aboutsummaryrefslogtreecommitdiffstats
path: root/yql
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-11-20 17:37:57 +0000
committerGitHub <noreply@github.com>2024-11-20 17:37:57 +0000
commitf76323e9b295c15751e51e3443aa47a36bee8023 (patch)
tree4113c8cad473a33e0f746966e0cf087252fa1d7a /yql
parent753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff)
parenta7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff)
downloadydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql')
-rw-r--r--yql/essentials/cfg/tests/fs.conf6
-rw-r--r--yql/essentials/cfg/tests/fs_arc.conf1
-rw-r--r--yql/essentials/cfg/tests/gateways-experimental.conf26
-rw-r--r--yql/essentials/cfg/tests/gateways-forceblocks.conf5
-rw-r--r--yql/essentials/cfg/tests/gateways.conf245
-rw-r--r--yql/essentials/cfg/udf_test/fs.conf6
-rw-r--r--yql/essentials/cfg/udf_test/gateways-forceblocks.conf13
-rw-r--r--yql/essentials/cfg/udf_test/gateways.conf10
-rw-r--r--yql/essentials/core/common_opt/yql_flatmap_over_join.cpp36
-rw-r--r--yql/essentials/core/ut/ya.make2
-rw-r--r--yql/essentials/parser/pg_wrapper/test/test_doc.py2
-rw-r--r--yql/essentials/parser/pg_wrapper/test/ya.make4
-rw-r--r--yql/essentials/tests/common/test_framework/conftest.py14
-rw-r--r--yql/essentials/tests/common/test_framework/solomon_runner.py40
-rw-r--r--yql/essentials/tests/common/test_framework/test_file_common.py155
-rw-r--r--yql/essentials/tests/common/test_framework/test_utils.py269
-rw-r--r--yql/essentials/tests/common/test_framework/udfs_deps/ya.make51
-rw-r--r--yql/essentials/tests/common/test_framework/ya.make32
-rw-r--r--yql/essentials/tests/common/test_framework/yql_http_file_server.py136
-rw-r--r--yql/essentials/tests/common/test_framework/yql_ports.py43
-rw-r--r--yql/essentials/tests/common/test_framework/yql_utils.py1043
-rw-r--r--yql/essentials/tests/common/test_framework/yqlrun.py346
-rw-r--r--yql/essentials/tests/common/udf_test/test.py111
-rw-r--r--yql/essentials/tests/common/udf_test/ya.make9
-rw-r--r--yql/essentials/tests/common/ya.make5
-rw-r--r--yql/essentials/tests/postgresql/README.md10
-rw-r--r--yql/essentials/tests/postgresql/cases/aggregates.err3402
-rw-r--r--yql/essentials/tests/postgresql/cases/aggregates.out738
-rw-r--r--yql/essentials/tests/postgresql/cases/aggregates.sql196
-rw-r--r--yql/essentials/tests/postgresql/cases/alter_table.err3455
-rw-r--r--yql/essentials/tests/postgresql/cases/alter_table.out284
-rw-r--r--yql/essentials/tests/postgresql/cases/alter_table.sql273
-rw-r--r--yql/essentials/tests/postgresql/cases/arrays.err3399
-rw-r--r--yql/essentials/tests/postgresql/cases/arrays.out771
-rw-r--r--yql/essentials/tests/postgresql/cases/arrays.sql207
-rw-r--r--yql/essentials/tests/postgresql/cases/bit.err498
-rw-r--r--yql/essentials/tests/postgresql/cases/bit.out491
-rw-r--r--yql/essentials/tests/postgresql/cases/bit.sql115
-rw-r--r--yql/essentials/tests/postgresql/cases/boolean.err510
-rw-r--r--yql/essentials/tests/postgresql/cases/boolean.out469
-rw-r--r--yql/essentials/tests/postgresql/cases/boolean.sql148
-rw-r--r--yql/essentials/tests/postgresql/cases/case.err469
-rw-r--r--yql/essentials/tests/postgresql/cases/case.out269
-rw-r--r--yql/essentials/tests/postgresql/cases/case.sql127
-rw-r--r--yql/essentials/tests/postgresql/cases/char.err101
-rw-r--r--yql/essentials/tests/postgresql/cases/char.err.1101
-rw-r--r--yql/essentials/tests/postgresql/cases/char.err.2101
-rw-r--r--yql/essentials/tests/postgresql/cases/char.out41
-rw-r--r--yql/essentials/tests/postgresql/cases/char.sql31
-rw-r--r--yql/essentials/tests/postgresql/cases/comments.err49
-rw-r--r--yql/essentials/tests/postgresql/cases/comments.out65
-rw-r--r--yql/essentials/tests/postgresql/cases/comments.sql35
-rw-r--r--yql/essentials/tests/postgresql/cases/create_misc.err579
-rw-r--r--yql/essentials/tests/postgresql/cases/create_misc.out24
-rw-r--r--yql/essentials/tests/postgresql/cases/create_misc.sql24
-rw-r--r--yql/essentials/tests/postgresql/cases/create_table.err2898
-rw-r--r--yql/essentials/tests/postgresql/cases/create_table.out213
-rw-r--r--yql/essentials/tests/postgresql/cases/create_table.sql203
-rw-r--r--yql/essentials/tests/postgresql/cases/date.err1319
-rw-r--r--yql/essentials/tests/postgresql/cases/date.out1105
-rw-r--r--yql/essentials/tests/postgresql/cases/date.sql246
-rw-r--r--yql/essentials/tests/postgresql/cases/dbsize.err291
-rw-r--r--yql/essentials/tests/postgresql/cases/dbsize.out110
-rw-r--r--yql/essentials/tests/postgresql/cases/dbsize.sql33
-rw-r--r--yql/essentials/tests/postgresql/cases/delete.err52
-rw-r--r--yql/essentials/tests/postgresql/cases/delete.out9
-rw-r--r--yql/essentials/tests/postgresql/cases/delete.sql9
-rw-r--r--yql/essentials/tests/postgresql/cases/expressions.err591
-rw-r--r--yql/essentials/tests/postgresql/cases/expressions.out83
-rw-r--r--yql/essentials/tests/postgresql/cases/expressions.sql43
-rw-r--r--yql/essentials/tests/postgresql/cases/float4.err854
-rw-r--r--yql/essentials/tests/postgresql/cases/float4.out434
-rw-r--r--yql/essentials/tests/postgresql/cases/float4.sql105
-rw-r--r--yql/essentials/tests/postgresql/cases/float8.err1188
-rw-r--r--yql/essentials/tests/postgresql/cases/float8.out840
-rw-r--r--yql/essentials/tests/postgresql/cases/float8.sql208
-rw-r--r--yql/essentials/tests/postgresql/cases/functional_deps.err656
-rw-r--r--yql/essentials/tests/postgresql/cases/functional_deps.out46
-rw-r--r--yql/essentials/tests/postgresql/cases/functional_deps.sql42
-rw-r--r--yql/essentials/tests/postgresql/cases/horology.err1689
-rw-r--r--yql/essentials/tests/postgresql/cases/horology.out506
-rw-r--r--yql/essentials/tests/postgresql/cases/horology.sql151
-rw-r--r--yql/essentials/tests/postgresql/cases/insert.err2670
-rw-r--r--yql/essentials/tests/postgresql/cases/insert.out25
-rw-r--r--yql/essentials/tests/postgresql/cases/insert.sql25
-rw-r--r--yql/essentials/tests/postgresql/cases/int2.err304
-rw-r--r--yql/essentials/tests/postgresql/cases/int2.out308
-rw-r--r--yql/essentials/tests/postgresql/cases/int2.sql75
-rw-r--r--yql/essentials/tests/postgresql/cases/int4.err474
-rw-r--r--yql/essentials/tests/postgresql/cases/int4.out401
-rw-r--r--yql/essentials/tests/postgresql/cases/int4.sql103
-rw-r--r--yql/essentials/tests/postgresql/cases/int8.err977
-rw-r--r--yql/essentials/tests/postgresql/cases/int8.out792
-rw-r--r--yql/essentials/tests/postgresql/cases/int8.sql163
-rw-r--r--yql/essentials/tests/postgresql/cases/interval.err998
-rw-r--r--yql/essentials/tests/postgresql/cases/interval.out630
-rw-r--r--yql/essentials/tests/postgresql/cases/interval.sql163
-rw-r--r--yql/essentials/tests/postgresql/cases/join.err5097
-rw-r--r--yql/essentials/tests/postgresql/cases/join.out608
-rw-r--r--yql/essentials/tests/postgresql/cases/join.sql398
-rw-r--r--yql/essentials/tests/postgresql/cases/json.err3999
-rw-r--r--yql/essentials/tests/postgresql/cases/json.out999
-rw-r--r--yql/essentials/tests/postgresql/cases/json.sql271
-rw-r--r--yql/essentials/tests/postgresql/cases/json_encoding.err337
-rw-r--r--yql/essentials/tests/postgresql/cases/json_encoding.out255
-rw-r--r--yql/essentials/tests/postgresql/cases/json_encoding.sql55
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb.err6964
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb.out2987
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb.sql627
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb_jsonpath.err3233
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb_jsonpath.out533
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonb_jsonpath.sql93
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath.err743
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath.out896
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath.sql153
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath_encoding.err278
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath_encoding.out173
-rw-r--r--yql/essentials/tests/postgresql/cases/jsonpath_encoding.sql42
-rw-r--r--yql/essentials/tests/postgresql/cases/limit.err689
-rw-r--r--yql/essentials/tests/postgresql/cases/limit.out164
-rw-r--r--yql/essentials/tests/postgresql/cases/limit.sql52
-rw-r--r--yql/essentials/tests/postgresql/cases/name.err320
-rw-r--r--yql/essentials/tests/postgresql/cases/name.out126
-rw-r--r--yql/essentials/tests/postgresql/cases/name.sql30
-rw-r--r--yql/essentials/tests/postgresql/cases/numeric.err4177
-rw-r--r--yql/essentials/tests/postgresql/cases/numeric.out2383
-rw-r--r--yql/essentials/tests/postgresql/cases/numeric.sql955
-rw-r--r--yql/essentials/tests/postgresql/cases/numerology.err141
-rw-r--r--yql/essentials/tests/postgresql/cases/numerology.out56
-rw-r--r--yql/essentials/tests/postgresql/cases/numerology.sql42
-rw-r--r--yql/essentials/tests/postgresql/cases/oid.err176
-rw-r--r--yql/essentials/tests/postgresql/cases/oid.out122
-rw-r--r--yql/essentials/tests/postgresql/cases/oid.sql32
-rw-r--r--yql/essentials/tests/postgresql/cases/select.err656
-rw-r--r--yql/essentials/tests/postgresql/cases/select.out204
-rw-r--r--yql/essentials/tests/postgresql/cases/select.sql52
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct.err386
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct.out48
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct.sql20
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct_on.err42
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct_on.out7
-rw-r--r--yql/essentials/tests/postgresql/cases/select_distinct_on.sql2
-rw-r--r--yql/essentials/tests/postgresql/cases/select_having.err110
-rw-r--r--yql/essentials/tests/postgresql/cases/select_having.err.1110
-rw-r--r--yql/essentials/tests/postgresql/cases/select_having.err.2110
-rw-r--r--yql/essentials/tests/postgresql/cases/select_having.out84
-rw-r--r--yql/essentials/tests/postgresql/cases/select_having.sql36
-rw-r--r--yql/essentials/tests/postgresql/cases/select_implicit.err293
-rw-r--r--yql/essentials/tests/postgresql/cases/select_implicit.err.1293
-rw-r--r--yql/essentials/tests/postgresql/cases/select_implicit.err.2293
-rw-r--r--yql/essentials/tests/postgresql/cases/select_implicit.out245
-rw-r--r--yql/essentials/tests/postgresql/cases/select_implicit.sql77
-rw-r--r--yql/essentials/tests/postgresql/cases/select_into.err543
-rw-r--r--yql/essentials/tests/postgresql/cases/select_into.out4
-rw-r--r--yql/essentials/tests/postgresql/cases/select_into.sql4
-rw-r--r--yql/essentials/tests/postgresql/cases/strings.err2139
-rw-r--r--yql/essentials/tests/postgresql/cases/strings.out1691
-rw-r--r--yql/essentials/tests/postgresql/cases/strings.sql423
-rw-r--r--yql/essentials/tests/postgresql/cases/subselect.err2054
-rw-r--r--yql/essentials/tests/postgresql/cases/subselect.out397
-rw-r--r--yql/essentials/tests/postgresql/cases/subselect.sql238
-rw-r--r--yql/essentials/tests/postgresql/cases/text.err464
-rw-r--r--yql/essentials/tests/postgresql/cases/text.out311
-rw-r--r--yql/essentials/tests/postgresql/cases/text.sql72
-rw-r--r--yql/essentials/tests/postgresql/cases/time.err244
-rw-r--r--yql/essentials/tests/postgresql/cases/time.out127
-rw-r--r--yql/essentials/tests/postgresql/cases/time.sql38
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamp.err895
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamp.out296
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamp.sql180
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamptz.err2525
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamptz.out264
-rw-r--r--yql/essentials/tests/postgresql/cases/timestamptz.sql158
-rw-r--r--yql/essentials/tests/postgresql/cases/timetz.err391
-rw-r--r--yql/essentials/tests/postgresql/cases/timetz.out106
-rw-r--r--yql/essentials/tests/postgresql/cases/timetz.sql29
-rw-r--r--yql/essentials/tests/postgresql/cases/truncate.err1273
-rw-r--r--yql/essentials/tests/postgresql/cases/truncate.out87
-rw-r--r--yql/essentials/tests/postgresql/cases/truncate.sql53
-rw-r--r--yql/essentials/tests/postgresql/cases/unicode.err125
-rw-r--r--yql/essentials/tests/postgresql/cases/unicode.out31
-rw-r--r--yql/essentials/tests/postgresql/cases/unicode.sql15
-rw-r--r--yql/essentials/tests/postgresql/cases/union.err1436
-rw-r--r--yql/essentials/tests/postgresql/cases/union.out465
-rw-r--r--yql/essentials/tests/postgresql/cases/union.sql132
-rw-r--r--yql/essentials/tests/postgresql/cases/update.err2332
-rw-r--r--yql/essentials/tests/postgresql/cases/update.out49
-rw-r--r--yql/essentials/tests/postgresql/cases/update.sql43
-rw-r--r--yql/essentials/tests/postgresql/cases/uuid.err209
-rw-r--r--yql/essentials/tests/postgresql/cases/uuid.out129
-rw-r--r--yql/essentials/tests/postgresql/cases/uuid.sql55
-rw-r--r--yql/essentials/tests/postgresql/cases/varchar.err93
-rw-r--r--yql/essentials/tests/postgresql/cases/varchar.err.193
-rw-r--r--yql/essentials/tests/postgresql/cases/varchar.err.293
-rw-r--r--yql/essentials/tests/postgresql/cases/varchar.out55
-rw-r--r--yql/essentials/tests/postgresql/cases/varchar.sql31
-rw-r--r--yql/essentials/tests/postgresql/cases/window.err3837
-rw-r--r--yql/essentials/tests/postgresql/cases/window.out715
-rw-r--r--yql/essentials/tests/postgresql/cases/window.sql193
-rw-r--r--yql/essentials/tests/postgresql/cases/xml.err2054
-rw-r--r--yql/essentials/tests/postgresql/cases/xml.err.12054
-rw-r--r--yql/essentials/tests/postgresql/cases/xml.err.22054
-rw-r--r--yql/essentials/tests/postgresql/cases/xml.out79
-rw-r--r--yql/essentials/tests/postgresql/cases/xml.sql21
-rw-r--r--yql/essentials/tests/postgresql/common/__init__.py129
-rw-r--r--yql/essentials/tests/postgresql/common/differ.py91
-rw-r--r--yql/essentials/tests/postgresql/common/ya.make8
-rw-r--r--yql/essentials/tests/postgresql/initscripts/aggtest.sql11
-rw-r--r--yql/essentials/tests/postgresql/initscripts/char_tbl.sql7
-rw-r--r--yql/essentials/tests/postgresql/initscripts/date_tbl.sql19
-rw-r--r--yql/essentials/tests/postgresql/initscripts/emp.sql14
-rw-r--r--yql/essentials/tests/postgresql/initscripts/equipment_r_0.sql5
-rw-r--r--yql/essentials/tests/postgresql/initscripts/float8_tbl.sql13
-rw-r--r--yql/essentials/tests/postgresql/initscripts/hobbies_r_0.sql5
-rw-r--r--yql/essentials/tests/postgresql/initscripts/int2_tbl.sql12
-rw-r--r--yql/essentials/tests/postgresql/initscripts/int4_tbl.sql13
-rw-r--r--yql/essentials/tests/postgresql/initscripts/int8_tbl.sql8
-rw-r--r--yql/essentials/tests/postgresql/initscripts/interval_tbl.sql13
-rw-r--r--yql/essentials/tests/postgresql/initscripts/onek.sql1021
-rw-r--r--yql/essentials/tests/postgresql/initscripts/onek2.sql1021
-rw-r--r--yql/essentials/tests/postgresql/initscripts/road.sql5141
-rw-r--r--yql/essentials/tests/postgresql/initscripts/stud_emp.sql15
-rw-r--r--yql/essentials/tests/postgresql/initscripts/student.sql11
-rw-r--r--yql/essentials/tests/postgresql/initscripts/tenk1.sql10039
-rw-r--r--yql/essentials/tests/postgresql/initscripts/tenk2.sql10039
-rw-r--r--yql/essentials/tests/postgresql/initscripts/tenk2_0.sql19
-rw-r--r--yql/essentials/tests/postgresql/initscripts/testjsonb.sql1018
-rw-r--r--yql/essentials/tests/postgresql/initscripts/text_tbl.sql9
-rw-r--r--yql/essentials/tests/postgresql/initscripts/time_tbl.sql14
-rw-r--r--yql/essentials/tests/postgresql/initscripts/timestamp_tbl.sql142
-rw-r--r--yql/essentials/tests/postgresql/initscripts/timestamptz_tbl.sql78
-rw-r--r--yql/essentials/tests/postgresql/initscripts/timetz_tbl.sql34
-rw-r--r--yql/essentials/tests/postgresql/initscripts/tmp.sql1009
-rw-r--r--yql/essentials/tests/postgresql/initscripts/varchar_tbl.sql11
-rwxr-xr-xyql/essentials/tests/postgresql/make-tests.sh14
-rwxr-xr-xyql/essentials/tests/postgresql/original.sh2
-rw-r--r--yql/essentials/tests/postgresql/original/cases/aggregates.out2815
-rw-r--r--yql/essentials/tests/postgresql/original/cases/aggregates.sql1247
-rw-r--r--yql/essentials/tests/postgresql/original/cases/alter_table.out4593
-rw-r--r--yql/essentials/tests/postgresql/original/cases/alter_table.sql3030
-rw-r--r--yql/essentials/tests/postgresql/original/cases/arrays.out2436
-rw-r--r--yql/essentials/tests/postgresql/original/cases/arrays.sql740
-rw-r--r--yql/essentials/tests/postgresql/original/cases/bit.out748
-rw-r--r--yql/essentials/tests/postgresql/original/cases/bit.sql231
-rw-r--r--yql/essentials/tests/postgresql/original/cases/boolean.out559
-rw-r--r--yql/essentials/tests/postgresql/original/cases/boolean.sql262
-rw-r--r--yql/essentials/tests/postgresql/original/cases/case.out419
-rw-r--r--yql/essentials/tests/postgresql/original/cases/case.sql265
-rw-r--r--yql/essentials/tests/postgresql/original/cases/char.out122
-rw-r--r--yql/essentials/tests/postgresql/original/cases/char.sql75
-rw-r--r--yql/essentials/tests/postgresql/original/cases/char_1.out122
-rw-r--r--yql/essentials/tests/postgresql/original/cases/char_2.out122
-rw-r--r--yql/essentials/tests/postgresql/original/cases/comments.out65
-rw-r--r--yql/essentials/tests/postgresql/original/cases/comments.sql42
-rw-r--r--yql/essentials/tests/postgresql/original/cases/create_misc.out151
-rw-r--r--yql/essentials/tests/postgresql/original/cases/create_misc.sql217
-rw-r--r--yql/essentials/tests/postgresql/original/cases/create_table.out1321
-rw-r--r--yql/essentials/tests/postgresql/original/cases/create_table.sql977
-rw-r--r--yql/essentials/tests/postgresql/original/cases/date.out1497
-rw-r--r--yql/essentials/tests/postgresql/original/cases/date.sql366
-rw-r--r--yql/essentials/tests/postgresql/original/cases/dbsize.out188
-rw-r--r--yql/essentials/tests/postgresql/original/cases/dbsize.sql67
-rw-r--r--yql/essentials/tests/postgresql/original/cases/delete.out33
-rw-r--r--yql/essentials/tests/postgresql/original/cases/delete.sql25
-rw-r--r--yql/essentials/tests/postgresql/original/cases/expressions.out381
-rw-r--r--yql/essentials/tests/postgresql/original/cases/expressions.sql205
-rw-r--r--yql/essentials/tests/postgresql/original/cases/float4.out961
-rw-r--r--yql/essentials/tests/postgresql/original/cases/float4.sql354
-rw-r--r--yql/essentials/tests/postgresql/original/cases/float8.out1382
-rw-r--r--yql/essentials/tests/postgresql/original/cases/float8.sql500
-rw-r--r--yql/essentials/tests/postgresql/original/cases/functional_deps.out232
-rw-r--r--yql/essentials/tests/postgresql/original/cases/functional_deps.sql210
-rw-r--r--yql/essentials/tests/postgresql/original/cases/horology.out3344
-rw-r--r--yql/essentials/tests/postgresql/original/cases/horology.sql570
-rw-r--r--yql/essentials/tests/postgresql/original/cases/insert.out1004
-rw-r--r--yql/essentials/tests/postgresql/original/cases/insert.sql626
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int2.out312
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int2.sql118
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int4.out439
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int4.sql178
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int8.out934
-rw-r--r--yql/essentials/tests/postgresql/original/cases/int8.sql252
-rw-r--r--yql/essentials/tests/postgresql/original/cases/interval.out1045
-rw-r--r--yql/essentials/tests/postgresql/original/cases/interval.sql357
-rw-r--r--yql/essentials/tests/postgresql/original/cases/join.out6628
-rw-r--r--yql/essentials/tests/postgresql/original/cases/join.sql2325
-rw-r--r--yql/essentials/tests/postgresql/original/cases/json.out2638
-rw-r--r--yql/essentials/tests/postgresql/original/cases/json.sql852
-rw-r--r--yql/essentials/tests/postgresql/original/cases/json_encoding.out262
-rw-r--r--yql/essentials/tests/postgresql/original/cases/json_encoding.sql78
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonb.out5511
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonb.sql1484
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.out2539
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.sql587
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonpath.out964
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonpath.sql181
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.out180
-rw-r--r--yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.sql59
-rw-r--r--yql/essentials/tests/postgresql/original/cases/limit.out694
-rw-r--r--yql/essentials/tests/postgresql/original/cases/limit.sql201
-rw-r--r--yql/essentials/tests/postgresql/original/cases/name.out197
-rw-r--r--yql/essentials/tests/postgresql/original/cases/name.sql87
-rw-r--r--yql/essentials/tests/postgresql/original/cases/numeric.out3226
-rw-r--r--yql/essentials/tests/postgresql/original/cases/numeric.sql1365
-rw-r--r--yql/essentials/tests/postgresql/original/cases/numerology.out136
-rw-r--r--yql/essentials/tests/postgresql/original/cases/numerology.sql98
-rw-r--r--yql/essentials/tests/postgresql/original/cases/oid.out122
-rw-r--r--yql/essentials/tests/postgresql/original/cases/oid.sql43
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select.out973
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select.sql269
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_distinct.out308
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_distinct.sql137
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_distinct_on.out75
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_distinct_on.sql19
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_having.out93
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_having.sql50
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_having_1.out93
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_having_2.out93
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_implicit.out338
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_implicit.sql156
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_implicit_1.out338
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_implicit_2.out338
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_into.out222
-rw-r--r--yql/essentials/tests/postgresql/original/cases/select_into.sql138
-rw-r--r--yql/essentials/tests/postgresql/original/cases/strings.out2272
-rw-r--r--yql/essentials/tests/postgresql/original/cases/strings.sql761
-rw-r--r--yql/essentials/tests/postgresql/original/cases/subselect.out1859
-rw-r--r--yql/essentials/tests/postgresql/original/cases/subselect.sql939
-rw-r--r--yql/essentials/tests/postgresql/original/cases/text.out440
-rw-r--r--yql/essentials/tests/postgresql/original/cases/text.sql118
-rw-r--r--yql/essentials/tests/postgresql/original/cases/time.out200
-rw-r--r--yql/essentials/tests/postgresql/original/cases/time.sql72
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timestamp.out2081
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timestamp.sql386
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timestamptz.out2991
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timestamptz.sql567
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timetz.out233
-rw-r--r--yql/essentials/tests/postgresql/original/cases/timetz.sql79
-rw-r--r--yql/essentials/tests/postgresql/original/cases/truncate.out594
-rw-r--r--yql/essentials/tests/postgresql/original/cases/truncate.sql329
-rw-r--r--yql/essentials/tests/postgresql/original/cases/unicode.out89
-rw-r--r--yql/essentials/tests/postgresql/original/cases/unicode.sql34
-rw-r--r--yql/essentials/tests/postgresql/original/cases/union.out1434
-rw-r--r--yql/essentials/tests/postgresql/original/cases/union.sql542
-rw-r--r--yql/essentials/tests/postgresql/original/cases/update.out1028
-rw-r--r--yql/essentials/tests/postgresql/original/cases/update.sql669
-rw-r--r--yql/essentials/tests/postgresql/original/cases/uuid.out159
-rw-r--r--yql/essentials/tests/postgresql/original/cases/uuid.sql85
-rw-r--r--yql/essentials/tests/postgresql/original/cases/varchar.out111
-rw-r--r--yql/essentials/tests/postgresql/original/cases/varchar.sql66
-rw-r--r--yql/essentials/tests/postgresql/original/cases/varchar_1.out111
-rw-r--r--yql/essentials/tests/postgresql/original/cases/varchar_2.out111
-rw-r--r--yql/essentials/tests/postgresql/original/cases/window.out4065
-rw-r--r--yql/essentials/tests/postgresql/original/cases/window.sql1330
-rw-r--r--yql/essentials/tests/postgresql/original/cases/xml.out1570
-rw-r--r--yql/essentials/tests/postgresql/original/cases/xml.sql619
-rw-r--r--yql/essentials/tests/postgresql/original/cases/xml_1.out1417
-rw-r--r--yql/essentials/tests/postgresql/original/cases/xml_2.out1550
-rw-r--r--yql/essentials/tests/postgresql/patches/alter_table.out.patch112
-rw-r--r--yql/essentials/tests/postgresql/patches/alter_table.sql.patch73
-rw-r--r--yql/essentials/tests/postgresql/patches/create_table.out.patch96
-rw-r--r--yql/essentials/tests/postgresql/patches/create_table.sql.patch71
-rw-r--r--yql/essentials/tests/postgresql/patches/json.out.patch18
-rw-r--r--yql/essentials/tests/postgresql/patches/json.sql.patch15
-rw-r--r--yql/essentials/tests/postgresql/patches/json_encoding.out.patch16
-rw-r--r--yql/essentials/tests/postgresql/patches/json_encoding.sql.patch17
-rw-r--r--yql/essentials/tests/postgresql/patches/jsonb.out.patch18
-rw-r--r--yql/essentials/tests/postgresql/patches/jsonb.sql.patch15
-rw-r--r--yql/essentials/tests/postgresql/patches/jsonpath_encoding.out.patch16
-rw-r--r--yql/essentials/tests/postgresql/patches/jsonpath_encoding.sql.patch17
-rw-r--r--yql/essentials/tests/postgresql/patches/unicode.out.patch10
-rw-r--r--yql/essentials/tests/postgresql/patches/unicode.sql.patch11
-rw-r--r--yql/essentials/tests/postgresql/pg_tests.csv57
-rw-r--r--yql/essentials/tests/postgresql/status.md61
-rw-r--r--yql/essentials/tests/postgresql/status.old61
-rwxr-xr-xyql/essentials/tests/postgresql/test.sh2
-rw-r--r--yql/essentials/tests/postgresql/test_postgres.py20
-rw-r--r--yql/essentials/tests/postgresql/test_postgres_original.py20
-rw-r--r--yql/essentials/tests/postgresql/testinits.cfg20
-rwxr-xr-xyql/essentials/tests/postgresql/update-status.sh3
-rw-r--r--yql/essentials/tests/postgresql/ya.make49
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggrAdd.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggrCount.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggrMinMax.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFields.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFieldsUsingTuple.yql52
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroupByOneField.yql50
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateOptState.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateRead.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinct.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctUsingTuple.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctWithParents.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadWithParents.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateSameDistinct.yql107
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutGroup.yql55
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutTraits.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Bug1.yql69
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Bug2.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.yql58
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregate.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateUsingTuple.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateWithParents.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZero.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZeroOpt.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.cfg7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.yql168
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.cfg8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.yql254
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.sql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.yql73
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/Traits.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt10
-rw-r--r--yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/AndOverOptional.yql60
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Arithmetic.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticOverEmptyOptionals.yql80
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/BitLogical.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/BitLogicalOverEmptyOptionals.yql62
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/BitShifts.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/BitShiftsOverEmptyOptionals.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Cast.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/CastStruct.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Coalesce.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/CombineByKey.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Compare.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/CompareWithEmptyOptionals.yql69
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Concat.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Condense.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Condense1.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Contains.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Convert.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/DicItems.yql48
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembers.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembersOpt.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Enumerate.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Exists.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Extract.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/FilterAndSize.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembers.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional2.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Floats.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Fold.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Fold1.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Fold2Lambda.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/FromString.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/GroupByKey.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/HasItems.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/If.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/IfType.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/IfType.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/IntTypes.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Just.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideMap.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideReduce.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ListAppendPrependExtend.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Logical.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Lookup.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/MatchType.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/MatchType.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/MinMax.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/MinMaxOverOptional.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Nanvl.yql81
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/NotOverOptional.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Now.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Now.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Nth.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/OptionalIf.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/OptionalReduce.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/OrOverOptional.yql60
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Random.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Random.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Reverse.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Skip.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/SkipAfterTake.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Sort.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/SortBySubkeyInsideReduce.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Substring.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Take.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/TakeAfterSkip.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ToIndexDict.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/TryMember.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/TwoSkip.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/TwoTake.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/TypeConstructors.yql49
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/UnionAll.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Unwrap.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/XorOverOptional.yql60
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/Zip.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/ZipAll.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/default.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToEnormousList.yql9
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataFloatTypes.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataIntegralTypes.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataTypes.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDict.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverList.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverNull.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverOptional.yql52
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverStruct.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverTuple.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/AlterToOverVariant.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/DoAlterTo.yql.txt14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/HasNullFalse.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/HasNullTrue.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverDict.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverList.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverNull.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverOptional.yql76
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStream.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStruct.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverTuple.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverVariant.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverDict.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverList.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverNull.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverOptional.yql76
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverStruct.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverTuple.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverVariant.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals.yql55
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals2.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Casts/default.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/DataSinks.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/DataSources.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/PureCommit.cfg0
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/PureCommit.yql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.yql6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Config/default.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/Copy.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/Limit.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/TablePull.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/TableScheme.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt.attr33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/Bug2318.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/DropTable.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideType.yql52
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/OverrideWithSort.yql65
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/PredictSort.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.yql46
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmas.yql63
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/UseAndOverrideType.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt.attr9
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt.attr46
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.yql305
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.sql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.yql117
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.sql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/DoAllJoinsExceptCross.yql.txt48
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiConvertToCommonTypeAlias.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiCrossSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiExclusionSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3OptStr.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3Str.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnNoOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1NoOpt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOptPartial1OptPartial2Str.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerDiffIntTypes.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3OptStr.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3StrRename.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3OptStr.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypes.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypesTwoColumn.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3OptStr.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3OptStr.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3Str.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntSameDiff.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntTakeDiff.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStr.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStrRename.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnNoOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1NoOpt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne1.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne12.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne2.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasTwo.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOptPartial1OptPartial2Str.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.yql9
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftOnlySelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnNoOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1NoOpt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOptPartial1OptPartial2Str.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSemiSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfInt.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfStr.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightOnlySelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnNoOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1NoOpt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1Opt2Str.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOptPartial1OptPartial2Str.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSemiSelfStr.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/ExtractRenameFromFlatMapOverJoin.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner3.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInnerTwoColumns.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi3.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoin.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoinFat.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftUniqueRightMap.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoin.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoinFat.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueInnerMap.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftMap.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftSemiShardedMap.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3.yql79
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Alias12.yql71
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Rename.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne1.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne12.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne2.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasTwo12.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemDiffIntTypes.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1Opt2.yql48
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt2.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemRename.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumns.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1Opt2.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt2.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinMergeFields.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/SqlInToJoin.yql59
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiCrossSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiExclusionSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullTwoFieldsSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1EatOptSelf.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1Self.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1bSelf.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested2Self.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerTwoFieldsSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftOnlySelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSemiSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftTwoFieldsSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptFullSelf.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptInnerSelf.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptLeftSelf.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptRightSelf.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightOnlySelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSemiSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightTwoFieldsSelf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/default.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt.attr35
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt.attr35
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql9
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql9
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql9
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt54
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommon.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonKey2.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12Key2.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1Key2.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2Key2.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMap.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapKey2.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12Key2.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1Key2.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2Key2.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt.attr29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt.attr29
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Cross2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12u.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2u.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_123.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_1o2o3o.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_123.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_1o2o3o.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_12.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_1o2o.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_12.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_1o2o.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt11
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/default.cfg9
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt.attr46
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrdered.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedKey2.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12Key2.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1Key2.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2Key2.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt.attr31
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt.attr40
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt.attr31
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt.attr40
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinType.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeKey2.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12Key2.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1Key2.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2Key2.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/ConfigureFileFromUrl.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FileContent.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FilePath.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FilePathFromRoot.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/FolderPath.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/HomeFiles.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/RootFiles.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/another_file.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/default.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/file1.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/File/one_file.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/AggregateWithFilter.yql51
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/CloseRange.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/CloseRangeOnSortedInput.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/EmptyRange.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/EmptyRangeOnSortedInput.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/Equal.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/EqualOnSortedInput.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.yql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/OpenRange.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/OpenRangeOnSortedInput.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/PartialKey.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/PartialKey.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/RangeIntersection.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/RangeIntersectionOnSortedInput.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/partkey.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Filter/partkey.txt.attr13
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/GraceJoinCore_Flow.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/SelfJoinCore_Flow.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt.attr39
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql70
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/AccessDictOpt.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/AggrMinMaxTuple.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/BitCore.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ByteAt.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Collect.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/CompareNulls.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/CompareStruct.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/CompareStruct2.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/CompareTuple.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.sql36
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.yql572
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/CountBits.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Default.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Demux.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/DictOpt.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/DictOptTuple.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeContains.yql81
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeLookup.yql81
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ExtractMembers.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FilterNullMembers.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FilterWithLimit.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FlatMapFiltersSortedList.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FloatsIncDec.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FloatsMod.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Fold.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Fold1Map.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverPreservedStream.yql63
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverUnboundedPreservedStream.yql63
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/FoldMap.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ForwardList.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/GroupOpt.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/GroupOptTuple.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Guess.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Guess.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Hopping.yql51
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/IndexDictOpt.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Iterator.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/LMap.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ListExtendMany.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ListFromRangeForDates.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/MemberOpt.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Merge.yql47
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/MultiMap.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Mux.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/NthOpt.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/PartitionByKey.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/PartitionByKeySorted.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeys.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeysSorted.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Queue.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/QueueCheckDependent.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/QueueMixedTypes.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/QueueRangeWithPreservedStream.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/QueueSimpleStrings.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ReplaceMember.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Seq.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/SkipNullMembers.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/SortOpt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/SortOptTuple.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/SqlAccess.yql74
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StaticMap.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamDiscard.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamExtend.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamFilter.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamFlatMap.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamFold1Map.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamFoldMap.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamInCombineByKey.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamInGroupByKey.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamMap.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamSkip.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StreamTake.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StringContains.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/StringWith.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Switch.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/TimezoneIdName.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToBytes.yql82
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToDict.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToDictOpt.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToDictOptTuple.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToDictOverOptList.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/ToOptional.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Top.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/VariantItem.yql50
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Visit.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Visit.yql59
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Way.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/Way.yql50
-rw-r--r--yql/essentials/tests/s-expressions/suites/InMem/default.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft_Flow.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight_Flow.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_Flow.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_FlowOfTuples.yql54
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/EmptyLeftJoin.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/JoinInMem.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/JoinTypes.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/MapJoinCore.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings_Flow.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_Flow.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_FlowOfTuples.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Join/input3.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg.yql21
-rwxr-xr-xyql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If.yql22
-rwxr-xr-xyql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If_Opt.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_And.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Or.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Xor.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_And_Opt.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Or_Opt.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Xor_Opt.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Compare_By_Opts.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Compare_By_Opts.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Limit.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By_Opt.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By_Opt.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Max.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Min.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Some.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Some_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum.yql21
-rwxr-xr-xyql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If.yql22
-rwxr-xr-xyql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If_Opt.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_Opt.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Decode.sql4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Decode.yql72
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/Sqr.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Lib/default.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldProject.yql59
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldRead.yql58
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.cfg16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.yql58
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/ConcatSortedAndNonSorted.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/DupAndSort.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/DupByExtend.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/ExtendBetweenSorts.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterAfterExtend.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterBeforeExtend.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.cfg9
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableRange.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableStrictRange.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTwoTables.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfWeakConcatTables.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/ManyTableRange.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/MapThreeTables.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/MapTwoTables.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/Skip.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/SkipTakeThenMapTreeTables.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/SortTwoTables.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/SplitTableRange.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRange.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRangeStrict.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverStrictTableRange.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverTableRange.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.sql181
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.yql192
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.sql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.yql47
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenGroup.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenSort.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapCombineMap.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenExtend.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenGroup.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenSort.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapWithReadTable.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenMap.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenSort.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/TakeThenMap.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_1.yql85
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_2.yql86
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/default.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiIn.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiOut.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/MapOverDemux.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMap.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMixed.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverRead.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/OrderedPartitionByKeyWithMultiOut.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/PartitionByKeyWithMultiOut.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts1.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts2.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts3.yql43
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/WriteOverDemux.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/default.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt10
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.yql111
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.yql87
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/BinaryDataLiterals.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CloneStructure.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverJust.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverNothing.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverAnd.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverNot.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverOr.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemStruct.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemTuple.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemStruct.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemTuple.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense1.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold1.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ConsumeOrMoveForwardList.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DemuxOverExtend.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/DoubleSort.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivInsideNestedLambdaOuterDiffLevel.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivLambda.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOneLevel.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterDiffLevel.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterSameLevel.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodeInNestedLambda.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodesInLambdas.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExpandAddRemoveMember.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapExchange.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapOptimizeTablePath.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendTableWithLiteral.yql80
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.sql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.yql48
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverRead.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ExtractPredicateFromFlatmapOverListIf.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.yql38
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterCombineByKey.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterFilterNullMembers.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapBeforeCombineByKey.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapToExtractMembers.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapWithVariantItemAfterSwitch.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMax.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMin.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyStruct.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyTuple.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1IncrementAsLength.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemStruct.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemTuple.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OverOptional.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMax.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMin.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyStruct.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyTuple.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldIncrementAsLength.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemStruct.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemTuple.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseExtractMembers.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithExtractMembers.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithStreamLambda.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapsWithDependsOn.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithInnerVisit.yql59
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithOptionalIf.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.sql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.yql82
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.sql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.yql59
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.sql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.yql85
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/FuseMultipliersFlatmaps.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUnused.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUsed.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/HasItemsAfterEnumerate.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/IfOverNotPredicate.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/InjectExtractMembersOverSort.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/InnerLambda.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterAsList.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterEnumerate.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterList.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterMap.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MapNextWithUnusedNext.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.yql37
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverFlattenMembers.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverJustOrNothingWithNulls.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverConstSort.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverExtend.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverMapNext.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSkip.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort1.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort2.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverTake.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.sql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.yql83
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/NonEquivNestedLambdaOuterSameLevel.yql28
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.yql72
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.yql72
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilter.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilterRef.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/PushDownToFlow.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/ReverseAfterSort.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelectMembersOverOptStruct.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.sql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.sql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipAfterMap.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipOverExtend.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SkipWhileOverLiterals.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SortAfterReverse.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SortOfSortedDesc.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SubsetOfFields.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/SwitchToVisit.yql73
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeAfterMap.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterFilter.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.yql34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterSort.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverExtend.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverTop.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/TakeWhileOverLiterals.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Top.yql42
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedDesc.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedMix.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/UnusedColumnsAfterTake.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/UseEmptyDict.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/VariantItemOverVisit.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/Visit1.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/VisitAllEqualLambdas.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/VisitAsGuess.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/VisitOverVisit.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt.attr42
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt200
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt.attr11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Apply.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Empty.yql3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/ParseType.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Pickle.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullDict.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PullYson.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Pure.yql52
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Resource.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql29
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/Yson.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/def_values.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/dict.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/struct.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/yson.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/Bug635.yql46
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.yql4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.yql6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.yql6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.yql6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FieldNames.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/FieldNamesAndTypes.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt.attr34
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.yql7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt.attr8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt.attr8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt.attr8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt.attr9
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt.attr9
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.yql7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/MapDict.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/MapDict.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.yql5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValueAndMap.yql41
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortInts.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortTuples.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WriteNumbers.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.yql27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/dict.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/dict.txt.attr27
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/empty.txt0
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/empty.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/input.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt.attr3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt.attr14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt.attr13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Drop.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Fill.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FillWithCount.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/IteratorInMap.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LMapOverTable.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTableInsideMap.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTempTableInsideMap.yql30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapStream.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MissingColumn.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Skip.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SkipTakeThenMap.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt7
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/TableInsertCastList.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Take.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/default.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt3
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt0
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt.attr28
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program1.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program10.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program11.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program12.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program13.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program14.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program15.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program16.yql20
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program17.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program18.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program19.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program20.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program21.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program22.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program23.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program24.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt9
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program8.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program9.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/FilterTable.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/FilterWithFields.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/FilterWithTake.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/InsideCombine.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/InsideMap.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/InsideReduce.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/default.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input.txt8
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt.attr10
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt.attr28
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt20
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt15
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMap.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.sql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.yql206
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.sql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.yql302
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CachedUdfType.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CallableType.yql18
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CustomPython.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/CustomPython.yql24
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/NamedApply.yql66
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/NamedArgUdf.yql44
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapName.yql60
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapPos.yql56
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PartialCall.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PartialCall.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Percentiles.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Percentiles.yql45
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoField.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoField.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.yql57
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.yql31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.yql39
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.yql26
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.yql33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonSum.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/PythonSum.yql23
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.cfg5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.yql22
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.cfg7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.yql19
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.cfg6
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.yql25
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Sleep.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/Sleep.yql35
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TopFreq.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt16
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TopFreq.yql47
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/block_4_columns.csv7
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/default.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/file_3_columns.csv8
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input2.txt.attr31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input3.txt.attr31
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input4.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input4.txt.attr33
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input5.txt2
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input5.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt.attr5
-rw-r--r--yql/essentials/tests/s-expressions/suites/Udf/struct_4_fields.csv5
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql32
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DsvCount.yql50
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql53
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1Data.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/NoReadData.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/RawView.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/RawView.yql40
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql21
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql17
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg2
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql11
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql16
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/default.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input.txt.attr33
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input2.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input2.txt.attr37
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input3.txt4
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input3.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input4.txt10
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input4.txt.attr32
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input5.txt1
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input5.txt.attr30
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input6.txt10
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input6.txt.attr31
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input_view.txt10
-rw-r--r--yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr4
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.yql12
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureList.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureLongList.yql15
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureNonList.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureStructList.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureStructListWithFields.yql13
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.cfg3
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.yql10
-rw-r--r--yql/essentials/tests/s-expressions/suites/YtNative/default.cfg1
-rw-r--r--yql/essentials/tests/sql/sql2yql/canondata/result.json36962
-rw-r--r--yql/essentials/tests/sql/sql2yql/test_sql2yql.py64
-rw-r--r--yql/essentials/tests/sql/sql2yql/test_sql_format.py29
-rw-r--r--yql/essentials/tests/sql/sql2yql/test_sql_negative.py68
-rw-r--r--yql/essentials/tests/sql/sql2yql/ya.make44
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_and_table.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_table.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_table.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_use.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_use.sql10
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.sql20
-rw-r--r--yql/essentials/tests/sql/suites/action/action_nested_query.sql10
-rw-r--r--yql/essentials/tests/sql/suites/action/action_opt_args.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/action_udf_args.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/action_udf_args.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/closure_action.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/combine_subqueries_with_table_param.sql22
-rw-r--r--yql/essentials/tests/sql/suites/action/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/define_simple_action.sql10
-rw-r--r--yql/essentials/tests/sql/suites/action/dep_world_action_quote.sql20
-rw-r--r--yql/essentials/tests/sql/suites/action/dep_world_quote_code.sql31
-rw-r--r--yql/essentials/tests/sql/suites/action/discard.sql32
-rw-r--r--yql/essentials/tests/sql/suites/action/empty_do.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_anon_table.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_anon_table.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_asatom.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_astagged.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.sql7
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.sql7
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_capture.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_capture.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_code.sql22
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_code_nested.sql18
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_column.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_column.sql34
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_drop.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_drop.sql7
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_each_input_table.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_ensuretype.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_extract.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_filter.sql12
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder.sql5
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder_via_file.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder_via_file.sql18
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.sql25
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_for.sql21
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_for_over_subquery.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_if.sql18
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_if_guard.sql10
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_input_output_table.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_input_output_table.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.sql16
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_like.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_like.sql12
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.sql15
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_percentile.sql7
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_pragma.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_pragma.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python3_ann.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python3_ann.sql16
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python3_signature.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python3_signature.sql17
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python_signature.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_python_signature.sql17
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_range.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_range.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_regexp.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_regexp.sql11
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_resourcetype.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_result_label.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_result_label.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_sample.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_sample.sql7
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_skip_take.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_skip_take.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_table_with_view.sql6
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_taggedtype.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_type.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_typeof_output_table.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_typeof_output_table.sql25
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_unresolved_type_arg.sql25
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/eval_variant.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/evaluate_match_type.sql12
-rw-r--r--yql/essentials/tests/sql/suites/action/evaluate_pure.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/evaluate_pure.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/evaluate_queries.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/evaluate_queries.sql28
-rw-r--r--yql/essentials/tests/sql/suites/action/export_action.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/export_action.sql6
-rw-r--r--yql/essentials/tests/sql/suites/action/inline_action.sql16
-rw-r--r--yql/essentials/tests/sql/suites/action/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/action/input1.txt10
-rw-r--r--yql/essentials/tests/sql/suites/action/input_attrs.txt4
-rw-r--r--yql/essentials/tests/sql/suites/action/input_attrs.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_after_eval.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_after_eval.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_each_from_folder.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/insert_each_from_folder.sql19
-rw-r--r--yql/essentials/tests/sql/suites/action/lambda_arg_count.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/action/lib1.sql.txt7
-rw-r--r--yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.sql45
-rw-r--r--yql/essentials/tests/sql/suites/action/modify.txt2
-rw-r--r--yql/essentials/tests/sql/suites/action/modify.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/action/nested_action.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/nested_eval.sql25
-rw-r--r--yql/essentials/tests/sql/suites/action/nested_rewrite_io.sql22
-rw-r--r--yql/essentials/tests/sql/suites/action/nested_subquery.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/action/nested_subquery.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/no_columns_in_do.sqlx8
-rw-r--r--yql/essentials/tests/sql/suites/action/parallel_for.sql11
-rw-r--r--yql/essentials/tests/sql/suites/action/parallel_for_commit.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/action/parallel_for_select.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/action/parallel_for_values.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/action/pass_action_as_param.sql14
-rw-r--r--yql/essentials/tests/sql/suites/action/pass_subquery_as_param.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/pending_arg_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/pending_arg_fail.sql4
-rw-r--r--yql/essentials/tests/sql/suites/action/process_from_subquery_with_orderby.sql5
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_apply_quoted_code.sql21
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_for_select.sql44
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_format_free_args_code.sql6
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_format_type.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_if_select.sql29
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_make_code.sql15
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_parse_type.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_quote_code.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_repr_code.sql12
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_serialize_type.sql3
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_type_kind.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/runtime_type_splitmake.sql54
-rw-r--r--yql/essentials/tests/sql/suites/action/select_from_subquery_with_orderby.sql12
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery.sql21
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_accessnode.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_assumeorderby.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_extend_over_extend_for.sql11
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge1.sql25
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge2.sql17
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge_evaluate.sql16
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.sql16
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_merge_nested_world.sql15
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_opt_args.sql8
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_orderby0.sql13
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_orderby1.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/subquery_orderby2.sql9
-rw-r--r--yql/essentials/tests/sql/suites/action/table_content_before_from_folder.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/action/table_content_before_from_folder.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.sql6
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_decimal.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_interval.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_numeric.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_numeric_opt.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/avg_state_type.sql13
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/count.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/input.txt.attr30
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/max.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/min.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_column_subset.sql6
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_len_count.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_len_count_all.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_len_count_distinct.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_len_count_null.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_sum_divide_by_zero.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/opt_sum_null.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/pg_int4.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/pg_int8.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/pg_text.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/some_notnull.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/some_null.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_decimal.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_decimal_null.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_double.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_interval.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_signed.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_type.sql12
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_type_empty.sql13
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_type_group_by.sql14
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/sum_unsigned.sql7
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/table.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/agg_apply/table.sql5
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/avg.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/avg_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/avg_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count_all.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count_all_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count_all_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/count_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/max.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/max_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/max_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min_by.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min_by_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min_by_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/min_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/percentile.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/percentile_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/percentile_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/sum.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/sum_null.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases/sum_opt.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg_decimal.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_null.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_opt.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_null.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_opt.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/max.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/min.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_notnull.sql80
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_null.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_null.sql81
-rw-r--r--yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_opt.sql81
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/avg.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/avg_distinct_expr.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/avg_if.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/bitand.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/bitor.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/bitxor.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/booland.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/boolor.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/bottom.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/bottom_by.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/container.sql61
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/container_empty.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/corellation.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/count.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/count_if.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/def_value_full_table.sql63
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/def_value_with_keys.sql66
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/every.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/flatten.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/flatten.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/histogram.sql17
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/hll.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/input.txt.attr30
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/linear_histogram.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/list.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/list.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/log_histogram.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/logariphmic_histogram.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/max.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/max_by.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/median.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/min.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/min_by.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/mode.sql18
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi.sql22
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_list.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_list_distinct_expr.sql28
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_list_nulls.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_minmaxby.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_struct_nulls.sql23
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_tuple.sql23
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/multi_tuple_nulls.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/some.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/stddev.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/sum_if.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/top.sql23
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/top_by.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/transform_input.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/transform_output.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/udaf.sql26
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/udaf_distinct_expr.sql19
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/udaf_in_udaf.sql25
-rw-r--r--yql/essentials/tests/sql/suites/aggr_factory/variance.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/GroupByOneField.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/GroupByOneField.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.sql9
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_full_table_list.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_phases_table1.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_phases_table2.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/agg_phases_table3.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_by_column_lookup_in_const_dict.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_by_one_column.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr.sql9
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_groupby_expr.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_in_access_node_exprs.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_list.sql38
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_struct_access.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_distinct_list.sql32
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_list_in_key.sql26
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_key_column.sql9
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_list_in_key.sql62
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_subquery_yql_15869.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_const_yson_options.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_default_yson_options.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregation_and_order.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.sql43
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map.sql44
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map_compact.sql45
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_interval.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/avg_with_having.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/columns.txt8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/columns.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_by.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_by_nulls.sql19
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_tuple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compare_tuple.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/descending.txt2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/descending.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/ensure_count.sql1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/fail_group_by_struct_member.sqlx16
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_column.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping_and_expr.sql20
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_columns_reuse.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.sql9
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_where.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_full_path.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_and_having.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_columns.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_expr.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_join_aliases.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect.sql16
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect_asterisk.sql15
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.sql17
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.sql17
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.sql16
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_static.sql26
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_hop_static_list_key.sql26
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.sql17
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.sql17
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_rename.sql16
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_grouping.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_qualified.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.sql5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.sql6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_star.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_partition_by_grouping.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.sql13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.sql12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.sql20
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_tuple.sql64
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_only.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_only.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_star.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_session_star.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_by_with_where.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.sql38
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/having_cast.sql1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/having_without_aggregation.sqlx5
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/histogram_cdf.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input5.txt8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input5.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_coalesce.txt2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_compare.txt10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_dict.txt3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_dict.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_dsv.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_dsv.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_expr.txt10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_intersect_sorted.txt14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/input_tutorial_users.txt12
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_after_group.sql4
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_nullable.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_nullable.sql3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.sql21
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/listbuiltin_constness.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/null_type.sql24
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/parsetype_constness.sql7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentile_interval.sql38
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_containers.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_containers.sql16
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.sql8
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_input.txt10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.sql2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.sql10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/session1.txt27
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/session1.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/should_use_clone_for_bind_params.sqlx13
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/sorted.txt6
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/table_funcs_group_by.sql11
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/table_funcs_spec_aggregation.sqlx10
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/table_row_aggregation.sql14
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/yql-18511.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/yql-18511.sql70
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/basic_columns.sql5
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/escaped_udf_name.sql6
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/escaping.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/inplace_yql.sql8
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/join_using.sql5
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/order_by.sql5
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/string_escaping.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ansi_idents/struct_access.sql5
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/BigDates.txt31
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/BigDates.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt14
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt27
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/Signed.txt17
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/Signed.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/Unsigned.txt8
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/Unsigned.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/arithmetic.sql103
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/bitcast_date32.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/bitcast_datetime64.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/bitcast_interval64.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/bitcast_timestamp64.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/common_type.sql49
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/compare_big_big.sql26
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/compare_big_small.sql85
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/compare_small_big.sql85
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/const_date32.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/const_datetime64.sql19
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/const_interval64.sql35
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/const_timestamp64.sql39
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/default.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/explicit_cast.sql64
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/implicit_cast_callable.sql43
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/input_date32.sql15
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/input_datetime64.sql28
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/input_interval64.sql45
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/input_timestamp64.sql65
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/int_cast.sql53
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/int_literals.sql14
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/misc.sql27
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/output_date32.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/output_datetime64.sql13
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/output_interval64.sql11
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/output_timestamp64.sql13
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/presort.sql25
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/round.sql136
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_arithmetic.sql17
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_arithmetic_mul_div.sql35
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_arithmetic_narrow.sql25
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_arithmetic_sub.sql10
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_common_type.sql27
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_explicit_cast.sql29
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_int_cast.sql34
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_io.sql17
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-default.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-on.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-wo_compat.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter.sql110
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_native-default.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_native-on.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_native-wo_compat.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/table_yt_native.sql11
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz.txt1
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_bytes.sql11
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_fill.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_fill.sql12
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_pull.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_pull.sql6
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_rw.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_rw.sql6
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.sql62
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tzcasts.sql18
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tznumliterals.sql51
-rw-r--r--yql/essentials/tests/sql/suites/bigdate/tzstrliterals.sql48
-rw-r--r--yql/essentials/tests/sql/suites/binding/anon_table_binding.sql10
-rw-r--r--yql/essentials/tests/sql/suites/binding/bind_cast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/bind_select.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql27
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql16
-rw-r--r--yql/essentials/tests/sql/suites/binding/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/binding/drop_binding.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/binding/drop_binding.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/binding/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/binding/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/binding/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/binding/insert_binding.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/binding/insert_binding.sql7
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_callable.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_expr_input.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql7
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding.sql9
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql9
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_filter_binding.sql27
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql28
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_range_binding.sql46
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql46
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql17
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql17
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql18
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/add_bitcast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/div_bitcast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/mod_bitcast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/mul_bitcast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/bitcast_implicit/sub_bitcast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_decimal.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_decimal.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int16.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int16.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int32.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int32.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int64.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int64.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int8.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_int8.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint16.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint16.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint32.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint32.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64_opt.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint8.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/add_uint8.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/bitcast_block.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/bitcast_block.sql3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/bitcast_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/bitcast_scalar.sql3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.sql18
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types-v3.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt15
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt.attr182
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt15
-rw-r--r--yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt.attr77
-rw-r--r--yql/essentials/tests/sql/suites/blocks/boolean_ops.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/boolean_ops.sql27
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_bools.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_bools.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_complex.sql37
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_ints.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_ints.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg.sql13
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_decimal.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_decimal.sql15
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_decimal_max.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max.sql19
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min.sql19
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_pg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_pg.sql17
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.sql14
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_some.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_some.sql19
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum.sql12
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_count.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_count.sql12
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_max.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_max.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_min.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_min.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.sql18
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_set.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_set.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_some.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_some.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.sql11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.sql46
-rw-r--r--yql/essentials/tests/sql/suites/blocks/compare.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/compare.sql24
-rw-r--r--yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.sql59
-rw-r--r--yql/essentials/tests/sql/suites/blocks/complex_scalars.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/complex_scalars.sql12
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_add_interval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_add_interval.sql31
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.sql57
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_equals.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_equals.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_equals_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_equals_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_greater_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_group_by.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_group_by.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_or_equal.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_or_equal.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_less_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_not_equals.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_not_equals.sql169
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.sql332
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub.sql165
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_interval.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_interval.sql31
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.sql58
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql326
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_top_sort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/date_top_sort.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/dates.txt1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/dates.txt.attr27
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_avg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_avg.sql8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_comparison.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_comparison.sql25
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.sql18
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_unary.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/decimal_unary.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.sql8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_pure_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_pure_all.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/div_uint64.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/div_uint64.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/exists.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/exists.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_direct_col.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_direct_col.sql1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_expr.sql1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_partial_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/filter_partial_expr.sql1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/group_by_complex_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/group_by_complex_key.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/if.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/if.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input1.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input1.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input2.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input2.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_allnums.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_allnums.txt.attr23
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bool.txt4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bool.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bools.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_bools.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_decimal.txt10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_decimal.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_double.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_double.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_exists.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_exists.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int16.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int16.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32_string.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int32_string.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int64.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int64.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int8.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_int8.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_json_document.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_json_document.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_nested.txt14
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_nested.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_pg.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_pg.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_strings.txt10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_strings.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt12
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_struct.txt9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_struct.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt.attr14
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_top.txt11
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_top.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_tuple.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_tuple.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint16.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint16.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint32.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint32.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt3
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint8.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint8.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_date.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_date.sql31
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.sql57
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_interval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_interval.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_div.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_div.sql22
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_div_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_div_scalar.sql41
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_mul.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_mul.sql40
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.sql79
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_sub_interval.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_sub_interval.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/json_document_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/json_document_type.sql8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.sql17
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.sql4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/member.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/member.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_strings.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_strings.sql21
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.sql17
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_tuple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/minmax_tuple.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mod_uint64.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mod_uint64.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/nested_optionals.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/nested_optionals.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/not.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/not.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/not_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/not_opt.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/partial_blocks1.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/partial_blocks1.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg.sql9
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_call.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_call.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_from_dates.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_from_dates.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_dates.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_dates.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_interval.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_interval.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_numbers.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_numbers.sql10
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_strings.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_to_strings.sql15
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_tofrom.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_tofrom.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_top_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/pg_top_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_one_asc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_one_asc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_one_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_one_desc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_asc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_asc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_desc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_mix.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sort_two_mix.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_as_agg_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_as_agg_key.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_filter.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_filter.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.sql42
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_pass.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_pass.sql6
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_with.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/string_with.sql22
-rw-r--r--yql/essentials/tests/sql/suites/blocks/struct_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/struct_type.sql8
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.sql7
-rw-r--r--yql/essentials/tests/sql/suites/blocks/tuple_nth.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/tuple_nth.sql16
-rw-r--r--yql/essentials/tests/sql/suites/blocks/tuple_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/blocks/tuple_type.sql5
-rw-r--r--yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.sql16
-rw-r--r--yql/essentials/tests/sql/suites/case/case_many_val.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_many_val.sql111
-rw-r--r--yql/essentials/tests/sql/suites/case/case_multi_val.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_opt_cond.sql5
-rw-r--r--yql/essentials/tests/sql/suites/case/case_opt_then.sql5
-rw-r--r--yql/essentials/tests/sql/suites/case/case_size_eq_cast.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_then_else.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_val_then_else.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_val_when_then.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/case_when_then.sql1
-rw-r--r--yql/essentials/tests/sql/suites/case/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/case/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce.sql1
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.sql24
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce_few_real.sql17
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce_sugar.sql3
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/coalesce_symmetry.sql11
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/input_coalesce.txt2
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/optional.txt1
-rw-r--r--yql/essentials/tests/sql/suites/coalesce/optional.txt.attr85
-rw-r--r--yql/essentials/tests/sql/suites/column_group/default.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-max.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-disable.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-single.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint.sql20
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_group/input.txt2
-rw-r--r--yql/essentials/tests/sql/suites/column_group/input.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length-perusage.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length-single.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_group/many_inserts.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/many_inserts.sql32
-rw-r--r--yql/essentials/tests/sql/suites/column_group/min_group.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish-single.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_order/align_publish.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/column_order/align_publish.sql10
-rw-r--r--yql/essentials/tests/sql/suites/column_order/align_publish_native.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/column_order/align_publish_native.sql12
-rw-r--r--yql/essentials/tests/sql/suites/column_order/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/column_order/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/column_order/input.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert.sql26
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_tmp.sql18
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_with_desc_sort_and_native_types.sql12
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.sql20
-rw-r--r--yql/essentials/tests/sql/suites/column_order/join.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/column_order/join.sql11
-rw-r--r--yql/essentials/tests/sql/suites/column_order/join_nosimple.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/column_order/join_nosimple.sql12
-rw-r--r--yql/essentials/tests/sql/suites/column_order/ordered_plus_native.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/column_order/ordered_plus_native.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_action.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_distinct_star.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_groupby_with_star.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_limit_offset.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_limit_offset_reorder.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_orderby.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_plain.sql16
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_plain_nosimple.sql17
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_sample.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_subquery.sql11
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_where.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/select_win_func.sql11
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all.sql15
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all_positional.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_order/values.sql10
-rw-r--r--yql/essentials/tests/sql/suites/column_order/winfunc.sql9
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/adjacent_to_point.sql85
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/decimal.sql13
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/huge_in.sql14
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/in.sql58
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/in2.sql29
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/in3.sql78
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/in_literal_nulls.sql13
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/merge_adjacent.sql43
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/multiply_limit.sql31
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/multiply_limit_for_single_key.sql15
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_dups.sql32
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_nulls.sql13
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/norange.sql21
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/pg_compare.sql35
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/pg_equal.sql22
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/pg_exists.sql20
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/pg_sqlin.sql23
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/pg_startswith.sql36
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/preserve_rest_predicates_order.sql17
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/repeated_keyranges_in_and.sql13
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/startswith.sql80
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/tuples_compare.sql46
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/tztypes.sql48
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/yql-12941.sql19
-rw-r--r--yql/essentials/tests/sql/suites/compute_range/yql-13489.sql18
-rw-r--r--yql/essentials/tests/sql/suites/count/avg_and_sum_by_value.txt4
-rw-r--r--yql/essentials/tests/sql/suites/count/boolean_count.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/boolean_count.sql3
-rw-r--r--yql/essentials/tests/sql/suites/count/count.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count.sql6
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all_grouped-empty.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all_grouped.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all_grouped.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all_view_concat.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_all_view_concat.sql3
-rw-r--r--yql/essentials/tests/sql/suites/count/count_by_nulls.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_by_nulls.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_const_no_grouping.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.sql3
-rw-r--r--yql/essentials/tests/sql/suites/count/count_input.txt5
-rw-r--r--yql/essentials/tests/sql/suites/count/count_input.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/count/count_no_grouping.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_nullable.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_nullable.sql1
-rw-r--r--yql/essentials/tests/sql/suites/count/count_nullable_sub.sql8
-rw-r--r--yql/essentials/tests/sql/suites/count/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/count/empty.txt1
-rw-r--r--yql/essentials/tests/sql/suites/count/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/count/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/count/input_intersect_with_holes.txt14
-rw-r--r--yql/essentials/tests/sql/suites/count/view_input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/count/view_input.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/csee/closure_in_l1_and_l2.sql12
-rw-r--r--yql/essentials/tests/sql/suites/csee/closure_in_l2_and_l1.sql12
-rw-r--r--yql/essentials/tests/sql/suites/csee/closure_l2.sql4
-rw-r--r--yql/essentials/tests/sql/suites/csee/complete_l2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/csee/const_body_diff_lambda.sql5
-rw-r--r--yql/essentials/tests/sql/suites/csee/const_body_same_lambda.sql5
-rw-r--r--yql/essentials/tests/sql/suites/csee/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/csee/expr.sql1
-rw-r--r--yql/essentials/tests/sql/suites/csee/expr_in_l0_and_l1.sql7
-rw-r--r--yql/essentials/tests/sql/suites/csee/expr_in_l1.sql6
-rw-r--r--yql/essentials/tests/sql/suites/csee/expr_in_l1_and_l0.sql7
-rw-r--r--yql/essentials/tests/sql/suites/csee/l2_dup_l1.sql9
-rw-r--r--yql/essentials/tests/sql/suites/csee/l2_dup_l1_many.sql9
-rw-r--r--yql/essentials/tests/sql/suites/csee/lambda_in_l0_and_l1.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/lambda_in_l1_and_l0.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2.sql12
-rw-r--r--yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2_unordered.sql12
-rw-r--r--yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1.sql12
-rw-r--r--yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1_unordered.sql13
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_closure_l2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_complete_l2.sql9
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_complete_l2_expr.sql9
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_free_closure_size2.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level_expr.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_free_closure_size2_expr.sql11
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_l1.sql5
-rw-r--r--yql/essentials/tests/sql/suites/csee/same_l1_expr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/csee/yql-7237.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/csee/yql-7237.sql68
-rw-r--r--yql/essentials/tests/sql/suites/datetime/all_timezones.sql7
-rw-r--r--yql/essentials/tests/sql/suites/datetime/current_date.sql5
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_arithmetic.sql26
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_bitcast.sql36
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_cast.sql97
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_convert.sql24
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_diff_compare.sql24
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_diff_sub.sql7
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_in.sql35
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_out.sql17
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_scale.sql7
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_types.sql15
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz.txt2
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_addremove.sql5
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_arithmetic.sql24
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_bitcast.sql27
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_bounds.sql17
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_bounds_scale.sql31
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_bytes.sql10
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_cast.sql47
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_compare_diff_zones.sql24
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_compare_gmt.sql42
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_compare_same_zones.sql42
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_expand_gmt.sql5
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.sql6
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_io.sql5
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_scale.sql14
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.sql12
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.sql12
-rw-r--r--yql/essentials/tests/sql/suites/datetime/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/datetime/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/distinct/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_and_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_and_join.sql8
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_by_tuple.sql2
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_columns.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_columns_after_group.sql4
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_count_and_avg.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_count_and_full_count.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_count_no_gouping.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_count_only.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_groupby.sql6
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_having_no_agg.sql6
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_join.sql8
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_list_after_group.sql3
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_one_count.sql1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_star.sql9
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_star1.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_star1.sql3
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_star_inmem.sql6
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_union_all.sql9
-rw-r--r--yql/essentials/tests/sql/suites/distinct/distinct_window.sql8
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input_dups.txt5
-rw-r--r--yql/essentials/tests/sql/suites/distinct/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.sql10
-rw-r--r--yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.sql10
-rw-r--r--yql/essentials/tests/sql/suites/dq/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/dq/dq_replicate_ok.sql6
-rw-r--r--yql/essentials/tests/sql/suites/dq/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.sql10
-rw-r--r--yql/essentials/tests/sql/suites/dq/list.txt4
-rw-r--r--yql/essentials/tests/sql/suites/dq/mem_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/dq/mem_limit.sql7
-rw-r--r--yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.sql8
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_asyncfile.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_asyncfile.sql5
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel.sql7
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.sql5
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.sql7
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_result.sql6
-rw-r--r--yql/essentials/tests/sql/suites/dq/precompute_tree.sql9
-rw-r--r--yql/essentials/tests/sql/suites/dq/read_cost.sql8
-rw-r--r--yql/essentials/tests/sql/suites/dq/read_cost_native.sql8
-rw-r--r--yql/essentials/tests/sql/suites/dq/truncate_local.sql3
-rw-r--r--yql/essentials/tests/sql/suites/dq/wrong_script.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/dq/wrong_script.sql13
-rw-r--r--yql/essentials/tests/sql/suites/dq/wrong_script_segf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/dq/wrong_script_segf.sql17
-rw-r--r--yql/essentials/tests/sql/suites/dq/wrong_script_timeout.sql14
-rw-r--r--yql/essentials/tests/sql/suites/epochs/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/epochs/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/epochs/modify.txt2
-rw-r--r--yql/essentials/tests/sql/suites/epochs/modify.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/epochs/read_modified.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/epochs/read_modified.sql17
-rw-r--r--yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.sql18
-rw-r--r--yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.sql21
-rw-r--r--yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.sql15
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_dict_dict_key.sql24
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_dict_implicit_cast.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_dict_list_key.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_dict_tuple_key.sql27
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_set.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_struct_0.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_struct_1.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_struct_2.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_struct_3.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_struct_syntax.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table.sql14
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_args.sqlx5
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_cluster.sqlx5
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_emptylist.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_emptylist.sql17
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_emptylist2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_hints.sqlx5
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_table_subquery.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_tuple_named.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_tuple_syntax.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_variant_enum.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/as_variant_enum_compare.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/backtick_escape.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/between.sql39
-rw-r--r--yql/essentials/tests/sql/suites/expr/callable.sql12
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_dynumber.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_from_utf8.sql7
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_longint.sql7
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_reverse_list.sql4
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_string_implicit.sql16
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_struct.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_type_bind.sql4
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_utf8.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/cast_variant.sql12
-rw-r--r--yql/essentials/tests/sql/suites/expr/checked_ops.sql21
-rw-r--r--yql/essentials/tests/sql/suites/expr/checked_ops_agg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/constraints_of.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/constraints_of.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/container_comp.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/convert_to_lambda_optional_args.sql7
-rw-r--r--yql/essentials/tests/sql/suites/expr/current_tz.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/decimal_bytes.sql14
-rw-r--r--yql/essentials/tests/sql/suites/expr/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/expr/dict_builtins.sql15
-rw-r--r--yql/essentials/tests/sql/suites/expr/dict_builtins_null_lookup.sql27
-rw-r--r--yql/essentials/tests/sql/suites/expr/dict_common_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/dict_common_type.sql15
-rw-r--r--yql/essentials/tests/sql/suites/expr/dict_comp.sql18
-rw-r--r--yql/essentials/tests/sql/suites/expr/distinct_from.sql11
-rw-r--r--yql/essentials/tests/sql/suites/expr/distinct_from_containers.sql18
-rw-r--r--yql/essentials/tests/sql/suites/expr/distinct_from_opt.sql13
-rw-r--r--yql/essentials/tests/sql/suites/expr/double.txt12
-rw-r--r--yql/essentials/tests/sql/suites/expr/double.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.sql18
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_dict_ops.sql19
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_iterator.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_iterator.sql20
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_iterator2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_iterator2.sql20
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_list_ops1.sql60
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_list_ops2.sql52
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_list_ops3.sql34
-rw-r--r--yql/essentials/tests/sql/suites/expr/empty_struct_tuple_types.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/ensure_ok.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/ensure_type_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/ensure_type_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/exapnd_with_singular_types.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_add_literal_nulls.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_cast.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_multiline_atoms.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_quotes.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_null.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_op_in_paren.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_trivial_named.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_yql_data.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_yql_from_string.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/expr_yql_function.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/extra_opt_try_member.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/extra_opt_try_member.sql22
-rw-r--r--yql/essentials/tests/sql/suites/expr/fallback_filternullelements.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/fallback_filternullmembers.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/flatmap_by_map_lazy_list.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/formattypediff.sql7
-rw-r--r--yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_if.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_listfromrange.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/inline_call.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/expr/inline_call.sql28
-rw-r--r--yql/essentials/tests/sql/suites/expr/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/expr/int_literals.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/int_literals_negative.sql14
-rw-r--r--yql/essentials/tests/sql/suites/expr/int_literals_negative_typed.sql19
-rw-r--r--yql/essentials/tests/sql/suites/expr/is_null.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/iterable.sql16
-rw-r--r--yql/essentials/tests/sql/suites/expr/lambda_as_optional_callable.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/lds_empty_cast.sql14
-rw-r--r--yql/essentials/tests/sql/suites/expr/lds_empty_compare.sql60
-rw-r--r--yql/essentials/tests/sql/suites/expr/lds_literal.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/lds_types.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/len.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/len.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/length_of_optional_set_intesection.sql1
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_builtins.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_builtins.sql70
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_builtins_opt.sql34
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_comp.sql70
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_concat.sql12
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_extend.sql13
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_flat_map_deprecated_opt.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_flatten.sql15
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_from_range.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_from_range_opt.sql26
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_from_range_overflow.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_indexof.sql13
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_not_null.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_replicate.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_replicate_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_replicate_fail.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_takeskipwhile.sql11
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_takeskipwhileinclusive.sql11
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_to_from_tuple.sql11
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_top_sort.sql32
-rw-r--r--yql/essentials/tests/sql/suites/expr/list_uniq.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/literal_list_element.sql4
-rw-r--r--yql/essentials/tests/sql/suites/expr/literal_strings.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/literal_strings_suffix.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/literal_struct_member.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/literal_true.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/longint_builtins.sql22
-rw-r--r--yql/essentials/tests/sql/suites/expr/many_opt_comp.sql104
-rw-r--r--yql/essentials/tests/sql/suites/expr/minmax_for_complex_types.sql19
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/expr/opt_list_map.sql26
-rw-r--r--yql/essentials/tests/sql/suites/expr/opt_try_member.sql23
-rw-r--r--yql/essentials/tests/sql/suites/expr/partial_columns_in_mem_aggr.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/pg_try_member.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/pg_try_member.sql29
-rw-r--r--yql/essentials/tests/sql/suites/expr/pickle.sql13
-rw-r--r--yql/essentials/tests/sql/suites/expr/replace_member.sql27
-rw-r--r--yql/essentials/tests/sql/suites/expr/sets.sql40
-rw-r--r--yql/essentials/tests/sql/suites/expr/static_fold.sql21
-rw-r--r--yql/essentials/tests/sql/suites/expr/static_zip.sql20
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_builtins.sql16
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_gather_spread.sql29
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_literal.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_literal.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_literal_bind.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_literal_members.sql5
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_merge.sql14
-rw-r--r--yql/essentials/tests/sql/suites/expr/struct_slice.sql9
-rw-r--r--yql/essentials/tests/sql/suites/expr/tagged_runtime.sql12
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_dict_from_nothing.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_dict_dict_key.sql40
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_dict_list_key.sql29
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_dict_tuple_key.sql81
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_dict_varstruct_key.sql34
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_dict_vartuple_key.sql34
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_set_dict_key.sql28
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_set_list_key.sql19
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_set_tuple_key.sql52
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_set_varstruct_key.sql24
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_hashed_set_vartuple_key.sql24
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_dict_list_key.sql16
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_dict_tuple_key.sql50
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_dict_vartuple_key.sql20
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_set_list_key.sql12
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_set_tuple_key.sql35
-rw-r--r--yql/essentials/tests/sql/suites/expr/to_sorted_set_vartuple_key.sql15
-rw-r--r--yql/essentials/tests/sql/suites/expr/try_member.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/try_member.sql53
-rw-r--r--yql/essentials/tests/sql/suites/expr/type_as_key.sql3
-rw-r--r--yql/essentials/tests/sql/suites/expr/tzdate_result.sql23
-rw-r--r--yql/essentials/tests/sql/suites/expr/udaf_with_list_zip.sql23
-rw-r--r--yql/essentials/tests/sql/suites/expr/unicode_literals.sql22
-rw-r--r--yql/essentials/tests/sql/suites/expr/untag.sql7
-rw-r--r--yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/expr/uuid.sql10
-rw-r--r--yql/essentials/tests/sql/suites/expr/uuid_order.sql36
-rw-r--r--yql/essentials/tests/sql/suites/expr/variant_list_sort.sql4
-rw-r--r--yql/essentials/tests/sql/suites/expr/variant_struct_comp.sql63
-rw-r--r--yql/essentials/tests/sql/suites/expr/variant_tuple_comp.sql74
-rw-r--r--yql/essentials/tests/sql/suites/expr/with_optional_args.sql8
-rw-r--r--yql/essentials/tests/sql/suites/expr/xor.sql17
-rw-r--r--yql/essentials/tests/sql/suites/expr/yql-10180.sql23
-rw-r--r--yql/essentials/tests/sql/suites/expr/yql-15485.sql86
-rw-r--r--yql/essentials/tests/sql/suites/file/bools.lst8
-rw-r--r--yql/essentials/tests/sql/suites/file/file_constness.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/file_constness.sql6
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_bools.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_bools.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_simple.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_simple.sql4
-rw-r--r--yql/essentials/tests/sql/suites/file/file_skip_take.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_skip_take.sql10
-rw-r--r--yql/essentials/tests/sql/suites/file/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/file/keyid.lst7
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql4
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_aster_opt.sql3
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_group_by_alias_collision.sql11
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.sql3
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_columns.sql10
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_columns_by_aggregate.sql16
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_columns_non_struct.sql6
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_columns_with_opt_struct.sql6
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_corr_name_column.sql15
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_dict.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_dict.sql13
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr.sql7
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.sql7
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.sql8
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_struct.sql12
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.sql7
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.sql8
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.sql22
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt9
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt.attr55
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.sql12
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql40
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.sql9
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.sql19
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_with_subquery.sql9
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/input_intersect_sorted.txt14
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt12
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/struct_with_wrong_correlation.sqlx10
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/struct_without_correlation.sql14
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/table_funcs_spec_flatten_by.sqlx10
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/typed_table.txt4
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/typed_table.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/basic.sql15
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/evaluate_expr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/flatten_by.sql8
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/functions.sql39
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/group_by.sql17
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/group_by2.sql18
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/inside_evaluate.sql11
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/struct_literals_vs_columns.sql9
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/text_and_bytes.sql18
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/unused_types.sql15
-rw-r--r--yql/essentials/tests/sql/suites/flexible_types/with_typeof.sql22
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/double_input.sql14
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/empty_out_hor_join.sql8
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/filters.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/filters.sql8
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1-outlimit.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.sql41
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2-outlimit.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.sql38
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage-outlimit.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.sql12
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_ranges.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_ranges.sql13
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_sampling.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_sampling.sql17
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_yamr.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/group_yamr.sql13
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/input.txt.attr30
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/input1.txt10
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/less_outs.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/less_outs.sql10
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/max_in_tables.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/max_in_tables.sql17
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/max_outtables.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/max_outtables.sql15
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.sql43
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.sql39
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.sql43
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/nonstrict.txt4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/nonstrict.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_hor_join.sql10
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_max_outtables.sql18
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_mem_limit.sql14
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_range.sql8
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_sampling.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_sampling.sql12
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/out_table_record.sql13
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.sql9
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/runtime_dep.sql15
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/skip_sampling.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/skip_sampling.sql14
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/skip_yamr.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/skip_yamr.sql10
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted_out.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted_out.sql17
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.sql18
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/table_record.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/table_record.sql11
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt4
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yield_off.sql23
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yield_on.sql20
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.sql13
-rw-r--r--yql/essentials/tests/sql/suites/hor_join/yql-6477_table_path.sql18
-rw-r--r--yql/essentials/tests/sql/suites/in/basic_in.sql13
-rw-r--r--yql/essentials/tests/sql/suites/in/default.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/in/empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/in/huge_in.sql2495
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi.sql23
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_dict.sql21
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_dict1.sql12
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_empty.sql17
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_join.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_join.sql52
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_list.sql22
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_list1.sql12
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_set.sql22
-rw-r--r--yql/essentials/tests/sql/suites/in/in_ansi_variant.sql25
-rw-r--r--yql/essentials/tests/sql/suites/in/in_compact_distinct-empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_compact_distinct.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_compact_distinct.sql6
-rw-r--r--yql/essentials/tests/sql/suites/in/in_enum_single0.sql1
-rw-r--r--yql/essentials/tests/sql/suites/in/in_enum_single1.sql2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.sql14
-rw-r--r--yql/essentials/tests/sql/suites/in/in_immediate_subquery.sql6
-rw-r--r--yql/essentials/tests/sql/suites/in/in_noansi.sql23
-rw-r--r--yql/essentials/tests/sql/suites/in/in_noansi_empty.sql17
-rw-r--r--yql/essentials/tests/sql/suites/in/in_noansi_join.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_noansi_join.sql52
-rw-r--r--yql/essentials/tests/sql/suites/in/in_noansi_list_dict.sql17
-rw-r--r--yql/essentials/tests/sql/suites/in/in_nonliteral_tuple.sql3
-rw-r--r--yql/essentials/tests/sql/suites/in/in_nonliteral_tuple_ansi.sql3
-rw-r--r--yql/essentials/tests/sql/suites/in/in_scalar_vector_subquery.sql29
-rw-r--r--yql/essentials/tests/sql/suites/in/in_sorted.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/in_sorted.sql7
-rw-r--r--yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.sql10
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.sql7
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql27
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tuple_table.sql4
-rw-r--r--yql/essentials/tests/sql/suites/in/in_types_cast.sql2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_types_cast_all.sql9
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_cast.sql8
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_list_dict.sql7
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs.sql2
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs_ansi.sql3
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals.sql29
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra.sql12
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra_ansi.sql12
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_opt_tuple.sql8
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_subquery_where.sqlx14
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_table_of_tuples.sql16
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_tuple.sql9
-rw-r--r--yql/essentials/tests/sql/suites/in/in_with_tuple_simple.sql5
-rw-r--r--yql/essentials/tests/sql/suites/in/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/in/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/in/input_optkey.txt21
-rw-r--r--yql/essentials/tests/sql/suites/in/input_optkey.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/in/input_optkey1.txt11
-rw-r--r--yql/essentials/tests/sql/suites/in/input_optkey1.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/in/input_with_tuples.txt3
-rw-r--r--yql/essentials/tests/sql/suites/in/input_with_tuples.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/large_in_YQL-19183.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/large_in_YQL-19183.sql10
-rw-r--r--yql/essentials/tests/sql/suites/in/optdict.txt6
-rw-r--r--yql/essentials/tests/sql/suites/in/optdict.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/small_in_YQL-19183.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/in/small_in_YQL-19183.sql5
-rw-r--r--yql/essentials/tests/sql/suites/in/sorted.txt6
-rw-r--r--yql/essentials/tests/sql/suites/in/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/in/yql-10038.sql18
-rw-r--r--yql/essentials/tests/sql/suites/in/yql-14677.sql10
-rw-r--r--yql/essentials/tests/sql/suites/insert/after_group_by.sql2
-rw-r--r--yql/essentials/tests/sql/suites/insert/anonymous_tables.sql14
-rw-r--r--yql/essentials/tests/sql/suites/insert/append-proto_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/append-view_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/insert/append-with_read_udf_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/append-with_view.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/append.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/append.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_after_replace.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_missing_null.sql14
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted.cfg9
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_calc.cfg9
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_desc.cfg9
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_sorted.cfg9
-rw-r--r--yql/essentials/tests/sql/suites/insert/append_sorted.sql25
-rw-r--r--yql/essentials/tests/sql/suites/insert/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.sql14
-rw-r--r--yql/essentials/tests/sql/suites/insert/drop_sortness-calc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/drop_sortness-desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/drop_sortness.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/drop_sortness.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.sql8
-rw-r--r--yql/essentials/tests/sql/suites/insert/from_two_sorted_by_calc.sql15
-rw-r--r--yql/essentials/tests/sql/suites/insert/inferschema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/insert/inferschema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/insert/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/input.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/insert/input2.txt1
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_proto.txt1
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_proto.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_view.txt3
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_view.txt.attr4
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_with_view.txt10
-rw-r--r--yql/essentials/tests/sql/suites/insert/input_with_view.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/insert/insert_from_other.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/insert_from_other.sql4
-rw-r--r--yql/essentials/tests/sql/suites/insert/insert_null.sql4
-rw-r--r--yql/essentials/tests/sql/suites/insert/insert_relabeled.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta-nonstrict_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta-proto_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta-view_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta-with_read_udf_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta-with_view.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/keepmeta.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert/literals_to_string.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/merge_publish.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/merge_publish.sql20
-rw-r--r--yql/essentials/tests/sql/suites/insert/multiappend_sorted.sql63
-rw-r--r--yql/essentials/tests/sql/suites/insert/other.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/other.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-from_sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-from_sorted_calc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-from_sorted_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-proto.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-view_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-with_read_udf.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/override-with_view.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/override.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/override.sql4
-rw-r--r--yql/essentials/tests/sql/suites/insert/part_sortness-desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/part_sortness.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/part_sortness.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert/read_schema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/insert/read_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_inferred.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_inferred.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_inferred_op.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_inferred_op.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_ordered_by_key.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/replace_ordered_by_key_desc.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_after_insert_relabeled.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_after_replace.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_after_replace_unwrap.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_operate_with_columns.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_operate_with_columns.sql4
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_relabel.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_subquery.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_subquery.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/select_with_sort_limit.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_calc.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_calc.txt.attr44
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_desc.txt10
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_desc.txt.attr47
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_empty.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_unique.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert/sorted_unique.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/insert/trivial_literals.sql2
-rw-r--r--yql/essentials/tests/sql/suites/insert/trivial_literals_multirow.sql4
-rw-r--r--yql/essentials/tests/sql/suites/insert/trivial_select.sql2
-rw-r--r--yql/essentials/tests/sql/suites/insert/two_input_tables.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert/two_input_tables.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/udf_empty.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/udf_empty.sql3
-rw-r--r--yql/essentials/tests/sql/suites/insert/unique_distinct_hints.cfg10
-rw-r--r--yql/essentials/tests/sql/suites/insert/unique_distinct_hints.sql15
-rw-r--r--yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.sql8
-rw-r--r--yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert/values_subquery.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/values_subquery.sql6
-rw-r--r--yql/essentials/tests/sql/suites/insert/yql-13083-existig.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/yql-13083.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert/yql-13083.sql32
-rw-r--r--yql/essentials/tests/sql/suites/insert/yql-14538.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert/yql-14538.sql18
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/default.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input1.txt2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input2.txt2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input3.txt1
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input4.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/several1.sql8
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/several2.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/aggr_diff_order.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/alias_where_group-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/alias_where_group.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/alias_where_group.sql16
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_dup-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_dup.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_dup.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.sql23
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodup-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/branch.txt15
-rw-r--r--yql/essentials/tests/sql/suites/join/branch.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in_in-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/bush_in_in_in.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables.sql16
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt14
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt.attr61
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt.attr34
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt5
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt.attr34
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt11
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt.attr50
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.sql17
-rw-r--r--yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/compact_join.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/compact_join.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem.sql40
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem2-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem2.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_check_key_mem2.sql16
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_key-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_key.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_key.sql31
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_key.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/convert_key.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/join/count_bans-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/count_bans.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/count_bans.sql45
-rw-r--r--yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/default.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/empty_dynamic.txt0
-rw-r--r--yql/essentials/tests/sql/suites/join/empty_dynamic.txt.attr22
-rw-r--r--yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_by_expr-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_by_expr.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_by_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_simple-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_simple.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_three_simple.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/filter_joined-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/filter_joined.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/filter_joined.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns1-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns1.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns1.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns2-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns2.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/flatten_columns2.sql20
-rw-r--r--yql/essentials/tests/sql/suites/join/force_merge_join.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/from_in_front_join-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/from_in_front_join.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/from_in_front_join.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_not_null-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_not_null.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_not_null.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_null-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_null.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/full_equal_null.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/full_join-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/full_join.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/full_join.sql19
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial_udf_call-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial_udf_call.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/full_trivial_udf_call.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/gj_countries1.txt25
-rw-r--r--yql/essentials/tests/sql/suites/join/gj_countries1.txt.attr18
-rw-r--r--yql/essentials/tests/sql/suites/join/gj_customers1.txt100
-rw-r--r--yql/essentials/tests/sql/suites/join/gj_customers1.txt.attr18
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join1-grace.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join1-map.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join1-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join1.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join1.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join2.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/grace_join2.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/group_compact_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/group_compact_by.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.sql23
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.sql22
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_null_key-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_null_key.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_null_key.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key.sql21
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key_any-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.sql21
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all_right-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all_right.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_all_right.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped_by_expr-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_on_key_only-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_on_key_only.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_on_key_only.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_table_and_view.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial_from_concat-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.sql3
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_order-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_order.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_order.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_select-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_select.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/inner_with_select.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/input.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/input1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input3.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input4.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input5.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input6.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input6.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/join/input7.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input8.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input8.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/join/input9.txt10
-rw-r--r--yql/essentials/tests/sql/suites/join/input9.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/join/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/join/input_left.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input_left.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/join/input_right.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/input_right.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/join/input_tutorial_users.txt12
-rw-r--r--yql/essentials/tests/sql/suites/join/join_and_distinct_key-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/join_and_distinct_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/join_and_distinct_key.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_and_distinct_key_without_correlation.sqlx6
-rw-r--r--yql/essentials/tests/sql/suites/join/join_cbo_3_tables.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/join_cbo_3_tables.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_common_table-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_common_table.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_common_table.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_inmem-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_inmem.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_inmem.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_map_table-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_map_table.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_comp_map_table.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/join_key_cmp_udf-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/join_key_cmp_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_key_cmp_udf.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/join_left_cbo.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_left_cbo.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/join_right_cbo.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_right_cbo.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/join_table_conflict_fail-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/join_table_conflict_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_table_conflict_fail.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.sqlx6
-rw-r--r--yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_column-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_column.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_column.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.sql22
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.sql18
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_names-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_names.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/join_without_correlation_names.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/kv1_sorted.txt32
-rw-r--r--yql/essentials/tests/sql/suites/join/kv1_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv1_sorted1.txt2
-rw-r--r--yql/essentials/tests/sql/suites/join/kv1_sorted1.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv2_sorted.txt22
-rw-r--r--yql/essentials/tests/sql/suites/join/kv2_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv2_sorted1.txt2
-rw-r--r--yql/essentials/tests/sql/suites/join/kv2_sorted1.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv3_sorted.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/kv3_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv4_sorted.txt18
-rw-r--r--yql/essentials/tests/sql/suites/join/kv4_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/kv5_sorted.txt13
-rw-r--r--yql/essentials/tests/sql/suites/join/kv5_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/leaf.txt17
-rw-r--r--yql/essentials/tests/sql/suites/join/leaf.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/join/left_all-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_all.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_all.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/left_cast_to_string-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_cast_to_string.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_cast_to_string.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input1.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input1.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input2.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input3.txt1
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_input3.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_null_column-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_null_column.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_null_column.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_with_self_aggr-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.sql51
-rw-r--r--yql/essentials/tests/sql/suites/join/left_null_literal-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/left_null_literal.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/left_null_literal.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_semi_and_other-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_semi_and_other.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_semi_and_other.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_with_other-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_with_other.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_only_with_other.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/left_semi_with_other-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_semi_with_other.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_semi_with_other.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/left_trivial-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/left_trivial.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/left_trivial.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.sql30
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.sql28
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug8533-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_not_selected-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_with_cache-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.sql19
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_dup_key-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_dup_key.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_dup_key.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence-off.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_left_null_column-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.sql16
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.sql23
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.sql18
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_sharded.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.sql20
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align1-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align1.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align1.sql26
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align2-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align2.sql22
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align3-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align3.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_align3.sql19
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_per_link-off.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.sql18
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_input1.txt20
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_input1.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_input2.txt5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_input2.txt.attr60
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_left_null_column-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.sql42
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner-off.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_small_primary-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_small_primary.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_small_primary.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.sql19
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.sql19
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_table_range-off.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/nested_semi_join-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/nested_semi_join.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/nested_semi_join.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side.sql20
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.sql24
-rw-r--r--yql/essentials/tests/sql/suites/join/order_of_qualified-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/order_of_qualified.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/order_of_qualified.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_cross-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_cross.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_cross.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_filter-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_filter.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_inner_filter.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_left_cross-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_left_cross.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_left_cross.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_semi-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_semi.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_common_semi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_context_dep-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_context_dep.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_context_dep.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_cross-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_cross.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_cross.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_inner-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_inner.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_inner.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_semi-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_semi.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_map_semi.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort1-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort2-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_inner-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_inner.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_inner.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_with_remap-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_with_remap.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_merge_with_remap.sql17
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_no_premap-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_no_premap.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_no_premap.sql27
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_context_dep-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_context_dep.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_context_dep.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_cross-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_cross.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_cross.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_exclusion-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_exclusion.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_exclusion.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_inner-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_inner.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_inner.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left_semi-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left_semi.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_left_semi.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_null_column-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_null_column.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_null_column.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_random-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_random.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_random.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_renaming-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_renaming.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_renaming.sql8
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_rownumber-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_rownumber.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pullup_rownumber.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_left-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.sql6
-rw-r--r--yql/essentials/tests/sql/suites/join/right_trivial-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/right_trivial.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/right_trivial.sql5
-rw-r--r--yql/essentials/tests/sql/suites/join/root.txt20
-rw-r--r--yql/essentials/tests/sql/suites/join/root.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-replicate.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.sql4
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.sql2
-rw-r--r--yql/essentials/tests/sql/suites/join/simple_columns_partial-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/simple_columns_partial.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/simple_columns_partial.sql23
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_k1.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_k1.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_k2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_k2.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key1.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key1.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key2.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key3.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key3.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key4.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key4.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt10
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt5
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt4
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt6
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq1.txt14
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq1.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq2.txt14
-rw-r--r--yql/essentials/tests/sql/suites/join/sorted_uniq2.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/join/spider_info.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/split_to_list_as_key-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/split_to_list_as_key.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/split_to_list_as_key.sql7
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_premap-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_premap.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_premap.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_mirror-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_mirror.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_mirror.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_multi-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_multi.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_multi.sql22
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly_premap-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly_premap.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_semionly_premap.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/starjoin_unused_keys.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/join/starjoin_unused_keys.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/strict_keys-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/strict_keys.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/strict_keys.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/table_funcs_spec_join.sqlx9
-rw-r--r--yql/essentials/tests/sql/suites/join/test_join_1.txt1000
-rw-r--r--yql/essentials/tests/sql/suites/join/test_join_2.txt100
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities_paren-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities_paren.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/three_equalities_paren.sql11
-rw-r--r--yql/essentials/tests/sql/suites/join/trivial_view-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/trivial_view.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/trivial_view.sql9
-rw-r--r--yql/essentials/tests/sql/suites/join/two_aggrs.sql18
-rw-r--r--yql/essentials/tests/sql/suites/join/uniqkeys.txt10
-rw-r--r--yql/essentials/tests/sql/suites/join/uniqkeys.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/join/view_input.txt3
-rw-r--r--yql/essentials/tests/sql/suites/join/view_input.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/join/vk1_sorted.txt32
-rw-r--r--yql/essentials/tests/sql/suites/join/vk1_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/vk2_sorted.txt22
-rw-r--r--yql/essentials/tests/sql/suites/join/vk2_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/vk3_sorted.txt8
-rw-r--r--yql/essentials/tests/sql/suites/join/vk3_sorted.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/join/wrong_order_by_col.sqlx16
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-12022-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-12022.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-12022.sql13
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_left-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_left.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_left.sql35
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_leftonly-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_leftonly.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14829_leftonly.sql35
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14847-off.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14847.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-14847.sql23
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-16011.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-16011.sql27
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-19081.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-19081.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-4275-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-4275.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-4275.sql10
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-4275.txt6
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-4275.txt.attr40
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6199-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6199.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6199.sql12
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6297-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6297.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-6297.sql21
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8125-off.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8125.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8125.sql29
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8131-off.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8131.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8131.sql14
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8980-off.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8980.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/join/yql-8980.sql15
-rw-r--r--yql/essentials/tests/sql/suites/join/yql_465-off.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/join/yql_465.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/join/yql_465.sql3
-rw-r--r--yql/essentials/tests/sql/suites/json/combination/nested.sql55
-rw-r--r--yql/essentials/tests/sql/suites/json/combination/unwrapped.sql9
-rw-r--r--yql/essentials/tests/sql/suites/json/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/example.txt6
-rw-r--r--yql/essentials/tests/sql/suites/json/example.txt.attr23
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/common_syntax.sql12
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/example.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/example.sql48
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt2
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt.attr23
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt2
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt.attr23
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/on_error.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.sql7
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/passing.sql102
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/passing_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_exists/passing_exception.sql14
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/common_syntax.sql12
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/example.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/example.sql47
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_empty.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.sql7
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_error.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_error_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/on_error_exception.sql7
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/passing.sql114
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/passing_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/passing_exception.sql15
-rw-r--r--yql/essentials/tests/sql/suites/json/json_query/wrapper.sql54
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/common_syntax.sql12
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/example.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/example.sql55
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_empty.sql30
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.sql6
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.sql6
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error.sql28
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.sql9
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.sql6
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/passing.sql102
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/passing_exception.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/passing_exception.sql14
-rw-r--r--yql/essentials/tests/sql/suites/json/json_value/returning.sql78
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/input.txt2
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/input.txt.attr23
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/insert.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/insert.sql5
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/json_exists.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/json_query.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/json_value.sql10
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/select.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/json/jsondocument/select.sql7
-rw-r--r--yql/essentials/tests/sql/suites/json/jsonpath/unicode.sql16
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.sql3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/calc_dependent.sql10
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/calc_dependent_with_tmp.sql11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/complex.sql3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/contains.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/contains_optional.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/contains_optional.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/contains_tuples.sql17
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/contains_tuples_no_keyfilter.sql14
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/convert.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/convert.sql5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/datetime.sql70
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/decimal.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/decimal.sql37
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dependent_value.sql3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dict_contains.sql2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.sql2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dynamic.txt7
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/dynamic.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/empty_range.cfg13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/empty_range.sql17
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/extend_over_map_with_same_schema.sql10
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_or_data.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_or_data.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_dbl.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_dbl.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_decimal.txt9
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_decimal.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.sql13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_flt.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_flt.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i16.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i16.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i32.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i32.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i64.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i64.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i8.txt5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_i8.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_str.txt4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_str.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt9
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui16.txt3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui16.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui32.txt3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui32.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui64.txt3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui64.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui8.txt3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_ui8.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_uuid.txt7
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/key_uuid.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.sql4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/large_ui64.txt4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/large_ui64.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.sql19
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/mixed_sort.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/mixed_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/multiusage.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/multiusage.sql31
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/nile_pred.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/nile_pred.sql1
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.sql8
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/num_key.txt13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/num_key.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/optional.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/optional.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.sql3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_passthrough.sql13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_type_adjust.sql13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/r1.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/r1.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/r2.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/r2.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/range_union.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/range_union.sql67
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/range_union_lower_excluded.sql2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/ranges.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/ranges.sql9
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted1.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted2.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted2.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted3.txt6
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted3.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/sorted4.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.sql10
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.sql10
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/string_with.sql5
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/string_with_ff.sql13
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/string_with_legacy.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/string_with_legacy.sql11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/tzdate.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/tzdate.sql35
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/utf8.txt9
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/utf8.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.sql15
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/uuid.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/uuid.sql41
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-14157.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-14157.sql12
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.sql16
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.sql4
-rw-r--r--yql/essentials/tests/sql/suites/key_filter/yql_5895_or.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lambda/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/lambda/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_brief.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_duplicate_arg.sqlx13
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_no_aggrs.sqlx9
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_no_arg.sql10
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_no_columns.sqlx9
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_arg.sqlx13
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_assign.sqlx13
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_opt_args.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_simple.sql13
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_udf.sql16
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_use_labmda_as_arg.sql14
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_with_tie.sql10
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.sql10
-rw-r--r--yql/essentials/tests/sql/suites/lambda/list_aggregate.sql18
-rw-r--r--yql/essentials/tests/sql/suites/lambda/list_aggregate_flatmap.sql18
-rw-r--r--yql/essentials/tests/sql/suites/library/agg.sql.txt7
-rw-r--r--yql/essentials/tests/sql/suites/library/forward_import.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/library/forward_import.sql16
-rw-r--r--yql/essentials/tests/sql/suites/library/lib.sql.txt6
-rw-r--r--yql/essentials/tests/sql/suites/library/lib1.sql.txt5
-rw-r--r--yql/essentials/tests/sql/suites/library/lib2.sql.txt3
-rw-r--r--yql/essentials/tests/sql/suites/library/library.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/library/library.sql6
-rw-r--r--yql/essentials/tests/sql/suites/library/library_alias.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/library/library_alias.sql4
-rw-r--r--yql/essentials/tests/sql/suites/library/library_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/library/library_udf.sql5
-rw-r--r--yql/essentials/tests/sql/suites/library/library_via_http.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/library/library_via_http.sql6
-rw-r--r--yql/essentials/tests/sql/suites/library/p_package_cluster.json1
-rw-r--r--yql/essentials/tests/sql/suites/library/package.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/library/package.sql9
-rw-r--r--yql/essentials/tests/sql/suites/library/package_bar.sql.txt7
-rw-r--r--yql/essentials/tests/sql/suites/library/package_bar_override.sql.txt7
-rw-r--r--yql/essentials/tests/sql/suites/library/package_foo.sql.txt7
-rw-r--r--yql/essentials/tests/sql/suites/library/package_override.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/library/package_override.sql8
-rw-r--r--yql/essentials/tests/sql/suites/library/package_total.sql.txt11
-rw-r--r--yql/essentials/tests/sql/suites/library/udf.sql.txt2
-rw-r--r--yql/essentials/tests/sql/suites/like/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/like/ilike_clause.sql2
-rw-r--r--yql/essentials/tests/sql/suites/like/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/like/like_clause.sql2
-rw-r--r--yql/essentials/tests/sql/suites/like/like_clause_escape.sql5
-rw-r--r--yql/essentials/tests/sql/suites/like/like_clause_no_pattern.sql9
-rw-r--r--yql/essentials/tests/sql/suites/like/like_escape.sql1
-rw-r--r--yql/essentials/tests/sql/suites/like/like_multiline.sql3
-rw-r--r--yql/essentials/tests/sql/suites/like/like_rewrite.sql11
-rw-r--r--yql/essentials/tests/sql/suites/like/regexp_clause.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/like/regexp_clause.sql4
-rw-r--r--yql/essentials/tests/sql/suites/limit/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic.txt7
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic_limit.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic_limit.sql6
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.sql19
-rw-r--r--yql/essentials/tests/sql/suites/limit/empty_input_after_limit.sql8
-rw-r--r--yql/essentials/tests/sql/suites/limit/empty_read_after_limit.sql3
-rw-r--r--yql/essentials/tests/sql/suites/limit/empty_sort_after_limit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/limit/empty_sort_calc_after_limit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/limit/empty_sort_desc_after_limit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/limit/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/limit/insert_with_limit-dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/limit/insert_with_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/limit/insert_with_limit.sql3
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit-dynamic.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit_offset.sql1
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.sql19
-rw-r--r--yql/essentials/tests/sql/suites/limit/limit_skip_take.sql2
-rw-r--r--yql/essentials/tests/sql/suites/limit/many_top_sorts.sql10
-rw-r--r--yql/essentials/tests/sql/suites/limit/sort_calc_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/limit/sort_calc_limit.sql8
-rw-r--r--yql/essentials/tests/sql/suites/limit/sorted_desc.txt10
-rw-r--r--yql/essentials/tests/sql/suites/limit/sorted_desc.txt.attr47
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-7900_empty_sorted_without_keys.sql11
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.sql45
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.sql31
-rw-r--r--yql/essentials/tests/sql/suites/limit/yql-9617_empty_lambda.sql7
-rw-r--r--yql/essentials/tests/sql/suites/limit/zero_limit.sql6
-rw-r--r--yql/essentials/tests/sql/suites/lineage/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/error_type.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/error_type.sql13
-rw-r--r--yql/essentials/tests/sql/suites/lineage/flatten_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/lineage/flatten_by.sql21
-rw-r--r--yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql19
-rw-r--r--yql/essentials/tests/sql/suites/lineage/flatten_where.sql11
-rw-r--r--yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql10
-rw-r--r--yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/lineage/grouping_sets.sql17
-rw-r--r--yql/essentials/tests/sql/suites/lineage/if_struct.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_list.txt3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_list.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_list_2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_optional.txt4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/isolated.sql8
-rw-r--r--yql/essentials/tests/sql/suites/lineage/join_as_struct.sql15
-rw-r--r--yql/essentials/tests/sql/suites/lineage/list_literal1.sql8
-rw-r--r--yql/essentials/tests/sql/suites/lineage/list_literal2.sql10
-rw-r--r--yql/essentials/tests/sql/suites/lineage/list_literal3.sql12
-rw-r--r--yql/essentials/tests/sql/suites/lineage/list_literal4.sql13
-rw-r--r--yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql18
-rw-r--r--yql/essentials/tests/sql/suites/lineage/process.sql8
-rw-r--r--yql/essentials/tests/sql/suites/lineage/reduce.sql7
-rw-r--r--yql/essentials/tests/sql/suites/lineage/reduce_all.sql8
-rw-r--r--yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql9
-rw-r--r--yql/essentials/tests/sql/suites/lineage/scalar_context.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/scalar_context.sql12
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_all.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_all_filter.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_field.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_field_filter.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql6
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_field_rename.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_join.sql5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_table_row.sql3
-rw-r--r--yql/essentials/tests/sql/suites/lineage/select_union_all.sql5
-rw-r--r--yql/essentials/tests/sql/suites/lineage/some_tablerow.sql6
-rw-r--r--yql/essentials/tests/sql/suites/lineage/topsort.sql8
-rw-r--r--yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql11
-rw-r--r--yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql9
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_asstruct.sql6
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_many.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_member_struct.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_one.sql2
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_session.sql4
-rw-r--r--yql/essentials/tests/sql/suites/lineage/window_tablerow.sql6
-rw-r--r--yql/essentials/tests/sql/suites/lineage/with_inline.sql8
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/after_match_skip_past_last_row.sql19
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/alerts-streaming.sql61
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/alerts.sql61
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/alerts_without_order.sql60
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/permute.sql35
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/simple_paritioning-streaming.sql45
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/simple_paritioning.sql46
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/test_type-streaming.sql75
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/test_type.sql76
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.sql18
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.sql5
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/and_absorption.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/and_absorption.sql9
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/coalesce_propagate.sql13
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.sql3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.sql5
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/constant_fold_minmax.sql19
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/default.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.sql8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.sql15
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.sql6
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.sql13
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input0.txt200
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input1.txt19
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input1.txt.attr42
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input3.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input3.txt.attr30
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input4.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input4.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input5.txt10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input5.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input_other.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input_other.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input_tutorial_users.txt12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input_view.txt21
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/input_view.txt.attr4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/instant_contains_lookup.sql3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/length_over_merge.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/length_over_merge.sql12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.sql14
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.sql8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.sql8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/opt_key.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/opt_key.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/or_absorption.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/or_absorption.sql8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/or_distributive.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/or_distributive.sql14
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/passthrough_sortness_over_map.sql31
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.sql12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.sql4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.sql19
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_prefix_keys.sql14
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_same_keys.sql14
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt.attr47
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.sql13
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.sql13
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_fuse_map_predicate_limit.sql12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_fuse_map_take.sql10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.sql47
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.sql15
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/total_order.sql29
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_group.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_group.sql9
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window.sql9
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.sql9
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/wide_if_present_over_double_just.sql1
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_flow_fuse_depends_on.sql6
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_fuse_depends_on.sql4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-10070_extract_members_over_calcoverwindow.sql23
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-10074_dont_inline_lists_depends_on.sql7
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-10737_lost_passthrough.sql15
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.sql18
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.sql7
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.sql12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.sql28
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.sql10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-16134.sql2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.sql10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.sql43
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-18300-flatmap-over-extend.sql19
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-18408_filter_multiusage_pushdown.sql84
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.sql6
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.sql16
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.sql11
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.sql12
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.sql18
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-4240-aggregate_whole_struct.sql16
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.sql13
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.sql29
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.sql11
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.sql25
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.sql28
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.sql23
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-7532_wrong_field_subset_for_calcoverwindow.sql23
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.sql10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.sql17
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.sql25
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.sql10
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.sql22
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.sql14
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.sql15
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.sql7
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.sql23
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByOneField.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByOneField.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByTwoFields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByTwoFields.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.sql8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_over_input.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_over_input.sql7
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.sql9
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_with_filter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_with_filter.sql13
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.sql13
-rw-r--r--yql/essentials/tests/sql/suites/order_by/avg_and_sum_by_value.txt4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/columns.txt8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/columns.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/complex_type.txt2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/complex_type.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/order_by/decimals.txt8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/decimals.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/descending.txt2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/descending.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.sql12
-rw-r--r--yql/essentials/tests/sql/suites/order_by/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/input2.txt9
-rw-r--r--yql/essentials/tests/sql/suites/order_by/input_expr.txt10
-rw-r--r--yql/essentials/tests/sql/suites/order_by/input_sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/input_sorted.txt.attr53
-rw-r--r--yql/essentials/tests/sql/suites/order_by/limit.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/limit.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal.sql8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_complex.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_complex.sql9
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_desc.sql9
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.sql9
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.sql15
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_with_assume.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_with_assume.sql15
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.sql13
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_publish.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_publish.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort-over_sorted.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort.sql7
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.sql7
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_dot_column.sql3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_dynum.sql3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_dynum_desc.sql4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_expr_with_deps.sql8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.sql3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.sql17
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.sql20
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.sql47
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.sql27
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.sql47
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_mul_columns.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_subquery.sqlx25
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.sql5
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.sql5
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tuple.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tuple_and_member.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_tuple_expr.sql10
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_udf.sql4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.sql5
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_by_value_desc.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/order_with_null.sql11
-rw-r--r--yql/essentials/tests/sql/suites/order_by/ordered_fill.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/ordered_fill.sql10
-rw-r--r--yql/essentials/tests/sql/suites/order_by/presort_mem.sql76
-rw-r--r--yql/essentials/tests/sql/suites/order_by/presort_order_by_table.sql15
-rw-r--r--yql/essentials/tests/sql/suites/order_by/read_schema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/order_by/read_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/single_item_tuple.sql2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/singular.sql12
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort.sql1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_decimals.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_decimals.sql4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_simple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_simple.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_with_take.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_with_take.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.sql6
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sorted_table1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/order_by/sorted_table1.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/order_by/tuple01.sql32
-rw-r--r--yql/essentials/tests/sql/suites/order_by/union_all.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/order_by/union_all.sql21
-rw-r--r--yql/essentials/tests/sql/suites/order_by/unsorted.txt8
-rw-r--r--yql/essentials/tests/sql/suites/order_by/unsorted.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.sql7
-rw-r--r--yql/essentials/tests/sql/suites/params/complex_yson.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/complex_yson.sql4
-rw-r--r--yql/essentials/tests/sql/suites/params/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/dict.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/params/dict.sql4
-rw-r--r--yql/essentials/tests/sql/suites/params/input.txt3
-rw-r--r--yql/essentials/tests/sql/suites/params/list.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/list.sql3
-rw-r--r--yql/essentials/tests/sql/suites/params/missing_param_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/params/missing_param_fail.sql3
-rw-r--r--yql/essentials/tests/sql/suites/params/no_optional_param.sql3
-rw-r--r--yql/essentials/tests/sql/suites/params/no_params_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/no_params_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/params/p_bool.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_date.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_datetime.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_decimal.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_dict.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_dict2.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_double.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_int64.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_interval.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_json.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_list.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_null.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_number_list.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_string.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_string_bin.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_string_ru.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_struct.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_timestamp.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_tuple1.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_tuple2.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_tzdate.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_tzdatetime.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_tztimestamp.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_uint64.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_uuid.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_variant1.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_variant2.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_variant3.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_variant4.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_variant5.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_yson.json1
-rw-r--r--yql/essentials/tests/sql/suites/params/p_yson2.json101
-rw-r--r--yql/essentials/tests/sql/suites/params/param_in_in_predicate.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/param_in_in_predicate.sql5
-rw-r--r--yql/essentials/tests/sql/suites/params/param_in_json_api.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/params/param_in_json_api.sql45
-rw-r--r--yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/params/primitives.cfg24
-rw-r--r--yql/essentials/tests/sql/suites/params/primitives.sql30
-rw-r--r--yql/essentials/tests/sql/suites/params/struct.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/params/struct.sql3
-rw-r--r--yql/essentials/tests/sql/suites/params/tuple.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/params/tuple.sql6
-rw-r--r--yql/essentials/tests/sql/suites/params/variant.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/params/variant.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt.attr37
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt.attr40
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer.txt.attr24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt.attr34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/default.cfg24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/item.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/item.txt.attr28
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q01.sql28
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q02.sql63
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q03.sql24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q04.sql119
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q05.sql131
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q06.sql29
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q07.sql24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q08.sql111
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q09.sql54
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q10.sql62
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q11.sql84
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q12.sql37
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q13.sql55
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q14.sql213
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q15.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q16.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q17.sql48
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q18.sql37
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q19.sql28
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q20.sql33
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q21.sql33
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q22.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q23.sql110
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q24.sql110
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q25.sql51
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q26.sql24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q27.sql26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q28.sql56
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q29.sql50
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q30.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q31.sql55
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q32.sql31
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q33.sql78
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q34.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q35.sql61
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q36.sql33
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q37.sql20
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q38.sql26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q39.sql57
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q40.sql31
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q41.sql55
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q42.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q43.sql22
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q44.sql38
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q45.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q46.sql38
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q47.sql54
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q48.sql70
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q49.sql132
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q50.sql62
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q51.sql48
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q52.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q53.sql31
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q54.sql59
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q55.sql17
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q56.sql72
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q57.sql51
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q58.sql68
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q59.sql47
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q60.sql81
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q61.sql47
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q62.sql38
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q63.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q64.sql124
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q65.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q66.sql223
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q67.sql47
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q68.sql45
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q69.sql50
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q70.sql41
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q71.sql43
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q72.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q73.sql31
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q74.sql64
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q75.sql73
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q76.sql27
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q77.sql111
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q78.sql61
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q79.sql26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q80.sql99
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q81.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q82.sql20
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q83.sql70
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q84.sql24
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q85.sql87
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q86.sql29
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q87.sql26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q88.sql97
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q89.sql31
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q90.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q91.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q92.sql33
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q93.sql21
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q94.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q95.sql35
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q96.sql19
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q97.sql28
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q98.sql36
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/q99.sql38
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/reason.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/reason.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store.txt.attr35
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt.attr26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt.attr29
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt.attr16
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt.attr20
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt.attr20
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt.attr30
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt.attr40
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt0
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/customer.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/customer.txt.attr14
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/default.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt.attr22
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/nation.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/nation.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/orders.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/orders.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/part.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/part.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q01.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q02.sql49
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q03.sql27
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q04.sql26
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q05.sql28
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q06.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q07.sql41
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q08.sql41
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q09.sql35
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q10.sql36
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q11.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q12.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q13.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q14.sql17
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q15.sql36
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q16.sql34
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q17.sql22
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q18.sql38
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q19.sql39
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q20.sql41
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q21.sql44
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/q22.sql40
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/region.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/region.txt.attr9
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/supplier.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg-tpch/supplier.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggr_compare.sql14
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_combine.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_combine.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_combine_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_combine_all.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_ctx.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_distinct.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_emit_agg_apply.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_factory.sql27
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/aggregate_scalar_minus_zero.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/all_data.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/all_data.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/all_data.txt2
-rw-r--r--yql/essentials/tests/sql/suites/pg/all_data.txt.attr35
-rw-r--r--yql/essentials/tests/sql/suites/pg/avg_float_clone_init_value.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/bit_const.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/cast_int_to_bit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/cbo_pragma1.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/cbo_pragma2.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/coalesce.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/compare.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/current_database.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/dates_from_pg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/dates_to_pg.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/def_column_name_func.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/default.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/pg/distinct_all_projection.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/distinct_on_multi_projection.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_no_order.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order_expr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/doubles_search_path.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/drop_table.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/drop_table.sql17
-rw-r--r--yql/essentials/tests/sql/suites/pg/equals_where_over_cross.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/equals_where_over_cross2.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/expr_op_array.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pg/in_mixed.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/in_mixed.sql21
-rw-r--r--yql/essentials/tests/sql/suites/pg/in_sorted.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/pg/input2.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input3.txt3
-rw-r--r--yql/essentials/tests/sql/suites/pg/input3.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input4.txt3
-rw-r--r--yql/essentials/tests/sql/suites/pg/input4.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input5.txt5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input5.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/inputC.txt1
-rw-r--r--yql/essentials/tests/sql/suites/pg/inputC.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/inputZ.txt2
-rw-r--r--yql/essentials/tests/sql/suites/pg/inputZ.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_1.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_2.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_3.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_3.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_name.txt3
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_name.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_pg.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_pg.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/pg/insert.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg/insert.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/interval_to_pg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/is_predicate.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_brackets1.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_brackets2.sql21
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_groups.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_tree_order.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using1.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using2.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using3.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using4.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using5.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using6.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using7.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using8.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using9.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_case_insensetive1.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_case_insensetive2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_multiple1.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_multiple2.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_multiple2.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_multiple3.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_table_used_order.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_table_used_order1.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_tables1.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_tables2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_tables3.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/join_using_tables4.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/lang_sql.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/long_ident.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/multi_usage_cross_join.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg/name.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg/name.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/nothing.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/nullif.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/nulls.sql39
-rw-r--r--yql/essentials/tests/sql/suites/pg/nulls_native.sql40
-rw-r--r--yql/essentials/tests/sql/suites/pg/numbers_to_pg.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/numeric_to_pg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_extra_for_keys.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_aggr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_full.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_keys.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_aggr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_keys_and_aggr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_agg_no_extra_for_aggs.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg_sublink.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_input_columns.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_input_columns_qual.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns_qual.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/palloc_big_string.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/param_text1.json1
-rw-r--r--yql/essentials/tests/sql/suites/pg/param_text2.json1
-rw-r--r--yql/essentials/tests/sql/suites/pg/parametrized.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg/parametrized.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_array_cast.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_array_compare.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_array_literal.sql15
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_column_case.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_column_case.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_corr_count.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_corr_limit.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_corr_offset.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit2.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_in_dict_key_with_stable_pickle.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_in_expr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_interval_literal.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_iterate.sql22
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_like.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_like.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_like_cast.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_like_opt.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_type_from_oid.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_aggregate1.sql80
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_array_literal.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_cast_with_length.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_dict.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_dict.sql17
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_literal_mods.sql14
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_literal_with_length.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_orderby.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_orderby.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_window1.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_types_window2.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/pg_view.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/pgns_agg.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/pgns_proc.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/point.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/range_function_multi.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/range_function_multi_record.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/range_function_scalar.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/record_from_table_row.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/reflection.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/regoids.sql44
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_expr_having.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_expr_key_under_agg.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_expr_order.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_expr_projection.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_group.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_group_key_only.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_gs_cube.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_gs_grouping.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_gs_rollup.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_gs_sets.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_one_row.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_qstar.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_agg_star.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_alias_partial.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_and_or_group.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_between.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_case.sql20
-rwxr-xr-xyql/essentials/tests/sql/suites/pg/select_cast_same_arg.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_columnref1.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_columnref2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_except.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_exceptall.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_if.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_intersect.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_intersectall.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_union.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_unionall.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_common_type_unionall.sql21
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_except.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_except_all.sql12
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_from_columns.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_from_columns_qstar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_from_columns_scalar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_from_columns_star.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_having.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_having_no_from.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_having_same_agg.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_intersect.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_intersect_all.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_is_null.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_cross.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_cross_and_inner.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full3.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full_const.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full_equi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_const.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_one.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_full_one.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner3.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner_const.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner_equi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_const.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_one.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_inner_one.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left3.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left_const.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left_equi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_const.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_one.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_left_one.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_qstar.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right3.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right_const.sql32
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right_equi.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_const.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_one.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_join_right_one.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_limit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_literals.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_plusminus.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_plusminus_unary.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_expr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_qstar.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_star.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_col.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_expr.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qcol.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qstar.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_star.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_expr.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_qstar.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_star.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_union_all_expr.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_qstarref1.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_qstarref2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_sort_project_expr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_sort_project_new.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_sort_project_same.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_sort_project_same_asc.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_sort_project_same_desc.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_starref1.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_starref2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery2_qstar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery_scalar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery_scalar2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_subquery_scalar2_qstar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_substring.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_table1.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_table2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_union.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_unionall_scalar.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_unionall_self.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_where.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_where_scalar.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_column_order_by.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_column_partition_by.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_count.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_count_all.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_cume_dist.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_expr_agg.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_expr_agg_order.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_expr_lead.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_expr_order.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_expr_partition.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_first_last_value.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_frame.sql18
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_lead_lag.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_max.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_max_null.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_min.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_min_null.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_nth_value.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_ntile.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_partition_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_percent_rank.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_rank.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_rank_order.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_row_number.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_sum.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_win_sum_null.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_yql_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/select_yql_type.sql15
-rw-r--r--yql/essentials/tests/sql/suites/pg/set_of_as_records.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/set_of_as_records.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/set_of_as_structs.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/set_over_unhashable.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg/simple_ops.sql18
-rw-r--r--yql/essentials/tests/sql/suites/pg/single_input_filter_over_join.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sort_nulls_priority.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg/sort_nulls_priority_window.sql13
-rw-r--r--yql/essentials/tests/sql/suites/pg/str_lookup_pg.sql22
-rw-r--r--yql/essentials/tests/sql/suites/pg/strings_to_pg.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/struct_tuple_cast.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns_corr.sql11
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_having_all.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_having_any.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_having_exists.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_having_expr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_having_in.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_order_all_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_order_any_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_order_exists_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_order_expr_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_order_in_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_all_corr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_any_corr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_array.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_array_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_exists_corr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_expr_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_in_corr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_projection_uncorrelated.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_all.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_all_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_any.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_any_corr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_exists.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_exists_corr.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_expr.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_expr_corr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_in.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg/sublink_where_in_corr.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/table_func.sql15
-rw-r--r--yql/essentials/tests/sql/suites/pg/type_aliases.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/unknown.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/uuid_from_pg.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg/values.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/variadic.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/variadic_array_arg.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg/wide_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/wide_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/wide_top_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg/wide_top_sort.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg/with.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/with_rec_all.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg/with_rec_all_empty.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg/with_rec_distinct.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg/with_rec_trivial.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/columns.sql14
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr5
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/lambda.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql20
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql14
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql17
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql18
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql15
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql7
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql3
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/tables.sql9
-rw-r--r--yql/essentials/tests/sql/suites/pg_catalog/user.sql6
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/order_by_duplicated_proj_on_column_ref.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_duplicates.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_same_projection_lambda.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_from_using.sql8
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_three_times.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_two_times.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/simple_duplicate.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/star_from_crossjoin.sql4
-rw-r--r--yql/essentials/tests/sql/suites/pg_duplicated/star_proj.sql2
-rw-r--r--yql/essentials/tests/sql/suites/pragma/classic_division.sql16
-rw-r--r--yql/essentials/tests/sql/suites/pragma/classic_division.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/pragma/config_exec.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pragma/config_exec.sql10
-rw-r--r--yql/essentials/tests/sql/suites/pragma/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pragma/file.sql1
-rw-r--r--yql/essentials/tests/sql/suites/pragma/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/pragma/messages.sqlx5
-rw-r--r--yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx6
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql24
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql23
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql25
-rw-r--r--yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql5
-rw-r--r--yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql4
-rw-r--r--yql/essentials/tests/sql/suites/produce/default.cfg7
-rw-r--r--yql/essentials/tests/sql/suites/produce/descending.txt2
-rw-r--r--yql/essentials/tests/sql/suites/produce/descending.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/produce/discard_process_with_lambda.sql8
-rw-r--r--yql/essentials/tests/sql/suites/produce/discard_reduce_lambda.sql9
-rw-r--r--yql/essentials/tests/sql/suites/produce/empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.sql69
-rw-r--r--yql/essentials/tests/sql/suites/produce/input0.txt4
-rw-r--r--yql/essentials/tests/sql/suites/produce/input1.txt9
-rw-r--r--yql/essentials/tests/sql/suites/produce/input2.txt10
-rw-r--r--yql/essentials/tests/sql/suites/produce/input_sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/produce/input_sorted.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.sql23
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_and_filter.sql2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_lambda_opt_args.sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.sql25
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.sql12
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_out.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_out.sql24
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.sql24
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_pure_with_sort.sql32
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_row_and_columns.sql19
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_and_filter.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_and_filter.sql23
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.sql30
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.sql30
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.sql28
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.sql28
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_streaming.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_streaming_count.sql19
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_streaming_inline_bash.sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_trivial_as_struct.sql2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_assume.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_assume.sql12
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_lambda.sql8
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_lambda_outstream.sql27
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_python.sql10
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_python_as_struct.sql10
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_python_stream-empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_python_stream.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_python_stream.sql23
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_udf.sql2
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_udf_rows.sql17
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_udf_validate.sql7
-rw-r--r--yql/essentials/tests/sql/suites/produce/process_with_udf_validate_ignore_broken.sql8
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_expr.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_list.sql18
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_list_stream.sql25
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_multi_in.sql15
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_opt.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream-dq_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream._sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_by_struct.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_lambda.sql11
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_lambda_list_mem.sql11
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_lambda_list_table.sql11
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin.sql13
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin_list.sql13
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in-empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in-sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.sql46
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.sql45
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.sql21
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.sql22
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.sql24
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling-sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.sql23
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.sql24
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_out.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_multi_out.sql18
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_subfields-sorted.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_subfields.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_subfields.sql25
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_typeinfo.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_typeinfo.sql18
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_assume.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_assume.sql11
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.sql13
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_flat_lambda.sql9
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_flat_python_stream.sql30
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.sql32
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys.sql15
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys_stream.sql19
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_filter_and_having.sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_having.sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream._sql14
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_presort.sql15
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_presort_stream.sql15
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_row.sql17
-rw-r--r--yql/essentials/tests/sql/suites/produce/reduce_with_python_row_repack.sql16
-rw-r--r--yql/essentials/tests/sql/suites/produce/sorted.txt6
-rw-r--r--yql/essentials/tests/sql/suites/produce/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/produce/sorted1.txt10
-rw-r--r--yql/essentials/tests/sql/suites/produce/sorted1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/produce/yql-10297.sql30
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_default.sql8
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_expr.sql10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_expr_subquery.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_expr_udf.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_expr_udf.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_join_left.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_join_right.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_multiple_sample.sql16
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_small_rate.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/bind_topsort.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/direct_read-dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/direct_read.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/direct_read.sql4
-rw-r--r--yql/essentials/tests/sql/suites/sampling/dynamic.txt10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/dynamic.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/sampling/input.txt10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/input1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/sampling/insert.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/insert.sql10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/join_left_sample.sql9
-rw-r--r--yql/essentials/tests/sql/suites/sampling/join_right_sample.sql9
-rw-r--r--yql/essentials/tests/sql/suites/sampling/map-dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/map-keyfilter.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/map.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/map.sql3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/mapjoin_left_sample.sql9
-rw-r--r--yql/essentials/tests/sql/suites/sampling/mapjoin_right_sample.sql10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/orderedjoin_left_sample.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/orderedjoin_right_sample.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/read-dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/read.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/read.sql3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/reduce-with_premap.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/reduce.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/reduce.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/reduce_with_presort.sql11
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sample.sql5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sort.sql3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sorted.txt10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sorted.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sorted_desc.txt10
-rw-r--r--yql/essentials/tests/sql/suites/sampling/sorted_desc.txt.attr47
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_default.sql5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_expr.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_filter.sql5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_limit.sql5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_mapjoin.sql14
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_multiple_sample.sql5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/subquery_sort.sql6
-rw-r--r--yql/essentials/tests/sql/suites/sampling/system_sampling-io_block_size.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/sampling/system_sampling.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/sampling/system_sampling.sql12
-rw-r--r--yql/essentials/tests/sql/suites/sampling/table_content.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/table_content.sql7
-rw-r--r--yql/essentials/tests/sql/suites/sampling/take_with_sampling.sql3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/topsort.sql3
-rw-r--r--yql/essentials/tests/sql/suites/sampling/yql-14664_deps.sql20
-rw-r--r--yql/essentials/tests/sql/suites/sampling/zero_percentage.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/sampling/zero_percentage.sql2
-rw-r--r--yql/essentials/tests/sql/suites/schema/append_to_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/append_to_desc.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.sql7
-rw-r--r--yql/essentials/tests/sql/suites/schema/concat.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/concat.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/copy-other.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/copy-read_schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/copy-schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/copy-yamred_dsv_raw.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/copy.sql3
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values.txt6
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values_job.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/def_values_job.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/descending.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/descending.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/schema/diffrerent_schemas.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/diffrerent_schemas.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/empty.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/empty.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/empty_no_schema.txt0
-rw-r--r--yql/essentials/tests/sql/suites/schema/empty_no_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/fake_column.sql11
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema2.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema2.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt6
-rw-r--r--yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_bad.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_bad.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_good.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_good.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_no_schema.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/input_no_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert-read_schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert-row_spec.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert-schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert_sorted-read_schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert_sorted-row_spec.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert_sorted-schema.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/insert_sorted.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/limit_directread.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/limit_directread.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/limit_simple.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/limit_simple.sql2
-rw-r--r--yql/essentials/tests/sql/suites/schema/other.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/schema/other.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/other1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/other1.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/schema/other2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/other2.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/schema/other_job.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/schema/other_job.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched1.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched2.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched2.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched3.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched3.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched4.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched4.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched5.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched5.txt.attr22
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched6.txt1
-rw-r--r--yql/essentials/tests/sql/suites/schema/patched6.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/schema/patchtype.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/schema/patchtype.sql8
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_change_other.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_change_other.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_other.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_other.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_other.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_other.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_partial.txt6
-rw-r--r--yql/essentials/tests/sql/suites/schema/read_schema_partial.txt.attr6
-rw-r--r--yql/essentials/tests/sql/suites/schema/remap_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/remap_desc.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt.attr18
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt.attr25
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt.attr18
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_part.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_part.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt2
-rw-r--r--yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt.attr19
-rw-r--r--yql/essentials/tests/sql/suites/schema/schema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-read_schema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_extra_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_hide_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-row_spec_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-schema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv_raw.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.sql3
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema-extra_field.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema-no_fields.cfg-disabled1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema2.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema2.sql2
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_range-empty_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.sql2
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_field-read_schema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_field-row_spec.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_field-schema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_field.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_fields_inferschema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_fields_inferschema.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_operate_with_columns_simple.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_reordered.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_simple.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_with_map-partial_read_schema.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_with_map-sorted_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_with_map.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_yamr_fields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/select_yamr_fields.sql1
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type2.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/sorted.txt6
-rw-r--r--yql/essentials/tests/sql/suites/schema/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/schema/sorted_desc.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/sorted_desc.txt.attr46
-rw-r--r--yql/essentials/tests/sql/suites/schema/unsorted.txt8
-rw-r--r--yql/essentials/tests/sql/suites/schema/unsorted.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_append.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_append.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_bind.sql8
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_directread.sql8
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_empty_table_ranges.sql16
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_existing_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_existing_column.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_missing_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_missing_column.sql4
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix1.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix1.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix2.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix2.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix3.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_mix3.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_no_infer.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_no_infer.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_override.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_override.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.sql5
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_with_sort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/schema/user_schema_with_sort.sql6
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv.txt4
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv.txt.attr4
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt5
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/anon_clash.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/anon_clash.sql8
-rw-r--r--yql/essentials/tests/sql/suites/select/append_to_value.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/append_to_value.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/append_to_value_1000.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/append_to_value_1000.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/autoextract_source_value.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/autoextract_source_value_in_where.sqlx11
-rw-r--r--yql/essentials/tests/sql/suites/select/autogen_columns_conflict.sql29
-rw-r--r--yql/essentials/tests/sql/suites/select/backtick_with_escapes.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/bin_ops_long_concat.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/bit_ops.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/boolean_where.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/boolean_where.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/boolean_where.txt5
-rw-r--r--yql/essentials/tests/sql/suites/select/boolean_where.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/select/braces.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/calculated_values.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/cast_double_to_uint32.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/column_labels.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/complex_filter_with_order.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/complex_view_input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/select/complex_view_input.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/select/const_subrequest_and_select_by_all.sql9
-rw-r--r--yql/essentials/tests/sql/suites/select/core_func_test_bit.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/corr_name_in_select.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/corr_name_in_select_seq.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/create_structures.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/create_tuples.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/data_instance.sql45
-rw-r--r--yql/essentials/tests/sql/suites/select/deep_udf_call.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/select/deep_udf_call.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/select/dict_lookup.sql10
-rw-r--r--yql/essentials/tests/sql/suites/select/dict_lookup_by_key.sql14
-rw-r--r--yql/essentials/tests/sql/suites/select/dict_lookup_by_key_with_def.sql14
-rw-r--r--yql/essentials/tests/sql/suites/select/dict_lookup_column_names.sql5
-rw-r--r--yql/essentials/tests/sql/suites/select/dict_with_few_keys.sql15
-rw-r--r--yql/essentials/tests/sql/suites/select/digits.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/select/digits.sql8
-rw-r--r--yql/essentials/tests/sql/suites/select/discard.sql9
-rw-r--r--yql/essentials/tests/sql/suites/select/dot_in_alias.sql6
-rw-r--r--yql/essentials/tests/sql/suites/select/dot_name_subrequest.sql8
-rw-r--r--yql/essentials/tests/sql/suites/select/double_at_ids.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/exists_false.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/exists_true.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/extend_and_take.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/select/extend_and_take.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/from_in_front.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/from_in_front_sub.sql9
-rw-r--r--yql/essentials/tests/sql/suites/select/hits_count.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/select/hits_count.sql33
-rw-r--r--yql/essentials/tests/sql/suites/select/hits_input1.txt3
-rw-r--r--yql/essentials/tests/sql/suites/select/hits_input2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/select/host_count.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/select/host_count.sql33
-rw-r--r--yql/essentials/tests/sql/suites/select/host_input1.txt3
-rw-r--r--yql/essentials/tests/sql/suites/select/host_input1.txt.attr16
-rw-r--r--yql/essentials/tests/sql/suites/select/host_input2.txt3
-rw-r--r--yql/essentials/tests/sql/suites/select/host_input2.txt.attr16
-rw-r--r--yql/essentials/tests/sql/suites/select/id_xor.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/if.sql6
-rw-r--r--yql/essentials/tests/sql/suites/select/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/select/input1100.txt1100
-rw-r--r--yql/essentials/tests/sql/suites/select/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/select/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/select/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/select/input_expr.txt10
-rw-r--r--yql/essentials/tests/sql/suites/select/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/select/input_struct_field.txt0
-rw-r--r--yql/essentials/tests/sql/suites/select/input_struct_field.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/select/literal_bool.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/literal_negative.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/logical_ops.sql6
-rw-r--r--yql/essentials/tests/sql/suites/select/match_clause.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/select/match_clause.sql4
-rw-r--r--yql/essentials/tests/sql/suites/select/missing_with_nonpersist.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/missing_with_nonpersist.sql10
-rw-r--r--yql/essentials/tests/sql/suites/select/multi_source_issue.sql17
-rw-r--r--yql/essentials/tests/sql/suites/select/normalize_name.sqlx1
-rw-r--r--yql/essentials/tests/sql/suites/select/null_check.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/one_labeled_column.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/one_unlabeled_column.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/opt_list_access.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/optional_as_warn.sql18
-rw-r--r--yql/essentials/tests/sql/suites/select/optional_in_job.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/optional_in_job.sql34
-rw-r--r--yql/essentials/tests/sql/suites/select/optional_pull.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/optional_pull.sql32
-rw-r--r--yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sql16
-rw-r--r--yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sqlx15
-rw-r--r--yql/essentials/tests/sql/suites/select/quoted_ids.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/quoted_ids_with_escapes.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/read_schema.txt5
-rw-r--r--yql/essentials/tests/sql/suites/select/read_schema.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/select/refselect-1000.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/refselect.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/refselect.sql4
-rw-r--r--yql/essentials/tests/sql/suites/select/result_label.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/result_rows_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/result_rows_limit.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/result_size_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/result_size_limit.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.sql9
-rw-r--r--yql/essentials/tests/sql/suites/select/reuse_named_node.sql5
-rw-r--r--yql/essentials/tests/sql/suites/select/sampleselect-1000.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/sampleselect.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/sampleselect.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/scalar_subquery.sql6
-rw-r--r--yql/essentials/tests/sql/suites/select/scalar_subquery_with_star.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_filtered.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_from_concat.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_from_concat_anon.sql10
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_group_by_column.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_group_by_column.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/select_all_ordered.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/select_concrete_detailed_columns.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/shift_columns.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/simple_struct_field_access.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/simple_struct_field_access.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/struct_access_without_table_name.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/struct_access_without_table_name.sql18
-rw-r--r--yql/essentials/tests/sql/suites/select/struct_members.sql4
-rw-r--r--yql/essentials/tests/sql/suites/select/substring.sql6
-rw-r--r--yql/essentials/tests/sql/suites/select/substring_v1.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/sum_to_string.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/swap_columns.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/table_content_from_double_opt.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/table_content_from_sort_desc.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/table_funcs_spec.sql15
-rw-r--r--yql/essentials/tests/sql/suites/select/table_funcs_spec_flatten_by.sql_gb_gs.sqlx11
-rw-r--r--yql/essentials/tests/sql/suites/select/tablename_with_table_row.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/tablepathprefix.sql9
-rw-r--r--yql/essentials/tests/sql/suites/select/to_dict.sql17
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_between.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_group_by.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_having.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_order_by.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_where-many.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_where-many.txt4
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_where-one.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_where.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/trivial_where.txt2
-rw-r--r--yql/essentials/tests/sql/suites/select/two_select_without_semi.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/two_selects_with_diff_fields.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/type_assert.sql11
-rw-r--r--yql/essentials/tests/sql/suites/select/unary_op_interval.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/unlabeled.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/unlabeled.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/unlabeled_1000.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/unlabeled_1000.sql3
-rw-r--r--yql/essentials/tests/sql/suites/select/use_cluster.sql2
-rw-r--r--yql/essentials/tests/sql/suites/select/use_subrequest_as_table.sqlx23
-rw-r--r--yql/essentials/tests/sql/suites/select/values.sql8
-rw-r--r--yql/essentials/tests/sql/suites/select/where_cast.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/where_in.sql7
-rw-r--r--yql/essentials/tests/sql/suites/select/where_not_null.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/where_not_null.sql1
-rw-r--r--yql/essentials/tests/sql/suites/select/where_with_lambda.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/select/where_with_lambda.sql11
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/action_shared_subquery_expr_after_commit.sql12
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/default.cfg0
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/shared_named_expr.sql6
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr.sql5
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr_after_commit.sql9
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/simple1.sql3
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/simple2.sql4
-rw-r--r--yql/essentials/tests/sql/suites/seq_mode/subquery_shared_subquery.sql9
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/no_simple_columns_tablerow.sql17
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_base.sql4
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.sql13
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_all.sql12
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_1.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_2.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_bug8923.sql16
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_disable.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_enable.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_1.sql18
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_2.sql18
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_1.sql8
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_2.sql8
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.sql13
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_qualified.sql13
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_all_key_without.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key.sql13
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_by_all.sql12
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_without.sql15
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates.sql16
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates_mult.sql17
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_qualified_all_and_group_by.sql14
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq.sql9
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq_all.sql9
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_tablerow.sql17
-rw-r--r--yql/essentials/tests/sql/suites/simple_columns/simple_columns_union_all_qualified_star.sql18
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/Basic.sql5
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.sql5
-rw-r--r--yql/essentials/tests/sql/suites/solomon/Downsampling.sql9
-rw-r--r--yql/essentials/tests/sql/suites/solomon/DownsamplingValidSettings.sql17
-rw-r--r--yql/essentials/tests/sql/suites/solomon/InvalidProject.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/InvalidProject.sql5
-rw-r--r--yql/essentials/tests/sql/suites/solomon/LabelColumns.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/Subquery.sql15
-rw-r--r--yql/essentials/tests/sql/suites/solomon/UnknownSetting.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/solomon/UnknownSetting.sql6
-rw-r--r--yql/essentials/tests/sql/suites/solomon/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/event.txt30
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/host.txt11
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr8
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/input.txt10
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql9
-rw-r--r--yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql9
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql14
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql13
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/concat_with_view.sql3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/doc_view.txt10
-rw-r--r--yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/empty_int64.txt0
-rw-r--r--yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/table_range/empty_uint32.txt0
-rw-r--r--yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/table_range/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql7
-rw-r--r--yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql6
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_desc.sql7
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_filter.sql12
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql16
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_like.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_like.sql4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql5
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_slash.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_slash.sql9
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_with_view.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/range_with_view.sql3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted1.txt6
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted2.txt6
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted_desc.txt10
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr47
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr15
-rw-r--r--yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql16
-rw-r--r--yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql6
-rw-r--r--yql/essentials/tests/sql/suites/table_range/view_input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/table_range/view_input.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/tpch/customer.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/customer.txt.attr56
-rw-r--r--yql/essentials/tests/sql/suites/tpch/default.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/tpch/lineitem.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/lineitem.txt.attr114
-rw-r--r--yql/essentials/tests/sql/suites/tpch/nation.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/nation.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/tpch/orders.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/orders.txt.attr65
-rw-r--r--yql/essentials/tests/sql/suites/tpch/part.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/part.txt.attr62
-rw-r--r--yql/essentials/tests/sql/suites/tpch/partsupp.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/partsupp.txt.attr39
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q1.sql26
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q10.sql87
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q11.sql62
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q12.sql45
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q13.sql33
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q14.sql21
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q15.sql56
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q16.sql44
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q17.sql41
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q18.sql53
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q19.sql40
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q2.sql68
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q20.sql83
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q21.sql51
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q22.sql58
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q3.sql55
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q4.sql29
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q5.sql102
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q6.sql16
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q7.sql87
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q8.sql110
-rw-r--r--yql/essentials/tests/sql/suites/tpch/q9.sql59
-rw-r--r--yql/essentials/tests/sql/suites/tpch/region.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/region.txt.attr26
-rw-r--r--yql/essentials/tests/sql/suites/tpch/supplier.txt1
-rw-r--r--yql/essentials/tests/sql/suites/tpch/supplier.txt.attr50
-rw-r--r--yql/essentials/tests/sql/suites/type_literal/create_table.sql80
-rw-r--r--yql/essentials/tests/sql/suites/type_literal/declare.sql82
-rw-r--r--yql/essentials/tests/sql/suites/type_literal/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_literal/evaluate.sql8
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_flags.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_flags.sql12
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.sql41
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.sql44
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/append_struct.sql21
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal.txt2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal.txt.attr37
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt.sql8
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.sql24
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.sql24
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/float.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/float.sql16
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/float.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/float.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-opt.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-protofield.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-tag_opt.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.sql8
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.sql10
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.sql25
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.sql25
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/json.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/json.sql16
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.sql11
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mixed.txt1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mixed.txt.attr40
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.sql5
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native.txt.attr36
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native1.txt.attr36
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_opt.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_opt.txt.attr39
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_proto.txt1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_proto.txt.attr37
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_sorted.txt.attr37
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt.attr37
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt.attr43
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/non_strict.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/non_strict.sql12
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/other.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/other.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.sql40
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/singulars.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/singulars.sql12
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/split.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/split.sql6
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/type_subset.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/type_subset.sql15
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/uuid.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/uuid.sql23
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/with_datetime.txt4
-rw-r--r--yql/essentials/tests/sql/suites/type_v3/with_datetime.txt.attr29
-rw-r--r--yql/essentials/tests/sql/suites/udf/automap_null.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/automap_null.sql5
-rw-r--r--yql/essentials/tests/sql/suites/udf/complex_return_type.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/complex_return_type.sql1
-rw-r--r--yql/essentials/tests/sql/suites/udf/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/generic_udf.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/generic_udf.sql2
-rw-r--r--yql/essentials/tests/sql/suites/udf/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/udf/input_tutorial_users.txt12
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args.sql12
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script.sql18
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.sql18
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.sql18
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.sql18
-rw-r--r--yql/essentials/tests/sql/suites/udf/named_args_for_script_with_wrong_order.sqlx18
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_script.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_script.py2
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_script.sql11
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_script_from_file.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_script_from_file.sql7
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_struct.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/udf/python_struct.sql23
-rw-r--r--yql/essentials/tests/sql/suites/udf/regexp_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/regexp_udf.sql3
-rw-r--r--yql/essentials/tests/sql/suites/udf/same_udf_modules.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/same_udf_modules.sql15
-rw-r--r--yql/essentials/tests/sql/suites/udf/sqlproject_grounds.sql8
-rw-r--r--yql/essentials/tests/sql/suites/udf/trivial_udf.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/trivial_udf.sql3
-rw-r--r--yql/essentials/tests/sql/suites/udf/two_regexps.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/two_regexps.sql5
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf.sql49
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_default.sql25
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_distinct.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_distinct.sql53
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_lambda.sql18
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_short.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udaf_short.sql27
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf.sql2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.sql6
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_empty.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_empty.sql2
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_result_member.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/udf/udf_result_member.sql3
-rw-r--r--yql/essentials/tests/sql/suites/udf/wrong_args_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/udf/wrong_args_fail.sql8
-rw-r--r--yql/essentials/tests/sql/suites/union/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/union/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/union/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/union/union_column_extention.sql16
-rw-r--r--yql/essentials/tests/sql/suites/union/union_mix.sql4
-rw-r--r--yql/essentials/tests/sql/suites/union/union_multiin.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/union/union_multiin.sql4
-rw-r--r--yql/essentials/tests/sql/suites/union/union_positional.sql9
-rw-r--r--yql/essentials/tests/sql/suites/union/union_positional_mix.sql10
-rw-r--r--yql/essentials/tests/sql/suites/union/union_trivial.sql4
-rw-r--r--yql/essentials/tests/sql/suites/union_all/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/union_all/infer_3.sql8
-rw-r--r--yql/essentials/tests/sql/suites/union_all/inner_union_all_with_limits.sql21
-rw-r--r--yql/essentials/tests/sql/suites/union_all/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/union_all/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/union_all/input_infer.txt4
-rw-r--r--yql/essentials/tests/sql/suites/union_all/input_infer.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/union_all/mix_map_and_project-trivial_map.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/union_all/mix_map_and_project.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/union_all/mix_map_and_project.sql13
-rw-r--r--yql/essentials/tests/sql/suites/union_all/mix_map_and_read.sql9
-rw-r--r--yql/essentials/tests/sql/suites/union_all/path_and_record.sql11
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_fields.sql7
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_incompatible.sql26
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_multiin.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_multiin.sql9
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_multiple.sql9
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_null.sql11
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_subexpr.sql7
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_trivial.sql3
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_with_discard_into_result_ansi.sql14
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_with_limits.sql3
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_with_parenthesis.sql4
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits.sqlx12
-rw-r--r--yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits_ansi.sql28
-rw-r--r--yql/essentials/tests/sql/suites/version/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/version/version.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/all_from_view.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/view/all_from_view.sql3
-rw-r--r--yql/essentials/tests/sql/suites/view/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/view/file_eval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/file_eval.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner_library.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner_library.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner_udf.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/view/file_inner_udf.sql8
-rw-r--r--yql/essentials/tests/sql/suites/view/file_outer.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/view/file_outer.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/file_outer_library.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/view/file_outer_library.sql6
-rw-r--r--yql/essentials/tests/sql/suites/view/foo.txt1
-rw-r--r--yql/essentials/tests/sql/suites/view/init_view_after_eval.sql10
-rw-r--r--yql/essentials/tests/sql/suites/view/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/input_lambda.txt1
-rw-r--r--yql/essentials/tests/sql/suites/view/input_lambda.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/view/input_library.txt1
-rw-r--r--yql/essentials/tests/sql/suites/view/input_library.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/view/mylib.sql.txt2
-rw-r--r--yql/essentials/tests/sql/suites/view/nested_library.sql.txt10
-rw-r--r--yql/essentials/tests/sql/suites/view/secure.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/secure.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/secure_eval.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/secure_eval.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql8
-rw-r--r--yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt8
-rw-r--r--yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr4
-rw-r--r--yql/essentials/tests/sql/suites/view/system_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/system_udf.sql5
-rw-r--r--yql/essentials/tests/sql/suites/view/trivial_view.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/view/trivial_view.sql4
-rw-r--r--yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/view/trivial_view_concat.sql4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_inner_library.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_outer_library.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/view/view_input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_input.txt.attr32
-rw-r--r--yql/essentials/tests/sql/suites/view/view_secure.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_secure.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/view/view_system_udf.txt4
-rw-r--r--yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr31
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_lambda.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_lambda.sql2
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql2
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_library.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/view/view_with_library.sql2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/default.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.sql12
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.sql7
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt7
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_rest.txt5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_rest.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt.attr12
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt.attr3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.sql4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.sql4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.sql4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.sql4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optional.txt1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/optional.txt.attr85
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other1.txt4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other1.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other2.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other3.txt5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other3.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other4.txt5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/other4.txt.attr17
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field.sql9
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.sql10
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_data.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_data.sql3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.sql7
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.sql10
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.sql9
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.sql6
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join.sql10
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.sql11
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join_no_src.sqlx8
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.sql13
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_list_type.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.sql8
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.sql7
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.sql10
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_opt.sql3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_real_col.sql11
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_rest.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_rest.sql14
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_strict.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_strict.sql10
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.sql5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_type.sql7
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/weak_member_string_copy.sql3
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt.attr22
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.sql27
-rw-r--r--yql/essentials/tests/sql/suites/window/agg_factory.sql.txt3
-rw-r--r--yql/essentials/tests/sql/suites/window/all_columns_hide_window_special_ones.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/current/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/aggregations.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.sql25
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_aliases.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_aliases.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_extended.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_extended.sql29
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_incompat_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/current/session_incompat_sort.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/distinct_over_window.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/distinct_over_window.sql20
-rw-r--r--yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.sql22
-rw-r--r--yql/essentials/tests/sql/suites/window/distinct_over_window_struct.sql37
-rw-r--r--yql/essentials/tests/sql/suites/window/empty/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/empty/aggregations.sql18
-rw-r--r--yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_compact.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/full/leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/leadlag.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/full/leadlag_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/leadlag_compact.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_aliases.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_aliases.sql19
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_aliases_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_aliases_compact.sql19
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_compact.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_compact.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_incompat_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/session_incompat_sort.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/full/syscolumns.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/full/syscolumns.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/session.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/session.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/session_aliases.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/generic/session_aliases.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/window/input2.txt10
-rw-r--r--yql/essentials/tests/sql/suites/window/input3.txt9
-rw-r--r--yql/essentials/tests/sql/suites/window/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/window/input5.txt30
-rw-r--r--yql/essentials/tests/sql/suites/window/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/window/input_intersect_with_holes.txt14
-rw-r--r--yql/essentials/tests/sql/suites/window/input_optkey1.txt5
-rw-r--r--yql/essentials/tests/sql/suites/window/input_optkey1.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/window/input_optkey2.txt5
-rw-r--r--yql/essentials/tests/sql/suites/window/input_optkey2.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/window/input_tutorial_users.txt12
-rw-r--r--yql/essentials/tests/sql/suites/window/lagging/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/lagging/aggregations.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/leading/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/leading/aggregations.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/lib1.sql.txt5
-rw-r--r--yql/essentials/tests/sql/suites/window/mixed/aggregations.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/mixed/aggregations.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/multiaggr_subq.sql.txt11
-rw-r--r--yql/essentials/tests/sql/suites/window/null_type.sql25
-rw-r--r--yql/essentials/tests/sql/suites/window/p_int32.json1
-rw-r--r--yql/essentials/tests/sql/suites/window/presort_window_order_by_table.sql16
-rw-r--r--yql/essentials/tests/sql/suites/window/presort_window_partition_by_mem.sql5
-rw-r--r--yql/essentials/tests/sql/suites/window/presort_window_partition_by_table.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/nulls.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/nulls_legacy.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/opt.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/opt.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/plain.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/plain.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/unordered.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/rank/unordered.sql20
-rw-r--r--yql/essentials/tests/sql/suites/window/row_number_no_part_from_subq.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/row_number_no_part_multi_input.sql25
-rw-r--r--yql/essentials/tests/sql/suites/window/row_number_to_map.sql18
-rw-r--r--yql/essentials/tests/sql/suites/window/row_number_to_map_multiple.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/row_number_to_map_noncompact.sql12
-rw-r--r--yql/essentials/tests/sql/suites/window/session1.txt26
-rw-r--r--yql/essentials/tests/sql/suites/window/session1.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/window/table_funcs_spec_win_func.sqlx10
-rw-r--r--yql/essentials/tests/sql/suites/window/table_funcs_spec_with_win_func.sqlx6
-rw-r--r--yql/essentials/tests/sql/suites/window/udaf_no_merge.sql11
-rw-r--r--yql/essentials/tests/sql/suites/window/udaf_window.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/udaf_window.sql51
-rw-r--r--yql/essentials/tests/sql/suites/window/udaf_with_def_value.sql65
-rw-r--r--yql/essentials/tests/sql/suites/window/win_aggregate_check01.sqlx24
-rw-r--r--yql/essentials/tests/sql/suites/window/win_aggregate_check02.sqlx23
-rw-r--r--yql/essentials/tests/sql/suites/window/win_by_all_aggregate.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/window/win_by_all_aggregate.sql38
-rw-r--r--yql/essentials/tests/sql/suites/window/win_by_all_avg_interval.sql19
-rw-r--r--yql/essentials/tests/sql/suites/window/win_by_all_percentile_interval.sql36
-rw-r--r--yql/essentials/tests/sql/suites/window/win_by_simple.sql5
-rw-r--r--yql/essentials/tests/sql/suites/window/win_expr_bounds.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_expr_bounds.sql13
-rw-r--r--yql/essentials/tests/sql/suites/window/win_extract_members.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.sql8
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_hist.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_hist.sql5
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_stat.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_stat.sql8
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_auto_arg.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_auto_arg_selective_rank.sql18
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_auto_arg_two_sort.sql18
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_cume_dist.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_cume_dist_ansi.sql4
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last.sql10
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last_over_nonopt.sql19
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last_rev.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last_rev.sql10
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_in_lib.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_in_lib.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_into_udf.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_into_udf.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.sql23
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.sql22
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.sql22
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_mutable_resource.sql5
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_nth_value.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_ntile.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_on_cloned_source.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by.sql17
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.sql25
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.sql27
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.sql24
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_having.sqlx17
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_where.sqlx16
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_part_by_expr.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_part_by_expr.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_part_by_expr_new.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_percent_rank.sql8
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_all.sql13
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.sql13
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_by_part.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_spec_with_part.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_spec_with_part.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_special.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_special.sql11
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_with_group_by.sqlx12
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_with_struct_access.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/win_func_with_struct_access_full_access.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/win_fuse_window.sql25
-rw-r--r--yql/essentials/tests/sql/suites/window/win_group_peephole.sql19
-rw-r--r--yql/essentials/tests/sql/suites/window/win_inline_spec.sql9
-rw-r--r--yql/essentials/tests/sql/suites/window/win_lead_in_mem.sql10
-rw-r--r--yql/essentials/tests/sql/suites/window/win_multiaggr.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_multiaggr_library.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/window/win_multiaggr_library.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/win_multiaggr_list.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_multiaggr_tuple.sql6
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_few_partitions.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_few_partitions.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.sql15
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_joined.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/window/win_over_joined.sql13
-rw-r--r--yql/essentials/tests/sql/suites/window/win_peephole.sql18
-rw-r--r--yql/essentials/tests/sql/suites/window/win_peephole_double_usage.sql14
-rw-r--r--yql/essentials/tests/sql/suites/window/win_with_as_table.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/win_with_cur_row.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/window/win_with_cur_row.sql8
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-14179.sql7
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-14277.sql21
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-14479.sql8
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-14738.sql12
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-15636.sql37
-rw-r--r--yql/essentials/tests/sql/suites/window/yql-18879.sql29
-rw-r--r--yql/essentials/tests/sql/suites/ypath/complex.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/default.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.sql4
-rw-r--r--yql/essentials/tests/sql/suites/ypath/dynamic.txt7
-rw-r--r--yql/essentials/tests/sql/suites/ypath/dynamic.txt.attr33
-rw-r--r--yql/essentials/tests/sql/suites/ypath/empty_range-dynamic.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/empty_range.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/empty_range.sql2
-rw-r--r--yql/essentials/tests/sql/suites/ypath/input.txt10
-rw-r--r--yql/essentials/tests/sql/suites/ypath/input.txt.attr13
-rw-r--r--yql/essentials/tests/sql/suites/ypath/limit_with_key.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/limit_with_range.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/multi_key.sql3
-rw-r--r--yql/essentials/tests/sql/suites/ypath/multi_range.sql3
-rw-r--r--yql/essentials/tests/sql/ya.make6
-rw-r--r--yql/essentials/tests/ya.make8
-rw-r--r--yql/essentials/tools/pg-make-test/README.md4
-rw-r--r--yql/essentials/tools/pg-make-test/__main__.py2
-rw-r--r--yql/essentials/tools/pg-make-test/ya.make2
-rw-r--r--yql/essentials/ya.make1
7622 files changed, 385436 insertions, 18 deletions
diff --git a/yql/essentials/cfg/tests/fs.conf b/yql/essentials/cfg/tests/fs.conf
new file mode 100644
index 0000000000..e3bfbe5a5e
--- /dev/null
+++ b/yql/essentials/cfg/tests/fs.conf
@@ -0,0 +1,6 @@
+# Use temp directory
+#Path: ""
+MaxFiles: 1000
+MaxSizeMb: 512
+Threads: 2
+RetryCount: 3
diff --git a/yql/essentials/cfg/tests/fs_arc.conf b/yql/essentials/cfg/tests/fs_arc.conf
new file mode 100644
index 0000000000..b91ff121ad
--- /dev/null
+++ b/yql/essentials/cfg/tests/fs_arc.conf
@@ -0,0 +1 @@
+ArcTokenPath: "~/.arc/token"
diff --git a/yql/essentials/cfg/tests/gateways-experimental.conf b/yql/essentials/cfg/tests/gateways-experimental.conf
new file mode 100644
index 0000000000..c173168fd8
--- /dev/null
+++ b/yql/essentials/cfg/tests/gateways-experimental.conf
@@ -0,0 +1,26 @@
+Yt {
+ DefaultSettings {
+ Name: "InferSchemaMode"
+ Value: "rpc"
+ }
+
+ DefaultSettings {
+ Name: "DQRPCReaderInflight"
+ Value: "10"
+ }
+
+ DefaultSettings {
+ Name: "TableContentLocalExecution"
+ Value: "true"
+ }
+}
+
+Dq {
+}
+
+YqlCore {
+ Flags {
+ Name: "OptimizerFlags"
+ Args: ["FieldSubsetEnableMultiusage", "EarlyExpandSkipNull"]
+ }
+}
diff --git a/yql/essentials/cfg/tests/gateways-forceblocks.conf b/yql/essentials/cfg/tests/gateways-forceblocks.conf
new file mode 100644
index 0000000000..53540ce3aa
--- /dev/null
+++ b/yql/essentials/cfg/tests/gateways-forceblocks.conf
@@ -0,0 +1,5 @@
+YqlCore {
+ Flags {
+ Name: "UseBlocks"
+ }
+}
diff --git a/yql/essentials/cfg/tests/gateways.conf b/yql/essentials/cfg/tests/gateways.conf
new file mode 100644
index 0000000000..cf82a39ae0
--- /dev/null
+++ b/yql/essentials/cfg/tests/gateways.conf
@@ -0,0 +1,245 @@
+Yt {
+ GatewayThreads: 0
+ YtLogLevel: YL_INFO
+
+ DefaultSettings {
+ Name: "DefaultMaxJobFails"
+ Value: "1"
+ }
+
+ DefaultSettings {
+ Name: "LocalCalcLimit"
+ Value: "16"
+ }
+
+ DefaultSettings {
+ Name: "ReleaseTempData"
+ Value: "immediate"
+ }
+
+ DefaultSettings {
+ Name: "NativeYtTypeCompatibility"
+ Value: "all"
+ }
+
+ DefaultSettings {
+ Name: "UseYqlRowSpecCompactForm"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseNewPredicateExtraction"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "PruneKeyFilterLambda"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "_UseKeyBoundApi"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "JoinCommonUseMapMultiOut"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseAggPhases"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "_EnableWriteReorder"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "_EnableYtPartitioning"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseRPCReaderInDq"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "PartitionByConstantKeysViaMap"
+ Value: "true"
+ }
+
+ RemoteFilePatterns {
+ Pattern: "yt://([a-zA-Z0-9\\-_]+)/([^&@?]+)$"
+ Cluster: "$1"
+ Path: "$2"
+ }
+
+ RemoteFilePatterns {
+ Pattern: "https?://yt\\.yandex(\\.net|-team\\.ru)/([a-zA-Z0-9\\-_]+)/#page=navigation&path=//([^&]+)$"
+ Cluster: "$2"
+ Path: "$3"
+ }
+
+ RemoteFilePatterns {
+ Pattern: "https?://yt\\.yandex(\\.net|-team\\.ru)/([a-zA-Z0-9\\-_]+)/navigation\\?path=//([^&]+)$"
+ Cluster: "$2"
+ Path: "$3"
+ }
+
+ RemoteFilePatterns {
+ Pattern: "https?://([a-zA-Z0-9\\-_]+)\\.yt\\.yandex(\\.net|-team\\.ru)/api/v(2/download|3/read_file)\\?(|.+&)path=//([^&]+)($|&.*)"
+ Cluster: "$1"
+ Path: "$5"
+ }
+}
+
+SqlCore {
+ TranslationFlags: ["FlexibleTypes", "DisableAnsiOptionalAs", "EmitAggApply", "UnorderedResult"]
+}
+
+YqlCore {
+ Flags {
+ Name: "DisableYsonCastToString"
+ }
+ Flags {
+ Name: "_EnableMatchRecognize"
+ }
+ Flags {
+ Name: "_EnableStreamLookupJoin"
+ }
+ Flags {
+ Name: "OptimizerFlags"
+ Args: ["FieldSubsetEnableMultiusage"]
+ }
+}
+
+Dq {
+ DefaultSettings {
+ Name: "EnableLLVM"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "EnableInsert"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "EnableFullResultWrite"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "_EnablePrecompute"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "_LiteralTimeout"
+ Value: "3600000"
+ }
+
+ DefaultSettings {
+ Name: "_TableTimeout"
+ Value: "3600000"
+ }
+ DefaultSettings {
+ Name: "EnableComputeActor"
+ Value: "1"
+ }
+ DefaultSettings {
+ Name: "ComputeActorType"
+ Value: "async"
+ }
+
+ DefaultSettings {
+ Name: "UseAggPhases"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "HashJoinMode"
+ Value: "grace"
+ }
+
+ DefaultSettings {
+ Name: "UseFinalizeByKey"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "EnableDqReplicate"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseWideChannels"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseFastPickleTransport"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "UseOOBTransport"
+ Value: "true"
+ }
+
+ DefaultSettings {
+ Name: "SplitStageOnDqReplicate"
+ Value: "false"
+ }
+}
+
+Fs {
+ CustomSchemes {
+ Pattern: "sbr:(?://)?(\\d+)"
+ TargetUrl: "https://proxy.sandbox.yandex-team.ru/$1"
+ }
+ CustomSchemes {
+ # backward compatibility rule
+ Pattern: "yt://([a-zA-Z0-9\\-_]+)/(.+)@t=([^&=]+)"
+ TargetUrl: "yt://$1/$2?transaction_id=$3"
+ }
+ CustomSchemes {
+ Pattern: "https?://yt\\.yandex(?:\\.net|-team\\.ru)/([a-zA-Z0-9\\-_]+)/#page=navigation&(.+)"
+ TargetUrl: "yt://$1/?$2"
+ }
+ CustomSchemes {
+ Pattern: "https?://yt\\.yandex(?:\\.net|-team\\.ru)/([a-zA-Z0-9\\-_]+)/navigation\\?(.+)"
+ TargetUrl: "yt://$1/?$2"
+ }
+ CustomSchemes {
+ Pattern: "https?://([a-zA-Z0-9\\-_]+)\\.yt\\.yandex(?:\\.net|-team\\.ru)/api/v3/read_file\\?(.+)"
+ TargetUrl: "yt://$1/?$2"
+ }
+ CustomSchemes {
+ Pattern: "https?://a\\.yandex-team\\.ru/(?:arc|svn)/(.+)/arcadia/(.+)\\?rev=r?(\\d+)"
+ TargetUrl: "arc:/$2?rev=$3&branch=$1"
+ }
+ CustomSchemes {
+ Pattern: "https?://a(?:rcanum)?\\.yandex-team\\.ru/arcadia/(.+)\\?rev=r(\\d+)"
+ TargetUrl: "arc:/$1?rev=$2"
+ }
+ CustomSchemes {
+ Pattern: "https?://a(?:rcanum)?\\.yandex-team\\.ru/arcadia/(.+)\\?rev=([^r].*)"
+ TargetUrl: "arc:/$1?hash=$2"
+ }
+ CustomSchemes {
+ Pattern: "arc://(.*)"
+ TargetUrl: "arc:/$1"
+ }
+}
+
+Solomon {
+ DefaultSettings {
+ Name: "_EnableReading"
+ Value: "1"
+ }
+}
diff --git a/yql/essentials/cfg/udf_test/fs.conf b/yql/essentials/cfg/udf_test/fs.conf
new file mode 100644
index 0000000000..e3bfbe5a5e
--- /dev/null
+++ b/yql/essentials/cfg/udf_test/fs.conf
@@ -0,0 +1,6 @@
+# Use temp directory
+#Path: ""
+MaxFiles: 1000
+MaxSizeMb: 512
+Threads: 2
+RetryCount: 3
diff --git a/yql/essentials/cfg/udf_test/gateways-forceblocks.conf b/yql/essentials/cfg/udf_test/gateways-forceblocks.conf
new file mode 100644
index 0000000000..927f4f5c87
--- /dev/null
+++ b/yql/essentials/cfg/udf_test/gateways-forceblocks.conf
@@ -0,0 +1,13 @@
+SqlCore {
+ TranslationFlags: ["FlexibleTypes", "DisableAnsiOptionalAs", "EmitAggApply"]
+}
+
+YqlCore {
+ Flags {
+ Name: "DisableYsonCastToString"
+ }
+ Flags {
+ Name: "UseBlocks"
+ }
+}
+
diff --git a/yql/essentials/cfg/udf_test/gateways.conf b/yql/essentials/cfg/udf_test/gateways.conf
new file mode 100644
index 0000000000..110ea04afc
--- /dev/null
+++ b/yql/essentials/cfg/udf_test/gateways.conf
@@ -0,0 +1,10 @@
+SqlCore {
+ TranslationFlags: ["FlexibleTypes", "DisableAnsiOptionalAs", "EmitAggApply", "DisableUnorderedResult"]
+}
+
+YqlCore {
+ Flags {
+ Name: "DisableYsonCastToString"
+ }
+}
+
diff --git a/yql/essentials/core/common_opt/yql_flatmap_over_join.cpp b/yql/essentials/core/common_opt/yql_flatmap_over_join.cpp
index 802c3b9aa0..efc69c5cb8 100644
--- a/yql/essentials/core/common_opt/yql_flatmap_over_join.cpp
+++ b/yql/essentials/core/common_opt/yql_flatmap_over_join.cpp
@@ -201,7 +201,7 @@ TExprNode::TPtr ApplyJoinPredicate(const TExprNode::TPtr& predicate, const TExpr
TExprNode::TPtr SingleInputPredicatePushdownOverEquiJoin(TExprNode::TPtr equiJoin, TExprNode::TPtr predicate,
const TSet<TStringBuf>& usedFields, TExprNode::TPtr args, const TJoinLabels& labels,
- ui32 firstCandidate, const TMap<TStringBuf, TVector<TStringBuf>>& renameMap, bool ordered, TExprContext& ctx)
+ ui32 firstCandidate, const TMap<TStringBuf, TVector<TStringBuf>>& renameMap, bool ordered, bool skipNulls, TExprContext& ctx)
{
auto inputsCount = equiJoin->ChildrenSize() - 2;
auto joinTree = equiJoin->Child(inputsCount);
@@ -274,7 +274,7 @@ TExprNode::TPtr SingleInputPredicatePushdownOverEquiJoin(TExprNode::TPtr equiJoi
auto prevInput = equiJoin->Child(inputIndex)->ChildPtr(0);
auto newInput = prevInput;
- if (x.second) {
+ if (x.second && skipNulls) {
// skip null key columns
TSet<TString> optionalKeyColumns;
GatherOptionalKeyColumns(joinTree, labels, inputIndex, optionalKeyColumns);
@@ -340,7 +340,7 @@ std::pair<TExprNode::TPtr, TExprNode::TPtr> IsRightSideForLeftJoin(
TExprNode::TPtr FilterPushdownOverJoinOptionalSide(TExprNode::TPtr equiJoin, TExprNode::TPtr predicate,
const TSet<TStringBuf>& usedFields, TExprNode::TPtr args, const TJoinLabels& labels,
- ui32 inputIndex, const TMap<TStringBuf, TVector<TStringBuf>>& renameMap, bool ordered, TExprContext& ctx,
+ ui32 inputIndex, const TMap<TStringBuf, TVector<TStringBuf>>& renameMap, bool ordered, bool skipNulls, TExprContext& ctx,
const TPositionHandle& pos)
{
auto inputsCount = equiJoin->ChildrenSize() - 2;
@@ -403,11 +403,13 @@ TExprNode::TPtr FilterPushdownOverJoinOptionalSide(TExprNode::TPtr equiJoin, TEx
YQL_ENSURE(leftJoinTree->Child(2)->IsAtom());
auto rightSideInput = equiJoinLabels.at(leftJoinTree->Child(2)->Content());
- // skip null key columns
- TSet<TString> optionalKeyColumns;
- GatherOptionalKeyColumns(joinTree, labels, inputIndex, optionalKeyColumns);
- rightSideInput = FilterOutNullJoinColumns(predicate->Pos(),
- rightSideInput, labels.Inputs[inputIndex], optionalKeyColumns, ctx);
+ if (skipNulls) {
+ // skip null key columns
+ TSet<TString> optionalKeyColumns;
+ GatherOptionalKeyColumns(joinTree, labels, inputIndex, optionalKeyColumns);
+ rightSideInput = FilterOutNullJoinColumns(predicate->Pos(),
+ rightSideInput, labels.Inputs[inputIndex], optionalKeyColumns, ctx);
+ }
// then apply predicate
auto filteredInput = ApplyJoinPredicate(
@@ -907,6 +909,19 @@ TExprNode::TPtr DecayCrossJoinIntoInner(TExprNode::TPtr equiJoin, const TExprNod
return ctx.ChangeChild(*equiJoin, inputsCount, std::move(newJoinTree));
}
+bool NeedEmitSkipNullMembers(const TTypeAnnotationContext* types) {
+ YQL_ENSURE(types);
+ static const TString emitFlag = to_lower(TString("EmitSkipNullOnPushdown"));
+ static const TString noEmitFlag = to_lower(TString("DisableEmitSkipNullOnPushdown"));
+ if (types->OptimizerFlags.contains(emitFlag)) {
+ return true;
+ }
+ if (types->OptimizerFlags.contains(noEmitFlag)) {
+ return false;
+ }
+ return true;
+}
+
} // namespace
TExprBase FlatMapOverEquiJoin(
@@ -1048,6 +1063,7 @@ TExprBase FlatMapOverEquiJoin(
}
const bool ordered = node.Maybe<TCoOrderedFlatMap>().IsValid();
+ const bool skipNulls = NeedEmitSkipNullMembers(types);
for (auto& andTerm : andTerms) {
if (andTerm->IsCallable("Likely")) {
@@ -1066,7 +1082,7 @@ TExprBase FlatMapOverEquiJoin(
if (!multiUsage && inputs.size() == 1) {
auto newJoin = SingleInputPredicatePushdownOverEquiJoin(equiJoin.Ptr(), andTerm, usedFields,
- node.Lambda().Args().Ptr(), labels, *inputs.begin(), renameMap, ordered, ctx);
+ node.Lambda().Args().Ptr(), labels, *inputs.begin(), renameMap, ordered, skipNulls, ctx);
if (newJoin != equiJoin.Ptr()) {
YQL_CLOG(DEBUG, Core) << "SingleInputPredicatePushdownOverEquiJoin";
ret = newJoin;
@@ -1074,7 +1090,7 @@ TExprBase FlatMapOverEquiJoin(
break;
} else if (types->FilterPushdownOverJoinOptionalSide) {
auto twoJoins = FilterPushdownOverJoinOptionalSide(equiJoin.Ptr(), andTerm, usedFields,
- node.Lambda().Args().Ptr(), labels, *inputs.begin(), renameMap, ordered, ctx, node.Pos());
+ node.Lambda().Args().Ptr(), labels, *inputs.begin(), renameMap, ordered, skipNulls, ctx, node.Pos());
if (twoJoins != equiJoin.Ptr()) {
YQL_CLOG(DEBUG, Core) << "RightSidePredicatePushdownOverLeftJoin";
ret = twoJoins;
diff --git a/yql/essentials/core/ut/ya.make b/yql/essentials/core/ut/ya.make
index 8b7c2d7b60..1813a0032f 100644
--- a/yql/essentials/core/ut/ya.make
+++ b/yql/essentials/core/ut/ya.make
@@ -46,7 +46,7 @@ PEERDIR(
)
RESOURCE(
- contrib/ydb/library/yql/cfg/tests/fs.conf fs.conf
+ yql/essentials/cfg/tests/fs.conf fs.conf
)
IF (SANITIZER_TYPE == "thread" OR WITH_VALGRIND)
diff --git a/yql/essentials/parser/pg_wrapper/test/test_doc.py b/yql/essentials/parser/pg_wrapper/test/test_doc.py
index 01e5b646e4..52214190e4 100644
--- a/yql/essentials/parser/pg_wrapper/test/test_doc.py
+++ b/yql/essentials/parser/pg_wrapper/test/test_doc.py
@@ -17,7 +17,7 @@ def run_one(item):
support_udfs = True
yqlrun_res = YQLRun(prov='yt',
use_sql2yql=False,
- cfg_dir='contrib/ydb/library/yql/cfg/udf_test',
+ cfg_dir='yql/essentials/cfg/udf_test',
support_udfs=support_udfs).yql_exec(
program="--!syntax_pg\n" + input,
run_sql=True,
diff --git a/yql/essentials/parser/pg_wrapper/test/ya.make b/yql/essentials/parser/pg_wrapper/test/ya.make
index 4ee6684cf7..9b29b15f97 100644
--- a/yql/essentials/parser/pg_wrapper/test/ya.make
+++ b/yql/essentials/parser/pg_wrapper/test/ya.make
@@ -23,12 +23,12 @@ REQUIREMENTS(
DATA(
arcadia/contrib/ydb/docs/ru/core/postgresql/_includes/functions.md
- arcadia/contrib/ydb/library/yql/cfg/udf_test
+ arcadia/yql/essentials/cfg/udf_test
arcadia/yql/essentials/mount
)
PEERDIR(
- contrib/ydb/library/yql/tests/common/test_framework
+ yql/essentials/tests/common/test_framework
)
DEPENDS(
diff --git a/yql/essentials/tests/common/test_framework/conftest.py b/yql/essentials/tests/common/test_framework/conftest.py
new file mode 100644
index 0000000000..675726de78
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/conftest.py
@@ -0,0 +1,14 @@
+try:
+ from yql_http_file_server import yql_http_file_server
+except ImportError:
+ yql_http_file_server = None
+
+try:
+ from solomon_runner import solomon
+except ImportError:
+ solomon = None
+
+# bunch of useless statements for linter happiness
+# (otherwise it complains about unused names)
+assert yql_http_file_server is yql_http_file_server
+assert solomon is solomon
diff --git a/yql/essentials/tests/common/test_framework/solomon_runner.py b/yql/essentials/tests/common/test_framework/solomon_runner.py
new file mode 100644
index 0000000000..de6062a9ec
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/solomon_runner.py
@@ -0,0 +1,40 @@
+import os
+import pytest
+import requests
+
+
+class SolomonWrapper(object):
+ def __init__(self, url, endpoint):
+ self._url = url
+ self._endpoint = endpoint
+ self.table_prefix = ""
+
+ def is_valid(self):
+ return self._url is not None
+
+ def cleanup(self):
+ res = requests.post(self._url + "/cleanup")
+ res.raise_for_status()
+
+ def get_metrics(self):
+ res = requests.get(self._url + "/metrics?project=my_project&cluster=my_cluster&service=my_service")
+ res.raise_for_status()
+ return res.text
+
+ def prepare_program(self, program, program_file, res_dir, lang='sql'):
+ return program, program_file
+
+ @property
+ def url(self):
+ return self._url
+
+ @property
+ def endpoint(self):
+ return self._endpoint
+
+
+@pytest.fixture(scope='module')
+def solomon(request):
+ solomon_url = os.environ.get("SOLOMON_URL")
+ solomon_endpoint = os.environ.get("SOLOMON_ENDPOINT")
+ return SolomonWrapper(solomon_url, solomon_endpoint)
diff --git a/yql/essentials/tests/common/test_framework/test_file_common.py b/yql/essentials/tests/common/test_framework/test_file_common.py
new file mode 100644
index 0000000000..b33076e561
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/test_file_common.py
@@ -0,0 +1,155 @@
+import codecs
+import os
+import pytest
+import re
+import cyson
+
+import yql.essentials.providers.common.proto.gateways_config_pb2 as gateways_config_pb2
+
+from google.protobuf import text_format
+from yql_utils import execute_sql, get_supported_providers, get_tables, get_files, get_http_files, \
+ get_pragmas, KSV_ATTR, is_xfail, get_param, YQLExecResult, yql_binary_path
+from yqlrun import YQLRun
+
+from test_utils import get_parameters_json, DATA_PATH, replace_vars
+
+
+def get_gateways_config(http_files, yql_http_file_server, force_blocks=False, is_hybrid=False):
+ config = None
+
+ if http_files or force_blocks or is_hybrid:
+ config_message = gateways_config_pb2.TGatewaysConfig()
+ if http_files:
+ schema = config_message.Fs.CustomSchemes.add()
+ schema.Pattern = 'http_test://(.*)'
+ schema.TargetUrl = yql_http_file_server.compose_http_link('$1')
+ if force_blocks:
+ config_message.SqlCore.TranslationFlags.extend(['EmitAggApply'])
+ flags = config_message.YqlCore.Flags.add()
+ flags.Name = 'UseBlocks'
+ if is_hybrid:
+ activate_hybrid = config_message.Yt.DefaultSettings.add()
+ activate_hybrid.Name = "HybridDqExecution"
+ activate_hybrid.Value = "1"
+ deactivate_dq = config_message.Dq.DefaultSettings.add()
+ deactivate_dq.Name = "AnalyzeQuery"
+ deactivate_dq.Value = "0"
+ config = text_format.MessageToString(config_message)
+
+ return config
+
+
+def is_hybrid(provider):
+ return provider == 'hybrid'
+
+
+def check_provider(provider, config):
+ if provider not in get_supported_providers(config):
+ pytest.skip('%s provider is not supported here' % provider)
+
+
+def get_sql_query(provider, suite, case, config):
+ pragmas = get_pragmas(config)
+
+ if get_param('TARGET_PLATFORM'):
+ if "yson" in case or "regexp" in case or "match" in case:
+ pytest.skip('yson/match/regexp is not supported on non-default target platform')
+
+ if get_param('TARGET_PLATFORM') and is_xfail(config):
+ pytest.skip('xfail is not supported on non-default target platform')
+
+ program_sql = os.path.join(DATA_PATH, suite, '%s.sql' % case)
+
+ with codecs.open(program_sql, encoding='utf-8') as program_file_descr:
+ sql_query = program_file_descr.read()
+ if get_param('TARGET_PLATFORM'):
+ if "Yson::" in sql_query:
+ pytest.skip('yson udf is not supported on non-default target platform')
+ if (provider + 'file can not' in sql_query) or (is_hybrid(provider) and ('ytfile can not' in sql_query)):
+ pytest.skip(provider + ' can not execute this')
+
+ pragmas.append(sql_query)
+ sql_query = ';\n'.join(pragmas)
+ if 'Python' in sql_query or 'Javascript' in sql_query:
+ pytest.skip('ScriptUdf')
+
+ assert 'UseBlocks' not in sql_query, 'UseBlocks should not be used directly, only via ForceBlocks'
+
+ return sql_query
+
+
+def run_file_no_cache(provider, suite, case, cfg, config, yql_http_file_server, yqlrun_binary=None, extra_args=[], force_blocks=False):
+ check_provider(provider, config)
+
+ sql_query = get_sql_query(provider, suite, case, config)
+ sql_query = replace_vars(sql_query, "yqlrun_var")
+
+ xfail = is_xfail(config)
+
+ in_tables, out_tables = get_tables(suite, config, DATA_PATH, def_attr=KSV_ATTR)
+ files = get_files(suite, config, DATA_PATH)
+ http_files = get_http_files(suite, config, DATA_PATH)
+ http_files_urls = yql_http_file_server.register_files({}, http_files)
+
+ for table in in_tables:
+ if cyson.loads(table.attr).get("type") == "document":
+ content = table.content
+ else:
+ content = table.attr
+ if 'Python' in content or 'Javascript' in content:
+ pytest.skip('ScriptUdf')
+
+ parameters = get_parameters_json(suite, config)
+
+ yqlrun = YQLRun(
+ prov=provider,
+ keep_temp=not re.search(r"yt\.ReleaseTempData", sql_query),
+ binary=yqlrun_binary,
+ gateway_config=get_gateways_config(http_files, yql_http_file_server, force_blocks=force_blocks, is_hybrid=is_hybrid(provider)),
+ extra_args=extra_args,
+ udfs_dir=yql_binary_path('yql/essentials/tests/common/test_framework/udfs_deps')
+ )
+
+ res, tables_res = execute_sql(
+ yqlrun,
+ program=sql_query,
+ input_tables=in_tables,
+ output_tables=out_tables,
+ files=files,
+ urls=http_files_urls,
+ check_error=not xfail,
+ verbose=True,
+ parameters=parameters)
+
+ fixed_stderr = res.std_err
+ if xfail:
+ assert res.execution_result.exit_code != 0
+ custom_error = re.search(r"/\* custom error:(.*)\*/", sql_query)
+ if custom_error:
+ err_string = custom_error.group(1)
+ assert res.std_err.find(err_string) != -1
+ fixed_stderr = None
+
+ fixed_result = YQLExecResult(res.std_out,
+ fixed_stderr,
+ res.results,
+ res.results_file,
+ res.opt,
+ res.opt_file,
+ res.plan,
+ res.plan_file,
+ res.program,
+ res.execution_result,
+ None)
+
+ return fixed_result, tables_res
+
+
+def run_file(provider, suite, case, cfg, config, yql_http_file_server, yqlrun_binary=None, extra_args=[], force_blocks=False):
+ if (suite, case, cfg) not in run_file.cache:
+ run_file.cache[(suite, case, cfg)] = run_file_no_cache(provider, suite, case, cfg, config, yql_http_file_server, yqlrun_binary, extra_args, force_blocks=force_blocks)
+
+ return run_file.cache[(suite, case, cfg)]
+
+
+run_file.cache = {}
diff --git a/yql/essentials/tests/common/test_framework/test_utils.py b/yql/essentials/tests/common/test_framework/test_utils.py
new file mode 100644
index 0000000000..624b33be89
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/test_utils.py
@@ -0,0 +1,269 @@
+import json
+import os
+import re
+import yatest.common
+
+from yql_utils import get_param as yql_get_param
+from google.protobuf import text_format
+import yql.essentials.providers.common.proto.gateways_config_pb2 as gateways_config_pb2
+
+DATA_PATH = yatest.common.source_path('yql/essentials/tests/sql/suites')
+try:
+ SQLRUN_PATH = yatest.common.binary_path('yql/essentials/tools/sql2yql/sql2yql')
+except BaseException:
+ SQLRUN_PATH = None
+
+try:
+ YQLRUN_PATH = yatest.common.binary_path('contrib/ydb/library/yql/tools/yqlrun/yqlrun')
+except BaseException:
+ YQLRUN_PATH = None
+
+
+def get_sql_flags():
+ gateway_config = gateways_config_pb2.TGatewaysConfig()
+
+ with open(yatest.common.source_path('yql/essentials/cfg/tests/gateways.conf')) as f:
+ text_format.Merge(f.read(), gateway_config)
+
+ if yql_get_param('SQL_FLAGS'):
+ flags = yql_get_param('SQL_FLAGS').split(',')
+ gateway_config.SqlCore.TranslationFlags.extend(flags)
+ return gateway_config.SqlCore.TranslationFlags
+
+
+try:
+ SQL_FLAGS = get_sql_flags()
+except BaseException:
+ SQL_FLAGS = None
+
+
+def recursive_glob(root, begin_template=None, end_template=None):
+ for parent, dirs, files in os.walk(root):
+ for filename in files:
+ if begin_template is not None and not filename.startswith(begin_template):
+ continue
+ if end_template is not None and not filename.endswith(end_template):
+ continue
+ path = os.path.join(parent, filename)
+ yield os.path.relpath(path, root)
+
+
+def pytest_generate_tests_by_template(template, metafunc):
+ argvalues = []
+
+ suites = [name for name in os.listdir(DATA_PATH) if os.path.isdir(os.path.join(DATA_PATH, name))]
+ for suite in suites:
+ for case in sorted([sql_query_path[:-len(template)]
+ for sql_query_path in recursive_glob(os.path.join(DATA_PATH, suite), end_template=template)]):
+ argvalues.append((suite, case))
+
+ metafunc.parametrize(['suite', 'case'], argvalues)
+
+
+def pytest_generate_tests_for_run(metafunc, template='.sql', suites=None, currentPart=0, partsCount=1, data_path=None):
+ if data_path is None:
+ data_path = DATA_PATH
+ argvalues = []
+
+ if not suites:
+ suites = sorted([name for name in os.listdir(data_path) if os.path.isdir(os.path.join(data_path, name))])
+
+ for suite in suites:
+ suite_dir = os.path.join(data_path, suite)
+ # .sql's
+ for case in sorted([sql_query_path[:-len(template)]
+ for sql_query_path in recursive_glob(suite_dir, end_template=template)]):
+ case_program = case + template
+ with open(os.path.join(suite_dir, case_program)) as f:
+ if 'do not execute' in f.read():
+ continue
+
+ # .cfg's
+ configs = [
+ cfg_file.replace(case + '-', '').replace('.cfg', '')
+ for cfg_file in recursive_glob(suite_dir, begin_template=case + '-', end_template='.cfg')
+ ]
+ if os.path.exists(suite_dir + '/' + case + '.cfg'):
+ configs.append('')
+ for cfg in sorted(configs):
+ if hash((suite, case, cfg)) % partsCount == currentPart:
+ argvalues.append((suite, case, cfg))
+ if not configs and hash((suite, case, 'default.txt')) % partsCount == currentPart:
+ argvalues.append((suite, case, 'default.txt'))
+
+ metafunc.parametrize(
+ ['suite', 'case', 'cfg'],
+ argvalues,
+ )
+
+
+def pytest_generate_tests_for_part(metafunc, currentPart, partsCount):
+ return pytest_generate_tests_for_run(metafunc, currentPart=currentPart, partsCount=partsCount)
+
+
+def get_cfg_file(cfg, case):
+ if cfg:
+ return (case + '-' + cfg + '.cfg') if cfg != 'default.txt' else 'default.cfg'
+ else:
+ return case + '.cfg'
+
+
+def validate_cfg(result):
+ for r in result:
+ assert r[0] in (
+ "in",
+ "in2",
+ "out",
+ "udf",
+ "providers",
+ "res",
+ "canonize_peephole",
+ "canonize_lineage",
+ "peephole_use_blocks",
+ "with_final_result_issues",
+ "xfail",
+ "pragma",
+ "canonize_yt",
+ "file",
+ "http_file",
+ "yt_file",
+ "os",
+ "param",
+ ), "Unknown command in .cfg: %s" % (r[0])
+
+
+def get_config(suite, case, cfg, data_path=None):
+ if data_path is None:
+ data_path = DATA_PATH
+ result = []
+ try:
+ default_cfg = get_cfg_file('default.txt', case)
+ inherit = ['canonize_peephole', 'canonize_lineage', 'peephole_use_blocks']
+ with open(os.path.join(data_path, suite, default_cfg)) as cfg_file_content:
+ result = [line.strip().split() for line in cfg_file_content.readlines() if line.strip() and line.strip().split()[0]]
+ validate_cfg(result)
+ result = [r for r in result if r[0] in inherit]
+ except IOError:
+ pass
+ cfg_file = get_cfg_file(cfg, case)
+ with open(os.path.join(data_path, suite, cfg_file)) as cfg_file_content:
+ result = [line.strip().split() for line in cfg_file_content.readlines() if line.strip()] + result
+ validate_cfg(result)
+ return result
+
+
+def load_json_file_strip_comments(path):
+ with open(path) as file:
+ return '\n'.join([line for line in file.readlines() if not line.startswith('#')])
+
+
+def get_parameters_files(suite, config):
+ result = []
+ for line in config:
+ if len(line) != 3 or not line[0] == "param":
+ continue
+
+ result.append((line[1], os.path.join(DATA_PATH, suite, line[2])))
+
+ return result
+
+
+def get_parameters_json(suite, config):
+ parameters_files = get_parameters_files(suite, config)
+ data = {}
+ for p in parameters_files:
+ value_json = json.loads(load_json_file_strip_comments(p[1]))
+ data[p[0]] = {'Data': value_json}
+
+ return data
+
+
+def output_dir(name):
+ output_dir = yatest.common.output_path(name)
+ if not os.path.isdir(output_dir):
+ os.mkdir(output_dir)
+ return output_dir
+
+
+def run_sql_on_mr(name, query, kikimr):
+ out_dir = output_dir(name)
+ opt_file = os.path.join(out_dir, 'opt.yql')
+ results_file = os.path.join(out_dir, 'results.yson')
+
+ try:
+ kikimr(
+ 'yql-exec -d 1 -P %s --sql --run --optimize -i /dev/stdin --oexpr %s --oresults %s' % (
+ kikimr.yql_pool_id,
+ opt_file,
+ results_file
+ ),
+ stdin=query
+ )
+ except yatest.common.ExecutionError as e:
+ runyqljob_result = e.execution_result
+ assert 0, 'yql-exec finished with error: \n\n%s \n\non program: \n\n%s' % (
+ runyqljob_result.std_err,
+ query
+ )
+ return opt_file, results_file
+
+
+def normalize_table(csv, fields_order=None):
+ '''
+ :param csv: table content
+ :param fields_order: normal order of fields (default: 'key', 'subkey', 'value')
+ :return: normalized table content
+ '''
+ if not csv.strip():
+ return ''
+
+ headers = csv.splitlines()[0].strip().split(';')
+
+ if fields_order is None:
+ if len(set(headers)) < len(headers):
+ # we have duplicates in case of joining tables, let's just cut headers and return as is
+ return '\n'.join(csv.splitlines()[1:])
+
+ fields_order = headers
+
+ normalized = ''
+
+ if any(field not in headers for field in fields_order):
+ fields_order = sorted(headers)
+
+ translator = {
+ field: headers.index(field) for field in fields_order
+ }
+
+ def normalize_cell(s):
+ if s == 't':
+ return 'true'
+ if s == 'f':
+ return 'false'
+
+ if '.' in s:
+ try:
+ f = float(s)
+ return str(str(int(f)) if f.is_integer() else f)
+ except ValueError:
+ return s
+ else:
+ return s
+
+ for line in csv.splitlines()[1:]:
+ line = line.strip().split(';')
+ normalized_cells = [normalize_cell(line[translator[field]]) for field in fields_order]
+ normalized += '\n' + ';'.join(normalized_cells)
+
+ return normalized.strip()
+
+
+def replace_vars(sql_query, var_tag):
+ """
+ Sql can contain comment like /* yt_local_var: VAR_NAME=VAR_VALUE */
+ it will replace VAR_NAME with VAR_VALUE within sql query
+ """
+ vars = re.findall(r"\/\* {}: (.*)=(.*) \*\/".format(var_tag), sql_query)
+ for var_name, var_value in vars:
+ sql_query = re.sub(re.escape(var_name.strip()), var_value.strip(), sql_query)
+ return sql_query
diff --git a/yql/essentials/tests/common/test_framework/udfs_deps/ya.make b/yql/essentials/tests/common/test_framework/udfs_deps/ya.make
new file mode 100644
index 0000000000..16b320bc3b
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/udfs_deps/ya.make
@@ -0,0 +1,51 @@
+SET(
+ UDFS
+ yql/essentials/udfs/common/datetime2
+ yql/essentials/udfs/common/digest
+ yql/essentials/udfs/common/file
+ yql/essentials/udfs/common/hyperloglog
+ yql/essentials/udfs/common/pire
+ yql/essentials/udfs/common/protobuf
+ yql/essentials/udfs/common/re2
+ yql/essentials/udfs/common/set
+ yql/essentials/udfs/common/stat
+ yql/essentials/udfs/common/topfreq
+ yql/essentials/udfs/common/top
+ yql/essentials/udfs/common/string
+ yql/essentials/udfs/common/histogram
+ yql/essentials/udfs/common/json2
+ yql/essentials/udfs/common/yson2
+ yql/essentials/udfs/common/math
+ yql/essentials/udfs/common/url_base
+ yql/essentials/udfs/common/unicode_base
+ yql/essentials/udfs/common/streaming
+ yql/essentials/udfs/examples/callables
+ yql/essentials/udfs/examples/dicts
+ yql/essentials/udfs/examples/dummylog
+ yql/essentials/udfs/examples/lists
+ yql/essentials/udfs/examples/structs
+ yql/essentials/udfs/examples/type_inspection
+ yql/essentials/udfs/logs/dsv
+ yql/essentials/udfs/test/simple
+ yql/essentials/udfs/test/test_import
+)
+
+IF (OS_LINUX AND CLANG)
+ SET(
+ UDFS
+ ${UDFS}
+ yql/essentials/udfs/common/hyperscan
+ )
+ENDIF()
+
+PACKAGE()
+
+IF (SANITIZER_TYPE != "undefined")
+
+PEERDIR(
+ ${UDFS}
+)
+
+ENDIF()
+
+END()
diff --git a/yql/essentials/tests/common/test_framework/ya.make b/yql/essentials/tests/common/test_framework/ya.make
new file mode 100644
index 0000000000..c0d912d16e
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/ya.make
@@ -0,0 +1,32 @@
+PY23_LIBRARY()
+
+PY_SRCS(
+ TOP_LEVEL
+ solomon_runner.py
+ yql_utils.py
+ yql_ports.py
+ yqlrun.py
+ yql_http_file_server.py
+ test_utils.py
+ test_file_common.py
+)
+
+PY_SRCS(
+ NAMESPACE ydb_library_yql_test_framework
+ conftest.py
+)
+
+PEERDIR(
+ contrib/python/requests
+ contrib/python/six
+ contrib/python/urllib3
+ library/python/cyson
+ yql/essentials/core/file_storage/proto
+ yql/essentials/providers/common/proto
+)
+
+END()
+
+RECURSE(
+ udfs_deps
+)
diff --git a/yql/essentials/tests/common/test_framework/yql_http_file_server.py b/yql/essentials/tests/common/test_framework/yql_http_file_server.py
new file mode 100644
index 0000000000..ad58588ed1
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/yql_http_file_server.py
@@ -0,0 +1,136 @@
+import io
+import os
+import pytest
+import threading
+import shutil
+
+import six.moves.BaseHTTPServer as BaseHTTPServer
+import six.moves.socketserver as socketserver
+
+from yql_ports import get_yql_port, release_yql_port
+
+
+# handler is created on each request
+# store state in server
+class YqlHttpRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ def get_requested_filename(self):
+ return self.path.lstrip('/')
+
+ def do_GET(self):
+ f = self.send_head(self.get_requested_filename())
+ if f:
+ try:
+ shutil.copyfileobj(f, self.wfile)
+ finally:
+ f.close()
+
+ def do_HEAD(self):
+ f = self.send_head(self.get_requested_filename())
+ if f:
+ f.close()
+
+ def get_file_and_size(self, filename):
+ try:
+ path = self.server.file_paths[filename]
+ f = open(path, 'rb')
+ fs = os.fstat(f.fileno())
+ size = fs[6]
+ return (f, size)
+ except KeyError:
+ try:
+ content = self.server.file_contents[filename]
+ return (io.BytesIO(content), len(content))
+ except KeyError:
+ return (None, 0)
+
+ return (None, 0)
+
+ def send_head(self, filename):
+ (f, size) = self.get_file_and_size(filename)
+
+ if not f:
+ self.send_error(404, "File %s not found" % filename)
+ return None
+
+ if self.server.etag is not None:
+ if_none_match = self.headers.get('If-None-Match', None)
+ if if_none_match == self.server.etag:
+ self.send_response(304)
+ self.end_headers()
+ f.close()
+ return None
+
+ self.send_response(200)
+
+ if self.server.etag is not None:
+ self.send_header("ETag", self.server.etag)
+
+ self.send_header("Content-type", 'application/octet-stream')
+ self.send_header("Content-Length", size)
+ self.end_headers()
+ return f
+
+
+class YqlHttpFileServer(socketserver.TCPServer, object):
+ def __init__(self):
+ self.http_server_port = get_yql_port('YqlHttpFileServer')
+ super(YqlHttpFileServer, self).__init__(('', self.http_server_port), YqlHttpRequestHandler,
+ bind_and_activate=False)
+ self.file_contents = {}
+ self.file_paths = {}
+ # common etag for all resources
+ self.etag = None
+ self.serve_thread = None
+
+ def start(self):
+ self.allow_reuse_address = True
+ self.server_bind()
+ self.server_activate()
+ self.serve_thread = threading.Thread(target=self.serve_forever)
+ self.serve_thread.start()
+
+ def stop(self):
+ super(YqlHttpFileServer, self).shutdown()
+ self.serve_thread.join()
+ release_yql_port(self.http_server_port)
+ self.http_server_port = None
+
+ def forget_files(self):
+ self.register_files({}, {})
+
+ def set_etag(self, newEtag):
+ self.etag = newEtag
+
+ def register_new_path(self, key, file_path):
+ self.file_paths[key] = file_path
+ return self.compose_http_link(key)
+
+ def register_files(self, file_contents, file_paths):
+ self.file_contents = file_contents
+ self.file_paths = file_paths
+
+ keys = []
+ if file_contents:
+ keys.extend(file_contents.keys())
+
+ if file_paths:
+ keys.extend(file_paths.keys())
+
+ return {k: self.compose_http_link(k) for k in keys}
+
+ def compose_http_link(self, filename):
+ return self.compose_http_host() + '/' + filename
+
+ def compose_http_host(self):
+ if not self.http_server_port:
+ raise Exception('http_server_port is empty. start HTTP server first')
+
+ return 'http://localhost:%d' % self.http_server_port
+
+
+@pytest.fixture(scope='module')
+def yql_http_file_server(request):
+ server = YqlHttpFileServer()
+ server.start()
+ request.addfinalizer(server.stop)
+ return server
diff --git a/yql/essentials/tests/common/test_framework/yql_ports.py b/yql/essentials/tests/common/test_framework/yql_ports.py
new file mode 100644
index 0000000000..d61be1efdf
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/yql_ports.py
@@ -0,0 +1,43 @@
+from yatest.common.network import PortManager
+import yql_utils
+
+port_manager = None
+
+
+def get_yql_port(service='unknown'):
+ global port_manager
+
+ if port_manager is None:
+ port_manager = PortManager()
+
+ port = port_manager.get_port()
+ yql_utils.log('get port for service %s: %d' % (service, port))
+ return port
+
+
+def release_yql_port(port):
+ if port is None:
+ return
+
+ global port_manager
+ port_manager.release_port(port)
+
+
+def get_yql_port_range(service, count):
+ global port_manager
+
+ if port_manager is None:
+ port_manager = PortManager()
+
+ port = port_manager.get_port_range(None, count)
+ yql_utils.log('get port range for service %s: start_port: %d, count: %d' % (service, port, count))
+ return port
+
+
+def release_yql_port_range(start_port, count):
+ if start_port is None:
+ return
+
+ global port_manager
+ for port in range(start_port, start_port + count):
+ port_manager.release_port(port)
diff --git a/yql/essentials/tests/common/test_framework/yql_utils.py b/yql/essentials/tests/common/test_framework/yql_utils.py
new file mode 100644
index 0000000000..85970dab02
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/yql_utils.py
@@ -0,0 +1,1043 @@
+from __future__ import print_function
+
+import hashlib
+import io
+import os
+import os.path
+import six
+import sys
+import re
+import tempfile
+import shutil
+
+from google.protobuf import text_format
+from collections import namedtuple, defaultdict, OrderedDict
+from functools import partial
+import codecs
+import decimal
+from threading import Lock
+
+import pytest
+import yatest.common
+import cyson
+
+import logging
+import getpass
+
+logger = logging.getLogger(__name__)
+
+KSV_ATTR = '''{_yql_row_spec={
+ Type=[StructType;
+ [[key;[DataType;String]];
+ [subkey;[DataType;String]];
+ [value;[DataType;String]]]]}}'''
+
+
+def get_param(name, default=None):
+ name = 'YQL_' + name.upper()
+ return yatest.common.get_param(name, os.environ.get(name) or default)
+
+
+def do_custom_query_check(res, sql_query):
+ custom_check = re.search(r"/\* custom check:(.*)\*/", sql_query)
+ if not custom_check:
+ return False
+ custom_check = custom_check.group(1)
+ yt_res_yson = res.results
+ yt_res_yson = cyson.loads(yt_res_yson) if yt_res_yson else cyson.loads("[]")
+ yt_res_yson = replace_vals(yt_res_yson)
+ assert eval(custom_check), 'Condition "%(custom_check)s" fails\nResult:\n %(yt_res_yson)s\n' % locals()
+ return True
+
+
+def get_gateway_cfg_suffix():
+ default_suffix = None
+ return get_param('gateway_config_suffix', default_suffix) or ''
+
+
+def get_gateway_cfg_filename():
+ suffix = get_gateway_cfg_suffix()
+ if suffix == '':
+ return 'gateways.conf'
+ else:
+ return 'gateways-' + suffix + '.conf'
+
+
+def merge_default_gateway_cfg(cfg_dir, gateway_config):
+
+ with open(yql_source_path(os.path.join(cfg_dir, 'gateways.conf'))) as f:
+ text_format.Merge(f.read(), gateway_config)
+
+ suffix = get_gateway_cfg_suffix()
+ if suffix:
+ with open(yql_source_path(os.path.join(cfg_dir, 'gateways-' + suffix + '.conf'))) as f:
+ text_format.Merge(f.read(), gateway_config)
+
+
+def find_file(path):
+ arcadia_root = '.'
+ while '.arcadia.root' not in os.listdir(arcadia_root):
+ arcadia_root = os.path.join(arcadia_root, '..')
+ res = os.path.abspath(os.path.join(arcadia_root, path))
+ assert os.path.exists(res)
+ return res
+
+
+output_path_cache = {}
+
+
+def yql_output_path(*args, **kwargs):
+ if not get_param('LOCAL_BENCH_XX'):
+ # abspath is needed, because output_path may be relative when test is run directly (without ya make).
+ return os.path.abspath(yatest.common.output_path(*args, **kwargs))
+
+ else:
+ if args and args in output_path_cache:
+ return output_path_cache[args]
+ res = os.path.join(tempfile.mkdtemp(prefix='yql_tmp_'), *args)
+ if args:
+ output_path_cache[args] = res
+ return res
+
+
+def yql_binary_path(*args, **kwargs):
+ if not get_param('LOCAL_BENCH_XX'):
+ return yatest.common.binary_path(*args, **kwargs)
+
+ else:
+ return find_file(args[0])
+
+
+def yql_source_path(*args, **kwargs):
+ if not get_param('LOCAL_BENCH_XX'):
+ return yatest.common.source_path(*args, **kwargs)
+ else:
+ return find_file(args[0])
+
+
+def yql_work_path():
+ return os.path.abspath('.')
+
+
+YQLExecResult = namedtuple('YQLExecResult', (
+ 'std_out',
+ 'std_err',
+ 'results',
+ 'results_file',
+ 'opt',
+ 'opt_file',
+ 'plan',
+ 'plan_file',
+ 'program',
+ 'execution_result',
+ 'statistics'
+))
+
+Table = namedtuple('Table', (
+ 'name',
+ 'full_name',
+ 'content',
+ 'file',
+ 'yqlrun_file',
+ 'attr',
+ 'format',
+ 'exists'
+))
+
+
+def new_table(full_name, file_path=None, yqlrun_file=None, content=None, res_dir=None,
+ attr=None, format_name='yson', def_attr=None, should_exist=False, src_file_alternative=None):
+ assert '.' in full_name, 'expected name like cedar.Input'
+ name = '.'.join(full_name.split('.')[1:])
+
+ if res_dir is None:
+ res_dir = get_yql_dir('table_')
+
+ exists = True
+ if content is None:
+ # try read content from files
+ src_file = file_path or yqlrun_file
+ if src_file is None:
+ # nonexistent table, will be output for query
+ content = ''
+ exists = False
+ else:
+ if os.path.exists(src_file):
+ with open(src_file, 'rb') as f:
+ content = f.read()
+ elif src_file_alternative and os.path.exists(src_file_alternative):
+ with open(src_file_alternative, 'rb') as f:
+ content = f.read()
+ src_file = src_file_alternative
+ yqlrun_file, src_file_alternative = src_file_alternative, yqlrun_file
+ else:
+ content = ''
+ exists = False
+
+ file_path = os.path.join(res_dir, name + '.txt')
+ new_yqlrun_file = os.path.join(res_dir, name + '.yqlrun.txt')
+
+ if exists:
+ with open(file_path, 'wb') as f:
+ f.write(content)
+
+ # copy or create yqlrun_file in proper dir
+ if yqlrun_file is not None:
+ shutil.copyfile(yqlrun_file, new_yqlrun_file)
+ else:
+ with open(new_yqlrun_file, 'wb') as f:
+ f.write(content)
+ else:
+ assert not should_exist, locals()
+
+ if attr is None:
+ # try read from file
+ attr_file = None
+ if os.path.exists(file_path + '.attr'):
+ attr_file = file_path + '.attr'
+ elif yqlrun_file is not None and os.path.exists(yqlrun_file + '.attr'):
+ attr_file = yqlrun_file + '.attr'
+ elif src_file_alternative is not None and os.path.exists(src_file_alternative + '.attr'):
+ attr_file = src_file_alternative + '.attr'
+
+ if attr_file is not None:
+ with open(attr_file) as f:
+ attr = f.read()
+
+ if attr is None:
+ attr = def_attr
+
+ if attr is not None:
+ # probably we get it, now write attr file to proper place
+ attr_file = new_yqlrun_file + '.attr'
+ with open(attr_file, 'w') as f:
+ f.write(attr)
+
+ return Table(
+ name,
+ full_name,
+ content,
+ file_path,
+ new_yqlrun_file,
+ attr,
+ format_name,
+ exists
+ )
+
+
+def ensure_dir_exists(dir):
+ # handle race between isdir and mkdir
+ if os.path.isdir(dir):
+ return
+
+ try:
+ os.mkdir(dir)
+ except OSError:
+ if not os.path.isdir(dir):
+ raise
+
+
+def get_yql_dir(prefix):
+ yql_dir = yql_output_path('yql')
+ ensure_dir_exists(yql_dir)
+ res_dir = tempfile.mkdtemp(prefix=prefix, dir=yql_dir)
+ os.chmod(res_dir, 0o755)
+ return res_dir
+
+
+def get_cmd_for_files(arg, files):
+ cmd = ' '.join(
+ arg + ' ' + name + '@' + files[name]
+ for name in files
+ )
+ cmd += ' '
+ return cmd
+
+
+def read_res_file(file_path):
+ if os.path.exists(file_path):
+ with codecs.open(file_path, encoding="utf-8") as descr:
+ res = descr.read().strip()
+ if res == '':
+ log_res = '<EMPTY>'
+ else:
+ log_res = res
+ else:
+ res = ''
+ log_res = '<NOTHING>'
+ return res, log_res
+
+
+def normalize_yson(y):
+ from cyson import YsonBoolean, YsonEntity
+ if isinstance(y, YsonBoolean) or isinstance(y, bool):
+ return 'true' if y else 'false'
+ if isinstance(y, YsonEntity) or y is None:
+ return None
+ if isinstance(y, list):
+ return [normalize_yson(i) for i in y]
+ if isinstance(y, dict):
+ return {normalize_yson(k): normalize_yson(v) for k, v in six.iteritems(y)}
+ s = str(y) if not isinstance(y, six.text_type) else y.encode('utf-8', errors='xmlcharrefreplace')
+ return s
+
+
+volatile_attrs = {'DataSize', 'ModifyTime', 'Id', 'Revision'}
+current_user = getpass.getuser()
+
+
+def _replace_vals_impl(y):
+ if isinstance(y, list):
+ return [_replace_vals_impl(i) for i in y]
+ if isinstance(y, dict):
+ return {_replace_vals_impl(k): _replace_vals_impl(v) for k, v in six.iteritems(y) if k not in volatile_attrs}
+ if isinstance(y, str):
+ s = y.replace('tmp/yql/' + current_user + '/', 'tmp/')
+ s = re.sub(r'tmp/[0-9a-f]+-[0-9a-f]+-[0-9a-f]+-[0-9a-f]+', 'tmp/<temp_table_guid>', s)
+ return s
+ return y
+
+
+def replace_vals(y):
+ y = normalize_yson(y)
+ y = _replace_vals_impl(y)
+ return y
+
+
+def patch_yson_vals(y, patcher):
+ if isinstance(y, list):
+ return [patch_yson_vals(i, patcher) for i in y]
+ if isinstance(y, dict):
+ return {patch_yson_vals(k, patcher): patch_yson_vals(v, patcher) for k, v in six.iteritems(y)}
+ if isinstance(y, str):
+ return patcher(y)
+ return y
+
+
+floatRe = re.compile(r'^-?\d*\.\d+$')
+floatERe = re.compile(r'^-?(\d*\.)?\d+e[\+\-]?\d+$', re.IGNORECASE)
+specFloatRe = re.compile(r'^(-?inf|nan)$', re.IGNORECASE)
+
+
+def fix_double(x):
+ if floatRe.match(x) and len(x.replace('.', '').replace('-', '')) > 10:
+ # Emulate the same double precision as C++ code has
+ decimal.getcontext().rounding = decimal.ROUND_HALF_DOWN
+ decimal.getcontext().prec = 10
+ return str(decimal.Decimal(0) + decimal.Decimal(x)).rstrip('0')
+ if floatERe.match(x):
+ # Emulate the same double precision as C++ code has
+ decimal.getcontext().rounding = decimal.ROUND_HALF_DOWN
+ decimal.getcontext().prec = 10
+ return str(decimal.Decimal(0) + decimal.Decimal(x)).lower()
+ if specFloatRe.match(x):
+ return x.lower()
+ return x
+
+
+def remove_volatile_ast_parts(ast):
+ return re.sub(r"\(KiClusterConfig '\('\(.*\) '\"\d\" '\"\d\" '\"\d\"\)\)", "(KiClusterConfig)", ast)
+
+
+def prepare_program(program, program_file, yql_dir, ext='yql'):
+ assert not (program is None and program_file is None), 'Needs program or program_file'
+
+ if program is None:
+ with codecs.open(program_file, encoding='utf-8') as program_file_descr:
+ program = program_file_descr.read()
+
+ program_file = os.path.join(yql_dir, 'program.' + ext)
+ with codecs.open(program_file, 'w', encoding='utf-8') as program_file_descr:
+ program_file_descr.write(program)
+
+ return program, program_file
+
+
+def get_program_cfg(suite, case, DATA_PATH):
+ ret = []
+ config = os.path.join(DATA_PATH, suite if suite else '', case + '.cfg')
+ if not os.path.exists(config):
+ config = os.path.join(DATA_PATH, suite if suite else '', 'default.cfg')
+
+ if os.path.exists(config):
+ for line in open(config, 'r'):
+ if line.strip():
+ ret.append(tuple(line.split()))
+ else:
+ in_filename = case + '.in'
+ in_path = os.path.join(DATA_PATH, in_filename)
+ default_filename = 'default.in'
+ default_path = os.path.join(DATA_PATH, default_filename)
+ for filepath in [in_path, in_filename, default_path, default_filename]:
+ if os.path.exists(filepath):
+ try:
+ shutil.copy2(filepath, in_path)
+ except shutil.Error:
+ pass
+ ret.append(('in', 'yamr.plato.Input', in_path))
+ break
+
+ if not is_os_supported(ret):
+ pytest.skip('%s not supported here' % sys.platform)
+
+ return ret
+
+
+def find_user_file(suite, path, DATA_PATH):
+ source_path = os.path.join(DATA_PATH, suite, path)
+ if os.path.exists(source_path):
+ return source_path
+ else:
+ try:
+ return yql_binary_path(path)
+ except Exception:
+ raise Exception('Can not find file ' + path)
+
+
+def get_input_tables(suite, cfg, DATA_PATH, def_attr=None):
+ in_tables = []
+ for item in cfg:
+ if item[0] in ('in', 'out'):
+ io, table_name, file_name = item
+ if io == 'in':
+ in_tables.append(new_table(
+ full_name=table_name.replace('yamr.', '').replace('yt.', ''),
+ yqlrun_file=os.path.join(DATA_PATH, suite if suite else '', file_name),
+ src_file_alternative=os.path.join(yql_work_path(), suite if suite else '', file_name),
+ def_attr=def_attr,
+ should_exist=True
+ ))
+ return in_tables
+
+
+def get_tables(suite, cfg, DATA_PATH, def_attr=None):
+ in_tables = []
+ out_tables = []
+ suite_dir = os.path.join(DATA_PATH, suite)
+ res_dir = get_yql_dir('table_')
+
+ for splitted in cfg:
+ if splitted[0] == 'udf' and yatest.common.context.sanitize == 'undefined':
+ pytest.skip("udf under ubsan")
+
+ if len(splitted) == 4:
+ type_name, table, file_name, format_name = splitted
+ elif len(splitted) == 3:
+ type_name, table, file_name = splitted
+ format_name = 'yson'
+ else:
+ continue
+ yqlrun_file = os.path.join(suite_dir, file_name)
+ if type_name == 'in':
+ in_tables.append(new_table(
+ full_name='plato.' + table if '.' not in table else table,
+ yqlrun_file=yqlrun_file,
+ format_name=format_name,
+ def_attr=def_attr,
+ res_dir=res_dir
+ ))
+ if type_name == 'out':
+ out_tables.append(new_table(
+ full_name='plato.' + table if '.' not in table else table,
+ yqlrun_file=yqlrun_file if os.path.exists(yqlrun_file) else None,
+ res_dir=res_dir
+ ))
+ return in_tables, out_tables
+
+
+def get_supported_providers(cfg):
+ providers = 'yt', 'kikimr', 'dq', 'hybrid'
+ for item in cfg:
+ if item[0] == 'providers':
+ providers = [i.strip() for i in ''.join(item[1:]).split(',')]
+ return providers
+
+
+def is_os_supported(cfg):
+ for item in cfg:
+ if item[0] == 'os':
+ return any(sys.platform.startswith(_os) for _os in item[1].split(','))
+ return True
+
+
+def is_xfail(cfg):
+ for item in cfg:
+ if item[0] == 'xfail':
+ return True
+ return False
+
+
+def is_skip_forceblocks(cfg):
+ for item in cfg:
+ if item[0] == 'skip_forceblocks':
+ return True
+ return False
+
+
+def is_canonize_peephole(cfg):
+ for item in cfg:
+ if item[0] == 'canonize_peephole':
+ return True
+ return False
+
+
+def is_peephole_use_blocks(cfg):
+ for item in cfg:
+ if item[0] == 'peephole_use_blocks':
+ return True
+ return False
+
+
+def is_canonize_lineage(cfg):
+ for item in cfg:
+ if item[0] == 'canonize_lineage':
+ return True
+ return False
+
+
+def is_canonize_yt(cfg):
+ for item in cfg:
+ if item[0] == 'canonize_yt':
+ return True
+ return False
+
+
+def is_with_final_result_issues(cfg):
+ for item in cfg:
+ if item[0] == 'with_final_result_issues':
+ return True
+ return False
+
+
+def skip_test_if_required(cfg):
+ for item in cfg:
+ if item[0] == 'skip_test':
+ pytest.skip(item[1])
+
+
+def get_pragmas(cfg):
+ pragmas = []
+ for item in cfg:
+ if item[0] == 'pragma':
+ pragmas.append(' '.join(item))
+ return pragmas
+
+
+def execute(
+ klass=None,
+ program=None,
+ program_file=None,
+ files=None,
+ urls=None,
+ run_sql=False,
+ verbose=False,
+ check_error=True,
+ input_tables=None,
+ output_tables=None,
+ pretty_plan=True,
+ parameters={},
+):
+ '''
+ Executes YQL/SQL
+
+ :param klass: KiKiMRForYQL if instance (default: YQLRun)
+ :param program: string with YQL or SQL program
+ :param program_file: file with YQL or SQL program (optional, if :param program: is None)
+ :param files: dict like {'name': '/path'} with extra files
+ :param urls: dict like {'name': url} with extra files urls
+ :param run_sql: execute sql instead of yql
+ :param verbose: log all results and diagnostics
+ :param check_error: fail on non-zero exit code
+ :param input_tables: list of Table (will be written if not exist)
+ :param output_tables: list of Table (will be returned)
+ :param pretty_plan: whether to use pretty printing for plan or not
+ :param parameters: query parameters as dict like {name: json_value}
+ :return: YQLExecResult
+ '''
+
+ if input_tables is None:
+ input_tables = []
+ else:
+ assert isinstance(input_tables, list)
+ if output_tables is None:
+ output_tables = []
+
+ klass.write_tables(input_tables + output_tables)
+
+ res = klass.yql_exec(
+ program=program,
+ program_file=program_file,
+ files=files,
+ urls=urls,
+ run_sql=run_sql,
+ verbose=verbose,
+ check_error=check_error,
+ tables=(output_tables + input_tables),
+ pretty_plan=pretty_plan,
+ parameters=parameters
+ )
+
+ try:
+ res_tables = klass.get_tables(output_tables)
+ except Exception:
+ if check_error:
+ raise
+ res_tables = {}
+
+ return res, res_tables
+
+
+execute_sql = partial(execute, run_sql=True)
+
+
+def log(s):
+ if get_param('STDERR'):
+ print(s, file=sys.stderr)
+ else:
+ logger.debug(s)
+
+
+def tmpdir_module(request):
+ return tempfile.mkdtemp(prefix='kikimr_test_')
+
+
+@pytest.fixture(name='tmpdir_module', scope='module')
+def tmpdir_module_fixture(request):
+ return tmpdir_module(request)
+
+
+def escape_backslash(s):
+ return s.replace('\\', '\\\\')
+
+
+def get_default_mount_point_config_content():
+ return '''
+ MountPoints {
+ RootAlias: '/lib'
+ MountPoint: '%s'
+ Library: true
+ }
+ ''' % (
+ escape_backslash(yql_source_path('yql/essentials/mount/lib'))
+ )
+
+
+def get_mount_config_file(content=None):
+ config = yql_output_path('mount.cfg')
+ if not os.path.exists(config):
+ with open(config, 'w') as f:
+ f.write(content or get_default_mount_point_config_content())
+ return config
+
+
+def run_command(program, cmd, tmpdir_module=None, stdin=None,
+ check_exit_code=True, env=None, stdout=None):
+ if tmpdir_module is None:
+ tmpdir_module = tempfile.mkdtemp()
+
+ stdin_stream = None
+ if isinstance(stdin, six.string_types):
+ with tempfile.NamedTemporaryFile(
+ prefix='stdin_',
+ dir=tmpdir_module,
+ delete=False
+ ) as stdin_file:
+ stdin_file.write(stdin.encode() if isinstance(stdin, str) else stdin)
+ stdin_stream = open(stdin_file.name)
+ elif isinstance(stdin, io.IOBase):
+ stdin_stream = stdin
+ elif stdin is not None:
+ assert 0, 'Strange stdin ' + repr(stdin)
+
+ if isinstance(cmd, six.string_types):
+ cmd = cmd.split()
+ else:
+ cmd = [str(c) for c in cmd]
+ log(' '.join('\'%s\'' % c if ' ' in c else c for c in cmd))
+ cmd = [program] + cmd
+
+ stderr_stream = None
+ stdout_stream = None
+
+ if stdout:
+ stdout_stream = stdout
+
+ res = yatest.common.execute(
+ cmd,
+ cwd=tmpdir_module,
+ stdin=stdin_stream,
+ stdout=stdout_stream,
+ stderr=stderr_stream,
+ check_exit_code=check_exit_code,
+ env=env,
+ wait=True
+ )
+
+ if res.std_err:
+ log(res.std_err)
+ if res.std_out:
+ log(res.std_out)
+ return res
+
+
+def yson_to_csv(yson_content, columns=None, with_header=True, strict=False):
+ import cyson as yson
+ if columns:
+ headers = sorted(columns)
+ else:
+ headers = set()
+ for item in yson.loads(yson_content):
+ headers.update(six.iterkeys(item))
+ headers = sorted(headers)
+ csv_content = []
+ if with_header:
+ csv_content.append(';'.join(headers))
+ for item in yson.loads(yson_content):
+ if strict and sorted(six.iterkeys(item)) != headers:
+ return None
+ csv_content.append(';'.join([str(item[h]).replace('YsonEntity', '').encode('string_escape') if h in item else '' for h in headers]))
+ return '\n'.join(csv_content)
+
+
+udfs_lock = Lock()
+
+
+def get_udfs_path(extra_paths=None):
+ essentials_udfs_build_path = yatest.common.build_path('yql/essentials/udfs')
+ udfs_build_path = yatest.common.build_path('yql/udfs')
+ ydb_udfs_build_path = yatest.common.build_path('contrib/ydb/library/yql/udfs')
+ contrib_ydb_udfs_build_path = yatest.common.build_path('contrib/ydb/library/yql/udfs')
+ rthub_udfs_build_path = yatest.common.build_path('robot/rthub/yql/udfs')
+ kwyt_udfs_build_path = yatest.common.build_path('robot/kwyt/yql/udfs')
+
+ try:
+ udfs_bin_path = yatest.common.binary_path('yql/udfs')
+ except Exception:
+ udfs_bin_path = None
+
+ try:
+ udfs_project_path = yql_binary_path('yql/library/test_framework/udfs_deps')
+ except Exception:
+ udfs_project_path = None
+
+ try:
+ ydb_udfs_project_path = yql_binary_path('yql/essentials/tests/common/test_framework/udfs_deps')
+ except Exception:
+ ydb_udfs_project_path = None
+
+ merged_udfs_path = yql_output_path('yql_udfs')
+ with udfs_lock:
+ if not os.path.isdir(merged_udfs_path):
+ os.mkdir(merged_udfs_path)
+
+ udfs_paths = [
+ udfs_project_path,
+ ydb_udfs_project_path,
+ udfs_bin_path,
+ essentials_udfs_build_path,
+ udfs_build_path,
+ ydb_udfs_build_path,
+ contrib_ydb_udfs_build_path,
+ rthub_udfs_build_path,
+ kwyt_udfs_build_path
+ ]
+ if extra_paths is not None:
+ udfs_paths += extra_paths
+
+ log('process search UDF in: %s, %s, %s, %s' % (udfs_project_path, ydb_udfs_project_path, udfs_bin_path, udfs_build_path))
+ for _udfs_path in udfs_paths:
+ if _udfs_path:
+ for dirpath, dnames, fnames in os.walk(_udfs_path):
+ for f in fnames:
+ if f.endswith('.so'):
+ f = os.path.join(dirpath, f)
+ if not os.path.exists(f) and os.path.lexists(f): # seems like broken symlink
+ try:
+ os.unlink(f)
+ except OSError:
+ pass
+ link_name = os.path.join(merged_udfs_path, os.path.basename(f))
+ if not os.path.exists(link_name):
+ os.symlink(f, link_name)
+ log('Added UDF: ' + f)
+ return merged_udfs_path
+
+
+def get_test_prefix():
+ return 'yql_tmp_' + hashlib.md5(yatest.common.context.test_name).hexdigest()
+
+
+def normalize_plan_ids(plan, no_detailed=False):
+ remapOps = {}
+
+ for node in sorted(filter(lambda n: n["type"] == "in", plan["Basic"]["nodes"]), key=lambda n: n.get("name")):
+ if node["id"] not in remapOps:
+ remapOps[node["id"]] = len(remapOps) + 1
+
+ for node in plan["Basic"]["nodes"]:
+ if node["id"] not in remapOps:
+ remapOps[node["id"]] = len(remapOps) + 1
+
+ def subst_basic(y):
+ if isinstance(y, list):
+ return [subst_basic(i) for i in y]
+ if isinstance(y, dict):
+ res = {}
+ for k, v in six.iteritems(y):
+ if k in {'source', 'target', 'id'}:
+ res[k] = remapOps.get(v)
+ elif k == "links":
+ res[k] = sorted(subst_basic(v), key=lambda x: (x["source"], x["target"]))
+ elif k == "nodes":
+ res[k] = sorted(subst_basic(v), key=lambda x: x["id"])
+ else:
+ res[k] = subst_basic(v)
+ return res
+ return y
+
+ # Sort and normalize input ids
+ def subst_detailed(y):
+ if isinstance(y, list):
+ return [subst_detailed(i) for i in y]
+ if isinstance(y, dict):
+ res = {}
+ for k, v in six.iteritems(y):
+ if k == "DependsOn":
+ res[k] = sorted([remapOps.get(i) for i in v])
+ elif k == "Providers":
+ res[k] = v
+ elif k in {'OperationRoot', 'Id'}:
+ res[k] = remapOps.get(v)
+ else:
+ res[k] = subst_detailed(v)
+ return res
+ return y
+
+ if no_detailed:
+ return {"Basic": subst_basic(plan["Basic"])}
+ return {"Basic": subst_basic(plan["Basic"]), "Detailed": subst_detailed(plan["Detailed"])}
+
+
+def normalized_plan_stats(plan):
+ renameMap = {
+ "MrLMap!": "YtMap!",
+ "MrMapReduce!": "YtMapReduce!",
+ "MrLReduce!": "YtMapReduce!",
+ "MrOrderedReduce!": "YtReduce!",
+ "MrSort!": "YtSort!",
+ "MrCopy!": "YtCopy!",
+ "YtMerge!": "YtCopy!",
+ "MrFill!": "YtFill!",
+ "MrDrop!": "YtDropTable!",
+ "YtTouch!": None,
+ "MrReadTable!": None,
+ "YtReadTable!": None,
+ "MrPublish!": "YtPublish!",
+ "MrReadTableScheme!": "YtReadTableScheme!",
+ }
+
+ normalizedStat = defaultdict(int)
+
+ for op, stat in six.iteritems(plan["Detailed"]["OperationStats"]):
+ renamedOp = renameMap.get(op, op)
+ if renamedOp is not None:
+ normalizedStat[renamedOp] += stat
+
+ return normalizedStat
+
+
+def normalize_table_yson(y):
+ from cyson import YsonEntity
+ if isinstance(y, list):
+ return [normalize_table_yson(i) for i in y]
+ if isinstance(y, dict):
+ normDict = OrderedDict()
+ for k, v in sorted(six.iteritems(y), key=lambda x: x[0], reverse=True):
+ if k == "_other":
+ normDict[normalize_table_yson(k)] = sorted(normalize_table_yson(v))
+ elif v != "Void" and v is not None and not isinstance(v, YsonEntity):
+ normDict[normalize_table_yson(k)] = normalize_table_yson(v)
+ return normDict
+ return y
+
+
+def dump_table_yson(res_yson, sort=True):
+ rows = normalize_table_yson(cyson.loads('[' + res_yson + ']'))
+ if sort:
+ rows = sorted(rows)
+ return cyson.dumps(rows, format="pretty")
+
+
+def normalize_source_code_path(s):
+ # remove contrib/
+ s = re.sub(r'\b(contrib/)(ydb/library/yql.*)', r'\2', s)
+ # replace line number in source code with 'xxx'
+ s = re.sub(r'\b(yql/[\w/]+(?:\.cpp|\.h)):(?:\d+)', r'\1:xxx', s)
+ return re.sub(r'(/lib/yql/[\w/]+(?:\.yql|\.sql)):(?:\d+):(?:\d+)', r'\1:xxx:yyy', s)
+
+
+def do_get_files(suite, config, DATA_PATH, config_key):
+ files = dict()
+ suite_dir = os.path.join(DATA_PATH, suite)
+ res_dir = None
+ for line in config:
+ if line[0] == config_key:
+ _, name, path = line
+ userpath = find_user_file(suite, path, DATA_PATH)
+ relpath = os.path.relpath(userpath, suite_dir)
+ if os.path.exists(os.path.join('cwd', relpath)):
+ path = relpath
+ else:
+ path = userpath
+
+ if not res_dir:
+ res_dir = get_yql_dir('file_')
+
+ new_path = os.path.join(res_dir, os.path.basename(path))
+ shutil.copyfile(path, new_path)
+
+ files[name] = new_path
+
+ return files
+
+
+def get_files(suite, config, DATA_PATH):
+ return do_get_files(suite, config, DATA_PATH, 'file')
+
+
+def get_http_files(suite, config, DATA_PATH):
+ return do_get_files(suite, config, DATA_PATH, 'http_file')
+
+
+def get_yt_files(suite, config, DATA_PATH):
+ return do_get_files(suite, config, DATA_PATH, 'yt_file')
+
+
+def get_syntax_version(program):
+ syntax_version_param = get_param('SYNTAX_VERSION')
+ default_syntax_version = 1
+ if 'syntax version 0' in program:
+ return 0
+ elif 'syntax version 1' in program:
+ return 1
+ elif syntax_version_param:
+ return int(syntax_version_param)
+ else:
+ return default_syntax_version
+
+
+def ansi_lexer_enabled(program):
+ return 'ansi_lexer' in program
+
+
+def pytest_get_current_part(path):
+ folder = os.path.dirname(path)
+ folder_name = os.path.basename(folder)
+ assert folder_name.startswith('part'), "Current folder is {}".format(folder_name)
+ current = int(folder_name[len('part'):])
+
+ parent = os.path.dirname(folder)
+ maxpart = max([int(part[len('part'):]) if part.startswith('part') else -1 for part in os.listdir(parent)])
+ assert maxpart > 0, "Cannot find parts in {}".format(parent)
+ return (current, 1 + maxpart)
+
+
+def normalize_result(res, sort):
+ res = cyson.loads(res) if res else cyson.loads("[]")
+ res = replace_vals(res)
+ for r in res:
+ for data in r['Write']:
+ if sort and 'Data' in data:
+ data['Data'] = sorted(data['Data'])
+ if 'Ref' in data:
+ data['Ref'] = []
+ data['Truncated'] = True
+ if 'Data' in data and len(data['Data']) == 0:
+ del data['Data']
+ return res
+
+
+def stable_write(writer, node):
+ if hasattr(node, 'attributes'):
+ writer.begin_attributes()
+ for k in sorted(node.attributes.keys()):
+ writer.key(k)
+ stable_write(writer, node.attributes[k])
+ writer.end_attributes()
+ if isinstance(node, list):
+ writer.begin_list()
+ for r in node:
+ stable_write(writer, r)
+ writer.end_list()
+ return
+ if isinstance(node, dict):
+ writer.begin_map()
+ for k in sorted(node.keys()):
+ writer.key(k)
+ stable_write(writer, node[k])
+ writer.end_map()
+ return
+ writer.write(node)
+
+
+def stable_result_file(res):
+ path = res.results_file
+ assert os.path.exists(path)
+ with open(path) as f:
+ res = f.read()
+ res = cyson.loads(res)
+ res = replace_vals(res)
+ for r in res:
+ for data in r['Write']:
+ if 'Unordered' in r and 'Data' in data:
+ data['Data'] = sorted(data['Data'])
+ with open(path, 'w') as f:
+ writer = cyson.Writer(stream=cyson.OutputStream.from_file(f), format='pretty', mode='node')
+ writer.begin_stream()
+ stable_write(writer, res)
+ writer.end_stream()
+ with open(path) as f:
+ return f.read()
+
+
+def stable_table_file(table):
+ path = table.file
+ assert os.path.exists(path)
+ assert table.attr is not None
+ is_sorted = False
+ for column in cyson.loads(table.attr)['schema']:
+ if 'sort_order' in column:
+ is_sorted = True
+ break
+ if not is_sorted:
+ with open(path) as f:
+ r = cyson.Reader(cyson.InputStream.from_file(f), mode='list_fragment')
+ lst = sorted(list(r.list_fragments()))
+ with open(path, 'w') as f:
+ writer = cyson.Writer(stream=cyson.OutputStream.from_file(f), format='pretty', mode='list_fragment')
+ writer.begin_stream()
+ for r in lst:
+ stable_write(writer, r)
+ writer.end_stream()
+ with open(path) as f:
+ return f.read()
+
+
+class LoggingDowngrade(object):
+
+ def __init__(self, loggers, level=logging.CRITICAL):
+ self.loggers = [(name, logging.getLogger(name).getEffectiveLevel()) for name in loggers]
+ self.level = level
+
+ def __enter__(self):
+ self.prev_levels = []
+ for name, _ in self.loggers:
+ log = logging.getLogger(name)
+ log.setLevel(self.level)
+ return self
+
+ def __exit__(self, exc_type, exc_value, tb):
+ for name, level in self.loggers:
+ log = logging.getLogger(name)
+ log.setLevel(level)
+ return True
diff --git a/yql/essentials/tests/common/test_framework/yqlrun.py b/yql/essentials/tests/common/test_framework/yqlrun.py
new file mode 100644
index 0000000000..b96641912a
--- /dev/null
+++ b/yql/essentials/tests/common/test_framework/yqlrun.py
@@ -0,0 +1,346 @@
+import os
+import shutil
+import yatest.common
+import yql_utils
+import cyson as yson
+import yql.essentials.providers.common.proto.gateways_config_pb2 as gateways_config_pb2
+import yql.essentials.core.file_storage.proto.file_storage_pb2 as file_storage_pb2
+
+import six
+
+from google.protobuf import text_format
+
+ARCADIA_PREFIX = 'arcadia/'
+ARCADIA_TESTS_DATA_PREFIX = 'arcadia_tests_data/'
+
+VAR_CHAR_PREFIX = '$'
+FIX_DIR_PREFIXES = {
+ 'SOURCE': yatest.common.source_path,
+ 'BUILD': yatest.common.build_path,
+ 'TEST_SOURCE': yatest.common.test_source_path,
+ 'DATA': yatest.common.data_path,
+ 'BINARY': yatest.common.binary_path,
+}
+
+
+class YQLRun(object):
+
+ def __init__(self, udfs_dir=None, prov='yt', use_sql2yql=False, keep_temp=True, binary=None, gateway_config=None, fs_config=None, extra_args=[], cfg_dir=None, support_udfs=True):
+ if binary is None:
+ self.yqlrun_binary = yql_utils.yql_binary_path(os.getenv('YQL_YQLRUN_PATH') or 'contrib/ydb/library/yql/tools/yqlrun/yqlrun')
+ else:
+ self.yqlrun_binary = binary
+ self.extra_args = extra_args
+
+ try:
+ self.sql2yql_binary = yql_utils.yql_binary_path(os.getenv('YQL_SQL2YQL_PATH') or 'yql/essentials/tools/sql2yql/sql2yql')
+ except BaseException:
+ self.sql2yql_binary = None
+
+ try:
+ self.udf_resolver_binary = yql_utils.yql_binary_path(os.getenv('YQL_UDFRESOLVER_PATH') or 'yql/essentials/tools/udf_resolver/udf_resolver')
+ except Exception:
+ self.udf_resolver_binary = None
+
+ if support_udfs:
+ if udfs_dir is None:
+ self.udfs_path = yql_utils.get_udfs_path()
+ else:
+ self.udfs_path = udfs_dir
+ else:
+ self.udfs_path = None
+
+ res_dir = yql_utils.get_yql_dir(prefix='yqlrun_')
+ self.res_dir = res_dir
+ self.tables = {}
+ self.prov = prov
+ self.use_sql2yql = use_sql2yql
+ self.keep_temp = keep_temp
+
+ self.gateway_config = gateways_config_pb2.TGatewaysConfig()
+ if gateway_config is not None:
+ text_format.Merge(gateway_config, self.gateway_config)
+
+ yql_utils.merge_default_gateway_cfg(cfg_dir or 'yql/essentials/cfg/tests', self.gateway_config)
+
+ self.fs_config = file_storage_pb2.TFileStorageConfig()
+
+ with open(yql_utils.yql_source_path(os.path.join(cfg_dir or 'yql/essentials/cfg/tests', 'fs.conf'))) as f:
+ text_format.Merge(f.read(), self.fs_config)
+
+ if fs_config is not None:
+ text_format.Merge(fs_config, self.fs_config)
+
+ if yql_utils.get_param('USE_NATIVE_YT_TYPES'):
+ attr = self.gateway_config.Yt.DefaultSettings.add()
+ attr.Name = 'UseNativeYtTypes'
+ attr.Value = 'true'
+
+ if yql_utils.get_param('SQL_FLAGS'):
+ flags = yql_utils.get_param('SQL_FLAGS').split(',')
+ self.gateway_config.SqlCore.TranslationFlags.extend(flags)
+
+ def yql_exec(self, program=None, program_file=None, files=None, urls=None,
+ run_sql=False, verbose=False, check_error=True, tables=None, pretty_plan=True,
+ wait=True, parameters={}, extra_env={}, require_udf_resolver=False, scan_udfs=True):
+ del pretty_plan
+
+ res_dir = self.res_dir
+
+ def res_file_path(name):
+ return os.path.join(res_dir, name)
+
+ opt_file = res_file_path('opt.yql')
+ results_file = res_file_path('results.txt')
+ plan_file = res_file_path('plan.txt')
+ err_file = res_file_path('err.txt')
+
+ udfs_dir = self.udfs_path
+ prov = self.prov
+
+ program, program_file = yql_utils.prepare_program(program, program_file, res_dir,
+ ext='sql' if run_sql else 'yql')
+
+ syntax_version = yql_utils.get_syntax_version(program)
+ ansi_lexer = yql_utils.ansi_lexer_enabled(program)
+
+ if run_sql and self.use_sql2yql:
+ orig_sql = program_file + '.orig_sql'
+ shutil.copy2(program_file, orig_sql)
+ cmd = [
+ self.sql2yql_binary,
+ orig_sql,
+ '--yql',
+ '--output=' + program_file,
+ '--syntax-version=%d' % syntax_version
+ ]
+ if ansi_lexer:
+ cmd.append('--ansi-lexer')
+ env = {'YQL_DETERMINISTIC_MODE': '1'}
+ env.update(extra_env)
+ for var in [
+ 'LLVM_PROFILE_FILE',
+ 'GO_COVERAGE_PREFIX',
+ 'PYTHON_COVERAGE_PREFIX',
+ 'NLG_COVERAGE_FILENAME',
+ 'YQL_EXPORT_PG_FUNCTIONS_DIR',
+ 'YQL_ALLOW_ALL_PG_FUNCTIONS',
+ ]:
+ if var in os.environ:
+ env[var] = os.environ[var]
+ yatest.common.process.execute(cmd, cwd=res_dir, env=env)
+
+ with open(program_file) as f:
+ yql_program = f.read()
+ with open(program_file, 'w') as f:
+ f.write(yql_program)
+
+ gateways_cfg_file = res_file_path('gateways.conf')
+ with open(gateways_cfg_file, 'w') as f:
+ f.write(str(self.gateway_config))
+
+ fs_cfg_file = res_file_path('fs.conf')
+ with open(fs_cfg_file, 'w') as f:
+ f.write(str(self.fs_config))
+
+ cmd = self.yqlrun_binary + ' '
+
+ if yql_utils.get_param('TRACE_OPT'):
+ cmd += '--trace-opt '
+
+ cmd += '-L ' \
+ '--program=%(program_file)s ' \
+ '--expr-file=%(opt_file)s ' \
+ '--result-file=%(results_file)s ' \
+ '--plan-file=%(plan_file)s ' \
+ '--err-file=%(err_file)s ' \
+ '--gateways=%(prov)s ' \
+ '--syntax-version=%(syntax_version)d ' \
+ '--tmp-dir=%(res_dir)s ' \
+ '--gateways-cfg=%(gateways_cfg_file)s ' \
+ '--fs-cfg=%(fs_cfg_file)s ' % locals()
+
+ if self.udfs_path is not None:
+ cmd += '--udfs-dir=%(udfs_dir)s ' % locals()
+
+ if ansi_lexer:
+ cmd += '--ansi-lexer '
+
+ if self.keep_temp:
+ cmd += '--keep-temp '
+
+ if self.extra_args:
+ cmd += " ".join(self.extra_args) + " "
+
+ cmd += '--mounts=' + yql_utils.get_mount_config_file() + ' '
+ cmd += '--validate-result-format '
+
+ if files:
+ for f in files:
+ if files[f].startswith(ARCADIA_PREFIX): # how does it work with folders? and does it?
+ files[f] = yatest.common.source_path(files[f][len(ARCADIA_PREFIX):])
+ continue
+ if files[f].startswith(ARCADIA_TESTS_DATA_PREFIX):
+ files[f] = yatest.common.data_path(files[f][len(ARCADIA_TESTS_DATA_PREFIX):])
+ continue
+
+ if files[f].startswith(VAR_CHAR_PREFIX):
+ for prefix, func in six.iteritems(FIX_DIR_PREFIXES):
+ if files[f].startswith(VAR_CHAR_PREFIX + prefix):
+ real_path = func(files[f][len(prefix) + 2:]) # $ + prefix + /
+ break
+ else:
+ raise Exception("unknown prefix in file path %s" % (files[f],))
+ copy_dest = os.path.join(res_dir, f)
+ if not os.path.exists(os.path.dirname(copy_dest)):
+ os.makedirs(os.path.dirname(copy_dest))
+ shutil.copy2(
+ real_path,
+ copy_dest,
+ )
+ files[f] = f
+ continue
+
+ if not files[f].startswith('/'): # why do we check files[f] instead of f here?
+ path_to_copy = os.path.join(
+ yatest.common.work_path(),
+ files[f]
+ )
+ if '/' in files[f]:
+ copy_dest = os.path.join(
+ res_dir,
+ os.path.dirname(files[f])
+ )
+ if not os.path.exists(copy_dest):
+ os.makedirs(copy_dest)
+ else:
+ copy_dest = res_dir
+ files[f] = os.path.basename(files[f])
+ shutil.copy2(path_to_copy, copy_dest)
+ else:
+ shutil.copy2(files[f], res_dir)
+ files[f] = os.path.basename(files[f])
+ cmd += yql_utils.get_cmd_for_files('--file', files)
+
+ if urls:
+ cmd += yql_utils.get_cmd_for_files('--url', urls)
+
+ optimize_only = False
+ if tables:
+ for table in tables:
+ self.tables[table.full_name] = table
+ if table.format != 'yson':
+ optimize_only = True
+ for name in self.tables:
+ cmd += '--table=yt.%s@%s ' % (name, self.tables[name].yqlrun_file)
+
+ if "--lineage" not in self.extra_args:
+ if optimize_only:
+ cmd += '-O '
+ else:
+ cmd += '--run '
+
+ if yql_utils.get_param('UDF_RESOLVER') or require_udf_resolver:
+ assert self.udf_resolver_binary, "Missing udf_resolver binary"
+ cmd += '--udf-resolver=' + self.udf_resolver_binary + ' '
+ if scan_udfs:
+ cmd += '--scan-udfs '
+ if not yatest.common.context.sanitize:
+ cmd += '--udf-resolver-filter-syscalls '
+
+ if run_sql and not self.use_sql2yql:
+ cmd += '--sql '
+
+ if parameters:
+ parameters_file = res_file_path('params.yson')
+ with open(parameters_file, 'w') as f:
+ f.write(six.ensure_str(yson.dumps(parameters)))
+ cmd += '--params-file=%s ' % parameters_file
+
+ if verbose:
+ yql_utils.log('prov is ' + self.prov)
+
+ env = {'YQL_DETERMINISTIC_MODE': '1'}
+ env.update(extra_env)
+ for var in [
+ 'LLVM_PROFILE_FILE',
+ 'GO_COVERAGE_PREFIX',
+ 'PYTHON_COVERAGE_PREFIX',
+ 'NLG_COVERAGE_FILENAME',
+ 'YQL_EXPORT_PG_FUNCTIONS_DIR',
+ 'YQL_ALLOW_ALL_PG_FUNCTIONS',
+ ]:
+ if var in os.environ:
+ env[var] = os.environ[var]
+ if yql_utils.get_param('STDERR'):
+ debug_udfs_dir = os.path.join(os.path.abspath('.'), '..', '..', '..')
+ env_setters = ";".join("{}={}".format(k, v) for k, v in six.iteritems(env))
+ yql_utils.log('GDB launch command:')
+ yql_utils.log('(cd "%s" && %s ya tool gdb --args %s)' % (res_dir, env_setters, cmd.replace(udfs_dir, debug_udfs_dir)))
+
+ proc_result = yatest.common.process.execute(cmd.strip().split(), check_exit_code=False, cwd=res_dir, env=env)
+ if proc_result.exit_code != 0 and check_error:
+ with open(err_file, 'r') as f:
+ err_file_text = f.read()
+ assert 0, \
+ 'Command\n%(command)s\n finished with exit code %(code)d, stderr:\n\n%(stderr)s\n\nerror file:\n%(err_file)s' % {
+ 'command': cmd,
+ 'code': proc_result.exit_code,
+ 'stderr': proc_result.std_err,
+ 'err_file': err_file_text
+ }
+
+ if os.path.exists(results_file) and os.stat(results_file).st_size == 0:
+ os.unlink(results_file) # kikimr yql-exec compatibility
+
+ results, log_results = yql_utils.read_res_file(results_file)
+ plan, log_plan = yql_utils.read_res_file(plan_file)
+ opt, log_opt = yql_utils.read_res_file(opt_file)
+ err, log_err = yql_utils.read_res_file(err_file)
+
+ if verbose:
+ yql_utils.log('PROGRAM:')
+ yql_utils.log(program)
+ yql_utils.log('OPT:')
+ yql_utils.log(log_opt)
+ yql_utils.log('PLAN:')
+ yql_utils.log(log_plan)
+ yql_utils.log('RESULTS:')
+ yql_utils.log(log_results)
+ yql_utils.log('ERROR:')
+ yql_utils.log(log_err)
+
+ return yql_utils.YQLExecResult(
+ proc_result.std_out,
+ yql_utils.normalize_source_code_path(err.replace(res_dir, '<tmp_path>')),
+ results,
+ results_file,
+ opt,
+ opt_file,
+ plan,
+ plan_file,
+ program,
+ proc_result,
+ None
+ )
+
+ def create_empty_tables(self, tables):
+ pass
+
+ def write_tables(self, tables):
+ pass
+
+ def get_tables(self, tables):
+ res = {}
+ for table in tables:
+ # recreate table after yql program was executed
+ res[table.full_name] = yql_utils.new_table(
+ table.full_name,
+ yqlrun_file=self.tables[table.full_name].yqlrun_file,
+ res_dir=self.res_dir
+ )
+
+ yql_utils.log('YQLRun table ' + table.full_name)
+ yql_utils.log(res[table.full_name].content)
+
+ return res
diff --git a/yql/essentials/tests/common/udf_test/test.py b/yql/essentials/tests/common/udf_test/test.py
new file mode 100644
index 0000000000..218b05b4bd
--- /dev/null
+++ b/yql/essentials/tests/common/udf_test/test.py
@@ -0,0 +1,111 @@
+import os
+import os.path
+import glob
+import codecs
+import shutil
+
+import pytest
+
+import yql_utils
+from yqlrun import YQLRun
+
+import yatest.common
+
+project_path = yatest.common.context.project_path
+SOURCE_PATH = yql_utils.yql_source_path((project_path + '/cases').replace('\\', '/'))
+DATA_PATH = yatest.common.output_path('cases')
+ASTDIFF_PATH = yql_utils.yql_binary_path(os.getenv('YQL_ASTDIFF_PATH') or 'yql/essentials/tools/astdiff/astdiff')
+
+
+def pytest_generate_tests(metafunc):
+ if os.path.exists(SOURCE_PATH):
+ shutil.copytree(SOURCE_PATH, DATA_PATH)
+ cases = sorted([os.path.basename(sql_query)[:-4] for sql_query in glob.glob(DATA_PATH + '/*.sql')])
+
+ else:
+ cases = []
+ metafunc.parametrize(['case'], [(case, ) for case in cases])
+
+
+def test(case):
+ program_file = os.path.join(DATA_PATH, case + '.sql')
+
+ with codecs.open(program_file, encoding='utf-8') as f:
+ program = f.readlines()
+
+ header = program[0]
+ canonize_ast = False
+
+ if header.startswith('--ignore'):
+ pytest.skip(header)
+ elif header.startswith('--sanitizer ignore') and yatest.common.context.sanitize is not None:
+ pytest.skip(header)
+ elif header.startswith('--sanitizer ignore address') and yatest.common.context.sanitize == 'address':
+ pytest.skip(header)
+ elif header.startswith('--sanitizer ignore memory') and yatest.common.context.sanitize == 'memory':
+ pytest.skip(header)
+ elif header.startswith('--sanitizer ignore thread') and yatest.common.context.sanitize == 'thread':
+ pytest.skip(header)
+ elif header.startswith('--sanitizer ignore undefined') and yatest.common.context.sanitize == 'undefined':
+ pytest.skip(header)
+ elif header.startswith('--canonize ast'):
+ canonize_ast = True
+
+ program = '\n'.join(['use plato;'] + program)
+
+ cfg = yql_utils.get_program_cfg(None, case, DATA_PATH)
+ files = {}
+ diff_tool = None
+ scan_udfs = False
+ for item in cfg:
+ if item[0] == 'file':
+ files[item[1]] = item[2]
+ if item[0] == 'diff_tool':
+ diff_tool = item[1:]
+ if item[0] == 'scan_udfs':
+ scan_udfs = True
+
+ in_tables = yql_utils.get_input_tables(None, cfg, DATA_PATH, def_attr=yql_utils.KSV_ATTR)
+
+ udfs_dir = yql_utils.get_udfs_path([
+ yatest.common.build_path(os.path.join(yatest.common.context.project_path, ".."))
+ ])
+
+ xfail = yql_utils.is_xfail(cfg)
+ if yql_utils.get_param('TARGET_PLATFORM') and xfail:
+ pytest.skip('xfail is not supported on non-default target platform')
+
+ extra_env = dict(os.environ)
+ extra_env["YQL_UDF_RESOLVER"] = "1"
+ extra_env["YQL_ARCADIA_BINARY_PATH"] = os.path.expandvars(yatest.common.build_path('.'))
+ extra_env["YQL_ARCADIA_SOURCE_PATH"] = os.path.expandvars(yatest.common.source_path('.'))
+ extra_env["Y_NO_AVX_IN_DOT_PRODUCT"] = "1"
+
+ # this breaks tests using V0 syntax
+ if "YA_TEST_RUNNER" in extra_env:
+ del extra_env["YA_TEST_RUNNER"]
+
+ yqlrun_res = YQLRun(udfs_dir=udfs_dir, prov='yt', use_sql2yql=False, cfg_dir=os.getenv('YQL_CONFIG_DIR') or 'yql/essentials/cfg/udf_test').yql_exec(
+ program=program,
+ run_sql=True,
+ tables=in_tables,
+ files=files,
+ check_error=not xfail,
+ extra_env=extra_env,
+ require_udf_resolver=True,
+ scan_udfs=scan_udfs
+ )
+
+ if xfail:
+ assert yqlrun_res.execution_result.exit_code != 0
+
+ results_path = os.path.join(yql_utils.yql_output_path(), case + '.results.txt')
+ with open(results_path, 'w') as f:
+ f.write(yqlrun_res.results)
+
+ to_canonize = [yqlrun_res.std_err] if xfail else [yatest.common.canonical_file(yqlrun_res.results_file, local=True, diff_tool=diff_tool)]
+
+ if canonize_ast:
+ to_canonize += [yatest.common.canonical_file(yqlrun_res.opt_file, local=True, diff_tool=ASTDIFF_PATH)]
+
+ return to_canonize
diff --git a/yql/essentials/tests/common/udf_test/ya.make b/yql/essentials/tests/common/udf_test/ya.make
new file mode 100644
index 0000000000..37570be0ab
--- /dev/null
+++ b/yql/essentials/tests/common/udf_test/ya.make
@@ -0,0 +1,9 @@
+PY23_LIBRARY()
+
+TEST_SRCS(test.py)
+
+PEERDIR(
+ yql/essentials/tests/common/test_framework
+)
+
+END()
diff --git a/yql/essentials/tests/common/ya.make b/yql/essentials/tests/common/ya.make
new file mode 100644
index 0000000000..1ac429bbb1
--- /dev/null
+++ b/yql/essentials/tests/common/ya.make
@@ -0,0 +1,5 @@
+RECURSE(
+ test_framework
+ udf_test
+)
+
diff --git a/yql/essentials/tests/postgresql/README.md b/yql/essentials/tests/postgresql/README.md
new file mode 100644
index 0000000000..a269d01b82
--- /dev/null
+++ b/yql/essentials/tests/postgresql/README.md
@@ -0,0 +1,10 @@
+Original regression Postgresql tests are in original/cases
+Extracts of original tests used as pre-commit tests are in cases
+
+test.sh runs pre-commit tests. Run ya make in yql/tools/pg-make-test beforehand
+original.sh runs original tests
+
+Run make-tests.sh to build pre-commit tests from original tests. pg_tests.csv file is a report file indicating
+share of SQL statements per testcase, which run successfully.
+
+Run update-status.sh to update status.md from pg_tests.csv
diff --git a/yql/essentials/tests/postgresql/cases/aggregates.err b/yql/essentials/tests/postgresql/cases/aggregates.err
new file mode 100644
index 0000000000..f7a28acb78
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/aggregates.err
@@ -0,0 +1,3402 @@
+Registering pre-existing tables
+ onek
+ int4_tbl
+ INT4_TBL
+ tenk1
+ VARCHAR_TBL
+ aggtest
+ student
+ varchar_tbl
+ int8_tbl
+<sql-statement>
+--
+-- AGGREGATES
+--
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+</sql-statement>
+<sql-statement>
+SELECT avg(four) AS avg_1 FROM onek;
+</sql-statement>
+<sql-statement>
+SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
+</sql-statement>
+<sql-statement>
+-- In 7.1, avg(float4) is computed using float8 arithmetic.
+-- Round the result to 3 digits to avoid platform-specific results.
+SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
+</sql-statement>
+<sql-statement>
+SELECT sum(four) AS sum_1500 FROM onek;
+</sql-statement>
+<sql-statement>
+SELECT sum(a) AS sum_198 FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT sum(b) AS avg_431_773 FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
+</sql-statement>
+<sql-statement>
+SELECT max(four) AS max_3 FROM onek;
+</sql-statement>
+<sql-statement>
+SELECT max(a) AS max_100 FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT max(student.gpa) AS max_3_7 FROM student;
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop(b) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT stddev_samp(b) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT var_pop(b) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT var_samp(b) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop(b::numeric) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT stddev_samp(b::numeric) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT var_pop(b::numeric) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT var_samp(b::numeric) FROM aggtest;
+</sql-statement>
+<sql-statement>
+-- population variance is defined for a single tuple, sample variance
+-- is not
+SELECT var_pop(1.0::float8), var_samp(2.0::float8);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop(3.0::float8), stddev_samp(4.0::float8);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('inf'::float8), var_samp('inf'::float8);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('inf'::float8), stddev_samp('inf'::float8);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('nan'::float8), var_samp('nan'::float8);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('nan'::float8), stddev_samp('nan'::float8);
+</sql-statement>
+<sql-statement>
+SELECT var_pop(1.0::float4), var_samp(2.0::float4);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop(3.0::float4), stddev_samp(4.0::float4);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('inf'::float4), var_samp('inf'::float4);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('inf'::float4), stddev_samp('inf'::float4);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('nan'::float4), var_samp('nan'::float4);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('nan'::float4), stddev_samp('nan'::float4);
+</sql-statement>
+<sql-statement>
+SELECT var_pop(1.0::numeric), var_samp(2.0::numeric);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop(3.0::numeric), stddev_samp(4.0::numeric);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('inf'::numeric), var_samp('inf'::numeric);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('inf'::numeric), stddev_samp('inf'::numeric);
+</sql-statement>
+<sql-statement>
+SELECT var_pop('nan'::numeric), var_samp('nan'::numeric);
+</sql-statement>
+<sql-statement>
+SELECT stddev_pop('nan'::numeric), stddev_samp('nan'::numeric);
+</sql-statement>
+<sql-statement>
+-- verify correct results for null and NaN inputs
+select sum(null::int4) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select sum(null::int8) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select sum(null::numeric) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select sum(null::float8) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select avg(null::int4) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select avg(null::int8) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select avg(null::numeric) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select avg(null::float8) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select sum('NaN'::numeric) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+select avg('NaN'::numeric) from generate_series(1,3);
+</sql-statement>
+<sql-statement>
+-- verify correct results for infinite inputs
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('1'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('1')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('1'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('1')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+</sql-statement>
+<sql-statement>
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+</sql-statement>
+<sql-statement>
+-- test accuracy with a large input offset
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x);
+</sql-statement>
+<sql-statement>
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (7000000000005), (7000000000007)) v(x);
+</sql-statement>
+<sql-statement>
+-- SQL2003 binary aggregates
+SELECT regr_count(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_sxx(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_syy(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_sxy(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_avgx(b, a), regr_avgy(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_r2(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT regr_slope(b, a), regr_intercept(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+SELECT corr(b, a) FROM aggtest;
+</sql-statement>
+<sql-statement>
+-- check single-tuple behavior
+SELECT covar_pop(1::float8,2::float8), covar_samp(3::float8,4::float8);
+</sql-statement>
+<sql-statement>
+SELECT covar_pop(1::float8,'inf'::float8), covar_samp(3::float8,'inf'::float8);
+</sql-statement>
+<sql-statement>
+SELECT covar_pop(1::float8,'nan'::float8), covar_samp(3::float8,'nan'::float8);
+</sql-statement>
+<sql-statement>
+-- test accum and combine functions directly
+CREATE TABLE regr_test (x float8, y float8);
+</sql-statement>
+<sql-statement>
+INSERT INTO regr_test VALUES (10,150),(20,250),(30,350),(80,540),(100,200);
+</sql-statement>
+<sql-statement>
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30,80);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: sum
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+<sql-statement>
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: sum
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+<sql-statement>
+SELECT float8_accum('{4,140,2900}'::float8[], 100);
+</sql-statement>
+<sql-statement>
+SELECT float8_regr_accum('{4,140,2900,1290,83075,15050}'::float8[], 200, 100);
+</sql-statement>
+<sql-statement>
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: sum
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+<sql-statement>
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (80,100);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: sum
+ SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+ ^
+<sql-statement>
+SELECT float8_combine('{3,60,200}'::float8[], '{0,0,0}'::float8[]);
+</sql-statement>
+<sql-statement>
+SELECT float8_combine('{0,0,0}'::float8[], '{2,180,200}'::float8[]);
+</sql-statement>
+<sql-statement>
+SELECT float8_combine('{3,60,200}'::float8[], '{2,180,200}'::float8[]);
+</sql-statement>
+<sql-statement>
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{0,0,0,0,0,0}'::float8[]);
+</sql-statement>
+<sql-statement>
+SELECT float8_regr_combine('{0,0,0,0,0,0}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+</sql-statement>
+<sql-statement>
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+</sql-statement>
+<sql-statement>
+DROP TABLE regr_test;
+</sql-statement>
+<sql-statement>
+-- test count, distinct
+SELECT count(four) AS cnt_1000 FROM onek;
+</sql-statement>
+<sql-statement>
+SELECT count(DISTINCT four) AS cnt_4 FROM onek;
+</sql-statement>
+<sql-statement>
+select ten, count(*), sum(four) from onek
+group by ten order by ten;
+</sql-statement>
+<sql-statement>
+select ten, count(four), sum(DISTINCT four) from onek
+group by ten order by ten;
+</sql-statement>
+<sql-statement>
+-- user-defined aggregates
+SELECT newavg(four) AS avg_1 FROM onek;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- user-defined aggregates
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT newavg(four) AS avg_1 FROM onek;
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: newavg
+ SELECT newavg(four) AS avg_1 FROM onek;
+ ^
+<sql-statement>
+SELECT newsum(four) AS sum_1500 FROM onek;
+</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 newsum(four) AS sum_1500 FROM onek;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT newsum(four) AS sum_1500 FROM onek;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: newsum
+ SELECT newsum(four) AS sum_1500 FROM onek;
+ ^
+<sql-statement>
+SELECT newcnt(four) AS cnt_1000 FROM onek;
+</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 newcnt(four) AS cnt_1000 FROM onek;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT newcnt(four) AS cnt_1000 FROM onek;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: newcnt
+ SELECT newcnt(four) AS cnt_1000 FROM onek;
+ ^
+<sql-statement>
+SELECT newcnt(*) AS cnt_1000 FROM onek;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: * is expected only in count function
+ SELECT newcnt(*) AS cnt_1000 FROM onek;
+ ^
+<sql-statement>
+SELECT oldcnt(*) AS cnt_1000 FROM onek;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: * is expected only in count function
+ SELECT oldcnt(*) AS cnt_1000 FROM onek;
+ ^
+<sql-statement>
+SELECT sum2(q1,q2) FROM int8_tbl;
+</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 sum2(q1,q2) FROM int8_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT sum2(q1,q2) FROM int8_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: sum2
+ SELECT sum2(q1,q2) FROM int8_tbl;
+ ^
+<sql-statement>
+-- test for outer-level aggregates
+-- this should work
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:43: Error: Aggregate functions are not allowed in: WHERE
+ having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+ ^
+<sql-statement>
+-- this should fail because subquery has an agg of its own in WHERE
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b
+ where sum(distinct a.four + b.four) = b.four);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:22: Error: Aggregate functions are not allowed in: WHERE
+ where sum(distinct a.four + b.four) = b.four);
+ ^
+<sql-statement>
+-- Test handling of sublinks within outer-level aggregates.
+-- Per bug report from Daniel Grace.
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+from tenk1 o;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Test handling of sublinks within outer-level aggregates.
+ ^
+ -stdin-:<main>:4:3: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+ ^
+ -stdin-:<main>:4:11: Error: At function: PgAgg
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+ ^
+ -stdin-:<main>:4:15: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+ ^
+ -stdin-:<main>:4:64: Error: No such column: unique1
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+ ^
+<sql-statement>
+-- Test handling of Params within aggregate arguments in hashed aggregation.
+-- Per bug report from Jeevan Chalke.
+explain (verbose, costs off)
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test handling of Params within aggregate arguments in hashed aggregation.
+ ^
+<sql-statement>
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select s1, s2, sm
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+</sql-statement>
+<sql-statement>
+--
+-- test for bitwise integer aggregates
+--
+CREATE TEMPORARY TABLE bitwise_test(
+ i2 INT2,
+ i4 INT4,
+ i8 INT8,
+ i INTEGER,
+ x INT2,
+ y BIT(4)
+);
+</sql-statement>
+<sql-statement>
+-- empty case
+SELECT
+ BIT_AND(i2) AS "?",
+ BIT_OR(i4) AS "?",
+ BIT_XOR(i8) AS "?"
+FROM bitwise_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- empty case
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: ?
+ -- empty case
+ ^
+<sql-statement>
+COPY bitwise_test FROM STDIN NULL 'null';
+1 1 1 1 1 B0101
+3 3 3 null 2 B0100
+7 7 7 3 4 B1100
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+SELECT
+ BIT_AND(i2) AS "1",
+ BIT_AND(i4) AS "1",
+ BIT_AND(i8) AS "1",
+ BIT_AND(i) AS "?",
+ BIT_AND(x) AS "0",
+ BIT_AND(y) AS "0100",
+ BIT_OR(i2) AS "7",
+ BIT_OR(i4) AS "7",
+ BIT_OR(i8) AS "7",
+ BIT_OR(i) AS "?",
+ BIT_OR(x) AS "7",
+ BIT_OR(y) AS "1101",
+ BIT_XOR(i2) AS "5",
+ BIT_XOR(i4) AS "5",
+ BIT_XOR(i8) AS "5",
+ BIT_XOR(i) AS "?",
+ BIT_XOR(x) AS "7",
+ BIT_XOR(y) AS "1101"
+FROM bitwise_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: 1
+ SELECT
+ ^
+<sql-statement>
+--
+-- test boolean aggregates
+--
+-- first test all possible transition and final states
+SELECT
+ -- boolean and transitions
+ -- null because strict
+ booland_statefunc(NULL, NULL) IS NULL AS "t",
+ booland_statefunc(TRUE, NULL) IS NULL AS "t",
+ booland_statefunc(FALSE, NULL) IS NULL AS "t",
+ booland_statefunc(NULL, TRUE) IS NULL AS "t",
+ booland_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- and actual computations
+ booland_statefunc(TRUE, TRUE) AS "t",
+ NOT booland_statefunc(TRUE, FALSE) AS "t",
+ NOT booland_statefunc(FALSE, TRUE) AS "t",
+ NOT booland_statefunc(FALSE, FALSE) AS "t";
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ --
+ ^
+<sql-statement>
+SELECT
+ -- boolean or transitions
+ -- null because strict
+ boolor_statefunc(NULL, NULL) IS NULL AS "t",
+ boolor_statefunc(TRUE, NULL) IS NULL AS "t",
+ boolor_statefunc(FALSE, NULL) IS NULL AS "t",
+ boolor_statefunc(NULL, TRUE) IS NULL AS "t",
+ boolor_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- actual computations
+ boolor_statefunc(TRUE, TRUE) AS "t",
+ boolor_statefunc(TRUE, FALSE) AS "t",
+ boolor_statefunc(FALSE, TRUE) AS "t",
+ NOT boolor_statefunc(FALSE, FALSE) AS "t";
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ SELECT
+ ^
+<sql-statement>
+CREATE TEMPORARY TABLE bool_test(
+ b1 BOOL,
+ b2 BOOL,
+ b3 BOOL,
+ b4 BOOL);
+</sql-statement>
+<sql-statement>
+-- empty case
+SELECT
+ BOOL_AND(b1) AS "n",
+ BOOL_OR(b3) AS "n"
+FROM bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- empty case
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: n
+ -- empty case
+ ^
+<sql-statement>
+COPY bool_test FROM STDIN NULL 'null';
+TRUE null FALSE null
+FALSE TRUE null null
+null TRUE FALSE null
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+SELECT
+ BOOL_AND(b1) AS "f",
+ BOOL_AND(b2) AS "t",
+ BOOL_AND(b3) AS "f",
+ BOOL_AND(b4) AS "n",
+ BOOL_AND(NOT b2) AS "f",
+ BOOL_AND(NOT b3) AS "t"
+FROM bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f
+ SELECT
+ ^
+<sql-statement>
+SELECT
+ EVERY(b1) AS "f",
+ EVERY(b2) AS "t",
+ EVERY(b3) AS "f",
+ EVERY(b4) AS "n",
+ EVERY(NOT b2) AS "f",
+ EVERY(NOT b3) AS "t"
+FROM bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f
+ SELECT
+ ^
+<sql-statement>
+SELECT
+ BOOL_OR(b1) AS "t",
+ BOOL_OR(b2) AS "t",
+ BOOL_OR(b3) AS "f",
+ BOOL_OR(b4) AS "n",
+ BOOL_OR(NOT b2) AS "f",
+ BOOL_OR(NOT b3) AS "t"
+FROM bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f
+ SELECT
+ ^
+<sql-statement>
+--
+-- Test cases that should be optimized into indexscans instead of
+-- the generic aggregate implementation.
+--
+-- Basic cases
+explain (costs off)
+ select min(unique1) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select min(unique1) from tenk1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique1) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique1) from tenk1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 < 42;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique1) from tenk1 where unique1 < 42;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique1) from tenk1 where unique1 > 42;
+</sql-statement>
+<sql-statement>
+-- the planner may choose a generic aggregate here if parallel query is
+-- enabled, since that plan will be parallel safe and the "optimized"
+-- plan, which has almost identical cost, will not be. we want to test
+-- the optimized plan, so temporarily disable parallel query.
+begin;
+</sql-statement>
+<sql-statement>
+set local max_parallel_workers_per_gather = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: max_parallel_workers_per_gather
+ set local max_parallel_workers_per_gather = 0;
+ ^
+<sql-statement>
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique1) from tenk1 where unique1 > 42000;
+</sql-statement>
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- multi-column index (uses tenk1_thous_tenthous)
+explain (costs off)
+ select max(tenthous) from tenk1 where thousand = 33;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- multi-column index (uses tenk1_thous_tenthous)
+ ^
+<sql-statement>
+select max(tenthous) from tenk1 where thousand = 33;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select min(tenthous) from tenk1 where thousand = 33;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select min(tenthous) from tenk1 where thousand = 33;
+</sql-statement>
+<sql-statement>
+-- check parameter propagation into an indexscan subquery
+explain (costs off)
+ select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check parameter propagation into an indexscan subquery
+ ^
+<sql-statement>
+select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+</sql-statement>
+<sql-statement>
+-- check some cases that were handled incorrectly in 8.3.0
+explain (costs off)
+ select distinct max(unique2) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check some cases that were handled incorrectly in 8.3.0
+ ^
+<sql-statement>
+select distinct max(unique2) from tenk1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique2) from tenk1 order by 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique2) from tenk1 order by 1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique2) from tenk1 order by max(unique2);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2)+1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique2) from tenk1 order by max(unique2)+1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:22: Error: Generator functions are not allowed in: SELECT
+ select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+ ^
+<sql-statement>
+-- interesting corner case: constant gets optimized into a seqscan
+explain (costs off)
+ select max(100) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- interesting corner case: constant gets optimized into a seqscan
+ ^
+<sql-statement>
+select max(100) from tenk1;
+</sql-statement>
+<sql-statement>
+-- try it on an inheritance tree
+create table minmaxtest(f1 int);
+</sql-statement>
+<sql-statement>
+create table minmaxtest1() inherits (minmaxtest);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table minmaxtest1() inherits (minmaxtest);
+ ^
+<sql-statement>
+create table minmaxtest2() inherits (minmaxtest);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table minmaxtest2() inherits (minmaxtest);
+ ^
+<sql-statement>
+create table minmaxtest3() inherits (minmaxtest);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table minmaxtest3() inherits (minmaxtest);
+ ^
+<sql-statement>
+create index minmaxtesti on minmaxtest(f1);
+</sql-statement>
+<sql-statement>
+create index minmaxtest1i on minmaxtest1(f1);
+</sql-statement>
+<sql-statement>
+create index minmaxtest2i on minmaxtest2(f1 desc);
+</sql-statement>
+<sql-statement>
+create index minmaxtest3i on minmaxtest3(f1) where f1 is not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: partial index is not supported yet
+ create index minmaxtest3i on minmaxtest3(f1) where f1 is not null;
+ ^
+<sql-statement>
+insert into minmaxtest values(11), (12);
+</sql-statement>
+<sql-statement>
+insert into minmaxtest1 values(13), (14);
+</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.minmaxtest1
+
+<sql-statement>
+insert into minmaxtest2 values(15), (16);
+</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.minmaxtest2
+
+<sql-statement>
+insert into minmaxtest3 values(17), (18);
+</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.minmaxtest3
+
+<sql-statement>
+explain (costs off)
+ select min(f1), max(f1) from minmaxtest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select min(f1), max(f1) from minmaxtest;
+</sql-statement>
+<sql-statement>
+-- DISTINCT doesn't do anything useful here, but it shouldn't fail
+explain (costs off)
+ select distinct min(f1), max(f1) from minmaxtest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- DISTINCT doesn't do anything useful here, but it shouldn't fail
+ ^
+<sql-statement>
+select distinct min(f1), max(f1) from minmaxtest;
+</sql-statement>
+<sql-statement>
+drop table minmaxtest cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ drop table minmaxtest cascade;
+ ^
+<sql-statement>
+-- check for correct detection of nested-aggregate errors
+select max(min(unique1)) from tenk1;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- check for correct detection of nested-aggregate errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ydb/library/yql/providers/common/mkql/yql_provider_mkql.cpp:364 GetCallable(): requirement Callables.cend() != compiler failed, message: Missed callable: PgAgg
+ -- check for correct detection of nested-aggregate errors
+ ^
+<sql-statement>
+select (select max(min(unique1)) from int8_tbl) from tenk1;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:8: Fatal: Execution of node: YtMapReduce!
+ select (select max(min(unique1)) from int8_tbl) from tenk1;
+ ^
+ -stdin-:<main>:1:8: Fatal: ydb/library/yql/providers/common/mkql/yql_provider_mkql.cpp:364 GetCallable(): requirement Callables.cend() != compiler failed, message: Missed callable: PgAgg
+ select (select max(min(unique1)) from int8_tbl) from tenk1;
+ ^
+<sql-statement>
+--
+-- Test removal of redundant GROUP BY columns
+--
+create temp table t1 (a int, b int, c int, d int, primary key (a, b));
+</sql-statement>
+<sql-statement>
+create temp table t2 (x int, y int, z int, primary key (x, y));
+</sql-statement>
+<sql-statement>
+create temp table t3 (a int, b int, c int, primary key(a, b) deferrable);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DEFERRABLE constraints not supported
+ create temp table t3 (a int, b int, c int, primary key(a, b) deferrable);
+ ^
+<sql-statement>
+-- Non-primary-key columns can be removed from GROUP BY
+explain (costs off) select * from t1 group by a,b,c,d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Non-primary-key columns can be removed from GROUP BY
+ ^
+<sql-statement>
+-- No removal can happen if the complete PK is not present in GROUP BY
+explain (costs off) select a,c from t1 group by a,c,d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- No removal can happen if the complete PK is not present in GROUP BY
+ ^
+<sql-statement>
+-- Test removal across multiple relations
+explain (costs off) select *
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.y,t2.z;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test removal across multiple relations
+ ^
+<sql-statement>
+-- Test case where t1 can be optimized but not t2
+explain (costs off) select t1.*,t2.x,t2.z
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.z;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test case where t1 can be optimized but not t2
+ ^
+<sql-statement>
+-- Cannot optimize when PK is deferrable
+explain (costs off) select * from t3 group by a,b,c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Cannot optimize when PK is deferrable
+ ^
+<sql-statement>
+create temp table t1c () inherits (t1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table t1c () inherits (t1);
+ ^
+<sql-statement>
+-- Ensure we don't remove any columns when t1 has a child table
+explain (costs off) select * from t1 group by a,b,c,d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Ensure we don't remove any columns when t1 has a child table
+ ^
+<sql-statement>
+-- Okay to remove columns if we're only querying the parent.
+explain (costs off) select * from only t1 group by a,b,c,d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Okay to remove columns if we're only querying the parent.
+ ^
+<sql-statement>
+create temp table p_t1 (
+ a int,
+ b int,
+ c int,
+ d int,
+ primary key(a,b)
+) partition by list(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create temp table p_t1 (
+ ^
+<sql-statement>
+create temp table p_t1_1 partition of p_t1 for values in(1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table p_t1_1 partition of p_t1 for values in(1);
+ ^
+<sql-statement>
+create temp table p_t1_2 partition of p_t1 for values in(2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table p_t1_2 partition of p_t1 for values in(2);
+ ^
+<sql-statement>
+-- Ensure we can remove non-PK columns for partitioned tables.
+explain (costs off) select * from p_t1 group by a,b,c,d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Ensure we can remove non-PK columns for partitioned tables.
+ ^
+<sql-statement>
+drop table t1 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ drop table t1 cascade;
+ ^
+<sql-statement>
+drop table t2;
+</sql-statement>
+<sql-statement>
+drop table t3;
+</sql-statement>
+<sql-statement>
+drop table p_t1;
+</sql-statement>
+<sql-statement>
+--
+-- Test GROUP BY matching of join columns that are type-coerced due to USING
+--
+create temp table t1(f1 int, f2 bigint);
+</sql-statement>
+<sql-statement>
+create temp table t2(f1 bigint, f22 bigint);
+</sql-statement>
+<sql-statement>
+select f1 from t1 left join t2 using (f1) group by f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1 from t1 left join t2 using (f1) group by f1;
+ ^
+ -stdin-:<main>:1:1: Error: Can't find column: f1
+ select f1 from t1 left join t2 using (f1) group by f1;
+ ^
+<sql-statement>
+select f1 from t1 left join t2 using (f1) group by t1.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1 from t1 left join t2 using (f1) group by t1.f1;
+ ^
+ -stdin-:<main>:1:1: Error: Can't find column: f1
+ select f1 from t1 left join t2 using (f1) group by t1.f1;
+ ^
+<sql-statement>
+select t1.f1 from t1 left join t2 using (f1) group by t1.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select t1.f1 from t1 left join t2 using (f1) group by t1.f1;
+ ^
+ -stdin-:<main>:1:1: Error: Can't find column: f1
+ select t1.f1 from t1 left join t2 using (f1) group by t1.f1;
+ ^
+<sql-statement>
+-- only this one should fail:
+select t1.f1 from t1 left join t2 using (f1) group by f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- only this one should fail:
+ ^
+ -stdin-:<main>:1:1: Error: Can't find column: f1
+ -- only this one should fail:
+ ^
+<sql-statement>
+drop table t1, t2;
+</sql-statement>
+<sql-statement>
+--
+-- Test combinations of DISTINCT and/or ORDER BY
+--
+select array_agg(a order by b)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:8: Error: FuncCall: unsupported agg_order
+ select array_agg(a order by b)
+ ^
+<sql-statement>
+select array_agg(a order by a)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(a order by a)
+ ^
+<sql-statement>
+select array_agg(a order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(a order by a desc)
+ ^
+<sql-statement>
+select array_agg(b order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(b order by a desc)
+ ^
+<sql-statement>
+select array_agg(distinct a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+</sql-statement>
+<sql-statement>
+select array_agg(distinct a order by a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(distinct a order by a)
+ ^
+<sql-statement>
+select array_agg(distinct a order by a desc)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(distinct a order by a desc)
+ ^
+<sql-statement>
+select array_agg(distinct a order by a desc nulls last)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select array_agg(distinct a order by a desc nulls last)
+ ^
+<sql-statement>
+-- multi-arg aggs, strict/nonstrict, distinct/order by
+select aggfstr(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- multi-arg aggs, strict/nonstrict, distinct/order by
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select aggfstr(a,b,c)
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: aggfstr
+ select aggfstr(a,b,c)
+ ^
+<sql-statement>
+select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</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 aggfns(a,b,c)
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select aggfns(a,b,c)
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: aggfns
+ select aggfns(a,b,c)
+ ^
+<sql-statement>
+select aggfstr(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: agg_distinct must be set only for aggregate functions
+ select aggfstr(distinct a,b,c)
+ ^
+<sql-statement>
+select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: agg_distinct must be set only for aggregate functions
+ select aggfns(distinct a,b,c)
+ ^
+<sql-statement>
+select aggfstr(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfstr(distinct a,b,c order by b)
+ ^
+<sql-statement>
+select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by b)
+ ^
+<sql-statement>
+-- test specific code paths
+select aggfns(distinct a,a,c order by c using ~<~,a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,a,c order by c using ~<~,a)
+ ^
+<sql-statement>
+select aggfns(distinct a,a,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,a,c order by c using ~<~)
+ ^
+<sql-statement>
+select aggfns(distinct a,a,c order by a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,a,c order by a)
+ ^
+<sql-statement>
+select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ ^
+<sql-statement>
+-- check node I/O via view creation and usage, also deparsing logic
+create view agg_view1 as
+ select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- check node I/O via view creation and usage, also deparsing logic
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by b+1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(a,a,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create or replace view agg_view1 as
+ ^
+<sql-statement>
+select * from agg_view1;
+</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.agg_view1
+
+<sql-statement>
+select pg_get_viewdef('agg_view1'::regclass);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "agg_view1" does not exist
+
+ select pg_get_viewdef('agg_view1'::regclass);
+ ^
+<sql-statement>
+drop view agg_view1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'agg_view1'
+ drop view agg_view1;
+ ^
+<sql-statement>
+-- incorrect DISTINCT usage errors
+select aggfns(distinct a,b,c order by i)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by i)
+ ^
+<sql-statement>
+select aggfns(distinct a,b,c order by a,b+1)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by a,b+1)
+ ^
+<sql-statement>
+select aggfns(distinct a,b,c order by a,b,i,c)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by a,b,i,c)
+ ^
+<sql-statement>
+select aggfns(distinct a,a,c order by a,b)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,a,c order by a,b)
+ ^
+<sql-statement>
+-- string_agg tests
+select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
+</sql-statement>
+<sql-statement>
+select string_agg(a,',') from (values('aaaa'),(null),('bbbb'),('cccc')) g(a);
+</sql-statement>
+<sql-statement>
+select string_agg(a,'AB') from (values(null),(null),('bbbb'),('cccc')) g(a);
+</sql-statement>
+<sql-statement>
+select string_agg(a,',') from (values(null),(null)) g(a);
+</sql-statement>
+<sql-statement>
+-- check some implicit casting cases, as per bug #5564
+select string_agg(distinct f1, ',' order by f1) from varchar_tbl; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select string_agg(distinct f1, ',' order by f1) from varchar_tbl; -- ok
+ ^
+<sql-statement>
+select string_agg(distinct f1::text, ',' order by f1) from varchar_tbl; -- not ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select string_agg(distinct f1::text, ',' order by f1) from varchar_tbl; -- not ok
+ ^
+<sql-statement>
+select string_agg(distinct f1, ',' order by f1::text) from varchar_tbl; -- not ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select string_agg(distinct f1, ',' order by f1::text) from varchar_tbl; -- not ok
+ ^
+<sql-statement>
+select string_agg(distinct f1::text, ',' order by f1::text) from varchar_tbl; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select string_agg(distinct f1::text, ',' order by f1::text) from varchar_tbl; -- ok
+ ^
+<sql-statement>
+-- string_agg bytea tests
+create table bytea_test_table(v bytea);
+</sql-statement>
+<sql-statement>
+select string_agg(v, '') from bytea_test_table;
+</sql-statement>
+<sql-statement>
+insert into bytea_test_table values(decode('ff','hex'));
+</sql-statement>
+<sql-statement>
+select string_agg(v, '') from bytea_test_table;
+</sql-statement>
+<sql-statement>
+insert into bytea_test_table values(decode('aa','hex'));
+</sql-statement>
+<sql-statement>
+select string_agg(v, '') from bytea_test_table;
+</sql-statement>
+<sql-statement>
+select string_agg(v, NULL) from bytea_test_table;
+</sql-statement>
+<sql-statement>
+select string_agg(v, decode('ee', 'hex')) from bytea_test_table;
+</sql-statement>
+<sql-statement>
+drop table bytea_test_table;
+</sql-statement>
+<sql-statement>
+-- FILTER tests
+select min(unique1) filter (where unique1 > 100) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_filter
+ select min(unique1) filter (where unique1 > 100) from tenk1;
+ ^
+<sql-statement>
+select sum(1/ten) filter (where ten > 0) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_filter
+ select sum(1/ten) filter (where ten > 0) from tenk1;
+ ^
+<sql-statement>
+select ten, sum(distinct four) filter (where four::text ~ '123') from onek a
+group by ten;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: FuncCall: unsupported agg_filter
+ select ten, sum(distinct four) filter (where four::text ~ '123') from onek a
+ ^
+<sql-statement>
+select ten, sum(distinct four) filter (where four > 10) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:43: Error: Aggregate functions are not allowed in: WHERE
+ having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+ ^
+<sql-statement>
+select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0')
+from (values ('a', 'b')) AS v(foo,bar);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_filter
+ select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0')
+ ^
+<sql-statement>
+-- outer reference in FILTER (PostgreSQL extension)
+select (select count(*)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+</sql-statement>
+<sql-statement>
+select (select count(*) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- outer query is aggregation query
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: FuncCall: unsupported agg_filter
+ select (select count(*) filter (where outer_c <> 0)
+ ^
+<sql-statement>
+select (select count(inner_c) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: FuncCall: unsupported agg_filter
+ select (select count(inner_c) filter (where outer_c <> 0)
+ ^
+<sql-statement>
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1))
+ filter (where o.unique1 < 10))
+from tenk1 o; -- outer query is aggregation query
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:11: Error: FuncCall: unsupported agg_filter
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1))
+ ^
+<sql-statement>
+-- subquery in FILTER clause (PostgreSQL extension)
+select sum(unique1) FILTER (WHERE
+ unique1 IN (SELECT unique1 FROM onek where unique1 < 100)) FROM tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_filter
+ select sum(unique1) FILTER (WHERE
+ ^
+<sql-statement>
+-- exercise lots of aggregate parts with FILTER
+select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
+ ^
+<sql-statement>
+-- check handling of bare boolean Var in FILTER
+select max(0) filter (where b1) from bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_filter
+ select max(0) filter (where b1) from bool_test;
+ ^
+<sql-statement>
+select (select max(0) filter (where b1)) from bool_test;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: FuncCall: unsupported agg_filter
+ select (select max(0) filter (where b1)) from bool_test;
+ ^
+<sql-statement>
+-- check for correct detection of nested-aggregate errors in FILTER
+select max(unique1) filter (where sum(ten) > 0) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_filter
+ select max(unique1) filter (where sum(ten) > 0) from tenk1;
+ ^
+<sql-statement>
+select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: FuncCall: unsupported agg_filter
+ select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
+ ^
+<sql-statement>
+select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_filter
+ select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
+ ^
+<sql-statement>
+select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: FuncCall: unsupported agg_filter
+ select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
+ ^
+<sql-statement>
+-- ordered-set aggregates
+select p, percentile_cont(p) within group (order by x::float8)
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:11: Error: FuncCall: unsupported agg_order
+ select p, percentile_cont(p) within group (order by x::float8)
+ ^
+<sql-statement>
+select p, percentile_cont(p order by p) within group (order by x) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: ERROR: cannot use multiple ORDER BY clauses with WITHIN GROUP
+
+ select p, percentile_cont(p order by p) within group (order by x) -- error
+ ^
+<sql-statement>
+select p, sum() within group (order by x::float8) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:11: Error: FuncCall: unsupported agg_order
+ select p, sum() within group (order by x::float8) -- error
+ ^
+<sql-statement>
+select p, percentile_cont(p,p) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+</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 p, percentile_cont(p,p) -- error
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgResolvedCall
+ select p, percentile_cont(p,p) -- error
+ ^
+ -stdin-:<main>:1:11: Error: Aggregate function percentile_cont cannot be called directly
+ select p, percentile_cont(p,p) -- error
+ ^
+<sql-statement>
+select percentile_cont(0.5) within group (order by b) from aggtest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_cont(0.5) within group (order by b) from aggtest;
+ ^
+<sql-statement>
+select percentile_cont(0.5) within group (order by b), sum(b) from aggtest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_cont(0.5) within group (order by b), sum(b) from aggtest;
+ ^
+<sql-statement>
+select percentile_cont(0.5) within group (order by thousand) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_cont(0.5) within group (order by thousand) from tenk1;
+ ^
+<sql-statement>
+select percentile_disc(0.5) within group (order by thousand) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_disc(0.5) within group (order by thousand) from tenk1;
+ ^
+<sql-statement>
+select rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select rank(3) within group (order by x)
+ ^
+<sql-statement>
+select cume_dist(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select cume_dist(3) within group (order by x)
+ ^
+<sql-statement>
+select percent_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4),(5)) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percent_rank(3) within group (order by x)
+ ^
+<sql-statement>
+select dense_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select dense_rank(3) within group (order by x)
+ ^
+<sql-statement>
+select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group (order by thousand)
+from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group (order by thousand)
+ ^
+<sql-statement>
+select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by thousand)
+from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by thousand)
+ ^
+<sql-statement>
+select percentile_disc(array[[null,1,0.5],[0.75,0.25,null]]) within group (order by thousand)
+from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_disc(array[[null,1,0.5],[0.75,0.25,null]]) within group (order by thousand)
+ ^
+<sql-statement>
+select percentile_cont(array[0,1,0.25,0.75,0.5,1,0.3,0.32,0.35,0.38,0.4]) within group (order by x)
+from generate_series(1,6) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_cont(array[0,1,0.25,0.75,0.5,1,0.3,0.32,0.35,0.38,0.4]) within group (order by x)
+ ^
+<sql-statement>
+select ten, mode() within group (order by string4) from tenk1 group by ten;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: FuncCall: unsupported agg_order
+ select ten, mode() within group (order by string4) from tenk1 group by ten;
+ ^
+<sql-statement>
+select percentile_disc(array[0.25,0.5,0.75]) within group (order by x)
+from unnest('{fred,jim,fred,jack,jill,fred,jill,jim,jim,sheila,jim,sheila}'::text[]) u(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select percentile_disc(array[0.25,0.5,0.75]) within group (order by x)
+ ^
+<sql-statement>
+-- check collation propagates up in suitable cases:
+select pg_collation_for(percentile_disc(1) within group (order by x collate "POSIX"))
+ from (values ('fred'),('jim')) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:25: Error: FuncCall: unsupported agg_order
+ select pg_collation_for(percentile_disc(1) within group (order by x collate "POSIX"))
+ ^
+<sql-statement>
+-- ordered-set aggs created with CREATE AGGREGATE
+select test_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select test_rank(3) within group (order by x)
+ ^
+<sql-statement>
+select test_percentile_disc(0.5) within group (order by thousand) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select test_percentile_disc(0.5) within group (order by thousand) from tenk1;
+ ^
+<sql-statement>
+-- ordered-set aggs can't use ungrouped vars in direct args:
+select rank(x) within group (order by x) from generate_series(1,5) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select rank(x) within group (order by x) from generate_series(1,5) x;
+ ^
+<sql-statement>
+-- outer-level agg can't use a grouped arg of a lower level, either:
+select array(select percentile_disc(a) within group (order by x)
+ from (values (0.3),(0.7)) v(a) group by a)
+ from generate_series(1,5) g(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:21: Error: FuncCall: unsupported agg_order
+ select array(select percentile_disc(a) within group (order by x)
+ ^
+<sql-statement>
+-- agg in the direct args is a grouping violation, too:
+select rank(sum(x)) within group (order by x) from generate_series(1,5) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select rank(sum(x)) within group (order by x) from generate_series(1,5) x;
+ ^
+<sql-statement>
+-- hypothetical-set type unification and argument-count failures:
+select rank(3) within group (order by x) from (values ('fred'),('jim')) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select rank(3) within group (order by x) from (values ('fred'),('jim')) v(x);
+ ^
+<sql-statement>
+select rank(3) within group (order by stringu1,stringu2) from tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select rank(3) within group (order by stringu1,stringu2) from tenk1;
+ ^
+<sql-statement>
+select rank('fred') within group (order by x) from generate_series(1,5) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select rank('fred') within group (order by x) from generate_series(1,5) x;
+ ^
+<sql-statement>
+select rank('adam'::text collate "C") within group (order by x collate "POSIX")
+ from (values ('fred'),('jim')) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select rank('adam'::text collate "C") within group (order by x collate "POSIX")
+ ^
+<sql-statement>
+-- hypothetical-set type unification successes:
+select rank('adam'::varchar) within group (order by x) from (values ('fred'),('jim')) v(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select rank('adam'::varchar) within group (order by x) from (values ('fred'),('jim')) v(x);
+ ^
+<sql-statement>
+select rank('3') within group (order by x) from generate_series(1,5) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ select rank('3') within group (order by x) from generate_series(1,5) x;
+ ^
+<sql-statement>
+-- divide by zero check
+select percent_rank(0) within group (order by x) from generate_series(1,0) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ select percent_rank(0) within group (order by x) from generate_series(1,0) x;
+ ^
+<sql-statement>
+-- deparse and multiple features:
+create view aggordview1 as
+select ten,
+ percentile_disc(0.5) within group (order by thousand) as p50,
+ percentile_disc(0.5) within group (order by thousand) filter (where hundred=1) as px,
+ rank(5,'AZZZZ',50) within group (order by hundred, string4 desc, hundred)
+ from tenk1
+ group by ten order by ten;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- deparse and multiple features:
+ ^
+<sql-statement>
+select pg_get_viewdef('aggordview1');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select pg_get_viewdef('aggordview1');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "aggordview1" does not exist
+
+ select pg_get_viewdef('aggordview1');
+ ^
+<sql-statement>
+select * from aggordview1 order by ten;
+</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.aggordview1
+
+<sql-statement>
+drop view aggordview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'aggordview1'
+ drop view aggordview1;
+ ^
+<sql-statement>
+-- variadic aggregates
+select least_agg(q1,q2) from int8_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- variadic aggregates
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select least_agg(q1,q2) from int8_tbl;
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: least_agg
+ select least_agg(q1,q2) from int8_tbl;
+ ^
+<sql-statement>
+select least_agg(variadic array[q1,q2]) from int8_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select least_agg(variadic array[q1,q2]) from int8_tbl;
+ ^
+<sql-statement>
+select cleast_agg(q1,q2) from int8_tbl;
+</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 cleast_agg(q1,q2) from int8_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select cleast_agg(q1,q2) from int8_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: cleast_agg
+ select cleast_agg(q1,q2) from int8_tbl;
+ ^
+<sql-statement>
+select cleast_agg(4.5,f1) from int4_tbl;
+</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 cleast_agg(4.5,f1) from int4_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select cleast_agg(4.5,f1) from int4_tbl;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: cleast_agg
+ select cleast_agg(4.5,f1) from int4_tbl;
+ ^
+<sql-statement>
+select cleast_agg(variadic array[4.5,f1]) from int4_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select cleast_agg(variadic array[4.5,f1]) from int4_tbl;
+ ^
+<sql-statement>
+select pg_typeof(cleast_agg(variadic array[4.5,f1])) from int4_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: FuncCall: unsupported func_variadic
+ select pg_typeof(cleast_agg(variadic array[4.5,f1])) from int4_tbl;
+ ^
+<sql-statement>
+-- test aggregates with common transition functions share the same states
+begin work;
+</sql-statement>
+<sql-statement>
+create type avg_state as (total bigint, count bigint);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ create type avg_state as (total bigint, count bigint);
+ ^
+<sql-statement>
+create or replace function avg_transfn(state avg_state, n int) returns avg_state as
+$$
+declare new_state avg_state;
+begin
+ raise notice 'avg_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state.total := n;
+ new_state.count := 1;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state.total := state.total + n;
+ state.count := state.count + 1;
+ return state;
+ end if;
+ return null;
+end
+$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create or replace function avg_transfn(state avg_state, n int) returns avg_state as
+ ^
+<sql-statement>
+create function avg_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total / state.count;
+ end if;
+end
+$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function avg_finalfn(state avg_state) returns int4 as
+ ^
+<sql-statement>
+create function sum_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total;
+ end if;
+end
+$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function sum_finalfn(state avg_state) returns int4 as
+ ^
+<sql-statement>
+create aggregate my_avg(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_avg(int4)
+ ^
+<sql-statement>
+create aggregate my_sum(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_sum(int4)
+ ^
+<sql-statement>
+-- aggregate state should be shared as aggs are the same.
+select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- aggregate state should be shared as aggs are the same.
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- aggregate state should be shared as aggs are the same.
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_avg
+ select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- aggregate state should be shared as aggs are the same.
+ ^
+ -stdin-:<main>:2:20: Error: At function: PgCall
+ select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:20: Error: No such proc: my_avg
+ select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+-- aggregate state should be shared as transfn is the same for both aggs.
+select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- aggregate state should be shared as transfn is the same for both aggs.
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- aggregate state should be shared as transfn is the same for both aggs.
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_avg
+ select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- aggregate state should be shared as transfn is the same for both aggs.
+ ^
+ -stdin-:<main>:2:20: Error: At function: PgCall
+ select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:20: Error: No such proc: my_sum
+ select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+-- same as previous one, but with DISTINCT, which requires sorting the input.
+select my_avg(distinct one),my_sum(distinct one) from (values(1),(3),(1)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: agg_distinct must be set only for aggregate functions
+ select my_avg(distinct one),my_sum(distinct one) from (values(1),(3),(1)) t(one);
+ ^
+<sql-statement>
+-- shouldn't share states due to the distinctness not matching.
+select my_avg(distinct one),my_sum(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: agg_distinct must be set only for aggregate functions
+ select my_avg(distinct one),my_sum(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+-- shouldn't share states due to the filter clause not matching.
+select my_avg(one) filter (where one > 1),my_sum(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_filter
+ select my_avg(one) filter (where one > 1),my_sum(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+-- this should not share the state due to different input columns.
+select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- this should not share the state due to different input columns.
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- this should not share the state due to different input columns.
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_avg
+ select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- this should not share the state due to different input columns.
+ ^
+ -stdin-:<main>:2:20: Error: At function: PgCall
+ select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+ ^
+ -stdin-:<main>:2:20: Error: No such proc: my_sum
+ select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+ ^
+<sql-statement>
+-- exercise cases where OSAs share state
+select
+ percentile_cont(0.5) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:3: Error: FuncCall: unsupported agg_order
+ percentile_cont(0.5) within group (order by a),
+ ^
+<sql-statement>
+select
+ percentile_cont(0.25) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:3: Error: FuncCall: unsupported agg_order
+ percentile_cont(0.25) within group (order by a),
+ ^
+<sql-statement>
+-- these can't share state currently
+select
+ rank(4) within group (order by a),
+ dense_rank(4) within group (order by a)
+from (values(1),(3),(5),(7)) t(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:3: Error: FuncCall: unsupported agg_order
+ rank(4) within group (order by a),
+ ^
+<sql-statement>
+-- test that aggs with the same sfunc and initcond share the same agg state
+create aggregate my_sum_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn,
+ initcond = '(10,0)'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ -- test that aggs with the same sfunc and initcond share the same agg state
+ ^
+<sql-statement>
+create aggregate my_avg_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(10,0)'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_avg_init(int4)
+ ^
+<sql-statement>
+create aggregate my_avg_init2(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(4,0)'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_avg_init2(int4)
+ ^
+<sql-statement>
+-- state should be shared if INITCONDs are matching
+select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- state should be shared if INITCONDs are matching
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- state should be shared if INITCONDs are matching
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_sum_init
+ select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- state should be shared if INITCONDs are matching
+ ^
+ -stdin-:<main>:2:25: Error: At function: PgCall
+ select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:25: Error: No such proc: my_avg_init
+ select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+-- Varying INITCONDs should cause the states not to be shared.
+select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Varying INITCONDs should cause the states not to be shared.
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- Varying INITCONDs should cause the states not to be shared.
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_sum_init
+ select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- Varying INITCONDs should cause the states not to be shared.
+ ^
+ -stdin-:<main>:2:25: Error: At function: PgCall
+ select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+ ^
+ -stdin-:<main>:2:25: Error: No such proc: my_avg_init2
+ select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- test aggregate state sharing to ensure it works if one aggregate has a
+-- finalfn and the other one has none.
+begin work;
+</sql-statement>
+<sql-statement>
+create or replace function sum_transfn(state int4, n int4) returns int4 as
+$$
+declare new_state int4;
+begin
+ raise notice 'sum_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state := n;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state := state + n;
+ return state;
+ end if;
+ return null;
+end
+$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create or replace function sum_transfn(state int4, n int4) returns int4 as
+ ^
+<sql-statement>
+create function halfsum_finalfn(state int4) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state / 2;
+ end if;
+end
+$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function halfsum_finalfn(state int4) returns int4 as
+ ^
+<sql-statement>
+create aggregate my_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_sum(int4)
+ ^
+<sql-statement>
+create aggregate my_half_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn,
+ finalfunc = halfsum_finalfn
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create aggregate my_half_sum(int4)
+ ^
+<sql-statement>
+-- Agg state should be shared even though my_sum has no finalfn
+select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Agg state should be shared even though my_sum has no finalfn
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- Agg state should be shared even though my_sum has no finalfn
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+ ^
+ -stdin-:<main>:2:8: Error: No such proc: my_sum
+ select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- Agg state should be shared even though my_sum has no finalfn
+ ^
+ -stdin-:<main>:2:20: Error: At function: PgCall
+ select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+ ^
+ -stdin-:<main>:2:20: Error: No such proc: my_half_sum
+ select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- test that the aggregate transition logic correctly handles
+-- transition / combine functions returning NULL
+-- First test the case of a normal transition function returning NULL
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE FUNCTION balkifnull(int8, int4)
+RETURNS int8
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION balkifnull(int8, int4)
+ ^
+<sql-statement>
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = balkifnull(int8, int4),
+ STYPE = int8,
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE balk(int4)
+ ^
+<sql-statement>
+SELECT balk(hundred) FROM tenk1;
+</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 balk(hundred) FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT balk(hundred) FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: balk
+ SELECT balk(hundred) FROM tenk1;
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+-- Secondly test the case of a parallel aggregate combiner function
+-- returning NULL. For that use normal transition function, but a
+-- combiner function returning NULL.
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE FUNCTION balkifnull(int8, int8)
+RETURNS int8
+PARALLEL SAFE
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION balkifnull(int8, int8)
+ ^
+<sql-statement>
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = int4_sum(int8, int4),
+ STYPE = int8,
+ COMBINEFUNC = balkifnull(int8, int8),
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE balk(int4)
+ ^
+<sql-statement>
+-- force use of parallelism
+ALTER TABLE tenk1 set (parallel_workers = 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- force use of parallelism
+ ^
+<sql-statement>
+SET LOCAL parallel_setup_cost=0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: parallel_setup_cost
+ SET LOCAL parallel_setup_cost=0;
+ ^
+<sql-statement>
+SET LOCAL max_parallel_workers_per_gather=4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: max_parallel_workers_per_gather
+ SET LOCAL max_parallel_workers_per_gather=4;
+ ^
+<sql-statement>
+EXPLAIN (COSTS OFF) SELECT balk(hundred) FROM tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF) SELECT balk(hundred) FROM tenk1;
+ ^
+<sql-statement>
+SELECT balk(hundred) FROM tenk1;
+</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 balk(hundred) FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT balk(hundred) FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: balk
+ SELECT balk(hundred) FROM tenk1;
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+-- test coverage for aggregate combine/serial/deserial functions
+BEGIN;
+</sql-statement>
+<sql-statement>
+SET parallel_setup_cost = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: parallel_setup_cost
+ SET parallel_setup_cost = 0;
+ ^
+<sql-statement>
+SET parallel_tuple_cost = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: parallel_tuple_cost
+ SET parallel_tuple_cost = 0;
+ ^
+<sql-statement>
+SET min_parallel_table_scan_size = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: min_parallel_table_scan_size
+ SET min_parallel_table_scan_size = 0;
+ ^
+<sql-statement>
+SET max_parallel_workers_per_gather = 4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: max_parallel_workers_per_gather
+ SET max_parallel_workers_per_gather = 4;
+ ^
+<sql-statement>
+SET parallel_leader_participation = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: parallel_leader_participation
+ SET parallel_leader_participation = off;
+ ^
+<sql-statement>
+SET enable_indexonlyscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_indexonlyscan
+ SET enable_indexonlyscan = off;
+ ^
+<sql-statement>
+-- variance(int4) covers numeric_poly_combine
+-- sum(int8) covers int8_avg_combine
+-- regr_count(float8, float8) covers int8inc_float8_float8 and aggregates with > 1 arg
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- variance(int4) covers numeric_poly_combine
+ ^
+<sql-statement>
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+</sql-statement>
+<sql-statement>
+-- variance(int8) covers numeric_combine
+-- avg(numeric) covers numeric_avg_combine
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- variance(int8) covers numeric_combine
+ ^
+<sql-statement>
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+</sql-statement>
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+-- test coverage for dense_rank
+SELECT dense_rank(x) WITHIN GROUP (ORDER BY x) FROM (VALUES (1),(1),(2),(2),(3),(3)) v(x) GROUP BY (x) ORDER BY 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported agg_order
+ SELECT dense_rank(x) WITHIN GROUP (ORDER BY x) FROM (VALUES (1),(1),(2),(2),(3),(3)) v(x) GROUP BY (x) ORDER BY 1;
+ ^
+<sql-statement>
+-- Ensure that the STRICT checks for aggregates does not take NULLness
+-- of ORDER BY columns into account. See bug report around
+-- 2a505161-2727-2473-7c46-591ed108ac52@email.cz
+SELECT min(x ORDER BY y) FROM (VALUES(1, NULL)) AS d(x,y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:8: Error: FuncCall: unsupported agg_order
+ SELECT min(x ORDER BY y) FROM (VALUES(1, NULL)) AS d(x,y);
+ ^
+<sql-statement>
+SELECT min(x ORDER BY y) FROM (VALUES(1, 2)) AS d(x,y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ SELECT min(x ORDER BY y) FROM (VALUES(1, 2)) AS d(x,y);
+ ^
+<sql-statement>
+-- check collation-sensitive matching between grouping expressions
+select v||'a', case v||'a' when 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+</sql-statement>
+<sql-statement>
+select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+</sql-statement>
+<sql-statement>
+-- Make sure that generation of HashAggregate for uniqification purposes
+-- does not lead to array overflow due to unexpected duplicate hash keys
+-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
+set enable_memoize to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_memoize
+ -- Make sure that generation of HashAggregate for uniqification purposes
+ ^
+<sql-statement>
+explain (costs off)
+ select 1 from tenk1
+ where (hundred, thousand) in (select twothousand, twothousand from onek);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+reset enable_memoize;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_memoize;
+ ^
+<sql-statement>
+--
+-- Hash Aggregation Spill tests
+--
+set enable_sort=false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ --
+ ^
+<sql-statement>
+set work_mem='64kB';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: work_mem
+ set work_mem='64kB';
+ ^
+<sql-statement>
+select unique1, count(*), sum(twothousand) from tenk1
+group by unique1
+having sum(fivethous) > 4975
+order by sum(twothousand);
+</sql-statement>
+<sql-statement>
+set work_mem to default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ set work_mem to default;
+ ^
+<sql-statement>
+set enable_sort to default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ set enable_sort to default;
+ ^
+<sql-statement>
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+set work_mem='64kB';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: work_mem
+ --
+ ^
+<sql-statement>
+create table agg_data_2k as
+select g from generate_series(0, 1999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_data_2k as
+ ^
+<sql-statement>
+analyze agg_data_2k;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze agg_data_2k;
+ ^
+<sql-statement>
+create table agg_data_20k as
+select g from generate_series(0, 19999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_data_20k as
+ ^
+<sql-statement>
+analyze agg_data_20k;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze agg_data_20k;
+ ^
+<sql-statement>
+-- Produce results with sorting.
+set enable_hashagg = false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- Produce results with sorting.
+ ^
+<sql-statement>
+set jit_above_cost = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: jit_above_cost
+ set jit_above_cost = 0;
+ ^
+<sql-statement>
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+create table agg_group_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_group_1 as
+ ^
+<sql-statement>
+create table agg_group_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_group_2 as
+ ^
+<sql-statement>
+set jit_above_cost to default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ set jit_above_cost to default;
+ ^
+<sql-statement>
+create table agg_group_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_group_3 as
+ ^
+<sql-statement>
+create table agg_group_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_group_4 as
+ ^
+<sql-statement>
+-- Produce results with hash aggregation
+set enable_hashagg = true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- Produce results with hash aggregation
+ ^
+<sql-statement>
+set enable_sort = false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ set enable_sort = false;
+ ^
+<sql-statement>
+set jit_above_cost = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: jit_above_cost
+ set jit_above_cost = 0;
+ ^
+<sql-statement>
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+create table agg_hash_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_hash_1 as
+ ^
+<sql-statement>
+create table agg_hash_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_hash_2 as
+ ^
+<sql-statement>
+set jit_above_cost to default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ set jit_above_cost to default;
+ ^
+<sql-statement>
+create table agg_hash_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_hash_3 as
+ ^
+<sql-statement>
+create table agg_hash_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create table agg_hash_4 as
+ ^
+<sql-statement>
+set enable_sort = true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ set enable_sort = true;
+ ^
+<sql-statement>
+set work_mem to default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ set work_mem to default;
+ ^
+<sql-statement>
+-- Compare group aggregation results to hash aggregation results
+(select * from agg_hash_1 except select * from agg_group_1)
+ union all
+(select * from agg_group_1 except select * from agg_hash_1);
+</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.agg_group_1
+
+<sql-statement>
+(select * from agg_hash_2 except select * from agg_group_2)
+ union all
+(select * from agg_group_2 except select * from agg_hash_2);
+</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.agg_group_2
+
+<sql-statement>
+(select * from agg_hash_3 except select * from agg_group_3)
+ union all
+(select * from agg_group_3 except select * from agg_hash_3);
+</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.agg_hash_3
+
+<sql-statement>
+(select * from agg_hash_4 except select * from agg_group_4)
+ union all
+(select * from agg_group_4 except select * from agg_hash_4);
+</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.agg_hash_4
+
+<sql-statement>
+drop table agg_group_1;
+</sql-statement>
+<sql-statement>
+drop table agg_group_2;
+</sql-statement>
+<sql-statement>
+drop table agg_group_3;
+</sql-statement>
+<sql-statement>
+drop table agg_group_4;
+</sql-statement>
+<sql-statement>
+drop table agg_hash_1;
+</sql-statement>
+<sql-statement>
+drop table agg_hash_2;
+</sql-statement>
+<sql-statement>
+drop table agg_hash_3;
+</sql-statement>
+<sql-statement>
+drop table agg_hash_4;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/aggregates.out b/yql/essentials/tests/postgresql/cases/aggregates.out
new file mode 100644
index 0000000000..af0f3403a6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/aggregates.out
@@ -0,0 +1,738 @@
+--
+-- AGGREGATES
+--
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+SELECT avg(four) AS avg_1 FROM onek;
+ avg_1
+--------------------
+ 1.5000000000000000
+(1 row)
+
+SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
+ avg_32
+---------------------
+ 32.6666666666666667
+(1 row)
+
+-- In 7.1, avg(float4) is computed using float8 arithmetic.
+-- Round the result to 3 digits to avoid platform-specific results.
+SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
+ avg_107_943
+-------------
+ 107.943
+(1 row)
+
+SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
+ avg_3_4
+---------
+ 3.4
+(1 row)
+
+SELECT sum(four) AS sum_1500 FROM onek;
+ sum_1500
+----------
+ 1500
+(1 row)
+
+SELECT sum(a) AS sum_198 FROM aggtest;
+ sum_198
+---------
+ 198
+(1 row)
+
+SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
+ avg_6_8
+---------
+ 6.8
+(1 row)
+
+SELECT max(four) AS max_3 FROM onek;
+ max_3
+-------
+ 3
+(1 row)
+
+SELECT max(a) AS max_100 FROM aggtest;
+ max_100
+---------
+ 100
+(1 row)
+
+SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
+ max_324_78
+------------
+ 324.78
+(1 row)
+
+SELECT max(student.gpa) AS max_3_7 FROM student;
+ max_3_7
+---------
+ 3.7
+(1 row)
+
+SELECT stddev_pop(b) FROM aggtest;
+ stddev_pop
+-----------------
+ 131.10703231895
+(1 row)
+
+SELECT stddev_samp(b) FROM aggtest;
+ stddev_samp
+------------------
+ 151.389360803998
+(1 row)
+
+SELECT var_pop(b) FROM aggtest;
+ var_pop
+------------------
+ 17189.0539234823
+(1 row)
+
+SELECT var_samp(b) FROM aggtest;
+ var_samp
+------------------
+ 22918.7385646431
+(1 row)
+
+SELECT stddev_pop(b::numeric) FROM aggtest;
+ stddev_pop
+------------------
+ 131.107032862199
+(1 row)
+
+SELECT stddev_samp(b::numeric) FROM aggtest;
+ stddev_samp
+------------------
+ 151.389361431288
+(1 row)
+
+SELECT var_pop(b::numeric) FROM aggtest;
+ var_pop
+--------------------
+ 17189.054065929769
+(1 row)
+
+SELECT var_samp(b::numeric) FROM aggtest;
+ var_samp
+--------------------
+ 22918.738754573025
+(1 row)
+
+-- population variance is defined for a single tuple, sample variance
+-- is not
+SELECT var_pop(1.0::float8), var_samp(2.0::float8);
+ var_pop | var_samp
+---------+----------
+ 0 |
+(1 row)
+
+SELECT stddev_pop(3.0::float8), stddev_samp(4.0::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ 0 |
+(1 row)
+
+SELECT var_pop('inf'::float8), var_samp('inf'::float8);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::float8), stddev_samp('inf'::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::float8), var_samp('nan'::float8);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::float8), stddev_samp('nan'::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop(1.0::float4), var_samp(2.0::float4);
+ var_pop | var_samp
+---------+----------
+ 0 |
+(1 row)
+
+SELECT stddev_pop(3.0::float4), stddev_samp(4.0::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ 0 |
+(1 row)
+
+SELECT var_pop('inf'::float4), var_samp('inf'::float4);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::float4), stddev_samp('inf'::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::float4), var_samp('nan'::float4);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::float4), stddev_samp('nan'::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('inf'::numeric), var_samp('inf'::numeric);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::numeric), stddev_samp('inf'::numeric);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::numeric), var_samp('nan'::numeric);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::numeric), stddev_samp('nan'::numeric);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+-- verify correct results for null and NaN inputs
+select sum(null::int4) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::int8) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::numeric) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::float8) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select avg(null::int4) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::int8) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::numeric) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::float8) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select sum('NaN'::numeric) from generate_series(1,3);
+ sum
+-----
+ NaN
+(1 row)
+
+select avg('NaN'::numeric) from generate_series(1,3);
+ avg
+-----
+ NaN
+(1 row)
+
+-- verify correct results for infinite inputs
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('1'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('1')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+-----+-----+---------
+ NaN | NaN | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+ sum | avg | var_pop
+-----------+-----------+---------
+ -Infinity | -Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('1'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('1')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+-----+-----+---------
+ NaN | NaN | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+ sum | avg | var_pop
+-----------+-----------+---------
+ -Infinity | -Infinity | NaN
+(1 row)
+
+-- test accuracy with a large input offset
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x);
+ avg | var_pop
+-----------+---------
+ 100000005 | 2.5
+(1 row)
+
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (7000000000005), (7000000000007)) v(x);
+ avg | var_pop
+---------------+---------
+ 7000000000006 | 1
+(1 row)
+
+-- SQL2003 binary aggregates
+SELECT regr_count(b, a) FROM aggtest;
+ regr_count
+------------
+ 4
+(1 row)
+
+SELECT regr_sxx(b, a) FROM aggtest;
+ regr_sxx
+----------
+ 5099
+(1 row)
+
+SELECT regr_syy(b, a) FROM aggtest;
+ regr_syy
+------------------
+ 68756.2156939293
+(1 row)
+
+SELECT regr_sxy(b, a) FROM aggtest;
+ regr_sxy
+------------------
+ 2614.51582155004
+(1 row)
+
+SELECT regr_avgx(b, a), regr_avgy(b, a) FROM aggtest;
+ regr_avgx | regr_avgy
+-----------+------------------
+ 49.5 | 107.943152273074
+(1 row)
+
+SELECT regr_r2(b, a) FROM aggtest;
+ regr_r2
+--------------------
+ 0.0194977982031803
+(1 row)
+
+SELECT regr_slope(b, a), regr_intercept(b, a) FROM aggtest;
+ regr_slope | regr_intercept
+-------------------+------------------
+ 0.512750700441271 | 82.5619926012309
+(1 row)
+
+SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest;
+ covar_pop | covar_samp
+-----------------+------------------
+ 653.62895538751 | 871.505273850014
+(1 row)
+
+SELECT corr(b, a) FROM aggtest;
+ corr
+-------------------
+ 0.139634516517873
+(1 row)
+
+-- check single-tuple behavior
+SELECT covar_pop(1::float8,2::float8), covar_samp(3::float8,4::float8);
+ covar_pop | covar_samp
+-----------+------------
+ 0 |
+(1 row)
+
+SELECT covar_pop(1::float8,'inf'::float8), covar_samp(3::float8,'inf'::float8);
+ covar_pop | covar_samp
+-----------+------------
+ NaN |
+(1 row)
+
+SELECT covar_pop(1::float8,'nan'::float8), covar_samp(3::float8,'nan'::float8);
+ covar_pop | covar_samp
+-----------+------------
+ NaN |
+(1 row)
+
+-- test accum and combine functions directly
+CREATE TABLE regr_test (x float8, y float8);
+INSERT INTO regr_test VALUES (10,150),(20,250),(30,350),(80,540),(100,200);
+SELECT float8_accum('{4,140,2900}'::float8[], 100);
+ float8_accum
+--------------
+ {5,240,6280}
+(1 row)
+
+SELECT float8_regr_accum('{4,140,2900,1290,83075,15050}'::float8[], 200, 100);
+ float8_regr_accum
+------------------------------
+ {5,240,6280,1490,95080,8680}
+(1 row)
+
+SELECT float8_combine('{3,60,200}'::float8[], '{0,0,0}'::float8[]);
+ float8_combine
+----------------
+ {3,60,200}
+(1 row)
+
+SELECT float8_combine('{0,0,0}'::float8[], '{2,180,200}'::float8[]);
+ float8_combine
+----------------
+ {2,180,200}
+(1 row)
+
+SELECT float8_combine('{3,60,200}'::float8[], '{2,180,200}'::float8[]);
+ float8_combine
+----------------
+ {5,240,6280}
+(1 row)
+
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{0,0,0,0,0,0}'::float8[]);
+ float8_regr_combine
+---------------------------
+ {3,60,200,750,20000,2000}
+(1 row)
+
+SELECT float8_regr_combine('{0,0,0,0,0,0}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+ float8_regr_combine
+-----------------------------
+ {2,180,200,740,57800,-3400}
+(1 row)
+
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+ float8_regr_combine
+------------------------------
+ {5,240,6280,1490,95080,8680}
+(1 row)
+
+DROP TABLE regr_test;
+-- test count, distinct
+SELECT count(four) AS cnt_1000 FROM onek;
+ cnt_1000
+----------
+ 1000
+(1 row)
+
+SELECT count(DISTINCT four) AS cnt_4 FROM onek;
+ cnt_4
+-------
+ 4
+(1 row)
+
+select ten, count(*), sum(four) from onek
+group by ten order by ten;
+ ten | count | sum
+-----+-------+-----
+ 0 | 100 | 100
+ 1 | 100 | 200
+ 2 | 100 | 100
+ 3 | 100 | 200
+ 4 | 100 | 100
+ 5 | 100 | 200
+ 6 | 100 | 100
+ 7 | 100 | 200
+ 8 | 100 | 100
+ 9 | 100 | 200
+(10 rows)
+
+select ten, count(four), sum(DISTINCT four) from onek
+group by ten order by ten;
+ ten | count | sum
+-----+-------+-----
+ 0 | 100 | 2
+ 1 | 100 | 4
+ 2 | 100 | 2
+ 3 | 100 | 4
+ 4 | 100 | 2
+ 5 | 100 | 4
+ 6 | 100 | 2
+ 7 | 100 | 4
+ 8 | 100 | 2
+ 9 | 100 | 4
+(10 rows)
+
+--
+-- test for bitwise integer aggregates
+--
+CREATE TEMPORARY TABLE bitwise_test(
+ i2 INT2,
+ i4 INT4,
+ i8 INT8,
+ i INTEGER,
+ x INT2,
+ y BIT(4)
+);
+CREATE TEMPORARY TABLE bool_test(
+ b1 BOOL,
+ b2 BOOL,
+ b3 BOOL,
+ b4 BOOL);
+select min(unique1) from tenk1;
+ min
+-----
+ 0
+(1 row)
+
+select max(unique1) from tenk1;
+ max
+------
+ 9999
+(1 row)
+
+select max(unique1) from tenk1 where unique1 < 42;
+ max
+-----
+ 41
+(1 row)
+
+select max(unique1) from tenk1 where unique1 > 42;
+ max
+------
+ 9999
+(1 row)
+
+-- the planner may choose a generic aggregate here if parallel query is
+-- enabled, since that plan will be parallel safe and the "optimized"
+-- plan, which has almost identical cost, will not be. we want to test
+-- the optimized plan, so temporarily disable parallel query.
+begin;
+select max(unique1) from tenk1 where unique1 > 42000;
+ max
+-----
+
+(1 row)
+
+rollback;
+select max(tenthous) from tenk1 where thousand = 33;
+ max
+------
+ 9033
+(1 row)
+
+select min(tenthous) from tenk1 where thousand = 33;
+ min
+-----
+ 33
+(1 row)
+
+select distinct max(unique2) from tenk1;
+ max
+------
+ 9999
+(1 row)
+
+select max(unique2) from tenk1 order by 1;
+ max
+------
+ 9999
+(1 row)
+
+select max(unique2) from tenk1 order by max(unique2);
+ max
+------
+ 9999
+(1 row)
+
+select max(unique2) from tenk1 order by max(unique2)+1;
+ max
+------
+ 9999
+(1 row)
+
+select max(100) from tenk1;
+ max
+-----
+ 100
+(1 row)
+
+-- try it on an inheritance tree
+create table minmaxtest(f1 int);
+create index minmaxtesti on minmaxtest(f1);
+create index minmaxtest1i on minmaxtest1(f1);
+create index minmaxtest2i on minmaxtest2(f1 desc);
+insert into minmaxtest values(11), (12);
+--
+-- Test removal of redundant GROUP BY columns
+--
+create temp table t1 (a int, b int, c int, d int, primary key (a, b));
+create temp table t2 (x int, y int, z int, primary key (x, y));
+drop table t2;
+--
+-- Test GROUP BY matching of join columns that are type-coerced due to USING
+--
+create temp table t1(f1 int, f2 bigint);
+create temp table t2(f1 bigint, f22 bigint);
+drop table t1, t2;
+select array_agg(distinct a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+ array_agg
+--------------
+ {1,2,3,NULL}
+(1 row)
+
+-- string_agg tests
+select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
+ string_agg
+----------------
+ aaaa,bbbb,cccc
+(1 row)
+
+select string_agg(a,',') from (values('aaaa'),(null),('bbbb'),('cccc')) g(a);
+ string_agg
+----------------
+ aaaa,bbbb,cccc
+(1 row)
+
+select string_agg(a,'AB') from (values(null),(null),('bbbb'),('cccc')) g(a);
+ string_agg
+------------
+ bbbbABcccc
+(1 row)
+
+select string_agg(a,',') from (values(null),(null)) g(a);
+ string_agg
+------------
+
+(1 row)
+
+-- string_agg bytea tests
+create table bytea_test_table(v bytea);
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+
+(1 row)
+
+insert into bytea_test_table values(decode('ff','hex'));
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+ \xff
+(1 row)
+
+insert into bytea_test_table values(decode('aa','hex'));
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+ \xffaa
+(1 row)
+
+select string_agg(v, NULL) from bytea_test_table;
+ string_agg
+------------
+ \xffaa
+(1 row)
+
+select string_agg(v, decode('ee', 'hex')) from bytea_test_table;
+ string_agg
+------------
+ \xffeeaa
+(1 row)
+
+drop table bytea_test_table;
+-- outer reference in FILTER (PostgreSQL extension)
+select (select count(*)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+ count
+-------
+ 1
+ 1
+(2 rows)
+
+select p, percentile_cont(p order by p) within group (order by x) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+ERROR: cannot use multiple ORDER BY clauses with WITHIN GROUP
+LINE 1: select p, percentile_cont(p order by p) within group (order ...
+ ^
+-- test aggregates with common transition functions share the same states
+begin work;
diff --git a/yql/essentials/tests/postgresql/cases/aggregates.sql b/yql/essentials/tests/postgresql/cases/aggregates.sql
new file mode 100644
index 0000000000..64412fd03c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/aggregates.sql
@@ -0,0 +1,196 @@
+--
+-- AGGREGATES
+--
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+SELECT avg(four) AS avg_1 FROM onek;
+SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
+-- In 7.1, avg(float4) is computed using float8 arithmetic.
+-- Round the result to 3 digits to avoid platform-specific results.
+SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
+SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
+SELECT sum(four) AS sum_1500 FROM onek;
+SELECT sum(a) AS sum_198 FROM aggtest;
+SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
+SELECT max(four) AS max_3 FROM onek;
+SELECT max(a) AS max_100 FROM aggtest;
+SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
+SELECT max(student.gpa) AS max_3_7 FROM student;
+SELECT stddev_pop(b) FROM aggtest;
+SELECT stddev_samp(b) FROM aggtest;
+SELECT var_pop(b) FROM aggtest;
+SELECT var_samp(b) FROM aggtest;
+SELECT stddev_pop(b::numeric) FROM aggtest;
+SELECT stddev_samp(b::numeric) FROM aggtest;
+SELECT var_pop(b::numeric) FROM aggtest;
+SELECT var_samp(b::numeric) FROM aggtest;
+-- population variance is defined for a single tuple, sample variance
+-- is not
+SELECT var_pop(1.0::float8), var_samp(2.0::float8);
+SELECT stddev_pop(3.0::float8), stddev_samp(4.0::float8);
+SELECT var_pop('inf'::float8), var_samp('inf'::float8);
+SELECT stddev_pop('inf'::float8), stddev_samp('inf'::float8);
+SELECT var_pop('nan'::float8), var_samp('nan'::float8);
+SELECT stddev_pop('nan'::float8), stddev_samp('nan'::float8);
+SELECT var_pop(1.0::float4), var_samp(2.0::float4);
+SELECT stddev_pop(3.0::float4), stddev_samp(4.0::float4);
+SELECT var_pop('inf'::float4), var_samp('inf'::float4);
+SELECT stddev_pop('inf'::float4), stddev_samp('inf'::float4);
+SELECT var_pop('nan'::float4), var_samp('nan'::float4);
+SELECT stddev_pop('nan'::float4), stddev_samp('nan'::float4);
+SELECT var_pop('inf'::numeric), var_samp('inf'::numeric);
+SELECT stddev_pop('inf'::numeric), stddev_samp('inf'::numeric);
+SELECT var_pop('nan'::numeric), var_samp('nan'::numeric);
+SELECT stddev_pop('nan'::numeric), stddev_samp('nan'::numeric);
+-- verify correct results for null and NaN inputs
+select sum(null::int4) from generate_series(1,3);
+select sum(null::int8) from generate_series(1,3);
+select sum(null::numeric) from generate_series(1,3);
+select sum(null::float8) from generate_series(1,3);
+select avg(null::int4) from generate_series(1,3);
+select avg(null::int8) from generate_series(1,3);
+select avg(null::numeric) from generate_series(1,3);
+select avg(null::float8) from generate_series(1,3);
+select sum('NaN'::numeric) from generate_series(1,3);
+select avg('NaN'::numeric) from generate_series(1,3);
+-- verify correct results for infinite inputs
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('1'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('1')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('1'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('1')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+-- test accuracy with a large input offset
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x);
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (7000000000005), (7000000000007)) v(x);
+-- SQL2003 binary aggregates
+SELECT regr_count(b, a) FROM aggtest;
+SELECT regr_sxx(b, a) FROM aggtest;
+SELECT regr_syy(b, a) FROM aggtest;
+SELECT regr_sxy(b, a) FROM aggtest;
+SELECT regr_avgx(b, a), regr_avgy(b, a) FROM aggtest;
+SELECT regr_r2(b, a) FROM aggtest;
+SELECT regr_slope(b, a), regr_intercept(b, a) FROM aggtest;
+SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest;
+SELECT corr(b, a) FROM aggtest;
+-- check single-tuple behavior
+SELECT covar_pop(1::float8,2::float8), covar_samp(3::float8,4::float8);
+SELECT covar_pop(1::float8,'inf'::float8), covar_samp(3::float8,'inf'::float8);
+SELECT covar_pop(1::float8,'nan'::float8), covar_samp(3::float8,'nan'::float8);
+-- test accum and combine functions directly
+CREATE TABLE regr_test (x float8, y float8);
+INSERT INTO regr_test VALUES (10,150),(20,250),(30,350),(80,540),(100,200);
+SELECT float8_accum('{4,140,2900}'::float8[], 100);
+SELECT float8_regr_accum('{4,140,2900,1290,83075,15050}'::float8[], 200, 100);
+SELECT float8_combine('{3,60,200}'::float8[], '{0,0,0}'::float8[]);
+SELECT float8_combine('{0,0,0}'::float8[], '{2,180,200}'::float8[]);
+SELECT float8_combine('{3,60,200}'::float8[], '{2,180,200}'::float8[]);
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{0,0,0,0,0,0}'::float8[]);
+SELECT float8_regr_combine('{0,0,0,0,0,0}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+DROP TABLE regr_test;
+-- test count, distinct
+SELECT count(four) AS cnt_1000 FROM onek;
+SELECT count(DISTINCT four) AS cnt_4 FROM onek;
+select ten, count(*), sum(four) from onek
+group by ten order by ten;
+select ten, count(four), sum(DISTINCT four) from onek
+group by ten order by ten;
+--
+-- test for bitwise integer aggregates
+--
+CREATE TEMPORARY TABLE bitwise_test(
+ i2 INT2,
+ i4 INT4,
+ i8 INT8,
+ i INTEGER,
+ x INT2,
+ y BIT(4)
+);
+CREATE TEMPORARY TABLE bool_test(
+ b1 BOOL,
+ b2 BOOL,
+ b3 BOOL,
+ b4 BOOL);
+select min(unique1) from tenk1;
+select max(unique1) from tenk1;
+select max(unique1) from tenk1 where unique1 < 42;
+select max(unique1) from tenk1 where unique1 > 42;
+-- the planner may choose a generic aggregate here if parallel query is
+-- enabled, since that plan will be parallel safe and the "optimized"
+-- plan, which has almost identical cost, will not be. we want to test
+-- the optimized plan, so temporarily disable parallel query.
+begin;
+select max(unique1) from tenk1 where unique1 > 42000;
+rollback;
+select max(tenthous) from tenk1 where thousand = 33;
+select min(tenthous) from tenk1 where thousand = 33;
+select distinct max(unique2) from tenk1;
+select max(unique2) from tenk1 order by 1;
+select max(unique2) from tenk1 order by max(unique2);
+select max(unique2) from tenk1 order by max(unique2)+1;
+select max(100) from tenk1;
+-- try it on an inheritance tree
+create table minmaxtest(f1 int);
+create index minmaxtesti on minmaxtest(f1);
+create index minmaxtest1i on minmaxtest1(f1);
+create index minmaxtest2i on minmaxtest2(f1 desc);
+insert into minmaxtest values(11), (12);
+--
+-- Test removal of redundant GROUP BY columns
+--
+create temp table t1 (a int, b int, c int, d int, primary key (a, b));
+create temp table t2 (x int, y int, z int, primary key (x, y));
+drop table t2;
+--
+-- Test GROUP BY matching of join columns that are type-coerced due to USING
+--
+create temp table t1(f1 int, f2 bigint);
+create temp table t2(f1 bigint, f22 bigint);
+drop table t1, t2;
+select array_agg(distinct a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+-- string_agg tests
+select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
+select string_agg(a,',') from (values('aaaa'),(null),('bbbb'),('cccc')) g(a);
+select string_agg(a,'AB') from (values(null),(null),('bbbb'),('cccc')) g(a);
+select string_agg(a,',') from (values(null),(null)) g(a);
+-- string_agg bytea tests
+create table bytea_test_table(v bytea);
+select string_agg(v, '') from bytea_test_table;
+insert into bytea_test_table values(decode('ff','hex'));
+select string_agg(v, '') from bytea_test_table;
+insert into bytea_test_table values(decode('aa','hex'));
+select string_agg(v, '') from bytea_test_table;
+select string_agg(v, NULL) from bytea_test_table;
+select string_agg(v, decode('ee', 'hex')) from bytea_test_table;
+drop table bytea_test_table;
+-- outer reference in FILTER (PostgreSQL extension)
+select (select count(*)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+select p, percentile_cont(p order by p) within group (order by x) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+-- test aggregates with common transition functions share the same states
+begin work;
diff --git a/yql/essentials/tests/postgresql/cases/alter_table.err b/yql/essentials/tests/postgresql/cases/alter_table.err
new file mode 100644
index 0000000000..d12f5ce662
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/alter_table.err
@@ -0,0 +1,3455 @@
+Registering pre-existing tables
+ onek
+ tenk1
+ stud_emp
+<sql-statement>
+--
+-- ALTER_TABLE
+--
+-- Clean up in case a prior regression run failed
+SET client_min_messages TO 'warning';
+</sql-statement>
+<sql-statement>
+DROP ROLE IF EXISTS regress_alter_table_user1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
+ DROP ROLE IF EXISTS regress_alter_table_user1;
+ ^
+<sql-statement>
+RESET client_min_messages;
+</sql-statement>
+<sql-statement>
+CREATE USER regress_alter_table_user1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
+ CREATE USER regress_alter_table_user1;
+ ^
+<sql-statement>
+--
+-- add attribute
+--
+CREATE TABLE attmp (initial int4);
+</sql-statement>
+<sql-statement>
+COMMENT ON TABLE attmp_wrong IS 'table comment';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
+ COMMENT ON TABLE attmp_wrong IS 'table comment';
+ ^
+<sql-statement>
+COMMENT ON TABLE attmp IS 'table comment';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
+ COMMENT ON TABLE attmp IS 'table comment';
+ ^
+<sql-statement>
+COMMENT ON TABLE attmp IS NULL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
+ COMMENT ON TABLE attmp IS NULL;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN a int4 default 3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN a int4 default 3;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN b name;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN b name;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN c text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN c text;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN d float8;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN d float8;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN e float4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN e float4;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN f int2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN f int2;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN g polygon;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN g polygon;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN i char;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN i char;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN k int4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN k int4;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN l tid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN l tid;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN m xid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN m xid;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN n oidvector;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN n oidvector;
+ ^
+<sql-statement>
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ --ALTER TABLE attmp ADD COLUMN o lock;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN q point;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN q point;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN r lseg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN r lseg;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN s path;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN s path;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN t box;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN t box;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN v timestamp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN v timestamp;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN w interval;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN w interval;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN x float8[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN x float8[];
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN y float4[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN y float4[];
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN z int2[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN z int2[];
+ ^
+<sql-statement>
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+</sql-statement>
+<sql-statement>
+SELECT * FROM attmp;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp;
+</sql-statement>
+<sql-statement>
+-- the wolf bug - schema mods caused inconsistent row descriptors
+CREATE TABLE attmp (
+ initial int4
+);
+</sql-statement>
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN a int4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN a int4;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN b name;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN b name;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN c text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN c text;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN d float8;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN d float8;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN e float4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN e float4;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN f int2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN f int2;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN g polygon;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN g polygon;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN i char;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN i char;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN k int4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN k int4;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN l tid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN l tid;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN m xid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN m xid;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN n oidvector;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN n oidvector;
+ ^
+<sql-statement>
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ --ALTER TABLE attmp ADD COLUMN o lock;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN q point;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN q point;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN r lseg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN r lseg;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN s path;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN s path;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN t box;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN t box;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN v timestamp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN v timestamp;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN w interval;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN w interval;
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN x float8[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN x float8[];
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN y float4[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN y float4[];
+ ^
+<sql-statement>
+ALTER TABLE attmp ADD COLUMN z int2[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp ADD COLUMN z int2[];
+ ^
+<sql-statement>
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+</sql-statement>
+<sql-statement>
+SELECT * FROM attmp;
+</sql-statement>
+<sql-statement>
+CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
+ ^
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:37: Error: ERROR: column number must be in range from 1 to 32767
+
+ ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+ ^
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
+ ^
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
+ ^
+<sql-statement>
+\d+ attmp_idx
+</sql-statement>
+Metacommand \d+ attmp_idx is not supported
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
+ ^
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
+ ^
+<sql-statement>
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
+ ^
+<sql-statement>
+DROP TABLE attmp;
+</sql-statement>
+<sql-statement>
+-- fails with incorrect object type
+CREATE VIEW at_v1 AS SELECT 1 as a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- fails with incorrect object type
+ ^
+<sql-statement>
+ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
+ ^
+<sql-statement>
+DROP VIEW at_v1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'at_v1'
+ DROP VIEW at_v1;
+ ^
+<sql-statement>
+--
+-- rename - check on both non-temp and temp tables
+--
+CREATE TABLE attmp (regtable int);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE attmp (attmptable int);
+</sql-statement>
+<sql-statement>
+ALTER TABLE attmp RENAME TO attmp_new;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE attmp RENAME TO attmp_new;
+ ^
+<sql-statement>
+SELECT * FROM attmp;
+</sql-statement>
+<sql-statement>
+SELECT * FROM attmp_new;
+</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.attmp_new
+
+<sql-statement>
+ALTER TABLE attmp RENAME TO attmp_new2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE attmp RENAME TO attmp_new2;
+ ^
+<sql-statement>
+SELECT * FROM attmp; -- should fail
+</sql-statement>
+<sql-statement>
+SELECT * FROM attmp_new;
+</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.attmp_new
+
+<sql-statement>
+SELECT * FROM attmp_new2;
+</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.attmp_new2
+
+<sql-statement>
+DROP TABLE attmp_new;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp_new2;
+</sql-statement>
+<sql-statement>
+-- check rename of partitioned tables and indexes also
+CREATE TABLE part_attmp (a int primary key) partition by range (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check rename of partitioned tables and indexes also
+ ^
+<sql-statement>
+CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
+ ^
+<sql-statement>
+ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
+ ^
+<sql-statement>
+ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
+ ^
+<sql-statement>
+ALTER TABLE part_attmp RENAME TO part_at2tmp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE part_attmp RENAME TO part_at2tmp;
+ ^
+<sql-statement>
+ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
+ ^
+<sql-statement>
+SET ROLE regress_alter_table_user1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ SET ROLE regress_alter_table_user1;
+ ^
+<sql-statement>
+ALTER INDEX part_attmp_index RENAME TO fail;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX part_attmp_index RENAME TO fail;
+ ^
+<sql-statement>
+ALTER INDEX part_attmp1_index RENAME TO fail;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX part_attmp1_index RENAME TO fail;
+ ^
+<sql-statement>
+ALTER TABLE part_at2tmp RENAME TO fail;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE part_at2tmp RENAME TO fail;
+ ^
+<sql-statement>
+ALTER TABLE part_at2tmp1 RENAME TO fail;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE part_at2tmp1 RENAME TO fail;
+ ^
+<sql-statement>
+RESET ROLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET ROLE;
+ ^
+<sql-statement>
+DROP TABLE part_at2tmp;
+</sql-statement>
+<sql-statement>
+--
+-- check renaming to a table's array type's autogenerated name
+-- (the array type's name should get out of the way)
+--
+CREATE TABLE attmp_array (id int);
+</sql-statement>
+<sql-statement>
+CREATE TABLE attmp_array2 (id int);
+</sql-statement>
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array2[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
+ ^
+<sql-statement>
+ALTER TABLE attmp_array2 RENAME TO _attmp_array;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE attmp_array2 RENAME TO _attmp_array;
+ ^
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "_attmp_array[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ ^
+<sql-statement>
+DROP TABLE _attmp_array;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp_array;
+</sql-statement>
+<sql-statement>
+-- renaming to table's own array type's name is an interesting corner case
+CREATE TABLE attmp_array (id int);
+</sql-statement>
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "attmp_array[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ ^
+<sql-statement>
+ALTER TABLE attmp_array RENAME TO _attmp_array;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE attmp_array RENAME TO _attmp_array;
+ ^
+<sql-statement>
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: type "_attmp_array[]" does not exist
+
+ SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ ^
+<sql-statement>
+DROP TABLE _attmp_array;
+</sql-statement>
+<sql-statement>
+-- ALTER TABLE ... RENAME on non-table relations
+-- renaming indexes (FIXME: this should probably test the index's functionality)
+ALTER INDEX IF EXISTS __onek_unique1 RENAME TO attmp_onek_unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ -- ALTER TABLE ... RENAME on non-table relations
+ ^
+<sql-statement>
+ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
+ ^
+<sql-statement>
+ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
+ ^
+<sql-statement>
+ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
+ ^
+<sql-statement>
+SET ROLE regress_alter_table_user1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ SET ROLE regress_alter_table_user1;
+ ^
+<sql-statement>
+ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
+ ^
+<sql-statement>
+RESET ROLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET ROLE;
+ ^
+<sql-statement>
+-- rename statements with mismatching statement and object types
+CREATE TABLE alter_idx_rename_test (a INT);
+</sql-statement>
+<sql-statement>
+CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
+</sql-statement>
+<sql-statement>
+CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
+ ^
+<sql-statement>
+CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
+ ^
+<sql-statement>
+ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
+ ^
+<sql-statement>
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
+ SELECT relation::regclass, mode FROM pg_locks
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
+ ^
+<sql-statement>
+ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
+ ^
+<sql-statement>
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
+ SELECT relation::regclass, mode FROM pg_locks
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
+ ^
+<sql-statement>
+ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
+ ^
+<sql-statement>
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 365
+ SELECT relation::regclass, mode FROM pg_locks
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+DROP TABLE alter_idx_rename_test_2;
+</sql-statement>
+<sql-statement>
+-- renaming views
+CREATE VIEW attmp_view (unique1) AS SELECT unique1 FROM tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>: Error: Not all views have been dropped
+
+<sql-statement>
+ALTER TABLE attmp_view RENAME TO attmp_view_new;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE attmp_view RENAME TO attmp_view_new;
+ ^
+<sql-statement>
+SET ROLE regress_alter_table_user1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ SET ROLE regress_alter_table_user1;
+ ^
+<sql-statement>
+ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
+ ^
+<sql-statement>
+RESET ROLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET ROLE;
+ ^
+<sql-statement>
+-- hack to ensure we get an indexscan here
+set enable_seqscan to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ -- hack to ensure we get an indexscan here
+ ^
+<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>
+-- 5 values, sorted
+SELECT unique1 FROM tenk1 WHERE unique1 < 5;
+</sql-statement>
+<sql-statement>
+reset enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_seqscan;
+ ^
+<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>
+DROP VIEW attmp_view_new;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'attmp_view_new'
+ DROP VIEW attmp_view_new;
+ ^
+<sql-statement>
+-- toast-like relation name
+alter table stud_emp rename to pg_toast_stud_emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ -- toast-like relation name
+ ^
+<sql-statement>
+alter table pg_toast_stud_emp rename to stud_emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ alter table pg_toast_stud_emp rename to stud_emp;
+ ^
+<sql-statement>
+-- renaming index should rename constraint as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- renaming index should rename constraint as well
+ ^
+<sql-statement>
+ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
+ ^
+<sql-statement>
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+ ^
+<sql-statement>
+-- renaming constraint
+ALTER TABLE onek ADD CONSTRAINT onek_check_constraint CHECK (unique1 >= 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- renaming constraint
+ ^
+<sql-statement>
+ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
+ ^
+<sql-statement>
+ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
+ ^
+<sql-statement>
+-- renaming constraint should rename index as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- renaming constraint should rename index as well
+ ^
+<sql-statement>
+DROP INDEX onek_unique1_constraint; -- to see whether it's there
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX onek_unique1_constraint; -- to see whether it's there
+ ^
+<sql-statement>
+ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
+ ^
+<sql-statement>
+DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
+ ^
+<sql-statement>
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+ ^
+<sql-statement>
+-- renaming constraints vs. inheritance
+CREATE TABLE constraint_rename_test (a int CONSTRAINT con1 CHECK (a > 0), b int, c int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ -- renaming constraints vs. inheritance
+ ^
+<sql-statement>
+\d constraint_rename_test
+</sql-statement>
+Metacommand \d constraint_rename_test is not supported
+<sql-statement>
+CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
+ ^
+<sql-statement>
+\d constraint_rename_test2
+</sql-statement>
+Metacommand \d constraint_rename_test2 is not supported
+<sql-statement>
+ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
+ ^
+<sql-statement>
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
+ ^
+<sql-statement>
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
+ ^
+<sql-statement>
+\d constraint_rename_test
+</sql-statement>
+Metacommand \d constraint_rename_test is not supported
+<sql-statement>
+\d constraint_rename_test2
+</sql-statement>
+Metacommand \d constraint_rename_test2 is not supported
+<sql-statement>
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
+ ^
+<sql-statement>
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
+ ^
+<sql-statement>
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
+ ^
+<sql-statement>
+\d constraint_rename_test
+</sql-statement>
+Metacommand \d constraint_rename_test is not supported
+<sql-statement>
+\d constraint_rename_test2
+</sql-statement>
+Metacommand \d constraint_rename_test2 is not supported
+<sql-statement>
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
+ ^
+<sql-statement>
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
+ ^
+<sql-statement>
+\d constraint_rename_test
+</sql-statement>
+Metacommand \d constraint_rename_test is not supported
+<sql-statement>
+\d constraint_rename_test2
+</sql-statement>
+Metacommand \d constraint_rename_test2 is not supported
+<sql-statement>
+DROP TABLE constraint_rename_test2;
+</sql-statement>
+<sql-statement>
+DROP TABLE constraint_rename_test;
+</sql-statement>
+<sql-statement>
+ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
+ ^
+<sql-statement>
+ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
+ ^
+<sql-statement>
+-- renaming constraints with cache reset of target relation
+CREATE TABLE constraint_rename_cache (a int,
+ CONSTRAINT chk_a CHECK (a > 0),
+ PRIMARY KEY (a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table constraint not supported
+ -- renaming constraints with cache reset of target relation
+ ^
+<sql-statement>
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT chk_a TO chk_a_new;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_cache
+ ^
+<sql-statement>
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT constraint_rename_cache_pkey TO constraint_rename_pkey_new;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ ALTER TABLE constraint_rename_cache
+ ^
+<sql-statement>
+CREATE TABLE like_constraint_rename_cache
+ (LIKE constraint_rename_cache INCLUDING ALL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CreateStmt: alternative is not implemented yet : 389
+ CREATE TABLE like_constraint_rename_cache
+ ^
+<sql-statement>
+\d like_constraint_rename_cache
+</sql-statement>
+Metacommand \d like_constraint_rename_cache is not supported
+<sql-statement>
+DROP TABLE constraint_rename_cache;
+</sql-statement>
+<sql-statement>
+DROP TABLE like_constraint_rename_cache;
+</sql-statement>
+<sql-statement>
+-- FOREIGN KEY CONSTRAINT adding TEST
+CREATE TABLE attmp2 (a int primary key);
+</sql-statement>
+<sql-statement>
+CREATE TABLE attmp3 (a int, b int);
+</sql-statement>
+<sql-statement>
+CREATE TABLE attmp4 (a int, b int, unique(a,b));
+</sql-statement>
+<sql-statement>
+CREATE TABLE attmp5 (a int, b int);
+</sql-statement>
+<sql-statement>
+-- Insert rows into attmp2 (pktable)
+INSERT INTO attmp2 values (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO attmp2 values (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO attmp2 values (3);
+</sql-statement>
+<sql-statement>
+INSERT INTO attmp2 values (4);
+</sql-statement>
+<sql-statement>
+-- Insert rows into attmp3
+INSERT INTO attmp3 values (1,10);
+</sql-statement>
+<sql-statement>
+INSERT INTO attmp3 values (1,20);
+</sql-statement>
+<sql-statement>
+INSERT INTO attmp3 values (5,50);
+</sql-statement>
+<sql-statement>
+-- Try (and fail) to add constraint due to invalid source columns
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(c) references attmp2 match full;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and fail) to add constraint due to invalid source columns
+ ^
+<sql-statement>
+-- Try (and fail) to add constraint due to invalid destination columns explicitly given
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(a) references attmp2(b) match full;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and fail) to add constraint due to invalid destination columns explicitly given
+ ^
+<sql-statement>
+-- Try (and fail) to add constraint due to invalid data
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and fail) to add constraint due to invalid data
+ ^
+<sql-statement>
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+</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>
+-- Try (and succeed)
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and succeed)
+ ^
+<sql-statement>
+ALTER TABLE attmp3 drop constraint attmpconstr;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 drop constraint attmpconstr;
+ ^
+<sql-statement>
+INSERT INTO attmp3 values (5,50);
+</sql-statement>
+<sql-statement>
+-- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full NOT VALID;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
+ ^
+<sql-statement>
+ALTER TABLE attmp3 validate constraint attmpconstr;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 validate constraint attmpconstr;
+ ^
+<sql-statement>
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+</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>
+-- Try (and succeed) and repeat to show it works on already valid constraint
+ALTER TABLE attmp3 validate constraint attmpconstr;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and succeed) and repeat to show it works on already valid constraint
+ ^
+<sql-statement>
+ALTER TABLE attmp3 validate constraint attmpconstr;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 validate constraint attmpconstr;
+ ^
+<sql-statement>
+-- Try a non-verified CHECK constraint
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10); -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try a non-verified CHECK constraint
+ ^
+<sql-statement>
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
+ ^
+<sql-statement>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
+ ^
+<sql-statement>
+DELETE FROM attmp3 WHERE NOT b > 10;
+</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>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+ ^
+<sql-statement>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+ ^
+<sql-statement>
+-- Test inherited NOT VALID CHECK constraints
+select * from attmp3;
+</sql-statement>
+<sql-statement>
+CREATE TABLE attmp6 () INHERITS (attmp3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE attmp6 () INHERITS (attmp3);
+ ^
+<sql-statement>
+CREATE TABLE attmp7 () INHERITS (attmp3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE attmp7 () INHERITS (attmp3);
+ ^
+<sql-statement>
+INSERT INTO attmp6 VALUES (6, 30), (7, 16);
+</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.attmp6
+
+<sql-statement>
+ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
+ ^
+<sql-statement>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
+ ^
+<sql-statement>
+DELETE FROM attmp6 WHERE b > 20;
+</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>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
+ ^
+<sql-statement>
+-- An already validated constraint must not be revalidated
+CREATE FUNCTION boo(int) RETURNS int IMMUTABLE STRICT LANGUAGE plpgsql AS $$ BEGIN RAISE NOTICE 'boo: %', $1; RETURN $1; END; $$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- An already validated constraint must not be revalidated
+ ^
+<sql-statement>
+INSERT INTO attmp7 VALUES (8, 18);
+</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.attmp7
+
+<sql-statement>
+ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
+ ^
+<sql-statement>
+ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
+ ^
+<sql-statement>
+ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
+ ^
+<sql-statement>
+-- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
+create table parent_noinh_convalid (a int);
+</sql-statement>
+<sql-statement>
+create table child_noinh_convalid () inherits (parent_noinh_convalid);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table child_noinh_convalid () inherits (parent_noinh_convalid);
+ ^
+<sql-statement>
+insert into parent_noinh_convalid values (1);
+</sql-statement>
+<sql-statement>
+insert into child_noinh_convalid values (1);
+</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.child_noinh_convalid
+
+<sql-statement>
+alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
+ ^
+<sql-statement>
+-- fail, because of the row in parent
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail, because of the row in parent
+ ^
+<sql-statement>
+delete from only parent_noinh_convalid;
+</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>
+-- ok (parent itself contains no violating rows)
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- ok (parent itself contains no violating rows)
+ ^
+<sql-statement>
+select convalidated from pg_constraint where conrelid = 'parent_noinh_convalid'::regclass and conname = 'check_a_is_2';
+</sql-statement>
+<sql-statement>
+-- cleanup
+drop table parent_noinh_convalid, child_noinh_convalid;
+</sql-statement>
+<sql-statement>
+-- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
+-- attmp4 is a,b
+ALTER TABLE attmp5 add constraint attmpconstr foreign key(a) references attmp4(a) match full;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
+ ^
+<sql-statement>
+DROP TABLE attmp7;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp6;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp5;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp4;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp3;
+</sql-statement>
+<sql-statement>
+DROP TABLE attmp2;
+</sql-statement>
+<sql-statement>
+-- NOT VALID with plan invalidation -- ensure we don't use a constraint for
+-- exclusion until validated
+set constraint_exclusion TO 'partition';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: constraint_exclusion
+ -- NOT VALID with plan invalidation -- ensure we don't use a constraint for
+ ^
+<sql-statement>
+create table nv_parent (d date, check (false) no inherit not valid);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table constraint not supported
+ create table nv_parent (d date, check (false) no inherit not valid);
+ ^
+<sql-statement>
+-- not valid constraint added at creation time should automatically become valid
+\d nv_parent
+</sql-statement>
+Metacommand \d nv_parent is not supported
+<sql-statement>
+create table nv_child_2010 () inherits (nv_parent);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table nv_child_2010 () inherits (nv_parent);
+ ^
+<sql-statement>
+create table nv_child_2011 () inherits (nv_parent);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table nv_child_2011 () inherits (nv_parent);
+ ^
+<sql-statement>
+alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
+ ^
+<sql-statement>
+alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
+ ^
+<sql-statement>
+explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
+ ^
+<sql-statement>
+create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
+ ^
+<sql-statement>
+explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
+ ^
+<sql-statement>
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+ ^
+<sql-statement>
+-- after validation, the constraint should be used
+alter table nv_child_2011 VALIDATE CONSTRAINT nv_child_2011_d_check;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- after validation, the constraint should be used
+ ^
+<sql-statement>
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+ ^
+<sql-statement>
+-- add an inherited NOT VALID constraint
+alter table nv_parent add check (d between '2001-01-01'::date and '2099-12-31'::date) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add an inherited NOT VALID constraint
+ ^
+<sql-statement>
+\d nv_child_2009
+</sql-statement>
+Metacommand \d nv_child_2009 is not supported
+<sql-statement>
+-- we leave nv_parent and children around to help test pg_dump logic
+-- Foreign key adding test with mixed types
+-- Note: these tables are TEMP to avoid name conflicts when this test
+-- is run in parallel with foreign_key.sql.
+CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+INSERT INTO PKTABLE VALUES(42);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE FKTABLE (ftest1 inet);
+</sql-statement>
+<sql-statement>
+-- This next should fail, because int=inet does not exist
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- This next should fail, because int=inet does not exist
+ ^
+<sql-statement>
+-- This should also fail for the same reason, but here we
+-- give the column name
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- This should also fail for the same reason, but here we
+ ^
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+-- This should succeed, even though they are different types,
+-- because int=int8 exists and is a member of the integer opfamily
+CREATE TEMP TABLE FKTABLE (ftest1 int8);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+ ^
+<sql-statement>
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+</sql-statement>
+<sql-statement>
+INSERT INTO FKTABLE VALUES(43); -- should fail
+</sql-statement>
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+-- This should fail, because we'd have to cast numeric to int which is
+-- not an implicit coercion (or use numeric=numeric, but that's not part
+-- of the integer opfamily)
+CREATE TEMP TABLE FKTABLE (ftest1 numeric);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+ ^
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+DROP TABLE PKTABLE;
+</sql-statement>
+<sql-statement>
+-- On the other hand, this should work because int implicitly promotes to
+-- numeric, and we allow promotion on the FK side
+CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+INSERT INTO PKTABLE VALUES(42);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+ ^
+<sql-statement>
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+</sql-statement>
+<sql-statement>
+INSERT INTO FKTABLE VALUES(43); -- should fail
+</sql-statement>
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+DROP TABLE PKTABLE;
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
+ PRIMARY KEY(ptest1, ptest2));
+</sql-statement>
+<sql-statement>
+-- This should fail, because we just chose really odd types
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
+ ^
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+-- Again, so should this...
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest1, ptest2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ ^
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+-- This fails because we mixed up the column ordering
+CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest2, ptest1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ ^
+<sql-statement>
+-- As does this...
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
+ references pktable(ptest1, ptest2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- As does this...
+ ^
+<sql-statement>
+DROP TABLE FKTABLE;
+</sql-statement>
+<sql-statement>
+DROP TABLE PKTABLE;
+</sql-statement>
+<sql-statement>
+-- Test that ALTER CONSTRAINT updates trigger deferrability properly
+CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+</sql-statement>
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ^
+<sql-statement>
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
+ ^
+<sql-statement>
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'pktable'::regclass
+ORDER BY 1,2,3;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: Sort
+ SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+ ^
+ -stdin-:<main>:1:1: Error: Expected comparable type, but got: Tuple<pgname,pgregproc,pgint2>
+ SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+ ^
+<sql-statement>
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'fktable'::regclass
+ORDER BY 1,2,3;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: Sort
+ SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+ ^
+ -stdin-:<main>:1:1: Error: Expected comparable type, but got: Tuple<pgname,pgregproc,pgint2>
+ SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+ ^
+<sql-statement>
+-- temp tables should go away by themselves, need not drop them.
+-- test check constraint adding
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- add a check constraint
+alter table atacc1 add constraint atacc_test1 check (test>3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a check constraint
+ ^
+<sql-statement>
+-- should fail
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- should succeed
+insert into atacc1 (test) values (4);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the check fails when added
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- insert a soon to be failing row
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test>3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a check constraint (fails)
+ ^
+<sql-statement>
+insert into atacc1 (test) values (4);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the check fails because the column doesn't exist
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test1>3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a check constraint (fails)
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- something a little more complicated
+create table atacc1 ( test int, test2 int, test3 int);
+</sql-statement>
+<sql-statement>
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a check constraint (fails)
+ ^
+<sql-statement>
+-- should fail
+insert into atacc1 (test,test2,test3) values (4,4,2);
+</sql-statement>
+<sql-statement>
+-- should succeed
+insert into atacc1 (test,test2,test3) values (4,4,5);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- lets do some naming tests
+create table atacc1 (test int check (test>3), test2 int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ -- lets do some naming tests
+ ^
+<sql-statement>
+alter table atacc1 add check (test2>test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add check (test2>test);
+ ^
+<sql-statement>
+-- should fail for $2
+insert into atacc1 (test2, test) values (3, 4);
+</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.atacc1
+
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- inheritance related tests
+create table atacc1 (test int);
+</sql-statement>
+<sql-statement>
+create table atacc2 (test2 int);
+</sql-statement>
+<sql-statement>
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table atacc3 (test3 int) inherits (atacc1, atacc2);
+ ^
+<sql-statement>
+alter table atacc2 add constraint foo check (test2>0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc2 add constraint foo check (test2>0);
+ ^
+<sql-statement>
+-- fail and then succeed on atacc2
+insert into atacc2 (test2) values (-3);
+</sql-statement>
+<sql-statement>
+insert into atacc2 (test2) values (3);
+</sql-statement>
+<sql-statement>
+-- fail and then succeed on atacc3
+insert into atacc3 (test2) values (-3);
+</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.atacc3
+
+<sql-statement>
+insert into atacc3 (test2) values (3);
+</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.atacc3
+
+<sql-statement>
+drop table atacc3;
+</sql-statement>
+<sql-statement>
+drop table atacc2;
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- same things with one created with INHERIT
+create table atacc1 (test int);
+</sql-statement>
+<sql-statement>
+create table atacc2 (test2 int);
+</sql-statement>
+<sql-statement>
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table atacc3 (test3 int) inherits (atacc1, atacc2);
+ ^
+<sql-statement>
+alter table atacc3 no inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 no inherit atacc2;
+ ^
+<sql-statement>
+-- fail
+alter table atacc3 no inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail
+ ^
+<sql-statement>
+-- make sure it really isn't a child
+insert into atacc3 (test2) values (3);
+</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.atacc3
+
+<sql-statement>
+select test2 from atacc2;
+</sql-statement>
+<sql-statement>
+-- fail due to missing constraint
+alter table atacc2 add constraint foo check (test2>0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail due to missing constraint
+ ^
+<sql-statement>
+alter table atacc3 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 inherit atacc2;
+ ^
+<sql-statement>
+-- fail due to missing column
+alter table atacc3 rename test2 to testx;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 264
+ -- fail due to missing column
+ ^
+<sql-statement>
+alter table atacc3 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 inherit atacc2;
+ ^
+<sql-statement>
+-- fail due to mismatched data type
+alter table atacc3 add test2 bool;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail due to mismatched data type
+ ^
+<sql-statement>
+alter table atacc3 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 inherit atacc2;
+ ^
+<sql-statement>
+alter table atacc3 drop test2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 drop test2;
+ ^
+<sql-statement>
+-- succeed
+alter table atacc3 add test2 int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- succeed
+ ^
+<sql-statement>
+update atacc3 set test2 = 4 where test2 is 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>
+alter table atacc3 add constraint foo check (test2>0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 add constraint foo check (test2>0);
+ ^
+<sql-statement>
+alter table atacc3 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc3 inherit atacc2;
+ ^
+<sql-statement>
+-- fail due to duplicates and circular inheritance
+alter table atacc3 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail due to duplicates and circular inheritance
+ ^
+<sql-statement>
+alter table atacc2 inherit atacc3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc2 inherit atacc3;
+ ^
+<sql-statement>
+alter table atacc2 inherit atacc2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc2 inherit atacc2;
+ ^
+<sql-statement>
+-- test that we really are a child now (should see 4 not 3 and cascade should go through)
+select test2 from atacc2;
+</sql-statement>
+<sql-statement>
+drop table atacc2 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ drop table atacc2 cascade;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- adding only to a parent is allowed as of 9.2
+create table atacc1 (test int);
+</sql-statement>
+<sql-statement>
+create table atacc2 (test2 int) inherits (atacc1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table atacc2 (test2 int) inherits (atacc1);
+ ^
+<sql-statement>
+-- ok:
+alter table atacc1 add constraint foo check (test>0) no inherit;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- ok:
+ ^
+<sql-statement>
+-- check constraint is not there on child
+insert into atacc2 (test) values (-3);
+</sql-statement>
+<sql-statement>
+-- check constraint is there on parent
+insert into atacc1 (test) values (-3);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test) values (3);
+</sql-statement>
+<sql-statement>
+-- fail, violating row:
+alter table atacc2 add constraint foo check (test>0) no inherit;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail, violating row:
+ ^
+<sql-statement>
+drop table atacc2;
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- test unique constraint adding
+create table atacc1 ( test int ) ;
+</sql-statement>
+<sql-statement>
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a unique constraint
+ ^
+<sql-statement>
+-- insert first value
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- should fail
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- should succeed
+insert into atacc1 (test) values (4);
+</sql-statement>
+<sql-statement>
+-- try to create duplicates via alter table using - should fail
+alter table atacc1 alter column test type integer using 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try to create duplicates via alter table using - should fail
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the unique constraint fails when added
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a unique constraint (fails)
+ ^
+<sql-statement>
+insert into atacc1 (test) values (3);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the unique constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a unique constraint (fails)
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+</sql-statement>
+<sql-statement>
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test, test2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a unique constraint
+ ^
+<sql-statement>
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+</sql-statement>
+<sql-statement>
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+</sql-statement>
+<sql-statement>
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (5,4);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (5,5);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, unique(test));
+</sql-statement>
+<sql-statement>
+alter table atacc1 add unique (test2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add unique (test2);
+ ^
+<sql-statement>
+-- should fail for @@ second one @@
+insert into atacc1 (test2, test) values (3, 3);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test2, test) values (2, 3);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- test primary key constraint adding
+create table atacc1 ( id serial, test int) ;
+</sql-statement>
+<sql-statement>
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key constraint
+ ^
+<sql-statement>
+-- insert first value
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- should fail
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- should succeed
+insert into atacc1 (test) values (4);
+</sql-statement>
+<sql-statement>
+-- inserting NULL should fail
+insert into atacc1 (test) values(NULL);
+</sql-statement>
+<sql-statement>
+-- try adding a second primary key (should fail)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try adding a second primary key (should fail)
+ ^
+<sql-statement>
+-- drop first primary key constraint
+alter table atacc1 drop constraint atacc_test1 restrict;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- drop first primary key constraint
+ ^
+<sql-statement>
+-- try adding a primary key on oid (should succeed)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try adding a primary key on oid (should succeed)
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the primary key constraint fails when added
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test) values (2);
+</sql-statement>
+<sql-statement>
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key (fails)
+ ^
+<sql-statement>
+insert into atacc1 (test) values (3);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do another one where the primary key constraint fails when added
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- insert soon to be failing row
+insert into atacc1 (test) values (NULL);
+</sql-statement>
+<sql-statement>
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key (fails)
+ ^
+<sql-statement>
+insert into atacc1 (test) values (3);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- let's do one where the primary key constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+-- add a primary key constraint (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key constraint (fails)
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- adding a new column as primary key to a non-empty table.
+-- should fail unless the column has a non-null default value.
+create table atacc1 ( test int );
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test) values (0);
+</sql-statement>
+<sql-statement>
+-- add a primary key column without a default (fails).
+alter table atacc1 add column test2 int primary key;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key column without a default (fails).
+ ^
+<sql-statement>
+-- now add a primary key column with a default (succeeds).
+alter table atacc1 add column test2 int default 0 primary key;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- now add a primary key column with a default (succeeds).
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- this combination used to have order-of-execution problems (bug #15580)
+create table atacc1 (a int);
+</sql-statement>
+<sql-statement>
+insert into atacc1 values(1);
+</sql-statement>
+<sql-statement>
+alter table atacc1
+ add column b float8 not null default random(),
+ add primary key(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- additionally, we've seen issues with foreign key validation not being
+-- properly delayed until after a table rewrite. Check that works ok.
+create table atacc1 (a int primary key);
+</sql-statement>
+<sql-statement>
+alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
+ ^
+<sql-statement>
+alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- we've also seen issues with check constraints being validated at the wrong
+-- time when there's a pending table rewrite.
+create table atacc1 (a bigint, b int);
+</sql-statement>
+<sql-statement>
+insert into atacc1 values(1,1);
+</sql-statement>
+<sql-statement>
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+ ^
+<sql-statement>
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 validate constraint atacc1_chk, alter a type int;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- same as above, but ensure the constraint violation is detected
+create table atacc1 (a bigint, b int);
+</sql-statement>
+<sql-statement>
+insert into atacc1 values(1,2);
+</sql-statement>
+<sql-statement>
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+ ^
+<sql-statement>
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 validate constraint atacc1_chk, alter a type int;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+</sql-statement>
+<sql-statement>
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test, test2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- add a primary key constraint
+ ^
+<sql-statement>
+-- try adding a second primary key - should fail
+alter table atacc1 add constraint atacc_test2 primary key (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try adding a second primary key - should fail
+ ^
+<sql-statement>
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+</sql-statement>
+<sql-statement>
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (NULL,3);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (3, NULL);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (NULL,NULL);
+</sql-statement>
+<sql-statement>
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (5,4);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test,test2) values (5,5);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, primary key(test));
+</sql-statement>
+<sql-statement>
+-- only first should succeed
+insert into atacc1 (test2, test) values (3, 3);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test2, test) values (2, 3);
+</sql-statement>
+<sql-statement>
+insert into atacc1 (test2, test) values (1, NULL);
+</sql-statement>
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- alter table / alter column [set/drop] not null tests
+-- try altering system catalogs, should fail
+alter table pg_class alter column relname drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- alter table / alter column [set/drop] not null tests
+ ^
+<sql-statement>
+alter table pg_class alter relname set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table pg_class alter relname set not null;
+ ^
+<sql-statement>
+-- try altering non-existent table, should fail
+alter table non_existent alter column bar set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try altering non-existent table, should fail
+ ^
+<sql-statement>
+alter table non_existent alter column bar drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table non_existent alter column bar drop not null;
+ ^
+<sql-statement>
+-- test setting columns to null and not null and vice versa
+-- test checking for null values and primary key
+create table atacc1 (test int not null);
+</sql-statement>
+<sql-statement>
+alter table atacc1 add constraint "atacc1_pkey" primary key (test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add constraint "atacc1_pkey" primary key (test);
+ ^
+<sql-statement>
+alter table atacc1 alter column test drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter column test drop not null;
+ ^
+<sql-statement>
+alter table atacc1 drop constraint "atacc1_pkey";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 drop constraint "atacc1_pkey";
+ ^
+<sql-statement>
+alter table atacc1 alter column test drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter column test drop not null;
+ ^
+<sql-statement>
+insert into atacc1 values (null);
+</sql-statement>
+<sql-statement>
+alter table atacc1 alter test set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test set not null;
+ ^
+<sql-statement>
+delete from atacc1;
+</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>
+alter table atacc1 alter test set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test set not null;
+ ^
+<sql-statement>
+-- try altering a non-existent column, should fail
+alter table atacc1 alter bar set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- try altering a non-existent column, should fail
+ ^
+<sql-statement>
+alter table atacc1 alter bar drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter bar drop not null;
+ ^
+<sql-statement>
+-- try creating a view and altering that, should fail
+create view myview as select * from atacc1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- try creating a view and altering that, should fail
+ ^
+<sql-statement>
+alter table myview alter column test drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table myview alter column test drop not null;
+ ^
+<sql-statement>
+alter table myview alter column test set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table myview alter column test set not null;
+ ^
+<sql-statement>
+drop view myview;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'myview'
+ drop view myview;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- set not null verified by constraints
+create table atacc1 (test_a int, test_b int);
+</sql-statement>
+<sql-statement>
+insert into atacc1 values (null, 1);
+</sql-statement>
+<sql-statement>
+-- constraint not cover all values, should fail
+alter table atacc1 add constraint atacc1_constr_or check(test_a is not null or test_b < 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- constraint not cover all values, should fail
+ ^
+<sql-statement>
+alter table atacc1 alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_a set not null;
+ ^
+<sql-statement>
+alter table atacc1 drop constraint atacc1_constr_or;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 drop constraint atacc1_constr_or;
+ ^
+<sql-statement>
+-- not valid constraint, should fail
+alter table atacc1 add constraint atacc1_constr_invalid check(test_a is not null) not valid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- not valid constraint, should fail
+ ^
+<sql-statement>
+alter table atacc1 alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_a set not null;
+ ^
+<sql-statement>
+alter table atacc1 drop constraint atacc1_constr_invalid;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 drop constraint atacc1_constr_invalid;
+ ^
+<sql-statement>
+-- with valid constraint
+update atacc1 set test_a = 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>
+alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
+ ^
+<sql-statement>
+alter table atacc1 alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_a set not null;
+ ^
+<sql-statement>
+delete from atacc1;
+</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 atacc1 values (2, null);
+</sql-statement>
+<sql-statement>
+alter table atacc1 alter test_a drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_a drop not null;
+ ^
+<sql-statement>
+-- test multiple set not null at same time
+-- test_a checked by atacc1_constr_a_valid, test_b should fail by table scan
+alter table atacc1 alter test_a set not null, alter test_b set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- test multiple set not null at same time
+ ^
+<sql-statement>
+-- commands order has no importance
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- commands order has no importance
+ ^
+<sql-statement>
+-- valid one by table scan, one by check constraints
+update atacc1 set test_b = 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>
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_b set not null, alter test_a set not null;
+ ^
+<sql-statement>
+alter table atacc1 alter test_a drop not null, alter test_b drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_a drop not null, alter test_b drop not null;
+ ^
+<sql-statement>
+-- both column has check constraints
+alter table atacc1 add constraint atacc1_constr_b_valid check(test_b is not null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- both column has check constraints
+ ^
+<sql-statement>
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table atacc1 alter test_b set not null, alter test_a set not null;
+ ^
+<sql-statement>
+drop table atacc1;
+</sql-statement>
+<sql-statement>
+-- test inheritance
+create table parent (a int);
+</sql-statement>
+<sql-statement>
+create table child (b varchar(255)) inherits (parent);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table child (b varchar(255)) inherits (parent);
+ ^
+<sql-statement>
+alter table parent alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table parent alter a set not null;
+ ^
+<sql-statement>
+insert into parent values (NULL);
+</sql-statement>
+<sql-statement>
+insert into child (a, b) values (NULL, 'foo');
+</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.child
+
+<sql-statement>
+alter table parent alter a drop not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table parent alter a drop not null;
+ ^
+<sql-statement>
+insert into parent values (NULL);
+</sql-statement>
+<sql-statement>
+insert into child (a, b) values (NULL, 'foo');
+</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.child
+
+<sql-statement>
+alter table only parent alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table only parent alter a set not null;
+ ^
+<sql-statement>
+alter table child alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table child alter a set not null;
+ ^
+<sql-statement>
+delete from parent;
+</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>
+alter table only parent alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table only parent alter a set not null;
+ ^
+<sql-statement>
+insert into parent values (NULL);
+</sql-statement>
+<sql-statement>
+alter table child alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table child alter a set not null;
+ ^
+<sql-statement>
+insert into child (a, b) values (NULL, 'foo');
+</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.child
+
+<sql-statement>
+delete from child;
+</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>
+alter table child alter a set not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table child alter a set not null;
+ ^
+<sql-statement>
+insert into child (a, b) values (NULL, 'foo');
+</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.child
+
+<sql-statement>
+drop table child;
+</sql-statement>
+<sql-statement>
+drop table parent;
+</sql-statement>
+<sql-statement>
+-- test setting and removing default values
+create table def_test (
+ c1 int4 default 5,
+ c2 text default 'initial_default'
+);
+</sql-statement>
+<sql-statement>
+insert into def_test default values;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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>
+alter table def_test alter column c1 drop default;
+</sql-statement>
+NSQLTranslationPG::TConverter::ParseAlterTableStmt(AlterTableStmt const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:2904:0
+NSQLTranslationPG::TConverter::ParseRawStmt(RawStmt const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:510:0
+NSQLTranslationPG::TConverter::ParseResult(List const*, TMaybe<unsigned int, NMaybe::TPolicyUndefinedExcept>) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:393:0
+NSQLTranslationPG::TConverter::OnResult(List const*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:351:0
+NYql::PGParse(TBasicString<char, std::__y1::char_traits<char>> const&, NYql::IPGParseEvents&) at /-S/ydb/library/yql/parser/pg_wrapper/parser.cpp:217:0
+NSQLTranslationPG::PGToYql(TBasicString<char, std::__y1::char_traits<char>> const&, NSQLTranslation::TTranslationSettings const&, NYql::TStmtParseInfo*) at /-S/ydb/library/yql/sql/pg/pg_sql.cpp:5109:0
+NSQLTranslation::SqlToYql(TBasicString<char, std::__y1::char_traits<char>> const&, NSQLTranslation::TTranslationSettings const&, TVector<NYql::TWarningRule, std::__y1::allocator<NYql::TWarningRule>>*, NYql::TStmtParseInfo*) at /-S/ydb/library/yql/sql/sql.cpp:38:0
+NYql::TProgram::ParseSql(NSQLTranslation::TTranslationSettings const&) at /-S/ydb/library/yql/core/facade/yql_facade.cpp:658:0
+Main(int, char**) at /-S/ydb/library/yql/tools/pgrun/pgrun.cpp:1239:0
+main at /-S/ydb/library/yql/tools/pgrun/pgrun.cpp:1341:0
+__libc_start_call_main at ../sysdeps/nptl/libc_start_call_main.h:58:0
+__libc_start_main_impl at ../csu/libc-start.c:392:0
+??? at ???:0:0
diff --git a/yql/essentials/tests/postgresql/cases/alter_table.out b/yql/essentials/tests/postgresql/cases/alter_table.out
new file mode 100644
index 0000000000..fb21a101f0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/alter_table.out
@@ -0,0 +1,284 @@
+--
+-- ALTER_TABLE
+--
+-- Clean up in case a prior regression run failed
+SET client_min_messages TO 'warning';
+RESET client_min_messages;
+--
+-- add attribute
+--
+CREATE TABLE attmp (initial int4);
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+DROP TABLE attmp;
+-- the wolf bug - schema mods caused inconsistent row descriptors
+CREATE TABLE attmp (
+ initial int4
+);
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+ERROR: column number must be in range from 1 to 32767
+LINE 1: ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+ ^
+DROP TABLE attmp;
+--
+-- rename - check on both non-temp and temp tables
+--
+CREATE TABLE attmp (regtable int);
+CREATE TEMP TABLE attmp (attmptable int);
+SELECT * FROM attmp;
+ regtable
+----------
+(0 rows)
+
+--
+-- check renaming to a table's array type's autogenerated name
+-- (the array type's name should get out of the way)
+--
+CREATE TABLE attmp_array (id int);
+CREATE TABLE attmp_array2 (id int);
+DROP TABLE attmp_array;
+-- renaming to table's own array type's name is an interesting corner case
+CREATE TABLE attmp_array (id int);
+-- rename statements with mismatching statement and object types
+CREATE TABLE alter_idx_rename_test (a INT);
+CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
+CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
+BEGIN;
+COMMIT;
+BEGIN;
+COMMIT;
+BEGIN;
+COMMIT;
+-- FOREIGN KEY CONSTRAINT adding TEST
+CREATE TABLE attmp2 (a int primary key);
+CREATE TABLE attmp3 (a int, b int);
+CREATE TABLE attmp4 (a int, b int, unique(a,b));
+CREATE TABLE attmp5 (a int, b int);
+-- Insert rows into attmp2 (pktable)
+INSERT INTO attmp2 values (1);
+INSERT INTO attmp2 values (2);
+INSERT INTO attmp2 values (3);
+INSERT INTO attmp2 values (4);
+-- Insert rows into attmp3
+INSERT INTO attmp3 values (1,10);
+INSERT INTO attmp3 values (1,20);
+INSERT INTO attmp3 values (5,50);
+INSERT INTO attmp3 values (5,50);
+-- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
+create table parent_noinh_convalid (a int);
+insert into parent_noinh_convalid values (1);
+DROP TABLE attmp5;
+DROP TABLE attmp4;
+DROP TABLE attmp3;
+DROP TABLE attmp2;
+-- we leave nv_parent and children around to help test pg_dump logic
+-- Foreign key adding test with mixed types
+-- Note: these tables are TEMP to avoid name conflicts when this test
+-- is run in parallel with foreign_key.sql.
+CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 inet);
+DROP TABLE FKTABLE;
+-- This should succeed, even though they are different types,
+-- because int=int8 exists and is a member of the integer opfamily
+CREATE TEMP TABLE FKTABLE (ftest1 int8);
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+DROP TABLE FKTABLE;
+-- This should fail, because we'd have to cast numeric to int which is
+-- not an implicit coercion (or use numeric=numeric, but that's not part
+-- of the integer opfamily)
+CREATE TEMP TABLE FKTABLE (ftest1 numeric);
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- On the other hand, this should work because int implicitly promotes to
+-- numeric, and we allow promotion on the FK side
+CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
+ PRIMARY KEY(ptest1, ptest2));
+-- This should fail, because we just chose really odd types
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+DROP TABLE FKTABLE;
+-- Again, so should this...
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+DROP TABLE FKTABLE;
+-- This fails because we mixed up the column ordering
+CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- Test that ALTER CONSTRAINT updates trigger deferrability properly
+CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+-- temp tables should go away by themselves, need not drop them.
+-- test check constraint adding
+create table atacc1 ( test int );
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails when added
+create table atacc1 ( test int );
+-- insert a soon to be failing row
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int, test3 int);
+-- should succeed
+insert into atacc1 (test,test2,test3) values (4,4,5);
+drop table atacc1;
+-- inheritance related tests
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+insert into atacc2 (test2) values (3);
+drop table atacc2;
+drop table atacc1;
+-- same things with one created with INHERIT
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+select test2 from atacc2;
+ test2
+-------
+(0 rows)
+
+drop table atacc1;
+-- adding only to a parent is allowed as of 9.2
+create table atacc1 (test int);
+-- check constraint is not there on child
+insert into atacc2 (test) values (-3);
+insert into atacc1 (test) values (3);
+drop table atacc2;
+drop table atacc1;
+-- test unique constraint adding
+create table atacc1 ( test int ) ;
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the unique constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the unique constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, unique(test));
+-- should fail for @@ second one @@
+insert into atacc1 (test2, test) values (3, 3);
+drop table atacc1;
+-- test primary key constraint adding
+create table atacc1 ( id serial, test int) ;
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do another one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing row
+insert into atacc1 (test) values (NULL);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the primary key constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- adding a new column as primary key to a non-empty table.
+-- should fail unless the column has a non-null default value.
+create table atacc1 ( test int );
+insert into atacc1 (test) values (0);
+drop table atacc1;
+-- this combination used to have order-of-execution problems (bug #15580)
+create table atacc1 (a int);
+insert into atacc1 values(1);
+drop table atacc1;
+-- additionally, we've seen issues with foreign key validation not being
+-- properly delayed until after a table rewrite. Check that works ok.
+create table atacc1 (a int primary key);
+drop table atacc1;
+-- we've also seen issues with check constraints being validated at the wrong
+-- time when there's a pending table rewrite.
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,1);
+drop table atacc1;
+-- same as above, but ensure the constraint violation is detected
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,2);
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, primary key(test));
+-- only first should succeed
+insert into atacc1 (test2, test) values (3, 3);
+drop table atacc1;
+-- test setting columns to null and not null and vice versa
+-- test checking for null values and primary key
+create table atacc1 (test int not null);
+insert into atacc1 values (null);
+drop table atacc1;
+-- set not null verified by constraints
+create table atacc1 (test_a int, test_b int);
+insert into atacc1 values (null, 1);
+insert into atacc1 values (2, null);
+drop table atacc1;
+-- test inheritance
+create table parent (a int);
+insert into parent values (NULL);
+drop table parent;
+-- test setting and removing default values
+create table def_test (
+ c1 int4 default 5,
+ c2 text default 'initial_default'
+);
diff --git a/yql/essentials/tests/postgresql/cases/alter_table.sql b/yql/essentials/tests/postgresql/cases/alter_table.sql
new file mode 100644
index 0000000000..611f95a0ab
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/alter_table.sql
@@ -0,0 +1,273 @@
+--
+-- ALTER_TABLE
+--
+-- Clean up in case a prior regression run failed
+SET client_min_messages TO 'warning';
+RESET client_min_messages;
+--
+-- add attribute
+--
+CREATE TABLE attmp (initial int4);
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+DROP TABLE attmp;
+-- the wolf bug - schema mods caused inconsistent row descriptors
+CREATE TABLE attmp (
+ initial int4
+);
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+DROP TABLE attmp;
+--
+-- rename - check on both non-temp and temp tables
+--
+CREATE TABLE attmp (regtable int);
+CREATE TEMP TABLE attmp (attmptable int);
+SELECT * FROM attmp;
+--
+-- check renaming to a table's array type's autogenerated name
+-- (the array type's name should get out of the way)
+--
+CREATE TABLE attmp_array (id int);
+CREATE TABLE attmp_array2 (id int);
+DROP TABLE attmp_array;
+-- renaming to table's own array type's name is an interesting corner case
+CREATE TABLE attmp_array (id int);
+-- rename statements with mismatching statement and object types
+CREATE TABLE alter_idx_rename_test (a INT);
+CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
+CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
+BEGIN;
+COMMIT;
+BEGIN;
+COMMIT;
+BEGIN;
+COMMIT;
+-- FOREIGN KEY CONSTRAINT adding TEST
+CREATE TABLE attmp2 (a int primary key);
+CREATE TABLE attmp3 (a int, b int);
+CREATE TABLE attmp4 (a int, b int, unique(a,b));
+CREATE TABLE attmp5 (a int, b int);
+-- Insert rows into attmp2 (pktable)
+INSERT INTO attmp2 values (1);
+INSERT INTO attmp2 values (2);
+INSERT INTO attmp2 values (3);
+INSERT INTO attmp2 values (4);
+-- Insert rows into attmp3
+INSERT INTO attmp3 values (1,10);
+INSERT INTO attmp3 values (1,20);
+INSERT INTO attmp3 values (5,50);
+INSERT INTO attmp3 values (5,50);
+-- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
+create table parent_noinh_convalid (a int);
+insert into parent_noinh_convalid values (1);
+DROP TABLE attmp5;
+DROP TABLE attmp4;
+DROP TABLE attmp3;
+DROP TABLE attmp2;
+-- we leave nv_parent and children around to help test pg_dump logic
+-- Foreign key adding test with mixed types
+-- Note: these tables are TEMP to avoid name conflicts when this test
+-- is run in parallel with foreign_key.sql.
+CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 inet);
+DROP TABLE FKTABLE;
+-- This should succeed, even though they are different types,
+-- because int=int8 exists and is a member of the integer opfamily
+CREATE TEMP TABLE FKTABLE (ftest1 int8);
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+DROP TABLE FKTABLE;
+-- This should fail, because we'd have to cast numeric to int which is
+-- not an implicit coercion (or use numeric=numeric, but that's not part
+-- of the integer opfamily)
+CREATE TEMP TABLE FKTABLE (ftest1 numeric);
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- On the other hand, this should work because int implicitly promotes to
+-- numeric, and we allow promotion on the FK side
+CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
+ PRIMARY KEY(ptest1, ptest2));
+-- This should fail, because we just chose really odd types
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+DROP TABLE FKTABLE;
+-- Again, so should this...
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+DROP TABLE FKTABLE;
+-- This fails because we mixed up the column ordering
+CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- Test that ALTER CONSTRAINT updates trigger deferrability properly
+CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+-- temp tables should go away by themselves, need not drop them.
+-- test check constraint adding
+create table atacc1 ( test int );
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails when added
+create table atacc1 ( test int );
+-- insert a soon to be failing row
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int, test3 int);
+-- should succeed
+insert into atacc1 (test,test2,test3) values (4,4,5);
+drop table atacc1;
+-- inheritance related tests
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+insert into atacc2 (test2) values (3);
+drop table atacc2;
+drop table atacc1;
+-- same things with one created with INHERIT
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+select test2 from atacc2;
+drop table atacc1;
+-- adding only to a parent is allowed as of 9.2
+create table atacc1 (test int);
+-- check constraint is not there on child
+insert into atacc2 (test) values (-3);
+insert into atacc1 (test) values (3);
+drop table atacc2;
+drop table atacc1;
+-- test unique constraint adding
+create table atacc1 ( test int ) ;
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the unique constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the unique constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, unique(test));
+-- should fail for @@ second one @@
+insert into atacc1 (test2, test) values (3, 3);
+drop table atacc1;
+-- test primary key constraint adding
+create table atacc1 ( id serial, test int) ;
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do another one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing row
+insert into atacc1 (test) values (NULL);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the primary key constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+drop table atacc1;
+-- adding a new column as primary key to a non-empty table.
+-- should fail unless the column has a non-null default value.
+create table atacc1 ( test int );
+insert into atacc1 (test) values (0);
+drop table atacc1;
+-- this combination used to have order-of-execution problems (bug #15580)
+create table atacc1 (a int);
+insert into atacc1 values(1);
+drop table atacc1;
+-- additionally, we've seen issues with foreign key validation not being
+-- properly delayed until after a table rewrite. Check that works ok.
+create table atacc1 (a int primary key);
+drop table atacc1;
+-- we've also seen issues with check constraints being validated at the wrong
+-- time when there's a pending table rewrite.
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,1);
+drop table atacc1;
+-- same as above, but ensure the constraint violation is detected
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,2);
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, primary key(test));
+-- only first should succeed
+insert into atacc1 (test2, test) values (3, 3);
+drop table atacc1;
+-- test setting columns to null and not null and vice versa
+-- test checking for null values and primary key
+create table atacc1 (test int not null);
+insert into atacc1 values (null);
+drop table atacc1;
+-- set not null verified by constraints
+create table atacc1 (test_a int, test_b int);
+insert into atacc1 values (null, 1);
+insert into atacc1 values (2, null);
+drop table atacc1;
+-- test inheritance
+create table parent (a int);
+insert into parent values (NULL);
+drop table parent;
+-- test setting and removing default values
+create table def_test (
+ c1 int4 default 5,
+ c2 text default 'initial_default'
+);
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
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/arrays.out b/yql/essentials/tests/postgresql/cases/arrays.out
new file mode 100644
index 0000000000..76e7824f00
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/arrays.out
@@ -0,0 +1,771 @@
+--
+-- ARRAYS
+--
+CREATE TABLE arrtest (
+ a int2[],
+ b int4[][][],
+ c name[],
+ d text[][],
+ e float8[],
+ f char(5)[],
+ g varchar(5)[]
+);
+-- test mixed slice/scalar subscripting
+select '{{1,2,3},{4,5,6},{7,8,9}}'::int[];
+ int4
+---------------------------
+ {{1,2,3},{4,5,6},{7,8,9}}
+(1 row)
+
+select '[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[];
+ int4
+--------------------------------------
+ [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
+(1 row)
+
+-- test slices with empty lower and/or upper index
+CREATE TEMP TABLE arrtest_s (
+ a int2[],
+ b int2[][]
+);
+INSERT INTO arrtest_s VALUES(NULL, NULL);
+--
+-- test array extension
+--
+CREATE TEMP TABLE arrtest1 (i int[], t text[]);
+--
+-- array expressions and operators
+--
+-- table creation and INSERTs
+CREATE TEMP TABLE arrtest2 (i integer ARRAY[4], f float8[], n numeric[], t text[], d timestamp[]);
+-- some more test data
+CREATE TEMP TABLE arrtest_f (f0 int, f1 text, f2 float8);
+insert into arrtest_f values(1,'cat1',1.21);
+insert into arrtest_f values(2,'cat1',1.24);
+insert into arrtest_f values(3,'cat1',1.18);
+insert into arrtest_f values(4,'cat1',1.26);
+insert into arrtest_f values(5,'cat1',1.15);
+insert into arrtest_f values(6,'cat2',1.15);
+insert into arrtest_f values(7,'cat2',1.26);
+insert into arrtest_f values(8,'cat2',1.32);
+insert into arrtest_f values(9,'cat2',1.30);
+CREATE TEMP TABLE arrtest_i (f0 int, f1 text, f2 int);
+insert into arrtest_i values(1,'cat1',21);
+insert into arrtest_i values(2,'cat1',24);
+insert into arrtest_i values(3,'cat1',18);
+insert into arrtest_i values(4,'cat1',26);
+insert into arrtest_i values(5,'cat1',15);
+insert into arrtest_i values(6,'cat2',15);
+insert into arrtest_i values(7,'cat2',26);
+insert into arrtest_i values(8,'cat2',32);
+insert into arrtest_i values(9,'cat2',30);
+SELECT ARRAY[[[[[['hello'],['world']]]]]];
+ array
+---------------------------
+ {{{{{{hello},{world}}}}}}
+(1 row)
+
+SELECT ARRAY[ARRAY['hello'],ARRAY['world']];
+ array
+-------------------
+ {{hello},{world}}
+(1 row)
+
+-- with nulls
+SELECT '{1,null,3}'::int[];
+ int4
+------------
+ {1,NULL,3}
+(1 row)
+
+SELECT ARRAY[1,NULL,3];
+ array
+------------
+ {1,NULL,3}
+(1 row)
+
+SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE";
+ FALSE
+-------
+ f
+(1 row)
+
+-- array casts
+SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}";
+ {1,2,3}
+---------
+ {1,2,3}
+(1 row)
+
+SELECT pg_typeof(ARRAY[1,2,3]::text[]::int[]::float8[]) AS "double precision[]";
+ double precision[]
+--------------------
+ double precision[]
+(1 row)
+
+SELECT ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[] AS "{{a,bc},{def,hijk}}";
+ {{a,bc},{def,hijk}}
+---------------------
+ {{a,bc},{def,hijk}}
+(1 row)
+
+SELECT pg_typeof(ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[]) AS "character varying[]";
+ character varying[]
+---------------------
+ character varying[]
+(1 row)
+
+SELECT CAST(ARRAY[[[[[['a','bb','ccc']]]]]] as text[]) as "{{{{{{a,bb,ccc}}}}}}";
+ {{{{{{a,bb,ccc}}}}}}
+----------------------
+ {{{{{{a,bb,ccc}}}}}}
+(1 row)
+
+SELECT NULL::text[]::int[] AS "NULL";
+ NULL
+------
+
+(1 row)
+
+-- scalar op any/all (array)
+select 33 = any ('{1,2,3}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 = any ('{1,2,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+select 33 = all ('{1,2,33}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 >= all ('{1,2,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+-- boundary cases
+select null::int >= all ('{1,2,33}');
+ ?column?
+----------
+
+(1 row)
+
+select null::int >= all ('{}');
+ ?column?
+----------
+ t
+(1 row)
+
+select null::int >= any ('{}');
+ ?column?
+----------
+ f
+(1 row)
+
+-- cross-datatype
+select 33.4 = any (array[1,2,3]);
+ ?column?
+----------
+ f
+(1 row)
+
+select 33.4 > all (array[1,2,3]);
+ ?column?
+----------
+ t
+(1 row)
+
+-- nulls
+select 33 = any (null::int[]);
+ ?column?
+----------
+
+(1 row)
+
+select null::int = any ('{1,2,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = any ('{1,null,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = any ('{1,null,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+select 33 = all (null::int[]);
+ ?column?
+----------
+
+(1 row)
+
+select null::int = all ('{1,2,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = all ('{1,null,3}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 = all ('{33,null,33}');
+ ?column?
+----------
+
+(1 row)
+
+-- nulls later in the bitmap
+SELECT -1 != ALL(ARRAY(SELECT NULLIF(g.i, 900) FROM generate_series(1,1000) g(i)));
+ ?column?
+----------
+
+(1 row)
+
+-- test indexes on arrays
+create temp table arr_tbl (f1 int[] unique);
+-- test ON CONFLICT DO UPDATE with arrays
+create temp table arr_pk_tbl (pk int4 primary key, f1 int[]);
+-- test [not] (like|ilike) (any|all) (...)
+select 'foo' like any (array['%a', '%o']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' like any (array['%a', '%b']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' like all (array['f%', '%o']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' like all (array['f%', '%b']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' not like any (array['%a', '%b']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' not like all (array['%a', '%o']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' ilike any (array['%A', '%O']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' ilike all (array['F%', '%O']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- General array parser tests
+--
+-- none of the following should be accepted
+select '{{1,{2}},{2,3}}'::text[];
+ERROR: malformed array literal: "{{1,{2}},{2,3}}"
+LINE 1: select '{{1,{2}},{2,3}}'::text[];
+ ^
+DETAIL: Unexpected "{" character.
+select '{{},{}}'::text[];
+ERROR: malformed array literal: "{{},{}}"
+LINE 1: select '{{},{}}'::text[];
+ ^
+DETAIL: Unexpected "}" character.
+select E'{{1,2},\\{2,3}}'::text[];
+ERROR: malformed array literal: "{{1,2},\{2,3}}"
+LINE 1: select E'{{1,2},\\{2,3}}'::text[];
+ ^
+DETAIL: Unexpected "\" character.
+select '{{"1 2" x},{3}}'::text[];
+ERROR: malformed array literal: "{{"1 2" x},{3}}"
+LINE 1: select '{{"1 2" x},{3}}'::text[];
+ ^
+DETAIL: Unexpected array element.
+select '{}}'::text[];
+ERROR: malformed array literal: "{}}"
+LINE 1: select '{}}'::text[];
+ ^
+DETAIL: Junk after closing right brace.
+select '{ }}'::text[];
+ERROR: malformed array literal: "{ }}"
+LINE 1: select '{ }}'::text[];
+ ^
+DETAIL: Junk after closing right brace.
+-- none of the above should be accepted
+-- all of the following should be accepted
+select '{}'::text[];
+ text
+------
+ {}
+(1 row)
+
+select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[];
+ text
+-----------------------------------------------
+ {{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}
+(1 row)
+
+select '{ { "," } , { 3 } }'::text[];
+ text
+-------------
+ {{","},{3}}
+(1 row)
+
+select ' { { " 0 second " , 0 second } }'::text[];
+ text
+-------------------------------
+ {{" 0 second ","0 second"}}
+(1 row)
+
+select '[0:1]={1.1,2.2}'::float8[];
+ float8
+-----------------
+ [0:1]={1.1,2.2}
+(1 row)
+
+-- all of the above should be accepted
+-- tests for array aggregates
+CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]);
+create table comptable (c1 comptype, c2 comptype[]);
+drop table comptable;
+select string_to_array('1|2|3', '|');
+ string_to_array
+-----------------
+ {1,2,3}
+(1 row)
+
+select string_to_array('1|2|3|', '|');
+ string_to_array
+-----------------
+ {1,2,3,""}
+(1 row)
+
+select string_to_array('1||2|3||', '||');
+ string_to_array
+-----------------
+ {1,2|3,""}
+(1 row)
+
+select string_to_array('1|2|3', '');
+ string_to_array
+-----------------
+ {1|2|3}
+(1 row)
+
+select string_to_array('', '|');
+ string_to_array
+-----------------
+ {}
+(1 row)
+
+select string_to_array('1|2|3', NULL);
+ string_to_array
+-----------------
+ {1,|,2,|,3}
+(1 row)
+
+select string_to_array(NULL, '|') IS NULL;
+ ?column?
+----------
+ t
+(1 row)
+
+select string_to_array('abc', '');
+ string_to_array
+-----------------
+ {abc}
+(1 row)
+
+select string_to_array('abc', '', 'abc');
+ string_to_array
+-----------------
+ {NULL}
+(1 row)
+
+select string_to_array('abc', ',');
+ string_to_array
+-----------------
+ {abc}
+(1 row)
+
+select string_to_array('abc', ',', 'abc');
+ string_to_array
+-----------------
+ {NULL}
+(1 row)
+
+select string_to_array('1,2,3,4,,6', ',');
+ string_to_array
+-----------------
+ {1,2,3,4,"",6}
+(1 row)
+
+select string_to_array('1,2,3,4,,6', ',', '');
+ string_to_array
+------------------
+ {1,2,3,4,NULL,6}
+(1 row)
+
+select string_to_array('1,2,3,4,*,6', ',', '*');
+ string_to_array
+------------------
+ {1,2,3,4,NULL,6}
+(1 row)
+
+select v, v is null as "is null" from string_to_table('1|2|3', '|') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+(3 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3|', '|') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ | f
+(4 rows)
+
+select v, v is null as "is null" from string_to_table('1||2|3||', '||') g(v);
+ v | is null
+-----+---------
+ 1 | f
+ 2|3 | f
+ | f
+(3 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3', '') g(v);
+ v | is null
+-------+---------
+ 1|2|3 | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('', '|') g(v);
+ v | is null
+---+---------
+(0 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3', NULL) g(v);
+ v | is null
+---+---------
+ 1 | f
+ | | f
+ 2 | f
+ | | f
+ 3 | f
+(5 rows)
+
+select v, v is null as "is null" from string_to_table(NULL, '|') g(v);
+ v | is null
+---+---------
+(0 rows)
+
+select v, v is null as "is null" from string_to_table('abc', '') g(v);
+ v | is null
+-----+---------
+ abc | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', '', 'abc') g(v);
+ v | is null
+---+---------
+ | t
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', ',') g(v);
+ v | is null
+-----+---------
+ abc | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', ',', 'abc') g(v);
+ v | is null
+---+---------
+ | t
+(1 row)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | f
+ 6 | f
+(6 rows)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',', '') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | t
+ 6 | f
+(6 rows)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,*,6', ',', '*') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | t
+ 6 | f
+(6 rows)
+
+select array_to_string(NULL::int4[], ',') IS NULL;
+ ?column?
+----------
+ t
+(1 row)
+
+select array_to_string('{}'::int4[], ',');
+ array_to_string
+-----------------
+
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',');
+ array_to_string
+-----------------
+ 1,2,3,4,6
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',', '*');
+ array_to_string
+-----------------
+ 1,2,3,4,*,6
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], NULL);
+ array_to_string
+-----------------
+
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',', NULL);
+ array_to_string
+-----------------
+ 1,2,3,4,6
+(1 row)
+
+select array_to_string(string_to_array('1|2|3', '|'), '|');
+ array_to_string
+-----------------
+ 1|2|3
+(1 row)
+
+select array_length(array[1,2,3], 1);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 0);
+ array_length
+--------------
+
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 1);
+ array_length
+--------------
+ 2
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 2);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 3);
+ array_length
+--------------
+
+(1 row)
+
+select cardinality(NULL::int[]);
+ cardinality
+-------------
+
+(1 row)
+
+select cardinality('{}'::int[]);
+ cardinality
+-------------
+ 0
+(1 row)
+
+select cardinality(array[1,2,3]);
+ cardinality
+-------------
+ 3
+(1 row)
+
+select cardinality('[2:4]={5,6,7}'::int[]);
+ cardinality
+-------------
+ 3
+(1 row)
+
+select cardinality('{{1,2}}'::int[]);
+ cardinality
+-------------
+ 2
+(1 row)
+
+select cardinality('{{1,2},{3,4},{5,6}}'::int[]);
+ cardinality
+-------------
+ 6
+(1 row)
+
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
+ cardinality
+-------------
+ 8
+(1 row)
+
+select array_agg(unique1) from tenk1 where unique1 < -15;
+ array_agg
+-----------
+
+(1 row)
+
+-- array_agg(anyarray)
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3,4}'::int[])) v(ar);
+ array_agg
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select array_agg(ar)
+ from (select array_agg(array[i, i+1, i-1])
+ from generate_series(1,2) a(i)) b(ar);
+ array_agg
+---------------------
+ {{{1,2,0},{2,3,1}}}
+(1 row)
+
+select array_agg(array[i+1.2, i+1.3, i+1.4]) from generate_series(1,3) g(i);
+ array_agg
+---------------------------------------------
+ {{2.2,2.3,2.4},{3.2,3.3,3.4},{4.2,4.3,4.4}}
+(1 row)
+
+select array_agg(array['Hello', i::text]) from generate_series(9,11) g(i);
+ array_agg
+-----------------------------------
+ {{Hello,9},{Hello,10},{Hello,11}}
+(1 row)
+
+select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i);
+ array_agg
+--------------------------------------
+ {{1,1,2},{2,2,3},{3,NULL,4},{4,4,5}}
+(1 row)
+
+-- errors
+select array_agg('{}'::int[]) from generate_series(1,2);
+ERROR: cannot accumulate empty arrays
+select array_agg(null::int[]) from generate_series(1,2);
+ERROR: cannot accumulate null arrays
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3}'::int[])) v(ar);
+ERROR: cannot accumulate arrays of different dimensionality
+select * from unnest(array[1,2,3]);
+ unnest
+--------
+ 1
+ 2
+ 3
+(3 rows)
+
+-- array(select array-value ...)
+select array(select array[i,i/2] from generate_series(1,5) i);
+ array
+---------------------------------
+ {{1,0},{2,1},{3,1},{4,2},{5,2}}
+(1 row)
+
+select array(select array['Hello', i::text] from generate_series(9,11) i);
+ array
+-----------------------------------
+ {{Hello,9},{Hello,10},{Hello,11}}
+(1 row)
+
+-- Insert/update on a column that is array of composite
+create temp table t1 (f1 int8_tbl[]);
+-- Check that arrays of composites are safely detoasted when needed
+create temp table src (f1 text);
+insert into src
+ select string_agg(random()::text,'') from generate_series(1,10000);
+create temp table dest (f1 textandtext[]);
+drop table src;
+drop table dest;
+-- 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);
+ arr | trim_array
+-------------------------------+-----------------
+ {1,2,3,4,5,6} | {1,2,3,4}
+ {1,2} | {}
+ [10:16]={1,2,3,4,5,6,7} | {1,2,3,4,5}
+ [-15:-10]={1,2,3,4,5,6} | {1,2,3,4}
+ {{1,10},{2,20},{3,30},{4,40}} | {{1,10},{2,20}}
+(5 rows)
+
+SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail
+ERROR: number of elements to trim must be between 0 and 3
+SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail
+ERROR: number of elements to trim must be between 0 and 3
diff --git a/yql/essentials/tests/postgresql/cases/arrays.sql b/yql/essentials/tests/postgresql/cases/arrays.sql
new file mode 100644
index 0000000000..fa337276f1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/arrays.sql
@@ -0,0 +1,207 @@
+--
+-- ARRAYS
+--
+CREATE TABLE arrtest (
+ a int2[],
+ b int4[][][],
+ c name[],
+ d text[][],
+ e float8[],
+ f char(5)[],
+ g varchar(5)[]
+);
+-- test mixed slice/scalar subscripting
+select '{{1,2,3},{4,5,6},{7,8,9}}'::int[];
+select '[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[];
+-- test slices with empty lower and/or upper index
+CREATE TEMP TABLE arrtest_s (
+ a int2[],
+ b int2[][]
+);
+INSERT INTO arrtest_s VALUES(NULL, NULL);
+--
+-- test array extension
+--
+CREATE TEMP TABLE arrtest1 (i int[], t text[]);
+--
+-- array expressions and operators
+--
+-- table creation and INSERTs
+CREATE TEMP TABLE arrtest2 (i integer ARRAY[4], f float8[], n numeric[], t text[], d timestamp[]);
+-- some more test data
+CREATE TEMP TABLE arrtest_f (f0 int, f1 text, f2 float8);
+insert into arrtest_f values(1,'cat1',1.21);
+insert into arrtest_f values(2,'cat1',1.24);
+insert into arrtest_f values(3,'cat1',1.18);
+insert into arrtest_f values(4,'cat1',1.26);
+insert into arrtest_f values(5,'cat1',1.15);
+insert into arrtest_f values(6,'cat2',1.15);
+insert into arrtest_f values(7,'cat2',1.26);
+insert into arrtest_f values(8,'cat2',1.32);
+insert into arrtest_f values(9,'cat2',1.30);
+CREATE TEMP TABLE arrtest_i (f0 int, f1 text, f2 int);
+insert into arrtest_i values(1,'cat1',21);
+insert into arrtest_i values(2,'cat1',24);
+insert into arrtest_i values(3,'cat1',18);
+insert into arrtest_i values(4,'cat1',26);
+insert into arrtest_i values(5,'cat1',15);
+insert into arrtest_i values(6,'cat2',15);
+insert into arrtest_i values(7,'cat2',26);
+insert into arrtest_i values(8,'cat2',32);
+insert into arrtest_i values(9,'cat2',30);
+SELECT ARRAY[[[[[['hello'],['world']]]]]];
+SELECT ARRAY[ARRAY['hello'],ARRAY['world']];
+-- with nulls
+SELECT '{1,null,3}'::int[];
+SELECT ARRAY[1,NULL,3];
+SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE";
+-- array casts
+SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}";
+SELECT pg_typeof(ARRAY[1,2,3]::text[]::int[]::float8[]) AS "double precision[]";
+SELECT ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[] AS "{{a,bc},{def,hijk}}";
+SELECT pg_typeof(ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[]) AS "character varying[]";
+SELECT CAST(ARRAY[[[[[['a','bb','ccc']]]]]] as text[]) as "{{{{{{a,bb,ccc}}}}}}";
+SELECT NULL::text[]::int[] AS "NULL";
+-- scalar op any/all (array)
+select 33 = any ('{1,2,3}');
+select 33 = any ('{1,2,33}');
+select 33 = all ('{1,2,33}');
+select 33 >= all ('{1,2,33}');
+-- boundary cases
+select null::int >= all ('{1,2,33}');
+select null::int >= all ('{}');
+select null::int >= any ('{}');
+-- cross-datatype
+select 33.4 = any (array[1,2,3]);
+select 33.4 > all (array[1,2,3]);
+-- nulls
+select 33 = any (null::int[]);
+select null::int = any ('{1,2,3}');
+select 33 = any ('{1,null,3}');
+select 33 = any ('{1,null,33}');
+select 33 = all (null::int[]);
+select null::int = all ('{1,2,3}');
+select 33 = all ('{1,null,3}');
+select 33 = all ('{33,null,33}');
+-- nulls later in the bitmap
+SELECT -1 != ALL(ARRAY(SELECT NULLIF(g.i, 900) FROM generate_series(1,1000) g(i)));
+-- test indexes on arrays
+create temp table arr_tbl (f1 int[] unique);
+-- test ON CONFLICT DO UPDATE with arrays
+create temp table arr_pk_tbl (pk int4 primary key, f1 int[]);
+-- test [not] (like|ilike) (any|all) (...)
+select 'foo' like any (array['%a', '%o']); -- t
+select 'foo' like any (array['%a', '%b']); -- f
+select 'foo' like all (array['f%', '%o']); -- t
+select 'foo' like all (array['f%', '%b']); -- f
+select 'foo' not like any (array['%a', '%b']); -- t
+select 'foo' not like all (array['%a', '%o']); -- f
+select 'foo' ilike any (array['%A', '%O']); -- t
+select 'foo' ilike all (array['F%', '%O']); -- t
+--
+-- General array parser tests
+--
+-- none of the following should be accepted
+select '{{1,{2}},{2,3}}'::text[];
+select '{{},{}}'::text[];
+select E'{{1,2},\\{2,3}}'::text[];
+select '{{"1 2" x},{3}}'::text[];
+select '{}}'::text[];
+select '{ }}'::text[];
+-- none of the above should be accepted
+-- all of the following should be accepted
+select '{}'::text[];
+select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[];
+select '{ { "," } , { 3 } }'::text[];
+select ' { { " 0 second " , 0 second } }'::text[];
+select '[0:1]={1.1,2.2}'::float8[];
+-- all of the above should be accepted
+-- tests for array aggregates
+CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]);
+create table comptable (c1 comptype, c2 comptype[]);
+drop table comptable;
+select string_to_array('1|2|3', '|');
+select string_to_array('1|2|3|', '|');
+select string_to_array('1||2|3||', '||');
+select string_to_array('1|2|3', '');
+select string_to_array('', '|');
+select string_to_array('1|2|3', NULL);
+select string_to_array(NULL, '|') IS NULL;
+select string_to_array('abc', '');
+select string_to_array('abc', '', 'abc');
+select string_to_array('abc', ',');
+select string_to_array('abc', ',', 'abc');
+select string_to_array('1,2,3,4,,6', ',');
+select string_to_array('1,2,3,4,,6', ',', '');
+select string_to_array('1,2,3,4,*,6', ',', '*');
+select v, v is null as "is null" from string_to_table('1|2|3', '|') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3|', '|') g(v);
+select v, v is null as "is null" from string_to_table('1||2|3||', '||') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3', '') g(v);
+select v, v is null as "is null" from string_to_table('', '|') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3', NULL) g(v);
+select v, v is null as "is null" from string_to_table(NULL, '|') g(v);
+select v, v is null as "is null" from string_to_table('abc', '') g(v);
+select v, v is null as "is null" from string_to_table('abc', '', 'abc') g(v);
+select v, v is null as "is null" from string_to_table('abc', ',') g(v);
+select v, v is null as "is null" from string_to_table('abc', ',', 'abc') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',', '') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,*,6', ',', '*') g(v);
+select array_to_string(NULL::int4[], ',') IS NULL;
+select array_to_string('{}'::int4[], ',');
+select array_to_string(array[1,2,3,4,NULL,6], ',');
+select array_to_string(array[1,2,3,4,NULL,6], ',', '*');
+select array_to_string(array[1,2,3,4,NULL,6], NULL);
+select array_to_string(array[1,2,3,4,NULL,6], ',', NULL);
+select array_to_string(string_to_array('1|2|3', '|'), '|');
+select array_length(array[1,2,3], 1);
+select array_length(array[[1,2,3], [4,5,6]], 0);
+select array_length(array[[1,2,3], [4,5,6]], 1);
+select array_length(array[[1,2,3], [4,5,6]], 2);
+select array_length(array[[1,2,3], [4,5,6]], 3);
+select cardinality(NULL::int[]);
+select cardinality('{}'::int[]);
+select cardinality(array[1,2,3]);
+select cardinality('[2:4]={5,6,7}'::int[]);
+select cardinality('{{1,2}}'::int[]);
+select cardinality('{{1,2},{3,4},{5,6}}'::int[]);
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
+select array_agg(unique1) from tenk1 where unique1 < -15;
+-- array_agg(anyarray)
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3,4}'::int[])) v(ar);
+select array_agg(ar)
+ from (select array_agg(array[i, i+1, i-1])
+ from generate_series(1,2) a(i)) b(ar);
+select array_agg(array[i+1.2, i+1.3, i+1.4]) from generate_series(1,3) g(i);
+select array_agg(array['Hello', i::text]) from generate_series(9,11) g(i);
+select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i);
+-- errors
+select array_agg('{}'::int[]) from generate_series(1,2);
+select array_agg(null::int[]) from generate_series(1,2);
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3}'::int[])) v(ar);
+select * from unnest(array[1,2,3]);
+-- array(select array-value ...)
+select array(select array[i,i/2] from generate_series(1,5) i);
+select array(select array['Hello', i::text] from generate_series(9,11) i);
+-- Insert/update on a column that is array of composite
+create temp table t1 (f1 int8_tbl[]);
+-- Check that arrays of composites are safely detoasted when needed
+create temp table src (f1 text);
+insert into src
+ select string_agg(random()::text,'') from generate_series(1,10000);
+create temp table dest (f1 textandtext[]);
+drop table src;
+drop table dest;
+-- 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);
+SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail
+SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail
diff --git a/yql/essentials/tests/postgresql/cases/bit.err b/yql/essentials/tests/postgresql/cases/bit.err
new file mode 100644
index 0000000000..1159e1a21f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/bit.err
@@ -0,0 +1,498 @@
+<sql-statement>
+--
+-- BIT types
+--
+--
+-- Build tables for testing
+--
+CREATE TABLE BIT_TABLE(b BIT(11));
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_TABLE VALUES (B'10'); -- too short
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_TABLE VALUES (B'00000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_TABLE VALUES (B'11011000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_TABLE VALUES (B'01010101010');
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long
+</sql-statement>
+<sql-statement>
+--INSERT INTO BIT_TABLE VALUES ('X554');
+--INSERT INTO BIT_TABLE VALUES ('X555');
+SELECT * FROM BIT_TABLE;
+</sql-statement>
+<sql-statement>
+CREATE TABLE VARBIT_TABLE(v BIT VARYING(11));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_TABLE VALUES (B'');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_TABLE VALUES (B'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_TABLE VALUES (B'010101');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long
+</sql-statement>
+<sql-statement>
+--INSERT INTO VARBIT_TABLE VALUES ('X554');
+--INSERT INTO VARBIT_TABLE VALUES ('X555');
+SELECT * FROM VARBIT_TABLE;
+</sql-statement>
+<sql-statement>
+-- Concatenation
+SELECT v, b, (v || b) AS concat
+ FROM BIT_TABLE, VARBIT_TABLE
+ ORDER BY 3;
+</sql-statement>
+<sql-statement>
+-- Length
+SELECT b, length(b) AS lb
+ FROM BIT_TABLE;
+</sql-statement>
+<sql-statement>
+SELECT v, length(v) AS lv
+ FROM VARBIT_TABLE;
+</sql-statement>
+<sql-statement>
+-- Substring
+SELECT b,
+ SUBSTRING(b FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(b FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(b FROM 6) AS sub_6
+ FROM BIT_TABLE;
+</sql-statement>
+<sql-statement>
+SELECT v,
+ SUBSTRING(v FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(v FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(v FROM 6) AS sub_6
+ FROM VARBIT_TABLE;
+</sql-statement>
+<sql-statement>
+-- test overflow cases
+SELECT SUBSTRING('01010101'::bit(8) FROM 2 FOR 2147483646) AS "1010101";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR 2147483646) AS "01010101";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+ ^
+<sql-statement>
+SELECT SUBSTRING('01010101'::varbit FROM 2 FOR 2147483646) AS "1010101";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR 2147483646) AS "01010101";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+ ^
+<sql-statement>
+--- Bit operations
+DROP TABLE varbit_table;
+</sql-statement>
+<sql-statement>
+CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16));
+</sql-statement>
+<sql-statement>
+COPY varbit_table FROM stdin;
+X0F X10
+X1F X11
+X2F X12
+X3F X13
+X8F X04
+X000F X0010
+X0123 XFFFF
+X2468 X2468
+XFA50 X05AF
+X1234 XFFF5
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+SELECT a, b, ~a AS "~ a", a & b AS "a & b",
+ a | b AS "a | b", a # b AS "a # b" FROM varbit_table;
+</sql-statement>
+<sql-statement>
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table;
+</sql-statement>
+<sql-statement>
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table;
+</sql-statement>
+<sql-statement>
+DROP TABLE varbit_table;
+</sql-statement>
+<sql-statement>
+--- Bit operations
+DROP TABLE bit_table;
+</sql-statement>
+<sql-statement>
+CREATE TABLE bit_table (a BIT(16), b BIT(16));
+</sql-statement>
+<sql-statement>
+COPY bit_table FROM stdin;
+X0F00 X1000
+X1F00 X1100
+X2F00 X1200
+X3F00 X1300
+X8F00 X0400
+X000F X0010
+X0123 XFFFF
+X2468 X2468
+XFA50 X05AF
+X1234 XFFF5
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+SELECT a,b,~a AS "~ a",a & b AS "a & b",
+ a|b AS "a | b", a # b AS "a # b" FROM bit_table;
+</sql-statement>
+<sql-statement>
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table;
+</sql-statement>
+<sql-statement>
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table;
+</sql-statement>
+<sql-statement>
+DROP TABLE bit_table;
+</sql-statement>
+<sql-statement>
+-- The following should fail
+select B'001' & B'10';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- The following should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot AND bit strings of different sizes
+
+ -- The following should fail
+ ^
+<sql-statement>
+select B'0111' | B'011';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select B'0111' | B'011';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot OR bit strings of different sizes
+
+ select B'0111' | B'011';
+ ^
+<sql-statement>
+select B'0010' # B'011101';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select B'0010' # B'011101';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot XOR bit strings of different sizes
+
+ select B'0010' # B'011101';
+ ^
+<sql-statement>
+-- More position tests, checking all the boundary cases
+SELECT POSITION(B'1010' IN B'0000101'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1010' IN B'00001010'); -- 5
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1010' IN B'00000101'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1010' IN B'000001010'); -- 6
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'' IN B'00001010'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'0' IN B''); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'' IN B''); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'11101011' IN B'11101011'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'11101011' IN B'011101011'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'11101011' IN B'00011101011'); -- 4
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'11101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'011101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'00011101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0
+</sql-statement>
+<sql-statement>
+-- Shifting
+CREATE TABLE BIT_SHIFT_TABLE(b BIT(16));
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1101' IN b),
+ POSITION(B'11011' IN b),
+ b
+ FROM BIT_SHIFT_TABLE ;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT POSITION(B'1101' IN b),
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: position
+ SELECT POSITION(B'1101' IN b),
+ ^
+<sql-statement>
+SELECT b, b >> 1 AS bsr, b << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+SELECT b, b >> 8 AS bsr8, b << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+SELECT b::bit(15), b::bit(15) >> 1 AS bsr, b::bit(15) << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+SELECT b::bit(15), b::bit(15) >> 8 AS bsr8, b::bit(15) << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+SELECT POSITION(B'1101' IN v),
+ POSITION(B'11011' IN v),
+ v
+ FROM VARBIT_SHIFT_TABLE ;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT POSITION(B'1101' IN v),
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: position
+ SELECT POSITION(B'1101' IN v),
+ ^
+<sql-statement>
+SELECT v, v >> 1 AS vsr, v << 1 AS vsl
+ FROM VARBIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+SELECT v, v >> 8 AS vsr8, v << 8 AS vsl8
+ FROM VARBIT_SHIFT_TABLE ;
+</sql-statement>
+<sql-statement>
+DROP TABLE BIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+DROP TABLE VARBIT_SHIFT_TABLE;
+</sql-statement>
+<sql-statement>
+-- Get/Set bit
+SELECT get_bit(B'0101011000100', 10);
+</sql-statement>
+<sql-statement>
+SELECT set_bit(B'0101011000100100', 15, 1);
+</sql-statement>
+<sql-statement>
+SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bit index 16 out of valid range (0..15)
+
+ SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+ ^
+<sql-statement>
+-- Overlay
+SELECT overlay(B'0101011100' placing '001' from 2 for 3);
+</sql-statement>
+<sql-statement>
+SELECT overlay(B'0101011100' placing '101' from 6);
+</sql-statement>
+<sql-statement>
+SELECT overlay(B'0101011100' placing '001' from 11);
+</sql-statement>
+<sql-statement>
+SELECT overlay(B'0101011100' placing '001' from 20);
+</sql-statement>
+<sql-statement>
+-- bit_count
+SELECT bit_count(B'0101011100'::bit(10));
+</sql-statement>
+<sql-statement>
+SELECT bit_count(B'1111111111'::bit(10));
+</sql-statement>
+<sql-statement>
+-- This table is intentionally left around to exercise pg_dump/pg_upgrade
+CREATE TABLE bit_defaults(
+ b1 bit(4) DEFAULT '1001',
+ b2 bit(4) DEFAULT B'0101',
+ b3 bit varying(5) DEFAULT '1001',
+ b4 bit varying(5) DEFAULT B'0101'
+);
+</sql-statement>
+<sql-statement>
+\d bit_defaults
+</sql-statement>
+Metacommand \d bit_defaults is not supported
+<sql-statement>
+INSERT INTO bit_defaults DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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>
+TABLE bit_defaults;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/bit.out b/yql/essentials/tests/postgresql/cases/bit.out
new file mode 100644
index 0000000000..f62c350304
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/bit.out
@@ -0,0 +1,491 @@
+--
+-- BIT types
+--
+--
+-- Build tables for testing
+--
+CREATE TABLE BIT_TABLE(b BIT(11));
+INSERT INTO BIT_TABLE VALUES (B'00000000000');
+INSERT INTO BIT_TABLE VALUES (B'11011000000');
+INSERT INTO BIT_TABLE VALUES (B'01010101010');
+CREATE TABLE VARBIT_TABLE(v BIT VARYING(11));
+INSERT INTO VARBIT_TABLE VALUES (B'');
+INSERT INTO VARBIT_TABLE VALUES (B'0');
+INSERT INTO VARBIT_TABLE VALUES (B'010101');
+INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
+-- test overflow cases
+SELECT SUBSTRING('01010101'::bit(8) FROM 2 FOR 2147483646) AS "1010101";
+ 1010101
+---------
+ 1010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR 2147483646) AS "01010101";
+ 01010101
+----------
+ 01010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+SELECT SUBSTRING('01010101'::varbit FROM 2 FOR 2147483646) AS "1010101";
+ 1010101
+---------
+ 1010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR 2147483646) AS "01010101";
+ 01010101
+----------
+ 01010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16));
+DROP TABLE varbit_table;
+CREATE TABLE bit_table (a BIT(16), b BIT(16));
+DROP TABLE bit_table;
+-- The following should fail
+select B'001' & B'10';
+ERROR: cannot AND bit strings of different sizes
+select B'0111' | B'011';
+ERROR: cannot OR bit strings of different sizes
+select B'0010' # B'011101';
+ERROR: cannot XOR bit strings of different sizes
+-- More position tests, checking all the boundary cases
+SELECT POSITION(B'1010' IN B'0000101'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'1010' IN B'00001010'); -- 5
+ position
+----------
+ 5
+(1 row)
+
+SELECT POSITION(B'1010' IN B'00000101'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'1010' IN B'000001010'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'' IN B'00001010'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'0' IN B''); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'' IN B''); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5
+ position
+----------
+ 5
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'11101011'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'011101011'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'00011101011'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'11101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14
+ position
+----------
+ 14
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15
+ position
+----------
+ 15
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17
+ position
+----------
+ 17
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19
+ position
+----------
+ 19
+(1 row)
+
+SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+-- Shifting
+CREATE TABLE BIT_SHIFT_TABLE(b BIT(16));
+INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000');
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE;
+SELECT b, b >> 1 AS bsr, b << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr | bsl
+------------------+------------------+------------------
+ 1101100000000000 | 0110110000000000 | 1011000000000000
+ 0110110000000000 | 0011011000000000 | 1101100000000000
+ 0011011000000000 | 0001101100000000 | 0110110000000000
+ 0001101100000000 | 0000110110000000 | 0011011000000000
+ 0000110110000000 | 0000011011000000 | 0001101100000000
+ 0000011011000000 | 0000001101100000 | 0000110110000000
+ 0000001101100000 | 0000000110110000 | 0000011011000000
+ 0000000110110000 | 0000000011011000 | 0000001101100000
+ 0000000011011000 | 0000000001101100 | 0000000110110000
+ 0000000001101100 | 0000000000110110 | 0000000011011000
+ 0000000000110110 | 0000000000011011 | 0000000001101100
+ 0000000000011011 | 0000000000001101 | 0000000000110110
+ 0000000000001101 | 0000000000000110 | 0000000000011010
+ 0000000000000110 | 0000000000000011 | 0000000000001100
+ 0000000000000011 | 0000000000000001 | 0000000000000110
+ 0000000000000001 | 0000000000000000 | 0000000000000010
+(16 rows)
+
+SELECT b, b >> 8 AS bsr8, b << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr8 | bsl8
+------------------+------------------+------------------
+ 1101100000000000 | 0000000011011000 | 0000000000000000
+ 0110110000000000 | 0000000001101100 | 0000000000000000
+ 0011011000000000 | 0000000000110110 | 0000000000000000
+ 0001101100000000 | 0000000000011011 | 0000000000000000
+ 0000110110000000 | 0000000000001101 | 1000000000000000
+ 0000011011000000 | 0000000000000110 | 1100000000000000
+ 0000001101100000 | 0000000000000011 | 0110000000000000
+ 0000000110110000 | 0000000000000001 | 1011000000000000
+ 0000000011011000 | 0000000000000000 | 1101100000000000
+ 0000000001101100 | 0000000000000000 | 0110110000000000
+ 0000000000110110 | 0000000000000000 | 0011011000000000
+ 0000000000011011 | 0000000000000000 | 0001101100000000
+ 0000000000001101 | 0000000000000000 | 0000110100000000
+ 0000000000000110 | 0000000000000000 | 0000011000000000
+ 0000000000000011 | 0000000000000000 | 0000001100000000
+ 0000000000000001 | 0000000000000000 | 0000000100000000
+(16 rows)
+
+SELECT b::bit(15), b::bit(15) >> 1 AS bsr, b::bit(15) << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr | bsl
+-----------------+-----------------+-----------------
+ 110110000000000 | 011011000000000 | 101100000000000
+ 011011000000000 | 001101100000000 | 110110000000000
+ 001101100000000 | 000110110000000 | 011011000000000
+ 000110110000000 | 000011011000000 | 001101100000000
+ 000011011000000 | 000001101100000 | 000110110000000
+ 000001101100000 | 000000110110000 | 000011011000000
+ 000000110110000 | 000000011011000 | 000001101100000
+ 000000011011000 | 000000001101100 | 000000110110000
+ 000000001101100 | 000000000110110 | 000000011011000
+ 000000000110110 | 000000000011011 | 000000001101100
+ 000000000011011 | 000000000001101 | 000000000110110
+ 000000000001101 | 000000000000110 | 000000000011010
+ 000000000000110 | 000000000000011 | 000000000001100
+ 000000000000011 | 000000000000001 | 000000000000110
+ 000000000000001 | 000000000000000 | 000000000000010
+ 000000000000000 | 000000000000000 | 000000000000000
+(16 rows)
+
+SELECT b::bit(15), b::bit(15) >> 8 AS bsr8, b::bit(15) << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr8 | bsl8
+-----------------+-----------------+-----------------
+ 110110000000000 | 000000001101100 | 000000000000000
+ 011011000000000 | 000000000110110 | 000000000000000
+ 001101100000000 | 000000000011011 | 000000000000000
+ 000110110000000 | 000000000001101 | 000000000000000
+ 000011011000000 | 000000000000110 | 100000000000000
+ 000001101100000 | 000000000000011 | 110000000000000
+ 000000110110000 | 000000000000001 | 011000000000000
+ 000000011011000 | 000000000000000 | 101100000000000
+ 000000001101100 | 000000000000000 | 110110000000000
+ 000000000110110 | 000000000000000 | 011011000000000
+ 000000000011011 | 000000000000000 | 001101100000000
+ 000000000001101 | 000000000000000 | 000110100000000
+ 000000000000110 | 000000000000000 | 000011000000000
+ 000000000000011 | 000000000000000 | 000001100000000
+ 000000000000001 | 000000000000000 | 000000100000000
+ 000000000000000 | 000000000000000 | 000000000000000
+(16 rows)
+
+CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20));
+INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011');
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE;
+SELECT v, v >> 1 AS vsr, v << 1 AS vsl
+ FROM VARBIT_SHIFT_TABLE ;
+ v | vsr | vsl
+----------------------+----------------------+----------------------
+ 11011 | 01101 | 10110
+ 011011 | 001101 | 110110
+ 0011011 | 0001101 | 0110110
+ 00011011 | 00001101 | 00110110
+ 000011011 | 000001101 | 000110110
+ 0000011011 | 0000001101 | 0000110110
+ 00000011011 | 00000001101 | 00000110110
+ 000000011011 | 000000001101 | 000000110110
+ 0000000011011 | 0000000001101 | 0000000110110
+ 00000000011011 | 00000000001101 | 00000000110110
+ 000000000011011 | 000000000001101 | 000000000110110
+ 0000000000011011 | 0000000000001101 | 0000000000110110
+ 00000000000011011 | 00000000000001101 | 00000000000110110
+ 000000000000011011 | 000000000000001101 | 000000000000110110
+ 0000000000000011011 | 0000000000000001101 | 0000000000000110110
+ 00000000000000011011 | 00000000000000001101 | 00000000000000110110
+(16 rows)
+
+SELECT v, v >> 8 AS vsr8, v << 8 AS vsl8
+ FROM VARBIT_SHIFT_TABLE ;
+ v | vsr8 | vsl8
+----------------------+----------------------+----------------------
+ 11011 | 00000 | 00000
+ 011011 | 000000 | 000000
+ 0011011 | 0000000 | 0000000
+ 00011011 | 00000000 | 00000000
+ 000011011 | 000000000 | 100000000
+ 0000011011 | 0000000000 | 1100000000
+ 00000011011 | 00000000000 | 01100000000
+ 000000011011 | 000000000000 | 101100000000
+ 0000000011011 | 0000000000000 | 1101100000000
+ 00000000011011 | 00000000000000 | 01101100000000
+ 000000000011011 | 000000000000000 | 001101100000000
+ 0000000000011011 | 0000000000000000 | 0001101100000000
+ 00000000000011011 | 00000000000000000 | 00001101100000000
+ 000000000000011011 | 000000000000000000 | 000001101100000000
+ 0000000000000011011 | 0000000000000000000 | 0000001101100000000
+ 00000000000000011011 | 00000000000000000000 | 00000001101100000000
+(16 rows)
+
+DROP TABLE BIT_SHIFT_TABLE;
+DROP TABLE VARBIT_SHIFT_TABLE;
+-- Get/Set bit
+SELECT get_bit(B'0101011000100', 10);
+ get_bit
+---------
+ 1
+(1 row)
+
+SELECT set_bit(B'0101011000100100', 15, 1);
+ set_bit
+------------------
+ 0101011000100101
+(1 row)
+
+SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+ERROR: bit index 16 out of valid range (0..15)
+-- Overlay
+SELECT overlay(B'0101011100' placing '001' from 2 for 3);
+ overlay
+------------
+ 0001011100
+(1 row)
+
+SELECT overlay(B'0101011100' placing '101' from 6);
+ overlay
+------------
+ 0101010100
+(1 row)
+
+SELECT overlay(B'0101011100' placing '001' from 11);
+ overlay
+---------------
+ 0101011100001
+(1 row)
+
+SELECT overlay(B'0101011100' placing '001' from 20);
+ overlay
+---------------
+ 0101011100001
+(1 row)
+
+-- bit_count
+SELECT bit_count(B'0101011100'::bit(10));
+ bit_count
+-----------
+ 5
+(1 row)
+
+SELECT bit_count(B'1111111111'::bit(10));
+ bit_count
+-----------
+ 10
+(1 row)
+
+-- This table is intentionally left around to exercise pg_dump/pg_upgrade
+CREATE TABLE bit_defaults(
+ b1 bit(4) DEFAULT '1001',
+ b2 bit(4) DEFAULT B'0101',
+ b3 bit varying(5) DEFAULT '1001',
+ b4 bit varying(5) DEFAULT B'0101'
+);
diff --git a/yql/essentials/tests/postgresql/cases/bit.sql b/yql/essentials/tests/postgresql/cases/bit.sql
new file mode 100644
index 0000000000..736b3f7a4d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/bit.sql
@@ -0,0 +1,115 @@
+--
+-- BIT types
+--
+--
+-- Build tables for testing
+--
+CREATE TABLE BIT_TABLE(b BIT(11));
+INSERT INTO BIT_TABLE VALUES (B'00000000000');
+INSERT INTO BIT_TABLE VALUES (B'11011000000');
+INSERT INTO BIT_TABLE VALUES (B'01010101010');
+CREATE TABLE VARBIT_TABLE(v BIT VARYING(11));
+INSERT INTO VARBIT_TABLE VALUES (B'');
+INSERT INTO VARBIT_TABLE VALUES (B'0');
+INSERT INTO VARBIT_TABLE VALUES (B'010101');
+INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
+-- test overflow cases
+SELECT SUBSTRING('01010101'::bit(8) FROM 2 FOR 2147483646) AS "1010101";
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR 2147483646) AS "01010101";
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+SELECT SUBSTRING('01010101'::varbit FROM 2 FOR 2147483646) AS "1010101";
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR 2147483646) AS "01010101";
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16));
+DROP TABLE varbit_table;
+CREATE TABLE bit_table (a BIT(16), b BIT(16));
+DROP TABLE bit_table;
+-- The following should fail
+select B'001' & B'10';
+select B'0111' | B'011';
+select B'0010' # B'011101';
+-- More position tests, checking all the boundary cases
+SELECT POSITION(B'1010' IN B'0000101'); -- 0
+SELECT POSITION(B'1010' IN B'00001010'); -- 5
+SELECT POSITION(B'1010' IN B'00000101'); -- 0
+SELECT POSITION(B'1010' IN B'000001010'); -- 6
+SELECT POSITION(B'' IN B'00001010'); -- 1
+SELECT POSITION(B'0' IN B''); -- 0
+SELECT POSITION(B'' IN B''); -- 0
+SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3
+SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3
+SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3
+SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5
+SELECT POSITION(B'11101011' IN B'11101011'); -- 1
+SELECT POSITION(B'11101011' IN B'011101011'); -- 2
+SELECT POSITION(B'11101011' IN B'00011101011'); -- 4
+SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+SELECT POSITION(B'111010110' IN B'11101011'); -- 0
+SELECT POSITION(B'111010110' IN B'011101011'); -- 0
+SELECT POSITION(B'111010110' IN B'00011101011'); -- 0
+SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14
+SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15
+SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17
+SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19
+SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1
+SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2
+SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0
+-- Shifting
+CREATE TABLE BIT_SHIFT_TABLE(b BIT(16));
+INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000');
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE;
+SELECT b, b >> 1 AS bsr, b << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+SELECT b, b >> 8 AS bsr8, b << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+SELECT b::bit(15), b::bit(15) >> 1 AS bsr, b::bit(15) << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+SELECT b::bit(15), b::bit(15) >> 8 AS bsr8, b::bit(15) << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20));
+INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011');
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE;
+SELECT v, v >> 1 AS vsr, v << 1 AS vsl
+ FROM VARBIT_SHIFT_TABLE ;
+SELECT v, v >> 8 AS vsr8, v << 8 AS vsl8
+ FROM VARBIT_SHIFT_TABLE ;
+DROP TABLE BIT_SHIFT_TABLE;
+DROP TABLE VARBIT_SHIFT_TABLE;
+-- Get/Set bit
+SELECT get_bit(B'0101011000100', 10);
+SELECT set_bit(B'0101011000100100', 15, 1);
+SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+-- Overlay
+SELECT overlay(B'0101011100' placing '001' from 2 for 3);
+SELECT overlay(B'0101011100' placing '101' from 6);
+SELECT overlay(B'0101011100' placing '001' from 11);
+SELECT overlay(B'0101011100' placing '001' from 20);
+-- bit_count
+SELECT bit_count(B'0101011100'::bit(10));
+SELECT bit_count(B'1111111111'::bit(10));
+-- This table is intentionally left around to exercise pg_dump/pg_upgrade
+CREATE TABLE bit_defaults(
+ b1 bit(4) DEFAULT '1001',
+ b2 bit(4) DEFAULT B'0101',
+ b3 bit varying(5) DEFAULT '1001',
+ b4 bit varying(5) DEFAULT B'0101'
+);
diff --git a/yql/essentials/tests/postgresql/cases/boolean.err b/yql/essentials/tests/postgresql/cases/boolean.err
new file mode 100644
index 0000000000..60a444e2d1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/boolean.err
@@ -0,0 +1,510 @@
+<sql-statement>
+--
+-- BOOLEAN
+--
+--
+-- sanity check - if this fails go insane!
+--
+SELECT 1 AS one;
+</sql-statement>
+<sql-statement>
+-- ******************testing built-in type bool********************
+-- check bool input syntax
+SELECT true AS true;
+</sql-statement>
+<sql-statement>
+SELECT false AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool ' f ' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'true' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'test' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'test' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "test"
+
+ SELECT bool 'test' AS error;
+ ^
+<sql-statement>
+SELECT bool 'false' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'foo' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'foo' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "foo"
+
+ SELECT bool 'foo' AS error;
+ ^
+<sql-statement>
+SELECT bool 'y' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'yes' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'yeah' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'yeah' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "yeah"
+
+ SELECT bool 'yeah' AS error;
+ ^
+<sql-statement>
+SELECT bool 'n' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'no' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'nay' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'nay' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "nay"
+
+ SELECT bool 'nay' AS error;
+ ^
+<sql-statement>
+SELECT bool 'on' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'off' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'of' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 'o' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'o' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "o"
+
+ SELECT bool 'o' AS error;
+ ^
+<sql-statement>
+SELECT bool 'on_' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'on_' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "on_"
+
+ SELECT bool 'on_' AS error;
+ ^
+<sql-statement>
+SELECT bool 'off_' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool 'off_' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "off_"
+
+ SELECT bool 'off_' AS error;
+ ^
+<sql-statement>
+SELECT bool '1' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool '11' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool '11' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "11"
+
+ SELECT bool '11' AS error;
+ ^
+<sql-statement>
+SELECT bool '0' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool '000' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool '000' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "000"
+
+ SELECT bool '000' AS error;
+ ^
+<sql-statement>
+SELECT bool '' AS error;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT bool '' AS error;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: ""
+
+ SELECT bool '' AS error;
+ ^
+<sql-statement>
+-- and, or, not in qualifications
+SELECT bool 't' or bool 'f' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' and bool 'f' AS false;
+</sql-statement>
+<sql-statement>
+SELECT not bool 'f' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' = bool 'f' AS false;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' <> bool 'f' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' > bool 'f' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 't' >= bool 'f' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'f' < bool 't' AS true;
+</sql-statement>
+<sql-statement>
+SELECT bool 'f' <= bool 't' AS true;
+</sql-statement>
+<sql-statement>
+-- explicit casts to/from text
+SELECT 'TrUe'::text::boolean AS true, 'fAlse'::text::boolean AS false;
+</sql-statement>
+<sql-statement>
+SELECT ' true '::text::boolean AS true,
+ ' FALSE'::text::boolean AS false;
+</sql-statement>
+<sql-statement>
+SELECT true::boolean::text AS true, false::boolean::text AS false;
+</sql-statement>
+<sql-statement>
+SELECT ' tru e '::text::boolean AS invalid; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ' tru e '::text::boolean AS invalid; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: " tru e "
+
+ SELECT ' tru e '::text::boolean AS invalid; -- error
+ ^
+<sql-statement>
+SELECT ''::text::boolean AS invalid; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ''::text::boolean AS invalid; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: ""
+
+ SELECT ''::text::boolean AS invalid; -- error
+ ^
+<sql-statement>
+CREATE TABLE BOOLTBL1 (f1 bool);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 't');
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'True');
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'true');
+</sql-statement>
+<sql-statement>
+-- BOOLTBL1 should be full of true's at this point
+SELECT BOOLTBL1.* FROM BOOLTBL1;
+</sql-statement>
+<sql-statement>
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'true';
+</sql-statement>
+<sql-statement>
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 <> bool 'false';
+</sql-statement>
+<sql-statement>
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE booleq(bool 'false', f1);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'f');
+</sql-statement>
+<sql-statement>
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'false';
+</sql-statement>
+<sql-statement>
+CREATE TABLE BOOLTBL2 (f1 bool);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'f');
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'false');
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False');
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
+</sql-statement>
+<sql-statement>
+-- This is now an invalid expression
+-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
+INSERT INTO BOOLTBL2 (f1)
+ VALUES (bool 'XXX');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- This is now an invalid expression
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type boolean: "XXX"
+
+ -- This is now an invalid expression
+ ^
+<sql-statement>
+-- BOOLTBL2 should be full of false's at this point
+SELECT BOOLTBL2.* FROM BOOLTBL2;
+</sql-statement>
+<sql-statement>
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 <> BOOLTBL1.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+<sql-statement>
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE boolne(BOOLTBL2.f1,BOOLTBL1.f1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+<sql-statement>
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 and BOOLTBL1.f1 = bool 'false';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+<sql-statement>
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 or BOOLTBL1.f1 = bool 'true'
+ ORDER BY BOOLTBL1.f1, BOOLTBL2.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT BOOLTBL1.*, BOOLTBL2.*
+ ^
+<sql-statement>
+--
+-- SQL syntax
+-- Try all combinations to ensure that we get nothing when we expect nothing
+-- - thomas 2000-01-04
+--
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS TRUE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT FALSE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS FALSE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT TRUE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS TRUE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT FALSE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS FALSE;
+</sql-statement>
+<sql-statement>
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT TRUE;
+</sql-statement>
+<sql-statement>
+--
+-- Tests for BooleanTest
+--
+CREATE TABLE BOOLTBL3 (d text, b bool, o int);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('true', true, 1);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('false', false, 2);
+</sql-statement>
+<sql-statement>
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
+</sql-statement>
+<sql-statement>
+SELECT
+ d,
+ b IS TRUE AS istrue,
+ b IS NOT TRUE AS isnottrue,
+ b IS FALSE AS isfalse,
+ b IS NOT FALSE AS isnotfalse,
+ b IS UNKNOWN AS isunknown,
+ b IS NOT UNKNOWN AS isnotunknown
+FROM booltbl3 ORDER BY o;
+</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.booltbl3
+
+<sql-statement>
+-- Test to make sure short-circuiting and NULL handling is
+-- correct. Use a table as source to prevent constant simplification
+-- to interfer.
+CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+</sql-statement>
+<sql-statement>
+INSERT INTO booltbl4 VALUES (false, true, null);
+</sql-statement>
+<sql-statement>
+\pset null '(null)'
+</sql-statement>
+<sql-statement>
+-- AND expression need to return null if there's any nulls and not all
+-- of the value are true
+SELECT istrue AND isnul AND istrue FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT istrue AND istrue AND isnul FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isnul AND istrue AND istrue FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+</sql-statement>
+<sql-statement>
+-- OR expression need to return null if there's any nulls and none
+-- of the value is true
+SELECT isfalse OR isnul OR isfalse FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isfalse OR isfalse OR isnul FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+</sql-statement>
+<sql-statement>
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+</sql-statement>
+<sql-statement>
+--
+-- Clean up
+-- Many tables are retained by the regression test, but these do not seem
+-- particularly useful so just get rid of them for now.
+-- - thomas 1997-11-30
+--
+DROP TABLE BOOLTBL1;
+</sql-statement>
+<sql-statement>
+DROP TABLE BOOLTBL2;
+</sql-statement>
+<sql-statement>
+DROP TABLE BOOLTBL3;
+</sql-statement>
+<sql-statement>
+DROP TABLE BOOLTBL4;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/boolean.out b/yql/essentials/tests/postgresql/cases/boolean.out
new file mode 100644
index 0000000000..97dddd3456
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/boolean.out
@@ -0,0 +1,469 @@
+--
+-- BOOLEAN
+--
+--
+-- sanity check - if this fails go insane!
+--
+SELECT 1 AS one;
+ one
+-----
+ 1
+(1 row)
+
+-- ******************testing built-in type bool********************
+-- check bool input syntax
+SELECT true AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT false AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool ' f ' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'true' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'test' AS error;
+ERROR: invalid input syntax for type boolean: "test"
+LINE 1: SELECT bool 'test' AS error;
+ ^
+SELECT bool 'false' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'foo' AS error;
+ERROR: invalid input syntax for type boolean: "foo"
+LINE 1: SELECT bool 'foo' AS error;
+ ^
+SELECT bool 'y' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'yes' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'yeah' AS error;
+ERROR: invalid input syntax for type boolean: "yeah"
+LINE 1: SELECT bool 'yeah' AS error;
+ ^
+SELECT bool 'n' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'no' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'nay' AS error;
+ERROR: invalid input syntax for type boolean: "nay"
+LINE 1: SELECT bool 'nay' AS error;
+ ^
+SELECT bool 'on' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'off' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'of' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'o' AS error;
+ERROR: invalid input syntax for type boolean: "o"
+LINE 1: SELECT bool 'o' AS error;
+ ^
+SELECT bool 'on_' AS error;
+ERROR: invalid input syntax for type boolean: "on_"
+LINE 1: SELECT bool 'on_' AS error;
+ ^
+SELECT bool 'off_' AS error;
+ERROR: invalid input syntax for type boolean: "off_"
+LINE 1: SELECT bool 'off_' AS error;
+ ^
+SELECT bool '1' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool '11' AS error;
+ERROR: invalid input syntax for type boolean: "11"
+LINE 1: SELECT bool '11' AS error;
+ ^
+SELECT bool '0' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool '000' AS error;
+ERROR: invalid input syntax for type boolean: "000"
+LINE 1: SELECT bool '000' AS error;
+ ^
+SELECT bool '' AS error;
+ERROR: invalid input syntax for type boolean: ""
+LINE 1: SELECT bool '' AS error;
+ ^
+-- and, or, not in qualifications
+SELECT bool 't' or bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' and bool 'f' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT not bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' = bool 'f' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 't' <> bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' > bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' >= bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'f' < bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'f' <= bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+-- explicit casts to/from text
+SELECT 'TrUe'::text::boolean AS true, 'fAlse'::text::boolean AS false;
+ true | false
+------+-------
+ t | f
+(1 row)
+
+SELECT ' true '::text::boolean AS true,
+ ' FALSE'::text::boolean AS false;
+ true | false
+------+-------
+ t | f
+(1 row)
+
+SELECT true::boolean::text AS true, false::boolean::text AS false;
+ true | false
+------+-------
+ true | false
+(1 row)
+
+SELECT ' tru e '::text::boolean AS invalid; -- error
+ERROR: invalid input syntax for type boolean: " tru e "
+SELECT ''::text::boolean AS invalid; -- error
+ERROR: invalid input syntax for type boolean: ""
+CREATE TABLE BOOLTBL1 (f1 bool);
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 't');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'True');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'true');
+-- BOOLTBL1 should be full of true's at this point
+SELECT BOOLTBL1.* FROM BOOLTBL1;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'true';
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 <> bool 'false';
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE booleq(bool 'false', f1);
+ f1
+----
+(0 rows)
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'f');
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'false';
+ f1
+----
+ f
+(1 row)
+
+CREATE TABLE BOOLTBL2 (f1 bool);
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'f');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'false');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
+-- This is now an invalid expression
+-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
+INSERT INTO BOOLTBL2 (f1)
+ VALUES (bool 'XXX');
+ERROR: invalid input syntax for type boolean: "XXX"
+LINE 2: VALUES (bool 'XXX');
+ ^
+-- BOOLTBL2 should be full of false's at this point
+SELECT BOOLTBL2.* FROM BOOLTBL2;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+--
+-- SQL syntax
+-- Try all combinations to ensure that we get nothing when we expect nothing
+-- - thomas 2000-01-04
+--
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS TRUE;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT FALSE;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS FALSE;
+ f1
+----
+ f
+(1 row)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT TRUE;
+ f1
+----
+ f
+(1 row)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS TRUE;
+ f1
+----
+(0 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT FALSE;
+ f1
+----
+(0 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS FALSE;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT TRUE;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+--
+-- Tests for BooleanTest
+--
+CREATE TABLE BOOLTBL3 (d text, b bool, o int);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('true', true, 1);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('false', false, 2);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
+-- Test to make sure short-circuiting and NULL handling is
+-- correct. Use a table as source to prevent constant simplification
+-- to interfer.
+CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+INSERT INTO booltbl4 VALUES (false, true, null);
+\pset null '(null)'
+-- AND expression need to return null if there's any nulls and not all
+-- of the value are true
+SELECT istrue AND isnul AND istrue FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT istrue AND istrue AND isnul FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isnul AND istrue AND istrue FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+-- OR expression need to return null if there's any nulls and none
+-- of the value is true
+SELECT isfalse OR isnul OR isfalse FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse OR isfalse OR isnul FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Clean up
+-- Many tables are retained by the regression test, but these do not seem
+-- particularly useful so just get rid of them for now.
+-- - thomas 1997-11-30
+--
+DROP TABLE BOOLTBL1;
+DROP TABLE BOOLTBL2;
+DROP TABLE BOOLTBL3;
diff --git a/yql/essentials/tests/postgresql/cases/boolean.sql b/yql/essentials/tests/postgresql/cases/boolean.sql
new file mode 100644
index 0000000000..99fb18dd23
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/boolean.sql
@@ -0,0 +1,148 @@
+--
+-- BOOLEAN
+--
+--
+-- sanity check - if this fails go insane!
+--
+SELECT 1 AS one;
+-- ******************testing built-in type bool********************
+-- check bool input syntax
+SELECT true AS true;
+SELECT false AS false;
+SELECT bool 't' AS true;
+SELECT bool ' f ' AS false;
+SELECT bool 'true' AS true;
+SELECT bool 'test' AS error;
+SELECT bool 'false' AS false;
+SELECT bool 'foo' AS error;
+SELECT bool 'y' AS true;
+SELECT bool 'yes' AS true;
+SELECT bool 'yeah' AS error;
+SELECT bool 'n' AS false;
+SELECT bool 'no' AS false;
+SELECT bool 'nay' AS error;
+SELECT bool 'on' AS true;
+SELECT bool 'off' AS false;
+SELECT bool 'of' AS false;
+SELECT bool 'o' AS error;
+SELECT bool 'on_' AS error;
+SELECT bool 'off_' AS error;
+SELECT bool '1' AS true;
+SELECT bool '11' AS error;
+SELECT bool '0' AS false;
+SELECT bool '000' AS error;
+SELECT bool '' AS error;
+-- and, or, not in qualifications
+SELECT bool 't' or bool 'f' AS true;
+SELECT bool 't' and bool 'f' AS false;
+SELECT not bool 'f' AS true;
+SELECT bool 't' = bool 'f' AS false;
+SELECT bool 't' <> bool 'f' AS true;
+SELECT bool 't' > bool 'f' AS true;
+SELECT bool 't' >= bool 'f' AS true;
+SELECT bool 'f' < bool 't' AS true;
+SELECT bool 'f' <= bool 't' AS true;
+-- explicit casts to/from text
+SELECT 'TrUe'::text::boolean AS true, 'fAlse'::text::boolean AS false;
+SELECT ' true '::text::boolean AS true,
+ ' FALSE'::text::boolean AS false;
+SELECT true::boolean::text AS true, false::boolean::text AS false;
+SELECT ' tru e '::text::boolean AS invalid; -- error
+SELECT ''::text::boolean AS invalid; -- error
+CREATE TABLE BOOLTBL1 (f1 bool);
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 't');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'True');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'true');
+-- BOOLTBL1 should be full of true's at this point
+SELECT BOOLTBL1.* FROM BOOLTBL1;
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'true';
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 <> bool 'false';
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE booleq(bool 'false', f1);
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'f');
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'false';
+CREATE TABLE BOOLTBL2 (f1 bool);
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'f');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'false');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
+-- This is now an invalid expression
+-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
+INSERT INTO BOOLTBL2 (f1)
+ VALUES (bool 'XXX');
+-- BOOLTBL2 should be full of false's at this point
+SELECT BOOLTBL2.* FROM BOOLTBL2;
+--
+-- SQL syntax
+-- Try all combinations to ensure that we get nothing when we expect nothing
+-- - thomas 2000-01-04
+--
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS TRUE;
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT FALSE;
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS FALSE;
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT TRUE;
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS TRUE;
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT FALSE;
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS FALSE;
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT TRUE;
+--
+-- Tests for BooleanTest
+--
+CREATE TABLE BOOLTBL3 (d text, b bool, o int);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('true', true, 1);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('false', false, 2);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
+-- Test to make sure short-circuiting and NULL handling is
+-- correct. Use a table as source to prevent constant simplification
+-- to interfer.
+CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+INSERT INTO booltbl4 VALUES (false, true, null);
+\pset null '(null)'
+-- AND expression need to return null if there's any nulls and not all
+-- of the value are true
+SELECT istrue AND isnul AND istrue FROM booltbl4;
+SELECT istrue AND istrue AND isnul FROM booltbl4;
+SELECT isnul AND istrue AND istrue FROM booltbl4;
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+-- OR expression need to return null if there's any nulls and none
+-- of the value is true
+SELECT isfalse OR isnul OR isfalse FROM booltbl4;
+SELECT isfalse OR isfalse OR isnul FROM booltbl4;
+SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+--
+-- Clean up
+-- Many tables are retained by the regression test, but these do not seem
+-- particularly useful so just get rid of them for now.
+-- - thomas 1997-11-30
+--
+DROP TABLE BOOLTBL1;
+DROP TABLE BOOLTBL2;
+DROP TABLE BOOLTBL3;
diff --git a/yql/essentials/tests/postgresql/cases/case.err b/yql/essentials/tests/postgresql/cases/case.err
new file mode 100644
index 0000000000..d5d8e45f36
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/case.err
@@ -0,0 +1,469 @@
+<sql-statement>
+--
+-- CASE
+-- Test the case statement
+--
+CREATE TABLE CASE_TBL (
+ i integer,
+ f double precision
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE CASE2_TBL (
+ i integer,
+ j integer
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE_TBL VALUES (1, 10.1);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE_TBL VALUES (2, 20.2);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE_TBL VALUES (3, -30.3);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE_TBL VALUES (4, NULL);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (1, -1);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (2, -2);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (3, -3);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (2, -4);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (1, NULL);
+</sql-statement>
+<sql-statement>
+INSERT INTO CASE2_TBL VALUES (NULL, -6);
+</sql-statement>
+<sql-statement>
+--
+-- Simplest examples without tables
+--
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ END AS "Simple WHEN";
+</sql-statement>
+<sql-statement>
+SELECT '<NULL>' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ END AS "Simple default";
+</sql-statement>
+<sql-statement>
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ ELSE 4
+ END AS "Simple ELSE";
+</sql-statement>
+<sql-statement>
+SELECT '4' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ ELSE 4
+ END AS "ELSE default";
+</sql-statement>
+<sql-statement>
+SELECT '6' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ WHEN 4 < 5 THEN 6
+ ELSE 7
+ END AS "Two WHEN with default";
+</sql-statement>
+<sql-statement>
+SELECT '7' AS "None",
+ CASE WHEN random() < 0 THEN 1
+ END AS "NULL on no matches";
+</sql-statement>
+<sql-statement>
+-- Constant-expression folding shouldn't evaluate unreachable subexpressions
+SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
+</sql-statement>
+<sql-statement>
+SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END;
+</sql-statement>
+<sql-statement>
+-- However we do not currently suppress folding of potentially
+-- reachable subexpressions
+SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl;
+</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.case_tbl
+
+<sql-statement>
+-- Test for cases involving untyped literals in test expression
+SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+</sql-statement>
+<sql-statement>
+--
+-- Examples of targets involving tables
+--
+SELECT
+ CASE
+ WHEN i >= 3 THEN i
+ END AS ">= 3 or Null"
+ FROM CASE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT
+ CASE WHEN i >= 3 THEN (i + i)
+ ELSE i
+ END AS "Simplest Math"
+ FROM CASE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT i AS "Value",
+ CASE WHEN (i < 0) THEN 'small'
+ WHEN (i = 0) THEN 'zero'
+ WHEN (i = 1) THEN 'one'
+ WHEN (i = 2) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT
+ CASE WHEN ((i < 0) or (i < 0)) THEN 'small'
+ WHEN ((i = 0) or (i = 0)) THEN 'zero'
+ WHEN ((i = 1) or (i = 1)) THEN 'one'
+ WHEN ((i = 2) or (i = 2)) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Examples of qualifications involving tables
+--
+--
+-- NULLIF() and COALESCE()
+-- Shorthand forms for typical CASE constructs
+-- defined in the SQL standard.
+--
+SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
+</sql-statement>
+<sql-statement>
+SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2;
+</sql-statement>
+<sql-statement>
+SELECT COALESCE(a.f, b.i, b.j)
+ FROM CASE_TBL a, CASE2_TBL b;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(a.f, b.i, b.j) = 2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ SELECT *
+ ^
+<sql-statement>
+SELECT NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
+ NULLIF(b.i, 4) AS "NULLIF(b.i,4)"
+ FROM CASE_TBL a, CASE2_TBL b;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(f,b.i) = 2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ SELECT *
+ ^
+<sql-statement>
+-- Tests for constant subexpression simplification
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 2) = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Tests for constant subexpression simplification
+ ^
+<sql-statement>
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 1) IS NOT NULL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, null) = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- Examples of updates involving tables
+--
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 3 THEN (- i)
+ ELSE (2 * i) END;
+</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 CASE_TBL;
+</sql-statement>
+<sql-statement>
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 2 THEN (2 * i)
+ ELSE (3 * i) END;
+</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 CASE_TBL;
+</sql-statement>
+<sql-statement>
+UPDATE CASE_TBL
+ SET i = CASE WHEN b.i >= 2 THEN (2 * j)
+ ELSE (3 * j) END
+ FROM CASE2_TBL b
+ WHERE j = -CASE_TBL.i;
+</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 CASE_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Nested CASE expressions
+--
+-- This test exercises a bug caused by aliasing econtext->caseValue_isNull
+-- with the isNull argument of the inner CASE's CaseExpr evaluation. After
+-- evaluating the vol(null) expression in the inner CASE's second WHEN-clause,
+-- the isNull flag for the case test value incorrectly became true, causing
+-- the third WHEN-clause not to match. The volatile function calls are needed
+-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE FUNCTION vol(text) returns text as
+ 'begin return $1; end' language plpgsql volatile;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION vol(text) returns text as
+ ^
+<sql-statement>
+SELECT CASE
+ (CASE vol('bar')
+ WHEN 'foo' THEN 'it was foo!'
+ WHEN vol(null) THEN 'null input'
+ WHEN 'bar' THEN 'it was bar!' END
+ )
+ WHEN 'it was foo!' THEN 'foo recognized'
+ WHEN 'it was bar!' THEN 'bar recognized'
+ ELSE 'unrecognized' END;
+</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 CASE
+ ^
+ -stdin-:<main>:1:8: Error: At function: If, At function: Or, At function: Coalesce, At function: FromPg, At function: PgOp
+ SELECT CASE
+ ^
+ -stdin-:<main>:2:4: Error: At function: If, At function: Or
+ (CASE vol('bar')
+ ^
+ -stdin-:<main>:2:4: Error: At function: Coalesce, At function: FromPg, At function: PgOp
+ (CASE vol('bar')
+ ^
+ -stdin-:<main>:2:9: Error: At function: PgCall
+ (CASE vol('bar')
+ ^
+ -stdin-:<main>:2:9: Error: No such proc: vol
+ (CASE vol('bar')
+ ^
+ -stdin-:<main>:2:4: Error: At function: Coalesce, At function: FromPg, At function: PgOp
+ (CASE vol('bar')
+ ^
+ -stdin-:<main>:4:10: Error: At function: PgCall
+ WHEN vol(null) THEN 'null input'
+ ^
+ -stdin-:<main>:4:10: Error: No such proc: vol
+ WHEN vol(null) THEN 'null input'
+ ^
+<sql-statement>
+-- In this case, we can't inline the SQL function without confusing things.
+CREATE DOMAIN foodomain AS text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ -- In this case, we can't inline the SQL function without confusing things.
+ ^
+<sql-statement>
+CREATE FUNCTION volfoo(text) returns foodomain as
+ 'begin return $1::foodomain; end' language plpgsql volatile;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION volfoo(text) returns foodomain as
+ ^
+<sql-statement>
+CREATE FUNCTION inline_eq(foodomain, foodomain) returns boolean as
+ 'SELECT CASE $2::text WHEN $1::text THEN true ELSE false END' language sql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION inline_eq(foodomain, foodomain) returns boolean as
+ ^
+<sql-statement>
+CREATE OPERATOR = (procedure = inline_eq,
+ leftarg = foodomain, rightarg = foodomain);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE OPERATOR = (procedure = inline_eq,
+ ^
+<sql-statement>
+SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo' END;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:39: Error: Unknown type: foodomain
+ SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo' END;
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+-- Test multiple evaluation of a CASE arg that is a read/write object (#14472)
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE DOMAIN arrdomain AS int[];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN arrdomain AS int[];
+ ^
+<sql-statement>
+CREATE FUNCTION make_ad(int,int) returns arrdomain as
+ 'declare x arrdomain;
+ begin
+ x := array[$1,$2];
+ return x;
+ end' language plpgsql volatile;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION make_ad(int,int) returns arrdomain as
+ ^
+<sql-statement>
+CREATE FUNCTION ad_eq(arrdomain, arrdomain) returns boolean as
+ 'begin return array_eq($1, $2); end' language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION ad_eq(arrdomain, arrdomain) returns boolean as
+ ^
+<sql-statement>
+CREATE OPERATOR = (procedure = ad_eq,
+ leftarg = arrdomain, rightarg = arrdomain);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE OPERATOR = (procedure = ad_eq,
+ ^
+<sql-statement>
+SELECT CASE make_ad(1,2)
+ WHEN array[2,4]::arrdomain THEN 'wrong'
+ WHEN array[2,5]::arrdomain THEN 'still wrong'
+ WHEN array[1,2]::arrdomain THEN 'right'
+ END;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:20: Error: Unknown type: arrdomain
+ WHEN array[2,4]::arrdomain THEN 'wrong'
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+-- Test interaction of CASE with ArrayCoerceExpr (bug #15471)
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE TYPE casetestenum AS ENUM ('e', 'f', 'g');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 315
+ CREATE TYPE casetestenum AS ENUM ('e', 'f', 'g');
+ ^
+<sql-statement>
+SELECT
+ CASE 'foo'::text
+ WHEN 'foo' THEN ARRAY['a', 'b', 'c', 'd'] || enum_range(NULL::casetestenum)::text[]
+ ELSE ARRAY['x', 'y']
+ END;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:67: Error: Unknown type: casetestenum
+ WHEN 'foo' THEN ARRAY['a', 'b', 'c', 'd'] || enum_range(NULL::casetestenum)::text[]
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+--
+-- Clean up
+--
+DROP TABLE CASE_TBL;
+</sql-statement>
+<sql-statement>
+DROP TABLE CASE2_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/case.out b/yql/essentials/tests/postgresql/cases/case.out
new file mode 100644
index 0000000000..3678f04f17
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/case.out
@@ -0,0 +1,269 @@
+--
+-- CASE
+-- Test the case statement
+--
+CREATE TABLE CASE_TBL (
+ i integer,
+ f double precision
+);
+CREATE TABLE CASE2_TBL (
+ i integer,
+ j integer
+);
+INSERT INTO CASE_TBL VALUES (1, 10.1);
+INSERT INTO CASE_TBL VALUES (2, 20.2);
+INSERT INTO CASE_TBL VALUES (3, -30.3);
+INSERT INTO CASE_TBL VALUES (4, NULL);
+INSERT INTO CASE2_TBL VALUES (1, -1);
+INSERT INTO CASE2_TBL VALUES (2, -2);
+INSERT INTO CASE2_TBL VALUES (3, -3);
+INSERT INTO CASE2_TBL VALUES (2, -4);
+INSERT INTO CASE2_TBL VALUES (1, NULL);
+INSERT INTO CASE2_TBL VALUES (NULL, -6);
+--
+-- Simplest examples without tables
+--
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ END AS "Simple WHEN";
+ One | Simple WHEN
+-----+-------------
+ 3 | 3
+(1 row)
+
+SELECT '<NULL>' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ END AS "Simple default";
+ One | Simple default
+--------+----------------
+ <NULL> |
+(1 row)
+
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ ELSE 4
+ END AS "Simple ELSE";
+ One | Simple ELSE
+-----+-------------
+ 3 | 3
+(1 row)
+
+SELECT '4' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ ELSE 4
+ END AS "ELSE default";
+ One | ELSE default
+-----+--------------
+ 4 | 4
+(1 row)
+
+SELECT '6' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ WHEN 4 < 5 THEN 6
+ ELSE 7
+ END AS "Two WHEN with default";
+ One | Two WHEN with default
+-----+-----------------------
+ 6 | 6
+(1 row)
+
+SELECT '7' AS "None",
+ CASE WHEN random() < 0 THEN 1
+ END AS "NULL on no matches";
+ None | NULL on no matches
+------+--------------------
+ 7 |
+(1 row)
+
+-- Constant-expression folding shouldn't evaluate unreachable subexpressions
+SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
+ case
+------
+ 1
+(1 row)
+
+SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END;
+ case
+------
+ 1
+(1 row)
+
+-- Test for cases involving untyped literals in test expression
+SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+ case
+------
+ 1
+(1 row)
+
+--
+-- Examples of targets involving tables
+--
+SELECT
+ CASE
+ WHEN i >= 3 THEN i
+ END AS ">= 3 or Null"
+ FROM CASE_TBL;
+ >= 3 or Null
+--------------
+
+
+ 3
+ 4
+(4 rows)
+
+SELECT
+ CASE WHEN i >= 3 THEN (i + i)
+ ELSE i
+ END AS "Simplest Math"
+ FROM CASE_TBL;
+ Simplest Math
+---------------
+ 1
+ 2
+ 6
+ 8
+(4 rows)
+
+SELECT i AS "Value",
+ CASE WHEN (i < 0) THEN 'small'
+ WHEN (i = 0) THEN 'zero'
+ WHEN (i = 1) THEN 'one'
+ WHEN (i = 2) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+ Value | Category
+-------+----------
+ 1 | one
+ 2 | two
+ 3 | big
+ 4 | big
+(4 rows)
+
+SELECT
+ CASE WHEN ((i < 0) or (i < 0)) THEN 'small'
+ WHEN ((i = 0) or (i = 0)) THEN 'zero'
+ WHEN ((i = 1) or (i = 1)) THEN 'one'
+ WHEN ((i = 2) or (i = 2)) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+ Category
+----------
+ one
+ two
+ big
+ big
+(4 rows)
+
+--
+-- Examples of qualifications involving tables
+--
+--
+-- NULLIF() and COALESCE()
+-- Shorthand forms for typical CASE constructs
+-- defined in the SQL standard.
+--
+SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
+ i | f
+---+---
+ 4 |
+(1 row)
+
+SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2;
+ i | f
+---+---
+(0 rows)
+
+SELECT COALESCE(a.f, b.i, b.j)
+ FROM CASE_TBL a, CASE2_TBL b;
+ coalesce
+----------
+ 10.1
+ 20.2
+ -30.3
+ 1
+ 10.1
+ 20.2
+ -30.3
+ 2
+ 10.1
+ 20.2
+ -30.3
+ 3
+ 10.1
+ 20.2
+ -30.3
+ 2
+ 10.1
+ 20.2
+ -30.3
+ 1
+ 10.1
+ 20.2
+ -30.3
+ -6
+(24 rows)
+
+SELECT NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
+ NULLIF(b.i, 4) AS "NULLIF(b.i,4)"
+ FROM CASE_TBL a, CASE2_TBL b;
+ NULLIF(a.i,b.i) | NULLIF(b.i,4)
+-----------------+---------------
+ | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 1 | 2
+ | 2
+ 3 | 2
+ 4 | 2
+ 1 | 3
+ 2 | 3
+ | 3
+ 4 | 3
+ 1 | 2
+ | 2
+ 3 | 2
+ 4 | 2
+ | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+(24 rows)
+
+--
+-- Nested CASE expressions
+--
+-- This test exercises a bug caused by aliasing econtext->caseValue_isNull
+-- with the isNull argument of the inner CASE's CaseExpr evaluation. After
+-- evaluating the vol(null) expression in the inner CASE's second WHEN-clause,
+-- the isNull flag for the case test value incorrectly became true, causing
+-- the third WHEN-clause not to match. The volatile function calls are needed
+-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+ROLLBACK;
+-- Test multiple evaluation of a CASE arg that is a read/write object (#14472)
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+ROLLBACK;
+-- Test interaction of CASE with ArrayCoerceExpr (bug #15471)
+BEGIN;
+ROLLBACK;
+--
+-- Clean up
+--
+DROP TABLE CASE_TBL;
+DROP TABLE CASE2_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/case.sql b/yql/essentials/tests/postgresql/cases/case.sql
new file mode 100644
index 0000000000..ab0cb6b39f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/case.sql
@@ -0,0 +1,127 @@
+--
+-- CASE
+-- Test the case statement
+--
+CREATE TABLE CASE_TBL (
+ i integer,
+ f double precision
+);
+CREATE TABLE CASE2_TBL (
+ i integer,
+ j integer
+);
+INSERT INTO CASE_TBL VALUES (1, 10.1);
+INSERT INTO CASE_TBL VALUES (2, 20.2);
+INSERT INTO CASE_TBL VALUES (3, -30.3);
+INSERT INTO CASE_TBL VALUES (4, NULL);
+INSERT INTO CASE2_TBL VALUES (1, -1);
+INSERT INTO CASE2_TBL VALUES (2, -2);
+INSERT INTO CASE2_TBL VALUES (3, -3);
+INSERT INTO CASE2_TBL VALUES (2, -4);
+INSERT INTO CASE2_TBL VALUES (1, NULL);
+INSERT INTO CASE2_TBL VALUES (NULL, -6);
+--
+-- Simplest examples without tables
+--
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ END AS "Simple WHEN";
+SELECT '<NULL>' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ END AS "Simple default";
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ ELSE 4
+ END AS "Simple ELSE";
+SELECT '4' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ ELSE 4
+ END AS "ELSE default";
+SELECT '6' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ WHEN 4 < 5 THEN 6
+ ELSE 7
+ END AS "Two WHEN with default";
+SELECT '7' AS "None",
+ CASE WHEN random() < 0 THEN 1
+ END AS "NULL on no matches";
+-- Constant-expression folding shouldn't evaluate unreachable subexpressions
+SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
+SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END;
+-- Test for cases involving untyped literals in test expression
+SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+--
+-- Examples of targets involving tables
+--
+SELECT
+ CASE
+ WHEN i >= 3 THEN i
+ END AS ">= 3 or Null"
+ FROM CASE_TBL;
+SELECT
+ CASE WHEN i >= 3 THEN (i + i)
+ ELSE i
+ END AS "Simplest Math"
+ FROM CASE_TBL;
+SELECT i AS "Value",
+ CASE WHEN (i < 0) THEN 'small'
+ WHEN (i = 0) THEN 'zero'
+ WHEN (i = 1) THEN 'one'
+ WHEN (i = 2) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+SELECT
+ CASE WHEN ((i < 0) or (i < 0)) THEN 'small'
+ WHEN ((i = 0) or (i = 0)) THEN 'zero'
+ WHEN ((i = 1) or (i = 1)) THEN 'one'
+ WHEN ((i = 2) or (i = 2)) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+--
+-- Examples of qualifications involving tables
+--
+--
+-- NULLIF() and COALESCE()
+-- Shorthand forms for typical CASE constructs
+-- defined in the SQL standard.
+--
+SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
+SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2;
+SELECT COALESCE(a.f, b.i, b.j)
+ FROM CASE_TBL a, CASE2_TBL b;
+SELECT NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
+ NULLIF(b.i, 4) AS "NULLIF(b.i,4)"
+ FROM CASE_TBL a, CASE2_TBL b;
+--
+-- Nested CASE expressions
+--
+-- This test exercises a bug caused by aliasing econtext->caseValue_isNull
+-- with the isNull argument of the inner CASE's CaseExpr evaluation. After
+-- evaluating the vol(null) expression in the inner CASE's second WHEN-clause,
+-- the isNull flag for the case test value incorrectly became true, causing
+-- the third WHEN-clause not to match. The volatile function calls are needed
+-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+ROLLBACK;
+-- Test multiple evaluation of a CASE arg that is a read/write object (#14472)
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+ROLLBACK;
+-- Test interaction of CASE with ArrayCoerceExpr (bug #15471)
+BEGIN;
+ROLLBACK;
+--
+-- Clean up
+--
+DROP TABLE CASE_TBL;
+DROP TABLE CASE2_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/char.err b/yql/essentials/tests/postgresql/cases/char.err
new file mode 100644
index 0000000000..2de5448566
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/char.err
@@ -0,0 +1,101 @@
+<sql-statement>
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+</sql-statement>
+<sql-statement>
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE CHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/char.err.1 b/yql/essentials/tests/postgresql/cases/char.err.1
new file mode 100644
index 0000000000..2de5448566
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/char.err.1
@@ -0,0 +1,101 @@
+<sql-statement>
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+</sql-statement>
+<sql-statement>
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE CHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/char.err.2 b/yql/essentials/tests/postgresql/cases/char.err.2
new file mode 100644
index 0000000000..2de5448566
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/char.err.2
@@ -0,0 +1,101 @@
+<sql-statement>
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+</sql-statement>
+<sql-statement>
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE CHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM CHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/char.out b/yql/essentials/tests/postgresql/cases/char.out
new file mode 100644
index 0000000000..5881d9f10b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/char.out
@@ -0,0 +1,41 @@
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+ true
+------
+ t
+(1 row)
+
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+DROP TABLE CHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
diff --git a/yql/essentials/tests/postgresql/cases/char.sql b/yql/essentials/tests/postgresql/cases/char.sql
new file mode 100644
index 0000000000..de51cce09a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/char.sql
@@ -0,0 +1,31 @@
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+DROP TABLE CHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
diff --git a/yql/essentials/tests/postgresql/cases/comments.err b/yql/essentials/tests/postgresql/cases/comments.err
new file mode 100644
index 0000000000..3918f6e171
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/comments.err
@@ -0,0 +1,49 @@
+<sql-statement>
+--
+-- COMMENTS
+--
+SELECT 'trailing' AS first; -- trailing single line
+</sql-statement>
+<sql-statement>
+SELECT /* embedded single line */ 'embedded' AS second;
+</sql-statement>
+<sql-statement>
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+</sql-statement>
+<sql-statement>
+SELECT 'before multi-line' AS fourth;
+</sql-statement>
+<sql-statement>
+/* This is an example of SQL which should not execute:
+ * select 'multi-line';
+ */
+SELECT 'after multi-line' AS fifth;
+</sql-statement>
+<sql-statement>
+--
+-- Nested comments
+--
+/*
+SELECT 'trailing' as x1; -- inside block comment
+*/
+/* This block comment surrounds a query which itself has a block comment...
+SELECT /* embedded single line */ 'embedded' AS x2;
+*/
+SELECT -- continued after the following block comments...
+/* Deeply nested comment.
+ This includes a single apostrophe to make sure we aren't decoding this part as a string.
+SELECT 'deep nest' AS n1;
+/* Second level of nesting...
+SELECT 'deeper nest' as n2;
+/* Third level of nesting...
+SELECT 'deepest nest' as n3;
+*/
+Hoo boy. Still two deep...
+*/
+Now just one deep...
+*/
+'deeply nested example' AS sixth;
+</sql-statement>
+<sql-statement>
+/* and this is the end of the file */
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/comments.out b/yql/essentials/tests/postgresql/cases/comments.out
new file mode 100644
index 0000000000..33f612e633
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/comments.out
@@ -0,0 +1,65 @@
+--
+-- COMMENTS
+--
+SELECT 'trailing' AS first; -- trailing single line
+ first
+----------
+ trailing
+(1 row)
+
+SELECT /* embedded single line */ 'embedded' AS second;
+ second
+----------
+ embedded
+(1 row)
+
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+ third
+-------
+ both
+(1 row)
+
+SELECT 'before multi-line' AS fourth;
+ fourth
+-------------------
+ before multi-line
+(1 row)
+
+/* This is an example of SQL which should not execute:
+ * select 'multi-line';
+ */
+SELECT 'after multi-line' AS fifth;
+ fifth
+------------------
+ after multi-line
+(1 row)
+
+--
+-- Nested comments
+--
+/*
+SELECT 'trailing' as x1; -- inside block comment
+*/
+/* This block comment surrounds a query which itself has a block comment...
+SELECT /* embedded single line */ 'embedded' AS x2;
+*/
+SELECT -- continued after the following block comments...
+/* Deeply nested comment.
+ This includes a single apostrophe to make sure we aren't decoding this part as a string.
+SELECT 'deep nest' AS n1;
+/* Second level of nesting...
+SELECT 'deeper nest' as n2;
+/* Third level of nesting...
+SELECT 'deepest nest' as n3;
+*/
+Hoo boy. Still two deep...
+*/
+Now just one deep...
+*/
+'deeply nested example' AS sixth;
+ sixth
+-----------------------
+ deeply nested example
+(1 row)
+
+/* and this is the end of the file */
diff --git a/yql/essentials/tests/postgresql/cases/comments.sql b/yql/essentials/tests/postgresql/cases/comments.sql
new file mode 100644
index 0000000000..7aec12fac7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/comments.sql
@@ -0,0 +1,35 @@
+--
+-- COMMENTS
+--
+SELECT 'trailing' AS first; -- trailing single line
+SELECT /* embedded single line */ 'embedded' AS second;
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+SELECT 'before multi-line' AS fourth;
+/* This is an example of SQL which should not execute:
+ * select 'multi-line';
+ */
+SELECT 'after multi-line' AS fifth;
+--
+-- Nested comments
+--
+/*
+SELECT 'trailing' as x1; -- inside block comment
+*/
+/* This block comment surrounds a query which itself has a block comment...
+SELECT /* embedded single line */ 'embedded' AS x2;
+*/
+SELECT -- continued after the following block comments...
+/* Deeply nested comment.
+ This includes a single apostrophe to make sure we aren't decoding this part as a string.
+SELECT 'deep nest' AS n1;
+/* Second level of nesting...
+SELECT 'deeper nest' as n2;
+/* Third level of nesting...
+SELECT 'deepest nest' as n3;
+*/
+Hoo boy. Still two deep...
+*/
+Now just one deep...
+*/
+'deeply nested example' AS sixth;
+/* and this is the end of the file */
diff --git a/yql/essentials/tests/postgresql/cases/create_misc.err b/yql/essentials/tests/postgresql/cases/create_misc.err
new file mode 100644
index 0000000000..a6b37f3470
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_misc.err
@@ -0,0 +1,579 @@
+Registering pre-existing tables
+ tenk1
+ equipment_r
+ tenk2
+ hobbies_r
+<sql-statement>
+--
+-- CREATE_MISC
+--
+-- CLASS POPULATION
+-- (any resemblance to real life is purely coincidental)
+--
+INSERT INTO tenk2 SELECT * FROM tenk1;
+</sql-statement>
+<sql-statement>
+CREATE TABLE onek2 AS SELECT * FROM onek;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE onek2 AS SELECT * FROM onek;
+ ^
+<sql-statement>
+INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000;
+</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.fast_emp4000
+
+<sql-statement>
+SELECT *
+ INTO TABLE Bprime
+ FROM tenk1
+ WHERE unique2 < 1000;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ SELECT *
+ ^
+<sql-statement>
+INSERT INTO hobbies_r (name, person)
+ SELECT 'posthacking', p.name
+ FROM person* p
+ WHERE p.name = 'mike' or p.name = 'jeff';
+</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.person
+
+<sql-statement>
+INSERT INTO hobbies_r (name, person)
+ SELECT 'basketball', p.name
+ FROM person p
+ WHERE p.name = 'joe' or p.name = 'sally';
+</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.person
+
+<sql-statement>
+INSERT INTO hobbies_r (name) VALUES ('skywalking');
+</sql-statement>
+<sql-statement>
+INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
+</sql-statement>
+<sql-statement>
+INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
+</sql-statement>
+<sql-statement>
+INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
+</sql-statement>
+<sql-statement>
+INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
+</sql-statement>
+<sql-statement>
+INSERT INTO city VALUES
+('Podunk', '(1,2),(3,4)', '100,127,1000'),
+('Gotham', '(1000,34),(1100,334)', '123456,127,-1000,6789');
+</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.city
+
+<sql-statement>
+TABLE city;
+</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.city
+
+<sql-statement>
+SELECT *
+ INTO TABLE ramp
+ FROM road
+ WHERE name ~ '.*Ramp';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ SELECT *
+ ^
+<sql-statement>
+INSERT INTO ihighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'I- .*';
+</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.road
+
+<sql-statement>
+INSERT INTO shighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'State Hwy.*';
+</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.road
+
+<sql-statement>
+UPDATE shighway
+ SET surface = 'asphalt';
+</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 a_star (class, a) VALUES ('a', 1);
+</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.a_star
+
+<sql-statement>
+INSERT INTO a_star (class, a) VALUES ('a', 2);
+</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.a_star
+
+<sql-statement>
+INSERT INTO a_star (class) VALUES ('a');
+</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.a_star
+
+<sql-statement>
+INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text);
+</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.b_star
+
+<sql-statement>
+INSERT INTO b_star (class, a) VALUES ('b', 4);
+</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.b_star
+
+<sql-statement>
+INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text);
+</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.b_star
+
+<sql-statement>
+INSERT INTO b_star (class) VALUES ('b');
+</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.b_star
+
+<sql-statement>
+INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::name);
+</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.c_star
+
+<sql-statement>
+INSERT INTO c_star (class, a) VALUES ('c', 6);
+</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.c_star
+
+<sql-statement>
+INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::name);
+</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.c_star
+
+<sql-statement>
+INSERT INTO c_star (class) VALUES ('c');
+</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.c_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, b, c, d)
+ VALUES ('d', 7, 'grumble'::text, 'hi sunita'::name, '0.0'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, b, c)
+ VALUES ('d', 8, 'stumble'::text, 'hi koko'::name);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, b, d)
+ VALUES ('d', 9, 'rumble'::text, '1.1'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, c, d)
+ VALUES ('d', 10, 'hi kristin'::name, '10.01'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, b, c, d)
+ VALUES ('d', 'crumble'::text, 'hi boris'::name, '100.001'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, b)
+ VALUES ('d', 11, 'fumble'::text);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, c)
+ VALUES ('d', 12, 'hi avi'::name);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a, d)
+ VALUES ('d', 13, '1000.0001'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, b, c)
+ VALUES ('d', 'tumble'::text, 'hi andrew'::name);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, b, d)
+ VALUES ('d', 'humble'::text, '10000.00001'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, c, d)
+ VALUES ('d', 'hi ginger'::name, '100000.000001'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, a) VALUES ('d', 14);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8);
+</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.d_star
+
+<sql-statement>
+INSERT INTO d_star (class) VALUES ('d');
+</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.d_star
+
+<sql-statement>
+INSERT INTO e_star (class, a, c, e)
+ VALUES ('e', 15, 'hi carol'::name, '-1'::int2);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, a, c)
+ VALUES ('e', 16, 'hi bob'::name);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, a, e)
+ VALUES ('e', 17, '-2'::int2);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, c, e)
+ VALUES ('e', 'hi michelle'::name, '-3'::int2);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, a)
+ VALUES ('e', 18);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, c)
+ VALUES ('e', 'hi elisa'::name);
+</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.e_star
+
+<sql-statement>
+INSERT INTO e_star (class, e)
+ VALUES ('e', '-4'::int2);
+</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.e_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, c, e, f)
+ VALUES ('f', 19, 'hi claire'::name, '-5'::int2, '(1,3),(2,4)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, c, e)
+ VALUES ('f', 20, 'hi mike'::name, '-6'::int2);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, c, f)
+ VALUES ('f', 21, 'hi marcel'::name, '(11,44),(22,55),(33,66)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, e, f)
+ VALUES ('f', 22, '-7'::int2, '(111,555),(222,666),(333,777),(444,888)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, c, e, f)
+ VALUES ('f', 'hi keith'::name, '-8'::int2,
+ '(1111,3333),(2222,4444)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, c)
+ VALUES ('f', 24, 'hi marc'::name);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, e)
+ VALUES ('f', 25, '-9'::int2);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a, f)
+ VALUES ('f', 26, '(11111,33333),(22222,44444)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, c, e)
+ VALUES ('f', 'hi allison'::name, '-10'::int2);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, c, f)
+ VALUES ('f', 'hi jeff'::name,
+ '(111111,333333),(222222,444444)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, e, f)
+ VALUES ('f', '-11'::int2, '(1111111,3333333),(2222222,4444444)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, a) VALUES ('f', 27);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::name);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class, f)
+ VALUES ('f', '(11111111,33333333),(22222222,44444444)'::polygon);
+</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.f_star
+
+<sql-statement>
+INSERT INTO f_star (class) VALUES ('f');
+</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.f_star
+
+<sql-statement>
+-- Analyze the X_star tables for better plan stability in later tests
+ANALYZE a_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ -- Analyze the X_star tables for better plan stability in later tests
+ ^
+<sql-statement>
+ANALYZE b_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ ANALYZE b_star;
+ ^
+<sql-statement>
+ANALYZE c_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ ANALYZE c_star;
+ ^
+<sql-statement>
+ANALYZE d_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ ANALYZE d_star;
+ ^
+<sql-statement>
+ANALYZE e_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ ANALYZE e_star;
+ ^
+<sql-statement>
+ANALYZE f_star;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ ANALYZE f_star;
+ ^
+<sql-statement>
+--
+-- for internal portal (cursor) tests
+--
+CREATE TABLE iportaltest (
+ i int4,
+ d float4,
+ p polygon
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO iportaltest (i, d, p)
+ VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
+</sql-statement>
+<sql-statement>
+INSERT INTO iportaltest (i, d, p)
+ VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/create_misc.out b/yql/essentials/tests/postgresql/cases/create_misc.out
new file mode 100644
index 0000000000..566dbff19c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_misc.out
@@ -0,0 +1,24 @@
+--
+-- CREATE_MISC
+--
+-- CLASS POPULATION
+-- (any resemblance to real life is purely coincidental)
+--
+INSERT INTO tenk2 SELECT * FROM tenk1;
+INSERT INTO hobbies_r (name) VALUES ('skywalking');
+INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
+INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
+--
+-- for internal portal (cursor) tests
+--
+CREATE TABLE iportaltest (
+ i int4,
+ d float4,
+ p polygon
+);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
diff --git a/yql/essentials/tests/postgresql/cases/create_misc.sql b/yql/essentials/tests/postgresql/cases/create_misc.sql
new file mode 100644
index 0000000000..566dbff19c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_misc.sql
@@ -0,0 +1,24 @@
+--
+-- CREATE_MISC
+--
+-- CLASS POPULATION
+-- (any resemblance to real life is purely coincidental)
+--
+INSERT INTO tenk2 SELECT * FROM tenk1;
+INSERT INTO hobbies_r (name) VALUES ('skywalking');
+INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
+INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
+--
+-- for internal portal (cursor) tests
+--
+CREATE TABLE iportaltest (
+ i int4,
+ d float4,
+ p polygon
+);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
diff --git a/yql/essentials/tests/postgresql/cases/create_table.err b/yql/essentials/tests/postgresql/cases/create_table.err
new file mode 100644
index 0000000000..d13b588362
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_table.err
@@ -0,0 +1,2898 @@
+<sql-statement>
+--
+-- CREATE_TABLE
+--
+--
+-- CLASS DEFINITIONS
+--
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE person (
+ name text,
+ age int4,
+ location point
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE emp (
+ salary int4,
+ manager name
+) INHERITS (person);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE emp (
+ ^
+<sql-statement>
+CREATE TABLE student (
+ gpa float8
+) INHERITS (person);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE student (
+ ^
+<sql-statement>
+CREATE TABLE stud_emp (
+ percent int4
+) INHERITS (emp, student);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE stud_emp (
+ ^
+<sql-statement>
+CREATE TABLE city (
+ name name,
+ location box,
+ budget city_budget
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE dept (
+ dname name,
+ mgrname text
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE slow_emp4000 (
+ home_base box
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE fast_emp4000 (
+ home_base box
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE ihighway () INHERITS (road);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE ihighway () INHERITS (road);
+ ^
+<sql-statement>
+CREATE TABLE shighway (
+ surface text
+) INHERITS (road);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE shighway (
+ ^
+<sql-statement>
+CREATE TABLE real_city (
+ pop int4,
+ cname text,
+ outline path
+);
+</sql-statement>
+<sql-statement>
+--
+-- test the "star" operators a bit more thoroughly -- this time,
+-- throw in lots of NULL fields...
+--
+-- a is the type root
+-- b and c inherit from a (one-level single inheritance)
+-- d inherits from b and c (two-level multiple inheritance)
+-- e inherits from c (two-level single inheritance)
+-- f inherits from e (three-level single inheritance)
+--
+CREATE TABLE a_star (
+ class char,
+ a int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE b_star (
+ b text
+) INHERITS (a_star);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE b_star (
+ ^
+<sql-statement>
+CREATE TABLE c_star (
+ c name
+) INHERITS (a_star);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE c_star (
+ ^
+<sql-statement>
+CREATE TABLE d_star (
+ d float8
+) INHERITS (b_star, c_star);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE d_star (
+ ^
+<sql-statement>
+CREATE TABLE e_star (
+ e int2
+) INHERITS (c_star);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE e_star (
+ ^
+<sql-statement>
+CREATE TABLE f_star (
+ f polygon
+) INHERITS (e_star);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE f_star (
+ ^
+<sql-statement>
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE hash_i4_heap (
+ seqno int4,
+ random int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE hash_name_heap (
+ seqno int4,
+ random name
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE hash_txt_heap (
+ seqno int4,
+ random text
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE hash_f8_heap (
+ seqno int4,
+ random float8
+);
+</sql-statement>
+<sql-statement>
+-- don't include the hash_ovfl_heap stuff in the distribution
+-- the data set is too large for what it's worth
+--
+-- CREATE TABLE hash_ovfl_heap (
+-- x int4,
+-- y int4
+-- );
+CREATE TABLE bt_i4_heap (
+ seqno int4,
+ random int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE bt_name_heap (
+ seqno name,
+ random int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE bt_txt_heap (
+ seqno text,
+ random int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE bt_f8_heap (
+ seqno float8,
+ random int4
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE array_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE array_index_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE testjsonb (
+ j jsonb
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE unknowntab (
+ u unknown -- fail
+);
+</sql-statement>
+<sql-statement>
+CREATE TYPE unknown_comptype AS (
+ u unknown -- fail
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ CREATE TYPE unknown_comptype AS (
+ ^
+<sql-statement>
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text,
+ a tsvector
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text
+);
+</sql-statement>
+<sql-statement>
+-- invalid: non-lowercase quoted reloptions identifiers
+CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- invalid: non-lowercase quoted reloptions identifiers
+ ^
+<sql-statement>
+CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+</sql-statement>
+<sql-statement>
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ ^
+<sql-statement>
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ ^
+<sql-statement>
+CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ ^
+<sql-statement>
+DROP TABLE as_select1;
+</sql-statement>
+<sql-statement>
+PREPARE select1 AS SELECT 1 as a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ PREPARE select1 AS SELECT 1 as a;
+ ^
+<sql-statement>
+CREATE TABLE as_select1 AS EXECUTE select1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE as_select1 AS EXECUTE select1;
+ ^
+<sql-statement>
+CREATE TABLE as_select1 AS EXECUTE select1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE as_select1 AS EXECUTE select1;
+ ^
+<sql-statement>
+SELECT * FROM as_select1;
+</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.as_select1
+
+<sql-statement>
+CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
+ ^
+<sql-statement>
+DROP TABLE as_select1;
+</sql-statement>
+<sql-statement>
+DEALLOCATE select1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 303
+ DEALLOCATE select1;
+ ^
+<sql-statement>
+-- create an extra wide table to test for issues related to that
+-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
+\set ECHO none
+</sql-statement>
+Metacommand \set ECHO none is not supported
+<sql-statement>
+SELECT 'CREATE TABLE extra_wide_table(firstc text, '|| array_to_string(array_agg('c'||i||' bool'),',')||', lastc text);'
+FROM generate_series(1, 1100) g(i)
+\gexec
+</sql-statement>
+Metacommand \gexec is not supported
+<sql-statement>
+\set ECHO all
+</sql-statement>
+Metacommand \set ECHO all is not supported
+<sql-statement>
+INSERT INTO extra_wide_table(firstc, lastc) VALUES('first col', 'last col');
+</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.extra_wide_table
+
+<sql-statement>
+SELECT firstc, lastc FROM extra_wide_table;
+</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.extra_wide_table
+
+<sql-statement>
+-- check that tables with oids cannot be created anymore
+CREATE TABLE withoid() WITH OIDS;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:29: Error: ERROR: syntax error at or near "OIDS"
+
+ CREATE TABLE withoid() WITH OIDS;
+ ^
+<sql-statement>
+CREATE TABLE withoid() WITH (oids);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table options not supported
+ CREATE TABLE withoid() WITH (oids);
+ ^
+<sql-statement>
+CREATE TABLE withoid() WITH (oids = true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table options not supported
+ CREATE TABLE withoid() WITH (oids = true);
+ ^
+<sql-statement>
+-- but explicitly not adding oids is still supported
+CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
+</sql-statement>
+<sql-statement>
+DROP TABLE withoutoid;
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE withoutoid() WITH (oids = false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table options not supported
+ CREATE TEMP TABLE withoutoid() WITH (oids = false);
+ ^
+<sql-statement>
+DROP TABLE withoutoid;
+</sql-statement>
+<sql-statement>
+-- check restriction with default expressions
+-- invalid use of column reference in default expressions
+CREATE TABLE default_expr_column (id int DEFAULT (id));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:51: Error: Columns are not allowed in: DEFAULT
+ CREATE TABLE default_expr_column (id int DEFAULT (id));
+ ^
+<sql-statement>
+CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:51: Error: Columns are not allowed in: DEFAULT
+ CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
+ ^
+<sql-statement>
+CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:55: Error: Aggregate functions are not allowed in: DEFAULT
+ CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
+ ^
+<sql-statement>
+-- invalid column definition
+CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:54: Error: Aggregate functions are not allowed in: DEFAULT
+ CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
+ ^
+<sql-statement>
+-- invalid use of aggregate
+CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:47: Error: Aggregate functions are not allowed in: DEFAULT
+ CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
+ ^
+<sql-statement>
+-- invalid use of subquery
+CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:46: Error: SubLinks are not allowed in: DEFAULT
+ CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
+ ^
+<sql-statement>
+-- invalid use of set-returning function
+CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:47: Error: Generator functions are not allowed in: DEFAULT
+ CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
+ ^
+<sql-statement>
+-- Verify that subtransaction rollback restores rd_createSubid.
+BEGIN;
+</sql-statement>
+<sql-statement>
+CREATE TABLE remember_create_subid (c int);
+</sql-statement>
+<sql-statement>
+SAVEPOINT q;
+</sql-statement>
+<sql-statement>
+DROP TABLE remember_create_subid;
+</sql-statement>
+<sql-statement>
+ROLLBACK TO q;
+</sql-statement>
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+DROP TABLE remember_create_subid;
+</sql-statement>
+<sql-statement>
+-- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+CREATE TABLE remember_node_subid (c int);
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+ ^
+<sql-statement>
+SAVEPOINT q;
+</sql-statement>
+<sql-statement>
+DROP TABLE remember_node_subid;
+</sql-statement>
+<sql-statement>
+ROLLBACK TO q;
+</sql-statement>
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+DROP TABLE remember_node_subid;
+</sql-statement>
+<sql-statement>
+--
+-- Partitioned tables
+--
+-- cannot combine INHERITS and PARTITION BY (although grammar allows)
+CREATE TABLE partitioned (
+ a int
+) INHERITS (some_table) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ --
+ ^
+<sql-statement>
+-- cannot use more than 1 column as partition key for list partitioned table
+CREATE TABLE partitioned (
+ a1 int,
+ a2 int
+) PARTITION BY LIST (a1, a2); -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cannot use more than 1 column as partition key for list partitioned table
+ ^
+<sql-statement>
+-- unsupported constraint type for partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ EXCLUDE USING gist (a WITH &&)
+) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- unsupported constraint type for partitioned tables
+ ^
+<sql-statement>
+-- prevent using prohibited expressions in the key
+CREATE FUNCTION retset (a int) RETURNS SETOF int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- prevent using prohibited expressions in the key
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (retset(a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+DROP FUNCTION retset(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION retset(int);
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((avg(a)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE ((avg(a) OVER (PARTITION BY b)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY LIST ((a LIKE (SELECT 1)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((42));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (const_func());
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+DROP FUNCTION const_func();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION const_func();
+ ^
+<sql-statement>
+-- only accept valid partitioning strategy
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY MAGIC (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- only accept valid partitioning strategy
+ ^
+<sql-statement>
+-- specified column must be present in the table
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- specified column must be present in the table
+ ^
+<sql-statement>
+-- cannot use system columns in partition key
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (xmin);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cannot use system columns in partition key
+ ^
+<sql-statement>
+-- cannot use pseudotypes
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (((a, b)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cannot use pseudotypes
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (a, ('unknown'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+-- functions in key must be immutable
+CREATE FUNCTION immut_func (a int) RETURNS int AS $$ SELECT a + random()::int; $$ LANGUAGE SQL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- functions in key must be immutable
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (immut_func(a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+DROP FUNCTION immut_func(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION immut_func(int);
+ ^
+<sql-statement>
+-- prevent using columns of unsupported types in key (type must have a btree operator class)
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- prevent using columns of unsupported types in key (type must have a btree operator class)
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a point_ops);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a point_ops);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+-- cannot add NO INHERIT constraints to partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ CONSTRAINT check_a CHECK (a > 0) NO INHERIT
+) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cannot add NO INHERIT constraints to partitioned tables
+ ^
+<sql-statement>
+-- some checks after successful creation of a partitioned table
+CREATE FUNCTION plusone(a int) RETURNS INT AS $$ SELECT a+1; $$ LANGUAGE SQL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- some checks after successful creation of a partitioned table
+ ^
+<sql-statement>
+CREATE TABLE partitioned (
+ a int,
+ b int,
+ c text,
+ d text
+) PARTITION BY RANGE (a oid_ops, plusone(b), c collate "default", d collate "C");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partitioned (
+ ^
+<sql-statement>
+-- check relkind
+SELECT relkind FROM pg_class WHERE relname = 'partitioned';
+</sql-statement>
+<sql-statement>
+-- prevent a function referenced in partition key from being dropped
+DROP FUNCTION plusone(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ -- prevent a function referenced in partition key from being dropped
+ ^
+<sql-statement>
+-- partitioned table cannot participate in regular inheritance
+CREATE TABLE partitioned2 (
+ a int,
+ b text
+) PARTITION BY RANGE ((a+1), substr(b, 1, 5));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- partitioned table cannot participate in regular inheritance
+ ^
+<sql-statement>
+CREATE TABLE fail () INHERITS (partitioned2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail () INHERITS (partitioned2);
+ ^
+<sql-statement>
+-- Partition key in describe output
+\d partitioned
+</sql-statement>
+Metacommand \d partitioned is not supported
+<sql-statement>
+\d+ partitioned2
+</sql-statement>
+Metacommand \d+ partitioned2 is not supported
+<sql-statement>
+INSERT INTO partitioned2 VALUES (1, 'hello');
+</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.partitioned2
+
+<sql-statement>
+CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
+ ^
+<sql-statement>
+\d+ part2_1
+</sql-statement>
+Metacommand \d+ part2_1 is not supported
+<sql-statement>
+DROP TABLE partitioned, partitioned2;
+</sql-statement>
+<sql-statement>
+-- check reference to partitioned table's rowtype in partition descriptor
+create table partitioned (a int, b int)
+ partition by list ((row(a, b)::partitioned));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check reference to partitioned table's rowtype in partition descriptor
+ ^
+<sql-statement>
+create table partitioned1
+ partition of partitioned for values in ('(1,2)'::partitioned);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table partitioned1
+ ^
+<sql-statement>
+create table partitioned2
+ partition of partitioned for values in ('(2,4)'::partitioned);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table partitioned2
+ ^
+<sql-statement>
+explain (costs off)
+select * from partitioned where row(a,b)::partitioned = '(1,2)'::partitioned;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+drop table partitioned;
+</sql-statement>
+<sql-statement>
+-- whole-row Var in partition key works too
+create table partitioned (a int, b int)
+ partition by list ((partitioned));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- whole-row Var in partition key works too
+ ^
+<sql-statement>
+create table partitioned1
+ partition of partitioned for values in ('(1,2)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table partitioned1
+ ^
+<sql-statement>
+create table partitioned2
+ partition of partitioned for values in ('(2,4)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table partitioned2
+ ^
+<sql-statement>
+explain (costs off)
+select * from partitioned where partitioned = '(1,2)'::partitioned;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+\d+ partitioned1
+</sql-statement>
+Metacommand \d+ partitioned1 is not supported
+<sql-statement>
+drop table partitioned;
+</sql-statement>
+<sql-statement>
+-- check that dependencies of partition columns are handled correctly
+create domain intdom1 as int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ -- check that dependencies of partition columns are handled correctly
+ ^
+<sql-statement>
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table partitioned (
+ ^
+<sql-statement>
+alter table partitioned drop column a; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table partitioned drop column a; -- fail
+ ^
+<sql-statement>
+drop domain intdom1; -- fail, requires cascade
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop domain intdom1; -- fail, requires cascade
+ ^
+<sql-statement>
+drop domain intdom1 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop domain intdom1 cascade;
+ ^
+<sql-statement>
+table partitioned; -- gone
+</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.partitioned
+
+<sql-statement>
+-- likewise for columns used in partition expressions
+create domain intdom1 as int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ -- likewise for columns used in partition expressions
+ ^
+<sql-statement>
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (plusone(a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table partitioned (
+ ^
+<sql-statement>
+alter table partitioned drop column a; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table partitioned drop column a; -- fail
+ ^
+<sql-statement>
+drop domain intdom1; -- fail, requires cascade
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop domain intdom1; -- fail, requires cascade
+ ^
+<sql-statement>
+drop domain intdom1 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop domain intdom1 cascade;
+ ^
+<sql-statement>
+table partitioned; -- gone
+</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.partitioned
+
+<sql-statement>
+--
+-- Partitions
+--
+-- check partition bound syntax
+CREATE TABLE list_parted (
+ a int
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ --
+ ^
+<sql-statement>
+CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
+ ^
+<sql-statement>
+CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
+ ^
+<sql-statement>
+CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
+ ^
+<sql-statement>
+CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
+ ^
+<sql-statement>
+\d+ list_parted
+</sql-statement>
+Metacommand \d+ list_parted is not supported
+<sql-statement>
+-- forbidden expressions for partition bound with list partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- forbidden expressions for partition bound with list partitioned table
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
+ ^
+<sql-statement>
+-- syntax does not allow empty list of values for list partitions
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:64: Error: ERROR: syntax error at or near ")"
+
+ CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+ ^
+<sql-statement>
+-- trying to specify range for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES FROM (1) TO (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to specify range for list partitioned table
+ ^
+<sql-statement>
+-- trying to specify modulus and remainder for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ ^
+<sql-statement>
+-- check default partition cannot be created more than once
+CREATE TABLE part_default PARTITION OF list_parted DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- check default partition cannot be created more than once
+ ^
+<sql-statement>
+CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
+ ^
+<sql-statement>
+-- specified literal can't be cast to the partition column data type
+CREATE TABLE bools (
+ a bool
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- specified literal can't be cast to the partition column data type
+ ^
+<sql-statement>
+CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
+ ^
+<sql-statement>
+DROP TABLE bools;
+</sql-statement>
+<sql-statement>
+-- specified literal can be cast, and the cast might not be immutable
+CREATE TABLE moneyp (
+ a money
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- specified literal can be cast, and the cast might not be immutable
+ ^
+<sql-statement>
+CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
+ ^
+<sql-statement>
+CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
+ ^
+<sql-statement>
+CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
+ ^
+<sql-statement>
+DROP TABLE moneyp;
+</sql-statement>
+<sql-statement>
+-- cast is immutable
+CREATE TABLE bigintp (
+ a bigint
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cast is immutable
+ ^
+<sql-statement>
+CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
+ ^
+<sql-statement>
+-- fails due to overlap:
+CREATE TABLE bigintp_10_2 PARTITION OF bigintp FOR VALUES IN ('10');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- fails due to overlap:
+ ^
+<sql-statement>
+DROP TABLE bigintp;
+</sql-statement>
+<sql-statement>
+CREATE TABLE range_parted (
+ a date
+) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE range_parted (
+ ^
+<sql-statement>
+-- forbidden expressions for partition bounds with range partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- forbidden expressions for partition bounds with range partitioned table
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename.somename) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (a) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(a)) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(somename)) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max('2019-02-01'::date)) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM ((select 1)) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (generate_series(1, 3)) TO ('2019-01-01');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ ^
+<sql-statement>
+-- trying to specify list for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES IN ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to specify list for range partitioned table
+ ^
+<sql-statement>
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ ^
+<sql-statement>
+-- each of start and end bounds must have same number of values as the
+-- length of the partition key
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('z');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- each of start and end bounds must have same number of values as the
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
+ ^
+<sql-statement>
+-- cannot specify null values in range bounds
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM (null) TO (maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- cannot specify null values in range bounds
+ ^
+<sql-statement>
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ ^
+<sql-statement>
+-- check partition bound syntax for the hash partition
+CREATE TABLE hash_parted (
+ a int
+) PARTITION BY HASH (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check partition bound syntax for the hash partition
+ ^
+<sql-statement>
+CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
+ ^
+<sql-statement>
+CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
+ ^
+<sql-statement>
+CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
+ ^
+<sql-statement>
+CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:65: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
+ ^
+<sql-statement>
+-- modulus 25 is factor of modulus of 50 but 10 is not a factor of 25.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
+ ^
+<sql-statement>
+-- previous modulus 50 is factor of 150 but this modulus is not a factor of next modulus 200.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
+ ^
+<sql-statement>
+-- overlapping remainders
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:66: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
+ ^
+<sql-statement>
+-- trying to specify range for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES FROM ('a', 1) TO ('z');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to specify range for the hash partitioned table
+ ^
+<sql-statement>
+-- trying to specify list value for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES IN (1000);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to specify list value for the hash partitioned table
+ ^
+<sql-statement>
+-- trying to create default partition for the hash partitioned table
+CREATE TABLE fail_default_part PARTITION OF hash_parted DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to create default partition for the hash partitioned table
+ ^
+<sql-statement>
+-- check if compatible with the specified parent
+-- cannot create as partition of a non-partitioned table
+CREATE TABLE unparted (
+ a int
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:64: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+ ^
+<sql-statement>
+DROP TABLE unparted;
+</sql-statement>
+<sql-statement>
+-- cannot create a permanent rel as partition of a temp rel
+CREATE TEMP TABLE temp_parted (
+ a int
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- cannot create a permanent rel as partition of a temp rel
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
+ ^
+<sql-statement>
+DROP TABLE temp_parted;
+</sql-statement>
+<sql-statement>
+-- check for partition bound overlap and other invalid specifications
+CREATE TABLE list_parted2 (
+ a varchar
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check for partition bound overlap and other invalid specifications
+ ^
+<sql-statement>
+CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
+ ^
+<sql-statement>
+CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
+ ^
+<sql-statement>
+CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
+ ^
+<sql-statement>
+-- check default partition overlap
+INSERT INTO list_parted2 VALUES('X');
+</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.list_parted2
+
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
+ ^
+<sql-statement>
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE range_parted2 (
+ ^
+<sql-statement>
+-- trying to create range partition with empty range
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- trying to create range partition with empty range
+ ^
+<sql-statement>
+-- note that the range '[1, 1)' has no elements
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- note that the range '[1, 1)' has no elements
+ ^
+<sql-statement>
+CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
+ ^
+<sql-statement>
+CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
+ ^
+<sql-statement>
+CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
+ ^
+<sql-statement>
+CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
+ ^
+<sql-statement>
+-- Create a default partition for range partitioned table
+CREATE TABLE range2_default PARTITION OF range_parted2 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- Create a default partition for range partitioned table
+ ^
+<sql-statement>
+-- More than one default partition is not allowed, so this should give error
+CREATE TABLE fail_default_part PARTITION OF range_parted2 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- More than one default partition is not allowed, so this should give error
+ ^
+<sql-statement>
+-- Check if the range for default partitions overlap
+INSERT INTO range_parted2 VALUES (85);
+</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.range_parted2
+
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
+ ^
+<sql-statement>
+CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
+ ^
+<sql-statement>
+-- now check for multi-column range partition key
+CREATE TABLE range_parted3 (
+ a int,
+ b int
+) PARTITION BY RANGE (a, (b+1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- now check for multi-column range partition key
+ ^
+<sql-statement>
+CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
+ ^
+<sql-statement>
+CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
+ ^
+<sql-statement>
+CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
+ ^
+<sql-statement>
+CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
+ ^
+<sql-statement>
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
+ ^
+<sql-statement>
+CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
+ ^
+<sql-statement>
+-- cannot create a partition that says column b is allowed to range
+-- from -infinity to +infinity, while there exist partitions that have
+-- more specific ranges
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- cannot create a partition that says column b is allowed to range
+ ^
+<sql-statement>
+-- check for partition bound overlap and other invalid specifications for the hash partition
+CREATE TABLE hash_parted2 (
+ a varchar
+) PARTITION BY HASH (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check for partition bound overlap and other invalid specifications for the hash partition
+ ^
+<sql-statement>
+CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+ ^
+<sql-statement>
+CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+ ^
+<sql-statement>
+CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+ ^
+<sql-statement>
+CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
+ ^
+<sql-statement>
+-- overlap with part_4
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+ ^
+<sql-statement>
+-- modulus must be greater than zero
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+ ^
+<sql-statement>
+-- remainder must be greater than or equal to zero and less than modulus
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:67: Error: ERROR: unrecognized hash partition bound specification "MODULUS"
+
+ CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+ ^
+<sql-statement>
+-- check schema propagation from parent
+CREATE TABLE parted (
+ a text,
+ b int NOT NULL DEFAULT 0,
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check schema propagation from parent
+ ^
+<sql-statement>
+CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+ ^
+<sql-statement>
+-- able to specify column default, column constraint, and table constraint
+-- first check the "column specified more than once" error
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL,
+ b DEFAULT 1,
+ b CHECK (b >= 0),
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) FOR VALUES IN ('b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- able to specify column default, column constraint, and table constraint
+ ^
+<sql-statement>
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL DEFAULT 1,
+ CONSTRAINT check_a CHECK (length(a) > 0),
+ CONSTRAINT check_b CHECK (b >= 0)
+) FOR VALUES IN ('b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_b PARTITION OF parted (
+ ^
+<sql-statement>
+-- conislocal should be false for any merged constraints, true otherwise
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass ORDER BY conislocal, coninhcount;
+</sql-statement>
+<sql-statement>
+-- Once check_b is added to the parent, it should be made non-local for part_b
+ALTER TABLE parted ADD CONSTRAINT check_b CHECK (b >= 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Once check_b is added to the parent, it should be made non-local for part_b
+ ^
+<sql-statement>
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+</sql-statement>
+<sql-statement>
+-- Neither check_a nor check_b are droppable from part_b
+ALTER TABLE part_b DROP CONSTRAINT check_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Neither check_a nor check_b are droppable from part_b
+ ^
+<sql-statement>
+ALTER TABLE part_b DROP CONSTRAINT check_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_b DROP CONSTRAINT check_b;
+ ^
+<sql-statement>
+-- And dropping it from parted should leave no trace of them on part_b, unlike
+-- traditional inheritance where they will be left behind, because they would
+-- be local constraints.
+ALTER TABLE parted DROP CONSTRAINT check_a, DROP CONSTRAINT check_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- And dropping it from parted should leave no trace of them on part_b, unlike
+ ^
+<sql-statement>
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+</sql-statement>
+<sql-statement>
+-- specify PARTITION BY for a partition
+CREATE TABLE fail_part_col_not_found PARTITION OF parted FOR VALUES IN ('c') PARTITION BY RANGE (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- specify PARTITION BY for a partition
+ ^
+<sql-statement>
+CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
+ ^
+<sql-statement>
+-- create a level-2 partition
+CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- create a level-2 partition
+ ^
+<sql-statement>
+-- check that NOT NULL and default value are inherited correctly
+create table parted_notnull_inh_test (a int default 1, b int not null default 0) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that NOT NULL and default value are inherited correctly
+ ^
+<sql-statement>
+create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
+ ^
+<sql-statement>
+insert into parted_notnull_inh_test (b) values (null);
+</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.parted_notnull_inh_test
+
+<sql-statement>
+-- note that while b's default is overriden, a's default is preserved
+\d parted_notnull_inh_test1
+</sql-statement>
+Metacommand \d parted_notnull_inh_test1 is not supported
+<sql-statement>
+drop table parted_notnull_inh_test;
+</sql-statement>
+<sql-statement>
+-- check that collations are assigned in partition bound expressions
+create table parted_boolean_col (a bool, b text) partition by list(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that collations are assigned in partition bound expressions
+ ^
+<sql-statement>
+create table parted_boolean_less partition of parted_boolean_col
+ for values in ('foo' < 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table parted_boolean_less partition of parted_boolean_col
+ ^
+<sql-statement>
+create table parted_boolean_greater partition of parted_boolean_col
+ for values in ('foo' > 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table parted_boolean_greater partition of parted_boolean_col
+ ^
+<sql-statement>
+drop table parted_boolean_col;
+</sql-statement>
+<sql-statement>
+-- check for a conflicting COLLATE clause
+create table parted_collate_must_match (a text collate "C", b text collate "C")
+ partition by range (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check for a conflicting COLLATE clause
+ ^
+<sql-statement>
+-- on the partition key
+create table parted_collate_must_match1 partition of parted_collate_must_match
+ (a collate "POSIX") for values from ('a') to ('m');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- on the partition key
+ ^
+<sql-statement>
+-- on another column
+create table parted_collate_must_match2 partition of parted_collate_must_match
+ (b collate "POSIX") for values from ('m') to ('z');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- on another column
+ ^
+<sql-statement>
+drop table parted_collate_must_match;
+</sql-statement>
+<sql-statement>
+-- check that non-matching collations for partition bound
+-- expressions are coerced to the right collation
+create table test_part_coll_posix (a text) partition by range (a collate "POSIX");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that non-matching collations for partition bound
+ ^
+<sql-statement>
+-- ok, collation is implicitly coerced
+create table test_part_coll partition of test_part_coll_posix for values from ('a' collate "C") to ('g');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- ok, collation is implicitly coerced
+ ^
+<sql-statement>
+-- ok
+create table test_part_coll2 partition of test_part_coll_posix for values from ('g') to ('m');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- ok
+ ^
+<sql-statement>
+-- ok, collation is implicitly coerced
+create table test_part_coll_cast partition of test_part_coll_posix for values from (name 'm' collate "C") to ('s');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- ok, collation is implicitly coerced
+ ^
+<sql-statement>
+-- ok; partition collation silently overrides the default collation of type 'name'
+create table test_part_coll_cast2 partition of test_part_coll_posix for values from (name 's') to ('z');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- ok; partition collation silently overrides the default collation of type 'name'
+ ^
+<sql-statement>
+drop table test_part_coll_posix;
+</sql-statement>
+<sql-statement>
+-- Partition bound in describe output
+\d+ part_b
+</sql-statement>
+Metacommand \d+ part_b is not supported
+<sql-statement>
+-- Both partition bound and partition key in describe output
+\d+ part_c
+</sql-statement>
+Metacommand \d+ part_c is not supported
+<sql-statement>
+-- a level-2 partition's constraint will include the parent's expressions
+\d+ part_c_1_10
+</sql-statement>
+Metacommand \d+ part_c_1_10 is not supported
+<sql-statement>
+-- Show partition count in the parent's describe output
+-- Tempted to include \d+ output listing partitions with bound info but
+-- output could vary depending on the order in which partition oids are
+-- returned.
+\d parted
+</sql-statement>
+Metacommand \d parted is not supported
+<sql-statement>
+\d hash_parted
+</sql-statement>
+Metacommand \d hash_parted is not supported
+<sql-statement>
+-- check that we get the expected partition constraints
+CREATE TABLE range_parted4 (a int, b int, c int) PARTITION BY RANGE (abs(a), abs(b), c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that we get the expected partition constraints
+ ^
+<sql-statement>
+CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
+ ^
+<sql-statement>
+\d+ unbounded_range_part
+</sql-statement>
+Metacommand \d+ unbounded_range_part is not supported
+<sql-statement>
+DROP TABLE unbounded_range_part;
+</sql-statement>
+<sql-statement>
+CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
+ ^
+<sql-statement>
+\d+ range_parted4_1
+</sql-statement>
+Metacommand \d+ range_parted4_1 is not supported
+<sql-statement>
+CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
+ ^
+<sql-statement>
+\d+ range_parted4_2
+</sql-statement>
+Metacommand \d+ range_parted4_2 is not supported
+<sql-statement>
+CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
+ ^
+<sql-statement>
+\d+ range_parted4_3
+</sql-statement>
+Metacommand \d+ range_parted4_3 is not supported
+<sql-statement>
+DROP TABLE range_parted4;
+</sql-statement>
+<sql-statement>
+-- user-defined operator class in partition key
+CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql
+ AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 1 ELSE -1 END; $$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- user-defined operator class in partition key
+ ^
+<sql-statement>
+CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
+ OPERATOR 1 < (int4,int4), OPERATOR 2 <= (int4,int4),
+ OPERATOR 3 = (int4,int4), OPERATOR 4 >= (int4,int4),
+ OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
+ CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
+ ^
+<sql-statement>
+CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
+ ^
+<sql-statement>
+CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
+ ^
+<sql-statement>
+INSERT INTO partkey_t VALUES (100);
+</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.partkey_t
+
+<sql-statement>
+INSERT INTO partkey_t VALUES (200);
+</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.partkey_t
+
+<sql-statement>
+-- cleanup
+DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
+</sql-statement>
+<sql-statement>
+DROP TABLE partkey_t, hash_parted, hash_parted2;
+</sql-statement>
+<sql-statement>
+DROP OPERATOR CLASS test_int4_ops USING btree;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP OPERATOR CLASS test_int4_ops USING btree;
+ ^
+<sql-statement>
+DROP FUNCTION my_int4_sort(int4,int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION my_int4_sort(int4,int4);
+ ^
+<sql-statement>
+-- comments on partitioned tables columns
+CREATE TABLE parted_col_comment (a int, b text) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- comments on partitioned tables columns
+ ^
+<sql-statement>
+COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
+ COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
+ ^
+<sql-statement>
+COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 258
+ COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
+ ^
+<sql-statement>
+SELECT obj_description('parted_col_comment'::regclass);
+</sql-statement>
+<sql-statement>
+\d+ parted_col_comment
+</sql-statement>
+Metacommand \d+ parted_col_comment is not supported
+<sql-statement>
+DROP TABLE parted_col_comment;
+</sql-statement>
+<sql-statement>
+-- list partitioning on array type column
+CREATE TABLE arrlp (a int[]) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- list partitioning on array type column
+ ^
+<sql-statement>
+CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
+ ^
+<sql-statement>
+\d+ arrlp12
+</sql-statement>
+Metacommand \d+ arrlp12 is not supported
+<sql-statement>
+DROP TABLE arrlp;
+</sql-statement>
+<sql-statement>
+-- partition on boolean column
+create table boolspart (a bool) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- partition on boolean column
+ ^
+<sql-statement>
+create table boolspart_t partition of boolspart for values in (true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table boolspart_t partition of boolspart for values in (true);
+ ^
+<sql-statement>
+create table boolspart_f partition of boolspart for values in (false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table boolspart_f partition of boolspart for values in (false);
+ ^
+<sql-statement>
+\d+ boolspart
+</sql-statement>
+Metacommand \d+ boolspart is not supported
+<sql-statement>
+drop table boolspart;
+</sql-statement>
+<sql-statement>
+-- partitions mixing temporary and permanent relations
+create table perm_parted (a int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- partitions mixing temporary and permanent relations
+ ^
+<sql-statement>
+create temporary table temp_parted (a int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create temporary table temp_parted (a int) partition by list (a);
+ ^
+<sql-statement>
+create table perm_part partition of temp_parted default; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table perm_part partition of temp_parted default; -- error
+ ^
+<sql-statement>
+create temp table temp_part partition of perm_parted default; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table temp_part partition of perm_parted default; -- error
+ ^
+<sql-statement>
+create temp table temp_part partition of temp_parted default; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table temp_part partition of temp_parted default; -- ok
+ ^
+<sql-statement>
+drop table perm_parted cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ drop table perm_parted cascade;
+ ^
+<sql-statement>
+drop table temp_parted cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ drop table temp_parted cascade;
+ ^
+<sql-statement>
+-- check that adding partitions to a table while it is being used is prevented
+create table tab_part_create (a int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that adding partitions to a table while it is being used is prevented
+ ^
+<sql-statement>
+create or replace function func_part_create() returns trigger
+ language plpgsql as $$
+ begin
+ execute 'create table tab_part_create_1 partition of tab_part_create for values in (1)';
+ return null;
+ end $$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create or replace function func_part_create() returns trigger
+ ^
+<sql-statement>
+create trigger trig_part_create before insert on tab_part_create
+ for each statement execute procedure func_part_create();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger trig_part_create before insert on tab_part_create
+ ^
+<sql-statement>
+insert into tab_part_create values (1);
+</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.tab_part_create
+
+<sql-statement>
+drop table tab_part_create;
+</sql-statement>
+<sql-statement>
+drop function func_part_create();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function func_part_create();
+ ^
+<sql-statement>
+-- test using a volatile expression as partition bound
+create table volatile_partbound_test (partkey timestamp) partition by range (partkey);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- test using a volatile expression as partition bound
+ ^
+<sql-statement>
+create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
+ ^
+<sql-statement>
+create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
+ ^
+<sql-statement>
+-- this should go into the partition volatile_partbound_test2
+insert into volatile_partbound_test values (current_timestamp);
+</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.volatile_partbound_test
+
+<sql-statement>
+select tableoid::regclass from volatile_partbound_test;
+</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.volatile_partbound_test
+
+<sql-statement>
+drop table volatile_partbound_test;
+</sql-statement>
+<sql-statement>
+-- test the case where a check constraint on default partition allows
+-- to avoid scanning it when adding a new partition
+create table defcheck (a int, b int) partition by list (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- test the case where a check constraint on default partition allows
+ ^
+<sql-statement>
+create table defcheck_def (a int, c int, b int);
+</sql-statement>
+<sql-statement>
+alter table defcheck_def drop c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table defcheck_def drop c;
+ ^
+<sql-statement>
+alter table defcheck attach partition defcheck_def default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table defcheck attach partition defcheck_def default;
+ ^
+<sql-statement>
+alter table defcheck_def add check (b <= 0 and b is not null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table defcheck_def add check (b <= 0 and b is not null);
+ ^
+<sql-statement>
+create table defcheck_1 partition of defcheck for values in (1, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table defcheck_1 partition of defcheck for values in (1, null);
+ ^
+<sql-statement>
+-- test that complex default partition constraints are enforced correctly
+insert into defcheck_def values (0, 0);
+</sql-statement>
+<sql-statement>
+create table defcheck_0 partition of defcheck for values in (0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table defcheck_0 partition of defcheck for values in (0);
+ ^
+<sql-statement>
+drop table defcheck;
+</sql-statement>
+<sql-statement>
+-- tests of column drop with partition tables and indexes using
+-- predicates and expressions.
+create table part_column_drop (
+ useless_1 int,
+ id int,
+ useless_2 int,
+ d int,
+ b int,
+ useless_3 int
+) partition by range (id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- tests of column drop with partition tables and indexes using
+ ^
+<sql-statement>
+alter table part_column_drop drop column useless_1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table part_column_drop drop column useless_1;
+ ^
+<sql-statement>
+alter table part_column_drop drop column useless_2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table part_column_drop drop column useless_2;
+ ^
+<sql-statement>
+alter table part_column_drop drop column useless_3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table part_column_drop drop column useless_3;
+ ^
+<sql-statement>
+create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: partial index is not supported yet
+ create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
+ ^
+<sql-statement>
+create index part_column_drop_b_expr on part_column_drop((b = 1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ create index part_column_drop_b_expr on part_column_drop((b = 1));
+ ^
+<sql-statement>
+create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: partial index is not supported yet
+ create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
+ ^
+<sql-statement>
+create index part_column_drop_d_expr on part_column_drop((d = 2));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ create index part_column_drop_d_expr on part_column_drop((d = 2));
+ ^
+<sql-statement>
+create table part_column_drop_1_10 partition of
+ part_column_drop for values from (1) to (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_column_drop_1_10 partition of
+ ^
+<sql-statement>
+\d part_column_drop
+</sql-statement>
+Metacommand \d part_column_drop is not supported
+<sql-statement>
+\d part_column_drop_1_10
+</sql-statement>
+Metacommand \d part_column_drop_1_10 is not supported
+<sql-statement>
+drop table part_column_drop;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/create_table.out b/yql/essentials/tests/postgresql/cases/create_table.out
new file mode 100644
index 0000000000..1a496b1fad
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_table.out
@@ -0,0 +1,213 @@
+--
+-- CREATE_TABLE
+--
+--
+-- CLASS DEFINITIONS
+--
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE person (
+ name text,
+ age int4,
+ location point
+);
+CREATE TABLE city (
+ name name,
+ location box,
+ budget city_budget
+);
+CREATE TABLE dept (
+ dname name,
+ mgrname text
+);
+CREATE TABLE slow_emp4000 (
+ home_base box
+);
+CREATE TABLE fast_emp4000 (
+ home_base box
+);
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+CREATE TABLE real_city (
+ pop int4,
+ cname text,
+ outline path
+);
+--
+-- test the "star" operators a bit more thoroughly -- this time,
+-- throw in lots of NULL fields...
+--
+-- a is the type root
+-- b and c inherit from a (one-level single inheritance)
+-- d inherits from b and c (two-level multiple inheritance)
+-- e inherits from c (two-level single inheritance)
+-- f inherits from e (three-level single inheritance)
+--
+CREATE TABLE a_star (
+ class char,
+ a int4
+);
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+CREATE TABLE hash_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE hash_name_heap (
+ seqno int4,
+ random name
+);
+CREATE TABLE hash_txt_heap (
+ seqno int4,
+ random text
+);
+CREATE TABLE hash_f8_heap (
+ seqno int4,
+ random float8
+);
+-- don't include the hash_ovfl_heap stuff in the distribution
+-- the data set is too large for what it's worth
+--
+-- CREATE TABLE hash_ovfl_heap (
+-- x int4,
+-- y int4
+-- );
+CREATE TABLE bt_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE bt_name_heap (
+ seqno name,
+ random int4
+);
+CREATE TABLE bt_txt_heap (
+ seqno text,
+ random int4
+);
+CREATE TABLE bt_f8_heap (
+ seqno float8,
+ random int4
+);
+CREATE TABLE array_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE array_index_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE testjsonb (
+ j jsonb
+);
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text,
+ a tsvector
+);
+CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+-- check that tables with oids cannot be created anymore
+CREATE TABLE withoid() WITH OIDS;
+ERROR: syntax error at or near "OIDS"
+LINE 1: CREATE TABLE withoid() WITH OIDS;
+ ^
+-- but explicitly not adding oids is still supported
+CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
+DROP TABLE withoutoid;
+-- Verify that subtransaction rollback restores rd_createSubid.
+BEGIN;
+CREATE TABLE remember_create_subid (c int);
+SAVEPOINT q;
+DROP TABLE remember_create_subid;
+ROLLBACK TO q;
+COMMIT;
+-- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+CREATE TABLE remember_node_subid (c int);
+BEGIN;
+SAVEPOINT q;
+DROP TABLE remember_node_subid;
+ROLLBACK TO q;
+COMMIT;
+-- syntax does not allow empty list of values for list partitions
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+ERROR: syntax error at or near ")"
+LINE 1: ...E TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+ ^
+-- check if compatible with the specified parent
+-- cannot create as partition of a non-partitioned table
+CREATE TABLE unparted (
+ a int
+);
+DROP TABLE unparted;
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+ conislocal | coninhcount
+------------+-------------
+(0 rows)
+
+create table defcheck_def (a int, c int, b int);
+-- test that complex default partition constraints are enforced correctly
+insert into defcheck_def values (0, 0);
diff --git a/yql/essentials/tests/postgresql/cases/create_table.sql b/yql/essentials/tests/postgresql/cases/create_table.sql
new file mode 100644
index 0000000000..81bcd3dec6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/create_table.sql
@@ -0,0 +1,203 @@
+--
+-- CREATE_TABLE
+--
+--
+-- CLASS DEFINITIONS
+--
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE person (
+ name text,
+ age int4,
+ location point
+);
+CREATE TABLE city (
+ name name,
+ location box,
+ budget city_budget
+);
+CREATE TABLE dept (
+ dname name,
+ mgrname text
+);
+CREATE TABLE slow_emp4000 (
+ home_base box
+);
+CREATE TABLE fast_emp4000 (
+ home_base box
+);
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+CREATE TABLE real_city (
+ pop int4,
+ cname text,
+ outline path
+);
+--
+-- test the "star" operators a bit more thoroughly -- this time,
+-- throw in lots of NULL fields...
+--
+-- a is the type root
+-- b and c inherit from a (one-level single inheritance)
+-- d inherits from b and c (two-level multiple inheritance)
+-- e inherits from c (two-level single inheritance)
+-- f inherits from e (three-level single inheritance)
+--
+CREATE TABLE a_star (
+ class char,
+ a int4
+);
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+CREATE TABLE hash_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE hash_name_heap (
+ seqno int4,
+ random name
+);
+CREATE TABLE hash_txt_heap (
+ seqno int4,
+ random text
+);
+CREATE TABLE hash_f8_heap (
+ seqno int4,
+ random float8
+);
+-- don't include the hash_ovfl_heap stuff in the distribution
+-- the data set is too large for what it's worth
+--
+-- CREATE TABLE hash_ovfl_heap (
+-- x int4,
+-- y int4
+-- );
+CREATE TABLE bt_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE bt_name_heap (
+ seqno name,
+ random int4
+);
+CREATE TABLE bt_txt_heap (
+ seqno text,
+ random int4
+);
+CREATE TABLE bt_f8_heap (
+ seqno float8,
+ random int4
+);
+CREATE TABLE array_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE array_index_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE testjsonb (
+ j jsonb
+);
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text,
+ a tsvector
+);
+CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+-- check that tables with oids cannot be created anymore
+CREATE TABLE withoid() WITH OIDS;
+-- but explicitly not adding oids is still supported
+CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
+DROP TABLE withoutoid;
+-- Verify that subtransaction rollback restores rd_createSubid.
+BEGIN;
+CREATE TABLE remember_create_subid (c int);
+SAVEPOINT q;
+DROP TABLE remember_create_subid;
+ROLLBACK TO q;
+COMMIT;
+-- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+CREATE TABLE remember_node_subid (c int);
+BEGIN;
+SAVEPOINT q;
+DROP TABLE remember_node_subid;
+ROLLBACK TO q;
+COMMIT;
+-- syntax does not allow empty list of values for list partitions
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+-- check if compatible with the specified parent
+-- cannot create as partition of a non-partitioned table
+CREATE TABLE unparted (
+ a int
+);
+DROP TABLE unparted;
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+create table defcheck_def (a int, c int, b int);
+-- test that complex default partition constraints are enforced correctly
+insert into defcheck_def values (0, 0);
diff --git a/yql/essentials/tests/postgresql/cases/date.err b/yql/essentials/tests/postgresql/cases/date.err
new file mode 100644
index 0000000000..73f287e6fd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/date.err
@@ -0,0 +1,1319 @@
+<sql-statement>
+--
+-- DATE
+--
+CREATE TABLE DATE_TBL (f1 date);
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1957-04-09');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1957-06-13');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1996-02-28');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1996-02-29');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1996-03-01');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1996-03-02');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1997-02-28');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1997-02-29');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "1997-02-29"
+
+ INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ ^
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1997-03-01');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('1997-03-02');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2000-04-01');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2000-04-02');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2000-04-03');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2038-04-08');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2039-04-09');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2040-04-10');
+</sql-statement>
+<sql-statement>
+INSERT INTO DATE_TBL VALUES ('2040-04-10 BC');
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM DATE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM DATE_TBL WHERE f1 < '2000-01-01';
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM DATE_TBL
+ WHERE f1 BETWEEN '2000-01-01' AND '2001-01-01';
+</sql-statement>
+<sql-statement>
+--
+-- Check all the documented input formats
+--
+SET datestyle TO iso; -- display results in ISO
+</sql-statement>
+<sql-statement>
+SET datestyle TO ymd;
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-18';
+</sql-statement>
+<sql-statement>
+SELECT date '1/8/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1/18/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '18/1/1999';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '18/1/1999';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "18/1/1999"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '18/1/1999';
+ ^
+<sql-statement>
+SELECT date '01/02/03';
+</sql-statement>
+<sql-statement>
+SELECT date '19990108';
+</sql-statement>
+<sql-statement>
+SELECT date '990108';
+</sql-statement>
+<sql-statement>
+SELECT date '1999.008';
+</sql-statement>
+<sql-statement>
+SELECT date 'J2451187';
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 99 BC';
+</sql-statement>
+<sql-statement>
+SELECT date '99-Jan-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-Jan-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-Jan-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-Jan-08';
+ ^
+<sql-statement>
+SELECT date '1999-Jan-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99-08-Jan"
+
+ SELECT date '99-08-Jan';
+ ^
+<sql-statement>
+SELECT date '1999-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '1999-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "1999-08-Jan"
+
+ SELECT date '1999-08-Jan';
+ ^
+<sql-statement>
+SELECT date '99 Jan 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 Jan 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 Jan 08"
+
+ SELECT date '99 Jan 08';
+ ^
+<sql-statement>
+SELECT date '1999 Jan 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 08 Jan"
+
+ SELECT date '99 08 Jan';
+ ^
+<sql-statement>
+SELECT date '1999 08 Jan';
+</sql-statement>
+<sql-statement>
+SELECT date '99-01-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-01-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-01-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-01-08';
+ ^
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-08-01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-08-01';
+ ^
+<sql-statement>
+SELECT date '1999-08-01';
+</sql-statement>
+<sql-statement>
+SELECT date '99 01 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 01 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 01 08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 01 08';
+ ^
+<sql-statement>
+SELECT date '1999 01 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 08 01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 08 01';
+ ^
+<sql-statement>
+SELECT date '1999 08 01';
+</sql-statement>
+<sql-statement>
+SET datestyle TO dmy;
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-18';
+</sql-statement>
+<sql-statement>
+SELECT date '1/8/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1/18/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '18/1/1999';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '18/1/1999';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "18/1/1999"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '18/1/1999';
+ ^
+<sql-statement>
+SELECT date '01/02/03';
+</sql-statement>
+<sql-statement>
+SELECT date '19990108';
+</sql-statement>
+<sql-statement>
+SELECT date '990108';
+</sql-statement>
+<sql-statement>
+SELECT date '1999.008';
+</sql-statement>
+<sql-statement>
+SELECT date 'J2451187';
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 99 BC';
+</sql-statement>
+<sql-statement>
+SELECT date '99-Jan-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-Jan-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-Jan-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-Jan-08';
+ ^
+<sql-statement>
+SELECT date '1999-Jan-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99-08-Jan"
+
+ SELECT date '99-08-Jan';
+ ^
+<sql-statement>
+SELECT date '1999-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '1999-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "1999-08-Jan"
+
+ SELECT date '1999-08-Jan';
+ ^
+<sql-statement>
+SELECT date '99 Jan 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 Jan 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 Jan 08"
+
+ SELECT date '99 Jan 08';
+ ^
+<sql-statement>
+SELECT date '1999 Jan 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 08 Jan"
+
+ SELECT date '99 08 Jan';
+ ^
+<sql-statement>
+SELECT date '1999 08 Jan';
+</sql-statement>
+<sql-statement>
+SELECT date '99-01-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-01-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-01-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-01-08';
+ ^
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-08-01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-08-01';
+ ^
+<sql-statement>
+SELECT date '1999-08-01';
+</sql-statement>
+<sql-statement>
+SELECT date '99 01 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 01 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 01 08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 01 08';
+ ^
+<sql-statement>
+SELECT date '1999 01 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 08 01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 08 01';
+ ^
+<sql-statement>
+SELECT date '1999 08 01';
+</sql-statement>
+<sql-statement>
+SET datestyle TO mdy;
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '1999-01-18';
+</sql-statement>
+<sql-statement>
+SELECT date '1/8/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '1/18/1999';
+</sql-statement>
+<sql-statement>
+SELECT date '18/1/1999';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '18/1/1999';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "18/1/1999"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '18/1/1999';
+ ^
+<sql-statement>
+SELECT date '01/02/03';
+</sql-statement>
+<sql-statement>
+SELECT date '19990108';
+</sql-statement>
+<sql-statement>
+SELECT date '990108';
+</sql-statement>
+<sql-statement>
+SELECT date '1999.008';
+</sql-statement>
+<sql-statement>
+SELECT date 'J2451187';
+</sql-statement>
+<sql-statement>
+SELECT date 'January 8, 99 BC';
+</sql-statement>
+<sql-statement>
+SELECT date '99-Jan-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-Jan-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-Jan-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-Jan-08';
+ ^
+<sql-statement>
+SELECT date '1999-Jan-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-Jan-1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99-08-Jan"
+
+ SELECT date '99-08-Jan';
+ ^
+<sql-statement>
+SELECT date '1999-08-Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '1999-08-Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "1999-08-Jan"
+
+ SELECT date '1999-08-Jan';
+ ^
+<sql-statement>
+SELECT date '99 Jan 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 Jan 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 Jan 08"
+
+ SELECT date '99 Jan 08';
+ ^
+<sql-statement>
+SELECT date '1999 Jan 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 Jan 1999';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date 'Jan 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 Jan';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 Jan';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type date: "99 08 Jan"
+
+ SELECT date '99 08 Jan';
+ ^
+<sql-statement>
+SELECT date '1999 08 Jan';
+</sql-statement>
+<sql-statement>
+SELECT date '99-01-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-01-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-01-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-01-08';
+ ^
+<sql-statement>
+SELECT date '1999-01-08';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-99';
+</sql-statement>
+<sql-statement>
+SELECT date '08-01-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-99';
+</sql-statement>
+<sql-statement>
+SELECT date '01-08-1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99-08-01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99-08-01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99-08-01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99-08-01';
+ ^
+<sql-statement>
+SELECT date '1999-08-01';
+</sql-statement>
+<sql-statement>
+SELECT date '99 01 08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 01 08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 01 08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 01 08';
+ ^
+<sql-statement>
+SELECT date '1999 01 08';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 99';
+</sql-statement>
+<sql-statement>
+SELECT date '08 01 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 99';
+</sql-statement>
+<sql-statement>
+SELECT date '01 08 1999';
+</sql-statement>
+<sql-statement>
+SELECT date '99 08 01';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '99 08 01';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "99 08 01"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT date '99 08 01';
+ ^
+<sql-statement>
+SELECT date '1999 08 01';
+</sql-statement>
+<sql-statement>
+-- Check upper and lower limits of date range
+SELECT date '4714-11-24 BC';
+</sql-statement>
+<sql-statement>
+SELECT date '4714-11-23 BC'; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '4714-11-23 BC'; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date out of range: "4714-11-23 BC"
+
+ SELECT date '4714-11-23 BC'; -- out of range
+ ^
+<sql-statement>
+SELECT date '5874897-12-31';
+</sql-statement>
+<sql-statement>
+SELECT date '5874898-01-01'; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '5874898-01-01'; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date out of range: "5874898-01-01"
+
+ SELECT date '5874898-01-01'; -- out of range
+ ^
+<sql-statement>
+RESET datestyle;
+</sql-statement>
+<sql-statement>
+--
+-- Simple math
+-- Leave most of it for the horology tests
+--
+SELECT f1 - date '2000-01-01' AS "Days From 2K" FROM DATE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 - date 'epoch' AS "Days From Epoch" FROM DATE_TBL;
+</sql-statement>
+<sql-statement>
+SELECT date 'yesterday' - date 'today' AS "One day";
+</sql-statement>
+<sql-statement>
+SELECT date 'today' - date 'tomorrow' AS "One day";
+</sql-statement>
+<sql-statement>
+SELECT date 'yesterday' - date 'tomorrow' AS "Two days";
+</sql-statement>
+<sql-statement>
+SELECT date 'tomorrow' - date 'today' AS "One day";
+</sql-statement>
+<sql-statement>
+SELECT date 'today' - date 'yesterday' AS "One day";
+</sql-statement>
+<sql-statement>
+SELECT date 'tomorrow' - date 'yesterday' AS "Two days";
+</sql-statement>
+<sql-statement>
+--
+-- test extract!
+--
+SELECT f1 as "date",
+ date_part('year', f1) AS year,
+ date_part('month', f1) AS month,
+ date_part('day', f1) AS day,
+ date_part('quarter', f1) AS quarter,
+ date_part('decade', f1) AS decade,
+ date_part('century', f1) AS century,
+ date_part('millennium', f1) AS millennium,
+ date_part('isoyear', f1) AS isoyear,
+ date_part('week', f1) AS week,
+ date_part('dow', f1) AS dow,
+ date_part('isodow', f1) AS isodow,
+ date_part('doy', f1) AS doy,
+ date_part('julian', f1) AS julian,
+ date_part('epoch', f1) AS epoch
+ FROM date_tbl;
+</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.date_tbl
+
+<sql-statement>
+--
+-- epoch
+--
+SELECT EXTRACT(EPOCH FROM DATE '1970-01-01'); -- 0
+</sql-statement>
+<sql-statement>
+--
+-- century
+--
+SELECT EXTRACT(CENTURY FROM DATE '0101-12-31 BC'); -- -2
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '0100-12-31 BC'); -- -1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '0001-12-31 BC'); -- -1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01 AD'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '1900-12-31'); -- 19
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '1901-01-01'); -- 20
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '2000-12-31'); -- 20
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '2001-01-01'); -- 21
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM CURRENT_DATE)>=21 AS True; -- true
+</sql-statement>
+<sql-statement>
+--
+-- millennium
+--
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-12-31 BC'); -- -1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-01-01 AD'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '1000-12-31'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '1001-01-01'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '2000-12-31'); -- 2
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '2001-01-01'); -- 3
+</sql-statement>
+<sql-statement>
+-- next test to be fixed on the turn of the next millennium;-)
+SELECT EXTRACT(MILLENNIUM FROM CURRENT_DATE); -- 3
+</sql-statement>
+<sql-statement>
+--
+-- decade
+--
+SELECT EXTRACT(DECADE FROM DATE '1994-12-25'); -- 199
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0010-01-01'); -- 1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0009-12-31'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0001-01-01 BC'); -- 0
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0002-12-31 BC'); -- -1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0011-01-01 BC'); -- -1
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '0012-12-31 BC'); -- -2
+</sql-statement>
+<sql-statement>
+--
+-- all possible fields
+--
+SELECT EXTRACT(MICROSECONDS FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "microseconds" not supported
+
+ --
+ ^
+<sql-statement>
+SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "milliseconds" not supported
+
+ SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "second" not supported
+
+ SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "minute" not supported
+
+ SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "hour" not supported
+
+ SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(DAY FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MONTH FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11 BC');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11 BC');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(QUARTER FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(WEEK FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DOW FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DOW FROM DATE '2020-08-16');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-16');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DOY FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "timezone" not supported
+
+ SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "timezone_m" not supported
+
+ SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "timezone_h" not supported
+
+ SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+ ^
+<sql-statement>
+SELECT EXTRACT(EPOCH FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(JULIAN FROM DATE '2020-08-11');
+</sql-statement>
+<sql-statement>
+--
+-- test trunc function!
+--
+SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('CENTURY', DATE '1970-03-20'); -- 1901
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
+</sql-statement>
+<sql-statement>
+SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
+</sql-statement>
+<sql-statement>
+--
+-- test infinity
+--
+select 'infinity'::date, '-infinity'::date;
+</sql-statement>
+<sql-statement>
+select 'infinity'::date > 'today'::date as t;
+</sql-statement>
+<sql-statement>
+select '-infinity'::date < 'today'::date as t;
+</sql-statement>
+<sql-statement>
+select isfinite('infinity'::date), isfinite('-infinity'::date), isfinite('today'::date);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select isfinite('infinity'::date), isfinite('-infinity'::date), isfinite('today'::date);
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: isfinite
+ select isfinite('infinity'::date), isfinite('-infinity'::date), isfinite('today'::date);
+ ^
+<sql-statement>
+--
+-- oscillating fields from non-finite date:
+--
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DAY FROM DATE '-infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+-- all supported fields
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MONTH FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(QUARTER FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(WEEK FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DOW FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISODOW FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DOY FROM DATE 'infinity'); -- NULL
+</sql-statement>
+<sql-statement>
+--
+-- monotonic fields from non-finite date:
+--
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(EPOCH FROM DATE '-infinity'); -- -Infinity
+</sql-statement>
+<sql-statement>
+-- all supported fields
+SELECT EXTRACT(YEAR FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLENNIUM FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(JULIAN FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(ISOYEAR FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+</sql-statement>
+<sql-statement>
+--
+-- wrong fields from non-finite date:
+--
+SELECT EXTRACT(MICROSEC FROM DATE 'infinity'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date units "microsec" not recognized
+
+ --
+ ^
+<sql-statement>
+-- test constructors
+select make_date(2013, 7, 15);
+</sql-statement>
+<sql-statement>
+select make_date(-44, 3, 15);
+</sql-statement>
+<sql-statement>
+select make_time(8, 20, 0.0);
+</sql-statement>
+<sql-statement>
+-- should fail
+select make_date(0, 7, 15);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date field value out of range: 0-07-15
+
+ -- should fail
+ ^
+<sql-statement>
+select make_date(2013, 2, 30);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select make_date(2013, 2, 30);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date field value out of range: 2013-02-30
+
+ select make_date(2013, 2, 30);
+ ^
+<sql-statement>
+select make_date(2013, 13, 1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select make_date(2013, 13, 1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date field value out of range: 2013-13-01
+
+ select make_date(2013, 13, 1);
+ ^
+<sql-statement>
+select make_date(2013, 11, -1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select make_date(2013, 11, -1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date field value out of range: 2013-11--1
+
+ select make_date(2013, 11, -1);
+ ^
+<sql-statement>
+select make_time(10, 55, 100.1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select make_time(10, 55, 100.1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time field value out of range: 10:55:100.1
+
+ select make_time(10, 55, 100.1);
+ ^
+<sql-statement>
+select make_time(24, 0, 2.1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select make_time(24, 0, 2.1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time field value out of range: 24:00:2.1
+
+ select make_time(24, 0, 2.1);
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/date.out b/yql/essentials/tests/postgresql/cases/date.out
new file mode 100644
index 0000000000..4169a1e604
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/date.out
@@ -0,0 +1,1105 @@
+--
+-- DATE
+--
+CREATE TABLE DATE_TBL (f1 date);
+INSERT INTO DATE_TBL VALUES ('1957-04-09');
+INSERT INTO DATE_TBL VALUES ('1957-06-13');
+INSERT INTO DATE_TBL VALUES ('1996-02-28');
+INSERT INTO DATE_TBL VALUES ('1996-02-29');
+INSERT INTO DATE_TBL VALUES ('1996-03-01');
+INSERT INTO DATE_TBL VALUES ('1996-03-02');
+INSERT INTO DATE_TBL VALUES ('1997-02-28');
+INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ERROR: date/time field value out of range: "1997-02-29"
+LINE 1: INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ ^
+INSERT INTO DATE_TBL VALUES ('1997-03-01');
+INSERT INTO DATE_TBL VALUES ('1997-03-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-01');
+INSERT INTO DATE_TBL VALUES ('2000-04-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-03');
+INSERT INTO DATE_TBL VALUES ('2038-04-08');
+INSERT INTO DATE_TBL VALUES ('2039-04-09');
+INSERT INTO DATE_TBL VALUES ('2040-04-10');
+INSERT INTO DATE_TBL VALUES ('2040-04-10 BC');
+--
+-- Check all the documented input formats
+--
+SET datestyle TO iso; -- display results in ISO
+SET datestyle TO ymd;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '18/1/1999';
+ERROR: date/time field value out of range: "18/1/1999"
+LINE 1: SELECT date '18/1/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SET datestyle TO dmy;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'January 8, 99 BC';
+ date
+---------------
+ 0099-01-08 BC
+(1 row)
+
+SELECT date '99-Jan-08';
+ERROR: date/time field value out of range: "99-Jan-08"
+LINE 1: SELECT date '99-Jan-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 Jan';
+ERROR: invalid input syntax for type date: "99 08 Jan"
+LINE 1: SELECT date '99 08 Jan';
+ ^
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-01-08';
+ERROR: date/time field value out of range: "99-01-08"
+LINE 1: SELECT date '99-01-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-01';
+ERROR: date/time field value out of range: "99-08-01"
+LINE 1: SELECT date '99-08-01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 01 08';
+ERROR: date/time field value out of range: "99 01 08"
+LINE 1: SELECT date '99 01 08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 01';
+ERROR: date/time field value out of range: "99 08 01"
+LINE 1: SELECT date '99 08 01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SET datestyle TO mdy;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '1/8/1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1/18/1999';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '18/1/1999';
+ERROR: date/time field value out of range: "18/1/1999"
+LINE 1: SELECT date '18/1/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01/02/03';
+ date
+------------
+ 2003-01-02
+(1 row)
+
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'January 8, 99 BC';
+ date
+---------------
+ 0099-01-08 BC
+(1 row)
+
+SELECT date '99-Jan-08';
+ERROR: date/time field value out of range: "99-Jan-08"
+LINE 1: SELECT date '99-Jan-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '99 Jan 08';
+ERROR: invalid input syntax for type date: "99 Jan 08"
+LINE 1: SELECT date '99 Jan 08';
+ ^
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 Jan';
+ERROR: invalid input syntax for type date: "99 08 Jan"
+LINE 1: SELECT date '99 08 Jan';
+ ^
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-01-08';
+ERROR: date/time field value out of range: "99-01-08"
+LINE 1: SELECT date '99-01-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-01-99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '08-01-1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-01';
+ERROR: date/time field value out of range: "99-08-01"
+LINE 1: SELECT date '99-08-01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 01 08';
+ERROR: date/time field value out of range: "99 01 08"
+LINE 1: SELECT date '99 01 08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 01 99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '08 01 1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 01';
+ERROR: date/time field value out of range: "99 08 01"
+LINE 1: SELECT date '99 08 01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+-- Check upper and lower limits of date range
+SELECT date '4714-11-24 BC';
+ date
+---------------
+ 4714-11-24 BC
+(1 row)
+
+SELECT date '4714-11-23 BC'; -- out of range
+ERROR: date out of range: "4714-11-23 BC"
+LINE 1: SELECT date '4714-11-23 BC';
+ ^
+SELECT date '5874897-12-31';
+ date
+---------------
+ 5874897-12-31
+(1 row)
+
+SELECT date '5874898-01-01'; -- out of range
+ERROR: date out of range: "5874898-01-01"
+LINE 1: SELECT date '5874898-01-01';
+ ^
+RESET datestyle;
+--
+-- Simple math
+-- Leave most of it for the horology tests
+--
+SELECT f1 - date '2000-01-01' AS "Days From 2K" FROM DATE_TBL;
+ Days From 2K
+--------------
+ -15607
+ -15542
+ -1403
+ -1402
+ -1401
+ -1400
+ -1037
+ -1036
+ -1035
+ 91
+ 92
+ 93
+ 13977
+ 14343
+ 14710
+ -1475115
+(16 rows)
+
+SELECT f1 - date 'epoch' AS "Days From Epoch" FROM DATE_TBL;
+ Days From Epoch
+-----------------
+ -4650
+ -4585
+ 9554
+ 9555
+ 9556
+ 9557
+ 9920
+ 9921
+ 9922
+ 11048
+ 11049
+ 11050
+ 24934
+ 25300
+ 25667
+ -1464158
+(16 rows)
+
+SELECT date 'yesterday' - date 'today' AS "One day";
+ One day
+---------
+ -1
+(1 row)
+
+SELECT date 'today' - date 'tomorrow' AS "One day";
+ One day
+---------
+ -1
+(1 row)
+
+SELECT date 'yesterday' - date 'tomorrow' AS "Two days";
+ Two days
+----------
+ -2
+(1 row)
+
+SELECT date 'tomorrow' - date 'today' AS "One day";
+ One day
+---------
+ 1
+(1 row)
+
+SELECT date 'today' - date 'yesterday' AS "One day";
+ One day
+---------
+ 1
+(1 row)
+
+SELECT date 'tomorrow' - date 'yesterday' AS "Two days";
+ Two days
+----------
+ 2
+(1 row)
+
+--
+-- century
+--
+SELECT EXTRACT(CENTURY FROM DATE '0101-12-31 BC'); -- -2
+ extract
+---------
+ -2
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0100-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01 AD'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '1900-12-31'); -- 19
+ extract
+---------
+ 19
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '1901-01-01'); -- 20
+ extract
+---------
+ 20
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2000-12-31'); -- 20
+ extract
+---------
+ 20
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2001-01-01'); -- 21
+ extract
+---------
+ 21
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM CURRENT_DATE)>=21 AS True; -- true
+ true
+------
+ t
+(1 row)
+
+--
+-- millennium
+--
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-01-01 AD'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '1000-12-31'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '1001-01-01'); -- 2
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2000-12-31'); -- 2
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2001-01-01'); -- 3
+ extract
+---------
+ 3
+(1 row)
+
+-- next test to be fixed on the turn of the next millennium;-)
+SELECT EXTRACT(MILLENNIUM FROM CURRENT_DATE); -- 3
+ extract
+---------
+ 3
+(1 row)
+
+--
+-- decade
+--
+SELECT EXTRACT(DECADE FROM DATE '1994-12-25'); -- 199
+ extract
+---------
+ 199
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0010-01-01'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0002-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0011-01-01 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0012-12-31 BC'); -- -2
+ extract
+---------
+ -2
+(1 row)
+
+--
+-- all possible fields
+--
+SELECT EXTRACT(MICROSECONDS FROM DATE '2020-08-11');
+ERROR: date units "microseconds" not supported
+SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+ERROR: date units "milliseconds" not supported
+SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+ERROR: date units "second" not supported
+SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+ERROR: date units "minute" not supported
+SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+ERROR: date units "hour" not supported
+SELECT EXTRACT(DAY FROM DATE '2020-08-11');
+ extract
+---------
+ 11
+(1 row)
+
+SELECT EXTRACT(MONTH FROM DATE '2020-08-11');
+ extract
+---------
+ 8
+(1 row)
+
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11');
+ extract
+---------
+ 2020
+(1 row)
+
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11 BC');
+ extract
+---------
+ -2020
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '2020-08-11');
+ extract
+---------
+ 202
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2020-08-11');
+ extract
+---------
+ 21
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2020-08-11');
+ extract
+---------
+ 3
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11');
+ extract
+---------
+ 2020
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11 BC');
+ extract
+---------
+ -2020
+(1 row)
+
+SELECT EXTRACT(QUARTER FROM DATE '2020-08-11');
+ extract
+---------
+ 3
+(1 row)
+
+SELECT EXTRACT(WEEK FROM DATE '2020-08-11');
+ extract
+---------
+ 33
+(1 row)
+
+SELECT EXTRACT(DOW FROM DATE '2020-08-11');
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-11');
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-16');
+ extract
+---------
+ 7
+(1 row)
+
+SELECT EXTRACT(DOY FROM DATE '2020-08-11');
+ extract
+---------
+ 224
+(1 row)
+
+SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+ERROR: date units "timezone" not supported
+SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+ERROR: date units "timezone_m" not supported
+SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+ERROR: date units "timezone_h" not supported
+SELECT EXTRACT(EPOCH FROM DATE '2020-08-11');
+ extract
+------------
+ 1597104000
+(1 row)
+
+SELECT EXTRACT(JULIAN FROM DATE '2020-08-11');
+ extract
+---------
+ 2459073
+(1 row)
+
+--
+-- test infinity
+--
+select 'infinity'::date, '-infinity'::date;
+ date | date
+----------+-----------
+ infinity | -infinity
+(1 row)
+
+select 'infinity'::date > 'today'::date as t;
+ t
+---
+ t
+(1 row)
+
+select '-infinity'::date < 'today'::date as t;
+ t
+---
+ t
+(1 row)
+
+--
+-- oscillating fields from non-finite date:
+--
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DAY FROM DATE '-infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+-- all supported fields
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(MONTH FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(QUARTER FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(WEEK FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DOW FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DOY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+--
+-- monotonic fields from non-finite date:
+--
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM DATE '-infinity'); -- -Infinity
+ extract
+-----------
+ -Infinity
+(1 row)
+
+-- all supported fields
+SELECT EXTRACT(YEAR FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(JULIAN FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+--
+-- wrong fields from non-finite date:
+--
+SELECT EXTRACT(MICROSEC FROM DATE 'infinity'); -- error
+ERROR: date units "microsec" not recognized
+select make_time(8, 20, 0.0);
+ make_time
+-----------
+ 08:20:00
+(1 row)
+
+-- should fail
+select make_date(0, 7, 15);
+ERROR: date field value out of range: 0-07-15
+select make_date(2013, 2, 30);
+ERROR: date field value out of range: 2013-02-30
+select make_date(2013, 13, 1);
+ERROR: date field value out of range: 2013-13-01
+select make_date(2013, 11, -1);
+ERROR: date field value out of range: 2013-11--1
+select make_time(10, 55, 100.1);
+ERROR: time field value out of range: 10:55:100.1
+select make_time(24, 0, 2.1);
+ERROR: time field value out of range: 24:00:2.1
diff --git a/yql/essentials/tests/postgresql/cases/date.sql b/yql/essentials/tests/postgresql/cases/date.sql
new file mode 100644
index 0000000000..47c179db23
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/date.sql
@@ -0,0 +1,246 @@
+--
+-- DATE
+--
+CREATE TABLE DATE_TBL (f1 date);
+INSERT INTO DATE_TBL VALUES ('1957-04-09');
+INSERT INTO DATE_TBL VALUES ('1957-06-13');
+INSERT INTO DATE_TBL VALUES ('1996-02-28');
+INSERT INTO DATE_TBL VALUES ('1996-02-29');
+INSERT INTO DATE_TBL VALUES ('1996-03-01');
+INSERT INTO DATE_TBL VALUES ('1996-03-02');
+INSERT INTO DATE_TBL VALUES ('1997-02-28');
+INSERT INTO DATE_TBL VALUES ('1997-02-29');
+INSERT INTO DATE_TBL VALUES ('1997-03-01');
+INSERT INTO DATE_TBL VALUES ('1997-03-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-01');
+INSERT INTO DATE_TBL VALUES ('2000-04-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-03');
+INSERT INTO DATE_TBL VALUES ('2038-04-08');
+INSERT INTO DATE_TBL VALUES ('2039-04-09');
+INSERT INTO DATE_TBL VALUES ('2040-04-10');
+INSERT INTO DATE_TBL VALUES ('2040-04-10 BC');
+--
+-- Check all the documented input formats
+--
+SET datestyle TO iso; -- display results in ISO
+SET datestyle TO ymd;
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '18/1/1999';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 1999';
+SELECT date '1999 08 Jan';
+SELECT date '1999-01-08';
+SELECT date '1999-08-01';
+SELECT date '1999 01 08';
+SELECT date '1999 08 01';
+SET datestyle TO dmy;
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date 'January 8, 99 BC';
+SELECT date '99-Jan-08';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-99';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-99';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 99';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 99';
+SELECT date 'Jan 08 1999';
+SELECT date '99 08 Jan';
+SELECT date '1999 08 Jan';
+SELECT date '99-01-08';
+SELECT date '1999-01-08';
+SELECT date '99-08-01';
+SELECT date '1999-08-01';
+SELECT date '99 01 08';
+SELECT date '1999 01 08';
+SELECT date '99 08 01';
+SELECT date '1999 08 01';
+SET datestyle TO mdy;
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '1/8/1999';
+SELECT date '1/18/1999';
+SELECT date '18/1/1999';
+SELECT date '01/02/03';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date 'January 8, 99 BC';
+SELECT date '99-Jan-08';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-99';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-99';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+SELECT date '99 Jan 08';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 99';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 99';
+SELECT date 'Jan 08 1999';
+SELECT date '99 08 Jan';
+SELECT date '1999 08 Jan';
+SELECT date '99-01-08';
+SELECT date '1999-01-08';
+SELECT date '08-01-99';
+SELECT date '08-01-1999';
+SELECT date '01-08-99';
+SELECT date '01-08-1999';
+SELECT date '99-08-01';
+SELECT date '1999-08-01';
+SELECT date '99 01 08';
+SELECT date '1999 01 08';
+SELECT date '08 01 99';
+SELECT date '08 01 1999';
+SELECT date '01 08 99';
+SELECT date '01 08 1999';
+SELECT date '99 08 01';
+SELECT date '1999 08 01';
+-- Check upper and lower limits of date range
+SELECT date '4714-11-24 BC';
+SELECT date '4714-11-23 BC'; -- out of range
+SELECT date '5874897-12-31';
+SELECT date '5874898-01-01'; -- out of range
+RESET datestyle;
+--
+-- Simple math
+-- Leave most of it for the horology tests
+--
+SELECT f1 - date '2000-01-01' AS "Days From 2K" FROM DATE_TBL;
+SELECT f1 - date 'epoch' AS "Days From Epoch" FROM DATE_TBL;
+SELECT date 'yesterday' - date 'today' AS "One day";
+SELECT date 'today' - date 'tomorrow' AS "One day";
+SELECT date 'yesterday' - date 'tomorrow' AS "Two days";
+SELECT date 'tomorrow' - date 'today' AS "One day";
+SELECT date 'today' - date 'yesterday' AS "One day";
+SELECT date 'tomorrow' - date 'yesterday' AS "Two days";
+--
+-- century
+--
+SELECT EXTRACT(CENTURY FROM DATE '0101-12-31 BC'); -- -2
+SELECT EXTRACT(CENTURY FROM DATE '0100-12-31 BC'); -- -1
+SELECT EXTRACT(CENTURY FROM DATE '0001-12-31 BC'); -- -1
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01'); -- 1
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01 AD'); -- 1
+SELECT EXTRACT(CENTURY FROM DATE '1900-12-31'); -- 19
+SELECT EXTRACT(CENTURY FROM DATE '1901-01-01'); -- 20
+SELECT EXTRACT(CENTURY FROM DATE '2000-12-31'); -- 20
+SELECT EXTRACT(CENTURY FROM DATE '2001-01-01'); -- 21
+SELECT EXTRACT(CENTURY FROM CURRENT_DATE)>=21 AS True; -- true
+--
+-- millennium
+--
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-12-31 BC'); -- -1
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-01-01 AD'); -- 1
+SELECT EXTRACT(MILLENNIUM FROM DATE '1000-12-31'); -- 1
+SELECT EXTRACT(MILLENNIUM FROM DATE '1001-01-01'); -- 2
+SELECT EXTRACT(MILLENNIUM FROM DATE '2000-12-31'); -- 2
+SELECT EXTRACT(MILLENNIUM FROM DATE '2001-01-01'); -- 3
+-- next test to be fixed on the turn of the next millennium;-)
+SELECT EXTRACT(MILLENNIUM FROM CURRENT_DATE); -- 3
+--
+-- decade
+--
+SELECT EXTRACT(DECADE FROM DATE '1994-12-25'); -- 199
+SELECT EXTRACT(DECADE FROM DATE '0010-01-01'); -- 1
+SELECT EXTRACT(DECADE FROM DATE '0002-12-31 BC'); -- -1
+SELECT EXTRACT(DECADE FROM DATE '0011-01-01 BC'); -- -1
+SELECT EXTRACT(DECADE FROM DATE '0012-12-31 BC'); -- -2
+--
+-- all possible fields
+--
+SELECT EXTRACT(MICROSECONDS FROM DATE '2020-08-11');
+SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+SELECT EXTRACT(DAY FROM DATE '2020-08-11');
+SELECT EXTRACT(MONTH FROM DATE '2020-08-11');
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11');
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11 BC');
+SELECT EXTRACT(DECADE FROM DATE '2020-08-11');
+SELECT EXTRACT(CENTURY FROM DATE '2020-08-11');
+SELECT EXTRACT(MILLENNIUM FROM DATE '2020-08-11');
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11');
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11 BC');
+SELECT EXTRACT(QUARTER FROM DATE '2020-08-11');
+SELECT EXTRACT(WEEK FROM DATE '2020-08-11');
+SELECT EXTRACT(DOW FROM DATE '2020-08-11');
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-11');
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-16');
+SELECT EXTRACT(DOY FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+SELECT EXTRACT(EPOCH FROM DATE '2020-08-11');
+SELECT EXTRACT(JULIAN FROM DATE '2020-08-11');
+--
+-- test infinity
+--
+select 'infinity'::date, '-infinity'::date;
+select 'infinity'::date > 'today'::date as t;
+select '-infinity'::date < 'today'::date as t;
+--
+-- oscillating fields from non-finite date:
+--
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DAY FROM DATE '-infinity'); -- NULL
+-- all supported fields
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(MONTH FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(QUARTER FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(WEEK FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DOW FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(ISODOW FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DOY FROM DATE 'infinity'); -- NULL
+--
+-- monotonic fields from non-finite date:
+--
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(EPOCH FROM DATE '-infinity'); -- -Infinity
+-- all supported fields
+SELECT EXTRACT(YEAR FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(DECADE FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(CENTURY FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(MILLENNIUM FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(JULIAN FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(ISOYEAR FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+--
+-- wrong fields from non-finite date:
+--
+SELECT EXTRACT(MICROSEC FROM DATE 'infinity'); -- error
+select make_time(8, 20, 0.0);
+-- should fail
+select make_date(0, 7, 15);
+select make_date(2013, 2, 30);
+select make_date(2013, 13, 1);
+select make_date(2013, 11, -1);
+select make_time(10, 55, 100.1);
+select make_time(24, 0, 2.1);
diff --git a/yql/essentials/tests/postgresql/cases/dbsize.err b/yql/essentials/tests/postgresql/cases/dbsize.err
new file mode 100644
index 0000000000..ae31573877
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/dbsize.err
@@ -0,0 +1,291 @@
+<sql-statement>
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::bigint), (1000::bigint), (1000000::bigint),
+ (1000000000::bigint), (1000000000000::bigint),
+ (1000000000000000::bigint)) x(size);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+<sql-statement>
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::numeric), (1000::numeric), (1000000::numeric),
+ (1000000000::numeric), (1000000000000::numeric),
+ (1000000000000000::numeric),
+ (10.5::numeric), (1000.5::numeric), (1000000.5::numeric),
+ (1000000000.5::numeric), (1000000000000.5::numeric),
+ (1000000000000000.5::numeric)) x(size);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+<sql-statement>
+-- test where units change up
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::bigint), (10240::bigint),
+ (10485247::bigint), (10485248::bigint),
+ (10736893951::bigint), (10736893952::bigint),
+ (10994579406847::bigint), (10994579406848::bigint),
+ (11258449312612351::bigint), (11258449312612352::bigint)) x(size);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test where units change up
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
+ -- test where units change up
+ ^
+<sql-statement>
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::numeric), (10240::numeric),
+ (10485247::numeric), (10485248::numeric),
+ (10736893951::numeric), (10736893952::numeric),
+ (10994579406847::numeric), (10994579406848::numeric),
+ (11258449312612351::numeric), (11258449312612352::numeric)) x(size);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: pg_size_pretty
+ SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ ^
+<sql-statement>
+-- pg_size_bytes() tests
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
+ ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
+</sql-statement>
+<sql-statement>
+-- case-insensitive units are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
+ ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
+</sql-statement>
+<sql-statement>
+-- negative numbers are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
+ ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
+</sql-statement>
+<sql-statement>
+-- different cases with allowed points
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
+ ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
+</sql-statement>
+<sql-statement>
+-- invalid inputs
+SELECT pg_size_bytes('1 AB');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- invalid inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB"
+DETAIL: Invalid size unit: "AB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+
+ -- invalid inputs
+ ^
+<sql-statement>
+SELECT pg_size_bytes('1 AB A');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('1 AB A');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB A"
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+
+ SELECT pg_size_bytes('1 AB A');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('1 AB A ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('1 AB A ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 AB A "
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+
+ SELECT pg_size_bytes('1 AB A ');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('9223372036854775807.9');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('9223372036854775807.9');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT pg_size_bytes('9223372036854775807.9');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('1e100');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('1e100');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT pg_size_bytes('1e100');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('1e1000000000000000000');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('1e1000000000000000000');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
+
+ SELECT pg_size_bytes('1e1000000000000000000');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "1 byte"
+DETAIL: Invalid size unit: "byte".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+
+ SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+ ^
+<sql-statement>
+SELECT pg_size_bytes('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ""
+
+ SELECT pg_size_bytes('');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('kb');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('kb');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "kb"
+
+ SELECT pg_size_bytes('kb');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('..');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('..');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ".."
+
+ SELECT pg_size_bytes('..');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('-.');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('-.');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-."
+
+ SELECT pg_size_bytes('-.');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('-.kb');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('-.kb');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-.kb"
+
+ SELECT pg_size_bytes('-.kb');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('-. kb');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('-. kb');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "-. kb"
+
+ SELECT pg_size_bytes('-. kb');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('.+912');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('.+912');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: ".+912"
+
+ SELECT pg_size_bytes('.+912');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('+912+ kB');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('+912+ kB');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "+912+ kB"
+DETAIL: Invalid size unit: "+ kB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+
+ SELECT pg_size_bytes('+912+ kB');
+ ^
+<sql-statement>
+SELECT pg_size_bytes('++123 kB');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_bytes('++123 kB');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid size: "++123 kB"
+
+ SELECT pg_size_bytes('++123 kB');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/dbsize.out b/yql/essentials/tests/postgresql/cases/dbsize.out
new file mode 100644
index 0000000000..55e68ac48c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/dbsize.out
@@ -0,0 +1,110 @@
+-- pg_size_bytes() tests
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
+ ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
+ size | pg_size_bytes
+----------+------------------
+ 1 | 1
+ 123bytes | 123
+ 1kB | 1024
+ 1MB | 1048576
+ 1 GB | 1073741824
+ 1.5 GB | 1610612736
+ 1TB | 1099511627776
+ 3000 TB | 3298534883328000
+ 1e6 MB | 1048576000000
+(9 rows)
+
+-- case-insensitive units are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
+ ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
+ size | pg_size_bytes
+----------+------------------
+ 1 | 1
+ 123bYteS | 123
+ 1kb | 1024
+ 1mb | 1048576
+ 1 Gb | 1073741824
+ 1.5 gB | 1610612736
+ 1tb | 1099511627776
+ 3000 tb | 3298534883328000
+ 1e6 mb | 1048576000000
+(9 rows)
+
+-- negative numbers are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
+ ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
+ size | pg_size_bytes
+-----------+-------------------
+ -1 | -1
+ -123bytes | -123
+ -1kb | -1024
+ -1mb | -1048576
+ -1 Gb | -1073741824
+ -1.5 gB | -1610612736
+ -1tb | -1099511627776
+ -3000 TB | -3298534883328000
+ -10e-1 MB | -1048576
+(9 rows)
+
+-- different cases with allowed points
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
+ ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
+ size | pg_size_bytes
+--------+---------------
+ -1. | -1
+ -1.kb | -1024
+ -1. kb | -1024
+ -0. gb | 0
+ -.1 | 0
+ -.1kb | -102
+ -.1 kb | -102
+ -.0 gb | 0
+(8 rows)
+
+-- invalid inputs
+SELECT pg_size_bytes('1 AB');
+ERROR: invalid size: "1 AB"
+DETAIL: Invalid size unit: "AB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('1 AB A');
+ERROR: invalid size: "1 AB A"
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('1 AB A ');
+ERROR: invalid size: "1 AB A "
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('9223372036854775807.9');
+ERROR: bigint out of range
+SELECT pg_size_bytes('1e100');
+ERROR: bigint out of range
+SELECT pg_size_bytes('1e1000000000000000000');
+ERROR: value overflows numeric format
+SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+ERROR: invalid size: "1 byte"
+DETAIL: Invalid size unit: "byte".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('');
+ERROR: invalid size: ""
+SELECT pg_size_bytes('kb');
+ERROR: invalid size: "kb"
+SELECT pg_size_bytes('..');
+ERROR: invalid size: ".."
+SELECT pg_size_bytes('-.');
+ERROR: invalid size: "-."
+SELECT pg_size_bytes('-.kb');
+ERROR: invalid size: "-.kb"
+SELECT pg_size_bytes('-. kb');
+ERROR: invalid size: "-. kb"
+SELECT pg_size_bytes('.+912');
+ERROR: invalid size: ".+912"
+SELECT pg_size_bytes('+912+ kB');
+ERROR: invalid size: "+912+ kB"
+DETAIL: Invalid size unit: "+ kB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('++123 kB');
+ERROR: invalid size: "++123 kB"
diff --git a/yql/essentials/tests/postgresql/cases/dbsize.sql b/yql/essentials/tests/postgresql/cases/dbsize.sql
new file mode 100644
index 0000000000..1a391ef8f9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/dbsize.sql
@@ -0,0 +1,33 @@
+-- pg_size_bytes() tests
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
+ ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
+-- case-insensitive units are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
+ ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
+-- negative numbers are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
+ ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
+-- different cases with allowed points
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
+ ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
+-- invalid inputs
+SELECT pg_size_bytes('1 AB');
+SELECT pg_size_bytes('1 AB A');
+SELECT pg_size_bytes('1 AB A ');
+SELECT pg_size_bytes('9223372036854775807.9');
+SELECT pg_size_bytes('1e100');
+SELECT pg_size_bytes('1e1000000000000000000');
+SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+SELECT pg_size_bytes('');
+SELECT pg_size_bytes('kb');
+SELECT pg_size_bytes('..');
+SELECT pg_size_bytes('-.');
+SELECT pg_size_bytes('-.kb');
+SELECT pg_size_bytes('-. kb');
+SELECT pg_size_bytes('.+912');
+SELECT pg_size_bytes('+912+ kB');
+SELECT pg_size_bytes('++123 kB');
diff --git a/yql/essentials/tests/postgresql/cases/delete.err b/yql/essentials/tests/postgresql/cases/delete.err
new file mode 100644
index 0000000000..7227577469
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/delete.err
@@ -0,0 +1,52 @@
+<sql-statement>
+CREATE TABLE delete_test (
+ id SERIAL PRIMARY KEY,
+ a INT,
+ b text
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO delete_test (a) VALUES (10);
+</sql-statement>
+<sql-statement>
+INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000));
+</sql-statement>
+<sql-statement>
+INSERT INTO delete_test (a) VALUES (100);
+</sql-statement>
+<sql-statement>
+-- allow an alias to be specified for DELETE's target table
+DELETE FROM delete_test AS dt WHERE dt.a > 75;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ -- allow an alias to be specified for DELETE's target table
+ ^
+<sql-statement>
+-- if an alias is specified, don't allow the original table name
+-- to be referenced
+DELETE FROM delete_test dt WHERE delete_test.a > 25;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ -- if an alias is specified, don't allow the original table name
+ ^
+<sql-statement>
+SELECT id, a, char_length(b) FROM delete_test;
+</sql-statement>
+<sql-statement>
+-- delete a row with a TOASTed value
+DELETE FROM delete_test WHERE a > 25;
+</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 id, a, char_length(b) FROM delete_test;
+</sql-statement>
+<sql-statement>
+DROP TABLE delete_test;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/delete.out b/yql/essentials/tests/postgresql/cases/delete.out
new file mode 100644
index 0000000000..6ab34ba7e2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/delete.out
@@ -0,0 +1,9 @@
+CREATE TABLE delete_test (
+ id SERIAL PRIMARY KEY,
+ a INT,
+ b text
+);
+INSERT INTO delete_test (a) VALUES (10);
+INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000));
+INSERT INTO delete_test (a) VALUES (100);
+DROP TABLE delete_test;
diff --git a/yql/essentials/tests/postgresql/cases/delete.sql b/yql/essentials/tests/postgresql/cases/delete.sql
new file mode 100644
index 0000000000..6ab34ba7e2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/delete.sql
@@ -0,0 +1,9 @@
+CREATE TABLE delete_test (
+ id SERIAL PRIMARY KEY,
+ a INT,
+ b text
+);
+INSERT INTO delete_test (a) VALUES (10);
+INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000));
+INSERT INTO delete_test (a) VALUES (100);
+DROP TABLE delete_test;
diff --git a/yql/essentials/tests/postgresql/cases/expressions.err b/yql/essentials/tests/postgresql/cases/expressions.err
new file mode 100644
index 0000000000..c5ca77c1ab
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/expressions.err
@@ -0,0 +1,591 @@
+Registering pre-existing tables
+ date_tbl
+<sql-statement>
+--
+-- expression evaluation tests that don't fit into a more specific file
+--
+--
+-- Tests for SQLVAlueFunction
+--
+-- current_date (always matches because of transactional behaviour)
+SELECT date(now())::text = current_date::text;
+</sql-statement>
+<sql-statement>
+-- current_time / localtime
+SELECT now()::timetz::text = current_time::text;
+</sql-statement>
+<sql-statement>
+SELECT now()::timetz(4)::text = current_time(4)::text;
+</sql-statement>
+<sql-statement>
+SELECT now()::time::text = localtime::text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:28: Error: Usupported SQLValueFunction: 5
+ SELECT now()::time::text = localtime::text;
+ ^
+<sql-statement>
+SELECT now()::time(3)::text = localtime(3)::text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:31: Error: Usupported SQLValueFunction: 6
+ SELECT now()::time(3)::text = localtime(3)::text;
+ ^
+<sql-statement>
+-- current_timestamp / localtimestamp (always matches because of transactional behaviour)
+SELECT current_timestamp = NOW();
+</sql-statement>
+<sql-statement>
+-- precision
+SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
+</sql-statement>
+<sql-statement>
+-- localtimestamp
+SELECT now()::timestamp::text = localtimestamp::text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:33: Error: Usupported SQLValueFunction: 7
+ SELECT now()::timestamp::text = localtimestamp::text;
+ ^
+<sql-statement>
+-- current_role/user/user is tested in rolnames.sql
+-- current database / catalog
+SELECT current_catalog = current_database();
+</sql-statement>
+<sql-statement>
+-- current_schema
+SELECT current_schema;
+</sql-statement>
+<sql-statement>
+SET search_path = 'notme';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, search path supports only 'information_schema', 'public', 'pg_catalog', '' but got: 'notme'
+ SET search_path = 'notme';
+ ^
+<sql-statement>
+SELECT current_schema;
+</sql-statement>
+<sql-statement>
+SET search_path = 'pg_catalog';
+</sql-statement>
+<sql-statement>
+SELECT current_schema;
+</sql-statement>
+<sql-statement>
+RESET search_path;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET search_path;
+ ^
+<sql-statement>
+--
+-- Tests for BETWEEN
+--
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgReadTable!
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
+ select count(*) from date_tbl
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgReadTable!
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
+ select count(*) from date_tbl
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgReadTable!
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
+ select count(*) from date_tbl
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgReadTable!
+ select count(*) from date_tbl
+ ^
+ -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
+ select count(*) from date_tbl
+ ^
+<sql-statement>
+--
+-- Test parsing of a no-op cast to a type with unspecified typmod
+--
+begin;
+</sql-statement>
+<sql-statement>
+create table numeric_tbl (f1 numeric(18,3), f2 numeric);
+</sql-statement>
+<sql-statement>
+create view numeric_view as
+ select
+ f1, f1::numeric(16,4) as f1164, f1::numeric as f1n,
+ f2, f2::numeric(16,4) as f2164, f2::numeric as f2n
+ from numeric_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create view numeric_view as
+ ^
+<sql-statement>
+\d+ numeric_view
+</sql-statement>
+Metacommand \d+ numeric_view is not supported
+<sql-statement>
+explain (verbose, costs off) select * from numeric_view;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off) select * from numeric_view;
+ ^
+<sql-statement>
+-- bpchar, lacking planner support for its length coercion function,
+-- could behave differently
+create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
+</sql-statement>
+<sql-statement>
+create view bpchar_view as
+ select
+ f1, f1::character(14) as f114, f1::bpchar as f1n,
+ f2, f2::character(14) as f214, f2::bpchar as f2n
+ from bpchar_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create view bpchar_view as
+ ^
+<sql-statement>
+\d+ bpchar_view
+</sql-statement>
+Metacommand \d+ bpchar_view is not supported
+<sql-statement>
+explain (verbose, costs off) select * from bpchar_view
+ where f1::bpchar = 'foo';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off) select * from bpchar_view
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- Ordinarily, IN/NOT IN can be converted to a ScalarArrayOpExpr
+-- with a suitably-chosen array type.
+--
+explain (verbose, costs off)
+select random() IN (1, 4, 8.0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select random()::int IN (1, 4, 8.0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+-- However, if there's not a common supertype for the IN elements,
+-- we should instead try to produce "x = v1 OR x = v2 OR ...".
+-- In most cases that'll fail for lack of all the requisite = operators,
+-- but it can succeed sometimes. So this should complain about lack of
+-- an = operator, not about cast failure.
+select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- However, if there's not a common supertype for the IN elements,
+ ^
+ -stdin-:<main>:6:23: Error: At function: PgIn
+ select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+ ^
+ -stdin-:<main>:6:40: Error: Cannot infer common type for types 600 and 603
+ select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+ ^
+<sql-statement>
+--
+-- Tests for ScalarArrayOpExpr with a hashfn
+--
+-- create a stable function so that the tests below are not
+-- evaluated using the planner's constant folding.
+begin;
+</sql-statement>
+<sql-statement>
+create function return_int_input(int) returns int as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function return_int_input(int) returns int as $$
+ ^
+<sql-statement>
+create function return_text_input(text) returns text as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function return_text_input(text) returns text as $$
+ ^
+<sql-statement>
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 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 return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:28: Error: At function: PgIn
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+<sql-statement>
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 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 return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:28: Error: At function: PgIn
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+<sql-statement>
+select return_int_input(1) in (null, null, null, null, null, null, null, null, null, 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 return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+ ^
+ -stdin-:<main>:1:28: Error: At function: PgIn
+ select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+ ^
+<sql-statement>
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, 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 return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+ ^
+ -stdin-:<main>:1:28: Error: At function: PgIn
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+ ^
+<sql-statement>
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 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 return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:36: Error: At function: PgIn
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ^
+<sql-statement>
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 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 return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:36: Error: At function: PgIn
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_int_input
+ select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ^
+<sql-statement>
+select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+</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 return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+ ^
+ -stdin-:<main>:1:31: Error: At function: PgIn
+ select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: return_text_input
+ select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- Test with non-strict equality function.
+-- We need to create our own type for this.
+begin;
+</sql-statement>
+<sql-statement>
+create type myint;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create type myint;
+ ^
+<sql-statement>
+create function myintin(cstring) returns myint strict immutable language
+ internal as 'int4in';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function myintin(cstring) returns myint strict immutable language
+ ^
+<sql-statement>
+create function myintout(myint) returns cstring strict immutable language
+ internal as 'int4out';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function myintout(myint) returns cstring strict immutable language
+ ^
+<sql-statement>
+create function myinthash(myint) returns integer strict immutable language
+ internal as 'hashint4';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function myinthash(myint) returns integer strict immutable language
+ ^
+<sql-statement>
+create type myint (input = myintin, output = myintout, like = int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create type myint (input = myintin, output = myintout, like = int4);
+ ^
+<sql-statement>
+create cast (int4 as myint) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (int4 as myint) without function;
+ ^
+<sql-statement>
+create cast (myint as int4) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (myint as int4) without function;
+ ^
+<sql-statement>
+create function myinteq(myint, myint) returns bool as $$
+begin
+ if $1 is null and $2 is null then
+ return true;
+ else
+ return $1::int = $2::int;
+ end if;
+end;
+$$ language plpgsql immutable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function myinteq(myint, myint) returns bool as $$
+ ^
+<sql-statement>
+create operator = (
+ leftarg = myint,
+ rightarg = myint,
+ commutator = =,
+ negator = <>,
+ procedure = myinteq,
+ restrict = eqsel,
+ join = eqjoinsel,
+ merges
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create operator = (
+ ^
+<sql-statement>
+create operator class myint_ops
+default for type myint using hash as
+ operator 1 = (myint, myint),
+ function 1 myinthash(myint);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
+ create operator class myint_ops
+ ^
+<sql-statement>
+create table inttest (a myint);
+</sql-statement>
+<sql-statement>
+insert into inttest values(1::myint),(null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:31: Error: Unknown type: myint
+ insert into inttest values(1::myint),(null);
+ ^
+<sql-statement>
+-- try an array with enough elements to cause hashing
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:38: Error: Unknown type: myint
+ select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
+ ^
+<sql-statement>
+-- ensure the result matched with the non-hashed version. We simply remove
+-- some array elements so that we don't reach the hashing threshold.
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:38: Error: Unknown type: myint
+ select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/expressions.out b/yql/essentials/tests/postgresql/cases/expressions.out
new file mode 100644
index 0000000000..20fff8c6e5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/expressions.out
@@ -0,0 +1,83 @@
+--
+-- expression evaluation tests that don't fit into a more specific file
+--
+--
+-- Tests for SQLVAlueFunction
+--
+-- current_date (always matches because of transactional behaviour)
+SELECT date(now())::text = current_date::text;
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_time / localtime
+SELECT now()::timetz::text = current_time::text;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT now()::timetz(4)::text = current_time(4)::text;
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_timestamp / localtimestamp (always matches because of transactional behaviour)
+SELECT current_timestamp = NOW();
+ ?column?
+----------
+ t
+(1 row)
+
+-- precision
+SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_role/user/user is tested in rolnames.sql
+-- current database / catalog
+SELECT current_catalog = current_database();
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_schema
+SELECT current_schema;
+ current_schema
+----------------
+ public
+(1 row)
+
+SET search_path = 'pg_catalog';
+SELECT current_schema;
+ current_schema
+----------------
+ pg_catalog
+(1 row)
+
+--
+-- Test parsing of a no-op cast to a type with unspecified typmod
+--
+begin;
+create table numeric_tbl (f1 numeric(18,3), f2 numeric);
+-- bpchar, lacking planner support for its length coercion function,
+-- could behave differently
+create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
+rollback;
+--
+-- Tests for ScalarArrayOpExpr with a hashfn
+--
+-- create a stable function so that the tests below are not
+-- evaluated using the planner's constant folding.
+begin;
+rollback;
+-- Test with non-strict equality function.
+-- We need to create our own type for this.
+begin;
+create table inttest (a myint);
+rollback;
diff --git a/yql/essentials/tests/postgresql/cases/expressions.sql b/yql/essentials/tests/postgresql/cases/expressions.sql
new file mode 100644
index 0000000000..55eb47d284
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/expressions.sql
@@ -0,0 +1,43 @@
+--
+-- expression evaluation tests that don't fit into a more specific file
+--
+--
+-- Tests for SQLVAlueFunction
+--
+-- current_date (always matches because of transactional behaviour)
+SELECT date(now())::text = current_date::text;
+-- current_time / localtime
+SELECT now()::timetz::text = current_time::text;
+SELECT now()::timetz(4)::text = current_time(4)::text;
+-- current_timestamp / localtimestamp (always matches because of transactional behaviour)
+SELECT current_timestamp = NOW();
+-- precision
+SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
+-- current_role/user/user is tested in rolnames.sql
+-- current database / catalog
+SELECT current_catalog = current_database();
+-- current_schema
+SELECT current_schema;
+SET search_path = 'pg_catalog';
+SELECT current_schema;
+--
+-- Test parsing of a no-op cast to a type with unspecified typmod
+--
+begin;
+create table numeric_tbl (f1 numeric(18,3), f2 numeric);
+-- bpchar, lacking planner support for its length coercion function,
+-- could behave differently
+create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
+rollback;
+--
+-- Tests for ScalarArrayOpExpr with a hashfn
+--
+-- create a stable function so that the tests below are not
+-- evaluated using the planner's constant folding.
+begin;
+rollback;
+-- Test with non-strict equality function.
+-- We need to create our own type for this.
+begin;
+create table inttest (a myint);
+rollback;
diff --git a/yql/essentials/tests/postgresql/cases/float4.err b/yql/essentials/tests/postgresql/cases/float4.err
new file mode 100644
index 0000000000..55e601c281
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float4.err
@@ -0,0 +1,854 @@
+<sql-statement>
+--
+-- FLOAT4
+--
+CREATE TABLE FLOAT4_TBL (f1 float4);
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+</sql-statement>
+<sql-statement>
+-- test for over and under flow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- test for over and under flow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e70" is out of range for type real
+
+ -- test for over and under flow
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e70" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e-70" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e-70" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: overflow
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: overflow
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: underflow
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: underflow
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e400" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e400" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e-400" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e-400" is out of range for type real
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ ^
+<sql-statement>
+-- bad input
+INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad input
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: ""
+
+ -- bad input
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: " "
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "xyz"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "5.0.0"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "5 . 0"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "5. 0"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: " - 3.0"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "123 5"
+
+ INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ ^
+<sql-statement>
+-- special inputs
+SELECT 'NaN'::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float4;
+</sql-statement>
+<sql-statement>
+SELECT ' NAN '::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'infinity'::float4;
+</sql-statement>
+<sql-statement>
+SELECT ' -INFINiTY '::float4;
+</sql-statement>
+<sql-statement>
+-- bad special inputs
+SELECT 'N A N'::float4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- bad special inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "N A N"
+
+ -- bad special inputs
+ ^
+<sql-statement>
+SELECT 'NaN x'::float4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'NaN x'::float4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: "NaN x"
+
+ SELECT 'NaN x'::float4;
+ ^
+<sql-statement>
+SELECT ' INFINITY x'::float4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ' INFINITY x'::float4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type real: " INFINITY x"
+
+ SELECT ' INFINITY x'::float4;
+ ^
+<sql-statement>
+SELECT 'Infinity'::float4 + 100.0;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::float4 / 'Infinity'::float4;
+</sql-statement>
+<sql-statement>
+SELECT '42'::float4 / 'Infinity'::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float4 / 'nan'::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float4 / '0'::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::numeric::float4;
+</sql-statement>
+<sql-statement>
+SELECT * FROM FLOAT4_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+-- test divide by zero
+SELECT f.f1 / '0.0' from FLOAT4_TBL f;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ -- test divide by zero
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ -- test divide by zero
+ ^
+<sql-statement>
+SELECT * FROM FLOAT4_TBL;
+</sql-statement>
+<sql-statement>
+-- test the unary float4abs operator
+SELECT f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+</sql-statement>
+<sql-statement>
+UPDATE FLOAT4_TBL
+ SET f1 = FLOAT4_TBL.f1 * '-1'
+ WHERE FLOAT4_TBL.f1 > '0.0';
+</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 FLOAT4_TBL;
+</sql-statement>
+<sql-statement>
+-- test edge-case coercions to integer
+SELECT '32767.4'::float4::int2;
+</sql-statement>
+<sql-statement>
+SELECT '32767.6'::float4::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '32767.6'::float4::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT '32767.6'::float4::int2;
+ ^
+<sql-statement>
+SELECT '-32768.4'::float4::int2;
+</sql-statement>
+<sql-statement>
+SELECT '-32768.6'::float4::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-32768.6'::float4::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT '-32768.6'::float4::int2;
+ ^
+<sql-statement>
+SELECT '2147483520'::float4::int4;
+</sql-statement>
+<sql-statement>
+SELECT '2147483647'::float4::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2147483647'::float4::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT '2147483647'::float4::int4;
+ ^
+<sql-statement>
+SELECT '-2147483648.5'::float4::int4;
+</sql-statement>
+<sql-statement>
+SELECT '-2147483900'::float4::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-2147483900'::float4::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT '-2147483900'::float4::int4;
+ ^
+<sql-statement>
+SELECT '9223369837831520256'::float4::int8;
+</sql-statement>
+<sql-statement>
+SELECT '9223372036854775807'::float4::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '9223372036854775807'::float4::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT '9223372036854775807'::float4::int8;
+ ^
+<sql-statement>
+SELECT '-9223372036854775808.5'::float4::int8;
+</sql-statement>
+<sql-statement>
+SELECT '-9223380000000000000'::float4::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-9223380000000000000'::float4::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT '-9223380000000000000'::float4::int8;
+ ^
+<sql-statement>
+-- Test for correct input rounding in edge cases.
+-- These lists are from Paxson 1991, excluding subnormals and
+-- inputs of over 9 sig. digits.
+SELECT float4send('5e-20'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('67e14'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('985e15'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('55895e-16'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('7038531e-32'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('702990899e-20'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('3e-23'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('57e18'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('789e-35'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('2539e-18'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('76173e28'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('887745e-11'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('5382571e-37'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('82381273e-35'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('750486563e-38'::float4);
+</sql-statement>
+<sql-statement>
+-- Test that the smallest possible normalized input value inputs
+-- correctly, either in 9-significant-digit or shortest-decimal
+-- format.
+--
+-- exact val is 1.1754943508...
+-- shortest val is 1.1754944000
+-- midpoint to next val is 1.1754944208...
+SELECT float4send('1.17549435e-38'::float4);
+</sql-statement>
+<sql-statement>
+SELECT float4send('1.1754944e-38'::float4);
+</sql-statement>
+<sql-statement>
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+create type xfloat4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ -- test output (and round-trip safety) of various values.
+ ^
+<sql-statement>
+create function xfloat4in(cstring) returns xfloat4 immutable strict
+ language internal as 'int4in';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function xfloat4in(cstring) returns xfloat4 immutable strict
+ ^
+<sql-statement>
+create function xfloat4out(xfloat4) returns cstring immutable strict
+ language internal as 'int4out';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function xfloat4out(xfloat4) returns cstring immutable strict
+ ^
+<sql-statement>
+create type xfloat4 (input = xfloat4in, output = xfloat4out, like = float4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create type xfloat4 (input = xfloat4in, output = xfloat4out, like = float4);
+ ^
+<sql-statement>
+create cast (xfloat4 as float4) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (xfloat4 as float4) without function;
+ ^
+<sql-statement>
+create cast (float4 as xfloat4) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (float4 as xfloat4) without function;
+ ^
+<sql-statement>
+create cast (xfloat4 as integer) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (xfloat4 as integer) without function;
+ ^
+<sql-statement>
+create cast (integer as xfloat4) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (integer as xfloat4) without function;
+ ^
+<sql-statement>
+-- float4: seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+with testdata(bits) as (values
+ -- small subnormals
+ (x'00000001'),
+ (x'00000002'), (x'00000003'),
+ (x'00000010'), (x'00000011'), (x'00000100'), (x'00000101'),
+ (x'00004000'), (x'00004001'), (x'00080000'), (x'00080001'),
+ -- stress values
+ (x'0053c4f4'), -- 7693e-42
+ (x'006c85c4'), -- 996622e-44
+ (x'0041ca76'), -- 60419369e-46
+ (x'004b7678'), -- 6930161142e-48
+ -- taken from upstream testsuite
+ (x'00000007'),
+ (x'00424fe2'),
+ -- borderline between subnormal and normal
+ (x'007ffff0'), (x'007ffff1'), (x'007ffffe'), (x'007fffff'))
+select float4send(flt) as ibits,
+ flt
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:23:31: Error: Unknown type: xfloat4
+ from (select bits::integer::xfloat4::float4 as flt
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- float4: seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- float4: seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+ ^
+<sql-statement>
+with testdata(bits) as (values
+ (x'00000000'),
+ -- smallest normal values
+ (x'00800000'), (x'00800001'), (x'00800004'), (x'00800005'),
+ (x'00800006'),
+ -- small normal values chosen for short vs. long output
+ (x'008002f1'), (x'008002f2'), (x'008002f3'),
+ (x'00800e17'), (x'00800e18'), (x'00800e19'),
+ -- assorted values (random mantissae)
+ (x'01000001'), (x'01102843'), (x'01a52c98'),
+ (x'0219c229'), (x'02e4464d'), (x'037343c1'), (x'03a91b36'),
+ (x'047ada65'), (x'0496fe87'), (x'0550844f'), (x'05999da3'),
+ (x'060ea5e2'), (x'06e63c45'), (x'07f1e548'), (x'0fc5282b'),
+ (x'1f850283'), (x'2874a9d6'),
+ -- values around 5e-08
+ (x'3356bf94'), (x'3356bf95'), (x'3356bf96'),
+ -- around 1e-07
+ (x'33d6bf94'), (x'33d6bf95'), (x'33d6bf96'),
+ -- around 3e-07 .. 1e-04
+ (x'34a10faf'), (x'34a10fb0'), (x'34a10fb1'),
+ (x'350637bc'), (x'350637bd'), (x'350637be'),
+ (x'35719786'), (x'35719787'), (x'35719788'),
+ (x'358637bc'), (x'358637bd'), (x'358637be'),
+ (x'36a7c5ab'), (x'36a7c5ac'), (x'36a7c5ad'),
+ (x'3727c5ab'), (x'3727c5ac'), (x'3727c5ad'),
+ -- format crossover at 1e-04
+ (x'38d1b714'), (x'38d1b715'), (x'38d1b716'),
+ (x'38d1b717'), (x'38d1b718'), (x'38d1b719'),
+ (x'38d1b71a'), (x'38d1b71b'), (x'38d1b71c'),
+ (x'38d1b71d'),
+ --
+ (x'38dffffe'), (x'38dfffff'), (x'38e00000'),
+ (x'38efffff'), (x'38f00000'), (x'38f00001'),
+ (x'3a83126e'), (x'3a83126f'), (x'3a831270'),
+ (x'3c23d709'), (x'3c23d70a'), (x'3c23d70b'),
+ (x'3dcccccc'), (x'3dcccccd'), (x'3dccccce'),
+ -- chosen to need 9 digits for 3dcccd70
+ (x'3dcccd6f'), (x'3dcccd70'), (x'3dcccd71'),
+ --
+ (x'3effffff'), (x'3f000000'), (x'3f000001'),
+ (x'3f333332'), (x'3f333333'), (x'3f333334'),
+ -- approach 1.0 with increasing numbers of 9s
+ (x'3f666665'), (x'3f666666'), (x'3f666667'),
+ (x'3f7d70a3'), (x'3f7d70a4'), (x'3f7d70a5'),
+ (x'3f7fbe76'), (x'3f7fbe77'), (x'3f7fbe78'),
+ (x'3f7ff971'), (x'3f7ff972'), (x'3f7ff973'),
+ (x'3f7fff57'), (x'3f7fff58'), (x'3f7fff59'),
+ (x'3f7fffee'), (x'3f7fffef'),
+ -- values very close to 1
+ (x'3f7ffff0'), (x'3f7ffff1'), (x'3f7ffff2'),
+ (x'3f7ffff3'), (x'3f7ffff4'), (x'3f7ffff5'),
+ (x'3f7ffff6'), (x'3f7ffff7'), (x'3f7ffff8'),
+ (x'3f7ffff9'), (x'3f7ffffa'), (x'3f7ffffb'),
+ (x'3f7ffffc'), (x'3f7ffffd'), (x'3f7ffffe'),
+ (x'3f7fffff'),
+ (x'3f800000'),
+ (x'3f800001'), (x'3f800002'), (x'3f800003'),
+ (x'3f800004'), (x'3f800005'), (x'3f800006'),
+ (x'3f800007'), (x'3f800008'), (x'3f800009'),
+ -- values 1 to 1.1
+ (x'3f80000f'), (x'3f800010'), (x'3f800011'),
+ (x'3f800012'), (x'3f800013'), (x'3f800014'),
+ (x'3f800017'), (x'3f800018'), (x'3f800019'),
+ (x'3f80001a'), (x'3f80001b'), (x'3f80001c'),
+ (x'3f800029'), (x'3f80002a'), (x'3f80002b'),
+ (x'3f800053'), (x'3f800054'), (x'3f800055'),
+ (x'3f800346'), (x'3f800347'), (x'3f800348'),
+ (x'3f8020c4'), (x'3f8020c5'), (x'3f8020c6'),
+ (x'3f8147ad'), (x'3f8147ae'), (x'3f8147af'),
+ (x'3f8ccccc'), (x'3f8ccccd'), (x'3f8cccce'),
+ --
+ (x'3fc90fdb'), -- pi/2
+ (x'402df854'), -- e
+ (x'40490fdb'), -- pi
+ --
+ (x'409fffff'), (x'40a00000'), (x'40a00001'),
+ (x'40afffff'), (x'40b00000'), (x'40b00001'),
+ (x'411fffff'), (x'41200000'), (x'41200001'),
+ (x'42c7ffff'), (x'42c80000'), (x'42c80001'),
+ (x'4479ffff'), (x'447a0000'), (x'447a0001'),
+ (x'461c3fff'), (x'461c4000'), (x'461c4001'),
+ (x'47c34fff'), (x'47c35000'), (x'47c35001'),
+ (x'497423ff'), (x'49742400'), (x'49742401'),
+ (x'4b18967f'), (x'4b189680'), (x'4b189681'),
+ (x'4cbebc1f'), (x'4cbebc20'), (x'4cbebc21'),
+ (x'4e6e6b27'), (x'4e6e6b28'), (x'4e6e6b29'),
+ (x'501502f8'), (x'501502f9'), (x'501502fa'),
+ (x'51ba43b6'), (x'51ba43b7'), (x'51ba43b8'),
+ -- stress values
+ (x'1f6c1e4a'), -- 5e-20
+ (x'59be6cea'), -- 67e14
+ (x'5d5ab6c4'), -- 985e15
+ (x'2cc4a9bd'), -- 55895e-16
+ (x'15ae43fd'), -- 7038531e-32
+ (x'2cf757ca'), -- 702990899e-20
+ (x'665ba998'), -- 25933168707e13
+ (x'743c3324'), -- 596428896559e20
+ -- exercise fixed-point memmoves
+ (x'47f1205a'),
+ (x'4640e6ae'),
+ (x'449a5225'),
+ (x'42f6e9d5'),
+ (x'414587dd'),
+ (x'3f9e064b'),
+ -- these cases come from the upstream's testsuite
+ -- BoundaryRoundEven
+ (x'4c000004'),
+ (x'50061c46'),
+ (x'510006a8'),
+ -- ExactValueRoundEven
+ (x'48951f84'),
+ (x'45fd1840'),
+ -- LotsOfTrailingZeros
+ (x'39800000'),
+ (x'3b200000'),
+ (x'3b900000'),
+ (x'3bd00000'),
+ -- Regression
+ (x'63800000'),
+ (x'4b000000'),
+ (x'4b800000'),
+ (x'4c000001'),
+ (x'4c800b0d'),
+ (x'00d24584'),
+ (x'00d90b88'),
+ (x'45803f34'),
+ (x'4f9f24f7'),
+ (x'3a8722c3'),
+ (x'5c800041'),
+ (x'15ae43fd'),
+ (x'5d4cccfb'),
+ (x'4c800001'),
+ (x'57800ed8'),
+ (x'5f000000'),
+ (x'700000f0'),
+ (x'5f23e9ac'),
+ (x'5e9502f9'),
+ (x'5e8012b1'),
+ (x'3c000028'),
+ (x'60cde861'),
+ (x'03aa2a50'),
+ (x'43480000'),
+ (x'4c000000'),
+ -- LooksLikePow5
+ (x'5D1502F9'),
+ (x'5D9502F9'),
+ (x'5E1502F9'),
+ -- OutputLength
+ (x'3f99999a'),
+ (x'3f9d70a4'),
+ (x'3f9df3b6'),
+ (x'3f9e0419'),
+ (x'3f9e0610'),
+ (x'3f9e064b'),
+ (x'3f9e0651'),
+ (x'03d20cfe')
+)
+select float4send(flt) as ibits,
+ flt,
+ flt::text::float4 as r_flt,
+ float4send(flt::text::float4) as obits,
+ float4send(flt::text::float4) = float4send(flt) as correct
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:163:31: Error: Unknown type: xfloat4
+ from (select bits::integer::xfloat4::float4 as flt
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ with testdata(bits) as (values
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ with testdata(bits) as (values
+ ^
+<sql-statement>
+-- clean up, lest opr_sanity complain
+drop type xfloat4 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ -- clean up, lest opr_sanity complain
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/float4.out b/yql/essentials/tests/postgresql/cases/float4.out
new file mode 100644
index 0000000000..c4128d4416
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float4.out
@@ -0,0 +1,434 @@
+--
+-- FLOAT4
+--
+CREATE TABLE FLOAT4_TBL (f1 float4);
+INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+-- test for over and under flow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+ERROR: "10e70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ERROR: "-10e70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ERROR: "10e-70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ERROR: "-10e-70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+ERROR: value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+ERROR: value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ERROR: "10e400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ERROR: "-10e400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ERROR: "10e-400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ERROR: "-10e-400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ ^
+-- bad input
+INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type real: ""
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type real: " "
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ERROR: invalid input syntax for type real: "xyz"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ERROR: invalid input syntax for type real: "5.0.0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type real: "5 . 0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ERROR: invalid input syntax for type real: "5. 0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ERROR: invalid input syntax for type real: " - 3.0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type real: "123 5"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ ^
+-- special inputs
+SELECT 'NaN'::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'nan'::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT ' NAN '::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'infinity'::float4;
+ float4
+----------
+ Infinity
+(1 row)
+
+SELECT ' -INFINiTY '::float4;
+ float4
+-----------
+ -Infinity
+(1 row)
+
+-- bad special inputs
+SELECT 'N A N'::float4;
+ERROR: invalid input syntax for type real: "N A N"
+LINE 1: SELECT 'N A N'::float4;
+ ^
+SELECT 'NaN x'::float4;
+ERROR: invalid input syntax for type real: "NaN x"
+LINE 1: SELECT 'NaN x'::float4;
+ ^
+SELECT ' INFINITY x'::float4;
+ERROR: invalid input syntax for type real: " INFINITY x"
+LINE 1: SELECT ' INFINITY x'::float4;
+ ^
+SELECT 'Infinity'::float4 + 100.0;
+ ?column?
+----------
+ Infinity
+(1 row)
+
+SELECT 'Infinity'::float4 / 'Infinity'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '42'::float4 / 'Infinity'::float4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT 'nan'::float4 / 'nan'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::float4 / '0'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::numeric::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT * FROM FLOAT4_TBL;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(5 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+ f1
+--------
+ 1004.3
+(1 row)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e-20
+(3 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e-20
+(3 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+----------------
+ 1004.3 | -10043
+ 1.2345679e+20 | -1.2345678e+21
+ 1.2345679e-20 | -1.2345678e-19
+(3 rows)
+
+SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+----------------
+ 1004.3 | -100.43
+ 1.2345679e+20 | -1.2345679e+19
+ 1.2345679e-20 | -1.2345679e-21
+(3 rows)
+
+SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+---------------
+ 1004.3 | 1014.3
+ 1.2345679e+20 | 1.2345679e+20
+ 1.2345679e-20 | 10
+(3 rows)
+
+-- test divide by zero
+SELECT f.f1 / '0.0' from FLOAT4_TBL f;
+ERROR: division by zero
+SELECT * FROM FLOAT4_TBL;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(5 rows)
+
+-- test the unary float4abs operator
+SELECT f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+ f1 | abs_f1
+---------------+---------------
+ 0 | 0
+ 1004.3 | 1004.3
+ -34.84 | 34.84
+ 1.2345679e+20 | 1.2345679e+20
+ 1.2345679e-20 | 1.2345679e-20
+(5 rows)
+
+-- test edge-case coercions to integer
+SELECT '32767.4'::float4::int2;
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT '32767.6'::float4::int2;
+ERROR: smallint out of range
+SELECT '-32768.4'::float4::int2;
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT '-32768.6'::float4::int2;
+ERROR: smallint out of range
+SELECT '2147483520'::float4::int4;
+ int4
+------------
+ 2147483520
+(1 row)
+
+SELECT '2147483647'::float4::int4;
+ERROR: integer out of range
+SELECT '-2147483648.5'::float4::int4;
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT '-2147483900'::float4::int4;
+ERROR: integer out of range
+SELECT '9223369837831520256'::float4::int8;
+ int8
+---------------------
+ 9223369837831520256
+(1 row)
+
+SELECT '9223372036854775807'::float4::int8;
+ERROR: bigint out of range
+SELECT '-9223372036854775808.5'::float4::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT '-9223380000000000000'::float4::int8;
+ERROR: bigint out of range
+-- Test for correct input rounding in edge cases.
+-- These lists are from Paxson 1991, excluding subnormals and
+-- inputs of over 9 sig. digits.
+SELECT float4send('5e-20'::float4);
+ float4send
+------------
+ \x1f6c1e4a
+(1 row)
+
+SELECT float4send('67e14'::float4);
+ float4send
+------------
+ \x59be6cea
+(1 row)
+
+SELECT float4send('985e15'::float4);
+ float4send
+------------
+ \x5d5ab6c4
+(1 row)
+
+SELECT float4send('55895e-16'::float4);
+ float4send
+------------
+ \x2cc4a9bd
+(1 row)
+
+SELECT float4send('7038531e-32'::float4);
+ float4send
+------------
+ \x15ae43fd
+(1 row)
+
+SELECT float4send('702990899e-20'::float4);
+ float4send
+------------
+ \x2cf757ca
+(1 row)
+
+SELECT float4send('3e-23'::float4);
+ float4send
+------------
+ \x1a111234
+(1 row)
+
+SELECT float4send('57e18'::float4);
+ float4send
+------------
+ \x6045c22c
+(1 row)
+
+SELECT float4send('789e-35'::float4);
+ float4send
+------------
+ \x0a23de70
+(1 row)
+
+SELECT float4send('2539e-18'::float4);
+ float4send
+------------
+ \x2736f449
+(1 row)
+
+SELECT float4send('76173e28'::float4);
+ float4send
+------------
+ \x7616398a
+(1 row)
+
+SELECT float4send('887745e-11'::float4);
+ float4send
+------------
+ \x3714f05c
+(1 row)
+
+SELECT float4send('5382571e-37'::float4);
+ float4send
+------------
+ \x0d2eaca7
+(1 row)
+
+SELECT float4send('82381273e-35'::float4);
+ float4send
+------------
+ \x128289d1
+(1 row)
+
+SELECT float4send('750486563e-38'::float4);
+ float4send
+------------
+ \x0f18377e
+(1 row)
+
+-- Test that the smallest possible normalized input value inputs
+-- correctly, either in 9-significant-digit or shortest-decimal
+-- format.
+--
+-- exact val is 1.1754943508...
+-- shortest val is 1.1754944000
+-- midpoint to next val is 1.1754944208...
+SELECT float4send('1.17549435e-38'::float4);
+ float4send
+------------
+ \x00800000
+(1 row)
+
+SELECT float4send('1.1754944e-38'::float4);
+ float4send
+------------
+ \x00800000
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/float4.sql b/yql/essentials/tests/postgresql/cases/float4.sql
new file mode 100644
index 0000000000..8a6adaf11d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float4.sql
@@ -0,0 +1,105 @@
+--
+-- FLOAT4
+--
+CREATE TABLE FLOAT4_TBL (f1 float4);
+INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+-- test for over and under flow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+-- bad input
+INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+-- special inputs
+SELECT 'NaN'::float4;
+SELECT 'nan'::float4;
+SELECT ' NAN '::float4;
+SELECT 'infinity'::float4;
+SELECT ' -INFINiTY '::float4;
+-- bad special inputs
+SELECT 'N A N'::float4;
+SELECT 'NaN x'::float4;
+SELECT ' INFINITY x'::float4;
+SELECT 'Infinity'::float4 + 100.0;
+SELECT 'Infinity'::float4 / 'Infinity'::float4;
+SELECT '42'::float4 / 'Infinity'::float4;
+SELECT 'nan'::float4 / 'nan'::float4;
+SELECT 'nan'::float4 / '0'::float4;
+SELECT 'nan'::numeric::float4;
+SELECT * FROM FLOAT4_TBL;
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+-- test divide by zero
+SELECT f.f1 / '0.0' from FLOAT4_TBL f;
+SELECT * FROM FLOAT4_TBL;
+-- test the unary float4abs operator
+SELECT f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+-- test edge-case coercions to integer
+SELECT '32767.4'::float4::int2;
+SELECT '32767.6'::float4::int2;
+SELECT '-32768.4'::float4::int2;
+SELECT '-32768.6'::float4::int2;
+SELECT '2147483520'::float4::int4;
+SELECT '2147483647'::float4::int4;
+SELECT '-2147483648.5'::float4::int4;
+SELECT '-2147483900'::float4::int4;
+SELECT '9223369837831520256'::float4::int8;
+SELECT '9223372036854775807'::float4::int8;
+SELECT '-9223372036854775808.5'::float4::int8;
+SELECT '-9223380000000000000'::float4::int8;
+-- Test for correct input rounding in edge cases.
+-- These lists are from Paxson 1991, excluding subnormals and
+-- inputs of over 9 sig. digits.
+SELECT float4send('5e-20'::float4);
+SELECT float4send('67e14'::float4);
+SELECT float4send('985e15'::float4);
+SELECT float4send('55895e-16'::float4);
+SELECT float4send('7038531e-32'::float4);
+SELECT float4send('702990899e-20'::float4);
+SELECT float4send('3e-23'::float4);
+SELECT float4send('57e18'::float4);
+SELECT float4send('789e-35'::float4);
+SELECT float4send('2539e-18'::float4);
+SELECT float4send('76173e28'::float4);
+SELECT float4send('887745e-11'::float4);
+SELECT float4send('5382571e-37'::float4);
+SELECT float4send('82381273e-35'::float4);
+SELECT float4send('750486563e-38'::float4);
+-- Test that the smallest possible normalized input value inputs
+-- correctly, either in 9-significant-digit or shortest-decimal
+-- format.
+--
+-- exact val is 1.1754943508...
+-- shortest val is 1.1754944000
+-- midpoint to next val is 1.1754944208...
+SELECT float4send('1.17549435e-38'::float4);
+SELECT float4send('1.1754944e-38'::float4);
diff --git a/yql/essentials/tests/postgresql/cases/float8.err b/yql/essentials/tests/postgresql/cases/float8.err
new file mode 100644
index 0000000000..ca1be732fc
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float8.err
@@ -0,0 +1,1188 @@
+<sql-statement>
+--
+-- FLOAT8
+--
+CREATE TABLE FLOAT8_TBL(f1 float8);
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+</sql-statement>
+<sql-statement>
+-- test for underflow and overflow handling
+SELECT '10e400'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- test for underflow and overflow handling
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e400" is out of range for type double precision
+
+ -- test for underflow and overflow handling
+ ^
+<sql-statement>
+SELECT '-10e400'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-10e400'::float8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e400" is out of range for type double precision
+
+ SELECT '-10e400'::float8;
+ ^
+<sql-statement>
+SELECT '10e-400'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '10e-400'::float8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e-400" is out of range for type double precision
+
+ SELECT '10e-400'::float8;
+ ^
+<sql-statement>
+SELECT '-10e-400'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-10e-400'::float8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e-400" is out of range for type double precision
+
+ SELECT '-10e-400'::float8;
+ ^
+<sql-statement>
+-- test smallest normalized input
+SELECT float8send('2.2250738585072014E-308'::float8);
+</sql-statement>
+<sql-statement>
+-- bad input
+INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad input
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: ""
+
+ -- bad input
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: " "
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "xyz"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "5.0.0"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "5 . 0"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "5. 0"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: " - 3"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "123 5"
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ ^
+<sql-statement>
+-- special inputs
+SELECT 'NaN'::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float8;
+</sql-statement>
+<sql-statement>
+SELECT ' NAN '::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'infinity'::float8;
+</sql-statement>
+<sql-statement>
+SELECT ' -INFINiTY '::float8;
+</sql-statement>
+<sql-statement>
+-- bad special inputs
+SELECT 'N A N'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- bad special inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "N A N"
+
+ -- bad special inputs
+ ^
+<sql-statement>
+SELECT 'NaN x'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'NaN x'::float8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: "NaN x"
+
+ SELECT 'NaN x'::float8;
+ ^
+<sql-statement>
+SELECT ' INFINITY x'::float8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ' INFINITY x'::float8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type double precision: " INFINITY x"
+
+ SELECT ' INFINITY x'::float8;
+ ^
+<sql-statement>
+SELECT 'Infinity'::float8 + 100.0;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::float8 / 'Infinity'::float8;
+</sql-statement>
+<sql-statement>
+SELECT '42'::float8 / 'Infinity'::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float8 / 'nan'::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::float8 / '0'::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'nan'::numeric::float8;
+</sql-statement>
+<sql-statement>
+SELECT * FROM FLOAT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+</sql-statement>
+<sql-statement>
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 / '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+SELECT f.f1 ^ '2.0' AS square_f1
+ FROM FLOAT8_TBL f where f.f1 = '1004.3';
+</sql-statement>
+<sql-statement>
+-- absolute value
+SELECT f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+</sql-statement>
+<sql-statement>
+-- truncate
+SELECT f.f1, trunc(f.f1) AS trunc_f1
+ FROM FLOAT8_TBL f;
+</sql-statement>
+<sql-statement>
+-- round
+SELECT f.f1, round(f.f1) AS round_f1
+ FROM FLOAT8_TBL f;
+</sql-statement>
+<sql-statement>
+-- ceil / ceiling
+select ceil(f1) as ceil_f1 from float8_tbl f;
+</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.float8_tbl
+
+<sql-statement>
+select ceiling(f1) as ceiling_f1 from float8_tbl f;
+</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.float8_tbl
+
+<sql-statement>
+-- floor
+select floor(f1) as floor_f1 from float8_tbl f;
+</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.float8_tbl
+
+<sql-statement>
+-- sign
+select sign(f1) as sign_f1 from float8_tbl f;
+</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.float8_tbl
+
+<sql-statement>
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+</sql-statement>
+<sql-statement>
+-- square root
+SELECT sqrt(float8 '64') AS eight;
+</sql-statement>
+<sql-statement>
+SELECT |/ float8 '64' AS eight;
+</sql-statement>
+<sql-statement>
+SELECT f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+-- power
+SELECT power(float8 '144', float8 '0.5');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'NaN', float8 '0.5');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '144', float8 'NaN');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'NaN', float8 'NaN');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-1', float8 'NaN');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '1', float8 'NaN');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'NaN', float8 '0');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'inf', float8 '0');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '0');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '0', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '0', float8 '-inf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power(float8 '0', float8 '-inf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: zero raised to a negative power is undefined
+
+ SELECT power(float8 '0', float8 '-inf');
+ ^
+<sql-statement>
+SELECT power(float8 '1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '0.1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-0.1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '1.1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-1.1', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '0.1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-0.1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '1.1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-1.1', float8 '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'inf', float8 '-2');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'inf', float8 '2');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'inf', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 'inf', float8 '-inf');
+</sql-statement>
+<sql-statement>
+-- Intel's icc misoptimizes the code that controls the sign of this result,
+-- even with -mp1. Pending a fix for that, only test for "is it zero".
+SELECT power(float8 '-inf', float8 '-2') = '0';
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '-3');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '2');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '3');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '3.5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power(float8 '-inf', float8 '3.5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: a negative number raised to a non-integer power yields a complex result
+
+ SELECT power(float8 '-inf', float8 '3.5');
+ ^
+<sql-statement>
+SELECT power(float8 '-inf', float8 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power(float8 '-inf', float8 '-inf');
+</sql-statement>
+<sql-statement>
+-- take exp of ln(f.f1)
+SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+</sql-statement>
+<sql-statement>
+-- check edge cases for exp
+SELECT exp('inf'::float8), exp('-inf'::float8), exp('nan'::float8);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- check edge cases for exp
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: exp
+ -- check edge cases for exp
+ ^
+<sql-statement>
+-- cube root
+SELECT ||/ float8 '27' AS three;
+</sql-statement>
+<sql-statement>
+SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+</sql-statement>
+<sql-statement>
+SELECT * FROM FLOAT8_TBL;
+</sql-statement>
+<sql-statement>
+UPDATE FLOAT8_TBL
+ SET f1 = FLOAT8_TBL.f1 * '-1'
+ WHERE FLOAT8_TBL.f1 > '0.0';
+</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 f.f1 * '1e200' from FLOAT8_TBL f;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: overflow
+
+ SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+ ^
+<sql-statement>
+SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: overflow
+
+ SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+ ^
+<sql-statement>
+SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
+</sql-statement>
+<sql-statement>
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+ ^
+<sql-statement>
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+ ^
+<sql-statement>
+SELECT exp(f.f1) from FLOAT8_TBL f;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT exp(f.f1) from FLOAT8_TBL f;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value out of range: overflow
+
+ SELECT exp(f.f1) from FLOAT8_TBL f;
+ ^
+<sql-statement>
+SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+ ^
+<sql-statement>
+SELECT * FROM FLOAT8_TBL;
+</sql-statement>
+<sql-statement>
+-- hyperbolic functions
+-- we run these with extra_float_digits = 0 too, since different platforms
+-- tend to produce results that vary in the last place.
+SELECT sinh(float8 '1');
+</sql-statement>
+<sql-statement>
+SELECT cosh(float8 '1');
+</sql-statement>
+<sql-statement>
+SELECT tanh(float8 '1');
+</sql-statement>
+<sql-statement>
+SELECT asinh(float8 '1');
+</sql-statement>
+<sql-statement>
+SELECT acosh(float8 '2');
+</sql-statement>
+<sql-statement>
+SELECT atanh(float8 '0.5');
+</sql-statement>
+<sql-statement>
+-- test Inf/NaN cases for hyperbolic functions
+SELECT sinh(float8 'infinity');
+</sql-statement>
+<sql-statement>
+SELECT sinh(float8 '-infinity');
+</sql-statement>
+<sql-statement>
+SELECT sinh(float8 'nan');
+</sql-statement>
+<sql-statement>
+SELECT cosh(float8 'infinity');
+</sql-statement>
+<sql-statement>
+SELECT cosh(float8 '-infinity');
+</sql-statement>
+<sql-statement>
+SELECT cosh(float8 'nan');
+</sql-statement>
+<sql-statement>
+SELECT tanh(float8 'infinity');
+</sql-statement>
+<sql-statement>
+SELECT tanh(float8 '-infinity');
+</sql-statement>
+<sql-statement>
+SELECT tanh(float8 'nan');
+</sql-statement>
+<sql-statement>
+SELECT asinh(float8 'infinity');
+</sql-statement>
+<sql-statement>
+SELECT asinh(float8 '-infinity');
+</sql-statement>
+<sql-statement>
+SELECT asinh(float8 'nan');
+</sql-statement>
+<sql-statement>
+-- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+-- SELECT acosh(float8 'infinity');
+SELECT acosh(float8 '-infinity');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: input is out of range
+
+ -- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+ ^
+<sql-statement>
+SELECT acosh(float8 'nan');
+</sql-statement>
+<sql-statement>
+SELECT atanh(float8 'infinity');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT atanh(float8 'infinity');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: input is out of range
+
+ SELECT atanh(float8 'infinity');
+ ^
+<sql-statement>
+SELECT atanh(float8 '-infinity');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT atanh(float8 '-infinity');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: input is out of range
+
+ SELECT atanh(float8 '-infinity');
+ ^
+<sql-statement>
+SELECT atanh(float8 'nan');
+</sql-statement>
+<sql-statement>
+RESET extra_float_digits;
+</sql-statement>
+<sql-statement>
+-- test for over- and underflow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- test for over- and underflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e400" is out of range for type double precision
+
+ -- test for over- and underflow
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e400" is out of range for type double precision
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "10e-400" is out of range for type double precision
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ ^
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "-10e-400" is out of range for type double precision
+
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ ^
+<sql-statement>
+-- maintain external table consistency across platforms
+-- delete all values and reinsert well-behaved ones
+DELETE FROM FLOAT8_TBL;
+</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 FLOAT8_TBL(f1) VALUES ('0.0');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+</sql-statement>
+<sql-statement>
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+</sql-statement>
+<sql-statement>
+SELECT * FROM FLOAT8_TBL;
+</sql-statement>
+<sql-statement>
+-- test edge-case coercions to integer
+SELECT '32767.4'::float8::int2;
+</sql-statement>
+<sql-statement>
+SELECT '32767.6'::float8::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '32767.6'::float8::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT '32767.6'::float8::int2;
+ ^
+<sql-statement>
+SELECT '-32768.4'::float8::int2;
+</sql-statement>
+<sql-statement>
+SELECT '-32768.6'::float8::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-32768.6'::float8::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT '-32768.6'::float8::int2;
+ ^
+<sql-statement>
+SELECT '2147483647.4'::float8::int4;
+</sql-statement>
+<sql-statement>
+SELECT '2147483647.6'::float8::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2147483647.6'::float8::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT '2147483647.6'::float8::int4;
+ ^
+<sql-statement>
+SELECT '-2147483648.4'::float8::int4;
+</sql-statement>
+<sql-statement>
+SELECT '-2147483648.6'::float8::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-2147483648.6'::float8::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT '-2147483648.6'::float8::int4;
+ ^
+<sql-statement>
+SELECT '9223372036854773760'::float8::int8;
+</sql-statement>
+<sql-statement>
+SELECT '9223372036854775807'::float8::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '9223372036854775807'::float8::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT '9223372036854775807'::float8::int8;
+ ^
+<sql-statement>
+SELECT '-9223372036854775808.5'::float8::int8;
+</sql-statement>
+<sql-statement>
+SELECT '-9223372036854780000'::float8::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-9223372036854780000'::float8::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT '-9223372036854780000'::float8::int8;
+ ^
+<sql-statement>
+-- test exact cases for trigonometric functions in degrees
+SELECT x,
+ sind(x),
+ sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
+FROM (VALUES (0), (30), (90), (150), (180),
+ (210), (270), (330), (360)) AS t(x);
+</sql-statement>
+<sql-statement>
+SELECT x,
+ cosd(x),
+ cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
+FROM (VALUES (0), (60), (90), (120), (180),
+ (240), (270), (300), (360)) AS t(x);
+</sql-statement>
+<sql-statement>
+SELECT x,
+ tand(x),
+ tand(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS tand_exact,
+ cotd(x),
+ cotd(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS cotd_exact
+FROM (VALUES (0), (45), (90), (135), (180),
+ (225), (270), (315), (360)) AS t(x);
+</sql-statement>
+<sql-statement>
+SELECT x,
+ asind(x),
+ asind(x) IN (-90,-30,0,30,90) AS asind_exact,
+ acosd(x),
+ acosd(x) IN (0,60,90,120,180) AS acosd_exact
+FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
+</sql-statement>
+<sql-statement>
+SELECT x,
+ atand(x),
+ atand(x) IN (-90,-45,0,45,90) AS atand_exact
+FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
+ ('Infinity'::float8)) AS t(x);
+</sql-statement>
+<sql-statement>
+SELECT x, y,
+ atan2d(y, x),
+ atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
+FROM (SELECT 10*cosd(a), 10*sind(a)
+ FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
+</sql-statement>
+<sql-statement>
+--
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+create type xfloat8;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ --
+ ^
+<sql-statement>
+create function xfloat8in(cstring) returns xfloat8 immutable strict
+ language internal as 'int8in';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function xfloat8in(cstring) returns xfloat8 immutable strict
+ ^
+<sql-statement>
+create function xfloat8out(xfloat8) returns cstring immutable strict
+ language internal as 'int8out';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function xfloat8out(xfloat8) returns cstring immutable strict
+ ^
+<sql-statement>
+create type xfloat8 (input = xfloat8in, output = xfloat8out, like = float8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create type xfloat8 (input = xfloat8in, output = xfloat8out, like = float8);
+ ^
+<sql-statement>
+create cast (xfloat8 as float8) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (xfloat8 as float8) without function;
+ ^
+<sql-statement>
+create cast (float8 as xfloat8) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (float8 as xfloat8) without function;
+ ^
+<sql-statement>
+create cast (xfloat8 as bigint) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (xfloat8 as bigint) without function;
+ ^
+<sql-statement>
+create cast (bigint as xfloat8) without function;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
+ create cast (bigint as xfloat8) without function;
+ ^
+<sql-statement>
+-- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+with testdata(bits) as (values
+ -- small subnormals
+ (x'0000000000000001'),
+ (x'0000000000000002'), (x'0000000000000003'),
+ (x'0000000000001000'), (x'0000000100000000'),
+ (x'0000010000000000'), (x'0000010100000000'),
+ (x'0000400000000000'), (x'0000400100000000'),
+ (x'0000800000000000'), (x'0000800000000001'),
+ -- these values taken from upstream testsuite
+ (x'00000000000f4240'),
+ (x'00000000016e3600'),
+ (x'0000008cdcdea440'),
+ -- borderline between subnormal and normal
+ (x'000ffffffffffff0'), (x'000ffffffffffff1'),
+ (x'000ffffffffffffe'), (x'000fffffffffffff'))
+select float8send(flt) as ibits,
+ flt
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:22:30: Error: Unknown type: xfloat8
+ from (select bits::bigint::xfloat8::float8 as flt
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
+ ^
+<sql-statement>
+-- round-trip tests
+with testdata(bits) as (values
+ (x'0000000000000000'),
+ -- smallest normal values
+ (x'0010000000000000'), (x'0010000000000001'),
+ (x'0010000000000002'), (x'0018000000000000'),
+ --
+ (x'3ddb7cdfd9d7bdba'), (x'3ddb7cdfd9d7bdbb'), (x'3ddb7cdfd9d7bdbc'),
+ (x'3e112e0be826d694'), (x'3e112e0be826d695'), (x'3e112e0be826d696'),
+ (x'3e45798ee2308c39'), (x'3e45798ee2308c3a'), (x'3e45798ee2308c3b'),
+ (x'3e7ad7f29abcaf47'), (x'3e7ad7f29abcaf48'), (x'3e7ad7f29abcaf49'),
+ (x'3eb0c6f7a0b5ed8c'), (x'3eb0c6f7a0b5ed8d'), (x'3eb0c6f7a0b5ed8e'),
+ (x'3ee4f8b588e368ef'), (x'3ee4f8b588e368f0'), (x'3ee4f8b588e368f1'),
+ (x'3f1a36e2eb1c432c'), (x'3f1a36e2eb1c432d'), (x'3f1a36e2eb1c432e'),
+ (x'3f50624dd2f1a9fb'), (x'3f50624dd2f1a9fc'), (x'3f50624dd2f1a9fd'),
+ (x'3f847ae147ae147a'), (x'3f847ae147ae147b'), (x'3f847ae147ae147c'),
+ (x'3fb9999999999999'), (x'3fb999999999999a'), (x'3fb999999999999b'),
+ -- values very close to 1
+ (x'3feffffffffffff0'), (x'3feffffffffffff1'), (x'3feffffffffffff2'),
+ (x'3feffffffffffff3'), (x'3feffffffffffff4'), (x'3feffffffffffff5'),
+ (x'3feffffffffffff6'), (x'3feffffffffffff7'), (x'3feffffffffffff8'),
+ (x'3feffffffffffff9'), (x'3feffffffffffffa'), (x'3feffffffffffffb'),
+ (x'3feffffffffffffc'), (x'3feffffffffffffd'), (x'3feffffffffffffe'),
+ (x'3fefffffffffffff'),
+ (x'3ff0000000000000'),
+ (x'3ff0000000000001'), (x'3ff0000000000002'), (x'3ff0000000000003'),
+ (x'3ff0000000000004'), (x'3ff0000000000005'), (x'3ff0000000000006'),
+ (x'3ff0000000000007'), (x'3ff0000000000008'), (x'3ff0000000000009'),
+ --
+ (x'3ff921fb54442d18'),
+ (x'4005bf0a8b14576a'),
+ (x'400921fb54442d18'),
+ --
+ (x'4023ffffffffffff'), (x'4024000000000000'), (x'4024000000000001'),
+ (x'4058ffffffffffff'), (x'4059000000000000'), (x'4059000000000001'),
+ (x'408f3fffffffffff'), (x'408f400000000000'), (x'408f400000000001'),
+ (x'40c387ffffffffff'), (x'40c3880000000000'), (x'40c3880000000001'),
+ (x'40f869ffffffffff'), (x'40f86a0000000000'), (x'40f86a0000000001'),
+ (x'412e847fffffffff'), (x'412e848000000000'), (x'412e848000000001'),
+ (x'416312cfffffffff'), (x'416312d000000000'), (x'416312d000000001'),
+ (x'4197d783ffffffff'), (x'4197d78400000000'), (x'4197d78400000001'),
+ (x'41cdcd64ffffffff'), (x'41cdcd6500000000'), (x'41cdcd6500000001'),
+ (x'4202a05f1fffffff'), (x'4202a05f20000000'), (x'4202a05f20000001'),
+ (x'42374876e7ffffff'), (x'42374876e8000000'), (x'42374876e8000001'),
+ (x'426d1a94a1ffffff'), (x'426d1a94a2000000'), (x'426d1a94a2000001'),
+ (x'42a2309ce53fffff'), (x'42a2309ce5400000'), (x'42a2309ce5400001'),
+ (x'42d6bcc41e8fffff'), (x'42d6bcc41e900000'), (x'42d6bcc41e900001'),
+ (x'430c6bf52633ffff'), (x'430c6bf526340000'), (x'430c6bf526340001'),
+ (x'4341c37937e07fff'), (x'4341c37937e08000'), (x'4341c37937e08001'),
+ (x'4376345785d89fff'), (x'4376345785d8a000'), (x'4376345785d8a001'),
+ (x'43abc16d674ec7ff'), (x'43abc16d674ec800'), (x'43abc16d674ec801'),
+ (x'43e158e460913cff'), (x'43e158e460913d00'), (x'43e158e460913d01'),
+ (x'4415af1d78b58c3f'), (x'4415af1d78b58c40'), (x'4415af1d78b58c41'),
+ (x'444b1ae4d6e2ef4f'), (x'444b1ae4d6e2ef50'), (x'444b1ae4d6e2ef51'),
+ (x'4480f0cf064dd591'), (x'4480f0cf064dd592'), (x'4480f0cf064dd593'),
+ (x'44b52d02c7e14af5'), (x'44b52d02c7e14af6'), (x'44b52d02c7e14af7'),
+ (x'44ea784379d99db3'), (x'44ea784379d99db4'), (x'44ea784379d99db5'),
+ (x'45208b2a2c280290'), (x'45208b2a2c280291'), (x'45208b2a2c280292'),
+ --
+ (x'7feffffffffffffe'), (x'7fefffffffffffff'),
+ -- round to even tests (+ve)
+ (x'4350000000000002'),
+ (x'4350000000002e06'),
+ (x'4352000000000003'),
+ (x'4352000000000004'),
+ (x'4358000000000003'),
+ (x'4358000000000004'),
+ (x'435f000000000020'),
+ -- round to even tests (-ve)
+ (x'c350000000000002'),
+ (x'c350000000002e06'),
+ (x'c352000000000003'),
+ (x'c352000000000004'),
+ (x'c358000000000003'),
+ (x'c358000000000004'),
+ (x'c35f000000000020'),
+ -- exercise fixed-point memmoves
+ (x'42dc12218377de66'),
+ (x'42a674e79c5fe51f'),
+ (x'4271f71fb04cb74c'),
+ (x'423cbe991a145879'),
+ (x'4206fee0e1a9e061'),
+ (x'41d26580b487e6b4'),
+ (x'419d6f34540ca453'),
+ (x'41678c29dcd6e9dc'),
+ (x'4132d687e3df217d'),
+ (x'40fe240c9fcb68c8'),
+ (x'40c81cd6e63c53d3'),
+ (x'40934a4584fd0fdc'),
+ (x'405edd3c07fb4c93'),
+ (x'4028b0fcd32f7076'),
+ (x'3ff3c0ca428c59f8'),
+ -- these cases come from the upstream's testsuite
+ -- LotsOfTrailingZeros)
+ (x'3e60000000000000'),
+ -- Regression
+ (x'c352bd2668e077c4'),
+ (x'434018601510c000'),
+ (x'43d055dc36f24000'),
+ (x'43e052961c6f8000'),
+ (x'3ff3c0ca2a5b1d5d'),
+ -- LooksLikePow5
+ (x'4830f0cf064dd592'),
+ (x'4840f0cf064dd592'),
+ (x'4850f0cf064dd592'),
+ -- OutputLength
+ (x'3ff3333333333333'),
+ (x'3ff3ae147ae147ae'),
+ (x'3ff3be76c8b43958'),
+ (x'3ff3c083126e978d'),
+ (x'3ff3c0c1fc8f3238'),
+ (x'3ff3c0c9539b8887'),
+ (x'3ff3c0ca2a5b1d5d'),
+ (x'3ff3c0ca4283de1b'),
+ (x'3ff3c0ca43db770a'),
+ (x'3ff3c0ca428abd53'),
+ (x'3ff3c0ca428c1d2b'),
+ (x'3ff3c0ca428c51f2'),
+ (x'3ff3c0ca428c58fc'),
+ (x'3ff3c0ca428c59dd'),
+ (x'3ff3c0ca428c59f8'),
+ (x'3ff3c0ca428c59fb'),
+ -- 32-bit chunking
+ (x'40112e0be8047a7d'),
+ (x'40112e0be815a889'),
+ (x'40112e0be826d695'),
+ (x'40112e0be83804a1'),
+ (x'40112e0be84932ad'),
+ -- MinMaxShift
+ (x'0040000000000000'),
+ (x'007fffffffffffff'),
+ (x'0290000000000000'),
+ (x'029fffffffffffff'),
+ (x'4350000000000000'),
+ (x'435fffffffffffff'),
+ (x'1330000000000000'),
+ (x'133fffffffffffff'),
+ (x'3a6fa7161a4d6e0c')
+)
+select float8send(flt) as ibits,
+ flt,
+ flt::text::float8 as r_flt,
+ float8send(flt::text::float8) as obits,
+ float8send(flt::text::float8) = float8send(flt) as correct
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:145:30: Error: Unknown type: xfloat8
+ from (select bits::bigint::xfloat8::float8 as flt
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- round-trip tests
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- round-trip tests
+ ^
+<sql-statement>
+-- clean up, lest opr_sanity complain
+drop type xfloat8 cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ -- clean up, lest opr_sanity complain
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/float8.out b/yql/essentials/tests/postgresql/cases/float8.out
new file mode 100644
index 0000000000..438862da6c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float8.out
@@ -0,0 +1,840 @@
+--
+-- FLOAT8
+--
+CREATE TABLE FLOAT8_TBL(f1 float8);
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+-- test for underflow and overflow handling
+SELECT '10e400'::float8;
+ERROR: "10e400" is out of range for type double precision
+LINE 1: SELECT '10e400'::float8;
+ ^
+SELECT '-10e400'::float8;
+ERROR: "-10e400" is out of range for type double precision
+LINE 1: SELECT '-10e400'::float8;
+ ^
+SELECT '10e-400'::float8;
+ERROR: "10e-400" is out of range for type double precision
+LINE 1: SELECT '10e-400'::float8;
+ ^
+SELECT '-10e-400'::float8;
+ERROR: "-10e-400" is out of range for type double precision
+LINE 1: SELECT '-10e-400'::float8;
+ ^
+-- test smallest normalized input
+SELECT float8send('2.2250738585072014E-308'::float8);
+ float8send
+--------------------
+ \x0010000000000000
+(1 row)
+
+-- bad input
+INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type double precision: ""
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type double precision: " "
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ERROR: invalid input syntax for type double precision: "xyz"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ERROR: invalid input syntax for type double precision: "5.0.0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type double precision: "5 . 0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ERROR: invalid input syntax for type double precision: "5. 0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ERROR: invalid input syntax for type double precision: " - 3"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type double precision: "123 5"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ ^
+-- special inputs
+SELECT 'NaN'::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'nan'::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT ' NAN '::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'infinity'::float8;
+ float8
+----------
+ Infinity
+(1 row)
+
+SELECT ' -INFINiTY '::float8;
+ float8
+-----------
+ -Infinity
+(1 row)
+
+-- bad special inputs
+SELECT 'N A N'::float8;
+ERROR: invalid input syntax for type double precision: "N A N"
+LINE 1: SELECT 'N A N'::float8;
+ ^
+SELECT 'NaN x'::float8;
+ERROR: invalid input syntax for type double precision: "NaN x"
+LINE 1: SELECT 'NaN x'::float8;
+ ^
+SELECT ' INFINITY x'::float8;
+ERROR: invalid input syntax for type double precision: " INFINITY x"
+LINE 1: SELECT ' INFINITY x'::float8;
+ ^
+SELECT 'Infinity'::float8 + 100.0;
+ ?column?
+----------
+ Infinity
+(1 row)
+
+SELECT 'Infinity'::float8 / 'Infinity'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '42'::float8 / 'Infinity'::float8;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT 'nan'::float8 / 'nan'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::float8 / '0'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::numeric::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT * FROM FLOAT8_TBL;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(5 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+ f1
+--------
+ 1004.3
+(1 row)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e-200
+(3 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e-200
+(3 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+-----------------------
+ 1004.3 | -10043
+ 1.2345678901234e+200 | -1.2345678901234e+201
+ 1.2345678901234e-200 | -1.2345678901234e-199
+(3 rows)
+
+SELECT f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+----------------------
+ 1004.3 | 994.3
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | -10
+(3 rows)
+
+SELECT f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+----------------------
+ 1004.3 | 1014.3
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 10
+(3 rows)
+
+-- absolute value
+SELECT f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+ f1 | abs_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004.3
+ -34.84 | 34.84
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 1.2345678901234e-200
+(5 rows)
+
+-- truncate
+SELECT f.f1, trunc(f.f1) AS trunc_f1
+ FROM FLOAT8_TBL f;
+ f1 | trunc_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004
+ -34.84 | -34
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 0
+(5 rows)
+
+-- round
+SELECT f.f1, round(f.f1) AS round_f1
+ FROM FLOAT8_TBL f;
+ f1 | round_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004
+ -34.84 | -35
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 0
+(5 rows)
+
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+-- square root
+SELECT sqrt(float8 '64') AS eight;
+ eight
+-------
+ 8
+(1 row)
+
+SELECT |/ float8 '64' AS eight;
+ eight
+-------
+ 8
+(1 row)
+
+SELECT f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | sqrt_f1
+----------------------+-----------------------
+ 1004.3 | 31.6906926399535
+ 1.2345678901234e+200 | 1.11111110611109e+100
+ 1.2345678901234e-200 | 1.11111110611109e-100
+(3 rows)
+
+-- power
+SELECT power(float8 '144', float8 '0.5');
+ power
+-------
+ 12
+(1 row)
+
+SELECT power(float8 'NaN', float8 '0.5');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '144', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 'NaN', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '-1', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '1', float8 'NaN');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 'NaN', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 'inf', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-inf', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '0', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '0', float8 '-inf');
+ERROR: zero raised to a negative power is undefined
+SELECT power(float8 '1', float8 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '1', float8 '-inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-1', float8 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-1', float8 '-inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '0.1', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '-0.1', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '1.1', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-1.1', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '0.1', float8 '-inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-0.1', float8 '-inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '1.1', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '-1.1', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 'inf', float8 '-2');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 'inf', float8 '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 'inf', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 'inf', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+-- Intel's icc misoptimizes the code that controls the sign of this result,
+-- even with -mp1. Pending a fix for that, only test for "is it zero".
+SELECT power(float8 '-inf', float8 '-2') = '0';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT power(float8 '-inf', float8 '-3');
+ power
+-------
+ -0
+(1 row)
+
+SELECT power(float8 '-inf', float8 '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '3');
+ power
+-----------
+ -Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '3.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power(float8 '-inf', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+-- take exp of ln(f.f1)
+SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | exp_ln_f1
+----------------------+-----------------------
+ 1004.3 | 1004.3
+ 1.2345678901234e+200 | 1.23456789012338e+200
+ 1.2345678901234e-200 | 1.23456789012339e-200
+(3 rows)
+
+-- cube root
+SELECT ||/ float8 '27' AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+ f1 | cbrt_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 10.014312837827
+ -34.84 | -3.26607421344208
+ 1.2345678901234e+200 | 4.97933859234765e+66
+ 1.2345678901234e-200 | 2.3112042409018e-67
+(5 rows)
+
+SELECT * FROM FLOAT8_TBL;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(5 rows)
+
+SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+ERROR: value out of range: overflow
+SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+ERROR: value out of range: overflow
+SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+ERROR: cannot take logarithm of zero
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+ERROR: cannot take logarithm of a negative number
+SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+ERROR: division by zero
+-- hyperbolic functions
+-- we run these with extra_float_digits = 0 too, since different platforms
+-- tend to produce results that vary in the last place.
+SELECT sinh(float8 '1');
+ sinh
+-----------------
+ 1.1752011936438
+(1 row)
+
+SELECT cosh(float8 '1');
+ cosh
+------------------
+ 1.54308063481524
+(1 row)
+
+SELECT tanh(float8 '1');
+ tanh
+-------------------
+ 0.761594155955765
+(1 row)
+
+SELECT asinh(float8 '1');
+ asinh
+-------------------
+ 0.881373587019543
+(1 row)
+
+SELECT acosh(float8 '2');
+ acosh
+------------------
+ 1.31695789692482
+(1 row)
+
+SELECT atanh(float8 '0.5');
+ atanh
+-------------------
+ 0.549306144334055
+(1 row)
+
+-- test Inf/NaN cases for hyperbolic functions
+SELECT sinh(float8 'infinity');
+ sinh
+----------
+ Infinity
+(1 row)
+
+SELECT sinh(float8 '-infinity');
+ sinh
+-----------
+ -Infinity
+(1 row)
+
+SELECT sinh(float8 'nan');
+ sinh
+------
+ NaN
+(1 row)
+
+SELECT cosh(float8 'infinity');
+ cosh
+----------
+ Infinity
+(1 row)
+
+SELECT cosh(float8 '-infinity');
+ cosh
+----------
+ Infinity
+(1 row)
+
+SELECT cosh(float8 'nan');
+ cosh
+------
+ NaN
+(1 row)
+
+SELECT tanh(float8 'infinity');
+ tanh
+------
+ 1
+(1 row)
+
+SELECT tanh(float8 '-infinity');
+ tanh
+------
+ -1
+(1 row)
+
+SELECT tanh(float8 'nan');
+ tanh
+------
+ NaN
+(1 row)
+
+SELECT asinh(float8 'infinity');
+ asinh
+----------
+ Infinity
+(1 row)
+
+SELECT asinh(float8 '-infinity');
+ asinh
+-----------
+ -Infinity
+(1 row)
+
+SELECT asinh(float8 'nan');
+ asinh
+-------
+ NaN
+(1 row)
+
+-- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+-- SELECT acosh(float8 'infinity');
+SELECT acosh(float8 '-infinity');
+ERROR: input is out of range
+SELECT acosh(float8 'nan');
+ acosh
+-------
+ NaN
+(1 row)
+
+SELECT atanh(float8 'infinity');
+ERROR: input is out of range
+SELECT atanh(float8 '-infinity');
+ERROR: input is out of range
+SELECT atanh(float8 'nan');
+ atanh
+-------
+ NaN
+(1 row)
+
+RESET extra_float_digits;
+-- test for over- and underflow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+ERROR: "10e400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ERROR: "-10e400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ERROR: "10e-400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ERROR: "-10e-400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+-- test edge-case coercions to integer
+SELECT '32767.4'::float8::int2;
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT '32767.6'::float8::int2;
+ERROR: smallint out of range
+SELECT '-32768.4'::float8::int2;
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT '-32768.6'::float8::int2;
+ERROR: smallint out of range
+SELECT '2147483647.4'::float8::int4;
+ int4
+------------
+ 2147483647
+(1 row)
+
+SELECT '2147483647.6'::float8::int4;
+ERROR: integer out of range
+SELECT '-2147483648.4'::float8::int4;
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT '-2147483648.6'::float8::int4;
+ERROR: integer out of range
+SELECT '9223372036854773760'::float8::int8;
+ int8
+---------------------
+ 9223372036854773760
+(1 row)
+
+SELECT '9223372036854775807'::float8::int8;
+ERROR: bigint out of range
+SELECT '-9223372036854775808.5'::float8::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT '-9223372036854780000'::float8::int8;
+ERROR: bigint out of range
+-- test exact cases for trigonometric functions in degrees
+SELECT x,
+ sind(x),
+ sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
+FROM (VALUES (0), (30), (90), (150), (180),
+ (210), (270), (330), (360)) AS t(x);
+ x | sind | sind_exact
+-----+------+------------
+ 0 | 0 | t
+ 30 | 0.5 | t
+ 90 | 1 | t
+ 150 | 0.5 | t
+ 180 | 0 | t
+ 210 | -0.5 | t
+ 270 | -1 | t
+ 330 | -0.5 | t
+ 360 | 0 | t
+(9 rows)
+
+SELECT x,
+ cosd(x),
+ cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
+FROM (VALUES (0), (60), (90), (120), (180),
+ (240), (270), (300), (360)) AS t(x);
+ x | cosd | cosd_exact
+-----+------+------------
+ 0 | 1 | t
+ 60 | 0.5 | t
+ 90 | 0 | t
+ 120 | -0.5 | t
+ 180 | -1 | t
+ 240 | -0.5 | t
+ 270 | 0 | t
+ 300 | 0.5 | t
+ 360 | 1 | t
+(9 rows)
+
+SELECT x,
+ tand(x),
+ tand(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS tand_exact,
+ cotd(x),
+ cotd(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS cotd_exact
+FROM (VALUES (0), (45), (90), (135), (180),
+ (225), (270), (315), (360)) AS t(x);
+ x | tand | tand_exact | cotd | cotd_exact
+-----+-----------+------------+-----------+------------
+ 0 | 0 | t | Infinity | t
+ 45 | 1 | t | 1 | t
+ 90 | Infinity | t | 0 | t
+ 135 | -1 | t | -1 | t
+ 180 | 0 | t | -Infinity | t
+ 225 | 1 | t | 1 | t
+ 270 | -Infinity | t | 0 | t
+ 315 | -1 | t | -1 | t
+ 360 | 0 | t | Infinity | t
+(9 rows)
+
+SELECT x,
+ atand(x),
+ atand(x) IN (-90,-45,0,45,90) AS atand_exact
+FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
+ ('Infinity'::float8)) AS t(x);
+ x | atand | atand_exact
+-----------+-------+-------------
+ -Infinity | -90 | t
+ -1 | -45 | t
+ 0 | 0 | t
+ 1 | 45 | t
+ Infinity | 90 | t
+(5 rows)
+
+SELECT x, y,
+ atan2d(y, x),
+ atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
+FROM (SELECT 10*cosd(a), 10*sind(a)
+ FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
+ x | y | atan2d | atan2d_exact
+-----+-----+--------+--------------
+ 10 | 0 | 0 | t
+ 0 | 10 | 90 | t
+ -10 | 0 | 180 | t
+ 0 | -10 | -90 | t
+ 10 | 0 | 0 | t
+(5 rows)
+
diff --git a/yql/essentials/tests/postgresql/cases/float8.sql b/yql/essentials/tests/postgresql/cases/float8.sql
new file mode 100644
index 0000000000..d81f81e06a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/float8.sql
@@ -0,0 +1,208 @@
+--
+-- FLOAT8
+--
+CREATE TABLE FLOAT8_TBL(f1 float8);
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+-- test for underflow and overflow handling
+SELECT '10e400'::float8;
+SELECT '-10e400'::float8;
+SELECT '10e-400'::float8;
+SELECT '-10e-400'::float8;
+-- test smallest normalized input
+SELECT float8send('2.2250738585072014E-308'::float8);
+-- bad input
+INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+-- special inputs
+SELECT 'NaN'::float8;
+SELECT 'nan'::float8;
+SELECT ' NAN '::float8;
+SELECT 'infinity'::float8;
+SELECT ' -INFINiTY '::float8;
+-- bad special inputs
+SELECT 'N A N'::float8;
+SELECT 'NaN x'::float8;
+SELECT ' INFINITY x'::float8;
+SELECT 'Infinity'::float8 + 100.0;
+SELECT 'Infinity'::float8 / 'Infinity'::float8;
+SELECT '42'::float8 / 'Infinity'::float8;
+SELECT 'nan'::float8 / 'nan'::float8;
+SELECT 'nan'::float8 / '0'::float8;
+SELECT 'nan'::numeric::float8;
+SELECT * FROM FLOAT8_TBL;
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+SELECT f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+SELECT f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+SELECT f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+-- absolute value
+SELECT f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+-- truncate
+SELECT f.f1, trunc(f.f1) AS trunc_f1
+ FROM FLOAT8_TBL f;
+-- round
+SELECT f.f1, round(f.f1) AS round_f1
+ FROM FLOAT8_TBL f;
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+-- square root
+SELECT sqrt(float8 '64') AS eight;
+SELECT |/ float8 '64' AS eight;
+SELECT f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+-- power
+SELECT power(float8 '144', float8 '0.5');
+SELECT power(float8 'NaN', float8 '0.5');
+SELECT power(float8 '144', float8 'NaN');
+SELECT power(float8 'NaN', float8 'NaN');
+SELECT power(float8 '-1', float8 'NaN');
+SELECT power(float8 '1', float8 'NaN');
+SELECT power(float8 'NaN', float8 '0');
+SELECT power(float8 'inf', float8 '0');
+SELECT power(float8 '-inf', float8 '0');
+SELECT power(float8 '0', float8 'inf');
+SELECT power(float8 '0', float8 '-inf');
+SELECT power(float8 '1', float8 'inf');
+SELECT power(float8 '1', float8 '-inf');
+SELECT power(float8 '-1', float8 'inf');
+SELECT power(float8 '-1', float8 '-inf');
+SELECT power(float8 '0.1', float8 'inf');
+SELECT power(float8 '-0.1', float8 'inf');
+SELECT power(float8 '1.1', float8 'inf');
+SELECT power(float8 '-1.1', float8 'inf');
+SELECT power(float8 '0.1', float8 '-inf');
+SELECT power(float8 '-0.1', float8 '-inf');
+SELECT power(float8 '1.1', float8 '-inf');
+SELECT power(float8 '-1.1', float8 '-inf');
+SELECT power(float8 'inf', float8 '-2');
+SELECT power(float8 'inf', float8 '2');
+SELECT power(float8 'inf', float8 'inf');
+SELECT power(float8 'inf', float8 '-inf');
+-- Intel's icc misoptimizes the code that controls the sign of this result,
+-- even with -mp1. Pending a fix for that, only test for "is it zero".
+SELECT power(float8 '-inf', float8 '-2') = '0';
+SELECT power(float8 '-inf', float8 '-3');
+SELECT power(float8 '-inf', float8 '2');
+SELECT power(float8 '-inf', float8 '3');
+SELECT power(float8 '-inf', float8 '3.5');
+SELECT power(float8 '-inf', float8 'inf');
+SELECT power(float8 '-inf', float8 '-inf');
+-- take exp of ln(f.f1)
+SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+-- cube root
+SELECT ||/ float8 '27' AS three;
+SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+SELECT * FROM FLOAT8_TBL;
+SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+-- hyperbolic functions
+-- we run these with extra_float_digits = 0 too, since different platforms
+-- tend to produce results that vary in the last place.
+SELECT sinh(float8 '1');
+SELECT cosh(float8 '1');
+SELECT tanh(float8 '1');
+SELECT asinh(float8 '1');
+SELECT acosh(float8 '2');
+SELECT atanh(float8 '0.5');
+-- test Inf/NaN cases for hyperbolic functions
+SELECT sinh(float8 'infinity');
+SELECT sinh(float8 '-infinity');
+SELECT sinh(float8 'nan');
+SELECT cosh(float8 'infinity');
+SELECT cosh(float8 '-infinity');
+SELECT cosh(float8 'nan');
+SELECT tanh(float8 'infinity');
+SELECT tanh(float8 '-infinity');
+SELECT tanh(float8 'nan');
+SELECT asinh(float8 'infinity');
+SELECT asinh(float8 '-infinity');
+SELECT asinh(float8 'nan');
+-- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+-- SELECT acosh(float8 'infinity');
+SELECT acosh(float8 '-infinity');
+SELECT acosh(float8 'nan');
+SELECT atanh(float8 'infinity');
+SELECT atanh(float8 '-infinity');
+SELECT atanh(float8 'nan');
+RESET extra_float_digits;
+-- test for over- and underflow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+-- test edge-case coercions to integer
+SELECT '32767.4'::float8::int2;
+SELECT '32767.6'::float8::int2;
+SELECT '-32768.4'::float8::int2;
+SELECT '-32768.6'::float8::int2;
+SELECT '2147483647.4'::float8::int4;
+SELECT '2147483647.6'::float8::int4;
+SELECT '-2147483648.4'::float8::int4;
+SELECT '-2147483648.6'::float8::int4;
+SELECT '9223372036854773760'::float8::int8;
+SELECT '9223372036854775807'::float8::int8;
+SELECT '-9223372036854775808.5'::float8::int8;
+SELECT '-9223372036854780000'::float8::int8;
+-- test exact cases for trigonometric functions in degrees
+SELECT x,
+ sind(x),
+ sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
+FROM (VALUES (0), (30), (90), (150), (180),
+ (210), (270), (330), (360)) AS t(x);
+SELECT x,
+ cosd(x),
+ cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
+FROM (VALUES (0), (60), (90), (120), (180),
+ (240), (270), (300), (360)) AS t(x);
+SELECT x,
+ tand(x),
+ tand(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS tand_exact,
+ cotd(x),
+ cotd(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS cotd_exact
+FROM (VALUES (0), (45), (90), (135), (180),
+ (225), (270), (315), (360)) AS t(x);
+SELECT x,
+ atand(x),
+ atand(x) IN (-90,-45,0,45,90) AS atand_exact
+FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
+ ('Infinity'::float8)) AS t(x);
+SELECT x, y,
+ atan2d(y, x),
+ atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
+FROM (SELECT 10*cosd(a), 10*sind(a)
+ FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
diff --git a/yql/essentials/tests/postgresql/cases/functional_deps.err b/yql/essentials/tests/postgresql/cases/functional_deps.err
new file mode 100644
index 0000000000..d227b8c4c9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/functional_deps.err
@@ -0,0 +1,656 @@
+<sql-statement>
+-- from http://www.depesz.com/index.php/2010/04/19/getting-unique-elements/
+CREATE TEMP TABLE articles (
+ id int CONSTRAINT articles_pkey PRIMARY KEY,
+ keywords text,
+ title text UNIQUE NOT NULL,
+ body text UNIQUE,
+ created date
+);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE articles_in_category (
+ article_id int,
+ category_id int,
+ changed date,
+ PRIMARY KEY (article_id, category_id)
+);
+</sql-statement>
+<sql-statement>
+-- test functional dependencies based on primary keys/unique constraints
+-- base tables
+-- group by primary key (OK)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- test functional dependencies based on primary keys/unique constraints
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- test functional dependencies based on primary keys/unique constraints
+ ^
+ -stdin-:<main>:4:12: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:12: Error: Member not found: _alias_articles.keywords
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:22: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:22: Error: Member not found: _alias_articles.title
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:29: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:29: Error: Member not found: _alias_articles.body
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:35: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:4:35: Error: Member not found: _alias_articles.created
+ SELECT id, keywords, title, body, created
+ ^
+<sql-statement>
+-- group by unique not null (fail/todo)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY title;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- group by unique not null (fail/todo)
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- group by unique not null (fail/todo)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_articles.id
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:12: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:12: Error: Member not found: _alias_articles.keywords
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:29: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:29: Error: Member not found: _alias_articles.body
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: Member not found: _alias_articles.created
+ SELECT id, keywords, title, body, created
+ ^
+<sql-statement>
+-- group by unique nullable (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- group by unique nullable (fail)
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- group by unique nullable (fail)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_articles.id
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:12: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:12: Error: Member not found: _alias_articles.keywords
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:22: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:22: Error: Member not found: _alias_articles.title
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: Member not found: _alias_articles.created
+ SELECT id, keywords, title, body, created
+ ^
+<sql-statement>
+-- group by something else (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY keywords;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_articles.id
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:22: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:22: Error: Member not found: _alias_articles.title
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:29: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:29: Error: Member not found: _alias_articles.body
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: At function: Member
+ SELECT id, keywords, title, body, created
+ ^
+ -stdin-:<main>:2:35: Error: Member not found: _alias_articles.created
+ SELECT id, keywords, title, body, created
+ ^
+<sql-statement>
+-- multiple tables
+-- group by primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- multiple tables
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- multiple tables
+ ^
+ -stdin-:<main>:3:14: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:14: Error: Member not found: _alias_a.keywords
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:26: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:26: Error: Member not found: _alias_a.title
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:35: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:35: Error: Member not found: _alias_a.body
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:43: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:43: Error: Member not found: _alias_a.created
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+<sql-statement>
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_a.id
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:14: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:14: Error: Member not found: _alias_a.keywords
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:26: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:26: Error: Member not found: _alias_a.title
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:35: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:35: Error: Member not found: _alias_a.body
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:43: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:43: Error: Member not found: _alias_a.created
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+<sql-statement>
+-- JOIN syntax
+-- group by left table's primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- JOIN syntax
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- JOIN syntax
+ ^
+ -stdin-:<main>:3:14: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:14: Error: Member not found: _alias_a.keywords
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:26: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:26: Error: Member not found: _alias_a.title
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:35: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:35: Error: Member not found: _alias_a.body
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:43: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:3:43: Error: Member not found: _alias_a.created
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+<sql-statement>
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:1:1: Error: At function: AsStruct
+ -- group by something else (fail)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_a.id
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:14: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:14: Error: Member not found: _alias_a.keywords
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:26: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:26: Error: Member not found: _alias_a.title
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:35: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:35: Error: Member not found: _alias_a.body
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:43: Error: At function: Member
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+ -stdin-:<main>:2:43: Error: Member not found: _alias_a.created
+ SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+<sql-statement>
+-- group by right table's (composite) primary key (OK)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.category_id, aic.article_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- group by right table's (composite) primary key (OK)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT aic.changed
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_aic.changed
+ SELECT aic.changed
+ ^
+<sql-statement>
+-- group by right table's partial primary key (fail)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- group by right table's partial primary key (fail)
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT aic.changed
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_aic.changed
+ SELECT aic.changed
+ ^
+<sql-statement>
+-- example from documentation
+CREATE TEMP TABLE products (product_id int, name text, price numeric);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE sales (product_id int, units int);
+</sql-statement>
+<sql-statement>
+-- OK
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id, p.name, p.price;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: UnionAll, At function: Aggregate, At function: OrderedMap, At function: OrderedMap, At function: FlattenMembers
+ -- OK
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: product_id
+ -- OK
+ ^
+<sql-statement>
+-- fail
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: UnionAll, At function: Aggregate, At function: OrderedMap, At function: OrderedMap, At function: FlattenMembers
+ -- fail
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: product_id
+ -- fail
+ ^
+<sql-statement>
+ALTER TABLE products ADD PRIMARY KEY (product_id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE products ADD PRIMARY KEY (product_id);
+ ^
+<sql-statement>
+-- OK now
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: UnionAll, At function: Aggregate, At function: OrderedMap, At function: OrderedMap, At function: FlattenMembers
+ -- OK now
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: product_id
+ -- OK now
+ ^
+<sql-statement>
+-- Drupal example, http://drupal.org/node/555530
+CREATE TEMP TABLE node (
+ nid SERIAL,
+ vid integer NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid integer NOT NULL default '0',
+ status integer NOT NULL default '1',
+ created integer NOT NULL default '0',
+ -- snip
+ PRIMARY KEY (nid, vid)
+);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE users (
+ uid integer NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ -- snip
+ PRIMARY KEY (uid),
+ UNIQUE (name)
+);
+</sql-statement>
+<sql-statement>
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid, u.name;
+</sql-statement>
+<sql-statement>
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- OK
+ ^
+ -stdin-:<main>:2:15: Error: At function: Member
+ SELECT u.uid, u.name FROM node n
+ ^
+ -stdin-:<main>:2:15: Error: Member not found: _alias_u.name
+ SELECT u.uid, u.name FROM node n
+ ^
+<sql-statement>
+-- Check views and dependencies
+-- fail
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- Check views and dependencies
+ ^
+<sql-statement>
+-- OK
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- OK
+ ^
+<sql-statement>
+-- fail
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- fail
+ ^
+<sql-statement>
+DROP VIEW fdv1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'fdv1'
+ DROP VIEW fdv1;
+ ^
+<sql-statement>
+-- multiple dependencies
+CREATE TEMP VIEW fdv2 AS
+SELECT a.id, a.keywords, a.title, aic.category_id, aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id, aic.category_id, aic.article_id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- multiple dependencies
+ ^
+<sql-statement>
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ ^
+<sql-statement>
+ALTER TABLE articles_in_category DROP CONSTRAINT articles_in_category_pkey RESTRICT; --fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE articles_in_category DROP CONSTRAINT articles_in_category_pkey RESTRICT; --fail
+ ^
+<sql-statement>
+DROP VIEW fdv2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'fdv2'
+ DROP VIEW fdv2;
+ ^
+<sql-statement>
+-- nested queries
+CREATE TEMP VIEW fdv3 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id
+UNION
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- nested queries
+ ^
+<sql-statement>
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ ^
+<sql-statement>
+DROP VIEW fdv3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'fdv3'
+ DROP VIEW fdv3;
+ ^
+<sql-statement>
+CREATE TEMP VIEW fdv4 AS
+SELECT * FROM articles WHERE title IN (SELECT title FROM articles GROUP BY id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE TEMP VIEW fdv4 AS
+ ^
+<sql-statement>
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ ^
+<sql-statement>
+DROP VIEW fdv4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'fdv4'
+ DROP VIEW fdv4;
+ ^
+<sql-statement>
+-- prepared query plans: this results in failure on reuse
+PREPARE foo AS
+ SELECT id, keywords, title, body, created
+ FROM articles
+ GROUP BY id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ -- prepared query plans: this results in failure on reuse
+ ^
+<sql-statement>
+EXECUTE foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo;
+ ^
+<sql-statement>
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+ ^
+<sql-statement>
+EXECUTE foo; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo; -- fail
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/functional_deps.out b/yql/essentials/tests/postgresql/cases/functional_deps.out
new file mode 100644
index 0000000000..60ac758a42
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/functional_deps.out
@@ -0,0 +1,46 @@
+-- from http://www.depesz.com/index.php/2010/04/19/getting-unique-elements/
+CREATE TEMP TABLE articles (
+ id int CONSTRAINT articles_pkey PRIMARY KEY,
+ keywords text,
+ title text UNIQUE NOT NULL,
+ body text UNIQUE,
+ created date
+);
+CREATE TEMP TABLE articles_in_category (
+ article_id int,
+ category_id int,
+ changed date,
+ PRIMARY KEY (article_id, category_id)
+);
+-- example from documentation
+CREATE TEMP TABLE products (product_id int, name text, price numeric);
+CREATE TEMP TABLE sales (product_id int, units int);
+-- Drupal example, http://drupal.org/node/555530
+CREATE TEMP TABLE node (
+ nid SERIAL,
+ vid integer NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid integer NOT NULL default '0',
+ status integer NOT NULL default '1',
+ created integer NOT NULL default '0',
+ -- snip
+ PRIMARY KEY (nid, vid)
+);
+CREATE TEMP TABLE users (
+ uid integer NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ -- snip
+ PRIMARY KEY (uid),
+ UNIQUE (name)
+);
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid, u.name;
+ uid | name
+-----+------
+(0 rows)
+
diff --git a/yql/essentials/tests/postgresql/cases/functional_deps.sql b/yql/essentials/tests/postgresql/cases/functional_deps.sql
new file mode 100644
index 0000000000..4c8da83ef8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/functional_deps.sql
@@ -0,0 +1,42 @@
+-- from http://www.depesz.com/index.php/2010/04/19/getting-unique-elements/
+CREATE TEMP TABLE articles (
+ id int CONSTRAINT articles_pkey PRIMARY KEY,
+ keywords text,
+ title text UNIQUE NOT NULL,
+ body text UNIQUE,
+ created date
+);
+CREATE TEMP TABLE articles_in_category (
+ article_id int,
+ category_id int,
+ changed date,
+ PRIMARY KEY (article_id, category_id)
+);
+-- example from documentation
+CREATE TEMP TABLE products (product_id int, name text, price numeric);
+CREATE TEMP TABLE sales (product_id int, units int);
+-- Drupal example, http://drupal.org/node/555530
+CREATE TEMP TABLE node (
+ nid SERIAL,
+ vid integer NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid integer NOT NULL default '0',
+ status integer NOT NULL default '1',
+ created integer NOT NULL default '0',
+ -- snip
+ PRIMARY KEY (nid, vid)
+);
+CREATE TEMP TABLE users (
+ uid integer NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ -- snip
+ PRIMARY KEY (uid),
+ UNIQUE (name)
+);
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid, u.name;
diff --git a/yql/essentials/tests/postgresql/cases/horology.err b/yql/essentials/tests/postgresql/cases/horology.err
new file mode 100644
index 0000000000..55741efc1f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/horology.err
@@ -0,0 +1,1689 @@
+Registering pre-existing tables
+ TIME_TBL
+ TIMESTAMPTZ_TBL
+ TIMESTAMP_TBL
+ INTERVAL_TBL
+ TIMETZ_TBL
+<sql-statement>
+--
+-- HOROLOGY
+--
+SET DateStyle = 'Postgres, MDY';
+</sql-statement>
+<sql-statement>
+SHOW TimeZone; -- Many of these tests depend on the prevailing setting
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "timezone"
+ SHOW TimeZone; -- Many of these tests depend on the prevailing setting
+ ^
+<sql-statement>
+--
+-- Test various input formats
+--
+SELECT timestamp with time zone '20011227 040506+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227 040506-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227 040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227 040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227T040506+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227T040506-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227T040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '20011227T040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2001-12-27 04:05:06.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2001.12.27 04:05:06.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2001/12/27 04:05:06.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '12/27/2001 04:05:06.789-08';
+</sql-statement>
+<sql-statement>
+-- should fail in mdy mode:
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail in mdy mode:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ -- should fail in mdy mode:
+ ^
+<sql-statement>
+set datestyle to dmy;
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+ ^
+<sql-statement>
+reset datestyle;
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271.5+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271.5-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271 04:05:06+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271 04:05:06-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271T040506+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271T040506-08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271T040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone 'J2452271T040506.789-08';
+</sql-statement>
+<sql-statement>
+-- German/European-style dates with periods as delimiters
+SELECT timestamp with time zone '12.27.2001 04:05:06.789+08';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '12.27.2001 04:05:06.789-08';
+</sql-statement>
+<sql-statement>
+SET DateStyle = 'German';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "27.12.2001 04:05:06.789+08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
+ ^
+<sql-statement>
+SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "27.12.2001 04:05:06.789-08"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
+ ^
+<sql-statement>
+SET DateStyle = 'ISO';
+</sql-statement>
+<sql-statement>
+-- As of 7.4, allow time without time zone having a time zone specified
+SELECT time without time zone '040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT time without time zone '040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT time without time zone 'T040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT time without time zone 'T040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone '040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone '040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone 'T040506.789+08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone 'T040506.789-08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone 'T040506.789 +08';
+</sql-statement>
+<sql-statement>
+SELECT time with time zone 'T040506.789 -08';
+</sql-statement>
+<sql-statement>
+SET DateStyle = 'Postgres, MDY';
+</sql-statement>
+<sql-statement>
+-- Check Julian dates BC
+SELECT date 'J1520447' AS "Confucius' Birthday";
+</sql-statement>
+<sql-statement>
+SELECT date 'J0' AS "Julian Epoch";
+</sql-statement>
+<sql-statement>
+--
+-- date, time arithmetic
+--
+SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
+</sql-statement>
+<sql-statement>
+SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "04:05:06 PST"
+
+ SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+ ^
+<sql-statement>
+SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "04:05:06 UTC"
+
+ SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+ ^
+<sql-statement>
+SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
+</sql-statement>
+<sql-statement>
+SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
+</sql-statement>
+<sql-statement>
+-- subtract time from date should not make sense; use interval instead
+SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
+</sql-statement>
+<sql-statement>
+SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+</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 date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgOp
+ SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+ ^
+ -stdin-:<main>:1:26: Error: Unable to find an overload for operator - with given argument type(s): (date,timetz)
+ SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+ ^
+<sql-statement>
+--
+-- timestamp, interval arithmetic
+--
+SELECT timestamp without time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
+</sql-statement>
+<sql-statement>
+SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
+</sql-statement>
+<sql-statement>
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - thomas 97/04/26
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
+</sql-statement>
+<sql-statement>
+-- Convert from date and time to timestamp
+-- This test used to be timestamp(date,time) but no longer allowed by grammar
+-- to enable support for SQL99 timestamp type syntax.
+SELECT date '1994-01-01' + time '11:00' AS "Jan_01_1994_11am";
+</sql-statement>
+<sql-statement>
+SELECT date '1994-01-01' + time '10:00' AS "Jan_01_1994_10am";
+</sql-statement>
+<sql-statement>
+SELECT date '1994-01-01' + timetz '11:00-5' AS "Jan_01_1994_8am";
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+</sql-statement>
+<sql-statement>
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
+</sql-statement>
+<sql-statement>
+-- timestamp with time zone, interval arithmetic around DST change
+-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
+SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
+</sql-statement>
+<sql-statement>
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
+</sql-statement>
+<sql-statement>
+RESET TIME ZONE;
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time '11:00') AS "Jan_01_1994_10am";
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time '10:00') AS "Jan_01_1994_9am";
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-8') AS "Jan_01_1994_11am";
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time with time zone '10:00-8') AS "Jan_01_1994_10am";
+</sql-statement>
+<sql-statement>
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+</sql-statement>
+<sql-statement>
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- time, interval arithmetic
+--
+SELECT CAST(time '01:02' AS interval) AS "+01:02";
+</sql-statement>
+<sql-statement>
+SELECT CAST(interval '02:03' AS time) AS "02:03:00";
+</sql-statement>
+<sql-statement>
+SELECT time '01:30' + interval '02:01' AS "03:31:00";
+</sql-statement>
+<sql-statement>
+SELECT time '01:30' - interval '02:01' AS "23:29:00";
+</sql-statement>
+<sql-statement>
+SELECT time '02:30' + interval '36:01' AS "14:31:00";
+</sql-statement>
+<sql-statement>
+SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
+</sql-statement>
+<sql-statement>
+SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+</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 CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+ ^
+ -stdin-:<main>:1:47: Error: At function: PgCast
+ SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+ ^
+ -stdin-:<main>:1:47: Error: Cannot cast type timetz into type interval
+ SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+ ^
+<sql-statement>
+SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+</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 CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgCast
+ SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+ ^
+ -stdin-:<main>:1:33: Error: Cannot cast type interval into type timetz
+ SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+ ^
+<sql-statement>
+SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
+</sql-statement>
+<sql-statement>
+SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
+</sql-statement>
+<sql-statement>
+-- These two tests cannot be used because they default to current timezone,
+-- which may be either -08 or -07 depending on the time of year.
+-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
+-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
+-- Try the following two tests instead, as a poor substitute
+SELECT CAST(CAST(date 'today' + time with time zone '05:30'
+ + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
+</sql-statement>
+<sql-statement>
+SELECT CAST(cast(date 'today' + time with time zone '03:30'
+ + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
+</sql-statement>
+<sql-statement>
+SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract"
+ FROM TIMESTAMP_TBL t, INTERVAL_TBL i
+ WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01'
+ AND i.f1 BETWEEN '00:00' AND '23:00'
+ ORDER BY 1,2;
+</sql-statement>
+<sql-statement>
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIME_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+</sql-statement>
+<sql-statement>
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIMETZ_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+</sql-statement>
+<sql-statement>
+-- SQL9x OVERLAPS operator
+-- test with time zone
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
+</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 (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,timestamptz,timestamptz,interval)
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ ^
+<sql-statement>
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+</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 (timestamp with time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,timestamptz)
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+ ^
+<sql-statement>
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
+</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 (timestamp with time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,interval)
+ OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
+ ^
+<sql-statement>
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+</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 (timestamp with time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,interval)
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ ^
+<sql-statement>
+-- test without time zone
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+</sql-statement>
+<sql-statement>
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
+</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 (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,timestamp,timestamp,interval)
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ ^
+<sql-statement>
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+</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 (timestamp without time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,timestamp)
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+ ^
+<sql-statement>
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
+</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 (timestamp without time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,interval)
+ OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
+ ^
+<sql-statement>
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+</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 (timestamp without time zone '2000-11-27', interval '12 hours')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,interval)
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ ^
+<sql-statement>
+-- test time and interval
+SELECT (time '00:00', time '01:00')
+ OVERLAPS (time '00:30', time '01:30') AS "True";
+</sql-statement>
+<sql-statement>
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '00:30', interval '1 hour') AS "True";
+</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 (time '00:00', interval '1 hour')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (time '00:30', interval '1 hour') AS "True";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
+ OVERLAPS (time '00:30', interval '1 hour') AS "True";
+ ^
+<sql-statement>
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 hour') AS "False";
+</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 (time '00:00', interval '1 hour')
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgCall
+ OVERLAPS (time '01:30', interval '1 hour') AS "False";
+ ^
+ -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
+ OVERLAPS (time '01:30', interval '1 hour') AS "False";
+ ^
+<sql-statement>
+-- SQL99 seems to want this to be false (and we conform to the spec).
+-- istm that this *should* return true, on the theory that time
+-- intervals can wrap around the day boundary - thomas 2001-09-25
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 day') AS "False";
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- SQL99 seems to want this to be false (and we conform to the spec).
+ ^
+ -stdin-:<main>:5:3: Error: At function: PgCall
+ OVERLAPS (time '01:30', interval '1 day') AS "False";
+ ^
+ -stdin-:<main>:5:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
+ OVERLAPS (time '01:30', interval '1 day') AS "False";
+ ^
+<sql-statement>
+CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
+</sql-statement>
+<sql-statement>
+-- get some candidate input values
+INSERT INTO TEMP_TIMESTAMP (f1)
+ SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
+ OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "timestamp"
+ FROM TEMP_TIMESTAMP
+ ORDER BY "timestamp";
+</sql-statement>
+<sql-statement>
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 + t.f1 AS plus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ ORDER BY plus, "timestamp", "interval";
+</sql-statement>
+<sql-statement>
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 - t.f1 AS minus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ WHERE isfinite(d.f1)
+ ORDER BY minus, "timestamp", "interval";
+</sql-statement>
+<sql-statement>
+SELECT d.f1 AS "timestamp",
+ timestamp with time zone '1980-01-06 00:00 GMT' AS gpstime_zero,
+ d.f1 - timestamp with time zone '1980-01-06 00:00 GMT' AS difference
+ FROM TEMP_TIMESTAMP d
+ ORDER BY difference;
+</sql-statement>
+<sql-statement>
+SELECT d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS difference
+ FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
+ ORDER BY timestamp1, timestamp2, difference;
+</sql-statement>
+<sql-statement>
+--
+-- Conversions
+--
+SELECT f1 AS "timestamp", date(f1) AS date
+ FROM TEMP_TIMESTAMP
+ WHERE f1 <> timestamp 'now'
+ ORDER BY date, "timestamp";
+</sql-statement>
+<sql-statement>
+DROP TABLE TEMP_TIMESTAMP;
+</sql-statement>
+<sql-statement>
+--
+-- Comparisons between datetime types, especially overflow cases
+---
+SELECT '2202020-10-05'::date::timestamp; -- fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date out of range for timestamp
+
+ --
+ ^
+<sql-statement>
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
+</sql-statement>
+<sql-statement>
+SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
+</sql-statement>
+<sql-statement>
+SELECT '2202020-10-05'::date::timestamptz; -- fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2202020-10-05'::date::timestamptz; -- fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date out of range for timestamp
+
+ SELECT '2202020-10-05'::date::timestamptz; -- fail
+ ^
+<sql-statement>
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
+</sql-statement>
+<sql-statement>
+SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
+</sql-statement>
+<sql-statement>
+-- This conversion may work depending on timezone
+SELECT '4714-11-24 BC'::date::timestamptz;
+</sql-statement>
+<sql-statement>
+SET TimeZone = 'UTC-2';
+</sql-statement>
+<sql-statement>
+SELECT '4714-11-24 BC'::date::timestamptz; -- fail
+</sql-statement>
+<sql-statement>
+SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
+</sql-statement>
+<sql-statement>
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
+</sql-statement>
+<sql-statement>
+SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
+</sql-statement>
+<sql-statement>
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
+</sql-statement>
+<sql-statement>
+RESET TimeZone;
+</sql-statement>
+<sql-statement>
+--
+-- Formats
+--
+SET DateStyle TO 'US,Postgres';
+</sql-statement>
+<sql-statement>
+SHOW DateStyle;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
+ SHOW DateStyle;
+ ^
+<sql-statement>
+SELECT d1 AS us_postgres FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SET DateStyle TO 'US,ISO';
+</sql-statement>
+<sql-statement>
+SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SET DateStyle TO 'US,SQL';
+</sql-statement>
+<sql-statement>
+SHOW DateStyle;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
+ SHOW DateStyle;
+ ^
+<sql-statement>
+SELECT d1 AS us_sql FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SET DateStyle TO 'European,Postgres';
+</sql-statement>
+<sql-statement>
+SHOW DateStyle;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
+ SHOW DateStyle;
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "13/06/1957"
+HINT: Perhaps you need a different "datestyle" setting.
+
+ INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
+ ^
+<sql-statement>
+SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
+</sql-statement>
+<sql-statement>
+SELECT d1 AS european_postgres FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SET DateStyle TO 'European,ISO';
+</sql-statement>
+<sql-statement>
+SHOW DateStyle;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
+ SHOW DateStyle;
+ ^
+<sql-statement>
+SELECT d1 AS european_iso FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SET DateStyle TO 'European,SQL';
+</sql-statement>
+<sql-statement>
+SHOW DateStyle;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
+ SHOW DateStyle;
+ ^
+<sql-statement>
+SELECT d1 AS european_sql FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+RESET DateStyle;
+</sql-statement>
+<sql-statement>
+--
+-- to_timestamp()
+--
+SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1985 January 12', 'YYYY FMMonth DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1985 FMMonth 12', 'YYYY "FMMonth" DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1985 \ 12', 'YYYY \\ DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
+ '"My birthday-> Year:" YYYY, "Month:" FMMonth, "Day:" DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('15 "text between quote marks" 98 54 45',
+ E'HH24 "\\"text between quote marks\\"" YY MI SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('05121445482000', 'MMDDHH24MISSYYYY');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000January09Sunday', 'YYYYFMMonthDDFMDay');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "/Feb/16" for "Mon"
+DETAIL: The given value did not match any of the allowed values for this field.
+
+ SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+ ^
+<sql-statement>
+SELECT to_timestamp('97/Feb/16', 'YY:Mon:DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('97/Feb/16', 'FXYY/Mon/DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('19971116', 'YYYYMMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('20000-1116', 'YYYY-MMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('9-1116', 'Y-MMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('95-1116', 'YY-MMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('995-1116', 'YYY-MMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2005426', 'YYYYWWD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2005300', 'YYYYDDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2005527', 'IYYYIWID');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('005527', 'IYYIWID');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('05527', 'IYIWID');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('5527', 'IIWID');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2005364', 'IYYYIDDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('20050302', 'YYYYMMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2005 03 02', 'YYYYMMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp(' 2005 03 02', 'YYYYMMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp(' 20050302', 'YYYYMMDD');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 AM', 'YYYY-MM-DD HH12:MI PM');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 PM', 'YYYY-MM-DD HH12:MI PM');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 A.M.', 'YYYY-MM-DD HH12:MI P.M.');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 P.M.', 'YYYY-MM-DD HH12:MI P.M.');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 +05', 'YYYY-MM-DD HH12:MI TZH');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: formatting field "TZ" is only supported in to_char
+
+ SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+ ^
+<sql-statement>
+SELECT to_timestamp('2018-11-02 12:34:56.025', 'YYYY-MM-DD HH24:MI:SS.MS');
+</sql-statement>
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:74: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:74: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:76: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:76: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:77: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:77: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:78: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:78: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:79: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:79: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:80: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:80: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:81: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:81: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+</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 i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:11: Error: At function: PgCall
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:84: Error: At function: PgOp
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+ -stdin-:<main>:1:84: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ ^
+<sql-statement>
+SELECT to_date('1 4 1902', 'Q MM YYYY'); -- Q is ignored
+</sql-statement>
+<sql-statement>
+SELECT to_date('3 4 21 01', 'W MM CC YY');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2458872', 'J');
+</sql-statement>
+<sql-statement>
+--
+-- Check handling of BC dates
+--
+SELECT to_date('44-02-01 BC','YYYY-MM-DD BC');
+</sql-statement>
+<sql-statement>
+SELECT to_date('-44-02-01','YYYY-MM-DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+</sql-statement>
+<sql-statement>
+--
+-- Check handling of multiple spaces in format and/or input
+--
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000+ JUN', 'YYYY/MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp(' 2000 +JUN', 'YYYY/MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp(' 2000 +JUN', 'YYYY//MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 +JUN', 'YYYY//MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 + JUN', 'YYYY MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 ++ JUN', 'YYYY MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "+" for "MON"
+DETAIL: The given value did not match any of the allowed values for this field.
+
+ SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+ ^
+<sql-statement>
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 12 18', 'YYYYxMMxDD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011x 12x 18', 'YYYYxMMxDD');
+</sql-statement>
+<sql-statement>
+SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "x1" for "MM"
+DETAIL: Value must be an integer.
+
+ SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+ ^
+<sql-statement>
+--
+-- Check errors for some incorrect usages of to_timestamp() and to_date()
+--
+-- Mixture of date conventions (ISO week and Gregorian):
+SELECT to_timestamp('2005527', 'YYYYIWID');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid combination of date conventions
+HINT: Do not mix Gregorian and ISO week date conventions in a formatting template.
+
+ --
+ ^
+<sql-statement>
+-- Insufficient characters in the source string:
+SELECT to_timestamp('19971', 'YYYYMMDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Insufficient characters in the source string:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: source string too short for "MM" formatting field
+DETAIL: Field requires 2 characters, but only 1 remain.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+
+ -- Insufficient characters in the source string:
+ ^
+<sql-statement>
+-- Insufficient digit characters for a single node:
+SELECT to_timestamp('19971)24', 'YYYYMMDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Insufficient digit characters for a single node:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "1)" for "MM"
+DETAIL: Field requires 2 characters, but only 1 could be parsed.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+
+ -- Insufficient digit characters for a single node:
+ ^
+<sql-statement>
+-- We don't accept full-length day or month names if short form is specified:
+SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- We don't accept full-length day or month names if short form is specified:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "da" for "DD"
+DETAIL: Value must be an integer.
+
+ -- We don't accept full-length day or month names if short form is specified:
+ ^
+<sql-statement>
+SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "uary" for "YYYY"
+DETAIL: Value must be an integer.
+
+ SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+ ^
+<sql-statement>
+SELECT to_timestamp('Fri 1-Jan-1999', 'DY DD MON YYYY'); -- ok
+</sql-statement>
+<sql-statement>
+-- Value clobbering:
+SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Value clobbering:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: conflicting values for "Mon" field in formatting string
+DETAIL: This value contradicts a previous setting for the same field type.
+
+ -- Value clobbering:
+ ^
+<sql-statement>
+-- Non-numeric input:
+SELECT to_timestamp('199711xy', 'YYYYMMDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Non-numeric input:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid value "xy" for "DD"
+DETAIL: Value must be an integer.
+
+ -- Non-numeric input:
+ ^
+<sql-statement>
+-- Input that doesn't fit in an int:
+SELECT to_timestamp('10000000000', 'FMYYYY');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Input that doesn't fit in an int:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value for "YYYY" in source string is out of range
+DETAIL: Value must be in the range -2147483648 to 2147483647.
+
+ -- Input that doesn't fit in an int:
+ ^
+<sql-statement>
+-- Out-of-range and not-quite-out-of-range fields:
+SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Out-of-range and not-quite-out-of-range fields:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-06-13 25:00:00"
+
+ -- Out-of-range and not-quite-out-of-range fields:
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-06-13 15:60:00"
+
+ SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-06-13 15:50:60"
+
+ SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: hour "15" is invalid for the 12-hour clock
+HINT: Use the 24-hour clock, or give an hour between 1 and 12.
+
+ SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-13-01 15:50:55"
+
+ SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-02-30 15:50:55"
+
+ SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2016-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2015-02-29 15:50:55"
+
+ SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSS'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2015-02-11 86400"
+
+ SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+ ^
+<sql-statement>
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSSS'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2015-02-11 86400"
+
+ SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+ ^
+<sql-statement>
+SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-13-10"
+
+ SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+ ^
+<sql-statement>
+SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016-02-30"
+
+ SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+ ^
+<sql-statement>
+SELECT to_date('2016-02-29', 'YYYY-MM-DD'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2015-02-29"
+
+ SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+ ^
+<sql-statement>
+SELECT to_date('2015 365', 'YYYY DDD'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_date('2015 366', 'YYYY DDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2015 366', 'YYYY DDD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2015 366"
+
+ SELECT to_date('2015 366', 'YYYY DDD');
+ ^
+<sql-statement>
+SELECT to_date('2016 365', 'YYYY DDD'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_date('2016 366', 'YYYY DDD'); -- ok
+</sql-statement>
+<sql-statement>
+SELECT to_date('2016 367', 'YYYY DDD');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_date('2016 367', 'YYYY DDD');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "2016 367"
+
+ SELECT to_date('2016 367', 'YYYY DDD');
+ ^
+<sql-statement>
+SELECT to_date('0000-02-01','YYYY-MM-DD'); -- allowed, though it shouldn't be
+</sql-statement>
+<sql-statement>
+--
+-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
+--
+SET TIME ZONE 'America/New_York';
+</sql-statement>
+<sql-statement>
+SET TIME ZONE '-1.5';
+</sql-statement>
+<sql-statement>
+SHOW TIME ZONE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "timezone"
+ SHOW TIME ZONE;
+ ^
+<sql-statement>
+SELECT '2012-12-12 12:00'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
+ ^
+<sql-statement>
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
+</sql-statement>
+<sql-statement>
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
+</sql-statement>
+<sql-statement>
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
+</sql-statement>
+<sql-statement>
+RESET TIME ZONE;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/horology.out b/yql/essentials/tests/postgresql/cases/horology.out
new file mode 100644
index 0000000000..8fd3192ac9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/horology.out
@@ -0,0 +1,506 @@
+--
+-- HOROLOGY
+--
+SET DateStyle = 'Postgres, MDY';
+-- should fail in mdy mode:
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
+LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'...
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+set datestyle to dmy;
+reset datestyle;
+SET DateStyle = 'German';
+SET DateStyle = 'ISO';
+-- As of 7.4, allow time without time zone having a time zone specified
+SELECT time without time zone '040506.789+08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone '040506.789-08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone 'T040506.789+08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone 'T040506.789-08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time with time zone '040506.789+08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone '040506.789-08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SELECT time with time zone 'T040506.789+08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone 'T040506.789-08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SELECT time with time zone 'T040506.789 +08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone 'T040506.789 -08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SET DateStyle = 'Postgres, MDY';
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - thomas 97/04/26
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
+ True
+------
+ t
+(1 row)
+
+-- timestamp with time zone, interval arithmetic around DST change
+-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
+SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
+RESET TIME ZONE;
+SELECT CAST(interval '02:03' AS time) AS "02:03:00";
+ 02:03:00
+----------
+ 02:03:00
+(1 row)
+
+SELECT time '01:30' + interval '02:01' AS "03:31:00";
+ 03:31:00
+----------
+ 03:31:00
+(1 row)
+
+SELECT time '01:30' - interval '02:01' AS "23:29:00";
+ 23:29:00
+----------
+ 23:29:00
+(1 row)
+
+SELECT time '02:30' + interval '36:01' AS "14:31:00";
+ 14:31:00
+----------
+ 14:31:00
+(1 row)
+
+SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
+ 23:29:00-08
+-------------
+ 23:29:00-08
+(1 row)
+
+SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
+ 14:31:00-08
+-------------
+ 14:31:00-08
+(1 row)
+
+-- These two tests cannot be used because they default to current timezone,
+-- which may be either -08 or -07 depending on the time of year.
+-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
+-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
+-- Try the following two tests instead, as a poor substitute
+SELECT CAST(CAST(date 'today' + time with time zone '05:30'
+ + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+SELECT CAST(cast(date 'today' + time with time zone '03:30'
+ + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+-- SQL9x OVERLAPS operator
+-- test with time zone
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+-- test without time zone
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+-- test time and interval
+SELECT (time '00:00', time '01:00')
+ OVERLAPS (time '00:30', time '01:30') AS "True";
+ True
+------
+ t
+(1 row)
+
+CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
+-- get some candidate input values
+INSERT INTO TEMP_TIMESTAMP (f1)
+ SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
+ OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
+DROP TABLE TEMP_TIMESTAMP;
+--
+-- Comparisons between datetime types, especially overflow cases
+---
+SELECT '2202020-10-05'::date::timestamp; -- fail
+ERROR: date out of range for timestamp
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
+ f
+---
+ f
+(1 row)
+
+SELECT '2202020-10-05'::date::timestamptz; -- fail
+ERROR: date out of range for timestamp
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
+ f
+---
+ f
+(1 row)
+
+SET TimeZone = 'UTC-2';
+SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
+ t
+---
+ t
+(1 row)
+
+RESET TimeZone;
+--
+-- Formats
+--
+SET DateStyle TO 'US,Postgres';
+SET DateStyle TO 'US,ISO';
+SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
+ us_iso
+------------------------
+ -infinity
+ infinity
+ 1970-01-01 00:00:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:02
+ 1997-02-10 17:32:01.4
+ 1997-02-10 17:32:01.5
+ 1997-02-10 17:32:01.6
+ 1997-01-02 00:00:00
+ 1997-01-02 03:04:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 17:32:01
+ 2001-09-22 18:19:20
+ 2000-03-15 08:14:01
+ 2000-03-15 13:14:02
+ 2000-03-15 12:14:03
+ 2000-03-15 03:14:04
+ 2000-03-15 02:14:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 18:32:01
+ 1997-02-10 17:32:01
+ 1997-02-11 17:32:01
+ 1997-02-12 17:32:01
+ 1997-02-13 17:32:01
+ 1997-02-14 17:32:01
+ 1997-02-15 17:32:01
+ 1997-02-16 17:32:01
+ 0097-02-16 17:32:01 BC
+ 0097-02-16 17:32:01
+ 0597-02-16 17:32:01
+ 1097-02-16 17:32:01
+ 1697-02-16 17:32:01
+ 1797-02-16 17:32:01
+ 1897-02-16 17:32:01
+ 1997-02-16 17:32:01
+ 2097-02-16 17:32:01
+ 1996-02-28 17:32:01
+ 1996-02-29 17:32:01
+ 1996-03-01 17:32:01
+ 1996-12-30 17:32:01
+ 1996-12-31 17:32:01
+ 1997-01-01 17:32:01
+ 1997-02-28 17:32:01
+ 1997-03-01 17:32:01
+ 1997-12-30 17:32:01
+ 1997-12-31 17:32:01
+ 1999-12-31 17:32:01
+ 2000-01-01 17:32:01
+ 2000-12-31 17:32:01
+ 2001-01-01 17:32:01
+(65 rows)
+
+SET DateStyle TO 'US,SQL';
+SET DateStyle TO 'European,Postgres';
+SET DateStyle TO 'European,ISO';
+SET DateStyle TO 'European,SQL';
+RESET DateStyle;
+SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+ERROR: invalid value "/Feb/16" for "Mon"
+DETAIL: The given value did not match any of the allowed values for this field.
+SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+ERROR: formatting field "TZ" is only supported in to_char
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+ERROR: invalid value "+" for "MON"
+DETAIL: The given value did not match any of the allowed values for this field.
+SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+ERROR: invalid value "x1" for "MM"
+DETAIL: Value must be an integer.
+--
+-- Check errors for some incorrect usages of to_timestamp() and to_date()
+--
+-- Mixture of date conventions (ISO week and Gregorian):
+SELECT to_timestamp('2005527', 'YYYYIWID');
+ERROR: invalid combination of date conventions
+HINT: Do not mix Gregorian and ISO week date conventions in a formatting template.
+-- Insufficient characters in the source string:
+SELECT to_timestamp('19971', 'YYYYMMDD');
+ERROR: source string too short for "MM" formatting field
+DETAIL: Field requires 2 characters, but only 1 remain.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+-- Insufficient digit characters for a single node:
+SELECT to_timestamp('19971)24', 'YYYYMMDD');
+ERROR: invalid value "1)" for "MM"
+DETAIL: Field requires 2 characters, but only 1 could be parsed.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+-- We don't accept full-length day or month names if short form is specified:
+SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
+ERROR: invalid value "da" for "DD"
+DETAIL: Value must be an integer.
+SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+ERROR: invalid value "uary" for "YYYY"
+DETAIL: Value must be an integer.
+-- Value clobbering:
+SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
+ERROR: conflicting values for "Mon" field in formatting string
+DETAIL: This value contradicts a previous setting for the same field type.
+-- Non-numeric input:
+SELECT to_timestamp('199711xy', 'YYYYMMDD');
+ERROR: invalid value "xy" for "DD"
+DETAIL: Value must be an integer.
+-- Input that doesn't fit in an int:
+SELECT to_timestamp('10000000000', 'FMYYYY');
+ERROR: value for "YYYY" in source string is out of range
+DETAIL: Value must be in the range -2147483648 to 2147483647.
+-- Out-of-range and not-quite-out-of-range fields:
+SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 25:00:00"
+SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 15:60:00"
+SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 15:50:60"
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+ERROR: hour "15" is invalid for the 12-hour clock
+HINT: Use the 24-hour clock, or give an hour between 1 and 12.
+SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-13-01 15:50:55"
+SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-02-30 15:50:55"
+SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2015-02-29 15:50:55"
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+ERROR: date/time field value out of range: "2015-02-11 86400"
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+ERROR: date/time field value out of range: "2015-02-11 86400"
+SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2016-13-10"
+SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2016-02-30"
+SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2015-02-29"
+SELECT to_date('2015 366', 'YYYY DDD');
+ERROR: date/time field value out of range: "2015 366"
+SELECT to_date('2016 367', 'YYYY DDD');
+ERROR: date/time field value out of range: "2016 367"
+--
+-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
+--
+SET TIME ZONE 'America/New_York';
+SET TIME ZONE '-1.5';
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
+ to_char
+------------------
+ 2012-12-12 43200
+(1 row)
+
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
+ to_char
+------------------
+ 2012-12-12 43200
+(1 row)
+
+RESET TIME ZONE;
diff --git a/yql/essentials/tests/postgresql/cases/horology.sql b/yql/essentials/tests/postgresql/cases/horology.sql
new file mode 100644
index 0000000000..c9916b4f04
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/horology.sql
@@ -0,0 +1,151 @@
+--
+-- HOROLOGY
+--
+SET DateStyle = 'Postgres, MDY';
+-- should fail in mdy mode:
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+set datestyle to dmy;
+reset datestyle;
+SET DateStyle = 'German';
+SET DateStyle = 'ISO';
+-- As of 7.4, allow time without time zone having a time zone specified
+SELECT time without time zone '040506.789+08';
+SELECT time without time zone '040506.789-08';
+SELECT time without time zone 'T040506.789+08';
+SELECT time without time zone 'T040506.789-08';
+SELECT time with time zone '040506.789+08';
+SELECT time with time zone '040506.789-08';
+SELECT time with time zone 'T040506.789+08';
+SELECT time with time zone 'T040506.789-08';
+SELECT time with time zone 'T040506.789 +08';
+SELECT time with time zone 'T040506.789 -08';
+SET DateStyle = 'Postgres, MDY';
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - thomas 97/04/26
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
+SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
+SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
+SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
+SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
+-- timestamp with time zone, interval arithmetic around DST change
+-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
+SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
+RESET TIME ZONE;
+SELECT CAST(interval '02:03' AS time) AS "02:03:00";
+SELECT time '01:30' + interval '02:01' AS "03:31:00";
+SELECT time '01:30' - interval '02:01' AS "23:29:00";
+SELECT time '02:30' + interval '36:01' AS "14:31:00";
+SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
+SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
+SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
+-- These two tests cannot be used because they default to current timezone,
+-- which may be either -08 or -07 depending on the time of year.
+-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
+-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
+-- Try the following two tests instead, as a poor substitute
+SELECT CAST(CAST(date 'today' + time with time zone '05:30'
+ + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
+SELECT CAST(cast(date 'today' + time with time zone '03:30'
+ + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
+-- SQL9x OVERLAPS operator
+-- test with time zone
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
+SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+-- test without time zone
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
+SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+-- test time and interval
+SELECT (time '00:00', time '01:00')
+ OVERLAPS (time '00:30', time '01:30') AS "True";
+CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
+-- get some candidate input values
+INSERT INTO TEMP_TIMESTAMP (f1)
+ SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
+ OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
+DROP TABLE TEMP_TIMESTAMP;
+--
+-- Comparisons between datetime types, especially overflow cases
+---
+SELECT '2202020-10-05'::date::timestamp; -- fail
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
+SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
+SELECT '2202020-10-05'::date::timestamptz; -- fail
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
+SET TimeZone = 'UTC-2';
+SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
+SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
+RESET TimeZone;
+--
+-- Formats
+--
+SET DateStyle TO 'US,Postgres';
+SET DateStyle TO 'US,ISO';
+SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
+SET DateStyle TO 'US,SQL';
+SET DateStyle TO 'European,Postgres';
+SET DateStyle TO 'European,ISO';
+SET DateStyle TO 'European,SQL';
+RESET DateStyle;
+SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+--
+-- Check errors for some incorrect usages of to_timestamp() and to_date()
+--
+-- Mixture of date conventions (ISO week and Gregorian):
+SELECT to_timestamp('2005527', 'YYYYIWID');
+-- Insufficient characters in the source string:
+SELECT to_timestamp('19971', 'YYYYMMDD');
+-- Insufficient digit characters for a single node:
+SELECT to_timestamp('19971)24', 'YYYYMMDD');
+-- We don't accept full-length day or month names if short form is specified:
+SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
+SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+-- Value clobbering:
+SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
+-- Non-numeric input:
+SELECT to_timestamp('199711xy', 'YYYYMMDD');
+-- Input that doesn't fit in an int:
+SELECT to_timestamp('10000000000', 'FMYYYY');
+-- Out-of-range and not-quite-out-of-range fields:
+SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+SELECT to_date('2015 366', 'YYYY DDD');
+SELECT to_date('2016 367', 'YYYY DDD');
+--
+-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
+--
+SET TIME ZONE 'America/New_York';
+SET TIME ZONE '-1.5';
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
+RESET TIME ZONE;
diff --git a/yql/essentials/tests/postgresql/cases/insert.err b/yql/essentials/tests/postgresql/cases/insert.err
new file mode 100644
index 0000000000..1427a14aef
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/insert.err
@@ -0,0 +1,2670 @@
+<sql-statement>
+--
+-- insert with DEFAULT in the target_list
+--
+create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
+</sql-statement>
+<sql-statement>
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
+ ^
+<sql-statement>
+insert into inserttest (col2, col3) values (3, DEFAULT);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (col2, col3) values (3, DEFAULT);
+ ^
+<sql-statement>
+insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
+ ^
+<sql-statement>
+insert into inserttest values (DEFAULT, 5, 'test');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest values (DEFAULT, 5, 'test');
+ ^
+<sql-statement>
+insert into inserttest values (DEFAULT, 7);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest values (DEFAULT, 7);
+ ^
+<sql-statement>
+select * from inserttest;
+</sql-statement>
+<sql-statement>
+--
+-- insert with similar expression / target_list values (all fail)
+--
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ --
+ ^
+<sql-statement>
+insert into inserttest (col1, col2, col3) values (1, 2);
+</sql-statement>
+<sql-statement>
+insert into inserttest (col1) values (1, 2);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: YtWriteTable!
+ insert into inserttest (col1) values (1, 2);
+ ^
+ -stdin-:<main>:1:1: Error: values have 2 columns, INSERT INTO expects: 1
+ insert into inserttest (col1) values (1, 2);
+ ^
+<sql-statement>
+insert into inserttest (col1) values (DEFAULT, DEFAULT);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (col1) values (DEFAULT, DEFAULT);
+ ^
+<sql-statement>
+select * from inserttest;
+</sql-statement>
+<sql-statement>
+--
+-- VALUES test
+--
+insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
+ ((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ --
+ ^
+<sql-statement>
+select * from inserttest;
+</sql-statement>
+<sql-statement>
+--
+-- TOASTed value test
+--
+insert into inserttest values(30, 50, repeat('x', 10000));
+</sql-statement>
+<sql-statement>
+select col1, col2, char_length(col3) from inserttest;
+</sql-statement>
+<sql-statement>
+drop table inserttest;
+</sql-statement>
+<sql-statement>
+--
+-- tuple larger than fillfactor
+--
+CREATE TABLE large_tuple_test (a int, b text) WITH (fillfactor = 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table options not supported
+ --
+ ^
+<sql-statement>
+ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
+ ^
+<sql-statement>
+-- create page w/ free space in range [nearlyEmptyFreeSpace, MaxHeapTupleSize)
+INSERT INTO large_tuple_test (select 1, NULL);
+</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.large_tuple_test
+
+<sql-statement>
+-- should still fit on the page
+INSERT INTO large_tuple_test (select 2, repeat('a', 1000));
+</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.large_tuple_test
+
+<sql-statement>
+SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "large_tuple_test" does not exist
+
+ SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
+ ^
+<sql-statement>
+-- add small record to the second page
+INSERT INTO large_tuple_test (select 3, NULL);
+</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.large_tuple_test
+
+<sql-statement>
+-- now this tuple won't fit on the second page, but the insert should
+-- still succeed by extending the relation
+INSERT INTO large_tuple_test (select 4, repeat('a', 8126));
+</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.large_tuple_test
+
+<sql-statement>
+DROP TABLE large_tuple_test;
+</sql-statement>
+<sql-statement>
+--
+-- check indirection (field/array assignment), cf bug #14265
+--
+-- these tests are aware that transformInsertStmt has 3 separate code paths
+--
+create type insert_test_type as (if1 int, if2 text[]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ --
+ ^
+<sql-statement>
+create table inserttest (f1 int, f2 int[],
+ f3 insert_test_type, f4 insert_test_type[]);
+</sql-statement>
+<sql-statement>
+insert into inserttest (f2[1], f2[2]) values (1,2);
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f2[1], f2[2]) values (3,4), (5,6);
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f2[1], f2[2]) select 7,8;
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
+ ^
+<sql-statement>
+insert into inserttest (f3.if1, f3.if2) values (1,array['foo']);
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f3.if1, f3.if2) values (1,'{foo}'), (2,'{bar}');
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f3.if1, f3.if2) select 3, '{baz,quux}';
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
+ ^
+<sql-statement>
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar');
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f3.if2[1], f3.if2[2]) select 'bear', 'beer';
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar');
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+</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.inserttest
+
+<sql-statement>
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) select 'bear', 'beer';
+</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.inserttest
+
+<sql-statement>
+select * from inserttest;
+</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.inserttest
+
+<sql-statement>
+-- also check reverse-listing
+create table inserttest2 (f1 bigint, f2 text);
+</sql-statement>
+<sql-statement>
+create rule irule1 as on insert to inserttest2 do also
+ insert into inserttest (f3.if2[1], f3.if2[2])
+ values (new.f1,new.f2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 265
+ create rule irule1 as on insert to inserttest2 do also
+ ^
+<sql-statement>
+create rule irule2 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ values (1,'fool'),(new.f1,new.f2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 265
+ create rule irule2 as on insert to inserttest2 do also
+ ^
+<sql-statement>
+create rule irule3 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ select new.f1, new.f2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 265
+ create rule irule3 as on insert to inserttest2 do also
+ ^
+<sql-statement>
+\d+ inserttest2
+</sql-statement>
+Metacommand \d+ inserttest2 is not supported
+<sql-statement>
+drop table inserttest2;
+</sql-statement>
+<sql-statement>
+drop table inserttest;
+</sql-statement>
+<sql-statement>
+drop type insert_test_type;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop type insert_test_type;
+ ^
+<sql-statement>
+-- direct partition inserts should check partition bound constraint
+create table range_parted (
+ a text,
+ b int
+) partition by range (a, (b+0));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- direct partition inserts should check partition bound constraint
+ ^
+<sql-statement>
+-- no partitions, so fail
+insert into range_parted values ('a', 11);
+</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.range_parted
+
+<sql-statement>
+create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
+ ^
+<sql-statement>
+create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
+ ^
+<sql-statement>
+create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
+ ^
+<sql-statement>
+create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
+ ^
+<sql-statement>
+-- fail
+insert into part1 values ('a', 11);
+</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.part1
+
+<sql-statement>
+insert into part1 values ('b', 1);
+</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.part1
+
+<sql-statement>
+-- ok
+insert into part1 values ('a', 1);
+</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.part1
+
+<sql-statement>
+-- fail
+insert into part4 values ('b', 21);
+</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.part4
+
+<sql-statement>
+insert into part4 values ('a', 10);
+</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.part4
+
+<sql-statement>
+-- ok
+insert into part4 values ('b', 10);
+</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.part4
+
+<sql-statement>
+-- fail (partition key a has a NOT NULL constraint)
+insert into part1 values (null);
+</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.part1
+
+<sql-statement>
+-- fail (expression key (b+0) cannot be null either)
+insert into part1 values (1);
+</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.part1
+
+<sql-statement>
+create table list_parted (
+ a text,
+ b int
+) partition by list (lower(a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table list_parted (
+ ^
+<sql-statement>
+create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
+ ^
+<sql-statement>
+create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
+ ^
+<sql-statement>
+create table part_null partition of list_parted FOR VALUES IN (null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_null partition of list_parted FOR VALUES IN (null);
+ ^
+<sql-statement>
+-- fail
+insert into part_aa_bb values ('cc', 1);
+</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.part_aa_bb
+
+<sql-statement>
+insert into part_aa_bb values ('AAa', 1);
+</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.part_aa_bb
+
+<sql-statement>
+insert into part_aa_bb values (null);
+</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.part_aa_bb
+
+<sql-statement>
+-- ok
+insert into part_cc_dd values ('cC', 1);
+</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.part_cc_dd
+
+<sql-statement>
+insert into part_null values (null, 0);
+</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.part_null
+
+<sql-statement>
+-- check in case of multi-level partitioned table
+create table part_ee_ff partition of list_parted for values in ('ee', 'ff') partition by range (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- check in case of multi-level partitioned table
+ ^
+<sql-statement>
+create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
+ ^
+<sql-statement>
+create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
+ ^
+<sql-statement>
+-- test default partition
+create table part_default partition of list_parted default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- test default partition
+ ^
+<sql-statement>
+-- Negative test: a row, which would fit in other partition, does not fit
+-- default partition, even when inserted directly
+insert into part_default values ('aa', 2);
+</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.part_default
+
+<sql-statement>
+insert into part_default values (null, 2);
+</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.part_default
+
+<sql-statement>
+-- ok
+insert into part_default values ('Zz', 2);
+</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.part_default
+
+<sql-statement>
+-- test if default partition works as expected for multi-level partitioned
+-- table as well as when default partition itself is further partitioned
+drop table part_default;
+</sql-statement>
+<sql-statement>
+create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
+ ^
+<sql-statement>
+create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
+ ^
+<sql-statement>
+create table part_xx_yy_defpart partition of part_xx_yy default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_xx_yy_defpart partition of part_xx_yy default;
+ ^
+<sql-statement>
+create table part_default partition of list_parted default partition by range(b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_default partition of list_parted default partition by range(b);
+ ^
+<sql-statement>
+create table part_default_p1 partition of part_default for values from (20) to (30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_default_p1 partition of part_default for values from (20) to (30);
+ ^
+<sql-statement>
+create table part_default_p2 partition of part_default for values from (30) to (40);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_default_p2 partition of part_default for values from (30) to (40);
+ ^
+<sql-statement>
+-- fail
+insert into part_ee_ff1 values ('EE', 11);
+</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.part_ee_ff1
+
+<sql-statement>
+insert into part_default_p2 values ('gg', 43);
+</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.part_default_p2
+
+<sql-statement>
+-- fail (even the parent's, ie, part_ee_ff's partition constraint applies)
+insert into part_ee_ff1 values ('cc', 1);
+</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.part_ee_ff1
+
+<sql-statement>
+insert into part_default values ('gg', 43);
+</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.part_default
+
+<sql-statement>
+-- ok
+insert into part_ee_ff1 values ('ff', 1);
+</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.part_ee_ff1
+
+<sql-statement>
+insert into part_ee_ff2 values ('ff', 11);
+</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.part_ee_ff2
+
+<sql-statement>
+insert into part_default_p1 values ('cd', 25);
+</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.part_default_p1
+
+<sql-statement>
+insert into part_default_p2 values ('de', 35);
+</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.part_default_p2
+
+<sql-statement>
+insert into list_parted values ('ab', 21);
+</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.list_parted
+
+<sql-statement>
+insert into list_parted values ('xx', 1);
+</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.list_parted
+
+<sql-statement>
+insert into list_parted values ('yy', 2);
+</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.list_parted
+
+<sql-statement>
+select tableoid::regclass, * from list_parted;
+</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.list_parted
+
+<sql-statement>
+-- Check tuple routing for partitioned tables
+-- fail
+insert into range_parted values ('a', 0);
+</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.range_parted
+
+<sql-statement>
+-- ok
+insert into range_parted values ('a', 1);
+</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.range_parted
+
+<sql-statement>
+insert into range_parted values ('a', 10);
+</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.range_parted
+
+<sql-statement>
+-- fail
+insert into range_parted values ('a', 20);
+</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.range_parted
+
+<sql-statement>
+-- ok
+insert into range_parted values ('b', 1);
+</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.range_parted
+
+<sql-statement>
+insert into range_parted values ('b', 10);
+</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.range_parted
+
+<sql-statement>
+-- fail (partition key (b+0) is null)
+insert into range_parted values ('a');
+</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.range_parted
+
+<sql-statement>
+-- Check default partition
+create table part_def partition of range_parted default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- Check default partition
+ ^
+<sql-statement>
+-- fail
+insert into part_def values ('b', 10);
+</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.part_def
+
+<sql-statement>
+-- ok
+insert into part_def values ('c', 10);
+</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.part_def
+
+<sql-statement>
+insert into range_parted values (null, null);
+</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.range_parted
+
+<sql-statement>
+insert into range_parted values ('a', null);
+</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.range_parted
+
+<sql-statement>
+insert into range_parted values (null, 19);
+</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.range_parted
+
+<sql-statement>
+insert into range_parted values ('b', 20);
+</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.range_parted
+
+<sql-statement>
+select tableoid::regclass, * from range_parted;
+</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.range_parted
+
+<sql-statement>
+-- ok
+insert into list_parted values (null, 1);
+</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.list_parted
+
+<sql-statement>
+insert into list_parted (a) values ('aA');
+</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.list_parted
+
+<sql-statement>
+-- fail (partition of part_ee_ff not found in both cases)
+insert into list_parted values ('EE', 0);
+</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.list_parted
+
+<sql-statement>
+insert into part_ee_ff values ('EE', 0);
+</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.part_ee_ff
+
+<sql-statement>
+-- ok
+insert into list_parted values ('EE', 1);
+</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.list_parted
+
+<sql-statement>
+insert into part_ee_ff values ('EE', 10);
+</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.part_ee_ff
+
+<sql-statement>
+select tableoid::regclass, * from list_parted;
+</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.list_parted
+
+<sql-statement>
+-- some more tests to exercise tuple-routing with multi-level partitioning
+create table part_gg partition of list_parted for values in ('gg') partition by range (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- some more tests to exercise tuple-routing with multi-level partitioning
+ ^
+<sql-statement>
+create table part_gg1 partition of part_gg for values from (minvalue) to (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_gg1 partition of part_gg for values from (minvalue) to (1);
+ ^
+<sql-statement>
+create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
+ ^
+<sql-statement>
+create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
+ ^
+<sql-statement>
+create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
+ ^
+<sql-statement>
+create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
+ ^
+<sql-statement>
+create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
+ ^
+<sql-statement>
+create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
+ ^
+<sql-statement>
+truncate list_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ truncate list_parted;
+ ^
+<sql-statement>
+insert into list_parted values ('aa'), ('cc');
+</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.list_parted
+
+<sql-statement>
+insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
+</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.list_parted
+
+<sql-statement>
+insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
+</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.list_parted
+
+<sql-statement>
+insert into list_parted (b) values (1);
+</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.list_parted
+
+<sql-statement>
+select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
+</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.list_parted
+
+<sql-statement>
+-- direct partition inserts should check hash partition bound constraint
+-- Use hand-rolled hash functions and operator classes to get predictable
+-- result on different machines. The hash function for int4 simply returns
+-- the sum of the values passed to it and the one for text returns the length
+-- of the non-empty string value passed to it or 0.
+create or replace function part_hashint4_noop(value int4, seed int8)
+returns int8 as $$
+select value + seed;
+$$ language sql immutable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- direct partition inserts should check hash partition bound constraint
+ ^
+<sql-statement>
+create operator class part_test_int4_ops
+for type int4
+using hash as
+operator 1 =,
+function 2 part_hashint4_noop(int4, int8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
+ create operator class part_test_int4_ops
+ ^
+<sql-statement>
+create or replace function part_hashtext_length(value text, seed int8)
+RETURNS int8 AS $$
+select length(coalesce(value, ''))::int8
+$$ 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 part_hashtext_length(value text, seed int8)
+ ^
+<sql-statement>
+create operator class part_test_text_ops
+for type text
+using hash as
+operator 1 =,
+function 2 part_hashtext_length(text, int8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
+ create operator class part_test_text_ops
+ ^
+<sql-statement>
+create table hash_parted (
+ a int
+) partition by hash (a part_test_int4_ops);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table hash_parted (
+ ^
+<sql-statement>
+create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
+ ^
+<sql-statement>
+create table hpart1 partition of hash_parted for values with (modulus 4, remainder 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart1 partition of hash_parted for values with (modulus 4, remainder 1);
+ ^
+<sql-statement>
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+ ^
+<sql-statement>
+create table hpart3 partition of hash_parted for values with (modulus 4, remainder 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart3 partition of hash_parted for values with (modulus 4, remainder 3);
+ ^
+<sql-statement>
+insert into hash_parted values(generate_series(1,10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:32: Error: Generator functions are not allowed in: VALUES
+ insert into hash_parted values(generate_series(1,10));
+ ^
+<sql-statement>
+-- direct insert of values divisible by 4 - ok;
+insert into hpart0 values(12),(16);
+</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.hpart0
+
+<sql-statement>
+-- fail;
+insert into hpart0 values(11);
+</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.hpart0
+
+<sql-statement>
+-- 11 % 4 -> 3 remainder i.e. valid data for hpart3 partition
+insert into hpart3 values(11);
+</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.hpart3
+
+<sql-statement>
+-- view data
+select tableoid::regclass as part, a, a%4 as "remainder = a % 4"
+from hash_parted order by part;
+</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.hash_parted
+
+<sql-statement>
+-- test \d+ output on a table which has both partitioned and unpartitioned
+-- partitions
+\d+ list_parted
+</sql-statement>
+Metacommand \d+ list_parted is not supported
+<sql-statement>
+-- cleanup
+drop table range_parted, list_parted;
+</sql-statement>
+<sql-statement>
+drop table hash_parted;
+</sql-statement>
+<sql-statement>
+-- test that a default partition added as the first partition accepts any value
+-- including null
+create table list_parted (a int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- test that a default partition added as the first partition accepts any value
+ ^
+<sql-statement>
+create table part_default partition of list_parted default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_default partition of list_parted default;
+ ^
+<sql-statement>
+\d+ part_default
+</sql-statement>
+Metacommand \d+ part_default is not supported
+<sql-statement>
+insert into part_default values (null);
+</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.part_default
+
+<sql-statement>
+insert into part_default values (1);
+</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.part_default
+
+<sql-statement>
+insert into part_default values (-1);
+</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.part_default
+
+<sql-statement>
+select tableoid::regclass, a from list_parted;
+</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.list_parted
+
+<sql-statement>
+-- cleanup
+drop table list_parted;
+</sql-statement>
+<sql-statement>
+-- more tests for certain multi-level partitioning scenarios
+create table mlparted (a int, b int) partition by range (a, b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- more tests for certain multi-level partitioning scenarios
+ ^
+<sql-statement>
+create table mlparted1 (b int not null, a int not null) partition by range ((b+0));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table mlparted1 (b int not null, a int not null) partition by range ((b+0));
+ ^
+<sql-statement>
+create table mlparted11 (like mlparted1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CreateStmt: alternative is not implemented yet : 389
+ create table mlparted11 (like mlparted1);
+ ^
+<sql-statement>
+alter table mlparted11 drop a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted11 drop a;
+ ^
+<sql-statement>
+alter table mlparted11 add a int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted11 add a int;
+ ^
+<sql-statement>
+alter table mlparted11 drop a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted11 drop a;
+ ^
+<sql-statement>
+alter table mlparted11 add a int not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted11 add a int not null;
+ ^
+<sql-statement>
+-- attnum for key attribute 'a' is different in mlparted, mlparted1, and mlparted11
+select attrelid::regclass, attname, attnum
+from pg_attribute
+where attname = 'a'
+ and (attrelid = 'mlparted'::regclass
+ or attrelid = 'mlparted1'::regclass
+ or attrelid = 'mlparted11'::regclass)
+order by attrelid::regclass::text;
+</sql-statement>
+<sql-statement>
+alter table mlparted1 attach partition mlparted11 for values from (2) to (5);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted1 attach partition mlparted11 for values from (2) to (5);
+ ^
+<sql-statement>
+alter table mlparted attach partition mlparted1 for values from (1, 2) to (1, 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted attach partition mlparted1 for values from (1, 2) to (1, 10);
+ ^
+<sql-statement>
+-- check that "(1, 2)" is correctly routed to mlparted11.
+insert into mlparted values (1, 2);
+</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.mlparted
+
+<sql-statement>
+select tableoid::regclass, * from mlparted;
+</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.mlparted
+
+<sql-statement>
+-- check that proper message is shown after failure to route through mlparted1
+insert into mlparted (a, b) values (1, 5);
+</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.mlparted
+
+<sql-statement>
+truncate mlparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ truncate mlparted;
+ ^
+<sql-statement>
+alter table mlparted add constraint check_b check (b = 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted add constraint check_b check (b = 3);
+ ^
+<sql-statement>
+-- have a BR trigger modify the row such that the check_b is violated
+create function mlparted11_trig_fn()
+returns trigger AS
+$$
+begin
+ NEW.b := 4;
+ return NEW;
+end;
+$$
+language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- have a BR trigger modify the row such that the check_b is violated
+ ^
+<sql-statement>
+create trigger mlparted11_trig before insert ON mlparted11
+ for each row execute procedure mlparted11_trig_fn();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger mlparted11_trig before insert ON mlparted11
+ ^
+<sql-statement>
+-- check that the correct row is shown when constraint check_b fails after
+-- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due
+-- to the BR trigger mlparted11_trig_fn)
+insert into mlparted values (1, 2);
+</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.mlparted
+
+<sql-statement>
+drop trigger mlparted11_trig on mlparted11;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ drop trigger mlparted11_trig on mlparted11;
+ ^
+<sql-statement>
+drop function mlparted11_trig_fn();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function mlparted11_trig_fn();
+ ^
+<sql-statement>
+-- check that inserting into an internal partition successfully results in
+-- checking its partition constraint before inserting into the leaf partition
+-- selected by tuple-routing
+insert into mlparted1 (a, b) values (2, 3);
+</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.mlparted1
+
+<sql-statement>
+-- check routing error through a list partitioned table when the key is null
+create table lparted_nonullpart (a int, b char) partition by list (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check routing error through a list partitioned table when the key is null
+ ^
+<sql-statement>
+create table lparted_nonullpart_a partition of lparted_nonullpart for values in ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table lparted_nonullpart_a partition of lparted_nonullpart for values in ('a');
+ ^
+<sql-statement>
+insert into lparted_nonullpart values (1);
+</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.lparted_nonullpart
+
+<sql-statement>
+drop table lparted_nonullpart;
+</sql-statement>
+<sql-statement>
+-- check that RETURNING works correctly with tuple-routing
+alter table mlparted drop constraint check_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- check that RETURNING works correctly with tuple-routing
+ ^
+<sql-statement>
+create table mlparted12 partition of mlparted1 for values from (5) to (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted12 partition of mlparted1 for values from (5) to (10);
+ ^
+<sql-statement>
+create table mlparted2 (b int not null, a int not null);
+</sql-statement>
+<sql-statement>
+alter table mlparted attach partition mlparted2 for values from (1, 10) to (1, 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted attach partition mlparted2 for values from (1, 10) to (1, 20);
+ ^
+<sql-statement>
+create table mlparted3 partition of mlparted for values from (1, 20) to (1, 30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted3 partition of mlparted for values from (1, 20) to (1, 30);
+ ^
+<sql-statement>
+create table mlparted4 (like mlparted);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CreateStmt: alternative is not implemented yet : 389
+ create table mlparted4 (like mlparted);
+ ^
+<sql-statement>
+alter table mlparted4 drop a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted4 drop a;
+ ^
+<sql-statement>
+alter table mlparted4 add a int not null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted4 add a int not null;
+ ^
+<sql-statement>
+alter table mlparted attach partition mlparted4 for values from (1, 30) to (1, 40);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted attach partition mlparted4 for values from (1, 30) to (1, 40);
+ ^
+<sql-statement>
+with ins (a, b, c) as
+ (insert into mlparted (b, a) select s.a, 1 from generate_series(2, 39) s(a) returning tableoid::regclass, *)
+ select a, b, min(c), max(c) from ins group by a, b order by 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:6: Error: Expected Select statement as CTE query
+ with ins (a, b, c) as
+ ^
+<sql-statement>
+alter table mlparted add c text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted add c text;
+ ^
+<sql-statement>
+create table mlparted5 (c text, a int not null, b int not null) partition by list (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table mlparted5 (c text, a int not null, b int not null) partition by list (c);
+ ^
+<sql-statement>
+create table mlparted5a (a int not null, c text, b int not null);
+</sql-statement>
+<sql-statement>
+alter table mlparted5 attach partition mlparted5a for values in ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted5 attach partition mlparted5a for values in ('a');
+ ^
+<sql-statement>
+alter table mlparted attach partition mlparted5 for values from (1, 40) to (1, 50);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted attach partition mlparted5 for values from (1, 40) to (1, 50);
+ ^
+<sql-statement>
+alter table mlparted add constraint check_b check (a = 1 and b < 45);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted add constraint check_b check (a = 1 and b < 45);
+ ^
+<sql-statement>
+insert into mlparted values (1, 45, 'a');
+</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.mlparted
+
+<sql-statement>
+create function mlparted5abrtrig_func() returns trigger as $$ begin new.c = 'b'; return new; end; $$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function mlparted5abrtrig_func() returns trigger as $$ begin new.c = 'b'; return new; end; $$ language plpgsql;
+ ^
+<sql-statement>
+create trigger mlparted5abrtrig before insert on mlparted5a for each row execute procedure mlparted5abrtrig_func();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger mlparted5abrtrig before insert on mlparted5a for each row execute procedure mlparted5abrtrig_func();
+ ^
+<sql-statement>
+insert into mlparted5 (a, b, c) values (1, 40, 'a');
+</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.mlparted5
+
+<sql-statement>
+drop table mlparted5;
+</sql-statement>
+<sql-statement>
+alter table mlparted drop constraint check_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted drop constraint check_b;
+ ^
+<sql-statement>
+-- Check multi-level default partition
+create table mlparted_def partition of mlparted default partition by range(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- Check multi-level default partition
+ ^
+<sql-statement>
+create table mlparted_def1 partition of mlparted_def for values from (40) to (50);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted_def1 partition of mlparted_def for values from (40) to (50);
+ ^
+<sql-statement>
+create table mlparted_def2 partition of mlparted_def for values from (50) to (60);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted_def2 partition of mlparted_def for values from (50) to (60);
+ ^
+<sql-statement>
+insert into mlparted values (40, 100);
+</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.mlparted
+
+<sql-statement>
+insert into mlparted_def1 values (42, 100);
+</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.mlparted_def1
+
+<sql-statement>
+insert into mlparted_def2 values (54, 50);
+</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.mlparted_def2
+
+<sql-statement>
+-- fail
+insert into mlparted values (70, 100);
+</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.mlparted
+
+<sql-statement>
+insert into mlparted_def1 values (52, 50);
+</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.mlparted_def1
+
+<sql-statement>
+insert into mlparted_def2 values (34, 50);
+</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.mlparted_def2
+
+<sql-statement>
+-- ok
+create table mlparted_defd partition of mlparted_def default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- ok
+ ^
+<sql-statement>
+insert into mlparted values (70, 100);
+</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.mlparted
+
+<sql-statement>
+select tableoid::regclass, * from mlparted_def;
+</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.mlparted_def
+
+<sql-statement>
+-- Check multi-level tuple routing with attributes dropped from the
+-- top-most parent. First remove the last attribute.
+alter table mlparted add d int, add e int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Check multi-level tuple routing with attributes dropped from the
+ ^
+<sql-statement>
+alter table mlparted drop e;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted drop e;
+ ^
+<sql-statement>
+create table mlparted5 partition of mlparted
+ for values from (1, 40) to (1, 50) partition by range (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted5 partition of mlparted
+ ^
+<sql-statement>
+create table mlparted5_ab partition of mlparted5
+ for values from ('a') to ('c') partition by list (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted5_ab partition of mlparted5
+ ^
+<sql-statement>
+-- This partitioned table should remain with no partitions.
+create table mlparted5_cd partition of mlparted5
+ for values from ('c') to ('e') partition by list (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- This partitioned table should remain with no partitions.
+ ^
+<sql-statement>
+create table mlparted5_a partition of mlparted5_ab for values in ('a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mlparted5_a partition of mlparted5_ab for values in ('a');
+ ^
+<sql-statement>
+create table mlparted5_b (d int, b int, c text, a int);
+</sql-statement>
+<sql-statement>
+alter table mlparted5_ab attach partition mlparted5_b for values in ('b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted5_ab attach partition mlparted5_b for values in ('b');
+ ^
+<sql-statement>
+truncate mlparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ truncate mlparted;
+ ^
+<sql-statement>
+insert into mlparted values (1, 2, 'a', 1);
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+</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.mlparted
+
+<sql-statement>
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+</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.mlparted
+
+<sql-statement>
+alter table mlparted drop d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted drop d;
+ ^
+<sql-statement>
+truncate mlparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ truncate mlparted;
+ ^
+<sql-statement>
+-- Remove the before last attribute.
+alter table mlparted add e int, add d int;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- Remove the before last attribute.
+ ^
+<sql-statement>
+alter table mlparted drop e;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted drop e;
+ ^
+<sql-statement>
+insert into mlparted values (1, 2, 'a', 1);
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+</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.mlparted
+
+<sql-statement>
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+</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.mlparted
+
+<sql-statement>
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+</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.mlparted
+
+<sql-statement>
+alter table mlparted drop d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table mlparted drop d;
+ ^
+<sql-statement>
+drop table mlparted5;
+</sql-statement>
+<sql-statement>
+-- check that message shown after failure to find a partition shows the
+-- appropriate key description (or none) in various situations
+create table key_desc (a int, b int) partition by list ((a+0));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that message shown after failure to find a partition shows the
+ ^
+<sql-statement>
+create table key_desc_1 partition of key_desc for values in (1) partition by range (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table key_desc_1 partition of key_desc for values in (1) partition by range (b);
+ ^
+<sql-statement>
+create user regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
+ create user regress_insert_other_user;
+ ^
+<sql-statement>
+grant select (a) on key_desc_1 to regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ grant select (a) on key_desc_1 to regress_insert_other_user;
+ ^
+<sql-statement>
+grant insert on key_desc to regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ grant insert on key_desc to regress_insert_other_user;
+ ^
+<sql-statement>
+set role regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ set role regress_insert_other_user;
+ ^
+<sql-statement>
+-- no key description is shown
+insert into key_desc values (1, 1);
+</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.key_desc
+
+<sql-statement>
+reset role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset role;
+ ^
+<sql-statement>
+grant select (b) on key_desc_1 to regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ grant select (b) on key_desc_1 to regress_insert_other_user;
+ ^
+<sql-statement>
+set role regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ set role regress_insert_other_user;
+ ^
+<sql-statement>
+-- key description (b)=(1) is now shown
+insert into key_desc values (1, 1);
+</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.key_desc
+
+<sql-statement>
+-- key description is not shown if key contains expression
+insert into key_desc values (2, 1);
+</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.key_desc
+
+<sql-statement>
+reset role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset role;
+ ^
+<sql-statement>
+revoke all on key_desc from regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ revoke all on key_desc from regress_insert_other_user;
+ ^
+<sql-statement>
+revoke all on key_desc_1 from regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ revoke all on key_desc_1 from regress_insert_other_user;
+ ^
+<sql-statement>
+drop role regress_insert_other_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
+ drop role regress_insert_other_user;
+ ^
+<sql-statement>
+drop table key_desc, key_desc_1;
+</sql-statement>
+<sql-statement>
+-- test minvalue/maxvalue restrictions
+create table mcrparted (a int, b int, c int) partition by range (a, abs(b), c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- test minvalue/maxvalue restrictions
+ ^
+<sql-statement>
+create table mcrparted0 partition of mcrparted for values from (minvalue, 0, 0) to (1, maxvalue, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted0 partition of mcrparted for values from (minvalue, 0, 0) to (1, maxvalue, maxvalue);
+ ^
+<sql-statement>
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, minvalue);
+ ^
+<sql-statement>
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, 0) to (30, 20, minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted4 partition of mcrparted for values from (21, minvalue, 0) to (30, 20, minvalue);
+ ^
+<sql-statement>
+-- check multi-column range partitioning expression enforces the same
+-- constraint as what tuple-routing would determine it to be
+create table mcrparted0 partition of mcrparted for values from (minvalue, minvalue, minvalue) to (1, maxvalue, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- check multi-column range partitioning expression enforces the same
+ ^
+<sql-statement>
+create table mcrparted1 partition of mcrparted for values from (2, 1, minvalue) to (10, 5, 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted1 partition of mcrparted for values from (2, 1, minvalue) to (10, 5, 10);
+ ^
+<sql-statement>
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, maxvalue);
+ ^
+<sql-statement>
+create table mcrparted3 partition of mcrparted for values from (11, 1, 1) to (20, 10, 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted3 partition of mcrparted for values from (11, 1, 1) to (20, 10, 10);
+ ^
+<sql-statement>
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, minvalue) to (30, 20, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted4 partition of mcrparted for values from (21, minvalue, minvalue) to (30, 20, maxvalue);
+ ^
+<sql-statement>
+create table mcrparted5 partition of mcrparted for values from (30, 21, 20) to (maxvalue, maxvalue, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted5 partition of mcrparted for values from (30, 21, 20) to (maxvalue, maxvalue, maxvalue);
+ ^
+<sql-statement>
+-- null not allowed in range partition
+insert into mcrparted values (null, null, null);
+</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.mcrparted
+
+<sql-statement>
+-- routed to mcrparted0
+insert into mcrparted values (0, 1, 1);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted0 values (0, 1, 1);
+</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.mcrparted0
+
+<sql-statement>
+-- routed to mcparted1
+insert into mcrparted values (9, 1000, 1);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted1 values (9, 1000, 1);
+</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.mcrparted1
+
+<sql-statement>
+insert into mcrparted values (10, 5, -1);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted1 values (10, 5, -1);
+</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.mcrparted1
+
+<sql-statement>
+insert into mcrparted values (2, 1, 0);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted1 values (2, 1, 0);
+</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.mcrparted1
+
+<sql-statement>
+-- routed to mcparted2
+insert into mcrparted values (10, 6, 1000);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted2 values (10, 6, 1000);
+</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.mcrparted2
+
+<sql-statement>
+insert into mcrparted values (10, 1000, 1000);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted2 values (10, 1000, 1000);
+</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.mcrparted2
+
+<sql-statement>
+-- no partition exists, nor does mcrparted3 accept it
+insert into mcrparted values (11, 1, -1);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted3 values (11, 1, -1);
+</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.mcrparted3
+
+<sql-statement>
+-- routed to mcrparted5
+insert into mcrparted values (30, 21, 20);
+</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.mcrparted
+
+<sql-statement>
+insert into mcrparted5 values (30, 21, 20);
+</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.mcrparted5
+
+<sql-statement>
+insert into mcrparted4 values (30, 21, 20); -- error
+</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.mcrparted4
+
+<sql-statement>
+-- check rows
+select tableoid::regclass::text, * from mcrparted order by 1;
+</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.mcrparted
+
+<sql-statement>
+-- cleanup
+drop table mcrparted;
+</sql-statement>
+<sql-statement>
+-- check that a BR constraint can't make partition contain violating rows
+create table brtrigpartcon (a int, b text) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that a BR constraint can't make partition contain violating rows
+ ^
+<sql-statement>
+create table brtrigpartcon1 partition of brtrigpartcon for values in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table brtrigpartcon1 partition of brtrigpartcon for values in (1);
+ ^
+<sql-statement>
+create or replace function brtrigpartcon1trigf() returns trigger as $$begin new.a := 2; return new; end$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create or replace function brtrigpartcon1trigf() returns trigger as $$begin new.a := 2; return new; end$$ language plpgsql;
+ ^
+<sql-statement>
+create trigger brtrigpartcon1trig before insert on brtrigpartcon1 for each row execute procedure brtrigpartcon1trigf();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger brtrigpartcon1trig before insert on brtrigpartcon1 for each row execute procedure brtrigpartcon1trigf();
+ ^
+<sql-statement>
+insert into brtrigpartcon values (1, 'hi there');
+</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.brtrigpartcon
+
+<sql-statement>
+insert into brtrigpartcon1 values (1, 'hi there');
+</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.brtrigpartcon1
+
+<sql-statement>
+-- check that the message shows the appropriate column description in a
+-- situation where the partitioned table is not the primary ModifyTable node
+create table inserttest3 (f1 text default 'foo', f2 text default 'bar', f3 int);
+</sql-statement>
+<sql-statement>
+create role regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
+ create role regress_coldesc_role;
+ ^
+<sql-statement>
+grant insert on inserttest3 to regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ grant insert on inserttest3 to regress_coldesc_role;
+ ^
+<sql-statement>
+grant insert on brtrigpartcon to regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ grant insert on brtrigpartcon to regress_coldesc_role;
+ ^
+<sql-statement>
+revoke select on brtrigpartcon from regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ revoke select on brtrigpartcon from regress_coldesc_role;
+ ^
+<sql-statement>
+set role regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: role
+ set role regress_coldesc_role;
+ ^
+<sql-statement>
+with result as (insert into brtrigpartcon values (1, 'hi there') returning 1)
+ insert into inserttest3 (f3) select * from result;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported withClause
+ with result as (insert into brtrigpartcon values (1, 'hi there') returning 1)
+ ^
+<sql-statement>
+reset role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset role;
+ ^
+<sql-statement>
+-- cleanup
+revoke all on inserttest3 from regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ -- cleanup
+ ^
+<sql-statement>
+revoke all on brtrigpartcon from regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ revoke all on brtrigpartcon from regress_coldesc_role;
+ ^
+<sql-statement>
+drop role regress_coldesc_role;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
+ drop role regress_coldesc_role;
+ ^
+<sql-statement>
+drop table inserttest3;
+</sql-statement>
+<sql-statement>
+drop table brtrigpartcon;
+</sql-statement>
+<sql-statement>
+drop function brtrigpartcon1trigf();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function brtrigpartcon1trigf();
+ ^
+<sql-statement>
+-- check that "do nothing" BR triggers work with tuple-routing
+create table donothingbrtrig_test (a int, b text) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that "do nothing" BR triggers work with tuple-routing
+ ^
+<sql-statement>
+create table donothingbrtrig_test1 (b text, a int);
+</sql-statement>
+<sql-statement>
+create table donothingbrtrig_test2 (c text, b text, a int);
+</sql-statement>
+<sql-statement>
+alter table donothingbrtrig_test2 drop column c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table donothingbrtrig_test2 drop column c;
+ ^
+<sql-statement>
+create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
+ ^
+<sql-statement>
+create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+ ^
+<sql-statement>
+create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+ ^
+<sql-statement>
+alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
+ ^
+<sql-statement>
+alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
+ ^
+<sql-statement>
+insert into donothingbrtrig_test values (1, 'foo'), (2, 'bar');
+</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.donothingbrtrig_test
+
+<sql-statement>
+copy donothingbrtrig_test from stdout;
+1 baz
+2 qux
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+select tableoid::regclass, * from donothingbrtrig_test;
+</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.donothingbrtrig_test
+
+<sql-statement>
+-- cleanup
+drop table donothingbrtrig_test;
+</sql-statement>
+<sql-statement>
+drop function donothingbrtrig_func();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function donothingbrtrig_func();
+ ^
+<sql-statement>
+-- check multi-column range partitioning with minvalue/maxvalue constraints
+create table mcrparted (a text, b int) partition by range(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check multi-column range partitioning with minvalue/maxvalue constraints
+ ^
+<sql-statement>
+create table mcrparted1_lt_b partition of mcrparted for values from (minvalue, minvalue) to ('b', minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted1_lt_b partition of mcrparted for values from (minvalue, minvalue) to ('b', minvalue);
+ ^
+<sql-statement>
+create table mcrparted2_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted2_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
+ ^
+<sql-statement>
+create table mcrparted3_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted3_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
+ ^
+<sql-statement>
+create table mcrparted4_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted4_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
+ ^
+<sql-statement>
+create table mcrparted5_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted5_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
+ ^
+<sql-statement>
+create table mcrparted6_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted6_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
+ ^
+<sql-statement>
+create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
+ ^
+<sql-statement>
+create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, maxvalue);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, maxvalue);
+ ^
+<sql-statement>
+\d+ mcrparted
+</sql-statement>
+Metacommand \d+ mcrparted is not supported
+<sql-statement>
+\d+ mcrparted1_lt_b
+</sql-statement>
+Metacommand \d+ mcrparted1_lt_b is not supported
+<sql-statement>
+\d+ mcrparted2_b
+</sql-statement>
+Metacommand \d+ mcrparted2_b is not supported
+<sql-statement>
+\d+ mcrparted3_c_to_common
+</sql-statement>
+Metacommand \d+ mcrparted3_c_to_common is not supported
+<sql-statement>
+\d+ mcrparted4_common_lt_0
+</sql-statement>
+Metacommand \d+ mcrparted4_common_lt_0 is not supported
+<sql-statement>
+\d+ mcrparted5_common_0_to_10
+</sql-statement>
+Metacommand \d+ mcrparted5_common_0_to_10 is not supported
+<sql-statement>
+\d+ mcrparted6_common_ge_10
+</sql-statement>
+Metacommand \d+ mcrparted6_common_ge_10 is not supported
+<sql-statement>
+\d+ mcrparted7_gt_common_lt_d
+</sql-statement>
+Metacommand \d+ mcrparted7_gt_common_lt_d is not supported
+<sql-statement>
+\d+ mcrparted8_ge_d
+</sql-statement>
+Metacommand \d+ mcrparted8_ge_d is not supported
+<sql-statement>
+insert into mcrparted values ('aaa', 0), ('b', 0), ('bz', 10), ('c', -10),
+ ('comm', -10), ('common', -10), ('common', 0), ('common', 10),
+ ('commons', 0), ('d', -10), ('e', 0);
+</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.mcrparted
+
+<sql-statement>
+select tableoid::regclass, * from mcrparted order by a, b;
+</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.mcrparted
+
+<sql-statement>
+drop table mcrparted;
+</sql-statement>
+<sql-statement>
+-- check that wholerow vars in the RETURNING list work with partitioned tables
+create table returningwrtest (a int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- check that wholerow vars in the RETURNING list work with partitioned tables
+ ^
+<sql-statement>
+create table returningwrtest1 partition of returningwrtest for values in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table returningwrtest1 partition of returningwrtest for values in (1);
+ ^
+<sql-statement>
+insert into returningwrtest values (1) returning returningwrtest;
+</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>
+-- check also that the wholerow vars in RETURNING list are converted as needed
+alter table returningwrtest add b text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- check also that the wholerow vars in RETURNING list are converted as needed
+ ^
+<sql-statement>
+create table returningwrtest2 (b text, c int, a int);
+</sql-statement>
+<sql-statement>
+alter table returningwrtest2 drop c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table returningwrtest2 drop c;
+ ^
+<sql-statement>
+alter table returningwrtest attach partition returningwrtest2 for values in (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table returningwrtest attach partition returningwrtest2 for values in (2);
+ ^
+<sql-statement>
+insert into returningwrtest values (2, 'foo') returning returningwrtest;
+</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>
+drop table returningwrtest;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/insert.out b/yql/essentials/tests/postgresql/cases/insert.out
new file mode 100644
index 0000000000..deceb2192b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/insert.out
@@ -0,0 +1,25 @@
+--
+-- insert with DEFAULT in the target_list
+--
+create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
+--
+-- TOASTed value test
+--
+insert into inserttest values(30, 50, repeat('x', 10000));
+drop table inserttest;
+create table inserttest (f1 int, f2 int[],
+ f3 insert_test_type, f4 insert_test_type[]);
+-- also check reverse-listing
+create table inserttest2 (f1 bigint, f2 text);
+drop table inserttest2;
+drop table inserttest;
+create table mlparted2 (b int not null, a int not null);
+create table mlparted5a (a int not null, c text, b int not null);
+create table mlparted5_b (d int, b int, c text, a int);
+-- check that the message shows the appropriate column description in a
+-- situation where the partitioned table is not the primary ModifyTable node
+create table inserttest3 (f1 text default 'foo', f2 text default 'bar', f3 int);
+drop table inserttest3;
+create table donothingbrtrig_test1 (b text, a int);
+create table donothingbrtrig_test2 (c text, b text, a int);
+create table returningwrtest2 (b text, c int, a int);
diff --git a/yql/essentials/tests/postgresql/cases/insert.sql b/yql/essentials/tests/postgresql/cases/insert.sql
new file mode 100644
index 0000000000..deceb2192b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/insert.sql
@@ -0,0 +1,25 @@
+--
+-- insert with DEFAULT in the target_list
+--
+create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
+--
+-- TOASTed value test
+--
+insert into inserttest values(30, 50, repeat('x', 10000));
+drop table inserttest;
+create table inserttest (f1 int, f2 int[],
+ f3 insert_test_type, f4 insert_test_type[]);
+-- also check reverse-listing
+create table inserttest2 (f1 bigint, f2 text);
+drop table inserttest2;
+drop table inserttest;
+create table mlparted2 (b int not null, a int not null);
+create table mlparted5a (a int not null, c text, b int not null);
+create table mlparted5_b (d int, b int, c text, a int);
+-- check that the message shows the appropriate column description in a
+-- situation where the partitioned table is not the primary ModifyTable node
+create table inserttest3 (f1 text default 'foo', f2 text default 'bar', f3 int);
+drop table inserttest3;
+create table donothingbrtrig_test1 (b text, a int);
+create table donothingbrtrig_test2 (c text, b text, a int);
+create table returningwrtest2 (b text, c int, a int);
diff --git a/yql/essentials/tests/postgresql/cases/int2.err b/yql/essentials/tests/postgresql/cases/int2.err
new file mode 100644
index 0000000000..b5372d1b62
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int2.err
@@ -0,0 +1,304 @@
+<sql-statement>
+--
+-- INT2
+--
+CREATE TABLE INT2_TBL(f1 int2);
+</sql-statement>
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('0 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES (' -1234');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "34.5"
+
+ INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ ^
+<sql-statement>
+-- largest and smallest values
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+</sql-statement>
+<sql-statement>
+-- bad input values -- should give errors
+INSERT INTO INT2_TBL(f1) VALUES ('100000');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad input values -- should give errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "100000" is out of range for type smallint
+
+ -- bad input values -- should give errors
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "asdf"
+
+ INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES (' ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: " "
+
+ INSERT INTO INT2_TBL(f1) VALUES (' ');
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "- 1234"
+
+ INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "4 444"
+
+ INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "123 dt"
+
+ INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ ^
+<sql-statement>
+INSERT INTO INT2_TBL(f1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT2_TBL(f1) VALUES ('');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: ""
+
+ INSERT INTO INT2_TBL(f1) VALUES ('');
+ ^
+<sql-statement>
+SELECT * FROM INT2_TBL;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT2_TBL AS f(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM INT2_TBL AS f(a, b);
+ ^
+ -stdin-:<main>:1:1: Error: Wrong number of columns, expected: 1, got: 2
+ SELECT * FROM INT2_TBL AS f(a, b);
+ ^
+<sql-statement>
+SELECT * FROM (TABLE int2_tbl) AS s (a, b);
+</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.int2_tbl
+
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
+</sql-statement>
+<sql-statement>
+-- positive odds
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+</sql-statement>
+<sql-statement>
+-- any evens
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i
+WHERE abs(f1) < 16384;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i
+WHERE f1 < 32766;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i
+WHERE f1 > -32767;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
+</sql-statement>
+<sql-statement>
+-- corner cases
+SELECT (-1::int2<<15)::text;
+</sql-statement>
+<sql-statement>
+SELECT ((-1::int2<<15)+1::int2)::text;
+</sql-statement>
+<sql-statement>
+-- check sane handling of INT16_MIN overflow cases
+SELECT (-32768)::int2 * (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- check sane handling of INT16_MIN overflow cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ -- check sane handling of INT16_MIN overflow cases
+ ^
+<sql-statement>
+SELECT (-32768)::int2 / (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-32768)::int2 / (-1)::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT (-32768)::int2 / (-1)::int2;
+ ^
+<sql-statement>
+SELECT (-32768)::int2 % (-1)::int2;
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from float
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from numeric
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/int2.out b/yql/essentials/tests/postgresql/cases/int2.out
new file mode 100644
index 0000000000..55ea7202cd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int2.out
@@ -0,0 +1,308 @@
+--
+-- INT2
+--
+CREATE TABLE INT2_TBL(f1 int2);
+INSERT INTO INT2_TBL(f1) VALUES ('0 ');
+INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
+INSERT INTO INT2_TBL(f1) VALUES (' -1234');
+INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ERROR: invalid input syntax for type smallint: "34.5"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ ^
+-- largest and smallest values
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+-- bad input values -- should give errors
+INSERT INTO INT2_TBL(f1) VALUES ('100000');
+ERROR: value "100000" is out of range for type smallint
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('100000');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ERROR: invalid input syntax for type smallint: "asdf"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type smallint: " "
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ERROR: invalid input syntax for type smallint: "- 1234"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ERROR: invalid input syntax for type smallint: "4 444"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ERROR: invalid input syntax for type smallint: "123 dt"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type smallint: ""
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('');
+ ^
+SELECT * FROM INT2_TBL;
+ f1
+--------
+ 0
+ 1234
+ -1234
+ 32767
+ -32767
+(5 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
+ f1
+--------
+ 1234
+ -1234
+ 32767
+ -32767
+(4 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
+ f1
+--------
+ 1234
+ -1234
+ 32767
+ -32767
+(4 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
+ f1
+--------
+ -1234
+ -32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
+ f1
+--------
+ -1234
+ -32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
+ f1
+--------
+ 0
+ -1234
+ -32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
+ f1
+--------
+ 0
+ -1234
+ -32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
+ f1
+-------
+ 1234
+ 32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
+ f1
+-------
+ 1234
+ 32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
+ f1
+-------
+ 0
+ 1234
+ 32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
+ f1
+-------
+ 0
+ 1234
+ 32767
+(3 rows)
+
+-- positive odds
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+ f1
+-------
+ 32767
+(1 row)
+
+-- any evens
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+ f1
+-------
+ 0
+ 1234
+ -1234
+(3 rows)
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i
+WHERE abs(f1) < 16384;
+ f1 | x
+-------+-------
+ 0 | 0
+ 1234 | 2468
+ -1234 | -2468
+(3 rows)
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 2468
+ -1234 | -2468
+ 32767 | 65534
+ -32767 | -65534
+(5 rows)
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i
+WHERE f1 < 32766;
+ f1 | x
+--------+--------
+ 0 | 2
+ 1234 | 1236
+ -1234 | -1232
+ -32767 | -32765
+(4 rows)
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 2
+ 1234 | 1236
+ -1234 | -1232
+ 32767 | 32769
+ -32767 | -32765
+(5 rows)
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i
+WHERE f1 > -32767;
+ f1 | x
+-------+-------
+ 0 | -2
+ 1234 | 1232
+ -1234 | -1236
+ 32767 | 32765
+(4 rows)
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | -2
+ 1234 | 1232
+ -1234 | -1236
+ 32767 | 32765
+ -32767 | -32769
+(5 rows)
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 617
+ -1234 | -617
+ 32767 | 16383
+ -32767 | -16383
+(5 rows)
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 617
+ -1234 | -617
+ 32767 | 16383
+ -32767 | -16383
+(5 rows)
+
+-- corner cases
+SELECT (-1::int2<<15)::text;
+ text
+--------
+ -32768
+(1 row)
+
+SELECT ((-1::int2<<15)+1::int2)::text;
+ text
+--------
+ -32767
+(1 row)
+
+-- check sane handling of INT16_MIN overflow cases
+SELECT (-32768)::int2 * (-1)::int2;
+ERROR: smallint out of range
+SELECT (-32768)::int2 / (-1)::int2;
+ERROR: smallint out of range
+SELECT (-32768)::int2 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int2_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int2_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
diff --git a/yql/essentials/tests/postgresql/cases/int2.sql b/yql/essentials/tests/postgresql/cases/int2.sql
new file mode 100644
index 0000000000..8373a26d95
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int2.sql
@@ -0,0 +1,75 @@
+--
+-- INT2
+--
+CREATE TABLE INT2_TBL(f1 int2);
+INSERT INTO INT2_TBL(f1) VALUES ('0 ');
+INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
+INSERT INTO INT2_TBL(f1) VALUES (' -1234');
+INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+-- largest and smallest values
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+-- bad input values -- should give errors
+INSERT INTO INT2_TBL(f1) VALUES ('100000');
+INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+INSERT INTO INT2_TBL(f1) VALUES (' ');
+INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+INSERT INTO INT2_TBL(f1) VALUES ('');
+SELECT * FROM INT2_TBL;
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
+-- positive odds
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+-- any evens
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i
+WHERE abs(f1) < 16384;
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i
+WHERE f1 < 32766;
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i
+WHERE f1 > -32767;
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
+-- corner cases
+SELECT (-1::int2<<15)::text;
+SELECT ((-1::int2<<15)+1::int2)::text;
+-- check sane handling of INT16_MIN overflow cases
+SELECT (-32768)::int2 * (-1)::int2;
+SELECT (-32768)::int2 / (-1)::int2;
+SELECT (-32768)::int2 % (-1)::int2;
+-- check rounding when casting from float
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+-- check rounding when casting from numeric
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
diff --git a/yql/essentials/tests/postgresql/cases/int4.err b/yql/essentials/tests/postgresql/cases/int4.err
new file mode 100644
index 0000000000..b2ba1e827d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int4.err
@@ -0,0 +1,474 @@
+<sql-statement>
+--
+-- INT4
+--
+CREATE TABLE INT4_TBL(f1 int4);
+</sql-statement>
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "34.5"
+
+ INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ ^
+<sql-statement>
+-- largest and smallest values
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+</sql-statement>
+<sql-statement>
+-- bad input values -- should give errors
+INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad input values -- should give errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "1000000000000" is out of range for type integer
+
+ -- bad input values -- should give errors
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "asdf"
+
+ INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES (' ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: " "
+
+ INSERT INTO INT4_TBL(f1) VALUES (' ');
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: " asdf "
+
+ INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "- 1234"
+
+ INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "123 5"
+
+ INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ ^
+<sql-statement>
+INSERT INTO INT4_TBL(f1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT4_TBL(f1) VALUES ('');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: ""
+
+ INSERT INTO INT4_TBL(f1) VALUES ('');
+ ^
+<sql-statement>
+SELECT * FROM INT4_TBL;
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int4 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0';
+</sql-statement>
+<sql-statement>
+-- positive odds
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+</sql-statement>
+<sql-statement>
+-- any evens
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+ ^
+<sql-statement>
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+<sql-statement>
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i;
+</sql-statement>
+<sql-statement>
+--
+-- more complex expressions
+--
+-- variations on unary minus parsing
+SELECT -2+3 AS one;
+</sql-statement>
+<sql-statement>
+SELECT 4-2 AS two;
+</sql-statement>
+<sql-statement>
+SELECT 2- -1 AS three;
+</sql-statement>
+<sql-statement>
+SELECT 2 - -2 AS four;
+</sql-statement>
+<sql-statement>
+SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true;
+</sql-statement>
+<sql-statement>
+SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true;
+</sql-statement>
+<sql-statement>
+SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true;
+</sql-statement>
+<sql-statement>
+SELECT int4 '1000' < int4 '999' AS false;
+</sql-statement>
+<sql-statement>
+SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+</sql-statement>
+<sql-statement>
+SELECT 2 + 2 / 2 AS three;
+</sql-statement>
+<sql-statement>
+SELECT (2 + 2) / 2 AS two;
+</sql-statement>
+<sql-statement>
+-- corner case
+SELECT (-1::int4<<31)::text;
+</sql-statement>
+<sql-statement>
+SELECT ((-1::int4<<31)+1)::text;
+</sql-statement>
+<sql-statement>
+-- check sane handling of INT_MIN overflow cases
+SELECT (-2147483648)::int4 * (-1)::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- check sane handling of INT_MIN overflow cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ -- check sane handling of INT_MIN overflow cases
+ ^
+<sql-statement>
+SELECT (-2147483648)::int4 / (-1)::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-2147483648)::int4 / (-1)::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT (-2147483648)::int4 / (-1)::int4;
+ ^
+<sql-statement>
+SELECT (-2147483648)::int4 % (-1)::int4;
+</sql-statement>
+<sql-statement>
+SELECT (-2147483648)::int4 * (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-2147483648)::int4 * (-1)::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT (-2147483648)::int4 * (-1)::int2;
+ ^
+<sql-statement>
+SELECT (-2147483648)::int4 / (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-2147483648)::int4 / (-1)::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT (-2147483648)::int4 / (-1)::int2;
+ ^
+<sql-statement>
+SELECT (-2147483648)::int4 % (-1)::int2;
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from float
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from numeric
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+</sql-statement>
+<sql-statement>
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 6410818::int4),
+ (61866666::int4, 6410818::int4),
+ (-61866666::int4, 6410818::int4),
+ ((-2147483648)::int4, 1::int4),
+ ((-2147483648)::int4, 2147483647::int4),
+ ((-2147483648)::int4, 1073741824::int4)) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test gcd()
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: gcd
+ -- test gcd()
+ ^
+<sql-statement>
+SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+ ^
+<sql-statement>
+SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+ ^
+<sql-statement>
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 42::int4),
+ (42::int4, 42::int4),
+ (330::int4, 462::int4),
+ (-330::int4, 462::int4),
+ ((-2147483648)::int4, 0::int4)) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test lcm()
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: lcm
+ -- test lcm()
+ ^
+<sql-statement>
+SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+ ^
+<sql-statement>
+SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/int4.out b/yql/essentials/tests/postgresql/cases/int4.out
new file mode 100644
index 0000000000..1447974809
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int4.out
@@ -0,0 +1,401 @@
+--
+-- INT4
+--
+CREATE TABLE INT4_TBL(f1 int4);
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ERROR: invalid input syntax for type integer: "34.5"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ ^
+-- largest and smallest values
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+-- bad input values -- should give errors
+INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+ERROR: value "1000000000000" is out of range for type integer
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ERROR: invalid input syntax for type integer: "asdf"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type integer: " "
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ERROR: invalid input syntax for type integer: " asdf "
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ERROR: invalid input syntax for type integer: "- 1234"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type integer: "123 5"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type integer: ""
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('');
+ ^
+SELECT * FROM INT4_TBL;
+ f1
+-------------
+ 0
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(5 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0';
+ f1
+-------------
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(4 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0';
+ f1
+-------------
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(4 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int2 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int4 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int2 '0';
+ f1
+-------------
+ -123456
+ -2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int4 '0';
+ f1
+-------------
+ -123456
+ -2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0';
+ f1
+-------------
+ 0
+ -123456
+ -2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0';
+ f1
+-------------
+ 0
+ -123456
+ -2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int2 '0';
+ f1
+------------
+ 123456
+ 2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int4 '0';
+ f1
+------------
+ 123456
+ 2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0';
+ f1
+------------
+ 0
+ 123456
+ 2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0';
+ f1
+------------
+ 0
+ 123456
+ 2147483647
+(3 rows)
+
+-- positive odds
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+ f1
+------------
+ 2147483647
+(1 row)
+
+-- any evens
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+ f1
+---------
+ 0
+ 123456
+ -123456
+(3 rows)
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+ f1 | x
+---------+---------
+ 0 | 0
+ 123456 | 246912
+ -123456 | -246912
+(3 rows)
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+ f1 | x
+---------+---------
+ 0 | 0
+ 123456 | 246912
+ -123456 | -246912
+(3 rows)
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+ f1 | x
+-------------+-------------
+ 0 | 2
+ 123456 | 123458
+ -123456 | -123454
+ -2147483647 | -2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+ f1 | x
+-------------+-------------
+ 0 | 2
+ 123456 | 123458
+ -123456 | -123454
+ -2147483647 | -2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+ f1 | x
+------------+------------
+ 0 | -2
+ 123456 | 123454
+ -123456 | -123458
+ 2147483647 | 2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+ f1 | x
+------------+------------
+ 0 | -2
+ 123456 | 123454
+ -123456 | -123458
+ 2147483647 | 2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i;
+ f1 | x
+-------------+-------------
+ 0 | 0
+ 123456 | 61728
+ -123456 | -61728
+ 2147483647 | 1073741823
+ -2147483647 | -1073741823
+(5 rows)
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i;
+ f1 | x
+-------------+-------------
+ 0 | 0
+ 123456 | 61728
+ -123456 | -61728
+ 2147483647 | 1073741823
+ -2147483647 | -1073741823
+(5 rows)
+
+--
+-- more complex expressions
+--
+-- variations on unary minus parsing
+SELECT -2+3 AS one;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 4-2 AS two;
+ two
+-----
+ 2
+(1 row)
+
+SELECT 2- -1 AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT 2 - -2 AS four;
+ four
+------
+ 4
+(1 row)
+
+SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int4 '1000' < int4 '999' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+ ten
+-----
+ 10
+(1 row)
+
+SELECT 2 + 2 / 2 AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT (2 + 2) / 2 AS two;
+ two
+-----
+ 2
+(1 row)
+
+-- corner case
+SELECT (-1::int4<<31)::text;
+ text
+-------------
+ -2147483648
+(1 row)
+
+SELECT ((-1::int4<<31)+1)::text;
+ text
+-------------
+ -2147483647
+(1 row)
+
+-- check sane handling of INT_MIN overflow cases
+SELECT (-2147483648)::int4 * (-1)::int4;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 / (-1)::int4;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 % (-1)::int4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-2147483648)::int4 * (-1)::int2;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 / (-1)::int2;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int4_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int4_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
+SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+ERROR: integer out of range
+SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+ERROR: integer out of range
+SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+ERROR: integer out of range
+SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
+ERROR: integer out of range
diff --git a/yql/essentials/tests/postgresql/cases/int4.sql b/yql/essentials/tests/postgresql/cases/int4.sql
new file mode 100644
index 0000000000..d571cac66a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int4.sql
@@ -0,0 +1,103 @@
+--
+-- INT4
+--
+CREATE TABLE INT4_TBL(f1 int4);
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+-- largest and smallest values
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+-- bad input values -- should give errors
+INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+INSERT INTO INT4_TBL(f1) VALUES (' ');
+INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+INSERT INTO INT4_TBL(f1) VALUES ('');
+SELECT * FROM INT4_TBL;
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int4 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int4 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int4 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0';
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0';
+-- positive odds
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+-- any evens
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i;
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i;
+--
+-- more complex expressions
+--
+-- variations on unary minus parsing
+SELECT -2+3 AS one;
+SELECT 4-2 AS two;
+SELECT 2- -1 AS three;
+SELECT 2 - -2 AS four;
+SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true;
+SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true;
+SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true;
+SELECT int4 '1000' < int4 '999' AS false;
+SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+SELECT 2 + 2 / 2 AS three;
+SELECT (2 + 2) / 2 AS two;
+-- corner case
+SELECT (-1::int4<<31)::text;
+SELECT ((-1::int4<<31)+1)::text;
+-- check sane handling of INT_MIN overflow cases
+SELECT (-2147483648)::int4 * (-1)::int4;
+SELECT (-2147483648)::int4 / (-1)::int4;
+SELECT (-2147483648)::int4 % (-1)::int4;
+SELECT (-2147483648)::int4 * (-1)::int2;
+SELECT (-2147483648)::int4 / (-1)::int2;
+SELECT (-2147483648)::int4 % (-1)::int2;
+-- check rounding when casting from float
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+-- check rounding when casting from numeric
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
diff --git a/yql/essentials/tests/postgresql/cases/int8.err b/yql/essentials/tests/postgresql/cases/int8.err
new file mode 100644
index 0000000000..464a4682cb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int8.err
@@ -0,0 +1,977 @@
+<sql-statement>
+--
+-- INT8
+-- Test int8 64-bit integers.
+--
+CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+</sql-statement>
+<sql-statement>
+INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+</sql-statement>
+<sql-statement>
+INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+</sql-statement>
+<sql-statement>
+-- bad inputs
+INSERT INTO INT8_TBL(q1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bigint: " "
+
+ -- bad inputs
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bigint: "xxx"
+
+ INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "3908203590239580293850293850329485" is out of range for type bigint
+
+ INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "-1204982019841029840928340329840934" is out of range for type bigint
+
+ INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bigint: "- 123"
+
+ INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bigint: " 345 5"
+
+ INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ ^
+<sql-statement>
+INSERT INTO INT8_TBL(q1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INT8_TBL(q1) VALUES ('');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bigint: ""
+
+ INSERT INTO INT8_TBL(q1) VALUES ('');
+ ^
+<sql-statement>
+SELECT * FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+</sql-statement>
+<sql-statement>
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+</sql-statement>
+<sql-statement>
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE 123 > q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+</sql-statement>
+<sql-statement>
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+</sql-statement>
+<sql-statement>
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+</sql-statement>
+<sql-statement>
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ ^
+<sql-statement>
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+</sql-statement>
+<sql-statement>
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1, float8(q1) FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q2, float8(q2) FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q2, abs(q2) FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT min(q1), min(q2) FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT min(q1), min(q2) FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: min
+ SELECT min(q1), min(q2) FROM INT8_TBL;
+ ^
+<sql-statement>
+SELECT max(q1), max(q2) FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT max(q1), max(q2) FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: max
+ SELECT max(q1), max(q2) FROM INT8_TBL;
+ ^
+<sql-statement>
+-- TO_CHAR()
+--
+SELECT to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+ FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- TO_CHAR()
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: to_char
+ -- TO_CHAR()
+ ^
+<sql-statement>
+SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: to_char
+ SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ ^
+<sql-statement>
+SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: to_char
+ SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ ^
+<sql-statement>
+SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: to_char
+ SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ ^
+<sql-statement>
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- check min/max values and overflow behavior
+select '-9223372036854775808'::int8;
+</sql-statement>
+<sql-statement>
+select '-9223372036854775809'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775809'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "-9223372036854775809" is out of range for type bigint
+
+ select '-9223372036854775809'::int8;
+ ^
+<sql-statement>
+select '9223372036854775807'::int8;
+</sql-statement>
+<sql-statement>
+select '9223372036854775808'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775808'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "9223372036854775808" is out of range for type bigint
+
+ select '9223372036854775808'::int8;
+ ^
+<sql-statement>
+select -('-9223372036854775807'::int8);
+</sql-statement>
+<sql-statement>
+select -('-9223372036854775808'::int8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select -('-9223372036854775808'::int8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select -('-9223372036854775808'::int8);
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 / '0'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 / '0'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ select '9223372036854775800'::int8 / '0'::int8;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 % '0'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 % '0'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ select '9223372036854775800'::int8 % '0'::int8;
+ ^
+<sql-statement>
+select abs('-9223372036854775808'::int8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select abs('-9223372036854775808'::int8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select abs('-9223372036854775808'::int8);
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 + '100'::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 + '100'::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 + '100'::int4;
+ ^
+<sql-statement>
+select '-9223372036854775800'::int8 - '100'::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775800'::int8 - '100'::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-9223372036854775800'::int8 - '100'::int4;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 * '100'::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 * '100'::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 * '100'::int4;
+ ^
+<sql-statement>
+select '100'::int4 + '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '100'::int4 + '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '100'::int4 + '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '-100'::int4 - '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-100'::int4 - '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-100'::int4 - '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '100'::int4 * '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '100'::int4 * '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '100'::int4 * '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 + '100'::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 + '100'::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 + '100'::int2;
+ ^
+<sql-statement>
+select '-9223372036854775800'::int8 - '100'::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775800'::int8 - '100'::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-9223372036854775800'::int8 - '100'::int2;
+ ^
+<sql-statement>
+select '9223372036854775800'::int8 * '100'::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '9223372036854775800'::int8 * '100'::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '9223372036854775800'::int8 * '100'::int2;
+ ^
+<sql-statement>
+select '-9223372036854775808'::int8 / '0'::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-9223372036854775808'::int8 / '0'::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ select '-9223372036854775808'::int8 / '0'::int2;
+ ^
+<sql-statement>
+select '100'::int2 + '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '100'::int2 + '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '100'::int2 + '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '-100'::int2 - '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '-100'::int2 - '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '-100'::int2 - '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '100'::int2 * '9223372036854775800'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '100'::int2 * '9223372036854775800'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ select '100'::int2 * '9223372036854775800'::int8;
+ ^
+<sql-statement>
+select '100'::int2 / '0'::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '100'::int2 / '0'::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ select '100'::int2 / '0'::int8;
+ ^
+<sql-statement>
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 = 456;
+</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.int8_tbl
+
+<sql-statement>
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 <> 456;
+</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.int8_tbl
+
+<sql-statement>
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 = 456;
+</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.int8_tbl
+
+<sql-statement>
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 <> 456;
+</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.int8_tbl
+
+<sql-statement>
+SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
+</sql-statement>
+<sql-statement>
+SELECT CAST(q1 AS float4), CAST(q2 AS float8) FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST('36854775807.0'::float4 AS int8);
+</sql-statement>
+<sql-statement>
+SELECT CAST('922337203685477580700.0'::float8 AS int8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT CAST('922337203685477580700.0'::float8 AS int8);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT CAST('922337203685477580700.0'::float8 AS int8);
+ ^
+<sql-statement>
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: OID out of range
+
+ SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ ^
+<sql-statement>
+SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
+</sql-statement>
+<sql-statement>
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+</sql-statement>
+<sql-statement>
+-- generate_series
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
+</sql-statement>
+<sql-statement>
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot equal zero
+
+ SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+ ^
+<sql-statement>
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
+</sql-statement>
+<sql-statement>
+-- corner case
+SELECT (-1::int8<<63)::text;
+</sql-statement>
+<sql-statement>
+SELECT ((-1::int8<<63)+1)::text;
+</sql-statement>
+<sql-statement>
+-- check sane handling of INT64_MIN overflow cases
+SELECT (-9223372036854775808)::int8 * (-1)::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- check sane handling of INT64_MIN overflow cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ -- check sane handling of INT64_MIN overflow cases
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 / (-1)::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-9223372036854775808)::int8 / (-1)::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT (-9223372036854775808)::int8 / (-1)::int8;
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 % (-1)::int8;
+</sql-statement>
+<sql-statement>
+SELECT (-9223372036854775808)::int8 * (-1)::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-9223372036854775808)::int8 * (-1)::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT (-9223372036854775808)::int8 * (-1)::int4;
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 / (-1)::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-9223372036854775808)::int8 / (-1)::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT (-9223372036854775808)::int8 / (-1)::int4;
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 % (-1)::int4;
+</sql-statement>
+<sql-statement>
+SELECT (-9223372036854775808)::int8 * (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-9223372036854775808)::int8 * (-1)::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT (-9223372036854775808)::int8 * (-1)::int2;
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 / (-1)::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-9223372036854775808)::int8 / (-1)::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT (-9223372036854775808)::int8 / (-1)::int2;
+ ^
+<sql-statement>
+SELECT (-9223372036854775808)::int8 % (-1)::int2;
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from float
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+</sql-statement>
+<sql-statement>
+-- check rounding when casting from numeric
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+</sql-statement>
+<sql-statement>
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 1::int8),
+ ((-9223372036854775808)::int8, 9223372036854775807::int8),
+ ((-9223372036854775808)::int8, 4611686018427387904::int8)) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test gcd()
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: gcd
+ -- test gcd()
+ ^
+<sql-statement>
+SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+ ^
+<sql-statement>
+SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+ ^
+<sql-statement>
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (29893644334::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 0::int8)) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test lcm()
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: lcm
+ -- test lcm()
+ ^
+<sql-statement>
+SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+ ^
+<sql-statement>
+SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/int8.out b/yql/essentials/tests/postgresql/cases/int8.out
new file mode 100644
index 0000000000..bf82db3e7f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int8.out
@@ -0,0 +1,792 @@
+--
+-- INT8
+-- Test int8 64-bit integers.
+--
+CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+-- bad inputs
+INSERT INTO INT8_TBL(q1) VALUES (' ');
+ERROR: invalid input syntax for type bigint: " "
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' ');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ERROR: invalid input syntax for type bigint: "xxx"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+ERROR: value "3908203590239580293850293850329485" is out of range for type bigint
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('39082035902395802938502938...
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+ERROR: value "-1204982019841029840928340329840934" is out of range for type bigint
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340...
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ERROR: invalid input syntax for type bigint: "- 123"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ERROR: invalid input syntax for type bigint: " 345 5"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('');
+ERROR: invalid input syntax for type bigint: ""
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('');
+ ^
+SELECT * FROM INT8_TBL;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 > q1;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+ plus | minus
+------------------+-------------------
+ 123 | -123
+ 123 | -123
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+ q1 | q2 | plus
+------------------+-------------------+------------------
+ 123 | 456 | 579
+ 123 | 4567890123456789 | 4567890123456912
+ 4567890123456789 | 123 | 4567890123456912
+ 4567890123456789 | 4567890123456789 | 9135780246913578
+ 4567890123456789 | -4567890123456789 | 0
+(5 rows)
+
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+ q1 | q2 | minus
+------------------+-------------------+-------------------
+ 123 | 456 | -333
+ 123 | 4567890123456789 | -4567890123456666
+ 4567890123456789 | 123 | 4567890123456666
+ 4567890123456789 | 4567890123456789 | 0
+ 4567890123456789 | -4567890123456789 | 9135780246913578
+(5 rows)
+
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ERROR: bigint out of range
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+ q1 | q2 | multiply
+------------------+------------------+--------------------
+ 123 | 456 | 56088
+ 123 | 4567890123456789 | 561850485185185047
+ 4567890123456789 | 123 | 561850485185185047
+(3 rows)
+
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+ q1 | q2 | divide | mod
+------------------+-------------------+----------------+-----
+ 123 | 456 | 0 | 123
+ 123 | 4567890123456789 | 0 | 123
+ 4567890123456789 | 123 | 37137318076884 | 57
+ 4567890123456789 | 4567890123456789 | 1 | 0
+ 4567890123456789 | -4567890123456789 | -1 | 0
+(5 rows)
+
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+ plus4
+------------------
+ 160
+ 160
+ 4567890123456826
+ 4567890123456826
+ 4567890123456826
+(5 rows)
+
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+ minus4
+-------------------
+ -86
+ -86
+ -4567890123456752
+ -4567890123456752
+ -4567890123456752
+(5 rows)
+
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+ 8plus4 | 8minus4 | 8mul4 | 8div4
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+ 4plus8 | 4minus8 | 4mul8 | 4div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+ 8plus2 | 8minus2 | 8mul2 | 8div2
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+ 2plus8 | 2minus8 | 2mul8 | 2div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+SELECT q2, abs(q2) FROM INT8_TBL;
+ q2 | abs
+-------------------+------------------
+ 456 | 456
+ 4567890123456789 | 4567890123456789
+ 123 | 123
+ 4567890123456789 | 4567890123456789
+ -4567890123456789 | 4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 456
+ 4567890123456789
+ 123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +456
+ +4567890123456789
+ +123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+ to_char
+--------------------
+ 456TH
+ 4567890123456789TH
+ 123RD
+ 4567890123456789TH
+ <4567890123456789>
+(5 rows)
+
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+ to_char
+---------------------
+ + 456th
+ +4567890123456789th
+ + 123rd
+ +4567890123456789th
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +0000000000000456
+ +4567890123456789
+ +0000000000000123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+ to_char
+-----------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+ to_char
+------------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+ to_char
+--------------------
+ 456.
+ 4567890123456789.
+ 123.
+ 4567890123456789.
+ -4567890123456789.
+(5 rows)
+
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+ to_char
+-------------------------------------------
+ +4 5 6 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ +1 2 3 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ -4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+(5 rows)
+
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+ to_char
+-----------------------------------------------------------
+ text 9999 "text between quote marks" 456
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ text 9999 "text between quote marks" 123
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ -45678 text 9012 9999 345 "text between quote marks" 6789
+(5 rows)
+
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ + 456
+ 456789+0123456789
+ + 123
+ 456789+0123456789
+ 456789-0123456789
+(5 rows)
+
+-- check min/max values and overflow behavior
+select '-9223372036854775808'::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR: value "-9223372036854775809" is out of range for type bigint
+LINE 1: select '-9223372036854775809'::int8;
+ ^
+select '9223372036854775807'::int8;
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR: value "9223372036854775808" is out of range for type bigint
+LINE 1: select '9223372036854775808'::int8;
+ ^
+select -('-9223372036854775807'::int8);
+ ?column?
+---------------------
+ 9223372036854775807
+(1 row)
+
+select -('-9223372036854775808'::int8);
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 / '0'::int8;
+ERROR: division by zero
+select '9223372036854775800'::int8 % '0'::int8;
+ERROR: division by zero
+select abs('-9223372036854775808'::int8);
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '100'::int4;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '100'::int4;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '100'::int4;
+ERROR: bigint out of range
+select '100'::int4 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-100'::int4 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int4 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '100'::int2;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '100'::int2;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '100'::int2;
+ERROR: bigint out of range
+select '-9223372036854775808'::int8 / '0'::int2;
+ERROR: division by zero
+select '100'::int2 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-100'::int2 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int2 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int2 / '0'::int8;
+ERROR: division by zero
+SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
+ int8 | int8
+------+------
+ 42 | -37
+(1 row)
+
+SELECT CAST('36854775807.0'::float4 AS int8);
+ int8
+-------------
+ 36854775808
+(1 row)
+
+SELECT CAST('922337203685477580700.0'::float8 AS int8);
+ERROR: bigint out of range
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ERROR: OID out of range
+SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
+ oid
+------
+ 1259
+(1 row)
+
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+ q1 | q2 | and | or | xor | not
+------------------+-------------------+------------------+------------------+------------------+-------------------
+ 123 | 456 | 72 | 507 | 435 | -124
+ 123 | 4567890123456789 | 17 | 4567890123456895 | 4567890123456878 | -124
+ 4567890123456789 | 123 | 17 | 4567890123456895 | 4567890123456878 | -4567890123456790
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 0 | -4567890123456790
+ 4567890123456789 | -4567890123456789 | 1 | -1 | -2 | -4567890123456790
+(5 rows)
+
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+ q1 | shl | shr
+------------------+-------------------+-----------------
+ 123 | 492 | 15
+ 123 | 492 | 15
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+(5 rows)
+
+-- generate_series
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
+ generate_series
+------------------
+ 4567890123456789
+ 4567890123456790
+ 4567890123456791
+ 4567890123456792
+ 4567890123456793
+ 4567890123456794
+ 4567890123456795
+ 4567890123456796
+ 4567890123456797
+ 4567890123456798
+ 4567890123456799
+(11 rows)
+
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+ERROR: step size cannot equal zero
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
+ generate_series
+------------------
+ 4567890123456789
+ 4567890123456791
+ 4567890123456793
+ 4567890123456795
+ 4567890123456797
+ 4567890123456799
+(6 rows)
+
+-- corner case
+SELECT (-1::int8<<63)::text;
+ text
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT ((-1::int8<<63)+1)::text;
+ text
+----------------------
+ -9223372036854775807
+(1 row)
+
+-- check sane handling of INT64_MIN overflow cases
+SELECT (-9223372036854775808)::int8 * (-1)::int8;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int8;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int8;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-9223372036854775808)::int8 * (-1)::int4;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int4;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-9223372036854775808)::int8 * (-1)::int2;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int2;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int8_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int8_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
+SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+ERROR: bigint out of range
+SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+ERROR: bigint out of range
+SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+ERROR: bigint out of range
+SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
+ERROR: bigint out of range
diff --git a/yql/essentials/tests/postgresql/cases/int8.sql b/yql/essentials/tests/postgresql/cases/int8.sql
new file mode 100644
index 0000000000..55a594b540
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/int8.sql
@@ -0,0 +1,163 @@
+--
+-- INT8
+-- Test int8 64-bit integers.
+--
+CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+-- bad inputs
+INSERT INTO INT8_TBL(q1) VALUES (' ');
+INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+INSERT INTO INT8_TBL(q1) VALUES ('');
+SELECT * FROM INT8_TBL;
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+SELECT * FROM INT8_TBL WHERE 123 > q1;
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+SELECT q2, abs(q2) FROM INT8_TBL;
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+-- check min/max values and overflow behavior
+select '-9223372036854775808'::int8;
+select '-9223372036854775809'::int8;
+select '9223372036854775807'::int8;
+select '9223372036854775808'::int8;
+select -('-9223372036854775807'::int8);
+select -('-9223372036854775808'::int8);
+select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+select '9223372036854775800'::int8 / '0'::int8;
+select '9223372036854775800'::int8 % '0'::int8;
+select abs('-9223372036854775808'::int8);
+select '9223372036854775800'::int8 + '100'::int4;
+select '-9223372036854775800'::int8 - '100'::int4;
+select '9223372036854775800'::int8 * '100'::int4;
+select '100'::int4 + '9223372036854775800'::int8;
+select '-100'::int4 - '9223372036854775800'::int8;
+select '100'::int4 * '9223372036854775800'::int8;
+select '9223372036854775800'::int8 + '100'::int2;
+select '-9223372036854775800'::int8 - '100'::int2;
+select '9223372036854775800'::int8 * '100'::int2;
+select '-9223372036854775808'::int8 / '0'::int2;
+select '100'::int2 + '9223372036854775800'::int8;
+select '-100'::int2 - '9223372036854775800'::int8;
+select '100'::int2 * '9223372036854775800'::int8;
+select '100'::int2 / '0'::int8;
+SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
+SELECT CAST('36854775807.0'::float4 AS int8);
+SELECT CAST('922337203685477580700.0'::float8 AS int8);
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+-- generate_series
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
+-- corner case
+SELECT (-1::int8<<63)::text;
+SELECT ((-1::int8<<63)+1)::text;
+-- check sane handling of INT64_MIN overflow cases
+SELECT (-9223372036854775808)::int8 * (-1)::int8;
+SELECT (-9223372036854775808)::int8 / (-1)::int8;
+SELECT (-9223372036854775808)::int8 % (-1)::int8;
+SELECT (-9223372036854775808)::int8 * (-1)::int4;
+SELECT (-9223372036854775808)::int8 / (-1)::int4;
+SELECT (-9223372036854775808)::int8 % (-1)::int4;
+SELECT (-9223372036854775808)::int8 * (-1)::int2;
+SELECT (-9223372036854775808)::int8 / (-1)::int2;
+SELECT (-9223372036854775808)::int8 % (-1)::int2;
+-- check rounding when casting from float
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+-- check rounding when casting from numeric
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
diff --git a/yql/essentials/tests/postgresql/cases/interval.err b/yql/essentials/tests/postgresql/cases/interval.err
new file mode 100644
index 0000000000..a3ce9924b2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/interval.err
@@ -0,0 +1,998 @@
+<sql-statement>
+--
+-- INTERVAL
+--
+SET DATESTYLE = 'ISO';
+</sql-statement>
+<sql-statement>
+SET IntervalStyle to postgres;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ SET IntervalStyle to postgres;
+ ^
+<sql-statement>
+-- check acceptance of "time zone style"
+SELECT INTERVAL '01:00' AS "One hour";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '+02:00' AS "Two hours";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '-08:00' AS "Eight hours";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '1.5 months' AS "One month 15 days";
+</sql-statement>
+<sql-statement>
+SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
+</sql-statement>
+<sql-statement>
+CREATE TABLE INTERVAL_TBL (f1 interval);
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+</sql-statement>
+<sql-statement>
+-- badly formatted interval
+INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- badly formatted interval
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "badly formatted interval"
+
+ -- badly formatted interval
+ ^
+<sql-statement>
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "@ 30 eons ago"
+
+ INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ ^
+<sql-statement>
+-- test interval operators
+SELECT * FROM INTERVAL_TBL;
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
+</sql-statement>
+<sql-statement>
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
+</sql-statement>
+<sql-statement>
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL r1, INTERVAL_TBL r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT r1.*, r2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT r1.*, r2.*
+ ^
+<sql-statement>
+-- Test intervals that are large enough to overflow 64 bits in comparisons
+CREATE TEMP TABLE INTERVAL_TBL_OF (f1 interval);
+</sql-statement>
+<sql-statement>
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES
+ ('2147483647 days 2147483647 months'),
+ ('2147483647 days -2147483648 months'),
+ ('1 year'),
+ ('-2147483648 days 2147483647 months'),
+ ('-2147483648 days -2147483648 months');
+</sql-statement>
+<sql-statement>
+-- these should fail as out-of-range
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- these should fail as out-of-range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval field value out of range: "2147483648 days"
+
+ -- these should fail as out-of-range
+ ^
+<sql-statement>
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval field value out of range: "-2147483649 days"
+
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+ ^
+<sql-statement>
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval out of range
+
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+ ^
+<sql-statement>
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval out of range
+
+ INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+ ^
+<sql-statement>
+-- Test edge-case overflow detection in interval multiplication
+select extract(epoch from '256 microseconds'::interval * (2^55)::float8);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Test edge-case overflow detection in interval multiplication
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval out of range
+
+ -- Test edge-case overflow detection in interval multiplication
+ ^
+<sql-statement>
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL_OF r1, INTERVAL_TBL_OF r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT r1.*, r2.*
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ SELECT r1.*, r2.*
+ ^
+<sql-statement>
+CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
+</sql-statement>
+<sql-statement>
+SET enable_seqscan TO false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ SET enable_seqscan TO false;
+ ^
+<sql-statement>
+EXPLAIN (COSTS OFF)
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF)
+ ^
+<sql-statement>
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+</sql-statement>
+<sql-statement>
+RESET enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_seqscan;
+ ^
+<sql-statement>
+DROP TABLE INTERVAL_TBL_OF;
+</sql-statement>
+<sql-statement>
+-- Test multiplication and division with intervals.
+-- Floating point arithmetic rounding errors can lead to unexpected results,
+-- though the code attempts to do the right thing and round up to days and
+-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
+-- Note that it is expected for some day components to be greater than 29 and
+-- some time components be greater than 23:59:59 due to how intervals are
+-- stored internally.
+CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
+</sql-statement>
+<sql-statement>
+COPY INTERVAL_MULDIV_TBL FROM STDIN;
+41 mon 12 days 360:00
+-41 mon -12 days +360:00
+-12 days
+9 mon -27 days 12:34:56
+-3 years 482 days 76:54:32.189
+4 mon
+14 mon
+999 mon 999 days
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+SELECT span * 0.3 AS product
+FROM INTERVAL_MULDIV_TBL;
+</sql-statement>
+<sql-statement>
+SELECT span * 8.2 AS product
+FROM INTERVAL_MULDIV_TBL;
+</sql-statement>
+<sql-statement>
+SELECT span / 10 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+</sql-statement>
+<sql-statement>
+SELECT span / 100 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+</sql-statement>
+<sql-statement>
+DROP TABLE INTERVAL_MULDIV_TBL;
+</sql-statement>
+<sql-statement>
+SET DATESTYLE = 'postgres';
+</sql-statement>
+<sql-statement>
+SET IntervalStyle to postgres_verbose;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ SET IntervalStyle to postgres_verbose;
+ ^
+<sql-statement>
+SELECT * FROM INTERVAL_TBL;
+</sql-statement>
+<sql-statement>
+-- test avg(interval), which is somewhat fragile since people have been
+-- known to change the allowed input syntax for type interval without
+-- updating pg_aggregate.agginitval
+select avg(f1) from interval_tbl;
+</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.interval_tbl
+
+<sql-statement>
+-- test long interval input
+select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
+</sql-statement>
+<sql-statement>
+-- test long interval output
+-- Note: the actual maximum length of the interval output is longer,
+-- but we need the test to work for both integer and floating-point
+-- timestamps.
+select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
+</sql-statement>
+<sql-statement>
+-- test justify_hours() and justify_days()
+SELECT justify_hours(interval '6 months 3 days 52 hours 3 minutes 2 seconds') as "6 mons 5 days 4 hours 3 mins 2 seconds";
+</sql-statement>
+<sql-statement>
+SELECT justify_days(interval '6 months 36 days 5 hours 4 minutes 3 seconds') as "7 mons 6 days 5 hours 4 mins 3 seconds";
+</sql-statement>
+<sql-statement>
+-- test justify_interval()
+SELECT justify_interval(interval '1 month -1 hour') as "1 month -1 hour";
+</sql-statement>
+<sql-statement>
+-- test fractional second input, and detection of duplicate units
+SET DATESTYLE = 'ISO';
+</sql-statement>
+<sql-statement>
+SET IntervalStyle TO postgres;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ SET IntervalStyle TO postgres;
+ ^
+<sql-statement>
+SELECT '1 millisecond'::interval, '1 microsecond'::interval,
+ '500 seconds 99 milliseconds 51 microseconds'::interval;
+</sql-statement>
+<sql-statement>
+SELECT '3 days 5 milliseconds'::interval;
+</sql-statement>
+<sql-statement>
+SELECT '1 second 2 seconds'::interval; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1 second 2 seconds'::interval; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 second 2 seconds"
+
+ SELECT '1 second 2 seconds'::interval; -- error
+ ^
+<sql-statement>
+SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "10 milliseconds 20 milliseconds"
+
+ SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+ ^
+<sql-statement>
+SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "5.5 seconds 3 milliseconds"
+
+ SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+ ^
+<sql-statement>
+SELECT '1:20:05 5 microseconds'::interval; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1:20:05 5 microseconds'::interval; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1:20:05 5 microseconds"
+
+ SELECT '1:20:05 5 microseconds'::interval; -- error
+ ^
+<sql-statement>
+SELECT '1 day 1 day'::interval; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1 day 1 day'::interval; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 day 1 day"
+
+ SELECT '1 day 1 day'::interval; -- error
+ ^
+<sql-statement>
+SELECT interval '1-2'; -- SQL year-month literal
+</sql-statement>
+<sql-statement>
+SELECT interval '999' second; -- oversize leading field is ok
+</sql-statement>
+<sql-statement>
+SELECT interval '999' minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '999' hour;
+</sql-statement>
+<sql-statement>
+SELECT interval '999' day;
+</sql-statement>
+<sql-statement>
+SELECT interval '999' month;
+</sql-statement>
+<sql-statement>
+-- test SQL-spec syntaxes for restricted field sets
+SELECT interval '1' year;
+</sql-statement>
+<sql-statement>
+SELECT interval '2' month;
+</sql-statement>
+<sql-statement>
+SELECT interval '3' day;
+</sql-statement>
+<sql-statement>
+SELECT interval '4' hour;
+</sql-statement>
+<sql-statement>
+SELECT interval '5' minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '6' second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1' year to month;
+</sql-statement>
+<sql-statement>
+SELECT interval '1-2' year to month;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' day to hour;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03' day to hour;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' day to hour;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' day to minute;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2' day to minute;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2"
+
+ SELECT interval '1 2' day to minute;
+ ^
+<sql-statement>
+SELECT interval '1 2:03' day to minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' day to minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' day to second;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2' day to second;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2"
+
+ SELECT interval '1 2' day to second;
+ ^
+<sql-statement>
+SELECT interval '1 2:03' day to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' day to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' hour to minute;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2' hour to minute;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2"
+
+ SELECT interval '1 2' hour to minute;
+ ^
+<sql-statement>
+SELECT interval '1 2:03' hour to minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' hour to minute;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' hour to second;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2' hour to second;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2"
+
+ SELECT interval '1 2' hour to second;
+ ^
+<sql-statement>
+SELECT interval '1 2:03' hour to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' hour to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2' minute to second;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2' minute to second;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2"
+
+ SELECT interval '1 2' minute to second;
+ ^
+<sql-statement>
+SELECT interval '1 2:03' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 +2:03' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 +2:03:04' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 -2:03' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1 -2:03:04' minute to second;
+</sql-statement>
+<sql-statement>
+SELECT interval '123 11' day to hour; -- ok
+</sql-statement>
+<sql-statement>
+SELECT interval '123 11' day; -- not ok
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '123 11' day; -- not ok
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "123 11"
+
+ SELECT interval '123 11' day; -- not ok
+ ^
+<sql-statement>
+SELECT interval '123 11'; -- not ok, too ambiguous
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '123 11'; -- not ok, too ambiguous
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "123 11"
+
+ SELECT interval '123 11'; -- not ok, too ambiguous
+ ^
+<sql-statement>
+SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "123 2:03 -2:04"
+
+ SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+ ^
+<sql-statement>
+-- test syntaxes for restricted precision
+SELECT interval(0) '1 day 01:23:45.6789';
+</sql-statement>
+<sql-statement>
+SELECT interval(2) '1 day 01:23:45.6789';
+</sql-statement>
+<sql-statement>
+SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
+</sql-statement>
+<sql-statement>
+SELECT interval '1.234' second;
+</sql-statement>
+<sql-statement>
+SELECT interval '1.234' second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2.345' day to second(2);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2.345' day to second(2);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2.345"
+
+ SELECT interval '1 2.345' day to second(2);
+ ^
+<sql-statement>
+SELECT interval '1 2:03' day to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03.4567' day to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04.5678' day to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2.345' hour to second(2);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2.345' hour to second(2);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2.345"
+
+ SELECT interval '1 2.345' hour to second(2);
+ ^
+<sql-statement>
+SELECT interval '1 2:03.45678' hour to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04.5678' hour to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2.3456' minute to second(2);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT interval '1 2.3456' minute to second(2);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type interval: "1 2.3456"
+
+ SELECT interval '1 2.3456' minute to second(2);
+ ^
+<sql-statement>
+SELECT interval '1 2:03.5678' minute to second(2);
+</sql-statement>
+<sql-statement>
+SELECT interval '1 2:03:04.5678' minute to second(2);
+</sql-statement>
+<sql-statement>
+-- test casting to restricted precision (bug #14479)
+SELECT f1, f1::INTERVAL DAY TO MINUTE AS "minutes",
+ (f1 + INTERVAL '1 month')::INTERVAL MONTH::INTERVAL YEAR AS "years"
+ FROM interval_tbl;
+</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.interval_tbl
+
+<sql-statement>
+-- test inputting and outputting SQL standard interval literals
+SET IntervalStyle TO sql_standard;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test inputting and outputting SQL standard interval literals
+ ^
+<sql-statement>
+SELECT interval '0' AS "zero",
+ interval '1-2' year to month AS "year-month",
+ interval '1 2:03:04' day to second AS "day-time",
+ - interval '1-2' AS "negative year-month",
+ - interval '1 2:03:04' AS "negative day-time";
+</sql-statement>
+<sql-statement>
+-- test input of some not-quite-standard interval values in the sql style
+SET IntervalStyle TO postgres;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test input of some not-quite-standard interval values in the sql style
+ ^
+<sql-statement>
+SELECT interval '+1 -1:00:00',
+ interval '-1 +1:00:00',
+ interval '+1-2 -3 +4:05:06.789',
+ interval '-1-2 +3 -4:05:06.789';
+</sql-statement>
+<sql-statement>
+-- test output of couple non-standard interval values in the sql style
+SET IntervalStyle TO sql_standard;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test output of couple non-standard interval values in the sql style
+ ^
+<sql-statement>
+SELECT interval '1 day -1 hours',
+ interval '-1 days +1 hours',
+ interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds',
+ - interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds';
+</sql-statement>
+<sql-statement>
+-- test outputting iso8601 intervals
+SET IntervalStyle to iso_8601;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test outputting iso8601 intervals
+ ^
+<sql-statement>
+select interval '0' AS "zero",
+ interval '1-2' AS "a year 2 months",
+ interval '1 2:03:04' AS "a bit over a day",
+ interval '2:03:04.45679' AS "a bit over 2 hours",
+ (interval '1-2' + interval '3 4:05:06.7') AS "all fields",
+ (interval '1-2' - interval '3 4:05:06.7') AS "mixed sign",
+ (- interval '1-2' + interval '3 4:05:06.7') AS "negative";
+</sql-statement>
+<sql-statement>
+-- test inputting ISO 8601 4.4.2.1 "Format With Time Unit Designators"
+SET IntervalStyle to sql_standard;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test inputting ISO 8601 4.4.2.1 "Format With Time Unit Designators"
+ ^
+<sql-statement>
+select interval 'P0Y' AS "zero",
+ interval 'P1Y2M' AS "a year 2 months",
+ interval 'P1W' AS "a week",
+ interval 'P1DT2H3M4S' AS "a bit over a day",
+ interval 'P1Y2M3DT4H5M6.7S' AS "all fields",
+ interval 'P-1Y-2M-3DT-4H-5M-6.7S' AS "negative",
+ interval 'PT-0.1S' AS "fractional second";
+</sql-statement>
+<sql-statement>
+-- test inputting ISO 8601 4.4.2.2 "Alternative Format"
+SET IntervalStyle to postgres;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test inputting ISO 8601 4.4.2.2 "Alternative Format"
+ ^
+<sql-statement>
+select interval 'P00021015T103020' AS "ISO8601 Basic Format",
+ interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
+</sql-statement>
+<sql-statement>
+-- Make sure optional ISO8601 alternative format fields are optional.
+select interval 'P0002' AS "year only",
+ interval 'P0002-10' AS "year month",
+ interval 'P0002-10-15' AS "year month day",
+ interval 'P0002T1S' AS "year only plus time",
+ interval 'P0002-10T1S' AS "year month plus time",
+ interval 'P0002-10-15T1S' AS "year month day plus time",
+ interval 'PT10' AS "hour only",
+ interval 'PT10:30' AS "hour minute";
+</sql-statement>
+<sql-statement>
+-- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
+SET IntervalStyle to postgres_verbose;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: IntervalStyle
+ -- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
+ ^
+<sql-statement>
+select interval '-10 mons -3 days +03:55:06.70';
+</sql-statement>
+<sql-statement>
+select interval '1 year 2 mons 3 days 04:05:06.699999';
+</sql-statement>
+<sql-statement>
+select interval '0:0:0.7', interval '@ 0.70 secs', interval '0.7 seconds';
+</sql-statement>
+<sql-statement>
+-- check that '30 days' equals '1 month' according to the hash function
+select '30 days'::interval = '1 month'::interval as t;
+</sql-statement>
+<sql-statement>
+select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
+</sql-statement>
+<sql-statement>
+-- numeric constructor
+select make_interval(years := 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: alternative is not implemented yet : 118
+ select make_interval(years := 2);
+ ^
+<sql-statement>
+select make_interval(years := 1, months := 6);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(years := 1, months := 6);
+ ^
+<sql-statement>
+select make_interval(years := 1, months := -1, weeks := 5, days := -7, hours := 25, mins := -180);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(years := 1, months := -1, weeks := 5, days := -7, hours := 25, mins := -180);
+ ^
+<sql-statement>
+select make_interval() = make_interval(years := 0, months := 0, weeks := 0, days := 0, mins := 0, secs := 0.0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:26: Error: alternative is not implemented yet : 118
+ select make_interval() = make_interval(years := 0, months := 0, weeks := 0, days := 0, mins := 0, secs := 0.0);
+ ^
+<sql-statement>
+select make_interval(hours := -2, mins := -10, secs := -25.3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(hours := -2, mins := -10, secs := -25.3);
+ ^
+<sql-statement>
+select make_interval(years := 'inf'::float::int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(years := 'inf'::float::int);
+ ^
+<sql-statement>
+select make_interval(months := 'NaN'::float::int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(months := 'NaN'::float::int);
+ ^
+<sql-statement>
+select make_interval(secs := 'inf');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(secs := 'inf');
+ ^
+<sql-statement>
+select make_interval(secs := 'NaN');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(secs := 'NaN');
+ ^
+<sql-statement>
+select make_interval(secs := 7e12);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select make_interval(secs := 7e12);
+ ^
+<sql-statement>
+--
+-- test EXTRACT
+--
+SELECT f1,
+ EXTRACT(MICROSECOND FROM f1) AS MICROSECOND,
+ EXTRACT(MILLISECOND FROM f1) AS MILLISECOND,
+ EXTRACT(SECOND FROM f1) AS SECOND,
+ EXTRACT(MINUTE FROM f1) AS MINUTE,
+ EXTRACT(HOUR FROM f1) AS HOUR,
+ EXTRACT(DAY FROM f1) AS DAY,
+ EXTRACT(MONTH FROM f1) AS MONTH,
+ EXTRACT(QUARTER FROM f1) AS QUARTER,
+ EXTRACT(YEAR FROM f1) AS YEAR,
+ EXTRACT(DECADE FROM f1) AS DECADE,
+ EXTRACT(CENTURY FROM f1) AS CENTURY,
+ EXTRACT(MILLENNIUM FROM f1) AS MILLENNIUM,
+ EXTRACT(EPOCH FROM f1) AS EPOCH
+ FROM INTERVAL_TBL;
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval units "fortnight" not recognized
+
+ SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: interval units "timezone" not supported
+
+ SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(DECADE FROM INTERVAL '100 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM INTERVAL '99 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM INTERVAL '-99 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DECADE FROM INTERVAL '-100 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM INTERVAL '100 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM INTERVAL '99 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM INTERVAL '-99 y');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(CENTURY FROM INTERVAL '-100 y');
+</sql-statement>
+<sql-statement>
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT f1,
+ date_part('microsecond', f1) AS microsecond,
+ date_part('millisecond', f1) AS millisecond,
+ date_part('second', f1) AS second,
+ date_part('epoch', f1) AS epoch
+ FROM INTERVAL_TBL;
+</sql-statement>
+<sql-statement>
+-- internal overflow test case
+SELECT extract(epoch from interval '1000000000 days');
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/interval.out b/yql/essentials/tests/postgresql/cases/interval.out
new file mode 100644
index 0000000000..26f1353402
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/interval.out
@@ -0,0 +1,630 @@
+--
+-- INTERVAL
+--
+SET DATESTYLE = 'ISO';
+-- check acceptance of "time zone style"
+SELECT INTERVAL '01:00' AS "One hour";
+ One hour
+----------
+ 01:00:00
+(1 row)
+
+SELECT INTERVAL '+02:00' AS "Two hours";
+ Two hours
+-----------
+ 02:00:00
+(1 row)
+
+SELECT INTERVAL '-08:00' AS "Eight hours";
+ Eight hours
+-------------
+ -08:00:00
+(1 row)
+
+SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
+ 22 hours ago...
+-------------------
+ -1 days +02:03:00
+(1 row)
+
+SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
+ 22 hours ago...
+-------------------
+ -1 days +02:03:00
+(1 row)
+
+SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
+ Ten days twelve hours
+-----------------------
+ 10 days 12:00:00
+(1 row)
+
+SELECT INTERVAL '1.5 months' AS "One month 15 days";
+ One month 15 days
+-------------------
+ 1 mon 15 days
+(1 row)
+
+SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
+ 9 years...
+----------------------------------
+ 9 years 1 mon -12 days +13:14:00
+(1 row)
+
+CREATE TABLE INTERVAL_TBL (f1 interval);
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+-- badly formatted interval
+INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
+ERROR: invalid input syntax for type interval: "badly formatted interval"
+LINE 1: INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted inter...
+ ^
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ERROR: invalid input syntax for type interval: "@ 30 eons ago"
+LINE 1: INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ ^
+-- test interval operators
+SELECT * FROM INTERVAL_TBL;
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 10 days
+ 34 years
+ 3 mons
+ -00:00:14
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(10 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 34 years
+ 3 mons
+ -00:00:14
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(9 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
+ f1
+-----------
+ 00:01:00
+ 05:00:00
+ -00:00:14
+(3 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
+ f1
+-----------
+ 00:01:00
+ 05:00:00
+ -00:00:14
+(3 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
+ f1
+----------
+ 34 years
+(1 row)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
+ f1
+-----------------
+ 34 years
+ 3 mons
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(5 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 10 days
+ 34 years
+ 3 mons
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(9 rows)
+
+-- Test intervals that are large enough to overflow 64 bits in comparisons
+CREATE TEMP TABLE INTERVAL_TBL_OF (f1 interval);
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES
+ ('2147483647 days 2147483647 months'),
+ ('2147483647 days -2147483648 months'),
+ ('1 year'),
+ ('-2147483648 days 2147483647 months'),
+ ('-2147483648 days -2147483648 months');
+-- these should fail as out-of-range
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+ERROR: interval field value out of range: "2147483648 days"
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+ERROR: interval field value out of range: "-2147483649 days"
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days')...
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+ERROR: interval out of range
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years')...
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+ERROR: interval out of range
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years'...
+ ^
+-- Test edge-case overflow detection in interval multiplication
+select extract(epoch from '256 microseconds'::interval * (2^55)::float8);
+ERROR: interval out of range
+CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
+DROP TABLE INTERVAL_TBL_OF;
+-- Test multiplication and division with intervals.
+-- Floating point arithmetic rounding errors can lead to unexpected results,
+-- though the code attempts to do the right thing and round up to days and
+-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
+-- Note that it is expected for some day components to be greater than 29 and
+-- some time components be greater than 23:59:59 due to how intervals are
+-- stored internally.
+CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
+DROP TABLE INTERVAL_MULDIV_TBL;
+SET DATESTYLE = 'postgres';
+-- test fractional second input, and detection of duplicate units
+SET DATESTYLE = 'ISO';
+SELECT '1 millisecond'::interval, '1 microsecond'::interval,
+ '500 seconds 99 milliseconds 51 microseconds'::interval;
+ interval | interval | interval
+--------------+-----------------+-----------------
+ 00:00:00.001 | 00:00:00.000001 | 00:08:20.099051
+(1 row)
+
+SELECT '3 days 5 milliseconds'::interval;
+ interval
+---------------------
+ 3 days 00:00:00.005
+(1 row)
+
+SELECT '1 second 2 seconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "1 second 2 seconds"
+LINE 1: SELECT '1 second 2 seconds'::interval;
+ ^
+SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "10 milliseconds 20 milliseconds"
+LINE 1: SELECT '10 milliseconds 20 milliseconds'::interval;
+ ^
+SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "5.5 seconds 3 milliseconds"
+LINE 1: SELECT '5.5 seconds 3 milliseconds'::interval;
+ ^
+SELECT '1:20:05 5 microseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "1:20:05 5 microseconds"
+LINE 1: SELECT '1:20:05 5 microseconds'::interval;
+ ^
+SELECT '1 day 1 day'::interval; -- error
+ERROR: invalid input syntax for type interval: "1 day 1 day"
+LINE 1: SELECT '1 day 1 day'::interval;
+ ^
+SELECT interval '1-2'; -- SQL year-month literal
+ interval
+---------------
+ 1 year 2 mons
+(1 row)
+
+SELECT interval '999' second; -- oversize leading field is ok
+ interval
+----------
+ 00:16:39
+(1 row)
+
+SELECT interval '999' minute;
+ interval
+----------
+ 16:39:00
+(1 row)
+
+SELECT interval '999' hour;
+ interval
+-----------
+ 999:00:00
+(1 row)
+
+SELECT interval '999' day;
+ interval
+----------
+ 999 days
+(1 row)
+
+SELECT interval '999' month;
+ interval
+-----------------
+ 83 years 3 mons
+(1 row)
+
+-- test SQL-spec syntaxes for restricted field sets
+SELECT interval '1' year;
+ interval
+----------
+ 1 year
+(1 row)
+
+SELECT interval '2' month;
+ interval
+----------
+ 2 mons
+(1 row)
+
+SELECT interval '3' day;
+ interval
+----------
+ 3 days
+(1 row)
+
+SELECT interval '4' hour;
+ interval
+----------
+ 04:00:00
+(1 row)
+
+SELECT interval '5' minute;
+ interval
+----------
+ 00:05:00
+(1 row)
+
+SELECT interval '6' second;
+ interval
+----------
+ 00:00:06
+(1 row)
+
+SELECT interval '1' year to month;
+ interval
+----------
+ 1 mon
+(1 row)
+
+SELECT interval '1-2' year to month;
+ interval
+---------------
+ 1 year 2 mons
+(1 row)
+
+SELECT interval '1 2' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2:03' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2' day to minute;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to minute;
+ ^
+SELECT interval '1 2:03' day to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2' day to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to second;
+ ^
+SELECT interval '1 2:03' day to second;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 2' hour to minute;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' hour to minute;
+ ^
+SELECT interval '1 2:03' hour to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' hour to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2' hour to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' hour to second;
+ ^
+SELECT interval '1 2:03' hour to second;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' hour to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 2' minute to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' minute to second;
+ ^
+SELECT interval '1 2:03' minute to second;
+ interval
+----------------
+ 1 day 00:02:03
+(1 row)
+
+SELECT interval '1 2:03:04' minute to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 +2:03' minute to second;
+ interval
+----------------
+ 1 day 00:02:03
+(1 row)
+
+SELECT interval '1 +2:03:04' minute to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 -2:03' minute to second;
+ interval
+-----------------
+ 1 day -00:02:03
+(1 row)
+
+SELECT interval '1 -2:03:04' minute to second;
+ interval
+-----------------
+ 1 day -02:03:04
+(1 row)
+
+SELECT interval '123 11' day to hour; -- ok
+ interval
+-------------------
+ 123 days 11:00:00
+(1 row)
+
+SELECT interval '123 11' day; -- not ok
+ERROR: invalid input syntax for type interval: "123 11"
+LINE 1: SELECT interval '123 11' day;
+ ^
+SELECT interval '123 11'; -- not ok, too ambiguous
+ERROR: invalid input syntax for type interval: "123 11"
+LINE 1: SELECT interval '123 11';
+ ^
+SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+ERROR: invalid input syntax for type interval: "123 2:03 -2:04"
+LINE 1: SELECT interval '123 2:03 -2:04';
+ ^
+-- test syntaxes for restricted precision
+SELECT interval(0) '1 day 01:23:45.6789';
+ interval
+----------------
+ 1 day 01:23:46
+(1 row)
+
+SELECT interval(2) '1 day 01:23:45.6789';
+ interval
+-------------------
+ 1 day 01:23:45.68
+(1 row)
+
+SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
+ interval
+-------------
+ 00:12:34.57
+(1 row)
+
+SELECT interval '1.234' second;
+ interval
+--------------
+ 00:00:01.234
+(1 row)
+
+SELECT interval '1.234' second(2);
+ interval
+-------------
+ 00:00:01.23
+(1 row)
+
+SELECT interval '1 2.345' day to second(2);
+ERROR: invalid input syntax for type interval: "1 2.345"
+LINE 1: SELECT interval '1 2.345' day to second(2);
+ ^
+SELECT interval '1 2:03' day to second(2);
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03.4567' day to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.46
+(1 row)
+
+SELECT interval '1 2:03:04.5678' day to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+SELECT interval '1 2.345' hour to second(2);
+ERROR: invalid input syntax for type interval: "1 2.345"
+LINE 1: SELECT interval '1 2.345' hour to second(2);
+ ^
+SELECT interval '1 2:03.45678' hour to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.46
+(1 row)
+
+SELECT interval '1 2:03:04.5678' hour to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+SELECT interval '1 2.3456' minute to second(2);
+ERROR: invalid input syntax for type interval: "1 2.3456"
+LINE 1: SELECT interval '1 2.3456' minute to second(2);
+ ^
+SELECT interval '1 2:03.5678' minute to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.57
+(1 row)
+
+SELECT interval '1 2:03:04.5678' minute to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+SELECT interval '+1 -1:00:00',
+ interval '-1 +1:00:00',
+ interval '+1-2 -3 +4:05:06.789',
+ interval '-1-2 +3 -4:05:06.789';
+ interval | interval | interval | interval
+-----------------+-------------------+-------------------------------------+----------------------------------------
+ 1 day -01:00:00 | -1 days +01:00:00 | 1 year 2 mons -3 days +04:05:06.789 | -1 years -2 mons +3 days -04:05:06.789
+(1 row)
+
+select interval 'P00021015T103020' AS "ISO8601 Basic Format",
+ interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
+ ISO8601 Basic Format | ISO8601 Extended Format
+----------------------------------+----------------------------------
+ 2 years 10 mons 15 days 10:30:20 | 2 years 10 mons 15 days 10:30:20
+(1 row)
+
+-- Make sure optional ISO8601 alternative format fields are optional.
+select interval 'P0002' AS "year only",
+ interval 'P0002-10' AS "year month",
+ interval 'P0002-10-15' AS "year month day",
+ interval 'P0002T1S' AS "year only plus time",
+ interval 'P0002-10T1S' AS "year month plus time",
+ interval 'P0002-10-15T1S' AS "year month day plus time",
+ interval 'PT10' AS "hour only",
+ interval 'PT10:30' AS "hour minute";
+ year only | year month | year month day | year only plus time | year month plus time | year month day plus time | hour only | hour minute
+-----------+-----------------+-------------------------+---------------------+--------------------------+----------------------------------+-----------+-------------
+ 2 years | 2 years 10 mons | 2 years 10 mons 15 days | 2 years 00:00:01 | 2 years 10 mons 00:00:01 | 2 years 10 mons 15 days 00:00:01 | 10:00:00 | 10:30:00
+(1 row)
+
+-- check that '30 days' equals '1 month' according to the hash function
+select '30 days'::interval = '1 month'::interval as t;
+ t
+---
+ t
+(1 row)
+
+select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
+ t
+---
+ t
+(1 row)
+
+SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+ERROR: interval units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+ERROR: interval units "timezone" not supported
+SELECT EXTRACT(DECADE FROM INTERVAL '100 y');
+ extract
+---------
+ 10
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '99 y');
+ extract
+---------
+ 9
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '-99 y');
+ extract
+---------
+ -9
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '-100 y');
+ extract
+---------
+ -10
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '100 y');
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '-100 y');
+ extract
+---------
+ -1
+(1 row)
+
+-- internal overflow test case
+SELECT extract(epoch from interval '1000000000 days');
+ extract
+-----------------------
+ 86400000000000.000000
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/interval.sql b/yql/essentials/tests/postgresql/cases/interval.sql
new file mode 100644
index 0000000000..f44f0f4fef
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/interval.sql
@@ -0,0 +1,163 @@
+--
+-- INTERVAL
+--
+SET DATESTYLE = 'ISO';
+-- check acceptance of "time zone style"
+SELECT INTERVAL '01:00' AS "One hour";
+SELECT INTERVAL '+02:00' AS "Two hours";
+SELECT INTERVAL '-08:00' AS "Eight hours";
+SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
+SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
+SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
+SELECT INTERVAL '1.5 months' AS "One month 15 days";
+SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
+CREATE TABLE INTERVAL_TBL (f1 interval);
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+-- badly formatted interval
+INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+-- test interval operators
+SELECT * FROM INTERVAL_TBL;
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
+-- Test intervals that are large enough to overflow 64 bits in comparisons
+CREATE TEMP TABLE INTERVAL_TBL_OF (f1 interval);
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES
+ ('2147483647 days 2147483647 months'),
+ ('2147483647 days -2147483648 months'),
+ ('1 year'),
+ ('-2147483648 days 2147483647 months'),
+ ('-2147483648 days -2147483648 months');
+-- these should fail as out-of-range
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+-- Test edge-case overflow detection in interval multiplication
+select extract(epoch from '256 microseconds'::interval * (2^55)::float8);
+CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
+DROP TABLE INTERVAL_TBL_OF;
+-- Test multiplication and division with intervals.
+-- Floating point arithmetic rounding errors can lead to unexpected results,
+-- though the code attempts to do the right thing and round up to days and
+-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
+-- Note that it is expected for some day components to be greater than 29 and
+-- some time components be greater than 23:59:59 due to how intervals are
+-- stored internally.
+CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
+DROP TABLE INTERVAL_MULDIV_TBL;
+SET DATESTYLE = 'postgres';
+-- test fractional second input, and detection of duplicate units
+SET DATESTYLE = 'ISO';
+SELECT '1 millisecond'::interval, '1 microsecond'::interval,
+ '500 seconds 99 milliseconds 51 microseconds'::interval;
+SELECT '3 days 5 milliseconds'::interval;
+SELECT '1 second 2 seconds'::interval; -- error
+SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+SELECT '1:20:05 5 microseconds'::interval; -- error
+SELECT '1 day 1 day'::interval; -- error
+SELECT interval '1-2'; -- SQL year-month literal
+SELECT interval '999' second; -- oversize leading field is ok
+SELECT interval '999' minute;
+SELECT interval '999' hour;
+SELECT interval '999' day;
+SELECT interval '999' month;
+-- test SQL-spec syntaxes for restricted field sets
+SELECT interval '1' year;
+SELECT interval '2' month;
+SELECT interval '3' day;
+SELECT interval '4' hour;
+SELECT interval '5' minute;
+SELECT interval '6' second;
+SELECT interval '1' year to month;
+SELECT interval '1-2' year to month;
+SELECT interval '1 2' day to hour;
+SELECT interval '1 2:03' day to hour;
+SELECT interval '1 2:03:04' day to hour;
+SELECT interval '1 2' day to minute;
+SELECT interval '1 2:03' day to minute;
+SELECT interval '1 2:03:04' day to minute;
+SELECT interval '1 2' day to second;
+SELECT interval '1 2:03' day to second;
+SELECT interval '1 2:03:04' day to second;
+SELECT interval '1 2' hour to minute;
+SELECT interval '1 2:03' hour to minute;
+SELECT interval '1 2:03:04' hour to minute;
+SELECT interval '1 2' hour to second;
+SELECT interval '1 2:03' hour to second;
+SELECT interval '1 2:03:04' hour to second;
+SELECT interval '1 2' minute to second;
+SELECT interval '1 2:03' minute to second;
+SELECT interval '1 2:03:04' minute to second;
+SELECT interval '1 +2:03' minute to second;
+SELECT interval '1 +2:03:04' minute to second;
+SELECT interval '1 -2:03' minute to second;
+SELECT interval '1 -2:03:04' minute to second;
+SELECT interval '123 11' day to hour; -- ok
+SELECT interval '123 11' day; -- not ok
+SELECT interval '123 11'; -- not ok, too ambiguous
+SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+-- test syntaxes for restricted precision
+SELECT interval(0) '1 day 01:23:45.6789';
+SELECT interval(2) '1 day 01:23:45.6789';
+SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
+SELECT interval '1.234' second;
+SELECT interval '1.234' second(2);
+SELECT interval '1 2.345' day to second(2);
+SELECT interval '1 2:03' day to second(2);
+SELECT interval '1 2:03.4567' day to second(2);
+SELECT interval '1 2:03:04.5678' day to second(2);
+SELECT interval '1 2.345' hour to second(2);
+SELECT interval '1 2:03.45678' hour to second(2);
+SELECT interval '1 2:03:04.5678' hour to second(2);
+SELECT interval '1 2.3456' minute to second(2);
+SELECT interval '1 2:03.5678' minute to second(2);
+SELECT interval '1 2:03:04.5678' minute to second(2);
+SELECT interval '+1 -1:00:00',
+ interval '-1 +1:00:00',
+ interval '+1-2 -3 +4:05:06.789',
+ interval '-1-2 +3 -4:05:06.789';
+select interval 'P00021015T103020' AS "ISO8601 Basic Format",
+ interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
+-- Make sure optional ISO8601 alternative format fields are optional.
+select interval 'P0002' AS "year only",
+ interval 'P0002-10' AS "year month",
+ interval 'P0002-10-15' AS "year month day",
+ interval 'P0002T1S' AS "year only plus time",
+ interval 'P0002-10T1S' AS "year month plus time",
+ interval 'P0002-10-15T1S' AS "year month day plus time",
+ interval 'PT10' AS "hour only",
+ interval 'PT10:30' AS "hour minute";
+-- check that '30 days' equals '1 month' according to the hash function
+select '30 days'::interval = '1 month'::interval as t;
+select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
+SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+SELECT EXTRACT(DECADE FROM INTERVAL '100 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '99 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '-99 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '-100 y');
+SELECT EXTRACT(CENTURY FROM INTERVAL '100 y');
+SELECT EXTRACT(CENTURY FROM INTERVAL '-100 y');
+-- internal overflow test case
+SELECT extract(epoch from interval '1000000000 days');
diff --git a/yql/essentials/tests/postgresql/cases/join.err b/yql/essentials/tests/postgresql/cases/join.err
new file mode 100644
index 0000000000..ae0fa136b8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/join.err
@@ -0,0 +1,5097 @@
+Registering pre-existing tables
+ onek
+ int4_tbl
+ INT4_TBL
+ tenk1
+ text_tbl
+ float8_tbl
+ INT2_TBL
+ tenk2
+ int2_tbl
+ TEXT_TBL
+ FLOAT8_TBL
+ int8_tbl
+<sql-statement>
+--
+-- JOIN
+-- Test JOIN clauses
+--
+CREATE TABLE J1_TBL (
+ i integer,
+ j integer,
+ t text
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE J2_TBL (
+ i integer,
+ k integer
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (1, 4, 'one');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (2, 3, 'two');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (3, 2, 'three');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (4, 1, 'four');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (5, 0, 'five');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (6, 6, 'six');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (7, 7, 'seven');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (8, 8, 'eight');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
+</sql-statement>
+<sql-statement>
+INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (1, -1);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (2, 2);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (3, -3);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (2, 4);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (5, -5);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (5, -5);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (0, NULL);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (NULL, NULL);
+</sql-statement>
+<sql-statement>
+INSERT INTO J2_TBL VALUES (NULL, 0);
+</sql-statement>
+<sql-statement>
+-- useful in some tests below
+create temp table onerow();
+</sql-statement>
+<sql-statement>
+insert into onerow default values;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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>
+analyze onerow;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze onerow;
+ ^
+<sql-statement>
+--
+-- CORRELATION NAMES
+-- Make sure that table/column aliases are supported
+-- before diving into more complex join syntax.
+--
+SELECT *
+ FROM J1_TBL AS tx;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL tx;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL AS t1 (a, b, c);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e);
+</sql-statement>
+<sql-statement>
+SELECT t1.a, t2.e
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
+ WHERE t1.a = t2.d;
+</sql-statement>
+<sql-statement>
+--
+-- CROSS JOIN
+-- Qualifications are not allowed on cross joins,
+-- which degenerate into a standard unqualified inner join.
+--
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ --
+ ^
+<sql-statement>
+-- ambiguous column
+SELECT i, k, t
+ FROM J1_TBL CROSS JOIN J2_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- ambiguous column
+ ^
+ -stdin-:<main>:2:8: Error: Column reference is ambiguous: i
+ SELECT i, k, t
+ ^
+<sql-statement>
+-- resolve previous ambiguity by specifying the table name
+SELECT t1.i, k, t
+ FROM J1_TBL t1 CROSS JOIN J2_TBL t2;
+</sql-statement>
+<sql-statement>
+SELECT ii, tt, kk
+ FROM (J1_TBL CROSS JOIN J2_TBL)
+ AS tx (ii, jj, tt, ii2, kk);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ SELECT ii, tt, kk
+ ^
+<sql-statement>
+SELECT tx.ii, tx.jj, tx.kk
+ FROM (J1_TBL t1 (a, b, c) CROSS JOIN J2_TBL t2 (d, e))
+ AS tx (ii, jj, tt, ii2, kk);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ SELECT tx.ii, tx.jj, tx.kk
+ ^
+<sql-statement>
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ SELECT *
+ ^
+<sql-statement>
+--
+--
+-- Inner joins (equi-joins)
+--
+--
+--
+-- Inner joins (equi-joins) with USING clause
+-- The USING syntax changes the shape of the resulting table
+-- by including a column in the USING clause only once in the result.
+--
+-- Inner equi-join on specified column
+SELECT *
+ FROM J1_TBL INNER JOIN J2_TBL USING (i);
+</sql-statement>
+<sql-statement>
+-- Same as above, slightly different syntax
+SELECT *
+ FROM J1_TBL JOIN J2_TBL USING (i);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
+ ORDER BY a, d;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, b) USING (b)
+ ORDER BY b, t1.a;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ SELECT *
+ ^
+<sql-statement>
+-- test join using aliases
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) WHERE J1_TBL.t = 'one'; -- ok
+</sql-statement>
+<sql-statement>
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one'; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one'; -- ok
+ ^
+<sql-statement>
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i)) AS x WHERE J1_TBL.t = 'one'; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ SELECT * FROM (J1_TBL JOIN J2_TBL USING (i)) AS x WHERE J1_TBL.t = 'one'; -- error
+ ^
+<sql-statement>
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.i = 1; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.i = 1; -- ok
+ ^
+<sql-statement>
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.t = 'one'; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.t = 'one'; -- error
+ ^
+<sql-statement>
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i) AS x) AS xx WHERE x.i = 1; -- error (XXX could use better hint)
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ SELECT * FROM (J1_TBL JOIN J2_TBL USING (i) AS x) AS xx WHERE x.i = 1; -- error (XXX could use better hint)
+ ^
+<sql-statement>
+SELECT * FROM J1_TBL a1 JOIN J2_TBL a2 USING (i) AS a1; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT * FROM J1_TBL a1 JOIN J2_TBL a2 USING (i) AS a1; -- error
+ ^
+<sql-statement>
+SELECT x.* FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT x.* FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ ^
+<sql-statement>
+SELECT ROW(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT ROW(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ ^
+<sql-statement>
+SELECT row_to_json(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ SELECT row_to_json(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ ^
+<sql-statement>
+--
+-- NATURAL JOIN
+-- Inner equi-join on all columns with the same name
+--
+SELECT *
+ FROM J1_TBL NATURAL JOIN J2_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ --
+ ^
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT *
+ ^
+<sql-statement>
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT *
+ ^
+<sql-statement>
+-- mismatch number of columns
+-- currently, Postgres will fill in with underlying names
+SELECT *
+ FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ -- mismatch number of columns
+ ^
+<sql-statement>
+--
+-- Inner joins (equi-joins)
+--
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ --
+ ^
+<sql-statement>
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ SELECT *
+ ^
+<sql-statement>
+--
+-- Non-equi-joins
+--
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i <= J2_TBL.k);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: i
+ --
+ ^
+<sql-statement>
+--
+-- Outer joins
+-- Note that OUTER is a noise word
+--
+SELECT *
+ FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL RIGHT JOIN J2_TBL USING (i);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL FULL JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1);
+</sql-statement>
+<sql-statement>
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (i = 1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT *
+ ^
+ -stdin-:<main>:2:49: Error: Column reference is ambiguous: i
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (i = 1);
+ ^
+<sql-statement>
+--
+-- semijoin selectivity for <>
+--
+explain (costs off)
+select * from int4_tbl i4, tenk1 a
+where exists(select * from tenk1 b
+ where a.twothousand = b.twothousand and a.fivethous <> b.fivethous)
+ and i4.f1 = a.tenthous;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+--
+-- More complicated constructs
+--
+--
+-- Multiway full join
+--
+CREATE TABLE t1 (name TEXT, n INTEGER);
+</sql-statement>
+<sql-statement>
+CREATE TABLE t2 (name TEXT, n INTEGER);
+</sql-statement>
+<sql-statement>
+CREATE TABLE t3 (name TEXT, n INTEGER);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES ( 'bb', 11 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t2 VALUES ( 'bb', 12 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t2 VALUES ( 'cc', 22 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t2 VALUES ( 'ee', 42 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES ( 'bb', 13 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES ( 'cc', 23 );
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES ( 'dd', 33 );
+</sql-statement>
+<sql-statement>
+SELECT * FROM t1 FULL JOIN t2 USING (name) FULL JOIN t3 USING (name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM t1 FULL JOIN t2 USING (name) FULL JOIN t3 USING (name);
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: n
+ SELECT * FROM t1 FULL JOIN t2 USING (name) FULL JOIN t3 USING (name);
+ ^
+<sql-statement>
+--
+-- Test interactions of join syntax and subqueries
+--
+-- Basic cases (we expect planner to pull up the subquery here)
+SELECT * FROM
+(SELECT * FROM t2) as s2
+INNER JOIN
+(SELECT * FROM t3) s3
+USING (name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: n
+ --
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT * FROM t2) as s2
+LEFT JOIN
+(SELECT * FROM t3) s3
+USING (name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: n
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT * FROM t2) as s2
+FULL JOIN
+(SELECT * FROM t3) s3
+USING (name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: n
+ SELECT * FROM
+ ^
+<sql-statement>
+-- Cases with non-nullable expressions in subquery results;
+-- make sure these go to null as expected
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ -- Cases with non-nullable expressions in subquery results;
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL LEFT JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL INNER JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL FULL JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported isNatural
+ SELECT * FROM
+ ^
+<sql-statement>
+-- Constants as join keys can also be problematic
+SELECT * FROM
+ (SELECT name, n as s1_n FROM t1) as s1
+FULL JOIN
+ (SELECT name, 2 as s2_n FROM t2) as s2
+ON (s1_n = s2_n);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Constants as join keys can also be problematic
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: name
+ -- Constants as join keys can also be problematic
+ ^
+<sql-statement>
+-- Test for propagation of nullability constraints into sub-joins
+create temp table x (x1 int, x2 int);
+</sql-statement>
+<sql-statement>
+insert into x values (1,11);
+</sql-statement>
+<sql-statement>
+insert into x values (2,22);
+</sql-statement>
+<sql-statement>
+insert into x values (3,null);
+</sql-statement>
+<sql-statement>
+insert into x values (4,44);
+</sql-statement>
+<sql-statement>
+insert into x values (5,null);
+</sql-statement>
+<sql-statement>
+create temp table y (y1 int, y2 int);
+</sql-statement>
+<sql-statement>
+insert into y values (1,111);
+</sql-statement>
+<sql-statement>
+insert into y values (2,222);
+</sql-statement>
+<sql-statement>
+insert into y values (3,333);
+</sql-statement>
+<sql-statement>
+insert into y values (4,null);
+</sql-statement>
+<sql-statement>
+select * from x;
+</sql-statement>
+<sql-statement>
+select * from y;
+</sql-statement>
+<sql-statement>
+select * from x left join y on (x1 = y1 and x2 is not null);
+</sql-statement>
+<sql-statement>
+select * from x left join y on (x1 = y1 and y2 is not null);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and x2 is not null);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and y2 is not null);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and xx2 is not null);
+</sql-statement>
+<sql-statement>
+-- these should NOT give the same answers as above
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (x2 is not null);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (y2 is not null);
+</sql-statement>
+<sql-statement>
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (xx2 is not null);
+</sql-statement>
+<sql-statement>
+--
+-- regression test: check for bug with propagation of implied equality
+-- to outside an IN
+--
+select count(*) from tenk1 a where unique1 in
+ (select unique1 from tenk1 b join tenk1 c using (unique1)
+ where b.unique2 = 42);
+</sql-statement>
+<sql-statement>
+--
+-- regression test: check for failure to generate a plan with multiple
+-- degenerate IN clauses
+--
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+</sql-statement>
+<sql-statement>
+-- try that with GEQO too
+begin;
+</sql-statement>
+<sql-statement>
+set geqo = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: geqo
+ set geqo = on;
+ ^
+<sql-statement>
+set geqo_threshold = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: geqo_threshold
+ set geqo_threshold = 2;
+ ^
+<sql-statement>
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+</sql-statement>
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- regression test: be sure we cope with proven-dummy append rels
+--
+explain (costs off)
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+</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.b
+
+<sql-statement>
+--
+-- regression test: check handling of empty-FROM subquery underneath outer join
+--
+explain (costs off)
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from int8_tbl i1 left join (int8_tbl i2 join
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: q1
+ select * from int8_tbl i1 left join (int8_tbl i2 join
+ ^
+<sql-statement>
+--
+-- regression test: check a case where join_clause_is_movable_into() gives
+-- an imprecise result, causing an assertion failure
+--
+select count(*)
+from
+ (select t3.tenthous as x1, coalesce(t1.stringu1, t2.stringu1) as x2
+ from tenk1 t1
+ left join tenk1 t2 on t1.unique1 = t2.unique1
+ join tenk1 t3 on t1.unique2 = t3.unique2) ss,
+ tenk1 t4,
+ tenk1 t5
+where t4.thousand = t5.unique1 and ss.x1 = t4.tenthous and ss.x2 = t5.stringu1;
+</sql-statement>
+<sql-statement>
+--
+-- regression test: check a case where we formerly missed including an EC
+-- enforcement clause because it was expected to be handled at scan level
+--
+explain (costs off)
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select a.f1, b.f1, t.thousand, t.tenthous from
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ select a.f1, b.f1, t.thousand, t.tenthous from
+ ^
+<sql-statement>
+--
+-- check a case where we formerly got confused by conflicting sort orders
+-- in redundant merge join path keys
+--
+explain (costs off)
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+</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.j1_tbl
+
+<sql-statement>
+--
+-- a different check for handling of redundant sort keys in merge joins
+--
+explain (costs off)
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+</sql-statement>
+<sql-statement>
+--
+-- Clean up
+--
+DROP TABLE t1;
+</sql-statement>
+<sql-statement>
+DROP TABLE t2;
+</sql-statement>
+<sql-statement>
+DROP TABLE t3;
+</sql-statement>
+<sql-statement>
+DROP TABLE J1_TBL;
+</sql-statement>
+<sql-statement>
+DROP TABLE J2_TBL;
+</sql-statement>
+<sql-statement>
+-- Both DELETE and UPDATE allow the specification of additional tables
+-- to "join" against to determine which rows should be modified.
+CREATE TEMP TABLE t1 (a int, b int);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE t2 (a int, b int);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE t3 (x int, y int);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES (5, 10);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES (15, 20);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES (100, 100);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES (200, 1000);
+</sql-statement>
+<sql-statement>
+INSERT INTO t2 VALUES (200, 2000);
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES (5, 20);
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES (6, 7);
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES (7, 8);
+</sql-statement>
+<sql-statement>
+INSERT INTO t3 VALUES (500, 100);
+</sql-statement>
+<sql-statement>
+DELETE FROM t3 USING t1 table1 WHERE t3.x = table1.a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ DELETE FROM t3 USING t1 table1 WHERE t3.x = table1.a;
+ ^
+<sql-statement>
+SELECT * FROM t3;
+</sql-statement>
+<sql-statement>
+DELETE FROM t3 USING t1 JOIN t2 USING (a) WHERE t3.x > t1.a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ DELETE FROM t3 USING t1 JOIN t2 USING (a) WHERE t3.x > t1.a;
+ ^
+<sql-statement>
+SELECT * FROM t3;
+</sql-statement>
+<sql-statement>
+DELETE FROM t3 USING t3 t3_other WHERE t3.x = t3_other.x AND t3.y = t3_other.y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ DELETE FROM t3 USING t3 t3_other WHERE t3.x = t3_other.x AND t3.y = t3_other.y;
+ ^
+<sql-statement>
+SELECT * FROM t3;
+</sql-statement>
+<sql-statement>
+-- Test join against inheritance tree
+create temp table t2a () inherits (t2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ -- Test join against inheritance tree
+ ^
+<sql-statement>
+insert into t2a values (200, 2001);
+</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.t2a
+
+<sql-statement>
+select * from t1 left join t2 on (t1.a = t2.a);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from t1 left join t2 on (t1.a = t2.a);
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ select * from t1 left join t2 on (t1.a = t2.a);
+ ^
+<sql-statement>
+-- Test matching of column name with wrong alias
+select t1.x from t1 join t3 on (t1.a = t3.x);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Test matching of column name with wrong alias
+ ^
+ -stdin-:<main>:2:8: Error: No such column: x
+ select t1.x from t1 join t3 on (t1.a = t3.x);
+ ^
+<sql-statement>
+-- Test matching of locking clause with wrong alias
+select t1.*, t2.*, unnamed_join.* from
+ t1 join t2 on (t1.a = t2.a), t3 as unnamed_join
+ for update of unnamed_join;
+</sql-statement>
+-stdin-:<main>: Warning: Parse Sql
+
+ -stdin-:<main>:1:1: Warning: SelectStmt: lockingClause is ignored
+ -- Test matching of locking clause with wrong alias
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Test matching of locking clause with wrong alias
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ -- Test matching of locking clause with wrong alias
+ ^
+<sql-statement>
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of unnamed_join;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ select foo.*, unnamed_join.* from
+ ^
+<sql-statement>
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: join USING: unsupported AS
+ select foo.*, unnamed_join.* from
+ ^
+<sql-statement>
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of foo;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ select bar.*, unnamed_join.* from
+ ^
+<sql-statement>
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of bar;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ select bar.*, unnamed_join.* from
+ ^
+<sql-statement>
+--
+-- regression test for 8.1 merge right join bug
+--
+CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
+</sql-statement>
+<sql-statement>
+INSERT INTO tt1 VALUES (1, 11);
+</sql-statement>
+<sql-statement>
+INSERT INTO tt1 VALUES (2, NULL);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
+</sql-statement>
+<sql-statement>
+INSERT INTO tt2 VALUES (21, 11);
+</sql-statement>
+<sql-statement>
+INSERT INTO tt2 VALUES (22, 11);
+</sql-statement>
+<sql-statement>
+set enable_hashjoin to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashjoin
+ set enable_hashjoin to off;
+ ^
+<sql-statement>
+set enable_nestloop to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_nestloop
+ set enable_nestloop to off;
+ ^
+<sql-statement>
+-- these should give the same results
+select tt1.*, tt2.* from tt1 left join tt2 on tt1.joincol = tt2.joincol;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- these should give the same results
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: joincol
+ -- these should give the same results
+ ^
+<sql-statement>
+select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: joincol
+ select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol;
+ ^
+<sql-statement>
+reset enable_hashjoin;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashjoin;
+ ^
+<sql-statement>
+reset enable_nestloop;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_nestloop;
+ ^
+<sql-statement>
+--
+-- regression test for bug #13908 (hash join with skew tuples & nbatch increase)
+--
+set work_mem to '64kB';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: work_mem
+ --
+ ^
+<sql-statement>
+set enable_mergejoin to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_mergejoin
+ set enable_mergejoin to off;
+ ^
+<sql-statement>
+set enable_memoize to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_memoize
+ set enable_memoize to off;
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+</sql-statement>
+<sql-statement>
+reset work_mem;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset work_mem;
+ ^
+<sql-statement>
+reset enable_mergejoin;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_mergejoin;
+ ^
+<sql-statement>
+reset enable_memoize;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_memoize;
+ ^
+<sql-statement>
+--
+-- regression test for 8.2 bug with improper re-ordering of left joins
+--
+create temp table tt3(f1 int, f2 text);
+</sql-statement>
+<sql-statement>
+insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
+</sql-statement>
+<sql-statement>
+create index tt3i on tt3(f1);
+</sql-statement>
+<sql-statement>
+analyze tt3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze tt3;
+ ^
+<sql-statement>
+create temp table tt4(f1 int);
+</sql-statement>
+<sql-statement>
+insert into tt4 values (0),(1),(9999);
+</sql-statement>
+<sql-statement>
+analyze tt4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze tt4;
+ ^
+<sql-statement>
+SELECT a.f1
+FROM tt4 a
+LEFT JOIN (
+ SELECT b.f1
+ FROM tt3 b LEFT JOIN tt3 c ON (b.f1 = c.f1)
+ WHERE c.f1 IS NULL
+) AS d ON (a.f1 = d.f1)
+WHERE d.f1 IS NULL;
+</sql-statement>
+<sql-statement>
+--
+-- regression test for proper handling of outer joins within antijoins
+--
+create temp table tt4x(c1 int, c2 int, c3 int);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select * from tt4x t1
+where not exists (
+ select 1 from tt4x t2
+ left join tt4x t3 on t2.c3 = t3.c1
+ left join ( select t5.c1 as c1
+ from tt4x t4 left join tt4x t5 on t4.c2 = t5.c1
+ ) a1 on t3.c2 = a1.c1
+ where t1.c1 = t2.c2
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- regression test for problems of the sort depicted in bug #3494
+--
+create temp table tt5(f1 int, f2 int);
+</sql-statement>
+<sql-statement>
+create temp table tt6(f1 int, f2 int);
+</sql-statement>
+<sql-statement>
+insert into tt5 values(1, 10);
+</sql-statement>
+<sql-statement>
+insert into tt5 values(1, 11);
+</sql-statement>
+<sql-statement>
+insert into tt6 values(1, 9);
+</sql-statement>
+<sql-statement>
+insert into tt6 values(1, 2);
+</sql-statement>
+<sql-statement>
+insert into tt6 values(2, 9);
+</sql-statement>
+<sql-statement>
+select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
+ ^
+<sql-statement>
+--
+-- regression test for problems of the sort depicted in bug #3588
+--
+create temp table xx (pkxx int);
+</sql-statement>
+<sql-statement>
+create temp table yy (pkyy int, pkxx int);
+</sql-statement>
+<sql-statement>
+insert into xx values (1);
+</sql-statement>
+<sql-statement>
+insert into xx values (2);
+</sql-statement>
+<sql-statement>
+insert into xx values (3);
+</sql-statement>
+<sql-statement>
+insert into yy values (101, 1);
+</sql-statement>
+<sql-statement>
+insert into yy values (201, 2);
+</sql-statement>
+<sql-statement>
+insert into yy values (301, NULL);
+</sql-statement>
+<sql-statement>
+select yy.pkyy as yy_pkyy, yy.pkxx as yy_pkxx, yya.pkyy as yya_pkyy,
+ xxa.pkxx as xxa_pkxx, xxb.pkxx as xxb_pkxx
+from yy
+ left join (SELECT * FROM yy where pkyy = 101) as yya ON yy.pkyy = yya.pkyy
+ left join xx xxa on yya.pkxx = xxa.pkxx
+ left join xx xxb on coalesce (xxa.pkxx, 1) = xxb.pkxx;
+</sql-statement>
+<sql-statement>
+--
+-- regression test for improper pushing of constants across outer-join clauses
+-- (as seen in early 8.2.x releases)
+--
+create temp table zt1 (f1 int primary key);
+</sql-statement>
+<sql-statement>
+create temp table zt2 (f2 int primary key);
+</sql-statement>
+<sql-statement>
+create temp table zt3 (f3 int primary key);
+</sql-statement>
+<sql-statement>
+insert into zt1 values(53);
+</sql-statement>
+<sql-statement>
+insert into zt2 values(53);
+</sql-statement>
+<sql-statement>
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zt1 on (f3 = f1)
+where f2 = 53;
+</sql-statement>
+<sql-statement>
+create temp view zv1 as select *,'dummy'::text AS junk from zt1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create temp view zv1 as select *,'dummy'::text AS junk from zt1;
+ ^
+<sql-statement>
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zv1 on (f3 = f1)
+where f2 = 53;
+</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.zv1
+
+<sql-statement>
+--
+-- regression test for improper extraction of OR indexqual conditions
+-- (as seen in early 8.3.x releases)
+--
+select a.unique2, a.ten, b.tenthous, b.unique2, b.hundred
+from tenk1 a left join tenk1 b on a.unique2 = b.tenthous
+where a.unique1 = 42 and
+ ((b.unique2 is null and a.ten = 2) or b.hundred = 3);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: unique2
+ --
+ ^
+<sql-statement>
+--
+-- test proper positioning of one-time quals in EXISTS (8.4devel bug)
+--
+prepare foo(bool) as
+ select count(*) from tenk1 a left join tenk1 b
+ on (a.unique2 = b.unique1 and exists
+ (select 1 from tenk1 c where c.thousand = b.unique2 and $1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ --
+ ^
+<sql-statement>
+execute foo(true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ execute foo(true);
+ ^
+<sql-statement>
+execute foo(false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ execute foo(false);
+ ^
+<sql-statement>
+--
+-- test for sane behavior with noncanonical merge clauses, per bug #4926
+--
+begin;
+</sql-statement>
+<sql-statement>
+set enable_mergejoin = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_mergejoin
+ set enable_mergejoin = 1;
+ ^
+<sql-statement>
+set enable_hashjoin = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashjoin
+ set enable_hashjoin = 0;
+ ^
+<sql-statement>
+set enable_nestloop = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_nestloop
+ set enable_nestloop = 0;
+ ^
+<sql-statement>
+create temp table a (i integer);
+</sql-statement>
+<sql-statement>
+create temp table b (x integer, y integer);
+</sql-statement>
+<sql-statement>
+select * from a left join b on i = x and i = y and x = i;
+</sql-statement>
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- test handling of merge clauses using record_ops
+--
+begin;
+</sql-statement>
+<sql-statement>
+create type mycomptype as (id int, v bigint);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ create type mycomptype as (id int, v bigint);
+ ^
+<sql-statement>
+create temp table tidv (idv mycomptype);
+</sql-statement>
+<sql-statement>
+create index on tidv (idv);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+set enable_mergejoin = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_mergejoin
+ set enable_mergejoin = 0;
+ ^
+<sql-statement>
+set enable_hashjoin = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashjoin
+ set enable_hashjoin = 0;
+ ^
+<sql-statement>
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- test NULL behavior of whole-row Vars, per bug #5025
+--
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 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
+ --
+ ^
+ -stdin-:<main>:4:15: Error: At function: PgAgg
+ select t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:4:21: Error: Expected PG type, but got: Struct
+ select t1.q2, count(t2.*)
+ ^
+<sql-statement>
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 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 t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgAgg
+ select t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:21: Error: Expected PG type, but got: Struct
+ select t1.q2, count(t2.*)
+ ^
+<sql-statement>
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl offset 0) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 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 t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgAgg
+ select t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:21: Error: Expected PG type, but got: Struct
+ select t1.q2, count(t2.*)
+ ^
+<sql-statement>
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join
+ (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2
+ on (t1.q2 = t2.q1)
+group by t1.q2 order by 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 t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgAgg
+ select t1.q2, count(t2.*)
+ ^
+ -stdin-:<main>:1:21: Error: Expected PG type, but got: Struct
+ select t1.q2, count(t2.*)
+ ^
+<sql-statement>
+--
+-- test incorrect failure to NULL pulled-up subexpressions
+--
+begin;
+</sql-statement>
+<sql-statement>
+create temp table a (
+ code char not null,
+ constraint a_pk primary key (code)
+);
+</sql-statement>
+<sql-statement>
+create temp table b (
+ a char not null,
+ num integer not null,
+ constraint b_pk primary key (a, num)
+);
+</sql-statement>
+<sql-statement>
+create temp table c (
+ name char not null,
+ a char,
+ constraint c_pk primary key (name)
+);
+</sql-statement>
+<sql-statement>
+insert into a (code) values ('p');
+</sql-statement>
+<sql-statement>
+insert into a (code) values ('q');
+</sql-statement>
+<sql-statement>
+insert into b (a, num) values ('p', 1);
+</sql-statement>
+<sql-statement>
+insert into b (a, num) values ('p', 2);
+</sql-statement>
+<sql-statement>
+insert into c (name, a) values ('A', 'p');
+</sql-statement>
+<sql-statement>
+insert into c (name, a) values ('B', 'q');
+</sql-statement>
+<sql-statement>
+insert into c (name, a) values ('C', null);
+</sql-statement>
+<sql-statement>
+select c.name, ss.code, ss.b_cnt, ss.const
+from c left join
+ (select a.code, coalesce(b_grp.cnt, 0) as b_cnt, -1 as const
+ from a left join
+ (select count(1) as cnt, b.a from b group by b.a) as b_grp
+ on a.code = b_grp.a
+ ) as ss
+ on (c.a = ss.code)
+order by c.name;
+</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: PgSelect, At function: PgSetItem
+ select c.name, ss.code, ss.b_cnt, ss.const
+ ^
+ -stdin-:<main>:5:51: Error: No such column: a
+ (select count(1) as cnt, b.a from b group by b.a) as b_grp
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- test incorrect handling of placeholders that only appear in targetlists,
+-- per bug #6154
+--
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+</sql-statement>
+<sql-statement>
+-- test the path using join aliases, too
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, value2, COALESCE(value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+</sql-statement>
+<sql-statement>
+--
+-- test case where a PlaceHolderVar is used as a nestloop parameter
+--
+EXPLAIN (COSTS OFF)
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT qq, unique1
+ ^
+ -stdin-:<main>:7:25: Error: Column reference is ambiguous: qq
+ INNER JOIN tenk1 c ON qq = unique2;
+ ^
+<sql-statement>
+--
+-- nested nestloops can require nested PlaceHolderVars
+--
+create temp table nt1 (
+ id int primary key,
+ a1 boolean,
+ a2 boolean
+);
+</sql-statement>
+<sql-statement>
+create temp table nt2 (
+ id int primary key,
+ nt1_id int,
+ b1 boolean,
+ b2 boolean,
+ foreign key (nt1_id) references nt1(id)
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table constraint not supported
+ create temp table nt2 (
+ ^
+<sql-statement>
+create temp table nt3 (
+ id int primary key,
+ nt2_id int,
+ c1 boolean,
+ foreign key (nt2_id) references nt2(id)
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table constraint not supported
+ create temp table nt3 (
+ ^
+<sql-statement>
+insert into nt1 values (1,true,true);
+</sql-statement>
+<sql-statement>
+insert into nt1 values (2,true,false);
+</sql-statement>
+<sql-statement>
+insert into nt1 values (3,false,false);
+</sql-statement>
+<sql-statement>
+insert into nt2 values (1,1,true,true);
+</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.nt2
+
+<sql-statement>
+insert into nt2 values (2,2,true,false);
+</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.nt2
+
+<sql-statement>
+insert into nt2 values (3,3,false,false);
+</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.nt2
+
+<sql-statement>
+insert into nt3 values (1,1,true);
+</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.nt3
+
+<sql-statement>
+insert into nt3 values (2,2,false);
+</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.nt3
+
+<sql-statement>
+insert into nt3 values (3,3,true);
+</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.nt3
+
+<sql-statement>
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+</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.nt2
+
+<sql-statement>
+--
+-- test case where a PlaceHolderVar is propagated into a subquery
+--
+explain (costs off)
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+</sql-statement>
+<sql-statement>
+--
+-- variant where a PlaceHolderVar is needed at a join, but not above the join
+--
+explain (costs off)
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+--
+-- test the corner cases FULL JOIN ON TRUE and FULL JOIN ON FALSE
+--
+select * from int4_tbl a full join int4_tbl b on true;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ --
+ ^
+<sql-statement>
+select * from int4_tbl a full join int4_tbl b on false;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from int4_tbl a full join int4_tbl b on false;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ select * from int4_tbl a full join int4_tbl b on false;
+ ^
+<sql-statement>
+--
+-- test for ability to use a cartesian join when necessary
+--
+create temp table q1 as select 1 as q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ --
+ ^
+<sql-statement>
+create temp table q2 as select 0 as q2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create temp table q2 as select 0 as q2;
+ ^
+<sql-statement>
+analyze q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze q1;
+ ^
+<sql-statement>
+analyze q2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze q2;
+ ^
+<sql-statement>
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where q1 = thousand or q2 = thousand;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where thousand = (q1 + q2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- test ability to generate a suitable plan for a star-schema query
+--
+explain (costs off)
+select * from
+ tenk1, int8_tbl a, int8_tbl b
+where thousand = a.q1 and tenthous = b.q1 and a.q2 = 1 and b.q2 = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+--
+-- test a corner case in which we shouldn't apply the star-schema optimization
+--
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+</sql-statement>
+<sql-statement>
+-- variant that isn't quite a star-schema case
+select ss1.d1 from
+ tenk1 as t1
+ inner join tenk1 as t2
+ on t1.tenthous = t2.ten
+ inner join
+ int8_tbl as i8
+ left join int4_tbl as i4
+ inner join (select 64::information_schema.cardinal_number as d1
+ from tenk1 t3,
+ lateral (select abs(t3.unique1) + random()) ss0(x)
+ where t3.fivethous < 0) as ss1
+ on i4.f1 = ss1.d1
+ on i8.q1 = i4.f1
+ on t1.tenthous = ss1.d1
+where t1.unique1 < i4.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- variant that isn't quite a star-schema case
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- variant that isn't quite a star-schema case
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- variant that isn't quite a star-schema case
+ ^
+<sql-statement>
+-- this variant is foldable by the remove-useless-RESULT-RTEs code
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- this variant is foldable by the remove-useless-RESULT-RTEs code
+ ^
+<sql-statement>
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+</sql-statement>
+<sql-statement>
+-- Here's a variant that we can't fold too aggressively, though,
+-- or we end up with noplace to evaluate the lateral PHV
+explain (verbose, costs off)
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Here's a variant that we can't fold too aggressively, though,
+ ^
+<sql-statement>
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+-- Test proper handling of appendrel PHVs during useless-RTE removal
+explain (costs off)
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test proper handling of appendrel PHVs during useless-RTE removal
+ ^
+<sql-statement>
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+--
+-- test inlining of immutable functions
+--
+create function f_immutable_int4(i integer) returns integer as
+$$ begin return i; end; $$ language plpgsql immutable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ --
+ ^
+<sql-statement>
+-- check optimization of function scan with join
+explain (costs off)
+select unique1 from tenk1, (select * from f_immutable_int4(1) x) x
+where x = unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check optimization of function scan with join
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select unique1, x.*
+from tenk1, (select *, random() from f_immutable_int4(1) x) x
+where x = unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x = unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x in (select 17);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1, x from tenk1 join f_immutable_int4(1) x on unique1 = x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1, x from tenk1 left join f_immutable_int4(1) x on unique1 = x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1, x from tenk1 right join f_immutable_int4(1) x on unique1 = x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select unique1, x from tenk1 full join f_immutable_int4(1) x on unique1 = x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- check that pullup of a const function allows further const-folding
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = 42;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check that pullup of a const function allows further const-folding
+ ^
+<sql-statement>
+-- test inlining of immutable functions with PlaceHolderVars
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 or i4 = 42) AS b3
+ from nt2 as nt2
+ left join
+ f_immutable_int4(0) i4
+ on i4 = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- test inlining of immutable functions with PlaceHolderVars
+ ^
+<sql-statement>
+drop function f_immutable_int4(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function f_immutable_int4(int);
+ ^
+<sql-statement>
+-- test inlining when function returns composite
+create function mki8(bigint, bigint) returns int8_tbl as
+$$select row($1,$2)::int8_tbl$$ language sql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- test inlining when function returns composite
+ ^
+<sql-statement>
+create function mki4(int) returns int4_tbl as
+$$select row($1)::int4_tbl$$ language sql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function mki4(int) returns int4_tbl as
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from mki8(1,2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from mki8(1,2);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from mki8(1,2);
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from mki8(1,2);
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: mki8
+ select * from mki8(1,2);
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from mki4(42);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from mki4(42);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from mki4(42);
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from mki4(42);
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: mki4
+ select * from mki4(42);
+ ^
+<sql-statement>
+drop function mki8(bigint, bigint);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function mki8(bigint, bigint);
+ ^
+<sql-statement>
+drop function mki4(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function mki4(int);
+ ^
+<sql-statement>
+--
+-- test extraction of restriction OR clauses from join OR clause
+-- (we used to only do this for indexable clauses)
+--
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.hundred = 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.ten = 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or
+ ((a.unique2 = 3 or a.unique2 = 7) and b.hundred = 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- test placement of movable quals in a parameterized join tree
+--
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten = t3.ten
+where t1.unique1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten + t2.ten = t3.ten
+where t1.unique1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: PgSelect, At function: PgSetItem, At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedMap, At function: EquiJoin
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_int8_tbl.q2 has type: pgint8, b._alias_tenk1.unique2 has type: pgint4)
+ select * from
+ ^
+<sql-statement>
+explain (costs off)
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:18: Error: Columns are not allowed in: RANGE FUNCTION
+ left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+ ^
+<sql-statement>
+--
+-- test handling of potential equivalence clauses above outer joins
+--
+explain (costs off)
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: OrderedMap, At function: EquiJoin
+ select q1, unique2, thousand, hundred
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_a.q1 has type: pgint8, b._alias_b.unique2 has type: pgint4)
+ select q1, unique2, thousand, hundred
+ ^
+<sql-statement>
+explain (costs off)
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+</sql-statement>
+<sql-statement>
+--
+-- another case with equivalence clauses above outer joins (bug #8591)
+--
+explain (costs off)
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: unique1
+ select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ ^
+<sql-statement>
+--
+-- check handling of join aliases when flattening multiple levels of subquery
+--
+explain (verbose, costs off)
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+</sql-statement>
+<sql-statement>
+--
+-- test successful handling of nested outer joins with degenerate join quals
+--
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin
+ select t1.* from
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_b1.q2 has type: pgint8, b._alias_b2.d2 has type: pgint4)
+ select t1.* from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin
+ select t1.* from
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_b1.q2 has type: pgint8, b._alias_b2.d2 has type: pgint4)
+ select t1.* from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin, At function: OrderedMap, At function: EquiJoin
+ select t1.* from
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_b1.q2 has type: pgint8, b._alias_b2.d2 has type: pgint4)
+ select t1.* from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ select * from
+ ^
+<sql-statement>
+--
+-- test for appropriate join order in the presence of lateral references
+--
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select 1 from
+ ^
+<sql-statement>
+--
+-- check a case in which a PlaceHolderVar forces join order
+--
+explain (verbose, costs off)
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select ss2.* from
+ ^
+<sql-statement>
+--
+-- test successful handling of full join underneath left join (bug #14105)
+--
+explain (costs off)
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ select * from
+ ^
+<sql-statement>
+--
+-- test ability to push constants through outer join clauses
+--
+explain (costs off)
+ select * from int4_tbl a left join tenk1 b on f1 = unique2 where f1 = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (costs off)
+ select * from tenk1 a full join tenk1 b using(unique2) where unique2 = 42;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- test that quals attached to an outer join have correct semantics,
+-- specifically that they don't re-use expressions computed below the join;
+-- we force a mergejoin so that coalesce(b.q1, 1) appears as a join input
+--
+set enable_hashjoin to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashjoin
+ --
+ ^
+<sql-statement>
+set enable_nestloop to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_nestloop
+ set enable_nestloop to off;
+ ^
+<sql-statement>
+explain (verbose, costs off)
+ select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+</sql-statement>
+<sql-statement>
+reset enable_hashjoin;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashjoin;
+ ^
+<sql-statement>
+reset enable_nestloop;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_nestloop;
+ ^
+<sql-statement>
+--
+-- test join removal
+--
+begin;
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE a (id int PRIMARY KEY, b_id int);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE b (id int PRIMARY KEY, c_id int);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE c (id int PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE d (a int, b int);
+</sql-statement>
+<sql-statement>
+INSERT INTO a VALUES (0, 0), (1, NULL);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: YtWriteTable!
+ INSERT INTO a VALUES (0, 0), (1, NULL);
+ ^
+ -stdin-:<main>:1:1: Error: values have 2 columns, INSERT INTO expects: 1
+ INSERT INTO a VALUES (0, 0), (1, NULL);
+ ^
+<sql-statement>
+INSERT INTO b VALUES (0, 0), (1, NULL);
+</sql-statement>
+<sql-statement>
+INSERT INTO c VALUES (0), (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO d VALUES (1,3), (2,2), (3,1);
+</sql-statement>
+<sql-statement>
+-- all three cases should be optimizable into a simple seqscan
+explain (costs off) SELECT a.* FROM a LEFT JOIN b ON a.b_id = b.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- all three cases should be optimizable into a simple seqscan
+ ^
+<sql-statement>
+explain (costs off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
+ ^
+<sql-statement>
+explain (costs off)
+ SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
+ ON (a.b_id = b.id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- check optimization of outer join within another special join
+explain (costs off)
+select id from a where id in (
+ select b.id from b left join c on b.id = c.id
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check optimization of outer join within another special join
+ ^
+<sql-statement>
+-- check that join removal works for a left join when joining a subquery
+-- that is guaranteed to be unique by its GROUP BY clause
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id and d.b = s.c_id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check that join removal works for a left join when joining a subquery
+ ^
+<sql-statement>
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id and d.b = s.c_id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- similarly, but keying off a DISTINCT clause
+ ^
+<sql-statement>
+-- join removal is not possible when the GROUP BY contains a column that is
+-- not in the join condition. (Note: as of 9.6, we notice that b.id is a
+-- primary key and so drop b.c_id from the GROUP BY of the resulting plan;
+-- but this happens too late for join removal in the outer plan level.)
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- join removal is not possible when the GROUP BY contains a column that is
+ ^
+<sql-statement>
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- similarly, but keying off a DISTINCT clause
+ ^
+<sql-statement>
+-- check join removal works when uniqueness of the join condition is enforced
+-- by a UNION
+explain (costs off)
+select d.* from d left join (select id from a union select id from b) s
+ on d.a = s.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check join removal works when uniqueness of the join condition is enforced
+ ^
+<sql-statement>
+-- check join removal with a cross-type comparison operator
+explain (costs off)
+select i8.* from int8_tbl i8 left join (select f1 from int4_tbl group by f1) i4
+ on i8.q1 = i4.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check join removal with a cross-type comparison operator
+ ^
+<sql-statement>
+-- check join removal with lateral references
+explain (costs off)
+select 1 from (select a.id FROM a left join b on a.b_id = b.id) q,
+ lateral generate_series(1, q.id) gs(i) where q.id = gs.i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check join removal with lateral references
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+create temp table parent (k int primary key, pd int);
+</sql-statement>
+<sql-statement>
+create temp table child (k int unique, cd int);
+</sql-statement>
+<sql-statement>
+insert into parent values (1, 10), (2, 20), (3, 30);
+</sql-statement>
+<sql-statement>
+insert into child values (1, 100), (4, 400);
+</sql-statement>
+<sql-statement>
+-- this case is optimizable
+select p.* from parent p left join child c on (p.k = c.k);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select p.* from parent p left join child c on (p.k = c.k);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- this case is not
+select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+ select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- bug 5255: this is not optimizable by join removal
+begin;
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE a (id int PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE b (id int PRIMARY KEY, a_id int);
+</sql-statement>
+<sql-statement>
+INSERT INTO a VALUES (0), (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO b VALUES (0, 0), (1, NULL);
+</sql-statement>
+<sql-statement>
+SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+ -stdin-:<main>:1:33: Error: No such column: a_id
+ SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+ -stdin-:<main>:1:42: Error: No such column: id
+ SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+<sql-statement>
+SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+ -stdin-:<main>:1:35: Error: No such column: a_id
+ SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+ -stdin-:<main>:1:44: Error: No such column: id
+ SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- another join removal bug: this is not optimizable, either
+begin;
+</sql-statement>
+<sql-statement>
+create temp table innertab (id int8 primary key, dat1 int8);
+</sql-statement>
+<sql-statement>
+insert into innertab values(123, 42);
+</sql-statement>
+<sql-statement>
+SELECT * FROM
+ (SELECT 1 AS x) ss1
+ LEFT JOIN
+ (SELECT q1, q2, COALESCE(dat1, q1) AS y
+ FROM int8_tbl LEFT JOIN innertab ON q2 = id) ss2
+ ON true;
+</sql-statement>
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- another join removal bug: we must clean up correctly when removing a PHV
+begin;
+</sql-statement>
+<sql-statement>
+create temp table uniquetbl (f1 text unique);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select t1.* from
+ uniquetbl as t1
+ left join (select *, '***'::text as d1 from uniquetbl) t2
+ on t1.f1 = t2.f1
+ left join uniquetbl t3
+ on t2.d1 = t3.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: PgSelect, At function: PgSetItem, At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedMap, At function: EquiJoin
+ select t0.*
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (a._alias_t1.string4 has type: pgname, b._alias_u1.f1 has type: pgtext)
+ select t0.*
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- test case to expose miscomputation of required relid set for a PHV
+explain (verbose, costs off)
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- test case to expose miscomputation of required relid set for a PHV
+ ^
+<sql-statement>
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select i8.*, ss.v, t.unique2
+ ^
+<sql-statement>
+-- and check a related issue where we miscompute required relids for
+-- a PHV that's been translated to a child rel
+create temp table parttbl (a integer primary key) partition by range (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- and check a related issue where we miscompute required relids for
+ ^
+<sql-statement>
+create temp table parttbl1 partition of parttbl for values from (1) to (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table parttbl1 partition of parttbl for values from (1) to (100);
+ ^
+<sql-statement>
+insert into parttbl values (11), (12);
+</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.parttbl
+
+<sql-statement>
+explain (costs off)
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+</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.parttbl
+
+<sql-statement>
+-- bug #8444: we've historically allowed duplicate aliases within aliased JOINs
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = f1; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ -- bug #8444: we've historically allowed duplicate aliases within aliased JOINs
+ ^
+<sql-statement>
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = y.f1; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ select * from
+ ^
+<sql-statement>
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y(ff)) j on q1 = f1; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ select * from
+ ^
+<sql-statement>
+--
+-- Test hints given on incorrect column references are useful
+--
+select t1.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t1" suggestion
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:4:8: Error: No such column: uunique1
+ select t1.uunique1 from
+ ^
+<sql-statement>
+select t2.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t2" suggestion
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select t2.uunique1 from
+ ^
+ -stdin-:<main>:1:8: Error: No such column: uunique1
+ select t2.uunique1 from
+ ^
+<sql-statement>
+select uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, suggest both at once
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select uunique1 from
+ ^
+ -stdin-:<main>:1:8: Error: No such column: uunique1
+ select uunique1 from
+ ^
+<sql-statement>
+--
+-- Take care to reference the correct RTE
+--
+select atts.relid::regclass, s.* from pg_stats s join
+ pg_attribute a on s.attname = a.attname and s.tablename =
+ a.attrelid::regclass::text join (select unnest(indkey) attnum,
+ indexrelid from pg_index i) atts on atts.attnum = a.attnum where
+ schemaname != 'pg_catalog';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:45: Error: Generator functions are not allowed in: SELECT
+ a.attrelid::regclass::text join (select unnest(indkey) attnum,
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ --
+ ^
+<sql-statement>
+--
+-- Test LATERAL
+--
+select unique2, x.*
+from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ --
+ ^
+<sql-statement>
+explain (costs off)
+ select unique2, x.*
+ from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique2, x.*
+from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select unique2, x.*
+ ^
+<sql-statement>
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x cross join lateral (select unique2 from tenk1 where f1 = unique1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique2, x.*
+from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select unique2, x.*
+ ^
+<sql-statement>
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- check scoping of lateral versus parent references
+-- the first of these should return int8_tbl.q2, the second int8_tbl.q1
+select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- check scoping of lateral versus parent references
+ ^
+ -stdin-:<main>:3:11: Error: At function: PgSubLink, At function: PgSelect
+ select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ ^
+ -stdin-:<main>:3:11: Error: At function: PgSetItem, At function: PgSelect, At function: PgSetItem
+ select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ ^
+ -stdin-:<main>:3:34: Error: Column reference can't be used without FROM
+ select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ ^
+ -stdin-:<main>:3:11: Error: At function: PgSelect, At function: PgSetItem
+ select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ ^
+ -stdin-:<main>:3:55: Error: Column reference can't be used without FROM
+ select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ ^
+<sql-statement>
+select *, (select r from (select q1 as q2) x, lateral (select q2 as r) y) from int8_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:11: Error: RangeSubselect: unsupported lateral
+ select *, (select r from (select q1 as q2) x, lateral (select q2 as r) y) from int8_tbl;
+ ^
+<sql-statement>
+-- lateral with function in FROM
+select count(*) from tenk1 a, lateral generate_series(1,two) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported lateral
+ -- lateral with function in FROM
+ ^
+<sql-statement>
+explain (costs off)
+ select count(*) from tenk1 a, lateral generate_series(1,two) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+ select count(*) from tenk1 a cross join lateral generate_series(1,two) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+-- don't need the explicit LATERAL keyword for functions
+explain (costs off)
+ select count(*) from tenk1 a, generate_series(1,two) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- don't need the explicit LATERAL keyword for functions
+ ^
+<sql-statement>
+-- lateral with UNION ALL subselect
+explain (costs off)
+ select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral with UNION ALL subselect
+ ^
+<sql-statement>
+select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from generate_series(100,200) g,
+ ^
+<sql-statement>
+-- lateral with VALUES
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral with VALUES
+ ^
+<sql-statement>
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select count(*) from tenk1 a,
+ ^
+<sql-statement>
+-- lateral with VALUES, no flattening possible
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral with VALUES, no flattening possible
+ ^
+<sql-statement>
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select count(*) from tenk1 a,
+ ^
+<sql-statement>
+-- lateral injecting a strange outer join condition
+explain (costs off)
+ select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral injecting a strange outer join condition
+ ^
+<sql-statement>
+select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from int8_tbl a,
+ ^
+<sql-statement>
+-- lateral reference to a join alias variable
+select * from (select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (select x) ss2(y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- lateral reference to a join alias variable
+ ^
+<sql-statement>
+select * from (select f1 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (values(x)) ss2(y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from (select f1 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ ^
+<sql-statement>
+select * from ((select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1) j,
+ lateral (select x) ss2(y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ select * from ((select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1) j,
+ ^
+<sql-statement>
+-- lateral references requiring pullup
+select * from (values(1)) x(lb),
+ lateral generate_series(lb,4) x4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported lateral
+ -- lateral references requiring pullup
+ ^
+<sql-statement>
+select * from (select f1/1000000000 from int4_tbl) x(lb),
+ lateral generate_series(lb,4) x4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported lateral
+ select * from (select f1/1000000000 from int4_tbl) x(lb),
+ ^
+<sql-statement>
+select * from (values(1)) x(lb),
+ lateral (values(lb)) y(lbcopy);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from (values(1)) x(lb),
+ ^
+<sql-statement>
+select * from (values(1)) x(lb),
+ lateral (select lb from int4_tbl) y(lbcopy);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from (values(1)) x(lb),
+ ^
+<sql-statement>
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (values(x.q1,y.q1,y.q2)) v(xq1,yq1,yq2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+select x.* from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select x.* from
+ ^
+<sql-statement>
+select v.* from
+ (int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select v.* from
+ ^
+<sql-statement>
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select v.* from
+ ^
+<sql-statement>
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 from onerow union all select x.q2,y.q2 from onerow) v(vx,vy);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select v.* from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+-- lateral can result in join conditions appearing below their
+-- real semantic level
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral can result in join conditions appearing below their
+ ^
+<sql-statement>
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from int4_tbl i left join
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from int4_tbl i left join
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from int4_tbl a,
+ ^
+<sql-statement>
+-- lateral reference in a PlaceHolderVar evaluated at join level
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- lateral reference in a PlaceHolderVar evaluated at join level
+ ^
+<sql-statement>
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+-- case requiring nested PlaceHolderVars
+explain (verbose, costs off)
+select * from
+ int8_tbl c left join (
+ int8_tbl a left join (select q1, coalesce(q2,42) as x from int8_tbl b) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select ss2.y offset 0) ss3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- case requiring nested PlaceHolderVars
+ ^
+<sql-statement>
+-- case that breaks the old ph_may_need optimization
+explain (verbose, costs off)
+select c.*,a.*,ss1.q1,ss2.q1,ss3.* from
+ int8_tbl c left join (
+ int8_tbl a left join
+ (select q1, coalesce(q2,f1) as x from int8_tbl b, int4_tbl b2
+ where q1 < f1) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select * from int4_tbl i where ss2.y > f1) ss3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- case that breaks the old ph_may_need optimization
+ ^
+<sql-statement>
+-- check processing of postponed quals (bug #9041)
+explain (verbose, costs off)
+select * from
+ (select 1 as x offset 0) x cross join (select 2 as y offset 0) y
+ left join lateral (
+ select * from (select 3 as z offset 0) z where z.z = x.x
+ ) zz on zz.z = y.y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check processing of postponed quals (bug #9041)
+ ^
+<sql-statement>
+-- check dummy rels with lateral references (bug #15694)
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl where false) ss on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check dummy rels with lateral references (bug #15694)
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl i1, int4_tbl i2 where false) ss on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+-- check handling of nested appendrels inside LATERAL
+select * from
+ ((select 2 as v) union all (select 3 as v)) as q1
+ cross join lateral
+ ((select * from
+ ((select 4 as v) union all (select 5 as v)) as q3)
+ union all
+ (select q1.v)
+ ) as q2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- check handling of nested appendrels inside LATERAL
+ ^
+<sql-statement>
+-- check the number of columns specified
+SELECT * FROM (int8_tbl i cross join int4_tbl j) ss(a,b,c,d);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: JoinExpr: unsupported alias
+ -- check the number of columns specified
+ ^
+<sql-statement>
+-- check we don't try to do a unique-ified semijoin with LATERAL
+explain (verbose, costs off)
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check we don't try to do a unique-ified semijoin with LATERAL
+ ^
+<sql-statement>
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+-- check proper extParam/allParam handling (this isn't exactly a LATERAL issue,
+-- but we can make the test case much more compact with LATERAL)
+explain (verbose, costs off)
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check proper extParam/allParam handling (this isn't exactly a LATERAL issue,
+ ^
+<sql-statement>
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from (values (0), (1)) v(id),
+ ^
+<sql-statement>
+-- test some error cases where LATERAL should have been used but wasn't
+select f1,g from int4_tbl a, (select f1 as g) 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
+ -- test some error cases where LATERAL should have been used but wasn't
+ ^
+ -stdin-:<main>:2:38: Error: Column reference can't be used without FROM
+ select f1,g from int4_tbl a, (select f1 as g) ss;
+ ^
+<sql-statement>
+select f1,g from int4_tbl a, (select a.f1 as g) 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
+ select f1,g from int4_tbl a, (select a.f1 as g) ss;
+ ^
+ -stdin-:<main>:1:38: Error: Column reference can't be used without FROM
+ select f1,g from int4_tbl a, (select a.f1 as g) ss;
+ ^
+<sql-statement>
+select f1,g from int4_tbl a cross join (select f1 as g) 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
+ select f1,g from int4_tbl a cross join (select f1 as g) ss;
+ ^
+ -stdin-:<main>:1:48: Error: Column reference can't be used without FROM
+ select f1,g from int4_tbl a cross join (select f1 as g) ss;
+ ^
+<sql-statement>
+select f1,g from int4_tbl a cross join (select a.f1 as g) 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
+ select f1,g from int4_tbl a cross join (select a.f1 as g) ss;
+ ^
+ -stdin-:<main>:1:48: Error: Column reference can't be used without FROM
+ select f1,g from int4_tbl a cross join (select a.f1 as g) ss;
+ ^
+<sql-statement>
+-- SQL:2008 says the left table is in scope but illegal to access here
+select f1,g from int4_tbl a right join lateral generate_series(0, a.f1) g on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported lateral
+ -- SQL:2008 says the left table is in scope but illegal to access here
+ ^
+<sql-statement>
+select f1,g from int4_tbl a full join lateral generate_series(0, a.f1) g on true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported lateral
+ select f1,g from int4_tbl a full join lateral generate_series(0, a.f1) g on true;
+ ^
+<sql-statement>
+-- check we complain about ambiguous table references
+select * from
+ int8_tbl x cross join (int4_tbl x cross join lateral (select x.f1) ss);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- check we complain about ambiguous table references
+ ^
+<sql-statement>
+-- LATERAL can be used to put an aggregate into the FROM clause of its query
+select 1 from tenk1 a, lateral (select max(a.unique1) from int4_tbl b) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- LATERAL can be used to put an aggregate into the FROM clause of its query
+ ^
+<sql-statement>
+-- check behavior of LATERAL in UPDATE/DELETE
+create temp table xx1 as select f1 as x1, -f1 as x2 from int4_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- check behavior of LATERAL in UPDATE/DELETE
+ ^
+<sql-statement>
+-- error, can't do this:
+update xx1 set x2 = f1 from (select * from int4_tbl where f1 = x1) ss;
+</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 xx1 set x2 = f1 from (select * from int4_tbl where f1 = xx1.x1) ss;
+</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>
+-- can't do it even with LATERAL:
+update xx1 set x2 = f1 from lateral (select * from int4_tbl where f1 = x1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- can't do it even with LATERAL:
+ ^
+<sql-statement>
+-- we might in future allow something like this, but for now it's an error:
+update xx1 set x2 = f1 from xx1, lateral (select * from int4_tbl where f1 = x1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ -- we might in future allow something like this, but for now it's an error:
+ ^
+<sql-statement>
+-- also errors:
+delete from xx1 using (select * from int4_tbl where f1 = x1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ -- also errors:
+ ^
+<sql-statement>
+delete from xx1 using (select * from int4_tbl where f1 = xx1.x1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ delete from xx1 using (select * from int4_tbl where f1 = xx1.x1) ss;
+ ^
+<sql-statement>
+delete from xx1 using lateral (select * from int4_tbl where f1 = x1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: using is not supported
+ delete from xx1 using lateral (select * from int4_tbl where f1 = x1) ss;
+ ^
+<sql-statement>
+--
+-- test LATERAL reference propagation down a multi-level inheritance hierarchy
+-- produced for a multi-level partitioned table hierarchy.
+--
+create table join_pt1 (a int, b int, c varchar) partition by range(a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ --
+ ^
+<sql-statement>
+create table join_pt1p1 partition of join_pt1 for values from (0) to (100) partition by range(b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table join_pt1p1 partition of join_pt1 for values from (0) to (100) partition by range(b);
+ ^
+<sql-statement>
+create table join_pt1p2 partition of join_pt1 for values from (100) to (200);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table join_pt1p2 partition of join_pt1 for values from (100) to (200);
+ ^
+<sql-statement>
+create table join_pt1p1p1 partition of join_pt1p1 for values from (0) to (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table join_pt1p1p1 partition of join_pt1p1 for values from (0) to (100);
+ ^
+<sql-statement>
+insert into join_pt1 values (1, 1, 'x'), (101, 101, 'y');
+</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.join_pt1
+
+<sql-statement>
+create table join_ut1 (a int, b int, c varchar);
+</sql-statement>
+<sql-statement>
+insert into join_ut1 values (101, 101, 'y'), (2, 2, 'z');
+</sql-statement>
+<sql-statement>
+explain (verbose, costs off)
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select t1.b, ss.phv from join_ut1 t1 left join lateral
+ ^
+<sql-statement>
+drop table join_pt1;
+</sql-statement>
+<sql-statement>
+drop table join_ut1;
+</sql-statement>
+<sql-statement>
+--
+-- test estimation behavior with multi-column foreign key and constant qual
+--
+begin;
+</sql-statement>
+<sql-statement>
+create table fkest (x integer, x10 integer, x10b integer, x100 integer);
+</sql-statement>
+<sql-statement>
+insert into fkest select x, x/10, x/10, x/100 from generate_series(1,1000) x;
+</sql-statement>
+<sql-statement>
+create unique index on fkest(x, x10, x100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ create unique index on fkest(x, x10, x100);
+ ^
+<sql-statement>
+analyze fkest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze fkest;
+ ^
+<sql-statement>
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+alter table fkest add constraint fk
+ foreign key (x, x10b, x100) references fkest (x, x10, x100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table fkest add constraint fk
+ ^
+<sql-statement>
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- test that foreign key join estimation performs sanely for outer joins
+--
+begin;
+</sql-statement>
+<sql-statement>
+create table fkest (a int, b int, c int unique, primary key(a,b));
+</sql-statement>
+<sql-statement>
+create table fkest1 (a int, b int, primary key(a,b));
+</sql-statement>
+<sql-statement>
+insert into fkest select x/10, x%10, x from generate_series(1,1000) x;
+</sql-statement>
+<sql-statement>
+insert into fkest1 select x/10, x%10 from generate_series(1,1000) x;
+</sql-statement>
+<sql-statement>
+alter table fkest1
+ add constraint fkest1_a_b_fkey foreign key (a,b) references fkest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table fkest1
+ ^
+<sql-statement>
+analyze fkest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze fkest;
+ ^
+<sql-statement>
+analyze fkest1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze fkest1;
+ ^
+<sql-statement>
+explain (costs off)
+select *
+from fkest f
+ left join fkest1 f1 on f.a = f1.a and f.b = f1.b
+ left join fkest1 f2 on f.a = f2.a and f.b = f2.b
+ left join fkest1 f3 on f.a = f3.a and f.b = f3.b
+where f.c = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- test planner's ability to mark joins as unique
+--
+create table j1 (id int primary key);
+</sql-statement>
+<sql-statement>
+create table j2 (id int primary key);
+</sql-statement>
+<sql-statement>
+create table j3 (id int);
+</sql-statement>
+<sql-statement>
+insert into j1 values(1),(2),(3);
+</sql-statement>
+<sql-statement>
+insert into j2 values(1),(2),(3);
+</sql-statement>
+<sql-statement>
+insert into j3 values(1),(1);
+</sql-statement>
+<sql-statement>
+analyze j1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j1;
+ ^
+<sql-statement>
+analyze j2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j2;
+ ^
+<sql-statement>
+analyze j3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j3;
+ ^
+<sql-statement>
+-- ensure join is properly marked as unique
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id = j2.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure join is properly marked as unique
+ ^
+<sql-statement>
+-- ensure join is not unique when not an equi-join
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id > j2.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure join is not unique when not an equi-join
+ ^
+<sql-statement>
+-- ensure non-unique rel is not chosen as inner
+explain (verbose, costs off)
+select * from j1 inner join j3 on j1.id = j3.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure non-unique rel is not chosen as inner
+ ^
+<sql-statement>
+-- ensure left join is marked as unique
+explain (verbose, costs off)
+select * from j1 left join j2 on j1.id = j2.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure left join is marked as unique
+ ^
+<sql-statement>
+-- ensure right join is marked as unique
+explain (verbose, costs off)
+select * from j1 right join j2 on j1.id = j2.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure right join is marked as unique
+ ^
+<sql-statement>
+-- ensure full join is marked as unique
+explain (verbose, costs off)
+select * from j1 full join j2 on j1.id = j2.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure full join is marked as unique
+ ^
+<sql-statement>
+-- a clauseless (cross) join can't be unique
+explain (verbose, costs off)
+select * from j1 cross join j2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- a clauseless (cross) join can't be unique
+ ^
+<sql-statement>
+-- ensure a natural join is marked as unique
+explain (verbose, costs off)
+select * from j1 natural join j2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure a natural join is marked as unique
+ ^
+<sql-statement>
+-- ensure a distinct clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select distinct id from j3) j3 on j1.id = j3.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure a distinct clause allows the inner to become unique
+ ^
+<sql-statement>
+-- ensure group by clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select id from j3 group by id) j3 on j1.id = j3.id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure group by clause allows the inner to become unique
+ ^
+<sql-statement>
+drop table j1;
+</sql-statement>
+<sql-statement>
+drop table j2;
+</sql-statement>
+<sql-statement>
+drop table j3;
+</sql-statement>
+<sql-statement>
+-- test more complex permutations of unique joins
+create table j1 (id1 int, id2 int, primary key(id1,id2));
+</sql-statement>
+<sql-statement>
+create table j2 (id1 int, id2 int, primary key(id1,id2));
+</sql-statement>
+<sql-statement>
+create table j3 (id1 int, id2 int, primary key(id1,id2));
+</sql-statement>
+<sql-statement>
+insert into j1 values(1,1),(1,2);
+</sql-statement>
+<sql-statement>
+insert into j2 values(1,1);
+</sql-statement>
+<sql-statement>
+insert into j3 values(1,1);
+</sql-statement>
+<sql-statement>
+analyze j1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j1;
+ ^
+<sql-statement>
+analyze j2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j2;
+ ^
+<sql-statement>
+analyze j3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j3;
+ ^
+<sql-statement>
+-- ensure there's no unique join when not all columns which are part of the
+-- unique index are seen in the join clause
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure there's no unique join when not all columns which are part of the
+ ^
+<sql-statement>
+-- ensure proper unique detection with multiple join quals
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure proper unique detection with multiple join quals
+ ^
+<sql-statement>
+-- ensure we don't detect the join to be unique when quals are not part of the
+-- join condition
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ensure we don't detect the join to be unique when quals are not part of the
+ ^
+<sql-statement>
+-- as above, but for left joins.
+explain (verbose, costs off)
+select * from j1
+left join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- as above, but for left joins.
+ ^
+<sql-statement>
+-- validate logic in merge joins which skips mark and restore.
+-- it should only do this if all quals which were used to detect the unique
+-- are present as join quals, and not plain quals.
+set enable_nestloop to 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_nestloop
+ -- validate logic in merge joins which skips mark and restore.
+ ^
+<sql-statement>
+set enable_hashjoin to 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashjoin
+ set enable_hashjoin to 0;
+ ^
+<sql-statement>
+set enable_sort to 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ set enable_sort to 0;
+ ^
+<sql-statement>
+-- create indexes that will be preferred over the PKs to perform the join
+create index j1_id1_idx on j1 (id1) where id1 % 1000 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: partial index is not supported yet
+ -- create indexes that will be preferred over the PKs to perform the join
+ ^
+<sql-statement>
+create index j2_id1_idx on j2 (id1) where id1 % 1000 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: partial index is not supported yet
+ create index j2_id1_idx on j2 (id1) where id1 % 1000 = 1;
+ ^
+<sql-statement>
+-- need an additional row in j2, if we want j2_id1_idx to be preferred
+insert into j2 values(1,2);
+</sql-statement>
+<sql-statement>
+analyze j2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze j2;
+ ^
+<sql-statement>
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from j1
+ ^
+<sql-statement>
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from j1
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id1
+ select * from j1
+ ^
+<sql-statement>
+-- Exercise array keys mark/restore B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Exercise array keys mark/restore B-Tree code
+ ^
+<sql-statement>
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from j1
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id1
+ select * from j1
+ ^
+<sql-statement>
+-- Exercise array keys "find extreme element" B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Exercise array keys "find extreme element" B-Tree code
+ ^
+<sql-statement>
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from j1
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id1
+ select * from j1
+ ^
+<sql-statement>
+reset enable_nestloop;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_nestloop;
+ ^
+<sql-statement>
+reset enable_hashjoin;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashjoin;
+ ^
+<sql-statement>
+reset enable_sort;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_sort;
+ ^
+<sql-statement>
+drop table j1;
+</sql-statement>
+<sql-statement>
+drop table j2;
+</sql-statement>
+<sql-statement>
+drop table j3;
+</sql-statement>
+<sql-statement>
+-- check that semijoin inner is not seen as unique for a portion of the outerrel
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from tenk1 t3
+ where t3.thousand = t1.unique1 and t3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check that semijoin inner is not seen as unique for a portion of the outerrel
+ ^
+<sql-statement>
+-- ... unless it actually is unique
+create table j3 as select unique1, tenthous from onek;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- ... unless it actually is unique
+ ^
+<sql-statement>
+vacuum analyze j3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ vacuum analyze j3;
+ ^
+<sql-statement>
+create unique index on j3(unique1, tenthous);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ create unique index on j3(unique1, tenthous);
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from j3
+ where j3.unique1 = t1.unique1 and j3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+drop table j3;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/join.out b/yql/essentials/tests/postgresql/cases/join.out
new file mode 100644
index 0000000000..226c2a4e26
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/join.out
@@ -0,0 +1,608 @@
+--
+-- JOIN
+-- Test JOIN clauses
+--
+CREATE TABLE J1_TBL (
+ i integer,
+ j integer,
+ t text
+);
+CREATE TABLE J2_TBL (
+ i integer,
+ k integer
+);
+INSERT INTO J1_TBL VALUES (1, 4, 'one');
+INSERT INTO J1_TBL VALUES (2, 3, 'two');
+INSERT INTO J1_TBL VALUES (3, 2, 'three');
+INSERT INTO J1_TBL VALUES (4, 1, 'four');
+INSERT INTO J1_TBL VALUES (5, 0, 'five');
+INSERT INTO J1_TBL VALUES (6, 6, 'six');
+INSERT INTO J1_TBL VALUES (7, 7, 'seven');
+INSERT INTO J1_TBL VALUES (8, 8, 'eight');
+INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
+INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
+INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
+INSERT INTO J2_TBL VALUES (1, -1);
+INSERT INTO J2_TBL VALUES (2, 2);
+INSERT INTO J2_TBL VALUES (3, -3);
+INSERT INTO J2_TBL VALUES (2, 4);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (0, NULL);
+INSERT INTO J2_TBL VALUES (NULL, NULL);
+INSERT INTO J2_TBL VALUES (NULL, 0);
+-- useful in some tests below
+create temp table onerow();
+--
+-- CORRELATION NAMES
+-- Make sure that table/column aliases are supported
+-- before diving into more complex join syntax.
+--
+SELECT *
+ FROM J1_TBL AS tx;
+ i | j | t
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL tx;
+ i | j | t
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL AS t1 (a, b, c);
+ a | b | c
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c);
+ a | b | c
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
+ ORDER BY a, d;
+ a | b | c | d
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+-- test join using aliases
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) WHERE J1_TBL.t = 'one'; -- ok
+ i | j | t | k
+---+---+-----+----
+ 1 | 4 | one | -1
+(1 row)
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1);
+ i | j | t | k
+---+---+---+---
+(0 rows)
+
+--
+-- More complicated constructs
+--
+--
+-- Multiway full join
+--
+CREATE TABLE t1 (name TEXT, n INTEGER);
+CREATE TABLE t2 (name TEXT, n INTEGER);
+CREATE TABLE t3 (name TEXT, n INTEGER);
+INSERT INTO t1 VALUES ( 'bb', 11 );
+INSERT INTO t2 VALUES ( 'bb', 12 );
+INSERT INTO t2 VALUES ( 'cc', 22 );
+INSERT INTO t2 VALUES ( 'ee', 42 );
+INSERT INTO t3 VALUES ( 'bb', 13 );
+INSERT INTO t3 VALUES ( 'cc', 23 );
+INSERT INTO t3 VALUES ( 'dd', 33 );
+-- Test for propagation of nullability constraints into sub-joins
+create temp table x (x1 int, x2 int);
+insert into x values (1,11);
+insert into x values (2,22);
+insert into x values (3,null);
+insert into x values (4,44);
+insert into x values (5,null);
+create temp table y (y1 int, y2 int);
+insert into y values (1,111);
+insert into y values (2,222);
+insert into y values (3,333);
+insert into y values (4,null);
+select * from x;
+ x1 | x2
+----+----
+ 1 | 11
+ 2 | 22
+ 3 |
+ 4 | 44
+ 5 |
+(5 rows)
+
+select * from y;
+ y1 | y2
+----+-----
+ 1 | 111
+ 2 | 222
+ 3 | 333
+ 4 |
+(4 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | 3 |
+ 4 | 44 | 4 | | 4 | 44
+ 5 | | | | 5 |
+(5 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and xx2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | |
+ 4 | 44 | 4 | | 4 | 44
+ 5 | | | | |
+(5 rows)
+
+-- these should NOT give the same answers as above
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (x2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 4 | 44 | 4 | | 4 | 44
+(3 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (y2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | 3 |
+(3 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (xx2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 4 | 44 | 4 | | 4 | 44
+(3 rows)
+
+--
+-- regression test: check for bug with propagation of implied equality
+-- to outside an IN
+--
+select count(*) from tenk1 a where unique1 in
+ (select unique1 from tenk1 b join tenk1 c using (unique1)
+ where b.unique2 = 42);
+ count
+-------
+ 1
+(1 row)
+
+-- try that with GEQO too
+begin;
+rollback;
+--
+-- regression test: check a case where join_clause_is_movable_into() gives
+-- an imprecise result, causing an assertion failure
+--
+select count(*)
+from
+ (select t3.tenthous as x1, coalesce(t1.stringu1, t2.stringu1) as x2
+ from tenk1 t1
+ left join tenk1 t2 on t1.unique1 = t2.unique1
+ join tenk1 t3 on t1.unique2 = t3.unique2) ss,
+ tenk1 t4,
+ tenk1 t5
+where t4.thousand = t5.unique1 and ss.x1 = t4.tenthous and ss.x2 = t5.stringu1;
+ count
+-------
+ 1000
+(1 row)
+
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+ count
+-------
+ 10000
+(1 row)
+
+--
+-- Clean up
+--
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE J1_TBL;
+DROP TABLE J2_TBL;
+-- Both DELETE and UPDATE allow the specification of additional tables
+-- to "join" against to determine which rows should be modified.
+CREATE TEMP TABLE t1 (a int, b int);
+CREATE TEMP TABLE t2 (a int, b int);
+CREATE TEMP TABLE t3 (x int, y int);
+INSERT INTO t1 VALUES (5, 10);
+INSERT INTO t1 VALUES (15, 20);
+INSERT INTO t1 VALUES (100, 100);
+INSERT INTO t1 VALUES (200, 1000);
+INSERT INTO t2 VALUES (200, 2000);
+INSERT INTO t3 VALUES (5, 20);
+INSERT INTO t3 VALUES (6, 7);
+INSERT INTO t3 VALUES (7, 8);
+INSERT INTO t3 VALUES (500, 100);
+--
+-- regression test for 8.1 merge right join bug
+--
+CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
+INSERT INTO tt1 VALUES (1, 11);
+INSERT INTO tt1 VALUES (2, NULL);
+CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
+INSERT INTO tt2 VALUES (21, 11);
+INSERT INTO tt2 VALUES (22, 11);
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+ count
+--------
+ 100000
+(1 row)
+
+--
+-- regression test for 8.2 bug with improper re-ordering of left joins
+--
+create temp table tt3(f1 int, f2 text);
+insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
+create index tt3i on tt3(f1);
+create temp table tt4(f1 int);
+insert into tt4 values (0),(1),(9999);
+--
+-- regression test for proper handling of outer joins within antijoins
+--
+create temp table tt4x(c1 int, c2 int, c3 int);
+--
+-- regression test for problems of the sort depicted in bug #3494
+--
+create temp table tt5(f1 int, f2 int);
+create temp table tt6(f1 int, f2 int);
+insert into tt5 values(1, 10);
+insert into tt5 values(1, 11);
+insert into tt6 values(1, 9);
+insert into tt6 values(1, 2);
+insert into tt6 values(2, 9);
+--
+-- regression test for problems of the sort depicted in bug #3588
+--
+create temp table xx (pkxx int);
+create temp table yy (pkyy int, pkxx int);
+insert into xx values (1);
+insert into xx values (2);
+insert into xx values (3);
+insert into yy values (101, 1);
+insert into yy values (201, 2);
+insert into yy values (301, NULL);
+--
+-- regression test for improper pushing of constants across outer-join clauses
+-- (as seen in early 8.2.x releases)
+--
+create temp table zt1 (f1 int primary key);
+create temp table zt2 (f2 int primary key);
+create temp table zt3 (f3 int primary key);
+insert into zt1 values(53);
+insert into zt2 values(53);
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zt1 on (f3 = f1)
+where f2 = 53;
+ f2 | f3 | f1
+----+----+----
+ 53 | |
+(1 row)
+
+--
+-- test for sane behavior with noncanonical merge clauses, per bug #4926
+--
+begin;
+create temp table a (i integer);
+create temp table b (x integer, y integer);
+select * from a left join b on i = x and i = y and x = i;
+ i | x | y
+---+---+---
+(0 rows)
+
+rollback;
+--
+-- test handling of merge clauses using record_ops
+--
+begin;
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+rollback;
+--
+-- test incorrect failure to NULL pulled-up subexpressions
+--
+begin;
+create temp table a (
+ code char not null,
+ constraint a_pk primary key (code)
+);
+create temp table b (
+ a char not null,
+ num integer not null,
+ constraint b_pk primary key (a, num)
+);
+create temp table c (
+ name char not null,
+ a char,
+ constraint c_pk primary key (name)
+);
+insert into a (code) values ('p');
+insert into a (code) values ('q');
+insert into b (a, num) values ('p', 1);
+insert into b (a, num) values ('p', 2);
+insert into c (name, a) values ('A', 'p');
+insert into c (name, a) values ('B', 'q');
+insert into c (name, a) values ('C', null);
+rollback;
+--
+-- test incorrect handling of placeholders that only appear in targetlists,
+-- per bug #6154
+--
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+ key1 | key3 | value2 | value3
+------+------+--------+--------
+ 1 | 1 | 1 | 1
+(1 row)
+
+-- test the path using join aliases, too
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, value2, COALESCE(value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+ key1 | key3 | value2 | value3
+------+------+--------+--------
+ 1 | 1 | 1 | 1
+(1 row)
+
+--
+-- nested nestloops can require nested PlaceHolderVars
+--
+create temp table nt1 (
+ id int primary key,
+ a1 boolean,
+ a2 boolean
+);
+insert into nt1 values (1,true,true);
+insert into nt1 values (2,true,false);
+insert into nt1 values (3,false,false);
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+ q1 | q2 | x | y
+------------------+------------------+------------------+----
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 123 | 123 | 42
+ 4567890123456789 | 123 | 123 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+(8 rows)
+
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+ unique2 | stringu1 | unique1 | stringu2
+---------+----------+---------+----------
+ 11 | WFAAAA | 3 | LKIAAA
+(1 row)
+
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+ count
+-------
+ 10
+(1 row)
+
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+ f1 | unique2 | case
+----+---------+------
+ 0 | 0 | 0
+(1 row)
+
+--
+-- test join removal
+--
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY, b_id int);
+CREATE TEMP TABLE b (id int PRIMARY KEY, c_id int);
+CREATE TEMP TABLE c (id int PRIMARY KEY);
+CREATE TEMP TABLE d (a int, b int);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+INSERT INTO c VALUES (0), (1);
+INSERT INTO d VALUES (1,3), (2,2), (3,1);
+rollback;
+create temp table parent (k int primary key, pd int);
+create temp table child (k int unique, cd int);
+insert into parent values (1, 10), (2, 20), (3, 30);
+insert into child values (1, 100), (4, 400);
+-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+ k | pd
+---+----
+(0 rows)
+
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+ k | pd
+---+----
+(0 rows)
+
+-- bug 5255: this is not optimizable by join removal
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY);
+CREATE TEMP TABLE b (id int PRIMARY KEY, a_id int);
+INSERT INTO a VALUES (0), (1);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+rollback;
+-- another join removal bug: this is not optimizable, either
+begin;
+create temp table innertab (id int8 primary key, dat1 int8);
+insert into innertab values(123, 42);
+rollback;
+-- another join removal bug: we must clean up correctly when removing a PHV
+begin;
+create temp table uniquetbl (f1 text unique);
+rollback;
+create table join_ut1 (a int, b int, c varchar);
+insert into join_ut1 values (101, 101, 'y'), (2, 2, 'z');
+drop table join_ut1;
+--
+-- test estimation behavior with multi-column foreign key and constant qual
+--
+begin;
+create table fkest (x integer, x10 integer, x10b integer, x100 integer);
+insert into fkest select x, x/10, x/10, x/100 from generate_series(1,1000) x;
+rollback;
+--
+-- test that foreign key join estimation performs sanely for outer joins
+--
+begin;
+create table fkest (a int, b int, c int unique, primary key(a,b));
+create table fkest1 (a int, b int, primary key(a,b));
+insert into fkest select x/10, x%10, x from generate_series(1,1000) x;
+insert into fkest1 select x/10, x%10 from generate_series(1,1000) x;
+rollback;
+--
+-- test planner's ability to mark joins as unique
+--
+create table j1 (id int primary key);
+create table j2 (id int primary key);
+create table j3 (id int);
+insert into j1 values(1),(2),(3);
+insert into j2 values(1),(2),(3);
+insert into j3 values(1),(1);
+drop table j1;
+drop table j2;
+drop table j3;
+-- test more complex permutations of unique joins
+create table j1 (id1 int, id2 int, primary key(id1,id2));
+create table j2 (id1 int, id2 int, primary key(id1,id2));
+create table j3 (id1 int, id2 int, primary key(id1,id2));
+insert into j1 values(1,1),(1,2);
+insert into j2 values(1,1);
+insert into j3 values(1,1);
+-- need an additional row in j2, if we want j2_id1_idx to be preferred
+insert into j2 values(1,2);
+drop table j1;
+drop table j2;
+drop table j3;
diff --git a/yql/essentials/tests/postgresql/cases/join.sql b/yql/essentials/tests/postgresql/cases/join.sql
new file mode 100644
index 0000000000..38db347d39
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/join.sql
@@ -0,0 +1,398 @@
+--
+-- JOIN
+-- Test JOIN clauses
+--
+CREATE TABLE J1_TBL (
+ i integer,
+ j integer,
+ t text
+);
+CREATE TABLE J2_TBL (
+ i integer,
+ k integer
+);
+INSERT INTO J1_TBL VALUES (1, 4, 'one');
+INSERT INTO J1_TBL VALUES (2, 3, 'two');
+INSERT INTO J1_TBL VALUES (3, 2, 'three');
+INSERT INTO J1_TBL VALUES (4, 1, 'four');
+INSERT INTO J1_TBL VALUES (5, 0, 'five');
+INSERT INTO J1_TBL VALUES (6, 6, 'six');
+INSERT INTO J1_TBL VALUES (7, 7, 'seven');
+INSERT INTO J1_TBL VALUES (8, 8, 'eight');
+INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
+INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
+INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
+INSERT INTO J2_TBL VALUES (1, -1);
+INSERT INTO J2_TBL VALUES (2, 2);
+INSERT INTO J2_TBL VALUES (3, -3);
+INSERT INTO J2_TBL VALUES (2, 4);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (0, NULL);
+INSERT INTO J2_TBL VALUES (NULL, NULL);
+INSERT INTO J2_TBL VALUES (NULL, 0);
+-- useful in some tests below
+create temp table onerow();
+--
+-- CORRELATION NAMES
+-- Make sure that table/column aliases are supported
+-- before diving into more complex join syntax.
+--
+SELECT *
+ FROM J1_TBL AS tx;
+SELECT *
+ FROM J1_TBL tx;
+SELECT *
+ FROM J1_TBL AS t1 (a, b, c);
+SELECT *
+ FROM J1_TBL t1 (a, b, c);
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
+ ORDER BY a, d;
+-- test join using aliases
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) WHERE J1_TBL.t = 'one'; -- ok
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1);
+--
+-- More complicated constructs
+--
+--
+-- Multiway full join
+--
+CREATE TABLE t1 (name TEXT, n INTEGER);
+CREATE TABLE t2 (name TEXT, n INTEGER);
+CREATE TABLE t3 (name TEXT, n INTEGER);
+INSERT INTO t1 VALUES ( 'bb', 11 );
+INSERT INTO t2 VALUES ( 'bb', 12 );
+INSERT INTO t2 VALUES ( 'cc', 22 );
+INSERT INTO t2 VALUES ( 'ee', 42 );
+INSERT INTO t3 VALUES ( 'bb', 13 );
+INSERT INTO t3 VALUES ( 'cc', 23 );
+INSERT INTO t3 VALUES ( 'dd', 33 );
+-- Test for propagation of nullability constraints into sub-joins
+create temp table x (x1 int, x2 int);
+insert into x values (1,11);
+insert into x values (2,22);
+insert into x values (3,null);
+insert into x values (4,44);
+insert into x values (5,null);
+create temp table y (y1 int, y2 int);
+insert into y values (1,111);
+insert into y values (2,222);
+insert into y values (3,333);
+insert into y values (4,null);
+select * from x;
+select * from y;
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and xx2 is not null);
+-- these should NOT give the same answers as above
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (x2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (y2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (xx2 is not null);
+--
+-- regression test: check for bug with propagation of implied equality
+-- to outside an IN
+--
+select count(*) from tenk1 a where unique1 in
+ (select unique1 from tenk1 b join tenk1 c using (unique1)
+ where b.unique2 = 42);
+-- try that with GEQO too
+begin;
+rollback;
+--
+-- regression test: check a case where join_clause_is_movable_into() gives
+-- an imprecise result, causing an assertion failure
+--
+select count(*)
+from
+ (select t3.tenthous as x1, coalesce(t1.stringu1, t2.stringu1) as x2
+ from tenk1 t1
+ left join tenk1 t2 on t1.unique1 = t2.unique1
+ join tenk1 t3 on t1.unique2 = t3.unique2) ss,
+ tenk1 t4,
+ tenk1 t5
+where t4.thousand = t5.unique1 and ss.x1 = t4.tenthous and ss.x2 = t5.stringu1;
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+--
+-- Clean up
+--
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE J1_TBL;
+DROP TABLE J2_TBL;
+-- Both DELETE and UPDATE allow the specification of additional tables
+-- to "join" against to determine which rows should be modified.
+CREATE TEMP TABLE t1 (a int, b int);
+CREATE TEMP TABLE t2 (a int, b int);
+CREATE TEMP TABLE t3 (x int, y int);
+INSERT INTO t1 VALUES (5, 10);
+INSERT INTO t1 VALUES (15, 20);
+INSERT INTO t1 VALUES (100, 100);
+INSERT INTO t1 VALUES (200, 1000);
+INSERT INTO t2 VALUES (200, 2000);
+INSERT INTO t3 VALUES (5, 20);
+INSERT INTO t3 VALUES (6, 7);
+INSERT INTO t3 VALUES (7, 8);
+INSERT INTO t3 VALUES (500, 100);
+--
+-- regression test for 8.1 merge right join bug
+--
+CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
+INSERT INTO tt1 VALUES (1, 11);
+INSERT INTO tt1 VALUES (2, NULL);
+CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
+INSERT INTO tt2 VALUES (21, 11);
+INSERT INTO tt2 VALUES (22, 11);
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+--
+-- regression test for 8.2 bug with improper re-ordering of left joins
+--
+create temp table tt3(f1 int, f2 text);
+insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
+create index tt3i on tt3(f1);
+create temp table tt4(f1 int);
+insert into tt4 values (0),(1),(9999);
+--
+-- regression test for proper handling of outer joins within antijoins
+--
+create temp table tt4x(c1 int, c2 int, c3 int);
+--
+-- regression test for problems of the sort depicted in bug #3494
+--
+create temp table tt5(f1 int, f2 int);
+create temp table tt6(f1 int, f2 int);
+insert into tt5 values(1, 10);
+insert into tt5 values(1, 11);
+insert into tt6 values(1, 9);
+insert into tt6 values(1, 2);
+insert into tt6 values(2, 9);
+--
+-- regression test for problems of the sort depicted in bug #3588
+--
+create temp table xx (pkxx int);
+create temp table yy (pkyy int, pkxx int);
+insert into xx values (1);
+insert into xx values (2);
+insert into xx values (3);
+insert into yy values (101, 1);
+insert into yy values (201, 2);
+insert into yy values (301, NULL);
+--
+-- regression test for improper pushing of constants across outer-join clauses
+-- (as seen in early 8.2.x releases)
+--
+create temp table zt1 (f1 int primary key);
+create temp table zt2 (f2 int primary key);
+create temp table zt3 (f3 int primary key);
+insert into zt1 values(53);
+insert into zt2 values(53);
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zt1 on (f3 = f1)
+where f2 = 53;
+--
+-- test for sane behavior with noncanonical merge clauses, per bug #4926
+--
+begin;
+create temp table a (i integer);
+create temp table b (x integer, y integer);
+select * from a left join b on i = x and i = y and x = i;
+rollback;
+--
+-- test handling of merge clauses using record_ops
+--
+begin;
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+rollback;
+--
+-- test incorrect failure to NULL pulled-up subexpressions
+--
+begin;
+create temp table a (
+ code char not null,
+ constraint a_pk primary key (code)
+);
+create temp table b (
+ a char not null,
+ num integer not null,
+ constraint b_pk primary key (a, num)
+);
+create temp table c (
+ name char not null,
+ a char,
+ constraint c_pk primary key (name)
+);
+insert into a (code) values ('p');
+insert into a (code) values ('q');
+insert into b (a, num) values ('p', 1);
+insert into b (a, num) values ('p', 2);
+insert into c (name, a) values ('A', 'p');
+insert into c (name, a) values ('B', 'q');
+insert into c (name, a) values ('C', null);
+rollback;
+--
+-- test incorrect handling of placeholders that only appear in targetlists,
+-- per bug #6154
+--
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+-- test the path using join aliases, too
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, value2, COALESCE(value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+--
+-- nested nestloops can require nested PlaceHolderVars
+--
+create temp table nt1 (
+ id int primary key,
+ a1 boolean,
+ a2 boolean
+);
+insert into nt1 values (1,true,true);
+insert into nt1 values (2,true,false);
+insert into nt1 values (3,false,false);
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+--
+-- test join removal
+--
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY, b_id int);
+CREATE TEMP TABLE b (id int PRIMARY KEY, c_id int);
+CREATE TEMP TABLE c (id int PRIMARY KEY);
+CREATE TEMP TABLE d (a int, b int);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+INSERT INTO c VALUES (0), (1);
+INSERT INTO d VALUES (1,3), (2,2), (3,1);
+rollback;
+create temp table parent (k int primary key, pd int);
+create temp table child (k int unique, cd int);
+insert into parent values (1, 10), (2, 20), (3, 30);
+insert into child values (1, 100), (4, 400);
+-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+-- bug 5255: this is not optimizable by join removal
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY);
+CREATE TEMP TABLE b (id int PRIMARY KEY, a_id int);
+INSERT INTO a VALUES (0), (1);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+rollback;
+-- another join removal bug: this is not optimizable, either
+begin;
+create temp table innertab (id int8 primary key, dat1 int8);
+insert into innertab values(123, 42);
+rollback;
+-- another join removal bug: we must clean up correctly when removing a PHV
+begin;
+create temp table uniquetbl (f1 text unique);
+rollback;
+create table join_ut1 (a int, b int, c varchar);
+insert into join_ut1 values (101, 101, 'y'), (2, 2, 'z');
+drop table join_ut1;
+--
+-- test estimation behavior with multi-column foreign key and constant qual
+--
+begin;
+create table fkest (x integer, x10 integer, x10b integer, x100 integer);
+insert into fkest select x, x/10, x/10, x/100 from generate_series(1,1000) x;
+rollback;
+--
+-- test that foreign key join estimation performs sanely for outer joins
+--
+begin;
+create table fkest (a int, b int, c int unique, primary key(a,b));
+create table fkest1 (a int, b int, primary key(a,b));
+insert into fkest select x/10, x%10, x from generate_series(1,1000) x;
+insert into fkest1 select x/10, x%10 from generate_series(1,1000) x;
+rollback;
+--
+-- test planner's ability to mark joins as unique
+--
+create table j1 (id int primary key);
+create table j2 (id int primary key);
+create table j3 (id int);
+insert into j1 values(1),(2),(3);
+insert into j2 values(1),(2),(3);
+insert into j3 values(1),(1);
+drop table j1;
+drop table j2;
+drop table j3;
+-- test more complex permutations of unique joins
+create table j1 (id1 int, id2 int, primary key(id1,id2));
+create table j2 (id1 int, id2 int, primary key(id1,id2));
+create table j3 (id1 int, id2 int, primary key(id1,id2));
+insert into j1 values(1,1),(1,2);
+insert into j2 values(1,1);
+insert into j3 values(1,1);
+-- need an additional row in j2, if we want j2_id1_idx to be preferred
+insert into j2 values(1,2);
+drop table j1;
+drop table j2;
+drop table j3;
diff --git a/yql/essentials/tests/postgresql/cases/json.err b/yql/essentials/tests/postgresql/cases/json.err
new file mode 100644
index 0000000000..ce67851376
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json.err
@@ -0,0 +1,3999 @@
+<sql-statement>
+-- Strings.
+SELECT '""'::json; -- OK.
+</sql-statement>
+<sql-statement>
+SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+
+ SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+ ^
+<sql-statement>
+SELECT '"abc"'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '"abc'::json; -- ERROR, quotes not closed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"abc'::json; -- ERROR, quotes not closed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+
+ SELECT '"abc'::json; -- ERROR, quotes not closed
+ ^
+<sql-statement>
+SELECT '"abc
+def"'::json; -- ERROR, unescaped newline in string constant
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"abc
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+
+ SELECT '"abc
+ ^
+<sql-statement>
+SELECT '"\n\"\\"'::json; -- OK, legal escapes
+</sql-statement>
+<sql-statement>
+SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+
+ SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+ ^
+<sql-statement>
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '0'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '01'::json; -- ERROR, not valid according to JSON spec
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '01'::json; -- ERROR, not valid according to JSON spec
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+
+ SELECT '01'::json; -- ERROR, not valid according to JSON spec
+ ^
+<sql-statement>
+SELECT '0.1'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8
+</sql-statement>
+<sql-statement>
+SELECT '1e100'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '1.3e100'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '1f2'::json; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1f2'::json; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+
+ SELECT '1f2'::json; -- ERROR
+ ^
+<sql-statement>
+SELECT '0.x1'::json; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '0.x1'::json; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+
+ SELECT '0.x1'::json; -- ERROR
+ ^
+<sql-statement>
+SELECT '1.3ex100'::json; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1.3ex100'::json; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+
+ SELECT '1.3ex100'::json; -- ERROR
+ ^
+<sql-statement>
+-- Arrays.
+SELECT '[]'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[1,2]'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[1,2,]'::json; -- ERROR, trailing comma
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,2,]'::json; -- ERROR, trailing comma
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+
+ SELECT '[1,2,]'::json; -- ERROR, trailing comma
+ ^
+<sql-statement>
+SELECT '[1,2'::json; -- ERROR, no closing bracket
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,2'::json; -- ERROR, no closing bracket
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+
+ SELECT '[1,2'::json; -- ERROR, no closing bracket
+ ^
+<sql-statement>
+SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+
+ SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+ ^
+<sql-statement>
+-- Objects.
+SELECT '{}'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{"abc"}'::json; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"}'::json; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+
+ SELECT '{"abc"}'::json; -- ERROR, no value
+ ^
+<sql-statement>
+SELECT '{"abc":1}'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+
+ SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+ ^
+<sql-statement>
+SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+
+ SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+
+ SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+
+ SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+
+ SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+ ^
+<sql-statement>
+SELECT '{"abc":1,3}'::json; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc":1,3}'::json; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+
+ SELECT '{"abc":1,3}'::json; -- ERROR, no value
+ ^
+<sql-statement>
+-- Miscellaneous stuff.
+SELECT 'true'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT 'false'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT 'null'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT ' true '::json; -- OK, even with extra whitespace
+</sql-statement>
+<sql-statement>
+SELECT 'true false'::json; -- ERROR, too many values
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'true false'::json; -- ERROR, too many values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+
+ SELECT 'true false'::json; -- ERROR, too many values
+ ^
+<sql-statement>
+SELECT 'true, false'::json; -- ERROR, too many values
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'true, false'::json; -- ERROR, too many values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+
+ SELECT 'true, false'::json; -- ERROR, too many values
+ ^
+<sql-statement>
+SELECT 'truf'::json; -- ERROR, not a keyword
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'truf'::json; -- ERROR, not a keyword
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+
+ SELECT 'truf'::json; -- ERROR, not a keyword
+ ^
+<sql-statement>
+SELECT 'trues'::json; -- ERROR, not a keyword
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'trues'::json; -- ERROR, not a keyword
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+
+ SELECT 'trues'::json; -- ERROR, not a keyword
+ ^
+<sql-statement>
+SELECT ''::json; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ''::json; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+
+ SELECT ''::json; -- ERROR, no value
+ ^
+<sql-statement>
+SELECT ' '::json; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ' '::json; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+
+ SELECT ' '::json; -- ERROR, no value
+ ^
+<sql-statement>
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::json; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::json;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+
+ SELECT '{
+ ^
+<sql-statement>
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+
+ SELECT '{
+ ^
+<sql-statement>
+-- ERROR missing value for last field
+--constructors
+-- array_to_json
+SELECT array_to_json(array(select 1 as a));
+</sql-statement>
+<sql-statement>
+SELECT array_to_json(array_agg(q),false) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+</sql-statement>
+-stdin-:<main>: Fatal: No such type: 0
+
+<sql-statement>
+SELECT array_to_json(array_agg(q),true) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+</sql-statement>
+-stdin-:<main>: Fatal: No such type: 0
+
+<sql-statement>
+SELECT array_to_json(array_agg(q),false)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:16: Error: alternative is not implemented yet : 138
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT array_to_json(array_agg(q),false)
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT array_to_json(array_agg(q),false)
+ ^
+<sql-statement>
+SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x;
+</sql-statement>
+<sql-statement>
+SELECT array_to_json('{{1,5},{99,100}}'::int[]);
+</sql-statement>
+<sql-statement>
+-- row_to_json
+SELECT row_to_json(row(1,'foo'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: alternative is not implemented yet : 138
+ SELECT row_to_json(row(1,'foo'));
+ ^
+<sql-statement>
+SELECT row_to_json(q)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:10: Error: alternative is not implemented yet : 138
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT row_to_json(q)
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT row_to_json(q)
+ ^
+<sql-statement>
+SELECT row_to_json(q,true)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:10: Error: alternative is not implemented yet : 138
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT row_to_json(q,true)
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT row_to_json(q,true)
+ ^
+<sql-statement>
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TEMP TABLE rows AS
+ ^
+<sql-statement>
+SELECT row_to_json(q,true)
+FROM rows q;
+</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.rows
+
+<sql-statement>
+SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 138
+ SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
+ ^
+<sql-statement>
+-- anyarray column
+analyze rows;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ -- anyarray column
+ ^
+<sql-statement>
+select attname, to_json(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 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 attname, to_json(histogram_bounds) histogram_bounds
+ ^
+ -stdin-:<main>:1:17: Error: At function: PgCall
+ select attname, to_json(histogram_bounds) histogram_bounds
+ ^
+ -stdin-:<main>:1:17: Error: Unable to find an overload for proc to_json with given argument types: (anyarray)
+ select attname, to_json(histogram_bounds) histogram_bounds
+ ^
+<sql-statement>
+-- to_json, timestamps
+select to_json(timestamp '2014-05-28 12:22:35.614298');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- to_json, timestamps
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select to_json(timestamp '2014-05-28 12:22:35.614298');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp)
+ select to_json(timestamp '2014-05-28 12:22:35.614298');
+ ^
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SET LOCAL TIME ZONE 10.5;
+</sql-statement>
+<sql-statement>
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+</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 to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz)
+ select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+<sql-statement>
+SET LOCAL TIME ZONE -8;
+</sql-statement>
+<sql-statement>
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+</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 to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz)
+ select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+select to_json(date '2014-05-28');
+</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 to_json(date '2014-05-28');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(date '2014-05-28');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date)
+ select to_json(date '2014-05-28');
+ ^
+<sql-statement>
+select to_json(date 'Infinity');
+</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 to_json(date 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(date 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date)
+ select to_json(date 'Infinity');
+ ^
+<sql-statement>
+select to_json(date '-Infinity');
+</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 to_json(date '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(date '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date)
+ select to_json(date '-Infinity');
+ ^
+<sql-statement>
+select to_json(timestamp 'Infinity');
+</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 to_json(timestamp 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamp 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp)
+ select to_json(timestamp 'Infinity');
+ ^
+<sql-statement>
+select to_json(timestamp '-Infinity');
+</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 to_json(timestamp '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamp '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp)
+ select to_json(timestamp '-Infinity');
+ ^
+<sql-statement>
+select to_json(timestamptz 'Infinity');
+</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 to_json(timestamptz 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamptz 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz)
+ select to_json(timestamptz 'Infinity');
+ ^
+<sql-statement>
+select to_json(timestamptz '-Infinity');
+</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 to_json(timestamptz '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_json(timestamptz '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz)
+ select to_json(timestamptz '-Infinity');
+ ^
+<sql-statement>
+--json_agg
+SELECT json_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:16: Error: alternative is not implemented yet : 138
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ --json_agg
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ --json_agg
+ ^
+<sql-statement>
+SELECT json_agg(q ORDER BY x, y)
+ FROM rows q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ SELECT json_agg(q ORDER BY x, y)
+ ^
+<sql-statement>
+UPDATE rows SET x = NULL WHERE x = 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 json_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ SELECT json_agg(q ORDER BY x NULLS FIRST, y)
+ ^
+<sql-statement>
+-- non-numeric output
+SELECT row_to_json(q)
+FROM (SELECT 'NaN'::float8 AS "float8field") q;
+</sql-statement>
+<sql-statement>
+SELECT row_to_json(q)
+FROM (SELECT 'Infinity'::float8 AS "float8field") q;
+</sql-statement>
+<sql-statement>
+SELECT row_to_json(q)
+FROM (SELECT '-Infinity'::float8 AS "float8field") q;
+</sql-statement>
+<sql-statement>
+-- json input
+SELECT row_to_json(q)
+FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q;
+</sql-statement>
+<sql-statement>
+-- json extraction functions
+CREATE TEMP TABLE test_json (
+ json_type text,
+ test_json json
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_json VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json->'field2'
+FROM test_json
+WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json->>'field2'
+FROM test_json
+WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> -1
+FROM test_json
+WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json->>2
+FROM test_json
+WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'scalar';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_object_keys(test_json)
+ ^
+<sql-statement>
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'array';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_object_keys(test_json)
+ ^
+<sql-statement>
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'object';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_object_keys(test_json)
+ ^
+<sql-statement>
+-- test extending object_keys resultset - initial resultset size is 256
+select count(*) from
+ (select json_object_keys(json_object(array_agg(g)))
+ from (select unnest(array['f'||n,n::text])as g
+ from generate_series(1,300) as n) x ) y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:19: Error: Generator functions are not allowed in: SELECT
+ from (select unnest(array['f'||n,n::text])as g
+ ^
+ -stdin-:<main>:3:13: Error: Generator functions are not allowed in: SELECT
+ (select json_object_keys(json_object(array_agg(g)))
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- test extending object_keys resultset - initial resultset size is 256
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- test extending object_keys resultset - initial resultset size is 256
+ ^
+<sql-statement>
+-- nulls
+select (test_json->'field3') is null as expect_false
+from test_json
+where json_type = 'object';
+</sql-statement>
+<sql-statement>
+select (test_json->>'field3') is null as expect_true
+from test_json
+where json_type = 'object';
+</sql-statement>
+<sql-statement>
+select (test_json->3) is null as expect_false
+from test_json
+where json_type = 'array';
+</sql-statement>
+<sql-statement>
+select (test_json->>3) is null as expect_true
+from test_json
+where json_type = 'array';
+</sql-statement>
+<sql-statement>
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> '';
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 1;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 3;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": "c", "b": null}'::json -> 'b';
+</sql-statement>
+<sql-statement>
+select '"foo"'::json -> 1;
+</sql-statement>
+<sql-statement>
+select '"foo"'::json -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> '';
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": "c", "b": null}'::json ->> 'b';
+</sql-statement>
+<sql-statement>
+select '"foo"'::json ->> 1;
+</sql-statement>
+<sql-statement>
+select '"foo"'::json ->> 'z';
+</sql-statement>
+<sql-statement>
+-- array length
+SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+</sql-statement>
+<sql-statement>
+SELECT json_array_length('[]');
+</sql-statement>
+<sql-statement>
+SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot get array length of a non-array
+
+ SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+ ^
+<sql-statement>
+SELECT json_array_length('4');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_array_length('4');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot get array length of a scalar
+
+ SELECT json_array_length('4');
+ ^
+<sql-statement>
+-- each
+select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+ ^
+<sql-statement>
+select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+</sql-statement>
+<sql-statement>
+select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+ ^
+<sql-statement>
+select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+</sql-statement>
+<sql-statement>
+-- extract_path, extract_path_as_text
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+</sql-statement>
+<sql-statement>
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+</sql-statement>
+<sql-statement>
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+</sql-statement>
+<sql-statement>
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+</sql-statement>
+<sql-statement>
+-- extract_path nulls
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false;
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true;
+</sql-statement>
+<sql-statement>
+select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false;
+</sql-statement>
+<sql-statement>
+select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true;
+</sql-statement>
+<sql-statement>
+-- extract_path operators
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6'];
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- extract_path operators
+ ^
+ -stdin-:<main>:2:61: Error: At function: PgOp
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6'];
+ ^
+ -stdin-:<main>:2:61: Error: No such operator: #>
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6'];
+ ^
+<sql-statement>
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+ ^
+<sql-statement>
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+</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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+ ^
+<sql-statement>
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1'];
+ ^
+<sql-statement>
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>>
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+ ^
+<sql-statement>
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>>
+ select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+ ^
+<sql-statement>
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+</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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>>
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+ ^
+<sql-statement>
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1'];
+ ^
+ -stdin-:<main>:1:61: Error: At function: PgOp
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1'];
+ ^
+ -stdin-:<main>:1:61: Error: No such operator: #>>
+ select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1'];
+ ^
+<sql-statement>
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::json #> '{}';
+</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 for same
+ ^
+ -stdin-:<main>:2:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> '{}';
+ ^
+ -stdin-:<main>:2:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> '{}';
+ ^
+<sql-statement>
+select '[1,2,3]'::json #> '{}';
+</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 '[1,2,3]'::json #> '{}';
+ ^
+ -stdin-:<main>:1:24: Error: At function: PgOp
+ select '[1,2,3]'::json #> '{}';
+ ^
+ -stdin-:<main>:1:24: Error: No such operator: #>
+ select '[1,2,3]'::json #> '{}';
+ ^
+<sql-statement>
+select '"foo"'::json #> '{}';
+</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 '"foo"'::json #> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select '"foo"'::json #> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>
+ select '"foo"'::json #> '{}';
+ ^
+<sql-statement>
+select '42'::json #> '{}';
+</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 '42'::json #> '{}';
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #> '{}';
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>
+ select '42'::json #> '{}';
+ ^
+<sql-statement>
+select 'null'::json #> '{}';
+</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 'null'::json #> '{}';
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgOp
+ select 'null'::json #> '{}';
+ ^
+ -stdin-:<main>:1:21: Error: No such operator: #>
+ select 'null'::json #> '{}';
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', 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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:49: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:49: Error: No such operator: #>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:49: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:49: Error: No such operator: #>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+</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 '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+ ^
+<sql-statement>
+select '"foo"'::json #> array['z'];
+</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 '"foo"'::json #> array['z'];
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select '"foo"'::json #> array['z'];
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>
+ select '"foo"'::json #> array['z'];
+ ^
+<sql-statement>
+select '42'::json #> array['f2'];
+</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 '42'::json #> array['f2'];
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #> array['f2'];
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>
+ select '42'::json #> array['f2'];
+ ^
+<sql-statement>
+select '42'::json #> array['0'];
+</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 '42'::json #> array['0'];
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #> array['0'];
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>
+ select '42'::json #> array['0'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+ ^
+<sql-statement>
+select '[1,2,3]'::json #>> '{}';
+</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 '[1,2,3]'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:24: Error: At function: PgOp
+ select '[1,2,3]'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:24: Error: No such operator: #>>
+ select '[1,2,3]'::json #>> '{}';
+ ^
+<sql-statement>
+select '"foo"'::json #>> '{}';
+</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 '"foo"'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select '"foo"'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>>
+ select '"foo"'::json #>> '{}';
+ ^
+<sql-statement>
+select '42'::json #>> '{}';
+</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 '42'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>>
+ select '42'::json #>> '{}';
+ ^
+<sql-statement>
+select 'null'::json #>> '{}';
+</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 'null'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgOp
+ select 'null'::json #>> '{}';
+ ^
+ -stdin-:<main>:1:21: Error: No such operator: #>>
+ select 'null'::json #>> '{}';
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', 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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:49: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:49: Error: No such operator: #>>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:49: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:49: Error: No such operator: #>>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+</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 '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:42: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+ ^
+<sql-statement>
+select '"foo"'::json #>> array['z'];
+</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 '"foo"'::json #>> array['z'];
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select '"foo"'::json #>> array['z'];
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>>
+ select '"foo"'::json #>> array['z'];
+ ^
+<sql-statement>
+select '42'::json #>> array['f2'];
+</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 '42'::json #>> array['f2'];
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #>> array['f2'];
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>>
+ select '42'::json #>> array['f2'];
+ ^
+<sql-statement>
+select '42'::json #>> array['0'];
+</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 '42'::json #>> array['0'];
+ ^
+ -stdin-:<main>:1:19: Error: At function: PgOp
+ select '42'::json #>> array['0'];
+ ^
+ -stdin-:<main>:1:19: Error: No such operator: #>>
+ select '42'::json #>> array['0'];
+ ^
+<sql-statement>
+-- array_elements
+select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ ^
+<sql-statement>
+select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+</sql-statement>
+<sql-statement>
+select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ ^
+<sql-statement>
+select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+</sql-statement>
+<sql-statement>
+-- populate_record
+create type jpop as (a text, b int, c timestamp);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ -- populate_record
+ ^
+<sql-statement>
+CREATE DOMAIN js_int_not_null AS int NOT NULL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN js_int_not_null AS int NOT NULL;
+ ^
+<sql-statement>
+CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+ ^
+<sql-statement>
+CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+ ^
+<sql-statement>
+create type j_unordered_pair as (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ create type j_unordered_pair as (x int, y int);
+ ^
+<sql-statement>
+create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y);
+ ^
+<sql-statement>
+CREATE TYPE jsrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d js_int_array_1d,
+ ia2d js_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jpop,
+ reca jpop[]
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ CREATE TYPE jsrec AS (
+ ^
+<sql-statement>
+CREATE TYPE jsrec_i_not_null AS (
+ i js_int_not_null
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ CREATE TYPE jsrec_i_not_null AS (
+ ^
+<sql-statement>
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jpop
+ select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:70: Error: alternative is not implemented yet : 138
+ select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jpop
+ select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:70: Error: alternative is not implemented yet : 138
+ select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jpop
+ select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:70: Error: alternative is not implemented yet : 138
+ select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:70: Error: alternative is not implemented yet : 138
+ select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:70: Error: alternative is not implemented yet : 138
+ select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q;
+ ^
+<sql-statement>
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec_i_not_null
+ SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q;
+ ^
+<sql-statement>
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec_i_not_null
+ SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q;
+ ^
+<sql-statement>
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec_i_not_null
+ SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+ ^
+<sql-statement>
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
+ ^
+<sql-statement>
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
+ ^
+<sql-statement>
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+ ^
+<sql-statement>
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec
+ SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
+ ^
+<sql-statement>
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec
+ SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q;
+ ^
+<sql-statement>
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec
+ SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q;
+ ^
+<sql-statement>
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: Unknown type: jsrec
+ SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q;
+ ^
+<sql-statement>
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q;
+ ^
+<sql-statement>
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
+ ^
+<sql-statement>
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+ ^
+<sql-statement>
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+ ^
+<sql-statement>
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsrec
+ SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+ ^
+<sql-statement>
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q;
+ ^
+<sql-statement>
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q;
+ ^
+<sql-statement>
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+ ^
+<sql-statement>
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsrec
+ SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+ ^
+<sql-statement>
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
+ ^
+<sql-statement>
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsrec
+ SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+ ^
+<sql-statement>
+SELECT rec FROM json_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:49: Error: alternative is not implemented yet : 138
+ row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec,
+ ^
+<sql-statement>
+-- anonymous record type
+SELECT json_populate_record(null::record, '{"x": 0, "y": 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
+ -- anonymous record type
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT json_populate_record(null::record, '{"x": 0, "y": 1}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc json_populate_record with given argument types: (record,unknown)
+ SELECT json_populate_record(null::record, '{"x": 0, "y": 1}');
+ ^
+<sql-statement>
+SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 138
+ SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+ ^
+<sql-statement>
+SELECT * FROM
+ json_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- composite domain
+SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:35: Error: Unknown type: j_ordered_pair
+ SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}');
+ ^
+<sql-statement>
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:39: Error: alternative is not implemented yet : 138
+ SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}');
+ ^
+<sql-statement>
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:39: Error: alternative is not implemented yet : 138
+ SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}');
+ ^
+<sql-statement>
+-- populate_recordset
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:45: Error: Unknown type: jpop
+ select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jpop
+ select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+create type jpop2 as (a int, b json, c int, d int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ create type jpop2 as (a int, b json, c int, d int);
+ ^
+<sql-statement>
+select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jpop2
+ select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jpop
+ select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 138
+ select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+-- anonymous record type
+SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+ ^
+<sql-statement>
+SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+ ^
+<sql-statement>
+SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:11: Error: Generator functions are not allowed in: SELECT
+ SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+ ^
+<sql-statement>
+SELECT * FROM
+ json_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- empty array is a corner case
+SELECT json_populate_recordset(null::record, '[]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(null::record, '[]');
+ ^
+<sql-statement>
+SELECT json_populate_recordset(row(1,2), '[]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(row(1,2), '[]');
+ ^
+<sql-statement>
+SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jpop
+ SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q;
+ ^
+<sql-statement>
+SELECT * FROM
+ json_populate_recordset(null::record, '[]') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- composite domain
+SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]');
+ ^
+<sql-statement>
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]');
+ ^
+<sql-statement>
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]');
+ ^
+<sql-statement>
+-- negative cases where the wrong record type is supplied
+select * from json_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ -- negative cases where the wrong record type is supplied
+ ^
+<sql-statement>
+select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+-- test type info caching in json_populate_record()
+CREATE TEMP TABLE jspoptest (js json);
+</sql-statement>
+<sql-statement>
+INSERT INTO jspoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::json
+FROM generate_series(1, 3);
+</sql-statement>
+<sql-statement>
+SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest;
+ ^
+<sql-statement>
+DROP TYPE jsrec;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE jsrec;
+ ^
+<sql-statement>
+DROP TYPE jsrec_i_not_null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE jsrec_i_not_null;
+ ^
+<sql-statement>
+DROP DOMAIN js_int_not_null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN js_int_not_null;
+ ^
+<sql-statement>
+DROP DOMAIN js_int_array_1d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN js_int_array_1d;
+ ^
+<sql-statement>
+DROP DOMAIN js_int_array_2d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN js_int_array_2d;
+ ^
+<sql-statement>
+DROP DOMAIN j_ordered_pair;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN j_ordered_pair;
+ ^
+<sql-statement>
+DROP TYPE j_unordered_pair;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE j_unordered_pair;
+ ^
+<sql-statement>
+--json_typeof() function
+select value, json_typeof(value)
+ from (values (json '123.4'),
+ (json '-1'),
+ (json '"foo"'),
+ (json 'true'),
+ (json 'false'),
+ (json 'null'),
+ (json '[1, 2, 3]'),
+ (json '[]'),
+ (json '{"x":"foo", "y":123}'),
+ (json '{}'),
+ (NULL::json))
+ as data(value);
+</sql-statement>
+<sql-statement>
+-- json_build_array, json_build_object, json_object_agg
+SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+</sql-statement>
+<sql-statement>
+SELECT json_build_array('a', NULL); -- ok
+</sql-statement>
+<sql-statement>
+SELECT json_build_array(VARIADIC NULL::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC NULL::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC '{}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC '{}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+</sql-statement>
+<sql-statement>
+SELECT json_build_object(
+ 'a', json_build_object('b',false,'c',99),
+ 'd', json_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+</sql-statement>
+<sql-statement>
+SELECT json_build_object('{a,b,c}'::text[]); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object('{a,b,c}'::text[]); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+
+ SELECT json_build_object('{a,b,c}'::text[]); -- error
+ ^
+<sql-statement>
+SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ ^
+<sql-statement>
+SELECT json_build_object('a', 'b', 'c'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object('a', 'b', 'c'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+
+ SELECT json_build_object('a', 'b', 'c'); -- error
+ ^
+<sql-statement>
+SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+
+ SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+ ^
+<sql-statement>
+SELECT json_build_object('a', NULL); -- ok
+</sql-statement>
+<sql-statement>
+SELECT json_build_object(VARIADIC NULL::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC NULL::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC '{}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC '{}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ ^
+<sql-statement>
+SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ ^
+<sql-statement>
+-- empty objects/arrays
+SELECT json_build_array();
+</sql-statement>
+<sql-statement>
+SELECT json_build_object();
+</sql-statement>
+<sql-statement>
+-- make sure keys are quoted
+SELECT json_build_object(1,2);
+</sql-statement>
+<sql-statement>
+-- keys must be scalar and not null
+SELECT json_build_object(null,2);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- keys must be scalar and not null
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+
+ -- keys must be scalar and not null
+ ^
+<sql-statement>
+SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ ^
+<sql-statement>
+SELECT json_build_object(json '{"a":1,"b":2}', 3);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object(json '{"a":1,"b":2}', 3);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT json_build_object(json '{"a":1,"b":2}', 3);
+ ^
+<sql-statement>
+SELECT json_build_object('{1,2,3}'::int[], 3);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT json_build_object('{1,2,3}'::int[], 3);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT json_build_object('{1,2,3}'::int[], 3);
+ ^
+<sql-statement>
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+</sql-statement>
+<sql-statement>
+SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type)))
+FROM foo;
+</sql-statement>
+<sql-statement>
+SELECT json_object_agg(name, type) FROM foo;
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+</sql-statement>
+<sql-statement>
+SELECT json_object_agg(name, type) FROM foo;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMapReduce!
+ SELECT json_object_agg(name, type) FROM foo;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: field name must not be null
+
+ SELECT json_object_agg(name, type) FROM foo;
+ ^
+<sql-statement>
+-- json_object
+-- empty object, one dimension
+SELECT json_object('{}');
+</sql-statement>
+<sql-statement>
+-- empty object, two dimensions
+SELECT json_object('{}', '{}');
+</sql-statement>
+<sql-statement>
+-- one dimension
+SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+</sql-statement>
+<sql-statement>
+-- same but with two dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+</sql-statement>
+<sql-statement>
+-- odd number error
+SELECT json_object('{a,b,c}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- odd number error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have even number of elements
+
+ -- odd number error
+ ^
+<sql-statement>
+-- one column error
+SELECT json_object('{{a},{b}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- one column error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have two columns
+
+ -- one column error
+ ^
+<sql-statement>
+-- too many columns error
+SELECT json_object('{{a,b,c},{b,c,d}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many columns error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have two columns
+
+ -- too many columns error
+ ^
+<sql-statement>
+-- too many dimensions error
+SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many dimensions error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: wrong number of array subscripts
+
+ -- too many dimensions error
+ ^
+<sql-statement>
+--two argument form of json_object
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+<sql-statement>
+-- too many dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many dimensions
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: wrong number of array subscripts
+
+ -- too many dimensions
+ ^
+<sql-statement>
+-- mismatched dimensions
+select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- mismatched dimensions
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: mismatched array dimensions
+
+ -- mismatched dimensions
+ ^
+<sql-statement>
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: mismatched array dimensions
+
+ select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ ^
+<sql-statement>
+-- null key error
+select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- null key error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null value not allowed for object key
+
+ -- null key error
+ ^
+<sql-statement>
+-- empty key is allowed
+select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+<sql-statement>
+-- json_to_record and json_to_recordset
+select * from json_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ -- json_to_record and json_to_recordset
+ ^
+<sql-statement>
+select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ ^
+<sql-statement>
+select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]')
+ as x(a int, b json, c boolean);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]')
+ ^
+<sql-statement>
+select *, c is null as c_is_null
+from json_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::json)
+ as t(a int, b json, c text, x int, ca char(5)[], ia int[][], r jpop);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select *, c is null as c_is_null
+ ^
+<sql-statement>
+select *, c is null as c_is_null
+from json_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::json)
+ as t(a int, b json, c text, x int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select *, c is null as c_is_null
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": null}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": null}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": 123}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": 123}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+ ^
+<sql-statement>
+select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": {"key": 1}}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": {"key": 1}}') as x(out json);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": [{"key": 1}]}') as x(out json);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+ ^
+<sql-statement>
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+ ^
+<sql-statement>
+-- json_strip_nulls
+select json_strip_nulls(null);
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('1');
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('"a string"');
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('null');
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('[1,2,null,3,4]');
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+</sql-statement>
+<sql-statement>
+select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+</sql-statement>
+<sql-statement>
+-- an empty object is not null and should not be stripped
+select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+</sql-statement>
+<sql-statement>
+-- json to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json to tsvector
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- json to tsvector
+ ^
+<sql-statement>
+-- json to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json to tsvector with config
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "simple" does not exist
+
+ -- json to tsvector with config
+ ^
+<sql-statement>
+-- json to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json to tsvector with stop words
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- json to tsvector with stop words
+ ^
+<sql-statement>
+-- json to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json to tsvector with numeric values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- json to tsvector with numeric values
+ ^
+<sql-statement>
+-- json_to_tsvector
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json_to_tsvector
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- json_to_tsvector
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ ^
+<sql-statement>
+-- to_tsvector corner cases
+select to_tsvector('""'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- to_tsvector corner cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- to_tsvector corner cases
+ ^
+<sql-statement>
+select to_tsvector('{}'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('{}'::json);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('{}'::json);
+ ^
+<sql-statement>
+select to_tsvector('[]'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('[]'::json);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('[]'::json);
+ ^
+<sql-statement>
+select to_tsvector('null'::json);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('null'::json);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('null'::json);
+ ^
+<sql-statement>
+-- json_to_tsvector corner cases
+select json_to_tsvector('""'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- json_to_tsvector corner cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- json_to_tsvector corner cases
+ ^
+<sql-statement>
+select json_to_tsvector('{}'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('{}'::json, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select json_to_tsvector('{}'::json, '"all"');
+ ^
+<sql-statement>
+select json_to_tsvector('[]'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('[]'::json, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select json_to_tsvector('[]'::json, '"all"');
+ ^
+<sql-statement>
+select json_to_tsvector('null'::json, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('null'::json, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select json_to_tsvector('null'::json, '"all"');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null');
+ ^
+<sql-statement>
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
+ ^
+<sql-statement>
+-- ts_headline for json
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- ts_headline for json
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:2:121: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:2:121: Error: No such proc: tsquery
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+<sql-statement>
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+</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 ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:113: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:113: Error: No such proc: tsquery
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ^
+<sql-statement>
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+</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 ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:121: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:121: Error: No such proc: tsquery
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+<sql-statement>
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+</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 ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:132: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:132: Error: No such proc: tsquery
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+<sql-statement>
+-- corner cases for ts_headline with json
+select ts_headline('null'::json, tsquery('aaa & bbb'));
+</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 for ts_headline with json
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select ts_headline('null'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:2:34: Error: At function: PgCall
+ select ts_headline('null'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:2:34: Error: No such proc: tsquery
+ select ts_headline('null'::json, tsquery('aaa & bbb'));
+ ^
+<sql-statement>
+select ts_headline('{}'::json, tsquery('aaa & bbb'));
+</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 ts_headline('{}'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('{}'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgCall
+ select ts_headline('{}'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:32: Error: No such proc: tsquery
+ select ts_headline('{}'::json, tsquery('aaa & bbb'));
+ ^
+<sql-statement>
+select ts_headline('[]'::json, tsquery('aaa & bbb'));
+</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 ts_headline('[]'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('[]'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgCall
+ select ts_headline('[]'::json, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:32: Error: No such proc: tsquery
+ select ts_headline('[]'::json, tsquery('aaa & bbb'));
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/json.out b/yql/essentials/tests/postgresql/cases/json.out
new file mode 100644
index 0000000000..218af2696a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json.out
@@ -0,0 +1,999 @@
+-- Strings.
+SELECT '""'::json; -- OK.
+ json
+------
+ ""
+(1 row)
+
+SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT $$''$$::json;
+ ^
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+SELECT '"abc"'::json; -- OK
+ json
+-------
+ "abc"
+(1 row)
+
+SELECT '"abc'::json; -- ERROR, quotes not closed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc'::json;
+ ^
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"abc
+def"'::json; -- ERROR, unescaped newline in string constant
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc
+ ^
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"\n\"\\"'::json; -- OK, legal escapes
+ json
+----------
+ "\n\"\\"
+(1 row)
+
+SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\v"'::json;
+ ^
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::json; -- OK
+ json
+------
+ 1
+(1 row)
+
+SELECT '0'::json; -- OK
+ json
+------
+ 0
+(1 row)
+
+SELECT '01'::json; -- ERROR, not valid according to JSON spec
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '01'::json;
+ ^
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+SELECT '0.1'::json; -- OK
+ json
+------
+ 0.1
+(1 row)
+
+SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8
+ json
+---------------------
+ 9223372036854775808
+(1 row)
+
+SELECT '1e100'::json; -- OK
+ json
+-------
+ 1e100
+(1 row)
+
+SELECT '1.3e100'::json; -- OK
+ json
+---------
+ 1.3e100
+(1 row)
+
+SELECT '1f2'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1f2'::json;
+ ^
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+SELECT '0.x1'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '0.x1'::json;
+ ^
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+SELECT '1.3ex100'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1.3ex100'::json;
+ ^
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+-- Arrays.
+SELECT '[]'::json; -- OK
+ json
+------
+ []
+(1 row)
+
+SELECT '[1,2]'::json; -- OK
+ json
+-------
+ [1,2]
+(1 row)
+
+SELECT '[1,2,]'::json; -- ERROR, trailing comma
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2,]'::json;
+ ^
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+SELECT '[1,2'::json; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2'::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,[2]'::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+-- Objects.
+SELECT '{}'::json; -- OK
+ json
+------
+ {}
+(1 row)
+
+SELECT '{"abc"}'::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"}'::json;
+ ^
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+SELECT '{"abc":1}'::json; -- OK
+ json
+-----------
+ {"abc":1}
+(1 row)
+
+SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{1:"abc"}'::json;
+ ^
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc",1}'::json;
+ ^
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"=1}'::json;
+ ^
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"::1}'::json;
+ ^
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+ json
+---------------------------------------------------------
+ {"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}
+(1 row)
+
+SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1:2}'::json;
+ ^
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+SELECT '{"abc":1,3}'::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1,3}'::json;
+ ^
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+-- Miscellaneous stuff.
+SELECT 'true'::json; -- OK
+ json
+------
+ true
+(1 row)
+
+SELECT 'false'::json; -- OK
+ json
+-------
+ false
+(1 row)
+
+SELECT 'null'::json; -- OK
+ json
+------
+ null
+(1 row)
+
+SELECT ' true '::json; -- OK, even with extra whitespace
+ json
+--------
+ true
+(1 row)
+
+SELECT 'true false'::json; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true false'::json;
+ ^
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+SELECT 'true, false'::json; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true, false'::json;
+ ^
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+SELECT 'truf'::json; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'truf'::json;
+ ^
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+SELECT 'trues'::json; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'trues'::json;
+ ^
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+SELECT ''::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ''::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+SELECT ' '::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ' '::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::json;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+-- ERROR missing value for last field
+--constructors
+-- array_to_json
+SELECT array_to_json(array(select 1 as a));
+ array_to_json
+---------------
+ [1]
+(1 row)
+
+SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x;
+ array_to_json
+----------------
+ [5,6,7,8,9,10]
+(1 row)
+
+SELECT array_to_json('{{1,5},{99,100}}'::int[]);
+ array_to_json
+------------------
+ [[1,5],[99,100]]
+(1 row)
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+SET LOCAL TIME ZONE -8;
+COMMIT;
+-- non-numeric output
+SELECT row_to_json(q)
+FROM (SELECT 'NaN'::float8 AS "float8field") q;
+ row_to_json
+-----------------------
+ {"float8field":"NaN"}
+(1 row)
+
+SELECT row_to_json(q)
+FROM (SELECT 'Infinity'::float8 AS "float8field") q;
+ row_to_json
+----------------------------
+ {"float8field":"Infinity"}
+(1 row)
+
+SELECT row_to_json(q)
+FROM (SELECT '-Infinity'::float8 AS "float8field") q;
+ row_to_json
+-----------------------------
+ {"float8field":"-Infinity"}
+(1 row)
+
+-- json input
+SELECT row_to_json(q)
+FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q;
+ row_to_json
+------------------------------------------------------------------
+ {"jsonfield":{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}}
+(1 row)
+
+-- json extraction functions
+CREATE TEMP TABLE test_json (
+ json_type text,
+ test_json json
+);
+INSERT INTO test_json VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json->'field2'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+ "val2"
+(1 row)
+
+SELECT test_json->>'field2'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+ val2
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ "two"
+(1 row)
+
+SELECT test_json -> -1
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json->>2
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ two
+(1 row)
+
+SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ 4
+(1 row)
+
+SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+-- nulls
+select (test_json->'field3') is null as expect_false
+from test_json
+where json_type = 'object';
+ expect_false
+--------------
+ f
+(1 row)
+
+select (test_json->>'field3') is null as expect_true
+from test_json
+where json_type = 'object';
+ expect_true
+-------------
+ t
+(1 row)
+
+select (test_json->3) is null as expect_false
+from test_json
+where json_type = 'array';
+ expect_false
+--------------
+ f
+(1 row)
+
+select (test_json->>3) is null as expect_true
+from test_json
+where json_type = 'array';
+ expect_true
+-------------
+ t
+(1 row)
+
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::json -> 'b';
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::json -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::json ->> 'b';
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+-- array length
+SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+ json_array_length
+-------------------
+ 5
+(1 row)
+
+SELECT json_array_length('[]');
+ json_array_length
+-------------------
+ 0
+(1 row)
+
+SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+ERROR: cannot get array length of a non-array
+SELECT json_array_length('4');
+ERROR: cannot get array length of a scalar
+select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1,2,3]
+ f2 | {"f3":1}
+ f4 | null
+ f5 | 99
+ f6 | "stringy"
+(5 rows)
+
+select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+----------
+ f1 | [1,2,3]
+ f2 | {"f3":1}
+ f4 |
+ f5 | 99
+ f6 | stringy
+(5 rows)
+
+-- extract_path, extract_path_as_text
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ json_extract_path
+-------------------
+ "stringy"
+(1 row)
+
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ json_extract_path
+-------------------
+ {"f3":1}
+(1 row)
+
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ json_extract_path
+-------------------
+ "f3"
+(1 row)
+
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ json_extract_path
+-------------------
+ 1
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ json_extract_path_text
+------------------------
+ stringy
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ json_extract_path_text
+------------------------
+ {"f3":1}
+(1 row)
+
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ json_extract_path_text
+------------------------
+ f3
+(1 row)
+
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ json_extract_path_text
+------------------------
+ 1
+(1 row)
+
+-- extract_path nulls
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+-----------------------
+ 1
+ true
+ [1,[2,3]]
+ null
+ {"f1":1,"f2":[7,8,9]}
+ false
+ "stringy"
+(7 rows)
+
+select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+-----------------------
+ 1
+ true
+ [1,[2,3]]
+
+ {"f1":1,"f2":[7,8,9]}
+ false
+ stringy
+(7 rows)
+
+-- test type info caching in json_populate_record()
+CREATE TEMP TABLE jspoptest (js json);
+INSERT INTO jspoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::json
+FROM generate_series(1, 3);
+--json_typeof() function
+select value, json_typeof(value)
+ from (values (json '123.4'),
+ (json '-1'),
+ (json '"foo"'),
+ (json 'true'),
+ (json 'false'),
+ (json 'null'),
+ (json '[1, 2, 3]'),
+ (json '[]'),
+ (json '{"x":"foo", "y":123}'),
+ (json '{}'),
+ (NULL::json))
+ as data(value);
+ value | json_typeof
+----------------------+-------------
+ 123.4 | number
+ -1 | number
+ "foo" | string
+ true | boolean
+ false | boolean
+ null | null
+ [1, 2, 3] | array
+ [] | array
+ {"x":"foo", "y":123} | object
+ {} | object
+ |
+(11 rows)
+
+-- json_build_array, json_build_object, json_object_agg
+SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ json_build_array
+-----------------------------------------------------------------------
+ ["a", 1, "b", 1.2, "c", true, "d", null, "e", {"x": 3, "y": [1,2,3]}]
+(1 row)
+
+SELECT json_build_array('a', NULL); -- ok
+ json_build_array
+------------------
+ ["a", null]
+(1 row)
+
+SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ json_build_object
+----------------------------------------------------------------------------
+ {"a" : 1, "b" : 1.2, "c" : true, "d" : null, "e" : {"x": 3, "y": [1,2,3]}}
+(1 row)
+
+SELECT json_build_object('{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object('a', 'b', 'c'); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+SELECT json_build_object('a', NULL); -- ok
+ json_build_object
+-------------------
+ {"a" : null}
+(1 row)
+
+-- empty objects/arrays
+SELECT json_build_array();
+ json_build_array
+------------------
+ []
+(1 row)
+
+SELECT json_build_object();
+ json_build_object
+-------------------
+ {}
+(1 row)
+
+-- make sure keys are quoted
+SELECT json_build_object(1,2);
+ json_build_object
+-------------------
+ {"1" : 2}
+(1 row)
+
+-- keys must be scalar and not null
+SELECT json_build_object(null,2);
+ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object(json '{"a":1,"b":2}', 3);
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object('{1,2,3}'::int[], 3);
+ERROR: key value must be scalar, not array, composite, or json
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type)))
+FROM foo;
+ json_build_object
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"turbines" : { "847001" : {"name" : "t15", "type" : "GE1043"}, "847002" : {"name" : "t16", "type" : "GE1043"}, "847003" : {"name" : "sub-alpha", "type" : "GESS90"} }}
+(1 row)
+
+SELECT json_object_agg(name, type) FROM foo;
+ json_object_agg
+----------------------------------------------------------------
+ { "t15" : "GE1043", "t16" : "GE1043", "sub-alpha" : "GESS90" }
+(1 row)
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT json_object_agg(name, type) FROM foo;
+ERROR: field name must not be null
+-- json_object
+-- empty object, one dimension
+SELECT json_object('{}');
+ json_object
+-------------
+ {}
+(1 row)
+
+-- empty object, two dimensions
+SELECT json_object('{}', '{}');
+ json_object
+-------------
+ {}
+(1 row)
+
+-- one dimension
+SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+ json_object
+-------------------------------------------------------
+ {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"}
+(1 row)
+
+-- same but with two dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ json_object
+-------------------------------------------------------
+ {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"}
+(1 row)
+
+-- odd number error
+SELECT json_object('{a,b,c}');
+ERROR: array must have even number of elements
+-- one column error
+SELECT json_object('{{a},{b}}');
+ERROR: array must have two columns
+-- too many columns error
+SELECT json_object('{{a,b,c},{b,c,d}}');
+ERROR: array must have two columns
+-- too many dimensions error
+SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+ERROR: wrong number of array subscripts
+--two argument form of json_object
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+ json_object
+------------------------------------------------------
+ {"a" : "1", "b" : "2", "c" : "3", "d e f" : "a b c"}
+(1 row)
+
+-- too many dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ERROR: wrong number of array subscripts
+-- mismatched dimensions
+select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+ERROR: mismatched array dimensions
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ERROR: mismatched array dimensions
+-- null key error
+select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+ERROR: null value not allowed for object key
+-- empty key is allowed
+select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+ json_object
+-----------------------------------------------------
+ {"a" : "1", "b" : "2", "" : "3", "d e f" : "a b c"}
+(1 row)
+
+-- json_strip_nulls
+select json_strip_nulls(null);
+ json_strip_nulls
+------------------
+
+(1 row)
+
+select json_strip_nulls('1');
+ json_strip_nulls
+------------------
+ 1
+(1 row)
+
+select json_strip_nulls('"a string"');
+ json_strip_nulls
+------------------
+ "a string"
+(1 row)
+
+select json_strip_nulls('null');
+ json_strip_nulls
+------------------
+ null
+(1 row)
+
+select json_strip_nulls('[1,2,null,3,4]');
+ json_strip_nulls
+------------------
+ [1,2,null,3,4]
+(1 row)
+
+select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+ json_strip_nulls
+------------------------------------
+ {"a":1,"c":[2,null,3],"d":{"e":4}}
+(1 row)
+
+select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+ json_strip_nulls
+---------------------
+ [1,{"a":1,"c":2},3]
+(1 row)
+
+-- an empty object is not null and should not be stripped
+select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+ json_strip_nulls
+------------------
+ {"a":{},"d":{}}
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/json.sql b/yql/essentials/tests/postgresql/cases/json.sql
new file mode 100644
index 0000000000..83bcc80518
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json.sql
@@ -0,0 +1,271 @@
+-- Strings.
+SELECT '""'::json; -- OK.
+SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+SELECT '"abc"'::json; -- OK
+SELECT '"abc'::json; -- ERROR, quotes not closed
+SELECT '"abc
+def"'::json; -- ERROR, unescaped newline in string constant
+SELECT '"\n\"\\"'::json; -- OK, legal escapes
+SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::json; -- OK
+SELECT '0'::json; -- OK
+SELECT '01'::json; -- ERROR, not valid according to JSON spec
+SELECT '0.1'::json; -- OK
+SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8
+SELECT '1e100'::json; -- OK
+SELECT '1.3e100'::json; -- OK
+SELECT '1f2'::json; -- ERROR
+SELECT '0.x1'::json; -- ERROR
+SELECT '1.3ex100'::json; -- ERROR
+-- Arrays.
+SELECT '[]'::json; -- OK
+SELECT '[1,2]'::json; -- OK
+SELECT '[1,2,]'::json; -- ERROR, trailing comma
+SELECT '[1,2'::json; -- ERROR, no closing bracket
+SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+-- Objects.
+SELECT '{}'::json; -- OK
+SELECT '{"abc"}'::json; -- ERROR, no value
+SELECT '{"abc":1}'::json; -- OK
+SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+SELECT '{"abc":1,3}'::json; -- ERROR, no value
+-- Miscellaneous stuff.
+SELECT 'true'::json; -- OK
+SELECT 'false'::json; -- OK
+SELECT 'null'::json; -- OK
+SELECT ' true '::json; -- OK, even with extra whitespace
+SELECT 'true false'::json; -- ERROR, too many values
+SELECT 'true, false'::json; -- ERROR, too many values
+SELECT 'truf'::json; -- ERROR, not a keyword
+SELECT 'trues'::json; -- ERROR, not a keyword
+SELECT ''::json; -- ERROR, no value
+SELECT ' '::json; -- ERROR, no value
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::json;
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json;
+-- ERROR missing value for last field
+--constructors
+-- array_to_json
+SELECT array_to_json(array(select 1 as a));
+SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x;
+SELECT array_to_json('{{1,5},{99,100}}'::int[]);
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+SET LOCAL TIME ZONE -8;
+COMMIT;
+-- non-numeric output
+SELECT row_to_json(q)
+FROM (SELECT 'NaN'::float8 AS "float8field") q;
+SELECT row_to_json(q)
+FROM (SELECT 'Infinity'::float8 AS "float8field") q;
+SELECT row_to_json(q)
+FROM (SELECT '-Infinity'::float8 AS "float8field") q;
+-- json input
+SELECT row_to_json(q)
+FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q;
+-- json extraction functions
+CREATE TEMP TABLE test_json (
+ json_type text,
+ test_json json
+);
+INSERT INTO test_json VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'scalar';
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'array';
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'object';
+SELECT test_json->'field2'
+FROM test_json
+WHERE json_type = 'object';
+SELECT test_json->>'field2'
+FROM test_json
+WHERE json_type = 'object';
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'scalar';
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'array';
+SELECT test_json -> -1
+FROM test_json
+WHERE json_type = 'array';
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'object';
+SELECT test_json->>2
+FROM test_json
+WHERE json_type = 'array';
+SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array';
+SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array';
+SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object';
+SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object';
+SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object';
+-- nulls
+select (test_json->'field3') is null as expect_false
+from test_json
+where json_type = 'object';
+select (test_json->>'field3') is null as expect_true
+from test_json
+where json_type = 'object';
+select (test_json->3) is null as expect_false
+from test_json
+where json_type = 'array';
+select (test_json->>3) is null as expect_true
+from test_json
+where json_type = 'array';
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> '';
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z';
+select '{"a": "c", "b": null}'::json -> 'b';
+select '"foo"'::json -> 1;
+select '"foo"'::json -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> '';
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z';
+select '{"a": "c", "b": null}'::json ->> 'b';
+select '"foo"'::json ->> 1;
+select '"foo"'::json ->> 'z';
+-- array length
+SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+SELECT json_array_length('[]');
+SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+SELECT json_array_length('4');
+select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+-- extract_path, extract_path_as_text
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+-- extract_path nulls
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false;
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true;
+select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false;
+select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true;
+select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+-- test type info caching in json_populate_record()
+CREATE TEMP TABLE jspoptest (js json);
+INSERT INTO jspoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::json
+FROM generate_series(1, 3);
+--json_typeof() function
+select value, json_typeof(value)
+ from (values (json '123.4'),
+ (json '-1'),
+ (json '"foo"'),
+ (json 'true'),
+ (json 'false'),
+ (json 'null'),
+ (json '[1, 2, 3]'),
+ (json '[]'),
+ (json '{"x":"foo", "y":123}'),
+ (json '{}'),
+ (NULL::json))
+ as data(value);
+-- json_build_array, json_build_object, json_object_agg
+SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+SELECT json_build_array('a', NULL); -- ok
+SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+SELECT json_build_object('{a,b,c}'::text[]); -- error
+SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+SELECT json_build_object('a', 'b', 'c'); -- error
+SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+SELECT json_build_object('a', NULL); -- ok
+-- empty objects/arrays
+SELECT json_build_array();
+SELECT json_build_object();
+-- make sure keys are quoted
+SELECT json_build_object(1,2);
+-- keys must be scalar and not null
+SELECT json_build_object(null,2);
+SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+SELECT json_build_object(json '{"a":1,"b":2}', 3);
+SELECT json_build_object('{1,2,3}'::int[], 3);
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type)))
+FROM foo;
+SELECT json_object_agg(name, type) FROM foo;
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT json_object_agg(name, type) FROM foo;
+-- json_object
+-- empty object, one dimension
+SELECT json_object('{}');
+-- empty object, two dimensions
+SELECT json_object('{}', '{}');
+-- one dimension
+SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+-- same but with two dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+-- odd number error
+SELECT json_object('{a,b,c}');
+-- one column error
+SELECT json_object('{{a},{b}}');
+-- too many columns error
+SELECT json_object('{{a,b,c},{b,c,d}}');
+-- too many dimensions error
+SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+--two argument form of json_object
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+-- too many dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+-- mismatched dimensions
+select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+-- null key error
+select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+-- empty key is allowed
+select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+-- json_strip_nulls
+select json_strip_nulls(null);
+select json_strip_nulls('1');
+select json_strip_nulls('"a string"');
+select json_strip_nulls('null');
+select json_strip_nulls('[1,2,null,3,4]');
+select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+-- an empty object is not null and should not be stripped
+select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
diff --git a/yql/essentials/tests/postgresql/cases/json_encoding.err b/yql/essentials/tests/postgresql/cases/json_encoding.err
new file mode 100644
index 0000000000..3d12f9cdf6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json_encoding.err
@@ -0,0 +1,337 @@
+<sql-statement>
+--
+-- encoding-sensitive tests for json and jsonb
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+</sql-statement>
+<sql-statement>
+-- first json
+-- basic unicode input
+SELECT '"\u"'::json; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- first json
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+
+ -- first json
+ ^
+<sql-statement>
+SELECT '"\u00"'::json; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u00"'::json; -- ERROR, incomplete escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+
+ SELECT '"\u00"'::json; -- ERROR, incomplete escape
+ ^
+<sql-statement>
+SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+
+ SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+ ^
+<sql-statement>
+SELECT '"\u0000"'::json; -- OK, legal escape
+</sql-statement>
+<sql-statement>
+SELECT '"\uaBcD"'::json; -- OK, uppercase and lower case both OK
+</sql-statement>
+<sql-statement>
+-- handling of unicode surrogate pairs
+select json '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ ^
+<sql-statement>
+select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ ^
+<sql-statement>
+select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ ^
+<sql-statement>
+select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ ^
+<sql-statement>
+--handling of simple unicode escapes
+select json '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "null \u0000 escape" }' as not_unescaped;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "null \\u0000 escape" }' as not_an_escape;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+</sql-statement>
+<sql-statement>
+select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+
+ select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ ^
+<sql-statement>
+select json '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+</sql-statement>
+<sql-statement>
+-- then jsonb
+-- basic unicode input
+SELECT '"\u"'::jsonb; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- then jsonb
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+
+ -- then jsonb
+ ^
+<sql-statement>
+SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+
+ SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+ ^
+<sql-statement>
+SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+
+ SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+ ^
+<sql-statement>
+SELECT '"\u0045"'::jsonb; -- OK, legal escape
+</sql-statement>
+<sql-statement>
+SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: ...
+
+ SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+ ^
+<sql-statement>
+-- use octet_length here so we don't get an odd unicode char in the
+-- output
+SELECT octet_length('"\uaBcD"'::jsonb::text); -- OK, uppercase and lower case both OK
+</sql-statement>
+<sql-statement>
+-- handling of unicode surrogate pairs
+SELECT octet_length((jsonb '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a')::text) AS correct_in_utf8;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ ^
+<sql-statement>
+SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ ^
+<sql-statement>
+SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ ^
+<sql-statement>
+SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ ^
+<sql-statement>
+-- handling of simple unicode escapes
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ ^
+<sql-statement>
+SELECT jsonb '{ "a": "null \\u0000 escape" }' as not_an_escape;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+
+ SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ ^
+<sql-statement>
+SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/json_encoding.out b/yql/essentials/tests/postgresql/cases/json_encoding.out
new file mode 100644
index 0000000000..8025d09624
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json_encoding.out
@@ -0,0 +1,255 @@
+--
+-- encoding-sensitive tests for json and jsonb
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+---------------------
+ UTF8
+(1 row)
+
+-- first json
+-- basic unicode input
+SELECT '"\u"'::json; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+SELECT '"\u00"'::json; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u00"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u000g"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+SELECT '"\u0000"'::json; -- OK, legal escape
+ json
+----------
+ "\u0000"
+(1 row)
+
+SELECT '"\uaBcD"'::json; -- OK, uppercase and lower case both OK
+ json
+----------
+ "\uaBcD"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select json '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------------
+ "\ud83d\ude04\ud83d\udc36"
+(1 row)
+
+select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type json
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+--handling of simple unicode escapes
+select json '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+ correct_in_utf8
+---------------------------------------
+ { "a": "the Copyright \u00a9 sign" }
+(1 row)
+
+select json '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+ correct_everywhere
+-------------------------------------
+ { "a": "dollar \u0024 character" }
+(1 row)
+
+select json '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+ not_an_escape
+--------------------------------------
+ { "a": "dollar \\u0024 character" }
+(1 row)
+
+select json '{ "a": "null \u0000 escape" }' as not_unescaped;
+ not_unescaped
+--------------------------------
+ { "a": "null \u0000 escape" }
+(1 row)
+
+select json '{ "a": "null \\u0000 escape" }' as not_an_escape;
+ not_an_escape
+---------------------------------
+ { "a": "null \\u0000 escape" }
+(1 row)
+
+select json '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------
+ the Copyright © sign
+(1 row)
+
+select json '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+ correct_everywhere
+--------------------
+ dollar $ character
+(1 row)
+
+select json '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+ not_an_escape
+-------------------------
+ dollar \u0024 character
+(1 row)
+
+select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+ not_an_escape
+--------------------
+ null \u0000 escape
+(1 row)
+
+-- then jsonb
+-- basic unicode input
+SELECT '"\u"'::jsonb; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u00"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u000g"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+SELECT '"\u0045"'::jsonb; -- OK, legal escape
+ jsonb
+-------
+ "E"
+(1 row)
+
+SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '"\u0000"'::jsonb;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: ...
+-- use octet_length here so we don't get an odd unicode char in the
+-- output
+SELECT octet_length('"\uaBcD"'::jsonb::text); -- OK, uppercase and lower case both OK
+ octet_length
+--------------
+ 5
+(1 row)
+
+-- handling of unicode surrogate pairs
+SELECT octet_length((jsonb '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a')::text) AS correct_in_utf8;
+ correct_in_utf8
+-----------------
+ 10
+(1 row)
+
+SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a';
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ud83dX" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ude04X" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+-- handling of simple unicode escapes
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+ correct_in_utf8
+-------------------------------
+ {"a": "the Copyright © sign"}
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+ correct_everywhere
+-----------------------------
+ {"a": "dollar $ character"}
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+ not_an_escape
+-----------------------------------
+ {"a": "dollar \\u0024 character"}
+(1 row)
+
+SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "null \\u0000 escape" }' as not_an_escape;
+ not_an_escape
+------------------------------
+ {"a": "null \\u0000 escape"}
+(1 row)
+
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------
+ the Copyright © sign
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+ correct_everywhere
+--------------------
+ dollar $ character
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+ not_an_escape
+-------------------------
+ dollar \u0024 character
+(1 row)
+
+SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fai...
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+ not_an_escape
+--------------------
+ null \u0000 escape
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/json_encoding.sql b/yql/essentials/tests/postgresql/cases/json_encoding.sql
new file mode 100644
index 0000000000..f07f8986b2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/json_encoding.sql
@@ -0,0 +1,55 @@
+--
+-- encoding-sensitive tests for json and jsonb
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+-- first json
+-- basic unicode input
+SELECT '"\u"'::json; -- ERROR, incomplete escape
+SELECT '"\u00"'::json; -- ERROR, incomplete escape
+SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+SELECT '"\u0000"'::json; -- OK, legal escape
+SELECT '"\uaBcD"'::json; -- OK, uppercase and lower case both OK
+-- handling of unicode surrogate pairs
+select json '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
+select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+--handling of simple unicode escapes
+select json '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+select json '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+select json '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+select json '{ "a": "null \u0000 escape" }' as not_unescaped;
+select json '{ "a": "null \\u0000 escape" }' as not_an_escape;
+select json '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+select json '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+select json '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+select json '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+-- then jsonb
+-- basic unicode input
+SELECT '"\u"'::jsonb; -- ERROR, incomplete escape
+SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+SELECT '"\u0045"'::jsonb; -- OK, legal escape
+SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+-- use octet_length here so we don't get an odd unicode char in the
+-- output
+SELECT octet_length('"\uaBcD"'::jsonb::text); -- OK, uppercase and lower case both OK
+-- handling of unicode surrogate pairs
+SELECT octet_length((jsonb '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a')::text) AS correct_in_utf8;
+SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+-- handling of simple unicode escapes
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+SELECT jsonb '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+SELECT jsonb '{ "a": "null \\u0000 escape" }' as not_an_escape;
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
diff --git a/yql/essentials/tests/postgresql/cases/jsonb.err b/yql/essentials/tests/postgresql/cases/jsonb.err
new file mode 100644
index 0000000000..7b99270eb4
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb.err
@@ -0,0 +1,6964 @@
+Registering pre-existing tables
+ testjsonb
+<sql-statement>
+-- Strings.
+SELECT '""'::jsonb; -- OK.
+</sql-statement>
+<sql-statement>
+SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+
+ SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+ ^
+<sql-statement>
+SELECT '"abc"'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+
+ SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+ ^
+<sql-statement>
+SELECT '"abc
+def"'::jsonb; -- ERROR, unescaped newline in string constant
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"abc
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+
+ SELECT '"abc
+ ^
+<sql-statement>
+SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
+</sql-statement>
+<sql-statement>
+SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+
+ SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+ ^
+<sql-statement>
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '0'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+
+ SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+ ^
+<sql-statement>
+SELECT '0.1'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8
+</sql-statement>
+<sql-statement>
+SELECT '1e100'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '1.3e100'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '1f2'::jsonb; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1f2'::jsonb; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+
+ SELECT '1f2'::jsonb; -- ERROR
+ ^
+<sql-statement>
+SELECT '0.x1'::jsonb; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '0.x1'::jsonb; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+
+ SELECT '0.x1'::jsonb; -- ERROR
+ ^
+<sql-statement>
+SELECT '1.3ex100'::jsonb; -- ERROR
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '1.3ex100'::jsonb; -- ERROR
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+
+ SELECT '1.3ex100'::jsonb; -- ERROR
+ ^
+<sql-statement>
+-- Arrays.
+SELECT '[]'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[1,2]'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+
+ SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+ ^
+<sql-statement>
+SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+
+ SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+ ^
+<sql-statement>
+SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+
+ SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+ ^
+<sql-statement>
+-- Objects.
+SELECT '{}'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{"abc"}'::jsonb; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"}'::jsonb; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+
+ SELECT '{"abc"}'::jsonb; -- ERROR, no value
+ ^
+<sql-statement>
+SELECT '{"abc":1}'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+
+ SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+ ^
+<sql-statement>
+SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+
+ SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+
+ SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+
+ SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+ ^
+<sql-statement>
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+
+ SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+ ^
+<sql-statement>
+SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+
+ SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+ ^
+<sql-statement>
+-- Miscellaneous stuff.
+SELECT 'true'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT 'false'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT 'null'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT ' true '::jsonb; -- OK, even with extra whitespace
+</sql-statement>
+<sql-statement>
+SELECT 'true false'::jsonb; -- ERROR, too many values
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'true false'::jsonb; -- ERROR, too many values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+
+ SELECT 'true false'::jsonb; -- ERROR, too many values
+ ^
+<sql-statement>
+SELECT 'true, false'::jsonb; -- ERROR, too many values
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'true, false'::jsonb; -- ERROR, too many values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+
+ SELECT 'true, false'::jsonb; -- ERROR, too many values
+ ^
+<sql-statement>
+SELECT 'truf'::jsonb; -- ERROR, not a keyword
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'truf'::jsonb; -- ERROR, not a keyword
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+
+ SELECT 'truf'::jsonb; -- ERROR, not a keyword
+ ^
+<sql-statement>
+SELECT 'trues'::jsonb; -- ERROR, not a keyword
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'trues'::jsonb; -- ERROR, not a keyword
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+
+ SELECT 'trues'::jsonb; -- ERROR, not a keyword
+ ^
+<sql-statement>
+SELECT ''::jsonb; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ''::jsonb; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+
+ SELECT ''::jsonb; -- ERROR, no value
+ ^
+<sql-statement>
+SELECT ' '::jsonb; -- ERROR, no value
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ' '::jsonb; -- ERROR, no value
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+
+ SELECT ' '::jsonb; -- ERROR, no value
+ ^
+<sql-statement>
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::jsonb; -- OK
+</sql-statement>
+<sql-statement>
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::jsonb;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+
+ SELECT '{
+ ^
+<sql-statement>
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '{
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+
+ SELECT '{
+ ^
+<sql-statement>
+-- ERROR missing value for last field
+-- make sure jsonb is passed through json generators without being escaped
+SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']);
+</sql-statement>
+<sql-statement>
+-- anyarray column
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- anyarray column
+ ^
+<sql-statement>
+analyze rows;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze rows;
+ ^
+<sql-statement>
+select attname, to_jsonb(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 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 attname, to_jsonb(histogram_bounds) histogram_bounds
+ ^
+ -stdin-:<main>:1:17: Error: At function: PgCall
+ select attname, to_jsonb(histogram_bounds) histogram_bounds
+ ^
+ -stdin-:<main>:1:17: Error: Unable to find an overload for proc to_jsonb with given argument types: (anyarray)
+ select attname, to_jsonb(histogram_bounds) histogram_bounds
+ ^
+<sql-statement>
+-- to_jsonb, timestamps
+select to_jsonb(timestamp '2014-05-28 12:22:35.614298');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- to_jsonb, timestamps
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select to_jsonb(timestamp '2014-05-28 12:22:35.614298');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp)
+ select to_jsonb(timestamp '2014-05-28 12:22:35.614298');
+ ^
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SET LOCAL TIME ZONE 10.5;
+</sql-statement>
+<sql-statement>
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+</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 to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz)
+ select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+<sql-statement>
+SET LOCAL TIME ZONE -8;
+</sql-statement>
+<sql-statement>
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+</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 to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz)
+ select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+select to_jsonb(date '2014-05-28');
+</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 to_jsonb(date '2014-05-28');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(date '2014-05-28');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date)
+ select to_jsonb(date '2014-05-28');
+ ^
+<sql-statement>
+select to_jsonb(date 'Infinity');
+</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 to_jsonb(date 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(date 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date)
+ select to_jsonb(date 'Infinity');
+ ^
+<sql-statement>
+select to_jsonb(date '-Infinity');
+</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 to_jsonb(date '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(date '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date)
+ select to_jsonb(date '-Infinity');
+ ^
+<sql-statement>
+select to_jsonb(timestamp 'Infinity');
+</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 to_jsonb(timestamp 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamp 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp)
+ select to_jsonb(timestamp 'Infinity');
+ ^
+<sql-statement>
+select to_jsonb(timestamp '-Infinity');
+</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 to_jsonb(timestamp '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamp '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp)
+ select to_jsonb(timestamp '-Infinity');
+ ^
+<sql-statement>
+select to_jsonb(timestamptz 'Infinity');
+</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 to_jsonb(timestamptz 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamptz 'Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz)
+ select to_jsonb(timestamptz 'Infinity');
+ ^
+<sql-statement>
+select to_jsonb(timestamptz '-Infinity');
+</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 to_jsonb(timestamptz '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select to_jsonb(timestamptz '-Infinity');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz)
+ select to_jsonb(timestamptz '-Infinity');
+ ^
+<sql-statement>
+--jsonb_agg
+SELECT jsonb_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:16: Error: alternative is not implemented yet : 138
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ --jsonb_agg
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ --jsonb_agg
+ ^
+<sql-statement>
+SELECT jsonb_agg(q ORDER BY x, y)
+ FROM rows q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ SELECT jsonb_agg(q ORDER BY x, y)
+ ^
+<sql-statement>
+UPDATE rows SET x = NULL WHERE x = 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 jsonb_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order
+ SELECT jsonb_agg(q ORDER BY x NULLS FIRST, y)
+ ^
+<sql-statement>
+-- jsonb extraction functions
+CREATE TEMP TABLE test_jsonb (
+ json_type text,
+ test_json jsonb
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_jsonb VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar';
+ ^
+<sql-statement>
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array';
+ ^
+<sql-statement>
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object';
+ ^
+<sql-statement>
+-- nulls
+SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object';
+</sql-statement>
+<sql-statement>
+SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array';
+</sql-statement>
+<sql-statement>
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> '';
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": "c", "b": null}'::jsonb -> 'b';
+</sql-statement>
+<sql-statement>
+select '"foo"'::jsonb -> 1;
+</sql-statement>
+<sql-statement>
+select '"foo"'::jsonb -> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1;
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> '';
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3;
+</sql-statement>
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z';
+</sql-statement>
+<sql-statement>
+select '{"a": "c", "b": null}'::jsonb ->> 'b';
+</sql-statement>
+<sql-statement>
+select '"foo"'::jsonb ->> 1;
+</sql-statement>
+<sql-statement>
+select '"foo"'::jsonb ->> 'z';
+</sql-statement>
+<sql-statement>
+-- equality and inequality
+SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb;
+</sql-statement>
+<sql-statement>
+-- containment
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}');
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}';
+</sql-statement>
+<sql-statement>
+SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}');
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+</sql-statement>
+<sql-statement>
+-- Raw scalar may contain another raw scalar, array may contain a raw scalar
+SELECT '[5]'::jsonb @> '[5]';
+</sql-statement>
+<sql-statement>
+SELECT '5'::jsonb @> '5';
+</sql-statement>
+<sql-statement>
+SELECT '[5]'::jsonb @> '5';
+</sql-statement>
+<sql-statement>
+-- But a raw scalar cannot contain an array
+SELECT '5'::jsonb @> '[5]';
+</sql-statement>
+<sql-statement>
+-- In general, one thing should always contain itself. Test array containment:
+SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb;
+</sql-statement>
+<sql-statement>
+-- array containment string matching confusion bug
+SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}';
+</sql-statement>
+<sql-statement>
+-- array length
+SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_array_length('[]');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot get array length of a non-array
+
+ SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+ ^
+<sql-statement>
+SELECT jsonb_array_length('4');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_array_length('4');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot get array length of a scalar
+
+ SELECT jsonb_array_length('4');
+ ^
+<sql-statement>
+-- each
+SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+ ^
+<sql-statement>
+SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+</sql-statement>
+<sql-statement>
+SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+ ^
+<sql-statement>
+SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+</sql-statement>
+<sql-statement>
+SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+</sql-statement>
+<sql-statement>
+-- exists
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a');
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'a';
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'b';
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'c';
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a';
+</sql-statement>
+<sql-statement>
+-- array exists - array elements should behave as keys
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+</sql-statement>
+<sql-statement>
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+</sql-statement>
+<sql-statement>
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]);
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[];
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]);
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b'];
+</sql-statement>
+<sql-statement>
+SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[];
+</sql-statement>
+<sql-statement>
+-- typeof
+SELECT jsonb_typeof('{}') AS object;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('[]') AS array;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('["a", 1]') AS array;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('null') AS "null";
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('1') AS number;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('-1') AS number;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('1.0') AS number;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('1e2') AS number;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('-1.0') AS number;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('true') AS boolean;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('false') AS boolean;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('"hello"') AS string;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('"true"') AS string;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_typeof('"1.0"') AS string;
+</sql-statement>
+<sql-statement>
+-- jsonb_build_array, jsonb_build_object, jsonb_object_agg
+SELECT jsonb_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb_build_array, jsonb_build_object, jsonb_object_agg
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ -- jsonb_build_array, jsonb_build_object, jsonb_object_agg
+ ^
+<sql-statement>
+SELECT jsonb_build_array('a', NULL); -- ok
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_array('a', NULL); -- ok
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_array('a', NULL); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ ^
+<sql-statement>
+SELECT jsonb_build_object(
+ 'a', jsonb_build_object('b',false,'c',99),
+ 'd', jsonb_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object(
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object(
+ ^
+<sql-statement>
+SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: argument list must have even number of elements
+HINT: The arguments of jsonb_build_object() must consist of alternating keys and values.
+
+ SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+ ^
+<sql-statement>
+SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ ^
+<sql-statement>
+SELECT jsonb_build_object('a', 'b', 'c'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('a', 'b', 'c'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object('a', 'b', 'c'); -- error
+ ^
+<sql-statement>
+SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL
+ ^
+<sql-statement>
+SELECT jsonb_build_object('a', NULL); -- ok
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('a', NULL); -- ok
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object('a', NULL); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ ^
+<sql-statement>
+SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ ^
+<sql-statement>
+-- empty objects/arrays
+SELECT jsonb_build_array();
+</sql-statement>
+<sql-statement>
+SELECT jsonb_build_object();
+</sql-statement>
+<sql-statement>
+-- make sure keys are quoted
+SELECT jsonb_build_object(1,2);
+</sql-statement>
+<sql-statement>
+-- keys must be scalar and not null
+SELECT jsonb_build_object(null,2);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- keys must be scalar and not null
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ -- keys must be scalar and not null
+ ^
+<sql-statement>
+SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ ^
+<sql-statement>
+SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+ ^
+<sql-statement>
+SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json
+
+ SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+ ^
+<sql-statement>
+-- handling of NULL values
+SELECT jsonb_object_agg(1, NULL::jsonb);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_object_agg(NULL, '{"a":1}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT jsonb_object_agg(NULL, '{"a":1}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: field name must not be null
+
+ SELECT jsonb_object_agg(NULL, '{"a":1}');
+ ^
+<sql-statement>
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type)))
+FROM foo;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMapReduce!
+ SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type)))
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: could not determine data type for argument 1
+
+ SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type)))
+ ^
+<sql-statement>
+SELECT jsonb_object_agg(name, type) FROM foo;
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_object_agg(name, type) FROM foo;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMapReduce!
+ SELECT jsonb_object_agg(name, type) FROM foo;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: field name must not be null
+
+ SELECT jsonb_object_agg(name, type) FROM foo;
+ ^
+<sql-statement>
+-- jsonb_object
+-- empty object, one dimension
+SELECT jsonb_object('{}');
+</sql-statement>
+<sql-statement>
+-- empty object, two dimensions
+SELECT jsonb_object('{}', '{}');
+</sql-statement>
+<sql-statement>
+-- one dimension
+SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+</sql-statement>
+<sql-statement>
+-- same but with two dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+</sql-statement>
+<sql-statement>
+-- odd number error
+SELECT jsonb_object('{a,b,c}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- odd number error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have even number of elements
+
+ -- odd number error
+ ^
+<sql-statement>
+-- one column error
+SELECT jsonb_object('{{a},{b}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- one column error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have two columns
+
+ -- one column error
+ ^
+<sql-statement>
+-- too many columns error
+SELECT jsonb_object('{{a,b,c},{b,c,d}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many columns error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: array must have two columns
+
+ -- too many columns error
+ ^
+<sql-statement>
+-- too many dimensions error
+SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many dimensions error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: wrong number of array subscripts
+
+ -- too many dimensions error
+ ^
+<sql-statement>
+--two argument form of jsonb_object
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+<sql-statement>
+-- too many dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- too many dimensions
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: wrong number of array subscripts
+
+ -- too many dimensions
+ ^
+<sql-statement>
+-- mismatched dimensions
+select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- mismatched dimensions
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: mismatched array dimensions
+
+ -- mismatched dimensions
+ ^
+<sql-statement>
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: mismatched array dimensions
+
+ select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ ^
+<sql-statement>
+-- null key error
+select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- null key error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null value not allowed for object key
+
+ -- null key error
+ ^
+<sql-statement>
+-- empty key is allowed
+select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+</sql-statement>
+<sql-statement>
+-- extract_path, extract_path_as_text
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+</sql-statement>
+<sql-statement>
+-- extract_path nulls
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true;
+</sql-statement>
+<sql-statement>
+-- extract_path operators
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6'];
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- extract_path operators
+ ^
+ -stdin-:<main>:2:62: Error: At function: PgOp
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6'];
+ ^
+ -stdin-:<main>:2:62: Error: No such operator: #>
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6'];
+ ^
+<sql-statement>
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+ ^
+<sql-statement>
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+</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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+ ^
+<sql-statement>
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1'];
+ ^
+<sql-statement>
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>>
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+ ^
+<sql-statement>
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+</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 '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>>
+ SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+ ^
+<sql-statement>
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+</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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>>
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+ ^
+<sql-statement>
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','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 '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1'];
+ ^
+ -stdin-:<main>:1:62: Error: At function: PgOp
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1'];
+ ^
+ -stdin-:<main>:1:62: Error: No such operator: #>>
+ SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1'];
+ ^
+<sql-statement>
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
+</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 for same
+ ^
+ -stdin-:<main>:2:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:2:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
+ ^
+<sql-statement>
+select '[1,2,3]'::jsonb #> '{}';
+</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 '[1,2,3]'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgOp
+ select '[1,2,3]'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:25: Error: No such operator: #>
+ select '[1,2,3]'::jsonb #> '{}';
+ ^
+<sql-statement>
+select '"foo"'::jsonb #> '{}';
+</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 '"foo"'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:23: Error: At function: PgOp
+ select '"foo"'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:23: Error: No such operator: #>
+ select '"foo"'::jsonb #> '{}';
+ ^
+<sql-statement>
+select '42'::jsonb #> '{}';
+</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 '42'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>
+ select '42'::jsonb #> '{}';
+ ^
+<sql-statement>
+select 'null'::jsonb #> '{}';
+</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 'null'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select 'null'::jsonb #> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>
+ select 'null'::jsonb #> '{}';
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', 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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:50: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:50: Error: No such operator: #>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:50: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:50: Error: No such operator: #>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+</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 '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>
+ select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+ ^
+<sql-statement>
+select '"foo"'::jsonb #> array['z'];
+</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 '"foo"'::jsonb #> array['z'];
+ ^
+ -stdin-:<main>:1:23: Error: At function: PgOp
+ select '"foo"'::jsonb #> array['z'];
+ ^
+ -stdin-:<main>:1:23: Error: No such operator: #>
+ select '"foo"'::jsonb #> array['z'];
+ ^
+<sql-statement>
+select '42'::jsonb #> array['f2'];
+</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 '42'::jsonb #> array['f2'];
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #> array['f2'];
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>
+ select '42'::jsonb #> array['f2'];
+ ^
+<sql-statement>
+select '42'::jsonb #> array['0'];
+</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 '42'::jsonb #> array['0'];
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #> array['0'];
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>
+ select '42'::jsonb #> array['0'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+ ^
+<sql-statement>
+select '[1,2,3]'::jsonb #>> '{}';
+</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 '[1,2,3]'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgOp
+ select '[1,2,3]'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:25: Error: No such operator: #>>
+ select '[1,2,3]'::jsonb #>> '{}';
+ ^
+<sql-statement>
+select '"foo"'::jsonb #>> '{}';
+</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 '"foo"'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:23: Error: At function: PgOp
+ select '"foo"'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:23: Error: No such operator: #>>
+ select '"foo"'::jsonb #>> '{}';
+ ^
+<sql-statement>
+select '42'::jsonb #>> '{}';
+</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 '42'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>>
+ select '42'::jsonb #>> '{}';
+ ^
+<sql-statement>
+select 'null'::jsonb #>> '{}';
+</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 'null'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: At function: PgOp
+ select 'null'::jsonb #>> '{}';
+ ^
+ -stdin-:<main>:1:22: Error: No such operator: #>>
+ select 'null'::jsonb #>> '{}';
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', 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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+ ^
+<sql-statement>
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+</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 '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:50: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+ ^
+ -stdin-:<main>:1:50: Error: No such operator: #>>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+ ^
+<sql-statement>
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+</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 '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:50: Error: At function: PgOp
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+ ^
+ -stdin-:<main>:1:50: Error: No such operator: #>>
+ select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+</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 '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+ ^
+<sql-statement>
+select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+</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 '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgOp
+ select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+ ^
+ -stdin-:<main>:1:43: Error: No such operator: #>>
+ select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+ ^
+<sql-statement>
+select '"foo"'::jsonb #>> array['z'];
+</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 '"foo"'::jsonb #>> array['z'];
+ ^
+ -stdin-:<main>:1:23: Error: At function: PgOp
+ select '"foo"'::jsonb #>> array['z'];
+ ^
+ -stdin-:<main>:1:23: Error: No such operator: #>>
+ select '"foo"'::jsonb #>> array['z'];
+ ^
+<sql-statement>
+select '42'::jsonb #>> array['f2'];
+</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 '42'::jsonb #>> array['f2'];
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #>> array['f2'];
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>>
+ select '42'::jsonb #>> array['f2'];
+ ^
+<sql-statement>
+select '42'::jsonb #>> array['0'];
+</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 '42'::jsonb #>> array['0'];
+ ^
+ -stdin-:<main>:1:20: Error: At function: PgOp
+ select '42'::jsonb #>> array['0'];
+ ^
+ -stdin-:<main>:1:20: Error: No such operator: #>>
+ select '42'::jsonb #>> array['0'];
+ ^
+<sql-statement>
+-- array_elements
+SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]');
+ ^
+<sql-statement>
+SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q;
+</sql-statement>
+<sql-statement>
+SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ ^
+<sql-statement>
+SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+</sql-statement>
+<sql-statement>
+-- populate_record
+CREATE TYPE jbpop AS (a text, b int, c timestamp);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ -- populate_record
+ ^
+<sql-statement>
+CREATE DOMAIN jsb_int_not_null AS int NOT NULL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN jsb_int_not_null AS int NOT NULL;
+ ^
+<sql-statement>
+CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+ ^
+<sql-statement>
+CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+ ^
+<sql-statement>
+create type jb_unordered_pair as (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ create type jb_unordered_pair as (x int, y int);
+ ^
+<sql-statement>
+create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 272
+ create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y);
+ ^
+<sql-statement>
+CREATE TYPE jsbrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d jsb_int_array_1d,
+ ia2d jsb_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jbpop,
+ reca jbpop[]
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ CREATE TYPE jsbrec AS (
+ ^
+<sql-statement>
+CREATE TYPE jsbrec_i_not_null AS (
+ i jsb_int_not_null
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ CREATE TYPE jsbrec_i_not_null AS (
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:71: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:71: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:71: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:71: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:71: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q;
+ ^
+<sql-statement>
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec_i_not_null
+ SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q;
+ ^
+<sql-statement>
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec_i_not_null
+ SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q;
+ ^
+<sql-statement>
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec_i_not_null
+ SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
+ ^
+<sql-statement>
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
+ ^
+<sql-statement>
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+ ^
+<sql-statement>
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+ ^
+<sql-statement>
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
+ ^
+<sql-statement>
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
+ ^
+<sql-statement>
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+ ^
+<sql-statement>
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec
+ SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
+ ^
+<sql-statement>
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec
+ SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q;
+ ^
+<sql-statement>
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec
+ SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q;
+ ^
+<sql-statement>
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:43: Error: Unknown type: jsbrec
+ SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q;
+ ^
+<sql-statement>
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q;
+ ^
+<sql-statement>
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
+ ^
+<sql-statement>
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+ ^
+<sql-statement>
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+ ^
+<sql-statement>
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:44: Error: Unknown type: jsbrec
+ SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+ ^
+<sql-statement>
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
+ ^
+<sql-statement>
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+ ^
+<sql-statement>
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q;
+ ^
+<sql-statement>
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q;
+ ^
+<sql-statement>
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+ ^
+<sql-statement>
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Unknown type: jsbrec
+ SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+ ^
+<sql-statement>
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
+ ^
+<sql-statement>
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+ ^
+<sql-statement>
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jsbrec
+ SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+ ^
+<sql-statement>
+SELECT rec FROM jsonb_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:50: Error: alternative is not implemented yet : 138
+ row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec,
+ ^
+<sql-statement>
+-- anonymous record type
+SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 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
+ -- anonymous record type
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_populate_record with given argument types: (record,unknown)
+ SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}');
+ ^
+<sql-statement>
+SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 138
+ SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+ ^
+<sql-statement>
+SELECT * FROM
+ jsonb_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- composite domain
+SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:36: Error: Unknown type: jb_ordered_pair
+ SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}');
+ ^
+<sql-statement>
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:40: Error: alternative is not implemented yet : 138
+ SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}');
+ ^
+<sql-statement>
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:40: Error: alternative is not implemented yet : 138
+ SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}');
+ ^
+<sql-statement>
+-- populate_recordset
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:46: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:60: Error: alternative is not implemented yet : 138
+ SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ ^
+<sql-statement>
+-- anonymous record type
+SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+ ^
+<sql-statement>
+SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+ ^
+<sql-statement>
+SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:11: Error: Generator functions are not allowed in: SELECT
+ SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+ ^
+<sql-statement>
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- empty array is a corner case
+SELECT jsonb_populate_recordset(null::record, '[]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(null::record, '[]');
+ ^
+<sql-statement>
+SELECT jsonb_populate_recordset(row(1,2), '[]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(row(1,2), '[]');
+ ^
+<sql-statement>
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: Unknown type: jbpop
+ SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q;
+ ^
+<sql-statement>
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[]') AS (x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ SELECT * FROM
+ ^
+<sql-statement>
+-- composite domain
+SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]');
+ ^
+<sql-statement>
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]');
+ ^
+<sql-statement>
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]');
+ ^
+<sql-statement>
+-- negative cases where the wrong record type is supplied
+select * from jsonb_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ -- negative cases where the wrong record type is supplied
+ ^
+<sql-statement>
+select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+ ^
+<sql-statement>
+-- jsonb_to_record and jsonb_to_recordset
+select * from jsonb_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ -- jsonb_to_record and jsonb_to_recordset
+ ^
+<sql-statement>
+select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ ^
+<sql-statement>
+select *, c is null as c_is_null
+from jsonb_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::jsonb)
+ as t(a int, b jsonb, c text, x int, ca char(5)[], ia int[][], r jbpop);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select *, c is null as c_is_null
+ ^
+<sql-statement>
+select *, c is null as c_is_null
+from jsonb_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::jsonb)
+ as t(a int, b jsonb, c text, x int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select *, c is null as c_is_null
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": null}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": null}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+ ^
+<sql-statement>
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeFunction: unsupported coldeflist
+ select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+ ^
+<sql-statement>
+-- test type info caching in jsonb_populate_record()
+CREATE TEMP TABLE jsbpoptest (js jsonb);
+</sql-statement>
+<sql-statement>
+INSERT INTO jsbpoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::jsonb
+FROM generate_series(1, 3);
+</sql-statement>
+<sql-statement>
+SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest;
+ ^
+<sql-statement>
+DROP TYPE jsbrec;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE jsbrec;
+ ^
+<sql-statement>
+DROP TYPE jsbrec_i_not_null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE jsbrec_i_not_null;
+ ^
+<sql-statement>
+DROP DOMAIN jsb_int_not_null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN jsb_int_not_null;
+ ^
+<sql-statement>
+DROP DOMAIN jsb_int_array_1d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN jsb_int_array_1d;
+ ^
+<sql-statement>
+DROP DOMAIN jsb_int_array_2d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN jsb_int_array_2d;
+ ^
+<sql-statement>
+DROP DOMAIN jb_ordered_pair;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP DOMAIN jb_ordered_pair;
+ ^
+<sql-statement>
+DROP TYPE jb_unordered_pair;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ DROP TYPE jb_unordered_pair;
+ ^
+<sql-statement>
+-- indexing
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+</sql-statement>
+<sql-statement>
+CREATE INDEX jidx ON testjsonb USING gin (j);
+</sql-statement>
+<sql-statement>
+SET enable_seqscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ SET enable_seqscan = off;
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
+</sql-statement>
+<sql-statement>
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+</sql-statement>
+<sql-statement>
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF)
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+</sql-statement>
+<sql-statement>
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF)
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+</sql-statement>
+<sql-statement>
+-- array exists - array elements should behave as keys (for GIN index scans too)
+CREATE INDEX jidx_array ON testjsonb USING gin((j->'array'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ -- array exists - array elements should behave as keys (for GIN index scans too)
+ ^
+<sql-statement>
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+</sql-statement>
+<sql-statement>
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+</sql-statement>
+<sql-statement>
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+</sql-statement>
+<sql-statement>
+RESET enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_seqscan;
+ ^
+<sql-statement>
+SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+ ^
+<sql-statement>
+SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+ ^
+<sql-statement>
+-- sort/hash
+SELECT count(distinct j) FROM testjsonb;
+</sql-statement>
+<sql-statement>
+SET enable_hashagg = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ SET enable_hashagg = off;
+ ^
+<sql-statement>
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+</sql-statement>
+<sql-statement>
+SET enable_hashagg = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ SET enable_hashagg = on;
+ ^
+<sql-statement>
+SET enable_sort = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ SET enable_sort = off;
+ ^
+<sql-statement>
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+</sql-statement>
+<sql-statement>
+SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+</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: PgValuesList
+ SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+ ^
+ -stdin-:<main>:1:44: Error: At function: PgOp
+ SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+ ^
+ -stdin-:<main>:1:44: Error: Unable to find an overload for operator || with given argument type(s): (jsonb,text)
+ SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+ ^
+<sql-statement>
+SET enable_sort = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ SET enable_sort = on;
+ ^
+<sql-statement>
+RESET enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_hashagg;
+ ^
+<sql-statement>
+RESET enable_sort;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_sort;
+ ^
+<sql-statement>
+DROP INDEX jidx;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX jidx;
+ ^
+<sql-statement>
+DROP INDEX jidx_array;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX jidx_array;
+ ^
+<sql-statement>
+-- btree
+CREATE INDEX jidx ON testjsonb USING btree (j);
+</sql-statement>
+<sql-statement>
+SET enable_seqscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ SET enable_seqscan = off;
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j > '{"p":1}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}';
+</sql-statement>
+<sql-statement>
+--gin path opclass
+DROP INDEX jidx;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ --gin path opclass
+ ^
+<sql-statement>
+CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops);
+</sql-statement>
+<sql-statement>
+SET enable_seqscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ SET enable_seqscan = off;
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+</sql-statement>
+<sql-statement>
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+</sql-statement>
+<sql-statement>
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF)
+ ^
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+</sql-statement>
+<sql-statement>
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+</sql-statement>
+<sql-statement>
+RESET enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_seqscan;
+ ^
+<sql-statement>
+DROP INDEX jidx;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX jidx;
+ ^
+<sql-statement>
+-- nested tests
+SELECT '{"ff":{"a":12,"b":16}}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2"],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2",["c3"],{"c4":4}],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT '{"ff":["a","aaa"]}'::jsonb;
+</sql-statement>
+<sql-statement>
+SELECT
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff',
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq',
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f,
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t,
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x';
+</sql-statement>
+<sql-statement>
+-- nested containment
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+</sql-statement>
+<sql-statement>
+SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]';
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]';
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]';
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}';
+</sql-statement>
+<sql-statement>
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}';
+</sql-statement>
+<sql-statement>
+-- check some corner cases for indexed nested containment (bug #13756)
+create temp table nestjsonb (j jsonb);
+</sql-statement>
+<sql-statement>
+insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
+</sql-statement>
+<sql-statement>
+insert into nestjsonb (j) values ('[[14,2,3]]');
+</sql-statement>
+<sql-statement>
+insert into nestjsonb (j) values ('[1,[14,2,3]]');
+</sql-statement>
+<sql-statement>
+create index on nestjsonb using gin(j jsonb_path_ops);
+</sql-statement>
+<sql-statement>
+set enable_seqscan = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ set enable_seqscan = on;
+ ^
+<sql-statement>
+set enable_bitmapscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan
+ set enable_bitmapscan = off;
+ ^
+<sql-statement>
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+</sql-statement>
+<sql-statement>
+select * from nestjsonb where j @> '{"c":3}';
+</sql-statement>
+<sql-statement>
+select * from nestjsonb where j @> '[[14]]';
+</sql-statement>
+<sql-statement>
+set enable_seqscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ set enable_seqscan = off;
+ ^
+<sql-statement>
+set enable_bitmapscan = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan
+ set enable_bitmapscan = on;
+ ^
+<sql-statement>
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+</sql-statement>
+<sql-statement>
+select * from nestjsonb where j @> '{"c":3}';
+</sql-statement>
+<sql-statement>
+select * from nestjsonb where j @> '[[14]]';
+</sql-statement>
+<sql-statement>
+reset enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_seqscan;
+ ^
+<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>
+-- nested object field / array index lookup
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 0;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 1;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 2;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 4;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 5;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -1;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -5;
+</sql-statement>
+<sql-statement>
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -6;
+</sql-statement>
+<sql-statement>
+--nested path extraction
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ --nested path extraction
+ ^
+ -stdin-:<main>:2:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}';
+ ^
+ -stdin-:<main>:2:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+</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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+</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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+</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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}';
+ ^
+<sql-statement>
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-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 '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}';
+ ^
+ -stdin-:<main>:1:39: Error: At function: PgOp
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}';
+ ^
+ -stdin-:<main>:1:39: Error: No such operator: #>
+ SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}';
+ ^
+<sql-statement>
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+</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,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+ ^
+ -stdin-:<main>:1:44: Error: At function: PgOp
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+ ^
+ -stdin-:<main>:1:44: Error: No such operator: #>
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+ ^
+<sql-statement>
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{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,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}';
+ ^
+ -stdin-:<main>:1:44: Error: At function: PgOp
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}';
+ ^
+ -stdin-:<main>:1:44: Error: No such operator: #>
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}';
+ ^
+<sql-statement>
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{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 '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}';
+ ^
+ -stdin-:<main>:1:44: Error: At function: PgOp
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}';
+ ^
+ -stdin-:<main>:1:44: Error: No such operator: #>
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}';
+ ^
+<sql-statement>
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,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 '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}';
+ ^
+ -stdin-:<main>:1:44: Error: At function: PgOp
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}';
+ ^
+ -stdin-:<main>:1:44: Error: No such operator: #>
+ SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}';
+ ^
+<sql-statement>
+--nested exists
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd';
+</sql-statement>
+<sql-statement>
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e';
+</sql-statement>
+<sql-statement>
+-- jsonb_strip_nulls
+select jsonb_strip_nulls(null);
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('1');
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('"a string"');
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('null');
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('[1,2,null,3,4]');
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+</sql-statement>
+<sql-statement>
+select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+</sql-statement>
+<sql-statement>
+-- an empty object is not null and should not be stripped
+select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+</sql-statement>
+<sql-statement>
+select jsonb_pretty('{"a": "test", "b": [1, 2, 3], "c": "test3", "d":{"dd": "test4", "dd2":{"ddd": "test5"}}}');
+</sql-statement>
+<sql-statement>
+select jsonb_pretty('[{"f1":1,"f2":null},2,null,[[{"x":true},6,7],8],3]');
+</sql-statement>
+<sql-statement>
+select jsonb_pretty('{"a":["b", "c"], "d": {"e":"f"}}');
+</sql-statement>
+<sql-statement>
+select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}');
+</sql-statement>
+<sql-statement>
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+</sql-statement>
+<sql-statement>
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}';
+</sql-statement>
+<sql-statement>
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}';
+</sql-statement>
+<sql-statement>
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}';
+</sql-statement>
+<sql-statement>
+select '["a", "b"]'::jsonb || '["c"]';
+</sql-statement>
+<sql-statement>
+select '["a", "b"]'::jsonb || '["c", "d"]';
+</sql-statement>
+<sql-statement>
+select '["c"]' || '["a", "b"]'::jsonb;
+</sql-statement>
+<sql-statement>
+select '["a", "b"]'::jsonb || '"c"';
+</sql-statement>
+<sql-statement>
+select '"c"' || '["a", "b"]'::jsonb;
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb || '["a"]'::jsonb;
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb || '"a"'::jsonb;
+</sql-statement>
+<sql-statement>
+select '"b"'::jsonb || '"a"'::jsonb;
+</sql-statement>
+<sql-statement>
+select '{}'::jsonb || '{"a":"b"}'::jsonb;
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb || '{"a":"b"}'::jsonb;
+</sql-statement>
+<sql-statement>
+select '{"a":"b"}'::jsonb || '[]'::jsonb;
+</sql-statement>
+<sql-statement>
+select '"a"'::jsonb || '{"a":1}';
+</sql-statement>
+<sql-statement>
+select '{"a":1}' || '"a"'::jsonb;
+</sql-statement>
+<sql-statement>
+select '[3]'::jsonb || '{}'::jsonb;
+</sql-statement>
+<sql-statement>
+select '3'::jsonb || '[]'::jsonb;
+</sql-statement>
+<sql-statement>
+select '3'::jsonb || '4'::jsonb;
+</sql-statement>
+<sql-statement>
+select '3'::jsonb || '{}'::jsonb;
+</sql-statement>
+<sql-statement>
+select '["a", "b"]'::jsonb || '{"c":1}';
+</sql-statement>
+<sql-statement>
+select '{"c": 1}'::jsonb || '["a", "b"]';
+</sql-statement>
+<sql-statement>
+select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+</sql-statement>
+<sql-statement>
+select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb);
+</sql-statement>
+<sql-statement>
+select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+</sql-statement>
+<sql-statement>
+select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+</sql-statement>
+<sql-statement>
+select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+</sql-statement>
+<sql-statement>
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a');
+</sql-statement>
+<sql-statement>
+select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a');
+</sql-statement>
+<sql-statement>
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b');
+</sql-statement>
+<sql-statement>
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c');
+</sql-statement>
+<sql-statement>
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd');
+</sql-statement>
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'a';
+</sql-statement>
+<sql-statement>
+select '{"a":null , "b":2, "c":3}'::jsonb - 'a';
+</sql-statement>
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'b';
+</sql-statement>
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'c';
+</sql-statement>
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'd';
+</sql-statement>
+<sql-statement>
+select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb);
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - 3;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - 2;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - 1;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - 0;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - -1;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - -2;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - -3;
+</sql-statement>
+<sql-statement>
+select '["a","b","c"]'::jsonb - -4;
+</sql-statement>
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::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 '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: At function: PgOp
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text)
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[];
+ ^
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::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 '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: At function: PgOp
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text)
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[];
+ ^
+<sql-statement>
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::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 '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: At function: PgOp
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[];
+ ^
+ -stdin-:<main>:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text)
+ select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[];
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+</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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+ ^
+<sql-statement>
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+</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 jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown)
+ select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+ ^
+<sql-statement>
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}');
+</sql-statement>
+<sql-statement>
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}');
+</sql-statement>
+<sql-statement>
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}');
+</sql-statement>
+<sql-statement>
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}';
+</sql-statement>
+<sql-statement>
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}';
+</sql-statement>
+<sql-statement>
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: path element at position 2 is not an integer: "-1e"
+
+ select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+ ^
+<sql-statement>
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}';
+</sql-statement>
+<sql-statement>
+-- empty structure and error conditions for delete and replace
+select '"a"'::jsonb - 'a'; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- empty structure and error conditions for delete and replace
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot delete from scalar
+
+ -- empty structure and error conditions for delete and replace
+ ^
+<sql-statement>
+select '{}'::jsonb - 'a';
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb - 'a';
+</sql-statement>
+<sql-statement>
+select '"a"'::jsonb - 1; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"a"'::jsonb - 1; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot delete from scalar
+
+ select '"a"'::jsonb - 1; -- error
+ ^
+<sql-statement>
+select '{}'::jsonb - 1; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '{}'::jsonb - 1; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot delete from object using integer index
+
+ select '{}'::jsonb - 1; -- error
+ ^
+<sql-statement>
+select '[]'::jsonb - 1;
+</sql-statement>
+<sql-statement>
+select '"a"'::jsonb #- '{a}'; -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"a"'::jsonb #- '{a}'; -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot delete path in scalar
+
+ select '"a"'::jsonb #- '{a}'; -- error
+ ^
+<sql-statement>
+select '{}'::jsonb #- '{a}';
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb #- '{a}';
+</sql-statement>
+<sql-statement>
+select jsonb_set('"a"','{a}','"b"'); --error
+</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 jsonb_set('"a"','{a}','"b"'); --error
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('"a"','{a}','"b"'); --error
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('"a"','{a}','"b"'); --error
+ ^
+<sql-statement>
+select jsonb_set('{}','{a}','"b"', false);
+</sql-statement>
+<sql-statement>
+select jsonb_set('[]','{1}','"b"', false);
+</sql-statement>
+<sql-statement>
+select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false);
+</sql-statement>
+<sql-statement>
+-- jsonb_set adding instead of replacing
+-- prepend to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- jsonb_set adding instead of replacing
+ ^
+ -stdin-:<main>:3:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}');
+ ^
+ -stdin-:<main>:3:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}');
+ ^
+<sql-statement>
+-- append to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- append to array
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}');
+ ^
+<sql-statement>
+-- check nesting levels addition
+select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- check nesting levels addition
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}');
+ ^
+<sql-statement>
+-- add new key
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- add new key
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}');
+ ^
+<sql-statement>
+-- adding doesn't do anything if elements before last aren't present
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- adding doesn't do anything if elements before last aren't present
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}');
+ ^
+<sql-statement>
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+</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 jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+ ^
+<sql-statement>
+-- add to empty object
+select jsonb_set('{}','{x}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- add to empty object
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('{}','{x}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{}','{x}','{"foo":123}');
+ ^
+<sql-statement>
+--add to empty array
+select jsonb_set('[]','{0}','{"foo":123}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ --add to empty array
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set('[]','{0}','{"foo":123}');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('[]','{0}','{"foo":123}');
+ ^
+<sql-statement>
+select jsonb_set('[]','{99}','{"foo":123}');
+</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 jsonb_set('[]','{99}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('[]','{99}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('[]','{99}','{"foo":123}');
+ ^
+<sql-statement>
+select jsonb_set('[]','{-99}','{"foo":123}');
+</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 jsonb_set('[]','{-99}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('[]','{-99}','{"foo":123}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('[]','{-99}','{"foo":123}');
+ ^
+<sql-statement>
+select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+</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 jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+</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 jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+</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 jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown)
+ select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+ ^
+<sql-statement>
+-- jsonb_set_lax
+\pset null NULL
+</sql-statement>
+<sql-statement>
+-- pass though non nulls to jsonb_set
+select jsonb_set_lax('{"a":1,"b":2}','{b}','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
+ -- pass though non nulls to jsonb_set
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ;
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown)
+ select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ;
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+</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 jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown,bool)
+ select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+ ^
+<sql-statement>
+-- using the default treatment
+select jsonb_set_lax('{"a":1,"b":2}','{b}',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
+ -- using the default treatment
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_set_lax('{"a":1,"b":2}','{b}',null);
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown)
+ select jsonb_set_lax('{"a":1,"b":2}','{b}',null);
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+</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 jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown,bool)
+ select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+ ^
+<sql-statement>
+-- errors
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+
+ -- errors
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+ ^
+<sql-statement>
+-- explicit treatments
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: alternative is not implemented yet : 118
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception;
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target;
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key;
+ ^
+<sql-statement>
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null;
+ ^
+<sql-statement>
+\pset null ''
+</sql-statement>
+<sql-statement>
+-- jsonb_insert
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- jsonb_insert
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+</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 jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+ ^
+<sql-statement>
+-- edge cases
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- edge cases
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('[]', '{1}', '"new_value"');
+</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 jsonb_insert('[]', '{1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('[]', '{1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('[]', '{1}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('[]', '{1}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+</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 jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+</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 jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+ ^
+<sql-statement>
+-- jsonb_insert should be able to insert new value for objects, but not to replace
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- jsonb_insert should be able to insert new value for objects, but not to replace
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true);
+</sql-statement>
+<sql-statement>
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+</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 jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown)
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+ ^
+<sql-statement>
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot replace existing key
+HINT: Try using the function jsonb_set to replace key value.
+
+ select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+ ^
+<sql-statement>
+-- jsonb subscript
+select ('123'::jsonb)['a'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ -- jsonb subscript
+ ^
+<sql-statement>
+select ('123'::jsonb)[0];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('123'::jsonb)[0];
+ ^
+<sql-statement>
+select ('123'::jsonb)[NULL];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('123'::jsonb)[NULL];
+ ^
+<sql-statement>
+select ('{"a": 1}'::jsonb)['a'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1}'::jsonb)['a'];
+ ^
+<sql-statement>
+select ('{"a": 1}'::jsonb)[0];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1}'::jsonb)[0];
+ ^
+<sql-statement>
+select ('{"a": 1}'::jsonb)['not_exist'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1}'::jsonb)['not_exist'];
+ ^
+<sql-statement>
+select ('{"a": 1}'::jsonb)[NULL];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1}'::jsonb)[NULL];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)['a'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)['a'];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[0];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[0];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)['1'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)['1'];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[1.0];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[1.0];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[2];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[3];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[3];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[-2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[-2];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[1]['a'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[1]['a'];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[1][0];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[1][0];
+ ^
+<sql-statement>
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b'];
+ ^
+<sql-statement>
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'];
+ ^
+<sql-statement>
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1];
+ ^
+<sql-statement>
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a'];
+ ^
+<sql-statement>
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1'];
+ ^
+<sql-statement>
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2'];
+ ^
+<sql-statement>
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3'];
+ ^
+<sql-statement>
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'];
+ ^
+<sql-statement>
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2];
+ ^
+<sql-statement>
+-- slices are not supported
+select ('{"a": 1}'::jsonb)['a':'b'];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ -- slices are not supported
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[1:2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[1:2];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[:2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[:2];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[1:];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[1:];
+ ^
+<sql-statement>
+select ('[1, "2", null]'::jsonb)[:];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ select ('[1, "2", null]'::jsonb)[:];
+ ^
+<sql-statement>
+create TEMP TABLE test_jsonb_subscript (
+ id int,
+ test_json jsonb
+);
+</sql-statement>
+<sql-statement>
+insert into test_jsonb_subscript values
+(1, '{}'), -- empty jsonb
+(2, '{"key": "value"}'); -- jsonb with data
+</sql-statement>
+<sql-statement>
+-- update empty jsonb
+update test_jsonb_subscript set test_json['a'] = '1' where id = 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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- update jsonb with some data
+update test_jsonb_subscript set test_json['a'] = '1' where id = 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>
+select * from test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- replace jsonb
+update test_jsonb_subscript set test_json['a'] = '"test"';
+</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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- replace by object
+update test_jsonb_subscript set test_json['a'] = '{"b": 1}'::jsonb;
+</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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- replace by array
+update test_jsonb_subscript set test_json['a'] = '[1, 2, 3]'::jsonb;
+</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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- use jsonb subscription in where clause
+select * from test_jsonb_subscript where test_json['key'] = '"value"';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:59: Error: alternative is not implemented yet : 360
+ select * from test_jsonb_subscript where test_json['key'] = '"value"';
+ ^
+<sql-statement>
+select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:73: Error: alternative is not implemented yet : 360
+ select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"';
+ ^
+<sql-statement>
+select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:59: Error: alternative is not implemented yet : 360
+ select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"';
+ ^
+<sql-statement>
+-- NULL
+update test_jsonb_subscript set test_json[NULL] = '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 test_jsonb_subscript set test_json['another_key'] = 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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- NULL as jsonb source
+insert into test_jsonb_subscript values (3, NULL);
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a'] = '1' where id = 3;
+</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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json = NULL where id = 3;
+</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 test_jsonb_subscript set test_json[0] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- Fill the gaps logic
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '[0]');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[5] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[-4] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[-8] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- keep consistent values position
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '[]');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[5] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- create the whole path
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a'][0]['b'][0]['c'] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a'][2]['b'][2]['c'][2] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- create the whole path with already existing keys
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{"b": 1}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a'][0] = '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>
+select * from test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- the start jsonb is an object, first subscript is treated as a key
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[0]['a'] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- the start jsonb is an array
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '[]');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[0]['a'] = '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 test_jsonb_subscript set test_json[2]['b'] = '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>
+select * from test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- overwriting an existing path
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a']['b'][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 test_jsonb_subscript set test_json['a']['b'][10] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '[]');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[0][0][0] = '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 test_jsonb_subscript set test_json[0][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>
+select * from test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a']['b'][10] = '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 test_jsonb_subscript set test_json['a'][10][10] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- an empty sub element
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{"a": {}}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a']['b']['c'][2] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{"a": []}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a'][1]['c'][2] = '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 test_jsonb_subscript;
+</sql-statement>
+<sql-statement>
+-- trying replace assuming a composite object, but it's an element or a value
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, '{"a": 1}');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json['a']['b'] = '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 test_jsonb_subscript set test_json['a']['b']['c'] = '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 test_jsonb_subscript set test_json['a'][0] = '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 test_jsonb_subscript set test_json['a'][0]['c'] = '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 test_jsonb_subscript set test_json['a'][0][0] = '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>
+-- trying replace assuming a composite object, but it's a raw scalar
+delete from test_jsonb_subscript;
+</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 test_jsonb_subscript values (1, 'null');
+</sql-statement>
+<sql-statement>
+update test_jsonb_subscript set test_json[0] = '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 test_jsonb_subscript set test_json[0][0] = '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>
+-- jsonb to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb to tsvector
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- jsonb to tsvector
+ ^
+<sql-statement>
+-- jsonb to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb to tsvector with config
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "simple" does not exist
+
+ -- jsonb to tsvector with config
+ ^
+<sql-statement>
+-- jsonb to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb to tsvector with stop words
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- jsonb to tsvector with stop words
+ ^
+<sql-statement>
+-- jsonb to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb to tsvector with numeric values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- jsonb to tsvector with numeric values
+ ^
+<sql-statement>
+-- jsonb_to_tsvector
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb_to_tsvector
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ -- jsonb_to_tsvector
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ ^
+<sql-statement>
+-- to_tsvector corner cases
+select to_tsvector('""'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- to_tsvector corner cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- to_tsvector corner cases
+ ^
+<sql-statement>
+select to_tsvector('{}'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('{}'::jsonb);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('{}'::jsonb);
+ ^
+<sql-statement>
+select to_tsvector('[]'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('[]'::jsonb);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('[]'::jsonb);
+ ^
+<sql-statement>
+select to_tsvector('null'::jsonb);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select to_tsvector('null'::jsonb);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select to_tsvector('null'::jsonb);
+ ^
+<sql-statement>
+-- jsonb_to_tsvector corner cases
+select jsonb_to_tsvector('""'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- jsonb_to_tsvector corner cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ -- jsonb_to_tsvector corner cases
+ ^
+<sql-statement>
+select jsonb_to_tsvector('{}'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('{}'::jsonb, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select jsonb_to_tsvector('{}'::jsonb, '"all"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('[]'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('[]'::jsonb, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select jsonb_to_tsvector('[]'::jsonb, '"all"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('null'::jsonb, '"all"');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('null'::jsonb, '"all"');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration isn't set
+
+ select jsonb_to_tsvector('null'::jsonb, '"all"');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null');
+ ^
+<sql-statement>
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: text search configuration "english" does not exist
+
+ select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
+ ^
+<sql-statement>
+-- ts_headline for jsonb
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- ts_headline for jsonb
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:2:122: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:2:122: Error: No such proc: tsquery
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+<sql-statement>
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+</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 ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:114: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+ -stdin-:<main>:1:114: Error: No such proc: tsquery
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ^
+<sql-statement>
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+</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 ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:122: Error: At function: PgCall
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:122: Error: No such proc: tsquery
+ select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+<sql-statement>
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+</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 ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:133: Error: At function: PgCall
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+ -stdin-:<main>:1:133: Error: No such proc: tsquery
+ select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ^
+<sql-statement>
+-- corner cases for ts_headline with jsonb
+select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+</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 for ts_headline with jsonb
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:2:35: Error: At function: PgCall
+ select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:2:35: Error: No such proc: tsquery
+ select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+ ^
+<sql-statement>
+select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+</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 ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgCall
+ select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:33: Error: No such proc: tsquery
+ select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+ ^
+<sql-statement>
+select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+</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 ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgCall
+ select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+ ^
+ -stdin-:<main>:1:33: Error: No such proc: tsquery
+ select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+ ^
+<sql-statement>
+-- casts
+select 'true'::jsonb::bool;
+</sql-statement>
+<sql-statement>
+select '[]'::jsonb::bool;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '[]'::jsonb::bool;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot cast jsonb array to type boolean
+
+ select '[]'::jsonb::bool;
+ ^
+<sql-statement>
+select '1.0'::jsonb::float;
+</sql-statement>
+<sql-statement>
+select '[1.0]'::jsonb::float;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '[1.0]'::jsonb::float;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot cast jsonb array to type double precision
+
+ select '[1.0]'::jsonb::float;
+ ^
+<sql-statement>
+select '12345'::jsonb::int4;
+</sql-statement>
+<sql-statement>
+select '"hello"'::jsonb::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"hello"'::jsonb::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot cast jsonb string to type integer
+
+ select '"hello"'::jsonb::int4;
+ ^
+<sql-statement>
+select '12345'::jsonb::numeric;
+</sql-statement>
+<sql-statement>
+select '{}'::jsonb::numeric;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '{}'::jsonb::numeric;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot cast jsonb object to type numeric
+
+ select '{}'::jsonb::numeric;
+ ^
+<sql-statement>
+select '12345.05'::jsonb::numeric;
+</sql-statement>
+<sql-statement>
+select '12345.05'::jsonb::float4;
+</sql-statement>
+<sql-statement>
+select '12345.05'::jsonb::float8;
+</sql-statement>
+<sql-statement>
+select '12345.05'::jsonb::int2;
+</sql-statement>
+<sql-statement>
+select '12345.05'::jsonb::int4;
+</sql-statement>
+<sql-statement>
+select '12345.05'::jsonb::int8;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4;
+</sql-statement>
+<sql-statement>
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/jsonb.out b/yql/essentials/tests/postgresql/cases/jsonb.out
new file mode 100644
index 0000000000..e5f5749055
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb.out
@@ -0,0 +1,2987 @@
+-- Strings.
+SELECT '""'::jsonb; -- OK.
+ jsonb
+-------
+ ""
+(1 row)
+
+SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT $$''$$::jsonb;
+ ^
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+SELECT '"abc"'::jsonb; -- OK
+ jsonb
+-------
+ "abc"
+(1 row)
+
+SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc'::jsonb;
+ ^
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"abc
+def"'::jsonb; -- ERROR, unescaped newline in string constant
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc
+ ^
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
+ jsonb
+----------
+ "\n\"\\"
+(1 row)
+
+SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\v"'::jsonb;
+ ^
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::jsonb; -- OK
+ jsonb
+-------
+ 1
+(1 row)
+
+SELECT '0'::jsonb; -- OK
+ jsonb
+-------
+ 0
+(1 row)
+
+SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '01'::jsonb;
+ ^
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+SELECT '0.1'::jsonb; -- OK
+ jsonb
+-------
+ 0.1
+(1 row)
+
+SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8
+ jsonb
+---------------------
+ 9223372036854775808
+(1 row)
+
+SELECT '1f2'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1f2'::jsonb;
+ ^
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+SELECT '0.x1'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '0.x1'::jsonb;
+ ^
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+SELECT '1.3ex100'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1.3ex100'::jsonb;
+ ^
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+-- Arrays.
+SELECT '[]'::jsonb; -- OK
+ jsonb
+-------
+ []
+(1 row)
+
+SELECT '[1,2]'::jsonb; -- OK
+ jsonb
+--------
+ [1, 2]
+(1 row)
+
+SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2,]'::jsonb;
+ ^
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2'::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,[2]'::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+-- Objects.
+SELECT '{}'::jsonb; -- OK
+ jsonb
+-------
+ {}
+(1 row)
+
+SELECT '{"abc"}'::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"}'::jsonb;
+ ^
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+SELECT '{"abc":1}'::jsonb; -- OK
+ jsonb
+------------
+ {"abc": 1}
+(1 row)
+
+SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{1:"abc"}'::jsonb;
+ ^
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc",1}'::jsonb;
+ ^
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"=1}'::jsonb;
+ ^
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"::1}'::jsonb;
+ ^
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+ jsonb
+--------------------------------------------------------------------
+ {"abc": 1, "def": 2, "ghi": [3, 4], "hij": {"klm": 5, "nop": [6]}}
+(1 row)
+
+SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1:2}'::jsonb;
+ ^
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1,3}'::jsonb;
+ ^
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+-- Miscellaneous stuff.
+SELECT 'true'::jsonb; -- OK
+ jsonb
+-------
+ true
+(1 row)
+
+SELECT 'false'::jsonb; -- OK
+ jsonb
+-------
+ false
+(1 row)
+
+SELECT 'null'::jsonb; -- OK
+ jsonb
+-------
+ null
+(1 row)
+
+SELECT ' true '::jsonb; -- OK, even with extra whitespace
+ jsonb
+-------
+ true
+(1 row)
+
+SELECT 'true false'::jsonb; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true false'::jsonb;
+ ^
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+SELECT 'true, false'::jsonb; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true, false'::jsonb;
+ ^
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+SELECT 'truf'::jsonb; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'truf'::jsonb;
+ ^
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+SELECT 'trues'::jsonb; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'trues'::jsonb;
+ ^
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+SELECT ''::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ''::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+SELECT ' '::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ' '::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::jsonb; -- OK
+ jsonb
+-----------------------------------------
+ {"one": 1, "two": "two", "three": true}
+(1 row)
+
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::jsonb;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+-- ERROR missing value for last field
+-- make sure jsonb is passed through json generators without being escaped
+SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']);
+ array_to_json
+--------------------------
+ [{"a": 1},{"b": [2, 3]}]
+(1 row)
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+SET LOCAL TIME ZONE -8;
+COMMIT;
+-- jsonb extraction functions
+CREATE TEMP TABLE test_jsonb (
+ json_type text,
+ test_json jsonb
+);
+INSERT INTO test_jsonb VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ "val2"
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ val2
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+ "two"
+(1 row)
+
+SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+-----------
+ {"f1": 9}
+(1 row)
+
+SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ 4
+(1 row)
+
+SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+-----------
+ {"f1": 9}
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+ two
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+-- nulls
+SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object';
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object';
+ expect_true
+-------------
+ t
+(1 row)
+
+SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array';
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array';
+ expect_true
+-------------
+ t
+(1 row)
+
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::jsonb -> 'b';
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::jsonb -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::jsonb ->> 'b';
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+-- equality and inequality
+SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+-- containment
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+-- Raw scalar may contain another raw scalar, array may contain a raw scalar
+SELECT '[5]'::jsonb @> '[5]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '5'::jsonb @> '5';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[5]'::jsonb @> '5';
+ ?column?
+----------
+ t
+(1 row)
+
+-- But a raw scalar cannot contain an array
+SELECT '5'::jsonb @> '[5]';
+ ?column?
+----------
+ f
+(1 row)
+
+-- In general, one thing should always contain itself. Test array containment:
+SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+-- array containment string matching confusion bug
+SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}';
+ ?column?
+----------
+ f
+(1 row)
+
+-- array length
+SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+ jsonb_array_length
+--------------------
+ 5
+(1 row)
+
+SELECT jsonb_array_length('[]');
+ jsonb_array_length
+--------------------
+ 0
+(1 row)
+
+SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+ERROR: cannot get array length of a non-array
+SELECT jsonb_array_length('4');
+ERROR: cannot get array length of a scalar
+SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1, 2, 3]
+ f2 | {"f3": 1}
+ f4 | null
+ f5 | 99
+ f6 | "stringy"
+(5 rows)
+
+SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ key | value
+-----+------------------------------------
+ 1 | "first"
+ a | {"1": "first", "b": "c", "c": "b"}
+ b | [1, 2]
+ c | "cc"
+ n | null
+(5 rows)
+
+SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1, 2, 3]
+ f2 | {"f3": 1}
+ f4 |
+ f5 | 99
+ f6 | stringy
+(5 rows)
+
+SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ key | value
+-----+------------------------------------
+ 1 | first
+ a | {"1": "first", "b": "c", "c": "b"}
+ b | [1, 2]
+ c | cc
+ n |
+(5 rows)
+
+-- exists
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c');
+ jsonb_exists
+--------------
+ f
+(1 row)
+
+SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'b';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'c';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+-- array exists - array elements should behave as keys
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+ count
+-------
+ 3
+(1 row)
+
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+ count
+-------
+ 0
+(1 row)
+
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+ count
+-------
+ 1
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']);
+ jsonb_exists_any
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]);
+ jsonb_exists_any
+------------------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']);
+ jsonb_exists_all
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']);
+ jsonb_exists_all
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[];
+ ?column?
+----------
+ t
+(1 row)
+
+-- typeof
+SELECT jsonb_typeof('{}') AS object;
+ object
+--------
+ object
+(1 row)
+
+SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object;
+ object
+--------
+ object
+(1 row)
+
+SELECT jsonb_typeof('[]') AS array;
+ array
+-------
+ array
+(1 row)
+
+SELECT jsonb_typeof('["a", 1]') AS array;
+ array
+-------
+ array
+(1 row)
+
+SELECT jsonb_typeof('null') AS "null";
+ null
+------
+ null
+(1 row)
+
+SELECT jsonb_typeof('1') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('-1') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('1.0') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('1e2') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('-1.0') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('true') AS boolean;
+ boolean
+---------
+ boolean
+(1 row)
+
+SELECT jsonb_typeof('false') AS boolean;
+ boolean
+---------
+ boolean
+(1 row)
+
+SELECT jsonb_typeof('"hello"') AS string;
+ string
+--------
+ string
+(1 row)
+
+SELECT jsonb_typeof('"true"') AS string;
+ string
+--------
+ string
+(1 row)
+
+SELECT jsonb_typeof('"1.0"') AS string;
+ string
+--------
+ string
+(1 row)
+
+SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of jsonb_build_object() must consist of alternating keys and values.
+SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ERROR: key value must be scalar, not array, composite, or json
+-- empty objects/arrays
+SELECT jsonb_build_array();
+ jsonb_build_array
+-------------------
+ []
+(1 row)
+
+SELECT jsonb_build_object();
+ jsonb_build_object
+--------------------
+ {}
+(1 row)
+
+-- make sure keys are quoted
+SELECT jsonb_build_object(1,2);
+ jsonb_build_object
+--------------------
+ {"1": 2}
+(1 row)
+
+SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ERROR: key value must be scalar, not array, composite, or json
+SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+ERROR: key value must be scalar, not array, composite, or json
+SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+ERROR: key value must be scalar, not array, composite, or json
+-- handling of NULL values
+SELECT jsonb_object_agg(1, NULL::jsonb);
+ jsonb_object_agg
+------------------
+ {"1": null}
+(1 row)
+
+SELECT jsonb_object_agg(NULL, '{"a":1}');
+ERROR: field name must not be null
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT jsonb_object_agg(name, type) FROM foo;
+ jsonb_object_agg
+-----------------------------------------------------------
+ {"t15": "GE1043", "t16": "GE1043", "sub-alpha": "GESS90"}
+(1 row)
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT jsonb_object_agg(name, type) FROM foo;
+ERROR: field name must not be null
+-- jsonb_object
+-- empty object, one dimension
+SELECT jsonb_object('{}');
+ jsonb_object
+--------------
+ {}
+(1 row)
+
+-- empty object, two dimensions
+SELECT jsonb_object('{}', '{}');
+ jsonb_object
+--------------
+ {}
+(1 row)
+
+-- one dimension
+SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+ jsonb_object
+---------------------------------------------------
+ {"3": null, "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- same but with two dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ jsonb_object
+---------------------------------------------------
+ {"3": null, "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- odd number error
+SELECT jsonb_object('{a,b,c}');
+ERROR: array must have even number of elements
+-- one column error
+SELECT jsonb_object('{{a},{b}}');
+ERROR: array must have two columns
+-- too many columns error
+SELECT jsonb_object('{{a,b,c},{b,c,d}}');
+ERROR: array must have two columns
+-- too many dimensions error
+SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+ERROR: wrong number of array subscripts
+--two argument form of jsonb_object
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+ jsonb_object
+--------------------------------------------------
+ {"a": "1", "b": "2", "c": "3", "d e f": "a b c"}
+(1 row)
+
+-- too many dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ERROR: wrong number of array subscripts
+-- mismatched dimensions
+select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+ERROR: mismatched array dimensions
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ERROR: mismatched array dimensions
+-- null key error
+select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+ERROR: null value not allowed for object key
+-- empty key is allowed
+select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+ jsonb_object
+-------------------------------------------------
+ {"": "3", "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- extract_path, extract_path_as_text
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ jsonb_extract_path
+--------------------
+ "stringy"
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ jsonb_extract_path
+--------------------
+ {"f3": 1}
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ jsonb_extract_path
+--------------------
+ "f3"
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ jsonb_extract_path
+--------------------
+ 1
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ jsonb_extract_path_text
+-------------------------
+ stringy
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ jsonb_extract_path_text
+-------------------------
+ {"f3": 1}
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ jsonb_extract_path_text
+-------------------------
+ f3
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ jsonb_extract_path_text
+-------------------------
+ 1
+(1 row)
+
+-- extract_path nulls
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q;
+ value
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+ null
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+(6 rows)
+
+SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+ stringy
+(7 rows)
+
+-- test type info caching in jsonb_populate_record()
+CREATE TEMP TABLE jsbpoptest (js jsonb);
+INSERT INTO jsbpoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::jsonb
+FROM generate_series(1, 3);
+-- indexing
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+CREATE INDEX jidx ON testjsonb USING gin (j);
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
+ count
+-------
+ 3
+(1 row)
+
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+ count
+-------
+ 3
+(1 row)
+
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+ count
+-------
+ 0
+(1 row)
+
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+ count
+-------
+ 1
+(1 row)
+
+-- btree
+CREATE INDEX jidx ON testjsonb USING btree (j);
+SELECT count(*) FROM testjsonb WHERE j > '{"p":1}';
+ count
+-------
+ 884
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}';
+ count
+-------
+ 1
+(1 row)
+
+CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops);
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+-- nested tests
+SELECT '{"ff":{"a":12,"b":16}}'::jsonb;
+ jsonb
+----------------------------
+ {"ff": {"a": 12, "b": 16}}
+(1 row)
+
+SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb;
+ jsonb
+---------------------------------------
+ {"ff": {"a": 12, "b": 16}, "qq": 123}
+(1 row)
+
+SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb;
+ jsonb
+--------------------------------------------------------------------------------------------------
+ {"aa": ["a", "aaa"], "qq": {"a": 12, "b": 16, "c": ["c1", "c2"], "d": {"d1": "d3", "d2": "d2"}}}
+(1 row)
+
+SELECT '{"ff":["a","aaa"]}'::jsonb;
+ jsonb
+----------------------
+ {"ff": ["a", "aaa"]}
+(1 row)
+
+SELECT
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff',
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq',
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f,
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t,
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x';
+ ?column? | ?column? | f | t | ?column?
+--------------------+----------+---+---+----------
+ {"a": 12, "b": 16} | 123 | f | t | [1, 2]
+(1 row)
+
+-- nested containment
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}';
+ ?column?
+----------
+ t
+(1 row)
+
+-- check some corner cases for indexed nested containment (bug #13756)
+create temp table nestjsonb (j jsonb);
+insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
+insert into nestjsonb (j) values ('[[14,2,3]]');
+insert into nestjsonb (j) values ('[1,[14,2,3]]');
+create index on nestjsonb using gin(j jsonb_path_ops);
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '{"c":3}';
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '[[14]]';
+ j
+-----------------
+ [[14, 2, 3]]
+ [1, [14, 2, 3]]
+(2 rows)
+
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '{"c":3}';
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '[[14]]';
+ j
+-----------------
+ [[14, 2, 3]]
+ [1, [14, 2, 3]]
+(2 rows)
+
+-- nested object field / array index lookup
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n';
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a';
+ ?column?
+----------
+ 1
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b';
+ ?column?
+----------
+ [1, 2]
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c';
+ ?column?
+----------
+ {"1": 2}
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd';
+ ?column?
+---------------
+ {"1": [2, 3]}
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1';
+ ?column?
+----------
+ [2, 3]
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e';
+ ?column?
+----------
+
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error
+ ?column?
+----------
+
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 0;
+ ?column?
+----------
+ "a"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 1;
+ ?column?
+----------
+ "b"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 2;
+ ?column?
+----------
+ "c"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3;
+ ?column?
+----------
+ [1, 2]
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 4;
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 5;
+ ?column?
+----------
+
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -1;
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -5;
+ ?column?
+----------
+ "a"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -6;
+ ?column?
+----------
+
+(1 row)
+
+--nested exists
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e';
+ ?column?
+----------
+ f
+(1 row)
+
+-- jsonb_strip_nulls
+select jsonb_strip_nulls(null);
+ jsonb_strip_nulls
+-------------------
+
+(1 row)
+
+select jsonb_strip_nulls('1');
+ jsonb_strip_nulls
+-------------------
+ 1
+(1 row)
+
+select jsonb_strip_nulls('"a string"');
+ jsonb_strip_nulls
+-------------------
+ "a string"
+(1 row)
+
+select jsonb_strip_nulls('null');
+ jsonb_strip_nulls
+-------------------
+ null
+(1 row)
+
+select jsonb_strip_nulls('[1,2,null,3,4]');
+ jsonb_strip_nulls
+--------------------
+ [1, 2, null, 3, 4]
+(1 row)
+
+select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+ jsonb_strip_nulls
+--------------------------------------------
+ {"a": 1, "c": [2, null, 3], "d": {"e": 4}}
+(1 row)
+
+select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+ jsonb_strip_nulls
+--------------------------
+ [1, {"a": 1, "c": 2}, 3]
+(1 row)
+
+-- an empty object is not null and should not be stripped
+select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+ jsonb_strip_nulls
+--------------------
+ {"a": {}, "d": {}}
+(1 row)
+
+select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}');
+ jsonb_concat
+-------------------------------------------------------------------
+ {"a": [1, 2], "c": {"c1": 1, "c2": 2}, "d": "test", "g": "test2"}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+ ?column?
+---------------------------------------------
+ {"b": "g", "aa": 1, "cq": "l", "fg": false}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}';
+ ?column?
+---------------------------------------
+ {"b": 2, "aa": 1, "aq": "l", "cq": 3}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}';
+ ?column?
+------------------------------
+ {"b": 2, "aa": "l", "cq": 3}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}';
+ ?column?
+----------------------------
+ {"b": 2, "aa": 1, "cq": 3}
+(1 row)
+
+select '["a", "b"]'::jsonb || '["c"]';
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '["a", "b"]'::jsonb || '["c", "d"]';
+ ?column?
+----------------------
+ ["a", "b", "c", "d"]
+(1 row)
+
+select '["c"]' || '["a", "b"]'::jsonb;
+ ?column?
+-----------------
+ ["c", "a", "b"]
+(1 row)
+
+select '["a", "b"]'::jsonb || '"c"';
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '"c"' || '["a", "b"]'::jsonb;
+ ?column?
+-----------------
+ ["c", "a", "b"]
+(1 row)
+
+select '[]'::jsonb || '["a"]'::jsonb;
+ ?column?
+----------
+ ["a"]
+(1 row)
+
+select '[]'::jsonb || '"a"'::jsonb;
+ ?column?
+----------
+ ["a"]
+(1 row)
+
+select '"b"'::jsonb || '"a"'::jsonb;
+ ?column?
+------------
+ ["b", "a"]
+(1 row)
+
+select '{}'::jsonb || '{"a":"b"}'::jsonb;
+ ?column?
+------------
+ {"a": "b"}
+(1 row)
+
+select '[]'::jsonb || '{"a":"b"}'::jsonb;
+ ?column?
+--------------
+ [{"a": "b"}]
+(1 row)
+
+select '{"a":"b"}'::jsonb || '[]'::jsonb;
+ ?column?
+--------------
+ [{"a": "b"}]
+(1 row)
+
+select '"a"'::jsonb || '{"a":1}';
+ ?column?
+-----------------
+ ["a", {"a": 1}]
+(1 row)
+
+select '{"a":1}' || '"a"'::jsonb;
+ ?column?
+-----------------
+ [{"a": 1}, "a"]
+(1 row)
+
+select '[3]'::jsonb || '{}'::jsonb;
+ ?column?
+----------
+ [3, {}]
+(1 row)
+
+select '3'::jsonb || '[]'::jsonb;
+ ?column?
+----------
+ [3]
+(1 row)
+
+select '3'::jsonb || '4'::jsonb;
+ ?column?
+----------
+ [3, 4]
+(1 row)
+
+select '3'::jsonb || '{}'::jsonb;
+ ?column?
+----------
+ [3, {}]
+(1 row)
+
+select '["a", "b"]'::jsonb || '{"c":1}';
+ ?column?
+----------------------
+ ["a", "b", {"c": 1}]
+(1 row)
+
+select '{"c": 1}'::jsonb || '["a", "b"]';
+ ?column?
+----------------------
+ [{"c": 1}, "a", "b"]
+(1 row)
+
+select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+ ?column?
+------------------------------------
+ {"b": "g", "cq": "l", "fg": false}
+(1 row)
+
+select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a');
+ jsonb_delete
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a');
+ jsonb_delete
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b');
+ jsonb_delete
+------------------
+ {"a": 1, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c');
+ jsonb_delete
+------------------
+ {"a": 1, "b": 2}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd');
+ jsonb_delete
+--------------------------
+ {"a": 1, "b": 2, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'a';
+ ?column?
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select '{"a":null , "b":2, "c":3}'::jsonb - 'a';
+ ?column?
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'b';
+ ?column?
+------------------
+ {"a": 1, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'c';
+ ?column?
+------------------
+ {"a": 1, "b": 2}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'd';
+ ?column?
+--------------------------
+ {"a": 1, "b": 2, "c": 3}
+(1 row)
+
+select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select '["a","b","c"]'::jsonb - 3;
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 2;
+ ?column?
+------------
+ ["a", "b"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 1;
+ ?column?
+------------
+ ["a", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 0;
+ ?column?
+------------
+ ["b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -1;
+ ?column?
+------------
+ ["a", "b"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -2;
+ ?column?
+------------
+ ["a", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -3;
+ ?column?
+------------
+ ["b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -4;
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}');
+ jsonb_delete_path
+----------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}}
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}');
+ jsonb_delete_path
+------------------------------------------------------------------
+ {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}');
+ jsonb_delete_path
+------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}';
+ ?column?
+----------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}';
+ ?column?
+------------------------------------------------------------------
+ {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+ERROR: path element at position 2 is not an integer: "-1e"
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}';
+ ?column?
+------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null}
+(1 row)
+
+-- empty structure and error conditions for delete and replace
+select '"a"'::jsonb - 'a'; -- error
+ERROR: cannot delete from scalar
+select '{}'::jsonb - 'a';
+ ?column?
+----------
+ {}
+(1 row)
+
+select '[]'::jsonb - 'a';
+ ?column?
+----------
+ []
+(1 row)
+
+select '"a"'::jsonb - 1; -- error
+ERROR: cannot delete from scalar
+select '{}'::jsonb - 1; -- error
+ERROR: cannot delete from object using integer index
+select '[]'::jsonb - 1;
+ ?column?
+----------
+ []
+(1 row)
+
+select '"a"'::jsonb #- '{a}'; -- error
+ERROR: cannot delete path in scalar
+select '{}'::jsonb #- '{a}';
+ ?column?
+----------
+ {}
+(1 row)
+
+select '[]'::jsonb #- '{a}';
+ ?column?
+----------
+ []
+(1 row)
+
+select jsonb_set('{}','{a}','"b"', false);
+ jsonb_set
+-----------
+ {}
+(1 row)
+
+select jsonb_set('[]','{1}','"b"', false);
+ jsonb_set
+-----------
+ []
+(1 row)
+
+select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false);
+ jsonb_set
+-------------------------
+ [[2, 3, 4], 2, null, 3]
+(1 row)
+
+-- jsonb_set_lax
+\pset null NULL
+-- errors
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null);
+ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+\pset null ''
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, "new_value", 2]}
+(1 row)
+
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true);
+ jsonb_insert
+------------------------------------------------------------
+ {"a": {"b": {"c": [0, 1, "test1", "new_value", "test2"]}}}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, "new_value", 1, 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, 2, "new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, 2, "new_value"]}
+(1 row)
+
+select jsonb_insert('[]', '{1}', '"new_value"', true);
+ jsonb_insert
+---------------
+ ["new_value"]
+(1 row)
+
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true);
+ jsonb_insert
+----------------------
+ {"a": ["new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true);
+ jsonb_insert
+-----------------------------------------
+ {"a": {"b": "value", "c": "new_value"}}
+(1 row)
+
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+ERROR: cannot replace existing key
+HINT: Try using the function jsonb_set to replace key value.
+create TEMP TABLE test_jsonb_subscript (
+ id int,
+ test_json jsonb
+);
+insert into test_jsonb_subscript values
+(1, '{}'), -- empty jsonb
+(2, '{"key": "value"}'); -- jsonb with data
+-- NULL as jsonb source
+insert into test_jsonb_subscript values (3, NULL);
+insert into test_jsonb_subscript values (1, '[0]');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{"b": 1}');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{"a": {}}');
+insert into test_jsonb_subscript values (1, '{"a": []}');
+insert into test_jsonb_subscript values (1, '{"a": 1}');
+insert into test_jsonb_subscript values (1, 'null');
+-- casts
+select 'true'::jsonb::bool;
+ bool
+------
+ t
+(1 row)
+
+select '[]'::jsonb::bool;
+ERROR: cannot cast jsonb array to type boolean
+select '1.0'::jsonb::float;
+ float8
+--------
+ 1
+(1 row)
+
+select '[1.0]'::jsonb::float;
+ERROR: cannot cast jsonb array to type double precision
+select '12345'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '"hello"'::jsonb::int4;
+ERROR: cannot cast jsonb string to type integer
+select '12345'::jsonb::numeric;
+ numeric
+---------
+ 12345
+(1 row)
+
+select '{}'::jsonb::numeric;
+ERROR: cannot cast jsonb object to type numeric
+select '12345.05'::jsonb::numeric;
+ numeric
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::float4;
+ float4
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::float8;
+ float8
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::int2;
+ int2
+-------
+ 12345
+(1 row)
+
+select '12345.05'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '12345.05'::jsonb::int8;
+ int8
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric;
+ numeric
+------------------------------------------------------
+ 12345.0000000000000000000000000000000000000000000005
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4;
+ float4
+--------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8;
+ float8
+--------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2;
+ int2
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8;
+ int8
+-------
+ 12345
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/jsonb.sql b/yql/essentials/tests/postgresql/cases/jsonb.sql
new file mode 100644
index 0000000000..8ffbfc37d0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb.sql
@@ -0,0 +1,627 @@
+-- Strings.
+SELECT '""'::jsonb; -- OK.
+SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+SELECT '"abc"'::jsonb; -- OK
+SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+SELECT '"abc
+def"'::jsonb; -- ERROR, unescaped newline in string constant
+SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
+SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::jsonb; -- OK
+SELECT '0'::jsonb; -- OK
+SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+SELECT '0.1'::jsonb; -- OK
+SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8
+SELECT '1f2'::jsonb; -- ERROR
+SELECT '0.x1'::jsonb; -- ERROR
+SELECT '1.3ex100'::jsonb; -- ERROR
+-- Arrays.
+SELECT '[]'::jsonb; -- OK
+SELECT '[1,2]'::jsonb; -- OK
+SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+-- Objects.
+SELECT '{}'::jsonb; -- OK
+SELECT '{"abc"}'::jsonb; -- ERROR, no value
+SELECT '{"abc":1}'::jsonb; -- OK
+SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+-- Miscellaneous stuff.
+SELECT 'true'::jsonb; -- OK
+SELECT 'false'::jsonb; -- OK
+SELECT 'null'::jsonb; -- OK
+SELECT ' true '::jsonb; -- OK, even with extra whitespace
+SELECT 'true false'::jsonb; -- ERROR, too many values
+SELECT 'true, false'::jsonb; -- ERROR, too many values
+SELECT 'truf'::jsonb; -- ERROR, not a keyword
+SELECT 'trues'::jsonb; -- ERROR, not a keyword
+SELECT ''::jsonb; -- ERROR, no value
+SELECT ' '::jsonb; -- ERROR, no value
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::jsonb; -- OK
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::jsonb;
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb;
+-- ERROR missing value for last field
+-- make sure jsonb is passed through json generators without being escaped
+SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']);
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+SET LOCAL TIME ZONE -8;
+COMMIT;
+-- jsonb extraction functions
+CREATE TEMP TABLE test_jsonb (
+ json_type text,
+ test_json jsonb
+);
+INSERT INTO test_jsonb VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object';
+-- nulls
+SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object';
+SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object';
+SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array';
+SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array';
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> '';
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z';
+select '{"a": "c", "b": null}'::jsonb -> 'b';
+select '"foo"'::jsonb -> 1;
+select '"foo"'::jsonb -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> '';
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z';
+select '{"a": "c", "b": null}'::jsonb ->> 'b';
+select '"foo"'::jsonb ->> 1;
+select '"foo"'::jsonb ->> 'z';
+-- equality and inequality
+SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb;
+SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb;
+SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb;
+SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb;
+-- containment
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}');
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}';
+SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb;
+SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
+SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb;
+SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb;
+SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb;
+SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb;
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}');
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+-- Raw scalar may contain another raw scalar, array may contain a raw scalar
+SELECT '[5]'::jsonb @> '[5]';
+SELECT '5'::jsonb @> '5';
+SELECT '[5]'::jsonb @> '5';
+-- But a raw scalar cannot contain an array
+SELECT '5'::jsonb @> '[5]';
+-- In general, one thing should always contain itself. Test array containment:
+SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb;
+SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb;
+-- array containment string matching confusion bug
+SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}';
+-- array length
+SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+SELECT jsonb_array_length('[]');
+SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+SELECT jsonb_array_length('4');
+SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+-- exists
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a');
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b');
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c');
+SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a');
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'a';
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'b';
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'c';
+SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a';
+-- array exists - array elements should behave as keys
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]);
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[];
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]);
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[];
+-- typeof
+SELECT jsonb_typeof('{}') AS object;
+SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object;
+SELECT jsonb_typeof('[]') AS array;
+SELECT jsonb_typeof('["a", 1]') AS array;
+SELECT jsonb_typeof('null') AS "null";
+SELECT jsonb_typeof('1') AS number;
+SELECT jsonb_typeof('-1') AS number;
+SELECT jsonb_typeof('1.0') AS number;
+SELECT jsonb_typeof('1e2') AS number;
+SELECT jsonb_typeof('-1.0') AS number;
+SELECT jsonb_typeof('true') AS boolean;
+SELECT jsonb_typeof('false') AS boolean;
+SELECT jsonb_typeof('"hello"') AS string;
+SELECT jsonb_typeof('"true"') AS string;
+SELECT jsonb_typeof('"1.0"') AS string;
+SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+-- empty objects/arrays
+SELECT jsonb_build_array();
+SELECT jsonb_build_object();
+-- make sure keys are quoted
+SELECT jsonb_build_object(1,2);
+SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+-- handling of NULL values
+SELECT jsonb_object_agg(1, NULL::jsonb);
+SELECT jsonb_object_agg(NULL, '{"a":1}');
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT jsonb_object_agg(name, type) FROM foo;
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT jsonb_object_agg(name, type) FROM foo;
+-- jsonb_object
+-- empty object, one dimension
+SELECT jsonb_object('{}');
+-- empty object, two dimensions
+SELECT jsonb_object('{}', '{}');
+-- one dimension
+SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+-- same but with two dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+-- odd number error
+SELECT jsonb_object('{a,b,c}');
+-- one column error
+SELECT jsonb_object('{{a},{b}}');
+-- too many columns error
+SELECT jsonb_object('{{a,b,c},{b,c,d}}');
+-- too many dimensions error
+SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+--two argument form of jsonb_object
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+-- too many dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+-- mismatched dimensions
+select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+-- null key error
+select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+-- empty key is allowed
+select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+-- extract_path, extract_path_as_text
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+-- extract_path nulls
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false;
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true;
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false;
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true;
+SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q;
+SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+-- test type info caching in jsonb_populate_record()
+CREATE TEMP TABLE jsbpoptest (js jsonb);
+INSERT INTO jsbpoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::jsonb
+FROM generate_series(1, 3);
+-- indexing
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+CREATE INDEX jidx ON testjsonb USING gin (j);
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+-- btree
+CREATE INDEX jidx ON testjsonb USING btree (j);
+SELECT count(*) FROM testjsonb WHERE j > '{"p":1}';
+SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}';
+CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops);
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+-- nested tests
+SELECT '{"ff":{"a":12,"b":16}}'::jsonb;
+SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb;
+SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb;
+SELECT '{"ff":["a","aaa"]}'::jsonb;
+SELECT
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff',
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq',
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f,
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t,
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x';
+-- nested containment
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]';
+SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]';
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]';
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]';
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}';
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}';
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}';
+-- check some corner cases for indexed nested containment (bug #13756)
+create temp table nestjsonb (j jsonb);
+insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
+insert into nestjsonb (j) values ('[[14,2,3]]');
+insert into nestjsonb (j) values ('[1,[14,2,3]]');
+create index on nestjsonb using gin(j jsonb_path_ops);
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+select * from nestjsonb where j @> '{"c":3}';
+select * from nestjsonb where j @> '[[14]]';
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+select * from nestjsonb where j @> '{"c":3}';
+select * from nestjsonb where j @> '[[14]]';
+-- nested object field / array index lookup
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 0;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 2;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 4;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 5;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -5;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -6;
+--nested exists
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e';
+-- jsonb_strip_nulls
+select jsonb_strip_nulls(null);
+select jsonb_strip_nulls('1');
+select jsonb_strip_nulls('"a string"');
+select jsonb_strip_nulls('null');
+select jsonb_strip_nulls('[1,2,null,3,4]');
+select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+-- an empty object is not null and should not be stripped
+select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}');
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}';
+select '["a", "b"]'::jsonb || '["c"]';
+select '["a", "b"]'::jsonb || '["c", "d"]';
+select '["c"]' || '["a", "b"]'::jsonb;
+select '["a", "b"]'::jsonb || '"c"';
+select '"c"' || '["a", "b"]'::jsonb;
+select '[]'::jsonb || '["a"]'::jsonb;
+select '[]'::jsonb || '"a"'::jsonb;
+select '"b"'::jsonb || '"a"'::jsonb;
+select '{}'::jsonb || '{"a":"b"}'::jsonb;
+select '[]'::jsonb || '{"a":"b"}'::jsonb;
+select '{"a":"b"}'::jsonb || '[]'::jsonb;
+select '"a"'::jsonb || '{"a":1}';
+select '{"a":1}' || '"a"'::jsonb;
+select '[3]'::jsonb || '{}'::jsonb;
+select '3'::jsonb || '[]'::jsonb;
+select '3'::jsonb || '4'::jsonb;
+select '3'::jsonb || '{}'::jsonb;
+select '["a", "b"]'::jsonb || '{"c":1}';
+select '{"c": 1}'::jsonb || '["a", "b"]';
+select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb);
+select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a');
+select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd');
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'a';
+select '{"a":null , "b":2, "c":3}'::jsonb - 'a';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'b';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'c';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'd';
+select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb);
+select '["a","b","c"]'::jsonb - 3;
+select '["a","b","c"]'::jsonb - 2;
+select '["a","b","c"]'::jsonb - 1;
+select '["a","b","c"]'::jsonb - 0;
+select '["a","b","c"]'::jsonb - -1;
+select '["a","b","c"]'::jsonb - -2;
+select '["a","b","c"]'::jsonb - -3;
+select '["a","b","c"]'::jsonb - -4;
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}');
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}');
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}');
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}';
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}';
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}';
+-- empty structure and error conditions for delete and replace
+select '"a"'::jsonb - 'a'; -- error
+select '{}'::jsonb - 'a';
+select '[]'::jsonb - 'a';
+select '"a"'::jsonb - 1; -- error
+select '{}'::jsonb - 1; -- error
+select '[]'::jsonb - 1;
+select '"a"'::jsonb #- '{a}'; -- error
+select '{}'::jsonb #- '{a}';
+select '[]'::jsonb #- '{a}';
+select jsonb_set('{}','{a}','"b"', false);
+select jsonb_set('[]','{1}','"b"', false);
+select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false);
+-- jsonb_set_lax
+\pset null NULL
+-- errors
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null);
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+\pset null ''
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true);
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true);
+select jsonb_insert('[]', '{1}', '"new_value"', true);
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true);
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true);
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+create TEMP TABLE test_jsonb_subscript (
+ id int,
+ test_json jsonb
+);
+insert into test_jsonb_subscript values
+(1, '{}'), -- empty jsonb
+(2, '{"key": "value"}'); -- jsonb with data
+-- NULL as jsonb source
+insert into test_jsonb_subscript values (3, NULL);
+insert into test_jsonb_subscript values (1, '[0]');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{"b": 1}');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '[]');
+insert into test_jsonb_subscript values (1, '{}');
+insert into test_jsonb_subscript values (1, '{"a": {}}');
+insert into test_jsonb_subscript values (1, '{"a": []}');
+insert into test_jsonb_subscript values (1, '{"a": 1}');
+insert into test_jsonb_subscript values (1, 'null');
+-- casts
+select 'true'::jsonb::bool;
+select '[]'::jsonb::bool;
+select '1.0'::jsonb::float;
+select '[1.0]'::jsonb::float;
+select '12345'::jsonb::int4;
+select '"hello"'::jsonb::int4;
+select '12345'::jsonb::numeric;
+select '{}'::jsonb::numeric;
+select '12345.05'::jsonb::numeric;
+select '12345.05'::jsonb::float4;
+select '12345.05'::jsonb::float8;
+select '12345.05'::jsonb::int2;
+select '12345.05'::jsonb::int4;
+select '12345.05'::jsonb::int8;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8;
diff --git a/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.err b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.err
new file mode 100644
index 0000000000..15c80d879e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.err
@@ -0,0 +1,3233 @@
+<sql-statement>
+select jsonb '{"a": 12}' @? '$';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 12}' @? '1';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 12}' @? '$.a.b';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 12}' @? '$.b';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 12}' @? '$.a + 2';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 12}' @? '$.b + 2';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"a": 12}}' @? '$.a.a';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"a": 12}}' @? '$.*.a';
+</sql-statement>
+<sql-statement>
+select jsonb '{"b": {"a": 12}}' @? '$.*.a';
+</sql-statement>
+<sql-statement>
+select jsonb '{"b": {"a": 12}}' @? '$.*.b';
+</sql-statement>
+<sql-statement>
+select jsonb '{"b": {"a": 12}}' @? 'strict $.*.b';
+</sql-statement>
+<sql-statement>
+select jsonb '{}' @? '$.*';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 1}' @? '$.*';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{1}';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{2}';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{3}';
+</sql-statement>
+<sql-statement>
+select jsonb '[]' @? '$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[1]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? 'strict $[1]';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('[1]', 'strict $[1]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'strict $[1]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1]', 'strict $[1]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'strict $[1]', silent => true);
+ ^
+<sql-statement>
+select jsonb '[1]' @? 'lax $[10000000000000000]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? 'strict $[10000000000000000]';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('[1]', 'lax $[10000000000000000]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'lax $[10000000000000000]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1]', 'strict $[10000000000000000]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'strict $[10000000000000000]');
+ ^
+<sql-statement>
+select jsonb '[1]' @? '$[0]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[0.3]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[0.5]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[0.9]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? '$[1.2]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1]' @? 'strict $[1.2]';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] > @.b[*])';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] >= @.b[*])';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? '$ ? (@.a[*] >= @.b[*])';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? 'strict $ ? (@.a[*] >= @.b[*])';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": [1,2,3], "b": [3,4,null]}' @? '$ ? (@.a[*] >= @.b[*])';
+</sql-statement>
+<sql-statement>
+select jsonb '1' @? '$ ? ((@ == "1") is unknown)';
+</sql-statement>
+<sql-statement>
+select jsonb '1' @? '$ ? ((@ == 1) is unknown)';
+</sql-statement>
+<sql-statement>
+select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)';
+</sql-statement>
+<sql-statement>
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => false);
+ ^
+<sql-statement>
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => false);
+ ^
+<sql-statement>
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'lax $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'lax $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $.*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $.*');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $.a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $.a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $.*', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $.*', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'lax $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'lax $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $.a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $.a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('{}', 'lax $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', 'lax $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('{}', 'strict $.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', 'strict $.a');
+ ^
+<sql-statement>
+select jsonb_path_query('{}', 'strict $.a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', 'strict $.a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $[1]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $[1]');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $[*]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $[*]');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $[1]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $[1]');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $["a"]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $["a"]');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $[1]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $[1]', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'strict $[*]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'strict $[*]', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $[1]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $[1]', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $["a"]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $["a"]', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.a');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.b');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.*');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', 'lax $.*.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 12, "b": {"a": 13}}', 'lax $.*.a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].*');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[1].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[1].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[2].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[2].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0,1].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0,1].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10 / 0].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10 / 0].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}, "ccc", true]', '$[2.5 - 1 to $.size() - 2]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[12, {"a": 13}, {"b": 14}, "ccc", true]', '$[2.5 - 1 to $.size() - 2]');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'lax $[0]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'lax $[0]');
+ ^
+<sql-statement>
+select jsonb_path_query('1', 'lax $[*]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', 'lax $[*]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1]', 'lax $[0]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'lax $[0]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1]', 'lax $[*]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', 'lax $[*]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', 'lax $[*]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', 'lax $[*]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', 'strict $[*].a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', 'strict $[*].a');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', 'strict $[*].a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', 'strict $[*].a', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[]', '$[last]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', '$[last]');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', '$[last ? (exists(last))]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', '$[last ? (exists(last))]');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $[last]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $[last]');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $[last]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $[last]', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[1]', '$[last]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1]', '$[last]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', '$[last]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', '$[last]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', '$[last - 1]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', '$[last - 1]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "number")]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "number")]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]', silent => true);
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown,unknown)
+ select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+ ^
+<sql-statement>
+select * from jsonb_path_query('{}', '$ ? (@ == @)');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('{}', '$ ? (@ == @)');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('{}', '$ ? (@ == @)');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('{}', '$ ? (@ == @)');
+ ^
+<sql-statement>
+select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+ ^
+ -stdin-:<main>:1:15: Error: Unable to find an overload for proc jsonb_path_query with given argument types: (unknown,unknown)
+ select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2 to last}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2 to last}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{3 to last}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{3 to last}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{last}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{last}');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{2 to 3}.b ? (@ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{2 to 3}.b ? (@ > 0)');
+ ^
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**{0}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**{1}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{2 to 3}.b ? ( @ > 0)';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.y))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.y))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x ? (@ >= 2) ))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x ? (@ >= 2) ))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x + "3"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x + "3"))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? ((exists (@.x + "3")) is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? ((exists (@.x + "3")) is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? (exists (@.x))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? (exists (@.x))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? ((exists (@.x)) is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? ((exists (@.x)) is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? (exists (@[*].x))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? (exists (@[*].x))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? ((exists (@[*].x)) is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? ((exists (@[*].x)) is unknown)');
+ ^
+<sql-statement>
+--test ternary logic
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true && $y == true) ||
+ @ == false && !($x == true && $y == true) ||
+ @ == null && ($x == true && $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x && y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:2: Error: Generator functions are not allowed in: SELECT
+ jsonb_path_query(
+ ^
+<sql-statement>
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true || $y == true) ||
+ @ == false && !($x == true || $y == true) ||
+ @ == null && ($x == true || $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x || y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:2: Error: Generator functions are not allowed in: SELECT
+ jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$ ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? ($.c.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.* ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 1, "b":1}' @? '$.** ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.** ? (@.a == @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == 1 + 1)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == 1 + 1)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (1 + 1))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (1 + 1))');
+ ^
+<sql-statement>
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == @.b + 1)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == @.b + 1)');
+ ^
+<sql-statement>
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (@.b + 1))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (@.b + 1))');
+ ^
+<sql-statement>
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - 1)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -1)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -@.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 2, "b":1}}' @? '$.** ? (@.a == 1 - - @.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - +@.b)';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +2)';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +3)';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -2)';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -3)';
+</sql-statement>
+<sql-statement>
+select jsonb '1' @? '$ ? ($ > 0)';
+</sql-statement>
+<sql-statement>
+-- arithmetic errors
+select jsonb_path_query('[1,2,0,3]', '$[*] ? (2 / @ > 0)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,0,3]', '$[*] ? (2 / @ > 0)');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('0', '1 / $');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('0', '1 / $');
+ ^
+<sql-statement>
+select jsonb_path_query('0', '1 / $ + 2');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('0', '1 / $ + 2');
+ ^
+<sql-statement>
+select jsonb_path_query('0', '-(3 + 1 % $)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('0', '-(3 + 1 % $)');
+ ^
+<sql-statement>
+select jsonb_path_query('1', '$ + "2"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', '$ + "2"');
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2]', '3 * $');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2]', '3 * $');
+ ^
+<sql-statement>
+select jsonb_path_query('"a"', '-$');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"a"', '-$');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,"2",3]', '+$');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,"2",3]', '+$');
+ ^
+<sql-statement>
+select jsonb_path_query('1', '$ + "2"', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', '$ + "2"', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2]', '3 * $', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2]', '3 * $', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('"a"', '-$', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"a"', '-$', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[1,"2",3]', '+$', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,"2",3]', '+$', silent => true);
+ ^
+<sql-statement>
+select jsonb '["1",2,0,3]' @? '-$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,"2",0,3]' @? '-$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '["1",2,0,3]' @? 'strict -$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,"2",0,3]' @? 'strict -$[*]';
+</sql-statement>
+<sql-statement>
+-- unwrapping of operator arguments in lax mode
+select jsonb_path_query('{"a": [2]}', 'lax $.a * 3');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": [2]}', 'lax $.a * 3');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": [2]}', 'lax $.a + 3');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": [2]}', 'lax $.a + 3');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": [2, 3, 4]}', 'lax -$.a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": [2, 3, 4]}', 'lax -$.a');
+ ^
+<sql-statement>
+-- should fail
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3', silent => true);
+ ^
+<sql-statement>
+-- extension: boolean expressions
+select jsonb_path_query('2', '$ > 1');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('2', '$ > 1');
+ ^
+<sql-statement>
+select jsonb_path_query('2', '$ <= 1');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('2', '$ <= 1');
+ ^
+<sql-statement>
+select jsonb_path_query('2', '$ == "2"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('2', '$ == "2"');
+ ^
+<sql-statement>
+select jsonb '2' @? '$ == "2"';
+</sql-statement>
+<sql-statement>
+select jsonb '2' @@ '$ > 1';
+</sql-statement>
+<sql-statement>
+select jsonb '2' @@ '$ <= 1';
+</sql-statement>
+<sql-statement>
+select jsonb '2' @@ '$ == "2"';
+</sql-statement>
+<sql-statement>
+select jsonb '2' @@ '1';
+</sql-statement>
+<sql-statement>
+select jsonb '{}' @@ '$';
+</sql-statement>
+<sql-statement>
+select jsonb '[]' @@ '$';
+</sql-statement>
+<sql-statement>
+select jsonb '[1,2,3]' @@ '$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb '[]' @@ '$[*]';
+</sql-statement>
+<sql-statement>
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 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 jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_match with given argument types: (unknown,unknown,unknown)
+ select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
+ ^
+<sql-statement>
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 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 jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_match with given argument types: (unknown,unknown,unknown)
+ select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
+ ^
+<sql-statement>
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => false);
+ ^
+<sql-statement>
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => false);
+ ^
+<sql-statement>
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$.type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null,1,true,"a",[],{}]', '$.type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[null,1,true,"a",[],{}]', 'lax $.type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null,1,true,"a",[],{}]', 'lax $.type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$[*].type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null,1,true,"a",[],{}]', '$[*].type()');
+ ^
+<sql-statement>
+select jsonb_path_query('null', 'null.type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', 'null.type()');
+ ^
+<sql-statement>
+select jsonb_path_query('null', 'true.type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', 'true.type()');
+ ^
+<sql-statement>
+select jsonb_path_query('null', '(123).type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', '(123).type()');
+ ^
+<sql-statement>
+select jsonb_path_query('null', '"123".type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', '"123".type()');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 2}', '($.a - 5).abs() + 10');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 2}', '($.a - 5).abs() + 10');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() % 4.3');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() % 4.3');
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2, 3]', '($[*] > 2) ? (@ == true)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2, 3]', '($[*] > 2) ? (@ == true)');
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2, 3]', '($[*] > 3).type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2, 3]', '($[*] > 3).type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2, 3]', '($[*].a > 3).type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2, 3]', '($[*].a > 3).type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[1, 2, 3]', 'strict ($[*].a > 3).type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1, 2, 3]', 'strict ($[*].a > 3).type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()');
+ ^
+<sql-statement>
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'lax $[*].size()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'lax $[*].size()');
+ ^
+<sql-statement>
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].abs()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].abs()');
+ ^
+<sql-statement>
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor()');
+ ^
+<sql-statement>
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling()');
+ ^
+<sql-statement>
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs()');
+ ^
+<sql-statement>
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{},1]', '$[*].keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{},1]', '$[*].keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{},1]', '$[*].keyvalue()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{},1]', '$[*].keyvalue()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('{"a": 1, "b": [1, 2], "c": {"a": "bbb"}}', '$.keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{"a": 1, "b": [1, 2], "c": {"a": "bbb"}}', '$.keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', '$[*].keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', '$[*].keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'lax $.keyvalue()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'lax $.keyvalue()');
+ ^
+<sql-statement>
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue().a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue().a');
+ ^
+<sql-statement>
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue()';
+</sql-statement>
+<sql-statement>
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue().key';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('null', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('true', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('true', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('null', '$.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', '$.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('true', '$.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('true', '$.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('[]', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('1.23', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1.23', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"1.23"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"1.23"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"1.23aaa"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"1.23aaa"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('1e1000', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1e1000', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"nan"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"nan"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"NaN"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"NaN"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"inf"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"inf"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"-inf"', '$.double()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"-inf"', '$.double()');
+ ^
+<sql-statement>
+select jsonb_path_query('"inf"', '$.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"inf"', '$.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('"-inf"', '$.double()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"-inf"', '$.double()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.abs()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.abs()');
+ ^
+<sql-statement>
+select jsonb_path_query('true', '$.floor()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('true', '$.floor()');
+ ^
+<sql-statement>
+select jsonb_path_query('"1.2"', '$.ceiling()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"1.2"', '$.ceiling()');
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.abs()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.abs()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('true', '$.floor()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('true', '$.floor()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('"1.2"', '$.ceiling()', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"1.2"', '$.ceiling()', silent => true);
+ ^
+<sql-statement>
+select jsonb_path_query('["", "a", "abc", "abcabc"]', '$[*] ? (@ starts with "abc")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('["", "a", "abc", "abcabc"]', '$[*] ? (@ starts with "abc")');
+ ^
+<sql-statement>
+select jsonb_path_query('["", "a", "abc", "abcabc"]', 'strict $ ? (@[*] starts with "abc")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('["", "a", "abc", "abcabc"]', 'strict $ ? (@[*] starts with "abc")');
+ ^
+<sql-statement>
+select jsonb_path_query('["", "a", "abd", "abdabc"]', 'strict $ ? (@[*] starts with "abc")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('["", "a", "abd", "abdabc"]', 'strict $ ? (@[*] starts with "abc")');
+ ^
+<sql-statement>
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? (@[*] starts with "abc")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? (@[*] starts with "abc")');
+ ^
+<sql-statement>
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? ((@[*] starts with "abc") is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? ((@[*] starts with "abc") is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('[[null, 1, "abc", "abcabc"]]', 'lax $ ? (@[*] starts with "abc")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[[null, 1, "abc", "abcabc"]]', 'lax $ ? (@[*] starts with "abc")');
+ ^
+<sql-statement>
+select jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? ((@[*] starts with "abc") is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? ((@[*] starts with "abc") is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ? ((@ starts with "abc") is unknown)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ? ((@ starts with "abc") is unknown)');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "i")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "i")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "m")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "m")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "s")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "s")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "q")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "q")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "q")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "q")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "q")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "q")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "iq")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "iq")');
+ ^
+<sql-statement>
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "")');
+ ^
+<sql-statement>
+select jsonb_path_query('null', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('null', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('true', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('true', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('1', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('1', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('[]', 'strict $.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('[]', 'strict $.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('{}', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('{}', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"bogus"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"bogus"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34"', '$.datetime("aaa")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34"', '$.datetime("aaa")');
+ ^
+<sql-statement>
+select jsonb_path_query('"aaaa"', '$.datetime("HH24")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"aaaa"', '$.datetime("HH24")');
+ ^
+<sql-statement>
+select jsonb '"10-03-2017"' @? '$.datetime("dd-mm-yyyy")';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', ' $.datetime("dd-mm-yyyy HH24:MI").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', ' $.datetime("dd-mm-yyyy HH24:MI").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56"', '$.datetime("HH24:MI:SS").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56"', '$.datetime("HH24:MI:SS").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56 +05:20"', '$.datetime("HH24:MI:SS TZH:TZM").type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56 +05:20"', '$.datetime("HH24:MI:SS TZH:TZM").type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017T12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017T12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017t12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017t12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ ^
+<sql-statement>
+set time zone '+00';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+set time zone '+10';
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ ^
+<sql-statement>
+set time zone default;
+</sql-statement>
+<sql-statement>
+select jsonb_path_query('"2017-03-10"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10T12:34:56+3:10"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10T12:34:56+3:10"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"2017-03-10t12:34:56+3:10"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"2017-03-10t12:34:56+3:10"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56+3"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56+3"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56+3"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56+3"', '$.datetime()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime().type()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56+3:10"', '$.datetime().type()');
+ ^
+<sql-statement>
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"12:34:56+3:10"', '$.datetime()');
+ ^
+<sql-statement>
+set time zone '+00';
+</sql-statement>
+<sql-statement>
+-- date comparison
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+-- time comparison
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+-- timetz comparison
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+-- timestamp comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+-- timestamptz comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query_tz(
+ ^
+<sql-statement>
+-- overflow during comparison
+select jsonb_path_query('"1000000-01-01"', '$.datetime() > "2020-01-01 12:00:00".datetime()'::jsonpath);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ select jsonb_path_query('"1000000-01-01"', '$.datetime() > "2020-01-01 12:00:00".datetime()'::jsonpath);
+ ^
+<sql-statement>
+set time zone default;
+</sql-statement>
+<sql-statement>
+-- jsonpath operators
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*]');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*]');
+ ^
+<sql-statement>
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*] ? (@.a > 10)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*] ? (@.a > 10)');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+</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 jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_array with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+</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 jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_array with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 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 jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_array with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 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 jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_array with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+</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 jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_first with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a', silent => true);
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+</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 jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_first with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 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 jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_first with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 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 jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_query_first with given argument types: (unknown,unknown)
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
+</sql-statement>
+<sql-statement>
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+</sql-statement>
+<sql-statement>
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 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 jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_exists with given argument types: (unknown,unknown)
+ SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+ ^
+<sql-statement>
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 3, "max": 4}');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 3, "max": 4}');
+ ^
+<sql-statement>
+SELECT jsonb_path_match('true', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('true', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('false', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('false', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('null', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('null', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('1', '$', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('1', '$', silent => true);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('1', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('1', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('"a"', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('"a"', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('{}', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('{}', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('[true]', '$', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('[true]', '$', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('{}', 'lax $.a', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('{}', 'lax $.a', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('{}', 'strict $.a', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('{}', 'strict $.a', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('{}', 'strict $.a', silent => true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('{}', 'strict $.a', silent => true);
+ ^
+<sql-statement>
+SELECT jsonb_path_match('[true, true]', '$[*]', silent => false);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT jsonb_path_match('[true, true]', '$[*]', silent => false);
+ ^
+<sql-statement>
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
+</sql-statement>
+<sql-statement>
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
+</sql-statement>
+<sql-statement>
+SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 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 jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc jsonb_path_match with given argument types: (unknown,unknown)
+ SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+ ^
+<sql-statement>
+-- test string comparison (Unicode codepoint collation)
+WITH str(j, num) AS
+(
+ SELECT jsonb_build_object('s', s), num
+ FROM unnest('{"", "a", "ab", "abc", "abcd", "b", "A", "AB", "ABC", "ABc", "ABcD", "B"}'::text[]) WITH ORDINALITY AS a(s, num)
+)
+SELECT
+ s1.j, s2.j,
+ jsonb_path_query_first(s1.j, '$.s < $s', vars => s2.j) lt,
+ jsonb_path_query_first(s1.j, '$.s <= $s', vars => s2.j) le,
+ jsonb_path_query_first(s1.j, '$.s == $s', vars => s2.j) eq,
+ jsonb_path_query_first(s1.j, '$.s >= $s', vars => s2.j) ge,
+ jsonb_path_query_first(s1.j, '$.s > $s', vars => s2.j) gt
+FROM str s1, str s2
+ORDER BY s1.num, s2.num;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:6: Error: RangeFunction: unsupported ordinality
+ WITH str(j, num) AS
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.out b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.out
new file mode 100644
index 0000000000..030cadc456
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.out
@@ -0,0 +1,533 @@
+select jsonb '{"a": 12}' @? '$';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '1';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.a.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.a + 2';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.b + 2';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{"a": {"a": 12}}' @? '$.a.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"a": 12}}' @? '$.*.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? '$.*.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? '$.*.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? 'strict $.*.b';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{}' @? '$.*';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 1}' @? '$.*';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{1}';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{2}';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{3}';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[]' @? '$[*]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? '$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[1]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? 'strict $[1]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1]' @? 'lax $[10000000000000000]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1]' @? 'strict $[10000000000000000]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1]' @? '$[0]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.3]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.5]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.9]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[1.2]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? 'strict $[1.2]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] > @.b[*])';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? 'strict $ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,null]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '1' @? '$ ? ((@ == "1") is unknown)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '1' @? '$ ? ((@ == 1) is unknown)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{0}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{2 to 3}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$ ? (@.a == @.b)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? ($.c.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.* ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 1, "b":1}' @? '$.** ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.** ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -@.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 2, "b":1}}' @? '$.** ? (@.a == 1 - - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - +@.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +2)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +3)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -2)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -3)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '1' @? '$ ? ($ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '["1",2,0,3]' @? '-$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,"2",0,3]' @? '-$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '["1",2,0,3]' @? 'strict -$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1,"2",0,3]' @? 'strict -$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '2' @? '$ == "2"';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '2' @@ '$ > 1';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '2' @@ '$ <= 1';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '2' @@ '$ == "2"';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '2' @@ '1';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{}' @@ '$';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[]' @@ '$';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1,2,3]' @@ '$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[]' @@ '$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue()';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue().key';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '"10-03-2017"' @? '$.datetime("dd-mm-yyyy")';
+ ?column?
+----------
+ t
+(1 row)
+
+set time zone '+00';
+set time zone '+10';
+set time zone default;
+set time zone '+00';
+set time zone default;
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
+ ?column?
+----------
+ f
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.sql b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.sql
new file mode 100644
index 0000000000..c21b6d766e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonb_jsonpath.sql
@@ -0,0 +1,93 @@
+select jsonb '{"a": 12}' @? '$';
+select jsonb '{"a": 12}' @? '1';
+select jsonb '{"a": 12}' @? '$.a.b';
+select jsonb '{"a": 12}' @? '$.b';
+select jsonb '{"a": 12}' @? '$.a + 2';
+select jsonb '{"a": 12}' @? '$.b + 2';
+select jsonb '{"a": {"a": 12}}' @? '$.a.a';
+select jsonb '{"a": {"a": 12}}' @? '$.*.a';
+select jsonb '{"b": {"a": 12}}' @? '$.*.a';
+select jsonb '{"b": {"a": 12}}' @? '$.*.b';
+select jsonb '{"b": {"a": 12}}' @? 'strict $.*.b';
+select jsonb '{}' @? '$.*';
+select jsonb '{"a": 1}' @? '$.*';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{1}';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{2}';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{3}';
+select jsonb '[]' @? '$[*]';
+select jsonb '[1]' @? '$[*]';
+select jsonb '[1]' @? '$[1]';
+select jsonb '[1]' @? 'strict $[1]';
+select jsonb '[1]' @? 'lax $[10000000000000000]';
+select jsonb '[1]' @? 'strict $[10000000000000000]';
+select jsonb '[1]' @? '$[0]';
+select jsonb '[1]' @? '$[0.3]';
+select jsonb '[1]' @? '$[0.5]';
+select jsonb '[1]' @? '$[0.9]';
+select jsonb '[1]' @? '$[1.2]';
+select jsonb '[1]' @? 'strict $[1.2]';
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] > @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? 'strict $ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,null]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '1' @? '$ ? ((@ == "1") is unknown)';
+select jsonb '1' @? '$ ? ((@ == 1) is unknown)';
+select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)';
+select jsonb '{"a": {"b": 1}}' @? '$.**.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{0}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{2 to 3}.b ? ( @ > 0)';
+select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$ ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? ($.c.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.* ? (@.a == @.b)';
+select jsonb '{"a": 1, "b":1}' @? '$.** ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.** ? (@.a == @.b)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - 1)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -1)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -@.b)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - @.b)';
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - @.b)';
+select jsonb '{"c": {"a": 2, "b":1}}' @? '$.** ? (@.a == 1 - - @.b)';
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - +@.b)';
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +2)';
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +3)';
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -2)';
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -3)';
+select jsonb '1' @? '$ ? ($ > 0)';
+select jsonb '["1",2,0,3]' @? '-$[*]';
+select jsonb '[1,"2",0,3]' @? '-$[*]';
+select jsonb '["1",2,0,3]' @? 'strict -$[*]';
+select jsonb '[1,"2",0,3]' @? 'strict -$[*]';
+select jsonb '2' @? '$ == "2"';
+select jsonb '2' @@ '$ > 1';
+select jsonb '2' @@ '$ <= 1';
+select jsonb '2' @@ '$ == "2"';
+select jsonb '2' @@ '1';
+select jsonb '{}' @@ '$';
+select jsonb '[]' @@ '$';
+select jsonb '[1,2,3]' @@ '$[*]';
+select jsonb '[]' @@ '$[*]';
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue()';
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue().key';
+select jsonb '"10-03-2017"' @? '$.datetime("dd-mm-yyyy")';
+set time zone '+00';
+set time zone '+10';
+set time zone default;
+set time zone '+00';
+set time zone default;
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath.err b/yql/essentials/tests/postgresql/cases/jsonpath.err
new file mode 100644
index 0000000000..d0b84d814d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath.err
@@ -0,0 +1,743 @@
+<sql-statement>
+--jsonpath io
+select ''::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --jsonpath io
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath: ""
+
+ --jsonpath io
+ ^
+<sql-statement>
+select '$'::jsonpath;
+</sql-statement>
+<sql-statement>
+select 'strict $'::jsonpath;
+</sql-statement>
+<sql-statement>
+select 'lax $'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.v'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.*'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.*[*]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a[*]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a[*][*]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[*]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[0]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[*][0]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[*].a'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[*][0].a.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{2}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{2 to 2}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{2 to 5}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{0 to 5}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{5 to last}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{last}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a.**{last to 5}.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$+1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$-1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$--+1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a/+-1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1 * 2 + 4 % -3 != false'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '"\b\f\r\n\t\v\"\''\\"'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '"\x50\u0067\u{53}\u{051}\u{00004C}"'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.foo\x50\u0067\u{53}\u{051}\u{00004C}\t\"bar'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '"\z"'::jsonpath; -- unrecognized escape is just the literal char
+</sql-statement>
+<sql-statement>
+select '$.g ? ($.a == 1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@ == 1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1 || @.a == 4)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1 && @.a == 4)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1 || @.a == 4 && @.b == 7)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1 || !(@.a == 4) && @.b == 7)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.a == 1 || !(@.x >= 123 || @.a == 4) && @.b == 7)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.x >= @[*]?(@.a > "abc"))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (exists (@.x))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (exists (@.x ? (@ == 14)))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? ((@.x >= 123 || @.a == 4) && exists (@.x ? (@ == 14)))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (+@.x >= +-(+@.a + 2))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$a'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$a.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$a[*]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.g ? (@.zip == $zip)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a[1,2, 3 to 16]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a[$a + 1, ($b[*]) to -($[0] * 2)]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.a[$.a.size() - 3]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select 'last'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select 'last'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: LAST is allowed only in array subscripts
+
+ select 'last'::jsonpath;
+ ^
+<sql-statement>
+select '"last"'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.last'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (last > 0)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (last > 0)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: LAST is allowed only in array subscripts
+
+ select '$ ? (last > 0)'::jsonpath;
+ ^
+<sql-statement>
+select '$[last]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$[$[0] ? (last > 0)]'::jsonpath;
+</sql-statement>
+<sql-statement>
+select 'null.type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '(1).type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.2.type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '"aaa".type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select 'true.type()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.double().floor().ceiling().abs()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.keyvalue().key'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.datetime()'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$.datetime("datetime template")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ starts with "abc")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ starts with $var)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid regular expression: parentheses () not balanced
+
+ select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@ like_regex "pattern")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "i")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "is")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "isim")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: XQuery "x" flag (expanded regular expressions) is not implemented
+
+ select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "q")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "iq")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "smixq")'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: unrecognized flag character "a" in LIKE_REGEX predicate
+
+ select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ ^
+<sql-statement>
+select '$ < 1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '($ < 1) || $.a.b <= $x'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '@ + 1'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '@ + 1'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: @ is not allowed in root expressions
+
+ select '@ + 1'::jsonpath;
+ ^
+<sql-statement>
+select '($).a.b'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '($.a.b).c.d'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '($.a.b + -$.x.y).c.d'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '(-+$.a.b).c.d'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1 + ($.a.b + 2).c.d'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1 + ($.a.b > 2).c.d'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '($)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '(($))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '((($ + 1)).a + ((2)).b ? ((((@ > 1)) || (exists(@.c)))))'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < .1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < .1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < .1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < -.1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < -.1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < -.1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < +.1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < +.1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < +.1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < 0.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -0.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +0.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 10.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -10.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +10.1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < .1e1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < .1e1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < .1e1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < -.1e1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < -.1e1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < -.1e1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < +.1e1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < +.1e1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < +.1e1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < 0.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -0.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +0.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 10.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -10.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +10.1e1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < .1e-1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < .1e-1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < .1e-1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < -.1e-1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < -.1e-1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < -.1e-1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < +.1e-1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < +.1e-1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < +.1e-1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < 0.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -0.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +0.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 10.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -10.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +10.1e-1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < .1e+1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < .1e+1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < .1e+1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < -.1e+1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < -.1e+1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < -.1e+1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < +.1e+1)'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$ ? (@.a < +.1e+1)'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '$ ? (@.a < +.1e+1)'::jsonpath;
+ ^
+<sql-statement>
+select '$ ? (@.a < 0.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -0.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +0.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < 10.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < -10.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '$ ? (@.a < +10.1e+1)'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '00'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '00'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
+
+ select '00'::jsonpath;
+ ^
+<sql-statement>
+select '0.0'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.000'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.000e1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.000e2'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.000e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.0010'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.0010e-1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.0010e+1'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '0.0010e+2'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1e'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '1e'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid floating point number at or near "1e" of jsonpath input
+
+ select '1e'::jsonpath;
+ ^
+<sql-statement>
+select '1.e'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.2e'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '1.2e'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid floating point number at or near "1.2e" of jsonpath input
+
+ select '1.2e'::jsonpath;
+ ^
+<sql-statement>
+select '1.2.e'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '(1.2).e'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.e3.e'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.e3.e4'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.2e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1.2.e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '(1.2).e3'::jsonpath;
+</sql-statement>
+<sql-statement>
+select '1..e'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '1..e'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '1..e'::jsonpath;
+ ^
+<sql-statement>
+select '1..e3'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '1..e3'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected '.' at or near "." of jsonpath input
+
+ select '1..e3'::jsonpath;
+ ^
+<sql-statement>
+select '(1.).e'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '(1.).e'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
+
+ select '(1.).e'::jsonpath;
+ ^
+<sql-statement>
+select '(1.).e3'::jsonpath;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '(1.).e3'::jsonpath;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: syntax error, unexpected ')' at or near ")" of jsonpath input
+
+ select '(1.).e3'::jsonpath;
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath.out b/yql/essentials/tests/postgresql/cases/jsonpath.out
new file mode 100644
index 0000000000..bdbff16a19
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath.out
@@ -0,0 +1,896 @@
+--jsonpath io
+select ''::jsonpath;
+ERROR: invalid input syntax for type jsonpath: ""
+LINE 1: select ''::jsonpath;
+ ^
+select '$'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select 'strict $'::jsonpath;
+ jsonpath
+----------
+ strict $
+(1 row)
+
+select 'lax $'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '$.a'::jsonpath;
+ jsonpath
+----------
+ $."a"
+(1 row)
+
+select '$.a.v'::jsonpath;
+ jsonpath
+-----------
+ $."a"."v"
+(1 row)
+
+select '$.a.*'::jsonpath;
+ jsonpath
+----------
+ $."a".*
+(1 row)
+
+select '$.*[*]'::jsonpath;
+ jsonpath
+----------
+ $.*[*]
+(1 row)
+
+select '$.a[*]'::jsonpath;
+ jsonpath
+----------
+ $."a"[*]
+(1 row)
+
+select '$.a[*][*]'::jsonpath;
+ jsonpath
+-------------
+ $."a"[*][*]
+(1 row)
+
+select '$[*]'::jsonpath;
+ jsonpath
+----------
+ $[*]
+(1 row)
+
+select '$[0]'::jsonpath;
+ jsonpath
+----------
+ $[0]
+(1 row)
+
+select '$[*][0]'::jsonpath;
+ jsonpath
+----------
+ $[*][0]
+(1 row)
+
+select '$[*].a'::jsonpath;
+ jsonpath
+----------
+ $[*]."a"
+(1 row)
+
+select '$[*][0].a.b'::jsonpath;
+ jsonpath
+-----------------
+ $[*][0]."a"."b"
+(1 row)
+
+select '$.a.**.b'::jsonpath;
+ jsonpath
+--------------
+ $."a".**."b"
+(1 row)
+
+select '$.a.**{2}.b'::jsonpath;
+ jsonpath
+-----------------
+ $."a".**{2}."b"
+(1 row)
+
+select '$.a.**{2 to 2}.b'::jsonpath;
+ jsonpath
+-----------------
+ $."a".**{2}."b"
+(1 row)
+
+select '$.a.**{2 to 5}.b'::jsonpath;
+ jsonpath
+----------------------
+ $."a".**{2 to 5}."b"
+(1 row)
+
+select '$.a.**{0 to 5}.b'::jsonpath;
+ jsonpath
+----------------------
+ $."a".**{0 to 5}."b"
+(1 row)
+
+select '$.a.**{5 to last}.b'::jsonpath;
+ jsonpath
+-------------------------
+ $."a".**{5 to last}."b"
+(1 row)
+
+select '$.a.**{last}.b'::jsonpath;
+ jsonpath
+--------------------
+ $."a".**{last}."b"
+(1 row)
+
+select '$.a.**{last to 5}.b'::jsonpath;
+ jsonpath
+-------------------------
+ $."a".**{last to 5}."b"
+(1 row)
+
+select '$+1'::jsonpath;
+ jsonpath
+----------
+ ($ + 1)
+(1 row)
+
+select '$-1'::jsonpath;
+ jsonpath
+----------
+ ($ - 1)
+(1 row)
+
+select '$--+1'::jsonpath;
+ jsonpath
+----------
+ ($ - -1)
+(1 row)
+
+select '$.a/+-1'::jsonpath;
+ jsonpath
+--------------
+ ($."a" / -1)
+(1 row)
+
+select '1 * 2 + 4 % -3 != false'::jsonpath;
+ jsonpath
+---------------------------
+ (1 * 2 + 4 % -3 != false)
+(1 row)
+
+select '"\b\f\r\n\t\v\"\''\\"'::jsonpath;
+ jsonpath
+-------------------------
+ "\b\f\r\n\t\u000b\"'\\"
+(1 row)
+
+select '"\x50\u0067\u{53}\u{051}\u{00004C}"'::jsonpath;
+ jsonpath
+----------
+ "PgSQL"
+(1 row)
+
+select '$.foo\x50\u0067\u{53}\u{051}\u{00004C}\t\"bar'::jsonpath;
+ jsonpath
+---------------------
+ $."fooPgSQL\t\"bar"
+(1 row)
+
+select '"\z"'::jsonpath; -- unrecognized escape is just the literal char
+ jsonpath
+----------
+ "z"
+(1 row)
+
+select '$.g ? ($.a == 1)'::jsonpath;
+ jsonpath
+--------------------
+ $."g"?($."a" == 1)
+(1 row)
+
+select '$.g ? (@ == 1)'::jsonpath;
+ jsonpath
+----------------
+ $."g"?(@ == 1)
+(1 row)
+
+select '$.g ? (@.a == 1)'::jsonpath;
+ jsonpath
+--------------------
+ $."g"?(@."a" == 1)
+(1 row)
+
+select '$.g ? (@.a == 1 || @.a == 4)'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(@."a" == 1 || @."a" == 4)
+(1 row)
+
+select '$.g ? (@.a == 1 && @.a == 4)'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(@."a" == 1 && @."a" == 4)
+(1 row)
+
+select '$.g ? (@.a == 1 || @.a == 4 && @.b == 7)'::jsonpath;
+ jsonpath
+------------------------------------------------
+ $."g"?(@."a" == 1 || @."a" == 4 && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.a == 1 || !(@.a == 4) && @.b == 7)'::jsonpath;
+ jsonpath
+---------------------------------------------------
+ $."g"?(@."a" == 1 || !(@."a" == 4) && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.a == 1 || !(@.x >= 123 || @.a == 4) && @.b == 7)'::jsonpath;
+ jsonpath
+-------------------------------------------------------------------
+ $."g"?(@."a" == 1 || !(@."x" >= 123 || @."a" == 4) && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.x >= @[*]?(@.a > "abc"))'::jsonpath;
+ jsonpath
+---------------------------------------
+ $."g"?(@."x" >= @[*]?(@."a" > "abc"))
+(1 row)
+
+select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath;
+ jsonpath
+-------------------------------------------------
+ $."g"?((@."x" >= 123 || @."a" == 4) is unknown)
+(1 row)
+
+select '$.g ? (exists (@.x))'::jsonpath;
+ jsonpath
+------------------------
+ $."g"?(exists (@."x"))
+(1 row)
+
+select '$.g ? (exists (@.x ? (@ == 14)))'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(exists (@."x"?(@ == 14)))
+(1 row)
+
+select '$.g ? ((@.x >= 123 || @.a == 4) && exists (@.x ? (@ == 14)))'::jsonpath;
+ jsonpath
+------------------------------------------------------------------
+ $."g"?((@."x" >= 123 || @."a" == 4) && exists (@."x"?(@ == 14)))
+(1 row)
+
+select '$.g ? (+@.x >= +-(+@.a + 2))'::jsonpath;
+ jsonpath
+------------------------------------
+ $."g"?(+@."x" >= +(-(+@."a" + 2)))
+(1 row)
+
+select '$a'::jsonpath;
+ jsonpath
+----------
+ $"a"
+(1 row)
+
+select '$a.b'::jsonpath;
+ jsonpath
+----------
+ $"a"."b"
+(1 row)
+
+select '$a[*]'::jsonpath;
+ jsonpath
+----------
+ $"a"[*]
+(1 row)
+
+select '$.g ? (@.zip == $zip)'::jsonpath;
+ jsonpath
+---------------------------
+ $."g"?(@."zip" == $"zip")
+(1 row)
+
+select '$.a[1,2, 3 to 16]'::jsonpath;
+ jsonpath
+--------------------
+ $."a"[1,2,3 to 16]
+(1 row)
+
+select '$.a[$a + 1, ($b[*]) to -($[0] * 2)]'::jsonpath;
+ jsonpath
+----------------------------------------
+ $."a"[$"a" + 1,$"b"[*] to -($[0] * 2)]
+(1 row)
+
+select '$.a[$.a.size() - 3]'::jsonpath;
+ jsonpath
+-------------------------
+ $."a"[$."a".size() - 3]
+(1 row)
+
+select 'last'::jsonpath;
+ERROR: LAST is allowed only in array subscripts
+LINE 1: select 'last'::jsonpath;
+ ^
+select '"last"'::jsonpath;
+ jsonpath
+----------
+ "last"
+(1 row)
+
+select '$.last'::jsonpath;
+ jsonpath
+----------
+ $."last"
+(1 row)
+
+select '$ ? (last > 0)'::jsonpath;
+ERROR: LAST is allowed only in array subscripts
+LINE 1: select '$ ? (last > 0)'::jsonpath;
+ ^
+select '$[last]'::jsonpath;
+ jsonpath
+----------
+ $[last]
+(1 row)
+
+select '$[$[0] ? (last > 0)]'::jsonpath;
+ jsonpath
+--------------------
+ $[$[0]?(last > 0)]
+(1 row)
+
+select 'null.type()'::jsonpath;
+ jsonpath
+-------------
+ null.type()
+(1 row)
+
+select '1.type()'::jsonpath;
+ jsonpath
+----------
+ 1.type()
+(1 row)
+
+select '(1).type()'::jsonpath;
+ jsonpath
+----------
+ 1.type()
+(1 row)
+
+select '1.2.type()'::jsonpath;
+ jsonpath
+------------
+ 1.2.type()
+(1 row)
+
+select '"aaa".type()'::jsonpath;
+ jsonpath
+--------------
+ "aaa".type()
+(1 row)
+
+select 'true.type()'::jsonpath;
+ jsonpath
+-------------
+ true.type()
+(1 row)
+
+select '$.double().floor().ceiling().abs()'::jsonpath;
+ jsonpath
+------------------------------------
+ $.double().floor().ceiling().abs()
+(1 row)
+
+select '$.keyvalue().key'::jsonpath;
+ jsonpath
+--------------------
+ $.keyvalue()."key"
+(1 row)
+
+select '$.datetime()'::jsonpath;
+ jsonpath
+--------------
+ $.datetime()
+(1 row)
+
+select '$.datetime("datetime template")'::jsonpath;
+ jsonpath
+---------------------------------
+ $.datetime("datetime template")
+(1 row)
+
+select '$ ? (@ starts with "abc")'::jsonpath;
+ jsonpath
+-------------------------
+ $?(@ starts with "abc")
+(1 row)
+
+select '$ ? (@ starts with $var)'::jsonpath;
+ jsonpath
+--------------------------
+ $?(@ starts with $"var")
+(1 row)
+
+select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ERROR: invalid regular expression: parentheses () not balanced
+LINE 1: select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ ^
+select '$ ? (@ like_regex "pattern")'::jsonpath;
+ jsonpath
+----------------------------
+ $?(@ like_regex "pattern")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "")'::jsonpath;
+ jsonpath
+----------------------------
+ $?(@ like_regex "pattern")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "i")'::jsonpath;
+ jsonpath
+-------------------------------------
+ $?(@ like_regex "pattern" flag "i")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "is")'::jsonpath;
+ jsonpath
+--------------------------------------
+ $?(@ like_regex "pattern" flag "is")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "isim")'::jsonpath;
+ jsonpath
+---------------------------------------
+ $?(@ like_regex "pattern" flag "ism")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ERROR: XQuery "x" flag (expanded regular expressions) is not implemented
+LINE 1: select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ ^
+select '$ ? (@ like_regex "pattern" flag "q")'::jsonpath;
+ jsonpath
+-------------------------------------
+ $?(@ like_regex "pattern" flag "q")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "iq")'::jsonpath;
+ jsonpath
+--------------------------------------
+ $?(@ like_regex "pattern" flag "iq")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "smixq")'::jsonpath;
+ jsonpath
+-----------------------------------------
+ $?(@ like_regex "pattern" flag "ismxq")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ ^
+DETAIL: unrecognized flag character "a" in LIKE_REGEX predicate
+select '$ < 1'::jsonpath;
+ jsonpath
+----------
+ ($ < 1)
+(1 row)
+
+select '($ < 1) || $.a.b <= $x'::jsonpath;
+ jsonpath
+------------------------------
+ ($ < 1 || $."a"."b" <= $"x")
+(1 row)
+
+select '@ + 1'::jsonpath;
+ERROR: @ is not allowed in root expressions
+LINE 1: select '@ + 1'::jsonpath;
+ ^
+select '($).a.b'::jsonpath;
+ jsonpath
+-----------
+ $."a"."b"
+(1 row)
+
+select '($.a.b).c.d'::jsonpath;
+ jsonpath
+-------------------
+ $."a"."b"."c"."d"
+(1 row)
+
+select '($.a.b + -$.x.y).c.d'::jsonpath;
+ jsonpath
+----------------------------------
+ ($."a"."b" + -$."x"."y")."c"."d"
+(1 row)
+
+select '(-+$.a.b).c.d'::jsonpath;
+ jsonpath
+-------------------------
+ (-(+$."a"."b"))."c"."d"
+(1 row)
+
+select '1 + ($.a.b + 2).c.d'::jsonpath;
+ jsonpath
+-------------------------------
+ (1 + ($."a"."b" + 2)."c"."d")
+(1 row)
+
+select '1 + ($.a.b > 2).c.d'::jsonpath;
+ jsonpath
+-------------------------------
+ (1 + ($."a"."b" > 2)."c"."d")
+(1 row)
+
+select '($)'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '(($))'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '((($ + 1)).a + ((2)).b ? ((((@ > 1)) || (exists(@.c)))))'::jsonpath;
+ jsonpath
+-------------------------------------------------
+ (($ + 1)."a" + 2."b"?(@ > 1 || exists (@."c")))
+(1 row)
+
+select '$ ? (@.a < 1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < 0.1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < -0.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -0.1)
+(1 row)
+
+select '$ ? (@.a < +0.1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < 10.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 10.1)
+(1 row)
+
+select '$ ? (@.a < -10.1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -10.1)
+(1 row)
+
+select '$ ? (@.a < +10.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 10.1)
+(1 row)
+
+select '$ ? (@.a < 1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < -1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < -10)
+(1 row)
+
+select '$ ? (@.a < +1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < 0.1e1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -0.1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +0.1e1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < 10.1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < -10.1e1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -101)
+(1 row)
+
+select '$ ? (@.a < +10.1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < 1e-1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < -1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -0.1)
+(1 row)
+
+select '$ ? (@.a < +1e-1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < 0.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 0.01)
+(1 row)
+
+select '$ ? (@.a < -0.1e-1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -0.01)
+(1 row)
+
+select '$ ? (@.a < +0.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 0.01)
+(1 row)
+
+select '$ ? (@.a < 10.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 1.01)
+(1 row)
+
+select '$ ? (@.a < -10.1e-1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -1.01)
+(1 row)
+
+select '$ ? (@.a < +10.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 1.01)
+(1 row)
+
+select '$ ? (@.a < 1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < -1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < -10)
+(1 row)
+
+select '$ ? (@.a < +1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < 0.1e+1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -0.1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +0.1e+1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < 10.1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < -10.1e+1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -101)
+(1 row)
+
+select '$ ? (@.a < +10.1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '0'::jsonpath;
+ jsonpath
+----------
+ 0
+(1 row)
+
+select '0.0'::jsonpath;
+ jsonpath
+----------
+ 0.0
+(1 row)
+
+select '0.000'::jsonpath;
+ jsonpath
+----------
+ 0.000
+(1 row)
+
+select '0.000e1'::jsonpath;
+ jsonpath
+----------
+ 0.00
+(1 row)
+
+select '0.000e2'::jsonpath;
+ jsonpath
+----------
+ 0.0
+(1 row)
+
+select '0.000e3'::jsonpath;
+ jsonpath
+----------
+ 0
+(1 row)
+
+select '0.0010'::jsonpath;
+ jsonpath
+----------
+ 0.0010
+(1 row)
+
+select '0.0010e-1'::jsonpath;
+ jsonpath
+----------
+ 0.00010
+(1 row)
+
+select '0.0010e+1'::jsonpath;
+ jsonpath
+----------
+ 0.010
+(1 row)
+
+select '0.0010e+2'::jsonpath;
+ jsonpath
+----------
+ 0.10
+(1 row)
+
+select '1e'::jsonpath;
+ERROR: invalid floating point number at or near "1e" of jsonpath input
+LINE 1: select '1e'::jsonpath;
+ ^
+select '1.e'::jsonpath;
+ jsonpath
+----------
+ 1."e"
+(1 row)
+
+select '1.2e'::jsonpath;
+ERROR: invalid floating point number at or near "1.2e" of jsonpath input
+LINE 1: select '1.2e'::jsonpath;
+ ^
+select '1.2.e'::jsonpath;
+ jsonpath
+----------
+ 1.2."e"
+(1 row)
+
+select '(1.2).e'::jsonpath;
+ jsonpath
+----------
+ 1.2."e"
+(1 row)
+
+select '1e3'::jsonpath;
+ jsonpath
+----------
+ 1000
+(1 row)
+
+select '1.e3'::jsonpath;
+ jsonpath
+----------
+ 1."e3"
+(1 row)
+
+select '1.e3.e'::jsonpath;
+ jsonpath
+------------
+ 1."e3"."e"
+(1 row)
+
+select '1.e3.e4'::jsonpath;
+ jsonpath
+-------------
+ 1."e3"."e4"
+(1 row)
+
+select '1.2e3'::jsonpath;
+ jsonpath
+----------
+ 1200
+(1 row)
+
+select '1.2.e3'::jsonpath;
+ jsonpath
+----------
+ 1.2."e3"
+(1 row)
+
+select '(1.2).e3'::jsonpath;
+ jsonpath
+----------
+ 1.2."e3"
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath.sql b/yql/essentials/tests/postgresql/cases/jsonpath.sql
new file mode 100644
index 0000000000..9c3a92a2fb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath.sql
@@ -0,0 +1,153 @@
+--jsonpath io
+select ''::jsonpath;
+select '$'::jsonpath;
+select 'strict $'::jsonpath;
+select 'lax $'::jsonpath;
+select '$.a'::jsonpath;
+select '$.a.v'::jsonpath;
+select '$.a.*'::jsonpath;
+select '$.*[*]'::jsonpath;
+select '$.a[*]'::jsonpath;
+select '$.a[*][*]'::jsonpath;
+select '$[*]'::jsonpath;
+select '$[0]'::jsonpath;
+select '$[*][0]'::jsonpath;
+select '$[*].a'::jsonpath;
+select '$[*][0].a.b'::jsonpath;
+select '$.a.**.b'::jsonpath;
+select '$.a.**{2}.b'::jsonpath;
+select '$.a.**{2 to 2}.b'::jsonpath;
+select '$.a.**{2 to 5}.b'::jsonpath;
+select '$.a.**{0 to 5}.b'::jsonpath;
+select '$.a.**{5 to last}.b'::jsonpath;
+select '$.a.**{last}.b'::jsonpath;
+select '$.a.**{last to 5}.b'::jsonpath;
+select '$+1'::jsonpath;
+select '$-1'::jsonpath;
+select '$--+1'::jsonpath;
+select '$.a/+-1'::jsonpath;
+select '1 * 2 + 4 % -3 != false'::jsonpath;
+select '"\b\f\r\n\t\v\"\''\\"'::jsonpath;
+select '"\x50\u0067\u{53}\u{051}\u{00004C}"'::jsonpath;
+select '$.foo\x50\u0067\u{53}\u{051}\u{00004C}\t\"bar'::jsonpath;
+select '"\z"'::jsonpath; -- unrecognized escape is just the literal char
+select '$.g ? ($.a == 1)'::jsonpath;
+select '$.g ? (@ == 1)'::jsonpath;
+select '$.g ? (@.a == 1)'::jsonpath;
+select '$.g ? (@.a == 1 || @.a == 4)'::jsonpath;
+select '$.g ? (@.a == 1 && @.a == 4)'::jsonpath;
+select '$.g ? (@.a == 1 || @.a == 4 && @.b == 7)'::jsonpath;
+select '$.g ? (@.a == 1 || !(@.a == 4) && @.b == 7)'::jsonpath;
+select '$.g ? (@.a == 1 || !(@.x >= 123 || @.a == 4) && @.b == 7)'::jsonpath;
+select '$.g ? (@.x >= @[*]?(@.a > "abc"))'::jsonpath;
+select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath;
+select '$.g ? (exists (@.x))'::jsonpath;
+select '$.g ? (exists (@.x ? (@ == 14)))'::jsonpath;
+select '$.g ? ((@.x >= 123 || @.a == 4) && exists (@.x ? (@ == 14)))'::jsonpath;
+select '$.g ? (+@.x >= +-(+@.a + 2))'::jsonpath;
+select '$a'::jsonpath;
+select '$a.b'::jsonpath;
+select '$a[*]'::jsonpath;
+select '$.g ? (@.zip == $zip)'::jsonpath;
+select '$.a[1,2, 3 to 16]'::jsonpath;
+select '$.a[$a + 1, ($b[*]) to -($[0] * 2)]'::jsonpath;
+select '$.a[$.a.size() - 3]'::jsonpath;
+select 'last'::jsonpath;
+select '"last"'::jsonpath;
+select '$.last'::jsonpath;
+select '$ ? (last > 0)'::jsonpath;
+select '$[last]'::jsonpath;
+select '$[$[0] ? (last > 0)]'::jsonpath;
+select 'null.type()'::jsonpath;
+select '1.type()'::jsonpath;
+select '(1).type()'::jsonpath;
+select '1.2.type()'::jsonpath;
+select '"aaa".type()'::jsonpath;
+select 'true.type()'::jsonpath;
+select '$.double().floor().ceiling().abs()'::jsonpath;
+select '$.keyvalue().key'::jsonpath;
+select '$.datetime()'::jsonpath;
+select '$.datetime("datetime template")'::jsonpath;
+select '$ ? (@ starts with "abc")'::jsonpath;
+select '$ ? (@ starts with $var)'::jsonpath;
+select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+select '$ ? (@ like_regex "pattern")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "i")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "is")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "isim")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "q")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "iq")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "smixq")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+select '$ < 1'::jsonpath;
+select '($ < 1) || $.a.b <= $x'::jsonpath;
+select '@ + 1'::jsonpath;
+select '($).a.b'::jsonpath;
+select '($.a.b).c.d'::jsonpath;
+select '($.a.b + -$.x.y).c.d'::jsonpath;
+select '(-+$.a.b).c.d'::jsonpath;
+select '1 + ($.a.b + 2).c.d'::jsonpath;
+select '1 + ($.a.b > 2).c.d'::jsonpath;
+select '($)'::jsonpath;
+select '(($))'::jsonpath;
+select '((($ + 1)).a + ((2)).b ? ((((@ > 1)) || (exists(@.c)))))'::jsonpath;
+select '$ ? (@.a < 1)'::jsonpath;
+select '$ ? (@.a < -1)'::jsonpath;
+select '$ ? (@.a < +1)'::jsonpath;
+select '$ ? (@.a < 0.1)'::jsonpath;
+select '$ ? (@.a < -0.1)'::jsonpath;
+select '$ ? (@.a < +0.1)'::jsonpath;
+select '$ ? (@.a < 10.1)'::jsonpath;
+select '$ ? (@.a < -10.1)'::jsonpath;
+select '$ ? (@.a < +10.1)'::jsonpath;
+select '$ ? (@.a < 1e1)'::jsonpath;
+select '$ ? (@.a < -1e1)'::jsonpath;
+select '$ ? (@.a < +1e1)'::jsonpath;
+select '$ ? (@.a < 0.1e1)'::jsonpath;
+select '$ ? (@.a < -0.1e1)'::jsonpath;
+select '$ ? (@.a < +0.1e1)'::jsonpath;
+select '$ ? (@.a < 10.1e1)'::jsonpath;
+select '$ ? (@.a < -10.1e1)'::jsonpath;
+select '$ ? (@.a < +10.1e1)'::jsonpath;
+select '$ ? (@.a < 1e-1)'::jsonpath;
+select '$ ? (@.a < -1e-1)'::jsonpath;
+select '$ ? (@.a < +1e-1)'::jsonpath;
+select '$ ? (@.a < 0.1e-1)'::jsonpath;
+select '$ ? (@.a < -0.1e-1)'::jsonpath;
+select '$ ? (@.a < +0.1e-1)'::jsonpath;
+select '$ ? (@.a < 10.1e-1)'::jsonpath;
+select '$ ? (@.a < -10.1e-1)'::jsonpath;
+select '$ ? (@.a < +10.1e-1)'::jsonpath;
+select '$ ? (@.a < 1e+1)'::jsonpath;
+select '$ ? (@.a < -1e+1)'::jsonpath;
+select '$ ? (@.a < +1e+1)'::jsonpath;
+select '$ ? (@.a < 0.1e+1)'::jsonpath;
+select '$ ? (@.a < -0.1e+1)'::jsonpath;
+select '$ ? (@.a < +0.1e+1)'::jsonpath;
+select '$ ? (@.a < 10.1e+1)'::jsonpath;
+select '$ ? (@.a < -10.1e+1)'::jsonpath;
+select '$ ? (@.a < +10.1e+1)'::jsonpath;
+select '0'::jsonpath;
+select '0.0'::jsonpath;
+select '0.000'::jsonpath;
+select '0.000e1'::jsonpath;
+select '0.000e2'::jsonpath;
+select '0.000e3'::jsonpath;
+select '0.0010'::jsonpath;
+select '0.0010e-1'::jsonpath;
+select '0.0010e+1'::jsonpath;
+select '0.0010e+2'::jsonpath;
+select '1e'::jsonpath;
+select '1.e'::jsonpath;
+select '1.2e'::jsonpath;
+select '1.2.e'::jsonpath;
+select '(1.2).e'::jsonpath;
+select '1e3'::jsonpath;
+select '1.e3'::jsonpath;
+select '1.e3.e'::jsonpath;
+select '1.e3.e4'::jsonpath;
+select '1.2e3'::jsonpath;
+select '1.2.e3'::jsonpath;
+select '(1.2).e3'::jsonpath;
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath_encoding.err b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.err
new file mode 100644
index 0000000000..3852a5d470
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.err
@@ -0,0 +1,278 @@
+<sql-statement>
+--
+-- encoding-sensitive tests for jsonpath
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+</sql-statement>
+<sql-statement>
+-- checks for double-quoted values
+-- basic unicode input
+SELECT '"\u"'::jsonpath; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- checks for double-quoted values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+
+ -- checks for double-quoted values
+ ^
+<sql-statement>
+SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+
+ SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+ ^
+<sql-statement>
+SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+
+ SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ ^
+<sql-statement>
+SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+
+ SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+ ^
+<sql-statement>
+SELECT '"\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+</sql-statement>
+<sql-statement>
+-- handling of unicode surrogate pairs
+select '"\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+
+ select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ ^
+<sql-statement>
+select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ ^
+<sql-statement>
+select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+ ^
+<sql-statement>
+select '"\ude04X"'::jsonpath; -- orphan low surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"\ude04X"'::jsonpath; -- orphan low surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '"\ude04X"'::jsonpath; -- orphan low surrogate
+ ^
+<sql-statement>
+--handling of simple unicode escapes
+select '"the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select '"dollar \u0024 character"'::jsonpath as correct_everywhere;
+</sql-statement>
+<sql-statement>
+select '"dollar \\u0024 character"'::jsonpath as not_an_escape;
+</sql-statement>
+<sql-statement>
+select '"null \u0000 escape"'::jsonpath as not_unescaped;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+
+ select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+<sql-statement>
+select '"null \\u0000 escape"'::jsonpath as not_an_escape;
+</sql-statement>
+<sql-statement>
+-- checks for quoted key names
+-- basic unicode input
+SELECT '$."\u"'::jsonpath; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- checks for quoted key names
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+
+ -- checks for quoted key names
+ ^
+<sql-statement>
+SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+
+ SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+ ^
+<sql-statement>
+SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+
+ SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ ^
+<sql-statement>
+SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+
+ SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+ ^
+<sql-statement>
+SELECT '$."\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+</sql-statement>
+<sql-statement>
+-- handling of unicode surrogate pairs
+select '$."\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+
+ select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ ^
+<sql-statement>
+select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ ^
+<sql-statement>
+select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+ ^
+<sql-statement>
+select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type jsonpath
+DETAIL: Unicode low surrogate must follow a high surrogate.
+
+ select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+ ^
+<sql-statement>
+--handling of simple unicode escapes
+select '$."the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+</sql-statement>
+<sql-statement>
+select '$."dollar \u0024 character"'::jsonpath as correct_everywhere;
+</sql-statement>
+<sql-statement>
+select '$."dollar \\u0024 character"'::jsonpath as not_an_escape;
+</sql-statement>
+<sql-statement>
+select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+
+ select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+<sql-statement>
+select '$."null \\u0000 escape"'::jsonpath as not_an_escape;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath_encoding.out b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.out
new file mode 100644
index 0000000000..2b57de4a06
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.out
@@ -0,0 +1,173 @@
+--
+-- encoding-sensitive tests for jsonpath
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+---------------------
+ UTF8
+(1 row)
+
+-- checks for double-quoted values
+-- basic unicode input
+SELECT '"\u"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+LINE 1: SELECT '"\u"'::jsonpath;
+ ^
+SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+LINE 1: SELECT '"\u00"'::jsonpath;
+ ^
+SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+LINE 1: SELECT '"\u000g"'::jsonpath;
+ ^
+SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '"\u0000"'::jsonpath;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+SELECT '"\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+ jsonpath
+----------
+ "ê¯"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select '"\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+-----------------
+ "😄ðŸ¶"
+(1 row)
+
+select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ud83d\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ude04\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ud83dX"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '"\ude04X"'::jsonpath; -- orphan low surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ude04X"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+--handling of simple unicode escapes
+select '"the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+------------------------
+ "the Copyright © sign"
+(1 row)
+
+select '"dollar \u0024 character"'::jsonpath as correct_everywhere;
+ correct_everywhere
+----------------------
+ "dollar $ character"
+(1 row)
+
+select '"dollar \\u0024 character"'::jsonpath as not_an_escape;
+ not_an_escape
+----------------------------
+ "dollar \\u0024 character"
+(1 row)
+
+select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ERROR: unsupported Unicode escape sequence
+LINE 1: select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+select '"null \\u0000 escape"'::jsonpath as not_an_escape;
+ not_an_escape
+-----------------------
+ "null \\u0000 escape"
+(1 row)
+
+-- checks for quoted key names
+-- basic unicode input
+SELECT '$."\u"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+LINE 1: SELECT '$."\u"'::jsonpath;
+ ^
+SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+LINE 1: SELECT '$."\u00"'::jsonpath;
+ ^
+SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+LINE 1: SELECT '$."\u000g"'::jsonpath;
+ ^
+SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '$."\u0000"'::jsonpath;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+SELECT '$."\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+ jsonpath
+----------
+ $."ê¯"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select '$."\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+-----------------
+ $."😄ðŸ¶"
+(1 row)
+
+select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ud83d\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ude04\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ud83dX"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ude04X"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+--handling of simple unicode escapes
+select '$."the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+--------------------------
+ $."the Copyright © sign"
+(1 row)
+
+select '$."dollar \u0024 character"'::jsonpath as correct_everywhere;
+ correct_everywhere
+------------------------
+ $."dollar $ character"
+(1 row)
+
+select '$."dollar \\u0024 character"'::jsonpath as not_an_escape;
+ not_an_escape
+------------------------------
+ $."dollar \\u0024 character"
+(1 row)
+
+select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ERROR: unsupported Unicode escape sequence
+LINE 1: select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+select '$."null \\u0000 escape"'::jsonpath as not_an_escape;
+ not_an_escape
+-------------------------
+ $."null \\u0000 escape"
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/jsonpath_encoding.sql b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.sql
new file mode 100644
index 0000000000..597c153f5c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/jsonpath_encoding.sql
@@ -0,0 +1,42 @@
+--
+-- encoding-sensitive tests for jsonpath
+--
+SELECT getdatabaseencoding(); -- just to label the results files
+-- checks for double-quoted values
+-- basic unicode input
+SELECT '"\u"'::jsonpath; -- ERROR, incomplete escape
+SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+SELECT '"\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+-- handling of unicode surrogate pairs
+select '"\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+select '"\ude04X"'::jsonpath; -- orphan low surrogate
+--handling of simple unicode escapes
+select '"the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+select '"dollar \u0024 character"'::jsonpath as correct_everywhere;
+select '"dollar \\u0024 character"'::jsonpath as not_an_escape;
+select '"null \u0000 escape"'::jsonpath as not_unescaped;
+select '"null \\u0000 escape"'::jsonpath as not_an_escape;
+-- checks for quoted key names
+-- basic unicode input
+SELECT '$."\u"'::jsonpath; -- ERROR, incomplete escape
+SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+SELECT '$."\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+-- handling of unicode surrogate pairs
+select '$."\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+--handling of simple unicode escapes
+select '$."the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+select '$."dollar \u0024 character"'::jsonpath as correct_everywhere;
+select '$."dollar \\u0024 character"'::jsonpath as not_an_escape;
+select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+select '$."null \\u0000 escape"'::jsonpath as not_an_escape;
diff --git a/yql/essentials/tests/postgresql/cases/limit.err b/yql/essentials/tests/postgresql/cases/limit.err
new file mode 100644
index 0000000000..c1502c438b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/limit.err
@@ -0,0 +1,689 @@
+Registering pre-existing tables
+ onek
+ tenk1
+ int8_tbl
+<sql-statement>
+--
+-- LIMIT
+-- Check the LIMIT/OFFSET feature of SELECT
+--
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ ORDER BY unique1 LIMIT 2;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60
+ ORDER BY unique1 LIMIT 5;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60 AND unique1 < 63
+ ORDER BY unique1 LIMIT 5;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS three, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 100
+ ORDER BY unique1 LIMIT 3 OFFSET 20;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS zero, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS eleven, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS ten, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990 LIMIT 5;
+</sql-statement>
+<sql-statement>
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
+</sql-statement>
+<sql-statement>
+-- Test null limit and offset. The planner would discard a simple null
+-- constant, so to ensure executor is exercised, do this:
+select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
+</sql-statement>
+<sql-statement>
+select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
+</sql-statement>
+<sql-statement>
+-- Test assorted cases involving backwards fetch from a LIMIT plan node
+begin;
+</sql-statement>
+<sql-statement>
+declare c1 cursor for select * from int8_tbl limit 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c1 cursor for select * from int8_tbl limit 10;
+ ^
+<sql-statement>
+fetch all in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c1;
+ ^
+<sql-statement>
+fetch 1 in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch 1 in c1;
+ ^
+<sql-statement>
+fetch backward 1 in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c1;
+ ^
+<sql-statement>
+fetch backward all in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c1;
+ ^
+<sql-statement>
+fetch backward 1 in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c1;
+ ^
+<sql-statement>
+fetch all in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c1;
+ ^
+<sql-statement>
+declare c2 cursor for select * from int8_tbl limit 3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c2 cursor for select * from int8_tbl limit 3;
+ ^
+<sql-statement>
+fetch all in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c2;
+ ^
+<sql-statement>
+fetch 1 in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch 1 in c2;
+ ^
+<sql-statement>
+fetch backward 1 in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c2;
+ ^
+<sql-statement>
+fetch backward all in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c2;
+ ^
+<sql-statement>
+fetch backward 1 in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c2;
+ ^
+<sql-statement>
+fetch all in c2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c2;
+ ^
+<sql-statement>
+declare c3 cursor for select * from int8_tbl offset 3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c3 cursor for select * from int8_tbl offset 3;
+ ^
+<sql-statement>
+fetch all in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c3;
+ ^
+<sql-statement>
+fetch 1 in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch 1 in c3;
+ ^
+<sql-statement>
+fetch backward 1 in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c3;
+ ^
+<sql-statement>
+fetch backward all in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c3;
+ ^
+<sql-statement>
+fetch backward 1 in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c3;
+ ^
+<sql-statement>
+fetch all in c3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c3;
+ ^
+<sql-statement>
+declare c4 cursor for select * from int8_tbl offset 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c4 cursor for select * from int8_tbl offset 10;
+ ^
+<sql-statement>
+fetch all in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c4;
+ ^
+<sql-statement>
+fetch 1 in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch 1 in c4;
+ ^
+<sql-statement>
+fetch backward 1 in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c4;
+ ^
+<sql-statement>
+fetch backward all in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c4;
+ ^
+<sql-statement>
+fetch backward 1 in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c4;
+ ^
+<sql-statement>
+fetch all in c4;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c4;
+ ^
+<sql-statement>
+declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
+ ^
+<sql-statement>
+fetch all in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c5;
+ ^
+<sql-statement>
+fetch 1 in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch 1 in c5;
+ ^
+<sql-statement>
+fetch backward 1 in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c5;
+ ^
+<sql-statement>
+fetch backward 1 in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward 1 in c5;
+ ^
+<sql-statement>
+fetch all in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c5;
+ ^
+<sql-statement>
+fetch backward all in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c5;
+ ^
+<sql-statement>
+fetch all in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch all in c5;
+ ^
+<sql-statement>
+fetch backward all in c5;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c5;
+ ^
+<sql-statement>
+rollback;
+</sql-statement>
+<sql-statement>
+-- Stress test for variable LIMIT in conjunction with bounded-heap sorting
+SELECT
+ (SELECT n
+ FROM (VALUES (1)) AS x,
+ (SELECT n FROM generate_series(1,10) AS n
+ ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
+ FROM generate_series(1,10) AS s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:40: Error: Columns are not allowed in: OFFSET
+ ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Stress test for variable LIMIT in conjunction with bounded-heap sorting
+ ^
+ -stdin-:<main>:3:3: Error: At function: PgSubLink, At function: PgSelect
+ (SELECT n
+ ^
+ -stdin-:<main>:3:3: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ (SELECT n
+ ^
+<sql-statement>
+--
+-- Test behavior of volatile and set-returning functions in conjunction
+-- with ORDER BY and LIMIT.
+--
+create temp sequence testseq;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ --
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ select unique1, unique2, nextval('testseq')
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
+
+ select unique1, unique2, nextval('testseq')
+ ^
+<sql-statement>
+select currval('testseq');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select currval('testseq');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
+
+ select currval('testseq');
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ select unique1, unique2, nextval('testseq')
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
+
+ select unique1, unique2, nextval('testseq')
+ ^
+<sql-statement>
+select currval('testseq');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select currval('testseq');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "testseq" does not exist
+
+ select currval('testseq');
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:26: Error: Generator functions are not allowed in: SELECT
+ select unique1, unique2, generate_series(1,10)
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:26: Error: Generator functions are not allowed in: SELECT
+ select unique1, unique2, generate_series(1,10)
+ ^
+<sql-statement>
+-- use of random() is to keep planner from folding the expressions together
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- use of random() is to keep planner from folding the expressions together
+ ^
+<sql-statement>
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+ ^
+<sql-statement>
+-- test for failure to set all aggregates' aggtranstype
+explain (verbose, costs off)
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- test for failure to set all aggregates' aggtranstype
+ ^
+<sql-statement>
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+</sql-statement>
+<sql-statement>
+--
+-- FETCH FIRST
+-- Check the WITH TIES clause
+--
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW WITH TIES;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
+ --
+ ^
+<sql-statement>
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST ROWS WITH TIES;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
+ SELECT thousand
+ ^
+<sql-statement>
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: LimitOption unsupported value: 1
+ SELECT thousand
+ ^
+<sql-statement>
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW ONLY;
+</sql-statement>
+<sql-statement>
+-- SKIP LOCKED and WITH TIES are incompatible
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ERROR: SKIP LOCKED and WITH TIES options cannot be used together
+
+ -- SKIP LOCKED and WITH TIES are incompatible
+ ^
+<sql-statement>
+-- should fail
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ FETCH FIRST 2 ROW WITH TIES;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ERROR: WITH TIES cannot be specified without ORDER BY clause
+
+ -- should fail
+ ^
+<sql-statement>
+-- test ruleutils
+CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- test ruleutils
+ ^
+<sql-statement>
+\d+ limit_thousand_v_1
+</sql-statement>
+Metacommand \d+ limit_thousand_v_1 is not supported
+<sql-statement>
+CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand OFFSET 10 FETCH FIRST 5 ROWS ONLY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
+ ^
+<sql-statement>
+\d+ limit_thousand_v_2
+</sql-statement>
+Metacommand \d+ limit_thousand_v_2 is not supported
+<sql-statement>
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS WITH TIES; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ^
+<sql-statement>
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ^
+<sql-statement>
+\d+ limit_thousand_v_3
+</sql-statement>
+Metacommand \d+ limit_thousand_v_3 is not supported
+<sql-statement>
+CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS ONLY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
+ ^
+<sql-statement>
+\d+ limit_thousand_v_4
+</sql-statement>
+Metacommand \d+ limit_thousand_v_4 is not supported
+<sql-statement>
+-- leave these views
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/limit.out b/yql/essentials/tests/postgresql/cases/limit.out
new file mode 100644
index 0000000000..90a448a1b8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/limit.out
@@ -0,0 +1,164 @@
+--
+-- LIMIT
+-- Check the LIMIT/OFFSET feature of SELECT
+--
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ ORDER BY unique1 LIMIT 2;
+ two | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 51 | 76 | ZBAAAA
+ | 52 | 985 | ACAAAA
+(2 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60
+ ORDER BY unique1 LIMIT 5;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 61 | 560 | JCAAAA
+ | 62 | 633 | KCAAAA
+ | 63 | 296 | LCAAAA
+ | 64 | 479 | MCAAAA
+ | 65 | 64 | NCAAAA
+(5 rows)
+
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60 AND unique1 < 63
+ ORDER BY unique1 LIMIT 5;
+ two | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 61 | 560 | JCAAAA
+ | 62 | 633 | KCAAAA
+(2 rows)
+
+SELECT ''::text AS three, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 100
+ ORDER BY unique1 LIMIT 3 OFFSET 20;
+ three | unique1 | unique2 | stringu1
+-------+---------+---------+----------
+ | 121 | 700 | REAAAA
+ | 122 | 519 | SEAAAA
+ | 123 | 777 | TEAAAA
+(3 rows)
+
+SELECT ''::text AS zero, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
+ zero | unique1 | unique2 | stringu1
+------+---------+---------+----------
+(0 rows)
+
+SELECT ''::text AS eleven, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
+ eleven | unique1 | unique2 | stringu1
+--------+---------+---------+----------
+ | 10 | 520 | KAAAAA
+ | 9 | 49 | JAAAAA
+ | 8 | 653 | IAAAAA
+ | 7 | 647 | HAAAAA
+ | 6 | 978 | GAAAAA
+ | 5 | 541 | FAAAAA
+ | 4 | 833 | EAAAAA
+ | 3 | 431 | DAAAAA
+ | 2 | 326 | CAAAAA
+ | 1 | 214 | BAAAAA
+ | 0 | 998 | AAAAAA
+(11 rows)
+
+SELECT ''::text AS ten, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990;
+ ten | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 990 | 369 | CMAAAA
+ | 991 | 426 | DMAAAA
+ | 992 | 363 | EMAAAA
+ | 993 | 661 | FMAAAA
+ | 994 | 695 | GMAAAA
+ | 995 | 144 | HMAAAA
+ | 996 | 258 | IMAAAA
+ | 997 | 21 | JMAAAA
+ | 998 | 549 | KMAAAA
+ | 999 | 152 | LMAAAA
+(10 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990 LIMIT 5;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 990 | 369 | CMAAAA
+ | 991 | 426 | DMAAAA
+ | 992 | 363 | EMAAAA
+ | 993 | 661 | FMAAAA
+ | 994 | 695 | GMAAAA
+(5 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 900 | 913 | QIAAAA
+ | 901 | 931 | RIAAAA
+ | 902 | 702 | SIAAAA
+ | 903 | 641 | TIAAAA
+ | 904 | 793 | UIAAAA
+(5 rows)
+
+-- Test null limit and offset. The planner would discard a simple null
+-- constant, so to ensure executor is exercised, do this:
+select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- Test assorted cases involving backwards fetch from a LIMIT plan node
+begin;
+rollback;
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+ s1 | s2
+-------+-------
+ 45000 | 45000
+ 45010 | 45010
+ 45020 | 45020
+(3 rows)
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW ONLY;
+ thousand
+----------
+ 0
+ 0
+(2 rows)
+
+-- SKIP LOCKED and WITH TIES are incompatible
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
+ERROR: SKIP LOCKED and WITH TIES options cannot be used together
+-- should fail
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ FETCH FIRST 2 ROW WITH TIES;
+ERROR: WITH TIES cannot be specified without ORDER BY clause
+-- leave these views
diff --git a/yql/essentials/tests/postgresql/cases/limit.sql b/yql/essentials/tests/postgresql/cases/limit.sql
new file mode 100644
index 0000000000..bfd8e5b54e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/limit.sql
@@ -0,0 +1,52 @@
+--
+-- LIMIT
+-- Check the LIMIT/OFFSET feature of SELECT
+--
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ ORDER BY unique1 LIMIT 2;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60
+ ORDER BY unique1 LIMIT 5;
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60 AND unique1 < 63
+ ORDER BY unique1 LIMIT 5;
+SELECT ''::text AS three, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 100
+ ORDER BY unique1 LIMIT 3 OFFSET 20;
+SELECT ''::text AS zero, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
+SELECT ''::text AS eleven, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
+SELECT ''::text AS ten, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990 LIMIT 5;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
+-- Test null limit and offset. The planner would discard a simple null
+-- constant, so to ensure executor is exercised, do this:
+select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
+select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
+-- Test assorted cases involving backwards fetch from a LIMIT plan node
+begin;
+rollback;
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW ONLY;
+-- SKIP LOCKED and WITH TIES are incompatible
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
+-- should fail
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ FETCH FIRST 2 ROW WITH TIES;
+-- leave these views
diff --git a/yql/essentials/tests/postgresql/cases/name.err b/yql/essentials/tests/postgresql/cases/name.err
new file mode 100644
index 0000000000..85c245513f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/name.err
@@ -0,0 +1,320 @@
+<sql-statement>
+--
+-- NAME
+-- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
+--
+-- fixed-length by reference
+SELECT name 'name string' = name 'name string' AS "True";
+</sql-statement>
+<sql-statement>
+SELECT name 'name string' = name 'name string ' AS "False";
+</sql-statement>
+<sql-statement>
+--
+--
+--
+CREATE TABLE NAME_TBL(f1 name);
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM NAME_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
+</sql-statement>
+<sql-statement>
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
+</sql-statement>
+<sql-statement>
+DROP TABLE NAME_TBL;
+</sql-statement>
+<sql-statement>
+DO $$
+DECLARE r text[];
+BEGIN
+ r := parse_ident('Schemax.Tabley');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+ r := parse_ident('"SchemaX"."TableY"');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+END;
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263
+ DO $$
+ ^
+<sql-statement>
+SELECT parse_ident('foo.boo');
+</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 parse_ident('foo.boo');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('foo.boo');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('foo.boo');
+ ^
+<sql-statement>
+SELECT parse_ident('foo.boo[]'); -- should 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 parse_ident('foo.boo[]'); -- should fail
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('foo.boo[]'); -- should fail
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('foo.boo[]'); -- should fail
+ ^
+<sql-statement>
+SELECT parse_ident('foo.boo[]', strict => false); -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT parse_ident('foo.boo[]', strict => false); -- ok
+ ^
+<sql-statement>
+-- should fail
+SELECT parse_ident(' ');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- should fail
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT parse_ident(' ');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident(' ');
+ ^
+<sql-statement>
+SELECT parse_ident(' .aaa');
+</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 parse_ident(' .aaa');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(' .aaa');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident(' .aaa');
+ ^
+<sql-statement>
+SELECT parse_ident(' aaa . ');
+</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 parse_ident(' aaa . ');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(' aaa . ');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident(' aaa . ');
+ ^
+<sql-statement>
+SELECT parse_ident('aaa.a%b');
+</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 parse_ident('aaa.a%b');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('aaa.a%b');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('aaa.a%b');
+ ^
+<sql-statement>
+SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+</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 parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+ ^
+<sql-statement>
+SELECT length(a[1]), length(a[2]) from parse_ident('"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy') as a ;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 360
+ SELECT length(a[1]), length(a[2]) from parse_ident('"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy') as a ;
+ ^
+<sql-statement>
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+</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 parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (text)
+ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+ ^
+<sql-statement>
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+</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 parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+ ^
+ -stdin-:<main>:1:91: Error: At function: PgCast
+ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (text)
+ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+ ^
+<sql-statement>
+SELECT parse_ident(E'"c".X XXXX\002XXXXXX');
+</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 parse_ident(E'"c".X XXXX\002XXXXXX');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident(E'"c".X XXXX\002XXXXXX');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident(E'"c".X XXXX\002XXXXXX');
+ ^
+<sql-statement>
+SELECT parse_ident('1020');
+</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 parse_ident('1020');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('1020');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('1020');
+ ^
+<sql-statement>
+SELECT parse_ident('10.20');
+</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 parse_ident('10.20');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('10.20');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('10.20');
+ ^
+<sql-statement>
+SELECT parse_ident('.');
+</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 parse_ident('.');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('.');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('.');
+ ^
+<sql-statement>
+SELECT parse_ident('.1020');
+</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 parse_ident('.1020');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('.1020');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('.1020');
+ ^
+<sql-statement>
+SELECT parse_ident('xxx.1020');
+</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 parse_ident('xxx.1020');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT parse_ident('xxx.1020');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc parse_ident with given argument types: (unknown)
+ SELECT parse_ident('xxx.1020');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/name.out b/yql/essentials/tests/postgresql/cases/name.out
new file mode 100644
index 0000000000..cb19d6de6e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/name.out
@@ -0,0 +1,126 @@
+--
+-- NAME
+-- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
+--
+-- fixed-length by reference
+SELECT name 'name string' = name 'name string' AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT name 'name string' = name 'name string ' AS "False";
+ False
+-------
+ f
+(1 row)
+
+--
+--
+--
+CREATE TABLE NAME_TBL(f1 name);
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
+INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
+INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
+INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
+INSERT INTO NAME_TBL(f1) VALUES ('');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+SELECT * FROM NAME_TBL;
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(7 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+(5 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(2 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+----
+
+(1 row)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(3 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+(4 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(6 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(7 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
+ f1
+----
+(0 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ 343f%2a
+ d34aaasdf
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(5 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
+ f1
+------------
+ asdfghjkl;
+ d34aaasdf
+(2 rows)
+
+DROP TABLE NAME_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/name.sql b/yql/essentials/tests/postgresql/cases/name.sql
new file mode 100644
index 0000000000..964d6a72cb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/name.sql
@@ -0,0 +1,30 @@
+--
+-- NAME
+-- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
+--
+-- fixed-length by reference
+SELECT name 'name string' = name 'name string' AS "True";
+SELECT name 'name string' = name 'name string ' AS "False";
+--
+--
+--
+CREATE TABLE NAME_TBL(f1 name);
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
+INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
+INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
+INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
+INSERT INTO NAME_TBL(f1) VALUES ('');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+SELECT * FROM NAME_TBL;
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
+DROP TABLE NAME_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/numeric.err b/yql/essentials/tests/postgresql/cases/numeric.err
new file mode 100644
index 0000000000..5f629afdbe
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numeric.err
@@ -0,0 +1,4177 @@
+<sql-statement>
+--
+-- NUMERIC
+--
+CREATE TABLE num_data (id int4, val numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+</sql-statement>
+<sql-statement>
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,2,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,3,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,4,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,5,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,6,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,7,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,8,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (0,9,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,2,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,3,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,4,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,5,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,6,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,7,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,8,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (1,9,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+BEGIN TRANSACTION;
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (0, '0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (1, '0');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (3, '4.31');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (4, '7799461.4119');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (5, '16397.038491');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (6, '93901.57763026');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (7, '-83028485');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (8, '74881');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+</sql-statement>
+<sql-statement>
+COMMIT TRANSACTION;
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Create indices for faster checks
+-- ******************************
+CREATE UNIQUE INDEX num_exp_add_idx ON num_exp_add (id1, id2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ -- ******************************
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
+ ^
+<sql-statement>
+CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_add;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_add;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_sub;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_sub;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_div;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_div;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_mul;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_mul;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_sqrt;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_sqrt;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_ln;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_ln;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_log10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_log10;
+ ^
+<sql-statement>
+VACUUM ANALYZE num_exp_power_10_ln;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ VACUUM ANALYZE num_exp_power_10_ln;
+ ^
+<sql-statement>
+-- ******************************
+-- * Now check the behaviour of the NUMERIC type
+-- ******************************
+-- ******************************
+-- * Addition check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, t1.val + t2.val
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 10);
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Subtraction check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, t1.val - t2.val
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 40);
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Multiply check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, t1.val * t2.val
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+ FROM num_data t1, num_data t2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 30);
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Division check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, t1.val / t2.val
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+DELETE FROM num_result;
+</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 num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: id
+ INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+ ^
+<sql-statement>
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 80);
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Square root check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT id, 0, SQRT(ABS(val))
+ FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_sqrt t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Natural logarithm check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT id, 0, LN(ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+</sql-statement>
+<sql-statement>
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Logarithm base 10 check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT id, 0, LOG(numeric '10', ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+</sql-statement>
+<sql-statement>
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_log10 t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * POWER(10, LN(value)) check
+-- ******************************
+DELETE FROM num_result;
+</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 num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
+ FROM num_data
+ WHERE val != '0.0';
+</sql-statement>
+<sql-statement>
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_power_10_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * Check behavior with Inf and NaN inputs. It's easiest to handle these
+-- * separately from the num_data framework used above, because some input
+-- * combinations will throw errors.
+-- ******************************
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 + x2 AS sum,
+ x1 - x2 AS diff,
+ x1 * x2 AS prod
+FROM v AS v1(x1), v AS v2(x2);
+</sql-statement>
+<sql-statement>
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 / x2 AS quot,
+ x1 % x2 AS mod,
+ div(x1, x2) AS div
+FROM v AS v1(x1), v AS v2(x2) WHERE x2 != 0;
+</sql-statement>
+<sql-statement>
+SELECT 'inf'::numeric / '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'inf'::numeric / '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT 'inf'::numeric / '0';
+ ^
+<sql-statement>
+SELECT '-inf'::numeric / '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-inf'::numeric / '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT '-inf'::numeric / '0';
+ ^
+<sql-statement>
+SELECT 'nan'::numeric / '0';
+</sql-statement>
+<sql-statement>
+SELECT '0'::numeric / '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '0'::numeric / '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT '0'::numeric / '0';
+ ^
+<sql-statement>
+SELECT 'inf'::numeric % '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'inf'::numeric % '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT 'inf'::numeric % '0';
+ ^
+<sql-statement>
+SELECT '-inf'::numeric % '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-inf'::numeric % '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT '-inf'::numeric % '0';
+ ^
+<sql-statement>
+SELECT 'nan'::numeric % '0';
+</sql-statement>
+<sql-statement>
+SELECT '0'::numeric % '0';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '0'::numeric % '0';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT '0'::numeric % '0';
+ ^
+<sql-statement>
+SELECT div('inf'::numeric, '0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT div('inf'::numeric, '0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT div('inf'::numeric, '0');
+ ^
+<sql-statement>
+SELECT div('-inf'::numeric, '0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT div('-inf'::numeric, '0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT div('-inf'::numeric, '0');
+ ^
+<sql-statement>
+SELECT div('nan'::numeric, '0');
+</sql-statement>
+<sql-statement>
+SELECT div('0'::numeric, '0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT div('0'::numeric, '0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ SELECT div('0'::numeric, '0');
+ ^
+<sql-statement>
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, -x as minusx, abs(x), floor(x), ceil(x), sign(x), numeric_inc(x) as inc
+FROM v;
+</sql-statement>
+<sql-statement>
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, round(x), round(x,1) as round1, trunc(x), trunc(x,1) as trunc1
+FROM v;
+</sql-statement>
+<sql-statement>
+-- the large values fall into the numeric abbreviation code's maximal classes
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
+ ('inf'),('-inf'),('nan'),
+ ('inf'),('-inf'),('nan'))
+SELECT substring(x::text, 1, 32)
+FROM v ORDER BY x;
+</sql-statement>
+<sql-statement>
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('4.2'),('inf'),('nan'))
+SELECT x, sqrt(x)
+FROM v;
+</sql-statement>
+<sql-statement>
+SELECT sqrt('-1'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT sqrt('-1'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take square root of a negative number
+
+ SELECT sqrt('-1'::numeric);
+ ^
+<sql-statement>
+SELECT sqrt('-inf'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT sqrt('-inf'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take square root of a negative number
+
+ SELECT sqrt('-inf'::numeric);
+ ^
+<sql-statement>
+WITH v(x) AS
+ (VALUES('1'::numeric),('4.2'),('inf'),('nan'))
+SELECT x,
+ log(x),
+ log10(x),
+ ln(x)
+FROM v;
+</sql-statement>
+<sql-statement>
+SELECT ln('0'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ln('0'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ SELECT ln('0'::numeric);
+ ^
+<sql-statement>
+SELECT ln('-1'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ln('-1'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT ln('-1'::numeric);
+ ^
+<sql-statement>
+SELECT ln('-inf'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT ln('-inf'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT ln('-inf'::numeric);
+ ^
+<sql-statement>
+WITH v(x) AS
+ (VALUES('2'::numeric),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ log(x1, x2)
+FROM v AS v1(x1), v AS v2(x2);
+</sql-statement>
+<sql-statement>
+SELECT log('0'::numeric, '10');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('0'::numeric, '10');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ SELECT log('0'::numeric, '10');
+ ^
+<sql-statement>
+SELECT log('10'::numeric, '0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('10'::numeric, '0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ SELECT log('10'::numeric, '0');
+ ^
+<sql-statement>
+SELECT log('-inf'::numeric, '10');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('-inf'::numeric, '10');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT log('-inf'::numeric, '10');
+ ^
+<sql-statement>
+SELECT log('10'::numeric, '-inf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('10'::numeric, '-inf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT log('10'::numeric, '-inf');
+ ^
+<sql-statement>
+SELECT log('inf'::numeric, '0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('inf'::numeric, '0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ SELECT log('inf'::numeric, '0');
+ ^
+<sql-statement>
+SELECT log('inf'::numeric, '-inf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('inf'::numeric, '-inf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT log('inf'::numeric, '-inf');
+ ^
+<sql-statement>
+SELECT log('-inf'::numeric, 'inf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT log('-inf'::numeric, 'inf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ SELECT log('-inf'::numeric, 'inf');
+ ^
+<sql-statement>
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('2'),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ power(x1, x2)
+FROM v AS v1(x1), v AS v2(x2) WHERE x1 != 0 OR x2 >= 0;
+</sql-statement>
+<sql-statement>
+SELECT power('0'::numeric, '-1');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power('0'::numeric, '-1');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: zero raised to a negative power is undefined
+
+ SELECT power('0'::numeric, '-1');
+ ^
+<sql-statement>
+SELECT power('0'::numeric, '-inf');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power('0'::numeric, '-inf');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: zero raised to a negative power is undefined
+
+ SELECT power('0'::numeric, '-inf');
+ ^
+<sql-statement>
+SELECT power('-1'::numeric, 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power('-2'::numeric, '3');
+</sql-statement>
+<sql-statement>
+SELECT power('-2'::numeric, '3.3');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power('-2'::numeric, '3.3');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: a negative number raised to a non-integer power yields a complex result
+
+ SELECT power('-2'::numeric, '3.3');
+ ^
+<sql-statement>
+SELECT power('-2'::numeric, '-1');
+</sql-statement>
+<sql-statement>
+SELECT power('-2'::numeric, '-1.5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power('-2'::numeric, '-1.5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: a negative number raised to a non-integer power yields a complex result
+
+ SELECT power('-2'::numeric, '-1.5');
+ ^
+<sql-statement>
+SELECT power('-2'::numeric, 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power('-2'::numeric, '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power('inf'::numeric, '-2');
+</sql-statement>
+<sql-statement>
+SELECT power('inf'::numeric, '-inf');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '2');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '3');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '4.5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT power('-inf'::numeric, '4.5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: a negative number raised to a non-integer power yields a complex result
+
+ SELECT power('-inf'::numeric, '4.5');
+ ^
+<sql-statement>
+SELECT power('-inf'::numeric, '-2');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '-3');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '0');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, 'inf');
+</sql-statement>
+<sql-statement>
+SELECT power('-inf'::numeric, '-inf');
+</sql-statement>
+<sql-statement>
+-- ******************************
+-- * miscellaneous checks for things that have been broken in the past...
+-- ******************************
+-- numeric AVG used to fail on some platforms
+SELECT AVG(val) FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT MAX(val) FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT MIN(val) FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT STDDEV(val) FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT VARIANCE(val) FROM num_data;
+</sql-statement>
+<sql-statement>
+-- Check for appropriate rounding and overflow
+CREATE TABLE fract_only (id int, val numeric(4,4));
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (1, '0.0');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (2, '0.1');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (3, '1.0'); -- should fail
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (4, '-0.9999');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (5, '0.99994');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (7, '0.00001');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (8, '0.00017');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (9, 'NaN');
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (10, 'Inf'); -- should fail
+</sql-statement>
+<sql-statement>
+INSERT INTO fract_only VALUES (11, '-Inf'); -- should fail
+</sql-statement>
+<sql-statement>
+SELECT * FROM fract_only;
+</sql-statement>
+<sql-statement>
+DROP TABLE fract_only;
+</sql-statement>
+<sql-statement>
+-- Check conversion to integers
+SELECT (-9223372036854775808.5)::int8; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Check conversion to integers
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ -- Check conversion to integers
+ ^
+<sql-statement>
+SELECT (-9223372036854775808.4)::int8; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 9223372036854775807.4::int8; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 9223372036854775807.5::int8; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 9223372036854775807.5::int8; -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT 9223372036854775807.5::int8; -- should fail
+ ^
+<sql-statement>
+SELECT (-2147483648.5)::int4; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-2147483648.5)::int4; -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT (-2147483648.5)::int4; -- should fail
+ ^
+<sql-statement>
+SELECT (-2147483648.4)::int4; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 2147483647.4::int4; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 2147483647.5::int4; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 2147483647.5::int4; -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: integer out of range
+
+ SELECT 2147483647.5::int4; -- should fail
+ ^
+<sql-statement>
+SELECT (-32768.5)::int2; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT (-32768.5)::int2; -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT (-32768.5)::int2; -- should fail
+ ^
+<sql-statement>
+SELECT (-32768.4)::int2; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 32767.4::int2; -- ok
+</sql-statement>
+<sql-statement>
+SELECT 32767.5::int2; -- should fail
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 32767.5::int2; -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: smallint out of range
+
+ SELECT 32767.5::int2; -- should fail
+ ^
+<sql-statement>
+-- Check inf/nan conversion behavior
+SELECT 'NaN'::float8::numeric;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::float8::numeric;
+</sql-statement>
+<sql-statement>
+SELECT '-Infinity'::float8::numeric;
+</sql-statement>
+<sql-statement>
+SELECT 'NaN'::numeric::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::numeric::float8;
+</sql-statement>
+<sql-statement>
+SELECT '-Infinity'::numeric::float8;
+</sql-statement>
+<sql-statement>
+SELECT 'NaN'::float4::numeric;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::float4::numeric;
+</sql-statement>
+<sql-statement>
+SELECT '-Infinity'::float4::numeric;
+</sql-statement>
+<sql-statement>
+SELECT 'NaN'::numeric::float4;
+</sql-statement>
+<sql-statement>
+SELECT 'Infinity'::numeric::float4;
+</sql-statement>
+<sql-statement>
+SELECT '-Infinity'::numeric::float4;
+</sql-statement>
+<sql-statement>
+SELECT '42'::int2::numeric;
+</sql-statement>
+<sql-statement>
+SELECT 'NaN'::numeric::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'NaN'::numeric::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert NaN to smallint
+
+ SELECT 'NaN'::numeric::int2;
+ ^
+<sql-statement>
+SELECT 'Infinity'::numeric::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'Infinity'::numeric::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to smallint
+
+ SELECT 'Infinity'::numeric::int2;
+ ^
+<sql-statement>
+SELECT '-Infinity'::numeric::int2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-Infinity'::numeric::int2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to smallint
+
+ SELECT '-Infinity'::numeric::int2;
+ ^
+<sql-statement>
+SELECT 'NaN'::numeric::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'NaN'::numeric::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert NaN to integer
+
+ SELECT 'NaN'::numeric::int4;
+ ^
+<sql-statement>
+SELECT 'Infinity'::numeric::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'Infinity'::numeric::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to integer
+
+ SELECT 'Infinity'::numeric::int4;
+ ^
+<sql-statement>
+SELECT '-Infinity'::numeric::int4;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-Infinity'::numeric::int4;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to integer
+
+ SELECT '-Infinity'::numeric::int4;
+ ^
+<sql-statement>
+SELECT 'NaN'::numeric::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'NaN'::numeric::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert NaN to bigint
+
+ SELECT 'NaN'::numeric::int8;
+ ^
+<sql-statement>
+SELECT 'Infinity'::numeric::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'Infinity'::numeric::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to bigint
+
+ SELECT 'Infinity'::numeric::int8;
+ ^
+<sql-statement>
+SELECT '-Infinity'::numeric::int8;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '-Infinity'::numeric::int8;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert infinity to bigint
+
+ SELECT '-Infinity'::numeric::int8;
+ ^
+<sql-statement>
+-- Simple check that ceil(), floor(), and round() work correctly
+CREATE TABLE ceil_floor_round (a numeric);
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('-5.5');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('-5.499999');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('9.5');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('9.4999999');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('0.0');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('0.0000001');
+</sql-statement>
+<sql-statement>
+INSERT INTO ceil_floor_round VALUES ('-0.000001');
+</sql-statement>
+<sql-statement>
+SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round;
+</sql-statement>
+<sql-statement>
+DROP TABLE ceil_floor_round;
+</sql-statement>
+<sql-statement>
+-- Check rounding, it should round ties away from zero.
+SELECT i as pow,
+ round((-2.5 * 10 ^ i)::numeric, -i),
+ round((-1.5 * 10 ^ i)::numeric, -i),
+ round((-0.5 * 10 ^ i)::numeric, -i),
+ round((0.5 * 10 ^ i)::numeric, -i),
+ round((1.5 * 10 ^ i)::numeric, -i),
+ round((2.5 * 10 ^ i)::numeric, -i)
+FROM generate_series(-5,5) AS t(i);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Check rounding, it should round ties away from zero.
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: round
+ -- Check rounding, it should round ties away from zero.
+ ^
+<sql-statement>
+-- Testing for width_bucket(). For convenience, we test both the
+-- numeric and float8 versions of the function in this file.
+-- errors
+SELECT width_bucket(5.0, 3.0, 4.0, 0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Testing for width_bucket(). For convenience, we test both the
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: count must be greater than zero
+
+ -- Testing for width_bucket(). For convenience, we test both the
+ ^
+<sql-statement>
+SELECT width_bucket(5.0, 3.0, 4.0, -5);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(5.0, 3.0, 4.0, -5);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: count must be greater than zero
+
+ SELECT width_bucket(5.0, 3.0, 4.0, -5);
+ ^
+<sql-statement>
+SELECT width_bucket(3.5, 3.0, 3.0, 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(3.5, 3.0, 3.0, 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower bound cannot equal upper bound
+
+ SELECT width_bucket(3.5, 3.0, 3.0, 888);
+ ^
+<sql-statement>
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: count must be greater than zero
+
+ SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+ ^
+<sql-statement>
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: count must be greater than zero
+
+ SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+ ^
+<sql-statement>
+SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower bound cannot equal upper bound
+
+ SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+ ^
+<sql-statement>
+SELECT width_bucket('NaN', 3.0, 4.0, 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket('NaN', 3.0, 4.0, 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: operand, lower bound, and upper bound cannot be NaN
+
+ SELECT width_bucket('NaN', 3.0, 4.0, 888);
+ ^
+<sql-statement>
+SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: operand, lower bound, and upper bound cannot be NaN
+
+ SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+ ^
+<sql-statement>
+SELECT width_bucket(2.0, 3.0, '-inf', 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(2.0, 3.0, '-inf', 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ SELECT width_bucket(2.0, 3.0, '-inf', 888);
+ ^
+<sql-statement>
+SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+ ^
+<sql-statement>
+-- normal operation
+CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
+</sql-statement>
+<sql-statement>
+COPY width_bucket_test (operand_num) FROM stdin;
+-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
+\.
+</sql-statement>
+Metacommand \. is not supported
+<sql-statement>
+UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
+</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
+ operand_num,
+ width_bucket(operand_num, 0, 10, 5) AS wb_1,
+ width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
+ width_bucket(operand_num, 10, 0, 5) AS wb_2,
+ width_bucket(operand_f8, 10, 0, 5) AS wb_2f,
+ width_bucket(operand_num, 2, 8, 4) AS wb_3,
+ width_bucket(operand_f8, 2, 8, 4) AS wb_3f,
+ width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4,
+ width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f,
+ width_bucket(operand_num, -25, 25, 10) AS wb_5,
+ width_bucket(operand_f8, -25, 25, 10) AS wb_5f
+ FROM width_bucket_test;
+</sql-statement>
+<sql-statement>
+-- Check positive and negative infinity: we require
+-- finite bucket bounds, but allow an infinite operand
+SELECT width_bucket(0.0::numeric, 'Infinity'::numeric, 5, 10); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Check positive and negative infinity: we require
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ -- Check positive and negative infinity: we require
+ ^
+<sql-statement>
+SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+ ^
+<sql-statement>
+SELECT width_bucket('Infinity'::numeric, 1, 10, 10),
+ width_bucket('-Infinity'::numeric, 1, 10, 10);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT width_bucket('Infinity'::numeric, 1, 10, 10),
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: width_bucket
+ SELECT width_bucket('Infinity'::numeric, 1, 10, 10),
+ ^
+<sql-statement>
+SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+ ^
+<sql-statement>
+SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: lower and upper bounds must be finite
+
+ SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+ ^
+<sql-statement>
+SELECT width_bucket('Infinity'::float8, 1, 10, 10),
+ width_bucket('-Infinity'::float8, 1, 10, 10);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT width_bucket('Infinity'::float8, 1, 10, 10),
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: width_bucket
+ SELECT width_bucket('Infinity'::float8, 1, 10, 10),
+ ^
+<sql-statement>
+DROP TABLE width_bucket_test;
+</sql-statement>
+<sql-statement>
+-- Simple test for roundoff error when results should be exact
+SELECT x, width_bucket(x::float8, 10, 100, 9) as flt,
+ width_bucket(x::numeric, 10, 100, 9) as num
+FROM generate_series(0, 110, 10) x;
+</sql-statement>
+<sql-statement>
+SELECT x, width_bucket(x::float8, 100, 10, 9) as flt,
+ width_bucket(x::numeric, 100, 10, 9) as num
+FROM generate_series(0, 110, 10) x;
+</sql-statement>
+<sql-statement>
+--
+-- TO_CHAR()
+--
+SELECT to_char(val, '9G999G999G999G999G999')
+ FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '9G999G999G999G999G999D999G999G999G999G999')
+ FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '9999999999999999.999999999999999PR')
+ FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '9999999999999999.999999999999999S')
+ FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FMS9999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'SG9999999999999999.999999999999999th') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '0999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'S0999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM0999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999999999999.099999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '999999SG9999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
+</sql-statement>
+<sql-statement>
+SELECT to_char(val, '9.999EEEE') FROM num_data;
+</sql-statement>
+<sql-statement>
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, '9.999EEEE') as numeric,
+ to_char(val::float8, '9.999EEEE') as float8,
+ to_char(val::float4, '9.999EEEE') as float4
+FROM v;
+</sql-statement>
+<sql-statement>
+WITH v(exp) AS
+ (VALUES(-16379),(-16378),(-1234),(-789),(-45),(-5),(-4),(-3),(-2),(-1),(0),
+ (1),(2),(3),(4),(5),(38),(275),(2345),(45678),(131070),(131071))
+SELECT exp,
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+FROM v;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ WITH v(exp) AS
+ ^
+ -stdin-:<main>:5:3: Error: At function: PgCall
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+ ^
+ -stdin-:<main>:5:29: Error: At function: PgCast
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+ ^
+ -stdin-:<main>:5:21: Error: At function: PgOp
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+ ^
+ -stdin-:<main>:5:21: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+ ^
+<sql-statement>
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI9999999999.99') as numeric,
+ to_char(val::float8, 'MI9999999999.99') as float8,
+ to_char(val::float4, 'MI9999999999.99') as float4
+FROM v;
+</sql-statement>
+<sql-statement>
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI99.99') as numeric,
+ to_char(val::float8, 'MI99.99') as float8,
+ to_char(val::float4, 'MI99.99') as float4
+FROM v;
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'FM999.9');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'FM999.');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'FM999');
+</sql-statement>
+<sql-statement>
+-- Check parsing of literal text in a format string
+SELECT to_char('100'::numeric, 'foo999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f\oo999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f\\oo999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f\"oo999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f\\"oo999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f"ool"999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f"\ool"999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f"\\ool"999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f"ool\"999');
+</sql-statement>
+<sql-statement>
+SELECT to_char('100'::numeric, 'f"ool\\"999');
+</sql-statement>
+<sql-statement>
+-- TO_NUMBER()
+--
+SET lc_numeric = 'C';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: lc_numeric
+ -- TO_NUMBER()
+ ^
+<sql-statement>
+SELECT to_number('-34,338,492', '99G999G999');
+</sql-statement>
+<sql-statement>
+SELECT to_number('-34,338,492.654,878', '99G999G999D999G999');
+</sql-statement>
+<sql-statement>
+SELECT to_number('<564646.654564>', '999999.999999PR');
+</sql-statement>
+<sql-statement>
+SELECT to_number('0.00001-', '9.999999S');
+</sql-statement>
+<sql-statement>
+SELECT to_number('5.01-', 'FM9.999999S');
+</sql-statement>
+<sql-statement>
+SELECT to_number('5.01-', 'FM9.999999MI');
+</sql-statement>
+<sql-statement>
+SELECT to_number('5 4 4 4 4 8 . 7 8', '9 9 9 9 9 9 . 9 9');
+</sql-statement>
+<sql-statement>
+SELECT to_number('.01', 'FM9.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('.0', '99999999.99999999');
+</sql-statement>
+<sql-statement>
+SELECT to_number('0', '99.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('.-01', 'S99.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('.01-', '99.99S');
+</sql-statement>
+<sql-statement>
+SELECT to_number(' . 0 1-', ' 9 9 . 9 9 S');
+</sql-statement>
+<sql-statement>
+SELECT to_number('34,50','999,99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('123,000','999G');
+</sql-statement>
+<sql-statement>
+SELECT to_number('123456','999G999');
+</sql-statement>
+<sql-statement>
+SELECT to_number('$1234.56','L9,999.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('$1234.56','L99,999.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('$1,234.56','L99,999.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('1234.56','L99,999.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('1,234.56','L99,999.99');
+</sql-statement>
+<sql-statement>
+SELECT to_number('42nd', '99th');
+</sql-statement>
+<sql-statement>
+RESET lc_numeric;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET lc_numeric;
+ ^
+<sql-statement>
+--
+-- Input syntax
+--
+CREATE TABLE num_input_test (n1 numeric);
+</sql-statement>
+<sql-statement>
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' nan');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' inf ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' +inf ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' -inf ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' Infinity ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' +inFinity ');
+</sql-statement>
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' -INFINITY ');
+</sql-statement>
+<sql-statement>
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: " "
+
+ -- bad inputs
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: " 1234 %"
+
+ INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('xyz');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "xyz"
+
+ INSERT INTO num_input_test(n1) VALUES ('xyz');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "- 1234"
+
+ INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "5 . 0"
+
+ INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "5. 0 "
+
+ INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: ""
+
+ INSERT INTO num_input_test(n1) VALUES ('');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: " N aN "
+
+ INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ ^
+<sql-statement>
+INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "+ infinity"
+
+ INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ ^
+<sql-statement>
+SELECT * FROM num_input_test;
+</sql-statement>
+<sql-statement>
+--
+-- Test some corner cases for multiplication
+--
+select 4790999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+</sql-statement>
+<sql-statement>
+select 4789999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+</sql-statement>
+<sql-statement>
+select 4770999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+</sql-statement>
+<sql-statement>
+select 4769999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+</sql-statement>
+<sql-statement>
+select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383));
+</sql-statement>
+<sql-statement>
+--
+-- Test some corner cases for division
+--
+select 999999999999999999999::numeric/1000000000000000000000;
+</sql-statement>
+<sql-statement>
+select div(999999999999999999999::numeric,1000000000000000000000);
+</sql-statement>
+<sql-statement>
+select mod(999999999999999999999::numeric,1000000000000000000000);
+</sql-statement>
+<sql-statement>
+select div(-9999999999999999999999::numeric,1000000000000000000000);
+</sql-statement>
+<sql-statement>
+select mod(-9999999999999999999999::numeric,1000000000000000000000);
+</sql-statement>
+<sql-statement>
+select div(-9999999999999999999999::numeric,1000000000000000000000)*1000000000000000000000 + mod(-9999999999999999999999::numeric,1000000000000000000000);
+</sql-statement>
+<sql-statement>
+select mod (70.0,70) ;
+</sql-statement>
+<sql-statement>
+select div (70.0,70) ;
+</sql-statement>
+<sql-statement>
+select 70.0 / 70 ;
+</sql-statement>
+<sql-statement>
+select 12345678901234567890 % 123;
+</sql-statement>
+<sql-statement>
+select 12345678901234567890 / 123;
+</sql-statement>
+<sql-statement>
+select div(12345678901234567890, 123);
+</sql-statement>
+<sql-statement>
+select div(12345678901234567890, 123) * 123 + 12345678901234567890 % 123;
+</sql-statement>
+<sql-statement>
+--
+-- Test some corner cases for square root
+--
+select sqrt(1.000000000000003::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(1.000000000000004::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(96627521408608.56340355805::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(96627521408608.56340355806::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(515549506212297735.073688290367::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(515549506212297735.073688290368::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(8015491789940783531003294973900306::numeric);
+</sql-statement>
+<sql-statement>
+select sqrt(8015491789940783531003294973900307::numeric);
+</sql-statement>
+<sql-statement>
+--
+-- Test code path for raising to integer powers
+--
+select 10.0 ^ -2147483648 as rounds_to_zero;
+</sql-statement>
+<sql-statement>
+select 10.0 ^ -2147483647 as rounds_to_zero;
+</sql-statement>
+<sql-statement>
+select 10.0 ^ 2147483647 as overflows;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select 10.0 ^ 2147483647 as overflows;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
+
+ select 10.0 ^ 2147483647 as overflows;
+ ^
+<sql-statement>
+select 117743296169.0 ^ 1000000000 as overflows;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select 117743296169.0 ^ 1000000000 as overflows;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
+
+ select 117743296169.0 ^ 1000000000 as overflows;
+ ^
+<sql-statement>
+-- cases that used to return inaccurate results
+select 3.789 ^ 21;
+</sql-statement>
+<sql-statement>
+select 3.789 ^ 35;
+</sql-statement>
+<sql-statement>
+select 1.2 ^ 345;
+</sql-statement>
+<sql-statement>
+select 0.12 ^ (-20);
+</sql-statement>
+<sql-statement>
+select 1.000000000123 ^ (-2147483648);
+</sql-statement>
+<sql-statement>
+select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
+</sql-statement>
+<sql-statement>
+select round(((1 - 1.500012345678e-1000) ^ 1.45e1003) * 1e1000);
+</sql-statement>
+<sql-statement>
+-- cases that used to error out
+select 0.12 ^ (-25);
+</sql-statement>
+<sql-statement>
+select 0.5678 ^ (-85);
+</sql-statement>
+<sql-statement>
+select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
+</sql-statement>
+<sql-statement>
+-- negative base to integer powers
+select (-1.0) ^ 2147483646;
+</sql-statement>
+<sql-statement>
+select (-1.0) ^ 2147483647;
+</sql-statement>
+<sql-statement>
+select (-1.0) ^ 2147483648;
+</sql-statement>
+<sql-statement>
+select (-1.0) ^ 1000000000000000;
+</sql-statement>
+<sql-statement>
+select (-1.0) ^ 1000000000000001;
+</sql-statement>
+<sql-statement>
+--
+-- Tests for raising to non-integer powers
+--
+-- special cases
+select 0.0 ^ 0.0;
+</sql-statement>
+<sql-statement>
+select (-12.34) ^ 0.0;
+</sql-statement>
+<sql-statement>
+select 12.34 ^ 0.0;
+</sql-statement>
+<sql-statement>
+select 0.0 ^ 12.34;
+</sql-statement>
+<sql-statement>
+-- NaNs
+select 'NaN'::numeric ^ 'NaN'::numeric;
+</sql-statement>
+<sql-statement>
+select 'NaN'::numeric ^ 0;
+</sql-statement>
+<sql-statement>
+select 'NaN'::numeric ^ 1;
+</sql-statement>
+<sql-statement>
+select 0 ^ 'NaN'::numeric;
+</sql-statement>
+<sql-statement>
+select 1 ^ 'NaN'::numeric;
+</sql-statement>
+<sql-statement>
+-- invalid inputs
+select 0.0 ^ (-12.34);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- invalid inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: zero raised to a negative power is undefined
+
+ -- invalid inputs
+ ^
+<sql-statement>
+select (-12.34) ^ 1.2;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select (-12.34) ^ 1.2;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: a negative number raised to a non-integer power yields a complex result
+
+ select (-12.34) ^ 1.2;
+ ^
+<sql-statement>
+-- cases that used to generate inaccurate results
+select 32.1 ^ 9.8;
+</sql-statement>
+<sql-statement>
+select 32.1 ^ (-9.8);
+</sql-statement>
+<sql-statement>
+select 12.3 ^ 45.6;
+</sql-statement>
+<sql-statement>
+select 12.3 ^ (-45.6);
+</sql-statement>
+<sql-statement>
+-- big test
+select 1.234 ^ 5678;
+</sql-statement>
+<sql-statement>
+--
+-- Tests for EXP()
+--
+-- special cases
+select exp(0.0);
+</sql-statement>
+<sql-statement>
+select exp(1.0);
+</sql-statement>
+<sql-statement>
+select exp(1.0::numeric(71,70));
+</sql-statement>
+<sql-statement>
+select exp('nan'::numeric);
+</sql-statement>
+<sql-statement>
+select exp('inf'::numeric);
+</sql-statement>
+<sql-statement>
+select exp('-inf'::numeric);
+</sql-statement>
+<sql-statement>
+select coalesce(nullif(exp(-5000::numeric), 0), 0) as rounds_to_zero;
+</sql-statement>
+<sql-statement>
+select coalesce(nullif(exp(-10000::numeric), 0), 0) as underflows;
+</sql-statement>
+<sql-statement>
+-- cases that used to generate inaccurate results
+select exp(32.999);
+</sql-statement>
+<sql-statement>
+select exp(-32.999);
+</sql-statement>
+<sql-statement>
+select exp(123.456);
+</sql-statement>
+<sql-statement>
+select exp(-123.456);
+</sql-statement>
+<sql-statement>
+-- big test
+select exp(1234.5678);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for generate_series
+--
+select * from generate_series(0.0::numeric, 4.0::numeric);
+</sql-statement>
+<sql-statement>
+select * from generate_series(0.1::numeric, 4.0::numeric, 1.3::numeric);
+</sql-statement>
+<sql-statement>
+select * from generate_series(4.0::numeric, -1.5::numeric, -2.2::numeric);
+</sql-statement>
+<sql-statement>
+-- Trigger errors
+select * from generate_series(-100::numeric, 100::numeric, 0::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Trigger errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot equal zero
+
+ -- Trigger errors
+ ^
+<sql-statement>
+select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot be NaN
+
+ select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+ ^
+<sql-statement>
+select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: start value cannot be NaN
+
+ select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+ ^
+<sql-statement>
+select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stop value cannot be NaN
+
+ select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+ ^
+<sql-statement>
+select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: start value cannot be infinity
+
+ select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+ ^
+<sql-statement>
+select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stop value cannot be infinity
+
+ select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+ ^
+<sql-statement>
+select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot be infinity
+
+ select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+ ^
+<sql-statement>
+-- Checks maximum, output is truncated
+select (i / (10::numeric ^ 131071))::numeric(1,0)
+ from generate_series(6 * (10::numeric ^ 131071),
+ 9 * (10::numeric ^ 131071),
+ 10::numeric ^ 131071) as a(i);
+</sql-statement>
+<sql-statement>
+-- Check usage with variables
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(i,3) j;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:74: Error: Columns are not allowed in: RANGE FUNCTION
+ select * from generate_series(1::numeric, 3::numeric) i, generate_series(i,3) j;
+ ^
+<sql-statement>
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,i) j;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:76: Error: Columns are not allowed in: RANGE FUNCTION
+ select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,i) j;
+ ^
+<sql-statement>
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,5,i) j;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:78: Error: Columns are not allowed in: RANGE FUNCTION
+ select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,5,i) j;
+ ^
+<sql-statement>
+--
+-- Tests for LN()
+--
+-- Invalid inputs
+select ln(-12.34);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ --
+ ^
+<sql-statement>
+select ln(0.0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select ln(0.0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ select ln(0.0);
+ ^
+<sql-statement>
+-- Some random tests
+select ln(1.2345678e-28);
+</sql-statement>
+<sql-statement>
+select ln(0.0456789);
+</sql-statement>
+<sql-statement>
+select ln(0.349873948359354029493948309745709580730482050975);
+</sql-statement>
+<sql-statement>
+select ln(0.99949452);
+</sql-statement>
+<sql-statement>
+select ln(1.00049687395);
+</sql-statement>
+<sql-statement>
+select ln(1234.567890123456789);
+</sql-statement>
+<sql-statement>
+select ln(5.80397490724e5);
+</sql-statement>
+<sql-statement>
+select ln(9.342536355e34);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for LOG() (base 10)
+--
+-- invalid inputs
+select log(-12.34);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ --
+ ^
+<sql-statement>
+select log(0.0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(0.0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ select log(0.0);
+ ^
+<sql-statement>
+-- some random tests
+select log(1.234567e-89);
+</sql-statement>
+<sql-statement>
+select log(3.4634998359873254962349856073435545);
+</sql-statement>
+<sql-statement>
+select log(9.999999999999999999);
+</sql-statement>
+<sql-statement>
+select log(10.00000000000000000);
+</sql-statement>
+<sql-statement>
+select log(10.00000000000000001);
+</sql-statement>
+<sql-statement>
+select log(590489.45235237);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for LOG() (arbitrary base)
+--
+-- invalid inputs
+select log(-12.34, 56.78);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ --
+ ^
+<sql-statement>
+select log(-12.34, -56.78);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(-12.34, -56.78);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ select log(-12.34, -56.78);
+ ^
+<sql-statement>
+select log(12.34, -56.78);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(12.34, -56.78);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of a negative number
+
+ select log(12.34, -56.78);
+ ^
+<sql-statement>
+select log(0.0, 12.34);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(0.0, 12.34);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ select log(0.0, 12.34);
+ ^
+<sql-statement>
+select log(12.34, 0.0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(12.34, 0.0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot take logarithm of zero
+
+ select log(12.34, 0.0);
+ ^
+<sql-statement>
+select log(1.0, 12.34);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select log(1.0, 12.34);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: division by zero
+
+ select log(1.0, 12.34);
+ ^
+<sql-statement>
+-- some random tests
+select log(1.23e-89, 6.4689e45);
+</sql-statement>
+<sql-statement>
+select log(0.99923, 4.58934e34);
+</sql-statement>
+<sql-statement>
+select log(1.000016, 8.452010e18);
+</sql-statement>
+<sql-statement>
+select log(3.1954752e47, 9.4792021e-73);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for scale()
+--
+select scale(numeric 'NaN');
+</sql-statement>
+<sql-statement>
+select scale(numeric 'inf');
+</sql-statement>
+<sql-statement>
+select scale(NULL::numeric);
+</sql-statement>
+<sql-statement>
+select scale(1.12);
+</sql-statement>
+<sql-statement>
+select scale(0);
+</sql-statement>
+<sql-statement>
+select scale(0.00);
+</sql-statement>
+<sql-statement>
+select scale(1.12345);
+</sql-statement>
+<sql-statement>
+select scale(110123.12475871856128);
+</sql-statement>
+<sql-statement>
+select scale(-1123.12471856128);
+</sql-statement>
+<sql-statement>
+select scale(-13.000000000000000);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for min_scale()
+--
+select min_scale(numeric 'NaN') is NULL; -- should be true
+</sql-statement>
+<sql-statement>
+select min_scale(numeric 'inf') is NULL; -- should be true
+</sql-statement>
+<sql-statement>
+select min_scale(0); -- no digits
+</sql-statement>
+<sql-statement>
+select min_scale(0.00); -- no digits again
+</sql-statement>
+<sql-statement>
+select min_scale(1.0); -- no scale
+</sql-statement>
+<sql-statement>
+select min_scale(1.1); -- scale 1
+</sql-statement>
+<sql-statement>
+select min_scale(1.12); -- scale 2
+</sql-statement>
+<sql-statement>
+select min_scale(1.123); -- scale 3
+</sql-statement>
+<sql-statement>
+select min_scale(1.1234); -- scale 4, filled digit
+</sql-statement>
+<sql-statement>
+select min_scale(1.12345); -- scale 5, 2 NDIGITS
+</sql-statement>
+<sql-statement>
+select min_scale(1.1000); -- 1 pos in NDIGITS
+</sql-statement>
+<sql-statement>
+select min_scale(1e100); -- very big number
+</sql-statement>
+<sql-statement>
+--
+-- Tests for trim_scale()
+--
+select trim_scale(numeric 'NaN');
+</sql-statement>
+<sql-statement>
+select trim_scale(numeric 'inf');
+</sql-statement>
+<sql-statement>
+select trim_scale(1.120);
+</sql-statement>
+<sql-statement>
+select trim_scale(0);
+</sql-statement>
+<sql-statement>
+select trim_scale(0.00);
+</sql-statement>
+<sql-statement>
+select trim_scale(1.1234500);
+</sql-statement>
+<sql-statement>
+select trim_scale(110123.12475871856128000);
+</sql-statement>
+<sql-statement>
+select trim_scale(-1123.124718561280000000);
+</sql-statement>
+<sql-statement>
+select trim_scale(-13.00000000000000000000);
+</sql-statement>
+<sql-statement>
+select trim_scale(1e100);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for SUM()
+--
+-- cases that need carry propagation
+SELECT SUM(9999::numeric) FROM generate_series(1, 100000);
+</sql-statement>
+<sql-statement>
+SELECT SUM((-9999)::numeric) FROM generate_series(1, 100000);
+</sql-statement>
+<sql-statement>
+--
+-- Tests for GCD()
+--
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(-b, a), gcd(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 46375::numeric),
+ (433125::numeric, 46375::numeric),
+ (43312.5::numeric, 4637.5::numeric),
+ (4331.250::numeric, 463.75000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: gcd
+ --
+ ^
+<sql-statement>
+--
+-- Tests for LCM()
+--
+SELECT a,b, lcm(a, b), lcm(a, -b), lcm(-b, a), lcm(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 13272::numeric),
+ (13272::numeric, 13272::numeric),
+ (423282::numeric, 13272::numeric),
+ (42328.2::numeric, 1327.2::numeric),
+ (4232.820::numeric, 132.72000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: lcm
+ --
+ ^
+<sql-statement>
+SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
+
+ SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+ ^
+<sql-statement>
+--
+-- Tests for factorial
+--
+SELECT factorial(4);
+</sql-statement>
+<sql-statement>
+SELECT factorial(15);
+</sql-statement>
+<sql-statement>
+SELECT factorial(100000);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT factorial(100000);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value overflows numeric format
+
+ SELECT factorial(100000);
+ ^
+<sql-statement>
+SELECT factorial(0);
+</sql-statement>
+<sql-statement>
+SELECT factorial(-4);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT factorial(-4);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: factorial of a negative number is undefined
+
+ SELECT factorial(-4);
+ ^
+<sql-statement>
+--
+-- Tests for pg_lsn()
+--
+SELECT pg_lsn(23783416::numeric);
+</sql-statement>
+<sql-statement>
+SELECT pg_lsn(0::numeric);
+</sql-statement>
+<sql-statement>
+SELECT pg_lsn(18446744073709551615::numeric);
+</sql-statement>
+<sql-statement>
+SELECT pg_lsn(-1::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_lsn(-1::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: pg_lsn out of range
+
+ SELECT pg_lsn(-1::numeric);
+ ^
+<sql-statement>
+SELECT pg_lsn(18446744073709551616::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_lsn(18446744073709551616::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: pg_lsn out of range
+
+ SELECT pg_lsn(18446744073709551616::numeric);
+ ^
+<sql-statement>
+SELECT pg_lsn('NaN'::numeric);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_lsn('NaN'::numeric);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: cannot convert NaN to pg_lsn
+
+ SELECT pg_lsn('NaN'::numeric);
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/numeric.out b/yql/essentials/tests/postgresql/cases/numeric.out
new file mode 100644
index 0000000000..e9970b3d37
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numeric.out
@@ -0,0 +1,2383 @@
+--
+-- NUMERIC
+--
+CREATE TABLE num_data (id int4, val numeric(210,10));
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+BEGIN TRANSACTION;
+INSERT INTO num_exp_add VALUES (0,0,'0');
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+INSERT INTO num_exp_add VALUES (0,1,'0');
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+INSERT INTO num_exp_div VALUES (0,2,'0');
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+INSERT INTO num_exp_div VALUES (0,3,'0');
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+INSERT INTO num_exp_div VALUES (0,4,'0');
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+INSERT INTO num_exp_div VALUES (0,5,'0');
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+INSERT INTO num_exp_div VALUES (0,6,'0');
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+INSERT INTO num_exp_div VALUES (0,7,'0');
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+INSERT INTO num_exp_div VALUES (0,8,'0');
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+INSERT INTO num_exp_div VALUES (0,9,'0');
+INSERT INTO num_exp_add VALUES (1,0,'0');
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+INSERT INTO num_exp_add VALUES (1,1,'0');
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+INSERT INTO num_exp_div VALUES (1,2,'0');
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+INSERT INTO num_exp_div VALUES (1,3,'0');
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+INSERT INTO num_exp_div VALUES (1,4,'0');
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+INSERT INTO num_exp_div VALUES (1,5,'0');
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+INSERT INTO num_exp_div VALUES (1,6,'0');
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+INSERT INTO num_exp_div VALUES (1,7,'0');
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+INSERT INTO num_exp_div VALUES (1,8,'0');
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+INSERT INTO num_exp_div VALUES (1,9,'0');
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_data VALUES (0, '0');
+INSERT INTO num_data VALUES (1, '0');
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+INSERT INTO num_data VALUES (3, '4.31');
+INSERT INTO num_data VALUES (4, '7799461.4119');
+INSERT INTO num_data VALUES (5, '16397.038491');
+INSERT INTO num_data VALUES (6, '93901.57763026');
+INSERT INTO num_data VALUES (7, '-83028485');
+INSERT INTO num_data VALUES (8, '74881');
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+COMMIT TRANSACTION;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 10);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 40);
+ id1 | id2 | result | round
+-----+-----+--------+-------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 30);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 80);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+ FROM num_data;
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+INSERT INTO num_result SELECT id, 0, LOG(numeric '10', ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT 'inf'::numeric / '0';
+ERROR: division by zero
+SELECT '-inf'::numeric / '0';
+ERROR: division by zero
+SELECT 'nan'::numeric / '0';
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '0'::numeric / '0';
+ERROR: division by zero
+SELECT 'inf'::numeric % '0';
+ERROR: division by zero
+SELECT '-inf'::numeric % '0';
+ERROR: division by zero
+SELECT 'nan'::numeric % '0';
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '0'::numeric % '0';
+ERROR: division by zero
+SELECT div('inf'::numeric, '0');
+ERROR: division by zero
+SELECT div('-inf'::numeric, '0');
+ERROR: division by zero
+SELECT div('nan'::numeric, '0');
+ div
+-----
+ NaN
+(1 row)
+
+SELECT div('0'::numeric, '0');
+ERROR: division by zero
+-- the large values fall into the numeric abbreviation code's maximal classes
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
+ ('inf'),('-inf'),('nan'),
+ ('inf'),('-inf'),('nan'))
+SELECT substring(x::text, 1, 32)
+FROM v ORDER BY x;
+ substring
+----------------------------------
+ -Infinity
+ -Infinity
+ -1000000000000000000000000000000
+ -7.777
+ -1
+ 0
+ 1
+ 4.2
+ 10000000000000000000000000000000
+ Infinity
+ Infinity
+ NaN
+ NaN
+(13 rows)
+
+SELECT sqrt('-1'::numeric);
+ERROR: cannot take square root of a negative number
+SELECT sqrt('-inf'::numeric);
+ERROR: cannot take square root of a negative number
+SELECT ln('0'::numeric);
+ERROR: cannot take logarithm of zero
+SELECT ln('-1'::numeric);
+ERROR: cannot take logarithm of a negative number
+SELECT ln('-inf'::numeric);
+ERROR: cannot take logarithm of a negative number
+SELECT log('0'::numeric, '10');
+ERROR: cannot take logarithm of zero
+SELECT log('10'::numeric, '0');
+ERROR: cannot take logarithm of zero
+SELECT log('-inf'::numeric, '10');
+ERROR: cannot take logarithm of a negative number
+SELECT log('10'::numeric, '-inf');
+ERROR: cannot take logarithm of a negative number
+SELECT log('inf'::numeric, '0');
+ERROR: cannot take logarithm of zero
+SELECT log('inf'::numeric, '-inf');
+ERROR: cannot take logarithm of a negative number
+SELECT log('-inf'::numeric, 'inf');
+ERROR: cannot take logarithm of a negative number
+SELECT power('0'::numeric, '-1');
+ERROR: zero raised to a negative power is undefined
+SELECT power('0'::numeric, '-inf');
+ERROR: zero raised to a negative power is undefined
+SELECT power('-1'::numeric, 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power('-2'::numeric, '3');
+ power
+---------------------
+ -8.0000000000000000
+(1 row)
+
+SELECT power('-2'::numeric, '3.3');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-2'::numeric, '-1');
+ power
+---------------------
+ -0.5000000000000000
+(1 row)
+
+SELECT power('-2'::numeric, '-1.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-2'::numeric, 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '3');
+ power
+-----------
+ -Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '4.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-inf'::numeric, '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power('-inf'::numeric, 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+-- ******************************
+-- * miscellaneous checks for things that have been broken in the past...
+-- ******************************
+-- numeric AVG used to fail on some platforms
+SELECT AVG(val) FROM num_data;
+ avg
+------------------------
+ -13430913.592242320700
+(1 row)
+
+-- Check for appropriate rounding and overflow
+CREATE TABLE fract_only (id int, val numeric(4,4));
+INSERT INTO fract_only VALUES (1, '0.0');
+INSERT INTO fract_only VALUES (2, '0.1');
+INSERT INTO fract_only VALUES (4, '-0.9999');
+INSERT INTO fract_only VALUES (5, '0.99994');
+INSERT INTO fract_only VALUES (7, '0.00001');
+INSERT INTO fract_only VALUES (8, '0.00017');
+INSERT INTO fract_only VALUES (9, 'NaN');
+DROP TABLE fract_only;
+-- Check conversion to integers
+SELECT (-9223372036854775808.5)::int8; -- should fail
+ERROR: bigint out of range
+SELECT (-9223372036854775808.4)::int8; -- ok
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT 9223372036854775807.4::int8; -- ok
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+SELECT 9223372036854775807.5::int8; -- should fail
+ERROR: bigint out of range
+SELECT (-2147483648.5)::int4; -- should fail
+ERROR: integer out of range
+SELECT (-2147483648.4)::int4; -- ok
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT 2147483647.4::int4; -- ok
+ int4
+------------
+ 2147483647
+(1 row)
+
+SELECT 2147483647.5::int4; -- should fail
+ERROR: integer out of range
+SELECT (-32768.5)::int2; -- should fail
+ERROR: smallint out of range
+SELECT (-32768.4)::int2; -- ok
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT 32767.4::int2; -- ok
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT 32767.5::int2; -- should fail
+ERROR: smallint out of range
+-- Check inf/nan conversion behavior
+SELECT 'NaN'::float8::numeric;
+ numeric
+---------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::float8::numeric;
+ numeric
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::float8::numeric;
+ numeric
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::numeric::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::numeric::float8;
+ float8
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::numeric::float8;
+ float8
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::float4::numeric;
+ numeric
+---------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::float4::numeric;
+ numeric
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::float4::numeric;
+ numeric
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::numeric::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::numeric::float4;
+ float4
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::numeric::float4;
+ float4
+-----------
+ -Infinity
+(1 row)
+
+SELECT '42'::int2::numeric;
+ numeric
+---------
+ 42
+(1 row)
+
+SELECT 'NaN'::numeric::int2;
+ERROR: cannot convert NaN to smallint
+SELECT 'Infinity'::numeric::int2;
+ERROR: cannot convert infinity to smallint
+SELECT '-Infinity'::numeric::int2;
+ERROR: cannot convert infinity to smallint
+SELECT 'NaN'::numeric::int4;
+ERROR: cannot convert NaN to integer
+SELECT 'Infinity'::numeric::int4;
+ERROR: cannot convert infinity to integer
+SELECT '-Infinity'::numeric::int4;
+ERROR: cannot convert infinity to integer
+SELECT 'NaN'::numeric::int8;
+ERROR: cannot convert NaN to bigint
+SELECT 'Infinity'::numeric::int8;
+ERROR: cannot convert infinity to bigint
+SELECT '-Infinity'::numeric::int8;
+ERROR: cannot convert infinity to bigint
+-- Simple check that ceil(), floor(), and round() work correctly
+CREATE TABLE ceil_floor_round (a numeric);
+INSERT INTO ceil_floor_round VALUES ('-5.5');
+INSERT INTO ceil_floor_round VALUES ('-5.499999');
+INSERT INTO ceil_floor_round VALUES ('9.5');
+INSERT INTO ceil_floor_round VALUES ('9.4999999');
+INSERT INTO ceil_floor_round VALUES ('0.0');
+INSERT INTO ceil_floor_round VALUES ('0.0000001');
+INSERT INTO ceil_floor_round VALUES ('-0.000001');
+DROP TABLE ceil_floor_round;
+-- Testing for width_bucket(). For convenience, we test both the
+-- numeric and float8 versions of the function in this file.
+-- errors
+SELECT width_bucket(5.0, 3.0, 4.0, 0);
+ERROR: count must be greater than zero
+SELECT width_bucket(5.0, 3.0, 4.0, -5);
+ERROR: count must be greater than zero
+SELECT width_bucket(3.5, 3.0, 3.0, 888);
+ERROR: lower bound cannot equal upper bound
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+ERROR: count must be greater than zero
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+ERROR: count must be greater than zero
+SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+ERROR: lower bound cannot equal upper bound
+SELECT width_bucket('NaN', 3.0, 4.0, 888);
+ERROR: operand, lower bound, and upper bound cannot be NaN
+SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+ERROR: operand, lower bound, and upper bound cannot be NaN
+SELECT width_bucket(2.0, 3.0, '-inf', 888);
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+ERROR: lower and upper bounds must be finite
+-- normal operation
+CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
+-- Check positive and negative infinity: we require
+-- finite bucket bounds, but allow an infinite operand
+SELECT width_bucket(0.0::numeric, 'Infinity'::numeric, 5, 10); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+ERROR: lower and upper bounds must be finite
+DROP TABLE width_bucket_test;
+-- Simple test for roundoff error when results should be exact
+SELECT x, width_bucket(x::float8, 10, 100, 9) as flt,
+ width_bucket(x::numeric, 10, 100, 9) as num
+FROM generate_series(0, 110, 10) x;
+ x | flt | num
+-----+-----+-----
+ 0 | 0 | 0
+ 10 | 1 | 1
+ 20 | 2 | 2
+ 30 | 3 | 3
+ 40 | 4 | 4
+ 50 | 5 | 5
+ 60 | 6 | 6
+ 70 | 7 | 7
+ 80 | 8 | 8
+ 90 | 9 | 9
+ 100 | 10 | 10
+ 110 | 10 | 10
+(12 rows)
+
+SELECT x, width_bucket(x::float8, 100, 10, 9) as flt,
+ width_bucket(x::numeric, 100, 10, 9) as num
+FROM generate_series(0, 110, 10) x;
+ x | flt | num
+-----+-----+-----
+ 0 | 10 | 10
+ 10 | 10 | 10
+ 20 | 9 | 9
+ 30 | 8 | 8
+ 40 | 7 | 7
+ 50 | 6 | 6
+ 60 | 5 | 5
+ 70 | 4 | 4
+ 80 | 3 | 3
+ 90 | 2 | 2
+ 100 | 1 | 1
+ 110 | 0 | 0
+(12 rows)
+
+--
+-- TO_CHAR()
+--
+SELECT to_char(val, '9G999G999G999G999G999')
+ FROM num_data;
+ to_char
+------------------------
+ 0
+ 0
+ -34,338,492
+ 4
+ 7,799,461
+ 16,397
+ 93,902
+ -83,028,485
+ 74,881
+ -24,926,804
+(10 rows)
+
+SELECT to_char(val, '9G999G999G999G999G999D999G999G999G999G999')
+ FROM num_data;
+ to_char
+--------------------------------------------
+ .000,000,000,000,000
+ .000,000,000,000,000
+ -34,338,492.215,397,047,000,000
+ 4.310,000,000,000,000
+ 7,799,461.411,900,000,000,000
+ 16,397.038,491,000,000,000
+ 93,901.577,630,260,000,000
+ -83,028,485.000,000,000,000,000
+ 74,881.000,000,000,000,000
+ -24,926,804.045,047,420,000,000
+(10 rows)
+
+SELECT to_char(val, '9999999999999999.999999999999999PR')
+ FROM num_data;
+ to_char
+------------------------------------
+ .000000000000000
+ .000000000000000
+ <34338492.215397047000000>
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ <83028485.000000000000000>
+ 74881.000000000000000
+ <24926804.045047420000000>
+(10 rows)
+
+SELECT to_char(val, '9999999999999999.999999999999999S')
+ FROM num_data;
+ to_char
+-----------------------------------
+ .000000000000000+
+ .000000000000000+
+ 34338492.215397047000000-
+ 4.310000000000000+
+ 7799461.411900000000000+
+ 16397.038491000000000+
+ 93901.577630260000000+
+ 83028485.000000000000000-
+ 74881.000000000000000+
+ 24926804.045047420000000-
+(10 rows)
+
+SELECT to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ .000000000000000
+ .000000000000000
+ - 34338492.215397047000000
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ - 83028485.000000000000000
+ 74881.000000000000000
+ - 24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FMS9999999999999999.999999999999999') FROM num_data;
+ to_char
+---------------------
+ +0.
+ +0.
+ -34338492.215397047
+ +4.31
+ +7799461.4119
+ +16397.038491
+ +93901.57763026
+ -83028485.
+ +74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
+ to_char
+----------------------
+ 0.
+ 0.
+ <34338492.215397047>
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ <83028485.>
+ 74881.
+ <24926804.04504742>
+(10 rows)
+
+SELECT to_char(val, 'SG9999999999999999.999999999999999th') FROM num_data;
+ to_char
+-----------------------------------
+ + .000000000000000
+ + .000000000000000
+ - 34338492.215397047000000
+ + 4.310000000000000
+ + 7799461.411900000000000
+ + 16397.038491000000000
+ + 93901.577630260000000
+ - 83028485.000000000000000
+ + 74881.000000000000000
+ - 24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, '0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ 0000000000000000.000000000000000
+ 0000000000000000.000000000000000
+ -0000000034338492.215397047000000
+ 0000000000000004.310000000000000
+ 0000000007799461.411900000000000
+ 0000000000016397.038491000000000
+ 0000000000093901.577630260000000
+ -0000000083028485.000000000000000
+ 0000000000074881.000000000000000
+ -0000000024926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'S0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ +0000000000000000.000000000000000
+ +0000000000000000.000000000000000
+ -0000000034338492.215397047000000
+ +0000000000000004.310000000000000
+ +0000000007799461.411900000000000
+ +0000000000016397.038491000000000
+ +0000000000093901.577630260000000
+ -0000000083028485.000000000000000
+ +0000000000074881.000000000000000
+ -0000000024926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FM0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------
+ 0000000000000000.
+ 0000000000000000.
+ -0000000034338492.215397047
+ 0000000000000004.31
+ 0000000007799461.4119
+ 0000000000016397.038491
+ 0000000000093901.57763026
+ -0000000083028485.
+ 0000000000074881.
+ -0000000024926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.099999999999999') FROM num_data;
+ to_char
+---------------------
+ .0
+ .0
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.0
+ 74881.0
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
+ to_char
+---------------------
+ 0000.000
+ 0000.000
+ -34338492.215397047
+ 0004.310
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.000
+ 74881.000
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;
+ to_char
+-----------------------------
+ 0000000000000000.00000
+ 0000000000000000.00000
+ -0000000034338492.215397047
+ 0000000000000004.31000
+ 0000000007799461.41190
+ 0000000000016397.038491
+ 0000000000093901.57763026
+ -0000000083028485.00000
+ 0000000000074881.00000
+ -0000000024926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
+ to_char
+---------------------
+ 0000000.0
+ 0000000.0
+ -34338492.215397047
+ 0000004.31
+ 7799461.4119
+ 0016397.038491
+ 0093901.57763026
+ -83028485.0
+ 0074881.0
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
+ to_char
+------------------------------------
+ .000000000000000
+ .000000000000000
+ -34338492.215397047000000
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ -83028485.000000000000000
+ 74881.000000000000000
+ -24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
+ to_char
+---------------------
+ 0.
+ 0.
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.
+ 74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+ to_char
+-----------------------------------------------------------------------
+ +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
+ +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +1 6 3 9 7 . 0 3 8 4 9 1 0 0 0 0 0 0 0 0 0 0 0
+ +9 3 9 0 1 . 5 7 7 6 3 0 2 6 0 0 0 0 0 0 0 0 0
+ -8 3 0 2 8 4 8 5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +7 4 8 8 1 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 0 0 0 0 0 0 0 0 0
+(10 rows)
+
+SELECT to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+ to_char
+-------------------------------------------------------
+ +0 .
+ +0 .
+ -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7
+ +4 . 3 1
+ +7 7 9 9 4 6 1 . 4 1 1 9
+ +1 6 3 9 7 . 0 3 8 4 9 1
+ +9 3 9 0 1 . 5 7 7 6 3 0 2 6
+ -8 3 0 2 8 4 8 5 .
+ +7 4 8 8 1 .
+ -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
+(10 rows)
+
+SELECT to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
+ to_char
+-----------------------------------------------------------
+ text 9999 "text between quote marks" 0
+ text 9999 "text between quote marks" 0
+ text -3 9999 433 "text between quote marks" 8492
+ text 9999 "text between quote marks" 4
+ text 9999 779 "text between quote marks" 9461
+ text 9999 1 "text between quote marks" 6397
+ text 9999 9 "text between quote marks" 3902
+ text -8 9999 302 "text between quote marks" 8485
+ text 9999 7 "text between quote marks" 4881
+ text -2 9999 492 "text between quote marks" 6804
+(10 rows)
+
+SELECT to_char(val, '999999SG9999999999') FROM num_data;
+ to_char
+-------------------
+ + 0
+ + 0
+ - 34338492
+ + 4
+ + 7799461
+ + 16397
+ + 93902
+ - 83028485
+ + 74881
+ - 24926804
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
+ to_char
+---------------------
+ 0.
+ 0.
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.
+ 74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, '9.999EEEE') FROM num_data;
+ to_char
+------------
+ 0.000e+00
+ 0.000e+00
+ -3.434e+07
+ 4.310e+00
+ 7.799e+06
+ 1.640e+04
+ 9.390e+04
+ -8.303e+07
+ 7.488e+04
+ -2.493e+07
+(10 rows)
+
+SELECT to_char('100'::numeric, 'FM999.9');
+ to_char
+---------
+ 100.
+(1 row)
+
+SELECT to_char('100'::numeric, 'FM999.');
+ to_char
+---------
+ 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'FM999');
+ to_char
+---------
+ 100
+(1 row)
+
+-- Check parsing of literal text in a format string
+SELECT to_char('100'::numeric, 'foo999');
+ to_char
+---------
+ foo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\oo999');
+ to_char
+----------
+ f\oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\\oo999');
+ to_char
+-----------
+ f\\oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\"oo999');
+ to_char
+----------
+ f"oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\\"oo999');
+ to_char
+-----------
+ f\"oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool"999');
+ to_char
+----------
+ fool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"\ool"999');
+ to_char
+----------
+ fool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"\\ool"999');
+ to_char
+-----------
+ f\ool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool\"999');
+ to_char
+----------
+ fool"999
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool\\"999');
+ to_char
+-----------
+ fool\ 100
+(1 row)
+
+SELECT to_number('-34,338,492', '99G999G999');
+ to_number
+-----------
+ -34338492
+(1 row)
+
+SELECT to_number('-34,338,492.654,878', '99G999G999D999G999');
+ to_number
+------------------
+ -34338492.654878
+(1 row)
+
+SELECT to_number('<564646.654564>', '999999.999999PR');
+ to_number
+----------------
+ -564646.654564
+(1 row)
+
+SELECT to_number('0.00001-', '9.999999S');
+ to_number
+-----------
+ -0.00001
+(1 row)
+
+SELECT to_number('5.01-', 'FM9.999999S');
+ to_number
+-----------
+ -5.01
+(1 row)
+
+SELECT to_number('5.01-', 'FM9.999999MI');
+ to_number
+-----------
+ -5.01
+(1 row)
+
+SELECT to_number('5 4 4 4 4 8 . 7 8', '9 9 9 9 9 9 . 9 9');
+ to_number
+-----------
+ 544448.78
+(1 row)
+
+SELECT to_number('.01', 'FM9.99');
+ to_number
+-----------
+ 0.01
+(1 row)
+
+SELECT to_number('.0', '99999999.99999999');
+ to_number
+-----------
+ 0.0
+(1 row)
+
+SELECT to_number('.-01', 'S99.99');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number('.01-', '99.99S');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number(' . 0 1-', ' 9 9 . 9 9 S');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number('34,50','999,99');
+ to_number
+-----------
+ 3450
+(1 row)
+
+SELECT to_number('123,000','999G');
+ to_number
+-----------
+ 123
+(1 row)
+
+SELECT to_number('123456','999G999');
+ to_number
+-----------
+ 123456
+(1 row)
+
+SELECT to_number('$1234.56','L9,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('$1234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('$1,234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('1234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('1,234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('42nd', '99th');
+ to_number
+-----------
+ 42
+(1 row)
+
+--
+-- Input syntax
+--
+CREATE TABLE num_input_test (n1 numeric);
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+INSERT INTO num_input_test(n1) VALUES (' nan');
+INSERT INTO num_input_test(n1) VALUES (' inf ');
+INSERT INTO num_input_test(n1) VALUES (' +inf ');
+INSERT INTO num_input_test(n1) VALUES (' -inf ');
+INSERT INTO num_input_test(n1) VALUES (' Infinity ');
+INSERT INTO num_input_test(n1) VALUES (' +inFinity ');
+INSERT INTO num_input_test(n1) VALUES (' -INFINITY ');
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+ERROR: invalid input syntax for type numeric: " "
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' ');
+ ^
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ERROR: invalid input syntax for type numeric: " 1234 %"
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+ERROR: invalid input syntax for type numeric: "xyz"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('xyz');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ERROR: invalid input syntax for type numeric: "- 1234"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type numeric: "5 . 0"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ERROR: invalid input syntax for type numeric: "5. 0 "
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('');
+ERROR: invalid input syntax for type numeric: ""
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('');
+ ^
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ERROR: invalid input syntax for type numeric: " N aN "
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ERROR: invalid input syntax for type numeric: "+ infinity"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ ^
+SELECT * FROM num_input_test;
+ n1
+-----------
+ 123
+ 3245874
+ -93853
+ 555.50
+ -555.50
+ NaN
+ NaN
+ Infinity
+ Infinity
+ -Infinity
+ Infinity
+ Infinity
+ -Infinity
+(13 rows)
+
+select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383));
+ trim_scale
+------------
+ 0.01
+(1 row)
+
+--
+-- Test some corner cases for division
+--
+select 999999999999999999999::numeric/1000000000000000000000;
+ ?column?
+------------------------
+ 1.00000000000000000000
+(1 row)
+
+select mod(999999999999999999999::numeric,1000000000000000000000);
+ mod
+-----------------------
+ 999999999999999999999
+(1 row)
+
+select div(-9999999999999999999999::numeric,1000000000000000000000);
+ div
+-----
+ -9
+(1 row)
+
+select mod(-9999999999999999999999::numeric,1000000000000000000000);
+ mod
+------------------------
+ -999999999999999999999
+(1 row)
+
+select div(-9999999999999999999999::numeric,1000000000000000000000)*1000000000000000000000 + mod(-9999999999999999999999::numeric,1000000000000000000000);
+ ?column?
+-------------------------
+ -9999999999999999999999
+(1 row)
+
+select mod (70.0,70) ;
+ mod
+-----
+ 0.0
+(1 row)
+
+select div (70.0,70) ;
+ div
+-----
+ 1
+(1 row)
+
+select 70.0 / 70 ;
+ ?column?
+------------------------
+ 1.00000000000000000000
+(1 row)
+
+select 12345678901234567890 % 123;
+ ?column?
+----------
+ 78
+(1 row)
+
+select 12345678901234567890 / 123;
+ ?column?
+--------------------
+ 100371373180768845
+(1 row)
+
+select div(12345678901234567890, 123);
+ div
+--------------------
+ 100371373180768844
+(1 row)
+
+select div(12345678901234567890, 123) * 123 + 12345678901234567890 % 123;
+ ?column?
+----------------------
+ 12345678901234567890
+(1 row)
+
+--
+-- Test some corner cases for square root
+--
+select sqrt(1.000000000000003::numeric);
+ sqrt
+-------------------
+ 1.000000000000001
+(1 row)
+
+select sqrt(1.000000000000004::numeric);
+ sqrt
+-------------------
+ 1.000000000000002
+(1 row)
+
+select sqrt(96627521408608.56340355805::numeric);
+ sqrt
+---------------------
+ 9829929.87811248648
+(1 row)
+
+select sqrt(96627521408608.56340355806::numeric);
+ sqrt
+---------------------
+ 9829929.87811248649
+(1 row)
+
+select sqrt(515549506212297735.073688290367::numeric);
+ sqrt
+------------------------
+ 718017761.766585921184
+(1 row)
+
+select sqrt(515549506212297735.073688290368::numeric);
+ sqrt
+------------------------
+ 718017761.766585921185
+(1 row)
+
+select sqrt(8015491789940783531003294973900306::numeric);
+ sqrt
+-------------------
+ 89529278953540017
+(1 row)
+
+select sqrt(8015491789940783531003294973900307::numeric);
+ sqrt
+-------------------
+ 89529278953540018
+(1 row)
+
+--
+-- Test code path for raising to integer powers
+--
+select 10.0 ^ -2147483648 as rounds_to_zero;
+ rounds_to_zero
+--------------------
+ 0.0000000000000000
+(1 row)
+
+select 10.0 ^ -2147483647 as rounds_to_zero;
+ rounds_to_zero
+--------------------
+ 0.0000000000000000
+(1 row)
+
+select 10.0 ^ 2147483647 as overflows;
+ERROR: value overflows numeric format
+select 117743296169.0 ^ 1000000000 as overflows;
+ERROR: value overflows numeric format
+-- cases that used to return inaccurate results
+select 3.789 ^ 21;
+ ?column?
+--------------------------------
+ 1409343026052.8716016316022141
+(1 row)
+
+select 3.789 ^ 35;
+ ?column?
+----------------------------------------
+ 177158169650516670809.3820586142670135
+(1 row)
+
+select 1.2 ^ 345;
+ ?column?
+-----------------------------------------------
+ 2077446682327378559843444695.5827049735727869
+(1 row)
+
+select 0.12 ^ (-20);
+ ?column?
+--------------------------------------
+ 2608405330458882702.5529619561355838
+(1 row)
+
+select 1.000000000123 ^ (-2147483648);
+ ?column?
+--------------------
+ 0.7678656556403084
+(1 row)
+
+-- cases that used to error out
+select 0.12 ^ (-25);
+ ?column?
+-------------------------------------------
+ 104825960103961013959336.4983657883169110
+(1 row)
+
+select 0.5678 ^ (-85);
+ ?column?
+----------------------------------------
+ 782333637740774446257.7719390061997396
+(1 row)
+
+-- negative base to integer powers
+select (-1.0) ^ 2147483646;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 2147483647;
+ ?column?
+---------------------
+ -1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 2147483648;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 1000000000000000;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 1000000000000001;
+ ?column?
+---------------------
+ -1.0000000000000000
+(1 row)
+
+--
+-- Tests for raising to non-integer powers
+--
+-- special cases
+select 0.0 ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-12.34) ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select 12.34 ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select 0.0 ^ 12.34;
+ ?column?
+--------------------
+ 0.0000000000000000
+(1 row)
+
+-- NaNs
+select 'NaN'::numeric ^ 'NaN'::numeric;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 'NaN'::numeric ^ 0;
+ ?column?
+----------
+ 1
+(1 row)
+
+select 'NaN'::numeric ^ 1;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 0 ^ 'NaN'::numeric;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 1 ^ 'NaN'::numeric;
+ ?column?
+----------
+ 1
+(1 row)
+
+-- invalid inputs
+select 0.0 ^ (-12.34);
+ERROR: zero raised to a negative power is undefined
+select (-12.34) ^ 1.2;
+ERROR: a negative number raised to a non-integer power yields a complex result
+-- cases that used to generate inaccurate results
+select 32.1 ^ 9.8;
+ ?column?
+--------------------
+ 580429286790711.10
+(1 row)
+
+select 32.1 ^ (-9.8);
+ ?column?
+----------------------------------
+ 0.000000000000001722862754788209
+(1 row)
+
+select 12.3 ^ 45.6;
+ ?column?
+------------------------------------------------------
+ 50081010321492803393171165777624533697036806969694.9
+(1 row)
+
+select 12.3 ^ (-45.6);
+ ?column?
+---------------------------------------------------------------------
+ 0.00000000000000000000000000000000000000000000000001996764828785491
+(1 row)
+
+--
+-- Tests for EXP()
+--
+-- special cases
+select exp(0.0);
+ exp
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select exp(1.0);
+ exp
+--------------------
+ 2.7182818284590452
+(1 row)
+
+select exp(1.0::numeric(71,70));
+ exp
+--------------------------------------------------------------------------
+ 2.7182818284590452353602874713526624977572470936999595749669676277240766
+(1 row)
+
+select exp('nan'::numeric);
+ exp
+-----
+ NaN
+(1 row)
+
+select exp('inf'::numeric);
+ exp
+----------
+ Infinity
+(1 row)
+
+-- cases that used to generate inaccurate results
+select exp(32.999);
+ exp
+---------------------
+ 214429043492155.053
+(1 row)
+
+select exp(-32.999);
+ exp
+----------------------------------
+ 0.000000000000004663547361468248
+(1 row)
+
+select exp(123.456);
+ exp
+------------------------------------------------------------
+ 413294435277809344957685441227343146614594393746575438.725
+(1 row)
+
+select exp(-123.456);
+ exp
+-------------------------------------------------------------------------
+ 0.000000000000000000000000000000000000000000000000000002419582541264601
+(1 row)
+
+-- big test
+select exp(1234.5678);
+ exp
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 146549072930959479983482138503979804217622199675223653966270157446954995433819741094410764947112047906012815540251009949604426069672532417736057033099274204598385314594846509975629046864798765888104789074984927709616261452461385220475510438783429612447831614003668421849727379202555580791042606170523016207262965336641214601082882495255771621327088265411334088968112458492660609809762865582162764292604697957813514621259353683899630997077707406305730694385703091201347848855199354307506425820147289848677003277208302716466011827836279231.9667
+(1 row)
+
+--
+-- Tests for generate_series
+--
+select * from generate_series(0.0::numeric, 4.0::numeric);
+ generate_series
+-----------------
+ 0.0
+ 1.0
+ 2.0
+ 3.0
+ 4.0
+(5 rows)
+
+select * from generate_series(0.1::numeric, 4.0::numeric, 1.3::numeric);
+ generate_series
+-----------------
+ 0.1
+ 1.4
+ 2.7
+ 4.0
+(4 rows)
+
+select * from generate_series(4.0::numeric, -1.5::numeric, -2.2::numeric);
+ generate_series
+-----------------
+ 4.0
+ 1.8
+ -0.4
+(3 rows)
+
+-- Trigger errors
+select * from generate_series(-100::numeric, 100::numeric, 0::numeric);
+ERROR: step size cannot equal zero
+select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+ERROR: step size cannot be NaN
+select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+ERROR: start value cannot be NaN
+select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+ERROR: stop value cannot be NaN
+select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+ERROR: start value cannot be infinity
+select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+ERROR: stop value cannot be infinity
+select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+ERROR: step size cannot be infinity
+-- Checks maximum, output is truncated
+select (i / (10::numeric ^ 131071))::numeric(1,0)
+ from generate_series(6 * (10::numeric ^ 131071),
+ 9 * (10::numeric ^ 131071),
+ 10::numeric ^ 131071) as a(i);
+ numeric
+---------
+ 6
+ 7
+ 8
+ 9
+(4 rows)
+
+--
+-- Tests for LN()
+--
+-- Invalid inputs
+select ln(-12.34);
+ERROR: cannot take logarithm of a negative number
+select ln(0.0);
+ERROR: cannot take logarithm of zero
+-- Some random tests
+select ln(1.2345678e-28);
+ ln
+-----------------------------------------
+ -64.26166165451762991204894255882820859
+(1 row)
+
+select ln(0.0456789);
+ ln
+---------------------
+ -3.0861187944847439
+(1 row)
+
+select ln(0.349873948359354029493948309745709580730482050975);
+ ln
+-----------------------------------------------------
+ -1.050182336912082775693991697979750253056317885460
+(1 row)
+
+select ln(0.99949452);
+ ln
+-------------------------
+ -0.00050560779808326467
+(1 row)
+
+select ln(1.00049687395);
+ ln
+------------------------
+ 0.00049675054901370394
+(1 row)
+
+select ln(1234.567890123456789);
+ ln
+--------------------
+ 7.1184763012977896
+(1 row)
+
+select ln(5.80397490724e5);
+ ln
+--------------------
+ 13.271468476626518
+(1 row)
+
+select ln(9.342536355e34);
+ ln
+--------------------
+ 80.522470935524187
+(1 row)
+
+--
+-- Tests for LOG() (base 10)
+--
+-- invalid inputs
+select log(-12.34);
+ERROR: cannot take logarithm of a negative number
+CONTEXT: SQL function "log" statement 1
+select log(0.0);
+ERROR: cannot take logarithm of zero
+CONTEXT: SQL function "log" statement 1
+--
+-- Tests for LOG() (arbitrary base)
+--
+-- invalid inputs
+select log(-12.34, 56.78);
+ERROR: cannot take logarithm of a negative number
+select log(-12.34, -56.78);
+ERROR: cannot take logarithm of a negative number
+select log(12.34, -56.78);
+ERROR: cannot take logarithm of a negative number
+select log(0.0, 12.34);
+ERROR: cannot take logarithm of zero
+select log(12.34, 0.0);
+ERROR: cannot take logarithm of zero
+select log(1.0, 12.34);
+ERROR: division by zero
+-- some random tests
+select log(1.23e-89, 6.4689e45);
+ log
+------------------------------------------------------------------------------------------------
+ -0.5152489207781856983977054971756484879653568168479201885425588841094788842469115325262329756
+(1 row)
+
+select log(0.99923, 4.58934e34);
+ log
+---------------------
+ -103611.55579544132
+(1 row)
+
+select log(1.000016, 8.452010e18);
+ log
+--------------------
+ 2723830.2877097365
+(1 row)
+
+select log(3.1954752e47, 9.4792021e-73);
+ log
+-------------------------------------------------------------------------------------
+ -1.51613372350688302142917386143459361608600157692779164475351842333265418126982165
+(1 row)
+
+--
+-- Tests for scale()
+--
+select scale(numeric 'NaN');
+ scale
+-------
+
+(1 row)
+
+select scale(numeric 'inf');
+ scale
+-------
+
+(1 row)
+
+select scale(NULL::numeric);
+ scale
+-------
+
+(1 row)
+
+select scale(1.12);
+ scale
+-------
+ 2
+(1 row)
+
+select scale(0);
+ scale
+-------
+ 0
+(1 row)
+
+select scale(0.00);
+ scale
+-------
+ 2
+(1 row)
+
+select scale(1.12345);
+ scale
+-------
+ 5
+(1 row)
+
+select scale(110123.12475871856128);
+ scale
+-------
+ 14
+(1 row)
+
+select scale(-1123.12471856128);
+ scale
+-------
+ 11
+(1 row)
+
+select scale(-13.000000000000000);
+ scale
+-------
+ 15
+(1 row)
+
+--
+-- Tests for min_scale()
+--
+select min_scale(numeric 'NaN') is NULL; -- should be true
+ ?column?
+----------
+ t
+(1 row)
+
+select min_scale(numeric 'inf') is NULL; -- should be true
+ ?column?
+----------
+ t
+(1 row)
+
+select min_scale(0); -- no digits
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(0.00); -- no digits again
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(1.0); -- no scale
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(1.1); -- scale 1
+ min_scale
+-----------
+ 1
+(1 row)
+
+select min_scale(1.12); -- scale 2
+ min_scale
+-----------
+ 2
+(1 row)
+
+select min_scale(1.123); -- scale 3
+ min_scale
+-----------
+ 3
+(1 row)
+
+select min_scale(1.1234); -- scale 4, filled digit
+ min_scale
+-----------
+ 4
+(1 row)
+
+select min_scale(1.12345); -- scale 5, 2 NDIGITS
+ min_scale
+-----------
+ 5
+(1 row)
+
+select min_scale(1.1000); -- 1 pos in NDIGITS
+ min_scale
+-----------
+ 1
+(1 row)
+
+select min_scale(1e100); -- very big number
+ min_scale
+-----------
+ 0
+(1 row)
+
+--
+-- Tests for trim_scale()
+--
+select trim_scale(numeric 'NaN');
+ trim_scale
+------------
+ NaN
+(1 row)
+
+select trim_scale(numeric 'inf');
+ trim_scale
+------------
+ Infinity
+(1 row)
+
+select trim_scale(1.120);
+ trim_scale
+------------
+ 1.12
+(1 row)
+
+select trim_scale(1.1234500);
+ trim_scale
+------------
+ 1.12345
+(1 row)
+
+select trim_scale(110123.12475871856128000);
+ trim_scale
+-----------------------
+ 110123.12475871856128
+(1 row)
+
+select trim_scale(-1123.124718561280000000);
+ trim_scale
+-------------------
+ -1123.12471856128
+(1 row)
+
+select trim_scale(-13.00000000000000000000);
+ trim_scale
+------------
+ -13
+(1 row)
+
+select trim_scale(1e100);
+ trim_scale
+-------------------------------------------------------------------------------------------------------
+ 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+(1 row)
+
+--
+-- Tests for SUM()
+--
+-- cases that need carry propagation
+SELECT SUM(9999::numeric) FROM generate_series(1, 100000);
+ sum
+-----------
+ 999900000
+(1 row)
+
+SELECT SUM((-9999)::numeric) FROM generate_series(1, 100000);
+ sum
+------------
+ -999900000
+(1 row)
+
+SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+ERROR: value overflows numeric format
+--
+-- Tests for factorial
+--
+SELECT factorial(4);
+ factorial
+-----------
+ 24
+(1 row)
+
+SELECT factorial(15);
+ factorial
+---------------
+ 1307674368000
+(1 row)
+
+SELECT factorial(100000);
+ERROR: value overflows numeric format
+SELECT factorial(0);
+ factorial
+-----------
+ 1
+(1 row)
+
+SELECT factorial(-4);
+ERROR: factorial of a negative number is undefined
+--
+-- Tests for pg_lsn()
+--
+SELECT pg_lsn(23783416::numeric);
+ pg_lsn
+-----------
+ 0/16AE7F8
+(1 row)
+
+SELECT pg_lsn(0::numeric);
+ pg_lsn
+--------
+ 0/0
+(1 row)
+
+SELECT pg_lsn(18446744073709551615::numeric);
+ pg_lsn
+-------------------
+ FFFFFFFF/FFFFFFFF
+(1 row)
+
+SELECT pg_lsn(-1::numeric);
+ERROR: pg_lsn out of range
+SELECT pg_lsn(18446744073709551616::numeric);
+ERROR: pg_lsn out of range
+SELECT pg_lsn('NaN'::numeric);
+ERROR: cannot convert NaN to pg_lsn
diff --git a/yql/essentials/tests/postgresql/cases/numeric.sql b/yql/essentials/tests/postgresql/cases/numeric.sql
new file mode 100644
index 0000000000..d34f2c99b0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numeric.sql
@@ -0,0 +1,955 @@
+--
+-- NUMERIC
+--
+CREATE TABLE num_data (id int4, val numeric(210,10));
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+BEGIN TRANSACTION;
+INSERT INTO num_exp_add VALUES (0,0,'0');
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+INSERT INTO num_exp_add VALUES (0,1,'0');
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+INSERT INTO num_exp_div VALUES (0,2,'0');
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+INSERT INTO num_exp_div VALUES (0,3,'0');
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+INSERT INTO num_exp_div VALUES (0,4,'0');
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+INSERT INTO num_exp_div VALUES (0,5,'0');
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+INSERT INTO num_exp_div VALUES (0,6,'0');
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+INSERT INTO num_exp_div VALUES (0,7,'0');
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+INSERT INTO num_exp_div VALUES (0,8,'0');
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+INSERT INTO num_exp_div VALUES (0,9,'0');
+INSERT INTO num_exp_add VALUES (1,0,'0');
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+INSERT INTO num_exp_add VALUES (1,1,'0');
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+INSERT INTO num_exp_div VALUES (1,2,'0');
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+INSERT INTO num_exp_div VALUES (1,3,'0');
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+INSERT INTO num_exp_div VALUES (1,4,'0');
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+INSERT INTO num_exp_div VALUES (1,5,'0');
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+INSERT INTO num_exp_div VALUES (1,6,'0');
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+INSERT INTO num_exp_div VALUES (1,7,'0');
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+INSERT INTO num_exp_div VALUES (1,8,'0');
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+INSERT INTO num_exp_div VALUES (1,9,'0');
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_data VALUES (0, '0');
+INSERT INTO num_data VALUES (1, '0');
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+INSERT INTO num_data VALUES (3, '4.31');
+INSERT INTO num_data VALUES (4, '7799461.4119');
+INSERT INTO num_data VALUES (5, '16397.038491');
+INSERT INTO num_data VALUES (6, '93901.57763026');
+INSERT INTO num_data VALUES (7, '-83028485');
+INSERT INTO num_data VALUES (8, '74881');
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+COMMIT TRANSACTION;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 10);
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 40);
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 30);
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 80);
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+ FROM num_data;
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+INSERT INTO num_result SELECT id, 0, LOG(numeric '10', ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT 'inf'::numeric / '0';
+SELECT '-inf'::numeric / '0';
+SELECT 'nan'::numeric / '0';
+SELECT '0'::numeric / '0';
+SELECT 'inf'::numeric % '0';
+SELECT '-inf'::numeric % '0';
+SELECT 'nan'::numeric % '0';
+SELECT '0'::numeric % '0';
+SELECT div('inf'::numeric, '0');
+SELECT div('-inf'::numeric, '0');
+SELECT div('nan'::numeric, '0');
+SELECT div('0'::numeric, '0');
+-- the large values fall into the numeric abbreviation code's maximal classes
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
+ ('inf'),('-inf'),('nan'),
+ ('inf'),('-inf'),('nan'))
+SELECT substring(x::text, 1, 32)
+FROM v ORDER BY x;
+SELECT sqrt('-1'::numeric);
+SELECT sqrt('-inf'::numeric);
+SELECT ln('0'::numeric);
+SELECT ln('-1'::numeric);
+SELECT ln('-inf'::numeric);
+SELECT log('0'::numeric, '10');
+SELECT log('10'::numeric, '0');
+SELECT log('-inf'::numeric, '10');
+SELECT log('10'::numeric, '-inf');
+SELECT log('inf'::numeric, '0');
+SELECT log('inf'::numeric, '-inf');
+SELECT log('-inf'::numeric, 'inf');
+SELECT power('0'::numeric, '-1');
+SELECT power('0'::numeric, '-inf');
+SELECT power('-1'::numeric, 'inf');
+SELECT power('-2'::numeric, '3');
+SELECT power('-2'::numeric, '3.3');
+SELECT power('-2'::numeric, '-1');
+SELECT power('-2'::numeric, '-1.5');
+SELECT power('-2'::numeric, 'inf');
+SELECT power('-inf'::numeric, '2');
+SELECT power('-inf'::numeric, '3');
+SELECT power('-inf'::numeric, '4.5');
+SELECT power('-inf'::numeric, '0');
+SELECT power('-inf'::numeric, 'inf');
+-- ******************************
+-- * miscellaneous checks for things that have been broken in the past...
+-- ******************************
+-- numeric AVG used to fail on some platforms
+SELECT AVG(val) FROM num_data;
+-- Check for appropriate rounding and overflow
+CREATE TABLE fract_only (id int, val numeric(4,4));
+INSERT INTO fract_only VALUES (1, '0.0');
+INSERT INTO fract_only VALUES (2, '0.1');
+INSERT INTO fract_only VALUES (4, '-0.9999');
+INSERT INTO fract_only VALUES (5, '0.99994');
+INSERT INTO fract_only VALUES (7, '0.00001');
+INSERT INTO fract_only VALUES (8, '0.00017');
+INSERT INTO fract_only VALUES (9, 'NaN');
+DROP TABLE fract_only;
+-- Check conversion to integers
+SELECT (-9223372036854775808.5)::int8; -- should fail
+SELECT (-9223372036854775808.4)::int8; -- ok
+SELECT 9223372036854775807.4::int8; -- ok
+SELECT 9223372036854775807.5::int8; -- should fail
+SELECT (-2147483648.5)::int4; -- should fail
+SELECT (-2147483648.4)::int4; -- ok
+SELECT 2147483647.4::int4; -- ok
+SELECT 2147483647.5::int4; -- should fail
+SELECT (-32768.5)::int2; -- should fail
+SELECT (-32768.4)::int2; -- ok
+SELECT 32767.4::int2; -- ok
+SELECT 32767.5::int2; -- should fail
+-- Check inf/nan conversion behavior
+SELECT 'NaN'::float8::numeric;
+SELECT 'Infinity'::float8::numeric;
+SELECT '-Infinity'::float8::numeric;
+SELECT 'NaN'::numeric::float8;
+SELECT 'Infinity'::numeric::float8;
+SELECT '-Infinity'::numeric::float8;
+SELECT 'NaN'::float4::numeric;
+SELECT 'Infinity'::float4::numeric;
+SELECT '-Infinity'::float4::numeric;
+SELECT 'NaN'::numeric::float4;
+SELECT 'Infinity'::numeric::float4;
+SELECT '-Infinity'::numeric::float4;
+SELECT '42'::int2::numeric;
+SELECT 'NaN'::numeric::int2;
+SELECT 'Infinity'::numeric::int2;
+SELECT '-Infinity'::numeric::int2;
+SELECT 'NaN'::numeric::int4;
+SELECT 'Infinity'::numeric::int4;
+SELECT '-Infinity'::numeric::int4;
+SELECT 'NaN'::numeric::int8;
+SELECT 'Infinity'::numeric::int8;
+SELECT '-Infinity'::numeric::int8;
+-- Simple check that ceil(), floor(), and round() work correctly
+CREATE TABLE ceil_floor_round (a numeric);
+INSERT INTO ceil_floor_round VALUES ('-5.5');
+INSERT INTO ceil_floor_round VALUES ('-5.499999');
+INSERT INTO ceil_floor_round VALUES ('9.5');
+INSERT INTO ceil_floor_round VALUES ('9.4999999');
+INSERT INTO ceil_floor_round VALUES ('0.0');
+INSERT INTO ceil_floor_round VALUES ('0.0000001');
+INSERT INTO ceil_floor_round VALUES ('-0.000001');
+DROP TABLE ceil_floor_round;
+-- Testing for width_bucket(). For convenience, we test both the
+-- numeric and float8 versions of the function in this file.
+-- errors
+SELECT width_bucket(5.0, 3.0, 4.0, 0);
+SELECT width_bucket(5.0, 3.0, 4.0, -5);
+SELECT width_bucket(3.5, 3.0, 3.0, 888);
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+SELECT width_bucket('NaN', 3.0, 4.0, 888);
+SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+SELECT width_bucket(2.0, 3.0, '-inf', 888);
+SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+-- normal operation
+CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
+-- Check positive and negative infinity: we require
+-- finite bucket bounds, but allow an infinite operand
+SELECT width_bucket(0.0::numeric, 'Infinity'::numeric, 5, 10); -- error
+SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+DROP TABLE width_bucket_test;
+-- Simple test for roundoff error when results should be exact
+SELECT x, width_bucket(x::float8, 10, 100, 9) as flt,
+ width_bucket(x::numeric, 10, 100, 9) as num
+FROM generate_series(0, 110, 10) x;
+SELECT x, width_bucket(x::float8, 100, 10, 9) as flt,
+ width_bucket(x::numeric, 100, 10, 9) as num
+FROM generate_series(0, 110, 10) x;
+--
+-- TO_CHAR()
+--
+SELECT to_char(val, '9G999G999G999G999G999')
+ FROM num_data;
+SELECT to_char(val, '9G999G999G999G999G999D999G999G999G999G999')
+ FROM num_data;
+SELECT to_char(val, '9999999999999999.999999999999999PR')
+ FROM num_data;
+SELECT to_char(val, '9999999999999999.999999999999999S')
+ FROM num_data;
+SELECT to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FMS9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
+SELECT to_char(val, 'SG9999999999999999.999999999999999th') FROM num_data;
+SELECT to_char(val, '0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'S0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
+SELECT to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
+SELECT to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+SELECT to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+SELECT to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
+SELECT to_char(val, '999999SG9999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, '9.999EEEE') FROM num_data;
+SELECT to_char('100'::numeric, 'FM999.9');
+SELECT to_char('100'::numeric, 'FM999.');
+SELECT to_char('100'::numeric, 'FM999');
+-- Check parsing of literal text in a format string
+SELECT to_char('100'::numeric, 'foo999');
+SELECT to_char('100'::numeric, 'f\oo999');
+SELECT to_char('100'::numeric, 'f\\oo999');
+SELECT to_char('100'::numeric, 'f\"oo999');
+SELECT to_char('100'::numeric, 'f\\"oo999');
+SELECT to_char('100'::numeric, 'f"ool"999');
+SELECT to_char('100'::numeric, 'f"\ool"999');
+SELECT to_char('100'::numeric, 'f"\\ool"999');
+SELECT to_char('100'::numeric, 'f"ool\"999');
+SELECT to_char('100'::numeric, 'f"ool\\"999');
+SELECT to_number('-34,338,492', '99G999G999');
+SELECT to_number('-34,338,492.654,878', '99G999G999D999G999');
+SELECT to_number('<564646.654564>', '999999.999999PR');
+SELECT to_number('0.00001-', '9.999999S');
+SELECT to_number('5.01-', 'FM9.999999S');
+SELECT to_number('5.01-', 'FM9.999999MI');
+SELECT to_number('5 4 4 4 4 8 . 7 8', '9 9 9 9 9 9 . 9 9');
+SELECT to_number('.01', 'FM9.99');
+SELECT to_number('.0', '99999999.99999999');
+SELECT to_number('.-01', 'S99.99');
+SELECT to_number('.01-', '99.99S');
+SELECT to_number(' . 0 1-', ' 9 9 . 9 9 S');
+SELECT to_number('34,50','999,99');
+SELECT to_number('123,000','999G');
+SELECT to_number('123456','999G999');
+SELECT to_number('$1234.56','L9,999.99');
+SELECT to_number('$1234.56','L99,999.99');
+SELECT to_number('$1,234.56','L99,999.99');
+SELECT to_number('1234.56','L99,999.99');
+SELECT to_number('1,234.56','L99,999.99');
+SELECT to_number('42nd', '99th');
+--
+-- Input syntax
+--
+CREATE TABLE num_input_test (n1 numeric);
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+INSERT INTO num_input_test(n1) VALUES (' nan');
+INSERT INTO num_input_test(n1) VALUES (' inf ');
+INSERT INTO num_input_test(n1) VALUES (' +inf ');
+INSERT INTO num_input_test(n1) VALUES (' -inf ');
+INSERT INTO num_input_test(n1) VALUES (' Infinity ');
+INSERT INTO num_input_test(n1) VALUES (' +inFinity ');
+INSERT INTO num_input_test(n1) VALUES (' -INFINITY ');
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+INSERT INTO num_input_test(n1) VALUES ('');
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+SELECT * FROM num_input_test;
+select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383));
+--
+-- Test some corner cases for division
+--
+select 999999999999999999999::numeric/1000000000000000000000;
+select mod(999999999999999999999::numeric,1000000000000000000000);
+select div(-9999999999999999999999::numeric,1000000000000000000000);
+select mod(-9999999999999999999999::numeric,1000000000000000000000);
+select div(-9999999999999999999999::numeric,1000000000000000000000)*1000000000000000000000 + mod(-9999999999999999999999::numeric,1000000000000000000000);
+select mod (70.0,70) ;
+select div (70.0,70) ;
+select 70.0 / 70 ;
+select 12345678901234567890 % 123;
+select 12345678901234567890 / 123;
+select div(12345678901234567890, 123);
+select div(12345678901234567890, 123) * 123 + 12345678901234567890 % 123;
+--
+-- Test some corner cases for square root
+--
+select sqrt(1.000000000000003::numeric);
+select sqrt(1.000000000000004::numeric);
+select sqrt(96627521408608.56340355805::numeric);
+select sqrt(96627521408608.56340355806::numeric);
+select sqrt(515549506212297735.073688290367::numeric);
+select sqrt(515549506212297735.073688290368::numeric);
+select sqrt(8015491789940783531003294973900306::numeric);
+select sqrt(8015491789940783531003294973900307::numeric);
+--
+-- Test code path for raising to integer powers
+--
+select 10.0 ^ -2147483648 as rounds_to_zero;
+select 10.0 ^ -2147483647 as rounds_to_zero;
+select 10.0 ^ 2147483647 as overflows;
+select 117743296169.0 ^ 1000000000 as overflows;
+-- cases that used to return inaccurate results
+select 3.789 ^ 21;
+select 3.789 ^ 35;
+select 1.2 ^ 345;
+select 0.12 ^ (-20);
+select 1.000000000123 ^ (-2147483648);
+-- cases that used to error out
+select 0.12 ^ (-25);
+select 0.5678 ^ (-85);
+-- negative base to integer powers
+select (-1.0) ^ 2147483646;
+select (-1.0) ^ 2147483647;
+select (-1.0) ^ 2147483648;
+select (-1.0) ^ 1000000000000000;
+select (-1.0) ^ 1000000000000001;
+--
+-- Tests for raising to non-integer powers
+--
+-- special cases
+select 0.0 ^ 0.0;
+select (-12.34) ^ 0.0;
+select 12.34 ^ 0.0;
+select 0.0 ^ 12.34;
+-- NaNs
+select 'NaN'::numeric ^ 'NaN'::numeric;
+select 'NaN'::numeric ^ 0;
+select 'NaN'::numeric ^ 1;
+select 0 ^ 'NaN'::numeric;
+select 1 ^ 'NaN'::numeric;
+-- invalid inputs
+select 0.0 ^ (-12.34);
+select (-12.34) ^ 1.2;
+-- cases that used to generate inaccurate results
+select 32.1 ^ 9.8;
+select 32.1 ^ (-9.8);
+select 12.3 ^ 45.6;
+select 12.3 ^ (-45.6);
+--
+-- Tests for EXP()
+--
+-- special cases
+select exp(0.0);
+select exp(1.0);
+select exp(1.0::numeric(71,70));
+select exp('nan'::numeric);
+select exp('inf'::numeric);
+-- cases that used to generate inaccurate results
+select exp(32.999);
+select exp(-32.999);
+select exp(123.456);
+select exp(-123.456);
+-- big test
+select exp(1234.5678);
+--
+-- Tests for generate_series
+--
+select * from generate_series(0.0::numeric, 4.0::numeric);
+select * from generate_series(0.1::numeric, 4.0::numeric, 1.3::numeric);
+select * from generate_series(4.0::numeric, -1.5::numeric, -2.2::numeric);
+-- Trigger errors
+select * from generate_series(-100::numeric, 100::numeric, 0::numeric);
+select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+-- Checks maximum, output is truncated
+select (i / (10::numeric ^ 131071))::numeric(1,0)
+ from generate_series(6 * (10::numeric ^ 131071),
+ 9 * (10::numeric ^ 131071),
+ 10::numeric ^ 131071) as a(i);
+--
+-- Tests for LN()
+--
+-- Invalid inputs
+select ln(-12.34);
+select ln(0.0);
+-- Some random tests
+select ln(1.2345678e-28);
+select ln(0.0456789);
+select ln(0.349873948359354029493948309745709580730482050975);
+select ln(0.99949452);
+select ln(1.00049687395);
+select ln(1234.567890123456789);
+select ln(5.80397490724e5);
+select ln(9.342536355e34);
+--
+-- Tests for LOG() (base 10)
+--
+-- invalid inputs
+select log(-12.34);
+select log(0.0);
+--
+-- Tests for LOG() (arbitrary base)
+--
+-- invalid inputs
+select log(-12.34, 56.78);
+select log(-12.34, -56.78);
+select log(12.34, -56.78);
+select log(0.0, 12.34);
+select log(12.34, 0.0);
+select log(1.0, 12.34);
+-- some random tests
+select log(1.23e-89, 6.4689e45);
+select log(0.99923, 4.58934e34);
+select log(1.000016, 8.452010e18);
+select log(3.1954752e47, 9.4792021e-73);
+--
+-- Tests for scale()
+--
+select scale(numeric 'NaN');
+select scale(numeric 'inf');
+select scale(NULL::numeric);
+select scale(1.12);
+select scale(0);
+select scale(0.00);
+select scale(1.12345);
+select scale(110123.12475871856128);
+select scale(-1123.12471856128);
+select scale(-13.000000000000000);
+--
+-- Tests for min_scale()
+--
+select min_scale(numeric 'NaN') is NULL; -- should be true
+select min_scale(numeric 'inf') is NULL; -- should be true
+select min_scale(0); -- no digits
+select min_scale(0.00); -- no digits again
+select min_scale(1.0); -- no scale
+select min_scale(1.1); -- scale 1
+select min_scale(1.12); -- scale 2
+select min_scale(1.123); -- scale 3
+select min_scale(1.1234); -- scale 4, filled digit
+select min_scale(1.12345); -- scale 5, 2 NDIGITS
+select min_scale(1.1000); -- 1 pos in NDIGITS
+select min_scale(1e100); -- very big number
+--
+-- Tests for trim_scale()
+--
+select trim_scale(numeric 'NaN');
+select trim_scale(numeric 'inf');
+select trim_scale(1.120);
+select trim_scale(1.1234500);
+select trim_scale(110123.12475871856128000);
+select trim_scale(-1123.124718561280000000);
+select trim_scale(-13.00000000000000000000);
+select trim_scale(1e100);
+--
+-- Tests for SUM()
+--
+-- cases that need carry propagation
+SELECT SUM(9999::numeric) FROM generate_series(1, 100000);
+SELECT SUM((-9999)::numeric) FROM generate_series(1, 100000);
+SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+--
+-- Tests for factorial
+--
+SELECT factorial(4);
+SELECT factorial(15);
+SELECT factorial(100000);
+SELECT factorial(0);
+SELECT factorial(-4);
+--
+-- Tests for pg_lsn()
+--
+SELECT pg_lsn(23783416::numeric);
+SELECT pg_lsn(0::numeric);
+SELECT pg_lsn(18446744073709551615::numeric);
+SELECT pg_lsn(-1::numeric);
+SELECT pg_lsn(18446744073709551616::numeric);
+SELECT pg_lsn('NaN'::numeric);
diff --git a/yql/essentials/tests/postgresql/cases/numerology.err b/yql/essentials/tests/postgresql/cases/numerology.err
new file mode 100644
index 0000000000..b2ca51138f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numerology.err
@@ -0,0 +1,141 @@
+Registering pre-existing tables
+ int4_tbl
+ INT4_TBL
+ float8_tbl
+ INT2_TBL
+ int2_tbl
+ FLOAT8_TBL
+<sql-statement>
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT4_TBL;
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT2_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM TEMP_FLOAT
+ ORDER BY f1;
+</sql-statement>
+<sql-statement>
+-- int4
+CREATE TABLE TEMP_INT4 (f1 INT4);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM FLOAT8_TBL
+ WHERE (f1 > -2147483647) AND (f1 < 2147483647);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM INT2_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM TEMP_INT4
+ ORDER BY f1;
+</sql-statement>
+<sql-statement>
+-- int2
+CREATE TABLE TEMP_INT2 (f1 INT2);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM FLOAT8_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM INT4_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM TEMP_INT2
+ ORDER BY f1;
+</sql-statement>
+<sql-statement>
+--
+-- Group-by combinations
+--
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_GROUP
+ SELECT 1, (- i.f1), (- f.f1)
+ FROM INT4_TBL i, FLOAT8_TBL f;
+</sql-statement>
+<sql-statement>
+INSERT INTO TEMP_GROUP
+ SELECT 2, i.f1, f.f1
+ FROM INT4_TBL i, FLOAT8_TBL f;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ INSERT INTO TEMP_GROUP
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: f1
+ INSERT INTO TEMP_GROUP
+ ^
+<sql-statement>
+SELECT DISTINCT f1 AS two FROM TEMP_GROUP ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, max_float, min_float;
+</sql-statement>
+<sql-statement>
+-- GROUP BY a result column name is not legal per SQL92, but we accept it
+-- anyway (if the name is not the name of any column exposed by FROM).
+SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float
+ FROM TEMP_GROUP
+ GROUP BY two
+ ORDER BY two, max_float, min_float;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- GROUP BY a result column name is not legal per SQL92, but we accept it
+ ^
+ -stdin-:<main>:5:12: Error: No such column: two
+ GROUP BY two
+ ^
+<sql-statement>
+SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS two,
+ max(f2) + min(f2) AS max_plus_min,
+ min(f3) - 1 AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+</sql-statement>
+<sql-statement>
+DROP TABLE TEMP_INT2;
+</sql-statement>
+<sql-statement>
+DROP TABLE TEMP_INT4;
+</sql-statement>
+<sql-statement>
+DROP TABLE TEMP_FLOAT;
+</sql-statement>
+<sql-statement>
+DROP TABLE TEMP_GROUP;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/numerology.out b/yql/essentials/tests/postgresql/cases/numerology.out
new file mode 100644
index 0000000000..95830e6fa0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numerology.out
@@ -0,0 +1,56 @@
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT4_TBL;
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT2_TBL;
+SELECT f1 FROM TEMP_FLOAT
+ ORDER BY f1;
+ f1
+-------------
+ -2147483647
+ -123456
+ -32767
+ -1234
+ 0
+ 0
+ 1234
+ 32767
+ 123456
+ 2147483647
+(10 rows)
+
+-- int4
+CREATE TABLE TEMP_INT4 (f1 INT4);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM FLOAT8_TBL
+ WHERE (f1 > -2147483647) AND (f1 < 2147483647);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM INT2_TBL;
+-- int2
+CREATE TABLE TEMP_INT2 (f1 INT2);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM FLOAT8_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM INT4_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+--
+-- Group-by combinations
+--
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+INSERT INTO TEMP_GROUP
+ SELECT 1, (- i.f1), (- f.f1)
+ FROM INT4_TBL i, FLOAT8_TBL f;
+DROP TABLE TEMP_INT2;
+DROP TABLE TEMP_INT4;
+DROP TABLE TEMP_FLOAT;
+DROP TABLE TEMP_GROUP;
diff --git a/yql/essentials/tests/postgresql/cases/numerology.sql b/yql/essentials/tests/postgresql/cases/numerology.sql
new file mode 100644
index 0000000000..91b7786815
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/numerology.sql
@@ -0,0 +1,42 @@
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT4_TBL;
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT2_TBL;
+SELECT f1 FROM TEMP_FLOAT
+ ORDER BY f1;
+-- int4
+CREATE TABLE TEMP_INT4 (f1 INT4);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM FLOAT8_TBL
+ WHERE (f1 > -2147483647) AND (f1 < 2147483647);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM INT2_TBL;
+-- int2
+CREATE TABLE TEMP_INT2 (f1 INT2);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM FLOAT8_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM INT4_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+--
+-- Group-by combinations
+--
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+INSERT INTO TEMP_GROUP
+ SELECT 1, (- i.f1), (- f.f1)
+ FROM INT4_TBL i, FLOAT8_TBL f;
+DROP TABLE TEMP_INT2;
+DROP TABLE TEMP_INT4;
+DROP TABLE TEMP_FLOAT;
+DROP TABLE TEMP_GROUP;
diff --git a/yql/essentials/tests/postgresql/cases/oid.err b/yql/essentials/tests/postgresql/cases/oid.err
new file mode 100644
index 0000000000..c6a792771c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/oid.err
@@ -0,0 +1,176 @@
+<sql-statement>
+--
+-- OID
+--
+CREATE TABLE OID_TBL(f1 oid);
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('1234');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('1235');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('987');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('-1040');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('99999999');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('5 ');
+</sql-statement>
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES (' 10 ');
+</sql-statement>
+<sql-statement>
+-- leading/trailing hard tab is also allowed
+INSERT INTO OID_TBL(f1) VALUES (' 15 ');
+</sql-statement>
+<sql-statement>
+-- bad inputs
+INSERT INTO OID_TBL(f1) VALUES ('');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- bad inputs
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: ""
+
+ -- bad inputs
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES (' ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES (' ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: " "
+
+ INSERT INTO OID_TBL(f1) VALUES (' ');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: "asdfasd"
+
+ INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: "99asdfasd"
+
+ INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('5 d');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: "5 d"
+
+ INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES (' 5d');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: " 5d"
+
+ INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('5 5');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: "5 5"
+
+ INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES (' - 500');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type oid: " - 500"
+
+ INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "32958209582039852935" is out of range for type oid
+
+ INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ ^
+<sql-statement>
+INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: value "-23582358720398502385" is out of range for type oid
+
+ INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ ^
+<sql-statement>
+SELECT * FROM OID_TBL;
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 = 1234;
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 < '1234';
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+</sql-statement>
+<sql-statement>
+SELECT o.* FROM OID_TBL o WHERE o.f1 > '1234';
+</sql-statement>
+<sql-statement>
+DROP TABLE OID_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/oid.out b/yql/essentials/tests/postgresql/cases/oid.out
new file mode 100644
index 0000000000..8909373453
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/oid.out
@@ -0,0 +1,122 @@
+--
+-- OID
+--
+CREATE TABLE OID_TBL(f1 oid);
+INSERT INTO OID_TBL(f1) VALUES ('1234');
+INSERT INTO OID_TBL(f1) VALUES ('1235');
+INSERT INTO OID_TBL(f1) VALUES ('987');
+INSERT INTO OID_TBL(f1) VALUES ('-1040');
+INSERT INTO OID_TBL(f1) VALUES ('99999999');
+INSERT INTO OID_TBL(f1) VALUES ('5 ');
+INSERT INTO OID_TBL(f1) VALUES (' 10 ');
+-- leading/trailing hard tab is also allowed
+INSERT INTO OID_TBL(f1) VALUES (' 15 ');
+-- bad inputs
+INSERT INTO OID_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type oid: ""
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type oid: " "
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ERROR: invalid input syntax for type oid: "asdfasd"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ERROR: invalid input syntax for type oid: "99asdfasd"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ERROR: invalid input syntax for type oid: "5 d"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ERROR: invalid input syntax for type oid: " 5d"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ERROR: invalid input syntax for type oid: "5 5"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ERROR: invalid input syntax for type oid: " - 500"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ERROR: value "32958209582039852935" is out of range for type oid
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ERROR: value "-23582358720398502385" is out of range for type oid
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ ^
+SELECT * FROM OID_TBL;
+ f1
+------------
+ 1234
+ 1235
+ 987
+ 4294966256
+ 99999999
+ 5
+ 10
+ 15
+(8 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 = 1234;
+ f1
+------
+ 1234
+(1 row)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+ f1
+------------
+ 1235
+ 987
+ 4294966256
+ 99999999
+ 5
+ 10
+ 15
+(7 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+ f1
+------
+ 1234
+ 987
+ 5
+ 10
+ 15
+(5 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 < '1234';
+ f1
+-----
+ 987
+ 5
+ 10
+ 15
+(4 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+ f1
+------------
+ 1234
+ 1235
+ 4294966256
+ 99999999
+(4 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 > '1234';
+ f1
+------------
+ 1235
+ 4294966256
+ 99999999
+(3 rows)
+
+DROP TABLE OID_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/oid.sql b/yql/essentials/tests/postgresql/cases/oid.sql
new file mode 100644
index 0000000000..06230b51df
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/oid.sql
@@ -0,0 +1,32 @@
+--
+-- OID
+--
+CREATE TABLE OID_TBL(f1 oid);
+INSERT INTO OID_TBL(f1) VALUES ('1234');
+INSERT INTO OID_TBL(f1) VALUES ('1235');
+INSERT INTO OID_TBL(f1) VALUES ('987');
+INSERT INTO OID_TBL(f1) VALUES ('-1040');
+INSERT INTO OID_TBL(f1) VALUES ('99999999');
+INSERT INTO OID_TBL(f1) VALUES ('5 ');
+INSERT INTO OID_TBL(f1) VALUES (' 10 ');
+-- leading/trailing hard tab is also allowed
+INSERT INTO OID_TBL(f1) VALUES (' 15 ');
+-- bad inputs
+INSERT INTO OID_TBL(f1) VALUES ('');
+INSERT INTO OID_TBL(f1) VALUES (' ');
+INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+INSERT INTO OID_TBL(f1) VALUES ('5 d');
+INSERT INTO OID_TBL(f1) VALUES (' 5d');
+INSERT INTO OID_TBL(f1) VALUES ('5 5');
+INSERT INTO OID_TBL(f1) VALUES (' - 500');
+INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+SELECT * FROM OID_TBL;
+SELECT o.* FROM OID_TBL o WHERE o.f1 = 1234;
+SELECT o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+SELECT o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+SELECT o.* FROM OID_TBL o WHERE o.f1 < '1234';
+SELECT o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+SELECT o.* FROM OID_TBL o WHERE o.f1 > '1234';
+DROP TABLE OID_TBL;
diff --git a/yql/essentials/tests/postgresql/cases/select.err b/yql/essentials/tests/postgresql/cases/select.err
new file mode 100644
index 0000000000..8d37f1208e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select.err
@@ -0,0 +1,656 @@
+Registering pre-existing tables
+ onek
+ onek2
+ emp
+ student
+ stud_emp
+ int8_tbl
+<sql-statement>
+--
+-- SELECT
+--
+-- btree index
+-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT * FROM onek
+ WHERE onek.unique1 < 10
+ ORDER BY onek.unique1;
+</sql-statement>
+<sql-statement>
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:27: Error: sortby_dir unsupported value: 3
+ ORDER BY unique1 using >;
+ ^
+<sql-statement>
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY stringu1 using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:28: Error: sortby_dir unsupported value: 3
+ ORDER BY stringu1 using <;
+ ^
+<sql-statement>
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1d -2 +0nr -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using <, unique1 using >;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:27: Error: sortby_dir unsupported value: 3
+ ORDER BY string4 using <, unique1 using >;
+ ^
+<sql-statement>
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1dr -2 +0n -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using >, unique1 using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:27: Error: sortby_dir unsupported value: 3
+ ORDER BY string4 using >, unique1 using <;
+ ^
+<sql-statement>
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0nr -1 +1d -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >, string4 using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:27: Error: sortby_dir unsupported value: 3
+ ORDER BY unique1 using >, string4 using <;
+ ^
+<sql-statement>
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0n -1 +1dr -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using <, string4 using >;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:27: Error: sortby_dir unsupported value: 3
+ ORDER BY unique1 using <, string4 using >;
+ ^
+<sql-statement>
+--
+-- test partial btree indexes
+--
+-- As of 7.2, planner probably won't pick an indexscan without stats,
+-- so ANALYZE first. Also, we want to prevent it from picking a bitmapscan
+-- followed by sort, because that could hide index ordering problems.
+--
+ANALYZE onek2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ --
+ ^
+<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>
+SET enable_sort TO off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ SET enable_sort TO off;
+ ^
+<sql-statement>
+--
+-- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10;
+</sql-statement>
+<sql-statement>
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 < 20
+ ORDER BY unique1 using >;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:28: Error: sortby_dir unsupported value: 3
+ ORDER BY unique1 using >;
+ ^
+<sql-statement>
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 > 980;
+</sql-statement>
+<sql-statement>
+RESET enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_seqscan;
+ ^
+<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>
+RESET enable_sort;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_sort;
+ ^
+<sql-statement>
+SELECT two, stringu1, ten, string4
+ INTO TABLE tmp
+ FROM onek;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ SELECT two, stringu1, ten, string4
+ ^
+<sql-statement>
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=2){print $4,$5;}else{print;}}' - stud_emp.data
+--
+-- SELECT name, age FROM person*; ??? check if different
+SELECT p.name, p.age FROM person* p;
+</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.person
+
+<sql-statement>
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $4,$5;}else{print;}}' - stud_emp.data |
+-- sort +1nr -2
+--
+SELECT p.name, p.age FROM person* p ORDER BY age using >, name;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:8:56: Error: sortby_dir unsupported value: 3
+ SELECT p.name, p.age FROM person* p ORDER BY age using >, name;
+ ^
+<sql-statement>
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1 offset 0) as foo;
+</sql-statement>
+<sql-statement>
+select foo from (select null offset 0) as foo;
+</sql-statement>
+<sql-statement>
+select foo from (select 'xyzzy',1,null offset 0) as foo;
+</sql-statement>
+<sql-statement>
+--
+-- Test VALUES lists
+--
+select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
+ WHERE onek.unique1 = v.i and onek.stringu1 = v.j;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: OrderedMap, At function: EquiJoin
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Cannot compare key columns (0.stringu1 has type: pgname, 1._alias_v.j has type: pgtext)
+ --
+ ^
+<sql-statement>
+-- a more complex case
+-- looks like we're coding lisp :-)
+select * from onek,
+ (values ((select i from
+ (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i)
+ order by i asc limit 1))) bar (i)
+ where onek.unique1 = bar.i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:12: Error: SubLinks are not allowed in: VALUES
+ (values ((select i from
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- a more complex case
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ -- a more complex case
+ ^
+<sql-statement>
+-- try VALUES in a subquery
+select * from onek
+ where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99))
+ order by unique1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:25: Error: alternative is not implemented yet : 138
+ where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99))
+ ^
+<sql-statement>
+-- VALUES is also legal as a standalone query or a set-operation member
+VALUES (1,2), (3,4+4), (7,77.7);
+</sql-statement>
+<sql-statement>
+VALUES (1,2), (3,4+4), (7,77.7)
+UNION ALL
+SELECT 2+2, 57
+UNION ALL
+TABLE int8_tbl;
+</sql-statement>
+<sql-statement>
+-- corner case: VALUES with no columns
+CREATE TEMP TABLE nocols();
+</sql-statement>
+<sql-statement>
+INSERT INTO nocols DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 nocols n, LATERAL (VALUES(n.*)) v;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v;
+ ^
+<sql-statement>
+--
+-- Test ORDER BY options
+--
+CREATE TEMP TABLE foo (f1 int);
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 ASC; -- same thing
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+</sql-statement>
+<sql-statement>
+-- check if indexscans do the right things
+CREATE INDEX fooi ON foo (f1);
+</sql-statement>
+<sql-statement>
+SET enable_sort = false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ SET enable_sort = false;
+ ^
+<sql-statement>
+SELECT * FROM foo ORDER BY f1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+</sql-statement>
+<sql-statement>
+DROP INDEX fooi;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX fooi;
+ ^
+<sql-statement>
+CREATE INDEX fooi ON foo (f1 DESC);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+</sql-statement>
+<sql-statement>
+DROP INDEX fooi;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ DROP INDEX fooi;
+ ^
+<sql-statement>
+CREATE INDEX fooi ON foo (f1 DESC NULLS LAST);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC;
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+</sql-statement>
+<sql-statement>
+--
+-- Test planning of some cases with partial indexes
+--
+-- partial index is usable
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+</sql-statement>
+<sql-statement>
+-- actually run the query with an analyze to use the partial index
+explain (costs off, analyze on, timing off, summary off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- actually run the query with an analyze to use the partial index
+ ^
+<sql-statement>
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+</sql-statement>
+<sql-statement>
+-- partial index predicate implies clause, so no need for retest
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- partial index predicate implies clause, so no need for retest
+ ^
+<sql-statement>
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+<sql-statement>
+-- but if it's an update target, must retest anyway
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- but if it's an update target, must retest anyway
+ ^
+<sql-statement>
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+</sql-statement>
+<sql-statement>
+-- partial index is not applicable
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- partial index is not applicable
+ ^
+<sql-statement>
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+</sql-statement>
+<sql-statement>
+-- partial index implies clause, but bitmap scan must recheck predicate anyway
+SET enable_indexscan TO off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_indexscan
+ -- partial index implies clause, but bitmap scan must recheck predicate anyway
+ ^
+<sql-statement>
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+</sql-statement>
+<sql-statement>
+RESET enable_indexscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET enable_indexscan;
+ ^
+<sql-statement>
+-- check multi-index cases too
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check multi-index cases too
+ ^
+<sql-statement>
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+</sql-statement>
+<sql-statement>
+--
+-- Test some corner cases that have been known to confuse the planner
+--
+-- ORDER BY on a constant doesn't really need any sorting
+SELECT 1 AS x ORDER BY x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:5:24: Error: Column reference can't be used without FROM
+ SELECT 1 AS x ORDER BY x;
+ ^
+<sql-statement>
+-- But ORDER BY on a set-valued expression does
+create function sillysrf(int) returns setof int as
+ 'values (1),(10),(2),($1)' language sql immutable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- But ORDER BY on a set-valued expression does
+ ^
+<sql-statement>
+select sillysrf(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 sillysrf(42);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select sillysrf(42);
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: sillysrf
+ select sillysrf(42);
+ ^
+<sql-statement>
+select sillysrf(-1) order by 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 sillysrf(-1) order by 1;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select sillysrf(-1) order by 1;
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: sillysrf
+ select sillysrf(-1) order by 1;
+ ^
+<sql-statement>
+drop function sillysrf(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function sillysrf(int);
+ ^
+<sql-statement>
+-- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict
+-- (see bug #5084)
+select * from (values (2),(null),(1)) v(k) where k = k order by k;
+</sql-statement>
+<sql-statement>
+select * from (values (2),(null),(1)) v(k) where k = k;
+</sql-statement>
+<sql-statement>
+-- Test partitioned tables with no partitions, which should be handled the
+-- same as the non-inheritance case when expanding its RTE.
+create table list_parted_tbl (a int,b int) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- Test partitioned tables with no partitions, which should be handled the
+ ^
+<sql-statement>
+create table list_parted_tbl1 partition of list_parted_tbl
+ for values in (1) partition by list(b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table list_parted_tbl1 partition of list_parted_tbl
+ ^
+<sql-statement>
+explain (costs off) select * from list_parted_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off) select * from list_parted_tbl;
+ ^
+<sql-statement>
+drop table list_parted_tbl;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select.out b/yql/essentials/tests/postgresql/cases/select.out
new file mode 100644
index 0000000000..ddc7742c4d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select.out
@@ -0,0 +1,204 @@
+--
+-- SELECT
+--
+-- btree index
+-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT * FROM onek
+ WHERE onek.unique1 < 10
+ ORDER BY onek.unique1;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 0 | 998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | AAAAAA | KMBAAA | OOOOxx
+ 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx
+ 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx
+ 3 | 431 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 7 | DAAAAA | PQAAAA | VVVVxx
+ 4 | 833 | 0 | 0 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 9 | EAAAAA | BGBAAA | HHHHxx
+ 5 | 541 | 1 | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 10 | 11 | FAAAAA | VUAAAA | HHHHxx
+ 6 | 978 | 0 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 12 | 13 | GAAAAA | QLBAAA | OOOOxx
+ 7 | 647 | 1 | 3 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 14 | 15 | HAAAAA | XYAAAA | VVVVxx
+ 8 | 653 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 16 | 17 | IAAAAA | DZAAAA | HHHHxx
+ 9 | 49 | 1 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 18 | 19 | JAAAAA | XBAAAA | HHHHxx
+(10 rows)
+
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1 offset 0) as foo;
+ foo
+-----
+ (1)
+(1 row)
+
+select foo from (select null offset 0) as foo;
+ foo
+-----
+ ()
+(1 row)
+
+select foo from (select 'xyzzy',1,null offset 0) as foo;
+ foo
+------------
+ (xyzzy,1,)
+(1 row)
+
+-- VALUES is also legal as a standalone query or a set-operation member
+VALUES (1,2), (3,4+4), (7,77.7);
+ column1 | column2
+---------+---------
+ 1 | 2
+ 3 | 8
+ 7 | 77.7
+(3 rows)
+
+VALUES (1,2), (3,4+4), (7,77.7)
+UNION ALL
+SELECT 2+2, 57
+UNION ALL
+TABLE int8_tbl;
+ column1 | column2
+------------------+-------------------
+ 1 | 2
+ 3 | 8
+ 7 | 77.7
+ 4 | 57
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(9 rows)
+
+-- corner case: VALUES with no columns
+CREATE TEMP TABLE nocols();
+--
+-- Test ORDER BY options
+--
+CREATE TEMP TABLE foo (f1 int);
+INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+-- check if indexscans do the right things
+CREATE INDEX fooi ON foo (f1);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+CREATE INDEX fooi ON foo (f1 DESC);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+CREATE INDEX fooi ON foo (f1 DESC NULLS LAST);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx
+(1 row)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ unique2
+---------
+ 11
+(1 row)
+
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx
+(1 row)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique2
+---------
+ 11
+(1 row)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+ unique2
+---------
+ 11
+(1 row)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+ unique2
+---------
+ 11
+(1 row)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique2
+---------
+ 11
+(1 row)
+
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+ unique1 | unique2
+---------+---------
+ 494 | 11
+ 0 | 998
+(2 rows)
+
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+ unique1 | unique2
+---------+---------
+ 494 | 11
+ 0 | 998
+(2 rows)
+
+-- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict
+-- (see bug #5084)
+select * from (values (2),(null),(1)) v(k) where k = k order by k;
+ k
+---
+ 1
+ 2
+(2 rows)
+
+select * from (values (2),(null),(1)) v(k) where k = k;
+ k
+---
+ 2
+ 1
+(2 rows)
+
diff --git a/yql/essentials/tests/postgresql/cases/select.sql b/yql/essentials/tests/postgresql/cases/select.sql
new file mode 100644
index 0000000000..80e9c57baf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select.sql
@@ -0,0 +1,52 @@
+--
+-- SELECT
+--
+-- btree index
+-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT * FROM onek
+ WHERE onek.unique1 < 10
+ ORDER BY onek.unique1;
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1 offset 0) as foo;
+select foo from (select null offset 0) as foo;
+select foo from (select 'xyzzy',1,null offset 0) as foo;
+-- VALUES is also legal as a standalone query or a set-operation member
+VALUES (1,2), (3,4+4), (7,77.7);
+VALUES (1,2), (3,4+4), (7,77.7)
+UNION ALL
+SELECT 2+2, 57
+UNION ALL
+TABLE int8_tbl;
+-- corner case: VALUES with no columns
+CREATE TEMP TABLE nocols();
+--
+-- Test ORDER BY options
+--
+CREATE TEMP TABLE foo (f1 int);
+INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+-- check if indexscans do the right things
+CREATE INDEX fooi ON foo (f1);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+CREATE INDEX fooi ON foo (f1 DESC);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+CREATE INDEX fooi ON foo (f1 DESC NULLS LAST);
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+-- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict
+-- (see bug #5084)
+select * from (values (2),(null),(1)) v(k) where k = k order by k;
+select * from (values (2),(null),(1)) v(k) where k = k;
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct.err b/yql/essentials/tests/postgresql/cases/select_distinct.err
new file mode 100644
index 0000000000..7bd5c15f00
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct.err
@@ -0,0 +1,386 @@
+Registering pre-existing tables
+ tenk1
+ tmp
+ emp
+ student
+ stud_emp
+<sql-statement>
+--
+-- SELECT_DISTINCT
+--
+--
+-- awk '{print $3;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT two FROM tmp ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- awk '{print $5;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT ten FROM tmp ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- awk '{print $16;}' onek.data | sort -d | uniq
+--
+SELECT DISTINCT string4 FROM tmp ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- awk '{print $3,$16,$5;}' onek.data | sort -d | uniq |
+-- sort +0n -1 +1d -2 +2n -3
+--
+SELECT DISTINCT two, string4, ten
+ FROM tmp
+ ORDER BY two using <, string4 using <, ten using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:23: Error: sortby_dir unsupported value: 3
+ ORDER BY two using <, string4 using <, ten using <;
+ ^
+<sql-statement>
+--
+-- awk '{print $2;}' person.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $5;}else{print;}}' - stud_emp.data |
+-- sort -n -r | uniq
+--
+SELECT DISTINCT p.age FROM person* p ORDER BY age using >;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:8:57: Error: sortby_dir unsupported value: 3
+ SELECT DISTINCT p.age FROM person* p ORDER BY age using >;
+ ^
+<sql-statement>
+--
+-- Check mentioning same column more than once
+--
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) 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
+ SELECT count(*) FROM
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: two
+ SELECT count(*) FROM
+ ^
+<sql-statement>
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+SET work_mem='64kB';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: work_mem
+ --
+ ^
+<sql-statement>
+-- Produce results with sorting.
+SET enable_hashagg=FALSE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- Produce results with sorting.
+ ^
+<sql-statement>
+SET jit_above_cost=0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: jit_above_cost
+ SET jit_above_cost=0;
+ ^
+<sql-statement>
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (costs off)
+ ^
+<sql-statement>
+CREATE TABLE distinct_group_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE distinct_group_1 AS
+ ^
+<sql-statement>
+SET jit_above_cost TO DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ SET jit_above_cost TO DEFAULT;
+ ^
+<sql-statement>
+CREATE TABLE distinct_group_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE distinct_group_2 AS
+ ^
+<sql-statement>
+SET enable_hashagg=TRUE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ SET enable_hashagg=TRUE;
+ ^
+<sql-statement>
+-- Produce results with hash aggregation.
+SET enable_sort=FALSE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ -- Produce results with hash aggregation.
+ ^
+<sql-statement>
+SET jit_above_cost=0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: jit_above_cost
+ SET jit_above_cost=0;
+ ^
+<sql-statement>
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (costs off)
+ ^
+<sql-statement>
+CREATE TABLE distinct_hash_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE distinct_hash_1 AS
+ ^
+<sql-statement>
+SET jit_above_cost TO DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ SET jit_above_cost TO DEFAULT;
+ ^
+<sql-statement>
+CREATE TABLE distinct_hash_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE distinct_hash_2 AS
+ ^
+<sql-statement>
+SET enable_sort=TRUE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ SET enable_sort=TRUE;
+ ^
+<sql-statement>
+SET work_mem TO DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 1
+ SET work_mem TO DEFAULT;
+ ^
+<sql-statement>
+-- Compare results
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+</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.distinct_group_1
+
+<sql-statement>
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+</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.distinct_group_1
+
+<sql-statement>
+DROP TABLE distinct_hash_1;
+</sql-statement>
+<sql-statement>
+DROP TABLE distinct_hash_2;
+</sql-statement>
+<sql-statement>
+DROP TABLE distinct_group_1;
+</sql-statement>
+<sql-statement>
+DROP TABLE distinct_group_2;
+</sql-statement>
+<sql-statement>
+--
+-- Also, some tests of IS DISTINCT FROM, which doesn't quite deserve its
+-- very own regression file.
+--
+CREATE TEMP TABLE disttable (f1 integer);
+</sql-statement>
+<sql-statement>
+INSERT INTO DISTTABLE VALUES(1);
+</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.DISTTABLE
+
+<sql-statement>
+INSERT INTO DISTTABLE VALUES(2);
+</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.DISTTABLE
+
+<sql-statement>
+INSERT INTO DISTTABLE VALUES(3);
+</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.DISTTABLE
+
+<sql-statement>
+INSERT INTO DISTTABLE VALUES(NULL);
+</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.DISTTABLE
+
+<sql-statement>
+-- basic cases
+SELECT f1, f1 IS DISTINCT FROM 2 as "not 2" FROM disttable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:15: Error: A_Expr_Kind unsupported value: 3
+ SELECT f1, f1 IS DISTINCT FROM 2 as "not 2" FROM disttable;
+ ^
+<sql-statement>
+SELECT f1, f1 IS DISTINCT FROM NULL as "not null" FROM disttable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:15: Error: A_Expr_Kind unsupported value: 3
+ SELECT f1, f1 IS DISTINCT FROM NULL as "not null" FROM disttable;
+ ^
+<sql-statement>
+SELECT f1, f1 IS DISTINCT FROM f1 as "false" FROM disttable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:15: Error: A_Expr_Kind unsupported value: 3
+ SELECT f1, f1 IS DISTINCT FROM f1 as "false" FROM disttable;
+ ^
+<sql-statement>
+SELECT f1, f1 IS DISTINCT FROM f1+1 as "not null" FROM disttable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:15: Error: A_Expr_Kind unsupported value: 3
+ SELECT f1, f1 IS DISTINCT FROM f1+1 as "not null" FROM disttable;
+ ^
+<sql-statement>
+-- check that optimizer constant-folds it properly
+SELECT 1 IS DISTINCT FROM 2 as "yes";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:10: Error: A_Expr_Kind unsupported value: 3
+ SELECT 1 IS DISTINCT FROM 2 as "yes";
+ ^
+<sql-statement>
+SELECT 2 IS DISTINCT FROM 2 as "no";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:10: Error: A_Expr_Kind unsupported value: 3
+ SELECT 2 IS DISTINCT FROM 2 as "no";
+ ^
+<sql-statement>
+SELECT 2 IS DISTINCT FROM null as "yes";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:10: Error: A_Expr_Kind unsupported value: 3
+ SELECT 2 IS DISTINCT FROM null as "yes";
+ ^
+<sql-statement>
+SELECT null IS DISTINCT FROM null as "no";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: A_Expr_Kind unsupported value: 3
+ SELECT null IS DISTINCT FROM null as "no";
+ ^
+<sql-statement>
+-- negated form
+SELECT 1 IS NOT DISTINCT FROM 2 as "no";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:10: Error: A_Expr_Kind unsupported value: 4
+ SELECT 1 IS NOT DISTINCT FROM 2 as "no";
+ ^
+<sql-statement>
+SELECT 2 IS NOT DISTINCT FROM 2 as "yes";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:10: Error: A_Expr_Kind unsupported value: 4
+ SELECT 2 IS NOT DISTINCT FROM 2 as "yes";
+ ^
+<sql-statement>
+SELECT 2 IS NOT DISTINCT FROM null as "no";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:10: Error: A_Expr_Kind unsupported value: 4
+ SELECT 2 IS NOT DISTINCT FROM null as "no";
+ ^
+<sql-statement>
+SELECT null IS NOT DISTINCT FROM null as "yes";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: A_Expr_Kind unsupported value: 4
+ SELECT null IS NOT DISTINCT FROM null as "yes";
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct.out b/yql/essentials/tests/postgresql/cases/select_distinct.out
new file mode 100644
index 0000000000..787b783342
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct.out
@@ -0,0 +1,48 @@
+--
+-- SELECT_DISTINCT
+--
+--
+-- awk '{print $3;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT two FROM tmp ORDER BY 1;
+ two
+-----
+ 0
+ 1
+(2 rows)
+
+--
+-- awk '{print $5;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT ten FROM tmp ORDER BY 1;
+ ten
+-----
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+--
+-- awk '{print $16;}' onek.data | sort -d | uniq
+--
+SELECT DISTINCT string4 FROM tmp ORDER BY 1;
+ string4
+---------
+ AAAAxx
+ HHHHxx
+ OOOOxx
+ VVVVxx
+(4 rows)
+
+--
+-- Also, some tests of IS DISTINCT FROM, which doesn't quite deserve its
+-- very own regression file.
+--
+CREATE TEMP TABLE disttable (f1 integer);
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct.sql b/yql/essentials/tests/postgresql/cases/select_distinct.sql
new file mode 100644
index 0000000000..80d60b09e3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct.sql
@@ -0,0 +1,20 @@
+--
+-- SELECT_DISTINCT
+--
+--
+-- awk '{print $3;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT two FROM tmp ORDER BY 1;
+--
+-- awk '{print $5;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT ten FROM tmp ORDER BY 1;
+--
+-- awk '{print $16;}' onek.data | sort -d | uniq
+--
+SELECT DISTINCT string4 FROM tmp ORDER BY 1;
+--
+-- Also, some tests of IS DISTINCT FROM, which doesn't quite deserve its
+-- very own regression file.
+--
+CREATE TEMP TABLE disttable (f1 integer);
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct_on.err b/yql/essentials/tests/postgresql/cases/select_distinct_on.err
new file mode 100644
index 0000000000..af9a3ba62c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct_on.err
@@ -0,0 +1,42 @@
+Registering pre-existing tables
+ int4_tbl
+ INT4_TBL
+ tmp
+<sql-statement>
+--
+-- SELECT_DISTINCT_ON
+--
+SELECT DISTINCT ON (string4) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using >, ten using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:27: Error: sortby_dir unsupported value: 3
+ ORDER BY string4 using <, two using >, ten using <;
+ ^
+<sql-statement>
+-- this will fail due to conflict of ordering requirements
+SELECT DISTINCT ON (string4, ten) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using <, ten using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:27: Error: sortby_dir unsupported value: 3
+ ORDER BY string4 using <, two using <, ten using <;
+ ^
+<sql-statement>
+SELECT DISTINCT ON (string4, ten) string4, ten, two
+ FROM tmp
+ ORDER BY string4 using <, ten using >, two using <;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:27: Error: sortby_dir unsupported value: 3
+ ORDER BY string4 using <, ten using >, two using <;
+ ^
+<sql-statement>
+-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
+select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct_on.out b/yql/essentials/tests/postgresql/cases/select_distinct_on.out
new file mode 100644
index 0000000000..97e875579b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct_on.out
@@ -0,0 +1,7 @@
+-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
+select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
+ r | f1
+---+-------------
+ 0 | -2147483647
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/select_distinct_on.sql b/yql/essentials/tests/postgresql/cases/select_distinct_on.sql
new file mode 100644
index 0000000000..a59d3e4ff8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_distinct_on.sql
@@ -0,0 +1,2 @@
+-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
+select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
diff --git a/yql/essentials/tests/postgresql/cases/select_having.err b/yql/essentials/tests/postgresql/cases/select_having.err
new file mode 100644
index 0000000000..3bfa5ff803
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_having.err
@@ -0,0 +1,110 @@
+<sql-statement>
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+</sql-statement>
+<sql-statement>
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+<sql-statement>
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- errors: ungrouped column references
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_test_having.a
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING a > 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: Coalesce, At function: FromPg
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgResolvedOp
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: At function: Member
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: Member not found: _alias_test_having.a
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+<sql-statement>
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_having;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_having.err.1 b/yql/essentials/tests/postgresql/cases/select_having.err.1
new file mode 100644
index 0000000000..3bfa5ff803
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_having.err.1
@@ -0,0 +1,110 @@
+<sql-statement>
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+</sql-statement>
+<sql-statement>
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+<sql-statement>
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- errors: ungrouped column references
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_test_having.a
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING a > 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: Coalesce, At function: FromPg
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgResolvedOp
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: At function: Member
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: Member not found: _alias_test_having.a
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+<sql-statement>
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_having;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_having.err.2 b/yql/essentials/tests/postgresql/cases/select_having.err.2
new file mode 100644
index 0000000000..3bfa5ff803
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_having.err.2
@@ -0,0 +1,110 @@
+<sql-statement>
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+</sql-statement>
+<sql-statement>
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+</sql-statement>
+<sql-statement>
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+<sql-statement>
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ -- errors: ungrouped column references
+ ^
+ -stdin-:<main>:2:8: Error: At function: Member
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+ -stdin-:<main>:2:8: Error: Member not found: _alias_test_having.a
+ SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING a > 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: Coalesce, At function: FromPg
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:43: Error: At function: PgResolvedOp
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: At function: Member
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+ -stdin-:<main>:1:41: Error: Member not found: _alias_test_having.a
+ SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+<sql-statement>
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_having;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_having.out b/yql/essentials/tests/postgresql/cases/select_having.out
new file mode 100644
index 0000000000..e8be510b01
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_having.out
@@ -0,0 +1,84 @@
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+ b | c
+---+----------
+ 1 | XXXX
+ 3 | bbbb
+(2 rows)
+
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+ b | c
+---+----------
+ 3 | BBBB
+ 3 | bbbb
+(2 rows)
+
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+ lower | count
+-------+-------
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(3 rows)
+
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+ c | max
+----------+-----
+ XXXX | 0
+ bbbb | 5
+(2 rows)
+
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+ min | max
+-----+-----
+(0 rows)
+
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+ min | max
+-----+-----
+ 0 | 9
+(1 row)
+
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+ one
+-----
+(0 rows)
+
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/cases/select_having.sql b/yql/essentials/tests/postgresql/cases/select_having.sql
new file mode 100644
index 0000000000..96a412d59d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_having.sql
@@ -0,0 +1,36 @@
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/cases/select_implicit.err b/yql/essentials/tests/postgresql/cases/select_implicit.err
new file mode 100644
index 0000000000..9e5377b863
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_implicit.err
@@ -0,0 +1,293 @@
+<sql-statement>
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+</sql-statement>
+<sql-statement>
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+</sql-statement>
+<sql-statement>
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group using reference number out of range
+ ^
+ -stdin-:<main>:3:54: Error: GROUP BY: position 3 is not in select list
+ SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-stdin-:<main>: Fatal: ydb/library/yql/ast/yql_expr.h:1785: no children
+
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b ORDER BY b;
+ ^
+<sql-statement>
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- order w/ target under ambiguous condition
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ -- order w/ target under ambiguous condition
+ ^
+<sql-statement>
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target2;
+</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.test_missing_target2
+
+<sql-statement>
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b/2 ORDER BY b/2;
+ ^
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+ -stdin-:<main>:3:14: Error: Column reference is ambiguous: b
+ SELECT count(b) FROM test_missing_target x, test_missing_target y
+ ^
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target3;
+</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.test_missing_target3
+
+<sql-statement>
+-- Cleanup
+DROP TABLE test_missing_target;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target3;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_implicit.err.1 b/yql/essentials/tests/postgresql/cases/select_implicit.err.1
new file mode 100644
index 0000000000..9e5377b863
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_implicit.err.1
@@ -0,0 +1,293 @@
+<sql-statement>
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+</sql-statement>
+<sql-statement>
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+</sql-statement>
+<sql-statement>
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group using reference number out of range
+ ^
+ -stdin-:<main>:3:54: Error: GROUP BY: position 3 is not in select list
+ SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-stdin-:<main>: Fatal: ydb/library/yql/ast/yql_expr.h:1785: no children
+
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b ORDER BY b;
+ ^
+<sql-statement>
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- order w/ target under ambiguous condition
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ -- order w/ target under ambiguous condition
+ ^
+<sql-statement>
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target2;
+</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.test_missing_target2
+
+<sql-statement>
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b/2 ORDER BY b/2;
+ ^
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+ -stdin-:<main>:3:14: Error: Column reference is ambiguous: b
+ SELECT count(b) FROM test_missing_target x, test_missing_target y
+ ^
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target3;
+</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.test_missing_target3
+
+<sql-statement>
+-- Cleanup
+DROP TABLE test_missing_target;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target3;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_implicit.err.2 b/yql/essentials/tests/postgresql/cases/select_implicit.err.2
new file mode 100644
index 0000000000..9e5377b863
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_implicit.err.2
@@ -0,0 +1,293 @@
+<sql-statement>
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+</sql-statement>
+<sql-statement>
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+</sql-statement>
+<sql-statement>
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+</sql-statement>
+<sql-statement>
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group using reference number out of range
+ ^
+ -stdin-:<main>:3:54: Error: GROUP BY: position 3 is not in select list
+ SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-stdin-:<main>: Fatal: ydb/library/yql/ast/yql_expr.h:1785: no children
+
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b ORDER BY b;
+ ^
+<sql-statement>
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- order w/ target under ambiguous condition
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: a
+ -- order w/ target under ambiguous condition
+ ^
+<sql-statement>
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+</sql-statement>
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target2;
+</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.test_missing_target2
+
+<sql-statement>
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: OrderedMap, At function: Sort
+ -- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+ ^
+ -stdin-:<main>:3:62: Error: At function: Member
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+ -stdin-:<main>:3:62: Error: Member not found: _alias_test_missing_target.b
+ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+<sql-statement>
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+<sql-statement>
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+</sql-statement>
+<sql-statement>
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+</sql-statement>
+<sql-statement>
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+ ^
+ -stdin-:<main>:5:11: Error: Column reference is ambiguous: b
+ GROUP BY b/2 ORDER BY b/2;
+ ^
+<sql-statement>
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+ -stdin-:<main>:3:14: Error: Column reference is ambiguous: b
+ SELECT count(b) FROM test_missing_target x, test_missing_target y
+ ^
+<sql-statement>
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- group w/o existing GROUP BY target under ambiguous condition
+ ^
+<sql-statement>
+SELECT * FROM test_missing_target3;
+</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.test_missing_target3
+
+<sql-statement>
+-- Cleanup
+DROP TABLE test_missing_target;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target2;
+</sql-statement>
+<sql-statement>
+DROP TABLE test_missing_target3;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_implicit.out b/yql/essentials/tests/postgresql/cases/select_implicit.out
new file mode 100644
index 0000000000..507640d566
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_implicit.out
@@ -0,0 +1,245 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ CCCC | 2
+ XXXX | 1
+ bbbb | 1
+ cccc | 2
+(6 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ count
+-------
+ 2
+ 2
+ 2
+ 1
+ 1
+ 2
+(6 rows)
+
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+ c
+----------
+ XXXX
+ ABAB
+ ABAB
+ BBBB
+ BBBB
+ bbbb
+ cccc
+ cccc
+ CCCC
+ CCCC
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+ count
+-------
+ 4
+ 3
+ 2
+ 1
+(4 rows)
+
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+ count
+-------
+ 10
+(1 row)
+
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ CCCC | 2
+ XXXX | 1
+ bbbb | 1
+ cccc | 2
+(6 rows)
+
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 0 | 0
+ 1 | 1
+ 1 | 1
+ 2 | 2
+ 2 | 2
+ 3 | 3
+ 3 | 3
+ 4 | 4
+ 4 | 4
+(10 rows)
+
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(5 rows)
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+ ?column? | count
+----------+-------
+ 0 | 5
+ 1 | 5
+(2 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+ count
+-------
+ 2
+ 3
+ 4
+ 1
+(4 rows)
+
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+ lower | count
+-------+-------
+ abab | 2
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+ a
+---
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+ count
+-------
+ 7
+ 3
+(2 rows)
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+ ?column? | count
+----------+-------
+ 0 | 1
+ 1 | 5
+ 2 | 4
+(3 rows)
+
+-- Cleanup
+DROP TABLE test_missing_target;
diff --git a/yql/essentials/tests/postgresql/cases/select_implicit.sql b/yql/essentials/tests/postgresql/cases/select_implicit.sql
new file mode 100644
index 0000000000..23088cfd22
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_implicit.sql
@@ -0,0 +1,77 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+-- Cleanup
+DROP TABLE test_missing_target;
diff --git a/yql/essentials/tests/postgresql/cases/select_into.err b/yql/essentials/tests/postgresql/cases/select_into.err
new file mode 100644
index 0000000000..190143baf1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_into.err
@@ -0,0 +1,543 @@
+Registering pre-existing tables
+ onek
+ onek2
+ int8_tbl
+<sql-statement>
+--
+-- SELECT_INTO
+--
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek
+ WHERE onek.unique1 < 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ --
+ ^
+<sql-statement>
+DROP TABLE sitmp1;
+</sql-statement>
+<sql-statement>
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek2
+ WHERE onek2.unique1 < 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ SELECT *
+ ^
+<sql-statement>
+DROP TABLE sitmp1;
+</sql-statement>
+<sql-statement>
+--
+-- SELECT INTO and INSERT permission, if owner is not allowed to insert.
+--
+CREATE SCHEMA selinto_schema;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 292
+ --
+ ^
+<sql-statement>
+CREATE USER regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
+ CREATE USER regress_selinto_user;
+ ^
+<sql-statement>
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ REVOKE INSERT ON TABLES FROM regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 250
+ ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ ^
+<sql-statement>
+GRANT ALL ON SCHEMA selinto_schema TO public;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ GRANT ALL ON SCHEMA selinto_schema TO public;
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_selinto_user;
+ ^
+<sql-statement>
+-- WITH DATA, passes.
+CREATE TABLE selinto_schema.tbl_withdata1 (a)
+ AS SELECT generate_series(1,3) WITH DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- WITH DATA, passes.
+ ^
+<sql-statement>
+INSERT INTO selinto_schema.tbl_withdata1 VALUES (4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Unknown cluster: selinto_schema
+ INSERT INTO selinto_schema.tbl_withdata1 VALUES (4);
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata2 (a) AS
+ SELECT generate_series(1,3) WITH DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+-- WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata1 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- WITH NO DATA, passes.
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata2 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+-- EXECUTE and WITH DATA, passes.
+PREPARE data_sel AS SELECT generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ -- EXECUTE and WITH DATA, passes.
+ ^
+<sql-statement>
+CREATE TABLE selinto_schema.tbl_withdata3 (a) AS
+ EXECUTE data_sel WITH DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE selinto_schema.tbl_withdata3 (a) AS
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata4 (a) AS
+ EXECUTE data_sel WITH DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+-- EXECUTE and WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata3 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- EXECUTE and WITH NO DATA, passes.
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata4 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET SESSION AUTHORIZATION;
+ ^
+<sql-statement>
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ GRANT INSERT ON TABLES TO regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 250
+ ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_selinto_user;
+ ^
+<sql-statement>
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET SESSION AUTHORIZATION;
+ ^
+<sql-statement>
+DEALLOCATE data_sel;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 303
+ DEALLOCATE data_sel;
+ ^
+<sql-statement>
+DROP SCHEMA selinto_schema CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 228
+ DROP SCHEMA selinto_schema CASCADE;
+ ^
+<sql-statement>
+DROP USER regress_selinto_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
+ DROP USER regress_selinto_user;
+ ^
+<sql-statement>
+-- Tests for WITH NO DATA and column name consistency
+CREATE TABLE ctas_base (i int, j int);
+</sql-statement>
+<sql-statement>
+INSERT INTO ctas_base VALUES (1, 2);
+</sql-statement>
+<sql-statement>
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base; -- Error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base; -- Error
+ ^
+<sql-statement>
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base WITH NO DATA; -- Error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base WITH NO DATA; -- Error
+ ^
+<sql-statement>
+CREATE TABLE ctas_nodata (ii, jj) AS SELECT i, j FROM ctas_base; -- OK
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata (ii, jj) AS SELECT i, j FROM ctas_base; -- OK
+ ^
+<sql-statement>
+CREATE TABLE ctas_nodata_2 (ii, jj) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata_2 (ii, jj) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+ ^
+<sql-statement>
+CREATE TABLE ctas_nodata_3 (ii) AS SELECT i, j FROM ctas_base; -- OK
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata_3 (ii) AS SELECT i, j FROM ctas_base; -- OK
+ ^
+<sql-statement>
+CREATE TABLE ctas_nodata_4 (ii) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_nodata_4 (ii) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+ ^
+<sql-statement>
+SELECT * FROM ctas_nodata;
+</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.ctas_nodata
+
+<sql-statement>
+SELECT * FROM ctas_nodata_2;
+</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.ctas_nodata_2
+
+<sql-statement>
+SELECT * FROM ctas_nodata_3;
+</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.ctas_nodata_3
+
+<sql-statement>
+SELECT * FROM ctas_nodata_4;
+</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.ctas_nodata_4
+
+<sql-statement>
+DROP TABLE ctas_base;
+</sql-statement>
+<sql-statement>
+DROP TABLE ctas_nodata;
+</sql-statement>
+<sql-statement>
+DROP TABLE ctas_nodata_2;
+</sql-statement>
+<sql-statement>
+DROP TABLE ctas_nodata_3;
+</sql-statement>
+<sql-statement>
+DROP TABLE ctas_nodata_4;
+</sql-statement>
+<sql-statement>
+--
+-- CREATE TABLE AS/SELECT INTO as last command in a SQL function
+-- have been known to cause problems
+--
+CREATE FUNCTION make_table() RETURNS VOID
+AS $$
+ CREATE TABLE created_table AS SELECT * FROM int8_tbl;
+$$ LANGUAGE SQL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ --
+ ^
+<sql-statement>
+SELECT make_table();
+</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 make_table();
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT make_table();
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: make_table
+ SELECT make_table();
+ ^
+<sql-statement>
+SELECT * FROM created_table;
+</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.created_table
+
+<sql-statement>
+-- Try EXPLAIN ANALYZE SELECT INTO and EXPLAIN ANALYZE CREATE TABLE AS
+-- WITH NO DATA, but hide the outputs since they won't be stable.
+DO $$
+BEGIN
+ EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
+ EXECUTE 'EXPLAIN ANALYZE CREATE TABLE easi2 AS SELECT * FROM int8_tbl WITH NO DATA';
+END$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263
+ -- Try EXPLAIN ANALYZE SELECT INTO and EXPLAIN ANALYZE CREATE TABLE AS
+ ^
+<sql-statement>
+DROP TABLE created_table;
+</sql-statement>
+<sql-statement>
+DROP TABLE easi, easi2;
+</sql-statement>
+<sql-statement>
+--
+-- Disallowed uses of SELECT ... INTO. All should fail
+--
+DECLARE foo CURSOR FOR SELECT 1 INTO b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ --
+ ^
+<sql-statement>
+COPY (SELECT 1 INTO frak UNION SELECT 2) TO 'blob';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 253
+ COPY (SELECT 1 INTO frak UNION SELECT 2) TO 'blob';
+ ^
+<sql-statement>
+SELECT * FROM (SELECT 1 INTO f) bar;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ SELECT * FROM (SELECT 1 INTO f) bar;
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT * FROM (SELECT 1 INTO f) bar;
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT * FROM (SELECT 1 INTO f) bar;
+ ^
+<sql-statement>
+CREATE VIEW foo AS SELECT 1 INTO b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW foo AS SELECT 1 INTO b;
+ ^
+<sql-statement>
+INSERT INTO b SELECT 1 INTO f;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: not supported intoClause
+ INSERT INTO b SELECT 1 INTO f;
+ ^
+<sql-statement>
+-- Test CREATE TABLE AS ... IF NOT EXISTS
+CREATE TABLE ctas_ine_tbl AS SELECT 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ -- Test CREATE TABLE AS ... IF NOT EXISTS
+ ^
+<sql-statement>
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+ ^
+<sql-statement>
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+ ^
+<sql-statement>
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+ ^
+<sql-statement>
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+PREPARE ctas_ine_query AS SELECT 1 / 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ PREPARE ctas_ine_query AS SELECT 1 / 0;
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS EXECUTE ctas_ine_query; -- error
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS EXECUTE ctas_ine_query; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ ^
+<sql-statement>
+DROP TABLE ctas_ine_tbl;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/select_into.out b/yql/essentials/tests/postgresql/cases/select_into.out
new file mode 100644
index 0000000000..772dc0419b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_into.out
@@ -0,0 +1,4 @@
+-- Tests for WITH NO DATA and column name consistency
+CREATE TABLE ctas_base (i int, j int);
+INSERT INTO ctas_base VALUES (1, 2);
+DROP TABLE ctas_base;
diff --git a/yql/essentials/tests/postgresql/cases/select_into.sql b/yql/essentials/tests/postgresql/cases/select_into.sql
new file mode 100644
index 0000000000..772dc0419b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/select_into.sql
@@ -0,0 +1,4 @@
+-- Tests for WITH NO DATA and column name consistency
+CREATE TABLE ctas_base (i int, j int);
+INSERT INTO ctas_base VALUES (1, 2);
+DROP TABLE ctas_base;
diff --git a/yql/essentials/tests/postgresql/cases/strings.err b/yql/essentials/tests/postgresql/cases/strings.err
new file mode 100644
index 0000000000..d93637d2e9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/strings.err
@@ -0,0 +1,2139 @@
+Registering pre-existing tables
+ text_tbl
+ VARCHAR_TBL
+ CHAR_TBL
+ TEXT_TBL
+ varchar_tbl
+<sql-statement>
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+-- SQL string continuation syntax
+-- E021-03 character string literals
+SELECT 'first line'
+' - next line'
+ ' - third line'
+ AS "Three lines to one";
+</sql-statement>
+<sql-statement>
+-- illegal string continuation syntax
+SELECT 'first line'
+' - next line' /* this comment is not allowed here */
+' - third line'
+ AS "Illegal comment within continuation";
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:1: Error: ERROR: syntax error at or near "' - third line'"
+
+ ' - third line'
+ ^
+<sql-statement>
+-- Unicode escapes
+SET standard_conforming_strings TO on;
+</sql-statement>
+<sql-statement>
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+</sql-statement>
+<sql-statement>
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+</sql-statement>
+<sql-statement>
+SELECT U&'a\\b' AS "a\b";
+</sql-statement>
+<sql-statement>
+SELECT U&' \' UESCAPE '!' AS "tricky";
+</sql-statement>
+<sql-statement>
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+</sql-statement>
+<sql-statement>
+SELECT U&'wrong: \061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:19: Error: ERROR: invalid Unicode escape
+
+ SELECT U&'wrong: \061';
+ ^
+<sql-statement>
+SELECT U&'wrong: \+0061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:19: Error: ERROR: invalid Unicode escape
+
+ SELECT U&'wrong: \+0061';
+ ^
+<sql-statement>
+SELECT U&'wrong: +0061' UESCAPE +;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:34: Error: ERROR: UESCAPE must be followed by a simple string literal at or near "+"
+
+ SELECT U&'wrong: +0061' UESCAPE +;
+ ^
+<sql-statement>
+SELECT U&'wrong: +0061' UESCAPE '+';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:34: Error: ERROR: invalid Unicode escape character at or near "'+'"
+
+ SELECT U&'wrong: +0061' UESCAPE '+';
+ ^
+<sql-statement>
+SELECT U&'wrong: \db99';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair
+
+ SELECT U&'wrong: \db99';
+ ^
+<sql-statement>
+SELECT U&'wrong: \db99xy';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair
+
+ SELECT U&'wrong: \db99xy';
+ ^
+<sql-statement>
+SELECT U&'wrong: \db99\\';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair
+
+ SELECT U&'wrong: \db99\\';
+ ^
+<sql-statement>
+SELECT U&'wrong: \db99\0061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair
+
+ SELECT U&'wrong: \db99\0061';
+ ^
+<sql-statement>
+SELECT U&'wrong: \+00db99\+000061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:27: Error: ERROR: invalid Unicode surrogate pair
+
+ SELECT U&'wrong: \+00db99\+000061';
+ ^
+<sql-statement>
+SELECT U&'wrong: \+2FFFFF';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:19: Error: ERROR: invalid Unicode escape value
+
+ SELECT U&'wrong: \+2FFFFF';
+ ^
+<sql-statement>
+-- while we're here, check the same cases in E-style literals
+SELECT E'd\u0061t\U00000061' AS "data";
+</sql-statement>
+<sql-statement>
+SELECT E'a\\b' AS "a\b";
+</sql-statement>
+<sql-statement>
+SELECT E'wrong: \u061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: ERROR: invalid Unicode escape
+
+ SELECT E'wrong: \u061';
+ ^
+<sql-statement>
+SELECT E'wrong: \U0061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: ERROR: invalid Unicode escape
+
+ SELECT E'wrong: \U0061';
+ ^
+<sql-statement>
+SELECT E'wrong: \udb99';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair at or near "'"
+
+ SELECT E'wrong: \udb99';
+ ^
+<sql-statement>
+SELECT E'wrong: \udb99xy';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair at or near "x"
+
+ SELECT E'wrong: \udb99xy';
+ ^
+<sql-statement>
+SELECT E'wrong: \udb99\\';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair at or near "\"
+
+ SELECT E'wrong: \udb99\\';
+ ^
+<sql-statement>
+SELECT E'wrong: \udb99\u0061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:24: Error: ERROR: invalid Unicode surrogate pair at or near "\u0061"
+
+ SELECT E'wrong: \udb99\u0061';
+ ^
+<sql-statement>
+SELECT E'wrong: \U0000db99\U00000061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:28: Error: ERROR: invalid Unicode surrogate pair at or near "\U00000061"
+
+ SELECT E'wrong: \U0000db99\U00000061';
+ ^
+<sql-statement>
+SELECT E'wrong: \U002FFFFF';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: ERROR: invalid Unicode escape value at or near "\U002FFFFF"
+
+ SELECT E'wrong: \U002FFFFF';
+ ^
+<sql-statement>
+SET standard_conforming_strings TO off;
+</sql-statement>
+<sql-statement>
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+</sql-statement>
+<sql-statement>
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+</sql-statement>
+<sql-statement>
+SELECT U&' \' UESCAPE '!' AS "tricky";
+</sql-statement>
+<sql-statement>
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+</sql-statement>
+<sql-statement>
+SELECT U&'wrong: \061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:19: Error: ERROR: invalid Unicode escape
+
+ SELECT U&'wrong: \061';
+ ^
+<sql-statement>
+SELECT U&'wrong: \+0061';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:19: Error: ERROR: invalid Unicode escape
+
+ SELECT U&'wrong: \+0061';
+ ^
+<sql-statement>
+SELECT U&'wrong: +0061' UESCAPE '+';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:34: Error: ERROR: invalid Unicode escape character at or near "'+'"
+
+ SELECT U&'wrong: +0061' UESCAPE '+';
+ ^
+<sql-statement>
+RESET standard_conforming_strings;
+</sql-statement>
+<sql-statement>
+-- bytea
+SET bytea_output TO hex;
+</sql-statement>
+<sql-statement>
+SELECT E'\\xDeAdBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'\\x De Ad Be Ef '::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'\\xDeAdBeE'::bytea;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT E'\\xDeAdBeE'::bytea;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid hexadecimal data: odd number of digits
+
+ SELECT E'\\xDeAdBeE'::bytea;
+ ^
+<sql-statement>
+SELECT E'\\xDeAdBeEx'::bytea;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT E'\\xDeAdBeEx'::bytea;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid hexadecimal digit: "x"
+
+ SELECT E'\\xDeAdBeEx'::bytea;
+ ^
+<sql-statement>
+SELECT E'\\xDe00BeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'DeAdBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\\000dBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\123dBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\\123dBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\\678dBeEf'::bytea;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT E'De\\678dBeEf'::bytea;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type bytea
+
+ SELECT E'De\\678dBeEf'::bytea;
+ ^
+<sql-statement>
+SET bytea_output TO escape;
+</sql-statement>
+<sql-statement>
+SELECT E'\\xDeAdBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'\\x De Ad Be Ef '::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'\\xDe00BeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'DeAdBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\\000dBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+SELECT E'De\\123dBeEf'::bytea;
+</sql-statement>
+<sql-statement>
+--
+-- test conversions between various string types
+-- E021-10 implicit casting among the character data types
+--
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+</sql-statement>
+<sql-statement>
+-- since this is an explicit cast, it should truncate w/o error:
+SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
+</sql-statement>
+<sql-statement>
+-- note: implicit-cast case is tested in char.sql
+SELECT CAST(f1 AS char(20)) AS "char(text)" FROM TEXT_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
+</sql-statement>
+<sql-statement>
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+</sql-statement>
+<sql-statement>
+--
+-- test SQL string functions
+-- E### and T### are feature reference numbers from SQL99
+--
+-- E021-09 trim function
+SELECT TRIM(BOTH FROM ' bunch o blanks ') = 'bunch o blanks' AS "bunch o blanks";
+</sql-statement>
+<sql-statement>
+SELECT TRIM(LEADING FROM ' bunch o blanks ') = 'bunch o blanks ' AS "bunch o blanks ";
+</sql-statement>
+<sql-statement>
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') = ' bunch o blanks' AS " bunch o blanks";
+</sql-statement>
+<sql-statement>
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') = 'some Xs' AS "some Xs";
+</sql-statement>
+<sql-statement>
+-- E021-06 substring expression
+SELECT SUBSTRING('1234567890' FROM 3) = '34567890' AS "34567890";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
+</sql-statement>
+<sql-statement>
+-- test overflow cases
+SELECT SUBSTRING('string' FROM 2 FOR 2147483646) AS "tring";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('string' FROM -10 FOR 2147483646) AS "string";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+ ^
+<sql-statement>
+-- T581 regular expression substring (with SQL's bizarre regexp syntax)
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"(b_d)#"%' ESCAPE '#') AS "bcd";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- T581 regular expression substring (with SQL's bizarre regexp syntax)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"(b_d)#"%"
+
+ -- T581 regular expression substring (with SQL's bizarre regexp syntax)
+ ^
+<sql-statement>
+-- obsolete SQL99 syntax
+SELECT SUBSTRING('abcdefg' FROM 'a#"(b_d)#"%' FOR '#') AS "bcd";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- obsolete SQL99 syntax
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"(b_d)#"%"
+
+ -- obsolete SQL99 syntax
+ ^
+<sql-statement>
+-- No match should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '#"(b_d)#"%' ESCAPE '#') IS NULL AS "True";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- No match should return NULL
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "#"(b_d)#"%"
+
+ -- No match should return NULL
+ ^
+<sql-statement>
+-- Null inputs should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '%' ESCAPE NULL) IS NULL AS "True";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Null inputs should return NULL
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "%"
+
+ -- Null inputs should return NULL
+ ^
+<sql-statement>
+SELECT SUBSTRING(NULL SIMILAR '%' ESCAPE '#') IS NULL AS "True";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('abcdefg' SIMILAR NULL ESCAPE '#') IS NULL AS "True";
+</sql-statement>
+<sql-statement>
+-- The first and last parts should act non-greedy
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"g' ESCAPE '#') AS "bcdef";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- The first and last parts should act non-greedy
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"%#"g"
+
+ -- The first and last parts should act non-greedy
+ ^
+<sql-statement>
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*' ESCAPE '#') AS "abcdefg";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*' ESCAPE '#') AS "abcdefg";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a*#"%#"g*"
+
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*' ESCAPE '#') AS "abcdefg";
+ ^
+<sql-statement>
+-- Vertical bar in any part affects only that part
+SELECT SUBSTRING('abcdefg' SIMILAR 'a|b#"%#"g' ESCAPE '#') AS "bcdef";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Vertical bar in any part affects only that part
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a|b#"%#"g"
+
+ -- Vertical bar in any part affects only that part
+ ^
+<sql-statement>
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"x|g' ESCAPE '#') AS "bcdef";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"x|g' ESCAPE '#') AS "bcdef";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"%#"x|g"
+
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"x|g' ESCAPE '#') AS "bcdef";
+ ^
+<sql-statement>
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%|ab#"g' ESCAPE '#') AS "bcdef";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%|ab#"g' ESCAPE '#') AS "bcdef";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"%|ab#"g"
+
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%|ab#"g' ESCAPE '#') AS "bcdef";
+ ^
+<sql-statement>
+-- Can't have more than two part separators
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*#"x' ESCAPE '#') AS "error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Can't have more than two part separators
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a*#"%#"g*#"x"
+
+ -- Can't have more than two part separators
+ ^
+<sql-statement>
+-- Postgres extension: with 0 or 1 separator, assume parts 1 and 3 are empty
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%g' ESCAPE '#') AS "bcdefg";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Postgres extension: with 0 or 1 separator, assume parts 1 and 3 are empty
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a#"%g"
+
+ -- Postgres extension: with 0 or 1 separator, assume parts 1 and 3 are empty
+ ^
+<sql-statement>
+SELECT SUBSTRING('abcdefg' SIMILAR 'a%g' ESCAPE '#') AS "abcdefg";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a%g' ESCAPE '#') AS "abcdefg";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "a%g"
+
+ SELECT SUBSTRING('abcdefg' SIMILAR 'a%g' ESCAPE '#') AS "abcdefg";
+ ^
+<sql-statement>
+-- substring() with just two arguments is not allowed by SQL spec;
+-- we accept it, but we interpret the pattern as a POSIX regexp not SQL
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+</sql-statement>
+<sql-statement>
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
+</sql-statement>
+<sql-statement>
+-- Check behavior of SIMILAR TO, which uses largely the same regexp variant
+SELECT 'abcdefg' SIMILAR TO '_bcd%' AS true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO '_bcd%' AS true;
+ ^
+<sql-statement>
+SELECT 'abcdefg' SIMILAR TO 'bcd%' AS false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO 'bcd%' AS false;
+ ^
+<sql-statement>
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '#' AS false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '#' AS false;
+ ^
+<sql-statement>
+SELECT 'abcd%' SIMILAR TO '_bcd#%' ESCAPE '#' AS true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:16: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcd%' SIMILAR TO '_bcd#%' ESCAPE '#' AS true;
+ ^
+<sql-statement>
+-- Postgres uses '\' as the default escape character, which is not per spec
+SELECT 'abcdefg' SIMILAR TO '_bcd\%' AS false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO '_bcd\%' AS false;
+ ^
+<sql-statement>
+-- and an empty string to mean "no escape", which is also not per spec
+SELECT 'abcd\efg' SIMILAR TO '_bcd\%' ESCAPE '' AS true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcd\efg' SIMILAR TO '_bcd\%' ESCAPE '' AS true;
+ ^
+<sql-statement>
+-- these behaviors are per spec, though:
+SELECT 'abcdefg' SIMILAR TO '_bcd%' ESCAPE NULL AS null;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO '_bcd%' ESCAPE NULL AS null;
+ ^
+<sql-statement>
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '##' AS error;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: A_Expr_Kind unsupported value: 9
+ SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '##' AS error;
+ ^
+<sql-statement>
+-- Test back reference in regexp_replace
+SELECT regexp_replace('1112223333', E'(\\d{3})(\\d{3})(\\d{4})', E'(\\1) \\2-\\3');
+</sql-statement>
+<sql-statement>
+SELECT regexp_replace('AAA BBB CCC ', E'\\s+', ' ', 'g');
+</sql-statement>
+<sql-statement>
+SELECT regexp_replace('AAA', '^|$', 'Z', 'g');
+</sql-statement>
+<sql-statement>
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'gi');
+</sql-statement>
+<sql-statement>
+-- invalid regexp option
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'z');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- invalid regexp option
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid regular expression option: "z"
+
+ -- invalid regexp option
+ ^
+<sql-statement>
+-- set so we can tell NULL from empty string
+\pset null '\\N'
+</sql-statement>
+<sql-statement>
+-- return all matches from regexp
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
+ ^
+<sql-statement>
+-- test case insensitive
+SELECT regexp_matches('foObARbEqUEbAz', $re$(bar)(beque)$re$, 'i');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foObARbEqUEbAz', $re$(bar)(beque)$re$, 'i');
+ ^
+<sql-statement>
+-- global option - more than one match
+SELECT regexp_matches('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g');
+ ^
+<sql-statement>
+-- empty capture group (matched empty string)
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.*)(beque)$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(.*)(beque)$re$);
+ ^
+<sql-statement>
+-- no match
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)(beque)$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)(beque)$re$);
+ ^
+<sql-statement>
+-- optional capture group did not match, null entry in array
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)?(beque)$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)?(beque)$re$);
+ ^
+<sql-statement>
+-- no capture groups
+SELECT regexp_matches('foobarbequebaz', $re$barbeque$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$barbeque$re$);
+ ^
+<sql-statement>
+-- start/end-of-line matches are of zero length
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '^', 'mg');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '^', 'mg');
+ ^
+<sql-statement>
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '$', 'mg');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '$', 'mg');
+ ^
+<sql-statement>
+SELECT regexp_matches('1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '^.?', 'mg');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '^.?', 'mg');
+ ^
+<sql-statement>
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '.?$', 'mg');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '.?$', 'mg');
+ ^
+<sql-statement>
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4', '.?$', 'mg');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4', '.?$', 'mg');
+ ^
+<sql-statement>
+-- give me errors
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$, 'gz');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$, 'gz');
+ ^
+<sql-statement>
+SELECT regexp_matches('foobarbequebaz', $re$(barbeque$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(barbeque$re$);
+ ^
+<sql-statement>
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque){2,1}$re$);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque){2,1}$re$);
+ ^
+<sql-statement>
+-- split string on regexp
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s+$re$) AS foo;
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s+$re$);
+</sql-statement>
+<sql-statement>
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s*$re$) AS foo;
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s*$re$);
+</sql-statement>
+<sql-statement>
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '') AS foo;
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '');
+</sql-statement>
+<sql-statement>
+-- case insensitive
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i') AS foo;
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i');
+</sql-statement>
+<sql-statement>
+-- no match of pattern
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', 'nomatch') AS foo;
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', 'nomatch');
+</sql-statement>
+<sql-statement>
+-- some corner cases
+SELECT regexp_split_to_array('123456','1');
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('123456','6');
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('123456','.');
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('123456','');
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('123456','(?:)');
+</sql-statement>
+<sql-statement>
+SELECT regexp_split_to_array('1','');
+</sql-statement>
+<sql-statement>
+-- errors
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'zippy') AS foo;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid regular expression option: "z"
+
+ -- errors
+ ^
+<sql-statement>
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid regular expression option: "z"
+
+ SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+ ^
+<sql-statement>
+-- global option meaningless for regexp_split
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g') AS foo;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- global option meaningless for regexp_split
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: regexp_split_to_table() does not support the "global" option
+
+ -- global option meaningless for regexp_split
+ ^
+<sql-statement>
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: regexp_split_to_array() does not support the "global" option
+
+ SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+ ^
+<sql-statement>
+-- change NULL-display back
+\pset null ''
+</sql-statement>
+<sql-statement>
+-- E021-11 position expression
+SELECT POSITION('4' IN '1234567890') = '4' AS "4";
+</sql-statement>
+<sql-statement>
+SELECT POSITION('5' IN '1234567890') = '5' AS "5";
+</sql-statement>
+<sql-statement>
+-- T312 character overlay function
+SELECT OVERLAY('abcdef' PLACING '45' FROM 4) AS "abc45f";
+</sql-statement>
+<sql-statement>
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5) AS "yabadaba";
+</sql-statement>
+<sql-statement>
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5 FOR 0) AS "yabadabadoo";
+</sql-statement>
+<sql-statement>
+SELECT OVERLAY('babosa' PLACING 'ubb' FROM 2 FOR 4) AS "bubba";
+</sql-statement>
+<sql-statement>
+--
+-- test LIKE
+-- Be sure to form every test as a LIKE/NOT LIKE pair.
+--
+-- simplest examples
+-- E061-04 like predicate
+SELECT 'hawkeye' LIKE 'h%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT LIKE 'h%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' LIKE 'H%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT LIKE 'H%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' LIKE 'indio%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT LIKE 'indio%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' LIKE 'h%eye' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' LIKE '_ndio' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' NOT LIKE '_ndio' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' LIKE 'in__o' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' NOT LIKE 'in__o' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' LIKE 'in_o' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' NOT LIKE 'in_o' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'abc'::name LIKE '_b_' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'abc'::name NOT LIKE '_b_' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'abc'::bytea LIKE '_b_'::bytea AS "true";
+</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 'abc'::bytea LIKE '_b_'::bytea AS "true";
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgLike
+ SELECT 'abc'::bytea LIKE '_b_'::bytea AS "true";
+ ^
+ -stdin-:<main>:1:21: Error: Expected pg text, but got bytea
+ SELECT 'abc'::bytea LIKE '_b_'::bytea AS "true";
+ ^
+<sql-statement>
+SELECT 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+</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 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgNot, At function: PgLike
+ SELECT 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+ ^
+ -stdin-:<main>:1:21: Error: Expected pg text, but got bytea
+ SELECT 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+ ^
+<sql-statement>
+-- unused escape character
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT LIKE 'h%' ESCAPE '#' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' LIKE 'ind_o' ESCAPE '$' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' NOT LIKE 'ind_o' ESCAPE '$' AS "false";
+</sql-statement>
+<sql-statement>
+-- escape character
+-- E061-05 like predicate with escape clause
+SELECT 'h%' LIKE 'h#%' ESCAPE '#' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'h%' NOT LIKE 'h#%' ESCAPE '#' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'h%wkeye' NOT LIKE 'h#%' ESCAPE '#' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'h%wkeye' LIKE 'h#%%' ESCAPE '#' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'h%wkeye' NOT LIKE 'h#%%' ESCAPE '#' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'h%awkeye' LIKE 'h#%a%k%e' ESCAPE '#' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'h%awkeye' NOT LIKE 'h#%a%k%e' ESCAPE '#' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' LIKE '_ndio' ESCAPE '$' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'indio' NOT LIKE '_ndio' ESCAPE '$' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' LIKE 'i$_d_o' ESCAPE '$' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' NOT LIKE 'i$_d_o' ESCAPE '$' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' LIKE 'i$_nd_o' ESCAPE '$' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' NOT LIKE 'i$_nd_o' ESCAPE '$' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' LIKE 'i$_d%o' ESCAPE '$' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'i_dio' NOT LIKE 'i$_d%o' ESCAPE '$' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+</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 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgLike
+ SELECT 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+ ^
+ -stdin-:<main>:1:21: Error: Expected pg text, but got bytea
+ SELECT 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+ ^
+<sql-statement>
+SELECT 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+</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 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+ ^
+ -stdin-:<main>:1:21: Error: At function: PgNot, At function: PgLike
+ SELECT 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+ ^
+ -stdin-:<main>:1:21: Error: Expected pg text, but got bytea
+ SELECT 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+ ^
+<sql-statement>
+-- escape character same as pattern character
+SELECT 'maca' LIKE 'm%aca' ESCAPE '%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'maca' NOT LIKE 'm%aca' ESCAPE '%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'ma%a' LIKE 'm%a%%a' ESCAPE '%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'ma%a' NOT LIKE 'm%a%%a' ESCAPE '%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'bear' LIKE 'b_ear' ESCAPE '_' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'bear' NOT LIKE 'b_ear' ESCAPE '_' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'be_r' LIKE 'b_e__r' ESCAPE '_' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'be_r' NOT LIKE 'b_e__r' ESCAPE '_' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'be_r' LIKE '__e__r' ESCAPE '_' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'be_r' NOT LIKE '__e__r' ESCAPE '_' AS "true";
+</sql-statement>
+<sql-statement>
+--
+-- test ILIKE (case-insensitive LIKE)
+-- Be sure to form every test as an ILIKE/NOT ILIKE pair.
+--
+SELECT 'hawkeye' ILIKE 'h%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT ILIKE 'h%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' ILIKE 'H%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT ILIKE 'H%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' ILIKE 'H%Eye' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'hawkeye' NOT ILIKE 'H%Eye' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'Hawkeye' ILIKE 'h%' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
+</sql-statement>
+<sql-statement>
+SELECT 'ABC'::name ILIKE '_b_' AS "true";
+</sql-statement>
+<sql-statement>
+SELECT 'ABC'::name NOT ILIKE '_b_' AS "false";
+</sql-statement>
+<sql-statement>
+--
+-- test %/_ combination cases, cf bugs #4821 and #5478
+--
+SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ --
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ --
+ ^
+<sql-statement>
+SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
+ ^
+<sql-statement>
+SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
+ ^
+<sql-statement>
+SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: t
+ SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
+ ^
+<sql-statement>
+SELECT 'jack' LIKE '%____%' AS t;
+</sql-statement>
+<sql-statement>
+--
+-- basic tests of LIKE with indexes
+--
+CREATE TABLE texttest (a text PRIMARY KEY, b int);
+</sql-statement>
+<sql-statement>
+SELECT * FROM texttest WHERE a LIKE '%1%';
+</sql-statement>
+<sql-statement>
+CREATE TABLE byteatest (a bytea PRIMARY KEY, b int);
+</sql-statement>
+<sql-statement>
+SELECT * FROM byteatest WHERE a LIKE '%1%';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT * FROM byteatest WHERE a LIKE '%1%';
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT * FROM byteatest WHERE a LIKE '%1%';
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgLike
+ SELECT * FROM byteatest WHERE a LIKE '%1%';
+ ^
+ -stdin-:<main>:1:33: Error: Expected pg text, but got bytea
+ SELECT * FROM byteatest WHERE a LIKE '%1%';
+ ^
+<sql-statement>
+DROP TABLE texttest, byteatest;
+</sql-statement>
+<sql-statement>
+--
+-- test implicit type conversion
+--
+-- E021-07 character concatenation
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+</sql-statement>
+<sql-statement>
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+</sql-statement>
+<sql-statement>
+SELECT char(20) 'characters' || ' and text' AS "Concat char to unknown type";
+</sql-statement>
+<sql-statement>
+SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
+</sql-statement>
+<sql-statement>
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+</sql-statement>
+<sql-statement>
+--
+-- test substr with toasted text values
+--
+CREATE TABLE toasttest(f1 text);
+</sql-statement>
+<sql-statement>
+insert into toasttest values(repeat('1234567890',10000));
+</sql-statement>
+<sql-statement>
+insert into toasttest values(repeat('1234567890',10000));
+</sql-statement>
+<sql-statement>
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ --
+ ^
+<sql-statement>
+insert into toasttest values(repeat('1234567890',10000));
+</sql-statement>
+<sql-statement>
+insert into toasttest values(repeat('1234567890',10000));
+</sql-statement>
+<sql-statement>
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+</sql-statement>
+<sql-statement>
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ -- If the length is less than zero, an ERROR is thrown.
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ -- If the length is less than zero, an ERROR is thrown.
+ ^
+<sql-statement>
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+</sql-statement>
+<sql-statement>
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+</sql-statement>
+<sql-statement>
+TRUNCATE TABLE toasttest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE toasttest;
+ ^
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+-- expect >0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- expect >0 blocks
+ ^
+ -stdin-:<main>:2:40: Error: At function: PgOp
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc pg_relation_size with given argument types: (oid)
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+<sql-statement>
+TRUNCATE TABLE toasttest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE toasttest;
+ ^
+<sql-statement>
+ALTER TABLE toasttest set (toast_tuple_target = 4080);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE toasttest set (toast_tuple_target = 4080);
+ ^
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest values (repeat('1234567890',300));
+</sql-statement>
+<sql-statement>
+-- expect 0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- expect 0 blocks
+ ^
+ -stdin-:<main>:2:40: Error: At function: PgOp
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc pg_relation_size with given argument types: (oid)
+ SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ ^
+<sql-statement>
+DROP TABLE toasttest;
+</sql-statement>
+<sql-statement>
+--
+-- test substr with toasted bytea values
+--
+CREATE TABLE toasttest(f1 bytea);
+</sql-statement>
+<sql-statement>
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+</sql-statement>
+<sql-statement>
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+</sql-statement>
+<sql-statement>
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ --
+ ^
+<sql-statement>
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+</sql-statement>
+<sql-statement>
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+</sql-statement>
+<sql-statement>
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+</sql-statement>
+<sql-statement>
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ -- If the length is less than zero, an ERROR is thrown.
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ -- If the length is less than zero, an ERROR is thrown.
+ ^
+<sql-statement>
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+</sql-statement>
+<sql-statement>
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+</sql-statement>
+<sql-statement>
+DROP TABLE toasttest;
+</sql-statement>
+<sql-statement>
+-- test internally compressing datums
+-- this tests compressing a datum to a very small size which exercises a
+-- corner case in packed-varlena handling: even though small, the compressed
+-- datum must be given a 4-byte header because there are no bits to indicate
+-- compression in a 1-byte header
+CREATE TABLE toasttest (c char(4096));
+</sql-statement>
+<sql-statement>
+INSERT INTO toasttest VALUES('x');
+</sql-statement>
+<sql-statement>
+SELECT length(c), c::text FROM toasttest;
+</sql-statement>
+<sql-statement>
+SELECT c FROM toasttest;
+</sql-statement>
+<sql-statement>
+DROP TABLE toasttest;
+</sql-statement>
+<sql-statement>
+--
+-- test length
+--
+SELECT length('abcdef') AS "length_6";
+</sql-statement>
+<sql-statement>
+--
+-- test strpos
+--
+SELECT strpos('abcdef', 'cd') AS "pos_3";
+</sql-statement>
+<sql-statement>
+SELECT strpos('abcdef', 'xy') AS "pos_0";
+</sql-statement>
+<sql-statement>
+SELECT strpos('abcdef', '') AS "pos_1";
+</sql-statement>
+<sql-statement>
+SELECT strpos('', 'xy') AS "pos_0";
+</sql-statement>
+<sql-statement>
+SELECT strpos('', '') AS "pos_1";
+</sql-statement>
+<sql-statement>
+--
+-- test replace
+--
+SELECT replace('abcdef', 'de', '45') AS "abc45f";
+</sql-statement>
+<sql-statement>
+SELECT replace('yabadabadoo', 'ba', '123') AS "ya123da123doo";
+</sql-statement>
+<sql-statement>
+SELECT replace('yabadoo', 'bad', '') AS "yaoo";
+</sql-statement>
+<sql-statement>
+--
+-- test split_part
+--
+select split_part('','@',1) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('','@',-1) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','',1) AS "joeuser@mydatabase";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','',2) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','',-1) AS "joeuser@mydatabase";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','',-2) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',0) AS "an error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select split_part('joeuser@mydatabase','@',0) AS "an error";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: field position must not be zero
+
+ select split_part('joeuser@mydatabase','@',0) AS "an error";
+ ^
+<sql-statement>
+select split_part('joeuser@mydatabase','@@',1) AS "joeuser@mydatabase";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@@',2) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',1) AS "joeuser";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',2) AS "mydatabase";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',3) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',-1) AS "mydatabase";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',-2) AS "joeuser";
+</sql-statement>
+<sql-statement>
+select split_part('joeuser@mydatabase','@',-3) AS "empty string";
+</sql-statement>
+<sql-statement>
+select split_part('@joeuser@mydatabase@','@',-2) AS "mydatabase";
+</sql-statement>
+<sql-statement>
+--
+-- test to_hex
+--
+select to_hex(256*256*256 - 1) AS "ffffff";
+</sql-statement>
+<sql-statement>
+select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
+</sql-statement>
+<sql-statement>
+--
+-- MD5 test suite - from IETF RFC 1321
+-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
+--
+select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5(''::bytea) = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('a'::bytea) = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('abc'::bytea) = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('message digest'::bytea) = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('abcdefghijklmnopqrstuvwxyz'::bytea) = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'::bytea) = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+</sql-statement>
+<sql-statement>
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890'::bytea) = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+</sql-statement>
+<sql-statement>
+--
+-- SHA-2
+--
+SET bytea_output TO hex;
+</sql-statement>
+<sql-statement>
+SELECT sha224('');
+</sql-statement>
+<sql-statement>
+SELECT sha224('The quick brown fox jumps over the lazy dog.');
+</sql-statement>
+<sql-statement>
+SELECT sha256('');
+</sql-statement>
+<sql-statement>
+SELECT sha256('The quick brown fox jumps over the lazy dog.');
+</sql-statement>
+<sql-statement>
+SELECT sha384('');
+</sql-statement>
+<sql-statement>
+SELECT sha384('The quick brown fox jumps over the lazy dog.');
+</sql-statement>
+<sql-statement>
+SELECT sha512('');
+</sql-statement>
+<sql-statement>
+SELECT sha512('The quick brown fox jumps over the lazy dog.');
+</sql-statement>
+<sql-statement>
+--
+-- encode/decode
+--
+SELECT encode('\x1234567890abcdef00', 'hex');
+</sql-statement>
+<sql-statement>
+SELECT decode('1234567890abcdef00', 'hex');
+</sql-statement>
+<sql-statement>
+SELECT encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea, 'base64');
+</sql-statement>
+<sql-statement>
+SELECT decode(encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea,
+ 'base64'), 'base64');
+</sql-statement>
+<sql-statement>
+SELECT encode('\x1234567890abcdef00', 'escape');
+</sql-statement>
+<sql-statement>
+SELECT decode(encode('\x1234567890abcdef00', 'escape'), 'escape');
+</sql-statement>
+<sql-statement>
+--
+-- get_bit/set_bit etc
+--
+SELECT get_bit('\x1234567890abcdef00'::bytea, 43);
+</sql-statement>
+<sql-statement>
+SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: index 99 out of valid range, 0..71
+
+ SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+ ^
+<sql-statement>
+SELECT set_bit('\x1234567890abcdef00'::bytea, 43, 0);
+</sql-statement>
+<sql-statement>
+SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: index 99 out of valid range, 0..71
+
+ SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+ ^
+<sql-statement>
+SELECT get_byte('\x1234567890abcdef00'::bytea, 3);
+</sql-statement>
+<sql-statement>
+SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: index 99 out of valid range, 0..8
+
+ SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+ ^
+<sql-statement>
+SELECT set_byte('\x1234567890abcdef00'::bytea, 7, 11);
+</sql-statement>
+<sql-statement>
+SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: index 99 out of valid range, 0..8
+
+ SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+ ^
+<sql-statement>
+--
+-- test behavior of escape_string_warning and standard_conforming_strings options
+--
+set escape_string_warning = off;
+</sql-statement>
+<sql-statement>
+set standard_conforming_strings = off;
+</sql-statement>
+<sql-statement>
+show escape_string_warning;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "escape_string_warning"
+ show escape_string_warning;
+ ^
+<sql-statement>
+show standard_conforming_strings;
+</sql-statement>
+<sql-statement>
+set escape_string_warning = on;
+</sql-statement>
+<sql-statement>
+set standard_conforming_strings = on;
+</sql-statement>
+<sql-statement>
+show escape_string_warning;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unrecognized configuration parameter "escape_string_warning"
+ show escape_string_warning;
+ ^
+<sql-statement>
+show standard_conforming_strings;
+</sql-statement>
+<sql-statement>
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+</sql-statement>
+<sql-statement>
+set standard_conforming_strings = off;
+</sql-statement>
+<sql-statement>
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:34: Error: ERROR: syntax error at or near "' as f2, '"
+
+ select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+ ^
+<sql-statement>
+set escape_string_warning = off;
+</sql-statement>
+<sql-statement>
+set standard_conforming_strings = on;
+</sql-statement>
+<sql-statement>
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+</sql-statement>
+<sql-statement>
+set standard_conforming_strings = off;
+</sql-statement>
+<sql-statement>
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:34: Error: ERROR: syntax error at or near "' as f2, '"
+
+ select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+ ^
+<sql-statement>
+reset standard_conforming_strings;
+</sql-statement>
+<sql-statement>
+--
+-- Additional string functions
+--
+SET bytea_output TO escape;
+</sql-statement>
+<sql-statement>
+SELECT initcap('hi THOMAS');
+</sql-statement>
+<sql-statement>
+SELECT lpad('hi', 5, 'xy');
+</sql-statement>
+<sql-statement>
+SELECT lpad('hi', 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 lpad('hi', 5);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT lpad('hi', 5);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc lpad with given argument types: (unknown,int4)
+ SELECT lpad('hi', 5);
+ ^
+<sql-statement>
+SELECT lpad('hi', -5, 'xy');
+</sql-statement>
+<sql-statement>
+SELECT lpad('hello', 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 lpad('hello', 2);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT lpad('hello', 2);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc lpad with given argument types: (unknown,int4)
+ SELECT lpad('hello', 2);
+ ^
+<sql-statement>
+SELECT lpad('hi', 5, '');
+</sql-statement>
+<sql-statement>
+SELECT rpad('hi', 5, 'xy');
+</sql-statement>
+<sql-statement>
+SELECT rpad('hi', 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 rpad('hi', 5);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT rpad('hi', 5);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc rpad with given argument types: (unknown,int4)
+ SELECT rpad('hi', 5);
+ ^
+<sql-statement>
+SELECT rpad('hi', -5, 'xy');
+</sql-statement>
+<sql-statement>
+SELECT rpad('hello', 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 rpad('hello', 2);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT rpad('hello', 2);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc rpad with given argument types: (unknown,int4)
+ SELECT rpad('hello', 2);
+ ^
+<sql-statement>
+SELECT rpad('hi', 5, '');
+</sql-statement>
+<sql-statement>
+SELECT ltrim('zzzytrim', 'xyz');
+</sql-statement>
+<sql-statement>
+SELECT translate('', '14', 'ax');
+</sql-statement>
+<sql-statement>
+SELECT translate('12345', '14', 'ax');
+</sql-statement>
+<sql-statement>
+SELECT ascii('x');
+</sql-statement>
+<sql-statement>
+SELECT ascii('');
+</sql-statement>
+<sql-statement>
+SELECT chr(65);
+</sql-statement>
+<sql-statement>
+SELECT chr(0);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT chr(0);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null character not permitted
+
+ SELECT chr(0);
+ ^
+<sql-statement>
+SELECT repeat('Pg', 4);
+</sql-statement>
+<sql-statement>
+SELECT repeat('Pg', -4);
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('1234567890'::bytea FROM 3) "34567890";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('1234567890'::bytea FROM 4 FOR 3) AS "456";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('string'::bytea FROM 2 FOR 2147483646) AS "tring";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('string'::bytea FROM -10 FOR 2147483646) AS "string";
+</sql-statement>
+<sql-statement>
+SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: negative substring length not allowed
+
+ SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+ ^
+<sql-statement>
+SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT trim(leading E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT trim(trailing E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT btrim(''::bytea, E'\\000'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea);
+</sql-statement>
+<sql-statement>
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'Th\\001omas'::bytea from 2),'escape');
+</sql-statement>
+<sql-statement>
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 8),'escape');
+</sql-statement>
+<sql-statement>
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 5 for 3),'escape');
+</sql-statement>
+<sql-statement>
+SELECT bit_count('\x1234567890'::bytea);
+</sql-statement>
+<sql-statement>
+SELECT unistr('\0064at\+0000610');
+</sql-statement>
+<sql-statement>
+SELECT unistr('d\u0061t\U000000610');
+</sql-statement>
+<sql-statement>
+SELECT unistr('a\\b');
+</sql-statement>
+<sql-statement>
+-- errors:
+SELECT unistr('wrong: \db99');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- errors:
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode surrogate pair
+
+ -- errors:
+ ^
+<sql-statement>
+SELECT unistr('wrong: \db99\0061');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \db99\0061');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode surrogate pair
+
+ SELECT unistr('wrong: \db99\0061');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \+00db99\+000061');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \+00db99\+000061');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode surrogate pair
+
+ SELECT unistr('wrong: \+00db99\+000061');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \+2FFFFF');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \+2FFFFF');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode code point: 2FFFFF
+
+ SELECT unistr('wrong: \+2FFFFF');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \udb99\u0061');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \udb99\u0061');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode surrogate pair
+
+ SELECT unistr('wrong: \udb99\u0061');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \U0000db99\U00000061');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \U0000db99\U00000061');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode surrogate pair
+
+ SELECT unistr('wrong: \U0000db99\U00000061');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \U002FFFFF');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \U002FFFFF');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode code point: 2FFFFF
+
+ SELECT unistr('wrong: \U002FFFFF');
+ ^
+<sql-statement>
+SELECT unistr('wrong: \xyz');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT unistr('wrong: \xyz');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid Unicode escape
+HINT: Unicode escapes must be \XXXX, \+XXXXXX, \uXXXX, or \UXXXXXXXX.
+
+ SELECT unistr('wrong: \xyz');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/strings.out b/yql/essentials/tests/postgresql/cases/strings.out
new file mode 100644
index 0000000000..35d85bc014
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/strings.out
@@ -0,0 +1,1691 @@
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+-- SQL string continuation syntax
+-- E021-03 character string literals
+SELECT 'first line'
+' - next line'
+ ' - third line'
+ AS "Three lines to one";
+ Three lines to one
+-------------------------------------
+ first line - next line - third line
+(1 row)
+
+-- illegal string continuation syntax
+SELECT 'first line'
+' - next line' /* this comment is not allowed here */
+' - third line'
+ AS "Illegal comment within continuation";
+ERROR: syntax error at or near "' - third line'"
+LINE 3: ' - third line'
+ ^
+-- Unicode escapes
+SET standard_conforming_strings TO on;
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+ data
+------
+ data
+(1 row)
+
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+ dat\+000061
+-------------
+ dat\+000061
+(1 row)
+
+SELECT U&'a\\b' AS "a\b";
+ a\b
+-----
+ a\b
+(1 row)
+
+SELECT U&' \' UESCAPE '!' AS "tricky";
+ tricky
+--------
+ \
+(1 row)
+
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+ \
+--------
+ tricky
+(1 row)
+
+SELECT U&'wrong: \061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT U&'wrong: \061';
+ ^
+HINT: Unicode escapes must be \XXXX or \+XXXXXX.
+SELECT U&'wrong: \+0061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT U&'wrong: \+0061';
+ ^
+HINT: Unicode escapes must be \XXXX or \+XXXXXX.
+SELECT U&'wrong: +0061' UESCAPE +;
+ERROR: UESCAPE must be followed by a simple string literal at or near "+"
+LINE 1: SELECT U&'wrong: +0061' UESCAPE +;
+ ^
+SELECT U&'wrong: +0061' UESCAPE '+';
+ERROR: invalid Unicode escape character at or near "'+'"
+LINE 1: SELECT U&'wrong: +0061' UESCAPE '+';
+ ^
+SELECT U&'wrong: \db99';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99';
+ ^
+SELECT U&'wrong: \db99xy';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99xy';
+ ^
+SELECT U&'wrong: \db99\\';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99\\';
+ ^
+SELECT U&'wrong: \db99\0061';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99\0061';
+ ^
+SELECT U&'wrong: \+00db99\+000061';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \+00db99\+000061';
+ ^
+SELECT U&'wrong: \+2FFFFF';
+ERROR: invalid Unicode escape value
+LINE 1: SELECT U&'wrong: \+2FFFFF';
+ ^
+-- while we're here, check the same cases in E-style literals
+SELECT E'd\u0061t\U00000061' AS "data";
+ data
+------
+ data
+(1 row)
+
+SELECT E'a\\b' AS "a\b";
+ a\b
+-----
+ a\b
+(1 row)
+
+SELECT E'wrong: \u061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT E'wrong: \u061';
+ ^
+HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.
+SELECT E'wrong: \U0061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT E'wrong: \U0061';
+ ^
+HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.
+SELECT E'wrong: \udb99';
+ERROR: invalid Unicode surrogate pair at or near "'"
+LINE 1: SELECT E'wrong: \udb99';
+ ^
+SELECT E'wrong: \udb99xy';
+ERROR: invalid Unicode surrogate pair at or near "x"
+LINE 1: SELECT E'wrong: \udb99xy';
+ ^
+SELECT E'wrong: \udb99\\';
+ERROR: invalid Unicode surrogate pair at or near "\"
+LINE 1: SELECT E'wrong: \udb99\\';
+ ^
+SELECT E'wrong: \udb99\u0061';
+ERROR: invalid Unicode surrogate pair at or near "\u0061"
+LINE 1: SELECT E'wrong: \udb99\u0061';
+ ^
+SELECT E'wrong: \U0000db99\U00000061';
+ERROR: invalid Unicode surrogate pair at or near "\U00000061"
+LINE 1: SELECT E'wrong: \U0000db99\U00000061';
+ ^
+SELECT E'wrong: \U002FFFFF';
+ERROR: invalid Unicode escape value at or near "\U002FFFFF"
+LINE 1: SELECT E'wrong: \U002FFFFF';
+ ^
+SET standard_conforming_strings TO off;
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+ \
+--------
+ tricky
+(1 row)
+
+RESET standard_conforming_strings;
+-- bytea
+SET bytea_output TO hex;
+SELECT E'\\xDeAdBeEf'::bytea;
+ bytea
+------------
+ \xdeadbeef
+(1 row)
+
+SELECT E'\\x De Ad Be Ef '::bytea;
+ bytea
+------------
+ \xdeadbeef
+(1 row)
+
+SELECT E'\\xDeAdBeE'::bytea;
+ERROR: invalid hexadecimal data: odd number of digits
+LINE 1: SELECT E'\\xDeAdBeE'::bytea;
+ ^
+SELECT E'\\xDeAdBeEx'::bytea;
+ERROR: invalid hexadecimal digit: "x"
+LINE 1: SELECT E'\\xDeAdBeEx'::bytea;
+ ^
+SELECT E'\\xDe00BeEf'::bytea;
+ bytea
+------------
+ \xde00beef
+(1 row)
+
+SELECT E'DeAdBeEf'::bytea;
+ bytea
+--------------------
+ \x4465416442654566
+(1 row)
+
+SELECT E'De\\000dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465006442654566
+(1 row)
+
+SELECT E'De\123dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465536442654566
+(1 row)
+
+SELECT E'De\\123dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465536442654566
+(1 row)
+
+SELECT E'De\\678dBeEf'::bytea;
+ERROR: invalid input syntax for type bytea
+LINE 1: SELECT E'De\\678dBeEf'::bytea;
+ ^
+SET bytea_output TO escape;
+SELECT E'\\xDeAdBeEf'::bytea;
+ bytea
+------------------
+ \336\255\276\357
+(1 row)
+
+SELECT E'\\x De Ad Be Ef '::bytea;
+ bytea
+------------------
+ \336\255\276\357
+(1 row)
+
+SELECT E'\\xDe00BeEf'::bytea;
+ bytea
+------------------
+ \336\000\276\357
+(1 row)
+
+SELECT E'DeAdBeEf'::bytea;
+ bytea
+----------
+ DeAdBeEf
+(1 row)
+
+SELECT E'De\\000dBeEf'::bytea;
+ bytea
+-------------
+ De\000dBeEf
+(1 row)
+
+SELECT E'De\\123dBeEf'::bytea;
+ bytea
+----------
+ DeSdBeEf
+(1 row)
+
+--
+-- test conversions between various string types
+-- E021-10 implicit casting among the character data types
+--
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+ text(char)
+------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+ text(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+ text(name)
+------------
+ namefield
+(1 row)
+
+-- since this is an explicit cast, it should truncate w/o error:
+SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
+ char(text)
+------------
+ doh!
+ hi de ho n
+(2 rows)
+
+-- note: implicit-cast case is tested in char.sql
+SELECT CAST(f1 AS char(20)) AS "char(text)" FROM TEXT_TBL;
+ char(text)
+----------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL;
+ char(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
+ char(name)
+------------
+ namefield
+(1 row)
+
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+ varchar(text)
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+ varchar(char)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+ varchar(name)
+---------------
+ namefield
+(1 row)
+
+--
+-- test SQL string functions
+-- E### and T### are feature reference numbers from SQL99
+--
+-- E021-09 trim function
+SELECT TRIM(BOTH FROM ' bunch o blanks ') = 'bunch o blanks' AS "bunch o blanks";
+ bunch o blanks
+----------------
+ t
+(1 row)
+
+SELECT TRIM(LEADING FROM ' bunch o blanks ') = 'bunch o blanks ' AS "bunch o blanks ";
+ bunch o blanks
+------------------
+ t
+(1 row)
+
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') = ' bunch o blanks' AS " bunch o blanks";
+ bunch o blanks
+------------------
+ t
+(1 row)
+
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') = 'some Xs' AS "some Xs";
+ some Xs
+---------
+ t
+(1 row)
+
+-- E021-06 substring expression
+SELECT SUBSTRING('1234567890' FROM 3) = '34567890' AS "34567890";
+ 34567890
+----------
+ t
+(1 row)
+
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
+ 456
+-----
+ t
+(1 row)
+
+-- test overflow cases
+SELECT SUBSTRING('string' FROM 2 FOR 2147483646) AS "tring";
+ tring
+-------
+ tring
+(1 row)
+
+SELECT SUBSTRING('string' FROM -10 FOR 2147483646) AS "string";
+ string
+--------
+ string
+(1 row)
+
+SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+SELECT SUBSTRING(NULL SIMILAR '%' ESCAPE '#') IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR NULL ESCAPE '#') IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+-- substring() with just two arguments is not allowed by SQL spec;
+-- we accept it, but we interpret the pattern as a POSIX regexp not SQL
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+ cde
+-----
+ cde
+(1 row)
+
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
+ cde
+-----
+ cde
+(1 row)
+
+-- Test back reference in regexp_replace
+SELECT regexp_replace('1112223333', E'(\\d{3})(\\d{3})(\\d{4})', E'(\\1) \\2-\\3');
+ regexp_replace
+----------------
+ (111) 222-3333
+(1 row)
+
+SELECT regexp_replace('AAA BBB CCC ', E'\\s+', ' ', 'g');
+ regexp_replace
+----------------
+ AAA BBB CCC
+(1 row)
+
+SELECT regexp_replace('AAA', '^|$', 'Z', 'g');
+ regexp_replace
+----------------
+ ZAAAZ
+(1 row)
+
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'gi');
+ regexp_replace
+----------------
+ Z Z
+(1 row)
+
+-- invalid regexp option
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'z');
+ERROR: invalid regular expression option: "z"
+-- set so we can tell NULL from empty string
+\pset null '\\N'
+-- split string on regexp
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s+$re$) AS foo;
+ foo | length
+-------+--------
+ the | 3
+ quick | 5
+ brown | 5
+ fox | 3
+ jumps | 5
+ over | 4
+ the | 3
+ lazy | 4
+ dog | 3
+(9 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s+$re$);
+ regexp_split_to_array
+-----------------------------------------------
+ {the,quick,brown,fox,jumps,over,the,lazy,dog}
+(1 row)
+
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s*$re$) AS foo;
+ foo | length
+-----+--------
+ t | 1
+ h | 1
+ e | 1
+ q | 1
+ u | 1
+ i | 1
+ c | 1
+ k | 1
+ b | 1
+ r | 1
+ o | 1
+ w | 1
+ n | 1
+ f | 1
+ o | 1
+ x | 1
+ j | 1
+ u | 1
+ m | 1
+ p | 1
+ s | 1
+ o | 1
+ v | 1
+ e | 1
+ r | 1
+ t | 1
+ h | 1
+ e | 1
+ l | 1
+ a | 1
+ z | 1
+ y | 1
+ d | 1
+ o | 1
+ g | 1
+(35 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s*$re$);
+ regexp_split_to_array
+-------------------------------------------------------------------------
+ {t,h,e,q,u,i,c,k,b,r,o,w,n,f,o,x,j,u,m,p,s,o,v,e,r,t,h,e,l,a,z,y,d,o,g}
+(1 row)
+
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '') AS foo;
+ foo | length
+-----+--------
+ t | 1
+ h | 1
+ e | 1
+ | 1
+ q | 1
+ u | 1
+ i | 1
+ c | 1
+ k | 1
+ | 1
+ b | 1
+ r | 1
+ o | 1
+ w | 1
+ n | 1
+ | 1
+ f | 1
+ o | 1
+ x | 1
+ | 1
+ j | 1
+ u | 1
+ m | 1
+ p | 1
+ s | 1
+ | 1
+ o | 1
+ v | 1
+ e | 1
+ r | 1
+ | 1
+ t | 1
+ h | 1
+ e | 1
+ | 1
+ l | 1
+ a | 1
+ z | 1
+ y | 1
+ | 1
+ d | 1
+ o | 1
+ g | 1
+(43 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '');
+ regexp_split_to_array
+---------------------------------------------------------------------------------------------------------
+ {t,h,e," ",q,u,i,c,k," ",b,r,o,w,n," ",f,o,x," ",j,u,m,p,s," ",o,v,e,r," ",t,h,e," ",l,a,z,y," ",d,o,g}
+(1 row)
+
+-- case insensitive
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i') AS foo;
+ foo | length
+---------------------------+--------
+ th | 2
+ QUick bROWn FOx jUMPs ov | 25
+ r Th | 4
+ lazy dOG | 9
+(4 rows)
+
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i');
+ regexp_split_to_array
+-----------------------------------------------------
+ {th," QUick bROWn FOx jUMPs ov","r Th"," lazy dOG"}
+(1 row)
+
+-- no match of pattern
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', 'nomatch') AS foo;
+ foo | length
+---------------------------------------------+--------
+ the quick brown fox jumps over the lazy dog | 43
+(1 row)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', 'nomatch');
+ regexp_split_to_array
+-------------------------------------------------
+ {"the quick brown fox jumps over the lazy dog"}
+(1 row)
+
+-- some corner cases
+SELECT regexp_split_to_array('123456','1');
+ regexp_split_to_array
+-----------------------
+ {"",23456}
+(1 row)
+
+SELECT regexp_split_to_array('123456','6');
+ regexp_split_to_array
+-----------------------
+ {12345,""}
+(1 row)
+
+SELECT regexp_split_to_array('123456','.');
+ regexp_split_to_array
+------------------------
+ {"","","","","","",""}
+(1 row)
+
+SELECT regexp_split_to_array('123456','');
+ regexp_split_to_array
+-----------------------
+ {1,2,3,4,5,6}
+(1 row)
+
+SELECT regexp_split_to_array('123456','(?:)');
+ regexp_split_to_array
+-----------------------
+ {1,2,3,4,5,6}
+(1 row)
+
+SELECT regexp_split_to_array('1','');
+ regexp_split_to_array
+-----------------------
+ {1}
+(1 row)
+
+-- errors
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'zippy') AS foo;
+ERROR: invalid regular expression option: "z"
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+ERROR: invalid regular expression option: "z"
+-- global option meaningless for regexp_split
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g') AS foo;
+ERROR: regexp_split_to_table() does not support the "global" option
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+ERROR: regexp_split_to_array() does not support the "global" option
+-- change NULL-display back
+\pset null ''
+-- E021-11 position expression
+SELECT POSITION('4' IN '1234567890') = '4' AS "4";
+ 4
+---
+ t
+(1 row)
+
+SELECT POSITION('5' IN '1234567890') = '5' AS "5";
+ 5
+---
+ t
+(1 row)
+
+-- T312 character overlay function
+SELECT OVERLAY('abcdef' PLACING '45' FROM 4) AS "abc45f";
+ abc45f
+--------
+ abc45f
+(1 row)
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5) AS "yabadaba";
+ yabadaba
+----------
+ yabadaba
+(1 row)
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5 FOR 0) AS "yabadabadoo";
+ yabadabadoo
+-------------
+ yabadabadoo
+(1 row)
+
+SELECT OVERLAY('babosa' PLACING 'ubb' FROM 2 FOR 4) AS "bubba";
+ bubba
+-------
+ bubba
+(1 row)
+
+--
+-- test LIKE
+-- Be sure to form every test as a LIKE/NOT LIKE pair.
+--
+-- simplest examples
+-- E061-04 like predicate
+SELECT 'hawkeye' LIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' LIKE 'H%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'H%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' LIKE 'indio%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'indio%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' LIKE 'h%eye' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE '_ndio' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE '_ndio' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'in__o' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE 'in__o' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'in_o' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' NOT LIKE 'in_o' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'abc'::name LIKE '_b_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'abc'::name NOT LIKE '_b_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+-- unused escape character
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'ind_o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE 'ind_o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'h%wkeye' NOT LIKE 'h#%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' LIKE '_ndio' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE '_ndio' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'i_dio' LIKE 'i$_nd_o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'i_dio' NOT LIKE 'i$_nd_o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'be_r' LIKE '__e__r' ESCAPE '_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'be_r' NOT LIKE '__e__r' ESCAPE '_' AS "true";
+ true
+------
+ t
+(1 row)
+
+--
+-- test ILIKE (case-insensitive LIKE)
+-- Be sure to form every test as an ILIKE/NOT ILIKE pair.
+--
+SELECT 'hawkeye' ILIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' ILIKE 'H%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'H%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' ILIKE 'H%Eye' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'H%Eye' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'Hawkeye' ILIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'ABC'::name ILIKE '_b_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'ABC'::name NOT ILIKE '_b_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'jack' LIKE '%____%' AS t;
+ t
+---
+ t
+(1 row)
+
+--
+-- basic tests of LIKE with indexes
+--
+CREATE TABLE texttest (a text PRIMARY KEY, b int);
+SELECT * FROM texttest WHERE a LIKE '%1%';
+ a | b
+---+---
+(0 rows)
+
+CREATE TABLE byteatest (a bytea PRIMARY KEY, b int);
+DROP TABLE texttest, byteatest;
+--
+-- test implicit type conversion
+--
+-- E021-07 character concatenation
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+ Concat unknown types
+----------------------
+ unknown and unknown
+(1 row)
+
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+ Concat text to unknown type
+-----------------------------
+ text and unknown
+(1 row)
+
+SELECT char(20) 'characters' || ' and text' AS "Concat char to unknown type";
+ Concat char to unknown type
+-----------------------------
+ characters and text
+(1 row)
+
+SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
+ Concat text to char
+---------------------
+ text and characters
+(1 row)
+
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+ Concat text to varchar
+------------------------
+ text and varchar
+(1 row)
+
+--
+-- test substr with toasted text values
+--
+CREATE TABLE toasttest(f1 text);
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+ substr
+--------
+ 123
+ 123
+ 123
+ 123
+(4 rows)
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+ERROR: negative substring length not allowed
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+DROP TABLE toasttest;
+--
+-- test substr with toasted bytea values
+--
+CREATE TABLE toasttest(f1 bytea);
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+ substr
+--------
+ 123
+ 123
+ 123
+ 123
+(4 rows)
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+ERROR: negative substring length not allowed
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+DROP TABLE toasttest;
+-- test internally compressing datums
+-- this tests compressing a datum to a very small size which exercises a
+-- corner case in packed-varlena handling: even though small, the compressed
+-- datum must be given a 4-byte header because there are no bits to indicate
+-- compression in a 1-byte header
+CREATE TABLE toasttest (c char(4096));
+INSERT INTO toasttest VALUES('x');
+SELECT length(c), c::text FROM toasttest;
+ length | c
+--------+---
+ 1 | x
+(1 row)
+
+DROP TABLE toasttest;
+--
+-- test length
+--
+SELECT length('abcdef') AS "length_6";
+ length_6
+----------
+ 6
+(1 row)
+
+--
+-- test strpos
+--
+SELECT strpos('abcdef', 'cd') AS "pos_3";
+ pos_3
+-------
+ 3
+(1 row)
+
+SELECT strpos('abcdef', 'xy') AS "pos_0";
+ pos_0
+-------
+ 0
+(1 row)
+
+SELECT strpos('abcdef', '') AS "pos_1";
+ pos_1
+-------
+ 1
+(1 row)
+
+SELECT strpos('', 'xy') AS "pos_0";
+ pos_0
+-------
+ 0
+(1 row)
+
+SELECT strpos('', '') AS "pos_1";
+ pos_1
+-------
+ 1
+(1 row)
+
+--
+-- test replace
+--
+SELECT replace('abcdef', 'de', '45') AS "abc45f";
+ abc45f
+--------
+ abc45f
+(1 row)
+
+SELECT replace('yabadabadoo', 'ba', '123') AS "ya123da123doo";
+ ya123da123doo
+---------------
+ ya123da123doo
+(1 row)
+
+SELECT replace('yabadoo', 'bad', '') AS "yaoo";
+ yaoo
+------
+ yaoo
+(1 row)
+
+--
+-- test split_part
+--
+select split_part('','@',1) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('','@',-1) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','',1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','',2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','',-1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','',-2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','@',0) AS "an error";
+ERROR: field position must not be zero
+select split_part('joeuser@mydatabase','@@',1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@@',2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','@',1) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',2) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@',3) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-1) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-2) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-3) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('@joeuser@mydatabase@','@',-2) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+--
+-- test to_hex
+--
+select to_hex(256*256*256 - 1) AS "ffffff";
+ ffffff
+--------
+ ffffff
+(1 row)
+
+select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
+ ffffffff
+----------
+ ffffffff
+(1 row)
+
+--
+-- MD5 test suite - from IETF RFC 1321
+-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
+--
+select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5(''::bytea) = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('a'::bytea) = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abc'::bytea) = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('message digest'::bytea) = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abcdefghijklmnopqrstuvwxyz'::bytea) = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'::bytea) = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890'::bytea) = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+--
+-- SHA-2
+--
+SET bytea_output TO hex;
+SELECT sha224('');
+ sha224
+------------------------------------------------------------
+ \xd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
+(1 row)
+
+SELECT sha224('The quick brown fox jumps over the lazy dog.');
+ sha224
+------------------------------------------------------------
+ \x619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c
+(1 row)
+
+SELECT sha256('');
+ sha256
+--------------------------------------------------------------------
+ \xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+(1 row)
+
+SELECT sha256('The quick brown fox jumps over the lazy dog.');
+ sha256
+--------------------------------------------------------------------
+ \xef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c
+(1 row)
+
+SELECT sha384('');
+ sha384
+----------------------------------------------------------------------------------------------------
+ \x38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
+(1 row)
+
+SELECT sha384('The quick brown fox jumps over the lazy dog.');
+ sha384
+----------------------------------------------------------------------------------------------------
+ \xed892481d8272ca6df370bf706e4d7bc1b5739fa2177aae6c50e946678718fc67a7af2819a021c2fc34e91bdb63409d7
+(1 row)
+
+SELECT sha512('');
+ sha512
+------------------------------------------------------------------------------------------------------------------------------------
+ \xcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
+(1 row)
+
+SELECT sha512('The quick brown fox jumps over the lazy dog.');
+ sha512
+------------------------------------------------------------------------------------------------------------------------------------
+ \x91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed
+(1 row)
+
+--
+-- encode/decode
+--
+SELECT encode('\x1234567890abcdef00', 'hex');
+ encode
+--------------------
+ 1234567890abcdef00
+(1 row)
+
+SELECT decode('1234567890abcdef00', 'hex');
+ decode
+----------------------
+ \x1234567890abcdef00
+(1 row)
+
+SELECT decode(encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea,
+ 'base64'), 'base64');
+ decode
+------------------------------------------------------------------------------------------------------------------------------------------------
+ \x1234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef0001
+(1 row)
+
+SELECT decode(encode('\x1234567890abcdef00', 'escape'), 'escape');
+ decode
+----------------------
+ \x1234567890abcdef00
+(1 row)
+
+--
+-- get_bit/set_bit etc
+--
+SELECT get_bit('\x1234567890abcdef00'::bytea, 43);
+ get_bit
+---------
+ 1
+(1 row)
+
+SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+ERROR: index 99 out of valid range, 0..71
+SELECT set_bit('\x1234567890abcdef00'::bytea, 43, 0);
+ set_bit
+----------------------
+ \x1234567890a3cdef00
+(1 row)
+
+SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+ERROR: index 99 out of valid range, 0..71
+SELECT get_byte('\x1234567890abcdef00'::bytea, 3);
+ get_byte
+----------
+ 120
+(1 row)
+
+SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+ERROR: index 99 out of valid range, 0..8
+SELECT set_byte('\x1234567890abcdef00'::bytea, 7, 11);
+ set_byte
+----------------------
+ \x1234567890abcd0b00
+(1 row)
+
+SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+ERROR: index 99 out of valid range, 0..8
+--
+-- test behavior of escape_string_warning and standard_conforming_strings options
+--
+set escape_string_warning = off;
+set standard_conforming_strings = off;
+set escape_string_warning = on;
+set standard_conforming_strings = on;
+show standard_conforming_strings;
+ standard_conforming_strings
+-----------------------------
+ on
+(1 row)
+
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+set standard_conforming_strings = off;
+set escape_string_warning = off;
+set standard_conforming_strings = on;
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+set standard_conforming_strings = off;
+reset standard_conforming_strings;
+--
+-- Additional string functions
+--
+SET bytea_output TO escape;
+SELECT initcap('hi THOMAS');
+ initcap
+-----------
+ Hi Thomas
+(1 row)
+
+SELECT lpad('hi', 5, 'xy');
+ lpad
+-------
+ xyxhi
+(1 row)
+
+SELECT lpad('hi', -5, 'xy');
+ lpad
+------
+
+(1 row)
+
+SELECT lpad('hi', 5, '');
+ lpad
+------
+ hi
+(1 row)
+
+SELECT rpad('hi', 5, 'xy');
+ rpad
+-------
+ hixyx
+(1 row)
+
+SELECT rpad('hi', -5, 'xy');
+ rpad
+------
+
+(1 row)
+
+SELECT rpad('hi', 5, '');
+ rpad
+------
+ hi
+(1 row)
+
+SELECT ltrim('zzzytrim', 'xyz');
+ ltrim
+-------
+ trim
+(1 row)
+
+SELECT translate('', '14', 'ax');
+ translate
+-----------
+
+(1 row)
+
+SELECT translate('12345', '14', 'ax');
+ translate
+-----------
+ a23x5
+(1 row)
+
+SELECT ascii('x');
+ ascii
+-------
+ 120
+(1 row)
+
+SELECT ascii('');
+ ascii
+-------
+ 0
+(1 row)
+
+SELECT chr(65);
+ chr
+-----
+ A
+(1 row)
+
+SELECT chr(0);
+ERROR: null character not permitted
+SELECT repeat('Pg', 4);
+ repeat
+----------
+ PgPgPgPg
+(1 row)
+
+SELECT repeat('Pg', -4);
+ repeat
+--------
+
+(1 row)
+
+SELECT SUBSTRING('1234567890'::bytea FROM 3) "34567890";
+ 34567890
+----------
+ 34567890
+(1 row)
+
+SELECT SUBSTRING('1234567890'::bytea FROM 4 FOR 3) AS "456";
+ 456
+-----
+ 456
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM 2 FOR 2147483646) AS "tring";
+ tring
+-------
+ tring
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM -10 FOR 2147483646) AS "string";
+ string
+--------
+ string
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ btrim
+-------
+ Tom
+(1 row)
+
+SELECT trim(leading E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ ltrim
+---------
+ Tom\000
+(1 row)
+
+SELECT trim(trailing E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ rtrim
+---------
+ \000Tom
+(1 row)
+
+SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea);
+ btrim
+-------
+ trim
+(1 row)
+
+SELECT btrim(''::bytea, E'\\000'::bytea);
+ btrim
+-------
+
+(1 row)
+
+SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea);
+ btrim
+--------------
+ \000trim\000
+(1 row)
+
+SELECT bit_count('\x1234567890'::bytea);
+ bit_count
+-----------
+ 15
+(1 row)
+
+SELECT unistr('\0064at\+0000610');
+ unistr
+--------
+ data0
+(1 row)
+
+SELECT unistr('d\u0061t\U000000610');
+ unistr
+--------
+ data0
+(1 row)
+
+SELECT unistr('a\\b');
+ unistr
+--------
+ a\b
+(1 row)
+
+-- errors:
+SELECT unistr('wrong: \db99');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \db99\0061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \+00db99\+000061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \+2FFFFF');
+ERROR: invalid Unicode code point: 2FFFFF
+SELECT unistr('wrong: \udb99\u0061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \U0000db99\U00000061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \U002FFFFF');
+ERROR: invalid Unicode code point: 2FFFFF
+SELECT unistr('wrong: \xyz');
+ERROR: invalid Unicode escape
+HINT: Unicode escapes must be \XXXX, \+XXXXXX, \uXXXX, or \UXXXXXXXX.
diff --git a/yql/essentials/tests/postgresql/cases/strings.sql b/yql/essentials/tests/postgresql/cases/strings.sql
new file mode 100644
index 0000000000..232343f652
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/strings.sql
@@ -0,0 +1,423 @@
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+-- SQL string continuation syntax
+-- E021-03 character string literals
+SELECT 'first line'
+' - next line'
+ ' - third line'
+ AS "Three lines to one";
+-- illegal string continuation syntax
+SELECT 'first line'
+' - next line' /* this comment is not allowed here */
+' - third line'
+ AS "Illegal comment within continuation";
+-- Unicode escapes
+SET standard_conforming_strings TO on;
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+SELECT U&'a\\b' AS "a\b";
+SELECT U&' \' UESCAPE '!' AS "tricky";
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+SELECT U&'wrong: \061';
+SELECT U&'wrong: \+0061';
+SELECT U&'wrong: +0061' UESCAPE +;
+SELECT U&'wrong: +0061' UESCAPE '+';
+SELECT U&'wrong: \db99';
+SELECT U&'wrong: \db99xy';
+SELECT U&'wrong: \db99\\';
+SELECT U&'wrong: \db99\0061';
+SELECT U&'wrong: \+00db99\+000061';
+SELECT U&'wrong: \+2FFFFF';
+-- while we're here, check the same cases in E-style literals
+SELECT E'd\u0061t\U00000061' AS "data";
+SELECT E'a\\b' AS "a\b";
+SELECT E'wrong: \u061';
+SELECT E'wrong: \U0061';
+SELECT E'wrong: \udb99';
+SELECT E'wrong: \udb99xy';
+SELECT E'wrong: \udb99\\';
+SELECT E'wrong: \udb99\u0061';
+SELECT E'wrong: \U0000db99\U00000061';
+SELECT E'wrong: \U002FFFFF';
+SET standard_conforming_strings TO off;
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+RESET standard_conforming_strings;
+-- bytea
+SET bytea_output TO hex;
+SELECT E'\\xDeAdBeEf'::bytea;
+SELECT E'\\x De Ad Be Ef '::bytea;
+SELECT E'\\xDeAdBeE'::bytea;
+SELECT E'\\xDeAdBeEx'::bytea;
+SELECT E'\\xDe00BeEf'::bytea;
+SELECT E'DeAdBeEf'::bytea;
+SELECT E'De\\000dBeEf'::bytea;
+SELECT E'De\123dBeEf'::bytea;
+SELECT E'De\\123dBeEf'::bytea;
+SELECT E'De\\678dBeEf'::bytea;
+SET bytea_output TO escape;
+SELECT E'\\xDeAdBeEf'::bytea;
+SELECT E'\\x De Ad Be Ef '::bytea;
+SELECT E'\\xDe00BeEf'::bytea;
+SELECT E'DeAdBeEf'::bytea;
+SELECT E'De\\000dBeEf'::bytea;
+SELECT E'De\\123dBeEf'::bytea;
+--
+-- test conversions between various string types
+-- E021-10 implicit casting among the character data types
+--
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+-- since this is an explicit cast, it should truncate w/o error:
+SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
+-- note: implicit-cast case is tested in char.sql
+SELECT CAST(f1 AS char(20)) AS "char(text)" FROM TEXT_TBL;
+SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL;
+SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+--
+-- test SQL string functions
+-- E### and T### are feature reference numbers from SQL99
+--
+-- E021-09 trim function
+SELECT TRIM(BOTH FROM ' bunch o blanks ') = 'bunch o blanks' AS "bunch o blanks";
+SELECT TRIM(LEADING FROM ' bunch o blanks ') = 'bunch o blanks ' AS "bunch o blanks ";
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') = ' bunch o blanks' AS " bunch o blanks";
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') = 'some Xs' AS "some Xs";
+-- E021-06 substring expression
+SELECT SUBSTRING('1234567890' FROM 3) = '34567890' AS "34567890";
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
+-- test overflow cases
+SELECT SUBSTRING('string' FROM 2 FOR 2147483646) AS "tring";
+SELECT SUBSTRING('string' FROM -10 FOR 2147483646) AS "string";
+SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+SELECT SUBSTRING(NULL SIMILAR '%' ESCAPE '#') IS NULL AS "True";
+SELECT SUBSTRING('abcdefg' SIMILAR NULL ESCAPE '#') IS NULL AS "True";
+-- substring() with just two arguments is not allowed by SQL spec;
+-- we accept it, but we interpret the pattern as a POSIX regexp not SQL
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
+-- Test back reference in regexp_replace
+SELECT regexp_replace('1112223333', E'(\\d{3})(\\d{3})(\\d{4})', E'(\\1) \\2-\\3');
+SELECT regexp_replace('AAA BBB CCC ', E'\\s+', ' ', 'g');
+SELECT regexp_replace('AAA', '^|$', 'Z', 'g');
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'gi');
+-- invalid regexp option
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'z');
+-- set so we can tell NULL from empty string
+\pset null '\\N'
+-- split string on regexp
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s+$re$) AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s+$re$);
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s*$re$) AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s*$re$);
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '') AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '');
+-- case insensitive
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i');
+-- no match of pattern
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', 'nomatch') AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', 'nomatch');
+-- some corner cases
+SELECT regexp_split_to_array('123456','1');
+SELECT regexp_split_to_array('123456','6');
+SELECT regexp_split_to_array('123456','.');
+SELECT regexp_split_to_array('123456','');
+SELECT regexp_split_to_array('123456','(?:)');
+SELECT regexp_split_to_array('1','');
+-- errors
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'zippy') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+-- global option meaningless for regexp_split
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+-- change NULL-display back
+\pset null ''
+-- E021-11 position expression
+SELECT POSITION('4' IN '1234567890') = '4' AS "4";
+SELECT POSITION('5' IN '1234567890') = '5' AS "5";
+-- T312 character overlay function
+SELECT OVERLAY('abcdef' PLACING '45' FROM 4) AS "abc45f";
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5) AS "yabadaba";
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5 FOR 0) AS "yabadabadoo";
+SELECT OVERLAY('babosa' PLACING 'ubb' FROM 2 FOR 4) AS "bubba";
+--
+-- test LIKE
+-- Be sure to form every test as a LIKE/NOT LIKE pair.
+--
+-- simplest examples
+-- E061-04 like predicate
+SELECT 'hawkeye' LIKE 'h%' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%' AS "false";
+SELECT 'hawkeye' LIKE 'H%' AS "false";
+SELECT 'hawkeye' NOT LIKE 'H%' AS "true";
+SELECT 'hawkeye' LIKE 'indio%' AS "false";
+SELECT 'hawkeye' NOT LIKE 'indio%' AS "true";
+SELECT 'hawkeye' LIKE 'h%eye' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false";
+SELECT 'indio' LIKE '_ndio' AS "true";
+SELECT 'indio' NOT LIKE '_ndio' AS "false";
+SELECT 'indio' LIKE 'in__o' AS "true";
+SELECT 'indio' NOT LIKE 'in__o' AS "false";
+SELECT 'indio' LIKE 'in_o' AS "false";
+SELECT 'indio' NOT LIKE 'in_o' AS "true";
+SELECT 'abc'::name LIKE '_b_' AS "true";
+SELECT 'abc'::name NOT LIKE '_b_' AS "false";
+-- unused escape character
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%' ESCAPE '#' AS "false";
+SELECT 'indio' LIKE 'ind_o' ESCAPE '$' AS "true";
+SELECT 'indio' NOT LIKE 'ind_o' ESCAPE '$' AS "false";
+SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false";
+SELECT 'h%wkeye' NOT LIKE 'h#%' ESCAPE '#' AS "true";
+SELECT 'indio' LIKE '_ndio' ESCAPE '$' AS "true";
+SELECT 'indio' NOT LIKE '_ndio' ESCAPE '$' AS "false";
+SELECT 'i_dio' LIKE 'i$_nd_o' ESCAPE '$' AS "false";
+SELECT 'i_dio' NOT LIKE 'i$_nd_o' ESCAPE '$' AS "true";
+SELECT 'be_r' LIKE '__e__r' ESCAPE '_' AS "false";
+SELECT 'be_r' NOT LIKE '__e__r' ESCAPE '_' AS "true";
+--
+-- test ILIKE (case-insensitive LIKE)
+-- Be sure to form every test as an ILIKE/NOT ILIKE pair.
+--
+SELECT 'hawkeye' ILIKE 'h%' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'h%' AS "false";
+SELECT 'hawkeye' ILIKE 'H%' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'H%' AS "false";
+SELECT 'hawkeye' ILIKE 'H%Eye' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'H%Eye' AS "false";
+SELECT 'Hawkeye' ILIKE 'h%' AS "true";
+SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
+SELECT 'ABC'::name ILIKE '_b_' AS "true";
+SELECT 'ABC'::name NOT ILIKE '_b_' AS "false";
+SELECT 'jack' LIKE '%____%' AS t;
+--
+-- basic tests of LIKE with indexes
+--
+CREATE TABLE texttest (a text PRIMARY KEY, b int);
+SELECT * FROM texttest WHERE a LIKE '%1%';
+CREATE TABLE byteatest (a bytea PRIMARY KEY, b int);
+DROP TABLE texttest, byteatest;
+--
+-- test implicit type conversion
+--
+-- E021-07 character concatenation
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+SELECT char(20) 'characters' || ' and text' AS "Concat char to unknown type";
+SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+--
+-- test substr with toasted text values
+--
+CREATE TABLE toasttest(f1 text);
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+DROP TABLE toasttest;
+--
+-- test substr with toasted bytea values
+--
+CREATE TABLE toasttest(f1 bytea);
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+DROP TABLE toasttest;
+-- test internally compressing datums
+-- this tests compressing a datum to a very small size which exercises a
+-- corner case in packed-varlena handling: even though small, the compressed
+-- datum must be given a 4-byte header because there are no bits to indicate
+-- compression in a 1-byte header
+CREATE TABLE toasttest (c char(4096));
+INSERT INTO toasttest VALUES('x');
+SELECT length(c), c::text FROM toasttest;
+DROP TABLE toasttest;
+--
+-- test length
+--
+SELECT length('abcdef') AS "length_6";
+--
+-- test strpos
+--
+SELECT strpos('abcdef', 'cd') AS "pos_3";
+SELECT strpos('abcdef', 'xy') AS "pos_0";
+SELECT strpos('abcdef', '') AS "pos_1";
+SELECT strpos('', 'xy') AS "pos_0";
+SELECT strpos('', '') AS "pos_1";
+--
+-- test replace
+--
+SELECT replace('abcdef', 'de', '45') AS "abc45f";
+SELECT replace('yabadabadoo', 'ba', '123') AS "ya123da123doo";
+SELECT replace('yabadoo', 'bad', '') AS "yaoo";
+--
+-- test split_part
+--
+select split_part('','@',1) AS "empty string";
+select split_part('','@',-1) AS "empty string";
+select split_part('joeuser@mydatabase','',1) AS "joeuser@mydatabase";
+select split_part('joeuser@mydatabase','',2) AS "empty string";
+select split_part('joeuser@mydatabase','',-1) AS "joeuser@mydatabase";
+select split_part('joeuser@mydatabase','',-2) AS "empty string";
+select split_part('joeuser@mydatabase','@',0) AS "an error";
+select split_part('joeuser@mydatabase','@@',1) AS "joeuser@mydatabase";
+select split_part('joeuser@mydatabase','@@',2) AS "empty string";
+select split_part('joeuser@mydatabase','@',1) AS "joeuser";
+select split_part('joeuser@mydatabase','@',2) AS "mydatabase";
+select split_part('joeuser@mydatabase','@',3) AS "empty string";
+select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
+select split_part('joeuser@mydatabase','@',-1) AS "mydatabase";
+select split_part('joeuser@mydatabase','@',-2) AS "joeuser";
+select split_part('joeuser@mydatabase','@',-3) AS "empty string";
+select split_part('@joeuser@mydatabase@','@',-2) AS "mydatabase";
+--
+-- test to_hex
+--
+select to_hex(256*256*256 - 1) AS "ffffff";
+select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
+--
+-- MD5 test suite - from IETF RFC 1321
+-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
+--
+select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+select md5(''::bytea) = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+select md5('a'::bytea) = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+select md5('abc'::bytea) = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+select md5('message digest'::bytea) = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+select md5('abcdefghijklmnopqrstuvwxyz'::bytea) = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'::bytea) = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890'::bytea) = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+--
+-- SHA-2
+--
+SET bytea_output TO hex;
+SELECT sha224('');
+SELECT sha224('The quick brown fox jumps over the lazy dog.');
+SELECT sha256('');
+SELECT sha256('The quick brown fox jumps over the lazy dog.');
+SELECT sha384('');
+SELECT sha384('The quick brown fox jumps over the lazy dog.');
+SELECT sha512('');
+SELECT sha512('The quick brown fox jumps over the lazy dog.');
+--
+-- encode/decode
+--
+SELECT encode('\x1234567890abcdef00', 'hex');
+SELECT decode('1234567890abcdef00', 'hex');
+SELECT decode(encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea,
+ 'base64'), 'base64');
+SELECT decode(encode('\x1234567890abcdef00', 'escape'), 'escape');
+--
+-- get_bit/set_bit etc
+--
+SELECT get_bit('\x1234567890abcdef00'::bytea, 43);
+SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+SELECT set_bit('\x1234567890abcdef00'::bytea, 43, 0);
+SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+SELECT get_byte('\x1234567890abcdef00'::bytea, 3);
+SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+SELECT set_byte('\x1234567890abcdef00'::bytea, 7, 11);
+SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+--
+-- test behavior of escape_string_warning and standard_conforming_strings options
+--
+set escape_string_warning = off;
+set standard_conforming_strings = off;
+set escape_string_warning = on;
+set standard_conforming_strings = on;
+show standard_conforming_strings;
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+set standard_conforming_strings = off;
+set escape_string_warning = off;
+set standard_conforming_strings = on;
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+set standard_conforming_strings = off;
+reset standard_conforming_strings;
+--
+-- Additional string functions
+--
+SET bytea_output TO escape;
+SELECT initcap('hi THOMAS');
+SELECT lpad('hi', 5, 'xy');
+SELECT lpad('hi', -5, 'xy');
+SELECT lpad('hi', 5, '');
+SELECT rpad('hi', 5, 'xy');
+SELECT rpad('hi', -5, 'xy');
+SELECT rpad('hi', 5, '');
+SELECT ltrim('zzzytrim', 'xyz');
+SELECT translate('', '14', 'ax');
+SELECT translate('12345', '14', 'ax');
+SELECT ascii('x');
+SELECT ascii('');
+SELECT chr(65);
+SELECT chr(0);
+SELECT repeat('Pg', 4);
+SELECT repeat('Pg', -4);
+SELECT SUBSTRING('1234567890'::bytea FROM 3) "34567890";
+SELECT SUBSTRING('1234567890'::bytea FROM 4 FOR 3) AS "456";
+SELECT SUBSTRING('string'::bytea FROM 2 FOR 2147483646) AS "tring";
+SELECT SUBSTRING('string'::bytea FROM -10 FOR 2147483646) AS "string";
+SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT trim(leading E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT trim(trailing E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea);
+SELECT btrim(''::bytea, E'\\000'::bytea);
+SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea);
+SELECT bit_count('\x1234567890'::bytea);
+SELECT unistr('\0064at\+0000610');
+SELECT unistr('d\u0061t\U000000610');
+SELECT unistr('a\\b');
+-- errors:
+SELECT unistr('wrong: \db99');
+SELECT unistr('wrong: \db99\0061');
+SELECT unistr('wrong: \+00db99\+000061');
+SELECT unistr('wrong: \+2FFFFF');
+SELECT unistr('wrong: \udb99\u0061');
+SELECT unistr('wrong: \U0000db99\U00000061');
+SELECT unistr('wrong: \U002FFFFF');
+SELECT unistr('wrong: \xyz');
diff --git a/yql/essentials/tests/postgresql/cases/subselect.err b/yql/essentials/tests/postgresql/cases/subselect.err
new file mode 100644
index 0000000000..41dce0a24f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/subselect.err
@@ -0,0 +1,2054 @@
+Registering pre-existing tables
+ onek
+ int4_tbl
+ INT4_TBL
+ tenk1
+ text_tbl
+ road
+ TEXT_TBL
+ int8_tbl
+<sql-statement>
+--
+-- SUBSELECT
+--
+SELECT 1 AS one WHERE 1 IN (SELECT 1);
+</sql-statement>
+<sql-statement>
+SELECT 1 AS zero WHERE 1 NOT IN (SELECT 1);
+</sql-statement>
+<sql-statement>
+SELECT 1 AS zero WHERE 1 IN (SELECT 2);
+</sql-statement>
+<sql-statement>
+-- Check grammar's handling of extra parens in assorted contexts
+SELECT * FROM (SELECT 1 AS x) ss;
+</sql-statement>
+<sql-statement>
+SELECT * FROM ((SELECT 1 AS x)) ss;
+</sql-statement>
+<sql-statement>
+(SELECT 2) UNION SELECT 2;
+</sql-statement>
+<sql-statement>
+((SELECT 2)) UNION SELECT 2;
+</sql-statement>
+<sql-statement>
+SELECT ((SELECT 2) UNION SELECT 2);
+</sql-statement>
+<sql-statement>
+SELECT (((SELECT 2)) UNION SELECT 2);
+</sql-statement>
+<sql-statement>
+SELECT (SELECT ARRAY[1,2,3])[1];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT (SELECT ARRAY[1,2,3])[1];
+ ^
+<sql-statement>
+SELECT ((SELECT ARRAY[1,2,3]))[2];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT ((SELECT ARRAY[1,2,3]))[2];
+ ^
+<sql-statement>
+SELECT (((SELECT ARRAY[1,2,3])))[3];
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360
+ SELECT (((SELECT ARRAY[1,2,3])))[3];
+ ^
+<sql-statement>
+-- Set up some simple test tables
+CREATE TABLE SUBSELECT_TBL (
+ f1 integer,
+ f2 integer,
+ f3 float
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (1, 2, 3);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (2, 3, 4);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (3, 4, 5);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (1, 1, 1);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (2, 2, 2);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (3, 3, 3);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (6, 7, 8);
+</sql-statement>
+<sql-statement>
+INSERT INTO SUBSELECT_TBL VALUES (8, 9, NULL);
+</sql-statement>
+<sql-statement>
+SELECT * FROM SUBSELECT_TBL;
+</sql-statement>
+<sql-statement>
+-- Uncorrelated subselects
+SELECT f1 AS "Constant Select" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT 1);
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL);
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE
+ f2 IN (SELECT f1 FROM SUBSELECT_TBL));
+</sql-statement>
+<sql-statement>
+SELECT f1, f2
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) NOT IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:18: Error: alternative is not implemented yet : 138
+ WHERE (f1, f2) NOT IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ ^
+<sql-statement>
+-- Correlated subselects
+SELECT f1 AS "Correlated Field", f2 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE f1 = upper.f1);
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN
+ (SELECT f2 FROM SUBSELECT_TBL WHERE CAST(upper.f2 AS float) = f3);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: OrderedMap, At function: EquiJoin
+ SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ ^
+ -stdin-:<main>:3:12: Error: At function: Aggregate
+ WHERE f1 IN
+ ^
+ -stdin-:/lib/yql/aggregate.yql:644:18: Error: At function: AggregationTraits
+
+ ^
+ -stdin-:/lib/yql/aggregate.yql:678:111: Error: At function: SafeCast
+
+ ^
+ -stdin-:<main>:3:12: Error: At function: FromPg, At function: PgResolvedOp
+ WHERE f1 IN
+ ^
+ -stdin-:<main>:3:9: Error: At function: Member
+ WHERE f1 IN
+ ^
+ -stdin-:<main>:3:9: Error: Member not found: _yql_join_sublink_0__alias_upper.f1. Did you mean _yql_join_sublink_0__alias_upper.f2?
+ WHERE f1 IN
+ ^
+<sql-statement>
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ WHERE f2 = CAST(f3 AS integer));
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: OrderedFilter, At function: OrderedMap, At function: EquiJoin
+ SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ ^
+ -stdin-:<main>:3:12: Error: At function: Aggregate
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ ^
+ -stdin-:/lib/yql/aggregate.yql:644:18: Error: At function: AggregationTraits
+
+ ^
+ -stdin-:/lib/yql/aggregate.yql:678:111: Error: At function: SafeCast
+
+ ^
+ -stdin-:<main>:3:12: Error: At function: FromPg, At function: PgResolvedOp
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ ^
+ -stdin-:<main>:3:9: Error: At function: Member
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ ^
+ -stdin-:<main>:3:9: Error: Member not found: _yql_join_sublink_0__alias_upper.f3. Did you mean _yql_join_sublink_0__alias_upper.f1?
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ ^
+<sql-statement>
+SELECT f1 AS "Correlated Field"
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:18: Error: alternative is not implemented yet : 138
+ WHERE (f1, f2) IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ ^
+<sql-statement>
+--
+-- Use some existing tables in the regression test
+--
+SELECT ss.f1 AS "Correlated Field", ss.f3 AS "Second Field"
+ FROM SUBSELECT_TBL ss
+ WHERE f1 NOT IN (SELECT f1+1 FROM INT4_TBL
+ WHERE f1 != ss.f1 AND f1 < 2147483647);
+</sql-statement>
+<sql-statement>
+select q1, float8(count(*)) / (select count(*) from int8_tbl)
+from int8_tbl group by q1 order by q1;
+</sql-statement>
+-stdin-:<main>: Fatal: Optimization
+
+ -stdin-:<main>:1:1: Fatal: ydb/library/yql/core/common_opt/yql_co_pgselect.cpp:3637 ExpandPgSelectImpl(): requirement order failed
+ select q1, float8(count(*)) / (select count(*) from int8_tbl)
+ ^
+ -stdin-:<main>: Fatal: ydb/library/yql/core/common_opt/yql_co_pgselect.cpp:727 RewriteSubLinksPartial(): requirement status.Level != IGraphTransformer::TStatus::Error failed
+
+<sql-statement>
+-- Unspecified-type literals in output columns should resolve as text
+SELECT *, pg_typeof(f1) FROM
+ (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Unspecified-type literals in output columns should resolve as text
+ ^
+ -stdin-:<main>:2:21: Error: Star is incompatible to column reference
+ SELECT *, pg_typeof(f1) FROM
+ ^
+<sql-statement>
+-- ... unless there's context to suggest differently
+explain (verbose, costs off) select '42' union all select '43';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- ... unless there's context to suggest differently
+ ^
+<sql-statement>
+explain (verbose, costs off) select '42' union all select 43;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off) select '42' union all select 43;
+ ^
+<sql-statement>
+-- check materialization of an initplan reference (bug #14524)
+explain (verbose, costs off)
+select 1 = all (select (select 1));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- check materialization of an initplan reference (bug #14524)
+ ^
+<sql-statement>
+select 1 = all (select (select 1));
+</sql-statement>
+<sql-statement>
+--
+-- Check EXISTS simplification with LIMIT
+--
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (costs off)
+select * from int4_tbl o where not exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- Test cases to catch unpleasant interactions between IN-join processing
+-- and subquery pullup.
+--
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+</sql-statement>
+<sql-statement>
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+</sql-statement>
+<sql-statement>
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+</sql-statement>
+<sql-statement>
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+</sql-statement>
+<sql-statement>
+--
+-- Test cases to check for overenthusiastic optimization of
+-- "IN (SELECT DISTINCT ...)" and related cases. Per example from
+-- Luca Pireddu and Michael Fuhr.
+--
+CREATE TEMP TABLE foo (id integer);
+</sql-statement>
+<sql-statement>
+CREATE TEMP TABLE bar (id1 integer, id2 integer);
+</sql-statement>
+<sql-statement>
+INSERT INTO foo VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO bar VALUES (1, 1);
+</sql-statement>
+<sql-statement>
+INSERT INTO bar VALUES (2, 2);
+</sql-statement>
+<sql-statement>
+INSERT INTO bar VALUES (3, 1);
+</sql-statement>
+<sql-statement>
+-- These cases require an extra level of distinct-ing above subquery s
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT id1, id2 FROM bar) AS s);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1,id2 FROM bar GROUP BY id1,id2) AS s);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1, id2 FROM bar UNION
+ SELECT id1, id2 FROM bar) AS s);
+</sql-statement>
+<sql-statement>
+-- These cases do not
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT ON (id2) id1, id2 FROM bar) AS s);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar GROUP BY id2) AS s);
+</sql-statement>
+<sql-statement>
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar UNION
+ SELECT id2 FROM bar) AS s);
+</sql-statement>
+<sql-statement>
+--
+-- Test case to catch problems with multiply nested sub-SELECTs not getting
+-- recalculated properly. Per bug report from Didier Moens.
+--
+CREATE TABLE orderstest (
+ approver_ref integer,
+ po_ref integer,
+ ordercanceled boolean
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (1, 1, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 5, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 6, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 7, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 1, true);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 8, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 1, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (77, 1, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (1, 1, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (66, 1, false);
+</sql-statement>
+<sql-statement>
+INSERT INTO orderstest VALUES (1, 1, false);
+</sql-statement>
+<sql-statement>
+CREATE VIEW orders_view AS
+SELECT *,
+(SELECT CASE
+ WHEN ord.approver_ref=1 THEN '---' ELSE 'Approved'
+ END) AS "Approved",
+(SELECT CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (SELECT CASE
+ WHEN ord.po_ref=1
+ THEN
+ (SELECT CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status",
+(CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (CASE
+ WHEN ord.po_ref=1
+ THEN
+ (CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status_OK"
+FROM orderstest ord;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW orders_view AS
+ ^
+<sql-statement>
+SELECT * FROM orders_view;
+</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.orders_view
+
+<sql-statement>
+DROP TABLE orderstest cascade;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ DROP TABLE orderstest cascade;
+ ^
+<sql-statement>
+--
+-- Test cases to catch situations where rule rewriter fails to propagate
+-- hasSubLinks flag correctly. Per example from Kyle Bateman.
+--
+create temp table parts (
+ partnum text,
+ cost float8
+);
+</sql-statement>
+<sql-statement>
+create temp table shipped (
+ ttype char(2),
+ ordnum int4,
+ partnum text,
+ value float8
+);
+</sql-statement>
+<sql-statement>
+create temp view shipped_view as
+ select * from shipped where ttype = 'wt';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create temp view shipped_view as
+ ^
+<sql-statement>
+create rule shipped_view_insert as on insert to shipped_view do instead
+ insert into shipped values('wt', new.ordnum, new.partnum, new.value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 265
+ create rule shipped_view_insert as on insert to shipped_view do instead
+ ^
+<sql-statement>
+insert into parts (partnum, cost) values (1, 1234.56);
+</sql-statement>
+<sql-statement>
+insert into shipped_view (ordnum, partnum, value)
+ values (0, 1, (select cost from parts where partnum = '1'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: SubLinks are not allowed in: VALUES
+ values (0, 1, (select cost from parts where partnum = '1'));
+ ^
+<sql-statement>
+select * from shipped_view;
+</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.shipped_view
+
+<sql-statement>
+create rule shipped_view_update as on update to shipped_view do instead
+ update shipped set partnum = new.partnum, value = new.value
+ where ttype = new.ttype and ordnum = new.ordnum;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 265
+ create rule shipped_view_update as on update to shipped_view do instead
+ ^
+<sql-statement>
+update shipped_view set value = 11
+ from int4_tbl a join int4_tbl b
+ on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
+ where ordnum = a.f1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:18: Error: SubLinks are not allowed in: JOIN ON
+ on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
+ ^
+<sql-statement>
+select * from shipped_view;
+</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.shipped_view
+
+<sql-statement>
+select f1, ss1 as relabel from
+ (select *, (select sum(f1) from int4_tbl b where f1 >= a.f1) as ss1
+ from int4_tbl a) ss;
+</sql-statement>
+<sql-statement>
+--
+-- Test cases involving PARAM_EXEC parameters and min/max index optimizations.
+-- Per bug report from David Sanchez i Gregori.
+--
+select * from (
+ select max(unique1) from tenk1 as a
+ where exists (select 1 from tenk1 as b where b.thousand = a.unique2)
+) ss;
+</sql-statement>
+<sql-statement>
+select * from (
+ select min(unique1) from tenk1 as a
+ where not exists (select 1 from tenk1 as b where b.unique2 = 10000)
+) ss;
+</sql-statement>
+<sql-statement>
+--
+-- Test that an IN implemented using a UniquePath does unique-ification
+-- with the right semantics, as per bug #4113. (Unfortunately we have
+-- no simple way to ensure that this test case actually chooses that type
+-- of plan, but it does in releases 7.4-8.3. Note that an ordering difference
+-- here might mean that some other plan type is being used, rendering the test
+-- pointless.)
+--
+create temp table numeric_table (num_col numeric);
+</sql-statement>
+<sql-statement>
+insert into numeric_table values (1), (1.000000000000000000001), (2), (3);
+</sql-statement>
+<sql-statement>
+create temp table float_table (float_col float8);
+</sql-statement>
+<sql-statement>
+insert into float_table values (1), (2), (3);
+</sql-statement>
+<sql-statement>
+select * from float_table
+ where float_col in (select num_col from numeric_table);
+</sql-statement>
+<sql-statement>
+select * from numeric_table
+ where num_col in (select float_col from float_table);
+</sql-statement>
+<sql-statement>
+--
+-- Test case for bug #4290: bogus calculation of subplan param sets
+--
+create temp table ta (id int primary key, val int);
+</sql-statement>
+<sql-statement>
+insert into ta values(1,1);
+</sql-statement>
+<sql-statement>
+insert into ta values(2,2);
+</sql-statement>
+<sql-statement>
+create temp table tb (id int primary key, aval int);
+</sql-statement>
+<sql-statement>
+insert into tb values(1,1);
+</sql-statement>
+<sql-statement>
+insert into tb values(2,1);
+</sql-statement>
+<sql-statement>
+insert into tb values(3,2);
+</sql-statement>
+<sql-statement>
+insert into tb values(4,2);
+</sql-statement>
+<sql-statement>
+create temp table tc (id int primary key, aid int);
+</sql-statement>
+<sql-statement>
+insert into tc values(1,1);
+</sql-statement>
+<sql-statement>
+insert into tc values(2,2);
+</sql-statement>
+<sql-statement>
+select
+ ( select min(tb.id) from tb
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+from tc;
+</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
+ ^
+ -stdin-:<main>:2:3: Error: At function: PgSubLink, At function: PgSelect
+ ( select min(tb.id) from tb
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:2:3: Error: At function: PgWhere
+ ( select min(tb.id) from tb
+ ^
+ -stdin-:<main>:3:19: Error: At function: PgOp
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+ ^
+ -stdin-:<main>:3:21: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+ ^
+ -stdin-:<main>:3:58: Error: No such column: aid
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+ ^
+<sql-statement>
+--
+-- Test case for 8.3 "failed to locate grouping columns" bug
+--
+create temp table t1 (f1 numeric(14,0), f2 varchar(30));
+</sql-statement>
+<sql-statement>
+select * from
+ (select distinct f1, f2, (select f2 from t1 x where x.f1 = up.f1) as fs
+ from t1 up) ss
+group by f1,f2,fs;
+</sql-statement>
+<sql-statement>
+--
+-- Test case for bug #5514 (mishandling of whole-row Vars in subselects)
+--
+create temp table table_a(id integer);
+</sql-statement>
+<sql-statement>
+insert into table_a values (42);
+</sql-statement>
+<sql-statement>
+create temp view view_a as select * from table_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ create temp view view_a as select * from table_a;
+ ^
+<sql-statement>
+select view_a from view_a;
+</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.view_a
+
+<sql-statement>
+select (select view_a) from view_a;
+</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.view_a
+
+<sql-statement>
+select (select (select view_a)) from view_a;
+</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.view_a
+
+<sql-statement>
+select (select (a.*)::text) from view_a a;
+</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.view_a
+
+<sql-statement>
+--
+-- Check that whole-row Vars reading the result of a subselect don't include
+-- any junk columns therein
+--
+select q from (select max(f1) from int4_tbl group by f1 order by f1) q;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Pull
+ --
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: input of anonymous composite types is not implemented
+
+ --
+ ^
+<sql-statement>
+with q as (select max(f1) from int4_tbl group by f1 order by f1)
+ select q from q;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Pull
+ with q as (select max(f1) from int4_tbl group by f1 order by f1)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: input of anonymous composite types is not implemented
+
+ with q as (select max(f1) from int4_tbl group by f1 order by f1)
+ ^
+<sql-statement>
+--
+-- Test case for sublinks pulled up into joinaliasvars lists in an
+-- inherited update/delete query
+--
+begin; -- this shouldn't delete anything, but be safe
+</sql-statement>
+<sql-statement>
+delete from road
+where exists (
+ select 1
+ from
+ int4_tbl cross join
+ ( select f1, array(select q1 from int8_tbl) as arr
+ from text_tbl ) ss
+ where road.name = ss.f1 );
+</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>
+rollback;
+</sql-statement>
+<sql-statement>
+--
+-- Test case for sublinks pushed down into subselects via join alias expansion
+--
+select
+ (select sq1) as qq1
+from
+ (select exists(select 1 from int4_tbl where f1 = q2) as sq1, 42 as dummy
+ from int8_tbl) sq0
+ join
+ int4_tbl i4 on dummy = i4.f1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: OrderedFlatMap, At function: EquiJoin, At function: OrderedFlatMap, At function: EquiJoin, At function: OrderedFlatMap, At function: EquiJoin
+ --
+ ^
+ -stdin-:<main>:7:11: Error: At function: Aggregate, At function: OrderedMap, At function: EquiJoin
+ (select exists(select 1 from int4_tbl where f1 = q2) as sq1, 42 as dummy
+ ^
+ -stdin-:<main>:7:11: Error: Cannot compare key columns (a._alias_int4_tbl.f1 has type: pgint4, b._alias_int8_tbl.q2 has type: pgint8)
+ (select exists(select 1 from int4_tbl where f1 = q2) as sq1, 42 as dummy
+ ^
+<sql-statement>
+--
+-- Test case for subselect within UPDATE of INSERT...ON CONFLICT DO UPDATE
+--
+create temp table upsert(key int4 primary key, val text);
+</sql-statement>
+<sql-statement>
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'not seen';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ insert into upsert values(1, 'val') on conflict (key) do update set val = 'not seen';
+ ^
+<sql-statement>
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'seen with subselect ' || (select f1 from int4_tbl where f1 != 0 limit 1)::text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ insert into upsert values(1, 'val') on conflict (key) do update set val = 'seen with subselect ' || (select f1 from int4_tbl where f1 != 0 limit 1)::text;
+ ^
+<sql-statement>
+select * from upsert;
+</sql-statement>
+<sql-statement>
+with aa as (select 'int4_tbl' u from int4_tbl limit 1)
+insert into upsert values (1, 'x'), (999, 'y')
+on conflict (key) do update set val = (select u from aa)
+returning *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ with aa as (select 'int4_tbl' u from int4_tbl limit 1)
+ ^
+<sql-statement>
+--
+-- Test case for cross-type partial matching in hashed subplan (bug #7597)
+--
+create temp table outer_7597 (f1 int4, f2 int4);
+</sql-statement>
+<sql-statement>
+insert into outer_7597 values (0, 0);
+</sql-statement>
+<sql-statement>
+insert into outer_7597 values (1, 0);
+</sql-statement>
+<sql-statement>
+insert into outer_7597 values (0, null);
+</sql-statement>
+<sql-statement>
+insert into outer_7597 values (1, null);
+</sql-statement>
+<sql-statement>
+create temp table inner_7597(c1 int8, c2 int8);
+</sql-statement>
+<sql-statement>
+insert into inner_7597 values(0, null);
+</sql-statement>
+<sql-statement>
+select * from outer_7597 where (f1, f2) not in (select * from inner_7597);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: alternative is not implemented yet : 138
+ select * from outer_7597 where (f1, f2) not in (select * from inner_7597);
+ ^
+<sql-statement>
+--
+-- Similar test case using text that verifies that collation
+-- information is passed through by execTuplesEqual() in nodeSubplan.c
+-- (otherwise it would error in texteq())
+--
+create temp table outer_text (f1 text, f2 text);
+</sql-statement>
+<sql-statement>
+insert into outer_text values ('a', 'a');
+</sql-statement>
+<sql-statement>
+insert into outer_text values ('b', 'a');
+</sql-statement>
+<sql-statement>
+insert into outer_text values ('a', null);
+</sql-statement>
+<sql-statement>
+insert into outer_text values ('b', null);
+</sql-statement>
+<sql-statement>
+create temp table inner_text (c1 text, c2 text);
+</sql-statement>
+<sql-statement>
+insert into inner_text values ('a', null);
+</sql-statement>
+<sql-statement>
+insert into inner_text values ('123', '456');
+</sql-statement>
+<sql-statement>
+select * from outer_text where (f1, f2) not in (select * from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: alternative is not implemented yet : 138
+ select * from outer_text where (f1, f2) not in (select * from inner_text);
+ ^
+<sql-statement>
+--
+-- Another test case for cross-type hashed subplans: comparison of
+-- inner-side values must be done with appropriate operator
+--
+explain (verbose, costs off)
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+ ^
+ -stdin-:<main>:1:20: Error: At function: ToPg, At function: SqlIn
+ select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+ ^
+ -stdin-:<main>:1:20: Error: Can't lookup pgtext in collection of pgname: types pgtext and pgname are not comparable
+ select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+ ^
+<sql-statement>
+--
+-- Test that we don't try to hash nested records (bug #17363)
+-- (Hashing could be supported, but for now we don't)
+--
+explain (verbose, costs off)
+select row(row(row(1))) = any (select row(row(1)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select row(row(row(1))) = any (select row(row(1)));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:25: Error: alternative is not implemented yet : 138
+ select row(row(row(1))) = any (select row(row(1)));
+ ^
+<sql-statement>
+--
+-- Test case for premature memory release during hashing of subplan output
+--
+select '1'::text in (select '1'::name union all select '1'::name);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: PgReplaceUnknown, At function: OrderedMap, At function: AsStruct
+ --
+ ^
+ -stdin-:<main>:4:18: Error: At function: ToPg, At function: SqlIn
+ select '1'::text in (select '1'::name union all select '1'::name);
+ ^
+ -stdin-:<main>:4:18: Error: Can't lookup pgtext in collection of pgname: types pgtext and pgname are not comparable
+ select '1'::text in (select '1'::name union all select '1'::name);
+ ^
+<sql-statement>
+--
+-- Test that we don't try to use a hashed subplan if the simplified
+-- testexpr isn't of the right shape
+--
+-- this fails by default, of course
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ --
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ --
+ ^
+ -stdin-:<main>:6:33: Error: At function: PgSubLink, At function: PgOp
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:6:33: Error: Unable to find an overload for operator = with given argument type(s): (int8,text)
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+<sql-statement>
+begin;
+</sql-statement>
+<sql-statement>
+-- make an operator to allow it to succeed
+create function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- make an operator to allow it to succeed
+ ^
+<sql-statement>
+create operator = (procedure=bogus_int8_text_eq, leftarg=int8, rightarg=text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ create operator = (procedure=bogus_int8_text_eq, leftarg=int8, rightarg=text);
+ ^
+<sql-statement>
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgSubLink, At function: PgOp
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: Unable to find an overload for operator = with given argument type(s): (int8,text)
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+<sql-statement>
+-- inlining of this function results in unusual number of hash clauses,
+-- which we can still cope with
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2 and $1::text = $2';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- inlining of this function results in unusual number of hash clauses,
+ ^
+<sql-statement>
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgSubLink, At function: PgOp
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: Unable to find an overload for operator = with given argument type(s): (int8,text)
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+<sql-statement>
+-- inlining of this function causes LHS and RHS to be switched,
+-- which we can't cope with, so hashing should be abandoned
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $2 = $1::text';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- inlining of this function causes LHS and RHS to be switched,
+ ^
+<sql-statement>
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from int8_tbl where q1 in (select c1 from inner_text);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgSubLink, At function: PgOp
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+ -stdin-:<main>:1:33: Error: Unable to find an overload for operator = with given argument type(s): (int8,text)
+ select * from int8_tbl where q1 in (select c1 from inner_text);
+ ^
+<sql-statement>
+rollback; -- to get rid of the bogus operator
+</sql-statement>
+<sql-statement>
+--
+-- Test resolution of hashed vs non-hashed implementation of EXISTS subplan
+--
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+</sql-statement>
+<sql-statement>
+-- It's possible for the same EXISTS to get resolved both ways
+create temp table exists_tbl (c1 int, c2 int, c3 int) partition by list (c1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- It's possible for the same EXISTS to get resolved both ways
+ ^
+<sql-statement>
+create temp table exists_tbl_null partition of exists_tbl for values in (null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table exists_tbl_null partition of exists_tbl for values in (null);
+ ^
+<sql-statement>
+create temp table exists_tbl_def partition of exists_tbl default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create temp table exists_tbl_def partition of exists_tbl default;
+ ^
+<sql-statement>
+insert into exists_tbl select x, x/2, x+1 from generate_series(0,10) x;
+</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.exists_tbl
+
+<sql-statement>
+analyze exists_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze exists_tbl;
+ ^
+<sql-statement>
+explain (costs off)
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+</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.exists_tbl
+
+<sql-statement>
+--
+-- Test case for planner bug with nested EXISTS handling
+--
+select a.thousand from tenk1 a, tenk1 b
+where a.thousand = b.thousand
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ and not exists ( select 1 from tenk1 d
+ where a.thousand = d.thousand ) );
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ --
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ --
+ ^
+ -stdin-:<main>:6:3: Error: At function: PgAnd
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ ^
+ -stdin-:<main>:6:7: Error: At function: PgSubLink, At function: PgSelect
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:6:7: Error: At function: PgWhere
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ ^
+ -stdin-:<main>:7:20: Error: At function: PgAnd
+ and not exists ( select 1 from tenk1 d
+ ^
+ -stdin-:<main>:7:24: Error: At function: PgNot
+ and not exists ( select 1 from tenk1 d
+ ^
+ -stdin-:<main>:7:28: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem
+ and not exists ( select 1 from tenk1 d
+ ^
+ -stdin-:<main>:8:43: Error: No such column: thousand
+ where a.thousand = d.thousand ) );
+ ^
+<sql-statement>
+--
+-- Check that nested sub-selects are not pulled up if they contain volatiles
+--
+explain (verbose, costs off)
+ select x, x from
+ (select (select now()) as x from (values(1),(2)) v(y)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+explain (verbose, costs off)
+ select x, x from
+ (select (select random()) as x from (values(1),(2)) v(y)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+explain (verbose, costs off)
+ select x, x from
+ (select (select now() where y=y) as x from (values(1),(2)) v(y)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+explain (verbose, costs off)
+ select x, x from
+ (select (select random() where y=y) as x from (values(1),(2)) v(y)) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+--
+-- Test rescan of a hashed subplan (the use of random() is to prevent the
+-- sub-select from being pulled up, which would result in not hashing)
+--
+explain (verbose, costs off)
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select sum(ss.tst::int) from
+ ^
+<sql-statement>
+--
+-- Test rescan of a SetOp node
+--
+explain (costs off)
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select count(*) from
+ ^
+<sql-statement>
+--
+-- Test rescan of a RecursiveUnion node
+--
+explain (costs off)
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select sum(o.four), sum(ss.a) from
+ ^
+<sql-statement>
+--
+-- Check we don't misoptimize a NOT IN where the subquery returns no rows.
+--
+create temp table notinouter (a int);
+</sql-statement>
+<sql-statement>
+create temp table notininner (b int not null);
+</sql-statement>
+<sql-statement>
+insert into notinouter values (null), (1);
+</sql-statement>
+<sql-statement>
+select * from notinouter where a not in (select b from notininner);
+</sql-statement>
+<sql-statement>
+--
+-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
+--
+create temp table nocolumns();
+</sql-statement>
+<sql-statement>
+select exists(select * from nocolumns);
+</sql-statement>
+<sql-statement>
+--
+-- Check behavior with a SubPlan in VALUES (bug #14924)
+--
+select val.x
+ from generate_series(1,10) as s(i),
+ lateral (
+ values ((select s.i + 1)), (s.i + 101)
+ ) as val(x)
+where s.i < 10 and (select val.x) < 110;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ --
+ ^
+<sql-statement>
+-- another variant of that (bug #16213)
+explain (verbose, costs off)
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- another variant of that (bug #16213)
+ ^
+<sql-statement>
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:6: Error: SubLinks are not allowed in: VALUES
+ (3 not in (select * from (values (1), (2)) ss1)),
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select * from
+ ^
+<sql-statement>
+--
+-- Check sane behavior with nested IN SubLinks
+--
+explain (verbose, costs off)
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from int4_tbl where
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ select * from int4_tbl where
+ ^
+ -stdin-:<main>:2:73: Error: At function: PgSubLink, At function: PgOp
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ ^
+ -stdin-:<main>:2:4: Error: At function: If, At function: Coalesce, At function: FromPg
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ ^
+ -stdin-:<main>:2:17: Error: Expected computable data, but got: Unit
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ ^
+ -stdin-:<main>:2:17: Error: Computable required. Atom, key, world, datasink, datasource, type, lambda are not computable
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ ^
+<sql-statement>
+--
+-- Check for incorrect optimization when IN subquery contains a SRF
+--
+explain (verbose, costs off)
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: alternative is not implemented yet : 138
+ select * from int4_tbl o where (f1, f1) in
+ ^
+<sql-statement>
+--
+-- check for over-optimization of whole-row Var referencing an Append plan
+--
+select (select q from
+ (select 1,2,3 where f1 > 0
+ union all
+ select 4,5,6.0 where f1 <= 0
+ ) q )
+from int4_tbl;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ --
+ ^
+ -stdin-:<main>:4:8: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem, At function: PgSelect
+ select (select q from
+ ^
+ -stdin-:<main>:4:8: Error: At function: PgSetItem
+ select (select q from
+ ^
+ -stdin-:<main>:5:30: Error: Column reference can't be used without FROM
+ (select 1,2,3 where f1 > 0
+ ^
+ -stdin-:<main>:4:8: Error: At function: PgSetItem
+ select (select q from
+ ^
+ -stdin-:<main>:7:32: Error: Column reference can't be used without FROM
+ select 4,5,6.0 where f1 <= 0
+ ^
+<sql-statement>
+--
+-- Check for sane handling of a lateral reference in a subquery's quals
+-- (most of the complication here is to prevent the test case from being
+-- flattened too much)
+--
+explain (verbose, costs off)
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RangeSubselect: unsupported lateral
+ select * from
+ ^
+<sql-statement>
+--
+-- Check that volatile quals aren't pushed down past a DISTINCT:
+-- nextval() should not be called more than the nominal number of times
+--
+create temp sequence ts1;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ --
+ ^
+<sql-statement>
+select * from
+ (select distinct ten from tenk1) ss
+ where ten < 10 + nextval('ts1')
+ order by 1;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMapReduce!
+ select * from
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "ts1" does not exist
+
+ select * from
+ ^
+<sql-statement>
+select nextval('ts1');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select nextval('ts1');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "ts1" does not exist
+
+ select nextval('ts1');
+ ^
+<sql-statement>
+--
+-- Check that volatile quals aren't pushed down past a set-returning function;
+-- while a nonvolatile qual can be, if it doesn't reference the SRF.
+--
+create function tattle(x int, y int) returns bool
+volatile language plpgsql as $$
+begin
+ raise notice 'x = %, y = %', x, y;
+ return x > y;
+end$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ --
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: Generator functions are not allowed in: SELECT
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select * from
+ ^
+<sql-statement>
+-- if we pretend it's stable, we get different results:
+alter function tattle(x int, y int) stable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 262
+ -- if we pretend it's stable, we get different results:
+ ^
+<sql-statement>
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: Generator functions are not allowed in: SELECT
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select * from
+ ^
+<sql-statement>
+-- although even a stable qual should not be pushed down if it references SRF
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- although even a stable qual should not be pushed down if it references SRF
+ ^
+<sql-statement>
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: Generator functions are not allowed in: SELECT
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select * from
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select * from
+ ^
+<sql-statement>
+drop function tattle(x int, y int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function tattle(x int, y int);
+ ^
+<sql-statement>
+--
+-- Test that LIMIT can be pushed to SORT through a subquery that just projects
+-- columns. We check for that having happened by looking to see if EXPLAIN
+-- ANALYZE shows that a top-N sort was used. We must suppress or filter away
+-- all the non-invariant parts of the EXPLAIN ANALYZE output.
+--
+create table sq_limit (pk int primary key, c1 int, c2 int);
+</sql-statement>
+<sql-statement>
+insert into sq_limit values
+ (1, 1, 1),
+ (2, 2, 2),
+ (3, 3, 3),
+ (4, 4, 4),
+ (5, 1, 1),
+ (6, 2, 2),
+ (7, 3, 3),
+ (8, 4, 4);
+</sql-statement>
+<sql-statement>
+create function explain_sq_limit() returns setof text language plpgsql as
+$$
+declare ln text;
+begin
+ for ln in
+ explain (analyze, summary off, timing off, costs off)
+ select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3
+ loop
+ ln := regexp_replace(ln, 'Memory: \S*', 'Memory: xxx');
+ return next ln;
+ end loop;
+end;
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ create function explain_sq_limit() returns setof text language plpgsql as
+ ^
+<sql-statement>
+select * from explain_sq_limit();
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from explain_sq_limit();
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from explain_sq_limit();
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: explain_sq_limit
+ select * from explain_sq_limit();
+ ^
+<sql-statement>
+select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3;
+</sql-statement>
+<sql-statement>
+drop function explain_sq_limit();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function explain_sq_limit();
+ ^
+<sql-statement>
+drop table sq_limit;
+</sql-statement>
+<sql-statement>
+--
+-- Ensure that backward scan direction isn't propagated into
+-- expression subqueries (bug #15336)
+--
+begin;
+</sql-statement>
+<sql-statement>
+declare c1 scroll cursor for
+ select * from generate_series(1,4) i
+ where i <> all (values (2),(3));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 304
+ declare c1 scroll cursor for
+ ^
+<sql-statement>
+move forward all in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ move forward all in c1;
+ ^
+<sql-statement>
+fetch backward all in c1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 259
+ fetch backward all in c1;
+ ^
+<sql-statement>
+commit;
+</sql-statement>
+<sql-statement>
+--
+-- Tests for CTE inlining behavior
+--
+-- Basic subquery that can be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ --
+ ^
+<sql-statement>
+-- Explicitly request materialization
+explain (verbose, costs off)
+with x as materialized (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Explicitly request materialization
+ ^
+<sql-statement>
+-- Stable functions are safe to inline
+explain (verbose, costs off)
+with x as (select * from (select f1, now() from subselect_tbl) ss)
+select * from x where f1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Stable functions are safe to inline
+ ^
+<sql-statement>
+-- Volatile functions prevent inlining
+explain (verbose, costs off)
+with x as (select * from (select f1, random() from subselect_tbl) ss)
+select * from x where f1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Volatile functions prevent inlining
+ ^
+<sql-statement>
+-- SELECT FOR UPDATE cannot be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl for update) ss)
+select * from x where f1 = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- SELECT FOR UPDATE cannot be inlined
+ ^
+<sql-statement>
+-- Multiply-referenced CTEs are inlined only when requested
+explain (verbose, costs off)
+with x as (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Multiply-referenced CTEs are inlined only when requested
+ ^
+<sql-statement>
+explain (verbose, costs off)
+with x as not materialized (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+-- Multiply-referenced CTEs can't be inlined if they contain outer self-refs
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Multiply-referenced CTEs can't be inlined if they contain outer self-refs
+ ^
+<sql-statement>
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+</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.z
+
+<sql-statement>
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+</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.z
+
+<sql-statement>
+-- Check handling of outer references
+explain (verbose, costs off)
+with x as (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Check handling of outer references
+ ^
+<sql-statement>
+explain (verbose, costs off)
+with x as materialized (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (verbose, costs off)
+ ^
+<sql-statement>
+-- Ensure that we inline the currect CTE when there are
+-- multiple CTEs with the same name
+explain (verbose, costs off)
+with x as (select 1 as y)
+select * from (with x as (select 2 as y) select * from x) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Ensure that we inline the currect CTE when there are
+ ^
+<sql-statement>
+-- Row marks are not pushed into CTEs
+explain (verbose, costs off)
+with x as (select * from subselect_tbl)
+select * from x for update;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Row marks are not pushed into CTEs
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/subselect.out b/yql/essentials/tests/postgresql/cases/subselect.out
new file mode 100644
index 0000000000..6fcf3c2b3c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/subselect.out
@@ -0,0 +1,397 @@
+--
+-- SUBSELECT
+--
+SELECT 1 AS one WHERE 1 IN (SELECT 1);
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1 AS zero WHERE 1 NOT IN (SELECT 1);
+ zero
+------
+(0 rows)
+
+SELECT 1 AS zero WHERE 1 IN (SELECT 2);
+ zero
+------
+(0 rows)
+
+-- Check grammar's handling of extra parens in assorted contexts
+SELECT * FROM (SELECT 1 AS x) ss;
+ x
+---
+ 1
+(1 row)
+
+SELECT * FROM ((SELECT 1 AS x)) ss;
+ x
+---
+ 1
+(1 row)
+
+(SELECT 2) UNION SELECT 2;
+ ?column?
+----------
+ 2
+(1 row)
+
+((SELECT 2)) UNION SELECT 2;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT ((SELECT 2) UNION SELECT 2);
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT (((SELECT 2)) UNION SELECT 2);
+ ?column?
+----------
+ 2
+(1 row)
+
+-- Set up some simple test tables
+CREATE TABLE SUBSELECT_TBL (
+ f1 integer,
+ f2 integer,
+ f3 float
+);
+INSERT INTO SUBSELECT_TBL VALUES (1, 2, 3);
+INSERT INTO SUBSELECT_TBL VALUES (2, 3, 4);
+INSERT INTO SUBSELECT_TBL VALUES (3, 4, 5);
+INSERT INTO SUBSELECT_TBL VALUES (1, 1, 1);
+INSERT INTO SUBSELECT_TBL VALUES (2, 2, 2);
+INSERT INTO SUBSELECT_TBL VALUES (3, 3, 3);
+INSERT INTO SUBSELECT_TBL VALUES (6, 7, 8);
+INSERT INTO SUBSELECT_TBL VALUES (8, 9, NULL);
+SELECT * FROM SUBSELECT_TBL;
+ f1 | f2 | f3
+----+----+----
+ 1 | 2 | 3
+ 2 | 3 | 4
+ 3 | 4 | 5
+ 1 | 1 | 1
+ 2 | 2 | 2
+ 3 | 3 | 3
+ 6 | 7 | 8
+ 8 | 9 |
+(8 rows)
+
+-- Uncorrelated subselects
+SELECT f1 AS "Constant Select" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT 1);
+ Constant Select
+-----------------
+ 1
+ 1
+(2 rows)
+
+select 1 = all (select (select 1));
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Test cases to catch unpleasant interactions between IN-join processing
+-- and subquery pullup.
+--
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+ count
+-------
+ 100
+(1 row)
+
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+ count
+-------
+ 10
+(1 row)
+
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+ count
+-------
+ 100
+(1 row)
+
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+ count
+-------
+ 10
+(1 row)
+
+--
+-- Test cases to check for overenthusiastic optimization of
+-- "IN (SELECT DISTINCT ...)" and related cases. Per example from
+-- Luca Pireddu and Michael Fuhr.
+--
+CREATE TEMP TABLE foo (id integer);
+CREATE TEMP TABLE bar (id1 integer, id2 integer);
+INSERT INTO foo VALUES (1);
+INSERT INTO bar VALUES (1, 1);
+INSERT INTO bar VALUES (2, 2);
+INSERT INTO bar VALUES (3, 1);
+-- These cases require an extra level of distinct-ing above subquery s
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1,id2 FROM bar GROUP BY id1,id2) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1, id2 FROM bar UNION
+ SELECT id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+-- These cases do not
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT ON (id2) id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar GROUP BY id2) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar UNION
+ SELECT id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+--
+-- Test case to catch problems with multiply nested sub-SELECTs not getting
+-- recalculated properly. Per bug report from Didier Moens.
+--
+CREATE TABLE orderstest (
+ approver_ref integer,
+ po_ref integer,
+ ordercanceled boolean
+);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 5, false);
+INSERT INTO orderstest VALUES (66, 6, false);
+INSERT INTO orderstest VALUES (66, 7, false);
+INSERT INTO orderstest VALUES (66, 1, true);
+INSERT INTO orderstest VALUES (66, 8, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (77, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+--
+-- Test cases to catch situations where rule rewriter fails to propagate
+-- hasSubLinks flag correctly. Per example from Kyle Bateman.
+--
+create temp table parts (
+ partnum text,
+ cost float8
+);
+create temp table shipped (
+ ttype char(2),
+ ordnum int4,
+ partnum text,
+ value float8
+);
+insert into parts (partnum, cost) values (1, 1234.56);
+--
+-- Test cases involving PARAM_EXEC parameters and min/max index optimizations.
+-- Per bug report from David Sanchez i Gregori.
+--
+select * from (
+ select max(unique1) from tenk1 as a
+ where exists (select 1 from tenk1 as b where b.thousand = a.unique2)
+) ss;
+ max
+------
+ 9997
+(1 row)
+
+select * from (
+ select min(unique1) from tenk1 as a
+ where not exists (select 1 from tenk1 as b where b.unique2 = 10000)
+) ss;
+ min
+-----
+ 0
+(1 row)
+
+--
+-- Test that an IN implemented using a UniquePath does unique-ification
+-- with the right semantics, as per bug #4113. (Unfortunately we have
+-- no simple way to ensure that this test case actually chooses that type
+-- of plan, but it does in releases 7.4-8.3. Note that an ordering difference
+-- here might mean that some other plan type is being used, rendering the test
+-- pointless.)
+--
+create temp table numeric_table (num_col numeric);
+insert into numeric_table values (1), (1.000000000000000000001), (2), (3);
+create temp table float_table (float_col float8);
+insert into float_table values (1), (2), (3);
+select * from float_table
+ where float_col in (select num_col from numeric_table);
+ float_col
+-----------
+ 1
+ 2
+ 3
+(3 rows)
+
+--
+-- Test case for bug #4290: bogus calculation of subplan param sets
+--
+create temp table ta (id int primary key, val int);
+insert into ta values(1,1);
+insert into ta values(2,2);
+create temp table tb (id int primary key, aval int);
+insert into tb values(1,1);
+insert into tb values(2,1);
+insert into tb values(3,2);
+insert into tb values(4,2);
+create temp table tc (id int primary key, aid int);
+insert into tc values(1,1);
+insert into tc values(2,2);
+--
+-- Test case for 8.3 "failed to locate grouping columns" bug
+--
+create temp table t1 (f1 numeric(14,0), f2 varchar(30));
+select * from
+ (select distinct f1, f2, (select f2 from t1 x where x.f1 = up.f1) as fs
+ from t1 up) ss
+group by f1,f2,fs;
+ f1 | f2 | fs
+----+----+----
+(0 rows)
+
+--
+-- Test case for bug #5514 (mishandling of whole-row Vars in subselects)
+--
+create temp table table_a(id integer);
+insert into table_a values (42);
+--
+-- Test case for sublinks pulled up into joinaliasvars lists in an
+-- inherited update/delete query
+--
+begin; -- this shouldn't delete anything, but be safe
+rollback;
+--
+-- Test case for subselect within UPDATE of INSERT...ON CONFLICT DO UPDATE
+--
+create temp table upsert(key int4 primary key, val text);
+--
+-- Test case for cross-type partial matching in hashed subplan (bug #7597)
+--
+create temp table outer_7597 (f1 int4, f2 int4);
+insert into outer_7597 values (0, 0);
+insert into outer_7597 values (1, 0);
+insert into outer_7597 values (0, null);
+insert into outer_7597 values (1, null);
+create temp table inner_7597(c1 int8, c2 int8);
+insert into inner_7597 values(0, null);
+--
+-- Similar test case using text that verifies that collation
+-- information is passed through by execTuplesEqual() in nodeSubplan.c
+-- (otherwise it would error in texteq())
+--
+create temp table outer_text (f1 text, f2 text);
+insert into outer_text values ('a', 'a');
+insert into outer_text values ('b', 'a');
+insert into outer_text values ('a', null);
+insert into outer_text values ('b', null);
+create temp table inner_text (c1 text, c2 text);
+insert into inner_text values ('a', null);
+insert into inner_text values ('123', '456');
+begin;
+rollback; -- to get rid of the bogus operator
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+ count
+-------
+ 10000
+(1 row)
+
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+ count
+-------
+ 10
+(1 row)
+
+--
+-- Check we don't misoptimize a NOT IN where the subquery returns no rows.
+--
+create temp table notinouter (a int);
+create temp table notininner (b int not null);
+insert into notinouter values (null), (1);
+--
+-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
+--
+create temp table nocolumns();
+select exists(select * from nocolumns);
+ exists
+--------
+ f
+(1 row)
+
+--
+-- Test that LIMIT can be pushed to SORT through a subquery that just projects
+-- columns. We check for that having happened by looking to see if EXPLAIN
+-- ANALYZE shows that a top-N sort was used. We must suppress or filter away
+-- all the non-invariant parts of the EXPLAIN ANALYZE output.
+--
+create table sq_limit (pk int primary key, c1 int, c2 int);
+insert into sq_limit values
+ (1, 1, 1),
+ (2, 2, 2),
+ (3, 3, 3),
+ (4, 4, 4),
+ (5, 1, 1),
+ (6, 2, 2),
+ (7, 3, 3),
+ (8, 4, 4);
+select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3;
+ pk | c2
+----+----
+ 1 | 1
+ 5 | 1
+ 2 | 2
+(3 rows)
+
+drop table sq_limit;
+--
+-- Ensure that backward scan direction isn't propagated into
+-- expression subqueries (bug #15336)
+--
+begin;
+commit;
diff --git a/yql/essentials/tests/postgresql/cases/subselect.sql b/yql/essentials/tests/postgresql/cases/subselect.sql
new file mode 100644
index 0000000000..8199ba3176
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/subselect.sql
@@ -0,0 +1,238 @@
+--
+-- SUBSELECT
+--
+SELECT 1 AS one WHERE 1 IN (SELECT 1);
+SELECT 1 AS zero WHERE 1 NOT IN (SELECT 1);
+SELECT 1 AS zero WHERE 1 IN (SELECT 2);
+-- Check grammar's handling of extra parens in assorted contexts
+SELECT * FROM (SELECT 1 AS x) ss;
+SELECT * FROM ((SELECT 1 AS x)) ss;
+(SELECT 2) UNION SELECT 2;
+((SELECT 2)) UNION SELECT 2;
+SELECT ((SELECT 2) UNION SELECT 2);
+SELECT (((SELECT 2)) UNION SELECT 2);
+-- Set up some simple test tables
+CREATE TABLE SUBSELECT_TBL (
+ f1 integer,
+ f2 integer,
+ f3 float
+);
+INSERT INTO SUBSELECT_TBL VALUES (1, 2, 3);
+INSERT INTO SUBSELECT_TBL VALUES (2, 3, 4);
+INSERT INTO SUBSELECT_TBL VALUES (3, 4, 5);
+INSERT INTO SUBSELECT_TBL VALUES (1, 1, 1);
+INSERT INTO SUBSELECT_TBL VALUES (2, 2, 2);
+INSERT INTO SUBSELECT_TBL VALUES (3, 3, 3);
+INSERT INTO SUBSELECT_TBL VALUES (6, 7, 8);
+INSERT INTO SUBSELECT_TBL VALUES (8, 9, NULL);
+SELECT * FROM SUBSELECT_TBL;
+-- Uncorrelated subselects
+SELECT f1 AS "Constant Select" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT 1);
+select 1 = all (select (select 1));
+--
+-- Test cases to catch unpleasant interactions between IN-join processing
+-- and subquery pullup.
+--
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+--
+-- Test cases to check for overenthusiastic optimization of
+-- "IN (SELECT DISTINCT ...)" and related cases. Per example from
+-- Luca Pireddu and Michael Fuhr.
+--
+CREATE TEMP TABLE foo (id integer);
+CREATE TEMP TABLE bar (id1 integer, id2 integer);
+INSERT INTO foo VALUES (1);
+INSERT INTO bar VALUES (1, 1);
+INSERT INTO bar VALUES (2, 2);
+INSERT INTO bar VALUES (3, 1);
+-- These cases require an extra level of distinct-ing above subquery s
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT id1, id2 FROM bar) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1,id2 FROM bar GROUP BY id1,id2) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1, id2 FROM bar UNION
+ SELECT id1, id2 FROM bar) AS s);
+-- These cases do not
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT ON (id2) id1, id2 FROM bar) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar GROUP BY id2) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar UNION
+ SELECT id2 FROM bar) AS s);
+--
+-- Test case to catch problems with multiply nested sub-SELECTs not getting
+-- recalculated properly. Per bug report from Didier Moens.
+--
+CREATE TABLE orderstest (
+ approver_ref integer,
+ po_ref integer,
+ ordercanceled boolean
+);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 5, false);
+INSERT INTO orderstest VALUES (66, 6, false);
+INSERT INTO orderstest VALUES (66, 7, false);
+INSERT INTO orderstest VALUES (66, 1, true);
+INSERT INTO orderstest VALUES (66, 8, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (77, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+--
+-- Test cases to catch situations where rule rewriter fails to propagate
+-- hasSubLinks flag correctly. Per example from Kyle Bateman.
+--
+create temp table parts (
+ partnum text,
+ cost float8
+);
+create temp table shipped (
+ ttype char(2),
+ ordnum int4,
+ partnum text,
+ value float8
+);
+insert into parts (partnum, cost) values (1, 1234.56);
+--
+-- Test cases involving PARAM_EXEC parameters and min/max index optimizations.
+-- Per bug report from David Sanchez i Gregori.
+--
+select * from (
+ select max(unique1) from tenk1 as a
+ where exists (select 1 from tenk1 as b where b.thousand = a.unique2)
+) ss;
+select * from (
+ select min(unique1) from tenk1 as a
+ where not exists (select 1 from tenk1 as b where b.unique2 = 10000)
+) ss;
+--
+-- Test that an IN implemented using a UniquePath does unique-ification
+-- with the right semantics, as per bug #4113. (Unfortunately we have
+-- no simple way to ensure that this test case actually chooses that type
+-- of plan, but it does in releases 7.4-8.3. Note that an ordering difference
+-- here might mean that some other plan type is being used, rendering the test
+-- pointless.)
+--
+create temp table numeric_table (num_col numeric);
+insert into numeric_table values (1), (1.000000000000000000001), (2), (3);
+create temp table float_table (float_col float8);
+insert into float_table values (1), (2), (3);
+select * from float_table
+ where float_col in (select num_col from numeric_table);
+--
+-- Test case for bug #4290: bogus calculation of subplan param sets
+--
+create temp table ta (id int primary key, val int);
+insert into ta values(1,1);
+insert into ta values(2,2);
+create temp table tb (id int primary key, aval int);
+insert into tb values(1,1);
+insert into tb values(2,1);
+insert into tb values(3,2);
+insert into tb values(4,2);
+create temp table tc (id int primary key, aid int);
+insert into tc values(1,1);
+insert into tc values(2,2);
+--
+-- Test case for 8.3 "failed to locate grouping columns" bug
+--
+create temp table t1 (f1 numeric(14,0), f2 varchar(30));
+select * from
+ (select distinct f1, f2, (select f2 from t1 x where x.f1 = up.f1) as fs
+ from t1 up) ss
+group by f1,f2,fs;
+--
+-- Test case for bug #5514 (mishandling of whole-row Vars in subselects)
+--
+create temp table table_a(id integer);
+insert into table_a values (42);
+--
+-- Test case for sublinks pulled up into joinaliasvars lists in an
+-- inherited update/delete query
+--
+begin; -- this shouldn't delete anything, but be safe
+rollback;
+--
+-- Test case for subselect within UPDATE of INSERT...ON CONFLICT DO UPDATE
+--
+create temp table upsert(key int4 primary key, val text);
+--
+-- Test case for cross-type partial matching in hashed subplan (bug #7597)
+--
+create temp table outer_7597 (f1 int4, f2 int4);
+insert into outer_7597 values (0, 0);
+insert into outer_7597 values (1, 0);
+insert into outer_7597 values (0, null);
+insert into outer_7597 values (1, null);
+create temp table inner_7597(c1 int8, c2 int8);
+insert into inner_7597 values(0, null);
+--
+-- Similar test case using text that verifies that collation
+-- information is passed through by execTuplesEqual() in nodeSubplan.c
+-- (otherwise it would error in texteq())
+--
+create temp table outer_text (f1 text, f2 text);
+insert into outer_text values ('a', 'a');
+insert into outer_text values ('b', 'a');
+insert into outer_text values ('a', null);
+insert into outer_text values ('b', null);
+create temp table inner_text (c1 text, c2 text);
+insert into inner_text values ('a', null);
+insert into inner_text values ('123', '456');
+begin;
+rollback; -- to get rid of the bogus operator
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+--
+-- Check we don't misoptimize a NOT IN where the subquery returns no rows.
+--
+create temp table notinouter (a int);
+create temp table notininner (b int not null);
+insert into notinouter values (null), (1);
+--
+-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
+--
+create temp table nocolumns();
+select exists(select * from nocolumns);
+--
+-- Test that LIMIT can be pushed to SORT through a subquery that just projects
+-- columns. We check for that having happened by looking to see if EXPLAIN
+-- ANALYZE shows that a top-N sort was used. We must suppress or filter away
+-- all the non-invariant parts of the EXPLAIN ANALYZE output.
+--
+create table sq_limit (pk int primary key, c1 int, c2 int);
+insert into sq_limit values
+ (1, 1, 1),
+ (2, 2, 2),
+ (3, 3, 3),
+ (4, 4, 4),
+ (5, 1, 1),
+ (6, 2, 2),
+ (7, 3, 3),
+ (8, 4, 4);
+select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3;
+drop table sq_limit;
+--
+-- Ensure that backward scan direction isn't propagated into
+-- expression subqueries (bug #15336)
+--
+begin;
+commit;
diff --git a/yql/essentials/tests/postgresql/cases/text.err b/yql/essentials/tests/postgresql/cases/text.err
new file mode 100644
index 0000000000..d41c3081bb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/text.err
@@ -0,0 +1,464 @@
+<sql-statement>
+--
+-- TEXT
+--
+SELECT text 'this is a text string' = text 'this is a text string' AS true;
+</sql-statement>
+<sql-statement>
+SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+</sql-statement>
+<sql-statement>
+CREATE TABLE TEXT_TBL (f1 text);
+</sql-statement>
+<sql-statement>
+INSERT INTO TEXT_TBL VALUES ('doh!');
+</sql-statement>
+<sql-statement>
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+</sql-statement>
+<sql-statement>
+SELECT * FROM TEXT_TBL;
+</sql-statement>
+<sql-statement>
+-- As of 8.3 we have removed most implicit casts to text, so that for example
+-- this no longer works:
+select length(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
+ -- As of 8.3 we have removed most implicit casts to text, so that for example
+ ^
+ -stdin-:<main>:3:8: Error: At function: PgCall
+ select length(42);
+ ^
+ -stdin-:<main>:3:8: Error: Unable to find an overload for proc length with given argument types: (int4)
+ select length(42);
+ ^
+<sql-statement>
+-- But as a special exception for usability's sake, we still allow implicit
+-- casting to text in concatenations, so long as the other input is text or
+-- an unknown literal. So these work:
+select 'four: '::text || 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
+ -- But as a special exception for usability's sake, we still allow implicit
+ ^
+ -stdin-:<main>:4:23: Error: At function: PgOp
+ select 'four: '::text || 2+2;
+ ^
+ -stdin-:<main>:4:23: Error: Unable to find an overload for operator || with given argument type(s): (text,int4)
+ select 'four: '::text || 2+2;
+ ^
+<sql-statement>
+select 'four: ' || 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 'four: ' || 2+2;
+ ^
+ -stdin-:<main>:1:17: Error: At function: PgOp
+ select 'four: ' || 2+2;
+ ^
+ -stdin-:<main>:1:17: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
+ select 'four: ' || 2+2;
+ ^
+<sql-statement>
+-- but not this:
+select 3 || 4.0;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- but not this:
+ ^
+ -stdin-:<main>:2:10: Error: At function: PgOp
+ select 3 || 4.0;
+ ^
+ -stdin-:<main>:2:10: Error: Unable to find an overload for operator || with given argument type(s): (int4,numeric)
+ select 3 || 4.0;
+ ^
+<sql-statement>
+/*
+ * various string functions
+ */
+select concat('one');
+</sql-statement>
+<sql-statement>
+select concat(1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+</sql-statement>
+<sql-statement>
+select concat_ws('#','one');
+</sql-statement>
+<sql-statement>
+select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+</sql-statement>
+<sql-statement>
+select concat_ws(',',10,20,null,30);
+</sql-statement>
+<sql-statement>
+select concat_ws('',10,20,null,30);
+</sql-statement>
+<sql-statement>
+select concat_ws(NULL,10,20,null,30) is null;
+</sql-statement>
+<sql-statement>
+select reverse('abcde');
+</sql-statement>
+<sql-statement>
+select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
+</sql-statement>
+<sql-statement>
+select quote_literal('');
+</sql-statement>
+<sql-statement>
+select quote_literal('abc''');
+</sql-statement>
+<sql-statement>
+select quote_literal(e'\\');
+</sql-statement>
+<sql-statement>
+-- check variadic labeled argument
+select concat(variadic array[1,2,3]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select concat(variadic array[1,2,3]);
+ ^
+<sql-statement>
+select concat_ws(',', variadic array[1,2,3]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select concat_ws(',', variadic array[1,2,3]);
+ ^
+<sql-statement>
+select concat_ws(',', variadic NULL::int[]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select concat_ws(',', variadic NULL::int[]);
+ ^
+<sql-statement>
+select concat(variadic NULL::int[]) is NULL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select concat(variadic NULL::int[]) is NULL;
+ ^
+<sql-statement>
+select concat(variadic '{}'::int[]) = '';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select concat(variadic '{}'::int[]) = '';
+ ^
+<sql-statement>
+--should fail
+select concat_ws(',', variadic 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select concat_ws(',', variadic 10);
+ ^
+<sql-statement>
+/*
+ * format
+ */
+select format(NULL);
+</sql-statement>
+<sql-statement>
+select format('Hello');
+</sql-statement>
+<sql-statement>
+select format('Hello %s', 'World');
+</sql-statement>
+<sql-statement>
+select format('Hello %%');
+</sql-statement>
+<sql-statement>
+select format('Hello %%%%');
+</sql-statement>
+<sql-statement>
+-- should fail
+select format('Hello %s %s', 'World');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: too few arguments for format()
+
+ -- should fail
+ ^
+<sql-statement>
+select format('Hello %s');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('Hello %s');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: too few arguments for format()
+
+ select format('Hello %s');
+ ^
+<sql-statement>
+select format('Hello %x', 20);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('Hello %x', 20);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unrecognized format() type specifier "x"
+HINT: For a single "%" use "%%".
+
+ select format('Hello %x', 20);
+ ^
+<sql-statement>
+-- check literal and sql identifiers
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, 'Hello');
+</sql-statement>
+<sql-statement>
+select format('%s%s%s','Hello', NULL,'World');
+</sql-statement>
+<sql-statement>
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, NULL);
+</sql-statement>
+<sql-statement>
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello');
+</sql-statement>
+<sql-statement>
+-- should fail, sql identifier cannot be NULL
+select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail, sql identifier cannot be NULL
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: null values cannot be formatted as an SQL identifier
+
+ -- should fail, sql identifier cannot be NULL
+ ^
+<sql-statement>
+-- check positional placeholders
+select format('%1$s %3$s', 1, 2, 3);
+</sql-statement>
+<sql-statement>
+select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+</sql-statement>
+<sql-statement>
+-- should fail
+select format('%1$s %4$s', 1, 2, 3);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: too few arguments for format()
+
+ -- should fail
+ ^
+<sql-statement>
+select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: too few arguments for format()
+
+ select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ ^
+<sql-statement>
+select format('%0$s', 'Hello');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('%0$s', 'Hello');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: format specifies argument 0, but arguments are numbered from 1
+
+ select format('%0$s', 'Hello');
+ ^
+<sql-statement>
+select format('%*0$s', 'Hello');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('%*0$s', 'Hello');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: format specifies argument 0, but arguments are numbered from 1
+
+ select format('%*0$s', 'Hello');
+ ^
+<sql-statement>
+select format('%1$', 1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('%1$', 1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+
+ select format('%1$', 1);
+ ^
+<sql-statement>
+select format('%1$1', 1);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ select format('%1$1', 1);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+
+ select format('%1$1', 1);
+ ^
+<sql-statement>
+-- check mix of positional and ordered placeholders
+select format('Hello %s %1$s %s', 'World', 'Hello again');
+</sql-statement>
+<sql-statement>
+select format('Hello %s %s, %2$s %2$s', 'World', 'Hello again');
+</sql-statement>
+<sql-statement>
+-- check variadic labeled arguments
+select format('%s, %s', variadic array['Hello','World']);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select format('%s, %s', variadic array['Hello','World']);
+ ^
+<sql-statement>
+select format('%s, %s', variadic array[1, 2]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select format('%s, %s', variadic array[1, 2]);
+ ^
+<sql-statement>
+select format('%s, %s', variadic array[true, false]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select format('%s, %s', variadic array[true, false]);
+ ^
+<sql-statement>
+select format('%s, %s', variadic array[true, false]::text[]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select format('%s, %s', variadic array[true, false]::text[]);
+ ^
+<sql-statement>
+-- check variadic with positional placeholders
+select format('%2$s, %1$s', variadic array['first', 'second']);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select format('%2$s, %1$s', variadic array['first', 'second']);
+ ^
+<sql-statement>
+select format('%2$s, %1$s', variadic array[1, 2]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: unsupported func_variadic
+ select format('%2$s, %1$s', variadic array[1, 2]);
+ ^
+<sql-statement>
+-- variadic argument can be array type NULL, but should not be referenced
+select format('Hello', variadic NULL::int[]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select format('Hello', variadic NULL::int[]);
+ ^
+<sql-statement>
+-- variadic argument allows simulating more than FUNC_MAX_ARGS parameters
+select format(string_agg('%s',','), variadic array_agg(i))
+from generate_series(1,200) g(i);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: FuncCall: unsupported func_variadic
+ select format(string_agg('%s',','), variadic array_agg(i))
+ ^
+<sql-statement>
+-- check field widths and left, right alignment
+select format('>>%10s<<', 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%10s<<', NULL);
+</sql-statement>
+<sql-statement>
+select format('>>%10s<<', '');
+</sql-statement>
+<sql-statement>
+select format('>>%-10s<<', '');
+</sql-statement>
+<sql-statement>
+select format('>>%-10s<<', 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%-10s<<', NULL);
+</sql-statement>
+<sql-statement>
+select format('>>%1$10s<<', 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%1$-10I<<', 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%2$*1$L<<', 10, 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%2$*1$L<<', 10, NULL);
+</sql-statement>
+<sql-statement>
+select format('>>%2$*1$L<<', -10, NULL);
+</sql-statement>
+<sql-statement>
+select format('>>%*s<<', 10, 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%*1$s<<', 10, 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%-s<<', 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%10L<<', NULL);
+</sql-statement>
+<sql-statement>
+select format('>>%2$*1$L<<', NULL, 'Hello');
+</sql-statement>
+<sql-statement>
+select format('>>%2$*1$L<<', 0, 'Hello');
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/text.out b/yql/essentials/tests/postgresql/cases/text.out
new file mode 100644
index 0000000000..86196b7f59
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/text.out
@@ -0,0 +1,311 @@
+--
+-- TEXT
+--
+SELECT text 'this is a text string' = text 'this is a text string' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+ false
+-------
+ f
+(1 row)
+
+CREATE TABLE TEXT_TBL (f1 text);
+INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+SELECT * FROM TEXT_TBL;
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+/*
+ * various string functions
+ */
+select concat('one');
+ concat
+--------
+ one
+(1 row)
+
+select concat_ws('#','one');
+ concat_ws
+-----------
+ one
+(1 row)
+
+select concat_ws(',',10,20,null,30);
+ concat_ws
+-----------
+ 10,20,30
+(1 row)
+
+select concat_ws('',10,20,null,30);
+ concat_ws
+-----------
+ 102030
+(1 row)
+
+select concat_ws(NULL,10,20,null,30) is null;
+ ?column?
+----------
+ t
+(1 row)
+
+select reverse('abcde');
+ reverse
+---------
+ edcba
+(1 row)
+
+select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
+ i | left | right
+----+------+-------
+ -5 | |
+ -4 | |
+ -3 | a | j
+ -2 | ah | oj
+ -1 | aho | hoj
+ 0 | |
+ 1 | a | j
+ 2 | ah | oj
+ 3 | aho | hoj
+ 4 | ahoj | ahoj
+ 5 | ahoj | ahoj
+(11 rows)
+
+select quote_literal('');
+ quote_literal
+---------------
+ ''
+(1 row)
+
+select quote_literal('abc''');
+ quote_literal
+---------------
+ 'abc'''
+(1 row)
+
+select quote_literal(e'\\');
+ quote_literal
+---------------
+ E'\\'
+(1 row)
+
+/*
+ * format
+ */
+select format(NULL);
+ format
+--------
+
+(1 row)
+
+select format('Hello');
+ format
+--------
+ Hello
+(1 row)
+
+select format('Hello %s', 'World');
+ format
+-------------
+ Hello World
+(1 row)
+
+select format('Hello %%');
+ format
+---------
+ Hello %
+(1 row)
+
+select format('Hello %%%%');
+ format
+----------
+ Hello %%
+(1 row)
+
+-- should fail
+select format('Hello %s %s', 'World');
+ERROR: too few arguments for format()
+select format('Hello %s');
+ERROR: too few arguments for format()
+select format('Hello %x', 20);
+ERROR: unrecognized format() type specifier "x"
+HINT: For a single "%" use "%%".
+-- check literal and sql identifiers
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, 'Hello');
+ format
+----------------------------------------
+ INSERT INTO mytab VALUES('10','Hello')
+(1 row)
+
+select format('%s%s%s','Hello', NULL,'World');
+ format
+------------
+ HelloWorld
+(1 row)
+
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, NULL);
+ format
+-------------------------------------
+ INSERT INTO mytab VALUES('10',NULL)
+(1 row)
+
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello');
+ format
+----------------------------------------
+ INSERT INTO mytab VALUES(NULL,'Hello')
+(1 row)
+
+-- should fail, sql identifier cannot be NULL
+select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello');
+ERROR: null values cannot be formatted as an SQL identifier
+-- check positional placeholders
+select format('%1$s %3$s', 1, 2, 3);
+ format
+--------
+ 1 3
+(1 row)
+
+select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ format
+--------
+ 1 12
+(1 row)
+
+-- should fail
+select format('%1$s %4$s', 1, 2, 3);
+ERROR: too few arguments for format()
+select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ERROR: too few arguments for format()
+select format('%0$s', 'Hello');
+ERROR: format specifies argument 0, but arguments are numbered from 1
+select format('%*0$s', 'Hello');
+ERROR: format specifies argument 0, but arguments are numbered from 1
+select format('%1$', 1);
+ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+select format('%1$1', 1);
+ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+-- check mix of positional and ordered placeholders
+select format('Hello %s %1$s %s', 'World', 'Hello again');
+ format
+-------------------------------
+ Hello World World Hello again
+(1 row)
+
+select format('Hello %s %s, %2$s %2$s', 'World', 'Hello again');
+ format
+--------------------------------------------------
+ Hello World Hello again, Hello again Hello again
+(1 row)
+
+-- check field widths and left, right alignment
+select format('>>%10s<<', 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%10s<<', NULL);
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%10s<<', '');
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%-10s<<', '');
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%-10s<<', 'Hello');
+ format
+----------------
+ >>Hello <<
+(1 row)
+
+select format('>>%-10s<<', NULL);
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%1$10s<<', 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%1$-10I<<', 'Hello');
+ format
+----------------
+ >>"Hello" <<
+(1 row)
+
+select format('>>%2$*1$L<<', 10, 'Hello');
+ format
+----------------
+ >> 'Hello'<<
+(1 row)
+
+select format('>>%2$*1$L<<', 10, NULL);
+ format
+----------------
+ >> NULL<<
+(1 row)
+
+select format('>>%2$*1$L<<', -10, NULL);
+ format
+----------------
+ >>NULL <<
+(1 row)
+
+select format('>>%*s<<', 10, 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%*1$s<<', 10, 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%-s<<', 'Hello');
+ format
+-----------
+ >>Hello<<
+(1 row)
+
+select format('>>%10L<<', NULL);
+ format
+----------------
+ >> NULL<<
+(1 row)
+
+select format('>>%2$*1$L<<', NULL, 'Hello');
+ format
+-------------
+ >>'Hello'<<
+(1 row)
+
+select format('>>%2$*1$L<<', 0, 'Hello');
+ format
+-------------
+ >>'Hello'<<
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/text.sql b/yql/essentials/tests/postgresql/cases/text.sql
new file mode 100644
index 0000000000..2538e33c8a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/text.sql
@@ -0,0 +1,72 @@
+--
+-- TEXT
+--
+SELECT text 'this is a text string' = text 'this is a text string' AS true;
+SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+CREATE TABLE TEXT_TBL (f1 text);
+INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+SELECT * FROM TEXT_TBL;
+/*
+ * various string functions
+ */
+select concat('one');
+select concat_ws('#','one');
+select concat_ws(',',10,20,null,30);
+select concat_ws('',10,20,null,30);
+select concat_ws(NULL,10,20,null,30) is null;
+select reverse('abcde');
+select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
+select quote_literal('');
+select quote_literal('abc''');
+select quote_literal(e'\\');
+/*
+ * format
+ */
+select format(NULL);
+select format('Hello');
+select format('Hello %s', 'World');
+select format('Hello %%');
+select format('Hello %%%%');
+-- should fail
+select format('Hello %s %s', 'World');
+select format('Hello %s');
+select format('Hello %x', 20);
+-- check literal and sql identifiers
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, 'Hello');
+select format('%s%s%s','Hello', NULL,'World');
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, NULL);
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello');
+-- should fail, sql identifier cannot be NULL
+select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello');
+-- check positional placeholders
+select format('%1$s %3$s', 1, 2, 3);
+select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+-- should fail
+select format('%1$s %4$s', 1, 2, 3);
+select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+select format('%0$s', 'Hello');
+select format('%*0$s', 'Hello');
+select format('%1$', 1);
+select format('%1$1', 1);
+-- check mix of positional and ordered placeholders
+select format('Hello %s %1$s %s', 'World', 'Hello again');
+select format('Hello %s %s, %2$s %2$s', 'World', 'Hello again');
+-- check field widths and left, right alignment
+select format('>>%10s<<', 'Hello');
+select format('>>%10s<<', NULL);
+select format('>>%10s<<', '');
+select format('>>%-10s<<', '');
+select format('>>%-10s<<', 'Hello');
+select format('>>%-10s<<', NULL);
+select format('>>%1$10s<<', 'Hello');
+select format('>>%1$-10I<<', 'Hello');
+select format('>>%2$*1$L<<', 10, 'Hello');
+select format('>>%2$*1$L<<', 10, NULL);
+select format('>>%2$*1$L<<', -10, NULL);
+select format('>>%*s<<', 10, 'Hello');
+select format('>>%*1$s<<', 10, 'Hello');
+select format('>>%-s<<', 'Hello');
+select format('>>%10L<<', NULL);
+select format('>>%2$*1$L<<', NULL, 'Hello');
+select format('>>%2$*1$L<<', 0, 'Hello');
diff --git a/yql/essentials/tests/postgresql/cases/time.err b/yql/essentials/tests/postgresql/cases/time.err
new file mode 100644
index 0000000000..65c77502de
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/time.err
@@ -0,0 +1,244 @@
+<sql-statement>
+--
+-- TIME
+--
+CREATE TABLE TIME_TBL (f1 time(2));
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('00:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('01:00');
+</sql-statement>
+<sql-statement>
+-- as of 7.4, timezone spec should be accepted and ignored
+INSERT INTO TIME_TBL VALUES ('02:03 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- as of 7.4, timezone spec should be accepted and ignored
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time: "02:03 PST"
+
+ -- as of 7.4, timezone spec should be accepted and ignored
+ ^
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time: "11:59 EDT"
+
+ INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+ ^
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('12:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('12:01');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('23:59');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+ ^
+<sql-statement>
+INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+ ^
+<sql-statement>
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- this should fail (the timezone offset is not known)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ -- this should fail (the timezone offset is not known)
+ ^
+<sql-statement>
+SELECT f1 AS "Time" FROM TIME_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
+</sql-statement>
+<sql-statement>
+-- Check edge cases
+SELECT '23:59:59.999999'::time;
+</sql-statement>
+<sql-statement>
+SELECT '23:59:59.9999999'::time; -- rounds up
+</sql-statement>
+<sql-statement>
+SELECT '23:59:60'::time; -- rounds up
+</sql-statement>
+<sql-statement>
+SELECT '24:00:00'::time; -- allowed
+</sql-statement>
+<sql-statement>
+SELECT '24:00:00.01'::time; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '24:00:00.01'::time; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "24:00:00.01"
+
+ SELECT '24:00:00.01'::time; -- not allowed
+ ^
+<sql-statement>
+SELECT '23:59:60.01'::time; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '23:59:60.01'::time; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "23:59:60.01"
+
+ SELECT '23:59:60.01'::time; -- not allowed
+ ^
+<sql-statement>
+SELECT '24:01:00'::time; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '24:01:00'::time; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "24:01:00"
+
+ SELECT '24:01:00'::time; -- not allowed
+ ^
+<sql-statement>
+SELECT '25:00:00'::time; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '25:00:00'::time; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "25:00:00"
+
+ SELECT '25:00:00'::time; -- not allowed
+ ^
+<sql-statement>
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLISECOND FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(SECOND FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MINUTE FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(HOUR FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "time" units "day" not recognized
+
+ SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "time" units "fortnight" not recognized
+
+ SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "time" units "timezone" not recognized
+
+ SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(EPOCH FROM TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT date_part('millisecond', TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT date_part('second', TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
+<sql-statement>
+SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401');
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/time.out b/yql/essentials/tests/postgresql/cases/time.out
new file mode 100644
index 0000000000..5c5d511cfd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/time.out
@@ -0,0 +1,127 @@
+--
+-- TIME
+--
+CREATE TABLE TIME_TBL (f1 time(2));
+INSERT INTO TIME_TBL VALUES ('00:00');
+INSERT INTO TIME_TBL VALUES ('01:00');
+INSERT INTO TIME_TBL VALUES ('12:00');
+INSERT INTO TIME_TBL VALUES ('12:01');
+INSERT INTO TIME_TBL VALUES ('23:59');
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
+ None
+------
+(0 rows)
+
+-- Check edge cases
+SELECT '23:59:59.999999'::time;
+ time
+-----------------
+ 23:59:59.999999
+(1 row)
+
+SELECT '23:59:59.9999999'::time; -- rounds up
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '23:59:60'::time; -- rounds up
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '24:00:00'::time; -- allowed
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '24:00:00.01'::time; -- not allowed
+ERROR: date/time field value out of range: "24:00:00.01"
+LINE 1: SELECT '24:00:00.01'::time;
+ ^
+SELECT '23:59:60.01'::time; -- not allowed
+ERROR: date/time field value out of range: "23:59:60.01"
+LINE 1: SELECT '23:59:60.01'::time;
+ ^
+SELECT '24:01:00'::time; -- not allowed
+ERROR: date/time field value out of range: "24:01:00"
+LINE 1: SELECT '24:01:00'::time;
+ ^
+SELECT '25:00:00'::time; -- not allowed
+ERROR: date/time field value out of range: "25:00:00"
+LINE 1: SELECT '25:00:00'::time;
+ ^
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+----------
+ 25575401
+(1 row)
+
+SELECT EXTRACT(MILLISECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+-----------
+ 25575.401
+(1 row)
+
+SELECT EXTRACT(SECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+-----------
+ 25.575401
+(1 row)
+
+SELECT EXTRACT(MINUTE FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+---------
+ 30
+(1 row)
+
+SELECT EXTRACT(HOUR FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+---------
+ 13
+(1 row)
+
+SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "day" not recognized
+SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "timezone" not recognized
+SELECT EXTRACT(EPOCH FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+--------------
+ 48625.575401
+(1 row)
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25575401
+(1 row)
+
+SELECT date_part('millisecond', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25575.401
+(1 row)
+
+SELECT date_part('second', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25.575401
+(1 row)
+
+SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401');
+ date_part
+--------------
+ 48625.575401
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/time.sql b/yql/essentials/tests/postgresql/cases/time.sql
new file mode 100644
index 0000000000..73e96064f1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/time.sql
@@ -0,0 +1,38 @@
+--
+-- TIME
+--
+CREATE TABLE TIME_TBL (f1 time(2));
+INSERT INTO TIME_TBL VALUES ('00:00');
+INSERT INTO TIME_TBL VALUES ('01:00');
+INSERT INTO TIME_TBL VALUES ('12:00');
+INSERT INTO TIME_TBL VALUES ('12:01');
+INSERT INTO TIME_TBL VALUES ('23:59');
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
+-- Check edge cases
+SELECT '23:59:59.999999'::time;
+SELECT '23:59:59.9999999'::time; -- rounds up
+SELECT '23:59:60'::time; -- rounds up
+SELECT '24:00:00'::time; -- allowed
+SELECT '24:00:00.01'::time; -- not allowed
+SELECT '23:59:60.01'::time; -- not allowed
+SELECT '24:01:00'::time; -- not allowed
+SELECT '25:00:00'::time; -- not allowed
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(MILLISECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(SECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(MINUTE FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(HOUR FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(EPOCH FROM TIME '2020-05-26 13:30:25.575401');
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('millisecond', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('second', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401');
diff --git a/yql/essentials/tests/postgresql/cases/timestamp.err b/yql/essentials/tests/postgresql/cases/timestamp.err
new file mode 100644
index 0000000000..c765dc20ec
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamp.err
@@ -0,0 +1,895 @@
+<sql-statement>
+--
+-- TIMESTAMP
+--
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+</sql-statement>
+<sql-statement>
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('today');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
+</sql-statement>
+<sql-statement>
+-- time zone should be ignored by this data type
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow EST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- time zone should be ignored by this data type
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "tomorrow EST"
+
+ -- time zone should be ignored by this data type
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow zulu');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow zulu');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "tomorrow zulu"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow zulu');
+ ^
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'today';
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS Three FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'tomorrow';
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'yesterday';
+</sql-statement>
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+DELETE FROM TIMESTAMP_TBL;
+</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>
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
+</sql-statement>
+<sql-statement>
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+TRUNCATE TIMESTAMP_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TIMESTAMP_TBL;
+ ^
+<sql-statement>
+-- Special values
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+</sql-statement>
+<sql-statement>
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Postgres v6.0 standard output format
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01 1997 PST"
+
+ -- Postgres v6.0 standard output format
+ ^
+<sql-statement>
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Variations on Postgres v6.1 standard output format
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01.000001 1997 PST"
+
+ -- Variations on Postgres v6.1 standard output format
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01.999999 1997 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01.4 1997 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01.5 1997 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Mon Feb 10 17:32:01.6 1997 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+ ^
+<sql-statement>
+-- ISO 8601 format
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+</sql-statement>
+<sql-statement>
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+</sql-statement>
+<sql-statement>
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "1997-02-10 17:32:01 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "Feb-10-1997 17:32:01 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "02-10-1997 17:32:01 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "19970210 173201 PST"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+ ^
+<sql-statement>
+set datestyle to ymd;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "97FEB10 5:32:01PM UTC"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "97/02/10 17:32:01 UTC"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+ ^
+<sql-statement>
+reset datestyle;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "1997.041 17:32:01 UTC"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+ ^
+<sql-statement>
+-- this fails (even though TZ is a no-op, we still look it up)
+INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/Does_not_exist');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- this fails (even though TZ is a no-op, we still look it up)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/does_not_exist" not recognized
+
+ -- this fails (even though TZ is a no-op, we still look it up)
+ ^
+<sql-statement>
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 18:32:01 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Check date conversion and date arithmetic
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp: "1997-06-10 18:32:01 PDT"
+
+ -- Check date conversion and date arithmetic
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+</sql-statement>
+<sql-statement>
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Currently unsupported syntax and ranges
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+
+ -- Currently unsupported syntax and ranges
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+
+ INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ ^
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00 BC'::timestamp;
+</sql-statement>
+<sql-statement>
+SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "4714-11-23 23:59:59 BC"
+
+ SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+ ^
+<sql-statement>
+SELECT '294276-12-31 23:59:59'::timestamp;
+</sql-statement>
+<sql-statement>
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "294277-01-01 00:00:00"
+
+ SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+ ^
+<sql-statement>
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 > timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 < timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 = timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 != timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 <= timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 >= timestamp without time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+</sql-statement>
+<sql-statement>
+SELECT date_trunc( 'week', timestamp '2004-02-29 15:44:17.71393' ) AS week_trunc;
+</sql-statement>
+<sql-statement>
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+-- case 1: AD dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2001-01-01') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+</sql-statement>
+<sql-statement>
+-- case 2: BC dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2000-01-01 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+</sql-statement>
+<sql-statement>
+-- case 3: AD dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2020-03-02') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+</sql-statement>
+<sql-statement>
+-- case 4: BC dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '0055-06-17 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+</sql-statement>
+<sql-statement>
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamp '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamp '2001-01-01')) origin (origin);
+</sql-statement>
+<sql-statement>
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamp '2020-02-01 01:01:01', timestamp '2020-02-01 00:02:30');
+</sql-statement>
+<sql-statement>
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow intervals with months or years
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamps cannot be binned into intervals containing months or years
+
+ -- disallow intervals with months or years
+ ^
+<sql-statement>
+SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamps cannot be binned into intervals containing months or years
+
+ SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ ^
+<sql-statement>
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow zero intervals
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stride must be greater than zero
+
+ -- disallow zero intervals
+ ^
+<sql-statement>
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow negative intervals
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stride must be greater than zero
+
+ -- disallow negative intervals
+ ^
+<sql-statement>
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN timestamp without time zone '1902-01-01'
+ AND timestamp without time zone '2038-01-01';
+</sql-statement>
+<sql-statement>
+-- DATE_PART (timestamp_part)
+SELECT d1 as "timestamp",
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as "timestamp",
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as "timestamp",
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as "timestamp",
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
+</sql-statement>
+<sql-statement>
+SELECT extract(epoch from '294270-01-01 00:00:00'::timestamp);
+</sql-statement>
+<sql-statement>
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00'::timestamp);
+</sql-statement>
+<sql-statement>
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMP_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamp),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+</sql-statement>
+<sql-statement>
+-- Roman months, with upper and lower case.
+SELECT i,
+ to_char(i * interval '1mon', 'rm'),
+ to_char(i * interval '1mon', 'RM')
+ FROM generate_series(-13, 13) i;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Roman months, with upper and lower case.
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: to_char
+ -- Roman months, with upper and lower case.
+ ^
+<sql-statement>
+-- timestamp numeric fields constructor
+SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887);
+</sql-statement>
+<sql-statement>
+SELECT make_timestamp(-44, 3, 15, 12, 30, 15);
+</sql-statement>
+<sql-statement>
+-- should fail
+select make_timestamp(0, 7, 15, 12, 30, 15);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date field value out of range: 0-07-15
+
+ -- should fail
+ ^
+<sql-statement>
+-- generate_series for timestamp
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '1 hour'::interval);
+</sql-statement>
+<sql-statement>
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamp,
+ 'infinity'::timestamp,
+ '1 month'::interval) limit 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:8: Error: Generator functions are not allowed in: SELECT
+ select generate_series('2022-01-01 00:00'::timestamp,
+ ^
+<sql-statement>
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '0 hour'::interval);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot equal zero
+
+ -- errors
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/timestamp.out b/yql/essentials/tests/postgresql/cases/timestamp.out
new file mode 100644
index 0000000000..91cbd881bf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamp.out
@@ -0,0 +1,296 @@
+--
+-- TIMESTAMP
+--
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('today');
+INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'today';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'yesterday';
+ one
+-----
+ 1
+(1 row)
+
+COMMIT;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+COMMIT;
+-- Special values
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+-- ISO 8601 format
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+set datestyle to ymd;
+reset datestyle;
+-- this fails (even though TZ is a no-op, we still look it up)
+INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ERROR: time zone "america/does_not_exist" not recognized
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/D...
+ ^
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+ ^
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC')...
+ ^
+SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+ERROR: timestamp out of range: "4714-11-23 23:59:59 BC"
+LINE 1: SELECT '4714-11-23 23:59:59 BC'::timestamp;
+ ^
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00"
+LINE 1: SELECT '294277-01-01 00:00:00'::timestamp;
+ ^
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+-- case 1: AD dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2001-01-01') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 2: BC dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2000-01-01 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 3: AD dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2020-03-02') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 4: BC dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '0055-06-17 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ERROR: timestamps cannot be binned into intervals containing months or years
+SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ERROR: timestamps cannot be binned into intervals containing months or years
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+ERROR: stride must be greater than zero
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+ERROR: stride must be greater than zero
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
+ date_part
+---------------
+ 9224097091200
+(1 row)
+
+SELECT extract(epoch from '294270-01-01 00:00:00'::timestamp);
+ extract
+----------------------
+ 9224097091200.000000
+(1 row)
+
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00'::timestamp);
+ extract
+--------------------
+ 95617584000.000000
+(1 row)
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamp),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+ to_char
+--------------------------------------------------------------------
+ 0 00 000 0000 00000 000000 0 00 000 0000 00000 000000 000 000000
+ 7 78 780 7800 78000 780000 7 78 780 7800 78000 780000 780 780000
+ 7 78 789 7890 78901 789010 7 78 789 7890 78901 789010 789 789010
+ 7 78 789 7890 78901 789012 7 78 789 7890 78901 789012 789 789012
+(4 rows)
+
+-- should fail
+select make_timestamp(0, 7, 15, 12, 30, 15);
+ERROR: date field value out of range: 0-07-15
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '0 hour'::interval);
+ERROR: step size cannot equal zero
diff --git a/yql/essentials/tests/postgresql/cases/timestamp.sql b/yql/essentials/tests/postgresql/cases/timestamp.sql
new file mode 100644
index 0000000000..34a7c39c25
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamp.sql
@@ -0,0 +1,180 @@
+--
+-- TIMESTAMP
+--
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('today');
+INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'today';
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'yesterday';
+COMMIT;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+COMMIT;
+-- Special values
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+-- ISO 8601 format
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+set datestyle to ymd;
+reset datestyle;
+-- this fails (even though TZ is a no-op, we still look it up)
+INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/Does_not_exist');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+-- case 1: AD dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2001-01-01') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+-- case 2: BC dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2000-01-01 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+-- case 3: AD dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2020-03-02') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+-- case 4: BC dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '0055-06-17 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
+SELECT extract(epoch from '294270-01-01 00:00:00'::timestamp);
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00'::timestamp);
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamp),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+-- should fail
+select make_timestamp(0, 7, 15, 12, 30, 15);
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '0 hour'::interval);
diff --git a/yql/essentials/tests/postgresql/cases/timestamptz.err b/yql/essentials/tests/postgresql/cases/timestamptz.err
new file mode 100644
index 0000000000..26d02e3364
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamptz.err
@@ -0,0 +1,2525 @@
+<sql-statement>
+--
+-- TIMESTAMPTZ
+--
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+</sql-statement>
+<sql-statement>
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow EST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow EST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "tomorrow EST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow EST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow zulu');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow zulu');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "tomorrow zulu"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow zulu');
+ ^
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'today';
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow';
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'yesterday';
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow EST';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow EST';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "tomorrow EST"
+
+ SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow EST';
+ ^
+<sql-statement>
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow zulu';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow zulu';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "tomorrow zulu"
+
+ SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow zulu';
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+DELETE FROM TIMESTAMPTZ_TBL;
+</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>
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+</sql-statement>
+<sql-statement>
+SELECT pg_sleep(0.1);
+</sql-statement>
+<sql-statement>
+SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
+</sql-statement>
+<sql-statement>
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+TRUNCATE TIMESTAMPTZ_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TIMESTAMPTZ_TBL;
+ ^
+<sql-statement>
+-- Special values
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+</sql-statement>
+<sql-statement>
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Postgres v6.0 standard output format
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01 1997 PST"
+
+ -- Postgres v6.0 standard output format
+ ^
+<sql-statement>
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Variations on Postgres v6.1 standard output format
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01.000001 1997 PST"
+
+ -- Variations on Postgres v6.1 standard output format
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01.999999 1997 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01.4 1997 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01.5 1997 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Mon Feb 10 17:32:01.6 1997 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+ ^
+<sql-statement>
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+</sql-statement>
+<sql-statement>
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+</sql-statement>
+<sql-statement>
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "1997-02-10 17:32:01 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Feb-10-1997 17:32:01 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "02-10-1997 17:32:01 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "19970210 173201 PST"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+ ^
+<sql-statement>
+set datestyle to ymd;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "97FEB10 5:32:01PM UTC"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "97/02/10 17:32:01 UTC"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+ ^
+<sql-statement>
+reset datestyle;
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "1997.041 17:32:01 UTC"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+ ^
+<sql-statement>
+-- timestamps at different timezones
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- timestamps at different timezones
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ -- timestamps at different timezones
+ ^
+<sql-statement>
+SELECT '19970210 173201' AT TIME ZONE 'America/New_York';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '19970210 173201' AT TIME ZONE 'America/New_York';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "America/New_York" not recognized
+
+ SELECT '19970210 173201' AT TIME ZONE 'America/New_York';
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+ ^
+<sql-statement>
+SELECT '19970710 173201' AT TIME ZONE 'America/New_York';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '19970710 173201' AT TIME ZONE 'America/New_York';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "America/New_York" not recognized
+
+ SELECT '19970710 173201' AT TIME ZONE 'America/New_York';
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/does_not_exist" not recognized
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ ^
+<sql-statement>
+SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "America/Does_not_exist" not recognized
+
+ SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+ ^
+<sql-statement>
+-- Daylight saving time for timestamps beyond 32-bit time_t range.
+SELECT '20500710 173201 Europe/Helsinki'::timestamptz; -- DST
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Daylight saving time for timestamps beyond 32-bit time_t range.
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/helsinki" not recognized
+
+ -- Daylight saving time for timestamps beyond 32-bit time_t range.
+ ^
+<sql-statement>
+SELECT '20500110 173201 Europe/Helsinki'::timestamptz; -- non-DST
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '20500110 173201 Europe/Helsinki'::timestamptz; -- non-DST
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/helsinki" not recognized
+
+ SELECT '20500110 173201 Europe/Helsinki'::timestamptz; -- non-DST
+ ^
+<sql-statement>
+SELECT '205000-07-10 17:32:01 Europe/Helsinki'::timestamptz; -- DST
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '205000-07-10 17:32:01 Europe/Helsinki'::timestamptz; -- DST
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/helsinki" not recognized
+
+ SELECT '205000-07-10 17:32:01 Europe/Helsinki'::timestamptz; -- DST
+ ^
+<sql-statement>
+SELECT '205000-01-10 17:32:01 Europe/Helsinki'::timestamptz; -- non-DST
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '205000-01-10 17:32:01 Europe/Helsinki'::timestamptz; -- non-DST
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/helsinki" not recognized
+
+ SELECT '205000-01-10 17:32:01 Europe/Helsinki'::timestamptz; -- non-DST
+ ^
+<sql-statement>
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 18:32:01 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Check date conversion and date arithmetic
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "1997-06-10 18:32:01 PDT"
+
+ -- Check date conversion and date arithmetic
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+</sql-statement>
+<sql-statement>
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Currently unsupported syntax and ranges
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+
+ -- Currently unsupported syntax and ranges
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+
+ INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ ^
+<sql-statement>
+-- Alternative field order that we've historically supported (sort of)
+-- with regular and POSIXy timezone specs
+SELECT 'Wed Jul 11 10:51:14 America/New_York 2001'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Alternative field order that we've historically supported (sort of)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ -- Alternative field order that we've historically supported (sort of)
+ ^
+<sql-statement>
+SELECT 'Wed Jul 11 10:51:14 GMT-4 2001'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT 'Wed Jul 11 10:51:14 GMT+4 2001'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT 'Wed Jul 11 10:51:14 PST-03:00 2001'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT 'Wed Jul 11 10:51:14 PST+03:00 2001'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00+00 BC'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT '4714-11-23 16:00:00-08 BC'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Sun Nov 23 16:00:00 4714 PST BC"
+
+ SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "4714-11-23 23:59:59+00 BC"
+
+ SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+ ^
+<sql-statement>
+SELECT '294276-12-31 23:59:59+00'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT '294276-12-31 15:59:59-08'::timestamptz;
+</sql-statement>
+<sql-statement>
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "294277-01-01 00:00:00+00"
+
+ SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+ ^
+<sql-statement>
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp out of range: "294277-12-31 16:00:00-08"
+
+ SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+ ^
+<sql-statement>
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 > timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 < timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 = timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 != timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 <= timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 >= timestamp with time zone '1997-01-02';
+</sql-statement>
+<sql-statement>
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+</sql-statement>
+<sql-statement>
+SELECT date_trunc( 'week', timestamp with time zone '2004-02-29 15:44:17.71393' ) AS week_trunc;
+</sql-statement>
+<sql-statement>
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'Australia/Sydney') as sydney_trunc; -- zone name
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'Australia/Sydney') as sydney_trunc; -- zone name
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Australia/Sydney" not recognized
+
+ SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'Australia/Sydney') as sydney_trunc; -- zone name
+ ^
+<sql-statement>
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'GMT') as gmt_trunc; -- fixed-offset abbreviation
+</sql-statement>
+<sql-statement>
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'VET') as vet_trunc; -- variable-offset abbreviation
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'VET') as vet_trunc; -- variable-offset abbreviation
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "VET" not recognized
+
+ SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'VET') as vet_trunc; -- variable-offset abbreviation
+ ^
+<sql-statement>
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts, 'Australia/Sydney') = date_bin(interval::interval, ts, timestamp with time zone '2001-01-01+11') AS equal
+FROM (
+ VALUES
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamptz '2020-02-29 15:44:17.71393+00')) ts (ts);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- verify date_bin behaves the same as date_trunc for relevant intervals
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Australia/Sydney" not recognized
+
+ -- verify date_bin behaves the same as date_trunc for relevant intervals
+ ^
+<sql-statement>
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamptz '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamptz '2001-01-01')) origin (origin);
+</sql-statement>
+<sql-statement>
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamptz '2020-02-01 01:01:01+00', timestamptz '2020-02-01 00:02:30+00');
+</sql-statement>
+<sql-statement>
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow intervals with months or years
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamps cannot be binned into intervals containing months or years
+
+ -- disallow intervals with months or years
+ ^
+<sql-statement>
+SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamps cannot be binned into intervals containing months or years
+
+ SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ ^
+<sql-statement>
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow zero intervals
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stride must be greater than zero
+
+ -- disallow zero intervals
+ ^
+<sql-statement>
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- disallow negative intervals
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: stride must be greater than zero
+
+ -- disallow negative intervals
+ ^
+<sql-statement>
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL
+ WHERE d1 BETWEEN timestamp with time zone '1902-01-01' AND timestamp with time zone '2038-01-01';
+</sql-statement>
+<sql-statement>
+-- DATE_PART (timestamptz_part)
+SELECT d1 as timestamptz,
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as timestamptz,
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as timestamptz,
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as timestamptz,
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT d1 as timestamptz,
+ date_part( 'timezone', d1) AS timezone,
+ date_part( 'timezone_hour', d1) AS timezone_hour,
+ date_part( 'timezone_minute', d1) AS timezone_minute
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
+</sql-statement>
+<sql-statement>
+SELECT extract(epoch from '294270-01-01 00:00:00+00'::timestamptz);
+</sql-statement>
+<sql-statement>
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00+00'::timestamptz);
+</sql-statement>
+<sql-statement>
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMPTZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamptz),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+</sql-statement>
+<sql-statement>
+-- Check OF, TZH, TZM with various zone offsets, particularly fractional hours
+SET timezone = '00:00';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '+02:00';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '-13:00';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '-00:30';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '00:30';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '-04:30';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '04:30';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '-04:15';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+SET timezone = '04:15';
+</sql-statement>
+<sql-statement>
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+</sql-statement>
+<sql-statement>
+RESET timezone;
+</sql-statement>
+<sql-statement>
+CREATE TABLE TIMESTAMPTZ_TST (a int , b timestamptz);
+</sql-statement>
+<sql-statement>
+-- Test year field value with len > 4
+INSERT INTO TIMESTAMPTZ_TST VALUES(1, 'Sat Mar 12 23:58:48 1000 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- Test year field value with len > 4
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Sat Mar 12 23:58:48 1000 IST"
+
+ -- Test year field value with len > 4
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TST VALUES(2, 'Sat Mar 12 23:58:48 10000 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TST VALUES(2, 'Sat Mar 12 23:58:48 10000 IST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Sat Mar 12 23:58:48 10000 IST"
+
+ INSERT INTO TIMESTAMPTZ_TST VALUES(2, 'Sat Mar 12 23:58:48 10000 IST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, 'Sat Mar 12 23:58:48 100000 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TST VALUES(3, 'Sat Mar 12 23:58:48 100000 IST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "Sat Mar 12 23:58:48 100000 IST"
+
+ INSERT INTO TIMESTAMPTZ_TST VALUES(3, 'Sat Mar 12 23:58:48 100000 IST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, '10000 Mar 12 23:58:48 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TST VALUES(3, '10000 Mar 12 23:58:48 IST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "10000 Mar 12 23:58:48 IST"
+
+ INSERT INTO TIMESTAMPTZ_TST VALUES(3, '10000 Mar 12 23:58:48 IST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '100000312 23:58:48 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TST VALUES(4, '100000312 23:58:48 IST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "100000312 23:58:48 IST"
+
+ INSERT INTO TIMESTAMPTZ_TST VALUES(4, '100000312 23:58:48 IST');
+ ^
+<sql-statement>
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '1000000312 23:58:48 IST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMESTAMPTZ_TST VALUES(4, '1000000312 23:58:48 IST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "1000000312 23:58:48 IST"
+
+ INSERT INTO TIMESTAMPTZ_TST VALUES(4, '1000000312 23:58:48 IST');
+ ^
+<sql-statement>
+--Verify data
+SELECT * FROM TIMESTAMPTZ_TST ORDER BY a;
+</sql-statement>
+<sql-statement>
+--Cleanup
+DROP TABLE TIMESTAMPTZ_TST;
+</sql-statement>
+<sql-statement>
+-- test timestamptz constructors
+set TimeZone to 'America/New_York';
+</sql-statement>
+<sql-statement>
+-- numeric timezone
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
+</sql-statement>
+<sql-statement>
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
+</sql-statement>
+<sql-statement>
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
+</sql-statement>
+<sql-statement>
+WITH tzs (tz) AS (VALUES
+ ('+1'), ('+1:'), ('+1:0'), ('+100'), ('+1:00'), ('+01:00'),
+ ('+10'), ('+1000'), ('+10:'), ('+10:0'), ('+10:00'), ('+10:00:'),
+ ('+10:00:1'), ('+10:00:01'),
+ ('+10:00:10'))
+ SELECT make_timestamptz(2010, 2, 27, 3, 45, 00, tz), tz FROM tzs;
+</sql-statement>
+<sql-statement>
+-- these should fail
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- these should fail
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric time zone: "2"
+HINT: Numeric time zones must have "-" or "+" as first character.
+
+ -- these should fail
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: numeric time zone "+16" out of range
+
+ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: numeric time zone "-16" out of range
+
+ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+ ^
+<sql-statement>
+-- should be true
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
+</sql-statement>
+<sql-statement>
+-- full timezone names
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- full timezone names
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Prague" not recognized
+
+ -- full timezone names
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Prague" not recognized
+
+ SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
+ ^
+<sql-statement>
+SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Asia/Manila" not recognized
+
+ SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
+ ^
+<sql-statement>
+SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Paris" not recognized
+
+ SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
+ ^
+<sql-statement>
+SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Nehwon/Lankhmar" not recognized
+
+ SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+ ^
+<sql-statement>
+-- abbreviations
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- abbreviations
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "EST" not recognized
+
+ -- abbreviations
+ ^
+<sql-statement>
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "EDT" not recognized
+
+ SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, 'PST8PDT');
+</sql-statement>
+<sql-statement>
+RESET TimeZone;
+</sql-statement>
+<sql-statement>
+-- generate_series for timestamptz
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '1 hour'::interval);
+</sql-statement>
+<sql-statement>
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamptz,
+ 'infinity'::timestamptz,
+ '1 month'::interval) limit 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:8: Error: Generator functions are not allowed in: SELECT
+ select generate_series('2022-01-01 00:00'::timestamptz,
+ ^
+<sql-statement>
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '0 hour'::interval);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- errors
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: step size cannot equal zero
+
+ -- errors
+ ^
+<sql-statement>
+--
+-- Test behavior with a dynamic (time-varying) timezone abbreviation.
+-- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
+--
+SET TimeZone to 'UTC';
+</sql-statement>
+<sql-statement>
+SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 01:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:59:59 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:59:59 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 01:59:59 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 02:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:01 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:01 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 02:00:01 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:59:59 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:59:59 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 02:59:59 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 03:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:01 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:01 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 03:00:01 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 04:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 04:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2011-03-27 04:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 00:00:00 MSK"
+
+ SELECT '2011-03-27 00:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 01:00:00 MSK"
+
+ SELECT '2011-03-27 01:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:59:59 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:59:59 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 01:59:59 MSK"
+
+ SELECT '2011-03-27 01:59:59 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 02:00:00 MSK"
+
+ SELECT '2011-03-27 02:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:01 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:01 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 02:00:01 MSK"
+
+ SELECT '2011-03-27 02:00:01 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:59:59 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:59:59 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 02:59:59 MSK"
+
+ SELECT '2011-03-27 02:59:59 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 03:00:00 MSK"
+
+ SELECT '2011-03-27 03:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 03:00:01 MSK"
+
+ SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 04:00:00 MSK"
+
+ SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "europe/moscow" not recognized
+
+ SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-26 00:00:00 MSK"
+
+ SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-26 00:59:59 MSK"
+
+ SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-26 01:00:00 MSK"
+
+ SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-26 01:00:01 MSK"
+
+ SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-26 02:00:00 MSK"
+
+ SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "Europe/Moscow" not recognized
+
+ SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+ ^
+<sql-statement>
+SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "MSK" not recognized
+
+ SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
+ ^
+<sql-statement>
+SELECT to_timestamp( 0); -- 1970-01-01 00:00:00+00
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp( 946684800); -- 2000-01-01 00:00:00+00
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp(1262349296.7890123); -- 2010-01-01 12:34:56.789012+00
+</sql-statement>
+<sql-statement>
+-- edge cases
+SELECT to_timestamp(-210866803200); -- 4714-11-24 00:00:00+00 BC
+</sql-statement>
+<sql-statement>
+-- upper limit varies between integer and float timestamps, so hard to test
+-- nonfinite values
+SELECT to_timestamp(' Infinity'::float);
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('-Infinity'::float);
+</sql-statement>
+<sql-statement>
+SELECT to_timestamp('NaN'::float);
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT to_timestamp('NaN'::float);
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: timestamp cannot be NaN
+
+ SELECT to_timestamp('NaN'::float);
+ ^
+<sql-statement>
+SET TimeZone to 'Europe/Moscow';
+</sql-statement>
+<sql-statement>
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 21:00:00 UTC"
+
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:00:00 UTC"
+
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:59:59 UTC"
+
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:00 UTC"
+
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:01 UTC"
+
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:59:59 UTC"
+
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 00:00:00 UTC"
+
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:00:00 UTC"
+
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:59:59 UTC"
+
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:00 UTC"
+
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:01 UTC"
+
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+ ^
+<sql-statement>
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 23:00:00 UTC"
+
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
+ ^
+<sql-statement>
+RESET TimeZone;
+</sql-statement>
+<sql-statement>
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 21:00:00 UTC"
+
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:00:00 UTC"
+
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:59:59 UTC"
+
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:00 UTC"
+
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:01 UTC"
+
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:59:59 UTC"
+
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 00:00:00 UTC"
+
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:00:00 UTC"
+
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:59:59 UTC"
+
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:00 UTC"
+
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:01 UTC"
+
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 23:00:00 UTC"
+
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ ^
+<sql-statement>
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 21:00:00 UTC"
+
+ SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:00:00 UTC"
+
+ SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 22:59:59 UTC"
+
+ SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:00 UTC"
+
+ SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:00:01 UTC"
+
+ SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-26 23:59:59 UTC"
+
+ SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2011-03-27 00:00:00 UTC"
+
+ SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:00:00 UTC"
+
+ SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 21:59:59 UTC"
+
+ SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:00 UTC"
+
+ SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 22:00:01 UTC"
+
+ SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type timestamp with time zone: "2014-10-25 23:00:00 UTC"
+
+ SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ ^
+<sql-statement>
+--
+-- Test that AT TIME ZONE isn't misoptimized when using an index (bug #14504)
+--
+create temp table tmptz (f1 timestamptz primary key);
+</sql-statement>
+<sql-statement>
+insert into tmptz values ('2017-01-18 00:00+00');
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "utc" not recognized
+
+ select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/timestamptz.out b/yql/essentials/tests/postgresql/cases/timestamptz.out
new file mode 100644
index 0000000000..d666f9851b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamptz.out
@@ -0,0 +1,264 @@
+--
+-- TIMESTAMPTZ
+--
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'today';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'yesterday';
+ one
+-----
+ 1
+(1 row)
+
+COMMIT;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+COMMIT;
+-- Special values
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+set datestyle to ymd;
+reset datestyle;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ERROR: time zone "america/does_not_exist" not recognized
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America...
+ ^
+SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+ERROR: time zone "America/Does_not_exist" not recognized
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
+ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097')...
+ ^
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC...
+ ^
+SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+ERROR: timestamp out of range: "4714-11-23 23:59:59+00 BC"
+LINE 1: SELECT '4714-11-23 23:59:59+00 BC'::timestamptz;
+ ^
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00+00"
+LINE 1: SELECT '294277-01-01 00:00:00+00'::timestamptz;
+ ^
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-12-31 16:00:00-08"
+LINE 1: SELECT '294277-12-31 16:00:00-08'::timestamptz;
+ ^
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ERROR: timestamps cannot be binned into intervals containing months or years
+SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ERROR: timestamps cannot be binned into intervals containing months or years
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+ERROR: stride must be greater than zero
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+ERROR: stride must be greater than zero
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
+ date_part
+---------------
+ 9224097091200
+(1 row)
+
+SELECT extract(epoch from '294270-01-01 00:00:00+00'::timestamptz);
+ extract
+----------------------
+ 9224097091200.000000
+(1 row)
+
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00+00'::timestamptz);
+ extract
+--------------------
+ 95617584000.000000
+(1 row)
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamptz),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+ to_char
+--------------------------------------------------------------------
+ 0 00 000 0000 00000 000000 0 00 000 0000 00000 000000 000 000000
+ 7 78 780 7800 78000 780000 7 78 780 7800 78000 780000 780 780000
+ 7 78 789 7890 78901 789010 7 78 789 7890 78901 789010 789 789010
+ 7 78 789 7890 78901 789012 7 78 789 7890 78901 789012 789 789012
+(4 rows)
+
+-- Check OF, TZH, TZM with various zone offsets, particularly fractional hours
+SET timezone = '00:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+-----+---------
+ +00 | +00:00
+(1 row)
+
+SET timezone = '+02:00';
+SET timezone = '-13:00';
+SET timezone = '-00:30';
+SET timezone = '00:30';
+SET timezone = '-04:30';
+SET timezone = '04:30';
+SET timezone = '-04:15';
+SET timezone = '04:15';
+RESET timezone;
+CREATE TABLE TIMESTAMPTZ_TST (a int , b timestamptz);
+--Cleanup
+DROP TABLE TIMESTAMPTZ_TST;
+-- test timestamptz constructors
+set TimeZone to 'America/New_York';
+-- these should fail
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
+ERROR: invalid input syntax for type numeric time zone: "2"
+HINT: Numeric time zones must have "-" or "+" as first character.
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+ERROR: numeric time zone "+16" out of range
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+ERROR: numeric time zone "-16" out of range
+-- should be true
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+ERROR: time zone "Nehwon/Lankhmar" not recognized
+RESET TimeZone;
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '0 hour'::interval);
+ERROR: step size cannot equal zero
+--
+-- Test behavior with a dynamic (time-varying) timezone abbreviation.
+-- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
+--
+SET TimeZone to 'UTC';
+-- upper limit varies between integer and float timestamps, so hard to test
+-- nonfinite values
+SELECT to_timestamp(' Infinity'::float);
+ to_timestamp
+--------------
+ infinity
+(1 row)
+
+SELECT to_timestamp('-Infinity'::float);
+ to_timestamp
+--------------
+ -infinity
+(1 row)
+
+SELECT to_timestamp('NaN'::float);
+ERROR: timestamp cannot be NaN
+SET TimeZone to 'Europe/Moscow';
+RESET TimeZone;
+--
+-- Test that AT TIME ZONE isn't misoptimized when using an index (bug #14504)
+--
+create temp table tmptz (f1 timestamptz primary key);
+insert into tmptz values ('2017-01-18 00:00+00');
diff --git a/yql/essentials/tests/postgresql/cases/timestamptz.sql b/yql/essentials/tests/postgresql/cases/timestamptz.sql
new file mode 100644
index 0000000000..6bf8c37784
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timestamptz.sql
@@ -0,0 +1,158 @@
+--
+-- TIMESTAMPTZ
+--
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'today';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'yesterday';
+COMMIT;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+COMMIT;
+-- Special values
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+set datestyle to ymd;
+reset datestyle;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
+SELECT extract(epoch from '294270-01-01 00:00:00+00'::timestamptz);
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00+00'::timestamptz);
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamptz),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+-- Check OF, TZH, TZM with various zone offsets, particularly fractional hours
+SET timezone = '00:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '+02:00';
+SET timezone = '-13:00';
+SET timezone = '-00:30';
+SET timezone = '00:30';
+SET timezone = '-04:30';
+SET timezone = '04:30';
+SET timezone = '-04:15';
+SET timezone = '04:15';
+RESET timezone;
+CREATE TABLE TIMESTAMPTZ_TST (a int , b timestamptz);
+--Cleanup
+DROP TABLE TIMESTAMPTZ_TST;
+-- test timestamptz constructors
+set TimeZone to 'America/New_York';
+-- these should fail
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+-- should be true
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
+SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+RESET TimeZone;
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '0 hour'::interval);
+--
+-- Test behavior with a dynamic (time-varying) timezone abbreviation.
+-- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
+--
+SET TimeZone to 'UTC';
+-- upper limit varies between integer and float timestamps, so hard to test
+-- nonfinite values
+SELECT to_timestamp(' Infinity'::float);
+SELECT to_timestamp('-Infinity'::float);
+SELECT to_timestamp('NaN'::float);
+SET TimeZone to 'Europe/Moscow';
+RESET TimeZone;
+--
+-- Test that AT TIME ZONE isn't misoptimized when using an index (bug #14504)
+--
+create temp table tmptz (f1 timestamptz primary key);
+insert into tmptz values ('2017-01-18 00:00+00');
diff --git a/yql/essentials/tests/postgresql/cases/timetz.err b/yql/essentials/tests/postgresql/cases/timetz.err
new file mode 100644
index 0000000000..e5f18d8a9d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timetz.err
@@ -0,0 +1,391 @@
+<sql-statement>
+--
+-- TIMETZ
+--
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+</sql-statement>
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "00:01 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "01:00 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "02:03 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "07:07 PST"
+
+ INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "08:08 EDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "11:59 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "12:00 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "12:01 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "23:59 PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "11:59:59.99 PM PDT"
+
+ INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+ ^
+<sql-statement>
+INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+ ^
+<sql-statement>
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 America/New_York');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- this should fail (the timezone offset is not known)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: time zone "america/new_york" not recognized
+
+ -- this should fail (the timezone offset is not known)
+ ^
+<sql-statement>
+-- this should fail (timezone not specified without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- this should fail (timezone not specified without a date)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "15:36:39 m2"
+
+ -- this should fail (timezone not specified without a date)
+ ^
+<sql-statement>
+-- this should fail (dynamic timezone abbreviation without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- this should fail (dynamic timezone abbreviation without a date)
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "15:36:39 MSK m2"
+
+ -- this should fail (dynamic timezone abbreviation without a date)
+ ^
+<sql-statement>
+SELECT f1 AS "Time TZ" FROM TIMETZ_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Three" FROM TIMETZ_TBL WHERE f1 < '05:06:07-07';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Seven" FROM TIMETZ_TBL WHERE f1 > '05:06:07-07';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
+</sql-statement>
+<sql-statement>
+SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
+</sql-statement>
+<sql-statement>
+-- Check edge cases
+SELECT '23:59:59.999999 PDT'::timetz;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- Check edge cases
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "23:59:59.999999 PDT"
+
+ -- Check edge cases
+ ^
+<sql-statement>
+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "23:59:59.9999999 PDT"
+
+ SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
+ ^
+<sql-statement>
+SELECT '23:59:60 PDT'::timetz; -- rounds up
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '23:59:60 PDT'::timetz; -- rounds up
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "23:59:60 PDT"
+
+ SELECT '23:59:60 PDT'::timetz; -- rounds up
+ ^
+<sql-statement>
+SELECT '24:00:00 PDT'::timetz; -- allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '24:00:00 PDT'::timetz; -- allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "24:00:00 PDT"
+
+ SELECT '24:00:00 PDT'::timetz; -- allowed
+ ^
+<sql-statement>
+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '24:00:00.01 PDT'::timetz; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "24:00:00.01 PDT"
+
+ SELECT '24:00:00.01 PDT'::timetz; -- not allowed
+ ^
+<sql-statement>
+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '23:59:60.01 PDT'::timetz; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "23:59:60.01 PDT"
+
+ SELECT '23:59:60.01 PDT'::timetz; -- not allowed
+ ^
+<sql-statement>
+SELECT '24:01:00 PDT'::timetz; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '24:01:00 PDT'::timetz; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "24:01:00 PDT"
+
+ SELECT '24:01:00 PDT'::timetz; -- not allowed
+ ^
+<sql-statement>
+SELECT '25:00:00 PDT'::timetz; -- not allowed
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT '25:00:00 PDT'::timetz; -- not allowed
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "25:00:00 PDT"
+
+ SELECT '25:00:00 PDT'::timetz; -- not allowed
+ ^
+<sql-statement>
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ --
+ ^
+ -stdin-:<main>:9:11: Error: At function: PgOp
+ SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
+ ^
+ -stdin-:<main>:9:11: Error: Unable to find an overload for operator + with given argument type(s): (timetz,timetz)
+ SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
+ ^
+<sql-statement>
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MILLISECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(SECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "time with time zone" units "day" not recognized
+
+ SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: "time with time zone" units "fortnight" not recognized
+
+ SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ ^
+<sql-statement>
+SELECT EXTRACT(TIMEZONE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(TIMEZONE_HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(TIMEZONE_MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+</sql-statement>
+<sql-statement>
+SELECT EXTRACT(EPOCH FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT date_part('millisecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT date_part('second', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
+<sql-statement>
+SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/timetz.out b/yql/essentials/tests/postgresql/cases/timetz.out
new file mode 100644
index 0000000000..85ebff73e2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timetz.out
@@ -0,0 +1,106 @@
+--
+-- TIMETZ
+--
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+-- this should fail (timezone not specified without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+ERROR: invalid input syntax for type time with time zone: "15:36:39 m2"
+LINE 1: INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+ ^
+-- this should fail (dynamic timezone abbreviation without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+ERROR: invalid input syntax for type time with time zone: "15:36:39 MSK m2"
+LINE 1: INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+ ^
+SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
+ None
+------
+(0 rows)
+
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+----------
+ 25575401
+(1 row)
+
+SELECT EXTRACT(MILLISECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+-----------
+ 25575.401
+(1 row)
+
+SELECT EXTRACT(SECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+-----------
+ 25.575401
+(1 row)
+
+SELECT EXTRACT(MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+---------
+ 30
+(1 row)
+
+SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+---------
+ 13
+(1 row)
+
+SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ERROR: "time with time zone" units "day" not recognized
+SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ERROR: "time with time zone" units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -16200
+(1 row)
+
+SELECT EXTRACT(TIMEZONE_HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -4
+(1 row)
+
+SELECT EXTRACT(TIMEZONE_MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -30
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+--------------
+ 63025.575401
+(1 row)
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25575401
+(1 row)
+
+SELECT date_part('millisecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25575.401
+(1 row)
+
+SELECT date_part('second', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25.575401
+(1 row)
+
+SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+--------------
+ 63025.575401
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/timetz.sql b/yql/essentials/tests/postgresql/cases/timetz.sql
new file mode 100644
index 0000000000..ec6d015187
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/timetz.sql
@@ -0,0 +1,29 @@
+--
+-- TIMETZ
+--
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+-- this should fail (timezone not specified without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+-- this should fail (dynamic timezone abbreviation without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(MILLISECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(SECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+SELECT EXTRACT(TIMEZONE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(TIMEZONE_HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(TIMEZONE_MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(EPOCH FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('millisecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('second', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
diff --git a/yql/essentials/tests/postgresql/cases/truncate.err b/yql/essentials/tests/postgresql/cases/truncate.err
new file mode 100644
index 0000000000..2856e03888
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/truncate.err
@@ -0,0 +1,1273 @@
+<sql-statement>
+-- Test basic TRUNCATE functionality.
+CREATE TABLE truncate_a (col1 integer primary key);
+</sql-statement>
+<sql-statement>
+INSERT INTO truncate_a VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO truncate_a VALUES (2);
+</sql-statement>
+<sql-statement>
+SELECT * FROM truncate_a;
+</sql-statement>
+<sql-statement>
+-- Roll truncate back
+BEGIN;
+</sql-statement>
+<sql-statement>
+TRUNCATE truncate_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_a;
+ ^
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+SELECT * FROM truncate_a;
+</sql-statement>
+<sql-statement>
+-- Commit the truncate this time
+BEGIN;
+</sql-statement>
+<sql-statement>
+TRUNCATE truncate_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_a;
+ ^
+<sql-statement>
+COMMIT;
+</sql-statement>
+<sql-statement>
+SELECT * FROM truncate_a;
+</sql-statement>
+<sql-statement>
+-- Test foreign-key checks
+CREATE TABLE trunc_b (a int REFERENCES truncate_a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ -- Test foreign-key checks
+ ^
+<sql-statement>
+CREATE TABLE trunc_c (a serial PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+CREATE TABLE trunc_d (a int REFERENCES trunc_c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ CREATE TABLE trunc_d (a int REFERENCES trunc_c);
+ ^
+<sql-statement>
+CREATE TABLE trunc_e (a int REFERENCES truncate_a, b int REFERENCES trunc_c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ CREATE TABLE trunc_e (a int REFERENCES truncate_a, b int REFERENCES trunc_c);
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a,trunc_b; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a,trunc_b; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a,trunc_b,trunc_e; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a,trunc_b,trunc_e; -- ok
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a,trunc_e; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a,trunc_e; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,trunc_d; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,trunc_d; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,trunc_d,trunc_e; -- ok
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a,trunc_b; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a,trunc_b; -- ok
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a RESTRICT; -- fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a RESTRICT; -- fail
+ ^
+<sql-statement>
+TRUNCATE TABLE truncate_a CASCADE; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncate_a CASCADE; -- ok
+ ^
+<sql-statement>
+-- circular references
+ALTER TABLE truncate_a ADD FOREIGN KEY (col1) REFERENCES trunc_c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- circular references
+ ^
+<sql-statement>
+-- Add some data to verify that truncating actually works ...
+INSERT INTO trunc_c VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO truncate_a VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO trunc_b VALUES (1);
+</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.trunc_b
+
+<sql-statement>
+INSERT INTO trunc_d VALUES (1);
+</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.trunc_d
+
+<sql-statement>
+INSERT INTO trunc_e VALUES (1,1);
+</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.trunc_e
+
+<sql-statement>
+TRUNCATE TABLE trunc_c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c;
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,truncate_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,truncate_a;
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,truncate_a,trunc_d;
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
+ ^
+<sql-statement>
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
+ ^
+<sql-statement>
+-- Verify that truncating did actually work
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+</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.trunc_b
+
+<sql-statement>
+SELECT * FROM trunc_e;
+</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.trunc_e
+
+<sql-statement>
+-- Add data again to test TRUNCATE ... CASCADE
+INSERT INTO trunc_c VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO truncate_a VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO trunc_b VALUES (1);
+</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.trunc_b
+
+<sql-statement>
+INSERT INTO trunc_d VALUES (1);
+</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.trunc_d
+
+<sql-statement>
+INSERT INTO trunc_e VALUES (1,1);
+</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.trunc_e
+
+<sql-statement>
+TRUNCATE TABLE trunc_c CASCADE; -- ok
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_c CASCADE; -- ok
+ ^
+<sql-statement>
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+</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.trunc_b
+
+<sql-statement>
+SELECT * FROM trunc_e;
+</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.trunc_e
+
+<sql-statement>
+DROP TABLE truncate_a,trunc_c,trunc_b,trunc_d,trunc_e CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ DROP TABLE truncate_a,trunc_c,trunc_b,trunc_d,trunc_e CASCADE;
+ ^
+<sql-statement>
+-- Test TRUNCATE with inheritance
+CREATE TABLE trunc_f (col1 integer primary key);
+</sql-statement>
+<sql-statement>
+INSERT INTO trunc_f VALUES (1);
+</sql-statement>
+<sql-statement>
+INSERT INTO trunc_f VALUES (2);
+</sql-statement>
+<sql-statement>
+CREATE TABLE trunc_fa (col2a text) INHERITS (trunc_f);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_fa (col2a text) INHERITS (trunc_f);
+ ^
+<sql-statement>
+INSERT INTO trunc_fa VALUES (3, 'three');
+</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.trunc_fa
+
+<sql-statement>
+CREATE TABLE trunc_fb (col2b int) INHERITS (trunc_f);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_fb (col2b int) INHERITS (trunc_f);
+ ^
+<sql-statement>
+INSERT INTO trunc_fb VALUES (4, 444);
+</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.trunc_fb
+
+<sql-statement>
+CREATE TABLE trunc_faa (col3 text) INHERITS (trunc_fa);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_faa (col3 text) INHERITS (trunc_fa);
+ ^
+<sql-statement>
+INSERT INTO trunc_faa VALUES (5, 'five', 'FIVE');
+</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.trunc_faa
+
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+TRUNCATE trunc_f;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE trunc_f;
+ ^
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+TRUNCATE ONLY trunc_f;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE ONLY trunc_f;
+ ^
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_fa;
+</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.trunc_fa
+
+<sql-statement>
+SELECT * FROM trunc_faa;
+</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.trunc_faa
+
+<sql-statement>
+TRUNCATE ONLY trunc_fb, ONLY trunc_fa;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE ONLY trunc_fb, ONLY trunc_fa;
+ ^
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_fa;
+</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.trunc_fa
+
+<sql-statement>
+SELECT * FROM trunc_faa;
+</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.trunc_faa
+
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+BEGIN;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_fa;
+</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.trunc_fa
+
+<sql-statement>
+SELECT * FROM trunc_faa;
+</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.trunc_faa
+
+<sql-statement>
+TRUNCATE ONLY trunc_fb, trunc_fa;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE ONLY trunc_fb, trunc_fa;
+ ^
+<sql-statement>
+SELECT * FROM trunc_f;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_fa;
+</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.trunc_fa
+
+<sql-statement>
+SELECT * FROM trunc_faa;
+</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.trunc_faa
+
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+DROP TABLE trunc_f CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ DROP TABLE trunc_f CASCADE;
+ ^
+<sql-statement>
+-- Test ON TRUNCATE triggers
+CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text);
+</sql-statement>
+<sql-statement>
+CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text,
+ tgargv text, tgtable name, rowcount bigint);
+</sql-statement>
+<sql-statement>
+CREATE FUNCTION trunctrigger() RETURNS trigger as $$
+declare c bigint;
+begin
+ execute 'select count(*) from ' || quote_ident(tg_table_name) into c;
+ insert into trunc_trigger_log values
+ (TG_OP, TG_LEVEL, TG_WHEN, TG_ARGV[0], tg_table_name, c);
+ return null;
+end;
+$$ LANGUAGE plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION trunctrigger() RETURNS trigger as $$
+ ^
+<sql-statement>
+-- basic before trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+</sql-statement>
+<sql-statement>
+CREATE TRIGGER t
+BEFORE TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('before trigger truncate');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER t
+ ^
+<sql-statement>
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_trigger_log;
+</sql-statement>
+<sql-statement>
+TRUNCATE trunc_trigger_test;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE trunc_trigger_test;
+ ^
+<sql-statement>
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_trigger_log;
+</sql-statement>
+<sql-statement>
+DROP TRIGGER t ON trunc_trigger_test;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER t ON trunc_trigger_test;
+ ^
+<sql-statement>
+truncate trunc_trigger_log;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ truncate trunc_trigger_log;
+ ^
+<sql-statement>
+-- same test with an after trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+</sql-statement>
+<sql-statement>
+CREATE TRIGGER tt
+AFTER TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('after trigger truncate');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER tt
+ ^
+<sql-statement>
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_trigger_log;
+</sql-statement>
+<sql-statement>
+TRUNCATE trunc_trigger_test;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE trunc_trigger_test;
+ ^
+<sql-statement>
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+</sql-statement>
+<sql-statement>
+SELECT * FROM trunc_trigger_log;
+</sql-statement>
+<sql-statement>
+DROP TABLE trunc_trigger_test;
+</sql-statement>
+<sql-statement>
+DROP TABLE trunc_trigger_log;
+</sql-statement>
+<sql-statement>
+DROP FUNCTION trunctrigger();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION trunctrigger();
+ ^
+<sql-statement>
+-- test TRUNCATE ... RESTART IDENTITY
+CREATE SEQUENCE truncate_a_id1 START WITH 33;
+</sql-statement>
+-stdin-:<main>: Error: Pre type annotation
+
+ -stdin-:<main>:1:1: Error: Unexpected tag: pgObject
+ -- test TRUNCATE ... RESTART IDENTITY
+ ^
+<sql-statement>
+CREATE TABLE truncate_a (id serial,
+ id1 integer default nextval('truncate_a_id1'));
+</sql-statement>
+<sql-statement>
+ALTER SEQUENCE truncate_a_id1 OWNED BY truncate_a.id1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 231
+ ALTER SEQUENCE truncate_a_id1 OWNED BY truncate_a.id1;
+ ^
+<sql-statement>
+INSERT INTO truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a;
+</sql-statement>
+<sql-statement>
+TRUNCATE truncate_a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_a;
+ ^
+<sql-statement>
+INSERT INTO truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a;
+</sql-statement>
+<sql-statement>
+TRUNCATE truncate_a RESTART IDENTITY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_a RESTART IDENTITY;
+ ^
+<sql-statement>
+INSERT INTO truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a;
+</sql-statement>
+<sql-statement>
+CREATE TABLE truncate_b (id int GENERATED ALWAYS AS IDENTITY (START WITH 44));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ CREATE TABLE truncate_b (id int GENERATED ALWAYS AS IDENTITY (START WITH 44));
+ ^
+<sql-statement>
+INSERT INTO truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b;
+</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.truncate_b
+
+<sql-statement>
+TRUNCATE truncate_b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_b;
+ ^
+<sql-statement>
+INSERT INTO truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b;
+</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.truncate_b
+
+<sql-statement>
+TRUNCATE truncate_b RESTART IDENTITY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_b RESTART IDENTITY;
+ ^
+<sql-statement>
+INSERT INTO truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_b;
+</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.truncate_b
+
+<sql-statement>
+-- check rollback of a RESTART IDENTITY operation
+BEGIN;
+</sql-statement>
+<sql-statement>
+TRUNCATE truncate_a RESTART IDENTITY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncate_a RESTART IDENTITY;
+ ^
+<sql-statement>
+INSERT INTO truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a;
+</sql-statement>
+<sql-statement>
+ROLLBACK;
+</sql-statement>
+<sql-statement>
+INSERT INTO truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a DEFAULT VALUES;
+</sql-statement>
+-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' 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 truncate_a;
+</sql-statement>
+<sql-statement>
+DROP TABLE truncate_a;
+</sql-statement>
+<sql-statement>
+SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "truncate_a_id1" does not exist
+
+ SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+ ^
+<sql-statement>
+-- partitioned table
+CREATE TABLE truncparted (a int, b char) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- partitioned table
+ ^
+<sql-statement>
+-- error, can't truncate a partitioned table
+TRUNCATE ONLY truncparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- error, can't truncate a partitioned table
+ ^
+<sql-statement>
+CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1);
+ ^
+<sql-statement>
+INSERT INTO truncparted VALUES (1, 'a');
+</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.truncparted
+
+<sql-statement>
+-- error, must truncate partitions
+TRUNCATE ONLY truncparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- error, must truncate partitions
+ ^
+<sql-statement>
+TRUNCATE truncparted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE truncparted;
+ ^
+<sql-statement>
+DROP TABLE truncparted;
+</sql-statement>
+<sql-statement>
+-- foreign key on partitioned table: partition key is referencing column.
+-- Make sure truncate did execute on all tables
+CREATE FUNCTION tp_ins_data() RETURNS void LANGUAGE plpgsql AS $$
+ BEGIN
+ INSERT INTO truncprim VALUES (1), (100), (150);
+ INSERT INTO truncpart VALUES (1), (100), (150);
+ END
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- foreign key on partitioned table: partition key is referencing column.
+ ^
+<sql-statement>
+CREATE FUNCTION tp_chk_data(OUT pktb regclass, OUT pkval int, OUT fktb regclass, OUT fkval int)
+ RETURNS SETOF record LANGUAGE plpgsql AS $$
+ BEGIN
+ RETURN QUERY SELECT
+ pk.tableoid::regclass, pk.a, fk.tableoid::regclass, fk.a
+ FROM truncprim pk FULL JOIN truncpart fk USING (a)
+ ORDER BY 2, 4;
+ END
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION tp_chk_data(OUT pktb regclass, OUT pkval int, OUT fktb regclass, OUT fkval int)
+ ^
+<sql-statement>
+CREATE TABLE truncprim (a int PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+CREATE TABLE truncpart (a int REFERENCES truncprim)
+ PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE truncpart (a int REFERENCES truncprim)
+ ^
+<sql-statement>
+CREATE TABLE truncpart_1 PARTITION OF truncpart FOR VALUES FROM (0) TO (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE truncpart_1 PARTITION OF truncpart FOR VALUES FROM (0) TO (100);
+ ^
+<sql-statement>
+CREATE TABLE truncpart_2 PARTITION OF truncpart FOR VALUES FROM (100) TO (200)
+ PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE truncpart_2 PARTITION OF truncpart FOR VALUES FROM (100) TO (200)
+ ^
+<sql-statement>
+CREATE TABLE truncpart_2_1 PARTITION OF truncpart_2 FOR VALUES FROM (100) TO (150);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE truncpart_2_1 PARTITION OF truncpart_2 FOR VALUES FROM (100) TO (150);
+ ^
+<sql-statement>
+CREATE TABLE truncpart_2_d PARTITION OF truncpart_2 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE truncpart_2_d PARTITION OF truncpart_2 DEFAULT;
+ ^
+<sql-statement>
+TRUNCATE TABLE truncprim; -- should fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE truncprim; -- should fail
+ ^
+<sql-statement>
+select tp_ins_data();
+</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 tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: tp_ins_data
+ select tp_ins_data();
+ ^
+<sql-statement>
+-- should truncate everything
+TRUNCATE TABLE truncprim, truncpart;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- should truncate everything
+ ^
+<sql-statement>
+select * from tp_chk_data();
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select * from tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ select * from tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: tp_chk_data
+ select * from tp_chk_data();
+ ^
+<sql-statement>
+select tp_ins_data();
+</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 tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ select tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: tp_ins_data
+ select tp_ins_data();
+ ^
+<sql-statement>
+-- should truncate everything
+TRUNCATE TABLE truncprim CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- should truncate everything
+ ^
+<sql-statement>
+SELECT * FROM tp_chk_data();
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ SELECT * FROM tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: tp_chk_data
+ SELECT * FROM tp_chk_data();
+ ^
+<sql-statement>
+SELECT tp_ins_data();
+</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 tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT tp_ins_data();
+ ^
+ -stdin-:<main>:1:8: Error: No such proc: tp_ins_data
+ SELECT tp_ins_data();
+ ^
+<sql-statement>
+-- should truncate all partitions
+TRUNCATE TABLE truncpart;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- should truncate all partitions
+ ^
+<sql-statement>
+SELECT * FROM tp_chk_data();
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT * FROM tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: At function: PgCall
+ SELECT * FROM tp_chk_data();
+ ^
+ -stdin-:<main>:1:15: Error: No such proc: tp_chk_data
+ SELECT * FROM tp_chk_data();
+ ^
+<sql-statement>
+DROP TABLE truncprim, truncpart;
+</sql-statement>
+<sql-statement>
+DROP FUNCTION tp_ins_data(), tp_chk_data();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION tp_ins_data(), tp_chk_data();
+ ^
+<sql-statement>
+-- test cascade when referencing a partitioned table
+CREATE TABLE trunc_a (a INT PRIMARY KEY) PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- test cascade when referencing a partitioned table
+ ^
+<sql-statement>
+CREATE TABLE trunc_a1 PARTITION OF trunc_a FOR VALUES FROM (0) TO (10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a1 PARTITION OF trunc_a FOR VALUES FROM (0) TO (10);
+ ^
+<sql-statement>
+CREATE TABLE trunc_a2 PARTITION OF trunc_a FOR VALUES FROM (10) TO (20)
+ PARTITION BY RANGE (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a2 PARTITION OF trunc_a FOR VALUES FROM (10) TO (20)
+ ^
+<sql-statement>
+CREATE TABLE trunc_a21 PARTITION OF trunc_a2 FOR VALUES FROM (10) TO (12);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a21 PARTITION OF trunc_a2 FOR VALUES FROM (10) TO (12);
+ ^
+<sql-statement>
+CREATE TABLE trunc_a22 PARTITION OF trunc_a2 FOR VALUES FROM (12) TO (16);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a22 PARTITION OF trunc_a2 FOR VALUES FROM (12) TO (16);
+ ^
+<sql-statement>
+CREATE TABLE trunc_a2d PARTITION OF trunc_a2 DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a2d PARTITION OF trunc_a2 DEFAULT;
+ ^
+<sql-statement>
+CREATE TABLE trunc_a3 PARTITION OF trunc_a FOR VALUES FROM (20) TO (30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE trunc_a3 PARTITION OF trunc_a FOR VALUES FROM (20) TO (30);
+ ^
+<sql-statement>
+INSERT INTO trunc_a VALUES (0), (5), (10), (15), (20), (25);
+</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.trunc_a
+
+<sql-statement>
+-- truncate a partition cascading to a table
+CREATE TABLE ref_b (
+ b INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ -- truncate a partition cascading to a table
+ ^
+<sql-statement>
+INSERT INTO ref_b VALUES (10, 0), (50, 5), (100, 10), (150, 15);
+</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.ref_b
+
+<sql-statement>
+TRUNCATE TABLE trunc_a1 CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_a1 CASCADE;
+ ^
+<sql-statement>
+SELECT a FROM ref_b;
+</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.ref_b
+
+<sql-statement>
+DROP TABLE ref_b;
+</sql-statement>
+<sql-statement>
+-- truncate a partition cascading to a partitioned table
+CREATE TABLE ref_c (
+ c INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+) PARTITION BY RANGE (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- truncate a partition cascading to a partitioned table
+ ^
+<sql-statement>
+CREATE TABLE ref_c1 PARTITION OF ref_c FOR VALUES FROM (100) TO (200);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE ref_c1 PARTITION OF ref_c FOR VALUES FROM (100) TO (200);
+ ^
+<sql-statement>
+CREATE TABLE ref_c2 PARTITION OF ref_c FOR VALUES FROM (200) TO (300);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE ref_c2 PARTITION OF ref_c FOR VALUES FROM (200) TO (300);
+ ^
+<sql-statement>
+INSERT INTO ref_c VALUES (100, 10), (150, 15), (200, 20), (250, 25);
+</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.ref_c
+
+<sql-statement>
+TRUNCATE TABLE trunc_a21 CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ TRUNCATE TABLE trunc_a21 CASCADE;
+ ^
+<sql-statement>
+SELECT a as "from table ref_c" FROM ref_c;
+</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.ref_c
+
+<sql-statement>
+SELECT a as "from table trunc_a" FROM trunc_a ORDER BY a;
+</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.trunc_a
+
+<sql-statement>
+DROP TABLE trunc_a, ref_c;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/truncate.out b/yql/essentials/tests/postgresql/cases/truncate.out
new file mode 100644
index 0000000000..4468549224
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/truncate.out
@@ -0,0 +1,87 @@
+-- Test basic TRUNCATE functionality.
+CREATE TABLE truncate_a (col1 integer primary key);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO truncate_a VALUES (2);
+SELECT * FROM truncate_a;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+-- Roll truncate back
+BEGIN;
+ROLLBACK;
+SELECT * FROM truncate_a;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+-- Commit the truncate this time
+BEGIN;
+COMMIT;
+CREATE TABLE trunc_c (a serial PRIMARY KEY);
+-- Add some data to verify that truncating actually works ...
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+-- Add data again to test TRUNCATE ... CASCADE
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+-- Test TRUNCATE with inheritance
+CREATE TABLE trunc_f (col1 integer primary key);
+INSERT INTO trunc_f VALUES (1);
+INSERT INTO trunc_f VALUES (2);
+BEGIN;
+ROLLBACK;
+BEGIN;
+ROLLBACK;
+BEGIN;
+ROLLBACK;
+BEGIN;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+ROLLBACK;
+-- Test ON TRUNCATE triggers
+CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text);
+CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text,
+ tgargv text, tgtable name, rowcount bigint);
+-- basic before trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+ Row count in test table
+-------------------------
+ 2
+(1 row)
+
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+------+---------+--------+--------+---------+----------
+(0 rows)
+
+-- same test with an after trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+------+---------+--------+--------+---------+----------
+(0 rows)
+
+DROP TABLE trunc_trigger_test;
+DROP TABLE trunc_trigger_log;
+CREATE TABLE truncate_a (id serial,
+ id1 integer default nextval('truncate_a_id1'));
+-- check rollback of a RESTART IDENTITY operation
+BEGIN;
+ROLLBACK;
+DROP TABLE truncate_a;
+SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+ERROR: relation "truncate_a_id1" does not exist
+LINE 1: SELECT nextval('truncate_a_id1');
+ ^
+CREATE TABLE truncprim (a int PRIMARY KEY);
diff --git a/yql/essentials/tests/postgresql/cases/truncate.sql b/yql/essentials/tests/postgresql/cases/truncate.sql
new file mode 100644
index 0000000000..f76c95b9a7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/truncate.sql
@@ -0,0 +1,53 @@
+-- Test basic TRUNCATE functionality.
+CREATE TABLE truncate_a (col1 integer primary key);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO truncate_a VALUES (2);
+SELECT * FROM truncate_a;
+-- Roll truncate back
+BEGIN;
+ROLLBACK;
+SELECT * FROM truncate_a;
+-- Commit the truncate this time
+BEGIN;
+COMMIT;
+CREATE TABLE trunc_c (a serial PRIMARY KEY);
+-- Add some data to verify that truncating actually works ...
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+-- Add data again to test TRUNCATE ... CASCADE
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+-- Test TRUNCATE with inheritance
+CREATE TABLE trunc_f (col1 integer primary key);
+INSERT INTO trunc_f VALUES (1);
+INSERT INTO trunc_f VALUES (2);
+BEGIN;
+ROLLBACK;
+BEGIN;
+ROLLBACK;
+BEGIN;
+ROLLBACK;
+BEGIN;
+SELECT * FROM trunc_f;
+ROLLBACK;
+-- Test ON TRUNCATE triggers
+CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text);
+CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text,
+ tgargv text, tgtable name, rowcount bigint);
+-- basic before trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+SELECT * FROM trunc_trigger_log;
+-- same test with an after trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+SELECT * FROM trunc_trigger_log;
+DROP TABLE trunc_trigger_test;
+DROP TABLE trunc_trigger_log;
+CREATE TABLE truncate_a (id serial,
+ id1 integer default nextval('truncate_a_id1'));
+-- check rollback of a RESTART IDENTITY operation
+BEGIN;
+ROLLBACK;
+DROP TABLE truncate_a;
+SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+CREATE TABLE truncprim (a int PRIMARY KEY);
diff --git a/yql/essentials/tests/postgresql/cases/unicode.err b/yql/essentials/tests/postgresql/cases/unicode.err
new file mode 100644
index 0000000000..6763d250fc
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/unicode.err
@@ -0,0 +1,125 @@
+<sql-statement>
+SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:25: Error: alternative is not implemented yet : 365
+ SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+ ^
+<sql-statement>
+SELECT normalize('');
+</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 normalize('');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT normalize('');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc normalize with given argument types: (unknown)
+ SELECT normalize('');
+ ^
+<sql-statement>
+SELECT normalize(U&'\0061\0308\24D1c') = U&'\00E4\24D1c' COLLATE "C" AS test_default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:40: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\0061\0308\24D1c') = U&'\00E4\24D1c' COLLATE "C" AS test_default;
+ ^
+<sql-statement>
+SELECT normalize(U&'\0061\0308\24D1c', NFC) = U&'\00E4\24D1c' COLLATE "C" AS test_nfc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\0061\0308\24D1c', NFC) = U&'\00E4\24D1c' COLLATE "C" AS test_nfc;
+ ^
+<sql-statement>
+SELECT normalize(U&'\00E4bc', NFC) = U&'\00E4bc' COLLATE "C" AS test_nfc_idem;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:36: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\00E4bc', NFC) = U&'\00E4bc' COLLATE "C" AS test_nfc_idem;
+ ^
+<sql-statement>
+SELECT normalize(U&'\00E4\24D1c', NFD) = U&'\0061\0308\24D1c' COLLATE "C" AS test_nfd;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:40: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\00E4\24D1c', NFD) = U&'\0061\0308\24D1c' COLLATE "C" AS test_nfd;
+ ^
+<sql-statement>
+SELECT normalize(U&'\0061\0308\24D1c', NFKC) = U&'\00E4bc' COLLATE "C" AS test_nfkc;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:46: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\0061\0308\24D1c', NFKC) = U&'\00E4bc' COLLATE "C" AS test_nfkc;
+ ^
+<sql-statement>
+SELECT normalize(U&'\00E4\24D1c', NFKD) = U&'\0061\0308bc' COLLATE "C" AS test_nfkd;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: alternative is not implemented yet : 365
+ SELECT normalize(U&'\00E4\24D1c', NFKD) = U&'\0061\0308bc' COLLATE "C" AS test_nfkd;
+ ^
+<sql-statement>
+SELECT "normalize"('abc', 'def'); -- run-time error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT "normalize"('abc', 'def'); -- run-time error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid normalization form: def
+
+ SELECT "normalize"('abc', 'def'); -- run-time error
+ ^
+<sql-statement>
+SELECT U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+</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 U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+ ^
+ -stdin-:<main>:1:24: Error: At function: PgCall
+ SELECT U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+ ^
+ -stdin-:<main>:1:24: Error: Unable to find an overload for proc is_normalized with given argument types: (unknown)
+ SELECT U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+ ^
+<sql-statement>
+SELECT U&'\00E4\24D1c' IS NFC NORMALIZED AS test_nfc;
+</sql-statement>
+<sql-statement>
+SELECT num, val,
+ val IS NFC NORMALIZED AS NFC,
+ val IS NFD NORMALIZED AS NFD,
+ val IS NFKC NORMALIZED AS NFKC,
+ val IS NFKD NORMALIZED AS NFKD
+FROM
+ (VALUES (1, U&'\00E4bc'),
+ (2, U&'\0061\0308bc'),
+ (3, U&'\00E4\24D1c'),
+ (4, U&'\0061\0308\24D1c'),
+ (5, '')) vals (num, val)
+ORDER BY num;
+</sql-statement>
+<sql-statement>
+SELECT is_normalized('abc', 'def'); -- run-time error
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT is_normalized('abc', 'def'); -- run-time error
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid normalization form: def
+
+ SELECT is_normalized('abc', 'def'); -- run-time error
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/unicode.out b/yql/essentials/tests/postgresql/cases/unicode.out
new file mode 100644
index 0000000000..17816cb963
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/unicode.out
@@ -0,0 +1,31 @@
+SELECT "normalize"('abc', 'def'); -- run-time error
+ERROR: invalid normalization form: def
+SELECT U&'\00E4\24D1c' IS NFC NORMALIZED AS test_nfc;
+ test_nfc
+----------
+ t
+(1 row)
+
+SELECT num, val,
+ val IS NFC NORMALIZED AS NFC,
+ val IS NFD NORMALIZED AS NFD,
+ val IS NFKC NORMALIZED AS NFKC,
+ val IS NFKD NORMALIZED AS NFKD
+FROM
+ (VALUES (1, U&'\00E4bc'),
+ (2, U&'\0061\0308bc'),
+ (3, U&'\00E4\24D1c'),
+ (4, U&'\0061\0308\24D1c'),
+ (5, '')) vals (num, val)
+ORDER BY num;
+ num | val | nfc | nfd | nfkc | nfkd
+-----+-----+-----+-----+------+------
+ 1 | äbc | t | f | t | f
+ 2 | äbc | f | t | f | t
+ 3 | äⓑc | t | f | f | f
+ 4 | äⓑc | f | t | f | f
+ 5 | | t | t | t | t
+(5 rows)
+
+SELECT is_normalized('abc', 'def'); -- run-time error
+ERROR: invalid normalization form: def
diff --git a/yql/essentials/tests/postgresql/cases/unicode.sql b/yql/essentials/tests/postgresql/cases/unicode.sql
new file mode 100644
index 0000000000..6e9bc22afb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/unicode.sql
@@ -0,0 +1,15 @@
+SELECT "normalize"('abc', 'def'); -- run-time error
+SELECT U&'\00E4\24D1c' IS NFC NORMALIZED AS test_nfc;
+SELECT num, val,
+ val IS NFC NORMALIZED AS NFC,
+ val IS NFD NORMALIZED AS NFD,
+ val IS NFKC NORMALIZED AS NFKC,
+ val IS NFKD NORMALIZED AS NFKD
+FROM
+ (VALUES (1, U&'\00E4bc'),
+ (2, U&'\0061\0308bc'),
+ (3, U&'\00E4\24D1c'),
+ (4, U&'\0061\0308\24D1c'),
+ (5, '')) vals (num, val)
+ORDER BY num;
+SELECT is_normalized('abc', 'def'); -- run-time error
diff --git a/yql/essentials/tests/postgresql/cases/union.err b/yql/essentials/tests/postgresql/cases/union.err
new file mode 100644
index 0000000000..9e521c55fa
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/union.err
@@ -0,0 +1,1436 @@
+Registering pre-existing tables
+ int4_tbl
+ INT4_TBL
+ tenk1
+ text_tbl
+ VARCHAR_TBL
+ float8_tbl
+ CHAR_TBL
+ TEXT_TBL
+ FLOAT8_TBL
+ varchar_tbl
+ int8_tbl
+<sql-statement>
+--
+-- UNION (also INTERSECT, EXCEPT)
+--
+-- Simple UNION constructs
+SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS two UNION ALL SELECT 2;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS two UNION ALL SELECT 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- Mixed types
+SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1 AS one UNION SELECT 1.0::float8 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.0::float8 AS two UNION ALL SELECT 1 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1::float8 AS two UNION SELECT 2 UNION SELECT 2.0::float8 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- Try testing from tables...
+--
+SELECT f1 AS five FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM FLOAT8_TBL
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM FLOAT8_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS nine FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM INT4_TBL
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM INT4_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS five FROM FLOAT8_TBL
+ WHERE f1 BETWEEN -1e6 AND 1e6
+UNION
+SELECT f1 FROM INT4_TBL
+ WHERE f1 BETWEEN 0 AND 1000000
+ORDER BY 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT f1 AS five FROM FLOAT8_TBL
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT f1 AS five FROM FLOAT8_TBL
+ ^
+ -stdin-:<main>:2:12: Error: At function: PgBetween
+ WHERE f1 BETWEEN -1e6 AND 1e6
+ ^
+ -stdin-:<main>:2:12: Error: Mismatch of type of between elements: float8 and numeric
+ WHERE f1 BETWEEN -1e6 AND 1e6
+ ^
+<sql-statement>
+SELECT CAST(f1 AS char(4)) AS three FROM VARCHAR_TBL
+UNION
+SELECT f1 FROM CHAR_TBL
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS three FROM VARCHAR_TBL
+UNION
+SELECT CAST(f1 AS varchar) FROM CHAR_TBL
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS eight FROM VARCHAR_TBL
+UNION ALL
+SELECT f1 FROM CHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT f1 AS five FROM TEXT_TBL
+UNION
+SELECT f1 FROM VARCHAR_TBL
+UNION
+SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- INTERSECT and EXCEPT
+--
+SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl FOR NO KEY UPDATE;
+</sql-statement>
+<sql-statement>
+-- nested cases
+(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
+</sql-statement>
+<sql-statement>
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
+</sql-statement>
+<sql-statement>
+(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
+</sql-statement>
+<sql-statement>
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
+</sql-statement>
+<sql-statement>
+-- exercise both hashed and sorted implementations of UNION/INTERSECT/EXCEPT
+set enable_hashagg to on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- exercise both hashed and sorted implementations of UNION/INTERSECT/EXCEPT
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+</sql-statement>
+<sql-statement>
+set enable_hashagg to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ set enable_hashagg to off;
+ ^
+<sql-statement>
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+</sql-statement>
+<sql-statement>
+reset enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashagg;
+ ^
+<sql-statement>
+-- non-hashable type
+set enable_hashagg to on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- non-hashable type
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+set enable_hashagg to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ set enable_hashagg to off;
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+reset enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashagg;
+ ^
+<sql-statement>
+-- arrays
+set enable_hashagg to on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- arrays
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+-- non-hashable type
+explain (costs off)
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- non-hashable type
+ ^
+<sql-statement>
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: AssumeColumnOrder, At function: AssumeColumnOrder, At function: OrderedMap, At function: OrderedFilter, At function: CountedAggregateAll
+ select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Expected hashable and equatable type for key column: x, but got: _pgmoney
+ select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+ ^
+<sql-statement>
+set enable_hashagg to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ set enable_hashagg to off;
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+</sql-statement>
+<sql-statement>
+reset enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashagg;
+ ^
+<sql-statement>
+-- records
+set enable_hashagg to on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- records
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+-- non-hashable type
+-- With an anonymous row type, the typcache does not report that the
+-- type is hashable. (Otherwise, this would fail at execution time.)
+explain (costs off)
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- non-hashable type
+ ^
+<sql-statement>
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+ ^
+<sql-statement>
+-- With a defined row type, the typcache can inspect the type's fields
+-- for hashability.
+create type ct1 as (f1 money);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314
+ -- With a defined row type, the typcache can inspect the type's fields
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: alternative is not implemented yet : 138
+ select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ ^
+ -stdin-:<main>:1:122: Error: alternative is not implemented yet : 138
+ select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ ^
+<sql-statement>
+drop type ct1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373
+ drop type ct1;
+ ^
+<sql-statement>
+set enable_hashagg to off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ set enable_hashagg to off;
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ ^
+<sql-statement>
+reset enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashagg;
+ ^
+<sql-statement>
+--
+-- Mixed types
+--
+SELECT f1 FROM float8_tbl INTERSECT SELECT f1 FROM int4_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT f1 FROM float8_tbl EXCEPT SELECT f1 FROM int4_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- Operator precedence and (((((extra))))) parentheses
+--
+SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
+</sql-statement>
+<sql-statement>
+(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
+</sql-statement>
+<sql-statement>
+(((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+</sql-statement>
+<sql-statement>
+--
+-- Subqueries with ORDER BY & LIMIT clauses
+--
+-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
+SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
+ORDER BY q2,q1;
+</sql-statement>
+<sql-statement>
+-- This should fail, because q2 isn't a name of an EXCEPT output column
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ -- This should fail, because q2 isn't a name of an EXCEPT output column
+ ^
+ -stdin-:<main>:2:65: Error: No such column: q2
+ SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
+ ^
+<sql-statement>
+-- But this should work:
+SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1))) ORDER BY 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: sortClause should be used only on top
+ -- But this should work:
+ ^
+<sql-statement>
+--
+-- New syntaxes (7.1) permit new tests
+--
+(((((select * from int8_tbl)))));
+</sql-statement>
+<sql-statement>
+--
+-- Check behavior with empty select list (allowed since 9.4)
+--
+select union select;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ --
+ ^
+<sql-statement>
+select intersect select;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select intersect select;
+ ^
+<sql-statement>
+select except select;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select except select;
+ ^
+<sql-statement>
+-- check hashed implementation
+set enable_hashagg = true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- check hashed implementation
+ ^
+<sql-statement>
+set enable_sort = false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ set enable_sort = false;
+ ^
+<sql-statement>
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select from generate_series(1,5) union select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) union select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) union all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) union all select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) intersect select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) intersect select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) intersect all select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) except select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) except select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) except all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) except all select from generate_series(1,3);
+ ^
+<sql-statement>
+-- check sorted implementation
+set enable_hashagg = false;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_hashagg
+ -- check sorted implementation
+ ^
+<sql-statement>
+set enable_sort = true;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_sort
+ set enable_sort = true;
+ ^
+<sql-statement>
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select from generate_series(1,5) union select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) union select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) union all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) union all select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) intersect select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) intersect select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) intersect all select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) except select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) except select from generate_series(1,3);
+ ^
+<sql-statement>
+select from generate_series(1,5) except all select from generate_series(1,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: both values_list and target_list are not allowed to be empty
+ select from generate_series(1,5) except all select from generate_series(1,3);
+ ^
+<sql-statement>
+reset enable_hashagg;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_hashagg;
+ ^
+<sql-statement>
+reset enable_sort;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_sort;
+ ^
+<sql-statement>
+--
+-- Check handling of a case with unknown constants. We don't guarantee
+-- an undecorated constant will work in all cases, but historically this
+-- usage has worked, so test we don't break it.
+--
+SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
+UNION
+SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
+ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- This should fail, but it should produce an error cursor
+SELECT '3.4'::numeric UNION SELECT 'foo';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ -- This should fail, but it should produce an error cursor
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type numeric: "foo"
+
+ -- This should fail, but it should produce an error cursor
+ ^
+<sql-statement>
+--
+-- Test that expression-index constraints can be pushed down through
+-- UNION or UNION ALL
+--
+CREATE TEMP TABLE t1 (a text, b text);
+</sql-statement>
+<sql-statement>
+CREATE INDEX t1_ab_idx on t1 ((a || b));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ CREATE INDEX t1_ab_idx on t1 ((a || b));
+ ^
+<sql-statement>
+CREATE TEMP TABLE t2 (ab text primary key);
+</sql-statement>
+<sql-statement>
+INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
+</sql-statement>
+<sql-statement>
+INSERT INTO t2 VALUES ('ab'), ('xy');
+</sql-statement>
+<sql-statement>
+set enable_seqscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ set enable_seqscan = off;
+ ^
+<sql-statement>
+set enable_indexscan = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_indexscan
+ set enable_indexscan = on;
+ ^
+<sql-statement>
+set enable_bitmapscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan
+ set enable_bitmapscan = off;
+ ^
+<sql-statement>
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+--
+-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
+-- children.
+--
+CREATE TEMP TABLE t1c (b text, a text);
+</sql-statement>
+<sql-statement>
+ALTER TABLE t1c INHERIT t1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE t1c INHERIT t1;
+ ^
+<sql-statement>
+CREATE TEMP TABLE t2c (primary key (ab)) INHERITS (t2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TEMP TABLE t2c (primary key (ab)) INHERITS (t2);
+ ^
+<sql-statement>
+INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
+</sql-statement>
+<sql-statement>
+INSERT INTO t2c VALUES ('vw'), ('cd'), ('mn'), ('ef');
+</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.t2c
+
+<sql-statement>
+CREATE INDEX t1c_ab_idx on t1c ((a || b));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ CREATE INDEX t1c_ab_idx on t1c ((a || b));
+ ^
+<sql-statement>
+set enable_seqscan = on;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan
+ set enable_seqscan = on;
+ ^
+<sql-statement>
+set enable_indexonlyscan = off;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_indexonlyscan
+ set enable_indexonlyscan = off;
+ ^
+<sql-statement>
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+</sql-statement>
+<sql-statement>
+reset enable_seqscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_seqscan;
+ ^
+<sql-statement>
+reset enable_indexscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_indexscan;
+ ^
+<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>
+-- This simpler variant of the above test has been observed to fail differently
+create table events (event_id int primary key);
+</sql-statement>
+<sql-statement>
+create table other_events (event_id int primary key);
+</sql-statement>
+<sql-statement>
+create table events_child () inherits (events);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table events_child () inherits (events);
+ ^
+<sql-statement>
+explain (costs off)
+select event_id
+ from (select event_id from events
+ union all
+ select event_id from other_events) ss
+ order by event_id;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+drop table events_child, events, other_events;
+</sql-statement>
+<sql-statement>
+reset enable_indexonlyscan;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ reset enable_indexonlyscan;
+ ^
+<sql-statement>
+-- Test constraint exclusion of UNION ALL subqueries
+explain (costs off)
+ SELECT * FROM
+ (SELECT 1 AS t, * FROM tenk1 a
+ UNION ALL
+ SELECT 2 AS t, * FROM tenk1 b) c
+ WHERE t = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test constraint exclusion of UNION ALL subqueries
+ ^
+<sql-statement>
+-- Test that we push quals into UNION sub-selects only when it's safe
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test that we push quals into UNION sub-selects only when it's safe
+ ^
+<sql-statement>
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:19: Error: Generator functions are not allowed in: SELECT
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ ^
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT * FROM
+ ^
+ -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term
+ SELECT * FROM
+ ^
+<sql-statement>
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+</sql-statement>
+<sql-statement>
+-- Test cases where the native ordering of a sub-select has more pathkeys
+-- than the outer query cares about
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test cases where the native ordering of a sub-select has more pathkeys
+ ^
+<sql-statement>
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+</sql-statement>
+<sql-statement>
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+</sql-statement>
+<sql-statement>
+-- Test proper handling of parameterized appendrel paths when the
+-- potential join qual is expensive
+create function expensivefunc(int) returns int
+language plpgsql immutable strict cost 10000
+as $$begin return $1; end$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- Test proper handling of parameterized appendrel paths when the
+ ^
+<sql-statement>
+create temp table t3 as select generate_series(-1000,1000) as x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 277
+ create temp table t3 as select generate_series(-1000,1000) as x;
+ ^
+<sql-statement>
+create index t3i on t3 (expensivefunc(x));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: index expression is not supported yet
+ create index t3i on t3 (expensivefunc(x));
+ ^
+<sql-statement>
+analyze t3;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 275
+ analyze t3;
+ ^
+<sql-statement>
+explain (costs off)
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+</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.t3
+
+<sql-statement>
+drop table t3;
+</sql-statement>
+<sql-statement>
+drop function expensivefunc(int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function expensivefunc(int);
+ ^
+<sql-statement>
+-- Test handling of appendrel quals that const-simplify into an AND
+explain (costs off)
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test handling of appendrel quals that const-simplify into an AND
+ ^
+<sql-statement>
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/union.out b/yql/essentials/tests/postgresql/cases/union.out
new file mode 100644
index 0000000000..d285217abb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/union.out
@@ -0,0 +1,465 @@
+--
+-- UNION (also INTERSECT, EXCEPT)
+--
+-- Simple UNION constructs
+SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1 AS two UNION ALL SELECT 2;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS two UNION ALL SELECT 1;
+ two
+-----
+ 1
+ 1
+(2 rows)
+
+SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+ three
+-------
+ 1
+ 2
+ 3
+(3 rows)
+
+SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+ three
+-------
+ 1
+ 2
+ 2
+(3 rows)
+
+SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2.2
+(2 rows)
+
+-- Mixed types
+SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
+ two
+-----
+ 1
+ 2.2
+(2 rows)
+
+SELECT 1 AS one UNION SELECT 1.0::float8 ORDER BY 1;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1.0::float8 AS two UNION ALL SELECT 1 ORDER BY 1;
+ two
+-----
+ 1
+ 1
+(2 rows)
+
+SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+ three
+-------
+ 1.1
+ 2
+ 3
+(3 rows)
+
+SELECT 1.1::float8 AS two UNION SELECT 2 UNION SELECT 2.0::float8 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+ three
+-------
+ 1.1
+ 2
+ 2
+(3 rows)
+
+SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT f1 AS three FROM VARCHAR_TBL
+UNION
+SELECT CAST(f1 AS varchar) FROM CHAR_TBL
+ORDER BY 1;
+ three
+-------
+ a
+ ab
+ abcd
+(3 rows)
+
+SELECT f1 AS eight FROM VARCHAR_TBL
+UNION ALL
+SELECT f1 FROM CHAR_TBL;
+ eight
+-------
+ a
+ ab
+ abcd
+ abcd
+ a
+ ab
+ abcd
+ abcd
+(8 rows)
+
+SELECT f1 AS five FROM TEXT_TBL
+UNION
+SELECT f1 FROM VARCHAR_TBL
+UNION
+SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
+ORDER BY 1;
+ five
+-------------------
+ a
+ ab
+ abcd
+ doh!
+ hi de ho neighbor
+(5 rows)
+
+--
+-- INTERSECT and EXCEPT
+--
+SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+------------------
+ 123
+ 4567890123456789
+ 4567890123456789
+(3 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+ 4567890123456789
+(3 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+ 4567890123456789
+(3 rows)
+
+-- nested cases
+(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 4 | 5 | 6
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 4 | 5 | 6
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 1 | 2 | 3
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 1 | 2 | 3
+(1 row)
+
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ count
+-------
+ 10000
+(1 row)
+
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ count
+-------
+ 5000
+(1 row)
+
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ unique1
+---------
+ 10
+(1 row)
+
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ count
+-------
+ 10000
+(1 row)
+
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ count
+-------
+ 5000
+(1 row)
+
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ unique1
+---------
+ 10
+(1 row)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,2}
+(1 row)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,3}
+(1 row)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,2}
+(1 row)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,3}
+(1 row)
+
+--
+-- Operator precedence and (((((extra))))) parentheses
+--
+SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+ q1
+-------------------
+ -4567890123456789
+ 123
+ 123
+ 456
+ 4567890123456789
+ 4567890123456789
+ 4567890123456789
+(7 rows)
+
+SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
+ q1
+-------------------
+ 123
+ 4567890123456789
+ 456
+ 4567890123456789
+ 123
+ 4567890123456789
+ -4567890123456789
+(7 rows)
+
+SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
+ q1
+-------------------
+ 123
+ 123
+ 4567890123456789
+ 4567890123456789
+ 4567890123456789
+ -4567890123456789
+ 456
+(7 rows)
+
+--
+-- Subqueries with ORDER BY & LIMIT clauses
+--
+-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
+SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
+ORDER BY q2,q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | -4567890123456789
+ 123 | 456
+(2 rows)
+
+--
+-- New syntaxes (7.1) permit new tests
+--
+(((((select * from int8_tbl)))));
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+--
+-- Check handling of a case with unknown constants. We don't guarantee
+-- an undecorated constant will work in all cases, but historically this
+-- usage has worked, so test we don't break it.
+--
+SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
+UNION
+SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
+ORDER BY 1;
+ f1
+------
+ a
+ ab
+ abcd
+ test
+(4 rows)
+
+-- This should fail, but it should produce an error cursor
+SELECT '3.4'::numeric UNION SELECT 'foo';
+ERROR: invalid input syntax for type numeric: "foo"
+LINE 1: SELECT '3.4'::numeric UNION SELECT 'foo';
+ ^
+--
+-- Test that expression-index constraints can be pushed down through
+-- UNION or UNION ALL
+--
+CREATE TEMP TABLE t1 (a text, b text);
+CREATE TEMP TABLE t2 (ab text primary key);
+INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
+INSERT INTO t2 VALUES ('ab'), ('xy');
+--
+-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
+-- children.
+--
+CREATE TEMP TABLE t1c (b text, a text);
+INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
+-- This simpler variant of the above test has been observed to fail differently
+create table events (event_id int primary key);
+create table other_events (event_id int primary key);
+drop table events_child, events, other_events;
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+ t | x
+---+---
+ 1 | 2
+(1 row)
+
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+ t | x
+---+---
+ 2 | 4
+(1 row)
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+ q1
+------------------
+ 4567890123456789
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/union.sql b/yql/essentials/tests/postgresql/cases/union.sql
new file mode 100644
index 0000000000..bc2321c143
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/union.sql
@@ -0,0 +1,132 @@
+--
+-- UNION (also INTERSECT, EXCEPT)
+--
+-- Simple UNION constructs
+SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
+SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
+SELECT 1 AS two UNION ALL SELECT 2;
+SELECT 1 AS two UNION ALL SELECT 1;
+SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
+SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
+-- Mixed types
+SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
+SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
+SELECT 1 AS one UNION SELECT 1.0::float8 ORDER BY 1;
+SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
+SELECT 1.0::float8 AS two UNION ALL SELECT 1 ORDER BY 1;
+SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+SELECT 1.1::float8 AS two UNION SELECT 2 UNION SELECT 2.0::float8 ORDER BY 1;
+SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
+SELECT f1 AS three FROM VARCHAR_TBL
+UNION
+SELECT CAST(f1 AS varchar) FROM CHAR_TBL
+ORDER BY 1;
+SELECT f1 AS eight FROM VARCHAR_TBL
+UNION ALL
+SELECT f1 FROM CHAR_TBL;
+SELECT f1 AS five FROM TEXT_TBL
+UNION
+SELECT f1 FROM VARCHAR_TBL
+UNION
+SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
+ORDER BY 1;
+--
+-- INTERSECT and EXCEPT
+--
+SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
+SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
+-- nested cases
+(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+--
+-- Operator precedence and (((((extra))))) parentheses
+--
+SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
+(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
+SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
+--
+-- Subqueries with ORDER BY & LIMIT clauses
+--
+-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
+SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
+ORDER BY q2,q1;
+--
+-- New syntaxes (7.1) permit new tests
+--
+(((((select * from int8_tbl)))));
+--
+-- Check handling of a case with unknown constants. We don't guarantee
+-- an undecorated constant will work in all cases, but historically this
+-- usage has worked, so test we don't break it.
+--
+SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
+UNION
+SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
+ORDER BY 1;
+-- This should fail, but it should produce an error cursor
+SELECT '3.4'::numeric UNION SELECT 'foo';
+--
+-- Test that expression-index constraints can be pushed down through
+-- UNION or UNION ALL
+--
+CREATE TEMP TABLE t1 (a text, b text);
+CREATE TEMP TABLE t2 (ab text primary key);
+INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
+INSERT INTO t2 VALUES ('ab'), ('xy');
+--
+-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
+-- children.
+--
+CREATE TEMP TABLE t1c (b text, a text);
+INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
+-- This simpler variant of the above test has been observed to fail differently
+create table events (event_id int primary key);
+create table other_events (event_id int primary key);
+drop table events_child, events, other_events;
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
diff --git a/yql/essentials/tests/postgresql/cases/update.err b/yql/essentials/tests/postgresql/cases/update.err
new file mode 100644
index 0000000000..4b2ec7ea75
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/update.err
@@ -0,0 +1,2332 @@
+<sql-statement>
+--
+-- UPDATE syntax tests
+--
+CREATE TABLE update_test (
+ a INT DEFAULT 10,
+ b INT,
+ c TEXT
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO update_test VALUES (5, 10, 'foo');
+</sql-statement>
+<sql-statement>
+INSERT INTO update_test(b, a) VALUES (15, 10);
+</sql-statement>
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 148
+ UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+-- aliases for the UPDATE target table
+UPDATE update_test AS t SET b = 10 WHERE t.a = 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ -- aliases for the UPDATE target table
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+--
+-- Test VALUES in FROM
+--
+UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+</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 update_test;
+</sql-statement>
+<sql-statement>
+-- fail, wrong data type:
+UPDATE update_test SET a = v.* FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+</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 multiple-set-clause syntax
+--
+INSERT INTO update_test SELECT a,b+1,c FROM update_test;
+</sql-statement>
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo';
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10;
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+-- fail, multi assignment to same column:
+UPDATE update_test SET (c,b) = ('car', a+b), b = a + 1 WHERE a = 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- fail, multi assignment to same column:
+ ^
+<sql-statement>
+-- uncorrelated sub-select:
+UPDATE update_test
+ SET (b,a) = (select a,b from update_test where b = 41 and c = 'car')
+ WHERE a = 100 AND b = 20;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- uncorrelated sub-select:
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+-- correlated sub-select:
+UPDATE update_test o
+ SET (b,a) = (select a+1,b from update_test i
+ where i.a=o.a and i.b=o.b and i.c is not distinct from o.c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- correlated sub-select:
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+-- fail, multiple rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- fail, multiple rows supplied:
+ ^
+<sql-statement>
+-- set to null if no rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000)
+ WHERE a = 11;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- set to null if no rows supplied:
+ ^
+<sql-statement>
+SELECT * FROM update_test;
+</sql-statement>
+<sql-statement>
+-- *-expansion should work in this context:
+UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j)
+ WHERE update_test.a = v.i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- *-expansion should work in this context:
+ ^
+<sql-statement>
+-- you might expect this to work, but syntactically it's not a RowExpr:
+UPDATE update_test SET (a,b) = (v.*) FROM (VALUES(21, 101)) AS v(i, j)
+ WHERE update_test.a = v.i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 363
+ -- you might expect this to work, but syntactically it's not a RowExpr:
+ ^
+<sql-statement>
+-- if an alias for the target table is specified, don't allow references
+-- to the original table name
+UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ -- if an alias for the target table is specified, don't allow references
+ ^
+<sql-statement>
+-- Make sure that we can update to a TOASTed value.
+UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car';
+</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, char_length(c) FROM update_test;
+</sql-statement>
+<sql-statement>
+-- Check multi-assignment with a Result node to handle a one-time filter.
+EXPLAIN (VERBOSE, COSTS OFF)
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Check multi-assignment with a Result node to handle a one-time filter.
+ ^
+<sql-statement>
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:24: Error: Usupported SQLValueFunction: 12
+ WHERE CURRENT_USER = SESSION_USER;
+ ^
+<sql-statement>
+SELECT a, b, char_length(c) FROM update_test;
+</sql-statement>
+<sql-statement>
+-- Test ON CONFLICT DO UPDATE
+INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo');
+</sql-statement>
+<sql-statement>
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- uncorrelated sub-select:
+ ^
+<sql-statement>
+-- correlated sub-select:
+INSERT INTO upsert_test VALUES (1, 'Baz'), (3, 'Zaz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Correlated', a from upsert_test i WHERE i.a = upsert_test.a)
+ RETURNING *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- correlated sub-select:
+ ^
+<sql-statement>
+-- correlated sub-select (EXCLUDED.* alias):
+INSERT INTO upsert_test VALUES (1, 'Bat'), (3, 'Zot') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- correlated sub-select (EXCLUDED.* alias):
+ ^
+<sql-statement>
+-- ON CONFLICT using system attributes in RETURNING, testing both the
+-- inserting and updating paths. See bug report at:
+-- https://www.postgresql.org/message-id/73436355-6432-49B1-92ED-1FE4F7E7E100%40finefun.com.au
+INSERT INTO upsert_test VALUES (2, 'Beeble') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = 0 AS xmax_correct;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- ON CONFLICT using system attributes in RETURNING, testing both the
+ ^
+<sql-statement>
+-- currently xmax is set after a conflict - that's probably not good,
+-- but it seems worthwhile to have to be explicit if that changes.
+INSERT INTO upsert_test VALUES (2, 'Brox') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = pg_current_xact_id()::xid AS xmax_correct;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- currently xmax is set after a conflict - that's probably not good,
+ ^
+<sql-statement>
+DROP TABLE update_test;
+</sql-statement>
+<sql-statement>
+DROP TABLE upsert_test;
+</sql-statement>
+<sql-statement>
+-- Test ON CONFLICT DO UPDATE with partitioned table and non-identical children
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+) PARTITION BY LIST (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- Test ON CONFLICT DO UPDATE with partitioned table and non-identical children
+ ^
+<sql-statement>
+CREATE TABLE upsert_test_1 PARTITION OF upsert_test FOR VALUES IN (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE upsert_test_1 PARTITION OF upsert_test FOR VALUES IN (1);
+ ^
+<sql-statement>
+CREATE TABLE upsert_test_2 (b TEXT, a INT PRIMARY KEY);
+</sql-statement>
+<sql-statement>
+ALTER TABLE upsert_test ATTACH PARTITION upsert_test_2 FOR VALUES IN (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE upsert_test ATTACH PARTITION upsert_test_2 FOR VALUES IN (2);
+ ^
+<sql-statement>
+INSERT INTO upsert_test VALUES(1, 'Boo'), (2, 'Zoo');
+</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.upsert_test
+
+<sql-statement>
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- uncorrelated sub-select:
+ ^
+<sql-statement>
+-- correlated sub-select:
+WITH aaa AS (SELECT 1 AS ctea, ' Foo' AS cteb) INSERT INTO upsert_test
+ VALUES (1, 'Bar'), (2, 'Baz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT upsert_test.b||cteb, upsert_test.a FROM aaa) RETURNING *;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause
+ -- correlated sub-select:
+ ^
+<sql-statement>
+DROP TABLE upsert_test;
+</sql-statement>
+<sql-statement>
+---------------------------
+-- UPDATE with row movement
+---------------------------
+-- When a partitioned table receives an UPDATE to the partitioned key and the
+-- new values no longer meet the partition's bound, the row must be moved to
+-- the correct partition for the new partition key (if one exists). We must
+-- also ensure that updatable views on partitioned tables properly enforce any
+-- WITH CHECK OPTION that is defined. The situation with triggers in this case
+-- also requires thorough testing as partition key updates causing row
+-- movement convert UPDATEs into DELETE+INSERT.
+CREATE TABLE range_parted (
+ a text,
+ b bigint,
+ c numeric,
+ d int,
+ e varchar
+) PARTITION BY RANGE (a, b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ ---------------------------
+ ^
+<sql-statement>
+-- Create partitions intentionally in descending bound order, so as to test
+-- that update-row-movement works with the leaf partitions not in bound order.
+CREATE TABLE part_b_20_b_30 (e varchar, c numeric, a text, b bigint, d int);
+</sql-statement>
+<sql-statement>
+ALTER TABLE range_parted ATTACH PARTITION part_b_20_b_30 FOR VALUES FROM ('b', 20) TO ('b', 30);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE range_parted ATTACH PARTITION part_b_20_b_30 FOR VALUES FROM ('b', 20) TO ('b', 30);
+ ^
+<sql-statement>
+CREATE TABLE part_b_10_b_20 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY RANGE (c);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE part_b_10_b_20 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY RANGE (c);
+ ^
+<sql-statement>
+CREATE TABLE part_b_1_b_10 PARTITION OF range_parted FOR VALUES FROM ('b', 1) TO ('b', 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_b_1_b_10 PARTITION OF range_parted FOR VALUES FROM ('b', 1) TO ('b', 10);
+ ^
+<sql-statement>
+ALTER TABLE range_parted ATTACH PARTITION part_b_10_b_20 FOR VALUES FROM ('b', 10) TO ('b', 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE range_parted ATTACH PARTITION part_b_10_b_20 FOR VALUES FROM ('b', 10) TO ('b', 20);
+ ^
+<sql-statement>
+CREATE TABLE part_a_10_a_20 PARTITION OF range_parted FOR VALUES FROM ('a', 10) TO ('a', 20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_a_10_a_20 PARTITION OF range_parted FOR VALUES FROM ('a', 10) TO ('a', 20);
+ ^
+<sql-statement>
+CREATE TABLE part_a_1_a_10 PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('a', 10);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_a_1_a_10 PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('a', 10);
+ ^
+<sql-statement>
+-- Check that partition-key UPDATE works sanely on a partitioned table that
+-- does not have any child partitions.
+UPDATE part_b_10_b_20 set b = b - 6;
+</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>
+-- Create some more partitions following the above pattern of descending bound
+-- order, but let's make the situation a bit more complex by having the
+-- attribute numbers of the columns vary from their parent partition.
+CREATE TABLE part_c_100_200 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY range (abs(d));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- Create some more partitions following the above pattern of descending bound
+ ^
+<sql-statement>
+ALTER TABLE part_c_100_200 DROP COLUMN e, DROP COLUMN c, DROP COLUMN a;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_c_100_200 DROP COLUMN e, DROP COLUMN c, DROP COLUMN a;
+ ^
+<sql-statement>
+ALTER TABLE part_c_100_200 ADD COLUMN c numeric, ADD COLUMN e varchar, ADD COLUMN a text;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_c_100_200 ADD COLUMN c numeric, ADD COLUMN e varchar, ADD COLUMN a text;
+ ^
+<sql-statement>
+ALTER TABLE part_c_100_200 DROP COLUMN b;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_c_100_200 DROP COLUMN b;
+ ^
+<sql-statement>
+ALTER TABLE part_c_100_200 ADD COLUMN b bigint;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_c_100_200 ADD COLUMN b bigint;
+ ^
+<sql-statement>
+CREATE TABLE part_d_1_15 PARTITION OF part_c_100_200 FOR VALUES FROM (1) TO (15);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_d_1_15 PARTITION OF part_c_100_200 FOR VALUES FROM (1) TO (15);
+ ^
+<sql-statement>
+CREATE TABLE part_d_15_20 PARTITION OF part_c_100_200 FOR VALUES FROM (15) TO (20);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE part_d_15_20 PARTITION OF part_c_100_200 FOR VALUES FROM (15) TO (20);
+ ^
+<sql-statement>
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_100_200 FOR VALUES FROM (100) TO (200);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_100_200 FOR VALUES FROM (100) TO (200);
+ ^
+<sql-statement>
+CREATE TABLE part_c_1_100 (e varchar, d int, c numeric, b bigint, a text);
+</sql-statement>
+<sql-statement>
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_1_100 FOR VALUES FROM (1) TO (100);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_1_100 FOR VALUES FROM (1) TO (100);
+ ^
+<sql-statement>
+\set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)'
+</sql-statement>
+Metacommand \set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)' is not supported
+<sql-statement>
+\set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6'
+</sql-statement>
+Metacommand \set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6' is not supported
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- The order of subplans should be in bound order
+EXPLAIN (costs off) UPDATE range_parted set c = c - 50 WHERE c > 97;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- The order of subplans should be in bound order
+ ^
+<sql-statement>
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_c_100_200 set c = c - 20, d = c WHERE c = 105;
+</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>
+-- fail, no partition key update, so no attempt to move tuple,
+-- but "a = 'a'" violates partition constraint enforced by root partition)
+UPDATE part_b_10_b_20 set a = 'a';
+</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>
+-- ok, partition key update, no constraint violation
+UPDATE range_parted set d = d - 10 WHERE d > 10;
+</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>
+-- ok, no partition key update, no constraint violation
+UPDATE range_parted set e = d;
+</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>
+-- No row found
+UPDATE part_c_1_100 set c = c + 20 WHERE c = 98;
+</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>
+-- ok, row movement
+UPDATE part_b_10_b_20 set c = c + 20 returning c, b, a;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_b_10_b_20 set b = b - 6 WHERE c > 116 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>
+-- ok, row movement, with subset of rows moved into different partition.
+UPDATE range_parted set b = b - 6 WHERE c > 116 returning a, b + c;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 353
+ -- ok, row movement, with subset of rows moved into different partition.
+ ^
+<sql-statement>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Common table needed for multiple test scenarios.
+CREATE TABLE mintab(c1 int);
+</sql-statement>
+<sql-statement>
+INSERT into mintab VALUES (120);
+</sql-statement>
+<sql-statement>
+-- update partition key using updatable view.
+CREATE VIEW upview AS SELECT * FROM range_parted WHERE (select c > c1 FROM mintab) WITH CHECK OPTION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- update partition key using updatable view.
+ ^
+<sql-statement>
+-- ok
+UPDATE upview set c = 199 WHERE b = 4;
+</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>
+-- fail, check option violation
+UPDATE upview set c = 120 WHERE b = 4;
+</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>
+-- fail, row movement with check option violation
+UPDATE upview set a = 'b', b = 15, c = 120 WHERE b = 4;
+</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>
+-- ok, row movement, check option passes
+UPDATE upview set a = 'b', b = 15 WHERE b = 4;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- cleanup
+DROP VIEW upview;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'upview'
+ -- cleanup
+ ^
+<sql-statement>
+-- RETURNING having whole-row vars.
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:1: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+UPDATE range_parted set c = 95 WHERE a = 'b' and b > 10 and c > 100 returning (range_parted), *;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Transition tables with update row movement
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:1: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+CREATE FUNCTION trans_updatetrigfunc() RETURNS trigger LANGUAGE plpgsql AS
+$$
+ begin
+ raise notice 'trigger = %, old table = %, new table = %',
+ TG_NAME,
+ (select string_agg(old_table::text, ', ' ORDER BY a) FROM old_table),
+ (select string_agg(new_table::text, ', ' ORDER BY a) FROM new_table);
+ return null;
+ end;
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION trans_updatetrigfunc() RETURNS trigger LANGUAGE plpgsql AS
+ ^
+<sql-statement>
+CREATE TRIGGER trans_updatetrig
+ AFTER UPDATE ON range_parted REFERENCING OLD TABLE AS old_table NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trans_updatetrig
+ ^
+<sql-statement>
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end ) WHERE a = 'b' and b > 10 and c >= 96;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+-- Enabling OLD TABLE capture for both DELETE as well as UPDATE stmt triggers
+-- should not cause DELETEd rows to be captured twice. Similar thing for
+-- INSERT triggers and inserted rows.
+CREATE TRIGGER trans_deletetrig
+ AFTER DELETE ON range_parted REFERENCING OLD TABLE AS old_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ -- Enabling OLD TABLE capture for both DELETE as well as UPDATE stmt triggers
+ ^
+<sql-statement>
+CREATE TRIGGER trans_inserttrig
+ AFTER INSERT ON range_parted REFERENCING NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trans_inserttrig
+ ^
+<sql-statement>
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+DROP TRIGGER trans_deletetrig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trans_deletetrig ON range_parted;
+ ^
+<sql-statement>
+DROP TRIGGER trans_inserttrig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trans_inserttrig ON range_parted;
+ ^
+<sql-statement>
+-- Don't drop trans_updatetrig yet. It is required below.
+-- Test with transition tuple conversion happening for rows moved into the
+-- new partition. This requires a trigger that references transition table
+-- (we already have trans_updatetrig). For inserted rows, the conversion
+-- is not usually needed, because the original tuple is already compatible with
+-- the desired transition tuple format. But conversion happens when there is a
+-- BR trigger because the trigger can change the inserted row. So install a
+-- BR triggers on those child partitions where the rows will be moved.
+CREATE FUNCTION func_parted_mod_b() RETURNS trigger AS $$
+BEGIN
+ NEW.b = NEW.b + 1;
+ return NEW;
+END $$ language plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- Don't drop trans_updatetrig yet. It is required below.
+ ^
+<sql-statement>
+CREATE TRIGGER trig_c1_100 BEFORE UPDATE OR INSERT ON part_c_1_100
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trig_c1_100 BEFORE UPDATE OR INSERT ON part_c_1_100
+ ^
+<sql-statement>
+CREATE TRIGGER trig_d1_15 BEFORE UPDATE OR INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trig_d1_15 BEFORE UPDATE OR INSERT ON part_d_1_15
+ ^
+<sql-statement>
+CREATE TRIGGER trig_d15_20 BEFORE UPDATE OR INSERT ON part_d_15_20
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trig_d15_20 BEFORE UPDATE OR INSERT ON part_d_15_20
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end) WHERE a = 'b' and b > 10 and c >= 96;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Case where per-partition tuple conversion map array is allocated, but the
+-- map is not required for the particular tuple that is routed, thanks to
+-- matching table attributes of the partition and the target table.
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:1: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+UPDATE range_parted set b = 15 WHERE b = 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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+DROP TRIGGER trans_updatetrig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trans_updatetrig ON range_parted;
+ ^
+<sql-statement>
+DROP TRIGGER trig_c1_100 ON part_c_1_100;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trig_c1_100 ON part_c_1_100;
+ ^
+<sql-statement>
+DROP TRIGGER trig_d1_15 ON part_d_1_15;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trig_d1_15 ON part_d_1_15;
+ ^
+<sql-statement>
+DROP TRIGGER trig_d15_20 ON part_d_15_20;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trig_d15_20 ON part_d_15_20;
+ ^
+<sql-statement>
+DROP FUNCTION func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION func_parted_mod_b();
+ ^
+<sql-statement>
+-- RLS policies with update-row-movement
+-----------------------------------------
+ALTER TABLE range_parted ENABLE ROW LEVEL SECURITY;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ -- RLS policies with update-row-movement
+ ^
+<sql-statement>
+CREATE USER regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 285
+ CREATE USER regress_range_parted_user;
+ ^
+<sql-statement>
+GRANT ALL ON range_parted, mintab TO regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ GRANT ALL ON range_parted, mintab TO regress_range_parted_user;
+ ^
+<sql-statement>
+CREATE POLICY seeall ON range_parted AS PERMISSIVE FOR SELECT USING (true);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:42: Error: ERROR: unrecognized row security option "PERMISSIVE"
+
+ CREATE POLICY seeall ON range_parted AS PERMISSIVE FOR SELECT USING (true);
+ ^
+<sql-statement>
+CREATE POLICY policy_range_parted ON range_parted for UPDATE USING (true) WITH CHECK (c % 2 = 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 340
+ CREATE POLICY policy_range_parted ON range_parted for UPDATE USING (true) WITH CHECK (c % 2 = 0);
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- This should fail with RLS violation error while moving row from
+-- part_a_10_a_20 to part_d_1_15, because we are setting 'c' to an odd number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+</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>
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET SESSION AUTHORIZATION;
+ ^
+<sql-statement>
+-- Create a trigger on part_d_1_15
+CREATE FUNCTION func_d_1_15() RETURNS trigger AS $$
+BEGIN
+ NEW.c = NEW.c + 1; -- Make even numbers odd, or vice versa
+ return NEW;
+END $$ LANGUAGE plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- Create a trigger on part_d_1_15
+ ^
+<sql-statement>
+CREATE TRIGGER trig_d_1_15 BEFORE INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_d_1_15();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trig_d_1_15 BEFORE INSERT ON part_d_1_15
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- Here, RLS checks should succeed while moving row from part_a_10_a_20 to
+-- part_d_1_15. Even though the UPDATE is setting 'c' to an odd number, the
+-- trigger at the destination partition again makes it an even number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+</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>
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET SESSION AUTHORIZATION;
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- This should fail with RLS violation error. Even though the UPDATE is setting
+-- 'c' to an even number, the trigger at the destination partition again makes
+-- it an odd number.
+UPDATE range_parted set a = 'b', c = 150 WHERE a = 'a' and c = 200;
+</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>
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ -- Cleanup
+ ^
+<sql-statement>
+DROP TRIGGER trig_d_1_15 ON part_d_1_15;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER trig_d_1_15 ON part_d_1_15;
+ ^
+<sql-statement>
+DROP FUNCTION func_d_1_15();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION func_d_1_15();
+ ^
+<sql-statement>
+-- Policy expression contains SubPlan
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ -- Policy expression contains SubPlan
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+CREATE POLICY policy_range_parted_subplan on range_parted
+ AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK ((SELECT range_parted.c <= c1 FROM mintab));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:8: Error: ERROR: unrecognized row security option "RESTRICTIVE"
+
+ AS RESTRICTIVE for UPDATE USING (true)
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- fail, mintab has row with c1 = 120
+UPDATE range_parted set a = 'b', c = 122 WHERE a = 'a' and c = 200;
+</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>
+-- ok
+UPDATE range_parted set a = 'b', c = 120 WHERE a = 'a' and c = 200;
+</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>
+-- RLS policy expression contains whole row.
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ -- RLS policy expression contains whole row.
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+CREATE POLICY policy_range_parted_wholerow on range_parted AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK (range_parted = row('b', 10, 112, 1, NULL)::range_parted);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:64: Error: ERROR: unrecognized row security option "RESTRICTIVE"
+
+ CREATE POLICY policy_range_parted_wholerow on range_parted AS RESTRICTIVE for UPDATE USING (true)
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- ok, should pass the RLS check
+UPDATE range_parted set a = 'b', c = 112 WHERE a = 'a' and c = 200;
+</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>
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ RESET SESSION AUTHORIZATION;
+ ^
+<sql-statement>
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+SET SESSION AUTHORIZATION regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: session_authorization
+ SET SESSION AUTHORIZATION regress_range_parted_user;
+ ^
+<sql-statement>
+-- fail, the whole row RLS check should fail
+UPDATE range_parted set a = 'b', c = 116 WHERE a = 'a' and c = 200;
+</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>
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
+ -- Cleanup
+ ^
+<sql-statement>
+DROP POLICY policy_range_parted ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP POLICY policy_range_parted ON range_parted;
+ ^
+<sql-statement>
+DROP POLICY policy_range_parted_subplan ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP POLICY policy_range_parted_subplan ON range_parted;
+ ^
+<sql-statement>
+DROP POLICY policy_range_parted_wholerow ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP POLICY policy_range_parted_wholerow ON range_parted;
+ ^
+<sql-statement>
+REVOKE ALL ON range_parted, mintab FROM regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 248
+ REVOKE ALL ON range_parted, mintab FROM regress_range_parted_user;
+ ^
+<sql-statement>
+DROP USER regress_range_parted_user;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 287
+ DROP USER regress_range_parted_user;
+ ^
+<sql-statement>
+DROP TABLE mintab;
+</sql-statement>
+<sql-statement>
+-- statement triggers with update row movement
+---------------------------------------------------
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:1: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+CREATE FUNCTION trigfunc() returns trigger language plpgsql as
+$$
+ begin
+ raise notice 'trigger = % fired on table % during %',
+ TG_NAME, TG_TABLE_NAME, TG_OP;
+ return null;
+ end;
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION trigfunc() returns trigger language plpgsql as
+ ^
+<sql-statement>
+-- Triggers on root partition
+CREATE TRIGGER parent_delete_trig
+ AFTER DELETE ON range_parted for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ -- Triggers on root partition
+ ^
+<sql-statement>
+CREATE TRIGGER parent_update_trig
+ AFTER UPDATE ON range_parted for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER parent_update_trig
+ ^
+<sql-statement>
+CREATE TRIGGER parent_insert_trig
+ AFTER INSERT ON range_parted for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER parent_insert_trig
+ ^
+<sql-statement>
+-- Triggers on leaf partition part_c_1_100
+CREATE TRIGGER c1_delete_trig
+ AFTER DELETE ON part_c_1_100 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ -- Triggers on leaf partition part_c_1_100
+ ^
+<sql-statement>
+CREATE TRIGGER c1_update_trig
+ AFTER UPDATE ON part_c_1_100 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER c1_update_trig
+ ^
+<sql-statement>
+CREATE TRIGGER c1_insert_trig
+ AFTER INSERT ON part_c_1_100 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER c1_insert_trig
+ ^
+<sql-statement>
+-- Triggers on leaf partition part_d_1_15
+CREATE TRIGGER d1_delete_trig
+ AFTER DELETE ON part_d_1_15 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ -- Triggers on leaf partition part_d_1_15
+ ^
+<sql-statement>
+CREATE TRIGGER d1_update_trig
+ AFTER UPDATE ON part_d_1_15 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER d1_update_trig
+ ^
+<sql-statement>
+CREATE TRIGGER d1_insert_trig
+ AFTER INSERT ON part_d_1_15 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER d1_insert_trig
+ ^
+<sql-statement>
+-- Triggers on leaf partition part_d_15_20
+CREATE TRIGGER d15_delete_trig
+ AFTER DELETE ON part_d_15_20 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ -- Triggers on leaf partition part_d_15_20
+ ^
+<sql-statement>
+CREATE TRIGGER d15_update_trig
+ AFTER UPDATE ON part_d_15_20 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER d15_update_trig
+ ^
+<sql-statement>
+CREATE TRIGGER d15_insert_trig
+ AFTER INSERT ON part_d_15_20 for each statement execute procedure trigfunc();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER d15_insert_trig
+ ^
+<sql-statement>
+-- Move all rows from part_c_100_200 to part_c_1_100. None of the delete or
+-- insert statement triggers should be fired.
+UPDATE range_parted set c = c - 50 WHERE c > 97;
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+DROP TRIGGER parent_delete_trig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER parent_delete_trig ON range_parted;
+ ^
+<sql-statement>
+DROP TRIGGER parent_update_trig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER parent_update_trig ON range_parted;
+ ^
+<sql-statement>
+DROP TRIGGER parent_insert_trig ON range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER parent_insert_trig ON range_parted;
+ ^
+<sql-statement>
+DROP TRIGGER c1_delete_trig ON part_c_1_100;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER c1_delete_trig ON part_c_1_100;
+ ^
+<sql-statement>
+DROP TRIGGER c1_update_trig ON part_c_1_100;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER c1_update_trig ON part_c_1_100;
+ ^
+<sql-statement>
+DROP TRIGGER c1_insert_trig ON part_c_1_100;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER c1_insert_trig ON part_c_1_100;
+ ^
+<sql-statement>
+DROP TRIGGER d1_delete_trig ON part_d_1_15;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d1_delete_trig ON part_d_1_15;
+ ^
+<sql-statement>
+DROP TRIGGER d1_update_trig ON part_d_1_15;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d1_update_trig ON part_d_1_15;
+ ^
+<sql-statement>
+DROP TRIGGER d1_insert_trig ON part_d_1_15;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d1_insert_trig ON part_d_1_15;
+ ^
+<sql-statement>
+DROP TRIGGER d15_delete_trig ON part_d_15_20;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d15_delete_trig ON part_d_15_20;
+ ^
+<sql-statement>
+DROP TRIGGER d15_update_trig ON part_d_15_20;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d15_update_trig ON part_d_15_20;
+ ^
+<sql-statement>
+DROP TRIGGER d15_insert_trig ON part_d_15_20;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER d15_insert_trig ON part_d_15_20;
+ ^
+<sql-statement>
+-- Creating default partition for range
+:init_range_parted;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:1: Error: ERROR: syntax error at or near ":"
+
+ :init_range_parted;
+ ^
+<sql-statement>
+create table part_def partition of range_parted default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table part_def partition of range_parted default;
+ ^
+<sql-statement>
+\d+ part_def
+</sql-statement>
+Metacommand \d+ part_def is not supported
+<sql-statement>
+insert into range_parted values ('c', 9);
+</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.range_parted
+
+<sql-statement>
+-- ok
+update part_def set a = 'd' where a = 'c';
+</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>
+-- fail
+update part_def set a = 'a' where a = 'd';
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Update row movement from non-default to default partition.
+-- fail, default partition is not under part_a_10_a_20;
+UPDATE part_a_10_a_20 set a = 'ad' WHERE a = 'a';
+</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>
+-- ok
+UPDATE range_parted set a = 'ad' WHERE a = 'a';
+</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 range_parted set a = 'bd' WHERE a = 'b';
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Update row movement from default to non-default partitions.
+-- ok
+UPDATE range_parted set a = 'a' WHERE a = 'ad';
+</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 range_parted set a = 'b' WHERE a = 'bd';
+</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>
+:show_data;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:2: Error: ERROR: syntax error at or near ":"
+
+ :show_data;
+ ^
+<sql-statement>
+-- Cleanup: range_parted no longer needed.
+DROP TABLE range_parted;
+</sql-statement>
+<sql-statement>
+CREATE TABLE list_parted (
+ a text,
+ b int
+) PARTITION BY list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ CREATE TABLE list_parted (
+ ^
+<sql-statement>
+CREATE TABLE list_part1 PARTITION OF list_parted for VALUES in ('a', 'b');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE list_part1 PARTITION OF list_parted for VALUES in ('a', 'b');
+ ^
+<sql-statement>
+CREATE TABLE list_default PARTITION OF list_parted default;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE list_default PARTITION OF list_parted default;
+ ^
+<sql-statement>
+INSERT into list_part1 VALUES ('a', 1);
+</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.list_part1
+
+<sql-statement>
+INSERT into list_default VALUES ('d', 10);
+</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.list_default
+
+<sql-statement>
+-- fail
+UPDATE list_default set a = 'a' WHERE a = 'd';
+</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>
+-- ok
+UPDATE list_default set a = 'x' WHERE a = 'd';
+</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>
+DROP TABLE list_parted;
+</sql-statement>
+<sql-statement>
+-- Test retrieval of system columns with non-consistent partition row types.
+-- This is only partially supported, as seen in the results.
+create table utrtest (a int, b text) partition by list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ -- Test retrieval of system columns with non-consistent partition row types.
+ ^
+<sql-statement>
+create table utr1 (a int check (a in (1)), q text, b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ create table utr1 (a int check (a in (1)), q text, b text);
+ ^
+<sql-statement>
+create table utr2 (a int check (a in (2)), b text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: column constraint not supported
+ create table utr2 (a int check (a in (2)), b text);
+ ^
+<sql-statement>
+alter table utr1 drop column q;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table utr1 drop column q;
+ ^
+<sql-statement>
+alter table utrtest attach partition utr1 for values in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table utrtest attach partition utr1 for values in (1);
+ ^
+<sql-statement>
+alter table utrtest attach partition utr2 for values in (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ alter table utrtest attach partition utr2 for values in (2);
+ ^
+<sql-statement>
+insert into utrtest values (1, 'foo')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ insert into utrtest values (1, 'foo')
+ ^
+<sql-statement>
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ insert into utrtest values (2, 'bar')
+ ^
+<sql-statement>
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ insert into utrtest values (2, 'bar')
+ ^
+<sql-statement>
+update utrtest set b = b || b from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ update utrtest set b = b || b from (values (1), (2)) s(x) where a = s.x
+ ^
+<sql-statement>
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ ^
+<sql-statement>
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ ^
+<sql-statement>
+delete from utrtest
+ returning *, tableoid::regclass, xmax = pg_current_xact_id()::xid as xmax_ok;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 364
+ delete from utrtest
+ ^
+<sql-statement>
+drop table utrtest;
+</sql-statement>
+<sql-statement>
+--------------
+-- Some more update-partition-key test scenarios below. This time use list
+-- partitions.
+--------------
+-- Setup for list partitions
+CREATE TABLE list_parted (a numeric, b int, c int8) PARTITION BY list (a);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ --------------
+ ^
+<sql-statement>
+CREATE TABLE sub_parted PARTITION OF list_parted for VALUES in (1) PARTITION BY list (b);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ CREATE TABLE sub_parted PARTITION OF list_parted for VALUES in (1) PARTITION BY list (b);
+ ^
+<sql-statement>
+CREATE TABLE sub_part1(b int, c int8, a numeric);
+</sql-statement>
+<sql-statement>
+ALTER TABLE sub_parted ATTACH PARTITION sub_part1 for VALUES in (1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE sub_parted ATTACH PARTITION sub_part1 for VALUES in (1);
+ ^
+<sql-statement>
+CREATE TABLE sub_part2(b int, c int8, a numeric);
+</sql-statement>
+<sql-statement>
+ALTER TABLE sub_parted ATTACH PARTITION sub_part2 for VALUES in (2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE sub_parted ATTACH PARTITION sub_part2 for VALUES in (2);
+ ^
+<sql-statement>
+CREATE TABLE list_part1(a numeric, b int, c int8);
+</sql-statement>
+<sql-statement>
+ALTER TABLE list_parted ATTACH PARTITION list_part1 for VALUES in (2,3);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 245
+ ALTER TABLE list_parted ATTACH PARTITION list_part1 for VALUES in (2,3);
+ ^
+<sql-statement>
+INSERT into list_parted VALUES (2,5,50);
+</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.list_parted
+
+<sql-statement>
+INSERT into list_parted VALUES (3,6,60);
+</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.list_parted
+
+<sql-statement>
+INSERT into sub_parted VALUES (1,1,60);
+</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.sub_parted
+
+<sql-statement>
+INSERT into sub_parted VALUES (1,2,10);
+</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.sub_parted
+
+<sql-statement>
+-- Test partition constraint violation when intermediate ancestor is used and
+-- constraint is inherited from upper root.
+UPDATE sub_parted set a = 2 WHERE c = 10;
+</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 update-partition-key, where the unpruned partitions do not have their
+-- partition keys updated.
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+</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.list_parted
+
+<sql-statement>
+UPDATE list_parted set b = c + a WHERE a = 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>
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+</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.list_parted
+
+<sql-statement>
+-- Test the case where BR UPDATE triggers change the partition key.
+CREATE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ NEW.b = 2; -- This is changing partition key column.
+ return NEW;
+END $$ LANGUAGE plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- Test the case where BR UPDATE triggers change the partition key.
+ ^
+<sql-statement>
+CREATE TRIGGER parted_mod_b before update on sub_part1
+ for each row execute procedure func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER parted_mod_b before update on sub_part1
+ ^
+<sql-statement>
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+</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.list_parted
+
+<sql-statement>
+-- This should do the tuple routing even though there is no explicit
+-- partition-key update, because there is a trigger on sub_part1.
+UPDATE list_parted set c = 70 WHERE b = 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 tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+</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.list_parted
+
+<sql-statement>
+DROP TRIGGER parted_mod_b ON sub_part1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ DROP TRIGGER parted_mod_b ON sub_part1;
+ ^
+<sql-statement>
+-- If BR DELETE trigger prevented DELETE from happening, we should also skip
+-- the INSERT if that delete is part of UPDATE=>DELETE+INSERT.
+CREATE OR REPLACE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ raise notice 'Trigger: Got OLD row %, but returning NULL', OLD;
+ return NULL;
+END $$ LANGUAGE plpgsql;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- If BR DELETE trigger prevented DELETE from happening, we should also skip
+ ^
+<sql-statement>
+CREATE TRIGGER trig_skip_delete before delete on sub_part2
+ for each row execute procedure func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 283
+ CREATE TRIGGER trig_skip_delete before delete on sub_part2
+ ^
+<sql-statement>
+UPDATE list_parted set b = 1 WHERE c = 70;
+</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 tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+</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.list_parted
+
+<sql-statement>
+-- Drop the trigger. Now the row should be moved.
+DROP TRIGGER trig_skip_delete ON sub_part2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ -- Drop the trigger. Now the row should be moved.
+ ^
+<sql-statement>
+UPDATE list_parted set b = 1 WHERE c = 70;
+</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 tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+</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.list_parted
+
+<sql-statement>
+DROP FUNCTION func_parted_mod_b();
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ DROP FUNCTION func_parted_mod_b();
+ ^
+<sql-statement>
+-- UPDATE partition-key with FROM clause. If join produces multiple output
+-- rows for the same row to be modified, we should tuple-route the row only
+-- once. There should not be any rows inserted.
+CREATE TABLE non_parted (id int);
+</sql-statement>
+<sql-statement>
+INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3);
+</sql-statement>
+<sql-statement>
+UPDATE list_parted t1 set a = 2 FROM non_parted t2 WHERE t1.a = t2.id and a = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alias is not supported
+ UPDATE list_parted t1 set a = 2 FROM non_parted t2 WHERE t1.a = t2.id and a = 1;
+ ^
+<sql-statement>
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+</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.list_parted
+
+<sql-statement>
+DROP TABLE non_parted;
+</sql-statement>
+<sql-statement>
+-- Cleanup: list_parted no longer needed.
+DROP TABLE list_parted;
+</sql-statement>
+<sql-statement>
+-- create custom operator class and hash function, for the same reason
+-- explained in alter_table.sql
+create or replace function dummy_hashint4(a int4, seed int8) returns int8 as
+$$ begin return (a + seed); end; $$ language 'plpgsql' immutable;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- create custom operator class and hash function, for the same reason
+ ^
+<sql-statement>
+create operator class custom_opclass for type int4 using hash as
+operator 1 = , function 2 dummy_hashint4(int4, int8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
+ create operator class custom_opclass for type int4 using hash as
+ ^
+<sql-statement>
+create table hash_parted (
+ a int,
+ b int
+) partition by hash (a custom_opclass, b custom_opclass);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: PARTITION BY clause not supported
+ create table hash_parted (
+ ^
+<sql-statement>
+create table hpart1 partition of hash_parted for values with (modulus 2, remainder 1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart1 partition of hash_parted for values with (modulus 2, remainder 1);
+ ^
+<sql-statement>
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+ ^
+<sql-statement>
+create table hpart3 partition of hash_parted for values with (modulus 8, remainder 0);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart3 partition of hash_parted for values with (modulus 8, remainder 0);
+ ^
+<sql-statement>
+create table hpart4 partition of hash_parted for values with (modulus 8, remainder 4);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: table inheritance not supported
+ create table hpart4 partition of hash_parted for values with (modulus 8, remainder 4);
+ ^
+<sql-statement>
+insert into hpart1 values (1, 1);
+</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.hpart1
+
+<sql-statement>
+insert into hpart2 values (2, 5);
+</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.hpart2
+
+<sql-statement>
+insert into hpart4 values (3, 4);
+</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.hpart4
+
+<sql-statement>
+-- fail
+update hpart1 set a = 3, b=4 where a = 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>
+-- ok, row movement
+update hash_parted set b = b - 1 where b = 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>
+-- ok
+update hash_parted set b = b + 8 where b = 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>
+-- cleanup
+drop table hash_parted;
+</sql-statement>
+<sql-statement>
+drop operator class custom_opclass using hash;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: Not supported object type for DROP
+ drop operator class custom_opclass using hash;
+ ^
+<sql-statement>
+drop function dummy_hashint4(a int4, seed int8);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386
+ drop function dummy_hashint4(a int4, seed int8);
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/update.out b/yql/essentials/tests/postgresql/cases/update.out
new file mode 100644
index 0000000000..1d5832a5a5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/update.out
@@ -0,0 +1,49 @@
+--
+-- UPDATE syntax tests
+--
+CREATE TABLE update_test (
+ a INT DEFAULT 10,
+ b INT,
+ c TEXT
+);
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+);
+INSERT INTO update_test VALUES (5, 10, 'foo');
+INSERT INTO update_test(b, a) VALUES (15, 10);
+SELECT * FROM update_test;
+ a | b | c
+----+----+-----
+ 5 | 10 | foo
+ 10 | 15 |
+(2 rows)
+
+--
+-- Test multiple-set-clause syntax
+--
+INSERT INTO update_test SELECT a,b+1,c FROM update_test;
+-- Test ON CONFLICT DO UPDATE
+INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo');
+DROP TABLE update_test;
+DROP TABLE upsert_test;
+CREATE TABLE upsert_test_2 (b TEXT, a INT PRIMARY KEY);
+-- Create partitions intentionally in descending bound order, so as to test
+-- that update-row-movement works with the leaf partitions not in bound order.
+CREATE TABLE part_b_20_b_30 (e varchar, c numeric, a text, b bigint, d int);
+CREATE TABLE part_c_1_100 (e varchar, d int, c numeric, b bigint, a text);
+\set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)'
+\set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6'
+-- Common table needed for multiple test scenarios.
+CREATE TABLE mintab(c1 int);
+INSERT into mintab VALUES (120);
+DROP TABLE mintab;
+CREATE TABLE sub_part1(b int, c int8, a numeric);
+CREATE TABLE sub_part2(b int, c int8, a numeric);
+CREATE TABLE list_part1(a numeric, b int, c int8);
+-- UPDATE partition-key with FROM clause. If join produces multiple output
+-- rows for the same row to be modified, we should tuple-route the row only
+-- once. There should not be any rows inserted.
+CREATE TABLE non_parted (id int);
+INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3);
+DROP TABLE non_parted;
diff --git a/yql/essentials/tests/postgresql/cases/update.sql b/yql/essentials/tests/postgresql/cases/update.sql
new file mode 100644
index 0000000000..bb17fb332b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/update.sql
@@ -0,0 +1,43 @@
+--
+-- UPDATE syntax tests
+--
+CREATE TABLE update_test (
+ a INT DEFAULT 10,
+ b INT,
+ c TEXT
+);
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+);
+INSERT INTO update_test VALUES (5, 10, 'foo');
+INSERT INTO update_test(b, a) VALUES (15, 10);
+SELECT * FROM update_test;
+--
+-- Test multiple-set-clause syntax
+--
+INSERT INTO update_test SELECT a,b+1,c FROM update_test;
+-- Test ON CONFLICT DO UPDATE
+INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo');
+DROP TABLE update_test;
+DROP TABLE upsert_test;
+CREATE TABLE upsert_test_2 (b TEXT, a INT PRIMARY KEY);
+-- Create partitions intentionally in descending bound order, so as to test
+-- that update-row-movement works with the leaf partitions not in bound order.
+CREATE TABLE part_b_20_b_30 (e varchar, c numeric, a text, b bigint, d int);
+CREATE TABLE part_c_1_100 (e varchar, d int, c numeric, b bigint, a text);
+\set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)'
+\set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6'
+-- Common table needed for multiple test scenarios.
+CREATE TABLE mintab(c1 int);
+INSERT into mintab VALUES (120);
+DROP TABLE mintab;
+CREATE TABLE sub_part1(b int, c int8, a numeric);
+CREATE TABLE sub_part2(b int, c int8, a numeric);
+CREATE TABLE list_part1(a numeric, b int, c int8);
+-- UPDATE partition-key with FROM clause. If join produces multiple output
+-- rows for the same row to be modified, we should tuple-route the row only
+-- once. There should not be any rows inserted.
+CREATE TABLE non_parted (id int);
+INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3);
+DROP TABLE non_parted;
diff --git a/yql/essentials/tests/postgresql/cases/uuid.err b/yql/essentials/tests/postgresql/cases/uuid.err
new file mode 100644
index 0000000000..1e3d24f91a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/uuid.err
@@ -0,0 +1,209 @@
+<sql-statement>
+-- regression test for the uuid datatype
+-- creating test tables
+CREATE TABLE guid1
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+</sql-statement>
+<sql-statement>
+CREATE TABLE guid2
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+</sql-statement>
+<sql-statement>
+-- inserting invalid data tests
+-- too long
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- inserting invalid data tests
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "11111111-1111-1111-1111-111111111111F"
+
+ -- inserting invalid data tests
+ ^
+<sql-statement>
+-- too short
+INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- too short
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "{11111111-1111-1111-1111-11111111111}"
+
+ -- too short
+ ^
+<sql-statement>
+-- valid data but invalid format
+INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- valid data but invalid format
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "111-11111-1111-1111-1111-111111111111"
+
+ -- valid data but invalid format
+ ^
+<sql-statement>
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "{22222222-2222-2222-2222-222222222222 "
+
+ INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+ ^
+<sql-statement>
+-- invalid data
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ -- invalid data
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "11111111-1111-1111-G111-111111111111"
+
+ -- invalid data
+ ^
+<sql-statement>
+INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type uuid: "11+11111-1111-1111-1111-111111111111"
+
+ INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+ ^
+<sql-statement>
+--inserting three input formats
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+</sql-statement>
+<sql-statement>
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+</sql-statement>
+<sql-statement>
+INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+</sql-statement>
+<sql-statement>
+-- retrieving the inserted data
+SELECT guid_field FROM guid1;
+</sql-statement>
+<sql-statement>
+-- ordering test
+SELECT guid_field FROM guid1 ORDER BY guid_field ASC;
+</sql-statement>
+<sql-statement>
+SELECT guid_field FROM guid1 ORDER BY guid_field DESC;
+</sql-statement>
+<sql-statement>
+-- = operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e';
+</sql-statement>
+<sql-statement>
+-- <> operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111';
+</sql-statement>
+<sql-statement>
+-- < operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222';
+</sql-statement>
+<sql-statement>
+-- <= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222';
+</sql-statement>
+<sql-statement>
+-- > operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222';
+</sql-statement>
+<sql-statement>
+-- >= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222';
+</sql-statement>
+<sql-statement>
+-- btree and hash index creation test
+CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
+</sql-statement>
+<sql-statement>
+CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
+</sql-statement>
+<sql-statement>
+-- unique index test
+CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: unique index creation is not supported yet
+ -- unique index test
+ ^
+<sql-statement>
+-- should fail
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+</sql-statement>
+<sql-statement>
+-- check to see whether the new indexes are actually there
+SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
+</sql-statement>
+<sql-statement>
+-- populating the test tables with additional records
+INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444');
+</sql-statement>
+<sql-statement>
+INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+</sql-statement>
+<sql-statement>
+INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+</sql-statement>
+<sql-statement>
+INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+</sql-statement>
+<sql-statement>
+-- join test
+SELECT COUNT(*) FROM guid1 g1 INNER JOIN guid2 g2 ON g1.guid_field = g2.guid_field;
+</sql-statement>
+<sql-statement>
+SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL;
+</sql-statement>
+<sql-statement>
+-- generation test
+TRUNCATE guid1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257
+ -- generation test
+ ^
+<sql-statement>
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+</sql-statement>
+<sql-statement>
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+</sql-statement>
+<sql-statement>
+SELECT count(DISTINCT guid_field) FROM guid1;
+</sql-statement>
+<sql-statement>
+-- clean up
+DROP TABLE guid1, guid2 CASCADE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: CASCADE is not implemented
+ -- clean up
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/uuid.out b/yql/essentials/tests/postgresql/cases/uuid.out
new file mode 100644
index 0000000000..2221e36d43
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/uuid.out
@@ -0,0 +1,129 @@
+-- regression test for the uuid datatype
+-- creating test tables
+CREATE TABLE guid1
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+CREATE TABLE guid2
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+-- inserting invalid data tests
+-- too long
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F');
+ERROR: invalid input syntax for type uuid: "11111111-1111-1111-1111-111111111111F"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-111...
+ ^
+-- too short
+INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}');
+ERROR: invalid input syntax for type uuid: "{11111111-1111-1111-1111-11111111111}"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-11...
+ ^
+-- valid data but invalid format
+INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111');
+ERROR: invalid input syntax for type uuid: "111-11111-1111-1111-1111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-11...
+ ^
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+ERROR: invalid input syntax for type uuid: "{22222222-2222-2222-2222-222222222222 "
+LINE 1: INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-22...
+ ^
+-- invalid data
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111');
+ERROR: invalid input syntax for type uuid: "11111111-1111-1111-G111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G11...
+ ^
+INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+ERROR: invalid input syntax for type uuid: "11+11111-1111-1111-1111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-111...
+ ^
+--inserting three input formats
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+-- retrieving the inserted data
+SELECT guid_field FROM guid1;
+ guid_field
+--------------------------------------
+ 11111111-1111-1111-1111-111111111111
+ 22222222-2222-2222-2222-222222222222
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+(3 rows)
+
+-- ordering test
+SELECT guid_field FROM guid1 ORDER BY guid_field ASC;
+ guid_field
+--------------------------------------
+ 11111111-1111-1111-1111-111111111111
+ 22222222-2222-2222-2222-222222222222
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+(3 rows)
+
+SELECT guid_field FROM guid1 ORDER BY guid_field DESC;
+ guid_field
+--------------------------------------
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+ 22222222-2222-2222-2222-222222222222
+ 11111111-1111-1111-1111-111111111111
+(3 rows)
+
+-- = operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e';
+ count
+-------
+ 1
+(1 row)
+
+-- <> operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111';
+ count
+-------
+ 2
+(1 row)
+
+-- < operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 1
+(1 row)
+
+-- <= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 2
+(1 row)
+
+-- > operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 1
+(1 row)
+
+-- >= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 2
+(1 row)
+
+-- btree and hash index creation test
+CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
+CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
+-- populating the test tables with additional records
+INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444');
+INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL;
+ count
+-------
+ 1
+(1 row)
+
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
diff --git a/yql/essentials/tests/postgresql/cases/uuid.sql b/yql/essentials/tests/postgresql/cases/uuid.sql
new file mode 100644
index 0000000000..1aad4025e3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/uuid.sql
@@ -0,0 +1,55 @@
+-- regression test for the uuid datatype
+-- creating test tables
+CREATE TABLE guid1
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+CREATE TABLE guid2
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+-- inserting invalid data tests
+-- too long
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F');
+-- too short
+INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}');
+-- valid data but invalid format
+INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+-- invalid data
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+--inserting three input formats
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+-- retrieving the inserted data
+SELECT guid_field FROM guid1;
+-- ordering test
+SELECT guid_field FROM guid1 ORDER BY guid_field ASC;
+SELECT guid_field FROM guid1 ORDER BY guid_field DESC;
+-- = operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e';
+-- <> operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111';
+-- < operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222';
+-- <= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222';
+-- > operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222';
+-- >= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222';
+-- btree and hash index creation test
+CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
+CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
+-- populating the test tables with additional records
+INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444');
+INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL;
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
diff --git a/yql/essentials/tests/postgresql/cases/varchar.err b/yql/essentials/tests/postgresql/cases/varchar.err
new file mode 100644
index 0000000000..6f5db506f3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/varchar.err
@@ -0,0 +1,93 @@
+<sql-statement>
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/varchar.err.1 b/yql/essentials/tests/postgresql/cases/varchar.err.1
new file mode 100644
index 0000000000..6f5db506f3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/varchar.err.1
@@ -0,0 +1,93 @@
+<sql-statement>
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/varchar.err.2 b/yql/essentials/tests/postgresql/cases/varchar.err.2
new file mode 100644
index 0000000000..6f5db506f3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/varchar.err.2
@@ -0,0 +1,93 @@
+<sql-statement>
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+</sql-statement>
+<sql-statement>
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+</sql-statement>
+<sql-statement>
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+</sql-statement>
+<sql-statement>
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+</sql-statement>
+<sql-statement>
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+</sql-statement>
+<sql-statement>
+DROP TABLE VARCHAR_TBL;
+</sql-statement>
+<sql-statement>
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+</sql-statement>
+<sql-statement>
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+</sql-statement>
+<sql-statement>
+SELECT * FROM VARCHAR_TBL;
+</sql-statement>
diff --git a/yql/essentials/tests/postgresql/cases/varchar.out b/yql/essentials/tests/postgresql/cases/varchar.out
new file mode 100644
index 0000000000..46f8bd3032
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/varchar.out
@@ -0,0 +1,55 @@
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+(5 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+(6 rows)
+
+DROP TABLE VARCHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
diff --git a/yql/essentials/tests/postgresql/cases/varchar.sql b/yql/essentials/tests/postgresql/cases/varchar.sql
new file mode 100644
index 0000000000..5353ac7c36
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/varchar.sql
@@ -0,0 +1,31 @@
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+DROP TABLE VARCHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
diff --git a/yql/essentials/tests/postgresql/cases/window.err b/yql/essentials/tests/postgresql/cases/window.err
new file mode 100644
index 0000000000..f930334d5d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/window.err
@@ -0,0 +1,3837 @@
+Registering pre-existing tables
+ int4_tbl
+ INT4_TBL
+ tenk1
+ tenk2
+<sql-statement>
+--
+-- WINDOW FUNCTIONS
+--
+CREATE TEMPORARY TABLE empsalary (
+ depname varchar,
+ empno bigint,
+ salary int,
+ enroll_date date
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO empsalary VALUES
+('develop', 10, 5200, '2007-08-01'),
+('sales', 1, 5000, '2006-10-01'),
+('personnel', 5, 3500, '2007-12-10'),
+('sales', 4, 4800, '2007-08-08'),
+('personnel', 2, 3900, '2006-12-23'),
+('develop', 7, 4200, '2008-01-01'),
+('develop', 9, 4500, '2008-01-01'),
+('sales', 3, 4800, '2007-08-01'),
+('develop', 8, 6000, '2006-10-01'),
+('develop', 11, 5200, '2007-08-15');
+</sql-statement>
+<sql-statement>
+SELECT depname, empno, salary, sum(salary) OVER (PARTITION BY depname) FROM empsalary ORDER BY depname, salary;
+</sql-statement>
+<sql-statement>
+SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary) FROM empsalary;
+</sql-statement>
+<sql-statement>
+-- with GROUP BY
+SELECT four, ten, SUM(SUM(four)) OVER (PARTITION BY four), AVG(ten) FROM tenk1
+GROUP BY four, ten ORDER BY four, ten;
+</sql-statement>
+<sql-statement>
+SELECT depname, empno, salary, sum(salary) OVER w FROM empsalary WINDOW w AS (PARTITION BY depname);
+</sql-statement>
+<sql-statement>
+SELECT depname, empno, salary, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary) ORDER BY rank() OVER w;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:121: Error: Over is not allowed in: ORDER BY
+ SELECT depname, empno, salary, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary) ORDER BY rank() OVER w;
+ ^
+<sql-statement>
+-- empty window specification
+SELECT COUNT(*) OVER () FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT COUNT(*) OVER w FROM tenk1 WHERE unique2 < 10 WINDOW w AS ();
+</sql-statement>
+<sql-statement>
+-- no window operation
+SELECT four FROM tenk1 WHERE FALSE WINDOW w AS (PARTITION BY ten);
+</sql-statement>
+<sql-statement>
+-- cumulative aggregate
+SELECT sum(four) OVER (PARTITION BY ten ORDER BY unique2) AS sum_1, ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT row_number() OVER (ORDER BY unique2) FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT rank() OVER (PARTITION BY four ORDER BY ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT dense_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: percent_rank
+ SELECT percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: cume_dist
+ SELECT cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 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 ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: ntile
+ SELECT ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 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 ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 2;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 2;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: ntile
+ SELECT ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 2;
+ ^
+<sql-statement>
+SELECT lag(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlag
+ SELECT lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlag
+ SELECT lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+</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 lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlag
+ SELECT lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+<sql-statement>
+SELECT lead(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlead
+ SELECT lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 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 lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlead
+ SELECT lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ ^
+<sql-statement>
+SELECT lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+</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 lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+ -stdin-:<main>:1:8: Error: Expected one argument in functionlead
+ SELECT lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ ^
+<sql-statement>
+SELECT first_value(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+-- last_value returns the last row of the frame, which is CURRENT ROW in ORDER BY window.
+SELECT last_value(four) OVER (ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT last_value(ten) OVER (PARTITION BY four), ten, four FROM
+ (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s
+ ORDER BY four, ten;
+</sql-statement>
+<sql-statement>
+SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s;
+</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 nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: nth_value
+ SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ ^
+<sql-statement>
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER (PARTITION BY two ORDER BY ten) AS wsum
+FROM tenk1 GROUP BY ten, two;
+</sql-statement>
+<sql-statement>
+SELECT count(*) OVER (PARTITION BY four), four FROM (SELECT * FROM tenk1 WHERE two = 1)s WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT (count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY four ORDER BY ten))::varchar AS cntsum
+ FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+-- opexpr with different windows evaluation.
+SELECT * FROM(
+ SELECT count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS total,
+ count(*) OVER (PARTITION BY four ORDER BY ten) AS fourcount,
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS twosum
+ FROM tenk1
+)sub
+WHERE total <> fourcount + twosum;
+</sql-statement>
+<sql-statement>
+SELECT avg(four) OVER (PARTITION BY four ORDER BY thousand / 100) FROM tenk1 WHERE unique2 < 10;
+</sql-statement>
+<sql-statement>
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER win AS wsum
+FROM tenk1 GROUP BY ten, two WINDOW win AS (PARTITION BY two ORDER BY ten);
+</sql-statement>
+<sql-statement>
+-- more than one window with GROUP BY
+SELECT sum(salary),
+ row_number() OVER (ORDER BY depname),
+ sum(sum(salary)) OVER (ORDER BY depname DESC)
+FROM empsalary GROUP BY depname;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- more than one window with GROUP BY
+ ^
+ -stdin-:<main>:1:1: Error: Duplicated member: sum
+ -- more than one window with GROUP BY
+ ^
+<sql-statement>
+-- identical windows with different names
+SELECT sum(salary) OVER w1, count(*) OVER w2
+FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary);
+</sql-statement>
+<sql-statement>
+-- subplan
+SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten)
+FROM tenk1 s WHERE unique2 < 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
+ -- subplan
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgWindowCall
+ SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten)
+ ^
+ -stdin-:<main>:2:8: Error: Expected one argument in functionlead
+ SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten)
+ ^
+<sql-statement>
+-- empty table
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s;
+</sql-statement>
+<sql-statement>
+-- mixture of agg/wfunc in the same window
+SELECT sum(salary) OVER w, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);
+</sql-statement>
+<sql-statement>
+-- strict aggs
+SELECT empno, depname, salary, bonus, depadj, MIN(bonus) OVER (ORDER BY empno), MAX(depadj) OVER () FROM(
+ SELECT *,
+ CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
+ CASE WHEN
+ AVG(salary) OVER (PARTITION BY depname) < salary
+ THEN 200 END AS depadj FROM empsalary
+)s;
+</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
+ -- strict aggs
+ ^
+ -stdin-:<main>:4:13: Error: Star is incompatible to column reference
+ CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
+ ^
+ -stdin-:<main>:4:70: Error: Star is incompatible to column reference
+ CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
+ ^
+<sql-statement>
+-- window function over ungrouped agg over empty row set (bug before 9.1)
+SELECT SUM(COUNT(f1)) OVER () FROM int4_tbl WHERE f1=42;
+</sql-statement>
+<sql-statement>
+-- window function with ORDER BY an expression involving aggregates (9.1 bug)
+select ten,
+ sum(unique1) + sum(unique2) as res,
+ rank() over (order by sum(unique1) + sum(unique2)) as rank
+from tenk1
+group by ten order by ten;
+</sql-statement>
+<sql-statement>
+-- window and aggregate with GROUP BY expression (9.2 bug)
+explain (costs off)
+select first_value(max(x)) over (), y
+ from (select unique1 as x, ten+four as y from tenk1) ss
+ group by y;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- window and aggregate with GROUP BY expression (9.2 bug)
+ ^
+<sql-statement>
+-- test non-default frame specifications
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten),
+ last_value(ten) over (partition by four order by ten)
+FROM (select distinct ten, four from tenk1) ss;
+</sql-statement>
+<sql-statement>
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and current row),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT four, ten,
+ ^
+ -stdin-:<main>:2:16: Error: At function: PgWindow
+ sum(ten) over (partition by four order by ten range between unbounded preceding and current row),
+ ^
+ -stdin-:<main>:2:16: Error: Unsupported frame type: range
+ sum(ten) over (partition by four order by ten range between unbounded preceding and current row),
+ ^
+ -stdin-:<main>:3:23: Error: At function: PgWindow
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and current row)
+ ^
+ -stdin-:<main>:3:23: Error: Unsupported frame type: range
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and current row)
+ ^
+<sql-statement>
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and unbounded following),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and unbounded following)
+FROM (select distinct ten, four from tenk1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT four, ten,
+ ^
+ -stdin-:<main>:2:16: Error: At function: PgWindow
+ sum(ten) over (partition by four order by ten range between unbounded preceding and unbounded following),
+ ^
+ -stdin-:<main>:2:16: Error: Unsupported frame type: range
+ sum(ten) over (partition by four order by ten range between unbounded preceding and unbounded following),
+ ^
+ -stdin-:<main>:3:23: Error: At function: PgWindow
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and unbounded following)
+ ^
+ -stdin-:<main>:3:23: Error: Unsupported frame type: range
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and unbounded following)
+ ^
+<sql-statement>
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT four, ten/4 as two,
+ ^
+ -stdin-:<main>:2:18: Error: At function: PgWindow
+ sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row),
+ ^
+ -stdin-:<main>:2:18: Error: Unsupported frame type: range
+ sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row),
+ ^
+ -stdin-:<main>:3:25: Error: At function: PgWindow
+ last_value(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row)
+ ^
+ -stdin-:<main>:3:25: Error: Unsupported frame type: range
+ last_value(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row)
+ ^
+<sql-statement>
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: range
+ SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (rows between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ ^
+<sql-statement>
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:34: Error: At function: PgWindow
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:34: Error: Excludes are not supported
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+<sql-statement>
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:34: Error: At function: PgWindow
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:34: Error: Excludes are not supported
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+<sql-statement>
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:34: Error: At function: PgWindow
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:34: Error: Excludes are not supported
+ SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+<sql-statement>
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgWindow
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+ -stdin-:<main>:1:33: Error: Excludes are not supported
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ ^
+<sql-statement>
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgWindow
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+ -stdin-:<main>:1:33: Error: Excludes are not supported
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ ^
+<sql-statement>
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:33: Error: At function: PgWindow
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+ -stdin-:<main>:1:33: Error: Excludes are not supported
+ SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (rows between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (rows between 1 following and 3 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (rows between unbounded preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+<sql-statement>
+SELECT sum(unique1) over (w range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (w range between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (w range between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Window reference is not supported
+ SELECT sum(unique1) over (w range between current row and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ ^
+ -stdin-:<main>:1:26: Error: Window reference is not supported
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ ^
+ -stdin-:<main>:1:26: Error: Window reference is not supported
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ ^
+ -stdin-:<main>:1:26: Error: Window reference is not supported
+ SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ ^
+<sql-statement>
+SELECT first_value(unique1) over w,
+ nth_value(unique1, 2) over w AS nth_2,
+ last_value(unique1) over w, unique1, four
+FROM tenk1 WHERE unique1 < 10
+WINDOW w AS (order by four range between current row and unbounded following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT first_value(unique1) over w,
+ ^
+ -stdin-:<main>:5:13: Error: At function: PgWindow
+ WINDOW w AS (order by four range between current row and unbounded following);
+ ^
+ -stdin-:<main>:5:13: Error: Unsupported frame type: range
+ WINDOW w AS (order by four range between current row and unbounded following);
+ ^
+<sql-statement>
+SELECT sum(unique1) over
+ (order by unique1
+ rows (SELECT unique1 FROM tenk1 ORDER BY unique1 LIMIT 1) + 1 PRECEDING),
+ unique1
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:8: Error: SubLinks are not allowed in: FRAME
+ rows (SELECT unique1 FROM tenk1 ORDER BY unique1 LIMIT 1) + 1 PRECEDING),
+ ^
+<sql-statement>
+CREATE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following) as sum_rows
+ FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude current row) as sum_rows FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE OR REPLACE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude group) as sum_rows FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE OR REPLACE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude ties) as sum_rows FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE OR REPLACE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude no others) as sum_rows FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE OR REPLACE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i groups between 1 preceding and 1 following) as sum_rows FROM generate_series(1, 10) i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE OR REPLACE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT * FROM v_window;
+</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.v_window
+
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+DROP VIEW v_window;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: View not found: 'v_window'
+ DROP VIEW v_window;
+ ^
+<sql-statement>
+CREATE TEMP VIEW v_window AS
+ SELECT i, min(i) over (order by i range between '1 day' preceding and '10 days' following) as min_i
+ FROM generate_series(now(), now()+'100 days'::interval, '1 hour') i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE TEMP VIEW v_window AS
+ ^
+<sql-statement>
+SELECT pg_get_viewdef('v_window');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT pg_get_viewdef('v_window');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: relation "v_window" does not exist
+
+ SELECT pg_get_viewdef('v_window');
+ ^
+<sql-statement>
+-- RANGE offset PRECEDING/FOLLOWING tests
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:2:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:2:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ ^
+ -stdin-:<main>:2:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ ^
+ -stdin-:<main>:1:63: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ ^
+ -stdin-:<main>:1:58: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ ^
+ -stdin-:<main>:1:79: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ exclude current row),unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:26: Error: At function: EvaluateExpr
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:26: Error: At function: Unwrap
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ ^
+ -stdin-:<main>:1:79: Error: Can't unwrap PostgreSQL type
+ SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+ -stdin-:<main>:1:71: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+ -stdin-:<main>:1:76: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ ^
+ -stdin-:<main>:1:76: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude current row), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:71: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude group), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:71: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:71: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lead(salary) over(order by salary range between 1000 preceding and 1000 following),
+ nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgWindow
+ select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:1:32: Error: Unsupported frame type: range
+ select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:2:19: Error: At function: PgWindow
+ lead(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:2:19: Error: Unsupported frame type: range
+ lead(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:3:27: Error: At function: PgWindow
+ nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:3:27: Error: Unsupported frame type: range
+ nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+<sql-statement>
+select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lag(salary) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:1:31: Error: At function: PgWindow
+ select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:1:31: Error: Unsupported frame type: range
+ select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:2:18: Error: At function: PgWindow
+ lag(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+ -stdin-:<main>:2:18: Error: Unsupported frame type: range
+ lag(salary) over(order by salary range between 1000 preceding and 1000 following),
+ ^
+<sql-statement>
+select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude current row),
+ lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties),
+ nth_value(salary, 1) over(order by salary range between 1000 following and 3000 following
+ exclude ties),
+ salary from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgWindow
+ select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:1:32: Error: Excludes are not supported
+ select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:3:19: Error: At function: PgWindow
+ lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties),
+ ^
+ -stdin-:<main>:3:19: Error: Excludes are not supported
+ lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties),
+ ^
+ -stdin-:<main>:4:27: Error: At function: PgWindow
+ nth_value(salary, 1) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:4:27: Error: Excludes are not supported
+ nth_value(salary, 1) over(order by salary range between 1000 following and 3000 following
+ ^
+<sql-statement>
+select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude group),
+ lag(salary) over(order by salary range between 1000 following and 3000 following exclude group),
+ salary from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:1:31: Error: At function: PgWindow
+ select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:1:31: Error: Excludes are not supported
+ select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ ^
+ -stdin-:<main>:3:18: Error: At function: PgWindow
+ lag(salary) over(order by salary range between 1000 following and 3000 following exclude group),
+ ^
+ -stdin-:<main>:3:18: Error: Excludes are not supported
+ lag(salary) over(order by salary range between 1000 following and 3000 following exclude group),
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:32: Error: At function: EvaluateExpr
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:32: Error: At function: Unwrap
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:102: Error: Can't unwrap PostgreSQL type
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:32: Error: At function: EvaluateExpr
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:32: Error: At function: Unwrap
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:102: Error: Can't unwrap PostgreSQL type
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:32: Error: At function: EvaluateExpr
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:32: Error: At function: Unwrap
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:102: Error: Can't unwrap PostgreSQL type
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:32: Error: At function: EvaluateExpr
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:32: Error: At function: Unwrap
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+ -stdin-:<main>:1:102: Error: Can't unwrap PostgreSQL type
+ select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ ^
+<sql-statement>
+-- RANGE offset PRECEDING/FOLLOWING with null values
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls first range between 2 preceding and 2 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- RANGE offset PRECEDING/FOLLOWING with null values
+ ^
+ -stdin-:<main>:10:3: Error: At function: PgWindow
+ (order by x asc nulls first range between 2 preceding and 2 following);
+ ^
+ -stdin-:<main>:10:3: Error: Unsupported frame type: range
+ (order by x asc nulls first range between 2 preceding and 2 following);
+ ^
+<sql-statement>
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls last range between 2 preceding and 2 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, y,
+ ^
+ -stdin-:<main>:9:3: Error: At function: PgWindow
+ (order by x asc nulls last range between 2 preceding and 2 following);
+ ^
+ -stdin-:<main>:9:3: Error: Unsupported frame type: range
+ (order by x asc nulls last range between 2 preceding and 2 following);
+ ^
+<sql-statement>
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls first range between 2 preceding and 2 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, y,
+ ^
+ -stdin-:<main>:9:3: Error: At function: PgWindow
+ (order by x desc nulls first range between 2 preceding and 2 following);
+ ^
+ -stdin-:<main>:9:3: Error: Unsupported frame type: range
+ (order by x desc nulls first range between 2 preceding and 2 following);
+ ^
+<sql-statement>
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls last range between 2 preceding and 2 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, y,
+ ^
+ -stdin-:<main>:9:3: Error: At function: PgWindow
+ (order by x desc nulls last range between 2 preceding and 2 following);
+ ^
+ -stdin-:<main>:9:3: Error: Unsupported frame type: range
+ (order by x desc nulls last range between 2 preceding and 2 following);
+ ^
+<sql-statement>
+-- Check overflow behavior for various integer sizes
+select x, last_value(x) over (order by x::smallint range between current row and 2147450884 following)
+from generate_series(32764, 32766) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- Check overflow behavior for various integer sizes
+ ^
+ -stdin-:<main>:2:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x::smallint range between current row and 2147450884 following)
+ ^
+ -stdin-:<main>:2:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x::smallint range between current row and 2147450884 following)
+ ^
+<sql-statement>
+select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+from generate_series(-32766, -32764) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+ ^
+ -stdin-:<main>:1:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+ ^
+<sql-statement>
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(2147483644, 2147483646) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+ -stdin-:<main>:1:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+<sql-statement>
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-2147483646, -2147483644) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+ -stdin-:<main>:1:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+<sql-statement>
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(9223372036854775804, 9223372036854775806) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+ -stdin-:<main>:1:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x range between current row and 4 following)
+ ^
+<sql-statement>
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-9223372036854775806, -9223372036854775804) x;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+ -stdin-:<main>:1:30: Error: Unsupported frame type: range
+ select x, last_value(x) over (order by x desc range between current row and 5 following)
+ ^
+<sql-statement>
+-- Test in_range for other numeric datatypes
+create temp table numerics(
+ id int,
+ f_float4 float4,
+ f_float8 float8,
+ f_numeric numeric
+);
+</sql-statement>
+<sql-statement>
+insert into numerics values
+(0, '-infinity', '-infinity', '-infinity'),
+(1, -3, -3, -3),
+(2, -1, -1, -1),
+(3, 0, 0, 0),
+(4, 1.1, 1.1, 1.1),
+(5, 1.12, 1.12, 1.12),
+(6, 2, 2, 2),
+(7, 100, 100, 100),
+(8, 'infinity', 'infinity', 'infinity'),
+(9, 'NaN', 'NaN', 'NaN');
+</sql-statement>
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select id, f_float4, first_value(id) over w, last_value(id) over w
+ ^
+ -stdin-:<main>:3:13: Error: At function: PgWindow
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:3:13: Error: Unsupported frame type: range
+ window w as (order by f_float4 range between
+ ^
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1.1::float4 following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:4:35: Error: Can't unwrap PostgreSQL type
+ 1 preceding and 1.1::float4 following);
+ ^
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' following);
+ ^
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' preceding);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' preceding);
+ ^
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' following and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' following and 'inf' following);
+ ^
+<sql-statement>
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float4 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select id, f_float8, first_value(id) over w, last_value(id) over w
+ ^
+ -stdin-:<main>:3:13: Error: At function: PgWindow
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:3:13: Error: Unsupported frame type: range
+ window w as (order by f_float8 range between
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1.1::float8 following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:4:35: Error: Can't unwrap PostgreSQL type
+ 1 preceding and 1.1::float8 following);
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' following);
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' preceding);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' preceding);
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' following and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' following and 'inf' following);
+ ^
+<sql-statement>
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_float8 range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select id, f_numeric, first_value(id) over w, last_value(id) over w
+ ^
+ -stdin-:<main>:3:13: Error: At function: PgWindow
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:3:13: Error: Unsupported frame type: range
+ window w as (order by f_numeric range between
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::numeric following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:35: Error: Can't unwrap PostgreSQL type
+ 1 preceding and 1.1::numeric following);
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::float8 following); -- currently unsupported
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:35: Error: Can't unwrap PostgreSQL type
+ 1 preceding and 1.1::float8 following); -- currently unsupported
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' following);
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' preceding);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' preceding and 'inf' preceding);
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' following and 'inf' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 'inf' following and 'inf' following);
+ ^
+<sql-statement>
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_numeric range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ ^
+<sql-statement>
+-- Test in_range for other datetime datatypes
+create temp table datetimes(
+ id int,
+ f_time time,
+ f_timetz timetz,
+ f_interval interval,
+ f_timestamptz timestamptz,
+ f_timestamp timestamp
+);
+</sql-statement>
+<sql-statement>
+insert into datetimes values
+(1, '11:00', '11:00 BST', '1 year', '2000-10-19 10:23:54+01', '2000-10-19 10:23:54'),
+(2, '12:00', '12:00 BST', '2 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(3, '13:00', '13:00 BST', '3 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(4, '14:00', '14:00 BST', '4 years', '2002-10-19 10:23:54+01', '2002-10-19 10:23:54'),
+(5, '15:00', '15:00 BST', '5 years', '2003-10-19 10:23:54+01', '2003-10-19 10:23:54'),
+(6, '15:00', '15:00 BST', '5 years', '2004-10-19 10:23:54+01', '2004-10-19 10:23:54'),
+(7, '17:00', '17:00 BST', '7 years', '2005-10-19 10:23:54+01', '2005-10-19 10:23:54'),
+(8, '18:00', '18:00 BST', '8 years', '2006-10-19 10:23:54+01', '2006-10-19 10:23:54'),
+(9, '19:00', '19:00 BST', '9 years', '2007-10-19 10:23:54+01', '2007-10-19 10:23:54'),
+(10, '20:00', '20:00 BST', '10 years', '2008-10-19 10:23:54+01', '2008-10-19 10:23:54');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ insert into datetimes values
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type time with time zone: "11:00 BST"
+
+ insert into datetimes values
+ ^
+<sql-statement>
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_time range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_time range between
+ ^
+ -stdin-:<main>:4:24: Error: Can't unwrap PostgreSQL type
+ '70 min'::interval preceding and '2 hours'::interval following);
+ ^
+<sql-statement>
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time desc range between
+ '70 min' preceding and '2 hours' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_time desc range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_time desc range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ '70 min' preceding and '2 hours' following);
+ ^
+<sql-statement>
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timetz range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timetz range between
+ ^
+ -stdin-:<main>:4:24: Error: Can't unwrap PostgreSQL type
+ '70 min'::interval preceding and '2 hours'::interval following);
+ ^
+<sql-statement>
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz desc range between
+ '70 min' preceding and '2 hours' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timetz desc range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timetz desc range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ '70 min' preceding and '2 hours' following);
+ ^
+<sql-statement>
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval range between
+ '1 year'::interval preceding and '1 year'::interval following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_interval range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_interval range between
+ ^
+ -stdin-:<main>:4:24: Error: Can't unwrap PostgreSQL type
+ '1 year'::interval preceding and '1 year'::interval following);
+ ^
+<sql-statement>
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval desc range between
+ '1 year' preceding and '1 year' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_interval desc range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_interval desc range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ '1 year' preceding and '1 year' following);
+ ^
+<sql-statement>
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz range between
+ '1 year'::interval preceding and '1 year'::interval following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timestamptz range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timestamptz range between
+ ^
+ -stdin-:<main>:4:24: Error: Can't unwrap PostgreSQL type
+ '1 year'::interval preceding and '1 year'::interval following);
+ ^
+<sql-statement>
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz desc range between
+ '1 year' preceding and '1 year' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timestamptz desc range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timestamptz desc range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ '1 year' preceding and '1 year' following);
+ ^
+<sql-statement>
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp range between
+ '1 year'::interval preceding and '1 year'::interval following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timestamp range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timestamp range between
+ ^
+ -stdin-:<main>:4:24: Error: Can't unwrap PostgreSQL type
+ '1 year'::interval preceding and '1 year'::interval following);
+ ^
+<sql-statement>
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp desc range between
+ '1 year' preceding and '1 year' following);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:3:13: Error: At function: EvaluateExpr
+ window w as (order by f_timestamp desc range between
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:3:13: Error: At function: Unwrap
+ window w as (order by f_timestamp desc range between
+ ^
+ -stdin-:<main>:4:14: Error: Can't unwrap PostgreSQL type
+ '1 year' preceding and '1 year' following);
+ ^
+<sql-statement>
+-- RANGE offset PRECEDING/FOLLOWING error cases
+select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:2:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:2:25: Error: At function: Unwrap
+ select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>:2:79: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+<sql-statement>
+select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>:1:50: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+<sql-statement>
+select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:25: Error: At function: EvaluateExpr
+ select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:25: Error: At function: Unwrap
+ select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>:1:67: Error: Can't unwrap PostgreSQL type
+ select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+<sql-statement>
+select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ ^
+ -stdin-:<main>:1:30: Error: Excludes are not supported
+ select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ ^
+<sql-statement>
+select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ ^
+ -stdin-:<main>:1:30: Error: Excludes are not supported
+ select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ ^
+<sql-statement>
+select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ ^
+ -stdin-:<main>:1:30: Error: At function: PgWindow
+ select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ ^
+ -stdin-:<main>:1:30: Error: Excludes are not supported
+ select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ ^
+<sql-statement>
+select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:30: Error: At function: EvaluateExpr
+ select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:30: Error: At function: Unwrap
+ select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+ -stdin-:<main>:1:71: Error: Can't unwrap PostgreSQL type
+ select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ ^
+<sql-statement>
+select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:1:30: Error: At function: EvaluateExpr
+ select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:30: Error: At function: Unwrap
+ select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ ^
+ -stdin-:<main>:1:76: Error: Can't unwrap PostgreSQL type
+ select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ ^
+<sql-statement>
+-- GROUPS tests
+SELECT sum(unique1) over (order by four groups between unbounded preceding and current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- GROUPS tests
+ ^
+ -stdin-:<main>:2:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and current row),
+ ^
+ -stdin-:<main>:2:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and current row),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude current row), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude group), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+<sql-statement>
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude ties), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following),unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: Unsupported frame type: groups
+ SELECT sum(unique1) over (partition by ten
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude current row), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (partition by ten
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude group), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (partition by ten
+ ^
+<sql-statement>
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude ties), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: At function: PgWindow
+ SELECT sum(unique1) over (partition by ten
+ ^
+ -stdin-:<main>:1:26: Error: Excludes are not supported
+ SELECT sum(unique1) over (partition by ten
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lead(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgWindow
+ select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:32: Error: Unsupported frame type: groups
+ select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:2:19: Error: At function: PgWindow
+ lead(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:2:19: Error: Unsupported frame type: groups
+ lead(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:3:27: Error: At function: PgWindow
+ nth_value(salary, 1) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:3:27: Error: Unsupported frame type: groups
+ nth_value(salary, 1) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+<sql-statement>
+select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lag(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:31: Error: At function: PgWindow
+ select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:1:31: Error: Unsupported frame type: groups
+ select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:2:18: Error: At function: PgWindow
+ lag(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+ -stdin-:<main>:2:18: Error: Unsupported frame type: groups
+ lag(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ ^
+<sql-statement>
+select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude current row),
+ lead(salary) over(order by enroll_date groups between 1 following and 3 following exclude ties),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 following and 3 following
+ exclude ties),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:1:32: Error: At function: PgWindow
+ select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:1:32: Error: Excludes are not supported
+ select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:3:19: Error: At function: PgWindow
+ lead(salary) over(order by enroll_date groups between 1 following and 3 following exclude ties),
+ ^
+ -stdin-:<main>:3:19: Error: Excludes are not supported
+ lead(salary) over(order by enroll_date groups between 1 following and 3 following exclude ties),
+ ^
+ -stdin-:<main>:4:27: Error: At function: PgWindow
+ nth_value(salary, 1) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:4:27: Error: Excludes are not supported
+ nth_value(salary, 1) over(order by enroll_date groups between 1 following and 3 following
+ ^
+<sql-statement>
+select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude group),
+ lag(salary) over(order by enroll_date groups between 1 following and 3 following exclude group),
+ salary, enroll_date from empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:1:31: Error: At function: PgWindow
+ select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:1:31: Error: Excludes are not supported
+ select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ ^
+ -stdin-:<main>:3:18: Error: At function: PgWindow
+ lag(salary) over(order by enroll_date groups between 1 following and 3 following exclude group),
+ ^
+ -stdin-:<main>:3:18: Error: Excludes are not supported
+ lag(salary) over(order by enroll_date groups between 1 following and 3 following exclude group),
+ ^
+<sql-statement>
+-- Show differences in offset interpretation between ROWS, RANGE, and GROUPS
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+</sql-statement>
+<sql-statement>
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ WITH cte (x) AS (
+ ^
+ -stdin-:<main>:6:13: Error: At function: PgWindow
+ WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ ^
+ -stdin-:<main>:6:13: Error: Unsupported frame type: range
+ WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ ^
+<sql-statement>
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ WITH cte (x) AS (
+ ^
+ -stdin-:<main>:6:13: Error: At function: PgWindow
+ WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ ^
+ -stdin-:<main>:6:13: Error: Unsupported frame type: groups
+ WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ ^
+<sql-statement>
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+</sql-statement>
+<sql-statement>
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ WITH cte (x) AS (
+ ^
+ -stdin-:<main>:7:13: Error: At function: PgWindow
+ WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ ^
+ -stdin-:<main>:7:13: Error: Unsupported frame type: range
+ WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ ^
+<sql-statement>
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ WITH cte (x) AS (
+ ^
+ -stdin-:<main>:7:13: Error: At function: PgWindow
+ WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ ^
+ -stdin-:<main>:7:13: Error: Unsupported frame type: groups
+ WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ ^
+<sql-statement>
+-- with UNION
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk2)s LIMIT 0;
+</sql-statement>
+<sql-statement>
+-- check some degenerate cases
+create temp table t1 (f1 int, f2 int8);
+</sql-statement>
+<sql-statement>
+insert into t1 values (1,1),(1,2),(2,2);
+</sql-statement>
+<sql-statement>
+select f1, sum(f1) over (partition by f1
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: range
+ select f1, sum(f1) over (partition by f1
+ ^
+<sql-statement>
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: range
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ range between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: range
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ range between 1 following and 2 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: range
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: groups
+ select f1, sum(f1) over (partition by f1
+ ^
+<sql-statement>
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ explain (costs off)
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: groups
+ select f1, sum(f1) over (partition by f1 order by f2
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ groups between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: groups
+ select f1, sum(f1) over (partition by f1, f1 order by f2
+ ^
+<sql-statement>
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ groups between 1 following and 2 following)
+from t1 where f1 = f2;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: At function: PgWindow
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+ -stdin-:<main>:1:25: Error: Unsupported frame type: groups
+ select f1, sum(f1) over (partition by f1, f2 order by f2
+ ^
+<sql-statement>
+-- ordering by a non-integer constant is allowed
+SELECT rank() OVER (ORDER BY length('abc'));
+</sql-statement>
+<sql-statement>
+-- can't order by another window function
+SELECT rank() OVER (ORDER BY rank() OVER (ORDER BY random()));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:30: Error: Over is not allowed in: ORDER BY
+ SELECT rank() OVER (ORDER BY rank() OVER (ORDER BY random()));
+ ^
+<sql-statement>
+-- some other errors
+SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY salary) < 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:31: Error: Over is not allowed in: WHERE
+ SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY salary) < 10;
+ ^
+<sql-statement>
+SELECT * FROM empsalary INNER JOIN tenk1 ON row_number() OVER (ORDER BY salary) < 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:45: Error: Over is not allowed in: JOIN ON
+ SELECT * FROM empsalary INNER JOIN tenk1 ON row_number() OVER (ORDER BY salary) < 10;
+ ^
+<sql-statement>
+SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GROUP BY 1;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GROUP BY 1;
+ ^
+ -stdin-:<main>:1:1: Fatal: ydb/library/yql/providers/common/mkql/yql_provider_mkql.cpp:364 GetCallable(): requirement Callables.cend() != compiler failed, message: Missed callable: PgWindowCall
+ SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GROUP BY 1;
+ ^
+<sql-statement>
+SELECT * FROM rank() OVER (ORDER BY random());
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:29: Error: ERROR: syntax error at or near "ORDER"
+
+ SELECT * FROM rank() OVER (ORDER BY random());
+ ^
+<sql-statement>
+DELETE FROM empsalary WHERE (rank() OVER (ORDER BY random())) > 10;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:30: Error: Over is not allowed in: WHERE
+ DELETE FROM empsalary WHERE (rank() OVER (ORDER BY random())) > 10;
+ ^
+<sql-statement>
+DELETE FROM empsalary RETURNING rank() OVER (ORDER BY random());
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: ResTarget: alternative is not implemented yet : 357
+ DELETE FROM empsalary RETURNING rank() OVER (ORDER BY random());
+ ^
+<sql-statement>
+SELECT count(*) OVER w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY unique1);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ SELECT count(*) OVER w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY unique1);
+ ^
+ -stdin-:<main>:1:72: Error: Duplicated window name: w
+ SELECT count(*) OVER w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY unique1);
+ ^
+<sql-statement>
+SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:41: Error: ERROR: syntax error at or near "ORDER"
+
+ SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+ ^
+<sql-statement>
+SELECT count() OVER () FROM tenk1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: FuncCall: count(*) must be used to call a parameterless aggregate function
+ SELECT count() OVER () FROM tenk1;
+ ^
+<sql-statement>
+SELECT generate_series(1, 100) OVER () FROM empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT
+ SELECT generate_series(1, 100) OVER () FROM empsalary;
+ ^
+<sql-statement>
+SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+</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 ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: ntile
+ SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+<sql-statement>
+SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+</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 nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: nth_value
+ SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ ^
+<sql-statement>
+-- filter
+SELECT sum(salary), row_number() OVER (ORDER BY depname), sum(
+ sum(salary) FILTER (WHERE enroll_date > '2007-01-01')
+) FILTER (WHERE depname <> 'sales') OVER (ORDER BY depname DESC) AS "filtered_sum",
+ depname
+FROM empsalary GROUP BY depname;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:59: Error: FuncCall: unsupported agg_filter
+ SELECT sum(salary), row_number() OVER (ORDER BY depname), sum(
+ ^
+<sql-statement>
+-- Test pushdown of quals into a subquery containing window functions
+-- pushdown is safe because all PARTITION BY clauses include depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname) depsalary,
+ min(salary) OVER (PARTITION BY depname || 'A', depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test pushdown of quals into a subquery containing window functions
+ ^
+<sql-statement>
+-- pushdown is unsafe because there's a PARTITION BY clause without depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY enroll_date) enroll_salary,
+ min(salary) OVER (PARTITION BY depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- pushdown is unsafe because there's a PARTITION BY clause without depname:
+ ^
+<sql-statement>
+-- Test Sort node collapsing
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname order by empno) depsalary,
+ min(salary) OVER (PARTITION BY depname, empno order by enroll_date) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test Sort node collapsing
+ ^
+<sql-statement>
+-- Test Sort node reordering
+EXPLAIN (COSTS OFF)
+SELECT
+ lead(1) OVER (PARTITION BY depname ORDER BY salary, enroll_date),
+ lag(1) OVER (PARTITION BY depname ORDER BY salary,enroll_date,empno)
+FROM empsalary;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test Sort node reordering
+ ^
+<sql-statement>
+-- Test incremental sorting
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ -- Test incremental sorting
+ ^
+<sql-statement>
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+</sql-statement>
+<sql-statement>
+-- cleanup
+DROP TABLE empsalary;
+</sql-statement>
+<sql-statement>
+-- test user-defined window function with named args and default args
+CREATE FUNCTION nth_value_def(val anyelement, n integer = 1) RETURNS anyelement
+ LANGUAGE internal WINDOW IMMUTABLE STRICT AS 'window_nth_value';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- test user-defined window function with named args and default args
+ ^
+<sql-statement>
+SELECT nth_value_def(n := 2, val := ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:8: Error: alternative is not implemented yet : 118
+ SELECT nth_value_def(n := 2, val := ten) OVER (PARTITION BY four), ten, four
+ ^
+<sql-statement>
+SELECT nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+</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 nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgWindowCall
+ SELECT nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ ^
+ -stdin-:<main>:1:8: Error: Unsupported function: nth_value_def
+ SELECT nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ ^
+<sql-statement>
+--
+-- Test the basic moving-aggregate machinery
+--
+-- create aggregates that record the series of transform calls (these are
+-- intentionally not true inverses)
+CREATE FUNCTION logging_sfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '*' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ --
+ ^
+<sql-statement>
+CREATE FUNCTION logging_msfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '+' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION logging_msfunc_nonstrict(text, anyelement) RETURNS text AS
+ ^
+<sql-statement>
+CREATE FUNCTION logging_minvfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION logging_minvfunc_nonstrict(text, anyelement) RETURNS text AS
+ ^
+<sql-statement>
+CREATE AGGREGATE logging_agg_nonstrict (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE logging_agg_nonstrict (anyelement)
+ ^
+<sql-statement>
+CREATE AGGREGATE logging_agg_nonstrict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE logging_agg_nonstrict_initcond (anyelement)
+ ^
+<sql-statement>
+CREATE FUNCTION logging_sfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '*' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION logging_sfunc_strict(text, anyelement) RETURNS text AS
+ ^
+<sql-statement>
+CREATE FUNCTION logging_msfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '+' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION logging_msfunc_strict(text, anyelement) RETURNS text AS
+ ^
+<sql-statement>
+CREATE FUNCTION logging_minvfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ CREATE FUNCTION logging_minvfunc_strict(text, anyelement) RETURNS text AS
+ ^
+<sql-statement>
+CREATE AGGREGATE logging_agg_strict (text)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE logging_agg_strict (text)
+ ^
+<sql-statement>
+CREATE AGGREGATE logging_agg_strict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE logging_agg_strict_initcond (anyelement)
+ ^
+<sql-statement>
+-- test strict and non-strict cases
+SELECT
+ p::text || ',' || i::text || ':' || COALESCE(v::text, 'NULL') AS row,
+ logging_agg_nonstrict(v) over wnd as nstrict,
+ logging_agg_nonstrict_initcond(v) over wnd as nstrict_init,
+ logging_agg_strict(v::text) over wnd as strict,
+ logging_agg_strict_initcond(v) over wnd as strict_init
+FROM (VALUES
+ (1, 1, NULL),
+ (1, 2, 'a'),
+ (1, 3, 'b'),
+ (1, 4, NULL),
+ (1, 5, NULL),
+ (1, 6, 'c'),
+ (2, 1, NULL),
+ (2, 2, 'x'),
+ (3, 1, 'z')
+) AS t(p, i, v)
+WINDOW wnd AS (PARTITION BY P ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test strict and non-strict cases
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test strict and non-strict cases
+ ^
+ -stdin-:<main>:4:2: Error: At function: PgWindowCall
+ logging_agg_nonstrict(v) over wnd as nstrict,
+ ^
+ -stdin-:<main>:4:2: Error: Unsupported function: logging_agg_nonstrict
+ logging_agg_nonstrict(v) over wnd as nstrict,
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test strict and non-strict cases
+ ^
+ -stdin-:<main>:5:2: Error: At function: PgWindowCall
+ logging_agg_nonstrict_initcond(v) over wnd as nstrict_init,
+ ^
+ -stdin-:<main>:5:2: Error: Unsupported function: logging_agg_nonstrict_initcond
+ logging_agg_nonstrict_initcond(v) over wnd as nstrict_init,
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test strict and non-strict cases
+ ^
+ -stdin-:<main>:6:2: Error: At function: PgWindowCall
+ logging_agg_strict(v::text) over wnd as strict,
+ ^
+ -stdin-:<main>:6:2: Error: Unsupported function: logging_agg_strict
+ logging_agg_strict(v::text) over wnd as strict,
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test strict and non-strict cases
+ ^
+ -stdin-:<main>:7:2: Error: At function: PgWindowCall
+ logging_agg_strict_initcond(v) over wnd as strict_init
+ ^
+ -stdin-:<main>:7:2: Error: Unsupported function: logging_agg_strict_initcond
+ logging_agg_strict_initcond(v) over wnd as strict_init
+ ^
+<sql-statement>
+-- and again, but with filter
+SELECT
+ p::text || ',' || i::text || ':' ||
+ CASE WHEN f THEN COALESCE(v::text, 'NULL') ELSE '-' END as row,
+ logging_agg_nonstrict(v) filter(where f) over wnd as nstrict_filt,
+ logging_agg_nonstrict_initcond(v) filter(where f) over wnd as nstrict_init_filt,
+ logging_agg_strict(v::text) filter(where f) over wnd as strict_filt,
+ logging_agg_strict_initcond(v) filter(where f) over wnd as strict_init_filt
+FROM (VALUES
+ (1, 1, true, NULL),
+ (1, 2, false, 'a'),
+ (1, 3, true, 'b'),
+ (1, 4, false, NULL),
+ (1, 5, false, NULL),
+ (1, 6, false, 'c'),
+ (2, 1, false, NULL),
+ (2, 2, true, 'x'),
+ (3, 1, true, 'z')
+) AS t(p, i, f, v)
+WINDOW wnd AS (PARTITION BY p ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:2: Error: FuncCall: unsupported agg_filter
+ logging_agg_nonstrict(v) filter(where f) over wnd as nstrict_filt,
+ ^
+<sql-statement>
+-- test that volatile arguments disable moving-aggregate mode
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text)
+ over wnd as inverse,
+ logging_agg_strict(v::text || CASE WHEN random() < 0 then '?' ELSE '' END)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ -- test that volatile arguments disable moving-aggregate mode
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test that volatile arguments disable moving-aggregate mode
+ ^
+ -stdin-:<main>:4:2: Error: At function: PgWindowCall
+ logging_agg_strict(v::text)
+ ^
+ -stdin-:<main>:4:2: Error: Unsupported function: logging_agg_strict
+ logging_agg_strict(v::text)
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ -- test that volatile arguments disable moving-aggregate mode
+ ^
+ -stdin-:<main>:6:2: Error: At function: PgWindowCall
+ logging_agg_strict(v::text || CASE WHEN random() < 0 then '?' ELSE '' END)
+ ^
+ -stdin-:<main>:6:2: Error: Unsupported function: logging_agg_strict
+ logging_agg_strict(v::text || CASE WHEN random() < 0 then '?' ELSE '' END)
+ ^
+<sql-statement>
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text) filter(where true)
+ over wnd as inverse,
+ logging_agg_strict(v::text) filter(where random() >= 0)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:2: Error: FuncCall: unsupported agg_filter
+ logging_agg_strict(v::text) filter(where true)
+ ^
+<sql-statement>
+-- test that non-overlapping windows don't use inverse transitions
+SELECT
+ logging_agg_strict(v::text) OVER wnd
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ORDER BY i;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- test that non-overlapping windows don't use inverse transitions
+ ^
+ -stdin-:<main>:3:2: Error: At function: PgWindowCall
+ logging_agg_strict(v::text) OVER wnd
+ ^
+ -stdin-:<main>:3:2: Error: Unsupported function: logging_agg_strict
+ logging_agg_strict(v::text) OVER wnd
+ ^
+<sql-statement>
+-- test that returning NULL from the inverse transition functions
+-- restarts the aggregation from scratch. The second aggregate is supposed
+-- to test cases where only some aggregates restart, the third one checks
+-- that one aggregate restarting doesn't cause others to restart.
+CREATE FUNCTION sum_int_randrestart_minvfunc(int4, int4) RETURNS int4 AS
+$$ SELECT CASE WHEN random() < 0.2 THEN NULL ELSE $1 - $2 END $$
+LANGUAGE SQL STRICT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- test that returning NULL from the inverse transition functions
+ ^
+<sql-statement>
+CREATE AGGREGATE sum_int_randomrestart (int4)
+(
+ stype = int4,
+ sfunc = int4pl,
+ mstype = int4,
+ msfunc = int4pl,
+ minvfunc = sum_int_randrestart_minvfunc
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
+ CREATE AGGREGATE sum_int_randomrestart (int4)
+ ^
+<sql-statement>
+WITH
+vs AS (
+ SELECT i, (random() * 100)::int4 AS v
+ FROM generate_series(1, 100) AS i
+),
+sum_following AS (
+ SELECT i, SUM(v) OVER
+ (ORDER BY i DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS s
+ FROM vs
+)
+SELECT DISTINCT
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+FROM vs
+JOIN sum_following ON sum_following.i = vs.i
+WINDOW fwd AS (
+ ORDER BY vs.i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
+);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
+ WITH
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ WITH
+ ^
+ -stdin-:<main>:12:18: Error: At function: PgOp
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ ^
+ -stdin-:<main>:12:20: Error: At function: PgWindowCall
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ ^
+ -stdin-:<main>:12:20: Error: Unsupported function: sum_int_randomrestart
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ WITH
+ ^
+ -stdin-:<main>:13:19: Error: At function: PgOp
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ ^
+ -stdin-:<main>:13:21: Error: At function: PgWindowCall
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ ^
+ -stdin-:<main>:13:21: Error: Unsupported function: sum_int_randomrestart
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ ^
+ -stdin-:<main>:1:1: Error: At function: PgResultItem
+ WITH
+ ^
+ -stdin-:<main>:14:19: Error: At function: PgOp
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+ ^
+ -stdin-:<main>:14:21: Error: At function: PgCall
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+ ^
+ -stdin-:<main>:14:28: Error: At function: PgWindowCall
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+ ^
+ -stdin-:<main>:14:28: Error: Unsupported function: logging_agg_nonstrict
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+ ^
+<sql-statement>
+--
+-- Test various built-in aggregates that have moving-aggregate support
+--
+-- test inverse transition functions handle NULLs properly
+SELECT i,AVG(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,AVG(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,AVG(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,AVG(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.5),(2,2.5),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,AVG(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::money) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1.10'),(2,'2.20'),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.1),(2,2.2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT SUM(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.01),(2,2),(3,3)) v(i,n);
+</sql-statement>
+<sql-statement>
+SELECT i,COUNT(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,COUNT(*) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT VAR_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VAR_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VARIANCE(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VARIANCE(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VARIANCE(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT VARIANCE(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+SELECT STDDEV(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+</sql-statement>
+<sql-statement>
+-- test that inverse transition functions work with various frame options
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+</sql-statement>
+<sql-statement>
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,3),(4,4)) t(i,v);
+</sql-statement>
+<sql-statement>
+-- ensure aggregate over numeric properly recovers from NaN values
+SELECT a, b,
+ SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM (VALUES(1,1::numeric),(2,2),(3,'NaN'),(4,3),(5,4)) t(a,b);
+</sql-statement>
+<sql-statement>
+-- It might be tempting for someone to add an inverse trans function for
+-- float and double precision. This should not be done as it can give incorrect
+-- results. This test should fail if anyone ever does this without thinking too
+-- hard about it.
+SELECT to_char(SUM(n::float8) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING),'999999999999999999999D9')
+ FROM (VALUES(1,1e20),(2,1)) n(i,n);
+</sql-statement>
+<sql-statement>
+SELECT i, b, bool_and(b) OVER w, bool_or(b) OVER w
+ FROM (VALUES (1,true), (2,true), (3,false), (4,false), (5,true)) v(i,b)
+ WINDOW w AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING);
+</sql-statement>
+<sql-statement>
+-- Tests for problems with failure to walk or mutate expressions
+-- within window frame clauses.
+-- test walker (fails with collation error if expressions are not walked)
+SELECT array_agg(i) OVER w
+ FROM generate_series(1,5) i
+WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+</sql-statement>
+-stdin-:<main>: Error: Expression evaluation
+
+ -stdin-:<main>:6:13: Error: At function: EvaluateExpr
+ WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+ ^
+ -stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:6:13: Error: At function: Unwrap
+ WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+ ^
+ -stdin-:<main>:6:59: Error: Can't unwrap PostgreSQL type
+ WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+ ^
+<sql-statement>
+-- test mutator (fails when inlined if expressions are not mutated)
+CREATE FUNCTION pg_temp.f(group_size BIGINT) RETURNS SETOF integer[]
+AS $$
+ SELECT array_agg(s) OVER w
+ FROM generate_series(1,5) s
+ WINDOW w AS (ORDER BY s ROWS BETWEEN CURRENT ROW AND GROUP_SIZE FOLLOWING)
+$$ LANGUAGE SQL STABLE;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
+ -- test mutator (fails when inlined if expressions are not mutated)
+ ^
+<sql-statement>
+EXPLAIN (costs off) SELECT * FROM pg_temp.f(2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (costs off) SELECT * FROM pg_temp.f(2);
+ ^
+<sql-statement>
+SELECT * FROM pg_temp.f(2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:15: Error: FuncCall: expected pg_catalog, but got: pg_temp
+ SELECT * FROM pg_temp.f(2);
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/window.out b/yql/essentials/tests/postgresql/cases/window.out
new file mode 100644
index 0000000000..b2397191c6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/window.out
@@ -0,0 +1,715 @@
+--
+-- WINDOW FUNCTIONS
+--
+CREATE TEMPORARY TABLE empsalary (
+ depname varchar,
+ empno bigint,
+ salary int,
+ enroll_date date
+);
+INSERT INTO empsalary VALUES
+('develop', 10, 5200, '2007-08-01'),
+('sales', 1, 5000, '2006-10-01'),
+('personnel', 5, 3500, '2007-12-10'),
+('sales', 4, 4800, '2007-08-08'),
+('personnel', 2, 3900, '2006-12-23'),
+('develop', 7, 4200, '2008-01-01'),
+('develop', 9, 4500, '2008-01-01'),
+('sales', 3, 4800, '2007-08-01'),
+('develop', 8, 6000, '2006-10-01'),
+('develop', 11, 5200, '2007-08-15');
+-- empty window specification
+SELECT COUNT(*) OVER () FROM tenk1 WHERE unique2 < 10;
+ count
+-------
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+(10 rows)
+
+SELECT COUNT(*) OVER w FROM tenk1 WHERE unique2 < 10 WINDOW w AS ();
+ count
+-------
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+(10 rows)
+
+-- no window operation
+SELECT four FROM tenk1 WHERE FALSE WINDOW w AS (PARTITION BY ten);
+ four
+------
+(0 rows)
+
+SELECT row_number() OVER (ORDER BY unique2) FROM tenk1 WHERE unique2 < 10;
+ row_number
+------------
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+(10 rows)
+
+SELECT count(*) OVER (PARTITION BY four), four FROM (SELECT * FROM tenk1 WHERE two = 1)s WHERE unique2 < 10;
+ count | four
+-------+------
+ 4 | 1
+ 4 | 1
+ 4 | 1
+ 4 | 1
+ 2 | 3
+ 2 | 3
+(6 rows)
+
+-- opexpr with different windows evaluation.
+SELECT * FROM(
+ SELECT count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS total,
+ count(*) OVER (PARTITION BY four ORDER BY ten) AS fourcount,
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS twosum
+ FROM tenk1
+)sub
+WHERE total <> fourcount + twosum;
+ total | fourcount | twosum
+-------+-----------+--------
+(0 rows)
+
+-- identical windows with different names
+SELECT sum(salary) OVER w1, count(*) OVER w2
+FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary);
+ sum | count
+-------+-------
+ 3500 | 1
+ 7400 | 2
+ 11600 | 3
+ 16100 | 4
+ 25700 | 6
+ 25700 | 6
+ 30700 | 7
+ 41100 | 9
+ 41100 | 9
+ 47100 | 10
+(10 rows)
+
+-- empty table
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s;
+ count
+-------
+(0 rows)
+
+-- window function with ORDER BY an expression involving aggregates (9.1 bug)
+select ten,
+ sum(unique1) + sum(unique2) as res,
+ rank() over (order by sum(unique1) + sum(unique2)) as rank
+from tenk1
+group by ten order by ten;
+ ten | res | rank
+-----+----------+------
+ 0 | 9976146 | 4
+ 1 | 10114187 | 9
+ 2 | 10059554 | 8
+ 3 | 9878541 | 1
+ 4 | 9881005 | 2
+ 5 | 9981670 | 5
+ 6 | 9947099 | 3
+ 7 | 10120309 | 10
+ 8 | 9991305 | 6
+ 9 | 10040184 | 7
+(10 rows)
+
+SELECT sum(unique1) over (rows between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 4 | 0
+ 41 | 2 | 2
+ 39 | 1 | 1
+ 38 | 6 | 2
+ 32 | 9 | 1
+ 23 | 8 | 0
+ 15 | 5 | 1
+ 10 | 3 | 3
+ 7 | 7 | 3
+ 0 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 7 | 4 | 0
+ 13 | 2 | 2
+ 22 | 1 | 1
+ 26 | 6 | 2
+ 29 | 9 | 1
+ 31 | 8 | 0
+ 32 | 5 | 1
+ 23 | 3 | 3
+ 15 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 7 | 4 | 0
+ 13 | 2 | 2
+ 22 | 1 | 1
+ 26 | 6 | 2
+ 29 | 9 | 1
+ 31 | 8 | 0
+ 32 | 5 | 1
+ 23 | 3 | 3
+ 15 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 4 | 0
+ 4 | 2 | 2
+ 6 | 1 | 1
+ 3 | 6 | 2
+ 7 | 9 | 1
+ 15 | 8 | 0
+ 17 | 5 | 1
+ 13 | 3 | 3
+ 8 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 1 following and 3 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 9 | 4 | 0
+ 16 | 2 | 2
+ 23 | 1 | 1
+ 22 | 6 | 2
+ 16 | 9 | 1
+ 15 | 8 | 0
+ 10 | 5 | 1
+ 7 | 3 | 3
+ 0 | 7 | 3
+ | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between unbounded preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 6 | 4 | 0
+ 7 | 2 | 2
+ 13 | 1 | 1
+ 22 | 6 | 2
+ 30 | 9 | 1
+ 35 | 8 | 0
+ 38 | 5 | 1
+ 45 | 3 | 3
+ 45 | 7 | 3
+ 45 | 0 | 0
+(10 rows)
+
+-- Test in_range for other numeric datatypes
+create temp table numerics(
+ id int,
+ f_float4 float4,
+ f_float8 float8,
+ f_numeric numeric
+);
+insert into numerics values
+(0, '-infinity', '-infinity', '-infinity'),
+(1, -3, -3, -3),
+(2, -1, -1, -1),
+(3, 0, 0, 0),
+(4, 1.1, 1.1, 1.1),
+(5, 1.12, 1.12, 1.12),
+(6, 2, 2, 2),
+(7, 100, 100, 100),
+(8, 'infinity', 'infinity', 'infinity'),
+(9, 'NaN', 'NaN', 'NaN');
+-- Test in_range for other datetime datatypes
+create temp table datetimes(
+ id int,
+ f_time time,
+ f_timetz timetz,
+ f_interval interval,
+ f_timestamptz timestamptz,
+ f_timestamp timestamp
+);
+-- Show differences in offset interpretation between ROWS, RANGE, and GROUPS
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 4
+ 3 | 9
+ 5 | 15
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 68
+(18 rows)
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 2
+ 1 | 3
+ 1 | 7
+ 5 | 13
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 105
+ 37 | 111
+ 39 | 117
+ 41 | 123
+ 43 | 129
+ 45 | 135
+ 47 | 141
+ 49 | 96
+(26 rows)
+
+-- with UNION
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk2)s LIMIT 0;
+ count
+-------
+(0 rows)
+
+-- check some degenerate cases
+create temp table t1 (f1 int, f2 int8);
+insert into t1 values (1,1),(1,2),(2,2);
+-- ordering by a non-integer constant is allowed
+SELECT rank() OVER (ORDER BY length('abc'));
+ rank
+------
+ 1
+(1 row)
+
+SELECT * FROM rank() OVER (ORDER BY random());
+ERROR: syntax error at or near "ORDER"
+LINE 1: SELECT * FROM rank() OVER (ORDER BY random());
+ ^
+SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+ERROR: syntax error at or near "ORDER"
+LINE 1: SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM te...
+ ^
+-- cleanup
+DROP TABLE empsalary;
+--
+-- Test various built-in aggregates that have moving-aggregate support
+--
+-- test inverse transition functions handle NULLs properly
+SELECT i,AVG(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.5),(2,2.5),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 2.0000000000000000
+ 2 | 2.5000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.1),(2,2.2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3.3
+ 2 | 2.2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT SUM(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.01),(2,2),(3,3)) v(i,n);
+ sum
+------
+ 6.01
+ 5
+ 3
+(3 rows)
+
+SELECT i,COUNT(*) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | count
+---+-------
+ 1 | 4
+ 2 | 3
+ 3 | 2
+ 4 | 1
+(4 rows)
+
+SELECT VAR_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT STDDEV_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+-- test that inverse transition functions work with various frame options
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 1
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,3),(4,4)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 7
+(4 rows)
+
+-- ensure aggregate over numeric properly recovers from NaN values
+SELECT a, b,
+ SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM (VALUES(1,1::numeric),(2,2),(3,'NaN'),(4,3),(5,4)) t(a,b);
+ a | b | sum
+---+-----+-----
+ 1 | 1 | 1
+ 2 | 2 | 3
+ 3 | NaN | NaN
+ 4 | 3 | NaN
+ 5 | 4 | 7
+(5 rows)
+
+-- It might be tempting for someone to add an inverse trans function for
+-- float and double precision. This should not be done as it can give incorrect
+-- results. This test should fail if anyone ever does this without thinking too
+-- hard about it.
+SELECT to_char(SUM(n::float8) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING),'999999999999999999999D9')
+ FROM (VALUES(1,1e20),(2,1)) n(i,n);
+ to_char
+--------------------------
+ 100000000000000000000
+ 1.0
+(2 rows)
+
+SELECT i, b, bool_and(b) OVER w, bool_or(b) OVER w
+ FROM (VALUES (1,true), (2,true), (3,false), (4,false), (5,true)) v(i,b)
+ WINDOW w AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING);
+ i | b | bool_and | bool_or
+---+---+----------+---------
+ 1 | t | t | t
+ 2 | t | f | t
+ 3 | f | f | f
+ 4 | f | f | t
+ 5 | t | t | t
+(5 rows)
+
diff --git a/yql/essentials/tests/postgresql/cases/window.sql b/yql/essentials/tests/postgresql/cases/window.sql
new file mode 100644
index 0000000000..d6481b7112
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/window.sql
@@ -0,0 +1,193 @@
+--
+-- WINDOW FUNCTIONS
+--
+CREATE TEMPORARY TABLE empsalary (
+ depname varchar,
+ empno bigint,
+ salary int,
+ enroll_date date
+);
+INSERT INTO empsalary VALUES
+('develop', 10, 5200, '2007-08-01'),
+('sales', 1, 5000, '2006-10-01'),
+('personnel', 5, 3500, '2007-12-10'),
+('sales', 4, 4800, '2007-08-08'),
+('personnel', 2, 3900, '2006-12-23'),
+('develop', 7, 4200, '2008-01-01'),
+('develop', 9, 4500, '2008-01-01'),
+('sales', 3, 4800, '2007-08-01'),
+('develop', 8, 6000, '2006-10-01'),
+('develop', 11, 5200, '2007-08-15');
+-- empty window specification
+SELECT COUNT(*) OVER () FROM tenk1 WHERE unique2 < 10;
+SELECT COUNT(*) OVER w FROM tenk1 WHERE unique2 < 10 WINDOW w AS ();
+-- no window operation
+SELECT four FROM tenk1 WHERE FALSE WINDOW w AS (PARTITION BY ten);
+SELECT row_number() OVER (ORDER BY unique2) FROM tenk1 WHERE unique2 < 10;
+SELECT count(*) OVER (PARTITION BY four), four FROM (SELECT * FROM tenk1 WHERE two = 1)s WHERE unique2 < 10;
+-- opexpr with different windows evaluation.
+SELECT * FROM(
+ SELECT count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS total,
+ count(*) OVER (PARTITION BY four ORDER BY ten) AS fourcount,
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS twosum
+ FROM tenk1
+)sub
+WHERE total <> fourcount + twosum;
+-- identical windows with different names
+SELECT sum(salary) OVER w1, count(*) OVER w2
+FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary);
+-- empty table
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s;
+-- window function with ORDER BY an expression involving aggregates (9.1 bug)
+select ten,
+ sum(unique1) + sum(unique2) as res,
+ rank() over (order by sum(unique1) + sum(unique2)) as rank
+from tenk1
+group by ten order by ten;
+SELECT sum(unique1) over (rows between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+SELECT sum(unique1) over (rows between 2 preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+SELECT sum(unique1) over (rows between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+SELECT sum(unique1) over (rows between 1 following and 3 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+SELECT sum(unique1) over (rows between unbounded preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+-- Test in_range for other numeric datatypes
+create temp table numerics(
+ id int,
+ f_float4 float4,
+ f_float8 float8,
+ f_numeric numeric
+);
+insert into numerics values
+(0, '-infinity', '-infinity', '-infinity'),
+(1, -3, -3, -3),
+(2, -1, -1, -1),
+(3, 0, 0, 0),
+(4, 1.1, 1.1, 1.1),
+(5, 1.12, 1.12, 1.12),
+(6, 2, 2, 2),
+(7, 100, 100, 100),
+(8, 'infinity', 'infinity', 'infinity'),
+(9, 'NaN', 'NaN', 'NaN');
+-- Test in_range for other datetime datatypes
+create temp table datetimes(
+ id int,
+ f_time time,
+ f_timetz timetz,
+ f_interval interval,
+ f_timestamptz timestamptz,
+ f_timestamp timestamp
+);
+-- Show differences in offset interpretation between ROWS, RANGE, and GROUPS
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+-- with UNION
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk2)s LIMIT 0;
+-- check some degenerate cases
+create temp table t1 (f1 int, f2 int8);
+insert into t1 values (1,1),(1,2),(2,2);
+-- ordering by a non-integer constant is allowed
+SELECT rank() OVER (ORDER BY length('abc'));
+SELECT * FROM rank() OVER (ORDER BY random());
+SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+-- cleanup
+DROP TABLE empsalary;
+--
+-- Test various built-in aggregates that have moving-aggregate support
+--
+-- test inverse transition functions handle NULLs properly
+SELECT i,AVG(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,AVG(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,AVG(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,AVG(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.5),(2,2.5),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.1),(2,2.2),(3,NULL),(4,NULL)) t(i,v);
+SELECT SUM(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.01),(2,2),(3,3)) v(i,n);
+SELECT i,COUNT(*) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT VAR_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VAR_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VAR_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VAR_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VARIANCE(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VARIANCE(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VARIANCE(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT VARIANCE(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT STDDEV_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+SELECT STDDEV_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+SELECT STDDEV_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+SELECT STDDEV_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+SELECT STDDEV(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT STDDEV(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT STDDEV(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+SELECT STDDEV(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+-- test that inverse transition functions work with various frame options
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,3),(4,4)) t(i,v);
+-- ensure aggregate over numeric properly recovers from NaN values
+SELECT a, b,
+ SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM (VALUES(1,1::numeric),(2,2),(3,'NaN'),(4,3),(5,4)) t(a,b);
+-- It might be tempting for someone to add an inverse trans function for
+-- float and double precision. This should not be done as it can give incorrect
+-- results. This test should fail if anyone ever does this without thinking too
+-- hard about it.
+SELECT to_char(SUM(n::float8) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING),'999999999999999999999D9')
+ FROM (VALUES(1,1e20),(2,1)) n(i,n);
+SELECT i, b, bool_and(b) OVER w, bool_or(b) OVER w
+ FROM (VALUES (1,true), (2,true), (3,false), (4,false), (5,true)) v(i,b)
+ WINDOW w AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING);
diff --git a/yql/essentials/tests/postgresql/cases/xml.err b/yql/essentials/tests/postgresql/cases/xml.err
new file mode 100644
index 0000000000..fd345d6cd6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/xml.err
@@ -0,0 +1,2054 @@
+Registering pre-existing tables
+ emp
+<sql-statement>
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (3, '<wrong');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
+ <wrong
+ ^
+
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+<sql-statement>
+SELECT * FROM xmltest;
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('-test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test-');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('test-');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('test-');
+ ^
+<sql-statement>
+SELECT xmlcomment('--test');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('--test');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('--test');
+ ^
+<sql-statement>
+SELECT xmlcomment('te st');
+</sql-statement>
+<sql-statement>
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(xmlcomment('hello'),
+ ^
+<sql-statement>
+SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+SELECT xmlconcat(1, 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(1, 2);
+ ^
+<sql-statement>
+SELECT xmlconcat('bad', '<syntax');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('bad', '<syntax');
+ ^
+<sql-statement>
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL);
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL, NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL, NULL);
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ ^
+<sql-statement>
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ ^
+<sql-statement>
+SELECT xmlelement(name num, 37);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name num, 37);
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, array[1, 2, 3]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, array[1, 2, 3]);
+ ^
+<sql-statement>
+SET xmlbinary TO base64;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO base64;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SET xmlbinary TO hex;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO hex;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes(true as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ ^
+<sql-statement>
+SELECT xmlparse(content '');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '');
+ ^
+<sql-statement>
+SELECT xmlparse(content ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(content 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(document 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidentity>&</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidentity>&</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff);
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'in?>valid');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'in?>valid');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, ' bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, ' bar');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version '2.0');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version '2.0');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ ^
+<sql-statement>
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot (
+ ^
+<sql-statement>
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+SELECT xmlserialize(document 'bad' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(document 'bad' as text);
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:21: Error: alternative is not implemented yet : 143
+ SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml 'abc' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: alternative is not implemented yet : 143
+ SELECT xml 'abc' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT '<>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: alternative is not implemented yet : 143
+ SELECT '<>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <value>one</value><value>two</value>
+ ^
+
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+</sql-statement>
+<sql-statement>
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ ^
+<sql-statement>
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- Check mapping SQL identifier to XML name
+ ^
+<sql-statement>
+SELECT xmlpi(name "123");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "123");
+ ^
+<sql-statement>
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ ^
+<sql-statement>
+SET XML OPTION DOCUMENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('bad');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('bad');
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+SET XML OPTION CONTENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('good');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('good');
+ ^
+<sql-statement>
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+ <!-- hi--> oops <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!-- hi--> <oops/> <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- Test backwards parsing
+ ^
+<sql-statement>
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+ ^
+<sql-statement>
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+ ^
+<sql-statement>
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Text XPath expressions evaluation
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,xml)
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+</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 xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:26: Error: At function: ToPg, At function: Not, At function: Exists
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath('', '<!-- error -->');
+</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 xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('', '<!-- error -->');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</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 xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+<sql-statement>
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+</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 xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<root>&lt;</root>');
+</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 xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+<sql-statement>
+SELECT xpath('//@value', '<root value="&lt;"/>');
+</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 xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+<sql-statement>
+SELECT xpath('''<<invalid>>''', '<root/>');
+</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 xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+</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 xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('/nosuchtag', '<root/>');
+</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 xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('root', '<root/>');
+</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 xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('root', '<root/>');
+ ^
+<sql-statement>
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263
+ -- Round-trip non-ASCII data through xpath().
+ ^
+<sql-statement>
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+</sql-statement>
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+</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 xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+<sql-statement>
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+CREATE TABLE query ( expr TEXT );
+</sql-statement>
+<sql-statement>
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_document('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('abc');
+</sql-statement>
+<sql-statement>
+SET xmloption TO DOCUMENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<abc/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+<sql-statement>
+SET xmloption TO CONTENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+</sql-statement>
+Metacommand \set VERBOSITY terse is not supported
+<sql-statement>
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+</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 xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+\set VERBOSITY default
+</sql-statement>
+Metacommand \set VERBOSITY default is not supported
+<sql-statement>
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Again, the XML isn't well-formed for namespace purposes
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- XPath deprecates relative namespaces, but they're not supposed to
+ ^
+ -stdin-:<main>:3:8: Error: At function: PgCall
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+ -stdin-:<main>:3:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- External entity references should not leak filesystem information.
+ ^
+<sql-statement>
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ ^
+<sql-statement>
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- This might or might not load the requested DTD, but it mustn't throw error.
+ ^
+<sql-statement>
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT * FROM xmltableview1;
+</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.xmltableview1
+
+<sql-statement>
+\sv xmltableview1
+</sql-statement>
+Metacommand \sv xmltableview1 is not supported
+<sql-statement>
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- errors
+ ^
+<sql-statement>
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+SELECT * FROM xmltableview2;
+</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.xmltableview2
+
+<sql-statement>
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'a');
+ ^
+<sql-statement>
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:39: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a text PATH 'foo/namespace::node()');
+ ^
+<sql-statement>
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXECUTE pp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE pp;
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:154: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ ^
+<sql-statement>
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- CDATA test
+ ^
+<sql-statement>
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- XML builtin entities
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- test qual
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (VERBOSE, COSTS OFF)
+ ^
+<sql-statement>
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:8:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name proc,
+ ^
+<sql-statement>
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name data,
+ ^
+<sql-statement>
+CREATE TABLE xmltest2(x xml, _path text);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:83: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ ^
+<sql-statement>
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:61: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:122: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:78: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/xml.err.1 b/yql/essentials/tests/postgresql/cases/xml.err.1
new file mode 100644
index 0000000000..fd345d6cd6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/xml.err.1
@@ -0,0 +1,2054 @@
+Registering pre-existing tables
+ emp
+<sql-statement>
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (3, '<wrong');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
+ <wrong
+ ^
+
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+<sql-statement>
+SELECT * FROM xmltest;
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('-test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test-');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('test-');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('test-');
+ ^
+<sql-statement>
+SELECT xmlcomment('--test');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('--test');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('--test');
+ ^
+<sql-statement>
+SELECT xmlcomment('te st');
+</sql-statement>
+<sql-statement>
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(xmlcomment('hello'),
+ ^
+<sql-statement>
+SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+SELECT xmlconcat(1, 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(1, 2);
+ ^
+<sql-statement>
+SELECT xmlconcat('bad', '<syntax');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('bad', '<syntax');
+ ^
+<sql-statement>
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL);
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL, NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL, NULL);
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ ^
+<sql-statement>
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ ^
+<sql-statement>
+SELECT xmlelement(name num, 37);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name num, 37);
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, array[1, 2, 3]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, array[1, 2, 3]);
+ ^
+<sql-statement>
+SET xmlbinary TO base64;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO base64;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SET xmlbinary TO hex;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO hex;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes(true as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ ^
+<sql-statement>
+SELECT xmlparse(content '');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '');
+ ^
+<sql-statement>
+SELECT xmlparse(content ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(content 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(document 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidentity>&</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidentity>&</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff);
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'in?>valid');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'in?>valid');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, ' bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, ' bar');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version '2.0');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version '2.0');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ ^
+<sql-statement>
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot (
+ ^
+<sql-statement>
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+SELECT xmlserialize(document 'bad' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(document 'bad' as text);
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:21: Error: alternative is not implemented yet : 143
+ SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml 'abc' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: alternative is not implemented yet : 143
+ SELECT xml 'abc' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT '<>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: alternative is not implemented yet : 143
+ SELECT '<>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <value>one</value><value>two</value>
+ ^
+
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+</sql-statement>
+<sql-statement>
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ ^
+<sql-statement>
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- Check mapping SQL identifier to XML name
+ ^
+<sql-statement>
+SELECT xmlpi(name "123");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "123");
+ ^
+<sql-statement>
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ ^
+<sql-statement>
+SET XML OPTION DOCUMENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('bad');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('bad');
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+SET XML OPTION CONTENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('good');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('good');
+ ^
+<sql-statement>
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+ <!-- hi--> oops <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!-- hi--> <oops/> <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- Test backwards parsing
+ ^
+<sql-statement>
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+ ^
+<sql-statement>
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+ ^
+<sql-statement>
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Text XPath expressions evaluation
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,xml)
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+</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 xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:26: Error: At function: ToPg, At function: Not, At function: Exists
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath('', '<!-- error -->');
+</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 xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('', '<!-- error -->');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</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 xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+<sql-statement>
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+</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 xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<root>&lt;</root>');
+</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 xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+<sql-statement>
+SELECT xpath('//@value', '<root value="&lt;"/>');
+</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 xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+<sql-statement>
+SELECT xpath('''<<invalid>>''', '<root/>');
+</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 xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+</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 xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('/nosuchtag', '<root/>');
+</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 xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('root', '<root/>');
+</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 xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('root', '<root/>');
+ ^
+<sql-statement>
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263
+ -- Round-trip non-ASCII data through xpath().
+ ^
+<sql-statement>
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+</sql-statement>
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+</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 xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+<sql-statement>
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+CREATE TABLE query ( expr TEXT );
+</sql-statement>
+<sql-statement>
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_document('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('abc');
+</sql-statement>
+<sql-statement>
+SET xmloption TO DOCUMENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<abc/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+<sql-statement>
+SET xmloption TO CONTENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+</sql-statement>
+Metacommand \set VERBOSITY terse is not supported
+<sql-statement>
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+</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 xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+\set VERBOSITY default
+</sql-statement>
+Metacommand \set VERBOSITY default is not supported
+<sql-statement>
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Again, the XML isn't well-formed for namespace purposes
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- XPath deprecates relative namespaces, but they're not supposed to
+ ^
+ -stdin-:<main>:3:8: Error: At function: PgCall
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+ -stdin-:<main>:3:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- External entity references should not leak filesystem information.
+ ^
+<sql-statement>
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ ^
+<sql-statement>
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- This might or might not load the requested DTD, but it mustn't throw error.
+ ^
+<sql-statement>
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT * FROM xmltableview1;
+</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.xmltableview1
+
+<sql-statement>
+\sv xmltableview1
+</sql-statement>
+Metacommand \sv xmltableview1 is not supported
+<sql-statement>
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- errors
+ ^
+<sql-statement>
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+SELECT * FROM xmltableview2;
+</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.xmltableview2
+
+<sql-statement>
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'a');
+ ^
+<sql-statement>
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:39: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a text PATH 'foo/namespace::node()');
+ ^
+<sql-statement>
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXECUTE pp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE pp;
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:154: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ ^
+<sql-statement>
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- CDATA test
+ ^
+<sql-statement>
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- XML builtin entities
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- test qual
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (VERBOSE, COSTS OFF)
+ ^
+<sql-statement>
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:8:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name proc,
+ ^
+<sql-statement>
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name data,
+ ^
+<sql-statement>
+CREATE TABLE xmltest2(x xml, _path text);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:83: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ ^
+<sql-statement>
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:61: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:122: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:78: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/xml.err.2 b/yql/essentials/tests/postgresql/cases/xml.err.2
new file mode 100644
index 0000000000..fd345d6cd6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/xml.err.2
@@ -0,0 +1,2054 @@
+Registering pre-existing tables
+ emp
+<sql-statement>
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (3, '<wrong');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
+ <wrong
+ ^
+
+ INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+<sql-statement>
+SELECT * FROM xmltest;
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('-test');
+</sql-statement>
+<sql-statement>
+SELECT xmlcomment('test-');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('test-');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('test-');
+ ^
+<sql-statement>
+SELECT xmlcomment('--test');
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlcomment('--test');
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML comment
+
+ SELECT xmlcomment('--test');
+ ^
+<sql-statement>
+SELECT xmlcomment('te st');
+</sql-statement>
+<sql-statement>
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(xmlcomment('hello'),
+ ^
+<sql-statement>
+SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+SELECT xmlconcat(1, 2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(1, 2);
+ ^
+<sql-statement>
+SELECT xmlconcat('bad', '<syntax');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('bad', '<syntax');
+ ^
+<sql-statement>
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL);
+ ^
+<sql-statement>
+SELECT xmlconcat(NULL, NULL);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlconcat(NULL, NULL);
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element,
+ ^
+<sql-statement>
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ ^
+<sql-statement>
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ ^
+<sql-statement>
+SELECT xmlelement(name num, 37);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name num, 37);
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, text 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, text 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xml 'b<a/>r');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xml 'b<a/>r');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, array[1, 2, 3]);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, array[1, 2, 3]);
+ ^
+<sql-statement>
+SET xmlbinary TO base64;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO base64;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SET xmlbinary TO hex;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: xmlbinary
+ SET xmlbinary TO hex;
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, bytea 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, bytea 'bar');
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes(true as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ ^
+<sql-statement>
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ ^
+<sql-statement>
+SELECT xmlparse(content '');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '');
+ ^
+<sql-statement>
+SELECT xmlparse(content ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(content 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(content '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document ' ');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document ' ');
+ ^
+<sql-statement>
+SELECT xmlparse(document 'abc');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document 'abc');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<abc>x</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidentity>&</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidentity>&</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ ^
+<sql-statement>
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlparse(document '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff);
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, 'in?>valid');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, 'in?>valid');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xml, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xml, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name xmlstuff, null);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name xmlstuff, null);
+ ^
+<sql-statement>
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ ^
+<sql-statement>
+SELECT xmlpi(name foo, ' bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name foo, ' bar');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version '2.0');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version '2.0');
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ ^
+<sql-statement>
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ ^
+<sql-statement>
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlroot (
+ ^
+<sql-statement>
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+SELECT xmlserialize(document 'bad' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 393
+ SELECT xmlserialize(document 'bad' as text);
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:21: Error: alternative is not implemented yet : 143
+ SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xml 'abc' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:18: Error: alternative is not implemented yet : 143
+ SELECT xml 'abc' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT '<>' IS NOT DOCUMENT;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:13: Error: alternative is not implemented yet : 143
+ SELECT '<>' IS NOT DOCUMENT;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <value>one</value><value>two</value>
+ ^
+
+ SELECT xmlagg(data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+</sql-statement>
+<sql-statement>
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ ^
+<sql-statement>
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- Check mapping SQL identifier to XML name
+ ^
+<sql-statement>
+SELECT xmlpi(name "123");
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT xmlpi(name "123");
+ ^
+<sql-statement>
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 301
+ PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ ^
+<sql-statement>
+SET XML OPTION DOCUMENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('bad');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('bad');
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+SET XML OPTION CONTENT;
+</sql-statement>
+<sql-statement>
+EXECUTE foo ('<bar/>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('<bar/>');
+ ^
+<sql-statement>
+EXECUTE foo ('good');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE foo ('good');
+ ^
+<sql-statement>
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/>';
+</sql-statement>
+<sql-statement>
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+ <!-- hi--> oops <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!-- hi--> <oops/> <!DOCTYPE a><a/>
+ ^
+
+ SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+<sql-statement>
+SELECT xml '<!DOCTYPE a><a/><b/>';
+</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: Result
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: invalid XML document
+DETAIL: line 1: Extra content at the end of the document
+ <!DOCTYPE a><a/><b/>
+ ^
+
+ SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+<sql-statement>
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ -- Test backwards parsing
+ ^
+<sql-statement>
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ ^
+<sql-statement>
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+ ^
+<sql-statement>
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ ^
+<sql-statement>
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+ ^
+<sql-statement>
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+ ^
+<sql-statement>
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ ^
+<sql-statement>
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+ ^
+<sql-statement>
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: expected at least one target column
+ CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+ ^
+<sql-statement>
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+</sql-statement>
+<sql-statement>
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Text XPath expressions evaluation
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,xml)
+ SELECT xpath('/value', data) FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+</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 xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:26: Error: At function: ToPg, At function: Not, At function: Exists
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ^
+<sql-statement>
+SELECT xpath('', '<!-- error -->');
+</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 xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('', '<!-- error -->');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('', '<!-- error -->');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</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 xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ ^
+<sql-statement>
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+</sql-statement>
+<sql-statement>
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+</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 xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ ^
+<sql-statement>
+SELECT xpath('//text()', '<root>&lt;</root>');
+</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 xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+<sql-statement>
+SELECT xpath('//@value', '<root value="&lt;"/>');
+</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 xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+<sql-statement>
+SELECT xpath('''<<invalid>>''', '<root/>');
+</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 xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+</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 xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+</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 xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+<sql-statement>
+SELECT xpath('/nosuchtag', '<root/>');
+</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 xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/nosuchtag', '<root/>');
+ ^
+<sql-statement>
+SELECT xpath('root', '<root/>');
+</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 xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('root', '<root/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('root', '<root/>');
+ ^
+<sql-statement>
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263
+ -- Round-trip non-ASCII data through xpath().
+ ^
+<sql-statement>
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+</sql-statement>
+<sql-statement>
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+</sql-statement>
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+</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 xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ ^
+<sql-statement>
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+</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 xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+<sql-statement>
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>: Error: At function: PgSetItem
+
+ -stdin-:<main>:1:1: Error: At function: PgWhere
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: At function: PgCall
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+ -stdin-:<main>:1:37: Error: Unable to find an overload for proc xpath_exists with given argument types: (unknown,xml)
+ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ ^
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+</sql-statement>
+<sql-statement>
+CREATE TABLE query ( expr TEXT );
+</sql-statement>
+<sql-statement>
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+</sql-statement>
+<sql-statement>
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+</sql-statement>
+<sql-statement>
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_document('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed_content('abc');
+</sql-statement>
+<sql-statement>
+SET xmloption TO DOCUMENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<abc/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo>bar</foo');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+</sql-statement>
+<sql-statement>
+SET xmloption TO CONTENT;
+</sql-statement>
+<sql-statement>
+SELECT xml_is_well_formed('abc');
+</sql-statement>
+<sql-statement>
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+</sql-statement>
+Metacommand \set VERBOSITY terse is not supported
+<sql-statement>
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+</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 xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: At function: PgCall
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+ -stdin-:<main>:1:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ ^
+<sql-statement>
+\set VERBOSITY default
+</sql-statement>
+Metacommand \set VERBOSITY default is not supported
+<sql-statement>
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- Again, the XML isn't well-formed for namespace purposes
+ ^
+ -stdin-:<main>:2:8: Error: At function: PgCall
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+ -stdin-:<main>:2:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+<sql-statement>
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+</sql-statement>
+-stdin-:<main>: Error: Type annotation
+
+ -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
+ -- XPath deprecates relative namespaces, but they're not supposed to
+ ^
+ -stdin-:<main>:3:8: Error: At function: PgCall
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+ -stdin-:<main>:3:8: Error: Unable to find an overload for proc xpath with given argument types: (unknown,unknown)
+ SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+<sql-statement>
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- External entity references should not leak filesystem information.
+ ^
+<sql-statement>
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ ^
+<sql-statement>
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: alternative is not implemented yet : 143
+ -- This might or might not load the requested DTD, but it mustn't throw error.
+ ^
+<sql-statement>
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT * FROM xmltableview1;
+</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.xmltableview1
+
+<sql-statement>
+\sv xmltableview1
+</sql-statement>
+Metacommand \sv xmltableview1 is not supported
+<sql-statement>
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ ^
+<sql-statement>
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- errors
+ ^
+<sql-statement>
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'zz:a');
+ ^
+<sql-statement>
+SELECT * FROM xmltableview2;
+</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.xmltableview2
+
+<sql-statement>
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:4:37: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a int PATH 'a');
+ ^
+<sql-statement>
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:3:39: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS a text PATH 'foo/namespace::node()');
+ ^
+<sql-statement>
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXECUTE pp;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 302
+ EXECUTE pp;
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:137: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:154: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ ^
+<sql-statement>
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- CDATA test
+ ^
+<sql-statement>
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- XML builtin entities
+ ^
+<sql-statement>
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: SelectStmt: alternative is not implemented yet : 371
+ -- test qual
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
+ EXPLAIN (VERBOSE, COSTS OFF)
+ ^
+<sql-statement>
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:5:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:6:41: Error: ERROR: unrecognized column option "PATH"
+
+ COLUMNS id int PATH '@id',
+ ^
+<sql-statement>
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:8:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name proc,
+ ^
+<sql-statement>
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:7:4: Error: alternative is not implemented yet : 143
+ y AS (SELECT xmlelement(name data,
+ ^
+<sql-statement>
+CREATE TABLE xmltest2(x xml, _path text);
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+</sql-statement>
+<sql-statement>
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+</sql-statement>
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:83: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ ^
+<sql-statement>
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:109: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ ^
+<sql-statement>
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:2:61: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:122: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+ ^
+<sql-statement>
+\x
+</sql-statement>
+Metacommand \x is not supported
+<sql-statement>
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+</sql-statement>
+-stdin-:<main>: Error: Parse Sql
+
+ -stdin-:<main>:1:78: Error: ERROR: unrecognized column option "PATH"
+
+ SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ ^
diff --git a/yql/essentials/tests/postgresql/cases/xml.out b/yql/essentials/tests/postgresql/cases/xml.out
new file mode 100644
index 0000000000..7e539c8abd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/xml.out
@@ -0,0 +1,79 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+SELECT * FROM xmltest;
+ id | data
+----+--------------------
+ 1 | <value>one</value>
+ 2 | <value>two</value>
+(2 rows)
+
+SELECT xmlcomment('test');
+ xmlcomment
+-------------
+ <!--test-->
+(1 row)
+
+SELECT xmlcomment('-test');
+ xmlcomment
+--------------
+ <!---test-->
+(1 row)
+
+SELECT xmlcomment('test-');
+ERROR: invalid XML comment
+SELECT xmlcomment('--test');
+ERROR: invalid XML comment
+SELECT xmlcomment('te st');
+ xmlcomment
+--------------
+ <!--te st-->
+(1 row)
+
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+ xmlagg
+--------
+
+(1 row)
+
+SET XML OPTION DOCUMENT;
+SET XML OPTION CONTENT;
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+ xml
+--------------------------------------------------------------------
+ <!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+ xml
+------------------------------
+ <!-- hi--> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<!DOCTYPE a><a/>';
+ xml
+------------------
+ <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+-------
+ {1,2}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" id=\"1\">number one</local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" xmlns=\"http://127.0.0.2\" id=\"1\"><internal>number one</internal><internal2/></local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/cases/xml.sql b/yql/essentials/tests/postgresql/cases/xml.sql
new file mode 100644
index 0000000000..1eb81a6b29
--- /dev/null
+++ b/yql/essentials/tests/postgresql/cases/xml.sql
@@ -0,0 +1,21 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+SELECT * FROM xmltest;
+SELECT xmlcomment('test');
+SELECT xmlcomment('-test');
+SELECT xmlcomment('test-');
+SELECT xmlcomment('--test');
+SELECT xmlcomment('te st');
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+SET XML OPTION DOCUMENT;
+SET XML OPTION CONTENT;
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+SELECT xml '<!DOCTYPE a><a/>';
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
diff --git a/yql/essentials/tests/postgresql/common/__init__.py b/yql/essentials/tests/postgresql/common/__init__.py
new file mode 100644
index 0000000000..e4238ef56a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/common/__init__.py
@@ -0,0 +1,129 @@
+import sys
+import logging
+from pathlib import Path
+import subprocess
+from .differ import Differ
+
+
+LOGGER = logging.getLogger(__name__)
+
+
+def setup_logger():
+ options = dict(
+ level=logging.DEBUG,
+ format='%(levelname)s: %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S',
+ stream=sys.stderr
+ )
+
+ logging.basicConfig(**options)
+
+
+setup_logger()
+
+
+def find_sql_tests(path):
+ tests = []
+
+ for sql_file in Path(path).glob('*.sql'):
+ if not sql_file.is_file():
+ LOGGER.warning("'%s' is not a file", sql_file.absolute())
+ continue
+
+ out_files = list(get_out_files(sql_file))
+ if not out_files:
+ LOGGER.warning("No .out files found for '%s'", sql_file.absolute())
+ continue
+
+ tests.append((sql_file.stem, (sql_file, out_files)))
+
+ return tests
+
+
+def load_init_scripts_for_testcase(testcase_name, init_scripts_cfg, init_scripts_dir):
+ with open(init_scripts_cfg, 'r') as cfg:
+ for lineno, line in enumerate(cfg, 1):
+ cfgline = line.strip().split(':')
+ if len(cfgline) != 2:
+ LOGGER.info("Bad line %d in init scripts configuration '%s'", lineno, init_scripts_cfg)
+ continue
+
+ if cfgline[0].strip() == testcase_name:
+ break
+ else:
+ return []
+
+ avail_scripts = frozenset(s.stem for s in init_scripts_dir.glob("*.sql"))
+
+ scripts = [(init_scripts_dir / s).with_suffix(".sql") for s in cfgline[1].split() if s in avail_scripts]
+
+ if scripts:
+ LOGGER.debug("Init scripts: %s", ", ".join(s.stem for s in scripts))
+
+ return scripts
+
+
+def run_sql_test(sql, out, tmp_path, runner, udfs, init_scripts_cfg, init_scripts_dir):
+ args = [runner, "--datadir", tmp_path]
+ for udf in udfs:
+ args.append("--udf")
+ args.append(udf)
+
+ LOGGER.debug("Loading init scripts for '%s' from '%s'", sql.stem, init_scripts_cfg)
+ init_scripts = load_init_scripts_for_testcase(sql.stem, init_scripts_cfg, Path(init_scripts_dir))
+
+ if init_scripts:
+ LOGGER.debug("Executing init scripts for '%s'", sql.stem)
+ for script in init_scripts:
+ LOGGER.debug("Executing init script '%s'", script.name)
+ with open(script, 'rb') as f:
+ pi = subprocess.run(args,
+ stdin=f, stdout=subprocess.PIPE, stderr=sys.stderr, check=True)
+
+ LOGGER.debug("Running %s '%s' -> [%s]", runner, sql, ', '.join("'{}'".format(a) for a in out))
+ with open(sql, 'rb') as f:
+ pi = subprocess.run(args,
+ stdin=f, stdout=subprocess.PIPE, stderr=sys.stderr, check=True)
+
+ min_diff = sys.maxsize
+ best_match = out[0]
+ best_diff = ''
+
+ for out_file in out:
+ with open(out_file, 'rb') as f:
+ out_data = f.read()
+
+ last_diff = Differ.diff(pi.stdout, out_data)
+ diff_len = len(last_diff)
+
+ if diff_len == 0:
+ return
+
+ if diff_len < min_diff:
+ min_diff = diff_len
+ best_match = out_file
+ best_diff = last_diff
+
+ LOGGER.info("No exact match for '%s'. Best match is '%s'", sql, best_match)
+ for line in best_diff:
+ LOGGER.debug(line)
+
+ # We need assert to fail the test properly
+ assert min_diff == 0, \
+ f"pgrun output does not match out-file for {sql}. Diff:\n" + ''.join(d.decode('utf8') for d in best_diff)[:1024]
+
+
+def get_out_files(sql_file):
+ base_name = sql_file.stem
+ out_file = sql_file.with_suffix('.out')
+
+ if out_file.is_file():
+ yield out_file
+
+ for i in range(1, 10):
+ nth_out_file = out_file.with_stem('{}_{}'.format(base_name, i))
+
+ if not nth_out_file.is_file():
+ break
+
+ yield nth_out_file
diff --git a/yql/essentials/tests/postgresql/common/differ.py b/yql/essentials/tests/postgresql/common/differ.py
new file mode 100644
index 0000000000..3b29d2cdd5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/common/differ.py
@@ -0,0 +1,91 @@
+import difflib
+import re
+
+
+class Differ:
+ @classmethod
+ def diff(cls, left, right):
+ left = cls.__remove_pg_error_msgs(left).splitlines(keepends=True)
+ right = cls.__remove_pg_error_msgs(right).splitlines(keepends=True)
+
+ cls.__unify_tables(left, right)
+
+ return list(difflib.diff_bytes(difflib.unified_diff, left, right, n=0, fromfile=b'sql', tofile=b'out'))
+
+ __reErr = re.compile(b'(^ERROR: [^\n]+)(?:\nLINE \\d+: [^\n]+(?:\n\\s*\\^\\s*)?)?(?:\n(?:HINT|DETAIL|CONTEXT): [^\n]+)*(?:\n|$)',
+ re.MULTILINE)
+
+ @classmethod
+ def __remove_pg_error_msgs(cls, s):
+ return cls.__reErr.sub(rb"\1", s)
+
+ __reUniversalTableMarker = re.compile(rb'^-{3,100}(?:\+-{3,100})*$')
+ __reTableEndMarker = re.compile(rb'^\(\d+ rows?\)$')
+
+ @classmethod
+ def __is_table_start(cls, pgrun_output: str, row_idx):
+ is_0_col_tbl_start = pgrun_output[row_idx] == b'--\n' and row_idx + 1 < len(pgrun_output) \
+ and cls.__reTableEndMarker.match(pgrun_output[row_idx + 1])
+ return is_0_col_tbl_start or cls.__reUniversalTableMarker.match(pgrun_output[row_idx])
+
+ @classmethod
+ def __reformat_table_row(cls, row, col_widths):
+ cells = [c.strip() for c in row[:-1].split(b'|')]
+ return b'|'.join(c.ljust(w) for (c, w) in zip(cells, col_widths))
+
+ @classmethod
+ def __remove_table_headers(cls, lines, header_line_numbers):
+ for i in reversed(header_line_numbers):
+ del lines[i]
+ del lines[i-1]
+
+ @classmethod
+ def __unify_tables(cls, left, right):
+ left_headers = []
+ right_headers = []
+ ucols = []
+
+ in_table = False
+ R = enumerate(right)
+ for i, l in enumerate(left):
+ if in_table:
+ if cls.__reTableEndMarker.match(l):
+ in_table = False
+
+ for (j, r) in R:
+ if cls.__reTableEndMarker.match(r):
+ break
+ right[j] = cls.__reformat_table_row(r, ucols)
+ else:
+ break
+
+ continue
+
+ left[i] = cls.__reformat_table_row(l, ucols)
+
+ continue
+
+ if cls.__is_table_start(left, i):
+ for (j, r) in R:
+ if cls.__is_table_start(right, j):
+ break
+ else:
+ continue
+ lcols = [len(c) for c in l[:-1].split(b'+')]
+ rcols = [len(c) for c in r[:-1].split(b'+')]
+
+ if left[i-1] == right[j-1]:
+ continue
+
+ if len(lcols) != len(rcols):
+ continue
+
+ ucols = [max(lw, rw) for lw, rw in zip(lcols, rcols)]
+
+ left_headers.append(i)
+ right_headers.append(j)
+
+ in_table = True
+
+ cls.__remove_table_headers(left, left_headers)
+ cls.__remove_table_headers(right, right_headers)
diff --git a/yql/essentials/tests/postgresql/common/ya.make b/yql/essentials/tests/postgresql/common/ya.make
new file mode 100644
index 0000000000..c354d69518
--- /dev/null
+++ b/yql/essentials/tests/postgresql/common/ya.make
@@ -0,0 +1,8 @@
+PY3_LIBRARY()
+
+PY_SRCS(
+ __init__.py
+ differ.py
+)
+
+END()
diff --git a/yql/essentials/tests/postgresql/initscripts/aggtest.sql b/yql/essentials/tests/postgresql/initscripts/aggtest.sql
new file mode 100644
index 0000000000..e4bc11b880
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/aggtest.sql
@@ -0,0 +1,11 @@
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+
+INSERT INTO aggtest VALUES
+(56, 7.8),
+(100, 99.097),
+(0, 0.09561),
+(42, 324.78);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/char_tbl.sql b/yql/essentials/tests/postgresql/initscripts/char_tbl.sql
new file mode 100644
index 0000000000..00ac6b34fb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/char_tbl.sql
@@ -0,0 +1,7 @@
+CREATE TABLE CHAR_TBL(f1 char(4));
+
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/date_tbl.sql b/yql/essentials/tests/postgresql/initscripts/date_tbl.sql
new file mode 100644
index 0000000000..f66a7531e5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/date_tbl.sql
@@ -0,0 +1,19 @@
+CREATE TABLE date_tbl (f1 date);
+
+INSERT INTO date_tbl VALUES ('1957-04-09');
+INSERT INTO date_tbl VALUES ('1957-06-13');
+INSERT INTO date_tbl VALUES ('1996-02-28');
+INSERT INTO date_tbl VALUES ('1996-02-29');
+INSERT INTO date_tbl VALUES ('1996-03-01');
+INSERT INTO date_tbl VALUES ('1996-03-02');
+INSERT INTO date_tbl VALUES ('1997-02-28');
+INSERT INTO date_tbl VALUES ('1997-03-01');
+INSERT INTO date_tbl VALUES ('1997-03-02');
+INSERT INTO date_tbl VALUES ('2000-04-01');
+INSERT INTO date_tbl VALUES ('2000-04-02');
+INSERT INTO date_tbl VALUES ('2000-04-03');
+INSERT INTO date_tbl VALUES ('2038-04-08');
+INSERT INTO date_tbl VALUES ('2039-04-09');
+INSERT INTO date_tbl VALUES ('2040-04-10');
+INSERT INTO date_tbl VALUES ('2040-04-10 BC');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/emp.sql b/yql/essentials/tests/postgresql/initscripts/emp.sql
new file mode 100644
index 0000000000..b9460d1a3a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/emp.sql
@@ -0,0 +1,14 @@
+CREATE TABLE emp (
+ name text,
+ age int4,
+ -- TODO: uncomment after point type gets supported
+ --location point
+ salary int4,
+ manager name
+);
+
+INSERT INTO emp VALUES
+('sharon', 25, /*(15,12),*/ 1000, 'sam'),
+('sam', 30, /*(10,5),*/ 2000, 'bill'),
+('bill', 20, /*(11,10),*/ 1000, 'sharon');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/equipment_r_0.sql b/yql/essentials/tests/postgresql/initscripts/equipment_r_0.sql
new file mode 100644
index 0000000000..8068ab085f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/equipment_r_0.sql
@@ -0,0 +1,5 @@
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/float8_tbl.sql b/yql/essentials/tests/postgresql/initscripts/float8_tbl.sql
new file mode 100644
index 0000000000..f4b4cac0ca
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/float8_tbl.sql
@@ -0,0 +1,13 @@
+CREATE TABLE FLOAT8_TBL(f1 float8);
+
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+
+CREATE TABLE float8_tbl(f1 float8);
+
+INSERT INTO float8_tbl
+SELECT * FROM LOAT8_TBL;
+
diff --git a/yql/essentials/tests/postgresql/initscripts/hobbies_r_0.sql b/yql/essentials/tests/postgresql/initscripts/hobbies_r_0.sql
new file mode 100644
index 0000000000..219ccf01b0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/hobbies_r_0.sql
@@ -0,0 +1,5 @@
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/int2_tbl.sql b/yql/essentials/tests/postgresql/initscripts/int2_tbl.sql
new file mode 100644
index 0000000000..ccb86462df
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/int2_tbl.sql
@@ -0,0 +1,12 @@
+CREATE TABLE INT2_TBL(f1 int2);
+
+INSERT INTO INT2_TBL(f1) VALUES ('0');
+INSERT INTO INT2_TBL(f1) VALUES ('1234');
+INSERT INTO INT2_TBL(f1) VALUES ('-1234');
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+
+CREATE TABLE int2_tbl(f1 int2);
+INSERT INTO int2_tbl
+SELECT * FROM INT2_TBL;
+
diff --git a/yql/essentials/tests/postgresql/initscripts/int4_tbl.sql b/yql/essentials/tests/postgresql/initscripts/int4_tbl.sql
new file mode 100644
index 0000000000..11c0eccbe5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/int4_tbl.sql
@@ -0,0 +1,13 @@
+CREATE TABLE INT4_TBL(f1 int4);
+
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+
+CREATE TABLE int4_tbl(f1 int4);
+
+INSERT INTO int4_tbl
+SELECT * FROM INT4_TBL;
+
diff --git a/yql/essentials/tests/postgresql/initscripts/int8_tbl.sql b/yql/essentials/tests/postgresql/initscripts/int8_tbl.sql
new file mode 100644
index 0000000000..a8d08d85ca
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/int8_tbl.sql
@@ -0,0 +1,8 @@
+CREATE TABLE int8_tbl(q1 int8, q2 int8);
+
+INSERT INTO int8_tbl VALUES(' 123 ',' 456');
+INSERT INTO int8_tbl VALUES('123 ','4567890123456789');
+INSERT INTO int8_tbl VALUES('4567890123456789','123');
+INSERT INTO int8_tbl VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO int8_tbl VALUES('+4567890123456789','-4567890123456789');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/interval_tbl.sql b/yql/essentials/tests/postgresql/initscripts/interval_tbl.sql
new file mode 100644
index 0000000000..f3de944b30
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/interval_tbl.sql
@@ -0,0 +1,13 @@
+CREATE TABLE INTERVAL_TBL (f1 interval);
+
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/onek.sql b/yql/essentials/tests/postgresql/initscripts/onek.sql
new file mode 100644
index 0000000000..64bbc15299
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/onek.sql
@@ -0,0 +1,1021 @@
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+INSERT INTO onek VALUES
+(147, 0, 1, 3, 7, 7, 7, 47, 147, 147, 147, 14, 15, 'RFAAAA', 'AAAAAA', 'AAAAxx'),
+(931, 1, 1, 3, 1, 11, 1, 31, 131, 431, 931, 2, 3, 'VJAAAA', 'BAAAAA', 'HHHHxx'),
+(714, 2, 0, 2, 4, 14, 4, 14, 114, 214, 714, 8, 9, 'MBAAAA', 'CAAAAA', 'OOOOxx'),
+(711, 3, 1, 3, 1, 11, 1, 11, 111, 211, 711, 2, 3, 'JBAAAA', 'DAAAAA', 'VVVVxx'),
+(883, 4, 1, 3, 3, 3, 3, 83, 83, 383, 883, 6, 7, 'ZHAAAA', 'EAAAAA', 'AAAAxx'),
+(439, 5, 1, 3, 9, 19, 9, 39, 39, 439, 439, 18, 19, 'XQAAAA', 'FAAAAA', 'HHHHxx'),
+(670, 6, 0, 2, 0, 10, 0, 70, 70, 170, 670, 0, 1, 'UZAAAA', 'GAAAAA', 'OOOOxx'),
+(543, 7, 1, 3, 3, 3, 3, 43, 143, 43, 543, 6, 7, 'XUAAAA', 'HAAAAA', 'VVVVxx'),
+(425, 8, 1, 1, 5, 5, 5, 25, 25, 425, 425, 10, 11, 'JQAAAA', 'IAAAAA', 'AAAAxx'),
+(800, 9, 0, 0, 0, 0, 0, 0, 0, 300, 800, 0, 1, 'UEAAAA', 'JAAAAA', 'HHHHxx'),
+(489, 10, 1, 1, 9, 9, 9, 89, 89, 489, 489, 18, 19, 'VSAAAA', 'KAAAAA', 'OOOOxx'),
+(494, 11, 0, 2, 4, 14, 4, 94, 94, 494, 494, 8, 9, 'ATAAAA', 'LAAAAA', 'VVVVxx'),
+(880, 12, 0, 0, 0, 0, 0, 80, 80, 380, 880, 0, 1, 'WHAAAA', 'MAAAAA', 'AAAAxx'),
+(611, 13, 1, 3, 1, 11, 1, 11, 11, 111, 611, 2, 3, 'NXAAAA', 'NAAAAA', 'HHHHxx'),
+(226, 14, 0, 2, 6, 6, 6, 26, 26, 226, 226, 12, 13, 'SIAAAA', 'OAAAAA', 'OOOOxx'),
+(774, 15, 0, 2, 4, 14, 4, 74, 174, 274, 774, 8, 9, 'UDAAAA', 'PAAAAA', 'VVVVxx'),
+(298, 16, 0, 2, 8, 18, 8, 98, 98, 298, 298, 16, 17, 'MLAAAA', 'QAAAAA', 'AAAAxx'),
+(682, 17, 0, 2, 2, 2, 2, 82, 82, 182, 682, 4, 5, 'GAAAAA', 'RAAAAA', 'HHHHxx'),
+(864, 18, 0, 0, 4, 4, 4, 64, 64, 364, 864, 8, 9, 'GHAAAA', 'SAAAAA', 'OOOOxx'),
+(183, 19, 1, 3, 3, 3, 3, 83, 183, 183, 183, 6, 7, 'BHAAAA', 'TAAAAA', 'VVVVxx'),
+(885, 20, 1, 1, 5, 5, 5, 85, 85, 385, 885, 10, 11, 'BIAAAA', 'UAAAAA', 'AAAAxx'),
+(997, 21, 1, 1, 7, 17, 7, 97, 197, 497, 997, 14, 15, 'JMAAAA', 'VAAAAA', 'HHHHxx'),
+(966, 22, 0, 2, 6, 6, 6, 66, 166, 466, 966, 12, 13, 'ELAAAA', 'WAAAAA', 'OOOOxx'),
+(389, 23, 1, 1, 9, 9, 9, 89, 189, 389, 389, 18, 19, 'ZOAAAA', 'XAAAAA', 'VVVVxx'),
+(846, 24, 0, 2, 6, 6, 6, 46, 46, 346, 846, 12, 13, 'OGAAAA', 'YAAAAA', 'AAAAxx'),
+(206, 25, 0, 2, 6, 6, 6, 6, 6, 206, 206, 12, 13, 'YHAAAA', 'ZAAAAA', 'HHHHxx'),
+(239, 26, 1, 3, 9, 19, 9, 39, 39, 239, 239, 18, 19, 'FJAAAA', 'ABAAAA', 'OOOOxx'),
+(365, 27, 1, 1, 5, 5, 5, 65, 165, 365, 365, 10, 11, 'BOAAAA', 'BBAAAA', 'VVVVxx'),
+(204, 28, 0, 0, 4, 4, 4, 4, 4, 204, 204, 8, 9, 'WHAAAA', 'CBAAAA', 'AAAAxx'),
+(690, 29, 0, 2, 0, 10, 0, 90, 90, 190, 690, 0, 1, 'OAAAAA', 'DBAAAA', 'HHHHxx'),
+(69, 30, 1, 1, 9, 9, 9, 69, 69, 69, 69, 18, 19, 'RCAAAA', 'EBAAAA', 'OOOOxx'),
+(358, 31, 0, 2, 8, 18, 8, 58, 158, 358, 358, 16, 17, 'UNAAAA', 'FBAAAA', 'VVVVxx'),
+(269, 32, 1, 1, 9, 9, 9, 69, 69, 269, 269, 18, 19, 'JKAAAA', 'GBAAAA', 'AAAAxx'),
+(663, 33, 1, 3, 3, 3, 3, 63, 63, 163, 663, 6, 7, 'NZAAAA', 'HBAAAA', 'HHHHxx'),
+(608, 34, 0, 0, 8, 8, 8, 8, 8, 108, 608, 16, 17, 'KXAAAA', 'IBAAAA', 'OOOOxx'),
+(398, 35, 0, 2, 8, 18, 8, 98, 198, 398, 398, 16, 17, 'IPAAAA', 'JBAAAA', 'VVVVxx'),
+(330, 36, 0, 2, 0, 10, 0, 30, 130, 330, 330, 0, 1, 'SMAAAA', 'KBAAAA', 'AAAAxx'),
+(529, 37, 1, 1, 9, 9, 9, 29, 129, 29, 529, 18, 19, 'JUAAAA', 'LBAAAA', 'HHHHxx'),
+(555, 38, 1, 3, 5, 15, 5, 55, 155, 55, 555, 10, 11, 'JVAAAA', 'MBAAAA', 'OOOOxx'),
+(746, 39, 0, 2, 6, 6, 6, 46, 146, 246, 746, 12, 13, 'SCAAAA', 'NBAAAA', 'VVVVxx'),
+(558, 40, 0, 2, 8, 18, 8, 58, 158, 58, 558, 16, 17, 'MVAAAA', 'OBAAAA', 'AAAAxx'),
+(574, 41, 0, 2, 4, 14, 4, 74, 174, 74, 574, 8, 9, 'CWAAAA', 'PBAAAA', 'HHHHxx'),
+(343, 42, 1, 3, 3, 3, 3, 43, 143, 343, 343, 6, 7, 'FNAAAA', 'QBAAAA', 'OOOOxx'),
+(120, 43, 0, 0, 0, 0, 0, 20, 120, 120, 120, 0, 1, 'QEAAAA', 'RBAAAA', 'VVVVxx'),
+(461, 44, 1, 1, 1, 1, 1, 61, 61, 461, 461, 2, 3, 'TRAAAA', 'SBAAAA', 'AAAAxx'),
+(754, 45, 0, 2, 4, 14, 4, 54, 154, 254, 754, 8, 9, 'ADAAAA', 'TBAAAA', 'HHHHxx'),
+(772, 46, 0, 0, 2, 12, 2, 72, 172, 272, 772, 4, 5, 'SDAAAA', 'UBAAAA', 'OOOOxx'),
+(749, 47, 1, 1, 9, 9, 9, 49, 149, 249, 749, 18, 19, 'VCAAAA', 'VBAAAA', 'VVVVxx'),
+(386, 48, 0, 2, 6, 6, 6, 86, 186, 386, 386, 12, 13, 'WOAAAA', 'WBAAAA', 'AAAAxx'),
+(9, 49, 1, 1, 9, 9, 9, 9, 9, 9, 9, 18, 19, 'JAAAAA', 'XBAAAA', 'HHHHxx'),
+(771, 50, 1, 3, 1, 11, 1, 71, 171, 271, 771, 2, 3, 'RDAAAA', 'YBAAAA', 'OOOOxx'),
+(470, 51, 0, 2, 0, 10, 0, 70, 70, 470, 470, 0, 1, 'CSAAAA', 'ZBAAAA', 'VVVVxx'),
+(238, 52, 0, 2, 8, 18, 8, 38, 38, 238, 238, 16, 17, 'EJAAAA', 'ACAAAA', 'AAAAxx'),
+(86, 53, 0, 2, 6, 6, 6, 86, 86, 86, 86, 12, 13, 'IDAAAA', 'BCAAAA', 'HHHHxx'),
+(56, 54, 0, 0, 6, 16, 6, 56, 56, 56, 56, 12, 13, 'ECAAAA', 'CCAAAA', 'OOOOxx'),
+(767, 55, 1, 3, 7, 7, 7, 67, 167, 267, 767, 14, 15, 'NDAAAA', 'DCAAAA', 'VVVVxx'),
+(363, 56, 1, 3, 3, 3, 3, 63, 163, 363, 363, 6, 7, 'ZNAAAA', 'ECAAAA', 'AAAAxx'),
+(655, 57, 1, 3, 5, 15, 5, 55, 55, 155, 655, 10, 11, 'FZAAAA', 'FCAAAA', 'HHHHxx'),
+(394, 58, 0, 2, 4, 14, 4, 94, 194, 394, 394, 8, 9, 'EPAAAA', 'GCAAAA', 'OOOOxx'),
+(223, 59, 1, 3, 3, 3, 3, 23, 23, 223, 223, 6, 7, 'PIAAAA', 'HCAAAA', 'VVVVxx'),
+(946, 60, 0, 2, 6, 6, 6, 46, 146, 446, 946, 12, 13, 'KKAAAA', 'ICAAAA', 'AAAAxx'),
+(863, 61, 1, 3, 3, 3, 3, 63, 63, 363, 863, 6, 7, 'FHAAAA', 'JCAAAA', 'HHHHxx'),
+(913, 62, 1, 1, 3, 13, 3, 13, 113, 413, 913, 6, 7, 'DJAAAA', 'KCAAAA', 'OOOOxx'),
+(737, 63, 1, 1, 7, 17, 7, 37, 137, 237, 737, 14, 15, 'JCAAAA', 'LCAAAA', 'VVVVxx'),
+(65, 64, 1, 1, 5, 5, 5, 65, 65, 65, 65, 10, 11, 'NCAAAA', 'MCAAAA', 'AAAAxx'),
+(251, 65, 1, 3, 1, 11, 1, 51, 51, 251, 251, 2, 3, 'RJAAAA', 'NCAAAA', 'HHHHxx'),
+(686, 66, 0, 2, 6, 6, 6, 86, 86, 186, 686, 12, 13, 'KAAAAA', 'OCAAAA', 'OOOOxx'),
+(971, 67, 1, 3, 1, 11, 1, 71, 171, 471, 971, 2, 3, 'JLAAAA', 'PCAAAA', 'VVVVxx'),
+(775, 68, 1, 3, 5, 15, 5, 75, 175, 275, 775, 10, 11, 'VDAAAA', 'QCAAAA', 'AAAAxx'),
+(577, 69, 1, 1, 7, 17, 7, 77, 177, 77, 577, 14, 15, 'FWAAAA', 'RCAAAA', 'HHHHxx'),
+(830, 70, 0, 2, 0, 10, 0, 30, 30, 330, 830, 0, 1, 'YFAAAA', 'SCAAAA', 'OOOOxx'),
+(787, 71, 1, 3, 7, 7, 7, 87, 187, 287, 787, 14, 15, 'HEAAAA', 'TCAAAA', 'VVVVxx'),
+(898, 72, 0, 2, 8, 18, 8, 98, 98, 398, 898, 16, 17, 'OIAAAA', 'UCAAAA', 'AAAAxx'),
+(588, 73, 0, 0, 8, 8, 8, 88, 188, 88, 588, 16, 17, 'QWAAAA', 'VCAAAA', 'HHHHxx'),
+(872, 74, 0, 0, 2, 12, 2, 72, 72, 372, 872, 4, 5, 'OHAAAA', 'WCAAAA', 'OOOOxx'),
+(397, 75, 1, 1, 7, 17, 7, 97, 197, 397, 397, 14, 15, 'HPAAAA', 'XCAAAA', 'VVVVxx'),
+(51, 76, 1, 3, 1, 11, 1, 51, 51, 51, 51, 2, 3, 'ZBAAAA', 'YCAAAA', 'AAAAxx'),
+(381, 77, 1, 1, 1, 1, 1, 81, 181, 381, 381, 2, 3, 'ROAAAA', 'ZCAAAA', 'HHHHxx'),
+(632, 78, 0, 0, 2, 12, 2, 32, 32, 132, 632, 4, 5, 'IYAAAA', 'ADAAAA', 'OOOOxx'),
+(31, 79, 1, 3, 1, 11, 1, 31, 31, 31, 31, 2, 3, 'FBAAAA', 'BDAAAA', 'VVVVxx'),
+(855, 80, 1, 3, 5, 15, 5, 55, 55, 355, 855, 10, 11, 'XGAAAA', 'CDAAAA', 'AAAAxx'),
+(699, 81, 1, 3, 9, 19, 9, 99, 99, 199, 699, 18, 19, 'XAAAAA', 'DDAAAA', 'HHHHxx'),
+(562, 82, 0, 2, 2, 2, 2, 62, 162, 62, 562, 4, 5, 'QVAAAA', 'EDAAAA', 'OOOOxx'),
+(681, 83, 1, 1, 1, 1, 1, 81, 81, 181, 681, 2, 3, 'FAAAAA', 'FDAAAA', 'VVVVxx'),
+(585, 84, 1, 1, 5, 5, 5, 85, 185, 85, 585, 10, 11, 'NWAAAA', 'GDAAAA', 'AAAAxx'),
+(35, 85, 1, 3, 5, 15, 5, 35, 35, 35, 35, 10, 11, 'JBAAAA', 'HDAAAA', 'HHHHxx'),
+(962, 86, 0, 2, 2, 2, 2, 62, 162, 462, 962, 4, 5, 'ALAAAA', 'IDAAAA', 'OOOOxx'),
+(282, 87, 0, 2, 2, 2, 2, 82, 82, 282, 282, 4, 5, 'WKAAAA', 'JDAAAA', 'VVVVxx'),
+(254, 88, 0, 2, 4, 14, 4, 54, 54, 254, 254, 8, 9, 'UJAAAA', 'KDAAAA', 'AAAAxx'),
+(514, 89, 0, 2, 4, 14, 4, 14, 114, 14, 514, 8, 9, 'UTAAAA', 'LDAAAA', 'HHHHxx'),
+(406, 90, 0, 2, 6, 6, 6, 6, 6, 406, 406, 12, 13, 'QPAAAA', 'MDAAAA', 'OOOOxx'),
+(544, 91, 0, 0, 4, 4, 4, 44, 144, 44, 544, 8, 9, 'YUAAAA', 'NDAAAA', 'VVVVxx'),
+(704, 92, 0, 0, 4, 4, 4, 4, 104, 204, 704, 8, 9, 'CBAAAA', 'ODAAAA', 'AAAAxx'),
+(948, 93, 0, 0, 8, 8, 8, 48, 148, 448, 948, 16, 17, 'MKAAAA', 'PDAAAA', 'HHHHxx'),
+(412, 94, 0, 0, 2, 12, 2, 12, 12, 412, 412, 4, 5, 'WPAAAA', 'QDAAAA', 'OOOOxx'),
+(200, 95, 0, 0, 0, 0, 0, 0, 0, 200, 200, 0, 1, 'SHAAAA', 'RDAAAA', 'VVVVxx'),
+(583, 96, 1, 3, 3, 3, 3, 83, 183, 83, 583, 6, 7, 'LWAAAA', 'SDAAAA', 'AAAAxx'),
+(486, 97, 0, 2, 6, 6, 6, 86, 86, 486, 486, 12, 13, 'SSAAAA', 'TDAAAA', 'HHHHxx'),
+(666, 98, 0, 2, 6, 6, 6, 66, 66, 166, 666, 12, 13, 'QZAAAA', 'UDAAAA', 'OOOOxx'),
+(436, 99, 0, 0, 6, 16, 6, 36, 36, 436, 436, 12, 13, 'UQAAAA', 'VDAAAA', 'VVVVxx'),
+(842, 100, 0, 2, 2, 2, 2, 42, 42, 342, 842, 4, 5, 'KGAAAA', 'WDAAAA', 'AAAAxx'),
+(99, 101, 1, 3, 9, 19, 9, 99, 99, 99, 99, 18, 19, 'VDAAAA', 'XDAAAA', 'HHHHxx'),
+(656, 102, 0, 0, 6, 16, 6, 56, 56, 156, 656, 12, 13, 'GZAAAA', 'YDAAAA', 'OOOOxx'),
+(673, 103, 1, 1, 3, 13, 3, 73, 73, 173, 673, 6, 7, 'XZAAAA', 'ZDAAAA', 'VVVVxx'),
+(371, 104, 1, 3, 1, 11, 1, 71, 171, 371, 371, 2, 3, 'HOAAAA', 'AEAAAA', 'AAAAxx'),
+(869, 105, 1, 1, 9, 9, 9, 69, 69, 369, 869, 18, 19, 'LHAAAA', 'BEAAAA', 'HHHHxx'),
+(569, 106, 1, 1, 9, 9, 9, 69, 169, 69, 569, 18, 19, 'XVAAAA', 'CEAAAA', 'OOOOxx'),
+(616, 107, 0, 0, 6, 16, 6, 16, 16, 116, 616, 12, 13, 'SXAAAA', 'DEAAAA', 'VVVVxx'),
+(612, 108, 0, 0, 2, 12, 2, 12, 12, 112, 612, 4, 5, 'OXAAAA', 'EEAAAA', 'AAAAxx'),
+(505, 109, 1, 1, 5, 5, 5, 5, 105, 5, 505, 10, 11, 'LTAAAA', 'FEAAAA', 'HHHHxx'),
+(922, 110, 0, 2, 2, 2, 2, 22, 122, 422, 922, 4, 5, 'MJAAAA', 'GEAAAA', 'OOOOxx'),
+(221, 111, 1, 1, 1, 1, 1, 21, 21, 221, 221, 2, 3, 'NIAAAA', 'HEAAAA', 'VVVVxx'),
+(388, 112, 0, 0, 8, 8, 8, 88, 188, 388, 388, 16, 17, 'YOAAAA', 'IEAAAA', 'AAAAxx'),
+(567, 113, 1, 3, 7, 7, 7, 67, 167, 67, 567, 14, 15, 'VVAAAA', 'JEAAAA', 'HHHHxx'),
+(58, 114, 0, 2, 8, 18, 8, 58, 58, 58, 58, 16, 17, 'GCAAAA', 'KEAAAA', 'OOOOxx'),
+(316, 115, 0, 0, 6, 16, 6, 16, 116, 316, 316, 12, 13, 'EMAAAA', 'LEAAAA', 'VVVVxx'),
+(659, 116, 1, 3, 9, 19, 9, 59, 59, 159, 659, 18, 19, 'JZAAAA', 'MEAAAA', 'AAAAxx'),
+(501, 117, 1, 1, 1, 1, 1, 1, 101, 1, 501, 2, 3, 'HTAAAA', 'NEAAAA', 'HHHHxx'),
+(815, 118, 1, 3, 5, 15, 5, 15, 15, 315, 815, 10, 11, 'JFAAAA', 'OEAAAA', 'OOOOxx'),
+(638, 119, 0, 2, 8, 18, 8, 38, 38, 138, 638, 16, 17, 'OYAAAA', 'PEAAAA', 'VVVVxx'),
+(696, 120, 0, 0, 6, 16, 6, 96, 96, 196, 696, 12, 13, 'UAAAAA', 'QEAAAA', 'AAAAxx'),
+(734, 121, 0, 2, 4, 14, 4, 34, 134, 234, 734, 8, 9, 'GCAAAA', 'REAAAA', 'HHHHxx'),
+(237, 122, 1, 1, 7, 17, 7, 37, 37, 237, 237, 14, 15, 'DJAAAA', 'SEAAAA', 'OOOOxx'),
+(816, 123, 0, 0, 6, 16, 6, 16, 16, 316, 816, 12, 13, 'KFAAAA', 'TEAAAA', 'VVVVxx'),
+(917, 124, 1, 1, 7, 17, 7, 17, 117, 417, 917, 14, 15, 'HJAAAA', 'UEAAAA', 'AAAAxx'),
+(844, 125, 0, 0, 4, 4, 4, 44, 44, 344, 844, 8, 9, 'MGAAAA', 'VEAAAA', 'HHHHxx'),
+(657, 126, 1, 1, 7, 17, 7, 57, 57, 157, 657, 14, 15, 'HZAAAA', 'WEAAAA', 'OOOOxx'),
+(952, 127, 0, 0, 2, 12, 2, 52, 152, 452, 952, 4, 5, 'QKAAAA', 'XEAAAA', 'VVVVxx'),
+(519, 128, 1, 3, 9, 19, 9, 19, 119, 19, 519, 18, 19, 'ZTAAAA', 'YEAAAA', 'AAAAxx'),
+(792, 129, 0, 0, 2, 12, 2, 92, 192, 292, 792, 4, 5, 'MEAAAA', 'ZEAAAA', 'HHHHxx'),
+(275, 130, 1, 3, 5, 15, 5, 75, 75, 275, 275, 10, 11, 'PKAAAA', 'AFAAAA', 'OOOOxx'),
+(319, 131, 1, 3, 9, 19, 9, 19, 119, 319, 319, 18, 19, 'HMAAAA', 'BFAAAA', 'VVVVxx'),
+(487, 132, 1, 3, 7, 7, 7, 87, 87, 487, 487, 14, 15, 'TSAAAA', 'CFAAAA', 'AAAAxx'),
+(945, 133, 1, 1, 5, 5, 5, 45, 145, 445, 945, 10, 11, 'JKAAAA', 'DFAAAA', 'HHHHxx'),
+(584, 134, 0, 0, 4, 4, 4, 84, 184, 84, 584, 8, 9, 'MWAAAA', 'EFAAAA', 'OOOOxx'),
+(765, 135, 1, 1, 5, 5, 5, 65, 165, 265, 765, 10, 11, 'LDAAAA', 'FFAAAA', 'VVVVxx'),
+(814, 136, 0, 2, 4, 14, 4, 14, 14, 314, 814, 8, 9, 'IFAAAA', 'GFAAAA', 'AAAAxx'),
+(359, 137, 1, 3, 9, 19, 9, 59, 159, 359, 359, 18, 19, 'VNAAAA', 'HFAAAA', 'HHHHxx'),
+(548, 138, 0, 0, 8, 8, 8, 48, 148, 48, 548, 16, 17, 'CVAAAA', 'IFAAAA', 'OOOOxx'),
+(811, 139, 1, 3, 1, 11, 1, 11, 11, 311, 811, 2, 3, 'FFAAAA', 'JFAAAA', 'VVVVxx'),
+(531, 140, 1, 3, 1, 11, 1, 31, 131, 31, 531, 2, 3, 'LUAAAA', 'KFAAAA', 'AAAAxx'),
+(104, 141, 0, 0, 4, 4, 4, 4, 104, 104, 104, 8, 9, 'AEAAAA', 'LFAAAA', 'HHHHxx'),
+(33, 142, 1, 1, 3, 13, 3, 33, 33, 33, 33, 6, 7, 'HBAAAA', 'MFAAAA', 'OOOOxx'),
+(404, 143, 0, 0, 4, 4, 4, 4, 4, 404, 404, 8, 9, 'OPAAAA', 'NFAAAA', 'VVVVxx'),
+(995, 144, 1, 3, 5, 15, 5, 95, 195, 495, 995, 10, 11, 'HMAAAA', 'OFAAAA', 'AAAAxx'),
+(408, 145, 0, 0, 8, 8, 8, 8, 8, 408, 408, 16, 17, 'SPAAAA', 'PFAAAA', 'HHHHxx'),
+(93, 146, 1, 1, 3, 13, 3, 93, 93, 93, 93, 6, 7, 'PDAAAA', 'QFAAAA', 'OOOOxx'),
+(794, 147, 0, 2, 4, 14, 4, 94, 194, 294, 794, 8, 9, 'OEAAAA', 'RFAAAA', 'VVVVxx'),
+(833, 148, 1, 1, 3, 13, 3, 33, 33, 333, 833, 6, 7, 'BGAAAA', 'SFAAAA', 'AAAAxx'),
+(615, 149, 1, 3, 5, 15, 5, 15, 15, 115, 615, 10, 11, 'RXAAAA', 'TFAAAA', 'HHHHxx'),
+(333, 150, 1, 1, 3, 13, 3, 33, 133, 333, 333, 6, 7, 'VMAAAA', 'UFAAAA', 'OOOOxx'),
+(357, 151, 1, 1, 7, 17, 7, 57, 157, 357, 357, 14, 15, 'TNAAAA', 'VFAAAA', 'VVVVxx'),
+(999, 152, 1, 3, 9, 19, 9, 99, 199, 499, 999, 18, 19, 'LMAAAA', 'WFAAAA', 'AAAAxx'),
+(515, 153, 1, 3, 5, 15, 5, 15, 115, 15, 515, 10, 11, 'VTAAAA', 'XFAAAA', 'HHHHxx'),
+(685, 154, 1, 1, 5, 5, 5, 85, 85, 185, 685, 10, 11, 'JAAAAA', 'YFAAAA', 'OOOOxx'),
+(692, 155, 0, 0, 2, 12, 2, 92, 92, 192, 692, 4, 5, 'QAAAAA', 'ZFAAAA', 'VVVVxx'),
+(627, 156, 1, 3, 7, 7, 7, 27, 27, 127, 627, 14, 15, 'DYAAAA', 'AGAAAA', 'AAAAxx'),
+(654, 157, 0, 2, 4, 14, 4, 54, 54, 154, 654, 8, 9, 'EZAAAA', 'BGAAAA', 'HHHHxx'),
+(115, 158, 1, 3, 5, 15, 5, 15, 115, 115, 115, 10, 11, 'LEAAAA', 'CGAAAA', 'OOOOxx'),
+(75, 159, 1, 3, 5, 15, 5, 75, 75, 75, 75, 10, 11, 'XCAAAA', 'DGAAAA', 'VVVVxx'),
+(14, 160, 0, 2, 4, 14, 4, 14, 14, 14, 14, 8, 9, 'OAAAAA', 'EGAAAA', 'AAAAxx'),
+(148, 161, 0, 0, 8, 8, 8, 48, 148, 148, 148, 16, 17, 'SFAAAA', 'FGAAAA', 'HHHHxx'),
+(201, 162, 1, 1, 1, 1, 1, 1, 1, 201, 201, 2, 3, 'THAAAA', 'GGAAAA', 'OOOOxx'),
+(862, 163, 0, 2, 2, 2, 2, 62, 62, 362, 862, 4, 5, 'EHAAAA', 'HGAAAA', 'VVVVxx'),
+(634, 164, 0, 2, 4, 14, 4, 34, 34, 134, 634, 8, 9, 'KYAAAA', 'IGAAAA', 'AAAAxx'),
+(589, 165, 1, 1, 9, 9, 9, 89, 189, 89, 589, 18, 19, 'RWAAAA', 'JGAAAA', 'HHHHxx'),
+(142, 166, 0, 2, 2, 2, 2, 42, 142, 142, 142, 4, 5, 'MFAAAA', 'KGAAAA', 'OOOOxx'),
+(545, 167, 1, 1, 5, 5, 5, 45, 145, 45, 545, 10, 11, 'ZUAAAA', 'LGAAAA', 'VVVVxx'),
+(983, 168, 1, 3, 3, 3, 3, 83, 183, 483, 983, 6, 7, 'VLAAAA', 'MGAAAA', 'AAAAxx'),
+(87, 169, 1, 3, 7, 7, 7, 87, 87, 87, 87, 14, 15, 'JDAAAA', 'NGAAAA', 'HHHHxx'),
+(335, 170, 1, 3, 5, 15, 5, 35, 135, 335, 335, 10, 11, 'XMAAAA', 'OGAAAA', 'OOOOxx'),
+(915, 171, 1, 3, 5, 15, 5, 15, 115, 415, 915, 10, 11, 'FJAAAA', 'PGAAAA', 'VVVVxx'),
+(286, 172, 0, 2, 6, 6, 6, 86, 86, 286, 286, 12, 13, 'ALAAAA', 'QGAAAA', 'AAAAxx'),
+(361, 173, 1, 1, 1, 1, 1, 61, 161, 361, 361, 2, 3, 'XNAAAA', 'RGAAAA', 'HHHHxx'),
+(97, 174, 1, 1, 7, 17, 7, 97, 97, 97, 97, 14, 15, 'TDAAAA', 'SGAAAA', 'OOOOxx'),
+(98, 175, 0, 2, 8, 18, 8, 98, 98, 98, 98, 16, 17, 'UDAAAA', 'TGAAAA', 'VVVVxx'),
+(377, 176, 1, 1, 7, 17, 7, 77, 177, 377, 377, 14, 15, 'NOAAAA', 'UGAAAA', 'AAAAxx'),
+(525, 177, 1, 1, 5, 5, 5, 25, 125, 25, 525, 10, 11, 'FUAAAA', 'VGAAAA', 'HHHHxx'),
+(448, 178, 0, 0, 8, 8, 8, 48, 48, 448, 448, 16, 17, 'GRAAAA', 'WGAAAA', 'OOOOxx'),
+(154, 179, 0, 2, 4, 14, 4, 54, 154, 154, 154, 8, 9, 'YFAAAA', 'XGAAAA', 'VVVVxx'),
+(866, 180, 0, 2, 6, 6, 6, 66, 66, 366, 866, 12, 13, 'IHAAAA', 'YGAAAA', 'AAAAxx'),
+(741, 181, 1, 1, 1, 1, 1, 41, 141, 241, 741, 2, 3, 'NCAAAA', 'ZGAAAA', 'HHHHxx'),
+(172, 182, 0, 0, 2, 12, 2, 72, 172, 172, 172, 4, 5, 'QGAAAA', 'AHAAAA', 'OOOOxx'),
+(843, 183, 1, 3, 3, 3, 3, 43, 43, 343, 843, 6, 7, 'LGAAAA', 'BHAAAA', 'VVVVxx'),
+(378, 184, 0, 2, 8, 18, 8, 78, 178, 378, 378, 16, 17, 'OOAAAA', 'CHAAAA', 'AAAAxx'),
+(804, 185, 0, 0, 4, 4, 4, 4, 4, 304, 804, 8, 9, 'YEAAAA', 'DHAAAA', 'HHHHxx'),
+(596, 186, 0, 0, 6, 16, 6, 96, 196, 96, 596, 12, 13, 'YWAAAA', 'EHAAAA', 'OOOOxx'),
+(77, 187, 1, 1, 7, 17, 7, 77, 77, 77, 77, 14, 15, 'ZCAAAA', 'FHAAAA', 'VVVVxx'),
+(572, 188, 0, 0, 2, 12, 2, 72, 172, 72, 572, 4, 5, 'AWAAAA', 'GHAAAA', 'AAAAxx'),
+(444, 189, 0, 0, 4, 4, 4, 44, 44, 444, 444, 8, 9, 'CRAAAA', 'HHAAAA', 'HHHHxx'),
+(47, 190, 1, 3, 7, 7, 7, 47, 47, 47, 47, 14, 15, 'VBAAAA', 'IHAAAA', 'OOOOxx'),
+(274, 191, 0, 2, 4, 14, 4, 74, 74, 274, 274, 8, 9, 'OKAAAA', 'JHAAAA', 'VVVVxx'),
+(40, 192, 0, 0, 0, 0, 0, 40, 40, 40, 40, 0, 1, 'OBAAAA', 'KHAAAA', 'AAAAxx'),
+(339, 193, 1, 3, 9, 19, 9, 39, 139, 339, 339, 18, 19, 'BNAAAA', 'LHAAAA', 'HHHHxx'),
+(13, 194, 1, 1, 3, 13, 3, 13, 13, 13, 13, 6, 7, 'NAAAAA', 'MHAAAA', 'OOOOxx'),
+(878, 195, 0, 2, 8, 18, 8, 78, 78, 378, 878, 16, 17, 'UHAAAA', 'NHAAAA', 'VVVVxx'),
+(53, 196, 1, 1, 3, 13, 3, 53, 53, 53, 53, 6, 7, 'BCAAAA', 'OHAAAA', 'AAAAxx'),
+(939, 197, 1, 3, 9, 19, 9, 39, 139, 439, 939, 18, 19, 'DKAAAA', 'PHAAAA', 'HHHHxx'),
+(928, 198, 0, 0, 8, 8, 8, 28, 128, 428, 928, 16, 17, 'SJAAAA', 'QHAAAA', 'OOOOxx'),
+(886, 199, 0, 2, 6, 6, 6, 86, 86, 386, 886, 12, 13, 'CIAAAA', 'RHAAAA', 'VVVVxx'),
+(267, 200, 1, 3, 7, 7, 7, 67, 67, 267, 267, 14, 15, 'HKAAAA', 'SHAAAA', 'AAAAxx'),
+(105, 201, 1, 1, 5, 5, 5, 5, 105, 105, 105, 10, 11, 'BEAAAA', 'THAAAA', 'HHHHxx'),
+(312, 202, 0, 0, 2, 12, 2, 12, 112, 312, 312, 4, 5, 'AMAAAA', 'UHAAAA', 'OOOOxx'),
+(552, 203, 0, 0, 2, 12, 2, 52, 152, 52, 552, 4, 5, 'GVAAAA', 'VHAAAA', 'VVVVxx'),
+(918, 204, 0, 2, 8, 18, 8, 18, 118, 418, 918, 16, 17, 'IJAAAA', 'WHAAAA', 'AAAAxx'),
+(114, 205, 0, 2, 4, 14, 4, 14, 114, 114, 114, 8, 9, 'KEAAAA', 'XHAAAA', 'HHHHxx'),
+(805, 206, 1, 1, 5, 5, 5, 5, 5, 305, 805, 10, 11, 'ZEAAAA', 'YHAAAA', 'OOOOxx'),
+(875, 207, 1, 3, 5, 15, 5, 75, 75, 375, 875, 10, 11, 'RHAAAA', 'ZHAAAA', 'VVVVxx'),
+(225, 208, 1, 1, 5, 5, 5, 25, 25, 225, 225, 10, 11, 'RIAAAA', 'AIAAAA', 'AAAAxx'),
+(495, 209, 1, 3, 5, 15, 5, 95, 95, 495, 495, 10, 11, 'BTAAAA', 'BIAAAA', 'HHHHxx'),
+(150, 210, 0, 2, 0, 10, 0, 50, 150, 150, 150, 0, 1, 'UFAAAA', 'CIAAAA', 'OOOOxx'),
+(759, 211, 1, 3, 9, 19, 9, 59, 159, 259, 759, 18, 19, 'FDAAAA', 'DIAAAA', 'VVVVxx'),
+(149, 212, 1, 1, 9, 9, 9, 49, 149, 149, 149, 18, 19, 'TFAAAA', 'EIAAAA', 'AAAAxx'),
+(480, 213, 0, 0, 0, 0, 0, 80, 80, 480, 480, 0, 1, 'MSAAAA', 'FIAAAA', 'HHHHxx'),
+(1, 214, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 'BAAAAA', 'GIAAAA', 'OOOOxx'),
+(557, 215, 1, 1, 7, 17, 7, 57, 157, 57, 557, 14, 15, 'LVAAAA', 'HIAAAA', 'VVVVxx'),
+(295, 216, 1, 3, 5, 15, 5, 95, 95, 295, 295, 10, 11, 'JLAAAA', 'IIAAAA', 'AAAAxx'),
+(854, 217, 0, 2, 4, 14, 4, 54, 54, 354, 854, 8, 9, 'WGAAAA', 'JIAAAA', 'HHHHxx'),
+(420, 218, 0, 0, 0, 0, 0, 20, 20, 420, 420, 0, 1, 'EQAAAA', 'KIAAAA', 'OOOOxx'),
+(414, 219, 0, 2, 4, 14, 4, 14, 14, 414, 414, 8, 9, 'YPAAAA', 'LIAAAA', 'VVVVxx'),
+(758, 220, 0, 2, 8, 18, 8, 58, 158, 258, 758, 16, 17, 'EDAAAA', 'MIAAAA', 'AAAAxx'),
+(879, 221, 1, 3, 9, 19, 9, 79, 79, 379, 879, 18, 19, 'VHAAAA', 'NIAAAA', 'HHHHxx'),
+(332, 222, 0, 0, 2, 12, 2, 32, 132, 332, 332, 4, 5, 'UMAAAA', 'OIAAAA', 'OOOOxx'),
+(78, 223, 0, 2, 8, 18, 8, 78, 78, 78, 78, 16, 17, 'ADAAAA', 'PIAAAA', 'VVVVxx'),
+(851, 224, 1, 3, 1, 11, 1, 51, 51, 351, 851, 2, 3, 'TGAAAA', 'QIAAAA', 'AAAAxx'),
+(592, 225, 0, 0, 2, 12, 2, 92, 192, 92, 592, 4, 5, 'UWAAAA', 'RIAAAA', 'HHHHxx'),
+(979, 226, 1, 3, 9, 19, 9, 79, 179, 479, 979, 18, 19, 'RLAAAA', 'SIAAAA', 'OOOOxx'),
+(989, 227, 1, 1, 9, 9, 9, 89, 189, 489, 989, 18, 19, 'BMAAAA', 'TIAAAA', 'VVVVxx'),
+(752, 228, 0, 0, 2, 12, 2, 52, 152, 252, 752, 4, 5, 'YCAAAA', 'UIAAAA', 'AAAAxx'),
+(214, 229, 0, 2, 4, 14, 4, 14, 14, 214, 214, 8, 9, 'GIAAAA', 'VIAAAA', 'HHHHxx'),
+(453, 230, 1, 1, 3, 13, 3, 53, 53, 453, 453, 6, 7, 'LRAAAA', 'WIAAAA', 'OOOOxx'),
+(540, 231, 0, 0, 0, 0, 0, 40, 140, 40, 540, 0, 1, 'UUAAAA', 'XIAAAA', 'VVVVxx'),
+(597, 232, 1, 1, 7, 17, 7, 97, 197, 97, 597, 14, 15, 'ZWAAAA', 'YIAAAA', 'AAAAxx'),
+(356, 233, 0, 0, 6, 16, 6, 56, 156, 356, 356, 12, 13, 'SNAAAA', 'ZIAAAA', 'HHHHxx'),
+(720, 234, 0, 0, 0, 0, 0, 20, 120, 220, 720, 0, 1, 'SBAAAA', 'AJAAAA', 'OOOOxx'),
+(367, 235, 1, 3, 7, 7, 7, 67, 167, 367, 367, 14, 15, 'DOAAAA', 'BJAAAA', 'VVVVxx'),
+(762, 236, 0, 2, 2, 2, 2, 62, 162, 262, 762, 4, 5, 'IDAAAA', 'CJAAAA', 'AAAAxx'),
+(986, 237, 0, 2, 6, 6, 6, 86, 186, 486, 986, 12, 13, 'YLAAAA', 'DJAAAA', 'HHHHxx'),
+(924, 238, 0, 0, 4, 4, 4, 24, 124, 424, 924, 8, 9, 'OJAAAA', 'EJAAAA', 'OOOOxx'),
+(779, 239, 1, 3, 9, 19, 9, 79, 179, 279, 779, 18, 19, 'ZDAAAA', 'FJAAAA', 'VVVVxx'),
+(684, 240, 0, 0, 4, 4, 4, 84, 84, 184, 684, 8, 9, 'IAAAAA', 'GJAAAA', 'AAAAxx'),
+(413, 241, 1, 1, 3, 13, 3, 13, 13, 413, 413, 6, 7, 'XPAAAA', 'HJAAAA', 'HHHHxx'),
+(479, 242, 1, 3, 9, 19, 9, 79, 79, 479, 479, 18, 19, 'LSAAAA', 'IJAAAA', 'OOOOxx'),
+(731, 243, 1, 3, 1, 11, 1, 31, 131, 231, 731, 2, 3, 'DCAAAA', 'JJAAAA', 'VVVVxx'),
+(409, 244, 1, 1, 9, 9, 9, 9, 9, 409, 409, 18, 19, 'TPAAAA', 'KJAAAA', 'AAAAxx'),
+(372, 245, 0, 0, 2, 12, 2, 72, 172, 372, 372, 4, 5, 'IOAAAA', 'LJAAAA', 'HHHHxx'),
+(139, 246, 1, 3, 9, 19, 9, 39, 139, 139, 139, 18, 19, 'JFAAAA', 'MJAAAA', 'OOOOxx'),
+(717, 247, 1, 1, 7, 17, 7, 17, 117, 217, 717, 14, 15, 'PBAAAA', 'NJAAAA', 'VVVVxx'),
+(539, 248, 1, 3, 9, 19, 9, 39, 139, 39, 539, 18, 19, 'TUAAAA', 'OJAAAA', 'AAAAxx'),
+(318, 249, 0, 2, 8, 18, 8, 18, 118, 318, 318, 16, 17, 'GMAAAA', 'PJAAAA', 'HHHHxx'),
+(208, 250, 0, 0, 8, 8, 8, 8, 8, 208, 208, 16, 17, 'AIAAAA', 'QJAAAA', 'OOOOxx'),
+(797, 251, 1, 1, 7, 17, 7, 97, 197, 297, 797, 14, 15, 'REAAAA', 'RJAAAA', 'VVVVxx'),
+(661, 252, 1, 1, 1, 1, 1, 61, 61, 161, 661, 2, 3, 'LZAAAA', 'SJAAAA', 'AAAAxx'),
+(50, 253, 0, 2, 0, 10, 0, 50, 50, 50, 50, 0, 1, 'YBAAAA', 'TJAAAA', 'HHHHxx'),
+(102, 254, 0, 2, 2, 2, 2, 2, 102, 102, 102, 4, 5, 'YDAAAA', 'UJAAAA', 'OOOOxx'),
+(484, 255, 0, 0, 4, 4, 4, 84, 84, 484, 484, 8, 9, 'QSAAAA', 'VJAAAA', 'VVVVxx'),
+(108, 256, 0, 0, 8, 8, 8, 8, 108, 108, 108, 16, 17, 'EEAAAA', 'WJAAAA', 'AAAAxx'),
+(140, 257, 0, 0, 0, 0, 0, 40, 140, 140, 140, 0, 1, 'KFAAAA', 'XJAAAA', 'HHHHxx'),
+(996, 258, 0, 0, 6, 16, 6, 96, 196, 496, 996, 12, 13, 'IMAAAA', 'YJAAAA', 'OOOOxx'),
+(687, 259, 1, 3, 7, 7, 7, 87, 87, 187, 687, 14, 15, 'LAAAAA', 'ZJAAAA', 'VVVVxx'),
+(241, 260, 1, 1, 1, 1, 1, 41, 41, 241, 241, 2, 3, 'HJAAAA', 'AKAAAA', 'AAAAxx'),
+(923, 261, 1, 3, 3, 3, 3, 23, 123, 423, 923, 6, 7, 'NJAAAA', 'BKAAAA', 'HHHHxx'),
+(500, 262, 0, 0, 0, 0, 0, 0, 100, 0, 500, 0, 1, 'GTAAAA', 'CKAAAA', 'OOOOxx'),
+(536, 263, 0, 0, 6, 16, 6, 36, 136, 36, 536, 12, 13, 'QUAAAA', 'DKAAAA', 'VVVVxx'),
+(490, 264, 0, 2, 0, 10, 0, 90, 90, 490, 490, 0, 1, 'WSAAAA', 'EKAAAA', 'AAAAxx'),
+(773, 265, 1, 1, 3, 13, 3, 73, 173, 273, 773, 6, 7, 'TDAAAA', 'FKAAAA', 'HHHHxx'),
+(19, 266, 1, 3, 9, 19, 9, 19, 19, 19, 19, 18, 19, 'TAAAAA', 'GKAAAA', 'OOOOxx'),
+(534, 267, 0, 2, 4, 14, 4, 34, 134, 34, 534, 8, 9, 'OUAAAA', 'HKAAAA', 'VVVVxx'),
+(941, 268, 1, 1, 1, 1, 1, 41, 141, 441, 941, 2, 3, 'FKAAAA', 'IKAAAA', 'AAAAxx'),
+(477, 269, 1, 1, 7, 17, 7, 77, 77, 477, 477, 14, 15, 'JSAAAA', 'JKAAAA', 'HHHHxx'),
+(173, 270, 1, 1, 3, 13, 3, 73, 173, 173, 173, 6, 7, 'RGAAAA', 'KKAAAA', 'OOOOxx'),
+(113, 271, 1, 1, 3, 13, 3, 13, 113, 113, 113, 6, 7, 'JEAAAA', 'LKAAAA', 'VVVVxx'),
+(526, 272, 0, 2, 6, 6, 6, 26, 126, 26, 526, 12, 13, 'GUAAAA', 'MKAAAA', 'AAAAxx'),
+(727, 273, 1, 3, 7, 7, 7, 27, 127, 227, 727, 14, 15, 'ZBAAAA', 'NKAAAA', 'HHHHxx'),
+(302, 274, 0, 2, 2, 2, 2, 2, 102, 302, 302, 4, 5, 'QLAAAA', 'OKAAAA', 'OOOOxx'),
+(789, 275, 1, 1, 9, 9, 9, 89, 189, 289, 789, 18, 19, 'JEAAAA', 'PKAAAA', 'VVVVxx'),
+(447, 276, 1, 3, 7, 7, 7, 47, 47, 447, 447, 14, 15, 'FRAAAA', 'QKAAAA', 'AAAAxx'),
+(884, 277, 0, 0, 4, 4, 4, 84, 84, 384, 884, 8, 9, 'AIAAAA', 'RKAAAA', 'HHHHxx'),
+(718, 278, 0, 2, 8, 18, 8, 18, 118, 218, 718, 16, 17, 'QBAAAA', 'SKAAAA', 'OOOOxx'),
+(818, 279, 0, 2, 8, 18, 8, 18, 18, 318, 818, 16, 17, 'MFAAAA', 'TKAAAA', 'VVVVxx'),
+(466, 280, 0, 2, 6, 6, 6, 66, 66, 466, 466, 12, 13, 'YRAAAA', 'UKAAAA', 'AAAAxx'),
+(131, 281, 1, 3, 1, 11, 1, 31, 131, 131, 131, 2, 3, 'BFAAAA', 'VKAAAA', 'HHHHxx'),
+(503, 282, 1, 3, 3, 3, 3, 3, 103, 3, 503, 6, 7, 'JTAAAA', 'WKAAAA', 'OOOOxx'),
+(364, 283, 0, 0, 4, 4, 4, 64, 164, 364, 364, 8, 9, 'AOAAAA', 'XKAAAA', 'VVVVxx'),
+(934, 284, 0, 2, 4, 14, 4, 34, 134, 434, 934, 8, 9, 'YJAAAA', 'YKAAAA', 'AAAAxx'),
+(542, 285, 0, 2, 2, 2, 2, 42, 142, 42, 542, 4, 5, 'WUAAAA', 'ZKAAAA', 'HHHHxx'),
+(146, 286, 0, 2, 6, 6, 6, 46, 146, 146, 146, 12, 13, 'QFAAAA', 'ALAAAA', 'OOOOxx'),
+(652, 287, 0, 0, 2, 12, 2, 52, 52, 152, 652, 4, 5, 'CZAAAA', 'BLAAAA', 'VVVVxx'),
+(566, 288, 0, 2, 6, 6, 6, 66, 166, 66, 566, 12, 13, 'UVAAAA', 'CLAAAA', 'AAAAxx'),
+(788, 289, 0, 0, 8, 8, 8, 88, 188, 288, 788, 16, 17, 'IEAAAA', 'DLAAAA', 'HHHHxx'),
+(168, 290, 0, 0, 8, 8, 8, 68, 168, 168, 168, 16, 17, 'MGAAAA', 'ELAAAA', 'OOOOxx'),
+(736, 291, 0, 0, 6, 16, 6, 36, 136, 236, 736, 12, 13, 'ICAAAA', 'FLAAAA', 'VVVVxx'),
+(795, 292, 1, 3, 5, 15, 5, 95, 195, 295, 795, 10, 11, 'PEAAAA', 'GLAAAA', 'AAAAxx'),
+(103, 293, 1, 3, 3, 3, 3, 3, 103, 103, 103, 6, 7, 'ZDAAAA', 'HLAAAA', 'HHHHxx'),
+(763, 294, 1, 3, 3, 3, 3, 63, 163, 263, 763, 6, 7, 'JDAAAA', 'ILAAAA', 'OOOOxx'),
+(256, 295, 0, 0, 6, 16, 6, 56, 56, 256, 256, 12, 13, 'WJAAAA', 'JLAAAA', 'VVVVxx'),
+(63, 296, 1, 3, 3, 3, 3, 63, 63, 63, 63, 6, 7, 'LCAAAA', 'KLAAAA', 'AAAAxx'),
+(702, 297, 0, 2, 2, 2, 2, 2, 102, 202, 702, 4, 5, 'ABAAAA', 'LLAAAA', 'HHHHxx'),
+(390, 298, 0, 2, 0, 10, 0, 90, 190, 390, 390, 0, 1, 'APAAAA', 'MLAAAA', 'OOOOxx'),
+(116, 299, 0, 0, 6, 16, 6, 16, 116, 116, 116, 12, 13, 'MEAAAA', 'NLAAAA', 'VVVVxx'),
+(354, 300, 0, 2, 4, 14, 4, 54, 154, 354, 354, 8, 9, 'QNAAAA', 'OLAAAA', 'AAAAxx'),
+(162, 301, 0, 2, 2, 2, 2, 62, 162, 162, 162, 4, 5, 'GGAAAA', 'PLAAAA', 'HHHHxx'),
+(71, 302, 1, 3, 1, 11, 1, 71, 71, 71, 71, 2, 3, 'TCAAAA', 'QLAAAA', 'OOOOxx'),
+(916, 303, 0, 0, 6, 16, 6, 16, 116, 416, 916, 12, 13, 'GJAAAA', 'RLAAAA', 'VVVVxx'),
+(565, 304, 1, 1, 5, 5, 5, 65, 165, 65, 565, 10, 11, 'TVAAAA', 'SLAAAA', 'AAAAxx'),
+(509, 305, 1, 1, 9, 9, 9, 9, 109, 9, 509, 18, 19, 'PTAAAA', 'TLAAAA', 'HHHHxx'),
+(20, 306, 0, 0, 0, 0, 0, 20, 20, 20, 20, 0, 1, 'UAAAAA', 'ULAAAA', 'OOOOxx'),
+(813, 307, 1, 1, 3, 13, 3, 13, 13, 313, 813, 6, 7, 'HFAAAA', 'VLAAAA', 'VVVVxx'),
+(80, 308, 0, 0, 0, 0, 0, 80, 80, 80, 80, 0, 1, 'CDAAAA', 'WLAAAA', 'AAAAxx'),
+(400, 309, 0, 0, 0, 0, 0, 0, 0, 400, 400, 0, 1, 'KPAAAA', 'XLAAAA', 'HHHHxx'),
+(888, 310, 0, 0, 8, 8, 8, 88, 88, 388, 888, 16, 17, 'EIAAAA', 'YLAAAA', 'OOOOxx'),
+(825, 311, 1, 1, 5, 5, 5, 25, 25, 325, 825, 10, 11, 'TFAAAA', 'ZLAAAA', 'VVVVxx'),
+(401, 312, 1, 1, 1, 1, 1, 1, 1, 401, 401, 2, 3, 'LPAAAA', 'AMAAAA', 'AAAAxx'),
+(158, 313, 0, 2, 8, 18, 8, 58, 158, 158, 158, 16, 17, 'CGAAAA', 'BMAAAA', 'HHHHxx'),
+(973, 314, 1, 1, 3, 13, 3, 73, 173, 473, 973, 6, 7, 'LLAAAA', 'CMAAAA', 'OOOOxx'),
+(324, 315, 0, 0, 4, 4, 4, 24, 124, 324, 324, 8, 9, 'MMAAAA', 'DMAAAA', 'VVVVxx'),
+(873, 316, 1, 1, 3, 13, 3, 73, 73, 373, 873, 6, 7, 'PHAAAA', 'EMAAAA', 'AAAAxx'),
+(676, 317, 0, 0, 6, 16, 6, 76, 76, 176, 676, 12, 13, 'AAAAAA', 'FMAAAA', 'HHHHxx'),
+(199, 318, 1, 3, 9, 19, 9, 99, 199, 199, 199, 18, 19, 'RHAAAA', 'GMAAAA', 'OOOOxx'),
+(304, 319, 0, 0, 4, 4, 4, 4, 104, 304, 304, 8, 9, 'SLAAAA', 'HMAAAA', 'VVVVxx'),
+(338, 320, 0, 2, 8, 18, 8, 38, 138, 338, 338, 16, 17, 'ANAAAA', 'IMAAAA', 'AAAAxx'),
+(743, 321, 1, 3, 3, 3, 3, 43, 143, 243, 743, 6, 7, 'PCAAAA', 'JMAAAA', 'HHHHxx'),
+(730, 322, 0, 2, 0, 10, 0, 30, 130, 230, 730, 0, 1, 'CCAAAA', 'KMAAAA', 'OOOOxx'),
+(130, 323, 0, 2, 0, 10, 0, 30, 130, 130, 130, 0, 1, 'AFAAAA', 'LMAAAA', 'VVVVxx'),
+(224, 324, 0, 0, 4, 4, 4, 24, 24, 224, 224, 8, 9, 'QIAAAA', 'MMAAAA', 'AAAAxx'),
+(216, 325, 0, 0, 6, 16, 6, 16, 16, 216, 216, 12, 13, 'IIAAAA', 'NMAAAA', 'HHHHxx'),
+(2, 326, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 'CAAAAA', 'OMAAAA', 'OOOOxx'),
+(836, 327, 0, 0, 6, 16, 6, 36, 36, 336, 836, 12, 13, 'EGAAAA', 'PMAAAA', 'VVVVxx'),
+(443, 328, 1, 3, 3, 3, 3, 43, 43, 443, 443, 6, 7, 'BRAAAA', 'QMAAAA', 'AAAAxx'),
+(777, 329, 1, 1, 7, 17, 7, 77, 177, 277, 777, 14, 15, 'XDAAAA', 'RMAAAA', 'HHHHxx'),
+(126, 330, 0, 2, 6, 6, 6, 26, 126, 126, 126, 12, 13, 'WEAAAA', 'SMAAAA', 'OOOOxx'),
+(117, 331, 1, 1, 7, 17, 7, 17, 117, 117, 117, 14, 15, 'NEAAAA', 'TMAAAA', 'VVVVxx'),
+(633, 332, 1, 1, 3, 13, 3, 33, 33, 133, 633, 6, 7, 'JYAAAA', 'UMAAAA', 'AAAAxx'),
+(310, 333, 0, 2, 0, 10, 0, 10, 110, 310, 310, 0, 1, 'YLAAAA', 'VMAAAA', 'HHHHxx'),
+(622, 334, 0, 2, 2, 2, 2, 22, 22, 122, 622, 4, 5, 'YXAAAA', 'WMAAAA', 'OOOOxx'),
+(268, 335, 0, 0, 8, 8, 8, 68, 68, 268, 268, 16, 17, 'IKAAAA', 'XMAAAA', 'VVVVxx'),
+(384, 336, 0, 0, 4, 4, 4, 84, 184, 384, 384, 8, 9, 'UOAAAA', 'YMAAAA', 'AAAAxx'),
+(460, 337, 0, 0, 0, 0, 0, 60, 60, 460, 460, 0, 1, 'SRAAAA', 'ZMAAAA', 'HHHHxx'),
+(475, 338, 1, 3, 5, 15, 5, 75, 75, 475, 475, 10, 11, 'HSAAAA', 'ANAAAA', 'OOOOxx'),
+(624, 339, 0, 0, 4, 4, 4, 24, 24, 124, 624, 8, 9, 'AYAAAA', 'BNAAAA', 'VVVVxx'),
+(826, 340, 0, 2, 6, 6, 6, 26, 26, 326, 826, 12, 13, 'UFAAAA', 'CNAAAA', 'AAAAxx'),
+(680, 341, 0, 0, 0, 0, 0, 80, 80, 180, 680, 0, 1, 'EAAAAA', 'DNAAAA', 'HHHHxx'),
+(306, 342, 0, 2, 6, 6, 6, 6, 106, 306, 306, 12, 13, 'ULAAAA', 'ENAAAA', 'OOOOxx'),
+(896, 343, 0, 0, 6, 16, 6, 96, 96, 396, 896, 12, 13, 'MIAAAA', 'FNAAAA', 'VVVVxx'),
+(30, 344, 0, 2, 0, 10, 0, 30, 30, 30, 30, 0, 1, 'EBAAAA', 'GNAAAA', 'AAAAxx'),
+(576, 345, 0, 0, 6, 16, 6, 76, 176, 76, 576, 12, 13, 'EWAAAA', 'HNAAAA', 'HHHHxx'),
+(551, 346, 1, 3, 1, 11, 1, 51, 151, 51, 551, 2, 3, 'FVAAAA', 'INAAAA', 'OOOOxx'),
+(639, 347, 1, 3, 9, 19, 9, 39, 39, 139, 639, 18, 19, 'PYAAAA', 'JNAAAA', 'VVVVxx'),
+(975, 348, 1, 3, 5, 15, 5, 75, 175, 475, 975, 10, 11, 'NLAAAA', 'KNAAAA', 'AAAAxx'),
+(882, 349, 0, 2, 2, 2, 2, 82, 82, 382, 882, 4, 5, 'YHAAAA', 'LNAAAA', 'HHHHxx'),
+(160, 350, 0, 0, 0, 0, 0, 60, 160, 160, 160, 0, 1, 'EGAAAA', 'MNAAAA', 'OOOOxx'),
+(522, 351, 0, 2, 2, 2, 2, 22, 122, 22, 522, 4, 5, 'CUAAAA', 'NNAAAA', 'VVVVxx'),
+(620, 352, 0, 0, 0, 0, 0, 20, 20, 120, 620, 0, 1, 'WXAAAA', 'ONAAAA', 'AAAAxx'),
+(719, 353, 1, 3, 9, 19, 9, 19, 119, 219, 719, 18, 19, 'RBAAAA', 'PNAAAA', 'HHHHxx'),
+(88, 354, 0, 0, 8, 8, 8, 88, 88, 88, 88, 16, 17, 'KDAAAA', 'QNAAAA', 'OOOOxx'),
+(614, 355, 0, 2, 4, 14, 4, 14, 14, 114, 614, 8, 9, 'QXAAAA', 'RNAAAA', 'VVVVxx'),
+(54, 356, 0, 2, 4, 14, 4, 54, 54, 54, 54, 8, 9, 'CCAAAA', 'SNAAAA', 'AAAAxx'),
+(209, 357, 1, 1, 9, 9, 9, 9, 9, 209, 209, 18, 19, 'BIAAAA', 'TNAAAA', 'HHHHxx'),
+(67, 358, 1, 3, 7, 7, 7, 67, 67, 67, 67, 14, 15, 'PCAAAA', 'UNAAAA', 'OOOOxx'),
+(809, 359, 1, 1, 9, 9, 9, 9, 9, 309, 809, 18, 19, 'DFAAAA', 'VNAAAA', 'VVVVxx'),
+(982, 360, 0, 2, 2, 2, 2, 82, 182, 482, 982, 4, 5, 'ULAAAA', 'WNAAAA', 'AAAAxx'),
+(817, 361, 1, 1, 7, 17, 7, 17, 17, 317, 817, 14, 15, 'LFAAAA', 'XNAAAA', 'HHHHxx'),
+(187, 362, 1, 3, 7, 7, 7, 87, 187, 187, 187, 14, 15, 'FHAAAA', 'YNAAAA', 'OOOOxx'),
+(992, 363, 0, 0, 2, 12, 2, 92, 192, 492, 992, 4, 5, 'EMAAAA', 'ZNAAAA', 'VVVVxx'),
+(580, 364, 0, 0, 0, 0, 0, 80, 180, 80, 580, 0, 1, 'IWAAAA', 'AOAAAA', 'AAAAxx'),
+(658, 365, 0, 2, 8, 18, 8, 58, 58, 158, 658, 16, 17, 'IZAAAA', 'BOAAAA', 'HHHHxx'),
+(222, 366, 0, 2, 2, 2, 2, 22, 22, 222, 222, 4, 5, 'OIAAAA', 'COAAAA', 'OOOOxx'),
+(667, 367, 1, 3, 7, 7, 7, 67, 67, 167, 667, 14, 15, 'RZAAAA', 'DOAAAA', 'VVVVxx'),
+(715, 368, 1, 3, 5, 15, 5, 15, 115, 215, 715, 10, 11, 'NBAAAA', 'EOAAAA', 'AAAAxx'),
+(990, 369, 0, 2, 0, 10, 0, 90, 190, 490, 990, 0, 1, 'CMAAAA', 'FOAAAA', 'HHHHxx'),
+(22, 370, 0, 2, 2, 2, 2, 22, 22, 22, 22, 4, 5, 'WAAAAA', 'GOAAAA', 'OOOOxx'),
+(362, 371, 0, 2, 2, 2, 2, 62, 162, 362, 362, 4, 5, 'YNAAAA', 'HOAAAA', 'VVVVxx'),
+(376, 372, 0, 0, 6, 16, 6, 76, 176, 376, 376, 12, 13, 'MOAAAA', 'IOAAAA', 'AAAAxx'),
+(246, 373, 0, 2, 6, 6, 6, 46, 46, 246, 246, 12, 13, 'MJAAAA', 'JOAAAA', 'HHHHxx'),
+(300, 374, 0, 0, 0, 0, 0, 0, 100, 300, 300, 0, 1, 'OLAAAA', 'KOAAAA', 'OOOOxx'),
+(231, 375, 1, 3, 1, 11, 1, 31, 31, 231, 231, 2, 3, 'XIAAAA', 'LOAAAA', 'VVVVxx'),
+(151, 376, 1, 3, 1, 11, 1, 51, 151, 151, 151, 2, 3, 'VFAAAA', 'MOAAAA', 'AAAAxx'),
+(29, 377, 1, 1, 9, 9, 9, 29, 29, 29, 29, 18, 19, 'DBAAAA', 'NOAAAA', 'HHHHxx'),
+(297, 378, 1, 1, 7, 17, 7, 97, 97, 297, 297, 14, 15, 'LLAAAA', 'OOAAAA', 'OOOOxx'),
+(403, 379, 1, 3, 3, 3, 3, 3, 3, 403, 403, 6, 7, 'NPAAAA', 'POAAAA', 'VVVVxx'),
+(716, 380, 0, 0, 6, 16, 6, 16, 116, 216, 716, 12, 13, 'OBAAAA', 'QOAAAA', 'AAAAxx'),
+(260, 381, 0, 0, 0, 0, 0, 60, 60, 260, 260, 0, 1, 'AKAAAA', 'ROAAAA', 'HHHHxx'),
+(170, 382, 0, 2, 0, 10, 0, 70, 170, 170, 170, 0, 1, 'OGAAAA', 'SOAAAA', 'OOOOxx'),
+(285, 383, 1, 1, 5, 5, 5, 85, 85, 285, 285, 10, 11, 'ZKAAAA', 'TOAAAA', 'VVVVxx'),
+(82, 384, 0, 2, 2, 2, 2, 82, 82, 82, 82, 4, 5, 'EDAAAA', 'UOAAAA', 'AAAAxx'),
+(958, 385, 0, 2, 8, 18, 8, 58, 158, 458, 958, 16, 17, 'WKAAAA', 'VOAAAA', 'HHHHxx'),
+(175, 386, 1, 3, 5, 15, 5, 75, 175, 175, 175, 10, 11, 'TGAAAA', 'WOAAAA', 'OOOOxx'),
+(671, 387, 1, 3, 1, 11, 1, 71, 71, 171, 671, 2, 3, 'VZAAAA', 'XOAAAA', 'VVVVxx'),
+(822, 388, 0, 2, 2, 2, 2, 22, 22, 322, 822, 4, 5, 'QFAAAA', 'YOAAAA', 'AAAAxx'),
+(573, 389, 1, 1, 3, 13, 3, 73, 173, 73, 573, 6, 7, 'BWAAAA', 'ZOAAAA', 'HHHHxx'),
+(723, 390, 1, 3, 3, 3, 3, 23, 123, 223, 723, 6, 7, 'VBAAAA', 'APAAAA', 'OOOOxx'),
+(195, 391, 1, 3, 5, 15, 5, 95, 195, 195, 195, 10, 11, 'NHAAAA', 'BPAAAA', 'VVVVxx'),
+(197, 392, 1, 1, 7, 17, 7, 97, 197, 197, 197, 14, 15, 'PHAAAA', 'CPAAAA', 'AAAAxx'),
+(755, 393, 1, 3, 5, 15, 5, 55, 155, 255, 755, 10, 11, 'BDAAAA', 'DPAAAA', 'HHHHxx'),
+(42, 394, 0, 2, 2, 2, 2, 42, 42, 42, 42, 4, 5, 'QBAAAA', 'EPAAAA', 'OOOOxx'),
+(897, 395, 1, 1, 7, 17, 7, 97, 97, 397, 897, 14, 15, 'NIAAAA', 'FPAAAA', 'VVVVxx'),
+(309, 396, 1, 1, 9, 9, 9, 9, 109, 309, 309, 18, 19, 'XLAAAA', 'GPAAAA', 'AAAAxx'),
+(724, 397, 0, 0, 4, 4, 4, 24, 124, 224, 724, 8, 9, 'WBAAAA', 'HPAAAA', 'HHHHxx'),
+(474, 398, 0, 2, 4, 14, 4, 74, 74, 474, 474, 8, 9, 'GSAAAA', 'IPAAAA', 'OOOOxx'),
+(345, 399, 1, 1, 5, 5, 5, 45, 145, 345, 345, 10, 11, 'HNAAAA', 'JPAAAA', 'VVVVxx'),
+(678, 400, 0, 2, 8, 18, 8, 78, 78, 178, 678, 16, 17, 'CAAAAA', 'KPAAAA', 'AAAAxx'),
+(757, 401, 1, 1, 7, 17, 7, 57, 157, 257, 757, 14, 15, 'DDAAAA', 'LPAAAA', 'HHHHxx'),
+(600, 402, 0, 0, 0, 0, 0, 0, 0, 100, 600, 0, 1, 'CXAAAA', 'MPAAAA', 'OOOOxx'),
+(184, 403, 0, 0, 4, 4, 4, 84, 184, 184, 184, 8, 9, 'CHAAAA', 'NPAAAA', 'VVVVxx'),
+(155, 404, 1, 3, 5, 15, 5, 55, 155, 155, 155, 10, 11, 'ZFAAAA', 'OPAAAA', 'AAAAxx'),
+(136, 405, 0, 0, 6, 16, 6, 36, 136, 136, 136, 12, 13, 'GFAAAA', 'PPAAAA', 'HHHHxx'),
+(889, 406, 1, 1, 9, 9, 9, 89, 89, 389, 889, 18, 19, 'FIAAAA', 'QPAAAA', 'OOOOxx'),
+(95, 407, 1, 3, 5, 15, 5, 95, 95, 95, 95, 10, 11, 'RDAAAA', 'RPAAAA', 'VVVVxx'),
+(549, 408, 1, 1, 9, 9, 9, 49, 149, 49, 549, 18, 19, 'DVAAAA', 'SPAAAA', 'AAAAxx'),
+(81, 409, 1, 1, 1, 1, 1, 81, 81, 81, 81, 2, 3, 'DDAAAA', 'TPAAAA', 'HHHHxx'),
+(679, 410, 1, 3, 9, 19, 9, 79, 79, 179, 679, 18, 19, 'DAAAAA', 'UPAAAA', 'OOOOxx'),
+(27, 411, 1, 3, 7, 7, 7, 27, 27, 27, 27, 14, 15, 'BBAAAA', 'VPAAAA', 'VVVVxx'),
+(748, 412, 0, 0, 8, 8, 8, 48, 148, 248, 748, 16, 17, 'UCAAAA', 'WPAAAA', 'AAAAxx'),
+(107, 413, 1, 3, 7, 7, 7, 7, 107, 107, 107, 14, 15, 'DEAAAA', 'XPAAAA', 'HHHHxx'),
+(870, 414, 0, 2, 0, 10, 0, 70, 70, 370, 870, 0, 1, 'MHAAAA', 'YPAAAA', 'OOOOxx'),
+(848, 415, 0, 0, 8, 8, 8, 48, 48, 348, 848, 16, 17, 'QGAAAA', 'ZPAAAA', 'VVVVxx'),
+(764, 416, 0, 0, 4, 4, 4, 64, 164, 264, 764, 8, 9, 'KDAAAA', 'AQAAAA', 'AAAAxx'),
+(535, 417, 1, 3, 5, 15, 5, 35, 135, 35, 535, 10, 11, 'PUAAAA', 'BQAAAA', 'HHHHxx'),
+(211, 418, 1, 3, 1, 11, 1, 11, 11, 211, 211, 2, 3, 'DIAAAA', 'CQAAAA', 'OOOOxx'),
+(625, 419, 1, 1, 5, 5, 5, 25, 25, 125, 625, 10, 11, 'BYAAAA', 'DQAAAA', 'VVVVxx'),
+(96, 420, 0, 0, 6, 16, 6, 96, 96, 96, 96, 12, 13, 'SDAAAA', 'EQAAAA', 'AAAAxx'),
+(828, 421, 0, 0, 8, 8, 8, 28, 28, 328, 828, 16, 17, 'WFAAAA', 'FQAAAA', 'HHHHxx'),
+(229, 422, 1, 1, 9, 9, 9, 29, 29, 229, 229, 18, 19, 'VIAAAA', 'GQAAAA', 'OOOOxx'),
+(602, 423, 0, 2, 2, 2, 2, 2, 2, 102, 602, 4, 5, 'EXAAAA', 'HQAAAA', 'VVVVxx'),
+(742, 424, 0, 2, 2, 2, 2, 42, 142, 242, 742, 4, 5, 'OCAAAA', 'IQAAAA', 'AAAAxx'),
+(451, 425, 1, 3, 1, 11, 1, 51, 51, 451, 451, 2, 3, 'JRAAAA', 'JQAAAA', 'HHHHxx'),
+(991, 426, 1, 3, 1, 11, 1, 91, 191, 491, 991, 2, 3, 'DMAAAA', 'KQAAAA', 'OOOOxx'),
+(301, 427, 1, 1, 1, 1, 1, 1, 101, 301, 301, 2, 3, 'PLAAAA', 'LQAAAA', 'VVVVxx'),
+(510, 428, 0, 2, 0, 10, 0, 10, 110, 10, 510, 0, 1, 'QTAAAA', 'MQAAAA', 'AAAAxx'),
+(299, 429, 1, 3, 9, 19, 9, 99, 99, 299, 299, 18, 19, 'NLAAAA', 'NQAAAA', 'HHHHxx'),
+(961, 430, 1, 1, 1, 1, 1, 61, 161, 461, 961, 2, 3, 'ZKAAAA', 'OQAAAA', 'OOOOxx'),
+(3, 431, 1, 3, 3, 3, 3, 3, 3, 3, 3, 6, 7, 'DAAAAA', 'PQAAAA', 'VVVVxx'),
+(106, 432, 0, 2, 6, 6, 6, 6, 106, 106, 106, 12, 13, 'CEAAAA', 'QQAAAA', 'AAAAxx'),
+(591, 433, 1, 3, 1, 11, 1, 91, 191, 91, 591, 2, 3, 'TWAAAA', 'RQAAAA', 'HHHHxx'),
+(700, 434, 0, 0, 0, 0, 0, 0, 100, 200, 700, 0, 1, 'YAAAAA', 'SQAAAA', 'OOOOxx'),
+(841, 435, 1, 1, 1, 1, 1, 41, 41, 341, 841, 2, 3, 'JGAAAA', 'TQAAAA', 'VVVVxx'),
+(829, 436, 1, 1, 9, 9, 9, 29, 29, 329, 829, 18, 19, 'XFAAAA', 'UQAAAA', 'AAAAxx'),
+(508, 437, 0, 0, 8, 8, 8, 8, 108, 8, 508, 16, 17, 'OTAAAA', 'VQAAAA', 'HHHHxx'),
+(750, 438, 0, 2, 0, 10, 0, 50, 150, 250, 750, 0, 1, 'WCAAAA', 'WQAAAA', 'OOOOxx'),
+(665, 439, 1, 1, 5, 5, 5, 65, 65, 165, 665, 10, 11, 'PZAAAA', 'XQAAAA', 'VVVVxx'),
+(157, 440, 1, 1, 7, 17, 7, 57, 157, 157, 157, 14, 15, 'BGAAAA', 'YQAAAA', 'AAAAxx'),
+(694, 441, 0, 2, 4, 14, 4, 94, 94, 194, 694, 8, 9, 'SAAAAA', 'ZQAAAA', 'HHHHxx'),
+(176, 442, 0, 0, 6, 16, 6, 76, 176, 176, 176, 12, 13, 'UGAAAA', 'ARAAAA', 'OOOOxx'),
+(950, 443, 0, 2, 0, 10, 0, 50, 150, 450, 950, 0, 1, 'OKAAAA', 'BRAAAA', 'VVVVxx'),
+(970, 444, 0, 2, 0, 10, 0, 70, 170, 470, 970, 0, 1, 'ILAAAA', 'CRAAAA', 'AAAAxx'),
+(496, 445, 0, 0, 6, 16, 6, 96, 96, 496, 496, 12, 13, 'CTAAAA', 'DRAAAA', 'HHHHxx'),
+(429, 446, 1, 1, 9, 9, 9, 29, 29, 429, 429, 18, 19, 'NQAAAA', 'ERAAAA', 'OOOOxx'),
+(907, 447, 1, 3, 7, 7, 7, 7, 107, 407, 907, 14, 15, 'XIAAAA', 'FRAAAA', 'VVVVxx'),
+(72, 448, 0, 0, 2, 12, 2, 72, 72, 72, 72, 4, 5, 'UCAAAA', 'GRAAAA', 'AAAAxx'),
+(186, 449, 0, 2, 6, 6, 6, 86, 186, 186, 186, 12, 13, 'EHAAAA', 'HRAAAA', 'HHHHxx'),
+(713, 450, 1, 1, 3, 13, 3, 13, 113, 213, 713, 6, 7, 'LBAAAA', 'IRAAAA', 'OOOOxx'),
+(432, 451, 0, 0, 2, 12, 2, 32, 32, 432, 432, 4, 5, 'QQAAAA', 'JRAAAA', 'VVVVxx'),
+(735, 452, 1, 3, 5, 15, 5, 35, 135, 235, 735, 10, 11, 'HCAAAA', 'KRAAAA', 'AAAAxx'),
+(516, 453, 0, 0, 6, 16, 6, 16, 116, 16, 516, 12, 13, 'WTAAAA', 'LRAAAA', 'HHHHxx'),
+(964, 454, 0, 0, 4, 4, 4, 64, 164, 464, 964, 8, 9, 'CLAAAA', 'MRAAAA', 'OOOOxx'),
+(840, 455, 0, 0, 0, 0, 0, 40, 40, 340, 840, 0, 1, 'IGAAAA', 'NRAAAA', 'VVVVxx'),
+(550, 456, 0, 2, 0, 10, 0, 50, 150, 50, 550, 0, 1, 'EVAAAA', 'ORAAAA', 'AAAAxx'),
+(360, 457, 0, 0, 0, 0, 0, 60, 160, 360, 360, 0, 1, 'WNAAAA', 'PRAAAA', 'HHHHxx'),
+(827, 458, 1, 3, 7, 7, 7, 27, 27, 327, 827, 14, 15, 'VFAAAA', 'QRAAAA', 'OOOOxx'),
+(959, 459, 1, 3, 9, 19, 9, 59, 159, 459, 959, 18, 19, 'XKAAAA', 'RRAAAA', 'VVVVxx'),
+(454, 460, 0, 2, 4, 14, 4, 54, 54, 454, 454, 8, 9, 'MRAAAA', 'SRAAAA', 'AAAAxx'),
+(819, 461, 1, 3, 9, 19, 9, 19, 19, 319, 819, 18, 19, 'NFAAAA', 'TRAAAA', 'HHHHxx'),
+(745, 462, 1, 1, 5, 5, 5, 45, 145, 245, 745, 10, 11, 'RCAAAA', 'URAAAA', 'OOOOxx'),
+(279, 463, 1, 3, 9, 19, 9, 79, 79, 279, 279, 18, 19, 'TKAAAA', 'VRAAAA', 'VVVVxx'),
+(426, 464, 0, 2, 6, 6, 6, 26, 26, 426, 426, 12, 13, 'KQAAAA', 'WRAAAA', 'AAAAxx'),
+(70, 465, 0, 2, 0, 10, 0, 70, 70, 70, 70, 0, 1, 'SCAAAA', 'XRAAAA', 'HHHHxx'),
+(637, 466, 1, 1, 7, 17, 7, 37, 37, 137, 637, 14, 15, 'NYAAAA', 'YRAAAA', 'OOOOxx'),
+(417, 467, 1, 1, 7, 17, 7, 17, 17, 417, 417, 14, 15, 'BQAAAA', 'ZRAAAA', 'VVVVxx'),
+(586, 468, 0, 2, 6, 6, 6, 86, 186, 86, 586, 12, 13, 'OWAAAA', 'ASAAAA', 'AAAAxx'),
+(314, 469, 0, 2, 4, 14, 4, 14, 114, 314, 314, 8, 9, 'CMAAAA', 'BSAAAA', 'HHHHxx'),
+(101, 470, 1, 1, 1, 1, 1, 1, 101, 101, 101, 2, 3, 'XDAAAA', 'CSAAAA', 'OOOOxx'),
+(205, 471, 1, 1, 5, 5, 5, 5, 5, 205, 205, 10, 11, 'XHAAAA', 'DSAAAA', 'VVVVxx'),
+(969, 472, 1, 1, 9, 9, 9, 69, 169, 469, 969, 18, 19, 'HLAAAA', 'ESAAAA', 'AAAAxx'),
+(217, 473, 1, 1, 7, 17, 7, 17, 17, 217, 217, 14, 15, 'JIAAAA', 'FSAAAA', 'HHHHxx'),
+(281, 474, 1, 1, 1, 1, 1, 81, 81, 281, 281, 2, 3, 'VKAAAA', 'GSAAAA', 'OOOOxx'),
+(984, 475, 0, 0, 4, 4, 4, 84, 184, 484, 984, 8, 9, 'WLAAAA', 'HSAAAA', 'VVVVxx'),
+(366, 476, 0, 2, 6, 6, 6, 66, 166, 366, 366, 12, 13, 'COAAAA', 'ISAAAA', 'AAAAxx'),
+(483, 477, 1, 3, 3, 3, 3, 83, 83, 483, 483, 6, 7, 'PSAAAA', 'JSAAAA', 'HHHHxx'),
+(838, 478, 0, 2, 8, 18, 8, 38, 38, 338, 838, 16, 17, 'GGAAAA', 'KSAAAA', 'OOOOxx'),
+(64, 479, 0, 0, 4, 4, 4, 64, 64, 64, 64, 8, 9, 'MCAAAA', 'LSAAAA', 'VVVVxx'),
+(981, 480, 1, 1, 1, 1, 1, 81, 181, 481, 981, 2, 3, 'TLAAAA', 'MSAAAA', 'AAAAxx'),
+(538, 481, 0, 2, 8, 18, 8, 38, 138, 38, 538, 16, 17, 'SUAAAA', 'NSAAAA', 'HHHHxx'),
+(39, 482, 1, 3, 9, 19, 9, 39, 39, 39, 39, 18, 19, 'NBAAAA', 'OSAAAA', 'OOOOxx'),
+(60, 483, 0, 0, 0, 0, 0, 60, 60, 60, 60, 0, 1, 'ICAAAA', 'PSAAAA', 'VVVVxx'),
+(874, 484, 0, 2, 4, 14, 4, 74, 74, 374, 874, 8, 9, 'QHAAAA', 'QSAAAA', 'AAAAxx'),
+(955, 485, 1, 3, 5, 15, 5, 55, 155, 455, 955, 10, 11, 'TKAAAA', 'RSAAAA', 'HHHHxx'),
+(347, 486, 1, 3, 7, 7, 7, 47, 147, 347, 347, 14, 15, 'JNAAAA', 'SSAAAA', 'OOOOxx'),
+(227, 487, 1, 3, 7, 7, 7, 27, 27, 227, 227, 14, 15, 'TIAAAA', 'TSAAAA', 'VVVVxx'),
+(44, 488, 0, 0, 4, 4, 4, 44, 44, 44, 44, 8, 9, 'SBAAAA', 'USAAAA', 'AAAAxx'),
+(446, 489, 0, 2, 6, 6, 6, 46, 46, 446, 446, 12, 13, 'ERAAAA', 'VSAAAA', 'HHHHxx'),
+(605, 490, 1, 1, 5, 5, 5, 5, 5, 105, 605, 10, 11, 'HXAAAA', 'WSAAAA', 'OOOOxx'),
+(570, 491, 0, 2, 0, 10, 0, 70, 170, 70, 570, 0, 1, 'YVAAAA', 'XSAAAA', 'VVVVxx'),
+(895, 492, 1, 3, 5, 15, 5, 95, 95, 395, 895, 10, 11, 'LIAAAA', 'YSAAAA', 'AAAAxx'),
+(760, 493, 0, 0, 0, 0, 0, 60, 160, 260, 760, 0, 1, 'GDAAAA', 'ZSAAAA', 'HHHHxx'),
+(428, 494, 0, 0, 8, 8, 8, 28, 28, 428, 428, 16, 17, 'MQAAAA', 'ATAAAA', 'OOOOxx'),
+(628, 495, 0, 0, 8, 8, 8, 28, 28, 128, 628, 16, 17, 'EYAAAA', 'BTAAAA', 'VVVVxx'),
+(933, 496, 1, 1, 3, 13, 3, 33, 133, 433, 933, 6, 7, 'XJAAAA', 'CTAAAA', 'AAAAxx'),
+(263, 497, 1, 3, 3, 3, 3, 63, 63, 263, 263, 6, 7, 'DKAAAA', 'DTAAAA', 'HHHHxx'),
+(729, 498, 1, 1, 9, 9, 9, 29, 129, 229, 729, 18, 19, 'BCAAAA', 'ETAAAA', 'OOOOxx'),
+(860, 499, 0, 0, 0, 0, 0, 60, 60, 360, 860, 0, 1, 'CHAAAA', 'FTAAAA', 'VVVVxx'),
+(76, 500, 0, 0, 6, 16, 6, 76, 76, 76, 76, 12, 13, 'YCAAAA', 'GTAAAA', 'AAAAxx'),
+(293, 501, 1, 1, 3, 13, 3, 93, 93, 293, 293, 6, 7, 'HLAAAA', 'HTAAAA', 'HHHHxx'),
+(296, 502, 0, 0, 6, 16, 6, 96, 96, 296, 296, 12, 13, 'KLAAAA', 'ITAAAA', 'OOOOxx'),
+(124, 503, 0, 0, 4, 4, 4, 24, 124, 124, 124, 8, 9, 'UEAAAA', 'JTAAAA', 'VVVVxx'),
+(568, 504, 0, 0, 8, 8, 8, 68, 168, 68, 568, 16, 17, 'WVAAAA', 'KTAAAA', 'AAAAxx'),
+(337, 505, 1, 1, 7, 17, 7, 37, 137, 337, 337, 14, 15, 'ZMAAAA', 'LTAAAA', 'HHHHxx'),
+(464, 506, 0, 0, 4, 4, 4, 64, 64, 464, 464, 8, 9, 'WRAAAA', 'MTAAAA', 'OOOOxx'),
+(582, 507, 0, 2, 2, 2, 2, 82, 182, 82, 582, 4, 5, 'KWAAAA', 'NTAAAA', 'VVVVxx'),
+(207, 508, 1, 3, 7, 7, 7, 7, 7, 207, 207, 14, 15, 'ZHAAAA', 'OTAAAA', 'AAAAxx'),
+(518, 509, 0, 2, 8, 18, 8, 18, 118, 18, 518, 16, 17, 'YTAAAA', 'PTAAAA', 'HHHHxx'),
+(513, 510, 1, 1, 3, 13, 3, 13, 113, 13, 513, 6, 7, 'TTAAAA', 'QTAAAA', 'OOOOxx'),
+(127, 511, 1, 3, 7, 7, 7, 27, 127, 127, 127, 14, 15, 'XEAAAA', 'RTAAAA', 'VVVVxx'),
+(396, 512, 0, 0, 6, 16, 6, 96, 196, 396, 396, 12, 13, 'GPAAAA', 'STAAAA', 'AAAAxx'),
+(781, 513, 1, 1, 1, 1, 1, 81, 181, 281, 781, 2, 3, 'BEAAAA', 'TTAAAA', 'HHHHxx'),
+(233, 514, 1, 1, 3, 13, 3, 33, 33, 233, 233, 6, 7, 'ZIAAAA', 'UTAAAA', 'OOOOxx'),
+(709, 515, 1, 1, 9, 9, 9, 9, 109, 209, 709, 18, 19, 'HBAAAA', 'VTAAAA', 'VVVVxx'),
+(325, 516, 1, 1, 5, 5, 5, 25, 125, 325, 325, 10, 11, 'NMAAAA', 'WTAAAA', 'AAAAxx'),
+(143, 517, 1, 3, 3, 3, 3, 43, 143, 143, 143, 6, 7, 'NFAAAA', 'XTAAAA', 'HHHHxx'),
+(824, 518, 0, 0, 4, 4, 4, 24, 24, 324, 824, 8, 9, 'SFAAAA', 'YTAAAA', 'OOOOxx'),
+(122, 519, 0, 2, 2, 2, 2, 22, 122, 122, 122, 4, 5, 'SEAAAA', 'ZTAAAA', 'VVVVxx'),
+(10, 520, 0, 2, 0, 10, 0, 10, 10, 10, 10, 0, 1, 'KAAAAA', 'AUAAAA', 'AAAAxx'),
+(41, 521, 1, 1, 1, 1, 1, 41, 41, 41, 41, 2, 3, 'PBAAAA', 'BUAAAA', 'HHHHxx'),
+(618, 522, 0, 2, 8, 18, 8, 18, 18, 118, 618, 16, 17, 'UXAAAA', 'CUAAAA', 'OOOOxx'),
+(161, 523, 1, 1, 1, 1, 1, 61, 161, 161, 161, 2, 3, 'FGAAAA', 'DUAAAA', 'VVVVxx'),
+(801, 524, 1, 1, 1, 1, 1, 1, 1, 301, 801, 2, 3, 'VEAAAA', 'EUAAAA', 'AAAAxx'),
+(768, 525, 0, 0, 8, 8, 8, 68, 168, 268, 768, 16, 17, 'ODAAAA', 'FUAAAA', 'HHHHxx'),
+(642, 526, 0, 2, 2, 2, 2, 42, 42, 142, 642, 4, 5, 'SYAAAA', 'GUAAAA', 'OOOOxx'),
+(803, 527, 1, 3, 3, 3, 3, 3, 3, 303, 803, 6, 7, 'XEAAAA', 'HUAAAA', 'VVVVxx'),
+(317, 528, 1, 1, 7, 17, 7, 17, 117, 317, 317, 14, 15, 'FMAAAA', 'IUAAAA', 'AAAAxx'),
+(938, 529, 0, 2, 8, 18, 8, 38, 138, 438, 938, 16, 17, 'CKAAAA', 'JUAAAA', 'HHHHxx'),
+(649, 530, 1, 1, 9, 9, 9, 49, 49, 149, 649, 18, 19, 'ZYAAAA', 'KUAAAA', 'OOOOxx'),
+(738, 531, 0, 2, 8, 18, 8, 38, 138, 238, 738, 16, 17, 'KCAAAA', 'LUAAAA', 'VVVVxx'),
+(344, 532, 0, 0, 4, 4, 4, 44, 144, 344, 344, 8, 9, 'GNAAAA', 'MUAAAA', 'AAAAxx'),
+(399, 533, 1, 3, 9, 19, 9, 99, 199, 399, 399, 18, 19, 'JPAAAA', 'NUAAAA', 'HHHHxx'),
+(609, 534, 1, 1, 9, 9, 9, 9, 9, 109, 609, 18, 19, 'LXAAAA', 'OUAAAA', 'OOOOxx'),
+(677, 535, 1, 1, 7, 17, 7, 77, 77, 177, 677, 14, 15, 'BAAAAA', 'PUAAAA', 'VVVVxx'),
+(478, 536, 0, 2, 8, 18, 8, 78, 78, 478, 478, 16, 17, 'KSAAAA', 'QUAAAA', 'AAAAxx'),
+(452, 537, 0, 0, 2, 12, 2, 52, 52, 452, 452, 4, 5, 'KRAAAA', 'RUAAAA', 'HHHHxx'),
+(261, 538, 1, 1, 1, 1, 1, 61, 61, 261, 261, 2, 3, 'BKAAAA', 'SUAAAA', 'OOOOxx'),
+(449, 539, 1, 1, 9, 9, 9, 49, 49, 449, 449, 18, 19, 'HRAAAA', 'TUAAAA', 'VVVVxx'),
+(433, 540, 1, 1, 3, 13, 3, 33, 33, 433, 433, 6, 7, 'RQAAAA', 'UUAAAA', 'AAAAxx'),
+(5, 541, 1, 1, 5, 5, 5, 5, 5, 5, 5, 10, 11, 'FAAAAA', 'VUAAAA', 'HHHHxx'),
+(664, 542, 0, 0, 4, 4, 4, 64, 64, 164, 664, 8, 9, 'OZAAAA', 'WUAAAA', 'OOOOxx'),
+(887, 543, 1, 3, 7, 7, 7, 87, 87, 387, 887, 14, 15, 'DIAAAA', 'XUAAAA', 'VVVVxx'),
+(546, 544, 0, 2, 6, 6, 6, 46, 146, 46, 546, 12, 13, 'AVAAAA', 'YUAAAA', 'AAAAxx'),
+(253, 545, 1, 1, 3, 13, 3, 53, 53, 253, 253, 6, 7, 'TJAAAA', 'ZUAAAA', 'HHHHxx'),
+(235, 546, 1, 3, 5, 15, 5, 35, 35, 235, 235, 10, 11, 'BJAAAA', 'AVAAAA', 'OOOOxx'),
+(258, 547, 0, 2, 8, 18, 8, 58, 58, 258, 258, 16, 17, 'YJAAAA', 'BVAAAA', 'VVVVxx'),
+(621, 548, 1, 1, 1, 1, 1, 21, 21, 121, 621, 2, 3, 'XXAAAA', 'CVAAAA', 'AAAAxx'),
+(998, 549, 0, 2, 8, 18, 8, 98, 198, 498, 998, 16, 17, 'KMAAAA', 'DVAAAA', 'HHHHxx'),
+(236, 550, 0, 0, 6, 16, 6, 36, 36, 236, 236, 12, 13, 'CJAAAA', 'EVAAAA', 'OOOOxx'),
+(537, 551, 1, 1, 7, 17, 7, 37, 137, 37, 537, 14, 15, 'RUAAAA', 'FVAAAA', 'VVVVxx'),
+(769, 552, 1, 1, 9, 9, 9, 69, 169, 269, 769, 18, 19, 'PDAAAA', 'GVAAAA', 'AAAAxx'),
+(921, 553, 1, 1, 1, 1, 1, 21, 121, 421, 921, 2, 3, 'LJAAAA', 'HVAAAA', 'HHHHxx'),
+(951, 554, 1, 3, 1, 11, 1, 51, 151, 451, 951, 2, 3, 'PKAAAA', 'IVAAAA', 'OOOOxx'),
+(240, 555, 0, 0, 0, 0, 0, 40, 40, 240, 240, 0, 1, 'GJAAAA', 'JVAAAA', 'VVVVxx'),
+(644, 556, 0, 0, 4, 4, 4, 44, 44, 144, 644, 8, 9, 'UYAAAA', 'KVAAAA', 'AAAAxx'),
+(352, 557, 0, 0, 2, 12, 2, 52, 152, 352, 352, 4, 5, 'ONAAAA', 'LVAAAA', 'HHHHxx'),
+(613, 558, 1, 1, 3, 13, 3, 13, 13, 113, 613, 6, 7, 'PXAAAA', 'MVAAAA', 'OOOOxx'),
+(784, 559, 0, 0, 4, 4, 4, 84, 184, 284, 784, 8, 9, 'EEAAAA', 'NVAAAA', 'VVVVxx'),
+(61, 560, 1, 1, 1, 1, 1, 61, 61, 61, 61, 2, 3, 'JCAAAA', 'OVAAAA', 'AAAAxx'),
+(144, 561, 0, 0, 4, 4, 4, 44, 144, 144, 144, 8, 9, 'OFAAAA', 'PVAAAA', 'HHHHxx'),
+(94, 562, 0, 2, 4, 14, 4, 94, 94, 94, 94, 8, 9, 'QDAAAA', 'QVAAAA', 'OOOOxx'),
+(270, 563, 0, 2, 0, 10, 0, 70, 70, 270, 270, 0, 1, 'KKAAAA', 'RVAAAA', 'VVVVxx'),
+(942, 564, 0, 2, 2, 2, 2, 42, 142, 442, 942, 4, 5, 'GKAAAA', 'SVAAAA', 'AAAAxx'),
+(756, 565, 0, 0, 6, 16, 6, 56, 156, 256, 756, 12, 13, 'CDAAAA', 'TVAAAA', 'HHHHxx'),
+(321, 566, 1, 1, 1, 1, 1, 21, 121, 321, 321, 2, 3, 'JMAAAA', 'UVAAAA', 'OOOOxx'),
+(36, 567, 0, 0, 6, 16, 6, 36, 36, 36, 36, 12, 13, 'KBAAAA', 'VVAAAA', 'VVVVxx'),
+(232, 568, 0, 0, 2, 12, 2, 32, 32, 232, 232, 4, 5, 'YIAAAA', 'WVAAAA', 'AAAAxx'),
+(430, 569, 0, 2, 0, 10, 0, 30, 30, 430, 430, 0, 1, 'OQAAAA', 'XVAAAA', 'HHHHxx'),
+(177, 570, 1, 1, 7, 17, 7, 77, 177, 177, 177, 14, 15, 'VGAAAA', 'YVAAAA', 'OOOOxx'),
+(220, 571, 0, 0, 0, 0, 0, 20, 20, 220, 220, 0, 1, 'MIAAAA', 'ZVAAAA', 'VVVVxx'),
+(109, 572, 1, 1, 9, 9, 9, 9, 109, 109, 109, 18, 19, 'FEAAAA', 'AWAAAA', 'AAAAxx'),
+(419, 573, 1, 3, 9, 19, 9, 19, 19, 419, 419, 18, 19, 'DQAAAA', 'BWAAAA', 'HHHHxx'),
+(135, 574, 1, 3, 5, 15, 5, 35, 135, 135, 135, 10, 11, 'FFAAAA', 'CWAAAA', 'OOOOxx'),
+(610, 575, 0, 2, 0, 10, 0, 10, 10, 110, 610, 0, 1, 'MXAAAA', 'DWAAAA', 'VVVVxx'),
+(956, 576, 0, 0, 6, 16, 6, 56, 156, 456, 956, 12, 13, 'UKAAAA', 'EWAAAA', 'AAAAxx'),
+(626, 577, 0, 2, 6, 6, 6, 26, 26, 126, 626, 12, 13, 'CYAAAA', 'FWAAAA', 'HHHHxx'),
+(375, 578, 1, 3, 5, 15, 5, 75, 175, 375, 375, 10, 11, 'LOAAAA', 'GWAAAA', 'OOOOxx'),
+(976, 579, 0, 0, 6, 16, 6, 76, 176, 476, 976, 12, 13, 'OLAAAA', 'HWAAAA', 'VVVVxx'),
+(152, 580, 0, 0, 2, 12, 2, 52, 152, 152, 152, 4, 5, 'WFAAAA', 'IWAAAA', 'AAAAxx'),
+(308, 581, 0, 0, 8, 8, 8, 8, 108, 308, 308, 16, 17, 'WLAAAA', 'JWAAAA', 'HHHHxx'),
+(445, 582, 1, 1, 5, 5, 5, 45, 45, 445, 445, 10, 11, 'DRAAAA', 'KWAAAA', 'OOOOxx'),
+(326, 583, 0, 2, 6, 6, 6, 26, 126, 326, 326, 12, 13, 'OMAAAA', 'LWAAAA', 'VVVVxx'),
+(422, 584, 0, 2, 2, 2, 2, 22, 22, 422, 422, 4, 5, 'GQAAAA', 'MWAAAA', 'AAAAxx'),
+(972, 585, 0, 0, 2, 12, 2, 72, 172, 472, 972, 4, 5, 'KLAAAA', 'NWAAAA', 'HHHHxx'),
+(45, 586, 1, 1, 5, 5, 5, 45, 45, 45, 45, 10, 11, 'TBAAAA', 'OWAAAA', 'OOOOxx'),
+(725, 587, 1, 1, 5, 5, 5, 25, 125, 225, 725, 10, 11, 'XBAAAA', 'PWAAAA', 'VVVVxx'),
+(753, 588, 1, 1, 3, 13, 3, 53, 153, 253, 753, 6, 7, 'ZCAAAA', 'QWAAAA', 'AAAAxx'),
+(493, 589, 1, 1, 3, 13, 3, 93, 93, 493, 493, 6, 7, 'ZSAAAA', 'RWAAAA', 'HHHHxx'),
+(601, 590, 1, 1, 1, 1, 1, 1, 1, 101, 601, 2, 3, 'DXAAAA', 'SWAAAA', 'OOOOxx'),
+(463, 591, 1, 3, 3, 3, 3, 63, 63, 463, 463, 6, 7, 'VRAAAA', 'TWAAAA', 'VVVVxx'),
+(303, 592, 1, 3, 3, 3, 3, 3, 103, 303, 303, 6, 7, 'RLAAAA', 'UWAAAA', 'AAAAxx'),
+(59, 593, 1, 3, 9, 19, 9, 59, 59, 59, 59, 18, 19, 'HCAAAA', 'VWAAAA', 'HHHHxx'),
+(595, 594, 1, 3, 5, 15, 5, 95, 195, 95, 595, 10, 11, 'XWAAAA', 'WWAAAA', 'OOOOxx'),
+(807, 595, 1, 3, 7, 7, 7, 7, 7, 307, 807, 14, 15, 'BFAAAA', 'XWAAAA', 'VVVVxx'),
+(424, 596, 0, 0, 4, 4, 4, 24, 24, 424, 424, 8, 9, 'IQAAAA', 'YWAAAA', 'AAAAxx'),
+(521, 597, 1, 1, 1, 1, 1, 21, 121, 21, 521, 2, 3, 'BUAAAA', 'ZWAAAA', 'HHHHxx'),
+(341, 598, 1, 1, 1, 1, 1, 41, 141, 341, 341, 2, 3, 'DNAAAA', 'AXAAAA', 'OOOOxx'),
+(571, 599, 1, 3, 1, 11, 1, 71, 171, 71, 571, 2, 3, 'ZVAAAA', 'BXAAAA', 'VVVVxx'),
+(165, 600, 1, 1, 5, 5, 5, 65, 165, 165, 165, 10, 11, 'JGAAAA', 'CXAAAA', 'AAAAxx'),
+(908, 601, 0, 0, 8, 8, 8, 8, 108, 408, 908, 16, 17, 'YIAAAA', 'DXAAAA', 'HHHHxx'),
+(351, 602, 1, 3, 1, 11, 1, 51, 151, 351, 351, 2, 3, 'NNAAAA', 'EXAAAA', 'OOOOxx'),
+(334, 603, 0, 2, 4, 14, 4, 34, 134, 334, 334, 8, 9, 'WMAAAA', 'FXAAAA', 'VVVVxx'),
+(636, 604, 0, 0, 6, 16, 6, 36, 36, 136, 636, 12, 13, 'MYAAAA', 'GXAAAA', 'AAAAxx'),
+(138, 605, 0, 2, 8, 18, 8, 38, 138, 138, 138, 16, 17, 'IFAAAA', 'HXAAAA', 'HHHHxx'),
+(438, 606, 0, 2, 8, 18, 8, 38, 38, 438, 438, 16, 17, 'WQAAAA', 'IXAAAA', 'OOOOxx'),
+(391, 607, 1, 3, 1, 11, 1, 91, 191, 391, 391, 2, 3, 'BPAAAA', 'JXAAAA', 'VVVVxx'),
+(395, 608, 1, 3, 5, 15, 5, 95, 195, 395, 395, 10, 11, 'FPAAAA', 'KXAAAA', 'AAAAxx'),
+(502, 609, 0, 2, 2, 2, 2, 2, 102, 2, 502, 4, 5, 'ITAAAA', 'LXAAAA', 'HHHHxx'),
+(85, 610, 1, 1, 5, 5, 5, 85, 85, 85, 85, 10, 11, 'HDAAAA', 'MXAAAA', 'OOOOxx'),
+(786, 611, 0, 2, 6, 6, 6, 86, 186, 286, 786, 12, 13, 'GEAAAA', 'NXAAAA', 'VVVVxx'),
+(619, 612, 1, 3, 9, 19, 9, 19, 19, 119, 619, 18, 19, 'VXAAAA', 'OXAAAA', 'AAAAxx'),
+(440, 613, 0, 0, 0, 0, 0, 40, 40, 440, 440, 0, 1, 'YQAAAA', 'PXAAAA', 'HHHHxx'),
+(949, 614, 1, 1, 9, 9, 9, 49, 149, 449, 949, 18, 19, 'NKAAAA', 'QXAAAA', 'OOOOxx'),
+(691, 615, 1, 3, 1, 11, 1, 91, 91, 191, 691, 2, 3, 'PAAAAA', 'RXAAAA', 'VVVVxx'),
+(348, 616, 0, 0, 8, 8, 8, 48, 148, 348, 348, 16, 17, 'KNAAAA', 'SXAAAA', 'AAAAxx'),
+(506, 617, 0, 2, 6, 6, 6, 6, 106, 6, 506, 12, 13, 'MTAAAA', 'TXAAAA', 'HHHHxx'),
+(192, 618, 0, 0, 2, 12, 2, 92, 192, 192, 192, 4, 5, 'KHAAAA', 'UXAAAA', 'OOOOxx'),
+(369, 619, 1, 1, 9, 9, 9, 69, 169, 369, 369, 18, 19, 'FOAAAA', 'VXAAAA', 'VVVVxx'),
+(311, 620, 1, 3, 1, 11, 1, 11, 111, 311, 311, 2, 3, 'ZLAAAA', 'WXAAAA', 'AAAAxx'),
+(273, 621, 1, 1, 3, 13, 3, 73, 73, 273, 273, 6, 7, 'NKAAAA', 'XXAAAA', 'HHHHxx'),
+(770, 622, 0, 2, 0, 10, 0, 70, 170, 270, 770, 0, 1, 'QDAAAA', 'YXAAAA', 'OOOOxx'),
+(191, 623, 1, 3, 1, 11, 1, 91, 191, 191, 191, 2, 3, 'JHAAAA', 'ZXAAAA', 'VVVVxx'),
+(90, 624, 0, 2, 0, 10, 0, 90, 90, 90, 90, 0, 1, 'MDAAAA', 'AYAAAA', 'AAAAxx'),
+(163, 625, 1, 3, 3, 3, 3, 63, 163, 163, 163, 6, 7, 'HGAAAA', 'BYAAAA', 'HHHHxx'),
+(350, 626, 0, 2, 0, 10, 0, 50, 150, 350, 350, 0, 1, 'MNAAAA', 'CYAAAA', 'OOOOxx'),
+(55, 627, 1, 3, 5, 15, 5, 55, 55, 55, 55, 10, 11, 'DCAAAA', 'DYAAAA', 'VVVVxx'),
+(488, 628, 0, 0, 8, 8, 8, 88, 88, 488, 488, 16, 17, 'USAAAA', 'EYAAAA', 'AAAAxx'),
+(215, 629, 1, 3, 5, 15, 5, 15, 15, 215, 215, 10, 11, 'HIAAAA', 'FYAAAA', 'HHHHxx'),
+(732, 630, 0, 0, 2, 12, 2, 32, 132, 232, 732, 4, 5, 'ECAAAA', 'GYAAAA', 'OOOOxx'),
+(688, 631, 0, 0, 8, 8, 8, 88, 88, 188, 688, 16, 17, 'MAAAAA', 'HYAAAA', 'VVVVxx'),
+(520, 632, 0, 0, 0, 0, 0, 20, 120, 20, 520, 0, 1, 'AUAAAA', 'IYAAAA', 'AAAAxx'),
+(62, 633, 0, 2, 2, 2, 2, 62, 62, 62, 62, 4, 5, 'KCAAAA', 'JYAAAA', 'HHHHxx'),
+(423, 634, 1, 3, 3, 3, 3, 23, 23, 423, 423, 6, 7, 'HQAAAA', 'KYAAAA', 'OOOOxx'),
+(242, 635, 0, 2, 2, 2, 2, 42, 42, 242, 242, 4, 5, 'IJAAAA', 'LYAAAA', 'VVVVxx'),
+(193, 636, 1, 1, 3, 13, 3, 93, 193, 193, 193, 6, 7, 'LHAAAA', 'MYAAAA', 'AAAAxx'),
+(648, 637, 0, 0, 8, 8, 8, 48, 48, 148, 648, 16, 17, 'YYAAAA', 'NYAAAA', 'HHHHxx'),
+(459, 638, 1, 3, 9, 19, 9, 59, 59, 459, 459, 18, 19, 'RRAAAA', 'OYAAAA', 'OOOOxx'),
+(196, 639, 0, 0, 6, 16, 6, 96, 196, 196, 196, 12, 13, 'OHAAAA', 'PYAAAA', 'VVVVxx'),
+(476, 640, 0, 0, 6, 16, 6, 76, 76, 476, 476, 12, 13, 'ISAAAA', 'QYAAAA', 'AAAAxx'),
+(903, 641, 1, 3, 3, 3, 3, 3, 103, 403, 903, 6, 7, 'TIAAAA', 'RYAAAA', 'HHHHxx'),
+(974, 642, 0, 2, 4, 14, 4, 74, 174, 474, 974, 8, 9, 'MLAAAA', 'SYAAAA', 'OOOOxx'),
+(603, 643, 1, 3, 3, 3, 3, 3, 3, 103, 603, 6, 7, 'FXAAAA', 'TYAAAA', 'VVVVxx'),
+(12, 644, 0, 0, 2, 12, 2, 12, 12, 12, 12, 4, 5, 'MAAAAA', 'UYAAAA', 'AAAAxx'),
+(599, 645, 1, 3, 9, 19, 9, 99, 199, 99, 599, 18, 19, 'BXAAAA', 'VYAAAA', 'HHHHxx'),
+(914, 646, 0, 2, 4, 14, 4, 14, 114, 414, 914, 8, 9, 'EJAAAA', 'WYAAAA', 'OOOOxx'),
+(7, 647, 1, 3, 7, 7, 7, 7, 7, 7, 7, 14, 15, 'HAAAAA', 'XYAAAA', 'VVVVxx'),
+(213, 648, 1, 1, 3, 13, 3, 13, 13, 213, 213, 6, 7, 'FIAAAA', 'YYAAAA', 'AAAAxx'),
+(174, 649, 0, 2, 4, 14, 4, 74, 174, 174, 174, 8, 9, 'SGAAAA', 'ZYAAAA', 'HHHHxx'),
+(392, 650, 0, 0, 2, 12, 2, 92, 192, 392, 392, 4, 5, 'CPAAAA', 'AZAAAA', 'OOOOxx'),
+(674, 651, 0, 2, 4, 14, 4, 74, 74, 174, 674, 8, 9, 'YZAAAA', 'BZAAAA', 'VVVVxx'),
+(650, 652, 0, 2, 0, 10, 0, 50, 50, 150, 650, 0, 1, 'AZAAAA', 'CZAAAA', 'AAAAxx'),
+(8, 653, 0, 0, 8, 8, 8, 8, 8, 8, 8, 16, 17, 'IAAAAA', 'DZAAAA', 'HHHHxx'),
+(492, 654, 0, 0, 2, 12, 2, 92, 92, 492, 492, 4, 5, 'YSAAAA', 'EZAAAA', 'OOOOxx'),
+(322, 655, 0, 2, 2, 2, 2, 22, 122, 322, 322, 4, 5, 'KMAAAA', 'FZAAAA', 'VVVVxx'),
+(315, 656, 1, 3, 5, 15, 5, 15, 115, 315, 315, 10, 11, 'DMAAAA', 'GZAAAA', 'AAAAxx'),
+(380, 657, 0, 0, 0, 0, 0, 80, 180, 380, 380, 0, 1, 'QOAAAA', 'HZAAAA', 'HHHHxx'),
+(353, 658, 1, 1, 3, 13, 3, 53, 153, 353, 353, 6, 7, 'PNAAAA', 'IZAAAA', 'OOOOxx'),
+(892, 659, 0, 0, 2, 12, 2, 92, 92, 392, 892, 4, 5, 'IIAAAA', 'JZAAAA', 'VVVVxx'),
+(932, 660, 0, 0, 2, 12, 2, 32, 132, 432, 932, 4, 5, 'WJAAAA', 'KZAAAA', 'AAAAxx'),
+(993, 661, 1, 1, 3, 13, 3, 93, 193, 493, 993, 6, 7, 'FMAAAA', 'LZAAAA', 'HHHHxx'),
+(859, 662, 1, 3, 9, 19, 9, 59, 59, 359, 859, 18, 19, 'BHAAAA', 'MZAAAA', 'OOOOxx'),
+(806, 663, 0, 2, 6, 6, 6, 6, 6, 306, 806, 12, 13, 'AFAAAA', 'NZAAAA', 'VVVVxx'),
+(145, 664, 1, 1, 5, 5, 5, 45, 145, 145, 145, 10, 11, 'PFAAAA', 'OZAAAA', 'AAAAxx'),
+(373, 665, 1, 1, 3, 13, 3, 73, 173, 373, 373, 6, 7, 'JOAAAA', 'PZAAAA', 'HHHHxx'),
+(418, 666, 0, 2, 8, 18, 8, 18, 18, 418, 418, 16, 17, 'CQAAAA', 'QZAAAA', 'OOOOxx'),
+(865, 667, 1, 1, 5, 5, 5, 65, 65, 365, 865, 10, 11, 'HHAAAA', 'RZAAAA', 'VVVVxx'),
+(462, 668, 0, 2, 2, 2, 2, 62, 62, 462, 462, 4, 5, 'URAAAA', 'SZAAAA', 'AAAAxx'),
+(24, 669, 0, 0, 4, 4, 4, 24, 24, 24, 24, 8, 9, 'YAAAAA', 'TZAAAA', 'HHHHxx'),
+(920, 670, 0, 0, 0, 0, 0, 20, 120, 420, 920, 0, 1, 'KJAAAA', 'UZAAAA', 'OOOOxx'),
+(672, 671, 0, 0, 2, 12, 2, 72, 72, 172, 672, 4, 5, 'WZAAAA', 'VZAAAA', 'VVVVxx'),
+(92, 672, 0, 0, 2, 12, 2, 92, 92, 92, 92, 4, 5, 'ODAAAA', 'WZAAAA', 'AAAAxx'),
+(721, 673, 1, 1, 1, 1, 1, 21, 121, 221, 721, 2, 3, 'TBAAAA', 'XZAAAA', 'HHHHxx'),
+(646, 674, 0, 2, 6, 6, 6, 46, 46, 146, 646, 12, 13, 'WYAAAA', 'YZAAAA', 'OOOOxx'),
+(910, 675, 0, 2, 0, 10, 0, 10, 110, 410, 910, 0, 1, 'AJAAAA', 'ZZAAAA', 'VVVVxx'),
+(909, 676, 1, 1, 9, 9, 9, 9, 109, 409, 909, 18, 19, 'ZIAAAA', 'AABAAA', 'AAAAxx'),
+(630, 677, 0, 2, 0, 10, 0, 30, 30, 130, 630, 0, 1, 'GYAAAA', 'BABAAA', 'HHHHxx'),
+(482, 678, 0, 2, 2, 2, 2, 82, 82, 482, 482, 4, 5, 'OSAAAA', 'CABAAA', 'OOOOxx'),
+(559, 679, 1, 3, 9, 19, 9, 59, 159, 59, 559, 18, 19, 'NVAAAA', 'DABAAA', 'VVVVxx'),
+(853, 680, 1, 1, 3, 13, 3, 53, 53, 353, 853, 6, 7, 'VGAAAA', 'EABAAA', 'AAAAxx'),
+(141, 681, 1, 1, 1, 1, 1, 41, 141, 141, 141, 2, 3, 'LFAAAA', 'FABAAA', 'HHHHxx'),
+(266, 682, 0, 2, 6, 6, 6, 66, 66, 266, 266, 12, 13, 'GKAAAA', 'GABAAA', 'OOOOxx'),
+(835, 683, 1, 3, 5, 15, 5, 35, 35, 335, 835, 10, 11, 'DGAAAA', 'HABAAA', 'VVVVxx'),
+(164, 684, 0, 0, 4, 4, 4, 64, 164, 164, 164, 8, 9, 'IGAAAA', 'IABAAA', 'AAAAxx'),
+(629, 685, 1, 1, 9, 9, 9, 29, 29, 129, 629, 18, 19, 'FYAAAA', 'JABAAA', 'HHHHxx'),
+(203, 686, 1, 3, 3, 3, 3, 3, 3, 203, 203, 6, 7, 'VHAAAA', 'KABAAA', 'OOOOxx'),
+(411, 687, 1, 3, 1, 11, 1, 11, 11, 411, 411, 2, 3, 'VPAAAA', 'LABAAA', 'VVVVxx'),
+(930, 688, 0, 2, 0, 10, 0, 30, 130, 430, 930, 0, 1, 'UJAAAA', 'MABAAA', 'AAAAxx'),
+(435, 689, 1, 3, 5, 15, 5, 35, 35, 435, 435, 10, 11, 'TQAAAA', 'NABAAA', 'HHHHxx'),
+(563, 690, 1, 3, 3, 3, 3, 63, 163, 63, 563, 6, 7, 'RVAAAA', 'OABAAA', 'OOOOxx'),
+(960, 691, 0, 0, 0, 0, 0, 60, 160, 460, 960, 0, 1, 'YKAAAA', 'PABAAA', 'VVVVxx'),
+(733, 692, 1, 1, 3, 13, 3, 33, 133, 233, 733, 6, 7, 'FCAAAA', 'QABAAA', 'AAAAxx'),
+(967, 693, 1, 3, 7, 7, 7, 67, 167, 467, 967, 14, 15, 'FLAAAA', 'RABAAA', 'HHHHxx'),
+(668, 694, 0, 0, 8, 8, 8, 68, 68, 168, 668, 16, 17, 'SZAAAA', 'SABAAA', 'OOOOxx'),
+(994, 695, 0, 2, 4, 14, 4, 94, 194, 494, 994, 8, 9, 'GMAAAA', 'TABAAA', 'VVVVxx'),
+(129, 696, 1, 1, 9, 9, 9, 29, 129, 129, 129, 18, 19, 'ZEAAAA', 'UABAAA', 'AAAAxx'),
+(954, 697, 0, 2, 4, 14, 4, 54, 154, 454, 954, 8, 9, 'SKAAAA', 'VABAAA', 'HHHHxx'),
+(68, 698, 0, 0, 8, 8, 8, 68, 68, 68, 68, 16, 17, 'QCAAAA', 'WABAAA', 'OOOOxx'),
+(79, 699, 1, 3, 9, 19, 9, 79, 79, 79, 79, 18, 19, 'BDAAAA', 'XABAAA', 'VVVVxx'),
+(121, 700, 1, 1, 1, 1, 1, 21, 121, 121, 121, 2, 3, 'REAAAA', 'YABAAA', 'AAAAxx'),
+(740, 701, 0, 0, 0, 0, 0, 40, 140, 240, 740, 0, 1, 'MCAAAA', 'ZABAAA', 'HHHHxx'),
+(902, 702, 0, 2, 2, 2, 2, 2, 102, 402, 902, 4, 5, 'SIAAAA', 'ABBAAA', 'OOOOxx'),
+(695, 703, 1, 3, 5, 15, 5, 95, 95, 195, 695, 10, 11, 'TAAAAA', 'BBBAAA', 'VVVVxx'),
+(455, 704, 1, 3, 5, 15, 5, 55, 55, 455, 455, 10, 11, 'NRAAAA', 'CBBAAA', 'AAAAxx'),
+(89, 705, 1, 1, 9, 9, 9, 89, 89, 89, 89, 18, 19, 'LDAAAA', 'DBBAAA', 'HHHHxx'),
+(893, 706, 1, 1, 3, 13, 3, 93, 93, 393, 893, 6, 7, 'JIAAAA', 'EBBAAA', 'OOOOxx'),
+(202, 707, 0, 2, 2, 2, 2, 2, 2, 202, 202, 4, 5, 'UHAAAA', 'FBBAAA', 'VVVVxx'),
+(132, 708, 0, 0, 2, 12, 2, 32, 132, 132, 132, 4, 5, 'CFAAAA', 'GBBAAA', 'AAAAxx'),
+(782, 709, 0, 2, 2, 2, 2, 82, 182, 282, 782, 4, 5, 'CEAAAA', 'HBBAAA', 'HHHHxx'),
+(512, 710, 0, 0, 2, 12, 2, 12, 112, 12, 512, 4, 5, 'STAAAA', 'IBBAAA', 'OOOOxx'),
+(857, 711, 1, 1, 7, 17, 7, 57, 57, 357, 857, 14, 15, 'ZGAAAA', 'JBBAAA', 'VVVVxx'),
+(248, 712, 0, 0, 8, 8, 8, 48, 48, 248, 248, 16, 17, 'OJAAAA', 'KBBAAA', 'AAAAxx'),
+(858, 713, 0, 2, 8, 18, 8, 58, 58, 358, 858, 16, 17, 'AHAAAA', 'LBBAAA', 'HHHHxx'),
+(527, 714, 1, 3, 7, 7, 7, 27, 127, 27, 527, 14, 15, 'HUAAAA', 'MBBAAA', 'OOOOxx'),
+(450, 715, 0, 2, 0, 10, 0, 50, 50, 450, 450, 0, 1, 'IRAAAA', 'NBBAAA', 'VVVVxx'),
+(712, 716, 0, 0, 2, 12, 2, 12, 112, 212, 712, 4, 5, 'KBAAAA', 'OBBAAA', 'AAAAxx'),
+(153, 717, 1, 1, 3, 13, 3, 53, 153, 153, 153, 6, 7, 'XFAAAA', 'PBBAAA', 'HHHHxx'),
+(587, 718, 1, 3, 7, 7, 7, 87, 187, 87, 587, 14, 15, 'PWAAAA', 'QBBAAA', 'OOOOxx'),
+(593, 719, 1, 1, 3, 13, 3, 93, 193, 93, 593, 6, 7, 'VWAAAA', 'RBBAAA', 'VVVVxx'),
+(249, 720, 1, 1, 9, 9, 9, 49, 49, 249, 249, 18, 19, 'PJAAAA', 'SBBAAA', 'AAAAxx'),
+(128, 721, 0, 0, 8, 8, 8, 28, 128, 128, 128, 16, 17, 'YEAAAA', 'TBBAAA', 'HHHHxx'),
+(675, 722, 1, 3, 5, 15, 5, 75, 75, 175, 675, 10, 11, 'ZZAAAA', 'UBBAAA', 'OOOOxx'),
+(929, 723, 1, 1, 9, 9, 9, 29, 129, 429, 929, 18, 19, 'TJAAAA', 'VBBAAA', 'VVVVxx'),
+(156, 724, 0, 0, 6, 16, 6, 56, 156, 156, 156, 12, 13, 'AGAAAA', 'WBBAAA', 'AAAAxx'),
+(415, 725, 1, 3, 5, 15, 5, 15, 15, 415, 415, 10, 11, 'ZPAAAA', 'XBBAAA', 'HHHHxx'),
+(28, 726, 0, 0, 8, 8, 8, 28, 28, 28, 28, 16, 17, 'CBAAAA', 'YBBAAA', 'OOOOxx'),
+(18, 727, 0, 2, 8, 18, 8, 18, 18, 18, 18, 16, 17, 'SAAAAA', 'ZBBAAA', 'VVVVxx'),
+(255, 728, 1, 3, 5, 15, 5, 55, 55, 255, 255, 10, 11, 'VJAAAA', 'ACBAAA', 'AAAAxx'),
+(793, 729, 1, 1, 3, 13, 3, 93, 193, 293, 793, 6, 7, 'NEAAAA', 'BCBAAA', 'HHHHxx'),
+(554, 730, 0, 2, 4, 14, 4, 54, 154, 54, 554, 8, 9, 'IVAAAA', 'CCBAAA', 'OOOOxx'),
+(467, 731, 1, 3, 7, 7, 7, 67, 67, 467, 467, 14, 15, 'ZRAAAA', 'DCBAAA', 'VVVVxx'),
+(410, 732, 0, 2, 0, 10, 0, 10, 10, 410, 410, 0, 1, 'UPAAAA', 'ECBAAA', 'AAAAxx'),
+(651, 733, 1, 3, 1, 11, 1, 51, 51, 151, 651, 2, 3, 'BZAAAA', 'FCBAAA', 'HHHHxx'),
+(287, 734, 1, 3, 7, 7, 7, 87, 87, 287, 287, 14, 15, 'BLAAAA', 'GCBAAA', 'OOOOxx'),
+(640, 735, 0, 0, 0, 0, 0, 40, 40, 140, 640, 0, 1, 'QYAAAA', 'HCBAAA', 'VVVVxx'),
+(245, 736, 1, 1, 5, 5, 5, 45, 45, 245, 245, 10, 11, 'LJAAAA', 'ICBAAA', 'AAAAxx'),
+(21, 737, 1, 1, 1, 1, 1, 21, 21, 21, 21, 2, 3, 'VAAAAA', 'JCBAAA', 'HHHHxx'),
+(83, 738, 1, 3, 3, 3, 3, 83, 83, 83, 83, 6, 7, 'FDAAAA', 'KCBAAA', 'OOOOxx'),
+(228, 739, 0, 0, 8, 8, 8, 28, 28, 228, 228, 16, 17, 'UIAAAA', 'LCBAAA', 'VVVVxx'),
+(323, 740, 1, 3, 3, 3, 3, 23, 123, 323, 323, 6, 7, 'LMAAAA', 'MCBAAA', 'AAAAxx'),
+(594, 741, 0, 2, 4, 14, 4, 94, 194, 94, 594, 8, 9, 'WWAAAA', 'NCBAAA', 'HHHHxx'),
+(528, 742, 0, 0, 8, 8, 8, 28, 128, 28, 528, 16, 17, 'IUAAAA', 'OCBAAA', 'OOOOxx'),
+(276, 743, 0, 0, 6, 16, 6, 76, 76, 276, 276, 12, 13, 'QKAAAA', 'PCBAAA', 'VVVVxx'),
+(598, 744, 0, 2, 8, 18, 8, 98, 198, 98, 598, 16, 17, 'AXAAAA', 'QCBAAA', 'AAAAxx'),
+(635, 745, 1, 3, 5, 15, 5, 35, 35, 135, 635, 10, 11, 'LYAAAA', 'RCBAAA', 'HHHHxx'),
+(868, 746, 0, 0, 8, 8, 8, 68, 68, 368, 868, 16, 17, 'KHAAAA', 'SCBAAA', 'OOOOxx'),
+(290, 747, 0, 2, 0, 10, 0, 90, 90, 290, 290, 0, 1, 'ELAAAA', 'TCBAAA', 'VVVVxx'),
+(468, 748, 0, 0, 8, 8, 8, 68, 68, 468, 468, 16, 17, 'ASAAAA', 'UCBAAA', 'AAAAxx'),
+(689, 749, 1, 1, 9, 9, 9, 89, 89, 189, 689, 18, 19, 'NAAAAA', 'VCBAAA', 'HHHHxx'),
+(799, 750, 1, 3, 9, 19, 9, 99, 199, 299, 799, 18, 19, 'TEAAAA', 'WCBAAA', 'OOOOxx'),
+(210, 751, 0, 2, 0, 10, 0, 10, 10, 210, 210, 0, 1, 'CIAAAA', 'XCBAAA', 'VVVVxx'),
+(346, 752, 0, 2, 6, 6, 6, 46, 146, 346, 346, 12, 13, 'INAAAA', 'YCBAAA', 'AAAAxx'),
+(957, 753, 1, 1, 7, 17, 7, 57, 157, 457, 957, 14, 15, 'VKAAAA', 'ZCBAAA', 'HHHHxx'),
+(905, 754, 1, 1, 5, 5, 5, 5, 105, 405, 905, 10, 11, 'VIAAAA', 'ADBAAA', 'OOOOxx'),
+(523, 755, 1, 3, 3, 3, 3, 23, 123, 23, 523, 6, 7, 'DUAAAA', 'BDBAAA', 'VVVVxx'),
+(899, 756, 1, 3, 9, 19, 9, 99, 99, 399, 899, 18, 19, 'PIAAAA', 'CDBAAA', 'AAAAxx'),
+(867, 757, 1, 3, 7, 7, 7, 67, 67, 367, 867, 14, 15, 'JHAAAA', 'DDBAAA', 'HHHHxx'),
+(11, 758, 1, 3, 1, 11, 1, 11, 11, 11, 11, 2, 3, 'LAAAAA', 'EDBAAA', 'OOOOxx'),
+(320, 759, 0, 0, 0, 0, 0, 20, 120, 320, 320, 0, 1, 'IMAAAA', 'FDBAAA', 'VVVVxx'),
+(766, 760, 0, 2, 6, 6, 6, 66, 166, 266, 766, 12, 13, 'MDAAAA', 'GDBAAA', 'AAAAxx'),
+(84, 761, 0, 0, 4, 4, 4, 84, 84, 84, 84, 8, 9, 'GDAAAA', 'HDBAAA', 'HHHHxx'),
+(507, 762, 1, 3, 7, 7, 7, 7, 107, 7, 507, 14, 15, 'NTAAAA', 'IDBAAA', 'OOOOxx'),
+(471, 763, 1, 3, 1, 11, 1, 71, 71, 471, 471, 2, 3, 'DSAAAA', 'JDBAAA', 'VVVVxx'),
+(517, 764, 1, 1, 7, 17, 7, 17, 117, 17, 517, 14, 15, 'XTAAAA', 'KDBAAA', 'AAAAxx'),
+(234, 765, 0, 2, 4, 14, 4, 34, 34, 234, 234, 8, 9, 'AJAAAA', 'LDBAAA', 'HHHHxx'),
+(988, 766, 0, 0, 8, 8, 8, 88, 188, 488, 988, 16, 17, 'AMAAAA', 'MDBAAA', 'OOOOxx'),
+(473, 767, 1, 1, 3, 13, 3, 73, 73, 473, 473, 6, 7, 'FSAAAA', 'NDBAAA', 'VVVVxx'),
+(66, 768, 0, 2, 6, 6, 6, 66, 66, 66, 66, 12, 13, 'OCAAAA', 'ODBAAA', 'AAAAxx'),
+(530, 769, 0, 2, 0, 10, 0, 30, 130, 30, 530, 0, 1, 'KUAAAA', 'PDBAAA', 'HHHHxx'),
+(834, 770, 0, 2, 4, 14, 4, 34, 34, 334, 834, 8, 9, 'CGAAAA', 'QDBAAA', 'OOOOxx'),
+(894, 771, 0, 2, 4, 14, 4, 94, 94, 394, 894, 8, 9, 'KIAAAA', 'RDBAAA', 'VVVVxx'),
+(481, 772, 1, 1, 1, 1, 1, 81, 81, 481, 481, 2, 3, 'NSAAAA', 'SDBAAA', 'AAAAxx'),
+(280, 773, 0, 0, 0, 0, 0, 80, 80, 280, 280, 0, 1, 'UKAAAA', 'TDBAAA', 'HHHHxx'),
+(705, 774, 1, 1, 5, 5, 5, 5, 105, 205, 705, 10, 11, 'DBAAAA', 'UDBAAA', 'OOOOxx'),
+(218, 775, 0, 2, 8, 18, 8, 18, 18, 218, 218, 16, 17, 'KIAAAA', 'VDBAAA', 'VVVVxx'),
+(560, 776, 0, 0, 0, 0, 0, 60, 160, 60, 560, 0, 1, 'OVAAAA', 'WDBAAA', 'AAAAxx'),
+(123, 777, 1, 3, 3, 3, 3, 23, 123, 123, 123, 6, 7, 'TEAAAA', 'XDBAAA', 'HHHHxx'),
+(289, 778, 1, 1, 9, 9, 9, 89, 89, 289, 289, 18, 19, 'DLAAAA', 'YDBAAA', 'OOOOxx'),
+(189, 779, 1, 1, 9, 9, 9, 89, 189, 189, 189, 18, 19, 'HHAAAA', 'ZDBAAA', 'VVVVxx'),
+(541, 780, 1, 1, 1, 1, 1, 41, 141, 41, 541, 2, 3, 'VUAAAA', 'AEBAAA', 'AAAAxx'),
+(876, 781, 0, 0, 6, 16, 6, 76, 76, 376, 876, 12, 13, 'SHAAAA', 'BEBAAA', 'HHHHxx'),
+(504, 782, 0, 0, 4, 4, 4, 4, 104, 4, 504, 8, 9, 'KTAAAA', 'CEBAAA', 'OOOOxx'),
+(643, 783, 1, 3, 3, 3, 3, 43, 43, 143, 643, 6, 7, 'TYAAAA', 'DEBAAA', 'VVVVxx'),
+(73, 784, 1, 1, 3, 13, 3, 73, 73, 73, 73, 6, 7, 'VCAAAA', 'EEBAAA', 'AAAAxx'),
+(465, 785, 1, 1, 5, 5, 5, 65, 65, 465, 465, 10, 11, 'XRAAAA', 'FEBAAA', 'HHHHxx'),
+(861, 786, 1, 1, 1, 1, 1, 61, 61, 361, 861, 2, 3, 'DHAAAA', 'GEBAAA', 'OOOOxx'),
+(355, 787, 1, 3, 5, 15, 5, 55, 155, 355, 355, 10, 11, 'RNAAAA', 'HEBAAA', 'VVVVxx'),
+(441, 788, 1, 1, 1, 1, 1, 41, 41, 441, 441, 2, 3, 'ZQAAAA', 'IEBAAA', 'AAAAxx'),
+(219, 789, 1, 3, 9, 19, 9, 19, 19, 219, 219, 18, 19, 'LIAAAA', 'JEBAAA', 'HHHHxx'),
+(839, 790, 1, 3, 9, 19, 9, 39, 39, 339, 839, 18, 19, 'HGAAAA', 'KEBAAA', 'OOOOxx'),
+(271, 791, 1, 3, 1, 11, 1, 71, 71, 271, 271, 2, 3, 'LKAAAA', 'LEBAAA', 'VVVVxx'),
+(212, 792, 0, 0, 2, 12, 2, 12, 12, 212, 212, 4, 5, 'EIAAAA', 'MEBAAA', 'AAAAxx'),
+(904, 793, 0, 0, 4, 4, 4, 4, 104, 404, 904, 8, 9, 'UIAAAA', 'NEBAAA', 'HHHHxx'),
+(244, 794, 0, 0, 4, 4, 4, 44, 44, 244, 244, 8, 9, 'KJAAAA', 'OEBAAA', 'OOOOxx'),
+(751, 795, 1, 3, 1, 11, 1, 51, 151, 251, 751, 2, 3, 'XCAAAA', 'PEBAAA', 'VVVVxx'),
+(944, 796, 0, 0, 4, 4, 4, 44, 144, 444, 944, 8, 9, 'IKAAAA', 'QEBAAA', 'AAAAxx'),
+(305, 797, 1, 1, 5, 5, 5, 5, 105, 305, 305, 10, 11, 'TLAAAA', 'REBAAA', 'HHHHxx'),
+(617, 798, 1, 1, 7, 17, 7, 17, 17, 117, 617, 14, 15, 'TXAAAA', 'SEBAAA', 'OOOOxx'),
+(891, 799, 1, 3, 1, 11, 1, 91, 91, 391, 891, 2, 3, 'HIAAAA', 'TEBAAA', 'VVVVxx'),
+(653, 800, 1, 1, 3, 13, 3, 53, 53, 153, 653, 6, 7, 'DZAAAA', 'UEBAAA', 'AAAAxx'),
+(845, 801, 1, 1, 5, 5, 5, 45, 45, 345, 845, 10, 11, 'NGAAAA', 'VEBAAA', 'HHHHxx'),
+(936, 802, 0, 0, 6, 16, 6, 36, 136, 436, 936, 12, 13, 'AKAAAA', 'WEBAAA', 'OOOOxx'),
+(91, 803, 1, 3, 1, 11, 1, 91, 91, 91, 91, 2, 3, 'NDAAAA', 'XEBAAA', 'VVVVxx'),
+(442, 804, 0, 2, 2, 2, 2, 42, 42, 442, 442, 4, 5, 'ARAAAA', 'YEBAAA', 'AAAAxx'),
+(498, 805, 0, 2, 8, 18, 8, 98, 98, 498, 498, 16, 17, 'ETAAAA', 'ZEBAAA', 'HHHHxx'),
+(987, 806, 1, 3, 7, 7, 7, 87, 187, 487, 987, 14, 15, 'ZLAAAA', 'AFBAAA', 'OOOOxx'),
+(194, 807, 0, 2, 4, 14, 4, 94, 194, 194, 194, 8, 9, 'MHAAAA', 'BFBAAA', 'VVVVxx'),
+(927, 808, 1, 3, 7, 7, 7, 27, 127, 427, 927, 14, 15, 'RJAAAA', 'CFBAAA', 'AAAAxx'),
+(607, 809, 1, 3, 7, 7, 7, 7, 7, 107, 607, 14, 15, 'JXAAAA', 'DFBAAA', 'HHHHxx'),
+(119, 810, 1, 3, 9, 19, 9, 19, 119, 119, 119, 18, 19, 'PEAAAA', 'EFBAAA', 'OOOOxx'),
+(182, 811, 0, 2, 2, 2, 2, 82, 182, 182, 182, 4, 5, 'AHAAAA', 'FFBAAA', 'VVVVxx'),
+(606, 812, 0, 2, 6, 6, 6, 6, 6, 106, 606, 12, 13, 'IXAAAA', 'GFBAAA', 'AAAAxx'),
+(849, 813, 1, 1, 9, 9, 9, 49, 49, 349, 849, 18, 19, 'RGAAAA', 'HFBAAA', 'HHHHxx'),
+(34, 814, 0, 2, 4, 14, 4, 34, 34, 34, 34, 8, 9, 'IBAAAA', 'IFBAAA', 'OOOOxx'),
+(683, 815, 1, 3, 3, 3, 3, 83, 83, 183, 683, 6, 7, 'HAAAAA', 'JFBAAA', 'VVVVxx'),
+(134, 816, 0, 2, 4, 14, 4, 34, 134, 134, 134, 8, 9, 'EFAAAA', 'KFBAAA', 'AAAAxx'),
+(331, 817, 1, 3, 1, 11, 1, 31, 131, 331, 331, 2, 3, 'TMAAAA', 'LFBAAA', 'HHHHxx'),
+(808, 818, 0, 0, 8, 8, 8, 8, 8, 308, 808, 16, 17, 'CFAAAA', 'MFBAAA', 'OOOOxx'),
+(703, 819, 1, 3, 3, 3, 3, 3, 103, 203, 703, 6, 7, 'BBAAAA', 'NFBAAA', 'VVVVxx'),
+(669, 820, 1, 1, 9, 9, 9, 69, 69, 169, 669, 18, 19, 'TZAAAA', 'OFBAAA', 'AAAAxx'),
+(264, 821, 0, 0, 4, 4, 4, 64, 64, 264, 264, 8, 9, 'EKAAAA', 'PFBAAA', 'HHHHxx'),
+(277, 822, 1, 1, 7, 17, 7, 77, 77, 277, 277, 14, 15, 'RKAAAA', 'QFBAAA', 'OOOOxx'),
+(877, 823, 1, 1, 7, 17, 7, 77, 77, 377, 877, 14, 15, 'THAAAA', 'RFBAAA', 'VVVVxx'),
+(783, 824, 1, 3, 3, 3, 3, 83, 183, 283, 783, 6, 7, 'DEAAAA', 'SFBAAA', 'AAAAxx'),
+(791, 825, 1, 3, 1, 11, 1, 91, 191, 291, 791, 2, 3, 'LEAAAA', 'TFBAAA', 'HHHHxx'),
+(171, 826, 1, 3, 1, 11, 1, 71, 171, 171, 171, 2, 3, 'PGAAAA', 'UFBAAA', 'OOOOxx'),
+(564, 827, 0, 0, 4, 4, 4, 64, 164, 64, 564, 8, 9, 'SVAAAA', 'VFBAAA', 'VVVVxx'),
+(230, 828, 0, 2, 0, 10, 0, 30, 30, 230, 230, 0, 1, 'WIAAAA', 'WFBAAA', 'AAAAxx'),
+(881, 829, 1, 1, 1, 1, 1, 81, 81, 381, 881, 2, 3, 'XHAAAA', 'XFBAAA', 'HHHHxx'),
+(890, 830, 0, 2, 0, 10, 0, 90, 90, 390, 890, 0, 1, 'GIAAAA', 'YFBAAA', 'OOOOxx'),
+(374, 831, 0, 2, 4, 14, 4, 74, 174, 374, 374, 8, 9, 'KOAAAA', 'ZFBAAA', 'VVVVxx'),
+(697, 832, 1, 1, 7, 17, 7, 97, 97, 197, 697, 14, 15, 'VAAAAA', 'AGBAAA', 'AAAAxx'),
+(4, 833, 0, 0, 4, 4, 4, 4, 4, 4, 4, 8, 9, 'EAAAAA', 'BGBAAA', 'HHHHxx'),
+(385, 834, 1, 1, 5, 5, 5, 85, 185, 385, 385, 10, 11, 'VOAAAA', 'CGBAAA', 'OOOOxx'),
+(739, 835, 1, 3, 9, 19, 9, 39, 139, 239, 739, 18, 19, 'LCAAAA', 'DGBAAA', 'VVVVxx'),
+(623, 836, 1, 3, 3, 3, 3, 23, 23, 123, 623, 6, 7, 'ZXAAAA', 'EGBAAA', 'AAAAxx'),
+(547, 837, 1, 3, 7, 7, 7, 47, 147, 47, 547, 14, 15, 'BVAAAA', 'FGBAAA', 'HHHHxx'),
+(532, 838, 0, 0, 2, 12, 2, 32, 132, 32, 532, 4, 5, 'MUAAAA', 'GGBAAA', 'OOOOxx'),
+(383, 839, 1, 3, 3, 3, 3, 83, 183, 383, 383, 6, 7, 'TOAAAA', 'HGBAAA', 'VVVVxx'),
+(181, 840, 1, 1, 1, 1, 1, 81, 181, 181, 181, 2, 3, 'ZGAAAA', 'IGBAAA', 'AAAAxx'),
+(327, 841, 1, 3, 7, 7, 7, 27, 127, 327, 327, 14, 15, 'PMAAAA', 'JGBAAA', 'HHHHxx'),
+(701, 842, 1, 1, 1, 1, 1, 1, 101, 201, 701, 2, 3, 'ZAAAAA', 'KGBAAA', 'OOOOxx'),
+(111, 843, 1, 3, 1, 11, 1, 11, 111, 111, 111, 2, 3, 'HEAAAA', 'LGBAAA', 'VVVVxx'),
+(977, 844, 1, 1, 7, 17, 7, 77, 177, 477, 977, 14, 15, 'PLAAAA', 'MGBAAA', 'AAAAxx'),
+(431, 845, 1, 3, 1, 11, 1, 31, 31, 431, 431, 2, 3, 'PQAAAA', 'NGBAAA', 'HHHHxx'),
+(456, 846, 0, 0, 6, 16, 6, 56, 56, 456, 456, 12, 13, 'ORAAAA', 'OGBAAA', 'OOOOxx'),
+(368, 847, 0, 0, 8, 8, 8, 68, 168, 368, 368, 16, 17, 'EOAAAA', 'PGBAAA', 'VVVVxx'),
+(32, 848, 0, 0, 2, 12, 2, 32, 32, 32, 32, 4, 5, 'GBAAAA', 'QGBAAA', 'AAAAxx'),
+(125, 849, 1, 1, 5, 5, 5, 25, 125, 125, 125, 10, 11, 'VEAAAA', 'RGBAAA', 'HHHHxx'),
+(847, 850, 1, 3, 7, 7, 7, 47, 47, 347, 847, 14, 15, 'PGAAAA', 'SGBAAA', 'OOOOxx'),
+(485, 851, 1, 1, 5, 5, 5, 85, 85, 485, 485, 10, 11, 'RSAAAA', 'TGBAAA', 'VVVVxx'),
+(387, 852, 1, 3, 7, 7, 7, 87, 187, 387, 387, 14, 15, 'XOAAAA', 'UGBAAA', 'AAAAxx'),
+(288, 853, 0, 0, 8, 8, 8, 88, 88, 288, 288, 16, 17, 'CLAAAA', 'VGBAAA', 'HHHHxx'),
+(919, 854, 1, 3, 9, 19, 9, 19, 119, 419, 919, 18, 19, 'JJAAAA', 'WGBAAA', 'OOOOxx'),
+(393, 855, 1, 1, 3, 13, 3, 93, 193, 393, 393, 6, 7, 'DPAAAA', 'XGBAAA', 'VVVVxx'),
+(953, 856, 1, 1, 3, 13, 3, 53, 153, 453, 953, 6, 7, 'RKAAAA', 'YGBAAA', 'AAAAxx'),
+(798, 857, 0, 2, 8, 18, 8, 98, 198, 298, 798, 16, 17, 'SEAAAA', 'ZGBAAA', 'HHHHxx'),
+(940, 858, 0, 0, 0, 0, 0, 40, 140, 440, 940, 0, 1, 'EKAAAA', 'AHBAAA', 'OOOOxx'),
+(198, 859, 0, 2, 8, 18, 8, 98, 198, 198, 198, 16, 17, 'QHAAAA', 'BHBAAA', 'VVVVxx'),
+(25, 860, 1, 1, 5, 5, 5, 25, 25, 25, 25, 10, 11, 'ZAAAAA', 'CHBAAA', 'AAAAxx'),
+(190, 861, 0, 2, 0, 10, 0, 90, 190, 190, 190, 0, 1, 'IHAAAA', 'DHBAAA', 'HHHHxx'),
+(820, 862, 0, 0, 0, 0, 0, 20, 20, 320, 820, 0, 1, 'OFAAAA', 'EHBAAA', 'OOOOxx'),
+(15, 863, 1, 3, 5, 15, 5, 15, 15, 15, 15, 10, 11, 'PAAAAA', 'FHBAAA', 'VVVVxx'),
+(427, 864, 1, 3, 7, 7, 7, 27, 27, 427, 427, 14, 15, 'LQAAAA', 'GHBAAA', 'AAAAxx'),
+(349, 865, 1, 1, 9, 9, 9, 49, 149, 349, 349, 18, 19, 'LNAAAA', 'HHBAAA', 'HHHHxx'),
+(785, 866, 1, 1, 5, 5, 5, 85, 185, 285, 785, 10, 11, 'FEAAAA', 'IHBAAA', 'OOOOxx'),
+(340, 867, 0, 0, 0, 0, 0, 40, 140, 340, 340, 0, 1, 'CNAAAA', 'JHBAAA', 'VVVVxx'),
+(292, 868, 0, 0, 2, 12, 2, 92, 92, 292, 292, 4, 5, 'GLAAAA', 'KHBAAA', 'AAAAxx'),
+(17, 869, 1, 1, 7, 17, 7, 17, 17, 17, 17, 14, 15, 'RAAAAA', 'LHBAAA', 'HHHHxx'),
+(985, 870, 1, 1, 5, 5, 5, 85, 185, 485, 985, 10, 11, 'XLAAAA', 'MHBAAA', 'OOOOxx'),
+(645, 871, 1, 1, 5, 5, 5, 45, 45, 145, 645, 10, 11, 'VYAAAA', 'NHBAAA', 'VVVVxx'),
+(631, 872, 1, 3, 1, 11, 1, 31, 31, 131, 631, 2, 3, 'HYAAAA', 'OHBAAA', 'AAAAxx'),
+(761, 873, 1, 1, 1, 1, 1, 61, 161, 261, 761, 2, 3, 'HDAAAA', 'PHBAAA', 'HHHHxx'),
+(707, 874, 1, 3, 7, 7, 7, 7, 107, 207, 707, 14, 15, 'FBAAAA', 'QHBAAA', 'OOOOxx'),
+(776, 875, 0, 0, 6, 16, 6, 76, 176, 276, 776, 12, 13, 'WDAAAA', 'RHBAAA', 'VVVVxx'),
+(856, 876, 0, 0, 6, 16, 6, 56, 56, 356, 856, 12, 13, 'YGAAAA', 'SHBAAA', 'AAAAxx'),
+(978, 877, 0, 2, 8, 18, 8, 78, 178, 478, 978, 16, 17, 'QLAAAA', 'THBAAA', 'HHHHxx'),
+(710, 878, 0, 2, 0, 10, 0, 10, 110, 210, 710, 0, 1, 'IBAAAA', 'UHBAAA', 'OOOOxx'),
+(604, 879, 0, 0, 4, 4, 4, 4, 4, 104, 604, 8, 9, 'GXAAAA', 'VHBAAA', 'VVVVxx'),
+(291, 880, 1, 3, 1, 11, 1, 91, 91, 291, 291, 2, 3, 'FLAAAA', 'WHBAAA', 'AAAAxx'),
+(747, 881, 1, 3, 7, 7, 7, 47, 147, 247, 747, 14, 15, 'TCAAAA', 'XHBAAA', 'HHHHxx'),
+(837, 882, 1, 1, 7, 17, 7, 37, 37, 337, 837, 14, 15, 'FGAAAA', 'YHBAAA', 'OOOOxx'),
+(722, 883, 0, 2, 2, 2, 2, 22, 122, 222, 722, 4, 5, 'UBAAAA', 'ZHBAAA', 'VVVVxx'),
+(925, 884, 1, 1, 5, 5, 5, 25, 125, 425, 925, 10, 11, 'PJAAAA', 'AIBAAA', 'AAAAxx'),
+(49, 885, 1, 1, 9, 9, 9, 49, 49, 49, 49, 18, 19, 'XBAAAA', 'BIBAAA', 'HHHHxx'),
+(832, 886, 0, 0, 2, 12, 2, 32, 32, 332, 832, 4, 5, 'AGAAAA', 'CIBAAA', 'OOOOxx'),
+(336, 887, 0, 0, 6, 16, 6, 36, 136, 336, 336, 12, 13, 'YMAAAA', 'DIBAAA', 'VVVVxx'),
+(185, 888, 1, 1, 5, 5, 5, 85, 185, 185, 185, 10, 11, 'DHAAAA', 'EIBAAA', 'AAAAxx'),
+(434, 889, 0, 2, 4, 14, 4, 34, 34, 434, 434, 8, 9, 'SQAAAA', 'FIBAAA', 'HHHHxx'),
+(284, 890, 0, 0, 4, 4, 4, 84, 84, 284, 284, 8, 9, 'YKAAAA', 'GIBAAA', 'OOOOxx'),
+(812, 891, 0, 0, 2, 12, 2, 12, 12, 312, 812, 4, 5, 'GFAAAA', 'HIBAAA', 'VVVVxx'),
+(810, 892, 0, 2, 0, 10, 0, 10, 10, 310, 810, 0, 1, 'EFAAAA', 'IIBAAA', 'AAAAxx'),
+(252, 893, 0, 0, 2, 12, 2, 52, 52, 252, 252, 4, 5, 'SJAAAA', 'JIBAAA', 'HHHHxx'),
+(965, 894, 1, 1, 5, 5, 5, 65, 165, 465, 965, 10, 11, 'DLAAAA', 'KIBAAA', 'OOOOxx'),
+(110, 895, 0, 2, 0, 10, 0, 10, 110, 110, 110, 0, 1, 'GEAAAA', 'LIBAAA', 'VVVVxx'),
+(698, 896, 0, 2, 8, 18, 8, 98, 98, 198, 698, 16, 17, 'WAAAAA', 'MIBAAA', 'AAAAxx'),
+(283, 897, 1, 3, 3, 3, 3, 83, 83, 283, 283, 6, 7, 'XKAAAA', 'NIBAAA', 'HHHHxx'),
+(533, 898, 1, 1, 3, 13, 3, 33, 133, 33, 533, 6, 7, 'NUAAAA', 'OIBAAA', 'OOOOxx'),
+(662, 899, 0, 2, 2, 2, 2, 62, 62, 162, 662, 4, 5, 'MZAAAA', 'PIBAAA', 'VVVVxx'),
+(329, 900, 1, 1, 9, 9, 9, 29, 129, 329, 329, 18, 19, 'RMAAAA', 'QIBAAA', 'AAAAxx'),
+(250, 901, 0, 2, 0, 10, 0, 50, 50, 250, 250, 0, 1, 'QJAAAA', 'RIBAAA', 'HHHHxx'),
+(407, 902, 1, 3, 7, 7, 7, 7, 7, 407, 407, 14, 15, 'RPAAAA', 'SIBAAA', 'OOOOxx'),
+(823, 903, 1, 3, 3, 3, 3, 23, 23, 323, 823, 6, 7, 'RFAAAA', 'TIBAAA', 'VVVVxx'),
+(852, 904, 0, 0, 2, 12, 2, 52, 52, 352, 852, 4, 5, 'UGAAAA', 'UIBAAA', 'AAAAxx'),
+(871, 905, 1, 3, 1, 11, 1, 71, 71, 371, 871, 2, 3, 'NHAAAA', 'VIBAAA', 'HHHHxx'),
+(118, 906, 0, 2, 8, 18, 8, 18, 118, 118, 118, 16, 17, 'OEAAAA', 'WIBAAA', 'OOOOxx'),
+(912, 907, 0, 0, 2, 12, 2, 12, 112, 412, 912, 4, 5, 'CJAAAA', 'XIBAAA', 'VVVVxx'),
+(458, 908, 0, 2, 8, 18, 8, 58, 58, 458, 458, 16, 17, 'QRAAAA', 'YIBAAA', 'AAAAxx'),
+(926, 909, 0, 2, 6, 6, 6, 26, 126, 426, 926, 12, 13, 'QJAAAA', 'ZIBAAA', 'HHHHxx'),
+(328, 910, 0, 0, 8, 8, 8, 28, 128, 328, 328, 16, 17, 'QMAAAA', 'AJBAAA', 'OOOOxx'),
+(980, 911, 0, 0, 0, 0, 0, 80, 180, 480, 980, 0, 1, 'SLAAAA', 'BJBAAA', 'VVVVxx'),
+(259, 912, 1, 3, 9, 19, 9, 59, 59, 259, 259, 18, 19, 'ZJAAAA', 'CJBAAA', 'AAAAxx'),
+(900, 913, 0, 0, 0, 0, 0, 0, 100, 400, 900, 0, 1, 'QIAAAA', 'DJBAAA', 'HHHHxx'),
+(137, 914, 1, 1, 7, 17, 7, 37, 137, 137, 137, 14, 15, 'HFAAAA', 'EJBAAA', 'OOOOxx'),
+(159, 915, 1, 3, 9, 19, 9, 59, 159, 159, 159, 18, 19, 'DGAAAA', 'FJBAAA', 'VVVVxx'),
+(243, 916, 1, 3, 3, 3, 3, 43, 43, 243, 243, 6, 7, 'JJAAAA', 'GJBAAA', 'AAAAxx'),
+(472, 917, 0, 0, 2, 12, 2, 72, 72, 472, 472, 4, 5, 'ESAAAA', 'HJBAAA', 'HHHHxx'),
+(796, 918, 0, 0, 6, 16, 6, 96, 196, 296, 796, 12, 13, 'QEAAAA', 'IJBAAA', 'OOOOxx'),
+(382, 919, 0, 2, 2, 2, 2, 82, 182, 382, 382, 4, 5, 'SOAAAA', 'JJBAAA', 'VVVVxx'),
+(911, 920, 1, 3, 1, 11, 1, 11, 111, 411, 911, 2, 3, 'BJAAAA', 'KJBAAA', 'AAAAxx'),
+(179, 921, 1, 3, 9, 19, 9, 79, 179, 179, 179, 18, 19, 'XGAAAA', 'LJBAAA', 'HHHHxx'),
+(778, 922, 0, 2, 8, 18, 8, 78, 178, 278, 778, 16, 17, 'YDAAAA', 'MJBAAA', 'OOOOxx'),
+(405, 923, 1, 1, 5, 5, 5, 5, 5, 405, 405, 10, 11, 'PPAAAA', 'NJBAAA', 'VVVVxx'),
+(265, 924, 1, 1, 5, 5, 5, 65, 65, 265, 265, 10, 11, 'FKAAAA', 'OJBAAA', 'AAAAxx'),
+(556, 925, 0, 0, 6, 16, 6, 56, 156, 56, 556, 12, 13, 'KVAAAA', 'PJBAAA', 'HHHHxx'),
+(16, 926, 0, 0, 6, 16, 6, 16, 16, 16, 16, 12, 13, 'QAAAAA', 'QJBAAA', 'OOOOxx'),
+(706, 927, 0, 2, 6, 6, 6, 6, 106, 206, 706, 12, 13, 'EBAAAA', 'RJBAAA', 'VVVVxx'),
+(497, 928, 1, 1, 7, 17, 7, 97, 97, 497, 497, 14, 15, 'DTAAAA', 'SJBAAA', 'AAAAxx'),
+(708, 929, 0, 0, 8, 8, 8, 8, 108, 208, 708, 16, 17, 'GBAAAA', 'TJBAAA', 'HHHHxx'),
+(46, 930, 0, 2, 6, 6, 6, 46, 46, 46, 46, 12, 13, 'UBAAAA', 'UJBAAA', 'OOOOxx'),
+(901, 931, 1, 1, 1, 1, 1, 1, 101, 401, 901, 2, 3, 'RIAAAA', 'VJBAAA', 'VVVVxx'),
+(416, 932, 0, 0, 6, 16, 6, 16, 16, 416, 416, 12, 13, 'AQAAAA', 'WJBAAA', 'AAAAxx'),
+(307, 933, 1, 3, 7, 7, 7, 7, 107, 307, 307, 14, 15, 'VLAAAA', 'XJBAAA', 'HHHHxx'),
+(166, 934, 0, 2, 6, 6, 6, 66, 166, 166, 166, 12, 13, 'KGAAAA', 'YJBAAA', 'OOOOxx'),
+(178, 935, 0, 2, 8, 18, 8, 78, 178, 178, 178, 16, 17, 'WGAAAA', 'ZJBAAA', 'VVVVxx'),
+(499, 936, 1, 3, 9, 19, 9, 99, 99, 499, 499, 18, 19, 'FTAAAA', 'AKBAAA', 'AAAAxx'),
+(257, 937, 1, 1, 7, 17, 7, 57, 57, 257, 257, 14, 15, 'XJAAAA', 'BKBAAA', 'HHHHxx'),
+(342, 938, 0, 2, 2, 2, 2, 42, 142, 342, 342, 4, 5, 'ENAAAA', 'CKBAAA', 'OOOOxx'),
+(850, 939, 0, 2, 0, 10, 0, 50, 50, 350, 850, 0, 1, 'SGAAAA', 'DKBAAA', 'VVVVxx'),
+(313, 940, 1, 1, 3, 13, 3, 13, 113, 313, 313, 6, 7, 'BMAAAA', 'EKBAAA', 'AAAAxx'),
+(831, 941, 1, 3, 1, 11, 1, 31, 31, 331, 831, 2, 3, 'ZFAAAA', 'FKBAAA', 'HHHHxx'),
+(57, 942, 1, 1, 7, 17, 7, 57, 57, 57, 57, 14, 15, 'FCAAAA', 'GKBAAA', 'OOOOxx'),
+(37, 943, 1, 1, 7, 17, 7, 37, 37, 37, 37, 14, 15, 'LBAAAA', 'HKBAAA', 'VVVVxx'),
+(511, 944, 1, 3, 1, 11, 1, 11, 111, 11, 511, 2, 3, 'RTAAAA', 'IKBAAA', 'AAAAxx'),
+(578, 945, 0, 2, 8, 18, 8, 78, 178, 78, 578, 16, 17, 'GWAAAA', 'JKBAAA', 'HHHHxx'),
+(100, 946, 0, 0, 0, 0, 0, 0, 100, 100, 100, 0, 1, 'WDAAAA', 'KKBAAA', 'OOOOxx'),
+(935, 947, 1, 3, 5, 15, 5, 35, 135, 435, 935, 10, 11, 'ZJAAAA', 'LKBAAA', 'VVVVxx'),
+(821, 948, 1, 1, 1, 1, 1, 21, 21, 321, 821, 2, 3, 'PFAAAA', 'MKBAAA', 'AAAAxx'),
+(294, 949, 0, 2, 4, 14, 4, 94, 94, 294, 294, 8, 9, 'ILAAAA', 'NKBAAA', 'HHHHxx'),
+(575, 950, 1, 3, 5, 15, 5, 75, 175, 75, 575, 10, 11, 'DWAAAA', 'OKBAAA', 'OOOOxx'),
+(272, 951, 0, 0, 2, 12, 2, 72, 72, 272, 272, 4, 5, 'MKAAAA', 'PKBAAA', 'VVVVxx'),
+(491, 952, 1, 3, 1, 11, 1, 91, 91, 491, 491, 2, 3, 'XSAAAA', 'QKBAAA', 'AAAAxx'),
+(43, 953, 1, 3, 3, 3, 3, 43, 43, 43, 43, 6, 7, 'RBAAAA', 'RKBAAA', 'HHHHxx'),
+(167, 954, 1, 3, 7, 7, 7, 67, 167, 167, 167, 14, 15, 'LGAAAA', 'SKBAAA', 'OOOOxx'),
+(457, 955, 1, 1, 7, 17, 7, 57, 57, 457, 457, 14, 15, 'PRAAAA', 'TKBAAA', 'VVVVxx'),
+(647, 956, 1, 3, 7, 7, 7, 47, 47, 147, 647, 14, 15, 'XYAAAA', 'UKBAAA', 'AAAAxx'),
+(180, 957, 0, 0, 0, 0, 0, 80, 180, 180, 180, 0, 1, 'YGAAAA', 'VKBAAA', 'HHHHxx'),
+(48, 958, 0, 0, 8, 8, 8, 48, 48, 48, 48, 16, 17, 'WBAAAA', 'WKBAAA', 'OOOOxx'),
+(553, 959, 1, 1, 3, 13, 3, 53, 153, 53, 553, 6, 7, 'HVAAAA', 'XKBAAA', 'VVVVxx'),
+(188, 960, 0, 0, 8, 8, 8, 88, 188, 188, 188, 16, 17, 'GHAAAA', 'YKBAAA', 'AAAAxx'),
+(262, 961, 0, 2, 2, 2, 2, 62, 62, 262, 262, 4, 5, 'CKAAAA', 'ZKBAAA', 'HHHHxx'),
+(728, 962, 0, 0, 8, 8, 8, 28, 128, 228, 728, 16, 17, 'ACAAAA', 'ALBAAA', 'OOOOxx'),
+(581, 963, 1, 1, 1, 1, 1, 81, 181, 81, 581, 2, 3, 'JWAAAA', 'BLBAAA', 'VVVVxx'),
+(937, 964, 1, 1, 7, 17, 7, 37, 137, 437, 937, 14, 15, 'BKAAAA', 'CLBAAA', 'AAAAxx'),
+(370, 965, 0, 2, 0, 10, 0, 70, 170, 370, 370, 0, 1, 'GOAAAA', 'DLBAAA', 'HHHHxx'),
+(590, 966, 0, 2, 0, 10, 0, 90, 190, 90, 590, 0, 1, 'SWAAAA', 'ELBAAA', 'OOOOxx'),
+(421, 967, 1, 1, 1, 1, 1, 21, 21, 421, 421, 2, 3, 'FQAAAA', 'FLBAAA', 'VVVVxx'),
+(693, 968, 1, 1, 3, 13, 3, 93, 93, 193, 693, 6, 7, 'RAAAAA', 'GLBAAA', 'AAAAxx'),
+(906, 969, 0, 2, 6, 6, 6, 6, 106, 406, 906, 12, 13, 'WIAAAA', 'HLBAAA', 'HHHHxx'),
+(802, 970, 0, 2, 2, 2, 2, 2, 2, 302, 802, 4, 5, 'WEAAAA', 'ILBAAA', 'OOOOxx'),
+(38, 971, 0, 2, 8, 18, 8, 38, 38, 38, 38, 16, 17, 'MBAAAA', 'JLBAAA', 'VVVVxx'),
+(790, 972, 0, 2, 0, 10, 0, 90, 190, 290, 790, 0, 1, 'KEAAAA', 'KLBAAA', 'AAAAxx'),
+(726, 973, 0, 2, 6, 6, 6, 26, 126, 226, 726, 12, 13, 'YBAAAA', 'LLBAAA', 'HHHHxx'),
+(23, 974, 1, 3, 3, 3, 3, 23, 23, 23, 23, 6, 7, 'XAAAAA', 'MLBAAA', 'OOOOxx'),
+(641, 975, 1, 1, 1, 1, 1, 41, 41, 141, 641, 2, 3, 'RYAAAA', 'NLBAAA', 'VVVVxx'),
+(524, 976, 0, 0, 4, 4, 4, 24, 124, 24, 524, 8, 9, 'EUAAAA', 'OLBAAA', 'AAAAxx'),
+(169, 977, 1, 1, 9, 9, 9, 69, 169, 169, 169, 18, 19, 'NGAAAA', 'PLBAAA', 'HHHHxx'),
+(6, 978, 0, 2, 6, 6, 6, 6, 6, 6, 6, 12, 13, 'GAAAAA', 'QLBAAA', 'OOOOxx'),
+(943, 979, 1, 3, 3, 3, 3, 43, 143, 443, 943, 6, 7, 'HKAAAA', 'RLBAAA', 'VVVVxx'),
+(26, 980, 0, 2, 6, 6, 6, 26, 26, 26, 26, 12, 13, 'ABAAAA', 'SLBAAA', 'AAAAxx'),
+(469, 981, 1, 1, 9, 9, 9, 69, 69, 469, 469, 18, 19, 'BSAAAA', 'TLBAAA', 'HHHHxx'),
+(968, 982, 0, 0, 8, 8, 8, 68, 168, 468, 968, 16, 17, 'GLAAAA', 'ULBAAA', 'OOOOxx'),
+(947, 983, 1, 3, 7, 7, 7, 47, 147, 447, 947, 14, 15, 'LKAAAA', 'VLBAAA', 'VVVVxx'),
+(133, 984, 1, 1, 3, 13, 3, 33, 133, 133, 133, 6, 7, 'DFAAAA', 'WLBAAA', 'AAAAxx'),
+(52, 985, 0, 0, 2, 12, 2, 52, 52, 52, 52, 4, 5, 'ACAAAA', 'XLBAAA', 'HHHHxx'),
+(660, 986, 0, 0, 0, 0, 0, 60, 60, 160, 660, 0, 1, 'KZAAAA', 'YLBAAA', 'OOOOxx'),
+(780, 987, 0, 0, 0, 0, 0, 80, 180, 280, 780, 0, 1, 'AEAAAA', 'ZLBAAA', 'VVVVxx'),
+(963, 988, 1, 3, 3, 3, 3, 63, 163, 463, 963, 6, 7, 'BLAAAA', 'AMBAAA', 'AAAAxx'),
+(561, 989, 1, 1, 1, 1, 1, 61, 161, 61, 561, 2, 3, 'PVAAAA', 'BMBAAA', 'HHHHxx'),
+(402, 990, 0, 2, 2, 2, 2, 2, 2, 402, 402, 4, 5, 'MPAAAA', 'CMBAAA', 'OOOOxx'),
+(437, 991, 1, 1, 7, 17, 7, 37, 37, 437, 437, 14, 15, 'VQAAAA', 'DMBAAA', 'VVVVxx'),
+(112, 992, 0, 0, 2, 12, 2, 12, 112, 112, 112, 4, 5, 'IEAAAA', 'EMBAAA', 'AAAAxx'),
+(247, 993, 1, 3, 7, 7, 7, 47, 47, 247, 247, 14, 15, 'NJAAAA', 'FMBAAA', 'HHHHxx'),
+(579, 994, 1, 3, 9, 19, 9, 79, 179, 79, 579, 18, 19, 'HWAAAA', 'GMBAAA', 'OOOOxx'),
+(379, 995, 1, 3, 9, 19, 9, 79, 179, 379, 379, 18, 19, 'POAAAA', 'HMBAAA', 'VVVVxx'),
+(74, 996, 0, 2, 4, 14, 4, 74, 74, 74, 74, 8, 9, 'WCAAAA', 'IMBAAA', 'AAAAxx'),
+(744, 997, 0, 0, 4, 4, 4, 44, 144, 244, 744, 8, 9, 'QCAAAA', 'JMBAAA', 'HHHHxx'),
+(0, 998, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'AAAAAA', 'KMBAAA', 'OOOOxx'),
+(278, 999, 0, 2, 8, 18, 8, 78, 78, 278, 278, 16, 17, 'SKAAAA', 'LMBAAA', 'VVVVxx');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/onek2.sql b/yql/essentials/tests/postgresql/initscripts/onek2.sql
new file mode 100644
index 0000000000..93a28b2a80
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/onek2.sql
@@ -0,0 +1,1021 @@
+CREATE TABLE onek2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+INSERT INTO onek2 VALUES
+(147, 0, 1, 3, 7, 7, 7, 47, 147, 147, 147, 14, 15, 'RFAAAA', 'AAAAAA', 'AAAAxx'),
+(931, 1, 1, 3, 1, 11, 1, 31, 131, 431, 931, 2, 3, 'VJAAAA', 'BAAAAA', 'HHHHxx'),
+(714, 2, 0, 2, 4, 14, 4, 14, 114, 214, 714, 8, 9, 'MBAAAA', 'CAAAAA', 'OOOOxx'),
+(711, 3, 1, 3, 1, 11, 1, 11, 111, 211, 711, 2, 3, 'JBAAAA', 'DAAAAA', 'VVVVxx'),
+(883, 4, 1, 3, 3, 3, 3, 83, 83, 383, 883, 6, 7, 'ZHAAAA', 'EAAAAA', 'AAAAxx'),
+(439, 5, 1, 3, 9, 19, 9, 39, 39, 439, 439, 18, 19, 'XQAAAA', 'FAAAAA', 'HHHHxx'),
+(670, 6, 0, 2, 0, 10, 0, 70, 70, 170, 670, 0, 1, 'UZAAAA', 'GAAAAA', 'OOOOxx'),
+(543, 7, 1, 3, 3, 3, 3, 43, 143, 43, 543, 6, 7, 'XUAAAA', 'HAAAAA', 'VVVVxx'),
+(425, 8, 1, 1, 5, 5, 5, 25, 25, 425, 425, 10, 11, 'JQAAAA', 'IAAAAA', 'AAAAxx'),
+(800, 9, 0, 0, 0, 0, 0, 0, 0, 300, 800, 0, 1, 'UEAAAA', 'JAAAAA', 'HHHHxx'),
+(489, 10, 1, 1, 9, 9, 9, 89, 89, 489, 489, 18, 19, 'VSAAAA', 'KAAAAA', 'OOOOxx'),
+(494, 11, 0, 2, 4, 14, 4, 94, 94, 494, 494, 8, 9, 'ATAAAA', 'LAAAAA', 'VVVVxx'),
+(880, 12, 0, 0, 0, 0, 0, 80, 80, 380, 880, 0, 1, 'WHAAAA', 'MAAAAA', 'AAAAxx'),
+(611, 13, 1, 3, 1, 11, 1, 11, 11, 111, 611, 2, 3, 'NXAAAA', 'NAAAAA', 'HHHHxx'),
+(226, 14, 0, 2, 6, 6, 6, 26, 26, 226, 226, 12, 13, 'SIAAAA', 'OAAAAA', 'OOOOxx'),
+(774, 15, 0, 2, 4, 14, 4, 74, 174, 274, 774, 8, 9, 'UDAAAA', 'PAAAAA', 'VVVVxx'),
+(298, 16, 0, 2, 8, 18, 8, 98, 98, 298, 298, 16, 17, 'MLAAAA', 'QAAAAA', 'AAAAxx'),
+(682, 17, 0, 2, 2, 2, 2, 82, 82, 182, 682, 4, 5, 'GAAAAA', 'RAAAAA', 'HHHHxx'),
+(864, 18, 0, 0, 4, 4, 4, 64, 64, 364, 864, 8, 9, 'GHAAAA', 'SAAAAA', 'OOOOxx'),
+(183, 19, 1, 3, 3, 3, 3, 83, 183, 183, 183, 6, 7, 'BHAAAA', 'TAAAAA', 'VVVVxx'),
+(885, 20, 1, 1, 5, 5, 5, 85, 85, 385, 885, 10, 11, 'BIAAAA', 'UAAAAA', 'AAAAxx'),
+(997, 21, 1, 1, 7, 17, 7, 97, 197, 497, 997, 14, 15, 'JMAAAA', 'VAAAAA', 'HHHHxx'),
+(966, 22, 0, 2, 6, 6, 6, 66, 166, 466, 966, 12, 13, 'ELAAAA', 'WAAAAA', 'OOOOxx'),
+(389, 23, 1, 1, 9, 9, 9, 89, 189, 389, 389, 18, 19, 'ZOAAAA', 'XAAAAA', 'VVVVxx'),
+(846, 24, 0, 2, 6, 6, 6, 46, 46, 346, 846, 12, 13, 'OGAAAA', 'YAAAAA', 'AAAAxx'),
+(206, 25, 0, 2, 6, 6, 6, 6, 6, 206, 206, 12, 13, 'YHAAAA', 'ZAAAAA', 'HHHHxx'),
+(239, 26, 1, 3, 9, 19, 9, 39, 39, 239, 239, 18, 19, 'FJAAAA', 'ABAAAA', 'OOOOxx'),
+(365, 27, 1, 1, 5, 5, 5, 65, 165, 365, 365, 10, 11, 'BOAAAA', 'BBAAAA', 'VVVVxx'),
+(204, 28, 0, 0, 4, 4, 4, 4, 4, 204, 204, 8, 9, 'WHAAAA', 'CBAAAA', 'AAAAxx'),
+(690, 29, 0, 2, 0, 10, 0, 90, 90, 190, 690, 0, 1, 'OAAAAA', 'DBAAAA', 'HHHHxx'),
+(69, 30, 1, 1, 9, 9, 9, 69, 69, 69, 69, 18, 19, 'RCAAAA', 'EBAAAA', 'OOOOxx'),
+(358, 31, 0, 2, 8, 18, 8, 58, 158, 358, 358, 16, 17, 'UNAAAA', 'FBAAAA', 'VVVVxx'),
+(269, 32, 1, 1, 9, 9, 9, 69, 69, 269, 269, 18, 19, 'JKAAAA', 'GBAAAA', 'AAAAxx'),
+(663, 33, 1, 3, 3, 3, 3, 63, 63, 163, 663, 6, 7, 'NZAAAA', 'HBAAAA', 'HHHHxx'),
+(608, 34, 0, 0, 8, 8, 8, 8, 8, 108, 608, 16, 17, 'KXAAAA', 'IBAAAA', 'OOOOxx'),
+(398, 35, 0, 2, 8, 18, 8, 98, 198, 398, 398, 16, 17, 'IPAAAA', 'JBAAAA', 'VVVVxx'),
+(330, 36, 0, 2, 0, 10, 0, 30, 130, 330, 330, 0, 1, 'SMAAAA', 'KBAAAA', 'AAAAxx'),
+(529, 37, 1, 1, 9, 9, 9, 29, 129, 29, 529, 18, 19, 'JUAAAA', 'LBAAAA', 'HHHHxx'),
+(555, 38, 1, 3, 5, 15, 5, 55, 155, 55, 555, 10, 11, 'JVAAAA', 'MBAAAA', 'OOOOxx'),
+(746, 39, 0, 2, 6, 6, 6, 46, 146, 246, 746, 12, 13, 'SCAAAA', 'NBAAAA', 'VVVVxx'),
+(558, 40, 0, 2, 8, 18, 8, 58, 158, 58, 558, 16, 17, 'MVAAAA', 'OBAAAA', 'AAAAxx'),
+(574, 41, 0, 2, 4, 14, 4, 74, 174, 74, 574, 8, 9, 'CWAAAA', 'PBAAAA', 'HHHHxx'),
+(343, 42, 1, 3, 3, 3, 3, 43, 143, 343, 343, 6, 7, 'FNAAAA', 'QBAAAA', 'OOOOxx'),
+(120, 43, 0, 0, 0, 0, 0, 20, 120, 120, 120, 0, 1, 'QEAAAA', 'RBAAAA', 'VVVVxx'),
+(461, 44, 1, 1, 1, 1, 1, 61, 61, 461, 461, 2, 3, 'TRAAAA', 'SBAAAA', 'AAAAxx'),
+(754, 45, 0, 2, 4, 14, 4, 54, 154, 254, 754, 8, 9, 'ADAAAA', 'TBAAAA', 'HHHHxx'),
+(772, 46, 0, 0, 2, 12, 2, 72, 172, 272, 772, 4, 5, 'SDAAAA', 'UBAAAA', 'OOOOxx'),
+(749, 47, 1, 1, 9, 9, 9, 49, 149, 249, 749, 18, 19, 'VCAAAA', 'VBAAAA', 'VVVVxx'),
+(386, 48, 0, 2, 6, 6, 6, 86, 186, 386, 386, 12, 13, 'WOAAAA', 'WBAAAA', 'AAAAxx'),
+(9, 49, 1, 1, 9, 9, 9, 9, 9, 9, 9, 18, 19, 'JAAAAA', 'XBAAAA', 'HHHHxx'),
+(771, 50, 1, 3, 1, 11, 1, 71, 171, 271, 771, 2, 3, 'RDAAAA', 'YBAAAA', 'OOOOxx'),
+(470, 51, 0, 2, 0, 10, 0, 70, 70, 470, 470, 0, 1, 'CSAAAA', 'ZBAAAA', 'VVVVxx'),
+(238, 52, 0, 2, 8, 18, 8, 38, 38, 238, 238, 16, 17, 'EJAAAA', 'ACAAAA', 'AAAAxx'),
+(86, 53, 0, 2, 6, 6, 6, 86, 86, 86, 86, 12, 13, 'IDAAAA', 'BCAAAA', 'HHHHxx'),
+(56, 54, 0, 0, 6, 16, 6, 56, 56, 56, 56, 12, 13, 'ECAAAA', 'CCAAAA', 'OOOOxx'),
+(767, 55, 1, 3, 7, 7, 7, 67, 167, 267, 767, 14, 15, 'NDAAAA', 'DCAAAA', 'VVVVxx'),
+(363, 56, 1, 3, 3, 3, 3, 63, 163, 363, 363, 6, 7, 'ZNAAAA', 'ECAAAA', 'AAAAxx'),
+(655, 57, 1, 3, 5, 15, 5, 55, 55, 155, 655, 10, 11, 'FZAAAA', 'FCAAAA', 'HHHHxx'),
+(394, 58, 0, 2, 4, 14, 4, 94, 194, 394, 394, 8, 9, 'EPAAAA', 'GCAAAA', 'OOOOxx'),
+(223, 59, 1, 3, 3, 3, 3, 23, 23, 223, 223, 6, 7, 'PIAAAA', 'HCAAAA', 'VVVVxx'),
+(946, 60, 0, 2, 6, 6, 6, 46, 146, 446, 946, 12, 13, 'KKAAAA', 'ICAAAA', 'AAAAxx'),
+(863, 61, 1, 3, 3, 3, 3, 63, 63, 363, 863, 6, 7, 'FHAAAA', 'JCAAAA', 'HHHHxx'),
+(913, 62, 1, 1, 3, 13, 3, 13, 113, 413, 913, 6, 7, 'DJAAAA', 'KCAAAA', 'OOOOxx'),
+(737, 63, 1, 1, 7, 17, 7, 37, 137, 237, 737, 14, 15, 'JCAAAA', 'LCAAAA', 'VVVVxx'),
+(65, 64, 1, 1, 5, 5, 5, 65, 65, 65, 65, 10, 11, 'NCAAAA', 'MCAAAA', 'AAAAxx'),
+(251, 65, 1, 3, 1, 11, 1, 51, 51, 251, 251, 2, 3, 'RJAAAA', 'NCAAAA', 'HHHHxx'),
+(686, 66, 0, 2, 6, 6, 6, 86, 86, 186, 686, 12, 13, 'KAAAAA', 'OCAAAA', 'OOOOxx'),
+(971, 67, 1, 3, 1, 11, 1, 71, 171, 471, 971, 2, 3, 'JLAAAA', 'PCAAAA', 'VVVVxx'),
+(775, 68, 1, 3, 5, 15, 5, 75, 175, 275, 775, 10, 11, 'VDAAAA', 'QCAAAA', 'AAAAxx'),
+(577, 69, 1, 1, 7, 17, 7, 77, 177, 77, 577, 14, 15, 'FWAAAA', 'RCAAAA', 'HHHHxx'),
+(830, 70, 0, 2, 0, 10, 0, 30, 30, 330, 830, 0, 1, 'YFAAAA', 'SCAAAA', 'OOOOxx'),
+(787, 71, 1, 3, 7, 7, 7, 87, 187, 287, 787, 14, 15, 'HEAAAA', 'TCAAAA', 'VVVVxx'),
+(898, 72, 0, 2, 8, 18, 8, 98, 98, 398, 898, 16, 17, 'OIAAAA', 'UCAAAA', 'AAAAxx'),
+(588, 73, 0, 0, 8, 8, 8, 88, 188, 88, 588, 16, 17, 'QWAAAA', 'VCAAAA', 'HHHHxx'),
+(872, 74, 0, 0, 2, 12, 2, 72, 72, 372, 872, 4, 5, 'OHAAAA', 'WCAAAA', 'OOOOxx'),
+(397, 75, 1, 1, 7, 17, 7, 97, 197, 397, 397, 14, 15, 'HPAAAA', 'XCAAAA', 'VVVVxx'),
+(51, 76, 1, 3, 1, 11, 1, 51, 51, 51, 51, 2, 3, 'ZBAAAA', 'YCAAAA', 'AAAAxx'),
+(381, 77, 1, 1, 1, 1, 1, 81, 181, 381, 381, 2, 3, 'ROAAAA', 'ZCAAAA', 'HHHHxx'),
+(632, 78, 0, 0, 2, 12, 2, 32, 32, 132, 632, 4, 5, 'IYAAAA', 'ADAAAA', 'OOOOxx'),
+(31, 79, 1, 3, 1, 11, 1, 31, 31, 31, 31, 2, 3, 'FBAAAA', 'BDAAAA', 'VVVVxx'),
+(855, 80, 1, 3, 5, 15, 5, 55, 55, 355, 855, 10, 11, 'XGAAAA', 'CDAAAA', 'AAAAxx'),
+(699, 81, 1, 3, 9, 19, 9, 99, 99, 199, 699, 18, 19, 'XAAAAA', 'DDAAAA', 'HHHHxx'),
+(562, 82, 0, 2, 2, 2, 2, 62, 162, 62, 562, 4, 5, 'QVAAAA', 'EDAAAA', 'OOOOxx'),
+(681, 83, 1, 1, 1, 1, 1, 81, 81, 181, 681, 2, 3, 'FAAAAA', 'FDAAAA', 'VVVVxx'),
+(585, 84, 1, 1, 5, 5, 5, 85, 185, 85, 585, 10, 11, 'NWAAAA', 'GDAAAA', 'AAAAxx'),
+(35, 85, 1, 3, 5, 15, 5, 35, 35, 35, 35, 10, 11, 'JBAAAA', 'HDAAAA', 'HHHHxx'),
+(962, 86, 0, 2, 2, 2, 2, 62, 162, 462, 962, 4, 5, 'ALAAAA', 'IDAAAA', 'OOOOxx'),
+(282, 87, 0, 2, 2, 2, 2, 82, 82, 282, 282, 4, 5, 'WKAAAA', 'JDAAAA', 'VVVVxx'),
+(254, 88, 0, 2, 4, 14, 4, 54, 54, 254, 254, 8, 9, 'UJAAAA', 'KDAAAA', 'AAAAxx'),
+(514, 89, 0, 2, 4, 14, 4, 14, 114, 14, 514, 8, 9, 'UTAAAA', 'LDAAAA', 'HHHHxx'),
+(406, 90, 0, 2, 6, 6, 6, 6, 6, 406, 406, 12, 13, 'QPAAAA', 'MDAAAA', 'OOOOxx'),
+(544, 91, 0, 0, 4, 4, 4, 44, 144, 44, 544, 8, 9, 'YUAAAA', 'NDAAAA', 'VVVVxx'),
+(704, 92, 0, 0, 4, 4, 4, 4, 104, 204, 704, 8, 9, 'CBAAAA', 'ODAAAA', 'AAAAxx'),
+(948, 93, 0, 0, 8, 8, 8, 48, 148, 448, 948, 16, 17, 'MKAAAA', 'PDAAAA', 'HHHHxx'),
+(412, 94, 0, 0, 2, 12, 2, 12, 12, 412, 412, 4, 5, 'WPAAAA', 'QDAAAA', 'OOOOxx'),
+(200, 95, 0, 0, 0, 0, 0, 0, 0, 200, 200, 0, 1, 'SHAAAA', 'RDAAAA', 'VVVVxx'),
+(583, 96, 1, 3, 3, 3, 3, 83, 183, 83, 583, 6, 7, 'LWAAAA', 'SDAAAA', 'AAAAxx'),
+(486, 97, 0, 2, 6, 6, 6, 86, 86, 486, 486, 12, 13, 'SSAAAA', 'TDAAAA', 'HHHHxx'),
+(666, 98, 0, 2, 6, 6, 6, 66, 66, 166, 666, 12, 13, 'QZAAAA', 'UDAAAA', 'OOOOxx'),
+(436, 99, 0, 0, 6, 16, 6, 36, 36, 436, 436, 12, 13, 'UQAAAA', 'VDAAAA', 'VVVVxx'),
+(842, 100, 0, 2, 2, 2, 2, 42, 42, 342, 842, 4, 5, 'KGAAAA', 'WDAAAA', 'AAAAxx'),
+(99, 101, 1, 3, 9, 19, 9, 99, 99, 99, 99, 18, 19, 'VDAAAA', 'XDAAAA', 'HHHHxx'),
+(656, 102, 0, 0, 6, 16, 6, 56, 56, 156, 656, 12, 13, 'GZAAAA', 'YDAAAA', 'OOOOxx'),
+(673, 103, 1, 1, 3, 13, 3, 73, 73, 173, 673, 6, 7, 'XZAAAA', 'ZDAAAA', 'VVVVxx'),
+(371, 104, 1, 3, 1, 11, 1, 71, 171, 371, 371, 2, 3, 'HOAAAA', 'AEAAAA', 'AAAAxx'),
+(869, 105, 1, 1, 9, 9, 9, 69, 69, 369, 869, 18, 19, 'LHAAAA', 'BEAAAA', 'HHHHxx'),
+(569, 106, 1, 1, 9, 9, 9, 69, 169, 69, 569, 18, 19, 'XVAAAA', 'CEAAAA', 'OOOOxx'),
+(616, 107, 0, 0, 6, 16, 6, 16, 16, 116, 616, 12, 13, 'SXAAAA', 'DEAAAA', 'VVVVxx'),
+(612, 108, 0, 0, 2, 12, 2, 12, 12, 112, 612, 4, 5, 'OXAAAA', 'EEAAAA', 'AAAAxx'),
+(505, 109, 1, 1, 5, 5, 5, 5, 105, 5, 505, 10, 11, 'LTAAAA', 'FEAAAA', 'HHHHxx'),
+(922, 110, 0, 2, 2, 2, 2, 22, 122, 422, 922, 4, 5, 'MJAAAA', 'GEAAAA', 'OOOOxx'),
+(221, 111, 1, 1, 1, 1, 1, 21, 21, 221, 221, 2, 3, 'NIAAAA', 'HEAAAA', 'VVVVxx'),
+(388, 112, 0, 0, 8, 8, 8, 88, 188, 388, 388, 16, 17, 'YOAAAA', 'IEAAAA', 'AAAAxx'),
+(567, 113, 1, 3, 7, 7, 7, 67, 167, 67, 567, 14, 15, 'VVAAAA', 'JEAAAA', 'HHHHxx'),
+(58, 114, 0, 2, 8, 18, 8, 58, 58, 58, 58, 16, 17, 'GCAAAA', 'KEAAAA', 'OOOOxx'),
+(316, 115, 0, 0, 6, 16, 6, 16, 116, 316, 316, 12, 13, 'EMAAAA', 'LEAAAA', 'VVVVxx'),
+(659, 116, 1, 3, 9, 19, 9, 59, 59, 159, 659, 18, 19, 'JZAAAA', 'MEAAAA', 'AAAAxx'),
+(501, 117, 1, 1, 1, 1, 1, 1, 101, 1, 501, 2, 3, 'HTAAAA', 'NEAAAA', 'HHHHxx'),
+(815, 118, 1, 3, 5, 15, 5, 15, 15, 315, 815, 10, 11, 'JFAAAA', 'OEAAAA', 'OOOOxx'),
+(638, 119, 0, 2, 8, 18, 8, 38, 38, 138, 638, 16, 17, 'OYAAAA', 'PEAAAA', 'VVVVxx'),
+(696, 120, 0, 0, 6, 16, 6, 96, 96, 196, 696, 12, 13, 'UAAAAA', 'QEAAAA', 'AAAAxx'),
+(734, 121, 0, 2, 4, 14, 4, 34, 134, 234, 734, 8, 9, 'GCAAAA', 'REAAAA', 'HHHHxx'),
+(237, 122, 1, 1, 7, 17, 7, 37, 37, 237, 237, 14, 15, 'DJAAAA', 'SEAAAA', 'OOOOxx'),
+(816, 123, 0, 0, 6, 16, 6, 16, 16, 316, 816, 12, 13, 'KFAAAA', 'TEAAAA', 'VVVVxx'),
+(917, 124, 1, 1, 7, 17, 7, 17, 117, 417, 917, 14, 15, 'HJAAAA', 'UEAAAA', 'AAAAxx'),
+(844, 125, 0, 0, 4, 4, 4, 44, 44, 344, 844, 8, 9, 'MGAAAA', 'VEAAAA', 'HHHHxx'),
+(657, 126, 1, 1, 7, 17, 7, 57, 57, 157, 657, 14, 15, 'HZAAAA', 'WEAAAA', 'OOOOxx'),
+(952, 127, 0, 0, 2, 12, 2, 52, 152, 452, 952, 4, 5, 'QKAAAA', 'XEAAAA', 'VVVVxx'),
+(519, 128, 1, 3, 9, 19, 9, 19, 119, 19, 519, 18, 19, 'ZTAAAA', 'YEAAAA', 'AAAAxx'),
+(792, 129, 0, 0, 2, 12, 2, 92, 192, 292, 792, 4, 5, 'MEAAAA', 'ZEAAAA', 'HHHHxx'),
+(275, 130, 1, 3, 5, 15, 5, 75, 75, 275, 275, 10, 11, 'PKAAAA', 'AFAAAA', 'OOOOxx'),
+(319, 131, 1, 3, 9, 19, 9, 19, 119, 319, 319, 18, 19, 'HMAAAA', 'BFAAAA', 'VVVVxx'),
+(487, 132, 1, 3, 7, 7, 7, 87, 87, 487, 487, 14, 15, 'TSAAAA', 'CFAAAA', 'AAAAxx'),
+(945, 133, 1, 1, 5, 5, 5, 45, 145, 445, 945, 10, 11, 'JKAAAA', 'DFAAAA', 'HHHHxx'),
+(584, 134, 0, 0, 4, 4, 4, 84, 184, 84, 584, 8, 9, 'MWAAAA', 'EFAAAA', 'OOOOxx'),
+(765, 135, 1, 1, 5, 5, 5, 65, 165, 265, 765, 10, 11, 'LDAAAA', 'FFAAAA', 'VVVVxx'),
+(814, 136, 0, 2, 4, 14, 4, 14, 14, 314, 814, 8, 9, 'IFAAAA', 'GFAAAA', 'AAAAxx'),
+(359, 137, 1, 3, 9, 19, 9, 59, 159, 359, 359, 18, 19, 'VNAAAA', 'HFAAAA', 'HHHHxx'),
+(548, 138, 0, 0, 8, 8, 8, 48, 148, 48, 548, 16, 17, 'CVAAAA', 'IFAAAA', 'OOOOxx'),
+(811, 139, 1, 3, 1, 11, 1, 11, 11, 311, 811, 2, 3, 'FFAAAA', 'JFAAAA', 'VVVVxx'),
+(531, 140, 1, 3, 1, 11, 1, 31, 131, 31, 531, 2, 3, 'LUAAAA', 'KFAAAA', 'AAAAxx'),
+(104, 141, 0, 0, 4, 4, 4, 4, 104, 104, 104, 8, 9, 'AEAAAA', 'LFAAAA', 'HHHHxx'),
+(33, 142, 1, 1, 3, 13, 3, 33, 33, 33, 33, 6, 7, 'HBAAAA', 'MFAAAA', 'OOOOxx'),
+(404, 143, 0, 0, 4, 4, 4, 4, 4, 404, 404, 8, 9, 'OPAAAA', 'NFAAAA', 'VVVVxx'),
+(995, 144, 1, 3, 5, 15, 5, 95, 195, 495, 995, 10, 11, 'HMAAAA', 'OFAAAA', 'AAAAxx'),
+(408, 145, 0, 0, 8, 8, 8, 8, 8, 408, 408, 16, 17, 'SPAAAA', 'PFAAAA', 'HHHHxx'),
+(93, 146, 1, 1, 3, 13, 3, 93, 93, 93, 93, 6, 7, 'PDAAAA', 'QFAAAA', 'OOOOxx'),
+(794, 147, 0, 2, 4, 14, 4, 94, 194, 294, 794, 8, 9, 'OEAAAA', 'RFAAAA', 'VVVVxx'),
+(833, 148, 1, 1, 3, 13, 3, 33, 33, 333, 833, 6, 7, 'BGAAAA', 'SFAAAA', 'AAAAxx'),
+(615, 149, 1, 3, 5, 15, 5, 15, 15, 115, 615, 10, 11, 'RXAAAA', 'TFAAAA', 'HHHHxx'),
+(333, 150, 1, 1, 3, 13, 3, 33, 133, 333, 333, 6, 7, 'VMAAAA', 'UFAAAA', 'OOOOxx'),
+(357, 151, 1, 1, 7, 17, 7, 57, 157, 357, 357, 14, 15, 'TNAAAA', 'VFAAAA', 'VVVVxx'),
+(999, 152, 1, 3, 9, 19, 9, 99, 199, 499, 999, 18, 19, 'LMAAAA', 'WFAAAA', 'AAAAxx'),
+(515, 153, 1, 3, 5, 15, 5, 15, 115, 15, 515, 10, 11, 'VTAAAA', 'XFAAAA', 'HHHHxx'),
+(685, 154, 1, 1, 5, 5, 5, 85, 85, 185, 685, 10, 11, 'JAAAAA', 'YFAAAA', 'OOOOxx'),
+(692, 155, 0, 0, 2, 12, 2, 92, 92, 192, 692, 4, 5, 'QAAAAA', 'ZFAAAA', 'VVVVxx'),
+(627, 156, 1, 3, 7, 7, 7, 27, 27, 127, 627, 14, 15, 'DYAAAA', 'AGAAAA', 'AAAAxx'),
+(654, 157, 0, 2, 4, 14, 4, 54, 54, 154, 654, 8, 9, 'EZAAAA', 'BGAAAA', 'HHHHxx'),
+(115, 158, 1, 3, 5, 15, 5, 15, 115, 115, 115, 10, 11, 'LEAAAA', 'CGAAAA', 'OOOOxx'),
+(75, 159, 1, 3, 5, 15, 5, 75, 75, 75, 75, 10, 11, 'XCAAAA', 'DGAAAA', 'VVVVxx'),
+(14, 160, 0, 2, 4, 14, 4, 14, 14, 14, 14, 8, 9, 'OAAAAA', 'EGAAAA', 'AAAAxx'),
+(148, 161, 0, 0, 8, 8, 8, 48, 148, 148, 148, 16, 17, 'SFAAAA', 'FGAAAA', 'HHHHxx'),
+(201, 162, 1, 1, 1, 1, 1, 1, 1, 201, 201, 2, 3, 'THAAAA', 'GGAAAA', 'OOOOxx'),
+(862, 163, 0, 2, 2, 2, 2, 62, 62, 362, 862, 4, 5, 'EHAAAA', 'HGAAAA', 'VVVVxx'),
+(634, 164, 0, 2, 4, 14, 4, 34, 34, 134, 634, 8, 9, 'KYAAAA', 'IGAAAA', 'AAAAxx'),
+(589, 165, 1, 1, 9, 9, 9, 89, 189, 89, 589, 18, 19, 'RWAAAA', 'JGAAAA', 'HHHHxx'),
+(142, 166, 0, 2, 2, 2, 2, 42, 142, 142, 142, 4, 5, 'MFAAAA', 'KGAAAA', 'OOOOxx'),
+(545, 167, 1, 1, 5, 5, 5, 45, 145, 45, 545, 10, 11, 'ZUAAAA', 'LGAAAA', 'VVVVxx'),
+(983, 168, 1, 3, 3, 3, 3, 83, 183, 483, 983, 6, 7, 'VLAAAA', 'MGAAAA', 'AAAAxx'),
+(87, 169, 1, 3, 7, 7, 7, 87, 87, 87, 87, 14, 15, 'JDAAAA', 'NGAAAA', 'HHHHxx'),
+(335, 170, 1, 3, 5, 15, 5, 35, 135, 335, 335, 10, 11, 'XMAAAA', 'OGAAAA', 'OOOOxx'),
+(915, 171, 1, 3, 5, 15, 5, 15, 115, 415, 915, 10, 11, 'FJAAAA', 'PGAAAA', 'VVVVxx'),
+(286, 172, 0, 2, 6, 6, 6, 86, 86, 286, 286, 12, 13, 'ALAAAA', 'QGAAAA', 'AAAAxx'),
+(361, 173, 1, 1, 1, 1, 1, 61, 161, 361, 361, 2, 3, 'XNAAAA', 'RGAAAA', 'HHHHxx'),
+(97, 174, 1, 1, 7, 17, 7, 97, 97, 97, 97, 14, 15, 'TDAAAA', 'SGAAAA', 'OOOOxx'),
+(98, 175, 0, 2, 8, 18, 8, 98, 98, 98, 98, 16, 17, 'UDAAAA', 'TGAAAA', 'VVVVxx'),
+(377, 176, 1, 1, 7, 17, 7, 77, 177, 377, 377, 14, 15, 'NOAAAA', 'UGAAAA', 'AAAAxx'),
+(525, 177, 1, 1, 5, 5, 5, 25, 125, 25, 525, 10, 11, 'FUAAAA', 'VGAAAA', 'HHHHxx'),
+(448, 178, 0, 0, 8, 8, 8, 48, 48, 448, 448, 16, 17, 'GRAAAA', 'WGAAAA', 'OOOOxx'),
+(154, 179, 0, 2, 4, 14, 4, 54, 154, 154, 154, 8, 9, 'YFAAAA', 'XGAAAA', 'VVVVxx'),
+(866, 180, 0, 2, 6, 6, 6, 66, 66, 366, 866, 12, 13, 'IHAAAA', 'YGAAAA', 'AAAAxx'),
+(741, 181, 1, 1, 1, 1, 1, 41, 141, 241, 741, 2, 3, 'NCAAAA', 'ZGAAAA', 'HHHHxx'),
+(172, 182, 0, 0, 2, 12, 2, 72, 172, 172, 172, 4, 5, 'QGAAAA', 'AHAAAA', 'OOOOxx'),
+(843, 183, 1, 3, 3, 3, 3, 43, 43, 343, 843, 6, 7, 'LGAAAA', 'BHAAAA', 'VVVVxx'),
+(378, 184, 0, 2, 8, 18, 8, 78, 178, 378, 378, 16, 17, 'OOAAAA', 'CHAAAA', 'AAAAxx'),
+(804, 185, 0, 0, 4, 4, 4, 4, 4, 304, 804, 8, 9, 'YEAAAA', 'DHAAAA', 'HHHHxx'),
+(596, 186, 0, 0, 6, 16, 6, 96, 196, 96, 596, 12, 13, 'YWAAAA', 'EHAAAA', 'OOOOxx'),
+(77, 187, 1, 1, 7, 17, 7, 77, 77, 77, 77, 14, 15, 'ZCAAAA', 'FHAAAA', 'VVVVxx'),
+(572, 188, 0, 0, 2, 12, 2, 72, 172, 72, 572, 4, 5, 'AWAAAA', 'GHAAAA', 'AAAAxx'),
+(444, 189, 0, 0, 4, 4, 4, 44, 44, 444, 444, 8, 9, 'CRAAAA', 'HHAAAA', 'HHHHxx'),
+(47, 190, 1, 3, 7, 7, 7, 47, 47, 47, 47, 14, 15, 'VBAAAA', 'IHAAAA', 'OOOOxx'),
+(274, 191, 0, 2, 4, 14, 4, 74, 74, 274, 274, 8, 9, 'OKAAAA', 'JHAAAA', 'VVVVxx'),
+(40, 192, 0, 0, 0, 0, 0, 40, 40, 40, 40, 0, 1, 'OBAAAA', 'KHAAAA', 'AAAAxx'),
+(339, 193, 1, 3, 9, 19, 9, 39, 139, 339, 339, 18, 19, 'BNAAAA', 'LHAAAA', 'HHHHxx'),
+(13, 194, 1, 1, 3, 13, 3, 13, 13, 13, 13, 6, 7, 'NAAAAA', 'MHAAAA', 'OOOOxx'),
+(878, 195, 0, 2, 8, 18, 8, 78, 78, 378, 878, 16, 17, 'UHAAAA', 'NHAAAA', 'VVVVxx'),
+(53, 196, 1, 1, 3, 13, 3, 53, 53, 53, 53, 6, 7, 'BCAAAA', 'OHAAAA', 'AAAAxx'),
+(939, 197, 1, 3, 9, 19, 9, 39, 139, 439, 939, 18, 19, 'DKAAAA', 'PHAAAA', 'HHHHxx'),
+(928, 198, 0, 0, 8, 8, 8, 28, 128, 428, 928, 16, 17, 'SJAAAA', 'QHAAAA', 'OOOOxx'),
+(886, 199, 0, 2, 6, 6, 6, 86, 86, 386, 886, 12, 13, 'CIAAAA', 'RHAAAA', 'VVVVxx'),
+(267, 200, 1, 3, 7, 7, 7, 67, 67, 267, 267, 14, 15, 'HKAAAA', 'SHAAAA', 'AAAAxx'),
+(105, 201, 1, 1, 5, 5, 5, 5, 105, 105, 105, 10, 11, 'BEAAAA', 'THAAAA', 'HHHHxx'),
+(312, 202, 0, 0, 2, 12, 2, 12, 112, 312, 312, 4, 5, 'AMAAAA', 'UHAAAA', 'OOOOxx'),
+(552, 203, 0, 0, 2, 12, 2, 52, 152, 52, 552, 4, 5, 'GVAAAA', 'VHAAAA', 'VVVVxx'),
+(918, 204, 0, 2, 8, 18, 8, 18, 118, 418, 918, 16, 17, 'IJAAAA', 'WHAAAA', 'AAAAxx'),
+(114, 205, 0, 2, 4, 14, 4, 14, 114, 114, 114, 8, 9, 'KEAAAA', 'XHAAAA', 'HHHHxx'),
+(805, 206, 1, 1, 5, 5, 5, 5, 5, 305, 805, 10, 11, 'ZEAAAA', 'YHAAAA', 'OOOOxx'),
+(875, 207, 1, 3, 5, 15, 5, 75, 75, 375, 875, 10, 11, 'RHAAAA', 'ZHAAAA', 'VVVVxx'),
+(225, 208, 1, 1, 5, 5, 5, 25, 25, 225, 225, 10, 11, 'RIAAAA', 'AIAAAA', 'AAAAxx'),
+(495, 209, 1, 3, 5, 15, 5, 95, 95, 495, 495, 10, 11, 'BTAAAA', 'BIAAAA', 'HHHHxx'),
+(150, 210, 0, 2, 0, 10, 0, 50, 150, 150, 150, 0, 1, 'UFAAAA', 'CIAAAA', 'OOOOxx'),
+(759, 211, 1, 3, 9, 19, 9, 59, 159, 259, 759, 18, 19, 'FDAAAA', 'DIAAAA', 'VVVVxx'),
+(149, 212, 1, 1, 9, 9, 9, 49, 149, 149, 149, 18, 19, 'TFAAAA', 'EIAAAA', 'AAAAxx'),
+(480, 213, 0, 0, 0, 0, 0, 80, 80, 480, 480, 0, 1, 'MSAAAA', 'FIAAAA', 'HHHHxx'),
+(1, 214, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 'BAAAAA', 'GIAAAA', 'OOOOxx'),
+(557, 215, 1, 1, 7, 17, 7, 57, 157, 57, 557, 14, 15, 'LVAAAA', 'HIAAAA', 'VVVVxx'),
+(295, 216, 1, 3, 5, 15, 5, 95, 95, 295, 295, 10, 11, 'JLAAAA', 'IIAAAA', 'AAAAxx'),
+(854, 217, 0, 2, 4, 14, 4, 54, 54, 354, 854, 8, 9, 'WGAAAA', 'JIAAAA', 'HHHHxx'),
+(420, 218, 0, 0, 0, 0, 0, 20, 20, 420, 420, 0, 1, 'EQAAAA', 'KIAAAA', 'OOOOxx'),
+(414, 219, 0, 2, 4, 14, 4, 14, 14, 414, 414, 8, 9, 'YPAAAA', 'LIAAAA', 'VVVVxx'),
+(758, 220, 0, 2, 8, 18, 8, 58, 158, 258, 758, 16, 17, 'EDAAAA', 'MIAAAA', 'AAAAxx'),
+(879, 221, 1, 3, 9, 19, 9, 79, 79, 379, 879, 18, 19, 'VHAAAA', 'NIAAAA', 'HHHHxx'),
+(332, 222, 0, 0, 2, 12, 2, 32, 132, 332, 332, 4, 5, 'UMAAAA', 'OIAAAA', 'OOOOxx'),
+(78, 223, 0, 2, 8, 18, 8, 78, 78, 78, 78, 16, 17, 'ADAAAA', 'PIAAAA', 'VVVVxx'),
+(851, 224, 1, 3, 1, 11, 1, 51, 51, 351, 851, 2, 3, 'TGAAAA', 'QIAAAA', 'AAAAxx'),
+(592, 225, 0, 0, 2, 12, 2, 92, 192, 92, 592, 4, 5, 'UWAAAA', 'RIAAAA', 'HHHHxx'),
+(979, 226, 1, 3, 9, 19, 9, 79, 179, 479, 979, 18, 19, 'RLAAAA', 'SIAAAA', 'OOOOxx'),
+(989, 227, 1, 1, 9, 9, 9, 89, 189, 489, 989, 18, 19, 'BMAAAA', 'TIAAAA', 'VVVVxx'),
+(752, 228, 0, 0, 2, 12, 2, 52, 152, 252, 752, 4, 5, 'YCAAAA', 'UIAAAA', 'AAAAxx'),
+(214, 229, 0, 2, 4, 14, 4, 14, 14, 214, 214, 8, 9, 'GIAAAA', 'VIAAAA', 'HHHHxx'),
+(453, 230, 1, 1, 3, 13, 3, 53, 53, 453, 453, 6, 7, 'LRAAAA', 'WIAAAA', 'OOOOxx'),
+(540, 231, 0, 0, 0, 0, 0, 40, 140, 40, 540, 0, 1, 'UUAAAA', 'XIAAAA', 'VVVVxx'),
+(597, 232, 1, 1, 7, 17, 7, 97, 197, 97, 597, 14, 15, 'ZWAAAA', 'YIAAAA', 'AAAAxx'),
+(356, 233, 0, 0, 6, 16, 6, 56, 156, 356, 356, 12, 13, 'SNAAAA', 'ZIAAAA', 'HHHHxx'),
+(720, 234, 0, 0, 0, 0, 0, 20, 120, 220, 720, 0, 1, 'SBAAAA', 'AJAAAA', 'OOOOxx'),
+(367, 235, 1, 3, 7, 7, 7, 67, 167, 367, 367, 14, 15, 'DOAAAA', 'BJAAAA', 'VVVVxx'),
+(762, 236, 0, 2, 2, 2, 2, 62, 162, 262, 762, 4, 5, 'IDAAAA', 'CJAAAA', 'AAAAxx'),
+(986, 237, 0, 2, 6, 6, 6, 86, 186, 486, 986, 12, 13, 'YLAAAA', 'DJAAAA', 'HHHHxx'),
+(924, 238, 0, 0, 4, 4, 4, 24, 124, 424, 924, 8, 9, 'OJAAAA', 'EJAAAA', 'OOOOxx'),
+(779, 239, 1, 3, 9, 19, 9, 79, 179, 279, 779, 18, 19, 'ZDAAAA', 'FJAAAA', 'VVVVxx'),
+(684, 240, 0, 0, 4, 4, 4, 84, 84, 184, 684, 8, 9, 'IAAAAA', 'GJAAAA', 'AAAAxx'),
+(413, 241, 1, 1, 3, 13, 3, 13, 13, 413, 413, 6, 7, 'XPAAAA', 'HJAAAA', 'HHHHxx'),
+(479, 242, 1, 3, 9, 19, 9, 79, 79, 479, 479, 18, 19, 'LSAAAA', 'IJAAAA', 'OOOOxx'),
+(731, 243, 1, 3, 1, 11, 1, 31, 131, 231, 731, 2, 3, 'DCAAAA', 'JJAAAA', 'VVVVxx'),
+(409, 244, 1, 1, 9, 9, 9, 9, 9, 409, 409, 18, 19, 'TPAAAA', 'KJAAAA', 'AAAAxx'),
+(372, 245, 0, 0, 2, 12, 2, 72, 172, 372, 372, 4, 5, 'IOAAAA', 'LJAAAA', 'HHHHxx'),
+(139, 246, 1, 3, 9, 19, 9, 39, 139, 139, 139, 18, 19, 'JFAAAA', 'MJAAAA', 'OOOOxx'),
+(717, 247, 1, 1, 7, 17, 7, 17, 117, 217, 717, 14, 15, 'PBAAAA', 'NJAAAA', 'VVVVxx'),
+(539, 248, 1, 3, 9, 19, 9, 39, 139, 39, 539, 18, 19, 'TUAAAA', 'OJAAAA', 'AAAAxx'),
+(318, 249, 0, 2, 8, 18, 8, 18, 118, 318, 318, 16, 17, 'GMAAAA', 'PJAAAA', 'HHHHxx'),
+(208, 250, 0, 0, 8, 8, 8, 8, 8, 208, 208, 16, 17, 'AIAAAA', 'QJAAAA', 'OOOOxx'),
+(797, 251, 1, 1, 7, 17, 7, 97, 197, 297, 797, 14, 15, 'REAAAA', 'RJAAAA', 'VVVVxx'),
+(661, 252, 1, 1, 1, 1, 1, 61, 61, 161, 661, 2, 3, 'LZAAAA', 'SJAAAA', 'AAAAxx'),
+(50, 253, 0, 2, 0, 10, 0, 50, 50, 50, 50, 0, 1, 'YBAAAA', 'TJAAAA', 'HHHHxx'),
+(102, 254, 0, 2, 2, 2, 2, 2, 102, 102, 102, 4, 5, 'YDAAAA', 'UJAAAA', 'OOOOxx'),
+(484, 255, 0, 0, 4, 4, 4, 84, 84, 484, 484, 8, 9, 'QSAAAA', 'VJAAAA', 'VVVVxx'),
+(108, 256, 0, 0, 8, 8, 8, 8, 108, 108, 108, 16, 17, 'EEAAAA', 'WJAAAA', 'AAAAxx'),
+(140, 257, 0, 0, 0, 0, 0, 40, 140, 140, 140, 0, 1, 'KFAAAA', 'XJAAAA', 'HHHHxx'),
+(996, 258, 0, 0, 6, 16, 6, 96, 196, 496, 996, 12, 13, 'IMAAAA', 'YJAAAA', 'OOOOxx'),
+(687, 259, 1, 3, 7, 7, 7, 87, 87, 187, 687, 14, 15, 'LAAAAA', 'ZJAAAA', 'VVVVxx'),
+(241, 260, 1, 1, 1, 1, 1, 41, 41, 241, 241, 2, 3, 'HJAAAA', 'AKAAAA', 'AAAAxx'),
+(923, 261, 1, 3, 3, 3, 3, 23, 123, 423, 923, 6, 7, 'NJAAAA', 'BKAAAA', 'HHHHxx'),
+(500, 262, 0, 0, 0, 0, 0, 0, 100, 0, 500, 0, 1, 'GTAAAA', 'CKAAAA', 'OOOOxx'),
+(536, 263, 0, 0, 6, 16, 6, 36, 136, 36, 536, 12, 13, 'QUAAAA', 'DKAAAA', 'VVVVxx'),
+(490, 264, 0, 2, 0, 10, 0, 90, 90, 490, 490, 0, 1, 'WSAAAA', 'EKAAAA', 'AAAAxx'),
+(773, 265, 1, 1, 3, 13, 3, 73, 173, 273, 773, 6, 7, 'TDAAAA', 'FKAAAA', 'HHHHxx'),
+(19, 266, 1, 3, 9, 19, 9, 19, 19, 19, 19, 18, 19, 'TAAAAA', 'GKAAAA', 'OOOOxx'),
+(534, 267, 0, 2, 4, 14, 4, 34, 134, 34, 534, 8, 9, 'OUAAAA', 'HKAAAA', 'VVVVxx'),
+(941, 268, 1, 1, 1, 1, 1, 41, 141, 441, 941, 2, 3, 'FKAAAA', 'IKAAAA', 'AAAAxx'),
+(477, 269, 1, 1, 7, 17, 7, 77, 77, 477, 477, 14, 15, 'JSAAAA', 'JKAAAA', 'HHHHxx'),
+(173, 270, 1, 1, 3, 13, 3, 73, 173, 173, 173, 6, 7, 'RGAAAA', 'KKAAAA', 'OOOOxx'),
+(113, 271, 1, 1, 3, 13, 3, 13, 113, 113, 113, 6, 7, 'JEAAAA', 'LKAAAA', 'VVVVxx'),
+(526, 272, 0, 2, 6, 6, 6, 26, 126, 26, 526, 12, 13, 'GUAAAA', 'MKAAAA', 'AAAAxx'),
+(727, 273, 1, 3, 7, 7, 7, 27, 127, 227, 727, 14, 15, 'ZBAAAA', 'NKAAAA', 'HHHHxx'),
+(302, 274, 0, 2, 2, 2, 2, 2, 102, 302, 302, 4, 5, 'QLAAAA', 'OKAAAA', 'OOOOxx'),
+(789, 275, 1, 1, 9, 9, 9, 89, 189, 289, 789, 18, 19, 'JEAAAA', 'PKAAAA', 'VVVVxx'),
+(447, 276, 1, 3, 7, 7, 7, 47, 47, 447, 447, 14, 15, 'FRAAAA', 'QKAAAA', 'AAAAxx'),
+(884, 277, 0, 0, 4, 4, 4, 84, 84, 384, 884, 8, 9, 'AIAAAA', 'RKAAAA', 'HHHHxx'),
+(718, 278, 0, 2, 8, 18, 8, 18, 118, 218, 718, 16, 17, 'QBAAAA', 'SKAAAA', 'OOOOxx'),
+(818, 279, 0, 2, 8, 18, 8, 18, 18, 318, 818, 16, 17, 'MFAAAA', 'TKAAAA', 'VVVVxx'),
+(466, 280, 0, 2, 6, 6, 6, 66, 66, 466, 466, 12, 13, 'YRAAAA', 'UKAAAA', 'AAAAxx'),
+(131, 281, 1, 3, 1, 11, 1, 31, 131, 131, 131, 2, 3, 'BFAAAA', 'VKAAAA', 'HHHHxx'),
+(503, 282, 1, 3, 3, 3, 3, 3, 103, 3, 503, 6, 7, 'JTAAAA', 'WKAAAA', 'OOOOxx'),
+(364, 283, 0, 0, 4, 4, 4, 64, 164, 364, 364, 8, 9, 'AOAAAA', 'XKAAAA', 'VVVVxx'),
+(934, 284, 0, 2, 4, 14, 4, 34, 134, 434, 934, 8, 9, 'YJAAAA', 'YKAAAA', 'AAAAxx'),
+(542, 285, 0, 2, 2, 2, 2, 42, 142, 42, 542, 4, 5, 'WUAAAA', 'ZKAAAA', 'HHHHxx'),
+(146, 286, 0, 2, 6, 6, 6, 46, 146, 146, 146, 12, 13, 'QFAAAA', 'ALAAAA', 'OOOOxx'),
+(652, 287, 0, 0, 2, 12, 2, 52, 52, 152, 652, 4, 5, 'CZAAAA', 'BLAAAA', 'VVVVxx'),
+(566, 288, 0, 2, 6, 6, 6, 66, 166, 66, 566, 12, 13, 'UVAAAA', 'CLAAAA', 'AAAAxx'),
+(788, 289, 0, 0, 8, 8, 8, 88, 188, 288, 788, 16, 17, 'IEAAAA', 'DLAAAA', 'HHHHxx'),
+(168, 290, 0, 0, 8, 8, 8, 68, 168, 168, 168, 16, 17, 'MGAAAA', 'ELAAAA', 'OOOOxx'),
+(736, 291, 0, 0, 6, 16, 6, 36, 136, 236, 736, 12, 13, 'ICAAAA', 'FLAAAA', 'VVVVxx'),
+(795, 292, 1, 3, 5, 15, 5, 95, 195, 295, 795, 10, 11, 'PEAAAA', 'GLAAAA', 'AAAAxx'),
+(103, 293, 1, 3, 3, 3, 3, 3, 103, 103, 103, 6, 7, 'ZDAAAA', 'HLAAAA', 'HHHHxx'),
+(763, 294, 1, 3, 3, 3, 3, 63, 163, 263, 763, 6, 7, 'JDAAAA', 'ILAAAA', 'OOOOxx'),
+(256, 295, 0, 0, 6, 16, 6, 56, 56, 256, 256, 12, 13, 'WJAAAA', 'JLAAAA', 'VVVVxx'),
+(63, 296, 1, 3, 3, 3, 3, 63, 63, 63, 63, 6, 7, 'LCAAAA', 'KLAAAA', 'AAAAxx'),
+(702, 297, 0, 2, 2, 2, 2, 2, 102, 202, 702, 4, 5, 'ABAAAA', 'LLAAAA', 'HHHHxx'),
+(390, 298, 0, 2, 0, 10, 0, 90, 190, 390, 390, 0, 1, 'APAAAA', 'MLAAAA', 'OOOOxx'),
+(116, 299, 0, 0, 6, 16, 6, 16, 116, 116, 116, 12, 13, 'MEAAAA', 'NLAAAA', 'VVVVxx'),
+(354, 300, 0, 2, 4, 14, 4, 54, 154, 354, 354, 8, 9, 'QNAAAA', 'OLAAAA', 'AAAAxx'),
+(162, 301, 0, 2, 2, 2, 2, 62, 162, 162, 162, 4, 5, 'GGAAAA', 'PLAAAA', 'HHHHxx'),
+(71, 302, 1, 3, 1, 11, 1, 71, 71, 71, 71, 2, 3, 'TCAAAA', 'QLAAAA', 'OOOOxx'),
+(916, 303, 0, 0, 6, 16, 6, 16, 116, 416, 916, 12, 13, 'GJAAAA', 'RLAAAA', 'VVVVxx'),
+(565, 304, 1, 1, 5, 5, 5, 65, 165, 65, 565, 10, 11, 'TVAAAA', 'SLAAAA', 'AAAAxx'),
+(509, 305, 1, 1, 9, 9, 9, 9, 109, 9, 509, 18, 19, 'PTAAAA', 'TLAAAA', 'HHHHxx'),
+(20, 306, 0, 0, 0, 0, 0, 20, 20, 20, 20, 0, 1, 'UAAAAA', 'ULAAAA', 'OOOOxx'),
+(813, 307, 1, 1, 3, 13, 3, 13, 13, 313, 813, 6, 7, 'HFAAAA', 'VLAAAA', 'VVVVxx'),
+(80, 308, 0, 0, 0, 0, 0, 80, 80, 80, 80, 0, 1, 'CDAAAA', 'WLAAAA', 'AAAAxx'),
+(400, 309, 0, 0, 0, 0, 0, 0, 0, 400, 400, 0, 1, 'KPAAAA', 'XLAAAA', 'HHHHxx'),
+(888, 310, 0, 0, 8, 8, 8, 88, 88, 388, 888, 16, 17, 'EIAAAA', 'YLAAAA', 'OOOOxx'),
+(825, 311, 1, 1, 5, 5, 5, 25, 25, 325, 825, 10, 11, 'TFAAAA', 'ZLAAAA', 'VVVVxx'),
+(401, 312, 1, 1, 1, 1, 1, 1, 1, 401, 401, 2, 3, 'LPAAAA', 'AMAAAA', 'AAAAxx'),
+(158, 313, 0, 2, 8, 18, 8, 58, 158, 158, 158, 16, 17, 'CGAAAA', 'BMAAAA', 'HHHHxx'),
+(973, 314, 1, 1, 3, 13, 3, 73, 173, 473, 973, 6, 7, 'LLAAAA', 'CMAAAA', 'OOOOxx'),
+(324, 315, 0, 0, 4, 4, 4, 24, 124, 324, 324, 8, 9, 'MMAAAA', 'DMAAAA', 'VVVVxx'),
+(873, 316, 1, 1, 3, 13, 3, 73, 73, 373, 873, 6, 7, 'PHAAAA', 'EMAAAA', 'AAAAxx'),
+(676, 317, 0, 0, 6, 16, 6, 76, 76, 176, 676, 12, 13, 'AAAAAA', 'FMAAAA', 'HHHHxx'),
+(199, 318, 1, 3, 9, 19, 9, 99, 199, 199, 199, 18, 19, 'RHAAAA', 'GMAAAA', 'OOOOxx'),
+(304, 319, 0, 0, 4, 4, 4, 4, 104, 304, 304, 8, 9, 'SLAAAA', 'HMAAAA', 'VVVVxx'),
+(338, 320, 0, 2, 8, 18, 8, 38, 138, 338, 338, 16, 17, 'ANAAAA', 'IMAAAA', 'AAAAxx'),
+(743, 321, 1, 3, 3, 3, 3, 43, 143, 243, 743, 6, 7, 'PCAAAA', 'JMAAAA', 'HHHHxx'),
+(730, 322, 0, 2, 0, 10, 0, 30, 130, 230, 730, 0, 1, 'CCAAAA', 'KMAAAA', 'OOOOxx'),
+(130, 323, 0, 2, 0, 10, 0, 30, 130, 130, 130, 0, 1, 'AFAAAA', 'LMAAAA', 'VVVVxx'),
+(224, 324, 0, 0, 4, 4, 4, 24, 24, 224, 224, 8, 9, 'QIAAAA', 'MMAAAA', 'AAAAxx'),
+(216, 325, 0, 0, 6, 16, 6, 16, 16, 216, 216, 12, 13, 'IIAAAA', 'NMAAAA', 'HHHHxx'),
+(2, 326, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 'CAAAAA', 'OMAAAA', 'OOOOxx'),
+(836, 327, 0, 0, 6, 16, 6, 36, 36, 336, 836, 12, 13, 'EGAAAA', 'PMAAAA', 'VVVVxx'),
+(443, 328, 1, 3, 3, 3, 3, 43, 43, 443, 443, 6, 7, 'BRAAAA', 'QMAAAA', 'AAAAxx'),
+(777, 329, 1, 1, 7, 17, 7, 77, 177, 277, 777, 14, 15, 'XDAAAA', 'RMAAAA', 'HHHHxx'),
+(126, 330, 0, 2, 6, 6, 6, 26, 126, 126, 126, 12, 13, 'WEAAAA', 'SMAAAA', 'OOOOxx'),
+(117, 331, 1, 1, 7, 17, 7, 17, 117, 117, 117, 14, 15, 'NEAAAA', 'TMAAAA', 'VVVVxx'),
+(633, 332, 1, 1, 3, 13, 3, 33, 33, 133, 633, 6, 7, 'JYAAAA', 'UMAAAA', 'AAAAxx'),
+(310, 333, 0, 2, 0, 10, 0, 10, 110, 310, 310, 0, 1, 'YLAAAA', 'VMAAAA', 'HHHHxx'),
+(622, 334, 0, 2, 2, 2, 2, 22, 22, 122, 622, 4, 5, 'YXAAAA', 'WMAAAA', 'OOOOxx'),
+(268, 335, 0, 0, 8, 8, 8, 68, 68, 268, 268, 16, 17, 'IKAAAA', 'XMAAAA', 'VVVVxx'),
+(384, 336, 0, 0, 4, 4, 4, 84, 184, 384, 384, 8, 9, 'UOAAAA', 'YMAAAA', 'AAAAxx'),
+(460, 337, 0, 0, 0, 0, 0, 60, 60, 460, 460, 0, 1, 'SRAAAA', 'ZMAAAA', 'HHHHxx'),
+(475, 338, 1, 3, 5, 15, 5, 75, 75, 475, 475, 10, 11, 'HSAAAA', 'ANAAAA', 'OOOOxx'),
+(624, 339, 0, 0, 4, 4, 4, 24, 24, 124, 624, 8, 9, 'AYAAAA', 'BNAAAA', 'VVVVxx'),
+(826, 340, 0, 2, 6, 6, 6, 26, 26, 326, 826, 12, 13, 'UFAAAA', 'CNAAAA', 'AAAAxx'),
+(680, 341, 0, 0, 0, 0, 0, 80, 80, 180, 680, 0, 1, 'EAAAAA', 'DNAAAA', 'HHHHxx'),
+(306, 342, 0, 2, 6, 6, 6, 6, 106, 306, 306, 12, 13, 'ULAAAA', 'ENAAAA', 'OOOOxx'),
+(896, 343, 0, 0, 6, 16, 6, 96, 96, 396, 896, 12, 13, 'MIAAAA', 'FNAAAA', 'VVVVxx'),
+(30, 344, 0, 2, 0, 10, 0, 30, 30, 30, 30, 0, 1, 'EBAAAA', 'GNAAAA', 'AAAAxx'),
+(576, 345, 0, 0, 6, 16, 6, 76, 176, 76, 576, 12, 13, 'EWAAAA', 'HNAAAA', 'HHHHxx'),
+(551, 346, 1, 3, 1, 11, 1, 51, 151, 51, 551, 2, 3, 'FVAAAA', 'INAAAA', 'OOOOxx'),
+(639, 347, 1, 3, 9, 19, 9, 39, 39, 139, 639, 18, 19, 'PYAAAA', 'JNAAAA', 'VVVVxx'),
+(975, 348, 1, 3, 5, 15, 5, 75, 175, 475, 975, 10, 11, 'NLAAAA', 'KNAAAA', 'AAAAxx'),
+(882, 349, 0, 2, 2, 2, 2, 82, 82, 382, 882, 4, 5, 'YHAAAA', 'LNAAAA', 'HHHHxx'),
+(160, 350, 0, 0, 0, 0, 0, 60, 160, 160, 160, 0, 1, 'EGAAAA', 'MNAAAA', 'OOOOxx'),
+(522, 351, 0, 2, 2, 2, 2, 22, 122, 22, 522, 4, 5, 'CUAAAA', 'NNAAAA', 'VVVVxx'),
+(620, 352, 0, 0, 0, 0, 0, 20, 20, 120, 620, 0, 1, 'WXAAAA', 'ONAAAA', 'AAAAxx'),
+(719, 353, 1, 3, 9, 19, 9, 19, 119, 219, 719, 18, 19, 'RBAAAA', 'PNAAAA', 'HHHHxx'),
+(88, 354, 0, 0, 8, 8, 8, 88, 88, 88, 88, 16, 17, 'KDAAAA', 'QNAAAA', 'OOOOxx'),
+(614, 355, 0, 2, 4, 14, 4, 14, 14, 114, 614, 8, 9, 'QXAAAA', 'RNAAAA', 'VVVVxx'),
+(54, 356, 0, 2, 4, 14, 4, 54, 54, 54, 54, 8, 9, 'CCAAAA', 'SNAAAA', 'AAAAxx'),
+(209, 357, 1, 1, 9, 9, 9, 9, 9, 209, 209, 18, 19, 'BIAAAA', 'TNAAAA', 'HHHHxx'),
+(67, 358, 1, 3, 7, 7, 7, 67, 67, 67, 67, 14, 15, 'PCAAAA', 'UNAAAA', 'OOOOxx'),
+(809, 359, 1, 1, 9, 9, 9, 9, 9, 309, 809, 18, 19, 'DFAAAA', 'VNAAAA', 'VVVVxx'),
+(982, 360, 0, 2, 2, 2, 2, 82, 182, 482, 982, 4, 5, 'ULAAAA', 'WNAAAA', 'AAAAxx'),
+(817, 361, 1, 1, 7, 17, 7, 17, 17, 317, 817, 14, 15, 'LFAAAA', 'XNAAAA', 'HHHHxx'),
+(187, 362, 1, 3, 7, 7, 7, 87, 187, 187, 187, 14, 15, 'FHAAAA', 'YNAAAA', 'OOOOxx'),
+(992, 363, 0, 0, 2, 12, 2, 92, 192, 492, 992, 4, 5, 'EMAAAA', 'ZNAAAA', 'VVVVxx'),
+(580, 364, 0, 0, 0, 0, 0, 80, 180, 80, 580, 0, 1, 'IWAAAA', 'AOAAAA', 'AAAAxx'),
+(658, 365, 0, 2, 8, 18, 8, 58, 58, 158, 658, 16, 17, 'IZAAAA', 'BOAAAA', 'HHHHxx'),
+(222, 366, 0, 2, 2, 2, 2, 22, 22, 222, 222, 4, 5, 'OIAAAA', 'COAAAA', 'OOOOxx'),
+(667, 367, 1, 3, 7, 7, 7, 67, 67, 167, 667, 14, 15, 'RZAAAA', 'DOAAAA', 'VVVVxx'),
+(715, 368, 1, 3, 5, 15, 5, 15, 115, 215, 715, 10, 11, 'NBAAAA', 'EOAAAA', 'AAAAxx'),
+(990, 369, 0, 2, 0, 10, 0, 90, 190, 490, 990, 0, 1, 'CMAAAA', 'FOAAAA', 'HHHHxx'),
+(22, 370, 0, 2, 2, 2, 2, 22, 22, 22, 22, 4, 5, 'WAAAAA', 'GOAAAA', 'OOOOxx'),
+(362, 371, 0, 2, 2, 2, 2, 62, 162, 362, 362, 4, 5, 'YNAAAA', 'HOAAAA', 'VVVVxx'),
+(376, 372, 0, 0, 6, 16, 6, 76, 176, 376, 376, 12, 13, 'MOAAAA', 'IOAAAA', 'AAAAxx'),
+(246, 373, 0, 2, 6, 6, 6, 46, 46, 246, 246, 12, 13, 'MJAAAA', 'JOAAAA', 'HHHHxx'),
+(300, 374, 0, 0, 0, 0, 0, 0, 100, 300, 300, 0, 1, 'OLAAAA', 'KOAAAA', 'OOOOxx'),
+(231, 375, 1, 3, 1, 11, 1, 31, 31, 231, 231, 2, 3, 'XIAAAA', 'LOAAAA', 'VVVVxx'),
+(151, 376, 1, 3, 1, 11, 1, 51, 151, 151, 151, 2, 3, 'VFAAAA', 'MOAAAA', 'AAAAxx'),
+(29, 377, 1, 1, 9, 9, 9, 29, 29, 29, 29, 18, 19, 'DBAAAA', 'NOAAAA', 'HHHHxx'),
+(297, 378, 1, 1, 7, 17, 7, 97, 97, 297, 297, 14, 15, 'LLAAAA', 'OOAAAA', 'OOOOxx'),
+(403, 379, 1, 3, 3, 3, 3, 3, 3, 403, 403, 6, 7, 'NPAAAA', 'POAAAA', 'VVVVxx'),
+(716, 380, 0, 0, 6, 16, 6, 16, 116, 216, 716, 12, 13, 'OBAAAA', 'QOAAAA', 'AAAAxx'),
+(260, 381, 0, 0, 0, 0, 0, 60, 60, 260, 260, 0, 1, 'AKAAAA', 'ROAAAA', 'HHHHxx'),
+(170, 382, 0, 2, 0, 10, 0, 70, 170, 170, 170, 0, 1, 'OGAAAA', 'SOAAAA', 'OOOOxx'),
+(285, 383, 1, 1, 5, 5, 5, 85, 85, 285, 285, 10, 11, 'ZKAAAA', 'TOAAAA', 'VVVVxx'),
+(82, 384, 0, 2, 2, 2, 2, 82, 82, 82, 82, 4, 5, 'EDAAAA', 'UOAAAA', 'AAAAxx'),
+(958, 385, 0, 2, 8, 18, 8, 58, 158, 458, 958, 16, 17, 'WKAAAA', 'VOAAAA', 'HHHHxx'),
+(175, 386, 1, 3, 5, 15, 5, 75, 175, 175, 175, 10, 11, 'TGAAAA', 'WOAAAA', 'OOOOxx'),
+(671, 387, 1, 3, 1, 11, 1, 71, 71, 171, 671, 2, 3, 'VZAAAA', 'XOAAAA', 'VVVVxx'),
+(822, 388, 0, 2, 2, 2, 2, 22, 22, 322, 822, 4, 5, 'QFAAAA', 'YOAAAA', 'AAAAxx'),
+(573, 389, 1, 1, 3, 13, 3, 73, 173, 73, 573, 6, 7, 'BWAAAA', 'ZOAAAA', 'HHHHxx'),
+(723, 390, 1, 3, 3, 3, 3, 23, 123, 223, 723, 6, 7, 'VBAAAA', 'APAAAA', 'OOOOxx'),
+(195, 391, 1, 3, 5, 15, 5, 95, 195, 195, 195, 10, 11, 'NHAAAA', 'BPAAAA', 'VVVVxx'),
+(197, 392, 1, 1, 7, 17, 7, 97, 197, 197, 197, 14, 15, 'PHAAAA', 'CPAAAA', 'AAAAxx'),
+(755, 393, 1, 3, 5, 15, 5, 55, 155, 255, 755, 10, 11, 'BDAAAA', 'DPAAAA', 'HHHHxx'),
+(42, 394, 0, 2, 2, 2, 2, 42, 42, 42, 42, 4, 5, 'QBAAAA', 'EPAAAA', 'OOOOxx'),
+(897, 395, 1, 1, 7, 17, 7, 97, 97, 397, 897, 14, 15, 'NIAAAA', 'FPAAAA', 'VVVVxx'),
+(309, 396, 1, 1, 9, 9, 9, 9, 109, 309, 309, 18, 19, 'XLAAAA', 'GPAAAA', 'AAAAxx'),
+(724, 397, 0, 0, 4, 4, 4, 24, 124, 224, 724, 8, 9, 'WBAAAA', 'HPAAAA', 'HHHHxx'),
+(474, 398, 0, 2, 4, 14, 4, 74, 74, 474, 474, 8, 9, 'GSAAAA', 'IPAAAA', 'OOOOxx'),
+(345, 399, 1, 1, 5, 5, 5, 45, 145, 345, 345, 10, 11, 'HNAAAA', 'JPAAAA', 'VVVVxx'),
+(678, 400, 0, 2, 8, 18, 8, 78, 78, 178, 678, 16, 17, 'CAAAAA', 'KPAAAA', 'AAAAxx'),
+(757, 401, 1, 1, 7, 17, 7, 57, 157, 257, 757, 14, 15, 'DDAAAA', 'LPAAAA', 'HHHHxx'),
+(600, 402, 0, 0, 0, 0, 0, 0, 0, 100, 600, 0, 1, 'CXAAAA', 'MPAAAA', 'OOOOxx'),
+(184, 403, 0, 0, 4, 4, 4, 84, 184, 184, 184, 8, 9, 'CHAAAA', 'NPAAAA', 'VVVVxx'),
+(155, 404, 1, 3, 5, 15, 5, 55, 155, 155, 155, 10, 11, 'ZFAAAA', 'OPAAAA', 'AAAAxx'),
+(136, 405, 0, 0, 6, 16, 6, 36, 136, 136, 136, 12, 13, 'GFAAAA', 'PPAAAA', 'HHHHxx'),
+(889, 406, 1, 1, 9, 9, 9, 89, 89, 389, 889, 18, 19, 'FIAAAA', 'QPAAAA', 'OOOOxx'),
+(95, 407, 1, 3, 5, 15, 5, 95, 95, 95, 95, 10, 11, 'RDAAAA', 'RPAAAA', 'VVVVxx'),
+(549, 408, 1, 1, 9, 9, 9, 49, 149, 49, 549, 18, 19, 'DVAAAA', 'SPAAAA', 'AAAAxx'),
+(81, 409, 1, 1, 1, 1, 1, 81, 81, 81, 81, 2, 3, 'DDAAAA', 'TPAAAA', 'HHHHxx'),
+(679, 410, 1, 3, 9, 19, 9, 79, 79, 179, 679, 18, 19, 'DAAAAA', 'UPAAAA', 'OOOOxx'),
+(27, 411, 1, 3, 7, 7, 7, 27, 27, 27, 27, 14, 15, 'BBAAAA', 'VPAAAA', 'VVVVxx'),
+(748, 412, 0, 0, 8, 8, 8, 48, 148, 248, 748, 16, 17, 'UCAAAA', 'WPAAAA', 'AAAAxx'),
+(107, 413, 1, 3, 7, 7, 7, 7, 107, 107, 107, 14, 15, 'DEAAAA', 'XPAAAA', 'HHHHxx'),
+(870, 414, 0, 2, 0, 10, 0, 70, 70, 370, 870, 0, 1, 'MHAAAA', 'YPAAAA', 'OOOOxx'),
+(848, 415, 0, 0, 8, 8, 8, 48, 48, 348, 848, 16, 17, 'QGAAAA', 'ZPAAAA', 'VVVVxx'),
+(764, 416, 0, 0, 4, 4, 4, 64, 164, 264, 764, 8, 9, 'KDAAAA', 'AQAAAA', 'AAAAxx'),
+(535, 417, 1, 3, 5, 15, 5, 35, 135, 35, 535, 10, 11, 'PUAAAA', 'BQAAAA', 'HHHHxx'),
+(211, 418, 1, 3, 1, 11, 1, 11, 11, 211, 211, 2, 3, 'DIAAAA', 'CQAAAA', 'OOOOxx'),
+(625, 419, 1, 1, 5, 5, 5, 25, 25, 125, 625, 10, 11, 'BYAAAA', 'DQAAAA', 'VVVVxx'),
+(96, 420, 0, 0, 6, 16, 6, 96, 96, 96, 96, 12, 13, 'SDAAAA', 'EQAAAA', 'AAAAxx'),
+(828, 421, 0, 0, 8, 8, 8, 28, 28, 328, 828, 16, 17, 'WFAAAA', 'FQAAAA', 'HHHHxx'),
+(229, 422, 1, 1, 9, 9, 9, 29, 29, 229, 229, 18, 19, 'VIAAAA', 'GQAAAA', 'OOOOxx'),
+(602, 423, 0, 2, 2, 2, 2, 2, 2, 102, 602, 4, 5, 'EXAAAA', 'HQAAAA', 'VVVVxx'),
+(742, 424, 0, 2, 2, 2, 2, 42, 142, 242, 742, 4, 5, 'OCAAAA', 'IQAAAA', 'AAAAxx'),
+(451, 425, 1, 3, 1, 11, 1, 51, 51, 451, 451, 2, 3, 'JRAAAA', 'JQAAAA', 'HHHHxx'),
+(991, 426, 1, 3, 1, 11, 1, 91, 191, 491, 991, 2, 3, 'DMAAAA', 'KQAAAA', 'OOOOxx'),
+(301, 427, 1, 1, 1, 1, 1, 1, 101, 301, 301, 2, 3, 'PLAAAA', 'LQAAAA', 'VVVVxx'),
+(510, 428, 0, 2, 0, 10, 0, 10, 110, 10, 510, 0, 1, 'QTAAAA', 'MQAAAA', 'AAAAxx'),
+(299, 429, 1, 3, 9, 19, 9, 99, 99, 299, 299, 18, 19, 'NLAAAA', 'NQAAAA', 'HHHHxx'),
+(961, 430, 1, 1, 1, 1, 1, 61, 161, 461, 961, 2, 3, 'ZKAAAA', 'OQAAAA', 'OOOOxx'),
+(3, 431, 1, 3, 3, 3, 3, 3, 3, 3, 3, 6, 7, 'DAAAAA', 'PQAAAA', 'VVVVxx'),
+(106, 432, 0, 2, 6, 6, 6, 6, 106, 106, 106, 12, 13, 'CEAAAA', 'QQAAAA', 'AAAAxx'),
+(591, 433, 1, 3, 1, 11, 1, 91, 191, 91, 591, 2, 3, 'TWAAAA', 'RQAAAA', 'HHHHxx'),
+(700, 434, 0, 0, 0, 0, 0, 0, 100, 200, 700, 0, 1, 'YAAAAA', 'SQAAAA', 'OOOOxx'),
+(841, 435, 1, 1, 1, 1, 1, 41, 41, 341, 841, 2, 3, 'JGAAAA', 'TQAAAA', 'VVVVxx'),
+(829, 436, 1, 1, 9, 9, 9, 29, 29, 329, 829, 18, 19, 'XFAAAA', 'UQAAAA', 'AAAAxx'),
+(508, 437, 0, 0, 8, 8, 8, 8, 108, 8, 508, 16, 17, 'OTAAAA', 'VQAAAA', 'HHHHxx'),
+(750, 438, 0, 2, 0, 10, 0, 50, 150, 250, 750, 0, 1, 'WCAAAA', 'WQAAAA', 'OOOOxx'),
+(665, 439, 1, 1, 5, 5, 5, 65, 65, 165, 665, 10, 11, 'PZAAAA', 'XQAAAA', 'VVVVxx'),
+(157, 440, 1, 1, 7, 17, 7, 57, 157, 157, 157, 14, 15, 'BGAAAA', 'YQAAAA', 'AAAAxx'),
+(694, 441, 0, 2, 4, 14, 4, 94, 94, 194, 694, 8, 9, 'SAAAAA', 'ZQAAAA', 'HHHHxx'),
+(176, 442, 0, 0, 6, 16, 6, 76, 176, 176, 176, 12, 13, 'UGAAAA', 'ARAAAA', 'OOOOxx'),
+(950, 443, 0, 2, 0, 10, 0, 50, 150, 450, 950, 0, 1, 'OKAAAA', 'BRAAAA', 'VVVVxx'),
+(970, 444, 0, 2, 0, 10, 0, 70, 170, 470, 970, 0, 1, 'ILAAAA', 'CRAAAA', 'AAAAxx'),
+(496, 445, 0, 0, 6, 16, 6, 96, 96, 496, 496, 12, 13, 'CTAAAA', 'DRAAAA', 'HHHHxx'),
+(429, 446, 1, 1, 9, 9, 9, 29, 29, 429, 429, 18, 19, 'NQAAAA', 'ERAAAA', 'OOOOxx'),
+(907, 447, 1, 3, 7, 7, 7, 7, 107, 407, 907, 14, 15, 'XIAAAA', 'FRAAAA', 'VVVVxx'),
+(72, 448, 0, 0, 2, 12, 2, 72, 72, 72, 72, 4, 5, 'UCAAAA', 'GRAAAA', 'AAAAxx'),
+(186, 449, 0, 2, 6, 6, 6, 86, 186, 186, 186, 12, 13, 'EHAAAA', 'HRAAAA', 'HHHHxx'),
+(713, 450, 1, 1, 3, 13, 3, 13, 113, 213, 713, 6, 7, 'LBAAAA', 'IRAAAA', 'OOOOxx'),
+(432, 451, 0, 0, 2, 12, 2, 32, 32, 432, 432, 4, 5, 'QQAAAA', 'JRAAAA', 'VVVVxx'),
+(735, 452, 1, 3, 5, 15, 5, 35, 135, 235, 735, 10, 11, 'HCAAAA', 'KRAAAA', 'AAAAxx'),
+(516, 453, 0, 0, 6, 16, 6, 16, 116, 16, 516, 12, 13, 'WTAAAA', 'LRAAAA', 'HHHHxx'),
+(964, 454, 0, 0, 4, 4, 4, 64, 164, 464, 964, 8, 9, 'CLAAAA', 'MRAAAA', 'OOOOxx'),
+(840, 455, 0, 0, 0, 0, 0, 40, 40, 340, 840, 0, 1, 'IGAAAA', 'NRAAAA', 'VVVVxx'),
+(550, 456, 0, 2, 0, 10, 0, 50, 150, 50, 550, 0, 1, 'EVAAAA', 'ORAAAA', 'AAAAxx'),
+(360, 457, 0, 0, 0, 0, 0, 60, 160, 360, 360, 0, 1, 'WNAAAA', 'PRAAAA', 'HHHHxx'),
+(827, 458, 1, 3, 7, 7, 7, 27, 27, 327, 827, 14, 15, 'VFAAAA', 'QRAAAA', 'OOOOxx'),
+(959, 459, 1, 3, 9, 19, 9, 59, 159, 459, 959, 18, 19, 'XKAAAA', 'RRAAAA', 'VVVVxx'),
+(454, 460, 0, 2, 4, 14, 4, 54, 54, 454, 454, 8, 9, 'MRAAAA', 'SRAAAA', 'AAAAxx'),
+(819, 461, 1, 3, 9, 19, 9, 19, 19, 319, 819, 18, 19, 'NFAAAA', 'TRAAAA', 'HHHHxx'),
+(745, 462, 1, 1, 5, 5, 5, 45, 145, 245, 745, 10, 11, 'RCAAAA', 'URAAAA', 'OOOOxx'),
+(279, 463, 1, 3, 9, 19, 9, 79, 79, 279, 279, 18, 19, 'TKAAAA', 'VRAAAA', 'VVVVxx'),
+(426, 464, 0, 2, 6, 6, 6, 26, 26, 426, 426, 12, 13, 'KQAAAA', 'WRAAAA', 'AAAAxx'),
+(70, 465, 0, 2, 0, 10, 0, 70, 70, 70, 70, 0, 1, 'SCAAAA', 'XRAAAA', 'HHHHxx'),
+(637, 466, 1, 1, 7, 17, 7, 37, 37, 137, 637, 14, 15, 'NYAAAA', 'YRAAAA', 'OOOOxx'),
+(417, 467, 1, 1, 7, 17, 7, 17, 17, 417, 417, 14, 15, 'BQAAAA', 'ZRAAAA', 'VVVVxx'),
+(586, 468, 0, 2, 6, 6, 6, 86, 186, 86, 586, 12, 13, 'OWAAAA', 'ASAAAA', 'AAAAxx'),
+(314, 469, 0, 2, 4, 14, 4, 14, 114, 314, 314, 8, 9, 'CMAAAA', 'BSAAAA', 'HHHHxx'),
+(101, 470, 1, 1, 1, 1, 1, 1, 101, 101, 101, 2, 3, 'XDAAAA', 'CSAAAA', 'OOOOxx'),
+(205, 471, 1, 1, 5, 5, 5, 5, 5, 205, 205, 10, 11, 'XHAAAA', 'DSAAAA', 'VVVVxx'),
+(969, 472, 1, 1, 9, 9, 9, 69, 169, 469, 969, 18, 19, 'HLAAAA', 'ESAAAA', 'AAAAxx'),
+(217, 473, 1, 1, 7, 17, 7, 17, 17, 217, 217, 14, 15, 'JIAAAA', 'FSAAAA', 'HHHHxx'),
+(281, 474, 1, 1, 1, 1, 1, 81, 81, 281, 281, 2, 3, 'VKAAAA', 'GSAAAA', 'OOOOxx'),
+(984, 475, 0, 0, 4, 4, 4, 84, 184, 484, 984, 8, 9, 'WLAAAA', 'HSAAAA', 'VVVVxx'),
+(366, 476, 0, 2, 6, 6, 6, 66, 166, 366, 366, 12, 13, 'COAAAA', 'ISAAAA', 'AAAAxx'),
+(483, 477, 1, 3, 3, 3, 3, 83, 83, 483, 483, 6, 7, 'PSAAAA', 'JSAAAA', 'HHHHxx'),
+(838, 478, 0, 2, 8, 18, 8, 38, 38, 338, 838, 16, 17, 'GGAAAA', 'KSAAAA', 'OOOOxx'),
+(64, 479, 0, 0, 4, 4, 4, 64, 64, 64, 64, 8, 9, 'MCAAAA', 'LSAAAA', 'VVVVxx'),
+(981, 480, 1, 1, 1, 1, 1, 81, 181, 481, 981, 2, 3, 'TLAAAA', 'MSAAAA', 'AAAAxx'),
+(538, 481, 0, 2, 8, 18, 8, 38, 138, 38, 538, 16, 17, 'SUAAAA', 'NSAAAA', 'HHHHxx'),
+(39, 482, 1, 3, 9, 19, 9, 39, 39, 39, 39, 18, 19, 'NBAAAA', 'OSAAAA', 'OOOOxx'),
+(60, 483, 0, 0, 0, 0, 0, 60, 60, 60, 60, 0, 1, 'ICAAAA', 'PSAAAA', 'VVVVxx'),
+(874, 484, 0, 2, 4, 14, 4, 74, 74, 374, 874, 8, 9, 'QHAAAA', 'QSAAAA', 'AAAAxx'),
+(955, 485, 1, 3, 5, 15, 5, 55, 155, 455, 955, 10, 11, 'TKAAAA', 'RSAAAA', 'HHHHxx'),
+(347, 486, 1, 3, 7, 7, 7, 47, 147, 347, 347, 14, 15, 'JNAAAA', 'SSAAAA', 'OOOOxx'),
+(227, 487, 1, 3, 7, 7, 7, 27, 27, 227, 227, 14, 15, 'TIAAAA', 'TSAAAA', 'VVVVxx'),
+(44, 488, 0, 0, 4, 4, 4, 44, 44, 44, 44, 8, 9, 'SBAAAA', 'USAAAA', 'AAAAxx'),
+(446, 489, 0, 2, 6, 6, 6, 46, 46, 446, 446, 12, 13, 'ERAAAA', 'VSAAAA', 'HHHHxx'),
+(605, 490, 1, 1, 5, 5, 5, 5, 5, 105, 605, 10, 11, 'HXAAAA', 'WSAAAA', 'OOOOxx'),
+(570, 491, 0, 2, 0, 10, 0, 70, 170, 70, 570, 0, 1, 'YVAAAA', 'XSAAAA', 'VVVVxx'),
+(895, 492, 1, 3, 5, 15, 5, 95, 95, 395, 895, 10, 11, 'LIAAAA', 'YSAAAA', 'AAAAxx'),
+(760, 493, 0, 0, 0, 0, 0, 60, 160, 260, 760, 0, 1, 'GDAAAA', 'ZSAAAA', 'HHHHxx'),
+(428, 494, 0, 0, 8, 8, 8, 28, 28, 428, 428, 16, 17, 'MQAAAA', 'ATAAAA', 'OOOOxx'),
+(628, 495, 0, 0, 8, 8, 8, 28, 28, 128, 628, 16, 17, 'EYAAAA', 'BTAAAA', 'VVVVxx'),
+(933, 496, 1, 1, 3, 13, 3, 33, 133, 433, 933, 6, 7, 'XJAAAA', 'CTAAAA', 'AAAAxx'),
+(263, 497, 1, 3, 3, 3, 3, 63, 63, 263, 263, 6, 7, 'DKAAAA', 'DTAAAA', 'HHHHxx'),
+(729, 498, 1, 1, 9, 9, 9, 29, 129, 229, 729, 18, 19, 'BCAAAA', 'ETAAAA', 'OOOOxx'),
+(860, 499, 0, 0, 0, 0, 0, 60, 60, 360, 860, 0, 1, 'CHAAAA', 'FTAAAA', 'VVVVxx'),
+(76, 500, 0, 0, 6, 16, 6, 76, 76, 76, 76, 12, 13, 'YCAAAA', 'GTAAAA', 'AAAAxx'),
+(293, 501, 1, 1, 3, 13, 3, 93, 93, 293, 293, 6, 7, 'HLAAAA', 'HTAAAA', 'HHHHxx'),
+(296, 502, 0, 0, 6, 16, 6, 96, 96, 296, 296, 12, 13, 'KLAAAA', 'ITAAAA', 'OOOOxx'),
+(124, 503, 0, 0, 4, 4, 4, 24, 124, 124, 124, 8, 9, 'UEAAAA', 'JTAAAA', 'VVVVxx'),
+(568, 504, 0, 0, 8, 8, 8, 68, 168, 68, 568, 16, 17, 'WVAAAA', 'KTAAAA', 'AAAAxx'),
+(337, 505, 1, 1, 7, 17, 7, 37, 137, 337, 337, 14, 15, 'ZMAAAA', 'LTAAAA', 'HHHHxx'),
+(464, 506, 0, 0, 4, 4, 4, 64, 64, 464, 464, 8, 9, 'WRAAAA', 'MTAAAA', 'OOOOxx'),
+(582, 507, 0, 2, 2, 2, 2, 82, 182, 82, 582, 4, 5, 'KWAAAA', 'NTAAAA', 'VVVVxx'),
+(207, 508, 1, 3, 7, 7, 7, 7, 7, 207, 207, 14, 15, 'ZHAAAA', 'OTAAAA', 'AAAAxx'),
+(518, 509, 0, 2, 8, 18, 8, 18, 118, 18, 518, 16, 17, 'YTAAAA', 'PTAAAA', 'HHHHxx'),
+(513, 510, 1, 1, 3, 13, 3, 13, 113, 13, 513, 6, 7, 'TTAAAA', 'QTAAAA', 'OOOOxx'),
+(127, 511, 1, 3, 7, 7, 7, 27, 127, 127, 127, 14, 15, 'XEAAAA', 'RTAAAA', 'VVVVxx'),
+(396, 512, 0, 0, 6, 16, 6, 96, 196, 396, 396, 12, 13, 'GPAAAA', 'STAAAA', 'AAAAxx'),
+(781, 513, 1, 1, 1, 1, 1, 81, 181, 281, 781, 2, 3, 'BEAAAA', 'TTAAAA', 'HHHHxx'),
+(233, 514, 1, 1, 3, 13, 3, 33, 33, 233, 233, 6, 7, 'ZIAAAA', 'UTAAAA', 'OOOOxx'),
+(709, 515, 1, 1, 9, 9, 9, 9, 109, 209, 709, 18, 19, 'HBAAAA', 'VTAAAA', 'VVVVxx'),
+(325, 516, 1, 1, 5, 5, 5, 25, 125, 325, 325, 10, 11, 'NMAAAA', 'WTAAAA', 'AAAAxx'),
+(143, 517, 1, 3, 3, 3, 3, 43, 143, 143, 143, 6, 7, 'NFAAAA', 'XTAAAA', 'HHHHxx'),
+(824, 518, 0, 0, 4, 4, 4, 24, 24, 324, 824, 8, 9, 'SFAAAA', 'YTAAAA', 'OOOOxx'),
+(122, 519, 0, 2, 2, 2, 2, 22, 122, 122, 122, 4, 5, 'SEAAAA', 'ZTAAAA', 'VVVVxx'),
+(10, 520, 0, 2, 0, 10, 0, 10, 10, 10, 10, 0, 1, 'KAAAAA', 'AUAAAA', 'AAAAxx'),
+(41, 521, 1, 1, 1, 1, 1, 41, 41, 41, 41, 2, 3, 'PBAAAA', 'BUAAAA', 'HHHHxx'),
+(618, 522, 0, 2, 8, 18, 8, 18, 18, 118, 618, 16, 17, 'UXAAAA', 'CUAAAA', 'OOOOxx'),
+(161, 523, 1, 1, 1, 1, 1, 61, 161, 161, 161, 2, 3, 'FGAAAA', 'DUAAAA', 'VVVVxx'),
+(801, 524, 1, 1, 1, 1, 1, 1, 1, 301, 801, 2, 3, 'VEAAAA', 'EUAAAA', 'AAAAxx'),
+(768, 525, 0, 0, 8, 8, 8, 68, 168, 268, 768, 16, 17, 'ODAAAA', 'FUAAAA', 'HHHHxx'),
+(642, 526, 0, 2, 2, 2, 2, 42, 42, 142, 642, 4, 5, 'SYAAAA', 'GUAAAA', 'OOOOxx'),
+(803, 527, 1, 3, 3, 3, 3, 3, 3, 303, 803, 6, 7, 'XEAAAA', 'HUAAAA', 'VVVVxx'),
+(317, 528, 1, 1, 7, 17, 7, 17, 117, 317, 317, 14, 15, 'FMAAAA', 'IUAAAA', 'AAAAxx'),
+(938, 529, 0, 2, 8, 18, 8, 38, 138, 438, 938, 16, 17, 'CKAAAA', 'JUAAAA', 'HHHHxx'),
+(649, 530, 1, 1, 9, 9, 9, 49, 49, 149, 649, 18, 19, 'ZYAAAA', 'KUAAAA', 'OOOOxx'),
+(738, 531, 0, 2, 8, 18, 8, 38, 138, 238, 738, 16, 17, 'KCAAAA', 'LUAAAA', 'VVVVxx'),
+(344, 532, 0, 0, 4, 4, 4, 44, 144, 344, 344, 8, 9, 'GNAAAA', 'MUAAAA', 'AAAAxx'),
+(399, 533, 1, 3, 9, 19, 9, 99, 199, 399, 399, 18, 19, 'JPAAAA', 'NUAAAA', 'HHHHxx'),
+(609, 534, 1, 1, 9, 9, 9, 9, 9, 109, 609, 18, 19, 'LXAAAA', 'OUAAAA', 'OOOOxx'),
+(677, 535, 1, 1, 7, 17, 7, 77, 77, 177, 677, 14, 15, 'BAAAAA', 'PUAAAA', 'VVVVxx'),
+(478, 536, 0, 2, 8, 18, 8, 78, 78, 478, 478, 16, 17, 'KSAAAA', 'QUAAAA', 'AAAAxx'),
+(452, 537, 0, 0, 2, 12, 2, 52, 52, 452, 452, 4, 5, 'KRAAAA', 'RUAAAA', 'HHHHxx'),
+(261, 538, 1, 1, 1, 1, 1, 61, 61, 261, 261, 2, 3, 'BKAAAA', 'SUAAAA', 'OOOOxx'),
+(449, 539, 1, 1, 9, 9, 9, 49, 49, 449, 449, 18, 19, 'HRAAAA', 'TUAAAA', 'VVVVxx'),
+(433, 540, 1, 1, 3, 13, 3, 33, 33, 433, 433, 6, 7, 'RQAAAA', 'UUAAAA', 'AAAAxx'),
+(5, 541, 1, 1, 5, 5, 5, 5, 5, 5, 5, 10, 11, 'FAAAAA', 'VUAAAA', 'HHHHxx'),
+(664, 542, 0, 0, 4, 4, 4, 64, 64, 164, 664, 8, 9, 'OZAAAA', 'WUAAAA', 'OOOOxx'),
+(887, 543, 1, 3, 7, 7, 7, 87, 87, 387, 887, 14, 15, 'DIAAAA', 'XUAAAA', 'VVVVxx'),
+(546, 544, 0, 2, 6, 6, 6, 46, 146, 46, 546, 12, 13, 'AVAAAA', 'YUAAAA', 'AAAAxx'),
+(253, 545, 1, 1, 3, 13, 3, 53, 53, 253, 253, 6, 7, 'TJAAAA', 'ZUAAAA', 'HHHHxx'),
+(235, 546, 1, 3, 5, 15, 5, 35, 35, 235, 235, 10, 11, 'BJAAAA', 'AVAAAA', 'OOOOxx'),
+(258, 547, 0, 2, 8, 18, 8, 58, 58, 258, 258, 16, 17, 'YJAAAA', 'BVAAAA', 'VVVVxx'),
+(621, 548, 1, 1, 1, 1, 1, 21, 21, 121, 621, 2, 3, 'XXAAAA', 'CVAAAA', 'AAAAxx'),
+(998, 549, 0, 2, 8, 18, 8, 98, 198, 498, 998, 16, 17, 'KMAAAA', 'DVAAAA', 'HHHHxx'),
+(236, 550, 0, 0, 6, 16, 6, 36, 36, 236, 236, 12, 13, 'CJAAAA', 'EVAAAA', 'OOOOxx'),
+(537, 551, 1, 1, 7, 17, 7, 37, 137, 37, 537, 14, 15, 'RUAAAA', 'FVAAAA', 'VVVVxx'),
+(769, 552, 1, 1, 9, 9, 9, 69, 169, 269, 769, 18, 19, 'PDAAAA', 'GVAAAA', 'AAAAxx'),
+(921, 553, 1, 1, 1, 1, 1, 21, 121, 421, 921, 2, 3, 'LJAAAA', 'HVAAAA', 'HHHHxx'),
+(951, 554, 1, 3, 1, 11, 1, 51, 151, 451, 951, 2, 3, 'PKAAAA', 'IVAAAA', 'OOOOxx'),
+(240, 555, 0, 0, 0, 0, 0, 40, 40, 240, 240, 0, 1, 'GJAAAA', 'JVAAAA', 'VVVVxx'),
+(644, 556, 0, 0, 4, 4, 4, 44, 44, 144, 644, 8, 9, 'UYAAAA', 'KVAAAA', 'AAAAxx'),
+(352, 557, 0, 0, 2, 12, 2, 52, 152, 352, 352, 4, 5, 'ONAAAA', 'LVAAAA', 'HHHHxx'),
+(613, 558, 1, 1, 3, 13, 3, 13, 13, 113, 613, 6, 7, 'PXAAAA', 'MVAAAA', 'OOOOxx'),
+(784, 559, 0, 0, 4, 4, 4, 84, 184, 284, 784, 8, 9, 'EEAAAA', 'NVAAAA', 'VVVVxx'),
+(61, 560, 1, 1, 1, 1, 1, 61, 61, 61, 61, 2, 3, 'JCAAAA', 'OVAAAA', 'AAAAxx'),
+(144, 561, 0, 0, 4, 4, 4, 44, 144, 144, 144, 8, 9, 'OFAAAA', 'PVAAAA', 'HHHHxx'),
+(94, 562, 0, 2, 4, 14, 4, 94, 94, 94, 94, 8, 9, 'QDAAAA', 'QVAAAA', 'OOOOxx'),
+(270, 563, 0, 2, 0, 10, 0, 70, 70, 270, 270, 0, 1, 'KKAAAA', 'RVAAAA', 'VVVVxx'),
+(942, 564, 0, 2, 2, 2, 2, 42, 142, 442, 942, 4, 5, 'GKAAAA', 'SVAAAA', 'AAAAxx'),
+(756, 565, 0, 0, 6, 16, 6, 56, 156, 256, 756, 12, 13, 'CDAAAA', 'TVAAAA', 'HHHHxx'),
+(321, 566, 1, 1, 1, 1, 1, 21, 121, 321, 321, 2, 3, 'JMAAAA', 'UVAAAA', 'OOOOxx'),
+(36, 567, 0, 0, 6, 16, 6, 36, 36, 36, 36, 12, 13, 'KBAAAA', 'VVAAAA', 'VVVVxx'),
+(232, 568, 0, 0, 2, 12, 2, 32, 32, 232, 232, 4, 5, 'YIAAAA', 'WVAAAA', 'AAAAxx'),
+(430, 569, 0, 2, 0, 10, 0, 30, 30, 430, 430, 0, 1, 'OQAAAA', 'XVAAAA', 'HHHHxx'),
+(177, 570, 1, 1, 7, 17, 7, 77, 177, 177, 177, 14, 15, 'VGAAAA', 'YVAAAA', 'OOOOxx'),
+(220, 571, 0, 0, 0, 0, 0, 20, 20, 220, 220, 0, 1, 'MIAAAA', 'ZVAAAA', 'VVVVxx'),
+(109, 572, 1, 1, 9, 9, 9, 9, 109, 109, 109, 18, 19, 'FEAAAA', 'AWAAAA', 'AAAAxx'),
+(419, 573, 1, 3, 9, 19, 9, 19, 19, 419, 419, 18, 19, 'DQAAAA', 'BWAAAA', 'HHHHxx'),
+(135, 574, 1, 3, 5, 15, 5, 35, 135, 135, 135, 10, 11, 'FFAAAA', 'CWAAAA', 'OOOOxx'),
+(610, 575, 0, 2, 0, 10, 0, 10, 10, 110, 610, 0, 1, 'MXAAAA', 'DWAAAA', 'VVVVxx'),
+(956, 576, 0, 0, 6, 16, 6, 56, 156, 456, 956, 12, 13, 'UKAAAA', 'EWAAAA', 'AAAAxx'),
+(626, 577, 0, 2, 6, 6, 6, 26, 26, 126, 626, 12, 13, 'CYAAAA', 'FWAAAA', 'HHHHxx'),
+(375, 578, 1, 3, 5, 15, 5, 75, 175, 375, 375, 10, 11, 'LOAAAA', 'GWAAAA', 'OOOOxx'),
+(976, 579, 0, 0, 6, 16, 6, 76, 176, 476, 976, 12, 13, 'OLAAAA', 'HWAAAA', 'VVVVxx'),
+(152, 580, 0, 0, 2, 12, 2, 52, 152, 152, 152, 4, 5, 'WFAAAA', 'IWAAAA', 'AAAAxx'),
+(308, 581, 0, 0, 8, 8, 8, 8, 108, 308, 308, 16, 17, 'WLAAAA', 'JWAAAA', 'HHHHxx'),
+(445, 582, 1, 1, 5, 5, 5, 45, 45, 445, 445, 10, 11, 'DRAAAA', 'KWAAAA', 'OOOOxx'),
+(326, 583, 0, 2, 6, 6, 6, 26, 126, 326, 326, 12, 13, 'OMAAAA', 'LWAAAA', 'VVVVxx'),
+(422, 584, 0, 2, 2, 2, 2, 22, 22, 422, 422, 4, 5, 'GQAAAA', 'MWAAAA', 'AAAAxx'),
+(972, 585, 0, 0, 2, 12, 2, 72, 172, 472, 972, 4, 5, 'KLAAAA', 'NWAAAA', 'HHHHxx'),
+(45, 586, 1, 1, 5, 5, 5, 45, 45, 45, 45, 10, 11, 'TBAAAA', 'OWAAAA', 'OOOOxx'),
+(725, 587, 1, 1, 5, 5, 5, 25, 125, 225, 725, 10, 11, 'XBAAAA', 'PWAAAA', 'VVVVxx'),
+(753, 588, 1, 1, 3, 13, 3, 53, 153, 253, 753, 6, 7, 'ZCAAAA', 'QWAAAA', 'AAAAxx'),
+(493, 589, 1, 1, 3, 13, 3, 93, 93, 493, 493, 6, 7, 'ZSAAAA', 'RWAAAA', 'HHHHxx'),
+(601, 590, 1, 1, 1, 1, 1, 1, 1, 101, 601, 2, 3, 'DXAAAA', 'SWAAAA', 'OOOOxx'),
+(463, 591, 1, 3, 3, 3, 3, 63, 63, 463, 463, 6, 7, 'VRAAAA', 'TWAAAA', 'VVVVxx'),
+(303, 592, 1, 3, 3, 3, 3, 3, 103, 303, 303, 6, 7, 'RLAAAA', 'UWAAAA', 'AAAAxx'),
+(59, 593, 1, 3, 9, 19, 9, 59, 59, 59, 59, 18, 19, 'HCAAAA', 'VWAAAA', 'HHHHxx'),
+(595, 594, 1, 3, 5, 15, 5, 95, 195, 95, 595, 10, 11, 'XWAAAA', 'WWAAAA', 'OOOOxx'),
+(807, 595, 1, 3, 7, 7, 7, 7, 7, 307, 807, 14, 15, 'BFAAAA', 'XWAAAA', 'VVVVxx'),
+(424, 596, 0, 0, 4, 4, 4, 24, 24, 424, 424, 8, 9, 'IQAAAA', 'YWAAAA', 'AAAAxx'),
+(521, 597, 1, 1, 1, 1, 1, 21, 121, 21, 521, 2, 3, 'BUAAAA', 'ZWAAAA', 'HHHHxx'),
+(341, 598, 1, 1, 1, 1, 1, 41, 141, 341, 341, 2, 3, 'DNAAAA', 'AXAAAA', 'OOOOxx'),
+(571, 599, 1, 3, 1, 11, 1, 71, 171, 71, 571, 2, 3, 'ZVAAAA', 'BXAAAA', 'VVVVxx'),
+(165, 600, 1, 1, 5, 5, 5, 65, 165, 165, 165, 10, 11, 'JGAAAA', 'CXAAAA', 'AAAAxx'),
+(908, 601, 0, 0, 8, 8, 8, 8, 108, 408, 908, 16, 17, 'YIAAAA', 'DXAAAA', 'HHHHxx'),
+(351, 602, 1, 3, 1, 11, 1, 51, 151, 351, 351, 2, 3, 'NNAAAA', 'EXAAAA', 'OOOOxx'),
+(334, 603, 0, 2, 4, 14, 4, 34, 134, 334, 334, 8, 9, 'WMAAAA', 'FXAAAA', 'VVVVxx'),
+(636, 604, 0, 0, 6, 16, 6, 36, 36, 136, 636, 12, 13, 'MYAAAA', 'GXAAAA', 'AAAAxx'),
+(138, 605, 0, 2, 8, 18, 8, 38, 138, 138, 138, 16, 17, 'IFAAAA', 'HXAAAA', 'HHHHxx'),
+(438, 606, 0, 2, 8, 18, 8, 38, 38, 438, 438, 16, 17, 'WQAAAA', 'IXAAAA', 'OOOOxx'),
+(391, 607, 1, 3, 1, 11, 1, 91, 191, 391, 391, 2, 3, 'BPAAAA', 'JXAAAA', 'VVVVxx'),
+(395, 608, 1, 3, 5, 15, 5, 95, 195, 395, 395, 10, 11, 'FPAAAA', 'KXAAAA', 'AAAAxx'),
+(502, 609, 0, 2, 2, 2, 2, 2, 102, 2, 502, 4, 5, 'ITAAAA', 'LXAAAA', 'HHHHxx'),
+(85, 610, 1, 1, 5, 5, 5, 85, 85, 85, 85, 10, 11, 'HDAAAA', 'MXAAAA', 'OOOOxx'),
+(786, 611, 0, 2, 6, 6, 6, 86, 186, 286, 786, 12, 13, 'GEAAAA', 'NXAAAA', 'VVVVxx'),
+(619, 612, 1, 3, 9, 19, 9, 19, 19, 119, 619, 18, 19, 'VXAAAA', 'OXAAAA', 'AAAAxx'),
+(440, 613, 0, 0, 0, 0, 0, 40, 40, 440, 440, 0, 1, 'YQAAAA', 'PXAAAA', 'HHHHxx'),
+(949, 614, 1, 1, 9, 9, 9, 49, 149, 449, 949, 18, 19, 'NKAAAA', 'QXAAAA', 'OOOOxx'),
+(691, 615, 1, 3, 1, 11, 1, 91, 91, 191, 691, 2, 3, 'PAAAAA', 'RXAAAA', 'VVVVxx'),
+(348, 616, 0, 0, 8, 8, 8, 48, 148, 348, 348, 16, 17, 'KNAAAA', 'SXAAAA', 'AAAAxx'),
+(506, 617, 0, 2, 6, 6, 6, 6, 106, 6, 506, 12, 13, 'MTAAAA', 'TXAAAA', 'HHHHxx'),
+(192, 618, 0, 0, 2, 12, 2, 92, 192, 192, 192, 4, 5, 'KHAAAA', 'UXAAAA', 'OOOOxx'),
+(369, 619, 1, 1, 9, 9, 9, 69, 169, 369, 369, 18, 19, 'FOAAAA', 'VXAAAA', 'VVVVxx'),
+(311, 620, 1, 3, 1, 11, 1, 11, 111, 311, 311, 2, 3, 'ZLAAAA', 'WXAAAA', 'AAAAxx'),
+(273, 621, 1, 1, 3, 13, 3, 73, 73, 273, 273, 6, 7, 'NKAAAA', 'XXAAAA', 'HHHHxx'),
+(770, 622, 0, 2, 0, 10, 0, 70, 170, 270, 770, 0, 1, 'QDAAAA', 'YXAAAA', 'OOOOxx'),
+(191, 623, 1, 3, 1, 11, 1, 91, 191, 191, 191, 2, 3, 'JHAAAA', 'ZXAAAA', 'VVVVxx'),
+(90, 624, 0, 2, 0, 10, 0, 90, 90, 90, 90, 0, 1, 'MDAAAA', 'AYAAAA', 'AAAAxx'),
+(163, 625, 1, 3, 3, 3, 3, 63, 163, 163, 163, 6, 7, 'HGAAAA', 'BYAAAA', 'HHHHxx'),
+(350, 626, 0, 2, 0, 10, 0, 50, 150, 350, 350, 0, 1, 'MNAAAA', 'CYAAAA', 'OOOOxx'),
+(55, 627, 1, 3, 5, 15, 5, 55, 55, 55, 55, 10, 11, 'DCAAAA', 'DYAAAA', 'VVVVxx'),
+(488, 628, 0, 0, 8, 8, 8, 88, 88, 488, 488, 16, 17, 'USAAAA', 'EYAAAA', 'AAAAxx'),
+(215, 629, 1, 3, 5, 15, 5, 15, 15, 215, 215, 10, 11, 'HIAAAA', 'FYAAAA', 'HHHHxx'),
+(732, 630, 0, 0, 2, 12, 2, 32, 132, 232, 732, 4, 5, 'ECAAAA', 'GYAAAA', 'OOOOxx'),
+(688, 631, 0, 0, 8, 8, 8, 88, 88, 188, 688, 16, 17, 'MAAAAA', 'HYAAAA', 'VVVVxx'),
+(520, 632, 0, 0, 0, 0, 0, 20, 120, 20, 520, 0, 1, 'AUAAAA', 'IYAAAA', 'AAAAxx'),
+(62, 633, 0, 2, 2, 2, 2, 62, 62, 62, 62, 4, 5, 'KCAAAA', 'JYAAAA', 'HHHHxx'),
+(423, 634, 1, 3, 3, 3, 3, 23, 23, 423, 423, 6, 7, 'HQAAAA', 'KYAAAA', 'OOOOxx'),
+(242, 635, 0, 2, 2, 2, 2, 42, 42, 242, 242, 4, 5, 'IJAAAA', 'LYAAAA', 'VVVVxx'),
+(193, 636, 1, 1, 3, 13, 3, 93, 193, 193, 193, 6, 7, 'LHAAAA', 'MYAAAA', 'AAAAxx'),
+(648, 637, 0, 0, 8, 8, 8, 48, 48, 148, 648, 16, 17, 'YYAAAA', 'NYAAAA', 'HHHHxx'),
+(459, 638, 1, 3, 9, 19, 9, 59, 59, 459, 459, 18, 19, 'RRAAAA', 'OYAAAA', 'OOOOxx'),
+(196, 639, 0, 0, 6, 16, 6, 96, 196, 196, 196, 12, 13, 'OHAAAA', 'PYAAAA', 'VVVVxx'),
+(476, 640, 0, 0, 6, 16, 6, 76, 76, 476, 476, 12, 13, 'ISAAAA', 'QYAAAA', 'AAAAxx'),
+(903, 641, 1, 3, 3, 3, 3, 3, 103, 403, 903, 6, 7, 'TIAAAA', 'RYAAAA', 'HHHHxx'),
+(974, 642, 0, 2, 4, 14, 4, 74, 174, 474, 974, 8, 9, 'MLAAAA', 'SYAAAA', 'OOOOxx'),
+(603, 643, 1, 3, 3, 3, 3, 3, 3, 103, 603, 6, 7, 'FXAAAA', 'TYAAAA', 'VVVVxx'),
+(12, 644, 0, 0, 2, 12, 2, 12, 12, 12, 12, 4, 5, 'MAAAAA', 'UYAAAA', 'AAAAxx'),
+(599, 645, 1, 3, 9, 19, 9, 99, 199, 99, 599, 18, 19, 'BXAAAA', 'VYAAAA', 'HHHHxx'),
+(914, 646, 0, 2, 4, 14, 4, 14, 114, 414, 914, 8, 9, 'EJAAAA', 'WYAAAA', 'OOOOxx'),
+(7, 647, 1, 3, 7, 7, 7, 7, 7, 7, 7, 14, 15, 'HAAAAA', 'XYAAAA', 'VVVVxx'),
+(213, 648, 1, 1, 3, 13, 3, 13, 13, 213, 213, 6, 7, 'FIAAAA', 'YYAAAA', 'AAAAxx'),
+(174, 649, 0, 2, 4, 14, 4, 74, 174, 174, 174, 8, 9, 'SGAAAA', 'ZYAAAA', 'HHHHxx'),
+(392, 650, 0, 0, 2, 12, 2, 92, 192, 392, 392, 4, 5, 'CPAAAA', 'AZAAAA', 'OOOOxx'),
+(674, 651, 0, 2, 4, 14, 4, 74, 74, 174, 674, 8, 9, 'YZAAAA', 'BZAAAA', 'VVVVxx'),
+(650, 652, 0, 2, 0, 10, 0, 50, 50, 150, 650, 0, 1, 'AZAAAA', 'CZAAAA', 'AAAAxx'),
+(8, 653, 0, 0, 8, 8, 8, 8, 8, 8, 8, 16, 17, 'IAAAAA', 'DZAAAA', 'HHHHxx'),
+(492, 654, 0, 0, 2, 12, 2, 92, 92, 492, 492, 4, 5, 'YSAAAA', 'EZAAAA', 'OOOOxx'),
+(322, 655, 0, 2, 2, 2, 2, 22, 122, 322, 322, 4, 5, 'KMAAAA', 'FZAAAA', 'VVVVxx'),
+(315, 656, 1, 3, 5, 15, 5, 15, 115, 315, 315, 10, 11, 'DMAAAA', 'GZAAAA', 'AAAAxx'),
+(380, 657, 0, 0, 0, 0, 0, 80, 180, 380, 380, 0, 1, 'QOAAAA', 'HZAAAA', 'HHHHxx'),
+(353, 658, 1, 1, 3, 13, 3, 53, 153, 353, 353, 6, 7, 'PNAAAA', 'IZAAAA', 'OOOOxx'),
+(892, 659, 0, 0, 2, 12, 2, 92, 92, 392, 892, 4, 5, 'IIAAAA', 'JZAAAA', 'VVVVxx'),
+(932, 660, 0, 0, 2, 12, 2, 32, 132, 432, 932, 4, 5, 'WJAAAA', 'KZAAAA', 'AAAAxx'),
+(993, 661, 1, 1, 3, 13, 3, 93, 193, 493, 993, 6, 7, 'FMAAAA', 'LZAAAA', 'HHHHxx'),
+(859, 662, 1, 3, 9, 19, 9, 59, 59, 359, 859, 18, 19, 'BHAAAA', 'MZAAAA', 'OOOOxx'),
+(806, 663, 0, 2, 6, 6, 6, 6, 6, 306, 806, 12, 13, 'AFAAAA', 'NZAAAA', 'VVVVxx'),
+(145, 664, 1, 1, 5, 5, 5, 45, 145, 145, 145, 10, 11, 'PFAAAA', 'OZAAAA', 'AAAAxx'),
+(373, 665, 1, 1, 3, 13, 3, 73, 173, 373, 373, 6, 7, 'JOAAAA', 'PZAAAA', 'HHHHxx'),
+(418, 666, 0, 2, 8, 18, 8, 18, 18, 418, 418, 16, 17, 'CQAAAA', 'QZAAAA', 'OOOOxx'),
+(865, 667, 1, 1, 5, 5, 5, 65, 65, 365, 865, 10, 11, 'HHAAAA', 'RZAAAA', 'VVVVxx'),
+(462, 668, 0, 2, 2, 2, 2, 62, 62, 462, 462, 4, 5, 'URAAAA', 'SZAAAA', 'AAAAxx'),
+(24, 669, 0, 0, 4, 4, 4, 24, 24, 24, 24, 8, 9, 'YAAAAA', 'TZAAAA', 'HHHHxx'),
+(920, 670, 0, 0, 0, 0, 0, 20, 120, 420, 920, 0, 1, 'KJAAAA', 'UZAAAA', 'OOOOxx'),
+(672, 671, 0, 0, 2, 12, 2, 72, 72, 172, 672, 4, 5, 'WZAAAA', 'VZAAAA', 'VVVVxx'),
+(92, 672, 0, 0, 2, 12, 2, 92, 92, 92, 92, 4, 5, 'ODAAAA', 'WZAAAA', 'AAAAxx'),
+(721, 673, 1, 1, 1, 1, 1, 21, 121, 221, 721, 2, 3, 'TBAAAA', 'XZAAAA', 'HHHHxx'),
+(646, 674, 0, 2, 6, 6, 6, 46, 46, 146, 646, 12, 13, 'WYAAAA', 'YZAAAA', 'OOOOxx'),
+(910, 675, 0, 2, 0, 10, 0, 10, 110, 410, 910, 0, 1, 'AJAAAA', 'ZZAAAA', 'VVVVxx'),
+(909, 676, 1, 1, 9, 9, 9, 9, 109, 409, 909, 18, 19, 'ZIAAAA', 'AABAAA', 'AAAAxx'),
+(630, 677, 0, 2, 0, 10, 0, 30, 30, 130, 630, 0, 1, 'GYAAAA', 'BABAAA', 'HHHHxx'),
+(482, 678, 0, 2, 2, 2, 2, 82, 82, 482, 482, 4, 5, 'OSAAAA', 'CABAAA', 'OOOOxx'),
+(559, 679, 1, 3, 9, 19, 9, 59, 159, 59, 559, 18, 19, 'NVAAAA', 'DABAAA', 'VVVVxx'),
+(853, 680, 1, 1, 3, 13, 3, 53, 53, 353, 853, 6, 7, 'VGAAAA', 'EABAAA', 'AAAAxx'),
+(141, 681, 1, 1, 1, 1, 1, 41, 141, 141, 141, 2, 3, 'LFAAAA', 'FABAAA', 'HHHHxx'),
+(266, 682, 0, 2, 6, 6, 6, 66, 66, 266, 266, 12, 13, 'GKAAAA', 'GABAAA', 'OOOOxx'),
+(835, 683, 1, 3, 5, 15, 5, 35, 35, 335, 835, 10, 11, 'DGAAAA', 'HABAAA', 'VVVVxx'),
+(164, 684, 0, 0, 4, 4, 4, 64, 164, 164, 164, 8, 9, 'IGAAAA', 'IABAAA', 'AAAAxx'),
+(629, 685, 1, 1, 9, 9, 9, 29, 29, 129, 629, 18, 19, 'FYAAAA', 'JABAAA', 'HHHHxx'),
+(203, 686, 1, 3, 3, 3, 3, 3, 3, 203, 203, 6, 7, 'VHAAAA', 'KABAAA', 'OOOOxx'),
+(411, 687, 1, 3, 1, 11, 1, 11, 11, 411, 411, 2, 3, 'VPAAAA', 'LABAAA', 'VVVVxx'),
+(930, 688, 0, 2, 0, 10, 0, 30, 130, 430, 930, 0, 1, 'UJAAAA', 'MABAAA', 'AAAAxx'),
+(435, 689, 1, 3, 5, 15, 5, 35, 35, 435, 435, 10, 11, 'TQAAAA', 'NABAAA', 'HHHHxx'),
+(563, 690, 1, 3, 3, 3, 3, 63, 163, 63, 563, 6, 7, 'RVAAAA', 'OABAAA', 'OOOOxx'),
+(960, 691, 0, 0, 0, 0, 0, 60, 160, 460, 960, 0, 1, 'YKAAAA', 'PABAAA', 'VVVVxx'),
+(733, 692, 1, 1, 3, 13, 3, 33, 133, 233, 733, 6, 7, 'FCAAAA', 'QABAAA', 'AAAAxx'),
+(967, 693, 1, 3, 7, 7, 7, 67, 167, 467, 967, 14, 15, 'FLAAAA', 'RABAAA', 'HHHHxx'),
+(668, 694, 0, 0, 8, 8, 8, 68, 68, 168, 668, 16, 17, 'SZAAAA', 'SABAAA', 'OOOOxx'),
+(994, 695, 0, 2, 4, 14, 4, 94, 194, 494, 994, 8, 9, 'GMAAAA', 'TABAAA', 'VVVVxx'),
+(129, 696, 1, 1, 9, 9, 9, 29, 129, 129, 129, 18, 19, 'ZEAAAA', 'UABAAA', 'AAAAxx'),
+(954, 697, 0, 2, 4, 14, 4, 54, 154, 454, 954, 8, 9, 'SKAAAA', 'VABAAA', 'HHHHxx'),
+(68, 698, 0, 0, 8, 8, 8, 68, 68, 68, 68, 16, 17, 'QCAAAA', 'WABAAA', 'OOOOxx'),
+(79, 699, 1, 3, 9, 19, 9, 79, 79, 79, 79, 18, 19, 'BDAAAA', 'XABAAA', 'VVVVxx'),
+(121, 700, 1, 1, 1, 1, 1, 21, 121, 121, 121, 2, 3, 'REAAAA', 'YABAAA', 'AAAAxx'),
+(740, 701, 0, 0, 0, 0, 0, 40, 140, 240, 740, 0, 1, 'MCAAAA', 'ZABAAA', 'HHHHxx'),
+(902, 702, 0, 2, 2, 2, 2, 2, 102, 402, 902, 4, 5, 'SIAAAA', 'ABBAAA', 'OOOOxx'),
+(695, 703, 1, 3, 5, 15, 5, 95, 95, 195, 695, 10, 11, 'TAAAAA', 'BBBAAA', 'VVVVxx'),
+(455, 704, 1, 3, 5, 15, 5, 55, 55, 455, 455, 10, 11, 'NRAAAA', 'CBBAAA', 'AAAAxx'),
+(89, 705, 1, 1, 9, 9, 9, 89, 89, 89, 89, 18, 19, 'LDAAAA', 'DBBAAA', 'HHHHxx'),
+(893, 706, 1, 1, 3, 13, 3, 93, 93, 393, 893, 6, 7, 'JIAAAA', 'EBBAAA', 'OOOOxx'),
+(202, 707, 0, 2, 2, 2, 2, 2, 2, 202, 202, 4, 5, 'UHAAAA', 'FBBAAA', 'VVVVxx'),
+(132, 708, 0, 0, 2, 12, 2, 32, 132, 132, 132, 4, 5, 'CFAAAA', 'GBBAAA', 'AAAAxx'),
+(782, 709, 0, 2, 2, 2, 2, 82, 182, 282, 782, 4, 5, 'CEAAAA', 'HBBAAA', 'HHHHxx'),
+(512, 710, 0, 0, 2, 12, 2, 12, 112, 12, 512, 4, 5, 'STAAAA', 'IBBAAA', 'OOOOxx'),
+(857, 711, 1, 1, 7, 17, 7, 57, 57, 357, 857, 14, 15, 'ZGAAAA', 'JBBAAA', 'VVVVxx'),
+(248, 712, 0, 0, 8, 8, 8, 48, 48, 248, 248, 16, 17, 'OJAAAA', 'KBBAAA', 'AAAAxx'),
+(858, 713, 0, 2, 8, 18, 8, 58, 58, 358, 858, 16, 17, 'AHAAAA', 'LBBAAA', 'HHHHxx'),
+(527, 714, 1, 3, 7, 7, 7, 27, 127, 27, 527, 14, 15, 'HUAAAA', 'MBBAAA', 'OOOOxx'),
+(450, 715, 0, 2, 0, 10, 0, 50, 50, 450, 450, 0, 1, 'IRAAAA', 'NBBAAA', 'VVVVxx'),
+(712, 716, 0, 0, 2, 12, 2, 12, 112, 212, 712, 4, 5, 'KBAAAA', 'OBBAAA', 'AAAAxx'),
+(153, 717, 1, 1, 3, 13, 3, 53, 153, 153, 153, 6, 7, 'XFAAAA', 'PBBAAA', 'HHHHxx'),
+(587, 718, 1, 3, 7, 7, 7, 87, 187, 87, 587, 14, 15, 'PWAAAA', 'QBBAAA', 'OOOOxx'),
+(593, 719, 1, 1, 3, 13, 3, 93, 193, 93, 593, 6, 7, 'VWAAAA', 'RBBAAA', 'VVVVxx'),
+(249, 720, 1, 1, 9, 9, 9, 49, 49, 249, 249, 18, 19, 'PJAAAA', 'SBBAAA', 'AAAAxx'),
+(128, 721, 0, 0, 8, 8, 8, 28, 128, 128, 128, 16, 17, 'YEAAAA', 'TBBAAA', 'HHHHxx'),
+(675, 722, 1, 3, 5, 15, 5, 75, 75, 175, 675, 10, 11, 'ZZAAAA', 'UBBAAA', 'OOOOxx'),
+(929, 723, 1, 1, 9, 9, 9, 29, 129, 429, 929, 18, 19, 'TJAAAA', 'VBBAAA', 'VVVVxx'),
+(156, 724, 0, 0, 6, 16, 6, 56, 156, 156, 156, 12, 13, 'AGAAAA', 'WBBAAA', 'AAAAxx'),
+(415, 725, 1, 3, 5, 15, 5, 15, 15, 415, 415, 10, 11, 'ZPAAAA', 'XBBAAA', 'HHHHxx'),
+(28, 726, 0, 0, 8, 8, 8, 28, 28, 28, 28, 16, 17, 'CBAAAA', 'YBBAAA', 'OOOOxx'),
+(18, 727, 0, 2, 8, 18, 8, 18, 18, 18, 18, 16, 17, 'SAAAAA', 'ZBBAAA', 'VVVVxx'),
+(255, 728, 1, 3, 5, 15, 5, 55, 55, 255, 255, 10, 11, 'VJAAAA', 'ACBAAA', 'AAAAxx'),
+(793, 729, 1, 1, 3, 13, 3, 93, 193, 293, 793, 6, 7, 'NEAAAA', 'BCBAAA', 'HHHHxx'),
+(554, 730, 0, 2, 4, 14, 4, 54, 154, 54, 554, 8, 9, 'IVAAAA', 'CCBAAA', 'OOOOxx'),
+(467, 731, 1, 3, 7, 7, 7, 67, 67, 467, 467, 14, 15, 'ZRAAAA', 'DCBAAA', 'VVVVxx'),
+(410, 732, 0, 2, 0, 10, 0, 10, 10, 410, 410, 0, 1, 'UPAAAA', 'ECBAAA', 'AAAAxx'),
+(651, 733, 1, 3, 1, 11, 1, 51, 51, 151, 651, 2, 3, 'BZAAAA', 'FCBAAA', 'HHHHxx'),
+(287, 734, 1, 3, 7, 7, 7, 87, 87, 287, 287, 14, 15, 'BLAAAA', 'GCBAAA', 'OOOOxx'),
+(640, 735, 0, 0, 0, 0, 0, 40, 40, 140, 640, 0, 1, 'QYAAAA', 'HCBAAA', 'VVVVxx'),
+(245, 736, 1, 1, 5, 5, 5, 45, 45, 245, 245, 10, 11, 'LJAAAA', 'ICBAAA', 'AAAAxx'),
+(21, 737, 1, 1, 1, 1, 1, 21, 21, 21, 21, 2, 3, 'VAAAAA', 'JCBAAA', 'HHHHxx'),
+(83, 738, 1, 3, 3, 3, 3, 83, 83, 83, 83, 6, 7, 'FDAAAA', 'KCBAAA', 'OOOOxx'),
+(228, 739, 0, 0, 8, 8, 8, 28, 28, 228, 228, 16, 17, 'UIAAAA', 'LCBAAA', 'VVVVxx'),
+(323, 740, 1, 3, 3, 3, 3, 23, 123, 323, 323, 6, 7, 'LMAAAA', 'MCBAAA', 'AAAAxx'),
+(594, 741, 0, 2, 4, 14, 4, 94, 194, 94, 594, 8, 9, 'WWAAAA', 'NCBAAA', 'HHHHxx'),
+(528, 742, 0, 0, 8, 8, 8, 28, 128, 28, 528, 16, 17, 'IUAAAA', 'OCBAAA', 'OOOOxx'),
+(276, 743, 0, 0, 6, 16, 6, 76, 76, 276, 276, 12, 13, 'QKAAAA', 'PCBAAA', 'VVVVxx'),
+(598, 744, 0, 2, 8, 18, 8, 98, 198, 98, 598, 16, 17, 'AXAAAA', 'QCBAAA', 'AAAAxx'),
+(635, 745, 1, 3, 5, 15, 5, 35, 35, 135, 635, 10, 11, 'LYAAAA', 'RCBAAA', 'HHHHxx'),
+(868, 746, 0, 0, 8, 8, 8, 68, 68, 368, 868, 16, 17, 'KHAAAA', 'SCBAAA', 'OOOOxx'),
+(290, 747, 0, 2, 0, 10, 0, 90, 90, 290, 290, 0, 1, 'ELAAAA', 'TCBAAA', 'VVVVxx'),
+(468, 748, 0, 0, 8, 8, 8, 68, 68, 468, 468, 16, 17, 'ASAAAA', 'UCBAAA', 'AAAAxx'),
+(689, 749, 1, 1, 9, 9, 9, 89, 89, 189, 689, 18, 19, 'NAAAAA', 'VCBAAA', 'HHHHxx'),
+(799, 750, 1, 3, 9, 19, 9, 99, 199, 299, 799, 18, 19, 'TEAAAA', 'WCBAAA', 'OOOOxx'),
+(210, 751, 0, 2, 0, 10, 0, 10, 10, 210, 210, 0, 1, 'CIAAAA', 'XCBAAA', 'VVVVxx'),
+(346, 752, 0, 2, 6, 6, 6, 46, 146, 346, 346, 12, 13, 'INAAAA', 'YCBAAA', 'AAAAxx'),
+(957, 753, 1, 1, 7, 17, 7, 57, 157, 457, 957, 14, 15, 'VKAAAA', 'ZCBAAA', 'HHHHxx'),
+(905, 754, 1, 1, 5, 5, 5, 5, 105, 405, 905, 10, 11, 'VIAAAA', 'ADBAAA', 'OOOOxx'),
+(523, 755, 1, 3, 3, 3, 3, 23, 123, 23, 523, 6, 7, 'DUAAAA', 'BDBAAA', 'VVVVxx'),
+(899, 756, 1, 3, 9, 19, 9, 99, 99, 399, 899, 18, 19, 'PIAAAA', 'CDBAAA', 'AAAAxx'),
+(867, 757, 1, 3, 7, 7, 7, 67, 67, 367, 867, 14, 15, 'JHAAAA', 'DDBAAA', 'HHHHxx'),
+(11, 758, 1, 3, 1, 11, 1, 11, 11, 11, 11, 2, 3, 'LAAAAA', 'EDBAAA', 'OOOOxx'),
+(320, 759, 0, 0, 0, 0, 0, 20, 120, 320, 320, 0, 1, 'IMAAAA', 'FDBAAA', 'VVVVxx'),
+(766, 760, 0, 2, 6, 6, 6, 66, 166, 266, 766, 12, 13, 'MDAAAA', 'GDBAAA', 'AAAAxx'),
+(84, 761, 0, 0, 4, 4, 4, 84, 84, 84, 84, 8, 9, 'GDAAAA', 'HDBAAA', 'HHHHxx'),
+(507, 762, 1, 3, 7, 7, 7, 7, 107, 7, 507, 14, 15, 'NTAAAA', 'IDBAAA', 'OOOOxx'),
+(471, 763, 1, 3, 1, 11, 1, 71, 71, 471, 471, 2, 3, 'DSAAAA', 'JDBAAA', 'VVVVxx'),
+(517, 764, 1, 1, 7, 17, 7, 17, 117, 17, 517, 14, 15, 'XTAAAA', 'KDBAAA', 'AAAAxx'),
+(234, 765, 0, 2, 4, 14, 4, 34, 34, 234, 234, 8, 9, 'AJAAAA', 'LDBAAA', 'HHHHxx'),
+(988, 766, 0, 0, 8, 8, 8, 88, 188, 488, 988, 16, 17, 'AMAAAA', 'MDBAAA', 'OOOOxx'),
+(473, 767, 1, 1, 3, 13, 3, 73, 73, 473, 473, 6, 7, 'FSAAAA', 'NDBAAA', 'VVVVxx'),
+(66, 768, 0, 2, 6, 6, 6, 66, 66, 66, 66, 12, 13, 'OCAAAA', 'ODBAAA', 'AAAAxx'),
+(530, 769, 0, 2, 0, 10, 0, 30, 130, 30, 530, 0, 1, 'KUAAAA', 'PDBAAA', 'HHHHxx'),
+(834, 770, 0, 2, 4, 14, 4, 34, 34, 334, 834, 8, 9, 'CGAAAA', 'QDBAAA', 'OOOOxx'),
+(894, 771, 0, 2, 4, 14, 4, 94, 94, 394, 894, 8, 9, 'KIAAAA', 'RDBAAA', 'VVVVxx'),
+(481, 772, 1, 1, 1, 1, 1, 81, 81, 481, 481, 2, 3, 'NSAAAA', 'SDBAAA', 'AAAAxx'),
+(280, 773, 0, 0, 0, 0, 0, 80, 80, 280, 280, 0, 1, 'UKAAAA', 'TDBAAA', 'HHHHxx'),
+(705, 774, 1, 1, 5, 5, 5, 5, 105, 205, 705, 10, 11, 'DBAAAA', 'UDBAAA', 'OOOOxx'),
+(218, 775, 0, 2, 8, 18, 8, 18, 18, 218, 218, 16, 17, 'KIAAAA', 'VDBAAA', 'VVVVxx'),
+(560, 776, 0, 0, 0, 0, 0, 60, 160, 60, 560, 0, 1, 'OVAAAA', 'WDBAAA', 'AAAAxx'),
+(123, 777, 1, 3, 3, 3, 3, 23, 123, 123, 123, 6, 7, 'TEAAAA', 'XDBAAA', 'HHHHxx'),
+(289, 778, 1, 1, 9, 9, 9, 89, 89, 289, 289, 18, 19, 'DLAAAA', 'YDBAAA', 'OOOOxx'),
+(189, 779, 1, 1, 9, 9, 9, 89, 189, 189, 189, 18, 19, 'HHAAAA', 'ZDBAAA', 'VVVVxx'),
+(541, 780, 1, 1, 1, 1, 1, 41, 141, 41, 541, 2, 3, 'VUAAAA', 'AEBAAA', 'AAAAxx'),
+(876, 781, 0, 0, 6, 16, 6, 76, 76, 376, 876, 12, 13, 'SHAAAA', 'BEBAAA', 'HHHHxx'),
+(504, 782, 0, 0, 4, 4, 4, 4, 104, 4, 504, 8, 9, 'KTAAAA', 'CEBAAA', 'OOOOxx'),
+(643, 783, 1, 3, 3, 3, 3, 43, 43, 143, 643, 6, 7, 'TYAAAA', 'DEBAAA', 'VVVVxx'),
+(73, 784, 1, 1, 3, 13, 3, 73, 73, 73, 73, 6, 7, 'VCAAAA', 'EEBAAA', 'AAAAxx'),
+(465, 785, 1, 1, 5, 5, 5, 65, 65, 465, 465, 10, 11, 'XRAAAA', 'FEBAAA', 'HHHHxx'),
+(861, 786, 1, 1, 1, 1, 1, 61, 61, 361, 861, 2, 3, 'DHAAAA', 'GEBAAA', 'OOOOxx'),
+(355, 787, 1, 3, 5, 15, 5, 55, 155, 355, 355, 10, 11, 'RNAAAA', 'HEBAAA', 'VVVVxx'),
+(441, 788, 1, 1, 1, 1, 1, 41, 41, 441, 441, 2, 3, 'ZQAAAA', 'IEBAAA', 'AAAAxx'),
+(219, 789, 1, 3, 9, 19, 9, 19, 19, 219, 219, 18, 19, 'LIAAAA', 'JEBAAA', 'HHHHxx'),
+(839, 790, 1, 3, 9, 19, 9, 39, 39, 339, 839, 18, 19, 'HGAAAA', 'KEBAAA', 'OOOOxx'),
+(271, 791, 1, 3, 1, 11, 1, 71, 71, 271, 271, 2, 3, 'LKAAAA', 'LEBAAA', 'VVVVxx'),
+(212, 792, 0, 0, 2, 12, 2, 12, 12, 212, 212, 4, 5, 'EIAAAA', 'MEBAAA', 'AAAAxx'),
+(904, 793, 0, 0, 4, 4, 4, 4, 104, 404, 904, 8, 9, 'UIAAAA', 'NEBAAA', 'HHHHxx'),
+(244, 794, 0, 0, 4, 4, 4, 44, 44, 244, 244, 8, 9, 'KJAAAA', 'OEBAAA', 'OOOOxx'),
+(751, 795, 1, 3, 1, 11, 1, 51, 151, 251, 751, 2, 3, 'XCAAAA', 'PEBAAA', 'VVVVxx'),
+(944, 796, 0, 0, 4, 4, 4, 44, 144, 444, 944, 8, 9, 'IKAAAA', 'QEBAAA', 'AAAAxx'),
+(305, 797, 1, 1, 5, 5, 5, 5, 105, 305, 305, 10, 11, 'TLAAAA', 'REBAAA', 'HHHHxx'),
+(617, 798, 1, 1, 7, 17, 7, 17, 17, 117, 617, 14, 15, 'TXAAAA', 'SEBAAA', 'OOOOxx'),
+(891, 799, 1, 3, 1, 11, 1, 91, 91, 391, 891, 2, 3, 'HIAAAA', 'TEBAAA', 'VVVVxx'),
+(653, 800, 1, 1, 3, 13, 3, 53, 53, 153, 653, 6, 7, 'DZAAAA', 'UEBAAA', 'AAAAxx'),
+(845, 801, 1, 1, 5, 5, 5, 45, 45, 345, 845, 10, 11, 'NGAAAA', 'VEBAAA', 'HHHHxx'),
+(936, 802, 0, 0, 6, 16, 6, 36, 136, 436, 936, 12, 13, 'AKAAAA', 'WEBAAA', 'OOOOxx'),
+(91, 803, 1, 3, 1, 11, 1, 91, 91, 91, 91, 2, 3, 'NDAAAA', 'XEBAAA', 'VVVVxx'),
+(442, 804, 0, 2, 2, 2, 2, 42, 42, 442, 442, 4, 5, 'ARAAAA', 'YEBAAA', 'AAAAxx'),
+(498, 805, 0, 2, 8, 18, 8, 98, 98, 498, 498, 16, 17, 'ETAAAA', 'ZEBAAA', 'HHHHxx'),
+(987, 806, 1, 3, 7, 7, 7, 87, 187, 487, 987, 14, 15, 'ZLAAAA', 'AFBAAA', 'OOOOxx'),
+(194, 807, 0, 2, 4, 14, 4, 94, 194, 194, 194, 8, 9, 'MHAAAA', 'BFBAAA', 'VVVVxx'),
+(927, 808, 1, 3, 7, 7, 7, 27, 127, 427, 927, 14, 15, 'RJAAAA', 'CFBAAA', 'AAAAxx'),
+(607, 809, 1, 3, 7, 7, 7, 7, 7, 107, 607, 14, 15, 'JXAAAA', 'DFBAAA', 'HHHHxx'),
+(119, 810, 1, 3, 9, 19, 9, 19, 119, 119, 119, 18, 19, 'PEAAAA', 'EFBAAA', 'OOOOxx'),
+(182, 811, 0, 2, 2, 2, 2, 82, 182, 182, 182, 4, 5, 'AHAAAA', 'FFBAAA', 'VVVVxx'),
+(606, 812, 0, 2, 6, 6, 6, 6, 6, 106, 606, 12, 13, 'IXAAAA', 'GFBAAA', 'AAAAxx'),
+(849, 813, 1, 1, 9, 9, 9, 49, 49, 349, 849, 18, 19, 'RGAAAA', 'HFBAAA', 'HHHHxx'),
+(34, 814, 0, 2, 4, 14, 4, 34, 34, 34, 34, 8, 9, 'IBAAAA', 'IFBAAA', 'OOOOxx'),
+(683, 815, 1, 3, 3, 3, 3, 83, 83, 183, 683, 6, 7, 'HAAAAA', 'JFBAAA', 'VVVVxx'),
+(134, 816, 0, 2, 4, 14, 4, 34, 134, 134, 134, 8, 9, 'EFAAAA', 'KFBAAA', 'AAAAxx'),
+(331, 817, 1, 3, 1, 11, 1, 31, 131, 331, 331, 2, 3, 'TMAAAA', 'LFBAAA', 'HHHHxx'),
+(808, 818, 0, 0, 8, 8, 8, 8, 8, 308, 808, 16, 17, 'CFAAAA', 'MFBAAA', 'OOOOxx'),
+(703, 819, 1, 3, 3, 3, 3, 3, 103, 203, 703, 6, 7, 'BBAAAA', 'NFBAAA', 'VVVVxx'),
+(669, 820, 1, 1, 9, 9, 9, 69, 69, 169, 669, 18, 19, 'TZAAAA', 'OFBAAA', 'AAAAxx'),
+(264, 821, 0, 0, 4, 4, 4, 64, 64, 264, 264, 8, 9, 'EKAAAA', 'PFBAAA', 'HHHHxx'),
+(277, 822, 1, 1, 7, 17, 7, 77, 77, 277, 277, 14, 15, 'RKAAAA', 'QFBAAA', 'OOOOxx'),
+(877, 823, 1, 1, 7, 17, 7, 77, 77, 377, 877, 14, 15, 'THAAAA', 'RFBAAA', 'VVVVxx'),
+(783, 824, 1, 3, 3, 3, 3, 83, 183, 283, 783, 6, 7, 'DEAAAA', 'SFBAAA', 'AAAAxx'),
+(791, 825, 1, 3, 1, 11, 1, 91, 191, 291, 791, 2, 3, 'LEAAAA', 'TFBAAA', 'HHHHxx'),
+(171, 826, 1, 3, 1, 11, 1, 71, 171, 171, 171, 2, 3, 'PGAAAA', 'UFBAAA', 'OOOOxx'),
+(564, 827, 0, 0, 4, 4, 4, 64, 164, 64, 564, 8, 9, 'SVAAAA', 'VFBAAA', 'VVVVxx'),
+(230, 828, 0, 2, 0, 10, 0, 30, 30, 230, 230, 0, 1, 'WIAAAA', 'WFBAAA', 'AAAAxx'),
+(881, 829, 1, 1, 1, 1, 1, 81, 81, 381, 881, 2, 3, 'XHAAAA', 'XFBAAA', 'HHHHxx'),
+(890, 830, 0, 2, 0, 10, 0, 90, 90, 390, 890, 0, 1, 'GIAAAA', 'YFBAAA', 'OOOOxx'),
+(374, 831, 0, 2, 4, 14, 4, 74, 174, 374, 374, 8, 9, 'KOAAAA', 'ZFBAAA', 'VVVVxx'),
+(697, 832, 1, 1, 7, 17, 7, 97, 97, 197, 697, 14, 15, 'VAAAAA', 'AGBAAA', 'AAAAxx'),
+(4, 833, 0, 0, 4, 4, 4, 4, 4, 4, 4, 8, 9, 'EAAAAA', 'BGBAAA', 'HHHHxx'),
+(385, 834, 1, 1, 5, 5, 5, 85, 185, 385, 385, 10, 11, 'VOAAAA', 'CGBAAA', 'OOOOxx'),
+(739, 835, 1, 3, 9, 19, 9, 39, 139, 239, 739, 18, 19, 'LCAAAA', 'DGBAAA', 'VVVVxx'),
+(623, 836, 1, 3, 3, 3, 3, 23, 23, 123, 623, 6, 7, 'ZXAAAA', 'EGBAAA', 'AAAAxx'),
+(547, 837, 1, 3, 7, 7, 7, 47, 147, 47, 547, 14, 15, 'BVAAAA', 'FGBAAA', 'HHHHxx'),
+(532, 838, 0, 0, 2, 12, 2, 32, 132, 32, 532, 4, 5, 'MUAAAA', 'GGBAAA', 'OOOOxx'),
+(383, 839, 1, 3, 3, 3, 3, 83, 183, 383, 383, 6, 7, 'TOAAAA', 'HGBAAA', 'VVVVxx'),
+(181, 840, 1, 1, 1, 1, 1, 81, 181, 181, 181, 2, 3, 'ZGAAAA', 'IGBAAA', 'AAAAxx'),
+(327, 841, 1, 3, 7, 7, 7, 27, 127, 327, 327, 14, 15, 'PMAAAA', 'JGBAAA', 'HHHHxx'),
+(701, 842, 1, 1, 1, 1, 1, 1, 101, 201, 701, 2, 3, 'ZAAAAA', 'KGBAAA', 'OOOOxx'),
+(111, 843, 1, 3, 1, 11, 1, 11, 111, 111, 111, 2, 3, 'HEAAAA', 'LGBAAA', 'VVVVxx'),
+(977, 844, 1, 1, 7, 17, 7, 77, 177, 477, 977, 14, 15, 'PLAAAA', 'MGBAAA', 'AAAAxx'),
+(431, 845, 1, 3, 1, 11, 1, 31, 31, 431, 431, 2, 3, 'PQAAAA', 'NGBAAA', 'HHHHxx'),
+(456, 846, 0, 0, 6, 16, 6, 56, 56, 456, 456, 12, 13, 'ORAAAA', 'OGBAAA', 'OOOOxx'),
+(368, 847, 0, 0, 8, 8, 8, 68, 168, 368, 368, 16, 17, 'EOAAAA', 'PGBAAA', 'VVVVxx'),
+(32, 848, 0, 0, 2, 12, 2, 32, 32, 32, 32, 4, 5, 'GBAAAA', 'QGBAAA', 'AAAAxx'),
+(125, 849, 1, 1, 5, 5, 5, 25, 125, 125, 125, 10, 11, 'VEAAAA', 'RGBAAA', 'HHHHxx'),
+(847, 850, 1, 3, 7, 7, 7, 47, 47, 347, 847, 14, 15, 'PGAAAA', 'SGBAAA', 'OOOOxx'),
+(485, 851, 1, 1, 5, 5, 5, 85, 85, 485, 485, 10, 11, 'RSAAAA', 'TGBAAA', 'VVVVxx'),
+(387, 852, 1, 3, 7, 7, 7, 87, 187, 387, 387, 14, 15, 'XOAAAA', 'UGBAAA', 'AAAAxx'),
+(288, 853, 0, 0, 8, 8, 8, 88, 88, 288, 288, 16, 17, 'CLAAAA', 'VGBAAA', 'HHHHxx'),
+(919, 854, 1, 3, 9, 19, 9, 19, 119, 419, 919, 18, 19, 'JJAAAA', 'WGBAAA', 'OOOOxx'),
+(393, 855, 1, 1, 3, 13, 3, 93, 193, 393, 393, 6, 7, 'DPAAAA', 'XGBAAA', 'VVVVxx'),
+(953, 856, 1, 1, 3, 13, 3, 53, 153, 453, 953, 6, 7, 'RKAAAA', 'YGBAAA', 'AAAAxx'),
+(798, 857, 0, 2, 8, 18, 8, 98, 198, 298, 798, 16, 17, 'SEAAAA', 'ZGBAAA', 'HHHHxx'),
+(940, 858, 0, 0, 0, 0, 0, 40, 140, 440, 940, 0, 1, 'EKAAAA', 'AHBAAA', 'OOOOxx'),
+(198, 859, 0, 2, 8, 18, 8, 98, 198, 198, 198, 16, 17, 'QHAAAA', 'BHBAAA', 'VVVVxx'),
+(25, 860, 1, 1, 5, 5, 5, 25, 25, 25, 25, 10, 11, 'ZAAAAA', 'CHBAAA', 'AAAAxx'),
+(190, 861, 0, 2, 0, 10, 0, 90, 190, 190, 190, 0, 1, 'IHAAAA', 'DHBAAA', 'HHHHxx'),
+(820, 862, 0, 0, 0, 0, 0, 20, 20, 320, 820, 0, 1, 'OFAAAA', 'EHBAAA', 'OOOOxx'),
+(15, 863, 1, 3, 5, 15, 5, 15, 15, 15, 15, 10, 11, 'PAAAAA', 'FHBAAA', 'VVVVxx'),
+(427, 864, 1, 3, 7, 7, 7, 27, 27, 427, 427, 14, 15, 'LQAAAA', 'GHBAAA', 'AAAAxx'),
+(349, 865, 1, 1, 9, 9, 9, 49, 149, 349, 349, 18, 19, 'LNAAAA', 'HHBAAA', 'HHHHxx'),
+(785, 866, 1, 1, 5, 5, 5, 85, 185, 285, 785, 10, 11, 'FEAAAA', 'IHBAAA', 'OOOOxx'),
+(340, 867, 0, 0, 0, 0, 0, 40, 140, 340, 340, 0, 1, 'CNAAAA', 'JHBAAA', 'VVVVxx'),
+(292, 868, 0, 0, 2, 12, 2, 92, 92, 292, 292, 4, 5, 'GLAAAA', 'KHBAAA', 'AAAAxx'),
+(17, 869, 1, 1, 7, 17, 7, 17, 17, 17, 17, 14, 15, 'RAAAAA', 'LHBAAA', 'HHHHxx'),
+(985, 870, 1, 1, 5, 5, 5, 85, 185, 485, 985, 10, 11, 'XLAAAA', 'MHBAAA', 'OOOOxx'),
+(645, 871, 1, 1, 5, 5, 5, 45, 45, 145, 645, 10, 11, 'VYAAAA', 'NHBAAA', 'VVVVxx'),
+(631, 872, 1, 3, 1, 11, 1, 31, 31, 131, 631, 2, 3, 'HYAAAA', 'OHBAAA', 'AAAAxx'),
+(761, 873, 1, 1, 1, 1, 1, 61, 161, 261, 761, 2, 3, 'HDAAAA', 'PHBAAA', 'HHHHxx'),
+(707, 874, 1, 3, 7, 7, 7, 7, 107, 207, 707, 14, 15, 'FBAAAA', 'QHBAAA', 'OOOOxx'),
+(776, 875, 0, 0, 6, 16, 6, 76, 176, 276, 776, 12, 13, 'WDAAAA', 'RHBAAA', 'VVVVxx'),
+(856, 876, 0, 0, 6, 16, 6, 56, 56, 356, 856, 12, 13, 'YGAAAA', 'SHBAAA', 'AAAAxx'),
+(978, 877, 0, 2, 8, 18, 8, 78, 178, 478, 978, 16, 17, 'QLAAAA', 'THBAAA', 'HHHHxx'),
+(710, 878, 0, 2, 0, 10, 0, 10, 110, 210, 710, 0, 1, 'IBAAAA', 'UHBAAA', 'OOOOxx'),
+(604, 879, 0, 0, 4, 4, 4, 4, 4, 104, 604, 8, 9, 'GXAAAA', 'VHBAAA', 'VVVVxx'),
+(291, 880, 1, 3, 1, 11, 1, 91, 91, 291, 291, 2, 3, 'FLAAAA', 'WHBAAA', 'AAAAxx'),
+(747, 881, 1, 3, 7, 7, 7, 47, 147, 247, 747, 14, 15, 'TCAAAA', 'XHBAAA', 'HHHHxx'),
+(837, 882, 1, 1, 7, 17, 7, 37, 37, 337, 837, 14, 15, 'FGAAAA', 'YHBAAA', 'OOOOxx'),
+(722, 883, 0, 2, 2, 2, 2, 22, 122, 222, 722, 4, 5, 'UBAAAA', 'ZHBAAA', 'VVVVxx'),
+(925, 884, 1, 1, 5, 5, 5, 25, 125, 425, 925, 10, 11, 'PJAAAA', 'AIBAAA', 'AAAAxx'),
+(49, 885, 1, 1, 9, 9, 9, 49, 49, 49, 49, 18, 19, 'XBAAAA', 'BIBAAA', 'HHHHxx'),
+(832, 886, 0, 0, 2, 12, 2, 32, 32, 332, 832, 4, 5, 'AGAAAA', 'CIBAAA', 'OOOOxx'),
+(336, 887, 0, 0, 6, 16, 6, 36, 136, 336, 336, 12, 13, 'YMAAAA', 'DIBAAA', 'VVVVxx'),
+(185, 888, 1, 1, 5, 5, 5, 85, 185, 185, 185, 10, 11, 'DHAAAA', 'EIBAAA', 'AAAAxx'),
+(434, 889, 0, 2, 4, 14, 4, 34, 34, 434, 434, 8, 9, 'SQAAAA', 'FIBAAA', 'HHHHxx'),
+(284, 890, 0, 0, 4, 4, 4, 84, 84, 284, 284, 8, 9, 'YKAAAA', 'GIBAAA', 'OOOOxx'),
+(812, 891, 0, 0, 2, 12, 2, 12, 12, 312, 812, 4, 5, 'GFAAAA', 'HIBAAA', 'VVVVxx'),
+(810, 892, 0, 2, 0, 10, 0, 10, 10, 310, 810, 0, 1, 'EFAAAA', 'IIBAAA', 'AAAAxx'),
+(252, 893, 0, 0, 2, 12, 2, 52, 52, 252, 252, 4, 5, 'SJAAAA', 'JIBAAA', 'HHHHxx'),
+(965, 894, 1, 1, 5, 5, 5, 65, 165, 465, 965, 10, 11, 'DLAAAA', 'KIBAAA', 'OOOOxx'),
+(110, 895, 0, 2, 0, 10, 0, 10, 110, 110, 110, 0, 1, 'GEAAAA', 'LIBAAA', 'VVVVxx'),
+(698, 896, 0, 2, 8, 18, 8, 98, 98, 198, 698, 16, 17, 'WAAAAA', 'MIBAAA', 'AAAAxx'),
+(283, 897, 1, 3, 3, 3, 3, 83, 83, 283, 283, 6, 7, 'XKAAAA', 'NIBAAA', 'HHHHxx'),
+(533, 898, 1, 1, 3, 13, 3, 33, 133, 33, 533, 6, 7, 'NUAAAA', 'OIBAAA', 'OOOOxx'),
+(662, 899, 0, 2, 2, 2, 2, 62, 62, 162, 662, 4, 5, 'MZAAAA', 'PIBAAA', 'VVVVxx'),
+(329, 900, 1, 1, 9, 9, 9, 29, 129, 329, 329, 18, 19, 'RMAAAA', 'QIBAAA', 'AAAAxx'),
+(250, 901, 0, 2, 0, 10, 0, 50, 50, 250, 250, 0, 1, 'QJAAAA', 'RIBAAA', 'HHHHxx'),
+(407, 902, 1, 3, 7, 7, 7, 7, 7, 407, 407, 14, 15, 'RPAAAA', 'SIBAAA', 'OOOOxx'),
+(823, 903, 1, 3, 3, 3, 3, 23, 23, 323, 823, 6, 7, 'RFAAAA', 'TIBAAA', 'VVVVxx'),
+(852, 904, 0, 0, 2, 12, 2, 52, 52, 352, 852, 4, 5, 'UGAAAA', 'UIBAAA', 'AAAAxx'),
+(871, 905, 1, 3, 1, 11, 1, 71, 71, 371, 871, 2, 3, 'NHAAAA', 'VIBAAA', 'HHHHxx'),
+(118, 906, 0, 2, 8, 18, 8, 18, 118, 118, 118, 16, 17, 'OEAAAA', 'WIBAAA', 'OOOOxx'),
+(912, 907, 0, 0, 2, 12, 2, 12, 112, 412, 912, 4, 5, 'CJAAAA', 'XIBAAA', 'VVVVxx'),
+(458, 908, 0, 2, 8, 18, 8, 58, 58, 458, 458, 16, 17, 'QRAAAA', 'YIBAAA', 'AAAAxx'),
+(926, 909, 0, 2, 6, 6, 6, 26, 126, 426, 926, 12, 13, 'QJAAAA', 'ZIBAAA', 'HHHHxx'),
+(328, 910, 0, 0, 8, 8, 8, 28, 128, 328, 328, 16, 17, 'QMAAAA', 'AJBAAA', 'OOOOxx'),
+(980, 911, 0, 0, 0, 0, 0, 80, 180, 480, 980, 0, 1, 'SLAAAA', 'BJBAAA', 'VVVVxx'),
+(259, 912, 1, 3, 9, 19, 9, 59, 59, 259, 259, 18, 19, 'ZJAAAA', 'CJBAAA', 'AAAAxx'),
+(900, 913, 0, 0, 0, 0, 0, 0, 100, 400, 900, 0, 1, 'QIAAAA', 'DJBAAA', 'HHHHxx'),
+(137, 914, 1, 1, 7, 17, 7, 37, 137, 137, 137, 14, 15, 'HFAAAA', 'EJBAAA', 'OOOOxx'),
+(159, 915, 1, 3, 9, 19, 9, 59, 159, 159, 159, 18, 19, 'DGAAAA', 'FJBAAA', 'VVVVxx'),
+(243, 916, 1, 3, 3, 3, 3, 43, 43, 243, 243, 6, 7, 'JJAAAA', 'GJBAAA', 'AAAAxx'),
+(472, 917, 0, 0, 2, 12, 2, 72, 72, 472, 472, 4, 5, 'ESAAAA', 'HJBAAA', 'HHHHxx'),
+(796, 918, 0, 0, 6, 16, 6, 96, 196, 296, 796, 12, 13, 'QEAAAA', 'IJBAAA', 'OOOOxx'),
+(382, 919, 0, 2, 2, 2, 2, 82, 182, 382, 382, 4, 5, 'SOAAAA', 'JJBAAA', 'VVVVxx'),
+(911, 920, 1, 3, 1, 11, 1, 11, 111, 411, 911, 2, 3, 'BJAAAA', 'KJBAAA', 'AAAAxx'),
+(179, 921, 1, 3, 9, 19, 9, 79, 179, 179, 179, 18, 19, 'XGAAAA', 'LJBAAA', 'HHHHxx'),
+(778, 922, 0, 2, 8, 18, 8, 78, 178, 278, 778, 16, 17, 'YDAAAA', 'MJBAAA', 'OOOOxx'),
+(405, 923, 1, 1, 5, 5, 5, 5, 5, 405, 405, 10, 11, 'PPAAAA', 'NJBAAA', 'VVVVxx'),
+(265, 924, 1, 1, 5, 5, 5, 65, 65, 265, 265, 10, 11, 'FKAAAA', 'OJBAAA', 'AAAAxx'),
+(556, 925, 0, 0, 6, 16, 6, 56, 156, 56, 556, 12, 13, 'KVAAAA', 'PJBAAA', 'HHHHxx'),
+(16, 926, 0, 0, 6, 16, 6, 16, 16, 16, 16, 12, 13, 'QAAAAA', 'QJBAAA', 'OOOOxx'),
+(706, 927, 0, 2, 6, 6, 6, 6, 106, 206, 706, 12, 13, 'EBAAAA', 'RJBAAA', 'VVVVxx'),
+(497, 928, 1, 1, 7, 17, 7, 97, 97, 497, 497, 14, 15, 'DTAAAA', 'SJBAAA', 'AAAAxx'),
+(708, 929, 0, 0, 8, 8, 8, 8, 108, 208, 708, 16, 17, 'GBAAAA', 'TJBAAA', 'HHHHxx'),
+(46, 930, 0, 2, 6, 6, 6, 46, 46, 46, 46, 12, 13, 'UBAAAA', 'UJBAAA', 'OOOOxx'),
+(901, 931, 1, 1, 1, 1, 1, 1, 101, 401, 901, 2, 3, 'RIAAAA', 'VJBAAA', 'VVVVxx'),
+(416, 932, 0, 0, 6, 16, 6, 16, 16, 416, 416, 12, 13, 'AQAAAA', 'WJBAAA', 'AAAAxx'),
+(307, 933, 1, 3, 7, 7, 7, 7, 107, 307, 307, 14, 15, 'VLAAAA', 'XJBAAA', 'HHHHxx'),
+(166, 934, 0, 2, 6, 6, 6, 66, 166, 166, 166, 12, 13, 'KGAAAA', 'YJBAAA', 'OOOOxx'),
+(178, 935, 0, 2, 8, 18, 8, 78, 178, 178, 178, 16, 17, 'WGAAAA', 'ZJBAAA', 'VVVVxx'),
+(499, 936, 1, 3, 9, 19, 9, 99, 99, 499, 499, 18, 19, 'FTAAAA', 'AKBAAA', 'AAAAxx'),
+(257, 937, 1, 1, 7, 17, 7, 57, 57, 257, 257, 14, 15, 'XJAAAA', 'BKBAAA', 'HHHHxx'),
+(342, 938, 0, 2, 2, 2, 2, 42, 142, 342, 342, 4, 5, 'ENAAAA', 'CKBAAA', 'OOOOxx'),
+(850, 939, 0, 2, 0, 10, 0, 50, 50, 350, 850, 0, 1, 'SGAAAA', 'DKBAAA', 'VVVVxx'),
+(313, 940, 1, 1, 3, 13, 3, 13, 113, 313, 313, 6, 7, 'BMAAAA', 'EKBAAA', 'AAAAxx'),
+(831, 941, 1, 3, 1, 11, 1, 31, 31, 331, 831, 2, 3, 'ZFAAAA', 'FKBAAA', 'HHHHxx'),
+(57, 942, 1, 1, 7, 17, 7, 57, 57, 57, 57, 14, 15, 'FCAAAA', 'GKBAAA', 'OOOOxx'),
+(37, 943, 1, 1, 7, 17, 7, 37, 37, 37, 37, 14, 15, 'LBAAAA', 'HKBAAA', 'VVVVxx'),
+(511, 944, 1, 3, 1, 11, 1, 11, 111, 11, 511, 2, 3, 'RTAAAA', 'IKBAAA', 'AAAAxx'),
+(578, 945, 0, 2, 8, 18, 8, 78, 178, 78, 578, 16, 17, 'GWAAAA', 'JKBAAA', 'HHHHxx'),
+(100, 946, 0, 0, 0, 0, 0, 0, 100, 100, 100, 0, 1, 'WDAAAA', 'KKBAAA', 'OOOOxx'),
+(935, 947, 1, 3, 5, 15, 5, 35, 135, 435, 935, 10, 11, 'ZJAAAA', 'LKBAAA', 'VVVVxx'),
+(821, 948, 1, 1, 1, 1, 1, 21, 21, 321, 821, 2, 3, 'PFAAAA', 'MKBAAA', 'AAAAxx'),
+(294, 949, 0, 2, 4, 14, 4, 94, 94, 294, 294, 8, 9, 'ILAAAA', 'NKBAAA', 'HHHHxx'),
+(575, 950, 1, 3, 5, 15, 5, 75, 175, 75, 575, 10, 11, 'DWAAAA', 'OKBAAA', 'OOOOxx'),
+(272, 951, 0, 0, 2, 12, 2, 72, 72, 272, 272, 4, 5, 'MKAAAA', 'PKBAAA', 'VVVVxx'),
+(491, 952, 1, 3, 1, 11, 1, 91, 91, 491, 491, 2, 3, 'XSAAAA', 'QKBAAA', 'AAAAxx'),
+(43, 953, 1, 3, 3, 3, 3, 43, 43, 43, 43, 6, 7, 'RBAAAA', 'RKBAAA', 'HHHHxx'),
+(167, 954, 1, 3, 7, 7, 7, 67, 167, 167, 167, 14, 15, 'LGAAAA', 'SKBAAA', 'OOOOxx'),
+(457, 955, 1, 1, 7, 17, 7, 57, 57, 457, 457, 14, 15, 'PRAAAA', 'TKBAAA', 'VVVVxx'),
+(647, 956, 1, 3, 7, 7, 7, 47, 47, 147, 647, 14, 15, 'XYAAAA', 'UKBAAA', 'AAAAxx'),
+(180, 957, 0, 0, 0, 0, 0, 80, 180, 180, 180, 0, 1, 'YGAAAA', 'VKBAAA', 'HHHHxx'),
+(48, 958, 0, 0, 8, 8, 8, 48, 48, 48, 48, 16, 17, 'WBAAAA', 'WKBAAA', 'OOOOxx'),
+(553, 959, 1, 1, 3, 13, 3, 53, 153, 53, 553, 6, 7, 'HVAAAA', 'XKBAAA', 'VVVVxx'),
+(188, 960, 0, 0, 8, 8, 8, 88, 188, 188, 188, 16, 17, 'GHAAAA', 'YKBAAA', 'AAAAxx'),
+(262, 961, 0, 2, 2, 2, 2, 62, 62, 262, 262, 4, 5, 'CKAAAA', 'ZKBAAA', 'HHHHxx'),
+(728, 962, 0, 0, 8, 8, 8, 28, 128, 228, 728, 16, 17, 'ACAAAA', 'ALBAAA', 'OOOOxx'),
+(581, 963, 1, 1, 1, 1, 1, 81, 181, 81, 581, 2, 3, 'JWAAAA', 'BLBAAA', 'VVVVxx'),
+(937, 964, 1, 1, 7, 17, 7, 37, 137, 437, 937, 14, 15, 'BKAAAA', 'CLBAAA', 'AAAAxx'),
+(370, 965, 0, 2, 0, 10, 0, 70, 170, 370, 370, 0, 1, 'GOAAAA', 'DLBAAA', 'HHHHxx'),
+(590, 966, 0, 2, 0, 10, 0, 90, 190, 90, 590, 0, 1, 'SWAAAA', 'ELBAAA', 'OOOOxx'),
+(421, 967, 1, 1, 1, 1, 1, 21, 21, 421, 421, 2, 3, 'FQAAAA', 'FLBAAA', 'VVVVxx'),
+(693, 968, 1, 1, 3, 13, 3, 93, 93, 193, 693, 6, 7, 'RAAAAA', 'GLBAAA', 'AAAAxx'),
+(906, 969, 0, 2, 6, 6, 6, 6, 106, 406, 906, 12, 13, 'WIAAAA', 'HLBAAA', 'HHHHxx'),
+(802, 970, 0, 2, 2, 2, 2, 2, 2, 302, 802, 4, 5, 'WEAAAA', 'ILBAAA', 'OOOOxx'),
+(38, 971, 0, 2, 8, 18, 8, 38, 38, 38, 38, 16, 17, 'MBAAAA', 'JLBAAA', 'VVVVxx'),
+(790, 972, 0, 2, 0, 10, 0, 90, 190, 290, 790, 0, 1, 'KEAAAA', 'KLBAAA', 'AAAAxx'),
+(726, 973, 0, 2, 6, 6, 6, 26, 126, 226, 726, 12, 13, 'YBAAAA', 'LLBAAA', 'HHHHxx'),
+(23, 974, 1, 3, 3, 3, 3, 23, 23, 23, 23, 6, 7, 'XAAAAA', 'MLBAAA', 'OOOOxx'),
+(641, 975, 1, 1, 1, 1, 1, 41, 41, 141, 641, 2, 3, 'RYAAAA', 'NLBAAA', 'VVVVxx'),
+(524, 976, 0, 0, 4, 4, 4, 24, 124, 24, 524, 8, 9, 'EUAAAA', 'OLBAAA', 'AAAAxx'),
+(169, 977, 1, 1, 9, 9, 9, 69, 169, 169, 169, 18, 19, 'NGAAAA', 'PLBAAA', 'HHHHxx'),
+(6, 978, 0, 2, 6, 6, 6, 6, 6, 6, 6, 12, 13, 'GAAAAA', 'QLBAAA', 'OOOOxx'),
+(943, 979, 1, 3, 3, 3, 3, 43, 143, 443, 943, 6, 7, 'HKAAAA', 'RLBAAA', 'VVVVxx'),
+(26, 980, 0, 2, 6, 6, 6, 26, 26, 26, 26, 12, 13, 'ABAAAA', 'SLBAAA', 'AAAAxx'),
+(469, 981, 1, 1, 9, 9, 9, 69, 69, 469, 469, 18, 19, 'BSAAAA', 'TLBAAA', 'HHHHxx'),
+(968, 982, 0, 0, 8, 8, 8, 68, 168, 468, 968, 16, 17, 'GLAAAA', 'ULBAAA', 'OOOOxx'),
+(947, 983, 1, 3, 7, 7, 7, 47, 147, 447, 947, 14, 15, 'LKAAAA', 'VLBAAA', 'VVVVxx'),
+(133, 984, 1, 1, 3, 13, 3, 33, 133, 133, 133, 6, 7, 'DFAAAA', 'WLBAAA', 'AAAAxx'),
+(52, 985, 0, 0, 2, 12, 2, 52, 52, 52, 52, 4, 5, 'ACAAAA', 'XLBAAA', 'HHHHxx'),
+(660, 986, 0, 0, 0, 0, 0, 60, 60, 160, 660, 0, 1, 'KZAAAA', 'YLBAAA', 'OOOOxx'),
+(780, 987, 0, 0, 0, 0, 0, 80, 180, 280, 780, 0, 1, 'AEAAAA', 'ZLBAAA', 'VVVVxx'),
+(963, 988, 1, 3, 3, 3, 3, 63, 163, 463, 963, 6, 7, 'BLAAAA', 'AMBAAA', 'AAAAxx'),
+(561, 989, 1, 1, 1, 1, 1, 61, 161, 61, 561, 2, 3, 'PVAAAA', 'BMBAAA', 'HHHHxx'),
+(402, 990, 0, 2, 2, 2, 2, 2, 2, 402, 402, 4, 5, 'MPAAAA', 'CMBAAA', 'OOOOxx'),
+(437, 991, 1, 1, 7, 17, 7, 37, 37, 437, 437, 14, 15, 'VQAAAA', 'DMBAAA', 'VVVVxx'),
+(112, 992, 0, 0, 2, 12, 2, 12, 112, 112, 112, 4, 5, 'IEAAAA', 'EMBAAA', 'AAAAxx'),
+(247, 993, 1, 3, 7, 7, 7, 47, 47, 247, 247, 14, 15, 'NJAAAA', 'FMBAAA', 'HHHHxx'),
+(579, 994, 1, 3, 9, 19, 9, 79, 179, 79, 579, 18, 19, 'HWAAAA', 'GMBAAA', 'OOOOxx'),
+(379, 995, 1, 3, 9, 19, 9, 79, 179, 379, 379, 18, 19, 'POAAAA', 'HMBAAA', 'VVVVxx'),
+(74, 996, 0, 2, 4, 14, 4, 74, 74, 74, 74, 8, 9, 'WCAAAA', 'IMBAAA', 'AAAAxx'),
+(744, 997, 0, 0, 4, 4, 4, 44, 144, 244, 744, 8, 9, 'QCAAAA', 'JMBAAA', 'HHHHxx'),
+(0, 998, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'AAAAAA', 'KMBAAA', 'OOOOxx'),
+(278, 999, 0, 2, 8, 18, 8, 78, 78, 278, 278, 16, 17, 'SKAAAA', 'LMBAAA', 'VVVVxx');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/road.sql b/yql/essentials/tests/postgresql/initscripts/road.sql
new file mode 100644
index 0000000000..dcc6a96d04
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/road.sql
@@ -0,0 +1,5141 @@
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+
+INSERT INTO road VALUES
+('A St', '[(-122.0265,37.049),(-122.0271,37.045)]'),
+('A St', '[(-122.089,37.71),(-122.0886,37.711)]'),
+('A St', '[(-122.0985,37.671),(-122.0981,37.674)]'),
+('A St', '[(-122.0991,37.668),(-122.0988,37.669)]'),
+('A St', '[(-122.103419,37.667),(-122.103439,37.667)]'),
+('A St', '[(-122.103913,37.66632),(-122.104037,37.66611),(-122.104051,37.66609)]'),
+('A St', '[(-122.106469,37.66446),(-122.1067,37.664)]'),
+('A St', '[(-122.107,37.664),(-122.107101,37.66425),(-122.1074,37.665)]'),
+('A St', '[(-122.1172,37.659),(-122.119506,37.65661)]'),
+('Abbie St', '[(-121.867486,37.54243),(-121.868,37.545)]'),
+('Acacia Ave', '[(-122.2353,37.457),(-122.2344,37.461)]'),
+('Acacia Ave', '[(-122.2364,37.436),(-122.2364,37.443)]'),
+('Acacia Ave', '[(-122.2415,37.435),(-122.2407,37.437)]'),
+('Acadia Ct', '[(-121.9007,37.773),(-121.9016,37.768)]'),
+('Acapulco Way', '[(-122.0517,37.91),(-122.0519,37.911)]'),
+('Access Rd 162', '[(-121.9469,37.993),(-121.9475,37.993)]'),
+('Access Rd 25', '[(-121.9283,37.894),(-121.9283,37.9)]'),
+('Access Rd 29', '[(-121.9339,37.854),(-121.9343,37.85)]'),
+('Acton Cir', '[(-122.2824,37.681),(-122.2824,37.688)]'),
+('Ada St', '[(-122.2487,37.398),(-122.2496,37.401)]'),
+('Ada St', '[(-122.2807,37.807),(-122.2797,37.811)]'),
+('Adams Ave', '[(-121.742,37.829),(-121.742,37.822)]'),
+('Adams Ave', '[(-122.1906,37.253),(-122.1893,37.272)]'),
+('Adams St', '[(-122.2349,37.542),(-122.2341,37.537)]'),
+('Adams St', '[(-122.2364,37.553),(-122.2357,37.548)]'),
+('Adason Dr', '[(-122.1315,37.016),(-122.1288,37.009)]'),
+('Addison St', '[(-122.2735,37.705),(-122.2722,37.707)]'),
+('Addison St', '[(-122.2856,37.688),(-122.2854,37.689)]'),
+('Addison St', '[(-122.2874,37.686),(-122.2864,37.688)]'),
+('Addison Way', '[(-121.9044,37.881),(-121.9044,37.889)]'),
+('Addison Way', '[(-121.9044,37.895),(-121.9044,37.899)]'),
+('Adelina Common', '[(-121.925847,37.29985),(-121.925765,37.29493)]'),
+('Adeline St', '[(-122.2728,37.442),(-122.2725,37.451)]'),
+('Adeline St', '[(-122.2785,37.291),(-122.2783,37.296)]'),
+('Adelle St', '[(-121.7793,37.841),(-121.7797,37.849)]'),
+('Admirality Lane', '[(-122.2424,37.323),(-122.2429,37.318)]'),
+('Adobe Dr', '[(-122.0304,37.579),(-122.0278,37.592)]'),
+('Adrian Ave', '[(-122.1019,37.389),(-122.1019,37.369)]'),
+('Adriano St', '[(-122.032,37.663),(-122.0312,37.653)]'),
+('Agate Ct', '[(-121.801,37.653),(-121.8008,37.649)]'),
+('Agena Cir', '[(-122.0694,37.847),(-122.0696,37.839)]'),
+('Agua Fria Creek', '[(-121.909487,37.94485),(-121.910653,37.94809)]'),
+('Agua Fria Creek', '[(-121.9125,37.95367),(-121.9138,37.958)]'),
+('Agua Fria Creek', '[(-121.9254,37.922),(-121.9281,37.889)]'),
+('Agua Fria Creek', '[(-121.935,37.828),(-121.9356,37.826)]'),
+('Agua Vista', '[(-122.0796,37.896),(-122.0792,37.896)]'),
+('Agua Vista St', '[(-122.2089,37.839),(-122.2069,37.819)]'),
+('Aileen St', '[(-122.2612,37.42),(-122.2622,37.421)]'),
+('Airport Road', '[(-122.2085,37.147),(-122.2101,37.154)]'),
+('Aladdin Ave', '[(-122.1532,37.088),(-122.1577,37.068)]'),
+('Alameda Ave', '[(-122.2197,37.68),(-122.2192,37.68)]'),
+('Alameda Ave', '[(-122.2555,37.689),(-122.2534,37.68)]'),
+('Alameda Ave', '[(-122.2605,37.713),(-122.2588,37.704)]'),
+('Alameda Dr', '[(-121.8756,37.746),(-121.8763,37.746)]'),
+('Alameda Road', '[(-122.2955,37.875),(-122.2963,37.871)]'),
+('Alameda Belt Line Railroad', '[(-122.2586,37.769),(-122.2624,37.784)]'),
+('Alameda Belt Line Railroad', '[(-122.2697,37.798),(-122.2709,37.797)]'),
+('Alameda Creek', '[(-121.8283,37.151),(-121.8273,37.142)]'),
+('Alameda Creek', '[(-121.909502,37.93892),(-121.909,37.94)]'),
+('Alameda Creek', '[(-121.930593,37.93785),(-121.930096,37.94011)]'),
+('Alameda Creek', '[(-121.9466,37.974),(-121.9503,37.973)]'),
+('Alameda Creek', '[(-121.9691,37.748),(-121.97,37.73)]'),
+('Alameda Creek', '[(-121.9724,37.727),(-121.9738,37.726)]'),
+('Alameda Creek', '[(-121.978805,37.72143),(-121.9839,37.717)]'),
+('Alameda Creek', '[(-122.0136,37.734),(-122.0165,37.748)]'),
+('Alameda Creek', '[(-122.022956,37.77306),(-122.025,37.781)]'),
+('Alameda Creek', '[(-122.038,37.877),(-122.0446,37.873)]'),
+('Alameda Creek', '[(-122.0513,37.248),(-122.0556,37.215)]'),
+('Alameda Diversion', '[(-121.774647,37.97333),(-121.772718,37.98591)]'),
+('Alamo Canal', '[(-121.910434,37.73476),(-121.9101,37.726)]'),
+('Alamo Canal', '[(-121.9117,37.768),(-121.911261,37.75648)]'),
+('Alamo Creek', '[(-121.910523,37.2611),(-121.910923,37.26374)]'),
+('Albany St', '[(-122.0327,37.129),(-122.0326,37.115)]'),
+('Albany Ter', '[(-122.2864,37.868),(-122.2856,37.867)]'),
+('Alborg Ct', '[(-122.0492,37.154),(-122.0484,37.15)]'),
+('Alcatraz Ave', '[(-122.2525,37.515),(-122.2531,37.514)]'),
+('Alcatraz Ave', '[(-122.2617,37.502),(-122.2624,37.501)]'),
+('Alcatraz Ave', '[(-122.279,37.479),(-122.2773,37.482)]'),
+('Alcatraz Ave', '[(-122.2817,37.475),(-122.2825,37.475)]'),
+('Alcosta Blvd', '[(-121.938,37.237),(-121.9392,37.235)]'),
+('Alden Lane', '[(-121.786092,37.56057),(-121.7837,37.56)]'),
+('Alden Lane', '[(-121.7978,37.561),(-121.795183,37.561)]'),
+('Alden Road', '[(-122.1116,37.817),(-122.110686,37.81989),(-122.1097,37.823)]'),
+('Alder Ct', '[(-122.0117,37.66),(-122.0109,37.653)]'),
+('Alexander Ct', '[(-121.8708,37.845),(-121.8706,37.841)]'),
+('Alexander St', '[(-121.7888,37.724),(-121.7874,37.724)]'),
+('Alexandria St', '[(-122.1411,37.892),(-122.1417,37.892)]'),
+('Algonquin Ave', '[(-121.7851,37.888),(-121.7852,37.891)]'),
+('Alhambra Lane', '[(-122.2107,37.368),(-122.2102,37.367)]'),
+('Alicante Dr', '[(-122.0211,37.587),(-122.0198,37.582)]'),
+('Alice St', '[(-122.086,37.644),(-122.0848,37.625)]'),
+('Alice St', '[(-122.2696,37.967),(-122.2695,37.969)]'),
+('Alice St', '[(-122.2722,37.927),(-122.2714,37.94)]'),
+('Alice Way', '[(-121.7968,37.718),(-121.7958,37.718)]'),
+('Alice Way', '[(-122.0715,37.836),(-122.072,37.833)]'),
+('Alida St', '[(-122.2025,37.06),(-122.2019,37.056)]'),
+('Alisal St', '[(-121.86925,37.34979),(-121.8685,37.326)]'),
+('Alisal St', '[(-121.87,37.382),(-121.8695,37.35)]'),
+('Aliso Ave', '[(-122.1809,37.953),(-122.18,37.946)]'),
+('Allegro Ct', '[(-121.9755,37.201),(-121.9764,37.201)]'),
+('Allen Ct', '[(-122.0131,37.602),(-122.0117,37.597)]'),
+('Allendale Ave', '[(-122.2048,37.863),(-122.2041,37.858),(-122.2035,37.851)]'),
+('Allendale Ave', '[(-122.2067,37.882),(-122.2065,37.879)]'),
+('Allison Dr', '[(-122.0748,37.863),(-122.073,37.855)]'),
+('Allston Way', '[(-122.2799,37.677),(-122.2787,37.681)]'),
+('Alma Ct', '[(-121.9087,37.799),(-121.9089,37.814)]'),
+('Almaden Blvd', '[(-122.0551,37.008),(-122.0551,37.016)]'),
+('Almaden Pl', '[(-121.9603,37.697),(-121.9601,37.693)]'),
+('Almeria Dr', '[(-122.0711,37.224),(-122.0736,37.224)]'),
+('Almond Ave', '[(-121.7387,37.75527),(-121.7387,37.74118)]'),
+('Almond Ave', '[(-121.7388,37.778),(-121.7387,37.772)]'),
+('Almond Road', '[(-122.0818,37.132),(-122.0831,37.116)]'),
+('Aloe Ct', '[(-121.9158,37.922),(-121.9152,37.927)]'),
+('Alpine Ter', '[(-122.2374,37.445),(-122.2377,37.459)]'),
+('Alta Dr', '[(-122.0109,37.424),(-122.0101,37.419)]'),
+('Alta Vista Ave', '[(-122.2483,37.174),(-122.2473,37.167)]'),
+('Altamont Creek', '[(-121.7422,37.178),(-121.7413,37.203)]'),
+('Altamont Creek', '[(-121.7509,37.149),(-121.7474,37.154)]'),
+('Altamont Pass Road', '[(-121.659901,37.44449),(-121.666828,37.41016)]'),
+('Altimirano Dr', '[(-121.8781,37.0193),(-121.8713,37.01707)]'),
+('Alton Ct', '[(-121.9977,37.581),(-121.9981,37.576)]'),
+('Alvarado Blvd', '[(-122.0562,37.829),(-122.055814,37.82723)]'),
+('Alvarado Road', '[(-122.2339,37.608),(-122.2322,37.616)]'),
+('Alvarado Road', '[(-122.2391,37.573),(-122.2397,37.58)]'),
+('Alvarado St', '[(-122.1505,37.05),(-122.1494,37.03)]'),
+('Alvarado Niles Road', '[(-122.0325,37.903),(-122.0316,37.9)]'),
+('Alvarado Niles Road', '[(-122.049848,37.95115),(-122.0473,37.945)]'),
+('Alvord Way', '[(-121.9085,37.891),(-121.9093,37.889)]'),
+('Amador St', '[(-122.0963,37.614),(-122.0962,37.609)]'),
+('Amador St', '[(-122.0981,37.647),(-122.0966,37.635)]'),
+('Amador St', '[(-122.0999,37.664),(-122.099,37.655)]'),
+('Amador Valley Blvd', '[(-121.9198,37.146),(-121.9211,37.138)]'),
+('Amador Valley Ct', '[(-121.9365,37.068),(-121.937909,37.06375)]'),
+('Amarillo Ct', '[(-121.9439,37.044),(-121.9432,37.046)]'),
+('Ambar Pl', '[(-121.9494,37.482),(-121.9479,37.474)]'),
+('Amber Ct', '[(-121.7997,37.708),(-121.7997,37.704)]'),
+('Amber Way', '[(-121.8025,37.707),(-121.8015,37.708)]'),
+('American Ave', '[(-122.1271,37.478),(-122.1281,37.489)]'),
+('Ames Ter', '[(-121.9962,37.763),(-121.9955,37.762)]'),
+('Amherst Ct', '[(-122.1571,37.036),(-122.1575,37.034)]'),
+('Anchor Dr', '[(-122.3027,37.374),(-122.3032,37.383)]'),
+('Andrade Road', '[(-121.8842,37.741),(-121.8841,37.738)]'),
+('Andrade Road', '[(-121.8853,37.565),(-121.8855,37.564)]'),
+('Andrea Cir', '[(-121.733218,37.88641),(-121.733286,37.90617)]'),
+('Andrews St', '[(-121.7814,37.834),(-121.7814,37.829)]'),
+('Angela St', '[(-121.865522,37.55324),(-121.8652,37.552)]'),
+('Angela St', '[(-121.8795,37.607),(-121.8798,37.608)]'),
+('Angus Way', '[(-122.098774,37.86535),(-122.0986,37.861)]'),
+('Anita Ct', '[(-121.9655,37.744),(-121.9653,37.738)]'),
+('Ann St', '[(-121.9888,37.604),(-121.9894,37.603)]'),
+('Anna Maria St', '[(-121.7957,37.756),(-121.7958,37.725)]'),
+('Annerley Road', '[(-122.2328,37.168),(-122.2325,37.17)]'),
+('Antelope Ct', '[(-122.0653,37.773),(-122.0648,37.773)]'),
+('Antonio St', '[(-122.1642,37.251),(-122.1653,37.247)]'),
+('Anza St', '[(-121.9184,37.306),(-121.9197,37.304)]'),
+('Anza Way', '[(-121.7794,37.714),(-121.7788,37.714)]'),
+('Apgar St', '[(-122.2709,37.288),(-122.2719,37.29)]'),
+('Apgar St', '[(-122.278,37.291),(-122.2785,37.291)]'),
+('Apollo Cir', '[(-122.068531,37.87654),(-122.0686,37.877)]'),
+('Appian Way', '[(-122.0022,37.98),(-122.0019,37.983)]'),
+('Apple Ave', '[(-122.0909,37.85),(-122.0901,37.857)]'),
+('Applewood St', '[(-121.9629,37.192),(-121.9616,37.168)]'),
+('Apricot Lane', '[(-121.9471,37.401),(-121.9456,37.392)]'),
+('Aquarius Cir', '[(-122.0669,37.877),(-122.0674,37.88)]'),
+('Arbor Dr', '[(-121.8506,37.576),(-121.8521,37.578)]'),
+('Arbor St', '[(-122.2587,37.758),(-122.2582,37.765)]'),
+('Arcade Lane', '[(-122.2514,37.865),(-122.251558,37.86316)]'),
+('Arch St', '[(-122.2639,37.79),(-122.2638,37.782)]'),
+('Arch St', '[(-122.2647,37.846),(-122.2646,37.844)]'),
+('Archer Ave', '[(-121.9879,37.627),(-121.9888,37.626)]'),
+('Arden Road', '[(-122.0978,37.177),(-122.1,37.177)]'),
+('Ardenwood Blvd', '[(-122.063701,37.59653),(-122.063302,37.58815)]'),
+('Ardmore Dr', '[(-122.1308,37.211),(-122.1293,37.212)]'),
+('Ardo St', '[(-122.0295,37.682),(-122.0302,37.674)]'),
+('Ardo St', '[(-122.0306,37.659),(-122.0312,37.653)]'),
+('Arena St', '[(-122.155014,37.82347),(-122.1559,37.82)]'),
+('Arendt Way', '[(-121.8717,37.606),(-121.871,37.602)]'),
+('Argonaut Way', '[(-121.993,37.475),(-121.9926,37.473)]'),
+('Argonne St', '[(-122.146,37.806),(-122.1455,37.801),(-122.1451,37.796)]'),
+('Arizona St', '[(-122.0381,37.901),(-122.0367,37.898)]'),
+('Arizona St', '[(-122.044507,37.905),(-122.0443,37.904)]'),
+('Arizona St', '[(-122.1985,37.978),(-122.1981,37.974)]'),
+('Ark Dr', '[(-122.1313,37.029),(-122.1313,37.036)]'),
+('Arkansas Pl', '[(-121.9148,37.696),(-121.9149,37.699)]'),
+('Arlington Ave', '[(-122.2699,37.43),(-122.2719,37.428)]'),
+('Arlington Ave', '[(-122.276,37.024),(-122.276,37.014)]'),
+('Arlington Ave', '[(-122.276,37.988),(-122.2753,37.974)]'),
+('Arlington Dr', '[(-121.8802,37.408),(-121.8807,37.394)]'),
+('Arlington Road', '[(-121.7957,37.898),(-121.7956,37.906)]'),
+('Armata St', '[(-121.9236,37.858),(-121.9232,37.853)]'),
+('Arnold Ct', '[(-122.0887,37.669),(-122.0894,37.666)]'),
+('Arnold Road', '[(-121.8923,37.113),(-121.8924,37.111)]'),
+('Arnold Road', '[(-121.8924,37.06),(-121.8924,37.062)]'),
+('Arrowhead Dr', '[(-122.1943,37.389),(-122.1908,37.366)]'),
+('Arroyo Dr', '[(-121.9049,37.509),(-121.9029,37.516)]'),
+('Arroyo Road', '[(-121.749307,37.14717),(-121.7481,37.14957)]'),
+('Arroyo Road', '[(-121.7506,37.189),(-121.75,37.18541)]'),
+('Arroyo Road', '[(-121.7555,37.258),(-121.7556,37.251)]'),
+('Arroyo Road', '[(-121.76696,37.7112),(-121.76687,37.7094)]'),
+('Arroyo Road', '[(-121.7671,37.654),(-121.767086,37.65214),(-121.767,37.641)]'),
+('Arroyo de la Laguna', '[(-121.9064,37.612),(-121.9047,37.551)]'),
+('Arroyo del Valle', '[(-121.607487,37.89841),(-121.612773,37.92638)]'),
+('Arroyo del Valle', '[(-121.654588,37.36507),(-121.656972,37.4088)]'),
+('Arroyo del Valle', '[(-121.75,37.20484),(-121.7584,37.208)]'),
+('Arroyo del Valle', '[(-121.8049,37.539),(-121.7856,37.463)]'),
+('Arroyo del Valle', '[(-121.8751,37.656),(-121.8731,37.646)]'),
+('Arroyo Las Positas', '[(-121.7308,37.87),(-121.72772,37.85435)]'),
+('Arroyo Las Positas', '[(-121.7349,37.943),(-121.734048,37.9262)]'),
+('Arroyo Las Positas', '[(-121.7836,37.997),(-121.783492,37.99605)]'),
+('Arroyo Las Positas', '[(-121.7973,37.997),(-121.7957,37.005)]'),
+('Arroyo Las Positas', '[(-121.8473,37.965),(-121.8312,37.992)]'),
+('Arroyo Las Positas', '[(-121.858962,37.94925),(-121.858919,37.95878)]'),
+('Arroyo Mocho', '[(-121.553409,37.25257),(-121.565204,37.37327)]'),
+('Arroyo Mocho', '[(-121.625,37.83316),(-121.624698,37.83019)]'),
+('Arroyo Mocho', '[(-121.660579,37.01388),(-121.668949,37.027),(-121.682578,37.10817)]'),
+('Arroyo Mocho', '[(-121.7316,37.595),(-121.7186,37.466)]'),
+('Arroyo Mocho Canal', '[(-121.90854,37.78099),(-121.907797,37.78392)]'),
+('Arroyo Seco', '[(-121.655796,37.50684),(-121.657215,37.51096)]'),
+('Arroyo Seco', '[(-121.7073,37.766),(-121.6997,37.729)]'),
+('Arroyuelo Ave', '[(-122.2496,37.271),(-122.249564,37.2728)]'),
+('Ascot Dr', '[(-122.1934,37.217),(-122.1926,37.219)]'),
+('Ascot Dr', '[(-122.1969,37.211),(-122.1951,37.207)]'),
+('Ash St', '[(-122.0384,37.259),(-122.0388,37.276)]'),
+('Ash St', '[(-122.0408,37.31),(-122.04,37.292)]'),
+('Ashby Ave', '[(-122.2494,37.579),(-122.2485,37.579)]'),
+('Ashby Ave', '[(-122.2526,37.574),(-122.2518,37.574)]'),
+('Ashby Ave', '[(-122.264,37.557),(-122.263,37.559)]'),
+('Ashland Ave', '[(-122.1178,37.941),(-122.1178,37.93)]'),
+('Ashland Ave', '[(-122.1179,37.914),(-122.1179,37.913)]'),
+('Ashwood Common', '[(-121.962832,37.21086),(-121.963052,37.21067)]'),
+('Asilomar Dr', '[(-122.2028,37.298),(-122.20355,37.2905)]'),
+('Asilomar Dr', '[(-122.2041,37.333),(-122.204,37.312)]'),
+('Aspinwall Road', '[(-122.2074,37.39),(-122.2068,37.39)]'),
+('Aster Ct', '[(-121.9125,37.72),(-121.9129,37.719)]'),
+('At and Sf Railroad', '[(-122.2765,37.347),(-122.2768,37.339)]'),
+('At and Sf Railroad', '[(-122.2767,37.463),(-122.2766,37.454)]'),
+('At and Sf Railroad', '[(-122.2785,37.544),(-122.2784,37.535)]'),
+('At and Sf Railroad', '[(-122.281389,37.30695),(-122.282488,37.30491)]'),
+('At and Sf Railroad', '[(-122.2827,37.611),(-122.2821,37.603)]'),
+('At and Sf Railroad', '[(-122.2844,37.293),(-122.2848,37.291)]'),
+('At and Sf Railroad', '[(-122.2878,37.788),(-122.2874,37.783)]'),
+('At and Sf Railroad', '[(-122.288,37.3),(-122.288,37.294)]'),
+('Atherton St', '[(-122.0819,37.68),(-122.0809,37.669)]'),
+('Atherton St', '[(-122.0838,37.7),(-122.0829,37.69)]'),
+('Atherton St', '[(-122.1701,37.612),(-122.1696,37.606)]'),
+('Athol Ave', '[(-122.2535,37.01),(-122.2523,37.016)]'),
+('Atlantic Ave', '[(-122.2831,37.804),(-122.2816,37.803)]'),
+('Atlantic St', '[(-122.0371,37.018),(-122.0382,37.018)]'),
+('Atlas Ave', '[(-122.1889,37.964),(-122.1882,37.966)]'),
+('Atwater Ct', '[(-122.0076,37.662),(-122.0084,37.654)]'),
+('Auburn Ave', '[(-122.25,37.489),(-122.25035,37.4945)]'),
+('Audrey Dr', '[(-122.069,37.13),(-122.0683,37.131)]'),
+('Audubon St', '[(-122.0388,37.261),(-122.0383,37.258)]'),
+('Aughinbaugh Way', '[(-122.2491,37.473),(-122.249,37.471)]'),
+('Augustine Pl', '[(-122.0169,37.732),(-122.0163,37.725)]'),
+('Aurora Dr', '[(-122.1804,37.973),(-122.18,37.966)]'),
+('Auseon Ave', '[(-122.1653,37.565),(-122.165,37.567)]'),
+('Austin St', '[(-121.943,37.422),(-121.9435,37.425)]'),
+('Autumn Oak Dr', '[(-121.749435,37.09187),(-121.749806,37.10065)]'),
+('Avalon Ave', '[(-122.2477,37.597),(-122.246,37.598)]'),
+('Avenue 130th', '[(-122.1851,37.044),(-122.1872,37.036)]'),
+('Avenue 134th', '[(-122.1823,37.002),(-122.1851,37.992)]'),
+('Avenue 140th', '[(-122.1656,37.003),(-122.1691,37.988)]'),
+('Avenue A', '[(-122.3005,37.885),(-122.3024,37.885)]'),
+('Avenue A', '[(-122.3035,37.885),(-122.3076,37.886)]'),
+('Avenue D', '[(-122.298,37.848),(-122.3024,37.849)]'),
+('Avenue F', '[(-122.2943,37.831),(-122.2971,37.832)]'),
+('Avenue L', '[(-122.296,37.757),(-122.2985,37.757)]'),
+('Avoca Ave', '[(-122.2211,37.413),(-122.2204,37.416)]'),
+('Ayala Ave', '[(-122.2587,37.429),(-122.2584,37.435)]'),
+('Azalea Ct', '[(-121.7365,37.13),(-121.7357,37.136)]'),
+('Azevedo Ave', '[(-122.0639,37.756),(-122.0641,37.75)]'),
+('Aztec Ct', '[(-121.922,37.92),(-121.921,37.92)]'),
+('B St', '[(-121.8924,37.95133),(-121.8924,37.952)]'),
+('B St', '[(-122.0241,37.05),(-122.0248,37.045)]'),
+('B St', '[(-122.0531,37.434),(-122.0537,37.434)]'),
+('B St', '[(-122.0656,37.823),(-122.0652,37.825)]'),
+('B St', '[(-122.0799,37.742),(-122.0782,37.753)]'),
+('B St', '[(-122.087,37.707),(-122.0863,37.709)]'),
+('B St', '[(-122.0955,37.673),(-122.0944,37.677)]'),
+('B St', '[(-122.1749,37.451),(-122.1743,37.443)]'),
+('Bach Ct', '[(-121.9778,37.295),(-121.9769,37.292)]'),
+('Bahama Ave', '[(-122.1039,37.335),(-122.1031,37.321)]'),
+('Bahama Com', '[(-122.0361,37.72),(-122.036031,37.72046),(-122.0358,37.722)]'),
+('Baine Ave', '[(-122.0089,37.565),(-122.0104,37.546)]'),
+('Bairo Ct', '[(-121.9505,37.398),(-121.9498,37.393)]'),
+('Baker St', '[(-122.2792,37.495),(-122.2791,37.488)]'),
+('Balboa Dr', '[(-122.1982,37.319),(-122.1971,37.333)]'),
+('Balboa Way', '[(-122.0205,37.519),(-122.0207,37.517)]'),
+('Baldwin Pl', '[(-122.0274,37.697),(-122.0265,37.692)]'),
+('Ballantyne Dr', '[(-121.858907,37.985),(-121.8585,37.985)]'),
+('Ballantyne Dr', '[(-121.8611,37.986),(-121.8605,37.985)]'),
+('Ballena Blvd', '[(-122.2854,37.691),(-122.285393,37.68924)]'),
+('Ballentine Dr', '[(-121.859765,37.96825),(-121.860477,37.96784)]'),
+('Balmoral Dr', '[(-122.1639,37.981),(-122.1635,37.988)]'),
+('Balmoral Dr', '[(-122.1658,37.027),(-122.1656,37.042)]'),
+('Balmoral St', '[(-122.055,37.971),(-122.0555,37.979)]'),
+('Banbury St', '[(-122.0943,37.495),(-122.0949,37.493)]'),
+('Bancroft Ave', '[(-122.1475,37.288),(-122.147,37.276)]'),
+('Bancroft Ave', '[(-122.1485,37.311),(-122.1481,37.303)]'),
+('Bancroft Ave', '[(-122.1518,37.358),(-122.1511,37.349)]'),
+('Bancroft Ave', '[(-122.15714,37.4242),(-122.156,37.409)]'),
+('Bancroft Ave', '[(-122.1585,37.445),(-122.1583,37.441)]'),
+('Bancroft Ave', '[(-122.1643,37.523),(-122.1631,37.508),(-122.1621,37.493)]'),
+('Bancroft Ave', '[(-122.1718,37.62),(-122.1715,37.617)]'),
+('Bancroft Ave', '[(-122.1796,37.689),(-122.1792,37.684)]'),
+('Bancroft Ave', '[(-122.1903,37.706),(-122.189,37.705)]'),
+('Bancroft Ave', '[(-122.2041,37.716),(-122.202,37.716)]'),
+('Bancroft Ct', '[(-122.1329,37.109),(-122.1322,37.116)]'),
+('Bancroft Way', '[(-122.2753,37.667),(-122.2742,37.668)]'),
+('Bancroft Way', '[(-122.2846,37.654),(-122.283747,37.655)]'),
+('Bancroft Way', '[(-122.291,37.644),(-122.2899,37.647)]'),
+('Bandon Dr', '[(-121.9311,37.234),(-121.931,37.237)]'),
+('Banyan Tree Road', '[(-121.9901,37.317),(-121.9877,37.304)]'),
+('Barbers Point Road', '[(-122.2957,37.896),(-122.2965,37.894)]'),
+('Barcelona Ave', '[(-122.0896,37.276),(-122.0894,37.253)]'),
+('Barcelona St', '[(-122.1459,37.639),(-122.1445,37.623)]'),
+('Barcelona Way', '[(-122.0787,37.86),(-122.0783,37.858)]'),
+('Bardolph Cir', '[(-122.0583,37.718),(-122.0586,37.726)]'),
+('Barlow Dr', '[(-122.0891,37.034),(-122.088,37.037),(-122.086558,37.03988)]'),
+('Barlow Dr', '[(-122.0915,37.03),(-122.0903,37.032)]'),
+('Bart Ramp', '[(-122.0495,37.208),(-122.0473,37.196)]'),
+('Bart Access Road', '[(-122.0346,37.081),(-122.0329,37.057)]'),
+('Bartlett Lane', '[(-122.111062,37.71771),(-122.10988,37.70276)]'),
+('Bartlett St', '[(-122.2071,37.902),(-122.2053,37.913)]'),
+('Barton Dr', '[(-121.9655,37.744),(-121.9644,37.749)]'),
+('Bates Dr', '[(-122.0328,37.748),(-122.0322,37.745)]'),
+('Baumberg Ave', '[(-122.0987,37.241),(-122.0985,37.237)]'),
+('Bautista St', '[(-121.9227,37.29),(-121.9225,37.284)]'),
+('Bay St', '[(-121.9611,37.33),(-121.9627,37.329)]'),
+('Bay St', '[(-122.2642,37.732),(-122.2641,37.751)]'),
+('Bay Area Rapid Transit', '[(-121.983355,37.64329),(-121.982907,37.63842)]'),
+('Bay Area Rapid Transit', '[(-122.0049,37.816),(-122.004,37.809)]'),
+('Bay Area Rapid Transit', '[(-122.007,37.833),(-122.0062,37.827)]'),
+('Bay Area Rapid Transit', '[(-122.02,37.935),(-122.0193,37.926)]'),
+('Bay Area Rapid Transit', '[(-122.0309,37.057),(-122.0281,37.027),(-122.0262,37.001)]'),
+('Bay Area Rapid Transit', '[(-122.0813,37.661),(-122.0806,37.654)]'),
+('Bay Area Rapid Transit', '[(-122.0981,37.779),(-122.0963,37.767)]'),
+('Bay Area Rapid Transit', '[(-122.1694,37.311),(-122.1679,37.3)]'),
+('Bay Area Rapid Transit', '[(-122.2086,37.641),(-122.2061,37.619)]'),
+('Bay Area Rapid Transit', '[(-122.2129,37.676),(-122.212,37.668)]'),
+('Bay Area Rapid Transit', '[(-122.2172,37.713),(-122.2184,37.719)]'),
+('Bay Area Rapid Transit', '[(-122.231147,37.54912),(-122.229,37.562)]'),
+('Bay Area Rapid Transit', '[(-122.2349,37.525),(-122.2339,37.532)]'),
+('Bay Area Rapid Transit', '[(-122.2571,37.427),(-122.2563,37.431)]'),
+('Bay Area Rapid Transit', '[(-122.2658,37.337),(-122.2644,37.38)]'),
+('Bay Area Rapid Transit', '[(-122.267508,37.25368),(-122.2674,37.258)]'),
+('Bay Forest Dr', '[(-122.2139,37.561),(-122.2142,37.565)]'),
+('Bay Walk Road', '[(-122.2471,37.389),(-122.2462,37.389)]'),
+('Bayfield Pl', '[(-121.9665,37.204),(-121.9664,37.196)]'),
+('Baylor St', '[(-122.0272,37.93),(-122.0284,37.903)]'),
+('Bayview Ave', '[(-122.0584,37.864),(-122.0581,37.855)]'),
+('Bayview Dr', '[(-122.2386,37.511),(-122.2379,37.514)]'),
+('Beachwood Way', '[(-121.8817,37.731),(-121.8807,37.731)]'),
+('Beacon St', '[(-122.2484,37.09),(-122.2472,37.088)]'),
+('Beard Road', '[(-122.0417,37.819),(-122.0424,37.81)]'),
+('Beard Road', '[(-122.0447,37.778),(-122.045,37.775)]'),
+('Beaumont Ave', '[(-122.2263,37.033),(-122.2262,37.04)]'),
+('Becket Dr', '[(-122.0509,37.005),(-122.0509,37.033)]'),
+('Bedelio Ter', '[(-122.019,37.579),(-122.018,37.574)]'),
+('Bedford St', '[(-121.9333,37.403),(-121.9338,37.402)]'),
+('Bedford Way', '[(-121.928,37.149),(-121.9288,37.15)]'),
+('Beecham Ct', '[(-121.8693,37.959),(-121.8704,37.959)]'),
+('Beechmont Lane', '[(-122.0971,37.558),(-122.0984,37.555)]'),
+('Begier Ave', '[(-122.15,37.314),(-122.1488,37.317)]'),
+('Begonia Dr', '[(-122.1334,37.01),(-122.1342,37.01)]'),
+('Begonia St', '[(-122.0153,37.785),(-122.0156,37.772)]'),
+('Begonia St', '[(-122.0218,37.797),(-122.022,37.789)]'),
+('Bel Aire St', '[(-122.0717,37.726),(-122.0714,37.725)]'),
+('Bell St', '[(-121.99126,37.4916),(-121.991407,37.49215)]'),
+('Belleview Dr', '[(-122.1626,37.325),(-122.1635,37.32)]'),
+('Bellevue Ave', '[(-122.2529,37.13),(-122.2521,37.111)]'),
+('Bellflower Dr', '[(-122.0103,37.317),(-122.009979,37.31387)]'),
+('Bellhaven Ave', '[(-122.0354,37.414),(-122.0364,37.405)]'),
+('Belmont Ave', '[(-122.0708,37.588),(-122.0703,37.582)]'),
+('Belvedere Ave', '[(-122.1768,37.918),(-122.1772,37.918)]'),
+('Belvedere Ave', '[(-122.2892,37.767),(-122.2888,37.759)]'),
+('Benecia Ave', '[(-122.0077,37.222),(-122.0076,37.225)]'),
+('Benedict Dr', '[(-122.1326,37.204),(-122.1323,37.199)]'),
+('Benner Ct', '[(-121.9063,37.891),(-121.9076,37.888)]'),
+('Bennington Lane', '[(-122.103818,37.36136),(-122.1045,37.361)]'),
+('Benson Road', '[(-122.083217,37.94765),(-122.0891,37.928)]'),
+('Benton St', '[(-122.2605,37.713),(-122.2605,37.731)]'),
+('Berkeley Way', '[(-122.2747,37.722),(-122.2726,37.725)]'),
+('Berlin Way', '[(-121.7774,37.649),(-121.7766,37.649)]'),
+('Bernal Ave', '[(-121.8556,37.668),(-121.85626,37.68656)]'),
+('Bernal Ave', '[(-121.895208,37.57837),(-121.884914,37.57603)]'),
+('Bernhardt Dr', '[(-122.1852,37.297),(-122.1847,37.292)]'),
+('Bernhardt St', '[(-122.1326,37.399),(-122.1322,37.449)]'),
+('Berwind Ave', '[(-121.7308,37.183),(-121.7303,37.181)]'),
+('Besco Dr', '[(-121.9764,37.32),(-121.9761,37.311)]'),
+('Bess Ave', '[(-121.765239,37.625),(-121.763602,37.625)]'),
+('Best Ave', '[(-122.1622,37.284),(-122.1636,37.278)]'),
+('Betlen Dr', '[(-121.9407,37.026),(-121.9397,37.029)]'),
+('Betlen Dr', '[(-121.9507,37.018),(-121.950121,37.01678)]'),
+('Bettencourt St', '[(-122.0479,37.34),(-122.0473,37.337)]'),
+('Beverly Ave', '[(-122.1578,37.382),(-122.1572,37.375)]'),
+('Beverly Ave', '[(-122.1586,37.395),(-122.1582,37.388)]'),
+('Beverly St', '[(-121.736023,37.85177),(-121.737956,37.84632)]'),
+('Bianca Way', '[(-121.7244,37.946),(-121.7257,37.945)]'),
+('Bianca Way', '[(-121.7281,37.939),(-121.729,37.937)]'),
+('Biddle Ave', '[(-122.0317,37.425),(-122.0329,37.417)]'),
+('Bidwell Dr', '[(-121.9748,37.448),(-121.9763,37.427)]'),
+('Bidwell Dr', '[(-121.9763,37.422),(-121.9764,37.42)]'),
+('Biehs Ct', '[(-122.2289,37.386),(-122.2283,37.391)]'),
+('Big Burn Road', '[(-122.0918,37.802),(-122.1091,37.788)]'),
+('Binnacle Hill', '[(-122.2269,37.533),(-122.2274,37.523)]'),
+('Birch St', '[(-122.0269,37.368),(-122.0254,37.36)]'),
+('Birch St', '[(-122.1617,37.425),(-122.1614,37.417)]'),
+('Birch St', '[(-122.1653,37.478),(-122.1641,37.464)]'),
+('Birch St', '[(-122.1673,37.509),(-122.1661,37.492)]'),
+('Birch Creek Dr', '[(-121.8641,37.629),(-121.8642,37.64)]'),
+('Birdsall Ave', '[(-122.1907,37.774),(-122.1907,37.781)]'),
+('Birdsall Ave', '[(-122.191,37.789),(-122.1911,37.796)]'),
+('Birkdale Dr', '[(-122.0515,37.373),(-122.0521,37.368)]'),
+('Birkdale Way', '[(-122.0406,37.17),(-122.0386,37.153)]'),
+('Biscayne Ave', '[(-122.0734,37.278),(-122.0734,37.274)]'),
+('Bishop Ave', '[(-121.9911,37.635),(-121.9921,37.632)]'),
+('Bitterroot Ave', '[(-122.0091,37.276),(-122.0087,37.282)]'),
+('Black Ave', '[(-121.8816,37.721),(-121.8826,37.721)]'),
+('Black Ave', '[(-121.8909,37.704),(-121.892,37.698)]'),
+('Black Ave', '[(-121.8964,37.701),(-121.8967,37.706)]'),
+('Blackbird Way', '[(-121.8867,37.801),(-121.8876,37.801),(-121.8882,37.801)]'),
+('Blackstone Way', '[(-122.0393,37.724),(-122.0388,37.721)]'),
+('Blackstone Way', '[(-122.0418,37.736),(-122.043,37.743)]'),
+('Blacow Road', '[(-121.9909,37.33),(-121.9895,37.324)]'),
+('Blacow Road', '[(-122.0061,37.409),(-122.0053,37.405)]'),
+('Blacow Road', '[(-122.0179,37.469),(-122.0167,37.465)]'),
+('Blair Ave', '[(-122.2225,37.27),(-122.2217,37.276)]'),
+('Blair Ave', '[(-122.2364,37.263),(-122.2359,37.267)]'),
+('Blaisdell Way', '[(-121.9858,37.816),(-121.9853,37.811)]'),
+('Blake St', '[(-122.2622,37.639),(-122.2599,37.642)]'),
+('Blake St', '[(-122.2864,37.605),(-122.2845,37.608)]'),
+('Blanchard St', '[(-121.97,37.382),(-121.9693,37.382)]'),
+('Blanchard St', '[(-121.9729,37.38),(-121.9709,37.383)]'),
+('Blanding Ave', '[(-122.2313,37.68),(-122.2328,37.686)]'),
+('Blewett St', '[(-121.9732,37.373),(-121.9733,37.369)]'),
+('Bloomington Way', '[(-121.9448,37.205),(-121.9434,37.204)]'),
+('Blossom Ct', '[(-121.8766,37.395),(-121.876493,37.39469)]'),
+('Blossom Ct', '[(-122.0212,37.772),(-122.0213,37.769)]'),
+('Blossom Way', '[(-122.1096,37.758),(-122.1087,37.764),(-122.1057,37.774)]'),
+('Blue Coral', '[(-121.965392,37.69509),(-121.965261,37.70132)]'),
+('Bluebell Dr', '[(-121.74,37.151),(-121.7411,37.161)]'),
+('Bluefield Lane', '[(-122.1024,37.584),(-122.1033,37.561)]'),
+('Blythe St', '[(-122.0704,37.745),(-122.0711,37.739)]'),
+('Boar Cir', '[(-121.912463,37.08667),(-121.912335,37.09052)]'),
+('Bobwhite Ter', '[(-122.046797,37.80224),(-122.046672,37.80179)]'),
+('Bockman Road', '[(-122.1206,37.713),(-122.122,37.712)]'),
+('Bodie Ter', '[(-121.9253,37.884),(-121.9247,37.887)]'),
+('Boeing St', '[(-122.2122,37.34),(-122.2112,37.322)]'),
+('Bolero Ave', '[(-122.0904,37.297),(-122.0913,37.297)]'),
+('Bonar St', '[(-122.2857,37.653),(-122.2856,37.642)]'),
+('Bond St', '[(-122.2071,37.718),(-122.2067,37.716)]'),
+('Bond St', '[(-122.2126,37.75),(-122.2116,37.739)]'),
+('Bonde Way', '[(-122.0077,37.59),(-122.0084,37.58)]'),
+('Bonita Ave', '[(-122.2355,37.306),(-122.235,37.296)]'),
+('Bonita Ave', '[(-122.2727,37.843),(-122.2725,37.835)]'),
+('Bonner Ave', '[(-121.9748,37.635),(-121.976,37.631)]'),
+('Bonnie St', '[(-122.0332,37.381),(-122.0324,37.378)]'),
+('Booker Way', '[(-122.0898,37.464),(-122.0902,37.454)]'),
+('Boone Dr', '[(-121.9825,37.329),(-121.9829,37.324)]'),
+('Boone Dr', '[(-122.0271,37.151),(-122.02815,37.14124)]'),
+('Bordeaux St', '[(-121.7685,37.688),(-121.7687,37.664)]'),
+('Boston Ave', '[(-122.2132,37.961),(-122.2129,37.969)]'),
+('Boulevard Way', '[(-122.2427,37.18),(-122.2423,37.181)]'),
+('Bourbon Dr', '[(-122.0869,37.194),(-122.0878,37.192)]'),
+('Bowditch St', '[(-122.2559,37.665),(-122.2557,37.656)]'),
+('Bowie Common', '[(-122.042847,37.64532),(-122.042808,37.64484)]'),
+('Boxwood Way', '[(-121.9329,37.094),(-121.9335,37.096)]'),
+('Bradrick Dr', '[(-122.138,37.962),(-122.1361,37.963)]'),
+('Bradshire Road', '[(-122.0885,37.204),(-122.0883,37.2)]'),
+('Bramble Ct', '[(-122.0944,37.941),(-122.0951,37.94)]'),
+('Brann St', '[(-122.1806,37.709),(-122.1785,37.705)]'),
+('Brayton Ct', '[(-122.0123,37.423),(-122.0114,37.418)]'),
+('Breakwater Ave', '[(-122.1196,37.294),(-122.1203,37.282)]'),
+('Brentford St', '[(-122.1965,37.581),(-122.1964,37.564)]'),
+('Breton Dr', '[(-122.0435,37.463),(-122.043,37.458)]'),
+('Brian St', '[(-122.0686,37.348),(-122.0693,37.344)]'),
+('Briar Cliff Road', '[(-122.1409,37.647),(-122.1382,37.658)]'),
+('Briarwood Dr', '[(-121.7663,37.915),(-121.7652,37.916)]'),
+('Brickell Way', '[(-122.067,37.104),(-122.067,37.101)]'),
+('Bridge Ct', '[(-122.0879,37.848),(-122.0874,37.844)]'),
+('Bridgepointe Dr', '[(-122.0514,37.305),(-122.0509,37.299)]'),
+('Bridgeview Dr', '[(-122.2112,37.133),(-122.21,37.138)]'),
+('Bridgewood Ter', '[(-122.0042,37.639),(-122.0047,37.632)]'),
+('Brier St', '[(-122.0806,37.959),(-122.0805,37.963)]'),
+('Brighton Ave', '[(-122.2944,37.979),(-122.2934,37.979)]'),
+('Brighton Dr', '[(-121.9263,37.188),(-121.9277,37.189),(-121.9285,37.19)]'),
+('Brighton Dr', '[(-121.931,37.198),(-121.9312,37.197)]'),
+('Briscoe Ter', '[(-121.948491,37.4184),(-121.948634,37.41645)]'),
+('Bristol Blvd', '[(-122.1674,37.353),(-122.1698,37.342)]'),
+('Bristolwood Road', '[(-121.9165,37.78),(-121.9164,37.787)]'),
+('Broadmoor Blvd', '[(-122.147,37.397),(-122.1466,37.399)]'),
+('Broadmoor Blvd', '[(-122.156,37.358),(-122.1546,37.364)]'),
+('Broadmoor St', '[(-121.7313,37.257),(-121.7313,37.263)]'),
+('Broadmoor St', '[(-121.7314,37.194),(-121.7314,37.199)]'),
+('Broadmoor St', '[(-121.7314,37.213),(-121.7314,37.221)]'),
+('Broadmore Ave', '[(-122.095,37.522),(-122.0936,37.497)]'),
+('Broadway', '[(-122.2212,37.5),(-122.2204,37.517)]'),
+('Broadway', '[(-122.2372,37.631),(-122.236753,37.63675)]'),
+('Broadway', '[(-122.2391,37.493),(-122.2386,37.495)]'),
+('Broadway', '[(-122.2409,37.586),(-122.2395,37.601)]'),
+('Broadway', '[(-122.243008,37.55961),(-122.2427,37.563)]'),
+('Broadway', '[(-122.245,37.45),(-122.2443,37.46),(-122.2436,37.469)]'),
+('Broadway', '[(-122.2457,37.528),(-122.2455,37.529)]'),
+('Broadway', '[(-122.2472,37.418),(-122.2468,37.426)]'),
+('Broadway', '[(-122.2539,37.316),(-122.2525,37.337)]'),
+('Broadway', '[(-122.2598,37.222),(-122.2596,37.227)]'),
+('Broadway', '[(-122.2632,37.167),(-122.2626,37.177),(-122.2617,37.19)]'),
+('Broadway', '[(-122.2719,37.028),(-122.2714,37.036)]'),
+('Broadway', '[(-122.2727,37.015),(-122.2723,37.021)]'),
+('Broadway Ter', '[(-122.2429,37.393),(-122.2413,37.397)]'),
+('Brookdale Ave', '[(-122.2043,37.834),(-122.2032,37.824)]'),
+('Brookdale Ave', '[(-122.2092,37.878),(-122.208568,37.87208)]'),
+('Brookdale Ave', '[(-122.2095,37.888),(-122.2088,37.882)]'),
+('Brookdale Blvd', '[(-122.0915,37.164),(-122.0912,37.166)]'),
+('Brookdale Blvd', '[(-122.0965,37.123),(-122.0958,37.133)]'),
+('Brooklyn Ave', '[(-122.2425,37.029),(-122.2416,37.026)]'),
+('Brooklyn Ave', '[(-122.2455,37.04),(-122.2445,37.036)]'),
+('Brooklyn Ave', '[(-122.2502,37.055),(-122.2495,37.053)]'),
+('Brookside Ct', '[(-121.9218,37.902),(-121.9213,37.908)]'),
+('Browning Ct', '[(-122.037289,37.766),(-122.038366,37.76228)]'),
+('Browning St', '[(-122.2874,37.686),(-122.2872,37.669)]'),
+('Bruce Ct', '[(-122.0595,37.084),(-122.0588,37.076)]'),
+('Bruce Dr', '[(-121.9442,37.309),(-121.945,37.312)]'),
+('Brunetti Lane', '[(-122.136,37.91),(-122.1351,37.906)]'),
+('Bruns Road', '[(-121.603992,37.95307),(-121.6046,37.049)]'),
+('Brush St', '[(-122.2788,37.065),(-122.2784,37.07)]'),
+('Brush St', '[(-122.283,37.989),(-122.2827,37.994)]'),
+('Brush Ramp St', '[(-122.2758,37.107),(-122.27511,37.11304),(-122.275,37.114)]'),
+('Bryant St', '[(-121.9216,37.321),(-121.9213,37.316)]'),
+('Bryce Canyon Ct', '[(-121.9008,37.78),(-121.9017,37.78)]'),
+('Buchanan St', '[(-122.3022,37.877),(-122.3014,37.878)]'),
+('Buckeye Pl', '[(-122.0448,37.336),(-122.0452,37.332)]'),
+('Buckingham Blvd', '[(-122.2231,37.59),(-122.2214,37.606)]'),
+('Buckingham Way', '[(-122.0647,37.214),(-122.0653,37.214)]'),
+('Buckingham Way', '[(-122.0689,37.208),(-122.0693,37.207)]'),
+('Buckner Ter', '[(-122.060105,37.62504),(-122.059743,37.62326)]'),
+('Bucks Lake St', '[(-122.0559,37.882),(-122.0546,37.874)]'),
+('Buckskin Road', '[(-121.7421,37.213),(-121.7421,37.22)]'),
+('Budwing Ter', '[(-121.9516,37.136),(-121.951826,37.13555)]'),
+('Buena Ave', '[(-122.2786,37.792),(-122.2773,37.797)]'),
+('Buena Ave', '[(-122.2813,37.781),(-122.2807,37.782)]'),
+('Buena Vista Ave', '[(-122.2301,37.437),(-122.2295,37.424)]'),
+('Buena Vista Ave', '[(-122.2337,37.651),(-122.2328,37.645)]'),
+('Buena Vista Ave', '[(-122.2359,37.47),(-122.2353,37.468)]'),
+('Buena Vista Ave', '[(-122.251,37.735),(-122.2499,37.73)]'),
+('Buena Vista Ave', '[(-122.2687,37.774),(-122.2673,37.773)]'),
+('Buena Vista Ave', '[(-122.271,37.774),(-122.2698,37.774)]'),
+('Buena Vista Way', '[(-122.2609,37.805),(-122.2597,37.809)]'),
+('Bullard Dr', '[(-122.2157,37.297),(-122.2138,37.276)]'),
+('Bullard St', '[(-121.9694,37.355),(-121.97,37.349)]'),
+('Burdeck Dr', '[(-122.1939,37.099),(-122.1932,37.091)]'),
+('Burdette St', '[(-121.9789,37.609),(-121.9795,37.611)]'),
+('Burdette St', '[(-121.98,37.62),(-121.9801,37.626)]'),
+('Burdick St', '[(-122.0273,37.421),(-122.0266,37.418)]'),
+('Burk St', '[(-122.2501,37.101),(-122.2502,37.106)]'),
+('Burkhart Ave', '[(-122.1422,37.856),(-122.1431,37.859)]'),
+('Burlington St', '[(-122.2046,37.057),(-122.2042,37.058)]'),
+('Burnett St', '[(-122.2823,37.539),(-122.281,37.541)]'),
+('Burnham Way', '[(-121.9242,37.176),(-121.9243,37.183)]'),
+('Burnside Ct', '[(-122.0063,37.345),(-122.0069,37.338)]'),
+('Busby Ave', '[(-122.1545,37.79),(-122.154983,37.78916)]'),
+('Butte Ct', '[(-121.783,37.938),(-121.783,37.934)]'),
+('Butterfield Dr', '[(-122.0838,37.002),(-122.0834,37.987)]'),
+('C St', '[(-122.0218,37.05),(-122.0224,37.045)]'),
+('C St', '[(-122.0737,37.767),(-122.0722,37.778)]'),
+('C St', '[(-122.0773,37.742),(-122.0756,37.754)]'),
+('C St', '[(-122.0906,37.681),(-122.0896,37.684)]'),
+('C St', '[(-122.1737,37.418),(-122.1723,37.399),(-122.1716,37.393)]'),
+('C St', '[(-122.1768,37.46),(-122.1749,37.435)]'),
+('Cabello St', '[(-122.078,37.811),(-122.0783,37.807)]'),
+('Cabernet Ct', '[(-121.8636,37.593),(-121.8641,37.582)]'),
+('Cabot Blvd', '[(-122.1334,37.412),(-122.1326,37.399)]'),
+('Cabot Ct', '[(-121.9848,37.583),(-121.9833,37.583)]'),
+('Cabral Dr', '[(-122.0294,37.569),(-122.0288,37.563)]'),
+('Cabral Dr', '[(-122.0348,37.648),(-122.035,37.643)]'),
+('Cabrillo Dr', '[(-122.0153,37.515),(-122.0144,37.511)]'),
+('Cabrillo Dr', '[(-122.0325,37.637),(-122.0318,37.633)]'),
+('Cabrillo Dr', '[(-122.091,37.218),(-122.0932,37.222)]'),
+('Cadiz Dr', '[(-122.0239,37.655),(-122.0235,37.653)]'),
+('Calaroga Ave', '[(-122.0886,37.297),(-122.0885,37.276)]'),
+('Calaroga Ave', '[(-122.0892,37.374),(-122.0888,37.361)]'),
+('Calaroga Ave', '[(-122.09,37.386),(-122.0897,37.38)]'),
+('Calaroga Ave', '[(-122.101,37.493),(-122.1006,37.487)]'),
+('Calaveras Ave', '[(-121.9924,37.364),(-121.9927,37.359)]'),
+('Calaveras Ave', '[(-122.1864,37.845),(-122.1854,37.841)]'),
+('Calaveras Road', '[(-121.8389,37.143),(-121.8338,37.128)]'),
+('Calaveras Road', '[(-121.8476,37.209),(-121.8431,37.178)]'),
+('Calaveras Creek', '[(-121.8203,37.035),(-121.8207,37.931)]'),
+('Calaveras Creek', '[(-121.8531,37.337),(-121.8517,37.316)]'),
+('Calaveras Creek', '[(-121.8637,37.611),(-121.8628,37.587)]'),
+('Calcott Ct', '[(-122.0306,37.822),(-122.0311,37.817)]'),
+('Caldecott Lane', '[(-122.2312,37.512),(-122.2261,37.491)]'),
+('Calhoun St', '[(-122.0542,37.43),(-122.0521,37.428)]'),
+('Calhoun St', '[(-122.2409,37.553),(-122.2405,37.551)]'),
+('Caliban Dr', '[(-122.0553,37.765),(-122.053955,37.75806)]'),
+('Caliente Dr', '[(-122.1393,37.993),(-122.1409,37.99),(-122.1417,37.993)]'),
+('California St', '[(-122.1952,37.942),(-122.1946,37.935)]'),
+('California St', '[(-122.2032,37.005),(-122.2016,37.996)]'),
+('California St', '[(-122.2767,37.563),(-122.2767,37.554)]'),
+('California St', '[(-122.2791,37.698),(-122.2787,37.681)]'),
+('California St', '[(-122.2793,37.743),(-122.2794,37.733)]'),
+('California St', '[(-122.2795,37.761),(-122.2795,37.751)]'),
+('California Aqueduct', '[(-121.587742,37.65201),(-121.600239,37.70939)]'),
+('California Aqueduct', '[(-121.622944,37.98443),(-121.622669,37.98611)]'),
+('Call Ave', '[(-122.0435,37.56),(-122.0436,37.566)]'),
+('Calle Alegre', '[(-121.895178,37.71975),(-121.8946,37.725)]'),
+('Calle Altamira', '[(-121.8994,37.669),(-121.8988,37.656)]'),
+('Calle de la Mesa', '[(-121.905106,37.71532),(-121.906643,37.69977)]'),
+('Calle de Monte', '[(-122.2452,37.344),(-122.2456,37.34)]'),
+('Calle Morelia', '[(-121.9003,37.684),(-121.9006,37.691)]'),
+('Calmar Ave', '[(-122.2384,37.105),(-122.2381,37.113)]'),
+('Camanoe Lane', '[(-122.2339,37.33),(-122.2334,37.326)]'),
+('Cambio Ct', '[(-122.0217,37.558),(-122.0226,37.552)]'),
+('Cambridge Ave', '[(-122.1616,37.335),(-122.1575,37.353)]'),
+('Cambridge Way', '[(-122.2442,37.231),(-122.2419,37.244)]'),
+('Camden St', '[(-121.9932,37.571),(-121.992,37.564)]'),
+('Camden St', '[(-121.9956,37.603),(-121.9955,37.598)]'),
+('Camden St', '[(-122.1823,37.735),(-122.1817,37.73)]'),
+('Camelford Pl', '[(-122.1933,37.211),(-122.1919,37.216)]'),
+('Camelia Dr', '[(-121.7852,37.695),(-121.7852,37.686)]'),
+('Camelia St', '[(-122.2928,37.792),(-122.2916,37.792)]'),
+('Camero Pl', '[(-121.9461,37.463),(-121.9453,37.454)]'),
+('Camero Way', '[(-121.9481,37.459),(-121.9488,37.456)]'),
+('Cameron Ave', '[(-121.86732,37.8431),(-121.865836,37.84371)]'),
+('Cameron Ave', '[(-122.1316,37.502),(-122.1327,37.481)]'),
+('Camino del Valle', '[(-122.2431,37.343),(-122.2437,37.334)]'),
+('Camino Santa Barbara', '[(-121.9314,37.446),(-121.9303,37.436)]'),
+('Camino Segura', '[(-121.900094,37.71647),(-121.9002,37.726)]'),
+('Campbell St', '[(-122.2941,37.123),(-122.2936,37.129)]'),
+('Campbell St', '[(-122.2985,37.066),(-122.2981,37.077)]'),
+('Campus Dr', '[(-122.0578,37.665),(-122.0545,37.66)]'),
+('Campus Dr', '[(-122.1626,37.858),(-122.1611,37.843)]'),
+('Campus Dr', '[(-122.1704,37.905),(-122.1678,37.868),(-122.1671,37.865)]'),
+('Canary Ct', '[(-122.019,37.856),(-122.0192,37.85)]'),
+('Canfield Dr', '[(-121.9952,37.488),(-121.9955,37.482)]'),
+('Canon Ave', '[(-122.21715,37.01951),(-122.2151,37.053)]'),
+('Canterbury Lane', '[(-121.9277,37.141),(-121.9276,37.149)]'),
+('Canterbury St', '[(-121.995,37.573),(-121.9948,37.57)]'),
+('Canyon Heights Dr', '[(-121.9431,37.568),(-121.9433,37.571)]'),
+('Canyon Heights Dr', '[(-121.9513,37.618),(-121.9528,37.627)]'),
+('Canyon Heights Dr', '[(-121.9595,37.76),(-121.9596,37.753)]'),
+('Cape Cod Dr', '[(-122.1351,37.928),(-122.1331,37.928)]'),
+('Capella Lane', '[(-122.2345,37.322),(-122.2352,37.326)]'),
+('Capitan Dr', '[(-121.84488,37.65695),(-121.84458,37.65195)]'),
+('Capricorn Ave', '[(-122.2176,37.404),(-122.2164,37.384)]'),
+('Capulet Cir', '[(-122.057612,37.69268),(-122.0578,37.7)]'),
+('Cardinal Dr', '[(-121.7865,37.805),(-121.7858,37.805)]'),
+('Caribbean Com', '[(-122.0361,37.73),(-122.0366,37.724)]'),
+('Carleton St', '[(-122.2641,37.617),(-122.2619,37.62)]'),
+('Carlos Bee Blvd', '[(-122.065049,37.59928),(-122.0639,37.596)]'),
+('Carlston Ave', '[(-122.23,37.132),(-122.2307,37.141)]'),
+('Carmel Ave', '[(-122.2891,37.979),(-122.2893,37.968),(-122.2893,37.95)]'),
+('Carmel Dr', '[(-122.0965,37.135),(-122.0958,37.133)]'),
+('Carmel Way', '[(-122.1394,37.979),(-122.1386,37.98)]'),
+('Carmel Way', '[(-122.1419,37.98),(-122.1411,37.98)]'),
+('Carmen St', '[(-121.9501,37.38),(-121.9484,37.369)]'),
+('Carnation Way', '[(-121.9975,37.775),(-121.996,37.773)]'),
+('Carol Ave', '[(-121.9537,37.283),(-121.955,37.282)]'),
+('Carol Ave', '[(-121.9574,37.279),(-121.959,37.277)]'),
+('Carol Ave', '[(-121.9657,37.27),(-121.9679,37.268)]'),
+('Caroline St', '[(-122.2676,37.695),(-122.2676,37.706)]'),
+('Carolyn St', '[(-122.1108,37.038),(-122.1091,37.028)]'),
+('Carpentier St', '[(-122.1567,37.203),(-122.1561,37.194)]'),
+('Carriage Circle Com', '[(-122.0128,37.433),(-122.0129,37.431)]'),
+('Carrol Road', '[(-121.659839,37.19494),(-121.659626,37.19326)]'),
+('Carson St', '[(-122.1846,37.9),(-122.1843,37.901)]'),
+('Carver Lane', '[(-121.877,37.057),(-121.8811,37.068)]'),
+('Cascade Road', '[(-122.1832,37.241),(-122.1808,37.216)]'),
+('Cascade St', '[(-122.0839,37.416),(-122.0831,37.416)]'),
+('Cascade St', '[(-122.0894,37.448),(-122.0887,37.431)]'),
+('Cassiopia St', '[(-121.735979,37.18311),(-121.735979,37.19069)]'),
+('Castilian Road', '[(-121.9447,37.135),(-121.9445,37.14)]'),
+('Castille Lane', '[(-122.0826,37.811),(-122.082655,37.8124)]'),
+('Castillejo Road', '[(-121.9397,37.313),(-121.9396,37.304)]'),
+('Castle Park Way', '[(-122.1936,37.15),(-122.1933,37.151)]'),
+('Castlewood Dr', '[(-121.8895,37.376),(-121.8902,37.373)]'),
+('Castro St', '[(-122.1629,37.144),(-122.1636,37.141)]'),
+('Castro St', '[(-122.2739,37.114),(-122.2735,37.121)]'),
+('Castro St', '[(-122.2749,37.1),(-122.2746,37.103)]'),
+('Castro St', '[(-122.2757,37.084),(-122.2753,37.091)]'),
+('Castro St', '[(-122.2782,37.045),(-122.2778,37.052)]'),
+('Castro St', '[(-122.2787,37.03),(-122.2785,37.038)]'),
+('Castro Valley Blvd', '[(-122.0478,37.966),(-122.047,37.969)]'),
+('Castro Valley Blvd', '[(-122.049131,37.96068),(-122.048358,37.96377)]'),
+('Castro Valley Blvd', '[(-122.0604,37.92),(-122.0585,37.925)]'),
+('Castro Valley Blvd', '[(-122.081,37.954),(-122.0801,37.955)]'),
+('Castro Valley Blvd', '[(-122.086,37.939),(-122.0853,37.942)]'),
+('Catalina Ave', '[(-122.2458,37.329),(-122.246102,37.33109)]'),
+('Catalina Dr', '[(-121.7837,37.628),(-121.7834,37.628)]'),
+('Catalina Dr', '[(-121.7892,37.66),(-121.7896,37.649)]'),
+('Catalpa Way', '[(-122.0852,37.218),(-122.088,37.207)]'),
+('Cato Ct', '[(-122.0691,37.944),(-122.0694,37.938)]'),
+('Catron Dr', '[(-122.1716,37.27),(-122.1711,37.275)]'),
+('Cavalier Lane', '[(-121.9361,37.175),(-121.9363,37.189)]'),
+('Cavendish Dr', '[(-122.0477,37.158),(-122.0475,37.151)]'),
+('Cavour St', '[(-122.2555,37.375),(-122.2561,37.379)]'),
+('Cayuga Pl', '[(-121.9205,37.023),(-121.9218,37.02)]'),
+('Cayuga Way', '[(-121.9233,37.013),(-121.9239,37.008)]'),
+('Cedar Blvd', '[(-122.0214,37.402),(-122.0193,37.391)]'),
+('Cedar Blvd', '[(-122.0282,37.446),(-122.0265,37.43)]'),
+('Cedar Dr', '[(-121.7964,37.859),(-121.7941,37.858),(-121.7931,37.858)]'),
+('Cedar Lane', '[(-121.9173,37.08),(-121.9183,37.083),(-121.9196,37.089),(-121.92,37.098)]'),
+('Cedar St', '[(-121.9188,37.277),(-121.92,37.276)]'),
+('Cedar St', '[(-122.260055,37.79558),(-122.2582,37.798)]'),
+('Cedar St', '[(-122.2841,37.764),(-122.2818,37.766)]'),
+('Cedar St', '[(-122.2864,37.76),(-122.2858,37.762)]'),
+('Cedar St', '[(-122.2913,37.755),(-122.2905,37.756)]'),
+('Cedar St', '[(-122.2945,37.75),(-122.2934,37.753)]'),
+('Cedar St', '[(-122.3011,37.737),(-122.2999,37.739)]'),
+('Cedar St', '[(-122.3043,37.729),(-122.3032,37.732)]'),
+('Cedar St', '[(-122.3045,37.078),(-122.3041,37.087)]'),
+('Cedarwood Lane', '[(-121.8746,37.706),(-121.8746,37.721)]'),
+('Celia St', '[(-122.0611,37.3),(-122.0616,37.299)]'),
+('Celia St', '[(-122.0623,37.297),(-122.0631,37.296)]'),
+('Center St', '[(-122.0598,37.052),(-122.0593,37.046)]'),
+('Center St', '[(-122.0599,37.111),(-122.06,37.106)]'),
+('Center St', '[(-122.0606,37.968),(-122.0608,37.958)]'),
+('Center St', '[(-122.2674,37.704),(-122.267,37.704)]'),
+('Central Ave', '[(-122.0064,37.524),(-122.0079,37.505)]'),
+('Central Ave', '[(-122.0118,37.455),(-122.0129,37.443)]'),
+('Central Ave', '[(-122.0148,37.415),(-122.0157,37.404)]'),
+('Central Ave', '[(-122.0302,37.226),(-122.0325,37.196)]'),
+('Central Ave', '[(-122.0487,37.144),(-122.0452,37.158)]'),
+('Central Ave', '[(-122.2309,37.579),(-122.2276,37.557)]'),
+('Central Ave', '[(-122.2343,37.602),(-122.2331,37.595)]'),
+('Central Ave', '[(-122.27,37.715),(-122.2685,37.714)]'),
+('Central Ave', '[(-122.2787,37.718),(-122.2777,37.717),(-122.2762,37.717)]'),
+('Central Ave', '[(-122.2906,37.769),(-122.2905,37.756)]'),
+('Central Blvd', '[(-122.0643,37.553),(-122.0633,37.552),(-122.0622,37.545)]'),
+('Central Blvd', '[(-122.0703,37.582),(-122.0697,37.586)]'),
+('Cerrito St', '[(-122.3023,37.93),(-122.3018,37.918)]'),
+('Cerro Vista Pl', '[(-121.73402,37.74008),(-121.735461,37.73955)]'),
+('Chabolyn Ter', '[(-122.242959,37.5192),(-122.2429,37.519)]'),
+('Chabot Ct', '[(-122.2432,37.489),(-122.2439,37.5)]'),
+('Chabot Canal', '[(-121.9027,37.804),(-121.9027,37.812)]'),
+('Chabot Canal', '[(-121.9036,37.013),(-121.9044,37.017)]'),
+('Chabot Canal', '[(-121.9044,37.017),(-121.9037,37.02)]'),
+('Chabot Crest', '[(-122.2425,37.504),(-122.2427,37.514)]'),
+('Chambers Dr', '[(-122.2004,37.352),(-122.1972,37.368)]'),
+('Chambers Lane', '[(-122.2001,37.359),(-122.1975,37.371)]'),
+('Champagne Pl', '[(-121.950378,37.11376),(-121.949579,37.11174)]'),
+('Champion St', '[(-122.214,37.991),(-122.2147,37.002)]'),
+('Champion St', '[(-122.2146,37.977),(-122.2145,37.982)]'),
+('Chance St', '[(-122.0536,37.259),(-122.0534,37.256)]'),
+('Chandler Road', '[(-122.10851,37.48139),(-122.108787,37.48677)]'),
+('Channel St', '[(-122.1372,37.71),(-122.1369,37.706)]'),
+('Channing Way', '[(-122.2453,37.425),(-122.2466,37.408)]'),
+('Channing Way', '[(-122.2638,37.664),(-122.2629,37.665),(-122.2606,37.669)]'),
+('Channing Way', '[(-122.2695,37.657),(-122.2669,37.66)]'),
+('Channing Way', '[(-122.2727,37.652),(-122.2717,37.653)]'),
+('Channing Way', '[(-122.2806,37.641),(-122.2795,37.641)]'),
+('Channing Way', '[(-122.2842,37.636),(-122.2835,37.637)]'),
+('Channing Way', '[(-122.292641,37.62357),(-122.2925,37.624)]'),
+('Chapel Ct', '[(-122.1508,37.897),(-122.1508,37.894)]'),
+('Chapman Dr', '[(-122.0421,37.504),(-122.0414,37.498)]'),
+('Chardonnay Dr', '[(-121.846993,37.64201),(-121.846448,37.64146)]'),
+('Charles St', '[(-122.0255,37.505),(-122.0252,37.499)]'),
+('Charlotte Way', '[(-121.7247,37.839),(-121.7246,37.836)]'),
+('Charlotte Way', '[(-121.7261,37.856),(-121.7254,37.851)]'),
+('Charlotte Way', '[(-121.733871,37.88044),(-121.734295,37.88051)]'),
+('Charter Oaks Dr', '[(-122.0574,37.212),(-122.0568,37.22)]'),
+('Chateau Way', '[(-121.7627,37.727),(-121.7627,37.723)]'),
+('Chateau Park Ct', '[(-121.9658,37.196),(-121.966,37.193)]'),
+('Chatsworth St', '[(-121.7766,37.502),(-121.7766,37.496)]'),
+('Chaucer Dr', '[(-122.0339,37.813),(-122.0342,37.812)]'),
+('Chaucer Dr', '[(-122.0357,37.794),(-122.0362,37.788)]'),
+('Chelsea Dr', '[(-122.03044,37.5228),(-122.0303,37.522)]'),
+('Chelsea Way', '[(-122.068,37.224),(-122.0686,37.223)]'),
+('Chelton Dr', '[(-122.189,37.293),(-122.1887,37.304)]'),
+('Chemult Com', '[(-121.9254,37.878),(-121.9255,37.881)]'),
+('Cherry Lane', '[(-121.966799,37.63085),(-121.966874,37.63373)]'),
+('Cherry St', '[(-122.0266,37.297),(-122.0258,37.294)]'),
+('Cherry St', '[(-122.040954,37.37918),(-122.04,37.369)]'),
+('Cherry St', '[(-122.0429,37.396),(-122.0424,37.392)]'),
+('Cherry St', '[(-122.0437,37.42),(-122.0434,37.413)]'),
+('Cherry St', '[(-122.1511,37.161),(-122.1503,37.149)]'),
+('Cherry St', '[(-122.1671,37.488),(-122.1661,37.474)]'),
+('Cherry St', '[(-122.1691,37.512),(-122.1684,37.502)]'),
+('Cherrywood Dr', '[(-122.023,37.838),(-122.0237,37.82)]'),
+('Cheryl Cir', '[(-121.8979,37.8),(-121.8957,37.794)]'),
+('Cheryl Ann Cir', '[(-122.0754,37.352),(-122.076,37.358)]'),
+('Chester St', '[(-122.0791,37.955),(-122.079,37.932)]'),
+('Chester St', '[(-122.2949,37.07),(-122.2946,37.078)]'),
+('Chestnut St', '[(-122.2482,37.733),(-122.2475,37.742)]'),
+('Chestnut St', '[(-122.2853,37.069),(-122.2848,37.084)]'),
+('Chestnut St', '[(-122.2873,37.722),(-122.2873,37.711)]'),
+('Chetwood Ave', '[(-121.9591,37.232),(-121.960057,37.23087)]'),
+('Chetwood St', '[(-122.2521,37.167),(-122.2513,37.169)]'),
+('Cheyenne River Com', '[(-122.0521,37.779),(-122.0524,37.775)]'),
+('Chiltern Dr', '[(-121.9414,37.433),(-121.9412,37.424)]'),
+('Chiltern Dr', '[(-121.9447,37.457),(-121.9442,37.454)]'),
+('Chimney Rock', '[(-122.13,37.701),(-122.12905,37.70195)]'),
+('Chippendale Dr', '[(-122.0665,37.843),(-122.068,37.828)]'),
+('Chisholm Ct', '[(-122.0773,37.42),(-122.077,37.409)]'),
+('Choctaw Dr', '[(-121.9179,37.87),(-121.9172,37.876)]'),
+('Chris Commons', '[(-121.73647,37.89437),(-121.736359,37.88665)]'),
+('Chrisholm Pl', '[(-121.9599,37.726),(-121.9592,37.732)]'),
+('Christensen Ct', '[(-122.0863,37.074),(-122.0863,37.065)]'),
+('Christensen Lane', '[(-122.085026,37.06463),(-122.0844,37.064)]'),
+('Christensen Road', '[(-121.625309,37.79774),(-121.621265,37.83993)]'),
+('Christina Ct', '[(-121.8654,37.629),(-121.8651,37.616)]'),
+('Christine Dr', '[(-122.0759,37.739),(-122.0756,37.734)]'),
+('Christine St', '[(-122.0364,37.385),(-122.0357,37.379)]'),
+('Christy St', '[(-121.9662,37.022),(-121.9658,37.019)]'),
+('Church St', '[(-122.179,37.675),(-122.1785,37.678)]'),
+('Cindy Lane', '[(-121.7346,37.8244),(-121.734673,37.83042)]'),
+('Circle Way', '[(-121.9418,37.013),(-121.9422,37.02)]'),
+('Citron Way', '[(-122.1008,37.461),(-122.1017,37.46)]'),
+('Civic Terrace Ave', '[(-122.0251,37.389),(-122.0263,37.374)]'),
+('Clara St', '[(-122.1855,37.377),(-122.1851,37.381)]'),
+('Clara St', '[(-122.187,37.339),(-122.1865,37.357)]'),
+('Claremont Ave', '[(-122.2429,37.607),(-122.2421,37.609)]'),
+('Claremont Ave', '[(-122.243294,37.59318),(-122.2434,37.59)]'),
+('Claremont Ave', '[(-122.246,37.565),(-122.2461,37.562)]'),
+('Claremont Ave', '[(-122.2508,37.509),(-122.2505,37.514)]'),
+('Claremont Ave', '[(-122.2591,37.408),(-122.2586,37.413)]'),
+('Claremont Ave', '[(-122.2612,37.386),(-122.2604,37.393)]'),
+('Claremont Pl', '[(-122.0542,37.995),(-122.0542,37.008)]'),
+('Clarendon Cres', '[(-122.2278,37.126),(-122.2266,37.119)]'),
+('Claret Road', '[(-121.757012,37.72568),(-121.757266,37.71391)]'),
+('Clarewood Lane', '[(-122.2343,37.393),(-122.232365,37.38802)]'),
+('Clarke Lane', '[(-122.236271,37.29202),(-122.236552,37.28906)]'),
+('Clarke St', '[(-122.1568,37.225),(-122.1562,37.217)]'),
+('Clausen Ct', '[(-122.040846,37.6758),(-122.040845,37.66913)]'),
+('Clawiter Road', '[(-122.1186,37.321),(-122.1186,37.308)]'),
+('Clawiter Road', '[(-122.1187,37.442),(-122.1188,37.435)]'),
+('Clay St', '[(-122.2733,37.051),(-122.2729,37.059)]'),
+('Clay St', '[(-122.2755,37.017),(-122.2751,37.024)]'),
+('Clement Ave', '[(-122.2525,37.765),(-122.252147,37.76429)]'),
+('Cleveland Ave', '[(-122.3061,37.895),(-122.3058,37.889)]'),
+('Cleveland St', '[(-122.2435,37.048),(-122.2418,37.042)]'),
+('Clifton St', '[(-122.2526,37.383),(-122.2533,37.388)]'),
+('Clipper Dr', '[(-122.2438,37.42),(-122.2437,37.406)]'),
+('Clover St', '[(-122.023,37.805),(-122.0217,37.801)]'),
+('Clubhouse Dr', '[(-121.8179,37.971),(-121.8181,37.972)]'),
+('Clubhouse Dr', '[(-122.121,37.67),(-122.1215,37.671)]'),
+('Clubhouse Dr', '[(-122.1227,37.671),(-122.1234,37.67)]'),
+('Cluny Pl', '[(-122.0438,37.432),(-122.0433,37.432)]'),
+('Coach Dr', '[(-122.1383,37.735),(-122.1355,37.706)]'),
+('Cobblestone Dr', '[(-122.00122,37.8492),(-122.000944,37.84795)]'),
+('Coco Palm Dr', '[(-121.9905,37.311),(-121.991,37.305)]'),
+('Codornices Creek', '[(-122.2986,37.83),(-122.2994,37.828)]'),
+('Codornices Creek', '[(-122.3069,37.818),(-122.3074,37.817)]'),
+('Cody Ct', '[(-121.9853,37.324),(-121.986,37.316)]'),
+('Coit Ave', '[(-121.9244,37.346),(-121.9244,37.338)]'),
+('Coit Ave', '[(-121.9245,37.352),(-121.924594,37.362)]'),
+('Colby St', '[(-122.1282,37.959),(-122.1279,37.959)]'),
+('Cold Water Dr', '[(-122.0403,37.068),(-122.041,37.069)]'),
+('Cole Pl', '[(-122.057,37.343),(-122.0564,37.334)]'),
+('Cole St', '[(-122.1974,37.724),(-122.1975,37.716)]'),
+('Cole St', '[(-122.1975,37.749),(-122.1962,37.76)]'),
+('Coleen St', '[(-121.79,37.763),(-121.7892,37.744)]'),
+('Coleport Landing', '[(-122.2374,37.426),(-122.2378,37.42)]'),
+('Coleport Landing', '[(-122.237889,37.41293),(-122.2379,37.412)]'),
+('Colette St', '[(-122.063,37.46),(-122.0623,37.451)]'),
+('Colette St', '[(-122.06565,37.4825),(-122.0646,37.479)]'),
+('Colgate Dr', '[(-122.0271,37.94),(-122.0249,37.933)]'),
+('Colgate St', '[(-122.1545,37.019),(-122.1538,37.014)]'),
+('Colima Ct', '[(-122.0251,37.664),(-122.0245,37.661)]'),
+('Coliseum Way', '[(-122.19759,37.4533),(-122.1948,37.444)]'),
+('Coliseum Way', '[(-122.2001,37.47),(-122.1978,37.516)]'),
+('Coliseum Way', '[(-122.2113,37.626),(-122.2085,37.592),(-122.2063,37.568)]'),
+('College Ave', '[(-121.7675,37.745),(-121.7658,37.745)]'),
+('College Ave', '[(-121.7693,37.744),(-121.769,37.744)]'),
+('College Ave', '[(-122.2506,37.367),(-122.2508,37.374)]'),
+('College Ave', '[(-122.2511,37.421),(-122.2512,37.429)]'),
+('College Ave', '[(-122.2516,37.474),(-122.2518,37.483)]'),
+('Collier Dr', '[(-122.1409,37.299),(-122.14,37.302)]'),
+('Colonial Loma Verde Dr', '[(-122.1184,37.849),(-122.117278,37.85528)]'),
+('Colony Ct', '[(-122.061894,37.27773),(-122.061805,37.27497)]'),
+('Colorados Dr', '[(-122.1757,37.281),(-122.1748,37.301)]'),
+('Columbia Dr', '[(-122.0574,37.168),(-122.0568,37.183)]'),
+('Columbia Dr', '[(-122.057463,37.28811),(-122.057463,37.28593)]'),
+('Columbian Dr', '[(-122.1635,37.727),(-122.1627,37.734)]'),
+('Columbine Pl', '[(-122.0122,37.321),(-122.013,37.33)]'),
+('Columbus Ave', '[(-121.776,37.679),(-121.7753,37.682)]'),
+('Columbus Ave', '[(-121.7786,37.68),(-121.7777,37.681)]'),
+('Colusa Ave', '[(-122.2786,37.835),(-122.2784,37.831)]'),
+('Colusa Ave', '[(-122.2794,37.922),(-122.2793,37.916)]'),
+('Colusa Ave', '[(-122.2812,37.943),(-122.2805,37.939)]'),
+('Colusa Ave', '[(-122.2847,37.973),(-122.2846,37.967)]'),
+('Colville Pl', '[(-122.0419,37.709),(-122.0402,37.702)]'),
+('Concannon Blvd', '[(-121.7804,37.608),(-121.779,37.608)]'),
+('Concord St', '[(-121.8551,37.602),(-121.856,37.593)]'),
+('Constitution Dr', '[(-121.816179,37.01178),(-121.816179,37.01023)]'),
+('Contra Costa Ave', '[(-122.0153,37.551),(-122.0141,37.545)]'),
+('Contra Costa Ave', '[(-122.2754,37.944),(-122.2754,37.918)]'),
+('Contreras Pl', '[(-122.0386,37.553),(-122.0387,37.55)]'),
+('Conway Ter', '[(-122.044884,37.64441),(-122.04466,37.64514)]'),
+('Coolidge Ave', '[(-122.2007,37.058),(-122.1992,37.06)]'),
+('Coolidge Ave', '[(-122.2104,37.957),(-122.2099,37.962)]'),
+('Coolidge Ave', '[(-122.2171,37.872),(-122.2169,37.875)]'),
+('Coral Road', '[(-122.1907,37.34),(-122.1902,37.334)]'),
+('Core Ter', '[(-122.047353,37.65391),(-122.047303,37.65185)]'),
+('Corey Way', '[(-122.0699,37.054),(-122.0698,37.046)]'),
+('Cormorant Ter', '[(-122.045468,37.80753),(-122.044829,37.80392)]'),
+('Cornell Ave', '[(-122.2956,37.925),(-122.2949,37.906),(-122.2939,37.875)]'),
+('Corning Ct', '[(-122.0689,37.688),(-122.0685,37.68)]'),
+('Cornish Dr', '[(-122.0228,37.75),(-122.0225,37.754)]'),
+('Coronado Lane', '[(-121.9026,37.843),(-121.9028,37.843)]'),
+('Corral Hollow Creek', '[(-121.590572,37.01116),(-121.599735,37.10676)]'),
+('Corriea Way', '[(-121.9501,37.402),(-121.9505,37.398)]'),
+('Corte de Flores', '[(-121.908126,37.71073),(-121.90924,37.71391)]'),
+('Corte Eulalia', '[(-122.1142,37.78),(-122.1154,37.776)]'),
+('Corte Munras', '[(-121.900576,37.74452),(-121.900804,37.74889)]'),
+('Corte Vera Cruz', '[(-121.9036,37.639),(-121.9038,37.642)]'),
+('Corte Yolanda', '[(-122.1426,37.753),(-122.1423,37.749)]'),
+('Cortland Way', '[(-121.7892,37.934),(-121.7885,37.939)]'),
+('Corvair St', '[(-122.2126,37.364),(-122.2132,37.36)]'),
+('Corvallis St', '[(-122.1527,37.974),(-122.1521,37.97)]'),
+('Cosgrave Ave', '[(-122.1621,37.62),(-122.1616,37.626)]'),
+('Cosmic Way', '[(-121.9659,37.423),(-121.9666,37.414)]'),
+('Cottage St', '[(-122.2593,37.713),(-122.258931,37.71803)]'),
+('Cotter Way', '[(-122.0904,37.818),(-122.0882,37.829)]'),
+('Cotton Ct', '[(-122.0462,37.123),(-122.0469,37.117)]'),
+('Cottonwood St', '[(-121.9116,37.732),(-121.9115,37.725)]'),
+('Cottonwood St', '[(-121.912,37.74),(-121.9118,37.735)]'),
+('Country Dr', '[(-121.9903,37.52),(-121.9916,37.506)]'),
+('Court St', '[(-122.2331,37.583),(-122.2324,37.589),(-122.2314,37.598)]'),
+('Courtland Ave', '[(-122.2041,37.801),(-122.2032,37.815)]'),
+('Courtland Ave', '[(-122.2084,37.76),(-122.2068,37.772)]'),
+('Cove Road', '[(-122.2468,37.425),(-122.2474,37.408)]'),
+('Covington Way', '[(-121.7935,37.936),(-121.7911,37.942)]'),
+('Cowing Road', '[(-122.0002,37.934),(-121.9772,37.782)]'),
+('Cowper St', '[(-122.2908,37.673),(-122.2894,37.675)]'),
+('Coyote Hills Slough', '[(-122.0904,37.85),(-122.0953,37.829)]'),
+('Coyote Hills Slough', '[(-122.1075,37.687),(-122.1285,37.643)]'),
+('Coyote River', '[(-121.931582,37.60707),(-121.932309,37.60824)]'),
+('Coyote River', '[(-121.9505,37.629),(-121.9582,37.646)]'),
+('Coyote River', '[(-121.9746,37.617),(-121.9863,37.648)]'),
+('Cragmont Ave', '[(-122.2616,37.921),(-122.2603,37.911)]'),
+('Cragmont Ave', '[(-122.266,37.95),(-122.2656,37.943)]'),
+('Craig St', '[(-121.9869,37.61),(-121.9864,37.601)]'),
+('Crane Ave', '[(-122.0578,37.103),(-122.058,37.086)]'),
+('Creed Road', '[(-122.2249,37.094),(-122.2256,37.101)]'),
+('Creekside Dr', '[(-121.924308,37.89385),(-121.925368,37.89008)]'),
+('Creekside Dr', '[(-121.926024,37.88774),(-121.926337,37.88663)]'),
+('Creekside Ter', '[(-121.997958,37.64593),(-121.998047,37.63504)]'),
+('Creekwood Dr', '[(-122.043309,37.66911),(-122.041422,37.66099)]'),
+('Crellin Road', '[(-121.846446,37.59189),(-121.846,37.591),(-121.845775,37.59073)]'),
+('Crest Ave', '[(-122.1039,37.067),(-122.1038,37.066)]'),
+('Crest Ave', '[(-122.162,37.699),(-122.1568,37.664)]'),
+('Crest Ct', '[(-122.0566,37.049),(-122.0571,37.05)]'),
+('Crest Lane', '[(-122.0558,37.047),(-122.0546,37.047)]'),
+('Crest Road', '[(-122.2149,37.216),(-122.2153,37.221)]'),
+('Crestline Road', '[(-121.887,37.789),(-121.8846,37.793)]'),
+('Crestmont Dr', '[(-122.1775,37.029),(-122.1798,37.044)]'),
+('Creston Road', '[(-122.2639,37.002),(-122.2613,37.986),(-122.2602,37.978),(-122.2598,37.973)]'),
+('Crestwood St', '[(-121.9589,37.159),(-121.961,37.156)]'),
+('Crisfield Lane', '[(-121.871,37.814),(-121.8718,37.813)]'),
+('Crocker Ave', '[(-122.2242,37.186),(-122.2243,37.171)]'),
+('Crockwood Ter', '[(-122.045255,37.66569),(-122.045487,37.66262)]'),
+('Cromwell Way', '[(-121.7723,37.932),(-121.7713,37.933)]'),
+('Crosby St', '[(-122.146,37.96),(-122.145,37.953)]'),
+('Cross Road', '[(-121.666843,37.7387),(-121.664768,37.7474)]'),
+('Crow Ct', '[(-121.8797,37.911),(-121.8801,37.91)]'),
+('Crow Canyon Road', '[(-122.0106,37.674),(-122.0102,37.675)]'),
+('Crow Canyon Road', '[(-122.0497,37.029),(-122.0479,37.028)]'),
+('Crow Canyon Road', '[(-122.0552,37.938),(-122.0545,37.967)]'),
+('Crow Canyon Creek', '[(-122.0425,37.051),(-122.0426,37.049)]'),
+('Crow Canyon Creek', '[(-122.043,37.905),(-122.0368,37.71)]'),
+('Crow Canyon Creek', '[(-122.046308,37.0015),(-122.046833,37.00133)]'),
+('Croxton Ave', '[(-122.2591,37.219),(-122.2584,37.211)]'),
+('Cryer St', '[(-122.1024,37.357),(-122.1035,37.351)]'),
+('Crystal Lane', '[(-121.868866,37.50763),(-121.870709,37.51024)]'),
+('Crystaline Dr', '[(-121.925856,37),(-121.925869,37.00527)]'),
+('Cull Canyon Road', '[(-122.0536,37.435),(-122.0499,37.315)]'),
+('Cull Canyon Reservoir', '[(-122.0546,37.039),(-122.0553,37.089)]'),
+('Cull Creek', '[(-122.0624,37.875),(-122.0582,37.527)]'),
+('Culver St', '[(-122.1998,37.865),(-122.1996,37.862)]'),
+('Cumberland Ave', '[(-122.1467,37.945),(-122.1507,37.944)]'),
+('Curran Way', '[(-122.2074,37.96),(-122.207,37.966)]'),
+('Curtis St', '[(-121.9765,37.246),(-121.9778,37.229)]'),
+('Curtis St', '[(-122.2866,37.981),(-122.2866,37.968),(-122.2867,37.949)]'),
+('Curtis St', '[(-122.2877,37.65),(-122.2877,37.639)]'),
+('Curtis St', '[(-122.2881,37.848),(-122.2883,37.831)]'),
+('Curtner Road', '[(-121.909,37.928),(-121.9084,37.928)]'),
+('Curtner Road', '[(-121.9117,37.939),(-121.9105,37.93)]'),
+('Cutler Ave', '[(-122.013942,37.74913),(-122.0142,37.745)]'),
+('Cypress St', '[(-122.2883,37.177),(-122.2884,37.184)]'),
+('Cypress St', '[(-122.2886,37.241),(-122.2883,37.247)]'),
+('Cypress St', '[(-122.2899,37.142),(-122.2894,37.156)]'),
+('Cypress St', '[(-122.2908,37.104),(-122.2905,37.113)]'),
+('Cypress St', '[(-122.2931,37.047),(-122.2928,37.055)]'),
+('Cypress Point Dr', '[(-121.7251,37.24),(-121.724,37.24)]'),
+('D St', '[(-122.0239,37.017),(-122.0242,37.015)]'),
+('D St', '[(-122.0529,37.421),(-122.0534,37.42)]'),
+('D St', '[(-122.055,37.798),(-122.0541,37.796),(-122.0529,37.794)]'),
+('D St', '[(-122.056892,37.79896),(-122.0564,37.8)]'),
+('D St', '[(-122.0746,37.745),(-122.0741,37.749)]'),
+('D St', '[(-122.179,37.476),(-122.1785,37.47)]'),
+('D St', '[(-122.1811,37.505),(-122.1805,37.497)]'),
+('Dagnino Road', '[(-121.7462,37.306),(-121.7461,37.379)]'),
+('Daisy St', '[(-122.1817,37.843),(-122.18,37.848),(-122.179,37.851)]'),
+('Daisy St', '[(-122.1857,37.858),(-122.185,37.851)]'),
+('Dalgo Road', '[(-121.947,37.529),(-121.9475,37.524)]'),
+('Dalton Way', '[(-122.0293,37.927),(-122.0297,37.915)]'),
+('Dalton Com', '[(-121.994,37.555),(-121.9944,37.556)]');
+
+INSERT INTO road VALUES
+('Damon Slough', '[(-122.2057,37.533),(-122.2063,37.531)]'),
+('Dana St', '[(-122.2578,37.501),(-122.2579,37.507)]'),
+('Dana St', '[(-122.2583,37.548),(-122.2582,37.541)]'),
+('Daniels Dr', '[(-122.1346,37.317),(-122.1335,37.323)]'),
+('Darius Way', '[(-122.1272,37.18),(-122.1267,37.164)]'),
+('Darwin Dr', '[(-122.0335,37.776),(-122.0349,37.767)]'),
+('Darwin Dr', '[(-122.0359,37.763),(-122.0366,37.755)]'),
+('Darwin St', '[(-122.0996,37.317),(-122.1024,37.311)]'),
+('Daryl Ave', '[(-122.115,37.883),(-122.1149,37.866)]'),
+('Dashwood Ave', '[(-122.177,37.618),(-122.1755,37.627)]'),
+('Davenport Ave', '[(-122.1827,37.892),(-122.1823,37.872)]'),
+('David St', '[(-122.0637,37.958),(-122.0608,37.958)]'),
+('Davis St', '[(-122.1624,37.225),(-122.1632,37.222),(-122.1647,37.218)]'),
+('Davis St', '[(-122.1702,37.203),(-122.171,37.201)]'),
+('Davis St', '[(-122.1719,37.199),(-122.1725,37.198)]'),
+('Davis St', '[(-122.1831,37.165),(-122.1835,37.165)]'),
+('Davis St', '[(-122.1857,37.158),(-122.1921,37.139)]'),
+('Davis St', '[(-122.217903,37.89337),(-122.216,37.885)]'),
+('Davona Dr', '[(-121.9261,37.222),(-121.9278,37.218)]'),
+('Davy Ct', '[(-121.9902,37.629),(-121.99,37.623)]'),
+('Dawe Ave', '[(-122.0783,37.927),(-122.0783,37.912)]'),
+('Dawes St', '[(-122.2122,37.24),(-122.2112,37.226)]'),
+('Dawn View Ct', '[(-122.041,37.144),(-122.0403,37.143)]'),
+('Dayle Ct', '[(-121.943,37.37),(-121.9421,37.369)]'),
+('De Brum Commons', '[(-121.924934,37.30872),(-121.924728,37.30014)]'),
+('De la Cruz Road', '[(-122.0554,37.305),(-122.055,37.301)]'),
+('Dearborn St', '[(-122.0274,37.107),(-122.0275,37.101)]'),
+('Decatur Way', '[(-122.0868,37.296),(-122.0863,37.267)]'),
+('Decoto Road', '[(-122.0159,37.006),(-122.016,37.002),(-122.0164,37.993)]'),
+('Decoto Road', '[(-122.0175,37.961),(-122.0177,37.955)]'),
+('Decoto Road', '[(-122.0189,37.925),(-122.019,37.921)]'),
+('Decoto Road', '[(-122.0292,37.733),(-122.0315,37.707)]'),
+('Decoto Road', '[(-122.0361,37.656),(-122.0364,37.652)]'),
+('Deep Creek Road', '[(-122.049391,37.64053),(-122.04928,37.63888)]'),
+('Deep Creek Road', '[(-122.0533,37.749),(-122.053709,37.74218)]'),
+('Deep Creek Road', '[(-122.0536,37.697),(-122.0517,37.674),(-122.0513,37.668)]'),
+('Deer Oaks Dr', '[(-121.909133,37.54092),(-121.907389,37.54544)]'),
+('Deer Park Way', '[(-122.0279,37.526),(-122.0266,37.524)]'),
+('Deer Trail Pl', '[(-122.0455,37.669),(-122.044472,37.66938)]'),
+('Deering St', '[(-122.2146,37.904),(-122.2126,37.897)]'),
+('Deervale Road', '[(-121.9376,37.178),(-121.9374,37.184)]'),
+('Deerwood St', '[(-122.1775,37.623),(-122.177,37.618)]'),
+('Del Valle Pkwy', '[(-121.875441,37.66004),(-121.874759,37.65728)]'),
+('Del Valle Road', '[(-121.688828,37.70896),(-121.691152,37.7458)]'),
+('Delaware Dr', '[(-121.951,37.203),(-121.9517,37.201)]'),
+('Delaware St', '[(-122.2016,37.926),(-122.2015,37.925)]'),
+('Delaware Way', '[(-121.786362,37.92959),(-121.7863,37.93)]'),
+('Delmar Ave', '[(-121.7889,37.693),(-121.787,37.704)]'),
+('Delmar Ave', '[(-122.2453,37.545),(-122.2444,37.556)]'),
+('Delores Dr', '[(-122.0742,37.735),(-122.0752,37.727)]'),
+('Delta Ter', '[(-121.9592,37.113),(-121.959,37.111)]'),
+('Delta Mendota Canal', '[(-121.562031,37.5571),(-121.573749,37.57374)]'),
+('Delta Mendota Canal', '[(-121.57819,37.7187),(-121.578403,37.71976)]'),
+('Delta Mendota Canal', '[(-121.589243,37.84355),(-121.589222,37.84389)]'),
+('Denise Ct', '[(-121.9418,37.142),(-121.9414,37.127)]'),
+('Denise St', '[(-121.9469,37.37),(-121.945,37.359)]'),
+('Denker Dr', '[(-121.9086,37.861),(-121.9082,37.863),(-121.9079,37.864)]'),
+('Dennison St', '[(-122.2379,37.796),(-122.2374,37.796)]'),
+('Dennison St', '[(-122.2428,37.791),(-122.2412,37.793),(-122.239,37.795)]'),
+('Denslowe St', '[(-122.1851,37.336),(-122.1847,37.332)]'),
+('Denton Ave', '[(-122.1118,37.467),(-122.108659,37.47689)]'),
+('Denton Ave', '[(-122.1118,37.467),(-122.112277,37.46666)]'),
+('Depot Road', '[(-122.127518,37.3808),(-122.1284,37.38)]'),
+('Depot Road', '[(-122.1302,37.38),(-122.1323,37.379)]'),
+('Derby St', '[(-122.246,37.628),(-122.2451,37.629)]'),
+('Derby St', '[(-122.2617,37.612),(-122.2595,37.615)]'),
+('Derby St', '[(-122.2688,37.602),(-122.2663,37.606)]'),
+('Dering Pl', '[(-122.0192,37.701),(-122.0183,37.693)]'),
+('Devonshire Ave', '[(-122.1466,37.926),(-122.1498,37.924)]'),
+('Devonshire Ave', '[(-122.1507,37.924),(-122.1517,37.924)]'),
+('Dewey St', '[(-122.1483,37.862),(-122.1482,37.857)]'),
+('Diablo Ave', '[(-122.1186,37.358),(-122.1236,37.358)]'),
+('Diablo Pl', '[(-122.0543,37.973),(-122.0534,37.974)]'),
+('Diamond Dr', '[(-121.8008,37.669),(-121.7988,37.682)]'),
+('Diana Common', '[(-122.056116,37.61386),(-122.056337,37.62065)]'),
+('Dichondra Pl', '[(-122.009872,37.31128),(-122.009205,37.31438)]'),
+('Dillo St', '[(-122.1303,37.024),(-122.1303,37.016)]'),
+('Dimond Ave', '[(-122.2167,37.994),(-122.2162,37.006)]'),
+('Dixon St', '[(-122.0524,37.32),(-122.0514,37.311)]'),
+('Doane St', '[(-121.9531,37.149),(-121.9562,37.14)]'),
+('Doane St', '[(-121.9581,37.135),(-121.9597,37.13)]'),
+('Dobbel Ave', '[(-122.0319,37.46),(-122.0328,37.463)]'),
+('Dobbel Ave', '[(-122.0417,37.52),(-122.0408,37.515)]'),
+('Dohr St', '[(-122.2805,37.56),(-122.2804,37.548)]'),
+('Dolores Ave', '[(-122.1517,37.224),(-122.1498,37.229)]'),
+('Dolores Dr', '[(-121.8732,37.524),(-121.8724,37.519)]'),
+('Dolores Dr', '[(-121.875651,37.52705),(-121.87384,37.52324)]'),
+('Dolores St', '[(-122.078,37.842),(-122.0779,37.833)]'),
+('Dominici Dr', '[(-122.0149,37.756),(-122.0151,37.75)]'),
+('Donalban Cir', '[(-122.0464,37.71),(-122.0475,37.709)]'),
+('Donegal Ct', '[(-122.0433,37.549),(-122.0421,37.543)]'),
+('Donlan Canyon Creek', '[(-121.9687,37.097),(-121.9584,37.101)]'),
+('Donna Way', '[(-122.1333,37.606),(-122.1316,37.599)]'),
+('Donner Way', '[(-121.9969,37.37),(-121.9945,37.357)]'),
+('Donohue Dr', '[(-121.932,37.091),(-121.9327,37.106)]'),
+('Doolittle Dr', '[(-122.174643,37.98341),(-122.1735,37.965)]'),
+('Doolittle Dr', '[(-122.1793,37.052),(-122.1787,37.043)]'),
+('Doolittle Dr', '[(-122.193162,37.21747),(-122.193,37.216)]'),
+('Doolittle Dr', '[(-122.224088,37.448),(-122.2226,37.448)]'),
+('Dorisa Ave', '[(-122.1462,37.555),(-122.1448,37.572)]'),
+('Dorman Road', '[(-121.9061,37.834),(-121.9063,37.841)]'),
+('Dorne Pl', '[(-121.9455,37.397),(-121.9456,37.392)]'),
+('Dorothy Pl', '[(-122.2301,37.566),(-122.2302,37.571)]'),
+('Dorsey Ave', '[(-121.9992,37.495),(-121.9997,37.489)]'),
+('Dorthea Ct', '[(-121.9064,37.519),(-121.908617,37.52369)]'),
+('Dougherty Road', '[(-121.908447,37.2552),(-121.90838,37.2379)]'),
+('Dougherty Road', '[(-121.9093,37.127),(-121.9093,37.15418)]'),
+('Dougherty Road', '[(-121.909939,37.28669),(-121.909373,37.30234),(-121.9092,37.305)]'),
+('Douglas Dr', '[(-122.1705,37.227),(-122.1698,37.214)]'),
+('Dover Way', '[(-121.7929,37.906),(-121.7917,37.906)]'),
+('Dowe Ave', '[(-122.0439,37.903),(-122.04363,37.91098)]'),
+('Dowling Blvd', '[(-122.1467,37.359),(-122.1447,37.359)]'),
+('Dowling Blvd', '[(-122.1552,37.323),(-122.1542,37.335)]'),
+('Downing Pl', '[(-122.0549,37.035),(-122.0546,37.041)]'),
+('Doyle St', '[(-122.2835,37.337),(-122.2836,37.344)]'),
+('Drake Dr', '[(-122.2056,37.311),(-122.2043,37.302)]'),
+('Drew St', '[(-122.1288,37.938),(-122.1281,37.939)]'),
+('Drew Ter', '[(-121.956729,37.21923),(-121.956991,37.21808)]'),
+('Driftwood Dr', '[(-122.0109,37.482),(-122.0113,37.477)]'),
+('Driftwood Way', '[(-121.919,37.794),(-121.92,37.795)]'),
+('Driftwood Way', '[(-122.1726,37.924),(-122.1734,37.924)]'),
+('Driscoll Road', '[(-121.9482,37.403),(-121.948451,37.39995)]'),
+('Dry Creek', '[(-121.706461,37.12006),(-121.708998,37.15525)]'),
+('Dry Creek', '[(-122.0367,37.88386),(-122.038,37.877)]'),
+('Dublin Blvd', '[(-121.9096,37.047),(-121.9115,37.034)]'),
+('Dublin Blvd', '[(-121.945852,37.98712),(-121.944625,37.99187)]'),
+('Dublin Road', '[(-121.955087,37.97529),(-121.946646,37.94858)]'),
+('Dublin Way', '[(-122.251,37.425),(-122.2513,37.43)]'),
+('Dublin Canyon Road', '[(-121.94428,37.95399),(-121.943721,37.95527)]'),
+('Dublin Creek', '[(-121.9422,37.974),(-121.955,37.984)]'),
+('Dublin Green Dr', '[(-121.939669,37.10516),(-121.9384,37.097)]'),
+('Dudley Ave', '[(-122.222,37.241),(-122.2221,37.234)]'),
+('Duffel Pl', '[(-122.0641,37.434),(-122.0637,37.429)]'),
+('Dunbar Pl', '[(-122.011,37.632),(-122.0121,37.621)]'),
+('Dundee Ct', '[(-122.1458,37.166),(-122.1451,37.16)]'),
+('Dunkirk Ave', '[(-122.1254,37.526),(-122.1228,37.531)]'),
+('Dunn Road', '[(-122.1195,37.452),(-122.1211,37.451)]'),
+('Durant Ave', '[(-122.2603,37.678),(-122.2584,37.68)]'),
+('Durant Ave', '[(-122.2671,37.669),(-122.2652,37.67)]'),
+('Durham Road', '[(-121.9216,37.146),(-121.9234,37.149)]'),
+('Durham Road', '[(-121.957278,37.10033),(-121.957885,37.09857)]'),
+('Durham Road', '[(-121.9605,37.091),(-121.9616,37.087)]'),
+('Durham Road', '[(-121.9634,37.081),(-121.9642,37.078)]'),
+('Durham Way', '[(-122.0321,37.656),(-122.0311,37.642)]'),
+('Durillo Dr', '[(-121.9464,37.446),(-121.9457,37.441)]'),
+('Durk Way', '[(-122.097393,37.57955),(-122.097541,37.58144)]'),
+('Dusterberry Way', '[(-122.0141,37.565),(-122.0135,37.562)]'),
+('Dutton Ave', '[(-122.1403,37.339),(-122.1394,37.34)]'),
+('Dutton Ave', '[(-122.155,37.319),(-122.1534,37.323)]'),
+('Dwight Way', '[(-122.2483,37.662),(-122.2472,37.661)]'),
+('Dwight Way', '[(-122.2546,37.657),(-122.2533,37.659)]'),
+('Dwight Way', '[(-122.2573,37.654),(-122.256,37.656)]'),
+('Dwight Way', '[(-122.286,37.616),(-122.2851,37.617)]'),
+('Dwight Way', '[(-122.2933,37.602),(-122.292,37.605),(-122.291,37.607)]'),
+('Dyer St', '[(-122.0684,37.028),(-122.0691,37.005)]'),
+('Dyer St', '[(-122.0701,37.969),(-122.0703,37.965)]'),
+('E St', '[(-122.019,37.037),(-122.0195,37.032),(-122.0203,37.027),(-122.0208,37.022)]'),
+('E St', '[(-122.1832,37.505),(-122.1826,37.498),(-122.182,37.49)]'),
+('Eagle Ave', '[(-122.2342,37.668),(-122.2335,37.664)]'),
+('Eagle Ave', '[(-122.2539,37.76),(-122.253215,37.75657)]'),
+('Earhart Road', '[(-122.2004,37.256),(-122.2004,37.259)]'),
+('Earhart Road', '[(-122.2086,37.296),(-122.2012,37.255)]'),
+('Earhart Road', '[(-122.2186,37.394),(-122.2181,37.389)]'),
+('Earl St', '[(-122.1564,37.709),(-122.1552,37.697)]'),
+('East Ave', '[(-121.7203,37.799),(-121.7176,37.801)]'),
+('East Ave', '[(-121.7296,37.8),(-121.7251,37.8)]'),
+('East Ave', '[(-121.7424,37.799),(-121.7416,37.799)]'),
+('East Ave', '[(-121.7597,37.798),(-121.7558,37.8)]'),
+('East Ave', '[(-121.7641,37.8),(-121.763,37.8)]'),
+('East Ave', '[(-122.0361,37.719),(-122.0352,37.733)]'),
+('Easterday Way', '[(-121.9916,37.829),(-121.9899,37.814)]'),
+('Eastlawn St', '[(-122.1989,37.629),(-122.1982,37.623)]'),
+('Eastlawn St', '[(-122.2005,37.644),(-122.2,37.638)]'),
+('Eastman Ave', '[(-122.20024,37.86217),(-122.1998,37.865)]'),
+('Eastman Ave', '[(-122.2028,37.845),(-122.2012,37.856)]'),
+('Eastman Ct', '[(-122.0732,37.492),(-122.0722,37.486)]'),
+('Eastpark Ter', '[(-122.041182,37.77686),(-122.042271,37.78226)]'),
+('Eastshore Hwy', '[(-122.3057,37.785),(-122.3051,37.755)]'),
+('Ebbetts St', '[(-122.0061,37.205),(-122.005,37.203)]'),
+('Eden Ave', '[(-122.1143,37.505),(-122.1142,37.491)]'),
+('Eden Creek', '[(-122.0218,37.996),(-122.0222,37.961)]'),
+('Eden Creek', '[(-122.022037,37.00675),(-122.0221,37.998)]'),
+('Eden Landing Road', '[(-122.1204,37.268),(-122.1204,37.267)]'),
+('Eden Landing Road', '[(-122.1213,37.226),(-122.1213,37.223)]'),
+('Edenberry St', '[(-121.9347,37.23),(-121.9349,37.235)]'),
+('Edes Ave', '[(-122.1833,37.363),(-122.1821,37.359)]'),
+('Edes Ave', '[(-122.1948,37.444),(-122.1941,37.444)]'),
+('Edgebrook Dr', '[(-122.057639,37.71523),(-122.057506,37.72472)]'),
+('Edgehill Ct', '[(-122.1305,37.239),(-122.1304,37.232)]'),
+('Edgemoor St', '[(-122.1492,37.918),(-122.1492,37.91)]'),
+('Edgewater Dr', '[(-122.0285,37.526),(-122.028611,37.52295)]'),
+('Edgewater Dr', '[(-122.0306,37.542),(-122.0298,37.538)]'),
+('Edgewater Dr', '[(-122.0327,37.552),(-122.0315,37.546)]'),
+('Edgewater Dr', '[(-122.0387,37.579),(-122.038315,37.57785)]'),
+('Edgewater Dr', '[(-122.0401,37.57),(-122.0405,37.565)]'),
+('Edgewater Dr', '[(-122.201,37.379),(-122.2042,37.41)]'),
+('Edison Way', '[(-121.9443,37.098),(-121.9473,37.084)]'),
+('Edith St', '[(-122.02,37.43),(-122.0197,37.429)]'),
+('Edith St', '[(-122.077,37.638),(-122.0764,37.631)]'),
+('Edith St', '[(-122.2764,37.774),(-122.2763,37.765)]'),
+('Edith Way', '[(-122.0733,37.825),(-122.0716,37.804)]'),
+('Edwards Ave', '[(-122.1652,37.749),(-122.1638,37.759)]'),
+('Edwards Lane', '[(-122.0599,37.016),(-122.058514,37.01551)]'),
+('Eggers Ct', '[(-121.9924,37.585),(-121.991,37.576)]'),
+('Eggers Dr', '[(-122.0002,37.465),(-122.0017,37.451)]'),
+('Ehle St', '[(-122.103,37.973),(-122.1017,37.959)]'),
+('Eilene Dr', '[(-121.869254,37.87019),(-121.869113,37.87253)]'),
+('Eilene Dr', '[(-121.869618,37.86592),(-121.869389,37.86861)]'),
+('El Caminito', '[(-121.7883,37.673),(-121.7852,37.67)]'),
+('El Caminito', '[(-121.7922,37.696),(-121.7907,37.685),(-121.7898,37.681)]'),
+('El Camino Real', '[(-122.2409,37.559),(-122.2407,37.556)]'),
+('El Centro Ave', '[(-122.2191,37.116),(-122.2185,37.118)]'),
+('El Dorado Dr', '[(-121.7803,37.659),(-121.7801,37.647)]'),
+('El Monte Ave', '[(-122.1594,37.624),(-122.1591,37.63)]'),
+('El Paseo', '[(-122.244718,37.33016),(-122.2454,37.333)]'),
+('El Portal', '[(-122.2429,37.359),(-122.2434,37.361)]'),
+('El Portal Ave', '[(-121.9993,37.83),(-121.9997,37.817)]'),
+('El Portal Ct', '[(-122.2554,37.844),(-122.2552,37.85)]'),
+('El Rey Ave', '[(-122.0219,37.536),(-122.0225,37.53)]'),
+('Elba Way', '[(-121.9223,37.143),(-121.923,37.139)]'),
+('Elbert St', '[(-122.2205,37.107),(-122.2195,37.095)]'),
+('Elder Way', '[(-122.0819,37.229),(-122.0827,37.229)]'),
+('Eldridge Ave', '[(-122.0883,37.402),(-122.0878,37.395)]'),
+('Eldridge Ave', '[(-122.0896,37.423),(-122.0888,37.408)]'),
+('Elgin St', '[(-122.1106,37.911),(-122.1102,37.911)]'),
+('Elgin St', '[(-122.113,37.911),(-122.1119,37.911)]'),
+('Elgin St', '[(-122.1222,37.95),(-122.1213,37.945)]'),
+('Elk Ct', '[(-121.912463,37.08667),(-121.913575,37.09125)]'),
+('Elko Ct', '[(-122.1499,37.778),(-122.1496,37.773)]'),
+('Ellen Way', '[(-122.0685,37.83),(-122.0687,37.828)]'),
+('Ellen Way', '[(-122.0711,37.801),(-122.0716,37.796)]'),
+('Ellis St', '[(-122.2726,37.542),(-122.2723,37.524)]'),
+('Ellsworth St', '[(-122.2611,37.575),(-122.2608,37.57)]'),
+('Elm St', '[(-121.7815,37.865),(-121.7807,37.865)]'),
+('Elm St', '[(-122.04,37.27),(-122.0392,37.254)]'),
+('Elmhurst St', '[(-122.0916,37.568),(-122.0918,37.564)]'),
+('Elmridge Ct', '[(-121.8867,37.707),(-121.8871,37.702)]'),
+('Elsie Ave', '[(-122.1497,37.21),(-122.1447,37.223)]'),
+('Elverton Dr', '[(-122.2028,37.487),(-122.2017,37.471)]'),
+('Elvessa St', '[(-122.1296,37.528),(-122.129,37.522)]'),
+('Elysian Fields Dr', '[(-122.1275,37.646),(-122.1275,37.649)]'),
+('Elysian Fields Dr', '[(-122.1336,37.595),(-122.133,37.594)]'),
+('Elysian Fields Dr', '[(-122.1369,37.589),(-122.1361,37.595)]'),
+('Embarcadero', '[(-122.2527,37.894),(-122.246486,37.86908)]'),
+('Embarcadero', '[(-122.276,37.961),(-122.2747,37.956)]'),
+('Embarcadero', '[(-122.2836,37.99),(-122.283,37.989)]'),
+('Emerald Ave', '[(-121.9247,37.13),(-121.925,37.136)]'),
+('Emerald St', '[(-122.2557,37.309),(-122.2557,37.315)]'),
+('Emerson St', '[(-121.9276,37.345),(-121.9284,37.347)]'),
+('Emerson St', '[(-122.2688,37.543),(-122.2678,37.544)]'),
+('Emily Ct', '[(-122.0726,37.121),(-122.0712,37.124)]'),
+('Empire Road', '[(-122.1873,37.278),(-122.1858,37.277)]'),
+('Encinitas Way', '[(-122.0759,37.917),(-122.0756,37.911)]'),
+('Encino Dr', '[(-121.7959,37.688),(-121.7947,37.688)]'),
+('Endeavour Way', '[(-122.0655,37.842),(-122.0647,37.84)]'),
+('Endicott St', '[(-122.1436,37.931),(-122.1435,37.911)]'),
+('Enfield Dr', '[(-122.0273,37.519),(-122.0277,37.507)]'),
+('Enos Way', '[(-121.7677,37.896),(-121.7673,37.91)]'),
+('Ensenada Ave', '[(-122.2833,37.933),(-122.2825,37.928)]'),
+('Enterprise Pl', '[(-121.9568,37.009),(-121.9558,37.002)]'),
+('Erica Pl', '[(-122.0299,37.165),(-122.0293,37.169)]'),
+('Erie St', '[(-122.2419,37.122),(-122.2408,37.134)]'),
+('Escher Dr', '[(-122.1962,37.258),(-122.1988,37.302)]'),
+('Essex St', '[(-122.2677,37.537),(-122.2657,37.539)]'),
+('Essex Way', '[(-121.9735,37.257),(-121.9749,37.249)]'),
+('Estabrook St', '[(-122.1527,37.164),(-122.1535,37.161)]'),
+('Estabrook St', '[(-122.1539,37.16),(-122.1547,37.156)]'),
+('Estates Dr', '[(-122.2136,37.158),(-122.2126,37.169)]'),
+('Estates Dr', '[(-122.2139,37.272),(-122.2135,37.26)]'),
+('Estates Dr', '[(-122.2178,37.33),(-122.2183,37.325)]'),
+('Estates Dr', '[(-122.2225,37.37),(-122.218617,37.34167)]'),
+('Estudillo Ave', '[(-122.1446,37.274),(-122.1425,37.28)]'),
+('Estudillo Ave', '[(-122.1509,37.256),(-122.1498,37.26)]'),
+('Estudillo Ave', '[(-122.1547,37.245),(-122.1551,37.244)]'),
+('Estudillo Ave', '[(-122.1584,37.229),(-122.1595,37.225)]'),
+('Estudillo Ave', '[(-122.1608,37.22),(-122.1621,37.214)]'),
+('Estudillo Canal', '[(-122.1282,37.969),(-122.1288,37.964)]'),
+('Estudillo Canal', '[(-122.1323,37.929),(-122.1363,37.924),(-122.1369,37.924)]'),
+('Estudillo Canal', '[(-122.1397,37.923),(-122.14066,37.92204)]'),
+('Estudillo Canal', '[(-122.1569,37.861),(-122.1587,37.858)]'),
+('Eucalyptus Ct', '[(-122.064324,37.37425),(-122.064548,37.37733)]'),
+('Euclid Ave', '[(-122.2618,37.893),(-122.2612,37.887)]'),
+('Euclid Ave', '[(-122.2627,37.907),(-122.2621,37.902)]'),
+('Euclid Ave', '[(-122.2632,37.942),(-122.2644,37.93)]'),
+('Euclid Ave', '[(-122.2671,37.009),(-122.2666,37.987)]'),
+('Eugene St', '[(-121.963937,37.38628),(-121.9642,37.383)]'),
+('Eugene St', '[(-121.9659,37.364),(-121.9664,37.358)]'),
+('Evans St', '[(-121.7778,37.607),(-121.7777,37.602)]'),
+('Evelyn Ave', '[(-122.2906,37.814),(-122.2903,37.807)]'),
+('Evelyn Ave', '[(-122.2919,37.843),(-122.2909,37.83)]'),
+('Everett Ave', '[(-122.2182,37.02),(-122.2172,37.05)]'),
+('Everett Ave', '[(-122.219,37.094),(-122.218,37.087)]'),
+('Everett St', '[(-122.236,37.678),(-122.2353,37.687)]'),
+('Everett St', '[(-122.2385,37.647),(-122.238,37.653)]'),
+('Everglade St', '[(-122.0822,37.275),(-122.083,37.272)]'),
+('Everglades Lane', '[(-121.8005,37.87),(-121.800259,37.87469)]'),
+('Everglades Park Dr', '[(-121.9703,37.175),(-121.9718,37.164)]'),
+('Evergreen Ave', '[(-122.1367,37.234),(-122.1361,37.224)]'),
+('Evergreen St', '[(-122.0877,37.458),(-122.087,37.455)]'),
+('Excelsior Ave', '[(-122.2224,37.019),(-122.2215,37.016)]'),
+('Excelsior Ave', '[(-122.2338,37.059),(-122.2312,37.051)]'),
+('F St', '[(-122.0191,37.017),(-122.0198,37.013)]'),
+('F St', '[(-122.0223,37.993),(-122.0225,37.993)]'),
+('F St', '[(-122.0246,37.976),(-122.0247,37.974)]'),
+('F Bay', '[(-122.152,37.358),(-122.150473,37.24998)]'),
+('F Bay', '[(-122.2842,37.681),(-122.2841,37.68)]'),
+('F Bay', '[(-122.3138,37.645),(-122.3154,37.643)]'),
+('Faber St', '[(-122.0694,37.105),(-122.075,37.106)]'),
+('Fabian Way', '[(-122.0703,37.27),(-122.0684,37.269)]'),
+('Fabian Com', '[(-121.9951,37.537),(-121.9947,37.534)]'),
+('Fair Ave', '[(-122.0298,37.395),(-122.0304,37.386)]'),
+('Fairbrook Ct', '[(-121.9207,37.829),(-121.9218,37.826)]'),
+('Fairfax Ave', '[(-122.1997,37.733),(-122.1997,37.724)]'),
+('Fairfax Ave', '[(-122.2022,37.784),(-122.2015,37.778)]'),
+('Fairlands Dr', '[(-121.871,37.976),(-121.8719,37.961)]'),
+('Fairlands Dr', '[(-121.8731,37.956),(-121.8738,37.952)]'),
+('Fairlands Road', '[(-122.0583,37.784),(-122.059,37.781)]'),
+('Fairmont Dr', '[(-122.1135,37.144),(-122.1109,37.143)]'),
+('Fairmount Ave', '[(-122.2525,37.23),(-122.2511,37.234)]'),
+('Fairmount Ave', '[(-122.2561,37.194),(-122.2553,37.202)]'),
+('Fairview Ave', '[(-121.999,37.428),(-121.9863,37.351)]'),
+('Fairview Ave', '[(-122.0165,37.549),(-122.016,37.525)]'),
+('Fairview Ave', '[(-122.02765,37.68521),(-122.0274,37.669),(-122.0267,37.646)]'),
+('Fairview Ave', '[(-122.038562,37.76258),(-122.0379,37.762)]'),
+('Fairview Ave', '[(-122.0418,37.748),(-122.0402,37.764)]'),
+('Fairview Ave', '[(-122.0432,37.752),(-122.0428,37.751)]'),
+('Fairview Ave', '[(-122.049,37.788),(-122.0482,37.775)]'),
+('Fairview Ave', '[(-122.2404,37.22),(-122.2401,37.227)]'),
+('Fairview St', '[(-122.2792,37.495),(-122.2776,37.498)]'),
+('Fairway Ct', '[(-122.0536,37.334),(-122.0539,37.33)]'),
+('Fairway Dr', '[(-122.1753,37.994),(-122.176433,37.98933)]'),
+('Fairway St', '[(-122.0353,37.237),(-122.0343,37.238)]'),
+('Fairway St', '[(-122.0375,37.221),(-122.0368,37.226)]'),
+('Fairwood St', '[(-121.9539,37.183),(-121.9573,37.178)]'),
+('Fall Creek Road', '[(-121.910898,37.2702),(-121.909729,37.25584)]'),
+('Fallbrook Way', '[(-122.1285,37.533),(-122.1278,37.522)]'),
+('Fallon St', '[(-122.2637,37.969),(-122.2633,37.977)]'),
+('Fallon St', '[(-122.2661,37.931),(-122.2658,37.935)]'),
+('Falls Ter', '[(-122.048735,37.61624),(-122.048402,37.60954)]'),
+('Falmouth Pl', '[(-122.0301,37.513),(-122.031,37.502)]'),
+('Farallon Dr', '[(-122.1681,37.938),(-122.1698,37.937)]'),
+('Fargo Ave', '[(-122.1468,37.881),(-122.1476,37.887)]'),
+('Farm Hill Dr', '[(-122.0328,37.523),(-122.0333,37.511)]'),
+('Farnsworth St', '[(-122.1507,37.952),(-122.1507,37.944)]'),
+('Farwell Dr', '[(-121.9867,37.255),(-121.9841,37.264)]'),
+('Farwell Dr', '[(-121.996,37.291),(-121.9952,37.287)]'),
+('Farwell Dr', '[(-121.9966,37.316),(-121.9962,37.314)]'),
+('Farwell Dr', '[(-122.0133,37.392),(-122.0125,37.389),(-122.01186,37.3858)]'),
+('Faulkner Dr', '[(-122.0034,37.53),(-122.0049,37.515)]'),
+('Feldspar Ct', '[(-122.0722,37.874),(-122.0734,37.87)]'),
+('Fellows St', '[(-122.0652,37.814),(-122.066,37.805)]'),
+('Fellows St', '[(-122.0682,37.78),(-122.0687,37.775)]'),
+('Fenico Ter', '[(-122.0166,37.562),(-122.0168,37.559)]'),
+('Fenwick Way', '[(-121.947144,37.20116),(-121.9451,37.202)]'),
+('Fenwick Way', '[(-121.9473,37.192),(-121.9472,37.199)]'),
+('Fernside Ave', '[(-122.2337,37.514),(-122.2343,37.509)]'),
+('Fernside Blvd', '[(-122.2256,37.575),(-122.2249,37.581)]'),
+('Fernside Blvd', '[(-122.2271,37.645),(-122.2265,37.64)]'),
+('Ferro St', '[(-122.2996,37.975),(-122.3025,37.968)]'),
+('Ferry St', '[(-122.3128,37.147),(-122.3113,37.159)]'),
+('Ferry St', '[(-122.3185,37.097),(-122.3155,37.122)]'),
+('Field St', '[(-122.1604,37.721),(-122.1596,37.728)]'),
+('Fielding Ct', '[(-122.0393,37.689),(-122.0384,37.688)]'),
+('Fiji Way', '[(-122.1747,37.968),(-122.1753,37.965)]'),
+('Filbert St', '[(-122.036,37.259),(-122.0356,37.252)]'),
+('Filbert St', '[(-122.2779,37.215),(-122.2772,37.233)]'),
+('Filbert St', '[(-122.2802,37.151),(-122.2796,37.168)]'),
+('Finback Way', '[(-122.1783,37.934),(-122.1776,37.936)]'),
+('Findlay Way', '[(-121.7463,37.753),(-121.7454,37.753)]'),
+('Fir Ave', '[(-122.2385,37.318),(-122.2379,37.314)]'),
+('Firestone Ct', '[(-122.1246,37.671),(-122.1246,37.666)]'),
+('First St', '[(-121.7572,37.875),(-121.7576,37.863)]'),
+('First St', '[(-121.7636,37.843),(-121.7644,37.84)]'),
+('Firth Ct', '[(-122.1359,37.93),(-122.1363,37.924)]'),
+('Fisk Ct', '[(-122.155,37.972),(-122.1545,37.968)]'),
+('Fitzerald St', '[(-122.28185,37.26208),(-122.282237,37.26273)]'),
+('Flagg St', '[(-122.0921,37.71),(-122.0914,37.7)]'),
+('Fleet Road', '[(-122.2235,37.085),(-122.2229,37.078)]'),
+('Fleming Ave', '[(-122.1949,37.791),(-122.1948,37.783)]'),
+('Fletcher Lane', '[(-122.0779,37.668),(-122.0762,37.683)]'),
+('Flint Ct', '[(-122.1074,37.711),(-122.1085,37.704)]'),
+('Flint River Ter', '[(-122.054,37.78),(-122.0536,37.778)]'),
+('Flora St', '[(-122.1882,37.625),(-122.1879,37.622)]'),
+('Florence Ave', '[(-122.2253,37.376),(-122.225,37.373)]'),
+('Florence Road', '[(-121.7743,37.711),(-121.7743,37.687)]'),
+('Floresta Blvd', '[(-122.146,37.994),(-122.1478,37.98)]'),
+('Florio St', '[(-122.2504,37.502),(-122.2494,37.504)]'),
+('Flynn Road', '[(-121.657764,37.18891),(-121.657276,37.18952)]'),
+('Folsom Ave', '[(-122.0587,37.271),(-122.0596,37.269)]'),
+('Folsom Ave', '[(-122.0628,37.259),(-122.062855,37.25882)]'),
+('Fontaine Ct', '[(-122.1525,37.685),(-122.1517,37.688)]'),
+('Fontana Dr', '[(-122.2458,37.36),(-122.2463,37.354)]'),
+('Fontes Dr', '[(-121.933352,37.40768),(-121.93251,37.40887)]'),
+('Fontonett Ave', '[(-121.795158,37.619),(-121.7947,37.619)]'),
+('Foothill Blvd', '[(-122.0798,37.709),(-122.0798,37.688)]'),
+('Foothill Blvd', '[(-122.0882,37.829),(-122.0869,37.822)]'),
+('Foothill Blvd', '[(-122.0926,37.862),(-122.0918,37.857)]'),
+('Foothill Blvd', '[(-122.0983,37.907),(-122.0981,37.905)]'),
+('Foothill Blvd', '[(-122.1455,37.421),(-122.145202,37.41752)]'),
+('Foothill Blvd', '[(-122.1775,37.697),(-122.1764,37.696)]'),
+('Foothill Blvd', '[(-122.1948,37.725),(-122.1928,37.721)]'),
+('Foothill Blvd', '[(-122.2018,37.724),(-122.2008,37.724)]'),
+('Foothill Blvd', '[(-122.2136,37.77),(-122.2129,37.763)]'),
+('Foothill Blvd', '[(-122.2216,37.837),(-122.2206,37.833)]'),
+('Foothill Blvd', '[(-122.2289,37.846),(-122.2278,37.845)]'),
+('Foothill Blvd', '[(-122.2414,37.9),(-122.2403,37.893)]'),
+('Foothill Blvd', '[(-122.2454,37.921),(-122.2442,37.91)]'),
+('Foothill Lane', '[(-121.905417,37.52303),(-121.905087,37.51659)]'),
+('Foothill Road', '[(-121.8956,37.413),(-121.8967,37.419)]'),
+('Foothill Road', '[(-121.9075,37.547),(-121.907696,37.55141)]'),
+('Foothill Road', '[(-121.923245,37.81689),(-121.9236,37.82)]'),
+('Foothill Road', '[(-121.932,37.93),(-121.9335,37.958)]'),
+('Foothill Knolls Dr', '[(-121.909407,37.65999),(-121.9094,37.657)]'),
+('Fordham Way', '[(-121.7488,37.869),(-121.7481,37.869),(-121.7472,37.868)]'),
+('Forest Pl', '[(-122.0672,37.051),(-122.0673,37.044)]'),
+('Forest St', '[(-122.2541,37.443),(-122.2547,37.445)]'),
+('Forest Glen Pl', '[(-122.067707,37.01875),(-122.068338,37.01945),(-122.068308,37.0263)]'),
+('Forest Hill Ave', '[(-122.2118,37.034),(-122.2086,37.069)]'),
+('Forestland Way', '[(-122.1886,37.334),(-122.1901,37.329)]'),
+('Fortune Way', '[(-122.1877,37.693),(-122.187,37.688)]'),
+('Foster Ct', '[(-122.0745,37.396),(-122.074447,37.39388)]'),
+('Foster St', '[(-121.9683,37.367),(-121.9664,37.358)]'),
+('Fountain St', '[(-122.2306,37.593),(-122.2293,37.605)]'),
+('Foxfire Pl', '[(-122.063987,37.27349),(-122.064027,37.27459)]'),
+('Foxswallow Road', '[(-121.8776,37.793),(-121.8796,37.794)]'),
+('Fraga Road', '[(-122.0397,37.975),(-122.0393,37.987)]'),
+('France Road', '[(-122.045563,37.6829),(-122.045452,37.68292)]'),
+('Francisco St', '[(-121.8687,37.749),(-121.8696,37.75)]'),
+('Francisco St', '[(-122.286,37.733),(-122.285,37.735),(-122.2839,37.737)]'),
+('Franklin Ave', '[(-122.0605,37.028),(-122.0614,37.039)]'),
+('Franklin Dr', '[(-121.9049,37.954),(-121.9084,37.934)]'),
+('Franklin St', '[(-122.2687,37.055),(-122.2679,37.068)]'),
+('Franklin St', '[(-122.2702,37.03),(-122.2698,37.037)]'),
+('Franklin St', '[(-122.2719,37.003),(-122.2715,37.009)]'),
+('Franklin St', '[(-122.2744,37.961),(-122.2741,37.968)]'),
+('Frederick Road', '[(-122.174,37.244),(-122.1735,37.225)]'),
+('Frederiksen Lane', '[(-121.9251,37.162),(-121.9256,37.162)]'),
+('Fredi St', '[(-122.0764,37.934),(-122.0767,37.93)]'),
+('Freedom Ave', '[(-122.1219,37.081),(-122.1215,37.075)]'),
+('Freeman Pl', '[(-122.0375,37.866),(-122.037548,37.86536)]'),
+('Fremont Ave', '[(-122.1429,37.008),(-122.145652,37.04405)]'),
+('Fremont Blvd', '[(-121.9347,37.663),(-121.9324,37.65)]'),
+('Fremont Blvd', '[(-121.955914,37.22071),(-121.9556,37.213)]'),
+('Fremont Blvd', '[(-121.960056,37.3392),(-121.9584,37.33)]'),
+('Fremont Blvd', '[(-121.964,37.362),(-121.9632,37.357)]'),
+('Fremont Blvd', '[(-122.0043,37.573),(-122.0038,37.57)]'),
+('Fremont Blvd', '[(-122.006647,37.58506),(-122.0071,37.587)]'),
+('Fremont Blvd', '[(-122.02826,37.6908),(-122.02694,37.6842)]'),
+('Fremont Blvd', '[(-122.0348,37.724),(-122.0315,37.707)]'),
+('Fremont Blvd', '[(-122.0373,37.736),(-122.0361,37.73)]'),
+('Fremont Blvd', '[(-122.0392,37.746),(-122.039154,37.74569)]'),
+('Fremont St', '[(-122.284,37.403),(-122.2841,37.407)]'),
+('Frontage Road', '[(-122.3051,37.664),(-122.2994,37.5)]'),
+('Frontage Road', '[(-122.3074,37.781),(-122.3048,37.71)]'),
+('Fruitvale Ave', '[(-122.2158,37.985),(-122.2157,37.987)]'),
+('Fruitvale Ave', '[(-122.2166,37.966),(-122.2163,37.97)]'),
+('Fruitvale Ave', '[(-122.2182,37.923),(-122.218,37.929)]'),
+('Fruitvale Ave', '[(-122.2257,37.754),(-122.2256,37.756)]'),
+('Fruitvale Ave', '[(-122.2272,37.719),(-122.2269,37.725)]'),
+('Fruitvale Ave', '[(-122.2285,37.693),(-122.227522,37.71256)]'),
+('Fulmar Ter', '[(-122.045623,37.80299),(-122.045824,37.80101)]'),
+('Funston Gate Ct', '[(-121.8824,37.847),(-121.883,37.842)]'),
+('Fuschia Ct', '[(-122.0204,37.325),(-122.0199,37.323)]'),
+('G St', '[(-122.0167,37.018),(-122.0174,37.013)]'),
+('Gable Dr', '[(-121.9178,37.798),(-121.9175,37.799)]'),
+('Gading Road', '[(-122.0801,37.343),(-122.08,37.336)]'),
+('Gading Road', '[(-122.0802,37.388),(-122.0802,37.38)]'),
+('Gail Dr', '[(-122.0853,37.858),(-122.0854,37.853)]'),
+('Gainsborough Ct', '[(-122.2448,37.473),(-122.2447,37.461)]'),
+('Gainsborough Ter', '[(-122.0369,37.764),(-122.0369,37.756)]'),
+('Galaxy Dr', '[(-122.0675,37.866),(-122.068,37.86)]'),
+('Galindo Dr', '[(-121.9071,37.895),(-121.9041,37.891)]'),
+('Galindo St', '[(-122.2158,37.84),(-122.2149,37.837)]'),
+('Gallegos Ave', '[(-121.9286,37.324),(-121.9285,37.318)]'),
+('Galleon Pl', '[(-122.178053,37.9223),(-122.177578,37.92252)]'),
+('Galloway St', '[(-121.7473,37.177),(-121.7459,37.18)]'),
+('Galloway Common', '[(-121.7459,37.18),(-121.745647,37.17049)]'),
+('Galsworthy Ct', '[(-121.995,37.586),(-121.9955,37.585)]'),
+('Galt St', '[(-122.1507,37.886),(-122.1507,37.88)]'),
+('Galway Bay', '[(-122.2473,37.389),(-122.2475,37.384)]'),
+('Gamay Dr', '[(-121.9093,37.676),(-121.909,37.67)]'),
+('Ganet Ter', '[(-122.045424,37.79478),(-122.04533,37.79418)]'),
+('Ganton Ct', '[(-122.0379,37.146),(-122.038,37.152)]'),
+('Garden Ave', '[(-122.1077,37.626),(-122.1075,37.61)]'),
+('Garfield Ave', '[(-122.1718,37.638),(-122.1713,37.632)]'),
+('Garfield Ave', '[(-122.1746,37.664),(-122.174,37.66)]'),
+('Garin Ave', '[(-122.033003,37.2842),(-122.032,37.282)]'),
+('Garland Ct', '[(-122.0924,37.192),(-122.0926,37.177)]'),
+('Garrison Ave', '[(-122.0785,37.075),(-122.0785,37.051)]'),
+('Garrone Ave', '[(-122.0498,37.437),(-122.0513,37.434)]'),
+('Garwood Glenn Dr', '[(-122.06406,37.68946),(-122.064269,37.68336)]'),
+('Gateview Ave', '[(-122.3047,37.921),(-122.3033,37.9)]'),
+('Gatewood St', '[(-121.9574,37.185),(-121.9573,37.178)]'),
+('Gawain Ct', '[(-122.0251,37.745),(-122.02374,37.7382)]'),
+('Geary Road', '[(-121.770923,37.99805),(-121.770222,37.9976)]'),
+('Geary Road', '[(-121.7784,37.014),(-121.7986,37.06)]'),
+('Geary Road', '[(-121.8277,37.073),(-121.8279,37.082)]'),
+('Gem Ave', '[(-122.0167,37.823),(-122.0171,37.809)]'),
+('Genoa St', '[(-122.2725,37.46),(-122.2727,37.467)]'),
+('Georgean St', '[(-122.1024,37.877),(-122.1006,37.892)]'),
+('Gertrude Dr', '[(-121.996,37.398),(-121.9966,37.39)]'),
+('Gettysburg Ave', '[(-122.1089,37.366),(-122.1089,37.357)]'),
+('Giannini Ct', '[(-122.0254,37.16),(-122.0256,37.157)]'),
+('Gibbons Dr', '[(-122.2289,37.633),(-122.2283,37.633)]'),
+('Gibbons Dr', '[(-122.2325,37.625),(-122.2317,37.629)]'),
+('Gibraltar Dr', '[(-121.9025,37.96),(-121.9008,37.96)]'),
+('Gibraltar Dr', '[(-122.0202,37.624),(-122.0207,37.619)]'),
+('Gibraltar Dr', '[(-122.0242,37.603),(-122.0252,37.608)]'),
+('Gibraltar Dr', '[(-122.026,37.613),(-122.026476,37.61522)]'),
+('Gilbert Pl', '[(-121.9823,37.655),(-121.9836,37.653)]'),
+('Gilman St', '[(-122.2883,37.813),(-122.2877,37.812)]'),
+('Gilman St', '[(-122.2942,37.808),(-122.2933,37.81)]'),
+('Gilman St', '[(-122.2962,37.803),(-122.2951,37.806)]'),
+('Girvin Dr', '[(-122.1957,37.291),(-122.1904,37.299)]'),
+('Gisler Way', '[(-122.042,37.285),(-122.0392,37.298)]'),
+('Glacier Dr', '[(-121.8016,37.804),(-121.8017,37.809)]'),
+('Glade St', '[(-122.0819,37.592),(-122.08171,37.5977)]'),
+('Glen Ave', '[(-122.2514,37.257),(-122.2505,37.258)]'),
+('Glen Dr', '[(-122.1459,37.316),(-122.1422,37.315)]'),
+('Glen Alpine Road', '[(-122.2198,37.223),(-122.2185,37.239),(-122.217349,37.236)]'),
+('Glen Ellen Dr', '[(-122.0479,37.85),(-122.0475,37.851)]'),
+('Glendale Dr', '[(-122.0074,37.46),(-122.0067,37.456)]'),
+('Glenmoor Dr', '[(-122.0046,37.466),(-122.0038,37.461)]'),
+('Glenora Way', '[(-121.9143,37.317),(-121.9146,37.316)]'),
+('Glenview Dr', '[(-122.001,37.413),(-122.0002,37.409)]'),
+('Glenwood St', '[(-121.7799,37.771),(-121.7794,37.771)]'),
+('Gliddon St', '[(-122.0575,37.066),(-122.058,37.045)]'),
+('Godwit Ct', '[(-122.0141,37.84),(-122.0141,37.845)]'),
+('Gold Creek', '[(-121.922096,37.88859),(-121.920744,37.88463)]'),
+('Goldcrest Cir', '[(-121.8909,37.725),(-121.8917,37.73)]'),
+('Golden Gate Way', '[(-122.2378,37.497),(-122.238055,37.49522)]'),
+('Goldengate Ave', '[(-122.2324,37.451),(-122.232584,37.45192)]'),
+('Golf Dr', '[(-121.7449,37.136),(-121.7443,37.142)]'),
+('Golf Links Road', '[(-122.1425,37.565),(-122.1415,37.569)]'),
+('Golf Links Road', '[(-122.1491,37.533),(-122.1482,37.536)]'),
+('Gomes Road', '[(-121.949156,37.42192),(-121.9493,37.42)]'),
+('Gordon St', '[(-122.0405,37.752),(-122.0408,37.748)]'),
+('Gordon St', '[(-122.2001,37.788),(-122.1998,37.785)]'),
+('Gotubin Common', '[(-122.053546,37.59037),(-122.054013,37.58887)]'),
+('Grace Ave', '[(-122.276,37.431),(-122.2764,37.43)]'),
+('Graffian St', '[(-122.16774,37.3758),(-122.1677,37.375)]'),
+('Graham Ave', '[(-122.0311,37.321),(-122.032,37.31)]'),
+('Graham Way', '[(-122.1328,37.128),(-122.1321,37.134)]'),
+('Granada Cir', '[(-122.0734,37.229),(-122.0736,37.228)]'),
+('Granada Cir', '[(-122.0741,37.234),(-122.0742,37.23)]'),
+('Granada Dr', '[(-122.0734,37.212),(-122.0734,37.207)]'),
+('Granada Dr', '[(-122.0738,37.22),(-122.0736,37.216)]'),
+('Grand Ave', '[(-122.2442,37.18),(-122.244,37.184)]'),
+('Grand Ave', '[(-122.2479,37.111),(-122.2478,37.115)]'),
+('Grand Ave', '[(-122.2684,37.123),(-122.269233,37.12388)]'),
+('Grand Ave', '[(-122.2722,37.128),(-122.2729,37.129)]'),
+('Grand Ave', '[(-122.2812,37.154),(-122.2823,37.156),(-122.2834,37.159)]'),
+('Grand St', '[(-122.2612,37.637),(-122.2609,37.643)]'),
+('Grand Lake Dr', '[(-122.0553,37.89),(-122.056,37.894)]'),
+('Grand Lake Dr', '[(-122.0591,37.864),(-122.0587,37.861)]'),
+('Grandbrook Park Ct', '[(-121.9661,37.136),(-121.9658,37.14)]'),
+('Grandview Dr', '[(-122.229712,37.58234),(-122.230071,37.57618)]'),
+('Grange Ter', '[(-122.04547,37.62805),(-122.045749,37.62695)]'),
+('Granger Ave', '[(-122.0778,37.984),(-122.0784,37.985)]'),
+('Grant Ave', '[(-122.1491,37.732),(-122.1512,37.722)]'),
+('Grant Ave', '[(-122.1523,37.717),(-122.1535,37.712)]'),
+('Grant Ave', '[(-122.1545,37.703),(-122.1567,37.683)]'),
+('Grant St', '[(-122.2725,37.579),(-122.2723,37.57)]'),
+('Grant St', '[(-122.2729,37.597),(-122.2727,37.588)]'),
+('Grant St', '[(-122.2738,37.632),(-122.2735,37.623)]'),
+('Grant Line Road', '[(-121.583469,37.45746),(-121.583118,37.4641)]'),
+('Granville Dr', '[(-122.0105,37.357),(-122.01,37.354)]'),
+('Grass Valley Ct', '[(-122.1194,37.518),(-122.1187,37.516)]'),
+('Grass Valley Road', '[(-122.1246,37.764),(-122.1176,37.634)]'),
+('Gray Fox Cir', '[(-121.84122,37.60072),(-121.841235,37.60161)]'),
+('Grayson St', '[(-122.2883,37.56),(-122.2871,37.563)]'),
+('Grayson St', '[(-122.2916,37.553),(-122.2906,37.556)]'),
+('Greenhills', '[(-122.082437,37.05551),(-122.08375,37.05557)]'),
+('Greenly Dr', '[(-122.1595,37.704),(-122.1578,37.696)]'),
+('Greenly Dr', '[(-122.1635,37.727),(-122.161,37.716)]'),
+('Greenridge Road', '[(-122.0454,37.151),(-122.043982,37.1588),(-122.0441,37.178)]'),
+('Greens Lane', '[(-121.8938,37.339),(-121.894,37.311)]'),
+('Greentree Ct', '[(-121.8851,37.696),(-121.8855,37.692)]'),
+('Greenview Dr', '[(-122.0652,37.907),(-122.064379,37.90817)]'),
+('Greenview Dr', '[(-122.0688,37.905),(-122.0683,37.905),(-122.0663,37.907)]'),
+('Greenville Road', '[(-121.6957,37.798),(-121.6956,37.778)]'),
+('Greenville Road', '[(-121.6959,37.044),(-121.6959,37.034)]'),
+('Greenville Road', '[(-121.6999,37.175),(-121.6993,37.169)]'),
+('Greenwood Road', '[(-121.8795,37.705),(-121.8795,37.721)]'),
+('Greenwood Road', '[(-121.8795,37.745),(-121.8796,37.766)]'),
+('Greenwood Road', '[(-121.8796,37.801),(-121.8796,37.802)]'),
+('Greer Ave', '[(-122.1393,37.889),(-122.1401,37.889)]'),
+('Gresel St', '[(-122.0345,37.178),(-122.0338,37.182)]'),
+('Gresham Ct', '[(-121.8752,37.943),(-121.8754,37.946)]'),
+('Grimmer Blvd', '[(-121.9555,37.054),(-121.9534,37.05)]'),
+('Grimmer Blvd', '[(-121.9625,37.394),(-121.9633,37.383)]'),
+('Grimmer Blvd', '[(-121.9636,37.133),(-121.962341,37.11577)]'),
+('Grimmer Blvd', '[(-121.966619,37.178),(-121.966,37.165)]'),
+('Grimmer Blvd', '[(-121.967,37.332),(-121.9682,37.315)]'),
+('Grizzly Peak Blvd', '[(-122.2112,37.568),(-122.2105,37.561)]'),
+('Grizzly Peak Blvd', '[(-122.2213,37.638),(-122.2127,37.581)]'),
+('Grizzly Peak Blvd', '[(-122.254,37.915),(-122.2536,37.912)]'),
+('Grizzly Peak Blvd', '[(-122.26,37.965),(-122.259,37.952)]'),
+('Grizzly Peak Blvd', '[(-122.2689,37.035),(-122.2667,37.02)]'),
+('Grouse Way', '[(-122.0136,37.821),(-122.013412,37.83099)]'),
+('Grove St', '[(-122.2364,37.582),(-122.2357,37.59)]'),
+('Grove Way', '[(-122.0643,37.884),(-122.062679,37.89162),(-122.061796,37.89578),(-122.0609,37.9)]'),
+('Grove Way', '[(-122.078,37.842),(-122.0759,37.843)]'),
+('Grove Way', '[(-122.1041,37.76),(-122.102947,37.76318)]'),
+('Grovenor Dr', '[(-122.0893,37.224),(-122.0887,37.209)]'),
+('Gulfstream St', '[(-121.8645,37.976),(-121.8645,37.993)]'),
+('Gull Ct', '[(-122.0594,37.775),(-122.0595,37.782)]'),
+('Gull Way', '[(-121.8004,37.846),(-121.7996,37.845)]'),
+('Gunn Dr', '[(-122.1902,37.347),(-122.190933,37.35637),(-122.192,37.357)]'),
+('Guthrie St', '[(-121.861539,37.97796),(-121.860503,37.97781)]'),
+('H St', '[(-121.7625,37.766),(-121.7621,37.756)]'),
+('H St', '[(-122.0204,37.974),(-122.0207,37.972)]'),
+('Hacienda Ave', '[(-122.1192,37.754),(-122.1214,37.746)]'),
+('Hacienda Ave', '[(-122.1225,37.742),(-122.1235,37.738)]'),
+('Hacienda Ave', '[(-122.125,37.729),(-122.1259,37.719)]'),
+('Hackamore Lane', '[(-121.922474,37.86233),(-121.9223,37.863)]'),
+('Hackamore Lane', '[(-121.924324,37.85594),(-121.9239,37.857)]'),
+('Hackamore Com', '[(-121.9233,37.864),(-121.922542,37.86411)]'),
+('Haddon Pl', '[(-122.2416,37.099),(-122.2411,37.103)]'),
+('Hagemann Dr', '[(-121.79953,37.88118),(-121.7995,37.883)]'),
+('Haight Ave', '[(-122.2881,37.767),(-122.2883,37.756)]'),
+('Haley St', '[(-122.0444,37.367),(-122.042309,37.35074)]'),
+('Haley St', '[(-122.0585,37.436),(-122.0579,37.432)]'),
+('Halkin Lane', '[(-122.2684,37.983),(-122.2677,37.985)]'),
+('Halliday Ave', '[(-122.175147,37.63369),(-122.1747,37.629)]'),
+('Hamilton Pl', '[(-122.2592,37.151),(-122.2604,37.16)]'),
+('Hamilton St', '[(-122.188,37.549),(-122.1875,37.544)]'),
+('Hamlin St', '[(-122.009871,37.36805),(-122.0092,37.365)]'),
+('Hampel St', '[(-122.2248,37.078),(-122.2244,37.073)]'),
+('Hampton Road', '[(-122.1086,37.838),(-122.1073,37.84)]'),
+('Hampton Road', '[(-122.2146,37.189),(-122.2139,37.183)]'),
+('Hampton Road', '[(-122.222,37.177),(-122.2209,37.179)]'),
+('Hamrick Lane', '[(-122.0831,37.344),(-122.0839,37.342)]'),
+('Hancock Dr', '[(-121.9569,37.419),(-121.957,37.413)]'),
+('Hanly Road', '[(-122.2137,37.067),(-122.2135,37.075)]'),
+('Hannah St', '[(-122.2854,37.216),(-122.2861,37.237)]'),
+('Hanover Ave', '[(-122.2488,37.034),(-122.2477,37.037)]'),
+('Hanover Ave', '[(-122.2536,37.031),(-122.253,37.031)]'),
+('Hanover St', '[(-121.789629,37.92481),(-121.7892,37.934)]'),
+('Hanover St', '[(-121.7911,37.942),(-121.7923,37.95)]'),
+('Hanover St', '[(-121.7939,37.918),(-121.7928,37.918)]'),
+('Hansen Ave', '[(-122.0121,37.523),(-122.0124,37.519)]'),
+('Hansen Dr', '[(-121.8984,37.7),(-121.898897,37.69774)]'),
+('Hansen Road', '[(-122.0551,37.706),(-122.055,37.712)]'),
+('Hansom Dr', '[(-122.1369,37.75),(-122.1354,37.726)]'),
+('Happy Valley Road', '[(-121.877541,37.35652),(-121.871788,37.33636)]'),
+('Happy Valley Road', '[(-121.879849,37.36461),(-121.877975,37.35804)]'),
+('Happyland Ave', '[(-122.1044,37.666),(-122.104441,37.66152)]'),
+('Harbor Bay Pkwy', '[(-122.233076,37.25225),(-122.236357,37.2515),(-122.2385,37.251)]'),
+('Harbor Light Road', '[(-122.2667,37.606),(-122.2651,37.631)]'),
+('Harbor View Ave', '[(-122.1872,37.927),(-122.1866,37.921)]'),
+('Harder Road', '[(-122.0693,37.506),(-122.0688,37.506)]'),
+('Harder Road', '[(-122.0793,37.489),(-122.0802,37.488)]'),
+('Harlan St', '[(-122.1477,37.195),(-122.151,37.182)]'),
+('Harlon Ct', '[(-122.0223,37.447),(-122.0229,37.445)]'),
+('Harmon Ave', '[(-122.194,37.68),(-122.1924,37.664),(-122.1911,37.652)]'),
+('Harpers Ferry Ct', '[(-121.9019,37.758),(-121.902271,37.7633)]'),
+('Harrington Ave', '[(-122.2115,37.847),(-122.2108,37.851)]'),
+('Harris Road', '[(-122.0659,37.372),(-122.0675,37.363)]'),
+('Harris Road', '[(-122.0681,37.36),(-122.0705,37.347)]'),
+('Harrisburg Ave', '[(-122.011,37.776),(-122.0113,37.773)]'),
+('Harrison St', '[(-122.1539,37.268),(-122.1535,37.259)]'),
+('Harrison St', '[(-122.2544,37.197),(-122.2542,37.199)]'),
+('Harrison St', '[(-122.2577,37.172),(-122.2569,37.176)]'),
+('Harrison St', '[(-122.2621,37.108),(-122.262,37.11)]'),
+('Harrison St', '[(-122.2722,37.952),(-122.2717,37.958)]'),
+('Harrison St Ramp', '[(-122.262,37.11),(-122.2613,37.114)]'),
+('Hartford Dr', '[(-122.0297,37.94),(-122.0295,37.944)]'),
+('Hartley Gate Ct', '[(-121.8803,37.863),(-121.8812,37.871)]'),
+('Hartman Road', '[(-121.7876,37.217),(-121.7953,37.211)]'),
+('Harvard Way', '[(-121.754,37.805),(-121.7508,37.806)]'),
+('Harvest Road', '[(-121.8797,37.687),(-121.8807,37.691)]'),
+('Harwood Ave', '[(-122.2471,37.497),(-122.2466,37.498)]'),
+('Harwood Ave', '[(-122.25,37.489),(-122.2475,37.495)]'),
+('Haskell St', '[(-122.2825,37.512),(-122.2805,37.516)]'),
+('Hathaway Ave', '[(-122.1109,37.742),(-122.1105,37.739)]'),
+('Havasu St', '[(-121.9209,37.887),(-121.9204,37.878)]'),
+('Havenscourt Blvd', '[(-122.1891,37.634),(-122.1888,37.638),(-122.1882,37.643)]'),
+('Haverhill Dr', '[(-122.1938,37.246),(-122.1915,37.242)]'),
+('Hawkins St', '[(-121.969533,37.36702),(-121.9703,37.358)]'),
+('Hawley St', '[(-122.1921,37.531),(-122.1915,37.526)]'),
+('Hawthorne Ter', '[(-122.261,37.825),(-122.262,37.823)]'),
+('Hayfield Road', '[(-121.8292,37.314),(-121.8281,37.295)]'),
+('Hays St', '[(-122.1538,37.203),(-122.1533,37.194)]'),
+('Hayward Blvd', '[(-122.0224,37.563),(-122.0179,37.544)]'),
+('Hayward Blvd', '[(-122.0335,37.552),(-122.032996,37.55094)]'),
+('Hayward Blvd', '[(-122.03757,37.5596),(-122.033997,37.55449)]'),
+('Hayward Blvd', '[(-122.0383,37.556),(-122.0381,37.557)]'),
+('Hayward Blvd', '[(-122.050043,37.58583),(-122.0484,37.574),(-122.047,37.556)]'),
+('Hearst Ave', '[(-122.2551,37.757),(-122.2545,37.758)]'),
+('Hearst Ave', '[(-122.2691,37.738),(-122.268,37.74)]'),
+('Hearst Ave', '[(-122.2726,37.734),(-122.2715,37.735)]'),
+('Hearst Ave', '[(-122.277,37.727),(-122.2748,37.731)]'),
+('Hearst Ave', '[(-122.2858,37.714),(-122.2847,37.715)]'),
+('Hearst Ave', '[(-122.2918,37.704),(-122.2887,37.709)]'),
+('Hearst Ave', '[(-122.3027,37.682),(-122.3019,37.685)]'),
+('Heartwood Dr', '[(-122.2006,37.341),(-122.1992,37.338)]'),
+('Heathrow Ter', '[(-122.057185,37.55699),(-122.056911,37.55223)]'),
+('Hebrides Ct', '[(-122.0343,37.529),(-122.034,37.531)]'),
+('Hegenberger Exwy', '[(-122.1874,37.572),(-122.1891,37.56)]'),
+('Hegenberger Exwy', '[(-122.1946,37.52),(-122.1947,37.497)]'),
+('Hegenberger Road', '[(-122.1953,37.401),(-122.1953,37.404)]'),
+('Hegenberger Road', '[(-122.1955,37.378),(-122.1954,37.385)]'),
+('Heidelberg Dr', '[(-121.7692,37.638),(-121.7714,37.645)]'),
+('Heidelberg Dr', '[(-121.7761,37.614),(-121.7751,37.614)]'),
+('Heinz Ave', '[(-122.2953,37.527),(-122.2912,37.536)]'),
+('Hellman St', '[(-122.1403,37.471),(-122.1406,37.464)]'),
+('Helsinki Way', '[(-121.7753,37.659),(-121.7744,37.658)]'),
+('Hemlock Ter', '[(-121.986875,37.25649),(-121.986744,37.25571)]'),
+('Henry St', '[(-122.2706,37.857),(-122.2704,37.843)]'),
+('Heritage Ter', '[(-121.997217,37.55076),(-121.997913,37.54319)]'),
+('Herman Ave', '[(-121.7163,37.123),(-121.7164,37.142)]'),
+('Hermes Ct', '[(-122.0786,37.516),(-122.0784,37.514)]'),
+('Hermitage Ave', '[(-122.0542,37.384),(-122.0566,37.368)]'),
+('Hermitage Ct', '[(-121.7295,37.263),(-121.729426,37.26819)]'),
+('Hermitage Lane', '[(-122.0362,37.137),(-122.0354,37.136)]'),
+('Hermosa Ave', '[(-122.2309,37.415),(-122.231,37.404),(-122.2301,37.404)]'),
+('Herrier St', '[(-122.1943,37.006),(-122.1936,37.998)]'),
+('Herrin Way', '[(-121.9098,37.888),(-121.91,37.893)]'),
+('Hesperian Blvd', '[(-122.0878,37.182),(-122.0873,37.174)]'),
+('Hesperian Blvd', '[(-122.088064,37.18684),(-122.087886,37.18358)]'),
+('Hesperian Blvd', '[(-122.0916,37.245),(-122.0896,37.214)]'),
+('Hesperian Blvd', '[(-122.097,37.333),(-122.0956,37.31),(-122.0946,37.293)]'),
+('Hesperian Blvd', '[(-122.1079,37.513),(-122.1076,37.507)]'),
+('Hesperian Blvd', '[(-122.1102,37.551),(-122.1091,37.534)]'),
+('Hesperian Blvd', '[(-122.1132,37.6),(-122.1123,37.586)]'),
+('Hesperian Blvd', '[(-122.1257,37.792),(-122.1251,37.781)]'),
+('Hesperian Blvd', '[(-122.1287,37.989),(-122.1287,37.984)]'),
+('Hesperian Blvd', '[(-122.1288,37.922),(-122.1288,37.913)]'),
+('Hesse Dr', '[(-122.0782,37.208),(-122.0782,37.204)]'),
+('Hetch Hetchy Aqueduct', '[(-121.635378,37.0634),(-121.630012,37.07482)]'),
+('Hetch Hetchy Aqueduct', '[(-121.687586,37.92102),(-121.686938,37.92241)]'),
+('Hetch Hetchy Aqueduct', '[(-121.74008,37.81072),(-121.739425,37.81211)]'),
+('Hetch Hetchy Aqueduct', '[(-121.9355,37.477),(-121.9169,37.53)]'),
+('Hetch Hetchy Aqueduct', '[(-121.9465,37.448),(-121.945888,37.4496)]'),
+('Hetch Hetchy Aqueduct', '[(-121.94968,37.4388),(-121.9488,37.441)]'),
+('Hetch Hetchy Aqueduct', '[(-121.9615,37.407),(-121.960853,37.40854)]'),
+('Hetch Hetchy Aqueduct', '[(-122.0007,37.313),(-122.0005,37.313)]'),
+('Hetch Hetchy Aqueduct', '[(-122.0233,37.291),(-122.020432,37.29388)]'),
+('Hetch Hetchy Aqueduct', '[(-122.0255,37.283),(-122.0245,37.286)]'),
+('Hetch Hetchy Aqueduct', '[(-122.039,37.25),(-122.0404,37.247)]'),
+('Heyer Ave', '[(-122.0673,37.044),(-122.0657,37.044)]'),
+('Hibiscus Ave', '[(-121.999801,37.80223),(-121.9993,37.8)]'),
+('Hickory Lane', '[(-121.9163,37.102),(-121.91604,37.1072)]'),
+('Hickory St', '[(-122.0524,37.214),(-122.0523,37.211)]'),
+('Hidalgo Ct', '[(-121.9505,37.614),(-121.9512,37.608)]'),
+('Hidden Lane', '[(-122.0553,37.757),(-122.05301,37.75242),(-122.0503,37.747)]'),
+('Higgins Way', '[(-121.9433,37.392),(-121.9424,37.392)]'),
+('High St', '[(-121.9601,37.381),(-121.95938,37.3774)]'),
+('High St', '[(-122.1901,37.889),(-122.1899,37.891)]'),
+('High St', '[(-122.199,37.845),(-122.1983,37.849)]'),
+('High St', '[(-122.2007,37.837),(-122.1997,37.842)]'),
+('High St', '[(-122.2151,37.712),(-122.2145,37.716)]'),
+('High St', '[(-122.2233,37.647),(-122.2226,37.652)]'),
+('High St', '[(-122.2281,37.605),(-122.2273,37.611),(-122.2267,37.618)]'),
+('High St', '[(-122.2295,37.592),(-122.2288,37.597)]'),
+('High St', '[(-122.2379,37.514),(-122.2367,37.526)]'),
+('Highland Ave', '[(-122.2286,37.21),(-122.2285,37.2)]'),
+('Hilgard Ave', '[(-122.2603,37.787),(-122.2585,37.789)]'),
+('Hilgard Ave', '[(-122.2638,37.782),(-122.2624,37.783)]'),
+('Hill Road', '[(-122.2498,37.881),(-122.2486,37.868)]'),
+('Hillcrest Ave', '[(-121.7472,37.839),(-121.7473,37.834)]'),
+('Hillcrest Ave', '[(-122.0492,37.591),(-122.0485,37.587)]'),
+('Hillcroft Cir', '[(-122.2304,37.089),(-122.2301,37.093)]'),
+('Hilldale Ave', '[(-122.2629,37.96),(-122.2624,37.956)]'),
+('Hillegass Ave', '[(-122.2541,37.503),(-122.2543,37.513)]'),
+('Hillegass Ave', '[(-122.2545,37.561),(-122.2541,37.539)]'),
+('Hillegass Ave', '[(-122.2557,37.619),(-122.2554,37.601)]'),
+('Hiller Dr', '[(-122.2275,37.551),(-122.2263,37.542)]'),
+('Hiller Dr', '[(-122.228415,37.50849),(-122.2284,37.508)]'),
+('Hillgirt Cir', '[(-122.2429,37.079),(-122.2424,37.076)]'),
+('Hillside Ave', '[(-121.997183,37.84571),(-121.998118,37.83759),(-121.9983,37.836)]'),
+('Hillside Ct', '[(-122.2345,37.231),(-122.2342,37.225)]'),
+('Hillside St', '[(-122.1628,37.561),(-122.1625,37.553)]'),
+('Hilltop Cres', '[(-122.2256,37.329),(-122.2246,37.319)]'),
+('Hillview Ct', '[(-121.9178,37.841),(-121.9191,37.838)]'),
+('Hillview Road', '[(-122.253,37.934),(-122.25,37.92)]'),
+('Hilsadne Ter', '[(-122.046919,37.64183),(-122.04699,37.6443)]'),
+('Hilton St', '[(-122.03,37.877),(-122.0305,37.864)]'),
+('Hobart Ct', '[(-121.9108,37.709),(-121.9102,37.711)]'),
+('Hochler Dr', '[(-121.9111,37.317),(-121.9099,37.305)]'),
+('Hogan Pl', '[(-121.7696,37.507),(-121.7689,37.502)]'),
+('Holiday St', '[(-122.0421,37.306),(-122.0418,37.304)]'),
+('Holladay Ct', '[(-121.7773,37.842),(-121.778,37.841)]'),
+('Holland Dr', '[(-121.9115,37.798),(-121.9118,37.801)]'),
+('Holland Dr', '[(-121.9124,37.814),(-121.9126,37.821)]'),
+('Holland St', '[(-122.2038,37.688),(-122.2016,37.677)]'),
+('Hollis St', '[(-122.2851,37.314),(-122.2857,37.332)]'),
+('Hollis St', '[(-122.2866,37.355),(-122.2869,37.362)]'),
+('Hollis St', '[(-122.2885,37.397),(-122.289,37.414)]'),
+('Hollis St', '[(-122.2894,37.428),(-122.2895,37.433)]'),
+('Hollis St', '[(-122.2901,37.45),(-122.2903,37.458)]'),
+('Hollis St', '[(-122.291,37.48),(-122.2913,37.49)]'),
+('Holly St', '[(-122.1715,37.488),(-122.1704,37.472)]'),
+('Holly St', '[(-122.1742,37.532),(-122.1737,37.526)]'),
+('Holly St', '[(-122.2393,37.3),(-122.2395,37.297)]'),
+('Hollyhock Dr', '[(-122.131813,37.99633),(-122.1306,37.997)]'),
+('Holmes St', '[(-121.7784,37.776),(-121.778512,37.7704)]'),
+('Holmes St', '[(-121.7789,37.751),(-121.7789,37.747)]'),
+('Holmes St', '[(-121.7794,37.697),(-121.7794,37.67)]'),
+('Holmes St', '[(-121.7816,37.566),(-121.7818,37.56)]'),
+('Holt St', '[(-122.063,37.813),(-122.063508,37.80257)]'),
+('Honeysuckle Road', '[(-121.7458,37.102),(-121.745,37.096)]'),
+('Hooper St', '[(-121.955964,37.28079),(-121.95582,37.27507)]'),
+('Hoover Ave', '[(-122.2088,37.116),(-122.2086,37.115)]'),
+('Hop Ranch Road', '[(-122.0461,37.942),(-122.045974,37.92945)]'),
+('Hopkins Ct', '[(-122.2829,37.819),(-122.2822,37.822)]'),
+('Hopkins St', '[(-122.0778,37.184),(-122.0775,37.159)]'),
+('Hopkins St', '[(-122.284,37.802),(-122.2834,37.805)]'),
+('Hopyard Road', '[(-121.8828,37.674),(-121.8833,37.678)]'),
+('Hopyard Road', '[(-121.9026,37.975),(-121.9033,37.985)]'),
+('Horatio Way', '[(-122.0499,37.781),(-122.0505,37.774)]'),
+('Hospital Dr', '[(-122.257,37.548),(-122.2559,37.549)]'),
+('Hotchkiss St', '[(-121.9283,37.947),(-121.9287,37.958)]'),
+('Howe Ct', '[(-121.9514,37.252),(-121.9544,37.25)]'),
+('Howe St', '[(-122.2541,37.265),(-122.2537,37.267)]'),
+('Hoyt St', '[(-121.9195,37.842),(-121.9184,37.824)]'),
+('Hubbard Ave', '[(-122.1585,37.914),(-122.1602,37.914)]'),
+('Huber Dr', '[(-122.0904,37.09),(-122.09042,37.0804),(-122.0901,37.074)]'),
+('Hudson Lane', '[(-122.1483,37.14),(-122.149,37.137)]'),
+('Hugh Way', '[(-122.0322,37.185),(-122.0317,37.18)]'),
+('Hula Cir', '[(-122.0465,37.869),(-122.0468,37.875)]'),
+('Humboldt Ave', '[(-122.2145,37.872),(-122.2133,37.879)]'),
+('Hummingbird Road', '[(-121.8824,37.777),(-121.8853,37.773)]'),
+('Hummingbird Road', '[(-121.8862,37.774),(-121.8871,37.774)]'),
+('Hunter Ave', '[(-122.1824,37.312),(-122.1816,37.339)]'),
+('Huntington St', '[(-122.1866,37.895),(-122.186,37.899)]'),
+('Huntwood Ave', '[(-122.0531,37.093),(-122.0531,37.078)]'),
+('Huntwood Ave', '[(-122.06,37.279),(-122.0598,37.273)]'),
+('Huntwood Ave', '[(-122.0641,37.336),(-122.063367,37.32585),(-122.0628,37.318)]'),
+('Huntwood Ave', '[(-122.0781,37.48),(-122.0774,37.473)]'),
+('Hutton Ct', '[(-121.9826,37.274),(-121.9822,37.272)]'),
+('Hyde St', '[(-122.2198,37.883),(-122.2171,37.872)]'),
+('I St', '[(-121.7655,37.798),(-121.7652,37.791)]'),
+('I St', '[(-121.7675,37.848),(-121.7682,37.857)]'),
+('I- 205', '((-121.573292,37.41726),(-121.571644,37.42),(-121.563557,37.42641))'),
+('I- 205', '[(-121.572819,37.42107),(-121.571705,37.42168),(-121.563557,37.42641),(-121.560856,37.42885),(-121.559467,37.42946),(-121.559055,37.42939),(-121.558781,37.42992),(-121.556644,37.43214),(-121.5559,37.434)]'),
+('I- 580', '((-121.628147,37.33089),(-121.605091,37.3605),(-121.589344,37.3946),(-121.58118,37.41062),(-121.573292,37.41726),(-121.571644,37.41779),(-121.55843,37.40406))'),
+('I- 580', '((-121.628147,37.33089),(-121.629246,37.32464),(-121.644337,37.2411),(-121.654377,37.20798),(-121.654356,37.20723),(-121.654926,37.20531),(-121.658827,37.19552))'),
+('I- 580', '((-121.727,37.074),(-121.7255,37.083),(-121.7234,37.092),(-121.723,37.095),(-121.721995,37.09859),(-121.7216,37.1),(-121.7211,37.102),(-121.7188,37.109))'),
+('I- 580', '((-122.1752,37.826),(-122.177,37.833))'),
+('I- 580', '((-122.2029,37.928),(-122.2036,37.933),(-122.2043,37.938))'),
+('I- 580', '((-122.2535,37.196),(-122.2539,37.2))'),
+('I- 580', '((-122.2744,37.262),(-122.2746,37.263),(-122.2774,37.27),(-122.278,37.271),(-122.2792,37.274),(-122.2806,37.275),(-122.2817,37.276),(-122.2828,37.276),(-122.2837,37.276))'),
+('I- 580', '((-122.2837,37.276),(-122.2849,37.273),(-122.286,37.27),(-122.2868,37.269),(-122.2871,37.266),(-122.2882,37.265),(-122.2893,37.266))'),
+('I- 580', '[(-121.560856,37.42885),(-121.55843,37.40406),(-121.557655,37.39926),(-121.556,37.389)]'),
+('I- 580', '[(-121.628757,37.34287),(-121.600742,37.38407),(-121.588856,37.40124),(-121.580494,37.41451),(-121.572819,37.42107)]'),
+('I- 580', '[(-121.628757,37.34287),(-121.630009,37.33791),(-121.657688,37.20089),(-121.658827,37.19552),(-121.659626,37.19326),(-121.660816,37.18952)]'),
+('I- 580', '[(-121.664341,37.1822),(-121.662081,37.18693),(-121.661812,37.18746),(-121.660816,37.18952)]'),
+('I- 580', '[(-121.664341,37.1822),(-121.666965,37.18166),(-121.6697,37.185)]'),
+('I- 580', '[(-121.727,37.074),(-121.7229,37.093),(-121.722301,37.09522),(-121.721001,37.10005),(-121.7194,37.106),(-121.7188,37.109),(-121.7168,37.12),(-121.7163,37.123),(-121.7145,37.127),(-121.7096,37.148),(-121.707731,37.1568),(-121.7058,37.166),(-121.7055,37.168),(-121.7044,37.174),(-121.7038,37.172),(-121.7037,37.172),(-121.7027,37.175),(-121.7001,37.181),(-121.6957,37.191),(-121.6948,37.192),(-121.6897,37.204),(-121.6697,37.185)]'),
+('I- 580', '[(-121.727,37.074),(-121.7275,37.072),(-121.7331,37.046)]'),
+('I- 580', '[(-121.7705,37.013),(-121.769039,37.01504),(-121.7583,37.03),(-121.7557,37.03),(-121.754805,37.02966),(-121.750803,37.02812),(-121.75,37.02738),(-121.7489,37.026),(-121.7453,37.024),(-121.7438,37.024),(-121.7411,37.024),(-121.740416,37.02505),(-121.739035,37.02719),(-121.7379,37.028),(-121.736275,37.03278),(-121.7362,37.033),(-121.7358,37.034),(-121.7331,37.046)]'),
+('I- 580', '[(-121.8585,37.013),(-121.8521,37.011),(-121.8485,37.011),(-121.8463,37.011),(-121.8455,37.011),(-121.8416,37.011),(-121.8414,37.011),(-121.834001,37.0104),(-121.8292,37.01),(-121.8288,37.009),(-121.82332,37.00833),(-121.8206,37.008)]'),
+('I- 580', '[(-121.8585,37.013),(-121.863393,37.01213),(-121.8641,37.012)]'),
+('I- 580', '[(-121.9214,37.015),(-121.9189,37.02),(-121.918,37.02),(-121.9087,37.017),(-121.90609,37.01797),(-121.906,37.018)]'),
+('I- 580', '[(-121.9214,37.015),(-121.9217,37.014)]'),
+('I- 580', '[(-121.9322,37.989),(-121.9243,37.006),(-121.9217,37.014)]'),
+('I- 580', '[(-122.018,37.019),(-122.0009,37.032),(-121.9787,37.983),(-121.958,37.984),(-121.9571,37.986)]'),
+('I- 580', '[(-122.0911,37.906),(-122.09,37.908),(-122.0882,37.908),(-122.0856,37.909),(-122.078489,37.909),(-122.0726,37.909),(-122.0711,37.91),(-122.068287,37.91137),(-122.0649,37.914)]'),
+('I- 580', '[(-122.098,37.908),(-122.0965,37.904),(-122.095586,37.903),(-122.0953,37.903),(-122.0943,37.902),(-122.0938,37.903),(-122.093241,37.90351)]'),
+('I- 580', '[(-122.1108,37.023),(-122.1101,37.02),(-122.108103,37.00764),(-122.108,37.007),(-122.1069,37.998),(-122.1064,37.994),(-122.1053,37.982),(-122.1048,37.977),(-122.1032,37.958),(-122.1026,37.953),(-122.1013,37.938),(-122.0989,37.911),(-122.0984,37.91),(-122.098,37.908)]'),
+('I- 580', '[(-122.1306,37.157),(-122.1298,37.147),(-122.1277,37.122),(-122.126709,37.11468),(-122.1254,37.105),(-122.125,37.103),(-122.1237,37.096),(-122.1231,37.093),(-122.1214,37.082),(-122.1183,37.066),(-122.116,37.052),(-122.1153,37.048),(-122.1108,37.023)]'),
+('I- 580', '[(-122.1543,37.703),(-122.1535,37.694),(-122.1512,37.655),(-122.1475,37.603),(-122.1468,37.583),(-122.1472,37.569),(-122.149044,37.54874),(-122.1493,37.546),(-122.1501,37.532),(-122.1506,37.509),(-122.1495,37.482),(-122.1487,37.467),(-122.1477,37.447),(-122.1414,37.383),(-122.1404,37.376),(-122.1398,37.372),(-122.139,37.356),(-122.1388,37.353),(-122.1385,37.34),(-122.1382,37.33),(-122.1378,37.316)]'),
+('I- 580', '[(-122.1716,37.805),(-122.1703,37.799),(-122.170042,37.79758),(-122.169413,37.79411),(-122.167295,37.78244),(-122.166339,37.77717),(-122.165224,37.77112),(-122.1648,37.769)]'),
+('I- 580', '[(-122.1716,37.805),(-122.1728,37.811),(-122.1742,37.817)]'),
+('I- 580', '[(-122.177,37.833),(-122.1789,37.838)]'),
+('I- 580', '[(-122.2043,37.938),(-122.204734,37.94074),(-122.2062,37.95),(-122.207492,37.95608),(-122.2079,37.958),(-122.2085,37.962)]'),
+('I- 580', '[(-122.2197,37.99),(-122.22,37.99),(-122.222092,37.99523),(-122.2232,37.998),(-122.224146,37.99963),(-122.2261,37.003),(-122.2278,37.007),(-122.2302,37.026),(-122.2323,37.043),(-122.2344,37.059),(-122.235405,37.06427),(-122.2365,37.07)]'),
+('I- 580', '[(-122.2535,37.196),(-122.2533,37.196)]'),
+('I- 580', '[(-122.2539,37.2),(-122.2541,37.201)]'),
+('I- 580', '[(-122.2613,37.23),(-122.2601,37.22833),(-122.2611,37.231),(-122.2639,37.238),(-122.2646,37.241),(-122.2654,37.242)]'),
+('I- 580', '[(-122.2613,37.23),(-122.263448,37.23307),(-122.2647,37.23486),(-122.2655,37.236),(-122.2664,37.238)]'),
+('I- 580', '[(-122.2664,37.238),(-122.2675,37.243)]'),
+('I- 580', '[(-122.2675,37.243),(-122.2677,37.243),(-122.2681,37.244)]'),
+('I- 580', '[(-122.2679,37.248),(-122.2681,37.248)]'),
+('I- 580', '[(-122.2744,37.262),(-122.2734,37.259),(-122.2695,37.247),(-122.268532,37.2449),(-122.268237,37.24426),(-122.2681,37.244)]'),
+('I- 580', '[(-122.2893,37.266),(-122.2904,37.27),(-122.2909,37.273)]'),
+('I- 580', '[(-122.2901,37.274),(-122.2905,37.278),(-122.2921,37.286),(-122.2927,37.299)]'),
+('I- 580', '[(-122.2909,37.273),(-122.2918,37.279),(-122.2923,37.282)]'),
+('I- 580', '[(-122.2928,37.293),(-122.2931,37.301)]'),
+('I- 580 Ramp', '((-121.74,37.036),(-121.7393,37.033),(-121.7384,37.032))'),
+('I- 580 Ramp', '((-121.7843,37.996),(-121.784294,37.99539),(-121.7842,37.985))'),
+('I- 580 Ramp', '((-121.818,37.011),(-121.8187,37.014))'),
+('I- 580 Ramp', '((-121.8185,37.008),(-121.8187,37.001))'),
+('I- 580 Ramp', '((-121.9025,37.018),(-121.9037,37.022),(-121.9059,37.029))'),
+('I- 580 Ramp', '((-121.9335,37.987),(-121.9331,37.979))'),
+('I- 580 Ramp', '((-122.0206,37.007),(-122.0203,37.015))'),
+('I- 580 Ramp', '((-122.1202,37.085),(-122.1203,37.083))'),
+('I- 580 Ramp', '((-122.1522,37.526),(-122.1514,37.524))'),
+('I- 580 Ramp', '((-122.2541,37.201),(-122.254,37.205))'),
+('I- 580 Ramp', '((-122.2646,37.241),(-122.2653,37.244),(-122.266,37.245))'),
+('I- 580 Ramp', '((-122.2654,37.242),(-122.266,37.245),(-122.2671,37.245))'),
+('I- 580 Ramp', '((-122.2786,37.288),(-122.2798,37.286),(-122.2804,37.285),(-122.2814,37.282),(-122.2818,37.28))'),
+('I- 580 Ramp', '((-122.2796,37.289),(-122.2818,37.283),(-122.2822,37.281))'),
+('I- 580 Ramp', '[(-121.657688,37.20089),(-121.658176,37.20089),(-121.659977,37.19715),(-121.660232,37.1965),(-121.661524,37.18996),(-121.662081,37.18693)]'),
+('I- 580 Ramp', '[(-121.660816,37.18952),(-121.659428,37.19105),(-121.658115,37.19272),(-121.657078,37.19639),(-121.654926,37.20531)]'),
+('I- 580 Ramp', '[(-121.7218,37.088),(-121.722301,37.09522)]'),
+('I- 580 Ramp', '[(-121.7231,37.108),(-121.7211,37.102)]'),
+('I- 580 Ramp', '[(-121.7232,37.103),(-121.7222,37.103),(-121.721995,37.09859)]'),
+('I- 580 Ramp', '[(-121.7232,37.103),(-121.7234,37.092)]'),
+('I- 580 Ramp', '[(-121.7255,37.083),(-121.7232,37.114)]'),
+('I- 580 Ramp', '[(-121.727,37.074),(-121.7237,37.084),(-121.723311,37.0823),(-121.7221,37.077),(-121.7219,37.081),(-121.720744,37.09257),(-121.7194,37.106)]'),
+('I- 580 Ramp', '[(-121.739,37.02),(-121.738298,37.02506),(-121.737988,37.02686),(-121.7379,37.028)]'),
+('I- 580 Ramp', '[(-121.739,37.02),(-121.7402,37.015)]'),
+('I- 580 Ramp', '[(-121.74,37.034),(-121.7409,37.034),(-121.7401,37.029),(-121.7384,37.032),(-121.7358,37.034)]'),
+('I- 580 Ramp', '[(-121.7411,37.024),(-121.7401,37.018),(-121.7401,37.024)]'),
+('I- 580 Ramp', '[(-121.7438,37.024),(-121.742961,37.02896),(-121.7416,37.037),(-121.74,37.039)]'),
+('I- 580 Ramp', '[(-121.7743,37.006),(-121.7729,37.006),(-121.7705,37.013)]'),
+('I- 580 Ramp', '[(-121.7743,37.006),(-121.7729,37.013),(-121.7705,37.013)]'),
+('I- 580 Ramp', '[(-121.7865,37.995),(-121.7852,37.992),(-121.7842,37.985),(-121.7838,37.966),(-121.7834,37.957)]'),
+('I- 580 Ramp', '[(-121.7891,37.998),(-121.7854,37.999),(-121.78441,37.9963),(-121.7843,37.996)]'),
+('I- 580 Ramp', '[(-121.8195,37.007),(-121.8187,37.014),(-121.8179,37.015)]'),
+('I- 580 Ramp', '[(-121.8206,37.008),(-121.8187,37.001),(-121.8179,37.005)]'),
+('I- 580 Ramp', '[(-121.8454,37.01),(-121.8455,37.011)]'),
+('I- 580 Ramp', '[(-121.8463,37.011),(-121.8496,37.025)]'),
+('I- 580 Ramp', '[(-121.8521,37.011),(-121.8479,37.999),(-121.8476,37.999),(-121.8456,37.01),(-121.8455,37.011)]'),
+('I- 580 Ramp', '[(-121.8521,37.011),(-121.8496,37.025)]'),
+('I- 580 Ramp', '[(-121.866951,37.01385),(-121.871381,37.02608)]'),
+('I- 580 Ramp', '[(-121.8695,37.013),(-121.8712,37.011),(-121.8717,37.001),(-121.8714,37.001)]'),
+('I- 580 Ramp', '[(-121.8713,37.014),(-121.871352,37.02321)]'),
+('I- 580 Ramp', '[(-121.8743,37.014),(-121.8722,37.999),(-121.8714,37.999)]'),
+('I- 580 Ramp', '[(-121.9043,37.998),(-121.9036,37.013),(-121.902632,37.0174),(-121.9025,37.018)]'),
+('I- 580 Ramp', '[(-121.906,37.018),(-121.9056,37.011)]'),
+('I- 580 Ramp', '[(-121.906,37.018),(-121.905635,37.0239),(-121.9065,37.023)]'),
+('I- 580 Ramp', '[(-121.906,37.018),(-121.906044,37.02416),(-121.906177,37.02331),(-121.906315,37.02115)]'),
+('I- 580 Ramp', '[(-121.9068,37.027),(-121.9059,37.029),(-121.9078,37.04)]'),
+('I- 580 Ramp', '[(-121.9087,37.017),(-121.9056,37.003),(-121.905,37.004)]'),
+('I- 580 Ramp', '[(-121.9087,37.017),(-121.907194,37.02619),(-121.9071,37.029),(-121.9072,37.033)]'),
+('I- 580 Ramp', '[(-121.9335,37.987),(-121.9341,37.991),(-121.9345,37.985)]'),
+('I- 580 Ramp', '[(-121.9345,37.985),(-121.9341,37.978)]'),
+('I- 580 Ramp', '[(-121.9364,37.986),(-121.9338,37.971),(-121.9331,37.979),(-121.9322,37.989)]'),
+('I- 580 Ramp', '[(-121.9368,37.986),(-121.936483,37.98832),(-121.9353,37.997),(-121.93504,37.00035),(-121.9346,37.006),(-121.933764,37.00031),(-121.9333,37.997),(-121.9322,37.989)]'),
+('I- 580 Ramp', '[(-121.9562,37.984),(-121.9565,37.98)]'),
+('I- 580 Ramp', '[(-121.9571,37.986),(-121.9565,37.98)]'),
+('I- 580 Ramp', '[(-121.958,37.984),(-121.9565,37.98)]'),
+('I- 580 Ramp', '[(-122.0195,37.012),(-122.0184,37.009),(-122.018,37.019)]'),
+('I- 580 Ramp', '[(-122.0195,37.012),(-122.0203,37.015),(-122.0212,37.02)]'),
+('I- 580 Ramp', '[(-122.0531,37.932),(-122.0544,37.941)]'),
+('I- 580 Ramp', '[(-122.0649,37.914),(-122.0618,37.916),(-122.0604,37.92)]'),
+('I- 580 Ramp', '[(-122.0649,37.914),(-122.0639,37.92),(-122.063,37.923)]'),
+('I- 580 Ramp', '[(-122.0884,37.911),(-122.0856,37.909)]'),
+('I- 580 Ramp', '[(-122.093241,37.90351),(-122.09364,37.89634),(-122.093788,37.89212)]'),
+('I- 580 Ramp', '[(-122.0934,37.896),(-122.09257,37.89961),(-122.0911,37.906)]'),
+('I- 580 Ramp', '[(-122.0941,37.897),(-122.0943,37.902)]'),
+('I- 580 Ramp', '[(-122.0953,37.903),(-122.0971,37.911),(-122.0943,37.902)]'),
+('I- 580 Ramp', '[(-122.096,37.888),(-122.0962,37.891),(-122.0964,37.9)]'),
+('I- 580 Ramp', '[(-122.101,37.898),(-122.1005,37.902),(-122.0989,37.911)]'),
+('I- 580 Ramp', '[(-122.108,37.007),(-122.1093,37.02)]'),
+('I- 580 Ramp', '[(-122.1086,37.003),(-122.1068,37.993),(-122.1066,37.992),(-122.1053,37.982)]'),
+('I- 580 Ramp', '[(-122.1086,37.003),(-122.1103,37.018),(-122.1108,37.023),(-122.1093,37.02)]'),
+('I- 580 Ramp', '[(-122.1206,37.088),(-122.1203,37.083),(-122.1183,37.066)]'),
+('I- 580 Ramp', '[(-122.1215,37.075),(-122.1183,37.066)]'),
+('I- 580 Ramp', '[(-122.1226,37.099),(-122.1238,37.102),(-122.1254,37.105)]'),
+('I- 580 Ramp', '[(-122.1237,37.096),(-122.1234,37.09)]'),
+('I- 580 Ramp', '[(-122.1311,37.177),(-122.1306,37.157)]'),
+('I- 580 Ramp', '[(-122.1338,37.222),(-122.135,37.227)]'),
+('I- 580 Ramp', '[(-122.1362,37.248),(-122.1374,37.249)]'),
+('I- 580 Ramp', '[(-122.1371,37.279),(-122.1367,37.264)]'),
+('I- 580 Ramp', '[(-122.1371,37.279),(-122.1381,37.262)]'),
+('I- 580 Ramp', '[(-122.1378,37.316),(-122.1374,37.311),(-122.1373,37.307),(-122.1367,37.296)]'),
+('I- 580 Ramp', '[(-122.1379,37.282),(-122.1371,37.279)]'),
+('I- 580 Ramp', '[(-122.1391,37.367),(-122.1388,37.353)]'),
+('I- 580 Ramp', '[(-122.1414,37.383),(-122.1407,37.376),(-122.1403,37.372),(-122.139,37.356)]'),
+('I- 580 Ramp', '[(-122.1487,37.467),(-122.1476,37.454)]'),
+('I- 580 Ramp', '[(-122.1493,37.546),(-122.1508,37.535)]'),
+('I- 580 Ramp', '[(-122.1495,37.482),(-122.1489,37.452)]'),
+('I- 580 Ramp', '[(-122.1521,37.529),(-122.1514,37.524),(-122.1506,37.509)]'),
+('I- 580 Ramp', '[(-122.1521,37.682),(-122.151,37.659),(-122.1512,37.655)]'),
+('I- 580 Ramp', '[(-122.1539,37.707),(-122.1535,37.694)]'),
+('I- 580 Ramp', '[(-122.1553,37.706),(-122.1543,37.703)]'),
+('I- 580 Ramp', '[(-122.1567,37.727),(-122.156,37.71)]'),
+('I- 580 Ramp', '[(-122.1648,37.769),(-122.16472,37.7682),(-122.1638,37.759)]'),
+('I- 580 Ramp', '[(-122.1716,37.805),(-122.1725,37.816)]'),
+('I- 580 Ramp', '[(-122.1729,37.803),(-122.1716,37.801),(-122.1703,37.799)]'),
+('I- 580 Ramp', '[(-122.1742,37.817),(-122.1752,37.822),(-122.177,37.833)]'),
+('I- 580 Ramp', '[(-122.1764,37.839),(-122.1756,37.838),(-122.1743,37.833)]'),
+('I- 580 Ramp', '[(-122.1773,37.839),(-122.1764,37.839)]'),
+('I- 580 Ramp', '[(-122.1789,37.838),(-122.1773,37.839)]'),
+('I- 580 Ramp', '[(-122.1823,37.838),(-122.182011,37.83754),(-122.180678,37.83541),(-122.1798,37.834),(-122.1798,37.838)]'),
+('I- 580 Ramp', '[(-122.1873,37.838),(-122.1868,37.841),(-122.1866,37.844),(-122.1854,37.841),(-122.1847,37.84)]'),
+('I- 580 Ramp', '[(-122.1895,37.844),(-122.1886,37.845)]'),
+('I- 580 Ramp', '[(-122.1909,37.85),(-122.1892,37.848),(-122.1879,37.844)]'),
+('I- 580 Ramp', '[(-122.1917,37.853),(-122.1927,37.863)]'),
+('I- 580 Ramp', '[(-122.1924,37.854),(-122.189775,37.84425),(-122.1889,37.841)]'),
+('I- 580 Ramp', '[(-122.1975,37.878),(-122.196458,37.87516),(-122.1964,37.875),(-122.1951,37.871),(-122.1942,37.869)]'),
+('I- 580 Ramp', '[(-122.2017,37.923),(-122.2029,37.928)]'),
+('I- 580 Ramp', '[(-122.2027,37.918),(-122.2037,37.93),(-122.2043,37.938)]'),
+('I- 580 Ramp', '[(-122.2079,37.958),(-122.2099,37.962)]'),
+('I- 580 Ramp', '[(-122.2085,37.962),(-122.209,37.966)]'),
+('I- 580 Ramp', '[(-122.2158,37.985),(-122.2173,37.989),(-122.2178,37.991),(-122.218357,37.99071),(-122.219392,37.99016),(-122.2197,37.99)]'),
+('I- 580 Ramp', '[(-122.2161,37.976),(-122.218,37.982),(-122.218481,37.98426),(-122.2197,37.99)]'),
+('I- 580 Ramp', '[(-122.2271,37.001),(-122.2261,37.003)]'),
+('I- 580 Ramp', '[(-122.2278,37.013),(-122.2261,37.003)]'),
+('I- 580 Ramp', '[(-122.2365,37.07),(-122.2346,37.052),(-122.2338,37.044)]'),
+('I- 580 Ramp', '[(-122.2428,37.096),(-122.2414,37.091),(-122.241182,37.09018),(-122.2406,37.088)]'),
+('I- 580 Ramp', '[(-122.2453,37.095),(-122.2414,37.089)]'),
+('I- 580 Ramp', '[(-122.249,37.121),(-122.2476,37.12)]'),
+('I- 580 Ramp', '[(-122.2491,37.115),(-122.2489,37.113)]');
+
+INSERT INTO road VALUES
+('I- 580 Ramp', '[(-122.2494,37.125),(-122.2489,37.113)]'),
+('I- 580 Ramp', '[(-122.2501,37.148),(-122.249485,37.14041),(-122.2484,37.127)]'),
+('I- 580 Ramp', '[(-122.2529,37.197),(-122.2525,37.192),(-122.2517,37.174)]'),
+('I- 580 Ramp', '[(-122.2535,37.192),(-122.253,37.182)]'),
+('I- 580 Ramp', '[(-122.2535,37.192),(-122.2539,37.2)]'),
+('I- 580 Ramp', '[(-122.2547,37.205),(-122.254,37.205),(-122.2538,37.202),(-122.2535,37.196)]'),
+('I- 580 Ramp', '[(-122.2564,37.213),(-122.2542,37.199),(-122.2538,37.19)]'),
+('I- 580 Ramp', '[(-122.2564,37.213),(-122.2544,37.197),(-122.2538,37.19)]'),
+('I- 580 Ramp', '[(-122.2604,37.222),(-122.2613,37.23)]'),
+('I- 580 Ramp', '[(-122.2639,37.238),(-122.2659,37.239),(-122.2664,37.238),(-122.2676,37.231),(-122.268,37.227)]'),
+('I- 580 Ramp', '[(-122.267,37.261),(-122.2671,37.263)]'),
+('I- 580 Ramp', '[(-122.2671,37.245),(-122.2673,37.248)]'),
+('I- 580 Ramp', '[(-122.2671,37.245),(-122.2675,37.243)]'),
+('I- 580 Ramp', '[(-122.2673,37.248),(-122.2676,37.25),(-122.2677,37.252)]'),
+('I- 580 Ramp', '[(-122.2676,37.273),(-122.267231,37.28349),(-122.266927,37.29214)]'),
+('I- 580 Ramp', '[(-122.2676,37.273),(-122.2679,37.264),(-122.2677,37.252)]'),
+('I- 580 Ramp', '[(-122.2677,37.242),(-122.2675,37.243)]'),
+('I- 580 Ramp', '[(-122.2677,37.242),(-122.2681,37.238),(-122.2678,37.233)]'),
+('I- 580 Ramp', '[(-122.2677,37.242),(-122.2681,37.244)]'),
+('I- 580 Ramp', '[(-122.2677,37.242),(-122.2683,37.243)]'),
+('I- 580 Ramp', '[(-122.2677,37.252),(-122.267508,37.25368),(-122.267,37.261)]'),
+('I- 580 Ramp', '[(-122.2683,37.243),(-122.2685,37.243)]'),
+('I- 580 Ramp', '[(-122.268532,37.2449),(-122.2685,37.243)]'),
+('I- 580 Ramp', '[(-122.2686,37.249),(-122.2682,37.245),(-122.2681,37.244)]'),
+('I- 580 Ramp', '[(-122.2686,37.249),(-122.268532,37.2449)]'),
+('I- 580 Ramp', '[(-122.2686,37.249),(-122.2701,37.255)]'),
+('I- 580 Ramp', '[(-122.2695,37.247),(-122.2686,37.249),(-122.2677,37.252)]'),
+('I- 580 Ramp', '[(-122.2695,37.247),(-122.2692,37.244),(-122.2684,37.234)]'),
+('I- 580 Ramp', '[(-122.2716,37.259),(-122.2734,37.259)]'),
+('I- 580 Ramp', '[(-122.2806,37.275),(-122.2818,37.28),(-122.2822,37.281),(-122.2837,37.276)]'),
+('I- 580 Ramp', '[(-122.2913,37.278),(-122.2917,37.282)]'),
+('I- 580 Ramp', '[(-122.2917,37.282),(-122.2921,37.286)]'),
+('I- 580/I-680 Ramp', '((-121.9207,37.988),(-121.9192,37.016))'),
+('I- 580/I-680 Ramp', '((-121.9218,37.021),(-121.9237,37.017))'),
+('I- 580/I-680 Ramp', '[(-121.9213,37.005),(-121.9203,37.013),(-121.9192,37.016),(-121.918,37.02)]'),
+('I- 580/I-680 Ramp', '[(-121.922017,37.02317),(-121.9212,37.021)]'),
+('I- 580/I-680 Ramp', '[(-121.9225,37.034),(-121.9218,37.031),(-121.9213,37.026),(-121.919443,37.02043),(-121.921326,37.01739)]'),
+('I- 580/I-680 Ramp', '[(-121.9243,37.006),(-121.9238,37.005),(-121.9225,37.008),(-121.92154,37.0104)]'),
+('I- 580/I-680 Ramp', '[(-121.9243,37.006),(-121.924389,37.00779),(-121.9237,37.017),(-121.9231,37.022),(-121.9227,37.029),(-121.9229,37.039)]'),
+('I- 680', '((-121.8706,37.038),(-121.8709,37.047))'),
+('I- 680', '((-121.939,37.15),(-121.9387,37.145),(-121.9373,37.125),(-121.934242,37.07643),(-121.933886,37.0709),(-121.9337,37.068),(-121.933122,37.06139),(-121.932736,37.05698),(-121.93222,37.05108),(-121.931844,37.04678),(-121.930113,37.027),(-121.926829,37),(-121.9265,37.998),(-121.9217,37.96),(-121.9203,37.949),(-121.9184,37.934))'),
+('I- 680', '[(-121.8709,37.047),(-121.8831,37.366),(-121.8833,37.376)]'),
+('I- 680', '[(-121.8852,37.422),(-121.8874,37.444),(-121.8902,37.47),(-121.8905,37.472),(-121.8907,37.474),(-121.8985,37.545),(-121.8994,37.553),(-121.9007,37.565)]'),
+('I- 680', '[(-121.8867,37.732),(-121.8845,37.744),(-121.8818,37.756),(-121.8761,37.781),(-121.8712,37.857)]'),
+('I- 680', '[(-121.902447,37.64695),(-121.903435,37.65882)]'),
+('I- 680', '[(-121.9101,37.715),(-121.909801,37.70519),(-121.909562,37.69734),(-121.909493,37.69507),(-121.9094,37.692),(-121.909295,37.68862),(-121.909145,37.6838),(-121.909103,37.68245),(-121.908715,37.66995),(-121.908524,37.6638),(-121.9082,37.653)]'),
+('I- 680', '[(-121.9101,37.715),(-121.911269,37.74682),(-121.9119,37.764),(-121.9124,37.776),(-121.9174,37.905),(-121.9194,37.957),(-121.9207,37.988)]'),
+('I- 680', '[(-121.9139,37.562),(-121.9077,37.609)]'),
+('I- 680', '[(-121.9139,37.562),(-121.915,37.54),(-121.9156,37.532),(-121.9165,37.519),(-121.9174,37.504),(-121.918,37.493),(-121.92,37.438),(-121.9202,37.435),(-121.9233,37.404),(-121.9238,37.402)]'),
+('I- 680', '[(-121.9184,37.934),(-121.917,37.913),(-121.9122,37.83),(-121.9052,37.702)]'),
+('I- 680', '[(-121.92154,37.0104),(-121.9217,37.014)]'),
+('I- 680', '[(-121.9217,37.014),(-121.9218,37.021)]'),
+('I- 680', '[(-121.9229,37.039),(-121.9243,37.057),(-121.9286,37.106),(-121.929195,37.11329),(-121.929661,37.119),(-121.932027,37.148),(-121.93391,37.17107),(-121.9357,37.193),(-121.936421,37.20193),(-121.9378,37.219)]'),
+('I- 680', '[(-121.939,37.15),(-121.9418,37.195)]'),
+('I- 680 Ramp', '((-121.9007,37.565),(-121.9008,37.558))'),
+('I- 680 Ramp', '((-121.921,37.965),(-121.9198,37.96),(-121.9208,37.957),(-121.9199,37.951),(-121.9187,37.941))'),
+('I- 680 Ramp', '((-121.9247,37.932),(-121.9211,37.944),(-121.9201,37.944))'),
+('I- 680 Ramp', '((-121.9368,37.149),(-121.937,37.144))'),
+('I- 680 Ramp', '((-121.9372,37.335),(-121.938,37.32))'),
+('I- 680 Ramp', '((-121.9402,37.143),(-121.94,37.139))'),
+('I- 680 Ramp', '((-121.9418,37.314),(-121.9414,37.32))'),
+('I- 680 Ramp', '((-121.9422,37.314),(-121.9423,37.318))'),
+('I- 680 Ramp', '[(-121.8698,37.01),(-121.8706,37.038)]'),
+('I- 680 Ramp', '[(-121.8701,37.878),(-121.8681,37.881)]'),
+('I- 680 Ramp', '[(-121.8703,37.891),(-121.8712,37.857),(-121.8678,37.875)]'),
+('I- 680 Ramp', '[(-121.8709,37.924),(-121.8686,37.925)]'),
+('I- 680 Ramp', '[(-121.8712,37.01),(-121.8709,37.047)]'),
+('I- 680 Ramp', '[(-121.8818,37.756),(-121.8842,37.741),(-121.8867,37.732)]'),
+('I- 680 Ramp', '[(-121.8833,37.376),(-121.8833,37.392),(-121.883,37.4),(-121.8835,37.402),(-121.8852,37.422)]'),
+('I- 680 Ramp', '[(-121.8839,37.397),(-121.8847,37.394),(-121.884,37.399)]'),
+('I- 680 Ramp', '[(-121.8985,37.545),(-121.9001,37.565),(-121.8999,37.571),(-121.9008,37.572),(-121.903,37.586)]'),
+('I- 680 Ramp', '[(-121.8994,37.553),(-121.9008,37.558),(-121.9014,37.565)]'),
+('I- 680 Ramp', '[(-121.9027,37.672),(-121.902847,37.6715),(-121.90161,37.64898)]'),
+('I- 680 Ramp', '[(-121.905,37.699),(-121.9004,37.677),(-121.90161,37.64898)]'),
+('I- 680 Ramp', '[(-121.9052,37.702),(-121.9047,37.667),(-121.903435,37.65882)]'),
+('I- 680 Ramp', '[(-121.9077,37.609),(-121.9036,37.614)]'),
+('I- 680 Ramp', '[(-121.9077,37.609),(-121.9053,37.625)]'),
+('I- 680 Ramp', '[(-121.9167,37.5),(-121.9174,37.504)]'),
+('I- 680 Ramp', '[(-121.92,37.438),(-121.9218,37.424),(-121.9238,37.408),(-121.9252,37.392)]'),
+('I- 680 Ramp', '[(-121.921,37.965),(-121.922,37.966),(-121.9214,37.961)]'),
+('I- 680 Ramp', '[(-121.9226,37.394),(-121.9232,37.392),(-121.9252,37.392)]'),
+('I- 680 Ramp', '[(-121.9238,37.402),(-121.9234,37.395),(-121.923,37.399)]'),
+('I- 680 Ramp', '[(-121.9265,37.998),(-121.9242,37.983),(-121.922383,37.9786),(-121.9198,37.975),(-121.9195,37.954),(-121.9187,37.941),(-121.9184,37.934)]'),
+('I- 680 Ramp', '[(-121.9265,37.998),(-121.9249,37.98),(-121.9227,37.963),(-121.9221,37.959),(-121.9214,37.954),(-121.9206,37.947),(-121.9201,37.944),(-121.9184,37.934)]'),
+('I- 680 Ramp', '[(-121.9373,37.148),(-121.937,37.144),(-121.9373,37.125)]'),
+('I- 680 Ramp', '[(-121.9387,37.145),(-121.9376,37.147)]'),
+('I- 680 Ramp', '[(-121.9394,37.144),(-121.9387,37.145)]'),
+('I- 680 Ramp', '[(-121.9401,37.233),(-121.9378,37.219),(-121.937899,37.22791),(-121.938,37.237)]'),
+('I- 680 Ramp', '[(-121.9406,37.142),(-121.94,37.139),(-121.9373,37.125)]'),
+('I- 680 Ramp', '[(-121.9426,37.315),(-121.9423,37.318),(-121.9414,37.32),(-121.9394,37.324),(-121.938,37.32),(-121.9368,37.313)]'),
+('I- 80', '((-122.2927,37.299),(-122.2928,37.293),(-122.2932,37.284))'),
+('I- 80', '((-122.2931,37.301),(-122.2949,37.279))'),
+('I- 80', '((-122.2937,37.277),(-122.3016,37.262))'),
+('I- 80', '((-122.2949,37.279),(-122.2962,37.273))'),
+('I- 80', '((-122.2962,37.273),(-122.3004,37.264))'),
+('I- 80', '((-122.3004,37.264),(-122.3016,37.262),(-122.3051,37.254),(-122.3083,37.249))'),
+('I- 80', '((-122.307,37.902),(-122.3074,37.896),(-122.307512,37.89327),(-122.3081,37.879),(-122.3077,37.861))'),
+('I- 80', '[(-122.2932,37.284),(-122.2934,37.28)]'),
+('I- 80', '[(-122.2981,37.492),(-122.2978,37.48),(-122.2976,37.473),(-122.2971,37.452),(-122.2962,37.413)]'),
+('I- 80', '[(-122.3023,37.644),(-122.2988,37.518)]'),
+('I- 80', '[(-122.3062,37.774),(-122.3038,37.695)]'),
+('I- 80', '[(-122.3065,37.935),(-122.3065,37.913),(-122.3067,37.905),(-122.307,37.902)]'),
+('I- 80', '[(-122.3075,37.828),(-122.3076,37.831)]'),
+('I- 80', '[(-122.3075,37.828),(-122.3077,37.822),(-122.3074,37.817),(-122.3069,37.801),(-122.3068,37.795)]'),
+('I- 80', '[(-122.308,37.98),(-122.3066,37.943),(-122.3056,37.912),(-122.3057,37.908),(-122.305805,37.90511),(-122.3061,37.897),(-122.3064,37.893),(-122.3073,37.881),(-122.3073,37.877),(-122.3077,37.861),(-122.3076,37.831)]'),
+('I- 80', '[(-122.3083,37.249),(-122.3281,37.216),(-122.348,37.175)]'),
+('I- 80 Ramp', '((-122.2944,37.491),(-122.2956,37.484),(-122.2965,37.478))'),
+('I- 80 Ramp', '((-122.2983,37.501),(-122.2979,37.499))'),
+('I- 80 Ramp', '((-122.3017,37.67),(-122.3022,37.662))'),
+('I- 80 Ramp', '[(-122.2871,37.266),(-122.2901,37.274)]'),
+('I- 80 Ramp', '[(-122.2883,37.247),(-122.2904,37.267),(-122.2909,37.273),(-122.2918,37.275),(-122.2937,37.277)]'),
+('I- 80 Ramp', '[(-122.2885,37.254),(-122.2883,37.247)]'),
+('I- 80 Ramp', '[(-122.2885,37.254),(-122.2893,37.266)]'),
+('I- 80 Ramp', '[(-122.2918,37.279),(-122.2926,37.281)]'),
+('I- 80 Ramp', '[(-122.2923,37.282),(-122.2926,37.283),(-122.2932,37.284)]'),
+('I- 80 Ramp', '[(-122.2934,37.28),(-122.2926,37.281)]'),
+('I- 80 Ramp', '[(-122.2934,37.28),(-122.2962,37.273)]'),
+('I- 80 Ramp', '[(-122.2957,37.396),(-122.2946,37.384),(-122.2948,37.367)]'),
+('I- 80 Ramp', '[(-122.2962,37.413),(-122.2959,37.382),(-122.2951,37.372)]'),
+('I- 80 Ramp', '[(-122.2984,37.506),(-122.2977,37.502),(-122.2979,37.499),(-122.2956,37.489),(-122.2962,37.483),(-122.2965,37.478),(-122.2971,37.452)]'),
+('I- 80 Ramp', '[(-122.2988,37.518),(-122.299,37.5),(-122.2994,37.488),(-122.2995,37.477),(-122.2971,37.452)]'),
+('I- 80 Ramp', '[(-122.3038,37.695),(-122.3021,37.67),(-122.3022,37.662),(-122.3023,37.644)]'),
+('I- 80 Ramp', '[(-122.3038,37.695),(-122.3036,37.674),(-122.3034,37.667),(-122.3033,37.661),(-122.3023,37.644)]'),
+('I- 80 Ramp', '[(-122.3044,37.25),(-122.3051,37.254)]'),
+('I- 80 Ramp', '[(-122.3044,37.25),(-122.3083,37.249)]'),
+('I- 80 Ramp', '[(-122.3051,37.254),(-122.3083,37.249)]'),
+('I- 80 Ramp', '[(-122.3051,37.91),(-122.3056,37.912)]'),
+('I- 80 Ramp', '[(-122.3051,37.91),(-122.3057,37.908)]'),
+('I- 80 Ramp', '[(-122.306,37.876),(-122.3066,37.869),(-122.3067,37.843),(-122.3069,37.818)]'),
+('I- 80 Ramp', '[(-122.3068,37.795),(-122.306,37.783),(-122.3062,37.774)]'),
+('I- 80 Ramp', '[(-122.3068,37.795),(-122.3069,37.782),(-122.3062,37.774)]'),
+('I- 80 Ramp', '[(-122.3069,37.925),(-122.3065,37.935)]'),
+('I- 80 Ramp', '[(-122.307,37.902),(-122.3073,37.881)]'),
+('I- 80 Ramp', '[(-122.3072,37.916),(-122.3074,37.896)]'),
+('I- 80 Ramp', '[(-122.307624,37.87781),(-122.307512,37.89327)]'),
+('I- 80 Ramp', '[(-122.3078,37.93),(-122.3081,37.879)]'),
+('I- 80 Ramp', '[(-122.3088,37.885),(-122.3076,37.831)]'),
+('I- 880', '((-121.9669,37.075),(-121.9663,37.071),(-121.9656,37.065),(-121.9618,37.037),(-121.95689,37),(-121.948,37.933))'),
+('I- 880', '[(-121.9357,37.83),(-121.9356,37.826),(-121.9351,37.819),(-121.9349,37.813),(-121.9337,37.788),(-121.9327,37.767),(-121.9232,37.57),(-121.9229,37.563),(-121.9229,37.561),(-121.922487,37.55412)]'),
+('I- 880', '[(-121.937,37.852),(-121.9368,37.848)]'),
+('I- 880', '[(-121.948,37.933),(-121.9471,37.925),(-121.9467,37.923),(-121.946,37.918),(-121.9452,37.912),(-121.937,37.852)]'),
+('I- 880', '[(-121.9995,37.289),(-121.998758,37.28558),(-121.998013,37.282),(-121.996913,37.27613),(-121.9929,37.255),(-121.9919,37.252),(-121.991111,37.24795),(-121.990277,37.24367),(-121.989597,37.24018),(-121.9882,37.233),(-121.9871,37.229),(-121.9865,37.226),(-121.9848,37.216),(-121.982,37.196),(-121.9805,37.186),(-121.975936,37.14723),(-121.9712,37.107)]'),
+('I- 880', '[(-122.0219,37.466),(-122.0205,37.447),(-122.020331,37.44447),(-122.020008,37.43962),(-122.0195,37.432),(-122.0193,37.429),(-122.0164,37.393),(-122.010219,37.34771),(-122.0041,37.313)]'),
+('I- 880', '[(-122.0375,37.632),(-122.0359,37.619),(-122.0358,37.616),(-122.034514,37.60409),(-122.031876,37.57965),(-122.031193,37.57332),(-122.03016,37.56375),(-122.02943,37.55698),(-122.028689,37.54929),(-122.027833,37.53908),(-122.025979,37.51698),(-122.0238,37.491)]'),
+('I- 880', '[(-122.0469,37.774),(-122.0466,37.765),(-122.0465,37.761),(-122.045041,37.72234),(-122.0445,37.708),(-122.0426,37.686),(-122.041515,37.67425),(-122.0414,37.673),(-122.0398,37.656)]'),
+('I- 880', '[(-122.0612,37.003),(-122.0604,37.991),(-122.0596,37.982),(-122.0585,37.967),(-122.0583,37.961),(-122.0553,37.918),(-122.053635,37.89475),(-122.050759,37.8546),(-122.05,37.844),(-122.0485,37.817),(-122.0483,37.813),(-122.0482,37.811)]'),
+('I- 880', '[(-122.0666,37.085),(-122.0656,37.067),(-122.0653,37.062),(-122.0644,37.049),(-122.0635,37.036),(-122.0618,37.011)]'),
+('I- 880', '[(-122.0831,37.312),(-122.0819,37.296),(-122.081,37.285),(-122.0786,37.248),(-122.078,37.24),(-122.077642,37.23496),(-122.076983,37.22567),(-122.076599,37.22026),(-122.076229,37.21505),(-122.0758,37.209)]'),
+('I- 880', '[(-122.0978,37.528),(-122.096,37.496),(-122.0931,37.453),(-122.09277,37.4496),(-122.090189,37.41442),(-122.0896,37.405),(-122.085,37.34)]'),
+('I- 880', '[(-122.1048,37.638),(-122.1045,37.633),(-122.1042,37.63),(-122.1033,37.617),(-122.1029,37.61)]'),
+('I- 880', '[(-122.1365,37.902),(-122.1358,37.898),(-122.1333,37.881),(-122.1323,37.874),(-122.1311,37.866),(-122.1308,37.865),(-122.1307,37.864),(-122.1289,37.851),(-122.1277,37.843),(-122.1264,37.834),(-122.1231,37.812),(-122.1165,37.766),(-122.1104,37.72),(-122.109695,37.71094),(-122.109,37.702),(-122.108312,37.69168),(-122.1076,37.681)]'),
+('I- 880', '[(-122.1365,37.902),(-122.1376,37.91)]'),
+('I- 880', '[(-122.1755,37.185),(-122.1747,37.178),(-122.1742,37.173),(-122.1692,37.126),(-122.167792,37.11594),(-122.16757,37.11435),(-122.1671,37.111),(-122.1655,37.1),(-122.165169,37.09811),(-122.1641,37.092),(-122.1596,37.061),(-122.158381,37.05275),(-122.155991,37.03657),(-122.1531,37.017),(-122.1478,37.98),(-122.1407,37.932),(-122.1394,37.924),(-122.1389,37.92),(-122.1376,37.91)]'),
+('I- 880', '[(-122.1761,37.191),(-122.1757,37.187)]'),
+('I- 880', '[(-122.1947,37.394),(-122.194,37.385),(-122.1933,37.378),(-122.1882,37.32),(-122.1879,37.317),(-122.1877,37.315),(-122.1876,37.312),(-122.1873,37.309),(-122.1829,37.26),(-122.1818,37.249),(-122.1804,37.234),(-122.1802,37.231),(-122.1776,37.206),(-122.1768,37.197)]'),
+('I- 880', '[(-122.2068,37.534),(-122.2066,37.53),(-122.206,37.522),(-122.2005,37.46),(-122.1967,37.418),(-122.1959,37.407)]'),
+('I- 880', '[(-122.2214,37.711),(-122.2202,37.699),(-122.2199,37.695),(-122.219,37.682),(-122.2184,37.672),(-122.2173,37.652),(-122.2159,37.638),(-122.2144,37.616),(-122.2138,37.612),(-122.2135,37.609),(-122.212,37.592),(-122.2116,37.586),(-122.2111,37.581)]'),
+('I- 880', '[(-122.236,37.783),(-122.2352,37.767),(-122.2348,37.764),(-122.2339,37.758),(-122.2329,37.752),(-122.2323,37.748),(-122.2319,37.746),(-122.2316,37.746),(-122.2312,37.744),(-122.2301,37.743),(-122.2269,37.73),(-122.2267,37.73),(-122.222,37.713)]'),
+('I- 880', '[(-122.2707,37.975),(-122.2693,37.972),(-122.2681,37.966),(-122.267,37.962),(-122.2659,37.957),(-122.2648,37.952),(-122.2636,37.946),(-122.2625,37.935),(-122.2617,37.927),(-122.2607,37.921),(-122.2593,37.916),(-122.258,37.911),(-122.2536,37.898),(-122.2432,37.858),(-122.2408,37.845),(-122.2386,37.827),(-122.2374,37.811)]'),
+('I- 880', '[(-122.291,37.052),(-122.2898,37.042),(-122.2888,37.038),(-122.2878,37.036),(-122.2863,37.032)]'),
+('I- 880 Ramp', '((-121.9349,37.813),(-121.935,37.828))'),
+('I- 880 Ramp', '((-121.9351,37.819),(-121.935,37.828),(-121.9339,37.847))'),
+('I- 880 Ramp', '((-121.936,37.837),(-121.9351,37.835))'),
+('I- 880 Ramp', '((-121.9368,37.848),(-121.9362,37.835))'),
+('I- 880 Ramp', '((-121.9376,37.834),(-121.937,37.836))'),
+('I- 880 Ramp', '((-121.9477,37.91),(-121.9469,37.911),(-121.9463,37.911))'),
+('I- 880 Ramp', '((-121.9682,37.065),(-121.9686,37.066))'),
+('I- 880 Ramp', '((-122.0008,37.31),(-122.0002,37.308))'),
+('I- 880 Ramp', '((-122.0013,37.298),(-122.0013,37.287))'),
+('I- 880 Ramp', '((-122.0369,37.645),(-122.0364,37.646))'),
+('I- 880 Ramp', '((-122.0477,37.798),(-122.0466,37.789),(-122.0461,37.785))'),
+('I- 880 Ramp', '((-122.0477,37.798),(-122.0482,37.8))'),
+('I- 880 Ramp', '((-122.0585,37.967),(-122.0577,37.974),(-122.0548,37.966),(-122.055168,37.96828),(-122.0577,37.984))'),
+('I- 880 Ramp', '((-122.0919,37.465),(-122.0931,37.461))'),
+('I- 880 Ramp', '((-122.0932,37.439),(-122.0922,37.437),(-122.0915,37.427))'),
+('I- 880 Ramp', '((-122.1005,37.571),(-122.1003,37.565),(-122.0997,37.548))'),
+('I- 880 Ramp', '((-122.1286,37.836),(-122.1283,37.839))'),
+('I- 880 Ramp', '((-122.1335,37.901),(-122.1358,37.905))'),
+('I- 880 Ramp', '((-122.1378,37.923),(-122.1374,37.925))'),
+('I- 880 Ramp', '((-122.1757,37.187),(-122.1754,37.191))'),
+('I- 880 Ramp', '((-122.1863,37.322),(-122.187,37.322))'),
+('I- 880 Ramp', '((-122.1876,37.312),(-122.1877,37.309))'),
+('I- 880 Ramp', '((-122.2054,37.542),(-122.2057,37.533),(-122.2059,37.526))'),
+('I- 880 Ramp', '((-122.2091,37.532),(-122.2089,37.535),(-122.2072,37.535))'),
+('I- 880 Ramp', '((-122.2187,37.684),(-122.219,37.688),(-122.2194,37.697))'),
+('I- 880 Ramp', '((-122.2301,37.743),(-122.2316,37.751))'),
+('I- 880 Ramp', '((-122.2352,37.767),(-122.2356,37.768),(-122.236,37.768))'),
+('I- 880 Ramp', '[(-121.9215,37.556),(-121.92179,37.55745),(-121.9229,37.563)]'),
+('I- 880 Ramp', '[(-121.9232,37.57),(-121.9234,37.559),(-121.9229,37.561)]'),
+('I- 880 Ramp', '[(-121.9335,37.851),(-121.9339,37.847),(-121.9351,37.835),(-121.9357,37.83)]'),
+('I- 880 Ramp', '[(-121.9343,37.85),(-121.937,37.852),(-121.937,37.836),(-121.9362,37.835),(-121.9359,37.826),(-121.9349,37.813)]'),
+('I- 880 Ramp', '[(-121.946,37.918),(-121.9463,37.911),(-121.9452,37.912)]'),
+('I- 880 Ramp', '[(-121.9612,37.099),(-121.9615,37.09),(-121.9616,37.087)]'),
+('I- 880 Ramp', '[(-121.9618,37.037),(-121.961998,37.05205),(-121.962212,37.06831),(-121.9623,37.075),(-121.9616,37.087)]'),
+('I- 880 Ramp', '[(-121.9656,37.065),(-121.9678,37.061),(-121.9676,37.065)]'),
+('I- 880 Ramp', '[(-121.9688,37.061),(-121.9686,37.066),(-121.9669,37.075)]'),
+('I- 880 Ramp', '[(-121.9712,37.107),(-121.9643,37.087),(-121.9623,37.085)]'),
+('I- 880 Ramp', '[(-121.986,37.239),(-121.9865,37.236),(-121.9861,37.234)]'),
+('I- 880 Ramp', '[(-121.9865,37.226),(-121.9872,37.22)]'),
+('I- 880 Ramp', '[(-121.9871,37.229),(-121.9863,37.232)]'),
+('I- 880 Ramp', '[(-121.9885,37.211),(-121.9848,37.216)]'),
+('I- 880 Ramp', '[(-122.0019,37.301),(-122.002,37.293)]'),
+('I- 880 Ramp', '[(-122.0041,37.313),(-122.0018,37.315),(-122.0007,37.315),(-122.0005,37.313),(-122.0002,37.308),(-121.9995,37.289)]'),
+('I- 880 Ramp', '[(-122.0041,37.313),(-122.0038,37.308),(-122.0039,37.284),(-122.0013,37.287),(-121.9995,37.289)]'),
+('I- 880 Ramp', '[(-122.0226,37.474),(-122.0214,37.473),(-122.0219,37.466)]'),
+('I- 880 Ramp', '[(-122.0236,37.488),(-122.0231,37.458),(-122.0227,37.458),(-122.0223,37.452),(-122.0205,37.447)]'),
+('I- 880 Ramp', '[(-122.0238,37.491),(-122.0215,37.483),(-122.0211,37.477),(-122.0205,37.447)]'),
+('I- 880 Ramp', '[(-122.0364,37.652),(-122.0364,37.646),(-122.03618,37.63412),(-122.036027,37.62586),(-122.0359,37.619)]'),
+('I- 880 Ramp', '[(-122.0374,37.639),(-122.0375,37.632)]'),
+('I- 880 Ramp', '[(-122.0383,37.64),(-122.0387,37.636),(-122.0387,37.633),(-122.038,37.632)]'),
+('I- 880 Ramp', '[(-122.0392,37.65),(-122.0389,37.625),(-122.0391,37.617),(-122.036099,37.6161),(-122.0358,37.616)]'),
+('I- 880 Ramp', '[(-122.0398,37.656),(-122.0361,37.656)]'),
+('I- 880 Ramp', '[(-122.0482,37.811),(-122.0461,37.785),(-122.0453,37.778),(-122.045,37.775)]'),
+('I- 880 Ramp', '[(-122.0485,37.817),(-122.0484,37.813),(-122.0482,37.8),(-122.0481,37.794),(-122.0478,37.781),(-122.0469,37.774)]'),
+('I- 880 Ramp', '[(-122.059,37.982),(-122.0577,37.984),(-122.0612,37.003)]'),
+('I- 880 Ramp', '[(-122.0604,37.991),(-122.06,37.983),(-122.0605,37.983)]'),
+('I- 880 Ramp', '[(-122.0618,37.011),(-122.0631,37.982),(-122.0585,37.967)]'),
+('I- 880 Ramp', '[(-122.0635,37.036),(-122.064,37.049),(-122.0648,37.069)]'),
+('I- 880 Ramp', '[(-122.0642,37.073),(-122.0648,37.076),(-122.0666,37.085)]'),
+('I- 880 Ramp', '[(-122.0653,37.062),(-122.0663,37.064)]'),
+('I- 880 Ramp', '[(-122.0758,37.209),(-122.073269,37.18911),(-122.073,37.187),(-122.0723,37.183)]'),
+('I- 880 Ramp', '[(-122.0758,37.209),(-122.075697,37.2063),(-122.075,37.188),(-122.0749,37.184)]'),
+('I- 880 Ramp', '[(-122.0837,37.322),(-122.0822,37.316),(-122.0831,37.312)]'),
+('I- 880 Ramp', '[(-122.0837,37.322),(-122.0843,37.316)]'),
+('I- 880 Ramp', '[(-122.085,37.34),(-122.0801,37.316),(-122.081,37.285)]'),
+('I- 880 Ramp', '[(-122.085,37.34),(-122.0866,37.316),(-122.0819,37.296)]'),
+('I- 880 Ramp', '[(-122.0918,37.466),(-122.0896,37.405)]'),
+('I- 880 Ramp', '[(-122.092,37.461),(-122.0923,37.457)]'),
+('I- 880 Ramp', '[(-122.0931,37.453),(-122.0937,37.469),(-122.0931,37.461),(-122.0923,37.457)]'),
+('I- 880 Ramp', '[(-122.096,37.496),(-122.0941,37.464),(-122.0943,37.421),(-122.0915,37.427),(-122.0896,37.405)]'),
+('I- 880 Ramp', '[(-122.0985,37.574),(-122.0986,37.567),(-122.0978,37.528)]'),
+('I- 880 Ramp', '[(-122.0993,37.571),(-122.0999,37.569)]'),
+('I- 880 Ramp', '[(-122.1005,37.571),(-122.1009,37.568)]'),
+('I- 880 Ramp', '[(-122.1022,37.597),(-122.102055,37.59178),(-122.1019,37.562)]'),
+('I- 880 Ramp', '[(-122.1029,37.61),(-122.1013,37.587),(-122.0999,37.569)]'),
+('I- 880 Ramp', '[(-122.1032,37.557),(-122.0997,37.548),(-122.0978,37.528)]'),
+('I- 880 Ramp', '[(-122.1076,37.681),(-122.106243,37.66549),(-122.1062,37.665),(-122.106043,37.66186),(-122.105869,37.65838),(-122.1048,37.638)]'),
+('I- 880 Ramp', '[(-122.1076,37.681),(-122.107021,37.6646),(-122.107,37.664),(-122.106808,37.66184),(-122.1048,37.638)]'),
+('I- 880 Ramp', '[(-122.1287,37.842),(-122.1283,37.839),(-122.1264,37.834)]'),
+('I- 880 Ramp', '[(-122.1289,37.861),(-122.1284,37.855),(-122.1277,37.843)]'),
+('I- 880 Ramp', '[(-122.1296,37.865),(-122.1299,37.866),(-122.1323,37.874)]'),
+('I- 880 Ramp', '[(-122.1318,37.865),(-122.1319,37.866),(-122.1333,37.881)]'),
+('I- 880 Ramp', '[(-122.1376,37.91),(-122.1379,37.909),(-122.1376,37.907),(-122.1365,37.902)]'),
+('I- 880 Ramp', '[(-122.1379,37.891),(-122.1383,37.897),(-122.1377,37.902)]'),
+('I- 880 Ramp', '[(-122.1379,37.931),(-122.137597,37.92736),(-122.1374,37.925),(-122.1373,37.924),(-122.1369,37.914),(-122.1358,37.905),(-122.1365,37.908),(-122.1358,37.898)]'),
+('I- 880 Ramp', '[(-122.1407,37.932),(-122.1397,37.923),(-122.1389,37.917),(-122.1383,37.913)]'),
+('I- 880 Ramp', '[(-122.164,37.106),(-122.1653,37.113),(-122.1651,37.101)]'),
+('I- 880 Ramp', '[(-122.164188,37.10514),(-122.1641,37.092)]'),
+('I- 880 Ramp', '[(-122.1646,37.113),(-122.163,37.111)]'),
+('I- 880 Ramp', '[(-122.1646,37.113),(-122.165458,37.11379),(-122.167792,37.11594)]'),
+('I- 880 Ramp', '[(-122.165757,37.09059),(-122.165169,37.09811)]'),
+('I- 880 Ramp', '[(-122.165757,37.09059),(-122.16635,37.09559)]'),
+('I- 880 Ramp', '[(-122.1675,37.09),(-122.1666,37.089),(-122.165804,37.08972),(-122.1655,37.09),(-122.1641,37.092)]'),
+('I- 880 Ramp', '[(-122.1675,37.09),(-122.16757,37.11435)]'),
+('I- 880 Ramp', '[(-122.173,37.194),(-122.1742,37.173)]'),
+('I- 880 Ramp', '[(-122.1763,37.184),(-122.1761,37.191)]'),
+('I- 880 Ramp', '[(-122.1763,37.193),(-122.1754,37.191),(-122.1745,37.194),(-122.1743,37.192),(-122.1737,37.196),(-122.1725,37.198)]'),
+('I- 880 Ramp', '[(-122.1768,37.197),(-122.1774,37.182),(-122.1769,37.18),(-122.1758,37.181),(-122.1747,37.178)]'),
+('I- 880 Ramp', '[(-122.1868,37.32),(-122.187,37.322),(-122.1873,37.321),(-122.1877,37.319),(-122.1879,37.317)]'),
+('I- 880 Ramp', '[(-122.1893,37.303),(-122.1888,37.305),(-122.1885,37.307),(-122.1877,37.309),(-122.1873,37.309)]'),
+('I- 880 Ramp', '[(-122.1946,37.405),(-122.1942,37.411),(-122.1951,37.411)]'),
+('I- 880 Ramp', '[(-122.1946,37.405),(-122.1947,37.394)]'),
+('I- 880 Ramp', '[(-122.1952,37.418),(-122.1967,37.418)]'),
+('I- 880 Ramp', '[(-122.1954,37.372),(-122.1957,37.378)]'),
+('I- 880 Ramp', '[(-122.1959,37.407),(-122.1958,37.396),(-122.1953,37.396),(-122.1947,37.394)]'),
+('I- 880 Ramp', '[(-122.2065,37.54),(-122.2066,37.535),(-122.2063,37.531),(-122.2059,37.526),(-122.206,37.522)]'),
+('I- 880 Ramp', '[(-122.2092,37.535),(-122.2074,37.536),(-122.2072,37.535),(-122.2066,37.53)]'),
+('I- 880 Ramp', '[(-122.2096,37.565),(-122.2079,37.549),(-122.2061,37.541)]'),
+('I- 880 Ramp', '[(-122.2111,37.581),(-122.2108,37.535)]'),
+('I- 880 Ramp', '[(-122.2176,37.65),(-122.2173,37.652)]'),
+('I- 880 Ramp', '[(-122.2177,37.668),(-122.2168,37.653),(-122.2159,37.638)]'),
+('I- 880 Ramp', '[(-122.218,37.659),(-122.2173,37.652)]'),
+('I- 880 Ramp', '[(-122.2199,37.695),(-122.2194,37.697),(-122.2197,37.7),(-122.2202,37.699)]'),
+('I- 880 Ramp', '[(-122.222,37.713),(-122.2212,37.705),(-122.2207,37.697),(-122.2208,37.694),(-122.2192,37.68),(-122.2184,37.672)]'),
+('I- 880 Ramp', '[(-122.2301,37.743),(-122.2294,37.735)]'),
+('I- 880 Ramp', '[(-122.2316,37.746),(-122.2316,37.751),(-122.2321,37.752),(-122.2329,37.752)]'),
+('I- 880 Ramp', '[(-122.2325,37.743),(-122.2319,37.746)]'),
+('I- 880 Ramp', '[(-122.2361,37.785),(-122.2356,37.781)]'),
+('I- 880 Ramp', '[(-122.237,37.799),(-122.236,37.777),(-122.236,37.768),(-122.2357,37.764),(-122.235,37.754)]'),
+('I- 880 Ramp', '[(-122.2372,37.802),(-122.23638,37.7996),(-122.2361,37.801),(-122.2357,37.801)]'),
+('I- 880 Ramp', '[(-122.2374,37.811),(-122.2374,37.796)]'),
+('I- 880 Ramp', '[(-122.2536,37.898),(-122.254,37.902)]'),
+('I- 880 Ramp', '[(-122.2577,37.914),(-122.258,37.911)]'),
+('I- 880 Ramp', '[(-122.2636,37.946),(-122.2646,37.954)]'),
+('I- 880 Ramp', '[(-122.2636,37.946),(-122.2649,37.95),(-122.2662,37.954)]'),
+('I- 880 Ramp', '[(-122.268,37.969),(-122.2693,37.972)]'),
+('I- 880 Ramp', '[(-122.2685,37.962),(-122.2695,37.969),(-122.2707,37.975)]'),
+('I- 880 Ramp', '[(-122.2729,37.986),(-122.2744,37.986)]'),
+('I- 880 Ramp', '[(-122.274,37.993),(-122.2729,37.986)]'),
+('I- 880 Ramp', '[(-122.2771,37.002),(-122.278,37)]'),
+('I- 880 Ramp', '[(-122.2775,37.007),(-122.2769,37.001)]'),
+('I- 880 Ramp', '[(-122.2849,37.028),(-122.2845,37.026),(-122.2837,37.021)]'),
+('I- 880 Ramp', '[(-122.2863,37.032),(-122.285451,37.03094),(-122.284429,37.02966),(-122.2831,37.028),(-122.2823,37.031)]'),
+('I- 880 Ramp', '[(-122.291454,37.064),(-122.291088,37.06103),(-122.2903,37.05),(-122.2897,37.044),(-122.2888,37.038)]'),
+('I- 880 Ramp', '[(-122.2916,37.052),(-122.2898,37.04),(-122.2888,37.038)]'),
+('I- 980', '((-122.268,37.227),(-122.2678,37.233),(-122.2675,37.243))'),
+('I- 980', '((-122.2688,37.2),(-122.2684,37.215),(-122.268,37.227))'),
+('I- 980', '[(-122.2675,37.243),(-122.2674,37.246)]'),
+('I- 980', '[(-122.2681,37.248),(-122.2677,37.252)]'),
+('I- 980', '[(-122.268237,37.24426),(-122.2682,37.245)]'),
+('I- 980', '[(-122.2684,37.236),(-122.2683,37.243),(-122.268237,37.24426)]'),
+('I- 980', '[(-122.2684,37.236),(-122.2684,37.234),(-122.268817,37.22458),(-122.269027,37.21557),(-122.2691,37.213),(-122.2694,37.199),(-122.2693,37.194)]'),
+('I- 980', '[(-122.2688,37.2),(-122.2688,37.197),(-122.2689,37.191)]'),
+('I- 980', '[(-122.2699,37.159),(-122.2697,37.165),(-122.2695,37.17),(-122.2693,37.18),(-122.2689,37.191)]'),
+('I- 980', '[(-122.2701,37.163),(-122.2699,37.172),(-122.2693,37.192),(-122.2693,37.194)]'),
+('I- 980', '[(-122.2783,37.006),(-122.2787,37.014),(-122.2791,37.024),(-122.279124,37.0254),(-122.2782,37.053),(-122.2778,37.061),(-122.2773,37.068)]'),
+('I- 980', '[(-122.2789,37.009),(-122.2795,37.022),(-122.279648,37.02711),(-122.2787,37.055),(-122.2782,37.062),(-122.2775,37.075),(-122.2773,37.078),(-122.2763,37.094),(-122.2758,37.1),(-122.274904,37.11235),(-122.274857,37.1131),(-122.2748,37.114)]'),
+('I- 980 Ramp', '[(-122.2688,37.197),(-122.2691,37.191),(-122.2693,37.18)]'),
+('I- 980 Ramp', '[(-122.2688,37.206),(-122.2688,37.203),(-122.2684,37.215)]'),
+('I- 980 Ramp', '[(-122.2691,37.213),(-122.269438,37.20709),(-122.2699,37.199),(-122.27,37.194),(-122.270194,37.18382),(-122.270352,37.17552),(-122.2704,37.173)]'),
+('I- 980 Ramp', '[(-122.2693,37.194),(-122.2691,37.198)]'),
+('I- 980 Ramp', '[(-122.2699,37.159),(-122.2701,37.163)]'),
+('I- 980 Ramp', '[(-122.2739,37.117),(-122.2745,37.119),(-122.2733,37.129)]'),
+('I- 980 Ramp', '[(-122.2773,37.068),(-122.2772,37.061)]'),
+('I- 980 Ramp', '[(-122.2773,37.078),(-122.2766,37.095)]'),
+('Idaho St', '[(-122.28,37.437),(-122.2801,37.446)]'),
+('Iglesia Dr', '[(-121.946443,37.09438),(-121.946833,37.09285)]'),
+('Independence Ave', '[(-121.865283,37.46138),(-121.8634,37.446)]'),
+('Independence Dr', '[(-121.8683,37.521),(-121.868866,37.50763)]'),
+('Independence Road', '[(-121.9474,37.172),(-121.9508,37.163)]'),
+('Indian Road', '[(-122.2209,37.153),(-122.2216,37.142)]'),
+('Indian Way', '[(-122.2066,37.398),(-122.2045,37.411)]'),
+('Indian Creek', '[(-121.7642,37.246),(-121.7655,37.244)]'),
+('Indian Creek Road', '[(-121.7751,37.798),(-121.7646,37.799)]'),
+('Indian Creek Road', '[(-121.7889,37.843),(-121.8,37.791)]'),
+('Indian Creek Road', '[(-121.863754,37.77499),(-121.8644,37.782)]'),
+('Indian Joe Creek', '[(-121.8273,37.142),(-121.806,37.295)]'),
+('Indian Rock Path', '[(-122.2717,37.919),(-122.2727,37.922)]'),
+('Industrial Blvd', '[(-122.1091,37.328),(-122.1085,37.326)]'),
+('Industrial Pkwy', '[(-122.055708,37.21892),(-122.0559,37.217)]'),
+('Industrial Pkwy', '[(-122.0723,37.183),(-122.0731,37.184)]'),
+('Industrial St', '[(-122.1834,37.424),(-122.1833,37.425)]'),
+('Inglewood Dr', '[(-121.9086,37.877),(-121.9088,37.877)]'),
+('Inglewood Dr', '[(-121.909484,37.87762),(-121.9099,37.878)]'),
+('Inglewood St', '[(-122.0802,37.397),(-122.0823,37.397)]'),
+('Inglewood Common', '[(-121.955843,37.36729),(-121.955147,37.36923)]'),
+('Innsbruck St', '[(-121.7706,37.68),(-121.7708,37.668)]'),
+('Inverness St', '[(-122.1521,37.882),(-122.1523,37.877)]'),
+('Inverness Way', '[(-121.752134,37.92412),(-121.751744,37.92413)]'),
+('Iroquois Ave', '[(-121.7876,37.891),(-121.7876,37.899)]'),
+('Irvington Ave', '[(-121.9624,37.308),(-121.9661,37.307)]'),
+('Isabel Ave', '[(-121.8047,37.63301),(-121.8047,37.63248)]'),
+('Isherwood Way', '[(-122.0138,37.733),(-122.0156,37.702)]'),
+('Island Dr', '[(-122.2329,37.463),(-122.2336,37.455)]'),
+('Island Dr', '[(-122.2399,37.334),(-122.2394,37.34),(-122.2383,37.352)]'),
+('Island Dr', '[(-122.2411,37.318),(-122.2406,37.325)]'),
+('Island Pine Ct', '[(-122.069,37.31),(-122.0697,37.31)]'),
+('Isle Royal St', '[(-121.9695,37.178),(-121.9686,37.15),(-121.9683,37.149)]'),
+('Isola Ct', '[(-122.0551,37.815),(-122.0555,37.811)]'),
+('Ithaca St', '[(-122.0318,37.09),(-122.0317,37.087)]'),
+('Ivy Dr', '[(-122.2434,37.01),(-122.2413,37.015)]'),
+('J St', '[(-121.9762,37.754),(-121.9767,37.743)]'),
+('Jacaranda Ct', '[(-121.9431,37.49),(-121.9426,37.486)]'),
+('Jacaranda Dr', '[(-122.0147,37.288),(-122.013,37.287)]'),
+('Jackson Ave', '[(-121.7416,37.868),(-121.7416,37.862)]'),
+('Jackson Ct', '[(-121.9377,37.336),(-121.9383,37.337)]'),
+('Jackson St', '[(-122.0809,37.669),(-122.0804,37.677)]'),
+('Jackson St', '[(-122.0838,37.614),(-122.0832,37.624)]'),
+('Jackson St', '[(-122.0845,37.6),(-122.0842,37.606)]'),
+('Jackson St', '[(-122.0981,37.368),(-122.0988,37.365)]'),
+('Jackson St', '[(-122.2646,37.025),(-122.2641,37.034)]'),
+('Jackson St', '[(-122.2668,37.991),(-122.2664,37.997)]'),
+('Jackson St', '[(-122.2689,37.955),(-122.2685,37.962)]'),
+('Jade Cir', '[(-121.919585,37.25699),(-121.918784,37.24417)]'),
+('Jamaica Way', '[(-122.1785,37.971),(-122.1792,37.969)]'),
+('James Ave', '[(-122.0634,37.055),(-122.0598,37.052)]'),
+('Jamestown Road', '[(-121.947,37.165),(-121.9476,37.163)]'),
+('Jamison Way', '[(-122.075555,37.98023),(-122.073719,37.98074)]'),
+('Jaques Ct', '[(-122.052072,37.68998),(-122.050458,37.69474)]'),
+('Jaquiline St', '[(-121.725054,37.80597),(-121.723604,37.80449)]'),
+('Jarvis Ave', '[(-122.053935,37.43593),(-122.054359,37.43078)]'),
+('Jarvis Ave', '[(-122.055,37.423),(-122.0552,37.42)]'),
+('Jason Way', '[(-122.0044,37.584),(-122.0033,37.577)]'),
+('Jayar Pl', '[(-122.0345,37.206),(-122.0337,37.209)]'),
+('Jayne Ave', '[(-122.2566,37.13),(-122.2549,37.142)]'),
+('Jaynes St', '[(-122.2789,37.779),(-122.2781,37.781)]'),
+('Jean Ct', '[(-122.0755,37.809),(-122.0766,37.798)]'),
+('Jean Dr', '[(-122.0739,37.78),(-122.0734,37.774)]'),
+('Jean Dr', '[(-122.0766,37.798),(-122.0759,37.794)]'),
+('Jean St', '[(-122.2477,37.18),(-122.2468,37.187),(-122.2459,37.196)]'),
+('Jeffer St', '[(-122.0746,37.856),(-122.0739,37.86)]'),
+('Jefferson Ave', '[(-122.2775,37.663),(-122.2774,37.645),(-122.2771,37.627)]'),
+('Jefferson St', '[(-122.2749,37.049),(-122.2745,37.055)]'),
+('Jensen Road', '[(-122.03781,37.03891),(-122.0377,37.04)]'),
+('Jensen St', '[(-121.754,37.805),(-121.754,37.8)]'),
+('Jerome Ave', '[(-121.9239,37.294),(-121.9239,37.287)]'),
+('Jerome Ave', '[(-121.9247,37.314),(-121.9244,37.309)]'),
+('Jerrold Road', '[(-121.6907,37.681),(-121.6908,37.653)]'),
+('Jessica Cir', '[(-122.0472,37.76),(-122.0488,37.748)]'),
+('Jewell Ct', '[(-122.2048,37.467),(-122.2043,37.452)]'),
+('Joaquin Miller Road', '[(-122.1797,37.083),(-122.1778,37.051)]'),
+('Joaquin Miller Road', '[(-122.1914,37.128),(-122.1862,37.119),(-122.1842,37.106)]'),
+('Joaquin Murieta Ave', '[(-121.9958,37.208),(-121.9962,37.201)]'),
+('John Dr', '[(-122.0939,37.925),(-122.0934,37.919)]'),
+('Johnson Dr', '[(-121.9145,37.901),(-121.915,37.877)]'),
+('Johnson Industrial Dr', '[(-121.9096,37.014),(-121.9172,37.016)]'),
+('Jones St', '[(-122.2982,37.755),(-122.2971,37.757)]'),
+('Jones St', '[(-122.301984,37.74755),(-122.3015,37.749)]'),
+('Joseph Dr', '[(-122.0742,37.12),(-122.0732,37.109)]'),
+('Joshua St', '[(-122.0686,37.455),(-122.0686,37.449)]'),
+('Jovan Ter', '[(-122.046671,37.62206),(-122.046466,37.6181)]'),
+('Joyce St', '[(-122.0792,37.604),(-122.0774,37.581)]'),
+('Juana Ave', '[(-122.1417,37.262),(-122.1396,37.267)]'),
+('Juana Ave', '[(-122.1481,37.243),(-122.1459,37.249)]'),
+('June Ct', '[(-122.1041,37.76),(-122.1045,37.769)]'),
+('June Ct', '[(-122.1786,37.316),(-122.178,37.314)]'),
+('Juneau St', '[(-122.1814,37.068),(-122.1801,37.049)]'),
+('Juniper Ave', '[(-122.0464,37.255),(-122.0476,37.251)]'),
+('Juniper St', '[(-121.7823,37.897),(-121.7815,37.9)]'),
+('Juniper St', '[(-122.1592,37.961),(-122.1591,37.955)]'),
+('Junipero Com', '[(-121.9919,37.796),(-121.992,37.791)]'),
+('Jupiter Ct', '[(-122.064459,37.84741),(-122.064255,37.84626)]'),
+('Kains Ave', '[(-122.2923,37.758),(-122.2922,37.754)]'),
+('Kains Ave', '[(-122.2949,37.828),(-122.2948,37.825)]'),
+('Kains Ave', '[(-122.2992,37.983),(-122.2989,37.97),(-122.2984,37.953)]'),
+('Kaiser Dr', '[(-122.067163,37.47821),(-122.060402,37.51961)]'),
+('Kaiser Creek Road', '[(-122.0928,37.885),(-122.0918,37.802)]'),
+('Kamp Dr', '[(-121.867789,37.82326),(-121.867753,37.8292)]'),
+('Kansas Way', '[(-121.9115,37.71),(-121.912,37.706)]'),
+('Kathy Way', '[(-121.7292,37.825),(-121.729061,37.82514)]'),
+('Kato Road', '[(-121.9185,37.626),(-121.9181,37.627)]'),
+('Kay Ave', '[(-122.0968,37.433),(-122.0968,37.427)]'),
+('Kay Ave', '[(-122.0969,37.398),(-122.0971,37.389)]'),
+('Kay Ave', '[(-122.097,37.461),(-122.0969,37.457)]'),
+('Kay Ct', '[(-121.953,37.277),(-121.9535,37.277)]'),
+('Kearney Ave', '[(-122.1981,37.124),(-122.1963,37.135)]'),
+('Keeler Ave', '[(-122.2552,37.892),(-122.2549,37.882)]'),
+('Keeler Ave', '[(-122.2578,37.906),(-122.2579,37.899)]'),
+('Keith Ave', '[(-122.2603,37.894),(-122.26,37.893)]'),
+('Keller Ave', '[(-122.1353,37.702),(-122.1345,37.705)]'),
+('Keller Ave', '[(-122.154,37.723),(-122.1531,37.722)]'),
+('Kelly St', '[(-122.0519,37.852),(-122.0503,37.856)]'),
+('Kelly St', '[(-122.0583,37.842),(-122.058,37.842)]'),
+('Kelso Road', '[(-121.584782,37.94979),(-121.585132,37.94971)]'),
+('Kenilworth Ave', '[(-122.1501,37.376),(-122.1498,37.371)]'),
+('Kenilworth Ave', '[(-122.151,37.393),(-122.1505,37.383)]'),
+('Kenita Way', '[(-122.0508,37.944),(-122.0503,37.944)]'),
+('Kenmore Ave', '[(-122.2378,37.173),(-122.2386,37.162)]'),
+('Kenmore Ct', '[(-122.0713,37.965),(-122.0706,37.967)]'),
+('Kennedy Ave', '[(-122.0201,37.832),(-122.0203,37.824)]'),
+('Kennet St', '[(-122.0309,37.129),(-122.031,37.115)]'),
+('Kent Ave', '[(-122.113,37.891),(-122.1131,37.887)]'),
+('Kent Ave', '[(-122.113,37.937),(-122.113,37.929)]'),
+('Kentucky Ave', '[(-122.2719,37.026),(-122.2706,37.013)]'),
+('Kentwood Way', '[(-121.9235,37.841),(-121.926,37.838)]'),
+('Kenwood Dr', '[(-122.054303,37.63614),(-122.054133,37.62981)]'),
+('Keoncrest Dr', '[(-122.2842,37.77),(-122.2835,37.771)]'),
+('Kerlin St', '[(-121.9986,37.469),(-121.9979,37.465)]'),
+('Kerwin Ave', '[(-122.181,37.296),(-122.1807,37.295)]'),
+('Key Ct', '[(-122.1246,37.545),(-122.1244,37.553)]'),
+('Key Route Blvd', '[(-122.2921,37.91),(-122.292,37.908)]'),
+('Keys Pl', '[(-122.0871,37.253),(-122.0875,37.252)]'),
+('Kildare Road', '[(-122.0968,37.016),(-122.0959,37)]'),
+('Kilkenny Pl', '[(-122.251002,37.40535),(-122.2508,37.403)]'),
+('Kimberly Commons', '[(-121.737774,37.88769),(-121.737673,37.89024)]'),
+('King St', '[(-122.2733,37.504),(-122.2732,37.496)]'),
+('King St', '[(-122.2738,37.558),(-122.2737,37.55)]'),
+('King Way', '[(-121.9176,37.133),(-121.9185,37.13)]'),
+('Kings Ct', '[(-122.0695,37.764),(-122.0689,37.756)]'),
+('Kingsland Ave', '[(-122.1957,37.743),(-122.1956,37.753)]'),
+('Kingsley St', '[(-122.2311,37.042),(-122.2306,37.046)]'),
+('Kirkcaldy St', '[(-121.859937,37.97443),(-121.8601,37.97441)]'),
+('Kirkham St', '[(-122.289,37.122),(-122.2887,37.129)]'),
+('Kit Lane', '[(-122.0237,37.124),(-122.0236,37.132)]'),
+('Kitty Hawk Road', '[(-121.8048,37.797),(-121.8049,37.867)]'),
+('Klamath St', '[(-121.9142,37.982),(-121.9145,37.978)]'),
+('Klamath St', '[(-122.1832,37.035),(-122.1815,37.023)]'),
+('Knapp St', '[(-122.0594,37.062),(-122.0593,37.049)]'),
+('Knight Dr', '[(-122.089468,37.17681),(-122.089434,37.17337)]'),
+('Knight St', '[(-122.18,37.291),(-122.1794,37.288)]'),
+('Knoll Way', '[(-122.0864,37.848),(-122.0839,37.836)]'),
+('Knowland Ave', '[(-122.1957,37.816),(-122.1948,37.823)]'),
+('Kofman Ct', '[(-122.2498,37.422),(-122.2497,37.417)]'),
+('Koford Road', '[(-122.1903,37.296),(-122.1884,37.286)]'),
+('Kolln St', '[(-121.87,37.792),(-121.8705,37.796)]'),
+('Koopmann Creek', '[(-121.9442,37.181),(-121.943465,37.17671)]'),
+('Korbel St', '[(-122.0648,37.742),(-122.0655,37.723)]'),
+('Kottinger Dr', '[(-121.8596,37.58),(-121.859,37.57)]'),
+('Kramer St', '[(-122.1406,37.834),(-122.1416,37.826)]'),
+('Kramer St', '[(-122.143,37.819),(-122.1435,37.812)]'),
+('Krause St', '[(-121.8731,37.863),(-121.8719,37.865)]'),
+('L St', '[(-121.7684,37.772),(-121.768,37.762)]'),
+('L St', '[(-121.7694,37.795),(-121.7692,37.788)]'),
+('La Cresta', '[(-122.2433,37.353),(-122.2425,37.349)]'),
+('La Cresta Ave', '[(-122.2175,37.06),(-122.217,37.073)]'),
+('La Loma Ave', '[(-122.2554,37.844),(-122.2559,37.841)]'),
+('La Playa Dr', '[(-122.1039,37.545),(-122.101,37.493)]'),
+('La Salle Ave', '[(-122.2191,37.176),(-122.2206,37.158)]'),
+('La Salle Ave', '[(-122.2242,37.153),(-122.2255,37.155)]'),
+('La Vereda Road', '[(-122.2562,37.801),(-122.2558,37.792)]'),
+('Ladera Ct', '[(-121.9444,37.068),(-121.9429,37.07)]'),
+('Lafayette Ave', '[(-122.0309,37.474),(-122.0328,37.458)]'),
+('Lafayette Ave', '[(-122.0336,37.451),(-122.0352,37.438)]'),
+('Lafayette Ave', '[(-122.0395,37.411),(-122.0418,37.398)]'),
+('Lafayette Ave', '[(-122.1602,37.293),(-122.1597,37.287)]'),
+('Lafayette St', '[(-122.2559,37.646),(-122.2553,37.654)]'),
+('Laguna Ave', '[(-122.2062,37.027),(-122.2058,37.03)]'),
+('Laguna Ave', '[(-122.2099,37.989),(-122.2089,37)]'),
+('Laguna Dr', '[(-122.1128,37.418),(-122.1132,37.418)]'),
+('Laiolo Road', '[(-121.9715,37.322),(-121.9707,37.318)]'),
+('Lake Blvd', '[(-122.0381,37.533),(-122.0371,37.53)]'),
+('Lake Blvd', '[(-122.0393,37.539),(-122.0387,37.537)]'),
+('Lake Chabot', '[(-122.0753,37.378),(-122.0762,37.367)]'),
+('Lake Chabot Road', '[(-122.0988,37.133),(-122.0977,37.13)]'),
+('Lake Chabot Road', '[(-122.1061,37.171),(-122.1047,37.155)]'),
+('Lake Chabot Road', '[(-122.1323,37.308),(-122.132,37.307)]'),
+('Lake Mead Dr', '[(-122.0533,37.873),(-122.0523,37.858),(-122.0524,37.853)]'),
+('Lake Ontario Dr', '[(-122.0554,37.863),(-122.0557,37.859)]'),
+('Lake Ontario Dr', '[(-122.0562,37.852),(-122.0567,37.847)]'),
+('Lake Pillsbury Dr', '[(-122.0561,37.906),(-122.0573,37.901)]'),
+('Lakecrest Ct', '[(-122.0947,37.107),(-122.0939,37.103)]'),
+('Lakehurst Cir', '[(-122.284729,37.89025),(-122.286096,37.90364)]'),
+('Lakeridge Ave', '[(-122.048299,37.84349),(-122.048127,37.83401)]'),
+('Lakeshore Ave', '[(-122.2586,37.99),(-122.2556,37.006)]'),
+('Lakeview Ave', '[(-122.2225,37.219),(-122.2237,37.221)]'),
+('Lakeview Blvd', '[(-121.9313,37.702),(-121.936,37.784)]'),
+('Lakewood Ct', '[(-122.0261,37.472),(-122.0263,37.469)]'),
+('Lakewood Dr', '[(-122.0288,37.48),(-122.0269,37.477)]'),
+('Lakewood St', '[(-121.9189,37.763),(-121.9191,37.772)]'),
+('Lakewood Way', '[(-122.0795,37.389),(-122.0793,37.366)]'),
+('Lambaren Ave', '[(-121.7825,37.822),(-121.7816,37.821)]'),
+('Lambeth Road', '[(-121.7686,37.942),(-121.7684,37.947)]'),
+('Lanai Ct', '[(-122.0768,37.269),(-122.0768,37.26)]'),
+('Landing Road', '[(-121.947,37.809),(-121.9444,37.82)]'),
+('Landon Ave', '[(-121.9785,37.258),(-121.978,37.255)]'),
+('Langmuir Lane', '[(-121.9199,37.19),(-121.9215,37.197)]'),
+('Lansdown Ct', '[(-121.8659,37.949),(-121.8661,37.96)]'),
+('Larchmont Isle', '[(-122.2667,37.654),(-122.2671,37.647)]'),
+('Lark Way', '[(-122.0563,37.8),(-122.0553,37.797)]'),
+('Larkspur Dr', '[(-121.7431,37.084),(-121.7435,37.09)]'),
+('Larkspur St', '[(-122.0118,37.231),(-122.011,37.227)]'),
+('Larmer Ct', '[(-122.2371,37.215),(-122.2365,37.212)]'),
+('Las Palmas Ave', '[(-121.9521,37.547),(-121.9513,37.539)]'),
+('Las Palmas Ct', '[(-121.944,37.502),(-121.9443,37.513)]'),
+('Las Palmas Ct', '[(-121.950103,37.00582),(-121.949498,37.00835)]'),
+('Las Positas Blvd', '[(-121.7988,37.889),(-121.7984,37.889)]'),
+('Las Positas Blvd', '[(-121.8642,37.957),(-121.8645,37.955)]'),
+('Las Positas Blvd', '[(-121.907779,37.79734),(-121.908481,37.79416)]'),
+('Las Positas Blvd', '[(-121.9094,37.79),(-121.9099,37.787)]'),
+('Las Positas Blvd', '[(-121.915,37.769),(-121.9187,37.759)]'),
+('Las Positas Road', '[(-121.7548,37.025),(-121.75,37.01778)]'),
+('Las Positas Road', '[(-121.764488,37.99199),(-121.75569,37.02022)]'),
+('Las Positas Road', '[(-121.7726,37.976),(-121.76841,37.98426)]'),
+('Lassen Road', '[(-121.7428,37.05),(-121.742211,37.05687)]'),
+('Latham Lane', '[(-122.2572,37.943),(-122.2565,37.947)]'),
+('Latham Walk', '[(-122.2575,37.941),(-122.2572,37.943)]'),
+('Lauderdale Ave', '[(-122.0983,37.344),(-122.0977,37.334)]'),
+('Laurel St', '[(-122.0483,37.265),(-122.0476,37.251)]'),
+('Laurette Pl', '[(-122.0651,37.476),(-122.0646,37.479)]'),
+('Lauriston Ct', '[(-122.2032,37.45),(-122.2034,37.46)]'),
+('Laverne Ave', '[(-122.1938,37.731),(-122.1928,37.721)]'),
+('Laverne Dr', '[(-122.1533,37.821),(-122.1532,37.814)]'),
+('Laverne Dr', '[(-122.1564,37.852),(-122.1549,37.847)]'),
+('Lawlor St', '[(-122.1573,37.533),(-122.1567,37.517)]'),
+('Lawrence Dr', '[(-122.0779,37.133),(-122.0756,37.141)]'),
+('Lawton Ave', '[(-122.2563,37.36),(-122.256,37.366)]'),
+('Lee Ave', '[(-121.7614,37.878),(-121.7615,37.898)]'),
+('Lee Ave', '[(-122.1507,37.298),(-122.1506,37.291)]'),
+('Lee St', '[(-122.2561,37.115),(-122.2569,37.097)]'),
+('Leigh St', '[(-121.9154,37.776),(-121.9153,37.774)]'),
+('Leighton St', '[(-122.0805,37.628),(-122.0797,37.632)]'),
+('Leimert Blvd', '[(-122.2059,37.169),(-122.2048,37.169)]'),
+('Leland Way', '[(-121.7867,37.655),(-121.7859,37.656)]'),
+('Lemke Pl', '[(-121.9882,37.261),(-121.98835,37.2595)]'),
+('Leon Ct', '[(-122.0249,37.525),(-122.0255,37.521)]'),
+('Leona St', '[(-122.1751,37.84),(-122.1739,37.836)]'),
+('Leonard Dr', '[(-122.1731,37.185),(-122.1731,37.172),(-122.1725,37.165)]'),
+('Leonardo Way', '[(-122.1073,37.577),(-122.108,37.575)]'),
+('Leroy Ave', '[(-122.2598,37.819),(-122.259792,37.8182)]'),
+('Leslie St', '[(-121.9639,37.412),(-121.9634,37.405)]'),
+('Leslie St', '[(-121.9729,37.438),(-121.971866,37.43847)]'),
+('Lessley Ave', '[(-122.0727,37.866),(-122.0718,37.867)]'),
+('Levine Ct', '[(-122.0836,37.75),(-122.0831,37.753)]'),
+('Lewelling Blvd', '[(-122.1118,37.868),(-122.1112,37.869)]'),
+('Lewelling Blvd', '[(-122.1219,37.865),(-122.1178,37.866)]'),
+('Lewelling Blvd', '[(-122.1555,37.793),(-122.1572,37.787)]'),
+('Lewis Ave', '[(-122.143,37.359),(-122.1433,37.339)]'),
+('Liberty St', '[(-121.9795,37.499),(-121.9785,37.495)]'),
+('Liberty St', '[(-122.1019,37.934),(-122.1009,37.924)]'),
+('Libra Ct', '[(-121.7389,37.179),(-121.7391,37.187)]'),
+('Lilac Loop', '[(-122.0182,37.805),(-122.0184,37.798)]'),
+('Lilac St', '[(-122.2014,37.799),(-122.2008,37.804)]'),
+('Lillian Ave', '[(-122.1358,37.044),(-122.1337,37.063)]'),
+('Lillian St', '[(-121.7308,37.829),(-121.7307,37.824)]'),
+('Lilly St', '[(-122.078139,37.64103),(-122.0775,37.643)]'),
+('Lincoln Ave', '[(-121.7449,37.849),(-121.745,37.832)]'),
+('Lincoln Ave', '[(-122.1321,37.499),(-122.1349,37.499)]'),
+('Lincoln Ave', '[(-122.2064,37.063),(-122.2059,37.065)]'),
+('Lincoln Ave', '[(-122.2093,37.034),(-122.2087,37.041)]'),
+('Lincoln Ave', '[(-122.251,37.712),(-122.25,37.707)]'),
+('Lincoln Ave', '[(-122.2549,37.729),(-122.2541,37.726)]'),
+('Lincoln Ave', '[(-122.2628,37.751),(-122.2615,37.751)]'),
+('Lincoln Ave', '[(-122.2674,37.752),(-122.2667,37.753)]'),
+('Lincoln Ave', '[(-122.2721,37.754),(-122.2699,37.753)]'),
+('Lincoln Ave', '[(-122.2786,37.756),(-122.276,37.755)]'),
+('Lincoln Way', '[(-122.1987,37.117),(-122.198,37.101)]'),
+('Linda Way', '[(-121.8657,37.573),(-121.866,37.566)]'),
+('Lindbergh Ave', '[(-121.8089,37.973),(-121.8072,37.973)]'),
+('Lindbergh Ave', '[(-121.8151,37.972),(-121.8118,37.971),(-121.8098,37.973)]'),
+('Lindemann Road', '[(-121.558002,37.00213),(-121.558002,37.00663)]'),
+('Linden St', '[(-121.7733,37.876),(-121.772,37.879)]'),
+('Linden St', '[(-121.7782,37.861),(-121.777,37.865),(-121.7757,37.868)]'),
+('Linden St', '[(-122.0692,37.83),(-122.0678,37.833)]'),
+('Linden St', '[(-122.2751,37.344),(-122.275,37.35)]'),
+('Linden St', '[(-122.2832,37.096),(-122.2827,37.112)]'),
+('Linden St', '[(-122.2842,37.067),(-122.2837,37.082)]'),
+('Linden St', '[(-122.2854,37.035),(-122.2853,37.038)]'),
+('Linden St', '[(-122.2867,37.998),(-122.2864,37.008)]'),
+('Linmore Dr', '[(-121.9202,37.39),(-121.9191,37.388)]'),
+('Lisbon Ave', '[(-121.7818,37.71),(-121.7808,37.71)]'),
+('Little Foot Dr', '[(-121.9223,37.064),(-121.9228,37.064)]'),
+('Livermore Ave', '[(-121.7509,37.715),(-121.750474,37.71229)]'),
+('Livermore Ave', '[(-121.7553,37.744),(-121.7539,37.737)]'),
+('Livermore Ave', '[(-121.7589,37.765),(-121.7584,37.763)]'),
+('Livermore Ave', '[(-121.7662,37.811),(-121.7656,37.808)]'),
+('Livermore Ave', '[(-121.7687,37.448),(-121.769,37.375)]'),
+('Livermore Ave', '[(-121.7699,37.863),(-121.7703,37.874)]'),
+('Livermore Ave', '[(-121.772719,37.99085),(-121.7728,37.001)]'),
+('Livermore Commons', '[(-121.926632,37.3099),(-121.926508,37.30113)]'),
+('Locksley Ave', '[(-122.2547,37.422),(-122.2534,37.438)]'),
+('Lockwood Ave', '[(-121.9401,37.366),(-121.9408,37.364)]'),
+('Lockwood St', '[(-122.1802,37.628),(-122.1778,37.601)]'),
+('Locust St', '[(-121.7815,37.876),(-121.7791,37.881)]'),
+('Locust St', '[(-122.0435,37.315),(-122.0435,37.312)]'),
+('Locust St', '[(-122.1606,37.007),(-122.1593,37.987)]'),
+('Locust St', '[(-122.1813,37.578),(-122.1807,37.572)]'),
+('Logan Ct', '[(-122.0053,37.492),(-122.0061,37.484)]'),
+('Logan Dr', '[(-121.9862,37.39),(-121.9856,37.384)]'),
+('Logan Dr', '[(-121.9913,37.423),(-121.990341,37.41763)]'),
+('Loma Dr', '[(-121.9202,37.39),(-121.9204,37.394)]'),
+('Loma Vista Ave', '[(-122.1952,37.942),(-122.1933,37.952)]'),
+('Lomitas Ave', '[(-121.773262,37.59041),(-121.77308,37.59042),(-121.772998,37.59043)]'),
+('Lomitas Ave', '[(-121.7807,37.574),(-121.7804,37.586)]'),
+('Longridge Road', '[(-122.2345,37.096),(-122.2317,37.099)]'),
+('Longview Dr', '[(-121.904,37.486),(-121.9047,37.482)]'),
+('Longview Dr', '[(-122.1277,37.257),(-122.1277,37.252)]'),
+('Longwood Ct', '[(-122.1036,37.606),(-122.1038,37.603)]'),
+('Lori Way', '[(-122.0446,37.845),(-122.0441,37.835)]'),
+('Loro Pl', '[(-121.9447,37.577),(-121.9458,37.582)]'),
+('Lorren Dr', '[(-121.9911,37.491),(-121.9926,37.473)]'),
+('Los Banos St', '[(-122.102,37.914),(-122.1013,37.91)]'),
+('Los Banos St', '[(-122.1064,37.965),(-122.1057,37.956)]'),
+('Louise Lane', '[(-122.0749,37.764),(-122.0754,37.758)]'),
+('Lowell St', '[(-122.275,37.384),(-122.2752,37.389)]'),
+('Lowell St', '[(-122.2757,37.41),(-122.2759,37.417)]'),
+('Lowry Road', '[(-122.052627,37.83339),(-122.0531,37.827),(-122.0538,37.818)]'),
+('Lucot St', '[(-122.1091,37.746),(-122.1096,37.743)]'),
+('Luna Ave', '[(-122.1238,37.117),(-122.123,37.124)]'),
+('Lunar Way', '[(-122.0668,37.883),(-122.0669,37.877)]'),
+('Lurene Dr', '[(-121.918603,37.24972),(-121.919428,37.24785)]'),
+('Luzon Ct', '[(-121.9328,37.28),(-121.9321,37.279)]'),
+('Lyman Road', '[(-122.2124,37.068),(-122.2105,37.093)]'),
+('Lynde St', '[(-122.2195,37.912),(-122.2187,37.91),(-122.2173,37.908)]'),
+('Lyndhurst St', '[(-122.1823,37.354),(-122.1807,37.348)]'),
+('Lyra St', '[(-121.9186,37.766),(-121.9184,37.762)]'),
+('M St', '[(-121.7731,37.842),(-121.7736,37.853)]'),
+('M St', '[(-122.0851,37.754),(-122.0845,37.742)]'),
+('Maar Ave', '[(-121.9573,37.693),(-121.9565,37.701)]'),
+('Mabel Ave', '[(-122.0774,37.029),(-122.0728,37.029)]'),
+('Mabel St', '[(-122.2841,37.591),(-122.284,37.583)]'),
+('Mac Arthur Blvd', '[(-122.139,37.34),(-122.138812,37.34)]'),
+('Mac Arthur Blvd', '[(-122.1394,37.356),(-122.139376,37.35503)]'),
+('Mac Arthur Blvd', '[(-122.1407,37.372),(-122.14,37.364)]'),
+('Mac Arthur Blvd', '[(-122.1495,37.412),(-122.1487,37.408)]'),
+('Mac Arthur Blvd', '[(-122.1552,37.454),(-122.1541,37.446)]'),
+('Mac Arthur Blvd', '[(-122.1605,37.553),(-122.1596,37.525)]'),
+('Mac Arthur Blvd', '[(-122.1636,37.618),(-122.1629,37.612)]'),
+('Mac Arthur Blvd', '[(-122.1697,37.68),(-122.1696,37.679)]'),
+('Mac Arthur Blvd', '[(-122.185,37.757),(-122.1843,37.753)]'),
+('Mac Arthur Blvd', '[(-122.1868,37.773),(-122.1861,37.767)]'),
+('Mac Arthur Blvd', '[(-122.188,37.837),(-122.1871,37.833)]'),
+('Mac Arthur Blvd', '[(-122.207,37.985),(-122.204,37.973)]'),
+('Mac Arthur Blvd', '[(-122.2239,37.007),(-122.2229,37.005)]'),
+('Mac Arthur Blvd', '[(-122.2258,37.01),(-122.2251,37.008)]'),
+('Mac Arthur Blvd', '[(-122.2281,37.014),(-122.2278,37.013)]'),
+('Mac Arthur Blvd', '[(-122.2328,37.039),(-122.2307,37.022)]'),
+('Mac Arthur Blvd', '[(-122.2353,37.054),(-122.2338,37.044)]'),
+('Mac Arthur Blvd', '[(-122.2405,37.072),(-122.2402,37.07)]'),
+('Mac Arthur Blvd', '[(-122.252491,37.17473),(-122.253,37.182)]'),
+('Mac Arthur Blvd', '[(-122.262,37.258),(-122.2631,37.26)]'),
+('Mac Arthur Blvd', '[(-122.2673,37.272),(-122.2676,37.273)]'),
+('Mackenzie Pl', '[(-122.0125,37.698),(-122.0115,37.715)]'),
+('Maddux Dr', '[(-122.1829,37.343),(-122.1823,37.341)]'),
+('Maddux Dr', '[(-122.1848,37.366),(-122.1848,37.36)]'),
+('Madelaine Pl', '[(-122.0401,37.448),(-122.0395,37.448)]'),
+('Madera Ave', '[(-122.19,37.814),(-122.1914,37.824)]'),
+('Madison Ave', '[(-121.7414,37.777),(-121.7415,37.77)]'),
+('Madison Ave', '[(-122.0628,37.078),(-122.063,37.071)]'),
+('Madison St', '[(-122.267,37.962),(-122.2668,37.965)]'),
+('Madison St', '[(-122.2686,37.937),(-122.2682,37.945)]'),
+('Magee Ave', '[(-122.1991,37.928),(-122.1977,37.937)]'),
+('Magnolia Cir', '[(-121.868186,37.81015),(-121.866849,37.80683)]'),
+('Magnolia Dr', '[(-122.2313,37.296),(-122.2317,37.285)]'),
+('Magnolia St', '[(-122.0361,37.306),(-122.0354,37.303)]'),
+('Magnolia St', '[(-122.0409,37.333),(-122.0394,37.325)]'),
+('Magnolia St', '[(-122.0971,37.5),(-122.0962,37.484)]'),
+('Magnolia St', '[(-122.2864,37.104),(-122.286,37.115)]'),
+('Magnolia St', '[(-122.2899,37.005),(-122.2894,37.019)]'),
+('Main St', '[(-121.8743,37.615),(-121.8739,37.624)]'),
+('Main St', '[(-121.8754,37.595),(-121.875,37.604)]'),
+('Main St', '[(-121.8769,37.571),(-121.876403,37.57907)]'),
+('Main St', '[(-121.8875,37.939),(-121.8907,37.936)]'),
+('Main St', '[(-122.0817,37.729),(-122.0807,37.719)]'),
+('Main St', '[(-122.0844,37.758),(-122.0836,37.75)]'),
+('Main St', '[(-122.2907,37.832),(-122.2907,37.839)]'),
+('Mairmont Dr', '[(-121.8725,37.8),(-121.8734,37.8)]'),
+('Maitland Dr', '[(-122.2286,37.273),(-122.2277,37.265)]'),
+('Majestic Ave', '[(-122.1784,37.793),(-122.1789,37.788)]'),
+('Majestic Way', '[(-122.142593,37.98723),(-122.1423,37.98485)]'),
+('Malabar Ave', '[(-122.0727,37.103),(-122.0711,37.103)]'),
+('Malcolm Ave', '[(-122.1269,37.516),(-122.125,37.514)]'),
+('Malcolm Ave', '[(-122.1366,37.469),(-122.1359,37.483)]'),
+('Mallard Ct', '[(-122.0358,37.486),(-122.0367,37.492)]'),
+('Malta Ct', '[(-122.1832,37.273),(-122.1823,37.278)]'),
+('Manchester Road', '[(-122.1125,37.071),(-122.1116,37.071)]'),
+('Manchester St', '[(-121.866725,37.98973),(-121.866734,37.98255)]'),
+('Mandalay Road', '[(-122.2322,37.397),(-122.2321,37.403)]'),
+('Manila Ave', '[(-122.2448,37.425),(-122.2437,37.428)]'),
+('Mann Ave', '[(-122.0165,37.844),(-122.0171,37.83)]'),
+('Manor Blvd', '[(-122.1402,37.912),(-122.1409,37.913)]'),
+('Manor Blvd', '[(-122.1421,37.912),(-122.1426,37.912)]'),
+('Manor Blvd', '[(-122.1452,37.911),(-122.1461,37.91)]'),
+('Manor Blvd', '[(-122.1584,37.906),(-122.1597,37.905)]'),
+('Manor Way', '[(-122.2853,37.857),(-122.2844,37.855)]'),
+('Manter Road', '[(-122.0531,37.984),(-122.0522,37.98)]'),
+('Mantilla Ave', '[(-122.0781,37.31),(-122.079,37.309)]'),
+('Manzanita St', '[(-122.0188,37.263),(-122.0182,37.258)]'),
+('Maple Ave', '[(-122.1987,37.024),(-122.197,37.035)]'),
+('Maple Ave', '[(-122.2051,37.962),(-122.2047,37.965)]'),
+('Maple Ave', '[(-122.21,37.909),(-122.2096,37.915)]'),
+('Maple St', '[(-121.7638,37.824),(-121.7627,37.82)]'),
+('Maple St', '[(-122.2888,37.796),(-122.2872,37.795)]'),
+('Maple Leaf Dr', '[(-121.864615,37.81276),(-121.863868,37.79283)]'),
+('Marabu Way', '[(-121.9503,37.454),(-121.9508,37.45)]'),
+('Maraschino Ct', '[(-122.0249,37.842),(-122.0252,37.833)]'),
+('Margery Dr', '[(-121.9766,37.338),(-121.9772,37.33)]'),
+('Marianas', '[(-122.2426,37.344),(-122.243,37.339)]'),
+('Marianas', '[(-122.244,37.327),(-122.244408,37.32305)]'),
+('Marigold Ct', '[(-121.9177,37.748),(-121.9187,37.746)]'),
+('Marigold Road', '[(-121.7383,37.123),(-121.7393,37.128)]'),
+('Marin Ave', '[(-122.1044,37.614),(-122.1055,37.613)]'),
+('Marin Ave', '[(-122.1101,37.608),(-122.1107,37.607)]'),
+('Marin Ave', '[(-122.258,37.969),(-122.258,37.966)]'),
+('Marin Ave', '[(-122.2741,37.894),(-122.272,37.901)]'),
+('Marin Ave', '[(-122.2865,37.891),(-122.2856,37.895)]'),
+('Marin Ave', '[(-122.2928,37.877),(-122.2925,37.877)]'),
+('Marin Ave', '[(-122.2956,37.871),(-122.2948,37.873)]'),
+('Marin Way', '[(-122.2443,37.898),(-122.2436,37.893)]'),
+('Marina Blvd', '[(-122.163,37.111),(-122.164,37.106)]'),
+('Marina Blvd', '[(-122.164188,37.10514),(-122.1651,37.101)]'),
+('Marineview Dr', '[(-122.1261,37.21),(-122.1254,37.205)]'),
+('Marineview Dr', '[(-122.1318,37.241),(-122.1305,37.239)]'),
+('Maritime St', '[(-122.3072,37.156),(-122.3084,37.142)]'),
+('Market Ave', '[(-122.0229,37.328),(-122.0244,37.312)]'),
+('Market St', '[(-122.2727,37.333),(-122.2725,37.34)]'),
+('Market St', '[(-122.2738,37.292),(-122.2736,37.301)]'),
+('Market St', '[(-122.2741,37.426),(-122.2742,37.433)]'),
+('Market St', '[(-122.2754,37.227),(-122.2751,37.235)]'),
+('Market St', '[(-122.2794,37.109),(-122.2793,37.114)]'),
+('Market St', '[(-122.2826,37.021),(-122.2825,37.023)]'),
+('Marlboro Way', '[(-121.86612,37.9994),(-121.866,37.999)]'),
+('Marlin Ct', '[(-122.044157,37.30406),(-122.044602,37.30052)]'),
+('Marlow Dr', '[(-122.1375,37.346),(-122.1374,37.351)]'),
+('Marne St', '[(-122.148,37.811),(-122.1476,37.805)]'),
+('Mars Road', '[(-121.7834,37.586),(-121.7827,37.575)]'),
+('Marsala Ct', '[(-121.848563,37.64116),(-121.847736,37.63501),(-121.847146,37.63392)]'),
+('Marshall St', '[(-122.0637,37.99),(-122.0638,37.982)]'),
+('Marshall Ter', '[(-122.026173,37.67648),(-122.026375,37.67346)]'),
+('Martin Ave', '[(-121.8618,37.818),(-121.8618,37.82696),(-121.8618,37.848)]'),
+('Martin Luther King Jr Way', '[(-122.2667,37.353),(-122.2666,37.357)]'),
+('Martin Luther King Jr Way', '[(-122.2698,37.223),(-122.2697,37.229)]'),
+('Martin Luther King Jr Way', '[(-122.2703,37.527),(-122.2702,37.517)]'),
+('Martin Luther King Jr Way', '[(-122.2705,37.194),(-122.2704,37.199)]'),
+('Martin Luther King Jr Way', '[(-122.2707,37.563),(-122.2706,37.545)]'),
+('Martin Luther King Jr Way', '[(-122.2709,37.489),(-122.2708,37.481)]'),
+('Martin Luther King Jr Way', '[(-122.2712,37.608),(-122.2711,37.599)]'),
+('Martin Luther King Jr Way', '[(-122.272,37.146),(-122.2715,37.153)]'),
+('Martin Luther King Jr Way', '[(-122.2787,37.014),(-122.2784,37.02),(-122.2779,37.027)]'),
+('Martinez Dr', '[(-121.984,37.793),(-121.984,37.796)]'),
+('Martinez St', '[(-122.159,37.191),(-122.1582,37.185)]'),
+('Maryland Ave', '[(-122.2734,37.031),(-122.272,37.032)]'),
+('Marylin Ave', '[(-121.7857,37.838),(-121.7833,37.837)]'),
+('Masonic Ter', '[(-121.9512,37.123),(-121.9508,37.124)]'),
+('Massachusetts St', '[(-122.0925,37.051),(-122.0909,37.056)]'),
+('Mateo Ct', '[(-122.0266,37.659),(-122.0273,37.65)]'),
+('Matthew Ct', '[(-121.8807,37.394),(-121.8783,37.395)]'),
+('Mattos Dr', '[(-121.9983,37.542),(-121.9992,37.53)]'),
+('Mattos Dr', '[(-122.0002,37.52),(-122.0005,37.513)]'),
+('Mattos Dr', '[(-122.0005,37.502),(-122.000898,37.49683)]'),
+('Mattox Road', '[(-122.0958,37.872),(-122.0957,37.876)]'),
+('Maubert Ave', '[(-122.1114,37.009),(-122.1096,37.995)]'),
+('Maud Ave', '[(-122.1387,37.25),(-122.1379,37.252)]'),
+('Mauna Loa Park Dr', '[(-121.9723,37.191),(-121.972,37.196)]'),
+('Mavis Ct', '[(-121.8584,37.606),(-121.8577,37.603)]'),
+('Mavis Dr', '[(-121.86,37.628),(-121.8598,37.606)]'),
+('Maxwelton Road', '[(-122.2248,37.31),(-122.2252,37.32)]'),
+('May Ct', '[(-122.0589,37.323),(-122.0577,37.331)]'),
+('May Road', '[(-122.0168,37.083),(-122.015,37.095)]'),
+('Maya St', '[(-121.9148,37.792),(-121.9143,37.784)]'),
+('Maybelle Ave', '[(-122.1957,37.878),(-122.1948,37.883)]'),
+('Maybelle Way', '[(-122.1974,37.873),(-122.1971,37.874)]'),
+('Mayfair Park Ave', '[(-121.9631,37.148),(-121.9629,37.143)]'),
+('Mayhews Landing Road', '[(-122.0417,37.346),(-122.0424,37.341)]'),
+('Mayhews Landing Road', '[(-122.0458,37.318),(-122.0468,37.309)]'),
+('Mayhews Landing Road', '[(-122.0482,37.299),(-122.0489,37.295)]'),
+('Mayport Cir', '[(-122.283588,37.88064),(-122.284724,37.87992)]'),
+('Mayview Way', '[(-121.7869,37.637),(-121.7848,37.636)]'),
+('Mc Clary Ave', '[(-122.1924,37.443),(-122.1917,37.448)]'),
+('Mc Farlane Lane', '[(-122.0823,37.377),(-122.0863,37.374)]'),
+('Mc Gee Ave', '[(-122.2755,37.611),(-122.2754,37.603)]'),
+('Mc Gee Ave', '[(-122.2768,37.709),(-122.2768,37.702)]'),
+('Mc Gee Ave', '[(-122.2772,37.746),(-122.2771,37.736)]'),
+('Mc Millan St', '[(-122.2479,37.454),(-122.248,37.457)]'),
+('McClure Ave', '[(-122.1431,37.001),(-122.1436,37.998)]'),
+('McGlinchey Dr', '[(-121.7721,37.745),(-121.7722,37.729)]'),
+('McKeown Ct', '[(-122.0676,37.681),(-122.0671,37.674)]'),
+('McKeown Ter', '[(-121.992,37.825),(-121.992203,37.82275)]'),
+('McSherry Way', '[(-122.235166,37.29199),(-122.234053,37.27635)]'),
+('Meadowbrook Ave', '[(-122.0406,37.198),(-122.0389,37.183)]'),
+('Meadowbrook Com', '[(-122.0043,37.608),(-122.0036,37.609)]'),
+('Meadowlark Dr', '[(-122.0692,37.985),(-122.0692,37.973)]'),
+('Mecartney Road', '[(-122.2473,37.374),(-122.2455,37.369)]'),
+('Mecartney Road', '[(-122.24835,37.37769),(-122.247665,37.3761)]'),
+('Medacino Ter', '[(-122.043321,37.65121),(-122.043914,37.64881)]'),
+('Medallion Dr', '[(-122.0502,37.08),(-122.0502,37.059)]'),
+('Medallion Dr', '[(-122.0502,37.929),(-122.0502,37.936)]'),
+('Medellion Dr', '[(-122.050194,37.95738),(-122.050187,37.96407)]'),
+('Medford Ave', '[(-122.1017,37.828),(-122.1015,37.829),(-122.1002,37.832)]'),
+('Medlar Dr', '[(-122.0627,37.378),(-122.0625,37.375)]'),
+('Meek Ave', '[(-122.0919,37.641),(-122.0897,37.642)]'),
+('Meekland Ave', '[(-122.113,37.812),(-122.1128,37.809)]'),
+('Meiggs St', '[(-121.9596,37.267),(-121.9593,37.255)]'),
+('Melbourne Ave', '[(-122.0842,37.285),(-122.0837,37.269)]'),
+('Melcher St', '[(-122.1792,37.21),(-122.1778,37.198)]'),
+('Mellow Way', '[(-122.0387,37.846),(-122.0377,37.841)]'),
+('Melrose Ave', '[(-122.2032,37.736),(-122.2029,37.733)]'),
+('Melrose Ave', '[(-122.2075,37.756),(-122.2072,37.754)]'),
+('Melrose Ave', '[(-122.2328,37.331),(-122.2319,37.335)]'),
+('Mendenhall Road', '[(-121.681342,37.03354),(-121.684794,37.0443)]'),
+('Mendenhall Road', '[(-122.134,37.677),(-122.1324,37.685)]'),
+('Merced St', '[(-122.1708,37.102),(-122.1707,37.099)]'),
+('Mercury St', '[(-122.0598,37.291),(-122.0595,37.284)]'),
+('Merle Ct', '[(-122.1467,37.373),(-122.1467,37.366)]'),
+('Merle Ct', '[(-122.1482,37.368),(-122.1479,37.358)]'),
+('Merol Ave', '[(-121.9924,37.453),(-121.9918,37.45)]'),
+('Merriewood Dr', '[(-122.2136,37.373),(-122.2128,37.389)]'),
+('Merrill Ave', '[(-121.9205,37.807),(-121.9196,37.811)]'),
+('Merrimac River St', '[(-122.032907,37.70666),(-122.0332,37.703)]'),
+('Merritt Ave', '[(-122.2471,37.078),(-122.2446,37.078)]'),
+('Merritt Ave', '[(-122.2495,37.053),(-122.2487,37.066)]'),
+('Merritt Channel', '[(-122.2591,37.968),(-122.2606,37.942)]'),
+('Mesa Ave', '[(-122.233,37.304),(-122.2322,37.291)]'),
+('Meteor Dr', '[(-122.0713,37.868),(-122.0702,37.862)]'),
+('Miami Ave', '[(-122.0812,37.234),(-122.0812,37.229)]'),
+('Michael Ave', '[(-121.9605,37.208),(-121.961,37.206)]'),
+('Michell Ct', '[(-121.7588,37.897),(-121.7583,37.893)]'),
+('Michelle St', '[(-121.9691,37.461),(-121.968214,37.45771)]'),
+('Middlefield Ave', '[(-121.9442,37.309),(-121.9426,37.311)]'),
+('Midvale Ave', '[(-122.2016,37.933),(-122.2009,37.938)]'),
+('Midway Road', '[(-121.572056,37.50049),(-121.574787,37.51247)]'),
+('Milani Ave', '[(-122.0235,37.438),(-122.024,37.432)]'),
+('Milburn Ter', '[(-122.058937,37.54931),(-122.058337,37.5373)]'),
+('Mildred Ct', '[(-122.0002,37.388),(-121.9998,37.386)]'),
+('Mildred Dr', '[(-121.9958,37.44),(-121.9964,37.433)]'),
+('Mildred Dr', '[(-121.9973,37.421),(-121.9977,37.417)]'),
+('Miles Ave', '[(-122.2599,37.373),(-122.2589,37.382)]'),
+('Miller Ave', '[(-122.2322,37.844),(-122.2319,37.848)]'),
+('Miller Ave', '[(-122.2353,37.806),(-122.235,37.809)]'),
+('Miller Road', '[(-122.0902,37.645),(-122.0865,37.545)]'),
+('Miller St', '[(-122.1627,37.048),(-122.1614,37.032)]'),
+('Mills Ave', '[(-122.1222,37.917),(-122.1222,37.908)]'),
+('Milmar Blvd', '[(-122.0785,37.108),(-122.0783,37.101)]'),
+('Milvia St', '[(-122.2689,37.593),(-122.2687,37.585)]'),
+('Milvia St', '[(-122.2692,37.637),(-122.2691,37.629)]'),
+('Milvia St', '[(-122.2707,37.772),(-122.2707,37.763)]'),
+('Milvia St', '[(-122.2711,37.817),(-122.2708,37.8),(-122.2707,37.781)]'),
+('Minerva St', '[(-122.0652,37.282),(-122.066,37.28)]'),
+('Mines Road', '[(-121.531666,37.83219),(-121.534092,37.94366)]'),
+('Mines Road', '[(-121.536341,37),(-121.536966,37.00198)]'),
+('Mines Road', '[(-121.570515,37.78068),(-121.568708,37.80183)]'),
+('Mines Road', '[(-121.633014,37.95741),(-121.642288,37.98874)]'),
+('Minivet Ct', '[(-121.8834,37.805),(-121.8838,37.811)]'),
+('Minturn Ct', '[(-122.0545,37.944),(-122.0538,37.946)]'),
+('Mira Vista Dr', '[(-122.0829,37.22),(-122.0827,37.213)]'),
+('Mirador Ct', '[(-121.8644,37.556),(-121.8633,37.552)]'),
+('Miramar Ave', '[(-122.1009,37.025),(-122.099089,37.03209)]'),
+('Miramonte Ave', '[(-122.1052,37.986),(-122.1042,37.997)]'),
+('Miranda St', '[(-122.0715,37.211),(-122.0717,37.206)]'),
+('Miranda Way', '[(-121.7837,37.649),(-121.7807,37.648)]'),
+('Mission Blvd', '[(-121.918886,37),(-121.9194,37.976),(-121.9198,37.975)]'),
+('Mission Blvd', '[(-121.920783,37.37168),(-121.9204,37.367)]'),
+('Mission Blvd', '[(-121.9214,37.961),(-121.9217,37.96)]'),
+('Mission Blvd', '[(-121.924901,37.92912),(-121.9254,37.922)]'),
+('Mission Blvd', '[(-121.928695,37.43767),(-121.925,37.417)]'),
+('Mission Blvd', '[(-121.937204,37.48803),(-121.936483,37.48336)]'),
+('Mission Blvd', '[(-121.9418,37.517),(-121.9389,37.499)]'),
+('Mission Blvd', '[(-121.9449,37.536),(-121.9438,37.53)]'),
+('Mission Blvd', '[(-121.949133,37.56339),(-121.948176,37.5572)]'),
+('Mission Blvd', '[(-121.9562,37.607),(-121.9548,37.598)]'),
+('Mission Blvd', '[(-121.9632,37.683),(-121.96315,37.6825)]'),
+('Mission Blvd', '[(-121.971801,37.77041),(-121.9706,37.762)]'),
+('Mission Blvd', '[(-121.9823,37.791),(-121.9765,37.788),(-121.9751,37.786)]'),
+('Mission Blvd', '[(-122.0006,37.896),(-121.9989,37.88)]'),
+('Mission Blvd', '[(-122.0221,37.084),(-122.021325,37.07762)]'),
+('Mission Blvd', '[(-122.0641,37.491),(-122.062,37.464)]'),
+('Mission Blvd', '[(-122.07,37.567),(-122.0692,37.555)]'),
+('Mission Blvd', '[(-122.0798,37.688),(-122.0779,37.668)]'),
+('Mission Blvd', '[(-122.0928,37.802),(-122.0919,37.796),(-122.0916,37.793)]'),
+('Mission Blvd', '[(-122.0955,37.824),(-122.0947,37.817)]'),
+('Mission Blvd', '[(-122.1031,37.882),(-122.1024,37.877)]'),
+('Mission Ct', '[(-121.929057,37.90595),(-121.929602,37.90063)]'),
+('Mission Dr', '[(-121.879,37.526),(-121.8788,37.526)]'),
+('Mission Creek', '[(-121.9244,37.614),(-121.9238,37.608)]'),
+('Mistflower Ave', '[(-122.0195,37.329),(-122.0199,37.323)]'),
+('Mitchell Ave', '[(-122.1438,37.376),(-122.1439,37.374)]'),
+('Mitchell St', '[(-122.2257,37.844),(-122.2249,37.852)]'),
+('Moccasin St', '[(-122.0302,37.085),(-122.0297,37.078)]'),
+('Mocine Ave', '[(-122.0751,37.497),(-122.0748,37.476)]'),
+('Mockingbird Lane', '[(-122.0862,37.419),(-122.0861,37.412)]'),
+('Mohr Ave', '[(-121.8495,37.819),(-121.8618,37.818)]'),
+('Mohr Ave', '[(-121.877,37.819),(-121.8793,37.816),(-121.8799,37.819)]'),
+('Mohr Dr', '[(-122.1132,37.466),(-122.113,37.46)]'),
+('Molaka Cir', '[(-122.0476,37.863),(-122.0479,37.871)]'),
+('Monaco Ave', '[(-122.0024,37.966),(-122.0023,37.967)]'),
+('Monaco Ct', '[(-121.8762,37.544),(-121.8766,37.538)]'),
+('Monika Lane', '[(-122.051987,37.88553),(-122.052536,37.88171)]'),
+('Montcalm Ave', '[(-122.0394,37.373),(-122.04,37.369)]'),
+('Monte Vista Dr', '[(-122.1127,37.4),(-122.1126,37.388)]'),
+('Montecito Ave', '[(-122.2602,37.114),(-122.2589,37.122)]'),
+('Montecito Cir', '[(-121.789,37.97),(-121.7883,37.967),(-121.7867,37.962)]'),
+('Montecito Cir', '[(-121.789,37.97),(-121.78927,37.9709)]'),
+('Montecito Dr', '[(-121.9899,37.743),(-121.9892,37.762)]'),
+('Montego Bay', '[(-122.2491,37.389),(-122.2485,37.396)]'),
+('Monterey Ave', '[(-122.2793,37.863),(-122.2799,37.857)]'),
+('Monterey Blvd', '[(-122.1494,37.018),(-122.1486,37.013)]'),
+('Monterey Blvd', '[(-122.189,37.987),(-122.1891,37.971)]'),
+('Monterey Blvd', '[(-122.1931,37.068),(-122.1918,37.051)]'),
+('Monterey Blvd', '[(-122.1971,37.103),(-122.1961,37.096)]'),
+('Monterey Blvd', '[(-122.2029,37.167),(-122.2012,37.146)]'),
+('Monterey Dr', '[(-121.909595,37.12732),(-121.910168,37.15444)]'),
+('Montgomery Ave', '[(-122.0971,37.824),(-122.0955,37.811)]'),
+('Montgomery Ave', '[(-122.0989,37.838),(-122.0977,37.829)]'),
+('Montgomery St', '[(-122.0882,37.738),(-122.0875,37.727)]'),
+('Montgomery St', '[(-122.2489,37.316),(-122.2471,37.33)]'),
+('Montgomery St', '[(-122.2518,37.292),(-122.2504,37.305)]'),
+('Monticello Ave', '[(-122.2,37.771),(-122.199,37.778)]'),
+('Monticello St', '[(-122.0561,37.37),(-122.0554,37.374)]'),
+('Mooney Ave', '[(-122.1234,37.972),(-122.1234,37.978)]'),
+('Moonflower Way', '[(-121.7297,37.075),(-121.7322,37.071)]'),
+('Moore Dr', '[(-122.1901,37.335),(-122.1884,37.351)]'),
+('Moores Ave', '[(-122.0087,37.301),(-122.0094,37.292)]'),
+('Moores Ave', '[(-122.0098,37.287),(-122.0102,37.281)]'),
+('Moores Ave', '[(-122.0138,37.237),(-122.014,37.233)]'),
+('Morada Ct', '[(-121.93541,37.49248),(-121.935229,37.49155)]'),
+('Moraga Ave', '[(-122.2096,37.265),(-122.2088,37.254)]'),
+('Moraga Ave', '[(-122.225,37.3),(-122.2243,37.3)]'),
+('Moraga Ave', '[(-122.2447,37.288),(-122.2423,37.302)]'),
+('Moraga Dr', '[(-121.7915,37.701),(-121.7906,37.705)]'),
+('Morcom Pl', '[(-122.1901,37.826),(-122.1897,37.829)]'),
+('Moreland Dr', '[(-122.0802,37.11),(-122.0793,37.109)]'),
+('Morengo Way', '[(-121.9209,37.837),(-121.9203,37.84)]'),
+('Mound St', '[(-122.2346,37.582),(-122.2339,37.588)]'),
+('Mound St', '[(-122.2402,37.531),(-122.2395,37.537)]'),
+('Mount Hamilton Ct', '[(-122.030097,37.11348),(-122.030412,37.11049)]'),
+('Mountain Ave', '[(-122.2267,37.24),(-122.2261,37.231)]'),
+('Mountain Ave', '[(-122.2291,37.256),(-122.2288,37.257)]'),
+('Mountain Blvd', '[(-122.151,37.659),(-122.1484,37.64)]'),
+('Mountain Blvd', '[(-122.1535,37.702),(-122.153,37.696)]'),
+('Mountain Blvd', '[(-122.1765,37.857),(-122.177,37.85)]'),
+('Mountain Blvd', '[(-122.1774,37.889),(-122.1771,37.887)]'),
+('Mountain Blvd', '[(-122.1789,37.934),(-122.1787,37.93)]'),
+('Mountain Blvd', '[(-122.2013,37.164),(-122.2004,37.15)]'),
+('Mountain Blvd', '[(-122.2085,37.261),(-122.2088,37.254)]'),
+('Mountain Blvd', '[(-122.211,37.308),(-122.2102,37.297)]'),
+('Mountain Blvd', '[(-122.222,37.435),(-122.2204,37.436)]'),
+('Mountain Blvd', '[(-122.2261,37.465),(-122.2241,37.451)]'),
+('Mountaingate Way', '[(-122.1999,37.198),(-122.1994,37.193)]'),
+('Mowry Ave', '[(-121.9745,37.659),(-121.975803,37.65155)]'),
+('Mowry Ave', '[(-121.976381,37.64822),(-121.9769,37.646)]'),
+('Mowry Ave', '[(-121.9807,37.567),(-121.9809,37.565)]'),
+('Mowry Ave', '[(-121.9825,37.547),(-121.9838,37.532)]'),
+('Mowry Ave', '[(-121.9896,37.459),(-121.9904,37.449)]'),
+('Mowry Ave', '[(-122.0074,37.245),(-122.008,37.236)]'),
+('Mowry Ave', '[(-122.0113,37.158),(-122.0129,37.124)]'),
+('Mowry Slough', '[(-122.0393,37.918),(-122.0552,37.908)]'),
+('Msn Creek Dr', '[(-121.9354,37.428),(-121.9344,37.427)]'),
+('Mtn House Road', '[(-121.576862,37.78355),(-121.576389,37.80422)]'),
+('Mtn House Road', '[(-121.579578,37.73807),(-121.578037,37.75356)]'),
+('Mtn House Creek', '[(-121.558979,37.69672),(-121.558765,37.69123),(-121.564396,37.65095)]'),
+('Mtn House Creek', '[(-121.570759,37.60189),(-121.566196,37.63889)]'),
+('Mtn House Creek', '[(-121.577,37.50431),(-121.578144,37.49554)]'),
+('Muir St', '[(-122.0761,37.529),(-122.0756,37.524)]'),
+('Muir St', '[(-122.0787,37.562),(-122.0779,37.553)]'),
+('Muirwood Dr', '[(-121.9162,37.824),(-121.9168,37.831)]'),
+('Mulberry Pl', '[(-121.9221,37.234),(-121.9225,37.232)]'),
+('Mulberry Pl', '[(-121.9238,37.249),(-121.9249,37.261)]'),
+('Mulberry St', '[(-122.0363,37.332),(-122.034,37.32)]'),
+('Murcia St', '[(-122.076,37.235),(-122.0758,37.23)]'),
+('Murdell Lane', '[(-121.7977,37.619),(-121.797719,37.60774)]');
+
+INSERT INTO road VALUES
+('Murdell Lane', '[(-121.8001,37.746),(-121.7998,37.741)]'),
+('Murdock Ct', '[(-122.1828,37.753),(-122.1832,37.756)]'),
+('Murray St', '[(-122.2885,37.513),(-122.288,37.514)]'),
+('Murrieta Blvd', '[(-121.7825,37.758),(-121.7816,37.758)]'),
+('Murrieta Blvd', '[(-121.7847,37.94),(-121.7842,37.942)]'),
+('Murrieta Blvd', '[(-121.7864,37.791),(-121.7866,37.797)]'),
+('Murrieta Blvd', '[(-121.7865,37.934),(-121.7858,37.936)]'),
+('Murrieta Blvd', '[(-121.788409,37.80906),(-121.7885,37.815)]'),
+('Myers St', '[(-122.1511,37.423),(-122.151,37.415)]'),
+('Myra Ct', '[(-122.108083,37.47375),(-122.108278,37.47677)]'),
+('Myrtle St', '[(-122.0924,37.685),(-122.0919,37.676)]'),
+('Myrtle St', '[(-122.2812,37.092),(-122.2805,37.108)]'),
+('N St', '[(-121.7737,37.824),(-121.7739,37.829)]'),
+('Nandina Ct', '[(-121.9274,37.299),(-121.9281,37.297)]'),
+('Nansa Ct', '[(-121.9188,37.259),(-121.918711,37.25453)]'),
+('Natalie Ave', '[(-121.9792,37.307),(-121.9799,37.296)]'),
+('National Ave', '[(-122.1192,37.5),(-122.1281,37.489)]'),
+('Navajo Ct', '[(-121.8779,37.901),(-121.8783,37.9)]'),
+('Navy Roadway', '[(-122.3093,37.092),(-122.3123,37.109)]'),
+('Neal St', '[(-121.8692,37.577),(-121.8683,37.574)]'),
+('Nelson Ct', '[(-121.864163,37.4684),(-121.86436,37.4745)]'),
+('Nelson Pl', '[(-122.0366,37.522),(-122.0368,37.519)]'),
+('Nelson St', '[(-121.9822,37.362),(-121.9846,37.348)]'),
+('Neptune Dr', '[(-122.1878,37.989),(-122.1853,37.958)]'),
+('Neptune Dr', '[(-122.1881,37.032),(-122.1875,37.007)]'),
+('Neptune Road', '[(-121.7885,37.607),(-121.7885,37.599)]'),
+('Nevada St', '[(-122.0313,37.891),(-122.0317,37.882)]'),
+('Nevada St', '[(-122.1821,37.37),(-122.1815,37.376)]'),
+('New England Village Dr', '[(-122.058,37.237),(-122.0585,37.235)]'),
+('Newark Blvd', '[(-122.0329,37.398),(-122.032,37.382)]'),
+('Newark Blvd', '[(-122.0352,37.438),(-122.0341,37.423)]'),
+('Newberry St', '[(-122.2671,37.568),(-122.2668,37.554)]'),
+('Newcastle Lane', '[(-121.918,37.167),(-121.9191,37.182)]'),
+('Newport St', '[(-122.1059,37.328),(-122.1054,37.315)]'),
+('Nicol Ave', '[(-122.2174,37.943),(-122.2164,37.94)]'),
+('Nicolet Ave', '[(-122.0174,37.696),(-122.0183,37.693)]'),
+('Nicolet Ave', '[(-122.0238,37.615),(-122.0238,37.61)]'),
+('Nicolet Ave', '[(-122.0264,37.574),(-122.0269,37.567)]'),
+('Nicolet Ct', '[(-122.0242,37.641),(-122.0236,37.638)]'),
+('Nielsen Lane', '[(-121.744,37.777),(-121.744,37.77)]'),
+('Niles Blvd', '[(-121.9933,37.803),(-121.9929,37.803)]'),
+('Niles Canyon Road', '[(-121.881448,37.92865),(-121.8812,37.929)]'),
+('Niles Canyon Road', '[(-121.8954,37.94),(-121.89496,37.93963)]'),
+('Niles Canyon Road', '[(-121.909,37.94),(-121.9034,37.957)]'),
+('Niles Canyon Road', '[(-121.9292,37.955),(-121.925931,37.9815)]'),
+('Niles Canyon Road', '[(-121.9333,37.913),(-121.9317,37.919)]'),
+('Niles Canyon Road', '[(-121.9352,37.912),(-121.9346,37.91)]'),
+('Nobhill Ct', '[(-122.0354,37.523),(-122.0353,37.517)]'),
+('Norbridge Ave', '[(-122.084,37.911),(-122.0829,37.911)]'),
+('Norene Way', '[(-122.1365,37.286),(-122.136,37.287)]'),
+('Norfolk Road', '[(-122.2936,37.877),(-122.2937,37.859)]'),
+('Norfolk Road', '[(-122.2937,37.848),(-122.2941,37.845)]'),
+('Noria Ct', '[(-121.9319,37.288),(-121.9324,37.286)]'),
+('Norissa Cir', '[(-122.0486,37.763),(-122.0484,37.77)]'),
+('Normandie Ave', '[(-122.1902,37.783),(-122.1886,37.768)]'),
+('Normandy Ct', '[(-122.0629,37.971),(-122.063,37.968)]'),
+('Normandy Dr', '[(-122.0501,37.457),(-122.0506,37.451)]'),
+('Norris Canyon Road', '[(-122.015,37.545),(-122.0103,37.541)]'),
+('Norris Canyon Road', '[(-122.0329,37.332),(-122.0278,37.371)]'),
+('North Blvd', '[(-122.1768,37.243),(-122.1775,37.242)]'),
+('North Hill Ct', '[(-122.231,37.533),(-122.2325,37.541)]'),
+('Northland Ter', '[(-122.059106,37.55559),(-122.05922,37.55498)]'),
+('Northrup St', '[(-122.2141,37.371),(-122.215,37.381)]'),
+('Northvale Road', '[(-122.2361,37.088),(-122.2335,37.083)]'),
+('Northview Dr', '[(-122.0504,37.887),(-122.0511,37.892)]'),
+('Northway Road', '[(-121.8857,37.748),(-121.8871,37.75)]'),
+('Northwood Dr', '[(-122.2299,37.64),(-122.2291,37.638)]'),
+('Northwood Dr', '[(-122.2317,37.629),(-122.2311,37.637)]'),
+('Northwood Com', '[(-121.7885,37.815),(-121.788231,37.80962)]'),
+('Norton Ave', '[(-122.1977,37.967),(-122.196855,37.97165)]'),
+('Norwood Pl', '[(-121.7807,37.534),(-121.7811,37.534)]'),
+('Nottingham Ct', '[(-122.0297,37.528),(-122.0303,37.522)]'),
+('Nova Dr', '[(-122.2397,37.213),(-122.2394,37.214)]'),
+('Novara Road', '[(-122.2377,37.47),(-122.2368,37.472)]'),
+('Novato St', '[(-122.0628,37.731),(-122.0633,37.723)]'),
+('Nula Way', '[(-122.0553,37.865),(-122.0552,37.855)]'),
+('Nursery Ave', '[(-121.9897,37.802),(-121.9901,37.795)]'),
+('O Connell Lane', '[(-121.9941,37.985),(-121.9917,37.974)]'),
+('O Connell Lane', '[(-122.00235,37.9875),(-121.9964,37.995)]'),
+('O Connell Lane', '[(-122.0038,37.972),(-122.0036,37.975)]'),
+('Oak St', '[(-122.2383,37.713),(-122.238,37.719)]'),
+('Oak St', '[(-122.2437,37.636),(-122.2431,37.644)]'),
+('Oak St', '[(-122.265,37.877),(-122.264,37.879)]'),
+('Oak St', '[(-122.2653,37.967),(-122.2649,37.974)]'),
+('Oak St', '[(-122.2666,37.947),(-122.2664,37.95)]'),
+('Oak Creek Ct', '[(-121.9153,37.737),(-121.9171,37.735)]'),
+('Oak Hill Road', '[(-122.1409,37.647),(-122.1382,37.658)]'),
+('Oak Knoll Blvd', '[(-122.151,37.559),(-122.1504,37.556)]'),
+('Oakbrook Ct', '[(-121.865488,37.96653),(-121.8661,37.965)]'),
+('Oakdale St', '[(-122.0648,37.767),(-122.0654,37.761)]'),
+('Oakes Blvd', '[(-122.1523,37.316),(-122.1511,37.318)]'),
+('Oakes Dr', '[(-122.034734,37.62423),(-122.0329,37.618)]'),
+('Oakland Ave', '[(-121.8703,37.85305),(-121.8703,37.866)]'),
+('Oakland Ave', '[(-122.2332,37.258),(-122.2319,37.262)]'),
+('Oakland Ave', '[(-122.24,37.235),(-122.2393,37.237),(-122.2387,37.24)]'),
+('Oakland Ave', '[(-122.2529,37.197),(-122.2521,37.203)]'),
+('Oakland Ave', '[(-122.2583,37.162),(-122.2569,37.167)]'),
+('Oakland Inner Harbor', '[(-122.2625,37.913),(-122.260016,37.89484)]'),
+('Oakmont Ave', '[(-122.231698,37.17113),(-122.2321,37.168)]'),
+('Oakport St', '[(-122.1975,37.422),(-122.1963,37.386)]'),
+('Oakport St', '[(-122.2123,37.59),(-122.2117,37.585)]'),
+('Oakridge Road', '[(-121.7646,37.841),(-121.768787,37.84142)]'),
+('Oakridge Road', '[(-121.8182,37.93),(-121.8207,37.931)]'),
+('Oakridge Road', '[(-121.8316,37.049),(-121.828382,37)]'),
+('Oakview Dr', '[(-122.2079,37.123),(-122.2074,37.116)]'),
+('Oakwood Dr', '[(-122.1989,37.424),(-122.198,37.437)]'),
+('Ocaso Camino', '[(-121.9293,37.261),(-121.9303,37.252)]'),
+('Occidental Road', '[(-122.1102,37.403),(-122.110496,37.40277)]'),
+('Ocie Way', '[(-122.0966,37.605),(-122.097,37.603)]'),
+('Octavia St', '[(-122.2026,37.906),(-122.2013,37.906)]'),
+('Ogden Dr', '[(-121.978963,37.36863),(-121.9808,37.368)]'),
+('Olazaba Ter', '[(-121.9176,37.247),(-121.917664,37.24323)]'),
+('Old Bernal Ave', '[(-121.879084,37.58027),(-121.878944,37.57993)]'),
+('Old Canyon Road', '[(-121.965,37.794),(-121.963,37.8)]'),
+('Old Santa Rita Road', '[(-121.877505,37.9429),(-121.8776,37.96)]'),
+('Old Tower Road', '[(-121.7722,37.729),(-121.7704,37.729)]'),
+('Old Warm Springs Blvd', '[(-121.9482,37.092),(-121.9473,37.084)]'),
+('Oleander Ave', '[(-122.2338,37.296),(-122.2346,37.295)]'),
+('Oleander Ave', '[(-122.2358,37.302),(-122.236192,37.30424)]'),
+('Oleander St', '[(-121.7471,37.126),(-121.7459,37.129)]'),
+('Olive Ave', '[(-121.9326,37.36),(-121.9333,37.356)]'),
+('Olive Ave', '[(-121.9458,37.34),(-121.9493,37.337)]'),
+('Olive Ave', '[(-122.2462,37.219),(-122.2451,37.202)]'),
+('Oliver Way', '[(-121.9665,37.739),(-121.966295,37.73644)]'),
+('Olivina Ave', '[(-121.7791,37.829),(-121.7787,37.829)]'),
+('Olympic Ct', '[(-122.0509,37.321),(-122.0518,37.31)]'),
+('Olympus Ave', '[(-122.2512,37.834),(-122.2502,37.818)]'),
+('Omak St', '[(-121.9209,37.064),(-121.9209,37.071)]'),
+('Omar St', '[(-121.9719,37.221),(-121.9724,37.222)]'),
+('Omar St', '[(-121.9825,37.255),(-121.9831,37.259)]'),
+('Omega Ave', '[(-122.0678,37.988),(-122.0664,37.989)]'),
+('Oneil Ave', '[(-122.073989,37.5886),(-122.073631,37.58413)]'),
+('Oneil Ave', '[(-122.076754,37.62476),(-122.0745,37.595)]'),
+('Onondaga Dr', '[(-121.9288,37.054),(-121.9282,37.048)]'),
+('Onondaga Dr', '[(-121.9312,37.054),(-121.93,37.058)]'),
+('Opal Way', '[(-121.7984,37.679),(-121.7975,37.679)]'),
+('Orange Ave', '[(-122.0787,37.867),(-122.0789,37.842)]'),
+('Orchard Ave', '[(-122.0858,37.555),(-122.0833,37.551)]'),
+('Orchard Lane', '[(-122.2475,37.694),(-122.2467,37.692)]'),
+('Orchid Dr', '[(-122.1416,37.098),(-122.1397,37.085)]'),
+('Oregon St', '[(-122.2589,37.588),(-122.2565,37.591)]'),
+('Oregon St', '[(-122.2794,37.561),(-122.2789,37.562)]'),
+('Orin Dr', '[(-122.2623,37.133),(-122.2626,37.142)]'),
+('Oriole Ave', '[(-121.7879,37.827),(-121.7879,37.851)]'),
+('Oriole Ave', '[(-122.1209,37.051),(-122.1205,37.071)]'),
+('Orleans Dr', '[(-122.046,37.393),(-122.0464,37.383)]'),
+('Orleans Dr', '[(-122.0473,37.438),(-122.0463,37.412)]'),
+('Orloff Dr', '[(-121.8659,37.767),(-121.865,37.765)]'),
+('Orloff Dr', '[(-121.8677,37.768),(-121.8669,37.768)]'),
+('Osgood Road', '[(-121.9371,37.071),(-121.9363,37.06)]'),
+('Osgood Road', '[(-121.949,37.262),(-121.946,37.208)]'),
+('Ostrander Road', '[(-122.2364,37.413),(-122.2356,37.429)]'),
+('Otis Dr', '[(-122.2564,37.619),(-122.256,37.618)]'),
+('Otis Dr', '[(-122.2605,37.627),(-122.2593,37.625)]'),
+('Outlook Ave', '[(-122.1616,37.636),(-122.1612,37.632)]'),
+('Outlook Ave', '[(-122.168,37.698),(-122.1678,37.697)]'),
+('Outlook Ave', '[(-122.1743,37.75),(-122.1736,37.746)]'),
+('Outlook Ave', '[(-122.1789,37.788),(-122.1786,37.787)]'),
+('Outrigger Dr', '[(-122.1802,37.95),(-122.178449,37.9197)]'),
+('Overacker Ave', '[(-121.9617,37.652),(-121.9614,37.648),(-121.9607,37.643)]'),
+('Owl Ct', '[(-121.91654,37.19636),(-121.915693,37.19031)]'),
+('Oxford Pl', '[(-121.7752,37.532),(-121.7747,37.535)]'),
+('Oxford St', '[(-122.2651,37.702),(-122.2651,37.699)]'),
+('Oxford St', '[(-122.2657,37.742),(-122.2656,37.734)]'),
+('Oyster Pond Road', '[(-122.2408,37.407),(-122.2404,37.403)]'),
+('Oyster Shoals', '[(-122.2372,37.394),(-122.2365,37.393)]'),
+('Pacific Ave', '[(-121.754552,37.76177),(-121.753824,37.76164)]'),
+('Pacific Ave', '[(-122.1632,37.171),(-122.1621,37.156),(-122.1613,37.15)]'),
+('Pacific Ave', '[(-122.1661,37.214),(-122.1654,37.204)]'),
+('Pacific Ave', '[(-122.2419,37.683),(-122.2408,37.678)]'),
+('Pacific Ave', '[(-122.2535,37.735),(-122.2527,37.731)]'),
+('Pacific St', '[(-122.0342,37.962),(-122.0371,37.962)]'),
+('Pacific St', '[(-122.0544,37.294),(-122.0548,37.297)]'),
+('Packet Landing Road', '[(-122.2376,37.471),(-122.2372,37.458)]'),
+('Pagano Ct', '[(-122.1371,37.959),(-122.1379,37.954)]'),
+('Pala Ave', '[(-122.2328,37.28),(-122.2319,37.283)]'),
+('Palatka Lane', '[(-122.0915,37.35),(-122.0927,37.354)]'),
+('Palm Ave', '[(-121.932,37.329),(-121.9319,37.319)]'),
+('Palm Dr', '[(-122.0503,37.898),(-122.0501,37.897)]'),
+('Palm Dr', '[(-122.052051,37.88751),(-122.0519,37.885)]'),
+('Palmer Dr', '[(-121.86601,37.85873),(-121.865793,37.84778)]'),
+('Palmer Dr', '[(-122.003005,37.52852),(-122.0026,37.527)]'),
+('Palmetto Dr', '[(-122.0189,37.111),(-122.018,37.106)]'),
+('Palo Verde Road', '[(-122.0242,37.959),(-122.023,37.955),(-122.0222,37.961)]'),
+('Paloma Ave', '[(-122.2347,37.126),(-122.2353,37.136)]'),
+('Palomares Road', '[(-121.9404,37.123),(-121.9407,37.11)]'),
+('Palomares Road', '[(-121.9501,37.318),(-121.948,37.304)]'),
+('Palomares Road', '[(-121.9683,37.439),(-121.9686,37.436)]'),
+('Palomares Road', '[(-121.9976,37.676),(-121.997,37.674)]'),
+('Palomares Road', '[(-122.0191,37.873),(-122.0056,37.744)]'),
+('Palomino Dr', '[(-121.8536,37.59),(-121.852,37.589)]'),
+('Pampas Ave', '[(-122.188335,37.87635),(-122.1878,37.872)]'),
+('Panda Way', '[(-122.0668,37.773),(-122.0662,37.762)]'),
+('Panitz St', '[(-122.0553,37.686),(-122.0553,37.679)]'),
+('Panorama Trl', '[(-121.8996,37.291),(-121.9098,37.262)]'),
+('Panorama Trl', '[(-121.9023,37.342),(-121.8995,37.303)]'),
+('Panorama Trl', '[(-121.9096,37.37),(-121.9098,37.371)]'),
+('Panorama Trl', '[(-121.9148,37.366),(-121.9141,37.356)]'),
+('Panoramic Way', '[(-122.2454,37.695),(-122.2436,37.688)]'),
+('Papago St', '[(-121.9155,37.826),(-121.9147,37.811)]'),
+('Parada St', '[(-121.9949,37.166),(-121.9931,37.153)]'),
+('Pardee Ave', '[(-121.9885,37.367),(-121.9893,37.359)]'),
+('Pardee Dr', '[(-122.1991,37.286),(-122.1974,37.27)]'),
+('Parish Ct', '[(-122.236048,37.33387),(-122.235406,37.3307)]'),
+('Park Ave', '[(-122.2407,37.634),(-122.2404,37.638)]'),
+('Park Ave', '[(-122.242,37.616),(-122.2416,37.621)]'),
+('Park Ave', '[(-122.2461,37.565),(-122.2443,37.589)]'),
+('Park Ave', '[(-122.2841,37.316),(-122.2851,37.314)]'),
+('Park Blvd', '[(-122.2058,37.222),(-122.2047,37.23)]'),
+('Park Blvd', '[(-122.218,37.087),(-122.2173,37.091)]'),
+('Park Blvd', '[(-122.2312,37.051),(-122.2303,37.049)]'),
+('Park Blvd', '[(-122.2387,37.027),(-122.2377,37.028),(-122.2362,37.031)]'),
+('Park Blvd', '[(-122.2461,37.013),(-122.2457,37.013)]'),
+('Park Lane', '[(-122.2309,37.163),(-122.2313,37.166)]'),
+('Park St', '[(-121.7711,37.86),(-121.7699,37.863)]'),
+('Park St', '[(-122.2377,37.686),(-122.237,37.695)]'),
+('Park St', '[(-122.2491,37.541),(-122.247562,37.56407)]'),
+('Park St', '[(-122.2825,37.544),(-122.282424,37.5421)]'),
+('Park Way', '[(-122.0875,37.97),(-122.087418,37.96824)]'),
+('Park Way', '[(-122.2339,37.288),(-122.2332,37.288)]'),
+('Park Way', '[(-122.2366,37.289),(-122.2357,37.288)]'),
+('Park Way', '[(-122.3038,37.798),(-122.3031,37.8)]'),
+('Park Blvd Way', '[(-122.2303,37.049),(-122.2287,37.049)]'),
+('Park Center Lane', '[(-121.9793,37.431),(-121.9798,37.425)]'),
+('Parker Ave', '[(-122.1647,37.685),(-122.1643,37.686)]'),
+('Parker Road', '[(-122.0876,37.181),(-122.0859,37.17)]'),
+('Parker St', '[(-122.2664,37.623),(-122.2643,37.626)]'),
+('Parkmeadow Dr', '[(-121.9319,37.062),(-121.9322,37.066)]'),
+('Parkmeadow Dr', '[(-121.9324,37.099),(-121.9317,37.104)]'),
+('Parkridge Dr', '[(-122.1438,37.884),(-122.1428,37.9)]'),
+('Parkside Dr', '[(-121.886474,37.83325),(-121.8863,37.834)]'),
+('Parkside Dr', '[(-121.8925,37.806),(-121.8916,37.809)]'),
+('Parkside Dr', '[(-121.895065,37.79588),(-121.8949,37.797)]'),
+('Parkside Dr', '[(-121.9836,37.598),(-121.9851,37.594),(-121.9861,37.592)]'),
+('Parkside Dr', '[(-122.0475,37.603),(-122.0443,37.596)]'),
+('Parkside Dr', '[(-122.0595,37.008),(-122.0592,37.012)]'),
+('Parkview Road', '[(-122.0548,37.023),(-122.0548,37.02)]'),
+('Parnassus Road', '[(-122.2525,37.814),(-122.2518,37.814)]'),
+('Parsons Ct', '[(-122.082,37.056),(-122.0812,37.053)]'),
+('Partridge Ave', '[(-122.1597,37.655),(-122.1584,37.652)]'),
+('Partridge Com', '[(-121.7876,37.877),(-121.7876,37.882)]'),
+('Paru St', '[(-122.2583,37.712),(-122.2574,37.725)]'),
+('Paru St', '[(-122.2601,37.687),(-122.2594,37.695)]'),
+('Pasatiempo St', '[(-121.7252,37.262),(-121.7252,37.27)]'),
+('Paseo del Cajon', '[(-121.8901,37.699),(-121.889101,37.68411)]'),
+('Paseo del Rio', '[(-122.1309,37.842),(-122.1332,37.836),(-122.134,37.835)]'),
+('Paseo Grande', '[(-122.1197,37.83),(-122.1204,37.826)]'),
+('Paseo Grande', '[(-122.1231,37.812),(-122.1234,37.809)]'),
+('Paseo Largavista', '[(-122.1287,37.822),(-122.1281,37.811)]'),
+('Paseo Padre Pkwy', '[(-121.9143,37.005),(-121.913522,37)]'),
+('Paseo Padre Pkwy', '[(-121.9188,37.004),(-121.9177,37.004)]'),
+('Paseo Padre Pkwy', '[(-121.9292,37.083),(-121.9295,37.088)]'),
+('Paseo Padre Pkwy', '[(-121.9302,37.137),(-121.9298,37.146)]'),
+('Paseo Padre Pkwy', '[(-121.9357,37.342),(-121.9327,37.318)]'),
+('Paseo Padre Pkwy', '[(-121.9594,37.433),(-121.9569,37.419)]'),
+('Paseo Padre Pkwy', '[(-121.960768,37.44248),(-121.9599,37.437)]'),
+('Paseo Padre Pkwy', '[(-121.9643,37.462),(-121.9618,37.449)]'),
+('Paseo Padre Pkwy', '[(-121.9885,37.578),(-121.9877,37.574)]'),
+('Paseo Padre Pkwy', '[(-122.0021,37.639),(-121.996,37.628)]'),
+('Paseo Padre Pkwy', '[(-122.0332,37.819),(-122.0307,37.809)]'),
+('Paseo Padre Pkwy', '[(-122.0414,37.734),(-122.0445,37.708)]'),
+('Paseo Padre Pkwy', '[(-122.045898,37.70023),(-122.047,37.695)]'),
+('Paseo Padre Pkwy', '[(-122.049,37.684),(-122.05,37.67999)]'),
+('Paseo Padre Pkwy', '[(-122.051153,37.67586),(-122.0517,37.674)]'),
+('Paseo Santa Cruz', '[(-121.9052,37.65),(-121.904,37.65)]'),
+('Paseo Santa Cruz', '[(-121.906145,37.66172),(-121.905945,37.65817)]'),
+('Patterson Pass Road', '[(-121.556654,37.14753),(-121.556,37.148)]'),
+('Patterson Pass Road', '[(-121.574131,37.07538),(-121.573093,37.09003)]'),
+('Patterson Ranch Road', '[(-122.0702,37.545),(-122.0855,37.509),(-122.0902,37.515)]'),
+('Paxton Ct', '[(-122.0092,37.388),(-122.0101,37.378)]'),
+('Payne Ct', '[(-121.9133,37.841),(-121.9139,37.84)]'),
+('Peach Ct', '[(-122.0477,37.295),(-122.0473,37.293)]'),
+('Peach St', '[(-122.2339,37.527),(-122.2334,37.532),(-122.2328,37.537)]'),
+('Peach St', '[(-122.2352,37.502),(-122.2354,37.514)]'),
+('Peachtree Ave', '[(-122.0511,37.277),(-122.0517,37.275)]'),
+('Peachtree Dr', '[(-122.091,37.209),(-122.0913,37.199)]'),
+('Pearl St', '[(-122.2319,37.672),(-122.2316,37.676)]'),
+('Pearl St', '[(-122.2337,37.651),(-122.2329,37.661)]'),
+('Pearl St', '[(-122.2383,37.594),(-122.2366,37.615)]'),
+('Pearl St', '[(-122.2551,37.179),(-122.2546,37.174)]'),
+('Peary Ct', '[(-121.769,37.711),(-121.7686,37.706)]'),
+('Pecan Ct', '[(-121.9126,37.743),(-121.9142,37.739)]'),
+('Peladeau St', '[(-122.2888,37.383),(-122.2889,37.386)]'),
+('Pelican Ct', '[(-121.7907,37.839),(-121.7902,37.832)]'),
+('Penniman Ave', '[(-122.2018,37.863),(-122.2012,37.856)]'),
+('Pennsylvania Ave', '[(-121.9854,37.532),(-121.9862,37.523)]'),
+('Peony Ct', '[(-121.9798,37.204),(-121.9804,37.198)]'),
+('Pepperdine St', '[(-122.1501,37.989),(-122.1488,37.98)]'),
+('Peppertree Ct', '[(-121.9416,37.16),(-121.9412,37.163)]'),
+('Peppertree Road', '[(-121.9421,37.127),(-121.94222,37.1302)]'),
+('Peralta Ave', '[(-122.1585,37.293),(-122.1592,37.29)]'),
+('Peralta Ave', '[(-122.1639,37.267),(-122.1653,37.27)]'),
+('Peralta Blvd', '[(-121.9856,37.63),(-121.9867,37.627)]'),
+('Peralta Blvd', '[(-122.0022,37.595),(-122.0045,37.591)]'),
+('Peralta Blvd', '[(-122.0073,37.573),(-122.0082,37.562)]'),
+('Peralta St', '[(-122.2832,37.243),(-122.2829,37.246)]'),
+('Peralta St', '[(-122.2933,37.113),(-122.2926,37.116)]'),
+('Peralta St', '[(-122.2943,37.103),(-122.2937,37.111)]'),
+('Peralta St', '[(-122.2974,37.061),(-122.2973,37.063)]'),
+('Peridot Dr', '[(-121.8024,37.648),(-121.8024,37.645)]'),
+('Periwinkle Road', '[(-122.0451,37.301),(-122.044758,37.29844)]'),
+('Perkins St', '[(-122.0185,37.617),(-122.0177,37.613)]'),
+('Perkins St', '[(-122.2553,37.105),(-122.2557,37.096)]'),
+('Perlata Creek', '[(-122.2027,37.941),(-122.2031,37.936)]'),
+('Perlata Creek', '[(-122.2059,37.92),(-122.2092,37.906)]'),
+('Perlata Creek', '[(-122.2133,37.891),(-122.214,37.885)]'),
+('Perlata Creek', '[(-122.2158,37.753),(-122.2155,37.739)]'),
+('Perlata Creek', '[(-122.21853,37.83163),(-122.2188,37.826)]'),
+('Perry Road', '[(-122.0265,37.846),(-122.0256,37.844)]'),
+('Pershing Dr', '[(-122.1618,37.278),(-122.1613,37.271),(-122.1609,37.266)]'),
+('Pershing Dr', '[(-122.1633,37.299),(-122.1628,37.291)]'),
+('Pershing Dr', '[(-122.165,37.321),(-122.1645,37.315)]'),
+('Pershing Dr', '[(-122.1662,37.339),(-122.1658,37.333)]'),
+('Pestana Pl', '[(-121.7578,37.84),(-121.757776,37.84644)]'),
+('Peterman Ave', '[(-122.0945,37.392),(-122.0918,37.421)]'),
+('Peters Ave', '[(-121.8769,37.6),(-121.8763,37.608)]'),
+('Peters St', '[(-122.1287,37.068),(-122.128,37.073)]'),
+('Peterson St', '[(-122.232,37.733),(-122.2316,37.739)]'),
+('Peterson Way', '[(-122.0967,37.162),(-122.0952,37.159)]'),
+('Petroleum St', '[(-122.3168,37.13),(-122.3177,37.13)]'),
+('Petronave Dr', '[(-121.8344,37.469),(-121.83751,37.55738)]'),
+('Pickering Ave', '[(-121.9596,37.722),(-121.958868,37.72618)]'),
+('Pickering Ave', '[(-121.964,37.698),(-121.9637,37.7)]'),
+('Pico Road', '[(-121.9165,37.524),(-121.9177,37.505)]'),
+('Piedmont Ave', '[(-122.2511,37.644),(-122.251,37.624)]'),
+('Piedmont Ave', '[(-122.2527,37.263),(-122.2521,37.268)]'),
+('Piedmont Cres', '[(-122.2513,37.671),(-122.2503,37.661)]'),
+('Pierce Ave', '[(-122.1683,37.186),(-122.1672,37.168)]'),
+('Pierce St', '[(-122.3045,37.891),(-122.3042,37.884)]'),
+('Pike Ct', '[(-121.9219,37.08),(-121.9224,37.079)]'),
+('Pimlico Dr', '[(-121.8616,37.998),(-121.8618,37.008)]'),
+('Pine St', '[(-121.7758,37.902),(-121.7746,37.906)]'),
+('Pine St', '[(-121.7784,37.894),(-121.7776,37.897)]'),
+('Pine St', '[(-121.7869,37.882),(-121.7864,37.883)]'),
+('Pine St', '[(-121.9216,37.243),(-121.9226,37.235)]'),
+('Pine St', '[(-122.303,37.074),(-122.3026,37.084)]'),
+('Pine St', '[(-122.3034,37.063),(-122.3032,37.069)]'),
+('Pine Needle Dr', '[(-122.2127,37.478),(-122.2125,37.473)]'),
+('Pinewood Road', '[(-122.2219,37.424),(-122.2211,37.429)]'),
+('Pinto Ct', '[(-122.0228,37.08),(-122.0224,37.073)]'),
+('Piper St', '[(-122.216,37.39),(-122.2155,37.385)]'),
+('Pippin St', '[(-122.1747,37.344),(-122.1734,37.332)]'),
+('Pizarro Dr', '[(-122.025,37.556),(-122.026,37.544)]'),
+('Placer Way', '[(-121.9789,37.415),(-121.9769,37.407)]'),
+('Plata Way', '[(-121.9402,37.066),(-121.9394,37.069)]'),
+('Pleasant Way', '[(-122.1653,37.311),(-122.1646,37.302)]'),
+('Pleasant Hill Road', '[(-121.9264,37.854),(-121.9268,37.86)]'),
+('Pleasant Valley Ct', '[(-122.2455,37.298),(-122.2439,37.305)]'),
+('Pleasanton Ave', '[(-121.8782,37.636),(-121.8784,37.63)]'),
+('Pleasanton Ave', '[(-121.8819,37.586),(-121.882761,37.5753)]'),
+('Pleasanton Canal', '[(-121.886052,37.82228),(-121.8833,37.835)]'),
+('Pleasanton Sunol Road', '[(-121.8765,37.987),(-121.8775,37.982)]'),
+('Pleasanton Sunol Road', '[(-121.8851,37.39),(-121.8858,37.387)]'),
+('Pleitner Ave', '[(-122.2098,37.946),(-122.2094,37.953)]'),
+('Plomosa Road', '[(-121.9106,37.703),(-121.9102,37.696)]'),
+('Plummer Creek', '[(-122.0778,37.095),(-122.0852,37.069)]'),
+('Plymouth Ave', '[(-121.9369,37.422),(-121.9378,37.424)]'),
+('Plymouth Dr', '[(-122.0798,37.132),(-122.0802,37.11)]'),
+('Plymouth St', '[(-122.1643,37.425),(-122.1641,37.418)]'),
+('Plymouth St', '[(-122.1661,37.454),(-122.1652,37.44)]'),
+('Plymouth St', '[(-122.1763,37.593),(-122.1758,37.586)]'),
+('Poda Ct', '[(-121.9321,37.308),(-121.9315,37.312)]'),
+('Poinciana Pl', '[(-121.9946,37.341),(-121.994,37.337)]'),
+('Point Eden Way', '[(-122.1208,37.255),(-122.1262,37.256)]'),
+('Polaris Ave', '[(-122.064185,37.84562),(-122.0647,37.84)]'),
+('Polk Way', '[(-121.745,37.867),(-121.745,37.858)]'),
+('Polvorosa Ct', '[(-122.0178,37.594),(-122.0174,37.591)]'),
+('Pomar Vista Ave', '[(-122.0989,37.958),(-122.0973,37.969)]'),
+('Pomona Way', '[(-121.743614,37.84357),(-121.7427,37.839)]'),
+('Ponderosa Dr', '[(-121.749629,37.12363),(-121.74967,37.11779)]'),
+('Pontiac St', '[(-122.165,37.365),(-122.1647,37.359),(-122.1643,37.354)]'),
+('Pontiac St', '[(-122.1665,37.383),(-122.166309,37.3779)]'),
+('Poplar Ave', '[(-122.1018,37.704),(-122.098,37.721)]'),
+('Poplar Path', '[(-122.2678,37.968),(-122.2687,37.967)]'),
+('Port Sailwood Dr', '[(-122.0261,37.467),(-122.0265,37.463)]'),
+('Portage Road', '[(-121.9241,37.092),(-121.9257,37.109)]'),
+('Portal Ave', '[(-122.2281,37.148),(-122.2282,37.157)]'),
+('Portland Ave', '[(-122.2861,37.949),(-122.2858,37.949)]'),
+('Portland Ave', '[(-122.2945,37.945),(-122.2937,37.946)]'),
+('Portofino Cir', '[(-122.123984,37.08583),(-122.124375,37.08809)]'),
+('Portola Ave', '[(-121.7822,37.948),(-121.7806,37.94),(-121.7794,37.935)]'),
+('Portola Ave', '[(-122.2723,37.696),(-122.2713,37.691)]'),
+('Portola Dr', '[(-122.019284,37.56839),(-122.0199,37.563)]'),
+('Portola Dr', '[(-122.1482,37.024),(-122.1488,37.021)]'),
+('Portola Dr', '[(-122.1505,37.019),(-122.1516,37.016)]'),
+('Portsmouth Ave', '[(-122.1023,37.262),(-122.1013,37.254)]'),
+('Portsmouth Ave', '[(-122.1064,37.315),(-122.1064,37.308)]'),
+('Portwood Ave', '[(-122.2322,37.76),(-122.2317,37.765)]'),
+('Posen Ave', '[(-122.2828,37.848),(-122.2822,37.85)]'),
+('Posey Loop', '[(-122.276,37.854),(-122.276,37.859)]'),
+('Potawatami Dr', '[(-121.9238,37.063),(-121.924,37.056)]'),
+('Powell St', '[(-122.2926,37.388),(-122.2937,37.387)]'),
+('Powell St', '[(-122.3101,37.375),(-122.3108,37.375)]'),
+('Prairie Dr', '[(-121.9124,37.667),(-121.9123,37.664)]'),
+('Prarie Dr', '[(-121.9102,37.652),(-121.910115,37.65226)]'),
+('Preda St', '[(-122.1686,37.244),(-122.1691,37.255)]'),
+('Presley Way', '[(-122.2461,37.462),(-122.2462,37.465)]'),
+('Preston Ct', '[(-121.733536,37.01447),(-121.733204,37.00955)]'),
+('Preston Ct', '[(-121.9666,37.659),(-121.9652,37.668)]'),
+('Prestwick Ave', '[(-122.0369,37.208),(-122.0363,37.202)]'),
+('Prince Dr', '[(-121.9164,37.155),(-121.9185,37.145)]'),
+('Prince St', '[(-122.2582,37.541),(-122.2568,37.543)]'),
+('Prince St', '[(-122.2723,37.524),(-122.2713,37.525)]'),
+('Prince St', '[(-122.2802,37.512),(-122.2794,37.514)]'),
+('Princeton Ter', '[(-121.977476,37.61102),(-121.977871,37.61066)]'),
+('Princeton Way', '[(-121.75,37.814),(-121.7472,37.814)]'),
+('Proctor Ave', '[(-122.2222,37.364),(-122.2217,37.36)]'),
+('Proctor Ave', '[(-122.2267,37.406),(-122.2251,37.386)]'),
+('Proctor Road', '[(-122.0671,37.192),(-122.067,37.2)]'),
+('Proctor Road', '[(-122.0761,37.177),(-122.073739,37.1724)]'),
+('Prospect St', '[(-122.2492,37.699),(-122.249,37.695)]'),
+('Prosperity Way', '[(-122.1033,37.031),(-122.1044,37.042)]'),
+('Pueblo Dr', '[(-122.1748,37.269),(-122.1743,37.269)]'),
+('Pueblo Creek', '[(-122.0958,37.203),(-122.0965,37.205)]'),
+('Pueblo Serena', '[(-122.0958,37.222),(-122.0958,37.203)]'),
+('Pueblo Spring', '[(-122.0964,37.238),(-122.0965,37.222)]'),
+('Puerto Vallarta', '[(-121.8719,37.54),(-121.8728,37.528)]'),
+('Pulaski Dr', '[(-122.0262,37.107),(-122.0254,37.1)]'),
+('Pulsar Ave', '[(-121.7892,37.58955),(-121.7892,37.60011)]'),
+('Purcell Pl', '[(-122.0249,37.718),(-122.0224,37.699)]'),
+('Purdue St', '[(-122.1555,37.95),(-122.1565,37.949)]'),
+('Pyramid St', '[(-121.768592,37.56164),(-121.768329,37.56198)]'),
+('Quail Run Road', '[(-122.0448,37.808),(-122.0439,37.805)]'),
+('Quebec Ave', '[(-122.1528,37.786),(-122.1535,37.785)]'),
+('Quebec Common', '[(-122.051368,37.60756),(-122.05282,37.60102)]'),
+('Queen Anne Dr', '[(-122.0751,37.883),(-122.077,37.865)]'),
+('Quercus Ct', '[(-122.0267,37.59),(-122.0269,37.572)]'),
+('Quigley Pl', '[(-122.1962,37.867),(-122.1957,37.861)]'),
+('Quinn Lane', '[(-122.066405,37.74794),(-122.066039,37.73557)]'),
+('Quintana Ct', '[(-121.9516,37.464),(-121.9522,37.463)]'),
+('Quintana Way', '[(-121.9504,37.49),(-121.9508,37.489)]'),
+('Rachelle St', '[(-121.7257,37.945),(-121.7257,37.932)]'),
+('Racine St', '[(-122.2622,37.494),(-122.2624,37.501)]'),
+('Racoon Hallow Ct', '[(-121.914577,37.63603),(-121.913452,37.63738)]'),
+('Radele Ct', '[(-122.0101,37.363),(-122.0105,37.357)]'),
+('Ragland St', '[(-122.109,37.877),(-122.1089,37.872)]'),
+('Railroad Ave', '[(-121.7661,37.841),(-121.7654,37.842)]'),
+('Railroad Ave', '[(-121.771533,37.82472),(-121.771,37.826)]'),
+('Railroad Ave', '[(-121.779215,37.79798),(-121.779265,37.79635)]'),
+('Railroad Ave', '[(-121.891,37.94),(-121.8924,37.941)]'),
+('Railroad Ave', '[(-122.0245,37.013),(-122.0234,37.003),(-122.0223,37.993)]'),
+('Railroad Ave', '[(-122.1835,37.394),(-122.1828,37.388)]'),
+('Rainier Ave', '[(-121.8009,37.803),(-121.7999,37.804)]'),
+('Ralston Com', '[(-121.9775,37.428),(-121.9771,37.432)]'),
+('Ramona Ave', '[(-122.2391,37.291),(-122.2373,37.293)]'),
+('Ramona Ave', '[(-122.244153,37.31499),(-122.243523,37.31109)]'),
+('Rancho Arroyo Pkwy', '[(-121.9932,37.785),(-121.9929,37.774),(-121.9926,37.769)]'),
+('Rancho Higuera Road', '[(-121.9112,37.96),(-121.9105,37.959)]'),
+('Randall Ct', '[(-122.0749,37.976),(-122.0756,37.968)]'),
+('Randicik Ct', '[(-121.863424,37.95818),(-121.863445,37.9654)]'),
+('Randy St', '[(-122.1517,37.809),(-122.1523,37.807)]'),
+('Ranker Pl', '[(-122.0725,37.4),(-122.0737,37.395)]'),
+('Ranspot Dr', '[(-122.0972,37.999),(-122.0959,37)]'),
+('Raymond Road', '[(-121.7462,37.306),(-121.7326,37.305)]'),
+('Reading Ave', '[(-122.0779,37.874),(-122.0735,37.875)]'),
+('Redbud Lane', '[(-122.0969,37.627),(-122.0978,37.627)]'),
+('Redding Pl', '[(-122.1919,37.843),(-122.1921,37.841)]'),
+('Redding St', '[(-122.191432,37.84242),(-122.1911,37.842)]'),
+('Redding St', '[(-122.1943,37.858),(-122.1934,37.854)]'),
+('Redding St', '[(-122.1978,37.901),(-122.1975,37.895)]'),
+('Redwood Ct', '[(-121.9142,37.69),(-121.9144,37.696)]'),
+('Redwood Road', '[(-122.0726,37.155),(-122.0726,37.139)]'),
+('Redwood Road', '[(-122.0726,37.18079),(-122.0726,37.179)]'),
+('Redwood Road', '[(-122.0726,37.909),(-122.0727,37.906)]'),
+('Redwood Road', '[(-122.0727,37.955),(-122.0727,37.948)]'),
+('Redwood Road', '[(-122.0736,37.393),(-122.075736,37.37634)]'),
+('Redwood Road', '[(-122.1493,37.98),(-122.1437,37.001)]'),
+('Redwood Road', '[(-122.174191,37.96191),(-122.174,37.966)]'),
+('Redwood Road', '[(-122.1819,37.978),(-122.1811,37.968)]'),
+('Redwood Road', '[(-122.1882,37.986),(-122.1877,37.986)]'),
+('Redwood Creek', '[(-122.1366,37.968),(-122.1302,37.918)]'),
+('Reed Ave', '[(-121.7581,37.516),(-121.7559,37.516)]'),
+('Regailia Ave', '[(-121.86701,37.62944),(-121.867052,37.62182)]'),
+('Regal Ave', '[(-122.0839,37.468),(-122.0857,37.449)]'),
+('Regents Blvd', '[(-122.0662,37.779),(-122.066625,37.77216)]'),
+('Regents Blvd', '[(-122.0673,37.759),(-122.0677,37.751)]'),
+('Regents Blvd', '[(-122.0681,37.74),(-122.068,37.73)]'),
+('Regents Blvd', '[(-122.068594,37.80778),(-122.0681,37.805)]'),
+('Regents Blvd', '[(-122.077,37.865),(-122.0761,37.862)]'),
+('Regional St', '[(-121.9328,37.029),(-121.9347,37.072)]'),
+('Reinhardt Dr', '[(-122.1831,37.922),(-122.1828,37.918)]'),
+('Renwick St', '[(-122.1989,37.797),(-122.1982,37.802)]'),
+('Republic Ave', '[(-122.1688,37.046),(-122.1721,37.032)]'),
+('Requa Road', '[(-122.2323,37.199),(-122.2293,37.21)]'),
+('Revere Ave', '[(-122.03,37.129),(-122.0287,37.129)]'),
+('Revere Ave', '[(-122.1347,37.359),(-122.134,37.362)]'),
+('Reyes Dr', '[(-122.0791,37.873),(-122.0787,37.873)]'),
+('Reynolds Dr', '[(-122.0036,37.671),(-122.002954,37.66809)]'),
+('Rhine Way', '[(-121.84112,37.58518),(-121.840944,37.56363)]'),
+('Rhododendron Dr', '[(-121.74419,37.09645),(-121.7445,37.105)]'),
+('Ribera Ct', '[(-122.0292,37.644),(-122.0286,37.641)]'),
+('Ricardo Ave', '[(-122.1176,37.761),(-122.1148,37.745)]'),
+('Rich Ave', '[(-122.0351,37.309),(-122.0354,37.303)]'),
+('Richardson Way', '[(-122.2263,37.224),(-122.225,37.22)]'),
+('Richmond Ave', '[(-121.9969,37.452),(-121.9975,37.442)]'),
+('Richmond Blvd', '[(-122.2584,37.211),(-122.2573,37.218)]'),
+('Richmond Blvd', '[(-122.2592,37.195),(-122.2587,37.201)]'),
+('Ridge Trl', '[(-121.8615,37.438),(-121.859211,37.42899)]'),
+('Ridge Top Road', '[(-122.1538,37.164),(-122.1566,37.179)]'),
+('Ridgeview Ter', '[(-121.970517,37.63559),(-121.970862,37.63332)]'),
+('Ridgeway Ave', '[(-122.2513,37.286),(-122.2518,37.292)]'),
+('Ridgeway Ave', '[(-122.2539,37.299),(-122.2548,37.302)]'),
+('Ridgewood Dr', '[(-122.051305,37.59386),(-122.053772,37.58263)]'),
+('Ridley Dr', '[(-121.9794,37.65),(-121.979,37.644)]'),
+('Riley Dr', '[(-122.2999,37.858),(-122.299,37.86)]'),
+('Rincon Ave', '[(-121.7824,37.828),(-121.7824,37.837)]'),
+('Rispen Dr', '[(-122.2342,37.621),(-122.2326,37.634)]'),
+('Riverdale Ct', '[(-121.9198,37.891),(-121.9201,37.893)]'),
+('Riverside Ave', '[(-121.9758,37.74),(-121.9764,37.725)]'),
+('Riviera Dr', '[(-122.0003,37.954),(-122.0003,37.957)]'),
+('Riviera Dr', '[(-122.0003,37.96),(-122.0003,37.968)]'),
+('Roberts Ave', '[(-121.9554,37.299),(-121.955,37.282)]'),
+('Robertson Ave', '[(-122.0164,37.33),(-122.0173,37.318)]'),
+('Robertson Ave', '[(-122.021,37.275),(-122.0213,37.27)]'),
+('Robin St', '[(-121.9701,37.297),(-121.9698,37.287)]'),
+('Robinson Dr', '[(-122.1825,37.096),(-122.1807,37.054)]'),
+('Robledo Dr', '[(-122.1734,37.304),(-122.1706,37.281)]'),
+('Roca Dr', '[(-122.0335,37.609),(-122.0314,37.599)]'),
+('Rochelle Ave', '[(-122.0603,37.347),(-122.0594,37.329)]'),
+('Rockford Road', '[(-122.0848,37.819),(-122.0842,37.814)]'),
+('Rockingham Dr', '[(-121.8681,37.948),(-121.8689,37.944)]'),
+('Rocklin Dr', '[(-122.070801,37.71701),(-122.0712,37.713)]'),
+('Rocklin Dr', '[(-122.0719,37.698),(-122.0722,37.689)]'),
+('Rockridge Blvd', '[(-122.242,37.457),(-122.2416,37.464)]'),
+('Rockridge Blvd', '[(-122.2424,37.454),(-122.2417,37.453)]'),
+('Rockrose Dr', '[(-122.0105,37.248),(-122.0114,37.252)]'),
+('Rockwood Dr', '[(-122.0128,37.492),(-122.0109,37.482)]'),
+('Rodney Com', '[(-121.9562,37.385),(-121.9555,37.382)]'),
+('Rogers Ave', '[(-122.0044,37.43),(-122.0061,37.409)]'),
+('Rolling Hills Dr', '[(-121.948386,37.07126),(-121.947082,37.07103)]'),
+('Rolling Hills Dr', '[(-121.950806,37.10304),(-121.950378,37.11376)]'),
+('Rollinghills Cir', '[(-121.945273,37.06404),(-121.945249,37.0671)]'),
+('Romeo Pl', '[(-122.0562,37.692),(-122.0571,37.694)]'),
+('Romey Lane', '[(-122.0603,37.825),(-122.0587,37.825)]'),
+('Ronald Ct', '[(-121.9528,37.259),(-121.9537,37.259)]'),
+('Ronda St', '[(-122.125,37.865),(-122.1251,37.856)]'),
+('Roosevelt Pl', '[(-121.9918,37.267),(-121.9923,37.263)]'),
+('Rosario Ct', '[(-122.110662,37.79847),(-122.109931,37.78596)]'),
+('Rose Ave', '[(-121.8792,37.616),(-121.8838,37.656)]'),
+('Rose Ave', '[(-122.244329,37.28237),(-122.2441,37.284),(-122.2438,37.287)]'),
+('Rose Ave', '[(-122.2476,37.256),(-122.2469,37.268)]'),
+('Rose Dr', '[(-122.1451,37.142),(-122.1445,37.138)]'),
+('Rose St', '[(-121.757,37.84),(-121.757,37.831)]'),
+('Rose St', '[(-122.2586,37.834),(-122.2575,37.836)]'),
+('Rose St', '[(-122.2644,37.83),(-122.263462,37.83335)]'),
+('Rose St', '[(-122.2696,37.82),(-122.2689,37.82)]'),
+('Rose St', '[(-122.2843,37.782),(-122.2829,37.787)]'),
+('Rose St', '[(-122.2882,37.769),(-122.287,37.771)]'),
+('Rosedale Ct', '[(-121.9232,37.9),(-121.924,37.897)]'),
+('Rosegate Ter', '[(-121.969628,37.63263),(-121.970152,37.638)]'),
+('Roselli Dr', '[(-121.7848,37.636),(-121.7848,37.628)]'),
+('Rosemary Ct', '[(-121.9314,37.088),(-121.9314,37.085)]'),
+('Rosewood Ct', '[(-122.0622,37.37),(-122.0618,37.372)]'),
+('Rosewood Common', '[(-121.964615,37.21789),(-121.964292,37.213)]'),
+('Ross Cir', '[(-122.2466,37.502),(-122.2474,37.514)]'),
+('Ross Gate Way', '[(-121.8794,37.845),(-121.8818,37.836)]'),
+('Rothchild Ct', '[(-121.950257,37.08452),(-121.951086,37.08115)]'),
+('Roundhill Dr', '[(-122.0376,37.542),(-122.0377,37.536)]'),
+('Rousillon Ave', '[(-122.046,37.672),(-122.0451,37.674)]'),
+('Roxanne St', '[(-121.7288,37.853),(-121.7287,37.849)]'),
+('Roxbury Ave', '[(-122.1354,37.339),(-122.1346,37.336)]'),
+('Roxbury Lane', '[(-122.0333,37.615),(-122.0329,37.618)]'),
+('Roxbury Lane', '[(-122.0359,37.623),(-122.0356,37.619)]'),
+('Royal Ann Dr', '[(-122.0267,37.889),(-122.0268,37.88)]'),
+('Royal Ann Dr', '[(-122.0273,37.871),(-122.0278,37.862)]'),
+('Royal Ann St', '[(-122.1696,37.367),(-122.1691,37.362)]'),
+('Royal Ann St', '[(-122.1705,37.38),(-122.1702,37.376)]'),
+('Royal Palm Dr', '[(-121.9945,37.315),(-121.9922,37.303)]'),
+('Ruby Road', '[(-121.8029,37.688),(-121.8023,37.68)]'),
+('Ruby St', '[(-122.0765,37.815),(-122.0751,37.802)]'),
+('Rudsdale St', '[(-122.1855,37.552),(-122.1849,37.547)]'),
+('Rugby Ave', '[(-122.274,37.045),(-122.2738,37.037)]'),
+('Running Hills Ave', '[(-121.7262,37.22),(-121.7238,37.213)]'),
+('Ruschin Dr', '[(-122.0397,37.459),(-122.0393,37.465)]'),
+('Russell Ave', '[(-122.1694,37.819),(-122.1687,37.845)]'),
+('Russell St', '[(-122.2661,37.569),(-122.2652,37.571)]'),
+('Russell St', '[(-122.2695,37.564),(-122.2684,37.566)]'),
+('Russell Way', '[(-122.08,37.771),(-122.0781,37.783)]'),
+('Russet St', '[(-122.1758,37.361),(-122.1753,37.355)]'),
+('Rutgers Way', '[(-121.7421,37.744),(-121.742,37.739)]'),
+('Ruth Ct', '[(-122.1301,37.004),(-122.1288,37.002)]'),
+('Ruth Way', '[(-121.7928,37.766),(-121.792,37.767)]'),
+('Ruth Glen', '[(-121.9121,37.281),(-121.9124,37.278)]'),
+('Ruus Road', '[(-122.0667,37.296),(-122.066,37.28)]'),
+('Sabercat Road', '[(-121.9396,37.176),(-121.9388,37.165),(-121.937,37.159)]'),
+('Sabercat Road', '[(-121.9453,37.266),(-121.944385,37.25156),(-121.9408,37.195)]'),
+('Sable Pointe', '[(-122.2393,37.439),(-122.24,37.434)]'),
+('Sable Pointe', '[(-122.241,37.424),(-122.2416,37.418)]'),
+('Sacramento Ave', '[(-121.9861,37.44),(-121.9865,37.436)]'),
+('Sacramento St', '[(-122.277606,37.50815),(-122.277616,37.50591)]'),
+('Sacramento St', '[(-122.2799,37.606),(-122.2797,37.597)]'),
+('Sacramento St', '[(-122.2813,37.703),(-122.2811,37.695)]'),
+('Saddle Brook Dr', '[(-122.1478,37.909),(-122.1454,37.904),(-122.1451,37.888)]'),
+('Saginaw Ct', '[(-121.8803,37.898),(-121.8806,37.901)]'),
+('Saguare Com', '[(-121.9049,37.022),(-121.9043,37.017)]'),
+('Sailway Dr', '[(-121.9673,37.495),(-121.9686,37.502)]'),
+('Salem St', '[(-122.2794,37.361),(-122.2796,37.368)]'),
+('Salem St', '[(-122.2832,37.474),(-122.2835,37.479)]'),
+('Salinas Pl', '[(-122.041,37.689),(-122.0404,37.686)]'),
+('Salisbury St', '[(-122.2162,37.863),(-122.2146,37.848)]'),
+('Salton Sea Lane', '[(-122.0597,37.88),(-122.0591,37.869)]'),
+('San Andreas Dr', '[(-122.0592,37.957),(-122.0585,37.954)]'),
+('San Andreas Dr', '[(-122.0609,37.9),(-122.0614,37.895)]'),
+('San Andreas Dr', '[(-122.0621,37.973),(-122.0614,37.972)]'),
+('San Andreas Dr', '[(-122.0635,37.878),(-122.0648,37.891)]'),
+('San Andreas Dr', '[(-122.0658,37.907),(-122.0661,37.914)]'),
+('San Andreas Dr', '[(-122.0668,37.926),(-122.0672,37.931)]'),
+('San Antonio Ave', '[(-122.2585,37.679),(-122.2566,37.672)]'),
+('San Antonio St', '[(-122.0472,37.155),(-122.0477,37.108)]'),
+('San Antonio Way', '[(-122.2323,37.891),(-122.2314,37.886)]'),
+('San Antonio Creek', '[(-121.8722,37.759),(-121.8641,37.771)]'),
+('San Antonio Reservoir', '[(-121.8487,37.728),(-121.8359,37.67)]'),
+('San Bernardino Way', '[(-122.0621,37.936),(-122.0628,37.933)]'),
+('San Carlos Ave', '[(-122.0912,37.941),(-122.0899,37.94)]'),
+('San Carlos Ave', '[(-122.2886,37.931),(-122.2885,37.91)]'),
+('San Carlos Walk', '[(-122.2087,37.795),(-122.208,37.789)]'),
+('San Clemente St', '[(-122.0511,37.188),(-122.051,37.177)]'),
+('San Franciscan Dr', '[(-122.0589,37.24),(-122.0582,37.246)]'),
+('San Francisco Bay', '[(-122.108,37.032),(-122.1048,37.001)]'),
+('San Francisco Bay', '[(-122.3115,37.814),(-122.3096,37.777)]'),
+('San Francisco Bay', '[(-122.3176,37.669),(-122.3108,37.652)]'),
+('San Jose Ave', '[(-122.2423,37.594),(-122.2409,37.586)]'),
+('San Jose Ave', '[(-122.2455,37.609),(-122.2445,37.605)]'),
+('San Jose Ave', '[(-122.2543,37.65),(-122.251,37.635)]'),
+('San Jose Ct', '[(-122.0563,37.922),(-122.055864,37.91921)]'),
+('San Juan St', '[(-122.2158,37.803),(-122.2149,37.795)]'),
+('San Leandro Blvd', '[(-122.1557,37.174),(-122.1545,37.168)]'),
+('San Leandro St', '[(-122.1703,37.323),(-122.1689,37.312)]'),
+('San Leandro St', '[(-122.1717,37.335),(-122.1709,37.329)]'),
+('San Leandro St', '[(-122.2195,37.721),(-122.2186,37.716)]'),
+('San Leandro St', '[(-122.2251,37.748),(-122.2242,37.743)]'),
+('San Leandro Bay', '[(-122.2241,37.553),(-122.2253,37.542)]'),
+('San Leandro Creek', '[(-122.154489,37.27978),(-122.155,37.281)]'),
+('San Leandro Creek', '[(-122.175792,37.24864),(-122.1807,37.247)]'),
+('San Leandro Creek Canal', '[(-122.2081,37.409),(-122.2076,37.401)]'),
+('San Lorenzo Ave', '[(-122.2861,37.93),(-122.2857,37.929)]'),
+('San Lorenzo Creek', '[(-122.0544,37.907),(-122.0547,37.908)]'),
+('San Lorenzo Creek', '[(-122.063257,37.85966),(-122.064271,37.85339)]'),
+('San Lorenzo Creek', '[(-122.0741,37.799),(-122.0757,37.789)]'),
+('San Lorenzo Creek', '[(-122.117293,37.85868),(-122.120139,37.85739)]'),
+('San Lorenzo Creek', '[(-122.124957,37.853),(-122.1271,37.849)]'),
+('San Lorenzo Creek', '[(-122.1539,37.747),(-122.1616,37.703)]'),
+('San Luces Way', '[(-122.0672,37.963),(-122.0695,37.954)]'),
+('San Luis Ct', '[(-121.8768,37.483),(-121.8766,37.474)]'),
+('San Luis Ct', '[(-122.065,37.975),(-122.0657,37.973)]'),
+('San Luis Road', '[(-122.271,37.959),(-122.2701,37.933)]'),
+('San Marco Way', '[(-122.0666,37.95),(-122.0687,37.942)]'),
+('San Mateo Road', '[(-122.2724,37.925),(-122.2728,37.928)]'),
+('San Mateo Way', '[(-122.0609,37.926),(-122.061842,37.92391)]'),
+('San Miguel Ave', '[(-122.0793,37.052),(-122.079224,37.0254)]'),
+('San Miguel Ave', '[(-122.0801,37.927),(-122.08,37.911)]'),
+('San Moreno Ct', '[(-121.954,37.576),(-121.9532,37.558)]'),
+('San Pablo Ave', '[(-122.2718,37.084),(-122.2721,37.093)]'),
+('San Pablo Ave', '[(-122.2797,37.326),(-122.2798,37.332)]'),
+('San Pablo Ave', '[(-122.2822,37.405),(-122.2824,37.411)]'),
+('San Pablo Ave', '[(-122.2834,37.442),(-122.2838,37.45)]'),
+('San Pablo Ave', '[(-122.2859,37.518),(-122.2857,37.515)]'),
+('San Pablo Ave', '[(-122.2864,37.537),(-122.2862,37.532)]'),
+('San Pablo Ave', '[(-122.2922,37.725),(-122.2922,37.716),(-122.2918,37.704)]'),
+('San Pablo Ave', '[(-122.2961,37.84),(-122.2959,37.832)]'),
+('San Rafael St', '[(-122.1398,37.225),(-122.1395,37.219)]'),
+('San Ramon Road', '[(-121.937288,37.09164),(-121.937307,37.0922)]'),
+('San Sabana Road', '[(-121.9402,37.066),(-121.9402,37.095)]'),
+('Sandalwood St', '[(-122.0347,37.493),(-122.0327,37.483)]'),
+('Sandburg Way', '[(-122.0625,37.226),(-122.0625,37.203)]'),
+('Sandelin Ave', '[(-122.1351,37.294),(-122.1343,37.298)]'),
+('Sandringham Road', '[(-122.2139,37.183),(-122.2142,37.179)]'),
+('Sandringham Road', '[(-122.2155,37.175),(-122.2163,37.165)]'),
+('Sandy Road', '[(-122.0643,37.089),(-122.0645,37.086)]'),
+('Sandy Hook Dr', '[(-122.0615,37.22),(-122.062,37.221)]'),
+('Sanford St', '[(-122.1546,37.737),(-122.1543,37.728)]'),
+('Sangamore St', '[(-122.1069,37.471),(-122.1076,37.468)]'),
+('Santa Barbara Road', '[(-122.2679,37.928),(-122.2666,37.92)]'),
+('Santa Clara Ave', '[(-122.2509,37.695),(-122.2479,37.682)]'),
+('Santa Clara Ave', '[(-122.254714,37.71317),(-122.254,37.71)]'),
+('Santa Clara Ave', '[(-122.2551,37.211),(-122.254,37.205)]'),
+('Santa Clara Ave', '[(-122.2787,37.736),(-122.2761,37.736)]'),
+('Santa Clara Ave', '[(-122.2791,37.994),(-122.2798,37.989)]'),
+('Santa Clara St', '[(-122.0901,37.496),(-122.0885,37.485)]'),
+('Santa Clara St', '[(-122.0923,37.51),(-122.0919,37.504)]'),
+('Santa Clara St', '[(-122.1009,37.618),(-122.1006,37.613)]'),
+('Santa Clara St', '[(-122.1012,37.667),(-122.1012,37.66389),(-122.1012,37.65718)]'),
+('Santa Clara Way', '[(-121.7539,37.854),(-121.7508,37.856),(-121.75,37.856)]'),
+('Santa Fe Ave', '[(-122.2899,37.817),(-122.2899,37.815)]'),
+('Santa Maria Ave', '[(-122.0773,37),(-122.0773,37.98)]'),
+('Santa Maria Dr', '[(-122.0633,37.965),(-122.0624,37.961)]'),
+('Santa Paula', '[(-122.1607,37.848),(-122.1596,37.834)]'),
+('Santa Ray Ave', '[(-122.2393,37.122),(-122.2381,37.113)]'),
+('Santa Rita Road', '[(-121.872608,37.75282),(-121.8731,37.766)]'),
+('Santa Rita Road', '[(-121.877461,37.9142),(-121.8775,37.922)]'),
+('Santa Rita St', '[(-122.2065,37.804),(-122.2058,37.796)]'),
+('Santa Rita St', '[(-122.2129,37.832),(-122.2104,37.839)]'),
+('Santa Rosa St', '[(-122.1506,37.247),(-122.1502,37.238)]'),
+('Santa Rosa St', '[(-122.1513,37.265),(-122.1509,37.256)]'),
+('Santa Teresa', '[(-122.1576,37.826),(-122.1565,37.812),(-122.1553,37.797)]'),
+('Santa Teresa Com', '[(-121.9505,37.564),(-121.9496,37.559)]'),
+('Santee Road', '[(-122.0371,37.691),(-122.0376,37.685)]'),
+('Santiago Road', '[(-122.176,37.962),(-122.1756,37.956)]'),
+('Santo Ct', '[(-121.946172,37.10869),(-121.947136,37.10367)]'),
+('Saratoga St', '[(-122.1024,37.997),(-122.1019,37.997)]'),
+('Sarazen Ave', '[(-122.1539,37.58),(-122.1532,37.585)]'),
+('Saroni Dr', '[(-122.1954,37.345),(-122.1944,37.347)]'),
+('Saturn Dr', '[(-122.1283,37.145),(-122.1238,37.117)]'),
+('Sausal Creek', '[(-122.2126,37.122),(-122.213944,37.10691)]'),
+('Sausal Creek', '[(-122.215521,37.03532),(-122.216544,37.01827)]'),
+('Sausal Creek', '[(-122.2175,37.985),(-122.218,37.982)]'),
+('Sausal Creek', '[(-122.218,37.982),(-122.218834,37.9583)]'),
+('Sausal Creek', '[(-122.219108,37.9487),(-122.2193,37.942),(-122.219513,37.93313)]'),
+('Sausal Creek', '[(-122.2217,37.893),(-122.2221,37.884)]'),
+('Sausal Creek', '[(-122.2228,37.862),(-122.2232,37.856)]'),
+('Scarborough Dr', '[(-122.0362,37.568),(-122.0362,37.556)]'),
+('Scarborough Dr', '[(-122.1993,37.214),(-122.1999,37.24),(-122.1994,37.241)]'),
+('Scenic Ave', '[(-121.7262,37.171),(-121.7232,37.171)]'),
+('Scenic Ave', '[(-121.7314,37.171),(-121.7305,37.17)]'),
+('Scenic Ave', '[(-121.7414,37.166),(-121.73802,37.16978)]'),
+('Scenic Ave', '[(-122.2282,37.278),(-122.2284,37.296)]'),
+('Scenic Ave', '[(-122.2619,37.762),(-122.2617,37.749)]'),
+('Scenicview Dr', '[(-122.1354,37.26),(-122.1325,37.252)]'),
+('School St', '[(-122.1378,37.209),(-122.1369,37.199),(-122.1364,37.197)]'),
+('School St', '[(-122.2116,37.945),(-122.2103,37.94)]'),
+('School Way', '[(-122.0838,37.18),(-122.0833,37.177)]'),
+('Schooner Hill', '[(-122.2263,37.56),(-122.2269,37.564)]'),
+('Schuster Ave', '[(-122.0854,37.081),(-122.0854,37.074)]'),
+('Scott Pl', '[(-122.0802,37.38),(-122.0815,37.381)]'),
+('Scott Creek', '[(-121.8694,37.814),(-121.8694,37.803)]'),
+('Scott Creek Road', '[(-121.8999,37.678),(-121.8975,37.685)]'),
+('Scott Creek Road', '[(-121.9047,37.667),(-121.9034,37.67)]'),
+('Scott Creek Road', '[(-121.9098,37.651),(-121.9086,37.655)]'),
+('Sea Bridge Way', '[(-122.2364,37.426),(-122.2359,37.417)]'),
+('Sea View Pkwy', '[(-122.242913,37.47248),(-122.2421,37.472),(-122.2411,37.471)]'),
+('Sea View Pkwy', '[(-122.2499,37.466),(-122.2496,37.468)]'),
+('Sea View Pkwy', '[(-122.253,37.455),(-122.2519,37.457)]'),
+('Sea View Pkwy', '[(-122.2547,37.434),(-122.255,37.439)]'),
+('Seal Rock Ter', '[(-122.033374,37.69186),(-122.0335,37.692),(-122.0338,37.694)]'),
+('Seaver St', '[(-122.1016,37.427),(-122.1016,37.419)]'),
+('Seaview Ave', '[(-122.0623,37.113),(-122.0599,37.111)]'),
+('Seawall Dr', '[(-122.316154,37.63126),(-122.315489,37.60045)]'),
+('Segovia Pl', '[(-121.9478,37.596),(-121.9489,37.585)]'),
+('Selkirk St', '[(-121.9798,37.336),(-121.9796,37.331)]'),
+('Seminary Ave', '[(-122.1772,37.796),(-122.1756,37.798)]'),
+('Seminary Ave', '[(-122.1814,37.772),(-122.1807,37.778)]'),
+('Seneca St', '[(-122.03,37.122),(-122.03,37.115)]'),
+('Seneca Park Ave', '[(-121.9649,37.17),(-121.9653,37.167)]'),
+('Senior Ave', '[(-122.2487,37.826),(-122.2473,37.827)]'),
+('Sequoia Road', '[(-122.0013,37.617),(-122.001192,37.61346)]'),
+('Sequoia Ter', '[(-121.997978,37.6571),(-121.997403,37.66696)]'),
+('Seven Hills Road', '[(-122.0876,37.1),(-122.086344,37.1012),(-122.0855,37.102)]'),
+('Severn Dr', '[(-122.0359,37.584),(-122.0368,37.571)]'),
+('Severn Pl', '[(-122.0363,37.586),(-122.0367,37.581)]'),
+('Sevilla Road', '[(-122.0829,37.809),(-122.0831,37.81)]'),
+('Seville Pl', '[(-121.9514,37.522),(-121.9522,37.518)]'),
+('Sextus Road', '[(-122.1938,37.33),(-122.1896,37.327)]'),
+('Seymour Pl', '[(-122.0357,37.84),(-122.0367,37.837)]'),
+('Shadow Ridge Dr', '[(-122.041,37.144),(-122.0411,37.162)]'),
+('Shady Creek Road', '[(-121.913106,37.24701),(-121.914087,37.24475)]'),
+('Shafer Creek', '[(-121.681036,37.12545),(-121.694801,37.25112)]'),
+('Shafter Ave', '[(-122.2539,37.418),(-122.2527,37.434)]'),
+('Shafter Ave', '[(-122.2569,37.383),(-122.2556,37.399)]'),
+('Shafter Ave', '[(-122.2586,37.313),(-122.2583,37.323)]'),
+('Shamrock Pl', '[(-121.929,37.24),(-121.9295,37.247)]'),
+('Shannon Ave', '[(-121.94218,37.14137),(-121.9418,37.142)]'),
+('Shasta St', '[(-121.802842,37.889),(-121.802801,37.8826)]'),
+('Shattuck Ave', '[(-122.053676,37.61223),(-122.052619,37.61591)]'),
+('Shattuck Ave', '[(-122.2633,37.339),(-122.2634,37.347)]'),
+('Shattuck Ave', '[(-122.2648,37.468),(-122.2648,37.474)]'),
+('Shattuck Ave', '[(-122.2675,37.712),(-122.2674,37.704)]'),
+('Shattuck Ave', '[(-122.2683,37.776),(-122.2683,37.766)]'),
+('Shattuck Ave', '[(-122.2686,37.904),(-122.2686,37.897)]'),
+('Shaw St', '[(-122.1518,37.459),(-122.1511,37.455)]'),
+('Sheffield Lane', '[(-122.0511,37.006),(-122.051292,37.00178)]'),
+('Sheffield Road', '[(-122.1032,37.097),(-122.1026,37.095)]'),
+('Sheffield Road', '[(-122.241,37.45),(-122.2413,37.446)]'),
+('Sheffield Road', '[(-122.2421,37.44),(-122.2427,37.437)]'),
+('Sheffield Road', '[(-122.2457,37.441),(-122.2448,37.44)]'),
+('Sheila St', '[(-122.0453,37.852),(-122.045,37.847)]'),
+('Sheldon St', '[(-122.146,37.455),(-122.1454,37.451)]'),
+('Shepherd Ave', '[(-122.0707,37.383),(-122.0737,37.367)]'),
+('Shepherd Canyon Road', '[(-122.1845,37.355),(-122.1835,37.355)]'),
+('Shepherd Canyon Road', '[(-122.1988,37.302),(-122.196132,37.31137)]'),
+('Shepherd Canyon Road', '[(-122.2052,37.245),(-122.2027,37.236)]'),
+('Sheridan Road', '[(-121.901114,37.58914),(-121.899,37.574)]'),
+('Sheridan Road', '[(-122.2279,37.425),(-122.2253,37.411),(-122.2223,37.377)]'),
+('Sherman St', '[(-122.2628,37.781),(-122.2627,37.787)]'),
+('Sherman St', '[(-122.263,37.695),(-122.262932,37.70799)]'),
+('Sherman St', '[(-122.2631,37.667),(-122.2631,37.674)]'),
+('Sherry Ct', '[(-121.7642,37.736),(-121.76437,37.73958)]'),
+('Sherwood Lane', '[(-122.2474,37.467),(-122.246514,37.45985)]'),
+('Shiela Way', '[(-122.0734,37.757),(-122.073,37.75)]'),
+('Shinn St', '[(-121.9818,37.64),(-121.9817,37.636)]'),
+('Shirley Ave', '[(-122.1157,37.717),(-122.117,37.712)]'),
+('Shoreline Dr', '[(-122.2638,37.596),(-122.2607,37.584)]'),
+('Shoreline Dr', '[(-122.2657,37.603),(-122.2648,37.6)]'),
+('Shoreline Dr', '[(-122.2714,37.626),(-122.2691,37.616)]'),
+('Shylock Dr', '[(-122.0488,37.748),(-122.0486,37.74)]'),
+('Sidney Ave', '[(-122.1279,37.096),(-122.1274,37.1)]'),
+('Sigourney Elysian Fields Dr', '[(-122.127563,37.66495),(-122.1275,37.649)]'),
+('Sigourney Elysian Fields Dr', '[(-122.128,37.674),(-122.1277,37.667)]'),
+('Silva Lane', '[(-122.237019,37.28132),(-122.235461,37.27888)]'),
+('Silvergate Dr', '[(-121.941,37.097),(-121.9402,37.095)]'),
+('Simm Ct', '[(-121.9757,37.15),(-121.9748,37.153)]'),
+('Simmons St', '[(-122.1881,37.803),(-122.1874,37.805)]'),
+('Sims Dr', '[(-122.21,37.207),(-122.2101,37.237)]'),
+('Simson St', '[(-122.1693,37.737),(-122.1687,37.74)]'),
+('Sinbad Creek', '[(-121.9177,37.343),(-121.9202,37.366)]'),
+('Sinbad Creek', '[(-121.9498,37.613),(-121.9556,37.643)]'),
+('Singing Hills Ave', '[(-121.7262,37.199),(-121.7237,37.206)]'),
+('Singleton Ave', '[(-122.2896,37.87397),(-122.288161,37.87394)]'),
+('Sioux Ct', '[(-121.926147,37.14374),(-121.9248,37.122)]'),
+('Sioux Dr', '[(-121.928,37.142),(-121.926147,37.14374)]'),
+('Siward Dr', '[(-122.043286,37.63282),(-122.043581,37.63639)]'),
+('Siward Dr', '[(-122.044259,37.64617),(-122.044499,37.6493)]'),
+('Siward Dr', '[(-122.046199,37.68158),(-122.046,37.672)]'),
+('Siward Dr', '[(-122.047527,37.71764),(-122.0475,37.716)]'),
+('Skylark Dr', '[(-122.0117,37.839),(-122.011,37.835)]'),
+('Skylark Dr', '[(-122.0192,37.85),(-122.0186,37.848)]'),
+('Skyline Blvd', '[(-122.1409,37.819),(-122.1307,37.73)]'),
+('Skyline Blvd', '[(-122.144,37.851),(-122.1409,37.829)]'),
+('Skyline Blvd', '[(-122.1701,37.988),(-122.167,37.982)]'),
+('Skyline Blvd', '[(-122.1738,37.01),(-122.1714,37.996)]'),
+('Skyline Blvd', '[(-122.1772,37.039),(-122.1774,37.037)]'),
+('Skyline Blvd', '[(-122.1865,37.25),(-122.186,37.247)]'),
+('Skyline Blvd', '[(-122.1885,37.275),(-122.1873,37.266)]'),
+('Skyline Blvd', '[(-122.1965,37.405),(-122.190866,37.38122)]'),
+('Skyline Blvd', '[(-122.2091,37.506),(-122.2076,37.506)]'),
+('Skyline Dr', '[(-122.0277,37.5),(-122.0284,37.498)]'),
+('Skyview Dr', '[(-122.1276,37.242),(-122.1274,37.244)]'),
+('Skywest Dr', '[(-122.1161,37.62),(-122.1123,37.586)]'),
+('Sleepy Hollow Ave', '[(-122.093,37.35),(-122.0927,37.343)]'),
+('Sleepy Hollow Ave', '[(-122.1003,37.335),(-122.1008,37.332)]'),
+('Sleepy Hollow Ave', '[(-122.1045,37.316),(-122.1054,37.315)]'),
+('Slender Ct', '[(-122.0565,37.73),(-122.055,37.735)]'),
+('Smalley Ave', '[(-122.095194,37.69714),(-122.0945,37.7)]'),
+('Smith St', '[(-122.0727,37.965),(-122.0742,37.964)]'),
+('Smith St', '[(-122.0759,37.963),(-122.0778,37.964)]'),
+('Snake Road', '[(-122.206567,37.27603),(-122.2062,37.281),(-122.2057,37.292)]'),
+('Snake Road', '[(-122.2066,37.331),(-122.2048,37.345)]'),
+('Sodaville Ct', '[(-121.9266,37.029),(-121.9278,37.033)]'),
+('Solano Ave', '[(-122.1131,37.735),(-122.1161,37.724)]'),
+('Solano Ave', '[(-122.2829,37.912),(-122.2819,37.913)]'),
+('Solano Ave', '[(-122.2871,37.91),(-122.2867,37.91)]'),
+('Solano Ave', '[(-122.289,37.909),(-122.2885,37.91)]'),
+('Solano Way', '[(-122.0773,37.921),(-122.0785,37.921)]'),
+('Solano Way', '[(-122.2451,37.889),(-122.2443,37.885)]'),
+('Solomon Lane', '[(-122.2372,37.299),(-122.2374,37.3)]'),
+('Somerset Ave', '[(-122.0827,37.016),(-122.0811,37.016)]'),
+('Somerset Ave', '[(-122.0893,37.006),(-122.0885,37.008)]'),
+('Somerset Ave', '[(-122.0907,37.003),(-122.0899,37.005)]'),
+('Somerset Ave', '[(-122.0936,37.994),(-122.0922,37.998)]'),
+('Somerset Pl', '[(-122.0295,37.49),(-122.0299,37.485)]'),
+('Somerset Pl', '[(-122.2732,37.949),(-122.27246,37.94689)]'),
+('Sonoma Ave', '[(-122.2776,37.858),(-122.2765,37.856)]'),
+('Sonoma Dr', '[(-121.8796,37.487),(-121.8799,37.488)]'),
+('Soquel St', '[(-122.0664,37.711),(-122.0657,37.707)]'),
+('Sora Com', '[(-122.043,37.743),(-122.0428,37.746)]'),
+('Sorani Way', '[(-122.0785,37.172),(-122.0782,37.171)]'),
+('Soto Road', '[(-122.0812,37.561),(-122.0798,37.545)]'),
+('South Road', '[(-121.8941,37.283),(-121.894,37.279)]'),
+('South Bay Aqueduct', '[(-121.6786,37.942),(-121.676067,37.8981)]'),
+('South Dry Creek Branch', '[(-122.0168,37.083),(-122.0173,37.084)]'),
+('South Fork Trout Creek', '[(-121.658085,37.99874),(-121.657591,37.02423)]'),
+('South Front Road', '[(-121.7116,37.134),(-121.7092,37.145)]'),
+('South Front Road', '[(-121.723953,37.0797),(-121.722,37.062)]'),
+('South Front Road', '[(-121.738379,37.02183),(-121.737947,37.02335)]'),
+('Southampton Ave', '[(-122.2745,37.948),(-122.2742,37.962)]'),
+('Southern Pacific Railroad', '[(-121.558002,37.00663),(-121.576,37.136)]'),
+('Southern Pacific Railroad', '[(-121.6695,37.391),(-121.666889,37.41337)]'),
+('Southern Pacific Railroad', '[(-121.7674,37.843),(-121.7686,37.84)]'),
+('Southern Pacific Railroad', '[(-122.3002,37.674),(-122.2999,37.661)]'),
+('Southlake Com', '[(-121.9572,37.113),(-121.9565,37.116)]'),
+('Southwick Ct', '[(-121.9441,37.185),(-121.9436,37.18)]'),
+('Sp Railroad', '[(-121.7182,37.017),(-121.7162,37.025)]'),
+('Sp Railroad', '[(-121.8204,37.746),(-121.8139,37.753)]'),
+('Sp Railroad', '[(-121.8591,37.701),(-121.8586,37.705)]'),
+('Sp Railroad', '[(-121.8699,37.631),(-121.8678,37.651)]'),
+('Sp Railroad', '[(-121.87958,37.88603),(-121.880675,37.89396)]'),
+('Sp Railroad', '[(-121.893564,37.99009),(-121.897,37.016)]'),
+('Sp Railroad', '[(-121.8977,37.022),(-121.9022,37.054)]'),
+('Sp Railroad', '[(-121.9271,37.788),(-121.9185,37.626)]'),
+('Sp Railroad', '[(-121.950757,37.25243),(-121.9506,37.25)]'),
+('Sp Railroad', '[(-121.9565,37.898),(-121.9562,37.9)]'),
+('Sp Railroad', '[(-121.9684,37.715),(-121.9669,37.701),(-121.9655,37.69)]'),
+('Sp Railroad', '[(-121.9736,37.616),(-121.9737,37.608)]'),
+('Sp Railroad', '[(-121.993831,37.81669),(-121.992146,37.8107)]'),
+('Sp Railroad', '[(-122.0257,37.349),(-122.0289,37.31)]'),
+('Sp Railroad', '[(-122.0315,37.251),(-122.0292,37.24)]'),
+('Sp Railroad', '[(-122.0321,37.271),(-122.0347,37.265)]'),
+('Sp Railroad', '[(-122.0386,37.133),(-122.0335,37.089)]'),
+('Sp Railroad', '[(-122.0414,37.268),(-122.042509,37.26338)]'),
+('Sp Railroad', '[(-122.0553,37.212),(-122.0652,37.134),(-122.0654,37.131)]'),
+('Sp Railroad', '[(-122.0594,37.75),(-122.0593,37.743)]'),
+('Sp Railroad', '[(-122.0626,37.857),(-122.0616,37.845)]'),
+('Sp Railroad', '[(-122.0734,37.001),(-122.0734,37.997)]'),
+('Sp Railroad', '[(-122.076691,37.99914),(-122.075907,37.99243)]'),
+('Sp Railroad', '[(-122.086,37.079),(-122.081,37.036)]'),
+('Sp Railroad', '[(-122.0914,37.601),(-122.087,37.56),(-122.086408,37.5551)]'),
+('Sp Railroad', '[(-122.10629,37.73042),(-122.1054,37.723)]'),
+('Sp Railroad', '[(-122.1129,37.315),(-122.1125,37.311)]'),
+('Sp Railroad', '[(-122.121,37.857),(-122.1187,37.837)]'),
+('Sp Railroad', '[(-122.137,37.576),(-122.1327,37.53)]'),
+('Sp Railroad', '[(-122.137792,37.003),(-122.1365,37.992),(-122.131257,37.94612)]'),
+('Sp Railroad', '[(-122.172213,37.03399),(-122.1678,37.059)]'),
+('Sp Railroad', '[(-122.1748,37.322),(-122.174,37.315)]'),
+('Sp Railroad', '[(-122.1785,37.355),(-122.178,37.351)]'),
+('Sp Railroad', '[(-122.17894,37.32386),(-122.179281,37.31827),(-122.1807,37.295)]'),
+('Sp Railroad', '[(-122.1801,37.115),(-122.178,37.088)]'),
+('Sp Railroad', '[(-122.1947,37.497),(-122.193328,37.4848)]'),
+('Sp Railroad', '[(-122.2269,37.73),(-122.2272,37.726)]'),
+('Sp Railroad', '[(-122.2281,37.761),(-122.2268,37.753)]'),
+('Sp Railroad', '[(-122.2346,37.727),(-122.2343,37.726)]'),
+('Sp Railroad', '[(-122.2411,37.85),(-122.2359,37.814)]'),
+('Sp Railroad', '[(-122.2506,37.891),(-122.2501,37.889)]'),
+('Sp Railroad', '[(-122.2724,37.946),(-122.2713,37.942)]'),
+('Sp Railroad', '[(-122.2737,37.774),(-122.2731,37.765)]'),
+('Sp Railroad', '[(-122.2744,37.802),(-122.2743,37.795)]'),
+('Sp Railroad', '[(-122.275429,37.88474),(-122.2754,37.883)]'),
+('Sp Railroad', '[(-122.2853,37.355),(-122.2847,37.334)]'),
+('Sp Railroad', '[(-122.2864,37.393),(-122.2881,37.387)]'),
+('Sp Railroad', '[(-122.2888,37.383),(-122.2893,37.38)]'),
+('Sp Railroad', '[(-122.2898,37.349),(-122.2887,37.319),(-122.2883,37.307)]'),
+('Sp Railroad', '[(-122.2939,37.484),(-122.2936,37.475)]'),
+('Sp Railroad', '[(-122.2965,37.56),(-122.2959,37.545)]'),
+('Sp Railroad', '[(-122.305229,37.83926),(-122.3049,37.822)]'),
+('Sp Railroad', '[(-122.3086,37.087),(-122.31,37.085)]'),
+('Spady St', '[(-121.9689,37.424),(-121.969174,37.41761)]'),
+('Sparrow Dr', '[(-121.9331,37.139),(-121.9328,37.134)]'),
+('Sparrow Road', '[(-122.0827,37.209),(-122.0826,37.203)]'),
+('Spence Ave', '[(-121.9733,37.616),(-121.9728,37.619)]'),
+('Spetti Dr', '[(-121.9684,37.665),(-121.9696,37.658)]'),
+('Spinnaker Way', '[(-122.3138,37.694),(-122.3171,37.687)]'),
+('Spoonbill Common', '[(-122.043662,37.66522),(-122.043425,37.66065)]'),
+('Spring St', '[(-121.8702,37.62),(-121.871,37.621)]'),
+('Springbrook Lane', '[(-122.057162,37.29952),(-122.056705,37.29151)]'),
+('Springdale Ave', '[(-121.9196,37.845),(-121.92,37.854)]'),
+('Springdale Ave', '[(-121.9229,37.884),(-121.9233,37.888)]'),
+('Springfield St', '[(-122.1598,37.485),(-122.1597,37.477)]'),
+('Springhouse Dr', '[(-121.883683,37.89587),(-121.880871,37.89125)]'),
+('Springlake Dr', '[(-122.133113,37.93134),(-122.134,37.93)]'),
+('Springtown Blvd', '[(-121.74,37.039),(-121.7407,37.059)]'),
+('Springtown Blvd', '[(-121.743242,37.07568),(-121.745,37.088)]'),
+('Spruce St', '[(-122.0506,37.327),(-122.0496,37.322)]'),
+('Spruce St', '[(-122.0566,37.368),(-122.0565,37.361)]'),
+('Spruce St', '[(-122.1578,37.994),(-122.1586,37.991)]'),
+('Spruce St', '[(-122.2398,37.048),(-122.2393,37.056)]'),
+('Spruce St', '[(-122.2659,37.849),(-122.2655,37.839)]'),
+('Spruce St', '[(-122.2698,37.99),(-122.2693,37.981)]'),
+('St Anthony Dr', '[(-121.939,37.474),(-121.9385,37.471)]'),
+('St Charles St', '[(-122.2654,37.763),(-122.2653,37.773)]'),
+('St Johns St', '[(-121.8764,37.643),(-121.8777,37.646)]'),
+('St Matthew Dr', '[(-122.024,37.394),(-122.0234,37.391)]'),
+('St Michael Cir', '[(-121.853648,37.6251),(-121.853779,37.61796)]'),
+('Stacy St', '[(-122.1218,37.544),(-122.1199,37.532)]'),
+('Stadium Way', '[(-121.758155,37.66715),(-121.757912,37.66728)]'),
+('Stagecoach Road', '[(-121.921401,37.27049),(-121.9218,37.277)]'),
+('Stalker Way', '[(-122.264,37.807),(-122.2672,37.816)]'),
+('Stanford Ave', '[(-122.2764,37.438),(-122.2773,37.433)]'),
+('Stanford Ave', '[(-122.2781,37.43),(-122.2802,37.42)]'),
+('Stanford Way', '[(-121.7451,37.826),(-121.743925,37.82264)]'),
+('Stanford Way', '[(-121.7473,37.828),(-121.7459,37.826)]'),
+('Stanley Ave', '[(-121.9621,37.242),(-121.9632,37.24)]'),
+('Stanley Ave', '[(-122.1504,37.485),(-122.15,37.478),(-122.1498,37.469)]'),
+('Stanley Blvd', '[(-121.7971,37.769),(-121.7948,37.772)]'),
+('Stanley Blvd', '[(-121.8705,37.659),(-121.871,37.66)]'),
+('Stannage Ave', '[(-122.2939,37.844),(-122.2939,37.828)]'),
+('Stannage Ave', '[(-122.297,37.939),(-122.2965,37.923)]'),
+('Stanton Ave', '[(-122.0889,37.939),(-122.0885,37.928)]'),
+('Stanton Ave', '[(-122.0953,37.027),(-122.0944,37.022)]'),
+('Stanton Ave', '[(-122.100392,37.0697),(-122.099513,37.06052)]'),
+('Stanton Hill Road', '[(-122.0935,37.963),(-122.0929,37.964)]'),
+('Stanwood Ave', '[(-122.0839,37.416),(-122.0839,37.409)]'),
+('Star View Ct', '[(-122.2251,37.516),(-122.2248,37.511)]'),
+('Starflower Way', '[(-121.7298,37.099),(-121.7323,37.095)]'),
+('Starling Dr', '[(-122.015929,37.82489),(-122.0171,37.83)]'),
+('Starlite Way', '[(-121.9167,37.738),(-121.9162,37.745)]'),
+('Starr Ct', '[(-121.9238,37.371),(-121.9246,37.373)]'),
+('Starr Ct', '[(-121.9249,37.373),(-121.92514,37.3722)]'),
+('Starr St', '[(-121.9213,37.378),(-121.9216,37.376)]'),
+('Starview Dr', '[(-122.1248,37.197),(-122.1231,37.201)]'),
+('Starward Dr', '[(-121.9356,37.103),(-121.936,37.109)]'),
+('Starward Dr', '[(-121.9361,37.115),(-121.9363,37.128)]'),
+('State Hwy 123', '[(-122.3004,37.986),(-122.2998,37.969),(-122.2995,37.962),(-122.2992,37.952),(-122.299,37.942),(-122.2987,37.935),(-122.2984,37.924),(-122.2982,37.92),(-122.2976,37.904),(-122.297,37.88),(-122.2966,37.869),(-122.2959,37.848),(-122.2961,37.843)]'),
+('State Hwy 13', '[(-122.1797,37.943),(-122.179871,37.91849),(-122.18,37.9),(-122.179023,37.86615),(-122.1787,37.862),(-122.1781,37.851),(-122.1777,37.845),(-122.1773,37.839),(-122.177,37.833)]'),
+('State Hwy 13', '[(-122.1828,37.974),(-122.1799,37.948)]'),
+('State Hwy 13', '[(-122.2049,37.2),(-122.20328,37.17975),(-122.1989,37.125),(-122.198078,37.11641),(-122.1975,37.11)]'),
+('State Hwy 13', '[(-122.2213,37.388),(-122.218753,37.36402),(-122.2168,37.336),(-122.2163,37.328),(-122.2144,37.313),(-122.211744,37.28221),(-122.21,37.262),(-122.2087,37.244),(-122.207,37.224),(-122.2065,37.218),(-122.2058,37.209)]'),
+('State Hwy 13', '[(-122.2319,37.515),(-122.2316,37.511),(-122.2305,37.498),(-122.2296,37.489),(-122.2286,37.478),(-122.2244,37.427)]'),
+('State Hwy 13 Ramp', '[(-122.1781,37.851),(-122.1782,37.847),(-122.1777,37.845)]'),
+('State Hwy 13 Ramp', '[(-122.1799,37.948),(-122.1797,37.943)]'),
+('State Hwy 13 Ramp', '[(-122.1819,37.978),(-122.1828,37.974)]'),
+('State Hwy 13 Ramp', '[(-122.1835,37.98),(-122.1852,37.985)]'),
+('State Hwy 13 Ramp', '[(-122.1854,37.996),(-122.1861,37.986)]'),
+('State Hwy 13 Ramp', '[(-122.1937,37.078),(-122.1943,37.08)]'),
+('State Hwy 13 Ramp', '[(-122.1942,37.084),(-122.1964,37.107)]'),
+('State Hwy 13 Ramp', '[(-122.1975,37.11),(-122.1964,37.107)]'),
+('State Hwy 13 Ramp', '[(-122.1989,37.125),(-122.1984,37.117),(-122.1981,37.112)]'),
+('State Hwy 13 Ramp', '[(-122.2054,37.205),(-122.2048,37.209)]'),
+('State Hwy 13 Ramp', '[(-122.2055,37.197),(-122.2049,37.2)]'),
+('State Hwy 13 Ramp', '[(-122.2058,37.209),(-122.2049,37.211)]'),
+('State Hwy 13 Ramp', '[(-122.2069,37.213),(-122.2072,37.216),(-122.2065,37.218)]'),
+('State Hwy 13 Ramp', '[(-122.2073,37.221),(-122.207,37.224)]');
+
+INSERT INTO road VALUES
+('State Hwy 13 Ramp', '[(-122.2163,37.328),(-122.2149,37.321),(-122.2144,37.313)]'),
+('State Hwy 13 Ramp', '[(-122.2168,37.336),(-122.2168,37.328)]'),
+('State Hwy 13 Ramp', '[(-122.2232,37.41),(-122.2247,37.422)]'),
+('State Hwy 13 Ramp', '[(-122.2244,37.427),(-122.223,37.414),(-122.2214,37.396),(-122.2213,37.388)]'),
+('State Hwy 13 Ramp', '[(-122.2244,37.427),(-122.2247,37.422)]'),
+('State Hwy 13 Ramp', '[(-122.2307,37.487),(-122.2286,37.478)]'),
+('State Hwy 17', '[(-122.3107,37.976),(-122.3078,37.93),(-122.3072,37.916),(-122.307,37.902)]'),
+('State Hwy 17 Ramp', '((-122.2877,37.234),(-122.2881,37.237))'),
+('State Hwy 17 Ramp', '[(-122.2882,37.233),(-122.2881,37.237),(-122.2882,37.242),(-122.2883,37.247),(-122.2885,37.254)]'),
+('State Hwy 17 Ramp', '[(-122.2899,37.128),(-122.2898,37.132),(-122.2897,37.142)]'),
+('State Hwy 17 Ramp', '[(-122.291,37.113),(-122.2906,37.118)]'),
+('State Hwy 17 Ramp', '[(-122.2915,37.083),(-122.29137,37.07065),(-122.290561,37.06224)]'),
+('State Hwy 238', '((-122.098,37.908),(-122.0983,37.907),(-122.099,37.905),(-122.101,37.898),(-122.101535,37.89711),(-122.103173,37.89438),(-122.1046,37.892),(-122.106,37.89))'),
+('State Hwy 238', '[(-122.106,37.89),(-122.1061,37.89),(-122.1064,37.89),(-122.1073,37.889)]'),
+('State Hwy 238 Ramp', '((-122.1064,37.89),(-122.1067,37.899))'),
+('State Hwy 238 Ramp', '((-122.1288,37.892),(-122.1293,37.895))'),
+('State Hwy 238 Ramp', '((-122.1288,37.913),(-122.1294,37.917))'),
+('State Hwy 238 Ramp', '[(-122.1073,37.889),(-122.1067,37.899),(-122.1056,37.899)]'),
+('State Hwy 238 Ramp', '[(-122.1073,37.889),(-122.1068,37.881),(-122.106574,37.88354),(-122.106,37.89)]'),
+('State Hwy 238 Ramp', '[(-122.1288,37.9),(-122.1293,37.895),(-122.1296,37.906)]'),
+('State Hwy 238 Ramp', '[(-122.1288,37.922),(-122.1294,37.917),(-122.1296,37.906)]'),
+('State Hwy 24', '[(-122.2206,37.531),(-122.2204,37.536),(-122.2194,37.541),(-122.217,37.546),(-122.2151,37.551),(-122.2139,37.561),(-122.2121,37.577)]'),
+('State Hwy 24', '[(-122.2674,37.246),(-122.2673,37.248),(-122.267,37.261),(-122.2668,37.271),(-122.2663,37.298),(-122.2659,37.315),(-122.2655,37.336),(-122.265007,37.35882),(-122.264443,37.37286),(-122.2641,37.381),(-122.2638,37.388),(-122.2631,37.396),(-122.2617,37.405),(-122.2615,37.407),(-122.2605,37.412)]'),
+('State Hwy 24', '[(-122.2681,37.244),(-122.2679,37.248),(-122.2677,37.252)]'),
+('State Hwy 24 Ramp', '((-122.2191,37.537),(-122.2197,37.535))'),
+('State Hwy 24 Ramp', '((-122.2204,37.536),(-122.2211,37.533))'),
+('State Hwy 24 Ramp', '[(-122.2194,37.541),(-122.2197,37.535),(-122.2197,37.531)]'),
+('State Hwy 24 Ramp', '[(-122.2211,37.542),(-122.2211,37.533),(-122.2209,37.526)]'),
+('State Hwy 24 Ramp', '[(-122.2218,37.517),(-122.2214,37.507)]'),
+('State Hwy 24 Ramp', '[(-122.2224,37.497),(-122.2219,37.494),(-122.2215,37.492)]'),
+('State Hwy 24 Ramp', '[(-122.2279,37.486),(-122.2284,37.485)]'),
+('State Hwy 24 Ramp', '[(-122.2279,37.486),(-122.2305,37.498)]'),
+('State Hwy 24 Ramp', '[(-122.2286,37.478),(-122.2284,37.485)]'),
+('State Hwy 24 Ramp', '[(-122.2551,37.435),(-122.2568,37.436),(-122.2585,37.428),(-122.259722,37.42438),(-122.260592,37.4218),(-122.2612,37.42)]'),
+('State Hwy 24 Ramp', '[(-122.257,37.433),(-122.258,37.427)]'),
+('State Hwy 24 Ramp', '[(-122.2605,37.412),(-122.2601,37.412),(-122.2599,37.412),(-122.2586,37.413)]'),
+('State Hwy 24 Ramp', '[(-122.2623,37.409),(-122.2614,37.411),(-122.260282,37.41626),(-122.258,37.427)]'),
+('State Hwy 24 Ramp', '[(-122.2657,37.351),(-122.2665,37.36)]'),
+('State Hwy 24 Ramp', '[(-122.266,37.348),(-122.2661,37.35),(-122.2668,37.35)]'),
+('State Hwy 24 Ramp', '[(-122.2677,37.252),(-122.2674,37.258),(-122.2671,37.263),(-122.2672,37.267),(-122.2673,37.272)]'),
+('State Hwy 84', '[(-121.7673,37.82),(-121.7664,37.828),(-121.7654,37.835),(-121.765,37.837)]'),
+('State Hwy 84', '[(-121.9565,37.898),(-121.956589,37.89911),(-121.9569,37.903),(-121.956,37.91),(-121.9553,37.919)]'),
+('State Hwy 84', '[(-121.9725,37.749),(-121.972151,37.75144),(-121.9715,37.756),(-121.9706,37.762),(-121.9692,37.778),(-121.9673,37.793),(-121.9637,37.813),(-121.9637,37.854),(-121.9576,37.891)]'),
+('State Hwy 84', '[(-122.0484,37.539),(-122.0443,37.564),(-122.0423,37.577)]'),
+('State Hwy 84', '[(-122.0484,37.539),(-122.0514,37.52),(-122.051557,37.51906),(-122.0544,37.502)]'),
+('State Hwy 84', '[(-122.0671,37.426),(-122.0658,37.432)]'),
+('State Hwy 84', '[(-122.0671,37.426),(-122.07,37.402),(-122.074,37.37),(-122.0773,37.338)]'),
+('State Hwy 84 Ramp', '[(-122.0544,37.502),(-122.052622,37.50902),(-122.0506,37.517),(-122.0484,37.539)]'),
+('State Hwy 92', '[(-122.1085,37.326),(-122.1095,37.322),(-122.1111,37.316),(-122.1119,37.313),(-122.1125,37.311),(-122.1131,37.308),(-122.1167,37.292),(-122.1187,37.285),(-122.12,37.28)]'),
+('State Hwy 92 Ramp', '((-122.1091,37.328),(-122.1101,37.332))'),
+('State Hwy 92 Ramp', '[(-122.099,37.368),(-122.0994,37.363)]'),
+('State Hwy 92 Ramp', '[(-122.1086,37.321),(-122.1089,37.315),(-122.1111,37.316)]'),
+('State Hwy 92 Ramp', '[(-122.1091,37.328),(-122.1101,37.332),(-122.1101,37.327),(-122.1095,37.322)]'),
+('State Hwy 92 Ramp', '[(-122.1167,37.292),(-122.1185,37.295),(-122.1191,37.298)]'),
+('State Hwy 92 Ramp', '[(-122.1187,37.285),(-122.1186,37.292),(-122.1193,37.29)]'),
+('State Hwy 92 Ramp', '[(-122.12,37.28),(-122.1207,37.269),(-122.1204,37.27)]'),
+('State Hwy 92 Ramp', '[(-122.1204,37.267),(-122.123,37.271)]'),
+('Staten Ave', '[(-122.2533,37.103),(-122.2534,37.094)]'),
+('Stearns Ave', '[(-122.1564,37.533),(-122.1533,37.512)]'),
+('Steele St', '[(-122.188,37.892),(-122.1874,37.886)]'),
+('Steinmetz Way', '[(-122.1979,37.061),(-122.1976,37.051)]'),
+('Stella St', '[(-122.14272,37.4824),(-122.1418,37.469)]'),
+('Stenhammer Dr', '[(-121.9612,37.84),(-121.9607,37.826)]'),
+('Sterne Pl', '[(-122.0318,37.838),(-122.0327,37.835)]'),
+('Steuben Ct', '[(-121.9547,37.227),(-121.9553,37.225)]'),
+('Stevens St', '[(-122.0718,37.999),(-122.0707,37.999)]'),
+('Stevenson Blvd', '[(-121.9758,37.367),(-121.9782,37.334)]'),
+('Stevenson Blvd', '[(-121.982964,37.27715),(-121.983567,37.27017)]'),
+('Stewart Ave', '[(-121.9797,37.174),(-121.9821,37.149)]'),
+('Stoakes Ave', '[(-122.161722,37.31574),(-122.16195,37.31467)]'),
+('Stonedale Dr', '[(-121.9171,37.877),(-121.9173,37.882)]'),
+('Stonehenge Road', '[(-122.037162,37.84679),(-122.0377,37.841)]'),
+('Stoneridge Dr', '[(-121.894,37.919),(-121.8902,37.925)]'),
+('Stoneridge Dr', '[(-121.9082,37.905),(-121.9089,37.904)]'),
+('Stoneridge Mall Road', '[(-121.9274,37.926),(-121.925,37.925)]'),
+('Stoneridge Mall Road', '[(-121.9287,37.963),(-121.9283,37.941)]'),
+('Stonewall Ave', '[(-122.1076,37.568),(-122.1067,37.554)]'),
+('Stony Brook', '[(-121.9429,37.244),(-121.9432,37.21)]'),
+('Storer Ave', '[(-122.1944,37.852),(-122.1934,37.854)]'),
+('Stow Ave', '[(-122.2508,37.042),(-122.2491,37.043)]'),
+('Strang Ave', '[(-122.1087,37.034),(-122.1076,37.037)]'),
+('Stratford Ave', '[(-121.9696,37.271),(-121.9732,37.254)]'),
+('Stratton Common', '[(-121.983399,37.43226),(-121.983217,37.43097)]'),
+('Stream', '[(-121.574573,37.54948),(-121.574039,37.57213)]'),
+('Stream', '[(-121.648853,37.05723),(-121.651539,37.14924)]'),
+('Strobridge Ave', '[(-122.0884,37.911),(-122.0882,37.908)]'),
+('Strong Way', '[(-122.102446,37.04885),(-122.101424,37.05337)]'),
+('Stuart St', '[(-122.2518,37.6),(-122.2507,37.601),(-122.2491,37.606)]'),
+('Stuart St', '[(-122.2554,37.601),(-122.2541,37.602)]'),
+('Suddard Ct', '[(-121.9057,37.823),(-121.9064,37.822)]'),
+('Sueirro St', '[(-122.1113,37.628),(-122.1121,37.627)]'),
+('Suffolk Way', '[(-121.8699,37.932),(-121.8732,37.92)]'),
+('Sulphur Dr', '[(-122.0517,37.719),(-122.0506,37.715)]'),
+('Sulphur Creek', '[(-122.058701,37.76216),(-122.0609,37.772)]'),
+('Sulphur Creek', '[(-122.0655,37.766),(-122.0659,37.764)]'),
+('Sumatra St', '[(-122.0743,37.277),(-122.0751,37.276)]'),
+('Summit Road', '[(-122.2464,37.816),(-122.2447,37.82)]'),
+('Summit Road', '[(-122.2479,37.874),(-122.2478,37.87)]'),
+('Sun Valley Dr', '[(-122.1174,37.493),(-122.1173,37.488)]'),
+('Sun Valley Dr', '[(-122.1191,37.47),(-122.1201,37.465)]'),
+('Sundale Dr', '[(-121.976,37.481),(-121.9776,37.464)]'),
+('Sundale Dr', '[(-121.982028,37.41595),(-121.98231,37.41254)]'),
+('Sundale Dr', '[(-121.9836,37.315),(-121.9809,37.301)]'),
+('Sundale Dr', '[(-121.9868,37.342),(-121.9867,37.338)]'),
+('Sundance Dr', '[(-121.9113,37.988),(-121.9097,37.992)]'),
+('Sundberg Ave', '[(-122.1667,37.119),(-122.1659,37.116)]'),
+('Sunnybank Pl', '[(-122.051879,37.78503),(-122.052,37.782)]'),
+('Sunnydale Ct', '[(-122.0429,37.203),(-122.0429,37.2)]'),
+('Sunnyhills Road', '[(-122.2257,37.111),(-122.2246,37.114)]'),
+('Sunnymere Ave', '[(-122.1681,37.776),(-122.1672,37.77)]'),
+('Sunnymere Ave', '[(-122.1707,37.791),(-122.1699,37.786)]'),
+('Sunnymere Ave', '[(-122.1729,37.803),(-122.1718,37.795)]'),
+('Sunnyside Ave', '[(-122.2469,37.232),(-122.2453,37.221)]'),
+('Sunnyside St', '[(-122.1564,37.386),(-122.1559,37.38)]'),
+('Sunnyside St', '[(-122.1611,37.462),(-122.1604,37.453)]'),
+('Sunol Blvd', '[(-121.8805,37.447),(-121.8807,37.422)]'),
+('Sunol Road', '[(-122.1254,37.671),(-122.1254,37.666)]'),
+('Sunol Ridge Trl', '[(-121.9419,37.455),(-121.9345,37.38)]'),
+('Sunrise Dr', '[(-121.7347,37.066),(-121.7343,37.069)]'),
+('Sunset Ave', '[(-122.2176,37.901),(-122.2173,37.908)]'),
+('Sunset Blvd', '[(-122.0899,37.779),(-122.0888,37.788)]'),
+('Sunset Blvd', '[(-122.0932,37.755),(-122.0921,37.761)]'),
+('Sunset Blvd', '[(-122.0944,37.75),(-122.0941,37.751)]'),
+('Sunset Trl', '[(-122.2375,37.574),(-122.2372,37.571)]'),
+('Sunshine Pl', '[(-122.097403,37.11209),(-122.096541,37.11436)]'),
+('Sunstream Lane', '[(-121.7345,37.059),(-121.7347,37.066)]'),
+('Sunwood Dr', '[(-121.9332,37.113),(-121.9335,37.132)]'),
+('Superior Ave', '[(-122.142,37.324),(-122.1422,37.315)]'),
+('Superior Dr', '[(-121.7724,37.543),(-121.7727,37.543)]'),
+('Surry Pl', '[(-122.0052,37.685),(-122.006,37.679)]'),
+('Sussex Way', '[(-122.0657,37.227),(-122.0669,37.222),(-122.0673,37.219)]'),
+('Suter St', '[(-122.2009,37.89),(-122.2007,37.888)]'),
+('Suter St', '[(-122.2072,37.94),(-122.2061,37.931)]'),
+('Sutter Dr', '[(-121.9893,37.359),(-121.987,37.35)]'),
+('Sutter Dr', '[(-121.9951,37.377),(-121.9943,37.373)]'),
+('Sutter Gate Ave', '[(-121.8838,37.866),(-121.8845,37.864)]'),
+('Sutton Loop', '[(-121.9994,37.586),(-121.9981,37.576)]'),
+('Swan Dr', '[(-121.7996,37.845),(-121.7991,37.834)]'),
+('Sybil Ave', '[(-122.1443,37.213),(-122.1435,37.215)]'),
+('Sycamore Ave', '[(-122.0759,37.633),(-122.0752,37.636)]'),
+('Sycamore Ave', '[(-122.0826,37.609),(-122.0818,37.606)]'),
+('Sycamore St', '[(-122.0361,37.294),(-122.0354,37.291)]'),
+('Sycamore St', '[(-122.2715,37.16),(-122.2739,37.163)]'),
+('Sydney Ave', '[(-121.7678,37.636),(-121.7669,37.636)]'),
+('Sydney Cir', '[(-122.098211,37.07652),(-122.09723,37.06547)]'),
+('Sylvan Glen', '[(-122.065238,37.685),(-122.065615,37.67879)]'),
+('Sylvaner Dr', '[(-121.8475,37.61),(-121.8482,37.607)]'),
+('Sylvaner Way', '[(-121.907301,37.67596),(-121.908111,37.67419)]'),
+('Sylvester Dr', '[(-122.041,37.815),(-122.0405,37.812)]'),
+('Sylvia Cir', '[(-121.860125,37.6435),(-121.8603,37.64325)]'),
+('Tacchella Way', '[(-121.994785,37.62496),(-121.994311,37.61417)]'),
+('Tahiti Lane', '[(-122.2411,37.343),(-122.240607,37.3499),(-122.2401,37.357)]'),
+('Talbot Ave', '[(-122.2925,37.847),(-122.2925,37.843)]'),
+('Talbot Ave', '[(-122.2967,37.989),(-122.2964,37.975),(-122.2959,37.959)]'),
+('Tallahassee St', '[(-122.0989,37.352),(-122.1012,37.345)]'),
+('Tamalpais Path', '[(-122.2596,37.866),(-122.2599,37.872)]'),
+('Tamalpais Road', '[(-122.2593,37.836),(-122.2588,37.842)]'),
+('Tamarack Dr', '[(-121.9207,37.159),(-121.922,37.155)]'),
+('Tamarack Dr', '[(-121.9255,37.155),(-121.9266,37.156)]'),
+('Tamarack Dr', '[(-121.9304,37.16),(-121.9313,37.163)]'),
+('Tamarack Dr', '[(-121.932412,37.17516),(-121.9327,37.179)]'),
+('Tamayo St', '[(-122.0184,37.732),(-122.019,37.729)]'),
+('Tamayo St', '[(-122.0201,37.723),(-122.0204,37.72)]'),
+('Tampa Ave', '[(-122.0747,37.327),(-122.0747,37.314),(-122.0746,37.308)]'),
+('Tanager Dr', '[(-121.8775,37.831),(-121.8778,37.838)]'),
+('Tanglewood Path', '[(-122.2431,37.628),(-122.2427,37.626)]'),
+('Tarraville Creek', '[(-121.52544,37.95569),(-121.525089,37.948)]'),
+('Tarraville Creek', '[(-121.528505,37.9837),(-121.528147,37.97997)]'),
+('Tarraville Creek', '[(-121.53429,37.98943),(-121.532627,37.98722)]'),
+('Tarraville Creek', '[(-121.536091,37.99721),(-121.536763,37)]'),
+('Tarraville Creek Road', '[(-121.52582,37.96459),(-121.525715,37.96296)]'),
+('Tarraville Creek Road', '[(-121.530642,37.9828),(-121.530608,37.98278)]'),
+('Tartarian St', '[(-122.1774,37.35),(-122.1768,37.352)]'),
+('Tassajara Road', '[(-121.8709,37.099),(-121.8713,37.048)]'),
+('Tassajara Creek', '[(-121.87866,37.98898),(-121.8782,37.015)]'),
+('Tassajara Creek', '[(-121.8862,37.901),(-121.8847,37.924)]'),
+('Taurus Ave', '[(-122.2159,37.416),(-122.2128,37.389)]'),
+('Taylor Ave', '[(-122.0547,37.245),(-122.0541,37.241),(-122.0535,37.237)]'),
+('Taylor Ave', '[(-122.280873,37.72975),(-122.280388,37.72958)]'),
+('Teakwood St', '[(-122.1109,37.58),(-122.1104,37.574)]'),
+('Technology Dr', '[(-121.9539,37.109),(-121.9536,37.099)]'),
+('Telegraph Ave', '[(-122.2581,37.635),(-122.2583,37.625)]'),
+('Telegraph Ave', '[(-122.2585,37.616),(-122.2586,37.607)]'),
+('Telegraph Ave', '[(-122.2589,37.588),(-122.2591,37.578)]'),
+('Telegraph Ave', '[(-122.2594,37.547),(-122.2596,37.541)]'),
+('Telegraph Ave', '[(-122.2614,37.411),(-122.2613,37.414)]'),
+('Telegraph Ave', '[(-122.2618,37.384),(-122.261742,37.38806)]'),
+('Telegraph Ave', '[(-122.2625,37.353),(-122.2623,37.361)]'),
+('Telegraph Ave', '[(-122.2647,37.266),(-122.2647,37.274)]'),
+('Telegraph Ave', '[(-122.2679,37.147),(-122.2678,37.149)]'),
+('Telegraph Ave', '[(-122.2688,37.109),(-122.2686,37.114)]'),
+('Telegraph Ave', '[(-122.2693,37.089),(-122.2691,37.096)]'),
+('Telegraph Ave', '[(-122.2699,37.067),(-122.2697,37.074)]'),
+('Temescal Cir', '[(-122.282639,37.36326),(-122.28206,37.3665)]'),
+('Temescal Creek', '[(-122.284945,37.36017),(-122.2855,37.359)]'),
+('Temescal Creek', '[(-122.2922,37.344),(-122.2937,37.341)]'),
+('Tennyson Road', '[(-122.056941,37.35835),(-122.0562,37.36)]'),
+('Tennyson Road', '[(-122.0605,37.352),(-122.0602,37.354)]'),
+('Tennyson Road', '[(-122.062,37.345),(-122.0625,37.343)]'),
+('Tennyson Road', '[(-122.0682,37.318),(-122.0685,37.317)]'),
+('Tennyson Road', '[(-122.0891,37.317),(-122.0927,37.317)]'),
+('Tennyson Road', '[(-122.1035,37.272),(-122.1041,37.268)]'),
+('Terrace St', '[(-122.2539,37.299),(-122.2523,37.321)]'),
+('Terrace Walk', '[(-122.2719,37.89),(-122.2705,37.884)]'),
+('Tesla Road', '[(-121.570042,37.38752),(-121.573978,37.37661)]'),
+('Tesla Road', '[(-121.588398,37.4085),(-121.596897,37.4397)]'),
+('Tesla Road', '[(-121.613819,37.51806),(-121.62334,37.46389)]'),
+('Tesla Road', '[(-121.646458,37.4545),(-121.646946,37.45847)]'),
+('Tesla Road', '[(-121.6705,37.607),(-121.667684,37.55608)]'),
+('Tesla Road', '[(-121.6774,37.632),(-121.675,37.633)]'),
+('Tevis St', '[(-122.2011,37.621),(-122.2007,37.616)]'),
+('Tevlin St', '[(-122.2866,37.83),(-122.2871,37.819)]'),
+('Texas St', '[(-122.2087,37.942),(-122.2076,37.937)]'),
+('Thackeray Ave', '[(-122.072,37.305),(-122.0715,37.298)]'),
+('The Cir', '[(-122.2721,37.904),(-122.2718,37.905)]'),
+('The Cres', '[(-122.2534,37.945),(-122.254,37.941)]'),
+('The Alameda', '[(-122.2749,37.863),(-122.2744,37.855)]'),
+('The Alameda', '[(-122.276,37.89),(-122.2759,37.882)]'),
+('The Alameda', '[(-122.2765,37.916),(-122.2762,37.902)]'),
+('The Alameda', '[(-122.2805,37.996),(-122.2808,37.988)]'),
+('The South Crossways', '[(-122.2442,37.529),(-122.2443,37.522)]'),
+('The Uplands', '[(-122.2477,37.545),(-122.246,37.543),(-122.245,37.538)]'),
+('Theresa Way', '[(-121.7273,37.877),(-121.7272,37.868)]'),
+('Theresa Way', '[(-121.7289,37.906),(-121.728,37.899)]'),
+('Theta St', '[(-122.0181,37.565),(-122.018394,37.56324)]'),
+('Theta St', '[(-122.0197,37.553),(-122.02,37.55)]'),
+('Thomas Ave', '[(-122.2487,37.375),(-122.2479,37.39)]'),
+('Thornhill Dr', '[(-122.204,37.39),(-122.201,37.389)]'),
+('Thornhill Dr', '[(-122.2131,37.335),(-122.2112,37.35)]'),
+('Thornton Ave', '[(-122.0036,37.671),(-122.0048,37.66)]'),
+('Thornton Ave', '[(-122.0068,37.644),(-122.0083,37.63)]'),
+('Thornton Ave', '[(-122.0127,37.583),(-122.0132,37.575)]'),
+('Thornton Ave', '[(-122.0164,37.537),(-122.0175,37.523)]'),
+('Thornton Ave', '[(-122.0211,37.477),(-122.0214,37.473)]'),
+('Thornton Ave', '[(-122.0291,37.379),(-122.03,37.37)]'),
+('Thornton Ave', '[(-122.0636,37.335),(-122.0626,37.303)]'),
+('Thornton St', '[(-122.1505,37.215),(-122.1526,37.206)]'),
+('Thornton St', '[(-122.1572,37.189),(-122.1576,37.188)]'),
+('Thousand Oaks Blvd', '[(-122.2799,37.975),(-122.2779,37.972)]'),
+('Thousand Oaks Blvd', '[(-122.283,37.972),(-122.2824,37.974)]'),
+('Tidal Canal', '[(-122.2302,37.697),(-122.229,37.694)]'),
+('Tidal Canal', '[(-122.2428,37.791),(-122.2386,37.745)]'),
+('Tidewater Ave', '[(-122.2193,37.625),(-122.2174,37.609)]'),
+('Tideway Dr', '[(-122.2877,37.692),(-122.2854,37.704)]'),
+('Tiffin Road', '[(-122.2086,37.069),(-122.2076,37.07)]'),
+('Tilgrim Way', '[(-122.0831,37.211),(-122.084,37.211)]'),
+('Timber St', '[(-122.0175,37.38),(-122.0139,37.362)]'),
+('Timbercreek Ter', '[(-121.9527,37.351),(-121.952496,37.35039)]'),
+('Timpanogas Cir', '[(-121.963,37.752),(-121.962723,37.74924)]'),
+('Tina Way', '[(-122.0322,37.185),(-122.0305,37.196)]'),
+('Tinder Ct', '[(-122.0496,37.109),(-122.0488,37.12)]'),
+('Tioga Ct', '[(-121.847804,37.6667),(-121.848197,37.66978)]'),
+('Tissiack Way', '[(-121.920364,37),(-121.9208,37.995)]'),
+('Toler Ave', '[(-122.1575,37.269),(-122.1593,37.261)]'),
+('Tonopah Ct', '[(-121.914,37.684),(-121.9138,37.682)]'),
+('Topawa Dr', '[(-121.9204,37.878),(-121.9197,37.88)]'),
+('Toroges Creek', '[(-121.9217,37.808),(-121.922457,37.80485)]'),
+('Toroges Creek', '[(-121.925,37.795),(-121.9268,37.789)]'),
+('Torrano Ave', '[(-122.0685,37.547),(-122.0679,37.551)]'),
+('Tory Way', '[(-121.9162,37.139),(-121.917,37.132)]'),
+('Totterdell St', '[(-122.187,37.228),(-122.1864,37.224)]'),
+('Touriga Dr', '[(-121.8512,37.611),(-121.851283,37.60893)]'),
+('Touriga Dr', '[(-121.8512,37.644),(-121.8511,37.648)]'),
+('Touriga Dr', '[(-121.8521,37.566),(-121.8523,37.559)]'),
+('Towers St', '[(-122.1296,37.096),(-122.1286,37.089)]'),
+('Toyon Pl', '[(-122.0469,37.951),(-122.0464,37.953)]'),
+('Tozier St', '[(-122.0502,37.394),(-122.0497,37.39)]'),
+('Trade Wind Lane', '[(-121.9887,37.294),(-121.9891,37.288)]'),
+('Trafalgar Ave', '[(-122.1036,37.369),(-122.1043,37.375)]'),
+('Treeview St', '[(-122.0379,37.267),(-122.0375,37.262)]'),
+('Treeview St', '[(-122.039,37.282),(-122.0387,37.278)]'),
+('Tremont St', '[(-122.267,37.503),(-122.2672,37.514)]'),
+('Trenery Dr', '[(-121.866449,37.88045),(-121.866515,37.88044)]'),
+('Trenton Dr', '[(-122.0655,37.155),(-122.0647,37.142)]'),
+('Trestle Glen Road', '[(-122.221239,37.12059),(-122.2207,37.125),(-122.2201,37.133)]'),
+('Trimingham Dr', '[(-121.871338,37.76396),(-121.872239,37.76736)]'),
+('Trojan Ave', '[(-122.144,37.868),(-122.1446,37.867)]'),
+('Trojan Ave', '[(-122.1467,37.864),(-122.1483,37.862)]'),
+('Trojan Ave', '[(-122.1514,37.858),(-122.1522,37.857)]'),
+('Trombas Ave', '[(-122.1428,37.217),(-122.1425,37.211)]'),
+('Tropicana Way', '[(-122.0492,37.892),(-122.050057,37.88256),(-122.0513,37.874)]'),
+('Truman Pl', '[(-121.9933,37.285),(-121.9938,37.279)]'),
+('Tudor Road', '[(-122.1808,37.216),(-122.1801,37.216)]'),
+('Tulare Ave', '[(-122.2811,37.889),(-122.2816,37.868)]'),
+('Tule Lake Lane', '[(-122.0568,37.871),(-122.0559,37.866)]'),
+('Tulip Ave', '[(-122.1901,37.881),(-122.1898,37.877)]'),
+('Tumbleweed Ct', '[(-122.0715,37.906),(-122.0718,37.908)]'),
+('Tunnel Road', '[(-122.2382,37.555),(-122.2374,37.553)]'),
+('Tunnel Road', '[(-122.2405,37.574),(-122.2402,37.57)]'),
+('Tunnel Road', '[(-122.2427,37.581),(-122.2414,37.579)]'),
+('Tunnel Creek', '[(-121.610752,37.58239),(-121.624698,37.83019)]'),
+('Tupelo Ter', '[(-122.059087,37.6113),(-122.057021,37.59942)]'),
+('Tupelo Ter', '[(-122.061851,37.62675),(-122.0606,37.62)]'),
+('Turban Ct', '[(-121.9737,37.141),(-121.9729,37.143)]'),
+('Turnstone Ct', '[(-121.7967,37.812),(-121.7967,37.814)]'),
+('Turquoise St', '[(-121.918671,37.20347),(-121.918562,37.20173)]'),
+('Twain Ave', '[(-122.2574,37.904),(-122.2563,37.907)]'),
+('Twin Peaks Ter', '[(-121.9785,37.427),(-121.9783,37.431)]'),
+('Tyee Ct', '[(-122.084,37.918),(-122.084,37.913)]'),
+('Tyler Lane', '[(-122.0674,37.157),(-122.066,37.146)]'),
+('Tyler Pl', '[(-121.9973,37.293),(-121.9986,37.289)]'),
+('Tyler St', '[(-122.2782,37.525),(-122.278041,37.52523)]'),
+('Tyrrell Ave', '[(-122.0709,37.334),(-122.0708,37.329)]'),
+('Tyrrell Ave', '[(-122.0751,37.441),(-122.0759,37.428)]'),
+('Ulmeca Pl', '[(-121.9129,37.786),(-121.9125,37.779)]'),
+('Underwood Ave', '[(-122.0823,37.477),(-122.0822,37.469)]'),
+('Underwood Ave', '[(-122.1852,37.828),(-122.1846,37.809)]'),
+('Union St', '[(-121.9578,37.334),(-121.9584,37.33)]'),
+('Union St', '[(-122.2527,37.731),(-122.2521,37.739)]'),
+('Union St', '[(-122.2555,37.689),(-122.2549,37.698)]'),
+('Union St', '[(-122.2579,37.654),(-122.2573,37.663)]'),
+('Union St', '[(-122.2839,37.21),(-122.2833,37.227)]'),
+('Union St', '[(-122.2854,37.164),(-122.2852,37.178),(-122.2844,37.195)]'),
+('Union St', '[(-122.2862,37.14),(-122.2858,37.152)]'),
+('Union St', '[(-122.2881,37.092),(-122.2876,37.107)]'),
+('Union St', '[(-122.2898,37.042),(-122.2897,37.044)]'),
+('Union City Blvd', '[(-122.0674,37.657),(-122.0669,37.654)]'),
+('Union City Blvd', '[(-122.078284,37.74531),(-122.078001,37.74022)]'),
+('Union City Blvd', '[(-122.0791,37.76),(-122.0786,37.751)]'),
+('Union City Blvd', '[(-122.0795,37.923),(-122.0797,37.907)]'),
+('Union City Blvd', '[(-122.0797,37.883),(-122.0797,37.878)]'),
+('Union City Blvd', '[(-122.0797,37.964),(-122.0797,37.959)]'),
+('Union City Blvd', '[(-122.0805,37.986),(-122.0804,37.972)]'),
+('University Ave', '[(-122.2711,37.718),(-122.27,37.719)]'),
+('University Dr', '[(-122.0275,37.971),(-122.0264,37.97)]'),
+('Upton Ave', '[(-122.1298,37.99),(-122.1297,37.984)]'),
+('Urban St', '[(-121.9714,37.412),(-121.971,37.41)]'),
+('Usher St', '[(-122.1276,37.885),(-122.1275,37.865)]'),
+('Utah St', '[(-121.8591,37.68),(-121.8584,37.682)]'),
+('Vaca Dr', '[(-121.9531,37.448),(-121.9531,37.442)]'),
+('Val St', '[(-121.9739,37.325),(-121.9746,37.324)]'),
+('Valita Dr', '[(-122.1417,37.192),(-122.141,37.195)]'),
+('Valle Vista Ave', '[(-122.246,37.162),(-122.2461,37.168)]'),
+('Vallecitos Road', '[(-121.7875,37.454),(-121.7856,37.463),(-121.7822,37.482)]'),
+('Vallecitos Road', '[(-121.8177,37.142),(-121.836,37.053)]'),
+('Vallecitos Road', '[(-121.8631,37.951),(-121.868,37.93)]'),
+('Vallecitos Road', '[(-121.8699,37.916),(-121.8703,37.891)]'),
+('Vallecitos Creek', '[(-121.8423,37.033),(-121.8379,37.094)]'),
+('Vallejo St', '[(-121.9718,37.765),(-121.9719,37.769)]'),
+('Vallejo St', '[(-122.2869,37.46),(-122.2872,37.466)]'),
+('Valley Ave', '[(-121.8591,37.733),(-121.8628,37.76)]'),
+('Valley Ave', '[(-121.8673,37.761),(-121.8677,37.76)]'),
+('Valley Ave', '[(-121.887,37.767),(-121.8878,37.767),(-121.8888,37.767)]'),
+('Valley Ave', '[(-121.8962,37.644),(-121.89632,37.6086),(-121.896359,37.59716)]'),
+('Valley Dr', '[(-121.863815,37.76063),(-121.8644,37.761)]'),
+('Valley Dr', '[(-121.8967,37.761),(-121.8982,37.746)]'),
+('Valley Dr', '[(-121.897701,37.6866),(-121.8972,37.677),(-121.89692,37.66207)]'),
+('Valley St', '[(-122.17,37.16),(-122.1707,37.158)]'),
+('Valley Brook Ct', '[(-122.0479,37.871),(-122.0478,37.867)]'),
+('Valley Trails Dr', '[(-121.9038,37.75),(-121.9029,37.754)]'),
+('Valley Trails Dr', '[(-121.9066,37.776),(-121.9075,37.775),(-121.9084,37.774)]'),
+('Valley Trails Dr', '[(-121.908,37.739),(-121.9075,37.739)]'),
+('Valley Trails Dr', '[(-121.9098,37.756),(-121.91,37.753)]'),
+('Valpey Park Ave', '[(-121.9748,37.188),(-121.9756,37.186)]'),
+('Van Ave', '[(-122.1212,37.142),(-122.1206,37.128)]'),
+('Van Buren Ave', '[(-122.2521,37.111),(-122.2512,37.113)]'),
+('Van Mourik Ave', '[(-122.1718,37.795),(-122.1716,37.801)]'),
+('Vancouver Way', '[(-121.7753,37.665),(-121.7742,37.666)]'),
+('Vancouver Way', '[(-121.7775,37.667),(-121.7768,37.666)]'),
+('Vanda Way', '[(-121.9989,37.807),(-121.9993,37.8)]'),
+('Vanderbilt St', '[(-122.039,37.254),(-122.0386,37.243)]'),
+('Vane Common', '[(-122.056732,37.54797),(-122.056633,37.54543)]'),
+('Vargas Road', '[(-121.9161,37.512),(-121.9165,37.504)]'),
+('Vasco Road', '[(-121.717311,37.99316),(-121.7174,37.971)]'),
+('Vasco Road', '[(-121.7177,37.70674),(-121.7177,37.68228)]'),
+('Vasco Road', '[(-121.7217,37.062),(-121.72,37.039)]'),
+('Vasco Road', '[(-121.7229,37.093),(-121.7228,37.089)]'),
+('Vasco Road', '[(-121.7231,37.108),(-121.7232,37.114)]'),
+('Vasco Road', '[(-121.737,37.725),(-121.7282,37.489)]'),
+('Vasquez Ct', '[(-122.0252,37.029),(-122.025392,37.02756)]'),
+('Vassar Ave', '[(-122.1245,37.952),(-122.1246,37.945)]'),
+('Vaughn Ave', '[(-121.7118,37.061),(-121.7074,37.08)]'),
+('Vaughn Ave', '[(-122.0802,37.053),(-122.0801,37.026)]'),
+('Vegas Ave', '[(-122.075906,37.8929),(-122.0726,37.894)]'),
+('Ventura Ave', '[(-122.2832,37.864),(-122.283509,37.8555)]'),
+('Vera Ave', '[(-122.1318,37.984),(-122.1317,37.977)]'),
+('Verdemar Dr', '[(-122.2454,37.333),(-122.2453,37.335)]'),
+('Vergil St', '[(-122.0685,37.886),(-122.0681,37.88)]'),
+('Vermont St', '[(-122.2424,37.16),(-122.2415,37.168)]'),
+('Vernetti Way', '[(-122.064379,37.90817),(-122.063821,37.90117)]'),
+('Vernon Ave', '[(-122.0039,37.383),(-122.006,37.358)]'),
+('Vernon St', '[(-122.2509,37.179),(-122.2503,37.184)]'),
+('Verona Ave', '[(-121.7808,37.721),(-121.7801,37.721)]'),
+('Versailles Ave', '[(-122.2383,37.577),(-122.2374,37.589)]'),
+('Via Alamitos', '[(-122.1302,37.675),(-122.13,37.668)]'),
+('Via Alamitos', '[(-122.1302,37.704),(-122.1303,37.697)]'),
+('Via Amigos', '[(-122.1406,37.731),(-122.1424,37.722)]'),
+('Via Annette', '[(-122.1389,37.65),(-122.1388,37.631)]'),
+('Via Arriba', '[(-122.122,37.712),(-122.1216,37.702)]'),
+('Via Arroyo', '[(-122.1256,37.835),(-122.1236,37.823)]'),
+('Via Barrett', '[(-122.1495,37.736),(-122.1503,37.733)]'),
+('Via Bellita', '[(-122.121893,37.82393),(-122.12257,37.81959)]'),
+('Via Buena Vista', '[(-122.1366,37.652),(-122.1374,37.651)]'),
+('Via Carmen', '[(-122.1401,37.674),(-122.1397,37.65)]'),
+('Via Chiquita', '[(-122.1321,37.693),(-122.1319,37.681)]'),
+('Via Chiquita', '[(-122.1322,37.708),(-122.1321,37.702)]'),
+('Via Chiquita', '[(-122.1337,37.731),(-122.1333,37.724)]'),
+('Via Cordoba', '[(-122.1246,37.853),(-122.1239,37.853)]'),
+('Via de Los Cerros', '[(-121.901117,37.7212),(-121.900094,37.71647)]'),
+('Via de Los Milagros', '[(-121.8982,37.746),(-121.8975,37.743)]'),
+('Via del Prado', '[(-122.135,37.797),(-122.1339,37.78)]'),
+('Via del Sol', '[(-121.7899,37.624),(-121.7901,37.615)]'),
+('Via Diego', '[(-122.118617,37.81903),(-122.1194,37.814)]'),
+('Via el Cerrito', '[(-122.1337,37.691),(-122.1336,37.676)]'),
+('Via Enrico', '[(-122.1379,37.82),(-122.1389,37.818)]'),
+('Via Enrico', '[(-122.139846,37.81379),(-122.1407,37.81)]'),
+('Via Escondido', '[(-122.1409,37.747),(-122.141278,37.74521)]'),
+('Via Escondido', '[(-122.142774,37.73812),(-122.143583,37.73429)]'),
+('Via Esperanza', '[(-122.1273,37.676),(-122.1302,37.675)]'),
+('Via Frances', '[(-122.1387,37.68),(-122.1386,37.666)]'),
+('Via Granada', '[(-122.121893,37.82393),(-122.1217,37.822)]'),
+('Via Harriet', '[(-122.1474,37.709),(-122.1473,37.691),(-122.1456,37.674)]'),
+('Via Hermana', '[(-122.1433,37.791),(-122.1442,37.786)]'),
+('Via la Jolla', '[(-122.1346,37.699),(-122.1345,37.691)]'),
+('Via Lacqua', '[(-122.1463,37.734),(-122.1471,37.73)]'),
+('Via Lucas', '[(-122.1381,37.71),(-122.1396,37.71)]'),
+('Via Manzanas', '[(-122.1248,37.761),(-122.1265,37.753)]'),
+('Via Matero', '[(-122.116,37.806),(-122.1175,37.797)]'),
+('Via Montalvo', '[(-121.7867,37.962),(-121.7861,37.967)]'),
+('Via Natal', '[(-122.1434,37.684),(-122.1441,37.68)]'),
+('Via Natal', '[(-122.1449,37.677),(-122.1456,37.674)]'),
+('Via Nueva', '[(-122.1461,37.743),(-122.1456,37.738)]'),
+('Via Paro', '[(-122.129,37.78),(-122.1276,37.757)]'),
+('Via Peralta', '[(-121.8941,37.729),(-121.8938,37.726)]'),
+('Via Perdido', '[(-122.1295,37.741),(-122.1281,37.727)]'),
+('Via Pinale', '[(-122.1333,37.793),(-122.1315,37.773)]'),
+('Via Primero', '[(-122.1223,37.774),(-122.1211,37.755)]'),
+('Via Redondo', '[(-122.141,37.7),(-122.1423,37.707)]'),
+('Via Rodriguez', '[(-122.1234,37.809),(-122.1233,37.806)]'),
+('Via Segundo', '[(-122.1207,37.778),(-122.1189,37.765)]'),
+('Via Tovita', '[(-122.1336,37.64),(-122.1356,37.638)]'),
+('Via Vega', '[(-122.1388,37.837),(-122.1389,37.818)]'),
+('Via Verde', '[(-122.1165,37.788),(-122.1175,37.782)]'),
+('Via Vista', '[(-122.1364,37.745),(-122.1391,37.735)]'),
+('Via Zapata', '[(-121.9434,37.147),(-121.9441,37.161)]'),
+('Vicente Pl', '[(-122.2329,37.572),(-122.232,37.578)]'),
+('Vicente St', '[(-122.2598,37.427),(-122.2598,37.432)]'),
+('Victor Ave', '[(-122.1914,37.972),(-122.1901,37.964)]'),
+('Victor Ave', '[(-122.1922,37.987),(-122.1918,37.981)]'),
+('Victoria Ave', '[(-122.0739,37.905),(-122.0759,37.903)]'),
+('Victoria Lane', '[(-121.663807,37.54316),(-121.663944,37.56139)]'),
+('Victoria Bay', '[(-122.2363,37.399),(-122.2365,37.393)]'),
+('Victory Dr', '[(-122.1091,37.635),(-122.109281,37.6426)]'),
+('View Dr', '[(-122.1364,37.276),(-122.1295,37.271)]'),
+('View Crest Ct', '[(-122.165164,37.82551),(-122.164162,37.826)]'),
+('Village Dr', '[(-122.0773,37.967),(-122.0766,37.967)]'),
+('Village Pkwy', '[(-121.9256,37.098),(-121.9267,37.113)]'),
+('Villareal Dr', '[(-122.019699,37.15004),(-122.018295,37.15912)]'),
+('Villareal Dr', '[(-122.0204,37.147),(-122.0217,37.142)]'),
+('Villareal Dr', '[(-122.022433,37.10266),(-122.023425,37.09294)]'),
+('Vine St', '[(-121.8603,37.64036),(-121.8601,37.64044)]'),
+('Vine St', '[(-122.2755,37.793),(-122.2743,37.794)]'),
+('Vineyard Ave', '[(-121.8463,37.647),(-121.846448,37.64711)]'),
+('Vineyard Ave', '[(-121.8524,37.648),(-121.8511,37.648)]'),
+('Vineyard Ave', '[(-121.853754,37.648),(-121.853805,37.648)]'),
+('Vineyard Road', '[(-121.919,37.056),(-121.9128,37.069)]'),
+('Vineyard Road', '[(-122.0878,37.2),(-122.0877,37.191)]'),
+('Virginia St', '[(-122.0748,37.47),(-122.0697,37.477)]'),
+('Virginia St', '[(-122.2582,37.78),(-122.2565,37.782),(-122.2557,37.784)]'),
+('Virginia St', '[(-122.2751,37.756),(-122.2739,37.759)]'),
+('Virgo Road', '[(-122.2152,37.415),(-122.2146,37.435)]'),
+('Vista Ct', '[(-121.755,37.84),(-121.7551,37.838)]'),
+('Vista del Plaza Lane', '[(-122.0834,37.809),(-122.0829,37.804)]'),
+('Vistamont Ave', '[(-122.265432,37.0356),(-122.2643,37.029)]'),
+('Vivian St', '[(-122.0831,37.895),(-122.082,37.895)]'),
+('Vomac Road', '[(-121.9367,37.166),(-121.937,37.173)]'),
+('Wadsworth Ct', '[(-121.97,37.249),(-121.9708,37.241)]'),
+('Wagner St', '[(-122.1254,37.959),(-122.1245,37.952)]'),
+('Wagoner Dr', '[(-121.784,37.67),(-121.784,37.663)]'),
+('Walker Ave', '[(-122.2437,37.153),(-122.2433,37.161)]'),
+('Walker Pl', '[(-121.7692,37.537),(-121.7693,37.544)]'),
+('Wall St', '[(-121.7904,37.776),(-121.7893,37.767)]'),
+('Walnut Ave', '[(-121.9689,37.601),(-121.969899,37.59434)]'),
+('Walnut Ave', '[(-121.9804,37.471),(-121.9817,37.456)]'),
+('Walnut Ave', '[(-121.983083,37.44159),(-121.983361,37.43869)]'),
+('Walnut St', '[(-121.769,37.877),(-121.7683,37.88)]'),
+('Walnut St', '[(-121.774,37.863),(-121.7728,37.866)]'),
+('Walnut St', '[(-122.0425,37.262),(-122.0417,37.246)]'),
+('Walnut St', '[(-122.1913,37.734),(-122.1909,37.729)]'),
+('Walnut St', '[(-122.1948,37.763),(-122.1923,37.742)]'),
+('Walnut St', '[(-122.2442,37.682),(-122.2437,37.69)]'),
+('Walnut St', '[(-122.2465,37.648),(-122.2459,37.658)]'),
+('Walnut St', '[(-122.2489,37.613),(-122.2483,37.622)]'),
+('Walnut St', '[(-122.2675,37.804),(-122.2672,37.785)]'),
+('Walpert St', '[(-122.07476,37.6893),(-122.073488,37.69487)]'),
+('Warbler Loop', '[(-122.0601,37.813),(-122.0597,37.793)]'),
+('Ward St', '[(-122.2838,37.575),(-122.2827,37.575)]'),
+('Ward Creek', '[(-122.0568,37.644),(-122.058701,37.64815)]'),
+('Ward Creek', '[(-122.0717,37.679),(-122.077,37.657)]'),
+('Ward Creek Branch', '[(-122.0615,37.62),(-122.069914,37.64417)]'),
+('Warfield Ave', '[(-122.2403,37.16),(-122.2382,37.178)]'),
+('Warfield Ave', '[(-122.2404,37.153),(-122.2402,37.157)]'),
+('Warfield Ave', '[(-122.244,37.124),(-122.2435,37.13)]'),
+('Warm Springs Blvd', '[(-121.9184,37.728),(-121.9168,37.703)]'),
+('Warm Springs Blvd', '[(-121.9209,37.769),(-121.9198,37.751)]'),
+('Warm Springs Blvd', '[(-121.9258,37.851),(-121.9247,37.833)]'),
+('Warm Springs Blvd', '[(-121.933956,37),(-121.9343,37.97)]'),
+('Warner Ave', '[(-122.0249,37.096),(-122.024,37.103)]'),
+('Warner Ave', '[(-122.1579,37.477),(-122.1571,37.482)]'),
+('Warren Ave', '[(-121.9285,37.866),(-121.9302,37.859)]'),
+('Warren Ave', '[(-121.9314,37.855),(-121.933,37.849)]'),
+('Warsaw Ave', '[(-121.7714,37.623),(-121.77064,37.6268)]'),
+('Warwick Pl', '[(-122.0498,37.647),(-122.0487,37.634)]'),
+('Warwick Road', '[(-122.0279,37.791),(-122.0282,37.787)]'),
+('Warwick Road', '[(-122.029,37.777),(-122.0298,37.768)]'),
+('Wasatch Dr', '[(-121.962,37.752),(-121.9623,37.756)]'),
+('Washburn Dr', '[(-121.9877,37.739),(-121.9881,37.728)]'),
+('Washington Ave', '[(-122.1378,37.897),(-122.1379,37.891)]'),
+('Washington Ave', '[(-122.1379,37.959),(-122.1379,37.954)]'),
+('Washington Ave', '[(-122.1491,37.154),(-122.149,37.151),(-122.1485,37.144)]'),
+('Washington Ave', '[(-122.1536,37.222),(-122.1534,37.217)]'),
+('Washington Ave', '[(-122.2912,37.932),(-122.2903,37.931)]'),
+('Washington Ave', '[(-122.301,37.919),(-122.3001,37.921)]'),
+('Washington Ave', '[(-122.3033,37.9),(-122.3023,37.905)]'),
+('Washington Blvd', '[(-121.9418,37.314),(-121.9422,37.314)]'),
+('Washington Blvd', '[(-121.9512,37.335),(-121.9522,37.335)]'),
+('Washington Blvd', '[(-121.9557,37.328),(-121.9584,37.33)]'),
+('Washington St', '[(-121.8615,37.684),(-121.8596,37.694)]'),
+('Washington St', '[(-122.2355,37.537),(-122.2347,37.532)]'),
+('Washington St', '[(-122.2378,37.553),(-122.237,37.548)]'),
+('Washington St', '[(-122.2405,37.568),(-122.24,37.566)]'),
+('Washington St', '[(-122.2772,37.965),(-122.2769,37.97)]'),
+('Washo Dr', '[(-121.9213,37.117),(-121.9204,37.114)]'),
+('Waterfall Isle', '[(-122.2699,37.668),(-122.2694,37.677)]'),
+('Waterford Pl', '[(-122.0472,37.026),(-122.0473,37.021)]'),
+('Watts St', '[(-122.2805,37.28),(-122.2804,37.285)]'),
+('Waverly Way', '[(-121.7634,37.94),(-121.762632,37.94055)]'),
+('Webb Ave', '[(-122.0975,37.89),(-122.0971,37.894)]'),
+('Webster St', '[(-122.0593,37.39),(-122.0587,37.393)]'),
+('Webster St', '[(-122.2474,37.563),(-122.2461,37.562)]'),
+('Webster St', '[(-122.2595,37.33),(-122.2596,37.337)]'),
+('Webster St', '[(-122.2599,37.305),(-122.2596,37.313)]'),
+('Webster St', '[(-122.2643,37.145),(-122.2642,37.152)]'),
+('Webster St', '[(-122.2691,37.026),(-122.2687,37.033)]'),
+('Webster St', '[(-122.2703,37.005),(-122.2699,37.011)]'),
+('Webster St', '[(-122.2724,37.97),(-122.272,37.977)]'),
+('Webster St', '[(-122.2752,37.925),(-122.2746,37.936)]'),
+('Webster St', '[(-122.276,37.775),(-122.276,37.785)]'),
+('Webster St', '[(-122.276,37.809),(-122.276,37.841)]'),
+('Webster St', '[(-122.276,37.903),(-122.276,37.913)]'),
+('Welch Creek', '[(-121.8107,37.349),(-121.8012,37.397)]'),
+('Welch Creek Road', '[(-121.7695,37.386),(-121.7737,37.413)]'),
+('Welch Creek Road', '[(-121.7895,37.36),(-121.7717,37.218)]'),
+('Welch Creek Road', '[(-121.844,37.37),(-121.8289,37.315)]'),
+('Weld St', '[(-122.1827,37.64),(-122.181,37.623)]'),
+('Welk Com', '[(-122.036356,37.86914),(-122.036265,37.8618)]'),
+('Wellington Pl', '[(-122.0242,37.628),(-122.0227,37.632)]'),
+('Wente St', '[(-121.7486,37.661),(-121.7486,37.65715)]'),
+('Wentworth Ave', '[(-122.1997,37.698),(-122.1986,37.698)]'),
+('Wesley Ave', '[(-122.2457,37.068),(-122.2446,37.078)]'),
+('Wesley Ave', '[(-122.2482,37.056),(-122.2476,37.059)]'),
+('West St', '[(-122.1066,37.48),(-122.108083,37.47375)]'),
+('West St', '[(-122.2719,37.243),(-122.2717,37.251)]'),
+('West St', '[(-122.2754,37.136),(-122.2751,37.141)]'),
+('West St', '[(-122.276,37.124),(-122.2756,37.131)]'),
+('West Loop Road', '[(-122.0576,37.604),(-122.0602,37.586)]'),
+('Westbrook Pl', '[(-121.7787,37.565),(-121.7784,37.564)]'),
+('Westchester St', '[(-122.031,37.135),(-122.0293,37.136)]'),
+('Western Ave', '[(-122.1365,37.049),(-122.1358,37.044)]'),
+('Western Blvd', '[(-122.1004,37.792),(-122.0983,37.778)]'),
+('Western Blvd', '[(-122.1043,37.819),(-122.1023,37.805)]'),
+('Western Pacific Railroad', '[(-121.628112,37.31406),(-121.628315,37.31524)]'),
+('Western Pacific Railroad', '[(-121.6953,37.215),(-121.6955,37.223)]'),
+('Western Pacific Railroad', '[(-121.95686,37.6508),(-121.9548,37.598)]'),
+('Western Pacific Railroad', '[(-122.0302,37.963),(-122.0302,37.99)]'),
+('Western Pacific Railroad Spur', '[(-122.0394,37.018),(-122.0394,37.961)]'),
+('Westminster Dr', '[(-122.2409,37.406),(-122.2391,37.413)]'),
+('Westover Dr', '[(-122.1985,37.286),(-122.1959,37.302)]'),
+('Westview Pl', '[(-122.2309,37.588),(-122.2303,37.585)]'),
+('Westwood Ave', '[(-122.0079,37.454),(-122.008033,37.45)]'),
+('Westwood Pl', '[(-122.0773,37.36),(-122.078,37.362)]'),
+('Whalebone Way', '[(-122.0592,37.244),(-122.059,37.242)]'),
+('Whimbrel Road', '[(-122.0439,37.832),(-122.0432,37.828)]'),
+('Whimbrel Road', '[(-122.045,37.842),(-122.0447,37.839)]'),
+('Whipple Road', '[(-122.0532,37.059),(-122.0576,37.059)]'),
+('Whipple Road', '[(-122.0676,37.055),(-122.0678,37.057),(-122.0752,37.057)]'),
+('Whispering Pine Ct', '[(-122.06,37.222),(-122.0608,37.226)]'),
+('Whitaker Ave', '[(-122.2555,37.909),(-122.2554,37.912)]'),
+('Whitecap Way', '[(-121.991567,37.28508),(-121.99096,37.28222)]'),
+('Whitlock Creek', '[(-121.74683,37.91276),(-121.733107,37)]'),
+('Whitman St', '[(-122.0633,37.399),(-122.063,37.392)]'),
+('Whitman St', '[(-122.072,37.54),(-122.0712,37.53)]'),
+('Whitney Pl', '[(-121.9168,37.703),(-121.9188,37.695)]'),
+('Wicks Blvd', '[(-122.1596,37.856),(-122.1578,37.833)]'),
+('Wicks Blvd', '[(-122.163486,37.97094),(-122.1632,37.966),(-122.1624,37.936)]'),
+('Wilbeam Ave', '[(-122.0759,37.936),(-122.076,37.932)]'),
+('Wilbur St', '[(-122.21,37.039),(-122.2093,37.034)]'),
+('Wild Current Way', '[(-122.1987,37.395),(-122.1993,37.402)]'),
+('Wildcat Ct', '[(-121.94693,37.08767),(-121.947193,37.08295)]'),
+('Wildcat Canyon Road', '[(-122.2628,37.035),(-122.264,37.041)]'),
+('Wildcat Canyon Road', '[(-122.2658,37.046),(-122.264,37.041)]'),
+('Wildwood Ave', '[(-122.2341,37.194),(-122.2328,37.199)]'),
+('Wiley St', '[(-122.1553,37.93),(-122.1548,37.921),(-122.1546,37.916)]'),
+('Willard Way', '[(-122.0871,37.169),(-122.0843,37.177)]'),
+('Williams St', '[(-122.1568,37.179),(-122.1577,37.175)]'),
+('Williams St', '[(-122.1634,37.151),(-122.164,37.148)]'),
+('Williams St', '[(-122.1649,37.143),(-122.1655,37.141)]'),
+('Willimet Way', '[(-122.0964,37.517),(-122.0949,37.493)]'),
+('Willow Ave', '[(-122.1012,37.748),(-122.1002,37.754)]'),
+('Willow Ave', '[(-122.16,37.961),(-122.1608,37.96)]'),
+('Willow St', '[(-122.0519,37.279),(-122.0517,37.275)]'),
+('Willow St', '[(-122.2459,37.711),(-122.2453,37.72)]'),
+('Willow St', '[(-122.2494,37.661),(-122.2487,37.67)]'),
+('Willow St', '[(-122.2516,37.627),(-122.251,37.635)]'),
+('Willow St', '[(-122.2559,37.567),(-122.2551,37.58)]'),
+('Willow St', '[(-122.2913,37.184),(-122.2901,37.198),(-122.2891,37.212)]'),
+('Willow St', '[(-122.2998,37.077),(-122.2996,37.081)]'),
+('Willow Walk', '[(-122.2364,37.572),(-122.23664,37.5678)]'),
+('Willowood Dr', '[(-122.0126,37.498),(-122.0096,37.483)]'),
+('Wilson Ave', '[(-122.0751,37.073),(-122.0727,37.07)]'),
+('Wilson Cir', '[(-122.246849,37.81463),(-122.2468,37.815)]'),
+('Winding Lane', '[(-121.931438,37.07849),(-121.9306,37.078)]'),
+('Windmill Ct', '[(-121.9163,37.948),(-121.9167,37.944)]'),
+('Windmill Lane', '[(-121.8688,37.531),(-121.8678,37.532)]'),
+('Windsor Dr', '[(-122.1125,37.071),(-122.1105,37.048)]'),
+('Windsor Dr', '[(-122.2303,37.673),(-122.2289,37.665)]'),
+('Windsor Pl', '[(-121.7781,37.521),(-121.7781,37.525)]'),
+('Windsor Way', '[(-121.7772,37.521),(-121.7762,37.521)]'),
+('Wingate Way', '[(-122.0652,37.838),(-122.0643,37.846)]'),
+('Winslow Ter', '[(-122.059185,37.53928),(-122.058347,37.5363)]'),
+('Winsor Ave', '[(-122.2356,37.203),(-122.2351,37.203)]'),
+('Winthrope St', '[(-122.1559,37.694),(-122.1548,37.678)]'),
+('Winton Ave', '[(-122.1151,37.533),(-122.1165,37.532)]'),
+('Winton Ave', '[(-122.1231,37.533),(-122.1231,37.53)]'),
+('Wisconsin St', '[(-122.1927,37.945),(-122.1921,37.94)]'),
+('Wisconsin St', '[(-122.1945,37.965),(-122.1939,37.959)]'),
+('Wisconsin St', '[(-122.1994,37.017),(-122.1975,37.998),(-122.1971,37.994)]'),
+('Wistaria Way', '[(-122.2251,37.182),(-122.2249,37.188)]'),
+('Wisteria Dr', '[(-121.9362,37.373),(-121.9363,37.367)]'),
+('Wisteria Dr', '[(-121.9369,37.398),(-121.9369,37.391)]'),
+('Wisteria Way', '[(-121.7322,37.118),(-121.7332,37.114)]'),
+('Wixon Dr', '[(-121.9613,37.199),(-121.9604,37.18)]'),
+('Wolcott Dr', '[(-121.9568,37.393),(-121.9564,37.389)]'),
+('Wood Dr', '[(-122.2194,37.28),(-122.2174,37.266)]'),
+('Wood St', '[(-121.762,37.839),(-121.7611,37.834)]'),
+('Wood St', '[(-122.2993,37.107),(-122.2988,37.113)]'),
+('Wood St', '[(-122.302,37.06),(-122.3019,37.066)]'),
+('Woodcrest Dr', '[(-121.9579,37.225),(-121.9589,37.224)]'),
+('Woodhaven Way', '[(-122.208,37.417),(-122.2045,37.411)]'),
+('Woodhue Ter', '[(-122.046987,37.6207),(-122.047212,37.62529)]'),
+('Woodridge Dr', '[(-122.0631,37.836),(-122.0616,37.82)]'),
+('Woodroe Ave', '[(-122.0536,37.855),(-122.0534,37.847)]'),
+('Woodroe Ave', '[(-122.0539,37.888),(-122.054,37.891)]'),
+('Woodruff Ave', '[(-122.2214,37.03),(-122.2206,37.057)]'),
+('Woolsey St', '[(-122.2553,37.538),(-122.2545,37.538)]'),
+('Wooster Ct', '[(-122.023499,37.15118),(-122.0237,37.147)]'),
+('Worth St', '[(-122.1903,37.362),(-122.1903,37.365)]'),
+('Worth St', '[(-122.1915,37.378),(-122.1916,37.379)]'),
+('Wp Railroad', '[(-121.7675,37.848),(-121.765632,37.85375),(-121.7636,37.86)]'),
+('Wp Railroad', '[(-121.7864,37.791),(-121.7761,37.822)]'),
+('Wp Railroad', '[(-121.813721,37.75618),(-121.8049,37.765)]'),
+('Wp Railroad', '[(-121.8346,37.733),(-121.8259,37.743)]'),
+('Wp Railroad', '[(-121.874759,37.65728),(-121.8727,37.665)]'),
+('Wp Railroad', '[(-121.8804,37.27),(-121.8806,37.272),(-121.88678,37.36528)]'),
+('Wp Railroad', '[(-121.882149,37.57458),(-121.8813,37.585)]'),
+('Wp Railroad', '[(-121.8861,37.94),(-121.8847,37.952)]'),
+('Wp Railroad', '[(-121.9304,37.856),(-121.9268,37.789)]'),
+('Wp Railroad', '[(-121.958612,37.67823),(-121.9581,37.67)]'),
+('Wp Railroad', '[(-122.0223,37.959),(-122.0211,37.949)]'),
+('Wp Railroad', '[(-122.0476,37.214),(-122.0473,37.196)]'),
+('Wp Railroad', '[(-122.0755,37.589),(-122.0731,37.56)]'),
+('Wp Railroad', '[(-122.1877,37.466),(-122.1834,37.43)]'),
+('Wp Railroad', '[(-122.2043,37.608),(-122.203628,37.60237)]'),
+('Wp Railroad', '[(-122.2145,37.694),(-122.2137,37.688)]'),
+('Wp Railroad', '[(-122.2342,37.806),(-122.2295,37.777)]'),
+('Wp Railroad', '[(-122.2434,37.865),(-122.241,37.851)]'),
+('Wp Railroad', '[(-122.254,37.902),(-122.2506,37.891)]'),
+('Wp Railroad', '[(-122.262,37.923),(-122.2607,37.921)]'),
+('Wp Railroad', '[(-122.2693,37.949),(-122.2682,37.945)]'),
+('Wrenn St', '[(-122.2063,37.117),(-122.2056,37.117)]'),
+('Wyndham Pl', '[(-122.027,37.724),(-122.0286,37.73)]'),
+('Xavier Way', '[(-121.7458,37.778),(-121.7459,37.77)]'),
+('Xavier Common', '[(-122.049697,37.64509),(-122.050346,37.64313)]'),
+('Yale Ave', '[(-122.1205,37.913),(-122.1205,37.907)]'),
+('Yale Way', '[(-121.9443,37.098),(-121.9482,37.092)]'),
+('Yampa Way', '[(-121.9117,37.641),(-121.9109,37.644)]'),
+('Yellowstone Park Dr', '[(-121.9686,37.111),(-121.9705,37.117)]'),
+('Yerba Buena Ave', '[(-122.2789,37.301),(-122.2843,37.29)]'),
+('Yerba Buena Pl', '[(-121.9602,37.678),(-121.9595,37.683)]'),
+('Yerba Buena St', '[(-121.960541,37.6819),(-121.9602,37.678)]'),
+('Ygnacio Ave', '[(-122.2103,37.756),(-122.2098,37.754)]'),
+('Yolo Ave', '[(-122.274,37.85),(-122.273,37.855)]'),
+('York Dr', '[(-121.9212,37.098),(-121.9227,37.104)]'),
+('York Dr', '[(-122.2415,37.283),(-122.2406,37.261)]'),
+('Yorktown Road', '[(-121.9507,37.173),(-121.9513,37.172)]'),
+('Yosemite Pl', '[(-121.8019,37.853),(-121.8024,37.855)]'),
+('Yosemite Road', '[(-122.2767,37.968),(-122.2757,37.958)]'),
+('Yosemite Way', '[(-122.1108,37.4803),(-122.109445,37.48415)]'),
+('Zacate Ave', '[(-121.9575,37.646),(-121.9567,37.64)]'),
+('Zacate Ave', '[(-121.9594,37.662),(-121.9589,37.654)]'),
+('Zapata Ct', '[(-121.9456,37.171),(-121.94565,37.1705)]'),
+('Zapotec Dr', '[(-121.9108,37.899),(-121.9097,37.898)]'),
+('Zephyr Ave', '[(-122.0572,37.107),(-122.0556,37.107)]'),
+('Zephyr Ave', '[(-122.0584,37.107),(-122.0609,37.107)]'),
+('Ziegler Ave', '[(-122.1258,37.483),(-122.125,37.499)]'),
+('Zircon Ter', '[(-122.051254,37.64038),(-122.051126,37.63696)]'),
+('100th Ave', '[(-122.1657,37.429),(-122.1647,37.432)]'),
+('100th Ave', '[(-122.1789,37.364),(-122.1785,37.367)]'),
+('101st Ave', '[(-122.1595,37.438),(-122.1583,37.441)]'),
+('104th Ave', '[(-122.1583,37.417),(-122.1573,37.423)]'),
+('104th Ave', '[(-122.1612,37.411),(-122.1587,37.417)]'),
+('104th Ave', '[(-122.1697,37.375),(-122.1681,37.383)]'),
+('105th Ave', '[(-122.1774,37.325),(-122.1771,37.327)]'),
+('106th Ave', '[(-122.158,37.404),(-122.156,37.409)]'),
+('107th Ave', '[(-122.1555,37.403),(-122.1531,37.41)]'),
+('108th Ave', '[(-122.1474,37.419),(-122.1468,37.423)]'),
+('10th St', '[(-122.0211,37.969),(-122.0198,37.958)]'),
+('10th St', '[(-122.0603,37.402),(-122.0593,37.39)]'),
+('10th St', '[(-122.2541,37.924),(-122.2537,37.92)]'),
+('10th St', '[(-122.2553,37.935),(-122.2545,37.927)]'),
+('10th St', '[(-122.2675,37.002),(-122.2687,37.007)]'),
+('10th St', '[(-122.2886,37.57),(-122.2883,37.56)]'),
+('10th St', '[(-122.2916,37.662),(-122.291,37.644)]'),
+('10th St', '[(-122.2918,37.084),(-122.292,37.085)]'),
+('10th St', '[(-122.2945,37.75),(-122.2939,37.732)]'),
+('11th Ave', '[(-122.2493,37.91),(-122.2483,37.916)]'),
+('11th St', '[(-122.0206,37.952),(-122.0192,37.941),(-122.0185,37.934)]'),
+('120 Canal', '[(-121.587482,37.88204),(-121.587833,37.8825)]'),
+('12th Ave', '[(-122.2396,37.958),(-122.2385,37.965)]'),
+('12th St', '[(-121.896,37.194),(-121.8932,37.194)]'),
+('12th St', '[(-121.9026,37.204),(-121.900288,37.19771),(-121.896959,37.19973)]'),
+('12th St', '[(-122.2163,37.718),(-122.2151,37.712)]'),
+('12th St', '[(-122.2469,37.891),(-122.2459,37.882)]'),
+('12th St', '[(-122.2566,37.974),(-122.256,37.971)]'),
+('12th St', '[(-122.2611,37.996),(-122.262,37.998)]'),
+('12th St', '[(-122.2644,37.006),(-122.2655,37.011)]'),
+('12th St', '[(-122.2807,37.073),(-122.2796,37.068)]'),
+('12th St', '[(-122.2889,37.094),(-122.29,37.094)]'),
+('12th St', '[(-122.2926,37.103),(-122.2937,37.102)]'),
+('12th St', '[(-122.2943,37.103),(-122.2955,37.109),(-122.2964,37.113)]'),
+('136th Ave', '[(-122.1399,37.158),(-122.1371,37.18)]'),
+('137th Ave', '[(-122.1366,37.176),(-122.1351,37.18)]'),
+('13th Ave', '[(-122.235,37.984),(-122.2345,37.99)]'),
+('13th Ave', '[(-122.2396,37.944),(-122.2387,37.95)]'),
+('13th St', '[(-122.0242,37.962),(-122.0231,37.954)]'),
+('13th St', '[(-122.0565,37.386),(-122.0554,37.374)]'),
+('13th St', '[(-122.2628,37.009),(-122.2639,37.014)]'),
+('140th Ave', '[(-122.1386,37.13),(-122.1374,37.14)]'),
+('141st Ave', '[(-122.1368,37.136),(-122.1355,37.147)]'),
+('142nd Ave', '[(-122.1348,37.142),(-122.1336,37.153)]'),
+('143rd Ave', '[(-122.1408,37.077),(-122.1397,37.085)]'),
+('145th Ave', '[(-122.1368,37.082),(-122.1359,37.09)]'),
+('148th Ave', '[(-122.1284,37.119),(-122.1277,37.122)]'),
+('14th Ave', '[(-122.2244,37.028),(-122.2242,37.036)]'),
+('14th Ave', '[(-122.2245,37.036),(-122.2238,37.062)]'),
+('14th Ave', '[(-122.2285,37.981),(-122.2283,37.988)]'),
+('14th Ave', '[(-122.232,37.965),(-122.2293,37.975)]'),
+('14th Ave', '[(-122.2342,37.957),(-122.2332,37.961)]'),
+('14th Ave', '[(-122.2357,37.953),(-122.2354,37.953)]'),
+('14th Ave', '[(-122.2408,37.923),(-122.2407,37.925)]'),
+('14th Ave', '[(-122.2426,37.911),(-122.2419,37.916)]'),
+('14th St', '[(-122.0238,37.949),(-122.0226,37.938)]'),
+('14th St', '[(-122.1178,37.983),(-122.116,37.971)]'),
+('14th St', '[(-122.1212,37.007),(-122.1206,37.002)]'),
+('14th St', '[(-122.1241,37.027),(-122.1235,37.023),(-122.1226,37.017)]'),
+('14th St', '[(-122.1316,37.081),(-122.1287,37.06)]'),
+('14th St', '[(-122.1378,37.124),(-122.1376,37.123)]'),
+('14th St', '[(-122.141,37.147),(-122.1397,37.138)]'),
+('14th St', '[(-122.1457,37.181),(-122.145,37.176)]'),
+('14th St', '[(-122.1562,37.262),(-122.1557,37.253)]'),
+('14th St', '[(-122.1626,37.348),(-122.1621,37.344)]'),
+('14th St', '[(-122.1655,37.387),(-122.165101,37.38001)]'),
+('14th St', '[(-122.1682,37.422),(-122.168,37.419)]'),
+('14th St', '[(-122.1709,37.459),(-122.1704,37.453)]'),
+('14th St', '[(-122.1761,37.529),(-122.1757,37.524),(-122.1754,37.52)]'),
+('14th St', '[(-122.1771,37.544),(-122.1768,37.54)]'),
+('14th St', '[(-122.1845,37.581),(-122.1839,37.579)]'),
+('14th St', '[(-122.1945,37.629),(-122.1936,37.625)]'),
+('14th St', '[(-122.2128,37.717),(-122.2118,37.713)]'),
+('14th St', '[(-122.2288,37.798),(-122.228,37.792)]'),
+('14th St', '[(-122.2419,37.877),(-122.2408,37.871)]'),
+('14th St', '[(-122.2659,37.03),(-122.2671,37.035)]'),
+('14th St', '[(-122.2755,37.068),(-122.2741,37.063)]'),
+('14th St', '[(-122.277,37.073),(-122.2765,37.071)]'),
+('14th St', '[(-122.299,37.147),(-122.3,37.148)]'),
+('150th Ave', '[(-122.1241,37.085),(-122.123984,37.08583)]'),
+('150th Ave', '[(-122.1266,37.065),(-122.1258,37.071)]'),
+('152nd Ave', '[(-122.1218,37.072),(-122.1215,37.075)]'),
+('15th St', '[(-122.0564,37.416),(-122.056,37.411)]'),
+('15th St', '[(-122.2264,37.794),(-122.2258,37.791),(-122.2251,37.789)]'),
+('15th St', '[(-122.241,37.885),(-122.2401,37.879)]'),
+('15th St', '[(-122.2472,37.923),(-122.2464,37.915)]'),
+('15th St', '[(-122.2534,37.976),(-122.2525,37.969)]'),
+('163rd Ave', '[(-122.1108,37.985),(-122.1096,37.995)]'),
+('164th Ave', '[(-122.1068,37.993),(-122.1069,37.998)]'),
+('164th Ave', '[(-122.1101,37.964),(-122.1096,37.968)]'),
+('166th Ave', '[(-122.1008,37.99),(-122.1006,37.997)]'),
+('167th Ave', '[(-122.1012,37.966),(-122.1006,37.973)]'),
+('168th Ave', '[(-122.1046,37.934),(-122.1041,37.938)]'),
+('16th Ave', '[(-122.2391,37.924),(-122.2387,37.928)]'),
+('16th Ave', '[(-122.2422,37.892),(-122.2418,37.896)]'),
+('16th Ave', '[(-122.2438,37.874),(-122.2438,37.876)]'),
+('16th St', '[(-122.054,37.414),(-122.0534,37.405)]'),
+('16th St', '[(-122.231,37.837),(-122.2306,37.834)]'),
+('16th St', '[(-122.2699,37.067),(-122.2713,37.069)]'),
+('16th St', '[(-122.2923,37.129),(-122.2926,37.132)]'),
+('170th Ave', '[(-122.1029,37.924),(-122.1025,37.93)]'),
+('170th Ave', '[(-122.1083,37.891),(-122.1075,37.893)]'),
+('171st Ave', '[(-122.1042,37.908),(-122.1031,37.916)]'),
+('173rd Ave', '[(-122.0984,37.935),(-122.0976,37.936)]'),
+('17th Ave', '[(-122.238,37.918),(-122.2377,37.921)]'),
+('17th St', '[(-122.1947,37.648),(-122.1934,37.637)]'),
+('17th St', '[(-122.2385,37.895),(-122.2375,37.889)]'),
+('17th St', '[(-122.2514,37.99),(-122.2507,37.982)]'),
+('17th St', '[(-122.2607,37.043),(-122.2619,37.047)]'),
+('17th St', '[(-122.2642,37.057),(-122.2655,37.059)]'),
+('17th St', '[(-122.2743,37.087),(-122.2729,37.082)]'),
+('17th St', '[(-122.2898,37.132),(-122.29,37.132)]'),
+('17th St', '[(-122.2938,37.149),(-122.295,37.155)]'),
+('18th Ave', '[(-122.2385,37.895),(-122.2381,37.899)]'),
+('18th St', '[(-122.2205,37.811),(-122.219,37.806)]'),
+('18th St', '[(-122.2424,37.924),(-122.2416,37.918)]'),
+('18th St', '[(-122.2461,37.957),(-122.2453,37.95)]'),
+('18th St', '[(-122.254,37.012),(-122.2535,37.01)]'),
+('18th St', '[(-122.2775,37.106),(-122.2762,37.101)]'),
+('18th St', '[(-122.2775,37.106),(-122.2794,37.109)]'),
+('18th St', '[(-122.2803,37.116),(-122.2814,37.119)]'),
+('19th Ave', '[(-122.2355,37.91),(-122.2351,37.914),(-122.2344,37.922)]'),
+('19th Ave', '[(-122.2366,37.897),(-122.2359,37.905)]'),
+('19th Ave', '[(-122.2386,37.877),(-122.2382,37.881)]'),
+('19th Ave', '[(-122.2394,37.868),(-122.239,37.873)]'),
+('19th Ave', '[(-122.2408,37.854),(-122.2406,37.856)]'),
+('19th St', '[(-122.2488,37.994),(-122.2479,37.986)]'),
+('19th St', '[(-122.2672,37.079),(-122.2685,37.084)]'),
+('1st Ave', '[(-122.2567,37.992),(-122.2558,37.999)]'),
+('1st St', '[(-121.7401,37.018),(-121.7401,37.024)]'),
+('1st St', '[(-121.7402,37.015),(-121.7401,37.018)]'),
+('1st St', '[(-121.7425,37.976),(-121.7417,37.986)]'),
+('1st St', '[(-121.75508,37.89294),(-121.753581,37.90031)]'),
+('1st St', '[(-121.7716,37.805),(-121.7702,37.809)]'),
+('1st St', '[(-121.8728,37.596),(-121.8738,37.587)]'),
+('20th Ave', '[(-122.238,37.867),(-122.2376,37.871)]'),
+('20th St', '[(-122.2327,37.887),(-122.2308,37.876)]'),
+('20th St', '[(-122.2433,37.963),(-122.2424,37.955)]'),
+('20th St', '[(-122.2468,37.994),(-122.2459,37.985)]'),
+('20th St', '[(-122.2912,37.163),(-122.2926,37.17)]'),
+('21st Ave', '[(-122.2341,37.89),(-122.2337,37.893)]'),
+('21st Ave', '[(-122.2368,37.859),(-122.2365,37.865)]'),
+('21st Ave', '[(-122.2385,37.843),(-122.238,37.847)]'),
+('21st St', '[(-122.243,37.975),(-122.2423,37.97)]'),
+('21st St', '[(-122.2624,37.099),(-122.2643,37.102)]'),
+('21st St', '[(-122.2688,37.109),(-122.2719,37.114)]'),
+('22nd Ave', '[(-122.2343,37.871),(-122.2338,37.875)]'),
+('22nd St', '[(-122.2227,37.854),(-122.222,37.851)]'),
+('22nd St', '[(-122.265,37.114),(-122.2655,37.114)]'),
+('22nd St', '[(-122.2756,37.131),(-122.2769,37.136)]'),
+('23rd Ave', '[(-122.2272,37.914),(-122.2266,37.92)]'),
+('23rd Ave', '[(-122.2298,37.892),(-122.2298,37.894)]'),
+('23rd Ave', '[(-122.2339,37.841),(-122.233,37.849)]'),
+('23rd Ave', '[(-122.2357,37.824),(-122.2356,37.825)]'),
+('23rd Ave', '[(-122.2359,37.817),(-122.236,37.82)]'),
+('23rd St', '[(-122.2258,37.878),(-122.2252,37.875)]'),
+('23rd St', '[(-122.228,37.896),(-122.2271,37.89)]'),
+('23rd St', '[(-122.2404,37.982),(-122.2395,37.974)]'),
+('23rd St', '[(-122.2648,37.124),(-122.2658,37.125)]'),
+('23rd Av Ovps', '[(-122.2356,37.768),(-122.235,37.754)]'),
+('23rd Av Ovps', '[(-122.236,37.783),(-122.2356,37.768)]'),
+('24th Ave', '[(-122.2285,37.873),(-122.2277,37.88),(-122.2271,37.89)]'),
+('24th St', '[(-122.233,37.936),(-122.2309,37.923)]'),
+('24th St', '[(-122.2352,37.95),(-122.235,37.948)]'),
+('24th St', '[(-122.2868,37.183),(-122.2877,37.186)]'),
+('24th St', '[(-122.2901,37.198),(-122.2914,37.204)]'),
+('25th Ave', '[(-122.2222,37.94),(-122.222,37.942)]'),
+('26th Ave', '[(-122.2252,37.875),(-122.2244,37.884)]'),
+('26th St', '[(-122.2294,37.939),(-122.2289,37.936)]'),
+('26th St', '[(-122.2739,37.171),(-122.2749,37.172)]'),
+('26th St', '[(-122.2791,37.183),(-122.28,37.185)]'),
+('27th Ave', '[(-122.234,37.773),(-122.2335,37.778)]'),
+('27th St', '[(-122.2224,37.918),(-122.2216,37.912)]'),
+('27th St', '[(-122.2243,37.928),(-122.2231,37.921)]'),
+('27th St', '[(-122.2287,37.945),(-122.2278,37.939)]'),
+('27th St', '[(-122.2625,37.151),(-122.2626,37.154)]'),
+('27th St', '[(-122.2751,37.181),(-122.276,37.18)]'),
+('28th St', '[(-122.2356,37.999),(-122.235,37.994)]'),
+('28th St', '[(-122.2671,37.176),(-122.2684,37.179)]'),
+('28th St', '[(-122.2754,37.192),(-122.2764,37.193)]'),
+('29th St', '[(-122.2633,37.179),(-122.264,37.181)]'),
+('29th St', '[(-122.266,37.183),(-122.2668,37.184)]'),
+('29th St', '[(-122.2693,37.192),(-122.27,37.194)]'),
+('29th St', '[(-122.2707,37.189),(-122.2733,37.194)]'),
+('29th Av Ovps', '[(-122.2323,37.748),(-122.2321,37.752)]'),
+('2nd St', '[(-121.9787,37.76),(-121.9775,37.757)]'),
+('2nd St', '[(-121.9825,37.768),(-121.9806,37.763)]'),
+('2nd St', '[(-121.986342,37.77609),(-121.9854,37.774),(-121.9842,37.772)]'),
+('2nd St', '[(-122.0522,37.685),(-122.05205,37.6854)]'),
+('2nd St', '[(-122.0553,37.679),(-122.0539,37.682)]'),
+('2nd St', '[(-122.0697,37.696),(-122.0674,37.688)]'),
+('2nd St', '[(-122.2781,37.975),(-122.2792,37.979)]'),
+('30th St', '[(-122.2789,37.218),(-122.2801,37.22)]'),
+('31st Ave', '[(-122.2259,37.771),(-122.2254,37.779)]'),
+('31st St', '[(-122.2252,37.982),(-122.224,37.979)]'),
+('31st St', '[(-122.2323,37.995),(-122.2303,37.992)]'),
+('31st St', '[(-122.2728,37.212),(-122.2756,37.217)]'),
+('32nd St', '[(-122.225,37.99),(-122.2244,37.988)]'),
+('32nd St', '[(-122.2754,37.227),(-122.2765,37.228)]'),
+('32nd St', '[(-122.2839,37.242),(-122.285,37.239)]'),
+('32nd St', '[(-122.2893,37.23),(-122.2901,37.229)]'),
+('33rd Ave', '[(-122.2235,37.776),(-122.2225,37.798)]'),
+('34th Ave', '[(-122.2205,37.811),(-122.2196,37.829)]'),
+('34th Ave', '[(-122.2232,37.755),(-122.2225,37.765)]'),
+('34th Ave', '[(-122.2251,37.728),(-122.2246,37.737)]'),
+('34th St', '[(-122.2637,37.223),(-122.2647,37.225)]'),
+('35th Ave', '[(-122.1914,37.983),(-122.1909,37.988)]'),
+('35th Ave', '[(-122.2005,37.929),(-122.1996,37.935)]'),
+('35th Ave', '[(-122.214,37.85),(-122.2138,37.852)]'),
+('35th Ave', '[(-122.2243,37.724),(-122.2238,37.731)]'),
+('35th St', '[(-122.2685,37.243),(-122.2692,37.244)]'),
+('35th St', '[(-122.2746,37.257),(-122.2779,37.266)]'),
+('35th St', '[(-122.2783,37.266),(-122.2792,37.269)]'),
+('36th Ave', '[(-122.2196,37.778),(-122.218,37.802)]'),
+('36th Ave', '[(-122.2214,37.746),(-122.2206,37.755)]'),
+('36th Ave', '[(-122.2221,37.737),(-122.222,37.738)]'),
+('36th Ave', '[(-122.2233,37.721),(-122.223,37.725)]'),
+('36th Ave', '[(-122.22414,37.70988),(-122.2238,37.716)]'),
+('36th St', '[(-122.228,37.022),(-122.227,37.02)]'),
+('36th St', '[(-122.2779,37.273),(-122.279,37.277)]'),
+('37th Ave', '[(-122.2211,37.732),(-122.221,37.733)]'),
+('37th St', '[(-122.2613,37.249),(-122.265,37.257)]'),
+('37th St', '[(-122.265,37.26),(-122.2663,37.271)]'),
+('37th St', '[(-122.2743,37.274),(-122.2768,37.278)]'),
+('38th Ave', '[(-122.1963,37.907),(-122.1954,37.912)]'),
+('38th Ave', '[(-122.2202,37.729),(-122.2197,37.734)]'),
+('38th St', '[(-122.2204,37.029),(-122.2199,37.028)]'),
+('38th St', '[(-122.2571,37.266),(-122.2583,37.268)]'),
+('38th St', '[(-122.2587,37.268),(-122.2597,37.269)]'),
+('39th Ave', '[(-122.2054,37.85),(-122.205,37.852)]'),
+('39th Ave', '[(-122.2163,37.763),(-122.216,37.768)]'),
+('3rd St', '[(-121.892355,37.95759),(-121.8908,37.957)]'),
+('3rd St', '[(-122.2872,37.803),(-122.287191,37.8084)]'),
+('3rd St', '[(-122.2873,37.767),(-122.2873,37.775)]'),
+('3rd St', '[(-122.2874,37.739),(-122.2874,37.748)]'),
+('3rd St', '[(-122.2894,37.019),(-122.2905,37.021)]'),
+('3rd St', '[(-122.2972,37.034),(-122.2982,37.036)]'),
+('40th Ave', '[(-122.2156,37.76),(-122.2152,37.764)]'),
+('40th St', '[(-122.2585,37.286),(-122.2594,37.288)]'),
+('41st Ave', '[(-122.214,37.75),(-122.2135,37.756)]'),
+('41st Ave', '[(-122.2153,37.735),(-122.2151,37.738)]'),
+('41st Ave', '[(-122.217,37.719),(-122.2169,37.721)]'),
+('41st St', '[(-122.2562,37.29),(-122.2571,37.291)]'),
+('41st St', '[(-122.2655,37.305),(-122.2653,37.314)]'),
+('41st St', '[(-122.2671,37.308),(-122.2677,37.308)]'),
+('41st St', '[(-122.2768,37.324),(-122.2773,37.325)]'),
+('42nd Ave', '[(-122.2104,37.767),(-122.2097,37.773)]'),
+('42nd St', '[(-122.2755,37.33),(-122.2765,37.332)]'),
+('43rd St', '[(-122.2673,37.325),(-122.2698,37.329)]'),
+('43rd St', '[(-122.2763,37.338),(-122.2768,37.339)]'),
+('45th Ave', '[(-122.2088,37.749),(-122.208,37.758)]'),
+('45th Ave', '[(-122.2118,37.713),(-122.2109,37.724)]'),
+('45th St', '[(-122.2814,37.341),(-122.2825,37.339)]'),
+('46th Ave', '[(-122.214,37.685),(-122.2137,37.688)]'),
+('46th St', '[(-122.2669,37.345),(-122.2694,37.349)]'),
+('47th Ave', '[(-122.2086,37.719),(-122.2082,37.723)]'),
+('48th Ave', '[(-122.2059,37.736),(-122.2052,37.745)]'),
+('48th St', '[(-122.2633,37.354),(-122.2643,37.356)]'),
+('48th St', '[(-122.2782,37.373),(-122.2782,37.37224)]'),
+('49th St', '[(-122.2545,37.348),(-122.2552,37.349)]'),
+('4th Ave', '[(-122.2534,37.976),(-122.2524,37.983)]'),
+('4th St', '[(-121.7778,37.76),(-121.7753,37.769),(-121.7741,37.772)]'),
+('4th St', '[(-122.0775,37.831),(-122.0772,37.824)]'),
+('4th St', '[(-122.2773,37.988),(-122.2784,37.993)]'),
+('4th St', '[(-122.2853,37.738),(-122.2854,37.742)]'),
+('4th St', '[(-122.3005,37.885),(-122.3006,37.871)]'),
+('50th Ave', '[(-122.2059,37.718),(-122.2054,37.724)]'),
+('50th Ave', '[(-122.2108,37.663),(-122.2096,37.675)]'),
+('50th Ave', '[(-122.2135,37.638),(-122.2123,37.65)]'),
+('51st Ave', '[(-122.2103,37.658),(-122.21,37.661)]'),
+('52nd Ave', '[(-122.2096,37.653),(-122.2092,37.657)]'),
+('52nd St', '[(-122.268,37.376),(-122.2683,37.376)]'),
+('52nd St', '[(-122.2706,37.372),(-122.2728,37.369)]'),
+('53rd Ave', '[(-122.2075,37.659),(-122.205,37.679)]'),
+('54th Ave', '[(-122.2076,37.649),(-122.2068,37.654)]'),
+('54th St', '[(-122.2733,37.386),(-122.275,37.384)]'),
+('55th Ave', '[(-122.1886,37.768),(-122.1883,37.77)]'),
+('55th Ave', '[(-122.197,37.709),(-122.1963,37.714)]'),
+('55th Ave', '[(-122.1996,37.689),(-122.1991,37.695)]'),
+('55th St', '[(-122.2641,37.408),(-122.2667,37.404)]'),
+('55th St', '[(-122.2824,37.386),(-122.2834,37.384)]'),
+('56th St', '[(-122.2692,37.409),(-122.2695,37.409)]'),
+('56th St', '[(-122.2735,37.404),(-122.2743,37.403)]'),
+('57th Ave', '[(-122.1933,37.711),(-122.1928,37.721)]'),
+('57th Ave', '[(-122.1969,37.686),(-122.1964,37.689)]'),
+('57th St', '[(-122.2609,37.433),(-122.262,37.435)]'),
+('57th St', '[(-122.2661,37.428),(-122.2671,37.426)]'),
+('57th St', '[(-122.274,37.418),(-122.2759,37.417)]'),
+('57th St', '[(-122.2798,37.409),(-122.2822,37.405)]'),
+('58th Ave', '[(-122.1876,37.749),(-122.1867,37.755)]'),
+('58th St', '[(-122.2663,37.437),(-122.2673,37.435)]'),
+('58th St', '[(-122.2701,37.437),(-122.272,37.435)]'),
+('59th St', '[(-122.2587,37.456),(-122.2608,37.454)]'),
+('59th St', '[(-122.2665,37.445),(-122.2675,37.445)]'),
+('59th St', '[(-122.2863,37.42),(-122.2872,37.418)]'),
+('5th Ave', '[(-122.2516,37.975),(-122.2507,37.982)]'),
+('5th St', '[(-121.7638,37.795),(-121.7633,37.795)]'),
+('5th St', '[(-121.7713,37.772),(-121.7701,37.775)]'),
+('5th St', '[(-121.7737,37.765),(-121.7727,37.769)]'),
+('5th St', '[(-121.7766,37.757),(-121.7751,37.761)]'),
+('5th St', '[(-121.9082,37.114),(-121.9045,37.113)]'),
+('5th St', '[(-122.0235,37.054),(-122.0224,37.045)]'),
+('5th St', '[(-122.071,37.754),(-122.0707,37.749)]');
+
+INSERT INTO road VALUES
+('5th St', '[(-122.0732,37.8),(-122.0725,37.789)]'),
+('5th St', '[(-122.2732,37.981),(-122.2744,37.986)]'),
+('5th St', '[(-122.2756,37.991),(-122.2768,37.995)]'),
+('5th St', '[(-122.278,37),(-122.2792,37.005),(-122.2803,37.009)]'),
+('5th St', '[(-122.2815,37.766),(-122.2814,37.777)]'),
+('5th St', '[(-122.2816,37.747),(-122.2816,37.757)]'),
+('5th St', '[(-122.2901,37.036),(-122.292,37.04)]'),
+('5th St', '[(-122.2933,37.041),(-122.2946,37.045)]'),
+('5th St', '[(-122.296,37.615),(-122.2953,37.598)]'),
+('5th St', '[(-122.2977,37.665),(-122.2972,37.651),(-122.2966,37.633)]'),
+('5th St', '[(-122.2979,37.866),(-122.2979,37.87)]'),
+('5th St', '[(-122.3011,37.775),(-122.3008,37.763)]'),
+('60th Ave', '[(-122.1881,37.712),(-122.1868,37.722)]'),
+('60th St', '[(-122.2606,37.469),(-122.2615,37.466)]'),
+('60th St', '[(-122.2816,37.435),(-122.2831,37.432)]'),
+('61st Ave', '[(-122.1973,37.643),(-122.1962,37.65)]'),
+('61st St', '[(-122.2861,37.436),(-122.2877,37.433)]'),
+('62nd Ave', '[(-122.1794,37.751),(-122.1787,37.755)]'),
+('62nd Ave', '[(-122.1916,37.67),(-122.1911,37.673)]'),
+('62nd Ave', '[(-122.1992,37.617),(-122.1982,37.623)]'),
+('62nd St', '[(-122.254,37.494),(-122.2563,37.491)]'),
+('62nd St', '[(-122.268,37.477),(-122.2685,37.476)]'),
+('62nd St', '[(-122.2755,37.466),(-122.2749,37.467)]'),
+('62nd St', '[(-122.2761,37.465),(-122.276639,37.4632),(-122.2767,37.463)]'),
+('63rd Ave', '[(-122.1853,37.7),(-122.1844,37.706)]'),
+('63rd St', '[(-122.2563,37.495),(-122.2576,37.493),(-122.2596,37.49)]'),
+('63rd St', '[(-122.2604,37.49),(-122.2621,37.487)]'),
+('63rd St', '[(-122.2622,37.492),(-122.2651,37.489)]'),
+('63rd St', '[(-122.2708,37.481),(-122.269,37.484)]'),
+('64th Ave', '[(-122.1758,37.76),(-122.1753,37.767)]'),
+('64th Ave', '[(-122.188,37.673),(-122.1852,37.691)]'),
+('64th Ave', '[(-122.1921,37.645),(-122.1911,37.652)]'),
+('64th St', '[(-122.2869,37.46),(-122.2884,37.455)]'),
+('64th St', '[(-122.2945,37.441),(-122.2962,37.439)]'),
+('64th Av Pl', '[(-122.1784,37.734),(-122.1767,37.744)]'),
+('65th St', '[(-122.2653,37.505),(-122.2661,37.504)]'),
+('65th St', '[(-122.2847,37.481),(-122.2874,37.476)]'),
+('66th Ave', '[(-122.2013,37.556),(-122.1997,37.564)]'),
+('66th Ave', '[(-122.2054,37.542),(-122.2042,37.546)]'),
+('67th St', '[(-122.2828,37.504),(-122.283232,37.5031)]'),
+('67th St', '[(-122.28407,37.50135),(-122.2852,37.499)]'),
+('67th St', '[(-122.2887,37.495),(-122.2913,37.49)]'),
+('69th Ave', '[(-122.1927,37.582),(-122.1919,37.587)]'),
+('69th Ave', '[(-122.1959,37.56),(-122.1954,37.563)]'),
+('6th St', '[(-121.7634,37.785),(-121.7624,37.789)]'),
+('6th St', '[(-122.0219,37.032),(-122.0208,37.022)]'),
+('6th St', '[(-122.2691,37.975),(-122.2704,37.98)]'),
+('6th St', '[(-122.274,37.993),(-122.2752,37.998)]'),
+('6th St', '[(-122.2965,37.668),(-122.296,37.653)]'),
+('6th St', '[(-122.2982,37.724),(-122.2977,37.705)]'),
+('6th St', '[(-122.3012,37.813),(-122.3006,37.795)]'),
+('6th St', '[(-122.3016,37.831),(-122.3016,37.826)]'),
+('70 Canal', '[(-121.576176,37.91958),(-121.57645,37.91996)]'),
+('70th Ave', '[(-122.187,37.611),(-122.1862,37.616)]'),
+('71st Ave', '[(-122.1908,37.576),(-122.189,37.588)]'),
+('71st Ave', '[(-122.195,37.548),(-122.1944,37.553)]'),
+('73rd Ave', '[(-122.1746,37.664),(-122.1724,37.68)]'),
+('73rd Ave', '[(-122.1768,37.651),(-122.1761,37.655)]'),
+('73rd Ave', '[(-122.1802,37.628),(-122.1794,37.633)]'),
+('73rd Ave', '[(-122.1837,37.606),(-122.1829,37.611)]'),
+('73rd Ave', '[(-122.1915,37.554),(-122.1897,37.565)]'),
+('74th Ave', '[(-122.175,37.653),(-122.174,37.66)]'),
+('77th Ave', '[(-122.17,37.656),(-122.1682,37.668)]'),
+('78th Ave', '[(-122.1697,37.652),(-122.1674,37.663)]'),
+('78th Ave', '[(-122.1791,37.593),(-122.1784,37.597)]'),
+('79th Ave', '[(-122.1686,37.639),(-122.1662,37.65)]'),
+('7th Ave', '[(-122.2413,37.015),(-122.2406,37.021)]'),
+('7th Ave', '[(-122.2459,37.985),(-122.2449,37.991)]'),
+('7th Ave', '[(-122.2528,37.94),(-122.2518,37.947)]'),
+('7th St', '[(-121.7606,37.79),(-121.7597,37.798)]'),
+('7th St', '[(-121.7618,37.779),(-121.7615,37.783)]'),
+('7th St', '[(-122.0047,37.916),(-122.0041,37.92)]'),
+('7th St', '[(-122.0168,37.978),(-122.0149,37.974)]'),
+('7th St', '[(-122.0674,37.771),(-122.0667,37.761)]'),
+('7th St', '[(-122.0693,37.803),(-122.0687,37.793)]'),
+('7th St', '[(-122.2362,37.753),(-122.235,37.754)]'),
+('7th St', '[(-122.2759,37.009),(-122.2771,37.014)]'),
+('7th St', '[(-122.2864,37.041),(-122.2875,37.043)]'),
+('7th St', '[(-122.2903,37.511),(-122.2902,37.508)]'),
+('7th St', '[(-122.2916,37.052),(-122.2926,37.055)]'),
+('7th St', '[(-122.2918,37.562),(-122.2916,37.553)]'),
+('7th St', '[(-122.2945,37.635),(-122.2938,37.62)]'),
+('7th St', '[(-122.2996,37.797),(-122.299,37.779),(-122.2985,37.767)]'),
+('7th St', '[(-122.3215,37.099),(-122.326,37.102)]'),
+('80th Ave', '[(-122.1807,37.563),(-122.1793,37.57)]'),
+('81st Ave', '[(-122.1912,37.493),(-122.191,37.495)]'),
+('82nd Ave', '[(-122.1659,37.614),(-122.1653,37.619)]'),
+('82nd Ave', '[(-122.1695,37.596),(-122.1681,37.603)]'),
+('82nd Ave', '[(-122.1764,37.562),(-122.1747,37.57)]'),
+('83rd Ave', '[(-122.1741,37.563),(-122.1724,37.571)]'),
+('83rd Ave', '[(-122.1799,37.531),(-122.179,37.535)]'),
+('84th Ave', '[(-122.1683,37.58),(-122.1665,37.589)]'),
+('85th Ave', '[(-122.1677,37.573),(-122.166,37.581)]'),
+('85th Ave', '[(-122.173,37.548),(-122.1713,37.556)]'),
+('85th Ave', '[(-122.1763,37.533),(-122.1748,37.54)]'),
+('85th Ave', '[(-122.1877,37.466),(-122.186,37.476)]'),
+('87th Ave', '[(-122.1646,37.561),(-122.1643,37.563)]'),
+('87th Ave', '[(-122.1698,37.536),(-122.1681,37.544)]'),
+('87th Ave', '[(-122.1834,37.474),(-122.1814,37.484)]'),
+('88th Ave', '[(-122.1728,37.514),(-122.1711,37.521)]'),
+('89th Ave', '[(-122.1822,37.459),(-122.1803,37.471)]'),
+('8th Ave', '[(-122.2489,37.952),(-122.248,37.958)]'),
+('8th St', '[(-121.9083,37.161),(-121.9081,37.16)]'),
+('8th St', '[(-122.2459,37.882),(-122.2456,37.879)]'),
+('8th St', '[(-122.2546,37.914),(-122.2533,37.909)]'),
+('8th St', '[(-122.2572,37.935),(-122.256523,37.92898)]'),
+('8th St', '[(-122.2755,37.017),(-122.2766,37.022)]'),
+('8th St', '[(-122.2955,37.709),(-122.2952,37.698)]'),
+('8th St', '[(-122.296,37.748),(-122.296,37.733)]'),
+('8th St', '[(-122.2969,37.751),(-122.2967,37.746)]'),
+('90th Ave', '[(-122.1769,37.477),(-122.1753,37.485)]'),
+('90th Ave', '[(-122.1798,37.464),(-122.1785,37.47)]'),
+('92nd Ave', '[(-122.1759,37.464),(-122.1742,37.472)]'),
+('94th Ave', '[(-122.1714,37.466),(-122.1704,37.472)]'),
+('96th Ave', '[(-122.1621,37.493),(-122.161,37.498)]'),
+('98th Ave', '[(-122.1568,37.498),(-122.1558,37.502)]'),
+('98th Ave', '[(-122.1693,37.438),(-122.1682,37.444)]'),
+('98th Ave', '[(-122.1767,37.401),(-122.1758,37.408)]'),
+('98th Ave', '[(-122.1783,37.388),(-122.1773,37.396)]'),
+('98th Ave', '[(-122.1791,37.382),(-122.1788,37.384)]'),
+('98th Ave', '[(-122.1914,37.294),(-122.1904,37.298)]'),
+('98th Ave', '[(-122.2001,37.258),(-122.1974,37.27)]'),
+('99th Av Ct', '[(-122.1698,37.427),(-122.1694,37.422)]'),
+('9th Ave', '[(-122.2491,37.938),(-122.248,37.945)]'),
+('9th Ave', '[(-122.2516,37.922),(-122.2511,37.925)]'),
+('9th St', '[(-122.2349,37.779),(-122.234,37.773)]'),
+('9th St', '[(-122.27,37.725),(-122.27,37.734)]'),
+('9th St', '[(-122.2899,37.576),(-122.2897,37.567)]');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/stud_emp.sql b/yql/essentials/tests/postgresql/initscripts/stud_emp.sql
new file mode 100644
index 0000000000..413b1db9a3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/stud_emp.sql
@@ -0,0 +1,15 @@
+CREATE TABLE stud_emp (
+ name text,
+ age int4,
+ --location point,
+ salary int4,
+ manager name,
+ gpa float8,
+ percent int4
+);
+
+INSERT INTO stud_emp VALUES
+('jeff', 23, /*(8,7.7),*/ 600, 'sharon', 3.50000000000000000e+00, null),
+('cim', 30, /*(10.5,4.7),*/ 400, null, 3.39999999999999990e+00, null),
+('linda', 19, /*(0.9,6.1),*/ 100, null, 2.89999999999999990e+00, null);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/student.sql b/yql/essentials/tests/postgresql/initscripts/student.sql
new file mode 100644
index 0000000000..4f4b2efdd6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/student.sql
@@ -0,0 +1,11 @@
+CREATE TABLE student (
+ name text,
+ age int4,
+ --location point,
+ gpa float8
+);
+
+INSERT INTO student VALUES
+('fred', 28, /*(3.1,-1.5), */ 3.70000000000000020e+00),
+('larry', 60, /*(21.8,4.9), */ 3.10000000000000010e+00);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/tenk1.sql b/yql/essentials/tests/postgresql/initscripts/tenk1.sql
new file mode 100644
index 0000000000..cf780e02e6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/tenk1.sql
@@ -0,0 +1,10039 @@
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+INSERT INTO tenk1 VALUES
+(8800, 0, 0, 0, 0, 0, 0, 800, 800, 3800, 8800, 0, 1, 'MAAAAA', 'AAAAAA', 'AAAAxx'),
+(1891, 1, 1, 3, 1, 11, 91, 891, 1891, 1891, 1891, 182, 183, 'TUAAAA', 'BAAAAA', 'HHHHxx'),
+(3420, 2, 0, 0, 0, 0, 20, 420, 1420, 3420, 3420, 40, 41, 'OBAAAA', 'CAAAAA', 'OOOOxx'),
+(9850, 3, 0, 2, 0, 10, 50, 850, 1850, 4850, 9850, 100, 101, 'WOAAAA', 'DAAAAA', 'VVVVxx'),
+(7164, 4, 0, 0, 4, 4, 64, 164, 1164, 2164, 7164, 128, 129, 'OPAAAA', 'EAAAAA', 'AAAAxx'),
+(8009, 5, 1, 1, 9, 9, 9, 9, 9, 3009, 8009, 18, 19, 'BWAAAA', 'FAAAAA', 'HHHHxx'),
+(5057, 6, 1, 1, 7, 17, 57, 57, 1057, 57, 5057, 114, 115, 'NMAAAA', 'GAAAAA', 'OOOOxx'),
+(6701, 7, 1, 1, 1, 1, 1, 701, 701, 1701, 6701, 2, 3, 'TXAAAA', 'HAAAAA', 'VVVVxx'),
+(4321, 8, 1, 1, 1, 1, 21, 321, 321, 4321, 4321, 42, 43, 'FKAAAA', 'IAAAAA', 'AAAAxx'),
+(3043, 9, 1, 3, 3, 3, 43, 43, 1043, 3043, 3043, 86, 87, 'BNAAAA', 'JAAAAA', 'HHHHxx'),
+(1314, 10, 0, 2, 4, 14, 14, 314, 1314, 1314, 1314, 28, 29, 'OYAAAA', 'KAAAAA', 'OOOOxx'),
+(1504, 11, 0, 0, 4, 4, 4, 504, 1504, 1504, 1504, 8, 9, 'WFAAAA', 'LAAAAA', 'VVVVxx'),
+(5222, 12, 0, 2, 2, 2, 22, 222, 1222, 222, 5222, 44, 45, 'WSAAAA', 'MAAAAA', 'AAAAxx'),
+(6243, 13, 1, 3, 3, 3, 43, 243, 243, 1243, 6243, 86, 87, 'DGAAAA', 'NAAAAA', 'HHHHxx'),
+(5471, 14, 1, 3, 1, 11, 71, 471, 1471, 471, 5471, 142, 143, 'LCAAAA', 'OAAAAA', 'OOOOxx'),
+(5006, 15, 0, 2, 6, 6, 6, 6, 1006, 6, 5006, 12, 13, 'OKAAAA', 'PAAAAA', 'VVVVxx'),
+(5387, 16, 1, 3, 7, 7, 87, 387, 1387, 387, 5387, 174, 175, 'FZAAAA', 'QAAAAA', 'AAAAxx'),
+(5785, 17, 1, 1, 5, 5, 85, 785, 1785, 785, 5785, 170, 171, 'NOAAAA', 'RAAAAA', 'HHHHxx'),
+(6621, 18, 1, 1, 1, 1, 21, 621, 621, 1621, 6621, 42, 43, 'RUAAAA', 'SAAAAA', 'OOOOxx'),
+(6969, 19, 1, 1, 9, 9, 69, 969, 969, 1969, 6969, 138, 139, 'BIAAAA', 'TAAAAA', 'VVVVxx'),
+(9460, 20, 0, 0, 0, 0, 60, 460, 1460, 4460, 9460, 120, 121, 'WZAAAA', 'UAAAAA', 'AAAAxx'),
+(59, 21, 1, 3, 9, 19, 59, 59, 59, 59, 59, 118, 119, 'HCAAAA', 'VAAAAA', 'HHHHxx'),
+(8020, 22, 0, 0, 0, 0, 20, 20, 20, 3020, 8020, 40, 41, 'MWAAAA', 'WAAAAA', 'OOOOxx'),
+(7695, 23, 1, 3, 5, 15, 95, 695, 1695, 2695, 7695, 190, 191, 'ZJAAAA', 'XAAAAA', 'VVVVxx'),
+(3442, 24, 0, 2, 2, 2, 42, 442, 1442, 3442, 3442, 84, 85, 'KCAAAA', 'YAAAAA', 'AAAAxx'),
+(5119, 25, 1, 3, 9, 19, 19, 119, 1119, 119, 5119, 38, 39, 'XOAAAA', 'ZAAAAA', 'HHHHxx'),
+(646, 26, 0, 2, 6, 6, 46, 646, 646, 646, 646, 92, 93, 'WYAAAA', 'ABAAAA', 'OOOOxx'),
+(9605, 27, 1, 1, 5, 5, 5, 605, 1605, 4605, 9605, 10, 11, 'LFAAAA', 'BBAAAA', 'VVVVxx'),
+(263, 28, 1, 3, 3, 3, 63, 263, 263, 263, 263, 126, 127, 'DKAAAA', 'CBAAAA', 'AAAAxx'),
+(3269, 29, 1, 1, 9, 9, 69, 269, 1269, 3269, 3269, 138, 139, 'TVAAAA', 'DBAAAA', 'HHHHxx'),
+(1839, 30, 1, 3, 9, 19, 39, 839, 1839, 1839, 1839, 78, 79, 'TSAAAA', 'EBAAAA', 'OOOOxx'),
+(9144, 31, 0, 0, 4, 4, 44, 144, 1144, 4144, 9144, 88, 89, 'SNAAAA', 'FBAAAA', 'VVVVxx'),
+(2513, 32, 1, 1, 3, 13, 13, 513, 513, 2513, 2513, 26, 27, 'RSAAAA', 'GBAAAA', 'AAAAxx'),
+(8850, 33, 0, 2, 0, 10, 50, 850, 850, 3850, 8850, 100, 101, 'KCAAAA', 'HBAAAA', 'HHHHxx'),
+(236, 34, 0, 0, 6, 16, 36, 236, 236, 236, 236, 72, 73, 'CJAAAA', 'IBAAAA', 'OOOOxx'),
+(3162, 35, 0, 2, 2, 2, 62, 162, 1162, 3162, 3162, 124, 125, 'QRAAAA', 'JBAAAA', 'VVVVxx'),
+(4380, 36, 0, 0, 0, 0, 80, 380, 380, 4380, 4380, 160, 161, 'MMAAAA', 'KBAAAA', 'AAAAxx'),
+(8095, 37, 1, 3, 5, 15, 95, 95, 95, 3095, 8095, 190, 191, 'JZAAAA', 'LBAAAA', 'HHHHxx'),
+(209, 38, 1, 1, 9, 9, 9, 209, 209, 209, 209, 18, 19, 'BIAAAA', 'MBAAAA', 'OOOOxx'),
+(3055, 39, 1, 3, 5, 15, 55, 55, 1055, 3055, 3055, 110, 111, 'NNAAAA', 'NBAAAA', 'VVVVxx'),
+(6921, 40, 1, 1, 1, 1, 21, 921, 921, 1921, 6921, 42, 43, 'FGAAAA', 'OBAAAA', 'AAAAxx'),
+(7046, 41, 0, 2, 6, 6, 46, 46, 1046, 2046, 7046, 92, 93, 'ALAAAA', 'PBAAAA', 'HHHHxx'),
+(7912, 42, 0, 0, 2, 12, 12, 912, 1912, 2912, 7912, 24, 25, 'ISAAAA', 'QBAAAA', 'OOOOxx'),
+(7267, 43, 1, 3, 7, 7, 67, 267, 1267, 2267, 7267, 134, 135, 'NTAAAA', 'RBAAAA', 'VVVVxx'),
+(3599, 44, 1, 3, 9, 19, 99, 599, 1599, 3599, 3599, 198, 199, 'LIAAAA', 'SBAAAA', 'AAAAxx'),
+(923, 45, 1, 3, 3, 3, 23, 923, 923, 923, 923, 46, 47, 'NJAAAA', 'TBAAAA', 'HHHHxx'),
+(1437, 46, 1, 1, 7, 17, 37, 437, 1437, 1437, 1437, 74, 75, 'HDAAAA', 'UBAAAA', 'OOOOxx'),
+(6439, 47, 1, 3, 9, 19, 39, 439, 439, 1439, 6439, 78, 79, 'RNAAAA', 'VBAAAA', 'VVVVxx'),
+(6989, 48, 1, 1, 9, 9, 89, 989, 989, 1989, 6989, 178, 179, 'VIAAAA', 'WBAAAA', 'AAAAxx'),
+(8798, 49, 0, 2, 8, 18, 98, 798, 798, 3798, 8798, 196, 197, 'KAAAAA', 'XBAAAA', 'HHHHxx'),
+(5960, 50, 0, 0, 0, 0, 60, 960, 1960, 960, 5960, 120, 121, 'GVAAAA', 'YBAAAA', 'OOOOxx'),
+(5832, 51, 0, 0, 2, 12, 32, 832, 1832, 832, 5832, 64, 65, 'IQAAAA', 'ZBAAAA', 'VVVVxx'),
+(6066, 52, 0, 2, 6, 6, 66, 66, 66, 1066, 6066, 132, 133, 'IZAAAA', 'ACAAAA', 'AAAAxx'),
+(322, 53, 0, 2, 2, 2, 22, 322, 322, 322, 322, 44, 45, 'KMAAAA', 'BCAAAA', 'HHHHxx'),
+(8321, 54, 1, 1, 1, 1, 21, 321, 321, 3321, 8321, 42, 43, 'BIAAAA', 'CCAAAA', 'OOOOxx'),
+(734, 55, 0, 2, 4, 14, 34, 734, 734, 734, 734, 68, 69, 'GCAAAA', 'DCAAAA', 'VVVVxx'),
+(688, 56, 0, 0, 8, 8, 88, 688, 688, 688, 688, 176, 177, 'MAAAAA', 'ECAAAA', 'AAAAxx'),
+(4212, 57, 0, 0, 2, 12, 12, 212, 212, 4212, 4212, 24, 25, 'AGAAAA', 'FCAAAA', 'HHHHxx'),
+(9653, 58, 1, 1, 3, 13, 53, 653, 1653, 4653, 9653, 106, 107, 'HHAAAA', 'GCAAAA', 'OOOOxx'),
+(2677, 59, 1, 1, 7, 17, 77, 677, 677, 2677, 2677, 154, 155, 'ZYAAAA', 'HCAAAA', 'VVVVxx'),
+(5423, 60, 1, 3, 3, 3, 23, 423, 1423, 423, 5423, 46, 47, 'PAAAAA', 'ICAAAA', 'AAAAxx'),
+(2592, 61, 0, 0, 2, 12, 92, 592, 592, 2592, 2592, 184, 185, 'SVAAAA', 'JCAAAA', 'HHHHxx'),
+(3233, 62, 1, 1, 3, 13, 33, 233, 1233, 3233, 3233, 66, 67, 'JUAAAA', 'KCAAAA', 'OOOOxx'),
+(5032, 63, 0, 0, 2, 12, 32, 32, 1032, 32, 5032, 64, 65, 'OLAAAA', 'LCAAAA', 'VVVVxx'),
+(2525, 64, 1, 1, 5, 5, 25, 525, 525, 2525, 2525, 50, 51, 'DTAAAA', 'MCAAAA', 'AAAAxx'),
+(4450, 65, 0, 2, 0, 10, 50, 450, 450, 4450, 4450, 100, 101, 'EPAAAA', 'NCAAAA', 'HHHHxx'),
+(5778, 66, 0, 2, 8, 18, 78, 778, 1778, 778, 5778, 156, 157, 'GOAAAA', 'OCAAAA', 'OOOOxx'),
+(5852, 67, 0, 0, 2, 12, 52, 852, 1852, 852, 5852, 104, 105, 'CRAAAA', 'PCAAAA', 'VVVVxx'),
+(5404, 68, 0, 0, 4, 4, 4, 404, 1404, 404, 5404, 8, 9, 'WZAAAA', 'QCAAAA', 'AAAAxx'),
+(6223, 69, 1, 3, 3, 3, 23, 223, 223, 1223, 6223, 46, 47, 'JFAAAA', 'RCAAAA', 'HHHHxx'),
+(6133, 70, 1, 1, 3, 13, 33, 133, 133, 1133, 6133, 66, 67, 'XBAAAA', 'SCAAAA', 'OOOOxx'),
+(9112, 71, 0, 0, 2, 12, 12, 112, 1112, 4112, 9112, 24, 25, 'MMAAAA', 'TCAAAA', 'VVVVxx'),
+(7575, 72, 1, 3, 5, 15, 75, 575, 1575, 2575, 7575, 150, 151, 'JFAAAA', 'UCAAAA', 'AAAAxx'),
+(7414, 73, 0, 2, 4, 14, 14, 414, 1414, 2414, 7414, 28, 29, 'EZAAAA', 'VCAAAA', 'HHHHxx'),
+(9741, 74, 1, 1, 1, 1, 41, 741, 1741, 4741, 9741, 82, 83, 'RKAAAA', 'WCAAAA', 'OOOOxx'),
+(3767, 75, 1, 3, 7, 7, 67, 767, 1767, 3767, 3767, 134, 135, 'XOAAAA', 'XCAAAA', 'VVVVxx'),
+(9372, 76, 0, 0, 2, 12, 72, 372, 1372, 4372, 9372, 144, 145, 'MWAAAA', 'YCAAAA', 'AAAAxx'),
+(8976, 77, 0, 0, 6, 16, 76, 976, 976, 3976, 8976, 152, 153, 'GHAAAA', 'ZCAAAA', 'HHHHxx'),
+(4071, 78, 1, 3, 1, 11, 71, 71, 71, 4071, 4071, 142, 143, 'PAAAAA', 'ADAAAA', 'OOOOxx'),
+(1311, 79, 1, 3, 1, 11, 11, 311, 1311, 1311, 1311, 22, 23, 'LYAAAA', 'BDAAAA', 'VVVVxx'),
+(2604, 80, 0, 0, 4, 4, 4, 604, 604, 2604, 2604, 8, 9, 'EWAAAA', 'CDAAAA', 'AAAAxx'),
+(8840, 81, 0, 0, 0, 0, 40, 840, 840, 3840, 8840, 80, 81, 'ACAAAA', 'DDAAAA', 'HHHHxx'),
+(567, 82, 1, 3, 7, 7, 67, 567, 567, 567, 567, 134, 135, 'VVAAAA', 'EDAAAA', 'OOOOxx'),
+(5215, 83, 1, 3, 5, 15, 15, 215, 1215, 215, 5215, 30, 31, 'PSAAAA', 'FDAAAA', 'VVVVxx'),
+(5474, 84, 0, 2, 4, 14, 74, 474, 1474, 474, 5474, 148, 149, 'OCAAAA', 'GDAAAA', 'AAAAxx'),
+(3906, 85, 0, 2, 6, 6, 6, 906, 1906, 3906, 3906, 12, 13, 'GUAAAA', 'HDAAAA', 'HHHHxx'),
+(1769, 86, 1, 1, 9, 9, 69, 769, 1769, 1769, 1769, 138, 139, 'BQAAAA', 'IDAAAA', 'OOOOxx'),
+(1454, 87, 0, 2, 4, 14, 54, 454, 1454, 1454, 1454, 108, 109, 'YDAAAA', 'JDAAAA', 'VVVVxx'),
+(6877, 88, 1, 1, 7, 17, 77, 877, 877, 1877, 6877, 154, 155, 'NEAAAA', 'KDAAAA', 'AAAAxx'),
+(6501, 89, 1, 1, 1, 1, 1, 501, 501, 1501, 6501, 2, 3, 'BQAAAA', 'LDAAAA', 'HHHHxx'),
+(934, 90, 0, 2, 4, 14, 34, 934, 934, 934, 934, 68, 69, 'YJAAAA', 'MDAAAA', 'OOOOxx'),
+(4075, 91, 1, 3, 5, 15, 75, 75, 75, 4075, 4075, 150, 151, 'TAAAAA', 'NDAAAA', 'VVVVxx'),
+(3180, 92, 0, 0, 0, 0, 80, 180, 1180, 3180, 3180, 160, 161, 'ISAAAA', 'ODAAAA', 'AAAAxx'),
+(7787, 93, 1, 3, 7, 7, 87, 787, 1787, 2787, 7787, 174, 175, 'NNAAAA', 'PDAAAA', 'HHHHxx'),
+(6401, 94, 1, 1, 1, 1, 1, 401, 401, 1401, 6401, 2, 3, 'FMAAAA', 'QDAAAA', 'OOOOxx'),
+(4244, 95, 0, 0, 4, 4, 44, 244, 244, 4244, 4244, 88, 89, 'GHAAAA', 'RDAAAA', 'VVVVxx'),
+(4591, 96, 1, 3, 1, 11, 91, 591, 591, 4591, 4591, 182, 183, 'PUAAAA', 'SDAAAA', 'AAAAxx'),
+(4113, 97, 1, 1, 3, 13, 13, 113, 113, 4113, 4113, 26, 27, 'FCAAAA', 'TDAAAA', 'HHHHxx'),
+(5925, 98, 1, 1, 5, 5, 25, 925, 1925, 925, 5925, 50, 51, 'XTAAAA', 'UDAAAA', 'OOOOxx'),
+(1987, 99, 1, 3, 7, 7, 87, 987, 1987, 1987, 1987, 174, 175, 'LYAAAA', 'VDAAAA', 'VVVVxx'),
+(8248, 100, 0, 0, 8, 8, 48, 248, 248, 3248, 8248, 96, 97, 'GFAAAA', 'WDAAAA', 'AAAAxx'),
+(4151, 101, 1, 3, 1, 11, 51, 151, 151, 4151, 4151, 102, 103, 'RDAAAA', 'XDAAAA', 'HHHHxx'),
+(8670, 102, 0, 2, 0, 10, 70, 670, 670, 3670, 8670, 140, 141, 'MVAAAA', 'YDAAAA', 'OOOOxx'),
+(6194, 103, 0, 2, 4, 14, 94, 194, 194, 1194, 6194, 188, 189, 'GEAAAA', 'ZDAAAA', 'VVVVxx'),
+(88, 104, 0, 0, 8, 8, 88, 88, 88, 88, 88, 176, 177, 'KDAAAA', 'AEAAAA', 'AAAAxx'),
+(4058, 105, 0, 2, 8, 18, 58, 58, 58, 4058, 4058, 116, 117, 'CAAAAA', 'BEAAAA', 'HHHHxx'),
+(2742, 106, 0, 2, 2, 2, 42, 742, 742, 2742, 2742, 84, 85, 'MBAAAA', 'CEAAAA', 'OOOOxx'),
+(8275, 107, 1, 3, 5, 15, 75, 275, 275, 3275, 8275, 150, 151, 'HGAAAA', 'DEAAAA', 'VVVVxx'),
+(4258, 108, 0, 2, 8, 18, 58, 258, 258, 4258, 4258, 116, 117, 'UHAAAA', 'EEAAAA', 'AAAAxx'),
+(6129, 109, 1, 1, 9, 9, 29, 129, 129, 1129, 6129, 58, 59, 'TBAAAA', 'FEAAAA', 'HHHHxx'),
+(7243, 110, 1, 3, 3, 3, 43, 243, 1243, 2243, 7243, 86, 87, 'PSAAAA', 'GEAAAA', 'OOOOxx'),
+(2392, 111, 0, 0, 2, 12, 92, 392, 392, 2392, 2392, 184, 185, 'AOAAAA', 'HEAAAA', 'VVVVxx'),
+(9853, 112, 1, 1, 3, 13, 53, 853, 1853, 4853, 9853, 106, 107, 'ZOAAAA', 'IEAAAA', 'AAAAxx'),
+(6064, 113, 0, 0, 4, 4, 64, 64, 64, 1064, 6064, 128, 129, 'GZAAAA', 'JEAAAA', 'HHHHxx'),
+(4391, 114, 1, 3, 1, 11, 91, 391, 391, 4391, 4391, 182, 183, 'XMAAAA', 'KEAAAA', 'OOOOxx'),
+(726, 115, 0, 2, 6, 6, 26, 726, 726, 726, 726, 52, 53, 'YBAAAA', 'LEAAAA', 'VVVVxx'),
+(6957, 116, 1, 1, 7, 17, 57, 957, 957, 1957, 6957, 114, 115, 'PHAAAA', 'MEAAAA', 'AAAAxx'),
+(3853, 117, 1, 1, 3, 13, 53, 853, 1853, 3853, 3853, 106, 107, 'FSAAAA', 'NEAAAA', 'HHHHxx'),
+(4524, 118, 0, 0, 4, 4, 24, 524, 524, 4524, 4524, 48, 49, 'ASAAAA', 'OEAAAA', 'OOOOxx'),
+(5330, 119, 0, 2, 0, 10, 30, 330, 1330, 330, 5330, 60, 61, 'AXAAAA', 'PEAAAA', 'VVVVxx'),
+(6671, 120, 1, 3, 1, 11, 71, 671, 671, 1671, 6671, 142, 143, 'PWAAAA', 'QEAAAA', 'AAAAxx'),
+(5314, 121, 0, 2, 4, 14, 14, 314, 1314, 314, 5314, 28, 29, 'KWAAAA', 'REAAAA', 'HHHHxx'),
+(9202, 122, 0, 2, 2, 2, 2, 202, 1202, 4202, 9202, 4, 5, 'YPAAAA', 'SEAAAA', 'OOOOxx'),
+(4596, 123, 0, 0, 6, 16, 96, 596, 596, 4596, 4596, 192, 193, 'UUAAAA', 'TEAAAA', 'VVVVxx'),
+(8951, 124, 1, 3, 1, 11, 51, 951, 951, 3951, 8951, 102, 103, 'HGAAAA', 'UEAAAA', 'AAAAxx'),
+(9902, 125, 0, 2, 2, 2, 2, 902, 1902, 4902, 9902, 4, 5, 'WQAAAA', 'VEAAAA', 'HHHHxx'),
+(1440, 126, 0, 0, 0, 0, 40, 440, 1440, 1440, 1440, 80, 81, 'KDAAAA', 'WEAAAA', 'OOOOxx'),
+(5339, 127, 1, 3, 9, 19, 39, 339, 1339, 339, 5339, 78, 79, 'JXAAAA', 'XEAAAA', 'VVVVxx'),
+(3371, 128, 1, 3, 1, 11, 71, 371, 1371, 3371, 3371, 142, 143, 'RZAAAA', 'YEAAAA', 'AAAAxx'),
+(4467, 129, 1, 3, 7, 7, 67, 467, 467, 4467, 4467, 134, 135, 'VPAAAA', 'ZEAAAA', 'HHHHxx'),
+(6216, 130, 0, 0, 6, 16, 16, 216, 216, 1216, 6216, 32, 33, 'CFAAAA', 'AFAAAA', 'OOOOxx'),
+(5364, 131, 0, 0, 4, 4, 64, 364, 1364, 364, 5364, 128, 129, 'IYAAAA', 'BFAAAA', 'VVVVxx'),
+(7547, 132, 1, 3, 7, 7, 47, 547, 1547, 2547, 7547, 94, 95, 'HEAAAA', 'CFAAAA', 'AAAAxx'),
+(4338, 133, 0, 2, 8, 18, 38, 338, 338, 4338, 4338, 76, 77, 'WKAAAA', 'DFAAAA', 'HHHHxx'),
+(3481, 134, 1, 1, 1, 1, 81, 481, 1481, 3481, 3481, 162, 163, 'XDAAAA', 'EFAAAA', 'OOOOxx'),
+(826, 135, 0, 2, 6, 6, 26, 826, 826, 826, 826, 52, 53, 'UFAAAA', 'FFAAAA', 'VVVVxx'),
+(3647, 136, 1, 3, 7, 7, 47, 647, 1647, 3647, 3647, 94, 95, 'HKAAAA', 'GFAAAA', 'AAAAxx'),
+(3337, 137, 1, 1, 7, 17, 37, 337, 1337, 3337, 3337, 74, 75, 'JYAAAA', 'HFAAAA', 'HHHHxx'),
+(3591, 138, 1, 3, 1, 11, 91, 591, 1591, 3591, 3591, 182, 183, 'DIAAAA', 'IFAAAA', 'OOOOxx'),
+(7192, 139, 0, 0, 2, 12, 92, 192, 1192, 2192, 7192, 184, 185, 'QQAAAA', 'JFAAAA', 'VVVVxx'),
+(1078, 140, 0, 2, 8, 18, 78, 78, 1078, 1078, 1078, 156, 157, 'MPAAAA', 'KFAAAA', 'AAAAxx'),
+(1310, 141, 0, 2, 0, 10, 10, 310, 1310, 1310, 1310, 20, 21, 'KYAAAA', 'LFAAAA', 'HHHHxx'),
+(9642, 142, 0, 2, 2, 2, 42, 642, 1642, 4642, 9642, 84, 85, 'WGAAAA', 'MFAAAA', 'OOOOxx'),
+(39, 143, 1, 3, 9, 19, 39, 39, 39, 39, 39, 78, 79, 'NBAAAA', 'NFAAAA', 'VVVVxx'),
+(8682, 144, 0, 2, 2, 2, 82, 682, 682, 3682, 8682, 164, 165, 'YVAAAA', 'OFAAAA', 'AAAAxx'),
+(1794, 145, 0, 2, 4, 14, 94, 794, 1794, 1794, 1794, 188, 189, 'ARAAAA', 'PFAAAA', 'HHHHxx'),
+(5630, 146, 0, 2, 0, 10, 30, 630, 1630, 630, 5630, 60, 61, 'OIAAAA', 'QFAAAA', 'OOOOxx'),
+(6748, 147, 0, 0, 8, 8, 48, 748, 748, 1748, 6748, 96, 97, 'OZAAAA', 'RFAAAA', 'VVVVxx'),
+(3766, 148, 0, 2, 6, 6, 66, 766, 1766, 3766, 3766, 132, 133, 'WOAAAA', 'SFAAAA', 'AAAAxx'),
+(6403, 149, 1, 3, 3, 3, 3, 403, 403, 1403, 6403, 6, 7, 'HMAAAA', 'TFAAAA', 'HHHHxx'),
+(175, 150, 1, 3, 5, 15, 75, 175, 175, 175, 175, 150, 151, 'TGAAAA', 'UFAAAA', 'OOOOxx'),
+(2179, 151, 1, 3, 9, 19, 79, 179, 179, 2179, 2179, 158, 159, 'VFAAAA', 'VFAAAA', 'VVVVxx'),
+(7897, 152, 1, 1, 7, 17, 97, 897, 1897, 2897, 7897, 194, 195, 'TRAAAA', 'WFAAAA', 'AAAAxx'),
+(2760, 153, 0, 0, 0, 0, 60, 760, 760, 2760, 2760, 120, 121, 'ECAAAA', 'XFAAAA', 'HHHHxx'),
+(1675, 154, 1, 3, 5, 15, 75, 675, 1675, 1675, 1675, 150, 151, 'LMAAAA', 'YFAAAA', 'OOOOxx'),
+(2564, 155, 0, 0, 4, 4, 64, 564, 564, 2564, 2564, 128, 129, 'QUAAAA', 'ZFAAAA', 'VVVVxx'),
+(157, 156, 1, 1, 7, 17, 57, 157, 157, 157, 157, 114, 115, 'BGAAAA', 'AGAAAA', 'AAAAxx'),
+(8779, 157, 1, 3, 9, 19, 79, 779, 779, 3779, 8779, 158, 159, 'RZAAAA', 'BGAAAA', 'HHHHxx'),
+(9591, 158, 1, 3, 1, 11, 91, 591, 1591, 4591, 9591, 182, 183, 'XEAAAA', 'CGAAAA', 'OOOOxx'),
+(8732, 159, 0, 0, 2, 12, 32, 732, 732, 3732, 8732, 64, 65, 'WXAAAA', 'DGAAAA', 'VVVVxx'),
+(139, 160, 1, 3, 9, 19, 39, 139, 139, 139, 139, 78, 79, 'JFAAAA', 'EGAAAA', 'AAAAxx'),
+(5372, 161, 0, 0, 2, 12, 72, 372, 1372, 372, 5372, 144, 145, 'QYAAAA', 'FGAAAA', 'HHHHxx'),
+(1278, 162, 0, 2, 8, 18, 78, 278, 1278, 1278, 1278, 156, 157, 'EXAAAA', 'GGAAAA', 'OOOOxx'),
+(4697, 163, 1, 1, 7, 17, 97, 697, 697, 4697, 4697, 194, 195, 'RYAAAA', 'HGAAAA', 'VVVVxx'),
+(8610, 164, 0, 2, 0, 10, 10, 610, 610, 3610, 8610, 20, 21, 'ETAAAA', 'IGAAAA', 'AAAAxx'),
+(8180, 165, 0, 0, 0, 0, 80, 180, 180, 3180, 8180, 160, 161, 'QCAAAA', 'JGAAAA', 'HHHHxx'),
+(2399, 166, 1, 3, 9, 19, 99, 399, 399, 2399, 2399, 198, 199, 'HOAAAA', 'KGAAAA', 'OOOOxx'),
+(615, 167, 1, 3, 5, 15, 15, 615, 615, 615, 615, 30, 31, 'RXAAAA', 'LGAAAA', 'VVVVxx'),
+(7629, 168, 1, 1, 9, 9, 29, 629, 1629, 2629, 7629, 58, 59, 'LHAAAA', 'MGAAAA', 'AAAAxx'),
+(7628, 169, 0, 0, 8, 8, 28, 628, 1628, 2628, 7628, 56, 57, 'KHAAAA', 'NGAAAA', 'HHHHxx'),
+(4659, 170, 1, 3, 9, 19, 59, 659, 659, 4659, 4659, 118, 119, 'FXAAAA', 'OGAAAA', 'OOOOxx'),
+(5865, 171, 1, 1, 5, 5, 65, 865, 1865, 865, 5865, 130, 131, 'PRAAAA', 'PGAAAA', 'VVVVxx'),
+(3973, 172, 1, 1, 3, 13, 73, 973, 1973, 3973, 3973, 146, 147, 'VWAAAA', 'QGAAAA', 'AAAAxx'),
+(552, 173, 0, 0, 2, 12, 52, 552, 552, 552, 552, 104, 105, 'GVAAAA', 'RGAAAA', 'HHHHxx'),
+(708, 174, 0, 0, 8, 8, 8, 708, 708, 708, 708, 16, 17, 'GBAAAA', 'SGAAAA', 'OOOOxx'),
+(3550, 175, 0, 2, 0, 10, 50, 550, 1550, 3550, 3550, 100, 101, 'OGAAAA', 'TGAAAA', 'VVVVxx'),
+(5547, 176, 1, 3, 7, 7, 47, 547, 1547, 547, 5547, 94, 95, 'JFAAAA', 'UGAAAA', 'AAAAxx'),
+(489, 177, 1, 1, 9, 9, 89, 489, 489, 489, 489, 178, 179, 'VSAAAA', 'VGAAAA', 'HHHHxx'),
+(3794, 178, 0, 2, 4, 14, 94, 794, 1794, 3794, 3794, 188, 189, 'YPAAAA', 'WGAAAA', 'OOOOxx'),
+(9479, 179, 1, 3, 9, 19, 79, 479, 1479, 4479, 9479, 158, 159, 'PAAAAA', 'XGAAAA', 'VVVVxx'),
+(6435, 180, 1, 3, 5, 15, 35, 435, 435, 1435, 6435, 70, 71, 'NNAAAA', 'YGAAAA', 'AAAAxx'),
+(5120, 181, 0, 0, 0, 0, 20, 120, 1120, 120, 5120, 40, 41, 'YOAAAA', 'ZGAAAA', 'HHHHxx'),
+(3615, 182, 1, 3, 5, 15, 15, 615, 1615, 3615, 3615, 30, 31, 'BJAAAA', 'AHAAAA', 'OOOOxx'),
+(8399, 183, 1, 3, 9, 19, 99, 399, 399, 3399, 8399, 198, 199, 'BLAAAA', 'BHAAAA', 'VVVVxx'),
+(2155, 184, 1, 3, 5, 15, 55, 155, 155, 2155, 2155, 110, 111, 'XEAAAA', 'CHAAAA', 'AAAAxx'),
+(6690, 185, 0, 2, 0, 10, 90, 690, 690, 1690, 6690, 180, 181, 'IXAAAA', 'DHAAAA', 'HHHHxx'),
+(1683, 186, 1, 3, 3, 3, 83, 683, 1683, 1683, 1683, 166, 167, 'TMAAAA', 'EHAAAA', 'OOOOxx'),
+(6302, 187, 0, 2, 2, 2, 2, 302, 302, 1302, 6302, 4, 5, 'KIAAAA', 'FHAAAA', 'VVVVxx'),
+(516, 188, 0, 0, 6, 16, 16, 516, 516, 516, 516, 32, 33, 'WTAAAA', 'GHAAAA', 'AAAAxx'),
+(3901, 189, 1, 1, 1, 1, 1, 901, 1901, 3901, 3901, 2, 3, 'BUAAAA', 'HHAAAA', 'HHHHxx'),
+(6938, 190, 0, 2, 8, 18, 38, 938, 938, 1938, 6938, 76, 77, 'WGAAAA', 'IHAAAA', 'OOOOxx'),
+(7484, 191, 0, 0, 4, 4, 84, 484, 1484, 2484, 7484, 168, 169, 'WBAAAA', 'JHAAAA', 'VVVVxx'),
+(7424, 192, 0, 0, 4, 4, 24, 424, 1424, 2424, 7424, 48, 49, 'OZAAAA', 'KHAAAA', 'AAAAxx'),
+(9410, 193, 0, 2, 0, 10, 10, 410, 1410, 4410, 9410, 20, 21, 'YXAAAA', 'LHAAAA', 'HHHHxx'),
+(1714, 194, 0, 2, 4, 14, 14, 714, 1714, 1714, 1714, 28, 29, 'YNAAAA', 'MHAAAA', 'OOOOxx'),
+(8278, 195, 0, 2, 8, 18, 78, 278, 278, 3278, 8278, 156, 157, 'KGAAAA', 'NHAAAA', 'VVVVxx'),
+(3158, 196, 0, 2, 8, 18, 58, 158, 1158, 3158, 3158, 116, 117, 'MRAAAA', 'OHAAAA', 'AAAAxx'),
+(2511, 197, 1, 3, 1, 11, 11, 511, 511, 2511, 2511, 22, 23, 'PSAAAA', 'PHAAAA', 'HHHHxx'),
+(2912, 198, 0, 0, 2, 12, 12, 912, 912, 2912, 2912, 24, 25, 'AIAAAA', 'QHAAAA', 'OOOOxx'),
+(2648, 199, 0, 0, 8, 8, 48, 648, 648, 2648, 2648, 96, 97, 'WXAAAA', 'RHAAAA', 'VVVVxx'),
+(9385, 200, 1, 1, 5, 5, 85, 385, 1385, 4385, 9385, 170, 171, 'ZWAAAA', 'SHAAAA', 'AAAAxx'),
+(7545, 201, 1, 1, 5, 5, 45, 545, 1545, 2545, 7545, 90, 91, 'FEAAAA', 'THAAAA', 'HHHHxx'),
+(8407, 202, 1, 3, 7, 7, 7, 407, 407, 3407, 8407, 14, 15, 'JLAAAA', 'UHAAAA', 'OOOOxx'),
+(5893, 203, 1, 1, 3, 13, 93, 893, 1893, 893, 5893, 186, 187, 'RSAAAA', 'VHAAAA', 'VVVVxx'),
+(7049, 204, 1, 1, 9, 9, 49, 49, 1049, 2049, 7049, 98, 99, 'DLAAAA', 'WHAAAA', 'AAAAxx'),
+(6812, 205, 0, 0, 2, 12, 12, 812, 812, 1812, 6812, 24, 25, 'ACAAAA', 'XHAAAA', 'HHHHxx'),
+(3649, 206, 1, 1, 9, 9, 49, 649, 1649, 3649, 3649, 98, 99, 'JKAAAA', 'YHAAAA', 'OOOOxx'),
+(9275, 207, 1, 3, 5, 15, 75, 275, 1275, 4275, 9275, 150, 151, 'TSAAAA', 'ZHAAAA', 'VVVVxx'),
+(1179, 208, 1, 3, 9, 19, 79, 179, 1179, 1179, 1179, 158, 159, 'JTAAAA', 'AIAAAA', 'AAAAxx'),
+(969, 209, 1, 1, 9, 9, 69, 969, 969, 969, 969, 138, 139, 'HLAAAA', 'BIAAAA', 'HHHHxx'),
+(7920, 210, 0, 0, 0, 0, 20, 920, 1920, 2920, 7920, 40, 41, 'QSAAAA', 'CIAAAA', 'OOOOxx'),
+(998, 211, 0, 2, 8, 18, 98, 998, 998, 998, 998, 196, 197, 'KMAAAA', 'DIAAAA', 'VVVVxx'),
+(3958, 212, 0, 2, 8, 18, 58, 958, 1958, 3958, 3958, 116, 117, 'GWAAAA', 'EIAAAA', 'AAAAxx'),
+(6052, 213, 0, 0, 2, 12, 52, 52, 52, 1052, 6052, 104, 105, 'UYAAAA', 'FIAAAA', 'HHHHxx'),
+(8791, 214, 1, 3, 1, 11, 91, 791, 791, 3791, 8791, 182, 183, 'DAAAAA', 'GIAAAA', 'OOOOxx'),
+(5191, 215, 1, 3, 1, 11, 91, 191, 1191, 191, 5191, 182, 183, 'RRAAAA', 'HIAAAA', 'VVVVxx'),
+(4267, 216, 1, 3, 7, 7, 67, 267, 267, 4267, 4267, 134, 135, 'DIAAAA', 'IIAAAA', 'AAAAxx'),
+(2829, 217, 1, 1, 9, 9, 29, 829, 829, 2829, 2829, 58, 59, 'VEAAAA', 'JIAAAA', 'HHHHxx'),
+(6396, 218, 0, 0, 6, 16, 96, 396, 396, 1396, 6396, 192, 193, 'AMAAAA', 'KIAAAA', 'OOOOxx'),
+(9413, 219, 1, 1, 3, 13, 13, 413, 1413, 4413, 9413, 26, 27, 'BYAAAA', 'LIAAAA', 'VVVVxx'),
+(614, 220, 0, 2, 4, 14, 14, 614, 614, 614, 614, 28, 29, 'QXAAAA', 'MIAAAA', 'AAAAxx'),
+(4660, 221, 0, 0, 0, 0, 60, 660, 660, 4660, 4660, 120, 121, 'GXAAAA', 'NIAAAA', 'HHHHxx'),
+(8834, 222, 0, 2, 4, 14, 34, 834, 834, 3834, 8834, 68, 69, 'UBAAAA', 'OIAAAA', 'OOOOxx'),
+(2767, 223, 1, 3, 7, 7, 67, 767, 767, 2767, 2767, 134, 135, 'LCAAAA', 'PIAAAA', 'VVVVxx'),
+(2444, 224, 0, 0, 4, 4, 44, 444, 444, 2444, 2444, 88, 89, 'AQAAAA', 'QIAAAA', 'AAAAxx'),
+(4129, 225, 1, 1, 9, 9, 29, 129, 129, 4129, 4129, 58, 59, 'VCAAAA', 'RIAAAA', 'HHHHxx'),
+(3394, 226, 0, 2, 4, 14, 94, 394, 1394, 3394, 3394, 188, 189, 'OAAAAA', 'SIAAAA', 'OOOOxx'),
+(2705, 227, 1, 1, 5, 5, 5, 705, 705, 2705, 2705, 10, 11, 'BAAAAA', 'TIAAAA', 'VVVVxx'),
+(8499, 228, 1, 3, 9, 19, 99, 499, 499, 3499, 8499, 198, 199, 'XOAAAA', 'UIAAAA', 'AAAAxx'),
+(8852, 229, 0, 0, 2, 12, 52, 852, 852, 3852, 8852, 104, 105, 'MCAAAA', 'VIAAAA', 'HHHHxx'),
+(6174, 230, 0, 2, 4, 14, 74, 174, 174, 1174, 6174, 148, 149, 'MDAAAA', 'WIAAAA', 'OOOOxx'),
+(750, 231, 0, 2, 0, 10, 50, 750, 750, 750, 750, 100, 101, 'WCAAAA', 'XIAAAA', 'VVVVxx'),
+(8164, 232, 0, 0, 4, 4, 64, 164, 164, 3164, 8164, 128, 129, 'ACAAAA', 'YIAAAA', 'AAAAxx'),
+(4930, 233, 0, 2, 0, 10, 30, 930, 930, 4930, 4930, 60, 61, 'QHAAAA', 'ZIAAAA', 'HHHHxx'),
+(9904, 234, 0, 0, 4, 4, 4, 904, 1904, 4904, 9904, 8, 9, 'YQAAAA', 'AJAAAA', 'OOOOxx'),
+(7378, 235, 0, 2, 8, 18, 78, 378, 1378, 2378, 7378, 156, 157, 'UXAAAA', 'BJAAAA', 'VVVVxx'),
+(2927, 236, 1, 3, 7, 7, 27, 927, 927, 2927, 2927, 54, 55, 'PIAAAA', 'CJAAAA', 'AAAAxx'),
+(7155, 237, 1, 3, 5, 15, 55, 155, 1155, 2155, 7155, 110, 111, 'FPAAAA', 'DJAAAA', 'HHHHxx'),
+(1302, 238, 0, 2, 2, 2, 2, 302, 1302, 1302, 1302, 4, 5, 'CYAAAA', 'EJAAAA', 'OOOOxx'),
+(5904, 239, 0, 0, 4, 4, 4, 904, 1904, 904, 5904, 8, 9, 'CTAAAA', 'FJAAAA', 'VVVVxx'),
+(9687, 240, 1, 3, 7, 7, 87, 687, 1687, 4687, 9687, 174, 175, 'PIAAAA', 'GJAAAA', 'AAAAxx'),
+(3553, 241, 1, 1, 3, 13, 53, 553, 1553, 3553, 3553, 106, 107, 'RGAAAA', 'HJAAAA', 'HHHHxx'),
+(4447, 242, 1, 3, 7, 7, 47, 447, 447, 4447, 4447, 94, 95, 'BPAAAA', 'IJAAAA', 'OOOOxx'),
+(6878, 243, 0, 2, 8, 18, 78, 878, 878, 1878, 6878, 156, 157, 'OEAAAA', 'JJAAAA', 'VVVVxx'),
+(9470, 244, 0, 2, 0, 10, 70, 470, 1470, 4470, 9470, 140, 141, 'GAAAAA', 'KJAAAA', 'AAAAxx'),
+(9735, 245, 1, 3, 5, 15, 35, 735, 1735, 4735, 9735, 70, 71, 'LKAAAA', 'LJAAAA', 'HHHHxx'),
+(5967, 246, 1, 3, 7, 7, 67, 967, 1967, 967, 5967, 134, 135, 'NVAAAA', 'MJAAAA', 'OOOOxx'),
+(6601, 247, 1, 1, 1, 1, 1, 601, 601, 1601, 6601, 2, 3, 'XTAAAA', 'NJAAAA', 'VVVVxx'),
+(7631, 248, 1, 3, 1, 11, 31, 631, 1631, 2631, 7631, 62, 63, 'NHAAAA', 'OJAAAA', 'AAAAxx'),
+(3559, 249, 1, 3, 9, 19, 59, 559, 1559, 3559, 3559, 118, 119, 'XGAAAA', 'PJAAAA', 'HHHHxx'),
+(2247, 250, 1, 3, 7, 7, 47, 247, 247, 2247, 2247, 94, 95, 'LIAAAA', 'QJAAAA', 'OOOOxx'),
+(9649, 251, 1, 1, 9, 9, 49, 649, 1649, 4649, 9649, 98, 99, 'DHAAAA', 'RJAAAA', 'VVVVxx'),
+(808, 252, 0, 0, 8, 8, 8, 808, 808, 808, 808, 16, 17, 'CFAAAA', 'SJAAAA', 'AAAAxx'),
+(240, 253, 0, 0, 0, 0, 40, 240, 240, 240, 240, 80, 81, 'GJAAAA', 'TJAAAA', 'HHHHxx'),
+(5031, 254, 1, 3, 1, 11, 31, 31, 1031, 31, 5031, 62, 63, 'NLAAAA', 'UJAAAA', 'OOOOxx'),
+(9563, 255, 1, 3, 3, 3, 63, 563, 1563, 4563, 9563, 126, 127, 'VDAAAA', 'VJAAAA', 'VVVVxx'),
+(5656, 256, 0, 0, 6, 16, 56, 656, 1656, 656, 5656, 112, 113, 'OJAAAA', 'WJAAAA', 'AAAAxx'),
+(3886, 257, 0, 2, 6, 6, 86, 886, 1886, 3886, 3886, 172, 173, 'MTAAAA', 'XJAAAA', 'HHHHxx'),
+(2431, 258, 1, 3, 1, 11, 31, 431, 431, 2431, 2431, 62, 63, 'NPAAAA', 'YJAAAA', 'OOOOxx'),
+(5560, 259, 0, 0, 0, 0, 60, 560, 1560, 560, 5560, 120, 121, 'WFAAAA', 'ZJAAAA', 'VVVVxx'),
+(9065, 260, 1, 1, 5, 5, 65, 65, 1065, 4065, 9065, 130, 131, 'RKAAAA', 'AKAAAA', 'AAAAxx'),
+(8130, 261, 0, 2, 0, 10, 30, 130, 130, 3130, 8130, 60, 61, 'SAAAAA', 'BKAAAA', 'HHHHxx'),
+(4054, 262, 0, 2, 4, 14, 54, 54, 54, 4054, 4054, 108, 109, 'YZAAAA', 'CKAAAA', 'OOOOxx'),
+(873, 263, 1, 1, 3, 13, 73, 873, 873, 873, 873, 146, 147, 'PHAAAA', 'DKAAAA', 'VVVVxx'),
+(3092, 264, 0, 0, 2, 12, 92, 92, 1092, 3092, 3092, 184, 185, 'YOAAAA', 'EKAAAA', 'AAAAxx'),
+(6697, 265, 1, 1, 7, 17, 97, 697, 697, 1697, 6697, 194, 195, 'PXAAAA', 'FKAAAA', 'HHHHxx'),
+(2452, 266, 0, 0, 2, 12, 52, 452, 452, 2452, 2452, 104, 105, 'IQAAAA', 'GKAAAA', 'OOOOxx'),
+(7867, 267, 1, 3, 7, 7, 67, 867, 1867, 2867, 7867, 134, 135, 'PQAAAA', 'HKAAAA', 'VVVVxx'),
+(3753, 268, 1, 1, 3, 13, 53, 753, 1753, 3753, 3753, 106, 107, 'JOAAAA', 'IKAAAA', 'AAAAxx'),
+(7834, 269, 0, 2, 4, 14, 34, 834, 1834, 2834, 7834, 68, 69, 'IPAAAA', 'JKAAAA', 'HHHHxx'),
+(5846, 270, 0, 2, 6, 6, 46, 846, 1846, 846, 5846, 92, 93, 'WQAAAA', 'KKAAAA', 'OOOOxx'),
+(7604, 271, 0, 0, 4, 4, 4, 604, 1604, 2604, 7604, 8, 9, 'MGAAAA', 'LKAAAA', 'VVVVxx'),
+(3452, 272, 0, 0, 2, 12, 52, 452, 1452, 3452, 3452, 104, 105, 'UCAAAA', 'MKAAAA', 'AAAAxx'),
+(4788, 273, 0, 0, 8, 8, 88, 788, 788, 4788, 4788, 176, 177, 'ECAAAA', 'NKAAAA', 'HHHHxx'),
+(8600, 274, 0, 0, 0, 0, 0, 600, 600, 3600, 8600, 0, 1, 'USAAAA', 'OKAAAA', 'OOOOxx'),
+(8511, 275, 1, 3, 1, 11, 11, 511, 511, 3511, 8511, 22, 23, 'JPAAAA', 'PKAAAA', 'VVVVxx'),
+(4452, 276, 0, 0, 2, 12, 52, 452, 452, 4452, 4452, 104, 105, 'GPAAAA', 'QKAAAA', 'AAAAxx'),
+(1709, 277, 1, 1, 9, 9, 9, 709, 1709, 1709, 1709, 18, 19, 'TNAAAA', 'RKAAAA', 'HHHHxx'),
+(3440, 278, 0, 0, 0, 0, 40, 440, 1440, 3440, 3440, 80, 81, 'ICAAAA', 'SKAAAA', 'OOOOxx'),
+(9188, 279, 0, 0, 8, 8, 88, 188, 1188, 4188, 9188, 176, 177, 'KPAAAA', 'TKAAAA', 'VVVVxx'),
+(3058, 280, 0, 2, 8, 18, 58, 58, 1058, 3058, 3058, 116, 117, 'QNAAAA', 'UKAAAA', 'AAAAxx'),
+(5821, 281, 1, 1, 1, 1, 21, 821, 1821, 821, 5821, 42, 43, 'XPAAAA', 'VKAAAA', 'HHHHxx'),
+(3428, 282, 0, 0, 8, 8, 28, 428, 1428, 3428, 3428, 56, 57, 'WBAAAA', 'WKAAAA', 'OOOOxx'),
+(3581, 283, 1, 1, 1, 1, 81, 581, 1581, 3581, 3581, 162, 163, 'THAAAA', 'XKAAAA', 'VVVVxx'),
+(7523, 284, 1, 3, 3, 3, 23, 523, 1523, 2523, 7523, 46, 47, 'JDAAAA', 'YKAAAA', 'AAAAxx'),
+(3131, 285, 1, 3, 1, 11, 31, 131, 1131, 3131, 3131, 62, 63, 'LQAAAA', 'ZKAAAA', 'HHHHxx'),
+(2404, 286, 0, 0, 4, 4, 4, 404, 404, 2404, 2404, 8, 9, 'MOAAAA', 'ALAAAA', 'OOOOxx'),
+(5453, 287, 1, 1, 3, 13, 53, 453, 1453, 453, 5453, 106, 107, 'TBAAAA', 'BLAAAA', 'VVVVxx'),
+(1599, 288, 1, 3, 9, 19, 99, 599, 1599, 1599, 1599, 198, 199, 'NJAAAA', 'CLAAAA', 'AAAAxx'),
+(7081, 289, 1, 1, 1, 1, 81, 81, 1081, 2081, 7081, 162, 163, 'JMAAAA', 'DLAAAA', 'HHHHxx'),
+(1750, 290, 0, 2, 0, 10, 50, 750, 1750, 1750, 1750, 100, 101, 'IPAAAA', 'ELAAAA', 'OOOOxx'),
+(5085, 291, 1, 1, 5, 5, 85, 85, 1085, 85, 5085, 170, 171, 'PNAAAA', 'FLAAAA', 'VVVVxx'),
+(9777, 292, 1, 1, 7, 17, 77, 777, 1777, 4777, 9777, 154, 155, 'BMAAAA', 'GLAAAA', 'AAAAxx'),
+(574, 293, 0, 2, 4, 14, 74, 574, 574, 574, 574, 148, 149, 'CWAAAA', 'HLAAAA', 'HHHHxx'),
+(5984, 294, 0, 0, 4, 4, 84, 984, 1984, 984, 5984, 168, 169, 'EWAAAA', 'ILAAAA', 'OOOOxx'),
+(7039, 295, 1, 3, 9, 19, 39, 39, 1039, 2039, 7039, 78, 79, 'TKAAAA', 'JLAAAA', 'VVVVxx'),
+(7143, 296, 1, 3, 3, 3, 43, 143, 1143, 2143, 7143, 86, 87, 'TOAAAA', 'KLAAAA', 'AAAAxx'),
+(5702, 297, 0, 2, 2, 2, 2, 702, 1702, 702, 5702, 4, 5, 'ILAAAA', 'LLAAAA', 'HHHHxx'),
+(362, 298, 0, 2, 2, 2, 62, 362, 362, 362, 362, 124, 125, 'YNAAAA', 'MLAAAA', 'OOOOxx'),
+(6997, 299, 1, 1, 7, 17, 97, 997, 997, 1997, 6997, 194, 195, 'DJAAAA', 'NLAAAA', 'VVVVxx'),
+(2529, 300, 1, 1, 9, 9, 29, 529, 529, 2529, 2529, 58, 59, 'HTAAAA', 'OLAAAA', 'AAAAxx'),
+(6319, 301, 1, 3, 9, 19, 19, 319, 319, 1319, 6319, 38, 39, 'BJAAAA', 'PLAAAA', 'HHHHxx'),
+(954, 302, 0, 2, 4, 14, 54, 954, 954, 954, 954, 108, 109, 'SKAAAA', 'QLAAAA', 'OOOOxx'),
+(3413, 303, 1, 1, 3, 13, 13, 413, 1413, 3413, 3413, 26, 27, 'HBAAAA', 'RLAAAA', 'VVVVxx'),
+(9081, 304, 1, 1, 1, 1, 81, 81, 1081, 4081, 9081, 162, 163, 'HLAAAA', 'SLAAAA', 'AAAAxx'),
+(5599, 305, 1, 3, 9, 19, 99, 599, 1599, 599, 5599, 198, 199, 'JHAAAA', 'TLAAAA', 'HHHHxx'),
+(4772, 306, 0, 0, 2, 12, 72, 772, 772, 4772, 4772, 144, 145, 'OBAAAA', 'ULAAAA', 'OOOOxx'),
+(1124, 307, 0, 0, 4, 4, 24, 124, 1124, 1124, 1124, 48, 49, 'GRAAAA', 'VLAAAA', 'VVVVxx'),
+(7793, 308, 1, 1, 3, 13, 93, 793, 1793, 2793, 7793, 186, 187, 'TNAAAA', 'WLAAAA', 'AAAAxx'),
+(4201, 309, 1, 1, 1, 1, 1, 201, 201, 4201, 4201, 2, 3, 'PFAAAA', 'XLAAAA', 'HHHHxx'),
+(7015, 310, 1, 3, 5, 15, 15, 15, 1015, 2015, 7015, 30, 31, 'VJAAAA', 'YLAAAA', 'OOOOxx'),
+(5936, 311, 0, 0, 6, 16, 36, 936, 1936, 936, 5936, 72, 73, 'IUAAAA', 'ZLAAAA', 'VVVVxx'),
+(4625, 312, 1, 1, 5, 5, 25, 625, 625, 4625, 4625, 50, 51, 'XVAAAA', 'AMAAAA', 'AAAAxx'),
+(4989, 313, 1, 1, 9, 9, 89, 989, 989, 4989, 4989, 178, 179, 'XJAAAA', 'BMAAAA', 'HHHHxx'),
+(4949, 314, 1, 1, 9, 9, 49, 949, 949, 4949, 4949, 98, 99, 'JIAAAA', 'CMAAAA', 'OOOOxx'),
+(6273, 315, 1, 1, 3, 13, 73, 273, 273, 1273, 6273, 146, 147, 'HHAAAA', 'DMAAAA', 'VVVVxx'),
+(4478, 316, 0, 2, 8, 18, 78, 478, 478, 4478, 4478, 156, 157, 'GQAAAA', 'EMAAAA', 'AAAAxx'),
+(8854, 317, 0, 2, 4, 14, 54, 854, 854, 3854, 8854, 108, 109, 'OCAAAA', 'FMAAAA', 'HHHHxx'),
+(2105, 318, 1, 1, 5, 5, 5, 105, 105, 2105, 2105, 10, 11, 'ZCAAAA', 'GMAAAA', 'OOOOxx'),
+(8345, 319, 1, 1, 5, 5, 45, 345, 345, 3345, 8345, 90, 91, 'ZIAAAA', 'HMAAAA', 'VVVVxx'),
+(1941, 320, 1, 1, 1, 1, 41, 941, 1941, 1941, 1941, 82, 83, 'RWAAAA', 'IMAAAA', 'AAAAxx'),
+(1765, 321, 1, 1, 5, 5, 65, 765, 1765, 1765, 1765, 130, 131, 'XPAAAA', 'JMAAAA', 'HHHHxx'),
+(9592, 322, 0, 0, 2, 12, 92, 592, 1592, 4592, 9592, 184, 185, 'YEAAAA', 'KMAAAA', 'OOOOxx'),
+(1694, 323, 0, 2, 4, 14, 94, 694, 1694, 1694, 1694, 188, 189, 'ENAAAA', 'LMAAAA', 'VVVVxx'),
+(8940, 324, 0, 0, 0, 0, 40, 940, 940, 3940, 8940, 80, 81, 'WFAAAA', 'MMAAAA', 'AAAAxx'),
+(7264, 325, 0, 0, 4, 4, 64, 264, 1264, 2264, 7264, 128, 129, 'KTAAAA', 'NMAAAA', 'HHHHxx'),
+(4699, 326, 1, 3, 9, 19, 99, 699, 699, 4699, 4699, 198, 199, 'TYAAAA', 'OMAAAA', 'OOOOxx'),
+(4541, 327, 1, 1, 1, 1, 41, 541, 541, 4541, 4541, 82, 83, 'RSAAAA', 'PMAAAA', 'VVVVxx'),
+(5768, 328, 0, 0, 8, 8, 68, 768, 1768, 768, 5768, 136, 137, 'WNAAAA', 'QMAAAA', 'AAAAxx'),
+(6183, 329, 1, 3, 3, 3, 83, 183, 183, 1183, 6183, 166, 167, 'VDAAAA', 'RMAAAA', 'HHHHxx'),
+(7457, 330, 1, 1, 7, 17, 57, 457, 1457, 2457, 7457, 114, 115, 'VAAAAA', 'SMAAAA', 'OOOOxx'),
+(7317, 331, 1, 1, 7, 17, 17, 317, 1317, 2317, 7317, 34, 35, 'LVAAAA', 'TMAAAA', 'VVVVxx'),
+(1944, 332, 0, 0, 4, 4, 44, 944, 1944, 1944, 1944, 88, 89, 'UWAAAA', 'UMAAAA', 'AAAAxx'),
+(665, 333, 1, 1, 5, 5, 65, 665, 665, 665, 665, 130, 131, 'PZAAAA', 'VMAAAA', 'HHHHxx'),
+(5974, 334, 0, 2, 4, 14, 74, 974, 1974, 974, 5974, 148, 149, 'UVAAAA', 'WMAAAA', 'OOOOxx'),
+(7370, 335, 0, 2, 0, 10, 70, 370, 1370, 2370, 7370, 140, 141, 'MXAAAA', 'XMAAAA', 'VVVVxx'),
+(9196, 336, 0, 0, 6, 16, 96, 196, 1196, 4196, 9196, 192, 193, 'SPAAAA', 'YMAAAA', 'AAAAxx'),
+(6796, 337, 0, 0, 6, 16, 96, 796, 796, 1796, 6796, 192, 193, 'KBAAAA', 'ZMAAAA', 'HHHHxx'),
+(6180, 338, 0, 0, 0, 0, 80, 180, 180, 1180, 6180, 160, 161, 'SDAAAA', 'ANAAAA', 'OOOOxx'),
+(8557, 339, 1, 1, 7, 17, 57, 557, 557, 3557, 8557, 114, 115, 'DRAAAA', 'BNAAAA', 'VVVVxx'),
+(928, 340, 0, 0, 8, 8, 28, 928, 928, 928, 928, 56, 57, 'SJAAAA', 'CNAAAA', 'AAAAxx'),
+(6275, 341, 1, 3, 5, 15, 75, 275, 275, 1275, 6275, 150, 151, 'JHAAAA', 'DNAAAA', 'HHHHxx'),
+(409, 342, 1, 1, 9, 9, 9, 409, 409, 409, 409, 18, 19, 'TPAAAA', 'ENAAAA', 'OOOOxx'),
+(6442, 343, 0, 2, 2, 2, 42, 442, 442, 1442, 6442, 84, 85, 'UNAAAA', 'FNAAAA', 'VVVVxx'),
+(5889, 344, 1, 1, 9, 9, 89, 889, 1889, 889, 5889, 178, 179, 'NSAAAA', 'GNAAAA', 'AAAAxx'),
+(5180, 345, 0, 0, 0, 0, 80, 180, 1180, 180, 5180, 160, 161, 'GRAAAA', 'HNAAAA', 'HHHHxx'),
+(1629, 346, 1, 1, 9, 9, 29, 629, 1629, 1629, 1629, 58, 59, 'RKAAAA', 'INAAAA', 'OOOOxx'),
+(6088, 347, 0, 0, 8, 8, 88, 88, 88, 1088, 6088, 176, 177, 'EAAAAA', 'JNAAAA', 'VVVVxx'),
+(5598, 348, 0, 2, 8, 18, 98, 598, 1598, 598, 5598, 196, 197, 'IHAAAA', 'KNAAAA', 'AAAAxx'),
+(1803, 349, 1, 3, 3, 3, 3, 803, 1803, 1803, 1803, 6, 7, 'JRAAAA', 'LNAAAA', 'HHHHxx'),
+(2330, 350, 0, 2, 0, 10, 30, 330, 330, 2330, 2330, 60, 61, 'QLAAAA', 'MNAAAA', 'OOOOxx'),
+(5901, 351, 1, 1, 1, 1, 1, 901, 1901, 901, 5901, 2, 3, 'ZSAAAA', 'NNAAAA', 'VVVVxx'),
+(780, 352, 0, 0, 0, 0, 80, 780, 780, 780, 780, 160, 161, 'AEAAAA', 'ONAAAA', 'AAAAxx'),
+(7171, 353, 1, 3, 1, 11, 71, 171, 1171, 2171, 7171, 142, 143, 'VPAAAA', 'PNAAAA', 'HHHHxx'),
+(8778, 354, 0, 2, 8, 18, 78, 778, 778, 3778, 8778, 156, 157, 'QZAAAA', 'QNAAAA', 'OOOOxx'),
+(6622, 355, 0, 2, 2, 2, 22, 622, 622, 1622, 6622, 44, 45, 'SUAAAA', 'RNAAAA', 'VVVVxx'),
+(9938, 356, 0, 2, 8, 18, 38, 938, 1938, 4938, 9938, 76, 77, 'GSAAAA', 'SNAAAA', 'AAAAxx'),
+(8254, 357, 0, 2, 4, 14, 54, 254, 254, 3254, 8254, 108, 109, 'MFAAAA', 'TNAAAA', 'HHHHxx'),
+(1951, 358, 1, 3, 1, 11, 51, 951, 1951, 1951, 1951, 102, 103, 'BXAAAA', 'UNAAAA', 'OOOOxx'),
+(1434, 359, 0, 2, 4, 14, 34, 434, 1434, 1434, 1434, 68, 69, 'EDAAAA', 'VNAAAA', 'VVVVxx'),
+(7539, 360, 1, 3, 9, 19, 39, 539, 1539, 2539, 7539, 78, 79, 'ZDAAAA', 'WNAAAA', 'AAAAxx'),
+(600, 361, 0, 0, 0, 0, 0, 600, 600, 600, 600, 0, 1, 'CXAAAA', 'XNAAAA', 'HHHHxx'),
+(3122, 362, 0, 2, 2, 2, 22, 122, 1122, 3122, 3122, 44, 45, 'CQAAAA', 'YNAAAA', 'OOOOxx'),
+(5704, 363, 0, 0, 4, 4, 4, 704, 1704, 704, 5704, 8, 9, 'KLAAAA', 'ZNAAAA', 'VVVVxx'),
+(6300, 364, 0, 0, 0, 0, 0, 300, 300, 1300, 6300, 0, 1, 'IIAAAA', 'AOAAAA', 'AAAAxx'),
+(4585, 365, 1, 1, 5, 5, 85, 585, 585, 4585, 4585, 170, 171, 'JUAAAA', 'BOAAAA', 'HHHHxx'),
+(6313, 366, 1, 1, 3, 13, 13, 313, 313, 1313, 6313, 26, 27, 'VIAAAA', 'COAAAA', 'OOOOxx'),
+(3154, 367, 0, 2, 4, 14, 54, 154, 1154, 3154, 3154, 108, 109, 'IRAAAA', 'DOAAAA', 'VVVVxx'),
+(642, 368, 0, 2, 2, 2, 42, 642, 642, 642, 642, 84, 85, 'SYAAAA', 'EOAAAA', 'AAAAxx'),
+(7736, 369, 0, 0, 6, 16, 36, 736, 1736, 2736, 7736, 72, 73, 'OLAAAA', 'FOAAAA', 'HHHHxx'),
+(5087, 370, 1, 3, 7, 7, 87, 87, 1087, 87, 5087, 174, 175, 'RNAAAA', 'GOAAAA', 'OOOOxx'),
+(5708, 371, 0, 0, 8, 8, 8, 708, 1708, 708, 5708, 16, 17, 'OLAAAA', 'HOAAAA', 'VVVVxx'),
+(8169, 372, 1, 1, 9, 9, 69, 169, 169, 3169, 8169, 138, 139, 'FCAAAA', 'IOAAAA', 'AAAAxx'),
+(9768, 373, 0, 0, 8, 8, 68, 768, 1768, 4768, 9768, 136, 137, 'SLAAAA', 'JOAAAA', 'HHHHxx'),
+(3874, 374, 0, 2, 4, 14, 74, 874, 1874, 3874, 3874, 148, 149, 'ATAAAA', 'KOAAAA', 'OOOOxx'),
+(6831, 375, 1, 3, 1, 11, 31, 831, 831, 1831, 6831, 62, 63, 'TCAAAA', 'LOAAAA', 'VVVVxx'),
+(18, 376, 0, 2, 8, 18, 18, 18, 18, 18, 18, 36, 37, 'SAAAAA', 'MOAAAA', 'AAAAxx'),
+(6375, 377, 1, 3, 5, 15, 75, 375, 375, 1375, 6375, 150, 151, 'FLAAAA', 'NOAAAA', 'HHHHxx'),
+(7106, 378, 0, 2, 6, 6, 6, 106, 1106, 2106, 7106, 12, 13, 'INAAAA', 'OOAAAA', 'OOOOxx'),
+(5926, 379, 0, 2, 6, 6, 26, 926, 1926, 926, 5926, 52, 53, 'YTAAAA', 'POAAAA', 'VVVVxx'),
+(4956, 380, 0, 0, 6, 16, 56, 956, 956, 4956, 4956, 112, 113, 'QIAAAA', 'QOAAAA', 'AAAAxx'),
+(7042, 381, 0, 2, 2, 2, 42, 42, 1042, 2042, 7042, 84, 85, 'WKAAAA', 'ROAAAA', 'HHHHxx'),
+(6043, 382, 1, 3, 3, 3, 43, 43, 43, 1043, 6043, 86, 87, 'LYAAAA', 'SOAAAA', 'OOOOxx'),
+(2084, 383, 0, 0, 4, 4, 84, 84, 84, 2084, 2084, 168, 169, 'ECAAAA', 'TOAAAA', 'VVVVxx'),
+(6038, 384, 0, 2, 8, 18, 38, 38, 38, 1038, 6038, 76, 77, 'GYAAAA', 'UOAAAA', 'AAAAxx'),
+(7253, 385, 1, 1, 3, 13, 53, 253, 1253, 2253, 7253, 106, 107, 'ZSAAAA', 'VOAAAA', 'HHHHxx'),
+(2061, 386, 1, 1, 1, 1, 61, 61, 61, 2061, 2061, 122, 123, 'HBAAAA', 'WOAAAA', 'OOOOxx'),
+(7800, 387, 0, 0, 0, 0, 0, 800, 1800, 2800, 7800, 0, 1, 'AOAAAA', 'XOAAAA', 'VVVVxx'),
+(4970, 388, 0, 2, 0, 10, 70, 970, 970, 4970, 4970, 140, 141, 'EJAAAA', 'YOAAAA', 'AAAAxx'),
+(8580, 389, 0, 0, 0, 0, 80, 580, 580, 3580, 8580, 160, 161, 'ASAAAA', 'ZOAAAA', 'HHHHxx'),
+(9173, 390, 1, 1, 3, 13, 73, 173, 1173, 4173, 9173, 146, 147, 'VOAAAA', 'APAAAA', 'OOOOxx'),
+(8558, 391, 0, 2, 8, 18, 58, 558, 558, 3558, 8558, 116, 117, 'ERAAAA', 'BPAAAA', 'VVVVxx'),
+(3897, 392, 1, 1, 7, 17, 97, 897, 1897, 3897, 3897, 194, 195, 'XTAAAA', 'CPAAAA', 'AAAAxx'),
+(5069, 393, 1, 1, 9, 9, 69, 69, 1069, 69, 5069, 138, 139, 'ZMAAAA', 'DPAAAA', 'HHHHxx'),
+(2301, 394, 1, 1, 1, 1, 1, 301, 301, 2301, 2301, 2, 3, 'NKAAAA', 'EPAAAA', 'OOOOxx'),
+(9863, 395, 1, 3, 3, 3, 63, 863, 1863, 4863, 9863, 126, 127, 'JPAAAA', 'FPAAAA', 'VVVVxx'),
+(5733, 396, 1, 1, 3, 13, 33, 733, 1733, 733, 5733, 66, 67, 'NMAAAA', 'GPAAAA', 'AAAAxx'),
+(2338, 397, 0, 2, 8, 18, 38, 338, 338, 2338, 2338, 76, 77, 'YLAAAA', 'HPAAAA', 'HHHHxx'),
+(9639, 398, 1, 3, 9, 19, 39, 639, 1639, 4639, 9639, 78, 79, 'TGAAAA', 'IPAAAA', 'OOOOxx'),
+(1139, 399, 1, 3, 9, 19, 39, 139, 1139, 1139, 1139, 78, 79, 'VRAAAA', 'JPAAAA', 'VVVVxx'),
+(2293, 400, 1, 1, 3, 13, 93, 293, 293, 2293, 2293, 186, 187, 'FKAAAA', 'KPAAAA', 'AAAAxx'),
+(6125, 401, 1, 1, 5, 5, 25, 125, 125, 1125, 6125, 50, 51, 'PBAAAA', 'LPAAAA', 'HHHHxx'),
+(5374, 402, 0, 2, 4, 14, 74, 374, 1374, 374, 5374, 148, 149, 'SYAAAA', 'MPAAAA', 'OOOOxx'),
+(7216, 403, 0, 0, 6, 16, 16, 216, 1216, 2216, 7216, 32, 33, 'ORAAAA', 'NPAAAA', 'VVVVxx'),
+(2285, 404, 1, 1, 5, 5, 85, 285, 285, 2285, 2285, 170, 171, 'XJAAAA', 'OPAAAA', 'AAAAxx'),
+(2387, 405, 1, 3, 7, 7, 87, 387, 387, 2387, 2387, 174, 175, 'VNAAAA', 'PPAAAA', 'HHHHxx'),
+(5015, 406, 1, 3, 5, 15, 15, 15, 1015, 15, 5015, 30, 31, 'XKAAAA', 'QPAAAA', 'OOOOxx'),
+(2087, 407, 1, 3, 7, 7, 87, 87, 87, 2087, 2087, 174, 175, 'HCAAAA', 'RPAAAA', 'VVVVxx'),
+(4938, 408, 0, 2, 8, 18, 38, 938, 938, 4938, 4938, 76, 77, 'YHAAAA', 'SPAAAA', 'AAAAxx'),
+(3635, 409, 1, 3, 5, 15, 35, 635, 1635, 3635, 3635, 70, 71, 'VJAAAA', 'TPAAAA', 'HHHHxx'),
+(7737, 410, 1, 1, 7, 17, 37, 737, 1737, 2737, 7737, 74, 75, 'PLAAAA', 'UPAAAA', 'OOOOxx'),
+(8056, 411, 0, 0, 6, 16, 56, 56, 56, 3056, 8056, 112, 113, 'WXAAAA', 'VPAAAA', 'VVVVxx'),
+(4502, 412, 0, 2, 2, 2, 2, 502, 502, 4502, 4502, 4, 5, 'ERAAAA', 'WPAAAA', 'AAAAxx'),
+(54, 413, 0, 2, 4, 14, 54, 54, 54, 54, 54, 108, 109, 'CCAAAA', 'XPAAAA', 'HHHHxx'),
+(3182, 414, 0, 2, 2, 2, 82, 182, 1182, 3182, 3182, 164, 165, 'KSAAAA', 'YPAAAA', 'OOOOxx'),
+(3718, 415, 0, 2, 8, 18, 18, 718, 1718, 3718, 3718, 36, 37, 'ANAAAA', 'ZPAAAA', 'VVVVxx'),
+(3989, 416, 1, 1, 9, 9, 89, 989, 1989, 3989, 3989, 178, 179, 'LXAAAA', 'AQAAAA', 'AAAAxx'),
+(8028, 417, 0, 0, 8, 8, 28, 28, 28, 3028, 8028, 56, 57, 'UWAAAA', 'BQAAAA', 'HHHHxx'),
+(1426, 418, 0, 2, 6, 6, 26, 426, 1426, 1426, 1426, 52, 53, 'WCAAAA', 'CQAAAA', 'OOOOxx'),
+(3801, 419, 1, 1, 1, 1, 1, 801, 1801, 3801, 3801, 2, 3, 'FQAAAA', 'DQAAAA', 'VVVVxx'),
+(241, 420, 1, 1, 1, 1, 41, 241, 241, 241, 241, 82, 83, 'HJAAAA', 'EQAAAA', 'AAAAxx'),
+(8000, 421, 0, 0, 0, 0, 0, 0, 0, 3000, 8000, 0, 1, 'SVAAAA', 'FQAAAA', 'HHHHxx'),
+(8357, 422, 1, 1, 7, 17, 57, 357, 357, 3357, 8357, 114, 115, 'LJAAAA', 'GQAAAA', 'OOOOxx'),
+(7548, 423, 0, 0, 8, 8, 48, 548, 1548, 2548, 7548, 96, 97, 'IEAAAA', 'HQAAAA', 'VVVVxx'),
+(7307, 424, 1, 3, 7, 7, 7, 307, 1307, 2307, 7307, 14, 15, 'BVAAAA', 'IQAAAA', 'AAAAxx'),
+(2275, 425, 1, 3, 5, 15, 75, 275, 275, 2275, 2275, 150, 151, 'NJAAAA', 'JQAAAA', 'HHHHxx'),
+(2718, 426, 0, 2, 8, 18, 18, 718, 718, 2718, 2718, 36, 37, 'OAAAAA', 'KQAAAA', 'OOOOxx'),
+(7068, 427, 0, 0, 8, 8, 68, 68, 1068, 2068, 7068, 136, 137, 'WLAAAA', 'LQAAAA', 'VVVVxx'),
+(3181, 428, 1, 1, 1, 1, 81, 181, 1181, 3181, 3181, 162, 163, 'JSAAAA', 'MQAAAA', 'AAAAxx'),
+(749, 429, 1, 1, 9, 9, 49, 749, 749, 749, 749, 98, 99, 'VCAAAA', 'NQAAAA', 'HHHHxx'),
+(5195, 430, 1, 3, 5, 15, 95, 195, 1195, 195, 5195, 190, 191, 'VRAAAA', 'OQAAAA', 'OOOOxx'),
+(6136, 431, 0, 0, 6, 16, 36, 136, 136, 1136, 6136, 72, 73, 'ACAAAA', 'PQAAAA', 'VVVVxx'),
+(8012, 432, 0, 0, 2, 12, 12, 12, 12, 3012, 8012, 24, 25, 'EWAAAA', 'QQAAAA', 'AAAAxx'),
+(3957, 433, 1, 1, 7, 17, 57, 957, 1957, 3957, 3957, 114, 115, 'FWAAAA', 'RQAAAA', 'HHHHxx'),
+(3083, 434, 1, 3, 3, 3, 83, 83, 1083, 3083, 3083, 166, 167, 'POAAAA', 'SQAAAA', 'OOOOxx'),
+(9997, 435, 1, 1, 7, 17, 97, 997, 1997, 4997, 9997, 194, 195, 'NUAAAA', 'TQAAAA', 'VVVVxx'),
+(3299, 436, 1, 3, 9, 19, 99, 299, 1299, 3299, 3299, 198, 199, 'XWAAAA', 'UQAAAA', 'AAAAxx'),
+(846, 437, 0, 2, 6, 6, 46, 846, 846, 846, 846, 92, 93, 'OGAAAA', 'VQAAAA', 'HHHHxx'),
+(2985, 438, 1, 1, 5, 5, 85, 985, 985, 2985, 2985, 170, 171, 'VKAAAA', 'WQAAAA', 'OOOOxx'),
+(9238, 439, 0, 2, 8, 18, 38, 238, 1238, 4238, 9238, 76, 77, 'IRAAAA', 'XQAAAA', 'VVVVxx'),
+(1403, 440, 1, 3, 3, 3, 3, 403, 1403, 1403, 1403, 6, 7, 'ZBAAAA', 'YQAAAA', 'AAAAxx'),
+(5563, 441, 1, 3, 3, 3, 63, 563, 1563, 563, 5563, 126, 127, 'ZFAAAA', 'ZQAAAA', 'HHHHxx'),
+(7965, 442, 1, 1, 5, 5, 65, 965, 1965, 2965, 7965, 130, 131, 'JUAAAA', 'ARAAAA', 'OOOOxx'),
+(4512, 443, 0, 0, 2, 12, 12, 512, 512, 4512, 4512, 24, 25, 'ORAAAA', 'BRAAAA', 'VVVVxx'),
+(9730, 444, 0, 2, 0, 10, 30, 730, 1730, 4730, 9730, 60, 61, 'GKAAAA', 'CRAAAA', 'AAAAxx'),
+(1129, 445, 1, 1, 9, 9, 29, 129, 1129, 1129, 1129, 58, 59, 'LRAAAA', 'DRAAAA', 'HHHHxx'),
+(2624, 446, 0, 0, 4, 4, 24, 624, 624, 2624, 2624, 48, 49, 'YWAAAA', 'ERAAAA', 'OOOOxx'),
+(8178, 447, 0, 2, 8, 18, 78, 178, 178, 3178, 8178, 156, 157, 'OCAAAA', 'FRAAAA', 'VVVVxx'),
+(6468, 448, 0, 0, 8, 8, 68, 468, 468, 1468, 6468, 136, 137, 'UOAAAA', 'GRAAAA', 'AAAAxx'),
+(3027, 449, 1, 3, 7, 7, 27, 27, 1027, 3027, 3027, 54, 55, 'LMAAAA', 'HRAAAA', 'HHHHxx'),
+(3845, 450, 1, 1, 5, 5, 45, 845, 1845, 3845, 3845, 90, 91, 'XRAAAA', 'IRAAAA', 'OOOOxx'),
+(786, 451, 0, 2, 6, 6, 86, 786, 786, 786, 786, 172, 173, 'GEAAAA', 'JRAAAA', 'VVVVxx'),
+(4971, 452, 1, 3, 1, 11, 71, 971, 971, 4971, 4971, 142, 143, 'FJAAAA', 'KRAAAA', 'AAAAxx'),
+(1542, 453, 0, 2, 2, 2, 42, 542, 1542, 1542, 1542, 84, 85, 'IHAAAA', 'LRAAAA', 'HHHHxx'),
+(7967, 454, 1, 3, 7, 7, 67, 967, 1967, 2967, 7967, 134, 135, 'LUAAAA', 'MRAAAA', 'OOOOxx'),
+(443, 455, 1, 3, 3, 3, 43, 443, 443, 443, 443, 86, 87, 'BRAAAA', 'NRAAAA', 'VVVVxx'),
+(7318, 456, 0, 2, 8, 18, 18, 318, 1318, 2318, 7318, 36, 37, 'MVAAAA', 'ORAAAA', 'AAAAxx'),
+(4913, 457, 1, 1, 3, 13, 13, 913, 913, 4913, 4913, 26, 27, 'ZGAAAA', 'PRAAAA', 'HHHHxx'),
+(9466, 458, 0, 2, 6, 6, 66, 466, 1466, 4466, 9466, 132, 133, 'CAAAAA', 'QRAAAA', 'OOOOxx'),
+(7866, 459, 0, 2, 6, 6, 66, 866, 1866, 2866, 7866, 132, 133, 'OQAAAA', 'RRAAAA', 'VVVVxx'),
+(784, 460, 0, 0, 4, 4, 84, 784, 784, 784, 784, 168, 169, 'EEAAAA', 'SRAAAA', 'AAAAxx'),
+(9040, 461, 0, 0, 0, 0, 40, 40, 1040, 4040, 9040, 80, 81, 'SJAAAA', 'TRAAAA', 'HHHHxx'),
+(3954, 462, 0, 2, 4, 14, 54, 954, 1954, 3954, 3954, 108, 109, 'CWAAAA', 'URAAAA', 'OOOOxx'),
+(4183, 463, 1, 3, 3, 3, 83, 183, 183, 4183, 4183, 166, 167, 'XEAAAA', 'VRAAAA', 'VVVVxx'),
+(3608, 464, 0, 0, 8, 8, 8, 608, 1608, 3608, 3608, 16, 17, 'UIAAAA', 'WRAAAA', 'AAAAxx'),
+(7630, 465, 0, 2, 0, 10, 30, 630, 1630, 2630, 7630, 60, 61, 'MHAAAA', 'XRAAAA', 'HHHHxx'),
+(590, 466, 0, 2, 0, 10, 90, 590, 590, 590, 590, 180, 181, 'SWAAAA', 'YRAAAA', 'OOOOxx'),
+(3453, 467, 1, 1, 3, 13, 53, 453, 1453, 3453, 3453, 106, 107, 'VCAAAA', 'ZRAAAA', 'VVVVxx'),
+(7757, 468, 1, 1, 7, 17, 57, 757, 1757, 2757, 7757, 114, 115, 'JMAAAA', 'ASAAAA', 'AAAAxx'),
+(7394, 469, 0, 2, 4, 14, 94, 394, 1394, 2394, 7394, 188, 189, 'KYAAAA', 'BSAAAA', 'HHHHxx'),
+(396, 470, 0, 0, 6, 16, 96, 396, 396, 396, 396, 192, 193, 'GPAAAA', 'CSAAAA', 'OOOOxx'),
+(7873, 471, 1, 1, 3, 13, 73, 873, 1873, 2873, 7873, 146, 147, 'VQAAAA', 'DSAAAA', 'VVVVxx'),
+(1553, 472, 1, 1, 3, 13, 53, 553, 1553, 1553, 1553, 106, 107, 'THAAAA', 'ESAAAA', 'AAAAxx'),
+(598, 473, 0, 2, 8, 18, 98, 598, 598, 598, 598, 196, 197, 'AXAAAA', 'FSAAAA', 'HHHHxx'),
+(7191, 474, 1, 3, 1, 11, 91, 191, 1191, 2191, 7191, 182, 183, 'PQAAAA', 'GSAAAA', 'OOOOxx'),
+(8116, 475, 0, 0, 6, 16, 16, 116, 116, 3116, 8116, 32, 33, 'EAAAAA', 'HSAAAA', 'VVVVxx'),
+(2516, 476, 0, 0, 6, 16, 16, 516, 516, 2516, 2516, 32, 33, 'USAAAA', 'ISAAAA', 'AAAAxx'),
+(7750, 477, 0, 2, 0, 10, 50, 750, 1750, 2750, 7750, 100, 101, 'CMAAAA', 'JSAAAA', 'HHHHxx'),
+(6625, 478, 1, 1, 5, 5, 25, 625, 625, 1625, 6625, 50, 51, 'VUAAAA', 'KSAAAA', 'OOOOxx'),
+(8838, 479, 0, 2, 8, 18, 38, 838, 838, 3838, 8838, 76, 77, 'YBAAAA', 'LSAAAA', 'VVVVxx'),
+(4636, 480, 0, 0, 6, 16, 36, 636, 636, 4636, 4636, 72, 73, 'IWAAAA', 'MSAAAA', 'AAAAxx'),
+(7627, 481, 1, 3, 7, 7, 27, 627, 1627, 2627, 7627, 54, 55, 'JHAAAA', 'NSAAAA', 'HHHHxx'),
+(1690, 482, 0, 2, 0, 10, 90, 690, 1690, 1690, 1690, 180, 181, 'ANAAAA', 'OSAAAA', 'OOOOxx'),
+(7071, 483, 1, 3, 1, 11, 71, 71, 1071, 2071, 7071, 142, 143, 'ZLAAAA', 'PSAAAA', 'VVVVxx'),
+(2081, 484, 1, 1, 1, 1, 81, 81, 81, 2081, 2081, 162, 163, 'BCAAAA', 'QSAAAA', 'AAAAxx'),
+(7138, 485, 0, 2, 8, 18, 38, 138, 1138, 2138, 7138, 76, 77, 'OOAAAA', 'RSAAAA', 'HHHHxx'),
+(864, 486, 0, 0, 4, 4, 64, 864, 864, 864, 864, 128, 129, 'GHAAAA', 'SSAAAA', 'OOOOxx'),
+(6392, 487, 0, 0, 2, 12, 92, 392, 392, 1392, 6392, 184, 185, 'WLAAAA', 'TSAAAA', 'VVVVxx'),
+(7544, 488, 0, 0, 4, 4, 44, 544, 1544, 2544, 7544, 88, 89, 'EEAAAA', 'USAAAA', 'AAAAxx'),
+(5438, 489, 0, 2, 8, 18, 38, 438, 1438, 438, 5438, 76, 77, 'EBAAAA', 'VSAAAA', 'HHHHxx'),
+(7099, 490, 1, 3, 9, 19, 99, 99, 1099, 2099, 7099, 198, 199, 'BNAAAA', 'WSAAAA', 'OOOOxx'),
+(5157, 491, 1, 1, 7, 17, 57, 157, 1157, 157, 5157, 114, 115, 'JQAAAA', 'XSAAAA', 'VVVVxx'),
+(3391, 492, 1, 3, 1, 11, 91, 391, 1391, 3391, 3391, 182, 183, 'LAAAAA', 'YSAAAA', 'AAAAxx'),
+(3805, 493, 1, 1, 5, 5, 5, 805, 1805, 3805, 3805, 10, 11, 'JQAAAA', 'ZSAAAA', 'HHHHxx'),
+(2110, 494, 0, 2, 0, 10, 10, 110, 110, 2110, 2110, 20, 21, 'EDAAAA', 'ATAAAA', 'OOOOxx'),
+(3176, 495, 0, 0, 6, 16, 76, 176, 1176, 3176, 3176, 152, 153, 'ESAAAA', 'BTAAAA', 'VVVVxx'),
+(5918, 496, 0, 2, 8, 18, 18, 918, 1918, 918, 5918, 36, 37, 'QTAAAA', 'CTAAAA', 'AAAAxx'),
+(1218, 497, 0, 2, 8, 18, 18, 218, 1218, 1218, 1218, 36, 37, 'WUAAAA', 'DTAAAA', 'HHHHxx'),
+(6683, 498, 1, 3, 3, 3, 83, 683, 683, 1683, 6683, 166, 167, 'BXAAAA', 'ETAAAA', 'OOOOxx'),
+(914, 499, 0, 2, 4, 14, 14, 914, 914, 914, 914, 28, 29, 'EJAAAA', 'FTAAAA', 'VVVVxx'),
+(4737, 500, 1, 1, 7, 17, 37, 737, 737, 4737, 4737, 74, 75, 'FAAAAA', 'GTAAAA', 'AAAAxx'),
+(7286, 501, 0, 2, 6, 6, 86, 286, 1286, 2286, 7286, 172, 173, 'GUAAAA', 'HTAAAA', 'HHHHxx'),
+(9975, 502, 1, 3, 5, 15, 75, 975, 1975, 4975, 9975, 150, 151, 'RTAAAA', 'ITAAAA', 'OOOOxx'),
+(8030, 503, 0, 2, 0, 10, 30, 30, 30, 3030, 8030, 60, 61, 'WWAAAA', 'JTAAAA', 'VVVVxx'),
+(7364, 504, 0, 0, 4, 4, 64, 364, 1364, 2364, 7364, 128, 129, 'GXAAAA', 'KTAAAA', 'AAAAxx'),
+(1389, 505, 1, 1, 9, 9, 89, 389, 1389, 1389, 1389, 178, 179, 'LBAAAA', 'LTAAAA', 'HHHHxx'),
+(4025, 506, 1, 1, 5, 5, 25, 25, 25, 4025, 4025, 50, 51, 'VYAAAA', 'MTAAAA', 'OOOOxx'),
+(4835, 507, 1, 3, 5, 15, 35, 835, 835, 4835, 4835, 70, 71, 'ZDAAAA', 'NTAAAA', 'VVVVxx'),
+(8045, 508, 1, 1, 5, 5, 45, 45, 45, 3045, 8045, 90, 91, 'LXAAAA', 'OTAAAA', 'AAAAxx'),
+(1864, 509, 0, 0, 4, 4, 64, 864, 1864, 1864, 1864, 128, 129, 'STAAAA', 'PTAAAA', 'HHHHxx'),
+(3313, 510, 1, 1, 3, 13, 13, 313, 1313, 3313, 3313, 26, 27, 'LXAAAA', 'QTAAAA', 'OOOOxx'),
+(2384, 511, 0, 0, 4, 4, 84, 384, 384, 2384, 2384, 168, 169, 'SNAAAA', 'RTAAAA', 'VVVVxx'),
+(6115, 512, 1, 3, 5, 15, 15, 115, 115, 1115, 6115, 30, 31, 'FBAAAA', 'STAAAA', 'AAAAxx'),
+(5705, 513, 1, 1, 5, 5, 5, 705, 1705, 705, 5705, 10, 11, 'LLAAAA', 'TTAAAA', 'HHHHxx'),
+(9269, 514, 1, 1, 9, 9, 69, 269, 1269, 4269, 9269, 138, 139, 'NSAAAA', 'UTAAAA', 'OOOOxx'),
+(3379, 515, 1, 3, 9, 19, 79, 379, 1379, 3379, 3379, 158, 159, 'ZZAAAA', 'VTAAAA', 'VVVVxx'),
+(8205, 516, 1, 1, 5, 5, 5, 205, 205, 3205, 8205, 10, 11, 'PDAAAA', 'WTAAAA', 'AAAAxx'),
+(6575, 517, 1, 3, 5, 15, 75, 575, 575, 1575, 6575, 150, 151, 'XSAAAA', 'XTAAAA', 'HHHHxx'),
+(486, 518, 0, 2, 6, 6, 86, 486, 486, 486, 486, 172, 173, 'SSAAAA', 'YTAAAA', 'OOOOxx'),
+(4894, 519, 0, 2, 4, 14, 94, 894, 894, 4894, 4894, 188, 189, 'GGAAAA', 'ZTAAAA', 'VVVVxx'),
+(3090, 520, 0, 2, 0, 10, 90, 90, 1090, 3090, 3090, 180, 181, 'WOAAAA', 'AUAAAA', 'AAAAxx'),
+(759, 521, 1, 3, 9, 19, 59, 759, 759, 759, 759, 118, 119, 'FDAAAA', 'BUAAAA', 'HHHHxx'),
+(4864, 522, 0, 0, 4, 4, 64, 864, 864, 4864, 4864, 128, 129, 'CFAAAA', 'CUAAAA', 'OOOOxx'),
+(4083, 523, 1, 3, 3, 3, 83, 83, 83, 4083, 4083, 166, 167, 'BBAAAA', 'DUAAAA', 'VVVVxx'),
+(6918, 524, 0, 2, 8, 18, 18, 918, 918, 1918, 6918, 36, 37, 'CGAAAA', 'EUAAAA', 'AAAAxx'),
+(8146, 525, 0, 2, 6, 6, 46, 146, 146, 3146, 8146, 92, 93, 'IBAAAA', 'FUAAAA', 'HHHHxx'),
+(1523, 526, 1, 3, 3, 3, 23, 523, 1523, 1523, 1523, 46, 47, 'PGAAAA', 'GUAAAA', 'OOOOxx'),
+(1591, 527, 1, 3, 1, 11, 91, 591, 1591, 1591, 1591, 182, 183, 'FJAAAA', 'HUAAAA', 'VVVVxx'),
+(3343, 528, 1, 3, 3, 3, 43, 343, 1343, 3343, 3343, 86, 87, 'PYAAAA', 'IUAAAA', 'AAAAxx'),
+(1391, 529, 1, 3, 1, 11, 91, 391, 1391, 1391, 1391, 182, 183, 'NBAAAA', 'JUAAAA', 'HHHHxx'),
+(9963, 530, 1, 3, 3, 3, 63, 963, 1963, 4963, 9963, 126, 127, 'FTAAAA', 'KUAAAA', 'OOOOxx'),
+(2423, 531, 1, 3, 3, 3, 23, 423, 423, 2423, 2423, 46, 47, 'FPAAAA', 'LUAAAA', 'VVVVxx'),
+(1822, 532, 0, 2, 2, 2, 22, 822, 1822, 1822, 1822, 44, 45, 'CSAAAA', 'MUAAAA', 'AAAAxx'),
+(8706, 533, 0, 2, 6, 6, 6, 706, 706, 3706, 8706, 12, 13, 'WWAAAA', 'NUAAAA', 'HHHHxx'),
+(3001, 534, 1, 1, 1, 1, 1, 1, 1001, 3001, 3001, 2, 3, 'LLAAAA', 'OUAAAA', 'OOOOxx'),
+(6707, 535, 1, 3, 7, 7, 7, 707, 707, 1707, 6707, 14, 15, 'ZXAAAA', 'PUAAAA', 'VVVVxx'),
+(2121, 536, 1, 1, 1, 1, 21, 121, 121, 2121, 2121, 42, 43, 'PDAAAA', 'QUAAAA', 'AAAAxx'),
+(5814, 537, 0, 2, 4, 14, 14, 814, 1814, 814, 5814, 28, 29, 'QPAAAA', 'RUAAAA', 'HHHHxx'),
+(2659, 538, 1, 3, 9, 19, 59, 659, 659, 2659, 2659, 118, 119, 'HYAAAA', 'SUAAAA', 'OOOOxx'),
+(2016, 539, 0, 0, 6, 16, 16, 16, 16, 2016, 2016, 32, 33, 'OZAAAA', 'TUAAAA', 'VVVVxx'),
+(4286, 540, 0, 2, 6, 6, 86, 286, 286, 4286, 4286, 172, 173, 'WIAAAA', 'UUAAAA', 'AAAAxx'),
+(9205, 541, 1, 1, 5, 5, 5, 205, 1205, 4205, 9205, 10, 11, 'BQAAAA', 'VUAAAA', 'HHHHxx'),
+(3496, 542, 0, 0, 6, 16, 96, 496, 1496, 3496, 3496, 192, 193, 'MEAAAA', 'WUAAAA', 'OOOOxx'),
+(5333, 543, 1, 1, 3, 13, 33, 333, 1333, 333, 5333, 66, 67, 'DXAAAA', 'XUAAAA', 'VVVVxx'),
+(5571, 544, 1, 3, 1, 11, 71, 571, 1571, 571, 5571, 142, 143, 'HGAAAA', 'YUAAAA', 'AAAAxx'),
+(1696, 545, 0, 0, 6, 16, 96, 696, 1696, 1696, 1696, 192, 193, 'GNAAAA', 'ZUAAAA', 'HHHHxx'),
+(4871, 546, 1, 3, 1, 11, 71, 871, 871, 4871, 4871, 142, 143, 'JFAAAA', 'AVAAAA', 'OOOOxx'),
+(4852, 547, 0, 0, 2, 12, 52, 852, 852, 4852, 4852, 104, 105, 'QEAAAA', 'BVAAAA', 'VVVVxx'),
+(8483, 548, 1, 3, 3, 3, 83, 483, 483, 3483, 8483, 166, 167, 'HOAAAA', 'CVAAAA', 'AAAAxx'),
+(1376, 549, 0, 0, 6, 16, 76, 376, 1376, 1376, 1376, 152, 153, 'YAAAAA', 'DVAAAA', 'HHHHxx'),
+(5456, 550, 0, 0, 6, 16, 56, 456, 1456, 456, 5456, 112, 113, 'WBAAAA', 'EVAAAA', 'OOOOxx'),
+(499, 551, 1, 3, 9, 19, 99, 499, 499, 499, 499, 198, 199, 'FTAAAA', 'FVAAAA', 'VVVVxx'),
+(3463, 552, 1, 3, 3, 3, 63, 463, 1463, 3463, 3463, 126, 127, 'FDAAAA', 'GVAAAA', 'AAAAxx'),
+(7426, 553, 0, 2, 6, 6, 26, 426, 1426, 2426, 7426, 52, 53, 'QZAAAA', 'HVAAAA', 'HHHHxx'),
+(5341, 554, 1, 1, 1, 1, 41, 341, 1341, 341, 5341, 82, 83, 'LXAAAA', 'IVAAAA', 'OOOOxx'),
+(9309, 555, 1, 1, 9, 9, 9, 309, 1309, 4309, 9309, 18, 19, 'BUAAAA', 'JVAAAA', 'VVVVxx'),
+(2055, 556, 1, 3, 5, 15, 55, 55, 55, 2055, 2055, 110, 111, 'BBAAAA', 'KVAAAA', 'AAAAxx'),
+(2199, 557, 1, 3, 9, 19, 99, 199, 199, 2199, 2199, 198, 199, 'PGAAAA', 'LVAAAA', 'HHHHxx'),
+(7235, 558, 1, 3, 5, 15, 35, 235, 1235, 2235, 7235, 70, 71, 'HSAAAA', 'MVAAAA', 'OOOOxx'),
+(8661, 559, 1, 1, 1, 1, 61, 661, 661, 3661, 8661, 122, 123, 'DVAAAA', 'NVAAAA', 'VVVVxx'),
+(9494, 560, 0, 2, 4, 14, 94, 494, 1494, 4494, 9494, 188, 189, 'EBAAAA', 'OVAAAA', 'AAAAxx'),
+(935, 561, 1, 3, 5, 15, 35, 935, 935, 935, 935, 70, 71, 'ZJAAAA', 'PVAAAA', 'HHHHxx'),
+(7044, 562, 0, 0, 4, 4, 44, 44, 1044, 2044, 7044, 88, 89, 'YKAAAA', 'QVAAAA', 'OOOOxx'),
+(1974, 563, 0, 2, 4, 14, 74, 974, 1974, 1974, 1974, 148, 149, 'YXAAAA', 'RVAAAA', 'VVVVxx'),
+(9679, 564, 1, 3, 9, 19, 79, 679, 1679, 4679, 9679, 158, 159, 'HIAAAA', 'SVAAAA', 'AAAAxx'),
+(9822, 565, 0, 2, 2, 2, 22, 822, 1822, 4822, 9822, 44, 45, 'UNAAAA', 'TVAAAA', 'HHHHxx'),
+(4088, 566, 0, 0, 8, 8, 88, 88, 88, 4088, 4088, 176, 177, 'GBAAAA', 'UVAAAA', 'OOOOxx'),
+(1749, 567, 1, 1, 9, 9, 49, 749, 1749, 1749, 1749, 98, 99, 'HPAAAA', 'VVAAAA', 'VVVVxx'),
+(2116, 568, 0, 0, 6, 16, 16, 116, 116, 2116, 2116, 32, 33, 'KDAAAA', 'WVAAAA', 'AAAAxx'),
+(976, 569, 0, 0, 6, 16, 76, 976, 976, 976, 976, 152, 153, 'OLAAAA', 'XVAAAA', 'HHHHxx'),
+(8689, 570, 1, 1, 9, 9, 89, 689, 689, 3689, 8689, 178, 179, 'FWAAAA', 'YVAAAA', 'OOOOxx'),
+(2563, 571, 1, 3, 3, 3, 63, 563, 563, 2563, 2563, 126, 127, 'PUAAAA', 'ZVAAAA', 'VVVVxx'),
+(7195, 572, 1, 3, 5, 15, 95, 195, 1195, 2195, 7195, 190, 191, 'TQAAAA', 'AWAAAA', 'AAAAxx'),
+(9985, 573, 1, 1, 5, 5, 85, 985, 1985, 4985, 9985, 170, 171, 'BUAAAA', 'BWAAAA', 'HHHHxx'),
+(7699, 574, 1, 3, 9, 19, 99, 699, 1699, 2699, 7699, 198, 199, 'DKAAAA', 'CWAAAA', 'OOOOxx'),
+(5311, 575, 1, 3, 1, 11, 11, 311, 1311, 311, 5311, 22, 23, 'HWAAAA', 'DWAAAA', 'VVVVxx'),
+(295, 576, 1, 3, 5, 15, 95, 295, 295, 295, 295, 190, 191, 'JLAAAA', 'EWAAAA', 'AAAAxx'),
+(8214, 577, 0, 2, 4, 14, 14, 214, 214, 3214, 8214, 28, 29, 'YDAAAA', 'FWAAAA', 'HHHHxx'),
+(3275, 578, 1, 3, 5, 15, 75, 275, 1275, 3275, 3275, 150, 151, 'ZVAAAA', 'GWAAAA', 'OOOOxx'),
+(9646, 579, 0, 2, 6, 6, 46, 646, 1646, 4646, 9646, 92, 93, 'AHAAAA', 'HWAAAA', 'VVVVxx'),
+(1908, 580, 0, 0, 8, 8, 8, 908, 1908, 1908, 1908, 16, 17, 'KVAAAA', 'IWAAAA', 'AAAAxx'),
+(3858, 581, 0, 2, 8, 18, 58, 858, 1858, 3858, 3858, 116, 117, 'KSAAAA', 'JWAAAA', 'HHHHxx'),
+(9362, 582, 0, 2, 2, 2, 62, 362, 1362, 4362, 9362, 124, 125, 'CWAAAA', 'KWAAAA', 'OOOOxx'),
+(9307, 583, 1, 3, 7, 7, 7, 307, 1307, 4307, 9307, 14, 15, 'ZTAAAA', 'LWAAAA', 'VVVVxx'),
+(6124, 584, 0, 0, 4, 4, 24, 124, 124, 1124, 6124, 48, 49, 'OBAAAA', 'MWAAAA', 'AAAAxx'),
+(2405, 585, 1, 1, 5, 5, 5, 405, 405, 2405, 2405, 10, 11, 'NOAAAA', 'NWAAAA', 'HHHHxx'),
+(8422, 586, 0, 2, 2, 2, 22, 422, 422, 3422, 8422, 44, 45, 'YLAAAA', 'OWAAAA', 'OOOOxx'),
+(393, 587, 1, 1, 3, 13, 93, 393, 393, 393, 393, 186, 187, 'DPAAAA', 'PWAAAA', 'VVVVxx'),
+(8973, 588, 1, 1, 3, 13, 73, 973, 973, 3973, 8973, 146, 147, 'DHAAAA', 'QWAAAA', 'AAAAxx'),
+(5171, 589, 1, 3, 1, 11, 71, 171, 1171, 171, 5171, 142, 143, 'XQAAAA', 'RWAAAA', 'HHHHxx'),
+(4929, 590, 1, 1, 9, 9, 29, 929, 929, 4929, 4929, 58, 59, 'PHAAAA', 'SWAAAA', 'OOOOxx'),
+(6935, 591, 1, 3, 5, 15, 35, 935, 935, 1935, 6935, 70, 71, 'TGAAAA', 'TWAAAA', 'VVVVxx'),
+(8584, 592, 0, 0, 4, 4, 84, 584, 584, 3584, 8584, 168, 169, 'ESAAAA', 'UWAAAA', 'AAAAxx'),
+(1035, 593, 1, 3, 5, 15, 35, 35, 1035, 1035, 1035, 70, 71, 'VNAAAA', 'VWAAAA', 'HHHHxx'),
+(3734, 594, 0, 2, 4, 14, 34, 734, 1734, 3734, 3734, 68, 69, 'QNAAAA', 'WWAAAA', 'OOOOxx'),
+(1458, 595, 0, 2, 8, 18, 58, 458, 1458, 1458, 1458, 116, 117, 'CEAAAA', 'XWAAAA', 'VVVVxx'),
+(8746, 596, 0, 2, 6, 6, 46, 746, 746, 3746, 8746, 92, 93, 'KYAAAA', 'YWAAAA', 'AAAAxx'),
+(1677, 597, 1, 1, 7, 17, 77, 677, 1677, 1677, 1677, 154, 155, 'NMAAAA', 'ZWAAAA', 'HHHHxx'),
+(8502, 598, 0, 2, 2, 2, 2, 502, 502, 3502, 8502, 4, 5, 'APAAAA', 'AXAAAA', 'OOOOxx'),
+(7752, 599, 0, 0, 2, 12, 52, 752, 1752, 2752, 7752, 104, 105, 'EMAAAA', 'BXAAAA', 'VVVVxx'),
+(2556, 600, 0, 0, 6, 16, 56, 556, 556, 2556, 2556, 112, 113, 'IUAAAA', 'CXAAAA', 'AAAAxx'),
+(6426, 601, 0, 2, 6, 6, 26, 426, 426, 1426, 6426, 52, 53, 'ENAAAA', 'DXAAAA', 'HHHHxx'),
+(8420, 602, 0, 0, 0, 0, 20, 420, 420, 3420, 8420, 40, 41, 'WLAAAA', 'EXAAAA', 'OOOOxx'),
+(4462, 603, 0, 2, 2, 2, 62, 462, 462, 4462, 4462, 124, 125, 'QPAAAA', 'FXAAAA', 'VVVVxx'),
+(1378, 604, 0, 2, 8, 18, 78, 378, 1378, 1378, 1378, 156, 157, 'ABAAAA', 'GXAAAA', 'AAAAxx'),
+(1387, 605, 1, 3, 7, 7, 87, 387, 1387, 1387, 1387, 174, 175, 'JBAAAA', 'HXAAAA', 'HHHHxx'),
+(8094, 606, 0, 2, 4, 14, 94, 94, 94, 3094, 8094, 188, 189, 'IZAAAA', 'IXAAAA', 'OOOOxx'),
+(7247, 607, 1, 3, 7, 7, 47, 247, 1247, 2247, 7247, 94, 95, 'TSAAAA', 'JXAAAA', 'VVVVxx'),
+(4261, 608, 1, 1, 1, 1, 61, 261, 261, 4261, 4261, 122, 123, 'XHAAAA', 'KXAAAA', 'AAAAxx'),
+(5029, 609, 1, 1, 9, 9, 29, 29, 1029, 29, 5029, 58, 59, 'LLAAAA', 'LXAAAA', 'HHHHxx'),
+(3625, 610, 1, 1, 5, 5, 25, 625, 1625, 3625, 3625, 50, 51, 'LJAAAA', 'MXAAAA', 'OOOOxx'),
+(8068, 611, 0, 0, 8, 8, 68, 68, 68, 3068, 8068, 136, 137, 'IYAAAA', 'NXAAAA', 'VVVVxx'),
+(102, 612, 0, 2, 2, 2, 2, 102, 102, 102, 102, 4, 5, 'YDAAAA', 'OXAAAA', 'AAAAxx'),
+(5596, 613, 0, 0, 6, 16, 96, 596, 1596, 596, 5596, 192, 193, 'GHAAAA', 'PXAAAA', 'HHHHxx'),
+(5872, 614, 0, 0, 2, 12, 72, 872, 1872, 872, 5872, 144, 145, 'WRAAAA', 'QXAAAA', 'OOOOxx'),
+(4742, 615, 0, 2, 2, 2, 42, 742, 742, 4742, 4742, 84, 85, 'KAAAAA', 'RXAAAA', 'VVVVxx'),
+(2117, 616, 1, 1, 7, 17, 17, 117, 117, 2117, 2117, 34, 35, 'LDAAAA', 'SXAAAA', 'AAAAxx'),
+(3945, 617, 1, 1, 5, 5, 45, 945, 1945, 3945, 3945, 90, 91, 'TVAAAA', 'TXAAAA', 'HHHHxx'),
+(7483, 618, 1, 3, 3, 3, 83, 483, 1483, 2483, 7483, 166, 167, 'VBAAAA', 'UXAAAA', 'OOOOxx'),
+(4455, 619, 1, 3, 5, 15, 55, 455, 455, 4455, 4455, 110, 111, 'JPAAAA', 'VXAAAA', 'VVVVxx'),
+(609, 620, 1, 1, 9, 9, 9, 609, 609, 609, 609, 18, 19, 'LXAAAA', 'WXAAAA', 'AAAAxx'),
+(9829, 621, 1, 1, 9, 9, 29, 829, 1829, 4829, 9829, 58, 59, 'BOAAAA', 'XXAAAA', 'HHHHxx'),
+(4857, 622, 1, 1, 7, 17, 57, 857, 857, 4857, 4857, 114, 115, 'VEAAAA', 'YXAAAA', 'OOOOxx'),
+(3314, 623, 0, 2, 4, 14, 14, 314, 1314, 3314, 3314, 28, 29, 'MXAAAA', 'ZXAAAA', 'VVVVxx'),
+(5353, 624, 1, 1, 3, 13, 53, 353, 1353, 353, 5353, 106, 107, 'XXAAAA', 'AYAAAA', 'AAAAxx'),
+(4909, 625, 1, 1, 9, 9, 9, 909, 909, 4909, 4909, 18, 19, 'VGAAAA', 'BYAAAA', 'HHHHxx'),
+(7597, 626, 1, 1, 7, 17, 97, 597, 1597, 2597, 7597, 194, 195, 'FGAAAA', 'CYAAAA', 'OOOOxx'),
+(2683, 627, 1, 3, 3, 3, 83, 683, 683, 2683, 2683, 166, 167, 'FZAAAA', 'DYAAAA', 'VVVVxx'),
+(3223, 628, 1, 3, 3, 3, 23, 223, 1223, 3223, 3223, 46, 47, 'ZTAAAA', 'EYAAAA', 'AAAAxx'),
+(5363, 629, 1, 3, 3, 3, 63, 363, 1363, 363, 5363, 126, 127, 'HYAAAA', 'FYAAAA', 'HHHHxx'),
+(4578, 630, 0, 2, 8, 18, 78, 578, 578, 4578, 4578, 156, 157, 'CUAAAA', 'GYAAAA', 'OOOOxx'),
+(5544, 631, 0, 0, 4, 4, 44, 544, 1544, 544, 5544, 88, 89, 'GFAAAA', 'HYAAAA', 'VVVVxx'),
+(1589, 632, 1, 1, 9, 9, 89, 589, 1589, 1589, 1589, 178, 179, 'DJAAAA', 'IYAAAA', 'AAAAxx'),
+(7412, 633, 0, 0, 2, 12, 12, 412, 1412, 2412, 7412, 24, 25, 'CZAAAA', 'JYAAAA', 'HHHHxx'),
+(3803, 634, 1, 3, 3, 3, 3, 803, 1803, 3803, 3803, 6, 7, 'HQAAAA', 'KYAAAA', 'OOOOxx'),
+(6179, 635, 1, 3, 9, 19, 79, 179, 179, 1179, 6179, 158, 159, 'RDAAAA', 'LYAAAA', 'VVVVxx'),
+(5588, 636, 0, 0, 8, 8, 88, 588, 1588, 588, 5588, 176, 177, 'YGAAAA', 'MYAAAA', 'AAAAxx'),
+(2134, 637, 0, 2, 4, 14, 34, 134, 134, 2134, 2134, 68, 69, 'CEAAAA', 'NYAAAA', 'HHHHxx'),
+(4383, 638, 1, 3, 3, 3, 83, 383, 383, 4383, 4383, 166, 167, 'PMAAAA', 'OYAAAA', 'OOOOxx'),
+(6995, 639, 1, 3, 5, 15, 95, 995, 995, 1995, 6995, 190, 191, 'BJAAAA', 'PYAAAA', 'VVVVxx'),
+(6598, 640, 0, 2, 8, 18, 98, 598, 598, 1598, 6598, 196, 197, 'UTAAAA', 'QYAAAA', 'AAAAxx'),
+(8731, 641, 1, 3, 1, 11, 31, 731, 731, 3731, 8731, 62, 63, 'VXAAAA', 'RYAAAA', 'HHHHxx'),
+(7177, 642, 1, 1, 7, 17, 77, 177, 1177, 2177, 7177, 154, 155, 'BQAAAA', 'SYAAAA', 'OOOOxx'),
+(6578, 643, 0, 2, 8, 18, 78, 578, 578, 1578, 6578, 156, 157, 'ATAAAA', 'TYAAAA', 'VVVVxx'),
+(9393, 644, 1, 1, 3, 13, 93, 393, 1393, 4393, 9393, 186, 187, 'HXAAAA', 'UYAAAA', 'AAAAxx'),
+(1276, 645, 0, 0, 6, 16, 76, 276, 1276, 1276, 1276, 152, 153, 'CXAAAA', 'VYAAAA', 'HHHHxx'),
+(8766, 646, 0, 2, 6, 6, 66, 766, 766, 3766, 8766, 132, 133, 'EZAAAA', 'WYAAAA', 'OOOOxx'),
+(1015, 647, 1, 3, 5, 15, 15, 15, 1015, 1015, 1015, 30, 31, 'BNAAAA', 'XYAAAA', 'VVVVxx'),
+(4396, 648, 0, 0, 6, 16, 96, 396, 396, 4396, 4396, 192, 193, 'CNAAAA', 'YYAAAA', 'AAAAxx'),
+(5564, 649, 0, 0, 4, 4, 64, 564, 1564, 564, 5564, 128, 129, 'AGAAAA', 'ZYAAAA', 'HHHHxx'),
+(927, 650, 1, 3, 7, 7, 27, 927, 927, 927, 927, 54, 55, 'RJAAAA', 'AZAAAA', 'OOOOxx'),
+(3306, 651, 0, 2, 6, 6, 6, 306, 1306, 3306, 3306, 12, 13, 'EXAAAA', 'BZAAAA', 'VVVVxx'),
+(1615, 652, 1, 3, 5, 15, 15, 615, 1615, 1615, 1615, 30, 31, 'DKAAAA', 'CZAAAA', 'AAAAxx'),
+(4550, 653, 0, 2, 0, 10, 50, 550, 550, 4550, 4550, 100, 101, 'ATAAAA', 'DZAAAA', 'HHHHxx'),
+(2468, 654, 0, 0, 8, 8, 68, 468, 468, 2468, 2468, 136, 137, 'YQAAAA', 'EZAAAA', 'OOOOxx'),
+(5336, 655, 0, 0, 6, 16, 36, 336, 1336, 336, 5336, 72, 73, 'GXAAAA', 'FZAAAA', 'VVVVxx'),
+(4471, 656, 1, 3, 1, 11, 71, 471, 471, 4471, 4471, 142, 143, 'ZPAAAA', 'GZAAAA', 'AAAAxx'),
+(8085, 657, 1, 1, 5, 5, 85, 85, 85, 3085, 8085, 170, 171, 'ZYAAAA', 'HZAAAA', 'HHHHxx'),
+(540, 658, 0, 0, 0, 0, 40, 540, 540, 540, 540, 80, 81, 'UUAAAA', 'IZAAAA', 'OOOOxx'),
+(5108, 659, 0, 0, 8, 8, 8, 108, 1108, 108, 5108, 16, 17, 'MOAAAA', 'JZAAAA', 'VVVVxx'),
+(8015, 660, 1, 3, 5, 15, 15, 15, 15, 3015, 8015, 30, 31, 'HWAAAA', 'KZAAAA', 'AAAAxx'),
+(2857, 661, 1, 1, 7, 17, 57, 857, 857, 2857, 2857, 114, 115, 'XFAAAA', 'LZAAAA', 'HHHHxx'),
+(9472, 662, 0, 0, 2, 12, 72, 472, 1472, 4472, 9472, 144, 145, 'IAAAAA', 'MZAAAA', 'OOOOxx'),
+(5666, 663, 0, 2, 6, 6, 66, 666, 1666, 666, 5666, 132, 133, 'YJAAAA', 'NZAAAA', 'VVVVxx'),
+(3555, 664, 1, 3, 5, 15, 55, 555, 1555, 3555, 3555, 110, 111, 'TGAAAA', 'OZAAAA', 'AAAAxx'),
+(378, 665, 0, 2, 8, 18, 78, 378, 378, 378, 378, 156, 157, 'OOAAAA', 'PZAAAA', 'HHHHxx'),
+(4466, 666, 0, 2, 6, 6, 66, 466, 466, 4466, 4466, 132, 133, 'UPAAAA', 'QZAAAA', 'OOOOxx'),
+(3247, 667, 1, 3, 7, 7, 47, 247, 1247, 3247, 3247, 94, 95, 'XUAAAA', 'RZAAAA', 'VVVVxx'),
+(6570, 668, 0, 2, 0, 10, 70, 570, 570, 1570, 6570, 140, 141, 'SSAAAA', 'SZAAAA', 'AAAAxx'),
+(5655, 669, 1, 3, 5, 15, 55, 655, 1655, 655, 5655, 110, 111, 'NJAAAA', 'TZAAAA', 'HHHHxx'),
+(917, 670, 1, 1, 7, 17, 17, 917, 917, 917, 917, 34, 35, 'HJAAAA', 'UZAAAA', 'OOOOxx'),
+(3637, 671, 1, 1, 7, 17, 37, 637, 1637, 3637, 3637, 74, 75, 'XJAAAA', 'VZAAAA', 'VVVVxx'),
+(3668, 672, 0, 0, 8, 8, 68, 668, 1668, 3668, 3668, 136, 137, 'CLAAAA', 'WZAAAA', 'AAAAxx'),
+(5644, 673, 0, 0, 4, 4, 44, 644, 1644, 644, 5644, 88, 89, 'CJAAAA', 'XZAAAA', 'HHHHxx'),
+(8286, 674, 0, 2, 6, 6, 86, 286, 286, 3286, 8286, 172, 173, 'SGAAAA', 'YZAAAA', 'OOOOxx'),
+(6896, 675, 0, 0, 6, 16, 96, 896, 896, 1896, 6896, 192, 193, 'GFAAAA', 'ZZAAAA', 'VVVVxx'),
+(2870, 676, 0, 2, 0, 10, 70, 870, 870, 2870, 2870, 140, 141, 'KGAAAA', 'AABAAA', 'AAAAxx'),
+(8041, 677, 1, 1, 1, 1, 41, 41, 41, 3041, 8041, 82, 83, 'HXAAAA', 'BABAAA', 'HHHHxx'),
+(8137, 678, 1, 1, 7, 17, 37, 137, 137, 3137, 8137, 74, 75, 'ZAAAAA', 'CABAAA', 'OOOOxx'),
+(4823, 679, 1, 3, 3, 3, 23, 823, 823, 4823, 4823, 46, 47, 'NDAAAA', 'DABAAA', 'VVVVxx'),
+(2438, 680, 0, 2, 8, 18, 38, 438, 438, 2438, 2438, 76, 77, 'UPAAAA', 'EABAAA', 'AAAAxx'),
+(6329, 681, 1, 1, 9, 9, 29, 329, 329, 1329, 6329, 58, 59, 'LJAAAA', 'FABAAA', 'HHHHxx'),
+(623, 682, 1, 3, 3, 3, 23, 623, 623, 623, 623, 46, 47, 'ZXAAAA', 'GABAAA', 'OOOOxx'),
+(1360, 683, 0, 0, 0, 0, 60, 360, 1360, 1360, 1360, 120, 121, 'IAAAAA', 'HABAAA', 'VVVVxx'),
+(7987, 684, 1, 3, 7, 7, 87, 987, 1987, 2987, 7987, 174, 175, 'FVAAAA', 'IABAAA', 'AAAAxx'),
+(9788, 685, 0, 0, 8, 8, 88, 788, 1788, 4788, 9788, 176, 177, 'MMAAAA', 'JABAAA', 'HHHHxx'),
+(3212, 686, 0, 0, 2, 12, 12, 212, 1212, 3212, 3212, 24, 25, 'OTAAAA', 'KABAAA', 'OOOOxx'),
+(2725, 687, 1, 1, 5, 5, 25, 725, 725, 2725, 2725, 50, 51, 'VAAAAA', 'LABAAA', 'VVVVxx'),
+(7837, 688, 1, 1, 7, 17, 37, 837, 1837, 2837, 7837, 74, 75, 'LPAAAA', 'MABAAA', 'AAAAxx'),
+(4746, 689, 0, 2, 6, 6, 46, 746, 746, 4746, 4746, 92, 93, 'OAAAAA', 'NABAAA', 'HHHHxx'),
+(3986, 690, 0, 2, 6, 6, 86, 986, 1986, 3986, 3986, 172, 173, 'IXAAAA', 'OABAAA', 'OOOOxx'),
+(9128, 691, 0, 0, 8, 8, 28, 128, 1128, 4128, 9128, 56, 57, 'CNAAAA', 'PABAAA', 'VVVVxx'),
+(5044, 692, 0, 0, 4, 4, 44, 44, 1044, 44, 5044, 88, 89, 'AMAAAA', 'QABAAA', 'AAAAxx'),
+(8132, 693, 0, 0, 2, 12, 32, 132, 132, 3132, 8132, 64, 65, 'UAAAAA', 'RABAAA', 'HHHHxx'),
+(9992, 694, 0, 0, 2, 12, 92, 992, 1992, 4992, 9992, 184, 185, 'IUAAAA', 'SABAAA', 'OOOOxx'),
+(8468, 695, 0, 0, 8, 8, 68, 468, 468, 3468, 8468, 136, 137, 'SNAAAA', 'TABAAA', 'VVVVxx'),
+(6876, 696, 0, 0, 6, 16, 76, 876, 876, 1876, 6876, 152, 153, 'MEAAAA', 'UABAAA', 'AAAAxx'),
+(3532, 697, 0, 0, 2, 12, 32, 532, 1532, 3532, 3532, 64, 65, 'WFAAAA', 'VABAAA', 'HHHHxx'),
+(2140, 698, 0, 0, 0, 0, 40, 140, 140, 2140, 2140, 80, 81, 'IEAAAA', 'WABAAA', 'OOOOxx'),
+(2183, 699, 1, 3, 3, 3, 83, 183, 183, 2183, 2183, 166, 167, 'ZFAAAA', 'XABAAA', 'VVVVxx'),
+(9766, 700, 0, 2, 6, 6, 66, 766, 1766, 4766, 9766, 132, 133, 'QLAAAA', 'YABAAA', 'AAAAxx'),
+(7943, 701, 1, 3, 3, 3, 43, 943, 1943, 2943, 7943, 86, 87, 'NTAAAA', 'ZABAAA', 'HHHHxx'),
+(9243, 702, 1, 3, 3, 3, 43, 243, 1243, 4243, 9243, 86, 87, 'NRAAAA', 'ABBAAA', 'OOOOxx'),
+(6241, 703, 1, 1, 1, 1, 41, 241, 241, 1241, 6241, 82, 83, 'BGAAAA', 'BBBAAA', 'VVVVxx'),
+(9540, 704, 0, 0, 0, 0, 40, 540, 1540, 4540, 9540, 80, 81, 'YCAAAA', 'CBBAAA', 'AAAAxx'),
+(7418, 705, 0, 2, 8, 18, 18, 418, 1418, 2418, 7418, 36, 37, 'IZAAAA', 'DBBAAA', 'HHHHxx'),
+(1603, 706, 1, 3, 3, 3, 3, 603, 1603, 1603, 1603, 6, 7, 'RJAAAA', 'EBBAAA', 'OOOOxx'),
+(8950, 707, 0, 2, 0, 10, 50, 950, 950, 3950, 8950, 100, 101, 'GGAAAA', 'FBBAAA', 'VVVVxx'),
+(6933, 708, 1, 1, 3, 13, 33, 933, 933, 1933, 6933, 66, 67, 'RGAAAA', 'GBBAAA', 'AAAAxx'),
+(2646, 709, 0, 2, 6, 6, 46, 646, 646, 2646, 2646, 92, 93, 'UXAAAA', 'HBBAAA', 'HHHHxx'),
+(3447, 710, 1, 3, 7, 7, 47, 447, 1447, 3447, 3447, 94, 95, 'PCAAAA', 'IBBAAA', 'OOOOxx'),
+(9957, 711, 1, 1, 7, 17, 57, 957, 1957, 4957, 9957, 114, 115, 'ZSAAAA', 'JBBAAA', 'VVVVxx'),
+(4623, 712, 1, 3, 3, 3, 23, 623, 623, 4623, 4623, 46, 47, 'VVAAAA', 'KBBAAA', 'AAAAxx'),
+(9058, 713, 0, 2, 8, 18, 58, 58, 1058, 4058, 9058, 116, 117, 'KKAAAA', 'LBBAAA', 'HHHHxx'),
+(7361, 714, 1, 1, 1, 1, 61, 361, 1361, 2361, 7361, 122, 123, 'DXAAAA', 'MBBAAA', 'OOOOxx'),
+(2489, 715, 1, 1, 9, 9, 89, 489, 489, 2489, 2489, 178, 179, 'TRAAAA', 'NBBAAA', 'VVVVxx'),
+(7643, 716, 1, 3, 3, 3, 43, 643, 1643, 2643, 7643, 86, 87, 'ZHAAAA', 'OBBAAA', 'AAAAxx'),
+(9166, 717, 0, 2, 6, 6, 66, 166, 1166, 4166, 9166, 132, 133, 'OOAAAA', 'PBBAAA', 'HHHHxx'),
+(7789, 718, 1, 1, 9, 9, 89, 789, 1789, 2789, 7789, 178, 179, 'PNAAAA', 'QBBAAA', 'OOOOxx'),
+(2332, 719, 0, 0, 2, 12, 32, 332, 332, 2332, 2332, 64, 65, 'SLAAAA', 'RBBAAA', 'VVVVxx'),
+(1832, 720, 0, 0, 2, 12, 32, 832, 1832, 1832, 1832, 64, 65, 'MSAAAA', 'SBBAAA', 'AAAAxx'),
+(8375, 721, 1, 3, 5, 15, 75, 375, 375, 3375, 8375, 150, 151, 'DKAAAA', 'TBBAAA', 'HHHHxx'),
+(948, 722, 0, 0, 8, 8, 48, 948, 948, 948, 948, 96, 97, 'MKAAAA', 'UBBAAA', 'OOOOxx'),
+(5613, 723, 1, 1, 3, 13, 13, 613, 1613, 613, 5613, 26, 27, 'XHAAAA', 'VBBAAA', 'VVVVxx'),
+(6310, 724, 0, 2, 0, 10, 10, 310, 310, 1310, 6310, 20, 21, 'SIAAAA', 'WBBAAA', 'AAAAxx'),
+(4254, 725, 0, 2, 4, 14, 54, 254, 254, 4254, 4254, 108, 109, 'QHAAAA', 'XBBAAA', 'HHHHxx'),
+(4260, 726, 0, 0, 0, 0, 60, 260, 260, 4260, 4260, 120, 121, 'WHAAAA', 'YBBAAA', 'OOOOxx'),
+(2060, 727, 0, 0, 0, 0, 60, 60, 60, 2060, 2060, 120, 121, 'GBAAAA', 'ZBBAAA', 'VVVVxx'),
+(4831, 728, 1, 3, 1, 11, 31, 831, 831, 4831, 4831, 62, 63, 'VDAAAA', 'ACBAAA', 'AAAAxx'),
+(6176, 729, 0, 0, 6, 16, 76, 176, 176, 1176, 6176, 152, 153, 'ODAAAA', 'BCBAAA', 'HHHHxx'),
+(6688, 730, 0, 0, 8, 8, 88, 688, 688, 1688, 6688, 176, 177, 'GXAAAA', 'CCBAAA', 'OOOOxx'),
+(5752, 731, 0, 0, 2, 12, 52, 752, 1752, 752, 5752, 104, 105, 'GNAAAA', 'DCBAAA', 'VVVVxx'),
+(8714, 732, 0, 2, 4, 14, 14, 714, 714, 3714, 8714, 28, 29, 'EXAAAA', 'ECBAAA', 'AAAAxx'),
+(6739, 733, 1, 3, 9, 19, 39, 739, 739, 1739, 6739, 78, 79, 'FZAAAA', 'FCBAAA', 'HHHHxx'),
+(7066, 734, 0, 2, 6, 6, 66, 66, 1066, 2066, 7066, 132, 133, 'ULAAAA', 'GCBAAA', 'OOOOxx'),
+(7250, 735, 0, 2, 0, 10, 50, 250, 1250, 2250, 7250, 100, 101, 'WSAAAA', 'HCBAAA', 'VVVVxx'),
+(3161, 736, 1, 1, 1, 1, 61, 161, 1161, 3161, 3161, 122, 123, 'PRAAAA', 'ICBAAA', 'AAAAxx'),
+(1411, 737, 1, 3, 1, 11, 11, 411, 1411, 1411, 1411, 22, 23, 'HCAAAA', 'JCBAAA', 'HHHHxx'),
+(9301, 738, 1, 1, 1, 1, 1, 301, 1301, 4301, 9301, 2, 3, 'TTAAAA', 'KCBAAA', 'OOOOxx'),
+(8324, 739, 0, 0, 4, 4, 24, 324, 324, 3324, 8324, 48, 49, 'EIAAAA', 'LCBAAA', 'VVVVxx'),
+(9641, 740, 1, 1, 1, 1, 41, 641, 1641, 4641, 9641, 82, 83, 'VGAAAA', 'MCBAAA', 'AAAAxx'),
+(7077, 741, 1, 1, 7, 17, 77, 77, 1077, 2077, 7077, 154, 155, 'FMAAAA', 'NCBAAA', 'HHHHxx'),
+(9888, 742, 0, 0, 8, 8, 88, 888, 1888, 4888, 9888, 176, 177, 'IQAAAA', 'OCBAAA', 'OOOOxx'),
+(9909, 743, 1, 1, 9, 9, 9, 909, 1909, 4909, 9909, 18, 19, 'DRAAAA', 'PCBAAA', 'VVVVxx'),
+(2209, 744, 1, 1, 9, 9, 9, 209, 209, 2209, 2209, 18, 19, 'ZGAAAA', 'QCBAAA', 'AAAAxx'),
+(6904, 745, 0, 0, 4, 4, 4, 904, 904, 1904, 6904, 8, 9, 'OFAAAA', 'RCBAAA', 'HHHHxx'),
+(6608, 746, 0, 0, 8, 8, 8, 608, 608, 1608, 6608, 16, 17, 'EUAAAA', 'SCBAAA', 'OOOOxx'),
+(8400, 747, 0, 0, 0, 0, 0, 400, 400, 3400, 8400, 0, 1, 'CLAAAA', 'TCBAAA', 'VVVVxx'),
+(5124, 748, 0, 0, 4, 4, 24, 124, 1124, 124, 5124, 48, 49, 'CPAAAA', 'UCBAAA', 'AAAAxx'),
+(5484, 749, 0, 0, 4, 4, 84, 484, 1484, 484, 5484, 168, 169, 'YCAAAA', 'VCBAAA', 'HHHHxx'),
+(3575, 750, 1, 3, 5, 15, 75, 575, 1575, 3575, 3575, 150, 151, 'NHAAAA', 'WCBAAA', 'OOOOxx'),
+(9723, 751, 1, 3, 3, 3, 23, 723, 1723, 4723, 9723, 46, 47, 'ZJAAAA', 'XCBAAA', 'VVVVxx'),
+(360, 752, 0, 0, 0, 0, 60, 360, 360, 360, 360, 120, 121, 'WNAAAA', 'YCBAAA', 'AAAAxx'),
+(1059, 753, 1, 3, 9, 19, 59, 59, 1059, 1059, 1059, 118, 119, 'TOAAAA', 'ZCBAAA', 'HHHHxx'),
+(4941, 754, 1, 1, 1, 1, 41, 941, 941, 4941, 4941, 82, 83, 'BIAAAA', 'ADBAAA', 'OOOOxx'),
+(2535, 755, 1, 3, 5, 15, 35, 535, 535, 2535, 2535, 70, 71, 'NTAAAA', 'BDBAAA', 'VVVVxx'),
+(4119, 756, 1, 3, 9, 19, 19, 119, 119, 4119, 4119, 38, 39, 'LCAAAA', 'CDBAAA', 'AAAAxx'),
+(3725, 757, 1, 1, 5, 5, 25, 725, 1725, 3725, 3725, 50, 51, 'HNAAAA', 'DDBAAA', 'HHHHxx'),
+(4758, 758, 0, 2, 8, 18, 58, 758, 758, 4758, 4758, 116, 117, 'ABAAAA', 'EDBAAA', 'OOOOxx'),
+(9593, 759, 1, 1, 3, 13, 93, 593, 1593, 4593, 9593, 186, 187, 'ZEAAAA', 'FDBAAA', 'VVVVxx'),
+(4663, 760, 1, 3, 3, 3, 63, 663, 663, 4663, 4663, 126, 127, 'JXAAAA', 'GDBAAA', 'AAAAxx'),
+(7734, 761, 0, 2, 4, 14, 34, 734, 1734, 2734, 7734, 68, 69, 'MLAAAA', 'HDBAAA', 'HHHHxx'),
+(9156, 762, 0, 0, 6, 16, 56, 156, 1156, 4156, 9156, 112, 113, 'EOAAAA', 'IDBAAA', 'OOOOxx'),
+(8120, 763, 0, 0, 0, 0, 20, 120, 120, 3120, 8120, 40, 41, 'IAAAAA', 'JDBAAA', 'VVVVxx'),
+(4385, 764, 1, 1, 5, 5, 85, 385, 385, 4385, 4385, 170, 171, 'RMAAAA', 'KDBAAA', 'AAAAxx'),
+(2926, 765, 0, 2, 6, 6, 26, 926, 926, 2926, 2926, 52, 53, 'OIAAAA', 'LDBAAA', 'HHHHxx'),
+(4186, 766, 0, 2, 6, 6, 86, 186, 186, 4186, 4186, 172, 173, 'AFAAAA', 'MDBAAA', 'OOOOxx'),
+(2508, 767, 0, 0, 8, 8, 8, 508, 508, 2508, 2508, 16, 17, 'MSAAAA', 'NDBAAA', 'VVVVxx'),
+(4012, 768, 0, 0, 2, 12, 12, 12, 12, 4012, 4012, 24, 25, 'IYAAAA', 'ODBAAA', 'AAAAxx'),
+(6266, 769, 0, 2, 6, 6, 66, 266, 266, 1266, 6266, 132, 133, 'AHAAAA', 'PDBAAA', 'HHHHxx'),
+(3709, 770, 1, 1, 9, 9, 9, 709, 1709, 3709, 3709, 18, 19, 'RMAAAA', 'QDBAAA', 'OOOOxx'),
+(7289, 771, 1, 1, 9, 9, 89, 289, 1289, 2289, 7289, 178, 179, 'JUAAAA', 'RDBAAA', 'VVVVxx'),
+(8875, 772, 1, 3, 5, 15, 75, 875, 875, 3875, 8875, 150, 151, 'JDAAAA', 'SDBAAA', 'AAAAxx'),
+(4412, 773, 0, 0, 2, 12, 12, 412, 412, 4412, 4412, 24, 25, 'SNAAAA', 'TDBAAA', 'HHHHxx'),
+(3033, 774, 1, 1, 3, 13, 33, 33, 1033, 3033, 3033, 66, 67, 'RMAAAA', 'UDBAAA', 'OOOOxx'),
+(1645, 775, 1, 1, 5, 5, 45, 645, 1645, 1645, 1645, 90, 91, 'HLAAAA', 'VDBAAA', 'VVVVxx'),
+(3557, 776, 1, 1, 7, 17, 57, 557, 1557, 3557, 3557, 114, 115, 'VGAAAA', 'WDBAAA', 'AAAAxx'),
+(6316, 777, 0, 0, 6, 16, 16, 316, 316, 1316, 6316, 32, 33, 'YIAAAA', 'XDBAAA', 'HHHHxx'),
+(2054, 778, 0, 2, 4, 14, 54, 54, 54, 2054, 2054, 108, 109, 'ABAAAA', 'YDBAAA', 'OOOOxx'),
+(7031, 779, 1, 3, 1, 11, 31, 31, 1031, 2031, 7031, 62, 63, 'LKAAAA', 'ZDBAAA', 'VVVVxx'),
+(3405, 780, 1, 1, 5, 5, 5, 405, 1405, 3405, 3405, 10, 11, 'ZAAAAA', 'AEBAAA', 'AAAAxx'),
+(5343, 781, 1, 3, 3, 3, 43, 343, 1343, 343, 5343, 86, 87, 'NXAAAA', 'BEBAAA', 'HHHHxx'),
+(5240, 782, 0, 0, 0, 0, 40, 240, 1240, 240, 5240, 80, 81, 'OTAAAA', 'CEBAAA', 'OOOOxx'),
+(9650, 783, 0, 2, 0, 10, 50, 650, 1650, 4650, 9650, 100, 101, 'EHAAAA', 'DEBAAA', 'VVVVxx'),
+(3777, 784, 1, 1, 7, 17, 77, 777, 1777, 3777, 3777, 154, 155, 'HPAAAA', 'EEBAAA', 'AAAAxx'),
+(9041, 785, 1, 1, 1, 1, 41, 41, 1041, 4041, 9041, 82, 83, 'TJAAAA', 'FEBAAA', 'HHHHxx'),
+(6923, 786, 1, 3, 3, 3, 23, 923, 923, 1923, 6923, 46, 47, 'HGAAAA', 'GEBAAA', 'OOOOxx'),
+(2977, 787, 1, 1, 7, 17, 77, 977, 977, 2977, 2977, 154, 155, 'NKAAAA', 'HEBAAA', 'VVVVxx'),
+(5500, 788, 0, 0, 0, 0, 0, 500, 1500, 500, 5500, 0, 1, 'ODAAAA', 'IEBAAA', 'AAAAxx'),
+(1044, 789, 0, 0, 4, 4, 44, 44, 1044, 1044, 1044, 88, 89, 'EOAAAA', 'JEBAAA', 'HHHHxx'),
+(434, 790, 0, 2, 4, 14, 34, 434, 434, 434, 434, 68, 69, 'SQAAAA', 'KEBAAA', 'OOOOxx'),
+(611, 791, 1, 3, 1, 11, 11, 611, 611, 611, 611, 22, 23, 'NXAAAA', 'LEBAAA', 'VVVVxx'),
+(5760, 792, 0, 0, 0, 0, 60, 760, 1760, 760, 5760, 120, 121, 'ONAAAA', 'MEBAAA', 'AAAAxx'),
+(2445, 793, 1, 1, 5, 5, 45, 445, 445, 2445, 2445, 90, 91, 'BQAAAA', 'NEBAAA', 'HHHHxx'),
+(7098, 794, 0, 2, 8, 18, 98, 98, 1098, 2098, 7098, 196, 197, 'ANAAAA', 'OEBAAA', 'OOOOxx'),
+(2188, 795, 0, 0, 8, 8, 88, 188, 188, 2188, 2188, 176, 177, 'EGAAAA', 'PEBAAA', 'VVVVxx'),
+(4597, 796, 1, 1, 7, 17, 97, 597, 597, 4597, 4597, 194, 195, 'VUAAAA', 'QEBAAA', 'AAAAxx'),
+(1913, 797, 1, 1, 3, 13, 13, 913, 1913, 1913, 1913, 26, 27, 'PVAAAA', 'REBAAA', 'HHHHxx'),
+(8696, 798, 0, 0, 6, 16, 96, 696, 696, 3696, 8696, 192, 193, 'MWAAAA', 'SEBAAA', 'OOOOxx'),
+(3332, 799, 0, 0, 2, 12, 32, 332, 1332, 3332, 3332, 64, 65, 'EYAAAA', 'TEBAAA', 'VVVVxx'),
+(8760, 800, 0, 0, 0, 0, 60, 760, 760, 3760, 8760, 120, 121, 'YYAAAA', 'UEBAAA', 'AAAAxx'),
+(3215, 801, 1, 3, 5, 15, 15, 215, 1215, 3215, 3215, 30, 31, 'RTAAAA', 'VEBAAA', 'HHHHxx'),
+(1625, 802, 1, 1, 5, 5, 25, 625, 1625, 1625, 1625, 50, 51, 'NKAAAA', 'WEBAAA', 'OOOOxx'),
+(4219, 803, 1, 3, 9, 19, 19, 219, 219, 4219, 4219, 38, 39, 'HGAAAA', 'XEBAAA', 'VVVVxx'),
+(415, 804, 1, 3, 5, 15, 15, 415, 415, 415, 415, 30, 31, 'ZPAAAA', 'YEBAAA', 'AAAAxx'),
+(4242, 805, 0, 2, 2, 2, 42, 242, 242, 4242, 4242, 84, 85, 'EHAAAA', 'ZEBAAA', 'HHHHxx'),
+(8660, 806, 0, 0, 0, 0, 60, 660, 660, 3660, 8660, 120, 121, 'CVAAAA', 'AFBAAA', 'OOOOxx'),
+(6525, 807, 1, 1, 5, 5, 25, 525, 525, 1525, 6525, 50, 51, 'ZQAAAA', 'BFBAAA', 'VVVVxx'),
+(2141, 808, 1, 1, 1, 1, 41, 141, 141, 2141, 2141, 82, 83, 'JEAAAA', 'CFBAAA', 'AAAAxx'),
+(5152, 809, 0, 0, 2, 12, 52, 152, 1152, 152, 5152, 104, 105, 'EQAAAA', 'DFBAAA', 'HHHHxx'),
+(8560, 810, 0, 0, 0, 0, 60, 560, 560, 3560, 8560, 120, 121, 'GRAAAA', 'EFBAAA', 'OOOOxx'),
+(9835, 811, 1, 3, 5, 15, 35, 835, 1835, 4835, 9835, 70, 71, 'HOAAAA', 'FFBAAA', 'VVVVxx'),
+(2657, 812, 1, 1, 7, 17, 57, 657, 657, 2657, 2657, 114, 115, 'FYAAAA', 'GFBAAA', 'AAAAxx'),
+(6085, 813, 1, 1, 5, 5, 85, 85, 85, 1085, 6085, 170, 171, 'BAAAAA', 'HFBAAA', 'HHHHxx'),
+(6698, 814, 0, 2, 8, 18, 98, 698, 698, 1698, 6698, 196, 197, 'QXAAAA', 'IFBAAA', 'OOOOxx'),
+(5421, 815, 1, 1, 1, 1, 21, 421, 1421, 421, 5421, 42, 43, 'NAAAAA', 'JFBAAA', 'VVVVxx'),
+(6661, 816, 1, 1, 1, 1, 61, 661, 661, 1661, 6661, 122, 123, 'FWAAAA', 'KFBAAA', 'AAAAxx'),
+(5645, 817, 1, 1, 5, 5, 45, 645, 1645, 645, 5645, 90, 91, 'DJAAAA', 'LFBAAA', 'HHHHxx'),
+(1248, 818, 0, 0, 8, 8, 48, 248, 1248, 1248, 1248, 96, 97, 'AWAAAA', 'MFBAAA', 'OOOOxx'),
+(5690, 819, 0, 2, 0, 10, 90, 690, 1690, 690, 5690, 180, 181, 'WKAAAA', 'NFBAAA', 'VVVVxx'),
+(4762, 820, 0, 2, 2, 2, 62, 762, 762, 4762, 4762, 124, 125, 'EBAAAA', 'OFBAAA', 'AAAAxx'),
+(1455, 821, 1, 3, 5, 15, 55, 455, 1455, 1455, 1455, 110, 111, 'ZDAAAA', 'PFBAAA', 'HHHHxx'),
+(9846, 822, 0, 2, 6, 6, 46, 846, 1846, 4846, 9846, 92, 93, 'SOAAAA', 'QFBAAA', 'OOOOxx'),
+(5295, 823, 1, 3, 5, 15, 95, 295, 1295, 295, 5295, 190, 191, 'RVAAAA', 'RFBAAA', 'VVVVxx'),
+(2826, 824, 0, 2, 6, 6, 26, 826, 826, 2826, 2826, 52, 53, 'SEAAAA', 'SFBAAA', 'AAAAxx'),
+(7496, 825, 0, 0, 6, 16, 96, 496, 1496, 2496, 7496, 192, 193, 'ICAAAA', 'TFBAAA', 'HHHHxx'),
+(3024, 826, 0, 0, 4, 4, 24, 24, 1024, 3024, 3024, 48, 49, 'IMAAAA', 'UFBAAA', 'OOOOxx'),
+(4945, 827, 1, 1, 5, 5, 45, 945, 945, 4945, 4945, 90, 91, 'FIAAAA', 'VFBAAA', 'VVVVxx'),
+(4404, 828, 0, 0, 4, 4, 4, 404, 404, 4404, 4404, 8, 9, 'KNAAAA', 'WFBAAA', 'AAAAxx'),
+(9302, 829, 0, 2, 2, 2, 2, 302, 1302, 4302, 9302, 4, 5, 'UTAAAA', 'XFBAAA', 'HHHHxx'),
+(1286, 830, 0, 2, 6, 6, 86, 286, 1286, 1286, 1286, 172, 173, 'MXAAAA', 'YFBAAA', 'OOOOxx'),
+(8435, 831, 1, 3, 5, 15, 35, 435, 435, 3435, 8435, 70, 71, 'LMAAAA', 'ZFBAAA', 'VVVVxx'),
+(8969, 832, 1, 1, 9, 9, 69, 969, 969, 3969, 8969, 138, 139, 'ZGAAAA', 'AGBAAA', 'AAAAxx'),
+(3302, 833, 0, 2, 2, 2, 2, 302, 1302, 3302, 3302, 4, 5, 'AXAAAA', 'BGBAAA', 'HHHHxx'),
+(9753, 834, 1, 1, 3, 13, 53, 753, 1753, 4753, 9753, 106, 107, 'DLAAAA', 'CGBAAA', 'OOOOxx'),
+(9374, 835, 0, 2, 4, 14, 74, 374, 1374, 4374, 9374, 148, 149, 'OWAAAA', 'DGBAAA', 'VVVVxx'),
+(4907, 836, 1, 3, 7, 7, 7, 907, 907, 4907, 4907, 14, 15, 'TGAAAA', 'EGBAAA', 'AAAAxx'),
+(1659, 837, 1, 3, 9, 19, 59, 659, 1659, 1659, 1659, 118, 119, 'VLAAAA', 'FGBAAA', 'HHHHxx'),
+(5095, 838, 1, 3, 5, 15, 95, 95, 1095, 95, 5095, 190, 191, 'ZNAAAA', 'GGBAAA', 'OOOOxx'),
+(9446, 839, 0, 2, 6, 6, 46, 446, 1446, 4446, 9446, 92, 93, 'IZAAAA', 'HGBAAA', 'VVVVxx'),
+(8528, 840, 0, 0, 8, 8, 28, 528, 528, 3528, 8528, 56, 57, 'AQAAAA', 'IGBAAA', 'AAAAxx'),
+(4890, 841, 0, 2, 0, 10, 90, 890, 890, 4890, 4890, 180, 181, 'CGAAAA', 'JGBAAA', 'HHHHxx'),
+(1221, 842, 1, 1, 1, 1, 21, 221, 1221, 1221, 1221, 42, 43, 'ZUAAAA', 'KGBAAA', 'OOOOxx'),
+(5583, 843, 1, 3, 3, 3, 83, 583, 1583, 583, 5583, 166, 167, 'TGAAAA', 'LGBAAA', 'VVVVxx'),
+(7303, 844, 1, 3, 3, 3, 3, 303, 1303, 2303, 7303, 6, 7, 'XUAAAA', 'MGBAAA', 'AAAAxx'),
+(406, 845, 0, 2, 6, 6, 6, 406, 406, 406, 406, 12, 13, 'QPAAAA', 'NGBAAA', 'HHHHxx'),
+(7542, 846, 0, 2, 2, 2, 42, 542, 1542, 2542, 7542, 84, 85, 'CEAAAA', 'OGBAAA', 'OOOOxx'),
+(9507, 847, 1, 3, 7, 7, 7, 507, 1507, 4507, 9507, 14, 15, 'RBAAAA', 'PGBAAA', 'VVVVxx'),
+(9511, 848, 1, 3, 1, 11, 11, 511, 1511, 4511, 9511, 22, 23, 'VBAAAA', 'QGBAAA', 'AAAAxx'),
+(1373, 849, 1, 1, 3, 13, 73, 373, 1373, 1373, 1373, 146, 147, 'VAAAAA', 'RGBAAA', 'HHHHxx'),
+(6556, 850, 0, 0, 6, 16, 56, 556, 556, 1556, 6556, 112, 113, 'ESAAAA', 'SGBAAA', 'OOOOxx'),
+(4117, 851, 1, 1, 7, 17, 17, 117, 117, 4117, 4117, 34, 35, 'JCAAAA', 'TGBAAA', 'VVVVxx'),
+(7794, 852, 0, 2, 4, 14, 94, 794, 1794, 2794, 7794, 188, 189, 'UNAAAA', 'UGBAAA', 'AAAAxx'),
+(7170, 853, 0, 2, 0, 10, 70, 170, 1170, 2170, 7170, 140, 141, 'UPAAAA', 'VGBAAA', 'HHHHxx'),
+(5809, 854, 1, 1, 9, 9, 9, 809, 1809, 809, 5809, 18, 19, 'LPAAAA', 'WGBAAA', 'OOOOxx'),
+(7828, 855, 0, 0, 8, 8, 28, 828, 1828, 2828, 7828, 56, 57, 'CPAAAA', 'XGBAAA', 'VVVVxx'),
+(8046, 856, 0, 2, 6, 6, 46, 46, 46, 3046, 8046, 92, 93, 'MXAAAA', 'YGBAAA', 'AAAAxx'),
+(4833, 857, 1, 1, 3, 13, 33, 833, 833, 4833, 4833, 66, 67, 'XDAAAA', 'ZGBAAA', 'HHHHxx'),
+(2107, 858, 1, 3, 7, 7, 7, 107, 107, 2107, 2107, 14, 15, 'BDAAAA', 'AHBAAA', 'OOOOxx'),
+(4276, 859, 0, 0, 6, 16, 76, 276, 276, 4276, 4276, 152, 153, 'MIAAAA', 'BHBAAA', 'VVVVxx'),
+(9536, 860, 0, 0, 6, 16, 36, 536, 1536, 4536, 9536, 72, 73, 'UCAAAA', 'CHBAAA', 'AAAAxx'),
+(5549, 861, 1, 1, 9, 9, 49, 549, 1549, 549, 5549, 98, 99, 'LFAAAA', 'DHBAAA', 'HHHHxx'),
+(6427, 862, 1, 3, 7, 7, 27, 427, 427, 1427, 6427, 54, 55, 'FNAAAA', 'EHBAAA', 'OOOOxx'),
+(1382, 863, 0, 2, 2, 2, 82, 382, 1382, 1382, 1382, 164, 165, 'EBAAAA', 'FHBAAA', 'VVVVxx'),
+(3256, 864, 0, 0, 6, 16, 56, 256, 1256, 3256, 3256, 112, 113, 'GVAAAA', 'GHBAAA', 'AAAAxx'),
+(3270, 865, 0, 2, 0, 10, 70, 270, 1270, 3270, 3270, 140, 141, 'UVAAAA', 'HHBAAA', 'HHHHxx'),
+(4808, 866, 0, 0, 8, 8, 8, 808, 808, 4808, 4808, 16, 17, 'YCAAAA', 'IHBAAA', 'OOOOxx'),
+(7938, 867, 0, 2, 8, 18, 38, 938, 1938, 2938, 7938, 76, 77, 'ITAAAA', 'JHBAAA', 'VVVVxx'),
+(4405, 868, 1, 1, 5, 5, 5, 405, 405, 4405, 4405, 10, 11, 'LNAAAA', 'KHBAAA', 'AAAAxx'),
+(2264, 869, 0, 0, 4, 4, 64, 264, 264, 2264, 2264, 128, 129, 'CJAAAA', 'LHBAAA', 'HHHHxx'),
+(80, 870, 0, 0, 0, 0, 80, 80, 80, 80, 80, 160, 161, 'CDAAAA', 'MHBAAA', 'OOOOxx'),
+(320, 871, 0, 0, 0, 0, 20, 320, 320, 320, 320, 40, 41, 'IMAAAA', 'NHBAAA', 'VVVVxx'),
+(2383, 872, 1, 3, 3, 3, 83, 383, 383, 2383, 2383, 166, 167, 'RNAAAA', 'OHBAAA', 'AAAAxx'),
+(3146, 873, 0, 2, 6, 6, 46, 146, 1146, 3146, 3146, 92, 93, 'ARAAAA', 'PHBAAA', 'HHHHxx'),
+(6911, 874, 1, 3, 1, 11, 11, 911, 911, 1911, 6911, 22, 23, 'VFAAAA', 'QHBAAA', 'OOOOxx'),
+(7377, 875, 1, 1, 7, 17, 77, 377, 1377, 2377, 7377, 154, 155, 'TXAAAA', 'RHBAAA', 'VVVVxx'),
+(9965, 876, 1, 1, 5, 5, 65, 965, 1965, 4965, 9965, 130, 131, 'HTAAAA', 'SHBAAA', 'AAAAxx'),
+(8361, 877, 1, 1, 1, 1, 61, 361, 361, 3361, 8361, 122, 123, 'PJAAAA', 'THBAAA', 'HHHHxx'),
+(9417, 878, 1, 1, 7, 17, 17, 417, 1417, 4417, 9417, 34, 35, 'FYAAAA', 'UHBAAA', 'OOOOxx'),
+(2483, 879, 1, 3, 3, 3, 83, 483, 483, 2483, 2483, 166, 167, 'NRAAAA', 'VHBAAA', 'VVVVxx'),
+(9843, 880, 1, 3, 3, 3, 43, 843, 1843, 4843, 9843, 86, 87, 'POAAAA', 'WHBAAA', 'AAAAxx'),
+(6395, 881, 1, 3, 5, 15, 95, 395, 395, 1395, 6395, 190, 191, 'ZLAAAA', 'XHBAAA', 'HHHHxx'),
+(6444, 882, 0, 0, 4, 4, 44, 444, 444, 1444, 6444, 88, 89, 'WNAAAA', 'YHBAAA', 'OOOOxx'),
+(1820, 883, 0, 0, 0, 0, 20, 820, 1820, 1820, 1820, 40, 41, 'ASAAAA', 'ZHBAAA', 'VVVVxx'),
+(2768, 884, 0, 0, 8, 8, 68, 768, 768, 2768, 2768, 136, 137, 'MCAAAA', 'AIBAAA', 'AAAAxx'),
+(5413, 885, 1, 1, 3, 13, 13, 413, 1413, 413, 5413, 26, 27, 'FAAAAA', 'BIBAAA', 'HHHHxx'),
+(2923, 886, 1, 3, 3, 3, 23, 923, 923, 2923, 2923, 46, 47, 'LIAAAA', 'CIBAAA', 'OOOOxx'),
+(5286, 887, 0, 2, 6, 6, 86, 286, 1286, 286, 5286, 172, 173, 'IVAAAA', 'DIBAAA', 'VVVVxx'),
+(6126, 888, 0, 2, 6, 6, 26, 126, 126, 1126, 6126, 52, 53, 'QBAAAA', 'EIBAAA', 'AAAAxx'),
+(8343, 889, 1, 3, 3, 3, 43, 343, 343, 3343, 8343, 86, 87, 'XIAAAA', 'FIBAAA', 'HHHHxx'),
+(6010, 890, 0, 2, 0, 10, 10, 10, 10, 1010, 6010, 20, 21, 'EXAAAA', 'GIBAAA', 'OOOOxx'),
+(4177, 891, 1, 1, 7, 17, 77, 177, 177, 4177, 4177, 154, 155, 'REAAAA', 'HIBAAA', 'VVVVxx'),
+(5808, 892, 0, 0, 8, 8, 8, 808, 1808, 808, 5808, 16, 17, 'KPAAAA', 'IIBAAA', 'AAAAxx'),
+(4859, 893, 1, 3, 9, 19, 59, 859, 859, 4859, 4859, 118, 119, 'XEAAAA', 'JIBAAA', 'HHHHxx'),
+(9252, 894, 0, 0, 2, 12, 52, 252, 1252, 4252, 9252, 104, 105, 'WRAAAA', 'KIBAAA', 'OOOOxx'),
+(2941, 895, 1, 1, 1, 1, 41, 941, 941, 2941, 2941, 82, 83, 'DJAAAA', 'LIBAAA', 'VVVVxx'),
+(8693, 896, 1, 1, 3, 13, 93, 693, 693, 3693, 8693, 186, 187, 'JWAAAA', 'MIBAAA', 'AAAAxx'),
+(4432, 897, 0, 0, 2, 12, 32, 432, 432, 4432, 4432, 64, 65, 'MOAAAA', 'NIBAAA', 'HHHHxx'),
+(2371, 898, 1, 3, 1, 11, 71, 371, 371, 2371, 2371, 142, 143, 'FNAAAA', 'OIBAAA', 'OOOOxx'),
+(7546, 899, 0, 2, 6, 6, 46, 546, 1546, 2546, 7546, 92, 93, 'GEAAAA', 'PIBAAA', 'VVVVxx'),
+(1369, 900, 1, 1, 9, 9, 69, 369, 1369, 1369, 1369, 138, 139, 'RAAAAA', 'QIBAAA', 'AAAAxx'),
+(4687, 901, 1, 3, 7, 7, 87, 687, 687, 4687, 4687, 174, 175, 'HYAAAA', 'RIBAAA', 'HHHHxx'),
+(8941, 902, 1, 1, 1, 1, 41, 941, 941, 3941, 8941, 82, 83, 'XFAAAA', 'SIBAAA', 'OOOOxx'),
+(226, 903, 0, 2, 6, 6, 26, 226, 226, 226, 226, 52, 53, 'SIAAAA', 'TIBAAA', 'VVVVxx'),
+(3493, 904, 1, 1, 3, 13, 93, 493, 1493, 3493, 3493, 186, 187, 'JEAAAA', 'UIBAAA', 'AAAAxx'),
+(6433, 905, 1, 1, 3, 13, 33, 433, 433, 1433, 6433, 66, 67, 'LNAAAA', 'VIBAAA', 'HHHHxx'),
+(9189, 906, 1, 1, 9, 9, 89, 189, 1189, 4189, 9189, 178, 179, 'LPAAAA', 'WIBAAA', 'OOOOxx'),
+(6027, 907, 1, 3, 7, 7, 27, 27, 27, 1027, 6027, 54, 55, 'VXAAAA', 'XIBAAA', 'VVVVxx'),
+(4615, 908, 1, 3, 5, 15, 15, 615, 615, 4615, 4615, 30, 31, 'NVAAAA', 'YIBAAA', 'AAAAxx'),
+(5320, 909, 0, 0, 0, 0, 20, 320, 1320, 320, 5320, 40, 41, 'QWAAAA', 'ZIBAAA', 'HHHHxx'),
+(7002, 910, 0, 2, 2, 2, 2, 2, 1002, 2002, 7002, 4, 5, 'IJAAAA', 'AJBAAA', 'OOOOxx'),
+(7367, 911, 1, 3, 7, 7, 67, 367, 1367, 2367, 7367, 134, 135, 'JXAAAA', 'BJBAAA', 'VVVVxx'),
+(289, 912, 1, 1, 9, 9, 89, 289, 289, 289, 289, 178, 179, 'DLAAAA', 'CJBAAA', 'AAAAxx'),
+(407, 913, 1, 3, 7, 7, 7, 407, 407, 407, 407, 14, 15, 'RPAAAA', 'DJBAAA', 'HHHHxx'),
+(504, 914, 0, 0, 4, 4, 4, 504, 504, 504, 504, 8, 9, 'KTAAAA', 'EJBAAA', 'OOOOxx'),
+(8301, 915, 1, 1, 1, 1, 1, 301, 301, 3301, 8301, 2, 3, 'HHAAAA', 'FJBAAA', 'VVVVxx'),
+(1396, 916, 0, 0, 6, 16, 96, 396, 1396, 1396, 1396, 192, 193, 'SBAAAA', 'GJBAAA', 'AAAAxx'),
+(4794, 917, 0, 2, 4, 14, 94, 794, 794, 4794, 4794, 188, 189, 'KCAAAA', 'HJBAAA', 'HHHHxx'),
+(6400, 918, 0, 0, 0, 0, 0, 400, 400, 1400, 6400, 0, 1, 'EMAAAA', 'IJBAAA', 'OOOOxx'),
+(1275, 919, 1, 3, 5, 15, 75, 275, 1275, 1275, 1275, 150, 151, 'BXAAAA', 'JJBAAA', 'VVVVxx'),
+(5797, 920, 1, 1, 7, 17, 97, 797, 1797, 797, 5797, 194, 195, 'ZOAAAA', 'KJBAAA', 'AAAAxx'),
+(2221, 921, 1, 1, 1, 1, 21, 221, 221, 2221, 2221, 42, 43, 'LHAAAA', 'LJBAAA', 'HHHHxx'),
+(2504, 922, 0, 0, 4, 4, 4, 504, 504, 2504, 2504, 8, 9, 'ISAAAA', 'MJBAAA', 'OOOOxx'),
+(2143, 923, 1, 3, 3, 3, 43, 143, 143, 2143, 2143, 86, 87, 'LEAAAA', 'NJBAAA', 'VVVVxx'),
+(1083, 924, 1, 3, 3, 3, 83, 83, 1083, 1083, 1083, 166, 167, 'RPAAAA', 'OJBAAA', 'AAAAxx'),
+(6148, 925, 0, 0, 8, 8, 48, 148, 148, 1148, 6148, 96, 97, 'MCAAAA', 'PJBAAA', 'HHHHxx'),
+(3612, 926, 0, 0, 2, 12, 12, 612, 1612, 3612, 3612, 24, 25, 'YIAAAA', 'QJBAAA', 'OOOOxx'),
+(9499, 927, 1, 3, 9, 19, 99, 499, 1499, 4499, 9499, 198, 199, 'JBAAAA', 'RJBAAA', 'VVVVxx'),
+(5773, 928, 1, 1, 3, 13, 73, 773, 1773, 773, 5773, 146, 147, 'BOAAAA', 'SJBAAA', 'AAAAxx'),
+(1014, 929, 0, 2, 4, 14, 14, 14, 1014, 1014, 1014, 28, 29, 'ANAAAA', 'TJBAAA', 'HHHHxx'),
+(1427, 930, 1, 3, 7, 7, 27, 427, 1427, 1427, 1427, 54, 55, 'XCAAAA', 'UJBAAA', 'OOOOxx'),
+(6770, 931, 0, 2, 0, 10, 70, 770, 770, 1770, 6770, 140, 141, 'KAAAAA', 'VJBAAA', 'VVVVxx'),
+(9042, 932, 0, 2, 2, 2, 42, 42, 1042, 4042, 9042, 84, 85, 'UJAAAA', 'WJBAAA', 'AAAAxx'),
+(9892, 933, 0, 0, 2, 12, 92, 892, 1892, 4892, 9892, 184, 185, 'MQAAAA', 'XJBAAA', 'HHHHxx'),
+(1771, 934, 1, 3, 1, 11, 71, 771, 1771, 1771, 1771, 142, 143, 'DQAAAA', 'YJBAAA', 'OOOOxx'),
+(7392, 935, 0, 0, 2, 12, 92, 392, 1392, 2392, 7392, 184, 185, 'IYAAAA', 'ZJBAAA', 'VVVVxx'),
+(4465, 936, 1, 1, 5, 5, 65, 465, 465, 4465, 4465, 130, 131, 'TPAAAA', 'AKBAAA', 'AAAAxx'),
+(278, 937, 0, 2, 8, 18, 78, 278, 278, 278, 278, 156, 157, 'SKAAAA', 'BKBAAA', 'HHHHxx'),
+(7776, 938, 0, 0, 6, 16, 76, 776, 1776, 2776, 7776, 152, 153, 'CNAAAA', 'CKBAAA', 'OOOOxx'),
+(3763, 939, 1, 3, 3, 3, 63, 763, 1763, 3763, 3763, 126, 127, 'TOAAAA', 'DKBAAA', 'VVVVxx'),
+(7503, 940, 1, 3, 3, 3, 3, 503, 1503, 2503, 7503, 6, 7, 'PCAAAA', 'EKBAAA', 'AAAAxx'),
+(3793, 941, 1, 1, 3, 13, 93, 793, 1793, 3793, 3793, 186, 187, 'XPAAAA', 'FKBAAA', 'HHHHxx'),
+(6510, 942, 0, 2, 0, 10, 10, 510, 510, 1510, 6510, 20, 21, 'KQAAAA', 'GKBAAA', 'OOOOxx'),
+(7641, 943, 1, 1, 1, 1, 41, 641, 1641, 2641, 7641, 82, 83, 'XHAAAA', 'HKBAAA', 'VVVVxx'),
+(3228, 944, 0, 0, 8, 8, 28, 228, 1228, 3228, 3228, 56, 57, 'EUAAAA', 'IKBAAA', 'AAAAxx'),
+(194, 945, 0, 2, 4, 14, 94, 194, 194, 194, 194, 188, 189, 'MHAAAA', 'JKBAAA', 'HHHHxx'),
+(8555, 946, 1, 3, 5, 15, 55, 555, 555, 3555, 8555, 110, 111, 'BRAAAA', 'KKBAAA', 'OOOOxx'),
+(4997, 947, 1, 1, 7, 17, 97, 997, 997, 4997, 4997, 194, 195, 'FKAAAA', 'LKBAAA', 'VVVVxx'),
+(8687, 948, 1, 3, 7, 7, 87, 687, 687, 3687, 8687, 174, 175, 'DWAAAA', 'MKBAAA', 'AAAAxx'),
+(6632, 949, 0, 0, 2, 12, 32, 632, 632, 1632, 6632, 64, 65, 'CVAAAA', 'NKBAAA', 'HHHHxx'),
+(9607, 950, 1, 3, 7, 7, 7, 607, 1607, 4607, 9607, 14, 15, 'NFAAAA', 'OKBAAA', 'OOOOxx'),
+(6201, 951, 1, 1, 1, 1, 1, 201, 201, 1201, 6201, 2, 3, 'NEAAAA', 'PKBAAA', 'VVVVxx'),
+(857, 952, 1, 1, 7, 17, 57, 857, 857, 857, 857, 114, 115, 'ZGAAAA', 'QKBAAA', 'AAAAxx'),
+(5623, 953, 1, 3, 3, 3, 23, 623, 1623, 623, 5623, 46, 47, 'HIAAAA', 'RKBAAA', 'HHHHxx'),
+(5979, 954, 1, 3, 9, 19, 79, 979, 1979, 979, 5979, 158, 159, 'ZVAAAA', 'SKBAAA', 'OOOOxx'),
+(2201, 955, 1, 1, 1, 1, 1, 201, 201, 2201, 2201, 2, 3, 'RGAAAA', 'TKBAAA', 'VVVVxx'),
+(3166, 956, 0, 2, 6, 6, 66, 166, 1166, 3166, 3166, 132, 133, 'URAAAA', 'UKBAAA', 'AAAAxx'),
+(6249, 957, 1, 1, 9, 9, 49, 249, 249, 1249, 6249, 98, 99, 'JGAAAA', 'VKBAAA', 'HHHHxx'),
+(3271, 958, 1, 3, 1, 11, 71, 271, 1271, 3271, 3271, 142, 143, 'VVAAAA', 'WKBAAA', 'OOOOxx'),
+(7777, 959, 1, 1, 7, 17, 77, 777, 1777, 2777, 7777, 154, 155, 'DNAAAA', 'XKBAAA', 'VVVVxx'),
+(6732, 960, 0, 0, 2, 12, 32, 732, 732, 1732, 6732, 64, 65, 'YYAAAA', 'YKBAAA', 'AAAAxx'),
+(6297, 961, 1, 1, 7, 17, 97, 297, 297, 1297, 6297, 194, 195, 'FIAAAA', 'ZKBAAA', 'HHHHxx'),
+(5685, 962, 1, 1, 5, 5, 85, 685, 1685, 685, 5685, 170, 171, 'RKAAAA', 'ALBAAA', 'OOOOxx'),
+(9931, 963, 1, 3, 1, 11, 31, 931, 1931, 4931, 9931, 62, 63, 'ZRAAAA', 'BLBAAA', 'VVVVxx'),
+(7485, 964, 1, 1, 5, 5, 85, 485, 1485, 2485, 7485, 170, 171, 'XBAAAA', 'CLBAAA', 'AAAAxx'),
+(386, 965, 0, 2, 6, 6, 86, 386, 386, 386, 386, 172, 173, 'WOAAAA', 'DLBAAA', 'HHHHxx'),
+(8204, 966, 0, 0, 4, 4, 4, 204, 204, 3204, 8204, 8, 9, 'ODAAAA', 'ELBAAA', 'OOOOxx'),
+(3606, 967, 0, 2, 6, 6, 6, 606, 1606, 3606, 3606, 12, 13, 'SIAAAA', 'FLBAAA', 'VVVVxx'),
+(1692, 968, 0, 0, 2, 12, 92, 692, 1692, 1692, 1692, 184, 185, 'CNAAAA', 'GLBAAA', 'AAAAxx'),
+(3002, 969, 0, 2, 2, 2, 2, 2, 1002, 3002, 3002, 4, 5, 'MLAAAA', 'HLBAAA', 'HHHHxx'),
+(9676, 970, 0, 0, 6, 16, 76, 676, 1676, 4676, 9676, 152, 153, 'EIAAAA', 'ILBAAA', 'OOOOxx'),
+(915, 971, 1, 3, 5, 15, 15, 915, 915, 915, 915, 30, 31, 'FJAAAA', 'JLBAAA', 'VVVVxx'),
+(7706, 972, 0, 2, 6, 6, 6, 706, 1706, 2706, 7706, 12, 13, 'KKAAAA', 'KLBAAA', 'AAAAxx'),
+(6080, 973, 0, 0, 0, 0, 80, 80, 80, 1080, 6080, 160, 161, 'WZAAAA', 'LLBAAA', 'HHHHxx'),
+(1860, 974, 0, 0, 0, 0, 60, 860, 1860, 1860, 1860, 120, 121, 'OTAAAA', 'MLBAAA', 'OOOOxx'),
+(1444, 975, 0, 0, 4, 4, 44, 444, 1444, 1444, 1444, 88, 89, 'ODAAAA', 'NLBAAA', 'VVVVxx'),
+(7208, 976, 0, 0, 8, 8, 8, 208, 1208, 2208, 7208, 16, 17, 'GRAAAA', 'OLBAAA', 'AAAAxx'),
+(8554, 977, 0, 2, 4, 14, 54, 554, 554, 3554, 8554, 108, 109, 'ARAAAA', 'PLBAAA', 'HHHHxx'),
+(2028, 978, 0, 0, 8, 8, 28, 28, 28, 2028, 2028, 56, 57, 'AAAAAA', 'QLBAAA', 'OOOOxx'),
+(9893, 979, 1, 1, 3, 13, 93, 893, 1893, 4893, 9893, 186, 187, 'NQAAAA', 'RLBAAA', 'VVVVxx'),
+(4740, 980, 0, 0, 0, 0, 40, 740, 740, 4740, 4740, 80, 81, 'IAAAAA', 'SLBAAA', 'AAAAxx'),
+(6186, 981, 0, 2, 6, 6, 86, 186, 186, 1186, 6186, 172, 173, 'YDAAAA', 'TLBAAA', 'HHHHxx'),
+(6357, 982, 1, 1, 7, 17, 57, 357, 357, 1357, 6357, 114, 115, 'NKAAAA', 'ULBAAA', 'OOOOxx'),
+(3699, 983, 1, 3, 9, 19, 99, 699, 1699, 3699, 3699, 198, 199, 'HMAAAA', 'VLBAAA', 'VVVVxx'),
+(7620, 984, 0, 0, 0, 0, 20, 620, 1620, 2620, 7620, 40, 41, 'CHAAAA', 'WLBAAA', 'AAAAxx'),
+(921, 985, 1, 1, 1, 1, 21, 921, 921, 921, 921, 42, 43, 'LJAAAA', 'XLBAAA', 'HHHHxx'),
+(5506, 986, 0, 2, 6, 6, 6, 506, 1506, 506, 5506, 12, 13, 'UDAAAA', 'YLBAAA', 'OOOOxx'),
+(8851, 987, 1, 3, 1, 11, 51, 851, 851, 3851, 8851, 102, 103, 'LCAAAA', 'ZLBAAA', 'VVVVxx'),
+(3205, 988, 1, 1, 5, 5, 5, 205, 1205, 3205, 3205, 10, 11, 'HTAAAA', 'AMBAAA', 'AAAAxx'),
+(1956, 989, 0, 0, 6, 16, 56, 956, 1956, 1956, 1956, 112, 113, 'GXAAAA', 'BMBAAA', 'HHHHxx'),
+(6272, 990, 0, 0, 2, 12, 72, 272, 272, 1272, 6272, 144, 145, 'GHAAAA', 'CMBAAA', 'OOOOxx'),
+(1509, 991, 1, 1, 9, 9, 9, 509, 1509, 1509, 1509, 18, 19, 'BGAAAA', 'DMBAAA', 'VVVVxx'),
+(53, 992, 1, 1, 3, 13, 53, 53, 53, 53, 53, 106, 107, 'BCAAAA', 'EMBAAA', 'AAAAxx'),
+(213, 993, 1, 1, 3, 13, 13, 213, 213, 213, 213, 26, 27, 'FIAAAA', 'FMBAAA', 'HHHHxx'),
+(4924, 994, 0, 0, 4, 4, 24, 924, 924, 4924, 4924, 48, 49, 'KHAAAA', 'GMBAAA', 'OOOOxx'),
+(2097, 995, 1, 1, 7, 17, 97, 97, 97, 2097, 2097, 194, 195, 'RCAAAA', 'HMBAAA', 'VVVVxx'),
+(4607, 996, 1, 3, 7, 7, 7, 607, 607, 4607, 4607, 14, 15, 'FVAAAA', 'IMBAAA', 'AAAAxx'),
+(1582, 997, 0, 2, 2, 2, 82, 582, 1582, 1582, 1582, 164, 165, 'WIAAAA', 'JMBAAA', 'HHHHxx'),
+(6643, 998, 1, 3, 3, 3, 43, 643, 643, 1643, 6643, 86, 87, 'NVAAAA', 'KMBAAA', 'OOOOxx'),
+(2238, 999, 0, 2, 8, 18, 38, 238, 238, 2238, 2238, 76, 77, 'CIAAAA', 'LMBAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(2942, 1000, 0, 2, 2, 2, 42, 942, 942, 2942, 2942, 84, 85, 'EJAAAA', 'MMBAAA', 'AAAAxx'),
+(1655, 1001, 1, 3, 5, 15, 55, 655, 1655, 1655, 1655, 110, 111, 'RLAAAA', 'NMBAAA', 'HHHHxx'),
+(3226, 1002, 0, 2, 6, 6, 26, 226, 1226, 3226, 3226, 52, 53, 'CUAAAA', 'OMBAAA', 'OOOOxx'),
+(4263, 1003, 1, 3, 3, 3, 63, 263, 263, 4263, 4263, 126, 127, 'ZHAAAA', 'PMBAAA', 'VVVVxx'),
+(960, 1004, 0, 0, 0, 0, 60, 960, 960, 960, 960, 120, 121, 'YKAAAA', 'QMBAAA', 'AAAAxx'),
+(1213, 1005, 1, 1, 3, 13, 13, 213, 1213, 1213, 1213, 26, 27, 'RUAAAA', 'RMBAAA', 'HHHHxx'),
+(1845, 1006, 1, 1, 5, 5, 45, 845, 1845, 1845, 1845, 90, 91, 'ZSAAAA', 'SMBAAA', 'OOOOxx'),
+(6944, 1007, 0, 0, 4, 4, 44, 944, 944, 1944, 6944, 88, 89, 'CHAAAA', 'TMBAAA', 'VVVVxx'),
+(5284, 1008, 0, 0, 4, 4, 84, 284, 1284, 284, 5284, 168, 169, 'GVAAAA', 'UMBAAA', 'AAAAxx'),
+(188, 1009, 0, 0, 8, 8, 88, 188, 188, 188, 188, 176, 177, 'GHAAAA', 'VMBAAA', 'HHHHxx'),
+(748, 1010, 0, 0, 8, 8, 48, 748, 748, 748, 748, 96, 97, 'UCAAAA', 'WMBAAA', 'OOOOxx'),
+(2226, 1011, 0, 2, 6, 6, 26, 226, 226, 2226, 2226, 52, 53, 'QHAAAA', 'XMBAAA', 'VVVVxx'),
+(7342, 1012, 0, 2, 2, 2, 42, 342, 1342, 2342, 7342, 84, 85, 'KWAAAA', 'YMBAAA', 'AAAAxx'),
+(6120, 1013, 0, 0, 0, 0, 20, 120, 120, 1120, 6120, 40, 41, 'KBAAAA', 'ZMBAAA', 'HHHHxx'),
+(536, 1014, 0, 0, 6, 16, 36, 536, 536, 536, 536, 72, 73, 'QUAAAA', 'ANBAAA', 'OOOOxx'),
+(3239, 1015, 1, 3, 9, 19, 39, 239, 1239, 3239, 3239, 78, 79, 'PUAAAA', 'BNBAAA', 'VVVVxx'),
+(2832, 1016, 0, 0, 2, 12, 32, 832, 832, 2832, 2832, 64, 65, 'YEAAAA', 'CNBAAA', 'AAAAxx'),
+(5296, 1017, 0, 0, 6, 16, 96, 296, 1296, 296, 5296, 192, 193, 'SVAAAA', 'DNBAAA', 'HHHHxx'),
+(5795, 1018, 1, 3, 5, 15, 95, 795, 1795, 795, 5795, 190, 191, 'XOAAAA', 'ENBAAA', 'OOOOxx'),
+(6290, 1019, 0, 2, 0, 10, 90, 290, 290, 1290, 6290, 180, 181, 'YHAAAA', 'FNBAAA', 'VVVVxx'),
+(4916, 1020, 0, 0, 6, 16, 16, 916, 916, 4916, 4916, 32, 33, 'CHAAAA', 'GNBAAA', 'AAAAxx'),
+(8366, 1021, 0, 2, 6, 6, 66, 366, 366, 3366, 8366, 132, 133, 'UJAAAA', 'HNBAAA', 'HHHHxx'),
+(4248, 1022, 0, 0, 8, 8, 48, 248, 248, 4248, 4248, 96, 97, 'KHAAAA', 'INBAAA', 'OOOOxx'),
+(6460, 1023, 0, 0, 0, 0, 60, 460, 460, 1460, 6460, 120, 121, 'MOAAAA', 'JNBAAA', 'VVVVxx'),
+(9296, 1024, 0, 0, 6, 16, 96, 296, 1296, 4296, 9296, 192, 193, 'OTAAAA', 'KNBAAA', 'AAAAxx'),
+(3486, 1025, 0, 2, 6, 6, 86, 486, 1486, 3486, 3486, 172, 173, 'CEAAAA', 'LNBAAA', 'HHHHxx'),
+(5664, 1026, 0, 0, 4, 4, 64, 664, 1664, 664, 5664, 128, 129, 'WJAAAA', 'MNBAAA', 'OOOOxx'),
+(7624, 1027, 0, 0, 4, 4, 24, 624, 1624, 2624, 7624, 48, 49, 'GHAAAA', 'NNBAAA', 'VVVVxx'),
+(2790, 1028, 0, 2, 0, 10, 90, 790, 790, 2790, 2790, 180, 181, 'IDAAAA', 'ONBAAA', 'AAAAxx'),
+(682, 1029, 0, 2, 2, 2, 82, 682, 682, 682, 682, 164, 165, 'GAAAAA', 'PNBAAA', 'HHHHxx'),
+(6412, 1030, 0, 0, 2, 12, 12, 412, 412, 1412, 6412, 24, 25, 'QMAAAA', 'QNBAAA', 'OOOOxx'),
+(6882, 1031, 0, 2, 2, 2, 82, 882, 882, 1882, 6882, 164, 165, 'SEAAAA', 'RNBAAA', 'VVVVxx'),
+(1332, 1032, 0, 0, 2, 12, 32, 332, 1332, 1332, 1332, 64, 65, 'GZAAAA', 'SNBAAA', 'AAAAxx'),
+(4911, 1033, 1, 3, 1, 11, 11, 911, 911, 4911, 4911, 22, 23, 'XGAAAA', 'TNBAAA', 'HHHHxx'),
+(3528, 1034, 0, 0, 8, 8, 28, 528, 1528, 3528, 3528, 56, 57, 'SFAAAA', 'UNBAAA', 'OOOOxx'),
+(271, 1035, 1, 3, 1, 11, 71, 271, 271, 271, 271, 142, 143, 'LKAAAA', 'VNBAAA', 'VVVVxx'),
+(7007, 1036, 1, 3, 7, 7, 7, 7, 1007, 2007, 7007, 14, 15, 'NJAAAA', 'WNBAAA', 'AAAAxx'),
+(2198, 1037, 0, 2, 8, 18, 98, 198, 198, 2198, 2198, 196, 197, 'OGAAAA', 'XNBAAA', 'HHHHxx'),
+(4266, 1038, 0, 2, 6, 6, 66, 266, 266, 4266, 4266, 132, 133, 'CIAAAA', 'YNBAAA', 'OOOOxx'),
+(9867, 1039, 1, 3, 7, 7, 67, 867, 1867, 4867, 9867, 134, 135, 'NPAAAA', 'ZNBAAA', 'VVVVxx'),
+(7602, 1040, 0, 2, 2, 2, 2, 602, 1602, 2602, 7602, 4, 5, 'KGAAAA', 'AOBAAA', 'AAAAxx'),
+(7521, 1041, 1, 1, 1, 1, 21, 521, 1521, 2521, 7521, 42, 43, 'HDAAAA', 'BOBAAA', 'HHHHxx'),
+(7200, 1042, 0, 0, 0, 0, 0, 200, 1200, 2200, 7200, 0, 1, 'YQAAAA', 'COBAAA', 'OOOOxx'),
+(4816, 1043, 0, 0, 6, 16, 16, 816, 816, 4816, 4816, 32, 33, 'GDAAAA', 'DOBAAA', 'VVVVxx'),
+(1669, 1044, 1, 1, 9, 9, 69, 669, 1669, 1669, 1669, 138, 139, 'FMAAAA', 'EOBAAA', 'AAAAxx'),
+(4764, 1045, 0, 0, 4, 4, 64, 764, 764, 4764, 4764, 128, 129, 'GBAAAA', 'FOBAAA', 'HHHHxx'),
+(7393, 1046, 1, 1, 3, 13, 93, 393, 1393, 2393, 7393, 186, 187, 'JYAAAA', 'GOBAAA', 'OOOOxx'),
+(7434, 1047, 0, 2, 4, 14, 34, 434, 1434, 2434, 7434, 68, 69, 'YZAAAA', 'HOBAAA', 'VVVVxx'),
+(9079, 1048, 1, 3, 9, 19, 79, 79, 1079, 4079, 9079, 158, 159, 'FLAAAA', 'IOBAAA', 'AAAAxx'),
+(9668, 1049, 0, 0, 8, 8, 68, 668, 1668, 4668, 9668, 136, 137, 'WHAAAA', 'JOBAAA', 'HHHHxx'),
+(7184, 1050, 0, 0, 4, 4, 84, 184, 1184, 2184, 7184, 168, 169, 'IQAAAA', 'KOBAAA', 'OOOOxx'),
+(7347, 1051, 1, 3, 7, 7, 47, 347, 1347, 2347, 7347, 94, 95, 'PWAAAA', 'LOBAAA', 'VVVVxx'),
+(951, 1052, 1, 3, 1, 11, 51, 951, 951, 951, 951, 102, 103, 'PKAAAA', 'MOBAAA', 'AAAAxx'),
+(4513, 1053, 1, 1, 3, 13, 13, 513, 513, 4513, 4513, 26, 27, 'PRAAAA', 'NOBAAA', 'HHHHxx'),
+(2692, 1054, 0, 0, 2, 12, 92, 692, 692, 2692, 2692, 184, 185, 'OZAAAA', 'OOBAAA', 'OOOOxx'),
+(9930, 1055, 0, 2, 0, 10, 30, 930, 1930, 4930, 9930, 60, 61, 'YRAAAA', 'POBAAA', 'VVVVxx'),
+(4516, 1056, 0, 0, 6, 16, 16, 516, 516, 4516, 4516, 32, 33, 'SRAAAA', 'QOBAAA', 'AAAAxx'),
+(1592, 1057, 0, 0, 2, 12, 92, 592, 1592, 1592, 1592, 184, 185, 'GJAAAA', 'ROBAAA', 'HHHHxx'),
+(6312, 1058, 0, 0, 2, 12, 12, 312, 312, 1312, 6312, 24, 25, 'UIAAAA', 'SOBAAA', 'OOOOxx'),
+(185, 1059, 1, 1, 5, 5, 85, 185, 185, 185, 185, 170, 171, 'DHAAAA', 'TOBAAA', 'VVVVxx'),
+(1848, 1060, 0, 0, 8, 8, 48, 848, 1848, 1848, 1848, 96, 97, 'CTAAAA', 'UOBAAA', 'AAAAxx'),
+(5844, 1061, 0, 0, 4, 4, 44, 844, 1844, 844, 5844, 88, 89, 'UQAAAA', 'VOBAAA', 'HHHHxx'),
+(1666, 1062, 0, 2, 6, 6, 66, 666, 1666, 1666, 1666, 132, 133, 'CMAAAA', 'WOBAAA', 'OOOOxx'),
+(5864, 1063, 0, 0, 4, 4, 64, 864, 1864, 864, 5864, 128, 129, 'ORAAAA', 'XOBAAA', 'VVVVxx'),
+(1004, 1064, 0, 0, 4, 4, 4, 4, 1004, 1004, 1004, 8, 9, 'QMAAAA', 'YOBAAA', 'AAAAxx'),
+(1758, 1065, 0, 2, 8, 18, 58, 758, 1758, 1758, 1758, 116, 117, 'QPAAAA', 'ZOBAAA', 'HHHHxx'),
+(8823, 1066, 1, 3, 3, 3, 23, 823, 823, 3823, 8823, 46, 47, 'JBAAAA', 'APBAAA', 'OOOOxx'),
+(129, 1067, 1, 1, 9, 9, 29, 129, 129, 129, 129, 58, 59, 'ZEAAAA', 'BPBAAA', 'VVVVxx'),
+(5703, 1068, 1, 3, 3, 3, 3, 703, 1703, 703, 5703, 6, 7, 'JLAAAA', 'CPBAAA', 'AAAAxx'),
+(3331, 1069, 1, 3, 1, 11, 31, 331, 1331, 3331, 3331, 62, 63, 'DYAAAA', 'DPBAAA', 'HHHHxx'),
+(5791, 1070, 1, 3, 1, 11, 91, 791, 1791, 791, 5791, 182, 183, 'TOAAAA', 'EPBAAA', 'OOOOxx'),
+(4421, 1071, 1, 1, 1, 1, 21, 421, 421, 4421, 4421, 42, 43, 'BOAAAA', 'FPBAAA', 'VVVVxx'),
+(9740, 1072, 0, 0, 0, 0, 40, 740, 1740, 4740, 9740, 80, 81, 'QKAAAA', 'GPBAAA', 'AAAAxx'),
+(798, 1073, 0, 2, 8, 18, 98, 798, 798, 798, 798, 196, 197, 'SEAAAA', 'HPBAAA', 'HHHHxx'),
+(571, 1074, 1, 3, 1, 11, 71, 571, 571, 571, 571, 142, 143, 'ZVAAAA', 'IPBAAA', 'OOOOxx'),
+(7084, 1075, 0, 0, 4, 4, 84, 84, 1084, 2084, 7084, 168, 169, 'MMAAAA', 'JPBAAA', 'VVVVxx'),
+(650, 1076, 0, 2, 0, 10, 50, 650, 650, 650, 650, 100, 101, 'AZAAAA', 'KPBAAA', 'AAAAxx'),
+(1467, 1077, 1, 3, 7, 7, 67, 467, 1467, 1467, 1467, 134, 135, 'LEAAAA', 'LPBAAA', 'HHHHxx'),
+(5446, 1078, 0, 2, 6, 6, 46, 446, 1446, 446, 5446, 92, 93, 'MBAAAA', 'MPBAAA', 'OOOOxx'),
+(830, 1079, 0, 2, 0, 10, 30, 830, 830, 830, 830, 60, 61, 'YFAAAA', 'NPBAAA', 'VVVVxx'),
+(5516, 1080, 0, 0, 6, 16, 16, 516, 1516, 516, 5516, 32, 33, 'EEAAAA', 'OPBAAA', 'AAAAxx'),
+(8520, 1081, 0, 0, 0, 0, 20, 520, 520, 3520, 8520, 40, 41, 'SPAAAA', 'PPBAAA', 'HHHHxx'),
+(1152, 1082, 0, 0, 2, 12, 52, 152, 1152, 1152, 1152, 104, 105, 'ISAAAA', 'QPBAAA', 'OOOOxx'),
+(862, 1083, 0, 2, 2, 2, 62, 862, 862, 862, 862, 124, 125, 'EHAAAA', 'RPBAAA', 'VVVVxx'),
+(454, 1084, 0, 2, 4, 14, 54, 454, 454, 454, 454, 108, 109, 'MRAAAA', 'SPBAAA', 'AAAAxx'),
+(9956, 1085, 0, 0, 6, 16, 56, 956, 1956, 4956, 9956, 112, 113, 'YSAAAA', 'TPBAAA', 'HHHHxx'),
+(1654, 1086, 0, 2, 4, 14, 54, 654, 1654, 1654, 1654, 108, 109, 'QLAAAA', 'UPBAAA', 'OOOOxx'),
+(257, 1087, 1, 1, 7, 17, 57, 257, 257, 257, 257, 114, 115, 'XJAAAA', 'VPBAAA', 'VVVVxx'),
+(5469, 1088, 1, 1, 9, 9, 69, 469, 1469, 469, 5469, 138, 139, 'JCAAAA', 'WPBAAA', 'AAAAxx'),
+(9075, 1089, 1, 3, 5, 15, 75, 75, 1075, 4075, 9075, 150, 151, 'BLAAAA', 'XPBAAA', 'HHHHxx'),
+(7799, 1090, 1, 3, 9, 19, 99, 799, 1799, 2799, 7799, 198, 199, 'ZNAAAA', 'YPBAAA', 'OOOOxx'),
+(2001, 1091, 1, 1, 1, 1, 1, 1, 1, 2001, 2001, 2, 3, 'ZYAAAA', 'ZPBAAA', 'VVVVxx'),
+(9786, 1092, 0, 2, 6, 6, 86, 786, 1786, 4786, 9786, 172, 173, 'KMAAAA', 'AQBAAA', 'AAAAxx'),
+(7281, 1093, 1, 1, 1, 1, 81, 281, 1281, 2281, 7281, 162, 163, 'BUAAAA', 'BQBAAA', 'HHHHxx'),
+(5137, 1094, 1, 1, 7, 17, 37, 137, 1137, 137, 5137, 74, 75, 'PPAAAA', 'CQBAAA', 'OOOOxx'),
+(4053, 1095, 1, 1, 3, 13, 53, 53, 53, 4053, 4053, 106, 107, 'XZAAAA', 'DQBAAA', 'VVVVxx'),
+(7911, 1096, 1, 3, 1, 11, 11, 911, 1911, 2911, 7911, 22, 23, 'HSAAAA', 'EQBAAA', 'AAAAxx'),
+(4298, 1097, 0, 2, 8, 18, 98, 298, 298, 4298, 4298, 196, 197, 'IJAAAA', 'FQBAAA', 'HHHHxx'),
+(4805, 1098, 1, 1, 5, 5, 5, 805, 805, 4805, 4805, 10, 11, 'VCAAAA', 'GQBAAA', 'OOOOxx'),
+(9038, 1099, 0, 2, 8, 18, 38, 38, 1038, 4038, 9038, 76, 77, 'QJAAAA', 'HQBAAA', 'VVVVxx'),
+(8023, 1100, 1, 3, 3, 3, 23, 23, 23, 3023, 8023, 46, 47, 'PWAAAA', 'IQBAAA', 'AAAAxx'),
+(6595, 1101, 1, 3, 5, 15, 95, 595, 595, 1595, 6595, 190, 191, 'RTAAAA', 'JQBAAA', 'HHHHxx'),
+(9831, 1102, 1, 3, 1, 11, 31, 831, 1831, 4831, 9831, 62, 63, 'DOAAAA', 'KQBAAA', 'OOOOxx'),
+(788, 1103, 0, 0, 8, 8, 88, 788, 788, 788, 788, 176, 177, 'IEAAAA', 'LQBAAA', 'VVVVxx'),
+(902, 1104, 0, 2, 2, 2, 2, 902, 902, 902, 902, 4, 5, 'SIAAAA', 'MQBAAA', 'AAAAxx'),
+(9137, 1105, 1, 1, 7, 17, 37, 137, 1137, 4137, 9137, 74, 75, 'LNAAAA', 'NQBAAA', 'HHHHxx'),
+(1744, 1106, 0, 0, 4, 4, 44, 744, 1744, 1744, 1744, 88, 89, 'CPAAAA', 'OQBAAA', 'OOOOxx'),
+(7285, 1107, 1, 1, 5, 5, 85, 285, 1285, 2285, 7285, 170, 171, 'FUAAAA', 'PQBAAA', 'VVVVxx'),
+(7006, 1108, 0, 2, 6, 6, 6, 6, 1006, 2006, 7006, 12, 13, 'MJAAAA', 'QQBAAA', 'AAAAxx'),
+(9236, 1109, 0, 0, 6, 16, 36, 236, 1236, 4236, 9236, 72, 73, 'GRAAAA', 'RQBAAA', 'HHHHxx'),
+(5472, 1110, 0, 0, 2, 12, 72, 472, 1472, 472, 5472, 144, 145, 'MCAAAA', 'SQBAAA', 'OOOOxx'),
+(7975, 1111, 1, 3, 5, 15, 75, 975, 1975, 2975, 7975, 150, 151, 'TUAAAA', 'TQBAAA', 'VVVVxx'),
+(4181, 1112, 1, 1, 1, 1, 81, 181, 181, 4181, 4181, 162, 163, 'VEAAAA', 'UQBAAA', 'AAAAxx'),
+(7677, 1113, 1, 1, 7, 17, 77, 677, 1677, 2677, 7677, 154, 155, 'HJAAAA', 'VQBAAA', 'HHHHxx'),
+(35, 1114, 1, 3, 5, 15, 35, 35, 35, 35, 35, 70, 71, 'JBAAAA', 'WQBAAA', 'OOOOxx'),
+(6813, 1115, 1, 1, 3, 13, 13, 813, 813, 1813, 6813, 26, 27, 'BCAAAA', 'XQBAAA', 'VVVVxx'),
+(6618, 1116, 0, 2, 8, 18, 18, 618, 618, 1618, 6618, 36, 37, 'OUAAAA', 'YQBAAA', 'AAAAxx'),
+(8069, 1117, 1, 1, 9, 9, 69, 69, 69, 3069, 8069, 138, 139, 'JYAAAA', 'ZQBAAA', 'HHHHxx'),
+(3071, 1118, 1, 3, 1, 11, 71, 71, 1071, 3071, 3071, 142, 143, 'DOAAAA', 'ARBAAA', 'OOOOxx'),
+(4390, 1119, 0, 2, 0, 10, 90, 390, 390, 4390, 4390, 180, 181, 'WMAAAA', 'BRBAAA', 'VVVVxx'),
+(7764, 1120, 0, 0, 4, 4, 64, 764, 1764, 2764, 7764, 128, 129, 'QMAAAA', 'CRBAAA', 'AAAAxx'),
+(8163, 1121, 1, 3, 3, 3, 63, 163, 163, 3163, 8163, 126, 127, 'ZBAAAA', 'DRBAAA', 'HHHHxx'),
+(1961, 1122, 1, 1, 1, 1, 61, 961, 1961, 1961, 1961, 122, 123, 'LXAAAA', 'ERBAAA', 'OOOOxx'),
+(1103, 1123, 1, 3, 3, 3, 3, 103, 1103, 1103, 1103, 6, 7, 'LQAAAA', 'FRBAAA', 'VVVVxx'),
+(5486, 1124, 0, 2, 6, 6, 86, 486, 1486, 486, 5486, 172, 173, 'ADAAAA', 'GRBAAA', 'AAAAxx'),
+(9513, 1125, 1, 1, 3, 13, 13, 513, 1513, 4513, 9513, 26, 27, 'XBAAAA', 'HRBAAA', 'HHHHxx'),
+(7311, 1126, 1, 3, 1, 11, 11, 311, 1311, 2311, 7311, 22, 23, 'FVAAAA', 'IRBAAA', 'OOOOxx'),
+(4144, 1127, 0, 0, 4, 4, 44, 144, 144, 4144, 4144, 88, 89, 'KDAAAA', 'JRBAAA', 'VVVVxx'),
+(7901, 1128, 1, 1, 1, 1, 1, 901, 1901, 2901, 7901, 2, 3, 'XRAAAA', 'KRBAAA', 'AAAAxx'),
+(4629, 1129, 1, 1, 9, 9, 29, 629, 629, 4629, 4629, 58, 59, 'BWAAAA', 'LRBAAA', 'HHHHxx'),
+(6858, 1130, 0, 2, 8, 18, 58, 858, 858, 1858, 6858, 116, 117, 'UDAAAA', 'MRBAAA', 'OOOOxx'),
+(125, 1131, 1, 1, 5, 5, 25, 125, 125, 125, 125, 50, 51, 'VEAAAA', 'NRBAAA', 'VVVVxx'),
+(3834, 1132, 0, 2, 4, 14, 34, 834, 1834, 3834, 3834, 68, 69, 'MRAAAA', 'ORBAAA', 'AAAAxx'),
+(8155, 1133, 1, 3, 5, 15, 55, 155, 155, 3155, 8155, 110, 111, 'RBAAAA', 'PRBAAA', 'HHHHxx'),
+(8230, 1134, 0, 2, 0, 10, 30, 230, 230, 3230, 8230, 60, 61, 'OEAAAA', 'QRBAAA', 'OOOOxx'),
+(744, 1135, 0, 0, 4, 4, 44, 744, 744, 744, 744, 88, 89, 'QCAAAA', 'RRBAAA', 'VVVVxx'),
+(357, 1136, 1, 1, 7, 17, 57, 357, 357, 357, 357, 114, 115, 'TNAAAA', 'SRBAAA', 'AAAAxx'),
+(2159, 1137, 1, 3, 9, 19, 59, 159, 159, 2159, 2159, 118, 119, 'BFAAAA', 'TRBAAA', 'HHHHxx'),
+(8559, 1138, 1, 3, 9, 19, 59, 559, 559, 3559, 8559, 118, 119, 'FRAAAA', 'URBAAA', 'OOOOxx'),
+(6866, 1139, 0, 2, 6, 6, 66, 866, 866, 1866, 6866, 132, 133, 'CEAAAA', 'VRBAAA', 'VVVVxx'),
+(3863, 1140, 1, 3, 3, 3, 63, 863, 1863, 3863, 3863, 126, 127, 'PSAAAA', 'WRBAAA', 'AAAAxx'),
+(4193, 1141, 1, 1, 3, 13, 93, 193, 193, 4193, 4193, 186, 187, 'HFAAAA', 'XRBAAA', 'HHHHxx'),
+(3277, 1142, 1, 1, 7, 17, 77, 277, 1277, 3277, 3277, 154, 155, 'BWAAAA', 'YRBAAA', 'OOOOxx'),
+(5577, 1143, 1, 1, 7, 17, 77, 577, 1577, 577, 5577, 154, 155, 'NGAAAA', 'ZRBAAA', 'VVVVxx'),
+(9503, 1144, 1, 3, 3, 3, 3, 503, 1503, 4503, 9503, 6, 7, 'NBAAAA', 'ASBAAA', 'AAAAxx'),
+(7642, 1145, 0, 2, 2, 2, 42, 642, 1642, 2642, 7642, 84, 85, 'YHAAAA', 'BSBAAA', 'HHHHxx'),
+(6197, 1146, 1, 1, 7, 17, 97, 197, 197, 1197, 6197, 194, 195, 'JEAAAA', 'CSBAAA', 'OOOOxx'),
+(8995, 1147, 1, 3, 5, 15, 95, 995, 995, 3995, 8995, 190, 191, 'ZHAAAA', 'DSBAAA', 'VVVVxx'),
+(440, 1148, 0, 0, 0, 0, 40, 440, 440, 440, 440, 80, 81, 'YQAAAA', 'ESBAAA', 'AAAAxx'),
+(8418, 1149, 0, 2, 8, 18, 18, 418, 418, 3418, 8418, 36, 37, 'ULAAAA', 'FSBAAA', 'HHHHxx'),
+(8531, 1150, 1, 3, 1, 11, 31, 531, 531, 3531, 8531, 62, 63, 'DQAAAA', 'GSBAAA', 'OOOOxx'),
+(3790, 1151, 0, 2, 0, 10, 90, 790, 1790, 3790, 3790, 180, 181, 'UPAAAA', 'HSBAAA', 'VVVVxx'),
+(7610, 1152, 0, 2, 0, 10, 10, 610, 1610, 2610, 7610, 20, 21, 'SGAAAA', 'ISBAAA', 'AAAAxx'),
+(1252, 1153, 0, 0, 2, 12, 52, 252, 1252, 1252, 1252, 104, 105, 'EWAAAA', 'JSBAAA', 'HHHHxx'),
+(7559, 1154, 1, 3, 9, 19, 59, 559, 1559, 2559, 7559, 118, 119, 'TEAAAA', 'KSBAAA', 'OOOOxx'),
+(9945, 1155, 1, 1, 5, 5, 45, 945, 1945, 4945, 9945, 90, 91, 'NSAAAA', 'LSBAAA', 'VVVVxx'),
+(9023, 1156, 1, 3, 3, 3, 23, 23, 1023, 4023, 9023, 46, 47, 'BJAAAA', 'MSBAAA', 'AAAAxx'),
+(3516, 1157, 0, 0, 6, 16, 16, 516, 1516, 3516, 3516, 32, 33, 'GFAAAA', 'NSBAAA', 'HHHHxx'),
+(4671, 1158, 1, 3, 1, 11, 71, 671, 671, 4671, 4671, 142, 143, 'RXAAAA', 'OSBAAA', 'OOOOxx'),
+(1465, 1159, 1, 1, 5, 5, 65, 465, 1465, 1465, 1465, 130, 131, 'JEAAAA', 'PSBAAA', 'VVVVxx'),
+(9515, 1160, 1, 3, 5, 15, 15, 515, 1515, 4515, 9515, 30, 31, 'ZBAAAA', 'QSBAAA', 'AAAAxx'),
+(3242, 1161, 0, 2, 2, 2, 42, 242, 1242, 3242, 3242, 84, 85, 'SUAAAA', 'RSBAAA', 'HHHHxx'),
+(1732, 1162, 0, 0, 2, 12, 32, 732, 1732, 1732, 1732, 64, 65, 'QOAAAA', 'SSBAAA', 'OOOOxx'),
+(1678, 1163, 0, 2, 8, 18, 78, 678, 1678, 1678, 1678, 156, 157, 'OMAAAA', 'TSBAAA', 'VVVVxx'),
+(1464, 1164, 0, 0, 4, 4, 64, 464, 1464, 1464, 1464, 128, 129, 'IEAAAA', 'USBAAA', 'AAAAxx'),
+(6546, 1165, 0, 2, 6, 6, 46, 546, 546, 1546, 6546, 92, 93, 'URAAAA', 'VSBAAA', 'HHHHxx'),
+(4448, 1166, 0, 0, 8, 8, 48, 448, 448, 4448, 4448, 96, 97, 'CPAAAA', 'WSBAAA', 'OOOOxx'),
+(9847, 1167, 1, 3, 7, 7, 47, 847, 1847, 4847, 9847, 94, 95, 'TOAAAA', 'XSBAAA', 'VVVVxx'),
+(8264, 1168, 0, 0, 4, 4, 64, 264, 264, 3264, 8264, 128, 129, 'WFAAAA', 'YSBAAA', 'AAAAxx'),
+(1620, 1169, 0, 0, 0, 0, 20, 620, 1620, 1620, 1620, 40, 41, 'IKAAAA', 'ZSBAAA', 'HHHHxx'),
+(9388, 1170, 0, 0, 8, 8, 88, 388, 1388, 4388, 9388, 176, 177, 'CXAAAA', 'ATBAAA', 'OOOOxx'),
+(6445, 1171, 1, 1, 5, 5, 45, 445, 445, 1445, 6445, 90, 91, 'XNAAAA', 'BTBAAA', 'VVVVxx'),
+(4789, 1172, 1, 1, 9, 9, 89, 789, 789, 4789, 4789, 178, 179, 'FCAAAA', 'CTBAAA', 'AAAAxx'),
+(1562, 1173, 0, 2, 2, 2, 62, 562, 1562, 1562, 1562, 124, 125, 'CIAAAA', 'DTBAAA', 'HHHHxx'),
+(7305, 1174, 1, 1, 5, 5, 5, 305, 1305, 2305, 7305, 10, 11, 'ZUAAAA', 'ETBAAA', 'OOOOxx'),
+(6344, 1175, 0, 0, 4, 4, 44, 344, 344, 1344, 6344, 88, 89, 'AKAAAA', 'FTBAAA', 'VVVVxx'),
+(5130, 1176, 0, 2, 0, 10, 30, 130, 1130, 130, 5130, 60, 61, 'IPAAAA', 'GTBAAA', 'AAAAxx'),
+(3284, 1177, 0, 0, 4, 4, 84, 284, 1284, 3284, 3284, 168, 169, 'IWAAAA', 'HTBAAA', 'HHHHxx'),
+(6346, 1178, 0, 2, 6, 6, 46, 346, 346, 1346, 6346, 92, 93, 'CKAAAA', 'ITBAAA', 'OOOOxx'),
+(1061, 1179, 1, 1, 1, 1, 61, 61, 1061, 1061, 1061, 122, 123, 'VOAAAA', 'JTBAAA', 'VVVVxx'),
+(872, 1180, 0, 0, 2, 12, 72, 872, 872, 872, 872, 144, 145, 'OHAAAA', 'KTBAAA', 'AAAAxx'),
+(123, 1181, 1, 3, 3, 3, 23, 123, 123, 123, 123, 46, 47, 'TEAAAA', 'LTBAAA', 'HHHHxx'),
+(7903, 1182, 1, 3, 3, 3, 3, 903, 1903, 2903, 7903, 6, 7, 'ZRAAAA', 'MTBAAA', 'OOOOxx'),
+(560, 1183, 0, 0, 0, 0, 60, 560, 560, 560, 560, 120, 121, 'OVAAAA', 'NTBAAA', 'VVVVxx'),
+(4446, 1184, 0, 2, 6, 6, 46, 446, 446, 4446, 4446, 92, 93, 'APAAAA', 'OTBAAA', 'AAAAxx'),
+(3909, 1185, 1, 1, 9, 9, 9, 909, 1909, 3909, 3909, 18, 19, 'JUAAAA', 'PTBAAA', 'HHHHxx'),
+(669, 1186, 1, 1, 9, 9, 69, 669, 669, 669, 669, 138, 139, 'TZAAAA', 'QTBAAA', 'OOOOxx'),
+(7843, 1187, 1, 3, 3, 3, 43, 843, 1843, 2843, 7843, 86, 87, 'RPAAAA', 'RTBAAA', 'VVVVxx'),
+(2546, 1188, 0, 2, 6, 6, 46, 546, 546, 2546, 2546, 92, 93, 'YTAAAA', 'STBAAA', 'AAAAxx'),
+(6757, 1189, 1, 1, 7, 17, 57, 757, 757, 1757, 6757, 114, 115, 'XZAAAA', 'TTBAAA', 'HHHHxx'),
+(466, 1190, 0, 2, 6, 6, 66, 466, 466, 466, 466, 132, 133, 'YRAAAA', 'UTBAAA', 'OOOOxx'),
+(5556, 1191, 0, 0, 6, 16, 56, 556, 1556, 556, 5556, 112, 113, 'SFAAAA', 'VTBAAA', 'VVVVxx'),
+(7196, 1192, 0, 0, 6, 16, 96, 196, 1196, 2196, 7196, 192, 193, 'UQAAAA', 'WTBAAA', 'AAAAxx'),
+(2947, 1193, 1, 3, 7, 7, 47, 947, 947, 2947, 2947, 94, 95, 'JJAAAA', 'XTBAAA', 'HHHHxx'),
+(6493, 1194, 1, 1, 3, 13, 93, 493, 493, 1493, 6493, 186, 187, 'TPAAAA', 'YTBAAA', 'OOOOxx'),
+(7203, 1195, 1, 3, 3, 3, 3, 203, 1203, 2203, 7203, 6, 7, 'BRAAAA', 'ZTBAAA', 'VVVVxx'),
+(3716, 1196, 0, 0, 6, 16, 16, 716, 1716, 3716, 3716, 32, 33, 'YMAAAA', 'AUBAAA', 'AAAAxx'),
+(8058, 1197, 0, 2, 8, 18, 58, 58, 58, 3058, 8058, 116, 117, 'YXAAAA', 'BUBAAA', 'HHHHxx'),
+(433, 1198, 1, 1, 3, 13, 33, 433, 433, 433, 433, 66, 67, 'RQAAAA', 'CUBAAA', 'OOOOxx'),
+(7649, 1199, 1, 1, 9, 9, 49, 649, 1649, 2649, 7649, 98, 99, 'FIAAAA', 'DUBAAA', 'VVVVxx'),
+(6966, 1200, 0, 2, 6, 6, 66, 966, 966, 1966, 6966, 132, 133, 'YHAAAA', 'EUBAAA', 'AAAAxx'),
+(553, 1201, 1, 1, 3, 13, 53, 553, 553, 553, 553, 106, 107, 'HVAAAA', 'FUBAAA', 'HHHHxx'),
+(3677, 1202, 1, 1, 7, 17, 77, 677, 1677, 3677, 3677, 154, 155, 'LLAAAA', 'GUBAAA', 'OOOOxx'),
+(2344, 1203, 0, 0, 4, 4, 44, 344, 344, 2344, 2344, 88, 89, 'EMAAAA', 'HUBAAA', 'VVVVxx'),
+(7439, 1204, 1, 3, 9, 19, 39, 439, 1439, 2439, 7439, 78, 79, 'DAAAAA', 'IUBAAA', 'AAAAxx'),
+(3910, 1205, 0, 2, 0, 10, 10, 910, 1910, 3910, 3910, 20, 21, 'KUAAAA', 'JUBAAA', 'HHHHxx'),
+(3638, 1206, 0, 2, 8, 18, 38, 638, 1638, 3638, 3638, 76, 77, 'YJAAAA', 'KUBAAA', 'OOOOxx'),
+(6637, 1207, 1, 1, 7, 17, 37, 637, 637, 1637, 6637, 74, 75, 'HVAAAA', 'LUBAAA', 'VVVVxx'),
+(4438, 1208, 0, 2, 8, 18, 38, 438, 438, 4438, 4438, 76, 77, 'SOAAAA', 'MUBAAA', 'AAAAxx'),
+(171, 1209, 1, 3, 1, 11, 71, 171, 171, 171, 171, 142, 143, 'PGAAAA', 'NUBAAA', 'HHHHxx'),
+(310, 1210, 0, 2, 0, 10, 10, 310, 310, 310, 310, 20, 21, 'YLAAAA', 'OUBAAA', 'OOOOxx'),
+(2714, 1211, 0, 2, 4, 14, 14, 714, 714, 2714, 2714, 28, 29, 'KAAAAA', 'PUBAAA', 'VVVVxx'),
+(5199, 1212, 1, 3, 9, 19, 99, 199, 1199, 199, 5199, 198, 199, 'ZRAAAA', 'QUBAAA', 'AAAAxx'),
+(8005, 1213, 1, 1, 5, 5, 5, 5, 5, 3005, 8005, 10, 11, 'XVAAAA', 'RUBAAA', 'HHHHxx'),
+(3188, 1214, 0, 0, 8, 8, 88, 188, 1188, 3188, 3188, 176, 177, 'QSAAAA', 'SUBAAA', 'OOOOxx'),
+(1518, 1215, 0, 2, 8, 18, 18, 518, 1518, 1518, 1518, 36, 37, 'KGAAAA', 'TUBAAA', 'VVVVxx'),
+(6760, 1216, 0, 0, 0, 0, 60, 760, 760, 1760, 6760, 120, 121, 'AAAAAA', 'UUBAAA', 'AAAAxx'),
+(9373, 1217, 1, 1, 3, 13, 73, 373, 1373, 4373, 9373, 146, 147, 'NWAAAA', 'VUBAAA', 'HHHHxx'),
+(1938, 1218, 0, 2, 8, 18, 38, 938, 1938, 1938, 1938, 76, 77, 'OWAAAA', 'WUBAAA', 'OOOOxx'),
+(2865, 1219, 1, 1, 5, 5, 65, 865, 865, 2865, 2865, 130, 131, 'FGAAAA', 'XUBAAA', 'VVVVxx'),
+(3203, 1220, 1, 3, 3, 3, 3, 203, 1203, 3203, 3203, 6, 7, 'FTAAAA', 'YUBAAA', 'AAAAxx'),
+(6025, 1221, 1, 1, 5, 5, 25, 25, 25, 1025, 6025, 50, 51, 'TXAAAA', 'ZUBAAA', 'HHHHxx'),
+(8684, 1222, 0, 0, 4, 4, 84, 684, 684, 3684, 8684, 168, 169, 'AWAAAA', 'AVBAAA', 'OOOOxx'),
+(7732, 1223, 0, 0, 2, 12, 32, 732, 1732, 2732, 7732, 64, 65, 'KLAAAA', 'BVBAAA', 'VVVVxx'),
+(3218, 1224, 0, 2, 8, 18, 18, 218, 1218, 3218, 3218, 36, 37, 'UTAAAA', 'CVBAAA', 'AAAAxx'),
+(525, 1225, 1, 1, 5, 5, 25, 525, 525, 525, 525, 50, 51, 'FUAAAA', 'DVBAAA', 'HHHHxx'),
+(601, 1226, 1, 1, 1, 1, 1, 601, 601, 601, 601, 2, 3, 'DXAAAA', 'EVBAAA', 'OOOOxx'),
+(6091, 1227, 1, 3, 1, 11, 91, 91, 91, 1091, 6091, 182, 183, 'HAAAAA', 'FVBAAA', 'VVVVxx'),
+(4498, 1228, 0, 2, 8, 18, 98, 498, 498, 4498, 4498, 196, 197, 'ARAAAA', 'GVBAAA', 'AAAAxx'),
+(8192, 1229, 0, 0, 2, 12, 92, 192, 192, 3192, 8192, 184, 185, 'CDAAAA', 'HVBAAA', 'HHHHxx'),
+(8006, 1230, 0, 2, 6, 6, 6, 6, 6, 3006, 8006, 12, 13, 'YVAAAA', 'IVBAAA', 'OOOOxx'),
+(6157, 1231, 1, 1, 7, 17, 57, 157, 157, 1157, 6157, 114, 115, 'VCAAAA', 'JVBAAA', 'VVVVxx'),
+(312, 1232, 0, 0, 2, 12, 12, 312, 312, 312, 312, 24, 25, 'AMAAAA', 'KVBAAA', 'AAAAxx'),
+(8652, 1233, 0, 0, 2, 12, 52, 652, 652, 3652, 8652, 104, 105, 'UUAAAA', 'LVBAAA', 'HHHHxx'),
+(2787, 1234, 1, 3, 7, 7, 87, 787, 787, 2787, 2787, 174, 175, 'FDAAAA', 'MVBAAA', 'OOOOxx'),
+(1782, 1235, 0, 2, 2, 2, 82, 782, 1782, 1782, 1782, 164, 165, 'OQAAAA', 'NVBAAA', 'VVVVxx'),
+(23, 1236, 1, 3, 3, 3, 23, 23, 23, 23, 23, 46, 47, 'XAAAAA', 'OVBAAA', 'AAAAxx'),
+(1206, 1237, 0, 2, 6, 6, 6, 206, 1206, 1206, 1206, 12, 13, 'KUAAAA', 'PVBAAA', 'HHHHxx'),
+(1076, 1238, 0, 0, 6, 16, 76, 76, 1076, 1076, 1076, 152, 153, 'KPAAAA', 'QVBAAA', 'OOOOxx'),
+(5379, 1239, 1, 3, 9, 19, 79, 379, 1379, 379, 5379, 158, 159, 'XYAAAA', 'RVBAAA', 'VVVVxx'),
+(2047, 1240, 1, 3, 7, 7, 47, 47, 47, 2047, 2047, 94, 95, 'TAAAAA', 'SVBAAA', 'AAAAxx'),
+(6262, 1241, 0, 2, 2, 2, 62, 262, 262, 1262, 6262, 124, 125, 'WGAAAA', 'TVBAAA', 'HHHHxx'),
+(1840, 1242, 0, 0, 0, 0, 40, 840, 1840, 1840, 1840, 80, 81, 'USAAAA', 'UVBAAA', 'OOOOxx'),
+(2106, 1243, 0, 2, 6, 6, 6, 106, 106, 2106, 2106, 12, 13, 'ADAAAA', 'VVBAAA', 'VVVVxx'),
+(1307, 1244, 1, 3, 7, 7, 7, 307, 1307, 1307, 1307, 14, 15, 'HYAAAA', 'WVBAAA', 'AAAAxx'),
+(735, 1245, 1, 3, 5, 15, 35, 735, 735, 735, 735, 70, 71, 'HCAAAA', 'XVBAAA', 'HHHHxx'),
+(3657, 1246, 1, 1, 7, 17, 57, 657, 1657, 3657, 3657, 114, 115, 'RKAAAA', 'YVBAAA', 'OOOOxx'),
+(3006, 1247, 0, 2, 6, 6, 6, 6, 1006, 3006, 3006, 12, 13, 'QLAAAA', 'ZVBAAA', 'VVVVxx'),
+(1538, 1248, 0, 2, 8, 18, 38, 538, 1538, 1538, 1538, 76, 77, 'EHAAAA', 'AWBAAA', 'AAAAxx'),
+(6098, 1249, 0, 2, 8, 18, 98, 98, 98, 1098, 6098, 196, 197, 'OAAAAA', 'BWBAAA', 'HHHHxx'),
+(5267, 1250, 1, 3, 7, 7, 67, 267, 1267, 267, 5267, 134, 135, 'PUAAAA', 'CWBAAA', 'OOOOxx'),
+(9757, 1251, 1, 1, 7, 17, 57, 757, 1757, 4757, 9757, 114, 115, 'HLAAAA', 'DWBAAA', 'VVVVxx'),
+(1236, 1252, 0, 0, 6, 16, 36, 236, 1236, 1236, 1236, 72, 73, 'OVAAAA', 'EWBAAA', 'AAAAxx'),
+(83, 1253, 1, 3, 3, 3, 83, 83, 83, 83, 83, 166, 167, 'FDAAAA', 'FWBAAA', 'HHHHxx'),
+(9227, 1254, 1, 3, 7, 7, 27, 227, 1227, 4227, 9227, 54, 55, 'XQAAAA', 'GWBAAA', 'OOOOxx'),
+(8772, 1255, 0, 0, 2, 12, 72, 772, 772, 3772, 8772, 144, 145, 'KZAAAA', 'HWBAAA', 'VVVVxx'),
+(8822, 1256, 0, 2, 2, 2, 22, 822, 822, 3822, 8822, 44, 45, 'IBAAAA', 'IWBAAA', 'AAAAxx'),
+(7167, 1257, 1, 3, 7, 7, 67, 167, 1167, 2167, 7167, 134, 135, 'RPAAAA', 'JWBAAA', 'HHHHxx'),
+(6909, 1258, 1, 1, 9, 9, 9, 909, 909, 1909, 6909, 18, 19, 'TFAAAA', 'KWBAAA', 'OOOOxx'),
+(1439, 1259, 1, 3, 9, 19, 39, 439, 1439, 1439, 1439, 78, 79, 'JDAAAA', 'LWBAAA', 'VVVVxx'),
+(2370, 1260, 0, 2, 0, 10, 70, 370, 370, 2370, 2370, 140, 141, 'ENAAAA', 'MWBAAA', 'AAAAxx'),
+(4577, 1261, 1, 1, 7, 17, 77, 577, 577, 4577, 4577, 154, 155, 'BUAAAA', 'NWBAAA', 'HHHHxx'),
+(2575, 1262, 1, 3, 5, 15, 75, 575, 575, 2575, 2575, 150, 151, 'BVAAAA', 'OWBAAA', 'OOOOxx'),
+(2795, 1263, 1, 3, 5, 15, 95, 795, 795, 2795, 2795, 190, 191, 'NDAAAA', 'PWBAAA', 'VVVVxx'),
+(5520, 1264, 0, 0, 0, 0, 20, 520, 1520, 520, 5520, 40, 41, 'IEAAAA', 'QWBAAA', 'AAAAxx'),
+(382, 1265, 0, 2, 2, 2, 82, 382, 382, 382, 382, 164, 165, 'SOAAAA', 'RWBAAA', 'HHHHxx'),
+(6335, 1266, 1, 3, 5, 15, 35, 335, 335, 1335, 6335, 70, 71, 'RJAAAA', 'SWBAAA', 'OOOOxx'),
+(8430, 1267, 0, 2, 0, 10, 30, 430, 430, 3430, 8430, 60, 61, 'GMAAAA', 'TWBAAA', 'VVVVxx'),
+(4131, 1268, 1, 3, 1, 11, 31, 131, 131, 4131, 4131, 62, 63, 'XCAAAA', 'UWBAAA', 'AAAAxx'),
+(9332, 1269, 0, 0, 2, 12, 32, 332, 1332, 4332, 9332, 64, 65, 'YUAAAA', 'VWBAAA', 'HHHHxx'),
+(293, 1270, 1, 1, 3, 13, 93, 293, 293, 293, 293, 186, 187, 'HLAAAA', 'WWBAAA', 'OOOOxx'),
+(2276, 1271, 0, 0, 6, 16, 76, 276, 276, 2276, 2276, 152, 153, 'OJAAAA', 'XWBAAA', 'VVVVxx'),
+(5687, 1272, 1, 3, 7, 7, 87, 687, 1687, 687, 5687, 174, 175, 'TKAAAA', 'YWBAAA', 'AAAAxx'),
+(5862, 1273, 0, 2, 2, 2, 62, 862, 1862, 862, 5862, 124, 125, 'MRAAAA', 'ZWBAAA', 'HHHHxx'),
+(5073, 1274, 1, 1, 3, 13, 73, 73, 1073, 73, 5073, 146, 147, 'DNAAAA', 'AXBAAA', 'OOOOxx'),
+(4170, 1275, 0, 2, 0, 10, 70, 170, 170, 4170, 4170, 140, 141, 'KEAAAA', 'BXBAAA', 'VVVVxx'),
+(5039, 1276, 1, 3, 9, 19, 39, 39, 1039, 39, 5039, 78, 79, 'VLAAAA', 'CXBAAA', 'AAAAxx'),
+(3294, 1277, 0, 2, 4, 14, 94, 294, 1294, 3294, 3294, 188, 189, 'SWAAAA', 'DXBAAA', 'HHHHxx'),
+(6015, 1278, 1, 3, 5, 15, 15, 15, 15, 1015, 6015, 30, 31, 'JXAAAA', 'EXBAAA', 'OOOOxx'),
+(9015, 1279, 1, 3, 5, 15, 15, 15, 1015, 4015, 9015, 30, 31, 'TIAAAA', 'FXBAAA', 'VVVVxx'),
+(9785, 1280, 1, 1, 5, 5, 85, 785, 1785, 4785, 9785, 170, 171, 'JMAAAA', 'GXBAAA', 'AAAAxx'),
+(4312, 1281, 0, 0, 2, 12, 12, 312, 312, 4312, 4312, 24, 25, 'WJAAAA', 'HXBAAA', 'HHHHxx'),
+(6343, 1282, 1, 3, 3, 3, 43, 343, 343, 1343, 6343, 86, 87, 'ZJAAAA', 'IXBAAA', 'OOOOxx'),
+(2161, 1283, 1, 1, 1, 1, 61, 161, 161, 2161, 2161, 122, 123, 'DFAAAA', 'JXBAAA', 'VVVVxx'),
+(4490, 1284, 0, 2, 0, 10, 90, 490, 490, 4490, 4490, 180, 181, 'SQAAAA', 'KXBAAA', 'AAAAxx'),
+(4454, 1285, 0, 2, 4, 14, 54, 454, 454, 4454, 4454, 108, 109, 'IPAAAA', 'LXBAAA', 'HHHHxx'),
+(7647, 1286, 1, 3, 7, 7, 47, 647, 1647, 2647, 7647, 94, 95, 'DIAAAA', 'MXBAAA', 'OOOOxx'),
+(1028, 1287, 0, 0, 8, 8, 28, 28, 1028, 1028, 1028, 56, 57, 'ONAAAA', 'NXBAAA', 'VVVVxx'),
+(2965, 1288, 1, 1, 5, 5, 65, 965, 965, 2965, 2965, 130, 131, 'BKAAAA', 'OXBAAA', 'AAAAxx'),
+(9900, 1289, 0, 0, 0, 0, 0, 900, 1900, 4900, 9900, 0, 1, 'UQAAAA', 'PXBAAA', 'HHHHxx'),
+(5509, 1290, 1, 1, 9, 9, 9, 509, 1509, 509, 5509, 18, 19, 'XDAAAA', 'QXBAAA', 'OOOOxx'),
+(7751, 1291, 1, 3, 1, 11, 51, 751, 1751, 2751, 7751, 102, 103, 'DMAAAA', 'RXBAAA', 'VVVVxx'),
+(9594, 1292, 0, 2, 4, 14, 94, 594, 1594, 4594, 9594, 188, 189, 'AFAAAA', 'SXBAAA', 'AAAAxx'),
+(7632, 1293, 0, 0, 2, 12, 32, 632, 1632, 2632, 7632, 64, 65, 'OHAAAA', 'TXBAAA', 'HHHHxx'),
+(6528, 1294, 0, 0, 8, 8, 28, 528, 528, 1528, 6528, 56, 57, 'CRAAAA', 'UXBAAA', 'OOOOxx'),
+(1041, 1295, 1, 1, 1, 1, 41, 41, 1041, 1041, 1041, 82, 83, 'BOAAAA', 'VXBAAA', 'VVVVxx'),
+(1534, 1296, 0, 2, 4, 14, 34, 534, 1534, 1534, 1534, 68, 69, 'AHAAAA', 'WXBAAA', 'AAAAxx'),
+(4229, 1297, 1, 1, 9, 9, 29, 229, 229, 4229, 4229, 58, 59, 'RGAAAA', 'XXBAAA', 'HHHHxx'),
+(84, 1298, 0, 0, 4, 4, 84, 84, 84, 84, 84, 168, 169, 'GDAAAA', 'YXBAAA', 'OOOOxx'),
+(2189, 1299, 1, 1, 9, 9, 89, 189, 189, 2189, 2189, 178, 179, 'FGAAAA', 'ZXBAAA', 'VVVVxx'),
+(7566, 1300, 0, 2, 6, 6, 66, 566, 1566, 2566, 7566, 132, 133, 'AFAAAA', 'AYBAAA', 'AAAAxx'),
+(707, 1301, 1, 3, 7, 7, 7, 707, 707, 707, 707, 14, 15, 'FBAAAA', 'BYBAAA', 'HHHHxx'),
+(581, 1302, 1, 1, 1, 1, 81, 581, 581, 581, 581, 162, 163, 'JWAAAA', 'CYBAAA', 'OOOOxx'),
+(6753, 1303, 1, 1, 3, 13, 53, 753, 753, 1753, 6753, 106, 107, 'TZAAAA', 'DYBAAA', 'VVVVxx'),
+(8604, 1304, 0, 0, 4, 4, 4, 604, 604, 3604, 8604, 8, 9, 'YSAAAA', 'EYBAAA', 'AAAAxx'),
+(373, 1305, 1, 1, 3, 13, 73, 373, 373, 373, 373, 146, 147, 'JOAAAA', 'FYBAAA', 'HHHHxx'),
+(9635, 1306, 1, 3, 5, 15, 35, 635, 1635, 4635, 9635, 70, 71, 'PGAAAA', 'GYBAAA', 'OOOOxx'),
+(9277, 1307, 1, 1, 7, 17, 77, 277, 1277, 4277, 9277, 154, 155, 'VSAAAA', 'HYBAAA', 'VVVVxx'),
+(7117, 1308, 1, 1, 7, 17, 17, 117, 1117, 2117, 7117, 34, 35, 'TNAAAA', 'IYBAAA', 'AAAAxx'),
+(8564, 1309, 0, 0, 4, 4, 64, 564, 564, 3564, 8564, 128, 129, 'KRAAAA', 'JYBAAA', 'HHHHxx'),
+(1697, 1310, 1, 1, 7, 17, 97, 697, 1697, 1697, 1697, 194, 195, 'HNAAAA', 'KYBAAA', 'OOOOxx'),
+(7840, 1311, 0, 0, 0, 0, 40, 840, 1840, 2840, 7840, 80, 81, 'OPAAAA', 'LYBAAA', 'VVVVxx'),
+(3646, 1312, 0, 2, 6, 6, 46, 646, 1646, 3646, 3646, 92, 93, 'GKAAAA', 'MYBAAA', 'AAAAxx'),
+(368, 1313, 0, 0, 8, 8, 68, 368, 368, 368, 368, 136, 137, 'EOAAAA', 'NYBAAA', 'HHHHxx'),
+(4797, 1314, 1, 1, 7, 17, 97, 797, 797, 4797, 4797, 194, 195, 'NCAAAA', 'OYBAAA', 'OOOOxx'),
+(5300, 1315, 0, 0, 0, 0, 0, 300, 1300, 300, 5300, 0, 1, 'WVAAAA', 'PYBAAA', 'VVVVxx'),
+(7664, 1316, 0, 0, 4, 4, 64, 664, 1664, 2664, 7664, 128, 129, 'UIAAAA', 'QYBAAA', 'AAAAxx'),
+(1466, 1317, 0, 2, 6, 6, 66, 466, 1466, 1466, 1466, 132, 133, 'KEAAAA', 'RYBAAA', 'HHHHxx'),
+(2477, 1318, 1, 1, 7, 17, 77, 477, 477, 2477, 2477, 154, 155, 'HRAAAA', 'SYBAAA', 'OOOOxx'),
+(2036, 1319, 0, 0, 6, 16, 36, 36, 36, 2036, 2036, 72, 73, 'IAAAAA', 'TYBAAA', 'VVVVxx'),
+(3624, 1320, 0, 0, 4, 4, 24, 624, 1624, 3624, 3624, 48, 49, 'KJAAAA', 'UYBAAA', 'AAAAxx'),
+(5099, 1321, 1, 3, 9, 19, 99, 99, 1099, 99, 5099, 198, 199, 'DOAAAA', 'VYBAAA', 'HHHHxx'),
+(1308, 1322, 0, 0, 8, 8, 8, 308, 1308, 1308, 1308, 16, 17, 'IYAAAA', 'WYBAAA', 'OOOOxx'),
+(3704, 1323, 0, 0, 4, 4, 4, 704, 1704, 3704, 3704, 8, 9, 'MMAAAA', 'XYBAAA', 'VVVVxx'),
+(2451, 1324, 1, 3, 1, 11, 51, 451, 451, 2451, 2451, 102, 103, 'HQAAAA', 'YYBAAA', 'AAAAxx'),
+(4898, 1325, 0, 2, 8, 18, 98, 898, 898, 4898, 4898, 196, 197, 'KGAAAA', 'ZYBAAA', 'HHHHxx'),
+(4959, 1326, 1, 3, 9, 19, 59, 959, 959, 4959, 4959, 118, 119, 'TIAAAA', 'AZBAAA', 'OOOOxx'),
+(5942, 1327, 0, 2, 2, 2, 42, 942, 1942, 942, 5942, 84, 85, 'OUAAAA', 'BZBAAA', 'VVVVxx'),
+(2425, 1328, 1, 1, 5, 5, 25, 425, 425, 2425, 2425, 50, 51, 'HPAAAA', 'CZBAAA', 'AAAAxx'),
+(7760, 1329, 0, 0, 0, 0, 60, 760, 1760, 2760, 7760, 120, 121, 'MMAAAA', 'DZBAAA', 'HHHHxx'),
+(6294, 1330, 0, 2, 4, 14, 94, 294, 294, 1294, 6294, 188, 189, 'CIAAAA', 'EZBAAA', 'OOOOxx'),
+(6785, 1331, 1, 1, 5, 5, 85, 785, 785, 1785, 6785, 170, 171, 'ZAAAAA', 'FZBAAA', 'VVVVxx'),
+(3542, 1332, 0, 2, 2, 2, 42, 542, 1542, 3542, 3542, 84, 85, 'GGAAAA', 'GZBAAA', 'AAAAxx'),
+(1809, 1333, 1, 1, 9, 9, 9, 809, 1809, 1809, 1809, 18, 19, 'PRAAAA', 'HZBAAA', 'HHHHxx'),
+(130, 1334, 0, 2, 0, 10, 30, 130, 130, 130, 130, 60, 61, 'AFAAAA', 'IZBAAA', 'OOOOxx'),
+(8672, 1335, 0, 0, 2, 12, 72, 672, 672, 3672, 8672, 144, 145, 'OVAAAA', 'JZBAAA', 'VVVVxx'),
+(2125, 1336, 1, 1, 5, 5, 25, 125, 125, 2125, 2125, 50, 51, 'TDAAAA', 'KZBAAA', 'AAAAxx'),
+(7683, 1337, 1, 3, 3, 3, 83, 683, 1683, 2683, 7683, 166, 167, 'NJAAAA', 'LZBAAA', 'HHHHxx'),
+(7842, 1338, 0, 2, 2, 2, 42, 842, 1842, 2842, 7842, 84, 85, 'QPAAAA', 'MZBAAA', 'OOOOxx'),
+(9584, 1339, 0, 0, 4, 4, 84, 584, 1584, 4584, 9584, 168, 169, 'QEAAAA', 'NZBAAA', 'VVVVxx'),
+(7963, 1340, 1, 3, 3, 3, 63, 963, 1963, 2963, 7963, 126, 127, 'HUAAAA', 'OZBAAA', 'AAAAxx'),
+(8581, 1341, 1, 1, 1, 1, 81, 581, 581, 3581, 8581, 162, 163, 'BSAAAA', 'PZBAAA', 'HHHHxx'),
+(2135, 1342, 1, 3, 5, 15, 35, 135, 135, 2135, 2135, 70, 71, 'DEAAAA', 'QZBAAA', 'OOOOxx'),
+(7352, 1343, 0, 0, 2, 12, 52, 352, 1352, 2352, 7352, 104, 105, 'UWAAAA', 'RZBAAA', 'VVVVxx'),
+(5789, 1344, 1, 1, 9, 9, 89, 789, 1789, 789, 5789, 178, 179, 'ROAAAA', 'SZBAAA', 'AAAAxx'),
+(8490, 1345, 0, 2, 0, 10, 90, 490, 490, 3490, 8490, 180, 181, 'OOAAAA', 'TZBAAA', 'HHHHxx'),
+(2145, 1346, 1, 1, 5, 5, 45, 145, 145, 2145, 2145, 90, 91, 'NEAAAA', 'UZBAAA', 'OOOOxx'),
+(7021, 1347, 1, 1, 1, 1, 21, 21, 1021, 2021, 7021, 42, 43, 'BKAAAA', 'VZBAAA', 'VVVVxx'),
+(3736, 1348, 0, 0, 6, 16, 36, 736, 1736, 3736, 3736, 72, 73, 'SNAAAA', 'WZBAAA', 'AAAAxx'),
+(7396, 1349, 0, 0, 6, 16, 96, 396, 1396, 2396, 7396, 192, 193, 'MYAAAA', 'XZBAAA', 'HHHHxx'),
+(6334, 1350, 0, 2, 4, 14, 34, 334, 334, 1334, 6334, 68, 69, 'QJAAAA', 'YZBAAA', 'OOOOxx'),
+(5461, 1351, 1, 1, 1, 1, 61, 461, 1461, 461, 5461, 122, 123, 'BCAAAA', 'ZZBAAA', 'VVVVxx'),
+(5337, 1352, 1, 1, 7, 17, 37, 337, 1337, 337, 5337, 74, 75, 'HXAAAA', 'AACAAA', 'AAAAxx'),
+(7440, 1353, 0, 0, 0, 0, 40, 440, 1440, 2440, 7440, 80, 81, 'EAAAAA', 'BACAAA', 'HHHHxx'),
+(6879, 1354, 1, 3, 9, 19, 79, 879, 879, 1879, 6879, 158, 159, 'PEAAAA', 'CACAAA', 'OOOOxx'),
+(2432, 1355, 0, 0, 2, 12, 32, 432, 432, 2432, 2432, 64, 65, 'OPAAAA', 'DACAAA', 'VVVVxx'),
+(8529, 1356, 1, 1, 9, 9, 29, 529, 529, 3529, 8529, 58, 59, 'BQAAAA', 'EACAAA', 'AAAAxx'),
+(7859, 1357, 1, 3, 9, 19, 59, 859, 1859, 2859, 7859, 118, 119, 'HQAAAA', 'FACAAA', 'HHHHxx'),
+(15, 1358, 1, 3, 5, 15, 15, 15, 15, 15, 15, 30, 31, 'PAAAAA', 'GACAAA', 'OOOOxx'),
+(7475, 1359, 1, 3, 5, 15, 75, 475, 1475, 2475, 7475, 150, 151, 'NBAAAA', 'HACAAA', 'VVVVxx'),
+(717, 1360, 1, 1, 7, 17, 17, 717, 717, 717, 717, 34, 35, 'PBAAAA', 'IACAAA', 'AAAAxx'),
+(250, 1361, 0, 2, 0, 10, 50, 250, 250, 250, 250, 100, 101, 'QJAAAA', 'JACAAA', 'HHHHxx'),
+(4700, 1362, 0, 0, 0, 0, 0, 700, 700, 4700, 4700, 0, 1, 'UYAAAA', 'KACAAA', 'OOOOxx'),
+(7510, 1363, 0, 2, 0, 10, 10, 510, 1510, 2510, 7510, 20, 21, 'WCAAAA', 'LACAAA', 'VVVVxx'),
+(4562, 1364, 0, 2, 2, 2, 62, 562, 562, 4562, 4562, 124, 125, 'MTAAAA', 'MACAAA', 'AAAAxx'),
+(8075, 1365, 1, 3, 5, 15, 75, 75, 75, 3075, 8075, 150, 151, 'PYAAAA', 'NACAAA', 'HHHHxx'),
+(871, 1366, 1, 3, 1, 11, 71, 871, 871, 871, 871, 142, 143, 'NHAAAA', 'OACAAA', 'OOOOxx'),
+(7161, 1367, 1, 1, 1, 1, 61, 161, 1161, 2161, 7161, 122, 123, 'LPAAAA', 'PACAAA', 'VVVVxx'),
+(9109, 1368, 1, 1, 9, 9, 9, 109, 1109, 4109, 9109, 18, 19, 'JMAAAA', 'QACAAA', 'AAAAxx'),
+(8675, 1369, 1, 3, 5, 15, 75, 675, 675, 3675, 8675, 150, 151, 'RVAAAA', 'RACAAA', 'HHHHxx'),
+(1025, 1370, 1, 1, 5, 5, 25, 25, 1025, 1025, 1025, 50, 51, 'LNAAAA', 'SACAAA', 'OOOOxx'),
+(4065, 1371, 1, 1, 5, 5, 65, 65, 65, 4065, 4065, 130, 131, 'JAAAAA', 'TACAAA', 'VVVVxx'),
+(3511, 1372, 1, 3, 1, 11, 11, 511, 1511, 3511, 3511, 22, 23, 'BFAAAA', 'UACAAA', 'AAAAxx'),
+(9840, 1373, 0, 0, 0, 0, 40, 840, 1840, 4840, 9840, 80, 81, 'MOAAAA', 'VACAAA', 'HHHHxx'),
+(7495, 1374, 1, 3, 5, 15, 95, 495, 1495, 2495, 7495, 190, 191, 'HCAAAA', 'WACAAA', 'OOOOxx'),
+(55, 1375, 1, 3, 5, 15, 55, 55, 55, 55, 55, 110, 111, 'DCAAAA', 'XACAAA', 'VVVVxx'),
+(6151, 1376, 1, 3, 1, 11, 51, 151, 151, 1151, 6151, 102, 103, 'PCAAAA', 'YACAAA', 'AAAAxx'),
+(2512, 1377, 0, 0, 2, 12, 12, 512, 512, 2512, 2512, 24, 25, 'QSAAAA', 'ZACAAA', 'HHHHxx'),
+(5881, 1378, 1, 1, 1, 1, 81, 881, 1881, 881, 5881, 162, 163, 'FSAAAA', 'ABCAAA', 'OOOOxx'),
+(1442, 1379, 0, 2, 2, 2, 42, 442, 1442, 1442, 1442, 84, 85, 'MDAAAA', 'BBCAAA', 'VVVVxx'),
+(1270, 1380, 0, 2, 0, 10, 70, 270, 1270, 1270, 1270, 140, 141, 'WWAAAA', 'CBCAAA', 'AAAAxx'),
+(959, 1381, 1, 3, 9, 19, 59, 959, 959, 959, 959, 118, 119, 'XKAAAA', 'DBCAAA', 'HHHHxx'),
+(8251, 1382, 1, 3, 1, 11, 51, 251, 251, 3251, 8251, 102, 103, 'JFAAAA', 'EBCAAA', 'OOOOxx'),
+(3051, 1383, 1, 3, 1, 11, 51, 51, 1051, 3051, 3051, 102, 103, 'JNAAAA', 'FBCAAA', 'VVVVxx'),
+(5052, 1384, 0, 0, 2, 12, 52, 52, 1052, 52, 5052, 104, 105, 'IMAAAA', 'GBCAAA', 'AAAAxx'),
+(1863, 1385, 1, 3, 3, 3, 63, 863, 1863, 1863, 1863, 126, 127, 'RTAAAA', 'HBCAAA', 'HHHHxx'),
+(344, 1386, 0, 0, 4, 4, 44, 344, 344, 344, 344, 88, 89, 'GNAAAA', 'IBCAAA', 'OOOOxx'),
+(3590, 1387, 0, 2, 0, 10, 90, 590, 1590, 3590, 3590, 180, 181, 'CIAAAA', 'JBCAAA', 'VVVVxx'),
+(4223, 1388, 1, 3, 3, 3, 23, 223, 223, 4223, 4223, 46, 47, 'LGAAAA', 'KBCAAA', 'AAAAxx'),
+(2284, 1389, 0, 0, 4, 4, 84, 284, 284, 2284, 2284, 168, 169, 'WJAAAA', 'LBCAAA', 'HHHHxx'),
+(9425, 1390, 1, 1, 5, 5, 25, 425, 1425, 4425, 9425, 50, 51, 'NYAAAA', 'MBCAAA', 'OOOOxx'),
+(6221, 1391, 1, 1, 1, 1, 21, 221, 221, 1221, 6221, 42, 43, 'HFAAAA', 'NBCAAA', 'VVVVxx'),
+(195, 1392, 1, 3, 5, 15, 95, 195, 195, 195, 195, 190, 191, 'NHAAAA', 'OBCAAA', 'AAAAxx'),
+(1517, 1393, 1, 1, 7, 17, 17, 517, 1517, 1517, 1517, 34, 35, 'JGAAAA', 'PBCAAA', 'HHHHxx'),
+(3791, 1394, 1, 3, 1, 11, 91, 791, 1791, 3791, 3791, 182, 183, 'VPAAAA', 'QBCAAA', 'OOOOxx'),
+(572, 1395, 0, 0, 2, 12, 72, 572, 572, 572, 572, 144, 145, 'AWAAAA', 'RBCAAA', 'VVVVxx'),
+(46, 1396, 0, 2, 6, 6, 46, 46, 46, 46, 46, 92, 93, 'UBAAAA', 'SBCAAA', 'AAAAxx'),
+(9451, 1397, 1, 3, 1, 11, 51, 451, 1451, 4451, 9451, 102, 103, 'NZAAAA', 'TBCAAA', 'HHHHxx'),
+(3359, 1398, 1, 3, 9, 19, 59, 359, 1359, 3359, 3359, 118, 119, 'FZAAAA', 'UBCAAA', 'OOOOxx'),
+(8867, 1399, 1, 3, 7, 7, 67, 867, 867, 3867, 8867, 134, 135, 'BDAAAA', 'VBCAAA', 'VVVVxx'),
+(674, 1400, 0, 2, 4, 14, 74, 674, 674, 674, 674, 148, 149, 'YZAAAA', 'WBCAAA', 'AAAAxx'),
+(2674, 1401, 0, 2, 4, 14, 74, 674, 674, 2674, 2674, 148, 149, 'WYAAAA', 'XBCAAA', 'HHHHxx'),
+(6523, 1402, 1, 3, 3, 3, 23, 523, 523, 1523, 6523, 46, 47, 'XQAAAA', 'YBCAAA', 'OOOOxx'),
+(6210, 1403, 0, 2, 0, 10, 10, 210, 210, 1210, 6210, 20, 21, 'WEAAAA', 'ZBCAAA', 'VVVVxx'),
+(7564, 1404, 0, 0, 4, 4, 64, 564, 1564, 2564, 7564, 128, 129, 'YEAAAA', 'ACCAAA', 'AAAAxx'),
+(4776, 1405, 0, 0, 6, 16, 76, 776, 776, 4776, 4776, 152, 153, 'SBAAAA', 'BCCAAA', 'HHHHxx'),
+(2993, 1406, 1, 1, 3, 13, 93, 993, 993, 2993, 2993, 186, 187, 'DLAAAA', 'CCCAAA', 'OOOOxx'),
+(2969, 1407, 1, 1, 9, 9, 69, 969, 969, 2969, 2969, 138, 139, 'FKAAAA', 'DCCAAA', 'VVVVxx'),
+(1762, 1408, 0, 2, 2, 2, 62, 762, 1762, 1762, 1762, 124, 125, 'UPAAAA', 'ECCAAA', 'AAAAxx'),
+(685, 1409, 1, 1, 5, 5, 85, 685, 685, 685, 685, 170, 171, 'JAAAAA', 'FCCAAA', 'HHHHxx'),
+(5312, 1410, 0, 0, 2, 12, 12, 312, 1312, 312, 5312, 24, 25, 'IWAAAA', 'GCCAAA', 'OOOOxx'),
+(3264, 1411, 0, 0, 4, 4, 64, 264, 1264, 3264, 3264, 128, 129, 'OVAAAA', 'HCCAAA', 'VVVVxx'),
+(7008, 1412, 0, 0, 8, 8, 8, 8, 1008, 2008, 7008, 16, 17, 'OJAAAA', 'ICCAAA', 'AAAAxx'),
+(5167, 1413, 1, 3, 7, 7, 67, 167, 1167, 167, 5167, 134, 135, 'TQAAAA', 'JCCAAA', 'HHHHxx'),
+(3060, 1414, 0, 0, 0, 0, 60, 60, 1060, 3060, 3060, 120, 121, 'SNAAAA', 'KCCAAA', 'OOOOxx'),
+(1752, 1415, 0, 0, 2, 12, 52, 752, 1752, 1752, 1752, 104, 105, 'KPAAAA', 'LCCAAA', 'VVVVxx'),
+(1016, 1416, 0, 0, 6, 16, 16, 16, 1016, 1016, 1016, 32, 33, 'CNAAAA', 'MCCAAA', 'AAAAxx'),
+(7365, 1417, 1, 1, 5, 5, 65, 365, 1365, 2365, 7365, 130, 131, 'HXAAAA', 'NCCAAA', 'HHHHxx'),
+(4358, 1418, 0, 2, 8, 18, 58, 358, 358, 4358, 4358, 116, 117, 'QLAAAA', 'OCCAAA', 'OOOOxx'),
+(2819, 1419, 1, 3, 9, 19, 19, 819, 819, 2819, 2819, 38, 39, 'LEAAAA', 'PCCAAA', 'VVVVxx'),
+(6727, 1420, 1, 3, 7, 7, 27, 727, 727, 1727, 6727, 54, 55, 'TYAAAA', 'QCCAAA', 'AAAAxx'),
+(1459, 1421, 1, 3, 9, 19, 59, 459, 1459, 1459, 1459, 118, 119, 'DEAAAA', 'RCCAAA', 'HHHHxx'),
+(1708, 1422, 0, 0, 8, 8, 8, 708, 1708, 1708, 1708, 16, 17, 'SNAAAA', 'SCCAAA', 'OOOOxx'),
+(471, 1423, 1, 3, 1, 11, 71, 471, 471, 471, 471, 142, 143, 'DSAAAA', 'TCCAAA', 'VVVVxx'),
+(387, 1424, 1, 3, 7, 7, 87, 387, 387, 387, 387, 174, 175, 'XOAAAA', 'UCCAAA', 'AAAAxx'),
+(1166, 1425, 0, 2, 6, 6, 66, 166, 1166, 1166, 1166, 132, 133, 'WSAAAA', 'VCCAAA', 'HHHHxx'),
+(2400, 1426, 0, 0, 0, 0, 0, 400, 400, 2400, 2400, 0, 1, 'IOAAAA', 'WCCAAA', 'OOOOxx'),
+(3584, 1427, 0, 0, 4, 4, 84, 584, 1584, 3584, 3584, 168, 169, 'WHAAAA', 'XCCAAA', 'VVVVxx'),
+(6423, 1428, 1, 3, 3, 3, 23, 423, 423, 1423, 6423, 46, 47, 'BNAAAA', 'YCCAAA', 'AAAAxx'),
+(9520, 1429, 0, 0, 0, 0, 20, 520, 1520, 4520, 9520, 40, 41, 'ECAAAA', 'ZCCAAA', 'HHHHxx'),
+(8080, 1430, 0, 0, 0, 0, 80, 80, 80, 3080, 8080, 160, 161, 'UYAAAA', 'ADCAAA', 'OOOOxx'),
+(5709, 1431, 1, 1, 9, 9, 9, 709, 1709, 709, 5709, 18, 19, 'PLAAAA', 'BDCAAA', 'VVVVxx'),
+(1131, 1432, 1, 3, 1, 11, 31, 131, 1131, 1131, 1131, 62, 63, 'NRAAAA', 'CDCAAA', 'AAAAxx'),
+(8562, 1433, 0, 2, 2, 2, 62, 562, 562, 3562, 8562, 124, 125, 'IRAAAA', 'DDCAAA', 'HHHHxx'),
+(5766, 1434, 0, 2, 6, 6, 66, 766, 1766, 766, 5766, 132, 133, 'UNAAAA', 'EDCAAA', 'OOOOxx'),
+(245, 1435, 1, 1, 5, 5, 45, 245, 245, 245, 245, 90, 91, 'LJAAAA', 'FDCAAA', 'VVVVxx'),
+(9869, 1436, 1, 1, 9, 9, 69, 869, 1869, 4869, 9869, 138, 139, 'PPAAAA', 'GDCAAA', 'AAAAxx'),
+(3533, 1437, 1, 1, 3, 13, 33, 533, 1533, 3533, 3533, 66, 67, 'XFAAAA', 'HDCAAA', 'HHHHxx'),
+(5109, 1438, 1, 1, 9, 9, 9, 109, 1109, 109, 5109, 18, 19, 'NOAAAA', 'IDCAAA', 'OOOOxx'),
+(977, 1439, 1, 1, 7, 17, 77, 977, 977, 977, 977, 154, 155, 'PLAAAA', 'JDCAAA', 'VVVVxx'),
+(1651, 1440, 1, 3, 1, 11, 51, 651, 1651, 1651, 1651, 102, 103, 'NLAAAA', 'KDCAAA', 'AAAAxx'),
+(1357, 1441, 1, 1, 7, 17, 57, 357, 1357, 1357, 1357, 114, 115, 'FAAAAA', 'LDCAAA', 'HHHHxx'),
+(9087, 1442, 1, 3, 7, 7, 87, 87, 1087, 4087, 9087, 174, 175, 'NLAAAA', 'MDCAAA', 'OOOOxx'),
+(3399, 1443, 1, 3, 9, 19, 99, 399, 1399, 3399, 3399, 198, 199, 'TAAAAA', 'NDCAAA', 'VVVVxx'),
+(7543, 1444, 1, 3, 3, 3, 43, 543, 1543, 2543, 7543, 86, 87, 'DEAAAA', 'ODCAAA', 'AAAAxx'),
+(2469, 1445, 1, 1, 9, 9, 69, 469, 469, 2469, 2469, 138, 139, 'ZQAAAA', 'PDCAAA', 'HHHHxx'),
+(8305, 1446, 1, 1, 5, 5, 5, 305, 305, 3305, 8305, 10, 11, 'LHAAAA', 'QDCAAA', 'OOOOxx'),
+(3265, 1447, 1, 1, 5, 5, 65, 265, 1265, 3265, 3265, 130, 131, 'PVAAAA', 'RDCAAA', 'VVVVxx'),
+(9977, 1448, 1, 1, 7, 17, 77, 977, 1977, 4977, 9977, 154, 155, 'TTAAAA', 'SDCAAA', 'AAAAxx'),
+(3961, 1449, 1, 1, 1, 1, 61, 961, 1961, 3961, 3961, 122, 123, 'JWAAAA', 'TDCAAA', 'HHHHxx'),
+(4952, 1450, 0, 0, 2, 12, 52, 952, 952, 4952, 4952, 104, 105, 'MIAAAA', 'UDCAAA', 'OOOOxx'),
+(5173, 1451, 1, 1, 3, 13, 73, 173, 1173, 173, 5173, 146, 147, 'ZQAAAA', 'VDCAAA', 'VVVVxx'),
+(860, 1452, 0, 0, 0, 0, 60, 860, 860, 860, 860, 120, 121, 'CHAAAA', 'WDCAAA', 'AAAAxx'),
+(4523, 1453, 1, 3, 3, 3, 23, 523, 523, 4523, 4523, 46, 47, 'ZRAAAA', 'XDCAAA', 'HHHHxx'),
+(2361, 1454, 1, 1, 1, 1, 61, 361, 361, 2361, 2361, 122, 123, 'VMAAAA', 'YDCAAA', 'OOOOxx'),
+(7877, 1455, 1, 1, 7, 17, 77, 877, 1877, 2877, 7877, 154, 155, 'ZQAAAA', 'ZDCAAA', 'VVVVxx'),
+(3422, 1456, 0, 2, 2, 2, 22, 422, 1422, 3422, 3422, 44, 45, 'QBAAAA', 'AECAAA', 'AAAAxx'),
+(5781, 1457, 1, 1, 1, 1, 81, 781, 1781, 781, 5781, 162, 163, 'JOAAAA', 'BECAAA', 'HHHHxx'),
+(4752, 1458, 0, 0, 2, 12, 52, 752, 752, 4752, 4752, 104, 105, 'UAAAAA', 'CECAAA', 'OOOOxx'),
+(1786, 1459, 0, 2, 6, 6, 86, 786, 1786, 1786, 1786, 172, 173, 'SQAAAA', 'DECAAA', 'VVVVxx'),
+(1892, 1460, 0, 0, 2, 12, 92, 892, 1892, 1892, 1892, 184, 185, 'UUAAAA', 'EECAAA', 'AAAAxx'),
+(6389, 1461, 1, 1, 9, 9, 89, 389, 389, 1389, 6389, 178, 179, 'TLAAAA', 'FECAAA', 'HHHHxx'),
+(8644, 1462, 0, 0, 4, 4, 44, 644, 644, 3644, 8644, 88, 89, 'MUAAAA', 'GECAAA', 'OOOOxx'),
+(9056, 1463, 0, 0, 6, 16, 56, 56, 1056, 4056, 9056, 112, 113, 'IKAAAA', 'HECAAA', 'VVVVxx'),
+(1423, 1464, 1, 3, 3, 3, 23, 423, 1423, 1423, 1423, 46, 47, 'TCAAAA', 'IECAAA', 'AAAAxx'),
+(4901, 1465, 1, 1, 1, 1, 1, 901, 901, 4901, 4901, 2, 3, 'NGAAAA', 'JECAAA', 'HHHHxx'),
+(3859, 1466, 1, 3, 9, 19, 59, 859, 1859, 3859, 3859, 118, 119, 'LSAAAA', 'KECAAA', 'OOOOxx'),
+(2324, 1467, 0, 0, 4, 4, 24, 324, 324, 2324, 2324, 48, 49, 'KLAAAA', 'LECAAA', 'VVVVxx'),
+(8101, 1468, 1, 1, 1, 1, 1, 101, 101, 3101, 8101, 2, 3, 'PZAAAA', 'MECAAA', 'AAAAxx'),
+(8016, 1469, 0, 0, 6, 16, 16, 16, 16, 3016, 8016, 32, 33, 'IWAAAA', 'NECAAA', 'HHHHxx'),
+(5826, 1470, 0, 2, 6, 6, 26, 826, 1826, 826, 5826, 52, 53, 'CQAAAA', 'OECAAA', 'OOOOxx'),
+(8266, 1471, 0, 2, 6, 6, 66, 266, 266, 3266, 8266, 132, 133, 'YFAAAA', 'PECAAA', 'VVVVxx'),
+(7558, 1472, 0, 2, 8, 18, 58, 558, 1558, 2558, 7558, 116, 117, 'SEAAAA', 'QECAAA', 'AAAAxx'),
+(6976, 1473, 0, 0, 6, 16, 76, 976, 976, 1976, 6976, 152, 153, 'IIAAAA', 'RECAAA', 'HHHHxx'),
+(222, 1474, 0, 2, 2, 2, 22, 222, 222, 222, 222, 44, 45, 'OIAAAA', 'SECAAA', 'OOOOxx'),
+(1624, 1475, 0, 0, 4, 4, 24, 624, 1624, 1624, 1624, 48, 49, 'MKAAAA', 'TECAAA', 'VVVVxx'),
+(1250, 1476, 0, 2, 0, 10, 50, 250, 1250, 1250, 1250, 100, 101, 'CWAAAA', 'UECAAA', 'AAAAxx'),
+(1621, 1477, 1, 1, 1, 1, 21, 621, 1621, 1621, 1621, 42, 43, 'JKAAAA', 'VECAAA', 'HHHHxx'),
+(2350, 1478, 0, 2, 0, 10, 50, 350, 350, 2350, 2350, 100, 101, 'KMAAAA', 'WECAAA', 'OOOOxx'),
+(5239, 1479, 1, 3, 9, 19, 39, 239, 1239, 239, 5239, 78, 79, 'NTAAAA', 'XECAAA', 'VVVVxx'),
+(6681, 1480, 1, 1, 1, 1, 81, 681, 681, 1681, 6681, 162, 163, 'ZWAAAA', 'YECAAA', 'AAAAxx'),
+(4983, 1481, 1, 3, 3, 3, 83, 983, 983, 4983, 4983, 166, 167, 'RJAAAA', 'ZECAAA', 'HHHHxx'),
+(7149, 1482, 1, 1, 9, 9, 49, 149, 1149, 2149, 7149, 98, 99, 'ZOAAAA', 'AFCAAA', 'OOOOxx'),
+(3502, 1483, 0, 2, 2, 2, 2, 502, 1502, 3502, 3502, 4, 5, 'SEAAAA', 'BFCAAA', 'VVVVxx'),
+(3133, 1484, 1, 1, 3, 13, 33, 133, 1133, 3133, 3133, 66, 67, 'NQAAAA', 'CFCAAA', 'AAAAxx'),
+(8342, 1485, 0, 2, 2, 2, 42, 342, 342, 3342, 8342, 84, 85, 'WIAAAA', 'DFCAAA', 'HHHHxx'),
+(3041, 1486, 1, 1, 1, 1, 41, 41, 1041, 3041, 3041, 82, 83, 'ZMAAAA', 'EFCAAA', 'OOOOxx'),
+(5383, 1487, 1, 3, 3, 3, 83, 383, 1383, 383, 5383, 166, 167, 'BZAAAA', 'FFCAAA', 'VVVVxx'),
+(3916, 1488, 0, 0, 6, 16, 16, 916, 1916, 3916, 3916, 32, 33, 'QUAAAA', 'GFCAAA', 'AAAAxx'),
+(1438, 1489, 0, 2, 8, 18, 38, 438, 1438, 1438, 1438, 76, 77, 'IDAAAA', 'HFCAAA', 'HHHHxx'),
+(9408, 1490, 0, 0, 8, 8, 8, 408, 1408, 4408, 9408, 16, 17, 'WXAAAA', 'IFCAAA', 'OOOOxx'),
+(5783, 1491, 1, 3, 3, 3, 83, 783, 1783, 783, 5783, 166, 167, 'LOAAAA', 'JFCAAA', 'VVVVxx'),
+(683, 1492, 1, 3, 3, 3, 83, 683, 683, 683, 683, 166, 167, 'HAAAAA', 'KFCAAA', 'AAAAxx'),
+(9381, 1493, 1, 1, 1, 1, 81, 381, 1381, 4381, 9381, 162, 163, 'VWAAAA', 'LFCAAA', 'HHHHxx'),
+(5676, 1494, 0, 0, 6, 16, 76, 676, 1676, 676, 5676, 152, 153, 'IKAAAA', 'MFCAAA', 'OOOOxx'),
+(3224, 1495, 0, 0, 4, 4, 24, 224, 1224, 3224, 3224, 48, 49, 'AUAAAA', 'NFCAAA', 'VVVVxx'),
+(8332, 1496, 0, 0, 2, 12, 32, 332, 332, 3332, 8332, 64, 65, 'MIAAAA', 'OFCAAA', 'AAAAxx'),
+(3372, 1497, 0, 0, 2, 12, 72, 372, 1372, 3372, 3372, 144, 145, 'SZAAAA', 'PFCAAA', 'HHHHxx'),
+(7436, 1498, 0, 0, 6, 16, 36, 436, 1436, 2436, 7436, 72, 73, 'AAAAAA', 'QFCAAA', 'OOOOxx'),
+(5010, 1499, 0, 2, 0, 10, 10, 10, 1010, 10, 5010, 20, 21, 'SKAAAA', 'RFCAAA', 'VVVVxx'),
+(7256, 1500, 0, 0, 6, 16, 56, 256, 1256, 2256, 7256, 112, 113, 'CTAAAA', 'SFCAAA', 'AAAAxx'),
+(961, 1501, 1, 1, 1, 1, 61, 961, 961, 961, 961, 122, 123, 'ZKAAAA', 'TFCAAA', 'HHHHxx'),
+(4182, 1502, 0, 2, 2, 2, 82, 182, 182, 4182, 4182, 164, 165, 'WEAAAA', 'UFCAAA', 'OOOOxx'),
+(639, 1503, 1, 3, 9, 19, 39, 639, 639, 639, 639, 78, 79, 'PYAAAA', 'VFCAAA', 'VVVVxx'),
+(8836, 1504, 0, 0, 6, 16, 36, 836, 836, 3836, 8836, 72, 73, 'WBAAAA', 'WFCAAA', 'AAAAxx'),
+(8705, 1505, 1, 1, 5, 5, 5, 705, 705, 3705, 8705, 10, 11, 'VWAAAA', 'XFCAAA', 'HHHHxx'),
+(32, 1506, 0, 0, 2, 12, 32, 32, 32, 32, 32, 64, 65, 'GBAAAA', 'YFCAAA', 'OOOOxx'),
+(7913, 1507, 1, 1, 3, 13, 13, 913, 1913, 2913, 7913, 26, 27, 'JSAAAA', 'ZFCAAA', 'VVVVxx'),
+(229, 1508, 1, 1, 9, 9, 29, 229, 229, 229, 229, 58, 59, 'VIAAAA', 'AGCAAA', 'AAAAxx'),
+(2393, 1509, 1, 1, 3, 13, 93, 393, 393, 2393, 2393, 186, 187, 'BOAAAA', 'BGCAAA', 'HHHHxx'),
+(2815, 1510, 1, 3, 5, 15, 15, 815, 815, 2815, 2815, 30, 31, 'HEAAAA', 'CGCAAA', 'OOOOxx'),
+(4858, 1511, 0, 2, 8, 18, 58, 858, 858, 4858, 4858, 116, 117, 'WEAAAA', 'DGCAAA', 'VVVVxx'),
+(6283, 1512, 1, 3, 3, 3, 83, 283, 283, 1283, 6283, 166, 167, 'RHAAAA', 'EGCAAA', 'AAAAxx'),
+(4147, 1513, 1, 3, 7, 7, 47, 147, 147, 4147, 4147, 94, 95, 'NDAAAA', 'FGCAAA', 'HHHHxx'),
+(6801, 1514, 1, 1, 1, 1, 1, 801, 801, 1801, 6801, 2, 3, 'PBAAAA', 'GGCAAA', 'OOOOxx'),
+(1011, 1515, 1, 3, 1, 11, 11, 11, 1011, 1011, 1011, 22, 23, 'XMAAAA', 'HGCAAA', 'VVVVxx'),
+(2527, 1516, 1, 3, 7, 7, 27, 527, 527, 2527, 2527, 54, 55, 'FTAAAA', 'IGCAAA', 'AAAAxx'),
+(381, 1517, 1, 1, 1, 1, 81, 381, 381, 381, 381, 162, 163, 'ROAAAA', 'JGCAAA', 'HHHHxx'),
+(3366, 1518, 0, 2, 6, 6, 66, 366, 1366, 3366, 3366, 132, 133, 'MZAAAA', 'KGCAAA', 'OOOOxx'),
+(9636, 1519, 0, 0, 6, 16, 36, 636, 1636, 4636, 9636, 72, 73, 'QGAAAA', 'LGCAAA', 'VVVVxx'),
+(2239, 1520, 1, 3, 9, 19, 39, 239, 239, 2239, 2239, 78, 79, 'DIAAAA', 'MGCAAA', 'AAAAxx'),
+(5911, 1521, 1, 3, 1, 11, 11, 911, 1911, 911, 5911, 22, 23, 'JTAAAA', 'NGCAAA', 'HHHHxx'),
+(449, 1522, 1, 1, 9, 9, 49, 449, 449, 449, 449, 98, 99, 'HRAAAA', 'OGCAAA', 'OOOOxx'),
+(5118, 1523, 0, 2, 8, 18, 18, 118, 1118, 118, 5118, 36, 37, 'WOAAAA', 'PGCAAA', 'VVVVxx'),
+(7684, 1524, 0, 0, 4, 4, 84, 684, 1684, 2684, 7684, 168, 169, 'OJAAAA', 'QGCAAA', 'AAAAxx'),
+(804, 1525, 0, 0, 4, 4, 4, 804, 804, 804, 804, 8, 9, 'YEAAAA', 'RGCAAA', 'HHHHxx'),
+(8378, 1526, 0, 2, 8, 18, 78, 378, 378, 3378, 8378, 156, 157, 'GKAAAA', 'SGCAAA', 'OOOOxx'),
+(9855, 1527, 1, 3, 5, 15, 55, 855, 1855, 4855, 9855, 110, 111, 'BPAAAA', 'TGCAAA', 'VVVVxx'),
+(1995, 1528, 1, 3, 5, 15, 95, 995, 1995, 1995, 1995, 190, 191, 'TYAAAA', 'UGCAAA', 'AAAAxx'),
+(1979, 1529, 1, 3, 9, 19, 79, 979, 1979, 1979, 1979, 158, 159, 'DYAAAA', 'VGCAAA', 'HHHHxx'),
+(4510, 1530, 0, 2, 0, 10, 10, 510, 510, 4510, 4510, 20, 21, 'MRAAAA', 'WGCAAA', 'OOOOxx'),
+(3792, 1531, 0, 0, 2, 12, 92, 792, 1792, 3792, 3792, 184, 185, 'WPAAAA', 'XGCAAA', 'VVVVxx'),
+(3541, 1532, 1, 1, 1, 1, 41, 541, 1541, 3541, 3541, 82, 83, 'FGAAAA', 'YGCAAA', 'AAAAxx'),
+(8847, 1533, 1, 3, 7, 7, 47, 847, 847, 3847, 8847, 94, 95, 'HCAAAA', 'ZGCAAA', 'HHHHxx'),
+(1336, 1534, 0, 0, 6, 16, 36, 336, 1336, 1336, 1336, 72, 73, 'KZAAAA', 'AHCAAA', 'OOOOxx'),
+(6780, 1535, 0, 0, 0, 0, 80, 780, 780, 1780, 6780, 160, 161, 'UAAAAA', 'BHCAAA', 'VVVVxx'),
+(8711, 1536, 1, 3, 1, 11, 11, 711, 711, 3711, 8711, 22, 23, 'BXAAAA', 'CHCAAA', 'AAAAxx'),
+(7839, 1537, 1, 3, 9, 19, 39, 839, 1839, 2839, 7839, 78, 79, 'NPAAAA', 'DHCAAA', 'HHHHxx'),
+(677, 1538, 1, 1, 7, 17, 77, 677, 677, 677, 677, 154, 155, 'BAAAAA', 'EHCAAA', 'OOOOxx'),
+(1574, 1539, 0, 2, 4, 14, 74, 574, 1574, 1574, 1574, 148, 149, 'OIAAAA', 'FHCAAA', 'VVVVxx'),
+(2905, 1540, 1, 1, 5, 5, 5, 905, 905, 2905, 2905, 10, 11, 'THAAAA', 'GHCAAA', 'AAAAxx'),
+(1879, 1541, 1, 3, 9, 19, 79, 879, 1879, 1879, 1879, 158, 159, 'HUAAAA', 'HHCAAA', 'HHHHxx'),
+(7820, 1542, 0, 0, 0, 0, 20, 820, 1820, 2820, 7820, 40, 41, 'UOAAAA', 'IHCAAA', 'OOOOxx'),
+(4308, 1543, 0, 0, 8, 8, 8, 308, 308, 4308, 4308, 16, 17, 'SJAAAA', 'JHCAAA', 'VVVVxx'),
+(4474, 1544, 0, 2, 4, 14, 74, 474, 474, 4474, 4474, 148, 149, 'CQAAAA', 'KHCAAA', 'AAAAxx'),
+(6985, 1545, 1, 1, 5, 5, 85, 985, 985, 1985, 6985, 170, 171, 'RIAAAA', 'LHCAAA', 'HHHHxx'),
+(6929, 1546, 1, 1, 9, 9, 29, 929, 929, 1929, 6929, 58, 59, 'NGAAAA', 'MHCAAA', 'OOOOxx'),
+(777, 1547, 1, 1, 7, 17, 77, 777, 777, 777, 777, 154, 155, 'XDAAAA', 'NHCAAA', 'VVVVxx'),
+(8271, 1548, 1, 3, 1, 11, 71, 271, 271, 3271, 8271, 142, 143, 'DGAAAA', 'OHCAAA', 'AAAAxx'),
+(2389, 1549, 1, 1, 9, 9, 89, 389, 389, 2389, 2389, 178, 179, 'XNAAAA', 'PHCAAA', 'HHHHxx'),
+(946, 1550, 0, 2, 6, 6, 46, 946, 946, 946, 946, 92, 93, 'KKAAAA', 'QHCAAA', 'OOOOxx'),
+(9682, 1551, 0, 2, 2, 2, 82, 682, 1682, 4682, 9682, 164, 165, 'KIAAAA', 'RHCAAA', 'VVVVxx'),
+(8722, 1552, 0, 2, 2, 2, 22, 722, 722, 3722, 8722, 44, 45, 'MXAAAA', 'SHCAAA', 'AAAAxx'),
+(470, 1553, 0, 2, 0, 10, 70, 470, 470, 470, 470, 140, 141, 'CSAAAA', 'THCAAA', 'HHHHxx'),
+(7425, 1554, 1, 1, 5, 5, 25, 425, 1425, 2425, 7425, 50, 51, 'PZAAAA', 'UHCAAA', 'OOOOxx'),
+(2372, 1555, 0, 0, 2, 12, 72, 372, 372, 2372, 2372, 144, 145, 'GNAAAA', 'VHCAAA', 'VVVVxx'),
+(508, 1556, 0, 0, 8, 8, 8, 508, 508, 508, 508, 16, 17, 'OTAAAA', 'WHCAAA', 'AAAAxx'),
+(163, 1557, 1, 3, 3, 3, 63, 163, 163, 163, 163, 126, 127, 'HGAAAA', 'XHCAAA', 'HHHHxx'),
+(6579, 1558, 1, 3, 9, 19, 79, 579, 579, 1579, 6579, 158, 159, 'BTAAAA', 'YHCAAA', 'OOOOxx'),
+(2355, 1559, 1, 3, 5, 15, 55, 355, 355, 2355, 2355, 110, 111, 'PMAAAA', 'ZHCAAA', 'VVVVxx'),
+(70, 1560, 0, 2, 0, 10, 70, 70, 70, 70, 70, 140, 141, 'SCAAAA', 'AICAAA', 'AAAAxx'),
+(651, 1561, 1, 3, 1, 11, 51, 651, 651, 651, 651, 102, 103, 'BZAAAA', 'BICAAA', 'HHHHxx'),
+(4436, 1562, 0, 0, 6, 16, 36, 436, 436, 4436, 4436, 72, 73, 'QOAAAA', 'CICAAA', 'OOOOxx'),
+(4240, 1563, 0, 0, 0, 0, 40, 240, 240, 4240, 4240, 80, 81, 'CHAAAA', 'DICAAA', 'VVVVxx'),
+(2722, 1564, 0, 2, 2, 2, 22, 722, 722, 2722, 2722, 44, 45, 'SAAAAA', 'EICAAA', 'AAAAxx'),
+(8937, 1565, 1, 1, 7, 17, 37, 937, 937, 3937, 8937, 74, 75, 'TFAAAA', 'FICAAA', 'HHHHxx'),
+(8364, 1566, 0, 0, 4, 4, 64, 364, 364, 3364, 8364, 128, 129, 'SJAAAA', 'GICAAA', 'OOOOxx'),
+(8317, 1567, 1, 1, 7, 17, 17, 317, 317, 3317, 8317, 34, 35, 'XHAAAA', 'HICAAA', 'VVVVxx'),
+(8872, 1568, 0, 0, 2, 12, 72, 872, 872, 3872, 8872, 144, 145, 'GDAAAA', 'IICAAA', 'AAAAxx'),
+(5512, 1569, 0, 0, 2, 12, 12, 512, 1512, 512, 5512, 24, 25, 'AEAAAA', 'JICAAA', 'HHHHxx'),
+(6651, 1570, 1, 3, 1, 11, 51, 651, 651, 1651, 6651, 102, 103, 'VVAAAA', 'KICAAA', 'OOOOxx'),
+(5976, 1571, 0, 0, 6, 16, 76, 976, 1976, 976, 5976, 152, 153, 'WVAAAA', 'LICAAA', 'VVVVxx'),
+(3301, 1572, 1, 1, 1, 1, 1, 301, 1301, 3301, 3301, 2, 3, 'ZWAAAA', 'MICAAA', 'AAAAxx'),
+(6784, 1573, 0, 0, 4, 4, 84, 784, 784, 1784, 6784, 168, 169, 'YAAAAA', 'NICAAA', 'HHHHxx'),
+(573, 1574, 1, 1, 3, 13, 73, 573, 573, 573, 573, 146, 147, 'BWAAAA', 'OICAAA', 'OOOOxx'),
+(3015, 1575, 1, 3, 5, 15, 15, 15, 1015, 3015, 3015, 30, 31, 'ZLAAAA', 'PICAAA', 'VVVVxx'),
+(8245, 1576, 1, 1, 5, 5, 45, 245, 245, 3245, 8245, 90, 91, 'DFAAAA', 'QICAAA', 'AAAAxx'),
+(5251, 1577, 1, 3, 1, 11, 51, 251, 1251, 251, 5251, 102, 103, 'ZTAAAA', 'RICAAA', 'HHHHxx'),
+(2281, 1578, 1, 1, 1, 1, 81, 281, 281, 2281, 2281, 162, 163, 'TJAAAA', 'SICAAA', 'OOOOxx'),
+(518, 1579, 0, 2, 8, 18, 18, 518, 518, 518, 518, 36, 37, 'YTAAAA', 'TICAAA', 'VVVVxx'),
+(9839, 1580, 1, 3, 9, 19, 39, 839, 1839, 4839, 9839, 78, 79, 'LOAAAA', 'UICAAA', 'AAAAxx'),
+(4526, 1581, 0, 2, 6, 6, 26, 526, 526, 4526, 4526, 52, 53, 'CSAAAA', 'VICAAA', 'HHHHxx'),
+(1261, 1582, 1, 1, 1, 1, 61, 261, 1261, 1261, 1261, 122, 123, 'NWAAAA', 'WICAAA', 'OOOOxx'),
+(4259, 1583, 1, 3, 9, 19, 59, 259, 259, 4259, 4259, 118, 119, 'VHAAAA', 'XICAAA', 'VVVVxx'),
+(9098, 1584, 0, 2, 8, 18, 98, 98, 1098, 4098, 9098, 196, 197, 'YLAAAA', 'YICAAA', 'AAAAxx'),
+(6037, 1585, 1, 1, 7, 17, 37, 37, 37, 1037, 6037, 74, 75, 'FYAAAA', 'ZICAAA', 'HHHHxx'),
+(4284, 1586, 0, 0, 4, 4, 84, 284, 284, 4284, 4284, 168, 169, 'UIAAAA', 'AJCAAA', 'OOOOxx'),
+(3267, 1587, 1, 3, 7, 7, 67, 267, 1267, 3267, 3267, 134, 135, 'RVAAAA', 'BJCAAA', 'VVVVxx'),
+(5908, 1588, 0, 0, 8, 8, 8, 908, 1908, 908, 5908, 16, 17, 'GTAAAA', 'CJCAAA', 'AAAAxx'),
+(1549, 1589, 1, 1, 9, 9, 49, 549, 1549, 1549, 1549, 98, 99, 'PHAAAA', 'DJCAAA', 'HHHHxx'),
+(8736, 1590, 0, 0, 6, 16, 36, 736, 736, 3736, 8736, 72, 73, 'AYAAAA', 'EJCAAA', 'OOOOxx'),
+(2008, 1591, 0, 0, 8, 8, 8, 8, 8, 2008, 2008, 16, 17, 'GZAAAA', 'FJCAAA', 'VVVVxx'),
+(548, 1592, 0, 0, 8, 8, 48, 548, 548, 548, 548, 96, 97, 'CVAAAA', 'GJCAAA', 'AAAAxx'),
+(8846, 1593, 0, 2, 6, 6, 46, 846, 846, 3846, 8846, 92, 93, 'GCAAAA', 'HJCAAA', 'HHHHxx'),
+(8374, 1594, 0, 2, 4, 14, 74, 374, 374, 3374, 8374, 148, 149, 'CKAAAA', 'IJCAAA', 'OOOOxx'),
+(7986, 1595, 0, 2, 6, 6, 86, 986, 1986, 2986, 7986, 172, 173, 'EVAAAA', 'JJCAAA', 'VVVVxx'),
+(6819, 1596, 1, 3, 9, 19, 19, 819, 819, 1819, 6819, 38, 39, 'HCAAAA', 'KJCAAA', 'AAAAxx'),
+(4418, 1597, 0, 2, 8, 18, 18, 418, 418, 4418, 4418, 36, 37, 'YNAAAA', 'LJCAAA', 'HHHHxx'),
+(833, 1598, 1, 1, 3, 13, 33, 833, 833, 833, 833, 66, 67, 'BGAAAA', 'MJCAAA', 'OOOOxx'),
+(4416, 1599, 0, 0, 6, 16, 16, 416, 416, 4416, 4416, 32, 33, 'WNAAAA', 'NJCAAA', 'VVVVxx'),
+(4902, 1600, 0, 2, 2, 2, 2, 902, 902, 4902, 4902, 4, 5, 'OGAAAA', 'OJCAAA', 'AAAAxx'),
+(6828, 1601, 0, 0, 8, 8, 28, 828, 828, 1828, 6828, 56, 57, 'QCAAAA', 'PJCAAA', 'HHHHxx'),
+(1118, 1602, 0, 2, 8, 18, 18, 118, 1118, 1118, 1118, 36, 37, 'ARAAAA', 'QJCAAA', 'OOOOxx'),
+(9993, 1603, 1, 1, 3, 13, 93, 993, 1993, 4993, 9993, 186, 187, 'JUAAAA', 'RJCAAA', 'VVVVxx'),
+(1430, 1604, 0, 2, 0, 10, 30, 430, 1430, 1430, 1430, 60, 61, 'ADAAAA', 'SJCAAA', 'AAAAxx'),
+(5670, 1605, 0, 2, 0, 10, 70, 670, 1670, 670, 5670, 140, 141, 'CKAAAA', 'TJCAAA', 'HHHHxx'),
+(5424, 1606, 0, 0, 4, 4, 24, 424, 1424, 424, 5424, 48, 49, 'QAAAAA', 'UJCAAA', 'OOOOxx'),
+(5561, 1607, 1, 1, 1, 1, 61, 561, 1561, 561, 5561, 122, 123, 'XFAAAA', 'VJCAAA', 'VVVVxx'),
+(2027, 1608, 1, 3, 7, 7, 27, 27, 27, 2027, 2027, 54, 55, 'ZZAAAA', 'WJCAAA', 'AAAAxx'),
+(6924, 1609, 0, 0, 4, 4, 24, 924, 924, 1924, 6924, 48, 49, 'IGAAAA', 'XJCAAA', 'HHHHxx'),
+(5946, 1610, 0, 2, 6, 6, 46, 946, 1946, 946, 5946, 92, 93, 'SUAAAA', 'YJCAAA', 'OOOOxx'),
+(4294, 1611, 0, 2, 4, 14, 94, 294, 294, 4294, 4294, 188, 189, 'EJAAAA', 'ZJCAAA', 'VVVVxx'),
+(2936, 1612, 0, 0, 6, 16, 36, 936, 936, 2936, 2936, 72, 73, 'YIAAAA', 'AKCAAA', 'AAAAxx'),
+(3855, 1613, 1, 3, 5, 15, 55, 855, 1855, 3855, 3855, 110, 111, 'HSAAAA', 'BKCAAA', 'HHHHxx'),
+(455, 1614, 1, 3, 5, 15, 55, 455, 455, 455, 455, 110, 111, 'NRAAAA', 'CKCAAA', 'OOOOxx'),
+(2918, 1615, 0, 2, 8, 18, 18, 918, 918, 2918, 2918, 36, 37, 'GIAAAA', 'DKCAAA', 'VVVVxx'),
+(448, 1616, 0, 0, 8, 8, 48, 448, 448, 448, 448, 96, 97, 'GRAAAA', 'EKCAAA', 'AAAAxx'),
+(2149, 1617, 1, 1, 9, 9, 49, 149, 149, 2149, 2149, 98, 99, 'REAAAA', 'FKCAAA', 'HHHHxx'),
+(8890, 1618, 0, 2, 0, 10, 90, 890, 890, 3890, 8890, 180, 181, 'YDAAAA', 'GKCAAA', 'OOOOxx'),
+(8919, 1619, 1, 3, 9, 19, 19, 919, 919, 3919, 8919, 38, 39, 'BFAAAA', 'HKCAAA', 'VVVVxx'),
+(4957, 1620, 1, 1, 7, 17, 57, 957, 957, 4957, 4957, 114, 115, 'RIAAAA', 'IKCAAA', 'AAAAxx'),
+(4, 1621, 0, 0, 4, 4, 4, 4, 4, 4, 4, 8, 9, 'EAAAAA', 'JKCAAA', 'HHHHxx'),
+(4837, 1622, 1, 1, 7, 17, 37, 837, 837, 4837, 4837, 74, 75, 'BEAAAA', 'KKCAAA', 'OOOOxx'),
+(3976, 1623, 0, 0, 6, 16, 76, 976, 1976, 3976, 3976, 152, 153, 'YWAAAA', 'LKCAAA', 'VVVVxx'),
+(9459, 1624, 1, 3, 9, 19, 59, 459, 1459, 4459, 9459, 118, 119, 'VZAAAA', 'MKCAAA', 'AAAAxx'),
+(7097, 1625, 1, 1, 7, 17, 97, 97, 1097, 2097, 7097, 194, 195, 'ZMAAAA', 'NKCAAA', 'HHHHxx'),
+(9226, 1626, 0, 2, 6, 6, 26, 226, 1226, 4226, 9226, 52, 53, 'WQAAAA', 'OKCAAA', 'OOOOxx'),
+(5803, 1627, 1, 3, 3, 3, 3, 803, 1803, 803, 5803, 6, 7, 'FPAAAA', 'PKCAAA', 'VVVVxx'),
+(21, 1628, 1, 1, 1, 1, 21, 21, 21, 21, 21, 42, 43, 'VAAAAA', 'QKCAAA', 'AAAAxx'),
+(5275, 1629, 1, 3, 5, 15, 75, 275, 1275, 275, 5275, 150, 151, 'XUAAAA', 'RKCAAA', 'HHHHxx'),
+(3488, 1630, 0, 0, 8, 8, 88, 488, 1488, 3488, 3488, 176, 177, 'EEAAAA', 'SKCAAA', 'OOOOxx'),
+(1595, 1631, 1, 3, 5, 15, 95, 595, 1595, 1595, 1595, 190, 191, 'JJAAAA', 'TKCAAA', 'VVVVxx'),
+(5212, 1632, 0, 0, 2, 12, 12, 212, 1212, 212, 5212, 24, 25, 'MSAAAA', 'UKCAAA', 'AAAAxx'),
+(6574, 1633, 0, 2, 4, 14, 74, 574, 574, 1574, 6574, 148, 149, 'WSAAAA', 'VKCAAA', 'HHHHxx'),
+(7524, 1634, 0, 0, 4, 4, 24, 524, 1524, 2524, 7524, 48, 49, 'KDAAAA', 'WKCAAA', 'OOOOxx'),
+(6100, 1635, 0, 0, 0, 0, 0, 100, 100, 1100, 6100, 0, 1, 'QAAAAA', 'XKCAAA', 'VVVVxx'),
+(1198, 1636, 0, 2, 8, 18, 98, 198, 1198, 1198, 1198, 196, 197, 'CUAAAA', 'YKCAAA', 'AAAAxx'),
+(7345, 1637, 1, 1, 5, 5, 45, 345, 1345, 2345, 7345, 90, 91, 'NWAAAA', 'ZKCAAA', 'HHHHxx'),
+(5020, 1638, 0, 0, 0, 0, 20, 20, 1020, 20, 5020, 40, 41, 'CLAAAA', 'ALCAAA', 'OOOOxx'),
+(6925, 1639, 1, 1, 5, 5, 25, 925, 925, 1925, 6925, 50, 51, 'JGAAAA', 'BLCAAA', 'VVVVxx'),
+(8915, 1640, 1, 3, 5, 15, 15, 915, 915, 3915, 8915, 30, 31, 'XEAAAA', 'CLCAAA', 'AAAAxx'),
+(3088, 1641, 0, 0, 8, 8, 88, 88, 1088, 3088, 3088, 176, 177, 'UOAAAA', 'DLCAAA', 'HHHHxx'),
+(4828, 1642, 0, 0, 8, 8, 28, 828, 828, 4828, 4828, 56, 57, 'SDAAAA', 'ELCAAA', 'OOOOxx'),
+(7276, 1643, 0, 0, 6, 16, 76, 276, 1276, 2276, 7276, 152, 153, 'WTAAAA', 'FLCAAA', 'VVVVxx'),
+(299, 1644, 1, 3, 9, 19, 99, 299, 299, 299, 299, 198, 199, 'NLAAAA', 'GLCAAA', 'AAAAxx'),
+(76, 1645, 0, 0, 6, 16, 76, 76, 76, 76, 76, 152, 153, 'YCAAAA', 'HLCAAA', 'HHHHxx'),
+(8458, 1646, 0, 2, 8, 18, 58, 458, 458, 3458, 8458, 116, 117, 'INAAAA', 'ILCAAA', 'OOOOxx'),
+(7207, 1647, 1, 3, 7, 7, 7, 207, 1207, 2207, 7207, 14, 15, 'FRAAAA', 'JLCAAA', 'VVVVxx'),
+(5585, 1648, 1, 1, 5, 5, 85, 585, 1585, 585, 5585, 170, 171, 'VGAAAA', 'KLCAAA', 'AAAAxx'),
+(3234, 1649, 0, 2, 4, 14, 34, 234, 1234, 3234, 3234, 68, 69, 'KUAAAA', 'LLCAAA', 'HHHHxx'),
+(8001, 1650, 1, 1, 1, 1, 1, 1, 1, 3001, 8001, 2, 3, 'TVAAAA', 'MLCAAA', 'OOOOxx'),
+(1319, 1651, 1, 3, 9, 19, 19, 319, 1319, 1319, 1319, 38, 39, 'TYAAAA', 'NLCAAA', 'VVVVxx'),
+(6342, 1652, 0, 2, 2, 2, 42, 342, 342, 1342, 6342, 84, 85, 'YJAAAA', 'OLCAAA', 'AAAAxx'),
+(9199, 1653, 1, 3, 9, 19, 99, 199, 1199, 4199, 9199, 198, 199, 'VPAAAA', 'PLCAAA', 'HHHHxx'),
+(5696, 1654, 0, 0, 6, 16, 96, 696, 1696, 696, 5696, 192, 193, 'CLAAAA', 'QLCAAA', 'OOOOxx'),
+(2562, 1655, 0, 2, 2, 2, 62, 562, 562, 2562, 2562, 124, 125, 'OUAAAA', 'RLCAAA', 'VVVVxx'),
+(4226, 1656, 0, 2, 6, 6, 26, 226, 226, 4226, 4226, 52, 53, 'OGAAAA', 'SLCAAA', 'AAAAxx'),
+(1184, 1657, 0, 0, 4, 4, 84, 184, 1184, 1184, 1184, 168, 169, 'OTAAAA', 'TLCAAA', 'HHHHxx'),
+(5807, 1658, 1, 3, 7, 7, 7, 807, 1807, 807, 5807, 14, 15, 'JPAAAA', 'ULCAAA', 'OOOOxx'),
+(1890, 1659, 0, 2, 0, 10, 90, 890, 1890, 1890, 1890, 180, 181, 'SUAAAA', 'VLCAAA', 'VVVVxx'),
+(451, 1660, 1, 3, 1, 11, 51, 451, 451, 451, 451, 102, 103, 'JRAAAA', 'WLCAAA', 'AAAAxx'),
+(1049, 1661, 1, 1, 9, 9, 49, 49, 1049, 1049, 1049, 98, 99, 'JOAAAA', 'XLCAAA', 'HHHHxx'),
+(5272, 1662, 0, 0, 2, 12, 72, 272, 1272, 272, 5272, 144, 145, 'UUAAAA', 'YLCAAA', 'OOOOxx'),
+(4588, 1663, 0, 0, 8, 8, 88, 588, 588, 4588, 4588, 176, 177, 'MUAAAA', 'ZLCAAA', 'VVVVxx'),
+(5213, 1664, 1, 1, 3, 13, 13, 213, 1213, 213, 5213, 26, 27, 'NSAAAA', 'AMCAAA', 'AAAAxx'),
+(9543, 1665, 1, 3, 3, 3, 43, 543, 1543, 4543, 9543, 86, 87, 'BDAAAA', 'BMCAAA', 'HHHHxx'),
+(6318, 1666, 0, 2, 8, 18, 18, 318, 318, 1318, 6318, 36, 37, 'AJAAAA', 'CMCAAA', 'OOOOxx'),
+(7992, 1667, 0, 0, 2, 12, 92, 992, 1992, 2992, 7992, 184, 185, 'KVAAAA', 'DMCAAA', 'VVVVxx'),
+(4619, 1668, 1, 3, 9, 19, 19, 619, 619, 4619, 4619, 38, 39, 'RVAAAA', 'EMCAAA', 'AAAAxx'),
+(7189, 1669, 1, 1, 9, 9, 89, 189, 1189, 2189, 7189, 178, 179, 'NQAAAA', 'FMCAAA', 'HHHHxx'),
+(2178, 1670, 0, 2, 8, 18, 78, 178, 178, 2178, 2178, 156, 157, 'UFAAAA', 'GMCAAA', 'OOOOxx'),
+(4928, 1671, 0, 0, 8, 8, 28, 928, 928, 4928, 4928, 56, 57, 'OHAAAA', 'HMCAAA', 'VVVVxx'),
+(3966, 1672, 0, 2, 6, 6, 66, 966, 1966, 3966, 3966, 132, 133, 'OWAAAA', 'IMCAAA', 'AAAAxx'),
+(9790, 1673, 0, 2, 0, 10, 90, 790, 1790, 4790, 9790, 180, 181, 'OMAAAA', 'JMCAAA', 'HHHHxx'),
+(9150, 1674, 0, 2, 0, 10, 50, 150, 1150, 4150, 9150, 100, 101, 'YNAAAA', 'KMCAAA', 'OOOOxx'),
+(313, 1675, 1, 1, 3, 13, 13, 313, 313, 313, 313, 26, 27, 'BMAAAA', 'LMCAAA', 'VVVVxx'),
+(1614, 1676, 0, 2, 4, 14, 14, 614, 1614, 1614, 1614, 28, 29, 'CKAAAA', 'MMCAAA', 'AAAAxx'),
+(1581, 1677, 1, 1, 1, 1, 81, 581, 1581, 1581, 1581, 162, 163, 'VIAAAA', 'NMCAAA', 'HHHHxx'),
+(3674, 1678, 0, 2, 4, 14, 74, 674, 1674, 3674, 3674, 148, 149, 'ILAAAA', 'OMCAAA', 'OOOOxx'),
+(3444, 1679, 0, 0, 4, 4, 44, 444, 1444, 3444, 3444, 88, 89, 'MCAAAA', 'PMCAAA', 'VVVVxx'),
+(1050, 1680, 0, 2, 0, 10, 50, 50, 1050, 1050, 1050, 100, 101, 'KOAAAA', 'QMCAAA', 'AAAAxx'),
+(8241, 1681, 1, 1, 1, 1, 41, 241, 241, 3241, 8241, 82, 83, 'ZEAAAA', 'RMCAAA', 'HHHHxx'),
+(3382, 1682, 0, 2, 2, 2, 82, 382, 1382, 3382, 3382, 164, 165, 'CAAAAA', 'SMCAAA', 'OOOOxx'),
+(7105, 1683, 1, 1, 5, 5, 5, 105, 1105, 2105, 7105, 10, 11, 'HNAAAA', 'TMCAAA', 'VVVVxx'),
+(2957, 1684, 1, 1, 7, 17, 57, 957, 957, 2957, 2957, 114, 115, 'TJAAAA', 'UMCAAA', 'AAAAxx'),
+(6162, 1685, 0, 2, 2, 2, 62, 162, 162, 1162, 6162, 124, 125, 'ADAAAA', 'VMCAAA', 'HHHHxx'),
+(5150, 1686, 0, 2, 0, 10, 50, 150, 1150, 150, 5150, 100, 101, 'CQAAAA', 'WMCAAA', 'OOOOxx'),
+(2622, 1687, 0, 2, 2, 2, 22, 622, 622, 2622, 2622, 44, 45, 'WWAAAA', 'XMCAAA', 'VVVVxx'),
+(2240, 1688, 0, 0, 0, 0, 40, 240, 240, 2240, 2240, 80, 81, 'EIAAAA', 'YMCAAA', 'AAAAxx'),
+(8880, 1689, 0, 0, 0, 0, 80, 880, 880, 3880, 8880, 160, 161, 'ODAAAA', 'ZMCAAA', 'HHHHxx'),
+(9250, 1690, 0, 2, 0, 10, 50, 250, 1250, 4250, 9250, 100, 101, 'URAAAA', 'ANCAAA', 'OOOOxx'),
+(7010, 1691, 0, 2, 0, 10, 10, 10, 1010, 2010, 7010, 20, 21, 'QJAAAA', 'BNCAAA', 'VVVVxx'),
+(1098, 1692, 0, 2, 8, 18, 98, 98, 1098, 1098, 1098, 196, 197, 'GQAAAA', 'CNCAAA', 'AAAAxx'),
+(648, 1693, 0, 0, 8, 8, 48, 648, 648, 648, 648, 96, 97, 'YYAAAA', 'DNCAAA', 'HHHHxx'),
+(5536, 1694, 0, 0, 6, 16, 36, 536, 1536, 536, 5536, 72, 73, 'YEAAAA', 'ENCAAA', 'OOOOxx'),
+(7858, 1695, 0, 2, 8, 18, 58, 858, 1858, 2858, 7858, 116, 117, 'GQAAAA', 'FNCAAA', 'VVVVxx'),
+(7053, 1696, 1, 1, 3, 13, 53, 53, 1053, 2053, 7053, 106, 107, 'HLAAAA', 'GNCAAA', 'AAAAxx'),
+(8681, 1697, 1, 1, 1, 1, 81, 681, 681, 3681, 8681, 162, 163, 'XVAAAA', 'HNCAAA', 'HHHHxx'),
+(8832, 1698, 0, 0, 2, 12, 32, 832, 832, 3832, 8832, 64, 65, 'SBAAAA', 'INCAAA', 'OOOOxx'),
+(6836, 1699, 0, 0, 6, 16, 36, 836, 836, 1836, 6836, 72, 73, 'YCAAAA', 'JNCAAA', 'VVVVxx'),
+(4856, 1700, 0, 0, 6, 16, 56, 856, 856, 4856, 4856, 112, 113, 'UEAAAA', 'KNCAAA', 'AAAAxx'),
+(345, 1701, 1, 1, 5, 5, 45, 345, 345, 345, 345, 90, 91, 'HNAAAA', 'LNCAAA', 'HHHHxx'),
+(6559, 1702, 1, 3, 9, 19, 59, 559, 559, 1559, 6559, 118, 119, 'HSAAAA', 'MNCAAA', 'OOOOxx'),
+(3017, 1703, 1, 1, 7, 17, 17, 17, 1017, 3017, 3017, 34, 35, 'BMAAAA', 'NNCAAA', 'VVVVxx'),
+(4176, 1704, 0, 0, 6, 16, 76, 176, 176, 4176, 4176, 152, 153, 'QEAAAA', 'ONCAAA', 'AAAAxx'),
+(2839, 1705, 1, 3, 9, 19, 39, 839, 839, 2839, 2839, 78, 79, 'FFAAAA', 'PNCAAA', 'HHHHxx'),
+(6065, 1706, 1, 1, 5, 5, 65, 65, 65, 1065, 6065, 130, 131, 'HZAAAA', 'QNCAAA', 'OOOOxx'),
+(7360, 1707, 0, 0, 0, 0, 60, 360, 1360, 2360, 7360, 120, 121, 'CXAAAA', 'RNCAAA', 'VVVVxx'),
+(9527, 1708, 1, 3, 7, 7, 27, 527, 1527, 4527, 9527, 54, 55, 'LCAAAA', 'SNCAAA', 'AAAAxx'),
+(8849, 1709, 1, 1, 9, 9, 49, 849, 849, 3849, 8849, 98, 99, 'JCAAAA', 'TNCAAA', 'HHHHxx'),
+(7274, 1710, 0, 2, 4, 14, 74, 274, 1274, 2274, 7274, 148, 149, 'UTAAAA', 'UNCAAA', 'OOOOxx'),
+(4368, 1711, 0, 0, 8, 8, 68, 368, 368, 4368, 4368, 136, 137, 'AMAAAA', 'VNCAAA', 'VVVVxx'),
+(2488, 1712, 0, 0, 8, 8, 88, 488, 488, 2488, 2488, 176, 177, 'SRAAAA', 'WNCAAA', 'AAAAxx'),
+(4674, 1713, 0, 2, 4, 14, 74, 674, 674, 4674, 4674, 148, 149, 'UXAAAA', 'XNCAAA', 'HHHHxx'),
+(365, 1714, 1, 1, 5, 5, 65, 365, 365, 365, 365, 130, 131, 'BOAAAA', 'YNCAAA', 'OOOOxx'),
+(5897, 1715, 1, 1, 7, 17, 97, 897, 1897, 897, 5897, 194, 195, 'VSAAAA', 'ZNCAAA', 'VVVVxx'),
+(8918, 1716, 0, 2, 8, 18, 18, 918, 918, 3918, 8918, 36, 37, 'AFAAAA', 'AOCAAA', 'AAAAxx'),
+(1988, 1717, 0, 0, 8, 8, 88, 988, 1988, 1988, 1988, 176, 177, 'MYAAAA', 'BOCAAA', 'HHHHxx'),
+(1210, 1718, 0, 2, 0, 10, 10, 210, 1210, 1210, 1210, 20, 21, 'OUAAAA', 'COCAAA', 'OOOOxx'),
+(2945, 1719, 1, 1, 5, 5, 45, 945, 945, 2945, 2945, 90, 91, 'HJAAAA', 'DOCAAA', 'VVVVxx'),
+(555, 1720, 1, 3, 5, 15, 55, 555, 555, 555, 555, 110, 111, 'JVAAAA', 'EOCAAA', 'AAAAxx'),
+(9615, 1721, 1, 3, 5, 15, 15, 615, 1615, 4615, 9615, 30, 31, 'VFAAAA', 'FOCAAA', 'HHHHxx'),
+(9939, 1722, 1, 3, 9, 19, 39, 939, 1939, 4939, 9939, 78, 79, 'HSAAAA', 'GOCAAA', 'OOOOxx'),
+(1216, 1723, 0, 0, 6, 16, 16, 216, 1216, 1216, 1216, 32, 33, 'UUAAAA', 'HOCAAA', 'VVVVxx'),
+(745, 1724, 1, 1, 5, 5, 45, 745, 745, 745, 745, 90, 91, 'RCAAAA', 'IOCAAA', 'AAAAxx'),
+(3326, 1725, 0, 2, 6, 6, 26, 326, 1326, 3326, 3326, 52, 53, 'YXAAAA', 'JOCAAA', 'HHHHxx'),
+(953, 1726, 1, 1, 3, 13, 53, 953, 953, 953, 953, 106, 107, 'RKAAAA', 'KOCAAA', 'OOOOxx'),
+(444, 1727, 0, 0, 4, 4, 44, 444, 444, 444, 444, 88, 89, 'CRAAAA', 'LOCAAA', 'VVVVxx'),
+(280, 1728, 0, 0, 0, 0, 80, 280, 280, 280, 280, 160, 161, 'UKAAAA', 'MOCAAA', 'AAAAxx'),
+(3707, 1729, 1, 3, 7, 7, 7, 707, 1707, 3707, 3707, 14, 15, 'PMAAAA', 'NOCAAA', 'HHHHxx'),
+(1351, 1730, 1, 3, 1, 11, 51, 351, 1351, 1351, 1351, 102, 103, 'ZZAAAA', 'OOCAAA', 'OOOOxx'),
+(1280, 1731, 0, 0, 0, 0, 80, 280, 1280, 1280, 1280, 160, 161, 'GXAAAA', 'POCAAA', 'VVVVxx'),
+(628, 1732, 0, 0, 8, 8, 28, 628, 628, 628, 628, 56, 57, 'EYAAAA', 'QOCAAA', 'AAAAxx'),
+(6198, 1733, 0, 2, 8, 18, 98, 198, 198, 1198, 6198, 196, 197, 'KEAAAA', 'ROCAAA', 'HHHHxx'),
+(1957, 1734, 1, 1, 7, 17, 57, 957, 1957, 1957, 1957, 114, 115, 'HXAAAA', 'SOCAAA', 'OOOOxx'),
+(9241, 1735, 1, 1, 1, 1, 41, 241, 1241, 4241, 9241, 82, 83, 'LRAAAA', 'TOCAAA', 'VVVVxx'),
+(303, 1736, 1, 3, 3, 3, 3, 303, 303, 303, 303, 6, 7, 'RLAAAA', 'UOCAAA', 'AAAAxx'),
+(1945, 1737, 1, 1, 5, 5, 45, 945, 1945, 1945, 1945, 90, 91, 'VWAAAA', 'VOCAAA', 'HHHHxx'),
+(3634, 1738, 0, 2, 4, 14, 34, 634, 1634, 3634, 3634, 68, 69, 'UJAAAA', 'WOCAAA', 'OOOOxx'),
+(4768, 1739, 0, 0, 8, 8, 68, 768, 768, 4768, 4768, 136, 137, 'KBAAAA', 'XOCAAA', 'VVVVxx'),
+(9262, 1740, 0, 2, 2, 2, 62, 262, 1262, 4262, 9262, 124, 125, 'GSAAAA', 'YOCAAA', 'AAAAxx'),
+(2610, 1741, 0, 2, 0, 10, 10, 610, 610, 2610, 2610, 20, 21, 'KWAAAA', 'ZOCAAA', 'HHHHxx'),
+(6640, 1742, 0, 0, 0, 0, 40, 640, 640, 1640, 6640, 80, 81, 'KVAAAA', 'APCAAA', 'OOOOxx'),
+(3338, 1743, 0, 2, 8, 18, 38, 338, 1338, 3338, 3338, 76, 77, 'KYAAAA', 'BPCAAA', 'VVVVxx'),
+(6560, 1744, 0, 0, 0, 0, 60, 560, 560, 1560, 6560, 120, 121, 'ISAAAA', 'CPCAAA', 'AAAAxx'),
+(5986, 1745, 0, 2, 6, 6, 86, 986, 1986, 986, 5986, 172, 173, 'GWAAAA', 'DPCAAA', 'HHHHxx'),
+(2970, 1746, 0, 2, 0, 10, 70, 970, 970, 2970, 2970, 140, 141, 'GKAAAA', 'EPCAAA', 'OOOOxx'),
+(4731, 1747, 1, 3, 1, 11, 31, 731, 731, 4731, 4731, 62, 63, 'ZZAAAA', 'FPCAAA', 'VVVVxx'),
+(9486, 1748, 0, 2, 6, 6, 86, 486, 1486, 4486, 9486, 172, 173, 'WAAAAA', 'GPCAAA', 'AAAAxx'),
+(7204, 1749, 0, 0, 4, 4, 4, 204, 1204, 2204, 7204, 8, 9, 'CRAAAA', 'HPCAAA', 'HHHHxx'),
+(6685, 1750, 1, 1, 5, 5, 85, 685, 685, 1685, 6685, 170, 171, 'DXAAAA', 'IPCAAA', 'OOOOxx'),
+(6852, 1751, 0, 0, 2, 12, 52, 852, 852, 1852, 6852, 104, 105, 'ODAAAA', 'JPCAAA', 'VVVVxx'),
+(2325, 1752, 1, 1, 5, 5, 25, 325, 325, 2325, 2325, 50, 51, 'LLAAAA', 'KPCAAA', 'AAAAxx'),
+(1063, 1753, 1, 3, 3, 3, 63, 63, 1063, 1063, 1063, 126, 127, 'XOAAAA', 'LPCAAA', 'HHHHxx'),
+(6810, 1754, 0, 2, 0, 10, 10, 810, 810, 1810, 6810, 20, 21, 'YBAAAA', 'MPCAAA', 'OOOOxx'),
+(7718, 1755, 0, 2, 8, 18, 18, 718, 1718, 2718, 7718, 36, 37, 'WKAAAA', 'NPCAAA', 'VVVVxx'),
+(1680, 1756, 0, 0, 0, 0, 80, 680, 1680, 1680, 1680, 160, 161, 'QMAAAA', 'OPCAAA', 'AAAAxx'),
+(7402, 1757, 0, 2, 2, 2, 2, 402, 1402, 2402, 7402, 4, 5, 'SYAAAA', 'PPCAAA', 'HHHHxx'),
+(4134, 1758, 0, 2, 4, 14, 34, 134, 134, 4134, 4134, 68, 69, 'ADAAAA', 'QPCAAA', 'OOOOxx'),
+(8232, 1759, 0, 0, 2, 12, 32, 232, 232, 3232, 8232, 64, 65, 'QEAAAA', 'RPCAAA', 'VVVVxx'),
+(6682, 1760, 0, 2, 2, 2, 82, 682, 682, 1682, 6682, 164, 165, 'AXAAAA', 'SPCAAA', 'AAAAxx'),
+(7952, 1761, 0, 0, 2, 12, 52, 952, 1952, 2952, 7952, 104, 105, 'WTAAAA', 'TPCAAA', 'HHHHxx'),
+(5943, 1762, 1, 3, 3, 3, 43, 943, 1943, 943, 5943, 86, 87, 'PUAAAA', 'UPCAAA', 'OOOOxx'),
+(5394, 1763, 0, 2, 4, 14, 94, 394, 1394, 394, 5394, 188, 189, 'MZAAAA', 'VPCAAA', 'VVVVxx'),
+(6554, 1764, 0, 2, 4, 14, 54, 554, 554, 1554, 6554, 108, 109, 'CSAAAA', 'WPCAAA', 'AAAAxx'),
+(8186, 1765, 0, 2, 6, 6, 86, 186, 186, 3186, 8186, 172, 173, 'WCAAAA', 'XPCAAA', 'HHHHxx'),
+(199, 1766, 1, 3, 9, 19, 99, 199, 199, 199, 199, 198, 199, 'RHAAAA', 'YPCAAA', 'OOOOxx'),
+(3386, 1767, 0, 2, 6, 6, 86, 386, 1386, 3386, 3386, 172, 173, 'GAAAAA', 'ZPCAAA', 'VVVVxx'),
+(8974, 1768, 0, 2, 4, 14, 74, 974, 974, 3974, 8974, 148, 149, 'EHAAAA', 'AQCAAA', 'AAAAxx'),
+(8140, 1769, 0, 0, 0, 0, 40, 140, 140, 3140, 8140, 80, 81, 'CBAAAA', 'BQCAAA', 'HHHHxx'),
+(3723, 1770, 1, 3, 3, 3, 23, 723, 1723, 3723, 3723, 46, 47, 'FNAAAA', 'CQCAAA', 'OOOOxx'),
+(8827, 1771, 1, 3, 7, 7, 27, 827, 827, 3827, 8827, 54, 55, 'NBAAAA', 'DQCAAA', 'VVVVxx'),
+(1998, 1772, 0, 2, 8, 18, 98, 998, 1998, 1998, 1998, 196, 197, 'WYAAAA', 'EQCAAA', 'AAAAxx'),
+(879, 1773, 1, 3, 9, 19, 79, 879, 879, 879, 879, 158, 159, 'VHAAAA', 'FQCAAA', 'HHHHxx'),
+(892, 1774, 0, 0, 2, 12, 92, 892, 892, 892, 892, 184, 185, 'IIAAAA', 'GQCAAA', 'OOOOxx'),
+(9468, 1775, 0, 0, 8, 8, 68, 468, 1468, 4468, 9468, 136, 137, 'EAAAAA', 'HQCAAA', 'VVVVxx'),
+(3797, 1776, 1, 1, 7, 17, 97, 797, 1797, 3797, 3797, 194, 195, 'BQAAAA', 'IQCAAA', 'AAAAxx'),
+(8379, 1777, 1, 3, 9, 19, 79, 379, 379, 3379, 8379, 158, 159, 'HKAAAA', 'JQCAAA', 'HHHHxx'),
+(2817, 1778, 1, 1, 7, 17, 17, 817, 817, 2817, 2817, 34, 35, 'JEAAAA', 'KQCAAA', 'OOOOxx'),
+(789, 1779, 1, 1, 9, 9, 89, 789, 789, 789, 789, 178, 179, 'JEAAAA', 'LQCAAA', 'VVVVxx'),
+(3871, 1780, 1, 3, 1, 11, 71, 871, 1871, 3871, 3871, 142, 143, 'XSAAAA', 'MQCAAA', 'AAAAxx'),
+(7931, 1781, 1, 3, 1, 11, 31, 931, 1931, 2931, 7931, 62, 63, 'BTAAAA', 'NQCAAA', 'HHHHxx'),
+(3636, 1782, 0, 0, 6, 16, 36, 636, 1636, 3636, 3636, 72, 73, 'WJAAAA', 'OQCAAA', 'OOOOxx'),
+(699, 1783, 1, 3, 9, 19, 99, 699, 699, 699, 699, 198, 199, 'XAAAAA', 'PQCAAA', 'VVVVxx'),
+(6850, 1784, 0, 2, 0, 10, 50, 850, 850, 1850, 6850, 100, 101, 'MDAAAA', 'QQCAAA', 'AAAAxx'),
+(6394, 1785, 0, 2, 4, 14, 94, 394, 394, 1394, 6394, 188, 189, 'YLAAAA', 'RQCAAA', 'HHHHxx'),
+(3475, 1786, 1, 3, 5, 15, 75, 475, 1475, 3475, 3475, 150, 151, 'RDAAAA', 'SQCAAA', 'OOOOxx'),
+(3026, 1787, 0, 2, 6, 6, 26, 26, 1026, 3026, 3026, 52, 53, 'KMAAAA', 'TQCAAA', 'VVVVxx'),
+(876, 1788, 0, 0, 6, 16, 76, 876, 876, 876, 876, 152, 153, 'SHAAAA', 'UQCAAA', 'AAAAxx'),
+(1992, 1789, 0, 0, 2, 12, 92, 992, 1992, 1992, 1992, 184, 185, 'QYAAAA', 'VQCAAA', 'HHHHxx'),
+(3079, 1790, 1, 3, 9, 19, 79, 79, 1079, 3079, 3079, 158, 159, 'LOAAAA', 'WQCAAA', 'OOOOxx'),
+(8128, 1791, 0, 0, 8, 8, 28, 128, 128, 3128, 8128, 56, 57, 'QAAAAA', 'XQCAAA', 'VVVVxx'),
+(8123, 1792, 1, 3, 3, 3, 23, 123, 123, 3123, 8123, 46, 47, 'LAAAAA', 'YQCAAA', 'AAAAxx'),
+(3285, 1793, 1, 1, 5, 5, 85, 285, 1285, 3285, 3285, 170, 171, 'JWAAAA', 'ZQCAAA', 'HHHHxx'),
+(9315, 1794, 1, 3, 5, 15, 15, 315, 1315, 4315, 9315, 30, 31, 'HUAAAA', 'ARCAAA', 'OOOOxx'),
+(9862, 1795, 0, 2, 2, 2, 62, 862, 1862, 4862, 9862, 124, 125, 'IPAAAA', 'BRCAAA', 'VVVVxx'),
+(2764, 1796, 0, 0, 4, 4, 64, 764, 764, 2764, 2764, 128, 129, 'ICAAAA', 'CRCAAA', 'AAAAxx'),
+(3544, 1797, 0, 0, 4, 4, 44, 544, 1544, 3544, 3544, 88, 89, 'IGAAAA', 'DRCAAA', 'HHHHxx'),
+(7747, 1798, 1, 3, 7, 7, 47, 747, 1747, 2747, 7747, 94, 95, 'ZLAAAA', 'ERCAAA', 'OOOOxx'),
+(7725, 1799, 1, 1, 5, 5, 25, 725, 1725, 2725, 7725, 50, 51, 'DLAAAA', 'FRCAAA', 'VVVVxx'),
+(2449, 1800, 1, 1, 9, 9, 49, 449, 449, 2449, 2449, 98, 99, 'FQAAAA', 'GRCAAA', 'AAAAxx'),
+(8967, 1801, 1, 3, 7, 7, 67, 967, 967, 3967, 8967, 134, 135, 'XGAAAA', 'HRCAAA', 'HHHHxx'),
+(7371, 1802, 1, 3, 1, 11, 71, 371, 1371, 2371, 7371, 142, 143, 'NXAAAA', 'IRCAAA', 'OOOOxx'),
+(2158, 1803, 0, 2, 8, 18, 58, 158, 158, 2158, 2158, 116, 117, 'AFAAAA', 'JRCAAA', 'VVVVxx'),
+(5590, 1804, 0, 2, 0, 10, 90, 590, 1590, 590, 5590, 180, 181, 'AHAAAA', 'KRCAAA', 'AAAAxx'),
+(8072, 1805, 0, 0, 2, 12, 72, 72, 72, 3072, 8072, 144, 145, 'MYAAAA', 'LRCAAA', 'HHHHxx'),
+(1971, 1806, 1, 3, 1, 11, 71, 971, 1971, 1971, 1971, 142, 143, 'VXAAAA', 'MRCAAA', 'OOOOxx'),
+(772, 1807, 0, 0, 2, 12, 72, 772, 772, 772, 772, 144, 145, 'SDAAAA', 'NRCAAA', 'VVVVxx'),
+(3433, 1808, 1, 1, 3, 13, 33, 433, 1433, 3433, 3433, 66, 67, 'BCAAAA', 'ORCAAA', 'AAAAxx'),
+(8419, 1809, 1, 3, 9, 19, 19, 419, 419, 3419, 8419, 38, 39, 'VLAAAA', 'PRCAAA', 'HHHHxx'),
+(1493, 1810, 1, 1, 3, 13, 93, 493, 1493, 1493, 1493, 186, 187, 'LFAAAA', 'QRCAAA', 'OOOOxx'),
+(2584, 1811, 0, 0, 4, 4, 84, 584, 584, 2584, 2584, 168, 169, 'KVAAAA', 'RRCAAA', 'VVVVxx'),
+(9502, 1812, 0, 2, 2, 2, 2, 502, 1502, 4502, 9502, 4, 5, 'MBAAAA', 'SRCAAA', 'AAAAxx'),
+(4673, 1813, 1, 1, 3, 13, 73, 673, 673, 4673, 4673, 146, 147, 'TXAAAA', 'TRCAAA', 'HHHHxx'),
+(7403, 1814, 1, 3, 3, 3, 3, 403, 1403, 2403, 7403, 6, 7, 'TYAAAA', 'URCAAA', 'OOOOxx'),
+(7103, 1815, 1, 3, 3, 3, 3, 103, 1103, 2103, 7103, 6, 7, 'FNAAAA', 'VRCAAA', 'VVVVxx'),
+(7026, 1816, 0, 2, 6, 6, 26, 26, 1026, 2026, 7026, 52, 53, 'GKAAAA', 'WRCAAA', 'AAAAxx'),
+(8574, 1817, 0, 2, 4, 14, 74, 574, 574, 3574, 8574, 148, 149, 'URAAAA', 'XRCAAA', 'HHHHxx'),
+(1366, 1818, 0, 2, 6, 6, 66, 366, 1366, 1366, 1366, 132, 133, 'OAAAAA', 'YRCAAA', 'OOOOxx'),
+(5787, 1819, 1, 3, 7, 7, 87, 787, 1787, 787, 5787, 174, 175, 'POAAAA', 'ZRCAAA', 'VVVVxx'),
+(2552, 1820, 0, 0, 2, 12, 52, 552, 552, 2552, 2552, 104, 105, 'EUAAAA', 'ASCAAA', 'AAAAxx'),
+(4557, 1821, 1, 1, 7, 17, 57, 557, 557, 4557, 4557, 114, 115, 'HTAAAA', 'BSCAAA', 'HHHHxx'),
+(3237, 1822, 1, 1, 7, 17, 37, 237, 1237, 3237, 3237, 74, 75, 'NUAAAA', 'CSCAAA', 'OOOOxx'),
+(6901, 1823, 1, 1, 1, 1, 1, 901, 901, 1901, 6901, 2, 3, 'LFAAAA', 'DSCAAA', 'VVVVxx'),
+(7708, 1824, 0, 0, 8, 8, 8, 708, 1708, 2708, 7708, 16, 17, 'MKAAAA', 'ESCAAA', 'AAAAxx'),
+(2011, 1825, 1, 3, 1, 11, 11, 11, 11, 2011, 2011, 22, 23, 'JZAAAA', 'FSCAAA', 'HHHHxx'),
+(9455, 1826, 1, 3, 5, 15, 55, 455, 1455, 4455, 9455, 110, 111, 'RZAAAA', 'GSCAAA', 'OOOOxx'),
+(5228, 1827, 0, 0, 8, 8, 28, 228, 1228, 228, 5228, 56, 57, 'CTAAAA', 'HSCAAA', 'VVVVxx'),
+(4043, 1828, 1, 3, 3, 3, 43, 43, 43, 4043, 4043, 86, 87, 'NZAAAA', 'ISCAAA', 'AAAAxx'),
+(8242, 1829, 0, 2, 2, 2, 42, 242, 242, 3242, 8242, 84, 85, 'AFAAAA', 'JSCAAA', 'HHHHxx'),
+(6351, 1830, 1, 3, 1, 11, 51, 351, 351, 1351, 6351, 102, 103, 'HKAAAA', 'KSCAAA', 'OOOOxx'),
+(5899, 1831, 1, 3, 9, 19, 99, 899, 1899, 899, 5899, 198, 199, 'XSAAAA', 'LSCAAA', 'VVVVxx'),
+(4849, 1832, 1, 1, 9, 9, 49, 849, 849, 4849, 4849, 98, 99, 'NEAAAA', 'MSCAAA', 'AAAAxx'),
+(9583, 1833, 1, 3, 3, 3, 83, 583, 1583, 4583, 9583, 166, 167, 'PEAAAA', 'NSCAAA', 'HHHHxx'),
+(4994, 1834, 0, 2, 4, 14, 94, 994, 994, 4994, 4994, 188, 189, 'CKAAAA', 'OSCAAA', 'OOOOxx'),
+(9787, 1835, 1, 3, 7, 7, 87, 787, 1787, 4787, 9787, 174, 175, 'LMAAAA', 'PSCAAA', 'VVVVxx'),
+(243, 1836, 1, 3, 3, 3, 43, 243, 243, 243, 243, 86, 87, 'JJAAAA', 'QSCAAA', 'AAAAxx'),
+(3931, 1837, 1, 3, 1, 11, 31, 931, 1931, 3931, 3931, 62, 63, 'FVAAAA', 'RSCAAA', 'HHHHxx'),
+(5945, 1838, 1, 1, 5, 5, 45, 945, 1945, 945, 5945, 90, 91, 'RUAAAA', 'SSCAAA', 'OOOOxx'),
+(1325, 1839, 1, 1, 5, 5, 25, 325, 1325, 1325, 1325, 50, 51, 'ZYAAAA', 'TSCAAA', 'VVVVxx'),
+(4142, 1840, 0, 2, 2, 2, 42, 142, 142, 4142, 4142, 84, 85, 'IDAAAA', 'USCAAA', 'AAAAxx'),
+(1963, 1841, 1, 3, 3, 3, 63, 963, 1963, 1963, 1963, 126, 127, 'NXAAAA', 'VSCAAA', 'HHHHxx'),
+(7041, 1842, 1, 1, 1, 1, 41, 41, 1041, 2041, 7041, 82, 83, 'VKAAAA', 'WSCAAA', 'OOOOxx'),
+(3074, 1843, 0, 2, 4, 14, 74, 74, 1074, 3074, 3074, 148, 149, 'GOAAAA', 'XSCAAA', 'VVVVxx'),
+(3290, 1844, 0, 2, 0, 10, 90, 290, 1290, 3290, 3290, 180, 181, 'OWAAAA', 'YSCAAA', 'AAAAxx'),
+(4146, 1845, 0, 2, 6, 6, 46, 146, 146, 4146, 4146, 92, 93, 'MDAAAA', 'ZSCAAA', 'HHHHxx'),
+(3832, 1846, 0, 0, 2, 12, 32, 832, 1832, 3832, 3832, 64, 65, 'KRAAAA', 'ATCAAA', 'OOOOxx'),
+(2217, 1847, 1, 1, 7, 17, 17, 217, 217, 2217, 2217, 34, 35, 'HHAAAA', 'BTCAAA', 'VVVVxx'),
+(635, 1848, 1, 3, 5, 15, 35, 635, 635, 635, 635, 70, 71, 'LYAAAA', 'CTCAAA', 'AAAAxx'),
+(6967, 1849, 1, 3, 7, 7, 67, 967, 967, 1967, 6967, 134, 135, 'ZHAAAA', 'DTCAAA', 'HHHHxx'),
+(3522, 1850, 0, 2, 2, 2, 22, 522, 1522, 3522, 3522, 44, 45, 'MFAAAA', 'ETCAAA', 'OOOOxx'),
+(2471, 1851, 1, 3, 1, 11, 71, 471, 471, 2471, 2471, 142, 143, 'BRAAAA', 'FTCAAA', 'VVVVxx'),
+(4236, 1852, 0, 0, 6, 16, 36, 236, 236, 4236, 4236, 72, 73, 'YGAAAA', 'GTCAAA', 'AAAAxx'),
+(853, 1853, 1, 1, 3, 13, 53, 853, 853, 853, 853, 106, 107, 'VGAAAA', 'HTCAAA', 'HHHHxx'),
+(3754, 1854, 0, 2, 4, 14, 54, 754, 1754, 3754, 3754, 108, 109, 'KOAAAA', 'ITCAAA', 'OOOOxx'),
+(796, 1855, 0, 0, 6, 16, 96, 796, 796, 796, 796, 192, 193, 'QEAAAA', 'JTCAAA', 'VVVVxx'),
+(4640, 1856, 0, 0, 0, 0, 40, 640, 640, 4640, 4640, 80, 81, 'MWAAAA', 'KTCAAA', 'AAAAxx'),
+(9496, 1857, 0, 0, 6, 16, 96, 496, 1496, 4496, 9496, 192, 193, 'GBAAAA', 'LTCAAA', 'HHHHxx'),
+(6873, 1858, 1, 1, 3, 13, 73, 873, 873, 1873, 6873, 146, 147, 'JEAAAA', 'MTCAAA', 'OOOOxx'),
+(4632, 1859, 0, 0, 2, 12, 32, 632, 632, 4632, 4632, 64, 65, 'EWAAAA', 'NTCAAA', 'VVVVxx'),
+(5758, 1860, 0, 2, 8, 18, 58, 758, 1758, 758, 5758, 116, 117, 'MNAAAA', 'OTCAAA', 'AAAAxx'),
+(6514, 1861, 0, 2, 4, 14, 14, 514, 514, 1514, 6514, 28, 29, 'OQAAAA', 'PTCAAA', 'HHHHxx'),
+(9510, 1862, 0, 2, 0, 10, 10, 510, 1510, 4510, 9510, 20, 21, 'UBAAAA', 'QTCAAA', 'OOOOxx'),
+(8411, 1863, 1, 3, 1, 11, 11, 411, 411, 3411, 8411, 22, 23, 'NLAAAA', 'RTCAAA', 'VVVVxx'),
+(7762, 1864, 0, 2, 2, 2, 62, 762, 1762, 2762, 7762, 124, 125, 'OMAAAA', 'STCAAA', 'AAAAxx'),
+(2225, 1865, 1, 1, 5, 5, 25, 225, 225, 2225, 2225, 50, 51, 'PHAAAA', 'TTCAAA', 'HHHHxx'),
+(4373, 1866, 1, 1, 3, 13, 73, 373, 373, 4373, 4373, 146, 147, 'FMAAAA', 'UTCAAA', 'OOOOxx'),
+(7326, 1867, 0, 2, 6, 6, 26, 326, 1326, 2326, 7326, 52, 53, 'UVAAAA', 'VTCAAA', 'VVVVxx'),
+(8651, 1868, 1, 3, 1, 11, 51, 651, 651, 3651, 8651, 102, 103, 'TUAAAA', 'WTCAAA', 'AAAAxx'),
+(9825, 1869, 1, 1, 5, 5, 25, 825, 1825, 4825, 9825, 50, 51, 'XNAAAA', 'XTCAAA', 'HHHHxx'),
+(2988, 1870, 0, 0, 8, 8, 88, 988, 988, 2988, 2988, 176, 177, 'YKAAAA', 'YTCAAA', 'OOOOxx'),
+(8138, 1871, 0, 2, 8, 18, 38, 138, 138, 3138, 8138, 76, 77, 'ABAAAA', 'ZTCAAA', 'VVVVxx'),
+(7792, 1872, 0, 0, 2, 12, 92, 792, 1792, 2792, 7792, 184, 185, 'SNAAAA', 'AUCAAA', 'AAAAxx'),
+(1232, 1873, 0, 0, 2, 12, 32, 232, 1232, 1232, 1232, 64, 65, 'KVAAAA', 'BUCAAA', 'HHHHxx'),
+(8221, 1874, 1, 1, 1, 1, 21, 221, 221, 3221, 8221, 42, 43, 'FEAAAA', 'CUCAAA', 'OOOOxx'),
+(4044, 1875, 0, 0, 4, 4, 44, 44, 44, 4044, 4044, 88, 89, 'OZAAAA', 'DUCAAA', 'VVVVxx'),
+(1204, 1876, 0, 0, 4, 4, 4, 204, 1204, 1204, 1204, 8, 9, 'IUAAAA', 'EUCAAA', 'AAAAxx'),
+(5145, 1877, 1, 1, 5, 5, 45, 145, 1145, 145, 5145, 90, 91, 'XPAAAA', 'FUCAAA', 'HHHHxx'),
+(7791, 1878, 1, 3, 1, 11, 91, 791, 1791, 2791, 7791, 182, 183, 'RNAAAA', 'GUCAAA', 'OOOOxx'),
+(8270, 1879, 0, 2, 0, 10, 70, 270, 270, 3270, 8270, 140, 141, 'CGAAAA', 'HUCAAA', 'VVVVxx'),
+(9427, 1880, 1, 3, 7, 7, 27, 427, 1427, 4427, 9427, 54, 55, 'PYAAAA', 'IUCAAA', 'AAAAxx'),
+(2152, 1881, 0, 0, 2, 12, 52, 152, 152, 2152, 2152, 104, 105, 'UEAAAA', 'JUCAAA', 'HHHHxx'),
+(7790, 1882, 0, 2, 0, 10, 90, 790, 1790, 2790, 7790, 180, 181, 'QNAAAA', 'KUCAAA', 'OOOOxx'),
+(5301, 1883, 1, 1, 1, 1, 1, 301, 1301, 301, 5301, 2, 3, 'XVAAAA', 'LUCAAA', 'VVVVxx'),
+(626, 1884, 0, 2, 6, 6, 26, 626, 626, 626, 626, 52, 53, 'CYAAAA', 'MUCAAA', 'AAAAxx'),
+(260, 1885, 0, 0, 0, 0, 60, 260, 260, 260, 260, 120, 121, 'AKAAAA', 'NUCAAA', 'HHHHxx'),
+(4369, 1886, 1, 1, 9, 9, 69, 369, 369, 4369, 4369, 138, 139, 'BMAAAA', 'OUCAAA', 'OOOOxx'),
+(5457, 1887, 1, 1, 7, 17, 57, 457, 1457, 457, 5457, 114, 115, 'XBAAAA', 'PUCAAA', 'VVVVxx'),
+(3468, 1888, 0, 0, 8, 8, 68, 468, 1468, 3468, 3468, 136, 137, 'KDAAAA', 'QUCAAA', 'AAAAxx'),
+(2257, 1889, 1, 1, 7, 17, 57, 257, 257, 2257, 2257, 114, 115, 'VIAAAA', 'RUCAAA', 'HHHHxx'),
+(9318, 1890, 0, 2, 8, 18, 18, 318, 1318, 4318, 9318, 36, 37, 'KUAAAA', 'SUCAAA', 'OOOOxx'),
+(8762, 1891, 0, 2, 2, 2, 62, 762, 762, 3762, 8762, 124, 125, 'AZAAAA', 'TUCAAA', 'VVVVxx'),
+(9153, 1892, 1, 1, 3, 13, 53, 153, 1153, 4153, 9153, 106, 107, 'BOAAAA', 'UUCAAA', 'AAAAxx'),
+(9220, 1893, 0, 0, 0, 0, 20, 220, 1220, 4220, 9220, 40, 41, 'QQAAAA', 'VUCAAA', 'HHHHxx'),
+(8003, 1894, 1, 3, 3, 3, 3, 3, 3, 3003, 8003, 6, 7, 'VVAAAA', 'WUCAAA', 'OOOOxx'),
+(7257, 1895, 1, 1, 7, 17, 57, 257, 1257, 2257, 7257, 114, 115, 'DTAAAA', 'XUCAAA', 'VVVVxx'),
+(3930, 1896, 0, 2, 0, 10, 30, 930, 1930, 3930, 3930, 60, 61, 'EVAAAA', 'YUCAAA', 'AAAAxx'),
+(2976, 1897, 0, 0, 6, 16, 76, 976, 976, 2976, 2976, 152, 153, 'MKAAAA', 'ZUCAAA', 'HHHHxx'),
+(2531, 1898, 1, 3, 1, 11, 31, 531, 531, 2531, 2531, 62, 63, 'JTAAAA', 'AVCAAA', 'OOOOxx'),
+(2250, 1899, 0, 2, 0, 10, 50, 250, 250, 2250, 2250, 100, 101, 'OIAAAA', 'BVCAAA', 'VVVVxx'),
+(8549, 1900, 1, 1, 9, 9, 49, 549, 549, 3549, 8549, 98, 99, 'VQAAAA', 'CVCAAA', 'AAAAxx'),
+(7197, 1901, 1, 1, 7, 17, 97, 197, 1197, 2197, 7197, 194, 195, 'VQAAAA', 'DVCAAA', 'HHHHxx'),
+(5916, 1902, 0, 0, 6, 16, 16, 916, 1916, 916, 5916, 32, 33, 'OTAAAA', 'EVCAAA', 'OOOOxx'),
+(5287, 1903, 1, 3, 7, 7, 87, 287, 1287, 287, 5287, 174, 175, 'JVAAAA', 'FVCAAA', 'VVVVxx'),
+(9095, 1904, 1, 3, 5, 15, 95, 95, 1095, 4095, 9095, 190, 191, 'VLAAAA', 'GVCAAA', 'AAAAxx'),
+(7137, 1905, 1, 1, 7, 17, 37, 137, 1137, 2137, 7137, 74, 75, 'NOAAAA', 'HVCAAA', 'HHHHxx'),
+(7902, 1906, 0, 2, 2, 2, 2, 902, 1902, 2902, 7902, 4, 5, 'YRAAAA', 'IVCAAA', 'OOOOxx'),
+(7598, 1907, 0, 2, 8, 18, 98, 598, 1598, 2598, 7598, 196, 197, 'GGAAAA', 'JVCAAA', 'VVVVxx'),
+(5652, 1908, 0, 0, 2, 12, 52, 652, 1652, 652, 5652, 104, 105, 'KJAAAA', 'KVCAAA', 'AAAAxx'),
+(2017, 1909, 1, 1, 7, 17, 17, 17, 17, 2017, 2017, 34, 35, 'PZAAAA', 'LVCAAA', 'HHHHxx'),
+(7255, 1910, 1, 3, 5, 15, 55, 255, 1255, 2255, 7255, 110, 111, 'BTAAAA', 'MVCAAA', 'OOOOxx'),
+(7999, 1911, 1, 3, 9, 19, 99, 999, 1999, 2999, 7999, 198, 199, 'RVAAAA', 'NVCAAA', 'VVVVxx'),
+(5388, 1912, 0, 0, 8, 8, 88, 388, 1388, 388, 5388, 176, 177, 'GZAAAA', 'OVCAAA', 'AAAAxx'),
+(8754, 1913, 0, 2, 4, 14, 54, 754, 754, 3754, 8754, 108, 109, 'SYAAAA', 'PVCAAA', 'HHHHxx'),
+(5415, 1914, 1, 3, 5, 15, 15, 415, 1415, 415, 5415, 30, 31, 'HAAAAA', 'QVCAAA', 'OOOOxx'),
+(8861, 1915, 1, 1, 1, 1, 61, 861, 861, 3861, 8861, 122, 123, 'VCAAAA', 'RVCAAA', 'VVVVxx'),
+(2874, 1916, 0, 2, 4, 14, 74, 874, 874, 2874, 2874, 148, 149, 'OGAAAA', 'SVCAAA', 'AAAAxx'),
+(9910, 1917, 0, 2, 0, 10, 10, 910, 1910, 4910, 9910, 20, 21, 'ERAAAA', 'TVCAAA', 'HHHHxx'),
+(5178, 1918, 0, 2, 8, 18, 78, 178, 1178, 178, 5178, 156, 157, 'ERAAAA', 'UVCAAA', 'OOOOxx'),
+(5698, 1919, 0, 2, 8, 18, 98, 698, 1698, 698, 5698, 196, 197, 'ELAAAA', 'VVCAAA', 'VVVVxx'),
+(8500, 1920, 0, 0, 0, 0, 0, 500, 500, 3500, 8500, 0, 1, 'YOAAAA', 'WVCAAA', 'AAAAxx'),
+(1814, 1921, 0, 2, 4, 14, 14, 814, 1814, 1814, 1814, 28, 29, 'URAAAA', 'XVCAAA', 'HHHHxx'),
+(4968, 1922, 0, 0, 8, 8, 68, 968, 968, 4968, 4968, 136, 137, 'CJAAAA', 'YVCAAA', 'OOOOxx'),
+(2642, 1923, 0, 2, 2, 2, 42, 642, 642, 2642, 2642, 84, 85, 'QXAAAA', 'ZVCAAA', 'VVVVxx'),
+(1578, 1924, 0, 2, 8, 18, 78, 578, 1578, 1578, 1578, 156, 157, 'SIAAAA', 'AWCAAA', 'AAAAxx'),
+(4774, 1925, 0, 2, 4, 14, 74, 774, 774, 4774, 4774, 148, 149, 'QBAAAA', 'BWCAAA', 'HHHHxx'),
+(7062, 1926, 0, 2, 2, 2, 62, 62, 1062, 2062, 7062, 124, 125, 'QLAAAA', 'CWCAAA', 'OOOOxx'),
+(5381, 1927, 1, 1, 1, 1, 81, 381, 1381, 381, 5381, 162, 163, 'ZYAAAA', 'DWCAAA', 'VVVVxx'),
+(7985, 1928, 1, 1, 5, 5, 85, 985, 1985, 2985, 7985, 170, 171, 'DVAAAA', 'EWCAAA', 'AAAAxx'),
+(3850, 1929, 0, 2, 0, 10, 50, 850, 1850, 3850, 3850, 100, 101, 'CSAAAA', 'FWCAAA', 'HHHHxx'),
+(5624, 1930, 0, 0, 4, 4, 24, 624, 1624, 624, 5624, 48, 49, 'IIAAAA', 'GWCAAA', 'OOOOxx'),
+(8948, 1931, 0, 0, 8, 8, 48, 948, 948, 3948, 8948, 96, 97, 'EGAAAA', 'HWCAAA', 'VVVVxx'),
+(995, 1932, 1, 3, 5, 15, 95, 995, 995, 995, 995, 190, 191, 'HMAAAA', 'IWCAAA', 'AAAAxx'),
+(5058, 1933, 0, 2, 8, 18, 58, 58, 1058, 58, 5058, 116, 117, 'OMAAAA', 'JWCAAA', 'HHHHxx'),
+(9670, 1934, 0, 2, 0, 10, 70, 670, 1670, 4670, 9670, 140, 141, 'YHAAAA', 'KWCAAA', 'OOOOxx'),
+(3115, 1935, 1, 3, 5, 15, 15, 115, 1115, 3115, 3115, 30, 31, 'VPAAAA', 'LWCAAA', 'VVVVxx'),
+(4935, 1936, 1, 3, 5, 15, 35, 935, 935, 4935, 4935, 70, 71, 'VHAAAA', 'MWCAAA', 'AAAAxx'),
+(4735, 1937, 1, 3, 5, 15, 35, 735, 735, 4735, 4735, 70, 71, 'DAAAAA', 'NWCAAA', 'HHHHxx'),
+(1348, 1938, 0, 0, 8, 8, 48, 348, 1348, 1348, 1348, 96, 97, 'WZAAAA', 'OWCAAA', 'OOOOxx'),
+(2380, 1939, 0, 0, 0, 0, 80, 380, 380, 2380, 2380, 160, 161, 'ONAAAA', 'PWCAAA', 'VVVVxx'),
+(4246, 1940, 0, 2, 6, 6, 46, 246, 246, 4246, 4246, 92, 93, 'IHAAAA', 'QWCAAA', 'AAAAxx'),
+(522, 1941, 0, 2, 2, 2, 22, 522, 522, 522, 522, 44, 45, 'CUAAAA', 'RWCAAA', 'HHHHxx'),
+(1701, 1942, 1, 1, 1, 1, 1, 701, 1701, 1701, 1701, 2, 3, 'LNAAAA', 'SWCAAA', 'OOOOxx'),
+(9709, 1943, 1, 1, 9, 9, 9, 709, 1709, 4709, 9709, 18, 19, 'LJAAAA', 'TWCAAA', 'VVVVxx'),
+(8829, 1944, 1, 1, 9, 9, 29, 829, 829, 3829, 8829, 58, 59, 'PBAAAA', 'UWCAAA', 'AAAAxx'),
+(7936, 1945, 0, 0, 6, 16, 36, 936, 1936, 2936, 7936, 72, 73, 'GTAAAA', 'VWCAAA', 'HHHHxx'),
+(8474, 1946, 0, 2, 4, 14, 74, 474, 474, 3474, 8474, 148, 149, 'YNAAAA', 'WWCAAA', 'OOOOxx'),
+(4676, 1947, 0, 0, 6, 16, 76, 676, 676, 4676, 4676, 152, 153, 'WXAAAA', 'XWCAAA', 'VVVVxx'),
+(6303, 1948, 1, 3, 3, 3, 3, 303, 303, 1303, 6303, 6, 7, 'LIAAAA', 'YWCAAA', 'AAAAxx'),
+(3485, 1949, 1, 1, 5, 5, 85, 485, 1485, 3485, 3485, 170, 171, 'BEAAAA', 'ZWCAAA', 'HHHHxx'),
+(2695, 1950, 1, 3, 5, 15, 95, 695, 695, 2695, 2695, 190, 191, 'RZAAAA', 'AXCAAA', 'OOOOxx'),
+(8830, 1951, 0, 2, 0, 10, 30, 830, 830, 3830, 8830, 60, 61, 'QBAAAA', 'BXCAAA', 'VVVVxx'),
+(898, 1952, 0, 2, 8, 18, 98, 898, 898, 898, 898, 196, 197, 'OIAAAA', 'CXCAAA', 'AAAAxx'),
+(7268, 1953, 0, 0, 8, 8, 68, 268, 1268, 2268, 7268, 136, 137, 'OTAAAA', 'DXCAAA', 'HHHHxx'),
+(6568, 1954, 0, 0, 8, 8, 68, 568, 568, 1568, 6568, 136, 137, 'QSAAAA', 'EXCAAA', 'OOOOxx'),
+(9724, 1955, 0, 0, 4, 4, 24, 724, 1724, 4724, 9724, 48, 49, 'AKAAAA', 'FXCAAA', 'VVVVxx'),
+(3329, 1956, 1, 1, 9, 9, 29, 329, 1329, 3329, 3329, 58, 59, 'BYAAAA', 'GXCAAA', 'AAAAxx'),
+(9860, 1957, 0, 0, 0, 0, 60, 860, 1860, 4860, 9860, 120, 121, 'GPAAAA', 'HXCAAA', 'HHHHxx'),
+(6833, 1958, 1, 1, 3, 13, 33, 833, 833, 1833, 6833, 66, 67, 'VCAAAA', 'IXCAAA', 'OOOOxx'),
+(5956, 1959, 0, 0, 6, 16, 56, 956, 1956, 956, 5956, 112, 113, 'CVAAAA', 'JXCAAA', 'VVVVxx'),
+(3963, 1960, 1, 3, 3, 3, 63, 963, 1963, 3963, 3963, 126, 127, 'LWAAAA', 'KXCAAA', 'AAAAxx'),
+(883, 1961, 1, 3, 3, 3, 83, 883, 883, 883, 883, 166, 167, 'ZHAAAA', 'LXCAAA', 'HHHHxx'),
+(2761, 1962, 1, 1, 1, 1, 61, 761, 761, 2761, 2761, 122, 123, 'FCAAAA', 'MXCAAA', 'OOOOxx'),
+(4644, 1963, 0, 0, 4, 4, 44, 644, 644, 4644, 4644, 88, 89, 'QWAAAA', 'NXCAAA', 'VVVVxx'),
+(1358, 1964, 0, 2, 8, 18, 58, 358, 1358, 1358, 1358, 116, 117, 'GAAAAA', 'OXCAAA', 'AAAAxx'),
+(2049, 1965, 1, 1, 9, 9, 49, 49, 49, 2049, 2049, 98, 99, 'VAAAAA', 'PXCAAA', 'HHHHxx'),
+(2193, 1966, 1, 1, 3, 13, 93, 193, 193, 2193, 2193, 186, 187, 'JGAAAA', 'QXCAAA', 'OOOOxx'),
+(9435, 1967, 1, 3, 5, 15, 35, 435, 1435, 4435, 9435, 70, 71, 'XYAAAA', 'RXCAAA', 'VVVVxx'),
+(5890, 1968, 0, 2, 0, 10, 90, 890, 1890, 890, 5890, 180, 181, 'OSAAAA', 'SXCAAA', 'AAAAxx'),
+(8149, 1969, 1, 1, 9, 9, 49, 149, 149, 3149, 8149, 98, 99, 'LBAAAA', 'TXCAAA', 'HHHHxx'),
+(423, 1970, 1, 3, 3, 3, 23, 423, 423, 423, 423, 46, 47, 'HQAAAA', 'UXCAAA', 'OOOOxx'),
+(7980, 1971, 0, 0, 0, 0, 80, 980, 1980, 2980, 7980, 160, 161, 'YUAAAA', 'VXCAAA', 'VVVVxx'),
+(9019, 1972, 1, 3, 9, 19, 19, 19, 1019, 4019, 9019, 38, 39, 'XIAAAA', 'WXCAAA', 'AAAAxx'),
+(1647, 1973, 1, 3, 7, 7, 47, 647, 1647, 1647, 1647, 94, 95, 'JLAAAA', 'XXCAAA', 'HHHHxx'),
+(9495, 1974, 1, 3, 5, 15, 95, 495, 1495, 4495, 9495, 190, 191, 'FBAAAA', 'YXCAAA', 'OOOOxx'),
+(3904, 1975, 0, 0, 4, 4, 4, 904, 1904, 3904, 3904, 8, 9, 'EUAAAA', 'ZXCAAA', 'VVVVxx'),
+(5838, 1976, 0, 2, 8, 18, 38, 838, 1838, 838, 5838, 76, 77, 'OQAAAA', 'AYCAAA', 'AAAAxx'),
+(3866, 1977, 0, 2, 6, 6, 66, 866, 1866, 3866, 3866, 132, 133, 'SSAAAA', 'BYCAAA', 'HHHHxx'),
+(3093, 1978, 1, 1, 3, 13, 93, 93, 1093, 3093, 3093, 186, 187, 'ZOAAAA', 'CYCAAA', 'OOOOxx'),
+(9666, 1979, 0, 2, 6, 6, 66, 666, 1666, 4666, 9666, 132, 133, 'UHAAAA', 'DYCAAA', 'VVVVxx'),
+(1246, 1980, 0, 2, 6, 6, 46, 246, 1246, 1246, 1246, 92, 93, 'YVAAAA', 'EYCAAA', 'AAAAxx'),
+(9759, 1981, 1, 3, 9, 19, 59, 759, 1759, 4759, 9759, 118, 119, 'JLAAAA', 'FYCAAA', 'HHHHxx'),
+(7174, 1982, 0, 2, 4, 14, 74, 174, 1174, 2174, 7174, 148, 149, 'YPAAAA', 'GYCAAA', 'OOOOxx'),
+(7678, 1983, 0, 2, 8, 18, 78, 678, 1678, 2678, 7678, 156, 157, 'IJAAAA', 'HYCAAA', 'VVVVxx'),
+(3004, 1984, 0, 0, 4, 4, 4, 4, 1004, 3004, 3004, 8, 9, 'OLAAAA', 'IYCAAA', 'AAAAxx'),
+(5607, 1985, 1, 3, 7, 7, 7, 607, 1607, 607, 5607, 14, 15, 'RHAAAA', 'JYCAAA', 'HHHHxx'),
+(8510, 1986, 0, 2, 0, 10, 10, 510, 510, 3510, 8510, 20, 21, 'IPAAAA', 'KYCAAA', 'OOOOxx'),
+(1483, 1987, 1, 3, 3, 3, 83, 483, 1483, 1483, 1483, 166, 167, 'BFAAAA', 'LYCAAA', 'VVVVxx'),
+(2915, 1988, 1, 3, 5, 15, 15, 915, 915, 2915, 2915, 30, 31, 'DIAAAA', 'MYCAAA', 'AAAAxx'),
+(1548, 1989, 0, 0, 8, 8, 48, 548, 1548, 1548, 1548, 96, 97, 'OHAAAA', 'NYCAAA', 'HHHHxx'),
+(5767, 1990, 1, 3, 7, 7, 67, 767, 1767, 767, 5767, 134, 135, 'VNAAAA', 'OYCAAA', 'OOOOxx'),
+(3214, 1991, 0, 2, 4, 14, 14, 214, 1214, 3214, 3214, 28, 29, 'QTAAAA', 'PYCAAA', 'VVVVxx'),
+(8663, 1992, 1, 3, 3, 3, 63, 663, 663, 3663, 8663, 126, 127, 'FVAAAA', 'QYCAAA', 'AAAAxx'),
+(5425, 1993, 1, 1, 5, 5, 25, 425, 1425, 425, 5425, 50, 51, 'RAAAAA', 'RYCAAA', 'HHHHxx'),
+(8530, 1994, 0, 2, 0, 10, 30, 530, 530, 3530, 8530, 60, 61, 'CQAAAA', 'SYCAAA', 'OOOOxx'),
+(821, 1995, 1, 1, 1, 1, 21, 821, 821, 821, 821, 42, 43, 'PFAAAA', 'TYCAAA', 'VVVVxx'),
+(8816, 1996, 0, 0, 6, 16, 16, 816, 816, 3816, 8816, 32, 33, 'CBAAAA', 'UYCAAA', 'AAAAxx'),
+(9367, 1997, 1, 3, 7, 7, 67, 367, 1367, 4367, 9367, 134, 135, 'HWAAAA', 'VYCAAA', 'HHHHxx'),
+(4138, 1998, 0, 2, 8, 18, 38, 138, 138, 4138, 4138, 76, 77, 'EDAAAA', 'WYCAAA', 'OOOOxx'),
+(94, 1999, 0, 2, 4, 14, 94, 94, 94, 94, 94, 188, 189, 'QDAAAA', 'XYCAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(1858, 2000, 0, 2, 8, 18, 58, 858, 1858, 1858, 1858, 116, 117, 'MTAAAA', 'YYCAAA', 'AAAAxx'),
+(5513, 2001, 1, 1, 3, 13, 13, 513, 1513, 513, 5513, 26, 27, 'BEAAAA', 'ZYCAAA', 'HHHHxx'),
+(9620, 2002, 0, 0, 0, 0, 20, 620, 1620, 4620, 9620, 40, 41, 'AGAAAA', 'AZCAAA', 'OOOOxx'),
+(4770, 2003, 0, 2, 0, 10, 70, 770, 770, 4770, 4770, 140, 141, 'MBAAAA', 'BZCAAA', 'VVVVxx'),
+(5193, 2004, 1, 1, 3, 13, 93, 193, 1193, 193, 5193, 186, 187, 'TRAAAA', 'CZCAAA', 'AAAAxx'),
+(198, 2005, 0, 2, 8, 18, 98, 198, 198, 198, 198, 196, 197, 'QHAAAA', 'DZCAAA', 'HHHHxx'),
+(417, 2006, 1, 1, 7, 17, 17, 417, 417, 417, 417, 34, 35, 'BQAAAA', 'EZCAAA', 'OOOOxx'),
+(173, 2007, 1, 1, 3, 13, 73, 173, 173, 173, 173, 146, 147, 'RGAAAA', 'FZCAAA', 'VVVVxx'),
+(6248, 2008, 0, 0, 8, 8, 48, 248, 248, 1248, 6248, 96, 97, 'IGAAAA', 'GZCAAA', 'AAAAxx'),
+(302, 2009, 0, 2, 2, 2, 2, 302, 302, 302, 302, 4, 5, 'QLAAAA', 'HZCAAA', 'HHHHxx'),
+(8983, 2010, 1, 3, 3, 3, 83, 983, 983, 3983, 8983, 166, 167, 'NHAAAA', 'IZCAAA', 'OOOOxx'),
+(4840, 2011, 0, 0, 0, 0, 40, 840, 840, 4840, 4840, 80, 81, 'EEAAAA', 'JZCAAA', 'VVVVxx'),
+(2876, 2012, 0, 0, 6, 16, 76, 876, 876, 2876, 2876, 152, 153, 'QGAAAA', 'KZCAAA', 'AAAAxx'),
+(5841, 2013, 1, 1, 1, 1, 41, 841, 1841, 841, 5841, 82, 83, 'RQAAAA', 'LZCAAA', 'HHHHxx'),
+(2766, 2014, 0, 2, 6, 6, 66, 766, 766, 2766, 2766, 132, 133, 'KCAAAA', 'MZCAAA', 'OOOOxx'),
+(9482, 2015, 0, 2, 2, 2, 82, 482, 1482, 4482, 9482, 164, 165, 'SAAAAA', 'NZCAAA', 'VVVVxx'),
+(5335, 2016, 1, 3, 5, 15, 35, 335, 1335, 335, 5335, 70, 71, 'FXAAAA', 'OZCAAA', 'AAAAxx'),
+(1502, 2017, 0, 2, 2, 2, 2, 502, 1502, 1502, 1502, 4, 5, 'UFAAAA', 'PZCAAA', 'HHHHxx'),
+(9291, 2018, 1, 3, 1, 11, 91, 291, 1291, 4291, 9291, 182, 183, 'JTAAAA', 'QZCAAA', 'OOOOxx'),
+(8655, 2019, 1, 3, 5, 15, 55, 655, 655, 3655, 8655, 110, 111, 'XUAAAA', 'RZCAAA', 'VVVVxx'),
+(1687, 2020, 1, 3, 7, 7, 87, 687, 1687, 1687, 1687, 174, 175, 'XMAAAA', 'SZCAAA', 'AAAAxx'),
+(8171, 2021, 1, 3, 1, 11, 71, 171, 171, 3171, 8171, 142, 143, 'HCAAAA', 'TZCAAA', 'HHHHxx'),
+(5699, 2022, 1, 3, 9, 19, 99, 699, 1699, 699, 5699, 198, 199, 'FLAAAA', 'UZCAAA', 'OOOOxx'),
+(1462, 2023, 0, 2, 2, 2, 62, 462, 1462, 1462, 1462, 124, 125, 'GEAAAA', 'VZCAAA', 'VVVVxx'),
+(608, 2024, 0, 0, 8, 8, 8, 608, 608, 608, 608, 16, 17, 'KXAAAA', 'WZCAAA', 'AAAAxx'),
+(6860, 2025, 0, 0, 0, 0, 60, 860, 860, 1860, 6860, 120, 121, 'WDAAAA', 'XZCAAA', 'HHHHxx'),
+(6063, 2026, 1, 3, 3, 3, 63, 63, 63, 1063, 6063, 126, 127, 'FZAAAA', 'YZCAAA', 'OOOOxx'),
+(1422, 2027, 0, 2, 2, 2, 22, 422, 1422, 1422, 1422, 44, 45, 'SCAAAA', 'ZZCAAA', 'VVVVxx'),
+(1932, 2028, 0, 0, 2, 12, 32, 932, 1932, 1932, 1932, 64, 65, 'IWAAAA', 'AADAAA', 'AAAAxx'),
+(5065, 2029, 1, 1, 5, 5, 65, 65, 1065, 65, 5065, 130, 131, 'VMAAAA', 'BADAAA', 'HHHHxx'),
+(432, 2030, 0, 0, 2, 12, 32, 432, 432, 432, 432, 64, 65, 'QQAAAA', 'CADAAA', 'OOOOxx'),
+(4680, 2031, 0, 0, 0, 0, 80, 680, 680, 4680, 4680, 160, 161, 'AYAAAA', 'DADAAA', 'VVVVxx'),
+(8172, 2032, 0, 0, 2, 12, 72, 172, 172, 3172, 8172, 144, 145, 'ICAAAA', 'EADAAA', 'AAAAxx'),
+(8668, 2033, 0, 0, 8, 8, 68, 668, 668, 3668, 8668, 136, 137, 'KVAAAA', 'FADAAA', 'HHHHxx'),
+(256, 2034, 0, 0, 6, 16, 56, 256, 256, 256, 256, 112, 113, 'WJAAAA', 'GADAAA', 'OOOOxx'),
+(2500, 2035, 0, 0, 0, 0, 0, 500, 500, 2500, 2500, 0, 1, 'ESAAAA', 'HADAAA', 'VVVVxx'),
+(274, 2036, 0, 2, 4, 14, 74, 274, 274, 274, 274, 148, 149, 'OKAAAA', 'IADAAA', 'AAAAxx'),
+(5907, 2037, 1, 3, 7, 7, 7, 907, 1907, 907, 5907, 14, 15, 'FTAAAA', 'JADAAA', 'HHHHxx'),
+(8587, 2038, 1, 3, 7, 7, 87, 587, 587, 3587, 8587, 174, 175, 'HSAAAA', 'KADAAA', 'OOOOxx'),
+(9942, 2039, 0, 2, 2, 2, 42, 942, 1942, 4942, 9942, 84, 85, 'KSAAAA', 'LADAAA', 'VVVVxx'),
+(116, 2040, 0, 0, 6, 16, 16, 116, 116, 116, 116, 32, 33, 'MEAAAA', 'MADAAA', 'AAAAxx'),
+(7134, 2041, 0, 2, 4, 14, 34, 134, 1134, 2134, 7134, 68, 69, 'KOAAAA', 'NADAAA', 'HHHHxx'),
+(9002, 2042, 0, 2, 2, 2, 2, 2, 1002, 4002, 9002, 4, 5, 'GIAAAA', 'OADAAA', 'OOOOxx'),
+(1209, 2043, 1, 1, 9, 9, 9, 209, 1209, 1209, 1209, 18, 19, 'NUAAAA', 'PADAAA', 'VVVVxx'),
+(9983, 2044, 1, 3, 3, 3, 83, 983, 1983, 4983, 9983, 166, 167, 'ZTAAAA', 'QADAAA', 'AAAAxx'),
+(1761, 2045, 1, 1, 1, 1, 61, 761, 1761, 1761, 1761, 122, 123, 'TPAAAA', 'RADAAA', 'HHHHxx'),
+(7723, 2046, 1, 3, 3, 3, 23, 723, 1723, 2723, 7723, 46, 47, 'BLAAAA', 'SADAAA', 'OOOOxx'),
+(6518, 2047, 0, 2, 8, 18, 18, 518, 518, 1518, 6518, 36, 37, 'SQAAAA', 'TADAAA', 'VVVVxx'),
+(1372, 2048, 0, 0, 2, 12, 72, 372, 1372, 1372, 1372, 144, 145, 'UAAAAA', 'UADAAA', 'AAAAxx'),
+(3587, 2049, 1, 3, 7, 7, 87, 587, 1587, 3587, 3587, 174, 175, 'ZHAAAA', 'VADAAA', 'HHHHxx'),
+(5323, 2050, 1, 3, 3, 3, 23, 323, 1323, 323, 5323, 46, 47, 'TWAAAA', 'WADAAA', 'OOOOxx'),
+(5902, 2051, 0, 2, 2, 2, 2, 902, 1902, 902, 5902, 4, 5, 'ATAAAA', 'XADAAA', 'VVVVxx'),
+(3749, 2052, 1, 1, 9, 9, 49, 749, 1749, 3749, 3749, 98, 99, 'FOAAAA', 'YADAAA', 'AAAAxx'),
+(5965, 2053, 1, 1, 5, 5, 65, 965, 1965, 965, 5965, 130, 131, 'LVAAAA', 'ZADAAA', 'HHHHxx'),
+(663, 2054, 1, 3, 3, 3, 63, 663, 663, 663, 663, 126, 127, 'NZAAAA', 'ABDAAA', 'OOOOxx'),
+(36, 2055, 0, 0, 6, 16, 36, 36, 36, 36, 36, 72, 73, 'KBAAAA', 'BBDAAA', 'VVVVxx'),
+(9782, 2056, 0, 2, 2, 2, 82, 782, 1782, 4782, 9782, 164, 165, 'GMAAAA', 'CBDAAA', 'AAAAxx'),
+(5412, 2057, 0, 0, 2, 12, 12, 412, 1412, 412, 5412, 24, 25, 'EAAAAA', 'DBDAAA', 'HHHHxx'),
+(9961, 2058, 1, 1, 1, 1, 61, 961, 1961, 4961, 9961, 122, 123, 'DTAAAA', 'EBDAAA', 'OOOOxx'),
+(6492, 2059, 0, 0, 2, 12, 92, 492, 492, 1492, 6492, 184, 185, 'SPAAAA', 'FBDAAA', 'VVVVxx'),
+(4234, 2060, 0, 2, 4, 14, 34, 234, 234, 4234, 4234, 68, 69, 'WGAAAA', 'GBDAAA', 'AAAAxx'),
+(4922, 2061, 0, 2, 2, 2, 22, 922, 922, 4922, 4922, 44, 45, 'IHAAAA', 'HBDAAA', 'HHHHxx'),
+(6166, 2062, 0, 2, 6, 6, 66, 166, 166, 1166, 6166, 132, 133, 'EDAAAA', 'IBDAAA', 'OOOOxx'),
+(7019, 2063, 1, 3, 9, 19, 19, 19, 1019, 2019, 7019, 38, 39, 'ZJAAAA', 'JBDAAA', 'VVVVxx'),
+(7805, 2064, 1, 1, 5, 5, 5, 805, 1805, 2805, 7805, 10, 11, 'FOAAAA', 'KBDAAA', 'AAAAxx'),
+(9808, 2065, 0, 0, 8, 8, 8, 808, 1808, 4808, 9808, 16, 17, 'GNAAAA', 'LBDAAA', 'HHHHxx'),
+(2550, 2066, 0, 2, 0, 10, 50, 550, 550, 2550, 2550, 100, 101, 'CUAAAA', 'MBDAAA', 'OOOOxx'),
+(8626, 2067, 0, 2, 6, 6, 26, 626, 626, 3626, 8626, 52, 53, 'UTAAAA', 'NBDAAA', 'VVVVxx'),
+(5649, 2068, 1, 1, 9, 9, 49, 649, 1649, 649, 5649, 98, 99, 'HJAAAA', 'OBDAAA', 'AAAAxx'),
+(3117, 2069, 1, 1, 7, 17, 17, 117, 1117, 3117, 3117, 34, 35, 'XPAAAA', 'PBDAAA', 'HHHHxx'),
+(866, 2070, 0, 2, 6, 6, 66, 866, 866, 866, 866, 132, 133, 'IHAAAA', 'QBDAAA', 'OOOOxx'),
+(2323, 2071, 1, 3, 3, 3, 23, 323, 323, 2323, 2323, 46, 47, 'JLAAAA', 'RBDAAA', 'VVVVxx'),
+(5132, 2072, 0, 0, 2, 12, 32, 132, 1132, 132, 5132, 64, 65, 'KPAAAA', 'SBDAAA', 'AAAAxx'),
+(9222, 2073, 0, 2, 2, 2, 22, 222, 1222, 4222, 9222, 44, 45, 'SQAAAA', 'TBDAAA', 'HHHHxx'),
+(3934, 2074, 0, 2, 4, 14, 34, 934, 1934, 3934, 3934, 68, 69, 'IVAAAA', 'UBDAAA', 'OOOOxx'),
+(4845, 2075, 1, 1, 5, 5, 45, 845, 845, 4845, 4845, 90, 91, 'JEAAAA', 'VBDAAA', 'VVVVxx'),
+(7714, 2076, 0, 2, 4, 14, 14, 714, 1714, 2714, 7714, 28, 29, 'SKAAAA', 'WBDAAA', 'AAAAxx'),
+(9818, 2077, 0, 2, 8, 18, 18, 818, 1818, 4818, 9818, 36, 37, 'QNAAAA', 'XBDAAA', 'HHHHxx'),
+(2219, 2078, 1, 3, 9, 19, 19, 219, 219, 2219, 2219, 38, 39, 'JHAAAA', 'YBDAAA', 'OOOOxx'),
+(6573, 2079, 1, 1, 3, 13, 73, 573, 573, 1573, 6573, 146, 147, 'VSAAAA', 'ZBDAAA', 'VVVVxx'),
+(4555, 2080, 1, 3, 5, 15, 55, 555, 555, 4555, 4555, 110, 111, 'FTAAAA', 'ACDAAA', 'AAAAxx'),
+(7306, 2081, 0, 2, 6, 6, 6, 306, 1306, 2306, 7306, 12, 13, 'AVAAAA', 'BCDAAA', 'HHHHxx'),
+(9313, 2082, 1, 1, 3, 13, 13, 313, 1313, 4313, 9313, 26, 27, 'FUAAAA', 'CCDAAA', 'OOOOxx'),
+(3924, 2083, 0, 0, 4, 4, 24, 924, 1924, 3924, 3924, 48, 49, 'YUAAAA', 'DCDAAA', 'VVVVxx'),
+(5176, 2084, 0, 0, 6, 16, 76, 176, 1176, 176, 5176, 152, 153, 'CRAAAA', 'ECDAAA', 'AAAAxx'),
+(9767, 2085, 1, 3, 7, 7, 67, 767, 1767, 4767, 9767, 134, 135, 'RLAAAA', 'FCDAAA', 'HHHHxx'),
+(905, 2086, 1, 1, 5, 5, 5, 905, 905, 905, 905, 10, 11, 'VIAAAA', 'GCDAAA', 'OOOOxx'),
+(8037, 2087, 1, 1, 7, 17, 37, 37, 37, 3037, 8037, 74, 75, 'DXAAAA', 'HCDAAA', 'VVVVxx'),
+(8133, 2088, 1, 1, 3, 13, 33, 133, 133, 3133, 8133, 66, 67, 'VAAAAA', 'ICDAAA', 'AAAAxx'),
+(2954, 2089, 0, 2, 4, 14, 54, 954, 954, 2954, 2954, 108, 109, 'QJAAAA', 'JCDAAA', 'HHHHxx'),
+(7262, 2090, 0, 2, 2, 2, 62, 262, 1262, 2262, 7262, 124, 125, 'ITAAAA', 'KCDAAA', 'OOOOxx'),
+(8768, 2091, 0, 0, 8, 8, 68, 768, 768, 3768, 8768, 136, 137, 'GZAAAA', 'LCDAAA', 'VVVVxx'),
+(6953, 2092, 1, 1, 3, 13, 53, 953, 953, 1953, 6953, 106, 107, 'LHAAAA', 'MCDAAA', 'AAAAxx'),
+(1984, 2093, 0, 0, 4, 4, 84, 984, 1984, 1984, 1984, 168, 169, 'IYAAAA', 'NCDAAA', 'HHHHxx'),
+(9348, 2094, 0, 0, 8, 8, 48, 348, 1348, 4348, 9348, 96, 97, 'OVAAAA', 'OCDAAA', 'OOOOxx'),
+(7769, 2095, 1, 1, 9, 9, 69, 769, 1769, 2769, 7769, 138, 139, 'VMAAAA', 'PCDAAA', 'VVVVxx'),
+(2994, 2096, 0, 2, 4, 14, 94, 994, 994, 2994, 2994, 188, 189, 'ELAAAA', 'QCDAAA', 'AAAAxx'),
+(5938, 2097, 0, 2, 8, 18, 38, 938, 1938, 938, 5938, 76, 77, 'KUAAAA', 'RCDAAA', 'HHHHxx'),
+(556, 2098, 0, 0, 6, 16, 56, 556, 556, 556, 556, 112, 113, 'KVAAAA', 'SCDAAA', 'OOOOxx'),
+(2577, 2099, 1, 1, 7, 17, 77, 577, 577, 2577, 2577, 154, 155, 'DVAAAA', 'TCDAAA', 'VVVVxx'),
+(8733, 2100, 1, 1, 3, 13, 33, 733, 733, 3733, 8733, 66, 67, 'XXAAAA', 'UCDAAA', 'AAAAxx'),
+(3108, 2101, 0, 0, 8, 8, 8, 108, 1108, 3108, 3108, 16, 17, 'OPAAAA', 'VCDAAA', 'HHHHxx'),
+(4166, 2102, 0, 2, 6, 6, 66, 166, 166, 4166, 4166, 132, 133, 'GEAAAA', 'WCDAAA', 'OOOOxx'),
+(3170, 2103, 0, 2, 0, 10, 70, 170, 1170, 3170, 3170, 140, 141, 'YRAAAA', 'XCDAAA', 'VVVVxx'),
+(8118, 2104, 0, 2, 8, 18, 18, 118, 118, 3118, 8118, 36, 37, 'GAAAAA', 'YCDAAA', 'AAAAxx'),
+(8454, 2105, 0, 2, 4, 14, 54, 454, 454, 3454, 8454, 108, 109, 'ENAAAA', 'ZCDAAA', 'HHHHxx'),
+(5338, 2106, 0, 2, 8, 18, 38, 338, 1338, 338, 5338, 76, 77, 'IXAAAA', 'ADDAAA', 'OOOOxx'),
+(402, 2107, 0, 2, 2, 2, 2, 402, 402, 402, 402, 4, 5, 'MPAAAA', 'BDDAAA', 'VVVVxx'),
+(5673, 2108, 1, 1, 3, 13, 73, 673, 1673, 673, 5673, 146, 147, 'FKAAAA', 'CDDAAA', 'AAAAxx'),
+(4324, 2109, 0, 0, 4, 4, 24, 324, 324, 4324, 4324, 48, 49, 'IKAAAA', 'DDDAAA', 'HHHHxx'),
+(1943, 2110, 1, 3, 3, 3, 43, 943, 1943, 1943, 1943, 86, 87, 'TWAAAA', 'EDDAAA', 'OOOOxx'),
+(7703, 2111, 1, 3, 3, 3, 3, 703, 1703, 2703, 7703, 6, 7, 'HKAAAA', 'FDDAAA', 'VVVVxx'),
+(7180, 2112, 0, 0, 0, 0, 80, 180, 1180, 2180, 7180, 160, 161, 'EQAAAA', 'GDDAAA', 'AAAAxx'),
+(5478, 2113, 0, 2, 8, 18, 78, 478, 1478, 478, 5478, 156, 157, 'SCAAAA', 'HDDAAA', 'HHHHxx'),
+(5775, 2114, 1, 3, 5, 15, 75, 775, 1775, 775, 5775, 150, 151, 'DOAAAA', 'IDDAAA', 'OOOOxx'),
+(6952, 2115, 0, 0, 2, 12, 52, 952, 952, 1952, 6952, 104, 105, 'KHAAAA', 'JDDAAA', 'VVVVxx'),
+(9022, 2116, 0, 2, 2, 2, 22, 22, 1022, 4022, 9022, 44, 45, 'AJAAAA', 'KDDAAA', 'AAAAxx'),
+(547, 2117, 1, 3, 7, 7, 47, 547, 547, 547, 547, 94, 95, 'BVAAAA', 'LDDAAA', 'HHHHxx'),
+(5877, 2118, 1, 1, 7, 17, 77, 877, 1877, 877, 5877, 154, 155, 'BSAAAA', 'MDDAAA', 'OOOOxx'),
+(9580, 2119, 0, 0, 0, 0, 80, 580, 1580, 4580, 9580, 160, 161, 'MEAAAA', 'NDDAAA', 'VVVVxx'),
+(6094, 2120, 0, 2, 4, 14, 94, 94, 94, 1094, 6094, 188, 189, 'KAAAAA', 'ODDAAA', 'AAAAxx'),
+(3398, 2121, 0, 2, 8, 18, 98, 398, 1398, 3398, 3398, 196, 197, 'SAAAAA', 'PDDAAA', 'HHHHxx'),
+(4574, 2122, 0, 2, 4, 14, 74, 574, 574, 4574, 4574, 148, 149, 'YTAAAA', 'QDDAAA', 'OOOOxx'),
+(3675, 2123, 1, 3, 5, 15, 75, 675, 1675, 3675, 3675, 150, 151, 'JLAAAA', 'RDDAAA', 'VVVVxx'),
+(6413, 2124, 1, 1, 3, 13, 13, 413, 413, 1413, 6413, 26, 27, 'RMAAAA', 'SDDAAA', 'AAAAxx'),
+(9851, 2125, 1, 3, 1, 11, 51, 851, 1851, 4851, 9851, 102, 103, 'XOAAAA', 'TDDAAA', 'HHHHxx'),
+(126, 2126, 0, 2, 6, 6, 26, 126, 126, 126, 126, 52, 53, 'WEAAAA', 'UDDAAA', 'OOOOxx'),
+(6803, 2127, 1, 3, 3, 3, 3, 803, 803, 1803, 6803, 6, 7, 'RBAAAA', 'VDDAAA', 'VVVVxx'),
+(6949, 2128, 1, 1, 9, 9, 49, 949, 949, 1949, 6949, 98, 99, 'HHAAAA', 'WDDAAA', 'AAAAxx'),
+(115, 2129, 1, 3, 5, 15, 15, 115, 115, 115, 115, 30, 31, 'LEAAAA', 'XDDAAA', 'HHHHxx'),
+(4165, 2130, 1, 1, 5, 5, 65, 165, 165, 4165, 4165, 130, 131, 'FEAAAA', 'YDDAAA', 'OOOOxx'),
+(201, 2131, 1, 1, 1, 1, 1, 201, 201, 201, 201, 2, 3, 'THAAAA', 'ZDDAAA', 'VVVVxx'),
+(9324, 2132, 0, 0, 4, 4, 24, 324, 1324, 4324, 9324, 48, 49, 'QUAAAA', 'AEDAAA', 'AAAAxx'),
+(6562, 2133, 0, 2, 2, 2, 62, 562, 562, 1562, 6562, 124, 125, 'KSAAAA', 'BEDAAA', 'HHHHxx'),
+(1917, 2134, 1, 1, 7, 17, 17, 917, 1917, 1917, 1917, 34, 35, 'TVAAAA', 'CEDAAA', 'OOOOxx'),
+(558, 2135, 0, 2, 8, 18, 58, 558, 558, 558, 558, 116, 117, 'MVAAAA', 'DEDAAA', 'VVVVxx'),
+(8515, 2136, 1, 3, 5, 15, 15, 515, 515, 3515, 8515, 30, 31, 'NPAAAA', 'EEDAAA', 'AAAAxx'),
+(6321, 2137, 1, 1, 1, 1, 21, 321, 321, 1321, 6321, 42, 43, 'DJAAAA', 'FEDAAA', 'HHHHxx'),
+(6892, 2138, 0, 0, 2, 12, 92, 892, 892, 1892, 6892, 184, 185, 'CFAAAA', 'GEDAAA', 'OOOOxx'),
+(1001, 2139, 1, 1, 1, 1, 1, 1, 1001, 1001, 1001, 2, 3, 'NMAAAA', 'HEDAAA', 'VVVVxx'),
+(2858, 2140, 0, 2, 8, 18, 58, 858, 858, 2858, 2858, 116, 117, 'YFAAAA', 'IEDAAA', 'AAAAxx'),
+(2434, 2141, 0, 2, 4, 14, 34, 434, 434, 2434, 2434, 68, 69, 'QPAAAA', 'JEDAAA', 'HHHHxx'),
+(4460, 2142, 0, 0, 0, 0, 60, 460, 460, 4460, 4460, 120, 121, 'OPAAAA', 'KEDAAA', 'OOOOxx'),
+(5447, 2143, 1, 3, 7, 7, 47, 447, 1447, 447, 5447, 94, 95, 'NBAAAA', 'LEDAAA', 'VVVVxx'),
+(3799, 2144, 1, 3, 9, 19, 99, 799, 1799, 3799, 3799, 198, 199, 'DQAAAA', 'MEDAAA', 'AAAAxx'),
+(4310, 2145, 0, 2, 0, 10, 10, 310, 310, 4310, 4310, 20, 21, 'UJAAAA', 'NEDAAA', 'HHHHxx'),
+(405, 2146, 1, 1, 5, 5, 5, 405, 405, 405, 405, 10, 11, 'PPAAAA', 'OEDAAA', 'OOOOxx'),
+(4573, 2147, 1, 1, 3, 13, 73, 573, 573, 4573, 4573, 146, 147, 'XTAAAA', 'PEDAAA', 'VVVVxx'),
+(706, 2148, 0, 2, 6, 6, 6, 706, 706, 706, 706, 12, 13, 'EBAAAA', 'QEDAAA', 'AAAAxx'),
+(7619, 2149, 1, 3, 9, 19, 19, 619, 1619, 2619, 7619, 38, 39, 'BHAAAA', 'REDAAA', 'HHHHxx'),
+(7959, 2150, 1, 3, 9, 19, 59, 959, 1959, 2959, 7959, 118, 119, 'DUAAAA', 'SEDAAA', 'OOOOxx'),
+(6712, 2151, 0, 0, 2, 12, 12, 712, 712, 1712, 6712, 24, 25, 'EYAAAA', 'TEDAAA', 'VVVVxx'),
+(6959, 2152, 1, 3, 9, 19, 59, 959, 959, 1959, 6959, 118, 119, 'RHAAAA', 'UEDAAA', 'AAAAxx'),
+(9791, 2153, 1, 3, 1, 11, 91, 791, 1791, 4791, 9791, 182, 183, 'PMAAAA', 'VEDAAA', 'HHHHxx'),
+(2112, 2154, 0, 0, 2, 12, 12, 112, 112, 2112, 2112, 24, 25, 'GDAAAA', 'WEDAAA', 'OOOOxx'),
+(9114, 2155, 0, 2, 4, 14, 14, 114, 1114, 4114, 9114, 28, 29, 'OMAAAA', 'XEDAAA', 'VVVVxx'),
+(3506, 2156, 0, 2, 6, 6, 6, 506, 1506, 3506, 3506, 12, 13, 'WEAAAA', 'YEDAAA', 'AAAAxx'),
+(5002, 2157, 0, 2, 2, 2, 2, 2, 1002, 2, 5002, 4, 5, 'KKAAAA', 'ZEDAAA', 'HHHHxx'),
+(3518, 2158, 0, 2, 8, 18, 18, 518, 1518, 3518, 3518, 36, 37, 'IFAAAA', 'AFDAAA', 'OOOOxx'),
+(602, 2159, 0, 2, 2, 2, 2, 602, 602, 602, 602, 4, 5, 'EXAAAA', 'BFDAAA', 'VVVVxx'),
+(9060, 2160, 0, 0, 0, 0, 60, 60, 1060, 4060, 9060, 120, 121, 'MKAAAA', 'CFDAAA', 'AAAAxx'),
+(3292, 2161, 0, 0, 2, 12, 92, 292, 1292, 3292, 3292, 184, 185, 'QWAAAA', 'DFDAAA', 'HHHHxx'),
+(77, 2162, 1, 1, 7, 17, 77, 77, 77, 77, 77, 154, 155, 'ZCAAAA', 'EFDAAA', 'OOOOxx'),
+(1420, 2163, 0, 0, 0, 0, 20, 420, 1420, 1420, 1420, 40, 41, 'QCAAAA', 'FFDAAA', 'VVVVxx'),
+(6001, 2164, 1, 1, 1, 1, 1, 1, 1, 1001, 6001, 2, 3, 'VWAAAA', 'GFDAAA', 'AAAAxx'),
+(7477, 2165, 1, 1, 7, 17, 77, 477, 1477, 2477, 7477, 154, 155, 'PBAAAA', 'HFDAAA', 'HHHHxx'),
+(6655, 2166, 1, 3, 5, 15, 55, 655, 655, 1655, 6655, 110, 111, 'ZVAAAA', 'IFDAAA', 'OOOOxx'),
+(7845, 2167, 1, 1, 5, 5, 45, 845, 1845, 2845, 7845, 90, 91, 'TPAAAA', 'JFDAAA', 'VVVVxx'),
+(8484, 2168, 0, 0, 4, 4, 84, 484, 484, 3484, 8484, 168, 169, 'IOAAAA', 'KFDAAA', 'AAAAxx'),
+(4345, 2169, 1, 1, 5, 5, 45, 345, 345, 4345, 4345, 90, 91, 'DLAAAA', 'LFDAAA', 'HHHHxx'),
+(4250, 2170, 0, 2, 0, 10, 50, 250, 250, 4250, 4250, 100, 101, 'MHAAAA', 'MFDAAA', 'OOOOxx'),
+(2391, 2171, 1, 3, 1, 11, 91, 391, 391, 2391, 2391, 182, 183, 'ZNAAAA', 'NFDAAA', 'VVVVxx'),
+(6884, 2172, 0, 0, 4, 4, 84, 884, 884, 1884, 6884, 168, 169, 'UEAAAA', 'OFDAAA', 'AAAAxx'),
+(7270, 2173, 0, 2, 0, 10, 70, 270, 1270, 2270, 7270, 140, 141, 'QTAAAA', 'PFDAAA', 'HHHHxx'),
+(2499, 2174, 1, 3, 9, 19, 99, 499, 499, 2499, 2499, 198, 199, 'DSAAAA', 'QFDAAA', 'OOOOxx'),
+(7312, 2175, 0, 0, 2, 12, 12, 312, 1312, 2312, 7312, 24, 25, 'GVAAAA', 'RFDAAA', 'VVVVxx'),
+(7113, 2176, 1, 1, 3, 13, 13, 113, 1113, 2113, 7113, 26, 27, 'PNAAAA', 'SFDAAA', 'AAAAxx'),
+(6695, 2177, 1, 3, 5, 15, 95, 695, 695, 1695, 6695, 190, 191, 'NXAAAA', 'TFDAAA', 'HHHHxx'),
+(6521, 2178, 1, 1, 1, 1, 21, 521, 521, 1521, 6521, 42, 43, 'VQAAAA', 'UFDAAA', 'OOOOxx'),
+(272, 2179, 0, 0, 2, 12, 72, 272, 272, 272, 272, 144, 145, 'MKAAAA', 'VFDAAA', 'VVVVxx'),
+(9976, 2180, 0, 0, 6, 16, 76, 976, 1976, 4976, 9976, 152, 153, 'STAAAA', 'WFDAAA', 'AAAAxx'),
+(992, 2181, 0, 0, 2, 12, 92, 992, 992, 992, 992, 184, 185, 'EMAAAA', 'XFDAAA', 'HHHHxx'),
+(6158, 2182, 0, 2, 8, 18, 58, 158, 158, 1158, 6158, 116, 117, 'WCAAAA', 'YFDAAA', 'OOOOxx'),
+(3281, 2183, 1, 1, 1, 1, 81, 281, 1281, 3281, 3281, 162, 163, 'FWAAAA', 'ZFDAAA', 'VVVVxx'),
+(7446, 2184, 0, 2, 6, 6, 46, 446, 1446, 2446, 7446, 92, 93, 'KAAAAA', 'AGDAAA', 'AAAAxx'),
+(4679, 2185, 1, 3, 9, 19, 79, 679, 679, 4679, 4679, 158, 159, 'ZXAAAA', 'BGDAAA', 'HHHHxx'),
+(5203, 2186, 1, 3, 3, 3, 3, 203, 1203, 203, 5203, 6, 7, 'DSAAAA', 'CGDAAA', 'OOOOxx'),
+(9874, 2187, 0, 2, 4, 14, 74, 874, 1874, 4874, 9874, 148, 149, 'UPAAAA', 'DGDAAA', 'VVVVxx'),
+(8371, 2188, 1, 3, 1, 11, 71, 371, 371, 3371, 8371, 142, 143, 'ZJAAAA', 'EGDAAA', 'AAAAxx'),
+(9086, 2189, 0, 2, 6, 6, 86, 86, 1086, 4086, 9086, 172, 173, 'MLAAAA', 'FGDAAA', 'HHHHxx'),
+(430, 2190, 0, 2, 0, 10, 30, 430, 430, 430, 430, 60, 61, 'OQAAAA', 'GGDAAA', 'OOOOxx'),
+(8749, 2191, 1, 1, 9, 9, 49, 749, 749, 3749, 8749, 98, 99, 'NYAAAA', 'HGDAAA', 'VVVVxx'),
+(577, 2192, 1, 1, 7, 17, 77, 577, 577, 577, 577, 154, 155, 'FWAAAA', 'IGDAAA', 'AAAAxx'),
+(4884, 2193, 0, 0, 4, 4, 84, 884, 884, 4884, 4884, 168, 169, 'WFAAAA', 'JGDAAA', 'HHHHxx'),
+(3421, 2194, 1, 1, 1, 1, 21, 421, 1421, 3421, 3421, 42, 43, 'PBAAAA', 'KGDAAA', 'OOOOxx'),
+(2812, 2195, 0, 0, 2, 12, 12, 812, 812, 2812, 2812, 24, 25, 'EEAAAA', 'LGDAAA', 'VVVVxx'),
+(5958, 2196, 0, 2, 8, 18, 58, 958, 1958, 958, 5958, 116, 117, 'EVAAAA', 'MGDAAA', 'AAAAxx'),
+(9901, 2197, 1, 1, 1, 1, 1, 901, 1901, 4901, 9901, 2, 3, 'VQAAAA', 'NGDAAA', 'HHHHxx'),
+(8478, 2198, 0, 2, 8, 18, 78, 478, 478, 3478, 8478, 156, 157, 'COAAAA', 'OGDAAA', 'OOOOxx'),
+(6545, 2199, 1, 1, 5, 5, 45, 545, 545, 1545, 6545, 90, 91, 'TRAAAA', 'PGDAAA', 'VVVVxx'),
+(1479, 2200, 1, 3, 9, 19, 79, 479, 1479, 1479, 1479, 158, 159, 'XEAAAA', 'QGDAAA', 'AAAAxx'),
+(1046, 2201, 0, 2, 6, 6, 46, 46, 1046, 1046, 1046, 92, 93, 'GOAAAA', 'RGDAAA', 'HHHHxx'),
+(6372, 2202, 0, 0, 2, 12, 72, 372, 372, 1372, 6372, 144, 145, 'CLAAAA', 'SGDAAA', 'OOOOxx'),
+(8206, 2203, 0, 2, 6, 6, 6, 206, 206, 3206, 8206, 12, 13, 'QDAAAA', 'TGDAAA', 'VVVVxx'),
+(9544, 2204, 0, 0, 4, 4, 44, 544, 1544, 4544, 9544, 88, 89, 'CDAAAA', 'UGDAAA', 'AAAAxx'),
+(9287, 2205, 1, 3, 7, 7, 87, 287, 1287, 4287, 9287, 174, 175, 'FTAAAA', 'VGDAAA', 'HHHHxx'),
+(6786, 2206, 0, 2, 6, 6, 86, 786, 786, 1786, 6786, 172, 173, 'ABAAAA', 'WGDAAA', 'OOOOxx'),
+(6511, 2207, 1, 3, 1, 11, 11, 511, 511, 1511, 6511, 22, 23, 'LQAAAA', 'XGDAAA', 'VVVVxx'),
+(603, 2208, 1, 3, 3, 3, 3, 603, 603, 603, 603, 6, 7, 'FXAAAA', 'YGDAAA', 'AAAAxx'),
+(2022, 2209, 0, 2, 2, 2, 22, 22, 22, 2022, 2022, 44, 45, 'UZAAAA', 'ZGDAAA', 'HHHHxx'),
+(2086, 2210, 0, 2, 6, 6, 86, 86, 86, 2086, 2086, 172, 173, 'GCAAAA', 'AHDAAA', 'OOOOxx'),
+(1969, 2211, 1, 1, 9, 9, 69, 969, 1969, 1969, 1969, 138, 139, 'TXAAAA', 'BHDAAA', 'VVVVxx'),
+(4841, 2212, 1, 1, 1, 1, 41, 841, 841, 4841, 4841, 82, 83, 'FEAAAA', 'CHDAAA', 'AAAAxx'),
+(5845, 2213, 1, 1, 5, 5, 45, 845, 1845, 845, 5845, 90, 91, 'VQAAAA', 'DHDAAA', 'HHHHxx'),
+(4635, 2214, 1, 3, 5, 15, 35, 635, 635, 4635, 4635, 70, 71, 'HWAAAA', 'EHDAAA', 'OOOOxx'),
+(4658, 2215, 0, 2, 8, 18, 58, 658, 658, 4658, 4658, 116, 117, 'EXAAAA', 'FHDAAA', 'VVVVxx'),
+(2896, 2216, 0, 0, 6, 16, 96, 896, 896, 2896, 2896, 192, 193, 'KHAAAA', 'GHDAAA', 'AAAAxx'),
+(5179, 2217, 1, 3, 9, 19, 79, 179, 1179, 179, 5179, 158, 159, 'FRAAAA', 'HHDAAA', 'HHHHxx'),
+(8667, 2218, 1, 3, 7, 7, 67, 667, 667, 3667, 8667, 134, 135, 'JVAAAA', 'IHDAAA', 'OOOOxx'),
+(7294, 2219, 0, 2, 4, 14, 94, 294, 1294, 2294, 7294, 188, 189, 'OUAAAA', 'JHDAAA', 'VVVVxx'),
+(3706, 2220, 0, 2, 6, 6, 6, 706, 1706, 3706, 3706, 12, 13, 'OMAAAA', 'KHDAAA', 'AAAAxx'),
+(8389, 2221, 1, 1, 9, 9, 89, 389, 389, 3389, 8389, 178, 179, 'RKAAAA', 'LHDAAA', 'HHHHxx'),
+(2486, 2222, 0, 2, 6, 6, 86, 486, 486, 2486, 2486, 172, 173, 'QRAAAA', 'MHDAAA', 'OOOOxx'),
+(8743, 2223, 1, 3, 3, 3, 43, 743, 743, 3743, 8743, 86, 87, 'HYAAAA', 'NHDAAA', 'VVVVxx'),
+(2777, 2224, 1, 1, 7, 17, 77, 777, 777, 2777, 2777, 154, 155, 'VCAAAA', 'OHDAAA', 'AAAAxx'),
+(2113, 2225, 1, 1, 3, 13, 13, 113, 113, 2113, 2113, 26, 27, 'HDAAAA', 'PHDAAA', 'HHHHxx'),
+(2076, 2226, 0, 0, 6, 16, 76, 76, 76, 2076, 2076, 152, 153, 'WBAAAA', 'QHDAAA', 'OOOOxx'),
+(2300, 2227, 0, 0, 0, 0, 0, 300, 300, 2300, 2300, 0, 1, 'MKAAAA', 'RHDAAA', 'VVVVxx'),
+(6894, 2228, 0, 2, 4, 14, 94, 894, 894, 1894, 6894, 188, 189, 'EFAAAA', 'SHDAAA', 'AAAAxx'),
+(6939, 2229, 1, 3, 9, 19, 39, 939, 939, 1939, 6939, 78, 79, 'XGAAAA', 'THDAAA', 'HHHHxx'),
+(446, 2230, 0, 2, 6, 6, 46, 446, 446, 446, 446, 92, 93, 'ERAAAA', 'UHDAAA', 'OOOOxx'),
+(6218, 2231, 0, 2, 8, 18, 18, 218, 218, 1218, 6218, 36, 37, 'EFAAAA', 'VHDAAA', 'VVVVxx'),
+(1295, 2232, 1, 3, 5, 15, 95, 295, 1295, 1295, 1295, 190, 191, 'VXAAAA', 'WHDAAA', 'AAAAxx'),
+(5135, 2233, 1, 3, 5, 15, 35, 135, 1135, 135, 5135, 70, 71, 'NPAAAA', 'XHDAAA', 'HHHHxx'),
+(8122, 2234, 0, 2, 2, 2, 22, 122, 122, 3122, 8122, 44, 45, 'KAAAAA', 'YHDAAA', 'OOOOxx'),
+(316, 2235, 0, 0, 6, 16, 16, 316, 316, 316, 316, 32, 33, 'EMAAAA', 'ZHDAAA', 'VVVVxx'),
+(514, 2236, 0, 2, 4, 14, 14, 514, 514, 514, 514, 28, 29, 'UTAAAA', 'AIDAAA', 'AAAAxx'),
+(7970, 2237, 0, 2, 0, 10, 70, 970, 1970, 2970, 7970, 140, 141, 'OUAAAA', 'BIDAAA', 'HHHHxx'),
+(9350, 2238, 0, 2, 0, 10, 50, 350, 1350, 4350, 9350, 100, 101, 'QVAAAA', 'CIDAAA', 'OOOOxx'),
+(3700, 2239, 0, 0, 0, 0, 0, 700, 1700, 3700, 3700, 0, 1, 'IMAAAA', 'DIDAAA', 'VVVVxx'),
+(582, 2240, 0, 2, 2, 2, 82, 582, 582, 582, 582, 164, 165, 'KWAAAA', 'EIDAAA', 'AAAAxx'),
+(9722, 2241, 0, 2, 2, 2, 22, 722, 1722, 4722, 9722, 44, 45, 'YJAAAA', 'FIDAAA', 'HHHHxx'),
+(7398, 2242, 0, 2, 8, 18, 98, 398, 1398, 2398, 7398, 196, 197, 'OYAAAA', 'GIDAAA', 'OOOOxx'),
+(2265, 2243, 1, 1, 5, 5, 65, 265, 265, 2265, 2265, 130, 131, 'DJAAAA', 'HIDAAA', 'VVVVxx'),
+(3049, 2244, 1, 1, 9, 9, 49, 49, 1049, 3049, 3049, 98, 99, 'HNAAAA', 'IIDAAA', 'AAAAxx'),
+(9121, 2245, 1, 1, 1, 1, 21, 121, 1121, 4121, 9121, 42, 43, 'VMAAAA', 'JIDAAA', 'HHHHxx'),
+(4275, 2246, 1, 3, 5, 15, 75, 275, 275, 4275, 4275, 150, 151, 'LIAAAA', 'KIDAAA', 'OOOOxx'),
+(6567, 2247, 1, 3, 7, 7, 67, 567, 567, 1567, 6567, 134, 135, 'PSAAAA', 'LIDAAA', 'VVVVxx'),
+(6755, 2248, 1, 3, 5, 15, 55, 755, 755, 1755, 6755, 110, 111, 'VZAAAA', 'MIDAAA', 'AAAAxx'),
+(4535, 2249, 1, 3, 5, 15, 35, 535, 535, 4535, 4535, 70, 71, 'LSAAAA', 'NIDAAA', 'HHHHxx'),
+(7968, 2250, 0, 0, 8, 8, 68, 968, 1968, 2968, 7968, 136, 137, 'MUAAAA', 'OIDAAA', 'OOOOxx'),
+(3412, 2251, 0, 0, 2, 12, 12, 412, 1412, 3412, 3412, 24, 25, 'GBAAAA', 'PIDAAA', 'VVVVxx'),
+(6112, 2252, 0, 0, 2, 12, 12, 112, 112, 1112, 6112, 24, 25, 'CBAAAA', 'QIDAAA', 'AAAAxx'),
+(6805, 2253, 1, 1, 5, 5, 5, 805, 805, 1805, 6805, 10, 11, 'TBAAAA', 'RIDAAA', 'HHHHxx'),
+(2880, 2254, 0, 0, 0, 0, 80, 880, 880, 2880, 2880, 160, 161, 'UGAAAA', 'SIDAAA', 'OOOOxx'),
+(7710, 2255, 0, 2, 0, 10, 10, 710, 1710, 2710, 7710, 20, 21, 'OKAAAA', 'TIDAAA', 'VVVVxx'),
+(7949, 2256, 1, 1, 9, 9, 49, 949, 1949, 2949, 7949, 98, 99, 'TTAAAA', 'UIDAAA', 'AAAAxx'),
+(7043, 2257, 1, 3, 3, 3, 43, 43, 1043, 2043, 7043, 86, 87, 'XKAAAA', 'VIDAAA', 'HHHHxx'),
+(9012, 2258, 0, 0, 2, 12, 12, 12, 1012, 4012, 9012, 24, 25, 'QIAAAA', 'WIDAAA', 'OOOOxx'),
+(878, 2259, 0, 2, 8, 18, 78, 878, 878, 878, 878, 156, 157, 'UHAAAA', 'XIDAAA', 'VVVVxx'),
+(7930, 2260, 0, 2, 0, 10, 30, 930, 1930, 2930, 7930, 60, 61, 'ATAAAA', 'YIDAAA', 'AAAAxx'),
+(667, 2261, 1, 3, 7, 7, 67, 667, 667, 667, 667, 134, 135, 'RZAAAA', 'ZIDAAA', 'HHHHxx'),
+(1905, 2262, 1, 1, 5, 5, 5, 905, 1905, 1905, 1905, 10, 11, 'HVAAAA', 'AJDAAA', 'OOOOxx'),
+(4958, 2263, 0, 2, 8, 18, 58, 958, 958, 4958, 4958, 116, 117, 'SIAAAA', 'BJDAAA', 'VVVVxx'),
+(2973, 2264, 1, 1, 3, 13, 73, 973, 973, 2973, 2973, 146, 147, 'JKAAAA', 'CJDAAA', 'AAAAxx'),
+(3631, 2265, 1, 3, 1, 11, 31, 631, 1631, 3631, 3631, 62, 63, 'RJAAAA', 'DJDAAA', 'HHHHxx'),
+(5868, 2266, 0, 0, 8, 8, 68, 868, 1868, 868, 5868, 136, 137, 'SRAAAA', 'EJDAAA', 'OOOOxx'),
+(2873, 2267, 1, 1, 3, 13, 73, 873, 873, 2873, 2873, 146, 147, 'NGAAAA', 'FJDAAA', 'VVVVxx'),
+(6941, 2268, 1, 1, 1, 1, 41, 941, 941, 1941, 6941, 82, 83, 'ZGAAAA', 'GJDAAA', 'AAAAxx'),
+(6384, 2269, 0, 0, 4, 4, 84, 384, 384, 1384, 6384, 168, 169, 'OLAAAA', 'HJDAAA', 'HHHHxx'),
+(3806, 2270, 0, 2, 6, 6, 6, 806, 1806, 3806, 3806, 12, 13, 'KQAAAA', 'IJDAAA', 'OOOOxx'),
+(5079, 2271, 1, 3, 9, 19, 79, 79, 1079, 79, 5079, 158, 159, 'JNAAAA', 'JJDAAA', 'VVVVxx'),
+(1970, 2272, 0, 2, 0, 10, 70, 970, 1970, 1970, 1970, 140, 141, 'UXAAAA', 'KJDAAA', 'AAAAxx'),
+(7810, 2273, 0, 2, 0, 10, 10, 810, 1810, 2810, 7810, 20, 21, 'KOAAAA', 'LJDAAA', 'HHHHxx'),
+(4639, 2274, 1, 3, 9, 19, 39, 639, 639, 4639, 4639, 78, 79, 'LWAAAA', 'MJDAAA', 'OOOOxx'),
+(6527, 2275, 1, 3, 7, 7, 27, 527, 527, 1527, 6527, 54, 55, 'BRAAAA', 'NJDAAA', 'VVVVxx'),
+(8079, 2276, 1, 3, 9, 19, 79, 79, 79, 3079, 8079, 158, 159, 'TYAAAA', 'OJDAAA', 'AAAAxx'),
+(2740, 2277, 0, 0, 0, 0, 40, 740, 740, 2740, 2740, 80, 81, 'KBAAAA', 'PJDAAA', 'HHHHxx'),
+(2337, 2278, 1, 1, 7, 17, 37, 337, 337, 2337, 2337, 74, 75, 'XLAAAA', 'QJDAAA', 'OOOOxx'),
+(6670, 2279, 0, 2, 0, 10, 70, 670, 670, 1670, 6670, 140, 141, 'OWAAAA', 'RJDAAA', 'VVVVxx'),
+(2345, 2280, 1, 1, 5, 5, 45, 345, 345, 2345, 2345, 90, 91, 'FMAAAA', 'SJDAAA', 'AAAAxx'),
+(401, 2281, 1, 1, 1, 1, 1, 401, 401, 401, 401, 2, 3, 'LPAAAA', 'TJDAAA', 'HHHHxx'),
+(2704, 2282, 0, 0, 4, 4, 4, 704, 704, 2704, 2704, 8, 9, 'AAAAAA', 'UJDAAA', 'OOOOxx'),
+(5530, 2283, 0, 2, 0, 10, 30, 530, 1530, 530, 5530, 60, 61, 'SEAAAA', 'VJDAAA', 'VVVVxx'),
+(51, 2284, 1, 3, 1, 11, 51, 51, 51, 51, 51, 102, 103, 'ZBAAAA', 'WJDAAA', 'AAAAxx'),
+(4282, 2285, 0, 2, 2, 2, 82, 282, 282, 4282, 4282, 164, 165, 'SIAAAA', 'XJDAAA', 'HHHHxx'),
+(7336, 2286, 0, 0, 6, 16, 36, 336, 1336, 2336, 7336, 72, 73, 'EWAAAA', 'YJDAAA', 'OOOOxx'),
+(8320, 2287, 0, 0, 0, 0, 20, 320, 320, 3320, 8320, 40, 41, 'AIAAAA', 'ZJDAAA', 'VVVVxx'),
+(7772, 2288, 0, 0, 2, 12, 72, 772, 1772, 2772, 7772, 144, 145, 'YMAAAA', 'AKDAAA', 'AAAAxx'),
+(1894, 2289, 0, 2, 4, 14, 94, 894, 1894, 1894, 1894, 188, 189, 'WUAAAA', 'BKDAAA', 'HHHHxx'),
+(2320, 2290, 0, 0, 0, 0, 20, 320, 320, 2320, 2320, 40, 41, 'GLAAAA', 'CKDAAA', 'OOOOxx'),
+(6232, 2291, 0, 0, 2, 12, 32, 232, 232, 1232, 6232, 64, 65, 'SFAAAA', 'DKDAAA', 'VVVVxx'),
+(2833, 2292, 1, 1, 3, 13, 33, 833, 833, 2833, 2833, 66, 67, 'ZEAAAA', 'EKDAAA', 'AAAAxx'),
+(8265, 2293, 1, 1, 5, 5, 65, 265, 265, 3265, 8265, 130, 131, 'XFAAAA', 'FKDAAA', 'HHHHxx'),
+(4589, 2294, 1, 1, 9, 9, 89, 589, 589, 4589, 4589, 178, 179, 'NUAAAA', 'GKDAAA', 'OOOOxx'),
+(8182, 2295, 0, 2, 2, 2, 82, 182, 182, 3182, 8182, 164, 165, 'SCAAAA', 'HKDAAA', 'VVVVxx'),
+(8337, 2296, 1, 1, 7, 17, 37, 337, 337, 3337, 8337, 74, 75, 'RIAAAA', 'IKDAAA', 'AAAAxx'),
+(8210, 2297, 0, 2, 0, 10, 10, 210, 210, 3210, 8210, 20, 21, 'UDAAAA', 'JKDAAA', 'HHHHxx'),
+(1406, 2298, 0, 2, 6, 6, 6, 406, 1406, 1406, 1406, 12, 13, 'CCAAAA', 'KKDAAA', 'OOOOxx'),
+(4463, 2299, 1, 3, 3, 3, 63, 463, 463, 4463, 4463, 126, 127, 'RPAAAA', 'LKDAAA', 'VVVVxx'),
+(4347, 2300, 1, 3, 7, 7, 47, 347, 347, 4347, 4347, 94, 95, 'FLAAAA', 'MKDAAA', 'AAAAxx'),
+(181, 2301, 1, 1, 1, 1, 81, 181, 181, 181, 181, 162, 163, 'ZGAAAA', 'NKDAAA', 'HHHHxx'),
+(9986, 2302, 0, 2, 6, 6, 86, 986, 1986, 4986, 9986, 172, 173, 'CUAAAA', 'OKDAAA', 'OOOOxx'),
+(661, 2303, 1, 1, 1, 1, 61, 661, 661, 661, 661, 122, 123, 'LZAAAA', 'PKDAAA', 'VVVVxx'),
+(4105, 2304, 1, 1, 5, 5, 5, 105, 105, 4105, 4105, 10, 11, 'XBAAAA', 'QKDAAA', 'AAAAxx'),
+(2187, 2305, 1, 3, 7, 7, 87, 187, 187, 2187, 2187, 174, 175, 'DGAAAA', 'RKDAAA', 'HHHHxx'),
+(1628, 2306, 0, 0, 8, 8, 28, 628, 1628, 1628, 1628, 56, 57, 'QKAAAA', 'SKDAAA', 'OOOOxx'),
+(3119, 2307, 1, 3, 9, 19, 19, 119, 1119, 3119, 3119, 38, 39, 'ZPAAAA', 'TKDAAA', 'VVVVxx'),
+(6804, 2308, 0, 0, 4, 4, 4, 804, 804, 1804, 6804, 8, 9, 'SBAAAA', 'UKDAAA', 'AAAAxx'),
+(9918, 2309, 0, 2, 8, 18, 18, 918, 1918, 4918, 9918, 36, 37, 'MRAAAA', 'VKDAAA', 'HHHHxx'),
+(8916, 2310, 0, 0, 6, 16, 16, 916, 916, 3916, 8916, 32, 33, 'YEAAAA', 'WKDAAA', 'OOOOxx'),
+(6057, 2311, 1, 1, 7, 17, 57, 57, 57, 1057, 6057, 114, 115, 'ZYAAAA', 'XKDAAA', 'VVVVxx'),
+(3622, 2312, 0, 2, 2, 2, 22, 622, 1622, 3622, 3622, 44, 45, 'IJAAAA', 'YKDAAA', 'AAAAxx'),
+(9168, 2313, 0, 0, 8, 8, 68, 168, 1168, 4168, 9168, 136, 137, 'QOAAAA', 'ZKDAAA', 'HHHHxx'),
+(3720, 2314, 0, 0, 0, 0, 20, 720, 1720, 3720, 3720, 40, 41, 'CNAAAA', 'ALDAAA', 'OOOOxx'),
+(9927, 2315, 1, 3, 7, 7, 27, 927, 1927, 4927, 9927, 54, 55, 'VRAAAA', 'BLDAAA', 'VVVVxx'),
+(5616, 2316, 0, 0, 6, 16, 16, 616, 1616, 616, 5616, 32, 33, 'AIAAAA', 'CLDAAA', 'AAAAxx'),
+(5210, 2317, 0, 2, 0, 10, 10, 210, 1210, 210, 5210, 20, 21, 'KSAAAA', 'DLDAAA', 'HHHHxx'),
+(636, 2318, 0, 0, 6, 16, 36, 636, 636, 636, 636, 72, 73, 'MYAAAA', 'ELDAAA', 'OOOOxx'),
+(9936, 2319, 0, 0, 6, 16, 36, 936, 1936, 4936, 9936, 72, 73, 'ESAAAA', 'FLDAAA', 'VVVVxx'),
+(2316, 2320, 0, 0, 6, 16, 16, 316, 316, 2316, 2316, 32, 33, 'CLAAAA', 'GLDAAA', 'AAAAxx'),
+(4363, 2321, 1, 3, 3, 3, 63, 363, 363, 4363, 4363, 126, 127, 'VLAAAA', 'HLDAAA', 'HHHHxx'),
+(7657, 2322, 1, 1, 7, 17, 57, 657, 1657, 2657, 7657, 114, 115, 'NIAAAA', 'ILDAAA', 'OOOOxx'),
+(697, 2323, 1, 1, 7, 17, 97, 697, 697, 697, 697, 194, 195, 'VAAAAA', 'JLDAAA', 'VVVVxx'),
+(912, 2324, 0, 0, 2, 12, 12, 912, 912, 912, 912, 24, 25, 'CJAAAA', 'KLDAAA', 'AAAAxx'),
+(8806, 2325, 0, 2, 6, 6, 6, 806, 806, 3806, 8806, 12, 13, 'SAAAAA', 'LLDAAA', 'HHHHxx'),
+(9698, 2326, 0, 2, 8, 18, 98, 698, 1698, 4698, 9698, 196, 197, 'AJAAAA', 'MLDAAA', 'OOOOxx'),
+(6191, 2327, 1, 3, 1, 11, 91, 191, 191, 1191, 6191, 182, 183, 'DEAAAA', 'NLDAAA', 'VVVVxx'),
+(1188, 2328, 0, 0, 8, 8, 88, 188, 1188, 1188, 1188, 176, 177, 'STAAAA', 'OLDAAA', 'AAAAxx'),
+(7676, 2329, 0, 0, 6, 16, 76, 676, 1676, 2676, 7676, 152, 153, 'GJAAAA', 'PLDAAA', 'HHHHxx'),
+(7073, 2330, 1, 1, 3, 13, 73, 73, 1073, 2073, 7073, 146, 147, 'BMAAAA', 'QLDAAA', 'OOOOxx'),
+(8019, 2331, 1, 3, 9, 19, 19, 19, 19, 3019, 8019, 38, 39, 'LWAAAA', 'RLDAAA', 'VVVVxx'),
+(4726, 2332, 0, 2, 6, 6, 26, 726, 726, 4726, 4726, 52, 53, 'UZAAAA', 'SLDAAA', 'AAAAxx'),
+(4648, 2333, 0, 0, 8, 8, 48, 648, 648, 4648, 4648, 96, 97, 'UWAAAA', 'TLDAAA', 'HHHHxx'),
+(3227, 2334, 1, 3, 7, 7, 27, 227, 1227, 3227, 3227, 54, 55, 'DUAAAA', 'ULDAAA', 'OOOOxx'),
+(7232, 2335, 0, 0, 2, 12, 32, 232, 1232, 2232, 7232, 64, 65, 'ESAAAA', 'VLDAAA', 'VVVVxx'),
+(9761, 2336, 1, 1, 1, 1, 61, 761, 1761, 4761, 9761, 122, 123, 'LLAAAA', 'WLDAAA', 'AAAAxx'),
+(3105, 2337, 1, 1, 5, 5, 5, 105, 1105, 3105, 3105, 10, 11, 'LPAAAA', 'XLDAAA', 'HHHHxx'),
+(5266, 2338, 0, 2, 6, 6, 66, 266, 1266, 266, 5266, 132, 133, 'OUAAAA', 'YLDAAA', 'OOOOxx'),
+(6788, 2339, 0, 0, 8, 8, 88, 788, 788, 1788, 6788, 176, 177, 'CBAAAA', 'ZLDAAA', 'VVVVxx'),
+(2442, 2340, 0, 2, 2, 2, 42, 442, 442, 2442, 2442, 84, 85, 'YPAAAA', 'AMDAAA', 'AAAAxx'),
+(8198, 2341, 0, 2, 8, 18, 98, 198, 198, 3198, 8198, 196, 197, 'IDAAAA', 'BMDAAA', 'HHHHxx'),
+(5806, 2342, 0, 2, 6, 6, 6, 806, 1806, 806, 5806, 12, 13, 'IPAAAA', 'CMDAAA', 'OOOOxx'),
+(8928, 2343, 0, 0, 8, 8, 28, 928, 928, 3928, 8928, 56, 57, 'KFAAAA', 'DMDAAA', 'VVVVxx'),
+(1657, 2344, 1, 1, 7, 17, 57, 657, 1657, 1657, 1657, 114, 115, 'TLAAAA', 'EMDAAA', 'AAAAxx'),
+(9164, 2345, 0, 0, 4, 4, 64, 164, 1164, 4164, 9164, 128, 129, 'MOAAAA', 'FMDAAA', 'HHHHxx'),
+(1851, 2346, 1, 3, 1, 11, 51, 851, 1851, 1851, 1851, 102, 103, 'FTAAAA', 'GMDAAA', 'OOOOxx'),
+(4744, 2347, 0, 0, 4, 4, 44, 744, 744, 4744, 4744, 88, 89, 'MAAAAA', 'HMDAAA', 'VVVVxx'),
+(8055, 2348, 1, 3, 5, 15, 55, 55, 55, 3055, 8055, 110, 111, 'VXAAAA', 'IMDAAA', 'AAAAxx'),
+(1533, 2349, 1, 1, 3, 13, 33, 533, 1533, 1533, 1533, 66, 67, 'ZGAAAA', 'JMDAAA', 'HHHHxx'),
+(1260, 2350, 0, 0, 0, 0, 60, 260, 1260, 1260, 1260, 120, 121, 'MWAAAA', 'KMDAAA', 'OOOOxx'),
+(1290, 2351, 0, 2, 0, 10, 90, 290, 1290, 1290, 1290, 180, 181, 'QXAAAA', 'LMDAAA', 'VVVVxx'),
+(297, 2352, 1, 1, 7, 17, 97, 297, 297, 297, 297, 194, 195, 'LLAAAA', 'MMDAAA', 'AAAAxx'),
+(4145, 2353, 1, 1, 5, 5, 45, 145, 145, 4145, 4145, 90, 91, 'LDAAAA', 'NMDAAA', 'HHHHxx'),
+(863, 2354, 1, 3, 3, 3, 63, 863, 863, 863, 863, 126, 127, 'FHAAAA', 'OMDAAA', 'OOOOxx'),
+(3423, 2355, 1, 3, 3, 3, 23, 423, 1423, 3423, 3423, 46, 47, 'RBAAAA', 'PMDAAA', 'VVVVxx'),
+(8750, 2356, 0, 2, 0, 10, 50, 750, 750, 3750, 8750, 100, 101, 'OYAAAA', 'QMDAAA', 'AAAAxx'),
+(3546, 2357, 0, 2, 6, 6, 46, 546, 1546, 3546, 3546, 92, 93, 'KGAAAA', 'RMDAAA', 'HHHHxx'),
+(3678, 2358, 0, 2, 8, 18, 78, 678, 1678, 3678, 3678, 156, 157, 'MLAAAA', 'SMDAAA', 'OOOOxx'),
+(5313, 2359, 1, 1, 3, 13, 13, 313, 1313, 313, 5313, 26, 27, 'JWAAAA', 'TMDAAA', 'VVVVxx'),
+(6233, 2360, 1, 1, 3, 13, 33, 233, 233, 1233, 6233, 66, 67, 'TFAAAA', 'UMDAAA', 'AAAAxx'),
+(5802, 2361, 0, 2, 2, 2, 2, 802, 1802, 802, 5802, 4, 5, 'EPAAAA', 'VMDAAA', 'HHHHxx'),
+(7059, 2362, 1, 3, 9, 19, 59, 59, 1059, 2059, 7059, 118, 119, 'NLAAAA', 'WMDAAA', 'OOOOxx'),
+(6481, 2363, 1, 1, 1, 1, 81, 481, 481, 1481, 6481, 162, 163, 'HPAAAA', 'XMDAAA', 'VVVVxx'),
+(1596, 2364, 0, 0, 6, 16, 96, 596, 1596, 1596, 1596, 192, 193, 'KJAAAA', 'YMDAAA', 'AAAAxx'),
+(8181, 2365, 1, 1, 1, 1, 81, 181, 181, 3181, 8181, 162, 163, 'RCAAAA', 'ZMDAAA', 'HHHHxx'),
+(5368, 2366, 0, 0, 8, 8, 68, 368, 1368, 368, 5368, 136, 137, 'MYAAAA', 'ANDAAA', 'OOOOxx'),
+(9416, 2367, 0, 0, 6, 16, 16, 416, 1416, 4416, 9416, 32, 33, 'EYAAAA', 'BNDAAA', 'VVVVxx'),
+(9521, 2368, 1, 1, 1, 1, 21, 521, 1521, 4521, 9521, 42, 43, 'FCAAAA', 'CNDAAA', 'AAAAxx'),
+(1042, 2369, 0, 2, 2, 2, 42, 42, 1042, 1042, 1042, 84, 85, 'COAAAA', 'DNDAAA', 'HHHHxx'),
+(4503, 2370, 1, 3, 3, 3, 3, 503, 503, 4503, 4503, 6, 7, 'FRAAAA', 'ENDAAA', 'OOOOxx'),
+(3023, 2371, 1, 3, 3, 3, 23, 23, 1023, 3023, 3023, 46, 47, 'HMAAAA', 'FNDAAA', 'VVVVxx'),
+(1976, 2372, 0, 0, 6, 16, 76, 976, 1976, 1976, 1976, 152, 153, 'AYAAAA', 'GNDAAA', 'AAAAxx'),
+(5610, 2373, 0, 2, 0, 10, 10, 610, 1610, 610, 5610, 20, 21, 'UHAAAA', 'HNDAAA', 'HHHHxx'),
+(7410, 2374, 0, 2, 0, 10, 10, 410, 1410, 2410, 7410, 20, 21, 'AZAAAA', 'INDAAA', 'OOOOxx'),
+(7872, 2375, 0, 0, 2, 12, 72, 872, 1872, 2872, 7872, 144, 145, 'UQAAAA', 'JNDAAA', 'VVVVxx'),
+(8591, 2376, 1, 3, 1, 11, 91, 591, 591, 3591, 8591, 182, 183, 'LSAAAA', 'KNDAAA', 'AAAAxx'),
+(1804, 2377, 0, 0, 4, 4, 4, 804, 1804, 1804, 1804, 8, 9, 'KRAAAA', 'LNDAAA', 'HHHHxx'),
+(5299, 2378, 1, 3, 9, 19, 99, 299, 1299, 299, 5299, 198, 199, 'VVAAAA', 'MNDAAA', 'OOOOxx'),
+(4695, 2379, 1, 3, 5, 15, 95, 695, 695, 4695, 4695, 190, 191, 'PYAAAA', 'NNDAAA', 'VVVVxx'),
+(2672, 2380, 0, 0, 2, 12, 72, 672, 672, 2672, 2672, 144, 145, 'UYAAAA', 'ONDAAA', 'AAAAxx'),
+(585, 2381, 1, 1, 5, 5, 85, 585, 585, 585, 585, 170, 171, 'NWAAAA', 'PNDAAA', 'HHHHxx'),
+(8622, 2382, 0, 2, 2, 2, 22, 622, 622, 3622, 8622, 44, 45, 'QTAAAA', 'QNDAAA', 'OOOOxx'),
+(3780, 2383, 0, 0, 0, 0, 80, 780, 1780, 3780, 3780, 160, 161, 'KPAAAA', 'RNDAAA', 'VVVVxx'),
+(7941, 2384, 1, 1, 1, 1, 41, 941, 1941, 2941, 7941, 82, 83, 'LTAAAA', 'SNDAAA', 'AAAAxx'),
+(3305, 2385, 1, 1, 5, 5, 5, 305, 1305, 3305, 3305, 10, 11, 'DXAAAA', 'TNDAAA', 'HHHHxx'),
+(8653, 2386, 1, 1, 3, 13, 53, 653, 653, 3653, 8653, 106, 107, 'VUAAAA', 'UNDAAA', 'OOOOxx'),
+(5756, 2387, 0, 0, 6, 16, 56, 756, 1756, 756, 5756, 112, 113, 'KNAAAA', 'VNDAAA', 'VVVVxx'),
+(576, 2388, 0, 0, 6, 16, 76, 576, 576, 576, 576, 152, 153, 'EWAAAA', 'WNDAAA', 'AAAAxx'),
+(1915, 2389, 1, 3, 5, 15, 15, 915, 1915, 1915, 1915, 30, 31, 'RVAAAA', 'XNDAAA', 'HHHHxx'),
+(4627, 2390, 1, 3, 7, 7, 27, 627, 627, 4627, 4627, 54, 55, 'ZVAAAA', 'YNDAAA', 'OOOOxx'),
+(920, 2391, 0, 0, 0, 0, 20, 920, 920, 920, 920, 40, 41, 'KJAAAA', 'ZNDAAA', 'VVVVxx'),
+(2537, 2392, 1, 1, 7, 17, 37, 537, 537, 2537, 2537, 74, 75, 'PTAAAA', 'AODAAA', 'AAAAxx'),
+(50, 2393, 0, 2, 0, 10, 50, 50, 50, 50, 50, 100, 101, 'YBAAAA', 'BODAAA', 'HHHHxx'),
+(1313, 2394, 1, 1, 3, 13, 13, 313, 1313, 1313, 1313, 26, 27, 'NYAAAA', 'CODAAA', 'OOOOxx'),
+(8542, 2395, 0, 2, 2, 2, 42, 542, 542, 3542, 8542, 84, 85, 'OQAAAA', 'DODAAA', 'VVVVxx'),
+(6428, 2396, 0, 0, 8, 8, 28, 428, 428, 1428, 6428, 56, 57, 'GNAAAA', 'EODAAA', 'AAAAxx'),
+(4351, 2397, 1, 3, 1, 11, 51, 351, 351, 4351, 4351, 102, 103, 'JLAAAA', 'FODAAA', 'HHHHxx'),
+(2050, 2398, 0, 2, 0, 10, 50, 50, 50, 2050, 2050, 100, 101, 'WAAAAA', 'GODAAA', 'OOOOxx'),
+(5162, 2399, 0, 2, 2, 2, 62, 162, 1162, 162, 5162, 124, 125, 'OQAAAA', 'HODAAA', 'VVVVxx'),
+(8229, 2400, 1, 1, 9, 9, 29, 229, 229, 3229, 8229, 58, 59, 'NEAAAA', 'IODAAA', 'AAAAxx'),
+(7782, 2401, 0, 2, 2, 2, 82, 782, 1782, 2782, 7782, 164, 165, 'INAAAA', 'JODAAA', 'HHHHxx'),
+(1563, 2402, 1, 3, 3, 3, 63, 563, 1563, 1563, 1563, 126, 127, 'DIAAAA', 'KODAAA', 'OOOOxx'),
+(267, 2403, 1, 3, 7, 7, 67, 267, 267, 267, 267, 134, 135, 'HKAAAA', 'LODAAA', 'VVVVxx'),
+(5138, 2404, 0, 2, 8, 18, 38, 138, 1138, 138, 5138, 76, 77, 'QPAAAA', 'MODAAA', 'AAAAxx'),
+(7022, 2405, 0, 2, 2, 2, 22, 22, 1022, 2022, 7022, 44, 45, 'CKAAAA', 'NODAAA', 'HHHHxx'),
+(6705, 2406, 1, 1, 5, 5, 5, 705, 705, 1705, 6705, 10, 11, 'XXAAAA', 'OODAAA', 'OOOOxx'),
+(6190, 2407, 0, 2, 0, 10, 90, 190, 190, 1190, 6190, 180, 181, 'CEAAAA', 'PODAAA', 'VVVVxx'),
+(8226, 2408, 0, 2, 6, 6, 26, 226, 226, 3226, 8226, 52, 53, 'KEAAAA', 'QODAAA', 'AAAAxx'),
+(8882, 2409, 0, 2, 2, 2, 82, 882, 882, 3882, 8882, 164, 165, 'QDAAAA', 'RODAAA', 'HHHHxx'),
+(5181, 2410, 1, 1, 1, 1, 81, 181, 1181, 181, 5181, 162, 163, 'HRAAAA', 'SODAAA', 'OOOOxx'),
+(4598, 2411, 0, 2, 8, 18, 98, 598, 598, 4598, 4598, 196, 197, 'WUAAAA', 'TODAAA', 'VVVVxx'),
+(4882, 2412, 0, 2, 2, 2, 82, 882, 882, 4882, 4882, 164, 165, 'UFAAAA', 'UODAAA', 'AAAAxx'),
+(7490, 2413, 0, 2, 0, 10, 90, 490, 1490, 2490, 7490, 180, 181, 'CCAAAA', 'VODAAA', 'HHHHxx'),
+(5224, 2414, 0, 0, 4, 4, 24, 224, 1224, 224, 5224, 48, 49, 'YSAAAA', 'WODAAA', 'OOOOxx'),
+(2174, 2415, 0, 2, 4, 14, 74, 174, 174, 2174, 2174, 148, 149, 'QFAAAA', 'XODAAA', 'VVVVxx'),
+(3059, 2416, 1, 3, 9, 19, 59, 59, 1059, 3059, 3059, 118, 119, 'RNAAAA', 'YODAAA', 'AAAAxx'),
+(8790, 2417, 0, 2, 0, 10, 90, 790, 790, 3790, 8790, 180, 181, 'CAAAAA', 'ZODAAA', 'HHHHxx'),
+(2222, 2418, 0, 2, 2, 2, 22, 222, 222, 2222, 2222, 44, 45, 'MHAAAA', 'APDAAA', 'OOOOxx'),
+(5473, 2419, 1, 1, 3, 13, 73, 473, 1473, 473, 5473, 146, 147, 'NCAAAA', 'BPDAAA', 'VVVVxx'),
+(937, 2420, 1, 1, 7, 17, 37, 937, 937, 937, 937, 74, 75, 'BKAAAA', 'CPDAAA', 'AAAAxx'),
+(2975, 2421, 1, 3, 5, 15, 75, 975, 975, 2975, 2975, 150, 151, 'LKAAAA', 'DPDAAA', 'HHHHxx'),
+(9569, 2422, 1, 1, 9, 9, 69, 569, 1569, 4569, 9569, 138, 139, 'BEAAAA', 'EPDAAA', 'OOOOxx'),
+(3456, 2423, 0, 0, 6, 16, 56, 456, 1456, 3456, 3456, 112, 113, 'YCAAAA', 'FPDAAA', 'VVVVxx'),
+(6657, 2424, 1, 1, 7, 17, 57, 657, 657, 1657, 6657, 114, 115, 'BWAAAA', 'GPDAAA', 'AAAAxx'),
+(3776, 2425, 0, 0, 6, 16, 76, 776, 1776, 3776, 3776, 152, 153, 'GPAAAA', 'HPDAAA', 'HHHHxx'),
+(6072, 2426, 0, 0, 2, 12, 72, 72, 72, 1072, 6072, 144, 145, 'OZAAAA', 'IPDAAA', 'OOOOxx'),
+(8129, 2427, 1, 1, 9, 9, 29, 129, 129, 3129, 8129, 58, 59, 'RAAAAA', 'JPDAAA', 'VVVVxx'),
+(1085, 2428, 1, 1, 5, 5, 85, 85, 1085, 1085, 1085, 170, 171, 'TPAAAA', 'KPDAAA', 'AAAAxx'),
+(2079, 2429, 1, 3, 9, 19, 79, 79, 79, 2079, 2079, 158, 159, 'ZBAAAA', 'LPDAAA', 'HHHHxx'),
+(1200, 2430, 0, 0, 0, 0, 0, 200, 1200, 1200, 1200, 0, 1, 'EUAAAA', 'MPDAAA', 'OOOOxx'),
+(3276, 2431, 0, 0, 6, 16, 76, 276, 1276, 3276, 3276, 152, 153, 'AWAAAA', 'NPDAAA', 'VVVVxx'),
+(2608, 2432, 0, 0, 8, 8, 8, 608, 608, 2608, 2608, 16, 17, 'IWAAAA', 'OPDAAA', 'AAAAxx'),
+(702, 2433, 0, 2, 2, 2, 2, 702, 702, 702, 702, 4, 5, 'ABAAAA', 'PPDAAA', 'HHHHxx'),
+(5750, 2434, 0, 2, 0, 10, 50, 750, 1750, 750, 5750, 100, 101, 'ENAAAA', 'QPDAAA', 'OOOOxx'),
+(2776, 2435, 0, 0, 6, 16, 76, 776, 776, 2776, 2776, 152, 153, 'UCAAAA', 'RPDAAA', 'VVVVxx'),
+(9151, 2436, 1, 3, 1, 11, 51, 151, 1151, 4151, 9151, 102, 103, 'ZNAAAA', 'SPDAAA', 'AAAAxx'),
+(3282, 2437, 0, 2, 2, 2, 82, 282, 1282, 3282, 3282, 164, 165, 'GWAAAA', 'TPDAAA', 'HHHHxx'),
+(408, 2438, 0, 0, 8, 8, 8, 408, 408, 408, 408, 16, 17, 'SPAAAA', 'UPDAAA', 'OOOOxx'),
+(3473, 2439, 1, 1, 3, 13, 73, 473, 1473, 3473, 3473, 146, 147, 'PDAAAA', 'VPDAAA', 'VVVVxx'),
+(7095, 2440, 1, 3, 5, 15, 95, 95, 1095, 2095, 7095, 190, 191, 'XMAAAA', 'WPDAAA', 'AAAAxx'),
+(3288, 2441, 0, 0, 8, 8, 88, 288, 1288, 3288, 3288, 176, 177, 'MWAAAA', 'XPDAAA', 'HHHHxx'),
+(8215, 2442, 1, 3, 5, 15, 15, 215, 215, 3215, 8215, 30, 31, 'ZDAAAA', 'YPDAAA', 'OOOOxx'),
+(6244, 2443, 0, 0, 4, 4, 44, 244, 244, 1244, 6244, 88, 89, 'EGAAAA', 'ZPDAAA', 'VVVVxx'),
+(8440, 2444, 0, 0, 0, 0, 40, 440, 440, 3440, 8440, 80, 81, 'QMAAAA', 'AQDAAA', 'AAAAxx'),
+(3800, 2445, 0, 0, 0, 0, 0, 800, 1800, 3800, 3800, 0, 1, 'EQAAAA', 'BQDAAA', 'HHHHxx'),
+(7279, 2446, 1, 3, 9, 19, 79, 279, 1279, 2279, 7279, 158, 159, 'ZTAAAA', 'CQDAAA', 'OOOOxx'),
+(9206, 2447, 0, 2, 6, 6, 6, 206, 1206, 4206, 9206, 12, 13, 'CQAAAA', 'DQDAAA', 'VVVVxx'),
+(6465, 2448, 1, 1, 5, 5, 65, 465, 465, 1465, 6465, 130, 131, 'ROAAAA', 'EQDAAA', 'AAAAxx'),
+(4127, 2449, 1, 3, 7, 7, 27, 127, 127, 4127, 4127, 54, 55, 'TCAAAA', 'FQDAAA', 'HHHHxx'),
+(7463, 2450, 1, 3, 3, 3, 63, 463, 1463, 2463, 7463, 126, 127, 'BBAAAA', 'GQDAAA', 'OOOOxx'),
+(5117, 2451, 1, 1, 7, 17, 17, 117, 1117, 117, 5117, 34, 35, 'VOAAAA', 'HQDAAA', 'VVVVxx'),
+(4715, 2452, 1, 3, 5, 15, 15, 715, 715, 4715, 4715, 30, 31, 'JZAAAA', 'IQDAAA', 'AAAAxx'),
+(2010, 2453, 0, 2, 0, 10, 10, 10, 10, 2010, 2010, 20, 21, 'IZAAAA', 'JQDAAA', 'HHHHxx'),
+(6486, 2454, 0, 2, 6, 6, 86, 486, 486, 1486, 6486, 172, 173, 'MPAAAA', 'KQDAAA', 'OOOOxx'),
+(6434, 2455, 0, 2, 4, 14, 34, 434, 434, 1434, 6434, 68, 69, 'MNAAAA', 'LQDAAA', 'VVVVxx'),
+(2151, 2456, 1, 3, 1, 11, 51, 151, 151, 2151, 2151, 102, 103, 'TEAAAA', 'MQDAAA', 'AAAAxx'),
+(4821, 2457, 1, 1, 1, 1, 21, 821, 821, 4821, 4821, 42, 43, 'LDAAAA', 'NQDAAA', 'HHHHxx'),
+(6507, 2458, 1, 3, 7, 7, 7, 507, 507, 1507, 6507, 14, 15, 'HQAAAA', 'OQDAAA', 'OOOOxx'),
+(8741, 2459, 1, 1, 1, 1, 41, 741, 741, 3741, 8741, 82, 83, 'FYAAAA', 'PQDAAA', 'VVVVxx'),
+(6846, 2460, 0, 2, 6, 6, 46, 846, 846, 1846, 6846, 92, 93, 'IDAAAA', 'QQDAAA', 'AAAAxx'),
+(4525, 2461, 1, 1, 5, 5, 25, 525, 525, 4525, 4525, 50, 51, 'BSAAAA', 'RQDAAA', 'HHHHxx'),
+(8299, 2462, 1, 3, 9, 19, 99, 299, 299, 3299, 8299, 198, 199, 'FHAAAA', 'SQDAAA', 'OOOOxx'),
+(5465, 2463, 1, 1, 5, 5, 65, 465, 1465, 465, 5465, 130, 131, 'FCAAAA', 'TQDAAA', 'VVVVxx'),
+(7206, 2464, 0, 2, 6, 6, 6, 206, 1206, 2206, 7206, 12, 13, 'ERAAAA', 'UQDAAA', 'AAAAxx'),
+(2616, 2465, 0, 0, 6, 16, 16, 616, 616, 2616, 2616, 32, 33, 'QWAAAA', 'VQDAAA', 'HHHHxx'),
+(4440, 2466, 0, 0, 0, 0, 40, 440, 440, 4440, 4440, 80, 81, 'UOAAAA', 'WQDAAA', 'OOOOxx'),
+(6109, 2467, 1, 1, 9, 9, 9, 109, 109, 1109, 6109, 18, 19, 'ZAAAAA', 'XQDAAA', 'VVVVxx'),
+(7905, 2468, 1, 1, 5, 5, 5, 905, 1905, 2905, 7905, 10, 11, 'BSAAAA', 'YQDAAA', 'AAAAxx'),
+(6498, 2469, 0, 2, 8, 18, 98, 498, 498, 1498, 6498, 196, 197, 'YPAAAA', 'ZQDAAA', 'HHHHxx'),
+(2034, 2470, 0, 2, 4, 14, 34, 34, 34, 2034, 2034, 68, 69, 'GAAAAA', 'ARDAAA', 'OOOOxx'),
+(7693, 2471, 1, 1, 3, 13, 93, 693, 1693, 2693, 7693, 186, 187, 'XJAAAA', 'BRDAAA', 'VVVVxx'),
+(7511, 2472, 1, 3, 1, 11, 11, 511, 1511, 2511, 7511, 22, 23, 'XCAAAA', 'CRDAAA', 'AAAAxx'),
+(7531, 2473, 1, 3, 1, 11, 31, 531, 1531, 2531, 7531, 62, 63, 'RDAAAA', 'DRDAAA', 'HHHHxx'),
+(6869, 2474, 1, 1, 9, 9, 69, 869, 869, 1869, 6869, 138, 139, 'FEAAAA', 'ERDAAA', 'OOOOxx'),
+(2763, 2475, 1, 3, 3, 3, 63, 763, 763, 2763, 2763, 126, 127, 'HCAAAA', 'FRDAAA', 'VVVVxx'),
+(575, 2476, 1, 3, 5, 15, 75, 575, 575, 575, 575, 150, 151, 'DWAAAA', 'GRDAAA', 'AAAAxx'),
+(8953, 2477, 1, 1, 3, 13, 53, 953, 953, 3953, 8953, 106, 107, 'JGAAAA', 'HRDAAA', 'HHHHxx'),
+(5833, 2478, 1, 1, 3, 13, 33, 833, 1833, 833, 5833, 66, 67, 'JQAAAA', 'IRDAAA', 'OOOOxx'),
+(9035, 2479, 1, 3, 5, 15, 35, 35, 1035, 4035, 9035, 70, 71, 'NJAAAA', 'JRDAAA', 'VVVVxx'),
+(9123, 2480, 1, 3, 3, 3, 23, 123, 1123, 4123, 9123, 46, 47, 'XMAAAA', 'KRDAAA', 'AAAAxx'),
+(206, 2481, 0, 2, 6, 6, 6, 206, 206, 206, 206, 12, 13, 'YHAAAA', 'LRDAAA', 'HHHHxx'),
+(4155, 2482, 1, 3, 5, 15, 55, 155, 155, 4155, 4155, 110, 111, 'VDAAAA', 'MRDAAA', 'OOOOxx'),
+(532, 2483, 0, 0, 2, 12, 32, 532, 532, 532, 532, 64, 65, 'MUAAAA', 'NRDAAA', 'VVVVxx'),
+(1370, 2484, 0, 2, 0, 10, 70, 370, 1370, 1370, 1370, 140, 141, 'SAAAAA', 'ORDAAA', 'AAAAxx'),
+(7656, 2485, 0, 0, 6, 16, 56, 656, 1656, 2656, 7656, 112, 113, 'MIAAAA', 'PRDAAA', 'HHHHxx'),
+(7735, 2486, 1, 3, 5, 15, 35, 735, 1735, 2735, 7735, 70, 71, 'NLAAAA', 'QRDAAA', 'OOOOxx'),
+(2118, 2487, 0, 2, 8, 18, 18, 118, 118, 2118, 2118, 36, 37, 'MDAAAA', 'RRDAAA', 'VVVVxx'),
+(6914, 2488, 0, 2, 4, 14, 14, 914, 914, 1914, 6914, 28, 29, 'YFAAAA', 'SRDAAA', 'AAAAxx'),
+(6277, 2489, 1, 1, 7, 17, 77, 277, 277, 1277, 6277, 154, 155, 'LHAAAA', 'TRDAAA', 'HHHHxx'),
+(6347, 2490, 1, 3, 7, 7, 47, 347, 347, 1347, 6347, 94, 95, 'DKAAAA', 'URDAAA', 'OOOOxx'),
+(4030, 2491, 0, 2, 0, 10, 30, 30, 30, 4030, 4030, 60, 61, 'AZAAAA', 'VRDAAA', 'VVVVxx'),
+(9673, 2492, 1, 1, 3, 13, 73, 673, 1673, 4673, 9673, 146, 147, 'BIAAAA', 'WRDAAA', 'AAAAxx'),
+(2015, 2493, 1, 3, 5, 15, 15, 15, 15, 2015, 2015, 30, 31, 'NZAAAA', 'XRDAAA', 'HHHHxx'),
+(1317, 2494, 1, 1, 7, 17, 17, 317, 1317, 1317, 1317, 34, 35, 'RYAAAA', 'YRDAAA', 'OOOOxx'),
+(404, 2495, 0, 0, 4, 4, 4, 404, 404, 404, 404, 8, 9, 'OPAAAA', 'ZRDAAA', 'VVVVxx'),
+(1604, 2496, 0, 0, 4, 4, 4, 604, 1604, 1604, 1604, 8, 9, 'SJAAAA', 'ASDAAA', 'AAAAxx'),
+(1912, 2497, 0, 0, 2, 12, 12, 912, 1912, 1912, 1912, 24, 25, 'OVAAAA', 'BSDAAA', 'HHHHxx'),
+(5727, 2498, 1, 3, 7, 7, 27, 727, 1727, 727, 5727, 54, 55, 'HMAAAA', 'CSDAAA', 'OOOOxx'),
+(4538, 2499, 0, 2, 8, 18, 38, 538, 538, 4538, 4538, 76, 77, 'OSAAAA', 'DSDAAA', 'VVVVxx'),
+(6868, 2500, 0, 0, 8, 8, 68, 868, 868, 1868, 6868, 136, 137, 'EEAAAA', 'ESDAAA', 'AAAAxx'),
+(9801, 2501, 1, 1, 1, 1, 1, 801, 1801, 4801, 9801, 2, 3, 'ZMAAAA', 'FSDAAA', 'HHHHxx'),
+(1781, 2502, 1, 1, 1, 1, 81, 781, 1781, 1781, 1781, 162, 163, 'NQAAAA', 'GSDAAA', 'OOOOxx'),
+(7061, 2503, 1, 1, 1, 1, 61, 61, 1061, 2061, 7061, 122, 123, 'PLAAAA', 'HSDAAA', 'VVVVxx'),
+(2412, 2504, 0, 0, 2, 12, 12, 412, 412, 2412, 2412, 24, 25, 'UOAAAA', 'ISDAAA', 'AAAAxx'),
+(9191, 2505, 1, 3, 1, 11, 91, 191, 1191, 4191, 9191, 182, 183, 'NPAAAA', 'JSDAAA', 'HHHHxx'),
+(1958, 2506, 0, 2, 8, 18, 58, 958, 1958, 1958, 1958, 116, 117, 'IXAAAA', 'KSDAAA', 'OOOOxx'),
+(2203, 2507, 1, 3, 3, 3, 3, 203, 203, 2203, 2203, 6, 7, 'TGAAAA', 'LSDAAA', 'VVVVxx'),
+(9104, 2508, 0, 0, 4, 4, 4, 104, 1104, 4104, 9104, 8, 9, 'EMAAAA', 'MSDAAA', 'AAAAxx'),
+(3837, 2509, 1, 1, 7, 17, 37, 837, 1837, 3837, 3837, 74, 75, 'PRAAAA', 'NSDAAA', 'HHHHxx'),
+(7055, 2510, 1, 3, 5, 15, 55, 55, 1055, 2055, 7055, 110, 111, 'JLAAAA', 'OSDAAA', 'OOOOxx'),
+(4612, 2511, 0, 0, 2, 12, 12, 612, 612, 4612, 4612, 24, 25, 'KVAAAA', 'PSDAAA', 'VVVVxx'),
+(6420, 2512, 0, 0, 0, 0, 20, 420, 420, 1420, 6420, 40, 41, 'YMAAAA', 'QSDAAA', 'AAAAxx'),
+(613, 2513, 1, 1, 3, 13, 13, 613, 613, 613, 613, 26, 27, 'PXAAAA', 'RSDAAA', 'HHHHxx'),
+(1691, 2514, 1, 3, 1, 11, 91, 691, 1691, 1691, 1691, 182, 183, 'BNAAAA', 'SSDAAA', 'OOOOxx'),
+(33, 2515, 1, 1, 3, 13, 33, 33, 33, 33, 33, 66, 67, 'HBAAAA', 'TSDAAA', 'VVVVxx'),
+(875, 2516, 1, 3, 5, 15, 75, 875, 875, 875, 875, 150, 151, 'RHAAAA', 'USDAAA', 'AAAAxx'),
+(9030, 2517, 0, 2, 0, 10, 30, 30, 1030, 4030, 9030, 60, 61, 'IJAAAA', 'VSDAAA', 'HHHHxx'),
+(4285, 2518, 1, 1, 5, 5, 85, 285, 285, 4285, 4285, 170, 171, 'VIAAAA', 'WSDAAA', 'OOOOxx'),
+(6236, 2519, 0, 0, 6, 16, 36, 236, 236, 1236, 6236, 72, 73, 'WFAAAA', 'XSDAAA', 'VVVVxx'),
+(4702, 2520, 0, 2, 2, 2, 2, 702, 702, 4702, 4702, 4, 5, 'WYAAAA', 'YSDAAA', 'AAAAxx'),
+(3441, 2521, 1, 1, 1, 1, 41, 441, 1441, 3441, 3441, 82, 83, 'JCAAAA', 'ZSDAAA', 'HHHHxx'),
+(2150, 2522, 0, 2, 0, 10, 50, 150, 150, 2150, 2150, 100, 101, 'SEAAAA', 'ATDAAA', 'OOOOxx'),
+(1852, 2523, 0, 0, 2, 12, 52, 852, 1852, 1852, 1852, 104, 105, 'GTAAAA', 'BTDAAA', 'VVVVxx'),
+(7713, 2524, 1, 1, 3, 13, 13, 713, 1713, 2713, 7713, 26, 27, 'RKAAAA', 'CTDAAA', 'AAAAxx'),
+(6849, 2525, 1, 1, 9, 9, 49, 849, 849, 1849, 6849, 98, 99, 'LDAAAA', 'DTDAAA', 'HHHHxx'),
+(3425, 2526, 1, 1, 5, 5, 25, 425, 1425, 3425, 3425, 50, 51, 'TBAAAA', 'ETDAAA', 'OOOOxx'),
+(4681, 2527, 1, 1, 1, 1, 81, 681, 681, 4681, 4681, 162, 163, 'BYAAAA', 'FTDAAA', 'VVVVxx'),
+(1134, 2528, 0, 2, 4, 14, 34, 134, 1134, 1134, 1134, 68, 69, 'QRAAAA', 'GTDAAA', 'AAAAxx'),
+(7462, 2529, 0, 2, 2, 2, 62, 462, 1462, 2462, 7462, 124, 125, 'ABAAAA', 'HTDAAA', 'HHHHxx'),
+(2148, 2530, 0, 0, 8, 8, 48, 148, 148, 2148, 2148, 96, 97, 'QEAAAA', 'ITDAAA', 'OOOOxx'),
+(5921, 2531, 1, 1, 1, 1, 21, 921, 1921, 921, 5921, 42, 43, 'TTAAAA', 'JTDAAA', 'VVVVxx'),
+(118, 2532, 0, 2, 8, 18, 18, 118, 118, 118, 118, 36, 37, 'OEAAAA', 'KTDAAA', 'AAAAxx'),
+(3065, 2533, 1, 1, 5, 5, 65, 65, 1065, 3065, 3065, 130, 131, 'XNAAAA', 'LTDAAA', 'HHHHxx'),
+(6590, 2534, 0, 2, 0, 10, 90, 590, 590, 1590, 6590, 180, 181, 'MTAAAA', 'MTDAAA', 'OOOOxx'),
+(4993, 2535, 1, 1, 3, 13, 93, 993, 993, 4993, 4993, 186, 187, 'BKAAAA', 'NTDAAA', 'VVVVxx'),
+(6818, 2536, 0, 2, 8, 18, 18, 818, 818, 1818, 6818, 36, 37, 'GCAAAA', 'OTDAAA', 'AAAAxx'),
+(1449, 2537, 1, 1, 9, 9, 49, 449, 1449, 1449, 1449, 98, 99, 'TDAAAA', 'PTDAAA', 'HHHHxx'),
+(2039, 2538, 1, 3, 9, 19, 39, 39, 39, 2039, 2039, 78, 79, 'LAAAAA', 'QTDAAA', 'OOOOxx'),
+(2524, 2539, 0, 0, 4, 4, 24, 524, 524, 2524, 2524, 48, 49, 'CTAAAA', 'RTDAAA', 'VVVVxx'),
+(1481, 2540, 1, 1, 1, 1, 81, 481, 1481, 1481, 1481, 162, 163, 'ZEAAAA', 'STDAAA', 'AAAAxx'),
+(6984, 2541, 0, 0, 4, 4, 84, 984, 984, 1984, 6984, 168, 169, 'QIAAAA', 'TTDAAA', 'HHHHxx'),
+(3960, 2542, 0, 0, 0, 0, 60, 960, 1960, 3960, 3960, 120, 121, 'IWAAAA', 'UTDAAA', 'OOOOxx'),
+(1983, 2543, 1, 3, 3, 3, 83, 983, 1983, 1983, 1983, 166, 167, 'HYAAAA', 'VTDAAA', 'VVVVxx'),
+(6379, 2544, 1, 3, 9, 19, 79, 379, 379, 1379, 6379, 158, 159, 'JLAAAA', 'WTDAAA', 'AAAAxx'),
+(8975, 2545, 1, 3, 5, 15, 75, 975, 975, 3975, 8975, 150, 151, 'FHAAAA', 'XTDAAA', 'HHHHxx'),
+(1102, 2546, 0, 2, 2, 2, 2, 102, 1102, 1102, 1102, 4, 5, 'KQAAAA', 'YTDAAA', 'OOOOxx'),
+(2517, 2547, 1, 1, 7, 17, 17, 517, 517, 2517, 2517, 34, 35, 'VSAAAA', 'ZTDAAA', 'VVVVxx'),
+(712, 2548, 0, 0, 2, 12, 12, 712, 712, 712, 712, 24, 25, 'KBAAAA', 'AUDAAA', 'AAAAxx'),
+(5419, 2549, 1, 3, 9, 19, 19, 419, 1419, 419, 5419, 38, 39, 'LAAAAA', 'BUDAAA', 'HHHHxx'),
+(723, 2550, 1, 3, 3, 3, 23, 723, 723, 723, 723, 46, 47, 'VBAAAA', 'CUDAAA', 'OOOOxx'),
+(8057, 2551, 1, 1, 7, 17, 57, 57, 57, 3057, 8057, 114, 115, 'XXAAAA', 'DUDAAA', 'VVVVxx'),
+(7471, 2552, 1, 3, 1, 11, 71, 471, 1471, 2471, 7471, 142, 143, 'JBAAAA', 'EUDAAA', 'AAAAxx'),
+(8855, 2553, 1, 3, 5, 15, 55, 855, 855, 3855, 8855, 110, 111, 'PCAAAA', 'FUDAAA', 'HHHHxx'),
+(5074, 2554, 0, 2, 4, 14, 74, 74, 1074, 74, 5074, 148, 149, 'ENAAAA', 'GUDAAA', 'OOOOxx'),
+(7139, 2555, 1, 3, 9, 19, 39, 139, 1139, 2139, 7139, 78, 79, 'POAAAA', 'HUDAAA', 'VVVVxx'),
+(3833, 2556, 1, 1, 3, 13, 33, 833, 1833, 3833, 3833, 66, 67, 'LRAAAA', 'IUDAAA', 'AAAAxx'),
+(5186, 2557, 0, 2, 6, 6, 86, 186, 1186, 186, 5186, 172, 173, 'MRAAAA', 'JUDAAA', 'HHHHxx'),
+(9436, 2558, 0, 0, 6, 16, 36, 436, 1436, 4436, 9436, 72, 73, 'YYAAAA', 'KUDAAA', 'OOOOxx'),
+(8859, 2559, 1, 3, 9, 19, 59, 859, 859, 3859, 8859, 118, 119, 'TCAAAA', 'LUDAAA', 'VVVVxx'),
+(6943, 2560, 1, 3, 3, 3, 43, 943, 943, 1943, 6943, 86, 87, 'BHAAAA', 'MUDAAA', 'AAAAxx'),
+(2315, 2561, 1, 3, 5, 15, 15, 315, 315, 2315, 2315, 30, 31, 'BLAAAA', 'NUDAAA', 'HHHHxx'),
+(1394, 2562, 0, 2, 4, 14, 94, 394, 1394, 1394, 1394, 188, 189, 'QBAAAA', 'OUDAAA', 'OOOOxx'),
+(8863, 2563, 1, 3, 3, 3, 63, 863, 863, 3863, 8863, 126, 127, 'XCAAAA', 'PUDAAA', 'VVVVxx'),
+(8812, 2564, 0, 0, 2, 12, 12, 812, 812, 3812, 8812, 24, 25, 'YAAAAA', 'QUDAAA', 'AAAAxx'),
+(7498, 2565, 0, 2, 8, 18, 98, 498, 1498, 2498, 7498, 196, 197, 'KCAAAA', 'RUDAAA', 'HHHHxx'),
+(8962, 2566, 0, 2, 2, 2, 62, 962, 962, 3962, 8962, 124, 125, 'SGAAAA', 'SUDAAA', 'OOOOxx'),
+(2533, 2567, 1, 1, 3, 13, 33, 533, 533, 2533, 2533, 66, 67, 'LTAAAA', 'TUDAAA', 'VVVVxx'),
+(8188, 2568, 0, 0, 8, 8, 88, 188, 188, 3188, 8188, 176, 177, 'YCAAAA', 'UUDAAA', 'AAAAxx'),
+(6137, 2569, 1, 1, 7, 17, 37, 137, 137, 1137, 6137, 74, 75, 'BCAAAA', 'VUDAAA', 'HHHHxx'),
+(974, 2570, 0, 2, 4, 14, 74, 974, 974, 974, 974, 148, 149, 'MLAAAA', 'WUDAAA', 'OOOOxx'),
+(2751, 2571, 1, 3, 1, 11, 51, 751, 751, 2751, 2751, 102, 103, 'VBAAAA', 'XUDAAA', 'VVVVxx'),
+(4975, 2572, 1, 3, 5, 15, 75, 975, 975, 4975, 4975, 150, 151, 'JJAAAA', 'YUDAAA', 'AAAAxx'),
+(3411, 2573, 1, 3, 1, 11, 11, 411, 1411, 3411, 3411, 22, 23, 'FBAAAA', 'ZUDAAA', 'HHHHxx'),
+(3143, 2574, 1, 3, 3, 3, 43, 143, 1143, 3143, 3143, 86, 87, 'XQAAAA', 'AVDAAA', 'OOOOxx'),
+(8011, 2575, 1, 3, 1, 11, 11, 11, 11, 3011, 8011, 22, 23, 'DWAAAA', 'BVDAAA', 'VVVVxx'),
+(988, 2576, 0, 0, 8, 8, 88, 988, 988, 988, 988, 176, 177, 'AMAAAA', 'CVDAAA', 'AAAAxx'),
+(4289, 2577, 1, 1, 9, 9, 89, 289, 289, 4289, 4289, 178, 179, 'ZIAAAA', 'DVDAAA', 'HHHHxx'),
+(8105, 2578, 1, 1, 5, 5, 5, 105, 105, 3105, 8105, 10, 11, 'TZAAAA', 'EVDAAA', 'OOOOxx'),
+(9885, 2579, 1, 1, 5, 5, 85, 885, 1885, 4885, 9885, 170, 171, 'FQAAAA', 'FVDAAA', 'VVVVxx'),
+(1002, 2580, 0, 2, 2, 2, 2, 2, 1002, 1002, 1002, 4, 5, 'OMAAAA', 'GVDAAA', 'AAAAxx'),
+(5827, 2581, 1, 3, 7, 7, 27, 827, 1827, 827, 5827, 54, 55, 'DQAAAA', 'HVDAAA', 'HHHHxx'),
+(1228, 2582, 0, 0, 8, 8, 28, 228, 1228, 1228, 1228, 56, 57, 'GVAAAA', 'IVDAAA', 'OOOOxx'),
+(6352, 2583, 0, 0, 2, 12, 52, 352, 352, 1352, 6352, 104, 105, 'IKAAAA', 'JVDAAA', 'VVVVxx'),
+(8868, 2584, 0, 0, 8, 8, 68, 868, 868, 3868, 8868, 136, 137, 'CDAAAA', 'KVDAAA', 'AAAAxx'),
+(3643, 2585, 1, 3, 3, 3, 43, 643, 1643, 3643, 3643, 86, 87, 'DKAAAA', 'LVDAAA', 'HHHHxx'),
+(1468, 2586, 0, 0, 8, 8, 68, 468, 1468, 1468, 1468, 136, 137, 'MEAAAA', 'MVDAAA', 'OOOOxx'),
+(8415, 2587, 1, 3, 5, 15, 15, 415, 415, 3415, 8415, 30, 31, 'RLAAAA', 'NVDAAA', 'VVVVxx'),
+(9631, 2588, 1, 3, 1, 11, 31, 631, 1631, 4631, 9631, 62, 63, 'LGAAAA', 'OVDAAA', 'AAAAxx'),
+(7408, 2589, 0, 0, 8, 8, 8, 408, 1408, 2408, 7408, 16, 17, 'YYAAAA', 'PVDAAA', 'HHHHxx'),
+(1934, 2590, 0, 2, 4, 14, 34, 934, 1934, 1934, 1934, 68, 69, 'KWAAAA', 'QVDAAA', 'OOOOxx'),
+(996, 2591, 0, 0, 6, 16, 96, 996, 996, 996, 996, 192, 193, 'IMAAAA', 'RVDAAA', 'VVVVxx'),
+(8027, 2592, 1, 3, 7, 7, 27, 27, 27, 3027, 8027, 54, 55, 'TWAAAA', 'SVDAAA', 'AAAAxx'),
+(8464, 2593, 0, 0, 4, 4, 64, 464, 464, 3464, 8464, 128, 129, 'ONAAAA', 'TVDAAA', 'HHHHxx'),
+(5007, 2594, 1, 3, 7, 7, 7, 7, 1007, 7, 5007, 14, 15, 'PKAAAA', 'UVDAAA', 'OOOOxx'),
+(8356, 2595, 0, 0, 6, 16, 56, 356, 356, 3356, 8356, 112, 113, 'KJAAAA', 'VVDAAA', 'VVVVxx'),
+(4579, 2596, 1, 3, 9, 19, 79, 579, 579, 4579, 4579, 158, 159, 'DUAAAA', 'WVDAAA', 'AAAAxx'),
+(8513, 2597, 1, 1, 3, 13, 13, 513, 513, 3513, 8513, 26, 27, 'LPAAAA', 'XVDAAA', 'HHHHxx'),
+(383, 2598, 1, 3, 3, 3, 83, 383, 383, 383, 383, 166, 167, 'TOAAAA', 'YVDAAA', 'OOOOxx'),
+(9304, 2599, 0, 0, 4, 4, 4, 304, 1304, 4304, 9304, 8, 9, 'WTAAAA', 'ZVDAAA', 'VVVVxx'),
+(7224, 2600, 0, 0, 4, 4, 24, 224, 1224, 2224, 7224, 48, 49, 'WRAAAA', 'AWDAAA', 'AAAAxx'),
+(6023, 2601, 1, 3, 3, 3, 23, 23, 23, 1023, 6023, 46, 47, 'RXAAAA', 'BWDAAA', 'HHHHxx'),
+(2746, 2602, 0, 2, 6, 6, 46, 746, 746, 2746, 2746, 92, 93, 'QBAAAA', 'CWDAAA', 'OOOOxx'),
+(137, 2603, 1, 1, 7, 17, 37, 137, 137, 137, 137, 74, 75, 'HFAAAA', 'DWDAAA', 'VVVVxx'),
+(9441, 2604, 1, 1, 1, 1, 41, 441, 1441, 4441, 9441, 82, 83, 'DZAAAA', 'EWDAAA', 'AAAAxx'),
+(3690, 2605, 0, 2, 0, 10, 90, 690, 1690, 3690, 3690, 180, 181, 'YLAAAA', 'FWDAAA', 'HHHHxx'),
+(913, 2606, 1, 1, 3, 13, 13, 913, 913, 913, 913, 26, 27, 'DJAAAA', 'GWDAAA', 'OOOOxx'),
+(1768, 2607, 0, 0, 8, 8, 68, 768, 1768, 1768, 1768, 136, 137, 'AQAAAA', 'HWDAAA', 'VVVVxx'),
+(8492, 2608, 0, 0, 2, 12, 92, 492, 492, 3492, 8492, 184, 185, 'QOAAAA', 'IWDAAA', 'AAAAxx'),
+(8083, 2609, 1, 3, 3, 3, 83, 83, 83, 3083, 8083, 166, 167, 'XYAAAA', 'JWDAAA', 'HHHHxx'),
+(4609, 2610, 1, 1, 9, 9, 9, 609, 609, 4609, 4609, 18, 19, 'HVAAAA', 'KWDAAA', 'OOOOxx'),
+(7520, 2611, 0, 0, 0, 0, 20, 520, 1520, 2520, 7520, 40, 41, 'GDAAAA', 'LWDAAA', 'VVVVxx'),
+(4231, 2612, 1, 3, 1, 11, 31, 231, 231, 4231, 4231, 62, 63, 'TGAAAA', 'MWDAAA', 'AAAAxx'),
+(6022, 2613, 0, 2, 2, 2, 22, 22, 22, 1022, 6022, 44, 45, 'QXAAAA', 'NWDAAA', 'HHHHxx'),
+(9784, 2614, 0, 0, 4, 4, 84, 784, 1784, 4784, 9784, 168, 169, 'IMAAAA', 'OWDAAA', 'OOOOxx'),
+(1343, 2615, 1, 3, 3, 3, 43, 343, 1343, 1343, 1343, 86, 87, 'RZAAAA', 'PWDAAA', 'VVVVxx'),
+(7549, 2616, 1, 1, 9, 9, 49, 549, 1549, 2549, 7549, 98, 99, 'JEAAAA', 'QWDAAA', 'AAAAxx'),
+(269, 2617, 1, 1, 9, 9, 69, 269, 269, 269, 269, 138, 139, 'JKAAAA', 'RWDAAA', 'HHHHxx'),
+(1069, 2618, 1, 1, 9, 9, 69, 69, 1069, 1069, 1069, 138, 139, 'DPAAAA', 'SWDAAA', 'OOOOxx'),
+(4610, 2619, 0, 2, 0, 10, 10, 610, 610, 4610, 4610, 20, 21, 'IVAAAA', 'TWDAAA', 'VVVVxx'),
+(482, 2620, 0, 2, 2, 2, 82, 482, 482, 482, 482, 164, 165, 'OSAAAA', 'UWDAAA', 'AAAAxx'),
+(3025, 2621, 1, 1, 5, 5, 25, 25, 1025, 3025, 3025, 50, 51, 'JMAAAA', 'VWDAAA', 'HHHHxx'),
+(7914, 2622, 0, 2, 4, 14, 14, 914, 1914, 2914, 7914, 28, 29, 'KSAAAA', 'WWDAAA', 'OOOOxx'),
+(3198, 2623, 0, 2, 8, 18, 98, 198, 1198, 3198, 3198, 196, 197, 'ATAAAA', 'XWDAAA', 'VVVVxx'),
+(1187, 2624, 1, 3, 7, 7, 87, 187, 1187, 1187, 1187, 174, 175, 'RTAAAA', 'YWDAAA', 'AAAAxx'),
+(4707, 2625, 1, 3, 7, 7, 7, 707, 707, 4707, 4707, 14, 15, 'BZAAAA', 'ZWDAAA', 'HHHHxx'),
+(8279, 2626, 1, 3, 9, 19, 79, 279, 279, 3279, 8279, 158, 159, 'LGAAAA', 'AXDAAA', 'OOOOxx'),
+(6127, 2627, 1, 3, 7, 7, 27, 127, 127, 1127, 6127, 54, 55, 'RBAAAA', 'BXDAAA', 'VVVVxx'),
+(1305, 2628, 1, 1, 5, 5, 5, 305, 1305, 1305, 1305, 10, 11, 'FYAAAA', 'CXDAAA', 'AAAAxx'),
+(4804, 2629, 0, 0, 4, 4, 4, 804, 804, 4804, 4804, 8, 9, 'UCAAAA', 'DXDAAA', 'HHHHxx'),
+(6069, 2630, 1, 1, 9, 9, 69, 69, 69, 1069, 6069, 138, 139, 'LZAAAA', 'EXDAAA', 'OOOOxx'),
+(9229, 2631, 1, 1, 9, 9, 29, 229, 1229, 4229, 9229, 58, 59, 'ZQAAAA', 'FXDAAA', 'VVVVxx'),
+(4703, 2632, 1, 3, 3, 3, 3, 703, 703, 4703, 4703, 6, 7, 'XYAAAA', 'GXDAAA', 'AAAAxx'),
+(6410, 2633, 0, 2, 0, 10, 10, 410, 410, 1410, 6410, 20, 21, 'OMAAAA', 'HXDAAA', 'HHHHxx'),
+(944, 2634, 0, 0, 4, 4, 44, 944, 944, 944, 944, 88, 89, 'IKAAAA', 'IXDAAA', 'OOOOxx'),
+(3744, 2635, 0, 0, 4, 4, 44, 744, 1744, 3744, 3744, 88, 89, 'AOAAAA', 'JXDAAA', 'VVVVxx'),
+(1127, 2636, 1, 3, 7, 7, 27, 127, 1127, 1127, 1127, 54, 55, 'JRAAAA', 'KXDAAA', 'AAAAxx'),
+(6693, 2637, 1, 1, 3, 13, 93, 693, 693, 1693, 6693, 186, 187, 'LXAAAA', 'LXDAAA', 'HHHHxx'),
+(583, 2638, 1, 3, 3, 3, 83, 583, 583, 583, 583, 166, 167, 'LWAAAA', 'MXDAAA', 'OOOOxx'),
+(2684, 2639, 0, 0, 4, 4, 84, 684, 684, 2684, 2684, 168, 169, 'GZAAAA', 'NXDAAA', 'VVVVxx'),
+(6192, 2640, 0, 0, 2, 12, 92, 192, 192, 1192, 6192, 184, 185, 'EEAAAA', 'OXDAAA', 'AAAAxx'),
+(4157, 2641, 1, 1, 7, 17, 57, 157, 157, 4157, 4157, 114, 115, 'XDAAAA', 'PXDAAA', 'HHHHxx'),
+(6470, 2642, 0, 2, 0, 10, 70, 470, 470, 1470, 6470, 140, 141, 'WOAAAA', 'QXDAAA', 'OOOOxx'),
+(8965, 2643, 1, 1, 5, 5, 65, 965, 965, 3965, 8965, 130, 131, 'VGAAAA', 'RXDAAA', 'VVVVxx'),
+(1433, 2644, 1, 1, 3, 13, 33, 433, 1433, 1433, 1433, 66, 67, 'DDAAAA', 'SXDAAA', 'AAAAxx'),
+(4570, 2645, 0, 2, 0, 10, 70, 570, 570, 4570, 4570, 140, 141, 'UTAAAA', 'TXDAAA', 'HHHHxx'),
+(1806, 2646, 0, 2, 6, 6, 6, 806, 1806, 1806, 1806, 12, 13, 'MRAAAA', 'UXDAAA', 'OOOOxx'),
+(1230, 2647, 0, 2, 0, 10, 30, 230, 1230, 1230, 1230, 60, 61, 'IVAAAA', 'VXDAAA', 'VVVVxx'),
+(2283, 2648, 1, 3, 3, 3, 83, 283, 283, 2283, 2283, 166, 167, 'VJAAAA', 'WXDAAA', 'AAAAxx'),
+(6456, 2649, 0, 0, 6, 16, 56, 456, 456, 1456, 6456, 112, 113, 'IOAAAA', 'XXDAAA', 'HHHHxx'),
+(7427, 2650, 1, 3, 7, 7, 27, 427, 1427, 2427, 7427, 54, 55, 'RZAAAA', 'YXDAAA', 'OOOOxx'),
+(8310, 2651, 0, 2, 0, 10, 10, 310, 310, 3310, 8310, 20, 21, 'QHAAAA', 'ZXDAAA', 'VVVVxx'),
+(8103, 2652, 1, 3, 3, 3, 3, 103, 103, 3103, 8103, 6, 7, 'RZAAAA', 'AYDAAA', 'AAAAxx'),
+(3947, 2653, 1, 3, 7, 7, 47, 947, 1947, 3947, 3947, 94, 95, 'VVAAAA', 'BYDAAA', 'HHHHxx'),
+(3414, 2654, 0, 2, 4, 14, 14, 414, 1414, 3414, 3414, 28, 29, 'IBAAAA', 'CYDAAA', 'OOOOxx'),
+(2043, 2655, 1, 3, 3, 3, 43, 43, 43, 2043, 2043, 86, 87, 'PAAAAA', 'DYDAAA', 'VVVVxx'),
+(4393, 2656, 1, 1, 3, 13, 93, 393, 393, 4393, 4393, 186, 187, 'ZMAAAA', 'EYDAAA', 'AAAAxx'),
+(6664, 2657, 0, 0, 4, 4, 64, 664, 664, 1664, 6664, 128, 129, 'IWAAAA', 'FYDAAA', 'HHHHxx'),
+(4545, 2658, 1, 1, 5, 5, 45, 545, 545, 4545, 4545, 90, 91, 'VSAAAA', 'GYDAAA', 'OOOOxx'),
+(7637, 2659, 1, 1, 7, 17, 37, 637, 1637, 2637, 7637, 74, 75, 'THAAAA', 'HYDAAA', 'VVVVxx'),
+(1359, 2660, 1, 3, 9, 19, 59, 359, 1359, 1359, 1359, 118, 119, 'HAAAAA', 'IYDAAA', 'AAAAxx'),
+(5018, 2661, 0, 2, 8, 18, 18, 18, 1018, 18, 5018, 36, 37, 'ALAAAA', 'JYDAAA', 'HHHHxx'),
+(987, 2662, 1, 3, 7, 7, 87, 987, 987, 987, 987, 174, 175, 'ZLAAAA', 'KYDAAA', 'OOOOxx'),
+(1320, 2663, 0, 0, 0, 0, 20, 320, 1320, 1320, 1320, 40, 41, 'UYAAAA', 'LYDAAA', 'VVVVxx'),
+(9311, 2664, 1, 3, 1, 11, 11, 311, 1311, 4311, 9311, 22, 23, 'DUAAAA', 'MYDAAA', 'AAAAxx'),
+(7993, 2665, 1, 1, 3, 13, 93, 993, 1993, 2993, 7993, 186, 187, 'LVAAAA', 'NYDAAA', 'HHHHxx'),
+(7588, 2666, 0, 0, 8, 8, 88, 588, 1588, 2588, 7588, 176, 177, 'WFAAAA', 'OYDAAA', 'OOOOxx'),
+(5983, 2667, 1, 3, 3, 3, 83, 983, 1983, 983, 5983, 166, 167, 'DWAAAA', 'PYDAAA', 'VVVVxx'),
+(4070, 2668, 0, 2, 0, 10, 70, 70, 70, 4070, 4070, 140, 141, 'OAAAAA', 'QYDAAA', 'AAAAxx'),
+(8349, 2669, 1, 1, 9, 9, 49, 349, 349, 3349, 8349, 98, 99, 'DJAAAA', 'RYDAAA', 'HHHHxx'),
+(3810, 2670, 0, 2, 0, 10, 10, 810, 1810, 3810, 3810, 20, 21, 'OQAAAA', 'SYDAAA', 'OOOOxx'),
+(6948, 2671, 0, 0, 8, 8, 48, 948, 948, 1948, 6948, 96, 97, 'GHAAAA', 'TYDAAA', 'VVVVxx'),
+(7153, 2672, 1, 1, 3, 13, 53, 153, 1153, 2153, 7153, 106, 107, 'DPAAAA', 'UYDAAA', 'AAAAxx'),
+(5371, 2673, 1, 3, 1, 11, 71, 371, 1371, 371, 5371, 142, 143, 'PYAAAA', 'VYDAAA', 'HHHHxx'),
+(8316, 2674, 0, 0, 6, 16, 16, 316, 316, 3316, 8316, 32, 33, 'WHAAAA', 'WYDAAA', 'OOOOxx'),
+(5903, 2675, 1, 3, 3, 3, 3, 903, 1903, 903, 5903, 6, 7, 'BTAAAA', 'XYDAAA', 'VVVVxx'),
+(6718, 2676, 0, 2, 8, 18, 18, 718, 718, 1718, 6718, 36, 37, 'KYAAAA', 'YYDAAA', 'AAAAxx'),
+(4759, 2677, 1, 3, 9, 19, 59, 759, 759, 4759, 4759, 118, 119, 'BBAAAA', 'ZYDAAA', 'HHHHxx'),
+(2555, 2678, 1, 3, 5, 15, 55, 555, 555, 2555, 2555, 110, 111, 'HUAAAA', 'AZDAAA', 'OOOOxx'),
+(3457, 2679, 1, 1, 7, 17, 57, 457, 1457, 3457, 3457, 114, 115, 'ZCAAAA', 'BZDAAA', 'VVVVxx'),
+(9626, 2680, 0, 2, 6, 6, 26, 626, 1626, 4626, 9626, 52, 53, 'GGAAAA', 'CZDAAA', 'AAAAxx'),
+(2570, 2681, 0, 2, 0, 10, 70, 570, 570, 2570, 2570, 140, 141, 'WUAAAA', 'DZDAAA', 'HHHHxx'),
+(7964, 2682, 0, 0, 4, 4, 64, 964, 1964, 2964, 7964, 128, 129, 'IUAAAA', 'EZDAAA', 'OOOOxx'),
+(1543, 2683, 1, 3, 3, 3, 43, 543, 1543, 1543, 1543, 86, 87, 'JHAAAA', 'FZDAAA', 'VVVVxx'),
+(929, 2684, 1, 1, 9, 9, 29, 929, 929, 929, 929, 58, 59, 'TJAAAA', 'GZDAAA', 'AAAAxx'),
+(9244, 2685, 0, 0, 4, 4, 44, 244, 1244, 4244, 9244, 88, 89, 'ORAAAA', 'HZDAAA', 'HHHHxx'),
+(9210, 2686, 0, 2, 0, 10, 10, 210, 1210, 4210, 9210, 20, 21, 'GQAAAA', 'IZDAAA', 'OOOOxx'),
+(8334, 2687, 0, 2, 4, 14, 34, 334, 334, 3334, 8334, 68, 69, 'OIAAAA', 'JZDAAA', 'VVVVxx'),
+(9310, 2688, 0, 2, 0, 10, 10, 310, 1310, 4310, 9310, 20, 21, 'CUAAAA', 'KZDAAA', 'AAAAxx'),
+(5024, 2689, 0, 0, 4, 4, 24, 24, 1024, 24, 5024, 48, 49, 'GLAAAA', 'LZDAAA', 'HHHHxx'),
+(8794, 2690, 0, 2, 4, 14, 94, 794, 794, 3794, 8794, 188, 189, 'GAAAAA', 'MZDAAA', 'OOOOxx'),
+(4091, 2691, 1, 3, 1, 11, 91, 91, 91, 4091, 4091, 182, 183, 'JBAAAA', 'NZDAAA', 'VVVVxx'),
+(649, 2692, 1, 1, 9, 9, 49, 649, 649, 649, 649, 98, 99, 'ZYAAAA', 'OZDAAA', 'AAAAxx'),
+(8505, 2693, 1, 1, 5, 5, 5, 505, 505, 3505, 8505, 10, 11, 'DPAAAA', 'PZDAAA', 'HHHHxx'),
+(6652, 2694, 0, 0, 2, 12, 52, 652, 652, 1652, 6652, 104, 105, 'WVAAAA', 'QZDAAA', 'OOOOxx'),
+(8945, 2695, 1, 1, 5, 5, 45, 945, 945, 3945, 8945, 90, 91, 'BGAAAA', 'RZDAAA', 'VVVVxx'),
+(2095, 2696, 1, 3, 5, 15, 95, 95, 95, 2095, 2095, 190, 191, 'PCAAAA', 'SZDAAA', 'AAAAxx'),
+(8676, 2697, 0, 0, 6, 16, 76, 676, 676, 3676, 8676, 152, 153, 'SVAAAA', 'TZDAAA', 'HHHHxx'),
+(3994, 2698, 0, 2, 4, 14, 94, 994, 1994, 3994, 3994, 188, 189, 'QXAAAA', 'UZDAAA', 'OOOOxx'),
+(2859, 2699, 1, 3, 9, 19, 59, 859, 859, 2859, 2859, 118, 119, 'ZFAAAA', 'VZDAAA', 'VVVVxx'),
+(5403, 2700, 1, 3, 3, 3, 3, 403, 1403, 403, 5403, 6, 7, 'VZAAAA', 'WZDAAA', 'AAAAxx'),
+(3254, 2701, 0, 2, 4, 14, 54, 254, 1254, 3254, 3254, 108, 109, 'EVAAAA', 'XZDAAA', 'HHHHxx'),
+(7339, 2702, 1, 3, 9, 19, 39, 339, 1339, 2339, 7339, 78, 79, 'HWAAAA', 'YZDAAA', 'OOOOxx'),
+(7220, 2703, 0, 0, 0, 0, 20, 220, 1220, 2220, 7220, 40, 41, 'SRAAAA', 'ZZDAAA', 'VVVVxx'),
+(4154, 2704, 0, 2, 4, 14, 54, 154, 154, 4154, 4154, 108, 109, 'UDAAAA', 'AAEAAA', 'AAAAxx'),
+(7570, 2705, 0, 2, 0, 10, 70, 570, 1570, 2570, 7570, 140, 141, 'EFAAAA', 'BAEAAA', 'HHHHxx'),
+(2576, 2706, 0, 0, 6, 16, 76, 576, 576, 2576, 2576, 152, 153, 'CVAAAA', 'CAEAAA', 'OOOOxx'),
+(5764, 2707, 0, 0, 4, 4, 64, 764, 1764, 764, 5764, 128, 129, 'SNAAAA', 'DAEAAA', 'VVVVxx'),
+(4314, 2708, 0, 2, 4, 14, 14, 314, 314, 4314, 4314, 28, 29, 'YJAAAA', 'EAEAAA', 'AAAAxx'),
+(2274, 2709, 0, 2, 4, 14, 74, 274, 274, 2274, 2274, 148, 149, 'MJAAAA', 'FAEAAA', 'HHHHxx'),
+(9756, 2710, 0, 0, 6, 16, 56, 756, 1756, 4756, 9756, 112, 113, 'GLAAAA', 'GAEAAA', 'OOOOxx'),
+(8274, 2711, 0, 2, 4, 14, 74, 274, 274, 3274, 8274, 148, 149, 'GGAAAA', 'HAEAAA', 'VVVVxx'),
+(1289, 2712, 1, 1, 9, 9, 89, 289, 1289, 1289, 1289, 178, 179, 'PXAAAA', 'IAEAAA', 'AAAAxx'),
+(7335, 2713, 1, 3, 5, 15, 35, 335, 1335, 2335, 7335, 70, 71, 'DWAAAA', 'JAEAAA', 'HHHHxx'),
+(5351, 2714, 1, 3, 1, 11, 51, 351, 1351, 351, 5351, 102, 103, 'VXAAAA', 'KAEAAA', 'OOOOxx'),
+(8978, 2715, 0, 2, 8, 18, 78, 978, 978, 3978, 8978, 156, 157, 'IHAAAA', 'LAEAAA', 'VVVVxx'),
+(2, 2716, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 'CAAAAA', 'MAEAAA', 'AAAAxx'),
+(8906, 2717, 0, 2, 6, 6, 6, 906, 906, 3906, 8906, 12, 13, 'OEAAAA', 'NAEAAA', 'HHHHxx'),
+(6388, 2718, 0, 0, 8, 8, 88, 388, 388, 1388, 6388, 176, 177, 'SLAAAA', 'OAEAAA', 'OOOOxx'),
+(5675, 2719, 1, 3, 5, 15, 75, 675, 1675, 675, 5675, 150, 151, 'HKAAAA', 'PAEAAA', 'VVVVxx'),
+(255, 2720, 1, 3, 5, 15, 55, 255, 255, 255, 255, 110, 111, 'VJAAAA', 'QAEAAA', 'AAAAxx'),
+(9538, 2721, 0, 2, 8, 18, 38, 538, 1538, 4538, 9538, 76, 77, 'WCAAAA', 'RAEAAA', 'HHHHxx'),
+(1480, 2722, 0, 0, 0, 0, 80, 480, 1480, 1480, 1480, 160, 161, 'YEAAAA', 'SAEAAA', 'OOOOxx'),
+(4015, 2723, 1, 3, 5, 15, 15, 15, 15, 4015, 4015, 30, 31, 'LYAAAA', 'TAEAAA', 'VVVVxx'),
+(5166, 2724, 0, 2, 6, 6, 66, 166, 1166, 166, 5166, 132, 133, 'SQAAAA', 'UAEAAA', 'AAAAxx'),
+(91, 2725, 1, 3, 1, 11, 91, 91, 91, 91, 91, 182, 183, 'NDAAAA', 'VAEAAA', 'HHHHxx'),
+(2958, 2726, 0, 2, 8, 18, 58, 958, 958, 2958, 2958, 116, 117, 'UJAAAA', 'WAEAAA', 'OOOOxx'),
+(9131, 2727, 1, 3, 1, 11, 31, 131, 1131, 4131, 9131, 62, 63, 'FNAAAA', 'XAEAAA', 'VVVVxx'),
+(3944, 2728, 0, 0, 4, 4, 44, 944, 1944, 3944, 3944, 88, 89, 'SVAAAA', 'YAEAAA', 'AAAAxx'),
+(4514, 2729, 0, 2, 4, 14, 14, 514, 514, 4514, 4514, 28, 29, 'QRAAAA', 'ZAEAAA', 'HHHHxx'),
+(5661, 2730, 1, 1, 1, 1, 61, 661, 1661, 661, 5661, 122, 123, 'TJAAAA', 'ABEAAA', 'OOOOxx'),
+(8724, 2731, 0, 0, 4, 4, 24, 724, 724, 3724, 8724, 48, 49, 'OXAAAA', 'BBEAAA', 'VVVVxx'),
+(6408, 2732, 0, 0, 8, 8, 8, 408, 408, 1408, 6408, 16, 17, 'MMAAAA', 'CBEAAA', 'AAAAxx'),
+(5013, 2733, 1, 1, 3, 13, 13, 13, 1013, 13, 5013, 26, 27, 'VKAAAA', 'DBEAAA', 'HHHHxx'),
+(6156, 2734, 0, 0, 6, 16, 56, 156, 156, 1156, 6156, 112, 113, 'UCAAAA', 'EBEAAA', 'OOOOxx'),
+(7350, 2735, 0, 2, 0, 10, 50, 350, 1350, 2350, 7350, 100, 101, 'SWAAAA', 'FBEAAA', 'VVVVxx'),
+(9858, 2736, 0, 2, 8, 18, 58, 858, 1858, 4858, 9858, 116, 117, 'EPAAAA', 'GBEAAA', 'AAAAxx'),
+(895, 2737, 1, 3, 5, 15, 95, 895, 895, 895, 895, 190, 191, 'LIAAAA', 'HBEAAA', 'HHHHxx'),
+(8368, 2738, 0, 0, 8, 8, 68, 368, 368, 3368, 8368, 136, 137, 'WJAAAA', 'IBEAAA', 'OOOOxx'),
+(179, 2739, 1, 3, 9, 19, 79, 179, 179, 179, 179, 158, 159, 'XGAAAA', 'JBEAAA', 'VVVVxx'),
+(4048, 2740, 0, 0, 8, 8, 48, 48, 48, 4048, 4048, 96, 97, 'SZAAAA', 'KBEAAA', 'AAAAxx'),
+(3073, 2741, 1, 1, 3, 13, 73, 73, 1073, 3073, 3073, 146, 147, 'FOAAAA', 'LBEAAA', 'HHHHxx'),
+(321, 2742, 1, 1, 1, 1, 21, 321, 321, 321, 321, 42, 43, 'JMAAAA', 'MBEAAA', 'OOOOxx'),
+(5352, 2743, 0, 0, 2, 12, 52, 352, 1352, 352, 5352, 104, 105, 'WXAAAA', 'NBEAAA', 'VVVVxx'),
+(1940, 2744, 0, 0, 0, 0, 40, 940, 1940, 1940, 1940, 80, 81, 'QWAAAA', 'OBEAAA', 'AAAAxx'),
+(8803, 2745, 1, 3, 3, 3, 3, 803, 803, 3803, 8803, 6, 7, 'PAAAAA', 'PBEAAA', 'HHHHxx'),
+(791, 2746, 1, 3, 1, 11, 91, 791, 791, 791, 791, 182, 183, 'LEAAAA', 'QBEAAA', 'OOOOxx'),
+(9809, 2747, 1, 1, 9, 9, 9, 809, 1809, 4809, 9809, 18, 19, 'HNAAAA', 'RBEAAA', 'VVVVxx'),
+(5519, 2748, 1, 3, 9, 19, 19, 519, 1519, 519, 5519, 38, 39, 'HEAAAA', 'SBEAAA', 'AAAAxx'),
+(7420, 2749, 0, 0, 0, 0, 20, 420, 1420, 2420, 7420, 40, 41, 'KZAAAA', 'TBEAAA', 'HHHHxx'),
+(7541, 2750, 1, 1, 1, 1, 41, 541, 1541, 2541, 7541, 82, 83, 'BEAAAA', 'UBEAAA', 'OOOOxx'),
+(6538, 2751, 0, 2, 8, 18, 38, 538, 538, 1538, 6538, 76, 77, 'MRAAAA', 'VBEAAA', 'VVVVxx'),
+(710, 2752, 0, 2, 0, 10, 10, 710, 710, 710, 710, 20, 21, 'IBAAAA', 'WBEAAA', 'AAAAxx'),
+(9488, 2753, 0, 0, 8, 8, 88, 488, 1488, 4488, 9488, 176, 177, 'YAAAAA', 'XBEAAA', 'HHHHxx'),
+(3135, 2754, 1, 3, 5, 15, 35, 135, 1135, 3135, 3135, 70, 71, 'PQAAAA', 'YBEAAA', 'OOOOxx'),
+(4273, 2755, 1, 1, 3, 13, 73, 273, 273, 4273, 4273, 146, 147, 'JIAAAA', 'ZBEAAA', 'VVVVxx'),
+(629, 2756, 1, 1, 9, 9, 29, 629, 629, 629, 629, 58, 59, 'FYAAAA', 'ACEAAA', 'AAAAxx'),
+(9167, 2757, 1, 3, 7, 7, 67, 167, 1167, 4167, 9167, 134, 135, 'POAAAA', 'BCEAAA', 'HHHHxx'),
+(751, 2758, 1, 3, 1, 11, 51, 751, 751, 751, 751, 102, 103, 'XCAAAA', 'CCEAAA', 'OOOOxx'),
+(1126, 2759, 0, 2, 6, 6, 26, 126, 1126, 1126, 1126, 52, 53, 'IRAAAA', 'DCEAAA', 'VVVVxx'),
+(3724, 2760, 0, 0, 4, 4, 24, 724, 1724, 3724, 3724, 48, 49, 'GNAAAA', 'ECEAAA', 'AAAAxx'),
+(1789, 2761, 1, 1, 9, 9, 89, 789, 1789, 1789, 1789, 178, 179, 'VQAAAA', 'FCEAAA', 'HHHHxx'),
+(792, 2762, 0, 0, 2, 12, 92, 792, 792, 792, 792, 184, 185, 'MEAAAA', 'GCEAAA', 'OOOOxx'),
+(2771, 2763, 1, 3, 1, 11, 71, 771, 771, 2771, 2771, 142, 143, 'PCAAAA', 'HCEAAA', 'VVVVxx'),
+(4313, 2764, 1, 1, 3, 13, 13, 313, 313, 4313, 4313, 26, 27, 'XJAAAA', 'ICEAAA', 'AAAAxx'),
+(9312, 2765, 0, 0, 2, 12, 12, 312, 1312, 4312, 9312, 24, 25, 'EUAAAA', 'JCEAAA', 'HHHHxx'),
+(955, 2766, 1, 3, 5, 15, 55, 955, 955, 955, 955, 110, 111, 'TKAAAA', 'KCEAAA', 'OOOOxx'),
+(6382, 2767, 0, 2, 2, 2, 82, 382, 382, 1382, 6382, 164, 165, 'MLAAAA', 'LCEAAA', 'VVVVxx'),
+(7875, 2768, 1, 3, 5, 15, 75, 875, 1875, 2875, 7875, 150, 151, 'XQAAAA', 'MCEAAA', 'AAAAxx'),
+(7491, 2769, 1, 3, 1, 11, 91, 491, 1491, 2491, 7491, 182, 183, 'DCAAAA', 'NCEAAA', 'HHHHxx'),
+(8193, 2770, 1, 1, 3, 13, 93, 193, 193, 3193, 8193, 186, 187, 'DDAAAA', 'OCEAAA', 'OOOOxx'),
+(968, 2771, 0, 0, 8, 8, 68, 968, 968, 968, 968, 136, 137, 'GLAAAA', 'PCEAAA', 'VVVVxx'),
+(4951, 2772, 1, 3, 1, 11, 51, 951, 951, 4951, 4951, 102, 103, 'LIAAAA', 'QCEAAA', 'AAAAxx'),
+(2204, 2773, 0, 0, 4, 4, 4, 204, 204, 2204, 2204, 8, 9, 'UGAAAA', 'RCEAAA', 'HHHHxx'),
+(2066, 2774, 0, 2, 6, 6, 66, 66, 66, 2066, 2066, 132, 133, 'MBAAAA', 'SCEAAA', 'OOOOxx'),
+(2631, 2775, 1, 3, 1, 11, 31, 631, 631, 2631, 2631, 62, 63, 'FXAAAA', 'TCEAAA', 'VVVVxx'),
+(8947, 2776, 1, 3, 7, 7, 47, 947, 947, 3947, 8947, 94, 95, 'DGAAAA', 'UCEAAA', 'AAAAxx'),
+(8033, 2777, 1, 1, 3, 13, 33, 33, 33, 3033, 8033, 66, 67, 'ZWAAAA', 'VCEAAA', 'HHHHxx'),
+(6264, 2778, 0, 0, 4, 4, 64, 264, 264, 1264, 6264, 128, 129, 'YGAAAA', 'WCEAAA', 'OOOOxx'),
+(7778, 2779, 0, 2, 8, 18, 78, 778, 1778, 2778, 7778, 156, 157, 'ENAAAA', 'XCEAAA', 'VVVVxx'),
+(9701, 2780, 1, 1, 1, 1, 1, 701, 1701, 4701, 9701, 2, 3, 'DJAAAA', 'YCEAAA', 'AAAAxx'),
+(5091, 2781, 1, 3, 1, 11, 91, 91, 1091, 91, 5091, 182, 183, 'VNAAAA', 'ZCEAAA', 'HHHHxx'),
+(7577, 2782, 1, 1, 7, 17, 77, 577, 1577, 2577, 7577, 154, 155, 'LFAAAA', 'ADEAAA', 'OOOOxx'),
+(3345, 2783, 1, 1, 5, 5, 45, 345, 1345, 3345, 3345, 90, 91, 'RYAAAA', 'BDEAAA', 'VVVVxx'),
+(7329, 2784, 1, 1, 9, 9, 29, 329, 1329, 2329, 7329, 58, 59, 'XVAAAA', 'CDEAAA', 'AAAAxx'),
+(7551, 2785, 1, 3, 1, 11, 51, 551, 1551, 2551, 7551, 102, 103, 'LEAAAA', 'DDEAAA', 'HHHHxx'),
+(6207, 2786, 1, 3, 7, 7, 7, 207, 207, 1207, 6207, 14, 15, 'TEAAAA', 'EDEAAA', 'OOOOxx'),
+(8664, 2787, 0, 0, 4, 4, 64, 664, 664, 3664, 8664, 128, 129, 'GVAAAA', 'FDEAAA', 'VVVVxx'),
+(8394, 2788, 0, 2, 4, 14, 94, 394, 394, 3394, 8394, 188, 189, 'WKAAAA', 'GDEAAA', 'AAAAxx'),
+(7324, 2789, 0, 0, 4, 4, 24, 324, 1324, 2324, 7324, 48, 49, 'SVAAAA', 'HDEAAA', 'HHHHxx'),
+(2713, 2790, 1, 1, 3, 13, 13, 713, 713, 2713, 2713, 26, 27, 'JAAAAA', 'IDEAAA', 'OOOOxx'),
+(2230, 2791, 0, 2, 0, 10, 30, 230, 230, 2230, 2230, 60, 61, 'UHAAAA', 'JDEAAA', 'VVVVxx'),
+(9211, 2792, 1, 3, 1, 11, 11, 211, 1211, 4211, 9211, 22, 23, 'HQAAAA', 'KDEAAA', 'AAAAxx'),
+(1296, 2793, 0, 0, 6, 16, 96, 296, 1296, 1296, 1296, 192, 193, 'WXAAAA', 'LDEAAA', 'HHHHxx'),
+(8104, 2794, 0, 0, 4, 4, 4, 104, 104, 3104, 8104, 8, 9, 'SZAAAA', 'MDEAAA', 'OOOOxx'),
+(6916, 2795, 0, 0, 6, 16, 16, 916, 916, 1916, 6916, 32, 33, 'AGAAAA', 'NDEAAA', 'VVVVxx'),
+(2208, 2796, 0, 0, 8, 8, 8, 208, 208, 2208, 2208, 16, 17, 'YGAAAA', 'ODEAAA', 'AAAAxx'),
+(3935, 2797, 1, 3, 5, 15, 35, 935, 1935, 3935, 3935, 70, 71, 'JVAAAA', 'PDEAAA', 'HHHHxx'),
+(7814, 2798, 0, 2, 4, 14, 14, 814, 1814, 2814, 7814, 28, 29, 'OOAAAA', 'QDEAAA', 'OOOOxx'),
+(6508, 2799, 0, 0, 8, 8, 8, 508, 508, 1508, 6508, 16, 17, 'IQAAAA', 'RDEAAA', 'VVVVxx'),
+(1703, 2800, 1, 3, 3, 3, 3, 703, 1703, 1703, 1703, 6, 7, 'NNAAAA', 'SDEAAA', 'AAAAxx'),
+(5640, 2801, 0, 0, 0, 0, 40, 640, 1640, 640, 5640, 80, 81, 'YIAAAA', 'TDEAAA', 'HHHHxx'),
+(6417, 2802, 1, 1, 7, 17, 17, 417, 417, 1417, 6417, 34, 35, 'VMAAAA', 'UDEAAA', 'OOOOxx'),
+(1713, 2803, 1, 1, 3, 13, 13, 713, 1713, 1713, 1713, 26, 27, 'XNAAAA', 'VDEAAA', 'VVVVxx'),
+(5309, 2804, 1, 1, 9, 9, 9, 309, 1309, 309, 5309, 18, 19, 'FWAAAA', 'WDEAAA', 'AAAAxx'),
+(4364, 2805, 0, 0, 4, 4, 64, 364, 364, 4364, 4364, 128, 129, 'WLAAAA', 'XDEAAA', 'HHHHxx'),
+(619, 2806, 1, 3, 9, 19, 19, 619, 619, 619, 619, 38, 39, 'VXAAAA', 'YDEAAA', 'OOOOxx'),
+(9498, 2807, 0, 2, 8, 18, 98, 498, 1498, 4498, 9498, 196, 197, 'IBAAAA', 'ZDEAAA', 'VVVVxx'),
+(2804, 2808, 0, 0, 4, 4, 4, 804, 804, 2804, 2804, 8, 9, 'WDAAAA', 'AEEAAA', 'AAAAxx'),
+(2220, 2809, 0, 0, 0, 0, 20, 220, 220, 2220, 2220, 40, 41, 'KHAAAA', 'BEEAAA', 'HHHHxx'),
+(9542, 2810, 0, 2, 2, 2, 42, 542, 1542, 4542, 9542, 84, 85, 'ADAAAA', 'CEEAAA', 'OOOOxx'),
+(3349, 2811, 1, 1, 9, 9, 49, 349, 1349, 3349, 3349, 98, 99, 'VYAAAA', 'DEEAAA', 'VVVVxx'),
+(9198, 2812, 0, 2, 8, 18, 98, 198, 1198, 4198, 9198, 196, 197, 'UPAAAA', 'EEEAAA', 'AAAAxx'),
+(2727, 2813, 1, 3, 7, 7, 27, 727, 727, 2727, 2727, 54, 55, 'XAAAAA', 'FEEAAA', 'HHHHxx'),
+(3768, 2814, 0, 0, 8, 8, 68, 768, 1768, 3768, 3768, 136, 137, 'YOAAAA', 'GEEAAA', 'OOOOxx'),
+(2334, 2815, 0, 2, 4, 14, 34, 334, 334, 2334, 2334, 68, 69, 'ULAAAA', 'HEEAAA', 'VVVVxx'),
+(7770, 2816, 0, 2, 0, 10, 70, 770, 1770, 2770, 7770, 140, 141, 'WMAAAA', 'IEEAAA', 'AAAAxx'),
+(5963, 2817, 1, 3, 3, 3, 63, 963, 1963, 963, 5963, 126, 127, 'JVAAAA', 'JEEAAA', 'HHHHxx'),
+(4732, 2818, 0, 0, 2, 12, 32, 732, 732, 4732, 4732, 64, 65, 'AAAAAA', 'KEEAAA', 'OOOOxx'),
+(2448, 2819, 0, 0, 8, 8, 48, 448, 448, 2448, 2448, 96, 97, 'EQAAAA', 'LEEAAA', 'VVVVxx'),
+(5998, 2820, 0, 2, 8, 18, 98, 998, 1998, 998, 5998, 196, 197, 'SWAAAA', 'MEEAAA', 'AAAAxx'),
+(8577, 2821, 1, 1, 7, 17, 77, 577, 577, 3577, 8577, 154, 155, 'XRAAAA', 'NEEAAA', 'HHHHxx'),
+(266, 2822, 0, 2, 6, 6, 66, 266, 266, 266, 266, 132, 133, 'GKAAAA', 'OEEAAA', 'OOOOxx'),
+(2169, 2823, 1, 1, 9, 9, 69, 169, 169, 2169, 2169, 138, 139, 'LFAAAA', 'PEEAAA', 'VVVVxx'),
+(8228, 2824, 0, 0, 8, 8, 28, 228, 228, 3228, 8228, 56, 57, 'MEAAAA', 'QEEAAA', 'AAAAxx'),
+(4813, 2825, 1, 1, 3, 13, 13, 813, 813, 4813, 4813, 26, 27, 'DDAAAA', 'REEAAA', 'HHHHxx'),
+(2769, 2826, 1, 1, 9, 9, 69, 769, 769, 2769, 2769, 138, 139, 'NCAAAA', 'SEEAAA', 'OOOOxx'),
+(8382, 2827, 0, 2, 2, 2, 82, 382, 382, 3382, 8382, 164, 165, 'KKAAAA', 'TEEAAA', 'VVVVxx'),
+(1717, 2828, 1, 1, 7, 17, 17, 717, 1717, 1717, 1717, 34, 35, 'BOAAAA', 'UEEAAA', 'AAAAxx'),
+(7178, 2829, 0, 2, 8, 18, 78, 178, 1178, 2178, 7178, 156, 157, 'CQAAAA', 'VEEAAA', 'HHHHxx'),
+(9547, 2830, 1, 3, 7, 7, 47, 547, 1547, 4547, 9547, 94, 95, 'FDAAAA', 'WEEAAA', 'OOOOxx'),
+(8187, 2831, 1, 3, 7, 7, 87, 187, 187, 3187, 8187, 174, 175, 'XCAAAA', 'XEEAAA', 'VVVVxx'),
+(3168, 2832, 0, 0, 8, 8, 68, 168, 1168, 3168, 3168, 136, 137, 'WRAAAA', 'YEEAAA', 'AAAAxx'),
+(2180, 2833, 0, 0, 0, 0, 80, 180, 180, 2180, 2180, 160, 161, 'WFAAAA', 'ZEEAAA', 'HHHHxx'),
+(859, 2834, 1, 3, 9, 19, 59, 859, 859, 859, 859, 118, 119, 'BHAAAA', 'AFEAAA', 'OOOOxx'),
+(1554, 2835, 0, 2, 4, 14, 54, 554, 1554, 1554, 1554, 108, 109, 'UHAAAA', 'BFEAAA', 'VVVVxx'),
+(3567, 2836, 1, 3, 7, 7, 67, 567, 1567, 3567, 3567, 134, 135, 'FHAAAA', 'CFEAAA', 'AAAAxx'),
+(5985, 2837, 1, 1, 5, 5, 85, 985, 1985, 985, 5985, 170, 171, 'FWAAAA', 'DFEAAA', 'HHHHxx'),
+(1, 2838, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 'BAAAAA', 'EFEAAA', 'OOOOxx'),
+(5937, 2839, 1, 1, 7, 17, 37, 937, 1937, 937, 5937, 74, 75, 'JUAAAA', 'FFEAAA', 'VVVVxx'),
+(7594, 2840, 0, 2, 4, 14, 94, 594, 1594, 2594, 7594, 188, 189, 'CGAAAA', 'GFEAAA', 'AAAAxx'),
+(3783, 2841, 1, 3, 3, 3, 83, 783, 1783, 3783, 3783, 166, 167, 'NPAAAA', 'HFEAAA', 'HHHHxx'),
+(6841, 2842, 1, 1, 1, 1, 41, 841, 841, 1841, 6841, 82, 83, 'DDAAAA', 'IFEAAA', 'OOOOxx'),
+(9694, 2843, 0, 2, 4, 14, 94, 694, 1694, 4694, 9694, 188, 189, 'WIAAAA', 'JFEAAA', 'VVVVxx'),
+(4322, 2844, 0, 2, 2, 2, 22, 322, 322, 4322, 4322, 44, 45, 'GKAAAA', 'KFEAAA', 'AAAAxx'),
+(6012, 2845, 0, 0, 2, 12, 12, 12, 12, 1012, 6012, 24, 25, 'GXAAAA', 'LFEAAA', 'HHHHxx'),
+(108, 2846, 0, 0, 8, 8, 8, 108, 108, 108, 108, 16, 17, 'EEAAAA', 'MFEAAA', 'OOOOxx'),
+(3396, 2847, 0, 0, 6, 16, 96, 396, 1396, 3396, 3396, 192, 193, 'QAAAAA', 'NFEAAA', 'VVVVxx'),
+(8643, 2848, 1, 3, 3, 3, 43, 643, 643, 3643, 8643, 86, 87, 'LUAAAA', 'OFEAAA', 'AAAAxx'),
+(6087, 2849, 1, 3, 7, 7, 87, 87, 87, 1087, 6087, 174, 175, 'DAAAAA', 'PFEAAA', 'HHHHxx'),
+(2629, 2850, 1, 1, 9, 9, 29, 629, 629, 2629, 2629, 58, 59, 'DXAAAA', 'QFEAAA', 'OOOOxx'),
+(3009, 2851, 1, 1, 9, 9, 9, 9, 1009, 3009, 3009, 18, 19, 'TLAAAA', 'RFEAAA', 'VVVVxx'),
+(438, 2852, 0, 2, 8, 18, 38, 438, 438, 438, 438, 76, 77, 'WQAAAA', 'SFEAAA', 'AAAAxx'),
+(2480, 2853, 0, 0, 0, 0, 80, 480, 480, 2480, 2480, 160, 161, 'KRAAAA', 'TFEAAA', 'HHHHxx'),
+(936, 2854, 0, 0, 6, 16, 36, 936, 936, 936, 936, 72, 73, 'AKAAAA', 'UFEAAA', 'OOOOxx'),
+(6, 2855, 0, 2, 6, 6, 6, 6, 6, 6, 6, 12, 13, 'GAAAAA', 'VFEAAA', 'VVVVxx'),
+(768, 2856, 0, 0, 8, 8, 68, 768, 768, 768, 768, 136, 137, 'ODAAAA', 'WFEAAA', 'AAAAxx'),
+(1564, 2857, 0, 0, 4, 4, 64, 564, 1564, 1564, 1564, 128, 129, 'EIAAAA', 'XFEAAA', 'HHHHxx'),
+(3236, 2858, 0, 0, 6, 16, 36, 236, 1236, 3236, 3236, 72, 73, 'MUAAAA', 'YFEAAA', 'OOOOxx'),
+(3932, 2859, 0, 0, 2, 12, 32, 932, 1932, 3932, 3932, 64, 65, 'GVAAAA', 'ZFEAAA', 'VVVVxx'),
+(8914, 2860, 0, 2, 4, 14, 14, 914, 914, 3914, 8914, 28, 29, 'WEAAAA', 'AGEAAA', 'AAAAxx'),
+(119, 2861, 1, 3, 9, 19, 19, 119, 119, 119, 119, 38, 39, 'PEAAAA', 'BGEAAA', 'HHHHxx'),
+(6034, 2862, 0, 2, 4, 14, 34, 34, 34, 1034, 6034, 68, 69, 'CYAAAA', 'CGEAAA', 'OOOOxx'),
+(5384, 2863, 0, 0, 4, 4, 84, 384, 1384, 384, 5384, 168, 169, 'CZAAAA', 'DGEAAA', 'VVVVxx'),
+(6885, 2864, 1, 1, 5, 5, 85, 885, 885, 1885, 6885, 170, 171, 'VEAAAA', 'EGEAAA', 'AAAAxx'),
+(232, 2865, 0, 0, 2, 12, 32, 232, 232, 232, 232, 64, 65, 'YIAAAA', 'FGEAAA', 'HHHHxx'),
+(1293, 2866, 1, 1, 3, 13, 93, 293, 1293, 1293, 1293, 186, 187, 'TXAAAA', 'GGEAAA', 'OOOOxx'),
+(9204, 2867, 0, 0, 4, 4, 4, 204, 1204, 4204, 9204, 8, 9, 'AQAAAA', 'HGEAAA', 'VVVVxx'),
+(527, 2868, 1, 3, 7, 7, 27, 527, 527, 527, 527, 54, 55, 'HUAAAA', 'IGEAAA', 'AAAAxx'),
+(6539, 2869, 1, 3, 9, 19, 39, 539, 539, 1539, 6539, 78, 79, 'NRAAAA', 'JGEAAA', 'HHHHxx'),
+(3679, 2870, 1, 3, 9, 19, 79, 679, 1679, 3679, 3679, 158, 159, 'NLAAAA', 'KGEAAA', 'OOOOxx'),
+(8282, 2871, 0, 2, 2, 2, 82, 282, 282, 3282, 8282, 164, 165, 'OGAAAA', 'LGEAAA', 'VVVVxx'),
+(5027, 2872, 1, 3, 7, 7, 27, 27, 1027, 27, 5027, 54, 55, 'JLAAAA', 'MGEAAA', 'AAAAxx'),
+(7694, 2873, 0, 2, 4, 14, 94, 694, 1694, 2694, 7694, 188, 189, 'YJAAAA', 'NGEAAA', 'HHHHxx'),
+(473, 2874, 1, 1, 3, 13, 73, 473, 473, 473, 473, 146, 147, 'FSAAAA', 'OGEAAA', 'OOOOxx'),
+(6325, 2875, 1, 1, 5, 5, 25, 325, 325, 1325, 6325, 50, 51, 'HJAAAA', 'PGEAAA', 'VVVVxx'),
+(8761, 2876, 1, 1, 1, 1, 61, 761, 761, 3761, 8761, 122, 123, 'ZYAAAA', 'QGEAAA', 'AAAAxx'),
+(6184, 2877, 0, 0, 4, 4, 84, 184, 184, 1184, 6184, 168, 169, 'WDAAAA', 'RGEAAA', 'HHHHxx'),
+(419, 2878, 1, 3, 9, 19, 19, 419, 419, 419, 419, 38, 39, 'DQAAAA', 'SGEAAA', 'OOOOxx'),
+(6111, 2879, 1, 3, 1, 11, 11, 111, 111, 1111, 6111, 22, 23, 'BBAAAA', 'TGEAAA', 'VVVVxx'),
+(3836, 2880, 0, 0, 6, 16, 36, 836, 1836, 3836, 3836, 72, 73, 'ORAAAA', 'UGEAAA', 'AAAAxx'),
+(4086, 2881, 0, 2, 6, 6, 86, 86, 86, 4086, 4086, 172, 173, 'EBAAAA', 'VGEAAA', 'HHHHxx'),
+(5818, 2882, 0, 2, 8, 18, 18, 818, 1818, 818, 5818, 36, 37, 'UPAAAA', 'WGEAAA', 'OOOOxx'),
+(4528, 2883, 0, 0, 8, 8, 28, 528, 528, 4528, 4528, 56, 57, 'ESAAAA', 'XGEAAA', 'VVVVxx'),
+(7199, 2884, 1, 3, 9, 19, 99, 199, 1199, 2199, 7199, 198, 199, 'XQAAAA', 'YGEAAA', 'AAAAxx'),
+(1847, 2885, 1, 3, 7, 7, 47, 847, 1847, 1847, 1847, 94, 95, 'BTAAAA', 'ZGEAAA', 'HHHHxx'),
+(2875, 2886, 1, 3, 5, 15, 75, 875, 875, 2875, 2875, 150, 151, 'PGAAAA', 'AHEAAA', 'OOOOxx'),
+(2872, 2887, 0, 0, 2, 12, 72, 872, 872, 2872, 2872, 144, 145, 'MGAAAA', 'BHEAAA', 'VVVVxx'),
+(3972, 2888, 0, 0, 2, 12, 72, 972, 1972, 3972, 3972, 144, 145, 'UWAAAA', 'CHEAAA', 'AAAAxx'),
+(7590, 2889, 0, 2, 0, 10, 90, 590, 1590, 2590, 7590, 180, 181, 'YFAAAA', 'DHEAAA', 'HHHHxx'),
+(1914, 2890, 0, 2, 4, 14, 14, 914, 1914, 1914, 1914, 28, 29, 'QVAAAA', 'EHEAAA', 'OOOOxx'),
+(1658, 2891, 0, 2, 8, 18, 58, 658, 1658, 1658, 1658, 116, 117, 'ULAAAA', 'FHEAAA', 'VVVVxx'),
+(2126, 2892, 0, 2, 6, 6, 26, 126, 126, 2126, 2126, 52, 53, 'UDAAAA', 'GHEAAA', 'AAAAxx'),
+(645, 2893, 1, 1, 5, 5, 45, 645, 645, 645, 645, 90, 91, 'VYAAAA', 'HHEAAA', 'HHHHxx'),
+(6636, 2894, 0, 0, 6, 16, 36, 636, 636, 1636, 6636, 72, 73, 'GVAAAA', 'IHEAAA', 'OOOOxx'),
+(1469, 2895, 1, 1, 9, 9, 69, 469, 1469, 1469, 1469, 138, 139, 'NEAAAA', 'JHEAAA', 'VVVVxx'),
+(1377, 2896, 1, 1, 7, 17, 77, 377, 1377, 1377, 1377, 154, 155, 'ZAAAAA', 'KHEAAA', 'AAAAxx'),
+(8425, 2897, 1, 1, 5, 5, 25, 425, 425, 3425, 8425, 50, 51, 'BMAAAA', 'LHEAAA', 'HHHHxx'),
+(9300, 2898, 0, 0, 0, 0, 0, 300, 1300, 4300, 9300, 0, 1, 'STAAAA', 'MHEAAA', 'OOOOxx'),
+(5355, 2899, 1, 3, 5, 15, 55, 355, 1355, 355, 5355, 110, 111, 'ZXAAAA', 'NHEAAA', 'VVVVxx'),
+(840, 2900, 0, 0, 0, 0, 40, 840, 840, 840, 840, 80, 81, 'IGAAAA', 'OHEAAA', 'AAAAxx'),
+(5185, 2901, 1, 1, 5, 5, 85, 185, 1185, 185, 5185, 170, 171, 'LRAAAA', 'PHEAAA', 'HHHHxx'),
+(6467, 2902, 1, 3, 7, 7, 67, 467, 467, 1467, 6467, 134, 135, 'TOAAAA', 'QHEAAA', 'OOOOxx'),
+(58, 2903, 0, 2, 8, 18, 58, 58, 58, 58, 58, 116, 117, 'GCAAAA', 'RHEAAA', 'VVVVxx'),
+(5051, 2904, 1, 3, 1, 11, 51, 51, 1051, 51, 5051, 102, 103, 'HMAAAA', 'SHEAAA', 'AAAAxx'),
+(8901, 2905, 1, 1, 1, 1, 1, 901, 901, 3901, 8901, 2, 3, 'JEAAAA', 'THEAAA', 'HHHHxx'),
+(1550, 2906, 0, 2, 0, 10, 50, 550, 1550, 1550, 1550, 100, 101, 'QHAAAA', 'UHEAAA', 'OOOOxx'),
+(1698, 2907, 0, 2, 8, 18, 98, 698, 1698, 1698, 1698, 196, 197, 'INAAAA', 'VHEAAA', 'VVVVxx'),
+(802, 2908, 0, 2, 2, 2, 2, 802, 802, 802, 802, 4, 5, 'WEAAAA', 'WHEAAA', 'AAAAxx'),
+(2440, 2909, 0, 0, 0, 0, 40, 440, 440, 2440, 2440, 80, 81, 'WPAAAA', 'XHEAAA', 'HHHHxx'),
+(2260, 2910, 0, 0, 0, 0, 60, 260, 260, 2260, 2260, 120, 121, 'YIAAAA', 'YHEAAA', 'OOOOxx'),
+(8218, 2911, 0, 2, 8, 18, 18, 218, 218, 3218, 8218, 36, 37, 'CEAAAA', 'ZHEAAA', 'VVVVxx'),
+(5144, 2912, 0, 0, 4, 4, 44, 144, 1144, 144, 5144, 88, 89, 'WPAAAA', 'AIEAAA', 'AAAAxx'),
+(4822, 2913, 0, 2, 2, 2, 22, 822, 822, 4822, 4822, 44, 45, 'MDAAAA', 'BIEAAA', 'HHHHxx'),
+(9476, 2914, 0, 0, 6, 16, 76, 476, 1476, 4476, 9476, 152, 153, 'MAAAAA', 'CIEAAA', 'OOOOxx'),
+(7535, 2915, 1, 3, 5, 15, 35, 535, 1535, 2535, 7535, 70, 71, 'VDAAAA', 'DIEAAA', 'VVVVxx'),
+(8738, 2916, 0, 2, 8, 18, 38, 738, 738, 3738, 8738, 76, 77, 'CYAAAA', 'EIEAAA', 'AAAAxx'),
+(7946, 2917, 0, 2, 6, 6, 46, 946, 1946, 2946, 7946, 92, 93, 'QTAAAA', 'FIEAAA', 'HHHHxx'),
+(8143, 2918, 1, 3, 3, 3, 43, 143, 143, 3143, 8143, 86, 87, 'FBAAAA', 'GIEAAA', 'OOOOxx'),
+(2623, 2919, 1, 3, 3, 3, 23, 623, 623, 2623, 2623, 46, 47, 'XWAAAA', 'HIEAAA', 'VVVVxx'),
+(5209, 2920, 1, 1, 9, 9, 9, 209, 1209, 209, 5209, 18, 19, 'JSAAAA', 'IIEAAA', 'AAAAxx'),
+(7674, 2921, 0, 2, 4, 14, 74, 674, 1674, 2674, 7674, 148, 149, 'EJAAAA', 'JIEAAA', 'HHHHxx'),
+(1135, 2922, 1, 3, 5, 15, 35, 135, 1135, 1135, 1135, 70, 71, 'RRAAAA', 'KIEAAA', 'OOOOxx'),
+(424, 2923, 0, 0, 4, 4, 24, 424, 424, 424, 424, 48, 49, 'IQAAAA', 'LIEAAA', 'VVVVxx'),
+(942, 2924, 0, 2, 2, 2, 42, 942, 942, 942, 942, 84, 85, 'GKAAAA', 'MIEAAA', 'AAAAxx'),
+(7813, 2925, 1, 1, 3, 13, 13, 813, 1813, 2813, 7813, 26, 27, 'NOAAAA', 'NIEAAA', 'HHHHxx'),
+(3539, 2926, 1, 3, 9, 19, 39, 539, 1539, 3539, 3539, 78, 79, 'DGAAAA', 'OIEAAA', 'OOOOxx'),
+(2909, 2927, 1, 1, 9, 9, 9, 909, 909, 2909, 2909, 18, 19, 'XHAAAA', 'PIEAAA', 'VVVVxx'),
+(3748, 2928, 0, 0, 8, 8, 48, 748, 1748, 3748, 3748, 96, 97, 'EOAAAA', 'QIEAAA', 'AAAAxx'),
+(2996, 2929, 0, 0, 6, 16, 96, 996, 996, 2996, 2996, 192, 193, 'GLAAAA', 'RIEAAA', 'HHHHxx'),
+(1869, 2930, 1, 1, 9, 9, 69, 869, 1869, 1869, 1869, 138, 139, 'XTAAAA', 'SIEAAA', 'OOOOxx'),
+(8151, 2931, 1, 3, 1, 11, 51, 151, 151, 3151, 8151, 102, 103, 'NBAAAA', 'TIEAAA', 'VVVVxx'),
+(6361, 2932, 1, 1, 1, 1, 61, 361, 361, 1361, 6361, 122, 123, 'RKAAAA', 'UIEAAA', 'AAAAxx'),
+(5568, 2933, 0, 0, 8, 8, 68, 568, 1568, 568, 5568, 136, 137, 'EGAAAA', 'VIEAAA', 'HHHHxx'),
+(2796, 2934, 0, 0, 6, 16, 96, 796, 796, 2796, 2796, 192, 193, 'ODAAAA', 'WIEAAA', 'OOOOxx'),
+(8489, 2935, 1, 1, 9, 9, 89, 489, 489, 3489, 8489, 178, 179, 'NOAAAA', 'XIEAAA', 'VVVVxx'),
+(9183, 2936, 1, 3, 3, 3, 83, 183, 1183, 4183, 9183, 166, 167, 'FPAAAA', 'YIEAAA', 'AAAAxx'),
+(8227, 2937, 1, 3, 7, 7, 27, 227, 227, 3227, 8227, 54, 55, 'LEAAAA', 'ZIEAAA', 'HHHHxx'),
+(1844, 2938, 0, 0, 4, 4, 44, 844, 1844, 1844, 1844, 88, 89, 'YSAAAA', 'AJEAAA', 'OOOOxx'),
+(3975, 2939, 1, 3, 5, 15, 75, 975, 1975, 3975, 3975, 150, 151, 'XWAAAA', 'BJEAAA', 'VVVVxx'),
+(6490, 2940, 0, 2, 0, 10, 90, 490, 490, 1490, 6490, 180, 181, 'QPAAAA', 'CJEAAA', 'AAAAxx'),
+(8303, 2941, 1, 3, 3, 3, 3, 303, 303, 3303, 8303, 6, 7, 'JHAAAA', 'DJEAAA', 'HHHHxx'),
+(7334, 2942, 0, 2, 4, 14, 34, 334, 1334, 2334, 7334, 68, 69, 'CWAAAA', 'EJEAAA', 'OOOOxx'),
+(2382, 2943, 0, 2, 2, 2, 82, 382, 382, 2382, 2382, 164, 165, 'QNAAAA', 'FJEAAA', 'VVVVxx'),
+(177, 2944, 1, 1, 7, 17, 77, 177, 177, 177, 177, 154, 155, 'VGAAAA', 'GJEAAA', 'AAAAxx'),
+(8117, 2945, 1, 1, 7, 17, 17, 117, 117, 3117, 8117, 34, 35, 'FAAAAA', 'HJEAAA', 'HHHHxx'),
+(5485, 2946, 1, 1, 5, 5, 85, 485, 1485, 485, 5485, 170, 171, 'ZCAAAA', 'IJEAAA', 'OOOOxx'),
+(6544, 2947, 0, 0, 4, 4, 44, 544, 544, 1544, 6544, 88, 89, 'SRAAAA', 'JJEAAA', 'VVVVxx'),
+(8517, 2948, 1, 1, 7, 17, 17, 517, 517, 3517, 8517, 34, 35, 'PPAAAA', 'KJEAAA', 'AAAAxx'),
+(2252, 2949, 0, 0, 2, 12, 52, 252, 252, 2252, 2252, 104, 105, 'QIAAAA', 'LJEAAA', 'HHHHxx'),
+(4480, 2950, 0, 0, 0, 0, 80, 480, 480, 4480, 4480, 160, 161, 'IQAAAA', 'MJEAAA', 'OOOOxx'),
+(4785, 2951, 1, 1, 5, 5, 85, 785, 785, 4785, 4785, 170, 171, 'BCAAAA', 'NJEAAA', 'VVVVxx'),
+(9700, 2952, 0, 0, 0, 0, 0, 700, 1700, 4700, 9700, 0, 1, 'CJAAAA', 'OJEAAA', 'AAAAxx'),
+(2122, 2953, 0, 2, 2, 2, 22, 122, 122, 2122, 2122, 44, 45, 'QDAAAA', 'PJEAAA', 'HHHHxx'),
+(8783, 2954, 1, 3, 3, 3, 83, 783, 783, 3783, 8783, 166, 167, 'VZAAAA', 'QJEAAA', 'OOOOxx'),
+(1453, 2955, 1, 1, 3, 13, 53, 453, 1453, 1453, 1453, 106, 107, 'XDAAAA', 'RJEAAA', 'VVVVxx'),
+(3908, 2956, 0, 0, 8, 8, 8, 908, 1908, 3908, 3908, 16, 17, 'IUAAAA', 'SJEAAA', 'AAAAxx'),
+(7707, 2957, 1, 3, 7, 7, 7, 707, 1707, 2707, 7707, 14, 15, 'LKAAAA', 'TJEAAA', 'HHHHxx'),
+(9049, 2958, 1, 1, 9, 9, 49, 49, 1049, 4049, 9049, 98, 99, 'BKAAAA', 'UJEAAA', 'OOOOxx'),
+(654, 2959, 0, 2, 4, 14, 54, 654, 654, 654, 654, 108, 109, 'EZAAAA', 'VJEAAA', 'VVVVxx'),
+(3336, 2960, 0, 0, 6, 16, 36, 336, 1336, 3336, 3336, 72, 73, 'IYAAAA', 'WJEAAA', 'AAAAxx'),
+(622, 2961, 0, 2, 2, 2, 22, 622, 622, 622, 622, 44, 45, 'YXAAAA', 'XJEAAA', 'HHHHxx'),
+(8398, 2962, 0, 2, 8, 18, 98, 398, 398, 3398, 8398, 196, 197, 'ALAAAA', 'YJEAAA', 'OOOOxx'),
+(9193, 2963, 1, 1, 3, 13, 93, 193, 1193, 4193, 9193, 186, 187, 'PPAAAA', 'ZJEAAA', 'VVVVxx'),
+(7896, 2964, 0, 0, 6, 16, 96, 896, 1896, 2896, 7896, 192, 193, 'SRAAAA', 'AKEAAA', 'AAAAxx'),
+(9798, 2965, 0, 2, 8, 18, 98, 798, 1798, 4798, 9798, 196, 197, 'WMAAAA', 'BKEAAA', 'HHHHxx'),
+(2881, 2966, 1, 1, 1, 1, 81, 881, 881, 2881, 2881, 162, 163, 'VGAAAA', 'CKEAAA', 'OOOOxx'),
+(672, 2967, 0, 0, 2, 12, 72, 672, 672, 672, 672, 144, 145, 'WZAAAA', 'DKEAAA', 'VVVVxx'),
+(6743, 2968, 1, 3, 3, 3, 43, 743, 743, 1743, 6743, 86, 87, 'JZAAAA', 'EKEAAA', 'AAAAxx'),
+(8935, 2969, 1, 3, 5, 15, 35, 935, 935, 3935, 8935, 70, 71, 'RFAAAA', 'FKEAAA', 'HHHHxx'),
+(2426, 2970, 0, 2, 6, 6, 26, 426, 426, 2426, 2426, 52, 53, 'IPAAAA', 'GKEAAA', 'OOOOxx'),
+(722, 2971, 0, 2, 2, 2, 22, 722, 722, 722, 722, 44, 45, 'UBAAAA', 'HKEAAA', 'VVVVxx'),
+(5088, 2972, 0, 0, 8, 8, 88, 88, 1088, 88, 5088, 176, 177, 'SNAAAA', 'IKEAAA', 'AAAAxx'),
+(8677, 2973, 1, 1, 7, 17, 77, 677, 677, 3677, 8677, 154, 155, 'TVAAAA', 'JKEAAA', 'HHHHxx'),
+(6963, 2974, 1, 3, 3, 3, 63, 963, 963, 1963, 6963, 126, 127, 'VHAAAA', 'KKEAAA', 'OOOOxx'),
+(1653, 2975, 1, 1, 3, 13, 53, 653, 1653, 1653, 1653, 106, 107, 'PLAAAA', 'LKEAAA', 'VVVVxx'),
+(7295, 2976, 1, 3, 5, 15, 95, 295, 1295, 2295, 7295, 190, 191, 'PUAAAA', 'MKEAAA', 'AAAAxx'),
+(6675, 2977, 1, 3, 5, 15, 75, 675, 675, 1675, 6675, 150, 151, 'TWAAAA', 'NKEAAA', 'HHHHxx'),
+(7183, 2978, 1, 3, 3, 3, 83, 183, 1183, 2183, 7183, 166, 167, 'HQAAAA', 'OKEAAA', 'OOOOxx'),
+(4378, 2979, 0, 2, 8, 18, 78, 378, 378, 4378, 4378, 156, 157, 'KMAAAA', 'PKEAAA', 'VVVVxx'),
+(2157, 2980, 1, 1, 7, 17, 57, 157, 157, 2157, 2157, 114, 115, 'ZEAAAA', 'QKEAAA', 'AAAAxx'),
+(2621, 2981, 1, 1, 1, 1, 21, 621, 621, 2621, 2621, 42, 43, 'VWAAAA', 'RKEAAA', 'HHHHxx'),
+(9278, 2982, 0, 2, 8, 18, 78, 278, 1278, 4278, 9278, 156, 157, 'WSAAAA', 'SKEAAA', 'OOOOxx'),
+(79, 2983, 1, 3, 9, 19, 79, 79, 79, 79, 79, 158, 159, 'BDAAAA', 'TKEAAA', 'VVVVxx'),
+(7358, 2984, 0, 2, 8, 18, 58, 358, 1358, 2358, 7358, 116, 117, 'AXAAAA', 'UKEAAA', 'AAAAxx'),
+(3589, 2985, 1, 1, 9, 9, 89, 589, 1589, 3589, 3589, 178, 179, 'BIAAAA', 'VKEAAA', 'HHHHxx'),
+(1254, 2986, 0, 2, 4, 14, 54, 254, 1254, 1254, 1254, 108, 109, 'GWAAAA', 'WKEAAA', 'OOOOxx'),
+(3490, 2987, 0, 2, 0, 10, 90, 490, 1490, 3490, 3490, 180, 181, 'GEAAAA', 'XKEAAA', 'VVVVxx'),
+(7533, 2988, 1, 1, 3, 13, 33, 533, 1533, 2533, 7533, 66, 67, 'TDAAAA', 'YKEAAA', 'AAAAxx'),
+(2800, 2989, 0, 0, 0, 0, 0, 800, 800, 2800, 2800, 0, 1, 'SDAAAA', 'ZKEAAA', 'HHHHxx'),
+(351, 2990, 1, 3, 1, 11, 51, 351, 351, 351, 351, 102, 103, 'NNAAAA', 'ALEAAA', 'OOOOxx'),
+(4359, 2991, 1, 3, 9, 19, 59, 359, 359, 4359, 4359, 118, 119, 'RLAAAA', 'BLEAAA', 'VVVVxx'),
+(5788, 2992, 0, 0, 8, 8, 88, 788, 1788, 788, 5788, 176, 177, 'QOAAAA', 'CLEAAA', 'AAAAxx'),
+(5521, 2993, 1, 1, 1, 1, 21, 521, 1521, 521, 5521, 42, 43, 'JEAAAA', 'DLEAAA', 'HHHHxx'),
+(3351, 2994, 1, 3, 1, 11, 51, 351, 1351, 3351, 3351, 102, 103, 'XYAAAA', 'ELEAAA', 'OOOOxx'),
+(5129, 2995, 1, 1, 9, 9, 29, 129, 1129, 129, 5129, 58, 59, 'HPAAAA', 'FLEAAA', 'VVVVxx'),
+(315, 2996, 1, 3, 5, 15, 15, 315, 315, 315, 315, 30, 31, 'DMAAAA', 'GLEAAA', 'AAAAxx'),
+(7552, 2997, 0, 0, 2, 12, 52, 552, 1552, 2552, 7552, 104, 105, 'MEAAAA', 'HLEAAA', 'HHHHxx'),
+(9176, 2998, 0, 0, 6, 16, 76, 176, 1176, 4176, 9176, 152, 153, 'YOAAAA', 'ILEAAA', 'OOOOxx'),
+(7458, 2999, 0, 2, 8, 18, 58, 458, 1458, 2458, 7458, 116, 117, 'WAAAAA', 'JLEAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(279, 3000, 1, 3, 9, 19, 79, 279, 279, 279, 279, 158, 159, 'TKAAAA', 'KLEAAA', 'AAAAxx'),
+(738, 3001, 0, 2, 8, 18, 38, 738, 738, 738, 738, 76, 77, 'KCAAAA', 'LLEAAA', 'HHHHxx'),
+(2557, 3002, 1, 1, 7, 17, 57, 557, 557, 2557, 2557, 114, 115, 'JUAAAA', 'MLEAAA', 'OOOOxx'),
+(9395, 3003, 1, 3, 5, 15, 95, 395, 1395, 4395, 9395, 190, 191, 'JXAAAA', 'NLEAAA', 'VVVVxx'),
+(7214, 3004, 0, 2, 4, 14, 14, 214, 1214, 2214, 7214, 28, 29, 'MRAAAA', 'OLEAAA', 'AAAAxx'),
+(6354, 3005, 0, 2, 4, 14, 54, 354, 354, 1354, 6354, 108, 109, 'KKAAAA', 'PLEAAA', 'HHHHxx'),
+(4799, 3006, 1, 3, 9, 19, 99, 799, 799, 4799, 4799, 198, 199, 'PCAAAA', 'QLEAAA', 'OOOOxx'),
+(1231, 3007, 1, 3, 1, 11, 31, 231, 1231, 1231, 1231, 62, 63, 'JVAAAA', 'RLEAAA', 'VVVVxx'),
+(5252, 3008, 0, 0, 2, 12, 52, 252, 1252, 252, 5252, 104, 105, 'AUAAAA', 'SLEAAA', 'AAAAxx'),
+(5250, 3009, 0, 2, 0, 10, 50, 250, 1250, 250, 5250, 100, 101, 'YTAAAA', 'TLEAAA', 'HHHHxx'),
+(9319, 3010, 1, 3, 9, 19, 19, 319, 1319, 4319, 9319, 38, 39, 'LUAAAA', 'ULEAAA', 'OOOOxx'),
+(1724, 3011, 0, 0, 4, 4, 24, 724, 1724, 1724, 1724, 48, 49, 'IOAAAA', 'VLEAAA', 'VVVVxx'),
+(7947, 3012, 1, 3, 7, 7, 47, 947, 1947, 2947, 7947, 94, 95, 'RTAAAA', 'WLEAAA', 'AAAAxx'),
+(1105, 3013, 1, 1, 5, 5, 5, 105, 1105, 1105, 1105, 10, 11, 'NQAAAA', 'XLEAAA', 'HHHHxx'),
+(1417, 3014, 1, 1, 7, 17, 17, 417, 1417, 1417, 1417, 34, 35, 'NCAAAA', 'YLEAAA', 'OOOOxx'),
+(7101, 3015, 1, 1, 1, 1, 1, 101, 1101, 2101, 7101, 2, 3, 'DNAAAA', 'ZLEAAA', 'VVVVxx'),
+(1088, 3016, 0, 0, 8, 8, 88, 88, 1088, 1088, 1088, 176, 177, 'WPAAAA', 'AMEAAA', 'AAAAxx'),
+(979, 3017, 1, 3, 9, 19, 79, 979, 979, 979, 979, 158, 159, 'RLAAAA', 'BMEAAA', 'HHHHxx'),
+(7589, 3018, 1, 1, 9, 9, 89, 589, 1589, 2589, 7589, 178, 179, 'XFAAAA', 'CMEAAA', 'OOOOxx'),
+(8952, 3019, 0, 0, 2, 12, 52, 952, 952, 3952, 8952, 104, 105, 'IGAAAA', 'DMEAAA', 'VVVVxx'),
+(2864, 3020, 0, 0, 4, 4, 64, 864, 864, 2864, 2864, 128, 129, 'EGAAAA', 'EMEAAA', 'AAAAxx'),
+(234, 3021, 0, 2, 4, 14, 34, 234, 234, 234, 234, 68, 69, 'AJAAAA', 'FMEAAA', 'HHHHxx'),
+(7231, 3022, 1, 3, 1, 11, 31, 231, 1231, 2231, 7231, 62, 63, 'DSAAAA', 'GMEAAA', 'OOOOxx'),
+(6792, 3023, 0, 0, 2, 12, 92, 792, 792, 1792, 6792, 184, 185, 'GBAAAA', 'HMEAAA', 'VVVVxx'),
+(4311, 3024, 1, 3, 1, 11, 11, 311, 311, 4311, 4311, 22, 23, 'VJAAAA', 'IMEAAA', 'AAAAxx'),
+(3374, 3025, 0, 2, 4, 14, 74, 374, 1374, 3374, 3374, 148, 149, 'UZAAAA', 'JMEAAA', 'HHHHxx'),
+(3367, 3026, 1, 3, 7, 7, 67, 367, 1367, 3367, 3367, 134, 135, 'NZAAAA', 'KMEAAA', 'OOOOxx'),
+(2598, 3027, 0, 2, 8, 18, 98, 598, 598, 2598, 2598, 196, 197, 'YVAAAA', 'LMEAAA', 'VVVVxx'),
+(1033, 3028, 1, 1, 3, 13, 33, 33, 1033, 1033, 1033, 66, 67, 'TNAAAA', 'MMEAAA', 'AAAAxx'),
+(7803, 3029, 1, 3, 3, 3, 3, 803, 1803, 2803, 7803, 6, 7, 'DOAAAA', 'NMEAAA', 'HHHHxx'),
+(3870, 3030, 0, 2, 0, 10, 70, 870, 1870, 3870, 3870, 140, 141, 'WSAAAA', 'OMEAAA', 'OOOOxx'),
+(4962, 3031, 0, 2, 2, 2, 62, 962, 962, 4962, 4962, 124, 125, 'WIAAAA', 'PMEAAA', 'VVVVxx'),
+(4842, 3032, 0, 2, 2, 2, 42, 842, 842, 4842, 4842, 84, 85, 'GEAAAA', 'QMEAAA', 'AAAAxx'),
+(8814, 3033, 0, 2, 4, 14, 14, 814, 814, 3814, 8814, 28, 29, 'ABAAAA', 'RMEAAA', 'HHHHxx'),
+(3429, 3034, 1, 1, 9, 9, 29, 429, 1429, 3429, 3429, 58, 59, 'XBAAAA', 'SMEAAA', 'OOOOxx'),
+(6550, 3035, 0, 2, 0, 10, 50, 550, 550, 1550, 6550, 100, 101, 'YRAAAA', 'TMEAAA', 'VVVVxx'),
+(6317, 3036, 1, 1, 7, 17, 17, 317, 317, 1317, 6317, 34, 35, 'ZIAAAA', 'UMEAAA', 'AAAAxx'),
+(5023, 3037, 1, 3, 3, 3, 23, 23, 1023, 23, 5023, 46, 47, 'FLAAAA', 'VMEAAA', 'HHHHxx'),
+(5825, 3038, 1, 1, 5, 5, 25, 825, 1825, 825, 5825, 50, 51, 'BQAAAA', 'WMEAAA', 'OOOOxx'),
+(5297, 3039, 1, 1, 7, 17, 97, 297, 1297, 297, 5297, 194, 195, 'TVAAAA', 'XMEAAA', 'VVVVxx'),
+(8764, 3040, 0, 0, 4, 4, 64, 764, 764, 3764, 8764, 128, 129, 'CZAAAA', 'YMEAAA', 'AAAAxx'),
+(5084, 3041, 0, 0, 4, 4, 84, 84, 1084, 84, 5084, 168, 169, 'ONAAAA', 'ZMEAAA', 'HHHHxx'),
+(6808, 3042, 0, 0, 8, 8, 8, 808, 808, 1808, 6808, 16, 17, 'WBAAAA', 'ANEAAA', 'OOOOxx'),
+(1780, 3043, 0, 0, 0, 0, 80, 780, 1780, 1780, 1780, 160, 161, 'MQAAAA', 'BNEAAA', 'VVVVxx'),
+(4092, 3044, 0, 0, 2, 12, 92, 92, 92, 4092, 4092, 184, 185, 'KBAAAA', 'CNEAAA', 'AAAAxx'),
+(3618, 3045, 0, 2, 8, 18, 18, 618, 1618, 3618, 3618, 36, 37, 'EJAAAA', 'DNEAAA', 'HHHHxx'),
+(7299, 3046, 1, 3, 9, 19, 99, 299, 1299, 2299, 7299, 198, 199, 'TUAAAA', 'ENEAAA', 'OOOOxx'),
+(8544, 3047, 0, 0, 4, 4, 44, 544, 544, 3544, 8544, 88, 89, 'QQAAAA', 'FNEAAA', 'VVVVxx'),
+(2359, 3048, 1, 3, 9, 19, 59, 359, 359, 2359, 2359, 118, 119, 'TMAAAA', 'GNEAAA', 'AAAAxx'),
+(1939, 3049, 1, 3, 9, 19, 39, 939, 1939, 1939, 1939, 78, 79, 'PWAAAA', 'HNEAAA', 'HHHHxx'),
+(5834, 3050, 0, 2, 4, 14, 34, 834, 1834, 834, 5834, 68, 69, 'KQAAAA', 'INEAAA', 'OOOOxx'),
+(1997, 3051, 1, 1, 7, 17, 97, 997, 1997, 1997, 1997, 194, 195, 'VYAAAA', 'JNEAAA', 'VVVVxx'),
+(7917, 3052, 1, 1, 7, 17, 17, 917, 1917, 2917, 7917, 34, 35, 'NSAAAA', 'KNEAAA', 'AAAAxx'),
+(2098, 3053, 0, 2, 8, 18, 98, 98, 98, 2098, 2098, 196, 197, 'SCAAAA', 'LNEAAA', 'HHHHxx'),
+(7576, 3054, 0, 0, 6, 16, 76, 576, 1576, 2576, 7576, 152, 153, 'KFAAAA', 'MNEAAA', 'OOOOxx'),
+(376, 3055, 0, 0, 6, 16, 76, 376, 376, 376, 376, 152, 153, 'MOAAAA', 'NNEAAA', 'VVVVxx'),
+(8535, 3056, 1, 3, 5, 15, 35, 535, 535, 3535, 8535, 70, 71, 'HQAAAA', 'ONEAAA', 'AAAAxx'),
+(5659, 3057, 1, 3, 9, 19, 59, 659, 1659, 659, 5659, 118, 119, 'RJAAAA', 'PNEAAA', 'HHHHxx'),
+(2786, 3058, 0, 2, 6, 6, 86, 786, 786, 2786, 2786, 172, 173, 'EDAAAA', 'QNEAAA', 'OOOOxx'),
+(8820, 3059, 0, 0, 0, 0, 20, 820, 820, 3820, 8820, 40, 41, 'GBAAAA', 'RNEAAA', 'VVVVxx'),
+(1229, 3060, 1, 1, 9, 9, 29, 229, 1229, 1229, 1229, 58, 59, 'HVAAAA', 'SNEAAA', 'AAAAxx'),
+(9321, 3061, 1, 1, 1, 1, 21, 321, 1321, 4321, 9321, 42, 43, 'NUAAAA', 'TNEAAA', 'HHHHxx'),
+(7662, 3062, 0, 2, 2, 2, 62, 662, 1662, 2662, 7662, 124, 125, 'SIAAAA', 'UNEAAA', 'OOOOxx'),
+(5535, 3063, 1, 3, 5, 15, 35, 535, 1535, 535, 5535, 70, 71, 'XEAAAA', 'VNEAAA', 'VVVVxx'),
+(4889, 3064, 1, 1, 9, 9, 89, 889, 889, 4889, 4889, 178, 179, 'BGAAAA', 'WNEAAA', 'AAAAxx'),
+(8259, 3065, 1, 3, 9, 19, 59, 259, 259, 3259, 8259, 118, 119, 'RFAAAA', 'XNEAAA', 'HHHHxx'),
+(6789, 3066, 1, 1, 9, 9, 89, 789, 789, 1789, 6789, 178, 179, 'DBAAAA', 'YNEAAA', 'OOOOxx'),
+(5411, 3067, 1, 3, 1, 11, 11, 411, 1411, 411, 5411, 22, 23, 'DAAAAA', 'ZNEAAA', 'VVVVxx'),
+(6992, 3068, 0, 0, 2, 12, 92, 992, 992, 1992, 6992, 184, 185, 'YIAAAA', 'AOEAAA', 'AAAAxx'),
+(7698, 3069, 0, 2, 8, 18, 98, 698, 1698, 2698, 7698, 196, 197, 'CKAAAA', 'BOEAAA', 'HHHHxx'),
+(2342, 3070, 0, 2, 2, 2, 42, 342, 342, 2342, 2342, 84, 85, 'CMAAAA', 'COEAAA', 'OOOOxx'),
+(1501, 3071, 1, 1, 1, 1, 1, 501, 1501, 1501, 1501, 2, 3, 'TFAAAA', 'DOEAAA', 'VVVVxx'),
+(6322, 3072, 0, 2, 2, 2, 22, 322, 322, 1322, 6322, 44, 45, 'EJAAAA', 'EOEAAA', 'AAAAxx'),
+(9861, 3073, 1, 1, 1, 1, 61, 861, 1861, 4861, 9861, 122, 123, 'HPAAAA', 'FOEAAA', 'HHHHxx'),
+(9802, 3074, 0, 2, 2, 2, 2, 802, 1802, 4802, 9802, 4, 5, 'ANAAAA', 'GOEAAA', 'OOOOxx'),
+(4750, 3075, 0, 2, 0, 10, 50, 750, 750, 4750, 4750, 100, 101, 'SAAAAA', 'HOEAAA', 'VVVVxx'),
+(5855, 3076, 1, 3, 5, 15, 55, 855, 1855, 855, 5855, 110, 111, 'FRAAAA', 'IOEAAA', 'AAAAxx'),
+(4304, 3077, 0, 0, 4, 4, 4, 304, 304, 4304, 4304, 8, 9, 'OJAAAA', 'JOEAAA', 'HHHHxx'),
+(2605, 3078, 1, 1, 5, 5, 5, 605, 605, 2605, 2605, 10, 11, 'FWAAAA', 'KOEAAA', 'OOOOxx'),
+(1802, 3079, 0, 2, 2, 2, 2, 802, 1802, 1802, 1802, 4, 5, 'IRAAAA', 'LOEAAA', 'VVVVxx'),
+(9368, 3080, 0, 0, 8, 8, 68, 368, 1368, 4368, 9368, 136, 137, 'IWAAAA', 'MOEAAA', 'AAAAxx'),
+(7107, 3081, 1, 3, 7, 7, 7, 107, 1107, 2107, 7107, 14, 15, 'JNAAAA', 'NOEAAA', 'HHHHxx'),
+(8895, 3082, 1, 3, 5, 15, 95, 895, 895, 3895, 8895, 190, 191, 'DEAAAA', 'OOEAAA', 'OOOOxx'),
+(3750, 3083, 0, 2, 0, 10, 50, 750, 1750, 3750, 3750, 100, 101, 'GOAAAA', 'POEAAA', 'VVVVxx'),
+(8934, 3084, 0, 2, 4, 14, 34, 934, 934, 3934, 8934, 68, 69, 'QFAAAA', 'QOEAAA', 'AAAAxx'),
+(9464, 3085, 0, 0, 4, 4, 64, 464, 1464, 4464, 9464, 128, 129, 'AAAAAA', 'ROEAAA', 'HHHHxx'),
+(1928, 3086, 0, 0, 8, 8, 28, 928, 1928, 1928, 1928, 56, 57, 'EWAAAA', 'SOEAAA', 'OOOOxx'),
+(3196, 3087, 0, 0, 6, 16, 96, 196, 1196, 3196, 3196, 192, 193, 'YSAAAA', 'TOEAAA', 'VVVVxx'),
+(5256, 3088, 0, 0, 6, 16, 56, 256, 1256, 256, 5256, 112, 113, 'EUAAAA', 'UOEAAA', 'AAAAxx'),
+(7119, 3089, 1, 3, 9, 19, 19, 119, 1119, 2119, 7119, 38, 39, 'VNAAAA', 'VOEAAA', 'HHHHxx'),
+(4495, 3090, 1, 3, 5, 15, 95, 495, 495, 4495, 4495, 190, 191, 'XQAAAA', 'WOEAAA', 'OOOOxx'),
+(9292, 3091, 0, 0, 2, 12, 92, 292, 1292, 4292, 9292, 184, 185, 'KTAAAA', 'XOEAAA', 'VVVVxx'),
+(1617, 3092, 1, 1, 7, 17, 17, 617, 1617, 1617, 1617, 34, 35, 'FKAAAA', 'YOEAAA', 'AAAAxx'),
+(481, 3093, 1, 1, 1, 1, 81, 481, 481, 481, 481, 162, 163, 'NSAAAA', 'ZOEAAA', 'HHHHxx'),
+(56, 3094, 0, 0, 6, 16, 56, 56, 56, 56, 56, 112, 113, 'ECAAAA', 'APEAAA', 'OOOOxx'),
+(9120, 3095, 0, 0, 0, 0, 20, 120, 1120, 4120, 9120, 40, 41, 'UMAAAA', 'BPEAAA', 'VVVVxx'),
+(1306, 3096, 0, 2, 6, 6, 6, 306, 1306, 1306, 1306, 12, 13, 'GYAAAA', 'CPEAAA', 'AAAAxx'),
+(7773, 3097, 1, 1, 3, 13, 73, 773, 1773, 2773, 7773, 146, 147, 'ZMAAAA', 'DPEAAA', 'HHHHxx'),
+(4863, 3098, 1, 3, 3, 3, 63, 863, 863, 4863, 4863, 126, 127, 'BFAAAA', 'EPEAAA', 'OOOOxx'),
+(1114, 3099, 0, 2, 4, 14, 14, 114, 1114, 1114, 1114, 28, 29, 'WQAAAA', 'FPEAAA', 'VVVVxx'),
+(8124, 3100, 0, 0, 4, 4, 24, 124, 124, 3124, 8124, 48, 49, 'MAAAAA', 'GPEAAA', 'AAAAxx'),
+(6254, 3101, 0, 2, 4, 14, 54, 254, 254, 1254, 6254, 108, 109, 'OGAAAA', 'HPEAAA', 'HHHHxx'),
+(8109, 3102, 1, 1, 9, 9, 9, 109, 109, 3109, 8109, 18, 19, 'XZAAAA', 'IPEAAA', 'OOOOxx'),
+(1747, 3103, 1, 3, 7, 7, 47, 747, 1747, 1747, 1747, 94, 95, 'FPAAAA', 'JPEAAA', 'VVVVxx'),
+(6185, 3104, 1, 1, 5, 5, 85, 185, 185, 1185, 6185, 170, 171, 'XDAAAA', 'KPEAAA', 'AAAAxx'),
+(3388, 3105, 0, 0, 8, 8, 88, 388, 1388, 3388, 3388, 176, 177, 'IAAAAA', 'LPEAAA', 'HHHHxx'),
+(4905, 3106, 1, 1, 5, 5, 5, 905, 905, 4905, 4905, 10, 11, 'RGAAAA', 'MPEAAA', 'OOOOxx'),
+(5728, 3107, 0, 0, 8, 8, 28, 728, 1728, 728, 5728, 56, 57, 'IMAAAA', 'NPEAAA', 'VVVVxx'),
+(7507, 3108, 1, 3, 7, 7, 7, 507, 1507, 2507, 7507, 14, 15, 'TCAAAA', 'OPEAAA', 'AAAAxx'),
+(5662, 3109, 0, 2, 2, 2, 62, 662, 1662, 662, 5662, 124, 125, 'UJAAAA', 'PPEAAA', 'HHHHxx'),
+(1686, 3110, 0, 2, 6, 6, 86, 686, 1686, 1686, 1686, 172, 173, 'WMAAAA', 'QPEAAA', 'OOOOxx'),
+(5202, 3111, 0, 2, 2, 2, 2, 202, 1202, 202, 5202, 4, 5, 'CSAAAA', 'RPEAAA', 'VVVVxx'),
+(6905, 3112, 1, 1, 5, 5, 5, 905, 905, 1905, 6905, 10, 11, 'PFAAAA', 'SPEAAA', 'AAAAxx'),
+(9577, 3113, 1, 1, 7, 17, 77, 577, 1577, 4577, 9577, 154, 155, 'JEAAAA', 'TPEAAA', 'HHHHxx'),
+(7194, 3114, 0, 2, 4, 14, 94, 194, 1194, 2194, 7194, 188, 189, 'SQAAAA', 'UPEAAA', 'OOOOxx'),
+(7016, 3115, 0, 0, 6, 16, 16, 16, 1016, 2016, 7016, 32, 33, 'WJAAAA', 'VPEAAA', 'VVVVxx'),
+(8905, 3116, 1, 1, 5, 5, 5, 905, 905, 3905, 8905, 10, 11, 'NEAAAA', 'WPEAAA', 'AAAAxx'),
+(3419, 3117, 1, 3, 9, 19, 19, 419, 1419, 3419, 3419, 38, 39, 'NBAAAA', 'XPEAAA', 'HHHHxx'),
+(6881, 3118, 1, 1, 1, 1, 81, 881, 881, 1881, 6881, 162, 163, 'REAAAA', 'YPEAAA', 'OOOOxx'),
+(8370, 3119, 0, 2, 0, 10, 70, 370, 370, 3370, 8370, 140, 141, 'YJAAAA', 'ZPEAAA', 'VVVVxx'),
+(6117, 3120, 1, 1, 7, 17, 17, 117, 117, 1117, 6117, 34, 35, 'HBAAAA', 'AQEAAA', 'AAAAxx'),
+(1636, 3121, 0, 0, 6, 16, 36, 636, 1636, 1636, 1636, 72, 73, 'YKAAAA', 'BQEAAA', 'HHHHxx'),
+(6857, 3122, 1, 1, 7, 17, 57, 857, 857, 1857, 6857, 114, 115, 'TDAAAA', 'CQEAAA', 'OOOOxx'),
+(7163, 3123, 1, 3, 3, 3, 63, 163, 1163, 2163, 7163, 126, 127, 'NPAAAA', 'DQEAAA', 'VVVVxx'),
+(5040, 3124, 0, 0, 0, 0, 40, 40, 1040, 40, 5040, 80, 81, 'WLAAAA', 'EQEAAA', 'AAAAxx'),
+(6263, 3125, 1, 3, 3, 3, 63, 263, 263, 1263, 6263, 126, 127, 'XGAAAA', 'FQEAAA', 'HHHHxx'),
+(4809, 3126, 1, 1, 9, 9, 9, 809, 809, 4809, 4809, 18, 19, 'ZCAAAA', 'GQEAAA', 'OOOOxx'),
+(900, 3127, 0, 0, 0, 0, 0, 900, 900, 900, 900, 0, 1, 'QIAAAA', 'HQEAAA', 'VVVVxx'),
+(3199, 3128, 1, 3, 9, 19, 99, 199, 1199, 3199, 3199, 198, 199, 'BTAAAA', 'IQEAAA', 'AAAAxx'),
+(4156, 3129, 0, 0, 6, 16, 56, 156, 156, 4156, 4156, 112, 113, 'WDAAAA', 'JQEAAA', 'HHHHxx'),
+(3501, 3130, 1, 1, 1, 1, 1, 501, 1501, 3501, 3501, 2, 3, 'REAAAA', 'KQEAAA', 'OOOOxx'),
+(164, 3131, 0, 0, 4, 4, 64, 164, 164, 164, 164, 128, 129, 'IGAAAA', 'LQEAAA', 'VVVVxx'),
+(9548, 3132, 0, 0, 8, 8, 48, 548, 1548, 4548, 9548, 96, 97, 'GDAAAA', 'MQEAAA', 'AAAAxx'),
+(1149, 3133, 1, 1, 9, 9, 49, 149, 1149, 1149, 1149, 98, 99, 'FSAAAA', 'NQEAAA', 'HHHHxx'),
+(1962, 3134, 0, 2, 2, 2, 62, 962, 1962, 1962, 1962, 124, 125, 'MXAAAA', 'OQEAAA', 'OOOOxx'),
+(4072, 3135, 0, 0, 2, 12, 72, 72, 72, 4072, 4072, 144, 145, 'QAAAAA', 'PQEAAA', 'VVVVxx'),
+(4280, 3136, 0, 0, 0, 0, 80, 280, 280, 4280, 4280, 160, 161, 'QIAAAA', 'QQEAAA', 'AAAAxx'),
+(1398, 3137, 0, 2, 8, 18, 98, 398, 1398, 1398, 1398, 196, 197, 'UBAAAA', 'RQEAAA', 'HHHHxx'),
+(725, 3138, 1, 1, 5, 5, 25, 725, 725, 725, 725, 50, 51, 'XBAAAA', 'SQEAAA', 'OOOOxx'),
+(3988, 3139, 0, 0, 8, 8, 88, 988, 1988, 3988, 3988, 176, 177, 'KXAAAA', 'TQEAAA', 'VVVVxx'),
+(5059, 3140, 1, 3, 9, 19, 59, 59, 1059, 59, 5059, 118, 119, 'PMAAAA', 'UQEAAA', 'AAAAxx'),
+(2632, 3141, 0, 0, 2, 12, 32, 632, 632, 2632, 2632, 64, 65, 'GXAAAA', 'VQEAAA', 'HHHHxx'),
+(1909, 3142, 1, 1, 9, 9, 9, 909, 1909, 1909, 1909, 18, 19, 'LVAAAA', 'WQEAAA', 'OOOOxx'),
+(6827, 3143, 1, 3, 7, 7, 27, 827, 827, 1827, 6827, 54, 55, 'PCAAAA', 'XQEAAA', 'VVVVxx'),
+(8156, 3144, 0, 0, 6, 16, 56, 156, 156, 3156, 8156, 112, 113, 'SBAAAA', 'YQEAAA', 'AAAAxx'),
+(1192, 3145, 0, 0, 2, 12, 92, 192, 1192, 1192, 1192, 184, 185, 'WTAAAA', 'ZQEAAA', 'HHHHxx'),
+(9545, 3146, 1, 1, 5, 5, 45, 545, 1545, 4545, 9545, 90, 91, 'DDAAAA', 'AREAAA', 'OOOOxx'),
+(2249, 3147, 1, 1, 9, 9, 49, 249, 249, 2249, 2249, 98, 99, 'NIAAAA', 'BREAAA', 'VVVVxx'),
+(5580, 3148, 0, 0, 0, 0, 80, 580, 1580, 580, 5580, 160, 161, 'QGAAAA', 'CREAAA', 'AAAAxx'),
+(8403, 3149, 1, 3, 3, 3, 3, 403, 403, 3403, 8403, 6, 7, 'FLAAAA', 'DREAAA', 'HHHHxx'),
+(4024, 3150, 0, 0, 4, 4, 24, 24, 24, 4024, 4024, 48, 49, 'UYAAAA', 'EREAAA', 'OOOOxx'),
+(1866, 3151, 0, 2, 6, 6, 66, 866, 1866, 1866, 1866, 132, 133, 'UTAAAA', 'FREAAA', 'VVVVxx'),
+(9251, 3152, 1, 3, 1, 11, 51, 251, 1251, 4251, 9251, 102, 103, 'VRAAAA', 'GREAAA', 'AAAAxx'),
+(9979, 3153, 1, 3, 9, 19, 79, 979, 1979, 4979, 9979, 158, 159, 'VTAAAA', 'HREAAA', 'HHHHxx'),
+(9899, 3154, 1, 3, 9, 19, 99, 899, 1899, 4899, 9899, 198, 199, 'TQAAAA', 'IREAAA', 'OOOOxx'),
+(2540, 3155, 0, 0, 0, 0, 40, 540, 540, 2540, 2540, 80, 81, 'STAAAA', 'JREAAA', 'VVVVxx'),
+(8957, 3156, 1, 1, 7, 17, 57, 957, 957, 3957, 8957, 114, 115, 'NGAAAA', 'KREAAA', 'AAAAxx'),
+(7702, 3157, 0, 2, 2, 2, 2, 702, 1702, 2702, 7702, 4, 5, 'GKAAAA', 'LREAAA', 'HHHHxx'),
+(4211, 3158, 1, 3, 1, 11, 11, 211, 211, 4211, 4211, 22, 23, 'ZFAAAA', 'MREAAA', 'OOOOxx'),
+(6684, 3159, 0, 0, 4, 4, 84, 684, 684, 1684, 6684, 168, 169, 'CXAAAA', 'NREAAA', 'VVVVxx'),
+(3883, 3160, 1, 3, 3, 3, 83, 883, 1883, 3883, 3883, 166, 167, 'JTAAAA', 'OREAAA', 'AAAAxx'),
+(3531, 3161, 1, 3, 1, 11, 31, 531, 1531, 3531, 3531, 62, 63, 'VFAAAA', 'PREAAA', 'HHHHxx'),
+(9178, 3162, 0, 2, 8, 18, 78, 178, 1178, 4178, 9178, 156, 157, 'APAAAA', 'QREAAA', 'OOOOxx'),
+(3389, 3163, 1, 1, 9, 9, 89, 389, 1389, 3389, 3389, 178, 179, 'JAAAAA', 'RREAAA', 'VVVVxx'),
+(7874, 3164, 0, 2, 4, 14, 74, 874, 1874, 2874, 7874, 148, 149, 'WQAAAA', 'SREAAA', 'AAAAxx'),
+(4522, 3165, 0, 2, 2, 2, 22, 522, 522, 4522, 4522, 44, 45, 'YRAAAA', 'TREAAA', 'HHHHxx'),
+(9399, 3166, 1, 3, 9, 19, 99, 399, 1399, 4399, 9399, 198, 199, 'NXAAAA', 'UREAAA', 'OOOOxx'),
+(9083, 3167, 1, 3, 3, 3, 83, 83, 1083, 4083, 9083, 166, 167, 'JLAAAA', 'VREAAA', 'VVVVxx'),
+(1530, 3168, 0, 2, 0, 10, 30, 530, 1530, 1530, 1530, 60, 61, 'WGAAAA', 'WREAAA', 'AAAAxx'),
+(2360, 3169, 0, 0, 0, 0, 60, 360, 360, 2360, 2360, 120, 121, 'UMAAAA', 'XREAAA', 'HHHHxx'),
+(4908, 3170, 0, 0, 8, 8, 8, 908, 908, 4908, 4908, 16, 17, 'UGAAAA', 'YREAAA', 'OOOOxx'),
+(4628, 3171, 0, 0, 8, 8, 28, 628, 628, 4628, 4628, 56, 57, 'AWAAAA', 'ZREAAA', 'VVVVxx'),
+(3889, 3172, 1, 1, 9, 9, 89, 889, 1889, 3889, 3889, 178, 179, 'PTAAAA', 'ASEAAA', 'AAAAxx'),
+(1331, 3173, 1, 3, 1, 11, 31, 331, 1331, 1331, 1331, 62, 63, 'FZAAAA', 'BSEAAA', 'HHHHxx'),
+(1942, 3174, 0, 2, 2, 2, 42, 942, 1942, 1942, 1942, 84, 85, 'SWAAAA', 'CSEAAA', 'OOOOxx'),
+(4734, 3175, 0, 2, 4, 14, 34, 734, 734, 4734, 4734, 68, 69, 'CAAAAA', 'DSEAAA', 'VVVVxx'),
+(8386, 3176, 0, 2, 6, 6, 86, 386, 386, 3386, 8386, 172, 173, 'OKAAAA', 'ESEAAA', 'AAAAxx'),
+(3586, 3177, 0, 2, 6, 6, 86, 586, 1586, 3586, 3586, 172, 173, 'YHAAAA', 'FSEAAA', 'HHHHxx'),
+(2354, 3178, 0, 2, 4, 14, 54, 354, 354, 2354, 2354, 108, 109, 'OMAAAA', 'GSEAAA', 'OOOOxx'),
+(7108, 3179, 0, 0, 8, 8, 8, 108, 1108, 2108, 7108, 16, 17, 'KNAAAA', 'HSEAAA', 'VVVVxx'),
+(1857, 3180, 1, 1, 7, 17, 57, 857, 1857, 1857, 1857, 114, 115, 'LTAAAA', 'ISEAAA', 'AAAAxx'),
+(2544, 3181, 0, 0, 4, 4, 44, 544, 544, 2544, 2544, 88, 89, 'WTAAAA', 'JSEAAA', 'HHHHxx'),
+(819, 3182, 1, 3, 9, 19, 19, 819, 819, 819, 819, 38, 39, 'NFAAAA', 'KSEAAA', 'OOOOxx'),
+(2878, 3183, 0, 2, 8, 18, 78, 878, 878, 2878, 2878, 156, 157, 'SGAAAA', 'LSEAAA', 'VVVVxx'),
+(1772, 3184, 0, 0, 2, 12, 72, 772, 1772, 1772, 1772, 144, 145, 'EQAAAA', 'MSEAAA', 'AAAAxx'),
+(354, 3185, 0, 2, 4, 14, 54, 354, 354, 354, 354, 108, 109, 'QNAAAA', 'NSEAAA', 'HHHHxx'),
+(3259, 3186, 1, 3, 9, 19, 59, 259, 1259, 3259, 3259, 118, 119, 'JVAAAA', 'OSEAAA', 'OOOOxx'),
+(2170, 3187, 0, 2, 0, 10, 70, 170, 170, 2170, 2170, 140, 141, 'MFAAAA', 'PSEAAA', 'VVVVxx'),
+(1190, 3188, 0, 2, 0, 10, 90, 190, 1190, 1190, 1190, 180, 181, 'UTAAAA', 'QSEAAA', 'AAAAxx'),
+(3607, 3189, 1, 3, 7, 7, 7, 607, 1607, 3607, 3607, 14, 15, 'TIAAAA', 'RSEAAA', 'HHHHxx'),
+(4661, 3190, 1, 1, 1, 1, 61, 661, 661, 4661, 4661, 122, 123, 'HXAAAA', 'SSEAAA', 'OOOOxx'),
+(1796, 3191, 0, 0, 6, 16, 96, 796, 1796, 1796, 1796, 192, 193, 'CRAAAA', 'TSEAAA', 'VVVVxx'),
+(1561, 3192, 1, 1, 1, 1, 61, 561, 1561, 1561, 1561, 122, 123, 'BIAAAA', 'USEAAA', 'AAAAxx'),
+(4336, 3193, 0, 0, 6, 16, 36, 336, 336, 4336, 4336, 72, 73, 'UKAAAA', 'VSEAAA', 'HHHHxx'),
+(7550, 3194, 0, 2, 0, 10, 50, 550, 1550, 2550, 7550, 100, 101, 'KEAAAA', 'WSEAAA', 'OOOOxx'),
+(3238, 3195, 0, 2, 8, 18, 38, 238, 1238, 3238, 3238, 76, 77, 'OUAAAA', 'XSEAAA', 'VVVVxx'),
+(9870, 3196, 0, 2, 0, 10, 70, 870, 1870, 4870, 9870, 140, 141, 'QPAAAA', 'YSEAAA', 'AAAAxx'),
+(6502, 3197, 0, 2, 2, 2, 2, 502, 502, 1502, 6502, 4, 5, 'CQAAAA', 'ZSEAAA', 'HHHHxx'),
+(3903, 3198, 1, 3, 3, 3, 3, 903, 1903, 3903, 3903, 6, 7, 'DUAAAA', 'ATEAAA', 'OOOOxx'),
+(2869, 3199, 1, 1, 9, 9, 69, 869, 869, 2869, 2869, 138, 139, 'JGAAAA', 'BTEAAA', 'VVVVxx'),
+(5072, 3200, 0, 0, 2, 12, 72, 72, 1072, 72, 5072, 144, 145, 'CNAAAA', 'CTEAAA', 'AAAAxx'),
+(1201, 3201, 1, 1, 1, 1, 1, 201, 1201, 1201, 1201, 2, 3, 'FUAAAA', 'DTEAAA', 'HHHHxx'),
+(6245, 3202, 1, 1, 5, 5, 45, 245, 245, 1245, 6245, 90, 91, 'FGAAAA', 'ETEAAA', 'OOOOxx'),
+(1402, 3203, 0, 2, 2, 2, 2, 402, 1402, 1402, 1402, 4, 5, 'YBAAAA', 'FTEAAA', 'VVVVxx'),
+(2594, 3204, 0, 2, 4, 14, 94, 594, 594, 2594, 2594, 188, 189, 'UVAAAA', 'GTEAAA', 'AAAAxx'),
+(9171, 3205, 1, 3, 1, 11, 71, 171, 1171, 4171, 9171, 142, 143, 'TOAAAA', 'HTEAAA', 'HHHHxx'),
+(2620, 3206, 0, 0, 0, 0, 20, 620, 620, 2620, 2620, 40, 41, 'UWAAAA', 'ITEAAA', 'OOOOxx'),
+(6309, 3207, 1, 1, 9, 9, 9, 309, 309, 1309, 6309, 18, 19, 'RIAAAA', 'JTEAAA', 'VVVVxx'),
+(1285, 3208, 1, 1, 5, 5, 85, 285, 1285, 1285, 1285, 170, 171, 'LXAAAA', 'KTEAAA', 'AAAAxx'),
+(5466, 3209, 0, 2, 6, 6, 66, 466, 1466, 466, 5466, 132, 133, 'GCAAAA', 'LTEAAA', 'HHHHxx'),
+(168, 3210, 0, 0, 8, 8, 68, 168, 168, 168, 168, 136, 137, 'MGAAAA', 'MTEAAA', 'OOOOxx'),
+(1410, 3211, 0, 2, 0, 10, 10, 410, 1410, 1410, 1410, 20, 21, 'GCAAAA', 'NTEAAA', 'VVVVxx'),
+(6332, 3212, 0, 0, 2, 12, 32, 332, 332, 1332, 6332, 64, 65, 'OJAAAA', 'OTEAAA', 'AAAAxx'),
+(9530, 3213, 0, 2, 0, 10, 30, 530, 1530, 4530, 9530, 60, 61, 'OCAAAA', 'PTEAAA', 'HHHHxx'),
+(7749, 3214, 1, 1, 9, 9, 49, 749, 1749, 2749, 7749, 98, 99, 'BMAAAA', 'QTEAAA', 'OOOOxx'),
+(3656, 3215, 0, 0, 6, 16, 56, 656, 1656, 3656, 3656, 112, 113, 'QKAAAA', 'RTEAAA', 'VVVVxx'),
+(37, 3216, 1, 1, 7, 17, 37, 37, 37, 37, 37, 74, 75, 'LBAAAA', 'STEAAA', 'AAAAxx'),
+(2744, 3217, 0, 0, 4, 4, 44, 744, 744, 2744, 2744, 88, 89, 'OBAAAA', 'TTEAAA', 'HHHHxx'),
+(4206, 3218, 0, 2, 6, 6, 6, 206, 206, 4206, 4206, 12, 13, 'UFAAAA', 'UTEAAA', 'OOOOxx'),
+(1846, 3219, 0, 2, 6, 6, 46, 846, 1846, 1846, 1846, 92, 93, 'ATAAAA', 'VTEAAA', 'VVVVxx'),
+(9913, 3220, 1, 1, 3, 13, 13, 913, 1913, 4913, 9913, 26, 27, 'HRAAAA', 'WTEAAA', 'AAAAxx'),
+(4078, 3221, 0, 2, 8, 18, 78, 78, 78, 4078, 4078, 156, 157, 'WAAAAA', 'XTEAAA', 'HHHHxx'),
+(2080, 3222, 0, 0, 0, 0, 80, 80, 80, 2080, 2080, 160, 161, 'ACAAAA', 'YTEAAA', 'OOOOxx'),
+(4169, 3223, 1, 1, 9, 9, 69, 169, 169, 4169, 4169, 138, 139, 'JEAAAA', 'ZTEAAA', 'VVVVxx'),
+(2070, 3224, 0, 2, 0, 10, 70, 70, 70, 2070, 2070, 140, 141, 'QBAAAA', 'AUEAAA', 'AAAAxx'),
+(4500, 3225, 0, 0, 0, 0, 0, 500, 500, 4500, 4500, 0, 1, 'CRAAAA', 'BUEAAA', 'HHHHxx'),
+(4123, 3226, 1, 3, 3, 3, 23, 123, 123, 4123, 4123, 46, 47, 'PCAAAA', 'CUEAAA', 'OOOOxx'),
+(5594, 3227, 0, 2, 4, 14, 94, 594, 1594, 594, 5594, 188, 189, 'EHAAAA', 'DUEAAA', 'VVVVxx'),
+(9941, 3228, 1, 1, 1, 1, 41, 941, 1941, 4941, 9941, 82, 83, 'JSAAAA', 'EUEAAA', 'AAAAxx'),
+(7154, 3229, 0, 2, 4, 14, 54, 154, 1154, 2154, 7154, 108, 109, 'EPAAAA', 'FUEAAA', 'HHHHxx'),
+(8340, 3230, 0, 0, 0, 0, 40, 340, 340, 3340, 8340, 80, 81, 'UIAAAA', 'GUEAAA', 'OOOOxx'),
+(7110, 3231, 0, 2, 0, 10, 10, 110, 1110, 2110, 7110, 20, 21, 'MNAAAA', 'HUEAAA', 'VVVVxx'),
+(7795, 3232, 1, 3, 5, 15, 95, 795, 1795, 2795, 7795, 190, 191, 'VNAAAA', 'IUEAAA', 'AAAAxx'),
+(132, 3233, 0, 0, 2, 12, 32, 132, 132, 132, 132, 64, 65, 'CFAAAA', 'JUEAAA', 'HHHHxx'),
+(4603, 3234, 1, 3, 3, 3, 3, 603, 603, 4603, 4603, 6, 7, 'BVAAAA', 'KUEAAA', 'OOOOxx'),
+(9720, 3235, 0, 0, 0, 0, 20, 720, 1720, 4720, 9720, 40, 41, 'WJAAAA', 'LUEAAA', 'VVVVxx'),
+(1460, 3236, 0, 0, 0, 0, 60, 460, 1460, 1460, 1460, 120, 121, 'EEAAAA', 'MUEAAA', 'AAAAxx'),
+(4677, 3237, 1, 1, 7, 17, 77, 677, 677, 4677, 4677, 154, 155, 'XXAAAA', 'NUEAAA', 'HHHHxx'),
+(9272, 3238, 0, 0, 2, 12, 72, 272, 1272, 4272, 9272, 144, 145, 'QSAAAA', 'OUEAAA', 'OOOOxx'),
+(2279, 3239, 1, 3, 9, 19, 79, 279, 279, 2279, 2279, 158, 159, 'RJAAAA', 'PUEAAA', 'VVVVxx'),
+(4587, 3240, 1, 3, 7, 7, 87, 587, 587, 4587, 4587, 174, 175, 'LUAAAA', 'QUEAAA', 'AAAAxx'),
+(2244, 3241, 0, 0, 4, 4, 44, 244, 244, 2244, 2244, 88, 89, 'IIAAAA', 'RUEAAA', 'HHHHxx'),
+(742, 3242, 0, 2, 2, 2, 42, 742, 742, 742, 742, 84, 85, 'OCAAAA', 'SUEAAA', 'OOOOxx'),
+(4426, 3243, 0, 2, 6, 6, 26, 426, 426, 4426, 4426, 52, 53, 'GOAAAA', 'TUEAAA', 'VVVVxx'),
+(4571, 3244, 1, 3, 1, 11, 71, 571, 571, 4571, 4571, 142, 143, 'VTAAAA', 'UUEAAA', 'AAAAxx'),
+(4775, 3245, 1, 3, 5, 15, 75, 775, 775, 4775, 4775, 150, 151, 'RBAAAA', 'VUEAAA', 'HHHHxx'),
+(24, 3246, 0, 0, 4, 4, 24, 24, 24, 24, 24, 48, 49, 'YAAAAA', 'WUEAAA', 'OOOOxx'),
+(4175, 3247, 1, 3, 5, 15, 75, 175, 175, 4175, 4175, 150, 151, 'PEAAAA', 'XUEAAA', 'VVVVxx'),
+(9877, 3248, 1, 1, 7, 17, 77, 877, 1877, 4877, 9877, 154, 155, 'XPAAAA', 'YUEAAA', 'AAAAxx'),
+(7271, 3249, 1, 3, 1, 11, 71, 271, 1271, 2271, 7271, 142, 143, 'RTAAAA', 'ZUEAAA', 'HHHHxx'),
+(5468, 3250, 0, 0, 8, 8, 68, 468, 1468, 468, 5468, 136, 137, 'ICAAAA', 'AVEAAA', 'OOOOxx'),
+(6106, 3251, 0, 2, 6, 6, 6, 106, 106, 1106, 6106, 12, 13, 'WAAAAA', 'BVEAAA', 'VVVVxx'),
+(9005, 3252, 1, 1, 5, 5, 5, 5, 1005, 4005, 9005, 10, 11, 'JIAAAA', 'CVEAAA', 'AAAAxx'),
+(109, 3253, 1, 1, 9, 9, 9, 109, 109, 109, 109, 18, 19, 'FEAAAA', 'DVEAAA', 'HHHHxx'),
+(6365, 3254, 1, 1, 5, 5, 65, 365, 365, 1365, 6365, 130, 131, 'VKAAAA', 'EVEAAA', 'OOOOxx'),
+(7437, 3255, 1, 1, 7, 17, 37, 437, 1437, 2437, 7437, 74, 75, 'BAAAAA', 'FVEAAA', 'VVVVxx'),
+(7979, 3256, 1, 3, 9, 19, 79, 979, 1979, 2979, 7979, 158, 159, 'XUAAAA', 'GVEAAA', 'AAAAxx'),
+(6050, 3257, 0, 2, 0, 10, 50, 50, 50, 1050, 6050, 100, 101, 'SYAAAA', 'HVEAAA', 'HHHHxx'),
+(2853, 3258, 1, 1, 3, 13, 53, 853, 853, 2853, 2853, 106, 107, 'TFAAAA', 'IVEAAA', 'OOOOxx'),
+(7603, 3259, 1, 3, 3, 3, 3, 603, 1603, 2603, 7603, 6, 7, 'LGAAAA', 'JVEAAA', 'VVVVxx'),
+(483, 3260, 1, 3, 3, 3, 83, 483, 483, 483, 483, 166, 167, 'PSAAAA', 'KVEAAA', 'AAAAxx'),
+(5994, 3261, 0, 2, 4, 14, 94, 994, 1994, 994, 5994, 188, 189, 'OWAAAA', 'LVEAAA', 'HHHHxx'),
+(6708, 3262, 0, 0, 8, 8, 8, 708, 708, 1708, 6708, 16, 17, 'AYAAAA', 'MVEAAA', 'OOOOxx'),
+(5090, 3263, 0, 2, 0, 10, 90, 90, 1090, 90, 5090, 180, 181, 'UNAAAA', 'NVEAAA', 'VVVVxx'),
+(4608, 3264, 0, 0, 8, 8, 8, 608, 608, 4608, 4608, 16, 17, 'GVAAAA', 'OVEAAA', 'AAAAxx'),
+(4551, 3265, 1, 3, 1, 11, 51, 551, 551, 4551, 4551, 102, 103, 'BTAAAA', 'PVEAAA', 'HHHHxx'),
+(5437, 3266, 1, 1, 7, 17, 37, 437, 1437, 437, 5437, 74, 75, 'DBAAAA', 'QVEAAA', 'OOOOxx'),
+(4130, 3267, 0, 2, 0, 10, 30, 130, 130, 4130, 4130, 60, 61, 'WCAAAA', 'RVEAAA', 'VVVVxx'),
+(6363, 3268, 1, 3, 3, 3, 63, 363, 363, 1363, 6363, 126, 127, 'TKAAAA', 'SVEAAA', 'AAAAxx'),
+(1499, 3269, 1, 3, 9, 19, 99, 499, 1499, 1499, 1499, 198, 199, 'RFAAAA', 'TVEAAA', 'HHHHxx'),
+(384, 3270, 0, 0, 4, 4, 84, 384, 384, 384, 384, 168, 169, 'UOAAAA', 'UVEAAA', 'OOOOxx'),
+(2266, 3271, 0, 2, 6, 6, 66, 266, 266, 2266, 2266, 132, 133, 'EJAAAA', 'VVEAAA', 'VVVVxx'),
+(6018, 3272, 0, 2, 8, 18, 18, 18, 18, 1018, 6018, 36, 37, 'MXAAAA', 'WVEAAA', 'AAAAxx'),
+(7915, 3273, 1, 3, 5, 15, 15, 915, 1915, 2915, 7915, 30, 31, 'LSAAAA', 'XVEAAA', 'HHHHxx'),
+(6167, 3274, 1, 3, 7, 7, 67, 167, 167, 1167, 6167, 134, 135, 'FDAAAA', 'YVEAAA', 'OOOOxx'),
+(9988, 3275, 0, 0, 8, 8, 88, 988, 1988, 4988, 9988, 176, 177, 'EUAAAA', 'ZVEAAA', 'VVVVxx'),
+(6599, 3276, 1, 3, 9, 19, 99, 599, 599, 1599, 6599, 198, 199, 'VTAAAA', 'AWEAAA', 'AAAAxx'),
+(1693, 3277, 1, 1, 3, 13, 93, 693, 1693, 1693, 1693, 186, 187, 'DNAAAA', 'BWEAAA', 'HHHHxx'),
+(5971, 3278, 1, 3, 1, 11, 71, 971, 1971, 971, 5971, 142, 143, 'RVAAAA', 'CWEAAA', 'OOOOxx'),
+(8470, 3279, 0, 2, 0, 10, 70, 470, 470, 3470, 8470, 140, 141, 'UNAAAA', 'DWEAAA', 'VVVVxx'),
+(2807, 3280, 1, 3, 7, 7, 7, 807, 807, 2807, 2807, 14, 15, 'ZDAAAA', 'EWEAAA', 'AAAAxx'),
+(1120, 3281, 0, 0, 0, 0, 20, 120, 1120, 1120, 1120, 40, 41, 'CRAAAA', 'FWEAAA', 'HHHHxx'),
+(5924, 3282, 0, 0, 4, 4, 24, 924, 1924, 924, 5924, 48, 49, 'WTAAAA', 'GWEAAA', 'OOOOxx'),
+(9025, 3283, 1, 1, 5, 5, 25, 25, 1025, 4025, 9025, 50, 51, 'DJAAAA', 'HWEAAA', 'VVVVxx'),
+(9454, 3284, 0, 2, 4, 14, 54, 454, 1454, 4454, 9454, 108, 109, 'QZAAAA', 'IWEAAA', 'AAAAxx'),
+(2259, 3285, 1, 3, 9, 19, 59, 259, 259, 2259, 2259, 118, 119, 'XIAAAA', 'JWEAAA', 'HHHHxx'),
+(5249, 3286, 1, 1, 9, 9, 49, 249, 1249, 249, 5249, 98, 99, 'XTAAAA', 'KWEAAA', 'OOOOxx'),
+(6350, 3287, 0, 2, 0, 10, 50, 350, 350, 1350, 6350, 100, 101, 'GKAAAA', 'LWEAAA', 'VVVVxx'),
+(2930, 3288, 0, 2, 0, 10, 30, 930, 930, 2930, 2930, 60, 61, 'SIAAAA', 'MWEAAA', 'AAAAxx'),
+(6055, 3289, 1, 3, 5, 15, 55, 55, 55, 1055, 6055, 110, 111, 'XYAAAA', 'NWEAAA', 'HHHHxx'),
+(7691, 3290, 1, 3, 1, 11, 91, 691, 1691, 2691, 7691, 182, 183, 'VJAAAA', 'OWEAAA', 'OOOOxx'),
+(1573, 3291, 1, 1, 3, 13, 73, 573, 1573, 1573, 1573, 146, 147, 'NIAAAA', 'PWEAAA', 'VVVVxx'),
+(9943, 3292, 1, 3, 3, 3, 43, 943, 1943, 4943, 9943, 86, 87, 'LSAAAA', 'QWEAAA', 'AAAAxx'),
+(3085, 3293, 1, 1, 5, 5, 85, 85, 1085, 3085, 3085, 170, 171, 'ROAAAA', 'RWEAAA', 'HHHHxx'),
+(5928, 3294, 0, 0, 8, 8, 28, 928, 1928, 928, 5928, 56, 57, 'AUAAAA', 'SWEAAA', 'OOOOxx'),
+(887, 3295, 1, 3, 7, 7, 87, 887, 887, 887, 887, 174, 175, 'DIAAAA', 'TWEAAA', 'VVVVxx'),
+(4630, 3296, 0, 2, 0, 10, 30, 630, 630, 4630, 4630, 60, 61, 'CWAAAA', 'UWEAAA', 'AAAAxx'),
+(9827, 3297, 1, 3, 7, 7, 27, 827, 1827, 4827, 9827, 54, 55, 'ZNAAAA', 'VWEAAA', 'HHHHxx'),
+(8926, 3298, 0, 2, 6, 6, 26, 926, 926, 3926, 8926, 52, 53, 'IFAAAA', 'WWEAAA', 'OOOOxx'),
+(5726, 3299, 0, 2, 6, 6, 26, 726, 1726, 726, 5726, 52, 53, 'GMAAAA', 'XWEAAA', 'VVVVxx'),
+(1569, 3300, 1, 1, 9, 9, 69, 569, 1569, 1569, 1569, 138, 139, 'JIAAAA', 'YWEAAA', 'AAAAxx'),
+(8074, 3301, 0, 2, 4, 14, 74, 74, 74, 3074, 8074, 148, 149, 'OYAAAA', 'ZWEAAA', 'HHHHxx'),
+(7909, 3302, 1, 1, 9, 9, 9, 909, 1909, 2909, 7909, 18, 19, 'FSAAAA', 'AXEAAA', 'OOOOxx'),
+(8367, 3303, 1, 3, 7, 7, 67, 367, 367, 3367, 8367, 134, 135, 'VJAAAA', 'BXEAAA', 'VVVVxx'),
+(7217, 3304, 1, 1, 7, 17, 17, 217, 1217, 2217, 7217, 34, 35, 'PRAAAA', 'CXEAAA', 'AAAAxx'),
+(5254, 3305, 0, 2, 4, 14, 54, 254, 1254, 254, 5254, 108, 109, 'CUAAAA', 'DXEAAA', 'HHHHxx'),
+(1181, 3306, 1, 1, 1, 1, 81, 181, 1181, 1181, 1181, 162, 163, 'LTAAAA', 'EXEAAA', 'OOOOxx'),
+(6907, 3307, 1, 3, 7, 7, 7, 907, 907, 1907, 6907, 14, 15, 'RFAAAA', 'FXEAAA', 'VVVVxx'),
+(5508, 3308, 0, 0, 8, 8, 8, 508, 1508, 508, 5508, 16, 17, 'WDAAAA', 'GXEAAA', 'AAAAxx'),
+(4782, 3309, 0, 2, 2, 2, 82, 782, 782, 4782, 4782, 164, 165, 'YBAAAA', 'HXEAAA', 'HHHHxx'),
+(793, 3310, 1, 1, 3, 13, 93, 793, 793, 793, 793, 186, 187, 'NEAAAA', 'IXEAAA', 'OOOOxx'),
+(5740, 3311, 0, 0, 0, 0, 40, 740, 1740, 740, 5740, 80, 81, 'UMAAAA', 'JXEAAA', 'VVVVxx'),
+(3107, 3312, 1, 3, 7, 7, 7, 107, 1107, 3107, 3107, 14, 15, 'NPAAAA', 'KXEAAA', 'AAAAxx'),
+(1197, 3313, 1, 1, 7, 17, 97, 197, 1197, 1197, 1197, 194, 195, 'BUAAAA', 'LXEAAA', 'HHHHxx'),
+(4376, 3314, 0, 0, 6, 16, 76, 376, 376, 4376, 4376, 152, 153, 'IMAAAA', 'MXEAAA', 'OOOOxx'),
+(6226, 3315, 0, 2, 6, 6, 26, 226, 226, 1226, 6226, 52, 53, 'MFAAAA', 'NXEAAA', 'VVVVxx'),
+(5033, 3316, 1, 1, 3, 13, 33, 33, 1033, 33, 5033, 66, 67, 'PLAAAA', 'OXEAAA', 'AAAAxx'),
+(5494, 3317, 0, 2, 4, 14, 94, 494, 1494, 494, 5494, 188, 189, 'IDAAAA', 'PXEAAA', 'HHHHxx'),
+(3244, 3318, 0, 0, 4, 4, 44, 244, 1244, 3244, 3244, 88, 89, 'UUAAAA', 'QXEAAA', 'OOOOxx'),
+(7670, 3319, 0, 2, 0, 10, 70, 670, 1670, 2670, 7670, 140, 141, 'AJAAAA', 'RXEAAA', 'VVVVxx'),
+(9273, 3320, 1, 1, 3, 13, 73, 273, 1273, 4273, 9273, 146, 147, 'RSAAAA', 'SXEAAA', 'AAAAxx'),
+(5248, 3321, 0, 0, 8, 8, 48, 248, 1248, 248, 5248, 96, 97, 'WTAAAA', 'TXEAAA', 'HHHHxx'),
+(3381, 3322, 1, 1, 1, 1, 81, 381, 1381, 3381, 3381, 162, 163, 'BAAAAA', 'UXEAAA', 'OOOOxx'),
+(4136, 3323, 0, 0, 6, 16, 36, 136, 136, 4136, 4136, 72, 73, 'CDAAAA', 'VXEAAA', 'VVVVxx'),
+(4163, 3324, 1, 3, 3, 3, 63, 163, 163, 4163, 4163, 126, 127, 'DEAAAA', 'WXEAAA', 'AAAAxx'),
+(4270, 3325, 0, 2, 0, 10, 70, 270, 270, 4270, 4270, 140, 141, 'GIAAAA', 'XXEAAA', 'HHHHxx'),
+(1729, 3326, 1, 1, 9, 9, 29, 729, 1729, 1729, 1729, 58, 59, 'NOAAAA', 'YXEAAA', 'OOOOxx'),
+(2778, 3327, 0, 2, 8, 18, 78, 778, 778, 2778, 2778, 156, 157, 'WCAAAA', 'ZXEAAA', 'VVVVxx'),
+(5082, 3328, 0, 2, 2, 2, 82, 82, 1082, 82, 5082, 164, 165, 'MNAAAA', 'AYEAAA', 'AAAAxx'),
+(870, 3329, 0, 2, 0, 10, 70, 870, 870, 870, 870, 140, 141, 'MHAAAA', 'BYEAAA', 'HHHHxx'),
+(4192, 3330, 0, 0, 2, 12, 92, 192, 192, 4192, 4192, 184, 185, 'GFAAAA', 'CYEAAA', 'OOOOxx'),
+(308, 3331, 0, 0, 8, 8, 8, 308, 308, 308, 308, 16, 17, 'WLAAAA', 'DYEAAA', 'VVVVxx'),
+(6783, 3332, 1, 3, 3, 3, 83, 783, 783, 1783, 6783, 166, 167, 'XAAAAA', 'EYEAAA', 'AAAAxx'),
+(7611, 3333, 1, 3, 1, 11, 11, 611, 1611, 2611, 7611, 22, 23, 'TGAAAA', 'FYEAAA', 'HHHHxx'),
+(4221, 3334, 1, 1, 1, 1, 21, 221, 221, 4221, 4221, 42, 43, 'JGAAAA', 'GYEAAA', 'OOOOxx'),
+(6353, 3335, 1, 1, 3, 13, 53, 353, 353, 1353, 6353, 106, 107, 'JKAAAA', 'HYEAAA', 'VVVVxx'),
+(1830, 3336, 0, 2, 0, 10, 30, 830, 1830, 1830, 1830, 60, 61, 'KSAAAA', 'IYEAAA', 'AAAAxx'),
+(2437, 3337, 1, 1, 7, 17, 37, 437, 437, 2437, 2437, 74, 75, 'TPAAAA', 'JYEAAA', 'HHHHxx'),
+(3360, 3338, 0, 0, 0, 0, 60, 360, 1360, 3360, 3360, 120, 121, 'GZAAAA', 'KYEAAA', 'OOOOxx'),
+(1829, 3339, 1, 1, 9, 9, 29, 829, 1829, 1829, 1829, 58, 59, 'JSAAAA', 'LYEAAA', 'VVVVxx'),
+(9475, 3340, 1, 3, 5, 15, 75, 475, 1475, 4475, 9475, 150, 151, 'LAAAAA', 'MYEAAA', 'AAAAxx'),
+(4566, 3341, 0, 2, 6, 6, 66, 566, 566, 4566, 4566, 132, 133, 'QTAAAA', 'NYEAAA', 'HHHHxx'),
+(9944, 3342, 0, 0, 4, 4, 44, 944, 1944, 4944, 9944, 88, 89, 'MSAAAA', 'OYEAAA', 'OOOOxx'),
+(6054, 3343, 0, 2, 4, 14, 54, 54, 54, 1054, 6054, 108, 109, 'WYAAAA', 'PYEAAA', 'VVVVxx'),
+(4722, 3344, 0, 2, 2, 2, 22, 722, 722, 4722, 4722, 44, 45, 'QZAAAA', 'QYEAAA', 'AAAAxx'),
+(2779, 3345, 1, 3, 9, 19, 79, 779, 779, 2779, 2779, 158, 159, 'XCAAAA', 'RYEAAA', 'HHHHxx'),
+(8051, 3346, 1, 3, 1, 11, 51, 51, 51, 3051, 8051, 102, 103, 'RXAAAA', 'SYEAAA', 'OOOOxx'),
+(9671, 3347, 1, 3, 1, 11, 71, 671, 1671, 4671, 9671, 142, 143, 'ZHAAAA', 'TYEAAA', 'VVVVxx'),
+(6084, 3348, 0, 0, 4, 4, 84, 84, 84, 1084, 6084, 168, 169, 'AAAAAA', 'UYEAAA', 'AAAAxx'),
+(3729, 3349, 1, 1, 9, 9, 29, 729, 1729, 3729, 3729, 58, 59, 'LNAAAA', 'VYEAAA', 'HHHHxx'),
+(6627, 3350, 1, 3, 7, 7, 27, 627, 627, 1627, 6627, 54, 55, 'XUAAAA', 'WYEAAA', 'OOOOxx'),
+(4769, 3351, 1, 1, 9, 9, 69, 769, 769, 4769, 4769, 138, 139, 'LBAAAA', 'XYEAAA', 'VVVVxx'),
+(2224, 3352, 0, 0, 4, 4, 24, 224, 224, 2224, 2224, 48, 49, 'OHAAAA', 'YYEAAA', 'AAAAxx'),
+(1404, 3353, 0, 0, 4, 4, 4, 404, 1404, 1404, 1404, 8, 9, 'ACAAAA', 'ZYEAAA', 'HHHHxx'),
+(8532, 3354, 0, 0, 2, 12, 32, 532, 532, 3532, 8532, 64, 65, 'EQAAAA', 'AZEAAA', 'OOOOxx'),
+(6759, 3355, 1, 3, 9, 19, 59, 759, 759, 1759, 6759, 118, 119, 'ZZAAAA', 'BZEAAA', 'VVVVxx'),
+(6404, 3356, 0, 0, 4, 4, 4, 404, 404, 1404, 6404, 8, 9, 'IMAAAA', 'CZEAAA', 'AAAAxx'),
+(3144, 3357, 0, 0, 4, 4, 44, 144, 1144, 3144, 3144, 88, 89, 'YQAAAA', 'DZEAAA', 'HHHHxx'),
+(973, 3358, 1, 1, 3, 13, 73, 973, 973, 973, 973, 146, 147, 'LLAAAA', 'EZEAAA', 'OOOOxx'),
+(9789, 3359, 1, 1, 9, 9, 89, 789, 1789, 4789, 9789, 178, 179, 'NMAAAA', 'FZEAAA', 'VVVVxx'),
+(6181, 3360, 1, 1, 1, 1, 81, 181, 181, 1181, 6181, 162, 163, 'TDAAAA', 'GZEAAA', 'AAAAxx'),
+(1519, 3361, 1, 3, 9, 19, 19, 519, 1519, 1519, 1519, 38, 39, 'LGAAAA', 'HZEAAA', 'HHHHxx'),
+(9729, 3362, 1, 1, 9, 9, 29, 729, 1729, 4729, 9729, 58, 59, 'FKAAAA', 'IZEAAA', 'OOOOxx'),
+(8167, 3363, 1, 3, 7, 7, 67, 167, 167, 3167, 8167, 134, 135, 'DCAAAA', 'JZEAAA', 'VVVVxx'),
+(3830, 3364, 0, 2, 0, 10, 30, 830, 1830, 3830, 3830, 60, 61, 'IRAAAA', 'KZEAAA', 'AAAAxx'),
+(6286, 3365, 0, 2, 6, 6, 86, 286, 286, 1286, 6286, 172, 173, 'UHAAAA', 'LZEAAA', 'HHHHxx'),
+(3047, 3366, 1, 3, 7, 7, 47, 47, 1047, 3047, 3047, 94, 95, 'FNAAAA', 'MZEAAA', 'OOOOxx'),
+(3183, 3367, 1, 3, 3, 3, 83, 183, 1183, 3183, 3183, 166, 167, 'LSAAAA', 'NZEAAA', 'VVVVxx'),
+(6687, 3368, 1, 3, 7, 7, 87, 687, 687, 1687, 6687, 174, 175, 'FXAAAA', 'OZEAAA', 'AAAAxx'),
+(2783, 3369, 1, 3, 3, 3, 83, 783, 783, 2783, 2783, 166, 167, 'BDAAAA', 'PZEAAA', 'HHHHxx'),
+(9920, 3370, 0, 0, 0, 0, 20, 920, 1920, 4920, 9920, 40, 41, 'ORAAAA', 'QZEAAA', 'OOOOxx'),
+(4847, 3371, 1, 3, 7, 7, 47, 847, 847, 4847, 4847, 94, 95, 'LEAAAA', 'RZEAAA', 'VVVVxx'),
+(3645, 3372, 1, 1, 5, 5, 45, 645, 1645, 3645, 3645, 90, 91, 'FKAAAA', 'SZEAAA', 'AAAAxx'),
+(7406, 3373, 0, 2, 6, 6, 6, 406, 1406, 2406, 7406, 12, 13, 'WYAAAA', 'TZEAAA', 'HHHHxx'),
+(6003, 3374, 1, 3, 3, 3, 3, 3, 3, 1003, 6003, 6, 7, 'XWAAAA', 'UZEAAA', 'OOOOxx'),
+(3408, 3375, 0, 0, 8, 8, 8, 408, 1408, 3408, 3408, 16, 17, 'CBAAAA', 'VZEAAA', 'VVVVxx'),
+(4243, 3376, 1, 3, 3, 3, 43, 243, 243, 4243, 4243, 86, 87, 'FHAAAA', 'WZEAAA', 'AAAAxx'),
+(1622, 3377, 0, 2, 2, 2, 22, 622, 1622, 1622, 1622, 44, 45, 'KKAAAA', 'XZEAAA', 'HHHHxx'),
+(5319, 3378, 1, 3, 9, 19, 19, 319, 1319, 319, 5319, 38, 39, 'PWAAAA', 'YZEAAA', 'OOOOxx'),
+(4033, 3379, 1, 1, 3, 13, 33, 33, 33, 4033, 4033, 66, 67, 'DZAAAA', 'ZZEAAA', 'VVVVxx'),
+(8573, 3380, 1, 1, 3, 13, 73, 573, 573, 3573, 8573, 146, 147, 'TRAAAA', 'AAFAAA', 'AAAAxx'),
+(8404, 3381, 0, 0, 4, 4, 4, 404, 404, 3404, 8404, 8, 9, 'GLAAAA', 'BAFAAA', 'HHHHxx'),
+(6993, 3382, 1, 1, 3, 13, 93, 993, 993, 1993, 6993, 186, 187, 'ZIAAAA', 'CAFAAA', 'OOOOxx'),
+(660, 3383, 0, 0, 0, 0, 60, 660, 660, 660, 660, 120, 121, 'KZAAAA', 'DAFAAA', 'VVVVxx'),
+(1136, 3384, 0, 0, 6, 16, 36, 136, 1136, 1136, 1136, 72, 73, 'SRAAAA', 'EAFAAA', 'AAAAxx'),
+(3393, 3385, 1, 1, 3, 13, 93, 393, 1393, 3393, 3393, 186, 187, 'NAAAAA', 'FAFAAA', 'HHHHxx'),
+(9743, 3386, 1, 3, 3, 3, 43, 743, 1743, 4743, 9743, 86, 87, 'TKAAAA', 'GAFAAA', 'OOOOxx'),
+(9705, 3387, 1, 1, 5, 5, 5, 705, 1705, 4705, 9705, 10, 11, 'HJAAAA', 'HAFAAA', 'VVVVxx'),
+(6960, 3388, 0, 0, 0, 0, 60, 960, 960, 1960, 6960, 120, 121, 'SHAAAA', 'IAFAAA', 'AAAAxx'),
+(2753, 3389, 1, 1, 3, 13, 53, 753, 753, 2753, 2753, 106, 107, 'XBAAAA', 'JAFAAA', 'HHHHxx'),
+(906, 3390, 0, 2, 6, 6, 6, 906, 906, 906, 906, 12, 13, 'WIAAAA', 'KAFAAA', 'OOOOxx'),
+(999, 3391, 1, 3, 9, 19, 99, 999, 999, 999, 999, 198, 199, 'LMAAAA', 'LAFAAA', 'VVVVxx'),
+(6927, 3392, 1, 3, 7, 7, 27, 927, 927, 1927, 6927, 54, 55, 'LGAAAA', 'MAFAAA', 'AAAAxx'),
+(4846, 3393, 0, 2, 6, 6, 46, 846, 846, 4846, 4846, 92, 93, 'KEAAAA', 'NAFAAA', 'HHHHxx'),
+(676, 3394, 0, 0, 6, 16, 76, 676, 676, 676, 676, 152, 153, 'AAAAAA', 'OAFAAA', 'OOOOxx'),
+(8612, 3395, 0, 0, 2, 12, 12, 612, 612, 3612, 8612, 24, 25, 'GTAAAA', 'PAFAAA', 'VVVVxx'),
+(4111, 3396, 1, 3, 1, 11, 11, 111, 111, 4111, 4111, 22, 23, 'DCAAAA', 'QAFAAA', 'AAAAxx'),
+(9994, 3397, 0, 2, 4, 14, 94, 994, 1994, 4994, 9994, 188, 189, 'KUAAAA', 'RAFAAA', 'HHHHxx'),
+(4399, 3398, 1, 3, 9, 19, 99, 399, 399, 4399, 4399, 198, 199, 'FNAAAA', 'SAFAAA', 'OOOOxx'),
+(4464, 3399, 0, 0, 4, 4, 64, 464, 464, 4464, 4464, 128, 129, 'SPAAAA', 'TAFAAA', 'VVVVxx'),
+(7316, 3400, 0, 0, 6, 16, 16, 316, 1316, 2316, 7316, 32, 33, 'KVAAAA', 'UAFAAA', 'AAAAxx'),
+(8982, 3401, 0, 2, 2, 2, 82, 982, 982, 3982, 8982, 164, 165, 'MHAAAA', 'VAFAAA', 'HHHHxx'),
+(1871, 3402, 1, 3, 1, 11, 71, 871, 1871, 1871, 1871, 142, 143, 'ZTAAAA', 'WAFAAA', 'OOOOxx'),
+(4082, 3403, 0, 2, 2, 2, 82, 82, 82, 4082, 4082, 164, 165, 'ABAAAA', 'XAFAAA', 'VVVVxx'),
+(3949, 3404, 1, 1, 9, 9, 49, 949, 1949, 3949, 3949, 98, 99, 'XVAAAA', 'YAFAAA', 'AAAAxx'),
+(9352, 3405, 0, 0, 2, 12, 52, 352, 1352, 4352, 9352, 104, 105, 'SVAAAA', 'ZAFAAA', 'HHHHxx'),
+(9638, 3406, 0, 2, 8, 18, 38, 638, 1638, 4638, 9638, 76, 77, 'SGAAAA', 'ABFAAA', 'OOOOxx'),
+(8177, 3407, 1, 1, 7, 17, 77, 177, 177, 3177, 8177, 154, 155, 'NCAAAA', 'BBFAAA', 'VVVVxx'),
+(3499, 3408, 1, 3, 9, 19, 99, 499, 1499, 3499, 3499, 198, 199, 'PEAAAA', 'CBFAAA', 'AAAAxx'),
+(4233, 3409, 1, 1, 3, 13, 33, 233, 233, 4233, 4233, 66, 67, 'VGAAAA', 'DBFAAA', 'HHHHxx'),
+(1953, 3410, 1, 1, 3, 13, 53, 953, 1953, 1953, 1953, 106, 107, 'DXAAAA', 'EBFAAA', 'OOOOxx'),
+(7372, 3411, 0, 0, 2, 12, 72, 372, 1372, 2372, 7372, 144, 145, 'OXAAAA', 'FBFAAA', 'VVVVxx'),
+(5127, 3412, 1, 3, 7, 7, 27, 127, 1127, 127, 5127, 54, 55, 'FPAAAA', 'GBFAAA', 'AAAAxx'),
+(4384, 3413, 0, 0, 4, 4, 84, 384, 384, 4384, 4384, 168, 169, 'QMAAAA', 'HBFAAA', 'HHHHxx'),
+(9964, 3414, 0, 0, 4, 4, 64, 964, 1964, 4964, 9964, 128, 129, 'GTAAAA', 'IBFAAA', 'OOOOxx'),
+(5392, 3415, 0, 0, 2, 12, 92, 392, 1392, 392, 5392, 184, 185, 'KZAAAA', 'JBFAAA', 'VVVVxx'),
+(616, 3416, 0, 0, 6, 16, 16, 616, 616, 616, 616, 32, 33, 'SXAAAA', 'KBFAAA', 'AAAAxx'),
+(591, 3417, 1, 3, 1, 11, 91, 591, 591, 591, 591, 182, 183, 'TWAAAA', 'LBFAAA', 'HHHHxx'),
+(6422, 3418, 0, 2, 2, 2, 22, 422, 422, 1422, 6422, 44, 45, 'ANAAAA', 'MBFAAA', 'OOOOxx'),
+(6551, 3419, 1, 3, 1, 11, 51, 551, 551, 1551, 6551, 102, 103, 'ZRAAAA', 'NBFAAA', 'VVVVxx'),
+(9286, 3420, 0, 2, 6, 6, 86, 286, 1286, 4286, 9286, 172, 173, 'ETAAAA', 'OBFAAA', 'AAAAxx'),
+(3817, 3421, 1, 1, 7, 17, 17, 817, 1817, 3817, 3817, 34, 35, 'VQAAAA', 'PBFAAA', 'HHHHxx'),
+(7717, 3422, 1, 1, 7, 17, 17, 717, 1717, 2717, 7717, 34, 35, 'VKAAAA', 'QBFAAA', 'OOOOxx'),
+(8718, 3423, 0, 2, 8, 18, 18, 718, 718, 3718, 8718, 36, 37, 'IXAAAA', 'RBFAAA', 'VVVVxx'),
+(8608, 3424, 0, 0, 8, 8, 8, 608, 608, 3608, 8608, 16, 17, 'CTAAAA', 'SBFAAA', 'AAAAxx'),
+(2242, 3425, 0, 2, 2, 2, 42, 242, 242, 2242, 2242, 84, 85, 'GIAAAA', 'TBFAAA', 'HHHHxx'),
+(4811, 3426, 1, 3, 1, 11, 11, 811, 811, 4811, 4811, 22, 23, 'BDAAAA', 'UBFAAA', 'OOOOxx'),
+(6838, 3427, 0, 2, 8, 18, 38, 838, 838, 1838, 6838, 76, 77, 'ADAAAA', 'VBFAAA', 'VVVVxx'),
+(787, 3428, 1, 3, 7, 7, 87, 787, 787, 787, 787, 174, 175, 'HEAAAA', 'WBFAAA', 'AAAAxx'),
+(7940, 3429, 0, 0, 0, 0, 40, 940, 1940, 2940, 7940, 80, 81, 'KTAAAA', 'XBFAAA', 'HHHHxx'),
+(336, 3430, 0, 0, 6, 16, 36, 336, 336, 336, 336, 72, 73, 'YMAAAA', 'YBFAAA', 'OOOOxx'),
+(9859, 3431, 1, 3, 9, 19, 59, 859, 1859, 4859, 9859, 118, 119, 'FPAAAA', 'ZBFAAA', 'VVVVxx'),
+(3864, 3432, 0, 0, 4, 4, 64, 864, 1864, 3864, 3864, 128, 129, 'QSAAAA', 'ACFAAA', 'AAAAxx'),
+(7162, 3433, 0, 2, 2, 2, 62, 162, 1162, 2162, 7162, 124, 125, 'MPAAAA', 'BCFAAA', 'HHHHxx'),
+(2071, 3434, 1, 3, 1, 11, 71, 71, 71, 2071, 2071, 142, 143, 'RBAAAA', 'CCFAAA', 'OOOOxx'),
+(7469, 3435, 1, 1, 9, 9, 69, 469, 1469, 2469, 7469, 138, 139, 'HBAAAA', 'DCFAAA', 'VVVVxx'),
+(2917, 3436, 1, 1, 7, 17, 17, 917, 917, 2917, 2917, 34, 35, 'FIAAAA', 'ECFAAA', 'AAAAxx'),
+(7486, 3437, 0, 2, 6, 6, 86, 486, 1486, 2486, 7486, 172, 173, 'YBAAAA', 'FCFAAA', 'HHHHxx'),
+(3355, 3438, 1, 3, 5, 15, 55, 355, 1355, 3355, 3355, 110, 111, 'BZAAAA', 'GCFAAA', 'OOOOxx'),
+(6998, 3439, 0, 2, 8, 18, 98, 998, 998, 1998, 6998, 196, 197, 'EJAAAA', 'HCFAAA', 'VVVVxx'),
+(5498, 3440, 0, 2, 8, 18, 98, 498, 1498, 498, 5498, 196, 197, 'MDAAAA', 'ICFAAA', 'AAAAxx'),
+(5113, 3441, 1, 1, 3, 13, 13, 113, 1113, 113, 5113, 26, 27, 'ROAAAA', 'JCFAAA', 'HHHHxx'),
+(2846, 3442, 0, 2, 6, 6, 46, 846, 846, 2846, 2846, 92, 93, 'MFAAAA', 'KCFAAA', 'OOOOxx'),
+(6834, 3443, 0, 2, 4, 14, 34, 834, 834, 1834, 6834, 68, 69, 'WCAAAA', 'LCFAAA', 'VVVVxx'),
+(8925, 3444, 1, 1, 5, 5, 25, 925, 925, 3925, 8925, 50, 51, 'HFAAAA', 'MCFAAA', 'AAAAxx'),
+(2757, 3445, 1, 1, 7, 17, 57, 757, 757, 2757, 2757, 114, 115, 'BCAAAA', 'NCFAAA', 'HHHHxx'),
+(2775, 3446, 1, 3, 5, 15, 75, 775, 775, 2775, 2775, 150, 151, 'TCAAAA', 'OCFAAA', 'OOOOxx'),
+(6182, 3447, 0, 2, 2, 2, 82, 182, 182, 1182, 6182, 164, 165, 'UDAAAA', 'PCFAAA', 'VVVVxx'),
+(4488, 3448, 0, 0, 8, 8, 88, 488, 488, 4488, 4488, 176, 177, 'QQAAAA', 'QCFAAA', 'AAAAxx'),
+(8523, 3449, 1, 3, 3, 3, 23, 523, 523, 3523, 8523, 46, 47, 'VPAAAA', 'RCFAAA', 'HHHHxx'),
+(52, 3450, 0, 0, 2, 12, 52, 52, 52, 52, 52, 104, 105, 'ACAAAA', 'SCFAAA', 'OOOOxx'),
+(7251, 3451, 1, 3, 1, 11, 51, 251, 1251, 2251, 7251, 102, 103, 'XSAAAA', 'TCFAAA', 'VVVVxx'),
+(6130, 3452, 0, 2, 0, 10, 30, 130, 130, 1130, 6130, 60, 61, 'UBAAAA', 'UCFAAA', 'AAAAxx'),
+(205, 3453, 1, 1, 5, 5, 5, 205, 205, 205, 205, 10, 11, 'XHAAAA', 'VCFAAA', 'HHHHxx'),
+(1186, 3454, 0, 2, 6, 6, 86, 186, 1186, 1186, 1186, 172, 173, 'QTAAAA', 'WCFAAA', 'OOOOxx'),
+(1738, 3455, 0, 2, 8, 18, 38, 738, 1738, 1738, 1738, 76, 77, 'WOAAAA', 'XCFAAA', 'VVVVxx'),
+(9485, 3456, 1, 1, 5, 5, 85, 485, 1485, 4485, 9485, 170, 171, 'VAAAAA', 'YCFAAA', 'AAAAxx'),
+(4235, 3457, 1, 3, 5, 15, 35, 235, 235, 4235, 4235, 70, 71, 'XGAAAA', 'ZCFAAA', 'HHHHxx'),
+(7891, 3458, 1, 3, 1, 11, 91, 891, 1891, 2891, 7891, 182, 183, 'NRAAAA', 'ADFAAA', 'OOOOxx'),
+(4960, 3459, 0, 0, 0, 0, 60, 960, 960, 4960, 4960, 120, 121, 'UIAAAA', 'BDFAAA', 'VVVVxx'),
+(8911, 3460, 1, 3, 1, 11, 11, 911, 911, 3911, 8911, 22, 23, 'TEAAAA', 'CDFAAA', 'AAAAxx'),
+(1219, 3461, 1, 3, 9, 19, 19, 219, 1219, 1219, 1219, 38, 39, 'XUAAAA', 'DDFAAA', 'HHHHxx'),
+(9652, 3462, 0, 0, 2, 12, 52, 652, 1652, 4652, 9652, 104, 105, 'GHAAAA', 'EDFAAA', 'OOOOxx'),
+(9715, 3463, 1, 3, 5, 15, 15, 715, 1715, 4715, 9715, 30, 31, 'RJAAAA', 'FDFAAA', 'VVVVxx'),
+(6629, 3464, 1, 1, 9, 9, 29, 629, 629, 1629, 6629, 58, 59, 'ZUAAAA', 'GDFAAA', 'AAAAxx'),
+(700, 3465, 0, 0, 0, 0, 0, 700, 700, 700, 700, 0, 1, 'YAAAAA', 'HDFAAA', 'HHHHxx'),
+(9819, 3466, 1, 3, 9, 19, 19, 819, 1819, 4819, 9819, 38, 39, 'RNAAAA', 'IDFAAA', 'OOOOxx'),
+(5188, 3467, 0, 0, 8, 8, 88, 188, 1188, 188, 5188, 176, 177, 'ORAAAA', 'JDFAAA', 'VVVVxx'),
+(5367, 3468, 1, 3, 7, 7, 67, 367, 1367, 367, 5367, 134, 135, 'LYAAAA', 'KDFAAA', 'AAAAxx'),
+(6447, 3469, 1, 3, 7, 7, 47, 447, 447, 1447, 6447, 94, 95, 'ZNAAAA', 'LDFAAA', 'HHHHxx'),
+(720, 3470, 0, 0, 0, 0, 20, 720, 720, 720, 720, 40, 41, 'SBAAAA', 'MDFAAA', 'OOOOxx'),
+(9157, 3471, 1, 1, 7, 17, 57, 157, 1157, 4157, 9157, 114, 115, 'FOAAAA', 'NDFAAA', 'VVVVxx'),
+(1082, 3472, 0, 2, 2, 2, 82, 82, 1082, 1082, 1082, 164, 165, 'QPAAAA', 'ODFAAA', 'AAAAxx'),
+(3179, 3473, 1, 3, 9, 19, 79, 179, 1179, 3179, 3179, 158, 159, 'HSAAAA', 'PDFAAA', 'HHHHxx'),
+(4818, 3474, 0, 2, 8, 18, 18, 818, 818, 4818, 4818, 36, 37, 'IDAAAA', 'QDFAAA', 'OOOOxx'),
+(7607, 3475, 1, 3, 7, 7, 7, 607, 1607, 2607, 7607, 14, 15, 'PGAAAA', 'RDFAAA', 'VVVVxx'),
+(2352, 3476, 0, 0, 2, 12, 52, 352, 352, 2352, 2352, 104, 105, 'MMAAAA', 'SDFAAA', 'AAAAxx'),
+(1170, 3477, 0, 2, 0, 10, 70, 170, 1170, 1170, 1170, 140, 141, 'ATAAAA', 'TDFAAA', 'HHHHxx'),
+(4269, 3478, 1, 1, 9, 9, 69, 269, 269, 4269, 4269, 138, 139, 'FIAAAA', 'UDFAAA', 'OOOOxx'),
+(8767, 3479, 1, 3, 7, 7, 67, 767, 767, 3767, 8767, 134, 135, 'FZAAAA', 'VDFAAA', 'VVVVxx'),
+(3984, 3480, 0, 0, 4, 4, 84, 984, 1984, 3984, 3984, 168, 169, 'GXAAAA', 'WDFAAA', 'AAAAxx'),
+(3190, 3481, 0, 2, 0, 10, 90, 190, 1190, 3190, 3190, 180, 181, 'SSAAAA', 'XDFAAA', 'HHHHxx'),
+(7456, 3482, 0, 0, 6, 16, 56, 456, 1456, 2456, 7456, 112, 113, 'UAAAAA', 'YDFAAA', 'OOOOxx'),
+(4348, 3483, 0, 0, 8, 8, 48, 348, 348, 4348, 4348, 96, 97, 'GLAAAA', 'ZDFAAA', 'VVVVxx'),
+(3150, 3484, 0, 2, 0, 10, 50, 150, 1150, 3150, 3150, 100, 101, 'ERAAAA', 'AEFAAA', 'AAAAxx'),
+(8780, 3485, 0, 0, 0, 0, 80, 780, 780, 3780, 8780, 160, 161, 'SZAAAA', 'BEFAAA', 'HHHHxx'),
+(2553, 3486, 1, 1, 3, 13, 53, 553, 553, 2553, 2553, 106, 107, 'FUAAAA', 'CEFAAA', 'OOOOxx'),
+(7526, 3487, 0, 2, 6, 6, 26, 526, 1526, 2526, 7526, 52, 53, 'MDAAAA', 'DEFAAA', 'VVVVxx'),
+(2031, 3488, 1, 3, 1, 11, 31, 31, 31, 2031, 2031, 62, 63, 'DAAAAA', 'EEFAAA', 'AAAAxx'),
+(8793, 3489, 1, 1, 3, 13, 93, 793, 793, 3793, 8793, 186, 187, 'FAAAAA', 'FEFAAA', 'HHHHxx'),
+(1122, 3490, 0, 2, 2, 2, 22, 122, 1122, 1122, 1122, 44, 45, 'ERAAAA', 'GEFAAA', 'OOOOxx'),
+(1855, 3491, 1, 3, 5, 15, 55, 855, 1855, 1855, 1855, 110, 111, 'JTAAAA', 'HEFAAA', 'VVVVxx'),
+(6613, 3492, 1, 1, 3, 13, 13, 613, 613, 1613, 6613, 26, 27, 'JUAAAA', 'IEFAAA', 'AAAAxx'),
+(3231, 3493, 1, 3, 1, 11, 31, 231, 1231, 3231, 3231, 62, 63, 'HUAAAA', 'JEFAAA', 'HHHHxx'),
+(9101, 3494, 1, 1, 1, 1, 1, 101, 1101, 4101, 9101, 2, 3, 'BMAAAA', 'KEFAAA', 'OOOOxx'),
+(4937, 3495, 1, 1, 7, 17, 37, 937, 937, 4937, 4937, 74, 75, 'XHAAAA', 'LEFAAA', 'VVVVxx'),
+(666, 3496, 0, 2, 6, 6, 66, 666, 666, 666, 666, 132, 133, 'QZAAAA', 'MEFAAA', 'AAAAxx'),
+(8943, 3497, 1, 3, 3, 3, 43, 943, 943, 3943, 8943, 86, 87, 'ZFAAAA', 'NEFAAA', 'HHHHxx'),
+(6164, 3498, 0, 0, 4, 4, 64, 164, 164, 1164, 6164, 128, 129, 'CDAAAA', 'OEFAAA', 'OOOOxx'),
+(1081, 3499, 1, 1, 1, 1, 81, 81, 1081, 1081, 1081, 162, 163, 'PPAAAA', 'PEFAAA', 'VVVVxx'),
+(210, 3500, 0, 2, 0, 10, 10, 210, 210, 210, 210, 20, 21, 'CIAAAA', 'QEFAAA', 'AAAAxx'),
+(6024, 3501, 0, 0, 4, 4, 24, 24, 24, 1024, 6024, 48, 49, 'SXAAAA', 'REFAAA', 'HHHHxx'),
+(5715, 3502, 1, 3, 5, 15, 15, 715, 1715, 715, 5715, 30, 31, 'VLAAAA', 'SEFAAA', 'OOOOxx'),
+(8938, 3503, 0, 2, 8, 18, 38, 938, 938, 3938, 8938, 76, 77, 'UFAAAA', 'TEFAAA', 'VVVVxx'),
+(1326, 3504, 0, 2, 6, 6, 26, 326, 1326, 1326, 1326, 52, 53, 'AZAAAA', 'UEFAAA', 'AAAAxx'),
+(7111, 3505, 1, 3, 1, 11, 11, 111, 1111, 2111, 7111, 22, 23, 'NNAAAA', 'VEFAAA', 'HHHHxx'),
+(757, 3506, 1, 1, 7, 17, 57, 757, 757, 757, 757, 114, 115, 'DDAAAA', 'WEFAAA', 'OOOOxx'),
+(8933, 3507, 1, 1, 3, 13, 33, 933, 933, 3933, 8933, 66, 67, 'PFAAAA', 'XEFAAA', 'VVVVxx'),
+(6495, 3508, 1, 3, 5, 15, 95, 495, 495, 1495, 6495, 190, 191, 'VPAAAA', 'YEFAAA', 'AAAAxx'),
+(3134, 3509, 0, 2, 4, 14, 34, 134, 1134, 3134, 3134, 68, 69, 'OQAAAA', 'ZEFAAA', 'HHHHxx'),
+(1304, 3510, 0, 0, 4, 4, 4, 304, 1304, 1304, 1304, 8, 9, 'EYAAAA', 'AFFAAA', 'OOOOxx'),
+(1835, 3511, 1, 3, 5, 15, 35, 835, 1835, 1835, 1835, 70, 71, 'PSAAAA', 'BFFAAA', 'VVVVxx'),
+(7275, 3512, 1, 3, 5, 15, 75, 275, 1275, 2275, 7275, 150, 151, 'VTAAAA', 'CFFAAA', 'AAAAxx'),
+(7337, 3513, 1, 1, 7, 17, 37, 337, 1337, 2337, 7337, 74, 75, 'FWAAAA', 'DFFAAA', 'HHHHxx'),
+(1282, 3514, 0, 2, 2, 2, 82, 282, 1282, 1282, 1282, 164, 165, 'IXAAAA', 'EFFAAA', 'OOOOxx'),
+(6566, 3515, 0, 2, 6, 6, 66, 566, 566, 1566, 6566, 132, 133, 'OSAAAA', 'FFFAAA', 'VVVVxx'),
+(3786, 3516, 0, 2, 6, 6, 86, 786, 1786, 3786, 3786, 172, 173, 'QPAAAA', 'GFFAAA', 'AAAAxx'),
+(5741, 3517, 1, 1, 1, 1, 41, 741, 1741, 741, 5741, 82, 83, 'VMAAAA', 'HFFAAA', 'HHHHxx'),
+(6076, 3518, 0, 0, 6, 16, 76, 76, 76, 1076, 6076, 152, 153, 'SZAAAA', 'IFFAAA', 'OOOOxx'),
+(9998, 3519, 0, 2, 8, 18, 98, 998, 1998, 4998, 9998, 196, 197, 'OUAAAA', 'JFFAAA', 'VVVVxx'),
+(6268, 3520, 0, 0, 8, 8, 68, 268, 268, 1268, 6268, 136, 137, 'CHAAAA', 'KFFAAA', 'AAAAxx'),
+(9647, 3521, 1, 3, 7, 7, 47, 647, 1647, 4647, 9647, 94, 95, 'BHAAAA', 'LFFAAA', 'HHHHxx'),
+(4877, 3522, 1, 1, 7, 17, 77, 877, 877, 4877, 4877, 154, 155, 'PFAAAA', 'MFFAAA', 'OOOOxx'),
+(2652, 3523, 0, 0, 2, 12, 52, 652, 652, 2652, 2652, 104, 105, 'AYAAAA', 'NFFAAA', 'VVVVxx'),
+(1247, 3524, 1, 3, 7, 7, 47, 247, 1247, 1247, 1247, 94, 95, 'ZVAAAA', 'OFFAAA', 'AAAAxx'),
+(2721, 3525, 1, 1, 1, 1, 21, 721, 721, 2721, 2721, 42, 43, 'RAAAAA', 'PFFAAA', 'HHHHxx'),
+(5968, 3526, 0, 0, 8, 8, 68, 968, 1968, 968, 5968, 136, 137, 'OVAAAA', 'QFFAAA', 'OOOOxx'),
+(9570, 3527, 0, 2, 0, 10, 70, 570, 1570, 4570, 9570, 140, 141, 'CEAAAA', 'RFFAAA', 'VVVVxx'),
+(6425, 3528, 1, 1, 5, 5, 25, 425, 425, 1425, 6425, 50, 51, 'DNAAAA', 'SFFAAA', 'AAAAxx'),
+(5451, 3529, 1, 3, 1, 11, 51, 451, 1451, 451, 5451, 102, 103, 'RBAAAA', 'TFFAAA', 'HHHHxx'),
+(5668, 3530, 0, 0, 8, 8, 68, 668, 1668, 668, 5668, 136, 137, 'AKAAAA', 'UFFAAA', 'OOOOxx'),
+(9493, 3531, 1, 1, 3, 13, 93, 493, 1493, 4493, 9493, 186, 187, 'DBAAAA', 'VFFAAA', 'VVVVxx'),
+(7973, 3532, 1, 1, 3, 13, 73, 973, 1973, 2973, 7973, 146, 147, 'RUAAAA', 'WFFAAA', 'AAAAxx'),
+(8250, 3533, 0, 2, 0, 10, 50, 250, 250, 3250, 8250, 100, 101, 'IFAAAA', 'XFFAAA', 'HHHHxx'),
+(82, 3534, 0, 2, 2, 2, 82, 82, 82, 82, 82, 164, 165, 'EDAAAA', 'YFFAAA', 'OOOOxx'),
+(6258, 3535, 0, 2, 8, 18, 58, 258, 258, 1258, 6258, 116, 117, 'SGAAAA', 'ZFFAAA', 'VVVVxx'),
+(9978, 3536, 0, 2, 8, 18, 78, 978, 1978, 4978, 9978, 156, 157, 'UTAAAA', 'AGFAAA', 'AAAAxx'),
+(6930, 3537, 0, 2, 0, 10, 30, 930, 930, 1930, 6930, 60, 61, 'OGAAAA', 'BGFAAA', 'HHHHxx'),
+(3746, 3538, 0, 2, 6, 6, 46, 746, 1746, 3746, 3746, 92, 93, 'COAAAA', 'CGFAAA', 'OOOOxx'),
+(7065, 3539, 1, 1, 5, 5, 65, 65, 1065, 2065, 7065, 130, 131, 'TLAAAA', 'DGFAAA', 'VVVVxx'),
+(4281, 3540, 1, 1, 1, 1, 81, 281, 281, 4281, 4281, 162, 163, 'RIAAAA', 'EGFAAA', 'AAAAxx'),
+(4367, 3541, 1, 3, 7, 7, 67, 367, 367, 4367, 4367, 134, 135, 'ZLAAAA', 'FGFAAA', 'HHHHxx'),
+(9526, 3542, 0, 2, 6, 6, 26, 526, 1526, 4526, 9526, 52, 53, 'KCAAAA', 'GGFAAA', 'OOOOxx'),
+(5880, 3543, 0, 0, 0, 0, 80, 880, 1880, 880, 5880, 160, 161, 'ESAAAA', 'HGFAAA', 'VVVVxx'),
+(8480, 3544, 0, 0, 0, 0, 80, 480, 480, 3480, 8480, 160, 161, 'EOAAAA', 'IGFAAA', 'AAAAxx'),
+(2476, 3545, 0, 0, 6, 16, 76, 476, 476, 2476, 2476, 152, 153, 'GRAAAA', 'JGFAAA', 'HHHHxx'),
+(9074, 3546, 0, 2, 4, 14, 74, 74, 1074, 4074, 9074, 148, 149, 'ALAAAA', 'KGFAAA', 'OOOOxx'),
+(4830, 3547, 0, 2, 0, 10, 30, 830, 830, 4830, 4830, 60, 61, 'UDAAAA', 'LGFAAA', 'VVVVxx'),
+(3207, 3548, 1, 3, 7, 7, 7, 207, 1207, 3207, 3207, 14, 15, 'JTAAAA', 'MGFAAA', 'AAAAxx'),
+(7894, 3549, 0, 2, 4, 14, 94, 894, 1894, 2894, 7894, 188, 189, 'QRAAAA', 'NGFAAA', 'HHHHxx'),
+(3860, 3550, 0, 0, 0, 0, 60, 860, 1860, 3860, 3860, 120, 121, 'MSAAAA', 'OGFAAA', 'OOOOxx'),
+(5293, 3551, 1, 1, 3, 13, 93, 293, 1293, 293, 5293, 186, 187, 'PVAAAA', 'PGFAAA', 'VVVVxx'),
+(6895, 3552, 1, 3, 5, 15, 95, 895, 895, 1895, 6895, 190, 191, 'FFAAAA', 'QGFAAA', 'AAAAxx'),
+(9908, 3553, 0, 0, 8, 8, 8, 908, 1908, 4908, 9908, 16, 17, 'CRAAAA', 'RGFAAA', 'HHHHxx'),
+(9247, 3554, 1, 3, 7, 7, 47, 247, 1247, 4247, 9247, 94, 95, 'RRAAAA', 'SGFAAA', 'OOOOxx'),
+(8110, 3555, 0, 2, 0, 10, 10, 110, 110, 3110, 8110, 20, 21, 'YZAAAA', 'TGFAAA', 'VVVVxx'),
+(4716, 3556, 0, 0, 6, 16, 16, 716, 716, 4716, 4716, 32, 33, 'KZAAAA', 'UGFAAA', 'AAAAxx'),
+(4979, 3557, 1, 3, 9, 19, 79, 979, 979, 4979, 4979, 158, 159, 'NJAAAA', 'VGFAAA', 'HHHHxx'),
+(5280, 3558, 0, 0, 0, 0, 80, 280, 1280, 280, 5280, 160, 161, 'CVAAAA', 'WGFAAA', 'OOOOxx'),
+(8326, 3559, 0, 2, 6, 6, 26, 326, 326, 3326, 8326, 52, 53, 'GIAAAA', 'XGFAAA', 'VVVVxx'),
+(5572, 3560, 0, 0, 2, 12, 72, 572, 1572, 572, 5572, 144, 145, 'IGAAAA', 'YGFAAA', 'AAAAxx'),
+(4665, 3561, 1, 1, 5, 5, 65, 665, 665, 4665, 4665, 130, 131, 'LXAAAA', 'ZGFAAA', 'HHHHxx'),
+(3665, 3562, 1, 1, 5, 5, 65, 665, 1665, 3665, 3665, 130, 131, 'ZKAAAA', 'AHFAAA', 'OOOOxx'),
+(6744, 3563, 0, 0, 4, 4, 44, 744, 744, 1744, 6744, 88, 89, 'KZAAAA', 'BHFAAA', 'VVVVxx'),
+(1897, 3564, 1, 1, 7, 17, 97, 897, 1897, 1897, 1897, 194, 195, 'ZUAAAA', 'CHFAAA', 'AAAAxx'),
+(1220, 3565, 0, 0, 0, 0, 20, 220, 1220, 1220, 1220, 40, 41, 'YUAAAA', 'DHFAAA', 'HHHHxx'),
+(2614, 3566, 0, 2, 4, 14, 14, 614, 614, 2614, 2614, 28, 29, 'OWAAAA', 'EHFAAA', 'OOOOxx'),
+(8509, 3567, 1, 1, 9, 9, 9, 509, 509, 3509, 8509, 18, 19, 'HPAAAA', 'FHFAAA', 'VVVVxx'),
+(8521, 3568, 1, 1, 1, 1, 21, 521, 521, 3521, 8521, 42, 43, 'TPAAAA', 'GHFAAA', 'AAAAxx'),
+(4121, 3569, 1, 1, 1, 1, 21, 121, 121, 4121, 4121, 42, 43, 'NCAAAA', 'HHFAAA', 'HHHHxx'),
+(9663, 3570, 1, 3, 3, 3, 63, 663, 1663, 4663, 9663, 126, 127, 'RHAAAA', 'IHFAAA', 'OOOOxx'),
+(2346, 3571, 0, 2, 6, 6, 46, 346, 346, 2346, 2346, 92, 93, 'GMAAAA', 'JHFAAA', 'VVVVxx'),
+(3370, 3572, 0, 2, 0, 10, 70, 370, 1370, 3370, 3370, 140, 141, 'QZAAAA', 'KHFAAA', 'AAAAxx'),
+(1498, 3573, 0, 2, 8, 18, 98, 498, 1498, 1498, 1498, 196, 197, 'QFAAAA', 'LHFAAA', 'HHHHxx'),
+(7422, 3574, 0, 2, 2, 2, 22, 422, 1422, 2422, 7422, 44, 45, 'MZAAAA', 'MHFAAA', 'OOOOxx'),
+(3472, 3575, 0, 0, 2, 12, 72, 472, 1472, 3472, 3472, 144, 145, 'ODAAAA', 'NHFAAA', 'VVVVxx'),
+(4126, 3576, 0, 2, 6, 6, 26, 126, 126, 4126, 4126, 52, 53, 'SCAAAA', 'OHFAAA', 'AAAAxx'),
+(4494, 3577, 0, 2, 4, 14, 94, 494, 494, 4494, 4494, 188, 189, 'WQAAAA', 'PHFAAA', 'HHHHxx'),
+(6323, 3578, 1, 3, 3, 3, 23, 323, 323, 1323, 6323, 46, 47, 'FJAAAA', 'QHFAAA', 'OOOOxx'),
+(2823, 3579, 1, 3, 3, 3, 23, 823, 823, 2823, 2823, 46, 47, 'PEAAAA', 'RHFAAA', 'VVVVxx'),
+(8596, 3580, 0, 0, 6, 16, 96, 596, 596, 3596, 8596, 192, 193, 'QSAAAA', 'SHFAAA', 'AAAAxx'),
+(6642, 3581, 0, 2, 2, 2, 42, 642, 642, 1642, 6642, 84, 85, 'MVAAAA', 'THFAAA', 'HHHHxx'),
+(9276, 3582, 0, 0, 6, 16, 76, 276, 1276, 4276, 9276, 152, 153, 'USAAAA', 'UHFAAA', 'OOOOxx'),
+(4148, 3583, 0, 0, 8, 8, 48, 148, 148, 4148, 4148, 96, 97, 'ODAAAA', 'VHFAAA', 'VVVVxx'),
+(9770, 3584, 0, 2, 0, 10, 70, 770, 1770, 4770, 9770, 140, 141, 'ULAAAA', 'WHFAAA', 'AAAAxx'),
+(9812, 3585, 0, 0, 2, 12, 12, 812, 1812, 4812, 9812, 24, 25, 'KNAAAA', 'XHFAAA', 'HHHHxx'),
+(4419, 3586, 1, 3, 9, 19, 19, 419, 419, 4419, 4419, 38, 39, 'ZNAAAA', 'YHFAAA', 'OOOOxx'),
+(3802, 3587, 0, 2, 2, 2, 2, 802, 1802, 3802, 3802, 4, 5, 'GQAAAA', 'ZHFAAA', 'VVVVxx'),
+(3210, 3588, 0, 2, 0, 10, 10, 210, 1210, 3210, 3210, 20, 21, 'MTAAAA', 'AIFAAA', 'AAAAxx'),
+(6794, 3589, 0, 2, 4, 14, 94, 794, 794, 1794, 6794, 188, 189, 'IBAAAA', 'BIFAAA', 'HHHHxx'),
+(242, 3590, 0, 2, 2, 2, 42, 242, 242, 242, 242, 84, 85, 'IJAAAA', 'CIFAAA', 'OOOOxx'),
+(962, 3591, 0, 2, 2, 2, 62, 962, 962, 962, 962, 124, 125, 'ALAAAA', 'DIFAAA', 'VVVVxx'),
+(7151, 3592, 1, 3, 1, 11, 51, 151, 1151, 2151, 7151, 102, 103, 'BPAAAA', 'EIFAAA', 'AAAAxx'),
+(9440, 3593, 0, 0, 0, 0, 40, 440, 1440, 4440, 9440, 80, 81, 'CZAAAA', 'FIFAAA', 'HHHHxx'),
+(721, 3594, 1, 1, 1, 1, 21, 721, 721, 721, 721, 42, 43, 'TBAAAA', 'GIFAAA', 'OOOOxx'),
+(2119, 3595, 1, 3, 9, 19, 19, 119, 119, 2119, 2119, 38, 39, 'NDAAAA', 'HIFAAA', 'VVVVxx'),
+(9883, 3596, 1, 3, 3, 3, 83, 883, 1883, 4883, 9883, 166, 167, 'DQAAAA', 'IIFAAA', 'AAAAxx'),
+(5071, 3597, 1, 3, 1, 11, 71, 71, 1071, 71, 5071, 142, 143, 'BNAAAA', 'JIFAAA', 'HHHHxx'),
+(8239, 3598, 1, 3, 9, 19, 39, 239, 239, 3239, 8239, 78, 79, 'XEAAAA', 'KIFAAA', 'OOOOxx'),
+(7451, 3599, 1, 3, 1, 11, 51, 451, 1451, 2451, 7451, 102, 103, 'PAAAAA', 'LIFAAA', 'VVVVxx'),
+(9517, 3600, 1, 1, 7, 17, 17, 517, 1517, 4517, 9517, 34, 35, 'BCAAAA', 'MIFAAA', 'AAAAxx'),
+(9180, 3601, 0, 0, 0, 0, 80, 180, 1180, 4180, 9180, 160, 161, 'CPAAAA', 'NIFAAA', 'HHHHxx'),
+(9327, 3602, 1, 3, 7, 7, 27, 327, 1327, 4327, 9327, 54, 55, 'TUAAAA', 'OIFAAA', 'OOOOxx'),
+(5462, 3603, 0, 2, 2, 2, 62, 462, 1462, 462, 5462, 124, 125, 'CCAAAA', 'PIFAAA', 'VVVVxx'),
+(8306, 3604, 0, 2, 6, 6, 6, 306, 306, 3306, 8306, 12, 13, 'MHAAAA', 'QIFAAA', 'AAAAxx'),
+(6234, 3605, 0, 2, 4, 14, 34, 234, 234, 1234, 6234, 68, 69, 'UFAAAA', 'RIFAAA', 'HHHHxx'),
+(8771, 3606, 1, 3, 1, 11, 71, 771, 771, 3771, 8771, 142, 143, 'JZAAAA', 'SIFAAA', 'OOOOxx'),
+(5853, 3607, 1, 1, 3, 13, 53, 853, 1853, 853, 5853, 106, 107, 'DRAAAA', 'TIFAAA', 'VVVVxx'),
+(8373, 3608, 1, 1, 3, 13, 73, 373, 373, 3373, 8373, 146, 147, 'BKAAAA', 'UIFAAA', 'AAAAxx'),
+(5017, 3609, 1, 1, 7, 17, 17, 17, 1017, 17, 5017, 34, 35, 'ZKAAAA', 'VIFAAA', 'HHHHxx'),
+(8025, 3610, 1, 1, 5, 5, 25, 25, 25, 3025, 8025, 50, 51, 'RWAAAA', 'WIFAAA', 'OOOOxx'),
+(2526, 3611, 0, 2, 6, 6, 26, 526, 526, 2526, 2526, 52, 53, 'ETAAAA', 'XIFAAA', 'VVVVxx'),
+(7419, 3612, 1, 3, 9, 19, 19, 419, 1419, 2419, 7419, 38, 39, 'JZAAAA', 'YIFAAA', 'AAAAxx'),
+(4572, 3613, 0, 0, 2, 12, 72, 572, 572, 4572, 4572, 144, 145, 'WTAAAA', 'ZIFAAA', 'HHHHxx'),
+(7744, 3614, 0, 0, 4, 4, 44, 744, 1744, 2744, 7744, 88, 89, 'WLAAAA', 'AJFAAA', 'OOOOxx'),
+(8825, 3615, 1, 1, 5, 5, 25, 825, 825, 3825, 8825, 50, 51, 'LBAAAA', 'BJFAAA', 'VVVVxx'),
+(6067, 3616, 1, 3, 7, 7, 67, 67, 67, 1067, 6067, 134, 135, 'JZAAAA', 'CJFAAA', 'AAAAxx'),
+(3291, 3617, 1, 3, 1, 11, 91, 291, 1291, 3291, 3291, 182, 183, 'PWAAAA', 'DJFAAA', 'HHHHxx'),
+(7115, 3618, 1, 3, 5, 15, 15, 115, 1115, 2115, 7115, 30, 31, 'RNAAAA', 'EJFAAA', 'OOOOxx'),
+(2626, 3619, 0, 2, 6, 6, 26, 626, 626, 2626, 2626, 52, 53, 'AXAAAA', 'FJFAAA', 'VVVVxx'),
+(4109, 3620, 1, 1, 9, 9, 9, 109, 109, 4109, 4109, 18, 19, 'BCAAAA', 'GJFAAA', 'AAAAxx'),
+(4056, 3621, 0, 0, 6, 16, 56, 56, 56, 4056, 4056, 112, 113, 'AAAAAA', 'HJFAAA', 'HHHHxx'),
+(6811, 3622, 1, 3, 1, 11, 11, 811, 811, 1811, 6811, 22, 23, 'ZBAAAA', 'IJFAAA', 'OOOOxx'),
+(680, 3623, 0, 0, 0, 0, 80, 680, 680, 680, 680, 160, 161, 'EAAAAA', 'JJFAAA', 'VVVVxx'),
+(474, 3624, 0, 2, 4, 14, 74, 474, 474, 474, 474, 148, 149, 'GSAAAA', 'KJFAAA', 'AAAAxx'),
+(9294, 3625, 0, 2, 4, 14, 94, 294, 1294, 4294, 9294, 188, 189, 'MTAAAA', 'LJFAAA', 'HHHHxx'),
+(7555, 3626, 1, 3, 5, 15, 55, 555, 1555, 2555, 7555, 110, 111, 'PEAAAA', 'MJFAAA', 'OOOOxx'),
+(8076, 3627, 0, 0, 6, 16, 76, 76, 76, 3076, 8076, 152, 153, 'QYAAAA', 'NJFAAA', 'VVVVxx'),
+(3840, 3628, 0, 0, 0, 0, 40, 840, 1840, 3840, 3840, 80, 81, 'SRAAAA', 'OJFAAA', 'AAAAxx'),
+(5955, 3629, 1, 3, 5, 15, 55, 955, 1955, 955, 5955, 110, 111, 'BVAAAA', 'PJFAAA', 'HHHHxx'),
+(994, 3630, 0, 2, 4, 14, 94, 994, 994, 994, 994, 188, 189, 'GMAAAA', 'QJFAAA', 'OOOOxx'),
+(2089, 3631, 1, 1, 9, 9, 89, 89, 89, 2089, 2089, 178, 179, 'JCAAAA', 'RJFAAA', 'VVVVxx'),
+(869, 3632, 1, 1, 9, 9, 69, 869, 869, 869, 869, 138, 139, 'LHAAAA', 'SJFAAA', 'AAAAxx'),
+(1223, 3633, 1, 3, 3, 3, 23, 223, 1223, 1223, 1223, 46, 47, 'BVAAAA', 'TJFAAA', 'HHHHxx'),
+(1514, 3634, 0, 2, 4, 14, 14, 514, 1514, 1514, 1514, 28, 29, 'GGAAAA', 'UJFAAA', 'OOOOxx'),
+(4891, 3635, 1, 3, 1, 11, 91, 891, 891, 4891, 4891, 182, 183, 'DGAAAA', 'VJFAAA', 'VVVVxx'),
+(4190, 3636, 0, 2, 0, 10, 90, 190, 190, 4190, 4190, 180, 181, 'EFAAAA', 'WJFAAA', 'AAAAxx'),
+(4377, 3637, 1, 1, 7, 17, 77, 377, 377, 4377, 4377, 154, 155, 'JMAAAA', 'XJFAAA', 'HHHHxx'),
+(9195, 3638, 1, 3, 5, 15, 95, 195, 1195, 4195, 9195, 190, 191, 'RPAAAA', 'YJFAAA', 'OOOOxx'),
+(3827, 3639, 1, 3, 7, 7, 27, 827, 1827, 3827, 3827, 54, 55, 'FRAAAA', 'ZJFAAA', 'VVVVxx'),
+(7386, 3640, 0, 2, 6, 6, 86, 386, 1386, 2386, 7386, 172, 173, 'CYAAAA', 'AKFAAA', 'AAAAxx'),
+(6665, 3641, 1, 1, 5, 5, 65, 665, 665, 1665, 6665, 130, 131, 'JWAAAA', 'BKFAAA', 'HHHHxx'),
+(7514, 3642, 0, 2, 4, 14, 14, 514, 1514, 2514, 7514, 28, 29, 'ADAAAA', 'CKFAAA', 'OOOOxx'),
+(6431, 3643, 1, 3, 1, 11, 31, 431, 431, 1431, 6431, 62, 63, 'JNAAAA', 'DKFAAA', 'VVVVxx'),
+(3251, 3644, 1, 3, 1, 11, 51, 251, 1251, 3251, 3251, 102, 103, 'BVAAAA', 'EKFAAA', 'AAAAxx'),
+(8439, 3645, 1, 3, 9, 19, 39, 439, 439, 3439, 8439, 78, 79, 'PMAAAA', 'FKFAAA', 'HHHHxx'),
+(831, 3646, 1, 3, 1, 11, 31, 831, 831, 831, 831, 62, 63, 'ZFAAAA', 'GKFAAA', 'OOOOxx'),
+(8485, 3647, 1, 1, 5, 5, 85, 485, 485, 3485, 8485, 170, 171, 'JOAAAA', 'HKFAAA', 'VVVVxx'),
+(7314, 3648, 0, 2, 4, 14, 14, 314, 1314, 2314, 7314, 28, 29, 'IVAAAA', 'IKFAAA', 'AAAAxx'),
+(3044, 3649, 0, 0, 4, 4, 44, 44, 1044, 3044, 3044, 88, 89, 'CNAAAA', 'JKFAAA', 'HHHHxx'),
+(4283, 3650, 1, 3, 3, 3, 83, 283, 283, 4283, 4283, 166, 167, 'TIAAAA', 'KKFAAA', 'OOOOxx'),
+(298, 3651, 0, 2, 8, 18, 98, 298, 298, 298, 298, 196, 197, 'MLAAAA', 'LKFAAA', 'VVVVxx'),
+(7114, 3652, 0, 2, 4, 14, 14, 114, 1114, 2114, 7114, 28, 29, 'QNAAAA', 'MKFAAA', 'AAAAxx'),
+(9664, 3653, 0, 0, 4, 4, 64, 664, 1664, 4664, 9664, 128, 129, 'SHAAAA', 'NKFAAA', 'HHHHxx'),
+(5315, 3654, 1, 3, 5, 15, 15, 315, 1315, 315, 5315, 30, 31, 'LWAAAA', 'OKFAAA', 'OOOOxx'),
+(2164, 3655, 0, 0, 4, 4, 64, 164, 164, 2164, 2164, 128, 129, 'GFAAAA', 'PKFAAA', 'VVVVxx'),
+(3390, 3656, 0, 2, 0, 10, 90, 390, 1390, 3390, 3390, 180, 181, 'KAAAAA', 'QKFAAA', 'AAAAxx'),
+(836, 3657, 0, 0, 6, 16, 36, 836, 836, 836, 836, 72, 73, 'EGAAAA', 'RKFAAA', 'HHHHxx'),
+(3316, 3658, 0, 0, 6, 16, 16, 316, 1316, 3316, 3316, 32, 33, 'OXAAAA', 'SKFAAA', 'OOOOxx'),
+(1284, 3659, 0, 0, 4, 4, 84, 284, 1284, 1284, 1284, 168, 169, 'KXAAAA', 'TKFAAA', 'VVVVxx'),
+(2497, 3660, 1, 1, 7, 17, 97, 497, 497, 2497, 2497, 194, 195, 'BSAAAA', 'UKFAAA', 'AAAAxx'),
+(1374, 3661, 0, 2, 4, 14, 74, 374, 1374, 1374, 1374, 148, 149, 'WAAAAA', 'VKFAAA', 'HHHHxx'),
+(9525, 3662, 1, 1, 5, 5, 25, 525, 1525, 4525, 9525, 50, 51, 'JCAAAA', 'WKFAAA', 'OOOOxx'),
+(2911, 3663, 1, 3, 1, 11, 11, 911, 911, 2911, 2911, 22, 23, 'ZHAAAA', 'XKFAAA', 'VVVVxx'),
+(9686, 3664, 0, 2, 6, 6, 86, 686, 1686, 4686, 9686, 172, 173, 'OIAAAA', 'YKFAAA', 'AAAAxx'),
+(584, 3665, 0, 0, 4, 4, 84, 584, 584, 584, 584, 168, 169, 'MWAAAA', 'ZKFAAA', 'HHHHxx'),
+(5653, 3666, 1, 1, 3, 13, 53, 653, 1653, 653, 5653, 106, 107, 'LJAAAA', 'ALFAAA', 'OOOOxx'),
+(4986, 3667, 0, 2, 6, 6, 86, 986, 986, 4986, 4986, 172, 173, 'UJAAAA', 'BLFAAA', 'VVVVxx'),
+(6049, 3668, 1, 1, 9, 9, 49, 49, 49, 1049, 6049, 98, 99, 'RYAAAA', 'CLFAAA', 'AAAAxx'),
+(9891, 3669, 1, 3, 1, 11, 91, 891, 1891, 4891, 9891, 182, 183, 'LQAAAA', 'DLFAAA', 'HHHHxx'),
+(8809, 3670, 1, 1, 9, 9, 9, 809, 809, 3809, 8809, 18, 19, 'VAAAAA', 'ELFAAA', 'OOOOxx'),
+(8598, 3671, 0, 2, 8, 18, 98, 598, 598, 3598, 8598, 196, 197, 'SSAAAA', 'FLFAAA', 'VVVVxx'),
+(2573, 3672, 1, 1, 3, 13, 73, 573, 573, 2573, 2573, 146, 147, 'ZUAAAA', 'GLFAAA', 'AAAAxx'),
+(6864, 3673, 0, 0, 4, 4, 64, 864, 864, 1864, 6864, 128, 129, 'AEAAAA', 'HLFAAA', 'HHHHxx'),
+(7932, 3674, 0, 0, 2, 12, 32, 932, 1932, 2932, 7932, 64, 65, 'CTAAAA', 'ILFAAA', 'OOOOxx'),
+(6605, 3675, 1, 1, 5, 5, 5, 605, 605, 1605, 6605, 10, 11, 'BUAAAA', 'JLFAAA', 'VVVVxx'),
+(9500, 3676, 0, 0, 0, 0, 0, 500, 1500, 4500, 9500, 0, 1, 'KBAAAA', 'KLFAAA', 'AAAAxx'),
+(8742, 3677, 0, 2, 2, 2, 42, 742, 742, 3742, 8742, 84, 85, 'GYAAAA', 'LLFAAA', 'HHHHxx'),
+(9815, 3678, 1, 3, 5, 15, 15, 815, 1815, 4815, 9815, 30, 31, 'NNAAAA', 'MLFAAA', 'OOOOxx'),
+(3319, 3679, 1, 3, 9, 19, 19, 319, 1319, 3319, 3319, 38, 39, 'RXAAAA', 'NLFAAA', 'VVVVxx'),
+(184, 3680, 0, 0, 4, 4, 84, 184, 184, 184, 184, 168, 169, 'CHAAAA', 'OLFAAA', 'AAAAxx'),
+(8886, 3681, 0, 2, 6, 6, 86, 886, 886, 3886, 8886, 172, 173, 'UDAAAA', 'PLFAAA', 'HHHHxx'),
+(7050, 3682, 0, 2, 0, 10, 50, 50, 1050, 2050, 7050, 100, 101, 'ELAAAA', 'QLFAAA', 'OOOOxx'),
+(9781, 3683, 1, 1, 1, 1, 81, 781, 1781, 4781, 9781, 162, 163, 'FMAAAA', 'RLFAAA', 'VVVVxx'),
+(2443, 3684, 1, 3, 3, 3, 43, 443, 443, 2443, 2443, 86, 87, 'ZPAAAA', 'SLFAAA', 'AAAAxx'),
+(1160, 3685, 0, 0, 0, 0, 60, 160, 1160, 1160, 1160, 120, 121, 'QSAAAA', 'TLFAAA', 'HHHHxx'),
+(4600, 3686, 0, 0, 0, 0, 0, 600, 600, 4600, 4600, 0, 1, 'YUAAAA', 'ULFAAA', 'OOOOxx'),
+(813, 3687, 1, 1, 3, 13, 13, 813, 813, 813, 813, 26, 27, 'HFAAAA', 'VLFAAA', 'VVVVxx'),
+(5078, 3688, 0, 2, 8, 18, 78, 78, 1078, 78, 5078, 156, 157, 'INAAAA', 'WLFAAA', 'AAAAxx'),
+(9008, 3689, 0, 0, 8, 8, 8, 8, 1008, 4008, 9008, 16, 17, 'MIAAAA', 'XLFAAA', 'HHHHxx'),
+(9016, 3690, 0, 0, 6, 16, 16, 16, 1016, 4016, 9016, 32, 33, 'UIAAAA', 'YLFAAA', 'OOOOxx'),
+(2747, 3691, 1, 3, 7, 7, 47, 747, 747, 2747, 2747, 94, 95, 'RBAAAA', 'ZLFAAA', 'VVVVxx'),
+(3106, 3692, 0, 2, 6, 6, 6, 106, 1106, 3106, 3106, 12, 13, 'MPAAAA', 'AMFAAA', 'AAAAxx'),
+(8235, 3693, 1, 3, 5, 15, 35, 235, 235, 3235, 8235, 70, 71, 'TEAAAA', 'BMFAAA', 'HHHHxx'),
+(5582, 3694, 0, 2, 2, 2, 82, 582, 1582, 582, 5582, 164, 165, 'SGAAAA', 'CMFAAA', 'OOOOxx'),
+(4334, 3695, 0, 2, 4, 14, 34, 334, 334, 4334, 4334, 68, 69, 'SKAAAA', 'DMFAAA', 'VVVVxx'),
+(1612, 3696, 0, 0, 2, 12, 12, 612, 1612, 1612, 1612, 24, 25, 'AKAAAA', 'EMFAAA', 'AAAAxx'),
+(5650, 3697, 0, 2, 0, 10, 50, 650, 1650, 650, 5650, 100, 101, 'IJAAAA', 'FMFAAA', 'HHHHxx'),
+(6086, 3698, 0, 2, 6, 6, 86, 86, 86, 1086, 6086, 172, 173, 'CAAAAA', 'GMFAAA', 'OOOOxx'),
+(9667, 3699, 1, 3, 7, 7, 67, 667, 1667, 4667, 9667, 134, 135, 'VHAAAA', 'HMFAAA', 'VVVVxx'),
+(4215, 3700, 1, 3, 5, 15, 15, 215, 215, 4215, 4215, 30, 31, 'DGAAAA', 'IMFAAA', 'AAAAxx'),
+(8553, 3701, 1, 1, 3, 13, 53, 553, 553, 3553, 8553, 106, 107, 'ZQAAAA', 'JMFAAA', 'HHHHxx'),
+(9066, 3702, 0, 2, 6, 6, 66, 66, 1066, 4066, 9066, 132, 133, 'SKAAAA', 'KMFAAA', 'OOOOxx'),
+(1092, 3703, 0, 0, 2, 12, 92, 92, 1092, 1092, 1092, 184, 185, 'AQAAAA', 'LMFAAA', 'VVVVxx'),
+(2848, 3704, 0, 0, 8, 8, 48, 848, 848, 2848, 2848, 96, 97, 'OFAAAA', 'MMFAAA', 'AAAAxx'),
+(2765, 3705, 1, 1, 5, 5, 65, 765, 765, 2765, 2765, 130, 131, 'JCAAAA', 'NMFAAA', 'HHHHxx'),
+(6513, 3706, 1, 1, 3, 13, 13, 513, 513, 1513, 6513, 26, 27, 'NQAAAA', 'OMFAAA', 'OOOOxx'),
+(6541, 3707, 1, 1, 1, 1, 41, 541, 541, 1541, 6541, 82, 83, 'PRAAAA', 'PMFAAA', 'VVVVxx'),
+(9617, 3708, 1, 1, 7, 17, 17, 617, 1617, 4617, 9617, 34, 35, 'XFAAAA', 'QMFAAA', 'AAAAxx'),
+(5870, 3709, 0, 2, 0, 10, 70, 870, 1870, 870, 5870, 140, 141, 'URAAAA', 'RMFAAA', 'HHHHxx'),
+(8811, 3710, 1, 3, 1, 11, 11, 811, 811, 3811, 8811, 22, 23, 'XAAAAA', 'SMFAAA', 'OOOOxx'),
+(4529, 3711, 1, 1, 9, 9, 29, 529, 529, 4529, 4529, 58, 59, 'FSAAAA', 'TMFAAA', 'VVVVxx'),
+(161, 3712, 1, 1, 1, 1, 61, 161, 161, 161, 161, 122, 123, 'FGAAAA', 'UMFAAA', 'AAAAxx'),
+(641, 3713, 1, 1, 1, 1, 41, 641, 641, 641, 641, 82, 83, 'RYAAAA', 'VMFAAA', 'HHHHxx'),
+(4767, 3714, 1, 3, 7, 7, 67, 767, 767, 4767, 4767, 134, 135, 'JBAAAA', 'WMFAAA', 'OOOOxx'),
+(6293, 3715, 1, 1, 3, 13, 93, 293, 293, 1293, 6293, 186, 187, 'BIAAAA', 'XMFAAA', 'VVVVxx'),
+(3816, 3716, 0, 0, 6, 16, 16, 816, 1816, 3816, 3816, 32, 33, 'UQAAAA', 'YMFAAA', 'AAAAxx'),
+(4748, 3717, 0, 0, 8, 8, 48, 748, 748, 4748, 4748, 96, 97, 'QAAAAA', 'ZMFAAA', 'HHHHxx'),
+(9924, 3718, 0, 0, 4, 4, 24, 924, 1924, 4924, 9924, 48, 49, 'SRAAAA', 'ANFAAA', 'OOOOxx'),
+(6716, 3719, 0, 0, 6, 16, 16, 716, 716, 1716, 6716, 32, 33, 'IYAAAA', 'BNFAAA', 'VVVVxx'),
+(8828, 3720, 0, 0, 8, 8, 28, 828, 828, 3828, 8828, 56, 57, 'OBAAAA', 'CNFAAA', 'AAAAxx'),
+(4967, 3721, 1, 3, 7, 7, 67, 967, 967, 4967, 4967, 134, 135, 'BJAAAA', 'DNFAAA', 'HHHHxx'),
+(9680, 3722, 0, 0, 0, 0, 80, 680, 1680, 4680, 9680, 160, 161, 'IIAAAA', 'ENFAAA', 'OOOOxx'),
+(2784, 3723, 0, 0, 4, 4, 84, 784, 784, 2784, 2784, 168, 169, 'CDAAAA', 'FNFAAA', 'VVVVxx'),
+(2882, 3724, 0, 2, 2, 2, 82, 882, 882, 2882, 2882, 164, 165, 'WGAAAA', 'GNFAAA', 'AAAAxx'),
+(3641, 3725, 1, 1, 1, 1, 41, 641, 1641, 3641, 3641, 82, 83, 'BKAAAA', 'HNFAAA', 'HHHHxx'),
+(5537, 3726, 1, 1, 7, 17, 37, 537, 1537, 537, 5537, 74, 75, 'ZEAAAA', 'INFAAA', 'OOOOxx'),
+(820, 3727, 0, 0, 0, 0, 20, 820, 820, 820, 820, 40, 41, 'OFAAAA', 'JNFAAA', 'VVVVxx'),
+(5847, 3728, 1, 3, 7, 7, 47, 847, 1847, 847, 5847, 94, 95, 'XQAAAA', 'KNFAAA', 'AAAAxx'),
+(566, 3729, 0, 2, 6, 6, 66, 566, 566, 566, 566, 132, 133, 'UVAAAA', 'LNFAAA', 'HHHHxx'),
+(2246, 3730, 0, 2, 6, 6, 46, 246, 246, 2246, 2246, 92, 93, 'KIAAAA', 'MNFAAA', 'OOOOxx'),
+(6680, 3731, 0, 0, 0, 0, 80, 680, 680, 1680, 6680, 160, 161, 'YWAAAA', 'NNFAAA', 'VVVVxx'),
+(2014, 3732, 0, 2, 4, 14, 14, 14, 14, 2014, 2014, 28, 29, 'MZAAAA', 'ONFAAA', 'AAAAxx'),
+(8355, 3733, 1, 3, 5, 15, 55, 355, 355, 3355, 8355, 110, 111, 'JJAAAA', 'PNFAAA', 'HHHHxx'),
+(1610, 3734, 0, 2, 0, 10, 10, 610, 1610, 1610, 1610, 20, 21, 'YJAAAA', 'QNFAAA', 'OOOOxx'),
+(9719, 3735, 1, 3, 9, 19, 19, 719, 1719, 4719, 9719, 38, 39, 'VJAAAA', 'RNFAAA', 'VVVVxx'),
+(8498, 3736, 0, 2, 8, 18, 98, 498, 498, 3498, 8498, 196, 197, 'WOAAAA', 'SNFAAA', 'AAAAxx'),
+(5883, 3737, 1, 3, 3, 3, 83, 883, 1883, 883, 5883, 166, 167, 'HSAAAA', 'TNFAAA', 'HHHHxx'),
+(7380, 3738, 0, 0, 0, 0, 80, 380, 1380, 2380, 7380, 160, 161, 'WXAAAA', 'UNFAAA', 'OOOOxx'),
+(8865, 3739, 1, 1, 5, 5, 65, 865, 865, 3865, 8865, 130, 131, 'ZCAAAA', 'VNFAAA', 'VVVVxx'),
+(4743, 3740, 1, 3, 3, 3, 43, 743, 743, 4743, 4743, 86, 87, 'LAAAAA', 'WNFAAA', 'AAAAxx'),
+(5086, 3741, 0, 2, 6, 6, 86, 86, 1086, 86, 5086, 172, 173, 'QNAAAA', 'XNFAAA', 'HHHHxx'),
+(2739, 3742, 1, 3, 9, 19, 39, 739, 739, 2739, 2739, 78, 79, 'JBAAAA', 'YNFAAA', 'OOOOxx'),
+(9375, 3743, 1, 3, 5, 15, 75, 375, 1375, 4375, 9375, 150, 151, 'PWAAAA', 'ZNFAAA', 'VVVVxx'),
+(7876, 3744, 0, 0, 6, 16, 76, 876, 1876, 2876, 7876, 152, 153, 'YQAAAA', 'AOFAAA', 'AAAAxx'),
+(453, 3745, 1, 1, 3, 13, 53, 453, 453, 453, 453, 106, 107, 'LRAAAA', 'BOFAAA', 'HHHHxx'),
+(6987, 3746, 1, 3, 7, 7, 87, 987, 987, 1987, 6987, 174, 175, 'TIAAAA', 'COFAAA', 'OOOOxx'),
+(2860, 3747, 0, 0, 0, 0, 60, 860, 860, 2860, 2860, 120, 121, 'AGAAAA', 'DOFAAA', 'VVVVxx'),
+(8372, 3748, 0, 0, 2, 12, 72, 372, 372, 3372, 8372, 144, 145, 'AKAAAA', 'EOFAAA', 'AAAAxx'),
+(2048, 3749, 0, 0, 8, 8, 48, 48, 48, 2048, 2048, 96, 97, 'UAAAAA', 'FOFAAA', 'HHHHxx'),
+(9231, 3750, 1, 3, 1, 11, 31, 231, 1231, 4231, 9231, 62, 63, 'BRAAAA', 'GOFAAA', 'OOOOxx'),
+(634, 3751, 0, 2, 4, 14, 34, 634, 634, 634, 634, 68, 69, 'KYAAAA', 'HOFAAA', 'VVVVxx'),
+(3998, 3752, 0, 2, 8, 18, 98, 998, 1998, 3998, 3998, 196, 197, 'UXAAAA', 'IOFAAA', 'AAAAxx'),
+(4728, 3753, 0, 0, 8, 8, 28, 728, 728, 4728, 4728, 56, 57, 'WZAAAA', 'JOFAAA', 'HHHHxx'),
+(579, 3754, 1, 3, 9, 19, 79, 579, 579, 579, 579, 158, 159, 'HWAAAA', 'KOFAAA', 'OOOOxx'),
+(815, 3755, 1, 3, 5, 15, 15, 815, 815, 815, 815, 30, 31, 'JFAAAA', 'LOFAAA', 'VVVVxx'),
+(1009, 3756, 1, 1, 9, 9, 9, 9, 1009, 1009, 1009, 18, 19, 'VMAAAA', 'MOFAAA', 'AAAAxx'),
+(6596, 3757, 0, 0, 6, 16, 96, 596, 596, 1596, 6596, 192, 193, 'STAAAA', 'NOFAAA', 'HHHHxx'),
+(2793, 3758, 1, 1, 3, 13, 93, 793, 793, 2793, 2793, 186, 187, 'LDAAAA', 'OOFAAA', 'OOOOxx'),
+(9589, 3759, 1, 1, 9, 9, 89, 589, 1589, 4589, 9589, 178, 179, 'VEAAAA', 'POFAAA', 'VVVVxx'),
+(2794, 3760, 0, 2, 4, 14, 94, 794, 794, 2794, 2794, 188, 189, 'MDAAAA', 'QOFAAA', 'AAAAxx'),
+(2551, 3761, 1, 3, 1, 11, 51, 551, 551, 2551, 2551, 102, 103, 'DUAAAA', 'ROFAAA', 'HHHHxx'),
+(1588, 3762, 0, 0, 8, 8, 88, 588, 1588, 1588, 1588, 176, 177, 'CJAAAA', 'SOFAAA', 'OOOOxx'),
+(4443, 3763, 1, 3, 3, 3, 43, 443, 443, 4443, 4443, 86, 87, 'XOAAAA', 'TOFAAA', 'VVVVxx'),
+(5009, 3764, 1, 1, 9, 9, 9, 9, 1009, 9, 5009, 18, 19, 'RKAAAA', 'UOFAAA', 'AAAAxx'),
+(4287, 3765, 1, 3, 7, 7, 87, 287, 287, 4287, 4287, 174, 175, 'XIAAAA', 'VOFAAA', 'HHHHxx'),
+(2167, 3766, 1, 3, 7, 7, 67, 167, 167, 2167, 2167, 134, 135, 'JFAAAA', 'WOFAAA', 'OOOOxx'),
+(2290, 3767, 0, 2, 0, 10, 90, 290, 290, 2290, 2290, 180, 181, 'CKAAAA', 'XOFAAA', 'VVVVxx'),
+(7225, 3768, 1, 1, 5, 5, 25, 225, 1225, 2225, 7225, 50, 51, 'XRAAAA', 'YOFAAA', 'AAAAxx'),
+(8992, 3769, 0, 0, 2, 12, 92, 992, 992, 3992, 8992, 184, 185, 'WHAAAA', 'ZOFAAA', 'HHHHxx'),
+(1540, 3770, 0, 0, 0, 0, 40, 540, 1540, 1540, 1540, 80, 81, 'GHAAAA', 'APFAAA', 'OOOOxx'),
+(2029, 3771, 1, 1, 9, 9, 29, 29, 29, 2029, 2029, 58, 59, 'BAAAAA', 'BPFAAA', 'VVVVxx'),
+(2855, 3772, 1, 3, 5, 15, 55, 855, 855, 2855, 2855, 110, 111, 'VFAAAA', 'CPFAAA', 'AAAAxx'),
+(3534, 3773, 0, 2, 4, 14, 34, 534, 1534, 3534, 3534, 68, 69, 'YFAAAA', 'DPFAAA', 'HHHHxx'),
+(8078, 3774, 0, 2, 8, 18, 78, 78, 78, 3078, 8078, 156, 157, 'SYAAAA', 'EPFAAA', 'OOOOxx'),
+(9778, 3775, 0, 2, 8, 18, 78, 778, 1778, 4778, 9778, 156, 157, 'CMAAAA', 'FPFAAA', 'VVVVxx'),
+(3543, 3776, 1, 3, 3, 3, 43, 543, 1543, 3543, 3543, 86, 87, 'HGAAAA', 'GPFAAA', 'AAAAxx'),
+(4778, 3777, 0, 2, 8, 18, 78, 778, 778, 4778, 4778, 156, 157, 'UBAAAA', 'HPFAAA', 'HHHHxx'),
+(8931, 3778, 1, 3, 1, 11, 31, 931, 931, 3931, 8931, 62, 63, 'NFAAAA', 'IPFAAA', 'OOOOxx'),
+(557, 3779, 1, 1, 7, 17, 57, 557, 557, 557, 557, 114, 115, 'LVAAAA', 'JPFAAA', 'VVVVxx'),
+(5546, 3780, 0, 2, 6, 6, 46, 546, 1546, 546, 5546, 92, 93, 'IFAAAA', 'KPFAAA', 'AAAAxx'),
+(7527, 3781, 1, 3, 7, 7, 27, 527, 1527, 2527, 7527, 54, 55, 'NDAAAA', 'LPFAAA', 'HHHHxx'),
+(5000, 3782, 0, 0, 0, 0, 0, 0, 1000, 0, 5000, 0, 1, 'IKAAAA', 'MPFAAA', 'OOOOxx'),
+(7587, 3783, 1, 3, 7, 7, 87, 587, 1587, 2587, 7587, 174, 175, 'VFAAAA', 'NPFAAA', 'VVVVxx'),
+(3014, 3784, 0, 2, 4, 14, 14, 14, 1014, 3014, 3014, 28, 29, 'YLAAAA', 'OPFAAA', 'AAAAxx'),
+(5276, 3785, 0, 0, 6, 16, 76, 276, 1276, 276, 5276, 152, 153, 'YUAAAA', 'PPFAAA', 'HHHHxx'),
+(6457, 3786, 1, 1, 7, 17, 57, 457, 457, 1457, 6457, 114, 115, 'JOAAAA', 'QPFAAA', 'OOOOxx'),
+(389, 3787, 1, 1, 9, 9, 89, 389, 389, 389, 389, 178, 179, 'ZOAAAA', 'RPFAAA', 'VVVVxx'),
+(7104, 3788, 0, 0, 4, 4, 4, 104, 1104, 2104, 7104, 8, 9, 'GNAAAA', 'SPFAAA', 'AAAAxx'),
+(9995, 3789, 1, 3, 5, 15, 95, 995, 1995, 4995, 9995, 190, 191, 'LUAAAA', 'TPFAAA', 'HHHHxx'),
+(7368, 3790, 0, 0, 8, 8, 68, 368, 1368, 2368, 7368, 136, 137, 'KXAAAA', 'UPFAAA', 'OOOOxx'),
+(3258, 3791, 0, 2, 8, 18, 58, 258, 1258, 3258, 3258, 116, 117, 'IVAAAA', 'VPFAAA', 'VVVVxx'),
+(9208, 3792, 0, 0, 8, 8, 8, 208, 1208, 4208, 9208, 16, 17, 'EQAAAA', 'WPFAAA', 'AAAAxx'),
+(2396, 3793, 0, 0, 6, 16, 96, 396, 396, 2396, 2396, 192, 193, 'EOAAAA', 'XPFAAA', 'HHHHxx'),
+(1715, 3794, 1, 3, 5, 15, 15, 715, 1715, 1715, 1715, 30, 31, 'ZNAAAA', 'YPFAAA', 'OOOOxx'),
+(1240, 3795, 0, 0, 0, 0, 40, 240, 1240, 1240, 1240, 80, 81, 'SVAAAA', 'ZPFAAA', 'VVVVxx'),
+(1952, 3796, 0, 0, 2, 12, 52, 952, 1952, 1952, 1952, 104, 105, 'CXAAAA', 'AQFAAA', 'AAAAxx'),
+(4403, 3797, 1, 3, 3, 3, 3, 403, 403, 4403, 4403, 6, 7, 'JNAAAA', 'BQFAAA', 'HHHHxx'),
+(6333, 3798, 1, 1, 3, 13, 33, 333, 333, 1333, 6333, 66, 67, 'PJAAAA', 'CQFAAA', 'OOOOxx'),
+(2492, 3799, 0, 0, 2, 12, 92, 492, 492, 2492, 2492, 184, 185, 'WRAAAA', 'DQFAAA', 'VVVVxx'),
+(6543, 3800, 1, 3, 3, 3, 43, 543, 543, 1543, 6543, 86, 87, 'RRAAAA', 'EQFAAA', 'AAAAxx'),
+(5548, 3801, 0, 0, 8, 8, 48, 548, 1548, 548, 5548, 96, 97, 'KFAAAA', 'FQFAAA', 'HHHHxx'),
+(3458, 3802, 0, 2, 8, 18, 58, 458, 1458, 3458, 3458, 116, 117, 'ADAAAA', 'GQFAAA', 'OOOOxx'),
+(2588, 3803, 0, 0, 8, 8, 88, 588, 588, 2588, 2588, 176, 177, 'OVAAAA', 'HQFAAA', 'VVVVxx'),
+(1364, 3804, 0, 0, 4, 4, 64, 364, 1364, 1364, 1364, 128, 129, 'MAAAAA', 'IQFAAA', 'AAAAxx'),
+(9856, 3805, 0, 0, 6, 16, 56, 856, 1856, 4856, 9856, 112, 113, 'CPAAAA', 'JQFAAA', 'HHHHxx'),
+(4964, 3806, 0, 0, 4, 4, 64, 964, 964, 4964, 4964, 128, 129, 'YIAAAA', 'KQFAAA', 'OOOOxx'),
+(773, 3807, 1, 1, 3, 13, 73, 773, 773, 773, 773, 146, 147, 'TDAAAA', 'LQFAAA', 'VVVVxx'),
+(6402, 3808, 0, 2, 2, 2, 2, 402, 402, 1402, 6402, 4, 5, 'GMAAAA', 'MQFAAA', 'AAAAxx'),
+(7213, 3809, 1, 1, 3, 13, 13, 213, 1213, 2213, 7213, 26, 27, 'LRAAAA', 'NQFAAA', 'HHHHxx'),
+(3385, 3810, 1, 1, 5, 5, 85, 385, 1385, 3385, 3385, 170, 171, 'FAAAAA', 'OQFAAA', 'OOOOxx'),
+(6005, 3811, 1, 1, 5, 5, 5, 5, 5, 1005, 6005, 10, 11, 'ZWAAAA', 'PQFAAA', 'VVVVxx'),
+(9346, 3812, 0, 2, 6, 6, 46, 346, 1346, 4346, 9346, 92, 93, 'MVAAAA', 'QQFAAA', 'AAAAxx'),
+(1831, 3813, 1, 3, 1, 11, 31, 831, 1831, 1831, 1831, 62, 63, 'LSAAAA', 'RQFAAA', 'HHHHxx'),
+(5406, 3814, 0, 2, 6, 6, 6, 406, 1406, 406, 5406, 12, 13, 'YZAAAA', 'SQFAAA', 'OOOOxx'),
+(2154, 3815, 0, 2, 4, 14, 54, 154, 154, 2154, 2154, 108, 109, 'WEAAAA', 'TQFAAA', 'VVVVxx'),
+(3721, 3816, 1, 1, 1, 1, 21, 721, 1721, 3721, 3721, 42, 43, 'DNAAAA', 'UQFAAA', 'AAAAxx'),
+(2889, 3817, 1, 1, 9, 9, 89, 889, 889, 2889, 2889, 178, 179, 'DHAAAA', 'VQFAAA', 'HHHHxx'),
+(4410, 3818, 0, 2, 0, 10, 10, 410, 410, 4410, 4410, 20, 21, 'QNAAAA', 'WQFAAA', 'OOOOxx'),
+(7102, 3819, 0, 2, 2, 2, 2, 102, 1102, 2102, 7102, 4, 5, 'ENAAAA', 'XQFAAA', 'VVVVxx'),
+(4057, 3820, 1, 1, 7, 17, 57, 57, 57, 4057, 4057, 114, 115, 'BAAAAA', 'YQFAAA', 'AAAAxx'),
+(9780, 3821, 0, 0, 0, 0, 80, 780, 1780, 4780, 9780, 160, 161, 'EMAAAA', 'ZQFAAA', 'HHHHxx'),
+(9481, 3822, 1, 1, 1, 1, 81, 481, 1481, 4481, 9481, 162, 163, 'RAAAAA', 'ARFAAA', 'OOOOxx'),
+(2366, 3823, 0, 2, 6, 6, 66, 366, 366, 2366, 2366, 132, 133, 'ANAAAA', 'BRFAAA', 'VVVVxx'),
+(2708, 3824, 0, 0, 8, 8, 8, 708, 708, 2708, 2708, 16, 17, 'EAAAAA', 'CRFAAA', 'AAAAxx'),
+(7399, 3825, 1, 3, 9, 19, 99, 399, 1399, 2399, 7399, 198, 199, 'PYAAAA', 'DRFAAA', 'HHHHxx'),
+(5234, 3826, 0, 2, 4, 14, 34, 234, 1234, 234, 5234, 68, 69, 'ITAAAA', 'ERFAAA', 'OOOOxx'),
+(1843, 3827, 1, 3, 3, 3, 43, 843, 1843, 1843, 1843, 86, 87, 'XSAAAA', 'FRFAAA', 'VVVVxx'),
+(1006, 3828, 0, 2, 6, 6, 6, 6, 1006, 1006, 1006, 12, 13, 'SMAAAA', 'GRFAAA', 'AAAAxx'),
+(7696, 3829, 0, 0, 6, 16, 96, 696, 1696, 2696, 7696, 192, 193, 'AKAAAA', 'HRFAAA', 'HHHHxx'),
+(6411, 3830, 1, 3, 1, 11, 11, 411, 411, 1411, 6411, 22, 23, 'PMAAAA', 'IRFAAA', 'OOOOxx'),
+(3913, 3831, 1, 1, 3, 13, 13, 913, 1913, 3913, 3913, 26, 27, 'NUAAAA', 'JRFAAA', 'VVVVxx'),
+(2538, 3832, 0, 2, 8, 18, 38, 538, 538, 2538, 2538, 76, 77, 'QTAAAA', 'KRFAAA', 'AAAAxx'),
+(3019, 3833, 1, 3, 9, 19, 19, 19, 1019, 3019, 3019, 38, 39, 'DMAAAA', 'LRFAAA', 'HHHHxx'),
+(107, 3834, 1, 3, 7, 7, 7, 107, 107, 107, 107, 14, 15, 'DEAAAA', 'MRFAAA', 'OOOOxx'),
+(427, 3835, 1, 3, 7, 7, 27, 427, 427, 427, 427, 54, 55, 'LQAAAA', 'NRFAAA', 'VVVVxx'),
+(9849, 3836, 1, 1, 9, 9, 49, 849, 1849, 4849, 9849, 98, 99, 'VOAAAA', 'ORFAAA', 'AAAAxx'),
+(4195, 3837, 1, 3, 5, 15, 95, 195, 195, 4195, 4195, 190, 191, 'JFAAAA', 'PRFAAA', 'HHHHxx'),
+(9215, 3838, 1, 3, 5, 15, 15, 215, 1215, 4215, 9215, 30, 31, 'LQAAAA', 'QRFAAA', 'OOOOxx'),
+(3165, 3839, 1, 1, 5, 5, 65, 165, 1165, 3165, 3165, 130, 131, 'TRAAAA', 'RRFAAA', 'VVVVxx'),
+(3280, 3840, 0, 0, 0, 0, 80, 280, 1280, 3280, 3280, 160, 161, 'EWAAAA', 'SRFAAA', 'AAAAxx'),
+(4477, 3841, 1, 1, 7, 17, 77, 477, 477, 4477, 4477, 154, 155, 'FQAAAA', 'TRFAAA', 'HHHHxx'),
+(5885, 3842, 1, 1, 5, 5, 85, 885, 1885, 885, 5885, 170, 171, 'JSAAAA', 'URFAAA', 'OOOOxx'),
+(3311, 3843, 1, 3, 1, 11, 11, 311, 1311, 3311, 3311, 22, 23, 'JXAAAA', 'VRFAAA', 'VVVVxx'),
+(6453, 3844, 1, 1, 3, 13, 53, 453, 453, 1453, 6453, 106, 107, 'FOAAAA', 'WRFAAA', 'AAAAxx'),
+(8527, 3845, 1, 3, 7, 7, 27, 527, 527, 3527, 8527, 54, 55, 'ZPAAAA', 'XRFAAA', 'HHHHxx'),
+(1921, 3846, 1, 1, 1, 1, 21, 921, 1921, 1921, 1921, 42, 43, 'XVAAAA', 'YRFAAA', 'OOOOxx'),
+(2427, 3847, 1, 3, 7, 7, 27, 427, 427, 2427, 2427, 54, 55, 'JPAAAA', 'ZRFAAA', 'VVVVxx'),
+(3691, 3848, 1, 3, 1, 11, 91, 691, 1691, 3691, 3691, 182, 183, 'ZLAAAA', 'ASFAAA', 'AAAAxx'),
+(3882, 3849, 0, 2, 2, 2, 82, 882, 1882, 3882, 3882, 164, 165, 'ITAAAA', 'BSFAAA', 'HHHHxx'),
+(562, 3850, 0, 2, 2, 2, 62, 562, 562, 562, 562, 124, 125, 'QVAAAA', 'CSFAAA', 'OOOOxx'),
+(377, 3851, 1, 1, 7, 17, 77, 377, 377, 377, 377, 154, 155, 'NOAAAA', 'DSFAAA', 'VVVVxx'),
+(1497, 3852, 1, 1, 7, 17, 97, 497, 1497, 1497, 1497, 194, 195, 'PFAAAA', 'ESFAAA', 'AAAAxx'),
+(4453, 3853, 1, 1, 3, 13, 53, 453, 453, 4453, 4453, 106, 107, 'HPAAAA', 'FSFAAA', 'HHHHxx'),
+(4678, 3854, 0, 2, 8, 18, 78, 678, 678, 4678, 4678, 156, 157, 'YXAAAA', 'GSFAAA', 'OOOOxx'),
+(2234, 3855, 0, 2, 4, 14, 34, 234, 234, 2234, 2234, 68, 69, 'YHAAAA', 'HSFAAA', 'VVVVxx'),
+(1073, 3856, 1, 1, 3, 13, 73, 73, 1073, 1073, 1073, 146, 147, 'HPAAAA', 'ISFAAA', 'AAAAxx'),
+(6479, 3857, 1, 3, 9, 19, 79, 479, 479, 1479, 6479, 158, 159, 'FPAAAA', 'JSFAAA', 'HHHHxx'),
+(5665, 3858, 1, 1, 5, 5, 65, 665, 1665, 665, 5665, 130, 131, 'XJAAAA', 'KSFAAA', 'OOOOxx'),
+(586, 3859, 0, 2, 6, 6, 86, 586, 586, 586, 586, 172, 173, 'OWAAAA', 'LSFAAA', 'VVVVxx'),
+(1584, 3860, 0, 0, 4, 4, 84, 584, 1584, 1584, 1584, 168, 169, 'YIAAAA', 'MSFAAA', 'AAAAxx'),
+(2574, 3861, 0, 2, 4, 14, 74, 574, 574, 2574, 2574, 148, 149, 'AVAAAA', 'NSFAAA', 'HHHHxx'),
+(9833, 3862, 1, 1, 3, 13, 33, 833, 1833, 4833, 9833, 66, 67, 'FOAAAA', 'OSFAAA', 'OOOOxx'),
+(6726, 3863, 0, 2, 6, 6, 26, 726, 726, 1726, 6726, 52, 53, 'SYAAAA', 'PSFAAA', 'VVVVxx'),
+(8497, 3864, 1, 1, 7, 17, 97, 497, 497, 3497, 8497, 194, 195, 'VOAAAA', 'QSFAAA', 'AAAAxx'),
+(2914, 3865, 0, 2, 4, 14, 14, 914, 914, 2914, 2914, 28, 29, 'CIAAAA', 'RSFAAA', 'HHHHxx'),
+(8586, 3866, 0, 2, 6, 6, 86, 586, 586, 3586, 8586, 172, 173, 'GSAAAA', 'SSFAAA', 'OOOOxx'),
+(6973, 3867, 1, 1, 3, 13, 73, 973, 973, 1973, 6973, 146, 147, 'FIAAAA', 'TSFAAA', 'VVVVxx'),
+(1322, 3868, 0, 2, 2, 2, 22, 322, 1322, 1322, 1322, 44, 45, 'WYAAAA', 'USFAAA', 'AAAAxx'),
+(5242, 3869, 0, 2, 2, 2, 42, 242, 1242, 242, 5242, 84, 85, 'QTAAAA', 'VSFAAA', 'HHHHxx'),
+(5581, 3870, 1, 1, 1, 1, 81, 581, 1581, 581, 5581, 162, 163, 'RGAAAA', 'WSFAAA', 'OOOOxx'),
+(1365, 3871, 1, 1, 5, 5, 65, 365, 1365, 1365, 1365, 130, 131, 'NAAAAA', 'XSFAAA', 'VVVVxx'),
+(2818, 3872, 0, 2, 8, 18, 18, 818, 818, 2818, 2818, 36, 37, 'KEAAAA', 'YSFAAA', 'AAAAxx'),
+(3758, 3873, 0, 2, 8, 18, 58, 758, 1758, 3758, 3758, 116, 117, 'OOAAAA', 'ZSFAAA', 'HHHHxx'),
+(2665, 3874, 1, 1, 5, 5, 65, 665, 665, 2665, 2665, 130, 131, 'NYAAAA', 'ATFAAA', 'OOOOxx'),
+(9823, 3875, 1, 3, 3, 3, 23, 823, 1823, 4823, 9823, 46, 47, 'VNAAAA', 'BTFAAA', 'VVVVxx'),
+(7057, 3876, 1, 1, 7, 17, 57, 57, 1057, 2057, 7057, 114, 115, 'LLAAAA', 'CTFAAA', 'AAAAxx'),
+(543, 3877, 1, 3, 3, 3, 43, 543, 543, 543, 543, 86, 87, 'XUAAAA', 'DTFAAA', 'HHHHxx'),
+(4008, 3878, 0, 0, 8, 8, 8, 8, 8, 4008, 4008, 16, 17, 'EYAAAA', 'ETFAAA', 'OOOOxx'),
+(4397, 3879, 1, 1, 7, 17, 97, 397, 397, 4397, 4397, 194, 195, 'DNAAAA', 'FTFAAA', 'VVVVxx'),
+(8533, 3880, 1, 1, 3, 13, 33, 533, 533, 3533, 8533, 66, 67, 'FQAAAA', 'GTFAAA', 'AAAAxx'),
+(9728, 3881, 0, 0, 8, 8, 28, 728, 1728, 4728, 9728, 56, 57, 'EKAAAA', 'HTFAAA', 'HHHHxx'),
+(5198, 3882, 0, 2, 8, 18, 98, 198, 1198, 198, 5198, 196, 197, 'YRAAAA', 'ITFAAA', 'OOOOxx'),
+(5036, 3883, 0, 0, 6, 16, 36, 36, 1036, 36, 5036, 72, 73, 'SLAAAA', 'JTFAAA', 'VVVVxx'),
+(4394, 3884, 0, 2, 4, 14, 94, 394, 394, 4394, 4394, 188, 189, 'ANAAAA', 'KTFAAA', 'AAAAxx'),
+(9633, 3885, 1, 1, 3, 13, 33, 633, 1633, 4633, 9633, 66, 67, 'NGAAAA', 'LTFAAA', 'HHHHxx'),
+(3339, 3886, 1, 3, 9, 19, 39, 339, 1339, 3339, 3339, 78, 79, 'LYAAAA', 'MTFAAA', 'OOOOxx'),
+(9529, 3887, 1, 1, 9, 9, 29, 529, 1529, 4529, 9529, 58, 59, 'NCAAAA', 'NTFAAA', 'VVVVxx'),
+(4780, 3888, 0, 0, 0, 0, 80, 780, 780, 4780, 4780, 160, 161, 'WBAAAA', 'OTFAAA', 'AAAAxx'),
+(4862, 3889, 0, 2, 2, 2, 62, 862, 862, 4862, 4862, 124, 125, 'AFAAAA', 'PTFAAA', 'HHHHxx'),
+(8152, 3890, 0, 0, 2, 12, 52, 152, 152, 3152, 8152, 104, 105, 'OBAAAA', 'QTFAAA', 'OOOOxx'),
+(9330, 3891, 0, 2, 0, 10, 30, 330, 1330, 4330, 9330, 60, 61, 'WUAAAA', 'RTFAAA', 'VVVVxx'),
+(4362, 3892, 0, 2, 2, 2, 62, 362, 362, 4362, 4362, 124, 125, 'ULAAAA', 'STFAAA', 'AAAAxx'),
+(4688, 3893, 0, 0, 8, 8, 88, 688, 688, 4688, 4688, 176, 177, 'IYAAAA', 'TTFAAA', 'HHHHxx'),
+(1903, 3894, 1, 3, 3, 3, 3, 903, 1903, 1903, 1903, 6, 7, 'FVAAAA', 'UTFAAA', 'OOOOxx'),
+(9027, 3895, 1, 3, 7, 7, 27, 27, 1027, 4027, 9027, 54, 55, 'FJAAAA', 'VTFAAA', 'VVVVxx'),
+(5385, 3896, 1, 1, 5, 5, 85, 385, 1385, 385, 5385, 170, 171, 'DZAAAA', 'WTFAAA', 'AAAAxx'),
+(9854, 3897, 0, 2, 4, 14, 54, 854, 1854, 4854, 9854, 108, 109, 'APAAAA', 'XTFAAA', 'HHHHxx'),
+(9033, 3898, 1, 1, 3, 13, 33, 33, 1033, 4033, 9033, 66, 67, 'LJAAAA', 'YTFAAA', 'OOOOxx'),
+(3185, 3899, 1, 1, 5, 5, 85, 185, 1185, 3185, 3185, 170, 171, 'NSAAAA', 'ZTFAAA', 'VVVVxx'),
+(2618, 3900, 0, 2, 8, 18, 18, 618, 618, 2618, 2618, 36, 37, 'SWAAAA', 'AUFAAA', 'AAAAxx'),
+(371, 3901, 1, 3, 1, 11, 71, 371, 371, 371, 371, 142, 143, 'HOAAAA', 'BUFAAA', 'HHHHxx'),
+(3697, 3902, 1, 1, 7, 17, 97, 697, 1697, 3697, 3697, 194, 195, 'FMAAAA', 'CUFAAA', 'OOOOxx'),
+(1682, 3903, 0, 2, 2, 2, 82, 682, 1682, 1682, 1682, 164, 165, 'SMAAAA', 'DUFAAA', 'VVVVxx'),
+(3333, 3904, 1, 1, 3, 13, 33, 333, 1333, 3333, 3333, 66, 67, 'FYAAAA', 'EUFAAA', 'AAAAxx'),
+(1722, 3905, 0, 2, 2, 2, 22, 722, 1722, 1722, 1722, 44, 45, 'GOAAAA', 'FUFAAA', 'HHHHxx'),
+(2009, 3906, 1, 1, 9, 9, 9, 9, 9, 2009, 2009, 18, 19, 'HZAAAA', 'GUFAAA', 'OOOOxx'),
+(3517, 3907, 1, 1, 7, 17, 17, 517, 1517, 3517, 3517, 34, 35, 'HFAAAA', 'HUFAAA', 'VVVVxx'),
+(7640, 3908, 0, 0, 0, 0, 40, 640, 1640, 2640, 7640, 80, 81, 'WHAAAA', 'IUFAAA', 'AAAAxx'),
+(259, 3909, 1, 3, 9, 19, 59, 259, 259, 259, 259, 118, 119, 'ZJAAAA', 'JUFAAA', 'HHHHxx'),
+(1400, 3910, 0, 0, 0, 0, 0, 400, 1400, 1400, 1400, 0, 1, 'WBAAAA', 'KUFAAA', 'OOOOxx'),
+(6663, 3911, 1, 3, 3, 3, 63, 663, 663, 1663, 6663, 126, 127, 'HWAAAA', 'LUFAAA', 'VVVVxx'),
+(1576, 3912, 0, 0, 6, 16, 76, 576, 1576, 1576, 1576, 152, 153, 'QIAAAA', 'MUFAAA', 'AAAAxx'),
+(8843, 3913, 1, 3, 3, 3, 43, 843, 843, 3843, 8843, 86, 87, 'DCAAAA', 'NUFAAA', 'HHHHxx'),
+(9474, 3914, 0, 2, 4, 14, 74, 474, 1474, 4474, 9474, 148, 149, 'KAAAAA', 'OUFAAA', 'OOOOxx'),
+(1597, 3915, 1, 1, 7, 17, 97, 597, 1597, 1597, 1597, 194, 195, 'LJAAAA', 'PUFAAA', 'VVVVxx'),
+(1143, 3916, 1, 3, 3, 3, 43, 143, 1143, 1143, 1143, 86, 87, 'ZRAAAA', 'QUFAAA', 'AAAAxx'),
+(4162, 3917, 0, 2, 2, 2, 62, 162, 162, 4162, 4162, 124, 125, 'CEAAAA', 'RUFAAA', 'HHHHxx'),
+(1301, 3918, 1, 1, 1, 1, 1, 301, 1301, 1301, 1301, 2, 3, 'BYAAAA', 'SUFAAA', 'OOOOxx'),
+(2935, 3919, 1, 3, 5, 15, 35, 935, 935, 2935, 2935, 70, 71, 'XIAAAA', 'TUFAAA', 'VVVVxx'),
+(886, 3920, 0, 2, 6, 6, 86, 886, 886, 886, 886, 172, 173, 'CIAAAA', 'UUFAAA', 'AAAAxx'),
+(1661, 3921, 1, 1, 1, 1, 61, 661, 1661, 1661, 1661, 122, 123, 'XLAAAA', 'VUFAAA', 'HHHHxx'),
+(1026, 3922, 0, 2, 6, 6, 26, 26, 1026, 1026, 1026, 52, 53, 'MNAAAA', 'WUFAAA', 'OOOOxx'),
+(7034, 3923, 0, 2, 4, 14, 34, 34, 1034, 2034, 7034, 68, 69, 'OKAAAA', 'XUFAAA', 'VVVVxx'),
+(2305, 3924, 1, 1, 5, 5, 5, 305, 305, 2305, 2305, 10, 11, 'RKAAAA', 'YUFAAA', 'AAAAxx'),
+(1725, 3925, 1, 1, 5, 5, 25, 725, 1725, 1725, 1725, 50, 51, 'JOAAAA', 'ZUFAAA', 'HHHHxx'),
+(909, 3926, 1, 1, 9, 9, 9, 909, 909, 909, 909, 18, 19, 'ZIAAAA', 'AVFAAA', 'OOOOxx'),
+(9906, 3927, 0, 2, 6, 6, 6, 906, 1906, 4906, 9906, 12, 13, 'ARAAAA', 'BVFAAA', 'VVVVxx'),
+(3309, 3928, 1, 1, 9, 9, 9, 309, 1309, 3309, 3309, 18, 19, 'HXAAAA', 'CVFAAA', 'AAAAxx'),
+(515, 3929, 1, 3, 5, 15, 15, 515, 515, 515, 515, 30, 31, 'VTAAAA', 'DVFAAA', 'HHHHxx'),
+(932, 3930, 0, 0, 2, 12, 32, 932, 932, 932, 932, 64, 65, 'WJAAAA', 'EVFAAA', 'OOOOxx'),
+(8144, 3931, 0, 0, 4, 4, 44, 144, 144, 3144, 8144, 88, 89, 'GBAAAA', 'FVFAAA', 'VVVVxx'),
+(5592, 3932, 0, 0, 2, 12, 92, 592, 1592, 592, 5592, 184, 185, 'CHAAAA', 'GVFAAA', 'AAAAxx'),
+(4003, 3933, 1, 3, 3, 3, 3, 3, 3, 4003, 4003, 6, 7, 'ZXAAAA', 'HVFAAA', 'HHHHxx'),
+(9566, 3934, 0, 2, 6, 6, 66, 566, 1566, 4566, 9566, 132, 133, 'YDAAAA', 'IVFAAA', 'OOOOxx'),
+(4556, 3935, 0, 0, 6, 16, 56, 556, 556, 4556, 4556, 112, 113, 'GTAAAA', 'JVFAAA', 'VVVVxx'),
+(268, 3936, 0, 0, 8, 8, 68, 268, 268, 268, 268, 136, 137, 'IKAAAA', 'KVFAAA', 'AAAAxx'),
+(8107, 3937, 1, 3, 7, 7, 7, 107, 107, 3107, 8107, 14, 15, 'VZAAAA', 'LVFAAA', 'HHHHxx'),
+(5816, 3938, 0, 0, 6, 16, 16, 816, 1816, 816, 5816, 32, 33, 'SPAAAA', 'MVFAAA', 'OOOOxx'),
+(8597, 3939, 1, 1, 7, 17, 97, 597, 597, 3597, 8597, 194, 195, 'RSAAAA', 'NVFAAA', 'VVVVxx'),
+(9611, 3940, 1, 3, 1, 11, 11, 611, 1611, 4611, 9611, 22, 23, 'RFAAAA', 'OVFAAA', 'AAAAxx'),
+(8070, 3941, 0, 2, 0, 10, 70, 70, 70, 3070, 8070, 140, 141, 'KYAAAA', 'PVFAAA', 'HHHHxx'),
+(6040, 3942, 0, 0, 0, 0, 40, 40, 40, 1040, 6040, 80, 81, 'IYAAAA', 'QVFAAA', 'OOOOxx'),
+(3184, 3943, 0, 0, 4, 4, 84, 184, 1184, 3184, 3184, 168, 169, 'MSAAAA', 'RVFAAA', 'VVVVxx'),
+(9656, 3944, 0, 0, 6, 16, 56, 656, 1656, 4656, 9656, 112, 113, 'KHAAAA', 'SVFAAA', 'AAAAxx'),
+(1577, 3945, 1, 1, 7, 17, 77, 577, 1577, 1577, 1577, 154, 155, 'RIAAAA', 'TVFAAA', 'HHHHxx'),
+(1805, 3946, 1, 1, 5, 5, 5, 805, 1805, 1805, 1805, 10, 11, 'LRAAAA', 'UVFAAA', 'OOOOxx'),
+(8268, 3947, 0, 0, 8, 8, 68, 268, 268, 3268, 8268, 136, 137, 'AGAAAA', 'VVFAAA', 'VVVVxx'),
+(3489, 3948, 1, 1, 9, 9, 89, 489, 1489, 3489, 3489, 178, 179, 'FEAAAA', 'WVFAAA', 'AAAAxx'),
+(4564, 3949, 0, 0, 4, 4, 64, 564, 564, 4564, 4564, 128, 129, 'OTAAAA', 'XVFAAA', 'HHHHxx'),
+(4006, 3950, 0, 2, 6, 6, 6, 6, 6, 4006, 4006, 12, 13, 'CYAAAA', 'YVFAAA', 'OOOOxx'),
+(8466, 3951, 0, 2, 6, 6, 66, 466, 466, 3466, 8466, 132, 133, 'QNAAAA', 'ZVFAAA', 'VVVVxx'),
+(938, 3952, 0, 2, 8, 18, 38, 938, 938, 938, 938, 76, 77, 'CKAAAA', 'AWFAAA', 'AAAAxx'),
+(5944, 3953, 0, 0, 4, 4, 44, 944, 1944, 944, 5944, 88, 89, 'QUAAAA', 'BWFAAA', 'HHHHxx'),
+(8363, 3954, 1, 3, 3, 3, 63, 363, 363, 3363, 8363, 126, 127, 'RJAAAA', 'CWFAAA', 'OOOOxx'),
+(5348, 3955, 0, 0, 8, 8, 48, 348, 1348, 348, 5348, 96, 97, 'SXAAAA', 'DWFAAA', 'VVVVxx'),
+(71, 3956, 1, 3, 1, 11, 71, 71, 71, 71, 71, 142, 143, 'TCAAAA', 'EWFAAA', 'AAAAxx'),
+(3620, 3957, 0, 0, 0, 0, 20, 620, 1620, 3620, 3620, 40, 41, 'GJAAAA', 'FWFAAA', 'HHHHxx'),
+(3230, 3958, 0, 2, 0, 10, 30, 230, 1230, 3230, 3230, 60, 61, 'GUAAAA', 'GWFAAA', 'OOOOxx'),
+(6132, 3959, 0, 0, 2, 12, 32, 132, 132, 1132, 6132, 64, 65, 'WBAAAA', 'HWFAAA', 'VVVVxx'),
+(6143, 3960, 1, 3, 3, 3, 43, 143, 143, 1143, 6143, 86, 87, 'HCAAAA', 'IWFAAA', 'AAAAxx'),
+(8781, 3961, 1, 1, 1, 1, 81, 781, 781, 3781, 8781, 162, 163, 'TZAAAA', 'JWFAAA', 'HHHHxx'),
+(5522, 3962, 0, 2, 2, 2, 22, 522, 1522, 522, 5522, 44, 45, 'KEAAAA', 'KWFAAA', 'OOOOxx'),
+(6320, 3963, 0, 0, 0, 0, 20, 320, 320, 1320, 6320, 40, 41, 'CJAAAA', 'LWFAAA', 'VVVVxx'),
+(3923, 3964, 1, 3, 3, 3, 23, 923, 1923, 3923, 3923, 46, 47, 'XUAAAA', 'MWFAAA', 'AAAAxx'),
+(2207, 3965, 1, 3, 7, 7, 7, 207, 207, 2207, 2207, 14, 15, 'XGAAAA', 'NWFAAA', 'HHHHxx'),
+(966, 3966, 0, 2, 6, 6, 66, 966, 966, 966, 966, 132, 133, 'ELAAAA', 'OWFAAA', 'OOOOxx'),
+(9020, 3967, 0, 0, 0, 0, 20, 20, 1020, 4020, 9020, 40, 41, 'YIAAAA', 'PWFAAA', 'VVVVxx'),
+(4616, 3968, 0, 0, 6, 16, 16, 616, 616, 4616, 4616, 32, 33, 'OVAAAA', 'QWFAAA', 'AAAAxx'),
+(8289, 3969, 1, 1, 9, 9, 89, 289, 289, 3289, 8289, 178, 179, 'VGAAAA', 'RWFAAA', 'HHHHxx'),
+(5796, 3970, 0, 0, 6, 16, 96, 796, 1796, 796, 5796, 192, 193, 'YOAAAA', 'SWFAAA', 'OOOOxx'),
+(9259, 3971, 1, 3, 9, 19, 59, 259, 1259, 4259, 9259, 118, 119, 'DSAAAA', 'TWFAAA', 'VVVVxx'),
+(3710, 3972, 0, 2, 0, 10, 10, 710, 1710, 3710, 3710, 20, 21, 'SMAAAA', 'UWFAAA', 'AAAAxx'),
+(251, 3973, 1, 3, 1, 11, 51, 251, 251, 251, 251, 102, 103, 'RJAAAA', 'VWFAAA', 'HHHHxx'),
+(7669, 3974, 1, 1, 9, 9, 69, 669, 1669, 2669, 7669, 138, 139, 'ZIAAAA', 'WWFAAA', 'OOOOxx'),
+(6304, 3975, 0, 0, 4, 4, 4, 304, 304, 1304, 6304, 8, 9, 'MIAAAA', 'XWFAAA', 'VVVVxx'),
+(6454, 3976, 0, 2, 4, 14, 54, 454, 454, 1454, 6454, 108, 109, 'GOAAAA', 'YWFAAA', 'AAAAxx'),
+(1489, 3977, 1, 1, 9, 9, 89, 489, 1489, 1489, 1489, 178, 179, 'HFAAAA', 'ZWFAAA', 'HHHHxx'),
+(715, 3978, 1, 3, 5, 15, 15, 715, 715, 715, 715, 30, 31, 'NBAAAA', 'AXFAAA', 'OOOOxx'),
+(4319, 3979, 1, 3, 9, 19, 19, 319, 319, 4319, 4319, 38, 39, 'DKAAAA', 'BXFAAA', 'VVVVxx'),
+(7112, 3980, 0, 0, 2, 12, 12, 112, 1112, 2112, 7112, 24, 25, 'ONAAAA', 'CXFAAA', 'AAAAxx'),
+(3726, 3981, 0, 2, 6, 6, 26, 726, 1726, 3726, 3726, 52, 53, 'INAAAA', 'DXFAAA', 'HHHHxx'),
+(7727, 3982, 1, 3, 7, 7, 27, 727, 1727, 2727, 7727, 54, 55, 'FLAAAA', 'EXFAAA', 'OOOOxx'),
+(8387, 3983, 1, 3, 7, 7, 87, 387, 387, 3387, 8387, 174, 175, 'PKAAAA', 'FXFAAA', 'VVVVxx'),
+(6555, 3984, 1, 3, 5, 15, 55, 555, 555, 1555, 6555, 110, 111, 'DSAAAA', 'GXFAAA', 'AAAAxx'),
+(1148, 3985, 0, 0, 8, 8, 48, 148, 1148, 1148, 1148, 96, 97, 'ESAAAA', 'HXFAAA', 'HHHHxx'),
+(9000, 3986, 0, 0, 0, 0, 0, 0, 1000, 4000, 9000, 0, 1, 'EIAAAA', 'IXFAAA', 'OOOOxx'),
+(5278, 3987, 0, 2, 8, 18, 78, 278, 1278, 278, 5278, 156, 157, 'AVAAAA', 'JXFAAA', 'VVVVxx'),
+(2388, 3988, 0, 0, 8, 8, 88, 388, 388, 2388, 2388, 176, 177, 'WNAAAA', 'KXFAAA', 'AAAAxx'),
+(7984, 3989, 0, 0, 4, 4, 84, 984, 1984, 2984, 7984, 168, 169, 'CVAAAA', 'LXFAAA', 'HHHHxx'),
+(881, 3990, 1, 1, 1, 1, 81, 881, 881, 881, 881, 162, 163, 'XHAAAA', 'MXFAAA', 'OOOOxx'),
+(6830, 3991, 0, 2, 0, 10, 30, 830, 830, 1830, 6830, 60, 61, 'SCAAAA', 'NXFAAA', 'VVVVxx'),
+(7056, 3992, 0, 0, 6, 16, 56, 56, 1056, 2056, 7056, 112, 113, 'KLAAAA', 'OXFAAA', 'AAAAxx'),
+(7581, 3993, 1, 1, 1, 1, 81, 581, 1581, 2581, 7581, 162, 163, 'PFAAAA', 'PXFAAA', 'HHHHxx'),
+(5214, 3994, 0, 2, 4, 14, 14, 214, 1214, 214, 5214, 28, 29, 'OSAAAA', 'QXFAAA', 'OOOOxx'),
+(2505, 3995, 1, 1, 5, 5, 5, 505, 505, 2505, 2505, 10, 11, 'JSAAAA', 'RXFAAA', 'VVVVxx'),
+(5112, 3996, 0, 0, 2, 12, 12, 112, 1112, 112, 5112, 24, 25, 'QOAAAA', 'SXFAAA', 'AAAAxx'),
+(9884, 3997, 0, 0, 4, 4, 84, 884, 1884, 4884, 9884, 168, 169, 'EQAAAA', 'TXFAAA', 'HHHHxx'),
+(8040, 3998, 0, 0, 0, 0, 40, 40, 40, 3040, 8040, 80, 81, 'GXAAAA', 'UXFAAA', 'OOOOxx'),
+(7033, 3999, 1, 1, 3, 13, 33, 33, 1033, 2033, 7033, 66, 67, 'NKAAAA', 'VXFAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(9343, 4000, 1, 3, 3, 3, 43, 343, 1343, 4343, 9343, 86, 87, 'JVAAAA', 'WXFAAA', 'AAAAxx'),
+(2931, 4001, 1, 3, 1, 11, 31, 931, 931, 2931, 2931, 62, 63, 'TIAAAA', 'XXFAAA', 'HHHHxx'),
+(9024, 4002, 0, 0, 4, 4, 24, 24, 1024, 4024, 9024, 48, 49, 'CJAAAA', 'YXFAAA', 'OOOOxx'),
+(6485, 4003, 1, 1, 5, 5, 85, 485, 485, 1485, 6485, 170, 171, 'LPAAAA', 'ZXFAAA', 'VVVVxx'),
+(3465, 4004, 1, 1, 5, 5, 65, 465, 1465, 3465, 3465, 130, 131, 'HDAAAA', 'AYFAAA', 'AAAAxx'),
+(3357, 4005, 1, 1, 7, 17, 57, 357, 1357, 3357, 3357, 114, 115, 'DZAAAA', 'BYFAAA', 'HHHHxx'),
+(2929, 4006, 1, 1, 9, 9, 29, 929, 929, 2929, 2929, 58, 59, 'RIAAAA', 'CYFAAA', 'OOOOxx'),
+(3086, 4007, 0, 2, 6, 6, 86, 86, 1086, 3086, 3086, 172, 173, 'SOAAAA', 'DYFAAA', 'VVVVxx'),
+(8897, 4008, 1, 1, 7, 17, 97, 897, 897, 3897, 8897, 194, 195, 'FEAAAA', 'EYFAAA', 'AAAAxx'),
+(9688, 4009, 0, 0, 8, 8, 88, 688, 1688, 4688, 9688, 176, 177, 'QIAAAA', 'FYFAAA', 'HHHHxx'),
+(6522, 4010, 0, 2, 2, 2, 22, 522, 522, 1522, 6522, 44, 45, 'WQAAAA', 'GYFAAA', 'OOOOxx'),
+(3241, 4011, 1, 1, 1, 1, 41, 241, 1241, 3241, 3241, 82, 83, 'RUAAAA', 'HYFAAA', 'VVVVxx'),
+(8770, 4012, 0, 2, 0, 10, 70, 770, 770, 3770, 8770, 140, 141, 'IZAAAA', 'IYFAAA', 'AAAAxx'),
+(2884, 4013, 0, 0, 4, 4, 84, 884, 884, 2884, 2884, 168, 169, 'YGAAAA', 'JYFAAA', 'HHHHxx'),
+(9579, 4014, 1, 3, 9, 19, 79, 579, 1579, 4579, 9579, 158, 159, 'LEAAAA', 'KYFAAA', 'OOOOxx'),
+(3125, 4015, 1, 1, 5, 5, 25, 125, 1125, 3125, 3125, 50, 51, 'FQAAAA', 'LYFAAA', 'VVVVxx'),
+(4604, 4016, 0, 0, 4, 4, 4, 604, 604, 4604, 4604, 8, 9, 'CVAAAA', 'MYFAAA', 'AAAAxx'),
+(2682, 4017, 0, 2, 2, 2, 82, 682, 682, 2682, 2682, 164, 165, 'EZAAAA', 'NYFAAA', 'HHHHxx'),
+(254, 4018, 0, 2, 4, 14, 54, 254, 254, 254, 254, 108, 109, 'UJAAAA', 'OYFAAA', 'OOOOxx'),
+(6569, 4019, 1, 1, 9, 9, 69, 569, 569, 1569, 6569, 138, 139, 'RSAAAA', 'PYFAAA', 'VVVVxx'),
+(2686, 4020, 0, 2, 6, 6, 86, 686, 686, 2686, 2686, 172, 173, 'IZAAAA', 'QYFAAA', 'AAAAxx'),
+(2123, 4021, 1, 3, 3, 3, 23, 123, 123, 2123, 2123, 46, 47, 'RDAAAA', 'RYFAAA', 'HHHHxx'),
+(1745, 4022, 1, 1, 5, 5, 45, 745, 1745, 1745, 1745, 90, 91, 'DPAAAA', 'SYFAAA', 'OOOOxx'),
+(247, 4023, 1, 3, 7, 7, 47, 247, 247, 247, 247, 94, 95, 'NJAAAA', 'TYFAAA', 'VVVVxx'),
+(5800, 4024, 0, 0, 0, 0, 0, 800, 1800, 800, 5800, 0, 1, 'CPAAAA', 'UYFAAA', 'AAAAxx'),
+(1121, 4025, 1, 1, 1, 1, 21, 121, 1121, 1121, 1121, 42, 43, 'DRAAAA', 'VYFAAA', 'HHHHxx'),
+(8893, 4026, 1, 1, 3, 13, 93, 893, 893, 3893, 8893, 186, 187, 'BEAAAA', 'WYFAAA', 'OOOOxx'),
+(7819, 4027, 1, 3, 9, 19, 19, 819, 1819, 2819, 7819, 38, 39, 'TOAAAA', 'XYFAAA', 'VVVVxx'),
+(1339, 4028, 1, 3, 9, 19, 39, 339, 1339, 1339, 1339, 78, 79, 'NZAAAA', 'YYFAAA', 'AAAAxx'),
+(5680, 4029, 0, 0, 0, 0, 80, 680, 1680, 680, 5680, 160, 161, 'MKAAAA', 'ZYFAAA', 'HHHHxx'),
+(5093, 4030, 1, 1, 3, 13, 93, 93, 1093, 93, 5093, 186, 187, 'XNAAAA', 'AZFAAA', 'OOOOxx'),
+(3508, 4031, 0, 0, 8, 8, 8, 508, 1508, 3508, 3508, 16, 17, 'YEAAAA', 'BZFAAA', 'VVVVxx'),
+(933, 4032, 1, 1, 3, 13, 33, 933, 933, 933, 933, 66, 67, 'XJAAAA', 'CZFAAA', 'AAAAxx'),
+(1106, 4033, 0, 2, 6, 6, 6, 106, 1106, 1106, 1106, 12, 13, 'OQAAAA', 'DZFAAA', 'HHHHxx'),
+(4386, 4034, 0, 2, 6, 6, 86, 386, 386, 4386, 4386, 172, 173, 'SMAAAA', 'EZFAAA', 'OOOOxx'),
+(5895, 4035, 1, 3, 5, 15, 95, 895, 1895, 895, 5895, 190, 191, 'TSAAAA', 'FZFAAA', 'VVVVxx'),
+(2980, 4036, 0, 0, 0, 0, 80, 980, 980, 2980, 2980, 160, 161, 'QKAAAA', 'GZFAAA', 'AAAAxx'),
+(4400, 4037, 0, 0, 0, 0, 0, 400, 400, 4400, 4400, 0, 1, 'GNAAAA', 'HZFAAA', 'HHHHxx'),
+(7433, 4038, 1, 1, 3, 13, 33, 433, 1433, 2433, 7433, 66, 67, 'XZAAAA', 'IZFAAA', 'OOOOxx'),
+(6110, 4039, 0, 2, 0, 10, 10, 110, 110, 1110, 6110, 20, 21, 'ABAAAA', 'JZFAAA', 'VVVVxx'),
+(867, 4040, 1, 3, 7, 7, 67, 867, 867, 867, 867, 134, 135, 'JHAAAA', 'KZFAAA', 'AAAAxx'),
+(5292, 4041, 0, 0, 2, 12, 92, 292, 1292, 292, 5292, 184, 185, 'OVAAAA', 'LZFAAA', 'HHHHxx'),
+(3926, 4042, 0, 2, 6, 6, 26, 926, 1926, 3926, 3926, 52, 53, 'AVAAAA', 'MZFAAA', 'OOOOxx'),
+(1107, 4043, 1, 3, 7, 7, 7, 107, 1107, 1107, 1107, 14, 15, 'PQAAAA', 'NZFAAA', 'VVVVxx'),
+(7355, 4044, 1, 3, 5, 15, 55, 355, 1355, 2355, 7355, 110, 111, 'XWAAAA', 'OZFAAA', 'AAAAxx'),
+(4689, 4045, 1, 1, 9, 9, 89, 689, 689, 4689, 4689, 178, 179, 'JYAAAA', 'PZFAAA', 'HHHHxx'),
+(4872, 4046, 0, 0, 2, 12, 72, 872, 872, 4872, 4872, 144, 145, 'KFAAAA', 'QZFAAA', 'OOOOxx'),
+(7821, 4047, 1, 1, 1, 1, 21, 821, 1821, 2821, 7821, 42, 43, 'VOAAAA', 'RZFAAA', 'VVVVxx'),
+(7277, 4048, 1, 1, 7, 17, 77, 277, 1277, 2277, 7277, 154, 155, 'XTAAAA', 'SZFAAA', 'AAAAxx'),
+(3268, 4049, 0, 0, 8, 8, 68, 268, 1268, 3268, 3268, 136, 137, 'SVAAAA', 'TZFAAA', 'HHHHxx'),
+(8877, 4050, 1, 1, 7, 17, 77, 877, 877, 3877, 8877, 154, 155, 'LDAAAA', 'UZFAAA', 'OOOOxx'),
+(343, 4051, 1, 3, 3, 3, 43, 343, 343, 343, 343, 86, 87, 'FNAAAA', 'VZFAAA', 'VVVVxx'),
+(621, 4052, 1, 1, 1, 1, 21, 621, 621, 621, 621, 42, 43, 'XXAAAA', 'WZFAAA', 'AAAAxx'),
+(5429, 4053, 1, 1, 9, 9, 29, 429, 1429, 429, 5429, 58, 59, 'VAAAAA', 'XZFAAA', 'HHHHxx'),
+(392, 4054, 0, 0, 2, 12, 92, 392, 392, 392, 392, 184, 185, 'CPAAAA', 'YZFAAA', 'OOOOxx'),
+(6004, 4055, 0, 0, 4, 4, 4, 4, 4, 1004, 6004, 8, 9, 'YWAAAA', 'ZZFAAA', 'VVVVxx'),
+(6377, 4056, 1, 1, 7, 17, 77, 377, 377, 1377, 6377, 154, 155, 'HLAAAA', 'AAGAAA', 'AAAAxx'),
+(3037, 4057, 1, 1, 7, 17, 37, 37, 1037, 3037, 3037, 74, 75, 'VMAAAA', 'BAGAAA', 'HHHHxx'),
+(3514, 4058, 0, 2, 4, 14, 14, 514, 1514, 3514, 3514, 28, 29, 'EFAAAA', 'CAGAAA', 'OOOOxx'),
+(8740, 4059, 0, 0, 0, 0, 40, 740, 740, 3740, 8740, 80, 81, 'EYAAAA', 'DAGAAA', 'VVVVxx'),
+(3877, 4060, 1, 1, 7, 17, 77, 877, 1877, 3877, 3877, 154, 155, 'DTAAAA', 'EAGAAA', 'AAAAxx'),
+(5731, 4061, 1, 3, 1, 11, 31, 731, 1731, 731, 5731, 62, 63, 'LMAAAA', 'FAGAAA', 'HHHHxx'),
+(6407, 4062, 1, 3, 7, 7, 7, 407, 407, 1407, 6407, 14, 15, 'LMAAAA', 'GAGAAA', 'OOOOxx'),
+(2044, 4063, 0, 0, 4, 4, 44, 44, 44, 2044, 2044, 88, 89, 'QAAAAA', 'HAGAAA', 'VVVVxx'),
+(7362, 4064, 0, 2, 2, 2, 62, 362, 1362, 2362, 7362, 124, 125, 'EXAAAA', 'IAGAAA', 'AAAAxx'),
+(5458, 4065, 0, 2, 8, 18, 58, 458, 1458, 458, 5458, 116, 117, 'YBAAAA', 'JAGAAA', 'HHHHxx'),
+(6437, 4066, 1, 1, 7, 17, 37, 437, 437, 1437, 6437, 74, 75, 'PNAAAA', 'KAGAAA', 'OOOOxx'),
+(1051, 4067, 1, 3, 1, 11, 51, 51, 1051, 1051, 1051, 102, 103, 'LOAAAA', 'LAGAAA', 'VVVVxx'),
+(1203, 4068, 1, 3, 3, 3, 3, 203, 1203, 1203, 1203, 6, 7, 'HUAAAA', 'MAGAAA', 'AAAAxx'),
+(2176, 4069, 0, 0, 6, 16, 76, 176, 176, 2176, 2176, 152, 153, 'SFAAAA', 'NAGAAA', 'HHHHxx'),
+(8997, 4070, 1, 1, 7, 17, 97, 997, 997, 3997, 8997, 194, 195, 'BIAAAA', 'OAGAAA', 'OOOOxx'),
+(6378, 4071, 0, 2, 8, 18, 78, 378, 378, 1378, 6378, 156, 157, 'ILAAAA', 'PAGAAA', 'VVVVxx'),
+(6006, 4072, 0, 2, 6, 6, 6, 6, 6, 1006, 6006, 12, 13, 'AXAAAA', 'QAGAAA', 'AAAAxx'),
+(2308, 4073, 0, 0, 8, 8, 8, 308, 308, 2308, 2308, 16, 17, 'UKAAAA', 'RAGAAA', 'HHHHxx'),
+(625, 4074, 1, 1, 5, 5, 25, 625, 625, 625, 625, 50, 51, 'BYAAAA', 'SAGAAA', 'OOOOxx'),
+(7298, 4075, 0, 2, 8, 18, 98, 298, 1298, 2298, 7298, 196, 197, 'SUAAAA', 'TAGAAA', 'VVVVxx'),
+(5575, 4076, 1, 3, 5, 15, 75, 575, 1575, 575, 5575, 150, 151, 'LGAAAA', 'UAGAAA', 'AAAAxx'),
+(3565, 4077, 1, 1, 5, 5, 65, 565, 1565, 3565, 3565, 130, 131, 'DHAAAA', 'VAGAAA', 'HHHHxx'),
+(47, 4078, 1, 3, 7, 7, 47, 47, 47, 47, 47, 94, 95, 'VBAAAA', 'WAGAAA', 'OOOOxx'),
+(2413, 4079, 1, 1, 3, 13, 13, 413, 413, 2413, 2413, 26, 27, 'VOAAAA', 'XAGAAA', 'VVVVxx'),
+(2153, 4080, 1, 1, 3, 13, 53, 153, 153, 2153, 2153, 106, 107, 'VEAAAA', 'YAGAAA', 'AAAAxx'),
+(752, 4081, 0, 0, 2, 12, 52, 752, 752, 752, 752, 104, 105, 'YCAAAA', 'ZAGAAA', 'HHHHxx'),
+(4095, 4082, 1, 3, 5, 15, 95, 95, 95, 4095, 4095, 190, 191, 'NBAAAA', 'ABGAAA', 'OOOOxx'),
+(2518, 4083, 0, 2, 8, 18, 18, 518, 518, 2518, 2518, 36, 37, 'WSAAAA', 'BBGAAA', 'VVVVxx'),
+(3681, 4084, 1, 1, 1, 1, 81, 681, 1681, 3681, 3681, 162, 163, 'PLAAAA', 'CBGAAA', 'AAAAxx'),
+(4213, 4085, 1, 1, 3, 13, 13, 213, 213, 4213, 4213, 26, 27, 'BGAAAA', 'DBGAAA', 'HHHHxx'),
+(2615, 4086, 1, 3, 5, 15, 15, 615, 615, 2615, 2615, 30, 31, 'PWAAAA', 'EBGAAA', 'OOOOxx'),
+(1471, 4087, 1, 3, 1, 11, 71, 471, 1471, 1471, 1471, 142, 143, 'PEAAAA', 'FBGAAA', 'VVVVxx'),
+(7315, 4088, 1, 3, 5, 15, 15, 315, 1315, 2315, 7315, 30, 31, 'JVAAAA', 'GBGAAA', 'AAAAxx'),
+(6013, 4089, 1, 1, 3, 13, 13, 13, 13, 1013, 6013, 26, 27, 'HXAAAA', 'HBGAAA', 'HHHHxx'),
+(3077, 4090, 1, 1, 7, 17, 77, 77, 1077, 3077, 3077, 154, 155, 'JOAAAA', 'IBGAAA', 'OOOOxx'),
+(2190, 4091, 0, 2, 0, 10, 90, 190, 190, 2190, 2190, 180, 181, 'GGAAAA', 'JBGAAA', 'VVVVxx'),
+(528, 4092, 0, 0, 8, 8, 28, 528, 528, 528, 528, 56, 57, 'IUAAAA', 'KBGAAA', 'AAAAxx'),
+(9508, 4093, 0, 0, 8, 8, 8, 508, 1508, 4508, 9508, 16, 17, 'SBAAAA', 'LBGAAA', 'HHHHxx'),
+(2473, 4094, 1, 1, 3, 13, 73, 473, 473, 2473, 2473, 146, 147, 'DRAAAA', 'MBGAAA', 'OOOOxx'),
+(167, 4095, 1, 3, 7, 7, 67, 167, 167, 167, 167, 134, 135, 'LGAAAA', 'NBGAAA', 'VVVVxx'),
+(8448, 4096, 0, 0, 8, 8, 48, 448, 448, 3448, 8448, 96, 97, 'YMAAAA', 'OBGAAA', 'AAAAxx'),
+(7538, 4097, 0, 2, 8, 18, 38, 538, 1538, 2538, 7538, 76, 77, 'YDAAAA', 'PBGAAA', 'HHHHxx'),
+(7638, 4098, 0, 2, 8, 18, 38, 638, 1638, 2638, 7638, 76, 77, 'UHAAAA', 'QBGAAA', 'OOOOxx'),
+(4328, 4099, 0, 0, 8, 8, 28, 328, 328, 4328, 4328, 56, 57, 'MKAAAA', 'RBGAAA', 'VVVVxx'),
+(3812, 4100, 0, 0, 2, 12, 12, 812, 1812, 3812, 3812, 24, 25, 'QQAAAA', 'SBGAAA', 'AAAAxx'),
+(2879, 4101, 1, 3, 9, 19, 79, 879, 879, 2879, 2879, 158, 159, 'TGAAAA', 'TBGAAA', 'HHHHxx'),
+(4741, 4102, 1, 1, 1, 1, 41, 741, 741, 4741, 4741, 82, 83, 'JAAAAA', 'UBGAAA', 'OOOOxx'),
+(9155, 4103, 1, 3, 5, 15, 55, 155, 1155, 4155, 9155, 110, 111, 'DOAAAA', 'VBGAAA', 'VVVVxx'),
+(5151, 4104, 1, 3, 1, 11, 51, 151, 1151, 151, 5151, 102, 103, 'DQAAAA', 'WBGAAA', 'AAAAxx'),
+(5591, 4105, 1, 3, 1, 11, 91, 591, 1591, 591, 5591, 182, 183, 'BHAAAA', 'XBGAAA', 'HHHHxx'),
+(1034, 4106, 0, 2, 4, 14, 34, 34, 1034, 1034, 1034, 68, 69, 'UNAAAA', 'YBGAAA', 'OOOOxx'),
+(765, 4107, 1, 1, 5, 5, 65, 765, 765, 765, 765, 130, 131, 'LDAAAA', 'ZBGAAA', 'VVVVxx'),
+(2664, 4108, 0, 0, 4, 4, 64, 664, 664, 2664, 2664, 128, 129, 'MYAAAA', 'ACGAAA', 'AAAAxx'),
+(6854, 4109, 0, 2, 4, 14, 54, 854, 854, 1854, 6854, 108, 109, 'QDAAAA', 'BCGAAA', 'HHHHxx'),
+(8263, 4110, 1, 3, 3, 3, 63, 263, 263, 3263, 8263, 126, 127, 'VFAAAA', 'CCGAAA', 'OOOOxx'),
+(8658, 4111, 0, 2, 8, 18, 58, 658, 658, 3658, 8658, 116, 117, 'AVAAAA', 'DCGAAA', 'VVVVxx'),
+(587, 4112, 1, 3, 7, 7, 87, 587, 587, 587, 587, 174, 175, 'PWAAAA', 'ECGAAA', 'AAAAxx'),
+(4553, 4113, 1, 1, 3, 13, 53, 553, 553, 4553, 4553, 106, 107, 'DTAAAA', 'FCGAAA', 'HHHHxx'),
+(1368, 4114, 0, 0, 8, 8, 68, 368, 1368, 1368, 1368, 136, 137, 'QAAAAA', 'GCGAAA', 'OOOOxx'),
+(1718, 4115, 0, 2, 8, 18, 18, 718, 1718, 1718, 1718, 36, 37, 'COAAAA', 'HCGAAA', 'VVVVxx'),
+(140, 4116, 0, 0, 0, 0, 40, 140, 140, 140, 140, 80, 81, 'KFAAAA', 'ICGAAA', 'AAAAxx'),
+(8341, 4117, 1, 1, 1, 1, 41, 341, 341, 3341, 8341, 82, 83, 'VIAAAA', 'JCGAAA', 'HHHHxx'),
+(72, 4118, 0, 0, 2, 12, 72, 72, 72, 72, 72, 144, 145, 'UCAAAA', 'KCGAAA', 'OOOOxx'),
+(6589, 4119, 1, 1, 9, 9, 89, 589, 589, 1589, 6589, 178, 179, 'LTAAAA', 'LCGAAA', 'VVVVxx'),
+(2024, 4120, 0, 0, 4, 4, 24, 24, 24, 2024, 2024, 48, 49, 'WZAAAA', 'MCGAAA', 'AAAAxx'),
+(8024, 4121, 0, 0, 4, 4, 24, 24, 24, 3024, 8024, 48, 49, 'QWAAAA', 'NCGAAA', 'HHHHxx'),
+(9564, 4122, 0, 0, 4, 4, 64, 564, 1564, 4564, 9564, 128, 129, 'WDAAAA', 'OCGAAA', 'OOOOxx'),
+(8625, 4123, 1, 1, 5, 5, 25, 625, 625, 3625, 8625, 50, 51, 'TTAAAA', 'PCGAAA', 'VVVVxx'),
+(2680, 4124, 0, 0, 0, 0, 80, 680, 680, 2680, 2680, 160, 161, 'CZAAAA', 'QCGAAA', 'AAAAxx'),
+(4323, 4125, 1, 3, 3, 3, 23, 323, 323, 4323, 4323, 46, 47, 'HKAAAA', 'RCGAAA', 'HHHHxx'),
+(8981, 4126, 1, 1, 1, 1, 81, 981, 981, 3981, 8981, 162, 163, 'LHAAAA', 'SCGAAA', 'OOOOxx'),
+(8909, 4127, 1, 1, 9, 9, 9, 909, 909, 3909, 8909, 18, 19, 'REAAAA', 'TCGAAA', 'VVVVxx'),
+(5288, 4128, 0, 0, 8, 8, 88, 288, 1288, 288, 5288, 176, 177, 'KVAAAA', 'UCGAAA', 'AAAAxx'),
+(2057, 4129, 1, 1, 7, 17, 57, 57, 57, 2057, 2057, 114, 115, 'DBAAAA', 'VCGAAA', 'HHHHxx'),
+(5931, 4130, 1, 3, 1, 11, 31, 931, 1931, 931, 5931, 62, 63, 'DUAAAA', 'WCGAAA', 'OOOOxx'),
+(9794, 4131, 0, 2, 4, 14, 94, 794, 1794, 4794, 9794, 188, 189, 'SMAAAA', 'XCGAAA', 'VVVVxx'),
+(1012, 4132, 0, 0, 2, 12, 12, 12, 1012, 1012, 1012, 24, 25, 'YMAAAA', 'YCGAAA', 'AAAAxx'),
+(5496, 4133, 0, 0, 6, 16, 96, 496, 1496, 496, 5496, 192, 193, 'KDAAAA', 'ZCGAAA', 'HHHHxx'),
+(9182, 4134, 0, 2, 2, 2, 82, 182, 1182, 4182, 9182, 164, 165, 'EPAAAA', 'ADGAAA', 'OOOOxx'),
+(5258, 4135, 0, 2, 8, 18, 58, 258, 1258, 258, 5258, 116, 117, 'GUAAAA', 'BDGAAA', 'VVVVxx'),
+(3050, 4136, 0, 2, 0, 10, 50, 50, 1050, 3050, 3050, 100, 101, 'INAAAA', 'CDGAAA', 'AAAAxx'),
+(2083, 4137, 1, 3, 3, 3, 83, 83, 83, 2083, 2083, 166, 167, 'DCAAAA', 'DDGAAA', 'HHHHxx'),
+(3069, 4138, 1, 1, 9, 9, 69, 69, 1069, 3069, 3069, 138, 139, 'BOAAAA', 'EDGAAA', 'OOOOxx'),
+(8459, 4139, 1, 3, 9, 19, 59, 459, 459, 3459, 8459, 118, 119, 'JNAAAA', 'FDGAAA', 'VVVVxx'),
+(169, 4140, 1, 1, 9, 9, 69, 169, 169, 169, 169, 138, 139, 'NGAAAA', 'GDGAAA', 'AAAAxx'),
+(4379, 4141, 1, 3, 9, 19, 79, 379, 379, 4379, 4379, 158, 159, 'LMAAAA', 'HDGAAA', 'HHHHxx'),
+(5126, 4142, 0, 2, 6, 6, 26, 126, 1126, 126, 5126, 52, 53, 'EPAAAA', 'IDGAAA', 'OOOOxx'),
+(1415, 4143, 1, 3, 5, 15, 15, 415, 1415, 1415, 1415, 30, 31, 'LCAAAA', 'JDGAAA', 'VVVVxx'),
+(1163, 4144, 1, 3, 3, 3, 63, 163, 1163, 1163, 1163, 126, 127, 'TSAAAA', 'KDGAAA', 'AAAAxx'),
+(3500, 4145, 0, 0, 0, 0, 0, 500, 1500, 3500, 3500, 0, 1, 'QEAAAA', 'LDGAAA', 'HHHHxx'),
+(7202, 4146, 0, 2, 2, 2, 2, 202, 1202, 2202, 7202, 4, 5, 'ARAAAA', 'MDGAAA', 'OOOOxx'),
+(747, 4147, 1, 3, 7, 7, 47, 747, 747, 747, 747, 94, 95, 'TCAAAA', 'NDGAAA', 'VVVVxx'),
+(9264, 4148, 0, 0, 4, 4, 64, 264, 1264, 4264, 9264, 128, 129, 'ISAAAA', 'ODGAAA', 'AAAAxx'),
+(8548, 4149, 0, 0, 8, 8, 48, 548, 548, 3548, 8548, 96, 97, 'UQAAAA', 'PDGAAA', 'HHHHxx'),
+(4228, 4150, 0, 0, 8, 8, 28, 228, 228, 4228, 4228, 56, 57, 'QGAAAA', 'QDGAAA', 'OOOOxx'),
+(7122, 4151, 0, 2, 2, 2, 22, 122, 1122, 2122, 7122, 44, 45, 'YNAAAA', 'RDGAAA', 'VVVVxx'),
+(3395, 4152, 1, 3, 5, 15, 95, 395, 1395, 3395, 3395, 190, 191, 'PAAAAA', 'SDGAAA', 'AAAAxx'),
+(5674, 4153, 0, 2, 4, 14, 74, 674, 1674, 674, 5674, 148, 149, 'GKAAAA', 'TDGAAA', 'HHHHxx'),
+(7293, 4154, 1, 1, 3, 13, 93, 293, 1293, 2293, 7293, 186, 187, 'NUAAAA', 'UDGAAA', 'OOOOxx'),
+(737, 4155, 1, 1, 7, 17, 37, 737, 737, 737, 737, 74, 75, 'JCAAAA', 'VDGAAA', 'VVVVxx'),
+(9595, 4156, 1, 3, 5, 15, 95, 595, 1595, 4595, 9595, 190, 191, 'BFAAAA', 'WDGAAA', 'AAAAxx'),
+(594, 4157, 0, 2, 4, 14, 94, 594, 594, 594, 594, 188, 189, 'WWAAAA', 'XDGAAA', 'HHHHxx'),
+(5322, 4158, 0, 2, 2, 2, 22, 322, 1322, 322, 5322, 44, 45, 'SWAAAA', 'YDGAAA', 'OOOOxx'),
+(2933, 4159, 1, 1, 3, 13, 33, 933, 933, 2933, 2933, 66, 67, 'VIAAAA', 'ZDGAAA', 'VVVVxx'),
+(4955, 4160, 1, 3, 5, 15, 55, 955, 955, 4955, 4955, 110, 111, 'PIAAAA', 'AEGAAA', 'AAAAxx'),
+(4073, 4161, 1, 1, 3, 13, 73, 73, 73, 4073, 4073, 146, 147, 'RAAAAA', 'BEGAAA', 'HHHHxx'),
+(7249, 4162, 1, 1, 9, 9, 49, 249, 1249, 2249, 7249, 98, 99, 'VSAAAA', 'CEGAAA', 'OOOOxx'),
+(192, 4163, 0, 0, 2, 12, 92, 192, 192, 192, 192, 184, 185, 'KHAAAA', 'DEGAAA', 'VVVVxx'),
+(2617, 4164, 1, 1, 7, 17, 17, 617, 617, 2617, 2617, 34, 35, 'RWAAAA', 'EEGAAA', 'AAAAxx'),
+(7409, 4165, 1, 1, 9, 9, 9, 409, 1409, 2409, 7409, 18, 19, 'ZYAAAA', 'FEGAAA', 'HHHHxx'),
+(4903, 4166, 1, 3, 3, 3, 3, 903, 903, 4903, 4903, 6, 7, 'PGAAAA', 'GEGAAA', 'OOOOxx'),
+(9797, 4167, 1, 1, 7, 17, 97, 797, 1797, 4797, 9797, 194, 195, 'VMAAAA', 'HEGAAA', 'VVVVxx'),
+(9919, 4168, 1, 3, 9, 19, 19, 919, 1919, 4919, 9919, 38, 39, 'NRAAAA', 'IEGAAA', 'AAAAxx'),
+(1878, 4169, 0, 2, 8, 18, 78, 878, 1878, 1878, 1878, 156, 157, 'GUAAAA', 'JEGAAA', 'HHHHxx'),
+(4851, 4170, 1, 3, 1, 11, 51, 851, 851, 4851, 4851, 102, 103, 'PEAAAA', 'KEGAAA', 'OOOOxx'),
+(5514, 4171, 0, 2, 4, 14, 14, 514, 1514, 514, 5514, 28, 29, 'CEAAAA', 'LEGAAA', 'VVVVxx'),
+(2582, 4172, 0, 2, 2, 2, 82, 582, 582, 2582, 2582, 164, 165, 'IVAAAA', 'MEGAAA', 'AAAAxx'),
+(3564, 4173, 0, 0, 4, 4, 64, 564, 1564, 3564, 3564, 128, 129, 'CHAAAA', 'NEGAAA', 'HHHHxx'),
+(7085, 4174, 1, 1, 5, 5, 85, 85, 1085, 2085, 7085, 170, 171, 'NMAAAA', 'OEGAAA', 'OOOOxx'),
+(3619, 4175, 1, 3, 9, 19, 19, 619, 1619, 3619, 3619, 38, 39, 'FJAAAA', 'PEGAAA', 'VVVVxx'),
+(261, 4176, 1, 1, 1, 1, 61, 261, 261, 261, 261, 122, 123, 'BKAAAA', 'QEGAAA', 'AAAAxx'),
+(7338, 4177, 0, 2, 8, 18, 38, 338, 1338, 2338, 7338, 76, 77, 'GWAAAA', 'REGAAA', 'HHHHxx'),
+(4251, 4178, 1, 3, 1, 11, 51, 251, 251, 4251, 4251, 102, 103, 'NHAAAA', 'SEGAAA', 'OOOOxx'),
+(5360, 4179, 0, 0, 0, 0, 60, 360, 1360, 360, 5360, 120, 121, 'EYAAAA', 'TEGAAA', 'VVVVxx'),
+(5678, 4180, 0, 2, 8, 18, 78, 678, 1678, 678, 5678, 156, 157, 'KKAAAA', 'UEGAAA', 'AAAAxx'),
+(9162, 4181, 0, 2, 2, 2, 62, 162, 1162, 4162, 9162, 124, 125, 'KOAAAA', 'VEGAAA', 'HHHHxx'),
+(5920, 4182, 0, 0, 0, 0, 20, 920, 1920, 920, 5920, 40, 41, 'STAAAA', 'WEGAAA', 'OOOOxx'),
+(7156, 4183, 0, 0, 6, 16, 56, 156, 1156, 2156, 7156, 112, 113, 'GPAAAA', 'XEGAAA', 'VVVVxx'),
+(4271, 4184, 1, 3, 1, 11, 71, 271, 271, 4271, 4271, 142, 143, 'HIAAAA', 'YEGAAA', 'AAAAxx'),
+(4698, 4185, 0, 2, 8, 18, 98, 698, 698, 4698, 4698, 196, 197, 'SYAAAA', 'ZEGAAA', 'HHHHxx'),
+(1572, 4186, 0, 0, 2, 12, 72, 572, 1572, 1572, 1572, 144, 145, 'MIAAAA', 'AFGAAA', 'OOOOxx'),
+(6974, 4187, 0, 2, 4, 14, 74, 974, 974, 1974, 6974, 148, 149, 'GIAAAA', 'BFGAAA', 'VVVVxx'),
+(4291, 4188, 1, 3, 1, 11, 91, 291, 291, 4291, 4291, 182, 183, 'BJAAAA', 'CFGAAA', 'AAAAxx'),
+(4036, 4189, 0, 0, 6, 16, 36, 36, 36, 4036, 4036, 72, 73, 'GZAAAA', 'DFGAAA', 'HHHHxx'),
+(7473, 4190, 1, 1, 3, 13, 73, 473, 1473, 2473, 7473, 146, 147, 'LBAAAA', 'EFGAAA', 'OOOOxx'),
+(4786, 4191, 0, 2, 6, 6, 86, 786, 786, 4786, 4786, 172, 173, 'CCAAAA', 'FFGAAA', 'VVVVxx'),
+(2662, 4192, 0, 2, 2, 2, 62, 662, 662, 2662, 2662, 124, 125, 'KYAAAA', 'GFGAAA', 'AAAAxx'),
+(916, 4193, 0, 0, 6, 16, 16, 916, 916, 916, 916, 32, 33, 'GJAAAA', 'HFGAAA', 'HHHHxx'),
+(668, 4194, 0, 0, 8, 8, 68, 668, 668, 668, 668, 136, 137, 'SZAAAA', 'IFGAAA', 'OOOOxx'),
+(4874, 4195, 0, 2, 4, 14, 74, 874, 874, 4874, 4874, 148, 149, 'MFAAAA', 'JFGAAA', 'VVVVxx'),
+(3752, 4196, 0, 0, 2, 12, 52, 752, 1752, 3752, 3752, 104, 105, 'IOAAAA', 'KFGAAA', 'AAAAxx'),
+(4865, 4197, 1, 1, 5, 5, 65, 865, 865, 4865, 4865, 130, 131, 'DFAAAA', 'LFGAAA', 'HHHHxx'),
+(7052, 4198, 0, 0, 2, 12, 52, 52, 1052, 2052, 7052, 104, 105, 'GLAAAA', 'MFGAAA', 'OOOOxx'),
+(5712, 4199, 0, 0, 2, 12, 12, 712, 1712, 712, 5712, 24, 25, 'SLAAAA', 'NFGAAA', 'VVVVxx'),
+(31, 4200, 1, 3, 1, 11, 31, 31, 31, 31, 31, 62, 63, 'FBAAAA', 'OFGAAA', 'AAAAxx'),
+(4944, 4201, 0, 0, 4, 4, 44, 944, 944, 4944, 4944, 88, 89, 'EIAAAA', 'PFGAAA', 'HHHHxx'),
+(1435, 4202, 1, 3, 5, 15, 35, 435, 1435, 1435, 1435, 70, 71, 'FDAAAA', 'QFGAAA', 'OOOOxx'),
+(501, 4203, 1, 1, 1, 1, 1, 501, 501, 501, 501, 2, 3, 'HTAAAA', 'RFGAAA', 'VVVVxx'),
+(9401, 4204, 1, 1, 1, 1, 1, 401, 1401, 4401, 9401, 2, 3, 'PXAAAA', 'SFGAAA', 'AAAAxx'),
+(5014, 4205, 0, 2, 4, 14, 14, 14, 1014, 14, 5014, 28, 29, 'WKAAAA', 'TFGAAA', 'HHHHxx'),
+(9125, 4206, 1, 1, 5, 5, 25, 125, 1125, 4125, 9125, 50, 51, 'ZMAAAA', 'UFGAAA', 'OOOOxx'),
+(6144, 4207, 0, 0, 4, 4, 44, 144, 144, 1144, 6144, 88, 89, 'ICAAAA', 'VFGAAA', 'VVVVxx'),
+(1743, 4208, 1, 3, 3, 3, 43, 743, 1743, 1743, 1743, 86, 87, 'BPAAAA', 'WFGAAA', 'AAAAxx'),
+(4316, 4209, 0, 0, 6, 16, 16, 316, 316, 4316, 4316, 32, 33, 'AKAAAA', 'XFGAAA', 'HHHHxx'),
+(8212, 4210, 0, 0, 2, 12, 12, 212, 212, 3212, 8212, 24, 25, 'WDAAAA', 'YFGAAA', 'OOOOxx'),
+(7344, 4211, 0, 0, 4, 4, 44, 344, 1344, 2344, 7344, 88, 89, 'MWAAAA', 'ZFGAAA', 'VVVVxx'),
+(2051, 4212, 1, 3, 1, 11, 51, 51, 51, 2051, 2051, 102, 103, 'XAAAAA', 'AGGAAA', 'AAAAxx'),
+(8131, 4213, 1, 3, 1, 11, 31, 131, 131, 3131, 8131, 62, 63, 'TAAAAA', 'BGGAAA', 'HHHHxx'),
+(7023, 4214, 1, 3, 3, 3, 23, 23, 1023, 2023, 7023, 46, 47, 'DKAAAA', 'CGGAAA', 'OOOOxx'),
+(9674, 4215, 0, 2, 4, 14, 74, 674, 1674, 4674, 9674, 148, 149, 'CIAAAA', 'DGGAAA', 'VVVVxx'),
+(4984, 4216, 0, 0, 4, 4, 84, 984, 984, 4984, 4984, 168, 169, 'SJAAAA', 'EGGAAA', 'AAAAxx'),
+(111, 4217, 1, 3, 1, 11, 11, 111, 111, 111, 111, 22, 23, 'HEAAAA', 'FGGAAA', 'HHHHxx'),
+(2296, 4218, 0, 0, 6, 16, 96, 296, 296, 2296, 2296, 192, 193, 'IKAAAA', 'GGGAAA', 'OOOOxx'),
+(5025, 4219, 1, 1, 5, 5, 25, 25, 1025, 25, 5025, 50, 51, 'HLAAAA', 'HGGAAA', 'VVVVxx'),
+(1756, 4220, 0, 0, 6, 16, 56, 756, 1756, 1756, 1756, 112, 113, 'OPAAAA', 'IGGAAA', 'AAAAxx'),
+(2885, 4221, 1, 1, 5, 5, 85, 885, 885, 2885, 2885, 170, 171, 'ZGAAAA', 'JGGAAA', 'HHHHxx'),
+(2541, 4222, 1, 1, 1, 1, 41, 541, 541, 2541, 2541, 82, 83, 'TTAAAA', 'KGGAAA', 'OOOOxx'),
+(1919, 4223, 1, 3, 9, 19, 19, 919, 1919, 1919, 1919, 38, 39, 'VVAAAA', 'LGGAAA', 'VVVVxx'),
+(6496, 4224, 0, 0, 6, 16, 96, 496, 496, 1496, 6496, 192, 193, 'WPAAAA', 'MGGAAA', 'AAAAxx'),
+(6103, 4225, 1, 3, 3, 3, 3, 103, 103, 1103, 6103, 6, 7, 'TAAAAA', 'NGGAAA', 'HHHHxx'),
+(98, 4226, 0, 2, 8, 18, 98, 98, 98, 98, 98, 196, 197, 'UDAAAA', 'OGGAAA', 'OOOOxx'),
+(3727, 4227, 1, 3, 7, 7, 27, 727, 1727, 3727, 3727, 54, 55, 'JNAAAA', 'PGGAAA', 'VVVVxx'),
+(689, 4228, 1, 1, 9, 9, 89, 689, 689, 689, 689, 178, 179, 'NAAAAA', 'QGGAAA', 'AAAAxx'),
+(7181, 4229, 1, 1, 1, 1, 81, 181, 1181, 2181, 7181, 162, 163, 'FQAAAA', 'RGGAAA', 'HHHHxx'),
+(8447, 4230, 1, 3, 7, 7, 47, 447, 447, 3447, 8447, 94, 95, 'XMAAAA', 'SGGAAA', 'OOOOxx'),
+(4569, 4231, 1, 1, 9, 9, 69, 569, 569, 4569, 4569, 138, 139, 'TTAAAA', 'TGGAAA', 'VVVVxx'),
+(8844, 4232, 0, 0, 4, 4, 44, 844, 844, 3844, 8844, 88, 89, 'ECAAAA', 'UGGAAA', 'AAAAxx'),
+(2436, 4233, 0, 0, 6, 16, 36, 436, 436, 2436, 2436, 72, 73, 'SPAAAA', 'VGGAAA', 'HHHHxx'),
+(391, 4234, 1, 3, 1, 11, 91, 391, 391, 391, 391, 182, 183, 'BPAAAA', 'WGGAAA', 'OOOOxx'),
+(3035, 4235, 1, 3, 5, 15, 35, 35, 1035, 3035, 3035, 70, 71, 'TMAAAA', 'XGGAAA', 'VVVVxx'),
+(7583, 4236, 1, 3, 3, 3, 83, 583, 1583, 2583, 7583, 166, 167, 'RFAAAA', 'YGGAAA', 'AAAAxx'),
+(1145, 4237, 1, 1, 5, 5, 45, 145, 1145, 1145, 1145, 90, 91, 'BSAAAA', 'ZGGAAA', 'HHHHxx'),
+(93, 4238, 1, 1, 3, 13, 93, 93, 93, 93, 93, 186, 187, 'PDAAAA', 'AHGAAA', 'OOOOxx'),
+(8896, 4239, 0, 0, 6, 16, 96, 896, 896, 3896, 8896, 192, 193, 'EEAAAA', 'BHGAAA', 'VVVVxx'),
+(6719, 4240, 1, 3, 9, 19, 19, 719, 719, 1719, 6719, 38, 39, 'LYAAAA', 'CHGAAA', 'AAAAxx'),
+(7728, 4241, 0, 0, 8, 8, 28, 728, 1728, 2728, 7728, 56, 57, 'GLAAAA', 'DHGAAA', 'HHHHxx'),
+(1349, 4242, 1, 1, 9, 9, 49, 349, 1349, 1349, 1349, 98, 99, 'XZAAAA', 'EHGAAA', 'OOOOxx'),
+(5349, 4243, 1, 1, 9, 9, 49, 349, 1349, 349, 5349, 98, 99, 'TXAAAA', 'FHGAAA', 'VVVVxx'),
+(3040, 4244, 0, 0, 0, 0, 40, 40, 1040, 3040, 3040, 80, 81, 'YMAAAA', 'GHGAAA', 'AAAAxx'),
+(2414, 4245, 0, 2, 4, 14, 14, 414, 414, 2414, 2414, 28, 29, 'WOAAAA', 'HHGAAA', 'HHHHxx'),
+(5122, 4246, 0, 2, 2, 2, 22, 122, 1122, 122, 5122, 44, 45, 'APAAAA', 'IHGAAA', 'OOOOxx'),
+(9553, 4247, 1, 1, 3, 13, 53, 553, 1553, 4553, 9553, 106, 107, 'LDAAAA', 'JHGAAA', 'VVVVxx'),
+(5987, 4248, 1, 3, 7, 7, 87, 987, 1987, 987, 5987, 174, 175, 'HWAAAA', 'KHGAAA', 'AAAAxx'),
+(5939, 4249, 1, 3, 9, 19, 39, 939, 1939, 939, 5939, 78, 79, 'LUAAAA', 'LHGAAA', 'HHHHxx'),
+(3525, 4250, 1, 1, 5, 5, 25, 525, 1525, 3525, 3525, 50, 51, 'PFAAAA', 'MHGAAA', 'OOOOxx'),
+(1371, 4251, 1, 3, 1, 11, 71, 371, 1371, 1371, 1371, 142, 143, 'TAAAAA', 'NHGAAA', 'VVVVxx'),
+(618, 4252, 0, 2, 8, 18, 18, 618, 618, 618, 618, 36, 37, 'UXAAAA', 'OHGAAA', 'AAAAxx'),
+(6529, 4253, 1, 1, 9, 9, 29, 529, 529, 1529, 6529, 58, 59, 'DRAAAA', 'PHGAAA', 'HHHHxx'),
+(4010, 4254, 0, 2, 0, 10, 10, 10, 10, 4010, 4010, 20, 21, 'GYAAAA', 'QHGAAA', 'OOOOxx'),
+(328, 4255, 0, 0, 8, 8, 28, 328, 328, 328, 328, 56, 57, 'QMAAAA', 'RHGAAA', 'VVVVxx'),
+(6121, 4256, 1, 1, 1, 1, 21, 121, 121, 1121, 6121, 42, 43, 'LBAAAA', 'SHGAAA', 'AAAAxx'),
+(3505, 4257, 1, 1, 5, 5, 5, 505, 1505, 3505, 3505, 10, 11, 'VEAAAA', 'THGAAA', 'HHHHxx'),
+(2033, 4258, 1, 1, 3, 13, 33, 33, 33, 2033, 2033, 66, 67, 'FAAAAA', 'UHGAAA', 'OOOOxx'),
+(4724, 4259, 0, 0, 4, 4, 24, 724, 724, 4724, 4724, 48, 49, 'SZAAAA', 'VHGAAA', 'VVVVxx'),
+(8717, 4260, 1, 1, 7, 17, 17, 717, 717, 3717, 8717, 34, 35, 'HXAAAA', 'WHGAAA', 'AAAAxx'),
+(5639, 4261, 1, 3, 9, 19, 39, 639, 1639, 639, 5639, 78, 79, 'XIAAAA', 'XHGAAA', 'HHHHxx'),
+(3448, 4262, 0, 0, 8, 8, 48, 448, 1448, 3448, 3448, 96, 97, 'QCAAAA', 'YHGAAA', 'OOOOxx'),
+(2919, 4263, 1, 3, 9, 19, 19, 919, 919, 2919, 2919, 38, 39, 'HIAAAA', 'ZHGAAA', 'VVVVxx'),
+(3417, 4264, 1, 1, 7, 17, 17, 417, 1417, 3417, 3417, 34, 35, 'LBAAAA', 'AIGAAA', 'AAAAxx'),
+(943, 4265, 1, 3, 3, 3, 43, 943, 943, 943, 943, 86, 87, 'HKAAAA', 'BIGAAA', 'HHHHxx'),
+(775, 4266, 1, 3, 5, 15, 75, 775, 775, 775, 775, 150, 151, 'VDAAAA', 'CIGAAA', 'OOOOxx'),
+(2333, 4267, 1, 1, 3, 13, 33, 333, 333, 2333, 2333, 66, 67, 'TLAAAA', 'DIGAAA', 'VVVVxx'),
+(4801, 4268, 1, 1, 1, 1, 1, 801, 801, 4801, 4801, 2, 3, 'RCAAAA', 'EIGAAA', 'AAAAxx'),
+(7169, 4269, 1, 1, 9, 9, 69, 169, 1169, 2169, 7169, 138, 139, 'TPAAAA', 'FIGAAA', 'HHHHxx'),
+(2840, 4270, 0, 0, 0, 0, 40, 840, 840, 2840, 2840, 80, 81, 'GFAAAA', 'GIGAAA', 'OOOOxx'),
+(9034, 4271, 0, 2, 4, 14, 34, 34, 1034, 4034, 9034, 68, 69, 'MJAAAA', 'HIGAAA', 'VVVVxx'),
+(6154, 4272, 0, 2, 4, 14, 54, 154, 154, 1154, 6154, 108, 109, 'SCAAAA', 'IIGAAA', 'AAAAxx'),
+(1412, 4273, 0, 0, 2, 12, 12, 412, 1412, 1412, 1412, 24, 25, 'ICAAAA', 'JIGAAA', 'HHHHxx'),
+(2263, 4274, 1, 3, 3, 3, 63, 263, 263, 2263, 2263, 126, 127, 'BJAAAA', 'KIGAAA', 'OOOOxx'),
+(7118, 4275, 0, 2, 8, 18, 18, 118, 1118, 2118, 7118, 36, 37, 'UNAAAA', 'LIGAAA', 'VVVVxx'),
+(1526, 4276, 0, 2, 6, 6, 26, 526, 1526, 1526, 1526, 52, 53, 'SGAAAA', 'MIGAAA', 'AAAAxx'),
+(491, 4277, 1, 3, 1, 11, 91, 491, 491, 491, 491, 182, 183, 'XSAAAA', 'NIGAAA', 'HHHHxx'),
+(9732, 4278, 0, 0, 2, 12, 32, 732, 1732, 4732, 9732, 64, 65, 'IKAAAA', 'OIGAAA', 'OOOOxx'),
+(7067, 4279, 1, 3, 7, 7, 67, 67, 1067, 2067, 7067, 134, 135, 'VLAAAA', 'PIGAAA', 'VVVVxx'),
+(212, 4280, 0, 0, 2, 12, 12, 212, 212, 212, 212, 24, 25, 'EIAAAA', 'QIGAAA', 'AAAAxx'),
+(1955, 4281, 1, 3, 5, 15, 55, 955, 1955, 1955, 1955, 110, 111, 'FXAAAA', 'RIGAAA', 'HHHHxx'),
+(3303, 4282, 1, 3, 3, 3, 3, 303, 1303, 3303, 3303, 6, 7, 'BXAAAA', 'SIGAAA', 'OOOOxx'),
+(2715, 4283, 1, 3, 5, 15, 15, 715, 715, 2715, 2715, 30, 31, 'LAAAAA', 'TIGAAA', 'VVVVxx'),
+(8168, 4284, 0, 0, 8, 8, 68, 168, 168, 3168, 8168, 136, 137, 'ECAAAA', 'UIGAAA', 'AAAAxx'),
+(6799, 4285, 1, 3, 9, 19, 99, 799, 799, 1799, 6799, 198, 199, 'NBAAAA', 'VIGAAA', 'HHHHxx'),
+(5080, 4286, 0, 0, 0, 0, 80, 80, 1080, 80, 5080, 160, 161, 'KNAAAA', 'WIGAAA', 'OOOOxx'),
+(4939, 4287, 1, 3, 9, 19, 39, 939, 939, 4939, 4939, 78, 79, 'ZHAAAA', 'XIGAAA', 'VVVVxx'),
+(6604, 4288, 0, 0, 4, 4, 4, 604, 604, 1604, 6604, 8, 9, 'AUAAAA', 'YIGAAA', 'AAAAxx'),
+(6531, 4289, 1, 3, 1, 11, 31, 531, 531, 1531, 6531, 62, 63, 'FRAAAA', 'ZIGAAA', 'HHHHxx'),
+(9948, 4290, 0, 0, 8, 8, 48, 948, 1948, 4948, 9948, 96, 97, 'QSAAAA', 'AJGAAA', 'OOOOxx'),
+(7923, 4291, 1, 3, 3, 3, 23, 923, 1923, 2923, 7923, 46, 47, 'TSAAAA', 'BJGAAA', 'VVVVxx'),
+(9905, 4292, 1, 1, 5, 5, 5, 905, 1905, 4905, 9905, 10, 11, 'ZQAAAA', 'CJGAAA', 'AAAAxx'),
+(340, 4293, 0, 0, 0, 0, 40, 340, 340, 340, 340, 80, 81, 'CNAAAA', 'DJGAAA', 'HHHHxx'),
+(1721, 4294, 1, 1, 1, 1, 21, 721, 1721, 1721, 1721, 42, 43, 'FOAAAA', 'EJGAAA', 'OOOOxx'),
+(9047, 4295, 1, 3, 7, 7, 47, 47, 1047, 4047, 9047, 94, 95, 'ZJAAAA', 'FJGAAA', 'VVVVxx'),
+(4723, 4296, 1, 3, 3, 3, 23, 723, 723, 4723, 4723, 46, 47, 'RZAAAA', 'GJGAAA', 'AAAAxx'),
+(5748, 4297, 0, 0, 8, 8, 48, 748, 1748, 748, 5748, 96, 97, 'CNAAAA', 'HJGAAA', 'HHHHxx'),
+(6845, 4298, 1, 1, 5, 5, 45, 845, 845, 1845, 6845, 90, 91, 'HDAAAA', 'IJGAAA', 'OOOOxx'),
+(1556, 4299, 0, 0, 6, 16, 56, 556, 1556, 1556, 1556, 112, 113, 'WHAAAA', 'JJGAAA', 'VVVVxx'),
+(9505, 4300, 1, 1, 5, 5, 5, 505, 1505, 4505, 9505, 10, 11, 'PBAAAA', 'KJGAAA', 'AAAAxx'),
+(3573, 4301, 1, 1, 3, 13, 73, 573, 1573, 3573, 3573, 146, 147, 'LHAAAA', 'LJGAAA', 'HHHHxx'),
+(3785, 4302, 1, 1, 5, 5, 85, 785, 1785, 3785, 3785, 170, 171, 'PPAAAA', 'MJGAAA', 'OOOOxx'),
+(2772, 4303, 0, 0, 2, 12, 72, 772, 772, 2772, 2772, 144, 145, 'QCAAAA', 'NJGAAA', 'VVVVxx'),
+(7282, 4304, 0, 2, 2, 2, 82, 282, 1282, 2282, 7282, 164, 165, 'CUAAAA', 'OJGAAA', 'AAAAxx'),
+(8106, 4305, 0, 2, 6, 6, 6, 106, 106, 3106, 8106, 12, 13, 'UZAAAA', 'PJGAAA', 'HHHHxx'),
+(2847, 4306, 1, 3, 7, 7, 47, 847, 847, 2847, 2847, 94, 95, 'NFAAAA', 'QJGAAA', 'OOOOxx'),
+(9803, 4307, 1, 3, 3, 3, 3, 803, 1803, 4803, 9803, 6, 7, 'BNAAAA', 'RJGAAA', 'VVVVxx'),
+(7719, 4308, 1, 3, 9, 19, 19, 719, 1719, 2719, 7719, 38, 39, 'XKAAAA', 'SJGAAA', 'AAAAxx'),
+(4649, 4309, 1, 1, 9, 9, 49, 649, 649, 4649, 4649, 98, 99, 'VWAAAA', 'TJGAAA', 'HHHHxx'),
+(6196, 4310, 0, 0, 6, 16, 96, 196, 196, 1196, 6196, 192, 193, 'IEAAAA', 'UJGAAA', 'OOOOxx'),
+(6026, 4311, 0, 2, 6, 6, 26, 26, 26, 1026, 6026, 52, 53, 'UXAAAA', 'VJGAAA', 'VVVVxx'),
+(1646, 4312, 0, 2, 6, 6, 46, 646, 1646, 1646, 1646, 92, 93, 'ILAAAA', 'WJGAAA', 'AAAAxx'),
+(6526, 4313, 0, 2, 6, 6, 26, 526, 526, 1526, 6526, 52, 53, 'ARAAAA', 'XJGAAA', 'HHHHxx'),
+(5110, 4314, 0, 2, 0, 10, 10, 110, 1110, 110, 5110, 20, 21, 'OOAAAA', 'YJGAAA', 'OOOOxx'),
+(3946, 4315, 0, 2, 6, 6, 46, 946, 1946, 3946, 3946, 92, 93, 'UVAAAA', 'ZJGAAA', 'VVVVxx'),
+(445, 4316, 1, 1, 5, 5, 45, 445, 445, 445, 445, 90, 91, 'DRAAAA', 'AKGAAA', 'AAAAxx'),
+(3249, 4317, 1, 1, 9, 9, 49, 249, 1249, 3249, 3249, 98, 99, 'ZUAAAA', 'BKGAAA', 'HHHHxx'),
+(2501, 4318, 1, 1, 1, 1, 1, 501, 501, 2501, 2501, 2, 3, 'FSAAAA', 'CKGAAA', 'OOOOxx'),
+(3243, 4319, 1, 3, 3, 3, 43, 243, 1243, 3243, 3243, 86, 87, 'TUAAAA', 'DKGAAA', 'VVVVxx'),
+(4701, 4320, 1, 1, 1, 1, 1, 701, 701, 4701, 4701, 2, 3, 'VYAAAA', 'EKGAAA', 'AAAAxx'),
+(472, 4321, 0, 0, 2, 12, 72, 472, 472, 472, 472, 144, 145, 'ESAAAA', 'FKGAAA', 'HHHHxx'),
+(3356, 4322, 0, 0, 6, 16, 56, 356, 1356, 3356, 3356, 112, 113, 'CZAAAA', 'GKGAAA', 'OOOOxx'),
+(9967, 4323, 1, 3, 7, 7, 67, 967, 1967, 4967, 9967, 134, 135, 'JTAAAA', 'HKGAAA', 'VVVVxx'),
+(4292, 4324, 0, 0, 2, 12, 92, 292, 292, 4292, 4292, 184, 185, 'CJAAAA', 'IKGAAA', 'AAAAxx'),
+(7005, 4325, 1, 1, 5, 5, 5, 5, 1005, 2005, 7005, 10, 11, 'LJAAAA', 'JKGAAA', 'HHHHxx'),
+(6267, 4326, 1, 3, 7, 7, 67, 267, 267, 1267, 6267, 134, 135, 'BHAAAA', 'KKGAAA', 'OOOOxx'),
+(6678, 4327, 0, 2, 8, 18, 78, 678, 678, 1678, 6678, 156, 157, 'WWAAAA', 'LKGAAA', 'VVVVxx'),
+(6083, 4328, 1, 3, 3, 3, 83, 83, 83, 1083, 6083, 166, 167, 'ZZAAAA', 'MKGAAA', 'AAAAxx'),
+(760, 4329, 0, 0, 0, 0, 60, 760, 760, 760, 760, 120, 121, 'GDAAAA', 'NKGAAA', 'HHHHxx'),
+(7833, 4330, 1, 1, 3, 13, 33, 833, 1833, 2833, 7833, 66, 67, 'HPAAAA', 'OKGAAA', 'OOOOxx'),
+(2877, 4331, 1, 1, 7, 17, 77, 877, 877, 2877, 2877, 154, 155, 'RGAAAA', 'PKGAAA', 'VVVVxx'),
+(8810, 4332, 0, 2, 0, 10, 10, 810, 810, 3810, 8810, 20, 21, 'WAAAAA', 'QKGAAA', 'AAAAxx'),
+(1560, 4333, 0, 0, 0, 0, 60, 560, 1560, 1560, 1560, 120, 121, 'AIAAAA', 'RKGAAA', 'HHHHxx'),
+(1367, 4334, 1, 3, 7, 7, 67, 367, 1367, 1367, 1367, 134, 135, 'PAAAAA', 'SKGAAA', 'OOOOxx'),
+(8756, 4335, 0, 0, 6, 16, 56, 756, 756, 3756, 8756, 112, 113, 'UYAAAA', 'TKGAAA', 'VVVVxx'),
+(1346, 4336, 0, 2, 6, 6, 46, 346, 1346, 1346, 1346, 92, 93, 'UZAAAA', 'UKGAAA', 'AAAAxx'),
+(6449, 4337, 1, 1, 9, 9, 49, 449, 449, 1449, 6449, 98, 99, 'BOAAAA', 'VKGAAA', 'HHHHxx'),
+(6658, 4338, 0, 2, 8, 18, 58, 658, 658, 1658, 6658, 116, 117, 'CWAAAA', 'WKGAAA', 'OOOOxx'),
+(6745, 4339, 1, 1, 5, 5, 45, 745, 745, 1745, 6745, 90, 91, 'LZAAAA', 'XKGAAA', 'VVVVxx'),
+(4866, 4340, 0, 2, 6, 6, 66, 866, 866, 4866, 4866, 132, 133, 'EFAAAA', 'YKGAAA', 'AAAAxx'),
+(14, 4341, 0, 2, 4, 14, 14, 14, 14, 14, 14, 28, 29, 'OAAAAA', 'ZKGAAA', 'HHHHxx'),
+(4506, 4342, 0, 2, 6, 6, 6, 506, 506, 4506, 4506, 12, 13, 'IRAAAA', 'ALGAAA', 'OOOOxx'),
+(1923, 4343, 1, 3, 3, 3, 23, 923, 1923, 1923, 1923, 46, 47, 'ZVAAAA', 'BLGAAA', 'VVVVxx'),
+(8365, 4344, 1, 1, 5, 5, 65, 365, 365, 3365, 8365, 130, 131, 'TJAAAA', 'CLGAAA', 'AAAAxx'),
+(1279, 4345, 1, 3, 9, 19, 79, 279, 1279, 1279, 1279, 158, 159, 'FXAAAA', 'DLGAAA', 'HHHHxx'),
+(7666, 4346, 0, 2, 6, 6, 66, 666, 1666, 2666, 7666, 132, 133, 'WIAAAA', 'ELGAAA', 'OOOOxx'),
+(7404, 4347, 0, 0, 4, 4, 4, 404, 1404, 2404, 7404, 8, 9, 'UYAAAA', 'FLGAAA', 'VVVVxx'),
+(65, 4348, 1, 1, 5, 5, 65, 65, 65, 65, 65, 130, 131, 'NCAAAA', 'GLGAAA', 'AAAAxx'),
+(5820, 4349, 0, 0, 0, 0, 20, 820, 1820, 820, 5820, 40, 41, 'WPAAAA', 'HLGAAA', 'HHHHxx'),
+(459, 4350, 1, 3, 9, 19, 59, 459, 459, 459, 459, 118, 119, 'RRAAAA', 'ILGAAA', 'OOOOxx'),
+(4787, 4351, 1, 3, 7, 7, 87, 787, 787, 4787, 4787, 174, 175, 'DCAAAA', 'JLGAAA', 'VVVVxx'),
+(5631, 4352, 1, 3, 1, 11, 31, 631, 1631, 631, 5631, 62, 63, 'PIAAAA', 'KLGAAA', 'AAAAxx'),
+(9717, 4353, 1, 1, 7, 17, 17, 717, 1717, 4717, 9717, 34, 35, 'TJAAAA', 'LLGAAA', 'HHHHxx'),
+(2560, 4354, 0, 0, 0, 0, 60, 560, 560, 2560, 2560, 120, 121, 'MUAAAA', 'MLGAAA', 'OOOOxx'),
+(8295, 4355, 1, 3, 5, 15, 95, 295, 295, 3295, 8295, 190, 191, 'BHAAAA', 'NLGAAA', 'VVVVxx'),
+(3596, 4356, 0, 0, 6, 16, 96, 596, 1596, 3596, 3596, 192, 193, 'IIAAAA', 'OLGAAA', 'AAAAxx'),
+(2023, 4357, 1, 3, 3, 3, 23, 23, 23, 2023, 2023, 46, 47, 'VZAAAA', 'PLGAAA', 'HHHHxx'),
+(5055, 4358, 1, 3, 5, 15, 55, 55, 1055, 55, 5055, 110, 111, 'LMAAAA', 'QLGAAA', 'OOOOxx'),
+(763, 4359, 1, 3, 3, 3, 63, 763, 763, 763, 763, 126, 127, 'JDAAAA', 'RLGAAA', 'VVVVxx'),
+(6733, 4360, 1, 1, 3, 13, 33, 733, 733, 1733, 6733, 66, 67, 'ZYAAAA', 'SLGAAA', 'AAAAxx'),
+(9266, 4361, 0, 2, 6, 6, 66, 266, 1266, 4266, 9266, 132, 133, 'KSAAAA', 'TLGAAA', 'HHHHxx'),
+(4479, 4362, 1, 3, 9, 19, 79, 479, 479, 4479, 4479, 158, 159, 'HQAAAA', 'ULGAAA', 'OOOOxx'),
+(1816, 4363, 0, 0, 6, 16, 16, 816, 1816, 1816, 1816, 32, 33, 'WRAAAA', 'VLGAAA', 'VVVVxx'),
+(899, 4364, 1, 3, 9, 19, 99, 899, 899, 899, 899, 198, 199, 'PIAAAA', 'WLGAAA', 'AAAAxx'),
+(230, 4365, 0, 2, 0, 10, 30, 230, 230, 230, 230, 60, 61, 'WIAAAA', 'XLGAAA', 'HHHHxx'),
+(5362, 4366, 0, 2, 2, 2, 62, 362, 1362, 362, 5362, 124, 125, 'GYAAAA', 'YLGAAA', 'OOOOxx'),
+(1609, 4367, 1, 1, 9, 9, 9, 609, 1609, 1609, 1609, 18, 19, 'XJAAAA', 'ZLGAAA', 'VVVVxx'),
+(6750, 4368, 0, 2, 0, 10, 50, 750, 750, 1750, 6750, 100, 101, 'QZAAAA', 'AMGAAA', 'AAAAxx'),
+(9704, 4369, 0, 0, 4, 4, 4, 704, 1704, 4704, 9704, 8, 9, 'GJAAAA', 'BMGAAA', 'HHHHxx'),
+(3991, 4370, 1, 3, 1, 11, 91, 991, 1991, 3991, 3991, 182, 183, 'NXAAAA', 'CMGAAA', 'OOOOxx'),
+(3959, 4371, 1, 3, 9, 19, 59, 959, 1959, 3959, 3959, 118, 119, 'HWAAAA', 'DMGAAA', 'VVVVxx'),
+(9021, 4372, 1, 1, 1, 1, 21, 21, 1021, 4021, 9021, 42, 43, 'ZIAAAA', 'EMGAAA', 'AAAAxx'),
+(7585, 4373, 1, 1, 5, 5, 85, 585, 1585, 2585, 7585, 170, 171, 'TFAAAA', 'FMGAAA', 'HHHHxx'),
+(7083, 4374, 1, 3, 3, 3, 83, 83, 1083, 2083, 7083, 166, 167, 'LMAAAA', 'GMGAAA', 'OOOOxx'),
+(7688, 4375, 0, 0, 8, 8, 88, 688, 1688, 2688, 7688, 176, 177, 'SJAAAA', 'HMGAAA', 'VVVVxx'),
+(2673, 4376, 1, 1, 3, 13, 73, 673, 673, 2673, 2673, 146, 147, 'VYAAAA', 'IMGAAA', 'AAAAxx'),
+(3554, 4377, 0, 2, 4, 14, 54, 554, 1554, 3554, 3554, 108, 109, 'SGAAAA', 'JMGAAA', 'HHHHxx'),
+(7416, 4378, 0, 0, 6, 16, 16, 416, 1416, 2416, 7416, 32, 33, 'GZAAAA', 'KMGAAA', 'OOOOxx'),
+(5672, 4379, 0, 0, 2, 12, 72, 672, 1672, 672, 5672, 144, 145, 'EKAAAA', 'LMGAAA', 'VVVVxx'),
+(1355, 4380, 1, 3, 5, 15, 55, 355, 1355, 1355, 1355, 110, 111, 'DAAAAA', 'MMGAAA', 'AAAAxx'),
+(3149, 4381, 1, 1, 9, 9, 49, 149, 1149, 3149, 3149, 98, 99, 'DRAAAA', 'NMGAAA', 'HHHHxx'),
+(5811, 4382, 1, 3, 1, 11, 11, 811, 1811, 811, 5811, 22, 23, 'NPAAAA', 'OMGAAA', 'OOOOxx'),
+(3759, 4383, 1, 3, 9, 19, 59, 759, 1759, 3759, 3759, 118, 119, 'POAAAA', 'PMGAAA', 'VVVVxx'),
+(5634, 4384, 0, 2, 4, 14, 34, 634, 1634, 634, 5634, 68, 69, 'SIAAAA', 'QMGAAA', 'AAAAxx'),
+(8617, 4385, 1, 1, 7, 17, 17, 617, 617, 3617, 8617, 34, 35, 'LTAAAA', 'RMGAAA', 'HHHHxx'),
+(8949, 4386, 1, 1, 9, 9, 49, 949, 949, 3949, 8949, 98, 99, 'FGAAAA', 'SMGAAA', 'OOOOxx'),
+(3964, 4387, 0, 0, 4, 4, 64, 964, 1964, 3964, 3964, 128, 129, 'MWAAAA', 'TMGAAA', 'VVVVxx'),
+(3852, 4388, 0, 0, 2, 12, 52, 852, 1852, 3852, 3852, 104, 105, 'ESAAAA', 'UMGAAA', 'AAAAxx'),
+(1555, 4389, 1, 3, 5, 15, 55, 555, 1555, 1555, 1555, 110, 111, 'VHAAAA', 'VMGAAA', 'HHHHxx'),
+(6536, 4390, 0, 0, 6, 16, 36, 536, 536, 1536, 6536, 72, 73, 'KRAAAA', 'WMGAAA', 'OOOOxx'),
+(4779, 4391, 1, 3, 9, 19, 79, 779, 779, 4779, 4779, 158, 159, 'VBAAAA', 'XMGAAA', 'VVVVxx'),
+(1893, 4392, 1, 1, 3, 13, 93, 893, 1893, 1893, 1893, 186, 187, 'VUAAAA', 'YMGAAA', 'AAAAxx'),
+(9358, 4393, 0, 2, 8, 18, 58, 358, 1358, 4358, 9358, 116, 117, 'YVAAAA', 'ZMGAAA', 'HHHHxx'),
+(7438, 4394, 0, 2, 8, 18, 38, 438, 1438, 2438, 7438, 76, 77, 'CAAAAA', 'ANGAAA', 'OOOOxx'),
+(941, 4395, 1, 1, 1, 1, 41, 941, 941, 941, 941, 82, 83, 'FKAAAA', 'BNGAAA', 'VVVVxx'),
+(4844, 4396, 0, 0, 4, 4, 44, 844, 844, 4844, 4844, 88, 89, 'IEAAAA', 'CNGAAA', 'AAAAxx'),
+(4745, 4397, 1, 1, 5, 5, 45, 745, 745, 4745, 4745, 90, 91, 'NAAAAA', 'DNGAAA', 'HHHHxx'),
+(1017, 4398, 1, 1, 7, 17, 17, 17, 1017, 1017, 1017, 34, 35, 'DNAAAA', 'ENGAAA', 'OOOOxx'),
+(327, 4399, 1, 3, 7, 7, 27, 327, 327, 327, 327, 54, 55, 'PMAAAA', 'FNGAAA', 'VVVVxx'),
+(3152, 4400, 0, 0, 2, 12, 52, 152, 1152, 3152, 3152, 104, 105, 'GRAAAA', 'GNGAAA', 'AAAAxx'),
+(4711, 4401, 1, 3, 1, 11, 11, 711, 711, 4711, 4711, 22, 23, 'FZAAAA', 'HNGAAA', 'HHHHxx'),
+(141, 4402, 1, 1, 1, 1, 41, 141, 141, 141, 141, 82, 83, 'LFAAAA', 'INGAAA', 'OOOOxx'),
+(1303, 4403, 1, 3, 3, 3, 3, 303, 1303, 1303, 1303, 6, 7, 'DYAAAA', 'JNGAAA', 'VVVVxx'),
+(8873, 4404, 1, 1, 3, 13, 73, 873, 873, 3873, 8873, 146, 147, 'HDAAAA', 'KNGAAA', 'AAAAxx'),
+(8481, 4405, 1, 1, 1, 1, 81, 481, 481, 3481, 8481, 162, 163, 'FOAAAA', 'LNGAAA', 'HHHHxx'),
+(5445, 4406, 1, 1, 5, 5, 45, 445, 1445, 445, 5445, 90, 91, 'LBAAAA', 'MNGAAA', 'OOOOxx'),
+(7868, 4407, 0, 0, 8, 8, 68, 868, 1868, 2868, 7868, 136, 137, 'QQAAAA', 'NNGAAA', 'VVVVxx'),
+(6722, 4408, 0, 2, 2, 2, 22, 722, 722, 1722, 6722, 44, 45, 'OYAAAA', 'ONGAAA', 'AAAAxx'),
+(6628, 4409, 0, 0, 8, 8, 28, 628, 628, 1628, 6628, 56, 57, 'YUAAAA', 'PNGAAA', 'HHHHxx'),
+(7738, 4410, 0, 2, 8, 18, 38, 738, 1738, 2738, 7738, 76, 77, 'QLAAAA', 'QNGAAA', 'OOOOxx'),
+(1018, 4411, 0, 2, 8, 18, 18, 18, 1018, 1018, 1018, 36, 37, 'ENAAAA', 'RNGAAA', 'VVVVxx'),
+(3296, 4412, 0, 0, 6, 16, 96, 296, 1296, 3296, 3296, 192, 193, 'UWAAAA', 'SNGAAA', 'AAAAxx'),
+(1946, 4413, 0, 2, 6, 6, 46, 946, 1946, 1946, 1946, 92, 93, 'WWAAAA', 'TNGAAA', 'HHHHxx'),
+(6603, 4414, 1, 3, 3, 3, 3, 603, 603, 1603, 6603, 6, 7, 'ZTAAAA', 'UNGAAA', 'OOOOxx'),
+(3562, 4415, 0, 2, 2, 2, 62, 562, 1562, 3562, 3562, 124, 125, 'AHAAAA', 'VNGAAA', 'VVVVxx'),
+(1147, 4416, 1, 3, 7, 7, 47, 147, 1147, 1147, 1147, 94, 95, 'DSAAAA', 'WNGAAA', 'AAAAxx'),
+(6031, 4417, 1, 3, 1, 11, 31, 31, 31, 1031, 6031, 62, 63, 'ZXAAAA', 'XNGAAA', 'HHHHxx'),
+(6484, 4418, 0, 0, 4, 4, 84, 484, 484, 1484, 6484, 168, 169, 'KPAAAA', 'YNGAAA', 'OOOOxx'),
+(496, 4419, 0, 0, 6, 16, 96, 496, 496, 496, 496, 192, 193, 'CTAAAA', 'ZNGAAA', 'VVVVxx'),
+(4563, 4420, 1, 3, 3, 3, 63, 563, 563, 4563, 4563, 126, 127, 'NTAAAA', 'AOGAAA', 'AAAAxx'),
+(1037, 4421, 1, 1, 7, 17, 37, 37, 1037, 1037, 1037, 74, 75, 'XNAAAA', 'BOGAAA', 'HHHHxx'),
+(9672, 4422, 0, 0, 2, 12, 72, 672, 1672, 4672, 9672, 144, 145, 'AIAAAA', 'COGAAA', 'OOOOxx'),
+(9053, 4423, 1, 1, 3, 13, 53, 53, 1053, 4053, 9053, 106, 107, 'FKAAAA', 'DOGAAA', 'VVVVxx'),
+(2523, 4424, 1, 3, 3, 3, 23, 523, 523, 2523, 2523, 46, 47, 'BTAAAA', 'EOGAAA', 'AAAAxx'),
+(8519, 4425, 1, 3, 9, 19, 19, 519, 519, 3519, 8519, 38, 39, 'RPAAAA', 'FOGAAA', 'HHHHxx'),
+(8190, 4426, 0, 2, 0, 10, 90, 190, 190, 3190, 8190, 180, 181, 'ADAAAA', 'GOGAAA', 'OOOOxx'),
+(2068, 4427, 0, 0, 8, 8, 68, 68, 68, 2068, 2068, 136, 137, 'OBAAAA', 'HOGAAA', 'VVVVxx'),
+(8569, 4428, 1, 1, 9, 9, 69, 569, 569, 3569, 8569, 138, 139, 'PRAAAA', 'IOGAAA', 'AAAAxx'),
+(6535, 4429, 1, 3, 5, 15, 35, 535, 535, 1535, 6535, 70, 71, 'JRAAAA', 'JOGAAA', 'HHHHxx'),
+(1810, 4430, 0, 2, 0, 10, 10, 810, 1810, 1810, 1810, 20, 21, 'QRAAAA', 'KOGAAA', 'OOOOxx'),
+(3099, 4431, 1, 3, 9, 19, 99, 99, 1099, 3099, 3099, 198, 199, 'FPAAAA', 'LOGAAA', 'VVVVxx'),
+(7466, 4432, 0, 2, 6, 6, 66, 466, 1466, 2466, 7466, 132, 133, 'EBAAAA', 'MOGAAA', 'AAAAxx'),
+(4017, 4433, 1, 1, 7, 17, 17, 17, 17, 4017, 4017, 34, 35, 'NYAAAA', 'NOGAAA', 'HHHHxx'),
+(1097, 4434, 1, 1, 7, 17, 97, 97, 1097, 1097, 1097, 194, 195, 'FQAAAA', 'OOGAAA', 'OOOOxx'),
+(7686, 4435, 0, 2, 6, 6, 86, 686, 1686, 2686, 7686, 172, 173, 'QJAAAA', 'POGAAA', 'VVVVxx'),
+(6742, 4436, 0, 2, 2, 2, 42, 742, 742, 1742, 6742, 84, 85, 'IZAAAA', 'QOGAAA', 'AAAAxx'),
+(5966, 4437, 0, 2, 6, 6, 66, 966, 1966, 966, 5966, 132, 133, 'MVAAAA', 'ROGAAA', 'HHHHxx'),
+(3632, 4438, 0, 0, 2, 12, 32, 632, 1632, 3632, 3632, 64, 65, 'SJAAAA', 'SOGAAA', 'OOOOxx'),
+(8837, 4439, 1, 1, 7, 17, 37, 837, 837, 3837, 8837, 74, 75, 'XBAAAA', 'TOGAAA', 'VVVVxx'),
+(1667, 4440, 1, 3, 7, 7, 67, 667, 1667, 1667, 1667, 134, 135, 'DMAAAA', 'UOGAAA', 'AAAAxx'),
+(8833, 4441, 1, 1, 3, 13, 33, 833, 833, 3833, 8833, 66, 67, 'TBAAAA', 'VOGAAA', 'HHHHxx'),
+(9805, 4442, 1, 1, 5, 5, 5, 805, 1805, 4805, 9805, 10, 11, 'DNAAAA', 'WOGAAA', 'OOOOxx'),
+(3650, 4443, 0, 2, 0, 10, 50, 650, 1650, 3650, 3650, 100, 101, 'KKAAAA', 'XOGAAA', 'VVVVxx'),
+(2237, 4444, 1, 1, 7, 17, 37, 237, 237, 2237, 2237, 74, 75, 'BIAAAA', 'YOGAAA', 'AAAAxx'),
+(9980, 4445, 0, 0, 0, 0, 80, 980, 1980, 4980, 9980, 160, 161, 'WTAAAA', 'ZOGAAA', 'HHHHxx'),
+(2861, 4446, 1, 1, 1, 1, 61, 861, 861, 2861, 2861, 122, 123, 'BGAAAA', 'APGAAA', 'OOOOxx'),
+(1334, 4447, 0, 2, 4, 14, 34, 334, 1334, 1334, 1334, 68, 69, 'IZAAAA', 'BPGAAA', 'VVVVxx'),
+(842, 4448, 0, 2, 2, 2, 42, 842, 842, 842, 842, 84, 85, 'KGAAAA', 'CPGAAA', 'AAAAxx'),
+(1116, 4449, 0, 0, 6, 16, 16, 116, 1116, 1116, 1116, 32, 33, 'YQAAAA', 'DPGAAA', 'HHHHxx'),
+(4055, 4450, 1, 3, 5, 15, 55, 55, 55, 4055, 4055, 110, 111, 'ZZAAAA', 'EPGAAA', 'OOOOxx'),
+(3842, 4451, 0, 2, 2, 2, 42, 842, 1842, 3842, 3842, 84, 85, 'URAAAA', 'FPGAAA', 'VVVVxx'),
+(1886, 4452, 0, 2, 6, 6, 86, 886, 1886, 1886, 1886, 172, 173, 'OUAAAA', 'GPGAAA', 'AAAAxx'),
+(8589, 4453, 1, 1, 9, 9, 89, 589, 589, 3589, 8589, 178, 179, 'JSAAAA', 'HPGAAA', 'HHHHxx'),
+(5873, 4454, 1, 1, 3, 13, 73, 873, 1873, 873, 5873, 146, 147, 'XRAAAA', 'IPGAAA', 'OOOOxx'),
+(7711, 4455, 1, 3, 1, 11, 11, 711, 1711, 2711, 7711, 22, 23, 'PKAAAA', 'JPGAAA', 'VVVVxx'),
+(911, 4456, 1, 3, 1, 11, 11, 911, 911, 911, 911, 22, 23, 'BJAAAA', 'KPGAAA', 'AAAAxx'),
+(5837, 4457, 1, 1, 7, 17, 37, 837, 1837, 837, 5837, 74, 75, 'NQAAAA', 'LPGAAA', 'HHHHxx'),
+(897, 4458, 1, 1, 7, 17, 97, 897, 897, 897, 897, 194, 195, 'NIAAAA', 'MPGAAA', 'OOOOxx'),
+(4299, 4459, 1, 3, 9, 19, 99, 299, 299, 4299, 4299, 198, 199, 'JJAAAA', 'NPGAAA', 'VVVVxx'),
+(7774, 4460, 0, 2, 4, 14, 74, 774, 1774, 2774, 7774, 148, 149, 'ANAAAA', 'OPGAAA', 'AAAAxx'),
+(7832, 4461, 0, 0, 2, 12, 32, 832, 1832, 2832, 7832, 64, 65, 'GPAAAA', 'PPGAAA', 'HHHHxx'),
+(9915, 4462, 1, 3, 5, 15, 15, 915, 1915, 4915, 9915, 30, 31, 'JRAAAA', 'QPGAAA', 'OOOOxx'),
+(9, 4463, 1, 1, 9, 9, 9, 9, 9, 9, 9, 18, 19, 'JAAAAA', 'RPGAAA', 'VVVVxx'),
+(9675, 4464, 1, 3, 5, 15, 75, 675, 1675, 4675, 9675, 150, 151, 'DIAAAA', 'SPGAAA', 'AAAAxx'),
+(7953, 4465, 1, 1, 3, 13, 53, 953, 1953, 2953, 7953, 106, 107, 'XTAAAA', 'TPGAAA', 'HHHHxx'),
+(8912, 4466, 0, 0, 2, 12, 12, 912, 912, 3912, 8912, 24, 25, 'UEAAAA', 'UPGAAA', 'OOOOxx'),
+(4188, 4467, 0, 0, 8, 8, 88, 188, 188, 4188, 4188, 176, 177, 'CFAAAA', 'VPGAAA', 'VVVVxx'),
+(8446, 4468, 0, 2, 6, 6, 46, 446, 446, 3446, 8446, 92, 93, 'WMAAAA', 'WPGAAA', 'AAAAxx'),
+(1600, 4469, 0, 0, 0, 0, 0, 600, 1600, 1600, 1600, 0, 1, 'OJAAAA', 'XPGAAA', 'HHHHxx'),
+(43, 4470, 1, 3, 3, 3, 43, 43, 43, 43, 43, 86, 87, 'RBAAAA', 'YPGAAA', 'OOOOxx'),
+(544, 4471, 0, 0, 4, 4, 44, 544, 544, 544, 544, 88, 89, 'YUAAAA', 'ZPGAAA', 'VVVVxx'),
+(6977, 4472, 1, 1, 7, 17, 77, 977, 977, 1977, 6977, 154, 155, 'JIAAAA', 'AQGAAA', 'AAAAxx'),
+(3191, 4473, 1, 3, 1, 11, 91, 191, 1191, 3191, 3191, 182, 183, 'TSAAAA', 'BQGAAA', 'HHHHxx'),
+(418, 4474, 0, 2, 8, 18, 18, 418, 418, 418, 418, 36, 37, 'CQAAAA', 'CQGAAA', 'OOOOxx'),
+(3142, 4475, 0, 2, 2, 2, 42, 142, 1142, 3142, 3142, 84, 85, 'WQAAAA', 'DQGAAA', 'VVVVxx'),
+(5042, 4476, 0, 2, 2, 2, 42, 42, 1042, 42, 5042, 84, 85, 'YLAAAA', 'EQGAAA', 'AAAAxx'),
+(2194, 4477, 0, 2, 4, 14, 94, 194, 194, 2194, 2194, 188, 189, 'KGAAAA', 'FQGAAA', 'HHHHxx'),
+(2397, 4478, 1, 1, 7, 17, 97, 397, 397, 2397, 2397, 194, 195, 'FOAAAA', 'GQGAAA', 'OOOOxx'),
+(4684, 4479, 0, 0, 4, 4, 84, 684, 684, 4684, 4684, 168, 169, 'EYAAAA', 'HQGAAA', 'VVVVxx'),
+(34, 4480, 0, 2, 4, 14, 34, 34, 34, 34, 34, 68, 69, 'IBAAAA', 'IQGAAA', 'AAAAxx'),
+(3844, 4481, 0, 0, 4, 4, 44, 844, 1844, 3844, 3844, 88, 89, 'WRAAAA', 'JQGAAA', 'HHHHxx'),
+(7824, 4482, 0, 0, 4, 4, 24, 824, 1824, 2824, 7824, 48, 49, 'YOAAAA', 'KQGAAA', 'OOOOxx'),
+(6177, 4483, 1, 1, 7, 17, 77, 177, 177, 1177, 6177, 154, 155, 'PDAAAA', 'LQGAAA', 'VVVVxx'),
+(9657, 4484, 1, 1, 7, 17, 57, 657, 1657, 4657, 9657, 114, 115, 'LHAAAA', 'MQGAAA', 'AAAAxx'),
+(4546, 4485, 0, 2, 6, 6, 46, 546, 546, 4546, 4546, 92, 93, 'WSAAAA', 'NQGAAA', 'HHHHxx'),
+(599, 4486, 1, 3, 9, 19, 99, 599, 599, 599, 599, 198, 199, 'BXAAAA', 'OQGAAA', 'OOOOxx'),
+(153, 4487, 1, 1, 3, 13, 53, 153, 153, 153, 153, 106, 107, 'XFAAAA', 'PQGAAA', 'VVVVxx'),
+(6910, 4488, 0, 2, 0, 10, 10, 910, 910, 1910, 6910, 20, 21, 'UFAAAA', 'QQGAAA', 'AAAAxx'),
+(4408, 4489, 0, 0, 8, 8, 8, 408, 408, 4408, 4408, 16, 17, 'ONAAAA', 'RQGAAA', 'HHHHxx'),
+(1164, 4490, 0, 0, 4, 4, 64, 164, 1164, 1164, 1164, 128, 129, 'USAAAA', 'SQGAAA', 'OOOOxx'),
+(6469, 4491, 1, 1, 9, 9, 69, 469, 469, 1469, 6469, 138, 139, 'VOAAAA', 'TQGAAA', 'VVVVxx'),
+(5996, 4492, 0, 0, 6, 16, 96, 996, 1996, 996, 5996, 192, 193, 'QWAAAA', 'UQGAAA', 'AAAAxx'),
+(2639, 4493, 1, 3, 9, 19, 39, 639, 639, 2639, 2639, 78, 79, 'NXAAAA', 'VQGAAA', 'HHHHxx'),
+(2678, 4494, 0, 2, 8, 18, 78, 678, 678, 2678, 2678, 156, 157, 'AZAAAA', 'WQGAAA', 'OOOOxx'),
+(8392, 4495, 0, 0, 2, 12, 92, 392, 392, 3392, 8392, 184, 185, 'UKAAAA', 'XQGAAA', 'VVVVxx'),
+(1386, 4496, 0, 2, 6, 6, 86, 386, 1386, 1386, 1386, 172, 173, 'IBAAAA', 'YQGAAA', 'AAAAxx'),
+(5125, 4497, 1, 1, 5, 5, 25, 125, 1125, 125, 5125, 50, 51, 'DPAAAA', 'ZQGAAA', 'HHHHxx'),
+(8453, 4498, 1, 1, 3, 13, 53, 453, 453, 3453, 8453, 106, 107, 'DNAAAA', 'ARGAAA', 'OOOOxx'),
+(2369, 4499, 1, 1, 9, 9, 69, 369, 369, 2369, 2369, 138, 139, 'DNAAAA', 'BRGAAA', 'VVVVxx'),
+(1608, 4500, 0, 0, 8, 8, 8, 608, 1608, 1608, 1608, 16, 17, 'WJAAAA', 'CRGAAA', 'AAAAxx'),
+(3781, 4501, 1, 1, 1, 1, 81, 781, 1781, 3781, 3781, 162, 163, 'LPAAAA', 'DRGAAA', 'HHHHxx'),
+(903, 4502, 1, 3, 3, 3, 3, 903, 903, 903, 903, 6, 7, 'TIAAAA', 'ERGAAA', 'OOOOxx'),
+(2099, 4503, 1, 3, 9, 19, 99, 99, 99, 2099, 2099, 198, 199, 'TCAAAA', 'FRGAAA', 'VVVVxx'),
+(538, 4504, 0, 2, 8, 18, 38, 538, 538, 538, 538, 76, 77, 'SUAAAA', 'GRGAAA', 'AAAAxx'),
+(9177, 4505, 1, 1, 7, 17, 77, 177, 1177, 4177, 9177, 154, 155, 'ZOAAAA', 'HRGAAA', 'HHHHxx'),
+(420, 4506, 0, 0, 0, 0, 20, 420, 420, 420, 420, 40, 41, 'EQAAAA', 'IRGAAA', 'OOOOxx'),
+(9080, 4507, 0, 0, 0, 0, 80, 80, 1080, 4080, 9080, 160, 161, 'GLAAAA', 'JRGAAA', 'VVVVxx'),
+(2630, 4508, 0, 2, 0, 10, 30, 630, 630, 2630, 2630, 60, 61, 'EXAAAA', 'KRGAAA', 'AAAAxx'),
+(5978, 4509, 0, 2, 8, 18, 78, 978, 1978, 978, 5978, 156, 157, 'YVAAAA', 'LRGAAA', 'HHHHxx'),
+(9239, 4510, 1, 3, 9, 19, 39, 239, 1239, 4239, 9239, 78, 79, 'JRAAAA', 'MRGAAA', 'OOOOxx'),
+(4372, 4511, 0, 0, 2, 12, 72, 372, 372, 4372, 4372, 144, 145, 'EMAAAA', 'NRGAAA', 'VVVVxx'),
+(4357, 4512, 1, 1, 7, 17, 57, 357, 357, 4357, 4357, 114, 115, 'PLAAAA', 'ORGAAA', 'AAAAxx'),
+(9857, 4513, 1, 1, 7, 17, 57, 857, 1857, 4857, 9857, 114, 115, 'DPAAAA', 'PRGAAA', 'HHHHxx'),
+(7933, 4514, 1, 1, 3, 13, 33, 933, 1933, 2933, 7933, 66, 67, 'DTAAAA', 'QRGAAA', 'OOOOxx'),
+(9574, 4515, 0, 2, 4, 14, 74, 574, 1574, 4574, 9574, 148, 149, 'GEAAAA', 'RRGAAA', 'VVVVxx'),
+(8294, 4516, 0, 2, 4, 14, 94, 294, 294, 3294, 8294, 188, 189, 'AHAAAA', 'SRGAAA', 'AAAAxx'),
+(627, 4517, 1, 3, 7, 7, 27, 627, 627, 627, 627, 54, 55, 'DYAAAA', 'TRGAAA', 'HHHHxx'),
+(3229, 4518, 1, 1, 9, 9, 29, 229, 1229, 3229, 3229, 58, 59, 'FUAAAA', 'URGAAA', 'OOOOxx'),
+(3163, 4519, 1, 3, 3, 3, 63, 163, 1163, 3163, 3163, 126, 127, 'RRAAAA', 'VRGAAA', 'VVVVxx'),
+(7349, 4520, 1, 1, 9, 9, 49, 349, 1349, 2349, 7349, 98, 99, 'RWAAAA', 'WRGAAA', 'AAAAxx'),
+(6889, 4521, 1, 1, 9, 9, 89, 889, 889, 1889, 6889, 178, 179, 'ZEAAAA', 'XRGAAA', 'HHHHxx'),
+(2101, 4522, 1, 1, 1, 1, 1, 101, 101, 2101, 2101, 2, 3, 'VCAAAA', 'YRGAAA', 'OOOOxx'),
+(6476, 4523, 0, 0, 6, 16, 76, 476, 476, 1476, 6476, 152, 153, 'CPAAAA', 'ZRGAAA', 'VVVVxx'),
+(6765, 4524, 1, 1, 5, 5, 65, 765, 765, 1765, 6765, 130, 131, 'FAAAAA', 'ASGAAA', 'AAAAxx'),
+(4204, 4525, 0, 0, 4, 4, 4, 204, 204, 4204, 4204, 8, 9, 'SFAAAA', 'BSGAAA', 'HHHHxx'),
+(5915, 4526, 1, 3, 5, 15, 15, 915, 1915, 915, 5915, 30, 31, 'NTAAAA', 'CSGAAA', 'OOOOxx'),
+(2318, 4527, 0, 2, 8, 18, 18, 318, 318, 2318, 2318, 36, 37, 'ELAAAA', 'DSGAAA', 'VVVVxx'),
+(294, 4528, 0, 2, 4, 14, 94, 294, 294, 294, 294, 188, 189, 'ILAAAA', 'ESGAAA', 'AAAAxx'),
+(5245, 4529, 1, 1, 5, 5, 45, 245, 1245, 245, 5245, 90, 91, 'TTAAAA', 'FSGAAA', 'HHHHxx'),
+(4481, 4530, 1, 1, 1, 1, 81, 481, 481, 4481, 4481, 162, 163, 'JQAAAA', 'GSGAAA', 'OOOOxx'),
+(7754, 4531, 0, 2, 4, 14, 54, 754, 1754, 2754, 7754, 108, 109, 'GMAAAA', 'HSGAAA', 'VVVVxx'),
+(8494, 4532, 0, 2, 4, 14, 94, 494, 494, 3494, 8494, 188, 189, 'SOAAAA', 'ISGAAA', 'AAAAxx'),
+(4014, 4533, 0, 2, 4, 14, 14, 14, 14, 4014, 4014, 28, 29, 'KYAAAA', 'JSGAAA', 'HHHHxx'),
+(2197, 4534, 1, 1, 7, 17, 97, 197, 197, 2197, 2197, 194, 195, 'NGAAAA', 'KSGAAA', 'OOOOxx'),
+(1297, 4535, 1, 1, 7, 17, 97, 297, 1297, 1297, 1297, 194, 195, 'XXAAAA', 'LSGAAA', 'VVVVxx'),
+(1066, 4536, 0, 2, 6, 6, 66, 66, 1066, 1066, 1066, 132, 133, 'APAAAA', 'MSGAAA', 'AAAAxx'),
+(5710, 4537, 0, 2, 0, 10, 10, 710, 1710, 710, 5710, 20, 21, 'QLAAAA', 'NSGAAA', 'HHHHxx'),
+(4100, 4538, 0, 0, 0, 0, 0, 100, 100, 4100, 4100, 0, 1, 'SBAAAA', 'OSGAAA', 'OOOOxx'),
+(7356, 4539, 0, 0, 6, 16, 56, 356, 1356, 2356, 7356, 112, 113, 'YWAAAA', 'PSGAAA', 'VVVVxx'),
+(7658, 4540, 0, 2, 8, 18, 58, 658, 1658, 2658, 7658, 116, 117, 'OIAAAA', 'QSGAAA', 'AAAAxx'),
+(3666, 4541, 0, 2, 6, 6, 66, 666, 1666, 3666, 3666, 132, 133, 'ALAAAA', 'RSGAAA', 'HHHHxx'),
+(9713, 4542, 1, 1, 3, 13, 13, 713, 1713, 4713, 9713, 26, 27, 'PJAAAA', 'SSGAAA', 'OOOOxx'),
+(691, 4543, 1, 3, 1, 11, 91, 691, 691, 691, 691, 182, 183, 'PAAAAA', 'TSGAAA', 'VVVVxx'),
+(3112, 4544, 0, 0, 2, 12, 12, 112, 1112, 3112, 3112, 24, 25, 'SPAAAA', 'USGAAA', 'AAAAxx'),
+(6035, 4545, 1, 3, 5, 15, 35, 35, 35, 1035, 6035, 70, 71, 'DYAAAA', 'VSGAAA', 'HHHHxx'),
+(8353, 4546, 1, 1, 3, 13, 53, 353, 353, 3353, 8353, 106, 107, 'HJAAAA', 'WSGAAA', 'OOOOxx'),
+(5679, 4547, 1, 3, 9, 19, 79, 679, 1679, 679, 5679, 158, 159, 'LKAAAA', 'XSGAAA', 'VVVVxx'),
+(2124, 4548, 0, 0, 4, 4, 24, 124, 124, 2124, 2124, 48, 49, 'SDAAAA', 'YSGAAA', 'AAAAxx'),
+(4714, 4549, 0, 2, 4, 14, 14, 714, 714, 4714, 4714, 28, 29, 'IZAAAA', 'ZSGAAA', 'HHHHxx'),
+(9048, 4550, 0, 0, 8, 8, 48, 48, 1048, 4048, 9048, 96, 97, 'AKAAAA', 'ATGAAA', 'OOOOxx'),
+(7692, 4551, 0, 0, 2, 12, 92, 692, 1692, 2692, 7692, 184, 185, 'WJAAAA', 'BTGAAA', 'VVVVxx'),
+(4542, 4552, 0, 2, 2, 2, 42, 542, 542, 4542, 4542, 84, 85, 'SSAAAA', 'CTGAAA', 'AAAAxx'),
+(8737, 4553, 1, 1, 7, 17, 37, 737, 737, 3737, 8737, 74, 75, 'BYAAAA', 'DTGAAA', 'HHHHxx'),
+(4977, 4554, 1, 1, 7, 17, 77, 977, 977, 4977, 4977, 154, 155, 'LJAAAA', 'ETGAAA', 'OOOOxx'),
+(9349, 4555, 1, 1, 9, 9, 49, 349, 1349, 4349, 9349, 98, 99, 'PVAAAA', 'FTGAAA', 'VVVVxx'),
+(731, 4556, 1, 3, 1, 11, 31, 731, 731, 731, 731, 62, 63, 'DCAAAA', 'GTGAAA', 'AAAAxx'),
+(1788, 4557, 0, 0, 8, 8, 88, 788, 1788, 1788, 1788, 176, 177, 'UQAAAA', 'HTGAAA', 'HHHHxx'),
+(7830, 4558, 0, 2, 0, 10, 30, 830, 1830, 2830, 7830, 60, 61, 'EPAAAA', 'ITGAAA', 'OOOOxx'),
+(3977, 4559, 1, 1, 7, 17, 77, 977, 1977, 3977, 3977, 154, 155, 'ZWAAAA', 'JTGAAA', 'VVVVxx'),
+(2421, 4560, 1, 1, 1, 1, 21, 421, 421, 2421, 2421, 42, 43, 'DPAAAA', 'KTGAAA', 'AAAAxx'),
+(5891, 4561, 1, 3, 1, 11, 91, 891, 1891, 891, 5891, 182, 183, 'PSAAAA', 'LTGAAA', 'HHHHxx'),
+(1111, 4562, 1, 3, 1, 11, 11, 111, 1111, 1111, 1111, 22, 23, 'TQAAAA', 'MTGAAA', 'OOOOxx'),
+(9224, 4563, 0, 0, 4, 4, 24, 224, 1224, 4224, 9224, 48, 49, 'UQAAAA', 'NTGAAA', 'VVVVxx'),
+(9872, 4564, 0, 0, 2, 12, 72, 872, 1872, 4872, 9872, 144, 145, 'SPAAAA', 'OTGAAA', 'AAAAxx'),
+(2433, 4565, 1, 1, 3, 13, 33, 433, 433, 2433, 2433, 66, 67, 'PPAAAA', 'PTGAAA', 'HHHHxx'),
+(1491, 4566, 1, 3, 1, 11, 91, 491, 1491, 1491, 1491, 182, 183, 'JFAAAA', 'QTGAAA', 'OOOOxx'),
+(6653, 4567, 1, 1, 3, 13, 53, 653, 653, 1653, 6653, 106, 107, 'XVAAAA', 'RTGAAA', 'VVVVxx'),
+(1907, 4568, 1, 3, 7, 7, 7, 907, 1907, 1907, 1907, 14, 15, 'JVAAAA', 'STGAAA', 'AAAAxx'),
+(889, 4569, 1, 1, 9, 9, 89, 889, 889, 889, 889, 178, 179, 'FIAAAA', 'TTGAAA', 'HHHHxx'),
+(561, 4570, 1, 1, 1, 1, 61, 561, 561, 561, 561, 122, 123, 'PVAAAA', 'UTGAAA', 'OOOOxx'),
+(7415, 4571, 1, 3, 5, 15, 15, 415, 1415, 2415, 7415, 30, 31, 'FZAAAA', 'VTGAAA', 'VVVVxx'),
+(2703, 4572, 1, 3, 3, 3, 3, 703, 703, 2703, 2703, 6, 7, 'ZZAAAA', 'WTGAAA', 'AAAAxx'),
+(2561, 4573, 1, 1, 1, 1, 61, 561, 561, 2561, 2561, 122, 123, 'NUAAAA', 'XTGAAA', 'HHHHxx'),
+(1257, 4574, 1, 1, 7, 17, 57, 257, 1257, 1257, 1257, 114, 115, 'JWAAAA', 'YTGAAA', 'OOOOxx'),
+(2390, 4575, 0, 2, 0, 10, 90, 390, 390, 2390, 2390, 180, 181, 'YNAAAA', 'ZTGAAA', 'VVVVxx'),
+(3915, 4576, 1, 3, 5, 15, 15, 915, 1915, 3915, 3915, 30, 31, 'PUAAAA', 'AUGAAA', 'AAAAxx'),
+(8476, 4577, 0, 0, 6, 16, 76, 476, 476, 3476, 8476, 152, 153, 'AOAAAA', 'BUGAAA', 'HHHHxx'),
+(607, 4578, 1, 3, 7, 7, 7, 607, 607, 607, 607, 14, 15, 'JXAAAA', 'CUGAAA', 'OOOOxx'),
+(3891, 4579, 1, 3, 1, 11, 91, 891, 1891, 3891, 3891, 182, 183, 'RTAAAA', 'DUGAAA', 'VVVVxx'),
+(7269, 4580, 1, 1, 9, 9, 69, 269, 1269, 2269, 7269, 138, 139, 'PTAAAA', 'EUGAAA', 'AAAAxx'),
+(9537, 4581, 1, 1, 7, 17, 37, 537, 1537, 4537, 9537, 74, 75, 'VCAAAA', 'FUGAAA', 'HHHHxx'),
+(8518, 4582, 0, 2, 8, 18, 18, 518, 518, 3518, 8518, 36, 37, 'QPAAAA', 'GUGAAA', 'OOOOxx'),
+(5221, 4583, 1, 1, 1, 1, 21, 221, 1221, 221, 5221, 42, 43, 'VSAAAA', 'HUGAAA', 'VVVVxx'),
+(3274, 4584, 0, 2, 4, 14, 74, 274, 1274, 3274, 3274, 148, 149, 'YVAAAA', 'IUGAAA', 'AAAAxx'),
+(6677, 4585, 1, 1, 7, 17, 77, 677, 677, 1677, 6677, 154, 155, 'VWAAAA', 'JUGAAA', 'HHHHxx'),
+(3114, 4586, 0, 2, 4, 14, 14, 114, 1114, 3114, 3114, 28, 29, 'UPAAAA', 'KUGAAA', 'OOOOxx'),
+(1966, 4587, 0, 2, 6, 6, 66, 966, 1966, 1966, 1966, 132, 133, 'QXAAAA', 'LUGAAA', 'VVVVxx'),
+(5941, 4588, 1, 1, 1, 1, 41, 941, 1941, 941, 5941, 82, 83, 'NUAAAA', 'MUGAAA', 'AAAAxx'),
+(9463, 4589, 1, 3, 3, 3, 63, 463, 1463, 4463, 9463, 126, 127, 'ZZAAAA', 'NUGAAA', 'HHHHxx'),
+(8966, 4590, 0, 2, 6, 6, 66, 966, 966, 3966, 8966, 132, 133, 'WGAAAA', 'OUGAAA', 'OOOOxx'),
+(4402, 4591, 0, 2, 2, 2, 2, 402, 402, 4402, 4402, 4, 5, 'INAAAA', 'PUGAAA', 'VVVVxx'),
+(3364, 4592, 0, 0, 4, 4, 64, 364, 1364, 3364, 3364, 128, 129, 'KZAAAA', 'QUGAAA', 'AAAAxx'),
+(3698, 4593, 0, 2, 8, 18, 98, 698, 1698, 3698, 3698, 196, 197, 'GMAAAA', 'RUGAAA', 'HHHHxx'),
+(4651, 4594, 1, 3, 1, 11, 51, 651, 651, 4651, 4651, 102, 103, 'XWAAAA', 'SUGAAA', 'OOOOxx'),
+(2127, 4595, 1, 3, 7, 7, 27, 127, 127, 2127, 2127, 54, 55, 'VDAAAA', 'TUGAAA', 'VVVVxx'),
+(3614, 4596, 0, 2, 4, 14, 14, 614, 1614, 3614, 3614, 28, 29, 'AJAAAA', 'UUGAAA', 'AAAAxx'),
+(5430, 4597, 0, 2, 0, 10, 30, 430, 1430, 430, 5430, 60, 61, 'WAAAAA', 'VUGAAA', 'HHHHxx'),
+(3361, 4598, 1, 1, 1, 1, 61, 361, 1361, 3361, 3361, 122, 123, 'HZAAAA', 'WUGAAA', 'OOOOxx'),
+(4798, 4599, 0, 2, 8, 18, 98, 798, 798, 4798, 4798, 196, 197, 'OCAAAA', 'XUGAAA', 'VVVVxx'),
+(8269, 4600, 1, 1, 9, 9, 69, 269, 269, 3269, 8269, 138, 139, 'BGAAAA', 'YUGAAA', 'AAAAxx'),
+(6458, 4601, 0, 2, 8, 18, 58, 458, 458, 1458, 6458, 116, 117, 'KOAAAA', 'ZUGAAA', 'HHHHxx'),
+(3358, 4602, 0, 2, 8, 18, 58, 358, 1358, 3358, 3358, 116, 117, 'EZAAAA', 'AVGAAA', 'OOOOxx'),
+(5898, 4603, 0, 2, 8, 18, 98, 898, 1898, 898, 5898, 196, 197, 'WSAAAA', 'BVGAAA', 'VVVVxx'),
+(1880, 4604, 0, 0, 0, 0, 80, 880, 1880, 1880, 1880, 160, 161, 'IUAAAA', 'CVGAAA', 'AAAAxx'),
+(782, 4605, 0, 2, 2, 2, 82, 782, 782, 782, 782, 164, 165, 'CEAAAA', 'DVGAAA', 'HHHHxx'),
+(3102, 4606, 0, 2, 2, 2, 2, 102, 1102, 3102, 3102, 4, 5, 'IPAAAA', 'EVGAAA', 'OOOOxx'),
+(6366, 4607, 0, 2, 6, 6, 66, 366, 366, 1366, 6366, 132, 133, 'WKAAAA', 'FVGAAA', 'VVVVxx'),
+(399, 4608, 1, 3, 9, 19, 99, 399, 399, 399, 399, 198, 199, 'JPAAAA', 'GVGAAA', 'AAAAxx'),
+(6773, 4609, 1, 1, 3, 13, 73, 773, 773, 1773, 6773, 146, 147, 'NAAAAA', 'HVGAAA', 'HHHHxx'),
+(7942, 4610, 0, 2, 2, 2, 42, 942, 1942, 2942, 7942, 84, 85, 'MTAAAA', 'IVGAAA', 'OOOOxx'),
+(6274, 4611, 0, 2, 4, 14, 74, 274, 274, 1274, 6274, 148, 149, 'IHAAAA', 'JVGAAA', 'VVVVxx'),
+(7447, 4612, 1, 3, 7, 7, 47, 447, 1447, 2447, 7447, 94, 95, 'LAAAAA', 'KVGAAA', 'AAAAxx'),
+(7648, 4613, 0, 0, 8, 8, 48, 648, 1648, 2648, 7648, 96, 97, 'EIAAAA', 'LVGAAA', 'HHHHxx'),
+(3997, 4614, 1, 1, 7, 17, 97, 997, 1997, 3997, 3997, 194, 195, 'TXAAAA', 'MVGAAA', 'OOOOxx'),
+(1759, 4615, 1, 3, 9, 19, 59, 759, 1759, 1759, 1759, 118, 119, 'RPAAAA', 'NVGAAA', 'VVVVxx'),
+(1785, 4616, 1, 1, 5, 5, 85, 785, 1785, 1785, 1785, 170, 171, 'RQAAAA', 'OVGAAA', 'AAAAxx'),
+(8930, 4617, 0, 2, 0, 10, 30, 930, 930, 3930, 8930, 60, 61, 'MFAAAA', 'PVGAAA', 'HHHHxx'),
+(7595, 4618, 1, 3, 5, 15, 95, 595, 1595, 2595, 7595, 190, 191, 'DGAAAA', 'QVGAAA', 'OOOOxx'),
+(6752, 4619, 0, 0, 2, 12, 52, 752, 752, 1752, 6752, 104, 105, 'SZAAAA', 'RVGAAA', 'VVVVxx'),
+(5635, 4620, 1, 3, 5, 15, 35, 635, 1635, 635, 5635, 70, 71, 'TIAAAA', 'SVGAAA', 'AAAAxx'),
+(1579, 4621, 1, 3, 9, 19, 79, 579, 1579, 1579, 1579, 158, 159, 'TIAAAA', 'TVGAAA', 'HHHHxx'),
+(7743, 4622, 1, 3, 3, 3, 43, 743, 1743, 2743, 7743, 86, 87, 'VLAAAA', 'UVGAAA', 'OOOOxx'),
+(5856, 4623, 0, 0, 6, 16, 56, 856, 1856, 856, 5856, 112, 113, 'GRAAAA', 'VVGAAA', 'VVVVxx'),
+(7273, 4624, 1, 1, 3, 13, 73, 273, 1273, 2273, 7273, 146, 147, 'TTAAAA', 'WVGAAA', 'AAAAxx'),
+(1399, 4625, 1, 3, 9, 19, 99, 399, 1399, 1399, 1399, 198, 199, 'VBAAAA', 'XVGAAA', 'HHHHxx'),
+(3694, 4626, 0, 2, 4, 14, 94, 694, 1694, 3694, 3694, 188, 189, 'CMAAAA', 'YVGAAA', 'OOOOxx'),
+(2782, 4627, 0, 2, 2, 2, 82, 782, 782, 2782, 2782, 164, 165, 'ADAAAA', 'ZVGAAA', 'VVVVxx'),
+(6951, 4628, 1, 3, 1, 11, 51, 951, 951, 1951, 6951, 102, 103, 'JHAAAA', 'AWGAAA', 'AAAAxx'),
+(6053, 4629, 1, 1, 3, 13, 53, 53, 53, 1053, 6053, 106, 107, 'VYAAAA', 'BWGAAA', 'HHHHxx'),
+(1753, 4630, 1, 1, 3, 13, 53, 753, 1753, 1753, 1753, 106, 107, 'LPAAAA', 'CWGAAA', 'OOOOxx'),
+(3985, 4631, 1, 1, 5, 5, 85, 985, 1985, 3985, 3985, 170, 171, 'HXAAAA', 'DWGAAA', 'VVVVxx'),
+(6159, 4632, 1, 3, 9, 19, 59, 159, 159, 1159, 6159, 118, 119, 'XCAAAA', 'EWGAAA', 'AAAAxx'),
+(6250, 4633, 0, 2, 0, 10, 50, 250, 250, 1250, 6250, 100, 101, 'KGAAAA', 'FWGAAA', 'HHHHxx'),
+(6240, 4634, 0, 0, 0, 0, 40, 240, 240, 1240, 6240, 80, 81, 'AGAAAA', 'GWGAAA', 'OOOOxx'),
+(6571, 4635, 1, 3, 1, 11, 71, 571, 571, 1571, 6571, 142, 143, 'TSAAAA', 'HWGAAA', 'VVVVxx'),
+(8624, 4636, 0, 0, 4, 4, 24, 624, 624, 3624, 8624, 48, 49, 'STAAAA', 'IWGAAA', 'AAAAxx'),
+(9718, 4637, 0, 2, 8, 18, 18, 718, 1718, 4718, 9718, 36, 37, 'UJAAAA', 'JWGAAA', 'HHHHxx'),
+(5529, 4638, 1, 1, 9, 9, 29, 529, 1529, 529, 5529, 58, 59, 'REAAAA', 'KWGAAA', 'OOOOxx'),
+(7089, 4639, 1, 1, 9, 9, 89, 89, 1089, 2089, 7089, 178, 179, 'RMAAAA', 'LWGAAA', 'VVVVxx'),
+(5488, 4640, 0, 0, 8, 8, 88, 488, 1488, 488, 5488, 176, 177, 'CDAAAA', 'MWGAAA', 'AAAAxx'),
+(5444, 4641, 0, 0, 4, 4, 44, 444, 1444, 444, 5444, 88, 89, 'KBAAAA', 'NWGAAA', 'HHHHxx'),
+(4899, 4642, 1, 3, 9, 19, 99, 899, 899, 4899, 4899, 198, 199, 'LGAAAA', 'OWGAAA', 'OOOOxx'),
+(7928, 4643, 0, 0, 8, 8, 28, 928, 1928, 2928, 7928, 56, 57, 'YSAAAA', 'PWGAAA', 'VVVVxx'),
+(4736, 4644, 0, 0, 6, 16, 36, 736, 736, 4736, 4736, 72, 73, 'EAAAAA', 'QWGAAA', 'AAAAxx'),
+(4317, 4645, 1, 1, 7, 17, 17, 317, 317, 4317, 4317, 34, 35, 'BKAAAA', 'RWGAAA', 'HHHHxx'),
+(1174, 4646, 0, 2, 4, 14, 74, 174, 1174, 1174, 1174, 148, 149, 'ETAAAA', 'SWGAAA', 'OOOOxx'),
+(6138, 4647, 0, 2, 8, 18, 38, 138, 138, 1138, 6138, 76, 77, 'CCAAAA', 'TWGAAA', 'VVVVxx'),
+(3943, 4648, 1, 3, 3, 3, 43, 943, 1943, 3943, 3943, 86, 87, 'RVAAAA', 'UWGAAA', 'AAAAxx'),
+(1545, 4649, 1, 1, 5, 5, 45, 545, 1545, 1545, 1545, 90, 91, 'LHAAAA', 'VWGAAA', 'HHHHxx'),
+(6867, 4650, 1, 3, 7, 7, 67, 867, 867, 1867, 6867, 134, 135, 'DEAAAA', 'WWGAAA', 'OOOOxx'),
+(6832, 4651, 0, 0, 2, 12, 32, 832, 832, 1832, 6832, 64, 65, 'UCAAAA', 'XWGAAA', 'VVVVxx'),
+(2987, 4652, 1, 3, 7, 7, 87, 987, 987, 2987, 2987, 174, 175, 'XKAAAA', 'YWGAAA', 'AAAAxx'),
+(5169, 4653, 1, 1, 9, 9, 69, 169, 1169, 169, 5169, 138, 139, 'VQAAAA', 'ZWGAAA', 'HHHHxx'),
+(8998, 4654, 0, 2, 8, 18, 98, 998, 998, 3998, 8998, 196, 197, 'CIAAAA', 'AXGAAA', 'OOOOxx'),
+(9347, 4655, 1, 3, 7, 7, 47, 347, 1347, 4347, 9347, 94, 95, 'NVAAAA', 'BXGAAA', 'VVVVxx'),
+(4800, 4656, 0, 0, 0, 0, 0, 800, 800, 4800, 4800, 0, 1, 'QCAAAA', 'CXGAAA', 'AAAAxx'),
+(4200, 4657, 0, 0, 0, 0, 0, 200, 200, 4200, 4200, 0, 1, 'OFAAAA', 'DXGAAA', 'HHHHxx'),
+(4046, 4658, 0, 2, 6, 6, 46, 46, 46, 4046, 4046, 92, 93, 'QZAAAA', 'EXGAAA', 'OOOOxx'),
+(7142, 4659, 0, 2, 2, 2, 42, 142, 1142, 2142, 7142, 84, 85, 'SOAAAA', 'FXGAAA', 'VVVVxx'),
+(2733, 4660, 1, 1, 3, 13, 33, 733, 733, 2733, 2733, 66, 67, 'DBAAAA', 'GXGAAA', 'AAAAxx'),
+(1568, 4661, 0, 0, 8, 8, 68, 568, 1568, 1568, 1568, 136, 137, 'IIAAAA', 'HXGAAA', 'HHHHxx'),
+(5105, 4662, 1, 1, 5, 5, 5, 105, 1105, 105, 5105, 10, 11, 'JOAAAA', 'IXGAAA', 'OOOOxx'),
+(9115, 4663, 1, 3, 5, 15, 15, 115, 1115, 4115, 9115, 30, 31, 'PMAAAA', 'JXGAAA', 'VVVVxx'),
+(6475, 4664, 1, 3, 5, 15, 75, 475, 475, 1475, 6475, 150, 151, 'BPAAAA', 'KXGAAA', 'AAAAxx'),
+(3796, 4665, 0, 0, 6, 16, 96, 796, 1796, 3796, 3796, 192, 193, 'AQAAAA', 'LXGAAA', 'HHHHxx'),
+(5410, 4666, 0, 2, 0, 10, 10, 410, 1410, 410, 5410, 20, 21, 'CAAAAA', 'MXGAAA', 'OOOOxx'),
+(4023, 4667, 1, 3, 3, 3, 23, 23, 23, 4023, 4023, 46, 47, 'TYAAAA', 'NXGAAA', 'VVVVxx'),
+(8904, 4668, 0, 0, 4, 4, 4, 904, 904, 3904, 8904, 8, 9, 'MEAAAA', 'OXGAAA', 'AAAAxx'),
+(450, 4669, 0, 2, 0, 10, 50, 450, 450, 450, 450, 100, 101, 'IRAAAA', 'PXGAAA', 'HHHHxx'),
+(8087, 4670, 1, 3, 7, 7, 87, 87, 87, 3087, 8087, 174, 175, 'BZAAAA', 'QXGAAA', 'OOOOxx'),
+(6478, 4671, 0, 2, 8, 18, 78, 478, 478, 1478, 6478, 156, 157, 'EPAAAA', 'RXGAAA', 'VVVVxx'),
+(2696, 4672, 0, 0, 6, 16, 96, 696, 696, 2696, 2696, 192, 193, 'SZAAAA', 'SXGAAA', 'AAAAxx'),
+(1792, 4673, 0, 0, 2, 12, 92, 792, 1792, 1792, 1792, 184, 185, 'YQAAAA', 'TXGAAA', 'HHHHxx'),
+(9699, 4674, 1, 3, 9, 19, 99, 699, 1699, 4699, 9699, 198, 199, 'BJAAAA', 'UXGAAA', 'OOOOxx'),
+(9160, 4675, 0, 0, 0, 0, 60, 160, 1160, 4160, 9160, 120, 121, 'IOAAAA', 'VXGAAA', 'VVVVxx'),
+(9989, 4676, 1, 1, 9, 9, 89, 989, 1989, 4989, 9989, 178, 179, 'FUAAAA', 'WXGAAA', 'AAAAxx'),
+(9568, 4677, 0, 0, 8, 8, 68, 568, 1568, 4568, 9568, 136, 137, 'AEAAAA', 'XXGAAA', 'HHHHxx'),
+(487, 4678, 1, 3, 7, 7, 87, 487, 487, 487, 487, 174, 175, 'TSAAAA', 'YXGAAA', 'OOOOxx'),
+(7863, 4679, 1, 3, 3, 3, 63, 863, 1863, 2863, 7863, 126, 127, 'LQAAAA', 'ZXGAAA', 'VVVVxx'),
+(1884, 4680, 0, 0, 4, 4, 84, 884, 1884, 1884, 1884, 168, 169, 'MUAAAA', 'AYGAAA', 'AAAAxx'),
+(2651, 4681, 1, 3, 1, 11, 51, 651, 651, 2651, 2651, 102, 103, 'ZXAAAA', 'BYGAAA', 'HHHHxx'),
+(8285, 4682, 1, 1, 5, 5, 85, 285, 285, 3285, 8285, 170, 171, 'RGAAAA', 'CYGAAA', 'OOOOxx'),
+(3927, 4683, 1, 3, 7, 7, 27, 927, 1927, 3927, 3927, 54, 55, 'BVAAAA', 'DYGAAA', 'VVVVxx'),
+(4076, 4684, 0, 0, 6, 16, 76, 76, 76, 4076, 4076, 152, 153, 'UAAAAA', 'EYGAAA', 'AAAAxx'),
+(6149, 4685, 1, 1, 9, 9, 49, 149, 149, 1149, 6149, 98, 99, 'NCAAAA', 'FYGAAA', 'HHHHxx'),
+(6581, 4686, 1, 1, 1, 1, 81, 581, 581, 1581, 6581, 162, 163, 'DTAAAA', 'GYGAAA', 'OOOOxx'),
+(8293, 4687, 1, 1, 3, 13, 93, 293, 293, 3293, 8293, 186, 187, 'ZGAAAA', 'HYGAAA', 'VVVVxx'),
+(7665, 4688, 1, 1, 5, 5, 65, 665, 1665, 2665, 7665, 130, 131, 'VIAAAA', 'IYGAAA', 'AAAAxx'),
+(4435, 4689, 1, 3, 5, 15, 35, 435, 435, 4435, 4435, 70, 71, 'POAAAA', 'JYGAAA', 'HHHHxx'),
+(1271, 4690, 1, 3, 1, 11, 71, 271, 1271, 1271, 1271, 142, 143, 'XWAAAA', 'KYGAAA', 'OOOOxx'),
+(3928, 4691, 0, 0, 8, 8, 28, 928, 1928, 3928, 3928, 56, 57, 'CVAAAA', 'LYGAAA', 'VVVVxx'),
+(7045, 4692, 1, 1, 5, 5, 45, 45, 1045, 2045, 7045, 90, 91, 'ZKAAAA', 'MYGAAA', 'AAAAxx'),
+(4943, 4693, 1, 3, 3, 3, 43, 943, 943, 4943, 4943, 86, 87, 'DIAAAA', 'NYGAAA', 'HHHHxx'),
+(8473, 4694, 1, 1, 3, 13, 73, 473, 473, 3473, 8473, 146, 147, 'XNAAAA', 'OYGAAA', 'OOOOxx'),
+(1707, 4695, 1, 3, 7, 7, 7, 707, 1707, 1707, 1707, 14, 15, 'RNAAAA', 'PYGAAA', 'VVVVxx'),
+(7509, 4696, 1, 1, 9, 9, 9, 509, 1509, 2509, 7509, 18, 19, 'VCAAAA', 'QYGAAA', 'AAAAxx'),
+(1593, 4697, 1, 1, 3, 13, 93, 593, 1593, 1593, 1593, 186, 187, 'HJAAAA', 'RYGAAA', 'HHHHxx'),
+(9281, 4698, 1, 1, 1, 1, 81, 281, 1281, 4281, 9281, 162, 163, 'ZSAAAA', 'SYGAAA', 'OOOOxx'),
+(8986, 4699, 0, 2, 6, 6, 86, 986, 986, 3986, 8986, 172, 173, 'QHAAAA', 'TYGAAA', 'VVVVxx'),
+(3740, 4700, 0, 0, 0, 0, 40, 740, 1740, 3740, 3740, 80, 81, 'WNAAAA', 'UYGAAA', 'AAAAxx'),
+(9265, 4701, 1, 1, 5, 5, 65, 265, 1265, 4265, 9265, 130, 131, 'JSAAAA', 'VYGAAA', 'HHHHxx'),
+(1510, 4702, 0, 2, 0, 10, 10, 510, 1510, 1510, 1510, 20, 21, 'CGAAAA', 'WYGAAA', 'OOOOxx'),
+(3022, 4703, 0, 2, 2, 2, 22, 22, 1022, 3022, 3022, 44, 45, 'GMAAAA', 'XYGAAA', 'VVVVxx'),
+(9014, 4704, 0, 2, 4, 14, 14, 14, 1014, 4014, 9014, 28, 29, 'SIAAAA', 'YYGAAA', 'AAAAxx'),
+(6816, 4705, 0, 0, 6, 16, 16, 816, 816, 1816, 6816, 32, 33, 'ECAAAA', 'ZYGAAA', 'HHHHxx'),
+(5518, 4706, 0, 2, 8, 18, 18, 518, 1518, 518, 5518, 36, 37, 'GEAAAA', 'AZGAAA', 'OOOOxx'),
+(4451, 4707, 1, 3, 1, 11, 51, 451, 451, 4451, 4451, 102, 103, 'FPAAAA', 'BZGAAA', 'VVVVxx'),
+(8747, 4708, 1, 3, 7, 7, 47, 747, 747, 3747, 8747, 94, 95, 'LYAAAA', 'CZGAAA', 'AAAAxx'),
+(4646, 4709, 0, 2, 6, 6, 46, 646, 646, 4646, 4646, 92, 93, 'SWAAAA', 'DZGAAA', 'HHHHxx'),
+(7296, 4710, 0, 0, 6, 16, 96, 296, 1296, 2296, 7296, 192, 193, 'QUAAAA', 'EZGAAA', 'OOOOxx'),
+(9644, 4711, 0, 0, 4, 4, 44, 644, 1644, 4644, 9644, 88, 89, 'YGAAAA', 'FZGAAA', 'VVVVxx'),
+(5977, 4712, 1, 1, 7, 17, 77, 977, 1977, 977, 5977, 154, 155, 'XVAAAA', 'GZGAAA', 'AAAAxx'),
+(6270, 4713, 0, 2, 0, 10, 70, 270, 270, 1270, 6270, 140, 141, 'EHAAAA', 'HZGAAA', 'HHHHxx'),
+(5578, 4714, 0, 2, 8, 18, 78, 578, 1578, 578, 5578, 156, 157, 'OGAAAA', 'IZGAAA', 'OOOOxx'),
+(2465, 4715, 1, 1, 5, 5, 65, 465, 465, 2465, 2465, 130, 131, 'VQAAAA', 'JZGAAA', 'VVVVxx'),
+(6436, 4716, 0, 0, 6, 16, 36, 436, 436, 1436, 6436, 72, 73, 'ONAAAA', 'KZGAAA', 'AAAAxx'),
+(8089, 4717, 1, 1, 9, 9, 89, 89, 89, 3089, 8089, 178, 179, 'DZAAAA', 'LZGAAA', 'HHHHxx'),
+(2409, 4718, 1, 1, 9, 9, 9, 409, 409, 2409, 2409, 18, 19, 'ROAAAA', 'MZGAAA', 'OOOOxx'),
+(284, 4719, 0, 0, 4, 4, 84, 284, 284, 284, 284, 168, 169, 'YKAAAA', 'NZGAAA', 'VVVVxx'),
+(5576, 4720, 0, 0, 6, 16, 76, 576, 1576, 576, 5576, 152, 153, 'MGAAAA', 'OZGAAA', 'AAAAxx'),
+(6534, 4721, 0, 2, 4, 14, 34, 534, 534, 1534, 6534, 68, 69, 'IRAAAA', 'PZGAAA', 'HHHHxx'),
+(8848, 4722, 0, 0, 8, 8, 48, 848, 848, 3848, 8848, 96, 97, 'ICAAAA', 'QZGAAA', 'OOOOxx'),
+(4305, 4723, 1, 1, 5, 5, 5, 305, 305, 4305, 4305, 10, 11, 'PJAAAA', 'RZGAAA', 'VVVVxx'),
+(5574, 4724, 0, 2, 4, 14, 74, 574, 1574, 574, 5574, 148, 149, 'KGAAAA', 'SZGAAA', 'AAAAxx'),
+(596, 4725, 0, 0, 6, 16, 96, 596, 596, 596, 596, 192, 193, 'YWAAAA', 'TZGAAA', 'HHHHxx'),
+(1253, 4726, 1, 1, 3, 13, 53, 253, 1253, 1253, 1253, 106, 107, 'FWAAAA', 'UZGAAA', 'OOOOxx'),
+(521, 4727, 1, 1, 1, 1, 21, 521, 521, 521, 521, 42, 43, 'BUAAAA', 'VZGAAA', 'VVVVxx'),
+(8739, 4728, 1, 3, 9, 19, 39, 739, 739, 3739, 8739, 78, 79, 'DYAAAA', 'WZGAAA', 'AAAAxx'),
+(908, 4729, 0, 0, 8, 8, 8, 908, 908, 908, 908, 16, 17, 'YIAAAA', 'XZGAAA', 'HHHHxx'),
+(6937, 4730, 1, 1, 7, 17, 37, 937, 937, 1937, 6937, 74, 75, 'VGAAAA', 'YZGAAA', 'OOOOxx'),
+(4515, 4731, 1, 3, 5, 15, 15, 515, 515, 4515, 4515, 30, 31, 'RRAAAA', 'ZZGAAA', 'VVVVxx'),
+(8630, 4732, 0, 2, 0, 10, 30, 630, 630, 3630, 8630, 60, 61, 'YTAAAA', 'AAHAAA', 'AAAAxx'),
+(7518, 4733, 0, 2, 8, 18, 18, 518, 1518, 2518, 7518, 36, 37, 'EDAAAA', 'BAHAAA', 'HHHHxx'),
+(8300, 4734, 0, 0, 0, 0, 0, 300, 300, 3300, 8300, 0, 1, 'GHAAAA', 'CAHAAA', 'OOOOxx'),
+(8434, 4735, 0, 2, 4, 14, 34, 434, 434, 3434, 8434, 68, 69, 'KMAAAA', 'DAHAAA', 'VVVVxx'),
+(6000, 4736, 0, 0, 0, 0, 0, 0, 0, 1000, 6000, 0, 1, 'UWAAAA', 'EAHAAA', 'AAAAxx'),
+(4508, 4737, 0, 0, 8, 8, 8, 508, 508, 4508, 4508, 16, 17, 'KRAAAA', 'FAHAAA', 'HHHHxx'),
+(7861, 4738, 1, 1, 1, 1, 61, 861, 1861, 2861, 7861, 122, 123, 'JQAAAA', 'GAHAAA', 'OOOOxx'),
+(5953, 4739, 1, 1, 3, 13, 53, 953, 1953, 953, 5953, 106, 107, 'ZUAAAA', 'HAHAAA', 'VVVVxx'),
+(5063, 4740, 1, 3, 3, 3, 63, 63, 1063, 63, 5063, 126, 127, 'TMAAAA', 'IAHAAA', 'AAAAxx'),
+(4501, 4741, 1, 1, 1, 1, 1, 501, 501, 4501, 4501, 2, 3, 'DRAAAA', 'JAHAAA', 'HHHHxx'),
+(7092, 4742, 0, 0, 2, 12, 92, 92, 1092, 2092, 7092, 184, 185, 'UMAAAA', 'KAHAAA', 'OOOOxx'),
+(4388, 4743, 0, 0, 8, 8, 88, 388, 388, 4388, 4388, 176, 177, 'UMAAAA', 'LAHAAA', 'VVVVxx'),
+(1826, 4744, 0, 2, 6, 6, 26, 826, 1826, 1826, 1826, 52, 53, 'GSAAAA', 'MAHAAA', 'AAAAxx'),
+(568, 4745, 0, 0, 8, 8, 68, 568, 568, 568, 568, 136, 137, 'WVAAAA', 'NAHAAA', 'HHHHxx'),
+(8184, 4746, 0, 0, 4, 4, 84, 184, 184, 3184, 8184, 168, 169, 'UCAAAA', 'OAHAAA', 'OOOOxx'),
+(4268, 4747, 0, 0, 8, 8, 68, 268, 268, 4268, 4268, 136, 137, 'EIAAAA', 'PAHAAA', 'VVVVxx'),
+(5798, 4748, 0, 2, 8, 18, 98, 798, 1798, 798, 5798, 196, 197, 'APAAAA', 'QAHAAA', 'AAAAxx'),
+(5190, 4749, 0, 2, 0, 10, 90, 190, 1190, 190, 5190, 180, 181, 'QRAAAA', 'RAHAAA', 'HHHHxx'),
+(1298, 4750, 0, 2, 8, 18, 98, 298, 1298, 1298, 1298, 196, 197, 'YXAAAA', 'SAHAAA', 'OOOOxx'),
+(4035, 4751, 1, 3, 5, 15, 35, 35, 35, 4035, 4035, 70, 71, 'FZAAAA', 'TAHAAA', 'VVVVxx'),
+(4504, 4752, 0, 0, 4, 4, 4, 504, 504, 4504, 4504, 8, 9, 'GRAAAA', 'UAHAAA', 'AAAAxx'),
+(5992, 4753, 0, 0, 2, 12, 92, 992, 1992, 992, 5992, 184, 185, 'MWAAAA', 'VAHAAA', 'HHHHxx'),
+(770, 4754, 0, 2, 0, 10, 70, 770, 770, 770, 770, 140, 141, 'QDAAAA', 'WAHAAA', 'OOOOxx'),
+(7502, 4755, 0, 2, 2, 2, 2, 502, 1502, 2502, 7502, 4, 5, 'OCAAAA', 'XAHAAA', 'VVVVxx'),
+(824, 4756, 0, 0, 4, 4, 24, 824, 824, 824, 824, 48, 49, 'SFAAAA', 'YAHAAA', 'AAAAxx'),
+(7716, 4757, 0, 0, 6, 16, 16, 716, 1716, 2716, 7716, 32, 33, 'UKAAAA', 'ZAHAAA', 'HHHHxx'),
+(5749, 4758, 1, 1, 9, 9, 49, 749, 1749, 749, 5749, 98, 99, 'DNAAAA', 'ABHAAA', 'OOOOxx'),
+(9814, 4759, 0, 2, 4, 14, 14, 814, 1814, 4814, 9814, 28, 29, 'MNAAAA', 'BBHAAA', 'VVVVxx'),
+(350, 4760, 0, 2, 0, 10, 50, 350, 350, 350, 350, 100, 101, 'MNAAAA', 'CBHAAA', 'AAAAxx'),
+(1390, 4761, 0, 2, 0, 10, 90, 390, 1390, 1390, 1390, 180, 181, 'MBAAAA', 'DBHAAA', 'HHHHxx'),
+(6994, 4762, 0, 2, 4, 14, 94, 994, 994, 1994, 6994, 188, 189, 'AJAAAA', 'EBHAAA', 'OOOOxx'),
+(3629, 4763, 1, 1, 9, 9, 29, 629, 1629, 3629, 3629, 58, 59, 'PJAAAA', 'FBHAAA', 'VVVVxx'),
+(9937, 4764, 1, 1, 7, 17, 37, 937, 1937, 4937, 9937, 74, 75, 'FSAAAA', 'GBHAAA', 'AAAAxx'),
+(5285, 4765, 1, 1, 5, 5, 85, 285, 1285, 285, 5285, 170, 171, 'HVAAAA', 'HBHAAA', 'HHHHxx'),
+(3157, 4766, 1, 1, 7, 17, 57, 157, 1157, 3157, 3157, 114, 115, 'LRAAAA', 'IBHAAA', 'OOOOxx'),
+(9549, 4767, 1, 1, 9, 9, 49, 549, 1549, 4549, 9549, 98, 99, 'HDAAAA', 'JBHAAA', 'VVVVxx'),
+(4118, 4768, 0, 2, 8, 18, 18, 118, 118, 4118, 4118, 36, 37, 'KCAAAA', 'KBHAAA', 'AAAAxx'),
+(756, 4769, 0, 0, 6, 16, 56, 756, 756, 756, 756, 112, 113, 'CDAAAA', 'LBHAAA', 'HHHHxx'),
+(5964, 4770, 0, 0, 4, 4, 64, 964, 1964, 964, 5964, 128, 129, 'KVAAAA', 'MBHAAA', 'OOOOxx'),
+(7701, 4771, 1, 1, 1, 1, 1, 701, 1701, 2701, 7701, 2, 3, 'FKAAAA', 'NBHAAA', 'VVVVxx'),
+(1242, 4772, 0, 2, 2, 2, 42, 242, 1242, 1242, 1242, 84, 85, 'UVAAAA', 'OBHAAA', 'AAAAxx'),
+(7890, 4773, 0, 2, 0, 10, 90, 890, 1890, 2890, 7890, 180, 181, 'MRAAAA', 'PBHAAA', 'HHHHxx'),
+(1991, 4774, 1, 3, 1, 11, 91, 991, 1991, 1991, 1991, 182, 183, 'PYAAAA', 'QBHAAA', 'OOOOxx'),
+(110, 4775, 0, 2, 0, 10, 10, 110, 110, 110, 110, 20, 21, 'GEAAAA', 'RBHAAA', 'VVVVxx'),
+(9334, 4776, 0, 2, 4, 14, 34, 334, 1334, 4334, 9334, 68, 69, 'AVAAAA', 'SBHAAA', 'AAAAxx'),
+(6231, 4777, 1, 3, 1, 11, 31, 231, 231, 1231, 6231, 62, 63, 'RFAAAA', 'TBHAAA', 'HHHHxx'),
+(9871, 4778, 1, 3, 1, 11, 71, 871, 1871, 4871, 9871, 142, 143, 'RPAAAA', 'UBHAAA', 'OOOOxx'),
+(9471, 4779, 1, 3, 1, 11, 71, 471, 1471, 4471, 9471, 142, 143, 'HAAAAA', 'VBHAAA', 'VVVVxx'),
+(2697, 4780, 1, 1, 7, 17, 97, 697, 697, 2697, 2697, 194, 195, 'TZAAAA', 'WBHAAA', 'AAAAxx'),
+(4761, 4781, 1, 1, 1, 1, 61, 761, 761, 4761, 4761, 122, 123, 'DBAAAA', 'XBHAAA', 'HHHHxx'),
+(8493, 4782, 1, 1, 3, 13, 93, 493, 493, 3493, 8493, 186, 187, 'ROAAAA', 'YBHAAA', 'OOOOxx'),
+(1045, 4783, 1, 1, 5, 5, 45, 45, 1045, 1045, 1045, 90, 91, 'FOAAAA', 'ZBHAAA', 'VVVVxx'),
+(3403, 4784, 1, 3, 3, 3, 3, 403, 1403, 3403, 3403, 6, 7, 'XAAAAA', 'ACHAAA', 'AAAAxx'),
+(9412, 4785, 0, 0, 2, 12, 12, 412, 1412, 4412, 9412, 24, 25, 'AYAAAA', 'BCHAAA', 'HHHHxx'),
+(7652, 4786, 0, 0, 2, 12, 52, 652, 1652, 2652, 7652, 104, 105, 'IIAAAA', 'CCHAAA', 'OOOOxx'),
+(5866, 4787, 0, 2, 6, 6, 66, 866, 1866, 866, 5866, 132, 133, 'QRAAAA', 'DCHAAA', 'VVVVxx'),
+(6942, 4788, 0, 2, 2, 2, 42, 942, 942, 1942, 6942, 84, 85, 'AHAAAA', 'ECHAAA', 'AAAAxx'),
+(9353, 4789, 1, 1, 3, 13, 53, 353, 1353, 4353, 9353, 106, 107, 'TVAAAA', 'FCHAAA', 'HHHHxx'),
+(2600, 4790, 0, 0, 0, 0, 0, 600, 600, 2600, 2600, 0, 1, 'AWAAAA', 'GCHAAA', 'OOOOxx'),
+(6971, 4791, 1, 3, 1, 11, 71, 971, 971, 1971, 6971, 142, 143, 'DIAAAA', 'HCHAAA', 'VVVVxx'),
+(5391, 4792, 1, 3, 1, 11, 91, 391, 1391, 391, 5391, 182, 183, 'JZAAAA', 'ICHAAA', 'AAAAxx'),
+(7654, 4793, 0, 2, 4, 14, 54, 654, 1654, 2654, 7654, 108, 109, 'KIAAAA', 'JCHAAA', 'HHHHxx'),
+(1797, 4794, 1, 1, 7, 17, 97, 797, 1797, 1797, 1797, 194, 195, 'DRAAAA', 'KCHAAA', 'OOOOxx'),
+(4530, 4795, 0, 2, 0, 10, 30, 530, 530, 4530, 4530, 60, 61, 'GSAAAA', 'LCHAAA', 'VVVVxx'),
+(3130, 4796, 0, 2, 0, 10, 30, 130, 1130, 3130, 3130, 60, 61, 'KQAAAA', 'MCHAAA', 'AAAAxx'),
+(9442, 4797, 0, 2, 2, 2, 42, 442, 1442, 4442, 9442, 84, 85, 'EZAAAA', 'NCHAAA', 'HHHHxx'),
+(6659, 4798, 1, 3, 9, 19, 59, 659, 659, 1659, 6659, 118, 119, 'DWAAAA', 'OCHAAA', 'OOOOxx'),
+(9714, 4799, 0, 2, 4, 14, 14, 714, 1714, 4714, 9714, 28, 29, 'QJAAAA', 'PCHAAA', 'VVVVxx'),
+(3660, 4800, 0, 0, 0, 0, 60, 660, 1660, 3660, 3660, 120, 121, 'UKAAAA', 'QCHAAA', 'AAAAxx'),
+(1906, 4801, 0, 2, 6, 6, 6, 906, 1906, 1906, 1906, 12, 13, 'IVAAAA', 'RCHAAA', 'HHHHxx'),
+(7927, 4802, 1, 3, 7, 7, 27, 927, 1927, 2927, 7927, 54, 55, 'XSAAAA', 'SCHAAA', 'OOOOxx'),
+(1767, 4803, 1, 3, 7, 7, 67, 767, 1767, 1767, 1767, 134, 135, 'ZPAAAA', 'TCHAAA', 'VVVVxx'),
+(5523, 4804, 1, 3, 3, 3, 23, 523, 1523, 523, 5523, 46, 47, 'LEAAAA', 'UCHAAA', 'AAAAxx'),
+(9289, 4805, 1, 1, 9, 9, 89, 289, 1289, 4289, 9289, 178, 179, 'HTAAAA', 'VCHAAA', 'HHHHxx'),
+(2717, 4806, 1, 1, 7, 17, 17, 717, 717, 2717, 2717, 34, 35, 'NAAAAA', 'WCHAAA', 'OOOOxx'),
+(4099, 4807, 1, 3, 9, 19, 99, 99, 99, 4099, 4099, 198, 199, 'RBAAAA', 'XCHAAA', 'VVVVxx'),
+(4387, 4808, 1, 3, 7, 7, 87, 387, 387, 4387, 4387, 174, 175, 'TMAAAA', 'YCHAAA', 'AAAAxx'),
+(8864, 4809, 0, 0, 4, 4, 64, 864, 864, 3864, 8864, 128, 129, 'YCAAAA', 'ZCHAAA', 'HHHHxx'),
+(1774, 4810, 0, 2, 4, 14, 74, 774, 1774, 1774, 1774, 148, 149, 'GQAAAA', 'ADHAAA', 'OOOOxx'),
+(6292, 4811, 0, 0, 2, 12, 92, 292, 292, 1292, 6292, 184, 185, 'AIAAAA', 'BDHAAA', 'VVVVxx'),
+(847, 4812, 1, 3, 7, 7, 47, 847, 847, 847, 847, 94, 95, 'PGAAAA', 'CDHAAA', 'AAAAxx'),
+(5954, 4813, 0, 2, 4, 14, 54, 954, 1954, 954, 5954, 108, 109, 'AVAAAA', 'DDHAAA', 'HHHHxx'),
+(8032, 4814, 0, 0, 2, 12, 32, 32, 32, 3032, 8032, 64, 65, 'YWAAAA', 'EDHAAA', 'OOOOxx'),
+(3295, 4815, 1, 3, 5, 15, 95, 295, 1295, 3295, 3295, 190, 191, 'TWAAAA', 'FDHAAA', 'VVVVxx'),
+(8984, 4816, 0, 0, 4, 4, 84, 984, 984, 3984, 8984, 168, 169, 'OHAAAA', 'GDHAAA', 'AAAAxx'),
+(7809, 4817, 1, 1, 9, 9, 9, 809, 1809, 2809, 7809, 18, 19, 'JOAAAA', 'HDHAAA', 'HHHHxx'),
+(1670, 4818, 0, 2, 0, 10, 70, 670, 1670, 1670, 1670, 140, 141, 'GMAAAA', 'IDHAAA', 'OOOOxx'),
+(7733, 4819, 1, 1, 3, 13, 33, 733, 1733, 2733, 7733, 66, 67, 'LLAAAA', 'JDHAAA', 'VVVVxx'),
+(6187, 4820, 1, 3, 7, 7, 87, 187, 187, 1187, 6187, 174, 175, 'ZDAAAA', 'KDHAAA', 'AAAAxx'),
+(9326, 4821, 0, 2, 6, 6, 26, 326, 1326, 4326, 9326, 52, 53, 'SUAAAA', 'LDHAAA', 'HHHHxx'),
+(2493, 4822, 1, 1, 3, 13, 93, 493, 493, 2493, 2493, 186, 187, 'XRAAAA', 'MDHAAA', 'OOOOxx'),
+(9512, 4823, 0, 0, 2, 12, 12, 512, 1512, 4512, 9512, 24, 25, 'WBAAAA', 'NDHAAA', 'VVVVxx'),
+(4342, 4824, 0, 2, 2, 2, 42, 342, 342, 4342, 4342, 84, 85, 'ALAAAA', 'ODHAAA', 'AAAAxx'),
+(5350, 4825, 0, 2, 0, 10, 50, 350, 1350, 350, 5350, 100, 101, 'UXAAAA', 'PDHAAA', 'HHHHxx'),
+(6009, 4826, 1, 1, 9, 9, 9, 9, 9, 1009, 6009, 18, 19, 'DXAAAA', 'QDHAAA', 'OOOOxx'),
+(1208, 4827, 0, 0, 8, 8, 8, 208, 1208, 1208, 1208, 16, 17, 'MUAAAA', 'RDHAAA', 'VVVVxx'),
+(7014, 4828, 0, 2, 4, 14, 14, 14, 1014, 2014, 7014, 28, 29, 'UJAAAA', 'SDHAAA', 'AAAAxx'),
+(2967, 4829, 1, 3, 7, 7, 67, 967, 967, 2967, 2967, 134, 135, 'DKAAAA', 'TDHAAA', 'HHHHxx'),
+(5831, 4830, 1, 3, 1, 11, 31, 831, 1831, 831, 5831, 62, 63, 'HQAAAA', 'UDHAAA', 'OOOOxx'),
+(3097, 4831, 1, 1, 7, 17, 97, 97, 1097, 3097, 3097, 194, 195, 'DPAAAA', 'VDHAAA', 'VVVVxx'),
+(1528, 4832, 0, 0, 8, 8, 28, 528, 1528, 1528, 1528, 56, 57, 'UGAAAA', 'WDHAAA', 'AAAAxx'),
+(6429, 4833, 1, 1, 9, 9, 29, 429, 429, 1429, 6429, 58, 59, 'HNAAAA', 'XDHAAA', 'HHHHxx'),
+(7320, 4834, 0, 0, 0, 0, 20, 320, 1320, 2320, 7320, 40, 41, 'OVAAAA', 'YDHAAA', 'OOOOxx'),
+(844, 4835, 0, 0, 4, 4, 44, 844, 844, 844, 844, 88, 89, 'MGAAAA', 'ZDHAAA', 'VVVVxx'),
+(7054, 4836, 0, 2, 4, 14, 54, 54, 1054, 2054, 7054, 108, 109, 'ILAAAA', 'AEHAAA', 'AAAAxx'),
+(1643, 4837, 1, 3, 3, 3, 43, 643, 1643, 1643, 1643, 86, 87, 'FLAAAA', 'BEHAAA', 'HHHHxx'),
+(7626, 4838, 0, 2, 6, 6, 26, 626, 1626, 2626, 7626, 52, 53, 'IHAAAA', 'CEHAAA', 'OOOOxx'),
+(8728, 4839, 0, 0, 8, 8, 28, 728, 728, 3728, 8728, 56, 57, 'SXAAAA', 'DEHAAA', 'VVVVxx'),
+(8277, 4840, 1, 1, 7, 17, 77, 277, 277, 3277, 8277, 154, 155, 'JGAAAA', 'EEHAAA', 'AAAAxx'),
+(189, 4841, 1, 1, 9, 9, 89, 189, 189, 189, 189, 178, 179, 'HHAAAA', 'FEHAAA', 'HHHHxx'),
+(3717, 4842, 1, 1, 7, 17, 17, 717, 1717, 3717, 3717, 34, 35, 'ZMAAAA', 'GEHAAA', 'OOOOxx'),
+(1020, 4843, 0, 0, 0, 0, 20, 20, 1020, 1020, 1020, 40, 41, 'GNAAAA', 'HEHAAA', 'VVVVxx'),
+(9234, 4844, 0, 2, 4, 14, 34, 234, 1234, 4234, 9234, 68, 69, 'ERAAAA', 'IEHAAA', 'AAAAxx'),
+(9541, 4845, 1, 1, 1, 1, 41, 541, 1541, 4541, 9541, 82, 83, 'ZCAAAA', 'JEHAAA', 'HHHHxx'),
+(380, 4846, 0, 0, 0, 0, 80, 380, 380, 380, 380, 160, 161, 'QOAAAA', 'KEHAAA', 'OOOOxx'),
+(397, 4847, 1, 1, 7, 17, 97, 397, 397, 397, 397, 194, 195, 'HPAAAA', 'LEHAAA', 'VVVVxx'),
+(835, 4848, 1, 3, 5, 15, 35, 835, 835, 835, 835, 70, 71, 'DGAAAA', 'MEHAAA', 'AAAAxx'),
+(347, 4849, 1, 3, 7, 7, 47, 347, 347, 347, 347, 94, 95, 'JNAAAA', 'NEHAAA', 'HHHHxx'),
+(2490, 4850, 0, 2, 0, 10, 90, 490, 490, 2490, 2490, 180, 181, 'URAAAA', 'OEHAAA', 'OOOOxx'),
+(605, 4851, 1, 1, 5, 5, 5, 605, 605, 605, 605, 10, 11, 'HXAAAA', 'PEHAAA', 'VVVVxx'),
+(7960, 4852, 0, 0, 0, 0, 60, 960, 1960, 2960, 7960, 120, 121, 'EUAAAA', 'QEHAAA', 'AAAAxx'),
+(9681, 4853, 1, 1, 1, 1, 81, 681, 1681, 4681, 9681, 162, 163, 'JIAAAA', 'REHAAA', 'HHHHxx'),
+(5753, 4854, 1, 1, 3, 13, 53, 753, 1753, 753, 5753, 106, 107, 'HNAAAA', 'SEHAAA', 'OOOOxx'),
+(1676, 4855, 0, 0, 6, 16, 76, 676, 1676, 1676, 1676, 152, 153, 'MMAAAA', 'TEHAAA', 'VVVVxx'),
+(5533, 4856, 1, 1, 3, 13, 33, 533, 1533, 533, 5533, 66, 67, 'VEAAAA', 'UEHAAA', 'AAAAxx'),
+(8958, 4857, 0, 2, 8, 18, 58, 958, 958, 3958, 8958, 116, 117, 'OGAAAA', 'VEHAAA', 'HHHHxx'),
+(664, 4858, 0, 0, 4, 4, 64, 664, 664, 664, 664, 128, 129, 'OZAAAA', 'WEHAAA', 'OOOOxx'),
+(3005, 4859, 1, 1, 5, 5, 5, 5, 1005, 3005, 3005, 10, 11, 'PLAAAA', 'XEHAAA', 'VVVVxx'),
+(8576, 4860, 0, 0, 6, 16, 76, 576, 576, 3576, 8576, 152, 153, 'WRAAAA', 'YEHAAA', 'AAAAxx'),
+(7304, 4861, 0, 0, 4, 4, 4, 304, 1304, 2304, 7304, 8, 9, 'YUAAAA', 'ZEHAAA', 'HHHHxx'),
+(3375, 4862, 1, 3, 5, 15, 75, 375, 1375, 3375, 3375, 150, 151, 'VZAAAA', 'AFHAAA', 'OOOOxx'),
+(6336, 4863, 0, 0, 6, 16, 36, 336, 336, 1336, 6336, 72, 73, 'SJAAAA', 'BFHAAA', 'VVVVxx'),
+(1392, 4864, 0, 0, 2, 12, 92, 392, 1392, 1392, 1392, 184, 185, 'OBAAAA', 'CFHAAA', 'AAAAxx'),
+(2925, 4865, 1, 1, 5, 5, 25, 925, 925, 2925, 2925, 50, 51, 'NIAAAA', 'DFHAAA', 'HHHHxx'),
+(1217, 4866, 1, 1, 7, 17, 17, 217, 1217, 1217, 1217, 34, 35, 'VUAAAA', 'EFHAAA', 'OOOOxx'),
+(3714, 4867, 0, 2, 4, 14, 14, 714, 1714, 3714, 3714, 28, 29, 'WMAAAA', 'FFHAAA', 'VVVVxx'),
+(2120, 4868, 0, 0, 0, 0, 20, 120, 120, 2120, 2120, 40, 41, 'ODAAAA', 'GFHAAA', 'AAAAxx'),
+(2845, 4869, 1, 1, 5, 5, 45, 845, 845, 2845, 2845, 90, 91, 'LFAAAA', 'HFHAAA', 'HHHHxx'),
+(3865, 4870, 1, 1, 5, 5, 65, 865, 1865, 3865, 3865, 130, 131, 'RSAAAA', 'IFHAAA', 'OOOOxx'),
+(124, 4871, 0, 0, 4, 4, 24, 124, 124, 124, 124, 48, 49, 'UEAAAA', 'JFHAAA', 'VVVVxx'),
+(865, 4872, 1, 1, 5, 5, 65, 865, 865, 865, 865, 130, 131, 'HHAAAA', 'KFHAAA', 'AAAAxx'),
+(9361, 4873, 1, 1, 1, 1, 61, 361, 1361, 4361, 9361, 122, 123, 'BWAAAA', 'LFHAAA', 'HHHHxx'),
+(6338, 4874, 0, 2, 8, 18, 38, 338, 338, 1338, 6338, 76, 77, 'UJAAAA', 'MFHAAA', 'OOOOxx'),
+(7330, 4875, 0, 2, 0, 10, 30, 330, 1330, 2330, 7330, 60, 61, 'YVAAAA', 'NFHAAA', 'VVVVxx'),
+(513, 4876, 1, 1, 3, 13, 13, 513, 513, 513, 513, 26, 27, 'TTAAAA', 'OFHAAA', 'AAAAxx'),
+(5001, 4877, 1, 1, 1, 1, 1, 1, 1001, 1, 5001, 2, 3, 'JKAAAA', 'PFHAAA', 'HHHHxx'),
+(549, 4878, 1, 1, 9, 9, 49, 549, 549, 549, 549, 98, 99, 'DVAAAA', 'QFHAAA', 'OOOOxx'),
+(1808, 4879, 0, 0, 8, 8, 8, 808, 1808, 1808, 1808, 16, 17, 'ORAAAA', 'RFHAAA', 'VVVVxx'),
+(7168, 4880, 0, 0, 8, 8, 68, 168, 1168, 2168, 7168, 136, 137, 'SPAAAA', 'SFHAAA', 'AAAAxx'),
+(9878, 4881, 0, 2, 8, 18, 78, 878, 1878, 4878, 9878, 156, 157, 'YPAAAA', 'TFHAAA', 'HHHHxx'),
+(233, 4882, 1, 1, 3, 13, 33, 233, 233, 233, 233, 66, 67, 'ZIAAAA', 'UFHAAA', 'OOOOxx'),
+(4262, 4883, 0, 2, 2, 2, 62, 262, 262, 4262, 4262, 124, 125, 'YHAAAA', 'VFHAAA', 'VVVVxx'),
+(7998, 4884, 0, 2, 8, 18, 98, 998, 1998, 2998, 7998, 196, 197, 'QVAAAA', 'WFHAAA', 'AAAAxx'),
+(2419, 4885, 1, 3, 9, 19, 19, 419, 419, 2419, 2419, 38, 39, 'BPAAAA', 'XFHAAA', 'HHHHxx'),
+(9960, 4886, 0, 0, 0, 0, 60, 960, 1960, 4960, 9960, 120, 121, 'CTAAAA', 'YFHAAA', 'OOOOxx'),
+(3523, 4887, 1, 3, 3, 3, 23, 523, 1523, 3523, 3523, 46, 47, 'NFAAAA', 'ZFHAAA', 'VVVVxx'),
+(5440, 4888, 0, 0, 0, 0, 40, 440, 1440, 440, 5440, 80, 81, 'GBAAAA', 'AGHAAA', 'AAAAxx'),
+(3030, 4889, 0, 2, 0, 10, 30, 30, 1030, 3030, 3030, 60, 61, 'OMAAAA', 'BGHAAA', 'HHHHxx'),
+(2745, 4890, 1, 1, 5, 5, 45, 745, 745, 2745, 2745, 90, 91, 'PBAAAA', 'CGHAAA', 'OOOOxx'),
+(7175, 4891, 1, 3, 5, 15, 75, 175, 1175, 2175, 7175, 150, 151, 'ZPAAAA', 'DGHAAA', 'VVVVxx'),
+(640, 4892, 0, 0, 0, 0, 40, 640, 640, 640, 640, 80, 81, 'QYAAAA', 'EGHAAA', 'AAAAxx'),
+(1798, 4893, 0, 2, 8, 18, 98, 798, 1798, 1798, 1798, 196, 197, 'ERAAAA', 'FGHAAA', 'HHHHxx'),
+(7499, 4894, 1, 3, 9, 19, 99, 499, 1499, 2499, 7499, 198, 199, 'LCAAAA', 'GGHAAA', 'OOOOxx'),
+(1924, 4895, 0, 0, 4, 4, 24, 924, 1924, 1924, 1924, 48, 49, 'AWAAAA', 'HGHAAA', 'VVVVxx'),
+(1327, 4896, 1, 3, 7, 7, 27, 327, 1327, 1327, 1327, 54, 55, 'BZAAAA', 'IGHAAA', 'AAAAxx'),
+(73, 4897, 1, 1, 3, 13, 73, 73, 73, 73, 73, 146, 147, 'VCAAAA', 'JGHAAA', 'HHHHxx'),
+(9558, 4898, 0, 2, 8, 18, 58, 558, 1558, 4558, 9558, 116, 117, 'QDAAAA', 'KGHAAA', 'OOOOxx'),
+(818, 4899, 0, 2, 8, 18, 18, 818, 818, 818, 818, 36, 37, 'MFAAAA', 'LGHAAA', 'VVVVxx'),
+(9916, 4900, 0, 0, 6, 16, 16, 916, 1916, 4916, 9916, 32, 33, 'KRAAAA', 'MGHAAA', 'AAAAxx'),
+(2978, 4901, 0, 2, 8, 18, 78, 978, 978, 2978, 2978, 156, 157, 'OKAAAA', 'NGHAAA', 'HHHHxx'),
+(8469, 4902, 1, 1, 9, 9, 69, 469, 469, 3469, 8469, 138, 139, 'TNAAAA', 'OGHAAA', 'OOOOxx'),
+(9845, 4903, 1, 1, 5, 5, 45, 845, 1845, 4845, 9845, 90, 91, 'ROAAAA', 'PGHAAA', 'VVVVxx'),
+(2326, 4904, 0, 2, 6, 6, 26, 326, 326, 2326, 2326, 52, 53, 'MLAAAA', 'QGHAAA', 'AAAAxx'),
+(4032, 4905, 0, 0, 2, 12, 32, 32, 32, 4032, 4032, 64, 65, 'CZAAAA', 'RGHAAA', 'HHHHxx'),
+(5604, 4906, 0, 0, 4, 4, 4, 604, 1604, 604, 5604, 8, 9, 'OHAAAA', 'SGHAAA', 'OOOOxx'),
+(9610, 4907, 0, 2, 0, 10, 10, 610, 1610, 4610, 9610, 20, 21, 'QFAAAA', 'TGHAAA', 'VVVVxx'),
+(5101, 4908, 1, 1, 1, 1, 1, 101, 1101, 101, 5101, 2, 3, 'FOAAAA', 'UGHAAA', 'AAAAxx'),
+(7246, 4909, 0, 2, 6, 6, 46, 246, 1246, 2246, 7246, 92, 93, 'SSAAAA', 'VGHAAA', 'HHHHxx'),
+(1292, 4910, 0, 0, 2, 12, 92, 292, 1292, 1292, 1292, 184, 185, 'SXAAAA', 'WGHAAA', 'OOOOxx'),
+(6235, 4911, 1, 3, 5, 15, 35, 235, 235, 1235, 6235, 70, 71, 'VFAAAA', 'XGHAAA', 'VVVVxx'),
+(1733, 4912, 1, 1, 3, 13, 33, 733, 1733, 1733, 1733, 66, 67, 'ROAAAA', 'YGHAAA', 'AAAAxx'),
+(4647, 4913, 1, 3, 7, 7, 47, 647, 647, 4647, 4647, 94, 95, 'TWAAAA', 'ZGHAAA', 'HHHHxx'),
+(258, 4914, 0, 2, 8, 18, 58, 258, 258, 258, 258, 116, 117, 'YJAAAA', 'AHHAAA', 'OOOOxx'),
+(8438, 4915, 0, 2, 8, 18, 38, 438, 438, 3438, 8438, 76, 77, 'OMAAAA', 'BHHAAA', 'VVVVxx'),
+(7869, 4916, 1, 1, 9, 9, 69, 869, 1869, 2869, 7869, 138, 139, 'RQAAAA', 'CHHAAA', 'AAAAxx'),
+(9691, 4917, 1, 3, 1, 11, 91, 691, 1691, 4691, 9691, 182, 183, 'TIAAAA', 'DHHAAA', 'HHHHxx'),
+(5422, 4918, 0, 2, 2, 2, 22, 422, 1422, 422, 5422, 44, 45, 'OAAAAA', 'EHHAAA', 'OOOOxx'),
+(9630, 4919, 0, 2, 0, 10, 30, 630, 1630, 4630, 9630, 60, 61, 'KGAAAA', 'FHHAAA', 'VVVVxx'),
+(4439, 4920, 1, 3, 9, 19, 39, 439, 439, 4439, 4439, 78, 79, 'TOAAAA', 'GHHAAA', 'AAAAxx'),
+(3140, 4921, 0, 0, 0, 0, 40, 140, 1140, 3140, 3140, 80, 81, 'UQAAAA', 'HHHAAA', 'HHHHxx'),
+(9111, 4922, 1, 3, 1, 11, 11, 111, 1111, 4111, 9111, 22, 23, 'LMAAAA', 'IHHAAA', 'OOOOxx'),
+(4606, 4923, 0, 2, 6, 6, 6, 606, 606, 4606, 4606, 12, 13, 'EVAAAA', 'JHHAAA', 'VVVVxx'),
+(8620, 4924, 0, 0, 0, 0, 20, 620, 620, 3620, 8620, 40, 41, 'OTAAAA', 'KHHAAA', 'AAAAxx'),
+(7849, 4925, 1, 1, 9, 9, 49, 849, 1849, 2849, 7849, 98, 99, 'XPAAAA', 'LHHAAA', 'HHHHxx'),
+(346, 4926, 0, 2, 6, 6, 46, 346, 346, 346, 346, 92, 93, 'INAAAA', 'MHHAAA', 'OOOOxx'),
+(9528, 4927, 0, 0, 8, 8, 28, 528, 1528, 4528, 9528, 56, 57, 'MCAAAA', 'NHHAAA', 'VVVVxx'),
+(1811, 4928, 1, 3, 1, 11, 11, 811, 1811, 1811, 1811, 22, 23, 'RRAAAA', 'OHHAAA', 'AAAAxx'),
+(6068, 4929, 0, 0, 8, 8, 68, 68, 68, 1068, 6068, 136, 137, 'KZAAAA', 'PHHAAA', 'HHHHxx'),
+(6260, 4930, 0, 0, 0, 0, 60, 260, 260, 1260, 6260, 120, 121, 'UGAAAA', 'QHHAAA', 'OOOOxx'),
+(5909, 4931, 1, 1, 9, 9, 9, 909, 1909, 909, 5909, 18, 19, 'HTAAAA', 'RHHAAA', 'VVVVxx'),
+(4518, 4932, 0, 2, 8, 18, 18, 518, 518, 4518, 4518, 36, 37, 'URAAAA', 'SHHAAA', 'AAAAxx'),
+(7530, 4933, 0, 2, 0, 10, 30, 530, 1530, 2530, 7530, 60, 61, 'QDAAAA', 'THHAAA', 'HHHHxx'),
+(3900, 4934, 0, 0, 0, 0, 0, 900, 1900, 3900, 3900, 0, 1, 'AUAAAA', 'UHHAAA', 'OOOOxx'),
+(3969, 4935, 1, 1, 9, 9, 69, 969, 1969, 3969, 3969, 138, 139, 'RWAAAA', 'VHHAAA', 'VVVVxx'),
+(8690, 4936, 0, 2, 0, 10, 90, 690, 690, 3690, 8690, 180, 181, 'GWAAAA', 'WHHAAA', 'AAAAxx'),
+(5532, 4937, 0, 0, 2, 12, 32, 532, 1532, 532, 5532, 64, 65, 'UEAAAA', 'XHHAAA', 'HHHHxx'),
+(5989, 4938, 1, 1, 9, 9, 89, 989, 1989, 989, 5989, 178, 179, 'JWAAAA', 'YHHAAA', 'OOOOxx'),
+(1870, 4939, 0, 2, 0, 10, 70, 870, 1870, 1870, 1870, 140, 141, 'YTAAAA', 'ZHHAAA', 'VVVVxx'),
+(1113, 4940, 1, 1, 3, 13, 13, 113, 1113, 1113, 1113, 26, 27, 'VQAAAA', 'AIHAAA', 'AAAAxx'),
+(5155, 4941, 1, 3, 5, 15, 55, 155, 1155, 155, 5155, 110, 111, 'HQAAAA', 'BIHAAA', 'HHHHxx'),
+(7460, 4942, 0, 0, 0, 0, 60, 460, 1460, 2460, 7460, 120, 121, 'YAAAAA', 'CIHAAA', 'OOOOxx'),
+(6217, 4943, 1, 1, 7, 17, 17, 217, 217, 1217, 6217, 34, 35, 'DFAAAA', 'DIHAAA', 'VVVVxx'),
+(8333, 4944, 1, 1, 3, 13, 33, 333, 333, 3333, 8333, 66, 67, 'NIAAAA', 'EIHAAA', 'AAAAxx'),
+(6341, 4945, 1, 1, 1, 1, 41, 341, 341, 1341, 6341, 82, 83, 'XJAAAA', 'FIHAAA', 'HHHHxx'),
+(6230, 4946, 0, 2, 0, 10, 30, 230, 230, 1230, 6230, 60, 61, 'QFAAAA', 'GIHAAA', 'OOOOxx'),
+(6902, 4947, 0, 2, 2, 2, 2, 902, 902, 1902, 6902, 4, 5, 'MFAAAA', 'HIHAAA', 'VVVVxx'),
+(670, 4948, 0, 2, 0, 10, 70, 670, 670, 670, 670, 140, 141, 'UZAAAA', 'IIHAAA', 'AAAAxx'),
+(805, 4949, 1, 1, 5, 5, 5, 805, 805, 805, 805, 10, 11, 'ZEAAAA', 'JIHAAA', 'HHHHxx'),
+(1340, 4950, 0, 0, 0, 0, 40, 340, 1340, 1340, 1340, 80, 81, 'OZAAAA', 'KIHAAA', 'OOOOxx'),
+(8649, 4951, 1, 1, 9, 9, 49, 649, 649, 3649, 8649, 98, 99, 'RUAAAA', 'LIHAAA', 'VVVVxx'),
+(3887, 4952, 1, 3, 7, 7, 87, 887, 1887, 3887, 3887, 174, 175, 'NTAAAA', 'MIHAAA', 'AAAAxx'),
+(5400, 4953, 0, 0, 0, 0, 0, 400, 1400, 400, 5400, 0, 1, 'SZAAAA', 'NIHAAA', 'HHHHxx'),
+(4354, 4954, 0, 2, 4, 14, 54, 354, 354, 4354, 4354, 108, 109, 'MLAAAA', 'OIHAAA', 'OOOOxx'),
+(950, 4955, 0, 2, 0, 10, 50, 950, 950, 950, 950, 100, 101, 'OKAAAA', 'PIHAAA', 'VVVVxx'),
+(1544, 4956, 0, 0, 4, 4, 44, 544, 1544, 1544, 1544, 88, 89, 'KHAAAA', 'QIHAAA', 'AAAAxx'),
+(3898, 4957, 0, 2, 8, 18, 98, 898, 1898, 3898, 3898, 196, 197, 'YTAAAA', 'RIHAAA', 'HHHHxx'),
+(8038, 4958, 0, 2, 8, 18, 38, 38, 38, 3038, 8038, 76, 77, 'EXAAAA', 'SIHAAA', 'OOOOxx'),
+(1095, 4959, 1, 3, 5, 15, 95, 95, 1095, 1095, 1095, 190, 191, 'DQAAAA', 'TIHAAA', 'VVVVxx'),
+(1748, 4960, 0, 0, 8, 8, 48, 748, 1748, 1748, 1748, 96, 97, 'GPAAAA', 'UIHAAA', 'AAAAxx'),
+(9154, 4961, 0, 2, 4, 14, 54, 154, 1154, 4154, 9154, 108, 109, 'COAAAA', 'VIHAAA', 'HHHHxx'),
+(2182, 4962, 0, 2, 2, 2, 82, 182, 182, 2182, 2182, 164, 165, 'YFAAAA', 'WIHAAA', 'OOOOxx'),
+(6797, 4963, 1, 1, 7, 17, 97, 797, 797, 1797, 6797, 194, 195, 'LBAAAA', 'XIHAAA', 'VVVVxx'),
+(9149, 4964, 1, 1, 9, 9, 49, 149, 1149, 4149, 9149, 98, 99, 'XNAAAA', 'YIHAAA', 'AAAAxx'),
+(7351, 4965, 1, 3, 1, 11, 51, 351, 1351, 2351, 7351, 102, 103, 'TWAAAA', 'ZIHAAA', 'HHHHxx'),
+(2820, 4966, 0, 0, 0, 0, 20, 820, 820, 2820, 2820, 40, 41, 'MEAAAA', 'AJHAAA', 'OOOOxx'),
+(9696, 4967, 0, 0, 6, 16, 96, 696, 1696, 4696, 9696, 192, 193, 'YIAAAA', 'BJHAAA', 'VVVVxx'),
+(253, 4968, 1, 1, 3, 13, 53, 253, 253, 253, 253, 106, 107, 'TJAAAA', 'CJHAAA', 'AAAAxx'),
+(3600, 4969, 0, 0, 0, 0, 0, 600, 1600, 3600, 3600, 0, 1, 'MIAAAA', 'DJHAAA', 'HHHHxx'),
+(3892, 4970, 0, 0, 2, 12, 92, 892, 1892, 3892, 3892, 184, 185, 'STAAAA', 'EJHAAA', 'OOOOxx'),
+(231, 4971, 1, 3, 1, 11, 31, 231, 231, 231, 231, 62, 63, 'XIAAAA', 'FJHAAA', 'VVVVxx'),
+(8331, 4972, 1, 3, 1, 11, 31, 331, 331, 3331, 8331, 62, 63, 'LIAAAA', 'GJHAAA', 'AAAAxx'),
+(403, 4973, 1, 3, 3, 3, 3, 403, 403, 403, 403, 6, 7, 'NPAAAA', 'HJHAAA', 'HHHHxx'),
+(8642, 4974, 0, 2, 2, 2, 42, 642, 642, 3642, 8642, 84, 85, 'KUAAAA', 'IJHAAA', 'OOOOxx'),
+(3118, 4975, 0, 2, 8, 18, 18, 118, 1118, 3118, 3118, 36, 37, 'YPAAAA', 'JJHAAA', 'VVVVxx'),
+(3835, 4976, 1, 3, 5, 15, 35, 835, 1835, 3835, 3835, 70, 71, 'NRAAAA', 'KJHAAA', 'AAAAxx'),
+(1117, 4977, 1, 1, 7, 17, 17, 117, 1117, 1117, 1117, 34, 35, 'ZQAAAA', 'LJHAAA', 'HHHHxx'),
+(7024, 4978, 0, 0, 4, 4, 24, 24, 1024, 2024, 7024, 48, 49, 'EKAAAA', 'MJHAAA', 'OOOOxx'),
+(2636, 4979, 0, 0, 6, 16, 36, 636, 636, 2636, 2636, 72, 73, 'KXAAAA', 'NJHAAA', 'VVVVxx'),
+(3778, 4980, 0, 2, 8, 18, 78, 778, 1778, 3778, 3778, 156, 157, 'IPAAAA', 'OJHAAA', 'AAAAxx'),
+(2003, 4981, 1, 3, 3, 3, 3, 3, 3, 2003, 2003, 6, 7, 'BZAAAA', 'PJHAAA', 'HHHHxx'),
+(5717, 4982, 1, 1, 7, 17, 17, 717, 1717, 717, 5717, 34, 35, 'XLAAAA', 'QJHAAA', 'OOOOxx'),
+(4869, 4983, 1, 1, 9, 9, 69, 869, 869, 4869, 4869, 138, 139, 'HFAAAA', 'RJHAAA', 'VVVVxx'),
+(8921, 4984, 1, 1, 1, 1, 21, 921, 921, 3921, 8921, 42, 43, 'DFAAAA', 'SJHAAA', 'AAAAxx'),
+(888, 4985, 0, 0, 8, 8, 88, 888, 888, 888, 888, 176, 177, 'EIAAAA', 'TJHAAA', 'HHHHxx'),
+(7599, 4986, 1, 3, 9, 19, 99, 599, 1599, 2599, 7599, 198, 199, 'HGAAAA', 'UJHAAA', 'OOOOxx'),
+(8621, 4987, 1, 1, 1, 1, 21, 621, 621, 3621, 8621, 42, 43, 'PTAAAA', 'VJHAAA', 'VVVVxx'),
+(811, 4988, 1, 3, 1, 11, 11, 811, 811, 811, 811, 22, 23, 'FFAAAA', 'WJHAAA', 'AAAAxx'),
+(9147, 4989, 1, 3, 7, 7, 47, 147, 1147, 4147, 9147, 94, 95, 'VNAAAA', 'XJHAAA', 'HHHHxx'),
+(1413, 4990, 1, 1, 3, 13, 13, 413, 1413, 1413, 1413, 26, 27, 'JCAAAA', 'YJHAAA', 'OOOOxx'),
+(5232, 4991, 0, 0, 2, 12, 32, 232, 1232, 232, 5232, 64, 65, 'GTAAAA', 'ZJHAAA', 'VVVVxx'),
+(5912, 4992, 0, 0, 2, 12, 12, 912, 1912, 912, 5912, 24, 25, 'KTAAAA', 'AKHAAA', 'AAAAxx'),
+(3418, 4993, 0, 2, 8, 18, 18, 418, 1418, 3418, 3418, 36, 37, 'MBAAAA', 'BKHAAA', 'HHHHxx'),
+(3912, 4994, 0, 0, 2, 12, 12, 912, 1912, 3912, 3912, 24, 25, 'MUAAAA', 'CKHAAA', 'OOOOxx'),
+(9576, 4995, 0, 0, 6, 16, 76, 576, 1576, 4576, 9576, 152, 153, 'IEAAAA', 'DKHAAA', 'VVVVxx'),
+(4225, 4996, 1, 1, 5, 5, 25, 225, 225, 4225, 4225, 50, 51, 'NGAAAA', 'EKHAAA', 'AAAAxx'),
+(8222, 4997, 0, 2, 2, 2, 22, 222, 222, 3222, 8222, 44, 45, 'GEAAAA', 'FKHAAA', 'HHHHxx'),
+(7013, 4998, 1, 1, 3, 13, 13, 13, 1013, 2013, 7013, 26, 27, 'TJAAAA', 'GKHAAA', 'OOOOxx'),
+(7037, 4999, 1, 1, 7, 17, 37, 37, 1037, 2037, 7037, 74, 75, 'RKAAAA', 'HKHAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(1205, 5000, 1, 1, 5, 5, 5, 205, 1205, 1205, 1205, 10, 11, 'JUAAAA', 'IKHAAA', 'AAAAxx'),
+(8114, 5001, 0, 2, 4, 14, 14, 114, 114, 3114, 8114, 28, 29, 'CAAAAA', 'JKHAAA', 'HHHHxx'),
+(6585, 5002, 1, 1, 5, 5, 85, 585, 585, 1585, 6585, 170, 171, 'HTAAAA', 'KKHAAA', 'OOOOxx'),
+(155, 5003, 1, 3, 5, 15, 55, 155, 155, 155, 155, 110, 111, 'ZFAAAA', 'LKHAAA', 'VVVVxx'),
+(2841, 5004, 1, 1, 1, 1, 41, 841, 841, 2841, 2841, 82, 83, 'HFAAAA', 'MKHAAA', 'AAAAxx'),
+(1996, 5005, 0, 0, 6, 16, 96, 996, 1996, 1996, 1996, 192, 193, 'UYAAAA', 'NKHAAA', 'HHHHxx'),
+(4948, 5006, 0, 0, 8, 8, 48, 948, 948, 4948, 4948, 96, 97, 'IIAAAA', 'OKHAAA', 'OOOOxx'),
+(3304, 5007, 0, 0, 4, 4, 4, 304, 1304, 3304, 3304, 8, 9, 'CXAAAA', 'PKHAAA', 'VVVVxx'),
+(5684, 5008, 0, 0, 4, 4, 84, 684, 1684, 684, 5684, 168, 169, 'QKAAAA', 'QKHAAA', 'AAAAxx'),
+(6962, 5009, 0, 2, 2, 2, 62, 962, 962, 1962, 6962, 124, 125, 'UHAAAA', 'RKHAAA', 'HHHHxx'),
+(8691, 5010, 1, 3, 1, 11, 91, 691, 691, 3691, 8691, 182, 183, 'HWAAAA', 'SKHAAA', 'OOOOxx'),
+(8501, 5011, 1, 1, 1, 1, 1, 501, 501, 3501, 8501, 2, 3, 'ZOAAAA', 'TKHAAA', 'VVVVxx'),
+(4783, 5012, 1, 3, 3, 3, 83, 783, 783, 4783, 4783, 166, 167, 'ZBAAAA', 'UKHAAA', 'AAAAxx'),
+(3762, 5013, 0, 2, 2, 2, 62, 762, 1762, 3762, 3762, 124, 125, 'SOAAAA', 'VKHAAA', 'HHHHxx'),
+(4534, 5014, 0, 2, 4, 14, 34, 534, 534, 4534, 4534, 68, 69, 'KSAAAA', 'WKHAAA', 'OOOOxx'),
+(4999, 5015, 1, 3, 9, 19, 99, 999, 999, 4999, 4999, 198, 199, 'HKAAAA', 'XKHAAA', 'VVVVxx'),
+(4618, 5016, 0, 2, 8, 18, 18, 618, 618, 4618, 4618, 36, 37, 'QVAAAA', 'YKHAAA', 'AAAAxx'),
+(4220, 5017, 0, 0, 0, 0, 20, 220, 220, 4220, 4220, 40, 41, 'IGAAAA', 'ZKHAAA', 'HHHHxx'),
+(3384, 5018, 0, 0, 4, 4, 84, 384, 1384, 3384, 3384, 168, 169, 'EAAAAA', 'ALHAAA', 'OOOOxx'),
+(3036, 5019, 0, 0, 6, 16, 36, 36, 1036, 3036, 3036, 72, 73, 'UMAAAA', 'BLHAAA', 'VVVVxx'),
+(545, 5020, 1, 1, 5, 5, 45, 545, 545, 545, 545, 90, 91, 'ZUAAAA', 'CLHAAA', 'AAAAxx'),
+(9946, 5021, 0, 2, 6, 6, 46, 946, 1946, 4946, 9946, 92, 93, 'OSAAAA', 'DLHAAA', 'HHHHxx'),
+(1985, 5022, 1, 1, 5, 5, 85, 985, 1985, 1985, 1985, 170, 171, 'JYAAAA', 'ELHAAA', 'OOOOxx'),
+(2310, 5023, 0, 2, 0, 10, 10, 310, 310, 2310, 2310, 20, 21, 'WKAAAA', 'FLHAAA', 'VVVVxx'),
+(6563, 5024, 1, 3, 3, 3, 63, 563, 563, 1563, 6563, 126, 127, 'LSAAAA', 'GLHAAA', 'AAAAxx'),
+(4886, 5025, 0, 2, 6, 6, 86, 886, 886, 4886, 4886, 172, 173, 'YFAAAA', 'HLHAAA', 'HHHHxx'),
+(9359, 5026, 1, 3, 9, 19, 59, 359, 1359, 4359, 9359, 118, 119, 'ZVAAAA', 'ILHAAA', 'OOOOxx'),
+(400, 5027, 0, 0, 0, 0, 0, 400, 400, 400, 400, 0, 1, 'KPAAAA', 'JLHAAA', 'VVVVxx'),
+(9742, 5028, 0, 2, 2, 2, 42, 742, 1742, 4742, 9742, 84, 85, 'SKAAAA', 'KLHAAA', 'AAAAxx'),
+(6736, 5029, 0, 0, 6, 16, 36, 736, 736, 1736, 6736, 72, 73, 'CZAAAA', 'LLHAAA', 'HHHHxx'),
+(8166, 5030, 0, 2, 6, 6, 66, 166, 166, 3166, 8166, 132, 133, 'CCAAAA', 'MLHAAA', 'OOOOxx'),
+(861, 5031, 1, 1, 1, 1, 61, 861, 861, 861, 861, 122, 123, 'DHAAAA', 'NLHAAA', 'VVVVxx'),
+(7492, 5032, 0, 0, 2, 12, 92, 492, 1492, 2492, 7492, 184, 185, 'ECAAAA', 'OLHAAA', 'AAAAxx'),
+(1155, 5033, 1, 3, 5, 15, 55, 155, 1155, 1155, 1155, 110, 111, 'LSAAAA', 'PLHAAA', 'HHHHxx'),
+(9769, 5034, 1, 1, 9, 9, 69, 769, 1769, 4769, 9769, 138, 139, 'TLAAAA', 'QLHAAA', 'OOOOxx'),
+(6843, 5035, 1, 3, 3, 3, 43, 843, 843, 1843, 6843, 86, 87, 'FDAAAA', 'RLHAAA', 'VVVVxx'),
+(5625, 5036, 1, 1, 5, 5, 25, 625, 1625, 625, 5625, 50, 51, 'JIAAAA', 'SLHAAA', 'AAAAxx'),
+(1910, 5037, 0, 2, 0, 10, 10, 910, 1910, 1910, 1910, 20, 21, 'MVAAAA', 'TLHAAA', 'HHHHxx'),
+(9796, 5038, 0, 0, 6, 16, 96, 796, 1796, 4796, 9796, 192, 193, 'UMAAAA', 'ULHAAA', 'OOOOxx'),
+(6950, 5039, 0, 2, 0, 10, 50, 950, 950, 1950, 6950, 100, 101, 'IHAAAA', 'VLHAAA', 'VVVVxx'),
+(3084, 5040, 0, 0, 4, 4, 84, 84, 1084, 3084, 3084, 168, 169, 'QOAAAA', 'WLHAAA', 'AAAAxx'),
+(2959, 5041, 1, 3, 9, 19, 59, 959, 959, 2959, 2959, 118, 119, 'VJAAAA', 'XLHAAA', 'HHHHxx'),
+(2093, 5042, 1, 1, 3, 13, 93, 93, 93, 2093, 2093, 186, 187, 'NCAAAA', 'YLHAAA', 'OOOOxx'),
+(2738, 5043, 0, 2, 8, 18, 38, 738, 738, 2738, 2738, 76, 77, 'IBAAAA', 'ZLHAAA', 'VVVVxx'),
+(6406, 5044, 0, 2, 6, 6, 6, 406, 406, 1406, 6406, 12, 13, 'KMAAAA', 'AMHAAA', 'AAAAxx'),
+(9082, 5045, 0, 2, 2, 2, 82, 82, 1082, 4082, 9082, 164, 165, 'ILAAAA', 'BMHAAA', 'HHHHxx'),
+(8568, 5046, 0, 0, 8, 8, 68, 568, 568, 3568, 8568, 136, 137, 'ORAAAA', 'CMHAAA', 'OOOOxx'),
+(3566, 5047, 0, 2, 6, 6, 66, 566, 1566, 3566, 3566, 132, 133, 'EHAAAA', 'DMHAAA', 'VVVVxx'),
+(3016, 5048, 0, 0, 6, 16, 16, 16, 1016, 3016, 3016, 32, 33, 'AMAAAA', 'EMHAAA', 'AAAAxx'),
+(1207, 5049, 1, 3, 7, 7, 7, 207, 1207, 1207, 1207, 14, 15, 'LUAAAA', 'FMHAAA', 'HHHHxx'),
+(4045, 5050, 1, 1, 5, 5, 45, 45, 45, 4045, 4045, 90, 91, 'PZAAAA', 'GMHAAA', 'OOOOxx'),
+(4173, 5051, 1, 1, 3, 13, 73, 173, 173, 4173, 4173, 146, 147, 'NEAAAA', 'HMHAAA', 'VVVVxx'),
+(3939, 5052, 1, 3, 9, 19, 39, 939, 1939, 3939, 3939, 78, 79, 'NVAAAA', 'IMHAAA', 'AAAAxx'),
+(9683, 5053, 1, 3, 3, 3, 83, 683, 1683, 4683, 9683, 166, 167, 'LIAAAA', 'JMHAAA', 'HHHHxx'),
+(1684, 5054, 0, 0, 4, 4, 84, 684, 1684, 1684, 1684, 168, 169, 'UMAAAA', 'KMHAAA', 'OOOOxx'),
+(9271, 5055, 1, 3, 1, 11, 71, 271, 1271, 4271, 9271, 142, 143, 'PSAAAA', 'LMHAAA', 'VVVVxx'),
+(9317, 5056, 1, 1, 7, 17, 17, 317, 1317, 4317, 9317, 34, 35, 'JUAAAA', 'MMHAAA', 'AAAAxx'),
+(5793, 5057, 1, 1, 3, 13, 93, 793, 1793, 793, 5793, 186, 187, 'VOAAAA', 'NMHAAA', 'HHHHxx'),
+(352, 5058, 0, 0, 2, 12, 52, 352, 352, 352, 352, 104, 105, 'ONAAAA', 'OMHAAA', 'OOOOxx'),
+(7328, 5059, 0, 0, 8, 8, 28, 328, 1328, 2328, 7328, 56, 57, 'WVAAAA', 'PMHAAA', 'VVVVxx'),
+(4582, 5060, 0, 2, 2, 2, 82, 582, 582, 4582, 4582, 164, 165, 'GUAAAA', 'QMHAAA', 'AAAAxx'),
+(7413, 5061, 1, 1, 3, 13, 13, 413, 1413, 2413, 7413, 26, 27, 'DZAAAA', 'RMHAAA', 'HHHHxx'),
+(6772, 5062, 0, 0, 2, 12, 72, 772, 772, 1772, 6772, 144, 145, 'MAAAAA', 'SMHAAA', 'OOOOxx'),
+(4973, 5063, 1, 1, 3, 13, 73, 973, 973, 4973, 4973, 146, 147, 'HJAAAA', 'TMHAAA', 'VVVVxx'),
+(7480, 5064, 0, 0, 0, 0, 80, 480, 1480, 2480, 7480, 160, 161, 'SBAAAA', 'UMHAAA', 'AAAAxx'),
+(5555, 5065, 1, 3, 5, 15, 55, 555, 1555, 555, 5555, 110, 111, 'RFAAAA', 'VMHAAA', 'HHHHxx'),
+(4227, 5066, 1, 3, 7, 7, 27, 227, 227, 4227, 4227, 54, 55, 'PGAAAA', 'WMHAAA', 'OOOOxx'),
+(4153, 5067, 1, 1, 3, 13, 53, 153, 153, 4153, 4153, 106, 107, 'TDAAAA', 'XMHAAA', 'VVVVxx'),
+(4601, 5068, 1, 1, 1, 1, 1, 601, 601, 4601, 4601, 2, 3, 'ZUAAAA', 'YMHAAA', 'AAAAxx'),
+(3782, 5069, 0, 2, 2, 2, 82, 782, 1782, 3782, 3782, 164, 165, 'MPAAAA', 'ZMHAAA', 'HHHHxx'),
+(3872, 5070, 0, 0, 2, 12, 72, 872, 1872, 3872, 3872, 144, 145, 'YSAAAA', 'ANHAAA', 'OOOOxx'),
+(893, 5071, 1, 1, 3, 13, 93, 893, 893, 893, 893, 186, 187, 'JIAAAA', 'BNHAAA', 'VVVVxx'),
+(2430, 5072, 0, 2, 0, 10, 30, 430, 430, 2430, 2430, 60, 61, 'MPAAAA', 'CNHAAA', 'AAAAxx'),
+(2591, 5073, 1, 3, 1, 11, 91, 591, 591, 2591, 2591, 182, 183, 'RVAAAA', 'DNHAAA', 'HHHHxx'),
+(264, 5074, 0, 0, 4, 4, 64, 264, 264, 264, 264, 128, 129, 'EKAAAA', 'ENHAAA', 'OOOOxx'),
+(6238, 5075, 0, 2, 8, 18, 38, 238, 238, 1238, 6238, 76, 77, 'YFAAAA', 'FNHAAA', 'VVVVxx'),
+(633, 5076, 1, 1, 3, 13, 33, 633, 633, 633, 633, 66, 67, 'JYAAAA', 'GNHAAA', 'AAAAxx'),
+(1029, 5077, 1, 1, 9, 9, 29, 29, 1029, 1029, 1029, 58, 59, 'PNAAAA', 'HNHAAA', 'HHHHxx'),
+(5934, 5078, 0, 2, 4, 14, 34, 934, 1934, 934, 5934, 68, 69, 'GUAAAA', 'INHAAA', 'OOOOxx'),
+(8694, 5079, 0, 2, 4, 14, 94, 694, 694, 3694, 8694, 188, 189, 'KWAAAA', 'JNHAAA', 'VVVVxx'),
+(7401, 5080, 1, 1, 1, 1, 1, 401, 1401, 2401, 7401, 2, 3, 'RYAAAA', 'KNHAAA', 'AAAAxx'),
+(1165, 5081, 1, 1, 5, 5, 65, 165, 1165, 1165, 1165, 130, 131, 'VSAAAA', 'LNHAAA', 'HHHHxx'),
+(9438, 5082, 0, 2, 8, 18, 38, 438, 1438, 4438, 9438, 76, 77, 'AZAAAA', 'MNHAAA', 'OOOOxx'),
+(4790, 5083, 0, 2, 0, 10, 90, 790, 790, 4790, 4790, 180, 181, 'GCAAAA', 'NNHAAA', 'VVVVxx'),
+(4531, 5084, 1, 3, 1, 11, 31, 531, 531, 4531, 4531, 62, 63, 'HSAAAA', 'ONHAAA', 'AAAAxx'),
+(6099, 5085, 1, 3, 9, 19, 99, 99, 99, 1099, 6099, 198, 199, 'PAAAAA', 'PNHAAA', 'HHHHxx'),
+(8236, 5086, 0, 0, 6, 16, 36, 236, 236, 3236, 8236, 72, 73, 'UEAAAA', 'QNHAAA', 'OOOOxx'),
+(8551, 5087, 1, 3, 1, 11, 51, 551, 551, 3551, 8551, 102, 103, 'XQAAAA', 'RNHAAA', 'VVVVxx'),
+(3128, 5088, 0, 0, 8, 8, 28, 128, 1128, 3128, 3128, 56, 57, 'IQAAAA', 'SNHAAA', 'AAAAxx'),
+(3504, 5089, 0, 0, 4, 4, 4, 504, 1504, 3504, 3504, 8, 9, 'UEAAAA', 'TNHAAA', 'HHHHxx'),
+(9071, 5090, 1, 3, 1, 11, 71, 71, 1071, 4071, 9071, 142, 143, 'XKAAAA', 'UNHAAA', 'OOOOxx'),
+(5930, 5091, 0, 2, 0, 10, 30, 930, 1930, 930, 5930, 60, 61, 'CUAAAA', 'VNHAAA', 'VVVVxx'),
+(6825, 5092, 1, 1, 5, 5, 25, 825, 825, 1825, 6825, 50, 51, 'NCAAAA', 'WNHAAA', 'AAAAxx'),
+(2218, 5093, 0, 2, 8, 18, 18, 218, 218, 2218, 2218, 36, 37, 'IHAAAA', 'XNHAAA', 'HHHHxx'),
+(3604, 5094, 0, 0, 4, 4, 4, 604, 1604, 3604, 3604, 8, 9, 'QIAAAA', 'YNHAAA', 'OOOOxx'),
+(5761, 5095, 1, 1, 1, 1, 61, 761, 1761, 761, 5761, 122, 123, 'PNAAAA', 'ZNHAAA', 'VVVVxx'),
+(5414, 5096, 0, 2, 4, 14, 14, 414, 1414, 414, 5414, 28, 29, 'GAAAAA', 'AOHAAA', 'AAAAxx'),
+(5892, 5097, 0, 0, 2, 12, 92, 892, 1892, 892, 5892, 184, 185, 'QSAAAA', 'BOHAAA', 'HHHHxx'),
+(4080, 5098, 0, 0, 0, 0, 80, 80, 80, 4080, 4080, 160, 161, 'YAAAAA', 'COHAAA', 'OOOOxx'),
+(8018, 5099, 0, 2, 8, 18, 18, 18, 18, 3018, 8018, 36, 37, 'KWAAAA', 'DOHAAA', 'VVVVxx'),
+(1757, 5100, 1, 1, 7, 17, 57, 757, 1757, 1757, 1757, 114, 115, 'PPAAAA', 'EOHAAA', 'AAAAxx'),
+(5854, 5101, 0, 2, 4, 14, 54, 854, 1854, 854, 5854, 108, 109, 'ERAAAA', 'FOHAAA', 'HHHHxx'),
+(1335, 5102, 1, 3, 5, 15, 35, 335, 1335, 1335, 1335, 70, 71, 'JZAAAA', 'GOHAAA', 'OOOOxx'),
+(3811, 5103, 1, 3, 1, 11, 11, 811, 1811, 3811, 3811, 22, 23, 'PQAAAA', 'HOHAAA', 'VVVVxx'),
+(9917, 5104, 1, 1, 7, 17, 17, 917, 1917, 4917, 9917, 34, 35, 'LRAAAA', 'IOHAAA', 'AAAAxx'),
+(5947, 5105, 1, 3, 7, 7, 47, 947, 1947, 947, 5947, 94, 95, 'TUAAAA', 'JOHAAA', 'HHHHxx'),
+(7263, 5106, 1, 3, 3, 3, 63, 263, 1263, 2263, 7263, 126, 127, 'JTAAAA', 'KOHAAA', 'OOOOxx'),
+(1730, 5107, 0, 2, 0, 10, 30, 730, 1730, 1730, 1730, 60, 61, 'OOAAAA', 'LOHAAA', 'VVVVxx'),
+(5747, 5108, 1, 3, 7, 7, 47, 747, 1747, 747, 5747, 94, 95, 'BNAAAA', 'MOHAAA', 'AAAAxx'),
+(3876, 5109, 0, 0, 6, 16, 76, 876, 1876, 3876, 3876, 152, 153, 'CTAAAA', 'NOHAAA', 'HHHHxx'),
+(2762, 5110, 0, 2, 2, 2, 62, 762, 762, 2762, 2762, 124, 125, 'GCAAAA', 'OOHAAA', 'OOOOxx'),
+(7613, 5111, 1, 1, 3, 13, 13, 613, 1613, 2613, 7613, 26, 27, 'VGAAAA', 'POHAAA', 'VVVVxx'),
+(152, 5112, 0, 0, 2, 12, 52, 152, 152, 152, 152, 104, 105, 'WFAAAA', 'QOHAAA', 'AAAAxx'),
+(3941, 5113, 1, 1, 1, 1, 41, 941, 1941, 3941, 3941, 82, 83, 'PVAAAA', 'ROHAAA', 'HHHHxx'),
+(5614, 5114, 0, 2, 4, 14, 14, 614, 1614, 614, 5614, 28, 29, 'YHAAAA', 'SOHAAA', 'OOOOxx'),
+(9279, 5115, 1, 3, 9, 19, 79, 279, 1279, 4279, 9279, 158, 159, 'XSAAAA', 'TOHAAA', 'VVVVxx'),
+(3048, 5116, 0, 0, 8, 8, 48, 48, 1048, 3048, 3048, 96, 97, 'GNAAAA', 'UOHAAA', 'AAAAxx'),
+(6152, 5117, 0, 0, 2, 12, 52, 152, 152, 1152, 6152, 104, 105, 'QCAAAA', 'VOHAAA', 'HHHHxx'),
+(5481, 5118, 1, 1, 1, 1, 81, 481, 1481, 481, 5481, 162, 163, 'VCAAAA', 'WOHAAA', 'OOOOxx'),
+(4675, 5119, 1, 3, 5, 15, 75, 675, 675, 4675, 4675, 150, 151, 'VXAAAA', 'XOHAAA', 'VVVVxx'),
+(3334, 5120, 0, 2, 4, 14, 34, 334, 1334, 3334, 3334, 68, 69, 'GYAAAA', 'YOHAAA', 'AAAAxx'),
+(4691, 5121, 1, 3, 1, 11, 91, 691, 691, 4691, 4691, 182, 183, 'LYAAAA', 'ZOHAAA', 'HHHHxx'),
+(803, 5122, 1, 3, 3, 3, 3, 803, 803, 803, 803, 6, 7, 'XEAAAA', 'APHAAA', 'OOOOxx'),
+(5409, 5123, 1, 1, 9, 9, 9, 409, 1409, 409, 5409, 18, 19, 'BAAAAA', 'BPHAAA', 'VVVVxx'),
+(1054, 5124, 0, 2, 4, 14, 54, 54, 1054, 1054, 1054, 108, 109, 'OOAAAA', 'CPHAAA', 'AAAAxx'),
+(103, 5125, 1, 3, 3, 3, 3, 103, 103, 103, 103, 6, 7, 'ZDAAAA', 'DPHAAA', 'HHHHxx'),
+(8565, 5126, 1, 1, 5, 5, 65, 565, 565, 3565, 8565, 130, 131, 'LRAAAA', 'EPHAAA', 'OOOOxx'),
+(4666, 5127, 0, 2, 6, 6, 66, 666, 666, 4666, 4666, 132, 133, 'MXAAAA', 'FPHAAA', 'VVVVxx'),
+(6634, 5128, 0, 2, 4, 14, 34, 634, 634, 1634, 6634, 68, 69, 'EVAAAA', 'GPHAAA', 'AAAAxx'),
+(5538, 5129, 0, 2, 8, 18, 38, 538, 1538, 538, 5538, 76, 77, 'AFAAAA', 'HPHAAA', 'HHHHxx'),
+(3789, 5130, 1, 1, 9, 9, 89, 789, 1789, 3789, 3789, 178, 179, 'TPAAAA', 'IPHAAA', 'OOOOxx'),
+(4641, 5131, 1, 1, 1, 1, 41, 641, 641, 4641, 4641, 82, 83, 'NWAAAA', 'JPHAAA', 'VVVVxx'),
+(2458, 5132, 0, 2, 8, 18, 58, 458, 458, 2458, 2458, 116, 117, 'OQAAAA', 'KPHAAA', 'AAAAxx'),
+(5667, 5133, 1, 3, 7, 7, 67, 667, 1667, 667, 5667, 134, 135, 'ZJAAAA', 'LPHAAA', 'HHHHxx'),
+(6524, 5134, 0, 0, 4, 4, 24, 524, 524, 1524, 6524, 48, 49, 'YQAAAA', 'MPHAAA', 'OOOOxx'),
+(9179, 5135, 1, 3, 9, 19, 79, 179, 1179, 4179, 9179, 158, 159, 'BPAAAA', 'NPHAAA', 'VVVVxx'),
+(6358, 5136, 0, 2, 8, 18, 58, 358, 358, 1358, 6358, 116, 117, 'OKAAAA', 'OPHAAA', 'AAAAxx'),
+(6668, 5137, 0, 0, 8, 8, 68, 668, 668, 1668, 6668, 136, 137, 'MWAAAA', 'PPHAAA', 'HHHHxx'),
+(6414, 5138, 0, 2, 4, 14, 14, 414, 414, 1414, 6414, 28, 29, 'SMAAAA', 'QPHAAA', 'OOOOxx'),
+(2813, 5139, 1, 1, 3, 13, 13, 813, 813, 2813, 2813, 26, 27, 'FEAAAA', 'RPHAAA', 'VVVVxx'),
+(8927, 5140, 1, 3, 7, 7, 27, 927, 927, 3927, 8927, 54, 55, 'JFAAAA', 'SPHAAA', 'AAAAxx'),
+(8695, 5141, 1, 3, 5, 15, 95, 695, 695, 3695, 8695, 190, 191, 'LWAAAA', 'TPHAAA', 'HHHHxx'),
+(363, 5142, 1, 3, 3, 3, 63, 363, 363, 363, 363, 126, 127, 'ZNAAAA', 'UPHAAA', 'OOOOxx'),
+(9966, 5143, 0, 2, 6, 6, 66, 966, 1966, 4966, 9966, 132, 133, 'ITAAAA', 'VPHAAA', 'VVVVxx'),
+(1323, 5144, 1, 3, 3, 3, 23, 323, 1323, 1323, 1323, 46, 47, 'XYAAAA', 'WPHAAA', 'AAAAxx'),
+(8211, 5145, 1, 3, 1, 11, 11, 211, 211, 3211, 8211, 22, 23, 'VDAAAA', 'XPHAAA', 'HHHHxx'),
+(4375, 5146, 1, 3, 5, 15, 75, 375, 375, 4375, 4375, 150, 151, 'HMAAAA', 'YPHAAA', 'OOOOxx'),
+(3257, 5147, 1, 1, 7, 17, 57, 257, 1257, 3257, 3257, 114, 115, 'HVAAAA', 'ZPHAAA', 'VVVVxx'),
+(6239, 5148, 1, 3, 9, 19, 39, 239, 239, 1239, 6239, 78, 79, 'ZFAAAA', 'AQHAAA', 'AAAAxx'),
+(3602, 5149, 0, 2, 2, 2, 2, 602, 1602, 3602, 3602, 4, 5, 'OIAAAA', 'BQHAAA', 'HHHHxx'),
+(9830, 5150, 0, 2, 0, 10, 30, 830, 1830, 4830, 9830, 60, 61, 'COAAAA', 'CQHAAA', 'OOOOxx'),
+(7826, 5151, 0, 2, 6, 6, 26, 826, 1826, 2826, 7826, 52, 53, 'APAAAA', 'DQHAAA', 'VVVVxx'),
+(2108, 5152, 0, 0, 8, 8, 8, 108, 108, 2108, 2108, 16, 17, 'CDAAAA', 'EQHAAA', 'AAAAxx'),
+(7245, 5153, 1, 1, 5, 5, 45, 245, 1245, 2245, 7245, 90, 91, 'RSAAAA', 'FQHAAA', 'HHHHxx'),
+(8330, 5154, 0, 2, 0, 10, 30, 330, 330, 3330, 8330, 60, 61, 'KIAAAA', 'GQHAAA', 'OOOOxx'),
+(7441, 5155, 1, 1, 1, 1, 41, 441, 1441, 2441, 7441, 82, 83, 'FAAAAA', 'HQHAAA', 'VVVVxx'),
+(9848, 5156, 0, 0, 8, 8, 48, 848, 1848, 4848, 9848, 96, 97, 'UOAAAA', 'IQHAAA', 'AAAAxx'),
+(1226, 5157, 0, 2, 6, 6, 26, 226, 1226, 1226, 1226, 52, 53, 'EVAAAA', 'JQHAAA', 'HHHHxx'),
+(414, 5158, 0, 2, 4, 14, 14, 414, 414, 414, 414, 28, 29, 'YPAAAA', 'KQHAAA', 'OOOOxx'),
+(1273, 5159, 1, 1, 3, 13, 73, 273, 1273, 1273, 1273, 146, 147, 'ZWAAAA', 'LQHAAA', 'VVVVxx'),
+(9866, 5160, 0, 2, 6, 6, 66, 866, 1866, 4866, 9866, 132, 133, 'MPAAAA', 'MQHAAA', 'AAAAxx'),
+(4633, 5161, 1, 1, 3, 13, 33, 633, 633, 4633, 4633, 66, 67, 'FWAAAA', 'NQHAAA', 'HHHHxx'),
+(8727, 5162, 1, 3, 7, 7, 27, 727, 727, 3727, 8727, 54, 55, 'RXAAAA', 'OQHAAA', 'OOOOxx'),
+(5308, 5163, 0, 0, 8, 8, 8, 308, 1308, 308, 5308, 16, 17, 'EWAAAA', 'PQHAAA', 'VVVVxx'),
+(1395, 5164, 1, 3, 5, 15, 95, 395, 1395, 1395, 1395, 190, 191, 'RBAAAA', 'QQHAAA', 'AAAAxx'),
+(1825, 5165, 1, 1, 5, 5, 25, 825, 1825, 1825, 1825, 50, 51, 'FSAAAA', 'RQHAAA', 'HHHHxx'),
+(7606, 5166, 0, 2, 6, 6, 6, 606, 1606, 2606, 7606, 12, 13, 'OGAAAA', 'SQHAAA', 'OOOOxx'),
+(9390, 5167, 0, 2, 0, 10, 90, 390, 1390, 4390, 9390, 180, 181, 'EXAAAA', 'TQHAAA', 'VVVVxx'),
+(2376, 5168, 0, 0, 6, 16, 76, 376, 376, 2376, 2376, 152, 153, 'KNAAAA', 'UQHAAA', 'AAAAxx'),
+(2377, 5169, 1, 1, 7, 17, 77, 377, 377, 2377, 2377, 154, 155, 'LNAAAA', 'VQHAAA', 'HHHHxx'),
+(5346, 5170, 0, 2, 6, 6, 46, 346, 1346, 346, 5346, 92, 93, 'QXAAAA', 'WQHAAA', 'OOOOxx'),
+(4140, 5171, 0, 0, 0, 0, 40, 140, 140, 4140, 4140, 80, 81, 'GDAAAA', 'XQHAAA', 'VVVVxx'),
+(6032, 5172, 0, 0, 2, 12, 32, 32, 32, 1032, 6032, 64, 65, 'AYAAAA', 'YQHAAA', 'AAAAxx'),
+(9453, 5173, 1, 1, 3, 13, 53, 453, 1453, 4453, 9453, 106, 107, 'PZAAAA', 'ZQHAAA', 'HHHHxx'),
+(9297, 5174, 1, 1, 7, 17, 97, 297, 1297, 4297, 9297, 194, 195, 'PTAAAA', 'ARHAAA', 'OOOOxx'),
+(6455, 5175, 1, 3, 5, 15, 55, 455, 455, 1455, 6455, 110, 111, 'HOAAAA', 'BRHAAA', 'VVVVxx'),
+(4458, 5176, 0, 2, 8, 18, 58, 458, 458, 4458, 4458, 116, 117, 'MPAAAA', 'CRHAAA', 'AAAAxx'),
+(9516, 5177, 0, 0, 6, 16, 16, 516, 1516, 4516, 9516, 32, 33, 'ACAAAA', 'DRHAAA', 'HHHHxx'),
+(6211, 5178, 1, 3, 1, 11, 11, 211, 211, 1211, 6211, 22, 23, 'XEAAAA', 'ERHAAA', 'OOOOxx'),
+(526, 5179, 0, 2, 6, 6, 26, 526, 526, 526, 526, 52, 53, 'GUAAAA', 'FRHAAA', 'VVVVxx'),
+(3570, 5180, 0, 2, 0, 10, 70, 570, 1570, 3570, 3570, 140, 141, 'IHAAAA', 'GRHAAA', 'AAAAxx'),
+(4885, 5181, 1, 1, 5, 5, 85, 885, 885, 4885, 4885, 170, 171, 'XFAAAA', 'HRHAAA', 'HHHHxx'),
+(6390, 5182, 0, 2, 0, 10, 90, 390, 390, 1390, 6390, 180, 181, 'ULAAAA', 'IRHAAA', 'OOOOxx'),
+(1606, 5183, 0, 2, 6, 6, 6, 606, 1606, 1606, 1606, 12, 13, 'UJAAAA', 'JRHAAA', 'VVVVxx'),
+(7850, 5184, 0, 2, 0, 10, 50, 850, 1850, 2850, 7850, 100, 101, 'YPAAAA', 'KRHAAA', 'AAAAxx'),
+(3315, 5185, 1, 3, 5, 15, 15, 315, 1315, 3315, 3315, 30, 31, 'NXAAAA', 'LRHAAA', 'HHHHxx'),
+(8322, 5186, 0, 2, 2, 2, 22, 322, 322, 3322, 8322, 44, 45, 'CIAAAA', 'MRHAAA', 'OOOOxx'),
+(3703, 5187, 1, 3, 3, 3, 3, 703, 1703, 3703, 3703, 6, 7, 'LMAAAA', 'NRHAAA', 'VVVVxx'),
+(9489, 5188, 1, 1, 9, 9, 89, 489, 1489, 4489, 9489, 178, 179, 'ZAAAAA', 'ORHAAA', 'AAAAxx'),
+(6104, 5189, 0, 0, 4, 4, 4, 104, 104, 1104, 6104, 8, 9, 'UAAAAA', 'PRHAAA', 'HHHHxx'),
+(3067, 5190, 1, 3, 7, 7, 67, 67, 1067, 3067, 3067, 134, 135, 'ZNAAAA', 'QRHAAA', 'OOOOxx'),
+(2521, 5191, 1, 1, 1, 1, 21, 521, 521, 2521, 2521, 42, 43, 'ZSAAAA', 'RRHAAA', 'VVVVxx'),
+(2581, 5192, 1, 1, 1, 1, 81, 581, 581, 2581, 2581, 162, 163, 'HVAAAA', 'SRHAAA', 'AAAAxx'),
+(595, 5193, 1, 3, 5, 15, 95, 595, 595, 595, 595, 190, 191, 'XWAAAA', 'TRHAAA', 'HHHHxx'),
+(8291, 5194, 1, 3, 1, 11, 91, 291, 291, 3291, 8291, 182, 183, 'XGAAAA', 'URHAAA', 'OOOOxx'),
+(1727, 5195, 1, 3, 7, 7, 27, 727, 1727, 1727, 1727, 54, 55, 'LOAAAA', 'VRHAAA', 'VVVVxx'),
+(6847, 5196, 1, 3, 7, 7, 47, 847, 847, 1847, 6847, 94, 95, 'JDAAAA', 'WRHAAA', 'AAAAxx'),
+(7494, 5197, 0, 2, 4, 14, 94, 494, 1494, 2494, 7494, 188, 189, 'GCAAAA', 'XRHAAA', 'HHHHxx'),
+(7093, 5198, 1, 1, 3, 13, 93, 93, 1093, 2093, 7093, 186, 187, 'VMAAAA', 'YRHAAA', 'OOOOxx'),
+(7357, 5199, 1, 1, 7, 17, 57, 357, 1357, 2357, 7357, 114, 115, 'ZWAAAA', 'ZRHAAA', 'VVVVxx'),
+(620, 5200, 0, 0, 0, 0, 20, 620, 620, 620, 620, 40, 41, 'WXAAAA', 'ASHAAA', 'AAAAxx'),
+(2460, 5201, 0, 0, 0, 0, 60, 460, 460, 2460, 2460, 120, 121, 'QQAAAA', 'BSHAAA', 'HHHHxx'),
+(1598, 5202, 0, 2, 8, 18, 98, 598, 1598, 1598, 1598, 196, 197, 'MJAAAA', 'CSHAAA', 'OOOOxx'),
+(4112, 5203, 0, 0, 2, 12, 12, 112, 112, 4112, 4112, 24, 25, 'ECAAAA', 'DSHAAA', 'VVVVxx'),
+(2956, 5204, 0, 0, 6, 16, 56, 956, 956, 2956, 2956, 112, 113, 'SJAAAA', 'ESHAAA', 'AAAAxx'),
+(3193, 5205, 1, 1, 3, 13, 93, 193, 1193, 3193, 3193, 186, 187, 'VSAAAA', 'FSHAAA', 'HHHHxx'),
+(6356, 5206, 0, 0, 6, 16, 56, 356, 356, 1356, 6356, 112, 113, 'MKAAAA', 'GSHAAA', 'OOOOxx'),
+(730, 5207, 0, 2, 0, 10, 30, 730, 730, 730, 730, 60, 61, 'CCAAAA', 'HSHAAA', 'VVVVxx'),
+(8826, 5208, 0, 2, 6, 6, 26, 826, 826, 3826, 8826, 52, 53, 'MBAAAA', 'ISHAAA', 'AAAAxx'),
+(9036, 5209, 0, 0, 6, 16, 36, 36, 1036, 4036, 9036, 72, 73, 'OJAAAA', 'JSHAAA', 'HHHHxx'),
+(2085, 5210, 1, 1, 5, 5, 85, 85, 85, 2085, 2085, 170, 171, 'FCAAAA', 'KSHAAA', 'OOOOxx'),
+(9007, 5211, 1, 3, 7, 7, 7, 7, 1007, 4007, 9007, 14, 15, 'LIAAAA', 'LSHAAA', 'VVVVxx'),
+(6047, 5212, 1, 3, 7, 7, 47, 47, 47, 1047, 6047, 94, 95, 'PYAAAA', 'MSHAAA', 'AAAAxx'),
+(3953, 5213, 1, 1, 3, 13, 53, 953, 1953, 3953, 3953, 106, 107, 'BWAAAA', 'NSHAAA', 'HHHHxx'),
+(1214, 5214, 0, 2, 4, 14, 14, 214, 1214, 1214, 1214, 28, 29, 'SUAAAA', 'OSHAAA', 'OOOOxx'),
+(4814, 5215, 0, 2, 4, 14, 14, 814, 814, 4814, 4814, 28, 29, 'EDAAAA', 'PSHAAA', 'VVVVxx'),
+(5738, 5216, 0, 2, 8, 18, 38, 738, 1738, 738, 5738, 76, 77, 'SMAAAA', 'QSHAAA', 'AAAAxx'),
+(7176, 5217, 0, 0, 6, 16, 76, 176, 1176, 2176, 7176, 152, 153, 'AQAAAA', 'RSHAAA', 'HHHHxx'),
+(3609, 5218, 1, 1, 9, 9, 9, 609, 1609, 3609, 3609, 18, 19, 'VIAAAA', 'SSHAAA', 'OOOOxx'),
+(592, 5219, 0, 0, 2, 12, 92, 592, 592, 592, 592, 184, 185, 'UWAAAA', 'TSHAAA', 'VVVVxx'),
+(9391, 5220, 1, 3, 1, 11, 91, 391, 1391, 4391, 9391, 182, 183, 'FXAAAA', 'USHAAA', 'AAAAxx'),
+(5345, 5221, 1, 1, 5, 5, 45, 345, 1345, 345, 5345, 90, 91, 'PXAAAA', 'VSHAAA', 'HHHHxx'),
+(1171, 5222, 1, 3, 1, 11, 71, 171, 1171, 1171, 1171, 142, 143, 'BTAAAA', 'WSHAAA', 'OOOOxx'),
+(7238, 5223, 0, 2, 8, 18, 38, 238, 1238, 2238, 7238, 76, 77, 'KSAAAA', 'XSHAAA', 'VVVVxx'),
+(7561, 5224, 1, 1, 1, 1, 61, 561, 1561, 2561, 7561, 122, 123, 'VEAAAA', 'YSHAAA', 'AAAAxx'),
+(5876, 5225, 0, 0, 6, 16, 76, 876, 1876, 876, 5876, 152, 153, 'ASAAAA', 'ZSHAAA', 'HHHHxx'),
+(6611, 5226, 1, 3, 1, 11, 11, 611, 611, 1611, 6611, 22, 23, 'HUAAAA', 'ATHAAA', 'OOOOxx'),
+(7300, 5227, 0, 0, 0, 0, 0, 300, 1300, 2300, 7300, 0, 1, 'UUAAAA', 'BTHAAA', 'VVVVxx'),
+(1506, 5228, 0, 2, 6, 6, 6, 506, 1506, 1506, 1506, 12, 13, 'YFAAAA', 'CTHAAA', 'AAAAxx'),
+(1153, 5229, 1, 1, 3, 13, 53, 153, 1153, 1153, 1153, 106, 107, 'JSAAAA', 'DTHAAA', 'HHHHxx'),
+(3831, 5230, 1, 3, 1, 11, 31, 831, 1831, 3831, 3831, 62, 63, 'JRAAAA', 'ETHAAA', 'OOOOxx'),
+(9255, 5231, 1, 3, 5, 15, 55, 255, 1255, 4255, 9255, 110, 111, 'ZRAAAA', 'FTHAAA', 'VVVVxx'),
+(1841, 5232, 1, 1, 1, 1, 41, 841, 1841, 1841, 1841, 82, 83, 'VSAAAA', 'GTHAAA', 'AAAAxx'),
+(5075, 5233, 1, 3, 5, 15, 75, 75, 1075, 75, 5075, 150, 151, 'FNAAAA', 'HTHAAA', 'HHHHxx'),
+(101, 5234, 1, 1, 1, 1, 1, 101, 101, 101, 101, 2, 3, 'XDAAAA', 'ITHAAA', 'OOOOxx'),
+(2627, 5235, 1, 3, 7, 7, 27, 627, 627, 2627, 2627, 54, 55, 'BXAAAA', 'JTHAAA', 'VVVVxx'),
+(7078, 5236, 0, 2, 8, 18, 78, 78, 1078, 2078, 7078, 156, 157, 'GMAAAA', 'KTHAAA', 'AAAAxx'),
+(2850, 5237, 0, 2, 0, 10, 50, 850, 850, 2850, 2850, 100, 101, 'QFAAAA', 'LTHAAA', 'HHHHxx'),
+(8703, 5238, 1, 3, 3, 3, 3, 703, 703, 3703, 8703, 6, 7, 'TWAAAA', 'MTHAAA', 'OOOOxx'),
+(4101, 5239, 1, 1, 1, 1, 1, 101, 101, 4101, 4101, 2, 3, 'TBAAAA', 'NTHAAA', 'VVVVxx'),
+(318, 5240, 0, 2, 8, 18, 18, 318, 318, 318, 318, 36, 37, 'GMAAAA', 'OTHAAA', 'AAAAxx'),
+(6452, 5241, 0, 0, 2, 12, 52, 452, 452, 1452, 6452, 104, 105, 'EOAAAA', 'PTHAAA', 'HHHHxx'),
+(5558, 5242, 0, 2, 8, 18, 58, 558, 1558, 558, 5558, 116, 117, 'UFAAAA', 'QTHAAA', 'OOOOxx'),
+(3127, 5243, 1, 3, 7, 7, 27, 127, 1127, 3127, 3127, 54, 55, 'HQAAAA', 'RTHAAA', 'VVVVxx'),
+(535, 5244, 1, 3, 5, 15, 35, 535, 535, 535, 535, 70, 71, 'PUAAAA', 'STHAAA', 'AAAAxx'),
+(270, 5245, 0, 2, 0, 10, 70, 270, 270, 270, 270, 140, 141, 'KKAAAA', 'TTHAAA', 'HHHHxx'),
+(4038, 5246, 0, 2, 8, 18, 38, 38, 38, 4038, 4038, 76, 77, 'IZAAAA', 'UTHAAA', 'OOOOxx'),
+(3404, 5247, 0, 0, 4, 4, 4, 404, 1404, 3404, 3404, 8, 9, 'YAAAAA', 'VTHAAA', 'VVVVxx'),
+(2374, 5248, 0, 2, 4, 14, 74, 374, 374, 2374, 2374, 148, 149, 'INAAAA', 'WTHAAA', 'AAAAxx'),
+(6446, 5249, 0, 2, 6, 6, 46, 446, 446, 1446, 6446, 92, 93, 'YNAAAA', 'XTHAAA', 'HHHHxx'),
+(7758, 5250, 0, 2, 8, 18, 58, 758, 1758, 2758, 7758, 116, 117, 'KMAAAA', 'YTHAAA', 'OOOOxx'),
+(356, 5251, 0, 0, 6, 16, 56, 356, 356, 356, 356, 112, 113, 'SNAAAA', 'ZTHAAA', 'VVVVxx'),
+(9197, 5252, 1, 1, 7, 17, 97, 197, 1197, 4197, 9197, 194, 195, 'TPAAAA', 'AUHAAA', 'AAAAxx'),
+(9765, 5253, 1, 1, 5, 5, 65, 765, 1765, 4765, 9765, 130, 131, 'PLAAAA', 'BUHAAA', 'HHHHxx'),
+(4974, 5254, 0, 2, 4, 14, 74, 974, 974, 4974, 4974, 148, 149, 'IJAAAA', 'CUHAAA', 'OOOOxx'),
+(442, 5255, 0, 2, 2, 2, 42, 442, 442, 442, 442, 84, 85, 'ARAAAA', 'DUHAAA', 'VVVVxx'),
+(4349, 5256, 1, 1, 9, 9, 49, 349, 349, 4349, 4349, 98, 99, 'HLAAAA', 'EUHAAA', 'AAAAxx'),
+(6119, 5257, 1, 3, 9, 19, 19, 119, 119, 1119, 6119, 38, 39, 'JBAAAA', 'FUHAAA', 'HHHHxx'),
+(7574, 5258, 0, 2, 4, 14, 74, 574, 1574, 2574, 7574, 148, 149, 'IFAAAA', 'GUHAAA', 'OOOOxx'),
+(4445, 5259, 1, 1, 5, 5, 45, 445, 445, 4445, 4445, 90, 91, 'ZOAAAA', 'HUHAAA', 'VVVVxx'),
+(940, 5260, 0, 0, 0, 0, 40, 940, 940, 940, 940, 80, 81, 'EKAAAA', 'IUHAAA', 'AAAAxx'),
+(1875, 5261, 1, 3, 5, 15, 75, 875, 1875, 1875, 1875, 150, 151, 'DUAAAA', 'JUHAAA', 'HHHHxx'),
+(5951, 5262, 1, 3, 1, 11, 51, 951, 1951, 951, 5951, 102, 103, 'XUAAAA', 'KUHAAA', 'OOOOxx'),
+(9132, 5263, 0, 0, 2, 12, 32, 132, 1132, 4132, 9132, 64, 65, 'GNAAAA', 'LUHAAA', 'VVVVxx'),
+(6913, 5264, 1, 1, 3, 13, 13, 913, 913, 1913, 6913, 26, 27, 'XFAAAA', 'MUHAAA', 'AAAAxx'),
+(3308, 5265, 0, 0, 8, 8, 8, 308, 1308, 3308, 3308, 16, 17, 'GXAAAA', 'NUHAAA', 'HHHHxx'),
+(7553, 5266, 1, 1, 3, 13, 53, 553, 1553, 2553, 7553, 106, 107, 'NEAAAA', 'OUHAAA', 'OOOOxx'),
+(2138, 5267, 0, 2, 8, 18, 38, 138, 138, 2138, 2138, 76, 77, 'GEAAAA', 'PUHAAA', 'VVVVxx'),
+(6252, 5268, 0, 0, 2, 12, 52, 252, 252, 1252, 6252, 104, 105, 'MGAAAA', 'QUHAAA', 'AAAAxx'),
+(2171, 5269, 1, 3, 1, 11, 71, 171, 171, 2171, 2171, 142, 143, 'NFAAAA', 'RUHAAA', 'HHHHxx'),
+(4159, 5270, 1, 3, 9, 19, 59, 159, 159, 4159, 4159, 118, 119, 'ZDAAAA', 'SUHAAA', 'OOOOxx'),
+(2401, 5271, 1, 1, 1, 1, 1, 401, 401, 2401, 2401, 2, 3, 'JOAAAA', 'TUHAAA', 'VVVVxx'),
+(6553, 5272, 1, 1, 3, 13, 53, 553, 553, 1553, 6553, 106, 107, 'BSAAAA', 'UUHAAA', 'AAAAxx'),
+(5217, 5273, 1, 1, 7, 17, 17, 217, 1217, 217, 5217, 34, 35, 'RSAAAA', 'VUHAAA', 'HHHHxx'),
+(1405, 5274, 1, 1, 5, 5, 5, 405, 1405, 1405, 1405, 10, 11, 'BCAAAA', 'WUHAAA', 'OOOOxx'),
+(1494, 5275, 0, 2, 4, 14, 94, 494, 1494, 1494, 1494, 188, 189, 'MFAAAA', 'XUHAAA', 'VVVVxx'),
+(5553, 5276, 1, 1, 3, 13, 53, 553, 1553, 553, 5553, 106, 107, 'PFAAAA', 'YUHAAA', 'AAAAxx'),
+(8296, 5277, 0, 0, 6, 16, 96, 296, 296, 3296, 8296, 192, 193, 'CHAAAA', 'ZUHAAA', 'HHHHxx'),
+(6565, 5278, 1, 1, 5, 5, 65, 565, 565, 1565, 6565, 130, 131, 'NSAAAA', 'AVHAAA', 'OOOOxx'),
+(817, 5279, 1, 1, 7, 17, 17, 817, 817, 817, 817, 34, 35, 'LFAAAA', 'BVHAAA', 'VVVVxx'),
+(6947, 5280, 1, 3, 7, 7, 47, 947, 947, 1947, 6947, 94, 95, 'FHAAAA', 'CVHAAA', 'AAAAxx'),
+(4184, 5281, 0, 0, 4, 4, 84, 184, 184, 4184, 4184, 168, 169, 'YEAAAA', 'DVHAAA', 'HHHHxx'),
+(6577, 5282, 1, 1, 7, 17, 77, 577, 577, 1577, 6577, 154, 155, 'ZSAAAA', 'EVHAAA', 'OOOOxx'),
+(6424, 5283, 0, 0, 4, 4, 24, 424, 424, 1424, 6424, 48, 49, 'CNAAAA', 'FVHAAA', 'VVVVxx'),
+(2482, 5284, 0, 2, 2, 2, 82, 482, 482, 2482, 2482, 164, 165, 'MRAAAA', 'GVHAAA', 'AAAAxx'),
+(6874, 5285, 0, 2, 4, 14, 74, 874, 874, 1874, 6874, 148, 149, 'KEAAAA', 'HVHAAA', 'HHHHxx'),
+(7601, 5286, 1, 1, 1, 1, 1, 601, 1601, 2601, 7601, 2, 3, 'JGAAAA', 'IVHAAA', 'OOOOxx'),
+(4552, 5287, 0, 0, 2, 12, 52, 552, 552, 4552, 4552, 104, 105, 'CTAAAA', 'JVHAAA', 'VVVVxx'),
+(8406, 5288, 0, 2, 6, 6, 6, 406, 406, 3406, 8406, 12, 13, 'ILAAAA', 'KVHAAA', 'AAAAxx'),
+(2924, 5289, 0, 0, 4, 4, 24, 924, 924, 2924, 2924, 48, 49, 'MIAAAA', 'LVHAAA', 'HHHHxx'),
+(8255, 5290, 1, 3, 5, 15, 55, 255, 255, 3255, 8255, 110, 111, 'NFAAAA', 'MVHAAA', 'OOOOxx'),
+(4920, 5291, 0, 0, 0, 0, 20, 920, 920, 4920, 4920, 40, 41, 'GHAAAA', 'NVHAAA', 'VVVVxx'),
+(228, 5292, 0, 0, 8, 8, 28, 228, 228, 228, 228, 56, 57, 'UIAAAA', 'OVHAAA', 'AAAAxx'),
+(9431, 5293, 1, 3, 1, 11, 31, 431, 1431, 4431, 9431, 62, 63, 'TYAAAA', 'PVHAAA', 'HHHHxx'),
+(4021, 5294, 1, 1, 1, 1, 21, 21, 21, 4021, 4021, 42, 43, 'RYAAAA', 'QVHAAA', 'OOOOxx'),
+(2966, 5295, 0, 2, 6, 6, 66, 966, 966, 2966, 2966, 132, 133, 'CKAAAA', 'RVHAAA', 'VVVVxx'),
+(2862, 5296, 0, 2, 2, 2, 62, 862, 862, 2862, 2862, 124, 125, 'CGAAAA', 'SVHAAA', 'AAAAxx'),
+(4303, 5297, 1, 3, 3, 3, 3, 303, 303, 4303, 4303, 6, 7, 'NJAAAA', 'TVHAAA', 'HHHHxx'),
+(9643, 5298, 1, 3, 3, 3, 43, 643, 1643, 4643, 9643, 86, 87, 'XGAAAA', 'UVHAAA', 'OOOOxx'),
+(3008, 5299, 0, 0, 8, 8, 8, 8, 1008, 3008, 3008, 16, 17, 'SLAAAA', 'VVHAAA', 'VVVVxx'),
+(7476, 5300, 0, 0, 6, 16, 76, 476, 1476, 2476, 7476, 152, 153, 'OBAAAA', 'WVHAAA', 'AAAAxx'),
+(3686, 5301, 0, 2, 6, 6, 86, 686, 1686, 3686, 3686, 172, 173, 'ULAAAA', 'XVHAAA', 'HHHHxx'),
+(9051, 5302, 1, 3, 1, 11, 51, 51, 1051, 4051, 9051, 102, 103, 'DKAAAA', 'YVHAAA', 'OOOOxx'),
+(6592, 5303, 0, 0, 2, 12, 92, 592, 592, 1592, 6592, 184, 185, 'OTAAAA', 'ZVHAAA', 'VVVVxx'),
+(924, 5304, 0, 0, 4, 4, 24, 924, 924, 924, 924, 48, 49, 'OJAAAA', 'AWHAAA', 'AAAAxx'),
+(4406, 5305, 0, 2, 6, 6, 6, 406, 406, 4406, 4406, 12, 13, 'MNAAAA', 'BWHAAA', 'HHHHxx'),
+(5233, 5306, 1, 1, 3, 13, 33, 233, 1233, 233, 5233, 66, 67, 'HTAAAA', 'CWHAAA', 'OOOOxx'),
+(8881, 5307, 1, 1, 1, 1, 81, 881, 881, 3881, 8881, 162, 163, 'PDAAAA', 'DWHAAA', 'VVVVxx'),
+(2212, 5308, 0, 0, 2, 12, 12, 212, 212, 2212, 2212, 24, 25, 'CHAAAA', 'EWHAAA', 'AAAAxx'),
+(5804, 5309, 0, 0, 4, 4, 4, 804, 1804, 804, 5804, 8, 9, 'GPAAAA', 'FWHAAA', 'HHHHxx'),
+(2990, 5310, 0, 2, 0, 10, 90, 990, 990, 2990, 2990, 180, 181, 'ALAAAA', 'GWHAAA', 'OOOOxx'),
+(4069, 5311, 1, 1, 9, 9, 69, 69, 69, 4069, 4069, 138, 139, 'NAAAAA', 'HWHAAA', 'VVVVxx'),
+(5380, 5312, 0, 0, 0, 0, 80, 380, 1380, 380, 5380, 160, 161, 'YYAAAA', 'IWHAAA', 'AAAAxx'),
+(5016, 5313, 0, 0, 6, 16, 16, 16, 1016, 16, 5016, 32, 33, 'YKAAAA', 'JWHAAA', 'HHHHxx'),
+(5056, 5314, 0, 0, 6, 16, 56, 56, 1056, 56, 5056, 112, 113, 'MMAAAA', 'KWHAAA', 'OOOOxx'),
+(3732, 5315, 0, 0, 2, 12, 32, 732, 1732, 3732, 3732, 64, 65, 'ONAAAA', 'LWHAAA', 'VVVVxx'),
+(5527, 5316, 1, 3, 7, 7, 27, 527, 1527, 527, 5527, 54, 55, 'PEAAAA', 'MWHAAA', 'AAAAxx'),
+(1151, 5317, 1, 3, 1, 11, 51, 151, 1151, 1151, 1151, 102, 103, 'HSAAAA', 'NWHAAA', 'HHHHxx'),
+(7900, 5318, 0, 0, 0, 0, 0, 900, 1900, 2900, 7900, 0, 1, 'WRAAAA', 'OWHAAA', 'OOOOxx'),
+(1660, 5319, 0, 0, 0, 0, 60, 660, 1660, 1660, 1660, 120, 121, 'WLAAAA', 'PWHAAA', 'VVVVxx'),
+(8064, 5320, 0, 0, 4, 4, 64, 64, 64, 3064, 8064, 128, 129, 'EYAAAA', 'QWHAAA', 'AAAAxx'),
+(8240, 5321, 0, 0, 0, 0, 40, 240, 240, 3240, 8240, 80, 81, 'YEAAAA', 'RWHAAA', 'HHHHxx'),
+(413, 5322, 1, 1, 3, 13, 13, 413, 413, 413, 413, 26, 27, 'XPAAAA', 'SWHAAA', 'OOOOxx'),
+(8311, 5323, 1, 3, 1, 11, 11, 311, 311, 3311, 8311, 22, 23, 'RHAAAA', 'TWHAAA', 'VVVVxx'),
+(1065, 5324, 1, 1, 5, 5, 65, 65, 1065, 1065, 1065, 130, 131, 'ZOAAAA', 'UWHAAA', 'AAAAxx'),
+(2741, 5325, 1, 1, 1, 1, 41, 741, 741, 2741, 2741, 82, 83, 'LBAAAA', 'VWHAAA', 'HHHHxx'),
+(5306, 5326, 0, 2, 6, 6, 6, 306, 1306, 306, 5306, 12, 13, 'CWAAAA', 'WWHAAA', 'OOOOxx'),
+(5464, 5327, 0, 0, 4, 4, 64, 464, 1464, 464, 5464, 128, 129, 'ECAAAA', 'XWHAAA', 'VVVVxx'),
+(4237, 5328, 1, 1, 7, 17, 37, 237, 237, 4237, 4237, 74, 75, 'ZGAAAA', 'YWHAAA', 'AAAAxx'),
+(3822, 5329, 0, 2, 2, 2, 22, 822, 1822, 3822, 3822, 44, 45, 'ARAAAA', 'ZWHAAA', 'HHHHxx'),
+(2548, 5330, 0, 0, 8, 8, 48, 548, 548, 2548, 2548, 96, 97, 'AUAAAA', 'AXHAAA', 'OOOOxx'),
+(2688, 5331, 0, 0, 8, 8, 88, 688, 688, 2688, 2688, 176, 177, 'KZAAAA', 'BXHAAA', 'VVVVxx'),
+(8061, 5332, 1, 1, 1, 1, 61, 61, 61, 3061, 8061, 122, 123, 'BYAAAA', 'CXHAAA', 'AAAAxx'),
+(9340, 5333, 0, 0, 0, 0, 40, 340, 1340, 4340, 9340, 80, 81, 'GVAAAA', 'DXHAAA', 'HHHHxx'),
+(4031, 5334, 1, 3, 1, 11, 31, 31, 31, 4031, 4031, 62, 63, 'BZAAAA', 'EXHAAA', 'OOOOxx'),
+(2635, 5335, 1, 3, 5, 15, 35, 635, 635, 2635, 2635, 70, 71, 'JXAAAA', 'FXHAAA', 'VVVVxx'),
+(809, 5336, 1, 1, 9, 9, 9, 809, 809, 809, 809, 18, 19, 'DFAAAA', 'GXHAAA', 'AAAAxx'),
+(3209, 5337, 1, 1, 9, 9, 9, 209, 1209, 3209, 3209, 18, 19, 'LTAAAA', 'HXHAAA', 'HHHHxx'),
+(3825, 5338, 1, 1, 5, 5, 25, 825, 1825, 3825, 3825, 50, 51, 'DRAAAA', 'IXHAAA', 'OOOOxx'),
+(1448, 5339, 0, 0, 8, 8, 48, 448, 1448, 1448, 1448, 96, 97, 'SDAAAA', 'JXHAAA', 'VVVVxx'),
+(9077, 5340, 1, 1, 7, 17, 77, 77, 1077, 4077, 9077, 154, 155, 'DLAAAA', 'KXHAAA', 'AAAAxx'),
+(3730, 5341, 0, 2, 0, 10, 30, 730, 1730, 3730, 3730, 60, 61, 'MNAAAA', 'LXHAAA', 'HHHHxx'),
+(9596, 5342, 0, 0, 6, 16, 96, 596, 1596, 4596, 9596, 192, 193, 'CFAAAA', 'MXHAAA', 'OOOOxx'),
+(3563, 5343, 1, 3, 3, 3, 63, 563, 1563, 3563, 3563, 126, 127, 'BHAAAA', 'NXHAAA', 'VVVVxx'),
+(4116, 5344, 0, 0, 6, 16, 16, 116, 116, 4116, 4116, 32, 33, 'ICAAAA', 'OXHAAA', 'AAAAxx'),
+(4825, 5345, 1, 1, 5, 5, 25, 825, 825, 4825, 4825, 50, 51, 'PDAAAA', 'PXHAAA', 'HHHHxx'),
+(8376, 5346, 0, 0, 6, 16, 76, 376, 376, 3376, 8376, 152, 153, 'EKAAAA', 'QXHAAA', 'OOOOxx'),
+(3917, 5347, 1, 1, 7, 17, 17, 917, 1917, 3917, 3917, 34, 35, 'RUAAAA', 'RXHAAA', 'VVVVxx'),
+(4407, 5348, 1, 3, 7, 7, 7, 407, 407, 4407, 4407, 14, 15, 'NNAAAA', 'SXHAAA', 'AAAAxx'),
+(8202, 5349, 0, 2, 2, 2, 2, 202, 202, 3202, 8202, 4, 5, 'MDAAAA', 'TXHAAA', 'HHHHxx'),
+(7675, 5350, 1, 3, 5, 15, 75, 675, 1675, 2675, 7675, 150, 151, 'FJAAAA', 'UXHAAA', 'OOOOxx'),
+(4104, 5351, 0, 0, 4, 4, 4, 104, 104, 4104, 4104, 8, 9, 'WBAAAA', 'VXHAAA', 'VVVVxx'),
+(9225, 5352, 1, 1, 5, 5, 25, 225, 1225, 4225, 9225, 50, 51, 'VQAAAA', 'WXHAAA', 'AAAAxx'),
+(2834, 5353, 0, 2, 4, 14, 34, 834, 834, 2834, 2834, 68, 69, 'AFAAAA', 'XXHAAA', 'HHHHxx'),
+(1227, 5354, 1, 3, 7, 7, 27, 227, 1227, 1227, 1227, 54, 55, 'FVAAAA', 'YXHAAA', 'OOOOxx'),
+(3383, 5355, 1, 3, 3, 3, 83, 383, 1383, 3383, 3383, 166, 167, 'DAAAAA', 'ZXHAAA', 'VVVVxx'),
+(67, 5356, 1, 3, 7, 7, 67, 67, 67, 67, 67, 134, 135, 'PCAAAA', 'AYHAAA', 'AAAAxx'),
+(1751, 5357, 1, 3, 1, 11, 51, 751, 1751, 1751, 1751, 102, 103, 'JPAAAA', 'BYHAAA', 'HHHHxx'),
+(8054, 5358, 0, 2, 4, 14, 54, 54, 54, 3054, 8054, 108, 109, 'UXAAAA', 'CYHAAA', 'OOOOxx'),
+(8571, 5359, 1, 3, 1, 11, 71, 571, 571, 3571, 8571, 142, 143, 'RRAAAA', 'DYHAAA', 'VVVVxx'),
+(2466, 5360, 0, 2, 6, 6, 66, 466, 466, 2466, 2466, 132, 133, 'WQAAAA', 'EYHAAA', 'AAAAxx'),
+(9405, 5361, 1, 1, 5, 5, 5, 405, 1405, 4405, 9405, 10, 11, 'TXAAAA', 'FYHAAA', 'HHHHxx'),
+(6883, 5362, 1, 3, 3, 3, 83, 883, 883, 1883, 6883, 166, 167, 'TEAAAA', 'GYHAAA', 'OOOOxx'),
+(4301, 5363, 1, 1, 1, 1, 1, 301, 301, 4301, 4301, 2, 3, 'LJAAAA', 'HYHAAA', 'VVVVxx'),
+(3705, 5364, 1, 1, 5, 5, 5, 705, 1705, 3705, 3705, 10, 11, 'NMAAAA', 'IYHAAA', 'AAAAxx'),
+(5420, 5365, 0, 0, 0, 0, 20, 420, 1420, 420, 5420, 40, 41, 'MAAAAA', 'JYHAAA', 'HHHHxx'),
+(3692, 5366, 0, 0, 2, 12, 92, 692, 1692, 3692, 3692, 184, 185, 'AMAAAA', 'KYHAAA', 'OOOOxx'),
+(6851, 5367, 1, 3, 1, 11, 51, 851, 851, 1851, 6851, 102, 103, 'NDAAAA', 'LYHAAA', 'VVVVxx'),
+(9363, 5368, 1, 3, 3, 3, 63, 363, 1363, 4363, 9363, 126, 127, 'DWAAAA', 'MYHAAA', 'AAAAxx'),
+(2269, 5369, 1, 1, 9, 9, 69, 269, 269, 2269, 2269, 138, 139, 'HJAAAA', 'NYHAAA', 'HHHHxx'),
+(4918, 5370, 0, 2, 8, 18, 18, 918, 918, 4918, 4918, 36, 37, 'EHAAAA', 'OYHAAA', 'OOOOxx'),
+(4297, 5371, 1, 1, 7, 17, 97, 297, 297, 4297, 4297, 194, 195, 'HJAAAA', 'PYHAAA', 'VVVVxx'),
+(1836, 5372, 0, 0, 6, 16, 36, 836, 1836, 1836, 1836, 72, 73, 'QSAAAA', 'QYHAAA', 'AAAAxx'),
+(237, 5373, 1, 1, 7, 17, 37, 237, 237, 237, 237, 74, 75, 'DJAAAA', 'RYHAAA', 'HHHHxx'),
+(6131, 5374, 1, 3, 1, 11, 31, 131, 131, 1131, 6131, 62, 63, 'VBAAAA', 'SYHAAA', 'OOOOxx'),
+(3174, 5375, 0, 2, 4, 14, 74, 174, 1174, 3174, 3174, 148, 149, 'CSAAAA', 'TYHAAA', 'VVVVxx'),
+(9987, 5376, 1, 3, 7, 7, 87, 987, 1987, 4987, 9987, 174, 175, 'DUAAAA', 'UYHAAA', 'AAAAxx'),
+(3630, 5377, 0, 2, 0, 10, 30, 630, 1630, 3630, 3630, 60, 61, 'QJAAAA', 'VYHAAA', 'HHHHxx'),
+(2899, 5378, 1, 3, 9, 19, 99, 899, 899, 2899, 2899, 198, 199, 'NHAAAA', 'WYHAAA', 'OOOOxx'),
+(4079, 5379, 1, 3, 9, 19, 79, 79, 79, 4079, 4079, 158, 159, 'XAAAAA', 'XYHAAA', 'VVVVxx'),
+(5049, 5380, 1, 1, 9, 9, 49, 49, 1049, 49, 5049, 98, 99, 'FMAAAA', 'YYHAAA', 'AAAAxx'),
+(2963, 5381, 1, 3, 3, 3, 63, 963, 963, 2963, 2963, 126, 127, 'ZJAAAA', 'ZYHAAA', 'HHHHxx'),
+(3962, 5382, 0, 2, 2, 2, 62, 962, 1962, 3962, 3962, 124, 125, 'KWAAAA', 'AZHAAA', 'OOOOxx'),
+(7921, 5383, 1, 1, 1, 1, 21, 921, 1921, 2921, 7921, 42, 43, 'RSAAAA', 'BZHAAA', 'VVVVxx'),
+(3967, 5384, 1, 3, 7, 7, 67, 967, 1967, 3967, 3967, 134, 135, 'PWAAAA', 'CZHAAA', 'AAAAxx'),
+(2752, 5385, 0, 0, 2, 12, 52, 752, 752, 2752, 2752, 104, 105, 'WBAAAA', 'DZHAAA', 'HHHHxx'),
+(7944, 5386, 0, 0, 4, 4, 44, 944, 1944, 2944, 7944, 88, 89, 'OTAAAA', 'EZHAAA', 'OOOOxx'),
+(2205, 5387, 1, 1, 5, 5, 5, 205, 205, 2205, 2205, 10, 11, 'VGAAAA', 'FZHAAA', 'VVVVxx'),
+(5035, 5388, 1, 3, 5, 15, 35, 35, 1035, 35, 5035, 70, 71, 'RLAAAA', 'GZHAAA', 'AAAAxx'),
+(1425, 5389, 1, 1, 5, 5, 25, 425, 1425, 1425, 1425, 50, 51, 'VCAAAA', 'HZHAAA', 'HHHHxx'),
+(832, 5390, 0, 0, 2, 12, 32, 832, 832, 832, 832, 64, 65, 'AGAAAA', 'IZHAAA', 'OOOOxx'),
+(1447, 5391, 1, 3, 7, 7, 47, 447, 1447, 1447, 1447, 94, 95, 'RDAAAA', 'JZHAAA', 'VVVVxx'),
+(6108, 5392, 0, 0, 8, 8, 8, 108, 108, 1108, 6108, 16, 17, 'YAAAAA', 'KZHAAA', 'AAAAxx'),
+(4936, 5393, 0, 0, 6, 16, 36, 936, 936, 4936, 4936, 72, 73, 'WHAAAA', 'LZHAAA', 'HHHHxx'),
+(7704, 5394, 0, 0, 4, 4, 4, 704, 1704, 2704, 7704, 8, 9, 'IKAAAA', 'MZHAAA', 'OOOOxx'),
+(142, 5395, 0, 2, 2, 2, 42, 142, 142, 142, 142, 84, 85, 'MFAAAA', 'NZHAAA', 'VVVVxx'),
+(4272, 5396, 0, 0, 2, 12, 72, 272, 272, 4272, 4272, 144, 145, 'IIAAAA', 'OZHAAA', 'AAAAxx'),
+(7667, 5397, 1, 3, 7, 7, 67, 667, 1667, 2667, 7667, 134, 135, 'XIAAAA', 'PZHAAA', 'HHHHxx'),
+(366, 5398, 0, 2, 6, 6, 66, 366, 366, 366, 366, 132, 133, 'COAAAA', 'QZHAAA', 'OOOOxx'),
+(8866, 5399, 0, 2, 6, 6, 66, 866, 866, 3866, 8866, 132, 133, 'ADAAAA', 'RZHAAA', 'VVVVxx'),
+(7712, 5400, 0, 0, 2, 12, 12, 712, 1712, 2712, 7712, 24, 25, 'QKAAAA', 'SZHAAA', 'AAAAxx'),
+(3880, 5401, 0, 0, 0, 0, 80, 880, 1880, 3880, 3880, 160, 161, 'GTAAAA', 'TZHAAA', 'HHHHxx'),
+(4631, 5402, 1, 3, 1, 11, 31, 631, 631, 4631, 4631, 62, 63, 'DWAAAA', 'UZHAAA', 'OOOOxx'),
+(2789, 5403, 1, 1, 9, 9, 89, 789, 789, 2789, 2789, 178, 179, 'HDAAAA', 'VZHAAA', 'VVVVxx'),
+(7720, 5404, 0, 0, 0, 0, 20, 720, 1720, 2720, 7720, 40, 41, 'YKAAAA', 'WZHAAA', 'AAAAxx'),
+(7618, 5405, 0, 2, 8, 18, 18, 618, 1618, 2618, 7618, 36, 37, 'AHAAAA', 'XZHAAA', 'HHHHxx'),
+(4990, 5406, 0, 2, 0, 10, 90, 990, 990, 4990, 4990, 180, 181, 'YJAAAA', 'YZHAAA', 'OOOOxx'),
+(7918, 5407, 0, 2, 8, 18, 18, 918, 1918, 2918, 7918, 36, 37, 'OSAAAA', 'ZZHAAA', 'VVVVxx'),
+(5067, 5408, 1, 3, 7, 7, 67, 67, 1067, 67, 5067, 134, 135, 'XMAAAA', 'AAIAAA', 'AAAAxx'),
+(6370, 5409, 0, 2, 0, 10, 70, 370, 370, 1370, 6370, 140, 141, 'ALAAAA', 'BAIAAA', 'HHHHxx'),
+(2268, 5410, 0, 0, 8, 8, 68, 268, 268, 2268, 2268, 136, 137, 'GJAAAA', 'CAIAAA', 'OOOOxx'),
+(1949, 5411, 1, 1, 9, 9, 49, 949, 1949, 1949, 1949, 98, 99, 'ZWAAAA', 'DAIAAA', 'VVVVxx'),
+(5503, 5412, 1, 3, 3, 3, 3, 503, 1503, 503, 5503, 6, 7, 'RDAAAA', 'EAIAAA', 'AAAAxx'),
+(9951, 5413, 1, 3, 1, 11, 51, 951, 1951, 4951, 9951, 102, 103, 'TSAAAA', 'FAIAAA', 'HHHHxx'),
+(6823, 5414, 1, 3, 3, 3, 23, 823, 823, 1823, 6823, 46, 47, 'LCAAAA', 'GAIAAA', 'OOOOxx'),
+(6287, 5415, 1, 3, 7, 7, 87, 287, 287, 1287, 6287, 174, 175, 'VHAAAA', 'HAIAAA', 'VVVVxx'),
+(6016, 5416, 0, 0, 6, 16, 16, 16, 16, 1016, 6016, 32, 33, 'KXAAAA', 'IAIAAA', 'AAAAxx'),
+(1977, 5417, 1, 1, 7, 17, 77, 977, 1977, 1977, 1977, 154, 155, 'BYAAAA', 'JAIAAA', 'HHHHxx'),
+(8579, 5418, 1, 3, 9, 19, 79, 579, 579, 3579, 8579, 158, 159, 'ZRAAAA', 'KAIAAA', 'OOOOxx'),
+(6204, 5419, 0, 0, 4, 4, 4, 204, 204, 1204, 6204, 8, 9, 'QEAAAA', 'LAIAAA', 'VVVVxx'),
+(9764, 5420, 0, 0, 4, 4, 64, 764, 1764, 4764, 9764, 128, 129, 'OLAAAA', 'MAIAAA', 'AAAAxx'),
+(2005, 5421, 1, 1, 5, 5, 5, 5, 5, 2005, 2005, 10, 11, 'DZAAAA', 'NAIAAA', 'HHHHxx'),
+(1648, 5422, 0, 0, 8, 8, 48, 648, 1648, 1648, 1648, 96, 97, 'KLAAAA', 'OAIAAA', 'OOOOxx'),
+(2457, 5423, 1, 1, 7, 17, 57, 457, 457, 2457, 2457, 114, 115, 'NQAAAA', 'PAIAAA', 'VVVVxx'),
+(2698, 5424, 0, 2, 8, 18, 98, 698, 698, 2698, 2698, 196, 197, 'UZAAAA', 'QAIAAA', 'AAAAxx'),
+(7730, 5425, 0, 2, 0, 10, 30, 730, 1730, 2730, 7730, 60, 61, 'ILAAAA', 'RAIAAA', 'HHHHxx'),
+(7287, 5426, 1, 3, 7, 7, 87, 287, 1287, 2287, 7287, 174, 175, 'HUAAAA', 'SAIAAA', 'OOOOxx'),
+(2937, 5427, 1, 1, 7, 17, 37, 937, 937, 2937, 2937, 74, 75, 'ZIAAAA', 'TAIAAA', 'VVVVxx'),
+(6824, 5428, 0, 0, 4, 4, 24, 824, 824, 1824, 6824, 48, 49, 'MCAAAA', 'UAIAAA', 'AAAAxx'),
+(9256, 5429, 0, 0, 6, 16, 56, 256, 1256, 4256, 9256, 112, 113, 'ASAAAA', 'VAIAAA', 'HHHHxx'),
+(4810, 5430, 0, 2, 0, 10, 10, 810, 810, 4810, 4810, 20, 21, 'ADAAAA', 'WAIAAA', 'OOOOxx'),
+(3869, 5431, 1, 1, 9, 9, 69, 869, 1869, 3869, 3869, 138, 139, 'VSAAAA', 'XAIAAA', 'VVVVxx'),
+(1993, 5432, 1, 1, 3, 13, 93, 993, 1993, 1993, 1993, 186, 187, 'RYAAAA', 'YAIAAA', 'AAAAxx'),
+(6048, 5433, 0, 0, 8, 8, 48, 48, 48, 1048, 6048, 96, 97, 'QYAAAA', 'ZAIAAA', 'HHHHxx'),
+(6922, 5434, 0, 2, 2, 2, 22, 922, 922, 1922, 6922, 44, 45, 'GGAAAA', 'ABIAAA', 'OOOOxx'),
+(8, 5435, 0, 0, 8, 8, 8, 8, 8, 8, 8, 16, 17, 'IAAAAA', 'BBIAAA', 'VVVVxx'),
+(6706, 5436, 0, 2, 6, 6, 6, 706, 706, 1706, 6706, 12, 13, 'YXAAAA', 'CBIAAA', 'AAAAxx'),
+(9159, 5437, 1, 3, 9, 19, 59, 159, 1159, 4159, 9159, 118, 119, 'HOAAAA', 'DBIAAA', 'HHHHxx'),
+(7020, 5438, 0, 0, 0, 0, 20, 20, 1020, 2020, 7020, 40, 41, 'AKAAAA', 'EBIAAA', 'OOOOxx'),
+(767, 5439, 1, 3, 7, 7, 67, 767, 767, 767, 767, 134, 135, 'NDAAAA', 'FBIAAA', 'VVVVxx'),
+(8602, 5440, 0, 2, 2, 2, 2, 602, 602, 3602, 8602, 4, 5, 'WSAAAA', 'GBIAAA', 'AAAAxx'),
+(4442, 5441, 0, 2, 2, 2, 42, 442, 442, 4442, 4442, 84, 85, 'WOAAAA', 'HBIAAA', 'HHHHxx'),
+(2040, 5442, 0, 0, 0, 0, 40, 40, 40, 2040, 2040, 80, 81, 'MAAAAA', 'IBIAAA', 'OOOOxx'),
+(5493, 5443, 1, 1, 3, 13, 93, 493, 1493, 493, 5493, 186, 187, 'HDAAAA', 'JBIAAA', 'VVVVxx'),
+(275, 5444, 1, 3, 5, 15, 75, 275, 275, 275, 275, 150, 151, 'PKAAAA', 'KBIAAA', 'AAAAxx'),
+(8876, 5445, 0, 0, 6, 16, 76, 876, 876, 3876, 8876, 152, 153, 'KDAAAA', 'LBIAAA', 'HHHHxx'),
+(7381, 5446, 1, 1, 1, 1, 81, 381, 1381, 2381, 7381, 162, 163, 'XXAAAA', 'MBIAAA', 'OOOOxx'),
+(1827, 5447, 1, 3, 7, 7, 27, 827, 1827, 1827, 1827, 54, 55, 'HSAAAA', 'NBIAAA', 'VVVVxx'),
+(3537, 5448, 1, 1, 7, 17, 37, 537, 1537, 3537, 3537, 74, 75, 'BGAAAA', 'OBIAAA', 'AAAAxx'),
+(6978, 5449, 0, 2, 8, 18, 78, 978, 978, 1978, 6978, 156, 157, 'KIAAAA', 'PBIAAA', 'HHHHxx'),
+(6160, 5450, 0, 0, 0, 0, 60, 160, 160, 1160, 6160, 120, 121, 'YCAAAA', 'QBIAAA', 'OOOOxx'),
+(9219, 5451, 1, 3, 9, 19, 19, 219, 1219, 4219, 9219, 38, 39, 'PQAAAA', 'RBIAAA', 'VVVVxx'),
+(5034, 5452, 0, 2, 4, 14, 34, 34, 1034, 34, 5034, 68, 69, 'QLAAAA', 'SBIAAA', 'AAAAxx'),
+(8463, 5453, 1, 3, 3, 3, 63, 463, 463, 3463, 8463, 126, 127, 'NNAAAA', 'TBIAAA', 'HHHHxx'),
+(2038, 5454, 0, 2, 8, 18, 38, 38, 38, 2038, 2038, 76, 77, 'KAAAAA', 'UBIAAA', 'OOOOxx'),
+(9562, 5455, 0, 2, 2, 2, 62, 562, 1562, 4562, 9562, 124, 125, 'UDAAAA', 'VBIAAA', 'VVVVxx'),
+(2687, 5456, 1, 3, 7, 7, 87, 687, 687, 2687, 2687, 174, 175, 'JZAAAA', 'WBIAAA', 'AAAAxx'),
+(5092, 5457, 0, 0, 2, 12, 92, 92, 1092, 92, 5092, 184, 185, 'WNAAAA', 'XBIAAA', 'HHHHxx'),
+(539, 5458, 1, 3, 9, 19, 39, 539, 539, 539, 539, 78, 79, 'TUAAAA', 'YBIAAA', 'OOOOxx'),
+(2139, 5459, 1, 3, 9, 19, 39, 139, 139, 2139, 2139, 78, 79, 'HEAAAA', 'ZBIAAA', 'VVVVxx'),
+(9221, 5460, 1, 1, 1, 1, 21, 221, 1221, 4221, 9221, 42, 43, 'RQAAAA', 'ACIAAA', 'AAAAxx'),
+(965, 5461, 1, 1, 5, 5, 65, 965, 965, 965, 965, 130, 131, 'DLAAAA', 'BCIAAA', 'HHHHxx'),
+(6051, 5462, 1, 3, 1, 11, 51, 51, 51, 1051, 6051, 102, 103, 'TYAAAA', 'CCIAAA', 'OOOOxx'),
+(5822, 5463, 0, 2, 2, 2, 22, 822, 1822, 822, 5822, 44, 45, 'YPAAAA', 'DCIAAA', 'VVVVxx'),
+(6397, 5464, 1, 1, 7, 17, 97, 397, 397, 1397, 6397, 194, 195, 'BMAAAA', 'ECIAAA', 'AAAAxx'),
+(2375, 5465, 1, 3, 5, 15, 75, 375, 375, 2375, 2375, 150, 151, 'JNAAAA', 'FCIAAA', 'HHHHxx'),
+(9415, 5466, 1, 3, 5, 15, 15, 415, 1415, 4415, 9415, 30, 31, 'DYAAAA', 'GCIAAA', 'OOOOxx'),
+(6552, 5467, 0, 0, 2, 12, 52, 552, 552, 1552, 6552, 104, 105, 'ASAAAA', 'HCIAAA', 'VVVVxx'),
+(2248, 5468, 0, 0, 8, 8, 48, 248, 248, 2248, 2248, 96, 97, 'MIAAAA', 'ICIAAA', 'AAAAxx'),
+(2611, 5469, 1, 3, 1, 11, 11, 611, 611, 2611, 2611, 22, 23, 'LWAAAA', 'JCIAAA', 'HHHHxx'),
+(9609, 5470, 1, 1, 9, 9, 9, 609, 1609, 4609, 9609, 18, 19, 'PFAAAA', 'KCIAAA', 'OOOOxx'),
+(2132, 5471, 0, 0, 2, 12, 32, 132, 132, 2132, 2132, 64, 65, 'AEAAAA', 'LCIAAA', 'VVVVxx'),
+(8452, 5472, 0, 0, 2, 12, 52, 452, 452, 3452, 8452, 104, 105, 'CNAAAA', 'MCIAAA', 'AAAAxx'),
+(9407, 5473, 1, 3, 7, 7, 7, 407, 1407, 4407, 9407, 14, 15, 'VXAAAA', 'NCIAAA', 'HHHHxx'),
+(2814, 5474, 0, 2, 4, 14, 14, 814, 814, 2814, 2814, 28, 29, 'GEAAAA', 'OCIAAA', 'OOOOxx'),
+(1889, 5475, 1, 1, 9, 9, 89, 889, 1889, 1889, 1889, 178, 179, 'RUAAAA', 'PCIAAA', 'VVVVxx'),
+(7489, 5476, 1, 1, 9, 9, 89, 489, 1489, 2489, 7489, 178, 179, 'BCAAAA', 'QCIAAA', 'AAAAxx'),
+(2255, 5477, 1, 3, 5, 15, 55, 255, 255, 2255, 2255, 110, 111, 'TIAAAA', 'RCIAAA', 'HHHHxx'),
+(3380, 5478, 0, 0, 0, 0, 80, 380, 1380, 3380, 3380, 160, 161, 'AAAAAA', 'SCIAAA', 'OOOOxx'),
+(1167, 5479, 1, 3, 7, 7, 67, 167, 1167, 1167, 1167, 134, 135, 'XSAAAA', 'TCIAAA', 'VVVVxx'),
+(5369, 5480, 1, 1, 9, 9, 69, 369, 1369, 369, 5369, 138, 139, 'NYAAAA', 'UCIAAA', 'AAAAxx'),
+(2378, 5481, 0, 2, 8, 18, 78, 378, 378, 2378, 2378, 156, 157, 'MNAAAA', 'VCIAAA', 'HHHHxx'),
+(8315, 5482, 1, 3, 5, 15, 15, 315, 315, 3315, 8315, 30, 31, 'VHAAAA', 'WCIAAA', 'OOOOxx'),
+(2934, 5483, 0, 2, 4, 14, 34, 934, 934, 2934, 2934, 68, 69, 'WIAAAA', 'XCIAAA', 'VVVVxx'),
+(7924, 5484, 0, 0, 4, 4, 24, 924, 1924, 2924, 7924, 48, 49, 'USAAAA', 'YCIAAA', 'AAAAxx'),
+(2867, 5485, 1, 3, 7, 7, 67, 867, 867, 2867, 2867, 134, 135, 'HGAAAA', 'ZCIAAA', 'HHHHxx'),
+(9141, 5486, 1, 1, 1, 1, 41, 141, 1141, 4141, 9141, 82, 83, 'PNAAAA', 'ADIAAA', 'OOOOxx'),
+(3613, 5487, 1, 1, 3, 13, 13, 613, 1613, 3613, 3613, 26, 27, 'ZIAAAA', 'BDIAAA', 'VVVVxx'),
+(2461, 5488, 1, 1, 1, 1, 61, 461, 461, 2461, 2461, 122, 123, 'RQAAAA', 'CDIAAA', 'AAAAxx'),
+(4567, 5489, 1, 3, 7, 7, 67, 567, 567, 4567, 4567, 134, 135, 'RTAAAA', 'DDIAAA', 'HHHHxx'),
+(2906, 5490, 0, 2, 6, 6, 6, 906, 906, 2906, 2906, 12, 13, 'UHAAAA', 'EDIAAA', 'OOOOxx'),
+(4848, 5491, 0, 0, 8, 8, 48, 848, 848, 4848, 4848, 96, 97, 'MEAAAA', 'FDIAAA', 'VVVVxx'),
+(6614, 5492, 0, 2, 4, 14, 14, 614, 614, 1614, 6614, 28, 29, 'KUAAAA', 'GDIAAA', 'AAAAxx'),
+(6200, 5493, 0, 0, 0, 0, 0, 200, 200, 1200, 6200, 0, 1, 'MEAAAA', 'HDIAAA', 'HHHHxx'),
+(7895, 5494, 1, 3, 5, 15, 95, 895, 1895, 2895, 7895, 190, 191, 'RRAAAA', 'IDIAAA', 'OOOOxx'),
+(6829, 5495, 1, 1, 9, 9, 29, 829, 829, 1829, 6829, 58, 59, 'RCAAAA', 'JDIAAA', 'VVVVxx'),
+(4087, 5496, 1, 3, 7, 7, 87, 87, 87, 4087, 4087, 174, 175, 'FBAAAA', 'KDIAAA', 'AAAAxx'),
+(8787, 5497, 1, 3, 7, 7, 87, 787, 787, 3787, 8787, 174, 175, 'ZZAAAA', 'LDIAAA', 'HHHHxx'),
+(3322, 5498, 0, 2, 2, 2, 22, 322, 1322, 3322, 3322, 44, 45, 'UXAAAA', 'MDIAAA', 'OOOOxx'),
+(9091, 5499, 1, 3, 1, 11, 91, 91, 1091, 4091, 9091, 182, 183, 'RLAAAA', 'NDIAAA', 'VVVVxx'),
+(5268, 5500, 0, 0, 8, 8, 68, 268, 1268, 268, 5268, 136, 137, 'QUAAAA', 'ODIAAA', 'AAAAxx'),
+(2719, 5501, 1, 3, 9, 19, 19, 719, 719, 2719, 2719, 38, 39, 'PAAAAA', 'PDIAAA', 'HHHHxx'),
+(30, 5502, 0, 2, 0, 10, 30, 30, 30, 30, 30, 60, 61, 'EBAAAA', 'QDIAAA', 'OOOOxx'),
+(1975, 5503, 1, 3, 5, 15, 75, 975, 1975, 1975, 1975, 150, 151, 'ZXAAAA', 'RDIAAA', 'VVVVxx'),
+(2641, 5504, 1, 1, 1, 1, 41, 641, 641, 2641, 2641, 82, 83, 'PXAAAA', 'SDIAAA', 'AAAAxx'),
+(8616, 5505, 0, 0, 6, 16, 16, 616, 616, 3616, 8616, 32, 33, 'KTAAAA', 'TDIAAA', 'HHHHxx'),
+(5980, 5506, 0, 0, 0, 0, 80, 980, 1980, 980, 5980, 160, 161, 'AWAAAA', 'UDIAAA', 'OOOOxx'),
+(5170, 5507, 0, 2, 0, 10, 70, 170, 1170, 170, 5170, 140, 141, 'WQAAAA', 'VDIAAA', 'VVVVxx'),
+(1960, 5508, 0, 0, 0, 0, 60, 960, 1960, 1960, 1960, 120, 121, 'KXAAAA', 'WDIAAA', 'AAAAxx'),
+(8141, 5509, 1, 1, 1, 1, 41, 141, 141, 3141, 8141, 82, 83, 'DBAAAA', 'XDIAAA', 'HHHHxx'),
+(6692, 5510, 0, 0, 2, 12, 92, 692, 692, 1692, 6692, 184, 185, 'KXAAAA', 'YDIAAA', 'OOOOxx'),
+(7621, 5511, 1, 1, 1, 1, 21, 621, 1621, 2621, 7621, 42, 43, 'DHAAAA', 'ZDIAAA', 'VVVVxx'),
+(3890, 5512, 0, 2, 0, 10, 90, 890, 1890, 3890, 3890, 180, 181, 'QTAAAA', 'AEIAAA', 'AAAAxx'),
+(4300, 5513, 0, 0, 0, 0, 0, 300, 300, 4300, 4300, 0, 1, 'KJAAAA', 'BEIAAA', 'HHHHxx'),
+(736, 5514, 0, 0, 6, 16, 36, 736, 736, 736, 736, 72, 73, 'ICAAAA', 'CEIAAA', 'OOOOxx'),
+(6626, 5515, 0, 2, 6, 6, 26, 626, 626, 1626, 6626, 52, 53, 'WUAAAA', 'DEIAAA', 'VVVVxx'),
+(1800, 5516, 0, 0, 0, 0, 0, 800, 1800, 1800, 1800, 0, 1, 'GRAAAA', 'EEIAAA', 'AAAAxx'),
+(3430, 5517, 0, 2, 0, 10, 30, 430, 1430, 3430, 3430, 60, 61, 'YBAAAA', 'FEIAAA', 'HHHHxx'),
+(9519, 5518, 1, 3, 9, 19, 19, 519, 1519, 4519, 9519, 38, 39, 'DCAAAA', 'GEIAAA', 'OOOOxx'),
+(5111, 5519, 1, 3, 1, 11, 11, 111, 1111, 111, 5111, 22, 23, 'POAAAA', 'HEIAAA', 'VVVVxx'),
+(6915, 5520, 1, 3, 5, 15, 15, 915, 915, 1915, 6915, 30, 31, 'ZFAAAA', 'IEIAAA', 'AAAAxx'),
+(9246, 5521, 0, 2, 6, 6, 46, 246, 1246, 4246, 9246, 92, 93, 'QRAAAA', 'JEIAAA', 'HHHHxx'),
+(5141, 5522, 1, 1, 1, 1, 41, 141, 1141, 141, 5141, 82, 83, 'TPAAAA', 'KEIAAA', 'OOOOxx'),
+(5922, 5523, 0, 2, 2, 2, 22, 922, 1922, 922, 5922, 44, 45, 'UTAAAA', 'LEIAAA', 'VVVVxx'),
+(3087, 5524, 1, 3, 7, 7, 87, 87, 1087, 3087, 3087, 174, 175, 'TOAAAA', 'MEIAAA', 'AAAAxx'),
+(1859, 5525, 1, 3, 9, 19, 59, 859, 1859, 1859, 1859, 118, 119, 'NTAAAA', 'NEIAAA', 'HHHHxx'),
+(8482, 5526, 0, 2, 2, 2, 82, 482, 482, 3482, 8482, 164, 165, 'GOAAAA', 'OEIAAA', 'OOOOxx'),
+(8414, 5527, 0, 2, 4, 14, 14, 414, 414, 3414, 8414, 28, 29, 'QLAAAA', 'PEIAAA', 'VVVVxx'),
+(6662, 5528, 0, 2, 2, 2, 62, 662, 662, 1662, 6662, 124, 125, 'GWAAAA', 'QEIAAA', 'AAAAxx'),
+(8614, 5529, 0, 2, 4, 14, 14, 614, 614, 3614, 8614, 28, 29, 'ITAAAA', 'REIAAA', 'HHHHxx'),
+(42, 5530, 0, 2, 2, 2, 42, 42, 42, 42, 42, 84, 85, 'QBAAAA', 'SEIAAA', 'OOOOxx'),
+(7582, 5531, 0, 2, 2, 2, 82, 582, 1582, 2582, 7582, 164, 165, 'QFAAAA', 'TEIAAA', 'VVVVxx'),
+(8183, 5532, 1, 3, 3, 3, 83, 183, 183, 3183, 8183, 166, 167, 'TCAAAA', 'UEIAAA', 'AAAAxx'),
+(1299, 5533, 1, 3, 9, 19, 99, 299, 1299, 1299, 1299, 198, 199, 'ZXAAAA', 'VEIAAA', 'HHHHxx'),
+(7004, 5534, 0, 0, 4, 4, 4, 4, 1004, 2004, 7004, 8, 9, 'KJAAAA', 'WEIAAA', 'OOOOxx'),
+(3298, 5535, 0, 2, 8, 18, 98, 298, 1298, 3298, 3298, 196, 197, 'WWAAAA', 'XEIAAA', 'VVVVxx'),
+(7884, 5536, 0, 0, 4, 4, 84, 884, 1884, 2884, 7884, 168, 169, 'GRAAAA', 'YEIAAA', 'AAAAxx'),
+(4191, 5537, 1, 3, 1, 11, 91, 191, 191, 4191, 4191, 182, 183, 'FFAAAA', 'ZEIAAA', 'HHHHxx'),
+(7346, 5538, 0, 2, 6, 6, 46, 346, 1346, 2346, 7346, 92, 93, 'OWAAAA', 'AFIAAA', 'OOOOxx'),
+(7989, 5539, 1, 1, 9, 9, 89, 989, 1989, 2989, 7989, 178, 179, 'HVAAAA', 'BFIAAA', 'VVVVxx'),
+(5719, 5540, 1, 3, 9, 19, 19, 719, 1719, 719, 5719, 38, 39, 'ZLAAAA', 'CFIAAA', 'AAAAxx'),
+(800, 5541, 0, 0, 0, 0, 0, 800, 800, 800, 800, 0, 1, 'UEAAAA', 'DFIAAA', 'HHHHxx'),
+(6509, 5542, 1, 1, 9, 9, 9, 509, 509, 1509, 6509, 18, 19, 'JQAAAA', 'EFIAAA', 'OOOOxx'),
+(4672, 5543, 0, 0, 2, 12, 72, 672, 672, 4672, 4672, 144, 145, 'SXAAAA', 'FFIAAA', 'VVVVxx'),
+(4434, 5544, 0, 2, 4, 14, 34, 434, 434, 4434, 4434, 68, 69, 'OOAAAA', 'GFIAAA', 'AAAAxx'),
+(8309, 5545, 1, 1, 9, 9, 9, 309, 309, 3309, 8309, 18, 19, 'PHAAAA', 'HFIAAA', 'HHHHxx'),
+(5134, 5546, 0, 2, 4, 14, 34, 134, 1134, 134, 5134, 68, 69, 'MPAAAA', 'IFIAAA', 'OOOOxx'),
+(5153, 5547, 1, 1, 3, 13, 53, 153, 1153, 153, 5153, 106, 107, 'FQAAAA', 'JFIAAA', 'VVVVxx'),
+(1522, 5548, 0, 2, 2, 2, 22, 522, 1522, 1522, 1522, 44, 45, 'OGAAAA', 'KFIAAA', 'AAAAxx'),
+(8629, 5549, 1, 1, 9, 9, 29, 629, 629, 3629, 8629, 58, 59, 'XTAAAA', 'LFIAAA', 'HHHHxx'),
+(4549, 5550, 1, 1, 9, 9, 49, 549, 549, 4549, 4549, 98, 99, 'ZSAAAA', 'MFIAAA', 'OOOOxx'),
+(9506, 5551, 0, 2, 6, 6, 6, 506, 1506, 4506, 9506, 12, 13, 'QBAAAA', 'NFIAAA', 'VVVVxx'),
+(6542, 5552, 0, 2, 2, 2, 42, 542, 542, 1542, 6542, 84, 85, 'QRAAAA', 'OFIAAA', 'AAAAxx'),
+(2579, 5553, 1, 3, 9, 19, 79, 579, 579, 2579, 2579, 158, 159, 'FVAAAA', 'PFIAAA', 'HHHHxx'),
+(4664, 5554, 0, 0, 4, 4, 64, 664, 664, 4664, 4664, 128, 129, 'KXAAAA', 'QFIAAA', 'OOOOxx'),
+(696, 5555, 0, 0, 6, 16, 96, 696, 696, 696, 696, 192, 193, 'UAAAAA', 'RFIAAA', 'VVVVxx'),
+(7950, 5556, 0, 2, 0, 10, 50, 950, 1950, 2950, 7950, 100, 101, 'UTAAAA', 'SFIAAA', 'AAAAxx'),
+(5, 5557, 1, 1, 5, 5, 5, 5, 5, 5, 5, 10, 11, 'FAAAAA', 'TFIAAA', 'HHHHxx'),
+(7806, 5558, 0, 2, 6, 6, 6, 806, 1806, 2806, 7806, 12, 13, 'GOAAAA', 'UFIAAA', 'OOOOxx'),
+(2770, 5559, 0, 2, 0, 10, 70, 770, 770, 2770, 2770, 140, 141, 'OCAAAA', 'VFIAAA', 'VVVVxx'),
+(1344, 5560, 0, 0, 4, 4, 44, 344, 1344, 1344, 1344, 88, 89, 'SZAAAA', 'WFIAAA', 'AAAAxx'),
+(511, 5561, 1, 3, 1, 11, 11, 511, 511, 511, 511, 22, 23, 'RTAAAA', 'XFIAAA', 'HHHHxx'),
+(9070, 5562, 0, 2, 0, 10, 70, 70, 1070, 4070, 9070, 140, 141, 'WKAAAA', 'YFIAAA', 'OOOOxx'),
+(2961, 5563, 1, 1, 1, 1, 61, 961, 961, 2961, 2961, 122, 123, 'XJAAAA', 'ZFIAAA', 'VVVVxx'),
+(8031, 5564, 1, 3, 1, 11, 31, 31, 31, 3031, 8031, 62, 63, 'XWAAAA', 'AGIAAA', 'AAAAxx'),
+(326, 5565, 0, 2, 6, 6, 26, 326, 326, 326, 326, 52, 53, 'OMAAAA', 'BGIAAA', 'HHHHxx'),
+(183, 5566, 1, 3, 3, 3, 83, 183, 183, 183, 183, 166, 167, 'BHAAAA', 'CGIAAA', 'OOOOxx'),
+(5917, 5567, 1, 1, 7, 17, 17, 917, 1917, 917, 5917, 34, 35, 'PTAAAA', 'DGIAAA', 'VVVVxx'),
+(8256, 5568, 0, 0, 6, 16, 56, 256, 256, 3256, 8256, 112, 113, 'OFAAAA', 'EGIAAA', 'AAAAxx'),
+(7889, 5569, 1, 1, 9, 9, 89, 889, 1889, 2889, 7889, 178, 179, 'LRAAAA', 'FGIAAA', 'HHHHxx'),
+(9029, 5570, 1, 1, 9, 9, 29, 29, 1029, 4029, 9029, 58, 59, 'HJAAAA', 'GGIAAA', 'OOOOxx'),
+(1316, 5571, 0, 0, 6, 16, 16, 316, 1316, 1316, 1316, 32, 33, 'QYAAAA', 'HGIAAA', 'VVVVxx'),
+(7442, 5572, 0, 2, 2, 2, 42, 442, 1442, 2442, 7442, 84, 85, 'GAAAAA', 'IGIAAA', 'AAAAxx'),
+(2810, 5573, 0, 2, 0, 10, 10, 810, 810, 2810, 2810, 20, 21, 'CEAAAA', 'JGIAAA', 'HHHHxx'),
+(20, 5574, 0, 0, 0, 0, 20, 20, 20, 20, 20, 40, 41, 'UAAAAA', 'KGIAAA', 'OOOOxx'),
+(2306, 5575, 0, 2, 6, 6, 6, 306, 306, 2306, 2306, 12, 13, 'SKAAAA', 'LGIAAA', 'VVVVxx'),
+(4694, 5576, 0, 2, 4, 14, 94, 694, 694, 4694, 4694, 188, 189, 'OYAAAA', 'MGIAAA', 'AAAAxx'),
+(9710, 5577, 0, 2, 0, 10, 10, 710, 1710, 4710, 9710, 20, 21, 'MJAAAA', 'NGIAAA', 'HHHHxx'),
+(1791, 5578, 1, 3, 1, 11, 91, 791, 1791, 1791, 1791, 182, 183, 'XQAAAA', 'OGIAAA', 'OOOOxx'),
+(6730, 5579, 0, 2, 0, 10, 30, 730, 730, 1730, 6730, 60, 61, 'WYAAAA', 'PGIAAA', 'VVVVxx'),
+(359, 5580, 1, 3, 9, 19, 59, 359, 359, 359, 359, 118, 119, 'VNAAAA', 'QGIAAA', 'AAAAxx'),
+(8097, 5581, 1, 1, 7, 17, 97, 97, 97, 3097, 8097, 194, 195, 'LZAAAA', 'RGIAAA', 'HHHHxx'),
+(6147, 5582, 1, 3, 7, 7, 47, 147, 147, 1147, 6147, 94, 95, 'LCAAAA', 'SGIAAA', 'OOOOxx'),
+(643, 5583, 1, 3, 3, 3, 43, 643, 643, 643, 643, 86, 87, 'TYAAAA', 'TGIAAA', 'VVVVxx'),
+(698, 5584, 0, 2, 8, 18, 98, 698, 698, 698, 698, 196, 197, 'WAAAAA', 'UGIAAA', 'AAAAxx'),
+(3881, 5585, 1, 1, 1, 1, 81, 881, 1881, 3881, 3881, 162, 163, 'HTAAAA', 'VGIAAA', 'HHHHxx'),
+(7600, 5586, 0, 0, 0, 0, 0, 600, 1600, 2600, 7600, 0, 1, 'IGAAAA', 'WGIAAA', 'OOOOxx'),
+(1583, 5587, 1, 3, 3, 3, 83, 583, 1583, 1583, 1583, 166, 167, 'XIAAAA', 'XGIAAA', 'VVVVxx'),
+(9612, 5588, 0, 0, 2, 12, 12, 612, 1612, 4612, 9612, 24, 25, 'SFAAAA', 'YGIAAA', 'AAAAxx'),
+(1032, 5589, 0, 0, 2, 12, 32, 32, 1032, 1032, 1032, 64, 65, 'SNAAAA', 'ZGIAAA', 'HHHHxx'),
+(4834, 5590, 0, 2, 4, 14, 34, 834, 834, 4834, 4834, 68, 69, 'YDAAAA', 'AHIAAA', 'OOOOxx'),
+(5076, 5591, 0, 0, 6, 16, 76, 76, 1076, 76, 5076, 152, 153, 'GNAAAA', 'BHIAAA', 'VVVVxx'),
+(3070, 5592, 0, 2, 0, 10, 70, 70, 1070, 3070, 3070, 140, 141, 'COAAAA', 'CHIAAA', 'AAAAxx'),
+(1421, 5593, 1, 1, 1, 1, 21, 421, 1421, 1421, 1421, 42, 43, 'RCAAAA', 'DHIAAA', 'HHHHxx'),
+(8970, 5594, 0, 2, 0, 10, 70, 970, 970, 3970, 8970, 140, 141, 'AHAAAA', 'EHIAAA', 'OOOOxx'),
+(6271, 5595, 1, 3, 1, 11, 71, 271, 271, 1271, 6271, 142, 143, 'FHAAAA', 'FHIAAA', 'VVVVxx'),
+(8547, 5596, 1, 3, 7, 7, 47, 547, 547, 3547, 8547, 94, 95, 'TQAAAA', 'GHIAAA', 'AAAAxx'),
+(1259, 5597, 1, 3, 9, 19, 59, 259, 1259, 1259, 1259, 118, 119, 'LWAAAA', 'HHIAAA', 'HHHHxx'),
+(8328, 5598, 0, 0, 8, 8, 28, 328, 328, 3328, 8328, 56, 57, 'IIAAAA', 'IHIAAA', 'OOOOxx'),
+(1503, 5599, 1, 3, 3, 3, 3, 503, 1503, 1503, 1503, 6, 7, 'VFAAAA', 'JHIAAA', 'VVVVxx'),
+(2253, 5600, 1, 1, 3, 13, 53, 253, 253, 2253, 2253, 106, 107, 'RIAAAA', 'KHIAAA', 'AAAAxx'),
+(7449, 5601, 1, 1, 9, 9, 49, 449, 1449, 2449, 7449, 98, 99, 'NAAAAA', 'LHIAAA', 'HHHHxx'),
+(3579, 5602, 1, 3, 9, 19, 79, 579, 1579, 3579, 3579, 158, 159, 'RHAAAA', 'MHIAAA', 'OOOOxx'),
+(1585, 5603, 1, 1, 5, 5, 85, 585, 1585, 1585, 1585, 170, 171, 'ZIAAAA', 'NHIAAA', 'VVVVxx'),
+(5543, 5604, 1, 3, 3, 3, 43, 543, 1543, 543, 5543, 86, 87, 'FFAAAA', 'OHIAAA', 'AAAAxx'),
+(8627, 5605, 1, 3, 7, 7, 27, 627, 627, 3627, 8627, 54, 55, 'VTAAAA', 'PHIAAA', 'HHHHxx'),
+(8618, 5606, 0, 2, 8, 18, 18, 618, 618, 3618, 8618, 36, 37, 'MTAAAA', 'QHIAAA', 'OOOOxx'),
+(1911, 5607, 1, 3, 1, 11, 11, 911, 1911, 1911, 1911, 22, 23, 'NVAAAA', 'RHIAAA', 'VVVVxx'),
+(2758, 5608, 0, 2, 8, 18, 58, 758, 758, 2758, 2758, 116, 117, 'CCAAAA', 'SHIAAA', 'AAAAxx'),
+(5744, 5609, 0, 0, 4, 4, 44, 744, 1744, 744, 5744, 88, 89, 'YMAAAA', 'THIAAA', 'HHHHxx'),
+(4976, 5610, 0, 0, 6, 16, 76, 976, 976, 4976, 4976, 152, 153, 'KJAAAA', 'UHIAAA', 'OOOOxx'),
+(6380, 5611, 0, 0, 0, 0, 80, 380, 380, 1380, 6380, 160, 161, 'KLAAAA', 'VHIAAA', 'VVVVxx'),
+(1937, 5612, 1, 1, 7, 17, 37, 937, 1937, 1937, 1937, 74, 75, 'NWAAAA', 'WHIAAA', 'AAAAxx'),
+(9903, 5613, 1, 3, 3, 3, 3, 903, 1903, 4903, 9903, 6, 7, 'XQAAAA', 'XHIAAA', 'HHHHxx'),
+(4409, 5614, 1, 1, 9, 9, 9, 409, 409, 4409, 4409, 18, 19, 'PNAAAA', 'YHIAAA', 'OOOOxx'),
+(4133, 5615, 1, 1, 3, 13, 33, 133, 133, 4133, 4133, 66, 67, 'ZCAAAA', 'ZHIAAA', 'VVVVxx'),
+(5263, 5616, 1, 3, 3, 3, 63, 263, 1263, 263, 5263, 126, 127, 'LUAAAA', 'AIIAAA', 'AAAAxx'),
+(7888, 5617, 0, 0, 8, 8, 88, 888, 1888, 2888, 7888, 176, 177, 'KRAAAA', 'BIIAAA', 'HHHHxx'),
+(6060, 5618, 0, 0, 0, 0, 60, 60, 60, 1060, 6060, 120, 121, 'CZAAAA', 'CIIAAA', 'OOOOxx'),
+(2522, 5619, 0, 2, 2, 2, 22, 522, 522, 2522, 2522, 44, 45, 'ATAAAA', 'DIIAAA', 'VVVVxx'),
+(5550, 5620, 0, 2, 0, 10, 50, 550, 1550, 550, 5550, 100, 101, 'MFAAAA', 'EIIAAA', 'AAAAxx'),
+(9396, 5621, 0, 0, 6, 16, 96, 396, 1396, 4396, 9396, 192, 193, 'KXAAAA', 'FIIAAA', 'HHHHxx'),
+(176, 5622, 0, 0, 6, 16, 76, 176, 176, 176, 176, 152, 153, 'UGAAAA', 'GIIAAA', 'OOOOxx'),
+(5148, 5623, 0, 0, 8, 8, 48, 148, 1148, 148, 5148, 96, 97, 'AQAAAA', 'HIIAAA', 'VVVVxx'),
+(6691, 5624, 1, 3, 1, 11, 91, 691, 691, 1691, 6691, 182, 183, 'JXAAAA', 'IIIAAA', 'AAAAxx'),
+(4652, 5625, 0, 0, 2, 12, 52, 652, 652, 4652, 4652, 104, 105, 'YWAAAA', 'JIIAAA', 'HHHHxx'),
+(5096, 5626, 0, 0, 6, 16, 96, 96, 1096, 96, 5096, 192, 193, 'AOAAAA', 'KIIAAA', 'OOOOxx'),
+(2408, 5627, 0, 0, 8, 8, 8, 408, 408, 2408, 2408, 16, 17, 'QOAAAA', 'LIIAAA', 'VVVVxx'),
+(7322, 5628, 0, 2, 2, 2, 22, 322, 1322, 2322, 7322, 44, 45, 'QVAAAA', 'MIIAAA', 'AAAAxx'),
+(6782, 5629, 0, 2, 2, 2, 82, 782, 782, 1782, 6782, 164, 165, 'WAAAAA', 'NIIAAA', 'HHHHxx'),
+(4642, 5630, 0, 2, 2, 2, 42, 642, 642, 4642, 4642, 84, 85, 'OWAAAA', 'OIIAAA', 'OOOOxx'),
+(5427, 5631, 1, 3, 7, 7, 27, 427, 1427, 427, 5427, 54, 55, 'TAAAAA', 'PIIAAA', 'VVVVxx'),
+(4461, 5632, 1, 1, 1, 1, 61, 461, 461, 4461, 4461, 122, 123, 'PPAAAA', 'QIIAAA', 'AAAAxx'),
+(8416, 5633, 0, 0, 6, 16, 16, 416, 416, 3416, 8416, 32, 33, 'SLAAAA', 'RIIAAA', 'HHHHxx'),
+(2593, 5634, 1, 1, 3, 13, 93, 593, 593, 2593, 2593, 186, 187, 'TVAAAA', 'SIIAAA', 'OOOOxx'),
+(6202, 5635, 0, 2, 2, 2, 2, 202, 202, 1202, 6202, 4, 5, 'OEAAAA', 'TIIAAA', 'VVVVxx'),
+(3826, 5636, 0, 2, 6, 6, 26, 826, 1826, 3826, 3826, 52, 53, 'ERAAAA', 'UIIAAA', 'AAAAxx'),
+(4417, 5637, 1, 1, 7, 17, 17, 417, 417, 4417, 4417, 34, 35, 'XNAAAA', 'VIIAAA', 'HHHHxx'),
+(7871, 5638, 1, 3, 1, 11, 71, 871, 1871, 2871, 7871, 142, 143, 'TQAAAA', 'WIIAAA', 'OOOOxx'),
+(5622, 5639, 0, 2, 2, 2, 22, 622, 1622, 622, 5622, 44, 45, 'GIAAAA', 'XIIAAA', 'VVVVxx'),
+(3010, 5640, 0, 2, 0, 10, 10, 10, 1010, 3010, 3010, 20, 21, 'ULAAAA', 'YIIAAA', 'AAAAxx'),
+(3407, 5641, 1, 3, 7, 7, 7, 407, 1407, 3407, 3407, 14, 15, 'BBAAAA', 'ZIIAAA', 'HHHHxx'),
+(1274, 5642, 0, 2, 4, 14, 74, 274, 1274, 1274, 1274, 148, 149, 'AXAAAA', 'AJIAAA', 'OOOOxx'),
+(2828, 5643, 0, 0, 8, 8, 28, 828, 828, 2828, 2828, 56, 57, 'UEAAAA', 'BJIAAA', 'VVVVxx'),
+(3427, 5644, 1, 3, 7, 7, 27, 427, 1427, 3427, 3427, 54, 55, 'VBAAAA', 'CJIAAA', 'AAAAxx'),
+(612, 5645, 0, 0, 2, 12, 12, 612, 612, 612, 612, 24, 25, 'OXAAAA', 'DJIAAA', 'HHHHxx'),
+(8729, 5646, 1, 1, 9, 9, 29, 729, 729, 3729, 8729, 58, 59, 'TXAAAA', 'EJIAAA', 'OOOOxx'),
+(1239, 5647, 1, 3, 9, 19, 39, 239, 1239, 1239, 1239, 78, 79, 'RVAAAA', 'FJIAAA', 'VVVVxx'),
+(8990, 5648, 0, 2, 0, 10, 90, 990, 990, 3990, 8990, 180, 181, 'UHAAAA', 'GJIAAA', 'AAAAxx'),
+(5609, 5649, 1, 1, 9, 9, 9, 609, 1609, 609, 5609, 18, 19, 'THAAAA', 'HJIAAA', 'HHHHxx'),
+(4441, 5650, 1, 1, 1, 1, 41, 441, 441, 4441, 4441, 82, 83, 'VOAAAA', 'IJIAAA', 'OOOOxx'),
+(9078, 5651, 0, 2, 8, 18, 78, 78, 1078, 4078, 9078, 156, 157, 'ELAAAA', 'JJIAAA', 'VVVVxx'),
+(6699, 5652, 1, 3, 9, 19, 99, 699, 699, 1699, 6699, 198, 199, 'RXAAAA', 'KJIAAA', 'AAAAxx'),
+(8390, 5653, 0, 2, 0, 10, 90, 390, 390, 3390, 8390, 180, 181, 'SKAAAA', 'LJIAAA', 'HHHHxx'),
+(5455, 5654, 1, 3, 5, 15, 55, 455, 1455, 455, 5455, 110, 111, 'VBAAAA', 'MJIAAA', 'OOOOxx'),
+(7537, 5655, 1, 1, 7, 17, 37, 537, 1537, 2537, 7537, 74, 75, 'XDAAAA', 'NJIAAA', 'VVVVxx'),
+(4669, 5656, 1, 1, 9, 9, 69, 669, 669, 4669, 4669, 138, 139, 'PXAAAA', 'OJIAAA', 'AAAAxx'),
+(5534, 5657, 0, 2, 4, 14, 34, 534, 1534, 534, 5534, 68, 69, 'WEAAAA', 'PJIAAA', 'HHHHxx'),
+(1920, 5658, 0, 0, 0, 0, 20, 920, 1920, 1920, 1920, 40, 41, 'WVAAAA', 'QJIAAA', 'OOOOxx'),
+(9465, 5659, 1, 1, 5, 5, 65, 465, 1465, 4465, 9465, 130, 131, 'BAAAAA', 'RJIAAA', 'VVVVxx'),
+(4897, 5660, 1, 1, 7, 17, 97, 897, 897, 4897, 4897, 194, 195, 'JGAAAA', 'SJIAAA', 'AAAAxx'),
+(1990, 5661, 0, 2, 0, 10, 90, 990, 1990, 1990, 1990, 180, 181, 'OYAAAA', 'TJIAAA', 'HHHHxx'),
+(7148, 5662, 0, 0, 8, 8, 48, 148, 1148, 2148, 7148, 96, 97, 'YOAAAA', 'UJIAAA', 'OOOOxx'),
+(533, 5663, 1, 1, 3, 13, 33, 533, 533, 533, 533, 66, 67, 'NUAAAA', 'VJIAAA', 'VVVVxx'),
+(4339, 5664, 1, 3, 9, 19, 39, 339, 339, 4339, 4339, 78, 79, 'XKAAAA', 'WJIAAA', 'AAAAxx'),
+(6450, 5665, 0, 2, 0, 10, 50, 450, 450, 1450, 6450, 100, 101, 'COAAAA', 'XJIAAA', 'HHHHxx'),
+(9627, 5666, 1, 3, 7, 7, 27, 627, 1627, 4627, 9627, 54, 55, 'HGAAAA', 'YJIAAA', 'OOOOxx'),
+(5539, 5667, 1, 3, 9, 19, 39, 539, 1539, 539, 5539, 78, 79, 'BFAAAA', 'ZJIAAA', 'VVVVxx'),
+(6758, 5668, 0, 2, 8, 18, 58, 758, 758, 1758, 6758, 116, 117, 'YZAAAA', 'AKIAAA', 'AAAAxx'),
+(3435, 5669, 1, 3, 5, 15, 35, 435, 1435, 3435, 3435, 70, 71, 'DCAAAA', 'BKIAAA', 'HHHHxx'),
+(4350, 5670, 0, 2, 0, 10, 50, 350, 350, 4350, 4350, 100, 101, 'ILAAAA', 'CKIAAA', 'OOOOxx'),
+(9088, 5671, 0, 0, 8, 8, 88, 88, 1088, 4088, 9088, 176, 177, 'OLAAAA', 'DKIAAA', 'VVVVxx'),
+(6368, 5672, 0, 0, 8, 8, 68, 368, 368, 1368, 6368, 136, 137, 'YKAAAA', 'EKIAAA', 'AAAAxx'),
+(6337, 5673, 1, 1, 7, 17, 37, 337, 337, 1337, 6337, 74, 75, 'TJAAAA', 'FKIAAA', 'HHHHxx'),
+(4361, 5674, 1, 1, 1, 1, 61, 361, 361, 4361, 4361, 122, 123, 'TLAAAA', 'GKIAAA', 'OOOOxx'),
+(1719, 5675, 1, 3, 9, 19, 19, 719, 1719, 1719, 1719, 38, 39, 'DOAAAA', 'HKIAAA', 'VVVVxx'),
+(3109, 5676, 1, 1, 9, 9, 9, 109, 1109, 3109, 3109, 18, 19, 'PPAAAA', 'IKIAAA', 'AAAAxx'),
+(7135, 5677, 1, 3, 5, 15, 35, 135, 1135, 2135, 7135, 70, 71, 'LOAAAA', 'JKIAAA', 'HHHHxx'),
+(1964, 5678, 0, 0, 4, 4, 64, 964, 1964, 1964, 1964, 128, 129, 'OXAAAA', 'KKIAAA', 'OOOOxx'),
+(3, 5679, 1, 3, 3, 3, 3, 3, 3, 3, 3, 6, 7, 'DAAAAA', 'LKIAAA', 'VVVVxx'),
+(1868, 5680, 0, 0, 8, 8, 68, 868, 1868, 1868, 1868, 136, 137, 'WTAAAA', 'MKIAAA', 'AAAAxx'),
+(5182, 5681, 0, 2, 2, 2, 82, 182, 1182, 182, 5182, 164, 165, 'IRAAAA', 'NKIAAA', 'HHHHxx'),
+(7567, 5682, 1, 3, 7, 7, 67, 567, 1567, 2567, 7567, 134, 135, 'BFAAAA', 'OKIAAA', 'OOOOxx'),
+(3676, 5683, 0, 0, 6, 16, 76, 676, 1676, 3676, 3676, 152, 153, 'KLAAAA', 'PKIAAA', 'VVVVxx'),
+(9382, 5684, 0, 2, 2, 2, 82, 382, 1382, 4382, 9382, 164, 165, 'WWAAAA', 'QKIAAA', 'AAAAxx'),
+(8645, 5685, 1, 1, 5, 5, 45, 645, 645, 3645, 8645, 90, 91, 'NUAAAA', 'RKIAAA', 'HHHHxx'),
+(2018, 5686, 0, 2, 8, 18, 18, 18, 18, 2018, 2018, 36, 37, 'QZAAAA', 'SKIAAA', 'OOOOxx'),
+(217, 5687, 1, 1, 7, 17, 17, 217, 217, 217, 217, 34, 35, 'JIAAAA', 'TKIAAA', 'VVVVxx'),
+(6793, 5688, 1, 1, 3, 13, 93, 793, 793, 1793, 6793, 186, 187, 'HBAAAA', 'UKIAAA', 'AAAAxx'),
+(7280, 5689, 0, 0, 0, 0, 80, 280, 1280, 2280, 7280, 160, 161, 'AUAAAA', 'VKIAAA', 'HHHHxx'),
+(2168, 5690, 0, 0, 8, 8, 68, 168, 168, 2168, 2168, 136, 137, 'KFAAAA', 'WKIAAA', 'OOOOxx'),
+(5259, 5691, 1, 3, 9, 19, 59, 259, 1259, 259, 5259, 118, 119, 'HUAAAA', 'XKIAAA', 'VVVVxx'),
+(6019, 5692, 1, 3, 9, 19, 19, 19, 19, 1019, 6019, 38, 39, 'NXAAAA', 'YKIAAA', 'AAAAxx'),
+(877, 5693, 1, 1, 7, 17, 77, 877, 877, 877, 877, 154, 155, 'THAAAA', 'ZKIAAA', 'HHHHxx'),
+(4961, 5694, 1, 1, 1, 1, 61, 961, 961, 4961, 4961, 122, 123, 'VIAAAA', 'ALIAAA', 'OOOOxx'),
+(1873, 5695, 1, 1, 3, 13, 73, 873, 1873, 1873, 1873, 146, 147, 'BUAAAA', 'BLIAAA', 'VVVVxx'),
+(13, 5696, 1, 1, 3, 13, 13, 13, 13, 13, 13, 26, 27, 'NAAAAA', 'CLIAAA', 'AAAAxx'),
+(1537, 5697, 1, 1, 7, 17, 37, 537, 1537, 1537, 1537, 74, 75, 'DHAAAA', 'DLIAAA', 'HHHHxx'),
+(3129, 5698, 1, 1, 9, 9, 29, 129, 1129, 3129, 3129, 58, 59, 'JQAAAA', 'ELIAAA', 'OOOOxx'),
+(6473, 5699, 1, 1, 3, 13, 73, 473, 473, 1473, 6473, 146, 147, 'ZOAAAA', 'FLIAAA', 'VVVVxx'),
+(7865, 5700, 1, 1, 5, 5, 65, 865, 1865, 2865, 7865, 130, 131, 'NQAAAA', 'GLIAAA', 'AAAAxx'),
+(7822, 5701, 0, 2, 2, 2, 22, 822, 1822, 2822, 7822, 44, 45, 'WOAAAA', 'HLIAAA', 'HHHHxx'),
+(239, 5702, 1, 3, 9, 19, 39, 239, 239, 239, 239, 78, 79, 'FJAAAA', 'ILIAAA', 'OOOOxx'),
+(2062, 5703, 0, 2, 2, 2, 62, 62, 62, 2062, 2062, 124, 125, 'IBAAAA', 'JLIAAA', 'VVVVxx'),
+(762, 5704, 0, 2, 2, 2, 62, 762, 762, 762, 762, 124, 125, 'IDAAAA', 'KLIAAA', 'AAAAxx'),
+(3764, 5705, 0, 0, 4, 4, 64, 764, 1764, 3764, 3764, 128, 129, 'UOAAAA', 'LLIAAA', 'HHHHxx'),
+(465, 5706, 1, 1, 5, 5, 65, 465, 465, 465, 465, 130, 131, 'XRAAAA', 'MLIAAA', 'OOOOxx'),
+(2587, 5707, 1, 3, 7, 7, 87, 587, 587, 2587, 2587, 174, 175, 'NVAAAA', 'NLIAAA', 'VVVVxx'),
+(8402, 5708, 0, 2, 2, 2, 2, 402, 402, 3402, 8402, 4, 5, 'ELAAAA', 'OLIAAA', 'AAAAxx'),
+(1055, 5709, 1, 3, 5, 15, 55, 55, 1055, 1055, 1055, 110, 111, 'POAAAA', 'PLIAAA', 'HHHHxx'),
+(3072, 5710, 0, 0, 2, 12, 72, 72, 1072, 3072, 3072, 144, 145, 'EOAAAA', 'QLIAAA', 'OOOOxx'),
+(7359, 5711, 1, 3, 9, 19, 59, 359, 1359, 2359, 7359, 118, 119, 'BXAAAA', 'RLIAAA', 'VVVVxx'),
+(6558, 5712, 0, 2, 8, 18, 58, 558, 558, 1558, 6558, 116, 117, 'GSAAAA', 'SLIAAA', 'AAAAxx'),
+(48, 5713, 0, 0, 8, 8, 48, 48, 48, 48, 48, 96, 97, 'WBAAAA', 'TLIAAA', 'HHHHxx'),
+(5382, 5714, 0, 2, 2, 2, 82, 382, 1382, 382, 5382, 164, 165, 'AZAAAA', 'ULIAAA', 'OOOOxx'),
+(947, 5715, 1, 3, 7, 7, 47, 947, 947, 947, 947, 94, 95, 'LKAAAA', 'VLIAAA', 'VVVVxx'),
+(2644, 5716, 0, 0, 4, 4, 44, 644, 644, 2644, 2644, 88, 89, 'SXAAAA', 'WLIAAA', 'AAAAxx'),
+(7516, 5717, 0, 0, 6, 16, 16, 516, 1516, 2516, 7516, 32, 33, 'CDAAAA', 'XLIAAA', 'HHHHxx'),
+(2362, 5718, 0, 2, 2, 2, 62, 362, 362, 2362, 2362, 124, 125, 'WMAAAA', 'YLIAAA', 'OOOOxx'),
+(839, 5719, 1, 3, 9, 19, 39, 839, 839, 839, 839, 78, 79, 'HGAAAA', 'ZLIAAA', 'VVVVxx'),
+(2216, 5720, 0, 0, 6, 16, 16, 216, 216, 2216, 2216, 32, 33, 'GHAAAA', 'AMIAAA', 'AAAAxx'),
+(7673, 5721, 1, 1, 3, 13, 73, 673, 1673, 2673, 7673, 146, 147, 'DJAAAA', 'BMIAAA', 'HHHHxx'),
+(8173, 5722, 1, 1, 3, 13, 73, 173, 173, 3173, 8173, 146, 147, 'JCAAAA', 'CMIAAA', 'OOOOxx'),
+(1630, 5723, 0, 2, 0, 10, 30, 630, 1630, 1630, 1630, 60, 61, 'SKAAAA', 'DMIAAA', 'VVVVxx'),
+(9057, 5724, 1, 1, 7, 17, 57, 57, 1057, 4057, 9057, 114, 115, 'JKAAAA', 'EMIAAA', 'AAAAxx'),
+(4392, 5725, 0, 0, 2, 12, 92, 392, 392, 4392, 4392, 184, 185, 'YMAAAA', 'FMIAAA', 'HHHHxx'),
+(3695, 5726, 1, 3, 5, 15, 95, 695, 1695, 3695, 3695, 190, 191, 'DMAAAA', 'GMIAAA', 'OOOOxx'),
+(5751, 5727, 1, 3, 1, 11, 51, 751, 1751, 751, 5751, 102, 103, 'FNAAAA', 'HMIAAA', 'VVVVxx'),
+(5745, 5728, 1, 1, 5, 5, 45, 745, 1745, 745, 5745, 90, 91, 'ZMAAAA', 'IMIAAA', 'AAAAxx'),
+(7945, 5729, 1, 1, 5, 5, 45, 945, 1945, 2945, 7945, 90, 91, 'PTAAAA', 'JMIAAA', 'HHHHxx'),
+(5174, 5730, 0, 2, 4, 14, 74, 174, 1174, 174, 5174, 148, 149, 'ARAAAA', 'KMIAAA', 'OOOOxx'),
+(3829, 5731, 1, 1, 9, 9, 29, 829, 1829, 3829, 3829, 58, 59, 'HRAAAA', 'LMIAAA', 'VVVVxx'),
+(3317, 5732, 1, 1, 7, 17, 17, 317, 1317, 3317, 3317, 34, 35, 'PXAAAA', 'MMIAAA', 'AAAAxx'),
+(4253, 5733, 1, 1, 3, 13, 53, 253, 253, 4253, 4253, 106, 107, 'PHAAAA', 'NMIAAA', 'HHHHxx'),
+(1291, 5734, 1, 3, 1, 11, 91, 291, 1291, 1291, 1291, 182, 183, 'RXAAAA', 'OMIAAA', 'OOOOxx'),
+(3266, 5735, 0, 2, 6, 6, 66, 266, 1266, 3266, 3266, 132, 133, 'QVAAAA', 'PMIAAA', 'VVVVxx'),
+(2939, 5736, 1, 3, 9, 19, 39, 939, 939, 2939, 2939, 78, 79, 'BJAAAA', 'QMIAAA', 'AAAAxx'),
+(2755, 5737, 1, 3, 5, 15, 55, 755, 755, 2755, 2755, 110, 111, 'ZBAAAA', 'RMIAAA', 'HHHHxx'),
+(6844, 5738, 0, 0, 4, 4, 44, 844, 844, 1844, 6844, 88, 89, 'GDAAAA', 'SMIAAA', 'OOOOxx'),
+(8594, 5739, 0, 2, 4, 14, 94, 594, 594, 3594, 8594, 188, 189, 'OSAAAA', 'TMIAAA', 'VVVVxx'),
+(704, 5740, 0, 0, 4, 4, 4, 704, 704, 704, 704, 8, 9, 'CBAAAA', 'UMIAAA', 'AAAAxx'),
+(1681, 5741, 1, 1, 1, 1, 81, 681, 1681, 1681, 1681, 162, 163, 'RMAAAA', 'VMIAAA', 'HHHHxx'),
+(364, 5742, 0, 0, 4, 4, 64, 364, 364, 364, 364, 128, 129, 'AOAAAA', 'WMIAAA', 'OOOOxx'),
+(2928, 5743, 0, 0, 8, 8, 28, 928, 928, 2928, 2928, 56, 57, 'QIAAAA', 'XMIAAA', 'VVVVxx'),
+(117, 5744, 1, 1, 7, 17, 17, 117, 117, 117, 117, 34, 35, 'NEAAAA', 'YMIAAA', 'AAAAxx'),
+(96, 5745, 0, 0, 6, 16, 96, 96, 96, 96, 96, 192, 193, 'SDAAAA', 'ZMIAAA', 'HHHHxx'),
+(7796, 5746, 0, 0, 6, 16, 96, 796, 1796, 2796, 7796, 192, 193, 'WNAAAA', 'ANIAAA', 'OOOOxx'),
+(3101, 5747, 1, 1, 1, 1, 1, 101, 1101, 3101, 3101, 2, 3, 'HPAAAA', 'BNIAAA', 'VVVVxx'),
+(3397, 5748, 1, 1, 7, 17, 97, 397, 1397, 3397, 3397, 194, 195, 'RAAAAA', 'CNIAAA', 'AAAAxx'),
+(1605, 5749, 1, 1, 5, 5, 5, 605, 1605, 1605, 1605, 10, 11, 'TJAAAA', 'DNIAAA', 'HHHHxx'),
+(4881, 5750, 1, 1, 1, 1, 81, 881, 881, 4881, 4881, 162, 163, 'TFAAAA', 'ENIAAA', 'OOOOxx'),
+(4521, 5751, 1, 1, 1, 1, 21, 521, 521, 4521, 4521, 42, 43, 'XRAAAA', 'FNIAAA', 'VVVVxx'),
+(6430, 5752, 0, 2, 0, 10, 30, 430, 430, 1430, 6430, 60, 61, 'INAAAA', 'GNIAAA', 'AAAAxx'),
+(282, 5753, 0, 2, 2, 2, 82, 282, 282, 282, 282, 164, 165, 'WKAAAA', 'HNIAAA', 'HHHHxx'),
+(9645, 5754, 1, 1, 5, 5, 45, 645, 1645, 4645, 9645, 90, 91, 'ZGAAAA', 'INIAAA', 'OOOOxx'),
+(8946, 5755, 0, 2, 6, 6, 46, 946, 946, 3946, 8946, 92, 93, 'CGAAAA', 'JNIAAA', 'VVVVxx'),
+(5064, 5756, 0, 0, 4, 4, 64, 64, 1064, 64, 5064, 128, 129, 'UMAAAA', 'KNIAAA', 'AAAAxx'),
+(7470, 5757, 0, 2, 0, 10, 70, 470, 1470, 2470, 7470, 140, 141, 'IBAAAA', 'LNIAAA', 'HHHHxx'),
+(5886, 5758, 0, 2, 6, 6, 86, 886, 1886, 886, 5886, 172, 173, 'KSAAAA', 'MNIAAA', 'OOOOxx'),
+(6280, 5759, 0, 0, 0, 0, 80, 280, 280, 1280, 6280, 160, 161, 'OHAAAA', 'NNIAAA', 'VVVVxx'),
+(5247, 5760, 1, 3, 7, 7, 47, 247, 1247, 247, 5247, 94, 95, 'VTAAAA', 'ONIAAA', 'AAAAxx'),
+(412, 5761, 0, 0, 2, 12, 12, 412, 412, 412, 412, 24, 25, 'WPAAAA', 'PNIAAA', 'HHHHxx'),
+(5342, 5762, 0, 2, 2, 2, 42, 342, 1342, 342, 5342, 84, 85, 'MXAAAA', 'QNIAAA', 'OOOOxx'),
+(2271, 5763, 1, 3, 1, 11, 71, 271, 271, 2271, 2271, 142, 143, 'JJAAAA', 'RNIAAA', 'VVVVxx'),
+(849, 5764, 1, 1, 9, 9, 49, 849, 849, 849, 849, 98, 99, 'RGAAAA', 'SNIAAA', 'AAAAxx'),
+(1885, 5765, 1, 1, 5, 5, 85, 885, 1885, 1885, 1885, 170, 171, 'NUAAAA', 'TNIAAA', 'HHHHxx'),
+(5620, 5766, 0, 0, 0, 0, 20, 620, 1620, 620, 5620, 40, 41, 'EIAAAA', 'UNIAAA', 'OOOOxx'),
+(7079, 5767, 1, 3, 9, 19, 79, 79, 1079, 2079, 7079, 158, 159, 'HMAAAA', 'VNIAAA', 'VVVVxx'),
+(5819, 5768, 1, 3, 9, 19, 19, 819, 1819, 819, 5819, 38, 39, 'VPAAAA', 'WNIAAA', 'AAAAxx'),
+(7497, 5769, 1, 1, 7, 17, 97, 497, 1497, 2497, 7497, 194, 195, 'JCAAAA', 'XNIAAA', 'HHHHxx'),
+(5993, 5770, 1, 1, 3, 13, 93, 993, 1993, 993, 5993, 186, 187, 'NWAAAA', 'YNIAAA', 'OOOOxx'),
+(3739, 5771, 1, 3, 9, 19, 39, 739, 1739, 3739, 3739, 78, 79, 'VNAAAA', 'ZNIAAA', 'VVVVxx'),
+(6296, 5772, 0, 0, 6, 16, 96, 296, 296, 1296, 6296, 192, 193, 'EIAAAA', 'AOIAAA', 'AAAAxx'),
+(2716, 5773, 0, 0, 6, 16, 16, 716, 716, 2716, 2716, 32, 33, 'MAAAAA', 'BOIAAA', 'HHHHxx'),
+(1130, 5774, 0, 2, 0, 10, 30, 130, 1130, 1130, 1130, 60, 61, 'MRAAAA', 'COIAAA', 'OOOOxx'),
+(5593, 5775, 1, 1, 3, 13, 93, 593, 1593, 593, 5593, 186, 187, 'DHAAAA', 'DOIAAA', 'VVVVxx'),
+(6972, 5776, 0, 0, 2, 12, 72, 972, 972, 1972, 6972, 144, 145, 'EIAAAA', 'EOIAAA', 'AAAAxx'),
+(8360, 5777, 0, 0, 0, 0, 60, 360, 360, 3360, 8360, 120, 121, 'OJAAAA', 'FOIAAA', 'HHHHxx'),
+(6448, 5778, 0, 0, 8, 8, 48, 448, 448, 1448, 6448, 96, 97, 'AOAAAA', 'GOIAAA', 'OOOOxx'),
+(3689, 5779, 1, 1, 9, 9, 89, 689, 1689, 3689, 3689, 178, 179, 'XLAAAA', 'HOIAAA', 'VVVVxx'),
+(7951, 5780, 1, 3, 1, 11, 51, 951, 1951, 2951, 7951, 102, 103, 'VTAAAA', 'IOIAAA', 'AAAAxx'),
+(2974, 5781, 0, 2, 4, 14, 74, 974, 974, 2974, 2974, 148, 149, 'KKAAAA', 'JOIAAA', 'HHHHxx'),
+(6600, 5782, 0, 0, 0, 0, 0, 600, 600, 1600, 6600, 0, 1, 'WTAAAA', 'KOIAAA', 'OOOOxx'),
+(4662, 5783, 0, 2, 2, 2, 62, 662, 662, 4662, 4662, 124, 125, 'IXAAAA', 'LOIAAA', 'VVVVxx'),
+(4765, 5784, 1, 1, 5, 5, 65, 765, 765, 4765, 4765, 130, 131, 'HBAAAA', 'MOIAAA', 'AAAAxx'),
+(355, 5785, 1, 3, 5, 15, 55, 355, 355, 355, 355, 110, 111, 'RNAAAA', 'NOIAAA', 'HHHHxx'),
+(6228, 5786, 0, 0, 8, 8, 28, 228, 228, 1228, 6228, 56, 57, 'OFAAAA', 'OOIAAA', 'OOOOxx'),
+(964, 5787, 0, 0, 4, 4, 64, 964, 964, 964, 964, 128, 129, 'CLAAAA', 'POIAAA', 'VVVVxx'),
+(3082, 5788, 0, 2, 2, 2, 82, 82, 1082, 3082, 3082, 164, 165, 'OOAAAA', 'QOIAAA', 'AAAAxx'),
+(7028, 5789, 0, 0, 8, 8, 28, 28, 1028, 2028, 7028, 56, 57, 'IKAAAA', 'ROIAAA', 'HHHHxx'),
+(4505, 5790, 1, 1, 5, 5, 5, 505, 505, 4505, 4505, 10, 11, 'HRAAAA', 'SOIAAA', 'OOOOxx'),
+(8961, 5791, 1, 1, 1, 1, 61, 961, 961, 3961, 8961, 122, 123, 'RGAAAA', 'TOIAAA', 'VVVVxx'),
+(9571, 5792, 1, 3, 1, 11, 71, 571, 1571, 4571, 9571, 142, 143, 'DEAAAA', 'UOIAAA', 'AAAAxx'),
+(9394, 5793, 0, 2, 4, 14, 94, 394, 1394, 4394, 9394, 188, 189, 'IXAAAA', 'VOIAAA', 'HHHHxx'),
+(4245, 5794, 1, 1, 5, 5, 45, 245, 245, 4245, 4245, 90, 91, 'HHAAAA', 'WOIAAA', 'OOOOxx'),
+(7560, 5795, 0, 0, 0, 0, 60, 560, 1560, 2560, 7560, 120, 121, 'UEAAAA', 'XOIAAA', 'VVVVxx'),
+(2907, 5796, 1, 3, 7, 7, 7, 907, 907, 2907, 2907, 14, 15, 'VHAAAA', 'YOIAAA', 'AAAAxx'),
+(7817, 5797, 1, 1, 7, 17, 17, 817, 1817, 2817, 7817, 34, 35, 'ROAAAA', 'ZOIAAA', 'HHHHxx'),
+(5408, 5798, 0, 0, 8, 8, 8, 408, 1408, 408, 5408, 16, 17, 'AAAAAA', 'APIAAA', 'OOOOxx'),
+(8092, 5799, 0, 0, 2, 12, 92, 92, 92, 3092, 8092, 184, 185, 'GZAAAA', 'BPIAAA', 'VVVVxx'),
+(1309, 5800, 1, 1, 9, 9, 9, 309, 1309, 1309, 1309, 18, 19, 'JYAAAA', 'CPIAAA', 'AAAAxx'),
+(6673, 5801, 1, 1, 3, 13, 73, 673, 673, 1673, 6673, 146, 147, 'RWAAAA', 'DPIAAA', 'HHHHxx'),
+(1245, 5802, 1, 1, 5, 5, 45, 245, 1245, 1245, 1245, 90, 91, 'XVAAAA', 'EPIAAA', 'OOOOxx'),
+(6790, 5803, 0, 2, 0, 10, 90, 790, 790, 1790, 6790, 180, 181, 'EBAAAA', 'FPIAAA', 'VVVVxx'),
+(8380, 5804, 0, 0, 0, 0, 80, 380, 380, 3380, 8380, 160, 161, 'IKAAAA', 'GPIAAA', 'AAAAxx'),
+(5786, 5805, 0, 2, 6, 6, 86, 786, 1786, 786, 5786, 172, 173, 'OOAAAA', 'HPIAAA', 'HHHHxx'),
+(9590, 5806, 0, 2, 0, 10, 90, 590, 1590, 4590, 9590, 180, 181, 'WEAAAA', 'IPIAAA', 'OOOOxx'),
+(5763, 5807, 1, 3, 3, 3, 63, 763, 1763, 763, 5763, 126, 127, 'RNAAAA', 'JPIAAA', 'VVVVxx'),
+(1345, 5808, 1, 1, 5, 5, 45, 345, 1345, 1345, 1345, 90, 91, 'TZAAAA', 'KPIAAA', 'AAAAxx'),
+(3480, 5809, 0, 0, 0, 0, 80, 480, 1480, 3480, 3480, 160, 161, 'WDAAAA', 'LPIAAA', 'HHHHxx'),
+(7864, 5810, 0, 0, 4, 4, 64, 864, 1864, 2864, 7864, 128, 129, 'MQAAAA', 'MPIAAA', 'OOOOxx'),
+(4853, 5811, 1, 1, 3, 13, 53, 853, 853, 4853, 4853, 106, 107, 'REAAAA', 'NPIAAA', 'VVVVxx'),
+(1445, 5812, 1, 1, 5, 5, 45, 445, 1445, 1445, 1445, 90, 91, 'PDAAAA', 'OPIAAA', 'AAAAxx'),
+(170, 5813, 0, 2, 0, 10, 70, 170, 170, 170, 170, 140, 141, 'OGAAAA', 'PPIAAA', 'HHHHxx'),
+(7348, 5814, 0, 0, 8, 8, 48, 348, 1348, 2348, 7348, 96, 97, 'QWAAAA', 'QPIAAA', 'OOOOxx'),
+(3920, 5815, 0, 0, 0, 0, 20, 920, 1920, 3920, 3920, 40, 41, 'UUAAAA', 'RPIAAA', 'VVVVxx'),
+(3307, 5816, 1, 3, 7, 7, 7, 307, 1307, 3307, 3307, 14, 15, 'FXAAAA', 'SPIAAA', 'AAAAxx'),
+(4584, 5817, 0, 0, 4, 4, 84, 584, 584, 4584, 4584, 168, 169, 'IUAAAA', 'TPIAAA', 'HHHHxx'),
+(3344, 5818, 0, 0, 4, 4, 44, 344, 1344, 3344, 3344, 88, 89, 'QYAAAA', 'UPIAAA', 'OOOOxx'),
+(4360, 5819, 0, 0, 0, 0, 60, 360, 360, 4360, 4360, 120, 121, 'SLAAAA', 'VPIAAA', 'VVVVxx'),
+(8757, 5820, 1, 1, 7, 17, 57, 757, 757, 3757, 8757, 114, 115, 'VYAAAA', 'WPIAAA', 'AAAAxx'),
+(4315, 5821, 1, 3, 5, 15, 15, 315, 315, 4315, 4315, 30, 31, 'ZJAAAA', 'XPIAAA', 'HHHHxx'),
+(5243, 5822, 1, 3, 3, 3, 43, 243, 1243, 243, 5243, 86, 87, 'RTAAAA', 'YPIAAA', 'OOOOxx'),
+(8550, 5823, 0, 2, 0, 10, 50, 550, 550, 3550, 8550, 100, 101, 'WQAAAA', 'ZPIAAA', 'VVVVxx'),
+(159, 5824, 1, 3, 9, 19, 59, 159, 159, 159, 159, 118, 119, 'DGAAAA', 'AQIAAA', 'AAAAxx'),
+(4710, 5825, 0, 2, 0, 10, 10, 710, 710, 4710, 4710, 20, 21, 'EZAAAA', 'BQIAAA', 'HHHHxx'),
+(7179, 5826, 1, 3, 9, 19, 79, 179, 1179, 2179, 7179, 158, 159, 'DQAAAA', 'CQIAAA', 'OOOOxx'),
+(2509, 5827, 1, 1, 9, 9, 9, 509, 509, 2509, 2509, 18, 19, 'NSAAAA', 'DQIAAA', 'VVVVxx'),
+(6981, 5828, 1, 1, 1, 1, 81, 981, 981, 1981, 6981, 162, 163, 'NIAAAA', 'EQIAAA', 'AAAAxx'),
+(5060, 5829, 0, 0, 0, 0, 60, 60, 1060, 60, 5060, 120, 121, 'QMAAAA', 'FQIAAA', 'HHHHxx'),
+(5601, 5830, 1, 1, 1, 1, 1, 601, 1601, 601, 5601, 2, 3, 'LHAAAA', 'GQIAAA', 'OOOOxx'),
+(703, 5831, 1, 3, 3, 3, 3, 703, 703, 703, 703, 6, 7, 'BBAAAA', 'HQIAAA', 'VVVVxx'),
+(8719, 5832, 1, 3, 9, 19, 19, 719, 719, 3719, 8719, 38, 39, 'JXAAAA', 'IQIAAA', 'AAAAxx'),
+(1570, 5833, 0, 2, 0, 10, 70, 570, 1570, 1570, 1570, 140, 141, 'KIAAAA', 'JQIAAA', 'HHHHxx'),
+(1036, 5834, 0, 0, 6, 16, 36, 36, 1036, 1036, 1036, 72, 73, 'WNAAAA', 'KQIAAA', 'OOOOxx'),
+(6703, 5835, 1, 3, 3, 3, 3, 703, 703, 1703, 6703, 6, 7, 'VXAAAA', 'LQIAAA', 'VVVVxx'),
+(252, 5836, 0, 0, 2, 12, 52, 252, 252, 252, 252, 104, 105, 'SJAAAA', 'MQIAAA', 'AAAAxx'),
+(631, 5837, 1, 3, 1, 11, 31, 631, 631, 631, 631, 62, 63, 'HYAAAA', 'NQIAAA', 'HHHHxx'),
+(5098, 5838, 0, 2, 8, 18, 98, 98, 1098, 98, 5098, 196, 197, 'COAAAA', 'OQIAAA', 'OOOOxx'),
+(8346, 5839, 0, 2, 6, 6, 46, 346, 346, 3346, 8346, 92, 93, 'AJAAAA', 'PQIAAA', 'VVVVxx'),
+(4910, 5840, 0, 2, 0, 10, 10, 910, 910, 4910, 4910, 20, 21, 'WGAAAA', 'QQIAAA', 'AAAAxx'),
+(559, 5841, 1, 3, 9, 19, 59, 559, 559, 559, 559, 118, 119, 'NVAAAA', 'RQIAAA', 'HHHHxx'),
+(1477, 5842, 1, 1, 7, 17, 77, 477, 1477, 1477, 1477, 154, 155, 'VEAAAA', 'SQIAAA', 'OOOOxx'),
+(5115, 5843, 1, 3, 5, 15, 15, 115, 1115, 115, 5115, 30, 31, 'TOAAAA', 'TQIAAA', 'VVVVxx'),
+(8784, 5844, 0, 0, 4, 4, 84, 784, 784, 3784, 8784, 168, 169, 'WZAAAA', 'UQIAAA', 'AAAAxx'),
+(4422, 5845, 0, 2, 2, 2, 22, 422, 422, 4422, 4422, 44, 45, 'COAAAA', 'VQIAAA', 'HHHHxx'),
+(2702, 5846, 0, 2, 2, 2, 2, 702, 702, 2702, 2702, 4, 5, 'YZAAAA', 'WQIAAA', 'OOOOxx'),
+(9599, 5847, 1, 3, 9, 19, 99, 599, 1599, 4599, 9599, 198, 199, 'FFAAAA', 'XQIAAA', 'VVVVxx'),
+(2463, 5848, 1, 3, 3, 3, 63, 463, 463, 2463, 2463, 126, 127, 'TQAAAA', 'YQIAAA', 'AAAAxx'),
+(498, 5849, 0, 2, 8, 18, 98, 498, 498, 498, 498, 196, 197, 'ETAAAA', 'ZQIAAA', 'HHHHxx'),
+(494, 5850, 0, 2, 4, 14, 94, 494, 494, 494, 494, 188, 189, 'ATAAAA', 'ARIAAA', 'OOOOxx'),
+(8632, 5851, 0, 0, 2, 12, 32, 632, 632, 3632, 8632, 64, 65, 'AUAAAA', 'BRIAAA', 'VVVVxx'),
+(3449, 5852, 1, 1, 9, 9, 49, 449, 1449, 3449, 3449, 98, 99, 'RCAAAA', 'CRIAAA', 'AAAAxx'),
+(5888, 5853, 0, 0, 8, 8, 88, 888, 1888, 888, 5888, 176, 177, 'MSAAAA', 'DRIAAA', 'HHHHxx'),
+(2211, 5854, 1, 3, 1, 11, 11, 211, 211, 2211, 2211, 22, 23, 'BHAAAA', 'ERIAAA', 'OOOOxx'),
+(2835, 5855, 1, 3, 5, 15, 35, 835, 835, 2835, 2835, 70, 71, 'BFAAAA', 'FRIAAA', 'VVVVxx'),
+(4196, 5856, 0, 0, 6, 16, 96, 196, 196, 4196, 4196, 192, 193, 'KFAAAA', 'GRIAAA', 'AAAAxx'),
+(2177, 5857, 1, 1, 7, 17, 77, 177, 177, 2177, 2177, 154, 155, 'TFAAAA', 'HRIAAA', 'HHHHxx'),
+(1959, 5858, 1, 3, 9, 19, 59, 959, 1959, 1959, 1959, 118, 119, 'JXAAAA', 'IRIAAA', 'OOOOxx'),
+(5172, 5859, 0, 0, 2, 12, 72, 172, 1172, 172, 5172, 144, 145, 'YQAAAA', 'JRIAAA', 'VVVVxx'),
+(7898, 5860, 0, 2, 8, 18, 98, 898, 1898, 2898, 7898, 196, 197, 'URAAAA', 'KRIAAA', 'AAAAxx'),
+(5729, 5861, 1, 1, 9, 9, 29, 729, 1729, 729, 5729, 58, 59, 'JMAAAA', 'LRIAAA', 'HHHHxx'),
+(469, 5862, 1, 1, 9, 9, 69, 469, 469, 469, 469, 138, 139, 'BSAAAA', 'MRIAAA', 'OOOOxx'),
+(4456, 5863, 0, 0, 6, 16, 56, 456, 456, 4456, 4456, 112, 113, 'KPAAAA', 'NRIAAA', 'VVVVxx'),
+(3578, 5864, 0, 2, 8, 18, 78, 578, 1578, 3578, 3578, 156, 157, 'QHAAAA', 'ORIAAA', 'AAAAxx'),
+(8623, 5865, 1, 3, 3, 3, 23, 623, 623, 3623, 8623, 46, 47, 'RTAAAA', 'PRIAAA', 'HHHHxx'),
+(6749, 5866, 1, 1, 9, 9, 49, 749, 749, 1749, 6749, 98, 99, 'PZAAAA', 'QRIAAA', 'OOOOxx'),
+(6735, 5867, 1, 3, 5, 15, 35, 735, 735, 1735, 6735, 70, 71, 'BZAAAA', 'RRIAAA', 'VVVVxx'),
+(5197, 5868, 1, 1, 7, 17, 97, 197, 1197, 197, 5197, 194, 195, 'XRAAAA', 'SRIAAA', 'AAAAxx'),
+(2067, 5869, 1, 3, 7, 7, 67, 67, 67, 2067, 2067, 134, 135, 'NBAAAA', 'TRIAAA', 'HHHHxx'),
+(5600, 5870, 0, 0, 0, 0, 0, 600, 1600, 600, 5600, 0, 1, 'KHAAAA', 'URIAAA', 'OOOOxx'),
+(7741, 5871, 1, 1, 1, 1, 41, 741, 1741, 2741, 7741, 82, 83, 'TLAAAA', 'VRIAAA', 'VVVVxx'),
+(9925, 5872, 1, 1, 5, 5, 25, 925, 1925, 4925, 9925, 50, 51, 'TRAAAA', 'WRIAAA', 'AAAAxx'),
+(9685, 5873, 1, 1, 5, 5, 85, 685, 1685, 4685, 9685, 170, 171, 'NIAAAA', 'XRIAAA', 'HHHHxx'),
+(7622, 5874, 0, 2, 2, 2, 22, 622, 1622, 2622, 7622, 44, 45, 'EHAAAA', 'YRIAAA', 'OOOOxx'),
+(6859, 5875, 1, 3, 9, 19, 59, 859, 859, 1859, 6859, 118, 119, 'VDAAAA', 'ZRIAAA', 'VVVVxx'),
+(3094, 5876, 0, 2, 4, 14, 94, 94, 1094, 3094, 3094, 188, 189, 'APAAAA', 'ASIAAA', 'AAAAxx'),
+(2628, 5877, 0, 0, 8, 8, 28, 628, 628, 2628, 2628, 56, 57, 'CXAAAA', 'BSIAAA', 'HHHHxx'),
+(40, 5878, 0, 0, 0, 0, 40, 40, 40, 40, 40, 80, 81, 'OBAAAA', 'CSIAAA', 'OOOOxx'),
+(1644, 5879, 0, 0, 4, 4, 44, 644, 1644, 1644, 1644, 88, 89, 'GLAAAA', 'DSIAAA', 'VVVVxx'),
+(588, 5880, 0, 0, 8, 8, 88, 588, 588, 588, 588, 176, 177, 'QWAAAA', 'ESIAAA', 'AAAAxx'),
+(7522, 5881, 0, 2, 2, 2, 22, 522, 1522, 2522, 7522, 44, 45, 'IDAAAA', 'FSIAAA', 'HHHHxx'),
+(162, 5882, 0, 2, 2, 2, 62, 162, 162, 162, 162, 124, 125, 'GGAAAA', 'GSIAAA', 'OOOOxx'),
+(3610, 5883, 0, 2, 0, 10, 10, 610, 1610, 3610, 3610, 20, 21, 'WIAAAA', 'HSIAAA', 'VVVVxx'),
+(3561, 5884, 1, 1, 1, 1, 61, 561, 1561, 3561, 3561, 122, 123, 'ZGAAAA', 'ISIAAA', 'AAAAxx'),
+(8185, 5885, 1, 1, 5, 5, 85, 185, 185, 3185, 8185, 170, 171, 'VCAAAA', 'JSIAAA', 'HHHHxx'),
+(7237, 5886, 1, 1, 7, 17, 37, 237, 1237, 2237, 7237, 74, 75, 'JSAAAA', 'KSIAAA', 'OOOOxx'),
+(4592, 5887, 0, 0, 2, 12, 92, 592, 592, 4592, 4592, 184, 185, 'QUAAAA', 'LSIAAA', 'VVVVxx'),
+(7082, 5888, 0, 2, 2, 2, 82, 82, 1082, 2082, 7082, 164, 165, 'KMAAAA', 'MSIAAA', 'AAAAxx'),
+(4719, 5889, 1, 3, 9, 19, 19, 719, 719, 4719, 4719, 38, 39, 'NZAAAA', 'NSIAAA', 'HHHHxx'),
+(3879, 5890, 1, 3, 9, 19, 79, 879, 1879, 3879, 3879, 158, 159, 'FTAAAA', 'OSIAAA', 'OOOOxx'),
+(1662, 5891, 0, 2, 2, 2, 62, 662, 1662, 1662, 1662, 124, 125, 'YLAAAA', 'PSIAAA', 'VVVVxx'),
+(3995, 5892, 1, 3, 5, 15, 95, 995, 1995, 3995, 3995, 190, 191, 'RXAAAA', 'QSIAAA', 'AAAAxx'),
+(5828, 5893, 0, 0, 8, 8, 28, 828, 1828, 828, 5828, 56, 57, 'EQAAAA', 'RSIAAA', 'HHHHxx'),
+(4197, 5894, 1, 1, 7, 17, 97, 197, 197, 4197, 4197, 194, 195, 'LFAAAA', 'SSIAAA', 'OOOOxx'),
+(5146, 5895, 0, 2, 6, 6, 46, 146, 1146, 146, 5146, 92, 93, 'YPAAAA', 'TSIAAA', 'VVVVxx'),
+(753, 5896, 1, 1, 3, 13, 53, 753, 753, 753, 753, 106, 107, 'ZCAAAA', 'USIAAA', 'AAAAxx'),
+(7064, 5897, 0, 0, 4, 4, 64, 64, 1064, 2064, 7064, 128, 129, 'SLAAAA', 'VSIAAA', 'HHHHxx'),
+(1312, 5898, 0, 0, 2, 12, 12, 312, 1312, 1312, 1312, 24, 25, 'MYAAAA', 'WSIAAA', 'OOOOxx'),
+(5573, 5899, 1, 1, 3, 13, 73, 573, 1573, 573, 5573, 146, 147, 'JGAAAA', 'XSIAAA', 'VVVVxx'),
+(7634, 5900, 0, 2, 4, 14, 34, 634, 1634, 2634, 7634, 68, 69, 'QHAAAA', 'YSIAAA', 'AAAAxx'),
+(2459, 5901, 1, 3, 9, 19, 59, 459, 459, 2459, 2459, 118, 119, 'PQAAAA', 'ZSIAAA', 'HHHHxx'),
+(8636, 5902, 0, 0, 6, 16, 36, 636, 636, 3636, 8636, 72, 73, 'EUAAAA', 'ATIAAA', 'OOOOxx'),
+(5318, 5903, 0, 2, 8, 18, 18, 318, 1318, 318, 5318, 36, 37, 'OWAAAA', 'BTIAAA', 'VVVVxx'),
+(1064, 5904, 0, 0, 4, 4, 64, 64, 1064, 1064, 1064, 128, 129, 'YOAAAA', 'CTIAAA', 'AAAAxx'),
+(9779, 5905, 1, 3, 9, 19, 79, 779, 1779, 4779, 9779, 158, 159, 'DMAAAA', 'DTIAAA', 'HHHHxx'),
+(6512, 5906, 0, 0, 2, 12, 12, 512, 512, 1512, 6512, 24, 25, 'MQAAAA', 'ETIAAA', 'OOOOxx'),
+(3572, 5907, 0, 0, 2, 12, 72, 572, 1572, 3572, 3572, 144, 145, 'KHAAAA', 'FTIAAA', 'VVVVxx'),
+(816, 5908, 0, 0, 6, 16, 16, 816, 816, 816, 816, 32, 33, 'KFAAAA', 'GTIAAA', 'AAAAxx'),
+(3978, 5909, 0, 2, 8, 18, 78, 978, 1978, 3978, 3978, 156, 157, 'AXAAAA', 'HTIAAA', 'HHHHxx'),
+(5390, 5910, 0, 2, 0, 10, 90, 390, 1390, 390, 5390, 180, 181, 'IZAAAA', 'ITIAAA', 'OOOOxx'),
+(4685, 5911, 1, 1, 5, 5, 85, 685, 685, 4685, 4685, 170, 171, 'FYAAAA', 'JTIAAA', 'VVVVxx'),
+(3003, 5912, 1, 3, 3, 3, 3, 3, 1003, 3003, 3003, 6, 7, 'NLAAAA', 'KTIAAA', 'AAAAxx'),
+(2638, 5913, 0, 2, 8, 18, 38, 638, 638, 2638, 2638, 76, 77, 'MXAAAA', 'LTIAAA', 'HHHHxx'),
+(9716, 5914, 0, 0, 6, 16, 16, 716, 1716, 4716, 9716, 32, 33, 'SJAAAA', 'MTIAAA', 'OOOOxx'),
+(9598, 5915, 0, 2, 8, 18, 98, 598, 1598, 4598, 9598, 196, 197, 'EFAAAA', 'NTIAAA', 'VVVVxx'),
+(9501, 5916, 1, 1, 1, 1, 1, 501, 1501, 4501, 9501, 2, 3, 'LBAAAA', 'OTIAAA', 'AAAAxx'),
+(1704, 5917, 0, 0, 4, 4, 4, 704, 1704, 1704, 1704, 8, 9, 'ONAAAA', 'PTIAAA', 'HHHHxx'),
+(8609, 5918, 1, 1, 9, 9, 9, 609, 609, 3609, 8609, 18, 19, 'DTAAAA', 'QTIAAA', 'OOOOxx'),
+(5211, 5919, 1, 3, 1, 11, 11, 211, 1211, 211, 5211, 22, 23, 'LSAAAA', 'RTIAAA', 'VVVVxx'),
+(3605, 5920, 1, 1, 5, 5, 5, 605, 1605, 3605, 3605, 10, 11, 'RIAAAA', 'STIAAA', 'AAAAxx'),
+(8730, 5921, 0, 2, 0, 10, 30, 730, 730, 3730, 8730, 60, 61, 'UXAAAA', 'TTIAAA', 'HHHHxx'),
+(4208, 5922, 0, 0, 8, 8, 8, 208, 208, 4208, 4208, 16, 17, 'WFAAAA', 'UTIAAA', 'OOOOxx'),
+(7784, 5923, 0, 0, 4, 4, 84, 784, 1784, 2784, 7784, 168, 169, 'KNAAAA', 'VTIAAA', 'VVVVxx'),
+(7501, 5924, 1, 1, 1, 1, 1, 501, 1501, 2501, 7501, 2, 3, 'NCAAAA', 'WTIAAA', 'AAAAxx'),
+(7862, 5925, 0, 2, 2, 2, 62, 862, 1862, 2862, 7862, 124, 125, 'KQAAAA', 'XTIAAA', 'HHHHxx'),
+(8922, 5926, 0, 2, 2, 2, 22, 922, 922, 3922, 8922, 44, 45, 'EFAAAA', 'YTIAAA', 'OOOOxx'),
+(3857, 5927, 1, 1, 7, 17, 57, 857, 1857, 3857, 3857, 114, 115, 'JSAAAA', 'ZTIAAA', 'VVVVxx'),
+(6393, 5928, 1, 1, 3, 13, 93, 393, 393, 1393, 6393, 186, 187, 'XLAAAA', 'AUIAAA', 'AAAAxx'),
+(506, 5929, 0, 2, 6, 6, 6, 506, 506, 506, 506, 12, 13, 'MTAAAA', 'BUIAAA', 'HHHHxx'),
+(4232, 5930, 0, 0, 2, 12, 32, 232, 232, 4232, 4232, 64, 65, 'UGAAAA', 'CUIAAA', 'OOOOxx'),
+(8991, 5931, 1, 3, 1, 11, 91, 991, 991, 3991, 8991, 182, 183, 'VHAAAA', 'DUIAAA', 'VVVVxx'),
+(8578, 5932, 0, 2, 8, 18, 78, 578, 578, 3578, 8578, 156, 157, 'YRAAAA', 'EUIAAA', 'AAAAxx'),
+(3235, 5933, 1, 3, 5, 15, 35, 235, 1235, 3235, 3235, 70, 71, 'LUAAAA', 'FUIAAA', 'HHHHxx'),
+(963, 5934, 1, 3, 3, 3, 63, 963, 963, 963, 963, 126, 127, 'BLAAAA', 'GUIAAA', 'OOOOxx'),
+(113, 5935, 1, 1, 3, 13, 13, 113, 113, 113, 113, 26, 27, 'JEAAAA', 'HUIAAA', 'VVVVxx'),
+(8234, 5936, 0, 2, 4, 14, 34, 234, 234, 3234, 8234, 68, 69, 'SEAAAA', 'IUIAAA', 'AAAAxx'),
+(2613, 5937, 1, 1, 3, 13, 13, 613, 613, 2613, 2613, 26, 27, 'NWAAAA', 'JUIAAA', 'HHHHxx'),
+(5540, 5938, 0, 0, 0, 0, 40, 540, 1540, 540, 5540, 80, 81, 'CFAAAA', 'KUIAAA', 'OOOOxx'),
+(9727, 5939, 1, 3, 7, 7, 27, 727, 1727, 4727, 9727, 54, 55, 'DKAAAA', 'LUIAAA', 'VVVVxx'),
+(2229, 5940, 1, 1, 9, 9, 29, 229, 229, 2229, 2229, 58, 59, 'THAAAA', 'MUIAAA', 'AAAAxx'),
+(6242, 5941, 0, 2, 2, 2, 42, 242, 242, 1242, 6242, 84, 85, 'CGAAAA', 'NUIAAA', 'HHHHxx'),
+(2502, 5942, 0, 2, 2, 2, 2, 502, 502, 2502, 2502, 4, 5, 'GSAAAA', 'OUIAAA', 'OOOOxx'),
+(6212, 5943, 0, 0, 2, 12, 12, 212, 212, 1212, 6212, 24, 25, 'YEAAAA', 'PUIAAA', 'VVVVxx'),
+(3495, 5944, 1, 3, 5, 15, 95, 495, 1495, 3495, 3495, 190, 191, 'LEAAAA', 'QUIAAA', 'AAAAxx'),
+(2364, 5945, 0, 0, 4, 4, 64, 364, 364, 2364, 2364, 128, 129, 'YMAAAA', 'RUIAAA', 'HHHHxx'),
+(6777, 5946, 1, 1, 7, 17, 77, 777, 777, 1777, 6777, 154, 155, 'RAAAAA', 'SUIAAA', 'OOOOxx'),
+(9811, 5947, 1, 3, 1, 11, 11, 811, 1811, 4811, 9811, 22, 23, 'JNAAAA', 'TUIAAA', 'VVVVxx'),
+(1450, 5948, 0, 2, 0, 10, 50, 450, 1450, 1450, 1450, 100, 101, 'UDAAAA', 'UUIAAA', 'AAAAxx'),
+(5008, 5949, 0, 0, 8, 8, 8, 8, 1008, 8, 5008, 16, 17, 'QKAAAA', 'VUIAAA', 'HHHHxx'),
+(1318, 5950, 0, 2, 8, 18, 18, 318, 1318, 1318, 1318, 36, 37, 'SYAAAA', 'WUIAAA', 'OOOOxx'),
+(3373, 5951, 1, 1, 3, 13, 73, 373, 1373, 3373, 3373, 146, 147, 'TZAAAA', 'XUIAAA', 'VVVVxx'),
+(398, 5952, 0, 2, 8, 18, 98, 398, 398, 398, 398, 196, 197, 'IPAAAA', 'YUIAAA', 'AAAAxx'),
+(3804, 5953, 0, 0, 4, 4, 4, 804, 1804, 3804, 3804, 8, 9, 'IQAAAA', 'ZUIAAA', 'HHHHxx'),
+(9148, 5954, 0, 0, 8, 8, 48, 148, 1148, 4148, 9148, 96, 97, 'WNAAAA', 'AVIAAA', 'OOOOxx'),
+(4382, 5955, 0, 2, 2, 2, 82, 382, 382, 4382, 4382, 164, 165, 'OMAAAA', 'BVIAAA', 'VVVVxx'),
+(4026, 5956, 0, 2, 6, 6, 26, 26, 26, 4026, 4026, 52, 53, 'WYAAAA', 'CVIAAA', 'AAAAxx'),
+(7804, 5957, 0, 0, 4, 4, 4, 804, 1804, 2804, 7804, 8, 9, 'EOAAAA', 'DVIAAA', 'HHHHxx'),
+(6839, 5958, 1, 3, 9, 19, 39, 839, 839, 1839, 6839, 78, 79, 'BDAAAA', 'EVIAAA', 'OOOOxx'),
+(3756, 5959, 0, 0, 6, 16, 56, 756, 1756, 3756, 3756, 112, 113, 'MOAAAA', 'FVIAAA', 'VVVVxx'),
+(6734, 5960, 0, 2, 4, 14, 34, 734, 734, 1734, 6734, 68, 69, 'AZAAAA', 'GVIAAA', 'AAAAxx'),
+(2228, 5961, 0, 0, 8, 8, 28, 228, 228, 2228, 2228, 56, 57, 'SHAAAA', 'HVIAAA', 'HHHHxx'),
+(3273, 5962, 1, 1, 3, 13, 73, 273, 1273, 3273, 3273, 146, 147, 'XVAAAA', 'IVIAAA', 'OOOOxx'),
+(3708, 5963, 0, 0, 8, 8, 8, 708, 1708, 3708, 3708, 16, 17, 'QMAAAA', 'JVIAAA', 'VVVVxx'),
+(4320, 5964, 0, 0, 0, 0, 20, 320, 320, 4320, 4320, 40, 41, 'EKAAAA', 'KVIAAA', 'AAAAxx'),
+(74, 5965, 0, 2, 4, 14, 74, 74, 74, 74, 74, 148, 149, 'WCAAAA', 'LVIAAA', 'HHHHxx'),
+(2520, 5966, 0, 0, 0, 0, 20, 520, 520, 2520, 2520, 40, 41, 'YSAAAA', 'MVIAAA', 'OOOOxx'),
+(9619, 5967, 1, 3, 9, 19, 19, 619, 1619, 4619, 9619, 38, 39, 'ZFAAAA', 'NVIAAA', 'VVVVxx'),
+(1801, 5968, 1, 1, 1, 1, 1, 801, 1801, 1801, 1801, 2, 3, 'HRAAAA', 'OVIAAA', 'AAAAxx'),
+(6399, 5969, 1, 3, 9, 19, 99, 399, 399, 1399, 6399, 198, 199, 'DMAAAA', 'PVIAAA', 'HHHHxx'),
+(8313, 5970, 1, 1, 3, 13, 13, 313, 313, 3313, 8313, 26, 27, 'THAAAA', 'QVIAAA', 'OOOOxx'),
+(7003, 5971, 1, 3, 3, 3, 3, 3, 1003, 2003, 7003, 6, 7, 'JJAAAA', 'RVIAAA', 'VVVVxx'),
+(329, 5972, 1, 1, 9, 9, 29, 329, 329, 329, 329, 58, 59, 'RMAAAA', 'SVIAAA', 'AAAAxx'),
+(9090, 5973, 0, 2, 0, 10, 90, 90, 1090, 4090, 9090, 180, 181, 'QLAAAA', 'TVIAAA', 'HHHHxx'),
+(2299, 5974, 1, 3, 9, 19, 99, 299, 299, 2299, 2299, 198, 199, 'LKAAAA', 'UVIAAA', 'OOOOxx'),
+(3925, 5975, 1, 1, 5, 5, 25, 925, 1925, 3925, 3925, 50, 51, 'ZUAAAA', 'VVIAAA', 'VVVVxx'),
+(8145, 5976, 1, 1, 5, 5, 45, 145, 145, 3145, 8145, 90, 91, 'HBAAAA', 'WVIAAA', 'AAAAxx'),
+(8561, 5977, 1, 1, 1, 1, 61, 561, 561, 3561, 8561, 122, 123, 'HRAAAA', 'XVIAAA', 'HHHHxx'),
+(2797, 5978, 1, 1, 7, 17, 97, 797, 797, 2797, 2797, 194, 195, 'PDAAAA', 'YVIAAA', 'OOOOxx'),
+(1451, 5979, 1, 3, 1, 11, 51, 451, 1451, 1451, 1451, 102, 103, 'VDAAAA', 'ZVIAAA', 'VVVVxx'),
+(7977, 5980, 1, 1, 7, 17, 77, 977, 1977, 2977, 7977, 154, 155, 'VUAAAA', 'AWIAAA', 'AAAAxx'),
+(112, 5981, 0, 0, 2, 12, 12, 112, 112, 112, 112, 24, 25, 'IEAAAA', 'BWIAAA', 'HHHHxx'),
+(5265, 5982, 1, 1, 5, 5, 65, 265, 1265, 265, 5265, 130, 131, 'NUAAAA', 'CWIAAA', 'OOOOxx'),
+(3819, 5983, 1, 3, 9, 19, 19, 819, 1819, 3819, 3819, 38, 39, 'XQAAAA', 'DWIAAA', 'VVVVxx'),
+(3648, 5984, 0, 0, 8, 8, 48, 648, 1648, 3648, 3648, 96, 97, 'IKAAAA', 'EWIAAA', 'AAAAxx'),
+(6306, 5985, 0, 2, 6, 6, 6, 306, 306, 1306, 6306, 12, 13, 'OIAAAA', 'FWIAAA', 'HHHHxx'),
+(2385, 5986, 1, 1, 5, 5, 85, 385, 385, 2385, 2385, 170, 171, 'TNAAAA', 'GWIAAA', 'OOOOxx'),
+(9084, 5987, 0, 0, 4, 4, 84, 84, 1084, 4084, 9084, 168, 169, 'KLAAAA', 'HWIAAA', 'VVVVxx'),
+(4499, 5988, 1, 3, 9, 19, 99, 499, 499, 4499, 4499, 198, 199, 'BRAAAA', 'IWIAAA', 'AAAAxx'),
+(1154, 5989, 0, 2, 4, 14, 54, 154, 1154, 1154, 1154, 108, 109, 'KSAAAA', 'JWIAAA', 'HHHHxx'),
+(6800, 5990, 0, 0, 0, 0, 0, 800, 800, 1800, 6800, 0, 1, 'OBAAAA', 'KWIAAA', 'OOOOxx'),
+(8049, 5991, 1, 1, 9, 9, 49, 49, 49, 3049, 8049, 98, 99, 'PXAAAA', 'LWIAAA', 'VVVVxx'),
+(3733, 5992, 1, 1, 3, 13, 33, 733, 1733, 3733, 3733, 66, 67, 'PNAAAA', 'MWIAAA', 'AAAAxx'),
+(8496, 5993, 0, 0, 6, 16, 96, 496, 496, 3496, 8496, 192, 193, 'UOAAAA', 'NWIAAA', 'HHHHxx'),
+(9952, 5994, 0, 0, 2, 12, 52, 952, 1952, 4952, 9952, 104, 105, 'USAAAA', 'OWIAAA', 'OOOOxx'),
+(9792, 5995, 0, 0, 2, 12, 92, 792, 1792, 4792, 9792, 184, 185, 'QMAAAA', 'PWIAAA', 'VVVVxx'),
+(5081, 5996, 1, 1, 1, 1, 81, 81, 1081, 81, 5081, 162, 163, 'LNAAAA', 'QWIAAA', 'AAAAxx'),
+(7908, 5997, 0, 0, 8, 8, 8, 908, 1908, 2908, 7908, 16, 17, 'ESAAAA', 'RWIAAA', 'HHHHxx'),
+(5398, 5998, 0, 2, 8, 18, 98, 398, 1398, 398, 5398, 196, 197, 'QZAAAA', 'SWIAAA', 'OOOOxx'),
+(8423, 5999, 1, 3, 3, 3, 23, 423, 423, 3423, 8423, 46, 47, 'ZLAAAA', 'TWIAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(3362, 6000, 0, 2, 2, 2, 62, 362, 1362, 3362, 3362, 124, 125, 'IZAAAA', 'UWIAAA', 'AAAAxx'),
+(7767, 6001, 1, 3, 7, 7, 67, 767, 1767, 2767, 7767, 134, 135, 'TMAAAA', 'VWIAAA', 'HHHHxx'),
+(7063, 6002, 1, 3, 3, 3, 63, 63, 1063, 2063, 7063, 126, 127, 'RLAAAA', 'WWIAAA', 'OOOOxx'),
+(8350, 6003, 0, 2, 0, 10, 50, 350, 350, 3350, 8350, 100, 101, 'EJAAAA', 'XWIAAA', 'VVVVxx'),
+(6779, 6004, 1, 3, 9, 19, 79, 779, 779, 1779, 6779, 158, 159, 'TAAAAA', 'YWIAAA', 'AAAAxx'),
+(5742, 6005, 0, 2, 2, 2, 42, 742, 1742, 742, 5742, 84, 85, 'WMAAAA', 'ZWIAAA', 'HHHHxx'),
+(9045, 6006, 1, 1, 5, 5, 45, 45, 1045, 4045, 9045, 90, 91, 'XJAAAA', 'AXIAAA', 'OOOOxx'),
+(8792, 6007, 0, 0, 2, 12, 92, 792, 792, 3792, 8792, 184, 185, 'EAAAAA', 'BXIAAA', 'VVVVxx'),
+(8160, 6008, 0, 0, 0, 0, 60, 160, 160, 3160, 8160, 120, 121, 'WBAAAA', 'CXIAAA', 'AAAAxx'),
+(3061, 6009, 1, 1, 1, 1, 61, 61, 1061, 3061, 3061, 122, 123, 'TNAAAA', 'DXIAAA', 'HHHHxx'),
+(4721, 6010, 1, 1, 1, 1, 21, 721, 721, 4721, 4721, 42, 43, 'PZAAAA', 'EXIAAA', 'OOOOxx'),
+(9817, 6011, 1, 1, 7, 17, 17, 817, 1817, 4817, 9817, 34, 35, 'PNAAAA', 'FXIAAA', 'VVVVxx'),
+(9257, 6012, 1, 1, 7, 17, 57, 257, 1257, 4257, 9257, 114, 115, 'BSAAAA', 'GXIAAA', 'AAAAxx'),
+(7779, 6013, 1, 3, 9, 19, 79, 779, 1779, 2779, 7779, 158, 159, 'FNAAAA', 'HXIAAA', 'HHHHxx'),
+(2663, 6014, 1, 3, 3, 3, 63, 663, 663, 2663, 2663, 126, 127, 'LYAAAA', 'IXIAAA', 'OOOOxx'),
+(3885, 6015, 1, 1, 5, 5, 85, 885, 1885, 3885, 3885, 170, 171, 'LTAAAA', 'JXIAAA', 'VVVVxx'),
+(9469, 6016, 1, 1, 9, 9, 69, 469, 1469, 4469, 9469, 138, 139, 'FAAAAA', 'KXIAAA', 'AAAAxx'),
+(6766, 6017, 0, 2, 6, 6, 66, 766, 766, 1766, 6766, 132, 133, 'GAAAAA', 'LXIAAA', 'HHHHxx'),
+(7173, 6018, 1, 1, 3, 13, 73, 173, 1173, 2173, 7173, 146, 147, 'XPAAAA', 'MXIAAA', 'OOOOxx'),
+(4709, 6019, 1, 1, 9, 9, 9, 709, 709, 4709, 4709, 18, 19, 'DZAAAA', 'NXIAAA', 'VVVVxx'),
+(4210, 6020, 0, 2, 0, 10, 10, 210, 210, 4210, 4210, 20, 21, 'YFAAAA', 'OXIAAA', 'AAAAxx'),
+(3715, 6021, 1, 3, 5, 15, 15, 715, 1715, 3715, 3715, 30, 31, 'XMAAAA', 'PXIAAA', 'HHHHxx'),
+(5089, 6022, 1, 1, 9, 9, 89, 89, 1089, 89, 5089, 178, 179, 'TNAAAA', 'QXIAAA', 'OOOOxx'),
+(1639, 6023, 1, 3, 9, 19, 39, 639, 1639, 1639, 1639, 78, 79, 'BLAAAA', 'RXIAAA', 'VVVVxx'),
+(5757, 6024, 1, 1, 7, 17, 57, 757, 1757, 757, 5757, 114, 115, 'LNAAAA', 'SXIAAA', 'AAAAxx'),
+(3545, 6025, 1, 1, 5, 5, 45, 545, 1545, 3545, 3545, 90, 91, 'JGAAAA', 'TXIAAA', 'HHHHxx'),
+(709, 6026, 1, 1, 9, 9, 9, 709, 709, 709, 709, 18, 19, 'HBAAAA', 'UXIAAA', 'OOOOxx'),
+(6519, 6027, 1, 3, 9, 19, 19, 519, 519, 1519, 6519, 38, 39, 'TQAAAA', 'VXIAAA', 'VVVVxx'),
+(4341, 6028, 1, 1, 1, 1, 41, 341, 341, 4341, 4341, 82, 83, 'ZKAAAA', 'WXIAAA', 'AAAAxx'),
+(2381, 6029, 1, 1, 1, 1, 81, 381, 381, 2381, 2381, 162, 163, 'PNAAAA', 'XXIAAA', 'HHHHxx'),
+(7215, 6030, 1, 3, 5, 15, 15, 215, 1215, 2215, 7215, 30, 31, 'NRAAAA', 'YXIAAA', 'OOOOxx'),
+(9323, 6031, 1, 3, 3, 3, 23, 323, 1323, 4323, 9323, 46, 47, 'PUAAAA', 'ZXIAAA', 'VVVVxx'),
+(3593, 6032, 1, 1, 3, 13, 93, 593, 1593, 3593, 3593, 186, 187, 'FIAAAA', 'AYIAAA', 'AAAAxx'),
+(3123, 6033, 1, 3, 3, 3, 23, 123, 1123, 3123, 3123, 46, 47, 'DQAAAA', 'BYIAAA', 'HHHHxx'),
+(8673, 6034, 1, 1, 3, 13, 73, 673, 673, 3673, 8673, 146, 147, 'PVAAAA', 'CYIAAA', 'OOOOxx'),
+(5094, 6035, 0, 2, 4, 14, 94, 94, 1094, 94, 5094, 188, 189, 'YNAAAA', 'DYIAAA', 'VVVVxx'),
+(6477, 6036, 1, 1, 7, 17, 77, 477, 477, 1477, 6477, 154, 155, 'DPAAAA', 'EYIAAA', 'AAAAxx'),
+(9734, 6037, 0, 2, 4, 14, 34, 734, 1734, 4734, 9734, 68, 69, 'KKAAAA', 'FYIAAA', 'HHHHxx'),
+(2998, 6038, 0, 2, 8, 18, 98, 998, 998, 2998, 2998, 196, 197, 'ILAAAA', 'GYIAAA', 'OOOOxx'),
+(7807, 6039, 1, 3, 7, 7, 7, 807, 1807, 2807, 7807, 14, 15, 'HOAAAA', 'HYIAAA', 'VVVVxx'),
+(5739, 6040, 1, 3, 9, 19, 39, 739, 1739, 739, 5739, 78, 79, 'TMAAAA', 'IYIAAA', 'AAAAxx'),
+(138, 6041, 0, 2, 8, 18, 38, 138, 138, 138, 138, 76, 77, 'IFAAAA', 'JYIAAA', 'HHHHxx'),
+(2403, 6042, 1, 3, 3, 3, 3, 403, 403, 2403, 2403, 6, 7, 'LOAAAA', 'KYIAAA', 'OOOOxx'),
+(2484, 6043, 0, 0, 4, 4, 84, 484, 484, 2484, 2484, 168, 169, 'ORAAAA', 'LYIAAA', 'VVVVxx'),
+(2805, 6044, 1, 1, 5, 5, 5, 805, 805, 2805, 2805, 10, 11, 'XDAAAA', 'MYIAAA', 'AAAAxx'),
+(5189, 6045, 1, 1, 9, 9, 89, 189, 1189, 189, 5189, 178, 179, 'PRAAAA', 'NYIAAA', 'HHHHxx'),
+(8336, 6046, 0, 0, 6, 16, 36, 336, 336, 3336, 8336, 72, 73, 'QIAAAA', 'OYIAAA', 'OOOOxx'),
+(5241, 6047, 1, 1, 1, 1, 41, 241, 1241, 241, 5241, 82, 83, 'PTAAAA', 'PYIAAA', 'VVVVxx'),
+(2612, 6048, 0, 0, 2, 12, 12, 612, 612, 2612, 2612, 24, 25, 'MWAAAA', 'QYIAAA', 'AAAAxx'),
+(2571, 6049, 1, 3, 1, 11, 71, 571, 571, 2571, 2571, 142, 143, 'XUAAAA', 'RYIAAA', 'HHHHxx'),
+(926, 6050, 0, 2, 6, 6, 26, 926, 926, 926, 926, 52, 53, 'QJAAAA', 'SYIAAA', 'OOOOxx'),
+(337, 6051, 1, 1, 7, 17, 37, 337, 337, 337, 337, 74, 75, 'ZMAAAA', 'TYIAAA', 'VVVVxx'),
+(2821, 6052, 1, 1, 1, 1, 21, 821, 821, 2821, 2821, 42, 43, 'NEAAAA', 'UYIAAA', 'AAAAxx'),
+(2658, 6053, 0, 2, 8, 18, 58, 658, 658, 2658, 2658, 116, 117, 'GYAAAA', 'VYIAAA', 'HHHHxx'),
+(9054, 6054, 0, 2, 4, 14, 54, 54, 1054, 4054, 9054, 108, 109, 'GKAAAA', 'WYIAAA', 'OOOOxx'),
+(5492, 6055, 0, 0, 2, 12, 92, 492, 1492, 492, 5492, 184, 185, 'GDAAAA', 'XYIAAA', 'VVVVxx'),
+(7313, 6056, 1, 1, 3, 13, 13, 313, 1313, 2313, 7313, 26, 27, 'HVAAAA', 'YYIAAA', 'AAAAxx'),
+(75, 6057, 1, 3, 5, 15, 75, 75, 75, 75, 75, 150, 151, 'XCAAAA', 'ZYIAAA', 'HHHHxx'),
+(5489, 6058, 1, 1, 9, 9, 89, 489, 1489, 489, 5489, 178, 179, 'DDAAAA', 'AZIAAA', 'OOOOxx'),
+(8413, 6059, 1, 1, 3, 13, 13, 413, 413, 3413, 8413, 26, 27, 'PLAAAA', 'BZIAAA', 'VVVVxx'),
+(3693, 6060, 1, 1, 3, 13, 93, 693, 1693, 3693, 3693, 186, 187, 'BMAAAA', 'CZIAAA', 'AAAAxx'),
+(9820, 6061, 0, 0, 0, 0, 20, 820, 1820, 4820, 9820, 40, 41, 'SNAAAA', 'DZIAAA', 'HHHHxx'),
+(8157, 6062, 1, 1, 7, 17, 57, 157, 157, 3157, 8157, 114, 115, 'TBAAAA', 'EZIAAA', 'OOOOxx'),
+(4161, 6063, 1, 1, 1, 1, 61, 161, 161, 4161, 4161, 122, 123, 'BEAAAA', 'FZIAAA', 'VVVVxx'),
+(8339, 6064, 1, 3, 9, 19, 39, 339, 339, 3339, 8339, 78, 79, 'TIAAAA', 'GZIAAA', 'AAAAxx'),
+(4141, 6065, 1, 1, 1, 1, 41, 141, 141, 4141, 4141, 82, 83, 'HDAAAA', 'HZIAAA', 'HHHHxx'),
+(9001, 6066, 1, 1, 1, 1, 1, 1, 1001, 4001, 9001, 2, 3, 'FIAAAA', 'IZIAAA', 'OOOOxx'),
+(8247, 6067, 1, 3, 7, 7, 47, 247, 247, 3247, 8247, 94, 95, 'FFAAAA', 'JZIAAA', 'VVVVxx'),
+(1182, 6068, 0, 2, 2, 2, 82, 182, 1182, 1182, 1182, 164, 165, 'MTAAAA', 'KZIAAA', 'AAAAxx'),
+(9876, 6069, 0, 0, 6, 16, 76, 876, 1876, 4876, 9876, 152, 153, 'WPAAAA', 'LZIAAA', 'HHHHxx'),
+(4302, 6070, 0, 2, 2, 2, 2, 302, 302, 4302, 4302, 4, 5, 'MJAAAA', 'MZIAAA', 'OOOOxx'),
+(6674, 6071, 0, 2, 4, 14, 74, 674, 674, 1674, 6674, 148, 149, 'SWAAAA', 'NZIAAA', 'VVVVxx'),
+(4214, 6072, 0, 2, 4, 14, 14, 214, 214, 4214, 4214, 28, 29, 'CGAAAA', 'OZIAAA', 'AAAAxx'),
+(5584, 6073, 0, 0, 4, 4, 84, 584, 1584, 584, 5584, 168, 169, 'UGAAAA', 'PZIAAA', 'HHHHxx'),
+(265, 6074, 1, 1, 5, 5, 65, 265, 265, 265, 265, 130, 131, 'FKAAAA', 'QZIAAA', 'OOOOxx'),
+(9207, 6075, 1, 3, 7, 7, 7, 207, 1207, 4207, 9207, 14, 15, 'DQAAAA', 'RZIAAA', 'VVVVxx'),
+(9434, 6076, 0, 2, 4, 14, 34, 434, 1434, 4434, 9434, 68, 69, 'WYAAAA', 'SZIAAA', 'AAAAxx'),
+(2921, 6077, 1, 1, 1, 1, 21, 921, 921, 2921, 2921, 42, 43, 'JIAAAA', 'TZIAAA', 'HHHHxx'),
+(9355, 6078, 1, 3, 5, 15, 55, 355, 1355, 4355, 9355, 110, 111, 'VVAAAA', 'UZIAAA', 'OOOOxx'),
+(8538, 6079, 0, 2, 8, 18, 38, 538, 538, 3538, 8538, 76, 77, 'KQAAAA', 'VZIAAA', 'VVVVxx'),
+(4559, 6080, 1, 3, 9, 19, 59, 559, 559, 4559, 4559, 118, 119, 'JTAAAA', 'WZIAAA', 'AAAAxx'),
+(9175, 6081, 1, 3, 5, 15, 75, 175, 1175, 4175, 9175, 150, 151, 'XOAAAA', 'XZIAAA', 'HHHHxx'),
+(4489, 6082, 1, 1, 9, 9, 89, 489, 489, 4489, 4489, 178, 179, 'RQAAAA', 'YZIAAA', 'OOOOxx'),
+(1485, 6083, 1, 1, 5, 5, 85, 485, 1485, 1485, 1485, 170, 171, 'DFAAAA', 'ZZIAAA', 'VVVVxx'),
+(8853, 6084, 1, 1, 3, 13, 53, 853, 853, 3853, 8853, 106, 107, 'NCAAAA', 'AAJAAA', 'AAAAxx'),
+(9143, 6085, 1, 3, 3, 3, 43, 143, 1143, 4143, 9143, 86, 87, 'RNAAAA', 'BAJAAA', 'HHHHxx'),
+(9551, 6086, 1, 3, 1, 11, 51, 551, 1551, 4551, 9551, 102, 103, 'JDAAAA', 'CAJAAA', 'OOOOxx'),
+(49, 6087, 1, 1, 9, 9, 49, 49, 49, 49, 49, 98, 99, 'XBAAAA', 'DAJAAA', 'VVVVxx'),
+(8351, 6088, 1, 3, 1, 11, 51, 351, 351, 3351, 8351, 102, 103, 'FJAAAA', 'EAJAAA', 'AAAAxx'),
+(9748, 6089, 0, 0, 8, 8, 48, 748, 1748, 4748, 9748, 96, 97, 'YKAAAA', 'FAJAAA', 'HHHHxx'),
+(4536, 6090, 0, 0, 6, 16, 36, 536, 536, 4536, 4536, 72, 73, 'MSAAAA', 'GAJAAA', 'OOOOxx'),
+(930, 6091, 0, 2, 0, 10, 30, 930, 930, 930, 930, 60, 61, 'UJAAAA', 'HAJAAA', 'VVVVxx'),
+(2206, 6092, 0, 2, 6, 6, 6, 206, 206, 2206, 2206, 12, 13, 'WGAAAA', 'IAJAAA', 'AAAAxx'),
+(8004, 6093, 0, 0, 4, 4, 4, 4, 4, 3004, 8004, 8, 9, 'WVAAAA', 'JAJAAA', 'HHHHxx'),
+(219, 6094, 1, 3, 9, 19, 19, 219, 219, 219, 219, 38, 39, 'LIAAAA', 'KAJAAA', 'OOOOxx'),
+(2724, 6095, 0, 0, 4, 4, 24, 724, 724, 2724, 2724, 48, 49, 'UAAAAA', 'LAJAAA', 'VVVVxx'),
+(4868, 6096, 0, 0, 8, 8, 68, 868, 868, 4868, 4868, 136, 137, 'GFAAAA', 'MAJAAA', 'AAAAxx'),
+(5952, 6097, 0, 0, 2, 12, 52, 952, 1952, 952, 5952, 104, 105, 'YUAAAA', 'NAJAAA', 'HHHHxx'),
+(2094, 6098, 0, 2, 4, 14, 94, 94, 94, 2094, 2094, 188, 189, 'OCAAAA', 'OAJAAA', 'OOOOxx'),
+(5707, 6099, 1, 3, 7, 7, 7, 707, 1707, 707, 5707, 14, 15, 'NLAAAA', 'PAJAAA', 'VVVVxx'),
+(5200, 6100, 0, 0, 0, 0, 0, 200, 1200, 200, 5200, 0, 1, 'ASAAAA', 'QAJAAA', 'AAAAxx'),
+(967, 6101, 1, 3, 7, 7, 67, 967, 967, 967, 967, 134, 135, 'FLAAAA', 'RAJAAA', 'HHHHxx'),
+(1982, 6102, 0, 2, 2, 2, 82, 982, 1982, 1982, 1982, 164, 165, 'GYAAAA', 'SAJAAA', 'OOOOxx'),
+(3410, 6103, 0, 2, 0, 10, 10, 410, 1410, 3410, 3410, 20, 21, 'EBAAAA', 'TAJAAA', 'VVVVxx'),
+(174, 6104, 0, 2, 4, 14, 74, 174, 174, 174, 174, 148, 149, 'SGAAAA', 'UAJAAA', 'AAAAxx'),
+(9217, 6105, 1, 1, 7, 17, 17, 217, 1217, 4217, 9217, 34, 35, 'NQAAAA', 'VAJAAA', 'HHHHxx'),
+(9103, 6106, 1, 3, 3, 3, 3, 103, 1103, 4103, 9103, 6, 7, 'DMAAAA', 'WAJAAA', 'OOOOxx'),
+(868, 6107, 0, 0, 8, 8, 68, 868, 868, 868, 868, 136, 137, 'KHAAAA', 'XAJAAA', 'VVVVxx'),
+(8261, 6108, 1, 1, 1, 1, 61, 261, 261, 3261, 8261, 122, 123, 'TFAAAA', 'YAJAAA', 'AAAAxx'),
+(2720, 6109, 0, 0, 0, 0, 20, 720, 720, 2720, 2720, 40, 41, 'QAAAAA', 'ZAJAAA', 'HHHHxx'),
+(2999, 6110, 1, 3, 9, 19, 99, 999, 999, 2999, 2999, 198, 199, 'JLAAAA', 'ABJAAA', 'OOOOxx'),
+(769, 6111, 1, 1, 9, 9, 69, 769, 769, 769, 769, 138, 139, 'PDAAAA', 'BBJAAA', 'VVVVxx'),
+(4533, 6112, 1, 1, 3, 13, 33, 533, 533, 4533, 4533, 66, 67, 'JSAAAA', 'CBJAAA', 'AAAAxx'),
+(2030, 6113, 0, 2, 0, 10, 30, 30, 30, 2030, 2030, 60, 61, 'CAAAAA', 'DBJAAA', 'HHHHxx'),
+(5824, 6114, 0, 0, 4, 4, 24, 824, 1824, 824, 5824, 48, 49, 'AQAAAA', 'EBJAAA', 'OOOOxx'),
+(2328, 6115, 0, 0, 8, 8, 28, 328, 328, 2328, 2328, 56, 57, 'OLAAAA', 'FBJAAA', 'VVVVxx'),
+(9970, 6116, 0, 2, 0, 10, 70, 970, 1970, 4970, 9970, 140, 141, 'MTAAAA', 'GBJAAA', 'AAAAxx'),
+(3192, 6117, 0, 0, 2, 12, 92, 192, 1192, 3192, 3192, 184, 185, 'USAAAA', 'HBJAAA', 'HHHHxx'),
+(3387, 6118, 1, 3, 7, 7, 87, 387, 1387, 3387, 3387, 174, 175, 'HAAAAA', 'IBJAAA', 'OOOOxx'),
+(1936, 6119, 0, 0, 6, 16, 36, 936, 1936, 1936, 1936, 72, 73, 'MWAAAA', 'JBJAAA', 'VVVVxx'),
+(6934, 6120, 0, 2, 4, 14, 34, 934, 934, 1934, 6934, 68, 69, 'SGAAAA', 'KBJAAA', 'AAAAxx'),
+(5615, 6121, 1, 3, 5, 15, 15, 615, 1615, 615, 5615, 30, 31, 'ZHAAAA', 'LBJAAA', 'HHHHxx'),
+(2241, 6122, 1, 1, 1, 1, 41, 241, 241, 2241, 2241, 82, 83, 'FIAAAA', 'MBJAAA', 'OOOOxx'),
+(1842, 6123, 0, 2, 2, 2, 42, 842, 1842, 1842, 1842, 84, 85, 'WSAAAA', 'NBJAAA', 'VVVVxx'),
+(8044, 6124, 0, 0, 4, 4, 44, 44, 44, 3044, 8044, 88, 89, 'KXAAAA', 'OBJAAA', 'AAAAxx'),
+(8902, 6125, 0, 2, 2, 2, 2, 902, 902, 3902, 8902, 4, 5, 'KEAAAA', 'PBJAAA', 'HHHHxx'),
+(4519, 6126, 1, 3, 9, 19, 19, 519, 519, 4519, 4519, 38, 39, 'VRAAAA', 'QBJAAA', 'OOOOxx'),
+(492, 6127, 0, 0, 2, 12, 92, 492, 492, 492, 492, 184, 185, 'YSAAAA', 'RBJAAA', 'VVVVxx'),
+(2694, 6128, 0, 2, 4, 14, 94, 694, 694, 2694, 2694, 188, 189, 'QZAAAA', 'SBJAAA', 'AAAAxx'),
+(5861, 6129, 1, 1, 1, 1, 61, 861, 1861, 861, 5861, 122, 123, 'LRAAAA', 'TBJAAA', 'HHHHxx'),
+(2104, 6130, 0, 0, 4, 4, 4, 104, 104, 2104, 2104, 8, 9, 'YCAAAA', 'UBJAAA', 'OOOOxx'),
+(5376, 6131, 0, 0, 6, 16, 76, 376, 1376, 376, 5376, 152, 153, 'UYAAAA', 'VBJAAA', 'VVVVxx'),
+(3147, 6132, 1, 3, 7, 7, 47, 147, 1147, 3147, 3147, 94, 95, 'BRAAAA', 'WBJAAA', 'AAAAxx'),
+(9880, 6133, 0, 0, 0, 0, 80, 880, 1880, 4880, 9880, 160, 161, 'AQAAAA', 'XBJAAA', 'HHHHxx'),
+(6171, 6134, 1, 3, 1, 11, 71, 171, 171, 1171, 6171, 142, 143, 'JDAAAA', 'YBJAAA', 'OOOOxx'),
+(1850, 6135, 0, 2, 0, 10, 50, 850, 1850, 1850, 1850, 100, 101, 'ETAAAA', 'ZBJAAA', 'VVVVxx'),
+(1775, 6136, 1, 3, 5, 15, 75, 775, 1775, 1775, 1775, 150, 151, 'HQAAAA', 'ACJAAA', 'AAAAxx'),
+(9261, 6137, 1, 1, 1, 1, 61, 261, 1261, 4261, 9261, 122, 123, 'FSAAAA', 'BCJAAA', 'HHHHxx'),
+(9648, 6138, 0, 0, 8, 8, 48, 648, 1648, 4648, 9648, 96, 97, 'CHAAAA', 'CCJAAA', 'OOOOxx'),
+(7846, 6139, 0, 2, 6, 6, 46, 846, 1846, 2846, 7846, 92, 93, 'UPAAAA', 'DCJAAA', 'VVVVxx'),
+(1446, 6140, 0, 2, 6, 6, 46, 446, 1446, 1446, 1446, 92, 93, 'QDAAAA', 'ECJAAA', 'AAAAxx'),
+(3139, 6141, 1, 3, 9, 19, 39, 139, 1139, 3139, 3139, 78, 79, 'TQAAAA', 'FCJAAA', 'HHHHxx'),
+(6142, 6142, 0, 2, 2, 2, 42, 142, 142, 1142, 6142, 84, 85, 'GCAAAA', 'GCJAAA', 'OOOOxx'),
+(5812, 6143, 0, 0, 2, 12, 12, 812, 1812, 812, 5812, 24, 25, 'OPAAAA', 'HCJAAA', 'VVVVxx'),
+(6728, 6144, 0, 0, 8, 8, 28, 728, 728, 1728, 6728, 56, 57, 'UYAAAA', 'ICJAAA', 'AAAAxx'),
+(4428, 6145, 0, 0, 8, 8, 28, 428, 428, 4428, 4428, 56, 57, 'IOAAAA', 'JCJAAA', 'HHHHxx'),
+(502, 6146, 0, 2, 2, 2, 2, 502, 502, 502, 502, 4, 5, 'ITAAAA', 'KCJAAA', 'OOOOxx'),
+(2363, 6147, 1, 3, 3, 3, 63, 363, 363, 2363, 2363, 126, 127, 'XMAAAA', 'LCJAAA', 'VVVVxx'),
+(3808, 6148, 0, 0, 8, 8, 8, 808, 1808, 3808, 3808, 16, 17, 'MQAAAA', 'MCJAAA', 'AAAAxx'),
+(1010, 6149, 0, 2, 0, 10, 10, 10, 1010, 1010, 1010, 20, 21, 'WMAAAA', 'NCJAAA', 'HHHHxx'),
+(9565, 6150, 1, 1, 5, 5, 65, 565, 1565, 4565, 9565, 130, 131, 'XDAAAA', 'OCJAAA', 'OOOOxx'),
+(1587, 6151, 1, 3, 7, 7, 87, 587, 1587, 1587, 1587, 174, 175, 'BJAAAA', 'PCJAAA', 'VVVVxx'),
+(1474, 6152, 0, 2, 4, 14, 74, 474, 1474, 1474, 1474, 148, 149, 'SEAAAA', 'QCJAAA', 'AAAAxx'),
+(6215, 6153, 1, 3, 5, 15, 15, 215, 215, 1215, 6215, 30, 31, 'BFAAAA', 'RCJAAA', 'HHHHxx'),
+(2395, 6154, 1, 3, 5, 15, 95, 395, 395, 2395, 2395, 190, 191, 'DOAAAA', 'SCJAAA', 'OOOOxx'),
+(8753, 6155, 1, 1, 3, 13, 53, 753, 753, 3753, 8753, 106, 107, 'RYAAAA', 'TCJAAA', 'VVVVxx'),
+(2446, 6156, 0, 2, 6, 6, 46, 446, 446, 2446, 2446, 92, 93, 'CQAAAA', 'UCJAAA', 'AAAAxx'),
+(60, 6157, 0, 0, 0, 0, 60, 60, 60, 60, 60, 120, 121, 'ICAAAA', 'VCJAAA', 'HHHHxx'),
+(982, 6158, 0, 2, 2, 2, 82, 982, 982, 982, 982, 164, 165, 'ULAAAA', 'WCJAAA', 'OOOOxx'),
+(6489, 6159, 1, 1, 9, 9, 89, 489, 489, 1489, 6489, 178, 179, 'PPAAAA', 'XCJAAA', 'VVVVxx'),
+(5334, 6160, 0, 2, 4, 14, 34, 334, 1334, 334, 5334, 68, 69, 'EXAAAA', 'YCJAAA', 'AAAAxx'),
+(8540, 6161, 0, 0, 0, 0, 40, 540, 540, 3540, 8540, 80, 81, 'MQAAAA', 'ZCJAAA', 'HHHHxx'),
+(490, 6162, 0, 2, 0, 10, 90, 490, 490, 490, 490, 180, 181, 'WSAAAA', 'ADJAAA', 'OOOOxx'),
+(6763, 6163, 1, 3, 3, 3, 63, 763, 763, 1763, 6763, 126, 127, 'DAAAAA', 'BDJAAA', 'VVVVxx'),
+(8273, 6164, 1, 1, 3, 13, 73, 273, 273, 3273, 8273, 146, 147, 'FGAAAA', 'CDJAAA', 'AAAAxx'),
+(8327, 6165, 1, 3, 7, 7, 27, 327, 327, 3327, 8327, 54, 55, 'HIAAAA', 'DDJAAA', 'HHHHxx'),
+(8541, 6166, 1, 1, 1, 1, 41, 541, 541, 3541, 8541, 82, 83, 'NQAAAA', 'EDJAAA', 'OOOOxx'),
+(3459, 6167, 1, 3, 9, 19, 59, 459, 1459, 3459, 3459, 118, 119, 'BDAAAA', 'FDJAAA', 'VVVVxx'),
+(5557, 6168, 1, 1, 7, 17, 57, 557, 1557, 557, 5557, 114, 115, 'TFAAAA', 'GDJAAA', 'AAAAxx'),
+(158, 6169, 0, 2, 8, 18, 58, 158, 158, 158, 158, 116, 117, 'CGAAAA', 'HDJAAA', 'HHHHxx'),
+(1741, 6170, 1, 1, 1, 1, 41, 741, 1741, 1741, 1741, 82, 83, 'ZOAAAA', 'IDJAAA', 'OOOOxx'),
+(8385, 6171, 1, 1, 5, 5, 85, 385, 385, 3385, 8385, 170, 171, 'NKAAAA', 'JDJAAA', 'VVVVxx'),
+(617, 6172, 1, 1, 7, 17, 17, 617, 617, 617, 617, 34, 35, 'TXAAAA', 'KDJAAA', 'AAAAxx'),
+(3560, 6173, 0, 0, 0, 0, 60, 560, 1560, 3560, 3560, 120, 121, 'YGAAAA', 'LDJAAA', 'HHHHxx'),
+(5216, 6174, 0, 0, 6, 16, 16, 216, 1216, 216, 5216, 32, 33, 'QSAAAA', 'MDJAAA', 'OOOOxx'),
+(8443, 6175, 1, 3, 3, 3, 43, 443, 443, 3443, 8443, 86, 87, 'TMAAAA', 'NDJAAA', 'VVVVxx'),
+(2700, 6176, 0, 0, 0, 0, 0, 700, 700, 2700, 2700, 0, 1, 'WZAAAA', 'ODJAAA', 'AAAAxx'),
+(3661, 6177, 1, 1, 1, 1, 61, 661, 1661, 3661, 3661, 122, 123, 'VKAAAA', 'PDJAAA', 'HHHHxx'),
+(4875, 6178, 1, 3, 5, 15, 75, 875, 875, 4875, 4875, 150, 151, 'NFAAAA', 'QDJAAA', 'OOOOxx'),
+(6721, 6179, 1, 1, 1, 1, 21, 721, 721, 1721, 6721, 42, 43, 'NYAAAA', 'RDJAAA', 'VVVVxx'),
+(3659, 6180, 1, 3, 9, 19, 59, 659, 1659, 3659, 3659, 118, 119, 'TKAAAA', 'SDJAAA', 'AAAAxx'),
+(8944, 6181, 0, 0, 4, 4, 44, 944, 944, 3944, 8944, 88, 89, 'AGAAAA', 'TDJAAA', 'HHHHxx'),
+(9133, 6182, 1, 1, 3, 13, 33, 133, 1133, 4133, 9133, 66, 67, 'HNAAAA', 'UDJAAA', 'OOOOxx'),
+(9882, 6183, 0, 2, 2, 2, 82, 882, 1882, 4882, 9882, 164, 165, 'CQAAAA', 'VDJAAA', 'VVVVxx'),
+(2102, 6184, 0, 2, 2, 2, 2, 102, 102, 2102, 2102, 4, 5, 'WCAAAA', 'WDJAAA', 'AAAAxx'),
+(9445, 6185, 1, 1, 5, 5, 45, 445, 1445, 4445, 9445, 90, 91, 'HZAAAA', 'XDJAAA', 'HHHHxx'),
+(5559, 6186, 1, 3, 9, 19, 59, 559, 1559, 559, 5559, 118, 119, 'VFAAAA', 'YDJAAA', 'OOOOxx'),
+(6096, 6187, 0, 0, 6, 16, 96, 96, 96, 1096, 6096, 192, 193, 'MAAAAA', 'ZDJAAA', 'VVVVxx'),
+(9336, 6188, 0, 0, 6, 16, 36, 336, 1336, 4336, 9336, 72, 73, 'CVAAAA', 'AEJAAA', 'AAAAxx'),
+(2162, 6189, 0, 2, 2, 2, 62, 162, 162, 2162, 2162, 124, 125, 'EFAAAA', 'BEJAAA', 'HHHHxx'),
+(7459, 6190, 1, 3, 9, 19, 59, 459, 1459, 2459, 7459, 118, 119, 'XAAAAA', 'CEJAAA', 'OOOOxx'),
+(3248, 6191, 0, 0, 8, 8, 48, 248, 1248, 3248, 3248, 96, 97, 'YUAAAA', 'DEJAAA', 'VVVVxx'),
+(9539, 6192, 1, 3, 9, 19, 39, 539, 1539, 4539, 9539, 78, 79, 'XCAAAA', 'EEJAAA', 'AAAAxx'),
+(4449, 6193, 1, 1, 9, 9, 49, 449, 449, 4449, 4449, 98, 99, 'DPAAAA', 'FEJAAA', 'HHHHxx'),
+(2809, 6194, 1, 1, 9, 9, 9, 809, 809, 2809, 2809, 18, 19, 'BEAAAA', 'GEJAAA', 'OOOOxx'),
+(7058, 6195, 0, 2, 8, 18, 58, 58, 1058, 2058, 7058, 116, 117, 'MLAAAA', 'HEJAAA', 'VVVVxx'),
+(3512, 6196, 0, 0, 2, 12, 12, 512, 1512, 3512, 3512, 24, 25, 'CFAAAA', 'IEJAAA', 'AAAAxx'),
+(2802, 6197, 0, 2, 2, 2, 2, 802, 802, 2802, 2802, 4, 5, 'UDAAAA', 'JEJAAA', 'HHHHxx'),
+(6289, 6198, 1, 1, 9, 9, 89, 289, 289, 1289, 6289, 178, 179, 'XHAAAA', 'KEJAAA', 'OOOOxx'),
+(1947, 6199, 1, 3, 7, 7, 47, 947, 1947, 1947, 1947, 94, 95, 'XWAAAA', 'LEJAAA', 'VVVVxx'),
+(9572, 6200, 0, 0, 2, 12, 72, 572, 1572, 4572, 9572, 144, 145, 'EEAAAA', 'MEJAAA', 'AAAAxx'),
+(2356, 6201, 0, 0, 6, 16, 56, 356, 356, 2356, 2356, 112, 113, 'QMAAAA', 'NEJAAA', 'HHHHxx'),
+(3039, 6202, 1, 3, 9, 19, 39, 39, 1039, 3039, 3039, 78, 79, 'XMAAAA', 'OEJAAA', 'OOOOxx'),
+(9452, 6203, 0, 0, 2, 12, 52, 452, 1452, 4452, 9452, 104, 105, 'OZAAAA', 'PEJAAA', 'VVVVxx'),
+(6328, 6204, 0, 0, 8, 8, 28, 328, 328, 1328, 6328, 56, 57, 'KJAAAA', 'QEJAAA', 'AAAAxx'),
+(7661, 6205, 1, 1, 1, 1, 61, 661, 1661, 2661, 7661, 122, 123, 'RIAAAA', 'REJAAA', 'HHHHxx'),
+(2566, 6206, 0, 2, 6, 6, 66, 566, 566, 2566, 2566, 132, 133, 'SUAAAA', 'SEJAAA', 'OOOOxx'),
+(6095, 6207, 1, 3, 5, 15, 95, 95, 95, 1095, 6095, 190, 191, 'LAAAAA', 'TEJAAA', 'VVVVxx'),
+(6367, 6208, 1, 3, 7, 7, 67, 367, 367, 1367, 6367, 134, 135, 'XKAAAA', 'UEJAAA', 'AAAAxx'),
+(3368, 6209, 0, 0, 8, 8, 68, 368, 1368, 3368, 3368, 136, 137, 'OZAAAA', 'VEJAAA', 'HHHHxx'),
+(5567, 6210, 1, 3, 7, 7, 67, 567, 1567, 567, 5567, 134, 135, 'DGAAAA', 'WEJAAA', 'OOOOxx'),
+(9834, 6211, 0, 2, 4, 14, 34, 834, 1834, 4834, 9834, 68, 69, 'GOAAAA', 'XEJAAA', 'VVVVxx'),
+(9695, 6212, 1, 3, 5, 15, 95, 695, 1695, 4695, 9695, 190, 191, 'XIAAAA', 'YEJAAA', 'AAAAxx'),
+(7291, 6213, 1, 3, 1, 11, 91, 291, 1291, 2291, 7291, 182, 183, 'LUAAAA', 'ZEJAAA', 'HHHHxx'),
+(4806, 6214, 0, 2, 6, 6, 6, 806, 806, 4806, 4806, 12, 13, 'WCAAAA', 'AFJAAA', 'OOOOxx'),
+(2000, 6215, 0, 0, 0, 0, 0, 0, 0, 2000, 2000, 0, 1, 'YYAAAA', 'BFJAAA', 'VVVVxx'),
+(6817, 6216, 1, 1, 7, 17, 17, 817, 817, 1817, 6817, 34, 35, 'FCAAAA', 'CFJAAA', 'AAAAxx'),
+(8487, 6217, 1, 3, 7, 7, 87, 487, 487, 3487, 8487, 174, 175, 'LOAAAA', 'DFJAAA', 'HHHHxx'),
+(3245, 6218, 1, 1, 5, 5, 45, 245, 1245, 3245, 3245, 90, 91, 'VUAAAA', 'EFJAAA', 'OOOOxx'),
+(632, 6219, 0, 0, 2, 12, 32, 632, 632, 632, 632, 64, 65, 'IYAAAA', 'FFJAAA', 'VVVVxx'),
+(8067, 6220, 1, 3, 7, 7, 67, 67, 67, 3067, 8067, 134, 135, 'HYAAAA', 'GFJAAA', 'AAAAxx'),
+(7140, 6221, 0, 0, 0, 0, 40, 140, 1140, 2140, 7140, 80, 81, 'QOAAAA', 'HFJAAA', 'HHHHxx'),
+(6802, 6222, 0, 2, 2, 2, 2, 802, 802, 1802, 6802, 4, 5, 'QBAAAA', 'IFJAAA', 'OOOOxx'),
+(3980, 6223, 0, 0, 0, 0, 80, 980, 1980, 3980, 3980, 160, 161, 'CXAAAA', 'JFJAAA', 'VVVVxx'),
+(1321, 6224, 1, 1, 1, 1, 21, 321, 1321, 1321, 1321, 42, 43, 'VYAAAA', 'KFJAAA', 'AAAAxx'),
+(2273, 6225, 1, 1, 3, 13, 73, 273, 273, 2273, 2273, 146, 147, 'LJAAAA', 'LFJAAA', 'HHHHxx'),
+(6787, 6226, 1, 3, 7, 7, 87, 787, 787, 1787, 6787, 174, 175, 'BBAAAA', 'MFJAAA', 'OOOOxx'),
+(9480, 6227, 0, 0, 0, 0, 80, 480, 1480, 4480, 9480, 160, 161, 'QAAAAA', 'NFJAAA', 'VVVVxx'),
+(9404, 6228, 0, 0, 4, 4, 4, 404, 1404, 4404, 9404, 8, 9, 'SXAAAA', 'OFJAAA', 'AAAAxx'),
+(3914, 6229, 0, 2, 4, 14, 14, 914, 1914, 3914, 3914, 28, 29, 'OUAAAA', 'PFJAAA', 'HHHHxx'),
+(5507, 6230, 1, 3, 7, 7, 7, 507, 1507, 507, 5507, 14, 15, 'VDAAAA', 'QFJAAA', 'OOOOxx'),
+(1813, 6231, 1, 1, 3, 13, 13, 813, 1813, 1813, 1813, 26, 27, 'TRAAAA', 'RFJAAA', 'VVVVxx'),
+(1999, 6232, 1, 3, 9, 19, 99, 999, 1999, 1999, 1999, 198, 199, 'XYAAAA', 'SFJAAA', 'AAAAxx'),
+(3848, 6233, 0, 0, 8, 8, 48, 848, 1848, 3848, 3848, 96, 97, 'ASAAAA', 'TFJAAA', 'HHHHxx'),
+(9693, 6234, 1, 1, 3, 13, 93, 693, 1693, 4693, 9693, 186, 187, 'VIAAAA', 'UFJAAA', 'OOOOxx'),
+(1353, 6235, 1, 1, 3, 13, 53, 353, 1353, 1353, 1353, 106, 107, 'BAAAAA', 'VFJAAA', 'VVVVxx'),
+(7218, 6236, 0, 2, 8, 18, 18, 218, 1218, 2218, 7218, 36, 37, 'QRAAAA', 'WFJAAA', 'AAAAxx'),
+(8223, 6237, 1, 3, 3, 3, 23, 223, 223, 3223, 8223, 46, 47, 'HEAAAA', 'XFJAAA', 'HHHHxx'),
+(9982, 6238, 0, 2, 2, 2, 82, 982, 1982, 4982, 9982, 164, 165, 'YTAAAA', 'YFJAAA', 'OOOOxx'),
+(8799, 6239, 1, 3, 9, 19, 99, 799, 799, 3799, 8799, 198, 199, 'LAAAAA', 'ZFJAAA', 'VVVVxx'),
+(8929, 6240, 1, 1, 9, 9, 29, 929, 929, 3929, 8929, 58, 59, 'LFAAAA', 'AGJAAA', 'AAAAxx'),
+(4626, 6241, 0, 2, 6, 6, 26, 626, 626, 4626, 4626, 52, 53, 'YVAAAA', 'BGJAAA', 'HHHHxx'),
+(7958, 6242, 0, 2, 8, 18, 58, 958, 1958, 2958, 7958, 116, 117, 'CUAAAA', 'CGJAAA', 'OOOOxx'),
+(3743, 6243, 1, 3, 3, 3, 43, 743, 1743, 3743, 3743, 86, 87, 'ZNAAAA', 'DGJAAA', 'VVVVxx'),
+(8165, 6244, 1, 1, 5, 5, 65, 165, 165, 3165, 8165, 130, 131, 'BCAAAA', 'EGJAAA', 'AAAAxx'),
+(7899, 6245, 1, 3, 9, 19, 99, 899, 1899, 2899, 7899, 198, 199, 'VRAAAA', 'FGJAAA', 'HHHHxx'),
+(8698, 6246, 0, 2, 8, 18, 98, 698, 698, 3698, 8698, 196, 197, 'OWAAAA', 'GGJAAA', 'OOOOxx'),
+(9270, 6247, 0, 2, 0, 10, 70, 270, 1270, 4270, 9270, 140, 141, 'OSAAAA', 'HGJAAA', 'VVVVxx'),
+(6348, 6248, 0, 0, 8, 8, 48, 348, 348, 1348, 6348, 96, 97, 'EKAAAA', 'IGJAAA', 'AAAAxx'),
+(6999, 6249, 1, 3, 9, 19, 99, 999, 999, 1999, 6999, 198, 199, 'FJAAAA', 'JGJAAA', 'HHHHxx'),
+(8467, 6250, 1, 3, 7, 7, 67, 467, 467, 3467, 8467, 134, 135, 'RNAAAA', 'KGJAAA', 'OOOOxx'),
+(3907, 6251, 1, 3, 7, 7, 7, 907, 1907, 3907, 3907, 14, 15, 'HUAAAA', 'LGJAAA', 'VVVVxx'),
+(4738, 6252, 0, 2, 8, 18, 38, 738, 738, 4738, 4738, 76, 77, 'GAAAAA', 'MGJAAA', 'AAAAxx'),
+(248, 6253, 0, 0, 8, 8, 48, 248, 248, 248, 248, 96, 97, 'OJAAAA', 'NGJAAA', 'HHHHxx'),
+(8769, 6254, 1, 1, 9, 9, 69, 769, 769, 3769, 8769, 138, 139, 'HZAAAA', 'OGJAAA', 'OOOOxx'),
+(9922, 6255, 0, 2, 2, 2, 22, 922, 1922, 4922, 9922, 44, 45, 'QRAAAA', 'PGJAAA', 'VVVVxx'),
+(778, 6256, 0, 2, 8, 18, 78, 778, 778, 778, 778, 156, 157, 'YDAAAA', 'QGJAAA', 'AAAAxx'),
+(1233, 6257, 1, 1, 3, 13, 33, 233, 1233, 1233, 1233, 66, 67, 'LVAAAA', 'RGJAAA', 'HHHHxx'),
+(1183, 6258, 1, 3, 3, 3, 83, 183, 1183, 1183, 1183, 166, 167, 'NTAAAA', 'SGJAAA', 'OOOOxx'),
+(2838, 6259, 0, 2, 8, 18, 38, 838, 838, 2838, 2838, 76, 77, 'EFAAAA', 'TGJAAA', 'VVVVxx'),
+(3096, 6260, 0, 0, 6, 16, 96, 96, 1096, 3096, 3096, 192, 193, 'CPAAAA', 'UGJAAA', 'AAAAxx'),
+(8566, 6261, 0, 2, 6, 6, 66, 566, 566, 3566, 8566, 132, 133, 'MRAAAA', 'VGJAAA', 'HHHHxx'),
+(7635, 6262, 1, 3, 5, 15, 35, 635, 1635, 2635, 7635, 70, 71, 'RHAAAA', 'WGJAAA', 'OOOOxx'),
+(5428, 6263, 0, 0, 8, 8, 28, 428, 1428, 428, 5428, 56, 57, 'UAAAAA', 'XGJAAA', 'VVVVxx'),
+(7430, 6264, 0, 2, 0, 10, 30, 430, 1430, 2430, 7430, 60, 61, 'UZAAAA', 'YGJAAA', 'AAAAxx'),
+(7210, 6265, 0, 2, 0, 10, 10, 210, 1210, 2210, 7210, 20, 21, 'IRAAAA', 'ZGJAAA', 'HHHHxx'),
+(4485, 6266, 1, 1, 5, 5, 85, 485, 485, 4485, 4485, 170, 171, 'NQAAAA', 'AHJAAA', 'OOOOxx'),
+(9623, 6267, 1, 3, 3, 3, 23, 623, 1623, 4623, 9623, 46, 47, 'DGAAAA', 'BHJAAA', 'VVVVxx'),
+(3670, 6268, 0, 2, 0, 10, 70, 670, 1670, 3670, 3670, 140, 141, 'ELAAAA', 'CHJAAA', 'AAAAxx'),
+(1575, 6269, 1, 3, 5, 15, 75, 575, 1575, 1575, 1575, 150, 151, 'PIAAAA', 'DHJAAA', 'HHHHxx'),
+(5874, 6270, 0, 2, 4, 14, 74, 874, 1874, 874, 5874, 148, 149, 'YRAAAA', 'EHJAAA', 'OOOOxx'),
+(673, 6271, 1, 1, 3, 13, 73, 673, 673, 673, 673, 146, 147, 'XZAAAA', 'FHJAAA', 'VVVVxx'),
+(9712, 6272, 0, 0, 2, 12, 12, 712, 1712, 4712, 9712, 24, 25, 'OJAAAA', 'GHJAAA', 'AAAAxx'),
+(7729, 6273, 1, 1, 9, 9, 29, 729, 1729, 2729, 7729, 58, 59, 'HLAAAA', 'HHJAAA', 'HHHHxx'),
+(4318, 6274, 0, 2, 8, 18, 18, 318, 318, 4318, 4318, 36, 37, 'CKAAAA', 'IHJAAA', 'OOOOxx'),
+(4143, 6275, 1, 3, 3, 3, 43, 143, 143, 4143, 4143, 86, 87, 'JDAAAA', 'JHJAAA', 'VVVVxx'),
+(4932, 6276, 0, 0, 2, 12, 32, 932, 932, 4932, 4932, 64, 65, 'SHAAAA', 'KHJAAA', 'AAAAxx'),
+(5835, 6277, 1, 3, 5, 15, 35, 835, 1835, 835, 5835, 70, 71, 'LQAAAA', 'LHJAAA', 'HHHHxx'),
+(4966, 6278, 0, 2, 6, 6, 66, 966, 966, 4966, 4966, 132, 133, 'AJAAAA', 'MHJAAA', 'OOOOxx'),
+(6711, 6279, 1, 3, 1, 11, 11, 711, 711, 1711, 6711, 22, 23, 'DYAAAA', 'NHJAAA', 'VVVVxx'),
+(3990, 6280, 0, 2, 0, 10, 90, 990, 1990, 3990, 3990, 180, 181, 'MXAAAA', 'OHJAAA', 'AAAAxx'),
+(990, 6281, 0, 2, 0, 10, 90, 990, 990, 990, 990, 180, 181, 'CMAAAA', 'PHJAAA', 'HHHHxx'),
+(220, 6282, 0, 0, 0, 0, 20, 220, 220, 220, 220, 40, 41, 'MIAAAA', 'QHJAAA', 'OOOOxx'),
+(5693, 6283, 1, 1, 3, 13, 93, 693, 1693, 693, 5693, 186, 187, 'ZKAAAA', 'RHJAAA', 'VVVVxx'),
+(3662, 6284, 0, 2, 2, 2, 62, 662, 1662, 3662, 3662, 124, 125, 'WKAAAA', 'SHJAAA', 'AAAAxx'),
+(7844, 6285, 0, 0, 4, 4, 44, 844, 1844, 2844, 7844, 88, 89, 'SPAAAA', 'THJAAA', 'HHHHxx'),
+(5515, 6286, 1, 3, 5, 15, 15, 515, 1515, 515, 5515, 30, 31, 'DEAAAA', 'UHJAAA', 'OOOOxx'),
+(5551, 6287, 1, 3, 1, 11, 51, 551, 1551, 551, 5551, 102, 103, 'NFAAAA', 'VHJAAA', 'VVVVxx'),
+(2358, 6288, 0, 2, 8, 18, 58, 358, 358, 2358, 2358, 116, 117, 'SMAAAA', 'WHJAAA', 'AAAAxx'),
+(8977, 6289, 1, 1, 7, 17, 77, 977, 977, 3977, 8977, 154, 155, 'HHAAAA', 'XHJAAA', 'HHHHxx'),
+(7040, 6290, 0, 0, 0, 0, 40, 40, 1040, 2040, 7040, 80, 81, 'UKAAAA', 'YHJAAA', 'OOOOxx'),
+(105, 6291, 1, 1, 5, 5, 5, 105, 105, 105, 105, 10, 11, 'BEAAAA', 'ZHJAAA', 'VVVVxx'),
+(4496, 6292, 0, 0, 6, 16, 96, 496, 496, 4496, 4496, 192, 193, 'YQAAAA', 'AIJAAA', 'AAAAxx'),
+(2254, 6293, 0, 2, 4, 14, 54, 254, 254, 2254, 2254, 108, 109, 'SIAAAA', 'BIJAAA', 'HHHHxx'),
+(411, 6294, 1, 3, 1, 11, 11, 411, 411, 411, 411, 22, 23, 'VPAAAA', 'CIJAAA', 'OOOOxx'),
+(2373, 6295, 1, 1, 3, 13, 73, 373, 373, 2373, 2373, 146, 147, 'HNAAAA', 'DIJAAA', 'VVVVxx'),
+(3477, 6296, 1, 1, 7, 17, 77, 477, 1477, 3477, 3477, 154, 155, 'TDAAAA', 'EIJAAA', 'AAAAxx'),
+(8964, 6297, 0, 0, 4, 4, 64, 964, 964, 3964, 8964, 128, 129, 'UGAAAA', 'FIJAAA', 'HHHHxx'),
+(8471, 6298, 1, 3, 1, 11, 71, 471, 471, 3471, 8471, 142, 143, 'VNAAAA', 'GIJAAA', 'OOOOxx'),
+(5776, 6299, 0, 0, 6, 16, 76, 776, 1776, 776, 5776, 152, 153, 'EOAAAA', 'HIJAAA', 'VVVVxx'),
+(9921, 6300, 1, 1, 1, 1, 21, 921, 1921, 4921, 9921, 42, 43, 'PRAAAA', 'IIJAAA', 'AAAAxx'),
+(7816, 6301, 0, 0, 6, 16, 16, 816, 1816, 2816, 7816, 32, 33, 'QOAAAA', 'JIJAAA', 'HHHHxx'),
+(2439, 6302, 1, 3, 9, 19, 39, 439, 439, 2439, 2439, 78, 79, 'VPAAAA', 'KIJAAA', 'OOOOxx'),
+(9298, 6303, 0, 2, 8, 18, 98, 298, 1298, 4298, 9298, 196, 197, 'QTAAAA', 'LIJAAA', 'VVVVxx'),
+(9424, 6304, 0, 0, 4, 4, 24, 424, 1424, 4424, 9424, 48, 49, 'MYAAAA', 'MIJAAA', 'AAAAxx'),
+(3252, 6305, 0, 0, 2, 12, 52, 252, 1252, 3252, 3252, 104, 105, 'CVAAAA', 'NIJAAA', 'HHHHxx'),
+(1401, 6306, 1, 1, 1, 1, 1, 401, 1401, 1401, 1401, 2, 3, 'XBAAAA', 'OIJAAA', 'OOOOxx'),
+(9632, 6307, 0, 0, 2, 12, 32, 632, 1632, 4632, 9632, 64, 65, 'MGAAAA', 'PIJAAA', 'VVVVxx'),
+(370, 6308, 0, 2, 0, 10, 70, 370, 370, 370, 370, 140, 141, 'GOAAAA', 'QIJAAA', 'AAAAxx'),
+(728, 6309, 0, 0, 8, 8, 28, 728, 728, 728, 728, 56, 57, 'ACAAAA', 'RIJAAA', 'HHHHxx'),
+(2888, 6310, 0, 0, 8, 8, 88, 888, 888, 2888, 2888, 176, 177, 'CHAAAA', 'SIJAAA', 'OOOOxx'),
+(1441, 6311, 1, 1, 1, 1, 41, 441, 1441, 1441, 1441, 82, 83, 'LDAAAA', 'TIJAAA', 'VVVVxx'),
+(8308, 6312, 0, 0, 8, 8, 8, 308, 308, 3308, 8308, 16, 17, 'OHAAAA', 'UIJAAA', 'AAAAxx'),
+(2165, 6313, 1, 1, 5, 5, 65, 165, 165, 2165, 2165, 130, 131, 'HFAAAA', 'VIJAAA', 'HHHHxx'),
+(6359, 6314, 1, 3, 9, 19, 59, 359, 359, 1359, 6359, 118, 119, 'PKAAAA', 'WIJAAA', 'OOOOxx'),
+(9637, 6315, 1, 1, 7, 17, 37, 637, 1637, 4637, 9637, 74, 75, 'RGAAAA', 'XIJAAA', 'VVVVxx'),
+(5208, 6316, 0, 0, 8, 8, 8, 208, 1208, 208, 5208, 16, 17, 'ISAAAA', 'YIJAAA', 'AAAAxx'),
+(4705, 6317, 1, 1, 5, 5, 5, 705, 705, 4705, 4705, 10, 11, 'ZYAAAA', 'ZIJAAA', 'HHHHxx'),
+(2341, 6318, 1, 1, 1, 1, 41, 341, 341, 2341, 2341, 82, 83, 'BMAAAA', 'AJJAAA', 'OOOOxx'),
+(8539, 6319, 1, 3, 9, 19, 39, 539, 539, 3539, 8539, 78, 79, 'LQAAAA', 'BJJAAA', 'VVVVxx'),
+(7528, 6320, 0, 0, 8, 8, 28, 528, 1528, 2528, 7528, 56, 57, 'ODAAAA', 'CJJAAA', 'AAAAxx'),
+(7969, 6321, 1, 1, 9, 9, 69, 969, 1969, 2969, 7969, 138, 139, 'NUAAAA', 'DJJAAA', 'HHHHxx'),
+(6381, 6322, 1, 1, 1, 1, 81, 381, 381, 1381, 6381, 162, 163, 'LLAAAA', 'EJJAAA', 'OOOOxx'),
+(4906, 6323, 0, 2, 6, 6, 6, 906, 906, 4906, 4906, 12, 13, 'SGAAAA', 'FJJAAA', 'VVVVxx'),
+(8697, 6324, 1, 1, 7, 17, 97, 697, 697, 3697, 8697, 194, 195, 'NWAAAA', 'GJJAAA', 'AAAAxx'),
+(6301, 6325, 1, 1, 1, 1, 1, 301, 301, 1301, 6301, 2, 3, 'JIAAAA', 'HJJAAA', 'HHHHxx'),
+(7554, 6326, 0, 2, 4, 14, 54, 554, 1554, 2554, 7554, 108, 109, 'OEAAAA', 'IJJAAA', 'OOOOxx'),
+(5107, 6327, 1, 3, 7, 7, 7, 107, 1107, 107, 5107, 14, 15, 'LOAAAA', 'JJJAAA', 'VVVVxx'),
+(5046, 6328, 0, 2, 6, 6, 46, 46, 1046, 46, 5046, 92, 93, 'CMAAAA', 'KJJAAA', 'AAAAxx'),
+(4063, 6329, 1, 3, 3, 3, 63, 63, 63, 4063, 4063, 126, 127, 'HAAAAA', 'LJJAAA', 'HHHHxx'),
+(7580, 6330, 0, 0, 0, 0, 80, 580, 1580, 2580, 7580, 160, 161, 'OFAAAA', 'MJJAAA', 'OOOOxx'),
+(2245, 6331, 1, 1, 5, 5, 45, 245, 245, 2245, 2245, 90, 91, 'JIAAAA', 'NJJAAA', 'VVVVxx'),
+(3711, 6332, 1, 3, 1, 11, 11, 711, 1711, 3711, 3711, 22, 23, 'TMAAAA', 'OJJAAA', 'AAAAxx'),
+(3220, 6333, 0, 0, 0, 0, 20, 220, 1220, 3220, 3220, 40, 41, 'WTAAAA', 'PJJAAA', 'HHHHxx'),
+(6463, 6334, 1, 3, 3, 3, 63, 463, 463, 1463, 6463, 126, 127, 'POAAAA', 'QJJAAA', 'OOOOxx'),
+(8196, 6335, 0, 0, 6, 16, 96, 196, 196, 3196, 8196, 192, 193, 'GDAAAA', 'RJJAAA', 'VVVVxx'),
+(9875, 6336, 1, 3, 5, 15, 75, 875, 1875, 4875, 9875, 150, 151, 'VPAAAA', 'SJJAAA', 'AAAAxx'),
+(1333, 6337, 1, 1, 3, 13, 33, 333, 1333, 1333, 1333, 66, 67, 'HZAAAA', 'TJJAAA', 'HHHHxx'),
+(7880, 6338, 0, 0, 0, 0, 80, 880, 1880, 2880, 7880, 160, 161, 'CRAAAA', 'UJJAAA', 'OOOOxx'),
+(2322, 6339, 0, 2, 2, 2, 22, 322, 322, 2322, 2322, 44, 45, 'ILAAAA', 'VJJAAA', 'VVVVxx'),
+(2163, 6340, 1, 3, 3, 3, 63, 163, 163, 2163, 2163, 126, 127, 'FFAAAA', 'WJJAAA', 'AAAAxx'),
+(421, 6341, 1, 1, 1, 1, 21, 421, 421, 421, 421, 42, 43, 'FQAAAA', 'XJJAAA', 'HHHHxx'),
+(2042, 6342, 0, 2, 2, 2, 42, 42, 42, 2042, 2042, 84, 85, 'OAAAAA', 'YJJAAA', 'OOOOxx'),
+(1424, 6343, 0, 0, 4, 4, 24, 424, 1424, 1424, 1424, 48, 49, 'UCAAAA', 'ZJJAAA', 'VVVVxx'),
+(7870, 6344, 0, 2, 0, 10, 70, 870, 1870, 2870, 7870, 140, 141, 'SQAAAA', 'AKJAAA', 'AAAAxx'),
+(2653, 6345, 1, 1, 3, 13, 53, 653, 653, 2653, 2653, 106, 107, 'BYAAAA', 'BKJAAA', 'HHHHxx'),
+(4216, 6346, 0, 0, 6, 16, 16, 216, 216, 4216, 4216, 32, 33, 'EGAAAA', 'CKJAAA', 'OOOOxx'),
+(1515, 6347, 1, 3, 5, 15, 15, 515, 1515, 1515, 1515, 30, 31, 'HGAAAA', 'DKJAAA', 'VVVVxx'),
+(7860, 6348, 0, 0, 0, 0, 60, 860, 1860, 2860, 7860, 120, 121, 'IQAAAA', 'EKJAAA', 'AAAAxx'),
+(2984, 6349, 0, 0, 4, 4, 84, 984, 984, 2984, 2984, 168, 169, 'UKAAAA', 'FKJAAA', 'HHHHxx'),
+(6269, 6350, 1, 1, 9, 9, 69, 269, 269, 1269, 6269, 138, 139, 'DHAAAA', 'GKJAAA', 'OOOOxx'),
+(2609, 6351, 1, 1, 9, 9, 9, 609, 609, 2609, 2609, 18, 19, 'JWAAAA', 'HKJAAA', 'VVVVxx'),
+(3671, 6352, 1, 3, 1, 11, 71, 671, 1671, 3671, 3671, 142, 143, 'FLAAAA', 'IKJAAA', 'AAAAxx'),
+(4544, 6353, 0, 0, 4, 4, 44, 544, 544, 4544, 4544, 88, 89, 'USAAAA', 'JKJAAA', 'HHHHxx'),
+(4668, 6354, 0, 0, 8, 8, 68, 668, 668, 4668, 4668, 136, 137, 'OXAAAA', 'KKJAAA', 'OOOOxx'),
+(2565, 6355, 1, 1, 5, 5, 65, 565, 565, 2565, 2565, 130, 131, 'RUAAAA', 'LKJAAA', 'VVVVxx'),
+(3126, 6356, 0, 2, 6, 6, 26, 126, 1126, 3126, 3126, 52, 53, 'GQAAAA', 'MKJAAA', 'AAAAxx'),
+(7573, 6357, 1, 1, 3, 13, 73, 573, 1573, 2573, 7573, 146, 147, 'HFAAAA', 'NKJAAA', 'HHHHxx'),
+(1476, 6358, 0, 0, 6, 16, 76, 476, 1476, 1476, 1476, 152, 153, 'UEAAAA', 'OKJAAA', 'OOOOxx'),
+(2146, 6359, 0, 2, 6, 6, 46, 146, 146, 2146, 2146, 92, 93, 'OEAAAA', 'PKJAAA', 'VVVVxx'),
+(9990, 6360, 0, 2, 0, 10, 90, 990, 1990, 4990, 9990, 180, 181, 'GUAAAA', 'QKJAAA', 'AAAAxx'),
+(2530, 6361, 0, 2, 0, 10, 30, 530, 530, 2530, 2530, 60, 61, 'ITAAAA', 'RKJAAA', 'HHHHxx'),
+(9288, 6362, 0, 0, 8, 8, 88, 288, 1288, 4288, 9288, 176, 177, 'GTAAAA', 'SKJAAA', 'OOOOxx'),
+(9755, 6363, 1, 3, 5, 15, 55, 755, 1755, 4755, 9755, 110, 111, 'FLAAAA', 'TKJAAA', 'VVVVxx'),
+(5305, 6364, 1, 1, 5, 5, 5, 305, 1305, 305, 5305, 10, 11, 'BWAAAA', 'UKJAAA', 'AAAAxx'),
+(2495, 6365, 1, 3, 5, 15, 95, 495, 495, 2495, 2495, 190, 191, 'ZRAAAA', 'VKJAAA', 'HHHHxx'),
+(5443, 6366, 1, 3, 3, 3, 43, 443, 1443, 443, 5443, 86, 87, 'JBAAAA', 'WKJAAA', 'OOOOxx'),
+(1930, 6367, 0, 2, 0, 10, 30, 930, 1930, 1930, 1930, 60, 61, 'GWAAAA', 'XKJAAA', 'VVVVxx'),
+(9134, 6368, 0, 2, 4, 14, 34, 134, 1134, 4134, 9134, 68, 69, 'INAAAA', 'YKJAAA', 'AAAAxx'),
+(2844, 6369, 0, 0, 4, 4, 44, 844, 844, 2844, 2844, 88, 89, 'KFAAAA', 'ZKJAAA', 'HHHHxx'),
+(896, 6370, 0, 0, 6, 16, 96, 896, 896, 896, 896, 192, 193, 'MIAAAA', 'ALJAAA', 'OOOOxx'),
+(1330, 6371, 0, 2, 0, 10, 30, 330, 1330, 1330, 1330, 60, 61, 'EZAAAA', 'BLJAAA', 'VVVVxx'),
+(8980, 6372, 0, 0, 0, 0, 80, 980, 980, 3980, 8980, 160, 161, 'KHAAAA', 'CLJAAA', 'AAAAxx'),
+(5940, 6373, 0, 0, 0, 0, 40, 940, 1940, 940, 5940, 80, 81, 'MUAAAA', 'DLJAAA', 'HHHHxx'),
+(6494, 6374, 0, 2, 4, 14, 94, 494, 494, 1494, 6494, 188, 189, 'UPAAAA', 'ELJAAA', 'OOOOxx'),
+(165, 6375, 1, 1, 5, 5, 65, 165, 165, 165, 165, 130, 131, 'JGAAAA', 'FLJAAA', 'VVVVxx'),
+(2510, 6376, 0, 2, 0, 10, 10, 510, 510, 2510, 2510, 20, 21, 'OSAAAA', 'GLJAAA', 'AAAAxx'),
+(9950, 6377, 0, 2, 0, 10, 50, 950, 1950, 4950, 9950, 100, 101, 'SSAAAA', 'HLJAAA', 'HHHHxx'),
+(3854, 6378, 0, 2, 4, 14, 54, 854, 1854, 3854, 3854, 108, 109, 'GSAAAA', 'ILJAAA', 'OOOOxx'),
+(7493, 6379, 1, 1, 3, 13, 93, 493, 1493, 2493, 7493, 186, 187, 'FCAAAA', 'JLJAAA', 'VVVVxx'),
+(4124, 6380, 0, 0, 4, 4, 24, 124, 124, 4124, 4124, 48, 49, 'QCAAAA', 'KLJAAA', 'AAAAxx'),
+(8563, 6381, 1, 3, 3, 3, 63, 563, 563, 3563, 8563, 126, 127, 'JRAAAA', 'LLJAAA', 'HHHHxx'),
+(8735, 6382, 1, 3, 5, 15, 35, 735, 735, 3735, 8735, 70, 71, 'ZXAAAA', 'MLJAAA', 'OOOOxx'),
+(9046, 6383, 0, 2, 6, 6, 46, 46, 1046, 4046, 9046, 92, 93, 'YJAAAA', 'NLJAAA', 'VVVVxx'),
+(1754, 6384, 0, 2, 4, 14, 54, 754, 1754, 1754, 1754, 108, 109, 'MPAAAA', 'OLJAAA', 'AAAAxx'),
+(6954, 6385, 0, 2, 4, 14, 54, 954, 954, 1954, 6954, 108, 109, 'MHAAAA', 'PLJAAA', 'HHHHxx'),
+(4953, 6386, 1, 1, 3, 13, 53, 953, 953, 4953, 4953, 106, 107, 'NIAAAA', 'QLJAAA', 'OOOOxx'),
+(8142, 6387, 0, 2, 2, 2, 42, 142, 142, 3142, 8142, 84, 85, 'EBAAAA', 'RLJAAA', 'VVVVxx'),
+(9661, 6388, 1, 1, 1, 1, 61, 661, 1661, 4661, 9661, 122, 123, 'PHAAAA', 'SLJAAA', 'AAAAxx'),
+(6415, 6389, 1, 3, 5, 15, 15, 415, 415, 1415, 6415, 30, 31, 'TMAAAA', 'TLJAAA', 'HHHHxx'),
+(5782, 6390, 0, 2, 2, 2, 82, 782, 1782, 782, 5782, 164, 165, 'KOAAAA', 'ULJAAA', 'OOOOxx'),
+(7721, 6391, 1, 1, 1, 1, 21, 721, 1721, 2721, 7721, 42, 43, 'ZKAAAA', 'VLJAAA', 'VVVVxx'),
+(580, 6392, 0, 0, 0, 0, 80, 580, 580, 580, 580, 160, 161, 'IWAAAA', 'WLJAAA', 'AAAAxx'),
+(3784, 6393, 0, 0, 4, 4, 84, 784, 1784, 3784, 3784, 168, 169, 'OPAAAA', 'XLJAAA', 'HHHHxx'),
+(9810, 6394, 0, 2, 0, 10, 10, 810, 1810, 4810, 9810, 20, 21, 'INAAAA', 'YLJAAA', 'OOOOxx'),
+(8488, 6395, 0, 0, 8, 8, 88, 488, 488, 3488, 8488, 176, 177, 'MOAAAA', 'ZLJAAA', 'VVVVxx'),
+(6214, 6396, 0, 2, 4, 14, 14, 214, 214, 1214, 6214, 28, 29, 'AFAAAA', 'AMJAAA', 'AAAAxx'),
+(9433, 6397, 1, 1, 3, 13, 33, 433, 1433, 4433, 9433, 66, 67, 'VYAAAA', 'BMJAAA', 'HHHHxx'),
+(9959, 6398, 1, 3, 9, 19, 59, 959, 1959, 4959, 9959, 118, 119, 'BTAAAA', 'CMJAAA', 'OOOOxx'),
+(554, 6399, 0, 2, 4, 14, 54, 554, 554, 554, 554, 108, 109, 'IVAAAA', 'DMJAAA', 'VVVVxx'),
+(6646, 6400, 0, 2, 6, 6, 46, 646, 646, 1646, 6646, 92, 93, 'QVAAAA', 'EMJAAA', 'AAAAxx'),
+(1138, 6401, 0, 2, 8, 18, 38, 138, 1138, 1138, 1138, 76, 77, 'URAAAA', 'FMJAAA', 'HHHHxx'),
+(9331, 6402, 1, 3, 1, 11, 31, 331, 1331, 4331, 9331, 62, 63, 'XUAAAA', 'GMJAAA', 'OOOOxx'),
+(7331, 6403, 1, 3, 1, 11, 31, 331, 1331, 2331, 7331, 62, 63, 'ZVAAAA', 'HMJAAA', 'VVVVxx'),
+(3482, 6404, 0, 2, 2, 2, 82, 482, 1482, 3482, 3482, 164, 165, 'YDAAAA', 'IMJAAA', 'AAAAxx'),
+(3795, 6405, 1, 3, 5, 15, 95, 795, 1795, 3795, 3795, 190, 191, 'ZPAAAA', 'JMJAAA', 'HHHHxx'),
+(2441, 6406, 1, 1, 1, 1, 41, 441, 441, 2441, 2441, 82, 83, 'XPAAAA', 'KMJAAA', 'OOOOxx'),
+(5229, 6407, 1, 1, 9, 9, 29, 229, 1229, 229, 5229, 58, 59, 'DTAAAA', 'LMJAAA', 'VVVVxx'),
+(7012, 6408, 0, 0, 2, 12, 12, 12, 1012, 2012, 7012, 24, 25, 'SJAAAA', 'MMJAAA', 'AAAAxx'),
+(7036, 6409, 0, 0, 6, 16, 36, 36, 1036, 2036, 7036, 72, 73, 'QKAAAA', 'NMJAAA', 'HHHHxx'),
+(8243, 6410, 1, 3, 3, 3, 43, 243, 243, 3243, 8243, 86, 87, 'BFAAAA', 'OMJAAA', 'OOOOxx'),
+(9320, 6411, 0, 0, 0, 0, 20, 320, 1320, 4320, 9320, 40, 41, 'MUAAAA', 'PMJAAA', 'VVVVxx'),
+(4693, 6412, 1, 1, 3, 13, 93, 693, 693, 4693, 4693, 186, 187, 'NYAAAA', 'QMJAAA', 'AAAAxx'),
+(6741, 6413, 1, 1, 1, 1, 41, 741, 741, 1741, 6741, 82, 83, 'HZAAAA', 'RMJAAA', 'HHHHxx'),
+(2997, 6414, 1, 1, 7, 17, 97, 997, 997, 2997, 2997, 194, 195, 'HLAAAA', 'SMJAAA', 'OOOOxx'),
+(4838, 6415, 0, 2, 8, 18, 38, 838, 838, 4838, 4838, 76, 77, 'CEAAAA', 'TMJAAA', 'VVVVxx'),
+(6945, 6416, 1, 1, 5, 5, 45, 945, 945, 1945, 6945, 90, 91, 'DHAAAA', 'UMJAAA', 'AAAAxx'),
+(8253, 6417, 1, 1, 3, 13, 53, 253, 253, 3253, 8253, 106, 107, 'LFAAAA', 'VMJAAA', 'HHHHxx'),
+(8989, 6418, 1, 1, 9, 9, 89, 989, 989, 3989, 8989, 178, 179, 'THAAAA', 'WMJAAA', 'OOOOxx'),
+(2640, 6419, 0, 0, 0, 0, 40, 640, 640, 2640, 2640, 80, 81, 'OXAAAA', 'XMJAAA', 'VVVVxx'),
+(5647, 6420, 1, 3, 7, 7, 47, 647, 1647, 647, 5647, 94, 95, 'FJAAAA', 'YMJAAA', 'AAAAxx'),
+(7186, 6421, 0, 2, 6, 6, 86, 186, 1186, 2186, 7186, 172, 173, 'KQAAAA', 'ZMJAAA', 'HHHHxx'),
+(3278, 6422, 0, 2, 8, 18, 78, 278, 1278, 3278, 3278, 156, 157, 'CWAAAA', 'ANJAAA', 'OOOOxx'),
+(8546, 6423, 0, 2, 6, 6, 46, 546, 546, 3546, 8546, 92, 93, 'SQAAAA', 'BNJAAA', 'VVVVxx'),
+(8297, 6424, 1, 1, 7, 17, 97, 297, 297, 3297, 8297, 194, 195, 'DHAAAA', 'CNJAAA', 'AAAAxx'),
+(9534, 6425, 0, 2, 4, 14, 34, 534, 1534, 4534, 9534, 68, 69, 'SCAAAA', 'DNJAAA', 'HHHHxx'),
+(9618, 6426, 0, 2, 8, 18, 18, 618, 1618, 4618, 9618, 36, 37, 'YFAAAA', 'ENJAAA', 'OOOOxx'),
+(8839, 6427, 1, 3, 9, 19, 39, 839, 839, 3839, 8839, 78, 79, 'ZBAAAA', 'FNJAAA', 'VVVVxx'),
+(7605, 6428, 1, 1, 5, 5, 5, 605, 1605, 2605, 7605, 10, 11, 'NGAAAA', 'GNJAAA', 'AAAAxx'),
+(6421, 6429, 1, 1, 1, 1, 21, 421, 421, 1421, 6421, 42, 43, 'ZMAAAA', 'HNJAAA', 'HHHHxx'),
+(3582, 6430, 0, 2, 2, 2, 82, 582, 1582, 3582, 3582, 164, 165, 'UHAAAA', 'INJAAA', 'OOOOxx'),
+(485, 6431, 1, 1, 5, 5, 85, 485, 485, 485, 485, 170, 171, 'RSAAAA', 'JNJAAA', 'VVVVxx'),
+(1925, 6432, 1, 1, 5, 5, 25, 925, 1925, 1925, 1925, 50, 51, 'BWAAAA', 'KNJAAA', 'AAAAxx'),
+(4296, 6433, 0, 0, 6, 16, 96, 296, 296, 4296, 4296, 192, 193, 'GJAAAA', 'LNJAAA', 'HHHHxx'),
+(8874, 6434, 0, 2, 4, 14, 74, 874, 874, 3874, 8874, 148, 149, 'IDAAAA', 'MNJAAA', 'OOOOxx'),
+(1443, 6435, 1, 3, 3, 3, 43, 443, 1443, 1443, 1443, 86, 87, 'NDAAAA', 'NNJAAA', 'VVVVxx'),
+(4239, 6436, 1, 3, 9, 19, 39, 239, 239, 4239, 4239, 78, 79, 'BHAAAA', 'ONJAAA', 'AAAAxx'),
+(9760, 6437, 0, 0, 0, 0, 60, 760, 1760, 4760, 9760, 120, 121, 'KLAAAA', 'PNJAAA', 'HHHHxx'),
+(136, 6438, 0, 0, 6, 16, 36, 136, 136, 136, 136, 72, 73, 'GFAAAA', 'QNJAAA', 'OOOOxx'),
+(6472, 6439, 0, 0, 2, 12, 72, 472, 472, 1472, 6472, 144, 145, 'YOAAAA', 'RNJAAA', 'VVVVxx'),
+(4896, 6440, 0, 0, 6, 16, 96, 896, 896, 4896, 4896, 192, 193, 'IGAAAA', 'SNJAAA', 'AAAAxx'),
+(9028, 6441, 0, 0, 8, 8, 28, 28, 1028, 4028, 9028, 56, 57, 'GJAAAA', 'TNJAAA', 'HHHHxx'),
+(8354, 6442, 0, 2, 4, 14, 54, 354, 354, 3354, 8354, 108, 109, 'IJAAAA', 'UNJAAA', 'OOOOxx'),
+(8648, 6443, 0, 0, 8, 8, 48, 648, 648, 3648, 8648, 96, 97, 'QUAAAA', 'VNJAAA', 'VVVVxx'),
+(918, 6444, 0, 2, 8, 18, 18, 918, 918, 918, 918, 36, 37, 'IJAAAA', 'WNJAAA', 'AAAAxx'),
+(6606, 6445, 0, 2, 6, 6, 6, 606, 606, 1606, 6606, 12, 13, 'CUAAAA', 'XNJAAA', 'HHHHxx'),
+(2462, 6446, 0, 2, 2, 2, 62, 462, 462, 2462, 2462, 124, 125, 'SQAAAA', 'YNJAAA', 'OOOOxx'),
+(7536, 6447, 0, 0, 6, 16, 36, 536, 1536, 2536, 7536, 72, 73, 'WDAAAA', 'ZNJAAA', 'VVVVxx'),
+(1700, 6448, 0, 0, 0, 0, 0, 700, 1700, 1700, 1700, 0, 1, 'KNAAAA', 'AOJAAA', 'AAAAxx'),
+(6740, 6449, 0, 0, 0, 0, 40, 740, 740, 1740, 6740, 80, 81, 'GZAAAA', 'BOJAAA', 'HHHHxx'),
+(28, 6450, 0, 0, 8, 8, 28, 28, 28, 28, 28, 56, 57, 'CBAAAA', 'COJAAA', 'OOOOxx'),
+(6044, 6451, 0, 0, 4, 4, 44, 44, 44, 1044, 6044, 88, 89, 'MYAAAA', 'DOJAAA', 'VVVVxx'),
+(5053, 6452, 1, 1, 3, 13, 53, 53, 1053, 53, 5053, 106, 107, 'JMAAAA', 'EOJAAA', 'AAAAxx'),
+(4832, 6453, 0, 0, 2, 12, 32, 832, 832, 4832, 4832, 64, 65, 'WDAAAA', 'FOJAAA', 'HHHHxx'),
+(9145, 6454, 1, 1, 5, 5, 45, 145, 1145, 4145, 9145, 90, 91, 'TNAAAA', 'GOJAAA', 'OOOOxx'),
+(5482, 6455, 0, 2, 2, 2, 82, 482, 1482, 482, 5482, 164, 165, 'WCAAAA', 'HOJAAA', 'VVVVxx'),
+(7644, 6456, 0, 0, 4, 4, 44, 644, 1644, 2644, 7644, 88, 89, 'AIAAAA', 'IOJAAA', 'AAAAxx'),
+(2128, 6457, 0, 0, 8, 8, 28, 128, 128, 2128, 2128, 56, 57, 'WDAAAA', 'JOJAAA', 'HHHHxx'),
+(6583, 6458, 1, 3, 3, 3, 83, 583, 583, 1583, 6583, 166, 167, 'FTAAAA', 'KOJAAA', 'OOOOxx'),
+(4224, 6459, 0, 0, 4, 4, 24, 224, 224, 4224, 4224, 48, 49, 'MGAAAA', 'LOJAAA', 'VVVVxx'),
+(5253, 6460, 1, 1, 3, 13, 53, 253, 1253, 253, 5253, 106, 107, 'BUAAAA', 'MOJAAA', 'AAAAxx'),
+(8219, 6461, 1, 3, 9, 19, 19, 219, 219, 3219, 8219, 38, 39, 'DEAAAA', 'NOJAAA', 'HHHHxx'),
+(8113, 6462, 1, 1, 3, 13, 13, 113, 113, 3113, 8113, 26, 27, 'BAAAAA', 'OOJAAA', 'OOOOxx'),
+(3616, 6463, 0, 0, 6, 16, 16, 616, 1616, 3616, 3616, 32, 33, 'CJAAAA', 'POJAAA', 'VVVVxx'),
+(1361, 6464, 1, 1, 1, 1, 61, 361, 1361, 1361, 1361, 122, 123, 'JAAAAA', 'QOJAAA', 'AAAAxx'),
+(949, 6465, 1, 1, 9, 9, 49, 949, 949, 949, 949, 98, 99, 'NKAAAA', 'ROJAAA', 'HHHHxx'),
+(8582, 6466, 0, 2, 2, 2, 82, 582, 582, 3582, 8582, 164, 165, 'CSAAAA', 'SOJAAA', 'OOOOxx'),
+(5104, 6467, 0, 0, 4, 4, 4, 104, 1104, 104, 5104, 8, 9, 'IOAAAA', 'TOJAAA', 'VVVVxx'),
+(6146, 6468, 0, 2, 6, 6, 46, 146, 146, 1146, 6146, 92, 93, 'KCAAAA', 'UOJAAA', 'AAAAxx'),
+(7681, 6469, 1, 1, 1, 1, 81, 681, 1681, 2681, 7681, 162, 163, 'LJAAAA', 'VOJAAA', 'HHHHxx'),
+(1904, 6470, 0, 0, 4, 4, 4, 904, 1904, 1904, 1904, 8, 9, 'GVAAAA', 'WOJAAA', 'OOOOxx'),
+(1989, 6471, 1, 1, 9, 9, 89, 989, 1989, 1989, 1989, 178, 179, 'NYAAAA', 'XOJAAA', 'VVVVxx'),
+(4179, 6472, 1, 3, 9, 19, 79, 179, 179, 4179, 4179, 158, 159, 'TEAAAA', 'YOJAAA', 'AAAAxx'),
+(1739, 6473, 1, 3, 9, 19, 39, 739, 1739, 1739, 1739, 78, 79, 'XOAAAA', 'ZOJAAA', 'HHHHxx'),
+(2447, 6474, 1, 3, 7, 7, 47, 447, 447, 2447, 2447, 94, 95, 'DQAAAA', 'APJAAA', 'OOOOxx'),
+(3029, 6475, 1, 1, 9, 9, 29, 29, 1029, 3029, 3029, 58, 59, 'NMAAAA', 'BPJAAA', 'VVVVxx'),
+(9783, 6476, 1, 3, 3, 3, 83, 783, 1783, 4783, 9783, 166, 167, 'HMAAAA', 'CPJAAA', 'AAAAxx'),
+(8381, 6477, 1, 1, 1, 1, 81, 381, 381, 3381, 8381, 162, 163, 'JKAAAA', 'DPJAAA', 'HHHHxx'),
+(8755, 6478, 1, 3, 5, 15, 55, 755, 755, 3755, 8755, 110, 111, 'TYAAAA', 'EPJAAA', 'OOOOxx'),
+(8384, 6479, 0, 0, 4, 4, 84, 384, 384, 3384, 8384, 168, 169, 'MKAAAA', 'FPJAAA', 'VVVVxx'),
+(7655, 6480, 1, 3, 5, 15, 55, 655, 1655, 2655, 7655, 110, 111, 'LIAAAA', 'GPJAAA', 'AAAAxx'),
+(4766, 6481, 0, 2, 6, 6, 66, 766, 766, 4766, 4766, 132, 133, 'IBAAAA', 'HPJAAA', 'HHHHxx'),
+(3324, 6482, 0, 0, 4, 4, 24, 324, 1324, 3324, 3324, 48, 49, 'WXAAAA', 'IPJAAA', 'OOOOxx'),
+(5022, 6483, 0, 2, 2, 2, 22, 22, 1022, 22, 5022, 44, 45, 'ELAAAA', 'JPJAAA', 'VVVVxx'),
+(2856, 6484, 0, 0, 6, 16, 56, 856, 856, 2856, 2856, 112, 113, 'WFAAAA', 'KPJAAA', 'AAAAxx'),
+(6503, 6485, 1, 3, 3, 3, 3, 503, 503, 1503, 6503, 6, 7, 'DQAAAA', 'LPJAAA', 'HHHHxx'),
+(6872, 6486, 0, 0, 2, 12, 72, 872, 872, 1872, 6872, 144, 145, 'IEAAAA', 'MPJAAA', 'OOOOxx'),
+(1663, 6487, 1, 3, 3, 3, 63, 663, 1663, 1663, 1663, 126, 127, 'ZLAAAA', 'NPJAAA', 'VVVVxx'),
+(6964, 6488, 0, 0, 4, 4, 64, 964, 964, 1964, 6964, 128, 129, 'WHAAAA', 'OPJAAA', 'AAAAxx'),
+(4622, 6489, 0, 2, 2, 2, 22, 622, 622, 4622, 4622, 44, 45, 'UVAAAA', 'PPJAAA', 'HHHHxx'),
+(6089, 6490, 1, 1, 9, 9, 89, 89, 89, 1089, 6089, 178, 179, 'FAAAAA', 'QPJAAA', 'OOOOxx'),
+(8567, 6491, 1, 3, 7, 7, 67, 567, 567, 3567, 8567, 134, 135, 'NRAAAA', 'RPJAAA', 'VVVVxx'),
+(597, 6492, 1, 1, 7, 17, 97, 597, 597, 597, 597, 194, 195, 'ZWAAAA', 'SPJAAA', 'AAAAxx'),
+(4222, 6493, 0, 2, 2, 2, 22, 222, 222, 4222, 4222, 44, 45, 'KGAAAA', 'TPJAAA', 'HHHHxx'),
+(9322, 6494, 0, 2, 2, 2, 22, 322, 1322, 4322, 9322, 44, 45, 'OUAAAA', 'UPJAAA', 'OOOOxx'),
+(624, 6495, 0, 0, 4, 4, 24, 624, 624, 624, 624, 48, 49, 'AYAAAA', 'VPJAAA', 'VVVVxx'),
+(4329, 6496, 1, 1, 9, 9, 29, 329, 329, 4329, 4329, 58, 59, 'NKAAAA', 'WPJAAA', 'AAAAxx'),
+(6781, 6497, 1, 1, 1, 1, 81, 781, 781, 1781, 6781, 162, 163, 'VAAAAA', 'XPJAAA', 'HHHHxx'),
+(1673, 6498, 1, 1, 3, 13, 73, 673, 1673, 1673, 1673, 146, 147, 'JMAAAA', 'YPJAAA', 'OOOOxx'),
+(6633, 6499, 1, 1, 3, 13, 33, 633, 633, 1633, 6633, 66, 67, 'DVAAAA', 'ZPJAAA', 'VVVVxx'),
+(2569, 6500, 1, 1, 9, 9, 69, 569, 569, 2569, 2569, 138, 139, 'VUAAAA', 'AQJAAA', 'AAAAxx'),
+(4995, 6501, 1, 3, 5, 15, 95, 995, 995, 4995, 4995, 190, 191, 'DKAAAA', 'BQJAAA', 'HHHHxx'),
+(2749, 6502, 1, 1, 9, 9, 49, 749, 749, 2749, 2749, 98, 99, 'TBAAAA', 'CQJAAA', 'OOOOxx'),
+(9044, 6503, 0, 0, 4, 4, 44, 44, 1044, 4044, 9044, 88, 89, 'WJAAAA', 'DQJAAA', 'VVVVxx'),
+(5823, 6504, 1, 3, 3, 3, 23, 823, 1823, 823, 5823, 46, 47, 'ZPAAAA', 'EQJAAA', 'AAAAxx'),
+(9366, 6505, 0, 2, 6, 6, 66, 366, 1366, 4366, 9366, 132, 133, 'GWAAAA', 'FQJAAA', 'HHHHxx'),
+(1169, 6506, 1, 1, 9, 9, 69, 169, 1169, 1169, 1169, 138, 139, 'ZSAAAA', 'GQJAAA', 'OOOOxx'),
+(1300, 6507, 0, 0, 0, 0, 0, 300, 1300, 1300, 1300, 0, 1, 'AYAAAA', 'HQJAAA', 'VVVVxx'),
+(9973, 6508, 1, 1, 3, 13, 73, 973, 1973, 4973, 9973, 146, 147, 'PTAAAA', 'IQJAAA', 'AAAAxx'),
+(2092, 6509, 0, 0, 2, 12, 92, 92, 92, 2092, 2092, 184, 185, 'MCAAAA', 'JQJAAA', 'HHHHxx'),
+(9776, 6510, 0, 0, 6, 16, 76, 776, 1776, 4776, 9776, 152, 153, 'AMAAAA', 'KQJAAA', 'OOOOxx'),
+(7612, 6511, 0, 0, 2, 12, 12, 612, 1612, 2612, 7612, 24, 25, 'UGAAAA', 'LQJAAA', 'VVVVxx'),
+(7190, 6512, 0, 2, 0, 10, 90, 190, 1190, 2190, 7190, 180, 181, 'OQAAAA', 'MQJAAA', 'AAAAxx'),
+(5147, 6513, 1, 3, 7, 7, 47, 147, 1147, 147, 5147, 94, 95, 'ZPAAAA', 'NQJAAA', 'HHHHxx'),
+(3722, 6514, 0, 2, 2, 2, 22, 722, 1722, 3722, 3722, 44, 45, 'ENAAAA', 'OQJAAA', 'OOOOxx'),
+(5858, 6515, 0, 2, 8, 18, 58, 858, 1858, 858, 5858, 116, 117, 'IRAAAA', 'PQJAAA', 'VVVVxx'),
+(3204, 6516, 0, 0, 4, 4, 4, 204, 1204, 3204, 3204, 8, 9, 'GTAAAA', 'QQJAAA', 'AAAAxx'),
+(8994, 6517, 0, 2, 4, 14, 94, 994, 994, 3994, 8994, 188, 189, 'YHAAAA', 'RQJAAA', 'HHHHxx'),
+(7478, 6518, 0, 2, 8, 18, 78, 478, 1478, 2478, 7478, 156, 157, 'QBAAAA', 'SQJAAA', 'OOOOxx'),
+(9624, 6519, 0, 0, 4, 4, 24, 624, 1624, 4624, 9624, 48, 49, 'EGAAAA', 'TQJAAA', 'VVVVxx'),
+(6639, 6520, 1, 3, 9, 19, 39, 639, 639, 1639, 6639, 78, 79, 'JVAAAA', 'UQJAAA', 'AAAAxx'),
+(369, 6521, 1, 1, 9, 9, 69, 369, 369, 369, 369, 138, 139, 'FOAAAA', 'VQJAAA', 'HHHHxx'),
+(7766, 6522, 0, 2, 6, 6, 66, 766, 1766, 2766, 7766, 132, 133, 'SMAAAA', 'WQJAAA', 'OOOOxx'),
+(4094, 6523, 0, 2, 4, 14, 94, 94, 94, 4094, 4094, 188, 189, 'MBAAAA', 'XQJAAA', 'VVVVxx'),
+(9556, 6524, 0, 0, 6, 16, 56, 556, 1556, 4556, 9556, 112, 113, 'ODAAAA', 'YQJAAA', 'AAAAxx'),
+(4887, 6525, 1, 3, 7, 7, 87, 887, 887, 4887, 4887, 174, 175, 'ZFAAAA', 'ZQJAAA', 'HHHHxx'),
+(2321, 6526, 1, 1, 1, 1, 21, 321, 321, 2321, 2321, 42, 43, 'HLAAAA', 'ARJAAA', 'OOOOxx'),
+(9201, 6527, 1, 1, 1, 1, 1, 201, 1201, 4201, 9201, 2, 3, 'XPAAAA', 'BRJAAA', 'VVVVxx'),
+(1627, 6528, 1, 3, 7, 7, 27, 627, 1627, 1627, 1627, 54, 55, 'PKAAAA', 'CRJAAA', 'AAAAxx'),
+(150, 6529, 0, 2, 0, 10, 50, 150, 150, 150, 150, 100, 101, 'UFAAAA', 'DRJAAA', 'HHHHxx'),
+(8010, 6530, 0, 2, 0, 10, 10, 10, 10, 3010, 8010, 20, 21, 'CWAAAA', 'ERJAAA', 'OOOOxx'),
+(8026, 6531, 0, 2, 6, 6, 26, 26, 26, 3026, 8026, 52, 53, 'SWAAAA', 'FRJAAA', 'VVVVxx'),
+(5495, 6532, 1, 3, 5, 15, 95, 495, 1495, 495, 5495, 190, 191, 'JDAAAA', 'GRJAAA', 'AAAAxx'),
+(6213, 6533, 1, 1, 3, 13, 13, 213, 213, 1213, 6213, 26, 27, 'ZEAAAA', 'HRJAAA', 'HHHHxx'),
+(6464, 6534, 0, 0, 4, 4, 64, 464, 464, 1464, 6464, 128, 129, 'QOAAAA', 'IRJAAA', 'OOOOxx'),
+(1158, 6535, 0, 2, 8, 18, 58, 158, 1158, 1158, 1158, 116, 117, 'OSAAAA', 'JRJAAA', 'VVVVxx'),
+(8669, 6536, 1, 1, 9, 9, 69, 669, 669, 3669, 8669, 138, 139, 'LVAAAA', 'KRJAAA', 'AAAAxx'),
+(3225, 6537, 1, 1, 5, 5, 25, 225, 1225, 3225, 3225, 50, 51, 'BUAAAA', 'LRJAAA', 'HHHHxx'),
+(1294, 6538, 0, 2, 4, 14, 94, 294, 1294, 1294, 1294, 188, 189, 'UXAAAA', 'MRJAAA', 'OOOOxx'),
+(2166, 6539, 0, 2, 6, 6, 66, 166, 166, 2166, 2166, 132, 133, 'IFAAAA', 'NRJAAA', 'VVVVxx'),
+(9328, 6540, 0, 0, 8, 8, 28, 328, 1328, 4328, 9328, 56, 57, 'UUAAAA', 'ORJAAA', 'AAAAxx'),
+(8431, 6541, 1, 3, 1, 11, 31, 431, 431, 3431, 8431, 62, 63, 'HMAAAA', 'PRJAAA', 'HHHHxx'),
+(7100, 6542, 0, 0, 0, 0, 0, 100, 1100, 2100, 7100, 0, 1, 'CNAAAA', 'QRJAAA', 'OOOOxx'),
+(8126, 6543, 0, 2, 6, 6, 26, 126, 126, 3126, 8126, 52, 53, 'OAAAAA', 'RRJAAA', 'VVVVxx'),
+(2185, 6544, 1, 1, 5, 5, 85, 185, 185, 2185, 2185, 170, 171, 'BGAAAA', 'SRJAAA', 'AAAAxx'),
+(5697, 6545, 1, 1, 7, 17, 97, 697, 1697, 697, 5697, 194, 195, 'DLAAAA', 'TRJAAA', 'HHHHxx'),
+(5531, 6546, 1, 3, 1, 11, 31, 531, 1531, 531, 5531, 62, 63, 'TEAAAA', 'URJAAA', 'OOOOxx'),
+(3020, 6547, 0, 0, 0, 0, 20, 20, 1020, 3020, 3020, 40, 41, 'EMAAAA', 'VRJAAA', 'VVVVxx'),
+(3076, 6548, 0, 0, 6, 16, 76, 76, 1076, 3076, 3076, 152, 153, 'IOAAAA', 'WRJAAA', 'AAAAxx'),
+(9228, 6549, 0, 0, 8, 8, 28, 228, 1228, 4228, 9228, 56, 57, 'YQAAAA', 'XRJAAA', 'HHHHxx'),
+(1734, 6550, 0, 2, 4, 14, 34, 734, 1734, 1734, 1734, 68, 69, 'SOAAAA', 'YRJAAA', 'OOOOxx'),
+(7616, 6551, 0, 0, 6, 16, 16, 616, 1616, 2616, 7616, 32, 33, 'YGAAAA', 'ZRJAAA', 'VVVVxx'),
+(9059, 6552, 1, 3, 9, 19, 59, 59, 1059, 4059, 9059, 118, 119, 'LKAAAA', 'ASJAAA', 'AAAAxx'),
+(323, 6553, 1, 3, 3, 3, 23, 323, 323, 323, 323, 46, 47, 'LMAAAA', 'BSJAAA', 'HHHHxx'),
+(1283, 6554, 1, 3, 3, 3, 83, 283, 1283, 1283, 1283, 166, 167, 'JXAAAA', 'CSJAAA', 'OOOOxx'),
+(9535, 6555, 1, 3, 5, 15, 35, 535, 1535, 4535, 9535, 70, 71, 'TCAAAA', 'DSJAAA', 'VVVVxx'),
+(2580, 6556, 0, 0, 0, 0, 80, 580, 580, 2580, 2580, 160, 161, 'GVAAAA', 'ESJAAA', 'AAAAxx'),
+(7633, 6557, 1, 1, 3, 13, 33, 633, 1633, 2633, 7633, 66, 67, 'PHAAAA', 'FSJAAA', 'HHHHxx'),
+(9497, 6558, 1, 1, 7, 17, 97, 497, 1497, 4497, 9497, 194, 195, 'HBAAAA', 'GSJAAA', 'OOOOxx'),
+(9842, 6559, 0, 2, 2, 2, 42, 842, 1842, 4842, 9842, 84, 85, 'OOAAAA', 'HSJAAA', 'VVVVxx'),
+(3426, 6560, 0, 2, 6, 6, 26, 426, 1426, 3426, 3426, 52, 53, 'UBAAAA', 'ISJAAA', 'AAAAxx'),
+(7650, 6561, 0, 2, 0, 10, 50, 650, 1650, 2650, 7650, 100, 101, 'GIAAAA', 'JSJAAA', 'HHHHxx'),
+(9935, 6562, 1, 3, 5, 15, 35, 935, 1935, 4935, 9935, 70, 71, 'DSAAAA', 'KSJAAA', 'OOOOxx'),
+(9354, 6563, 0, 2, 4, 14, 54, 354, 1354, 4354, 9354, 108, 109, 'UVAAAA', 'LSJAAA', 'VVVVxx'),
+(5569, 6564, 1, 1, 9, 9, 69, 569, 1569, 569, 5569, 138, 139, 'FGAAAA', 'MSJAAA', 'AAAAxx'),
+(5765, 6565, 1, 1, 5, 5, 65, 765, 1765, 765, 5765, 130, 131, 'TNAAAA', 'NSJAAA', 'HHHHxx'),
+(7283, 6566, 1, 3, 3, 3, 83, 283, 1283, 2283, 7283, 166, 167, 'DUAAAA', 'OSJAAA', 'OOOOxx'),
+(1068, 6567, 0, 0, 8, 8, 68, 68, 1068, 1068, 1068, 136, 137, 'CPAAAA', 'PSJAAA', 'VVVVxx'),
+(1641, 6568, 1, 1, 1, 1, 41, 641, 1641, 1641, 1641, 82, 83, 'DLAAAA', 'QSJAAA', 'AAAAxx'),
+(1688, 6569, 0, 0, 8, 8, 88, 688, 1688, 1688, 1688, 176, 177, 'YMAAAA', 'RSJAAA', 'HHHHxx'),
+(1133, 6570, 1, 1, 3, 13, 33, 133, 1133, 1133, 1133, 66, 67, 'PRAAAA', 'SSJAAA', 'OOOOxx'),
+(4493, 6571, 1, 1, 3, 13, 93, 493, 493, 4493, 4493, 186, 187, 'VQAAAA', 'TSJAAA', 'VVVVxx'),
+(3354, 6572, 0, 2, 4, 14, 54, 354, 1354, 3354, 3354, 108, 109, 'AZAAAA', 'USJAAA', 'AAAAxx'),
+(4029, 6573, 1, 1, 9, 9, 29, 29, 29, 4029, 4029, 58, 59, 'ZYAAAA', 'VSJAAA', 'HHHHxx'),
+(6704, 6574, 0, 0, 4, 4, 4, 704, 704, 1704, 6704, 8, 9, 'WXAAAA', 'WSJAAA', 'OOOOxx'),
+(3221, 6575, 1, 1, 1, 1, 21, 221, 1221, 3221, 3221, 42, 43, 'XTAAAA', 'XSJAAA', 'VVVVxx'),
+(9432, 6576, 0, 0, 2, 12, 32, 432, 1432, 4432, 9432, 64, 65, 'UYAAAA', 'YSJAAA', 'AAAAxx'),
+(6990, 6577, 0, 2, 0, 10, 90, 990, 990, 1990, 6990, 180, 181, 'WIAAAA', 'ZSJAAA', 'HHHHxx'),
+(1760, 6578, 0, 0, 0, 0, 60, 760, 1760, 1760, 1760, 120, 121, 'SPAAAA', 'ATJAAA', 'OOOOxx'),
+(4754, 6579, 0, 2, 4, 14, 54, 754, 754, 4754, 4754, 108, 109, 'WAAAAA', 'BTJAAA', 'VVVVxx'),
+(7724, 6580, 0, 0, 4, 4, 24, 724, 1724, 2724, 7724, 48, 49, 'CLAAAA', 'CTJAAA', 'AAAAxx'),
+(9487, 6581, 1, 3, 7, 7, 87, 487, 1487, 4487, 9487, 174, 175, 'XAAAAA', 'DTJAAA', 'HHHHxx'),
+(166, 6582, 0, 2, 6, 6, 66, 166, 166, 166, 166, 132, 133, 'KGAAAA', 'ETJAAA', 'OOOOxx'),
+(5479, 6583, 1, 3, 9, 19, 79, 479, 1479, 479, 5479, 158, 159, 'TCAAAA', 'FTJAAA', 'VVVVxx'),
+(8744, 6584, 0, 0, 4, 4, 44, 744, 744, 3744, 8744, 88, 89, 'IYAAAA', 'GTJAAA', 'AAAAxx'),
+(5746, 6585, 0, 2, 6, 6, 46, 746, 1746, 746, 5746, 92, 93, 'ANAAAA', 'HTJAAA', 'HHHHxx'),
+(907, 6586, 1, 3, 7, 7, 7, 907, 907, 907, 907, 14, 15, 'XIAAAA', 'ITJAAA', 'OOOOxx'),
+(3968, 6587, 0, 0, 8, 8, 68, 968, 1968, 3968, 3968, 136, 137, 'QWAAAA', 'JTJAAA', 'VVVVxx'),
+(5721, 6588, 1, 1, 1, 1, 21, 721, 1721, 721, 5721, 42, 43, 'BMAAAA', 'KTJAAA', 'AAAAxx'),
+(6738, 6589, 0, 2, 8, 18, 38, 738, 738, 1738, 6738, 76, 77, 'EZAAAA', 'LTJAAA', 'HHHHxx'),
+(4097, 6590, 1, 1, 7, 17, 97, 97, 97, 4097, 4097, 194, 195, 'PBAAAA', 'MTJAAA', 'OOOOxx'),
+(8456, 6591, 0, 0, 6, 16, 56, 456, 456, 3456, 8456, 112, 113, 'GNAAAA', 'NTJAAA', 'VVVVxx'),
+(1269, 6592, 1, 1, 9, 9, 69, 269, 1269, 1269, 1269, 138, 139, 'VWAAAA', 'OTJAAA', 'AAAAxx'),
+(7997, 6593, 1, 1, 7, 17, 97, 997, 1997, 2997, 7997, 194, 195, 'PVAAAA', 'PTJAAA', 'HHHHxx'),
+(9457, 6594, 1, 1, 7, 17, 57, 457, 1457, 4457, 9457, 114, 115, 'TZAAAA', 'QTJAAA', 'OOOOxx'),
+(1159, 6595, 1, 3, 9, 19, 59, 159, 1159, 1159, 1159, 118, 119, 'PSAAAA', 'RTJAAA', 'VVVVxx'),
+(1631, 6596, 1, 3, 1, 11, 31, 631, 1631, 1631, 1631, 62, 63, 'TKAAAA', 'STJAAA', 'AAAAxx'),
+(2019, 6597, 1, 3, 9, 19, 19, 19, 19, 2019, 2019, 38, 39, 'RZAAAA', 'TTJAAA', 'HHHHxx'),
+(3186, 6598, 0, 2, 6, 6, 86, 186, 1186, 3186, 3186, 172, 173, 'OSAAAA', 'UTJAAA', 'OOOOxx'),
+(5587, 6599, 1, 3, 7, 7, 87, 587, 1587, 587, 5587, 174, 175, 'XGAAAA', 'VTJAAA', 'VVVVxx'),
+(9172, 6600, 0, 0, 2, 12, 72, 172, 1172, 4172, 9172, 144, 145, 'UOAAAA', 'WTJAAA', 'AAAAxx'),
+(5589, 6601, 1, 1, 9, 9, 89, 589, 1589, 589, 5589, 178, 179, 'ZGAAAA', 'XTJAAA', 'HHHHxx'),
+(5103, 6602, 1, 3, 3, 3, 3, 103, 1103, 103, 5103, 6, 7, 'HOAAAA', 'YTJAAA', 'OOOOxx'),
+(3177, 6603, 1, 1, 7, 17, 77, 177, 1177, 3177, 3177, 154, 155, 'FSAAAA', 'ZTJAAA', 'VVVVxx'),
+(8887, 6604, 1, 3, 7, 7, 87, 887, 887, 3887, 8887, 174, 175, 'VDAAAA', 'AUJAAA', 'AAAAxx'),
+(12, 6605, 0, 0, 2, 12, 12, 12, 12, 12, 12, 24, 25, 'MAAAAA', 'BUJAAA', 'HHHHxx'),
+(8575, 6606, 1, 3, 5, 15, 75, 575, 575, 3575, 8575, 150, 151, 'VRAAAA', 'CUJAAA', 'OOOOxx'),
+(4335, 6607, 1, 3, 5, 15, 35, 335, 335, 4335, 4335, 70, 71, 'TKAAAA', 'DUJAAA', 'VVVVxx'),
+(4581, 6608, 1, 1, 1, 1, 81, 581, 581, 4581, 4581, 162, 163, 'FUAAAA', 'EUJAAA', 'AAAAxx'),
+(4444, 6609, 0, 0, 4, 4, 44, 444, 444, 4444, 4444, 88, 89, 'YOAAAA', 'FUJAAA', 'HHHHxx'),
+(7978, 6610, 0, 2, 8, 18, 78, 978, 1978, 2978, 7978, 156, 157, 'WUAAAA', 'GUJAAA', 'OOOOxx'),
+(3081, 6611, 1, 1, 1, 1, 81, 81, 1081, 3081, 3081, 162, 163, 'NOAAAA', 'HUJAAA', 'VVVVxx'),
+(4059, 6612, 1, 3, 9, 19, 59, 59, 59, 4059, 4059, 118, 119, 'DAAAAA', 'IUJAAA', 'AAAAxx'),
+(5711, 6613, 1, 3, 1, 11, 11, 711, 1711, 711, 5711, 22, 23, 'RLAAAA', 'JUJAAA', 'HHHHxx'),
+(7069, 6614, 1, 1, 9, 9, 69, 69, 1069, 2069, 7069, 138, 139, 'XLAAAA', 'KUJAAA', 'OOOOxx'),
+(6150, 6615, 0, 2, 0, 10, 50, 150, 150, 1150, 6150, 100, 101, 'OCAAAA', 'LUJAAA', 'VVVVxx'),
+(9550, 6616, 0, 2, 0, 10, 50, 550, 1550, 4550, 9550, 100, 101, 'IDAAAA', 'MUJAAA', 'AAAAxx'),
+(7087, 6617, 1, 3, 7, 7, 87, 87, 1087, 2087, 7087, 174, 175, 'PMAAAA', 'NUJAAA', 'HHHHxx'),
+(9557, 6618, 1, 1, 7, 17, 57, 557, 1557, 4557, 9557, 114, 115, 'PDAAAA', 'OUJAAA', 'OOOOxx'),
+(7856, 6619, 0, 0, 6, 16, 56, 856, 1856, 2856, 7856, 112, 113, 'EQAAAA', 'PUJAAA', 'VVVVxx'),
+(1115, 6620, 1, 3, 5, 15, 15, 115, 1115, 1115, 1115, 30, 31, 'XQAAAA', 'QUJAAA', 'AAAAxx'),
+(1086, 6621, 0, 2, 6, 6, 86, 86, 1086, 1086, 1086, 172, 173, 'UPAAAA', 'RUJAAA', 'HHHHxx'),
+(5048, 6622, 0, 0, 8, 8, 48, 48, 1048, 48, 5048, 96, 97, 'EMAAAA', 'SUJAAA', 'OOOOxx'),
+(5168, 6623, 0, 0, 8, 8, 68, 168, 1168, 168, 5168, 136, 137, 'UQAAAA', 'TUJAAA', 'VVVVxx'),
+(6029, 6624, 1, 1, 9, 9, 29, 29, 29, 1029, 6029, 58, 59, 'XXAAAA', 'UUJAAA', 'AAAAxx'),
+(546, 6625, 0, 2, 6, 6, 46, 546, 546, 546, 546, 92, 93, 'AVAAAA', 'VUJAAA', 'HHHHxx'),
+(2908, 6626, 0, 0, 8, 8, 8, 908, 908, 2908, 2908, 16, 17, 'WHAAAA', 'WUJAAA', 'OOOOxx'),
+(779, 6627, 1, 3, 9, 19, 79, 779, 779, 779, 779, 158, 159, 'ZDAAAA', 'XUJAAA', 'VVVVxx'),
+(4202, 6628, 0, 2, 2, 2, 2, 202, 202, 4202, 4202, 4, 5, 'QFAAAA', 'YUJAAA', 'AAAAxx'),
+(9984, 6629, 0, 0, 4, 4, 84, 984, 1984, 4984, 9984, 168, 169, 'AUAAAA', 'ZUJAAA', 'HHHHxx'),
+(4730, 6630, 0, 2, 0, 10, 30, 730, 730, 4730, 4730, 60, 61, 'YZAAAA', 'AVJAAA', 'OOOOxx'),
+(6517, 6631, 1, 1, 7, 17, 17, 517, 517, 1517, 6517, 34, 35, 'RQAAAA', 'BVJAAA', 'VVVVxx'),
+(8410, 6632, 0, 2, 0, 10, 10, 410, 410, 3410, 8410, 20, 21, 'MLAAAA', 'CVJAAA', 'AAAAxx'),
+(4793, 6633, 1, 1, 3, 13, 93, 793, 793, 4793, 4793, 186, 187, 'JCAAAA', 'DVJAAA', 'HHHHxx'),
+(3431, 6634, 1, 3, 1, 11, 31, 431, 1431, 3431, 3431, 62, 63, 'ZBAAAA', 'EVJAAA', 'OOOOxx'),
+(2481, 6635, 1, 1, 1, 1, 81, 481, 481, 2481, 2481, 162, 163, 'LRAAAA', 'FVJAAA', 'VVVVxx'),
+(3905, 6636, 1, 1, 5, 5, 5, 905, 1905, 3905, 3905, 10, 11, 'FUAAAA', 'GVJAAA', 'AAAAxx'),
+(8807, 6637, 1, 3, 7, 7, 7, 807, 807, 3807, 8807, 14, 15, 'TAAAAA', 'HVJAAA', 'HHHHxx'),
+(2660, 6638, 0, 0, 0, 0, 60, 660, 660, 2660, 2660, 120, 121, 'IYAAAA', 'IVJAAA', 'OOOOxx'),
+(4985, 6639, 1, 1, 5, 5, 85, 985, 985, 4985, 4985, 170, 171, 'TJAAAA', 'JVJAAA', 'VVVVxx'),
+(3080, 6640, 0, 0, 0, 0, 80, 80, 1080, 3080, 3080, 160, 161, 'MOAAAA', 'KVJAAA', 'AAAAxx'),
+(1090, 6641, 0, 2, 0, 10, 90, 90, 1090, 1090, 1090, 180, 181, 'YPAAAA', 'LVJAAA', 'HHHHxx'),
+(6917, 6642, 1, 1, 7, 17, 17, 917, 917, 1917, 6917, 34, 35, 'BGAAAA', 'MVJAAA', 'OOOOxx'),
+(5177, 6643, 1, 1, 7, 17, 77, 177, 1177, 177, 5177, 154, 155, 'DRAAAA', 'NVJAAA', 'VVVVxx'),
+(2729, 6644, 1, 1, 9, 9, 29, 729, 729, 2729, 2729, 58, 59, 'ZAAAAA', 'OVJAAA', 'AAAAxx'),
+(9706, 6645, 0, 2, 6, 6, 6, 706, 1706, 4706, 9706, 12, 13, 'IJAAAA', 'PVJAAA', 'HHHHxx'),
+(9929, 6646, 1, 1, 9, 9, 29, 929, 1929, 4929, 9929, 58, 59, 'XRAAAA', 'QVJAAA', 'OOOOxx'),
+(1547, 6647, 1, 3, 7, 7, 47, 547, 1547, 1547, 1547, 94, 95, 'NHAAAA', 'RVJAAA', 'VVVVxx'),
+(2798, 6648, 0, 2, 8, 18, 98, 798, 798, 2798, 2798, 196, 197, 'QDAAAA', 'SVJAAA', 'AAAAxx'),
+(4420, 6649, 0, 0, 0, 0, 20, 420, 420, 4420, 4420, 40, 41, 'AOAAAA', 'TVJAAA', 'HHHHxx'),
+(6771, 6650, 1, 3, 1, 11, 71, 771, 771, 1771, 6771, 142, 143, 'LAAAAA', 'UVJAAA', 'OOOOxx'),
+(2004, 6651, 0, 0, 4, 4, 4, 4, 4, 2004, 2004, 8, 9, 'CZAAAA', 'VVJAAA', 'VVVVxx'),
+(8686, 6652, 0, 2, 6, 6, 86, 686, 686, 3686, 8686, 172, 173, 'CWAAAA', 'WVJAAA', 'AAAAxx'),
+(3663, 6653, 1, 3, 3, 3, 63, 663, 1663, 3663, 3663, 126, 127, 'XKAAAA', 'XVJAAA', 'HHHHxx'),
+(806, 6654, 0, 2, 6, 6, 6, 806, 806, 806, 806, 12, 13, 'AFAAAA', 'YVJAAA', 'OOOOxx'),
+(4309, 6655, 1, 1, 9, 9, 9, 309, 309, 4309, 4309, 18, 19, 'TJAAAA', 'ZVJAAA', 'VVVVxx'),
+(7443, 6656, 1, 3, 3, 3, 43, 443, 1443, 2443, 7443, 86, 87, 'HAAAAA', 'AWJAAA', 'AAAAxx'),
+(5779, 6657, 1, 3, 9, 19, 79, 779, 1779, 779, 5779, 158, 159, 'HOAAAA', 'BWJAAA', 'HHHHxx'),
+(8821, 6658, 1, 1, 1, 1, 21, 821, 821, 3821, 8821, 42, 43, 'HBAAAA', 'CWJAAA', 'OOOOxx'),
+(4198, 6659, 0, 2, 8, 18, 98, 198, 198, 4198, 4198, 196, 197, 'MFAAAA', 'DWJAAA', 'VVVVxx'),
+(8115, 6660, 1, 3, 5, 15, 15, 115, 115, 3115, 8115, 30, 31, 'DAAAAA', 'EWJAAA', 'AAAAxx'),
+(9554, 6661, 0, 2, 4, 14, 54, 554, 1554, 4554, 9554, 108, 109, 'MDAAAA', 'FWJAAA', 'HHHHxx'),
+(8956, 6662, 0, 0, 6, 16, 56, 956, 956, 3956, 8956, 112, 113, 'MGAAAA', 'GWJAAA', 'OOOOxx'),
+(4733, 6663, 1, 1, 3, 13, 33, 733, 733, 4733, 4733, 66, 67, 'BAAAAA', 'HWJAAA', 'VVVVxx'),
+(5417, 6664, 1, 1, 7, 17, 17, 417, 1417, 417, 5417, 34, 35, 'JAAAAA', 'IWJAAA', 'AAAAxx'),
+(4792, 6665, 0, 0, 2, 12, 92, 792, 792, 4792, 4792, 184, 185, 'ICAAAA', 'JWJAAA', 'HHHHxx'),
+(462, 6666, 0, 2, 2, 2, 62, 462, 462, 462, 462, 124, 125, 'URAAAA', 'KWJAAA', 'OOOOxx'),
+(3687, 6667, 1, 3, 7, 7, 87, 687, 1687, 3687, 3687, 174, 175, 'VLAAAA', 'LWJAAA', 'VVVVxx'),
+(2013, 6668, 1, 1, 3, 13, 13, 13, 13, 2013, 2013, 26, 27, 'LZAAAA', 'MWJAAA', 'AAAAxx'),
+(5386, 6669, 0, 2, 6, 6, 86, 386, 1386, 386, 5386, 172, 173, 'EZAAAA', 'NWJAAA', 'HHHHxx'),
+(2816, 6670, 0, 0, 6, 16, 16, 816, 816, 2816, 2816, 32, 33, 'IEAAAA', 'OWJAAA', 'OOOOxx'),
+(7827, 6671, 1, 3, 7, 7, 27, 827, 1827, 2827, 7827, 54, 55, 'BPAAAA', 'PWJAAA', 'VVVVxx'),
+(5077, 6672, 1, 1, 7, 17, 77, 77, 1077, 77, 5077, 154, 155, 'HNAAAA', 'QWJAAA', 'AAAAxx'),
+(6039, 6673, 1, 3, 9, 19, 39, 39, 39, 1039, 6039, 78, 79, 'HYAAAA', 'RWJAAA', 'HHHHxx'),
+(215, 6674, 1, 3, 5, 15, 15, 215, 215, 215, 215, 30, 31, 'HIAAAA', 'SWJAAA', 'OOOOxx'),
+(855, 6675, 1, 3, 5, 15, 55, 855, 855, 855, 855, 110, 111, 'XGAAAA', 'TWJAAA', 'VVVVxx'),
+(9692, 6676, 0, 0, 2, 12, 92, 692, 1692, 4692, 9692, 184, 185, 'UIAAAA', 'UWJAAA', 'AAAAxx'),
+(8391, 6677, 1, 3, 1, 11, 91, 391, 391, 3391, 8391, 182, 183, 'TKAAAA', 'VWJAAA', 'HHHHxx'),
+(8424, 6678, 0, 0, 4, 4, 24, 424, 424, 3424, 8424, 48, 49, 'AMAAAA', 'WWJAAA', 'OOOOxx'),
+(6331, 6679, 1, 3, 1, 11, 31, 331, 331, 1331, 6331, 62, 63, 'NJAAAA', 'XWJAAA', 'VVVVxx'),
+(6561, 6680, 1, 1, 1, 1, 61, 561, 561, 1561, 6561, 122, 123, 'JSAAAA', 'YWJAAA', 'AAAAxx'),
+(8955, 6681, 1, 3, 5, 15, 55, 955, 955, 3955, 8955, 110, 111, 'LGAAAA', 'ZWJAAA', 'HHHHxx'),
+(1764, 6682, 0, 0, 4, 4, 64, 764, 1764, 1764, 1764, 128, 129, 'WPAAAA', 'AXJAAA', 'OOOOxx'),
+(6623, 6683, 1, 3, 3, 3, 23, 623, 623, 1623, 6623, 46, 47, 'TUAAAA', 'BXJAAA', 'VVVVxx'),
+(2900, 6684, 0, 0, 0, 0, 0, 900, 900, 2900, 2900, 0, 1, 'OHAAAA', 'CXJAAA', 'AAAAxx'),
+(7048, 6685, 0, 0, 8, 8, 48, 48, 1048, 2048, 7048, 96, 97, 'CLAAAA', 'DXJAAA', 'HHHHxx'),
+(3843, 6686, 1, 3, 3, 3, 43, 843, 1843, 3843, 3843, 86, 87, 'VRAAAA', 'EXJAAA', 'OOOOxx'),
+(4855, 6687, 1, 3, 5, 15, 55, 855, 855, 4855, 4855, 110, 111, 'TEAAAA', 'FXJAAA', 'VVVVxx'),
+(7383, 6688, 1, 3, 3, 3, 83, 383, 1383, 2383, 7383, 166, 167, 'ZXAAAA', 'GXJAAA', 'AAAAxx'),
+(7765, 6689, 1, 1, 5, 5, 65, 765, 1765, 2765, 7765, 130, 131, 'RMAAAA', 'HXJAAA', 'HHHHxx'),
+(1125, 6690, 1, 1, 5, 5, 25, 125, 1125, 1125, 1125, 50, 51, 'HRAAAA', 'IXJAAA', 'OOOOxx'),
+(755, 6691, 1, 3, 5, 15, 55, 755, 755, 755, 755, 110, 111, 'BDAAAA', 'JXJAAA', 'VVVVxx'),
+(2995, 6692, 1, 3, 5, 15, 95, 995, 995, 2995, 2995, 190, 191, 'FLAAAA', 'KXJAAA', 'AAAAxx'),
+(8907, 6693, 1, 3, 7, 7, 7, 907, 907, 3907, 8907, 14, 15, 'PEAAAA', 'LXJAAA', 'HHHHxx'),
+(9357, 6694, 1, 1, 7, 17, 57, 357, 1357, 4357, 9357, 114, 115, 'XVAAAA', 'MXJAAA', 'OOOOxx'),
+(4469, 6695, 1, 1, 9, 9, 69, 469, 469, 4469, 4469, 138, 139, 'XPAAAA', 'NXJAAA', 'VVVVxx'),
+(2147, 6696, 1, 3, 7, 7, 47, 147, 147, 2147, 2147, 94, 95, 'PEAAAA', 'OXJAAA', 'AAAAxx'),
+(2952, 6697, 0, 0, 2, 12, 52, 952, 952, 2952, 2952, 104, 105, 'OJAAAA', 'PXJAAA', 'HHHHxx'),
+(1324, 6698, 0, 0, 4, 4, 24, 324, 1324, 1324, 1324, 48, 49, 'YYAAAA', 'QXJAAA', 'OOOOxx'),
+(1173, 6699, 1, 1, 3, 13, 73, 173, 1173, 1173, 1173, 146, 147, 'DTAAAA', 'RXJAAA', 'VVVVxx'),
+(3169, 6700, 1, 1, 9, 9, 69, 169, 1169, 3169, 3169, 138, 139, 'XRAAAA', 'SXJAAA', 'AAAAxx'),
+(5149, 6701, 1, 1, 9, 9, 49, 149, 1149, 149, 5149, 98, 99, 'BQAAAA', 'TXJAAA', 'HHHHxx'),
+(9660, 6702, 0, 0, 0, 0, 60, 660, 1660, 4660, 9660, 120, 121, 'OHAAAA', 'UXJAAA', 'OOOOxx'),
+(3446, 6703, 0, 2, 6, 6, 46, 446, 1446, 3446, 3446, 92, 93, 'OCAAAA', 'VXJAAA', 'VVVVxx'),
+(6988, 6704, 0, 0, 8, 8, 88, 988, 988, 1988, 6988, 176, 177, 'UIAAAA', 'WXJAAA', 'AAAAxx'),
+(5829, 6705, 1, 1, 9, 9, 29, 829, 1829, 829, 5829, 58, 59, 'FQAAAA', 'XXJAAA', 'HHHHxx'),
+(7166, 6706, 0, 2, 6, 6, 66, 166, 1166, 2166, 7166, 132, 133, 'QPAAAA', 'YXJAAA', 'OOOOxx'),
+(3940, 6707, 0, 0, 0, 0, 40, 940, 1940, 3940, 3940, 80, 81, 'OVAAAA', 'ZXJAAA', 'VVVVxx'),
+(2645, 6708, 1, 1, 5, 5, 45, 645, 645, 2645, 2645, 90, 91, 'TXAAAA', 'AYJAAA', 'AAAAxx'),
+(478, 6709, 0, 2, 8, 18, 78, 478, 478, 478, 478, 156, 157, 'KSAAAA', 'BYJAAA', 'HHHHxx'),
+(1156, 6710, 0, 0, 6, 16, 56, 156, 1156, 1156, 1156, 112, 113, 'MSAAAA', 'CYJAAA', 'OOOOxx'),
+(2731, 6711, 1, 3, 1, 11, 31, 731, 731, 2731, 2731, 62, 63, 'BBAAAA', 'DYJAAA', 'VVVVxx'),
+(5637, 6712, 1, 1, 7, 17, 37, 637, 1637, 637, 5637, 74, 75, 'VIAAAA', 'EYJAAA', 'AAAAxx'),
+(7517, 6713, 1, 1, 7, 17, 17, 517, 1517, 2517, 7517, 34, 35, 'DDAAAA', 'FYJAAA', 'HHHHxx'),
+(5331, 6714, 1, 3, 1, 11, 31, 331, 1331, 331, 5331, 62, 63, 'BXAAAA', 'GYJAAA', 'OOOOxx'),
+(9640, 6715, 0, 0, 0, 0, 40, 640, 1640, 4640, 9640, 80, 81, 'UGAAAA', 'HYJAAA', 'VVVVxx'),
+(4108, 6716, 0, 0, 8, 8, 8, 108, 108, 4108, 4108, 16, 17, 'ACAAAA', 'IYJAAA', 'AAAAxx'),
+(1087, 6717, 1, 3, 7, 7, 87, 87, 1087, 1087, 1087, 174, 175, 'VPAAAA', 'JYJAAA', 'HHHHxx'),
+(8017, 6718, 1, 1, 7, 17, 17, 17, 17, 3017, 8017, 34, 35, 'JWAAAA', 'KYJAAA', 'OOOOxx'),
+(8795, 6719, 1, 3, 5, 15, 95, 795, 795, 3795, 8795, 190, 191, 'HAAAAA', 'LYJAAA', 'VVVVxx'),
+(7060, 6720, 0, 0, 0, 0, 60, 60, 1060, 2060, 7060, 120, 121, 'OLAAAA', 'MYJAAA', 'AAAAxx'),
+(9450, 6721, 0, 2, 0, 10, 50, 450, 1450, 4450, 9450, 100, 101, 'MZAAAA', 'NYJAAA', 'HHHHxx'),
+(390, 6722, 0, 2, 0, 10, 90, 390, 390, 390, 390, 180, 181, 'APAAAA', 'OYJAAA', 'OOOOxx'),
+(66, 6723, 0, 2, 6, 6, 66, 66, 66, 66, 66, 132, 133, 'OCAAAA', 'PYJAAA', 'VVVVxx'),
+(8789, 6724, 1, 1, 9, 9, 89, 789, 789, 3789, 8789, 178, 179, 'BAAAAA', 'QYJAAA', 'AAAAxx'),
+(9260, 6725, 0, 0, 0, 0, 60, 260, 1260, 4260, 9260, 120, 121, 'ESAAAA', 'RYJAAA', 'HHHHxx'),
+(6679, 6726, 1, 3, 9, 19, 79, 679, 679, 1679, 6679, 158, 159, 'XWAAAA', 'SYJAAA', 'OOOOxx'),
+(9052, 6727, 0, 0, 2, 12, 52, 52, 1052, 4052, 9052, 104, 105, 'EKAAAA', 'TYJAAA', 'VVVVxx'),
+(9561, 6728, 1, 1, 1, 1, 61, 561, 1561, 4561, 9561, 122, 123, 'TDAAAA', 'UYJAAA', 'AAAAxx'),
+(9725, 6729, 1, 1, 5, 5, 25, 725, 1725, 4725, 9725, 50, 51, 'BKAAAA', 'VYJAAA', 'HHHHxx'),
+(6298, 6730, 0, 2, 8, 18, 98, 298, 298, 1298, 6298, 196, 197, 'GIAAAA', 'WYJAAA', 'OOOOxx'),
+(8654, 6731, 0, 2, 4, 14, 54, 654, 654, 3654, 8654, 108, 109, 'WUAAAA', 'XYJAAA', 'VVVVxx'),
+(8725, 6732, 1, 1, 5, 5, 25, 725, 725, 3725, 8725, 50, 51, 'PXAAAA', 'YYJAAA', 'AAAAxx'),
+(9377, 6733, 1, 1, 7, 17, 77, 377, 1377, 4377, 9377, 154, 155, 'RWAAAA', 'ZYJAAA', 'HHHHxx'),
+(3807, 6734, 1, 3, 7, 7, 7, 807, 1807, 3807, 3807, 14, 15, 'LQAAAA', 'AZJAAA', 'OOOOxx'),
+(8048, 6735, 0, 0, 8, 8, 48, 48, 48, 3048, 8048, 96, 97, 'OXAAAA', 'BZJAAA', 'VVVVxx'),
+(764, 6736, 0, 0, 4, 4, 64, 764, 764, 764, 764, 128, 129, 'KDAAAA', 'CZJAAA', 'AAAAxx'),
+(9702, 6737, 0, 2, 2, 2, 2, 702, 1702, 4702, 9702, 4, 5, 'EJAAAA', 'DZJAAA', 'HHHHxx'),
+(8060, 6738, 0, 0, 0, 0, 60, 60, 60, 3060, 8060, 120, 121, 'AYAAAA', 'EZJAAA', 'OOOOxx'),
+(6371, 6739, 1, 3, 1, 11, 71, 371, 371, 1371, 6371, 142, 143, 'BLAAAA', 'FZJAAA', 'VVVVxx'),
+(5237, 6740, 1, 1, 7, 17, 37, 237, 1237, 237, 5237, 74, 75, 'LTAAAA', 'GZJAAA', 'AAAAxx'),
+(743, 6741, 1, 3, 3, 3, 43, 743, 743, 743, 743, 86, 87, 'PCAAAA', 'HZJAAA', 'HHHHxx'),
+(7395, 6742, 1, 3, 5, 15, 95, 395, 1395, 2395, 7395, 190, 191, 'LYAAAA', 'IZJAAA', 'OOOOxx'),
+(3365, 6743, 1, 1, 5, 5, 65, 365, 1365, 3365, 3365, 130, 131, 'LZAAAA', 'JZJAAA', 'VVVVxx'),
+(6667, 6744, 1, 3, 7, 7, 67, 667, 667, 1667, 6667, 134, 135, 'LWAAAA', 'KZJAAA', 'AAAAxx'),
+(3445, 6745, 1, 1, 5, 5, 45, 445, 1445, 3445, 3445, 90, 91, 'NCAAAA', 'LZJAAA', 'HHHHxx'),
+(4019, 6746, 1, 3, 9, 19, 19, 19, 19, 4019, 4019, 38, 39, 'PYAAAA', 'MZJAAA', 'OOOOxx'),
+(7035, 6747, 1, 3, 5, 15, 35, 35, 1035, 2035, 7035, 70, 71, 'PKAAAA', 'NZJAAA', 'VVVVxx'),
+(5274, 6748, 0, 2, 4, 14, 74, 274, 1274, 274, 5274, 148, 149, 'WUAAAA', 'OZJAAA', 'AAAAxx'),
+(519, 6749, 1, 3, 9, 19, 19, 519, 519, 519, 519, 38, 39, 'ZTAAAA', 'PZJAAA', 'HHHHxx'),
+(2801, 6750, 1, 1, 1, 1, 1, 801, 801, 2801, 2801, 2, 3, 'TDAAAA', 'QZJAAA', 'OOOOxx'),
+(3320, 6751, 0, 0, 0, 0, 20, 320, 1320, 3320, 3320, 40, 41, 'SXAAAA', 'RZJAAA', 'VVVVxx'),
+(3153, 6752, 1, 1, 3, 13, 53, 153, 1153, 3153, 3153, 106, 107, 'HRAAAA', 'SZJAAA', 'AAAAxx'),
+(7680, 6753, 0, 0, 0, 0, 80, 680, 1680, 2680, 7680, 160, 161, 'KJAAAA', 'TZJAAA', 'HHHHxx'),
+(8942, 6754, 0, 2, 2, 2, 42, 942, 942, 3942, 8942, 84, 85, 'YFAAAA', 'UZJAAA', 'OOOOxx'),
+(3195, 6755, 1, 3, 5, 15, 95, 195, 1195, 3195, 3195, 190, 191, 'XSAAAA', 'VZJAAA', 'VVVVxx'),
+(2287, 6756, 1, 3, 7, 7, 87, 287, 287, 2287, 2287, 174, 175, 'ZJAAAA', 'WZJAAA', 'AAAAxx'),
+(8325, 6757, 1, 1, 5, 5, 25, 325, 325, 3325, 8325, 50, 51, 'FIAAAA', 'XZJAAA', 'HHHHxx'),
+(2603, 6758, 1, 3, 3, 3, 3, 603, 603, 2603, 2603, 6, 7, 'DWAAAA', 'YZJAAA', 'OOOOxx'),
+(5871, 6759, 1, 3, 1, 11, 71, 871, 1871, 871, 5871, 142, 143, 'VRAAAA', 'ZZJAAA', 'VVVVxx'),
+(1773, 6760, 1, 1, 3, 13, 73, 773, 1773, 1773, 1773, 146, 147, 'FQAAAA', 'AAKAAA', 'AAAAxx'),
+(3323, 6761, 1, 3, 3, 3, 23, 323, 1323, 3323, 3323, 46, 47, 'VXAAAA', 'BAKAAA', 'HHHHxx'),
+(2053, 6762, 1, 1, 3, 13, 53, 53, 53, 2053, 2053, 106, 107, 'ZAAAAA', 'CAKAAA', 'OOOOxx'),
+(4062, 6763, 0, 2, 2, 2, 62, 62, 62, 4062, 4062, 124, 125, 'GAAAAA', 'DAKAAA', 'VVVVxx'),
+(4611, 6764, 1, 3, 1, 11, 11, 611, 611, 4611, 4611, 22, 23, 'JVAAAA', 'EAKAAA', 'AAAAxx'),
+(3451, 6765, 1, 3, 1, 11, 51, 451, 1451, 3451, 3451, 102, 103, 'TCAAAA', 'FAKAAA', 'HHHHxx'),
+(1819, 6766, 1, 3, 9, 19, 19, 819, 1819, 1819, 1819, 38, 39, 'ZRAAAA', 'GAKAAA', 'OOOOxx'),
+(9806, 6767, 0, 2, 6, 6, 6, 806, 1806, 4806, 9806, 12, 13, 'ENAAAA', 'HAKAAA', 'VVVVxx'),
+(6619, 6768, 1, 3, 9, 19, 19, 619, 619, 1619, 6619, 38, 39, 'PUAAAA', 'IAKAAA', 'AAAAxx'),
+(1031, 6769, 1, 3, 1, 11, 31, 31, 1031, 1031, 1031, 62, 63, 'RNAAAA', 'JAKAAA', 'HHHHxx'),
+(1865, 6770, 1, 1, 5, 5, 65, 865, 1865, 1865, 1865, 130, 131, 'TTAAAA', 'KAKAAA', 'OOOOxx'),
+(6282, 6771, 0, 2, 2, 2, 82, 282, 282, 1282, 6282, 164, 165, 'QHAAAA', 'LAKAAA', 'VVVVxx'),
+(1178, 6772, 0, 2, 8, 18, 78, 178, 1178, 1178, 1178, 156, 157, 'ITAAAA', 'MAKAAA', 'AAAAxx'),
+(8007, 6773, 1, 3, 7, 7, 7, 7, 7, 3007, 8007, 14, 15, 'ZVAAAA', 'NAKAAA', 'HHHHxx'),
+(9126, 6774, 0, 2, 6, 6, 26, 126, 1126, 4126, 9126, 52, 53, 'ANAAAA', 'OAKAAA', 'OOOOxx'),
+(9113, 6775, 1, 1, 3, 13, 13, 113, 1113, 4113, 9113, 26, 27, 'NMAAAA', 'PAKAAA', 'VVVVxx'),
+(537, 6776, 1, 1, 7, 17, 37, 537, 537, 537, 537, 74, 75, 'RUAAAA', 'QAKAAA', 'AAAAxx'),
+(6208, 6777, 0, 0, 8, 8, 8, 208, 208, 1208, 6208, 16, 17, 'UEAAAA', 'RAKAAA', 'HHHHxx'),
+(1626, 6778, 0, 2, 6, 6, 26, 626, 1626, 1626, 1626, 52, 53, 'OKAAAA', 'SAKAAA', 'OOOOxx'),
+(7188, 6779, 0, 0, 8, 8, 88, 188, 1188, 2188, 7188, 176, 177, 'MQAAAA', 'TAKAAA', 'VVVVxx'),
+(9216, 6780, 0, 0, 6, 16, 16, 216, 1216, 4216, 9216, 32, 33, 'MQAAAA', 'UAKAAA', 'AAAAxx'),
+(6134, 6781, 0, 2, 4, 14, 34, 134, 134, 1134, 6134, 68, 69, 'YBAAAA', 'VAKAAA', 'HHHHxx'),
+(2074, 6782, 0, 2, 4, 14, 74, 74, 74, 2074, 2074, 148, 149, 'UBAAAA', 'WAKAAA', 'OOOOxx'),
+(6369, 6783, 1, 1, 9, 9, 69, 369, 369, 1369, 6369, 138, 139, 'ZKAAAA', 'XAKAAA', 'VVVVxx'),
+(9306, 6784, 0, 2, 6, 6, 6, 306, 1306, 4306, 9306, 12, 13, 'YTAAAA', 'YAKAAA', 'AAAAxx'),
+(3155, 6785, 1, 3, 5, 15, 55, 155, 1155, 3155, 3155, 110, 111, 'JRAAAA', 'ZAKAAA', 'HHHHxx'),
+(3611, 6786, 1, 3, 1, 11, 11, 611, 1611, 3611, 3611, 22, 23, 'XIAAAA', 'ABKAAA', 'OOOOxx'),
+(6530, 6787, 0, 2, 0, 10, 30, 530, 530, 1530, 6530, 60, 61, 'ERAAAA', 'BBKAAA', 'VVVVxx'),
+(6979, 6788, 1, 3, 9, 19, 79, 979, 979, 1979, 6979, 158, 159, 'LIAAAA', 'CBKAAA', 'AAAAxx'),
+(9129, 6789, 1, 1, 9, 9, 29, 129, 1129, 4129, 9129, 58, 59, 'DNAAAA', 'DBKAAA', 'HHHHxx'),
+(8013, 6790, 1, 1, 3, 13, 13, 13, 13, 3013, 8013, 26, 27, 'FWAAAA', 'EBKAAA', 'OOOOxx'),
+(6926, 6791, 0, 2, 6, 6, 26, 926, 926, 1926, 6926, 52, 53, 'KGAAAA', 'FBKAAA', 'VVVVxx'),
+(1877, 6792, 1, 1, 7, 17, 77, 877, 1877, 1877, 1877, 154, 155, 'FUAAAA', 'GBKAAA', 'AAAAxx'),
+(1882, 6793, 0, 2, 2, 2, 82, 882, 1882, 1882, 1882, 164, 165, 'KUAAAA', 'HBKAAA', 'HHHHxx'),
+(6720, 6794, 0, 0, 0, 0, 20, 720, 720, 1720, 6720, 40, 41, 'MYAAAA', 'IBKAAA', 'OOOOxx'),
+(690, 6795, 0, 2, 0, 10, 90, 690, 690, 690, 690, 180, 181, 'OAAAAA', 'JBKAAA', 'VVVVxx'),
+(143, 6796, 1, 3, 3, 3, 43, 143, 143, 143, 143, 86, 87, 'NFAAAA', 'KBKAAA', 'AAAAxx'),
+(7241, 6797, 1, 1, 1, 1, 41, 241, 1241, 2241, 7241, 82, 83, 'NSAAAA', 'LBKAAA', 'HHHHxx'),
+(6461, 6798, 1, 1, 1, 1, 61, 461, 461, 1461, 6461, 122, 123, 'NOAAAA', 'MBKAAA', 'OOOOxx'),
+(2258, 6799, 0, 2, 8, 18, 58, 258, 258, 2258, 2258, 116, 117, 'WIAAAA', 'NBKAAA', 'VVVVxx'),
+(2280, 6800, 0, 0, 0, 0, 80, 280, 280, 2280, 2280, 160, 161, 'SJAAAA', 'OBKAAA', 'AAAAxx'),
+(7556, 6801, 0, 0, 6, 16, 56, 556, 1556, 2556, 7556, 112, 113, 'QEAAAA', 'PBKAAA', 'HHHHxx'),
+(1038, 6802, 0, 2, 8, 18, 38, 38, 1038, 1038, 1038, 76, 77, 'YNAAAA', 'QBKAAA', 'OOOOxx'),
+(2634, 6803, 0, 2, 4, 14, 34, 634, 634, 2634, 2634, 68, 69, 'IXAAAA', 'RBKAAA', 'VVVVxx'),
+(7847, 6804, 1, 3, 7, 7, 47, 847, 1847, 2847, 7847, 94, 95, 'VPAAAA', 'SBKAAA', 'AAAAxx'),
+(4415, 6805, 1, 3, 5, 15, 15, 415, 415, 4415, 4415, 30, 31, 'VNAAAA', 'TBKAAA', 'HHHHxx'),
+(1933, 6806, 1, 1, 3, 13, 33, 933, 1933, 1933, 1933, 66, 67, 'JWAAAA', 'UBKAAA', 'OOOOxx'),
+(8034, 6807, 0, 2, 4, 14, 34, 34, 34, 3034, 8034, 68, 69, 'AXAAAA', 'VBKAAA', 'VVVVxx'),
+(9233, 6808, 1, 1, 3, 13, 33, 233, 1233, 4233, 9233, 66, 67, 'DRAAAA', 'WBKAAA', 'AAAAxx'),
+(6572, 6809, 0, 0, 2, 12, 72, 572, 572, 1572, 6572, 144, 145, 'USAAAA', 'XBKAAA', 'HHHHxx'),
+(1586, 6810, 0, 2, 6, 6, 86, 586, 1586, 1586, 1586, 172, 173, 'AJAAAA', 'YBKAAA', 'OOOOxx'),
+(8512, 6811, 0, 0, 2, 12, 12, 512, 512, 3512, 8512, 24, 25, 'KPAAAA', 'ZBKAAA', 'VVVVxx'),
+(7421, 6812, 1, 1, 1, 1, 21, 421, 1421, 2421, 7421, 42, 43, 'LZAAAA', 'ACKAAA', 'AAAAxx'),
+(503, 6813, 1, 3, 3, 3, 3, 503, 503, 503, 503, 6, 7, 'JTAAAA', 'BCKAAA', 'HHHHxx'),
+(5332, 6814, 0, 0, 2, 12, 32, 332, 1332, 332, 5332, 64, 65, 'CXAAAA', 'CCKAAA', 'OOOOxx'),
+(2602, 6815, 0, 2, 2, 2, 2, 602, 602, 2602, 2602, 4, 5, 'CWAAAA', 'DCKAAA', 'VVVVxx'),
+(2902, 6816, 0, 2, 2, 2, 2, 902, 902, 2902, 2902, 4, 5, 'QHAAAA', 'ECKAAA', 'AAAAxx'),
+(2979, 6817, 1, 3, 9, 19, 79, 979, 979, 2979, 2979, 158, 159, 'PKAAAA', 'FCKAAA', 'HHHHxx'),
+(1431, 6818, 1, 3, 1, 11, 31, 431, 1431, 1431, 1431, 62, 63, 'BDAAAA', 'GCKAAA', 'OOOOxx'),
+(8639, 6819, 1, 3, 9, 19, 39, 639, 639, 3639, 8639, 78, 79, 'HUAAAA', 'HCKAAA', 'VVVVxx'),
+(4218, 6820, 0, 2, 8, 18, 18, 218, 218, 4218, 4218, 36, 37, 'GGAAAA', 'ICKAAA', 'AAAAxx'),
+(7453, 6821, 1, 1, 3, 13, 53, 453, 1453, 2453, 7453, 106, 107, 'RAAAAA', 'JCKAAA', 'HHHHxx'),
+(5448, 6822, 0, 0, 8, 8, 48, 448, 1448, 448, 5448, 96, 97, 'OBAAAA', 'KCKAAA', 'OOOOxx'),
+(6768, 6823, 0, 0, 8, 8, 68, 768, 768, 1768, 6768, 136, 137, 'IAAAAA', 'LCKAAA', 'VVVVxx'),
+(3104, 6824, 0, 0, 4, 4, 4, 104, 1104, 3104, 3104, 8, 9, 'KPAAAA', 'MCKAAA', 'AAAAxx'),
+(2297, 6825, 1, 1, 7, 17, 97, 297, 297, 2297, 2297, 194, 195, 'JKAAAA', 'NCKAAA', 'HHHHxx'),
+(7994, 6826, 0, 2, 4, 14, 94, 994, 1994, 2994, 7994, 188, 189, 'MVAAAA', 'OCKAAA', 'OOOOxx'),
+(550, 6827, 0, 2, 0, 10, 50, 550, 550, 550, 550, 100, 101, 'EVAAAA', 'PCKAAA', 'VVVVxx'),
+(4777, 6828, 1, 1, 7, 17, 77, 777, 777, 4777, 4777, 154, 155, 'TBAAAA', 'QCKAAA', 'AAAAxx'),
+(5962, 6829, 0, 2, 2, 2, 62, 962, 1962, 962, 5962, 124, 125, 'IVAAAA', 'RCKAAA', 'HHHHxx'),
+(1763, 6830, 1, 3, 3, 3, 63, 763, 1763, 1763, 1763, 126, 127, 'VPAAAA', 'SCKAAA', 'OOOOxx'),
+(3654, 6831, 0, 2, 4, 14, 54, 654, 1654, 3654, 3654, 108, 109, 'OKAAAA', 'TCKAAA', 'VVVVxx'),
+(4106, 6832, 0, 2, 6, 6, 6, 106, 106, 4106, 4106, 12, 13, 'YBAAAA', 'UCKAAA', 'AAAAxx'),
+(5156, 6833, 0, 0, 6, 16, 56, 156, 1156, 156, 5156, 112, 113, 'IQAAAA', 'VCKAAA', 'HHHHxx'),
+(422, 6834, 0, 2, 2, 2, 22, 422, 422, 422, 422, 44, 45, 'GQAAAA', 'WCKAAA', 'OOOOxx'),
+(5011, 6835, 1, 3, 1, 11, 11, 11, 1011, 11, 5011, 22, 23, 'TKAAAA', 'XCKAAA', 'VVVVxx'),
+(218, 6836, 0, 2, 8, 18, 18, 218, 218, 218, 218, 36, 37, 'KIAAAA', 'YCKAAA', 'AAAAxx'),
+(9762, 6837, 0, 2, 2, 2, 62, 762, 1762, 4762, 9762, 124, 125, 'MLAAAA', 'ZCKAAA', 'HHHHxx'),
+(6074, 6838, 0, 2, 4, 14, 74, 74, 74, 1074, 6074, 148, 149, 'QZAAAA', 'ADKAAA', 'OOOOxx'),
+(4060, 6839, 0, 0, 0, 0, 60, 60, 60, 4060, 4060, 120, 121, 'EAAAAA', 'BDKAAA', 'VVVVxx'),
+(8680, 6840, 0, 0, 0, 0, 80, 680, 680, 3680, 8680, 160, 161, 'WVAAAA', 'CDKAAA', 'AAAAxx'),
+(5863, 6841, 1, 3, 3, 3, 63, 863, 1863, 863, 5863, 126, 127, 'NRAAAA', 'DDKAAA', 'HHHHxx'),
+(8042, 6842, 0, 2, 2, 2, 42, 42, 42, 3042, 8042, 84, 85, 'IXAAAA', 'EDKAAA', 'OOOOxx'),
+(2964, 6843, 0, 0, 4, 4, 64, 964, 964, 2964, 2964, 128, 129, 'AKAAAA', 'FDKAAA', 'VVVVxx'),
+(6931, 6844, 1, 3, 1, 11, 31, 931, 931, 1931, 6931, 62, 63, 'PGAAAA', 'GDKAAA', 'AAAAxx'),
+(6715, 6845, 1, 3, 5, 15, 15, 715, 715, 1715, 6715, 30, 31, 'HYAAAA', 'HDKAAA', 'HHHHxx'),
+(5859, 6846, 1, 3, 9, 19, 59, 859, 1859, 859, 5859, 118, 119, 'JRAAAA', 'IDKAAA', 'OOOOxx'),
+(6173, 6847, 1, 1, 3, 13, 73, 173, 173, 1173, 6173, 146, 147, 'LDAAAA', 'JDKAAA', 'VVVVxx'),
+(7788, 6848, 0, 0, 8, 8, 88, 788, 1788, 2788, 7788, 176, 177, 'ONAAAA', 'KDKAAA', 'AAAAxx'),
+(9370, 6849, 0, 2, 0, 10, 70, 370, 1370, 4370, 9370, 140, 141, 'KWAAAA', 'LDKAAA', 'HHHHxx'),
+(3038, 6850, 0, 2, 8, 18, 38, 38, 1038, 3038, 3038, 76, 77, 'WMAAAA', 'MDKAAA', 'OOOOxx'),
+(6483, 6851, 1, 3, 3, 3, 83, 483, 483, 1483, 6483, 166, 167, 'JPAAAA', 'NDKAAA', 'VVVVxx'),
+(7534, 6852, 0, 2, 4, 14, 34, 534, 1534, 2534, 7534, 68, 69, 'UDAAAA', 'ODKAAA', 'AAAAxx'),
+(5769, 6853, 1, 1, 9, 9, 69, 769, 1769, 769, 5769, 138, 139, 'XNAAAA', 'PDKAAA', 'HHHHxx'),
+(9152, 6854, 0, 0, 2, 12, 52, 152, 1152, 4152, 9152, 104, 105, 'AOAAAA', 'QDKAAA', 'OOOOxx'),
+(6251, 6855, 1, 3, 1, 11, 51, 251, 251, 1251, 6251, 102, 103, 'LGAAAA', 'RDKAAA', 'VVVVxx'),
+(9209, 6856, 1, 1, 9, 9, 9, 209, 1209, 4209, 9209, 18, 19, 'FQAAAA', 'SDKAAA', 'AAAAxx'),
+(5365, 6857, 1, 1, 5, 5, 65, 365, 1365, 365, 5365, 130, 131, 'JYAAAA', 'TDKAAA', 'HHHHxx'),
+(509, 6858, 1, 1, 9, 9, 9, 509, 509, 509, 509, 18, 19, 'PTAAAA', 'UDKAAA', 'OOOOxx'),
+(3132, 6859, 0, 0, 2, 12, 32, 132, 1132, 3132, 3132, 64, 65, 'MQAAAA', 'VDKAAA', 'VVVVxx'),
+(5373, 6860, 1, 1, 3, 13, 73, 373, 1373, 373, 5373, 146, 147, 'RYAAAA', 'WDKAAA', 'AAAAxx'),
+(4247, 6861, 1, 3, 7, 7, 47, 247, 247, 4247, 4247, 94, 95, 'JHAAAA', 'XDKAAA', 'HHHHxx'),
+(3491, 6862, 1, 3, 1, 11, 91, 491, 1491, 3491, 3491, 182, 183, 'HEAAAA', 'YDKAAA', 'OOOOxx'),
+(495, 6863, 1, 3, 5, 15, 95, 495, 495, 495, 495, 190, 191, 'BTAAAA', 'ZDKAAA', 'VVVVxx'),
+(1594, 6864, 0, 2, 4, 14, 94, 594, 1594, 1594, 1594, 188, 189, 'IJAAAA', 'AEKAAA', 'AAAAxx'),
+(2243, 6865, 1, 3, 3, 3, 43, 243, 243, 2243, 2243, 86, 87, 'HIAAAA', 'BEKAAA', 'HHHHxx'),
+(7780, 6866, 0, 0, 0, 0, 80, 780, 1780, 2780, 7780, 160, 161, 'GNAAAA', 'CEKAAA', 'OOOOxx'),
+(5632, 6867, 0, 0, 2, 12, 32, 632, 1632, 632, 5632, 64, 65, 'QIAAAA', 'DEKAAA', 'VVVVxx'),
+(2679, 6868, 1, 3, 9, 19, 79, 679, 679, 2679, 2679, 158, 159, 'BZAAAA', 'EEKAAA', 'AAAAxx'),
+(1354, 6869, 0, 2, 4, 14, 54, 354, 1354, 1354, 1354, 108, 109, 'CAAAAA', 'FEKAAA', 'HHHHxx'),
+(180, 6870, 0, 0, 0, 0, 80, 180, 180, 180, 180, 160, 161, 'YGAAAA', 'GEKAAA', 'OOOOxx'),
+(7017, 6871, 1, 1, 7, 17, 17, 17, 1017, 2017, 7017, 34, 35, 'XJAAAA', 'HEKAAA', 'VVVVxx'),
+(1867, 6872, 1, 3, 7, 7, 67, 867, 1867, 1867, 1867, 134, 135, 'VTAAAA', 'IEKAAA', 'AAAAxx'),
+(2213, 6873, 1, 1, 3, 13, 13, 213, 213, 2213, 2213, 26, 27, 'DHAAAA', 'JEKAAA', 'HHHHxx'),
+(8773, 6874, 1, 1, 3, 13, 73, 773, 773, 3773, 8773, 146, 147, 'LZAAAA', 'KEKAAA', 'OOOOxx'),
+(1784, 6875, 0, 0, 4, 4, 84, 784, 1784, 1784, 1784, 168, 169, 'QQAAAA', 'LEKAAA', 'VVVVxx'),
+(5961, 6876, 1, 1, 1, 1, 61, 961, 1961, 961, 5961, 122, 123, 'HVAAAA', 'MEKAAA', 'AAAAxx'),
+(8801, 6877, 1, 1, 1, 1, 1, 801, 801, 3801, 8801, 2, 3, 'NAAAAA', 'NEKAAA', 'HHHHxx'),
+(4860, 6878, 0, 0, 0, 0, 60, 860, 860, 4860, 4860, 120, 121, 'YEAAAA', 'OEKAAA', 'OOOOxx'),
+(2214, 6879, 0, 2, 4, 14, 14, 214, 214, 2214, 2214, 28, 29, 'EHAAAA', 'PEKAAA', 'VVVVxx'),
+(1735, 6880, 1, 3, 5, 15, 35, 735, 1735, 1735, 1735, 70, 71, 'TOAAAA', 'QEKAAA', 'AAAAxx'),
+(578, 6881, 0, 2, 8, 18, 78, 578, 578, 578, 578, 156, 157, 'GWAAAA', 'REKAAA', 'HHHHxx'),
+(7853, 6882, 1, 1, 3, 13, 53, 853, 1853, 2853, 7853, 106, 107, 'BQAAAA', 'SEKAAA', 'OOOOxx'),
+(2215, 6883, 1, 3, 5, 15, 15, 215, 215, 2215, 2215, 30, 31, 'FHAAAA', 'TEKAAA', 'VVVVxx'),
+(4704, 6884, 0, 0, 4, 4, 4, 704, 704, 4704, 4704, 8, 9, 'YYAAAA', 'UEKAAA', 'AAAAxx'),
+(9379, 6885, 1, 3, 9, 19, 79, 379, 1379, 4379, 9379, 158, 159, 'TWAAAA', 'VEKAAA', 'HHHHxx'),
+(9745, 6886, 1, 1, 5, 5, 45, 745, 1745, 4745, 9745, 90, 91, 'VKAAAA', 'WEKAAA', 'OOOOxx'),
+(5636, 6887, 0, 0, 6, 16, 36, 636, 1636, 636, 5636, 72, 73, 'UIAAAA', 'XEKAAA', 'VVVVxx'),
+(4548, 6888, 0, 0, 8, 8, 48, 548, 548, 4548, 4548, 96, 97, 'YSAAAA', 'YEKAAA', 'AAAAxx'),
+(6537, 6889, 1, 1, 7, 17, 37, 537, 537, 1537, 6537, 74, 75, 'LRAAAA', 'ZEKAAA', 'HHHHxx'),
+(7748, 6890, 0, 0, 8, 8, 48, 748, 1748, 2748, 7748, 96, 97, 'AMAAAA', 'AFKAAA', 'OOOOxx'),
+(687, 6891, 1, 3, 7, 7, 87, 687, 687, 687, 687, 174, 175, 'LAAAAA', 'BFKAAA', 'VVVVxx'),
+(1243, 6892, 1, 3, 3, 3, 43, 243, 1243, 1243, 1243, 86, 87, 'VVAAAA', 'CFKAAA', 'AAAAxx'),
+(852, 6893, 0, 0, 2, 12, 52, 852, 852, 852, 852, 104, 105, 'UGAAAA', 'DFKAAA', 'HHHHxx'),
+(785, 6894, 1, 1, 5, 5, 85, 785, 785, 785, 785, 170, 171, 'FEAAAA', 'EFKAAA', 'OOOOxx'),
+(2002, 6895, 0, 2, 2, 2, 2, 2, 2, 2002, 2002, 4, 5, 'AZAAAA', 'FFKAAA', 'VVVVxx'),
+(2748, 6896, 0, 0, 8, 8, 48, 748, 748, 2748, 2748, 96, 97, 'SBAAAA', 'GFKAAA', 'AAAAxx'),
+(6075, 6897, 1, 3, 5, 15, 75, 75, 75, 1075, 6075, 150, 151, 'RZAAAA', 'HFKAAA', 'HHHHxx'),
+(7029, 6898, 1, 1, 9, 9, 29, 29, 1029, 2029, 7029, 58, 59, 'JKAAAA', 'IFKAAA', 'OOOOxx'),
+(7474, 6899, 0, 2, 4, 14, 74, 474, 1474, 2474, 7474, 148, 149, 'MBAAAA', 'JFKAAA', 'VVVVxx'),
+(7755, 6900, 1, 3, 5, 15, 55, 755, 1755, 2755, 7755, 110, 111, 'HMAAAA', 'KFKAAA', 'AAAAxx'),
+(1456, 6901, 0, 0, 6, 16, 56, 456, 1456, 1456, 1456, 112, 113, 'AEAAAA', 'LFKAAA', 'HHHHxx'),
+(2808, 6902, 0, 0, 8, 8, 8, 808, 808, 2808, 2808, 16, 17, 'AEAAAA', 'MFKAAA', 'OOOOxx'),
+(4089, 6903, 1, 1, 9, 9, 89, 89, 89, 4089, 4089, 178, 179, 'HBAAAA', 'NFKAAA', 'VVVVxx'),
+(4718, 6904, 0, 2, 8, 18, 18, 718, 718, 4718, 4718, 36, 37, 'MZAAAA', 'OFKAAA', 'AAAAxx'),
+(910, 6905, 0, 2, 0, 10, 10, 910, 910, 910, 910, 20, 21, 'AJAAAA', 'PFKAAA', 'HHHHxx'),
+(2868, 6906, 0, 0, 8, 8, 68, 868, 868, 2868, 2868, 136, 137, 'IGAAAA', 'QFKAAA', 'OOOOxx'),
+(2103, 6907, 1, 3, 3, 3, 3, 103, 103, 2103, 2103, 6, 7, 'XCAAAA', 'RFKAAA', 'VVVVxx'),
+(2407, 6908, 1, 3, 7, 7, 7, 407, 407, 2407, 2407, 14, 15, 'POAAAA', 'SFKAAA', 'AAAAxx'),
+(4353, 6909, 1, 1, 3, 13, 53, 353, 353, 4353, 4353, 106, 107, 'LLAAAA', 'TFKAAA', 'HHHHxx'),
+(7988, 6910, 0, 0, 8, 8, 88, 988, 1988, 2988, 7988, 176, 177, 'GVAAAA', 'UFKAAA', 'OOOOxx'),
+(2750, 6911, 0, 2, 0, 10, 50, 750, 750, 2750, 2750, 100, 101, 'UBAAAA', 'VFKAAA', 'VVVVxx'),
+(2006, 6912, 0, 2, 6, 6, 6, 6, 6, 2006, 2006, 12, 13, 'EZAAAA', 'WFKAAA', 'AAAAxx'),
+(4617, 6913, 1, 1, 7, 17, 17, 617, 617, 4617, 4617, 34, 35, 'PVAAAA', 'XFKAAA', 'HHHHxx'),
+(1251, 6914, 1, 3, 1, 11, 51, 251, 1251, 1251, 1251, 102, 103, 'DWAAAA', 'YFKAAA', 'OOOOxx'),
+(4590, 6915, 0, 2, 0, 10, 90, 590, 590, 4590, 4590, 180, 181, 'OUAAAA', 'ZFKAAA', 'VVVVxx'),
+(1144, 6916, 0, 0, 4, 4, 44, 144, 1144, 1144, 1144, 88, 89, 'ASAAAA', 'AGKAAA', 'AAAAxx'),
+(7131, 6917, 1, 3, 1, 11, 31, 131, 1131, 2131, 7131, 62, 63, 'HOAAAA', 'BGKAAA', 'HHHHxx'),
+(95, 6918, 1, 3, 5, 15, 95, 95, 95, 95, 95, 190, 191, 'RDAAAA', 'CGKAAA', 'OOOOxx'),
+(4827, 6919, 1, 3, 7, 7, 27, 827, 827, 4827, 4827, 54, 55, 'RDAAAA', 'DGKAAA', 'VVVVxx'),
+(4307, 6920, 1, 3, 7, 7, 7, 307, 307, 4307, 4307, 14, 15, 'RJAAAA', 'EGKAAA', 'AAAAxx'),
+(1505, 6921, 1, 1, 5, 5, 5, 505, 1505, 1505, 1505, 10, 11, 'XFAAAA', 'FGKAAA', 'HHHHxx'),
+(8191, 6922, 1, 3, 1, 11, 91, 191, 191, 3191, 8191, 182, 183, 'BDAAAA', 'GGKAAA', 'OOOOxx'),
+(5037, 6923, 1, 1, 7, 17, 37, 37, 1037, 37, 5037, 74, 75, 'TLAAAA', 'HGKAAA', 'VVVVxx'),
+(7363, 6924, 1, 3, 3, 3, 63, 363, 1363, 2363, 7363, 126, 127, 'FXAAAA', 'IGKAAA', 'AAAAxx'),
+(8427, 6925, 1, 3, 7, 7, 27, 427, 427, 3427, 8427, 54, 55, 'DMAAAA', 'JGKAAA', 'HHHHxx'),
+(5231, 6926, 1, 3, 1, 11, 31, 231, 1231, 231, 5231, 62, 63, 'FTAAAA', 'KGKAAA', 'OOOOxx'),
+(2943, 6927, 1, 3, 3, 3, 43, 943, 943, 2943, 2943, 86, 87, 'FJAAAA', 'LGKAAA', 'VVVVxx'),
+(4624, 6928, 0, 0, 4, 4, 24, 624, 624, 4624, 4624, 48, 49, 'WVAAAA', 'MGKAAA', 'AAAAxx'),
+(2020, 6929, 0, 0, 0, 0, 20, 20, 20, 2020, 2020, 40, 41, 'SZAAAA', 'NGKAAA', 'HHHHxx'),
+(6155, 6930, 1, 3, 5, 15, 55, 155, 155, 1155, 6155, 110, 111, 'TCAAAA', 'OGKAAA', 'OOOOxx'),
+(4381, 6931, 1, 1, 1, 1, 81, 381, 381, 4381, 4381, 162, 163, 'NMAAAA', 'PGKAAA', 'VVVVxx'),
+(1057, 6932, 1, 1, 7, 17, 57, 57, 1057, 1057, 1057, 114, 115, 'ROAAAA', 'QGKAAA', 'AAAAxx'),
+(9010, 6933, 0, 2, 0, 10, 10, 10, 1010, 4010, 9010, 20, 21, 'OIAAAA', 'RGKAAA', 'HHHHxx'),
+(4947, 6934, 1, 3, 7, 7, 47, 947, 947, 4947, 4947, 94, 95, 'HIAAAA', 'SGKAAA', 'OOOOxx'),
+(335, 6935, 1, 3, 5, 15, 35, 335, 335, 335, 335, 70, 71, 'XMAAAA', 'TGKAAA', 'VVVVxx'),
+(6890, 6936, 0, 2, 0, 10, 90, 890, 890, 1890, 6890, 180, 181, 'AFAAAA', 'UGKAAA', 'AAAAxx'),
+(5070, 6937, 0, 2, 0, 10, 70, 70, 1070, 70, 5070, 140, 141, 'ANAAAA', 'VGKAAA', 'HHHHxx'),
+(5270, 6938, 0, 2, 0, 10, 70, 270, 1270, 270, 5270, 140, 141, 'SUAAAA', 'WGKAAA', 'OOOOxx'),
+(8657, 6939, 1, 1, 7, 17, 57, 657, 657, 3657, 8657, 114, 115, 'ZUAAAA', 'XGKAAA', 'VVVVxx'),
+(7625, 6940, 1, 1, 5, 5, 25, 625, 1625, 2625, 7625, 50, 51, 'HHAAAA', 'YGKAAA', 'AAAAxx'),
+(5759, 6941, 1, 3, 9, 19, 59, 759, 1759, 759, 5759, 118, 119, 'NNAAAA', 'ZGKAAA', 'HHHHxx'),
+(9483, 6942, 1, 3, 3, 3, 83, 483, 1483, 4483, 9483, 166, 167, 'TAAAAA', 'AHKAAA', 'OOOOxx'),
+(8304, 6943, 0, 0, 4, 4, 4, 304, 304, 3304, 8304, 8, 9, 'KHAAAA', 'BHKAAA', 'VVVVxx'),
+(296, 6944, 0, 0, 6, 16, 96, 296, 296, 296, 296, 192, 193, 'KLAAAA', 'CHKAAA', 'AAAAxx'),
+(1176, 6945, 0, 0, 6, 16, 76, 176, 1176, 1176, 1176, 152, 153, 'GTAAAA', 'DHKAAA', 'HHHHxx'),
+(2069, 6946, 1, 1, 9, 9, 69, 69, 69, 2069, 2069, 138, 139, 'PBAAAA', 'EHKAAA', 'OOOOxx'),
+(1531, 6947, 1, 3, 1, 11, 31, 531, 1531, 1531, 1531, 62, 63, 'XGAAAA', 'FHKAAA', 'VVVVxx'),
+(5329, 6948, 1, 1, 9, 9, 29, 329, 1329, 329, 5329, 58, 59, 'ZWAAAA', 'GHKAAA', 'AAAAxx'),
+(3702, 6949, 0, 2, 2, 2, 2, 702, 1702, 3702, 3702, 4, 5, 'KMAAAA', 'HHKAAA', 'HHHHxx'),
+(6520, 6950, 0, 0, 0, 0, 20, 520, 520, 1520, 6520, 40, 41, 'UQAAAA', 'IHKAAA', 'OOOOxx'),
+(7310, 6951, 0, 2, 0, 10, 10, 310, 1310, 2310, 7310, 20, 21, 'EVAAAA', 'JHKAAA', 'VVVVxx'),
+(1175, 6952, 1, 3, 5, 15, 75, 175, 1175, 1175, 1175, 150, 151, 'FTAAAA', 'KHKAAA', 'AAAAxx'),
+(9107, 6953, 1, 3, 7, 7, 7, 107, 1107, 4107, 9107, 14, 15, 'HMAAAA', 'LHKAAA', 'HHHHxx'),
+(2737, 6954, 1, 1, 7, 17, 37, 737, 737, 2737, 2737, 74, 75, 'HBAAAA', 'MHKAAA', 'OOOOxx'),
+(3437, 6955, 1, 1, 7, 17, 37, 437, 1437, 3437, 3437, 74, 75, 'FCAAAA', 'NHKAAA', 'VVVVxx'),
+(281, 6956, 1, 1, 1, 1, 81, 281, 281, 281, 281, 162, 163, 'VKAAAA', 'OHKAAA', 'AAAAxx'),
+(6676, 6957, 0, 0, 6, 16, 76, 676, 676, 1676, 6676, 152, 153, 'UWAAAA', 'PHKAAA', 'HHHHxx'),
+(145, 6958, 1, 1, 5, 5, 45, 145, 145, 145, 145, 90, 91, 'PFAAAA', 'QHKAAA', 'OOOOxx'),
+(3172, 6959, 0, 0, 2, 12, 72, 172, 1172, 3172, 3172, 144, 145, 'ASAAAA', 'RHKAAA', 'VVVVxx'),
+(4049, 6960, 1, 1, 9, 9, 49, 49, 49, 4049, 4049, 98, 99, 'TZAAAA', 'SHKAAA', 'AAAAxx'),
+(6042, 6961, 0, 2, 2, 2, 42, 42, 42, 1042, 6042, 84, 85, 'KYAAAA', 'THKAAA', 'HHHHxx'),
+(9122, 6962, 0, 2, 2, 2, 22, 122, 1122, 4122, 9122, 44, 45, 'WMAAAA', 'UHKAAA', 'OOOOxx'),
+(7244, 6963, 0, 0, 4, 4, 44, 244, 1244, 2244, 7244, 88, 89, 'QSAAAA', 'VHKAAA', 'VVVVxx'),
+(5361, 6964, 1, 1, 1, 1, 61, 361, 1361, 361, 5361, 122, 123, 'FYAAAA', 'WHKAAA', 'AAAAxx'),
+(8647, 6965, 1, 3, 7, 7, 47, 647, 647, 3647, 8647, 94, 95, 'PUAAAA', 'XHKAAA', 'HHHHxx'),
+(7956, 6966, 0, 0, 6, 16, 56, 956, 1956, 2956, 7956, 112, 113, 'AUAAAA', 'YHKAAA', 'OOOOxx'),
+(7812, 6967, 0, 0, 2, 12, 12, 812, 1812, 2812, 7812, 24, 25, 'MOAAAA', 'ZHKAAA', 'VVVVxx'),
+(570, 6968, 0, 2, 0, 10, 70, 570, 570, 570, 570, 140, 141, 'YVAAAA', 'AIKAAA', 'AAAAxx'),
+(4115, 6969, 1, 3, 5, 15, 15, 115, 115, 4115, 4115, 30, 31, 'HCAAAA', 'BIKAAA', 'HHHHxx'),
+(1856, 6970, 0, 0, 6, 16, 56, 856, 1856, 1856, 1856, 112, 113, 'KTAAAA', 'CIKAAA', 'OOOOxx'),
+(9582, 6971, 0, 2, 2, 2, 82, 582, 1582, 4582, 9582, 164, 165, 'OEAAAA', 'DIKAAA', 'VVVVxx'),
+(2025, 6972, 1, 1, 5, 5, 25, 25, 25, 2025, 2025, 50, 51, 'XZAAAA', 'EIKAAA', 'AAAAxx'),
+(986, 6973, 0, 2, 6, 6, 86, 986, 986, 986, 986, 172, 173, 'YLAAAA', 'FIKAAA', 'HHHHxx'),
+(8358, 6974, 0, 2, 8, 18, 58, 358, 358, 3358, 8358, 116, 117, 'MJAAAA', 'GIKAAA', 'OOOOxx'),
+(510, 6975, 0, 2, 0, 10, 10, 510, 510, 510, 510, 20, 21, 'QTAAAA', 'HIKAAA', 'VVVVxx'),
+(6101, 6976, 1, 1, 1, 1, 1, 101, 101, 1101, 6101, 2, 3, 'RAAAAA', 'IIKAAA', 'AAAAxx'),
+(4167, 6977, 1, 3, 7, 7, 67, 167, 167, 4167, 4167, 134, 135, 'HEAAAA', 'JIKAAA', 'HHHHxx'),
+(6139, 6978, 1, 3, 9, 19, 39, 139, 139, 1139, 6139, 78, 79, 'DCAAAA', 'KIKAAA', 'OOOOxx'),
+(6912, 6979, 0, 0, 2, 12, 12, 912, 912, 1912, 6912, 24, 25, 'WFAAAA', 'LIKAAA', 'VVVVxx'),
+(339, 6980, 1, 3, 9, 19, 39, 339, 339, 339, 339, 78, 79, 'BNAAAA', 'MIKAAA', 'AAAAxx'),
+(8759, 6981, 1, 3, 9, 19, 59, 759, 759, 3759, 8759, 118, 119, 'XYAAAA', 'NIKAAA', 'HHHHxx'),
+(246, 6982, 0, 2, 6, 6, 46, 246, 246, 246, 246, 92, 93, 'MJAAAA', 'OIKAAA', 'OOOOxx'),
+(2831, 6983, 1, 3, 1, 11, 31, 831, 831, 2831, 2831, 62, 63, 'XEAAAA', 'PIKAAA', 'VVVVxx'),
+(2327, 6984, 1, 3, 7, 7, 27, 327, 327, 2327, 2327, 54, 55, 'NLAAAA', 'QIKAAA', 'AAAAxx'),
+(7001, 6985, 1, 1, 1, 1, 1, 1, 1001, 2001, 7001, 2, 3, 'HJAAAA', 'RIKAAA', 'HHHHxx'),
+(4398, 6986, 0, 2, 8, 18, 98, 398, 398, 4398, 4398, 196, 197, 'ENAAAA', 'SIKAAA', 'OOOOxx'),
+(1495, 6987, 1, 3, 5, 15, 95, 495, 1495, 1495, 1495, 190, 191, 'NFAAAA', 'TIKAAA', 'VVVVxx'),
+(8522, 6988, 0, 2, 2, 2, 22, 522, 522, 3522, 8522, 44, 45, 'UPAAAA', 'UIKAAA', 'AAAAxx'),
+(7090, 6989, 0, 2, 0, 10, 90, 90, 1090, 2090, 7090, 180, 181, 'SMAAAA', 'VIKAAA', 'HHHHxx'),
+(8457, 6990, 1, 1, 7, 17, 57, 457, 457, 3457, 8457, 114, 115, 'HNAAAA', 'WIKAAA', 'OOOOxx'),
+(4238, 6991, 0, 2, 8, 18, 38, 238, 238, 4238, 4238, 76, 77, 'AHAAAA', 'XIKAAA', 'VVVVxx'),
+(6791, 6992, 1, 3, 1, 11, 91, 791, 791, 1791, 6791, 182, 183, 'FBAAAA', 'YIKAAA', 'AAAAxx'),
+(1342, 6993, 0, 2, 2, 2, 42, 342, 1342, 1342, 1342, 84, 85, 'QZAAAA', 'ZIKAAA', 'HHHHxx'),
+(4580, 6994, 0, 0, 0, 0, 80, 580, 580, 4580, 4580, 160, 161, 'EUAAAA', 'AJKAAA', 'OOOOxx'),
+(1475, 6995, 1, 3, 5, 15, 75, 475, 1475, 1475, 1475, 150, 151, 'TEAAAA', 'BJKAAA', 'VVVVxx'),
+(9184, 6996, 0, 0, 4, 4, 84, 184, 1184, 4184, 9184, 168, 169, 'GPAAAA', 'CJKAAA', 'AAAAxx'),
+(1189, 6997, 1, 1, 9, 9, 89, 189, 1189, 1189, 1189, 178, 179, 'TTAAAA', 'DJKAAA', 'HHHHxx'),
+(638, 6998, 0, 2, 8, 18, 38, 638, 638, 638, 638, 76, 77, 'OYAAAA', 'EJKAAA', 'OOOOxx'),
+(5867, 6999, 1, 3, 7, 7, 67, 867, 1867, 867, 5867, 134, 135, 'RRAAAA', 'FJKAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(9911, 7000, 1, 3, 1, 11, 11, 911, 1911, 4911, 9911, 22, 23, 'FRAAAA', 'GJKAAA', 'AAAAxx'),
+(8147, 7001, 1, 3, 7, 7, 47, 147, 147, 3147, 8147, 94, 95, 'JBAAAA', 'HJKAAA', 'HHHHxx'),
+(4492, 7002, 0, 0, 2, 12, 92, 492, 492, 4492, 4492, 184, 185, 'UQAAAA', 'IJKAAA', 'OOOOxx'),
+(385, 7003, 1, 1, 5, 5, 85, 385, 385, 385, 385, 170, 171, 'VOAAAA', 'JJKAAA', 'VVVVxx'),
+(5235, 7004, 1, 3, 5, 15, 35, 235, 1235, 235, 5235, 70, 71, 'JTAAAA', 'KJKAAA', 'AAAAxx'),
+(4812, 7005, 0, 0, 2, 12, 12, 812, 812, 4812, 4812, 24, 25, 'CDAAAA', 'LJKAAA', 'HHHHxx'),
+(9807, 7006, 1, 3, 7, 7, 7, 807, 1807, 4807, 9807, 14, 15, 'FNAAAA', 'MJKAAA', 'OOOOxx'),
+(9588, 7007, 0, 0, 8, 8, 88, 588, 1588, 4588, 9588, 176, 177, 'UEAAAA', 'NJKAAA', 'VVVVxx'),
+(9832, 7008, 0, 0, 2, 12, 32, 832, 1832, 4832, 9832, 64, 65, 'EOAAAA', 'OJKAAA', 'AAAAxx'),
+(3757, 7009, 1, 1, 7, 17, 57, 757, 1757, 3757, 3757, 114, 115, 'NOAAAA', 'PJKAAA', 'HHHHxx'),
+(9703, 7010, 1, 3, 3, 3, 3, 703, 1703, 4703, 9703, 6, 7, 'FJAAAA', 'QJKAAA', 'OOOOxx'),
+(1022, 7011, 0, 2, 2, 2, 22, 22, 1022, 1022, 1022, 44, 45, 'INAAAA', 'RJKAAA', 'VVVVxx'),
+(5165, 7012, 1, 1, 5, 5, 65, 165, 1165, 165, 5165, 130, 131, 'RQAAAA', 'SJKAAA', 'AAAAxx'),
+(7129, 7013, 1, 1, 9, 9, 29, 129, 1129, 2129, 7129, 58, 59, 'FOAAAA', 'TJKAAA', 'HHHHxx'),
+(4164, 7014, 0, 0, 4, 4, 64, 164, 164, 4164, 4164, 128, 129, 'EEAAAA', 'UJKAAA', 'OOOOxx'),
+(7239, 7015, 1, 3, 9, 19, 39, 239, 1239, 2239, 7239, 78, 79, 'LSAAAA', 'VJKAAA', 'VVVVxx'),
+(523, 7016, 1, 3, 3, 3, 23, 523, 523, 523, 523, 46, 47, 'DUAAAA', 'WJKAAA', 'AAAAxx'),
+(4670, 7017, 0, 2, 0, 10, 70, 670, 670, 4670, 4670, 140, 141, 'QXAAAA', 'XJKAAA', 'HHHHxx'),
+(8503, 7018, 1, 3, 3, 3, 3, 503, 503, 3503, 8503, 6, 7, 'BPAAAA', 'YJKAAA', 'OOOOxx'),
+(714, 7019, 0, 2, 4, 14, 14, 714, 714, 714, 714, 28, 29, 'MBAAAA', 'ZJKAAA', 'VVVVxx'),
+(1350, 7020, 0, 2, 0, 10, 50, 350, 1350, 1350, 1350, 100, 101, 'YZAAAA', 'AKKAAA', 'AAAAxx'),
+(8318, 7021, 0, 2, 8, 18, 18, 318, 318, 3318, 8318, 36, 37, 'YHAAAA', 'BKKAAA', 'HHHHxx'),
+(1834, 7022, 0, 2, 4, 14, 34, 834, 1834, 1834, 1834, 68, 69, 'OSAAAA', 'CKKAAA', 'OOOOxx'),
+(4306, 7023, 0, 2, 6, 6, 6, 306, 306, 4306, 4306, 12, 13, 'QJAAAA', 'DKKAAA', 'VVVVxx'),
+(8543, 7024, 1, 3, 3, 3, 43, 543, 543, 3543, 8543, 86, 87, 'PQAAAA', 'EKKAAA', 'AAAAxx'),
+(9397, 7025, 1, 1, 7, 17, 97, 397, 1397, 4397, 9397, 194, 195, 'LXAAAA', 'FKKAAA', 'HHHHxx'),
+(3145, 7026, 1, 1, 5, 5, 45, 145, 1145, 3145, 3145, 90, 91, 'ZQAAAA', 'GKKAAA', 'OOOOxx'),
+(3942, 7027, 0, 2, 2, 2, 42, 942, 1942, 3942, 3942, 84, 85, 'QVAAAA', 'HKKAAA', 'VVVVxx'),
+(8583, 7028, 1, 3, 3, 3, 83, 583, 583, 3583, 8583, 166, 167, 'DSAAAA', 'IKKAAA', 'AAAAxx'),
+(8073, 7029, 1, 1, 3, 13, 73, 73, 73, 3073, 8073, 146, 147, 'NYAAAA', 'JKKAAA', 'HHHHxx'),
+(4940, 7030, 0, 0, 0, 0, 40, 940, 940, 4940, 4940, 80, 81, 'AIAAAA', 'KKKAAA', 'OOOOxx'),
+(9573, 7031, 1, 1, 3, 13, 73, 573, 1573, 4573, 9573, 146, 147, 'FEAAAA', 'LKKAAA', 'VVVVxx'),
+(5325, 7032, 1, 1, 5, 5, 25, 325, 1325, 325, 5325, 50, 51, 'VWAAAA', 'MKKAAA', 'AAAAxx'),
+(1833, 7033, 1, 1, 3, 13, 33, 833, 1833, 1833, 1833, 66, 67, 'NSAAAA', 'NKKAAA', 'HHHHxx'),
+(1337, 7034, 1, 1, 7, 17, 37, 337, 1337, 1337, 1337, 74, 75, 'LZAAAA', 'OKKAAA', 'OOOOxx'),
+(9749, 7035, 1, 1, 9, 9, 49, 749, 1749, 4749, 9749, 98, 99, 'ZKAAAA', 'PKKAAA', 'VVVVxx'),
+(7505, 7036, 1, 1, 5, 5, 5, 505, 1505, 2505, 7505, 10, 11, 'RCAAAA', 'QKKAAA', 'AAAAxx'),
+(9731, 7037, 1, 3, 1, 11, 31, 731, 1731, 4731, 9731, 62, 63, 'HKAAAA', 'RKKAAA', 'HHHHxx'),
+(4098, 7038, 0, 2, 8, 18, 98, 98, 98, 4098, 4098, 196, 197, 'QBAAAA', 'SKKAAA', 'OOOOxx'),
+(1418, 7039, 0, 2, 8, 18, 18, 418, 1418, 1418, 1418, 36, 37, 'OCAAAA', 'TKKAAA', 'VVVVxx'),
+(63, 7040, 1, 3, 3, 3, 63, 63, 63, 63, 63, 126, 127, 'LCAAAA', 'UKKAAA', 'AAAAxx'),
+(9889, 7041, 1, 1, 9, 9, 89, 889, 1889, 4889, 9889, 178, 179, 'JQAAAA', 'VKKAAA', 'HHHHxx'),
+(2871, 7042, 1, 3, 1, 11, 71, 871, 871, 2871, 2871, 142, 143, 'LGAAAA', 'WKKAAA', 'OOOOxx'),
+(1003, 7043, 1, 3, 3, 3, 3, 3, 1003, 1003, 1003, 6, 7, 'PMAAAA', 'XKKAAA', 'VVVVxx'),
+(8796, 7044, 0, 0, 6, 16, 96, 796, 796, 3796, 8796, 192, 193, 'IAAAAA', 'YKKAAA', 'AAAAxx'),
+(22, 7045, 0, 2, 2, 2, 22, 22, 22, 22, 22, 44, 45, 'WAAAAA', 'ZKKAAA', 'HHHHxx'),
+(8244, 7046, 0, 0, 4, 4, 44, 244, 244, 3244, 8244, 88, 89, 'CFAAAA', 'ALKAAA', 'OOOOxx'),
+(2282, 7047, 0, 2, 2, 2, 82, 282, 282, 2282, 2282, 164, 165, 'UJAAAA', 'BLKAAA', 'VVVVxx'),
+(3487, 7048, 1, 3, 7, 7, 87, 487, 1487, 3487, 3487, 174, 175, 'DEAAAA', 'CLKAAA', 'AAAAxx'),
+(8633, 7049, 1, 1, 3, 13, 33, 633, 633, 3633, 8633, 66, 67, 'BUAAAA', 'DLKAAA', 'HHHHxx'),
+(6418, 7050, 0, 2, 8, 18, 18, 418, 418, 1418, 6418, 36, 37, 'WMAAAA', 'ELKAAA', 'OOOOxx'),
+(4682, 7051, 0, 2, 2, 2, 82, 682, 682, 4682, 4682, 164, 165, 'CYAAAA', 'FLKAAA', 'VVVVxx'),
+(4103, 7052, 1, 3, 3, 3, 3, 103, 103, 4103, 4103, 6, 7, 'VBAAAA', 'GLKAAA', 'AAAAxx'),
+(6256, 7053, 0, 0, 6, 16, 56, 256, 256, 1256, 6256, 112, 113, 'QGAAAA', 'HLKAAA', 'HHHHxx'),
+(4040, 7054, 0, 0, 0, 0, 40, 40, 40, 4040, 4040, 80, 81, 'KZAAAA', 'ILKAAA', 'OOOOxx'),
+(9342, 7055, 0, 2, 2, 2, 42, 342, 1342, 4342, 9342, 84, 85, 'IVAAAA', 'JLKAAA', 'VVVVxx'),
+(9969, 7056, 1, 1, 9, 9, 69, 969, 1969, 4969, 9969, 138, 139, 'LTAAAA', 'KLKAAA', 'AAAAxx'),
+(223, 7057, 1, 3, 3, 3, 23, 223, 223, 223, 223, 46, 47, 'PIAAAA', 'LLKAAA', 'HHHHxx'),
+(4593, 7058, 1, 1, 3, 13, 93, 593, 593, 4593, 4593, 186, 187, 'RUAAAA', 'MLKAAA', 'OOOOxx'),
+(44, 7059, 0, 0, 4, 4, 44, 44, 44, 44, 44, 88, 89, 'SBAAAA', 'NLKAAA', 'VVVVxx'),
+(3513, 7060, 1, 1, 3, 13, 13, 513, 1513, 3513, 3513, 26, 27, 'DFAAAA', 'OLKAAA', 'AAAAxx'),
+(5771, 7061, 1, 3, 1, 11, 71, 771, 1771, 771, 5771, 142, 143, 'ZNAAAA', 'PLKAAA', 'HHHHxx'),
+(5083, 7062, 1, 3, 3, 3, 83, 83, 1083, 83, 5083, 166, 167, 'NNAAAA', 'QLKAAA', 'OOOOxx'),
+(3839, 7063, 1, 3, 9, 19, 39, 839, 1839, 3839, 3839, 78, 79, 'RRAAAA', 'RLKAAA', 'VVVVxx'),
+(2986, 7064, 0, 2, 6, 6, 86, 986, 986, 2986, 2986, 172, 173, 'WKAAAA', 'SLKAAA', 'AAAAxx'),
+(2200, 7065, 0, 0, 0, 0, 0, 200, 200, 2200, 2200, 0, 1, 'QGAAAA', 'TLKAAA', 'HHHHxx'),
+(197, 7066, 1, 1, 7, 17, 97, 197, 197, 197, 197, 194, 195, 'PHAAAA', 'ULKAAA', 'OOOOxx'),
+(7455, 7067, 1, 3, 5, 15, 55, 455, 1455, 2455, 7455, 110, 111, 'TAAAAA', 'VLKAAA', 'VVVVxx'),
+(1379, 7068, 1, 3, 9, 19, 79, 379, 1379, 1379, 1379, 158, 159, 'BBAAAA', 'WLKAAA', 'AAAAxx'),
+(4356, 7069, 0, 0, 6, 16, 56, 356, 356, 4356, 4356, 112, 113, 'OLAAAA', 'XLKAAA', 'HHHHxx'),
+(6888, 7070, 0, 0, 8, 8, 88, 888, 888, 1888, 6888, 176, 177, 'YEAAAA', 'YLKAAA', 'OOOOxx'),
+(9139, 7071, 1, 3, 9, 19, 39, 139, 1139, 4139, 9139, 78, 79, 'NNAAAA', 'ZLKAAA', 'VVVVxx'),
+(7682, 7072, 0, 2, 2, 2, 82, 682, 1682, 2682, 7682, 164, 165, 'MJAAAA', 'AMKAAA', 'AAAAxx'),
+(4873, 7073, 1, 1, 3, 13, 73, 873, 873, 4873, 4873, 146, 147, 'LFAAAA', 'BMKAAA', 'HHHHxx'),
+(783, 7074, 1, 3, 3, 3, 83, 783, 783, 783, 783, 166, 167, 'DEAAAA', 'CMKAAA', 'OOOOxx'),
+(6071, 7075, 1, 3, 1, 11, 71, 71, 71, 1071, 6071, 142, 143, 'NZAAAA', 'DMKAAA', 'VVVVxx'),
+(5160, 7076, 0, 0, 0, 0, 60, 160, 1160, 160, 5160, 120, 121, 'MQAAAA', 'EMKAAA', 'AAAAxx'),
+(2291, 7077, 1, 3, 1, 11, 91, 291, 291, 2291, 2291, 182, 183, 'DKAAAA', 'FMKAAA', 'HHHHxx'),
+(187, 7078, 1, 3, 7, 7, 87, 187, 187, 187, 187, 174, 175, 'FHAAAA', 'GMKAAA', 'OOOOxx'),
+(7786, 7079, 0, 2, 6, 6, 86, 786, 1786, 2786, 7786, 172, 173, 'MNAAAA', 'HMKAAA', 'VVVVxx'),
+(3432, 7080, 0, 0, 2, 12, 32, 432, 1432, 3432, 3432, 64, 65, 'ACAAAA', 'IMKAAA', 'AAAAxx'),
+(5450, 7081, 0, 2, 0, 10, 50, 450, 1450, 450, 5450, 100, 101, 'QBAAAA', 'JMKAAA', 'HHHHxx'),
+(2699, 7082, 1, 3, 9, 19, 99, 699, 699, 2699, 2699, 198, 199, 'VZAAAA', 'KMKAAA', 'OOOOxx'),
+(692, 7083, 0, 0, 2, 12, 92, 692, 692, 692, 692, 184, 185, 'QAAAAA', 'LMKAAA', 'VVVVxx'),
+(6081, 7084, 1, 1, 1, 1, 81, 81, 81, 1081, 6081, 162, 163, 'XZAAAA', 'MMKAAA', 'AAAAxx'),
+(4829, 7085, 1, 1, 9, 9, 29, 829, 829, 4829, 4829, 58, 59, 'TDAAAA', 'NMKAAA', 'HHHHxx'),
+(238, 7086, 0, 2, 8, 18, 38, 238, 238, 238, 238, 76, 77, 'EJAAAA', 'OMKAAA', 'OOOOxx'),
+(9100, 7087, 0, 0, 0, 0, 0, 100, 1100, 4100, 9100, 0, 1, 'AMAAAA', 'PMKAAA', 'VVVVxx'),
+(1968, 7088, 0, 0, 8, 8, 68, 968, 1968, 1968, 1968, 136, 137, 'SXAAAA', 'QMKAAA', 'AAAAxx'),
+(1872, 7089, 0, 0, 2, 12, 72, 872, 1872, 1872, 1872, 144, 145, 'AUAAAA', 'RMKAAA', 'HHHHxx'),
+(7051, 7090, 1, 3, 1, 11, 51, 51, 1051, 2051, 7051, 102, 103, 'FLAAAA', 'SMKAAA', 'OOOOxx'),
+(2743, 7091, 1, 3, 3, 3, 43, 743, 743, 2743, 2743, 86, 87, 'NBAAAA', 'TMKAAA', 'VVVVxx'),
+(1237, 7092, 1, 1, 7, 17, 37, 237, 1237, 1237, 1237, 74, 75, 'PVAAAA', 'UMKAAA', 'AAAAxx'),
+(3052, 7093, 0, 0, 2, 12, 52, 52, 1052, 3052, 3052, 104, 105, 'KNAAAA', 'VMKAAA', 'HHHHxx'),
+(8021, 7094, 1, 1, 1, 1, 21, 21, 21, 3021, 8021, 42, 43, 'NWAAAA', 'WMKAAA', 'OOOOxx'),
+(657, 7095, 1, 1, 7, 17, 57, 657, 657, 657, 657, 114, 115, 'HZAAAA', 'XMKAAA', 'VVVVxx'),
+(2236, 7096, 0, 0, 6, 16, 36, 236, 236, 2236, 2236, 72, 73, 'AIAAAA', 'YMKAAA', 'AAAAxx'),
+(7011, 7097, 1, 3, 1, 11, 11, 11, 1011, 2011, 7011, 22, 23, 'RJAAAA', 'ZMKAAA', 'HHHHxx'),
+(4067, 7098, 1, 3, 7, 7, 67, 67, 67, 4067, 4067, 134, 135, 'LAAAAA', 'ANKAAA', 'OOOOxx'),
+(9449, 7099, 1, 1, 9, 9, 49, 449, 1449, 4449, 9449, 98, 99, 'LZAAAA', 'BNKAAA', 'VVVVxx'),
+(7428, 7100, 0, 0, 8, 8, 28, 428, 1428, 2428, 7428, 56, 57, 'SZAAAA', 'CNKAAA', 'AAAAxx'),
+(1272, 7101, 0, 0, 2, 12, 72, 272, 1272, 1272, 1272, 144, 145, 'YWAAAA', 'DNKAAA', 'HHHHxx'),
+(6897, 7102, 1, 1, 7, 17, 97, 897, 897, 1897, 6897, 194, 195, 'HFAAAA', 'ENKAAA', 'OOOOxx'),
+(5839, 7103, 1, 3, 9, 19, 39, 839, 1839, 839, 5839, 78, 79, 'PQAAAA', 'FNKAAA', 'VVVVxx'),
+(6835, 7104, 1, 3, 5, 15, 35, 835, 835, 1835, 6835, 70, 71, 'XCAAAA', 'GNKAAA', 'AAAAxx'),
+(1887, 7105, 1, 3, 7, 7, 87, 887, 1887, 1887, 1887, 174, 175, 'PUAAAA', 'HNKAAA', 'HHHHxx'),
+(1551, 7106, 1, 3, 1, 11, 51, 551, 1551, 1551, 1551, 102, 103, 'RHAAAA', 'INKAAA', 'OOOOxx'),
+(4667, 7107, 1, 3, 7, 7, 67, 667, 667, 4667, 4667, 134, 135, 'NXAAAA', 'JNKAAA', 'VVVVxx'),
+(9603, 7108, 1, 3, 3, 3, 3, 603, 1603, 4603, 9603, 6, 7, 'JFAAAA', 'KNKAAA', 'AAAAxx'),
+(4332, 7109, 0, 0, 2, 12, 32, 332, 332, 4332, 4332, 64, 65, 'QKAAAA', 'LNKAAA', 'HHHHxx'),
+(5681, 7110, 1, 1, 1, 1, 81, 681, 1681, 681, 5681, 162, 163, 'NKAAAA', 'MNKAAA', 'OOOOxx'),
+(8062, 7111, 0, 2, 2, 2, 62, 62, 62, 3062, 8062, 124, 125, 'CYAAAA', 'NNKAAA', 'VVVVxx'),
+(2302, 7112, 0, 2, 2, 2, 2, 302, 302, 2302, 2302, 4, 5, 'OKAAAA', 'ONKAAA', 'AAAAxx'),
+(2825, 7113, 1, 1, 5, 5, 25, 825, 825, 2825, 2825, 50, 51, 'REAAAA', 'PNKAAA', 'HHHHxx'),
+(4527, 7114, 1, 3, 7, 7, 27, 527, 527, 4527, 4527, 54, 55, 'DSAAAA', 'QNKAAA', 'OOOOxx'),
+(4230, 7115, 0, 2, 0, 10, 30, 230, 230, 4230, 4230, 60, 61, 'SGAAAA', 'RNKAAA', 'VVVVxx'),
+(3053, 7116, 1, 1, 3, 13, 53, 53, 1053, 3053, 3053, 106, 107, 'LNAAAA', 'SNKAAA', 'AAAAxx'),
+(983, 7117, 1, 3, 3, 3, 83, 983, 983, 983, 983, 166, 167, 'VLAAAA', 'TNKAAA', 'HHHHxx'),
+(9458, 7118, 0, 2, 8, 18, 58, 458, 1458, 4458, 9458, 116, 117, 'UZAAAA', 'UNKAAA', 'OOOOxx'),
+(4128, 7119, 0, 0, 8, 8, 28, 128, 128, 4128, 4128, 56, 57, 'UCAAAA', 'VNKAAA', 'VVVVxx'),
+(425, 7120, 1, 1, 5, 5, 25, 425, 425, 425, 425, 50, 51, 'JQAAAA', 'WNKAAA', 'AAAAxx'),
+(3911, 7121, 1, 3, 1, 11, 11, 911, 1911, 3911, 3911, 22, 23, 'LUAAAA', 'XNKAAA', 'HHHHxx'),
+(6607, 7122, 1, 3, 7, 7, 7, 607, 607, 1607, 6607, 14, 15, 'DUAAAA', 'YNKAAA', 'OOOOxx'),
+(5431, 7123, 1, 3, 1, 11, 31, 431, 1431, 431, 5431, 62, 63, 'XAAAAA', 'ZNKAAA', 'VVVVxx'),
+(6330, 7124, 0, 2, 0, 10, 30, 330, 330, 1330, 6330, 60, 61, 'MJAAAA', 'AOKAAA', 'AAAAxx'),
+(3592, 7125, 0, 0, 2, 12, 92, 592, 1592, 3592, 3592, 184, 185, 'EIAAAA', 'BOKAAA', 'HHHHxx'),
+(154, 7126, 0, 2, 4, 14, 54, 154, 154, 154, 154, 108, 109, 'YFAAAA', 'COKAAA', 'OOOOxx'),
+(9879, 7127, 1, 3, 9, 19, 79, 879, 1879, 4879, 9879, 158, 159, 'ZPAAAA', 'DOKAAA', 'VVVVxx'),
+(3202, 7128, 0, 2, 2, 2, 2, 202, 1202, 3202, 3202, 4, 5, 'ETAAAA', 'EOKAAA', 'AAAAxx'),
+(3056, 7129, 0, 0, 6, 16, 56, 56, 1056, 3056, 3056, 112, 113, 'ONAAAA', 'FOKAAA', 'HHHHxx'),
+(9890, 7130, 0, 2, 0, 10, 90, 890, 1890, 4890, 9890, 180, 181, 'KQAAAA', 'GOKAAA', 'OOOOxx'),
+(5840, 7131, 0, 0, 0, 0, 40, 840, 1840, 840, 5840, 80, 81, 'QQAAAA', 'HOKAAA', 'VVVVxx'),
+(9804, 7132, 0, 0, 4, 4, 4, 804, 1804, 4804, 9804, 8, 9, 'CNAAAA', 'IOKAAA', 'AAAAxx'),
+(681, 7133, 1, 1, 1, 1, 81, 681, 681, 681, 681, 162, 163, 'FAAAAA', 'JOKAAA', 'HHHHxx'),
+(3443, 7134, 1, 3, 3, 3, 43, 443, 1443, 3443, 3443, 86, 87, 'LCAAAA', 'KOKAAA', 'OOOOxx'),
+(8088, 7135, 0, 0, 8, 8, 88, 88, 88, 3088, 8088, 176, 177, 'CZAAAA', 'LOKAAA', 'VVVVxx'),
+(9447, 7136, 1, 3, 7, 7, 47, 447, 1447, 4447, 9447, 94, 95, 'JZAAAA', 'MOKAAA', 'AAAAxx'),
+(1490, 7137, 0, 2, 0, 10, 90, 490, 1490, 1490, 1490, 180, 181, 'IFAAAA', 'NOKAAA', 'HHHHxx'),
+(3684, 7138, 0, 0, 4, 4, 84, 684, 1684, 3684, 3684, 168, 169, 'SLAAAA', 'OOKAAA', 'OOOOxx'),
+(3113, 7139, 1, 1, 3, 13, 13, 113, 1113, 3113, 3113, 26, 27, 'TPAAAA', 'POKAAA', 'VVVVxx'),
+(9004, 7140, 0, 0, 4, 4, 4, 4, 1004, 4004, 9004, 8, 9, 'IIAAAA', 'QOKAAA', 'AAAAxx'),
+(7147, 7141, 1, 3, 7, 7, 47, 147, 1147, 2147, 7147, 94, 95, 'XOAAAA', 'ROKAAA', 'HHHHxx'),
+(7571, 7142, 1, 3, 1, 11, 71, 571, 1571, 2571, 7571, 142, 143, 'FFAAAA', 'SOKAAA', 'OOOOxx'),
+(5545, 7143, 1, 1, 5, 5, 45, 545, 1545, 545, 5545, 90, 91, 'HFAAAA', 'TOKAAA', 'VVVVxx'),
+(4558, 7144, 0, 2, 8, 18, 58, 558, 558, 4558, 4558, 116, 117, 'ITAAAA', 'UOKAAA', 'AAAAxx'),
+(6206, 7145, 0, 2, 6, 6, 6, 206, 206, 1206, 6206, 12, 13, 'SEAAAA', 'VOKAAA', 'HHHHxx'),
+(5695, 7146, 1, 3, 5, 15, 95, 695, 1695, 695, 5695, 190, 191, 'BLAAAA', 'WOKAAA', 'OOOOxx'),
+(9600, 7147, 0, 0, 0, 0, 0, 600, 1600, 4600, 9600, 0, 1, 'GFAAAA', 'XOKAAA', 'VVVVxx'),
+(5432, 7148, 0, 0, 2, 12, 32, 432, 1432, 432, 5432, 64, 65, 'YAAAAA', 'YOKAAA', 'AAAAxx'),
+(9299, 7149, 1, 3, 9, 19, 99, 299, 1299, 4299, 9299, 198, 199, 'RTAAAA', 'ZOKAAA', 'HHHHxx'),
+(2386, 7150, 0, 2, 6, 6, 86, 386, 386, 2386, 2386, 172, 173, 'UNAAAA', 'APKAAA', 'OOOOxx'),
+(2046, 7151, 0, 2, 6, 6, 46, 46, 46, 2046, 2046, 92, 93, 'SAAAAA', 'BPKAAA', 'VVVVxx'),
+(3293, 7152, 1, 1, 3, 13, 93, 293, 1293, 3293, 3293, 186, 187, 'RWAAAA', 'CPKAAA', 'AAAAxx'),
+(3046, 7153, 0, 2, 6, 6, 46, 46, 1046, 3046, 3046, 92, 93, 'ENAAAA', 'DPKAAA', 'HHHHxx'),
+(214, 7154, 0, 2, 4, 14, 14, 214, 214, 214, 214, 28, 29, 'GIAAAA', 'EPKAAA', 'OOOOxx'),
+(7893, 7155, 1, 1, 3, 13, 93, 893, 1893, 2893, 7893, 186, 187, 'PRAAAA', 'FPKAAA', 'VVVVxx'),
+(891, 7156, 1, 3, 1, 11, 91, 891, 891, 891, 891, 182, 183, 'HIAAAA', 'GPKAAA', 'AAAAxx'),
+(6499, 7157, 1, 3, 9, 19, 99, 499, 499, 1499, 6499, 198, 199, 'ZPAAAA', 'HPKAAA', 'HHHHxx'),
+(5003, 7158, 1, 3, 3, 3, 3, 3, 1003, 3, 5003, 6, 7, 'LKAAAA', 'IPKAAA', 'OOOOxx'),
+(6487, 7159, 1, 3, 7, 7, 87, 487, 487, 1487, 6487, 174, 175, 'NPAAAA', 'JPKAAA', 'VVVVxx'),
+(9403, 7160, 1, 3, 3, 3, 3, 403, 1403, 4403, 9403, 6, 7, 'RXAAAA', 'KPKAAA', 'AAAAxx'),
+(945, 7161, 1, 1, 5, 5, 45, 945, 945, 945, 945, 90, 91, 'JKAAAA', 'LPKAAA', 'HHHHxx'),
+(6713, 7162, 1, 1, 3, 13, 13, 713, 713, 1713, 6713, 26, 27, 'FYAAAA', 'MPKAAA', 'OOOOxx'),
+(9928, 7163, 0, 0, 8, 8, 28, 928, 1928, 4928, 9928, 56, 57, 'WRAAAA', 'NPKAAA', 'VVVVxx'),
+(8585, 7164, 1, 1, 5, 5, 85, 585, 585, 3585, 8585, 170, 171, 'FSAAAA', 'OPKAAA', 'AAAAxx'),
+(4004, 7165, 0, 0, 4, 4, 4, 4, 4, 4004, 4004, 8, 9, 'AYAAAA', 'PPKAAA', 'HHHHxx'),
+(2528, 7166, 0, 0, 8, 8, 28, 528, 528, 2528, 2528, 56, 57, 'GTAAAA', 'QPKAAA', 'OOOOxx'),
+(3350, 7167, 0, 2, 0, 10, 50, 350, 1350, 3350, 3350, 100, 101, 'WYAAAA', 'RPKAAA', 'VVVVxx'),
+(2160, 7168, 0, 0, 0, 0, 60, 160, 160, 2160, 2160, 120, 121, 'CFAAAA', 'SPKAAA', 'AAAAxx'),
+(1521, 7169, 1, 1, 1, 1, 21, 521, 1521, 1521, 1521, 42, 43, 'NGAAAA', 'TPKAAA', 'HHHHxx'),
+(5660, 7170, 0, 0, 0, 0, 60, 660, 1660, 660, 5660, 120, 121, 'SJAAAA', 'UPKAAA', 'OOOOxx'),
+(5755, 7171, 1, 3, 5, 15, 55, 755, 1755, 755, 5755, 110, 111, 'JNAAAA', 'VPKAAA', 'VVVVxx'),
+(7614, 7172, 0, 2, 4, 14, 14, 614, 1614, 2614, 7614, 28, 29, 'WGAAAA', 'WPKAAA', 'AAAAxx'),
+(3121, 7173, 1, 1, 1, 1, 21, 121, 1121, 3121, 3121, 42, 43, 'BQAAAA', 'XPKAAA', 'HHHHxx'),
+(2735, 7174, 1, 3, 5, 15, 35, 735, 735, 2735, 2735, 70, 71, 'FBAAAA', 'YPKAAA', 'OOOOxx'),
+(7506, 7175, 0, 2, 6, 6, 6, 506, 1506, 2506, 7506, 12, 13, 'SCAAAA', 'ZPKAAA', 'VVVVxx'),
+(2693, 7176, 1, 1, 3, 13, 93, 693, 693, 2693, 2693, 186, 187, 'PZAAAA', 'AQKAAA', 'AAAAxx'),
+(2892, 7177, 0, 0, 2, 12, 92, 892, 892, 2892, 2892, 184, 185, 'GHAAAA', 'BQKAAA', 'HHHHxx'),
+(3310, 7178, 0, 2, 0, 10, 10, 310, 1310, 3310, 3310, 20, 21, 'IXAAAA', 'CQKAAA', 'OOOOxx'),
+(3484, 7179, 0, 0, 4, 4, 84, 484, 1484, 3484, 3484, 168, 169, 'AEAAAA', 'DQKAAA', 'VVVVxx'),
+(9733, 7180, 1, 1, 3, 13, 33, 733, 1733, 4733, 9733, 66, 67, 'JKAAAA', 'EQKAAA', 'AAAAxx'),
+(29, 7181, 1, 1, 9, 9, 29, 29, 29, 29, 29, 58, 59, 'DBAAAA', 'FQKAAA', 'HHHHxx'),
+(9013, 7182, 1, 1, 3, 13, 13, 13, 1013, 4013, 9013, 26, 27, 'RIAAAA', 'GQKAAA', 'OOOOxx'),
+(3847, 7183, 1, 3, 7, 7, 47, 847, 1847, 3847, 3847, 94, 95, 'ZRAAAA', 'HQKAAA', 'VVVVxx'),
+(6724, 7184, 0, 0, 4, 4, 24, 724, 724, 1724, 6724, 48, 49, 'QYAAAA', 'IQKAAA', 'AAAAxx'),
+(2559, 7185, 1, 3, 9, 19, 59, 559, 559, 2559, 2559, 118, 119, 'LUAAAA', 'JQKAAA', 'HHHHxx'),
+(5326, 7186, 0, 2, 6, 6, 26, 326, 1326, 326, 5326, 52, 53, 'WWAAAA', 'KQKAAA', 'OOOOxx'),
+(4802, 7187, 0, 2, 2, 2, 2, 802, 802, 4802, 4802, 4, 5, 'SCAAAA', 'LQKAAA', 'VVVVxx'),
+(131, 7188, 1, 3, 1, 11, 31, 131, 131, 131, 131, 62, 63, 'BFAAAA', 'MQKAAA', 'AAAAxx'),
+(1634, 7189, 0, 2, 4, 14, 34, 634, 1634, 1634, 1634, 68, 69, 'WKAAAA', 'NQKAAA', 'HHHHxx'),
+(919, 7190, 1, 3, 9, 19, 19, 919, 919, 919, 919, 38, 39, 'JJAAAA', 'OQKAAA', 'OOOOxx'),
+(9575, 7191, 1, 3, 5, 15, 75, 575, 1575, 4575, 9575, 150, 151, 'HEAAAA', 'PQKAAA', 'VVVVxx'),
+(1256, 7192, 0, 0, 6, 16, 56, 256, 1256, 1256, 1256, 112, 113, 'IWAAAA', 'QQKAAA', 'AAAAxx'),
+(9428, 7193, 0, 0, 8, 8, 28, 428, 1428, 4428, 9428, 56, 57, 'QYAAAA', 'RQKAAA', 'HHHHxx'),
+(5121, 7194, 1, 1, 1, 1, 21, 121, 1121, 121, 5121, 42, 43, 'ZOAAAA', 'SQKAAA', 'OOOOxx'),
+(6584, 7195, 0, 0, 4, 4, 84, 584, 584, 1584, 6584, 168, 169, 'GTAAAA', 'TQKAAA', 'VVVVxx'),
+(7193, 7196, 1, 1, 3, 13, 93, 193, 1193, 2193, 7193, 186, 187, 'RQAAAA', 'UQKAAA', 'AAAAxx'),
+(4047, 7197, 1, 3, 7, 7, 47, 47, 47, 4047, 4047, 94, 95, 'RZAAAA', 'VQKAAA', 'HHHHxx'),
+(104, 7198, 0, 0, 4, 4, 4, 104, 104, 104, 104, 8, 9, 'AEAAAA', 'WQKAAA', 'OOOOxx'),
+(1527, 7199, 1, 3, 7, 7, 27, 527, 1527, 1527, 1527, 54, 55, 'TGAAAA', 'XQKAAA', 'VVVVxx'),
+(3460, 7200, 0, 0, 0, 0, 60, 460, 1460, 3460, 3460, 120, 121, 'CDAAAA', 'YQKAAA', 'AAAAxx'),
+(8526, 7201, 0, 2, 6, 6, 26, 526, 526, 3526, 8526, 52, 53, 'YPAAAA', 'ZQKAAA', 'HHHHxx'),
+(8959, 7202, 1, 3, 9, 19, 59, 959, 959, 3959, 8959, 118, 119, 'PGAAAA', 'ARKAAA', 'OOOOxx'),
+(3633, 7203, 1, 1, 3, 13, 33, 633, 1633, 3633, 3633, 66, 67, 'TJAAAA', 'BRKAAA', 'VVVVxx'),
+(1799, 7204, 1, 3, 9, 19, 99, 799, 1799, 1799, 1799, 198, 199, 'FRAAAA', 'CRKAAA', 'AAAAxx'),
+(461, 7205, 1, 1, 1, 1, 61, 461, 461, 461, 461, 122, 123, 'TRAAAA', 'DRKAAA', 'HHHHxx'),
+(718, 7206, 0, 2, 8, 18, 18, 718, 718, 718, 718, 36, 37, 'QBAAAA', 'ERKAAA', 'OOOOxx'),
+(3219, 7207, 1, 3, 9, 19, 19, 219, 1219, 3219, 3219, 38, 39, 'VTAAAA', 'FRKAAA', 'VVVVxx'),
+(3494, 7208, 0, 2, 4, 14, 94, 494, 1494, 3494, 3494, 188, 189, 'KEAAAA', 'GRKAAA', 'AAAAxx'),
+(9402, 7209, 0, 2, 2, 2, 2, 402, 1402, 4402, 9402, 4, 5, 'QXAAAA', 'HRKAAA', 'HHHHxx'),
+(7983, 7210, 1, 3, 3, 3, 83, 983, 1983, 2983, 7983, 166, 167, 'BVAAAA', 'IRKAAA', 'OOOOxx'),
+(7919, 7211, 1, 3, 9, 19, 19, 919, 1919, 2919, 7919, 38, 39, 'PSAAAA', 'JRKAAA', 'VVVVxx'),
+(8036, 7212, 0, 0, 6, 16, 36, 36, 36, 3036, 8036, 72, 73, 'CXAAAA', 'KRKAAA', 'AAAAxx'),
+(5164, 7213, 0, 0, 4, 4, 64, 164, 1164, 164, 5164, 128, 129, 'QQAAAA', 'LRKAAA', 'HHHHxx'),
+(4160, 7214, 0, 0, 0, 0, 60, 160, 160, 4160, 4160, 120, 121, 'AEAAAA', 'MRKAAA', 'OOOOxx'),
+(5370, 7215, 0, 2, 0, 10, 70, 370, 1370, 370, 5370, 140, 141, 'OYAAAA', 'NRKAAA', 'VVVVxx'),
+(5347, 7216, 1, 3, 7, 7, 47, 347, 1347, 347, 5347, 94, 95, 'RXAAAA', 'ORKAAA', 'AAAAxx'),
+(7109, 7217, 1, 1, 9, 9, 9, 109, 1109, 2109, 7109, 18, 19, 'LNAAAA', 'PRKAAA', 'HHHHxx'),
+(4826, 7218, 0, 2, 6, 6, 26, 826, 826, 4826, 4826, 52, 53, 'QDAAAA', 'QRKAAA', 'OOOOxx'),
+(1338, 7219, 0, 2, 8, 18, 38, 338, 1338, 1338, 1338, 76, 77, 'MZAAAA', 'RRKAAA', 'VVVVxx'),
+(2711, 7220, 1, 3, 1, 11, 11, 711, 711, 2711, 2711, 22, 23, 'HAAAAA', 'SRKAAA', 'AAAAxx'),
+(6299, 7221, 1, 3, 9, 19, 99, 299, 299, 1299, 6299, 198, 199, 'HIAAAA', 'TRKAAA', 'HHHHxx'),
+(1616, 7222, 0, 0, 6, 16, 16, 616, 1616, 1616, 1616, 32, 33, 'EKAAAA', 'URKAAA', 'OOOOxx'),
+(7519, 7223, 1, 3, 9, 19, 19, 519, 1519, 2519, 7519, 38, 39, 'FDAAAA', 'VRKAAA', 'VVVVxx'),
+(1262, 7224, 0, 2, 2, 2, 62, 262, 1262, 1262, 1262, 124, 125, 'OWAAAA', 'WRKAAA', 'AAAAxx'),
+(7228, 7225, 0, 0, 8, 8, 28, 228, 1228, 2228, 7228, 56, 57, 'ASAAAA', 'XRKAAA', 'HHHHxx'),
+(7892, 7226, 0, 0, 2, 12, 92, 892, 1892, 2892, 7892, 184, 185, 'ORAAAA', 'YRKAAA', 'OOOOxx'),
+(7929, 7227, 1, 1, 9, 9, 29, 929, 1929, 2929, 7929, 58, 59, 'ZSAAAA', 'ZRKAAA', 'VVVVxx'),
+(7705, 7228, 1, 1, 5, 5, 5, 705, 1705, 2705, 7705, 10, 11, 'JKAAAA', 'ASKAAA', 'AAAAxx'),
+(3111, 7229, 1, 3, 1, 11, 11, 111, 1111, 3111, 3111, 22, 23, 'RPAAAA', 'BSKAAA', 'HHHHxx'),
+(3066, 7230, 0, 2, 6, 6, 66, 66, 1066, 3066, 3066, 132, 133, 'YNAAAA', 'CSKAAA', 'OOOOxx'),
+(9559, 7231, 1, 3, 9, 19, 59, 559, 1559, 4559, 9559, 118, 119, 'RDAAAA', 'DSKAAA', 'VVVVxx'),
+(3787, 7232, 1, 3, 7, 7, 87, 787, 1787, 3787, 3787, 174, 175, 'RPAAAA', 'ESKAAA', 'AAAAxx'),
+(8710, 7233, 0, 2, 0, 10, 10, 710, 710, 3710, 8710, 20, 21, 'AXAAAA', 'FSKAAA', 'HHHHxx'),
+(4870, 7234, 0, 2, 0, 10, 70, 870, 870, 4870, 4870, 140, 141, 'IFAAAA', 'GSKAAA', 'OOOOxx'),
+(1883, 7235, 1, 3, 3, 3, 83, 883, 1883, 1883, 1883, 166, 167, 'LUAAAA', 'HSKAAA', 'VVVVxx'),
+(9689, 7236, 1, 1, 9, 9, 89, 689, 1689, 4689, 9689, 178, 179, 'RIAAAA', 'ISKAAA', 'AAAAxx'),
+(9491, 7237, 1, 3, 1, 11, 91, 491, 1491, 4491, 9491, 182, 183, 'BBAAAA', 'JSKAAA', 'HHHHxx'),
+(2035, 7238, 1, 3, 5, 15, 35, 35, 35, 2035, 2035, 70, 71, 'HAAAAA', 'KSKAAA', 'OOOOxx'),
+(655, 7239, 1, 3, 5, 15, 55, 655, 655, 655, 655, 110, 111, 'FZAAAA', 'LSKAAA', 'VVVVxx'),
+(6305, 7240, 1, 1, 5, 5, 5, 305, 305, 1305, 6305, 10, 11, 'NIAAAA', 'MSKAAA', 'AAAAxx'),
+(9423, 7241, 1, 3, 3, 3, 23, 423, 1423, 4423, 9423, 46, 47, 'LYAAAA', 'NSKAAA', 'HHHHxx'),
+(283, 7242, 1, 3, 3, 3, 83, 283, 283, 283, 283, 166, 167, 'XKAAAA', 'OSKAAA', 'OOOOxx'),
+(2607, 7243, 1, 3, 7, 7, 7, 607, 607, 2607, 2607, 14, 15, 'HWAAAA', 'PSKAAA', 'VVVVxx'),
+(7740, 7244, 0, 0, 0, 0, 40, 740, 1740, 2740, 7740, 80, 81, 'SLAAAA', 'QSKAAA', 'AAAAxx'),
+(6956, 7245, 0, 0, 6, 16, 56, 956, 956, 1956, 6956, 112, 113, 'OHAAAA', 'RSKAAA', 'HHHHxx'),
+(884, 7246, 0, 0, 4, 4, 84, 884, 884, 884, 884, 168, 169, 'AIAAAA', 'SSKAAA', 'OOOOxx'),
+(5730, 7247, 0, 2, 0, 10, 30, 730, 1730, 730, 5730, 60, 61, 'KMAAAA', 'TSKAAA', 'VVVVxx'),
+(3438, 7248, 0, 2, 8, 18, 38, 438, 1438, 3438, 3438, 76, 77, 'GCAAAA', 'USKAAA', 'AAAAxx'),
+(3250, 7249, 0, 2, 0, 10, 50, 250, 1250, 3250, 3250, 100, 101, 'AVAAAA', 'VSKAAA', 'HHHHxx'),
+(5470, 7250, 0, 2, 0, 10, 70, 470, 1470, 470, 5470, 140, 141, 'KCAAAA', 'WSKAAA', 'OOOOxx'),
+(2037, 7251, 1, 1, 7, 17, 37, 37, 37, 2037, 2037, 74, 75, 'JAAAAA', 'XSKAAA', 'VVVVxx'),
+(6593, 7252, 1, 1, 3, 13, 93, 593, 593, 1593, 6593, 186, 187, 'PTAAAA', 'YSKAAA', 'AAAAxx'),
+(3893, 7253, 1, 1, 3, 13, 93, 893, 1893, 3893, 3893, 186, 187, 'TTAAAA', 'ZSKAAA', 'HHHHxx'),
+(3200, 7254, 0, 0, 0, 0, 0, 200, 1200, 3200, 3200, 0, 1, 'CTAAAA', 'ATKAAA', 'OOOOxx'),
+(7125, 7255, 1, 1, 5, 5, 25, 125, 1125, 2125, 7125, 50, 51, 'BOAAAA', 'BTKAAA', 'VVVVxx'),
+(2295, 7256, 1, 3, 5, 15, 95, 295, 295, 2295, 2295, 190, 191, 'HKAAAA', 'CTKAAA', 'AAAAxx'),
+(2056, 7257, 0, 0, 6, 16, 56, 56, 56, 2056, 2056, 112, 113, 'CBAAAA', 'DTKAAA', 'HHHHxx'),
+(2962, 7258, 0, 2, 2, 2, 62, 962, 962, 2962, 2962, 124, 125, 'YJAAAA', 'ETKAAA', 'OOOOxx'),
+(993, 7259, 1, 1, 3, 13, 93, 993, 993, 993, 993, 186, 187, 'FMAAAA', 'FTKAAA', 'VVVVxx'),
+(9127, 7260, 1, 3, 7, 7, 27, 127, 1127, 4127, 9127, 54, 55, 'BNAAAA', 'GTKAAA', 'AAAAxx'),
+(2075, 7261, 1, 3, 5, 15, 75, 75, 75, 2075, 2075, 150, 151, 'VBAAAA', 'HTKAAA', 'HHHHxx'),
+(9338, 7262, 0, 2, 8, 18, 38, 338, 1338, 4338, 9338, 76, 77, 'EVAAAA', 'ITKAAA', 'OOOOxx'),
+(8100, 7263, 0, 0, 0, 0, 0, 100, 100, 3100, 8100, 0, 1, 'OZAAAA', 'JTKAAA', 'VVVVxx'),
+(5047, 7264, 1, 3, 7, 7, 47, 47, 1047, 47, 5047, 94, 95, 'DMAAAA', 'KTKAAA', 'AAAAxx'),
+(7032, 7265, 0, 0, 2, 12, 32, 32, 1032, 2032, 7032, 64, 65, 'MKAAAA', 'LTKAAA', 'HHHHxx'),
+(6374, 7266, 0, 2, 4, 14, 74, 374, 374, 1374, 6374, 148, 149, 'ELAAAA', 'MTKAAA', 'OOOOxx'),
+(4137, 7267, 1, 1, 7, 17, 37, 137, 137, 4137, 4137, 74, 75, 'DDAAAA', 'NTKAAA', 'VVVVxx'),
+(7132, 7268, 0, 0, 2, 12, 32, 132, 1132, 2132, 7132, 64, 65, 'IOAAAA', 'OTKAAA', 'AAAAxx'),
+(3064, 7269, 0, 0, 4, 4, 64, 64, 1064, 3064, 3064, 128, 129, 'WNAAAA', 'PTKAAA', 'HHHHxx'),
+(3621, 7270, 1, 1, 1, 1, 21, 621, 1621, 3621, 3621, 42, 43, 'HJAAAA', 'QTKAAA', 'OOOOxx'),
+(6199, 7271, 1, 3, 9, 19, 99, 199, 199, 1199, 6199, 198, 199, 'LEAAAA', 'RTKAAA', 'VVVVxx'),
+(4926, 7272, 0, 2, 6, 6, 26, 926, 926, 4926, 4926, 52, 53, 'MHAAAA', 'STKAAA', 'AAAAxx'),
+(8035, 7273, 1, 3, 5, 15, 35, 35, 35, 3035, 8035, 70, 71, 'BXAAAA', 'TTKAAA', 'HHHHxx'),
+(2195, 7274, 1, 3, 5, 15, 95, 195, 195, 2195, 2195, 190, 191, 'LGAAAA', 'UTKAAA', 'OOOOxx'),
+(5366, 7275, 0, 2, 6, 6, 66, 366, 1366, 366, 5366, 132, 133, 'KYAAAA', 'VTKAAA', 'VVVVxx'),
+(3478, 7276, 0, 2, 8, 18, 78, 478, 1478, 3478, 3478, 156, 157, 'UDAAAA', 'WTKAAA', 'AAAAxx'),
+(1926, 7277, 0, 2, 6, 6, 26, 926, 1926, 1926, 1926, 52, 53, 'CWAAAA', 'XTKAAA', 'HHHHxx'),
+(7265, 7278, 1, 1, 5, 5, 65, 265, 1265, 2265, 7265, 130, 131, 'LTAAAA', 'YTKAAA', 'OOOOxx'),
+(7668, 7279, 0, 0, 8, 8, 68, 668, 1668, 2668, 7668, 136, 137, 'YIAAAA', 'ZTKAAA', 'VVVVxx'),
+(3335, 7280, 1, 3, 5, 15, 35, 335, 1335, 3335, 3335, 70, 71, 'HYAAAA', 'AUKAAA', 'AAAAxx'),
+(7660, 7281, 0, 0, 0, 0, 60, 660, 1660, 2660, 7660, 120, 121, 'QIAAAA', 'BUKAAA', 'HHHHxx'),
+(9604, 7282, 0, 0, 4, 4, 4, 604, 1604, 4604, 9604, 8, 9, 'KFAAAA', 'CUKAAA', 'OOOOxx'),
+(7301, 7283, 1, 1, 1, 1, 1, 301, 1301, 2301, 7301, 2, 3, 'VUAAAA', 'DUKAAA', 'VVVVxx'),
+(4475, 7284, 1, 3, 5, 15, 75, 475, 475, 4475, 4475, 150, 151, 'DQAAAA', 'EUKAAA', 'AAAAxx'),
+(9954, 7285, 0, 2, 4, 14, 54, 954, 1954, 4954, 9954, 108, 109, 'WSAAAA', 'FUKAAA', 'HHHHxx'),
+(5723, 7286, 1, 3, 3, 3, 23, 723, 1723, 723, 5723, 46, 47, 'DMAAAA', 'GUKAAA', 'OOOOxx'),
+(2669, 7287, 1, 1, 9, 9, 69, 669, 669, 2669, 2669, 138, 139, 'RYAAAA', 'HUKAAA', 'VVVVxx'),
+(1685, 7288, 1, 1, 5, 5, 85, 685, 1685, 1685, 1685, 170, 171, 'VMAAAA', 'IUKAAA', 'AAAAxx'),
+(2233, 7289, 1, 1, 3, 13, 33, 233, 233, 2233, 2233, 66, 67, 'XHAAAA', 'JUKAAA', 'HHHHxx'),
+(8111, 7290, 1, 3, 1, 11, 11, 111, 111, 3111, 8111, 22, 23, 'ZZAAAA', 'KUKAAA', 'OOOOxx'),
+(7685, 7291, 1, 1, 5, 5, 85, 685, 1685, 2685, 7685, 170, 171, 'PJAAAA', 'LUKAAA', 'VVVVxx'),
+(3773, 7292, 1, 1, 3, 13, 73, 773, 1773, 3773, 3773, 146, 147, 'DPAAAA', 'MUKAAA', 'AAAAxx'),
+(7172, 7293, 0, 0, 2, 12, 72, 172, 1172, 2172, 7172, 144, 145, 'WPAAAA', 'NUKAAA', 'HHHHxx'),
+(1740, 7294, 0, 0, 0, 0, 40, 740, 1740, 1740, 1740, 80, 81, 'YOAAAA', 'OUKAAA', 'OOOOxx'),
+(5416, 7295, 0, 0, 6, 16, 16, 416, 1416, 416, 5416, 32, 33, 'IAAAAA', 'PUKAAA', 'VVVVxx'),
+(1823, 7296, 1, 3, 3, 3, 23, 823, 1823, 1823, 1823, 46, 47, 'DSAAAA', 'QUKAAA', 'AAAAxx'),
+(1668, 7297, 0, 0, 8, 8, 68, 668, 1668, 1668, 1668, 136, 137, 'EMAAAA', 'RUKAAA', 'HHHHxx'),
+(1795, 7298, 1, 3, 5, 15, 95, 795, 1795, 1795, 1795, 190, 191, 'BRAAAA', 'SUKAAA', 'OOOOxx'),
+(8599, 7299, 1, 3, 9, 19, 99, 599, 599, 3599, 8599, 198, 199, 'TSAAAA', 'TUKAAA', 'VVVVxx'),
+(5542, 7300, 0, 2, 2, 2, 42, 542, 1542, 542, 5542, 84, 85, 'EFAAAA', 'UUKAAA', 'AAAAxx'),
+(5658, 7301, 0, 2, 8, 18, 58, 658, 1658, 658, 5658, 116, 117, 'QJAAAA', 'VUKAAA', 'HHHHxx'),
+(9824, 7302, 0, 0, 4, 4, 24, 824, 1824, 4824, 9824, 48, 49, 'WNAAAA', 'WUKAAA', 'OOOOxx'),
+(19, 7303, 1, 3, 9, 19, 19, 19, 19, 19, 19, 38, 39, 'TAAAAA', 'XUKAAA', 'VVVVxx'),
+(9344, 7304, 0, 0, 4, 4, 44, 344, 1344, 4344, 9344, 88, 89, 'KVAAAA', 'YUKAAA', 'AAAAxx'),
+(5900, 7305, 0, 0, 0, 0, 0, 900, 1900, 900, 5900, 0, 1, 'YSAAAA', 'ZUKAAA', 'HHHHxx'),
+(7818, 7306, 0, 2, 8, 18, 18, 818, 1818, 2818, 7818, 36, 37, 'SOAAAA', 'AVKAAA', 'OOOOxx'),
+(8377, 7307, 1, 1, 7, 17, 77, 377, 377, 3377, 8377, 154, 155, 'FKAAAA', 'BVKAAA', 'VVVVxx'),
+(6886, 7308, 0, 2, 6, 6, 86, 886, 886, 1886, 6886, 172, 173, 'WEAAAA', 'CVKAAA', 'AAAAxx'),
+(3201, 7309, 1, 1, 1, 1, 1, 201, 1201, 3201, 3201, 2, 3, 'DTAAAA', 'DVKAAA', 'HHHHxx'),
+(87, 7310, 1, 3, 7, 7, 87, 87, 87, 87, 87, 174, 175, 'JDAAAA', 'EVKAAA', 'OOOOxx'),
+(1089, 7311, 1, 1, 9, 9, 89, 89, 1089, 1089, 1089, 178, 179, 'XPAAAA', 'FVKAAA', 'VVVVxx'),
+(3948, 7312, 0, 0, 8, 8, 48, 948, 1948, 3948, 3948, 96, 97, 'WVAAAA', 'GVKAAA', 'AAAAxx'),
+(6383, 7313, 1, 3, 3, 3, 83, 383, 383, 1383, 6383, 166, 167, 'NLAAAA', 'HVKAAA', 'HHHHxx'),
+(837, 7314, 1, 1, 7, 17, 37, 837, 837, 837, 837, 74, 75, 'FGAAAA', 'IVKAAA', 'OOOOxx'),
+(6285, 7315, 1, 1, 5, 5, 85, 285, 285, 1285, 6285, 170, 171, 'THAAAA', 'JVKAAA', 'VVVVxx'),
+(78, 7316, 0, 2, 8, 18, 78, 78, 78, 78, 78, 156, 157, 'ADAAAA', 'KVKAAA', 'AAAAxx'),
+(4389, 7317, 1, 1, 9, 9, 89, 389, 389, 4389, 4389, 178, 179, 'VMAAAA', 'LVKAAA', 'HHHHxx'),
+(4795, 7318, 1, 3, 5, 15, 95, 795, 795, 4795, 4795, 190, 191, 'LCAAAA', 'MVKAAA', 'OOOOxx'),
+(9369, 7319, 1, 1, 9, 9, 69, 369, 1369, 4369, 9369, 138, 139, 'JWAAAA', 'NVKAAA', 'VVVVxx'),
+(69, 7320, 1, 1, 9, 9, 69, 69, 69, 69, 69, 138, 139, 'RCAAAA', 'OVKAAA', 'AAAAxx'),
+(7689, 7321, 1, 1, 9, 9, 89, 689, 1689, 2689, 7689, 178, 179, 'TJAAAA', 'PVKAAA', 'HHHHxx'),
+(5642, 7322, 0, 2, 2, 2, 42, 642, 1642, 642, 5642, 84, 85, 'AJAAAA', 'QVKAAA', 'OOOOxx'),
+(2348, 7323, 0, 0, 8, 8, 48, 348, 348, 2348, 2348, 96, 97, 'IMAAAA', 'RVKAAA', 'VVVVxx'),
+(9308, 7324, 0, 0, 8, 8, 8, 308, 1308, 4308, 9308, 16, 17, 'AUAAAA', 'SVKAAA', 'AAAAxx'),
+(9093, 7325, 1, 1, 3, 13, 93, 93, 1093, 4093, 9093, 186, 187, 'TLAAAA', 'TVKAAA', 'HHHHxx'),
+(1199, 7326, 1, 3, 9, 19, 99, 199, 1199, 1199, 1199, 198, 199, 'DUAAAA', 'UVKAAA', 'OOOOxx'),
+(307, 7327, 1, 3, 7, 7, 7, 307, 307, 307, 307, 14, 15, 'VLAAAA', 'VVKAAA', 'VVVVxx'),
+(3814, 7328, 0, 2, 4, 14, 14, 814, 1814, 3814, 3814, 28, 29, 'SQAAAA', 'WVKAAA', 'AAAAxx'),
+(8817, 7329, 1, 1, 7, 17, 17, 817, 817, 3817, 8817, 34, 35, 'DBAAAA', 'XVKAAA', 'HHHHxx'),
+(2329, 7330, 1, 1, 9, 9, 29, 329, 329, 2329, 2329, 58, 59, 'PLAAAA', 'YVKAAA', 'OOOOxx'),
+(2932, 7331, 0, 0, 2, 12, 32, 932, 932, 2932, 2932, 64, 65, 'UIAAAA', 'ZVKAAA', 'VVVVxx'),
+(1986, 7332, 0, 2, 6, 6, 86, 986, 1986, 1986, 1986, 172, 173, 'KYAAAA', 'AWKAAA', 'AAAAxx'),
+(5279, 7333, 1, 3, 9, 19, 79, 279, 1279, 279, 5279, 158, 159, 'BVAAAA', 'BWKAAA', 'HHHHxx'),
+(5357, 7334, 1, 1, 7, 17, 57, 357, 1357, 357, 5357, 114, 115, 'BYAAAA', 'CWKAAA', 'OOOOxx'),
+(6778, 7335, 0, 2, 8, 18, 78, 778, 778, 1778, 6778, 156, 157, 'SAAAAA', 'DWKAAA', 'VVVVxx'),
+(2773, 7336, 1, 1, 3, 13, 73, 773, 773, 2773, 2773, 146, 147, 'RCAAAA', 'EWKAAA', 'AAAAxx'),
+(244, 7337, 0, 0, 4, 4, 44, 244, 244, 244, 244, 88, 89, 'KJAAAA', 'FWKAAA', 'HHHHxx'),
+(6900, 7338, 0, 0, 0, 0, 0, 900, 900, 1900, 6900, 0, 1, 'KFAAAA', 'GWKAAA', 'OOOOxx'),
+(4739, 7339, 1, 3, 9, 19, 39, 739, 739, 4739, 4739, 78, 79, 'HAAAAA', 'HWKAAA', 'VVVVxx'),
+(3217, 7340, 1, 1, 7, 17, 17, 217, 1217, 3217, 3217, 34, 35, 'TTAAAA', 'IWKAAA', 'AAAAxx'),
+(7563, 7341, 1, 3, 3, 3, 63, 563, 1563, 2563, 7563, 126, 127, 'XEAAAA', 'JWKAAA', 'HHHHxx'),
+(1807, 7342, 1, 3, 7, 7, 7, 807, 1807, 1807, 1807, 14, 15, 'NRAAAA', 'KWKAAA', 'OOOOxx'),
+(4199, 7343, 1, 3, 9, 19, 99, 199, 199, 4199, 4199, 198, 199, 'NFAAAA', 'LWKAAA', 'VVVVxx'),
+(1077, 7344, 1, 1, 7, 17, 77, 77, 1077, 1077, 1077, 154, 155, 'LPAAAA', 'MWKAAA', 'AAAAxx'),
+(8348, 7345, 0, 0, 8, 8, 48, 348, 348, 3348, 8348, 96, 97, 'CJAAAA', 'NWKAAA', 'HHHHxx'),
+(841, 7346, 1, 1, 1, 1, 41, 841, 841, 841, 841, 82, 83, 'JGAAAA', 'OWKAAA', 'OOOOxx'),
+(8154, 7347, 0, 2, 4, 14, 54, 154, 154, 3154, 8154, 108, 109, 'QBAAAA', 'PWKAAA', 'VVVVxx'),
+(5261, 7348, 1, 1, 1, 1, 61, 261, 1261, 261, 5261, 122, 123, 'JUAAAA', 'QWKAAA', 'AAAAxx'),
+(1950, 7349, 0, 2, 0, 10, 50, 950, 1950, 1950, 1950, 100, 101, 'AXAAAA', 'RWKAAA', 'HHHHxx'),
+(8472, 7350, 0, 0, 2, 12, 72, 472, 472, 3472, 8472, 144, 145, 'WNAAAA', 'SWKAAA', 'OOOOxx'),
+(8745, 7351, 1, 1, 5, 5, 45, 745, 745, 3745, 8745, 90, 91, 'JYAAAA', 'TWKAAA', 'VVVVxx'),
+(8715, 7352, 1, 3, 5, 15, 15, 715, 715, 3715, 8715, 30, 31, 'FXAAAA', 'UWKAAA', 'AAAAxx'),
+(9708, 7353, 0, 0, 8, 8, 8, 708, 1708, 4708, 9708, 16, 17, 'KJAAAA', 'VWKAAA', 'HHHHxx'),
+(5860, 7354, 0, 0, 0, 0, 60, 860, 1860, 860, 5860, 120, 121, 'KRAAAA', 'WWKAAA', 'OOOOxx'),
+(9142, 7355, 0, 2, 2, 2, 42, 142, 1142, 4142, 9142, 84, 85, 'QNAAAA', 'XWKAAA', 'VVVVxx'),
+(6582, 7356, 0, 2, 2, 2, 82, 582, 582, 1582, 6582, 164, 165, 'ETAAAA', 'YWKAAA', 'AAAAxx'),
+(1255, 7357, 1, 3, 5, 15, 55, 255, 1255, 1255, 1255, 110, 111, 'HWAAAA', 'ZWKAAA', 'HHHHxx'),
+(6459, 7358, 1, 3, 9, 19, 59, 459, 459, 1459, 6459, 118, 119, 'LOAAAA', 'AXKAAA', 'OOOOxx'),
+(6327, 7359, 1, 3, 7, 7, 27, 327, 327, 1327, 6327, 54, 55, 'JJAAAA', 'BXKAAA', 'VVVVxx'),
+(4692, 7360, 0, 0, 2, 12, 92, 692, 692, 4692, 4692, 184, 185, 'MYAAAA', 'CXKAAA', 'AAAAxx'),
+(3772, 7361, 0, 0, 2, 12, 72, 772, 1772, 3772, 3772, 144, 145, 'CPAAAA', 'DXKAAA', 'HHHHxx'),
+(4203, 7362, 1, 3, 3, 3, 3, 203, 203, 4203, 4203, 6, 7, 'RFAAAA', 'EXKAAA', 'OOOOxx'),
+(2946, 7363, 0, 2, 6, 6, 46, 946, 946, 2946, 2946, 92, 93, 'IJAAAA', 'FXKAAA', 'VVVVxx'),
+(3524, 7364, 0, 0, 4, 4, 24, 524, 1524, 3524, 3524, 48, 49, 'OFAAAA', 'GXKAAA', 'AAAAxx'),
+(8409, 7365, 1, 1, 9, 9, 9, 409, 409, 3409, 8409, 18, 19, 'LLAAAA', 'HXKAAA', 'HHHHxx'),
+(1824, 7366, 0, 0, 4, 4, 24, 824, 1824, 1824, 1824, 48, 49, 'ESAAAA', 'IXKAAA', 'OOOOxx'),
+(4637, 7367, 1, 1, 7, 17, 37, 637, 637, 4637, 4637, 74, 75, 'JWAAAA', 'JXKAAA', 'VVVVxx'),
+(589, 7368, 1, 1, 9, 9, 89, 589, 589, 589, 589, 178, 179, 'RWAAAA', 'KXKAAA', 'AAAAxx'),
+(484, 7369, 0, 0, 4, 4, 84, 484, 484, 484, 484, 168, 169, 'QSAAAA', 'LXKAAA', 'HHHHxx'),
+(8963, 7370, 1, 3, 3, 3, 63, 963, 963, 3963, 8963, 126, 127, 'TGAAAA', 'MXKAAA', 'OOOOxx'),
+(5502, 7371, 0, 2, 2, 2, 2, 502, 1502, 502, 5502, 4, 5, 'QDAAAA', 'NXKAAA', 'VVVVxx'),
+(6982, 7372, 0, 2, 2, 2, 82, 982, 982, 1982, 6982, 164, 165, 'OIAAAA', 'OXKAAA', 'AAAAxx'),
+(8029, 7373, 1, 1, 9, 9, 29, 29, 29, 3029, 8029, 58, 59, 'VWAAAA', 'PXKAAA', 'HHHHxx'),
+(4395, 7374, 1, 3, 5, 15, 95, 395, 395, 4395, 4395, 190, 191, 'BNAAAA', 'QXKAAA', 'OOOOxx'),
+(2595, 7375, 1, 3, 5, 15, 95, 595, 595, 2595, 2595, 190, 191, 'VVAAAA', 'RXKAAA', 'VVVVxx'),
+(2133, 7376, 1, 1, 3, 13, 33, 133, 133, 2133, 2133, 66, 67, 'BEAAAA', 'SXKAAA', 'AAAAxx'),
+(1414, 7377, 0, 2, 4, 14, 14, 414, 1414, 1414, 1414, 28, 29, 'KCAAAA', 'TXKAAA', 'HHHHxx'),
+(8201, 7378, 1, 1, 1, 1, 1, 201, 201, 3201, 8201, 2, 3, 'LDAAAA', 'UXKAAA', 'OOOOxx'),
+(4706, 7379, 0, 2, 6, 6, 6, 706, 706, 4706, 4706, 12, 13, 'AZAAAA', 'VXKAAA', 'VVVVxx'),
+(5310, 7380, 0, 2, 0, 10, 10, 310, 1310, 310, 5310, 20, 21, 'GWAAAA', 'WXKAAA', 'AAAAxx'),
+(7333, 7381, 1, 1, 3, 13, 33, 333, 1333, 2333, 7333, 66, 67, 'BWAAAA', 'XXKAAA', 'HHHHxx'),
+(9420, 7382, 0, 0, 0, 0, 20, 420, 1420, 4420, 9420, 40, 41, 'IYAAAA', 'YXKAAA', 'OOOOxx'),
+(1383, 7383, 1, 3, 3, 3, 83, 383, 1383, 1383, 1383, 166, 167, 'FBAAAA', 'ZXKAAA', 'VVVVxx'),
+(6225, 7384, 1, 1, 5, 5, 25, 225, 225, 1225, 6225, 50, 51, 'LFAAAA', 'AYKAAA', 'AAAAxx'),
+(2064, 7385, 0, 0, 4, 4, 64, 64, 64, 2064, 2064, 128, 129, 'KBAAAA', 'BYKAAA', 'HHHHxx'),
+(6700, 7386, 0, 0, 0, 0, 0, 700, 700, 1700, 6700, 0, 1, 'SXAAAA', 'CYKAAA', 'OOOOxx'),
+(1352, 7387, 0, 0, 2, 12, 52, 352, 1352, 1352, 1352, 104, 105, 'AAAAAA', 'DYKAAA', 'VVVVxx'),
+(4249, 7388, 1, 1, 9, 9, 49, 249, 249, 4249, 4249, 98, 99, 'LHAAAA', 'EYKAAA', 'AAAAxx'),
+(9429, 7389, 1, 1, 9, 9, 29, 429, 1429, 4429, 9429, 58, 59, 'RYAAAA', 'FYKAAA', 'HHHHxx'),
+(8090, 7390, 0, 2, 0, 10, 90, 90, 90, 3090, 8090, 180, 181, 'EZAAAA', 'GYKAAA', 'OOOOxx'),
+(5378, 7391, 0, 2, 8, 18, 78, 378, 1378, 378, 5378, 156, 157, 'WYAAAA', 'HYKAAA', 'VVVVxx'),
+(9085, 7392, 1, 1, 5, 5, 85, 85, 1085, 4085, 9085, 170, 171, 'LLAAAA', 'IYKAAA', 'AAAAxx'),
+(7468, 7393, 0, 0, 8, 8, 68, 468, 1468, 2468, 7468, 136, 137, 'GBAAAA', 'JYKAAA', 'HHHHxx'),
+(9955, 7394, 1, 3, 5, 15, 55, 955, 1955, 4955, 9955, 110, 111, 'XSAAAA', 'KYKAAA', 'OOOOxx'),
+(8692, 7395, 0, 0, 2, 12, 92, 692, 692, 3692, 8692, 184, 185, 'IWAAAA', 'LYKAAA', 'VVVVxx'),
+(1463, 7396, 1, 3, 3, 3, 63, 463, 1463, 1463, 1463, 126, 127, 'HEAAAA', 'MYKAAA', 'AAAAxx'),
+(3577, 7397, 1, 1, 7, 17, 77, 577, 1577, 3577, 3577, 154, 155, 'PHAAAA', 'NYKAAA', 'HHHHxx'),
+(5654, 7398, 0, 2, 4, 14, 54, 654, 1654, 654, 5654, 108, 109, 'MJAAAA', 'OYKAAA', 'OOOOxx'),
+(7955, 7399, 1, 3, 5, 15, 55, 955, 1955, 2955, 7955, 110, 111, 'ZTAAAA', 'PYKAAA', 'VVVVxx'),
+(4843, 7400, 1, 3, 3, 3, 43, 843, 843, 4843, 4843, 86, 87, 'HEAAAA', 'QYKAAA', 'AAAAxx'),
+(1776, 7401, 0, 0, 6, 16, 76, 776, 1776, 1776, 1776, 152, 153, 'IQAAAA', 'RYKAAA', 'HHHHxx'),
+(2223, 7402, 1, 3, 3, 3, 23, 223, 223, 2223, 2223, 46, 47, 'NHAAAA', 'SYKAAA', 'OOOOxx'),
+(8442, 7403, 0, 2, 2, 2, 42, 442, 442, 3442, 8442, 84, 85, 'SMAAAA', 'TYKAAA', 'VVVVxx'),
+(9738, 7404, 0, 2, 8, 18, 38, 738, 1738, 4738, 9738, 76, 77, 'OKAAAA', 'UYKAAA', 'AAAAxx'),
+(4867, 7405, 1, 3, 7, 7, 67, 867, 867, 4867, 4867, 134, 135, 'FFAAAA', 'VYKAAA', 'HHHHxx'),
+(2983, 7406, 1, 3, 3, 3, 83, 983, 983, 2983, 2983, 166, 167, 'TKAAAA', 'WYKAAA', 'OOOOxx'),
+(3300, 7407, 0, 0, 0, 0, 0, 300, 1300, 3300, 3300, 0, 1, 'YWAAAA', 'XYKAAA', 'VVVVxx'),
+(3815, 7408, 1, 3, 5, 15, 15, 815, 1815, 3815, 3815, 30, 31, 'TQAAAA', 'YYKAAA', 'AAAAxx'),
+(1779, 7409, 1, 3, 9, 19, 79, 779, 1779, 1779, 1779, 158, 159, 'LQAAAA', 'ZYKAAA', 'HHHHxx'),
+(1123, 7410, 1, 3, 3, 3, 23, 123, 1123, 1123, 1123, 46, 47, 'FRAAAA', 'AZKAAA', 'OOOOxx'),
+(4824, 7411, 0, 0, 4, 4, 24, 824, 824, 4824, 4824, 48, 49, 'ODAAAA', 'BZKAAA', 'VVVVxx'),
+(5407, 7412, 1, 3, 7, 7, 7, 407, 1407, 407, 5407, 14, 15, 'ZZAAAA', 'CZKAAA', 'AAAAxx'),
+(5123, 7413, 1, 3, 3, 3, 23, 123, 1123, 123, 5123, 46, 47, 'BPAAAA', 'DZKAAA', 'HHHHxx'),
+(2515, 7414, 1, 3, 5, 15, 15, 515, 515, 2515, 2515, 30, 31, 'TSAAAA', 'EZKAAA', 'OOOOxx'),
+(4781, 7415, 1, 1, 1, 1, 81, 781, 781, 4781, 4781, 162, 163, 'XBAAAA', 'FZKAAA', 'VVVVxx'),
+(7831, 7416, 1, 3, 1, 11, 31, 831, 1831, 2831, 7831, 62, 63, 'FPAAAA', 'GZKAAA', 'AAAAxx'),
+(6946, 7417, 0, 2, 6, 6, 46, 946, 946, 1946, 6946, 92, 93, 'EHAAAA', 'HZKAAA', 'HHHHxx'),
+(1215, 7418, 1, 3, 5, 15, 15, 215, 1215, 1215, 1215, 30, 31, 'TUAAAA', 'IZKAAA', 'OOOOxx'),
+(7783, 7419, 1, 3, 3, 3, 83, 783, 1783, 2783, 7783, 166, 167, 'JNAAAA', 'JZKAAA', 'VVVVxx'),
+(4532, 7420, 0, 0, 2, 12, 32, 532, 532, 4532, 4532, 64, 65, 'ISAAAA', 'KZKAAA', 'AAAAxx'),
+(9068, 7421, 0, 0, 8, 8, 68, 68, 1068, 4068, 9068, 136, 137, 'UKAAAA', 'LZKAAA', 'HHHHxx'),
+(7030, 7422, 0, 2, 0, 10, 30, 30, 1030, 2030, 7030, 60, 61, 'KKAAAA', 'MZKAAA', 'OOOOxx'),
+(436, 7423, 0, 0, 6, 16, 36, 436, 436, 436, 436, 72, 73, 'UQAAAA', 'NZKAAA', 'VVVVxx'),
+(6549, 7424, 1, 1, 9, 9, 49, 549, 549, 1549, 6549, 98, 99, 'XRAAAA', 'OZKAAA', 'AAAAxx'),
+(3348, 7425, 0, 0, 8, 8, 48, 348, 1348, 3348, 3348, 96, 97, 'UYAAAA', 'PZKAAA', 'HHHHxx'),
+(6229, 7426, 1, 1, 9, 9, 29, 229, 229, 1229, 6229, 58, 59, 'PFAAAA', 'QZKAAA', 'OOOOxx'),
+(3933, 7427, 1, 1, 3, 13, 33, 933, 1933, 3933, 3933, 66, 67, 'HVAAAA', 'RZKAAA', 'VVVVxx'),
+(1876, 7428, 0, 0, 6, 16, 76, 876, 1876, 1876, 1876, 152, 153, 'EUAAAA', 'SZKAAA', 'AAAAxx'),
+(8920, 7429, 0, 0, 0, 0, 20, 920, 920, 3920, 8920, 40, 41, 'CFAAAA', 'TZKAAA', 'HHHHxx'),
+(7926, 7430, 0, 2, 6, 6, 26, 926, 1926, 2926, 7926, 52, 53, 'WSAAAA', 'UZKAAA', 'OOOOxx'),
+(8805, 7431, 1, 1, 5, 5, 5, 805, 805, 3805, 8805, 10, 11, 'RAAAAA', 'VZKAAA', 'VVVVxx'),
+(6729, 7432, 1, 1, 9, 9, 29, 729, 729, 1729, 6729, 58, 59, 'VYAAAA', 'WZKAAA', 'AAAAxx'),
+(7397, 7433, 1, 1, 7, 17, 97, 397, 1397, 2397, 7397, 194, 195, 'NYAAAA', 'XZKAAA', 'HHHHxx'),
+(9303, 7434, 1, 3, 3, 3, 3, 303, 1303, 4303, 9303, 6, 7, 'VTAAAA', 'YZKAAA', 'OOOOxx'),
+(4255, 7435, 1, 3, 5, 15, 55, 255, 255, 4255, 4255, 110, 111, 'RHAAAA', 'ZZKAAA', 'VVVVxx'),
+(7229, 7436, 1, 1, 9, 9, 29, 229, 1229, 2229, 7229, 58, 59, 'BSAAAA', 'AALAAA', 'AAAAxx'),
+(854, 7437, 0, 2, 4, 14, 54, 854, 854, 854, 854, 108, 109, 'WGAAAA', 'BALAAA', 'HHHHxx'),
+(6723, 7438, 1, 3, 3, 3, 23, 723, 723, 1723, 6723, 46, 47, 'PYAAAA', 'CALAAA', 'OOOOxx'),
+(9597, 7439, 1, 1, 7, 17, 97, 597, 1597, 4597, 9597, 194, 195, 'DFAAAA', 'DALAAA', 'VVVVxx'),
+(6532, 7440, 0, 0, 2, 12, 32, 532, 532, 1532, 6532, 64, 65, 'GRAAAA', 'EALAAA', 'AAAAxx'),
+(2910, 7441, 0, 2, 0, 10, 10, 910, 910, 2910, 2910, 20, 21, 'YHAAAA', 'FALAAA', 'HHHHxx'),
+(6717, 7442, 1, 1, 7, 17, 17, 717, 717, 1717, 6717, 34, 35, 'JYAAAA', 'GALAAA', 'OOOOxx'),
+(1790, 7443, 0, 2, 0, 10, 90, 790, 1790, 1790, 1790, 180, 181, 'WQAAAA', 'HALAAA', 'VVVVxx'),
+(3761, 7444, 1, 1, 1, 1, 61, 761, 1761, 3761, 3761, 122, 123, 'ROAAAA', 'IALAAA', 'AAAAxx'),
+(1565, 7445, 1, 1, 5, 5, 65, 565, 1565, 1565, 1565, 130, 131, 'FIAAAA', 'JALAAA', 'HHHHxx'),
+(6205, 7446, 1, 1, 5, 5, 5, 205, 205, 1205, 6205, 10, 11, 'REAAAA', 'KALAAA', 'OOOOxx'),
+(2726, 7447, 0, 2, 6, 6, 26, 726, 726, 2726, 2726, 52, 53, 'WAAAAA', 'LALAAA', 'VVVVxx'),
+(799, 7448, 1, 3, 9, 19, 99, 799, 799, 799, 799, 198, 199, 'TEAAAA', 'MALAAA', 'AAAAxx'),
+(3540, 7449, 0, 0, 0, 0, 40, 540, 1540, 3540, 3540, 80, 81, 'EGAAAA', 'NALAAA', 'HHHHxx'),
+(5878, 7450, 0, 2, 8, 18, 78, 878, 1878, 878, 5878, 156, 157, 'CSAAAA', 'OALAAA', 'OOOOxx'),
+(2542, 7451, 0, 2, 2, 2, 42, 542, 542, 2542, 2542, 84, 85, 'UTAAAA', 'PALAAA', 'VVVVxx'),
+(4888, 7452, 0, 0, 8, 8, 88, 888, 888, 4888, 4888, 176, 177, 'AGAAAA', 'QALAAA', 'AAAAxx'),
+(5290, 7453, 0, 2, 0, 10, 90, 290, 1290, 290, 5290, 180, 181, 'MVAAAA', 'RALAAA', 'HHHHxx'),
+(7995, 7454, 1, 3, 5, 15, 95, 995, 1995, 2995, 7995, 190, 191, 'NVAAAA', 'SALAAA', 'OOOOxx'),
+(3519, 7455, 1, 3, 9, 19, 19, 519, 1519, 3519, 3519, 38, 39, 'JFAAAA', 'TALAAA', 'VVVVxx'),
+(3571, 7456, 1, 3, 1, 11, 71, 571, 1571, 3571, 3571, 142, 143, 'JHAAAA', 'UALAAA', 'AAAAxx'),
+(7854, 7457, 0, 2, 4, 14, 54, 854, 1854, 2854, 7854, 108, 109, 'CQAAAA', 'VALAAA', 'HHHHxx'),
+(5184, 7458, 0, 0, 4, 4, 84, 184, 1184, 184, 5184, 168, 169, 'KRAAAA', 'WALAAA', 'OOOOxx'),
+(3498, 7459, 0, 2, 8, 18, 98, 498, 1498, 3498, 3498, 196, 197, 'OEAAAA', 'XALAAA', 'VVVVxx'),
+(1264, 7460, 0, 0, 4, 4, 64, 264, 1264, 1264, 1264, 128, 129, 'QWAAAA', 'YALAAA', 'AAAAxx'),
+(3159, 7461, 1, 3, 9, 19, 59, 159, 1159, 3159, 3159, 118, 119, 'NRAAAA', 'ZALAAA', 'HHHHxx'),
+(5480, 7462, 0, 0, 0, 0, 80, 480, 1480, 480, 5480, 160, 161, 'UCAAAA', 'ABLAAA', 'OOOOxx'),
+(1706, 7463, 0, 2, 6, 6, 6, 706, 1706, 1706, 1706, 12, 13, 'QNAAAA', 'BBLAAA', 'VVVVxx'),
+(4540, 7464, 0, 0, 0, 0, 40, 540, 540, 4540, 4540, 80, 81, 'QSAAAA', 'CBLAAA', 'AAAAxx'),
+(2799, 7465, 1, 3, 9, 19, 99, 799, 799, 2799, 2799, 198, 199, 'RDAAAA', 'DBLAAA', 'HHHHxx'),
+(7389, 7466, 1, 1, 9, 9, 89, 389, 1389, 2389, 7389, 178, 179, 'FYAAAA', 'EBLAAA', 'OOOOxx'),
+(5565, 7467, 1, 1, 5, 5, 65, 565, 1565, 565, 5565, 130, 131, 'BGAAAA', 'FBLAAA', 'VVVVxx'),
+(3896, 7468, 0, 0, 6, 16, 96, 896, 1896, 3896, 3896, 192, 193, 'WTAAAA', 'GBLAAA', 'AAAAxx'),
+(2100, 7469, 0, 0, 0, 0, 0, 100, 100, 2100, 2100, 0, 1, 'UCAAAA', 'HBLAAA', 'HHHHxx'),
+(3507, 7470, 1, 3, 7, 7, 7, 507, 1507, 3507, 3507, 14, 15, 'XEAAAA', 'IBLAAA', 'OOOOxx'),
+(7971, 7471, 1, 3, 1, 11, 71, 971, 1971, 2971, 7971, 142, 143, 'PUAAAA', 'JBLAAA', 'VVVVxx'),
+(2312, 7472, 0, 0, 2, 12, 12, 312, 312, 2312, 2312, 24, 25, 'YKAAAA', 'KBLAAA', 'AAAAxx'),
+(2494, 7473, 0, 2, 4, 14, 94, 494, 494, 2494, 2494, 188, 189, 'YRAAAA', 'LBLAAA', 'HHHHxx'),
+(2474, 7474, 0, 2, 4, 14, 74, 474, 474, 2474, 2474, 148, 149, 'ERAAAA', 'MBLAAA', 'OOOOxx'),
+(3136, 7475, 0, 0, 6, 16, 36, 136, 1136, 3136, 3136, 72, 73, 'QQAAAA', 'NBLAAA', 'VVVVxx'),
+(7242, 7476, 0, 2, 2, 2, 42, 242, 1242, 2242, 7242, 84, 85, 'OSAAAA', 'OBLAAA', 'AAAAxx'),
+(9430, 7477, 0, 2, 0, 10, 30, 430, 1430, 4430, 9430, 60, 61, 'SYAAAA', 'PBLAAA', 'HHHHxx'),
+(1052, 7478, 0, 0, 2, 12, 52, 52, 1052, 1052, 1052, 104, 105, 'MOAAAA', 'QBLAAA', 'OOOOxx'),
+(4172, 7479, 0, 0, 2, 12, 72, 172, 172, 4172, 4172, 144, 145, 'MEAAAA', 'RBLAAA', 'VVVVxx'),
+(970, 7480, 0, 2, 0, 10, 70, 970, 970, 970, 970, 140, 141, 'ILAAAA', 'SBLAAA', 'AAAAxx'),
+(882, 7481, 0, 2, 2, 2, 82, 882, 882, 882, 882, 164, 165, 'YHAAAA', 'TBLAAA', 'HHHHxx'),
+(9799, 7482, 1, 3, 9, 19, 99, 799, 1799, 4799, 9799, 198, 199, 'XMAAAA', 'UBLAAA', 'OOOOxx'),
+(5850, 7483, 0, 2, 0, 10, 50, 850, 1850, 850, 5850, 100, 101, 'ARAAAA', 'VBLAAA', 'VVVVxx'),
+(9473, 7484, 1, 1, 3, 13, 73, 473, 1473, 4473, 9473, 146, 147, 'JAAAAA', 'WBLAAA', 'AAAAxx'),
+(8635, 7485, 1, 3, 5, 15, 35, 635, 635, 3635, 8635, 70, 71, 'DUAAAA', 'XBLAAA', 'HHHHxx'),
+(2349, 7486, 1, 1, 9, 9, 49, 349, 349, 2349, 2349, 98, 99, 'JMAAAA', 'YBLAAA', 'OOOOxx'),
+(2270, 7487, 0, 2, 0, 10, 70, 270, 270, 2270, 2270, 140, 141, 'IJAAAA', 'ZBLAAA', 'VVVVxx'),
+(7887, 7488, 1, 3, 7, 7, 87, 887, 1887, 2887, 7887, 174, 175, 'JRAAAA', 'ACLAAA', 'AAAAxx'),
+(3091, 7489, 1, 3, 1, 11, 91, 91, 1091, 3091, 3091, 182, 183, 'XOAAAA', 'BCLAAA', 'HHHHxx'),
+(3728, 7490, 0, 0, 8, 8, 28, 728, 1728, 3728, 3728, 56, 57, 'KNAAAA', 'CCLAAA', 'OOOOxx'),
+(3658, 7491, 0, 2, 8, 18, 58, 658, 1658, 3658, 3658, 116, 117, 'SKAAAA', 'DCLAAA', 'VVVVxx'),
+(5975, 7492, 1, 3, 5, 15, 75, 975, 1975, 975, 5975, 150, 151, 'VVAAAA', 'ECLAAA', 'AAAAxx'),
+(332, 7493, 0, 0, 2, 12, 32, 332, 332, 332, 332, 64, 65, 'UMAAAA', 'FCLAAA', 'HHHHxx'),
+(7990, 7494, 0, 2, 0, 10, 90, 990, 1990, 2990, 7990, 180, 181, 'IVAAAA', 'GCLAAA', 'OOOOxx'),
+(8688, 7495, 0, 0, 8, 8, 88, 688, 688, 3688, 8688, 176, 177, 'EWAAAA', 'HCLAAA', 'VVVVxx'),
+(9601, 7496, 1, 1, 1, 1, 1, 601, 1601, 4601, 9601, 2, 3, 'HFAAAA', 'ICLAAA', 'AAAAxx'),
+(8401, 7497, 1, 1, 1, 1, 1, 401, 401, 3401, 8401, 2, 3, 'DLAAAA', 'JCLAAA', 'HHHHxx'),
+(8093, 7498, 1, 1, 3, 13, 93, 93, 93, 3093, 8093, 186, 187, 'HZAAAA', 'KCLAAA', 'OOOOxx'),
+(4278, 7499, 0, 2, 8, 18, 78, 278, 278, 4278, 4278, 156, 157, 'OIAAAA', 'LCLAAA', 'VVVVxx'),
+(5467, 7500, 1, 3, 7, 7, 67, 467, 1467, 467, 5467, 134, 135, 'HCAAAA', 'MCLAAA', 'AAAAxx'),
+(3137, 7501, 1, 1, 7, 17, 37, 137, 1137, 3137, 3137, 74, 75, 'RQAAAA', 'NCLAAA', 'HHHHxx'),
+(204, 7502, 0, 0, 4, 4, 4, 204, 204, 204, 204, 8, 9, 'WHAAAA', 'OCLAAA', 'OOOOxx'),
+(8224, 7503, 0, 0, 4, 4, 24, 224, 224, 3224, 8224, 48, 49, 'IEAAAA', 'PCLAAA', 'VVVVxx'),
+(2944, 7504, 0, 0, 4, 4, 44, 944, 944, 2944, 2944, 88, 89, 'GJAAAA', 'QCLAAA', 'AAAAxx'),
+(7593, 7505, 1, 1, 3, 13, 93, 593, 1593, 2593, 7593, 186, 187, 'BGAAAA', 'RCLAAA', 'HHHHxx'),
+(814, 7506, 0, 2, 4, 14, 14, 814, 814, 814, 814, 28, 29, 'IFAAAA', 'SCLAAA', 'OOOOxx'),
+(8047, 7507, 1, 3, 7, 7, 47, 47, 47, 3047, 8047, 94, 95, 'NXAAAA', 'TCLAAA', 'VVVVxx'),
+(7802, 7508, 0, 2, 2, 2, 2, 802, 1802, 2802, 7802, 4, 5, 'COAAAA', 'UCLAAA', 'AAAAxx'),
+(901, 7509, 1, 1, 1, 1, 1, 901, 901, 901, 901, 2, 3, 'RIAAAA', 'VCLAAA', 'HHHHxx'),
+(6168, 7510, 0, 0, 8, 8, 68, 168, 168, 1168, 6168, 136, 137, 'GDAAAA', 'WCLAAA', 'OOOOxx'),
+(2950, 7511, 0, 2, 0, 10, 50, 950, 950, 2950, 2950, 100, 101, 'MJAAAA', 'XCLAAA', 'VVVVxx'),
+(5393, 7512, 1, 1, 3, 13, 93, 393, 1393, 393, 5393, 186, 187, 'LZAAAA', 'YCLAAA', 'AAAAxx'),
+(3585, 7513, 1, 1, 5, 5, 85, 585, 1585, 3585, 3585, 170, 171, 'XHAAAA', 'ZCLAAA', 'HHHHxx'),
+(9392, 7514, 0, 0, 2, 12, 92, 392, 1392, 4392, 9392, 184, 185, 'GXAAAA', 'ADLAAA', 'OOOOxx'),
+(8314, 7515, 0, 2, 4, 14, 14, 314, 314, 3314, 8314, 28, 29, 'UHAAAA', 'BDLAAA', 'VVVVxx'),
+(9972, 7516, 0, 0, 2, 12, 72, 972, 1972, 4972, 9972, 144, 145, 'OTAAAA', 'CDLAAA', 'AAAAxx'),
+(9130, 7517, 0, 2, 0, 10, 30, 130, 1130, 4130, 9130, 60, 61, 'ENAAAA', 'DDLAAA', 'HHHHxx'),
+(975, 7518, 1, 3, 5, 15, 75, 975, 975, 975, 975, 150, 151, 'NLAAAA', 'EDLAAA', 'OOOOxx'),
+(5720, 7519, 0, 0, 0, 0, 20, 720, 1720, 720, 5720, 40, 41, 'AMAAAA', 'FDLAAA', 'VVVVxx'),
+(3769, 7520, 1, 1, 9, 9, 69, 769, 1769, 3769, 3769, 138, 139, 'ZOAAAA', 'GDLAAA', 'AAAAxx'),
+(5303, 7521, 1, 3, 3, 3, 3, 303, 1303, 303, 5303, 6, 7, 'ZVAAAA', 'HDLAAA', 'HHHHxx'),
+(6564, 7522, 0, 0, 4, 4, 64, 564, 564, 1564, 6564, 128, 129, 'MSAAAA', 'IDLAAA', 'OOOOxx'),
+(7855, 7523, 1, 3, 5, 15, 55, 855, 1855, 2855, 7855, 110, 111, 'DQAAAA', 'JDLAAA', 'VVVVxx'),
+(8153, 7524, 1, 1, 3, 13, 53, 153, 153, 3153, 8153, 106, 107, 'PBAAAA', 'KDLAAA', 'AAAAxx'),
+(2292, 7525, 0, 0, 2, 12, 92, 292, 292, 2292, 2292, 184, 185, 'EKAAAA', 'LDLAAA', 'HHHHxx'),
+(3156, 7526, 0, 0, 6, 16, 56, 156, 1156, 3156, 3156, 112, 113, 'KRAAAA', 'MDLAAA', 'OOOOxx'),
+(6580, 7527, 0, 0, 0, 0, 80, 580, 580, 1580, 6580, 160, 161, 'CTAAAA', 'NDLAAA', 'VVVVxx'),
+(5324, 7528, 0, 0, 4, 4, 24, 324, 1324, 324, 5324, 48, 49, 'UWAAAA', 'ODLAAA', 'AAAAxx'),
+(8871, 7529, 1, 3, 1, 11, 71, 871, 871, 3871, 8871, 142, 143, 'FDAAAA', 'PDLAAA', 'HHHHxx'),
+(2543, 7530, 1, 3, 3, 3, 43, 543, 543, 2543, 2543, 86, 87, 'VTAAAA', 'QDLAAA', 'OOOOxx'),
+(7857, 7531, 1, 1, 7, 17, 57, 857, 1857, 2857, 7857, 114, 115, 'FQAAAA', 'RDLAAA', 'VVVVxx'),
+(4084, 7532, 0, 0, 4, 4, 84, 84, 84, 4084, 4084, 168, 169, 'CBAAAA', 'SDLAAA', 'AAAAxx'),
+(9887, 7533, 1, 3, 7, 7, 87, 887, 1887, 4887, 9887, 174, 175, 'HQAAAA', 'TDLAAA', 'HHHHxx'),
+(6940, 7534, 0, 0, 0, 0, 40, 940, 940, 1940, 6940, 80, 81, 'YGAAAA', 'UDLAAA', 'OOOOxx'),
+(3415, 7535, 1, 3, 5, 15, 15, 415, 1415, 3415, 3415, 30, 31, 'JBAAAA', 'VDLAAA', 'VVVVxx'),
+(5012, 7536, 0, 0, 2, 12, 12, 12, 1012, 12, 5012, 24, 25, 'UKAAAA', 'WDLAAA', 'AAAAxx'),
+(3187, 7537, 1, 3, 7, 7, 87, 187, 1187, 3187, 3187, 174, 175, 'PSAAAA', 'XDLAAA', 'HHHHxx'),
+(8556, 7538, 0, 0, 6, 16, 56, 556, 556, 3556, 8556, 112, 113, 'CRAAAA', 'YDLAAA', 'OOOOxx'),
+(7966, 7539, 0, 2, 6, 6, 66, 966, 1966, 2966, 7966, 132, 133, 'KUAAAA', 'ZDLAAA', 'VVVVxx'),
+(7481, 7540, 1, 1, 1, 1, 81, 481, 1481, 2481, 7481, 162, 163, 'TBAAAA', 'AELAAA', 'AAAAxx'),
+(8524, 7541, 0, 0, 4, 4, 24, 524, 524, 3524, 8524, 48, 49, 'WPAAAA', 'BELAAA', 'HHHHxx'),
+(3021, 7542, 1, 1, 1, 1, 21, 21, 1021, 3021, 3021, 42, 43, 'FMAAAA', 'CELAAA', 'OOOOxx'),
+(6045, 7543, 1, 1, 5, 5, 45, 45, 45, 1045, 6045, 90, 91, 'NYAAAA', 'DELAAA', 'VVVVxx'),
+(8022, 7544, 0, 2, 2, 2, 22, 22, 22, 3022, 8022, 44, 45, 'OWAAAA', 'EELAAA', 'AAAAxx'),
+(3626, 7545, 0, 2, 6, 6, 26, 626, 1626, 3626, 3626, 52, 53, 'MJAAAA', 'FELAAA', 'HHHHxx'),
+(1030, 7546, 0, 2, 0, 10, 30, 30, 1030, 1030, 1030, 60, 61, 'QNAAAA', 'GELAAA', 'OOOOxx'),
+(8903, 7547, 1, 3, 3, 3, 3, 903, 903, 3903, 8903, 6, 7, 'LEAAAA', 'HELAAA', 'VVVVxx'),
+(7488, 7548, 0, 0, 8, 8, 88, 488, 1488, 2488, 7488, 176, 177, 'ACAAAA', 'IELAAA', 'AAAAxx'),
+(9293, 7549, 1, 1, 3, 13, 93, 293, 1293, 4293, 9293, 186, 187, 'LTAAAA', 'JELAAA', 'HHHHxx'),
+(4586, 7550, 0, 2, 6, 6, 86, 586, 586, 4586, 4586, 172, 173, 'KUAAAA', 'KELAAA', 'OOOOxx'),
+(9282, 7551, 0, 2, 2, 2, 82, 282, 1282, 4282, 9282, 164, 165, 'ATAAAA', 'LELAAA', 'VVVVxx'),
+(1948, 7552, 0, 0, 8, 8, 48, 948, 1948, 1948, 1948, 96, 97, 'YWAAAA', 'MELAAA', 'AAAAxx'),
+(2534, 7553, 0, 2, 4, 14, 34, 534, 534, 2534, 2534, 68, 69, 'MTAAAA', 'NELAAA', 'HHHHxx'),
+(1150, 7554, 0, 2, 0, 10, 50, 150, 1150, 1150, 1150, 100, 101, 'GSAAAA', 'OELAAA', 'OOOOxx'),
+(4931, 7555, 1, 3, 1, 11, 31, 931, 931, 4931, 4931, 62, 63, 'RHAAAA', 'PELAAA', 'VVVVxx'),
+(2866, 7556, 0, 2, 6, 6, 66, 866, 866, 2866, 2866, 132, 133, 'GGAAAA', 'QELAAA', 'AAAAxx'),
+(6172, 7557, 0, 0, 2, 12, 72, 172, 172, 1172, 6172, 144, 145, 'KDAAAA', 'RELAAA', 'HHHHxx'),
+(4819, 7558, 1, 3, 9, 19, 19, 819, 819, 4819, 4819, 38, 39, 'JDAAAA', 'SELAAA', 'OOOOxx'),
+(569, 7559, 1, 1, 9, 9, 69, 569, 569, 569, 569, 138, 139, 'XVAAAA', 'TELAAA', 'VVVVxx'),
+(1146, 7560, 0, 2, 6, 6, 46, 146, 1146, 1146, 1146, 92, 93, 'CSAAAA', 'UELAAA', 'AAAAxx'),
+(3062, 7561, 0, 2, 2, 2, 62, 62, 1062, 3062, 3062, 124, 125, 'UNAAAA', 'VELAAA', 'HHHHxx'),
+(7690, 7562, 0, 2, 0, 10, 90, 690, 1690, 2690, 7690, 180, 181, 'UJAAAA', 'WELAAA', 'OOOOxx'),
+(8611, 7563, 1, 3, 1, 11, 11, 611, 611, 3611, 8611, 22, 23, 'FTAAAA', 'XELAAA', 'VVVVxx'),
+(1142, 7564, 0, 2, 2, 2, 42, 142, 1142, 1142, 1142, 84, 85, 'YRAAAA', 'YELAAA', 'AAAAxx'),
+(1193, 7565, 1, 1, 3, 13, 93, 193, 1193, 1193, 1193, 186, 187, 'XTAAAA', 'ZELAAA', 'HHHHxx'),
+(2507, 7566, 1, 3, 7, 7, 7, 507, 507, 2507, 2507, 14, 15, 'LSAAAA', 'AFLAAA', 'OOOOxx'),
+(1043, 7567, 1, 3, 3, 3, 43, 43, 1043, 1043, 1043, 86, 87, 'DOAAAA', 'BFLAAA', 'VVVVxx'),
+(7472, 7568, 0, 0, 2, 12, 72, 472, 1472, 2472, 7472, 144, 145, 'KBAAAA', 'CFLAAA', 'AAAAxx'),
+(1817, 7569, 1, 1, 7, 17, 17, 817, 1817, 1817, 1817, 34, 35, 'XRAAAA', 'DFLAAA', 'HHHHxx'),
+(3868, 7570, 0, 0, 8, 8, 68, 868, 1868, 3868, 3868, 136, 137, 'USAAAA', 'EFLAAA', 'OOOOxx'),
+(9031, 7571, 1, 3, 1, 11, 31, 31, 1031, 4031, 9031, 62, 63, 'JJAAAA', 'FFLAAA', 'VVVVxx'),
+(7254, 7572, 0, 2, 4, 14, 54, 254, 1254, 2254, 7254, 108, 109, 'ATAAAA', 'GFLAAA', 'AAAAxx'),
+(5030, 7573, 0, 2, 0, 10, 30, 30, 1030, 30, 5030, 60, 61, 'MLAAAA', 'HFLAAA', 'HHHHxx'),
+(6594, 7574, 0, 2, 4, 14, 94, 594, 594, 1594, 6594, 188, 189, 'QTAAAA', 'IFLAAA', 'OOOOxx'),
+(6862, 7575, 0, 2, 2, 2, 62, 862, 862, 1862, 6862, 124, 125, 'YDAAAA', 'JFLAAA', 'VVVVxx'),
+(1994, 7576, 0, 2, 4, 14, 94, 994, 1994, 1994, 1994, 188, 189, 'SYAAAA', 'KFLAAA', 'AAAAxx'),
+(9017, 7577, 1, 1, 7, 17, 17, 17, 1017, 4017, 9017, 34, 35, 'VIAAAA', 'LFLAAA', 'HHHHxx'),
+(5716, 7578, 0, 0, 6, 16, 16, 716, 1716, 716, 5716, 32, 33, 'WLAAAA', 'MFLAAA', 'OOOOxx'),
+(1900, 7579, 0, 0, 0, 0, 0, 900, 1900, 1900, 1900, 0, 1, 'CVAAAA', 'NFLAAA', 'VVVVxx'),
+(120, 7580, 0, 0, 0, 0, 20, 120, 120, 120, 120, 40, 41, 'QEAAAA', 'OFLAAA', 'AAAAxx'),
+(9003, 7581, 1, 3, 3, 3, 3, 3, 1003, 4003, 9003, 6, 7, 'HIAAAA', 'PFLAAA', 'HHHHxx'),
+(4178, 7582, 0, 2, 8, 18, 78, 178, 178, 4178, 4178, 156, 157, 'SEAAAA', 'QFLAAA', 'OOOOxx'),
+(8777, 7583, 1, 1, 7, 17, 77, 777, 777, 3777, 8777, 154, 155, 'PZAAAA', 'RFLAAA', 'VVVVxx'),
+(3653, 7584, 1, 1, 3, 13, 53, 653, 1653, 3653, 3653, 106, 107, 'NKAAAA', 'SFLAAA', 'AAAAxx'),
+(1137, 7585, 1, 1, 7, 17, 37, 137, 1137, 1137, 1137, 74, 75, 'TRAAAA', 'TFLAAA', 'HHHHxx'),
+(6362, 7586, 0, 2, 2, 2, 62, 362, 362, 1362, 6362, 124, 125, 'SKAAAA', 'UFLAAA', 'OOOOxx'),
+(8537, 7587, 1, 1, 7, 17, 37, 537, 537, 3537, 8537, 74, 75, 'JQAAAA', 'VFLAAA', 'VVVVxx'),
+(1590, 7588, 0, 2, 0, 10, 90, 590, 1590, 1590, 1590, 180, 181, 'EJAAAA', 'WFLAAA', 'AAAAxx'),
+(374, 7589, 0, 2, 4, 14, 74, 374, 374, 374, 374, 148, 149, 'KOAAAA', 'XFLAAA', 'HHHHxx'),
+(2597, 7590, 1, 1, 7, 17, 97, 597, 597, 2597, 2597, 194, 195, 'XVAAAA', 'YFLAAA', 'OOOOxx'),
+(8071, 7591, 1, 3, 1, 11, 71, 71, 71, 3071, 8071, 142, 143, 'LYAAAA', 'ZFLAAA', 'VVVVxx'),
+(9009, 7592, 1, 1, 9, 9, 9, 9, 1009, 4009, 9009, 18, 19, 'NIAAAA', 'AGLAAA', 'AAAAxx'),
+(1978, 7593, 0, 2, 8, 18, 78, 978, 1978, 1978, 1978, 156, 157, 'CYAAAA', 'BGLAAA', 'HHHHxx'),
+(1541, 7594, 1, 1, 1, 1, 41, 541, 1541, 1541, 1541, 82, 83, 'HHAAAA', 'CGLAAA', 'OOOOxx'),
+(4998, 7595, 0, 2, 8, 18, 98, 998, 998, 4998, 4998, 196, 197, 'GKAAAA', 'DGLAAA', 'VVVVxx'),
+(1649, 7596, 1, 1, 9, 9, 49, 649, 1649, 1649, 1649, 98, 99, 'LLAAAA', 'EGLAAA', 'AAAAxx'),
+(5426, 7597, 0, 2, 6, 6, 26, 426, 1426, 426, 5426, 52, 53, 'SAAAAA', 'FGLAAA', 'HHHHxx'),
+(1492, 7598, 0, 0, 2, 12, 92, 492, 1492, 1492, 1492, 184, 185, 'KFAAAA', 'GGLAAA', 'OOOOxx'),
+(9622, 7599, 0, 2, 2, 2, 22, 622, 1622, 4622, 9622, 44, 45, 'CGAAAA', 'HGLAAA', 'VVVVxx'),
+(701, 7600, 1, 1, 1, 1, 1, 701, 701, 701, 701, 2, 3, 'ZAAAAA', 'IGLAAA', 'AAAAxx'),
+(2781, 7601, 1, 1, 1, 1, 81, 781, 781, 2781, 2781, 162, 163, 'ZCAAAA', 'JGLAAA', 'HHHHxx'),
+(3982, 7602, 0, 2, 2, 2, 82, 982, 1982, 3982, 3982, 164, 165, 'EXAAAA', 'KGLAAA', 'OOOOxx'),
+(7259, 7603, 1, 3, 9, 19, 59, 259, 1259, 2259, 7259, 118, 119, 'FTAAAA', 'LGLAAA', 'VVVVxx'),
+(9868, 7604, 0, 0, 8, 8, 68, 868, 1868, 4868, 9868, 136, 137, 'OPAAAA', 'MGLAAA', 'AAAAxx'),
+(564, 7605, 0, 0, 4, 4, 64, 564, 564, 564, 564, 128, 129, 'SVAAAA', 'NGLAAA', 'HHHHxx'),
+(6315, 7606, 1, 3, 5, 15, 15, 315, 315, 1315, 6315, 30, 31, 'XIAAAA', 'OGLAAA', 'OOOOxx'),
+(9092, 7607, 0, 0, 2, 12, 92, 92, 1092, 4092, 9092, 184, 185, 'SLAAAA', 'PGLAAA', 'VVVVxx'),
+(8237, 7608, 1, 1, 7, 17, 37, 237, 237, 3237, 8237, 74, 75, 'VEAAAA', 'QGLAAA', 'AAAAxx'),
+(1513, 7609, 1, 1, 3, 13, 13, 513, 1513, 1513, 1513, 26, 27, 'FGAAAA', 'RGLAAA', 'HHHHxx'),
+(1922, 7610, 0, 2, 2, 2, 22, 922, 1922, 1922, 1922, 44, 45, 'YVAAAA', 'SGLAAA', 'OOOOxx'),
+(5396, 7611, 0, 0, 6, 16, 96, 396, 1396, 396, 5396, 192, 193, 'OZAAAA', 'TGLAAA', 'VVVVxx'),
+(2485, 7612, 1, 1, 5, 5, 85, 485, 485, 2485, 2485, 170, 171, 'PRAAAA', 'UGLAAA', 'AAAAxx'),
+(5774, 7613, 0, 2, 4, 14, 74, 774, 1774, 774, 5774, 148, 149, 'COAAAA', 'VGLAAA', 'HHHHxx'),
+(3983, 7614, 1, 3, 3, 3, 83, 983, 1983, 3983, 3983, 166, 167, 'FXAAAA', 'WGLAAA', 'OOOOxx'),
+(221, 7615, 1, 1, 1, 1, 21, 221, 221, 221, 221, 42, 43, 'NIAAAA', 'XGLAAA', 'VVVVxx'),
+(8662, 7616, 0, 2, 2, 2, 62, 662, 662, 3662, 8662, 124, 125, 'EVAAAA', 'YGLAAA', 'AAAAxx'),
+(2456, 7617, 0, 0, 6, 16, 56, 456, 456, 2456, 2456, 112, 113, 'MQAAAA', 'ZGLAAA', 'HHHHxx'),
+(9736, 7618, 0, 0, 6, 16, 36, 736, 1736, 4736, 9736, 72, 73, 'MKAAAA', 'AHLAAA', 'OOOOxx'),
+(8936, 7619, 0, 0, 6, 16, 36, 936, 936, 3936, 8936, 72, 73, 'SFAAAA', 'BHLAAA', 'VVVVxx'),
+(5395, 7620, 1, 3, 5, 15, 95, 395, 1395, 395, 5395, 190, 191, 'NZAAAA', 'CHLAAA', 'AAAAxx'),
+(9523, 7621, 1, 3, 3, 3, 23, 523, 1523, 4523, 9523, 46, 47, 'HCAAAA', 'DHLAAA', 'HHHHxx'),
+(6980, 7622, 0, 0, 0, 0, 80, 980, 980, 1980, 6980, 160, 161, 'MIAAAA', 'EHLAAA', 'OOOOxx'),
+(2091, 7623, 1, 3, 1, 11, 91, 91, 91, 2091, 2091, 182, 183, 'LCAAAA', 'FHLAAA', 'VVVVxx'),
+(6807, 7624, 1, 3, 7, 7, 7, 807, 807, 1807, 6807, 14, 15, 'VBAAAA', 'GHLAAA', 'AAAAxx'),
+(8818, 7625, 0, 2, 8, 18, 18, 818, 818, 3818, 8818, 36, 37, 'EBAAAA', 'HHLAAA', 'HHHHxx'),
+(5298, 7626, 0, 2, 8, 18, 98, 298, 1298, 298, 5298, 196, 197, 'UVAAAA', 'IHLAAA', 'OOOOxx'),
+(1726, 7627, 0, 2, 6, 6, 26, 726, 1726, 1726, 1726, 52, 53, 'KOAAAA', 'JHLAAA', 'VVVVxx'),
+(3878, 7628, 0, 2, 8, 18, 78, 878, 1878, 3878, 3878, 156, 157, 'ETAAAA', 'KHLAAA', 'AAAAxx'),
+(8700, 7629, 0, 0, 0, 0, 0, 700, 700, 3700, 8700, 0, 1, 'QWAAAA', 'LHLAAA', 'HHHHxx'),
+(5201, 7630, 1, 1, 1, 1, 1, 201, 1201, 201, 5201, 2, 3, 'BSAAAA', 'MHLAAA', 'OOOOxx'),
+(3936, 7631, 0, 0, 6, 16, 36, 936, 1936, 3936, 3936, 72, 73, 'KVAAAA', 'NHLAAA', 'VVVVxx'),
+(776, 7632, 0, 0, 6, 16, 76, 776, 776, 776, 776, 152, 153, 'WDAAAA', 'OHLAAA', 'AAAAxx'),
+(5302, 7633, 0, 2, 2, 2, 2, 302, 1302, 302, 5302, 4, 5, 'YVAAAA', 'PHLAAA', 'HHHHxx'),
+(3595, 7634, 1, 3, 5, 15, 95, 595, 1595, 3595, 3595, 190, 191, 'HIAAAA', 'QHLAAA', 'OOOOxx'),
+(9061, 7635, 1, 1, 1, 1, 61, 61, 1061, 4061, 9061, 122, 123, 'NKAAAA', 'RHLAAA', 'VVVVxx'),
+(6261, 7636, 1, 1, 1, 1, 61, 261, 261, 1261, 6261, 122, 123, 'VGAAAA', 'SHLAAA', 'AAAAxx'),
+(8878, 7637, 0, 2, 8, 18, 78, 878, 878, 3878, 8878, 156, 157, 'MDAAAA', 'THLAAA', 'HHHHxx'),
+(3312, 7638, 0, 0, 2, 12, 12, 312, 1312, 3312, 3312, 24, 25, 'KXAAAA', 'UHLAAA', 'OOOOxx'),
+(9422, 7639, 0, 2, 2, 2, 22, 422, 1422, 4422, 9422, 44, 45, 'KYAAAA', 'VHLAAA', 'VVVVxx'),
+(7321, 7640, 1, 1, 1, 1, 21, 321, 1321, 2321, 7321, 42, 43, 'PVAAAA', 'WHLAAA', 'AAAAxx'),
+(3813, 7641, 1, 1, 3, 13, 13, 813, 1813, 3813, 3813, 26, 27, 'RQAAAA', 'XHLAAA', 'HHHHxx'),
+(5848, 7642, 0, 0, 8, 8, 48, 848, 1848, 848, 5848, 96, 97, 'YQAAAA', 'YHLAAA', 'OOOOxx'),
+(3535, 7643, 1, 3, 5, 15, 35, 535, 1535, 3535, 3535, 70, 71, 'ZFAAAA', 'ZHLAAA', 'VVVVxx'),
+(1040, 7644, 0, 0, 0, 0, 40, 40, 1040, 1040, 1040, 80, 81, 'AOAAAA', 'AILAAA', 'AAAAxx'),
+(8572, 7645, 0, 0, 2, 12, 72, 572, 572, 3572, 8572, 144, 145, 'SRAAAA', 'BILAAA', 'HHHHxx'),
+(5435, 7646, 1, 3, 5, 15, 35, 435, 1435, 435, 5435, 70, 71, 'BBAAAA', 'CILAAA', 'OOOOxx'),
+(8199, 7647, 1, 3, 9, 19, 99, 199, 199, 3199, 8199, 198, 199, 'JDAAAA', 'DILAAA', 'VVVVxx'),
+(8775, 7648, 1, 3, 5, 15, 75, 775, 775, 3775, 8775, 150, 151, 'NZAAAA', 'EILAAA', 'AAAAxx'),
+(7722, 7649, 0, 2, 2, 2, 22, 722, 1722, 2722, 7722, 44, 45, 'ALAAAA', 'FILAAA', 'HHHHxx'),
+(3549, 7650, 1, 1, 9, 9, 49, 549, 1549, 3549, 3549, 98, 99, 'NGAAAA', 'GILAAA', 'OOOOxx'),
+(2578, 7651, 0, 2, 8, 18, 78, 578, 578, 2578, 2578, 156, 157, 'EVAAAA', 'HILAAA', 'VVVVxx'),
+(1695, 7652, 1, 3, 5, 15, 95, 695, 1695, 1695, 1695, 190, 191, 'FNAAAA', 'IILAAA', 'AAAAxx'),
+(1902, 7653, 0, 2, 2, 2, 2, 902, 1902, 1902, 1902, 4, 5, 'EVAAAA', 'JILAAA', 'HHHHxx'),
+(6058, 7654, 0, 2, 8, 18, 58, 58, 58, 1058, 6058, 116, 117, 'AZAAAA', 'KILAAA', 'OOOOxx'),
+(6591, 7655, 1, 3, 1, 11, 91, 591, 591, 1591, 6591, 182, 183, 'NTAAAA', 'LILAAA', 'VVVVxx'),
+(7962, 7656, 0, 2, 2, 2, 62, 962, 1962, 2962, 7962, 124, 125, 'GUAAAA', 'MILAAA', 'AAAAxx'),
+(5612, 7657, 0, 0, 2, 12, 12, 612, 1612, 612, 5612, 24, 25, 'WHAAAA', 'NILAAA', 'HHHHxx'),
+(3341, 7658, 1, 1, 1, 1, 41, 341, 1341, 3341, 3341, 82, 83, 'NYAAAA', 'OILAAA', 'OOOOxx'),
+(5460, 7659, 0, 0, 0, 0, 60, 460, 1460, 460, 5460, 120, 121, 'ACAAAA', 'PILAAA', 'VVVVxx'),
+(2368, 7660, 0, 0, 8, 8, 68, 368, 368, 2368, 2368, 136, 137, 'CNAAAA', 'QILAAA', 'AAAAxx'),
+(8646, 7661, 0, 2, 6, 6, 46, 646, 646, 3646, 8646, 92, 93, 'OUAAAA', 'RILAAA', 'HHHHxx'),
+(4987, 7662, 1, 3, 7, 7, 87, 987, 987, 4987, 4987, 174, 175, 'VJAAAA', 'SILAAA', 'OOOOxx'),
+(9018, 7663, 0, 2, 8, 18, 18, 18, 1018, 4018, 9018, 36, 37, 'WIAAAA', 'TILAAA', 'VVVVxx'),
+(8685, 7664, 1, 1, 5, 5, 85, 685, 685, 3685, 8685, 170, 171, 'BWAAAA', 'UILAAA', 'AAAAxx'),
+(694, 7665, 0, 2, 4, 14, 94, 694, 694, 694, 694, 188, 189, 'SAAAAA', 'VILAAA', 'HHHHxx'),
+(2012, 7666, 0, 0, 2, 12, 12, 12, 12, 2012, 2012, 24, 25, 'KZAAAA', 'WILAAA', 'OOOOxx'),
+(2417, 7667, 1, 1, 7, 17, 17, 417, 417, 2417, 2417, 34, 35, 'ZOAAAA', 'XILAAA', 'VVVVxx'),
+(4022, 7668, 0, 2, 2, 2, 22, 22, 22, 4022, 4022, 44, 45, 'SYAAAA', 'YILAAA', 'AAAAxx'),
+(5935, 7669, 1, 3, 5, 15, 35, 935, 1935, 935, 5935, 70, 71, 'HUAAAA', 'ZILAAA', 'HHHHxx'),
+(1656, 7670, 0, 0, 6, 16, 56, 656, 1656, 1656, 1656, 112, 113, 'SLAAAA', 'AJLAAA', 'OOOOxx'),
+(6195, 7671, 1, 3, 5, 15, 95, 195, 195, 1195, 6195, 190, 191, 'HEAAAA', 'BJLAAA', 'VVVVxx'),
+(3057, 7672, 1, 1, 7, 17, 57, 57, 1057, 3057, 3057, 114, 115, 'PNAAAA', 'CJLAAA', 'AAAAxx'),
+(2852, 7673, 0, 0, 2, 12, 52, 852, 852, 2852, 2852, 104, 105, 'SFAAAA', 'DJLAAA', 'HHHHxx'),
+(4634, 7674, 0, 2, 4, 14, 34, 634, 634, 4634, 4634, 68, 69, 'GWAAAA', 'EJLAAA', 'OOOOxx'),
+(1689, 7675, 1, 1, 9, 9, 89, 689, 1689, 1689, 1689, 178, 179, 'ZMAAAA', 'FJLAAA', 'VVVVxx'),
+(4102, 7676, 0, 2, 2, 2, 2, 102, 102, 4102, 4102, 4, 5, 'UBAAAA', 'GJLAAA', 'AAAAxx'),
+(3287, 7677, 1, 3, 7, 7, 87, 287, 1287, 3287, 3287, 174, 175, 'LWAAAA', 'HJLAAA', 'HHHHxx'),
+(5246, 7678, 0, 2, 6, 6, 46, 246, 1246, 246, 5246, 92, 93, 'UTAAAA', 'IJLAAA', 'OOOOxx'),
+(7450, 7679, 0, 2, 0, 10, 50, 450, 1450, 2450, 7450, 100, 101, 'OAAAAA', 'JJLAAA', 'VVVVxx'),
+(6548, 7680, 0, 0, 8, 8, 48, 548, 548, 1548, 6548, 96, 97, 'WRAAAA', 'KJLAAA', 'AAAAxx'),
+(379, 7681, 1, 3, 9, 19, 79, 379, 379, 379, 379, 158, 159, 'POAAAA', 'LJLAAA', 'HHHHxx'),
+(7435, 7682, 1, 3, 5, 15, 35, 435, 1435, 2435, 7435, 70, 71, 'ZZAAAA', 'MJLAAA', 'OOOOxx'),
+(2041, 7683, 1, 1, 1, 1, 41, 41, 41, 2041, 2041, 82, 83, 'NAAAAA', 'NJLAAA', 'VVVVxx'),
+(8462, 7684, 0, 2, 2, 2, 62, 462, 462, 3462, 8462, 124, 125, 'MNAAAA', 'OJLAAA', 'AAAAxx'),
+(9076, 7685, 0, 0, 6, 16, 76, 76, 1076, 4076, 9076, 152, 153, 'CLAAAA', 'PJLAAA', 'HHHHxx'),
+(761, 7686, 1, 1, 1, 1, 61, 761, 761, 761, 761, 122, 123, 'HDAAAA', 'QJLAAA', 'OOOOxx'),
+(795, 7687, 1, 3, 5, 15, 95, 795, 795, 795, 795, 190, 191, 'PEAAAA', 'RJLAAA', 'VVVVxx'),
+(1671, 7688, 1, 3, 1, 11, 71, 671, 1671, 1671, 1671, 142, 143, 'HMAAAA', 'SJLAAA', 'AAAAxx'),
+(695, 7689, 1, 3, 5, 15, 95, 695, 695, 695, 695, 190, 191, 'TAAAAA', 'TJLAAA', 'HHHHxx'),
+(4981, 7690, 1, 1, 1, 1, 81, 981, 981, 4981, 4981, 162, 163, 'PJAAAA', 'UJLAAA', 'OOOOxx'),
+(1211, 7691, 1, 3, 1, 11, 11, 211, 1211, 1211, 1211, 22, 23, 'PUAAAA', 'VJLAAA', 'VVVVxx'),
+(5914, 7692, 0, 2, 4, 14, 14, 914, 1914, 914, 5914, 28, 29, 'MTAAAA', 'WJLAAA', 'AAAAxx'),
+(9356, 7693, 0, 0, 6, 16, 56, 356, 1356, 4356, 9356, 112, 113, 'WVAAAA', 'XJLAAA', 'HHHHxx'),
+(1500, 7694, 0, 0, 0, 0, 0, 500, 1500, 1500, 1500, 0, 1, 'SFAAAA', 'YJLAAA', 'OOOOxx'),
+(3353, 7695, 1, 1, 3, 13, 53, 353, 1353, 3353, 3353, 106, 107, 'ZYAAAA', 'ZJLAAA', 'VVVVxx'),
+(1060, 7696, 0, 0, 0, 0, 60, 60, 1060, 1060, 1060, 120, 121, 'UOAAAA', 'AKLAAA', 'AAAAxx'),
+(7910, 7697, 0, 2, 0, 10, 10, 910, 1910, 2910, 7910, 20, 21, 'GSAAAA', 'BKLAAA', 'HHHHxx'),
+(1329, 7698, 1, 1, 9, 9, 29, 329, 1329, 1329, 1329, 58, 59, 'DZAAAA', 'CKLAAA', 'OOOOxx'),
+(6011, 7699, 1, 3, 1, 11, 11, 11, 11, 1011, 6011, 22, 23, 'FXAAAA', 'DKLAAA', 'VVVVxx'),
+(7146, 7700, 0, 2, 6, 6, 46, 146, 1146, 2146, 7146, 92, 93, 'WOAAAA', 'EKLAAA', 'AAAAxx'),
+(4602, 7701, 0, 2, 2, 2, 2, 602, 602, 4602, 4602, 4, 5, 'AVAAAA', 'FKLAAA', 'HHHHxx'),
+(6751, 7702, 1, 3, 1, 11, 51, 751, 751, 1751, 6751, 102, 103, 'RZAAAA', 'GKLAAA', 'OOOOxx'),
+(2666, 7703, 0, 2, 6, 6, 66, 666, 666, 2666, 2666, 132, 133, 'OYAAAA', 'HKLAAA', 'VVVVxx'),
+(2785, 7704, 1, 1, 5, 5, 85, 785, 785, 2785, 2785, 170, 171, 'DDAAAA', 'IKLAAA', 'AAAAxx'),
+(5851, 7705, 1, 3, 1, 11, 51, 851, 1851, 851, 5851, 102, 103, 'BRAAAA', 'JKLAAA', 'HHHHxx'),
+(2435, 7706, 1, 3, 5, 15, 35, 435, 435, 2435, 2435, 70, 71, 'RPAAAA', 'KKLAAA', 'OOOOxx'),
+(7429, 7707, 1, 1, 9, 9, 29, 429, 1429, 2429, 7429, 58, 59, 'TZAAAA', 'LKLAAA', 'VVVVxx'),
+(4241, 7708, 1, 1, 1, 1, 41, 241, 241, 4241, 4241, 82, 83, 'DHAAAA', 'MKLAAA', 'AAAAxx'),
+(5691, 7709, 1, 3, 1, 11, 91, 691, 1691, 691, 5691, 182, 183, 'XKAAAA', 'NKLAAA', 'HHHHxx'),
+(7731, 7710, 1, 3, 1, 11, 31, 731, 1731, 2731, 7731, 62, 63, 'JLAAAA', 'OKLAAA', 'OOOOxx'),
+(249, 7711, 1, 1, 9, 9, 49, 249, 249, 249, 249, 98, 99, 'PJAAAA', 'PKLAAA', 'VVVVxx'),
+(1731, 7712, 1, 3, 1, 11, 31, 731, 1731, 1731, 1731, 62, 63, 'POAAAA', 'QKLAAA', 'AAAAxx'),
+(8716, 7713, 0, 0, 6, 16, 16, 716, 716, 3716, 8716, 32, 33, 'GXAAAA', 'RKLAAA', 'HHHHxx'),
+(2670, 7714, 0, 2, 0, 10, 70, 670, 670, 2670, 2670, 140, 141, 'SYAAAA', 'SKLAAA', 'OOOOxx'),
+(4654, 7715, 0, 2, 4, 14, 54, 654, 654, 4654, 4654, 108, 109, 'AXAAAA', 'TKLAAA', 'VVVVxx'),
+(1027, 7716, 1, 3, 7, 7, 27, 27, 1027, 1027, 1027, 54, 55, 'NNAAAA', 'UKLAAA', 'AAAAxx'),
+(1099, 7717, 1, 3, 9, 19, 99, 99, 1099, 1099, 1099, 198, 199, 'HQAAAA', 'VKLAAA', 'HHHHxx'),
+(3617, 7718, 1, 1, 7, 17, 17, 617, 1617, 3617, 3617, 34, 35, 'DJAAAA', 'WKLAAA', 'OOOOxx'),
+(4330, 7719, 0, 2, 0, 10, 30, 330, 330, 4330, 4330, 60, 61, 'OKAAAA', 'XKLAAA', 'VVVVxx'),
+(9750, 7720, 0, 2, 0, 10, 50, 750, 1750, 4750, 9750, 100, 101, 'ALAAAA', 'YKLAAA', 'AAAAxx'),
+(467, 7721, 1, 3, 7, 7, 67, 467, 467, 467, 467, 134, 135, 'ZRAAAA', 'ZKLAAA', 'HHHHxx'),
+(8525, 7722, 1, 1, 5, 5, 25, 525, 525, 3525, 8525, 50, 51, 'XPAAAA', 'ALLAAA', 'OOOOxx'),
+(5990, 7723, 0, 2, 0, 10, 90, 990, 1990, 990, 5990, 180, 181, 'KWAAAA', 'BLLAAA', 'VVVVxx'),
+(4839, 7724, 1, 3, 9, 19, 39, 839, 839, 4839, 4839, 78, 79, 'DEAAAA', 'CLLAAA', 'AAAAxx'),
+(9914, 7725, 0, 2, 4, 14, 14, 914, 1914, 4914, 9914, 28, 29, 'IRAAAA', 'DLLAAA', 'HHHHxx'),
+(7047, 7726, 1, 3, 7, 7, 47, 47, 1047, 2047, 7047, 94, 95, 'BLAAAA', 'ELLAAA', 'OOOOxx'),
+(874, 7727, 0, 2, 4, 14, 74, 874, 874, 874, 874, 148, 149, 'QHAAAA', 'FLLAAA', 'VVVVxx'),
+(6061, 7728, 1, 1, 1, 1, 61, 61, 61, 1061, 6061, 122, 123, 'DZAAAA', 'GLLAAA', 'AAAAxx'),
+(5491, 7729, 1, 3, 1, 11, 91, 491, 1491, 491, 5491, 182, 183, 'FDAAAA', 'HLLAAA', 'HHHHxx'),
+(4344, 7730, 0, 0, 4, 4, 44, 344, 344, 4344, 4344, 88, 89, 'CLAAAA', 'ILLAAA', 'OOOOxx'),
+(1281, 7731, 1, 1, 1, 1, 81, 281, 1281, 1281, 1281, 162, 163, 'HXAAAA', 'JLLAAA', 'VVVVxx'),
+(3597, 7732, 1, 1, 7, 17, 97, 597, 1597, 3597, 3597, 194, 195, 'JIAAAA', 'KLLAAA', 'AAAAxx'),
+(4992, 7733, 0, 0, 2, 12, 92, 992, 992, 4992, 4992, 184, 185, 'AKAAAA', 'LLLAAA', 'HHHHxx'),
+(3849, 7734, 1, 1, 9, 9, 49, 849, 1849, 3849, 3849, 98, 99, 'BSAAAA', 'MLLAAA', 'OOOOxx'),
+(2655, 7735, 1, 3, 5, 15, 55, 655, 655, 2655, 2655, 110, 111, 'DYAAAA', 'NLLAAA', 'VVVVxx'),
+(147, 7736, 1, 3, 7, 7, 47, 147, 147, 147, 147, 94, 95, 'RFAAAA', 'OLLAAA', 'AAAAxx'),
+(9110, 7737, 0, 2, 0, 10, 10, 110, 1110, 4110, 9110, 20, 21, 'KMAAAA', 'PLLAAA', 'HHHHxx'),
+(1637, 7738, 1, 1, 7, 17, 37, 637, 1637, 1637, 1637, 74, 75, 'ZKAAAA', 'QLLAAA', 'OOOOxx'),
+(9826, 7739, 0, 2, 6, 6, 26, 826, 1826, 4826, 9826, 52, 53, 'YNAAAA', 'RLLAAA', 'VVVVxx'),
+(5957, 7740, 1, 1, 7, 17, 57, 957, 1957, 957, 5957, 114, 115, 'DVAAAA', 'SLLAAA', 'AAAAxx'),
+(6932, 7741, 0, 0, 2, 12, 32, 932, 932, 1932, 6932, 64, 65, 'QGAAAA', 'TLLAAA', 'HHHHxx'),
+(9684, 7742, 0, 0, 4, 4, 84, 684, 1684, 4684, 9684, 168, 169, 'MIAAAA', 'ULLAAA', 'OOOOxx'),
+(4653, 7743, 1, 1, 3, 13, 53, 653, 653, 4653, 4653, 106, 107, 'ZWAAAA', 'VLLAAA', 'VVVVxx'),
+(8065, 7744, 1, 1, 5, 5, 65, 65, 65, 3065, 8065, 130, 131, 'FYAAAA', 'WLLAAA', 'AAAAxx'),
+(1202, 7745, 0, 2, 2, 2, 2, 202, 1202, 1202, 1202, 4, 5, 'GUAAAA', 'XLLAAA', 'HHHHxx'),
+(9214, 7746, 0, 2, 4, 14, 14, 214, 1214, 4214, 9214, 28, 29, 'KQAAAA', 'YLLAAA', 'OOOOxx'),
+(196, 7747, 0, 0, 6, 16, 96, 196, 196, 196, 196, 192, 193, 'OHAAAA', 'ZLLAAA', 'VVVVxx'),
+(4486, 7748, 0, 2, 6, 6, 86, 486, 486, 4486, 4486, 172, 173, 'OQAAAA', 'AMLAAA', 'AAAAxx'),
+(2585, 7749, 1, 1, 5, 5, 85, 585, 585, 2585, 2585, 170, 171, 'LVAAAA', 'BMLAAA', 'HHHHxx'),
+(2464, 7750, 0, 0, 4, 4, 64, 464, 464, 2464, 2464, 128, 129, 'UQAAAA', 'CMLAAA', 'OOOOxx'),
+(3467, 7751, 1, 3, 7, 7, 67, 467, 1467, 3467, 3467, 134, 135, 'JDAAAA', 'DMLAAA', 'VVVVxx'),
+(9295, 7752, 1, 3, 5, 15, 95, 295, 1295, 4295, 9295, 190, 191, 'NTAAAA', 'EMLAAA', 'AAAAxx'),
+(517, 7753, 1, 1, 7, 17, 17, 517, 517, 517, 517, 34, 35, 'XTAAAA', 'FMLAAA', 'HHHHxx'),
+(6870, 7754, 0, 2, 0, 10, 70, 870, 870, 1870, 6870, 140, 141, 'GEAAAA', 'GMLAAA', 'OOOOxx'),
+(5732, 7755, 0, 0, 2, 12, 32, 732, 1732, 732, 5732, 64, 65, 'MMAAAA', 'HMLAAA', 'VVVVxx'),
+(9376, 7756, 0, 0, 6, 16, 76, 376, 1376, 4376, 9376, 152, 153, 'QWAAAA', 'IMLAAA', 'AAAAxx'),
+(838, 7757, 0, 2, 8, 18, 38, 838, 838, 838, 838, 76, 77, 'GGAAAA', 'JMLAAA', 'HHHHxx'),
+(9254, 7758, 0, 2, 4, 14, 54, 254, 1254, 4254, 9254, 108, 109, 'YRAAAA', 'KMLAAA', 'OOOOxx'),
+(8879, 7759, 1, 3, 9, 19, 79, 879, 879, 3879, 8879, 158, 159, 'NDAAAA', 'LMLAAA', 'VVVVxx'),
+(6281, 7760, 1, 1, 1, 1, 81, 281, 281, 1281, 6281, 162, 163, 'PHAAAA', 'MMLAAA', 'AAAAxx'),
+(8216, 7761, 0, 0, 6, 16, 16, 216, 216, 3216, 8216, 32, 33, 'AEAAAA', 'NMLAAA', 'HHHHxx'),
+(9213, 7762, 1, 1, 3, 13, 13, 213, 1213, 4213, 9213, 26, 27, 'JQAAAA', 'OMLAAA', 'OOOOxx'),
+(7234, 7763, 0, 2, 4, 14, 34, 234, 1234, 2234, 7234, 68, 69, 'GSAAAA', 'PMLAAA', 'VVVVxx'),
+(5692, 7764, 0, 0, 2, 12, 92, 692, 1692, 692, 5692, 184, 185, 'YKAAAA', 'QMLAAA', 'AAAAxx'),
+(693, 7765, 1, 1, 3, 13, 93, 693, 693, 693, 693, 186, 187, 'RAAAAA', 'RMLAAA', 'HHHHxx'),
+(9050, 7766, 0, 2, 0, 10, 50, 50, 1050, 4050, 9050, 100, 101, 'CKAAAA', 'SMLAAA', 'OOOOxx'),
+(3623, 7767, 1, 3, 3, 3, 23, 623, 1623, 3623, 3623, 46, 47, 'JJAAAA', 'TMLAAA', 'VVVVxx'),
+(2130, 7768, 0, 2, 0, 10, 30, 130, 130, 2130, 2130, 60, 61, 'YDAAAA', 'UMLAAA', 'AAAAxx'),
+(2514, 7769, 0, 2, 4, 14, 14, 514, 514, 2514, 2514, 28, 29, 'SSAAAA', 'VMLAAA', 'HHHHxx'),
+(1812, 7770, 0, 0, 2, 12, 12, 812, 1812, 1812, 1812, 24, 25, 'SRAAAA', 'WMLAAA', 'OOOOxx'),
+(9037, 7771, 1, 1, 7, 17, 37, 37, 1037, 4037, 9037, 74, 75, 'PJAAAA', 'XMLAAA', 'VVVVxx'),
+(5054, 7772, 0, 2, 4, 14, 54, 54, 1054, 54, 5054, 108, 109, 'KMAAAA', 'YMLAAA', 'AAAAxx'),
+(7801, 7773, 1, 1, 1, 1, 1, 801, 1801, 2801, 7801, 2, 3, 'BOAAAA', 'ZMLAAA', 'HHHHxx'),
+(7939, 7774, 1, 3, 9, 19, 39, 939, 1939, 2939, 7939, 78, 79, 'JTAAAA', 'ANLAAA', 'OOOOxx'),
+(7374, 7775, 0, 2, 4, 14, 74, 374, 1374, 2374, 7374, 148, 149, 'QXAAAA', 'BNLAAA', 'VVVVxx'),
+(1058, 7776, 0, 2, 8, 18, 58, 58, 1058, 1058, 1058, 116, 117, 'SOAAAA', 'CNLAAA', 'AAAAxx'),
+(1972, 7777, 0, 0, 2, 12, 72, 972, 1972, 1972, 1972, 144, 145, 'WXAAAA', 'DNLAAA', 'HHHHxx'),
+(3741, 7778, 1, 1, 1, 1, 41, 741, 1741, 3741, 3741, 82, 83, 'XNAAAA', 'ENLAAA', 'OOOOxx'),
+(2227, 7779, 1, 3, 7, 7, 27, 227, 227, 2227, 2227, 54, 55, 'RHAAAA', 'FNLAAA', 'VVVVxx'),
+(304, 7780, 0, 0, 4, 4, 4, 304, 304, 304, 304, 8, 9, 'SLAAAA', 'GNLAAA', 'AAAAxx'),
+(4914, 7781, 0, 2, 4, 14, 14, 914, 914, 4914, 4914, 28, 29, 'AHAAAA', 'HNLAAA', 'HHHHxx'),
+(2428, 7782, 0, 0, 8, 8, 28, 428, 428, 2428, 2428, 56, 57, 'KPAAAA', 'INLAAA', 'OOOOxx'),
+(6660, 7783, 0, 0, 0, 0, 60, 660, 660, 1660, 6660, 120, 121, 'EWAAAA', 'JNLAAA', 'VVVVxx'),
+(2676, 7784, 0, 0, 6, 16, 76, 676, 676, 2676, 2676, 152, 153, 'YYAAAA', 'KNLAAA', 'AAAAxx'),
+(2454, 7785, 0, 2, 4, 14, 54, 454, 454, 2454, 2454, 108, 109, 'KQAAAA', 'LNLAAA', 'HHHHxx'),
+(3798, 7786, 0, 2, 8, 18, 98, 798, 1798, 3798, 3798, 196, 197, 'CQAAAA', 'MNLAAA', 'OOOOxx'),
+(1341, 7787, 1, 1, 1, 1, 41, 341, 1341, 1341, 1341, 82, 83, 'PZAAAA', 'NNLAAA', 'VVVVxx'),
+(1611, 7788, 1, 3, 1, 11, 11, 611, 1611, 1611, 1611, 22, 23, 'ZJAAAA', 'ONLAAA', 'AAAAxx'),
+(2681, 7789, 1, 1, 1, 1, 81, 681, 681, 2681, 2681, 162, 163, 'DZAAAA', 'PNLAAA', 'HHHHxx'),
+(7292, 7790, 0, 0, 2, 12, 92, 292, 1292, 2292, 7292, 184, 185, 'MUAAAA', 'QNLAAA', 'OOOOxx'),
+(7775, 7791, 1, 3, 5, 15, 75, 775, 1775, 2775, 7775, 150, 151, 'BNAAAA', 'RNLAAA', 'VVVVxx'),
+(794, 7792, 0, 2, 4, 14, 94, 794, 794, 794, 794, 188, 189, 'OEAAAA', 'SNLAAA', 'AAAAxx'),
+(8709, 7793, 1, 1, 9, 9, 9, 709, 709, 3709, 8709, 18, 19, 'ZWAAAA', 'TNLAAA', 'HHHHxx'),
+(1901, 7794, 1, 1, 1, 1, 1, 901, 1901, 1901, 1901, 2, 3, 'DVAAAA', 'UNLAAA', 'OOOOxx'),
+(3089, 7795, 1, 1, 9, 9, 89, 89, 1089, 3089, 3089, 178, 179, 'VOAAAA', 'VNLAAA', 'VVVVxx'),
+(7797, 7796, 1, 1, 7, 17, 97, 797, 1797, 2797, 7797, 194, 195, 'XNAAAA', 'WNLAAA', 'AAAAxx'),
+(6070, 7797, 0, 2, 0, 10, 70, 70, 70, 1070, 6070, 140, 141, 'MZAAAA', 'XNLAAA', 'HHHHxx'),
+(2191, 7798, 1, 3, 1, 11, 91, 191, 191, 2191, 2191, 182, 183, 'HGAAAA', 'YNLAAA', 'OOOOxx'),
+(3497, 7799, 1, 1, 7, 17, 97, 497, 1497, 3497, 3497, 194, 195, 'NEAAAA', 'ZNLAAA', 'VVVVxx'),
+(8302, 7800, 0, 2, 2, 2, 2, 302, 302, 3302, 8302, 4, 5, 'IHAAAA', 'AOLAAA', 'AAAAxx'),
+(4365, 7801, 1, 1, 5, 5, 65, 365, 365, 4365, 4365, 130, 131, 'XLAAAA', 'BOLAAA', 'HHHHxx'),
+(3588, 7802, 0, 0, 8, 8, 88, 588, 1588, 3588, 3588, 176, 177, 'AIAAAA', 'COLAAA', 'OOOOxx'),
+(8292, 7803, 0, 0, 2, 12, 92, 292, 292, 3292, 8292, 184, 185, 'YGAAAA', 'DOLAAA', 'VVVVxx'),
+(4696, 7804, 0, 0, 6, 16, 96, 696, 696, 4696, 4696, 192, 193, 'QYAAAA', 'EOLAAA', 'AAAAxx'),
+(5641, 7805, 1, 1, 1, 1, 41, 641, 1641, 641, 5641, 82, 83, 'ZIAAAA', 'FOLAAA', 'HHHHxx'),
+(9386, 7806, 0, 2, 6, 6, 86, 386, 1386, 4386, 9386, 172, 173, 'AXAAAA', 'GOLAAA', 'OOOOxx'),
+(507, 7807, 1, 3, 7, 7, 7, 507, 507, 507, 507, 14, 15, 'NTAAAA', 'HOLAAA', 'VVVVxx'),
+(7201, 7808, 1, 1, 1, 1, 1, 201, 1201, 2201, 7201, 2, 3, 'ZQAAAA', 'IOLAAA', 'AAAAxx'),
+(7785, 7809, 1, 1, 5, 5, 85, 785, 1785, 2785, 7785, 170, 171, 'LNAAAA', 'JOLAAA', 'HHHHxx'),
+(463, 7810, 1, 3, 3, 3, 63, 463, 463, 463, 463, 126, 127, 'VRAAAA', 'KOLAAA', 'OOOOxx'),
+(6656, 7811, 0, 0, 6, 16, 56, 656, 656, 1656, 6656, 112, 113, 'AWAAAA', 'LOLAAA', 'VVVVxx'),
+(807, 7812, 1, 3, 7, 7, 7, 807, 807, 807, 807, 14, 15, 'BFAAAA', 'MOLAAA', 'AAAAxx'),
+(7278, 7813, 0, 2, 8, 18, 78, 278, 1278, 2278, 7278, 156, 157, 'YTAAAA', 'NOLAAA', 'HHHHxx'),
+(6237, 7814, 1, 1, 7, 17, 37, 237, 237, 1237, 6237, 74, 75, 'XFAAAA', 'OOLAAA', 'OOOOxx'),
+(7671, 7815, 1, 3, 1, 11, 71, 671, 1671, 2671, 7671, 142, 143, 'BJAAAA', 'POLAAA', 'VVVVxx'),
+(2235, 7816, 1, 3, 5, 15, 35, 235, 235, 2235, 2235, 70, 71, 'ZHAAAA', 'QOLAAA', 'AAAAxx'),
+(4042, 7817, 0, 2, 2, 2, 42, 42, 42, 4042, 4042, 84, 85, 'MZAAAA', 'ROLAAA', 'HHHHxx'),
+(5273, 7818, 1, 1, 3, 13, 73, 273, 1273, 273, 5273, 146, 147, 'VUAAAA', 'SOLAAA', 'OOOOxx'),
+(7557, 7819, 1, 1, 7, 17, 57, 557, 1557, 2557, 7557, 114, 115, 'REAAAA', 'TOLAAA', 'VVVVxx'),
+(4007, 7820, 1, 3, 7, 7, 7, 7, 7, 4007, 4007, 14, 15, 'DYAAAA', 'UOLAAA', 'AAAAxx'),
+(1428, 7821, 0, 0, 8, 8, 28, 428, 1428, 1428, 1428, 56, 57, 'YCAAAA', 'VOLAAA', 'HHHHxx'),
+(9739, 7822, 1, 3, 9, 19, 39, 739, 1739, 4739, 9739, 78, 79, 'PKAAAA', 'WOLAAA', 'OOOOxx'),
+(7836, 7823, 0, 0, 6, 16, 36, 836, 1836, 2836, 7836, 72, 73, 'KPAAAA', 'XOLAAA', 'VVVVxx'),
+(1777, 7824, 1, 1, 7, 17, 77, 777, 1777, 1777, 1777, 154, 155, 'JQAAAA', 'YOLAAA', 'AAAAxx'),
+(5192, 7825, 0, 0, 2, 12, 92, 192, 1192, 192, 5192, 184, 185, 'SRAAAA', 'ZOLAAA', 'HHHHxx'),
+(7236, 7826, 0, 0, 6, 16, 36, 236, 1236, 2236, 7236, 72, 73, 'ISAAAA', 'APLAAA', 'OOOOxx'),
+(1623, 7827, 1, 3, 3, 3, 23, 623, 1623, 1623, 1623, 46, 47, 'LKAAAA', 'BPLAAA', 'VVVVxx'),
+(8288, 7828, 0, 0, 8, 8, 88, 288, 288, 3288, 8288, 176, 177, 'UGAAAA', 'CPLAAA', 'AAAAxx'),
+(2827, 7829, 1, 3, 7, 7, 27, 827, 827, 2827, 2827, 54, 55, 'TEAAAA', 'DPLAAA', 'HHHHxx'),
+(458, 7830, 0, 2, 8, 18, 58, 458, 458, 458, 458, 116, 117, 'QRAAAA', 'EPLAAA', 'OOOOxx'),
+(1818, 7831, 0, 2, 8, 18, 18, 818, 1818, 1818, 1818, 36, 37, 'YRAAAA', 'FPLAAA', 'VVVVxx'),
+(6837, 7832, 1, 1, 7, 17, 37, 837, 837, 1837, 6837, 74, 75, 'ZCAAAA', 'GPLAAA', 'AAAAxx'),
+(7825, 7833, 1, 1, 5, 5, 25, 825, 1825, 2825, 7825, 50, 51, 'ZOAAAA', 'HPLAAA', 'HHHHxx'),
+(9146, 7834, 0, 2, 6, 6, 46, 146, 1146, 4146, 9146, 92, 93, 'UNAAAA', 'IPLAAA', 'OOOOxx'),
+(8451, 7835, 1, 3, 1, 11, 51, 451, 451, 3451, 8451, 102, 103, 'BNAAAA', 'JPLAAA', 'VVVVxx'),
+(6438, 7836, 0, 2, 8, 18, 38, 438, 438, 1438, 6438, 76, 77, 'QNAAAA', 'KPLAAA', 'AAAAxx'),
+(4020, 7837, 0, 0, 0, 0, 20, 20, 20, 4020, 4020, 40, 41, 'QYAAAA', 'LPLAAA', 'HHHHxx'),
+(4068, 7838, 0, 0, 8, 8, 68, 68, 68, 4068, 4068, 136, 137, 'MAAAAA', 'MPLAAA', 'OOOOxx'),
+(2411, 7839, 1, 3, 1, 11, 11, 411, 411, 2411, 2411, 22, 23, 'TOAAAA', 'NPLAAA', 'VVVVxx'),
+(6222, 7840, 0, 2, 2, 2, 22, 222, 222, 1222, 6222, 44, 45, 'IFAAAA', 'OPLAAA', 'AAAAxx'),
+(3164, 7841, 0, 0, 4, 4, 64, 164, 1164, 3164, 3164, 128, 129, 'SRAAAA', 'PPLAAA', 'HHHHxx'),
+(311, 7842, 1, 3, 1, 11, 11, 311, 311, 311, 311, 22, 23, 'ZLAAAA', 'QPLAAA', 'OOOOxx'),
+(5683, 7843, 1, 3, 3, 3, 83, 683, 1683, 683, 5683, 166, 167, 'PKAAAA', 'RPLAAA', 'VVVVxx'),
+(3993, 7844, 1, 1, 3, 13, 93, 993, 1993, 3993, 3993, 186, 187, 'PXAAAA', 'SPLAAA', 'AAAAxx'),
+(9897, 7845, 1, 1, 7, 17, 97, 897, 1897, 4897, 9897, 194, 195, 'RQAAAA', 'TPLAAA', 'HHHHxx'),
+(6609, 7846, 1, 1, 9, 9, 9, 609, 609, 1609, 6609, 18, 19, 'FUAAAA', 'UPLAAA', 'OOOOxx'),
+(1362, 7847, 0, 2, 2, 2, 62, 362, 1362, 1362, 1362, 124, 125, 'KAAAAA', 'VPLAAA', 'VVVVxx'),
+(3918, 7848, 0, 2, 8, 18, 18, 918, 1918, 3918, 3918, 36, 37, 'SUAAAA', 'WPLAAA', 'AAAAxx'),
+(7376, 7849, 0, 0, 6, 16, 76, 376, 1376, 2376, 7376, 152, 153, 'SXAAAA', 'XPLAAA', 'HHHHxx'),
+(6996, 7850, 0, 0, 6, 16, 96, 996, 996, 1996, 6996, 192, 193, 'CJAAAA', 'YPLAAA', 'OOOOxx'),
+(9567, 7851, 1, 3, 7, 7, 67, 567, 1567, 4567, 9567, 134, 135, 'ZDAAAA', 'ZPLAAA', 'VVVVxx'),
+(7525, 7852, 1, 1, 5, 5, 25, 525, 1525, 2525, 7525, 50, 51, 'LDAAAA', 'AQLAAA', 'AAAAxx'),
+(9069, 7853, 1, 1, 9, 9, 69, 69, 1069, 4069, 9069, 138, 139, 'VKAAAA', 'BQLAAA', 'HHHHxx'),
+(9999, 7854, 1, 3, 9, 19, 99, 999, 1999, 4999, 9999, 198, 199, 'PUAAAA', 'CQLAAA', 'OOOOxx'),
+(9237, 7855, 1, 1, 7, 17, 37, 237, 1237, 4237, 9237, 74, 75, 'HRAAAA', 'DQLAAA', 'VVVVxx'),
+(8441, 7856, 1, 1, 1, 1, 41, 441, 441, 3441, 8441, 82, 83, 'RMAAAA', 'EQLAAA', 'AAAAxx'),
+(6769, 7857, 1, 1, 9, 9, 69, 769, 769, 1769, 6769, 138, 139, 'JAAAAA', 'FQLAAA', 'HHHHxx'),
+(6073, 7858, 1, 1, 3, 13, 73, 73, 73, 1073, 6073, 146, 147, 'PZAAAA', 'GQLAAA', 'OOOOxx'),
+(1091, 7859, 1, 3, 1, 11, 91, 91, 1091, 1091, 1091, 182, 183, 'ZPAAAA', 'HQLAAA', 'VVVVxx'),
+(9886, 7860, 0, 2, 6, 6, 86, 886, 1886, 4886, 9886, 172, 173, 'GQAAAA', 'IQLAAA', 'AAAAxx'),
+(3971, 7861, 1, 3, 1, 11, 71, 971, 1971, 3971, 3971, 142, 143, 'TWAAAA', 'JQLAAA', 'HHHHxx'),
+(4621, 7862, 1, 1, 1, 1, 21, 621, 621, 4621, 4621, 42, 43, 'TVAAAA', 'KQLAAA', 'OOOOxx'),
+(3120, 7863, 0, 0, 0, 0, 20, 120, 1120, 3120, 3120, 40, 41, 'AQAAAA', 'LQLAAA', 'VVVVxx'),
+(9773, 7864, 1, 1, 3, 13, 73, 773, 1773, 4773, 9773, 146, 147, 'XLAAAA', 'MQLAAA', 'AAAAxx'),
+(8712, 7865, 0, 0, 2, 12, 12, 712, 712, 3712, 8712, 24, 25, 'CXAAAA', 'NQLAAA', 'HHHHxx'),
+(801, 7866, 1, 1, 1, 1, 1, 801, 801, 801, 801, 2, 3, 'VEAAAA', 'OQLAAA', 'OOOOxx'),
+(9478, 7867, 0, 2, 8, 18, 78, 478, 1478, 4478, 9478, 156, 157, 'OAAAAA', 'PQLAAA', 'VVVVxx'),
+(3466, 7868, 0, 2, 6, 6, 66, 466, 1466, 3466, 3466, 132, 133, 'IDAAAA', 'QQLAAA', 'AAAAxx'),
+(6326, 7869, 0, 2, 6, 6, 26, 326, 326, 1326, 6326, 52, 53, 'IJAAAA', 'RQLAAA', 'HHHHxx'),
+(1723, 7870, 1, 3, 3, 3, 23, 723, 1723, 1723, 1723, 46, 47, 'HOAAAA', 'SQLAAA', 'OOOOxx'),
+(4978, 7871, 0, 2, 8, 18, 78, 978, 978, 4978, 4978, 156, 157, 'MJAAAA', 'TQLAAA', 'VVVVxx'),
+(2311, 7872, 1, 3, 1, 11, 11, 311, 311, 2311, 2311, 22, 23, 'XKAAAA', 'UQLAAA', 'AAAAxx'),
+(9532, 7873, 0, 0, 2, 12, 32, 532, 1532, 4532, 9532, 64, 65, 'QCAAAA', 'VQLAAA', 'HHHHxx'),
+(3680, 7874, 0, 0, 0, 0, 80, 680, 1680, 3680, 3680, 160, 161, 'OLAAAA', 'WQLAAA', 'OOOOxx'),
+(1244, 7875, 0, 0, 4, 4, 44, 244, 1244, 1244, 1244, 88, 89, 'WVAAAA', 'XQLAAA', 'VVVVxx'),
+(3821, 7876, 1, 1, 1, 1, 21, 821, 1821, 3821, 3821, 42, 43, 'ZQAAAA', 'YQLAAA', 'AAAAxx'),
+(9586, 7877, 0, 2, 6, 6, 86, 586, 1586, 4586, 9586, 172, 173, 'SEAAAA', 'ZQLAAA', 'HHHHxx'),
+(3894, 7878, 0, 2, 4, 14, 94, 894, 1894, 3894, 3894, 188, 189, 'UTAAAA', 'ARLAAA', 'OOOOxx'),
+(6169, 7879, 1, 1, 9, 9, 69, 169, 169, 1169, 6169, 138, 139, 'HDAAAA', 'BRLAAA', 'VVVVxx'),
+(5919, 7880, 1, 3, 9, 19, 19, 919, 1919, 919, 5919, 38, 39, 'RTAAAA', 'CRLAAA', 'AAAAxx'),
+(4187, 7881, 1, 3, 7, 7, 87, 187, 187, 4187, 4187, 174, 175, 'BFAAAA', 'DRLAAA', 'HHHHxx'),
+(5477, 7882, 1, 1, 7, 17, 77, 477, 1477, 477, 5477, 154, 155, 'RCAAAA', 'ERLAAA', 'OOOOxx'),
+(2806, 7883, 0, 2, 6, 6, 6, 806, 806, 2806, 2806, 12, 13, 'YDAAAA', 'FRLAAA', 'VVVVxx'),
+(8158, 7884, 0, 2, 8, 18, 58, 158, 158, 3158, 8158, 116, 117, 'UBAAAA', 'GRLAAA', 'AAAAxx'),
+(7130, 7885, 0, 2, 0, 10, 30, 130, 1130, 2130, 7130, 60, 61, 'GOAAAA', 'HRLAAA', 'HHHHxx'),
+(7133, 7886, 1, 1, 3, 13, 33, 133, 1133, 2133, 7133, 66, 67, 'JOAAAA', 'IRLAAA', 'OOOOxx'),
+(6033, 7887, 1, 1, 3, 13, 33, 33, 33, 1033, 6033, 66, 67, 'BYAAAA', 'JRLAAA', 'VVVVxx'),
+(2415, 7888, 1, 3, 5, 15, 15, 415, 415, 2415, 2415, 30, 31, 'XOAAAA', 'KRLAAA', 'AAAAxx'),
+(8091, 7889, 1, 3, 1, 11, 91, 91, 91, 3091, 8091, 182, 183, 'FZAAAA', 'LRLAAA', 'HHHHxx'),
+(8347, 7890, 1, 3, 7, 7, 47, 347, 347, 3347, 8347, 94, 95, 'BJAAAA', 'MRLAAA', 'OOOOxx'),
+(7879, 7891, 1, 3, 9, 19, 79, 879, 1879, 2879, 7879, 158, 159, 'BRAAAA', 'NRLAAA', 'VVVVxx'),
+(9360, 7892, 0, 0, 0, 0, 60, 360, 1360, 4360, 9360, 120, 121, 'AWAAAA', 'ORLAAA', 'AAAAxx'),
+(3369, 7893, 1, 1, 9, 9, 69, 369, 1369, 3369, 3369, 138, 139, 'PZAAAA', 'PRLAAA', 'HHHHxx'),
+(8536, 7894, 0, 0, 6, 16, 36, 536, 536, 3536, 8536, 72, 73, 'IQAAAA', 'QRLAAA', 'OOOOxx'),
+(8628, 7895, 0, 0, 8, 8, 28, 628, 628, 3628, 8628, 56, 57, 'WTAAAA', 'RRLAAA', 'VVVVxx'),
+(1580, 7896, 0, 0, 0, 0, 80, 580, 1580, 1580, 1580, 160, 161, 'UIAAAA', 'SRLAAA', 'AAAAxx'),
+(705, 7897, 1, 1, 5, 5, 5, 705, 705, 705, 705, 10, 11, 'DBAAAA', 'TRLAAA', 'HHHHxx'),
+(4650, 7898, 0, 2, 0, 10, 50, 650, 650, 4650, 4650, 100, 101, 'WWAAAA', 'URLAAA', 'OOOOxx'),
+(9165, 7899, 1, 1, 5, 5, 65, 165, 1165, 4165, 9165, 130, 131, 'NOAAAA', 'VRLAAA', 'VVVVxx'),
+(4820, 7900, 0, 0, 0, 0, 20, 820, 820, 4820, 4820, 40, 41, 'KDAAAA', 'WRLAAA', 'AAAAxx'),
+(3538, 7901, 0, 2, 8, 18, 38, 538, 1538, 3538, 3538, 76, 77, 'CGAAAA', 'XRLAAA', 'HHHHxx'),
+(9947, 7902, 1, 3, 7, 7, 47, 947, 1947, 4947, 9947, 94, 95, 'PSAAAA', 'YRLAAA', 'OOOOxx'),
+(4954, 7903, 0, 2, 4, 14, 54, 954, 954, 4954, 4954, 108, 109, 'OIAAAA', 'ZRLAAA', 'VVVVxx'),
+(1104, 7904, 0, 0, 4, 4, 4, 104, 1104, 1104, 1104, 8, 9, 'MQAAAA', 'ASLAAA', 'AAAAxx'),
+(8455, 7905, 1, 3, 5, 15, 55, 455, 455, 3455, 8455, 110, 111, 'FNAAAA', 'BSLAAA', 'HHHHxx'),
+(8307, 7906, 1, 3, 7, 7, 7, 307, 307, 3307, 8307, 14, 15, 'NHAAAA', 'CSLAAA', 'OOOOxx'),
+(9203, 7907, 1, 3, 3, 3, 3, 203, 1203, 4203, 9203, 6, 7, 'ZPAAAA', 'DSLAAA', 'VVVVxx'),
+(7565, 7908, 1, 1, 5, 5, 65, 565, 1565, 2565, 7565, 130, 131, 'ZEAAAA', 'ESLAAA', 'AAAAxx'),
+(7745, 7909, 1, 1, 5, 5, 45, 745, 1745, 2745, 7745, 90, 91, 'XLAAAA', 'FSLAAA', 'HHHHxx'),
+(1787, 7910, 1, 3, 7, 7, 87, 787, 1787, 1787, 1787, 174, 175, 'TQAAAA', 'GSLAAA', 'OOOOxx'),
+(4861, 7911, 1, 1, 1, 1, 61, 861, 861, 4861, 4861, 122, 123, 'ZEAAAA', 'HSLAAA', 'VVVVxx'),
+(5183, 7912, 1, 3, 3, 3, 83, 183, 1183, 183, 5183, 166, 167, 'JRAAAA', 'ISLAAA', 'AAAAxx'),
+(529, 7913, 1, 1, 9, 9, 29, 529, 529, 529, 529, 58, 59, 'JUAAAA', 'JSLAAA', 'HHHHxx'),
+(2470, 7914, 0, 2, 0, 10, 70, 470, 470, 2470, 2470, 140, 141, 'ARAAAA', 'KSLAAA', 'OOOOxx'),
+(1267, 7915, 1, 3, 7, 7, 67, 267, 1267, 1267, 1267, 134, 135, 'TWAAAA', 'LSLAAA', 'VVVVxx'),
+(2059, 7916, 1, 3, 9, 19, 59, 59, 59, 2059, 2059, 118, 119, 'FBAAAA', 'MSLAAA', 'AAAAxx'),
+(1862, 7917, 0, 2, 2, 2, 62, 862, 1862, 1862, 1862, 124, 125, 'QTAAAA', 'NSLAAA', 'HHHHxx'),
+(7382, 7918, 0, 2, 2, 2, 82, 382, 1382, 2382, 7382, 164, 165, 'YXAAAA', 'OSLAAA', 'OOOOxx'),
+(4796, 7919, 0, 0, 6, 16, 96, 796, 796, 4796, 4796, 192, 193, 'MCAAAA', 'PSLAAA', 'VVVVxx'),
+(2331, 7920, 1, 3, 1, 11, 31, 331, 331, 2331, 2331, 62, 63, 'RLAAAA', 'QSLAAA', 'AAAAxx'),
+(8870, 7921, 0, 2, 0, 10, 70, 870, 870, 3870, 8870, 140, 141, 'EDAAAA', 'RSLAAA', 'HHHHxx'),
+(9581, 7922, 1, 1, 1, 1, 81, 581, 1581, 4581, 9581, 162, 163, 'NEAAAA', 'SSLAAA', 'OOOOxx'),
+(9063, 7923, 1, 3, 3, 3, 63, 63, 1063, 4063, 9063, 126, 127, 'PKAAAA', 'TSLAAA', 'VVVVxx'),
+(2192, 7924, 0, 0, 2, 12, 92, 192, 192, 2192, 2192, 184, 185, 'IGAAAA', 'USLAAA', 'AAAAxx'),
+(6466, 7925, 0, 2, 6, 6, 66, 466, 466, 1466, 6466, 132, 133, 'SOAAAA', 'VSLAAA', 'HHHHxx'),
+(7096, 7926, 0, 0, 6, 16, 96, 96, 1096, 2096, 7096, 192, 193, 'YMAAAA', 'WSLAAA', 'OOOOxx'),
+(6257, 7927, 1, 1, 7, 17, 57, 257, 257, 1257, 6257, 114, 115, 'RGAAAA', 'XSLAAA', 'VVVVxx'),
+(7009, 7928, 1, 1, 9, 9, 9, 9, 1009, 2009, 7009, 18, 19, 'PJAAAA', 'YSLAAA', 'AAAAxx'),
+(8136, 7929, 0, 0, 6, 16, 36, 136, 136, 3136, 8136, 72, 73, 'YAAAAA', 'ZSLAAA', 'HHHHxx'),
+(1854, 7930, 0, 2, 4, 14, 54, 854, 1854, 1854, 1854, 108, 109, 'ITAAAA', 'ATLAAA', 'OOOOxx'),
+(3644, 7931, 0, 0, 4, 4, 44, 644, 1644, 3644, 3644, 88, 89, 'EKAAAA', 'BTLAAA', 'VVVVxx'),
+(4437, 7932, 1, 1, 7, 17, 37, 437, 437, 4437, 4437, 74, 75, 'ROAAAA', 'CTLAAA', 'AAAAxx'),
+(7209, 7933, 1, 1, 9, 9, 9, 209, 1209, 2209, 7209, 18, 19, 'HRAAAA', 'DTLAAA', 'HHHHxx'),
+(1516, 7934, 0, 0, 6, 16, 16, 516, 1516, 1516, 1516, 32, 33, 'IGAAAA', 'ETLAAA', 'OOOOxx'),
+(822, 7935, 0, 2, 2, 2, 22, 822, 822, 822, 822, 44, 45, 'QFAAAA', 'FTLAAA', 'VVVVxx'),
+(1778, 7936, 0, 2, 8, 18, 78, 778, 1778, 1778, 1778, 156, 157, 'KQAAAA', 'GTLAAA', 'AAAAxx'),
+(8161, 7937, 1, 1, 1, 1, 61, 161, 161, 3161, 8161, 122, 123, 'XBAAAA', 'HTLAAA', 'HHHHxx'),
+(6030, 7938, 0, 2, 0, 10, 30, 30, 30, 1030, 6030, 60, 61, 'YXAAAA', 'ITLAAA', 'OOOOxx'),
+(3515, 7939, 1, 3, 5, 15, 15, 515, 1515, 3515, 3515, 30, 31, 'FFAAAA', 'JTLAAA', 'VVVVxx'),
+(1702, 7940, 0, 2, 2, 2, 2, 702, 1702, 1702, 1702, 4, 5, 'MNAAAA', 'KTLAAA', 'AAAAxx'),
+(2671, 7941, 1, 3, 1, 11, 71, 671, 671, 2671, 2671, 142, 143, 'TYAAAA', 'LTLAAA', 'HHHHxx'),
+(7623, 7942, 1, 3, 3, 3, 23, 623, 1623, 2623, 7623, 46, 47, 'FHAAAA', 'MTLAAA', 'OOOOxx'),
+(9828, 7943, 0, 0, 8, 8, 28, 828, 1828, 4828, 9828, 56, 57, 'AOAAAA', 'NTLAAA', 'VVVVxx'),
+(1888, 7944, 0, 0, 8, 8, 88, 888, 1888, 1888, 1888, 176, 177, 'QUAAAA', 'OTLAAA', 'AAAAxx'),
+(4520, 7945, 0, 0, 0, 0, 20, 520, 520, 4520, 4520, 40, 41, 'WRAAAA', 'PTLAAA', 'HHHHxx'),
+(3461, 7946, 1, 1, 1, 1, 61, 461, 1461, 3461, 3461, 122, 123, 'DDAAAA', 'QTLAAA', 'OOOOxx'),
+(1488, 7947, 0, 0, 8, 8, 88, 488, 1488, 1488, 1488, 176, 177, 'GFAAAA', 'RTLAAA', 'VVVVxx'),
+(7753, 7948, 1, 1, 3, 13, 53, 753, 1753, 2753, 7753, 106, 107, 'FMAAAA', 'STLAAA', 'AAAAxx'),
+(5525, 7949, 1, 1, 5, 5, 25, 525, 1525, 525, 5525, 50, 51, 'NEAAAA', 'TTLAAA', 'HHHHxx'),
+(5220, 7950, 0, 0, 0, 0, 20, 220, 1220, 220, 5220, 40, 41, 'USAAAA', 'UTLAAA', 'OOOOxx'),
+(305, 7951, 1, 1, 5, 5, 5, 305, 305, 305, 305, 10, 11, 'TLAAAA', 'VTLAAA', 'VVVVxx'),
+(7883, 7952, 1, 3, 3, 3, 83, 883, 1883, 2883, 7883, 166, 167, 'FRAAAA', 'WTLAAA', 'AAAAxx'),
+(1222, 7953, 0, 2, 2, 2, 22, 222, 1222, 1222, 1222, 44, 45, 'AVAAAA', 'XTLAAA', 'HHHHxx'),
+(8552, 7954, 0, 0, 2, 12, 52, 552, 552, 3552, 8552, 104, 105, 'YQAAAA', 'YTLAAA', 'OOOOxx'),
+(6097, 7955, 1, 1, 7, 17, 97, 97, 97, 1097, 6097, 194, 195, 'NAAAAA', 'ZTLAAA', 'VVVVxx'),
+(2298, 7956, 0, 2, 8, 18, 98, 298, 298, 2298, 2298, 196, 197, 'KKAAAA', 'AULAAA', 'AAAAxx'),
+(956, 7957, 0, 0, 6, 16, 56, 956, 956, 956, 956, 112, 113, 'UKAAAA', 'BULAAA', 'HHHHxx'),
+(9351, 7958, 1, 3, 1, 11, 51, 351, 1351, 4351, 9351, 102, 103, 'RVAAAA', 'CULAAA', 'OOOOxx'),
+(6669, 7959, 1, 1, 9, 9, 69, 669, 669, 1669, 6669, 138, 139, 'NWAAAA', 'DULAAA', 'VVVVxx'),
+(9383, 7960, 1, 3, 3, 3, 83, 383, 1383, 4383, 9383, 166, 167, 'XWAAAA', 'EULAAA', 'AAAAxx'),
+(1607, 7961, 1, 3, 7, 7, 7, 607, 1607, 1607, 1607, 14, 15, 'VJAAAA', 'FULAAA', 'HHHHxx'),
+(812, 7962, 0, 0, 2, 12, 12, 812, 812, 812, 812, 24, 25, 'GFAAAA', 'GULAAA', 'OOOOxx'),
+(2109, 7963, 1, 1, 9, 9, 9, 109, 109, 2109, 2109, 18, 19, 'DDAAAA', 'HULAAA', 'VVVVxx'),
+(207, 7964, 1, 3, 7, 7, 7, 207, 207, 207, 207, 14, 15, 'ZHAAAA', 'IULAAA', 'AAAAxx'),
+(7124, 7965, 0, 0, 4, 4, 24, 124, 1124, 2124, 7124, 48, 49, 'AOAAAA', 'JULAAA', 'HHHHxx'),
+(9333, 7966, 1, 1, 3, 13, 33, 333, 1333, 4333, 9333, 66, 67, 'ZUAAAA', 'KULAAA', 'OOOOxx'),
+(3262, 7967, 0, 2, 2, 2, 62, 262, 1262, 3262, 3262, 124, 125, 'MVAAAA', 'LULAAA', 'VVVVxx'),
+(1070, 7968, 0, 2, 0, 10, 70, 70, 1070, 1070, 1070, 140, 141, 'EPAAAA', 'MULAAA', 'AAAAxx'),
+(7579, 7969, 1, 3, 9, 19, 79, 579, 1579, 2579, 7579, 158, 159, 'NFAAAA', 'NULAAA', 'HHHHxx'),
+(9283, 7970, 1, 3, 3, 3, 83, 283, 1283, 4283, 9283, 166, 167, 'BTAAAA', 'OULAAA', 'OOOOxx'),
+(4917, 7971, 1, 1, 7, 17, 17, 917, 917, 4917, 4917, 34, 35, 'DHAAAA', 'PULAAA', 'VVVVxx'),
+(1328, 7972, 0, 0, 8, 8, 28, 328, 1328, 1328, 1328, 56, 57, 'CZAAAA', 'QULAAA', 'AAAAxx'),
+(3042, 7973, 0, 2, 2, 2, 42, 42, 1042, 3042, 3042, 84, 85, 'ANAAAA', 'RULAAA', 'HHHHxx'),
+(8352, 7974, 0, 0, 2, 12, 52, 352, 352, 3352, 8352, 104, 105, 'GJAAAA', 'SULAAA', 'OOOOxx'),
+(2710, 7975, 0, 2, 0, 10, 10, 710, 710, 2710, 2710, 20, 21, 'GAAAAA', 'TULAAA', 'VVVVxx'),
+(3330, 7976, 0, 2, 0, 10, 30, 330, 1330, 3330, 3330, 60, 61, 'CYAAAA', 'UULAAA', 'AAAAxx'),
+(2822, 7977, 0, 2, 2, 2, 22, 822, 822, 2822, 2822, 44, 45, 'OEAAAA', 'VULAAA', 'HHHHxx'),
+(5627, 7978, 1, 3, 7, 7, 27, 627, 1627, 627, 5627, 54, 55, 'LIAAAA', 'WULAAA', 'OOOOxx'),
+(7848, 7979, 0, 0, 8, 8, 48, 848, 1848, 2848, 7848, 96, 97, 'WPAAAA', 'XULAAA', 'VVVVxx'),
+(7384, 7980, 0, 0, 4, 4, 84, 384, 1384, 2384, 7384, 168, 169, 'AYAAAA', 'YULAAA', 'AAAAxx'),
+(727, 7981, 1, 3, 7, 7, 27, 727, 727, 727, 727, 54, 55, 'ZBAAAA', 'ZULAAA', 'HHHHxx'),
+(9926, 7982, 0, 2, 6, 6, 26, 926, 1926, 4926, 9926, 52, 53, 'URAAAA', 'AVLAAA', 'OOOOxx'),
+(2647, 7983, 1, 3, 7, 7, 47, 647, 647, 2647, 2647, 94, 95, 'VXAAAA', 'BVLAAA', 'VVVVxx'),
+(6416, 7984, 0, 0, 6, 16, 16, 416, 416, 1416, 6416, 32, 33, 'UMAAAA', 'CVLAAA', 'AAAAxx'),
+(8751, 7985, 1, 3, 1, 11, 51, 751, 751, 3751, 8751, 102, 103, 'PYAAAA', 'DVLAAA', 'HHHHxx'),
+(6515, 7986, 1, 3, 5, 15, 15, 515, 515, 1515, 6515, 30, 31, 'PQAAAA', 'EVLAAA', 'OOOOxx'),
+(2472, 7987, 0, 0, 2, 12, 72, 472, 472, 2472, 2472, 144, 145, 'CRAAAA', 'FVLAAA', 'VVVVxx'),
+(7205, 7988, 1, 1, 5, 5, 5, 205, 1205, 2205, 7205, 10, 11, 'DRAAAA', 'GVLAAA', 'AAAAxx'),
+(9654, 7989, 0, 2, 4, 14, 54, 654, 1654, 4654, 9654, 108, 109, 'IHAAAA', 'HVLAAA', 'HHHHxx'),
+(5646, 7990, 0, 2, 6, 6, 46, 646, 1646, 646, 5646, 92, 93, 'EJAAAA', 'IVLAAA', 'OOOOxx'),
+(4217, 7991, 1, 1, 7, 17, 17, 217, 217, 4217, 4217, 34, 35, 'FGAAAA', 'JVLAAA', 'VVVVxx'),
+(4484, 7992, 0, 0, 4, 4, 84, 484, 484, 4484, 4484, 168, 169, 'MQAAAA', 'KVLAAA', 'AAAAxx'),
+(6654, 7993, 0, 2, 4, 14, 54, 654, 654, 1654, 6654, 108, 109, 'YVAAAA', 'LVLAAA', 'HHHHxx'),
+(4876, 7994, 0, 0, 6, 16, 76, 876, 876, 4876, 4876, 152, 153, 'OFAAAA', 'MVLAAA', 'OOOOxx'),
+(9690, 7995, 0, 2, 0, 10, 90, 690, 1690, 4690, 9690, 180, 181, 'SIAAAA', 'NVLAAA', 'VVVVxx'),
+(2453, 7996, 1, 1, 3, 13, 53, 453, 453, 2453, 2453, 106, 107, 'JQAAAA', 'OVLAAA', 'AAAAxx'),
+(829, 7997, 1, 1, 9, 9, 29, 829, 829, 829, 829, 58, 59, 'XFAAAA', 'PVLAAA', 'HHHHxx'),
+(2547, 7998, 1, 3, 7, 7, 47, 547, 547, 2547, 2547, 94, 95, 'ZTAAAA', 'QVLAAA', 'OOOOxx'),
+(9726, 7999, 0, 2, 6, 6, 26, 726, 1726, 4726, 9726, 52, 53, 'CKAAAA', 'RVLAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(9267, 8000, 1, 3, 7, 7, 67, 267, 1267, 4267, 9267, 134, 135, 'LSAAAA', 'SVLAAA', 'AAAAxx'),
+(7448, 8001, 0, 0, 8, 8, 48, 448, 1448, 2448, 7448, 96, 97, 'MAAAAA', 'TVLAAA', 'HHHHxx'),
+(610, 8002, 0, 2, 0, 10, 10, 610, 610, 610, 610, 20, 21, 'MXAAAA', 'UVLAAA', 'OOOOxx'),
+(2791, 8003, 1, 3, 1, 11, 91, 791, 791, 2791, 2791, 182, 183, 'JDAAAA', 'VVLAAA', 'VVVVxx'),
+(3651, 8004, 1, 3, 1, 11, 51, 651, 1651, 3651, 3651, 102, 103, 'LKAAAA', 'WVLAAA', 'AAAAxx'),
+(5206, 8005, 0, 2, 6, 6, 6, 206, 1206, 206, 5206, 12, 13, 'GSAAAA', 'XVLAAA', 'HHHHxx'),
+(8774, 8006, 0, 2, 4, 14, 74, 774, 774, 3774, 8774, 148, 149, 'MZAAAA', 'YVLAAA', 'OOOOxx'),
+(4753, 8007, 1, 1, 3, 13, 53, 753, 753, 4753, 4753, 106, 107, 'VAAAAA', 'ZVLAAA', 'VVVVxx'),
+(4755, 8008, 1, 3, 5, 15, 55, 755, 755, 4755, 4755, 110, 111, 'XAAAAA', 'AWLAAA', 'AAAAxx'),
+(686, 8009, 0, 2, 6, 6, 86, 686, 686, 686, 686, 172, 173, 'KAAAAA', 'BWLAAA', 'HHHHxx'),
+(8281, 8010, 1, 1, 1, 1, 81, 281, 281, 3281, 8281, 162, 163, 'NGAAAA', 'CWLAAA', 'OOOOxx'),
+(2058, 8011, 0, 2, 8, 18, 58, 58, 58, 2058, 2058, 116, 117, 'EBAAAA', 'DWLAAA', 'VVVVxx'),
+(8900, 8012, 0, 0, 0, 0, 0, 900, 900, 3900, 8900, 0, 1, 'IEAAAA', 'EWLAAA', 'AAAAxx'),
+(8588, 8013, 0, 0, 8, 8, 88, 588, 588, 3588, 8588, 176, 177, 'ISAAAA', 'FWLAAA', 'HHHHxx'),
+(2904, 8014, 0, 0, 4, 4, 4, 904, 904, 2904, 2904, 8, 9, 'SHAAAA', 'GWLAAA', 'OOOOxx'),
+(8917, 8015, 1, 1, 7, 17, 17, 917, 917, 3917, 8917, 34, 35, 'ZEAAAA', 'HWLAAA', 'VVVVxx'),
+(9026, 8016, 0, 2, 6, 6, 26, 26, 1026, 4026, 9026, 52, 53, 'EJAAAA', 'IWLAAA', 'AAAAxx'),
+(2416, 8017, 0, 0, 6, 16, 16, 416, 416, 2416, 2416, 32, 33, 'YOAAAA', 'JWLAAA', 'HHHHxx'),
+(1053, 8018, 1, 1, 3, 13, 53, 53, 1053, 1053, 1053, 106, 107, 'NOAAAA', 'KWLAAA', 'OOOOxx'),
+(7141, 8019, 1, 1, 1, 1, 41, 141, 1141, 2141, 7141, 82, 83, 'ROAAAA', 'LWLAAA', 'VVVVxx'),
+(9771, 8020, 1, 3, 1, 11, 71, 771, 1771, 4771, 9771, 142, 143, 'VLAAAA', 'MWLAAA', 'AAAAxx'),
+(2774, 8021, 0, 2, 4, 14, 74, 774, 774, 2774, 2774, 148, 149, 'SCAAAA', 'NWLAAA', 'HHHHxx'),
+(3213, 8022, 1, 1, 3, 13, 13, 213, 1213, 3213, 3213, 26, 27, 'PTAAAA', 'OWLAAA', 'OOOOxx'),
+(5694, 8023, 0, 2, 4, 14, 94, 694, 1694, 694, 5694, 188, 189, 'ALAAAA', 'PWLAAA', 'VVVVxx'),
+(6631, 8024, 1, 3, 1, 11, 31, 631, 631, 1631, 6631, 62, 63, 'BVAAAA', 'QWLAAA', 'AAAAxx'),
+(6638, 8025, 0, 2, 8, 18, 38, 638, 638, 1638, 6638, 76, 77, 'IVAAAA', 'RWLAAA', 'HHHHxx'),
+(7407, 8026, 1, 3, 7, 7, 7, 407, 1407, 2407, 7407, 14, 15, 'XYAAAA', 'SWLAAA', 'OOOOxx'),
+(8972, 8027, 0, 0, 2, 12, 72, 972, 972, 3972, 8972, 144, 145, 'CHAAAA', 'TWLAAA', 'VVVVxx'),
+(2202, 8028, 0, 2, 2, 2, 2, 202, 202, 2202, 2202, 4, 5, 'SGAAAA', 'UWLAAA', 'AAAAxx'),
+(6135, 8029, 1, 3, 5, 15, 35, 135, 135, 1135, 6135, 70, 71, 'ZBAAAA', 'VWLAAA', 'HHHHxx'),
+(5043, 8030, 1, 3, 3, 3, 43, 43, 1043, 43, 5043, 86, 87, 'ZLAAAA', 'WWLAAA', 'OOOOxx'),
+(5163, 8031, 1, 3, 3, 3, 63, 163, 1163, 163, 5163, 126, 127, 'PQAAAA', 'XWLAAA', 'VVVVxx'),
+(1191, 8032, 1, 3, 1, 11, 91, 191, 1191, 1191, 1191, 182, 183, 'VTAAAA', 'YWLAAA', 'AAAAxx'),
+(6576, 8033, 0, 0, 6, 16, 76, 576, 576, 1576, 6576, 152, 153, 'YSAAAA', 'ZWLAAA', 'HHHHxx'),
+(3455, 8034, 1, 3, 5, 15, 55, 455, 1455, 3455, 3455, 110, 111, 'XCAAAA', 'AXLAAA', 'OOOOxx'),
+(3688, 8035, 0, 0, 8, 8, 88, 688, 1688, 3688, 3688, 176, 177, 'WLAAAA', 'BXLAAA', 'VVVVxx'),
+(4982, 8036, 0, 2, 2, 2, 82, 982, 982, 4982, 4982, 164, 165, 'QJAAAA', 'CXLAAA', 'AAAAxx'),
+(4180, 8037, 0, 0, 0, 0, 80, 180, 180, 4180, 4180, 160, 161, 'UEAAAA', 'DXLAAA', 'HHHHxx'),
+(4708, 8038, 0, 0, 8, 8, 8, 708, 708, 4708, 4708, 16, 17, 'CZAAAA', 'EXLAAA', 'OOOOxx'),
+(1241, 8039, 1, 1, 1, 1, 41, 241, 1241, 1241, 1241, 82, 83, 'TVAAAA', 'FXLAAA', 'VVVVxx'),
+(4921, 8040, 1, 1, 1, 1, 21, 921, 921, 4921, 4921, 42, 43, 'HHAAAA', 'GXLAAA', 'AAAAxx'),
+(3197, 8041, 1, 1, 7, 17, 97, 197, 1197, 3197, 3197, 194, 195, 'ZSAAAA', 'HXLAAA', 'HHHHxx'),
+(8225, 8042, 1, 1, 5, 5, 25, 225, 225, 3225, 8225, 50, 51, 'JEAAAA', 'IXLAAA', 'OOOOxx'),
+(5913, 8043, 1, 1, 3, 13, 13, 913, 1913, 913, 5913, 26, 27, 'LTAAAA', 'JXLAAA', 'VVVVxx'),
+(6387, 8044, 1, 3, 7, 7, 87, 387, 387, 1387, 6387, 174, 175, 'RLAAAA', 'KXLAAA', 'AAAAxx'),
+(2706, 8045, 0, 2, 6, 6, 6, 706, 706, 2706, 2706, 12, 13, 'CAAAAA', 'LXLAAA', 'HHHHxx'),
+(1461, 8046, 1, 1, 1, 1, 61, 461, 1461, 1461, 1461, 122, 123, 'FEAAAA', 'MXLAAA', 'OOOOxx'),
+(7646, 8047, 0, 2, 6, 6, 46, 646, 1646, 2646, 7646, 92, 93, 'CIAAAA', 'NXLAAA', 'VVVVxx'),
+(8066, 8048, 0, 2, 6, 6, 66, 66, 66, 3066, 8066, 132, 133, 'GYAAAA', 'OXLAAA', 'AAAAxx'),
+(4171, 8049, 1, 3, 1, 11, 71, 171, 171, 4171, 4171, 142, 143, 'LEAAAA', 'PXLAAA', 'HHHHxx'),
+(8008, 8050, 0, 0, 8, 8, 8, 8, 8, 3008, 8008, 16, 17, 'AWAAAA', 'QXLAAA', 'OOOOxx'),
+(2088, 8051, 0, 0, 8, 8, 88, 88, 88, 2088, 2088, 176, 177, 'ICAAAA', 'RXLAAA', 'VVVVxx'),
+(7907, 8052, 1, 3, 7, 7, 7, 907, 1907, 2907, 7907, 14, 15, 'DSAAAA', 'SXLAAA', 'AAAAxx'),
+(2429, 8053, 1, 1, 9, 9, 29, 429, 429, 2429, 2429, 58, 59, 'LPAAAA', 'TXLAAA', 'HHHHxx'),
+(9629, 8054, 1, 1, 9, 9, 29, 629, 1629, 4629, 9629, 58, 59, 'JGAAAA', 'UXLAAA', 'OOOOxx'),
+(1470, 8055, 0, 2, 0, 10, 70, 470, 1470, 1470, 1470, 140, 141, 'OEAAAA', 'VXLAAA', 'VVVVxx'),
+(4346, 8056, 0, 2, 6, 6, 46, 346, 346, 4346, 4346, 92, 93, 'ELAAAA', 'WXLAAA', 'AAAAxx'),
+(7219, 8057, 1, 3, 9, 19, 19, 219, 1219, 2219, 7219, 38, 39, 'RRAAAA', 'XXLAAA', 'HHHHxx'),
+(1185, 8058, 1, 1, 5, 5, 85, 185, 1185, 1185, 1185, 170, 171, 'PTAAAA', 'YXLAAA', 'OOOOxx'),
+(8776, 8059, 0, 0, 6, 16, 76, 776, 776, 3776, 8776, 152, 153, 'OZAAAA', 'ZXLAAA', 'VVVVxx'),
+(684, 8060, 0, 0, 4, 4, 84, 684, 684, 684, 684, 168, 169, 'IAAAAA', 'AYLAAA', 'AAAAxx'),
+(2343, 8061, 1, 3, 3, 3, 43, 343, 343, 2343, 2343, 86, 87, 'DMAAAA', 'BYLAAA', 'HHHHxx'),
+(4470, 8062, 0, 2, 0, 10, 70, 470, 470, 4470, 4470, 140, 141, 'YPAAAA', 'CYLAAA', 'OOOOxx'),
+(5116, 8063, 0, 0, 6, 16, 16, 116, 1116, 116, 5116, 32, 33, 'UOAAAA', 'DYLAAA', 'VVVVxx'),
+(1746, 8064, 0, 2, 6, 6, 46, 746, 1746, 1746, 1746, 92, 93, 'EPAAAA', 'EYLAAA', 'AAAAxx'),
+(3216, 8065, 0, 0, 6, 16, 16, 216, 1216, 3216, 3216, 32, 33, 'STAAAA', 'FYLAAA', 'HHHHxx'),
+(4594, 8066, 0, 2, 4, 14, 94, 594, 594, 4594, 4594, 188, 189, 'SUAAAA', 'GYLAAA', 'OOOOxx'),
+(3013, 8067, 1, 1, 3, 13, 13, 13, 1013, 3013, 3013, 26, 27, 'XLAAAA', 'HYLAAA', 'VVVVxx'),
+(2307, 8068, 1, 3, 7, 7, 7, 307, 307, 2307, 2307, 14, 15, 'TKAAAA', 'IYLAAA', 'AAAAxx'),
+(7663, 8069, 1, 3, 3, 3, 63, 663, 1663, 2663, 7663, 126, 127, 'TIAAAA', 'JYLAAA', 'HHHHxx'),
+(8504, 8070, 0, 0, 4, 4, 4, 504, 504, 3504, 8504, 8, 9, 'CPAAAA', 'KYLAAA', 'OOOOxx'),
+(3683, 8071, 1, 3, 3, 3, 83, 683, 1683, 3683, 3683, 166, 167, 'RLAAAA', 'LYLAAA', 'VVVVxx'),
+(144, 8072, 0, 0, 4, 4, 44, 144, 144, 144, 144, 88, 89, 'OFAAAA', 'MYLAAA', 'AAAAxx'),
+(203, 8073, 1, 3, 3, 3, 3, 203, 203, 203, 203, 6, 7, 'VHAAAA', 'NYLAAA', 'HHHHxx'),
+(5255, 8074, 1, 3, 5, 15, 55, 255, 1255, 255, 5255, 110, 111, 'DUAAAA', 'OYLAAA', 'OOOOxx'),
+(4150, 8075, 0, 2, 0, 10, 50, 150, 150, 4150, 4150, 100, 101, 'QDAAAA', 'PYLAAA', 'VVVVxx'),
+(5701, 8076, 1, 1, 1, 1, 1, 701, 1701, 701, 5701, 2, 3, 'HLAAAA', 'QYLAAA', 'AAAAxx'),
+(7400, 8077, 0, 0, 0, 0, 0, 400, 1400, 2400, 7400, 0, 1, 'QYAAAA', 'RYLAAA', 'HHHHxx'),
+(8203, 8078, 1, 3, 3, 3, 3, 203, 203, 3203, 8203, 6, 7, 'NDAAAA', 'SYLAAA', 'OOOOxx'),
+(637, 8079, 1, 1, 7, 17, 37, 637, 637, 637, 637, 74, 75, 'NYAAAA', 'TYLAAA', 'VVVVxx'),
+(2898, 8080, 0, 2, 8, 18, 98, 898, 898, 2898, 2898, 196, 197, 'MHAAAA', 'UYLAAA', 'AAAAxx'),
+(1110, 8081, 0, 2, 0, 10, 10, 110, 1110, 1110, 1110, 20, 21, 'SQAAAA', 'VYLAAA', 'HHHHxx'),
+(6255, 8082, 1, 3, 5, 15, 55, 255, 255, 1255, 6255, 110, 111, 'PGAAAA', 'WYLAAA', 'OOOOxx'),
+(1071, 8083, 1, 3, 1, 11, 71, 71, 1071, 1071, 1071, 142, 143, 'FPAAAA', 'XYLAAA', 'VVVVxx'),
+(541, 8084, 1, 1, 1, 1, 41, 541, 541, 541, 541, 82, 83, 'VUAAAA', 'YYLAAA', 'AAAAxx'),
+(8077, 8085, 1, 1, 7, 17, 77, 77, 77, 3077, 8077, 154, 155, 'RYAAAA', 'ZYLAAA', 'HHHHxx'),
+(6809, 8086, 1, 1, 9, 9, 9, 809, 809, 1809, 6809, 18, 19, 'XBAAAA', 'AZLAAA', 'OOOOxx'),
+(4749, 8087, 1, 1, 9, 9, 49, 749, 749, 4749, 4749, 98, 99, 'RAAAAA', 'BZLAAA', 'VVVVxx'),
+(2886, 8088, 0, 2, 6, 6, 86, 886, 886, 2886, 2886, 172, 173, 'AHAAAA', 'CZLAAA', 'AAAAxx'),
+(5510, 8089, 0, 2, 0, 10, 10, 510, 1510, 510, 5510, 20, 21, 'YDAAAA', 'DZLAAA', 'HHHHxx'),
+(713, 8090, 1, 1, 3, 13, 13, 713, 713, 713, 713, 26, 27, 'LBAAAA', 'EZLAAA', 'OOOOxx'),
+(8388, 8091, 0, 0, 8, 8, 88, 388, 388, 3388, 8388, 176, 177, 'QKAAAA', 'FZLAAA', 'VVVVxx'),
+(9524, 8092, 0, 0, 4, 4, 24, 524, 1524, 4524, 9524, 48, 49, 'ICAAAA', 'GZLAAA', 'AAAAxx'),
+(9949, 8093, 1, 1, 9, 9, 49, 949, 1949, 4949, 9949, 98, 99, 'RSAAAA', 'HZLAAA', 'HHHHxx'),
+(885, 8094, 1, 1, 5, 5, 85, 885, 885, 885, 885, 170, 171, 'BIAAAA', 'IZLAAA', 'OOOOxx'),
+(8699, 8095, 1, 3, 9, 19, 99, 699, 699, 3699, 8699, 198, 199, 'PWAAAA', 'JZLAAA', 'VVVVxx'),
+(2232, 8096, 0, 0, 2, 12, 32, 232, 232, 2232, 2232, 64, 65, 'WHAAAA', 'KZLAAA', 'AAAAxx'),
+(5142, 8097, 0, 2, 2, 2, 42, 142, 1142, 142, 5142, 84, 85, 'UPAAAA', 'LZLAAA', 'HHHHxx'),
+(8891, 8098, 1, 3, 1, 11, 91, 891, 891, 3891, 8891, 182, 183, 'ZDAAAA', 'MZLAAA', 'OOOOxx'),
+(1881, 8099, 1, 1, 1, 1, 81, 881, 1881, 1881, 1881, 162, 163, 'JUAAAA', 'NZLAAA', 'VVVVxx'),
+(3751, 8100, 1, 3, 1, 11, 51, 751, 1751, 3751, 3751, 102, 103, 'HOAAAA', 'OZLAAA', 'AAAAxx'),
+(1896, 8101, 0, 0, 6, 16, 96, 896, 1896, 1896, 1896, 192, 193, 'YUAAAA', 'PZLAAA', 'HHHHxx'),
+(8258, 8102, 0, 2, 8, 18, 58, 258, 258, 3258, 8258, 116, 117, 'QFAAAA', 'QZLAAA', 'OOOOxx'),
+(3820, 8103, 0, 0, 0, 0, 20, 820, 1820, 3820, 3820, 40, 41, 'YQAAAA', 'RZLAAA', 'VVVVxx'),
+(6617, 8104, 1, 1, 7, 17, 17, 617, 617, 1617, 6617, 34, 35, 'NUAAAA', 'SZLAAA', 'AAAAxx'),
+(5100, 8105, 0, 0, 0, 0, 0, 100, 1100, 100, 5100, 0, 1, 'EOAAAA', 'TZLAAA', 'HHHHxx'),
+(4277, 8106, 1, 1, 7, 17, 77, 277, 277, 4277, 4277, 154, 155, 'NIAAAA', 'UZLAAA', 'OOOOxx'),
+(2498, 8107, 0, 2, 8, 18, 98, 498, 498, 2498, 2498, 196, 197, 'CSAAAA', 'VZLAAA', 'VVVVxx'),
+(4343, 8108, 1, 3, 3, 3, 43, 343, 343, 4343, 4343, 86, 87, 'BLAAAA', 'WZLAAA', 'AAAAxx'),
+(8319, 8109, 1, 3, 9, 19, 19, 319, 319, 3319, 8319, 38, 39, 'ZHAAAA', 'XZLAAA', 'HHHHxx'),
+(4803, 8110, 1, 3, 3, 3, 3, 803, 803, 4803, 4803, 6, 7, 'TCAAAA', 'YZLAAA', 'OOOOxx'),
+(3100, 8111, 0, 0, 0, 0, 0, 100, 1100, 3100, 3100, 0, 1, 'GPAAAA', 'ZZLAAA', 'VVVVxx'),
+(428, 8112, 0, 0, 8, 8, 28, 428, 428, 428, 428, 56, 57, 'MQAAAA', 'AAMAAA', 'AAAAxx'),
+(2811, 8113, 1, 3, 1, 11, 11, 811, 811, 2811, 2811, 22, 23, 'DEAAAA', 'BAMAAA', 'HHHHxx'),
+(2989, 8114, 1, 1, 9, 9, 89, 989, 989, 2989, 2989, 178, 179, 'ZKAAAA', 'CAMAAA', 'OOOOxx'),
+(1100, 8115, 0, 0, 0, 0, 0, 100, 1100, 1100, 1100, 0, 1, 'IQAAAA', 'DAMAAA', 'VVVVxx'),
+(6586, 8116, 0, 2, 6, 6, 86, 586, 586, 1586, 6586, 172, 173, 'ITAAAA', 'EAMAAA', 'AAAAxx'),
+(3124, 8117, 0, 0, 4, 4, 24, 124, 1124, 3124, 3124, 48, 49, 'EQAAAA', 'FAMAAA', 'HHHHxx'),
+(1635, 8118, 1, 3, 5, 15, 35, 635, 1635, 1635, 1635, 70, 71, 'XKAAAA', 'GAMAAA', 'OOOOxx'),
+(3888, 8119, 0, 0, 8, 8, 88, 888, 1888, 3888, 3888, 176, 177, 'OTAAAA', 'HAMAAA', 'VVVVxx'),
+(8369, 8120, 1, 1, 9, 9, 69, 369, 369, 3369, 8369, 138, 139, 'XJAAAA', 'IAMAAA', 'AAAAxx'),
+(3148, 8121, 0, 0, 8, 8, 48, 148, 1148, 3148, 3148, 96, 97, 'CRAAAA', 'JAMAAA', 'HHHHxx'),
+(2842, 8122, 0, 2, 2, 2, 42, 842, 842, 2842, 2842, 84, 85, 'IFAAAA', 'KAMAAA', 'OOOOxx'),
+(4965, 8123, 1, 1, 5, 5, 65, 965, 965, 4965, 4965, 130, 131, 'ZIAAAA', 'LAMAAA', 'VVVVxx'),
+(3742, 8124, 0, 2, 2, 2, 42, 742, 1742, 3742, 3742, 84, 85, 'YNAAAA', 'MAMAAA', 'AAAAxx'),
+(5196, 8125, 0, 0, 6, 16, 96, 196, 1196, 196, 5196, 192, 193, 'WRAAAA', 'NAMAAA', 'HHHHxx'),
+(9105, 8126, 1, 1, 5, 5, 5, 105, 1105, 4105, 9105, 10, 11, 'FMAAAA', 'OAMAAA', 'OOOOxx'),
+(6806, 8127, 0, 2, 6, 6, 6, 806, 806, 1806, 6806, 12, 13, 'UBAAAA', 'PAMAAA', 'VVVVxx'),
+(5849, 8128, 1, 1, 9, 9, 49, 849, 1849, 849, 5849, 98, 99, 'ZQAAAA', 'QAMAAA', 'AAAAxx'),
+(6504, 8129, 0, 0, 4, 4, 4, 504, 504, 1504, 6504, 8, 9, 'EQAAAA', 'RAMAAA', 'HHHHxx'),
+(9841, 8130, 1, 1, 1, 1, 41, 841, 1841, 4841, 9841, 82, 83, 'NOAAAA', 'SAMAAA', 'OOOOxx'),
+(457, 8131, 1, 1, 7, 17, 57, 457, 457, 457, 457, 114, 115, 'PRAAAA', 'TAMAAA', 'VVVVxx'),
+(8856, 8132, 0, 0, 6, 16, 56, 856, 856, 3856, 8856, 112, 113, 'QCAAAA', 'UAMAAA', 'AAAAxx'),
+(8043, 8133, 1, 3, 3, 3, 43, 43, 43, 3043, 8043, 86, 87, 'JXAAAA', 'VAMAAA', 'HHHHxx'),
+(5933, 8134, 1, 1, 3, 13, 33, 933, 1933, 933, 5933, 66, 67, 'FUAAAA', 'WAMAAA', 'OOOOxx'),
+(5725, 8135, 1, 1, 5, 5, 25, 725, 1725, 725, 5725, 50, 51, 'FMAAAA', 'XAMAAA', 'VVVVxx'),
+(8607, 8136, 1, 3, 7, 7, 7, 607, 607, 3607, 8607, 14, 15, 'BTAAAA', 'YAMAAA', 'AAAAxx'),
+(9280, 8137, 0, 0, 0, 0, 80, 280, 1280, 4280, 9280, 160, 161, 'YSAAAA', 'ZAMAAA', 'HHHHxx'),
+(6017, 8138, 1, 1, 7, 17, 17, 17, 17, 1017, 6017, 34, 35, 'LXAAAA', 'ABMAAA', 'OOOOxx'),
+(4946, 8139, 0, 2, 6, 6, 46, 946, 946, 4946, 4946, 92, 93, 'GIAAAA', 'BBMAAA', 'VVVVxx'),
+(7373, 8140, 1, 1, 3, 13, 73, 373, 1373, 2373, 7373, 146, 147, 'PXAAAA', 'CBMAAA', 'AAAAxx'),
+(8096, 8141, 0, 0, 6, 16, 96, 96, 96, 3096, 8096, 192, 193, 'KZAAAA', 'DBMAAA', 'HHHHxx'),
+(3178, 8142, 0, 2, 8, 18, 78, 178, 1178, 3178, 3178, 156, 157, 'GSAAAA', 'EBMAAA', 'OOOOxx'),
+(1849, 8143, 1, 1, 9, 9, 49, 849, 1849, 1849, 1849, 98, 99, 'DTAAAA', 'FBMAAA', 'VVVVxx'),
+(8813, 8144, 1, 1, 3, 13, 13, 813, 813, 3813, 8813, 26, 27, 'ZAAAAA', 'GBMAAA', 'AAAAxx'),
+(460, 8145, 0, 0, 0, 0, 60, 460, 460, 460, 460, 120, 121, 'SRAAAA', 'HBMAAA', 'HHHHxx'),
+(7756, 8146, 0, 0, 6, 16, 56, 756, 1756, 2756, 7756, 112, 113, 'IMAAAA', 'IBMAAA', 'OOOOxx'),
+(4425, 8147, 1, 1, 5, 5, 25, 425, 425, 4425, 4425, 50, 51, 'FOAAAA', 'JBMAAA', 'VVVVxx'),
+(1602, 8148, 0, 2, 2, 2, 2, 602, 1602, 1602, 1602, 4, 5, 'QJAAAA', 'KBMAAA', 'AAAAxx'),
+(5981, 8149, 1, 1, 1, 1, 81, 981, 1981, 981, 5981, 162, 163, 'BWAAAA', 'LBMAAA', 'HHHHxx'),
+(8139, 8150, 1, 3, 9, 19, 39, 139, 139, 3139, 8139, 78, 79, 'BBAAAA', 'MBMAAA', 'OOOOxx'),
+(754, 8151, 0, 2, 4, 14, 54, 754, 754, 754, 754, 108, 109, 'ADAAAA', 'NBMAAA', 'VVVVxx'),
+(26, 8152, 0, 2, 6, 6, 26, 26, 26, 26, 26, 52, 53, 'ABAAAA', 'OBMAAA', 'AAAAxx'),
+(106, 8153, 0, 2, 6, 6, 6, 106, 106, 106, 106, 12, 13, 'CEAAAA', 'PBMAAA', 'HHHHxx'),
+(7465, 8154, 1, 1, 5, 5, 65, 465, 1465, 2465, 7465, 130, 131, 'DBAAAA', 'QBMAAA', 'OOOOxx'),
+(1048, 8155, 0, 0, 8, 8, 48, 48, 1048, 1048, 1048, 96, 97, 'IOAAAA', 'RBMAAA', 'VVVVxx'),
+(2303, 8156, 1, 3, 3, 3, 3, 303, 303, 2303, 2303, 6, 7, 'PKAAAA', 'SBMAAA', 'AAAAxx'),
+(5794, 8157, 0, 2, 4, 14, 94, 794, 1794, 794, 5794, 188, 189, 'WOAAAA', 'TBMAAA', 'HHHHxx'),
+(3321, 8158, 1, 1, 1, 1, 21, 321, 1321, 3321, 3321, 42, 43, 'TXAAAA', 'UBMAAA', 'OOOOxx'),
+(6122, 8159, 0, 2, 2, 2, 22, 122, 122, 1122, 6122, 44, 45, 'MBAAAA', 'VBMAAA', 'VVVVxx'),
+(6474, 8160, 0, 2, 4, 14, 74, 474, 474, 1474, 6474, 148, 149, 'APAAAA', 'WBMAAA', 'AAAAxx'),
+(827, 8161, 1, 3, 7, 7, 27, 827, 827, 827, 827, 54, 55, 'VFAAAA', 'XBMAAA', 'HHHHxx'),
+(6616, 8162, 0, 0, 6, 16, 16, 616, 616, 1616, 6616, 32, 33, 'MUAAAA', 'YBMAAA', 'OOOOxx'),
+(2131, 8163, 1, 3, 1, 11, 31, 131, 131, 2131, 2131, 62, 63, 'ZDAAAA', 'ZBMAAA', 'VVVVxx'),
+(5483, 8164, 1, 3, 3, 3, 83, 483, 1483, 483, 5483, 166, 167, 'XCAAAA', 'ACMAAA', 'AAAAxx'),
+(606, 8165, 0, 2, 6, 6, 6, 606, 606, 606, 606, 12, 13, 'IXAAAA', 'BCMAAA', 'HHHHxx'),
+(922, 8166, 0, 2, 2, 2, 22, 922, 922, 922, 922, 44, 45, 'MJAAAA', 'CCMAAA', 'OOOOxx'),
+(8475, 8167, 1, 3, 5, 15, 75, 475, 475, 3475, 8475, 150, 151, 'ZNAAAA', 'DCMAAA', 'VVVVxx'),
+(7645, 8168, 1, 1, 5, 5, 45, 645, 1645, 2645, 7645, 90, 91, 'BIAAAA', 'ECMAAA', 'AAAAxx'),
+(5097, 8169, 1, 1, 7, 17, 97, 97, 1097, 97, 5097, 194, 195, 'BOAAAA', 'FCMAAA', 'HHHHxx'),
+(5377, 8170, 1, 1, 7, 17, 77, 377, 1377, 377, 5377, 154, 155, 'VYAAAA', 'GCMAAA', 'OOOOxx'),
+(6116, 8171, 0, 0, 6, 16, 16, 116, 116, 1116, 6116, 32, 33, 'GBAAAA', 'HCMAAA', 'VVVVxx'),
+(8674, 8172, 0, 2, 4, 14, 74, 674, 674, 3674, 8674, 148, 149, 'QVAAAA', 'ICMAAA', 'AAAAxx'),
+(8063, 8173, 1, 3, 3, 3, 63, 63, 63, 3063, 8063, 126, 127, 'DYAAAA', 'JCMAAA', 'HHHHxx'),
+(5271, 8174, 1, 3, 1, 11, 71, 271, 1271, 271, 5271, 142, 143, 'TUAAAA', 'KCMAAA', 'OOOOxx'),
+(1619, 8175, 1, 3, 9, 19, 19, 619, 1619, 1619, 1619, 38, 39, 'HKAAAA', 'LCMAAA', 'VVVVxx'),
+(6419, 8176, 1, 3, 9, 19, 19, 419, 419, 1419, 6419, 38, 39, 'XMAAAA', 'MCMAAA', 'AAAAxx'),
+(7651, 8177, 1, 3, 1, 11, 51, 651, 1651, 2651, 7651, 102, 103, 'HIAAAA', 'NCMAAA', 'HHHHxx'),
+(2897, 8178, 1, 1, 7, 17, 97, 897, 897, 2897, 2897, 194, 195, 'LHAAAA', 'OCMAAA', 'OOOOxx'),
+(8148, 8179, 0, 0, 8, 8, 48, 148, 148, 3148, 8148, 96, 97, 'KBAAAA', 'PCMAAA', 'VVVVxx'),
+(7461, 8180, 1, 1, 1, 1, 61, 461, 1461, 2461, 7461, 122, 123, 'ZAAAAA', 'QCMAAA', 'AAAAxx'),
+(9186, 8181, 0, 2, 6, 6, 86, 186, 1186, 4186, 9186, 172, 173, 'IPAAAA', 'RCMAAA', 'HHHHxx'),
+(7127, 8182, 1, 3, 7, 7, 27, 127, 1127, 2127, 7127, 54, 55, 'DOAAAA', 'SCMAAA', 'OOOOxx'),
+(8233, 8183, 1, 1, 3, 13, 33, 233, 233, 3233, 8233, 66, 67, 'REAAAA', 'TCMAAA', 'VVVVxx'),
+(9651, 8184, 1, 3, 1, 11, 51, 651, 1651, 4651, 9651, 102, 103, 'FHAAAA', 'UCMAAA', 'AAAAxx'),
+(6746, 8185, 0, 2, 6, 6, 46, 746, 746, 1746, 6746, 92, 93, 'MZAAAA', 'VCMAAA', 'HHHHxx'),
+(7835, 8186, 1, 3, 5, 15, 35, 835, 1835, 2835, 7835, 70, 71, 'JPAAAA', 'WCMAAA', 'OOOOxx'),
+(8815, 8187, 1, 3, 5, 15, 15, 815, 815, 3815, 8815, 30, 31, 'BBAAAA', 'XCMAAA', 'VVVVxx'),
+(6398, 8188, 0, 2, 8, 18, 98, 398, 398, 1398, 6398, 196, 197, 'CMAAAA', 'YCMAAA', 'AAAAxx'),
+(5344, 8189, 0, 0, 4, 4, 44, 344, 1344, 344, 5344, 88, 89, 'OXAAAA', 'ZCMAAA', 'HHHHxx'),
+(8209, 8190, 1, 1, 9, 9, 9, 209, 209, 3209, 8209, 18, 19, 'TDAAAA', 'ADMAAA', 'OOOOxx'),
+(8444, 8191, 0, 0, 4, 4, 44, 444, 444, 3444, 8444, 88, 89, 'UMAAAA', 'BDMAAA', 'VVVVxx'),
+(5669, 8192, 1, 1, 9, 9, 69, 669, 1669, 669, 5669, 138, 139, 'BKAAAA', 'CDMAAA', 'AAAAxx'),
+(2455, 8193, 1, 3, 5, 15, 55, 455, 455, 2455, 2455, 110, 111, 'LQAAAA', 'DDMAAA', 'HHHHxx'),
+(6767, 8194, 1, 3, 7, 7, 67, 767, 767, 1767, 6767, 134, 135, 'HAAAAA', 'EDMAAA', 'OOOOxx'),
+(135, 8195, 1, 3, 5, 15, 35, 135, 135, 135, 135, 70, 71, 'FFAAAA', 'FDMAAA', 'VVVVxx'),
+(3503, 8196, 1, 3, 3, 3, 3, 503, 1503, 3503, 3503, 6, 7, 'TEAAAA', 'GDMAAA', 'AAAAxx'),
+(6102, 8197, 0, 2, 2, 2, 2, 102, 102, 1102, 6102, 4, 5, 'SAAAAA', 'HDMAAA', 'HHHHxx'),
+(7136, 8198, 0, 0, 6, 16, 36, 136, 1136, 2136, 7136, 72, 73, 'MOAAAA', 'IDMAAA', 'OOOOxx'),
+(4933, 8199, 1, 1, 3, 13, 33, 933, 933, 4933, 4933, 66, 67, 'THAAAA', 'JDMAAA', 'VVVVxx'),
+(8804, 8200, 0, 0, 4, 4, 4, 804, 804, 3804, 8804, 8, 9, 'QAAAAA', 'KDMAAA', 'AAAAxx'),
+(3760, 8201, 0, 0, 0, 0, 60, 760, 1760, 3760, 3760, 120, 121, 'QOAAAA', 'LDMAAA', 'HHHHxx'),
+(8603, 8202, 1, 3, 3, 3, 3, 603, 603, 3603, 8603, 6, 7, 'XSAAAA', 'MDMAAA', 'OOOOxx'),
+(7411, 8203, 1, 3, 1, 11, 11, 411, 1411, 2411, 7411, 22, 23, 'BZAAAA', 'NDMAAA', 'VVVVxx'),
+(834, 8204, 0, 2, 4, 14, 34, 834, 834, 834, 834, 68, 69, 'CGAAAA', 'ODMAAA', 'AAAAxx'),
+(7385, 8205, 1, 1, 5, 5, 85, 385, 1385, 2385, 7385, 170, 171, 'BYAAAA', 'PDMAAA', 'HHHHxx'),
+(3696, 8206, 0, 0, 6, 16, 96, 696, 1696, 3696, 3696, 192, 193, 'EMAAAA', 'QDMAAA', 'OOOOxx'),
+(8720, 8207, 0, 0, 0, 0, 20, 720, 720, 3720, 8720, 40, 41, 'KXAAAA', 'RDMAAA', 'VVVVxx'),
+(4539, 8208, 1, 3, 9, 19, 39, 539, 539, 4539, 4539, 78, 79, 'PSAAAA', 'SDMAAA', 'AAAAxx'),
+(9837, 8209, 1, 1, 7, 17, 37, 837, 1837, 4837, 9837, 74, 75, 'JOAAAA', 'TDMAAA', 'HHHHxx'),
+(8595, 8210, 1, 3, 5, 15, 95, 595, 595, 3595, 8595, 190, 191, 'PSAAAA', 'UDMAAA', 'OOOOxx'),
+(3673, 8211, 1, 1, 3, 13, 73, 673, 1673, 3673, 3673, 146, 147, 'HLAAAA', 'VDMAAA', 'VVVVxx'),
+(475, 8212, 1, 3, 5, 15, 75, 475, 475, 475, 475, 150, 151, 'HSAAAA', 'WDMAAA', 'AAAAxx'),
+(2256, 8213, 0, 0, 6, 16, 56, 256, 256, 2256, 2256, 112, 113, 'UIAAAA', 'XDMAAA', 'HHHHxx'),
+(6349, 8214, 1, 1, 9, 9, 49, 349, 349, 1349, 6349, 98, 99, 'FKAAAA', 'YDMAAA', 'OOOOxx'),
+(9968, 8215, 0, 0, 8, 8, 68, 968, 1968, 4968, 9968, 136, 137, 'KTAAAA', 'ZDMAAA', 'VVVVxx'),
+(7261, 8216, 1, 1, 1, 1, 61, 261, 1261, 2261, 7261, 122, 123, 'HTAAAA', 'AEMAAA', 'AAAAxx'),
+(5799, 8217, 1, 3, 9, 19, 99, 799, 1799, 799, 5799, 198, 199, 'BPAAAA', 'BEMAAA', 'HHHHxx'),
+(8159, 8218, 1, 3, 9, 19, 59, 159, 159, 3159, 8159, 118, 119, 'VBAAAA', 'CEMAAA', 'OOOOxx'),
+(92, 8219, 0, 0, 2, 12, 92, 92, 92, 92, 92, 184, 185, 'ODAAAA', 'DEMAAA', 'VVVVxx'),
+(5927, 8220, 1, 3, 7, 7, 27, 927, 1927, 927, 5927, 54, 55, 'ZTAAAA', 'EEMAAA', 'AAAAxx'),
+(7925, 8221, 1, 1, 5, 5, 25, 925, 1925, 2925, 7925, 50, 51, 'VSAAAA', 'FEMAAA', 'HHHHxx'),
+(5836, 8222, 0, 0, 6, 16, 36, 836, 1836, 836, 5836, 72, 73, 'MQAAAA', 'GEMAAA', 'OOOOxx'),
+(7935, 8223, 1, 3, 5, 15, 35, 935, 1935, 2935, 7935, 70, 71, 'FTAAAA', 'HEMAAA', 'VVVVxx'),
+(5505, 8224, 1, 1, 5, 5, 5, 505, 1505, 505, 5505, 10, 11, 'TDAAAA', 'IEMAAA', 'AAAAxx'),
+(5882, 8225, 0, 2, 2, 2, 82, 882, 1882, 882, 5882, 164, 165, 'GSAAAA', 'JEMAAA', 'HHHHxx'),
+(4411, 8226, 1, 3, 1, 11, 11, 411, 411, 4411, 4411, 22, 23, 'RNAAAA', 'KEMAAA', 'OOOOxx'),
+(64, 8227, 0, 0, 4, 4, 64, 64, 64, 64, 64, 128, 129, 'MCAAAA', 'LEMAAA', 'VVVVxx'),
+(2851, 8228, 1, 3, 1, 11, 51, 851, 851, 2851, 2851, 102, 103, 'RFAAAA', 'MEMAAA', 'AAAAxx'),
+(1665, 8229, 1, 1, 5, 5, 65, 665, 1665, 1665, 1665, 130, 131, 'BMAAAA', 'NEMAAA', 'HHHHxx'),
+(2895, 8230, 1, 3, 5, 15, 95, 895, 895, 2895, 2895, 190, 191, 'JHAAAA', 'OEMAAA', 'OOOOxx'),
+(2210, 8231, 0, 2, 0, 10, 10, 210, 210, 2210, 2210, 20, 21, 'AHAAAA', 'PEMAAA', 'VVVVxx'),
+(9873, 8232, 1, 1, 3, 13, 73, 873, 1873, 4873, 9873, 146, 147, 'TPAAAA', 'QEMAAA', 'AAAAxx'),
+(5402, 8233, 0, 2, 2, 2, 2, 402, 1402, 402, 5402, 4, 5, 'UZAAAA', 'REMAAA', 'HHHHxx'),
+(285, 8234, 1, 1, 5, 5, 85, 285, 285, 285, 285, 170, 171, 'ZKAAAA', 'SEMAAA', 'OOOOxx'),
+(8545, 8235, 1, 1, 5, 5, 45, 545, 545, 3545, 8545, 90, 91, 'RQAAAA', 'TEMAAA', 'VVVVxx'),
+(5328, 8236, 0, 0, 8, 8, 28, 328, 1328, 328, 5328, 56, 57, 'YWAAAA', 'UEMAAA', 'AAAAxx'),
+(733, 8237, 1, 1, 3, 13, 33, 733, 733, 733, 733, 66, 67, 'FCAAAA', 'VEMAAA', 'HHHHxx'),
+(7726, 8238, 0, 2, 6, 6, 26, 726, 1726, 2726, 7726, 52, 53, 'ELAAAA', 'WEMAAA', 'OOOOxx'),
+(5418, 8239, 0, 2, 8, 18, 18, 418, 1418, 418, 5418, 36, 37, 'KAAAAA', 'XEMAAA', 'VVVVxx'),
+(7761, 8240, 1, 1, 1, 1, 61, 761, 1761, 2761, 7761, 122, 123, 'NMAAAA', 'YEMAAA', 'AAAAxx'),
+(9263, 8241, 1, 3, 3, 3, 63, 263, 1263, 4263, 9263, 126, 127, 'HSAAAA', 'ZEMAAA', 'HHHHxx'),
+(5579, 8242, 1, 3, 9, 19, 79, 579, 1579, 579, 5579, 158, 159, 'PGAAAA', 'AFMAAA', 'OOOOxx'),
+(5434, 8243, 0, 2, 4, 14, 34, 434, 1434, 434, 5434, 68, 69, 'ABAAAA', 'BFMAAA', 'VVVVxx'),
+(5230, 8244, 0, 2, 0, 10, 30, 230, 1230, 230, 5230, 60, 61, 'ETAAAA', 'CFMAAA', 'AAAAxx'),
+(9981, 8245, 1, 1, 1, 1, 81, 981, 1981, 4981, 9981, 162, 163, 'XTAAAA', 'DFMAAA', 'HHHHxx'),
+(5830, 8246, 0, 2, 0, 10, 30, 830, 1830, 830, 5830, 60, 61, 'GQAAAA', 'EFMAAA', 'OOOOxx'),
+(128, 8247, 0, 0, 8, 8, 28, 128, 128, 128, 128, 56, 57, 'YEAAAA', 'FFMAAA', 'VVVVxx'),
+(2734, 8248, 0, 2, 4, 14, 34, 734, 734, 2734, 2734, 68, 69, 'EBAAAA', 'GFMAAA', 'AAAAxx'),
+(4537, 8249, 1, 1, 7, 17, 37, 537, 537, 4537, 4537, 74, 75, 'NSAAAA', 'HFMAAA', 'HHHHxx'),
+(3899, 8250, 1, 3, 9, 19, 99, 899, 1899, 3899, 3899, 198, 199, 'ZTAAAA', 'IFMAAA', 'OOOOxx'),
+(1000, 8251, 0, 0, 0, 0, 0, 0, 1000, 1000, 1000, 0, 1, 'MMAAAA', 'JFMAAA', 'VVVVxx'),
+(9896, 8252, 0, 0, 6, 16, 96, 896, 1896, 4896, 9896, 192, 193, 'QQAAAA', 'KFMAAA', 'AAAAxx'),
+(3640, 8253, 0, 0, 0, 0, 40, 640, 1640, 3640, 3640, 80, 81, 'AKAAAA', 'LFMAAA', 'HHHHxx'),
+(2568, 8254, 0, 0, 8, 8, 68, 568, 568, 2568, 2568, 136, 137, 'UUAAAA', 'MFMAAA', 'OOOOxx'),
+(2026, 8255, 0, 2, 6, 6, 26, 26, 26, 2026, 2026, 52, 53, 'YZAAAA', 'NFMAAA', 'VVVVxx'),
+(3955, 8256, 1, 3, 5, 15, 55, 955, 1955, 3955, 3955, 110, 111, 'DWAAAA', 'OFMAAA', 'AAAAxx'),
+(7152, 8257, 0, 0, 2, 12, 52, 152, 1152, 2152, 7152, 104, 105, 'CPAAAA', 'PFMAAA', 'HHHHxx'),
+(2402, 8258, 0, 2, 2, 2, 2, 402, 402, 2402, 2402, 4, 5, 'KOAAAA', 'QFMAAA', 'OOOOxx'),
+(9522, 8259, 0, 2, 2, 2, 22, 522, 1522, 4522, 9522, 44, 45, 'GCAAAA', 'RFMAAA', 'VVVVxx'),
+(4011, 8260, 1, 3, 1, 11, 11, 11, 11, 4011, 4011, 22, 23, 'HYAAAA', 'SFMAAA', 'AAAAxx'),
+(3297, 8261, 1, 1, 7, 17, 97, 297, 1297, 3297, 3297, 194, 195, 'VWAAAA', 'TFMAAA', 'HHHHxx'),
+(4915, 8262, 1, 3, 5, 15, 15, 915, 915, 4915, 4915, 30, 31, 'BHAAAA', 'UFMAAA', 'OOOOxx'),
+(5397, 8263, 1, 1, 7, 17, 97, 397, 1397, 397, 5397, 194, 195, 'PZAAAA', 'VFMAAA', 'VVVVxx'),
+(5454, 8264, 0, 2, 4, 14, 54, 454, 1454, 454, 5454, 108, 109, 'UBAAAA', 'WFMAAA', 'AAAAxx'),
+(4568, 8265, 0, 0, 8, 8, 68, 568, 568, 4568, 4568, 136, 137, 'STAAAA', 'XFMAAA', 'HHHHxx'),
+(5875, 8266, 1, 3, 5, 15, 75, 875, 1875, 875, 5875, 150, 151, 'ZRAAAA', 'YFMAAA', 'OOOOxx'),
+(3642, 8267, 0, 2, 2, 2, 42, 642, 1642, 3642, 3642, 84, 85, 'CKAAAA', 'ZFMAAA', 'VVVVxx'),
+(8506, 8268, 0, 2, 6, 6, 6, 506, 506, 3506, 8506, 12, 13, 'EPAAAA', 'AGMAAA', 'AAAAxx'),
+(9621, 8269, 1, 1, 1, 1, 21, 621, 1621, 4621, 9621, 42, 43, 'BGAAAA', 'BGMAAA', 'HHHHxx'),
+(7739, 8270, 1, 3, 9, 19, 39, 739, 1739, 2739, 7739, 78, 79, 'RLAAAA', 'CGMAAA', 'OOOOxx'),
+(3987, 8271, 1, 3, 7, 7, 87, 987, 1987, 3987, 3987, 174, 175, 'JXAAAA', 'DGMAAA', 'VVVVxx'),
+(2090, 8272, 0, 2, 0, 10, 90, 90, 90, 2090, 2090, 180, 181, 'KCAAAA', 'EGMAAA', 'AAAAxx'),
+(3838, 8273, 0, 2, 8, 18, 38, 838, 1838, 3838, 3838, 76, 77, 'QRAAAA', 'FGMAAA', 'HHHHxx'),
+(17, 8274, 1, 1, 7, 17, 17, 17, 17, 17, 17, 34, 35, 'RAAAAA', 'GGMAAA', 'OOOOxx'),
+(3406, 8275, 0, 2, 6, 6, 6, 406, 1406, 3406, 3406, 12, 13, 'ABAAAA', 'HGMAAA', 'VVVVxx'),
+(8312, 8276, 0, 0, 2, 12, 12, 312, 312, 3312, 8312, 24, 25, 'SHAAAA', 'IGMAAA', 'AAAAxx'),
+(4034, 8277, 0, 2, 4, 14, 34, 34, 34, 4034, 4034, 68, 69, 'EZAAAA', 'JGMAAA', 'HHHHxx'),
+(1535, 8278, 1, 3, 5, 15, 35, 535, 1535, 1535, 1535, 70, 71, 'BHAAAA', 'KGMAAA', 'OOOOxx'),
+(7198, 8279, 0, 2, 8, 18, 98, 198, 1198, 2198, 7198, 196, 197, 'WQAAAA', 'LGMAAA', 'VVVVxx'),
+(8885, 8280, 1, 1, 5, 5, 85, 885, 885, 3885, 8885, 170, 171, 'TDAAAA', 'MGMAAA', 'AAAAxx'),
+(4081, 8281, 1, 1, 1, 1, 81, 81, 81, 4081, 4081, 162, 163, 'ZAAAAA', 'NGMAAA', 'HHHHxx'),
+(980, 8282, 0, 0, 0, 0, 80, 980, 980, 980, 980, 160, 161, 'SLAAAA', 'OGMAAA', 'OOOOxx'),
+(551, 8283, 1, 3, 1, 11, 51, 551, 551, 551, 551, 102, 103, 'FVAAAA', 'PGMAAA', 'VVVVxx'),
+(7746, 8284, 0, 2, 6, 6, 46, 746, 1746, 2746, 7746, 92, 93, 'YLAAAA', 'QGMAAA', 'AAAAxx'),
+(4756, 8285, 0, 0, 6, 16, 56, 756, 756, 4756, 4756, 112, 113, 'YAAAAA', 'RGMAAA', 'HHHHxx'),
+(3655, 8286, 1, 3, 5, 15, 55, 655, 1655, 3655, 3655, 110, 111, 'PKAAAA', 'SGMAAA', 'OOOOxx'),
+(7075, 8287, 1, 3, 5, 15, 75, 75, 1075, 2075, 7075, 150, 151, 'DMAAAA', 'TGMAAA', 'VVVVxx'),
+(3950, 8288, 0, 2, 0, 10, 50, 950, 1950, 3950, 3950, 100, 101, 'YVAAAA', 'UGMAAA', 'AAAAxx'),
+(2314, 8289, 0, 2, 4, 14, 14, 314, 314, 2314, 2314, 28, 29, 'ALAAAA', 'VGMAAA', 'HHHHxx'),
+(8432, 8290, 0, 0, 2, 12, 32, 432, 432, 3432, 8432, 64, 65, 'IMAAAA', 'WGMAAA', 'OOOOxx'),
+(62, 8291, 0, 2, 2, 2, 62, 62, 62, 62, 62, 124, 125, 'KCAAAA', 'XGMAAA', 'VVVVxx'),
+(6920, 8292, 0, 0, 0, 0, 20, 920, 920, 1920, 6920, 40, 41, 'EGAAAA', 'YGMAAA', 'AAAAxx'),
+(4077, 8293, 1, 1, 7, 17, 77, 77, 77, 4077, 4077, 154, 155, 'VAAAAA', 'ZGMAAA', 'HHHHxx'),
+(9118, 8294, 0, 2, 8, 18, 18, 118, 1118, 4118, 9118, 36, 37, 'SMAAAA', 'AHMAAA', 'OOOOxx'),
+(5375, 8295, 1, 3, 5, 15, 75, 375, 1375, 375, 5375, 150, 151, 'TYAAAA', 'BHMAAA', 'VVVVxx'),
+(178, 8296, 0, 2, 8, 18, 78, 178, 178, 178, 178, 156, 157, 'WGAAAA', 'CHMAAA', 'AAAAxx'),
+(1079, 8297, 1, 3, 9, 19, 79, 79, 1079, 1079, 1079, 158, 159, 'NPAAAA', 'DHMAAA', 'HHHHxx'),
+(4279, 8298, 1, 3, 9, 19, 79, 279, 279, 4279, 4279, 158, 159, 'PIAAAA', 'EHMAAA', 'OOOOxx'),
+(8436, 8299, 0, 0, 6, 16, 36, 436, 436, 3436, 8436, 72, 73, 'MMAAAA', 'FHMAAA', 'VVVVxx'),
+(1931, 8300, 1, 3, 1, 11, 31, 931, 1931, 1931, 1931, 62, 63, 'HWAAAA', 'GHMAAA', 'AAAAxx'),
+(2096, 8301, 0, 0, 6, 16, 96, 96, 96, 2096, 2096, 192, 193, 'QCAAAA', 'HHMAAA', 'HHHHxx'),
+(1638, 8302, 0, 2, 8, 18, 38, 638, 1638, 1638, 1638, 76, 77, 'ALAAAA', 'IHMAAA', 'OOOOxx'),
+(2788, 8303, 0, 0, 8, 8, 88, 788, 788, 2788, 2788, 176, 177, 'GDAAAA', 'JHMAAA', 'VVVVxx'),
+(4751, 8304, 1, 3, 1, 11, 51, 751, 751, 4751, 4751, 102, 103, 'TAAAAA', 'KHMAAA', 'AAAAxx'),
+(8824, 8305, 0, 0, 4, 4, 24, 824, 824, 3824, 8824, 48, 49, 'KBAAAA', 'LHMAAA', 'HHHHxx'),
+(3098, 8306, 0, 2, 8, 18, 98, 98, 1098, 3098, 3098, 196, 197, 'EPAAAA', 'MHMAAA', 'OOOOxx'),
+(4497, 8307, 1, 1, 7, 17, 97, 497, 497, 4497, 4497, 194, 195, 'ZQAAAA', 'NHMAAA', 'VVVVxx'),
+(5223, 8308, 1, 3, 3, 3, 23, 223, 1223, 223, 5223, 46, 47, 'XSAAAA', 'OHMAAA', 'AAAAxx'),
+(9212, 8309, 0, 0, 2, 12, 12, 212, 1212, 4212, 9212, 24, 25, 'IQAAAA', 'PHMAAA', 'HHHHxx'),
+(4265, 8310, 1, 1, 5, 5, 65, 265, 265, 4265, 4265, 130, 131, 'BIAAAA', 'QHMAAA', 'OOOOxx'),
+(6898, 8311, 0, 2, 8, 18, 98, 898, 898, 1898, 6898, 196, 197, 'IFAAAA', 'RHMAAA', 'VVVVxx'),
+(8808, 8312, 0, 0, 8, 8, 8, 808, 808, 3808, 8808, 16, 17, 'UAAAAA', 'SHMAAA', 'AAAAxx'),
+(5629, 8313, 1, 1, 9, 9, 29, 629, 1629, 629, 5629, 58, 59, 'NIAAAA', 'THMAAA', 'HHHHxx'),
+(3779, 8314, 1, 3, 9, 19, 79, 779, 1779, 3779, 3779, 158, 159, 'JPAAAA', 'UHMAAA', 'OOOOxx'),
+(4972, 8315, 0, 0, 2, 12, 72, 972, 972, 4972, 4972, 144, 145, 'GJAAAA', 'VHMAAA', 'VVVVxx'),
+(4511, 8316, 1, 3, 1, 11, 11, 511, 511, 4511, 4511, 22, 23, 'NRAAAA', 'WHMAAA', 'AAAAxx'),
+(6761, 8317, 1, 1, 1, 1, 61, 761, 761, 1761, 6761, 122, 123, 'BAAAAA', 'XHMAAA', 'HHHHxx'),
+(2335, 8318, 1, 3, 5, 15, 35, 335, 335, 2335, 2335, 70, 71, 'VLAAAA', 'YHMAAA', 'OOOOxx'),
+(732, 8319, 0, 0, 2, 12, 32, 732, 732, 732, 732, 64, 65, 'ECAAAA', 'ZHMAAA', 'VVVVxx'),
+(4757, 8320, 1, 1, 7, 17, 57, 757, 757, 4757, 4757, 114, 115, 'ZAAAAA', 'AIMAAA', 'AAAAxx'),
+(6624, 8321, 0, 0, 4, 4, 24, 624, 624, 1624, 6624, 48, 49, 'UUAAAA', 'BIMAAA', 'HHHHxx'),
+(5869, 8322, 1, 1, 9, 9, 69, 869, 1869, 869, 5869, 138, 139, 'TRAAAA', 'CIMAAA', 'OOOOxx'),
+(5842, 8323, 0, 2, 2, 2, 42, 842, 1842, 842, 5842, 84, 85, 'SQAAAA', 'DIMAAA', 'VVVVxx'),
+(5735, 8324, 1, 3, 5, 15, 35, 735, 1735, 735, 5735, 70, 71, 'PMAAAA', 'EIMAAA', 'AAAAxx'),
+(8276, 8325, 0, 0, 6, 16, 76, 276, 276, 3276, 8276, 152, 153, 'IGAAAA', 'FIMAAA', 'HHHHxx'),
+(7227, 8326, 1, 3, 7, 7, 27, 227, 1227, 2227, 7227, 54, 55, 'ZRAAAA', 'GIMAAA', 'OOOOxx'),
+(4923, 8327, 1, 3, 3, 3, 23, 923, 923, 4923, 4923, 46, 47, 'JHAAAA', 'HIMAAA', 'VVVVxx'),
+(9135, 8328, 1, 3, 5, 15, 35, 135, 1135, 4135, 9135, 70, 71, 'JNAAAA', 'IIMAAA', 'AAAAxx'),
+(5813, 8329, 1, 1, 3, 13, 13, 813, 1813, 813, 5813, 26, 27, 'PPAAAA', 'JIMAAA', 'HHHHxx'),
+(9697, 8330, 1, 1, 7, 17, 97, 697, 1697, 4697, 9697, 194, 195, 'ZIAAAA', 'KIMAAA', 'OOOOxx'),
+(3222, 8331, 0, 2, 2, 2, 22, 222, 1222, 3222, 3222, 44, 45, 'YTAAAA', 'LIMAAA', 'VVVVxx'),
+(2394, 8332, 0, 2, 4, 14, 94, 394, 394, 2394, 2394, 188, 189, 'COAAAA', 'MIMAAA', 'AAAAxx'),
+(5784, 8333, 0, 0, 4, 4, 84, 784, 1784, 784, 5784, 168, 169, 'MOAAAA', 'NIMAAA', 'HHHHxx'),
+(3652, 8334, 0, 0, 2, 12, 52, 652, 1652, 3652, 3652, 104, 105, 'MKAAAA', 'OIMAAA', 'OOOOxx'),
+(8175, 8335, 1, 3, 5, 15, 75, 175, 175, 3175, 8175, 150, 151, 'LCAAAA', 'PIMAAA', 'VVVVxx'),
+(7568, 8336, 0, 0, 8, 8, 68, 568, 1568, 2568, 7568, 136, 137, 'CFAAAA', 'QIMAAA', 'AAAAxx'),
+(6645, 8337, 1, 1, 5, 5, 45, 645, 645, 1645, 6645, 90, 91, 'PVAAAA', 'RIMAAA', 'HHHHxx'),
+(8176, 8338, 0, 0, 6, 16, 76, 176, 176, 3176, 8176, 152, 153, 'MCAAAA', 'SIMAAA', 'OOOOxx'),
+(530, 8339, 0, 2, 0, 10, 30, 530, 530, 530, 530, 60, 61, 'KUAAAA', 'TIMAAA', 'VVVVxx'),
+(5439, 8340, 1, 3, 9, 19, 39, 439, 1439, 439, 5439, 78, 79, 'FBAAAA', 'UIMAAA', 'AAAAxx'),
+(61, 8341, 1, 1, 1, 1, 61, 61, 61, 61, 61, 122, 123, 'JCAAAA', 'VIMAAA', 'HHHHxx'),
+(3951, 8342, 1, 3, 1, 11, 51, 951, 1951, 3951, 3951, 102, 103, 'ZVAAAA', 'WIMAAA', 'OOOOxx'),
+(5283, 8343, 1, 3, 3, 3, 83, 283, 1283, 283, 5283, 166, 167, 'FVAAAA', 'XIMAAA', 'VVVVxx'),
+(7226, 8344, 0, 2, 6, 6, 26, 226, 1226, 2226, 7226, 52, 53, 'YRAAAA', 'YIMAAA', 'AAAAxx'),
+(1954, 8345, 0, 2, 4, 14, 54, 954, 1954, 1954, 1954, 108, 109, 'EXAAAA', 'ZIMAAA', 'HHHHxx'),
+(334, 8346, 0, 2, 4, 14, 34, 334, 334, 334, 334, 68, 69, 'WMAAAA', 'AJMAAA', 'OOOOxx'),
+(3921, 8347, 1, 1, 1, 1, 21, 921, 1921, 3921, 3921, 42, 43, 'VUAAAA', 'BJMAAA', 'VVVVxx'),
+(6276, 8348, 0, 0, 6, 16, 76, 276, 276, 1276, 6276, 152, 153, 'KHAAAA', 'CJMAAA', 'AAAAxx'),
+(3378, 8349, 0, 2, 8, 18, 78, 378, 1378, 3378, 3378, 156, 157, 'YZAAAA', 'DJMAAA', 'HHHHxx'),
+(5236, 8350, 0, 0, 6, 16, 36, 236, 1236, 236, 5236, 72, 73, 'KTAAAA', 'EJMAAA', 'OOOOxx'),
+(7781, 8351, 1, 1, 1, 1, 81, 781, 1781, 2781, 7781, 162, 163, 'HNAAAA', 'FJMAAA', 'VVVVxx'),
+(8601, 8352, 1, 1, 1, 1, 1, 601, 601, 3601, 8601, 2, 3, 'VSAAAA', 'GJMAAA', 'AAAAxx'),
+(1473, 8353, 1, 1, 3, 13, 73, 473, 1473, 1473, 1473, 146, 147, 'REAAAA', 'HJMAAA', 'HHHHxx'),
+(3246, 8354, 0, 2, 6, 6, 46, 246, 1246, 3246, 3246, 92, 93, 'WUAAAA', 'IJMAAA', 'OOOOxx'),
+(3601, 8355, 1, 1, 1, 1, 1, 601, 1601, 3601, 3601, 2, 3, 'NIAAAA', 'JJMAAA', 'VVVVxx'),
+(6861, 8356, 1, 1, 1, 1, 61, 861, 861, 1861, 6861, 122, 123, 'XDAAAA', 'KJMAAA', 'AAAAxx'),
+(9032, 8357, 0, 0, 2, 12, 32, 32, 1032, 4032, 9032, 64, 65, 'KJAAAA', 'LJMAAA', 'HHHHxx'),
+(216, 8358, 0, 0, 6, 16, 16, 216, 216, 216, 216, 32, 33, 'IIAAAA', 'MJMAAA', 'OOOOxx'),
+(3824, 8359, 0, 0, 4, 4, 24, 824, 1824, 3824, 3824, 48, 49, 'CRAAAA', 'NJMAAA', 'VVVVxx'),
+(8486, 8360, 0, 2, 6, 6, 86, 486, 486, 3486, 8486, 172, 173, 'KOAAAA', 'OJMAAA', 'AAAAxx'),
+(276, 8361, 0, 0, 6, 16, 76, 276, 276, 276, 276, 152, 153, 'QKAAAA', 'PJMAAA', 'HHHHxx'),
+(1838, 8362, 0, 2, 8, 18, 38, 838, 1838, 1838, 1838, 76, 77, 'SSAAAA', 'QJMAAA', 'OOOOxx'),
+(6175, 8363, 1, 3, 5, 15, 75, 175, 175, 1175, 6175, 150, 151, 'NDAAAA', 'RJMAAA', 'VVVVxx'),
+(3719, 8364, 1, 3, 9, 19, 19, 719, 1719, 3719, 3719, 38, 39, 'BNAAAA', 'SJMAAA', 'AAAAxx'),
+(6958, 8365, 0, 2, 8, 18, 58, 958, 958, 1958, 6958, 116, 117, 'QHAAAA', 'TJMAAA', 'HHHHxx'),
+(6822, 8366, 0, 2, 2, 2, 22, 822, 822, 1822, 6822, 44, 45, 'KCAAAA', 'UJMAAA', 'OOOOxx'),
+(3318, 8367, 0, 2, 8, 18, 18, 318, 1318, 3318, 3318, 36, 37, 'QXAAAA', 'VJMAAA', 'VVVVxx'),
+(7222, 8368, 0, 2, 2, 2, 22, 222, 1222, 2222, 7222, 44, 45, 'URAAAA', 'WJMAAA', 'AAAAxx'),
+(85, 8369, 1, 1, 5, 5, 85, 85, 85, 85, 85, 170, 171, 'HDAAAA', 'XJMAAA', 'HHHHxx'),
+(5158, 8370, 0, 2, 8, 18, 58, 158, 1158, 158, 5158, 116, 117, 'KQAAAA', 'YJMAAA', 'OOOOxx'),
+(6360, 8371, 0, 0, 0, 0, 60, 360, 360, 1360, 6360, 120, 121, 'QKAAAA', 'ZJMAAA', 'VVVVxx'),
+(2599, 8372, 1, 3, 9, 19, 99, 599, 599, 2599, 2599, 198, 199, 'ZVAAAA', 'AKMAAA', 'AAAAxx'),
+(4002, 8373, 0, 2, 2, 2, 2, 2, 2, 4002, 4002, 4, 5, 'YXAAAA', 'BKMAAA', 'HHHHxx'),
+(6597, 8374, 1, 1, 7, 17, 97, 597, 597, 1597, 6597, 194, 195, 'TTAAAA', 'CKMAAA', 'OOOOxx'),
+(5762, 8375, 0, 2, 2, 2, 62, 762, 1762, 762, 5762, 124, 125, 'QNAAAA', 'DKMAAA', 'VVVVxx'),
+(8383, 8376, 1, 3, 3, 3, 83, 383, 383, 3383, 8383, 166, 167, 'LKAAAA', 'EKMAAA', 'AAAAxx'),
+(4686, 8377, 0, 2, 6, 6, 86, 686, 686, 4686, 4686, 172, 173, 'GYAAAA', 'FKMAAA', 'HHHHxx'),
+(5972, 8378, 0, 0, 2, 12, 72, 972, 1972, 972, 5972, 144, 145, 'SVAAAA', 'GKMAAA', 'OOOOxx'),
+(1432, 8379, 0, 0, 2, 12, 32, 432, 1432, 1432, 1432, 64, 65, 'CDAAAA', 'HKMAAA', 'VVVVxx'),
+(1601, 8380, 1, 1, 1, 1, 1, 601, 1601, 1601, 1601, 2, 3, 'PJAAAA', 'IKMAAA', 'AAAAxx'),
+(3012, 8381, 0, 0, 2, 12, 12, 12, 1012, 3012, 3012, 24, 25, 'WLAAAA', 'JKMAAA', 'HHHHxx'),
+(9345, 8382, 1, 1, 5, 5, 45, 345, 1345, 4345, 9345, 90, 91, 'LVAAAA', 'KKMAAA', 'OOOOxx'),
+(8869, 8383, 1, 1, 9, 9, 69, 869, 869, 3869, 8869, 138, 139, 'DDAAAA', 'LKMAAA', 'VVVVxx'),
+(6612, 8384, 0, 0, 2, 12, 12, 612, 612, 1612, 6612, 24, 25, 'IUAAAA', 'MKMAAA', 'AAAAxx'),
+(262, 8385, 0, 2, 2, 2, 62, 262, 262, 262, 262, 124, 125, 'CKAAAA', 'NKMAAA', 'HHHHxx'),
+(300, 8386, 0, 0, 0, 0, 0, 300, 300, 300, 300, 0, 1, 'OLAAAA', 'OKMAAA', 'OOOOxx'),
+(3045, 8387, 1, 1, 5, 5, 45, 45, 1045, 3045, 3045, 90, 91, 'DNAAAA', 'PKMAAA', 'VVVVxx'),
+(7252, 8388, 0, 0, 2, 12, 52, 252, 1252, 2252, 7252, 104, 105, 'YSAAAA', 'QKMAAA', 'AAAAxx'),
+(9099, 8389, 1, 3, 9, 19, 99, 99, 1099, 4099, 9099, 198, 199, 'ZLAAAA', 'RKMAAA', 'HHHHxx'),
+(9006, 8390, 0, 2, 6, 6, 6, 6, 1006, 4006, 9006, 12, 13, 'KIAAAA', 'SKMAAA', 'OOOOxx'),
+(3078, 8391, 0, 2, 8, 18, 78, 78, 1078, 3078, 3078, 156, 157, 'KOAAAA', 'TKMAAA', 'VVVVxx'),
+(5159, 8392, 1, 3, 9, 19, 59, 159, 1159, 159, 5159, 118, 119, 'LQAAAA', 'UKMAAA', 'AAAAxx'),
+(9329, 8393, 1, 1, 9, 9, 29, 329, 1329, 4329, 9329, 58, 59, 'VUAAAA', 'VKMAAA', 'HHHHxx'),
+(1393, 8394, 1, 1, 3, 13, 93, 393, 1393, 1393, 1393, 186, 187, 'PBAAAA', 'WKMAAA', 'OOOOxx'),
+(5894, 8395, 0, 2, 4, 14, 94, 894, 1894, 894, 5894, 188, 189, 'SSAAAA', 'XKMAAA', 'VVVVxx'),
+(11, 8396, 1, 3, 1, 11, 11, 11, 11, 11, 11, 22, 23, 'LAAAAA', 'YKMAAA', 'AAAAxx'),
+(5606, 8397, 0, 2, 6, 6, 6, 606, 1606, 606, 5606, 12, 13, 'QHAAAA', 'ZKMAAA', 'HHHHxx'),
+(5541, 8398, 1, 1, 1, 1, 41, 541, 1541, 541, 5541, 82, 83, 'DFAAAA', 'ALMAAA', 'OOOOxx'),
+(2689, 8399, 1, 1, 9, 9, 89, 689, 689, 2689, 2689, 178, 179, 'LZAAAA', 'BLMAAA', 'VVVVxx'),
+(1023, 8400, 1, 3, 3, 3, 23, 23, 1023, 1023, 1023, 46, 47, 'JNAAAA', 'CLMAAA', 'AAAAxx'),
+(8134, 8401, 0, 2, 4, 14, 34, 134, 134, 3134, 8134, 68, 69, 'WAAAAA', 'DLMAAA', 'HHHHxx'),
+(5923, 8402, 1, 3, 3, 3, 23, 923, 1923, 923, 5923, 46, 47, 'VTAAAA', 'ELMAAA', 'OOOOxx'),
+(6056, 8403, 0, 0, 6, 16, 56, 56, 56, 1056, 6056, 112, 113, 'YYAAAA', 'FLMAAA', 'VVVVxx'),
+(653, 8404, 1, 1, 3, 13, 53, 653, 653, 653, 653, 106, 107, 'DZAAAA', 'GLMAAA', 'AAAAxx'),
+(367, 8405, 1, 3, 7, 7, 67, 367, 367, 367, 367, 134, 135, 'DOAAAA', 'HLMAAA', 'HHHHxx'),
+(1828, 8406, 0, 0, 8, 8, 28, 828, 1828, 1828, 1828, 56, 57, 'ISAAAA', 'ILMAAA', 'OOOOxx'),
+(6506, 8407, 0, 2, 6, 6, 6, 506, 506, 1506, 6506, 12, 13, 'GQAAAA', 'JLMAAA', 'VVVVxx'),
+(5772, 8408, 0, 0, 2, 12, 72, 772, 1772, 772, 5772, 144, 145, 'AOAAAA', 'KLMAAA', 'AAAAxx'),
+(8052, 8409, 0, 0, 2, 12, 52, 52, 52, 3052, 8052, 104, 105, 'SXAAAA', 'LLMAAA', 'HHHHxx'),
+(2633, 8410, 1, 1, 3, 13, 33, 633, 633, 2633, 2633, 66, 67, 'HXAAAA', 'MLMAAA', 'OOOOxx'),
+(4878, 8411, 0, 2, 8, 18, 78, 878, 878, 4878, 4878, 156, 157, 'QFAAAA', 'NLMAAA', 'VVVVxx'),
+(5621, 8412, 1, 1, 1, 1, 21, 621, 1621, 621, 5621, 42, 43, 'FIAAAA', 'OLMAAA', 'AAAAxx'),
+(41, 8413, 1, 1, 1, 1, 41, 41, 41, 41, 41, 82, 83, 'PBAAAA', 'PLMAAA', 'HHHHxx'),
+(4613, 8414, 1, 1, 3, 13, 13, 613, 613, 4613, 4613, 26, 27, 'LVAAAA', 'QLMAAA', 'OOOOxx'),
+(9389, 8415, 1, 1, 9, 9, 89, 389, 1389, 4389, 9389, 178, 179, 'DXAAAA', 'RLMAAA', 'VVVVxx'),
+(9414, 8416, 0, 2, 4, 14, 14, 414, 1414, 4414, 9414, 28, 29, 'CYAAAA', 'SLMAAA', 'AAAAxx'),
+(3583, 8417, 1, 3, 3, 3, 83, 583, 1583, 3583, 3583, 166, 167, 'VHAAAA', 'TLMAAA', 'HHHHxx'),
+(3454, 8418, 0, 2, 4, 14, 54, 454, 1454, 3454, 3454, 108, 109, 'WCAAAA', 'ULMAAA', 'OOOOxx'),
+(719, 8419, 1, 3, 9, 19, 19, 719, 719, 719, 719, 38, 39, 'RBAAAA', 'VLMAAA', 'VVVVxx'),
+(6188, 8420, 0, 0, 8, 8, 88, 188, 188, 1188, 6188, 176, 177, 'AEAAAA', 'WLMAAA', 'AAAAxx'),
+(2288, 8421, 0, 0, 8, 8, 88, 288, 288, 2288, 2288, 176, 177, 'AKAAAA', 'XLMAAA', 'HHHHxx'),
+(1287, 8422, 1, 3, 7, 7, 87, 287, 1287, 1287, 1287, 174, 175, 'NXAAAA', 'YLMAAA', 'OOOOxx'),
+(1397, 8423, 1, 1, 7, 17, 97, 397, 1397, 1397, 1397, 194, 195, 'TBAAAA', 'ZLMAAA', 'VVVVxx'),
+(7763, 8424, 1, 3, 3, 3, 63, 763, 1763, 2763, 7763, 126, 127, 'PMAAAA', 'AMMAAA', 'AAAAxx'),
+(5194, 8425, 0, 2, 4, 14, 94, 194, 1194, 194, 5194, 188, 189, 'URAAAA', 'BMMAAA', 'HHHHxx'),
+(3167, 8426, 1, 3, 7, 7, 67, 167, 1167, 3167, 3167, 134, 135, 'VRAAAA', 'CMMAAA', 'OOOOxx'),
+(9218, 8427, 0, 2, 8, 18, 18, 218, 1218, 4218, 9218, 36, 37, 'OQAAAA', 'DMMAAA', 'VVVVxx'),
+(2065, 8428, 1, 1, 5, 5, 65, 65, 65, 2065, 2065, 130, 131, 'LBAAAA', 'EMMAAA', 'AAAAxx'),
+(9669, 8429, 1, 1, 9, 9, 69, 669, 1669, 4669, 9669, 138, 139, 'XHAAAA', 'FMMAAA', 'HHHHxx'),
+(146, 8430, 0, 2, 6, 6, 46, 146, 146, 146, 146, 92, 93, 'QFAAAA', 'GMMAAA', 'OOOOxx'),
+(6141, 8431, 1, 1, 1, 1, 41, 141, 141, 1141, 6141, 82, 83, 'FCAAAA', 'HMMAAA', 'VVVVxx'),
+(2843, 8432, 1, 3, 3, 3, 43, 843, 843, 2843, 2843, 86, 87, 'JFAAAA', 'IMMAAA', 'AAAAxx'),
+(7934, 8433, 0, 2, 4, 14, 34, 934, 1934, 2934, 7934, 68, 69, 'ETAAAA', 'JMMAAA', 'HHHHxx'),
+(2536, 8434, 0, 0, 6, 16, 36, 536, 536, 2536, 2536, 72, 73, 'OTAAAA', 'KMMAAA', 'OOOOxx'),
+(7088, 8435, 0, 0, 8, 8, 88, 88, 1088, 2088, 7088, 176, 177, 'QMAAAA', 'LMMAAA', 'VVVVxx'),
+(2519, 8436, 1, 3, 9, 19, 19, 519, 519, 2519, 2519, 38, 39, 'XSAAAA', 'MMMAAA', 'AAAAxx'),
+(6650, 8437, 0, 2, 0, 10, 50, 650, 650, 1650, 6650, 100, 101, 'UVAAAA', 'NMMAAA', 'HHHHxx'),
+(3007, 8438, 1, 3, 7, 7, 7, 7, 1007, 3007, 3007, 14, 15, 'RLAAAA', 'OMMAAA', 'OOOOxx'),
+(4507, 8439, 1, 3, 7, 7, 7, 507, 507, 4507, 4507, 14, 15, 'JRAAAA', 'PMMAAA', 'VVVVxx'),
+(4892, 8440, 0, 0, 2, 12, 92, 892, 892, 4892, 4892, 184, 185, 'EGAAAA', 'QMMAAA', 'AAAAxx'),
+(7159, 8441, 1, 3, 9, 19, 59, 159, 1159, 2159, 7159, 118, 119, 'JPAAAA', 'RMMAAA', 'HHHHxx'),
+(3171, 8442, 1, 3, 1, 11, 71, 171, 1171, 3171, 3171, 142, 143, 'ZRAAAA', 'SMMAAA', 'OOOOxx'),
+(1080, 8443, 0, 0, 0, 0, 80, 80, 1080, 1080, 1080, 160, 161, 'OPAAAA', 'TMMAAA', 'VVVVxx'),
+(7248, 8444, 0, 0, 8, 8, 48, 248, 1248, 2248, 7248, 96, 97, 'USAAAA', 'UMMAAA', 'AAAAxx'),
+(7230, 8445, 0, 2, 0, 10, 30, 230, 1230, 2230, 7230, 60, 61, 'CSAAAA', 'VMMAAA', 'HHHHxx'),
+(3823, 8446, 1, 3, 3, 3, 23, 823, 1823, 3823, 3823, 46, 47, 'BRAAAA', 'WMMAAA', 'OOOOxx'),
+(5517, 8447, 1, 1, 7, 17, 17, 517, 1517, 517, 5517, 34, 35, 'FEAAAA', 'XMMAAA', 'VVVVxx'),
+(1482, 8448, 0, 2, 2, 2, 82, 482, 1482, 1482, 1482, 164, 165, 'AFAAAA', 'YMMAAA', 'AAAAxx'),
+(9953, 8449, 1, 1, 3, 13, 53, 953, 1953, 4953, 9953, 106, 107, 'VSAAAA', 'ZMMAAA', 'HHHHxx'),
+(2754, 8450, 0, 2, 4, 14, 54, 754, 754, 2754, 2754, 108, 109, 'YBAAAA', 'ANMAAA', 'OOOOxx'),
+(3875, 8451, 1, 3, 5, 15, 75, 875, 1875, 3875, 3875, 150, 151, 'BTAAAA', 'BNMAAA', 'VVVVxx'),
+(9800, 8452, 0, 0, 0, 0, 0, 800, 1800, 4800, 9800, 0, 1, 'YMAAAA', 'CNMAAA', 'AAAAxx'),
+(8819, 8453, 1, 3, 9, 19, 19, 819, 819, 3819, 8819, 38, 39, 'FBAAAA', 'DNMAAA', 'HHHHxx'),
+(8267, 8454, 1, 3, 7, 7, 67, 267, 267, 3267, 8267, 134, 135, 'ZFAAAA', 'ENMAAA', 'OOOOxx'),
+(520, 8455, 0, 0, 0, 0, 20, 520, 520, 520, 520, 40, 41, 'AUAAAA', 'FNMAAA', 'VVVVxx'),
+(5770, 8456, 0, 2, 0, 10, 70, 770, 1770, 770, 5770, 140, 141, 'YNAAAA', 'GNMAAA', 'AAAAxx'),
+(2114, 8457, 0, 2, 4, 14, 14, 114, 114, 2114, 2114, 28, 29, 'IDAAAA', 'HNMAAA', 'HHHHxx'),
+(5045, 8458, 1, 1, 5, 5, 45, 45, 1045, 45, 5045, 90, 91, 'BMAAAA', 'INMAAA', 'OOOOxx'),
+(1094, 8459, 0, 2, 4, 14, 94, 94, 1094, 1094, 1094, 188, 189, 'CQAAAA', 'JNMAAA', 'VVVVxx'),
+(8786, 8460, 0, 2, 6, 6, 86, 786, 786, 3786, 8786, 172, 173, 'YZAAAA', 'KNMAAA', 'AAAAxx'),
+(353, 8461, 1, 1, 3, 13, 53, 353, 353, 353, 353, 106, 107, 'PNAAAA', 'LNMAAA', 'HHHHxx'),
+(290, 8462, 0, 2, 0, 10, 90, 290, 290, 290, 290, 180, 181, 'ELAAAA', 'MNMAAA', 'OOOOxx'),
+(3376, 8463, 0, 0, 6, 16, 76, 376, 1376, 3376, 3376, 152, 153, 'WZAAAA', 'NNMAAA', 'VVVVxx'),
+(9305, 8464, 1, 1, 5, 5, 5, 305, 1305, 4305, 9305, 10, 11, 'XTAAAA', 'ONMAAA', 'AAAAxx'),
+(186, 8465, 0, 2, 6, 6, 86, 186, 186, 186, 186, 172, 173, 'EHAAAA', 'PNMAAA', 'HHHHxx'),
+(4817, 8466, 1, 1, 7, 17, 17, 817, 817, 4817, 4817, 34, 35, 'HDAAAA', 'QNMAAA', 'OOOOxx'),
+(4638, 8467, 0, 2, 8, 18, 38, 638, 638, 4638, 4638, 76, 77, 'KWAAAA', 'RNMAAA', 'VVVVxx'),
+(3558, 8468, 0, 2, 8, 18, 58, 558, 1558, 3558, 3558, 116, 117, 'WGAAAA', 'SNMAAA', 'AAAAxx'),
+(9285, 8469, 1, 1, 5, 5, 85, 285, 1285, 4285, 9285, 170, 171, 'DTAAAA', 'TNMAAA', 'HHHHxx'),
+(848, 8470, 0, 0, 8, 8, 48, 848, 848, 848, 848, 96, 97, 'QGAAAA', 'UNMAAA', 'OOOOxx'),
+(8923, 8471, 1, 3, 3, 3, 23, 923, 923, 3923, 8923, 46, 47, 'FFAAAA', 'VNMAAA', 'VVVVxx'),
+(6826, 8472, 0, 2, 6, 6, 26, 826, 826, 1826, 6826, 52, 53, 'OCAAAA', 'WNMAAA', 'AAAAxx'),
+(5187, 8473, 1, 3, 7, 7, 87, 187, 1187, 187, 5187, 174, 175, 'NRAAAA', 'XNMAAA', 'HHHHxx'),
+(2398, 8474, 0, 2, 8, 18, 98, 398, 398, 2398, 2398, 196, 197, 'GOAAAA', 'YNMAAA', 'OOOOxx'),
+(7653, 8475, 1, 1, 3, 13, 53, 653, 1653, 2653, 7653, 106, 107, 'JIAAAA', 'ZNMAAA', 'VVVVxx'),
+(8835, 8476, 1, 3, 5, 15, 35, 835, 835, 3835, 8835, 70, 71, 'VBAAAA', 'AOMAAA', 'AAAAxx'),
+(5736, 8477, 0, 0, 6, 16, 36, 736, 1736, 736, 5736, 72, 73, 'QMAAAA', 'BOMAAA', 'HHHHxx'),
+(1238, 8478, 0, 2, 8, 18, 38, 238, 1238, 1238, 1238, 76, 77, 'QVAAAA', 'COMAAA', 'OOOOxx'),
+(6021, 8479, 1, 1, 1, 1, 21, 21, 21, 1021, 6021, 42, 43, 'PXAAAA', 'DOMAAA', 'VVVVxx'),
+(6815, 8480, 1, 3, 5, 15, 15, 815, 815, 1815, 6815, 30, 31, 'DCAAAA', 'EOMAAA', 'AAAAxx'),
+(2549, 8481, 1, 1, 9, 9, 49, 549, 549, 2549, 2549, 98, 99, 'BUAAAA', 'FOMAAA', 'HHHHxx'),
+(5657, 8482, 1, 1, 7, 17, 57, 657, 1657, 657, 5657, 114, 115, 'PJAAAA', 'GOMAAA', 'OOOOxx'),
+(6855, 8483, 1, 3, 5, 15, 55, 855, 855, 1855, 6855, 110, 111, 'RDAAAA', 'HOMAAA', 'VVVVxx'),
+(1225, 8484, 1, 1, 5, 5, 25, 225, 1225, 1225, 1225, 50, 51, 'DVAAAA', 'IOMAAA', 'AAAAxx'),
+(7452, 8485, 0, 0, 2, 12, 52, 452, 1452, 2452, 7452, 104, 105, 'QAAAAA', 'JOMAAA', 'HHHHxx'),
+(2479, 8486, 1, 3, 9, 19, 79, 479, 479, 2479, 2479, 158, 159, 'JRAAAA', 'KOMAAA', 'OOOOxx'),
+(7974, 8487, 0, 2, 4, 14, 74, 974, 1974, 2974, 7974, 148, 149, 'SUAAAA', 'LOMAAA', 'VVVVxx'),
+(1212, 8488, 0, 0, 2, 12, 12, 212, 1212, 1212, 1212, 24, 25, 'QUAAAA', 'MOMAAA', 'AAAAxx'),
+(8883, 8489, 1, 3, 3, 3, 83, 883, 883, 3883, 8883, 166, 167, 'RDAAAA', 'NOMAAA', 'HHHHxx'),
+(8150, 8490, 0, 2, 0, 10, 50, 150, 150, 3150, 8150, 100, 101, 'MBAAAA', 'OOMAAA', 'OOOOxx'),
+(3392, 8491, 0, 0, 2, 12, 92, 392, 1392, 3392, 3392, 184, 185, 'MAAAAA', 'POMAAA', 'VVVVxx'),
+(6774, 8492, 0, 2, 4, 14, 74, 774, 774, 1774, 6774, 148, 149, 'OAAAAA', 'QOMAAA', 'AAAAxx'),
+(904, 8493, 0, 0, 4, 4, 4, 904, 904, 904, 904, 8, 9, 'UIAAAA', 'ROMAAA', 'HHHHxx'),
+(5068, 8494, 0, 0, 8, 8, 68, 68, 1068, 68, 5068, 136, 137, 'YMAAAA', 'SOMAAA', 'OOOOxx'),
+(9339, 8495, 1, 3, 9, 19, 39, 339, 1339, 4339, 9339, 78, 79, 'FVAAAA', 'TOMAAA', 'VVVVxx'),
+(1062, 8496, 0, 2, 2, 2, 62, 62, 1062, 1062, 1062, 124, 125, 'WOAAAA', 'UOMAAA', 'AAAAxx'),
+(3841, 8497, 1, 1, 1, 1, 41, 841, 1841, 3841, 3841, 82, 83, 'TRAAAA', 'VOMAAA', 'HHHHxx'),
+(8924, 8498, 0, 0, 4, 4, 24, 924, 924, 3924, 8924, 48, 49, 'GFAAAA', 'WOMAAA', 'OOOOxx'),
+(9795, 8499, 1, 3, 5, 15, 95, 795, 1795, 4795, 9795, 190, 191, 'TMAAAA', 'XOMAAA', 'VVVVxx'),
+(3981, 8500, 1, 1, 1, 1, 81, 981, 1981, 3981, 3981, 162, 163, 'DXAAAA', 'YOMAAA', 'AAAAxx'),
+(4290, 8501, 0, 2, 0, 10, 90, 290, 290, 4290, 4290, 180, 181, 'AJAAAA', 'ZOMAAA', 'HHHHxx'),
+(1067, 8502, 1, 3, 7, 7, 67, 67, 1067, 1067, 1067, 134, 135, 'BPAAAA', 'APMAAA', 'OOOOxx'),
+(8679, 8503, 1, 3, 9, 19, 79, 679, 679, 3679, 8679, 158, 159, 'VVAAAA', 'BPMAAA', 'VVVVxx'),
+(2894, 8504, 0, 2, 4, 14, 94, 894, 894, 2894, 2894, 188, 189, 'IHAAAA', 'CPMAAA', 'AAAAxx'),
+(9248, 8505, 0, 0, 8, 8, 48, 248, 1248, 4248, 9248, 96, 97, 'SRAAAA', 'DPMAAA', 'HHHHxx'),
+(1072, 8506, 0, 0, 2, 12, 72, 72, 1072, 1072, 1072, 144, 145, 'GPAAAA', 'EPMAAA', 'OOOOxx'),
+(3510, 8507, 0, 2, 0, 10, 10, 510, 1510, 3510, 3510, 20, 21, 'AFAAAA', 'FPMAAA', 'VVVVxx'),
+(6871, 8508, 1, 3, 1, 11, 71, 871, 871, 1871, 6871, 142, 143, 'HEAAAA', 'GPMAAA', 'AAAAxx'),
+(8701, 8509, 1, 1, 1, 1, 1, 701, 701, 3701, 8701, 2, 3, 'RWAAAA', 'HPMAAA', 'HHHHxx'),
+(8170, 8510, 0, 2, 0, 10, 70, 170, 170, 3170, 8170, 140, 141, 'GCAAAA', 'IPMAAA', 'OOOOxx'),
+(2730, 8511, 0, 2, 0, 10, 30, 730, 730, 2730, 2730, 60, 61, 'ABAAAA', 'JPMAAA', 'VVVVxx'),
+(2668, 8512, 0, 0, 8, 8, 68, 668, 668, 2668, 2668, 136, 137, 'QYAAAA', 'KPMAAA', 'AAAAxx'),
+(8723, 8513, 1, 3, 3, 3, 23, 723, 723, 3723, 8723, 46, 47, 'NXAAAA', 'LPMAAA', 'HHHHxx'),
+(3439, 8514, 1, 3, 9, 19, 39, 439, 1439, 3439, 3439, 78, 79, 'HCAAAA', 'MPMAAA', 'OOOOxx'),
+(6219, 8515, 1, 3, 9, 19, 19, 219, 219, 1219, 6219, 38, 39, 'FFAAAA', 'NPMAAA', 'VVVVxx'),
+(4264, 8516, 0, 0, 4, 4, 64, 264, 264, 4264, 4264, 128, 129, 'AIAAAA', 'OPMAAA', 'AAAAxx'),
+(3929, 8517, 1, 1, 9, 9, 29, 929, 1929, 3929, 3929, 58, 59, 'DVAAAA', 'PPMAAA', 'HHHHxx'),
+(7, 8518, 1, 3, 7, 7, 7, 7, 7, 7, 7, 14, 15, 'HAAAAA', 'QPMAAA', 'OOOOxx'),
+(3737, 8519, 1, 1, 7, 17, 37, 737, 1737, 3737, 3737, 74, 75, 'TNAAAA', 'RPMAAA', 'VVVVxx'),
+(358, 8520, 0, 2, 8, 18, 58, 358, 358, 358, 358, 116, 117, 'UNAAAA', 'SPMAAA', 'AAAAxx'),
+(5128, 8521, 0, 0, 8, 8, 28, 128, 1128, 128, 5128, 56, 57, 'GPAAAA', 'TPMAAA', 'HHHHxx'),
+(7353, 8522, 1, 1, 3, 13, 53, 353, 1353, 2353, 7353, 106, 107, 'VWAAAA', 'UPMAAA', 'OOOOxx'),
+(8758, 8523, 0, 2, 8, 18, 58, 758, 758, 3758, 8758, 116, 117, 'WYAAAA', 'VPMAAA', 'VVVVxx'),
+(7284, 8524, 0, 0, 4, 4, 84, 284, 1284, 2284, 7284, 168, 169, 'EUAAAA', 'WPMAAA', 'AAAAxx'),
+(4037, 8525, 1, 1, 7, 17, 37, 37, 37, 4037, 4037, 74, 75, 'HZAAAA', 'XPMAAA', 'HHHHxx'),
+(435, 8526, 1, 3, 5, 15, 35, 435, 435, 435, 435, 70, 71, 'TQAAAA', 'YPMAAA', 'OOOOxx'),
+(3580, 8527, 0, 0, 0, 0, 80, 580, 1580, 3580, 3580, 160, 161, 'SHAAAA', 'ZPMAAA', 'VVVVxx'),
+(4554, 8528, 0, 2, 4, 14, 54, 554, 554, 4554, 4554, 108, 109, 'ETAAAA', 'AQMAAA', 'AAAAxx'),
+(4337, 8529, 1, 1, 7, 17, 37, 337, 337, 4337, 4337, 74, 75, 'VKAAAA', 'BQMAAA', 'HHHHxx'),
+(512, 8530, 0, 0, 2, 12, 12, 512, 512, 512, 512, 24, 25, 'STAAAA', 'CQMAAA', 'OOOOxx'),
+(2032, 8531, 0, 0, 2, 12, 32, 32, 32, 2032, 2032, 64, 65, 'EAAAAA', 'DQMAAA', 'VVVVxx'),
+(1755, 8532, 1, 3, 5, 15, 55, 755, 1755, 1755, 1755, 110, 111, 'NPAAAA', 'EQMAAA', 'AAAAxx'),
+(9923, 8533, 1, 3, 3, 3, 23, 923, 1923, 4923, 9923, 46, 47, 'RRAAAA', 'FQMAAA', 'HHHHxx'),
+(3747, 8534, 1, 3, 7, 7, 47, 747, 1747, 3747, 3747, 94, 95, 'DOAAAA', 'GQMAAA', 'OOOOxx'),
+(27, 8535, 1, 3, 7, 7, 27, 27, 27, 27, 27, 54, 55, 'BBAAAA', 'HQMAAA', 'VVVVxx'),
+(3075, 8536, 1, 3, 5, 15, 75, 75, 1075, 3075, 3075, 150, 151, 'HOAAAA', 'IQMAAA', 'AAAAxx'),
+(6259, 8537, 1, 3, 9, 19, 59, 259, 259, 1259, 6259, 118, 119, 'TGAAAA', 'JQMAAA', 'HHHHxx'),
+(2940, 8538, 0, 0, 0, 0, 40, 940, 940, 2940, 2940, 80, 81, 'CJAAAA', 'KQMAAA', 'OOOOxx'),
+(5724, 8539, 0, 0, 4, 4, 24, 724, 1724, 724, 5724, 48, 49, 'EMAAAA', 'LQMAAA', 'VVVVxx'),
+(5638, 8540, 0, 2, 8, 18, 38, 638, 1638, 638, 5638, 76, 77, 'WIAAAA', 'MQMAAA', 'AAAAxx'),
+(479, 8541, 1, 3, 9, 19, 79, 479, 479, 479, 479, 158, 159, 'LSAAAA', 'NQMAAA', 'HHHHxx'),
+(4125, 8542, 1, 1, 5, 5, 25, 125, 125, 4125, 4125, 50, 51, 'RCAAAA', 'OQMAAA', 'OOOOxx'),
+(1525, 8543, 1, 1, 5, 5, 25, 525, 1525, 1525, 1525, 50, 51, 'RGAAAA', 'PQMAAA', 'VVVVxx'),
+(7529, 8544, 1, 1, 9, 9, 29, 529, 1529, 2529, 7529, 58, 59, 'PDAAAA', 'QQMAAA', 'AAAAxx'),
+(931, 8545, 1, 3, 1, 11, 31, 931, 931, 931, 931, 62, 63, 'VJAAAA', 'RQMAAA', 'HHHHxx'),
+(5175, 8546, 1, 3, 5, 15, 75, 175, 1175, 175, 5175, 150, 151, 'BRAAAA', 'SQMAAA', 'OOOOxx'),
+(6798, 8547, 0, 2, 8, 18, 98, 798, 798, 1798, 6798, 196, 197, 'MBAAAA', 'TQMAAA', 'VVVVxx'),
+(2111, 8548, 1, 3, 1, 11, 11, 111, 111, 2111, 2111, 22, 23, 'FDAAAA', 'UQMAAA', 'AAAAxx'),
+(6145, 8549, 1, 1, 5, 5, 45, 145, 145, 1145, 6145, 90, 91, 'JCAAAA', 'VQMAAA', 'HHHHxx'),
+(4712, 8550, 0, 0, 2, 12, 12, 712, 712, 4712, 4712, 24, 25, 'GZAAAA', 'WQMAAA', 'OOOOxx'),
+(3110, 8551, 0, 2, 0, 10, 10, 110, 1110, 3110, 3110, 20, 21, 'QPAAAA', 'XQMAAA', 'VVVVxx'),
+(97, 8552, 1, 1, 7, 17, 97, 97, 97, 97, 97, 194, 195, 'TDAAAA', 'YQMAAA', 'AAAAxx'),
+(758, 8553, 0, 2, 8, 18, 58, 758, 758, 758, 758, 116, 117, 'EDAAAA', 'ZQMAAA', 'HHHHxx'),
+(1895, 8554, 1, 3, 5, 15, 95, 895, 1895, 1895, 1895, 190, 191, 'XUAAAA', 'ARMAAA', 'OOOOxx'),
+(5289, 8555, 1, 1, 9, 9, 89, 289, 1289, 289, 5289, 178, 179, 'LVAAAA', 'BRMAAA', 'VVVVxx'),
+(5026, 8556, 0, 2, 6, 6, 26, 26, 1026, 26, 5026, 52, 53, 'ILAAAA', 'CRMAAA', 'AAAAxx'),
+(4725, 8557, 1, 1, 5, 5, 25, 725, 725, 4725, 4725, 50, 51, 'TZAAAA', 'DRMAAA', 'HHHHxx'),
+(1679, 8558, 1, 3, 9, 19, 79, 679, 1679, 1679, 1679, 158, 159, 'PMAAAA', 'ERMAAA', 'OOOOxx'),
+(4433, 8559, 1, 1, 3, 13, 33, 433, 433, 4433, 4433, 66, 67, 'NOAAAA', 'FRMAAA', 'VVVVxx'),
+(5340, 8560, 0, 0, 0, 0, 40, 340, 1340, 340, 5340, 80, 81, 'KXAAAA', 'GRMAAA', 'AAAAxx'),
+(6340, 8561, 0, 0, 0, 0, 40, 340, 340, 1340, 6340, 80, 81, 'WJAAAA', 'HRMAAA', 'HHHHxx'),
+(3261, 8562, 1, 1, 1, 1, 61, 261, 1261, 3261, 3261, 122, 123, 'LVAAAA', 'IRMAAA', 'OOOOxx'),
+(8108, 8563, 0, 0, 8, 8, 8, 108, 108, 3108, 8108, 16, 17, 'WZAAAA', 'JRMAAA', 'VVVVxx'),
+(8785, 8564, 1, 1, 5, 5, 85, 785, 785, 3785, 8785, 170, 171, 'XZAAAA', 'KRMAAA', 'AAAAxx'),
+(7391, 8565, 1, 3, 1, 11, 91, 391, 1391, 2391, 7391, 182, 183, 'HYAAAA', 'LRMAAA', 'HHHHxx'),
+(1496, 8566, 0, 0, 6, 16, 96, 496, 1496, 1496, 1496, 192, 193, 'OFAAAA', 'MRMAAA', 'OOOOxx'),
+(1484, 8567, 0, 0, 4, 4, 84, 484, 1484, 1484, 1484, 168, 169, 'CFAAAA', 'NRMAAA', 'VVVVxx'),
+(5884, 8568, 0, 0, 4, 4, 84, 884, 1884, 884, 5884, 168, 169, 'ISAAAA', 'ORMAAA', 'AAAAxx'),
+(342, 8569, 0, 2, 2, 2, 42, 342, 342, 342, 342, 84, 85, 'ENAAAA', 'PRMAAA', 'HHHHxx'),
+(7659, 8570, 1, 3, 9, 19, 59, 659, 1659, 2659, 7659, 118, 119, 'PIAAAA', 'QRMAAA', 'OOOOxx'),
+(6635, 8571, 1, 3, 5, 15, 35, 635, 635, 1635, 6635, 70, 71, 'FVAAAA', 'RRMAAA', 'VVVVxx'),
+(8507, 8572, 1, 3, 7, 7, 7, 507, 507, 3507, 8507, 14, 15, 'FPAAAA', 'SRMAAA', 'AAAAxx'),
+(2583, 8573, 1, 3, 3, 3, 83, 583, 583, 2583, 2583, 166, 167, 'JVAAAA', 'TRMAAA', 'HHHHxx'),
+(6533, 8574, 1, 1, 3, 13, 33, 533, 533, 1533, 6533, 66, 67, 'HRAAAA', 'URMAAA', 'OOOOxx'),
+(5879, 8575, 1, 3, 9, 19, 79, 879, 1879, 879, 5879, 158, 159, 'DSAAAA', 'VRMAAA', 'VVVVxx'),
+(5511, 8576, 1, 3, 1, 11, 11, 511, 1511, 511, 5511, 22, 23, 'ZDAAAA', 'WRMAAA', 'AAAAxx'),
+(3682, 8577, 0, 2, 2, 2, 82, 682, 1682, 3682, 3682, 164, 165, 'QLAAAA', 'XRMAAA', 'HHHHxx'),
+(7182, 8578, 0, 2, 2, 2, 82, 182, 1182, 2182, 7182, 164, 165, 'GQAAAA', 'YRMAAA', 'OOOOxx'),
+(1409, 8579, 1, 1, 9, 9, 9, 409, 1409, 1409, 1409, 18, 19, 'FCAAAA', 'ZRMAAA', 'VVVVxx'),
+(3363, 8580, 1, 3, 3, 3, 63, 363, 1363, 3363, 3363, 126, 127, 'JZAAAA', 'ASMAAA', 'AAAAxx'),
+(729, 8581, 1, 1, 9, 9, 29, 729, 729, 729, 729, 58, 59, 'BCAAAA', 'BSMAAA', 'HHHHxx'),
+(5857, 8582, 1, 1, 7, 17, 57, 857, 1857, 857, 5857, 114, 115, 'HRAAAA', 'CSMAAA', 'OOOOxx'),
+(235, 8583, 1, 3, 5, 15, 35, 235, 235, 235, 235, 70, 71, 'BJAAAA', 'DSMAAA', 'VVVVxx'),
+(193, 8584, 1, 1, 3, 13, 93, 193, 193, 193, 193, 186, 187, 'LHAAAA', 'ESMAAA', 'AAAAxx'),
+(5586, 8585, 0, 2, 6, 6, 86, 586, 1586, 586, 5586, 172, 173, 'WGAAAA', 'FSMAAA', 'HHHHxx'),
+(6203, 8586, 1, 3, 3, 3, 3, 203, 203, 1203, 6203, 6, 7, 'PEAAAA', 'GSMAAA', 'OOOOxx'),
+(6795, 8587, 1, 3, 5, 15, 95, 795, 795, 1795, 6795, 190, 191, 'JBAAAA', 'HSMAAA', 'VVVVxx'),
+(3211, 8588, 1, 3, 1, 11, 11, 211, 1211, 3211, 3211, 22, 23, 'NTAAAA', 'ISMAAA', 'AAAAxx'),
+(9763, 8589, 1, 3, 3, 3, 63, 763, 1763, 4763, 9763, 126, 127, 'NLAAAA', 'JSMAAA', 'HHHHxx'),
+(9043, 8590, 1, 3, 3, 3, 43, 43, 1043, 4043, 9043, 86, 87, 'VJAAAA', 'KSMAAA', 'OOOOxx'),
+(2854, 8591, 0, 2, 4, 14, 54, 854, 854, 2854, 2854, 108, 109, 'UFAAAA', 'LSMAAA', 'VVVVxx'),
+(565, 8592, 1, 1, 5, 5, 65, 565, 565, 565, 565, 130, 131, 'TVAAAA', 'MSMAAA', 'AAAAxx'),
+(9284, 8593, 0, 0, 4, 4, 84, 284, 1284, 4284, 9284, 168, 169, 'CTAAAA', 'NSMAAA', 'HHHHxx'),
+(7886, 8594, 0, 2, 6, 6, 86, 886, 1886, 2886, 7886, 172, 173, 'IRAAAA', 'OSMAAA', 'OOOOxx'),
+(122, 8595, 0, 2, 2, 2, 22, 122, 122, 122, 122, 44, 45, 'SEAAAA', 'PSMAAA', 'VVVVxx'),
+(4934, 8596, 0, 2, 4, 14, 34, 934, 934, 4934, 4934, 68, 69, 'UHAAAA', 'QSMAAA', 'AAAAxx'),
+(1766, 8597, 0, 2, 6, 6, 66, 766, 1766, 1766, 1766, 132, 133, 'YPAAAA', 'RSMAAA', 'HHHHxx'),
+(2554, 8598, 0, 2, 4, 14, 54, 554, 554, 2554, 2554, 108, 109, 'GUAAAA', 'SSMAAA', 'OOOOxx'),
+(488, 8599, 0, 0, 8, 8, 88, 488, 488, 488, 488, 176, 177, 'USAAAA', 'TSMAAA', 'VVVVxx'),
+(825, 8600, 1, 1, 5, 5, 25, 825, 825, 825, 825, 50, 51, 'TFAAAA', 'USMAAA', 'AAAAxx'),
+(678, 8601, 0, 2, 8, 18, 78, 678, 678, 678, 678, 156, 157, 'CAAAAA', 'VSMAAA', 'HHHHxx'),
+(4543, 8602, 1, 3, 3, 3, 43, 543, 543, 4543, 4543, 86, 87, 'TSAAAA', 'WSMAAA', 'OOOOxx'),
+(1699, 8603, 1, 3, 9, 19, 99, 699, 1699, 1699, 1699, 198, 199, 'JNAAAA', 'XSMAAA', 'VVVVxx'),
+(3771, 8604, 1, 3, 1, 11, 71, 771, 1771, 3771, 3771, 142, 143, 'BPAAAA', 'YSMAAA', 'AAAAxx'),
+(1234, 8605, 0, 2, 4, 14, 34, 234, 1234, 1234, 1234, 68, 69, 'MVAAAA', 'ZSMAAA', 'HHHHxx'),
+(4152, 8606, 0, 0, 2, 12, 52, 152, 152, 4152, 4152, 104, 105, 'SDAAAA', 'ATMAAA', 'OOOOxx'),
+(1632, 8607, 0, 0, 2, 12, 32, 632, 1632, 1632, 1632, 64, 65, 'UKAAAA', 'BTMAAA', 'VVVVxx'),
+(4988, 8608, 0, 0, 8, 8, 88, 988, 988, 4988, 4988, 176, 177, 'WJAAAA', 'CTMAAA', 'AAAAxx'),
+(1980, 8609, 0, 0, 0, 0, 80, 980, 1980, 1980, 1980, 160, 161, 'EYAAAA', 'DTMAAA', 'HHHHxx'),
+(7479, 8610, 1, 3, 9, 19, 79, 479, 1479, 2479, 7479, 158, 159, 'RBAAAA', 'ETMAAA', 'OOOOxx'),
+(2586, 8611, 0, 2, 6, 6, 86, 586, 586, 2586, 2586, 172, 173, 'MVAAAA', 'FTMAAA', 'VVVVxx'),
+(5433, 8612, 1, 1, 3, 13, 33, 433, 1433, 433, 5433, 66, 67, 'ZAAAAA', 'GTMAAA', 'AAAAxx'),
+(2261, 8613, 1, 1, 1, 1, 61, 261, 261, 2261, 2261, 122, 123, 'ZIAAAA', 'HTMAAA', 'HHHHxx'),
+(1180, 8614, 0, 0, 0, 0, 80, 180, 1180, 1180, 1180, 160, 161, 'KTAAAA', 'ITMAAA', 'OOOOxx'),
+(3938, 8615, 0, 2, 8, 18, 38, 938, 1938, 3938, 3938, 76, 77, 'MVAAAA', 'JTMAAA', 'VVVVxx'),
+(6714, 8616, 0, 2, 4, 14, 14, 714, 714, 1714, 6714, 28, 29, 'GYAAAA', 'KTMAAA', 'AAAAxx'),
+(2890, 8617, 0, 2, 0, 10, 90, 890, 890, 2890, 2890, 180, 181, 'EHAAAA', 'LTMAAA', 'HHHHxx'),
+(7379, 8618, 1, 3, 9, 19, 79, 379, 1379, 2379, 7379, 158, 159, 'VXAAAA', 'MTMAAA', 'OOOOxx'),
+(5896, 8619, 0, 0, 6, 16, 96, 896, 1896, 896, 5896, 192, 193, 'USAAAA', 'NTMAAA', 'VVVVxx'),
+(5949, 8620, 1, 1, 9, 9, 49, 949, 1949, 949, 5949, 98, 99, 'VUAAAA', 'OTMAAA', 'AAAAxx'),
+(3194, 8621, 0, 2, 4, 14, 94, 194, 1194, 3194, 3194, 188, 189, 'WSAAAA', 'PTMAAA', 'HHHHxx'),
+(9325, 8622, 1, 1, 5, 5, 25, 325, 1325, 4325, 9325, 50, 51, 'RUAAAA', 'QTMAAA', 'OOOOxx'),
+(9531, 8623, 1, 3, 1, 11, 31, 531, 1531, 4531, 9531, 62, 63, 'PCAAAA', 'RTMAAA', 'VVVVxx'),
+(711, 8624, 1, 3, 1, 11, 11, 711, 711, 711, 711, 22, 23, 'JBAAAA', 'STMAAA', 'AAAAxx'),
+(2450, 8625, 0, 2, 0, 10, 50, 450, 450, 2450, 2450, 100, 101, 'GQAAAA', 'TTMAAA', 'HHHHxx'),
+(1929, 8626, 1, 1, 9, 9, 29, 929, 1929, 1929, 1929, 58, 59, 'FWAAAA', 'UTMAAA', 'OOOOxx'),
+(6165, 8627, 1, 1, 5, 5, 65, 165, 165, 1165, 6165, 130, 131, 'DDAAAA', 'VTMAAA', 'VVVVxx'),
+(4050, 8628, 0, 2, 0, 10, 50, 50, 50, 4050, 4050, 100, 101, 'UZAAAA', 'WTMAAA', 'AAAAxx'),
+(9011, 8629, 1, 3, 1, 11, 11, 11, 1011, 4011, 9011, 22, 23, 'PIAAAA', 'XTMAAA', 'HHHHxx'),
+(7916, 8630, 0, 0, 6, 16, 16, 916, 1916, 2916, 7916, 32, 33, 'MSAAAA', 'YTMAAA', 'OOOOxx'),
+(9136, 8631, 0, 0, 6, 16, 36, 136, 1136, 4136, 9136, 72, 73, 'KNAAAA', 'ZTMAAA', 'VVVVxx'),
+(8782, 8632, 0, 2, 2, 2, 82, 782, 782, 3782, 8782, 164, 165, 'UZAAAA', 'AUMAAA', 'AAAAxx'),
+(8491, 8633, 1, 3, 1, 11, 91, 491, 491, 3491, 8491, 182, 183, 'POAAAA', 'BUMAAA', 'HHHHxx'),
+(5114, 8634, 0, 2, 4, 14, 14, 114, 1114, 114, 5114, 28, 29, 'SOAAAA', 'CUMAAA', 'OOOOxx'),
+(5815, 8635, 1, 3, 5, 15, 15, 815, 1815, 815, 5815, 30, 31, 'RPAAAA', 'DUMAAA', 'VVVVxx'),
+(5628, 8636, 0, 0, 8, 8, 28, 628, 1628, 628, 5628, 56, 57, 'MIAAAA', 'EUMAAA', 'AAAAxx'),
+(810, 8637, 0, 2, 0, 10, 10, 810, 810, 810, 810, 20, 21, 'EFAAAA', 'FUMAAA', 'HHHHxx'),
+(6178, 8638, 0, 2, 8, 18, 78, 178, 178, 1178, 6178, 156, 157, 'QDAAAA', 'GUMAAA', 'OOOOxx'),
+(2619, 8639, 1, 3, 9, 19, 19, 619, 619, 2619, 2619, 38, 39, 'TWAAAA', 'HUMAAA', 'VVVVxx'),
+(3340, 8640, 0, 0, 0, 0, 40, 340, 1340, 3340, 3340, 80, 81, 'MYAAAA', 'IUMAAA', 'AAAAxx'),
+(2491, 8641, 1, 3, 1, 11, 91, 491, 491, 2491, 2491, 182, 183, 'VRAAAA', 'JUMAAA', 'HHHHxx'),
+(3574, 8642, 0, 2, 4, 14, 74, 574, 1574, 3574, 3574, 148, 149, 'MHAAAA', 'KUMAAA', 'OOOOxx'),
+(6754, 8643, 0, 2, 4, 14, 54, 754, 754, 1754, 6754, 108, 109, 'UZAAAA', 'LUMAAA', 'VVVVxx'),
+(1566, 8644, 0, 2, 6, 6, 66, 566, 1566, 1566, 1566, 132, 133, 'GIAAAA', 'MUMAAA', 'AAAAxx'),
+(9174, 8645, 0, 2, 4, 14, 74, 174, 1174, 4174, 9174, 148, 149, 'WOAAAA', 'NUMAAA', 'HHHHxx'),
+(1520, 8646, 0, 0, 0, 0, 20, 520, 1520, 1520, 1520, 40, 41, 'MGAAAA', 'OUMAAA', 'OOOOxx'),
+(2691, 8647, 1, 3, 1, 11, 91, 691, 691, 2691, 2691, 182, 183, 'NZAAAA', 'PUMAAA', 'VVVVxx'),
+(6961, 8648, 1, 1, 1, 1, 61, 961, 961, 1961, 6961, 122, 123, 'THAAAA', 'QUMAAA', 'AAAAxx'),
+(5722, 8649, 0, 2, 2, 2, 22, 722, 1722, 722, 5722, 44, 45, 'CMAAAA', 'RUMAAA', 'HHHHxx'),
+(9707, 8650, 1, 3, 7, 7, 7, 707, 1707, 4707, 9707, 14, 15, 'JJAAAA', 'SUMAAA', 'OOOOxx'),
+(2891, 8651, 1, 3, 1, 11, 91, 891, 891, 2891, 2891, 182, 183, 'FHAAAA', 'TUMAAA', 'VVVVxx'),
+(341, 8652, 1, 1, 1, 1, 41, 341, 341, 341, 341, 82, 83, 'DNAAAA', 'UUMAAA', 'AAAAxx'),
+(4690, 8653, 0, 2, 0, 10, 90, 690, 690, 4690, 4690, 180, 181, 'KYAAAA', 'VUMAAA', 'HHHHxx'),
+(7841, 8654, 1, 1, 1, 1, 41, 841, 1841, 2841, 7841, 82, 83, 'PPAAAA', 'WUMAAA', 'OOOOxx'),
+(6615, 8655, 1, 3, 5, 15, 15, 615, 615, 1615, 6615, 30, 31, 'LUAAAA', 'XUMAAA', 'VVVVxx'),
+(9169, 8656, 1, 1, 9, 9, 69, 169, 1169, 4169, 9169, 138, 139, 'ROAAAA', 'YUMAAA', 'AAAAxx'),
+(6689, 8657, 1, 1, 9, 9, 89, 689, 689, 1689, 6689, 178, 179, 'HXAAAA', 'ZUMAAA', 'HHHHxx'),
+(8721, 8658, 1, 1, 1, 1, 21, 721, 721, 3721, 8721, 42, 43, 'LXAAAA', 'AVMAAA', 'OOOOxx'),
+(7508, 8659, 0, 0, 8, 8, 8, 508, 1508, 2508, 7508, 16, 17, 'UCAAAA', 'BVMAAA', 'VVVVxx'),
+(8631, 8660, 1, 3, 1, 11, 31, 631, 631, 3631, 8631, 62, 63, 'ZTAAAA', 'CVMAAA', 'AAAAxx'),
+(480, 8661, 0, 0, 0, 0, 80, 480, 480, 480, 480, 160, 161, 'MSAAAA', 'DVMAAA', 'HHHHxx'),
+(7094, 8662, 0, 2, 4, 14, 94, 94, 1094, 2094, 7094, 188, 189, 'WMAAAA', 'EVMAAA', 'OOOOxx'),
+(319, 8663, 1, 3, 9, 19, 19, 319, 319, 319, 319, 38, 39, 'HMAAAA', 'FVMAAA', 'VVVVxx'),
+(9421, 8664, 1, 1, 1, 1, 21, 421, 1421, 4421, 9421, 42, 43, 'JYAAAA', 'GVMAAA', 'AAAAxx'),
+(4352, 8665, 0, 0, 2, 12, 52, 352, 352, 4352, 4352, 104, 105, 'KLAAAA', 'HVMAAA', 'HHHHxx'),
+(5019, 8666, 1, 3, 9, 19, 19, 19, 1019, 19, 5019, 38, 39, 'BLAAAA', 'IVMAAA', 'OOOOxx'),
+(3956, 8667, 0, 0, 6, 16, 56, 956, 1956, 3956, 3956, 112, 113, 'EWAAAA', 'JVMAAA', 'VVVVxx'),
+(114, 8668, 0, 2, 4, 14, 14, 114, 114, 114, 114, 28, 29, 'KEAAAA', 'KVMAAA', 'AAAAxx'),
+(1196, 8669, 0, 0, 6, 16, 96, 196, 1196, 1196, 1196, 192, 193, 'AUAAAA', 'LVMAAA', 'HHHHxx'),
+(1407, 8670, 1, 3, 7, 7, 7, 407, 1407, 1407, 1407, 14, 15, 'DCAAAA', 'MVMAAA', 'OOOOxx'),
+(7432, 8671, 0, 0, 2, 12, 32, 432, 1432, 2432, 7432, 64, 65, 'WZAAAA', 'NVMAAA', 'VVVVxx'),
+(3141, 8672, 1, 1, 1, 1, 41, 141, 1141, 3141, 3141, 82, 83, 'VQAAAA', 'OVMAAA', 'AAAAxx'),
+(2073, 8673, 1, 1, 3, 13, 73, 73, 73, 2073, 2073, 146, 147, 'TBAAAA', 'PVMAAA', 'HHHHxx'),
+(3400, 8674, 0, 0, 0, 0, 0, 400, 1400, 3400, 3400, 0, 1, 'UAAAAA', 'QVMAAA', 'OOOOxx'),
+(505, 8675, 1, 1, 5, 5, 5, 505, 505, 505, 505, 10, 11, 'LTAAAA', 'RVMAAA', 'VVVVxx'),
+(1263, 8676, 1, 3, 3, 3, 63, 263, 1263, 1263, 1263, 126, 127, 'PWAAAA', 'SVMAAA', 'AAAAxx'),
+(190, 8677, 0, 2, 0, 10, 90, 190, 190, 190, 190, 180, 181, 'IHAAAA', 'TVMAAA', 'HHHHxx'),
+(6686, 8678, 0, 2, 6, 6, 86, 686, 686, 1686, 6686, 172, 173, 'EXAAAA', 'UVMAAA', 'OOOOxx'),
+(9821, 8679, 1, 1, 1, 1, 21, 821, 1821, 4821, 9821, 42, 43, 'TNAAAA', 'VVMAAA', 'VVVVxx'),
+(1119, 8680, 1, 3, 9, 19, 19, 119, 1119, 1119, 1119, 38, 39, 'BRAAAA', 'WVMAAA', 'AAAAxx'),
+(2955, 8681, 1, 3, 5, 15, 55, 955, 955, 2955, 2955, 110, 111, 'RJAAAA', 'XVMAAA', 'HHHHxx'),
+(224, 8682, 0, 0, 4, 4, 24, 224, 224, 224, 224, 48, 49, 'QIAAAA', 'YVMAAA', 'OOOOxx'),
+(7562, 8683, 0, 2, 2, 2, 62, 562, 1562, 2562, 7562, 124, 125, 'WEAAAA', 'ZVMAAA', 'VVVVxx'),
+(8845, 8684, 1, 1, 5, 5, 45, 845, 845, 3845, 8845, 90, 91, 'FCAAAA', 'AWMAAA', 'AAAAxx'),
+(5405, 8685, 1, 1, 5, 5, 5, 405, 1405, 405, 5405, 10, 11, 'XZAAAA', 'BWMAAA', 'HHHHxx'),
+(9192, 8686, 0, 0, 2, 12, 92, 192, 1192, 4192, 9192, 184, 185, 'OPAAAA', 'CWMAAA', 'OOOOxx'),
+(4927, 8687, 1, 3, 7, 7, 27, 927, 927, 4927, 4927, 54, 55, 'NHAAAA', 'DWMAAA', 'VVVVxx'),
+(997, 8688, 1, 1, 7, 17, 97, 997, 997, 997, 997, 194, 195, 'JMAAAA', 'EWMAAA', 'AAAAxx'),
+(989, 8689, 1, 1, 9, 9, 89, 989, 989, 989, 989, 178, 179, 'BMAAAA', 'FWMAAA', 'HHHHxx'),
+(7258, 8690, 0, 2, 8, 18, 58, 258, 1258, 2258, 7258, 116, 117, 'ETAAAA', 'GWMAAA', 'OOOOxx'),
+(6899, 8691, 1, 3, 9, 19, 99, 899, 899, 1899, 6899, 198, 199, 'JFAAAA', 'HWMAAA', 'VVVVxx'),
+(1770, 8692, 0, 2, 0, 10, 70, 770, 1770, 1770, 1770, 140, 141, 'CQAAAA', 'IWMAAA', 'AAAAxx'),
+(4423, 8693, 1, 3, 3, 3, 23, 423, 423, 4423, 4423, 46, 47, 'DOAAAA', 'JWMAAA', 'HHHHxx'),
+(5671, 8694, 1, 3, 1, 11, 71, 671, 1671, 671, 5671, 142, 143, 'DKAAAA', 'KWMAAA', 'OOOOxx'),
+(8393, 8695, 1, 1, 3, 13, 93, 393, 393, 3393, 8393, 186, 187, 'VKAAAA', 'LWMAAA', 'VVVVxx'),
+(4355, 8696, 1, 3, 5, 15, 55, 355, 355, 4355, 4355, 110, 111, 'NLAAAA', 'MWMAAA', 'AAAAxx'),
+(3919, 8697, 1, 3, 9, 19, 19, 919, 1919, 3919, 3919, 38, 39, 'TUAAAA', 'NWMAAA', 'HHHHxx'),
+(338, 8698, 0, 2, 8, 18, 38, 338, 338, 338, 338, 76, 77, 'ANAAAA', 'OWMAAA', 'OOOOxx'),
+(5790, 8699, 0, 2, 0, 10, 90, 790, 1790, 790, 5790, 180, 181, 'SOAAAA', 'PWMAAA', 'VVVVxx'),
+(1452, 8700, 0, 0, 2, 12, 52, 452, 1452, 1452, 1452, 104, 105, 'WDAAAA', 'QWMAAA', 'AAAAxx'),
+(939, 8701, 1, 3, 9, 19, 39, 939, 939, 939, 939, 78, 79, 'DKAAAA', 'RWMAAA', 'HHHHxx'),
+(8913, 8702, 1, 1, 3, 13, 13, 913, 913, 3913, 8913, 26, 27, 'VEAAAA', 'SWMAAA', 'OOOOxx'),
+(7157, 8703, 1, 1, 7, 17, 57, 157, 1157, 2157, 7157, 114, 115, 'HPAAAA', 'TWMAAA', 'VVVVxx'),
+(7240, 8704, 0, 0, 0, 0, 40, 240, 1240, 2240, 7240, 80, 81, 'MSAAAA', 'UWMAAA', 'AAAAxx'),
+(3492, 8705, 0, 0, 2, 12, 92, 492, 1492, 3492, 3492, 184, 185, 'IEAAAA', 'VWMAAA', 'HHHHxx'),
+(3464, 8706, 0, 0, 4, 4, 64, 464, 1464, 3464, 3464, 128, 129, 'GDAAAA', 'WWMAAA', 'OOOOxx'),
+(388, 8707, 0, 0, 8, 8, 88, 388, 388, 388, 388, 176, 177, 'YOAAAA', 'XWMAAA', 'VVVVxx'),
+(4135, 8708, 1, 3, 5, 15, 35, 135, 135, 4135, 4135, 70, 71, 'BDAAAA', 'YWMAAA', 'AAAAxx'),
+(1194, 8709, 0, 2, 4, 14, 94, 194, 1194, 1194, 1194, 188, 189, 'YTAAAA', 'ZWMAAA', 'HHHHxx'),
+(5476, 8710, 0, 0, 6, 16, 76, 476, 1476, 476, 5476, 152, 153, 'QCAAAA', 'AXMAAA', 'OOOOxx'),
+(9844, 8711, 0, 0, 4, 4, 44, 844, 1844, 4844, 9844, 88, 89, 'QOAAAA', 'BXMAAA', 'VVVVxx'),
+(9364, 8712, 0, 0, 4, 4, 64, 364, 1364, 4364, 9364, 128, 129, 'EWAAAA', 'CXMAAA', 'AAAAxx'),
+(5238, 8713, 0, 2, 8, 18, 38, 238, 1238, 238, 5238, 76, 77, 'MTAAAA', 'DXMAAA', 'HHHHxx'),
+(3712, 8714, 0, 0, 2, 12, 12, 712, 1712, 3712, 3712, 24, 25, 'UMAAAA', 'EXMAAA', 'OOOOxx'),
+(6189, 8715, 1, 1, 9, 9, 89, 189, 189, 1189, 6189, 178, 179, 'BEAAAA', 'FXMAAA', 'VVVVxx'),
+(5257, 8716, 1, 1, 7, 17, 57, 257, 1257, 257, 5257, 114, 115, 'FUAAAA', 'GXMAAA', 'AAAAxx'),
+(81, 8717, 1, 1, 1, 1, 81, 81, 81, 81, 81, 162, 163, 'DDAAAA', 'HXMAAA', 'HHHHxx'),
+(3289, 8718, 1, 1, 9, 9, 89, 289, 1289, 3289, 3289, 178, 179, 'NWAAAA', 'IXMAAA', 'OOOOxx'),
+(1177, 8719, 1, 1, 7, 17, 77, 177, 1177, 1177, 1177, 154, 155, 'HTAAAA', 'JXMAAA', 'VVVVxx'),
+(5038, 8720, 0, 2, 8, 18, 38, 38, 1038, 38, 5038, 76, 77, 'ULAAAA', 'KXMAAA', 'AAAAxx'),
+(325, 8721, 1, 1, 5, 5, 25, 325, 325, 325, 325, 50, 51, 'NMAAAA', 'LXMAAA', 'HHHHxx'),
+(7221, 8722, 1, 1, 1, 1, 21, 221, 1221, 2221, 7221, 42, 43, 'TRAAAA', 'MXMAAA', 'OOOOxx'),
+(7123, 8723, 1, 3, 3, 3, 23, 123, 1123, 2123, 7123, 46, 47, 'ZNAAAA', 'NXMAAA', 'VVVVxx'),
+(6364, 8724, 0, 0, 4, 4, 64, 364, 364, 1364, 6364, 128, 129, 'UKAAAA', 'OXMAAA', 'AAAAxx'),
+(4468, 8725, 0, 0, 8, 8, 68, 468, 468, 4468, 4468, 136, 137, 'WPAAAA', 'PXMAAA', 'HHHHxx'),
+(9185, 8726, 1, 1, 5, 5, 85, 185, 1185, 4185, 9185, 170, 171, 'HPAAAA', 'QXMAAA', 'OOOOxx'),
+(4158, 8727, 0, 2, 8, 18, 58, 158, 158, 4158, 4158, 116, 117, 'YDAAAA', 'RXMAAA', 'VVVVxx'),
+(9439, 8728, 1, 3, 9, 19, 39, 439, 1439, 4439, 9439, 78, 79, 'BZAAAA', 'SXMAAA', 'AAAAxx'),
+(7759, 8729, 1, 3, 9, 19, 59, 759, 1759, 2759, 7759, 118, 119, 'LMAAAA', 'TXMAAA', 'HHHHxx'),
+(3325, 8730, 1, 1, 5, 5, 25, 325, 1325, 3325, 3325, 50, 51, 'XXAAAA', 'UXMAAA', 'OOOOxx'),
+(7991, 8731, 1, 3, 1, 11, 91, 991, 1991, 2991, 7991, 182, 183, 'JVAAAA', 'VXMAAA', 'VVVVxx'),
+(1650, 8732, 0, 2, 0, 10, 50, 650, 1650, 1650, 1650, 100, 101, 'MLAAAA', 'WXMAAA', 'AAAAxx'),
+(8395, 8733, 1, 3, 5, 15, 95, 395, 395, 3395, 8395, 190, 191, 'XKAAAA', 'XXMAAA', 'HHHHxx'),
+(286, 8734, 0, 2, 6, 6, 86, 286, 286, 286, 286, 172, 173, 'ALAAAA', 'YXMAAA', 'OOOOxx'),
+(1507, 8735, 1, 3, 7, 7, 7, 507, 1507, 1507, 1507, 14, 15, 'ZFAAAA', 'ZXMAAA', 'VVVVxx'),
+(4122, 8736, 0, 2, 2, 2, 22, 122, 122, 4122, 4122, 44, 45, 'OCAAAA', 'AYMAAA', 'AAAAxx'),
+(2625, 8737, 1, 1, 5, 5, 25, 625, 625, 2625, 2625, 50, 51, 'ZWAAAA', 'BYMAAA', 'HHHHxx'),
+(1140, 8738, 0, 0, 0, 0, 40, 140, 1140, 1140, 1140, 80, 81, 'WRAAAA', 'CYMAAA', 'OOOOxx'),
+(5262, 8739, 0, 2, 2, 2, 62, 262, 1262, 262, 5262, 124, 125, 'KUAAAA', 'DYMAAA', 'VVVVxx'),
+(4919, 8740, 1, 3, 9, 19, 19, 919, 919, 4919, 4919, 38, 39, 'FHAAAA', 'EYMAAA', 'AAAAxx'),
+(7266, 8741, 0, 2, 6, 6, 66, 266, 1266, 2266, 7266, 132, 133, 'MTAAAA', 'FYMAAA', 'HHHHxx'),
+(630, 8742, 0, 2, 0, 10, 30, 630, 630, 630, 630, 60, 61, 'GYAAAA', 'GYMAAA', 'OOOOxx'),
+(2129, 8743, 1, 1, 9, 9, 29, 129, 129, 2129, 2129, 58, 59, 'XDAAAA', 'HYMAAA', 'VVVVxx'),
+(9552, 8744, 0, 0, 2, 12, 52, 552, 1552, 4552, 9552, 104, 105, 'KDAAAA', 'IYMAAA', 'AAAAxx'),
+(3018, 8745, 0, 2, 8, 18, 18, 18, 1018, 3018, 3018, 36, 37, 'CMAAAA', 'JYMAAA', 'HHHHxx'),
+(7145, 8746, 1, 1, 5, 5, 45, 145, 1145, 2145, 7145, 90, 91, 'VOAAAA', 'KYMAAA', 'OOOOxx'),
+(1633, 8747, 1, 1, 3, 13, 33, 633, 1633, 1633, 1633, 66, 67, 'VKAAAA', 'LYMAAA', 'VVVVxx'),
+(7957, 8748, 1, 1, 7, 17, 57, 957, 1957, 2957, 7957, 114, 115, 'BUAAAA', 'MYMAAA', 'AAAAxx'),
+(774, 8749, 0, 2, 4, 14, 74, 774, 774, 774, 774, 148, 149, 'UDAAAA', 'NYMAAA', 'HHHHxx'),
+(9371, 8750, 1, 3, 1, 11, 71, 371, 1371, 4371, 9371, 142, 143, 'LWAAAA', 'OYMAAA', 'OOOOxx'),
+(6007, 8751, 1, 3, 7, 7, 7, 7, 7, 1007, 6007, 14, 15, 'BXAAAA', 'PYMAAA', 'VVVVxx'),
+(5277, 8752, 1, 1, 7, 17, 77, 277, 1277, 277, 5277, 154, 155, 'ZUAAAA', 'QYMAAA', 'AAAAxx'),
+(9426, 8753, 0, 2, 6, 6, 26, 426, 1426, 4426, 9426, 52, 53, 'OYAAAA', 'RYMAAA', 'HHHHxx'),
+(9190, 8754, 0, 2, 0, 10, 90, 190, 1190, 4190, 9190, 180, 181, 'MPAAAA', 'SYMAAA', 'OOOOxx'),
+(8996, 8755, 0, 0, 6, 16, 96, 996, 996, 3996, 8996, 192, 193, 'AIAAAA', 'TYMAAA', 'VVVVxx'),
+(3409, 8756, 1, 1, 9, 9, 9, 409, 1409, 3409, 3409, 18, 19, 'DBAAAA', 'UYMAAA', 'AAAAxx'),
+(7212, 8757, 0, 0, 2, 12, 12, 212, 1212, 2212, 7212, 24, 25, 'KRAAAA', 'VYMAAA', 'HHHHxx'),
+(416, 8758, 0, 0, 6, 16, 16, 416, 416, 416, 416, 32, 33, 'AQAAAA', 'WYMAAA', 'OOOOxx'),
+(7211, 8759, 1, 3, 1, 11, 11, 211, 1211, 2211, 7211, 22, 23, 'JRAAAA', 'XYMAAA', 'VVVVxx'),
+(7454, 8760, 0, 2, 4, 14, 54, 454, 1454, 2454, 7454, 108, 109, 'SAAAAA', 'YYMAAA', 'AAAAxx'),
+(8417, 8761, 1, 1, 7, 17, 17, 417, 417, 3417, 8417, 34, 35, 'TLAAAA', 'ZYMAAA', 'HHHHxx'),
+(5562, 8762, 0, 2, 2, 2, 62, 562, 1562, 562, 5562, 124, 125, 'YFAAAA', 'AZMAAA', 'OOOOxx'),
+(4996, 8763, 0, 0, 6, 16, 96, 996, 996, 4996, 4996, 192, 193, 'EKAAAA', 'BZMAAA', 'VVVVxx'),
+(5718, 8764, 0, 2, 8, 18, 18, 718, 1718, 718, 5718, 36, 37, 'YLAAAA', 'CZMAAA', 'AAAAxx'),
+(7838, 8765, 0, 2, 8, 18, 38, 838, 1838, 2838, 7838, 76, 77, 'MPAAAA', 'DZMAAA', 'HHHHxx'),
+(7715, 8766, 1, 3, 5, 15, 15, 715, 1715, 2715, 7715, 30, 31, 'TKAAAA', 'EZMAAA', 'OOOOxx'),
+(2780, 8767, 0, 0, 0, 0, 80, 780, 780, 2780, 2780, 160, 161, 'YCAAAA', 'FZMAAA', 'VVVVxx'),
+(1013, 8768, 1, 1, 3, 13, 13, 13, 1013, 1013, 1013, 26, 27, 'ZMAAAA', 'GZMAAA', 'AAAAxx'),
+(8465, 8769, 1, 1, 5, 5, 65, 465, 465, 3465, 8465, 130, 131, 'PNAAAA', 'HZMAAA', 'HHHHxx'),
+(7976, 8770, 0, 0, 6, 16, 76, 976, 1976, 2976, 7976, 152, 153, 'UUAAAA', 'IZMAAA', 'OOOOxx'),
+(7150, 8771, 0, 2, 0, 10, 50, 150, 1150, 2150, 7150, 100, 101, 'APAAAA', 'JZMAAA', 'VVVVxx'),
+(6471, 8772, 1, 3, 1, 11, 71, 471, 471, 1471, 6471, 142, 143, 'XOAAAA', 'KZMAAA', 'AAAAxx'),
+(1927, 8773, 1, 3, 7, 7, 27, 927, 1927, 1927, 1927, 54, 55, 'DWAAAA', 'LZMAAA', 'HHHHxx'),
+(227, 8774, 1, 3, 7, 7, 27, 227, 227, 227, 227, 54, 55, 'TIAAAA', 'MZMAAA', 'OOOOxx'),
+(6462, 8775, 0, 2, 2, 2, 62, 462, 462, 1462, 6462, 124, 125, 'OOAAAA', 'NZMAAA', 'VVVVxx'),
+(5227, 8776, 1, 3, 7, 7, 27, 227, 1227, 227, 5227, 54, 55, 'BTAAAA', 'OZMAAA', 'AAAAxx'),
+(1074, 8777, 0, 2, 4, 14, 74, 74, 1074, 1074, 1074, 148, 149, 'IPAAAA', 'PZMAAA', 'HHHHxx'),
+(9448, 8778, 0, 0, 8, 8, 48, 448, 1448, 4448, 9448, 96, 97, 'KZAAAA', 'QZMAAA', 'OOOOxx'),
+(4459, 8779, 1, 3, 9, 19, 59, 459, 459, 4459, 4459, 118, 119, 'NPAAAA', 'RZMAAA', 'VVVVxx'),
+(2478, 8780, 0, 2, 8, 18, 78, 478, 478, 2478, 2478, 156, 157, 'IRAAAA', 'SZMAAA', 'AAAAxx'),
+(5005, 8781, 1, 1, 5, 5, 5, 5, 1005, 5, 5005, 10, 11, 'NKAAAA', 'TZMAAA', 'HHHHxx'),
+(2418, 8782, 0, 2, 8, 18, 18, 418, 418, 2418, 2418, 36, 37, 'APAAAA', 'UZMAAA', 'OOOOxx'),
+(6991, 8783, 1, 3, 1, 11, 91, 991, 991, 1991, 6991, 182, 183, 'XIAAAA', 'VZMAAA', 'VVVVxx'),
+(4729, 8784, 1, 1, 9, 9, 29, 729, 729, 4729, 4729, 58, 59, 'XZAAAA', 'WZMAAA', 'AAAAxx'),
+(3548, 8785, 0, 0, 8, 8, 48, 548, 1548, 3548, 3548, 96, 97, 'MGAAAA', 'XZMAAA', 'HHHHxx'),
+(9616, 8786, 0, 0, 6, 16, 16, 616, 1616, 4616, 9616, 32, 33, 'WFAAAA', 'YZMAAA', 'OOOOxx'),
+(2901, 8787, 1, 1, 1, 1, 1, 901, 901, 2901, 2901, 2, 3, 'PHAAAA', 'ZZMAAA', 'VVVVxx'),
+(10, 8788, 0, 2, 0, 10, 10, 10, 10, 10, 10, 20, 21, 'KAAAAA', 'AANAAA', 'AAAAxx'),
+(2637, 8789, 1, 1, 7, 17, 37, 637, 637, 2637, 2637, 74, 75, 'LXAAAA', 'BANAAA', 'HHHHxx'),
+(6747, 8790, 1, 3, 7, 7, 47, 747, 747, 1747, 6747, 94, 95, 'NZAAAA', 'CANAAA', 'OOOOxx'),
+(797, 8791, 1, 1, 7, 17, 97, 797, 797, 797, 797, 194, 195, 'REAAAA', 'DANAAA', 'VVVVxx'),
+(7609, 8792, 1, 1, 9, 9, 9, 609, 1609, 2609, 7609, 18, 19, 'RGAAAA', 'EANAAA', 'AAAAxx'),
+(8290, 8793, 0, 2, 0, 10, 90, 290, 290, 3290, 8290, 180, 181, 'WGAAAA', 'FANAAA', 'HHHHxx'),
+(8765, 8794, 1, 1, 5, 5, 65, 765, 765, 3765, 8765, 130, 131, 'DZAAAA', 'GANAAA', 'OOOOxx'),
+(8053, 8795, 1, 1, 3, 13, 53, 53, 53, 3053, 8053, 106, 107, 'TXAAAA', 'HANAAA', 'VVVVxx'),
+(5602, 8796, 0, 2, 2, 2, 2, 602, 1602, 602, 5602, 4, 5, 'MHAAAA', 'IANAAA', 'AAAAxx'),
+(3672, 8797, 0, 0, 2, 12, 72, 672, 1672, 3672, 3672, 144, 145, 'GLAAAA', 'JANAAA', 'HHHHxx'),
+(7513, 8798, 1, 1, 3, 13, 13, 513, 1513, 2513, 7513, 26, 27, 'ZCAAAA', 'KANAAA', 'OOOOxx'),
+(3462, 8799, 0, 2, 2, 2, 62, 462, 1462, 3462, 3462, 124, 125, 'EDAAAA', 'LANAAA', 'VVVVxx'),
+(4457, 8800, 1, 1, 7, 17, 57, 457, 457, 4457, 4457, 114, 115, 'LPAAAA', 'MANAAA', 'AAAAxx'),
+(6547, 8801, 1, 3, 7, 7, 47, 547, 547, 1547, 6547, 94, 95, 'VRAAAA', 'NANAAA', 'HHHHxx'),
+(7417, 8802, 1, 1, 7, 17, 17, 417, 1417, 2417, 7417, 34, 35, 'HZAAAA', 'OANAAA', 'OOOOxx'),
+(8641, 8803, 1, 1, 1, 1, 41, 641, 641, 3641, 8641, 82, 83, 'JUAAAA', 'PANAAA', 'VVVVxx'),
+(149, 8804, 1, 1, 9, 9, 49, 149, 149, 149, 149, 98, 99, 'TFAAAA', 'QANAAA', 'AAAAxx'),
+(5041, 8805, 1, 1, 1, 1, 41, 41, 1041, 41, 5041, 82, 83, 'XLAAAA', 'RANAAA', 'HHHHxx'),
+(9232, 8806, 0, 0, 2, 12, 32, 232, 1232, 4232, 9232, 64, 65, 'CRAAAA', 'SANAAA', 'OOOOxx'),
+(3603, 8807, 1, 3, 3, 3, 3, 603, 1603, 3603, 3603, 6, 7, 'PIAAAA', 'TANAAA', 'VVVVxx'),
+(2792, 8808, 0, 0, 2, 12, 92, 792, 792, 2792, 2792, 184, 185, 'KDAAAA', 'UANAAA', 'AAAAxx'),
+(6620, 8809, 0, 0, 0, 0, 20, 620, 620, 1620, 6620, 40, 41, 'QUAAAA', 'VANAAA', 'HHHHxx'),
+(4000, 8810, 0, 0, 0, 0, 0, 0, 0, 4000, 4000, 0, 1, 'WXAAAA', 'WANAAA', 'OOOOxx'),
+(659, 8811, 1, 3, 9, 19, 59, 659, 659, 659, 659, 118, 119, 'JZAAAA', 'XANAAA', 'VVVVxx'),
+(8174, 8812, 0, 2, 4, 14, 74, 174, 174, 3174, 8174, 148, 149, 'KCAAAA', 'YANAAA', 'AAAAxx'),
+(4599, 8813, 1, 3, 9, 19, 99, 599, 599, 4599, 4599, 198, 199, 'XUAAAA', 'ZANAAA', 'HHHHxx'),
+(7851, 8814, 1, 3, 1, 11, 51, 851, 1851, 2851, 7851, 102, 103, 'ZPAAAA', 'ABNAAA', 'OOOOxx'),
+(6284, 8815, 0, 0, 4, 4, 84, 284, 284, 1284, 6284, 168, 169, 'SHAAAA', 'BBNAAA', 'VVVVxx'),
+(7116, 8816, 0, 0, 6, 16, 16, 116, 1116, 2116, 7116, 32, 33, 'SNAAAA', 'CBNAAA', 'AAAAxx'),
+(5595, 8817, 1, 3, 5, 15, 95, 595, 1595, 595, 5595, 190, 191, 'FHAAAA', 'DBNAAA', 'HHHHxx'),
+(2903, 8818, 1, 3, 3, 3, 3, 903, 903, 2903, 2903, 6, 7, 'RHAAAA', 'EBNAAA', 'OOOOxx'),
+(5948, 8819, 0, 0, 8, 8, 48, 948, 1948, 948, 5948, 96, 97, 'UUAAAA', 'FBNAAA', 'VVVVxx'),
+(225, 8820, 1, 1, 5, 5, 25, 225, 225, 225, 225, 50, 51, 'RIAAAA', 'GBNAAA', 'AAAAxx'),
+(524, 8821, 0, 0, 4, 4, 24, 524, 524, 524, 524, 48, 49, 'EUAAAA', 'HBNAAA', 'HHHHxx'),
+(7639, 8822, 1, 3, 9, 19, 39, 639, 1639, 2639, 7639, 78, 79, 'VHAAAA', 'IBNAAA', 'OOOOxx'),
+(7297, 8823, 1, 1, 7, 17, 97, 297, 1297, 2297, 7297, 194, 195, 'RUAAAA', 'JBNAAA', 'VVVVxx'),
+(2606, 8824, 0, 2, 6, 6, 6, 606, 606, 2606, 2606, 12, 13, 'GWAAAA', 'KBNAAA', 'AAAAxx'),
+(4771, 8825, 1, 3, 1, 11, 71, 771, 771, 4771, 4771, 142, 143, 'NBAAAA', 'LBNAAA', 'HHHHxx'),
+(8162, 8826, 0, 2, 2, 2, 62, 162, 162, 3162, 8162, 124, 125, 'YBAAAA', 'MBNAAA', 'OOOOxx'),
+(8999, 8827, 1, 3, 9, 19, 99, 999, 999, 3999, 8999, 198, 199, 'DIAAAA', 'NBNAAA', 'VVVVxx'),
+(2309, 8828, 1, 1, 9, 9, 9, 309, 309, 2309, 2309, 18, 19, 'VKAAAA', 'OBNAAA', 'AAAAxx'),
+(3594, 8829, 0, 2, 4, 14, 94, 594, 1594, 3594, 3594, 188, 189, 'GIAAAA', 'PBNAAA', 'HHHHxx'),
+(6092, 8830, 0, 0, 2, 12, 92, 92, 92, 1092, 6092, 184, 185, 'IAAAAA', 'QBNAAA', 'OOOOxx'),
+(7467, 8831, 1, 3, 7, 7, 67, 467, 1467, 2467, 7467, 134, 135, 'FBAAAA', 'RBNAAA', 'VVVVxx'),
+(6986, 8832, 0, 2, 6, 6, 86, 986, 986, 1986, 6986, 172, 173, 'SIAAAA', 'SBNAAA', 'AAAAxx'),
+(9898, 8833, 0, 2, 8, 18, 98, 898, 1898, 4898, 9898, 196, 197, 'SQAAAA', 'TBNAAA', 'HHHHxx'),
+(9578, 8834, 0, 2, 8, 18, 78, 578, 1578, 4578, 9578, 156, 157, 'KEAAAA', 'UBNAAA', 'OOOOxx'),
+(156, 8835, 0, 0, 6, 16, 56, 156, 156, 156, 156, 112, 113, 'AGAAAA', 'VBNAAA', 'VVVVxx'),
+(5810, 8836, 0, 2, 0, 10, 10, 810, 1810, 810, 5810, 20, 21, 'MPAAAA', 'WBNAAA', 'AAAAxx'),
+(790, 8837, 0, 2, 0, 10, 90, 790, 790, 790, 790, 180, 181, 'KEAAAA', 'XBNAAA', 'HHHHxx'),
+(6840, 8838, 0, 0, 0, 0, 40, 840, 840, 1840, 6840, 80, 81, 'CDAAAA', 'YBNAAA', 'OOOOxx'),
+(6725, 8839, 1, 1, 5, 5, 25, 725, 725, 1725, 6725, 50, 51, 'RYAAAA', 'ZBNAAA', 'VVVVxx'),
+(5528, 8840, 0, 0, 8, 8, 28, 528, 1528, 528, 5528, 56, 57, 'QEAAAA', 'ACNAAA', 'AAAAxx'),
+(4120, 8841, 0, 0, 0, 0, 20, 120, 120, 4120, 4120, 40, 41, 'MCAAAA', 'BCNAAA', 'HHHHxx'),
+(6694, 8842, 0, 2, 4, 14, 94, 694, 694, 1694, 6694, 188, 189, 'MXAAAA', 'CCNAAA', 'OOOOxx'),
+(3552, 8843, 0, 0, 2, 12, 52, 552, 1552, 3552, 3552, 104, 105, 'QGAAAA', 'DCNAAA', 'VVVVxx'),
+(1478, 8844, 0, 2, 8, 18, 78, 478, 1478, 1478, 1478, 156, 157, 'WEAAAA', 'ECNAAA', 'AAAAxx'),
+(8084, 8845, 0, 0, 4, 4, 84, 84, 84, 3084, 8084, 168, 169, 'YYAAAA', 'FCNAAA', 'HHHHxx'),
+(7578, 8846, 0, 2, 8, 18, 78, 578, 1578, 2578, 7578, 156, 157, 'MFAAAA', 'GCNAAA', 'OOOOxx'),
+(6314, 8847, 0, 2, 4, 14, 14, 314, 314, 1314, 6314, 28, 29, 'WIAAAA', 'HCNAAA', 'VVVVxx'),
+(6123, 8848, 1, 3, 3, 3, 23, 123, 123, 1123, 6123, 46, 47, 'NBAAAA', 'ICNAAA', 'AAAAxx'),
+(9443, 8849, 1, 3, 3, 3, 43, 443, 1443, 4443, 9443, 86, 87, 'FZAAAA', 'JCNAAA', 'HHHHxx'),
+(9628, 8850, 0, 0, 8, 8, 28, 628, 1628, 4628, 9628, 56, 57, 'IGAAAA', 'KCNAAA', 'OOOOxx'),
+(8508, 8851, 0, 0, 8, 8, 8, 508, 508, 3508, 8508, 16, 17, 'GPAAAA', 'LCNAAA', 'VVVVxx'),
+(5552, 8852, 0, 0, 2, 12, 52, 552, 1552, 552, 5552, 104, 105, 'OFAAAA', 'MCNAAA', 'AAAAxx'),
+(5327, 8853, 1, 3, 7, 7, 27, 327, 1327, 327, 5327, 54, 55, 'XWAAAA', 'NCNAAA', 'HHHHxx'),
+(7771, 8854, 1, 3, 1, 11, 71, 771, 1771, 2771, 7771, 142, 143, 'XMAAAA', 'OCNAAA', 'OOOOxx'),
+(8932, 8855, 0, 0, 2, 12, 32, 932, 932, 3932, 8932, 64, 65, 'OFAAAA', 'PCNAAA', 'VVVVxx'),
+(3526, 8856, 0, 2, 6, 6, 26, 526, 1526, 3526, 3526, 52, 53, 'QFAAAA', 'QCNAAA', 'AAAAxx'),
+(4340, 8857, 0, 0, 0, 0, 40, 340, 340, 4340, 4340, 80, 81, 'YKAAAA', 'RCNAAA', 'HHHHxx'),
+(9419, 8858, 1, 3, 9, 19, 19, 419, 1419, 4419, 9419, 38, 39, 'HYAAAA', 'SCNAAA', 'OOOOxx'),
+(8421, 8859, 1, 1, 1, 1, 21, 421, 421, 3421, 8421, 42, 43, 'XLAAAA', 'TCNAAA', 'VVVVxx'),
+(7431, 8860, 1, 3, 1, 11, 31, 431, 1431, 2431, 7431, 62, 63, 'VZAAAA', 'UCNAAA', 'AAAAxx'),
+(172, 8861, 0, 0, 2, 12, 72, 172, 172, 172, 172, 144, 145, 'QGAAAA', 'VCNAAA', 'HHHHxx'),
+(3279, 8862, 1, 3, 9, 19, 79, 279, 1279, 3279, 3279, 158, 159, 'DWAAAA', 'WCNAAA', 'OOOOxx'),
+(1508, 8863, 0, 0, 8, 8, 8, 508, 1508, 1508, 1508, 16, 17, 'AGAAAA', 'XCNAAA', 'VVVVxx'),
+(7091, 8864, 1, 3, 1, 11, 91, 91, 1091, 2091, 7091, 182, 183, 'TMAAAA', 'YCNAAA', 'AAAAxx'),
+(1419, 8865, 1, 3, 9, 19, 19, 419, 1419, 1419, 1419, 38, 39, 'PCAAAA', 'ZCNAAA', 'HHHHxx'),
+(3032, 8866, 0, 0, 2, 12, 32, 32, 1032, 3032, 3032, 64, 65, 'QMAAAA', 'ADNAAA', 'OOOOxx'),
+(8683, 8867, 1, 3, 3, 3, 83, 683, 683, 3683, 8683, 166, 167, 'ZVAAAA', 'BDNAAA', 'VVVVxx'),
+(4763, 8868, 1, 3, 3, 3, 63, 763, 763, 4763, 4763, 126, 127, 'FBAAAA', 'CDNAAA', 'AAAAxx'),
+(4424, 8869, 0, 0, 4, 4, 24, 424, 424, 4424, 4424, 48, 49, 'EOAAAA', 'DDNAAA', 'HHHHxx'),
+(8640, 8870, 0, 0, 0, 0, 40, 640, 640, 3640, 8640, 80, 81, 'IUAAAA', 'EDNAAA', 'OOOOxx'),
+(7187, 8871, 1, 3, 7, 7, 87, 187, 1187, 2187, 7187, 174, 175, 'LQAAAA', 'FDNAAA', 'VVVVxx'),
+(6247, 8872, 1, 3, 7, 7, 47, 247, 247, 1247, 6247, 94, 95, 'HGAAAA', 'GDNAAA', 'AAAAxx'),
+(7340, 8873, 0, 0, 0, 0, 40, 340, 1340, 2340, 7340, 80, 81, 'IWAAAA', 'HDNAAA', 'HHHHxx'),
+(182, 8874, 0, 2, 2, 2, 82, 182, 182, 182, 182, 164, 165, 'AHAAAA', 'IDNAAA', 'OOOOxx'),
+(2948, 8875, 0, 0, 8, 8, 48, 948, 948, 2948, 2948, 96, 97, 'KJAAAA', 'JDNAAA', 'VVVVxx'),
+(9462, 8876, 0, 2, 2, 2, 62, 462, 1462, 4462, 9462, 124, 125, 'YZAAAA', 'KDNAAA', 'AAAAxx'),
+(5997, 8877, 1, 1, 7, 17, 97, 997, 1997, 997, 5997, 194, 195, 'RWAAAA', 'LDNAAA', 'HHHHxx'),
+(5608, 8878, 0, 0, 8, 8, 8, 608, 1608, 608, 5608, 16, 17, 'SHAAAA', 'MDNAAA', 'OOOOxx'),
+(1472, 8879, 0, 0, 2, 12, 72, 472, 1472, 1472, 1472, 144, 145, 'QEAAAA', 'NDNAAA', 'VVVVxx'),
+(277, 8880, 1, 1, 7, 17, 77, 277, 277, 277, 277, 154, 155, 'RKAAAA', 'ODNAAA', 'AAAAxx'),
+(4807, 8881, 1, 3, 7, 7, 7, 807, 807, 4807, 4807, 14, 15, 'XCAAAA', 'PDNAAA', 'HHHHxx'),
+(4969, 8882, 1, 1, 9, 9, 69, 969, 969, 4969, 4969, 138, 139, 'DJAAAA', 'QDNAAA', 'OOOOxx'),
+(5611, 8883, 1, 3, 1, 11, 11, 611, 1611, 611, 5611, 22, 23, 'VHAAAA', 'RDNAAA', 'VVVVxx'),
+(372, 8884, 0, 0, 2, 12, 72, 372, 372, 372, 372, 144, 145, 'IOAAAA', 'SDNAAA', 'AAAAxx'),
+(6666, 8885, 0, 2, 6, 6, 66, 666, 666, 1666, 6666, 132, 133, 'KWAAAA', 'TDNAAA', 'HHHHxx'),
+(476, 8886, 0, 0, 6, 16, 76, 476, 476, 476, 476, 152, 153, 'ISAAAA', 'UDNAAA', 'OOOOxx'),
+(5225, 8887, 1, 1, 5, 5, 25, 225, 1225, 225, 5225, 50, 51, 'ZSAAAA', 'VDNAAA', 'VVVVxx'),
+(5143, 8888, 1, 3, 3, 3, 43, 143, 1143, 143, 5143, 86, 87, 'VPAAAA', 'WDNAAA', 'AAAAxx'),
+(1853, 8889, 1, 1, 3, 13, 53, 853, 1853, 1853, 1853, 106, 107, 'HTAAAA', 'XDNAAA', 'HHHHxx'),
+(675, 8890, 1, 3, 5, 15, 75, 675, 675, 675, 675, 150, 151, 'ZZAAAA', 'YDNAAA', 'OOOOxx'),
+(5643, 8891, 1, 3, 3, 3, 43, 643, 1643, 643, 5643, 86, 87, 'BJAAAA', 'ZDNAAA', 'VVVVxx'),
+(5317, 8892, 1, 1, 7, 17, 17, 317, 1317, 317, 5317, 34, 35, 'NWAAAA', 'AENAAA', 'AAAAxx'),
+(8102, 8893, 0, 2, 2, 2, 2, 102, 102, 3102, 8102, 4, 5, 'QZAAAA', 'BENAAA', 'HHHHxx'),
+(978, 8894, 0, 2, 8, 18, 78, 978, 978, 978, 978, 156, 157, 'QLAAAA', 'CENAAA', 'OOOOxx'),
+(4620, 8895, 0, 0, 0, 0, 20, 620, 620, 4620, 4620, 40, 41, 'SVAAAA', 'DENAAA', 'VVVVxx'),
+(151, 8896, 1, 3, 1, 11, 51, 151, 151, 151, 151, 102, 103, 'VFAAAA', 'EENAAA', 'AAAAxx'),
+(972, 8897, 0, 0, 2, 12, 72, 972, 972, 972, 972, 144, 145, 'KLAAAA', 'FENAAA', 'HHHHxx'),
+(6820, 8898, 0, 0, 0, 0, 20, 820, 820, 1820, 6820, 40, 41, 'ICAAAA', 'GENAAA', 'OOOOxx'),
+(7387, 8899, 1, 3, 7, 7, 87, 387, 1387, 2387, 7387, 174, 175, 'DYAAAA', 'HENAAA', 'VVVVxx'),
+(9634, 8900, 0, 2, 4, 14, 34, 634, 1634, 4634, 9634, 68, 69, 'OGAAAA', 'IENAAA', 'AAAAxx'),
+(6308, 8901, 0, 0, 8, 8, 8, 308, 308, 1308, 6308, 16, 17, 'QIAAAA', 'JENAAA', 'HHHHxx'),
+(8323, 8902, 1, 3, 3, 3, 23, 323, 323, 3323, 8323, 46, 47, 'DIAAAA', 'KENAAA', 'OOOOxx'),
+(6672, 8903, 0, 0, 2, 12, 72, 672, 672, 1672, 6672, 144, 145, 'QWAAAA', 'LENAAA', 'VVVVxx'),
+(8283, 8904, 1, 3, 3, 3, 83, 283, 283, 3283, 8283, 166, 167, 'PGAAAA', 'MENAAA', 'AAAAxx'),
+(7996, 8905, 0, 0, 6, 16, 96, 996, 1996, 2996, 7996, 192, 193, 'OVAAAA', 'NENAAA', 'HHHHxx'),
+(6488, 8906, 0, 0, 8, 8, 88, 488, 488, 1488, 6488, 176, 177, 'OPAAAA', 'OENAAA', 'OOOOxx'),
+(2365, 8907, 1, 1, 5, 5, 65, 365, 365, 2365, 2365, 130, 131, 'ZMAAAA', 'PENAAA', 'VVVVxx'),
+(9746, 8908, 0, 2, 6, 6, 46, 746, 1746, 4746, 9746, 92, 93, 'WKAAAA', 'QENAAA', 'AAAAxx'),
+(8605, 8909, 1, 1, 5, 5, 5, 605, 605, 3605, 8605, 10, 11, 'ZSAAAA', 'RENAAA', 'HHHHxx'),
+(3342, 8910, 0, 2, 2, 2, 42, 342, 1342, 3342, 3342, 84, 85, 'OYAAAA', 'SENAAA', 'OOOOxx'),
+(8429, 8911, 1, 1, 9, 9, 29, 429, 429, 3429, 8429, 58, 59, 'FMAAAA', 'TENAAA', 'VVVVxx'),
+(1162, 8912, 0, 2, 2, 2, 62, 162, 1162, 1162, 1162, 124, 125, 'SSAAAA', 'UENAAA', 'AAAAxx'),
+(531, 8913, 1, 3, 1, 11, 31, 531, 531, 531, 531, 62, 63, 'LUAAAA', 'VENAAA', 'HHHHxx'),
+(8408, 8914, 0, 0, 8, 8, 8, 408, 408, 3408, 8408, 16, 17, 'KLAAAA', 'WENAAA', 'OOOOxx'),
+(8862, 8915, 0, 2, 2, 2, 62, 862, 862, 3862, 8862, 124, 125, 'WCAAAA', 'XENAAA', 'VVVVxx'),
+(5843, 8916, 1, 3, 3, 3, 43, 843, 1843, 843, 5843, 86, 87, 'TQAAAA', 'YENAAA', 'AAAAxx'),
+(8704, 8917, 0, 0, 4, 4, 4, 704, 704, 3704, 8704, 8, 9, 'UWAAAA', 'ZENAAA', 'HHHHxx'),
+(7070, 8918, 0, 2, 0, 10, 70, 70, 1070, 2070, 7070, 140, 141, 'YLAAAA', 'AFNAAA', 'OOOOxx'),
+(9119, 8919, 1, 3, 9, 19, 19, 119, 1119, 4119, 9119, 38, 39, 'TMAAAA', 'BFNAAA', 'VVVVxx'),
+(8344, 8920, 0, 0, 4, 4, 44, 344, 344, 3344, 8344, 88, 89, 'YIAAAA', 'CFNAAA', 'AAAAxx'),
+(8979, 8921, 1, 3, 9, 19, 79, 979, 979, 3979, 8979, 158, 159, 'JHAAAA', 'DFNAAA', 'HHHHxx'),
+(2971, 8922, 1, 3, 1, 11, 71, 971, 971, 2971, 2971, 142, 143, 'HKAAAA', 'EFNAAA', 'OOOOxx'),
+(7700, 8923, 0, 0, 0, 0, 0, 700, 1700, 2700, 7700, 0, 1, 'EKAAAA', 'FFNAAA', 'VVVVxx'),
+(8280, 8924, 0, 0, 0, 0, 80, 280, 280, 3280, 8280, 160, 161, 'MGAAAA', 'GFNAAA', 'AAAAxx'),
+(9096, 8925, 0, 0, 6, 16, 96, 96, 1096, 4096, 9096, 192, 193, 'WLAAAA', 'HFNAAA', 'HHHHxx'),
+(99, 8926, 1, 3, 9, 19, 99, 99, 99, 99, 99, 198, 199, 'VDAAAA', 'IFNAAA', 'OOOOxx'),
+(6696, 8927, 0, 0, 6, 16, 96, 696, 696, 1696, 6696, 192, 193, 'OXAAAA', 'JFNAAA', 'VVVVxx'),
+(9490, 8928, 0, 2, 0, 10, 90, 490, 1490, 4490, 9490, 180, 181, 'ABAAAA', 'KFNAAA', 'AAAAxx'),
+(9073, 8929, 1, 1, 3, 13, 73, 73, 1073, 4073, 9073, 146, 147, 'ZKAAAA', 'LFNAAA', 'HHHHxx'),
+(1861, 8930, 1, 1, 1, 1, 61, 861, 1861, 1861, 1861, 122, 123, 'PTAAAA', 'MFNAAA', 'OOOOxx'),
+(4413, 8931, 1, 1, 3, 13, 13, 413, 413, 4413, 4413, 26, 27, 'TNAAAA', 'NFNAAA', 'VVVVxx'),
+(6002, 8932, 0, 2, 2, 2, 2, 2, 2, 1002, 6002, 4, 5, 'WWAAAA', 'OFNAAA', 'AAAAxx'),
+(439, 8933, 1, 3, 9, 19, 39, 439, 439, 439, 439, 78, 79, 'XQAAAA', 'PFNAAA', 'HHHHxx'),
+(5449, 8934, 1, 1, 9, 9, 49, 449, 1449, 449, 5449, 98, 99, 'PBAAAA', 'QFNAAA', 'OOOOxx'),
+(9737, 8935, 1, 1, 7, 17, 37, 737, 1737, 4737, 9737, 74, 75, 'NKAAAA', 'RFNAAA', 'VVVVxx'),
+(1898, 8936, 0, 2, 8, 18, 98, 898, 1898, 1898, 1898, 196, 197, 'AVAAAA', 'SFNAAA', 'AAAAxx'),
+(4189, 8937, 1, 1, 9, 9, 89, 189, 189, 4189, 4189, 178, 179, 'DFAAAA', 'TFNAAA', 'HHHHxx'),
+(1408, 8938, 0, 0, 8, 8, 8, 408, 1408, 1408, 1408, 16, 17, 'ECAAAA', 'UFNAAA', 'OOOOxx'),
+(394, 8939, 0, 2, 4, 14, 94, 394, 394, 394, 394, 188, 189, 'EPAAAA', 'VFNAAA', 'VVVVxx'),
+(1935, 8940, 1, 3, 5, 15, 35, 935, 1935, 1935, 1935, 70, 71, 'LWAAAA', 'WFNAAA', 'AAAAxx'),
+(3965, 8941, 1, 1, 5, 5, 65, 965, 1965, 3965, 3965, 130, 131, 'NWAAAA', 'XFNAAA', 'HHHHxx'),
+(6821, 8942, 1, 1, 1, 1, 21, 821, 821, 1821, 6821, 42, 43, 'JCAAAA', 'YFNAAA', 'OOOOxx'),
+(349, 8943, 1, 1, 9, 9, 49, 349, 349, 349, 349, 98, 99, 'LNAAAA', 'ZFNAAA', 'VVVVxx'),
+(8428, 8944, 0, 0, 8, 8, 28, 428, 428, 3428, 8428, 56, 57, 'EMAAAA', 'AGNAAA', 'AAAAxx'),
+(8200, 8945, 0, 0, 0, 0, 0, 200, 200, 3200, 8200, 0, 1, 'KDAAAA', 'BGNAAA', 'HHHHxx'),
+(1737, 8946, 1, 1, 7, 17, 37, 737, 1737, 1737, 1737, 74, 75, 'VOAAAA', 'CGNAAA', 'OOOOxx'),
+(6516, 8947, 0, 0, 6, 16, 16, 516, 516, 1516, 6516, 32, 33, 'QQAAAA', 'DGNAAA', 'VVVVxx'),
+(5441, 8948, 1, 1, 1, 1, 41, 441, 1441, 441, 5441, 82, 83, 'HBAAAA', 'EGNAAA', 'AAAAxx'),
+(5999, 8949, 1, 3, 9, 19, 99, 999, 1999, 999, 5999, 198, 199, 'TWAAAA', 'FGNAAA', 'HHHHxx'),
+(1539, 8950, 1, 3, 9, 19, 39, 539, 1539, 1539, 1539, 78, 79, 'FHAAAA', 'GGNAAA', 'OOOOxx'),
+(9067, 8951, 1, 3, 7, 7, 67, 67, 1067, 4067, 9067, 134, 135, 'TKAAAA', 'HGNAAA', 'VVVVxx'),
+(4061, 8952, 1, 1, 1, 1, 61, 61, 61, 4061, 4061, 122, 123, 'FAAAAA', 'IGNAAA', 'AAAAxx'),
+(1642, 8953, 0, 2, 2, 2, 42, 642, 1642, 1642, 1642, 84, 85, 'ELAAAA', 'JGNAAA', 'HHHHxx'),
+(4657, 8954, 1, 1, 7, 17, 57, 657, 657, 4657, 4657, 114, 115, 'DXAAAA', 'KGNAAA', 'OOOOxx'),
+(9934, 8955, 0, 2, 4, 14, 34, 934, 1934, 4934, 9934, 68, 69, 'CSAAAA', 'LGNAAA', 'VVVVxx'),
+(6385, 8956, 1, 1, 5, 5, 85, 385, 385, 1385, 6385, 170, 171, 'PLAAAA', 'MGNAAA', 'AAAAxx'),
+(6775, 8957, 1, 3, 5, 15, 75, 775, 775, 1775, 6775, 150, 151, 'PAAAAA', 'NGNAAA', 'HHHHxx'),
+(3873, 8958, 1, 1, 3, 13, 73, 873, 1873, 3873, 3873, 146, 147, 'ZSAAAA', 'OGNAAA', 'OOOOxx'),
+(3862, 8959, 0, 2, 2, 2, 62, 862, 1862, 3862, 3862, 124, 125, 'OSAAAA', 'PGNAAA', 'VVVVxx'),
+(1224, 8960, 0, 0, 4, 4, 24, 224, 1224, 1224, 1224, 48, 49, 'CVAAAA', 'QGNAAA', 'AAAAxx'),
+(4483, 8961, 1, 3, 3, 3, 83, 483, 483, 4483, 4483, 166, 167, 'LQAAAA', 'RGNAAA', 'HHHHxx'),
+(3685, 8962, 1, 1, 5, 5, 85, 685, 1685, 3685, 3685, 170, 171, 'TLAAAA', 'SGNAAA', 'OOOOxx'),
+(6082, 8963, 0, 2, 2, 2, 82, 82, 82, 1082, 6082, 164, 165, 'YZAAAA', 'TGNAAA', 'VVVVxx'),
+(7798, 8964, 0, 2, 8, 18, 98, 798, 1798, 2798, 7798, 196, 197, 'YNAAAA', 'UGNAAA', 'AAAAxx'),
+(9039, 8965, 1, 3, 9, 19, 39, 39, 1039, 4039, 9039, 78, 79, 'RJAAAA', 'VGNAAA', 'HHHHxx'),
+(985, 8966, 1, 1, 5, 5, 85, 985, 985, 985, 985, 170, 171, 'XLAAAA', 'WGNAAA', 'OOOOxx'),
+(5389, 8967, 1, 1, 9, 9, 89, 389, 1389, 389, 5389, 178, 179, 'HZAAAA', 'XGNAAA', 'VVVVxx'),
+(1716, 8968, 0, 0, 6, 16, 16, 716, 1716, 1716, 1716, 32, 33, 'AOAAAA', 'YGNAAA', 'AAAAxx'),
+(4209, 8969, 1, 1, 9, 9, 9, 209, 209, 4209, 4209, 18, 19, 'XFAAAA', 'ZGNAAA', 'HHHHxx'),
+(746, 8970, 0, 2, 6, 6, 46, 746, 746, 746, 746, 92, 93, 'SCAAAA', 'AHNAAA', 'OOOOxx'),
+(6295, 8971, 1, 3, 5, 15, 95, 295, 295, 1295, 6295, 190, 191, 'DIAAAA', 'BHNAAA', 'VVVVxx'),
+(9754, 8972, 0, 2, 4, 14, 54, 754, 1754, 4754, 9754, 108, 109, 'ELAAAA', 'CHNAAA', 'AAAAxx'),
+(2336, 8973, 0, 0, 6, 16, 36, 336, 336, 2336, 2336, 72, 73, 'WLAAAA', 'DHNAAA', 'HHHHxx'),
+(3701, 8974, 1, 1, 1, 1, 1, 701, 1701, 3701, 3701, 2, 3, 'JMAAAA', 'EHNAAA', 'OOOOxx'),
+(3551, 8975, 1, 3, 1, 11, 51, 551, 1551, 3551, 3551, 102, 103, 'PGAAAA', 'FHNAAA', 'VVVVxx'),
+(8516, 8976, 0, 0, 6, 16, 16, 516, 516, 3516, 8516, 32, 33, 'OPAAAA', 'GHNAAA', 'AAAAxx'),
+(9290, 8977, 0, 2, 0, 10, 90, 290, 1290, 4290, 9290, 180, 181, 'ITAAAA', 'HHNAAA', 'HHHHxx'),
+(5686, 8978, 0, 2, 6, 6, 86, 686, 1686, 686, 5686, 172, 173, 'SKAAAA', 'IHNAAA', 'OOOOxx'),
+(2893, 8979, 1, 1, 3, 13, 93, 893, 893, 2893, 2893, 186, 187, 'HHAAAA', 'JHNAAA', 'VVVVxx'),
+(6279, 8980, 1, 3, 9, 19, 79, 279, 279, 1279, 6279, 158, 159, 'NHAAAA', 'KHNAAA', 'AAAAxx'),
+(2278, 8981, 0, 2, 8, 18, 78, 278, 278, 2278, 2278, 156, 157, 'QJAAAA', 'LHNAAA', 'HHHHxx'),
+(1618, 8982, 0, 2, 8, 18, 18, 618, 1618, 1618, 1618, 36, 37, 'GKAAAA', 'MHNAAA', 'OOOOxx'),
+(3450, 8983, 0, 2, 0, 10, 50, 450, 1450, 3450, 3450, 100, 101, 'SCAAAA', 'NHNAAA', 'VVVVxx'),
+(8857, 8984, 1, 1, 7, 17, 57, 857, 857, 3857, 8857, 114, 115, 'RCAAAA', 'OHNAAA', 'AAAAxx'),
+(1005, 8985, 1, 1, 5, 5, 5, 5, 1005, 1005, 1005, 10, 11, 'RMAAAA', 'PHNAAA', 'HHHHxx'),
+(4727, 8986, 1, 3, 7, 7, 27, 727, 727, 4727, 4727, 54, 55, 'VZAAAA', 'QHNAAA', 'OOOOxx'),
+(7617, 8987, 1, 1, 7, 17, 17, 617, 1617, 2617, 7617, 34, 35, 'ZGAAAA', 'RHNAAA', 'VVVVxx'),
+(2021, 8988, 1, 1, 1, 1, 21, 21, 21, 2021, 2021, 42, 43, 'TZAAAA', 'SHNAAA', 'AAAAxx'),
+(9124, 8989, 0, 0, 4, 4, 24, 124, 1124, 4124, 9124, 48, 49, 'YMAAAA', 'THNAAA', 'HHHHxx'),
+(3175, 8990, 1, 3, 5, 15, 75, 175, 1175, 3175, 3175, 150, 151, 'DSAAAA', 'UHNAAA', 'OOOOxx'),
+(2949, 8991, 1, 1, 9, 9, 49, 949, 949, 2949, 2949, 98, 99, 'LJAAAA', 'VHNAAA', 'VVVVxx'),
+(2424, 8992, 0, 0, 4, 4, 24, 424, 424, 2424, 2424, 48, 49, 'GPAAAA', 'WHNAAA', 'AAAAxx'),
+(4791, 8993, 1, 3, 1, 11, 91, 791, 791, 4791, 4791, 182, 183, 'HCAAAA', 'XHNAAA', 'HHHHxx'),
+(7500, 8994, 0, 0, 0, 0, 0, 500, 1500, 2500, 7500, 0, 1, 'MCAAAA', 'YHNAAA', 'OOOOxx'),
+(4893, 8995, 1, 1, 3, 13, 93, 893, 893, 4893, 4893, 186, 187, 'FGAAAA', 'ZHNAAA', 'VVVVxx'),
+(121, 8996, 1, 1, 1, 1, 21, 121, 121, 121, 121, 42, 43, 'REAAAA', 'AINAAA', 'AAAAxx'),
+(1965, 8997, 1, 1, 5, 5, 65, 965, 1965, 1965, 1965, 130, 131, 'PXAAAA', 'BINAAA', 'HHHHxx'),
+(2972, 8998, 0, 0, 2, 12, 72, 972, 972, 2972, 2972, 144, 145, 'IKAAAA', 'CINAAA', 'OOOOxx'),
+(662, 8999, 0, 2, 2, 2, 62, 662, 662, 662, 662, 124, 125, 'MZAAAA', 'DINAAA', 'VVVVxx');
+
+INSERT INTO tenk1 VALUES
+(7074, 9000, 0, 2, 4, 14, 74, 74, 1074, 2074, 7074, 148, 149, 'CMAAAA', 'EINAAA', 'AAAAxx'),
+(981, 9001, 1, 1, 1, 1, 81, 981, 981, 981, 981, 162, 163, 'TLAAAA', 'FINAAA', 'HHHHxx'),
+(3520, 9002, 0, 0, 0, 0, 20, 520, 1520, 3520, 3520, 40, 41, 'KFAAAA', 'GINAAA', 'OOOOxx'),
+(6540, 9003, 0, 0, 0, 0, 40, 540, 540, 1540, 6540, 80, 81, 'ORAAAA', 'HINAAA', 'VVVVxx'),
+(6648, 9004, 0, 0, 8, 8, 48, 648, 648, 1648, 6648, 96, 97, 'SVAAAA', 'IINAAA', 'AAAAxx'),
+(7076, 9005, 0, 0, 6, 16, 76, 76, 1076, 2076, 7076, 152, 153, 'EMAAAA', 'JINAAA', 'HHHHxx'),
+(6919, 9006, 1, 3, 9, 19, 19, 919, 919, 1919, 6919, 38, 39, 'DGAAAA', 'KINAAA', 'OOOOxx'),
+(1108, 9007, 0, 0, 8, 8, 8, 108, 1108, 1108, 1108, 16, 17, 'QQAAAA', 'LINAAA', 'VVVVxx'),
+(317, 9008, 1, 1, 7, 17, 17, 317, 317, 317, 317, 34, 35, 'FMAAAA', 'MINAAA', 'AAAAxx'),
+(3483, 9009, 1, 3, 3, 3, 83, 483, 1483, 3483, 3483, 166, 167, 'ZDAAAA', 'NINAAA', 'HHHHxx'),
+(6764, 9010, 0, 0, 4, 4, 64, 764, 764, 1764, 6764, 128, 129, 'EAAAAA', 'OINAAA', 'OOOOxx'),
+(1235, 9011, 1, 3, 5, 15, 35, 235, 1235, 1235, 1235, 70, 71, 'NVAAAA', 'PINAAA', 'VVVVxx'),
+(7121, 9012, 1, 1, 1, 1, 21, 121, 1121, 2121, 7121, 42, 43, 'XNAAAA', 'QINAAA', 'AAAAxx'),
+(426, 9013, 0, 2, 6, 6, 26, 426, 426, 426, 426, 52, 53, 'KQAAAA', 'RINAAA', 'HHHHxx'),
+(6880, 9014, 0, 0, 0, 0, 80, 880, 880, 1880, 6880, 160, 161, 'QEAAAA', 'SINAAA', 'OOOOxx'),
+(5401, 9015, 1, 1, 1, 1, 1, 401, 1401, 401, 5401, 2, 3, 'TZAAAA', 'TINAAA', 'VVVVxx'),
+(7323, 9016, 1, 3, 3, 3, 23, 323, 1323, 2323, 7323, 46, 47, 'RVAAAA', 'UINAAA', 'AAAAxx'),
+(9751, 9017, 1, 3, 1, 11, 51, 751, 1751, 4751, 9751, 102, 103, 'BLAAAA', 'VINAAA', 'HHHHxx'),
+(3436, 9018, 0, 0, 6, 16, 36, 436, 1436, 3436, 3436, 72, 73, 'ECAAAA', 'WINAAA', 'OOOOxx'),
+(7319, 9019, 1, 3, 9, 19, 19, 319, 1319, 2319, 7319, 38, 39, 'NVAAAA', 'XINAAA', 'VVVVxx'),
+(7882, 9020, 0, 2, 2, 2, 82, 882, 1882, 2882, 7882, 164, 165, 'ERAAAA', 'YINAAA', 'AAAAxx'),
+(8260, 9021, 0, 0, 0, 0, 60, 260, 260, 3260, 8260, 120, 121, 'SFAAAA', 'ZINAAA', 'HHHHxx'),
+(9758, 9022, 0, 2, 8, 18, 58, 758, 1758, 4758, 9758, 116, 117, 'ILAAAA', 'AJNAAA', 'OOOOxx'),
+(4205, 9023, 1, 1, 5, 5, 5, 205, 205, 4205, 4205, 10, 11, 'TFAAAA', 'BJNAAA', 'VVVVxx'),
+(8884, 9024, 0, 0, 4, 4, 84, 884, 884, 3884, 8884, 168, 169, 'SDAAAA', 'CJNAAA', 'AAAAxx'),
+(1112, 9025, 0, 0, 2, 12, 12, 112, 1112, 1112, 1112, 24, 25, 'UQAAAA', 'DJNAAA', 'HHHHxx'),
+(2186, 9026, 0, 2, 6, 6, 86, 186, 186, 2186, 2186, 172, 173, 'CGAAAA', 'EJNAAA', 'OOOOxx'),
+(8666, 9027, 0, 2, 6, 6, 66, 666, 666, 3666, 8666, 132, 133, 'IVAAAA', 'FJNAAA', 'VVVVxx'),
+(4325, 9028, 1, 1, 5, 5, 25, 325, 325, 4325, 4325, 50, 51, 'JKAAAA', 'GJNAAA', 'AAAAxx'),
+(4912, 9029, 0, 0, 2, 12, 12, 912, 912, 4912, 4912, 24, 25, 'YGAAAA', 'HJNAAA', 'HHHHxx'),
+(6497, 9030, 1, 1, 7, 17, 97, 497, 497, 1497, 6497, 194, 195, 'XPAAAA', 'IJNAAA', 'OOOOxx'),
+(9072, 9031, 0, 0, 2, 12, 72, 72, 1072, 4072, 9072, 144, 145, 'YKAAAA', 'JJNAAA', 'VVVVxx'),
+(8899, 9032, 1, 3, 9, 19, 99, 899, 899, 3899, 8899, 198, 199, 'HEAAAA', 'KJNAAA', 'AAAAxx'),
+(5619, 9033, 1, 3, 9, 19, 19, 619, 1619, 619, 5619, 38, 39, 'DIAAAA', 'LJNAAA', 'HHHHxx'),
+(4110, 9034, 0, 2, 0, 10, 10, 110, 110, 4110, 4110, 20, 21, 'CCAAAA', 'MJNAAA', 'OOOOxx'),
+(7025, 9035, 1, 1, 5, 5, 25, 25, 1025, 2025, 7025, 50, 51, 'FKAAAA', 'NJNAAA', 'VVVVxx'),
+(5605, 9036, 1, 1, 5, 5, 5, 605, 1605, 605, 5605, 10, 11, 'PHAAAA', 'OJNAAA', 'AAAAxx'),
+(2572, 9037, 0, 0, 2, 12, 72, 572, 572, 2572, 2572, 144, 145, 'YUAAAA', 'PJNAAA', 'HHHHxx'),
+(3895, 9038, 1, 3, 5, 15, 95, 895, 1895, 3895, 3895, 190, 191, 'VTAAAA', 'QJNAAA', 'OOOOxx'),
+(9138, 9039, 0, 2, 8, 18, 38, 138, 1138, 4138, 9138, 76, 77, 'MNAAAA', 'RJNAAA', 'VVVVxx'),
+(4713, 9040, 1, 1, 3, 13, 13, 713, 713, 4713, 4713, 26, 27, 'HZAAAA', 'SJNAAA', 'AAAAxx'),
+(6079, 9041, 1, 3, 9, 19, 79, 79, 79, 1079, 6079, 158, 159, 'VZAAAA', 'TJNAAA', 'HHHHxx'),
+(8898, 9042, 0, 2, 8, 18, 98, 898, 898, 3898, 8898, 196, 197, 'GEAAAA', 'UJNAAA', 'OOOOxx'),
+(2650, 9043, 0, 2, 0, 10, 50, 650, 650, 2650, 2650, 100, 101, 'YXAAAA', 'VJNAAA', 'VVVVxx'),
+(5316, 9044, 0, 0, 6, 16, 16, 316, 1316, 316, 5316, 32, 33, 'MWAAAA', 'WJNAAA', 'AAAAxx'),
+(5133, 9045, 1, 1, 3, 13, 33, 133, 1133, 133, 5133, 66, 67, 'LPAAAA', 'XJNAAA', 'HHHHxx'),
+(2184, 9046, 0, 0, 4, 4, 84, 184, 184, 2184, 2184, 168, 169, 'AGAAAA', 'YJNAAA', 'OOOOxx'),
+(2728, 9047, 0, 0, 8, 8, 28, 728, 728, 2728, 2728, 56, 57, 'YAAAAA', 'ZJNAAA', 'VVVVxx'),
+(6737, 9048, 1, 1, 7, 17, 37, 737, 737, 1737, 6737, 74, 75, 'DZAAAA', 'AKNAAA', 'AAAAxx'),
+(1128, 9049, 0, 0, 8, 8, 28, 128, 1128, 1128, 1128, 56, 57, 'KRAAAA', 'BKNAAA', 'HHHHxx'),
+(9662, 9050, 0, 2, 2, 2, 62, 662, 1662, 4662, 9662, 124, 125, 'QHAAAA', 'CKNAAA', 'OOOOxx'),
+(9384, 9051, 0, 0, 4, 4, 84, 384, 1384, 4384, 9384, 168, 169, 'YWAAAA', 'DKNAAA', 'VVVVxx'),
+(4576, 9052, 0, 0, 6, 16, 76, 576, 576, 4576, 4576, 152, 153, 'AUAAAA', 'EKNAAA', 'AAAAxx'),
+(9613, 9053, 1, 1, 3, 13, 13, 613, 1613, 4613, 9613, 26, 27, 'TFAAAA', 'FKNAAA', 'HHHHxx'),
+(4001, 9054, 1, 1, 1, 1, 1, 1, 1, 4001, 4001, 2, 3, 'XXAAAA', 'GKNAAA', 'OOOOxx'),
+(3628, 9055, 0, 0, 8, 8, 28, 628, 1628, 3628, 3628, 56, 57, 'OJAAAA', 'HKNAAA', 'VVVVxx'),
+(6968, 9056, 0, 0, 8, 8, 68, 968, 968, 1968, 6968, 136, 137, 'AIAAAA', 'IKNAAA', 'AAAAxx'),
+(6491, 9057, 1, 3, 1, 11, 91, 491, 491, 1491, 6491, 182, 183, 'RPAAAA', 'JKNAAA', 'HHHHxx'),
+(1265, 9058, 1, 1, 5, 5, 65, 265, 1265, 1265, 1265, 130, 131, 'RWAAAA', 'KKNAAA', 'OOOOxx'),
+(6128, 9059, 0, 0, 8, 8, 28, 128, 128, 1128, 6128, 56, 57, 'SBAAAA', 'LKNAAA', 'VVVVxx'),
+(4274, 9060, 0, 2, 4, 14, 74, 274, 274, 4274, 4274, 148, 149, 'KIAAAA', 'MKNAAA', 'AAAAxx'),
+(3598, 9061, 0, 2, 8, 18, 98, 598, 1598, 3598, 3598, 196, 197, 'KIAAAA', 'NKNAAA', 'HHHHxx'),
+(7961, 9062, 1, 1, 1, 1, 61, 961, 1961, 2961, 7961, 122, 123, 'FUAAAA', 'OKNAAA', 'OOOOxx'),
+(2643, 9063, 1, 3, 3, 3, 43, 643, 643, 2643, 2643, 86, 87, 'RXAAAA', 'PKNAAA', 'VVVVxx'),
+(4547, 9064, 1, 3, 7, 7, 47, 547, 547, 4547, 4547, 94, 95, 'XSAAAA', 'QKNAAA', 'AAAAxx'),
+(3568, 9065, 0, 0, 8, 8, 68, 568, 1568, 3568, 3568, 136, 137, 'GHAAAA', 'RKNAAA', 'HHHHxx'),
+(8954, 9066, 0, 2, 4, 14, 54, 954, 954, 3954, 8954, 108, 109, 'KGAAAA', 'SKNAAA', 'OOOOxx'),
+(8802, 9067, 0, 2, 2, 2, 2, 802, 802, 3802, 8802, 4, 5, 'OAAAAA', 'TKNAAA', 'VVVVxx'),
+(7829, 9068, 1, 1, 9, 9, 29, 829, 1829, 2829, 7829, 58, 59, 'DPAAAA', 'UKNAAA', 'AAAAxx'),
+(1008, 9069, 0, 0, 8, 8, 8, 8, 1008, 1008, 1008, 16, 17, 'UMAAAA', 'VKNAAA', 'HHHHxx'),
+(3627, 9070, 1, 3, 7, 7, 27, 627, 1627, 3627, 3627, 54, 55, 'NJAAAA', 'WKNAAA', 'OOOOxx'),
+(3999, 9071, 1, 3, 9, 19, 99, 999, 1999, 3999, 3999, 198, 199, 'VXAAAA', 'XKNAAA', 'VVVVxx'),
+(7697, 9072, 1, 1, 7, 17, 97, 697, 1697, 2697, 7697, 194, 195, 'BKAAAA', 'YKNAAA', 'AAAAxx'),
+(9380, 9073, 0, 0, 0, 0, 80, 380, 1380, 4380, 9380, 160, 161, 'UWAAAA', 'ZKNAAA', 'HHHHxx'),
+(2707, 9074, 1, 3, 7, 7, 7, 707, 707, 2707, 2707, 14, 15, 'DAAAAA', 'ALNAAA', 'OOOOxx'),
+(4430, 9075, 0, 2, 0, 10, 30, 430, 430, 4430, 4430, 60, 61, 'KOAAAA', 'BLNAAA', 'VVVVxx'),
+(6440, 9076, 0, 0, 0, 0, 40, 440, 440, 1440, 6440, 80, 81, 'SNAAAA', 'CLNAAA', 'AAAAxx'),
+(9958, 9077, 0, 2, 8, 18, 58, 958, 1958, 4958, 9958, 116, 117, 'ATAAAA', 'DLNAAA', 'HHHHxx'),
+(7592, 9078, 0, 0, 2, 12, 92, 592, 1592, 2592, 7592, 184, 185, 'AGAAAA', 'ELNAAA', 'OOOOxx'),
+(7852, 9079, 0, 0, 2, 12, 52, 852, 1852, 2852, 7852, 104, 105, 'AQAAAA', 'FLNAAA', 'VVVVxx'),
+(9253, 9080, 1, 1, 3, 13, 53, 253, 1253, 4253, 9253, 106, 107, 'XRAAAA', 'GLNAAA', 'AAAAxx'),
+(5910, 9081, 0, 2, 0, 10, 10, 910, 1910, 910, 5910, 20, 21, 'ITAAAA', 'HLNAAA', 'HHHHxx'),
+(7487, 9082, 1, 3, 7, 7, 87, 487, 1487, 2487, 7487, 174, 175, 'ZBAAAA', 'ILNAAA', 'OOOOxx'),
+(6324, 9083, 0, 0, 4, 4, 24, 324, 324, 1324, 6324, 48, 49, 'GJAAAA', 'JLNAAA', 'VVVVxx'),
+(5792, 9084, 0, 0, 2, 12, 92, 792, 1792, 792, 5792, 184, 185, 'UOAAAA', 'KLNAAA', 'AAAAxx'),
+(7390, 9085, 0, 2, 0, 10, 90, 390, 1390, 2390, 7390, 180, 181, 'GYAAAA', 'LLNAAA', 'HHHHxx'),
+(8534, 9086, 0, 2, 4, 14, 34, 534, 534, 3534, 8534, 68, 69, 'GQAAAA', 'MLNAAA', 'OOOOxx'),
+(2690, 9087, 0, 2, 0, 10, 90, 690, 690, 2690, 2690, 180, 181, 'MZAAAA', 'NLNAAA', 'VVVVxx'),
+(3992, 9088, 0, 0, 2, 12, 92, 992, 1992, 3992, 3992, 184, 185, 'OXAAAA', 'OLNAAA', 'AAAAxx'),
+(6928, 9089, 0, 0, 8, 8, 28, 928, 928, 1928, 6928, 56, 57, 'MGAAAA', 'PLNAAA', 'HHHHxx'),
+(7815, 9090, 1, 3, 5, 15, 15, 815, 1815, 2815, 7815, 30, 31, 'POAAAA', 'QLNAAA', 'OOOOxx'),
+(9477, 9091, 1, 1, 7, 17, 77, 477, 1477, 4477, 9477, 154, 155, 'NAAAAA', 'RLNAAA', 'VVVVxx'),
+(497, 9092, 1, 1, 7, 17, 97, 497, 497, 497, 497, 194, 195, 'DTAAAA', 'SLNAAA', 'AAAAxx'),
+(7532, 9093, 0, 0, 2, 12, 32, 532, 1532, 2532, 7532, 64, 65, 'SDAAAA', 'TLNAAA', 'HHHHxx'),
+(9838, 9094, 0, 2, 8, 18, 38, 838, 1838, 4838, 9838, 76, 77, 'KOAAAA', 'ULNAAA', 'OOOOxx'),
+(1557, 9095, 1, 1, 7, 17, 57, 557, 1557, 1557, 1557, 114, 115, 'XHAAAA', 'VLNAAA', 'VVVVxx'),
+(2467, 9096, 1, 3, 7, 7, 67, 467, 467, 2467, 2467, 134, 135, 'XQAAAA', 'WLNAAA', 'AAAAxx'),
+(2367, 9097, 1, 3, 7, 7, 67, 367, 367, 2367, 2367, 134, 135, 'BNAAAA', 'XLNAAA', 'HHHHxx'),
+(5677, 9098, 1, 1, 7, 17, 77, 677, 1677, 677, 5677, 154, 155, 'JKAAAA', 'YLNAAA', 'OOOOxx'),
+(6193, 9099, 1, 1, 3, 13, 93, 193, 193, 1193, 6193, 186, 187, 'FEAAAA', 'ZLNAAA', 'VVVVxx'),
+(7126, 9100, 0, 2, 6, 6, 26, 126, 1126, 2126, 7126, 52, 53, 'COAAAA', 'AMNAAA', 'AAAAxx'),
+(5264, 9101, 0, 0, 4, 4, 64, 264, 1264, 264, 5264, 128, 129, 'MUAAAA', 'BMNAAA', 'HHHHxx'),
+(850, 9102, 0, 2, 0, 10, 50, 850, 850, 850, 850, 100, 101, 'SGAAAA', 'CMNAAA', 'OOOOxx'),
+(4854, 9103, 0, 2, 4, 14, 54, 854, 854, 4854, 4854, 108, 109, 'SEAAAA', 'DMNAAA', 'VVVVxx'),
+(4414, 9104, 0, 2, 4, 14, 14, 414, 414, 4414, 4414, 28, 29, 'UNAAAA', 'EMNAAA', 'AAAAxx'),
+(8971, 9105, 1, 3, 1, 11, 71, 971, 971, 3971, 8971, 142, 143, 'BHAAAA', 'FMNAAA', 'HHHHxx'),
+(9240, 9106, 0, 0, 0, 0, 40, 240, 1240, 4240, 9240, 80, 81, 'KRAAAA', 'GMNAAA', 'OOOOxx'),
+(7341, 9107, 1, 1, 1, 1, 41, 341, 1341, 2341, 7341, 82, 83, 'JWAAAA', 'HMNAAA', 'VVVVxx'),
+(3151, 9108, 1, 3, 1, 11, 51, 151, 1151, 3151, 3151, 102, 103, 'FRAAAA', 'IMNAAA', 'AAAAxx'),
+(1742, 9109, 0, 2, 2, 2, 42, 742, 1742, 1742, 1742, 84, 85, 'APAAAA', 'JMNAAA', 'HHHHxx'),
+(1347, 9110, 1, 3, 7, 7, 47, 347, 1347, 1347, 1347, 94, 95, 'VZAAAA', 'KMNAAA', 'OOOOxx'),
+(9418, 9111, 0, 2, 8, 18, 18, 418, 1418, 4418, 9418, 36, 37, 'GYAAAA', 'LMNAAA', 'VVVVxx'),
+(5452, 9112, 0, 0, 2, 12, 52, 452, 1452, 452, 5452, 104, 105, 'SBAAAA', 'MMNAAA', 'AAAAxx'),
+(8637, 9113, 1, 1, 7, 17, 37, 637, 637, 3637, 8637, 74, 75, 'FUAAAA', 'NMNAAA', 'HHHHxx'),
+(8287, 9114, 1, 3, 7, 7, 87, 287, 287, 3287, 8287, 174, 175, 'TGAAAA', 'OMNAAA', 'OOOOxx'),
+(9865, 9115, 1, 1, 5, 5, 65, 865, 1865, 4865, 9865, 130, 131, 'LPAAAA', 'PMNAAA', 'VVVVxx'),
+(1664, 9116, 0, 0, 4, 4, 64, 664, 1664, 1664, 1664, 128, 129, 'AMAAAA', 'QMNAAA', 'AAAAxx'),
+(9933, 9117, 1, 1, 3, 13, 33, 933, 1933, 4933, 9933, 66, 67, 'BSAAAA', 'RMNAAA', 'HHHHxx'),
+(3416, 9118, 0, 0, 6, 16, 16, 416, 1416, 3416, 3416, 32, 33, 'KBAAAA', 'SMNAAA', 'OOOOxx'),
+(7981, 9119, 1, 1, 1, 1, 81, 981, 1981, 2981, 7981, 162, 163, 'ZUAAAA', 'TMNAAA', 'VVVVxx'),
+(1981, 9120, 1, 1, 1, 1, 81, 981, 1981, 1981, 1981, 162, 163, 'FYAAAA', 'UMNAAA', 'AAAAxx'),
+(441, 9121, 1, 1, 1, 1, 41, 441, 441, 441, 441, 82, 83, 'ZQAAAA', 'VMNAAA', 'HHHHxx'),
+(1380, 9122, 0, 0, 0, 0, 80, 380, 1380, 1380, 1380, 160, 161, 'CBAAAA', 'WMNAAA', 'OOOOxx'),
+(7325, 9123, 1, 1, 5, 5, 25, 325, 1325, 2325, 7325, 50, 51, 'TVAAAA', 'XMNAAA', 'VVVVxx'),
+(5682, 9124, 0, 2, 2, 2, 82, 682, 1682, 682, 5682, 164, 165, 'OKAAAA', 'YMNAAA', 'AAAAxx'),
+(1024, 9125, 0, 0, 4, 4, 24, 24, 1024, 1024, 1024, 48, 49, 'KNAAAA', 'ZMNAAA', 'HHHHxx'),
+(1096, 9126, 0, 0, 6, 16, 96, 96, 1096, 1096, 1096, 192, 193, 'EQAAAA', 'ANNAAA', 'OOOOxx'),
+(4717, 9127, 1, 1, 7, 17, 17, 717, 717, 4717, 4717, 34, 35, 'LZAAAA', 'BNNAAA', 'VVVVxx'),
+(7948, 9128, 0, 0, 8, 8, 48, 948, 1948, 2948, 7948, 96, 97, 'STAAAA', 'CNNAAA', 'AAAAxx'),
+(4074, 9129, 0, 2, 4, 14, 74, 74, 74, 4074, 4074, 148, 149, 'SAAAAA', 'DNNAAA', 'HHHHxx'),
+(211, 9130, 1, 3, 1, 11, 11, 211, 211, 211, 211, 22, 23, 'DIAAAA', 'ENNAAA', 'OOOOxx'),
+(8993, 9131, 1, 1, 3, 13, 93, 993, 993, 3993, 8993, 186, 187, 'XHAAAA', 'FNNAAA', 'VVVVxx'),
+(4509, 9132, 1, 1, 9, 9, 9, 509, 509, 4509, 4509, 18, 19, 'LRAAAA', 'GNNAAA', 'AAAAxx'),
+(823, 9133, 1, 3, 3, 3, 23, 823, 823, 823, 823, 46, 47, 'RFAAAA', 'HNNAAA', 'HHHHxx'),
+(4747, 9134, 1, 3, 7, 7, 47, 747, 747, 4747, 4747, 94, 95, 'PAAAAA', 'INNAAA', 'OOOOxx'),
+(6955, 9135, 1, 3, 5, 15, 55, 955, 955, 1955, 6955, 110, 111, 'NHAAAA', 'JNNAAA', 'VVVVxx'),
+(7922, 9136, 0, 2, 2, 2, 22, 922, 1922, 2922, 7922, 44, 45, 'SSAAAA', 'KNNAAA', 'AAAAxx'),
+(6936, 9137, 0, 0, 6, 16, 36, 936, 936, 1936, 6936, 72, 73, 'UGAAAA', 'LNNAAA', 'HHHHxx'),
+(1546, 9138, 0, 2, 6, 6, 46, 546, 1546, 1546, 1546, 92, 93, 'MHAAAA', 'MNNAAA', 'OOOOxx'),
+(9836, 9139, 0, 0, 6, 16, 36, 836, 1836, 4836, 9836, 72, 73, 'IOAAAA', 'NNNAAA', 'VVVVxx'),
+(5626, 9140, 0, 2, 6, 6, 26, 626, 1626, 626, 5626, 52, 53, 'KIAAAA', 'ONNAAA', 'AAAAxx'),
+(4879, 9141, 1, 3, 9, 19, 79, 879, 879, 4879, 4879, 158, 159, 'RFAAAA', 'PNNAAA', 'HHHHxx'),
+(8590, 9142, 0, 2, 0, 10, 90, 590, 590, 3590, 8590, 180, 181, 'KSAAAA', 'QNNAAA', 'OOOOxx'),
+(8842, 9143, 0, 2, 2, 2, 42, 842, 842, 3842, 8842, 84, 85, 'CCAAAA', 'RNNAAA', 'VVVVxx'),
+(6505, 9144, 1, 1, 5, 5, 5, 505, 505, 1505, 6505, 10, 11, 'FQAAAA', 'SNNAAA', 'AAAAxx'),
+(2803, 9145, 1, 3, 3, 3, 3, 803, 803, 2803, 2803, 6, 7, 'VDAAAA', 'TNNAAA', 'HHHHxx'),
+(9258, 9146, 0, 2, 8, 18, 58, 258, 1258, 4258, 9258, 116, 117, 'CSAAAA', 'UNNAAA', 'OOOOxx'),
+(741, 9147, 1, 1, 1, 1, 41, 741, 741, 741, 741, 82, 83, 'NCAAAA', 'VNNAAA', 'VVVVxx'),
+(1457, 9148, 1, 1, 7, 17, 57, 457, 1457, 1457, 1457, 114, 115, 'BEAAAA', 'WNNAAA', 'AAAAxx'),
+(5777, 9149, 1, 1, 7, 17, 77, 777, 1777, 777, 5777, 154, 155, 'FOAAAA', 'XNNAAA', 'HHHHxx'),
+(2883, 9150, 1, 3, 3, 3, 83, 883, 883, 2883, 2883, 166, 167, 'XGAAAA', 'YNNAAA', 'OOOOxx'),
+(6610, 9151, 0, 2, 0, 10, 10, 610, 610, 1610, 6610, 20, 21, 'GUAAAA', 'ZNNAAA', 'VVVVxx'),
+(4331, 9152, 1, 3, 1, 11, 31, 331, 331, 4331, 4331, 62, 63, 'PKAAAA', 'AONAAA', 'AAAAxx'),
+(2712, 9153, 0, 0, 2, 12, 12, 712, 712, 2712, 2712, 24, 25, 'IAAAAA', 'BONAAA', 'HHHHxx'),
+(9268, 9154, 0, 0, 8, 8, 68, 268, 1268, 4268, 9268, 136, 137, 'MSAAAA', 'CONAAA', 'OOOOxx'),
+(410, 9155, 0, 2, 0, 10, 10, 410, 410, 410, 410, 20, 21, 'UPAAAA', 'DONAAA', 'VVVVxx'),
+(9411, 9156, 1, 3, 1, 11, 11, 411, 1411, 4411, 9411, 22, 23, 'ZXAAAA', 'EONAAA', 'AAAAxx'),
+(4683, 9157, 1, 3, 3, 3, 83, 683, 683, 4683, 4683, 166, 167, 'DYAAAA', 'FONAAA', 'HHHHxx'),
+(7072, 9158, 0, 0, 2, 12, 72, 72, 1072, 2072, 7072, 144, 145, 'AMAAAA', 'GONAAA', 'OOOOxx'),
+(5050, 9159, 0, 2, 0, 10, 50, 50, 1050, 50, 5050, 100, 101, 'GMAAAA', 'HONAAA', 'VVVVxx'),
+(5932, 9160, 0, 0, 2, 12, 32, 932, 1932, 932, 5932, 64, 65, 'EUAAAA', 'IONAAA', 'AAAAxx'),
+(2756, 9161, 0, 0, 6, 16, 56, 756, 756, 2756, 2756, 112, 113, 'ACAAAA', 'JONAAA', 'HHHHxx'),
+(9813, 9162, 1, 1, 3, 13, 13, 813, 1813, 4813, 9813, 26, 27, 'LNAAAA', 'KONAAA', 'OOOOxx'),
+(7388, 9163, 0, 0, 8, 8, 88, 388, 1388, 2388, 7388, 176, 177, 'EYAAAA', 'LONAAA', 'VVVVxx'),
+(2596, 9164, 0, 0, 6, 16, 96, 596, 596, 2596, 2596, 192, 193, 'WVAAAA', 'MONAAA', 'AAAAxx'),
+(5102, 9165, 0, 2, 2, 2, 2, 102, 1102, 102, 5102, 4, 5, 'GOAAAA', 'NONAAA', 'HHHHxx'),
+(208, 9166, 0, 0, 8, 8, 8, 208, 208, 208, 208, 16, 17, 'AIAAAA', 'OONAAA', 'OOOOxx'),
+(86, 9167, 0, 2, 6, 6, 86, 86, 86, 86, 86, 172, 173, 'IDAAAA', 'PONAAA', 'VVVVxx'),
+(8127, 9168, 1, 3, 7, 7, 27, 127, 127, 3127, 8127, 54, 55, 'PAAAAA', 'QONAAA', 'AAAAxx'),
+(5154, 9169, 0, 2, 4, 14, 54, 154, 1154, 154, 5154, 108, 109, 'GQAAAA', 'RONAAA', 'HHHHxx'),
+(4491, 9170, 1, 3, 1, 11, 91, 491, 491, 4491, 4491, 182, 183, 'TQAAAA', 'SONAAA', 'OOOOxx'),
+(7423, 9171, 1, 3, 3, 3, 23, 423, 1423, 2423, 7423, 46, 47, 'NZAAAA', 'TONAAA', 'VVVVxx'),
+(6441, 9172, 1, 1, 1, 1, 41, 441, 441, 1441, 6441, 82, 83, 'TNAAAA', 'UONAAA', 'AAAAxx'),
+(2920, 9173, 0, 0, 0, 0, 20, 920, 920, 2920, 2920, 40, 41, 'IIAAAA', 'VONAAA', 'HHHHxx'),
+(6386, 9174, 0, 2, 6, 6, 86, 386, 386, 1386, 6386, 172, 173, 'QLAAAA', 'WONAAA', 'OOOOxx'),
+(9744, 9175, 0, 0, 4, 4, 44, 744, 1744, 4744, 9744, 88, 89, 'UKAAAA', 'XONAAA', 'VVVVxx'),
+(2667, 9176, 1, 3, 7, 7, 67, 667, 667, 2667, 2667, 134, 135, 'PYAAAA', 'YONAAA', 'AAAAxx'),
+(5754, 9177, 0, 2, 4, 14, 54, 754, 1754, 754, 5754, 108, 109, 'INAAAA', 'ZONAAA', 'HHHHxx'),
+(4645, 9178, 1, 1, 5, 5, 45, 645, 645, 4645, 4645, 90, 91, 'RWAAAA', 'APNAAA', 'OOOOxx'),
+(4327, 9179, 1, 3, 7, 7, 27, 327, 327, 4327, 4327, 54, 55, 'LKAAAA', 'BPNAAA', 'VVVVxx'),
+(843, 9180, 1, 3, 3, 3, 43, 843, 843, 843, 843, 86, 87, 'LGAAAA', 'CPNAAA', 'AAAAxx'),
+(4085, 9181, 1, 1, 5, 5, 85, 85, 85, 4085, 4085, 170, 171, 'DBAAAA', 'DPNAAA', 'HHHHxx'),
+(2849, 9182, 1, 1, 9, 9, 49, 849, 849, 2849, 2849, 98, 99, 'PFAAAA', 'EPNAAA', 'OOOOxx'),
+(5734, 9183, 0, 2, 4, 14, 34, 734, 1734, 734, 5734, 68, 69, 'OMAAAA', 'FPNAAA', 'VVVVxx'),
+(5307, 9184, 1, 3, 7, 7, 7, 307, 1307, 307, 5307, 14, 15, 'DWAAAA', 'GPNAAA', 'AAAAxx'),
+(8433, 9185, 1, 1, 3, 13, 33, 433, 433, 3433, 8433, 66, 67, 'JMAAAA', 'HPNAAA', 'HHHHxx'),
+(3031, 9186, 1, 3, 1, 11, 31, 31, 1031, 3031, 3031, 62, 63, 'PMAAAA', 'IPNAAA', 'OOOOxx'),
+(5714, 9187, 0, 2, 4, 14, 14, 714, 1714, 714, 5714, 28, 29, 'ULAAAA', 'JPNAAA', 'VVVVxx'),
+(5969, 9188, 1, 1, 9, 9, 69, 969, 1969, 969, 5969, 138, 139, 'PVAAAA', 'KPNAAA', 'AAAAxx'),
+(2532, 9189, 0, 0, 2, 12, 32, 532, 532, 2532, 2532, 64, 65, 'KTAAAA', 'LPNAAA', 'HHHHxx'),
+(5219, 9190, 1, 3, 9, 19, 19, 219, 1219, 219, 5219, 38, 39, 'TSAAAA', 'MPNAAA', 'OOOOxx'),
+(7343, 9191, 1, 3, 3, 3, 43, 343, 1343, 2343, 7343, 86, 87, 'LWAAAA', 'NPNAAA', 'VVVVxx'),
+(9089, 9192, 1, 1, 9, 9, 89, 89, 1089, 4089, 9089, 178, 179, 'PLAAAA', 'OPNAAA', 'AAAAxx'),
+(9337, 9193, 1, 1, 7, 17, 37, 337, 1337, 4337, 9337, 74, 75, 'DVAAAA', 'PPNAAA', 'HHHHxx'),
+(5131, 9194, 1, 3, 1, 11, 31, 131, 1131, 131, 5131, 62, 63, 'JPAAAA', 'QPNAAA', 'OOOOxx'),
+(6253, 9195, 1, 1, 3, 13, 53, 253, 253, 1253, 6253, 106, 107, 'NGAAAA', 'RPNAAA', 'VVVVxx'),
+(5140, 9196, 0, 0, 0, 0, 40, 140, 1140, 140, 5140, 80, 81, 'SPAAAA', 'SPNAAA', 'AAAAxx'),
+(2953, 9197, 1, 1, 3, 13, 53, 953, 953, 2953, 2953, 106, 107, 'PJAAAA', 'TPNAAA', 'HHHHxx'),
+(4293, 9198, 1, 1, 3, 13, 93, 293, 293, 4293, 4293, 186, 187, 'DJAAAA', 'UPNAAA', 'OOOOxx'),
+(9974, 9199, 0, 2, 4, 14, 74, 974, 1974, 4974, 9974, 148, 149, 'QTAAAA', 'VPNAAA', 'VVVVxx'),
+(5061, 9200, 1, 1, 1, 1, 61, 61, 1061, 61, 5061, 122, 123, 'RMAAAA', 'WPNAAA', 'AAAAxx'),
+(8570, 9201, 0, 2, 0, 10, 70, 570, 570, 3570, 8570, 140, 141, 'QRAAAA', 'XPNAAA', 'HHHHxx'),
+(9504, 9202, 0, 0, 4, 4, 4, 504, 1504, 4504, 9504, 8, 9, 'OBAAAA', 'YPNAAA', 'OOOOxx'),
+(604, 9203, 0, 0, 4, 4, 4, 604, 604, 604, 604, 8, 9, 'GXAAAA', 'ZPNAAA', 'VVVVxx'),
+(4991, 9204, 1, 3, 1, 11, 91, 991, 991, 4991, 4991, 182, 183, 'ZJAAAA', 'AQNAAA', 'AAAAxx'),
+(880, 9205, 0, 0, 0, 0, 80, 880, 880, 880, 880, 160, 161, 'WHAAAA', 'BQNAAA', 'HHHHxx'),
+(3861, 9206, 1, 1, 1, 1, 61, 861, 1861, 3861, 3861, 122, 123, 'NSAAAA', 'CQNAAA', 'OOOOxx'),
+(8262, 9207, 0, 2, 2, 2, 62, 262, 262, 3262, 8262, 124, 125, 'UFAAAA', 'DQNAAA', 'VVVVxx'),
+(5689, 9208, 1, 1, 9, 9, 89, 689, 1689, 689, 5689, 178, 179, 'VKAAAA', 'EQNAAA', 'AAAAxx'),
+(1793, 9209, 1, 1, 3, 13, 93, 793, 1793, 1793, 1793, 186, 187, 'ZQAAAA', 'FQNAAA', 'HHHHxx'),
+(2661, 9210, 1, 1, 1, 1, 61, 661, 661, 2661, 2661, 122, 123, 'JYAAAA', 'GQNAAA', 'OOOOxx'),
+(7954, 9211, 0, 2, 4, 14, 54, 954, 1954, 2954, 7954, 108, 109, 'YTAAAA', 'HQNAAA', 'VVVVxx'),
+(1874, 9212, 0, 2, 4, 14, 74, 874, 1874, 1874, 1874, 148, 149, 'CUAAAA', 'IQNAAA', 'AAAAxx'),
+(2982, 9213, 0, 2, 2, 2, 82, 982, 982, 2982, 2982, 164, 165, 'SKAAAA', 'JQNAAA', 'HHHHxx'),
+(331, 9214, 1, 3, 1, 11, 31, 331, 331, 331, 331, 62, 63, 'TMAAAA', 'KQNAAA', 'OOOOxx'),
+(5021, 9215, 1, 1, 1, 1, 21, 21, 1021, 21, 5021, 42, 43, 'DLAAAA', 'LQNAAA', 'VVVVxx'),
+(9894, 9216, 0, 2, 4, 14, 94, 894, 1894, 4894, 9894, 188, 189, 'OQAAAA', 'MQNAAA', 'AAAAxx'),
+(7709, 9217, 1, 1, 9, 9, 9, 709, 1709, 2709, 7709, 18, 19, 'NKAAAA', 'NQNAAA', 'HHHHxx'),
+(4980, 9218, 0, 0, 0, 0, 80, 980, 980, 4980, 4980, 160, 161, 'OJAAAA', 'OQNAAA', 'OOOOxx'),
+(8249, 9219, 1, 1, 9, 9, 49, 249, 249, 3249, 8249, 98, 99, 'HFAAAA', 'PQNAAA', 'VVVVxx'),
+(7120, 9220, 0, 0, 0, 0, 20, 120, 1120, 2120, 7120, 40, 41, 'WNAAAA', 'QQNAAA', 'AAAAxx'),
+(7464, 9221, 0, 0, 4, 4, 64, 464, 1464, 2464, 7464, 128, 129, 'CBAAAA', 'RQNAAA', 'HHHHxx'),
+(8086, 9222, 0, 2, 6, 6, 86, 86, 86, 3086, 8086, 172, 173, 'AZAAAA', 'SQNAAA', 'OOOOxx'),
+(3509, 9223, 1, 1, 9, 9, 9, 509, 1509, 3509, 3509, 18, 19, 'ZEAAAA', 'TQNAAA', 'VVVVxx'),
+(3902, 9224, 0, 2, 2, 2, 2, 902, 1902, 3902, 3902, 4, 5, 'CUAAAA', 'UQNAAA', 'AAAAxx'),
+(9907, 9225, 1, 3, 7, 7, 7, 907, 1907, 4907, 9907, 14, 15, 'BRAAAA', 'VQNAAA', 'HHHHxx'),
+(6278, 9226, 0, 2, 8, 18, 78, 278, 278, 1278, 6278, 156, 157, 'MHAAAA', 'WQNAAA', 'OOOOxx'),
+(9316, 9227, 0, 0, 6, 16, 16, 316, 1316, 4316, 9316, 32, 33, 'IUAAAA', 'XQNAAA', 'VVVVxx'),
+(2824, 9228, 0, 0, 4, 4, 24, 824, 824, 2824, 2824, 48, 49, 'QEAAAA', 'YQNAAA', 'AAAAxx'),
+(1558, 9229, 0, 2, 8, 18, 58, 558, 1558, 1558, 1558, 116, 117, 'YHAAAA', 'ZQNAAA', 'HHHHxx'),
+(5436, 9230, 0, 0, 6, 16, 36, 436, 1436, 436, 5436, 72, 73, 'CBAAAA', 'ARNAAA', 'OOOOxx'),
+(1161, 9231, 1, 1, 1, 1, 61, 161, 1161, 1161, 1161, 122, 123, 'RSAAAA', 'BRNAAA', 'VVVVxx'),
+(7569, 9232, 1, 1, 9, 9, 69, 569, 1569, 2569, 7569, 138, 139, 'DFAAAA', 'CRNAAA', 'AAAAxx'),
+(9614, 9233, 0, 2, 4, 14, 14, 614, 1614, 4614, 9614, 28, 29, 'UFAAAA', 'DRNAAA', 'HHHHxx'),
+(6970, 9234, 0, 2, 0, 10, 70, 970, 970, 1970, 6970, 140, 141, 'CIAAAA', 'ERNAAA', 'OOOOxx'),
+(2422, 9235, 0, 2, 2, 2, 22, 422, 422, 2422, 2422, 44, 45, 'EPAAAA', 'FRNAAA', 'VVVVxx'),
+(8860, 9236, 0, 0, 0, 0, 60, 860, 860, 3860, 8860, 120, 121, 'UCAAAA', 'GRNAAA', 'AAAAxx'),
+(9912, 9237, 0, 0, 2, 12, 12, 912, 1912, 4912, 9912, 24, 25, 'GRAAAA', 'HRNAAA', 'HHHHxx'),
+(1109, 9238, 1, 1, 9, 9, 9, 109, 1109, 1109, 1109, 18, 19, 'RQAAAA', 'IRNAAA', 'OOOOxx'),
+(3286, 9239, 0, 2, 6, 6, 86, 286, 1286, 3286, 3286, 172, 173, 'KWAAAA', 'JRNAAA', 'VVVVxx'),
+(2277, 9240, 1, 1, 7, 17, 77, 277, 277, 2277, 2277, 154, 155, 'PJAAAA', 'KRNAAA', 'AAAAxx'),
+(8656, 9241, 0, 0, 6, 16, 56, 656, 656, 3656, 8656, 112, 113, 'YUAAAA', 'LRNAAA', 'HHHHxx'),
+(4656, 9242, 0, 0, 6, 16, 56, 656, 656, 4656, 4656, 112, 113, 'CXAAAA', 'MRNAAA', 'OOOOxx'),
+(6965, 9243, 1, 1, 5, 5, 65, 965, 965, 1965, 6965, 130, 131, 'XHAAAA', 'NRNAAA', 'VVVVxx'),
+(7591, 9244, 1, 3, 1, 11, 91, 591, 1591, 2591, 7591, 182, 183, 'ZFAAAA', 'ORNAAA', 'AAAAxx'),
+(4883, 9245, 1, 3, 3, 3, 83, 883, 883, 4883, 4883, 166, 167, 'VFAAAA', 'PRNAAA', 'HHHHxx'),
+(452, 9246, 0, 0, 2, 12, 52, 452, 452, 452, 452, 104, 105, 'KRAAAA', 'QRNAAA', 'OOOOxx'),
+(4018, 9247, 0, 2, 8, 18, 18, 18, 18, 4018, 4018, 36, 37, 'OYAAAA', 'RRNAAA', 'VVVVxx'),
+(4066, 9248, 0, 2, 6, 6, 66, 66, 66, 4066, 4066, 132, 133, 'KAAAAA', 'SRNAAA', 'AAAAxx'),
+(6480, 9249, 0, 0, 0, 0, 80, 480, 480, 1480, 6480, 160, 161, 'GPAAAA', 'TRNAAA', 'HHHHxx'),
+(8634, 9250, 0, 2, 4, 14, 34, 634, 634, 3634, 8634, 68, 69, 'CUAAAA', 'URNAAA', 'OOOOxx'),
+(9387, 9251, 1, 3, 7, 7, 87, 387, 1387, 4387, 9387, 174, 175, 'BXAAAA', 'VRNAAA', 'VVVVxx'),
+(3476, 9252, 0, 0, 6, 16, 76, 476, 1476, 3476, 3476, 152, 153, 'SDAAAA', 'WRNAAA', 'AAAAxx'),
+(5995, 9253, 1, 3, 5, 15, 95, 995, 1995, 995, 5995, 190, 191, 'PWAAAA', 'XRNAAA', 'HHHHxx'),
+(9677, 9254, 1, 1, 7, 17, 77, 677, 1677, 4677, 9677, 154, 155, 'FIAAAA', 'YRNAAA', 'OOOOxx'),
+(3884, 9255, 0, 0, 4, 4, 84, 884, 1884, 3884, 3884, 168, 169, 'KTAAAA', 'ZRNAAA', 'VVVVxx'),
+(6500, 9256, 0, 0, 0, 0, 0, 500, 500, 1500, 6500, 0, 1, 'AQAAAA', 'ASNAAA', 'AAAAxx'),
+(7972, 9257, 0, 0, 2, 12, 72, 972, 1972, 2972, 7972, 144, 145, 'QUAAAA', 'BSNAAA', 'HHHHxx'),
+(5281, 9258, 1, 1, 1, 1, 81, 281, 1281, 281, 5281, 162, 163, 'DVAAAA', 'CSNAAA', 'OOOOxx'),
+(1288, 9259, 0, 0, 8, 8, 88, 288, 1288, 1288, 1288, 176, 177, 'OXAAAA', 'DSNAAA', 'VVVVxx'),
+(4366, 9260, 0, 2, 6, 6, 66, 366, 366, 4366, 4366, 132, 133, 'YLAAAA', 'ESNAAA', 'AAAAxx'),
+(6557, 9261, 1, 1, 7, 17, 57, 557, 557, 1557, 6557, 114, 115, 'FSAAAA', 'FSNAAA', 'HHHHxx'),
+(7086, 9262, 0, 2, 6, 6, 86, 86, 1086, 2086, 7086, 172, 173, 'OMAAAA', 'GSNAAA', 'OOOOxx'),
+(6588, 9263, 0, 0, 8, 8, 88, 588, 588, 1588, 6588, 176, 177, 'KTAAAA', 'HSNAAA', 'VVVVxx'),
+(9062, 9264, 0, 2, 2, 2, 62, 62, 1062, 4062, 9062, 124, 125, 'OKAAAA', 'ISNAAA', 'AAAAxx'),
+(9230, 9265, 0, 2, 0, 10, 30, 230, 1230, 4230, 9230, 60, 61, 'ARAAAA', 'JSNAAA', 'HHHHxx'),
+(7672, 9266, 0, 0, 2, 12, 72, 672, 1672, 2672, 7672, 144, 145, 'CJAAAA', 'KSNAAA', 'OOOOxx'),
+(5204, 9267, 0, 0, 4, 4, 4, 204, 1204, 204, 5204, 8, 9, 'ESAAAA', 'LSNAAA', 'VVVVxx'),
+(2836, 9268, 0, 0, 6, 16, 36, 836, 836, 2836, 2836, 72, 73, 'CFAAAA', 'MSNAAA', 'AAAAxx'),
+(7165, 9269, 1, 1, 5, 5, 65, 165, 1165, 2165, 7165, 130, 131, 'PPAAAA', 'NSNAAA', 'HHHHxx'),
+(971, 9270, 1, 3, 1, 11, 71, 971, 971, 971, 971, 142, 143, 'JLAAAA', 'OSNAAA', 'OOOOxx'),
+(3851, 9271, 1, 3, 1, 11, 51, 851, 1851, 3851, 3851, 102, 103, 'DSAAAA', 'PSNAAA', 'VVVVxx'),
+(8593, 9272, 1, 1, 3, 13, 93, 593, 593, 3593, 8593, 186, 187, 'NSAAAA', 'QSNAAA', 'AAAAxx'),
+(7742, 9273, 0, 2, 2, 2, 42, 742, 1742, 2742, 7742, 84, 85, 'ULAAAA', 'RSNAAA', 'HHHHxx'),
+(2887, 9274, 1, 3, 7, 7, 87, 887, 887, 2887, 2887, 174, 175, 'BHAAAA', 'SSNAAA', 'OOOOxx'),
+(8479, 9275, 1, 3, 9, 19, 79, 479, 479, 3479, 8479, 158, 159, 'DOAAAA', 'TSNAAA', 'VVVVxx'),
+(9514, 9276, 0, 2, 4, 14, 14, 514, 1514, 4514, 9514, 28, 29, 'YBAAAA', 'USNAAA', 'AAAAxx'),
+(273, 9277, 1, 1, 3, 13, 73, 273, 273, 273, 273, 146, 147, 'NKAAAA', 'VSNAAA', 'HHHHxx'),
+(2938, 9278, 0, 2, 8, 18, 38, 938, 938, 2938, 2938, 76, 77, 'AJAAAA', 'WSNAAA', 'OOOOxx'),
+(9793, 9279, 1, 1, 3, 13, 93, 793, 1793, 4793, 9793, 186, 187, 'RMAAAA', 'XSNAAA', 'VVVVxx'),
+(8050, 9280, 0, 2, 0, 10, 50, 50, 50, 3050, 8050, 100, 101, 'QXAAAA', 'YSNAAA', 'AAAAxx'),
+(6702, 9281, 0, 2, 2, 2, 2, 702, 702, 1702, 6702, 4, 5, 'UXAAAA', 'ZSNAAA', 'HHHHxx'),
+(7290, 9282, 0, 2, 0, 10, 90, 290, 1290, 2290, 7290, 180, 181, 'KUAAAA', 'ATNAAA', 'OOOOxx'),
+(1837, 9283, 1, 1, 7, 17, 37, 837, 1837, 1837, 1837, 74, 75, 'RSAAAA', 'BTNAAA', 'VVVVxx'),
+(3206, 9284, 0, 2, 6, 6, 6, 206, 1206, 3206, 3206, 12, 13, 'ITAAAA', 'CTNAAA', 'AAAAxx'),
+(4925, 9285, 1, 1, 5, 5, 25, 925, 925, 4925, 4925, 50, 51, 'LHAAAA', 'DTNAAA', 'HHHHxx'),
+(5066, 9286, 0, 2, 6, 6, 66, 66, 1066, 66, 5066, 132, 133, 'WMAAAA', 'ETNAAA', 'OOOOxx'),
+(3401, 9287, 1, 1, 1, 1, 1, 401, 1401, 3401, 3401, 2, 3, 'VAAAAA', 'FTNAAA', 'VVVVxx'),
+(3474, 9288, 0, 2, 4, 14, 74, 474, 1474, 3474, 3474, 148, 149, 'QDAAAA', 'GTNAAA', 'AAAAxx'),
+(57, 9289, 1, 1, 7, 17, 57, 57, 57, 57, 57, 114, 115, 'FCAAAA', 'HTNAAA', 'HHHHxx'),
+(2082, 9290, 0, 2, 2, 2, 82, 82, 82, 2082, 2082, 164, 165, 'CCAAAA', 'ITNAAA', 'OOOOxx'),
+(100, 9291, 0, 0, 0, 0, 0, 100, 100, 100, 100, 0, 1, 'WDAAAA', 'JTNAAA', 'VVVVxx'),
+(9665, 9292, 1, 1, 5, 5, 65, 665, 1665, 4665, 9665, 130, 131, 'THAAAA', 'KTNAAA', 'AAAAxx'),
+(8284, 9293, 0, 0, 4, 4, 84, 284, 284, 3284, 8284, 168, 169, 'QGAAAA', 'LTNAAA', 'HHHHxx'),
+(958, 9294, 0, 2, 8, 18, 58, 958, 958, 958, 958, 116, 117, 'WKAAAA', 'MTNAAA', 'OOOOxx'),
+(5282, 9295, 0, 2, 2, 2, 82, 282, 1282, 282, 5282, 164, 165, 'EVAAAA', 'NTNAAA', 'VVVVxx'),
+(4257, 9296, 1, 1, 7, 17, 57, 257, 257, 4257, 4257, 114, 115, 'THAAAA', 'OTNAAA', 'AAAAxx'),
+(3160, 9297, 0, 0, 0, 0, 60, 160, 1160, 3160, 3160, 120, 121, 'ORAAAA', 'PTNAAA', 'HHHHxx'),
+(8449, 9298, 1, 1, 9, 9, 49, 449, 449, 3449, 8449, 98, 99, 'ZMAAAA', 'QTNAAA', 'OOOOxx'),
+(500, 9299, 0, 0, 0, 0, 0, 500, 500, 500, 500, 0, 1, 'GTAAAA', 'RTNAAA', 'VVVVxx'),
+(6432, 9300, 0, 0, 2, 12, 32, 432, 432, 1432, 6432, 64, 65, 'KNAAAA', 'STNAAA', 'AAAAxx'),
+(6220, 9301, 0, 0, 0, 0, 20, 220, 220, 1220, 6220, 40, 41, 'GFAAAA', 'TTNAAA', 'HHHHxx'),
+(7233, 9302, 1, 1, 3, 13, 33, 233, 1233, 2233, 7233, 66, 67, 'FSAAAA', 'UTNAAA', 'OOOOxx'),
+(2723, 9303, 1, 3, 3, 3, 23, 723, 723, 2723, 2723, 46, 47, 'TAAAAA', 'VTNAAA', 'VVVVxx'),
+(1899, 9304, 1, 3, 9, 19, 99, 899, 1899, 1899, 1899, 198, 199, 'BVAAAA', 'WTNAAA', 'AAAAxx'),
+(7158, 9305, 0, 2, 8, 18, 58, 158, 1158, 2158, 7158, 116, 117, 'IPAAAA', 'XTNAAA', 'HHHHxx'),
+(202, 9306, 0, 2, 2, 2, 2, 202, 202, 202, 202, 4, 5, 'UHAAAA', 'YTNAAA', 'OOOOxx'),
+(2286, 9307, 0, 2, 6, 6, 86, 286, 286, 2286, 2286, 172, 173, 'YJAAAA', 'ZTNAAA', 'VVVVxx'),
+(5356, 9308, 0, 0, 6, 16, 56, 356, 1356, 356, 5356, 112, 113, 'AYAAAA', 'AUNAAA', 'AAAAxx'),
+(3809, 9309, 1, 1, 9, 9, 9, 809, 1809, 3809, 3809, 18, 19, 'NQAAAA', 'BUNAAA', 'HHHHxx'),
+(3979, 9310, 1, 3, 9, 19, 79, 979, 1979, 3979, 3979, 158, 159, 'BXAAAA', 'CUNAAA', 'OOOOxx'),
+(8359, 9311, 1, 3, 9, 19, 59, 359, 359, 3359, 8359, 118, 119, 'NJAAAA', 'DUNAAA', 'VVVVxx'),
+(3479, 9312, 1, 3, 9, 19, 79, 479, 1479, 3479, 3479, 158, 159, 'VDAAAA', 'EUNAAA', 'AAAAxx'),
+(4895, 9313, 1, 3, 5, 15, 95, 895, 895, 4895, 4895, 190, 191, 'HGAAAA', 'FUNAAA', 'HHHHxx'),
+(6059, 9314, 1, 3, 9, 19, 59, 59, 59, 1059, 6059, 118, 119, 'BZAAAA', 'GUNAAA', 'OOOOxx'),
+(9560, 9315, 0, 0, 0, 0, 60, 560, 1560, 4560, 9560, 120, 121, 'SDAAAA', 'HUNAAA', 'VVVVxx'),
+(6756, 9316, 0, 0, 6, 16, 56, 756, 756, 1756, 6756, 112, 113, 'WZAAAA', 'IUNAAA', 'AAAAxx'),
+(7504, 9317, 0, 0, 4, 4, 4, 504, 1504, 2504, 7504, 8, 9, 'QCAAAA', 'JUNAAA', 'HHHHxx'),
+(6762, 9318, 0, 2, 2, 2, 62, 762, 762, 1762, 6762, 124, 125, 'CAAAAA', 'KUNAAA', 'OOOOxx'),
+(5304, 9319, 0, 0, 4, 4, 4, 304, 1304, 304, 5304, 8, 9, 'AWAAAA', 'LUNAAA', 'VVVVxx'),
+(9533, 9320, 1, 1, 3, 13, 33, 533, 1533, 4533, 9533, 66, 67, 'RCAAAA', 'MUNAAA', 'AAAAxx'),
+(6649, 9321, 1, 1, 9, 9, 49, 649, 649, 1649, 6649, 98, 99, 'TVAAAA', 'NUNAAA', 'HHHHxx'),
+(38, 9322, 0, 2, 8, 18, 38, 38, 38, 38, 38, 76, 77, 'MBAAAA', 'OUNAAA', 'OOOOxx'),
+(5713, 9323, 1, 1, 3, 13, 13, 713, 1713, 713, 5713, 26, 27, 'TLAAAA', 'PUNAAA', 'VVVVxx'),
+(3000, 9324, 0, 0, 0, 0, 0, 0, 1000, 3000, 3000, 0, 1, 'KLAAAA', 'QUNAAA', 'AAAAxx'),
+(3738, 9325, 0, 2, 8, 18, 38, 738, 1738, 3738, 3738, 76, 77, 'UNAAAA', 'RUNAAA', 'HHHHxx'),
+(3327, 9326, 1, 3, 7, 7, 27, 327, 1327, 3327, 3327, 54, 55, 'ZXAAAA', 'SUNAAA', 'OOOOxx'),
+(3922, 9327, 0, 2, 2, 2, 22, 922, 1922, 3922, 3922, 44, 45, 'WUAAAA', 'TUNAAA', 'VVVVxx'),
+(9245, 9328, 1, 1, 5, 5, 45, 245, 1245, 4245, 9245, 90, 91, 'PRAAAA', 'UUNAAA', 'AAAAxx'),
+(2172, 9329, 0, 0, 2, 12, 72, 172, 172, 2172, 2172, 144, 145, 'OFAAAA', 'VUNAAA', 'HHHHxx'),
+(7128, 9330, 0, 0, 8, 8, 28, 128, 1128, 2128, 7128, 56, 57, 'EOAAAA', 'WUNAAA', 'OOOOxx'),
+(1195, 9331, 1, 3, 5, 15, 95, 195, 1195, 1195, 1195, 190, 191, 'ZTAAAA', 'XUNAAA', 'VVVVxx'),
+(8445, 9332, 1, 1, 5, 5, 45, 445, 445, 3445, 8445, 90, 91, 'VMAAAA', 'YUNAAA', 'AAAAxx'),
+(8638, 9333, 0, 2, 8, 18, 38, 638, 638, 3638, 8638, 76, 77, 'GUAAAA', 'ZUNAAA', 'HHHHxx'),
+(1249, 9334, 1, 1, 9, 9, 49, 249, 1249, 1249, 1249, 98, 99, 'BWAAAA', 'AVNAAA', 'OOOOxx'),
+(8659, 9335, 1, 3, 9, 19, 59, 659, 659, 3659, 8659, 118, 119, 'BVAAAA', 'BVNAAA', 'VVVVxx'),
+(3556, 9336, 0, 0, 6, 16, 56, 556, 1556, 3556, 3556, 112, 113, 'UGAAAA', 'CVNAAA', 'AAAAxx'),
+(3347, 9337, 1, 3, 7, 7, 47, 347, 1347, 3347, 3347, 94, 95, 'TYAAAA', 'DVNAAA', 'HHHHxx'),
+(3260, 9338, 0, 0, 0, 0, 60, 260, 1260, 3260, 3260, 120, 121, 'KVAAAA', 'EVNAAA', 'OOOOxx'),
+(5139, 9339, 1, 3, 9, 19, 39, 139, 1139, 139, 5139, 78, 79, 'RPAAAA', 'FVNAAA', 'VVVVxx'),
+(9991, 9340, 1, 3, 1, 11, 91, 991, 1991, 4991, 9991, 182, 183, 'HUAAAA', 'GVNAAA', 'AAAAxx'),
+(5499, 9341, 1, 3, 9, 19, 99, 499, 1499, 499, 5499, 198, 199, 'NDAAAA', 'HVNAAA', 'HHHHxx'),
+(8082, 9342, 0, 2, 2, 2, 82, 82, 82, 3082, 8082, 164, 165, 'WYAAAA', 'IVNAAA', 'OOOOxx'),
+(1640, 9343, 0, 0, 0, 0, 40, 640, 1640, 1640, 1640, 80, 81, 'CLAAAA', 'JVNAAA', 'VVVVxx'),
+(8726, 9344, 0, 2, 6, 6, 26, 726, 726, 3726, 8726, 52, 53, 'QXAAAA', 'KVNAAA', 'AAAAxx'),
+(2339, 9345, 1, 3, 9, 19, 39, 339, 339, 2339, 2339, 78, 79, 'ZLAAAA', 'LVNAAA', 'HHHHxx'),
+(2601, 9346, 1, 1, 1, 1, 1, 601, 601, 2601, 2601, 2, 3, 'BWAAAA', 'MVNAAA', 'OOOOxx'),
+(9940, 9347, 0, 0, 0, 0, 40, 940, 1940, 4940, 9940, 80, 81, 'ISAAAA', 'NVNAAA', 'VVVVxx'),
+(4185, 9348, 1, 1, 5, 5, 85, 185, 185, 4185, 4185, 170, 171, 'ZEAAAA', 'OVNAAA', 'AAAAxx'),
+(9546, 9349, 0, 2, 6, 6, 46, 546, 1546, 4546, 9546, 92, 93, 'EDAAAA', 'PVNAAA', 'HHHHxx'),
+(5218, 9350, 0, 2, 8, 18, 18, 218, 1218, 218, 5218, 36, 37, 'SSAAAA', 'QVNAAA', 'OOOOxx'),
+(4374, 9351, 0, 2, 4, 14, 74, 374, 374, 4374, 4374, 148, 149, 'GMAAAA', 'RVNAAA', 'VVVVxx'),
+(288, 9352, 0, 0, 8, 8, 88, 288, 288, 288, 288, 176, 177, 'CLAAAA', 'SVNAAA', 'AAAAxx'),
+(7445, 9353, 1, 1, 5, 5, 45, 445, 1445, 2445, 7445, 90, 91, 'JAAAAA', 'TVNAAA', 'HHHHxx'),
+(1710, 9354, 0, 2, 0, 10, 10, 710, 1710, 1710, 1710, 20, 21, 'UNAAAA', 'UVNAAA', 'OOOOxx'),
+(6409, 9355, 1, 1, 9, 9, 9, 409, 409, 1409, 6409, 18, 19, 'NMAAAA', 'VVNAAA', 'VVVVxx'),
+(7982, 9356, 0, 2, 2, 2, 82, 982, 1982, 2982, 7982, 164, 165, 'AVAAAA', 'WVNAAA', 'AAAAxx'),
+(4950, 9357, 0, 2, 0, 10, 50, 950, 950, 4950, 4950, 100, 101, 'KIAAAA', 'XVNAAA', 'HHHHxx'),
+(9242, 9358, 0, 2, 2, 2, 42, 242, 1242, 4242, 9242, 84, 85, 'MRAAAA', 'YVNAAA', 'OOOOxx'),
+(3272, 9359, 0, 0, 2, 12, 72, 272, 1272, 3272, 3272, 144, 145, 'WVAAAA', 'ZVNAAA', 'VVVVxx'),
+(739, 9360, 1, 3, 9, 19, 39, 739, 739, 739, 739, 78, 79, 'LCAAAA', 'AWNAAA', 'AAAAxx'),
+(5526, 9361, 0, 2, 6, 6, 26, 526, 1526, 526, 5526, 52, 53, 'OEAAAA', 'BWNAAA', 'HHHHxx'),
+(8189, 9362, 1, 1, 9, 9, 89, 189, 189, 3189, 8189, 178, 179, 'ZCAAAA', 'CWNAAA', 'OOOOxx'),
+(9106, 9363, 0, 2, 6, 6, 6, 106, 1106, 4106, 9106, 12, 13, 'GMAAAA', 'DWNAAA', 'VVVVxx'),
+(9775, 9364, 1, 3, 5, 15, 75, 775, 1775, 4775, 9775, 150, 151, 'ZLAAAA', 'EWNAAA', 'AAAAxx'),
+(4643, 9365, 1, 3, 3, 3, 43, 643, 643, 4643, 4643, 86, 87, 'PWAAAA', 'FWNAAA', 'HHHHxx'),
+(8396, 9366, 0, 0, 6, 16, 96, 396, 396, 3396, 8396, 192, 193, 'YKAAAA', 'GWNAAA', 'OOOOxx'),
+(3255, 9367, 1, 3, 5, 15, 55, 255, 1255, 3255, 3255, 110, 111, 'FVAAAA', 'HWNAAA', 'VVVVxx'),
+(301, 9368, 1, 1, 1, 1, 1, 301, 301, 301, 301, 2, 3, 'PLAAAA', 'IWNAAA', 'AAAAxx'),
+(6014, 9369, 0, 2, 4, 14, 14, 14, 14, 1014, 6014, 28, 29, 'IXAAAA', 'JWNAAA', 'HHHHxx'),
+(6046, 9370, 0, 2, 6, 6, 46, 46, 46, 1046, 6046, 92, 93, 'OYAAAA', 'KWNAAA', 'OOOOxx'),
+(984, 9371, 0, 0, 4, 4, 84, 984, 984, 984, 984, 168, 169, 'WLAAAA', 'LWNAAA', 'VVVVxx'),
+(2420, 9372, 0, 0, 0, 0, 20, 420, 420, 2420, 2420, 40, 41, 'CPAAAA', 'MWNAAA', 'AAAAxx'),
+(2922, 9373, 0, 2, 2, 2, 22, 922, 922, 2922, 2922, 44, 45, 'KIAAAA', 'NWNAAA', 'HHHHxx'),
+(2317, 9374, 1, 1, 7, 17, 17, 317, 317, 2317, 2317, 34, 35, 'DLAAAA', 'OWNAAA', 'OOOOxx'),
+(7332, 9375, 0, 0, 2, 12, 32, 332, 1332, 2332, 7332, 64, 65, 'AWAAAA', 'PWNAAA', 'VVVVxx'),
+(6451, 9376, 1, 3, 1, 11, 51, 451, 451, 1451, 6451, 102, 103, 'DOAAAA', 'QWNAAA', 'AAAAxx'),
+(2589, 9377, 1, 1, 9, 9, 89, 589, 589, 2589, 2589, 178, 179, 'PVAAAA', 'RWNAAA', 'HHHHxx'),
+(4333, 9378, 1, 1, 3, 13, 33, 333, 333, 4333, 4333, 66, 67, 'RKAAAA', 'SWNAAA', 'OOOOxx'),
+(8650, 9379, 0, 2, 0, 10, 50, 650, 650, 3650, 8650, 100, 101, 'SUAAAA', 'TWNAAA', 'VVVVxx'),
+(6856, 9380, 0, 0, 6, 16, 56, 856, 856, 1856, 6856, 112, 113, 'SDAAAA', 'UWNAAA', 'AAAAxx'),
+(4194, 9381, 0, 2, 4, 14, 94, 194, 194, 4194, 4194, 188, 189, 'IFAAAA', 'VWNAAA', 'HHHHxx'),
+(6246, 9382, 0, 2, 6, 6, 46, 246, 246, 1246, 6246, 92, 93, 'GGAAAA', 'WWNAAA', 'OOOOxx'),
+(4371, 9383, 1, 3, 1, 11, 71, 371, 371, 4371, 4371, 142, 143, 'DMAAAA', 'XWNAAA', 'VVVVxx'),
+(1388, 9384, 0, 0, 8, 8, 88, 388, 1388, 1388, 1388, 176, 177, 'KBAAAA', 'YWNAAA', 'AAAAxx'),
+(1056, 9385, 0, 0, 6, 16, 56, 56, 1056, 1056, 1056, 112, 113, 'QOAAAA', 'ZWNAAA', 'HHHHxx'),
+(6041, 9386, 1, 1, 1, 1, 41, 41, 41, 1041, 6041, 82, 83, 'JYAAAA', 'AXNAAA', 'OOOOxx'),
+(6153, 9387, 1, 1, 3, 13, 53, 153, 153, 1153, 6153, 106, 107, 'RCAAAA', 'BXNAAA', 'VVVVxx'),
+(8450, 9388, 0, 2, 0, 10, 50, 450, 450, 3450, 8450, 100, 101, 'ANAAAA', 'CXNAAA', 'AAAAxx'),
+(3469, 9389, 1, 1, 9, 9, 69, 469, 1469, 3469, 3469, 138, 139, 'LDAAAA', 'DXNAAA', 'HHHHxx'),
+(5226, 9390, 0, 2, 6, 6, 26, 226, 1226, 226, 5226, 52, 53, 'ATAAAA', 'EXNAAA', 'OOOOxx'),
+(8112, 9391, 0, 0, 2, 12, 12, 112, 112, 3112, 8112, 24, 25, 'AAAAAA', 'FXNAAA', 'VVVVxx'),
+(647, 9392, 1, 3, 7, 7, 47, 647, 647, 647, 647, 94, 95, 'XYAAAA', 'GXNAAA', 'AAAAxx'),
+(2567, 9393, 1, 3, 7, 7, 67, 567, 567, 2567, 2567, 134, 135, 'TUAAAA', 'HXNAAA', 'HHHHxx'),
+(9064, 9394, 0, 0, 4, 4, 64, 64, 1064, 4064, 9064, 128, 129, 'QKAAAA', 'IXNAAA', 'OOOOxx'),
+(5161, 9395, 1, 1, 1, 1, 61, 161, 1161, 161, 5161, 122, 123, 'NQAAAA', 'JXNAAA', 'VVVVxx'),
+(5260, 9396, 0, 0, 0, 0, 60, 260, 1260, 260, 5260, 120, 121, 'IUAAAA', 'KXNAAA', 'AAAAxx'),
+(8988, 9397, 0, 0, 8, 8, 88, 988, 988, 3988, 8988, 176, 177, 'SHAAAA', 'LXNAAA', 'HHHHxx'),
+(9678, 9398, 0, 2, 8, 18, 78, 678, 1678, 4678, 9678, 156, 157, 'GIAAAA', 'MXNAAA', 'OOOOxx'),
+(6853, 9399, 1, 1, 3, 13, 53, 853, 853, 1853, 6853, 106, 107, 'PDAAAA', 'NXNAAA', 'VVVVxx'),
+(5294, 9400, 0, 2, 4, 14, 94, 294, 1294, 294, 5294, 188, 189, 'QVAAAA', 'OXNAAA', 'AAAAxx'),
+(9864, 9401, 0, 0, 4, 4, 64, 864, 1864, 4864, 9864, 128, 129, 'KPAAAA', 'PXNAAA', 'HHHHxx'),
+(8702, 9402, 0, 2, 2, 2, 2, 702, 702, 3702, 8702, 4, 5, 'SWAAAA', 'QXNAAA', 'OOOOxx'),
+(1132, 9403, 0, 0, 2, 12, 32, 132, 1132, 1132, 1132, 64, 65, 'ORAAAA', 'RXNAAA', 'VVVVxx'),
+(1524, 9404, 0, 0, 4, 4, 24, 524, 1524, 1524, 1524, 48, 49, 'QGAAAA', 'SXNAAA', 'AAAAxx'),
+(4560, 9405, 0, 0, 0, 0, 60, 560, 560, 4560, 4560, 120, 121, 'KTAAAA', 'TXNAAA', 'HHHHxx'),
+(2137, 9406, 1, 1, 7, 17, 37, 137, 137, 2137, 2137, 74, 75, 'FEAAAA', 'UXNAAA', 'OOOOxx'),
+(3283, 9407, 1, 3, 3, 3, 83, 283, 1283, 3283, 3283, 166, 167, 'HWAAAA', 'VXNAAA', 'VVVVxx'),
+(3377, 9408, 1, 1, 7, 17, 77, 377, 1377, 3377, 3377, 154, 155, 'XZAAAA', 'WXNAAA', 'AAAAxx'),
+(2267, 9409, 1, 3, 7, 7, 67, 267, 267, 2267, 2267, 134, 135, 'FJAAAA', 'XXNAAA', 'HHHHxx'),
+(8987, 9410, 1, 3, 7, 7, 87, 987, 987, 3987, 8987, 174, 175, 'RHAAAA', 'YXNAAA', 'OOOOxx'),
+(6709, 9411, 1, 1, 9, 9, 9, 709, 709, 1709, 6709, 18, 19, 'BYAAAA', 'ZXNAAA', 'VVVVxx'),
+(8059, 9412, 1, 3, 9, 19, 59, 59, 59, 3059, 8059, 118, 119, 'ZXAAAA', 'AYNAAA', 'AAAAxx'),
+(3402, 9413, 0, 2, 2, 2, 2, 402, 1402, 3402, 3402, 4, 5, 'WAAAAA', 'BYNAAA', 'HHHHxx'),
+(6443, 9414, 1, 3, 3, 3, 43, 443, 443, 1443, 6443, 86, 87, 'VNAAAA', 'CYNAAA', 'OOOOxx'),
+(8858, 9415, 0, 2, 8, 18, 58, 858, 858, 3858, 8858, 116, 117, 'SCAAAA', 'DYNAAA', 'VVVVxx'),
+(3974, 9416, 0, 2, 4, 14, 74, 974, 1974, 3974, 3974, 148, 149, 'WWAAAA', 'EYNAAA', 'AAAAxx'),
+(3521, 9417, 1, 1, 1, 1, 21, 521, 1521, 3521, 3521, 42, 43, 'LFAAAA', 'FYNAAA', 'HHHHxx'),
+(9509, 9418, 1, 1, 9, 9, 9, 509, 1509, 4509, 9509, 18, 19, 'TBAAAA', 'GYNAAA', 'OOOOxx'),
+(5442, 9419, 0, 2, 2, 2, 42, 442, 1442, 442, 5442, 84, 85, 'IBAAAA', 'HYNAAA', 'VVVVxx'),
+(8968, 9420, 0, 0, 8, 8, 68, 968, 968, 3968, 8968, 136, 137, 'YGAAAA', 'IYNAAA', 'AAAAxx'),
+(333, 9421, 1, 1, 3, 13, 33, 333, 333, 333, 333, 66, 67, 'VMAAAA', 'JYNAAA', 'HHHHxx'),
+(952, 9422, 0, 0, 2, 12, 52, 952, 952, 952, 952, 104, 105, 'QKAAAA', 'KYNAAA', 'OOOOxx'),
+(7482, 9423, 0, 2, 2, 2, 82, 482, 1482, 2482, 7482, 164, 165, 'UBAAAA', 'LYNAAA', 'VVVVxx'),
+(1486, 9424, 0, 2, 6, 6, 86, 486, 1486, 1486, 1486, 172, 173, 'EFAAAA', 'MYNAAA', 'AAAAxx'),
+(1815, 9425, 1, 3, 5, 15, 15, 815, 1815, 1815, 1815, 30, 31, 'VRAAAA', 'NYNAAA', 'HHHHxx'),
+(7937, 9426, 1, 1, 7, 17, 37, 937, 1937, 2937, 7937, 74, 75, 'HTAAAA', 'OYNAAA', 'OOOOxx'),
+(1436, 9427, 0, 0, 6, 16, 36, 436, 1436, 1436, 1436, 72, 73, 'GDAAAA', 'PYNAAA', 'VVVVxx'),
+(3470, 9428, 0, 2, 0, 10, 70, 470, 1470, 3470, 3470, 140, 141, 'MDAAAA', 'QYNAAA', 'AAAAxx'),
+(8195, 9429, 1, 3, 5, 15, 95, 195, 195, 3195, 8195, 190, 191, 'FDAAAA', 'RYNAAA', 'HHHHxx'),
+(6906, 9430, 0, 2, 6, 6, 6, 906, 906, 1906, 6906, 12, 13, 'QFAAAA', 'SYNAAA', 'OOOOxx'),
+(2539, 9431, 1, 3, 9, 19, 39, 539, 539, 2539, 2539, 78, 79, 'RTAAAA', 'TYNAAA', 'VVVVxx'),
+(5988, 9432, 0, 0, 8, 8, 88, 988, 1988, 988, 5988, 176, 177, 'IWAAAA', 'UYNAAA', 'AAAAxx'),
+(8908, 9433, 0, 0, 8, 8, 8, 908, 908, 3908, 8908, 16, 17, 'QEAAAA', 'VYNAAA', 'HHHHxx'),
+(2319, 9434, 1, 3, 9, 19, 19, 319, 319, 2319, 2319, 38, 39, 'FLAAAA', 'WYNAAA', 'OOOOxx'),
+(3263, 9435, 1, 3, 3, 3, 63, 263, 1263, 3263, 3263, 126, 127, 'NVAAAA', 'XYNAAA', 'VVVVxx'),
+(4039, 9436, 1, 3, 9, 19, 39, 39, 39, 4039, 4039, 78, 79, 'JZAAAA', 'YYNAAA', 'AAAAxx'),
+(6373, 9437, 1, 1, 3, 13, 73, 373, 373, 1373, 6373, 146, 147, 'DLAAAA', 'ZYNAAA', 'HHHHxx'),
+(1168, 9438, 0, 0, 8, 8, 68, 168, 1168, 1168, 1168, 136, 137, 'YSAAAA', 'AZNAAA', 'OOOOxx'),
+(8338, 9439, 0, 2, 8, 18, 38, 338, 338, 3338, 8338, 76, 77, 'SIAAAA', 'BZNAAA', 'VVVVxx'),
+(1172, 9440, 0, 0, 2, 12, 72, 172, 1172, 1172, 1172, 144, 145, 'CTAAAA', 'CZNAAA', 'AAAAxx'),
+(200, 9441, 0, 0, 0, 0, 0, 200, 200, 200, 200, 0, 1, 'SHAAAA', 'DZNAAA', 'HHHHxx'),
+(6355, 9442, 1, 3, 5, 15, 55, 355, 355, 1355, 6355, 110, 111, 'LKAAAA', 'EZNAAA', 'OOOOxx'),
+(7768, 9443, 0, 0, 8, 8, 68, 768, 1768, 2768, 7768, 136, 137, 'UMAAAA', 'FZNAAA', 'VVVVxx'),
+(25, 9444, 1, 1, 5, 5, 25, 25, 25, 25, 25, 50, 51, 'ZAAAAA', 'GZNAAA', 'AAAAxx'),
+(7144, 9445, 0, 0, 4, 4, 44, 144, 1144, 2144, 7144, 88, 89, 'UOAAAA', 'HZNAAA', 'HHHHxx'),
+(8671, 9446, 1, 3, 1, 11, 71, 671, 671, 3671, 8671, 142, 143, 'NVAAAA', 'IZNAAA', 'OOOOxx'),
+(9163, 9447, 1, 3, 3, 3, 63, 163, 1163, 4163, 9163, 126, 127, 'LOAAAA', 'JZNAAA', 'VVVVxx'),
+(8889, 9448, 1, 1, 9, 9, 89, 889, 889, 3889, 8889, 178, 179, 'XDAAAA', 'KZNAAA', 'AAAAxx'),
+(5950, 9449, 0, 2, 0, 10, 50, 950, 1950, 950, 5950, 100, 101, 'WUAAAA', 'LZNAAA', 'HHHHxx'),
+(6163, 9450, 1, 3, 3, 3, 63, 163, 163, 1163, 6163, 126, 127, 'BDAAAA', 'MZNAAA', 'OOOOxx'),
+(8119, 9451, 1, 3, 9, 19, 19, 119, 119, 3119, 8119, 38, 39, 'HAAAAA', 'NZNAAA', 'VVVVxx'),
+(1416, 9452, 0, 0, 6, 16, 16, 416, 1416, 1416, 1416, 32, 33, 'MCAAAA', 'OZNAAA', 'AAAAxx'),
+(4132, 9453, 0, 0, 2, 12, 32, 132, 132, 4132, 4132, 64, 65, 'YCAAAA', 'PZNAAA', 'HHHHxx'),
+(2294, 9454, 0, 2, 4, 14, 94, 294, 294, 2294, 2294, 188, 189, 'GKAAAA', 'QZNAAA', 'OOOOxx'),
+(9094, 9455, 0, 2, 4, 14, 94, 94, 1094, 4094, 9094, 188, 189, 'ULAAAA', 'RZNAAA', 'VVVVxx'),
+(4168, 9456, 0, 0, 8, 8, 68, 168, 168, 4168, 4168, 136, 137, 'IEAAAA', 'SZNAAA', 'AAAAxx'),
+(9108, 9457, 0, 0, 8, 8, 8, 108, 1108, 4108, 9108, 16, 17, 'IMAAAA', 'TZNAAA', 'HHHHxx'),
+(5706, 9458, 0, 2, 6, 6, 6, 706, 1706, 706, 5706, 12, 13, 'MLAAAA', 'UZNAAA', 'OOOOxx'),
+(2231, 9459, 1, 3, 1, 11, 31, 231, 231, 2231, 2231, 62, 63, 'VHAAAA', 'VZNAAA', 'VVVVxx'),
+(2173, 9460, 1, 1, 3, 13, 73, 173, 173, 2173, 2173, 146, 147, 'PFAAAA', 'WZNAAA', 'AAAAxx'),
+(90, 9461, 0, 2, 0, 10, 90, 90, 90, 90, 90, 180, 181, 'MDAAAA', 'XZNAAA', 'HHHHxx'),
+(9996, 9462, 0, 0, 6, 16, 96, 996, 1996, 4996, 9996, 192, 193, 'MUAAAA', 'YZNAAA', 'OOOOxx'),
+(330, 9463, 0, 2, 0, 10, 30, 330, 330, 330, 330, 60, 61, 'SMAAAA', 'ZZNAAA', 'VVVVxx'),
+(2052, 9464, 0, 0, 2, 12, 52, 52, 52, 2052, 2052, 104, 105, 'YAAAAA', 'AAOAAA', 'AAAAxx'),
+(1093, 9465, 1, 1, 3, 13, 93, 93, 1093, 1093, 1093, 186, 187, 'BQAAAA', 'BAOAAA', 'HHHHxx'),
+(5817, 9466, 1, 1, 7, 17, 17, 817, 1817, 817, 5817, 34, 35, 'TPAAAA', 'CAOAAA', 'OOOOxx'),
+(1559, 9467, 1, 3, 9, 19, 59, 559, 1559, 1559, 1559, 118, 119, 'ZHAAAA', 'DAOAAA', 'VVVVxx'),
+(8405, 9468, 1, 1, 5, 5, 5, 405, 405, 3405, 8405, 10, 11, 'HLAAAA', 'EAOAAA', 'AAAAxx'),
+(9962, 9469, 0, 2, 2, 2, 62, 962, 1962, 4962, 9962, 124, 125, 'ETAAAA', 'FAOAAA', 'HHHHxx'),
+(9461, 9470, 1, 1, 1, 1, 61, 461, 1461, 4461, 9461, 122, 123, 'XZAAAA', 'GAOAAA', 'OOOOxx'),
+(3028, 9471, 0, 0, 8, 8, 28, 28, 1028, 3028, 3028, 56, 57, 'MMAAAA', 'HAOAAA', 'VVVVxx'),
+(6814, 9472, 0, 2, 4, 14, 14, 814, 814, 1814, 6814, 28, 29, 'CCAAAA', 'IAOAAA', 'AAAAxx'),
+(9587, 9473, 1, 3, 7, 7, 87, 587, 1587, 4587, 9587, 174, 175, 'TEAAAA', 'JAOAAA', 'HHHHxx'),
+(6863, 9474, 1, 3, 3, 3, 63, 863, 863, 1863, 6863, 126, 127, 'ZDAAAA', 'KAOAAA', 'OOOOxx'),
+(4963, 9475, 1, 3, 3, 3, 63, 963, 963, 4963, 4963, 126, 127, 'XIAAAA', 'LAOAAA', 'VVVVxx'),
+(7811, 9476, 1, 3, 1, 11, 11, 811, 1811, 2811, 7811, 22, 23, 'LOAAAA', 'MAOAAA', 'AAAAxx'),
+(7608, 9477, 0, 0, 8, 8, 8, 608, 1608, 2608, 7608, 16, 17, 'QGAAAA', 'NAOAAA', 'HHHHxx'),
+(5321, 9478, 1, 1, 1, 1, 21, 321, 1321, 321, 5321, 42, 43, 'RWAAAA', 'OAOAAA', 'OOOOxx'),
+(9971, 9479, 1, 3, 1, 11, 71, 971, 1971, 4971, 9971, 142, 143, 'NTAAAA', 'PAOAAA', 'VVVVxx'),
+(6161, 9480, 1, 1, 1, 1, 61, 161, 161, 1161, 6161, 122, 123, 'ZCAAAA', 'QAOAAA', 'AAAAxx'),
+(2181, 9481, 1, 1, 1, 1, 81, 181, 181, 2181, 2181, 162, 163, 'XFAAAA', 'RAOAAA', 'HHHHxx'),
+(3828, 9482, 0, 0, 8, 8, 28, 828, 1828, 3828, 3828, 56, 57, 'GRAAAA', 'SAOAAA', 'OOOOxx'),
+(348, 9483, 0, 0, 8, 8, 48, 348, 348, 348, 348, 96, 97, 'KNAAAA', 'TAOAAA', 'VVVVxx'),
+(5459, 9484, 1, 3, 9, 19, 59, 459, 1459, 459, 5459, 118, 119, 'ZBAAAA', 'UAOAAA', 'AAAAxx'),
+(9406, 9485, 0, 2, 6, 6, 6, 406, 1406, 4406, 9406, 12, 13, 'UXAAAA', 'VAOAAA', 'HHHHxx'),
+(9852, 9486, 0, 0, 2, 12, 52, 852, 1852, 4852, 9852, 104, 105, 'YOAAAA', 'WAOAAA', 'OOOOxx'),
+(3095, 9487, 1, 3, 5, 15, 95, 95, 1095, 3095, 3095, 190, 191, 'BPAAAA', 'XAOAAA', 'VVVVxx'),
+(5597, 9488, 1, 1, 7, 17, 97, 597, 1597, 597, 5597, 194, 195, 'HHAAAA', 'YAOAAA', 'AAAAxx'),
+(8841, 9489, 1, 1, 1, 1, 41, 841, 841, 3841, 8841, 82, 83, 'BCAAAA', 'ZAOAAA', 'HHHHxx'),
+(3536, 9490, 0, 0, 6, 16, 36, 536, 1536, 3536, 3536, 72, 73, 'AGAAAA', 'ABOAAA', 'OOOOxx'),
+(4009, 9491, 1, 1, 9, 9, 9, 9, 9, 4009, 4009, 18, 19, 'FYAAAA', 'BBOAAA', 'VVVVxx'),
+(7366, 9492, 0, 2, 6, 6, 66, 366, 1366, 2366, 7366, 132, 133, 'IXAAAA', 'CBOAAA', 'AAAAxx'),
+(7327, 9493, 1, 3, 7, 7, 27, 327, 1327, 2327, 7327, 54, 55, 'VVAAAA', 'DBOAAA', 'HHHHxx'),
+(1613, 9494, 1, 1, 3, 13, 13, 613, 1613, 1613, 1613, 26, 27, 'BKAAAA', 'EBOAAA', 'OOOOxx'),
+(8619, 9495, 1, 3, 9, 19, 19, 619, 619, 3619, 8619, 38, 39, 'NTAAAA', 'FBOAAA', 'VVVVxx'),
+(4880, 9496, 0, 0, 0, 0, 80, 880, 880, 4880, 4880, 160, 161, 'SFAAAA', 'GBOAAA', 'AAAAxx'),
+(1552, 9497, 0, 0, 2, 12, 52, 552, 1552, 1552, 1552, 104, 105, 'SHAAAA', 'HBOAAA', 'HHHHxx'),
+(7636, 9498, 0, 0, 6, 16, 36, 636, 1636, 2636, 7636, 72, 73, 'SHAAAA', 'IBOAAA', 'OOOOxx'),
+(8397, 9499, 1, 1, 7, 17, 97, 397, 397, 3397, 8397, 194, 195, 'ZKAAAA', 'JBOAAA', 'VVVVxx'),
+(6224, 9500, 0, 0, 4, 4, 24, 224, 224, 1224, 6224, 48, 49, 'KFAAAA', 'KBOAAA', 'AAAAxx'),
+(9102, 9501, 0, 2, 2, 2, 2, 102, 1102, 4102, 9102, 4, 5, 'CMAAAA', 'LBOAAA', 'HHHHxx'),
+(7906, 9502, 0, 2, 6, 6, 6, 906, 1906, 2906, 7906, 12, 13, 'CSAAAA', 'MBOAAA', 'OOOOxx'),
+(9467, 9503, 1, 3, 7, 7, 67, 467, 1467, 4467, 9467, 134, 135, 'DAAAAA', 'NBOAAA', 'VVVVxx'),
+(828, 9504, 0, 0, 8, 8, 28, 828, 828, 828, 828, 56, 57, 'WFAAAA', 'OBOAAA', 'AAAAxx'),
+(9585, 9505, 1, 1, 5, 5, 85, 585, 1585, 4585, 9585, 170, 171, 'REAAAA', 'PBOAAA', 'HHHHxx'),
+(925, 9506, 1, 1, 5, 5, 25, 925, 925, 925, 925, 50, 51, 'PJAAAA', 'QBOAAA', 'OOOOxx'),
+(7375, 9507, 1, 3, 5, 15, 75, 375, 1375, 2375, 7375, 150, 151, 'RXAAAA', 'RBOAAA', 'VVVVxx'),
+(4027, 9508, 1, 3, 7, 7, 27, 27, 27, 4027, 4027, 54, 55, 'XYAAAA', 'SBOAAA', 'AAAAxx'),
+(766, 9509, 0, 2, 6, 6, 66, 766, 766, 766, 766, 132, 133, 'MDAAAA', 'TBOAAA', 'HHHHxx'),
+(5633, 9510, 1, 1, 3, 13, 33, 633, 1633, 633, 5633, 66, 67, 'RIAAAA', 'UBOAAA', 'OOOOxx'),
+(5648, 9511, 0, 0, 8, 8, 48, 648, 1648, 648, 5648, 96, 97, 'GJAAAA', 'VBOAAA', 'VVVVxx'),
+(148, 9512, 0, 0, 8, 8, 48, 148, 148, 148, 148, 96, 97, 'SFAAAA', 'WBOAAA', 'AAAAxx'),
+(2072, 9513, 0, 0, 2, 12, 72, 72, 72, 2072, 2072, 144, 145, 'SBAAAA', 'XBOAAA', 'HHHHxx'),
+(431, 9514, 1, 3, 1, 11, 31, 431, 431, 431, 431, 62, 63, 'PQAAAA', 'YBOAAA', 'OOOOxx'),
+(1711, 9515, 1, 3, 1, 11, 11, 711, 1711, 1711, 1711, 22, 23, 'VNAAAA', 'ZBOAAA', 'VVVVxx'),
+(9378, 9516, 0, 2, 8, 18, 78, 378, 1378, 4378, 9378, 156, 157, 'SWAAAA', 'ACOAAA', 'AAAAxx'),
+(6776, 9517, 0, 0, 6, 16, 76, 776, 776, 1776, 6776, 152, 153, 'QAAAAA', 'BCOAAA', 'HHHHxx'),
+(6842, 9518, 0, 2, 2, 2, 42, 842, 842, 1842, 6842, 84, 85, 'EDAAAA', 'CCOAAA', 'OOOOxx'),
+(2656, 9519, 0, 0, 6, 16, 56, 656, 656, 2656, 2656, 112, 113, 'EYAAAA', 'DCOAAA', 'VVVVxx'),
+(3116, 9520, 0, 0, 6, 16, 16, 116, 1116, 3116, 3116, 32, 33, 'WPAAAA', 'ECOAAA', 'AAAAxx'),
+(7904, 9521, 0, 0, 4, 4, 4, 904, 1904, 2904, 7904, 8, 9, 'ASAAAA', 'FCOAAA', 'HHHHxx'),
+(3529, 9522, 1, 1, 9, 9, 29, 529, 1529, 3529, 3529, 58, 59, 'TFAAAA', 'GCOAAA', 'OOOOxx'),
+(3240, 9523, 0, 0, 0, 0, 40, 240, 1240, 3240, 3240, 80, 81, 'QUAAAA', 'HCOAAA', 'VVVVxx'),
+(5801, 9524, 1, 1, 1, 1, 1, 801, 1801, 801, 5801, 2, 3, 'DPAAAA', 'ICOAAA', 'AAAAxx'),
+(4090, 9525, 0, 2, 0, 10, 90, 90, 90, 4090, 4090, 180, 181, 'IBAAAA', 'JCOAAA', 'HHHHxx'),
+(7687, 9526, 1, 3, 7, 7, 87, 687, 1687, 2687, 7687, 174, 175, 'RJAAAA', 'KCOAAA', 'OOOOxx'),
+(9711, 9527, 1, 3, 1, 11, 11, 711, 1711, 4711, 9711, 22, 23, 'NJAAAA', 'LCOAAA', 'VVVVxx'),
+(4760, 9528, 0, 0, 0, 0, 60, 760, 760, 4760, 4760, 120, 121, 'CBAAAA', 'MCOAAA', 'AAAAxx'),
+(5524, 9529, 0, 0, 4, 4, 24, 524, 1524, 524, 5524, 48, 49, 'MEAAAA', 'NCOAAA', 'HHHHxx'),
+(2251, 9530, 1, 3, 1, 11, 51, 251, 251, 2251, 2251, 102, 103, 'PIAAAA', 'OCOAAA', 'OOOOxx'),
+(1511, 9531, 1, 3, 1, 11, 11, 511, 1511, 1511, 1511, 22, 23, 'DGAAAA', 'PCOAAA', 'VVVVxx'),
+(5991, 9532, 1, 3, 1, 11, 91, 991, 1991, 991, 5991, 182, 183, 'LWAAAA', 'QCOAAA', 'AAAAxx'),
+(7808, 9533, 0, 0, 8, 8, 8, 808, 1808, 2808, 7808, 16, 17, 'IOAAAA', 'RCOAAA', 'HHHHxx'),
+(8708, 9534, 0, 0, 8, 8, 8, 708, 708, 3708, 8708, 16, 17, 'YWAAAA', 'SCOAAA', 'OOOOxx'),
+(8939, 9535, 1, 3, 9, 19, 39, 939, 939, 3939, 8939, 78, 79, 'VFAAAA', 'TCOAAA', 'VVVVxx'),
+(4295, 9536, 1, 3, 5, 15, 95, 295, 295, 4295, 4295, 190, 191, 'FJAAAA', 'UCOAAA', 'AAAAxx'),
+(5905, 9537, 1, 1, 5, 5, 5, 905, 1905, 905, 5905, 10, 11, 'DTAAAA', 'VCOAAA', 'HHHHxx'),
+(2649, 9538, 1, 1, 9, 9, 49, 649, 649, 2649, 2649, 98, 99, 'XXAAAA', 'WCOAAA', 'OOOOxx'),
+(2347, 9539, 1, 3, 7, 7, 47, 347, 347, 2347, 2347, 94, 95, 'HMAAAA', 'XCOAAA', 'VVVVxx'),
+(6339, 9540, 1, 3, 9, 19, 39, 339, 339, 1339, 6339, 78, 79, 'VJAAAA', 'YCOAAA', 'AAAAxx'),
+(292, 9541, 0, 0, 2, 12, 92, 292, 292, 292, 292, 184, 185, 'GLAAAA', 'ZCOAAA', 'HHHHxx'),
+(9314, 9542, 0, 2, 4, 14, 14, 314, 1314, 4314, 9314, 28, 29, 'GUAAAA', 'ADOAAA', 'OOOOxx'),
+(6893, 9543, 1, 1, 3, 13, 93, 893, 893, 1893, 6893, 186, 187, 'DFAAAA', 'BDOAAA', 'VVVVxx'),
+(3970, 9544, 0, 2, 0, 10, 70, 970, 1970, 3970, 3970, 140, 141, 'SWAAAA', 'CDOAAA', 'AAAAxx'),
+(1652, 9545, 0, 0, 2, 12, 52, 652, 1652, 1652, 1652, 104, 105, 'OLAAAA', 'DDOAAA', 'HHHHxx'),
+(4326, 9546, 0, 2, 6, 6, 26, 326, 326, 4326, 4326, 52, 53, 'KKAAAA', 'EDOAAA', 'OOOOxx'),
+(7881, 9547, 1, 1, 1, 1, 81, 881, 1881, 2881, 7881, 162, 163, 'DRAAAA', 'FDOAAA', 'VVVVxx'),
+(5291, 9548, 1, 3, 1, 11, 91, 291, 1291, 291, 5291, 182, 183, 'NVAAAA', 'GDOAAA', 'AAAAxx'),
+(957, 9549, 1, 1, 7, 17, 57, 957, 957, 957, 957, 114, 115, 'VKAAAA', 'HDOAAA', 'HHHHxx'),
+(2313, 9550, 1, 1, 3, 13, 13, 313, 313, 2313, 2313, 26, 27, 'ZKAAAA', 'IDOAAA', 'OOOOxx'),
+(5463, 9551, 1, 3, 3, 3, 63, 463, 1463, 463, 5463, 126, 127, 'DCAAAA', 'JDOAAA', 'VVVVxx'),
+(1268, 9552, 0, 0, 8, 8, 68, 268, 1268, 1268, 1268, 136, 137, 'UWAAAA', 'KDOAAA', 'AAAAxx'),
+(5028, 9553, 0, 0, 8, 8, 28, 28, 1028, 28, 5028, 56, 57, 'KLAAAA', 'LDOAAA', 'HHHHxx'),
+(656, 9554, 0, 0, 6, 16, 56, 656, 656, 656, 656, 112, 113, 'GZAAAA', 'MDOAAA', 'OOOOxx'),
+(9274, 9555, 0, 2, 4, 14, 74, 274, 1274, 4274, 9274, 148, 149, 'SSAAAA', 'NDOAAA', 'VVVVxx'),
+(8217, 9556, 1, 1, 7, 17, 17, 217, 217, 3217, 8217, 34, 35, 'BEAAAA', 'ODOAAA', 'AAAAxx'),
+(2175, 9557, 1, 3, 5, 15, 75, 175, 175, 2175, 2175, 150, 151, 'RFAAAA', 'PDOAAA', 'HHHHxx'),
+(6028, 9558, 0, 0, 8, 8, 28, 28, 28, 1028, 6028, 56, 57, 'WXAAAA', 'QDOAAA', 'OOOOxx'),
+(7584, 9559, 0, 0, 4, 4, 84, 584, 1584, 2584, 7584, 168, 169, 'SFAAAA', 'RDOAAA', 'VVVVxx'),
+(4114, 9560, 0, 2, 4, 14, 14, 114, 114, 4114, 4114, 28, 29, 'GCAAAA', 'SDOAAA', 'AAAAxx'),
+(8894, 9561, 0, 2, 4, 14, 94, 894, 894, 3894, 8894, 188, 189, 'CEAAAA', 'TDOAAA', 'HHHHxx'),
+(781, 9562, 1, 1, 1, 1, 81, 781, 781, 781, 781, 162, 163, 'BEAAAA', 'UDOAAA', 'OOOOxx'),
+(133, 9563, 1, 1, 3, 13, 33, 133, 133, 133, 133, 66, 67, 'DFAAAA', 'VDOAAA', 'VVVVxx'),
+(7572, 9564, 0, 0, 2, 12, 72, 572, 1572, 2572, 7572, 144, 145, 'GFAAAA', 'WDOAAA', 'AAAAxx'),
+(8514, 9565, 0, 2, 4, 14, 14, 514, 514, 3514, 8514, 28, 29, 'MPAAAA', 'XDOAAA', 'HHHHxx'),
+(3352, 9566, 0, 0, 2, 12, 52, 352, 1352, 3352, 3352, 104, 105, 'YYAAAA', 'YDOAAA', 'OOOOxx'),
+(8098, 9567, 0, 2, 8, 18, 98, 98, 98, 3098, 8098, 196, 197, 'MZAAAA', 'ZDOAAA', 'VVVVxx'),
+(9116, 9568, 0, 0, 6, 16, 16, 116, 1116, 4116, 9116, 32, 33, 'QMAAAA', 'AEOAAA', 'AAAAxx'),
+(9444, 9569, 0, 0, 4, 4, 44, 444, 1444, 4444, 9444, 88, 89, 'GZAAAA', 'BEOAAA', 'HHHHxx'),
+(2590, 9570, 0, 2, 0, 10, 90, 590, 590, 2590, 2590, 180, 181, 'QVAAAA', 'CEOAAA', 'OOOOxx'),
+(7302, 9571, 0, 2, 2, 2, 2, 302, 1302, 2302, 7302, 4, 5, 'WUAAAA', 'DEOAAA', 'VVVVxx'),
+(7444, 9572, 0, 0, 4, 4, 44, 444, 1444, 2444, 7444, 88, 89, 'IAAAAA', 'EEOAAA', 'AAAAxx'),
+(8748, 9573, 0, 0, 8, 8, 48, 748, 748, 3748, 8748, 96, 97, 'MYAAAA', 'FEOAAA', 'HHHHxx'),
+(7615, 9574, 1, 3, 5, 15, 15, 615, 1615, 2615, 7615, 30, 31, 'XGAAAA', 'GEOAAA', 'OOOOxx'),
+(6090, 9575, 0, 2, 0, 10, 90, 90, 90, 1090, 6090, 180, 181, 'GAAAAA', 'HEOAAA', 'VVVVxx'),
+(1529, 9576, 1, 1, 9, 9, 29, 529, 1529, 1529, 1529, 58, 59, 'VGAAAA', 'IEOAAA', 'AAAAxx'),
+(9398, 9577, 0, 2, 8, 18, 98, 398, 1398, 4398, 9398, 196, 197, 'MXAAAA', 'JEOAAA', 'HHHHxx'),
+(6114, 9578, 0, 2, 4, 14, 14, 114, 114, 1114, 6114, 28, 29, 'EBAAAA', 'KEOAAA', 'OOOOxx'),
+(2736, 9579, 0, 0, 6, 16, 36, 736, 736, 2736, 2736, 72, 73, 'GBAAAA', 'LEOAAA', 'VVVVxx'),
+(468, 9580, 0, 0, 8, 8, 68, 468, 468, 468, 468, 136, 137, 'ASAAAA', 'MEOAAA', 'AAAAxx'),
+(1487, 9581, 1, 3, 7, 7, 87, 487, 1487, 1487, 1487, 174, 175, 'FFAAAA', 'NEOAAA', 'HHHHxx'),
+(4784, 9582, 0, 0, 4, 4, 84, 784, 784, 4784, 4784, 168, 169, 'ACAAAA', 'OEOAAA', 'OOOOxx'),
+(6731, 9583, 1, 3, 1, 11, 31, 731, 731, 1731, 6731, 62, 63, 'XYAAAA', 'PEOAAA', 'VVVVxx'),
+(3328, 9584, 0, 0, 8, 8, 28, 328, 1328, 3328, 3328, 56, 57, 'AYAAAA', 'QEOAAA', 'AAAAxx'),
+(6891, 9585, 1, 3, 1, 11, 91, 891, 891, 1891, 6891, 182, 183, 'BFAAAA', 'REOAAA', 'HHHHxx'),
+(8039, 9586, 1, 3, 9, 19, 39, 39, 39, 3039, 8039, 78, 79, 'FXAAAA', 'SEOAAA', 'OOOOxx'),
+(4064, 9587, 0, 0, 4, 4, 64, 64, 64, 4064, 4064, 128, 129, 'IAAAAA', 'TEOAAA', 'VVVVxx'),
+(542, 9588, 0, 2, 2, 2, 42, 542, 542, 542, 542, 84, 85, 'WUAAAA', 'UEOAAA', 'AAAAxx'),
+(1039, 9589, 1, 3, 9, 19, 39, 39, 1039, 1039, 1039, 78, 79, 'ZNAAAA', 'VEOAAA', 'HHHHxx'),
+(5603, 9590, 1, 3, 3, 3, 3, 603, 1603, 603, 5603, 6, 7, 'NHAAAA', 'WEOAAA', 'OOOOxx'),
+(6641, 9591, 1, 1, 1, 1, 41, 641, 641, 1641, 6641, 82, 83, 'LVAAAA', 'XEOAAA', 'VVVVxx'),
+(6307, 9592, 1, 3, 7, 7, 7, 307, 307, 1307, 6307, 14, 15, 'PIAAAA', 'YEOAAA', 'AAAAxx'),
+(5354, 9593, 0, 2, 4, 14, 54, 354, 1354, 354, 5354, 108, 109, 'YXAAAA', 'ZEOAAA', 'HHHHxx'),
+(7878, 9594, 0, 2, 8, 18, 78, 878, 1878, 2878, 7878, 156, 157, 'ARAAAA', 'AFOAAA', 'OOOOxx'),
+(6391, 9595, 1, 3, 1, 11, 91, 391, 391, 1391, 6391, 182, 183, 'VLAAAA', 'BFOAAA', 'VVVVxx'),
+(4575, 9596, 1, 3, 5, 15, 75, 575, 575, 4575, 4575, 150, 151, 'ZTAAAA', 'CFOAAA', 'AAAAxx'),
+(6644, 9597, 0, 0, 4, 4, 44, 644, 644, 1644, 6644, 88, 89, 'OVAAAA', 'DFOAAA', 'HHHHxx'),
+(5207, 9598, 1, 3, 7, 7, 7, 207, 1207, 207, 5207, 14, 15, 'HSAAAA', 'EFOAAA', 'OOOOxx'),
+(1736, 9599, 0, 0, 6, 16, 36, 736, 1736, 1736, 1736, 72, 73, 'UOAAAA', 'FFOAAA', 'VVVVxx'),
+(3547, 9600, 1, 3, 7, 7, 47, 547, 1547, 3547, 3547, 94, 95, 'LGAAAA', 'GFOAAA', 'AAAAxx'),
+(6647, 9601, 1, 3, 7, 7, 47, 647, 647, 1647, 6647, 94, 95, 'RVAAAA', 'HFOAAA', 'HHHHxx'),
+(4107, 9602, 1, 3, 7, 7, 7, 107, 107, 4107, 4107, 14, 15, 'ZBAAAA', 'IFOAAA', 'OOOOxx'),
+(8125, 9603, 1, 1, 5, 5, 25, 125, 125, 3125, 8125, 50, 51, 'NAAAAA', 'JFOAAA', 'VVVVxx'),
+(9223, 9604, 1, 3, 3, 3, 23, 223, 1223, 4223, 9223, 46, 47, 'TQAAAA', 'KFOAAA', 'AAAAxx'),
+(6903, 9605, 1, 3, 3, 3, 3, 903, 903, 1903, 6903, 6, 7, 'NFAAAA', 'LFOAAA', 'HHHHxx'),
+(3639, 9606, 1, 3, 9, 19, 39, 639, 1639, 3639, 3639, 78, 79, 'ZJAAAA', 'MFOAAA', 'OOOOxx'),
+(9606, 9607, 0, 2, 6, 6, 6, 606, 1606, 4606, 9606, 12, 13, 'MFAAAA', 'NFOAAA', 'VVVVxx'),
+(3232, 9608, 0, 0, 2, 12, 32, 232, 1232, 3232, 3232, 64, 65, 'IUAAAA', 'OFOAAA', 'AAAAxx'),
+(2063, 9609, 1, 3, 3, 3, 63, 63, 63, 2063, 2063, 126, 127, 'JBAAAA', 'PFOAAA', 'HHHHxx'),
+(3731, 9610, 1, 3, 1, 11, 31, 731, 1731, 3731, 3731, 62, 63, 'NNAAAA', 'QFOAAA', 'OOOOxx'),
+(2558, 9611, 0, 2, 8, 18, 58, 558, 558, 2558, 2558, 116, 117, 'KUAAAA', 'RFOAAA', 'VVVVxx'),
+(2357, 9612, 1, 1, 7, 17, 57, 357, 357, 2357, 2357, 114, 115, 'RMAAAA', 'SFOAAA', 'AAAAxx'),
+(6008, 9613, 0, 0, 8, 8, 8, 8, 8, 1008, 6008, 16, 17, 'CXAAAA', 'TFOAAA', 'HHHHxx'),
+(8246, 9614, 0, 2, 6, 6, 46, 246, 246, 3246, 8246, 92, 93, 'EFAAAA', 'UFOAAA', 'OOOOxx'),
+(8220, 9615, 0, 0, 0, 0, 20, 220, 220, 3220, 8220, 40, 41, 'EEAAAA', 'VFOAAA', 'VVVVxx'),
+(1075, 9616, 1, 3, 5, 15, 75, 75, 1075, 1075, 1075, 150, 151, 'JPAAAA', 'WFOAAA', 'AAAAxx'),
+(2410, 9617, 0, 2, 0, 10, 10, 410, 410, 2410, 2410, 20, 21, 'SOAAAA', 'XFOAAA', 'HHHHxx'),
+(3253, 9618, 1, 1, 3, 13, 53, 253, 1253, 3253, 3253, 106, 107, 'DVAAAA', 'YFOAAA', 'OOOOxx'),
+(4370, 9619, 0, 2, 0, 10, 70, 370, 370, 4370, 4370, 140, 141, 'CMAAAA', 'ZFOAAA', 'VVVVxx'),
+(8426, 9620, 0, 2, 6, 6, 26, 426, 426, 3426, 8426, 52, 53, 'CMAAAA', 'AGOAAA', 'AAAAxx'),
+(2262, 9621, 0, 2, 2, 2, 62, 262, 262, 2262, 2262, 124, 125, 'AJAAAA', 'BGOAAA', 'HHHHxx'),
+(4149, 9622, 1, 1, 9, 9, 49, 149, 149, 4149, 4149, 98, 99, 'PDAAAA', 'CGOAAA', 'OOOOxx'),
+(2732, 9623, 0, 0, 2, 12, 32, 732, 732, 2732, 2732, 64, 65, 'CBAAAA', 'DGOAAA', 'VVVVxx'),
+(8606, 9624, 0, 2, 6, 6, 6, 606, 606, 3606, 8606, 12, 13, 'ATAAAA', 'EGOAAA', 'AAAAxx'),
+(6311, 9625, 1, 3, 1, 11, 11, 311, 311, 1311, 6311, 22, 23, 'TIAAAA', 'FGOAAA', 'HHHHxx'),
+(7223, 9626, 1, 3, 3, 3, 23, 223, 1223, 2223, 7223, 46, 47, 'VRAAAA', 'GGOAAA', 'OOOOxx'),
+(3054, 9627, 0, 2, 4, 14, 54, 54, 1054, 3054, 3054, 108, 109, 'MNAAAA', 'HGOAAA', 'VVVVxx'),
+(3952, 9628, 0, 0, 2, 12, 52, 952, 1952, 3952, 3952, 104, 105, 'AWAAAA', 'IGOAAA', 'AAAAxx'),
+(8252, 9629, 0, 0, 2, 12, 52, 252, 252, 3252, 8252, 104, 105, 'KFAAAA', 'JGOAAA', 'HHHHxx'),
+(6020, 9630, 0, 0, 0, 0, 20, 20, 20, 1020, 6020, 40, 41, 'OXAAAA', 'KGOAAA', 'OOOOxx'),
+(3846, 9631, 0, 2, 6, 6, 46, 846, 1846, 3846, 3846, 92, 93, 'YRAAAA', 'LGOAAA', 'VVVVxx'),
+(3755, 9632, 1, 3, 5, 15, 55, 755, 1755, 3755, 3755, 110, 111, 'LOAAAA', 'MGOAAA', 'AAAAxx'),
+(3765, 9633, 1, 1, 5, 5, 65, 765, 1765, 3765, 3765, 130, 131, 'VOAAAA', 'NGOAAA', 'HHHHxx'),
+(3434, 9634, 0, 2, 4, 14, 34, 434, 1434, 3434, 3434, 68, 69, 'CCAAAA', 'OGOAAA', 'OOOOxx'),
+(1381, 9635, 1, 1, 1, 1, 81, 381, 1381, 1381, 1381, 162, 163, 'DBAAAA', 'PGOAAA', 'VVVVxx'),
+(287, 9636, 1, 3, 7, 7, 87, 287, 287, 287, 287, 174, 175, 'BLAAAA', 'QGOAAA', 'AAAAxx'),
+(4476, 9637, 0, 0, 6, 16, 76, 476, 476, 4476, 4476, 152, 153, 'EQAAAA', 'RGOAAA', 'HHHHxx'),
+(2916, 9638, 0, 0, 6, 16, 16, 916, 916, 2916, 2916, 32, 33, 'EIAAAA', 'SGOAAA', 'OOOOxx'),
+(4517, 9639, 1, 1, 7, 17, 17, 517, 517, 4517, 4517, 34, 35, 'TRAAAA', 'TGOAAA', 'VVVVxx'),
+(4561, 9640, 1, 1, 1, 1, 61, 561, 561, 4561, 4561, 122, 123, 'LTAAAA', 'UGOAAA', 'AAAAxx'),
+(5106, 9641, 0, 2, 6, 6, 6, 106, 1106, 106, 5106, 12, 13, 'KOAAAA', 'VGOAAA', 'HHHHxx'),
+(2077, 9642, 1, 1, 7, 17, 77, 77, 77, 2077, 2077, 154, 155, 'XBAAAA', 'WGOAAA', 'OOOOxx'),
+(5269, 9643, 1, 1, 9, 9, 69, 269, 1269, 269, 5269, 138, 139, 'RUAAAA', 'XGOAAA', 'VVVVxx'),
+(5688, 9644, 0, 0, 8, 8, 88, 688, 1688, 688, 5688, 176, 177, 'UKAAAA', 'YGOAAA', 'AAAAxx'),
+(8831, 9645, 1, 3, 1, 11, 31, 831, 831, 3831, 8831, 62, 63, 'RBAAAA', 'ZGOAAA', 'HHHHxx'),
+(3867, 9646, 1, 3, 7, 7, 67, 867, 1867, 3867, 3867, 134, 135, 'TSAAAA', 'AHOAAA', 'OOOOxx'),
+(6062, 9647, 0, 2, 2, 2, 62, 62, 62, 1062, 6062, 124, 125, 'EZAAAA', 'BHOAAA', 'VVVVxx'),
+(8460, 9648, 0, 0, 0, 0, 60, 460, 460, 3460, 8460, 120, 121, 'KNAAAA', 'CHOAAA', 'AAAAxx'),
+(3138, 9649, 0, 2, 8, 18, 38, 138, 1138, 3138, 3138, 76, 77, 'SQAAAA', 'DHOAAA', 'HHHHxx'),
+(3173, 9650, 1, 1, 3, 13, 73, 173, 1173, 3173, 3173, 146, 147, 'BSAAAA', 'EHOAAA', 'OOOOxx'),
+(7018, 9651, 0, 2, 8, 18, 18, 18, 1018, 2018, 7018, 36, 37, 'YJAAAA', 'FHOAAA', 'VVVVxx'),
+(4836, 9652, 0, 0, 6, 16, 36, 836, 836, 4836, 4836, 72, 73, 'AEAAAA', 'GHOAAA', 'AAAAxx'),
+(1007, 9653, 1, 3, 7, 7, 7, 7, 1007, 1007, 1007, 14, 15, 'TMAAAA', 'HHOAAA', 'HHHHxx'),
+(658, 9654, 0, 2, 8, 18, 58, 658, 658, 658, 658, 116, 117, 'IZAAAA', 'IHOAAA', 'OOOOxx'),
+(5205, 9655, 1, 1, 5, 5, 5, 205, 1205, 205, 5205, 10, 11, 'FSAAAA', 'JHOAAA', 'VVVVxx'),
+(5805, 9656, 1, 1, 5, 5, 5, 805, 1805, 805, 5805, 10, 11, 'HPAAAA', 'KHOAAA', 'AAAAxx'),
+(5959, 9657, 1, 3, 9, 19, 59, 959, 1959, 959, 5959, 118, 119, 'FVAAAA', 'LHOAAA', 'HHHHxx'),
+(2863, 9658, 1, 3, 3, 3, 63, 863, 863, 2863, 2863, 126, 127, 'DGAAAA', 'MHOAAA', 'OOOOxx'),
+(7272, 9659, 0, 0, 2, 12, 72, 272, 1272, 2272, 7272, 144, 145, 'STAAAA', 'NHOAAA', 'VVVVxx'),
+(8437, 9660, 1, 1, 7, 17, 37, 437, 437, 3437, 8437, 74, 75, 'NMAAAA', 'OHOAAA', 'AAAAxx'),
+(4900, 9661, 0, 0, 0, 0, 0, 900, 900, 4900, 4900, 0, 1, 'MGAAAA', 'PHOAAA', 'HHHHxx'),
+(890, 9662, 0, 2, 0, 10, 90, 890, 890, 890, 890, 180, 181, 'GIAAAA', 'QHOAAA', 'OOOOxx'),
+(3530, 9663, 0, 2, 0, 10, 30, 530, 1530, 3530, 3530, 60, 61, 'UFAAAA', 'RHOAAA', 'VVVVxx'),
+(6209, 9664, 1, 1, 9, 9, 9, 209, 209, 1209, 6209, 18, 19, 'VEAAAA', 'SHOAAA', 'AAAAxx'),
+(4595, 9665, 1, 3, 5, 15, 95, 595, 595, 4595, 4595, 190, 191, 'TUAAAA', 'THOAAA', 'HHHHxx'),
+(5982, 9666, 0, 2, 2, 2, 82, 982, 1982, 982, 5982, 164, 165, 'CWAAAA', 'UHOAAA', 'OOOOxx'),
+(1101, 9667, 1, 1, 1, 1, 1, 101, 1101, 1101, 1101, 2, 3, 'JQAAAA', 'VHOAAA', 'VVVVxx'),
+(9555, 9668, 1, 3, 5, 15, 55, 555, 1555, 4555, 9555, 110, 111, 'NDAAAA', 'WHOAAA', 'AAAAxx'),
+(1918, 9669, 0, 2, 8, 18, 18, 918, 1918, 1918, 1918, 36, 37, 'UVAAAA', 'XHOAAA', 'HHHHxx'),
+(3527, 9670, 1, 3, 7, 7, 27, 527, 1527, 3527, 3527, 54, 55, 'RFAAAA', 'YHOAAA', 'OOOOxx'),
+(7309, 9671, 1, 1, 9, 9, 9, 309, 1309, 2309, 7309, 18, 19, 'DVAAAA', 'ZHOAAA', 'VVVVxx'),
+(8213, 9672, 1, 1, 3, 13, 13, 213, 213, 3213, 8213, 26, 27, 'XDAAAA', 'AIOAAA', 'AAAAxx'),
+(306, 9673, 0, 2, 6, 6, 6, 306, 306, 306, 306, 12, 13, 'ULAAAA', 'BIOAAA', 'HHHHxx'),
+(845, 9674, 1, 1, 5, 5, 45, 845, 845, 845, 845, 90, 91, 'NGAAAA', 'CIOAAA', 'OOOOxx'),
+(16, 9675, 0, 0, 6, 16, 16, 16, 16, 16, 16, 32, 33, 'QAAAAA', 'DIOAAA', 'VVVVxx'),
+(437, 9676, 1, 1, 7, 17, 37, 437, 437, 437, 437, 74, 75, 'VQAAAA', 'EIOAAA', 'AAAAxx'),
+(9518, 9677, 0, 2, 8, 18, 18, 518, 1518, 4518, 9518, 36, 37, 'CCAAAA', 'FIOAAA', 'HHHHxx'),
+(2142, 9678, 0, 2, 2, 2, 42, 142, 142, 2142, 2142, 84, 85, 'KEAAAA', 'GIOAAA', 'OOOOxx'),
+(8121, 9679, 1, 1, 1, 1, 21, 121, 121, 3121, 8121, 42, 43, 'JAAAAA', 'HIOAAA', 'VVVVxx'),
+(7354, 9680, 0, 2, 4, 14, 54, 354, 1354, 2354, 7354, 108, 109, 'WWAAAA', 'IIOAAA', 'AAAAxx'),
+(1720, 9681, 0, 0, 0, 0, 20, 720, 1720, 1720, 1720, 40, 41, 'EOAAAA', 'JIOAAA', 'HHHHxx'),
+(6078, 9682, 0, 2, 8, 18, 78, 78, 78, 1078, 6078, 156, 157, 'UZAAAA', 'KIOAAA', 'OOOOxx'),
+(5929, 9683, 1, 1, 9, 9, 29, 929, 1929, 929, 5929, 58, 59, 'BUAAAA', 'LIOAAA', 'VVVVxx'),
+(3856, 9684, 0, 0, 6, 16, 56, 856, 1856, 3856, 3856, 112, 113, 'ISAAAA', 'MIOAAA', 'AAAAxx'),
+(3424, 9685, 0, 0, 4, 4, 24, 424, 1424, 3424, 3424, 48, 49, 'SBAAAA', 'NIOAAA', 'HHHHxx'),
+(1712, 9686, 0, 0, 2, 12, 12, 712, 1712, 1712, 1712, 24, 25, 'WNAAAA', 'OIOAAA', 'OOOOxx'),
+(2340, 9687, 0, 0, 0, 0, 40, 340, 340, 2340, 2340, 80, 81, 'AMAAAA', 'PIOAAA', 'VVVVxx'),
+(5570, 9688, 0, 2, 0, 10, 70, 570, 1570, 570, 5570, 140, 141, 'GGAAAA', 'QIOAAA', 'AAAAxx'),
+(8734, 9689, 0, 2, 4, 14, 34, 734, 734, 3734, 8734, 68, 69, 'YXAAAA', 'RIOAAA', 'HHHHxx'),
+(6077, 9690, 1, 1, 7, 17, 77, 77, 77, 1077, 6077, 154, 155, 'TZAAAA', 'SIOAAA', 'OOOOxx'),
+(2960, 9691, 0, 0, 0, 0, 60, 960, 960, 2960, 2960, 120, 121, 'WJAAAA', 'TIOAAA', 'VVVVxx'),
+(5062, 9692, 0, 2, 2, 2, 62, 62, 1062, 62, 5062, 124, 125, 'SMAAAA', 'UIOAAA', 'AAAAxx'),
+(1532, 9693, 0, 0, 2, 12, 32, 532, 1532, 1532, 1532, 64, 65, 'YGAAAA', 'VIOAAA', 'HHHHxx'),
+(8298, 9694, 0, 2, 8, 18, 98, 298, 298, 3298, 8298, 196, 197, 'EHAAAA', 'WIOAAA', 'OOOOxx'),
+(2496, 9695, 0, 0, 6, 16, 96, 496, 496, 2496, 2496, 192, 193, 'ASAAAA', 'XIOAAA', 'VVVVxx'),
+(8412, 9696, 0, 0, 2, 12, 12, 412, 412, 3412, 8412, 24, 25, 'OLAAAA', 'YIOAAA', 'AAAAxx'),
+(724, 9697, 0, 0, 4, 4, 24, 724, 724, 724, 724, 48, 49, 'WBAAAA', 'ZIOAAA', 'HHHHxx'),
+(1019, 9698, 1, 3, 9, 19, 19, 19, 1019, 1019, 1019, 38, 39, 'FNAAAA', 'AJOAAA', 'OOOOxx'),
+(6265, 9699, 1, 1, 5, 5, 65, 265, 265, 1265, 6265, 130, 131, 'ZGAAAA', 'BJOAAA', 'VVVVxx'),
+(740, 9700, 0, 0, 0, 0, 40, 740, 740, 740, 740, 80, 81, 'MCAAAA', 'CJOAAA', 'AAAAxx'),
+(8495, 9701, 1, 3, 5, 15, 95, 495, 495, 3495, 8495, 190, 191, 'TOAAAA', 'DJOAAA', 'HHHHxx'),
+(6983, 9702, 1, 3, 3, 3, 83, 983, 983, 1983, 6983, 166, 167, 'PIAAAA', 'EJOAAA', 'OOOOxx'),
+(991, 9703, 1, 3, 1, 11, 91, 991, 991, 991, 991, 182, 183, 'DMAAAA', 'FJOAAA', 'VVVVxx'),
+(3189, 9704, 1, 1, 9, 9, 89, 189, 1189, 3189, 3189, 178, 179, 'RSAAAA', 'GJOAAA', 'AAAAxx'),
+(4487, 9705, 1, 3, 7, 7, 87, 487, 487, 4487, 4487, 174, 175, 'PQAAAA', 'HJOAAA', 'HHHHxx'),
+(5554, 9706, 0, 2, 4, 14, 54, 554, 1554, 554, 5554, 108, 109, 'QFAAAA', 'IJOAAA', 'OOOOxx'),
+(1258, 9707, 0, 2, 8, 18, 58, 258, 1258, 1258, 1258, 116, 117, 'KWAAAA', 'JJOAAA', 'VVVVxx'),
+(5359, 9708, 1, 3, 9, 19, 59, 359, 1359, 359, 5359, 118, 119, 'DYAAAA', 'KJOAAA', 'AAAAxx'),
+(2709, 9709, 1, 1, 9, 9, 9, 709, 709, 2709, 2709, 18, 19, 'FAAAAA', 'LJOAAA', 'HHHHxx'),
+(361, 9710, 1, 1, 1, 1, 61, 361, 361, 361, 361, 122, 123, 'XNAAAA', 'MJOAAA', 'OOOOxx'),
+(4028, 9711, 0, 0, 8, 8, 28, 28, 28, 4028, 4028, 56, 57, 'YYAAAA', 'NJOAAA', 'VVVVxx'),
+(3735, 9712, 1, 3, 5, 15, 35, 735, 1735, 3735, 3735, 70, 71, 'RNAAAA', 'OJOAAA', 'AAAAxx'),
+(4427, 9713, 1, 3, 7, 7, 27, 427, 427, 4427, 4427, 54, 55, 'HOAAAA', 'PJOAAA', 'HHHHxx'),
+(7540, 9714, 0, 0, 0, 0, 40, 540, 1540, 2540, 7540, 80, 81, 'AEAAAA', 'QJOAAA', 'OOOOxx'),
+(3569, 9715, 1, 1, 9, 9, 69, 569, 1569, 3569, 3569, 138, 139, 'HHAAAA', 'RJOAAA', 'VVVVxx'),
+(1916, 9716, 0, 0, 6, 16, 16, 916, 1916, 1916, 1916, 32, 33, 'SVAAAA', 'SJOAAA', 'AAAAxx'),
+(7596, 9717, 0, 0, 6, 16, 96, 596, 1596, 2596, 7596, 192, 193, 'EGAAAA', 'TJOAAA', 'HHHHxx'),
+(9721, 9718, 1, 1, 1, 1, 21, 721, 1721, 4721, 9721, 42, 43, 'XJAAAA', 'UJOAAA', 'OOOOxx'),
+(4429, 9719, 1, 1, 9, 9, 29, 429, 429, 4429, 4429, 58, 59, 'JOAAAA', 'VJOAAA', 'VVVVxx'),
+(3471, 9720, 1, 3, 1, 11, 71, 471, 1471, 3471, 3471, 142, 143, 'NDAAAA', 'WJOAAA', 'AAAAxx'),
+(1157, 9721, 1, 1, 7, 17, 57, 157, 1157, 1157, 1157, 114, 115, 'NSAAAA', 'XJOAAA', 'HHHHxx'),
+(5700, 9722, 0, 0, 0, 0, 0, 700, 1700, 700, 5700, 0, 1, 'GLAAAA', 'YJOAAA', 'OOOOxx'),
+(4431, 9723, 1, 3, 1, 11, 31, 431, 431, 4431, 4431, 62, 63, 'LOAAAA', 'ZJOAAA', 'VVVVxx'),
+(9409, 9724, 1, 1, 9, 9, 9, 409, 1409, 4409, 9409, 18, 19, 'XXAAAA', 'AKOAAA', 'AAAAxx'),
+(8752, 9725, 0, 0, 2, 12, 52, 752, 752, 3752, 8752, 104, 105, 'QYAAAA', 'BKOAAA', 'HHHHxx'),
+(9484, 9726, 0, 0, 4, 4, 84, 484, 1484, 4484, 9484, 168, 169, 'UAAAAA', 'CKOAAA', 'OOOOxx'),
+(1266, 9727, 0, 2, 6, 6, 66, 266, 1266, 1266, 1266, 132, 133, 'SWAAAA', 'DKOAAA', 'VVVVxx'),
+(9097, 9728, 1, 1, 7, 17, 97, 97, 1097, 4097, 9097, 194, 195, 'XLAAAA', 'EKOAAA', 'AAAAxx'),
+(3068, 9729, 0, 0, 8, 8, 68, 68, 1068, 3068, 3068, 136, 137, 'AOAAAA', 'FKOAAA', 'HHHHxx'),
+(5490, 9730, 0, 2, 0, 10, 90, 490, 1490, 490, 5490, 180, 181, 'EDAAAA', 'GKOAAA', 'OOOOxx'),
+(1375, 9731, 1, 3, 5, 15, 75, 375, 1375, 1375, 1375, 150, 151, 'XAAAAA', 'HKOAAA', 'VVVVxx'),
+(2487, 9732, 1, 3, 7, 7, 87, 487, 487, 2487, 2487, 174, 175, 'RRAAAA', 'IKOAAA', 'AAAAxx'),
+(1705, 9733, 1, 1, 5, 5, 5, 705, 1705, 1705, 1705, 10, 11, 'PNAAAA', 'JKOAAA', 'HHHHxx'),
+(1571, 9734, 1, 3, 1, 11, 71, 571, 1571, 1571, 1571, 142, 143, 'LIAAAA', 'KKOAAA', 'OOOOxx'),
+(4005, 9735, 1, 1, 5, 5, 5, 5, 5, 4005, 4005, 10, 11, 'BYAAAA', 'LKOAAA', 'VVVVxx'),
+(5497, 9736, 1, 1, 7, 17, 97, 497, 1497, 497, 5497, 194, 195, 'LDAAAA', 'MKOAAA', 'AAAAxx'),
+(2144, 9737, 0, 0, 4, 4, 44, 144, 144, 2144, 2144, 88, 89, 'MEAAAA', 'NKOAAA', 'HHHHxx'),
+(4052, 9738, 0, 0, 2, 12, 52, 52, 52, 4052, 4052, 104, 105, 'WZAAAA', 'OKOAAA', 'OOOOxx'),
+(4942, 9739, 0, 2, 2, 2, 42, 942, 942, 4942, 4942, 84, 85, 'CIAAAA', 'PKOAAA', 'VVVVxx'),
+(5504, 9740, 0, 0, 4, 4, 4, 504, 1504, 504, 5504, 8, 9, 'SDAAAA', 'QKOAAA', 'AAAAxx'),
+(2913, 9741, 1, 1, 3, 13, 13, 913, 913, 2913, 2913, 26, 27, 'BIAAAA', 'RKOAAA', 'HHHHxx'),
+(5617, 9742, 1, 1, 7, 17, 17, 617, 1617, 617, 5617, 34, 35, 'BIAAAA', 'SKOAAA', 'OOOOxx'),
+(8179, 9743, 1, 3, 9, 19, 79, 179, 179, 3179, 8179, 158, 159, 'PCAAAA', 'TKOAAA', 'VVVVxx'),
+(9437, 9744, 1, 1, 7, 17, 37, 437, 1437, 4437, 9437, 74, 75, 'ZYAAAA', 'UKOAAA', 'AAAAxx'),
+(1821, 9745, 1, 1, 1, 1, 21, 821, 1821, 1821, 1821, 42, 43, 'BSAAAA', 'VKOAAA', 'HHHHxx'),
+(5737, 9746, 1, 1, 7, 17, 37, 737, 1737, 737, 5737, 74, 75, 'RMAAAA', 'WKOAAA', 'OOOOxx'),
+(4207, 9747, 1, 3, 7, 7, 7, 207, 207, 4207, 4207, 14, 15, 'VFAAAA', 'XKOAAA', 'VVVVxx'),
+(4815, 9748, 1, 3, 5, 15, 15, 815, 815, 4815, 4815, 30, 31, 'FDAAAA', 'YKOAAA', 'AAAAxx'),
+(8707, 9749, 1, 3, 7, 7, 7, 707, 707, 3707, 8707, 14, 15, 'XWAAAA', 'ZKOAAA', 'HHHHxx'),
+(5970, 9750, 0, 2, 0, 10, 70, 970, 1970, 970, 5970, 140, 141, 'QVAAAA', 'ALOAAA', 'OOOOxx'),
+(5501, 9751, 1, 1, 1, 1, 1, 501, 1501, 501, 5501, 2, 3, 'PDAAAA', 'BLOAAA', 'VVVVxx'),
+(4013, 9752, 1, 1, 3, 13, 13, 13, 13, 4013, 4013, 26, 27, 'JYAAAA', 'CLOAAA', 'AAAAxx'),
+(9235, 9753, 1, 3, 5, 15, 35, 235, 1235, 4235, 9235, 70, 71, 'FRAAAA', 'DLOAAA', 'HHHHxx'),
+(2503, 9754, 1, 3, 3, 3, 3, 503, 503, 2503, 2503, 6, 7, 'HSAAAA', 'ELOAAA', 'OOOOxx'),
+(9181, 9755, 1, 1, 1, 1, 81, 181, 1181, 4181, 9181, 162, 163, 'DPAAAA', 'FLOAAA', 'VVVVxx'),
+(2289, 9756, 1, 1, 9, 9, 89, 289, 289, 2289, 2289, 178, 179, 'BKAAAA', 'GLOAAA', 'AAAAxx'),
+(4256, 9757, 0, 0, 6, 16, 56, 256, 256, 4256, 4256, 112, 113, 'SHAAAA', 'HLOAAA', 'HHHHxx'),
+(191, 9758, 1, 3, 1, 11, 91, 191, 191, 191, 191, 182, 183, 'JHAAAA', 'ILOAAA', 'OOOOxx'),
+(9655, 9759, 1, 3, 5, 15, 55, 655, 1655, 4655, 9655, 110, 111, 'JHAAAA', 'JLOAAA', 'VVVVxx'),
+(8615, 9760, 1, 3, 5, 15, 15, 615, 615, 3615, 8615, 30, 31, 'JTAAAA', 'KLOAAA', 'AAAAxx'),
+(3011, 9761, 1, 3, 1, 11, 11, 11, 1011, 3011, 3011, 22, 23, 'VLAAAA', 'LLOAAA', 'HHHHxx'),
+(6376, 9762, 0, 0, 6, 16, 76, 376, 376, 1376, 6376, 152, 153, 'GLAAAA', 'MLOAAA', 'OOOOxx'),
+(68, 9763, 0, 0, 8, 8, 68, 68, 68, 68, 68, 136, 137, 'QCAAAA', 'NLOAAA', 'VVVVxx'),
+(4720, 9764, 0, 0, 0, 0, 20, 720, 720, 4720, 4720, 40, 41, 'OZAAAA', 'OLOAAA', 'AAAAxx'),
+(6848, 9765, 0, 0, 8, 8, 48, 848, 848, 1848, 6848, 96, 97, 'KDAAAA', 'PLOAAA', 'HHHHxx'),
+(456, 9766, 0, 0, 6, 16, 56, 456, 456, 456, 456, 112, 113, 'ORAAAA', 'QLOAAA', 'OOOOxx'),
+(5887, 9767, 1, 3, 7, 7, 87, 887, 1887, 887, 5887, 174, 175, 'LSAAAA', 'RLOAAA', 'VVVVxx'),
+(9249, 9768, 1, 1, 9, 9, 49, 249, 1249, 4249, 9249, 98, 99, 'TRAAAA', 'SLOAAA', 'AAAAxx'),
+(4041, 9769, 1, 1, 1, 1, 41, 41, 41, 4041, 4041, 82, 83, 'LZAAAA', 'TLOAAA', 'HHHHxx'),
+(2304, 9770, 0, 0, 4, 4, 4, 304, 304, 2304, 2304, 8, 9, 'QKAAAA', 'ULOAAA', 'OOOOxx'),
+(8763, 9771, 1, 3, 3, 3, 63, 763, 763, 3763, 8763, 126, 127, 'BZAAAA', 'VLOAAA', 'VVVVxx'),
+(2115, 9772, 1, 3, 5, 15, 15, 115, 115, 2115, 2115, 30, 31, 'JDAAAA', 'WLOAAA', 'AAAAxx'),
+(8014, 9773, 0, 2, 4, 14, 14, 14, 14, 3014, 8014, 28, 29, 'GWAAAA', 'XLOAAA', 'HHHHxx'),
+(9895, 9774, 1, 3, 5, 15, 95, 895, 1895, 4895, 9895, 190, 191, 'PQAAAA', 'YLOAAA', 'OOOOxx'),
+(671, 9775, 1, 3, 1, 11, 71, 671, 671, 671, 671, 142, 143, 'VZAAAA', 'ZLOAAA', 'VVVVxx'),
+(3774, 9776, 0, 2, 4, 14, 74, 774, 1774, 3774, 3774, 148, 149, 'EPAAAA', 'AMOAAA', 'AAAAxx'),
+(134, 9777, 0, 2, 4, 14, 34, 134, 134, 134, 134, 68, 69, 'EFAAAA', 'BMOAAA', 'HHHHxx'),
+(534, 9778, 0, 2, 4, 14, 34, 534, 534, 534, 534, 68, 69, 'OUAAAA', 'CMOAAA', 'OOOOxx'),
+(7308, 9779, 0, 0, 8, 8, 8, 308, 1308, 2308, 7308, 16, 17, 'CVAAAA', 'DMOAAA', 'VVVVxx'),
+(5244, 9780, 0, 0, 4, 4, 44, 244, 1244, 244, 5244, 88, 89, 'STAAAA', 'EMOAAA', 'AAAAxx'),
+(1512, 9781, 0, 0, 2, 12, 12, 512, 1512, 1512, 1512, 24, 25, 'EGAAAA', 'FMOAAA', 'HHHHxx'),
+(8960, 9782, 0, 0, 0, 0, 60, 960, 960, 3960, 8960, 120, 121, 'QGAAAA', 'GMOAAA', 'OOOOxx'),
+(6602, 9783, 0, 2, 2, 2, 2, 602, 602, 1602, 6602, 4, 5, 'YTAAAA', 'HMOAAA', 'VVVVxx'),
+(593, 9784, 1, 1, 3, 13, 93, 593, 593, 593, 593, 186, 187, 'VWAAAA', 'IMOAAA', 'AAAAxx'),
+(2353, 9785, 1, 1, 3, 13, 53, 353, 353, 2353, 2353, 106, 107, 'NMAAAA', 'JMOAAA', 'HHHHxx'),
+(4139, 9786, 1, 3, 9, 19, 39, 139, 139, 4139, 4139, 78, 79, 'FDAAAA', 'KMOAAA', 'OOOOxx'),
+(3063, 9787, 1, 3, 3, 3, 63, 63, 1063, 3063, 3063, 126, 127, 'VNAAAA', 'LMOAAA', 'VVVVxx'),
+(652, 9788, 0, 0, 2, 12, 52, 652, 652, 652, 652, 104, 105, 'CZAAAA', 'MMOAAA', 'AAAAxx'),
+(7405, 9789, 1, 1, 5, 5, 5, 405, 1405, 2405, 7405, 10, 11, 'VYAAAA', 'NMOAAA', 'HHHHxx'),
+(3034, 9790, 0, 2, 4, 14, 34, 34, 1034, 3034, 3034, 68, 69, 'SMAAAA', 'OMOAAA', 'OOOOxx'),
+(4614, 9791, 0, 2, 4, 14, 14, 614, 614, 4614, 4614, 28, 29, 'MVAAAA', 'PMOAAA', 'VVVVxx'),
+(2351, 9792, 1, 3, 1, 11, 51, 351, 351, 2351, 2351, 102, 103, 'LMAAAA', 'QMOAAA', 'AAAAxx'),
+(8208, 9793, 0, 0, 8, 8, 8, 208, 208, 3208, 8208, 16, 17, 'SDAAAA', 'RMOAAA', 'HHHHxx'),
+(5475, 9794, 1, 3, 5, 15, 75, 475, 1475, 475, 5475, 150, 151, 'PCAAAA', 'SMOAAA', 'OOOOxx'),
+(6875, 9795, 1, 3, 5, 15, 75, 875, 875, 1875, 6875, 150, 151, 'LEAAAA', 'TMOAAA', 'VVVVxx'),
+(563, 9796, 1, 3, 3, 3, 63, 563, 563, 563, 563, 126, 127, 'RVAAAA', 'UMOAAA', 'AAAAxx'),
+(3346, 9797, 0, 2, 6, 6, 46, 346, 1346, 3346, 3346, 92, 93, 'SYAAAA', 'VMOAAA', 'HHHHxx'),
+(291, 9798, 1, 3, 1, 11, 91, 291, 291, 291, 291, 182, 183, 'FLAAAA', 'WMOAAA', 'OOOOxx'),
+(6345, 9799, 1, 1, 5, 5, 45, 345, 345, 1345, 6345, 90, 91, 'BKAAAA', 'XMOAAA', 'VVVVxx'),
+(8099, 9800, 1, 3, 9, 19, 99, 99, 99, 3099, 8099, 198, 199, 'NZAAAA', 'YMOAAA', 'AAAAxx'),
+(2078, 9801, 0, 2, 8, 18, 78, 78, 78, 2078, 2078, 156, 157, 'YBAAAA', 'ZMOAAA', 'HHHHxx'),
+(8238, 9802, 0, 2, 8, 18, 38, 238, 238, 3238, 8238, 76, 77, 'WEAAAA', 'ANOAAA', 'OOOOxx'),
+(4482, 9803, 0, 2, 2, 2, 82, 482, 482, 4482, 4482, 164, 165, 'KQAAAA', 'BNOAAA', 'VVVVxx'),
+(716, 9804, 0, 0, 6, 16, 16, 716, 716, 716, 716, 32, 33, 'OBAAAA', 'CNOAAA', 'AAAAxx'),
+(7288, 9805, 0, 0, 8, 8, 88, 288, 1288, 2288, 7288, 176, 177, 'IUAAAA', 'DNOAAA', 'HHHHxx'),
+(5906, 9806, 0, 2, 6, 6, 6, 906, 1906, 906, 5906, 12, 13, 'ETAAAA', 'ENOAAA', 'OOOOxx'),
+(5618, 9807, 0, 2, 8, 18, 18, 618, 1618, 618, 5618, 36, 37, 'CIAAAA', 'FNOAAA', 'VVVVxx'),
+(1141, 9808, 1, 1, 1, 1, 41, 141, 1141, 1141, 1141, 82, 83, 'XRAAAA', 'GNOAAA', 'AAAAxx'),
+(8231, 9809, 1, 3, 1, 11, 31, 231, 231, 3231, 8231, 62, 63, 'PEAAAA', 'HNOAAA', 'HHHHxx'),
+(3713, 9810, 1, 1, 3, 13, 13, 713, 1713, 3713, 3713, 26, 27, 'VMAAAA', 'INOAAA', 'OOOOxx'),
+(9158, 9811, 0, 2, 8, 18, 58, 158, 1158, 4158, 9158, 116, 117, 'GOAAAA', 'JNOAAA', 'VVVVxx'),
+(4051, 9812, 1, 3, 1, 11, 51, 51, 51, 4051, 4051, 102, 103, 'VZAAAA', 'KNOAAA', 'AAAAxx'),
+(1973, 9813, 1, 1, 3, 13, 73, 973, 1973, 1973, 1973, 146, 147, 'XXAAAA', 'LNOAAA', 'HHHHxx'),
+(6710, 9814, 0, 2, 0, 10, 10, 710, 710, 1710, 6710, 20, 21, 'CYAAAA', 'MNOAAA', 'OOOOxx'),
+(1021, 9815, 1, 1, 1, 1, 21, 21, 1021, 1021, 1021, 42, 43, 'HNAAAA', 'NNOAAA', 'VVVVxx'),
+(2196, 9816, 0, 0, 6, 16, 96, 196, 196, 2196, 2196, 192, 193, 'MGAAAA', 'ONOAAA', 'AAAAxx'),
+(8335, 9817, 1, 3, 5, 15, 35, 335, 335, 3335, 8335, 70, 71, 'PIAAAA', 'PNOAAA', 'HHHHxx'),
+(2272, 9818, 0, 0, 2, 12, 72, 272, 272, 2272, 2272, 144, 145, 'KJAAAA', 'QNOAAA', 'OOOOxx'),
+(3818, 9819, 0, 2, 8, 18, 18, 818, 1818, 3818, 3818, 36, 37, 'WQAAAA', 'RNOAAA', 'VVVVxx'),
+(679, 9820, 1, 3, 9, 19, 79, 679, 679, 679, 679, 158, 159, 'DAAAAA', 'SNOAAA', 'AAAAxx'),
+(7512, 9821, 0, 0, 2, 12, 12, 512, 1512, 2512, 7512, 24, 25, 'YCAAAA', 'TNOAAA', 'HHHHxx'),
+(493, 9822, 1, 1, 3, 13, 93, 493, 493, 493, 493, 186, 187, 'ZSAAAA', 'UNOAAA', 'OOOOxx'),
+(5663, 9823, 1, 3, 3, 3, 63, 663, 1663, 663, 5663, 126, 127, 'VJAAAA', 'VNOAAA', 'VVVVxx'),
+(4655, 9824, 1, 3, 5, 15, 55, 655, 655, 4655, 4655, 110, 111, 'BXAAAA', 'WNOAAA', 'AAAAxx'),
+(3996, 9825, 0, 0, 6, 16, 96, 996, 1996, 3996, 3996, 192, 193, 'SXAAAA', 'XNOAAA', 'HHHHxx'),
+(8797, 9826, 1, 1, 7, 17, 97, 797, 797, 3797, 8797, 194, 195, 'JAAAAA', 'YNOAAA', 'OOOOxx'),
+(2991, 9827, 1, 3, 1, 11, 91, 991, 991, 2991, 2991, 182, 183, 'BLAAAA', 'ZNOAAA', 'VVVVxx'),
+(7038, 9828, 0, 2, 8, 18, 38, 38, 1038, 2038, 7038, 76, 77, 'SKAAAA', 'AOOAAA', 'AAAAxx'),
+(4174, 9829, 0, 2, 4, 14, 74, 174, 174, 4174, 4174, 148, 149, 'OEAAAA', 'BOOAAA', 'HHHHxx'),
+(6908, 9830, 0, 0, 8, 8, 8, 908, 908, 1908, 6908, 16, 17, 'SFAAAA', 'COOAAA', 'OOOOxx'),
+(8477, 9831, 1, 1, 7, 17, 77, 477, 477, 3477, 8477, 154, 155, 'BOAAAA', 'DOOAAA', 'VVVVxx'),
+(3576, 9832, 0, 0, 6, 16, 76, 576, 1576, 3576, 3576, 152, 153, 'OHAAAA', 'EOOAAA', 'AAAAxx'),
+(2685, 9833, 1, 1, 5, 5, 85, 685, 685, 2685, 2685, 170, 171, 'HZAAAA', 'FOOAAA', 'HHHHxx'),
+(9161, 9834, 1, 1, 1, 1, 61, 161, 1161, 4161, 9161, 122, 123, 'JOAAAA', 'GOOAAA', 'OOOOxx'),
+(2951, 9835, 1, 3, 1, 11, 51, 951, 951, 2951, 2951, 102, 103, 'NJAAAA', 'HOOAAA', 'VVVVxx'),
+(8362, 9836, 0, 2, 2, 2, 62, 362, 362, 3362, 8362, 124, 125, 'QJAAAA', 'IOOAAA', 'AAAAxx'),
+(2379, 9837, 1, 3, 9, 19, 79, 379, 379, 2379, 2379, 158, 159, 'NNAAAA', 'JOOAAA', 'HHHHxx'),
+(1277, 9838, 1, 1, 7, 17, 77, 277, 1277, 1277, 1277, 154, 155, 'DXAAAA', 'KOOAAA', 'OOOOxx'),
+(1728, 9839, 0, 0, 8, 8, 28, 728, 1728, 1728, 1728, 56, 57, 'MOAAAA', 'LOOAAA', 'VVVVxx'),
+(9816, 9840, 0, 0, 6, 16, 16, 816, 1816, 4816, 9816, 32, 33, 'ONAAAA', 'MOOAAA', 'AAAAxx'),
+(6288, 9841, 0, 0, 8, 8, 88, 288, 288, 1288, 6288, 176, 177, 'WHAAAA', 'NOOAAA', 'HHHHxx'),
+(8985, 9842, 1, 1, 5, 5, 85, 985, 985, 3985, 8985, 170, 171, 'PHAAAA', 'OOOAAA', 'OOOOxx'),
+(771, 9843, 1, 3, 1, 11, 71, 771, 771, 771, 771, 142, 143, 'RDAAAA', 'POOAAA', 'VVVVxx'),
+(464, 9844, 0, 0, 4, 4, 64, 464, 464, 464, 464, 128, 129, 'WRAAAA', 'QOOAAA', 'AAAAxx'),
+(9625, 9845, 1, 1, 5, 5, 25, 625, 1625, 4625, 9625, 50, 51, 'FGAAAA', 'ROOAAA', 'HHHHxx'),
+(9608, 9846, 0, 0, 8, 8, 8, 608, 1608, 4608, 9608, 16, 17, 'OFAAAA', 'SOOAAA', 'OOOOxx'),
+(9170, 9847, 0, 2, 0, 10, 70, 170, 1170, 4170, 9170, 140, 141, 'SOAAAA', 'TOOAAA', 'VVVVxx'),
+(9658, 9848, 0, 2, 8, 18, 58, 658, 1658, 4658, 9658, 116, 117, 'MHAAAA', 'UOOAAA', 'AAAAxx'),
+(7515, 9849, 1, 3, 5, 15, 15, 515, 1515, 2515, 7515, 30, 31, 'BDAAAA', 'VOOAAA', 'HHHHxx'),
+(9400, 9850, 0, 0, 0, 0, 0, 400, 1400, 4400, 9400, 0, 1, 'OXAAAA', 'WOOAAA', 'OOOOxx'),
+(2045, 9851, 1, 1, 5, 5, 45, 45, 45, 2045, 2045, 90, 91, 'RAAAAA', 'XOOAAA', 'VVVVxx'),
+(324, 9852, 0, 0, 4, 4, 24, 324, 324, 324, 324, 48, 49, 'MMAAAA', 'YOOAAA', 'AAAAxx'),
+(4252, 9853, 0, 0, 2, 12, 52, 252, 252, 4252, 4252, 104, 105, 'OHAAAA', 'ZOOAAA', 'HHHHxx'),
+(8329, 9854, 1, 1, 9, 9, 29, 329, 329, 3329, 8329, 58, 59, 'JIAAAA', 'APOAAA', 'OOOOxx'),
+(4472, 9855, 0, 0, 2, 12, 72, 472, 472, 4472, 4472, 144, 145, 'AQAAAA', 'BPOAAA', 'VVVVxx'),
+(1047, 9856, 1, 3, 7, 7, 47, 47, 1047, 1047, 1047, 94, 95, 'HOAAAA', 'CPOAAA', 'AAAAxx'),
+(9341, 9857, 1, 1, 1, 1, 41, 341, 1341, 4341, 9341, 82, 83, 'HVAAAA', 'DPOAAA', 'HHHHxx'),
+(7000, 9858, 0, 0, 0, 0, 0, 0, 1000, 2000, 7000, 0, 1, 'GJAAAA', 'EPOAAA', 'OOOOxx'),
+(1429, 9859, 1, 1, 9, 9, 29, 429, 1429, 1429, 1429, 58, 59, 'ZCAAAA', 'FPOAAA', 'VVVVxx'),
+(2701, 9860, 1, 1, 1, 1, 1, 701, 701, 2701, 2701, 2, 3, 'XZAAAA', 'GPOAAA', 'AAAAxx'),
+(6630, 9861, 0, 2, 0, 10, 30, 630, 630, 1630, 6630, 60, 61, 'AVAAAA', 'HPOAAA', 'HHHHxx'),
+(3669, 9862, 1, 1, 9, 9, 69, 669, 1669, 3669, 3669, 138, 139, 'DLAAAA', 'IPOAAA', 'OOOOxx'),
+(8613, 9863, 1, 1, 3, 13, 13, 613, 613, 3613, 8613, 26, 27, 'HTAAAA', 'JPOAAA', 'VVVVxx'),
+(7080, 9864, 0, 0, 0, 0, 80, 80, 1080, 2080, 7080, 160, 161, 'IMAAAA', 'KPOAAA', 'AAAAxx'),
+(8788, 9865, 0, 0, 8, 8, 88, 788, 788, 3788, 8788, 176, 177, 'AAAAAA', 'LPOAAA', 'HHHHxx'),
+(6291, 9866, 1, 3, 1, 11, 91, 291, 291, 1291, 6291, 182, 183, 'ZHAAAA', 'MPOAAA', 'OOOOxx'),
+(7885, 9867, 1, 1, 5, 5, 85, 885, 1885, 2885, 7885, 170, 171, 'HRAAAA', 'NPOAAA', 'VVVVxx'),
+(7160, 9868, 0, 0, 0, 0, 60, 160, 1160, 2160, 7160, 120, 121, 'KPAAAA', 'OPOAAA', 'AAAAxx'),
+(6140, 9869, 0, 0, 0, 0, 40, 140, 140, 1140, 6140, 80, 81, 'ECAAAA', 'PPOAAA', 'HHHHxx'),
+(9881, 9870, 1, 1, 1, 1, 81, 881, 1881, 4881, 9881, 162, 163, 'BQAAAA', 'QPOAAA', 'OOOOxx'),
+(9140, 9871, 0, 0, 0, 0, 40, 140, 1140, 4140, 9140, 80, 81, 'ONAAAA', 'RPOAAA', 'VVVVxx'),
+(644, 9872, 0, 0, 4, 4, 44, 644, 644, 644, 644, 88, 89, 'UYAAAA', 'SPOAAA', 'AAAAxx'),
+(3667, 9873, 1, 3, 7, 7, 67, 667, 1667, 3667, 3667, 134, 135, 'BLAAAA', 'TPOAAA', 'HHHHxx'),
+(2675, 9874, 1, 3, 5, 15, 75, 675, 675, 2675, 2675, 150, 151, 'XYAAAA', 'UPOAAA', 'OOOOxx'),
+(9492, 9875, 0, 0, 2, 12, 92, 492, 1492, 4492, 9492, 184, 185, 'CBAAAA', 'VPOAAA', 'VVVVxx'),
+(5004, 9876, 0, 0, 4, 4, 4, 4, 1004, 4, 5004, 8, 9, 'MKAAAA', 'WPOAAA', 'AAAAxx'),
+(9456, 9877, 0, 0, 6, 16, 56, 456, 1456, 4456, 9456, 112, 113, 'SZAAAA', 'XPOAAA', 'HHHHxx'),
+(8197, 9878, 1, 1, 7, 17, 97, 197, 197, 3197, 8197, 194, 195, 'HDAAAA', 'YPOAAA', 'OOOOxx'),
+(2837, 9879, 1, 1, 7, 17, 37, 837, 837, 2837, 2837, 74, 75, 'DFAAAA', 'ZPOAAA', 'VVVVxx'),
+(127, 9880, 1, 3, 7, 7, 27, 127, 127, 127, 127, 54, 55, 'XEAAAA', 'AQOAAA', 'AAAAxx'),
+(9772, 9881, 0, 0, 2, 12, 72, 772, 1772, 4772, 9772, 144, 145, 'WLAAAA', 'BQOAAA', 'HHHHxx'),
+(5743, 9882, 1, 3, 3, 3, 43, 743, 1743, 743, 5743, 86, 87, 'XMAAAA', 'CQOAAA', 'OOOOxx'),
+(2007, 9883, 1, 3, 7, 7, 7, 7, 7, 2007, 2007, 14, 15, 'FZAAAA', 'DQOAAA', 'VVVVxx'),
+(7586, 9884, 0, 2, 6, 6, 86, 586, 1586, 2586, 7586, 172, 173, 'UFAAAA', 'EQOAAA', 'AAAAxx'),
+(45, 9885, 1, 1, 5, 5, 45, 45, 45, 45, 45, 90, 91, 'TBAAAA', 'FQOAAA', 'HHHHxx'),
+(6482, 9886, 0, 2, 2, 2, 82, 482, 482, 1482, 6482, 164, 165, 'IPAAAA', 'GQOAAA', 'OOOOxx'),
+(4565, 9887, 1, 1, 5, 5, 65, 565, 565, 4565, 4565, 130, 131, 'PTAAAA', 'HQOAAA', 'VVVVxx'),
+(6975, 9888, 1, 3, 5, 15, 75, 975, 975, 1975, 6975, 150, 151, 'HIAAAA', 'IQOAAA', 'AAAAxx'),
+(7260, 9889, 0, 0, 0, 0, 60, 260, 1260, 2260, 7260, 120, 121, 'GTAAAA', 'JQOAAA', 'HHHHxx'),
+(2830, 9890, 0, 2, 0, 10, 30, 830, 830, 2830, 2830, 60, 61, 'WEAAAA', 'KQOAAA', 'OOOOxx'),
+(9365, 9891, 1, 1, 5, 5, 65, 365, 1365, 4365, 9365, 130, 131, 'FWAAAA', 'LQOAAA', 'VVVVxx'),
+(8207, 9892, 1, 3, 7, 7, 7, 207, 207, 3207, 8207, 14, 15, 'RDAAAA', 'MQOAAA', 'AAAAxx'),
+(2506, 9893, 0, 2, 6, 6, 6, 506, 506, 2506, 2506, 12, 13, 'KSAAAA', 'NQOAAA', 'HHHHxx'),
+(8081, 9894, 1, 1, 1, 1, 81, 81, 81, 3081, 8081, 162, 163, 'VYAAAA', 'OQOAAA', 'OOOOxx'),
+(8678, 9895, 0, 2, 8, 18, 78, 678, 678, 3678, 8678, 156, 157, 'UVAAAA', 'PQOAAA', 'VVVVxx'),
+(9932, 9896, 0, 0, 2, 12, 32, 932, 1932, 4932, 9932, 64, 65, 'ASAAAA', 'QQOAAA', 'AAAAxx'),
+(447, 9897, 1, 3, 7, 7, 47, 447, 447, 447, 447, 94, 95, 'FRAAAA', 'RQOAAA', 'HHHHxx'),
+(9187, 9898, 1, 3, 7, 7, 87, 187, 1187, 4187, 9187, 174, 175, 'JPAAAA', 'SQOAAA', 'OOOOxx'),
+(89, 9899, 1, 1, 9, 9, 89, 89, 89, 89, 89, 178, 179, 'LDAAAA', 'TQOAAA', 'VVVVxx'),
+(7027, 9900, 1, 3, 7, 7, 27, 27, 1027, 2027, 7027, 54, 55, 'HKAAAA', 'UQOAAA', 'AAAAxx'),
+(1536, 9901, 0, 0, 6, 16, 36, 536, 1536, 1536, 1536, 72, 73, 'CHAAAA', 'VQOAAA', 'HHHHxx'),
+(160, 9902, 0, 0, 0, 0, 60, 160, 160, 160, 160, 120, 121, 'EGAAAA', 'WQOAAA', 'OOOOxx'),
+(7679, 9903, 1, 3, 9, 19, 79, 679, 1679, 2679, 7679, 158, 159, 'JJAAAA', 'XQOAAA', 'VVVVxx'),
+(5973, 9904, 1, 1, 3, 13, 73, 973, 1973, 973, 5973, 146, 147, 'TVAAAA', 'YQOAAA', 'AAAAxx'),
+(4401, 9905, 1, 1, 1, 1, 1, 401, 401, 4401, 4401, 2, 3, 'HNAAAA', 'ZQOAAA', 'HHHHxx'),
+(395, 9906, 1, 3, 5, 15, 95, 395, 395, 395, 395, 190, 191, 'FPAAAA', 'AROAAA', 'OOOOxx'),
+(4904, 9907, 0, 0, 4, 4, 4, 904, 904, 4904, 4904, 8, 9, 'QGAAAA', 'BROAAA', 'VVVVxx'),
+(2759, 9908, 1, 3, 9, 19, 59, 759, 759, 2759, 2759, 118, 119, 'DCAAAA', 'CROAAA', 'AAAAxx'),
+(8713, 9909, 1, 1, 3, 13, 13, 713, 713, 3713, 8713, 26, 27, 'DXAAAA', 'DROAAA', 'HHHHxx'),
+(3770, 9910, 0, 2, 0, 10, 70, 770, 1770, 3770, 3770, 140, 141, 'APAAAA', 'EROAAA', 'OOOOxx'),
+(8272, 9911, 0, 0, 2, 12, 72, 272, 272, 3272, 8272, 144, 145, 'EGAAAA', 'FROAAA', 'VVVVxx'),
+(5358, 9912, 0, 2, 8, 18, 58, 358, 1358, 358, 5358, 116, 117, 'CYAAAA', 'GROAAA', 'AAAAxx'),
+(9747, 9913, 1, 3, 7, 7, 47, 747, 1747, 4747, 9747, 94, 95, 'XKAAAA', 'HROAAA', 'HHHHxx'),
+(1567, 9914, 1, 3, 7, 7, 67, 567, 1567, 1567, 1567, 134, 135, 'HIAAAA', 'IROAAA', 'OOOOxx'),
+(2136, 9915, 0, 0, 6, 16, 36, 136, 136, 2136, 2136, 72, 73, 'EEAAAA', 'JROAAA', 'VVVVxx'),
+(314, 9916, 0, 2, 4, 14, 14, 314, 314, 314, 314, 28, 29, 'CMAAAA', 'KROAAA', 'AAAAxx'),
+(4583, 9917, 1, 3, 3, 3, 83, 583, 583, 4583, 4583, 166, 167, 'HUAAAA', 'LROAAA', 'HHHHxx'),
+(375, 9918, 1, 3, 5, 15, 75, 375, 375, 375, 375, 150, 151, 'LOAAAA', 'MROAAA', 'OOOOxx'),
+(5566, 9919, 0, 2, 6, 6, 66, 566, 1566, 566, 5566, 132, 133, 'CGAAAA', 'NROAAA', 'VVVVxx'),
+(6865, 9920, 1, 1, 5, 5, 65, 865, 865, 1865, 6865, 130, 131, 'BEAAAA', 'OROAAA', 'AAAAxx'),
+(894, 9921, 0, 2, 4, 14, 94, 894, 894, 894, 894, 188, 189, 'KIAAAA', 'PROAAA', 'HHHHxx'),
+(5399, 9922, 1, 3, 9, 19, 99, 399, 1399, 399, 5399, 198, 199, 'RZAAAA', 'QROAAA', 'OOOOxx'),
+(1385, 9923, 1, 1, 5, 5, 85, 385, 1385, 1385, 1385, 170, 171, 'HBAAAA', 'RROAAA', 'VVVVxx'),
+(2156, 9924, 0, 0, 6, 16, 56, 156, 156, 2156, 2156, 112, 113, 'YEAAAA', 'SROAAA', 'AAAAxx'),
+(9659, 9925, 1, 3, 9, 19, 59, 659, 1659, 4659, 9659, 118, 119, 'NHAAAA', 'TROAAA', 'HHHHxx'),
+(477, 9926, 1, 1, 7, 17, 77, 477, 477, 477, 477, 154, 155, 'JSAAAA', 'UROAAA', 'OOOOxx'),
+(8194, 9927, 0, 2, 4, 14, 94, 194, 194, 3194, 8194, 188, 189, 'EDAAAA', 'VROAAA', 'VVVVxx'),
+(3937, 9928, 1, 1, 7, 17, 37, 937, 1937, 3937, 3937, 74, 75, 'LVAAAA', 'WROAAA', 'AAAAxx'),
+(3745, 9929, 1, 1, 5, 5, 45, 745, 1745, 3745, 3745, 90, 91, 'BOAAAA', 'XROAAA', 'HHHHxx'),
+(4096, 9930, 0, 0, 6, 16, 96, 96, 96, 4096, 4096, 192, 193, 'OBAAAA', 'YROAAA', 'OOOOxx'),
+(5487, 9931, 1, 3, 7, 7, 87, 487, 1487, 487, 5487, 174, 175, 'BDAAAA', 'ZROAAA', 'VVVVxx'),
+(2475, 9932, 1, 3, 5, 15, 75, 475, 475, 2475, 2475, 150, 151, 'FRAAAA', 'ASOAAA', 'AAAAxx'),
+(6105, 9933, 1, 1, 5, 5, 5, 105, 105, 1105, 6105, 10, 11, 'VAAAAA', 'BSOAAA', 'HHHHxx'),
+(6036, 9934, 0, 0, 6, 16, 36, 36, 36, 1036, 6036, 72, 73, 'EYAAAA', 'CSOAAA', 'OOOOxx'),
+(1315, 9935, 1, 3, 5, 15, 15, 315, 1315, 1315, 1315, 30, 31, 'PYAAAA', 'DSOAAA', 'VVVVxx'),
+(4473, 9936, 1, 1, 3, 13, 73, 473, 473, 4473, 4473, 146, 147, 'BQAAAA', 'ESOAAA', 'AAAAxx'),
+(4016, 9937, 0, 0, 6, 16, 16, 16, 16, 4016, 4016, 32, 33, 'MYAAAA', 'FSOAAA', 'HHHHxx'),
+(8135, 9938, 1, 3, 5, 15, 35, 135, 135, 3135, 8135, 70, 71, 'XAAAAA', 'GSOAAA', 'OOOOxx'),
+(8892, 9939, 0, 0, 2, 12, 92, 892, 892, 3892, 8892, 184, 185, 'AEAAAA', 'HSOAAA', 'VVVVxx'),
+(4850, 9940, 0, 2, 0, 10, 50, 850, 850, 4850, 4850, 100, 101, 'OEAAAA', 'ISOAAA', 'AAAAxx'),
+(2545, 9941, 1, 1, 5, 5, 45, 545, 545, 2545, 2545, 90, 91, 'XTAAAA', 'JSOAAA', 'HHHHxx'),
+(3788, 9942, 0, 0, 8, 8, 88, 788, 1788, 3788, 3788, 176, 177, 'SPAAAA', 'KSOAAA', 'OOOOxx'),
+(1672, 9943, 0, 0, 2, 12, 72, 672, 1672, 1672, 1672, 144, 145, 'IMAAAA', 'LSOAAA', 'VVVVxx'),
+(3664, 9944, 0, 0, 4, 4, 64, 664, 1664, 3664, 3664, 128, 129, 'YKAAAA', 'MSOAAA', 'AAAAxx'),
+(3775, 9945, 1, 3, 5, 15, 75, 775, 1775, 3775, 3775, 150, 151, 'FPAAAA', 'NSOAAA', 'HHHHxx'),
+(3103, 9946, 1, 3, 3, 3, 3, 103, 1103, 3103, 3103, 6, 7, 'JPAAAA', 'OSOAAA', 'OOOOxx'),
+(9335, 9947, 1, 3, 5, 15, 35, 335, 1335, 4335, 9335, 70, 71, 'BVAAAA', 'PSOAAA', 'VVVVxx'),
+(9200, 9948, 0, 0, 0, 0, 0, 200, 1200, 4200, 9200, 0, 1, 'WPAAAA', 'QSOAAA', 'AAAAxx'),
+(8665, 9949, 1, 1, 5, 5, 65, 665, 665, 3665, 8665, 130, 131, 'HVAAAA', 'RSOAAA', 'HHHHxx'),
+(1356, 9950, 0, 0, 6, 16, 56, 356, 1356, 1356, 1356, 112, 113, 'EAAAAA', 'SSOAAA', 'OOOOxx'),
+(6118, 9951, 0, 2, 8, 18, 18, 118, 118, 1118, 6118, 36, 37, 'IBAAAA', 'TSOAAA', 'VVVVxx'),
+(4605, 9952, 1, 1, 5, 5, 5, 605, 605, 4605, 4605, 10, 11, 'DVAAAA', 'USOAAA', 'AAAAxx'),
+(5651, 9953, 1, 3, 1, 11, 51, 651, 1651, 651, 5651, 102, 103, 'JJAAAA', 'VSOAAA', 'HHHHxx'),
+(9055, 9954, 1, 3, 5, 15, 55, 55, 1055, 4055, 9055, 110, 111, 'HKAAAA', 'WSOAAA', 'OOOOxx'),
+(8461, 9955, 1, 1, 1, 1, 61, 461, 461, 3461, 8461, 122, 123, 'LNAAAA', 'XSOAAA', 'VVVVxx'),
+(6107, 9956, 1, 3, 7, 7, 7, 107, 107, 1107, 6107, 14, 15, 'XAAAAA', 'YSOAAA', 'AAAAxx'),
+(1967, 9957, 1, 3, 7, 7, 67, 967, 1967, 1967, 1967, 134, 135, 'RXAAAA', 'ZSOAAA', 'HHHHxx'),
+(8910, 9958, 0, 2, 0, 10, 10, 910, 910, 3910, 8910, 20, 21, 'SEAAAA', 'ATOAAA', 'OOOOxx'),
+(8257, 9959, 1, 1, 7, 17, 57, 257, 257, 3257, 8257, 114, 115, 'PFAAAA', 'BTOAAA', 'VVVVxx'),
+(851, 9960, 1, 3, 1, 11, 51, 851, 851, 851, 851, 102, 103, 'TGAAAA', 'CTOAAA', 'AAAAxx'),
+(7823, 9961, 1, 3, 3, 3, 23, 823, 1823, 2823, 7823, 46, 47, 'XOAAAA', 'DTOAAA', 'HHHHxx'),
+(3208, 9962, 0, 0, 8, 8, 8, 208, 1208, 3208, 3208, 16, 17, 'KTAAAA', 'ETOAAA', 'OOOOxx'),
+(856, 9963, 0, 0, 6, 16, 56, 856, 856, 856, 856, 112, 113, 'YGAAAA', 'FTOAAA', 'VVVVxx'),
+(2654, 9964, 0, 2, 4, 14, 54, 654, 654, 2654, 2654, 108, 109, 'CYAAAA', 'GTOAAA', 'AAAAxx'),
+(7185, 9965, 1, 1, 5, 5, 85, 185, 1185, 2185, 7185, 170, 171, 'JQAAAA', 'HTOAAA', 'HHHHxx'),
+(309, 9966, 1, 1, 9, 9, 9, 309, 309, 309, 309, 18, 19, 'XLAAAA', 'ITOAAA', 'OOOOxx'),
+(9752, 9967, 0, 0, 2, 12, 52, 752, 1752, 4752, 9752, 104, 105, 'CLAAAA', 'JTOAAA', 'VVVVxx'),
+(6405, 9968, 1, 1, 5, 5, 5, 405, 405, 1405, 6405, 10, 11, 'JMAAAA', 'KTOAAA', 'AAAAxx'),
+(6113, 9969, 1, 1, 3, 13, 13, 113, 113, 1113, 6113, 26, 27, 'DBAAAA', 'LTOAAA', 'HHHHxx'),
+(9774, 9970, 0, 2, 4, 14, 74, 774, 1774, 4774, 9774, 148, 149, 'YLAAAA', 'MTOAAA', 'OOOOxx'),
+(1674, 9971, 0, 2, 4, 14, 74, 674, 1674, 1674, 1674, 148, 149, 'KMAAAA', 'NTOAAA', 'VVVVxx'),
+(9602, 9972, 0, 2, 2, 2, 2, 602, 1602, 4602, 9602, 4, 5, 'IFAAAA', 'OTOAAA', 'AAAAxx'),
+(1363, 9973, 1, 3, 3, 3, 63, 363, 1363, 1363, 1363, 126, 127, 'LAAAAA', 'PTOAAA', 'HHHHxx'),
+(6887, 9974, 1, 3, 7, 7, 87, 887, 887, 1887, 6887, 174, 175, 'XEAAAA', 'QTOAAA', 'OOOOxx'),
+(6170, 9975, 0, 2, 0, 10, 70, 170, 170, 1170, 6170, 140, 141, 'IDAAAA', 'RTOAAA', 'VVVVxx'),
+(8888, 9976, 0, 0, 8, 8, 88, 888, 888, 3888, 8888, 176, 177, 'WDAAAA', 'STOAAA', 'AAAAxx'),
+(2981, 9977, 1, 1, 1, 1, 81, 981, 981, 2981, 2981, 162, 163, 'RKAAAA', 'TTOAAA', 'HHHHxx'),
+(7369, 9978, 1, 1, 9, 9, 69, 369, 1369, 2369, 7369, 138, 139, 'LXAAAA', 'UTOAAA', 'OOOOxx'),
+(6227, 9979, 1, 3, 7, 7, 27, 227, 227, 1227, 6227, 54, 55, 'NFAAAA', 'VTOAAA', 'VVVVxx'),
+(8002, 9980, 0, 2, 2, 2, 2, 2, 2, 3002, 8002, 4, 5, 'UVAAAA', 'WTOAAA', 'AAAAxx'),
+(4288, 9981, 0, 0, 8, 8, 88, 288, 288, 4288, 4288, 176, 177, 'YIAAAA', 'XTOAAA', 'HHHHxx'),
+(5136, 9982, 0, 0, 6, 16, 36, 136, 1136, 136, 5136, 72, 73, 'OPAAAA', 'YTOAAA', 'OOOOxx'),
+(1084, 9983, 0, 0, 4, 4, 84, 84, 1084, 1084, 1084, 168, 169, 'SPAAAA', 'ZTOAAA', 'VVVVxx'),
+(9117, 9984, 1, 1, 7, 17, 17, 117, 1117, 4117, 9117, 34, 35, 'RMAAAA', 'AUOAAA', 'AAAAxx'),
+(2406, 9985, 0, 2, 6, 6, 6, 406, 406, 2406, 2406, 12, 13, 'OOAAAA', 'BUOAAA', 'HHHHxx'),
+(1384, 9986, 0, 0, 4, 4, 84, 384, 1384, 1384, 1384, 168, 169, 'GBAAAA', 'CUOAAA', 'OOOOxx'),
+(9194, 9987, 0, 2, 4, 14, 94, 194, 1194, 4194, 9194, 188, 189, 'QPAAAA', 'DUOAAA', 'VVVVxx'),
+(858, 9988, 0, 2, 8, 18, 58, 858, 858, 858, 858, 116, 117, 'AHAAAA', 'EUOAAA', 'AAAAxx'),
+(8592, 9989, 0, 0, 2, 12, 92, 592, 592, 3592, 8592, 184, 185, 'MSAAAA', 'FUOAAA', 'HHHHxx'),
+(4773, 9990, 1, 1, 3, 13, 73, 773, 773, 4773, 4773, 146, 147, 'PBAAAA', 'GUOAAA', 'OOOOxx'),
+(4093, 9991, 1, 1, 3, 13, 93, 93, 93, 4093, 4093, 186, 187, 'LBAAAA', 'HUOAAA', 'VVVVxx'),
+(6587, 9992, 1, 3, 7, 7, 87, 587, 587, 1587, 6587, 174, 175, 'JTAAAA', 'IUOAAA', 'AAAAxx'),
+(6093, 9993, 1, 1, 3, 13, 93, 93, 93, 1093, 6093, 186, 187, 'JAAAAA', 'JUOAAA', 'HHHHxx'),
+(429, 9994, 1, 1, 9, 9, 29, 429, 429, 429, 429, 58, 59, 'NQAAAA', 'KUOAAA', 'OOOOxx'),
+(5780, 9995, 0, 0, 0, 0, 80, 780, 1780, 780, 5780, 160, 161, 'IOAAAA', 'LUOAAA', 'VVVVxx'),
+(1783, 9996, 1, 3, 3, 3, 83, 783, 1783, 1783, 1783, 166, 167, 'PQAAAA', 'MUOAAA', 'AAAAxx'),
+(2992, 9997, 0, 0, 2, 12, 92, 992, 992, 2992, 2992, 184, 185, 'CLAAAA', 'NUOAAA', 'HHHHxx'),
+(0, 9998, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'AAAAAA', 'OUOAAA', 'OOOOxx'),
+(2968, 9999, 0, 0, 8, 8, 68, 968, 968, 2968, 2968, 136, 137, 'EKAAAA', 'PUOAAA', 'VVVVxx');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/tenk2.sql b/yql/essentials/tests/postgresql/initscripts/tenk2.sql
new file mode 100644
index 0000000000..6b13877c8c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/tenk2.sql
@@ -0,0 +1,10039 @@
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+INSERT INTO tenk2 VALUES
+(8800, 0, 0, 0, 0, 0, 0, 800, 800, 3800, 8800, 0, 1, 'MAAAAA', 'AAAAAA', 'AAAAxx'),
+(1891, 1, 1, 3, 1, 11, 91, 891, 1891, 1891, 1891, 182, 183, 'TUAAAA', 'BAAAAA', 'HHHHxx'),
+(3420, 2, 0, 0, 0, 0, 20, 420, 1420, 3420, 3420, 40, 41, 'OBAAAA', 'CAAAAA', 'OOOOxx'),
+(9850, 3, 0, 2, 0, 10, 50, 850, 1850, 4850, 9850, 100, 101, 'WOAAAA', 'DAAAAA', 'VVVVxx'),
+(7164, 4, 0, 0, 4, 4, 64, 164, 1164, 2164, 7164, 128, 129, 'OPAAAA', 'EAAAAA', 'AAAAxx'),
+(8009, 5, 1, 1, 9, 9, 9, 9, 9, 3009, 8009, 18, 19, 'BWAAAA', 'FAAAAA', 'HHHHxx'),
+(5057, 6, 1, 1, 7, 17, 57, 57, 1057, 57, 5057, 114, 115, 'NMAAAA', 'GAAAAA', 'OOOOxx'),
+(6701, 7, 1, 1, 1, 1, 1, 701, 701, 1701, 6701, 2, 3, 'TXAAAA', 'HAAAAA', 'VVVVxx'),
+(4321, 8, 1, 1, 1, 1, 21, 321, 321, 4321, 4321, 42, 43, 'FKAAAA', 'IAAAAA', 'AAAAxx'),
+(3043, 9, 1, 3, 3, 3, 43, 43, 1043, 3043, 3043, 86, 87, 'BNAAAA', 'JAAAAA', 'HHHHxx'),
+(1314, 10, 0, 2, 4, 14, 14, 314, 1314, 1314, 1314, 28, 29, 'OYAAAA', 'KAAAAA', 'OOOOxx'),
+(1504, 11, 0, 0, 4, 4, 4, 504, 1504, 1504, 1504, 8, 9, 'WFAAAA', 'LAAAAA', 'VVVVxx'),
+(5222, 12, 0, 2, 2, 2, 22, 222, 1222, 222, 5222, 44, 45, 'WSAAAA', 'MAAAAA', 'AAAAxx'),
+(6243, 13, 1, 3, 3, 3, 43, 243, 243, 1243, 6243, 86, 87, 'DGAAAA', 'NAAAAA', 'HHHHxx'),
+(5471, 14, 1, 3, 1, 11, 71, 471, 1471, 471, 5471, 142, 143, 'LCAAAA', 'OAAAAA', 'OOOOxx'),
+(5006, 15, 0, 2, 6, 6, 6, 6, 1006, 6, 5006, 12, 13, 'OKAAAA', 'PAAAAA', 'VVVVxx'),
+(5387, 16, 1, 3, 7, 7, 87, 387, 1387, 387, 5387, 174, 175, 'FZAAAA', 'QAAAAA', 'AAAAxx'),
+(5785, 17, 1, 1, 5, 5, 85, 785, 1785, 785, 5785, 170, 171, 'NOAAAA', 'RAAAAA', 'HHHHxx'),
+(6621, 18, 1, 1, 1, 1, 21, 621, 621, 1621, 6621, 42, 43, 'RUAAAA', 'SAAAAA', 'OOOOxx'),
+(6969, 19, 1, 1, 9, 9, 69, 969, 969, 1969, 6969, 138, 139, 'BIAAAA', 'TAAAAA', 'VVVVxx'),
+(9460, 20, 0, 0, 0, 0, 60, 460, 1460, 4460, 9460, 120, 121, 'WZAAAA', 'UAAAAA', 'AAAAxx'),
+(59, 21, 1, 3, 9, 19, 59, 59, 59, 59, 59, 118, 119, 'HCAAAA', 'VAAAAA', 'HHHHxx'),
+(8020, 22, 0, 0, 0, 0, 20, 20, 20, 3020, 8020, 40, 41, 'MWAAAA', 'WAAAAA', 'OOOOxx'),
+(7695, 23, 1, 3, 5, 15, 95, 695, 1695, 2695, 7695, 190, 191, 'ZJAAAA', 'XAAAAA', 'VVVVxx'),
+(3442, 24, 0, 2, 2, 2, 42, 442, 1442, 3442, 3442, 84, 85, 'KCAAAA', 'YAAAAA', 'AAAAxx'),
+(5119, 25, 1, 3, 9, 19, 19, 119, 1119, 119, 5119, 38, 39, 'XOAAAA', 'ZAAAAA', 'HHHHxx'),
+(646, 26, 0, 2, 6, 6, 46, 646, 646, 646, 646, 92, 93, 'WYAAAA', 'ABAAAA', 'OOOOxx'),
+(9605, 27, 1, 1, 5, 5, 5, 605, 1605, 4605, 9605, 10, 11, 'LFAAAA', 'BBAAAA', 'VVVVxx'),
+(263, 28, 1, 3, 3, 3, 63, 263, 263, 263, 263, 126, 127, 'DKAAAA', 'CBAAAA', 'AAAAxx'),
+(3269, 29, 1, 1, 9, 9, 69, 269, 1269, 3269, 3269, 138, 139, 'TVAAAA', 'DBAAAA', 'HHHHxx'),
+(1839, 30, 1, 3, 9, 19, 39, 839, 1839, 1839, 1839, 78, 79, 'TSAAAA', 'EBAAAA', 'OOOOxx'),
+(9144, 31, 0, 0, 4, 4, 44, 144, 1144, 4144, 9144, 88, 89, 'SNAAAA', 'FBAAAA', 'VVVVxx'),
+(2513, 32, 1, 1, 3, 13, 13, 513, 513, 2513, 2513, 26, 27, 'RSAAAA', 'GBAAAA', 'AAAAxx'),
+(8850, 33, 0, 2, 0, 10, 50, 850, 850, 3850, 8850, 100, 101, 'KCAAAA', 'HBAAAA', 'HHHHxx'),
+(236, 34, 0, 0, 6, 16, 36, 236, 236, 236, 236, 72, 73, 'CJAAAA', 'IBAAAA', 'OOOOxx'),
+(3162, 35, 0, 2, 2, 2, 62, 162, 1162, 3162, 3162, 124, 125, 'QRAAAA', 'JBAAAA', 'VVVVxx'),
+(4380, 36, 0, 0, 0, 0, 80, 380, 380, 4380, 4380, 160, 161, 'MMAAAA', 'KBAAAA', 'AAAAxx'),
+(8095, 37, 1, 3, 5, 15, 95, 95, 95, 3095, 8095, 190, 191, 'JZAAAA', 'LBAAAA', 'HHHHxx'),
+(209, 38, 1, 1, 9, 9, 9, 209, 209, 209, 209, 18, 19, 'BIAAAA', 'MBAAAA', 'OOOOxx'),
+(3055, 39, 1, 3, 5, 15, 55, 55, 1055, 3055, 3055, 110, 111, 'NNAAAA', 'NBAAAA', 'VVVVxx'),
+(6921, 40, 1, 1, 1, 1, 21, 921, 921, 1921, 6921, 42, 43, 'FGAAAA', 'OBAAAA', 'AAAAxx'),
+(7046, 41, 0, 2, 6, 6, 46, 46, 1046, 2046, 7046, 92, 93, 'ALAAAA', 'PBAAAA', 'HHHHxx'),
+(7912, 42, 0, 0, 2, 12, 12, 912, 1912, 2912, 7912, 24, 25, 'ISAAAA', 'QBAAAA', 'OOOOxx'),
+(7267, 43, 1, 3, 7, 7, 67, 267, 1267, 2267, 7267, 134, 135, 'NTAAAA', 'RBAAAA', 'VVVVxx'),
+(3599, 44, 1, 3, 9, 19, 99, 599, 1599, 3599, 3599, 198, 199, 'LIAAAA', 'SBAAAA', 'AAAAxx'),
+(923, 45, 1, 3, 3, 3, 23, 923, 923, 923, 923, 46, 47, 'NJAAAA', 'TBAAAA', 'HHHHxx'),
+(1437, 46, 1, 1, 7, 17, 37, 437, 1437, 1437, 1437, 74, 75, 'HDAAAA', 'UBAAAA', 'OOOOxx'),
+(6439, 47, 1, 3, 9, 19, 39, 439, 439, 1439, 6439, 78, 79, 'RNAAAA', 'VBAAAA', 'VVVVxx'),
+(6989, 48, 1, 1, 9, 9, 89, 989, 989, 1989, 6989, 178, 179, 'VIAAAA', 'WBAAAA', 'AAAAxx'),
+(8798, 49, 0, 2, 8, 18, 98, 798, 798, 3798, 8798, 196, 197, 'KAAAAA', 'XBAAAA', 'HHHHxx'),
+(5960, 50, 0, 0, 0, 0, 60, 960, 1960, 960, 5960, 120, 121, 'GVAAAA', 'YBAAAA', 'OOOOxx'),
+(5832, 51, 0, 0, 2, 12, 32, 832, 1832, 832, 5832, 64, 65, 'IQAAAA', 'ZBAAAA', 'VVVVxx'),
+(6066, 52, 0, 2, 6, 6, 66, 66, 66, 1066, 6066, 132, 133, 'IZAAAA', 'ACAAAA', 'AAAAxx'),
+(322, 53, 0, 2, 2, 2, 22, 322, 322, 322, 322, 44, 45, 'KMAAAA', 'BCAAAA', 'HHHHxx'),
+(8321, 54, 1, 1, 1, 1, 21, 321, 321, 3321, 8321, 42, 43, 'BIAAAA', 'CCAAAA', 'OOOOxx'),
+(734, 55, 0, 2, 4, 14, 34, 734, 734, 734, 734, 68, 69, 'GCAAAA', 'DCAAAA', 'VVVVxx'),
+(688, 56, 0, 0, 8, 8, 88, 688, 688, 688, 688, 176, 177, 'MAAAAA', 'ECAAAA', 'AAAAxx'),
+(4212, 57, 0, 0, 2, 12, 12, 212, 212, 4212, 4212, 24, 25, 'AGAAAA', 'FCAAAA', 'HHHHxx'),
+(9653, 58, 1, 1, 3, 13, 53, 653, 1653, 4653, 9653, 106, 107, 'HHAAAA', 'GCAAAA', 'OOOOxx'),
+(2677, 59, 1, 1, 7, 17, 77, 677, 677, 2677, 2677, 154, 155, 'ZYAAAA', 'HCAAAA', 'VVVVxx'),
+(5423, 60, 1, 3, 3, 3, 23, 423, 1423, 423, 5423, 46, 47, 'PAAAAA', 'ICAAAA', 'AAAAxx'),
+(2592, 61, 0, 0, 2, 12, 92, 592, 592, 2592, 2592, 184, 185, 'SVAAAA', 'JCAAAA', 'HHHHxx'),
+(3233, 62, 1, 1, 3, 13, 33, 233, 1233, 3233, 3233, 66, 67, 'JUAAAA', 'KCAAAA', 'OOOOxx'),
+(5032, 63, 0, 0, 2, 12, 32, 32, 1032, 32, 5032, 64, 65, 'OLAAAA', 'LCAAAA', 'VVVVxx'),
+(2525, 64, 1, 1, 5, 5, 25, 525, 525, 2525, 2525, 50, 51, 'DTAAAA', 'MCAAAA', 'AAAAxx'),
+(4450, 65, 0, 2, 0, 10, 50, 450, 450, 4450, 4450, 100, 101, 'EPAAAA', 'NCAAAA', 'HHHHxx'),
+(5778, 66, 0, 2, 8, 18, 78, 778, 1778, 778, 5778, 156, 157, 'GOAAAA', 'OCAAAA', 'OOOOxx'),
+(5852, 67, 0, 0, 2, 12, 52, 852, 1852, 852, 5852, 104, 105, 'CRAAAA', 'PCAAAA', 'VVVVxx'),
+(5404, 68, 0, 0, 4, 4, 4, 404, 1404, 404, 5404, 8, 9, 'WZAAAA', 'QCAAAA', 'AAAAxx'),
+(6223, 69, 1, 3, 3, 3, 23, 223, 223, 1223, 6223, 46, 47, 'JFAAAA', 'RCAAAA', 'HHHHxx'),
+(6133, 70, 1, 1, 3, 13, 33, 133, 133, 1133, 6133, 66, 67, 'XBAAAA', 'SCAAAA', 'OOOOxx'),
+(9112, 71, 0, 0, 2, 12, 12, 112, 1112, 4112, 9112, 24, 25, 'MMAAAA', 'TCAAAA', 'VVVVxx'),
+(7575, 72, 1, 3, 5, 15, 75, 575, 1575, 2575, 7575, 150, 151, 'JFAAAA', 'UCAAAA', 'AAAAxx'),
+(7414, 73, 0, 2, 4, 14, 14, 414, 1414, 2414, 7414, 28, 29, 'EZAAAA', 'VCAAAA', 'HHHHxx'),
+(9741, 74, 1, 1, 1, 1, 41, 741, 1741, 4741, 9741, 82, 83, 'RKAAAA', 'WCAAAA', 'OOOOxx'),
+(3767, 75, 1, 3, 7, 7, 67, 767, 1767, 3767, 3767, 134, 135, 'XOAAAA', 'XCAAAA', 'VVVVxx'),
+(9372, 76, 0, 0, 2, 12, 72, 372, 1372, 4372, 9372, 144, 145, 'MWAAAA', 'YCAAAA', 'AAAAxx'),
+(8976, 77, 0, 0, 6, 16, 76, 976, 976, 3976, 8976, 152, 153, 'GHAAAA', 'ZCAAAA', 'HHHHxx'),
+(4071, 78, 1, 3, 1, 11, 71, 71, 71, 4071, 4071, 142, 143, 'PAAAAA', 'ADAAAA', 'OOOOxx'),
+(1311, 79, 1, 3, 1, 11, 11, 311, 1311, 1311, 1311, 22, 23, 'LYAAAA', 'BDAAAA', 'VVVVxx'),
+(2604, 80, 0, 0, 4, 4, 4, 604, 604, 2604, 2604, 8, 9, 'EWAAAA', 'CDAAAA', 'AAAAxx'),
+(8840, 81, 0, 0, 0, 0, 40, 840, 840, 3840, 8840, 80, 81, 'ACAAAA', 'DDAAAA', 'HHHHxx'),
+(567, 82, 1, 3, 7, 7, 67, 567, 567, 567, 567, 134, 135, 'VVAAAA', 'EDAAAA', 'OOOOxx'),
+(5215, 83, 1, 3, 5, 15, 15, 215, 1215, 215, 5215, 30, 31, 'PSAAAA', 'FDAAAA', 'VVVVxx'),
+(5474, 84, 0, 2, 4, 14, 74, 474, 1474, 474, 5474, 148, 149, 'OCAAAA', 'GDAAAA', 'AAAAxx'),
+(3906, 85, 0, 2, 6, 6, 6, 906, 1906, 3906, 3906, 12, 13, 'GUAAAA', 'HDAAAA', 'HHHHxx'),
+(1769, 86, 1, 1, 9, 9, 69, 769, 1769, 1769, 1769, 138, 139, 'BQAAAA', 'IDAAAA', 'OOOOxx'),
+(1454, 87, 0, 2, 4, 14, 54, 454, 1454, 1454, 1454, 108, 109, 'YDAAAA', 'JDAAAA', 'VVVVxx'),
+(6877, 88, 1, 1, 7, 17, 77, 877, 877, 1877, 6877, 154, 155, 'NEAAAA', 'KDAAAA', 'AAAAxx'),
+(6501, 89, 1, 1, 1, 1, 1, 501, 501, 1501, 6501, 2, 3, 'BQAAAA', 'LDAAAA', 'HHHHxx'),
+(934, 90, 0, 2, 4, 14, 34, 934, 934, 934, 934, 68, 69, 'YJAAAA', 'MDAAAA', 'OOOOxx'),
+(4075, 91, 1, 3, 5, 15, 75, 75, 75, 4075, 4075, 150, 151, 'TAAAAA', 'NDAAAA', 'VVVVxx'),
+(3180, 92, 0, 0, 0, 0, 80, 180, 1180, 3180, 3180, 160, 161, 'ISAAAA', 'ODAAAA', 'AAAAxx'),
+(7787, 93, 1, 3, 7, 7, 87, 787, 1787, 2787, 7787, 174, 175, 'NNAAAA', 'PDAAAA', 'HHHHxx'),
+(6401, 94, 1, 1, 1, 1, 1, 401, 401, 1401, 6401, 2, 3, 'FMAAAA', 'QDAAAA', 'OOOOxx'),
+(4244, 95, 0, 0, 4, 4, 44, 244, 244, 4244, 4244, 88, 89, 'GHAAAA', 'RDAAAA', 'VVVVxx'),
+(4591, 96, 1, 3, 1, 11, 91, 591, 591, 4591, 4591, 182, 183, 'PUAAAA', 'SDAAAA', 'AAAAxx'),
+(4113, 97, 1, 1, 3, 13, 13, 113, 113, 4113, 4113, 26, 27, 'FCAAAA', 'TDAAAA', 'HHHHxx'),
+(5925, 98, 1, 1, 5, 5, 25, 925, 1925, 925, 5925, 50, 51, 'XTAAAA', 'UDAAAA', 'OOOOxx'),
+(1987, 99, 1, 3, 7, 7, 87, 987, 1987, 1987, 1987, 174, 175, 'LYAAAA', 'VDAAAA', 'VVVVxx'),
+(8248, 100, 0, 0, 8, 8, 48, 248, 248, 3248, 8248, 96, 97, 'GFAAAA', 'WDAAAA', 'AAAAxx'),
+(4151, 101, 1, 3, 1, 11, 51, 151, 151, 4151, 4151, 102, 103, 'RDAAAA', 'XDAAAA', 'HHHHxx'),
+(8670, 102, 0, 2, 0, 10, 70, 670, 670, 3670, 8670, 140, 141, 'MVAAAA', 'YDAAAA', 'OOOOxx'),
+(6194, 103, 0, 2, 4, 14, 94, 194, 194, 1194, 6194, 188, 189, 'GEAAAA', 'ZDAAAA', 'VVVVxx'),
+(88, 104, 0, 0, 8, 8, 88, 88, 88, 88, 88, 176, 177, 'KDAAAA', 'AEAAAA', 'AAAAxx'),
+(4058, 105, 0, 2, 8, 18, 58, 58, 58, 4058, 4058, 116, 117, 'CAAAAA', 'BEAAAA', 'HHHHxx'),
+(2742, 106, 0, 2, 2, 2, 42, 742, 742, 2742, 2742, 84, 85, 'MBAAAA', 'CEAAAA', 'OOOOxx'),
+(8275, 107, 1, 3, 5, 15, 75, 275, 275, 3275, 8275, 150, 151, 'HGAAAA', 'DEAAAA', 'VVVVxx'),
+(4258, 108, 0, 2, 8, 18, 58, 258, 258, 4258, 4258, 116, 117, 'UHAAAA', 'EEAAAA', 'AAAAxx'),
+(6129, 109, 1, 1, 9, 9, 29, 129, 129, 1129, 6129, 58, 59, 'TBAAAA', 'FEAAAA', 'HHHHxx'),
+(7243, 110, 1, 3, 3, 3, 43, 243, 1243, 2243, 7243, 86, 87, 'PSAAAA', 'GEAAAA', 'OOOOxx'),
+(2392, 111, 0, 0, 2, 12, 92, 392, 392, 2392, 2392, 184, 185, 'AOAAAA', 'HEAAAA', 'VVVVxx'),
+(9853, 112, 1, 1, 3, 13, 53, 853, 1853, 4853, 9853, 106, 107, 'ZOAAAA', 'IEAAAA', 'AAAAxx'),
+(6064, 113, 0, 0, 4, 4, 64, 64, 64, 1064, 6064, 128, 129, 'GZAAAA', 'JEAAAA', 'HHHHxx'),
+(4391, 114, 1, 3, 1, 11, 91, 391, 391, 4391, 4391, 182, 183, 'XMAAAA', 'KEAAAA', 'OOOOxx'),
+(726, 115, 0, 2, 6, 6, 26, 726, 726, 726, 726, 52, 53, 'YBAAAA', 'LEAAAA', 'VVVVxx'),
+(6957, 116, 1, 1, 7, 17, 57, 957, 957, 1957, 6957, 114, 115, 'PHAAAA', 'MEAAAA', 'AAAAxx'),
+(3853, 117, 1, 1, 3, 13, 53, 853, 1853, 3853, 3853, 106, 107, 'FSAAAA', 'NEAAAA', 'HHHHxx'),
+(4524, 118, 0, 0, 4, 4, 24, 524, 524, 4524, 4524, 48, 49, 'ASAAAA', 'OEAAAA', 'OOOOxx'),
+(5330, 119, 0, 2, 0, 10, 30, 330, 1330, 330, 5330, 60, 61, 'AXAAAA', 'PEAAAA', 'VVVVxx'),
+(6671, 120, 1, 3, 1, 11, 71, 671, 671, 1671, 6671, 142, 143, 'PWAAAA', 'QEAAAA', 'AAAAxx'),
+(5314, 121, 0, 2, 4, 14, 14, 314, 1314, 314, 5314, 28, 29, 'KWAAAA', 'REAAAA', 'HHHHxx'),
+(9202, 122, 0, 2, 2, 2, 2, 202, 1202, 4202, 9202, 4, 5, 'YPAAAA', 'SEAAAA', 'OOOOxx'),
+(4596, 123, 0, 0, 6, 16, 96, 596, 596, 4596, 4596, 192, 193, 'UUAAAA', 'TEAAAA', 'VVVVxx'),
+(8951, 124, 1, 3, 1, 11, 51, 951, 951, 3951, 8951, 102, 103, 'HGAAAA', 'UEAAAA', 'AAAAxx'),
+(9902, 125, 0, 2, 2, 2, 2, 902, 1902, 4902, 9902, 4, 5, 'WQAAAA', 'VEAAAA', 'HHHHxx'),
+(1440, 126, 0, 0, 0, 0, 40, 440, 1440, 1440, 1440, 80, 81, 'KDAAAA', 'WEAAAA', 'OOOOxx'),
+(5339, 127, 1, 3, 9, 19, 39, 339, 1339, 339, 5339, 78, 79, 'JXAAAA', 'XEAAAA', 'VVVVxx'),
+(3371, 128, 1, 3, 1, 11, 71, 371, 1371, 3371, 3371, 142, 143, 'RZAAAA', 'YEAAAA', 'AAAAxx'),
+(4467, 129, 1, 3, 7, 7, 67, 467, 467, 4467, 4467, 134, 135, 'VPAAAA', 'ZEAAAA', 'HHHHxx'),
+(6216, 130, 0, 0, 6, 16, 16, 216, 216, 1216, 6216, 32, 33, 'CFAAAA', 'AFAAAA', 'OOOOxx'),
+(5364, 131, 0, 0, 4, 4, 64, 364, 1364, 364, 5364, 128, 129, 'IYAAAA', 'BFAAAA', 'VVVVxx'),
+(7547, 132, 1, 3, 7, 7, 47, 547, 1547, 2547, 7547, 94, 95, 'HEAAAA', 'CFAAAA', 'AAAAxx'),
+(4338, 133, 0, 2, 8, 18, 38, 338, 338, 4338, 4338, 76, 77, 'WKAAAA', 'DFAAAA', 'HHHHxx'),
+(3481, 134, 1, 1, 1, 1, 81, 481, 1481, 3481, 3481, 162, 163, 'XDAAAA', 'EFAAAA', 'OOOOxx'),
+(826, 135, 0, 2, 6, 6, 26, 826, 826, 826, 826, 52, 53, 'UFAAAA', 'FFAAAA', 'VVVVxx'),
+(3647, 136, 1, 3, 7, 7, 47, 647, 1647, 3647, 3647, 94, 95, 'HKAAAA', 'GFAAAA', 'AAAAxx'),
+(3337, 137, 1, 1, 7, 17, 37, 337, 1337, 3337, 3337, 74, 75, 'JYAAAA', 'HFAAAA', 'HHHHxx'),
+(3591, 138, 1, 3, 1, 11, 91, 591, 1591, 3591, 3591, 182, 183, 'DIAAAA', 'IFAAAA', 'OOOOxx'),
+(7192, 139, 0, 0, 2, 12, 92, 192, 1192, 2192, 7192, 184, 185, 'QQAAAA', 'JFAAAA', 'VVVVxx'),
+(1078, 140, 0, 2, 8, 18, 78, 78, 1078, 1078, 1078, 156, 157, 'MPAAAA', 'KFAAAA', 'AAAAxx'),
+(1310, 141, 0, 2, 0, 10, 10, 310, 1310, 1310, 1310, 20, 21, 'KYAAAA', 'LFAAAA', 'HHHHxx'),
+(9642, 142, 0, 2, 2, 2, 42, 642, 1642, 4642, 9642, 84, 85, 'WGAAAA', 'MFAAAA', 'OOOOxx'),
+(39, 143, 1, 3, 9, 19, 39, 39, 39, 39, 39, 78, 79, 'NBAAAA', 'NFAAAA', 'VVVVxx'),
+(8682, 144, 0, 2, 2, 2, 82, 682, 682, 3682, 8682, 164, 165, 'YVAAAA', 'OFAAAA', 'AAAAxx'),
+(1794, 145, 0, 2, 4, 14, 94, 794, 1794, 1794, 1794, 188, 189, 'ARAAAA', 'PFAAAA', 'HHHHxx'),
+(5630, 146, 0, 2, 0, 10, 30, 630, 1630, 630, 5630, 60, 61, 'OIAAAA', 'QFAAAA', 'OOOOxx'),
+(6748, 147, 0, 0, 8, 8, 48, 748, 748, 1748, 6748, 96, 97, 'OZAAAA', 'RFAAAA', 'VVVVxx'),
+(3766, 148, 0, 2, 6, 6, 66, 766, 1766, 3766, 3766, 132, 133, 'WOAAAA', 'SFAAAA', 'AAAAxx'),
+(6403, 149, 1, 3, 3, 3, 3, 403, 403, 1403, 6403, 6, 7, 'HMAAAA', 'TFAAAA', 'HHHHxx'),
+(175, 150, 1, 3, 5, 15, 75, 175, 175, 175, 175, 150, 151, 'TGAAAA', 'UFAAAA', 'OOOOxx'),
+(2179, 151, 1, 3, 9, 19, 79, 179, 179, 2179, 2179, 158, 159, 'VFAAAA', 'VFAAAA', 'VVVVxx'),
+(7897, 152, 1, 1, 7, 17, 97, 897, 1897, 2897, 7897, 194, 195, 'TRAAAA', 'WFAAAA', 'AAAAxx'),
+(2760, 153, 0, 0, 0, 0, 60, 760, 760, 2760, 2760, 120, 121, 'ECAAAA', 'XFAAAA', 'HHHHxx'),
+(1675, 154, 1, 3, 5, 15, 75, 675, 1675, 1675, 1675, 150, 151, 'LMAAAA', 'YFAAAA', 'OOOOxx'),
+(2564, 155, 0, 0, 4, 4, 64, 564, 564, 2564, 2564, 128, 129, 'QUAAAA', 'ZFAAAA', 'VVVVxx'),
+(157, 156, 1, 1, 7, 17, 57, 157, 157, 157, 157, 114, 115, 'BGAAAA', 'AGAAAA', 'AAAAxx'),
+(8779, 157, 1, 3, 9, 19, 79, 779, 779, 3779, 8779, 158, 159, 'RZAAAA', 'BGAAAA', 'HHHHxx'),
+(9591, 158, 1, 3, 1, 11, 91, 591, 1591, 4591, 9591, 182, 183, 'XEAAAA', 'CGAAAA', 'OOOOxx'),
+(8732, 159, 0, 0, 2, 12, 32, 732, 732, 3732, 8732, 64, 65, 'WXAAAA', 'DGAAAA', 'VVVVxx'),
+(139, 160, 1, 3, 9, 19, 39, 139, 139, 139, 139, 78, 79, 'JFAAAA', 'EGAAAA', 'AAAAxx'),
+(5372, 161, 0, 0, 2, 12, 72, 372, 1372, 372, 5372, 144, 145, 'QYAAAA', 'FGAAAA', 'HHHHxx'),
+(1278, 162, 0, 2, 8, 18, 78, 278, 1278, 1278, 1278, 156, 157, 'EXAAAA', 'GGAAAA', 'OOOOxx'),
+(4697, 163, 1, 1, 7, 17, 97, 697, 697, 4697, 4697, 194, 195, 'RYAAAA', 'HGAAAA', 'VVVVxx'),
+(8610, 164, 0, 2, 0, 10, 10, 610, 610, 3610, 8610, 20, 21, 'ETAAAA', 'IGAAAA', 'AAAAxx'),
+(8180, 165, 0, 0, 0, 0, 80, 180, 180, 3180, 8180, 160, 161, 'QCAAAA', 'JGAAAA', 'HHHHxx'),
+(2399, 166, 1, 3, 9, 19, 99, 399, 399, 2399, 2399, 198, 199, 'HOAAAA', 'KGAAAA', 'OOOOxx'),
+(615, 167, 1, 3, 5, 15, 15, 615, 615, 615, 615, 30, 31, 'RXAAAA', 'LGAAAA', 'VVVVxx'),
+(7629, 168, 1, 1, 9, 9, 29, 629, 1629, 2629, 7629, 58, 59, 'LHAAAA', 'MGAAAA', 'AAAAxx'),
+(7628, 169, 0, 0, 8, 8, 28, 628, 1628, 2628, 7628, 56, 57, 'KHAAAA', 'NGAAAA', 'HHHHxx'),
+(4659, 170, 1, 3, 9, 19, 59, 659, 659, 4659, 4659, 118, 119, 'FXAAAA', 'OGAAAA', 'OOOOxx'),
+(5865, 171, 1, 1, 5, 5, 65, 865, 1865, 865, 5865, 130, 131, 'PRAAAA', 'PGAAAA', 'VVVVxx'),
+(3973, 172, 1, 1, 3, 13, 73, 973, 1973, 3973, 3973, 146, 147, 'VWAAAA', 'QGAAAA', 'AAAAxx'),
+(552, 173, 0, 0, 2, 12, 52, 552, 552, 552, 552, 104, 105, 'GVAAAA', 'RGAAAA', 'HHHHxx'),
+(708, 174, 0, 0, 8, 8, 8, 708, 708, 708, 708, 16, 17, 'GBAAAA', 'SGAAAA', 'OOOOxx'),
+(3550, 175, 0, 2, 0, 10, 50, 550, 1550, 3550, 3550, 100, 101, 'OGAAAA', 'TGAAAA', 'VVVVxx'),
+(5547, 176, 1, 3, 7, 7, 47, 547, 1547, 547, 5547, 94, 95, 'JFAAAA', 'UGAAAA', 'AAAAxx'),
+(489, 177, 1, 1, 9, 9, 89, 489, 489, 489, 489, 178, 179, 'VSAAAA', 'VGAAAA', 'HHHHxx'),
+(3794, 178, 0, 2, 4, 14, 94, 794, 1794, 3794, 3794, 188, 189, 'YPAAAA', 'WGAAAA', 'OOOOxx'),
+(9479, 179, 1, 3, 9, 19, 79, 479, 1479, 4479, 9479, 158, 159, 'PAAAAA', 'XGAAAA', 'VVVVxx'),
+(6435, 180, 1, 3, 5, 15, 35, 435, 435, 1435, 6435, 70, 71, 'NNAAAA', 'YGAAAA', 'AAAAxx'),
+(5120, 181, 0, 0, 0, 0, 20, 120, 1120, 120, 5120, 40, 41, 'YOAAAA', 'ZGAAAA', 'HHHHxx'),
+(3615, 182, 1, 3, 5, 15, 15, 615, 1615, 3615, 3615, 30, 31, 'BJAAAA', 'AHAAAA', 'OOOOxx'),
+(8399, 183, 1, 3, 9, 19, 99, 399, 399, 3399, 8399, 198, 199, 'BLAAAA', 'BHAAAA', 'VVVVxx'),
+(2155, 184, 1, 3, 5, 15, 55, 155, 155, 2155, 2155, 110, 111, 'XEAAAA', 'CHAAAA', 'AAAAxx'),
+(6690, 185, 0, 2, 0, 10, 90, 690, 690, 1690, 6690, 180, 181, 'IXAAAA', 'DHAAAA', 'HHHHxx'),
+(1683, 186, 1, 3, 3, 3, 83, 683, 1683, 1683, 1683, 166, 167, 'TMAAAA', 'EHAAAA', 'OOOOxx'),
+(6302, 187, 0, 2, 2, 2, 2, 302, 302, 1302, 6302, 4, 5, 'KIAAAA', 'FHAAAA', 'VVVVxx'),
+(516, 188, 0, 0, 6, 16, 16, 516, 516, 516, 516, 32, 33, 'WTAAAA', 'GHAAAA', 'AAAAxx'),
+(3901, 189, 1, 1, 1, 1, 1, 901, 1901, 3901, 3901, 2, 3, 'BUAAAA', 'HHAAAA', 'HHHHxx'),
+(6938, 190, 0, 2, 8, 18, 38, 938, 938, 1938, 6938, 76, 77, 'WGAAAA', 'IHAAAA', 'OOOOxx'),
+(7484, 191, 0, 0, 4, 4, 84, 484, 1484, 2484, 7484, 168, 169, 'WBAAAA', 'JHAAAA', 'VVVVxx'),
+(7424, 192, 0, 0, 4, 4, 24, 424, 1424, 2424, 7424, 48, 49, 'OZAAAA', 'KHAAAA', 'AAAAxx'),
+(9410, 193, 0, 2, 0, 10, 10, 410, 1410, 4410, 9410, 20, 21, 'YXAAAA', 'LHAAAA', 'HHHHxx'),
+(1714, 194, 0, 2, 4, 14, 14, 714, 1714, 1714, 1714, 28, 29, 'YNAAAA', 'MHAAAA', 'OOOOxx'),
+(8278, 195, 0, 2, 8, 18, 78, 278, 278, 3278, 8278, 156, 157, 'KGAAAA', 'NHAAAA', 'VVVVxx'),
+(3158, 196, 0, 2, 8, 18, 58, 158, 1158, 3158, 3158, 116, 117, 'MRAAAA', 'OHAAAA', 'AAAAxx'),
+(2511, 197, 1, 3, 1, 11, 11, 511, 511, 2511, 2511, 22, 23, 'PSAAAA', 'PHAAAA', 'HHHHxx'),
+(2912, 198, 0, 0, 2, 12, 12, 912, 912, 2912, 2912, 24, 25, 'AIAAAA', 'QHAAAA', 'OOOOxx'),
+(2648, 199, 0, 0, 8, 8, 48, 648, 648, 2648, 2648, 96, 97, 'WXAAAA', 'RHAAAA', 'VVVVxx'),
+(9385, 200, 1, 1, 5, 5, 85, 385, 1385, 4385, 9385, 170, 171, 'ZWAAAA', 'SHAAAA', 'AAAAxx'),
+(7545, 201, 1, 1, 5, 5, 45, 545, 1545, 2545, 7545, 90, 91, 'FEAAAA', 'THAAAA', 'HHHHxx'),
+(8407, 202, 1, 3, 7, 7, 7, 407, 407, 3407, 8407, 14, 15, 'JLAAAA', 'UHAAAA', 'OOOOxx'),
+(5893, 203, 1, 1, 3, 13, 93, 893, 1893, 893, 5893, 186, 187, 'RSAAAA', 'VHAAAA', 'VVVVxx'),
+(7049, 204, 1, 1, 9, 9, 49, 49, 1049, 2049, 7049, 98, 99, 'DLAAAA', 'WHAAAA', 'AAAAxx'),
+(6812, 205, 0, 0, 2, 12, 12, 812, 812, 1812, 6812, 24, 25, 'ACAAAA', 'XHAAAA', 'HHHHxx'),
+(3649, 206, 1, 1, 9, 9, 49, 649, 1649, 3649, 3649, 98, 99, 'JKAAAA', 'YHAAAA', 'OOOOxx'),
+(9275, 207, 1, 3, 5, 15, 75, 275, 1275, 4275, 9275, 150, 151, 'TSAAAA', 'ZHAAAA', 'VVVVxx'),
+(1179, 208, 1, 3, 9, 19, 79, 179, 1179, 1179, 1179, 158, 159, 'JTAAAA', 'AIAAAA', 'AAAAxx'),
+(969, 209, 1, 1, 9, 9, 69, 969, 969, 969, 969, 138, 139, 'HLAAAA', 'BIAAAA', 'HHHHxx'),
+(7920, 210, 0, 0, 0, 0, 20, 920, 1920, 2920, 7920, 40, 41, 'QSAAAA', 'CIAAAA', 'OOOOxx'),
+(998, 211, 0, 2, 8, 18, 98, 998, 998, 998, 998, 196, 197, 'KMAAAA', 'DIAAAA', 'VVVVxx'),
+(3958, 212, 0, 2, 8, 18, 58, 958, 1958, 3958, 3958, 116, 117, 'GWAAAA', 'EIAAAA', 'AAAAxx'),
+(6052, 213, 0, 0, 2, 12, 52, 52, 52, 1052, 6052, 104, 105, 'UYAAAA', 'FIAAAA', 'HHHHxx'),
+(8791, 214, 1, 3, 1, 11, 91, 791, 791, 3791, 8791, 182, 183, 'DAAAAA', 'GIAAAA', 'OOOOxx'),
+(5191, 215, 1, 3, 1, 11, 91, 191, 1191, 191, 5191, 182, 183, 'RRAAAA', 'HIAAAA', 'VVVVxx'),
+(4267, 216, 1, 3, 7, 7, 67, 267, 267, 4267, 4267, 134, 135, 'DIAAAA', 'IIAAAA', 'AAAAxx'),
+(2829, 217, 1, 1, 9, 9, 29, 829, 829, 2829, 2829, 58, 59, 'VEAAAA', 'JIAAAA', 'HHHHxx'),
+(6396, 218, 0, 0, 6, 16, 96, 396, 396, 1396, 6396, 192, 193, 'AMAAAA', 'KIAAAA', 'OOOOxx'),
+(9413, 219, 1, 1, 3, 13, 13, 413, 1413, 4413, 9413, 26, 27, 'BYAAAA', 'LIAAAA', 'VVVVxx'),
+(614, 220, 0, 2, 4, 14, 14, 614, 614, 614, 614, 28, 29, 'QXAAAA', 'MIAAAA', 'AAAAxx'),
+(4660, 221, 0, 0, 0, 0, 60, 660, 660, 4660, 4660, 120, 121, 'GXAAAA', 'NIAAAA', 'HHHHxx'),
+(8834, 222, 0, 2, 4, 14, 34, 834, 834, 3834, 8834, 68, 69, 'UBAAAA', 'OIAAAA', 'OOOOxx'),
+(2767, 223, 1, 3, 7, 7, 67, 767, 767, 2767, 2767, 134, 135, 'LCAAAA', 'PIAAAA', 'VVVVxx'),
+(2444, 224, 0, 0, 4, 4, 44, 444, 444, 2444, 2444, 88, 89, 'AQAAAA', 'QIAAAA', 'AAAAxx'),
+(4129, 225, 1, 1, 9, 9, 29, 129, 129, 4129, 4129, 58, 59, 'VCAAAA', 'RIAAAA', 'HHHHxx'),
+(3394, 226, 0, 2, 4, 14, 94, 394, 1394, 3394, 3394, 188, 189, 'OAAAAA', 'SIAAAA', 'OOOOxx'),
+(2705, 227, 1, 1, 5, 5, 5, 705, 705, 2705, 2705, 10, 11, 'BAAAAA', 'TIAAAA', 'VVVVxx'),
+(8499, 228, 1, 3, 9, 19, 99, 499, 499, 3499, 8499, 198, 199, 'XOAAAA', 'UIAAAA', 'AAAAxx'),
+(8852, 229, 0, 0, 2, 12, 52, 852, 852, 3852, 8852, 104, 105, 'MCAAAA', 'VIAAAA', 'HHHHxx'),
+(6174, 230, 0, 2, 4, 14, 74, 174, 174, 1174, 6174, 148, 149, 'MDAAAA', 'WIAAAA', 'OOOOxx'),
+(750, 231, 0, 2, 0, 10, 50, 750, 750, 750, 750, 100, 101, 'WCAAAA', 'XIAAAA', 'VVVVxx'),
+(8164, 232, 0, 0, 4, 4, 64, 164, 164, 3164, 8164, 128, 129, 'ACAAAA', 'YIAAAA', 'AAAAxx'),
+(4930, 233, 0, 2, 0, 10, 30, 930, 930, 4930, 4930, 60, 61, 'QHAAAA', 'ZIAAAA', 'HHHHxx'),
+(9904, 234, 0, 0, 4, 4, 4, 904, 1904, 4904, 9904, 8, 9, 'YQAAAA', 'AJAAAA', 'OOOOxx'),
+(7378, 235, 0, 2, 8, 18, 78, 378, 1378, 2378, 7378, 156, 157, 'UXAAAA', 'BJAAAA', 'VVVVxx'),
+(2927, 236, 1, 3, 7, 7, 27, 927, 927, 2927, 2927, 54, 55, 'PIAAAA', 'CJAAAA', 'AAAAxx'),
+(7155, 237, 1, 3, 5, 15, 55, 155, 1155, 2155, 7155, 110, 111, 'FPAAAA', 'DJAAAA', 'HHHHxx'),
+(1302, 238, 0, 2, 2, 2, 2, 302, 1302, 1302, 1302, 4, 5, 'CYAAAA', 'EJAAAA', 'OOOOxx'),
+(5904, 239, 0, 0, 4, 4, 4, 904, 1904, 904, 5904, 8, 9, 'CTAAAA', 'FJAAAA', 'VVVVxx'),
+(9687, 240, 1, 3, 7, 7, 87, 687, 1687, 4687, 9687, 174, 175, 'PIAAAA', 'GJAAAA', 'AAAAxx'),
+(3553, 241, 1, 1, 3, 13, 53, 553, 1553, 3553, 3553, 106, 107, 'RGAAAA', 'HJAAAA', 'HHHHxx'),
+(4447, 242, 1, 3, 7, 7, 47, 447, 447, 4447, 4447, 94, 95, 'BPAAAA', 'IJAAAA', 'OOOOxx'),
+(6878, 243, 0, 2, 8, 18, 78, 878, 878, 1878, 6878, 156, 157, 'OEAAAA', 'JJAAAA', 'VVVVxx'),
+(9470, 244, 0, 2, 0, 10, 70, 470, 1470, 4470, 9470, 140, 141, 'GAAAAA', 'KJAAAA', 'AAAAxx'),
+(9735, 245, 1, 3, 5, 15, 35, 735, 1735, 4735, 9735, 70, 71, 'LKAAAA', 'LJAAAA', 'HHHHxx'),
+(5967, 246, 1, 3, 7, 7, 67, 967, 1967, 967, 5967, 134, 135, 'NVAAAA', 'MJAAAA', 'OOOOxx'),
+(6601, 247, 1, 1, 1, 1, 1, 601, 601, 1601, 6601, 2, 3, 'XTAAAA', 'NJAAAA', 'VVVVxx'),
+(7631, 248, 1, 3, 1, 11, 31, 631, 1631, 2631, 7631, 62, 63, 'NHAAAA', 'OJAAAA', 'AAAAxx'),
+(3559, 249, 1, 3, 9, 19, 59, 559, 1559, 3559, 3559, 118, 119, 'XGAAAA', 'PJAAAA', 'HHHHxx'),
+(2247, 250, 1, 3, 7, 7, 47, 247, 247, 2247, 2247, 94, 95, 'LIAAAA', 'QJAAAA', 'OOOOxx'),
+(9649, 251, 1, 1, 9, 9, 49, 649, 1649, 4649, 9649, 98, 99, 'DHAAAA', 'RJAAAA', 'VVVVxx'),
+(808, 252, 0, 0, 8, 8, 8, 808, 808, 808, 808, 16, 17, 'CFAAAA', 'SJAAAA', 'AAAAxx'),
+(240, 253, 0, 0, 0, 0, 40, 240, 240, 240, 240, 80, 81, 'GJAAAA', 'TJAAAA', 'HHHHxx'),
+(5031, 254, 1, 3, 1, 11, 31, 31, 1031, 31, 5031, 62, 63, 'NLAAAA', 'UJAAAA', 'OOOOxx'),
+(9563, 255, 1, 3, 3, 3, 63, 563, 1563, 4563, 9563, 126, 127, 'VDAAAA', 'VJAAAA', 'VVVVxx'),
+(5656, 256, 0, 0, 6, 16, 56, 656, 1656, 656, 5656, 112, 113, 'OJAAAA', 'WJAAAA', 'AAAAxx'),
+(3886, 257, 0, 2, 6, 6, 86, 886, 1886, 3886, 3886, 172, 173, 'MTAAAA', 'XJAAAA', 'HHHHxx'),
+(2431, 258, 1, 3, 1, 11, 31, 431, 431, 2431, 2431, 62, 63, 'NPAAAA', 'YJAAAA', 'OOOOxx'),
+(5560, 259, 0, 0, 0, 0, 60, 560, 1560, 560, 5560, 120, 121, 'WFAAAA', 'ZJAAAA', 'VVVVxx'),
+(9065, 260, 1, 1, 5, 5, 65, 65, 1065, 4065, 9065, 130, 131, 'RKAAAA', 'AKAAAA', 'AAAAxx'),
+(8130, 261, 0, 2, 0, 10, 30, 130, 130, 3130, 8130, 60, 61, 'SAAAAA', 'BKAAAA', 'HHHHxx'),
+(4054, 262, 0, 2, 4, 14, 54, 54, 54, 4054, 4054, 108, 109, 'YZAAAA', 'CKAAAA', 'OOOOxx'),
+(873, 263, 1, 1, 3, 13, 73, 873, 873, 873, 873, 146, 147, 'PHAAAA', 'DKAAAA', 'VVVVxx'),
+(3092, 264, 0, 0, 2, 12, 92, 92, 1092, 3092, 3092, 184, 185, 'YOAAAA', 'EKAAAA', 'AAAAxx'),
+(6697, 265, 1, 1, 7, 17, 97, 697, 697, 1697, 6697, 194, 195, 'PXAAAA', 'FKAAAA', 'HHHHxx'),
+(2452, 266, 0, 0, 2, 12, 52, 452, 452, 2452, 2452, 104, 105, 'IQAAAA', 'GKAAAA', 'OOOOxx'),
+(7867, 267, 1, 3, 7, 7, 67, 867, 1867, 2867, 7867, 134, 135, 'PQAAAA', 'HKAAAA', 'VVVVxx'),
+(3753, 268, 1, 1, 3, 13, 53, 753, 1753, 3753, 3753, 106, 107, 'JOAAAA', 'IKAAAA', 'AAAAxx'),
+(7834, 269, 0, 2, 4, 14, 34, 834, 1834, 2834, 7834, 68, 69, 'IPAAAA', 'JKAAAA', 'HHHHxx'),
+(5846, 270, 0, 2, 6, 6, 46, 846, 1846, 846, 5846, 92, 93, 'WQAAAA', 'KKAAAA', 'OOOOxx'),
+(7604, 271, 0, 0, 4, 4, 4, 604, 1604, 2604, 7604, 8, 9, 'MGAAAA', 'LKAAAA', 'VVVVxx'),
+(3452, 272, 0, 0, 2, 12, 52, 452, 1452, 3452, 3452, 104, 105, 'UCAAAA', 'MKAAAA', 'AAAAxx'),
+(4788, 273, 0, 0, 8, 8, 88, 788, 788, 4788, 4788, 176, 177, 'ECAAAA', 'NKAAAA', 'HHHHxx'),
+(8600, 274, 0, 0, 0, 0, 0, 600, 600, 3600, 8600, 0, 1, 'USAAAA', 'OKAAAA', 'OOOOxx'),
+(8511, 275, 1, 3, 1, 11, 11, 511, 511, 3511, 8511, 22, 23, 'JPAAAA', 'PKAAAA', 'VVVVxx'),
+(4452, 276, 0, 0, 2, 12, 52, 452, 452, 4452, 4452, 104, 105, 'GPAAAA', 'QKAAAA', 'AAAAxx'),
+(1709, 277, 1, 1, 9, 9, 9, 709, 1709, 1709, 1709, 18, 19, 'TNAAAA', 'RKAAAA', 'HHHHxx'),
+(3440, 278, 0, 0, 0, 0, 40, 440, 1440, 3440, 3440, 80, 81, 'ICAAAA', 'SKAAAA', 'OOOOxx'),
+(9188, 279, 0, 0, 8, 8, 88, 188, 1188, 4188, 9188, 176, 177, 'KPAAAA', 'TKAAAA', 'VVVVxx'),
+(3058, 280, 0, 2, 8, 18, 58, 58, 1058, 3058, 3058, 116, 117, 'QNAAAA', 'UKAAAA', 'AAAAxx'),
+(5821, 281, 1, 1, 1, 1, 21, 821, 1821, 821, 5821, 42, 43, 'XPAAAA', 'VKAAAA', 'HHHHxx'),
+(3428, 282, 0, 0, 8, 8, 28, 428, 1428, 3428, 3428, 56, 57, 'WBAAAA', 'WKAAAA', 'OOOOxx'),
+(3581, 283, 1, 1, 1, 1, 81, 581, 1581, 3581, 3581, 162, 163, 'THAAAA', 'XKAAAA', 'VVVVxx'),
+(7523, 284, 1, 3, 3, 3, 23, 523, 1523, 2523, 7523, 46, 47, 'JDAAAA', 'YKAAAA', 'AAAAxx'),
+(3131, 285, 1, 3, 1, 11, 31, 131, 1131, 3131, 3131, 62, 63, 'LQAAAA', 'ZKAAAA', 'HHHHxx'),
+(2404, 286, 0, 0, 4, 4, 4, 404, 404, 2404, 2404, 8, 9, 'MOAAAA', 'ALAAAA', 'OOOOxx'),
+(5453, 287, 1, 1, 3, 13, 53, 453, 1453, 453, 5453, 106, 107, 'TBAAAA', 'BLAAAA', 'VVVVxx'),
+(1599, 288, 1, 3, 9, 19, 99, 599, 1599, 1599, 1599, 198, 199, 'NJAAAA', 'CLAAAA', 'AAAAxx'),
+(7081, 289, 1, 1, 1, 1, 81, 81, 1081, 2081, 7081, 162, 163, 'JMAAAA', 'DLAAAA', 'HHHHxx'),
+(1750, 290, 0, 2, 0, 10, 50, 750, 1750, 1750, 1750, 100, 101, 'IPAAAA', 'ELAAAA', 'OOOOxx'),
+(5085, 291, 1, 1, 5, 5, 85, 85, 1085, 85, 5085, 170, 171, 'PNAAAA', 'FLAAAA', 'VVVVxx'),
+(9777, 292, 1, 1, 7, 17, 77, 777, 1777, 4777, 9777, 154, 155, 'BMAAAA', 'GLAAAA', 'AAAAxx'),
+(574, 293, 0, 2, 4, 14, 74, 574, 574, 574, 574, 148, 149, 'CWAAAA', 'HLAAAA', 'HHHHxx'),
+(5984, 294, 0, 0, 4, 4, 84, 984, 1984, 984, 5984, 168, 169, 'EWAAAA', 'ILAAAA', 'OOOOxx'),
+(7039, 295, 1, 3, 9, 19, 39, 39, 1039, 2039, 7039, 78, 79, 'TKAAAA', 'JLAAAA', 'VVVVxx'),
+(7143, 296, 1, 3, 3, 3, 43, 143, 1143, 2143, 7143, 86, 87, 'TOAAAA', 'KLAAAA', 'AAAAxx'),
+(5702, 297, 0, 2, 2, 2, 2, 702, 1702, 702, 5702, 4, 5, 'ILAAAA', 'LLAAAA', 'HHHHxx'),
+(362, 298, 0, 2, 2, 2, 62, 362, 362, 362, 362, 124, 125, 'YNAAAA', 'MLAAAA', 'OOOOxx'),
+(6997, 299, 1, 1, 7, 17, 97, 997, 997, 1997, 6997, 194, 195, 'DJAAAA', 'NLAAAA', 'VVVVxx'),
+(2529, 300, 1, 1, 9, 9, 29, 529, 529, 2529, 2529, 58, 59, 'HTAAAA', 'OLAAAA', 'AAAAxx'),
+(6319, 301, 1, 3, 9, 19, 19, 319, 319, 1319, 6319, 38, 39, 'BJAAAA', 'PLAAAA', 'HHHHxx'),
+(954, 302, 0, 2, 4, 14, 54, 954, 954, 954, 954, 108, 109, 'SKAAAA', 'QLAAAA', 'OOOOxx'),
+(3413, 303, 1, 1, 3, 13, 13, 413, 1413, 3413, 3413, 26, 27, 'HBAAAA', 'RLAAAA', 'VVVVxx'),
+(9081, 304, 1, 1, 1, 1, 81, 81, 1081, 4081, 9081, 162, 163, 'HLAAAA', 'SLAAAA', 'AAAAxx'),
+(5599, 305, 1, 3, 9, 19, 99, 599, 1599, 599, 5599, 198, 199, 'JHAAAA', 'TLAAAA', 'HHHHxx'),
+(4772, 306, 0, 0, 2, 12, 72, 772, 772, 4772, 4772, 144, 145, 'OBAAAA', 'ULAAAA', 'OOOOxx'),
+(1124, 307, 0, 0, 4, 4, 24, 124, 1124, 1124, 1124, 48, 49, 'GRAAAA', 'VLAAAA', 'VVVVxx'),
+(7793, 308, 1, 1, 3, 13, 93, 793, 1793, 2793, 7793, 186, 187, 'TNAAAA', 'WLAAAA', 'AAAAxx'),
+(4201, 309, 1, 1, 1, 1, 1, 201, 201, 4201, 4201, 2, 3, 'PFAAAA', 'XLAAAA', 'HHHHxx'),
+(7015, 310, 1, 3, 5, 15, 15, 15, 1015, 2015, 7015, 30, 31, 'VJAAAA', 'YLAAAA', 'OOOOxx'),
+(5936, 311, 0, 0, 6, 16, 36, 936, 1936, 936, 5936, 72, 73, 'IUAAAA', 'ZLAAAA', 'VVVVxx'),
+(4625, 312, 1, 1, 5, 5, 25, 625, 625, 4625, 4625, 50, 51, 'XVAAAA', 'AMAAAA', 'AAAAxx'),
+(4989, 313, 1, 1, 9, 9, 89, 989, 989, 4989, 4989, 178, 179, 'XJAAAA', 'BMAAAA', 'HHHHxx'),
+(4949, 314, 1, 1, 9, 9, 49, 949, 949, 4949, 4949, 98, 99, 'JIAAAA', 'CMAAAA', 'OOOOxx'),
+(6273, 315, 1, 1, 3, 13, 73, 273, 273, 1273, 6273, 146, 147, 'HHAAAA', 'DMAAAA', 'VVVVxx'),
+(4478, 316, 0, 2, 8, 18, 78, 478, 478, 4478, 4478, 156, 157, 'GQAAAA', 'EMAAAA', 'AAAAxx'),
+(8854, 317, 0, 2, 4, 14, 54, 854, 854, 3854, 8854, 108, 109, 'OCAAAA', 'FMAAAA', 'HHHHxx'),
+(2105, 318, 1, 1, 5, 5, 5, 105, 105, 2105, 2105, 10, 11, 'ZCAAAA', 'GMAAAA', 'OOOOxx'),
+(8345, 319, 1, 1, 5, 5, 45, 345, 345, 3345, 8345, 90, 91, 'ZIAAAA', 'HMAAAA', 'VVVVxx'),
+(1941, 320, 1, 1, 1, 1, 41, 941, 1941, 1941, 1941, 82, 83, 'RWAAAA', 'IMAAAA', 'AAAAxx'),
+(1765, 321, 1, 1, 5, 5, 65, 765, 1765, 1765, 1765, 130, 131, 'XPAAAA', 'JMAAAA', 'HHHHxx'),
+(9592, 322, 0, 0, 2, 12, 92, 592, 1592, 4592, 9592, 184, 185, 'YEAAAA', 'KMAAAA', 'OOOOxx'),
+(1694, 323, 0, 2, 4, 14, 94, 694, 1694, 1694, 1694, 188, 189, 'ENAAAA', 'LMAAAA', 'VVVVxx'),
+(8940, 324, 0, 0, 0, 0, 40, 940, 940, 3940, 8940, 80, 81, 'WFAAAA', 'MMAAAA', 'AAAAxx'),
+(7264, 325, 0, 0, 4, 4, 64, 264, 1264, 2264, 7264, 128, 129, 'KTAAAA', 'NMAAAA', 'HHHHxx'),
+(4699, 326, 1, 3, 9, 19, 99, 699, 699, 4699, 4699, 198, 199, 'TYAAAA', 'OMAAAA', 'OOOOxx'),
+(4541, 327, 1, 1, 1, 1, 41, 541, 541, 4541, 4541, 82, 83, 'RSAAAA', 'PMAAAA', 'VVVVxx'),
+(5768, 328, 0, 0, 8, 8, 68, 768, 1768, 768, 5768, 136, 137, 'WNAAAA', 'QMAAAA', 'AAAAxx'),
+(6183, 329, 1, 3, 3, 3, 83, 183, 183, 1183, 6183, 166, 167, 'VDAAAA', 'RMAAAA', 'HHHHxx'),
+(7457, 330, 1, 1, 7, 17, 57, 457, 1457, 2457, 7457, 114, 115, 'VAAAAA', 'SMAAAA', 'OOOOxx'),
+(7317, 331, 1, 1, 7, 17, 17, 317, 1317, 2317, 7317, 34, 35, 'LVAAAA', 'TMAAAA', 'VVVVxx'),
+(1944, 332, 0, 0, 4, 4, 44, 944, 1944, 1944, 1944, 88, 89, 'UWAAAA', 'UMAAAA', 'AAAAxx'),
+(665, 333, 1, 1, 5, 5, 65, 665, 665, 665, 665, 130, 131, 'PZAAAA', 'VMAAAA', 'HHHHxx'),
+(5974, 334, 0, 2, 4, 14, 74, 974, 1974, 974, 5974, 148, 149, 'UVAAAA', 'WMAAAA', 'OOOOxx'),
+(7370, 335, 0, 2, 0, 10, 70, 370, 1370, 2370, 7370, 140, 141, 'MXAAAA', 'XMAAAA', 'VVVVxx'),
+(9196, 336, 0, 0, 6, 16, 96, 196, 1196, 4196, 9196, 192, 193, 'SPAAAA', 'YMAAAA', 'AAAAxx'),
+(6796, 337, 0, 0, 6, 16, 96, 796, 796, 1796, 6796, 192, 193, 'KBAAAA', 'ZMAAAA', 'HHHHxx'),
+(6180, 338, 0, 0, 0, 0, 80, 180, 180, 1180, 6180, 160, 161, 'SDAAAA', 'ANAAAA', 'OOOOxx'),
+(8557, 339, 1, 1, 7, 17, 57, 557, 557, 3557, 8557, 114, 115, 'DRAAAA', 'BNAAAA', 'VVVVxx'),
+(928, 340, 0, 0, 8, 8, 28, 928, 928, 928, 928, 56, 57, 'SJAAAA', 'CNAAAA', 'AAAAxx'),
+(6275, 341, 1, 3, 5, 15, 75, 275, 275, 1275, 6275, 150, 151, 'JHAAAA', 'DNAAAA', 'HHHHxx'),
+(409, 342, 1, 1, 9, 9, 9, 409, 409, 409, 409, 18, 19, 'TPAAAA', 'ENAAAA', 'OOOOxx'),
+(6442, 343, 0, 2, 2, 2, 42, 442, 442, 1442, 6442, 84, 85, 'UNAAAA', 'FNAAAA', 'VVVVxx'),
+(5889, 344, 1, 1, 9, 9, 89, 889, 1889, 889, 5889, 178, 179, 'NSAAAA', 'GNAAAA', 'AAAAxx'),
+(5180, 345, 0, 0, 0, 0, 80, 180, 1180, 180, 5180, 160, 161, 'GRAAAA', 'HNAAAA', 'HHHHxx'),
+(1629, 346, 1, 1, 9, 9, 29, 629, 1629, 1629, 1629, 58, 59, 'RKAAAA', 'INAAAA', 'OOOOxx'),
+(6088, 347, 0, 0, 8, 8, 88, 88, 88, 1088, 6088, 176, 177, 'EAAAAA', 'JNAAAA', 'VVVVxx'),
+(5598, 348, 0, 2, 8, 18, 98, 598, 1598, 598, 5598, 196, 197, 'IHAAAA', 'KNAAAA', 'AAAAxx'),
+(1803, 349, 1, 3, 3, 3, 3, 803, 1803, 1803, 1803, 6, 7, 'JRAAAA', 'LNAAAA', 'HHHHxx'),
+(2330, 350, 0, 2, 0, 10, 30, 330, 330, 2330, 2330, 60, 61, 'QLAAAA', 'MNAAAA', 'OOOOxx'),
+(5901, 351, 1, 1, 1, 1, 1, 901, 1901, 901, 5901, 2, 3, 'ZSAAAA', 'NNAAAA', 'VVVVxx'),
+(780, 352, 0, 0, 0, 0, 80, 780, 780, 780, 780, 160, 161, 'AEAAAA', 'ONAAAA', 'AAAAxx'),
+(7171, 353, 1, 3, 1, 11, 71, 171, 1171, 2171, 7171, 142, 143, 'VPAAAA', 'PNAAAA', 'HHHHxx'),
+(8778, 354, 0, 2, 8, 18, 78, 778, 778, 3778, 8778, 156, 157, 'QZAAAA', 'QNAAAA', 'OOOOxx'),
+(6622, 355, 0, 2, 2, 2, 22, 622, 622, 1622, 6622, 44, 45, 'SUAAAA', 'RNAAAA', 'VVVVxx'),
+(9938, 356, 0, 2, 8, 18, 38, 938, 1938, 4938, 9938, 76, 77, 'GSAAAA', 'SNAAAA', 'AAAAxx'),
+(8254, 357, 0, 2, 4, 14, 54, 254, 254, 3254, 8254, 108, 109, 'MFAAAA', 'TNAAAA', 'HHHHxx'),
+(1951, 358, 1, 3, 1, 11, 51, 951, 1951, 1951, 1951, 102, 103, 'BXAAAA', 'UNAAAA', 'OOOOxx'),
+(1434, 359, 0, 2, 4, 14, 34, 434, 1434, 1434, 1434, 68, 69, 'EDAAAA', 'VNAAAA', 'VVVVxx'),
+(7539, 360, 1, 3, 9, 19, 39, 539, 1539, 2539, 7539, 78, 79, 'ZDAAAA', 'WNAAAA', 'AAAAxx'),
+(600, 361, 0, 0, 0, 0, 0, 600, 600, 600, 600, 0, 1, 'CXAAAA', 'XNAAAA', 'HHHHxx'),
+(3122, 362, 0, 2, 2, 2, 22, 122, 1122, 3122, 3122, 44, 45, 'CQAAAA', 'YNAAAA', 'OOOOxx'),
+(5704, 363, 0, 0, 4, 4, 4, 704, 1704, 704, 5704, 8, 9, 'KLAAAA', 'ZNAAAA', 'VVVVxx'),
+(6300, 364, 0, 0, 0, 0, 0, 300, 300, 1300, 6300, 0, 1, 'IIAAAA', 'AOAAAA', 'AAAAxx'),
+(4585, 365, 1, 1, 5, 5, 85, 585, 585, 4585, 4585, 170, 171, 'JUAAAA', 'BOAAAA', 'HHHHxx'),
+(6313, 366, 1, 1, 3, 13, 13, 313, 313, 1313, 6313, 26, 27, 'VIAAAA', 'COAAAA', 'OOOOxx'),
+(3154, 367, 0, 2, 4, 14, 54, 154, 1154, 3154, 3154, 108, 109, 'IRAAAA', 'DOAAAA', 'VVVVxx'),
+(642, 368, 0, 2, 2, 2, 42, 642, 642, 642, 642, 84, 85, 'SYAAAA', 'EOAAAA', 'AAAAxx'),
+(7736, 369, 0, 0, 6, 16, 36, 736, 1736, 2736, 7736, 72, 73, 'OLAAAA', 'FOAAAA', 'HHHHxx'),
+(5087, 370, 1, 3, 7, 7, 87, 87, 1087, 87, 5087, 174, 175, 'RNAAAA', 'GOAAAA', 'OOOOxx'),
+(5708, 371, 0, 0, 8, 8, 8, 708, 1708, 708, 5708, 16, 17, 'OLAAAA', 'HOAAAA', 'VVVVxx'),
+(8169, 372, 1, 1, 9, 9, 69, 169, 169, 3169, 8169, 138, 139, 'FCAAAA', 'IOAAAA', 'AAAAxx'),
+(9768, 373, 0, 0, 8, 8, 68, 768, 1768, 4768, 9768, 136, 137, 'SLAAAA', 'JOAAAA', 'HHHHxx'),
+(3874, 374, 0, 2, 4, 14, 74, 874, 1874, 3874, 3874, 148, 149, 'ATAAAA', 'KOAAAA', 'OOOOxx'),
+(6831, 375, 1, 3, 1, 11, 31, 831, 831, 1831, 6831, 62, 63, 'TCAAAA', 'LOAAAA', 'VVVVxx'),
+(18, 376, 0, 2, 8, 18, 18, 18, 18, 18, 18, 36, 37, 'SAAAAA', 'MOAAAA', 'AAAAxx'),
+(6375, 377, 1, 3, 5, 15, 75, 375, 375, 1375, 6375, 150, 151, 'FLAAAA', 'NOAAAA', 'HHHHxx'),
+(7106, 378, 0, 2, 6, 6, 6, 106, 1106, 2106, 7106, 12, 13, 'INAAAA', 'OOAAAA', 'OOOOxx'),
+(5926, 379, 0, 2, 6, 6, 26, 926, 1926, 926, 5926, 52, 53, 'YTAAAA', 'POAAAA', 'VVVVxx'),
+(4956, 380, 0, 0, 6, 16, 56, 956, 956, 4956, 4956, 112, 113, 'QIAAAA', 'QOAAAA', 'AAAAxx'),
+(7042, 381, 0, 2, 2, 2, 42, 42, 1042, 2042, 7042, 84, 85, 'WKAAAA', 'ROAAAA', 'HHHHxx'),
+(6043, 382, 1, 3, 3, 3, 43, 43, 43, 1043, 6043, 86, 87, 'LYAAAA', 'SOAAAA', 'OOOOxx'),
+(2084, 383, 0, 0, 4, 4, 84, 84, 84, 2084, 2084, 168, 169, 'ECAAAA', 'TOAAAA', 'VVVVxx'),
+(6038, 384, 0, 2, 8, 18, 38, 38, 38, 1038, 6038, 76, 77, 'GYAAAA', 'UOAAAA', 'AAAAxx'),
+(7253, 385, 1, 1, 3, 13, 53, 253, 1253, 2253, 7253, 106, 107, 'ZSAAAA', 'VOAAAA', 'HHHHxx'),
+(2061, 386, 1, 1, 1, 1, 61, 61, 61, 2061, 2061, 122, 123, 'HBAAAA', 'WOAAAA', 'OOOOxx'),
+(7800, 387, 0, 0, 0, 0, 0, 800, 1800, 2800, 7800, 0, 1, 'AOAAAA', 'XOAAAA', 'VVVVxx'),
+(4970, 388, 0, 2, 0, 10, 70, 970, 970, 4970, 4970, 140, 141, 'EJAAAA', 'YOAAAA', 'AAAAxx'),
+(8580, 389, 0, 0, 0, 0, 80, 580, 580, 3580, 8580, 160, 161, 'ASAAAA', 'ZOAAAA', 'HHHHxx'),
+(9173, 390, 1, 1, 3, 13, 73, 173, 1173, 4173, 9173, 146, 147, 'VOAAAA', 'APAAAA', 'OOOOxx'),
+(8558, 391, 0, 2, 8, 18, 58, 558, 558, 3558, 8558, 116, 117, 'ERAAAA', 'BPAAAA', 'VVVVxx'),
+(3897, 392, 1, 1, 7, 17, 97, 897, 1897, 3897, 3897, 194, 195, 'XTAAAA', 'CPAAAA', 'AAAAxx'),
+(5069, 393, 1, 1, 9, 9, 69, 69, 1069, 69, 5069, 138, 139, 'ZMAAAA', 'DPAAAA', 'HHHHxx'),
+(2301, 394, 1, 1, 1, 1, 1, 301, 301, 2301, 2301, 2, 3, 'NKAAAA', 'EPAAAA', 'OOOOxx'),
+(9863, 395, 1, 3, 3, 3, 63, 863, 1863, 4863, 9863, 126, 127, 'JPAAAA', 'FPAAAA', 'VVVVxx'),
+(5733, 396, 1, 1, 3, 13, 33, 733, 1733, 733, 5733, 66, 67, 'NMAAAA', 'GPAAAA', 'AAAAxx'),
+(2338, 397, 0, 2, 8, 18, 38, 338, 338, 2338, 2338, 76, 77, 'YLAAAA', 'HPAAAA', 'HHHHxx'),
+(9639, 398, 1, 3, 9, 19, 39, 639, 1639, 4639, 9639, 78, 79, 'TGAAAA', 'IPAAAA', 'OOOOxx'),
+(1139, 399, 1, 3, 9, 19, 39, 139, 1139, 1139, 1139, 78, 79, 'VRAAAA', 'JPAAAA', 'VVVVxx'),
+(2293, 400, 1, 1, 3, 13, 93, 293, 293, 2293, 2293, 186, 187, 'FKAAAA', 'KPAAAA', 'AAAAxx'),
+(6125, 401, 1, 1, 5, 5, 25, 125, 125, 1125, 6125, 50, 51, 'PBAAAA', 'LPAAAA', 'HHHHxx'),
+(5374, 402, 0, 2, 4, 14, 74, 374, 1374, 374, 5374, 148, 149, 'SYAAAA', 'MPAAAA', 'OOOOxx'),
+(7216, 403, 0, 0, 6, 16, 16, 216, 1216, 2216, 7216, 32, 33, 'ORAAAA', 'NPAAAA', 'VVVVxx'),
+(2285, 404, 1, 1, 5, 5, 85, 285, 285, 2285, 2285, 170, 171, 'XJAAAA', 'OPAAAA', 'AAAAxx'),
+(2387, 405, 1, 3, 7, 7, 87, 387, 387, 2387, 2387, 174, 175, 'VNAAAA', 'PPAAAA', 'HHHHxx'),
+(5015, 406, 1, 3, 5, 15, 15, 15, 1015, 15, 5015, 30, 31, 'XKAAAA', 'QPAAAA', 'OOOOxx'),
+(2087, 407, 1, 3, 7, 7, 87, 87, 87, 2087, 2087, 174, 175, 'HCAAAA', 'RPAAAA', 'VVVVxx'),
+(4938, 408, 0, 2, 8, 18, 38, 938, 938, 4938, 4938, 76, 77, 'YHAAAA', 'SPAAAA', 'AAAAxx'),
+(3635, 409, 1, 3, 5, 15, 35, 635, 1635, 3635, 3635, 70, 71, 'VJAAAA', 'TPAAAA', 'HHHHxx'),
+(7737, 410, 1, 1, 7, 17, 37, 737, 1737, 2737, 7737, 74, 75, 'PLAAAA', 'UPAAAA', 'OOOOxx'),
+(8056, 411, 0, 0, 6, 16, 56, 56, 56, 3056, 8056, 112, 113, 'WXAAAA', 'VPAAAA', 'VVVVxx'),
+(4502, 412, 0, 2, 2, 2, 2, 502, 502, 4502, 4502, 4, 5, 'ERAAAA', 'WPAAAA', 'AAAAxx'),
+(54, 413, 0, 2, 4, 14, 54, 54, 54, 54, 54, 108, 109, 'CCAAAA', 'XPAAAA', 'HHHHxx'),
+(3182, 414, 0, 2, 2, 2, 82, 182, 1182, 3182, 3182, 164, 165, 'KSAAAA', 'YPAAAA', 'OOOOxx'),
+(3718, 415, 0, 2, 8, 18, 18, 718, 1718, 3718, 3718, 36, 37, 'ANAAAA', 'ZPAAAA', 'VVVVxx'),
+(3989, 416, 1, 1, 9, 9, 89, 989, 1989, 3989, 3989, 178, 179, 'LXAAAA', 'AQAAAA', 'AAAAxx'),
+(8028, 417, 0, 0, 8, 8, 28, 28, 28, 3028, 8028, 56, 57, 'UWAAAA', 'BQAAAA', 'HHHHxx'),
+(1426, 418, 0, 2, 6, 6, 26, 426, 1426, 1426, 1426, 52, 53, 'WCAAAA', 'CQAAAA', 'OOOOxx'),
+(3801, 419, 1, 1, 1, 1, 1, 801, 1801, 3801, 3801, 2, 3, 'FQAAAA', 'DQAAAA', 'VVVVxx'),
+(241, 420, 1, 1, 1, 1, 41, 241, 241, 241, 241, 82, 83, 'HJAAAA', 'EQAAAA', 'AAAAxx'),
+(8000, 421, 0, 0, 0, 0, 0, 0, 0, 3000, 8000, 0, 1, 'SVAAAA', 'FQAAAA', 'HHHHxx'),
+(8357, 422, 1, 1, 7, 17, 57, 357, 357, 3357, 8357, 114, 115, 'LJAAAA', 'GQAAAA', 'OOOOxx'),
+(7548, 423, 0, 0, 8, 8, 48, 548, 1548, 2548, 7548, 96, 97, 'IEAAAA', 'HQAAAA', 'VVVVxx'),
+(7307, 424, 1, 3, 7, 7, 7, 307, 1307, 2307, 7307, 14, 15, 'BVAAAA', 'IQAAAA', 'AAAAxx'),
+(2275, 425, 1, 3, 5, 15, 75, 275, 275, 2275, 2275, 150, 151, 'NJAAAA', 'JQAAAA', 'HHHHxx'),
+(2718, 426, 0, 2, 8, 18, 18, 718, 718, 2718, 2718, 36, 37, 'OAAAAA', 'KQAAAA', 'OOOOxx'),
+(7068, 427, 0, 0, 8, 8, 68, 68, 1068, 2068, 7068, 136, 137, 'WLAAAA', 'LQAAAA', 'VVVVxx'),
+(3181, 428, 1, 1, 1, 1, 81, 181, 1181, 3181, 3181, 162, 163, 'JSAAAA', 'MQAAAA', 'AAAAxx'),
+(749, 429, 1, 1, 9, 9, 49, 749, 749, 749, 749, 98, 99, 'VCAAAA', 'NQAAAA', 'HHHHxx'),
+(5195, 430, 1, 3, 5, 15, 95, 195, 1195, 195, 5195, 190, 191, 'VRAAAA', 'OQAAAA', 'OOOOxx'),
+(6136, 431, 0, 0, 6, 16, 36, 136, 136, 1136, 6136, 72, 73, 'ACAAAA', 'PQAAAA', 'VVVVxx'),
+(8012, 432, 0, 0, 2, 12, 12, 12, 12, 3012, 8012, 24, 25, 'EWAAAA', 'QQAAAA', 'AAAAxx'),
+(3957, 433, 1, 1, 7, 17, 57, 957, 1957, 3957, 3957, 114, 115, 'FWAAAA', 'RQAAAA', 'HHHHxx'),
+(3083, 434, 1, 3, 3, 3, 83, 83, 1083, 3083, 3083, 166, 167, 'POAAAA', 'SQAAAA', 'OOOOxx'),
+(9997, 435, 1, 1, 7, 17, 97, 997, 1997, 4997, 9997, 194, 195, 'NUAAAA', 'TQAAAA', 'VVVVxx'),
+(3299, 436, 1, 3, 9, 19, 99, 299, 1299, 3299, 3299, 198, 199, 'XWAAAA', 'UQAAAA', 'AAAAxx'),
+(846, 437, 0, 2, 6, 6, 46, 846, 846, 846, 846, 92, 93, 'OGAAAA', 'VQAAAA', 'HHHHxx'),
+(2985, 438, 1, 1, 5, 5, 85, 985, 985, 2985, 2985, 170, 171, 'VKAAAA', 'WQAAAA', 'OOOOxx'),
+(9238, 439, 0, 2, 8, 18, 38, 238, 1238, 4238, 9238, 76, 77, 'IRAAAA', 'XQAAAA', 'VVVVxx'),
+(1403, 440, 1, 3, 3, 3, 3, 403, 1403, 1403, 1403, 6, 7, 'ZBAAAA', 'YQAAAA', 'AAAAxx'),
+(5563, 441, 1, 3, 3, 3, 63, 563, 1563, 563, 5563, 126, 127, 'ZFAAAA', 'ZQAAAA', 'HHHHxx'),
+(7965, 442, 1, 1, 5, 5, 65, 965, 1965, 2965, 7965, 130, 131, 'JUAAAA', 'ARAAAA', 'OOOOxx'),
+(4512, 443, 0, 0, 2, 12, 12, 512, 512, 4512, 4512, 24, 25, 'ORAAAA', 'BRAAAA', 'VVVVxx'),
+(9730, 444, 0, 2, 0, 10, 30, 730, 1730, 4730, 9730, 60, 61, 'GKAAAA', 'CRAAAA', 'AAAAxx'),
+(1129, 445, 1, 1, 9, 9, 29, 129, 1129, 1129, 1129, 58, 59, 'LRAAAA', 'DRAAAA', 'HHHHxx'),
+(2624, 446, 0, 0, 4, 4, 24, 624, 624, 2624, 2624, 48, 49, 'YWAAAA', 'ERAAAA', 'OOOOxx'),
+(8178, 447, 0, 2, 8, 18, 78, 178, 178, 3178, 8178, 156, 157, 'OCAAAA', 'FRAAAA', 'VVVVxx'),
+(6468, 448, 0, 0, 8, 8, 68, 468, 468, 1468, 6468, 136, 137, 'UOAAAA', 'GRAAAA', 'AAAAxx'),
+(3027, 449, 1, 3, 7, 7, 27, 27, 1027, 3027, 3027, 54, 55, 'LMAAAA', 'HRAAAA', 'HHHHxx'),
+(3845, 450, 1, 1, 5, 5, 45, 845, 1845, 3845, 3845, 90, 91, 'XRAAAA', 'IRAAAA', 'OOOOxx'),
+(786, 451, 0, 2, 6, 6, 86, 786, 786, 786, 786, 172, 173, 'GEAAAA', 'JRAAAA', 'VVVVxx'),
+(4971, 452, 1, 3, 1, 11, 71, 971, 971, 4971, 4971, 142, 143, 'FJAAAA', 'KRAAAA', 'AAAAxx'),
+(1542, 453, 0, 2, 2, 2, 42, 542, 1542, 1542, 1542, 84, 85, 'IHAAAA', 'LRAAAA', 'HHHHxx'),
+(7967, 454, 1, 3, 7, 7, 67, 967, 1967, 2967, 7967, 134, 135, 'LUAAAA', 'MRAAAA', 'OOOOxx'),
+(443, 455, 1, 3, 3, 3, 43, 443, 443, 443, 443, 86, 87, 'BRAAAA', 'NRAAAA', 'VVVVxx'),
+(7318, 456, 0, 2, 8, 18, 18, 318, 1318, 2318, 7318, 36, 37, 'MVAAAA', 'ORAAAA', 'AAAAxx'),
+(4913, 457, 1, 1, 3, 13, 13, 913, 913, 4913, 4913, 26, 27, 'ZGAAAA', 'PRAAAA', 'HHHHxx'),
+(9466, 458, 0, 2, 6, 6, 66, 466, 1466, 4466, 9466, 132, 133, 'CAAAAA', 'QRAAAA', 'OOOOxx'),
+(7866, 459, 0, 2, 6, 6, 66, 866, 1866, 2866, 7866, 132, 133, 'OQAAAA', 'RRAAAA', 'VVVVxx'),
+(784, 460, 0, 0, 4, 4, 84, 784, 784, 784, 784, 168, 169, 'EEAAAA', 'SRAAAA', 'AAAAxx'),
+(9040, 461, 0, 0, 0, 0, 40, 40, 1040, 4040, 9040, 80, 81, 'SJAAAA', 'TRAAAA', 'HHHHxx'),
+(3954, 462, 0, 2, 4, 14, 54, 954, 1954, 3954, 3954, 108, 109, 'CWAAAA', 'URAAAA', 'OOOOxx'),
+(4183, 463, 1, 3, 3, 3, 83, 183, 183, 4183, 4183, 166, 167, 'XEAAAA', 'VRAAAA', 'VVVVxx'),
+(3608, 464, 0, 0, 8, 8, 8, 608, 1608, 3608, 3608, 16, 17, 'UIAAAA', 'WRAAAA', 'AAAAxx'),
+(7630, 465, 0, 2, 0, 10, 30, 630, 1630, 2630, 7630, 60, 61, 'MHAAAA', 'XRAAAA', 'HHHHxx'),
+(590, 466, 0, 2, 0, 10, 90, 590, 590, 590, 590, 180, 181, 'SWAAAA', 'YRAAAA', 'OOOOxx'),
+(3453, 467, 1, 1, 3, 13, 53, 453, 1453, 3453, 3453, 106, 107, 'VCAAAA', 'ZRAAAA', 'VVVVxx'),
+(7757, 468, 1, 1, 7, 17, 57, 757, 1757, 2757, 7757, 114, 115, 'JMAAAA', 'ASAAAA', 'AAAAxx'),
+(7394, 469, 0, 2, 4, 14, 94, 394, 1394, 2394, 7394, 188, 189, 'KYAAAA', 'BSAAAA', 'HHHHxx'),
+(396, 470, 0, 0, 6, 16, 96, 396, 396, 396, 396, 192, 193, 'GPAAAA', 'CSAAAA', 'OOOOxx'),
+(7873, 471, 1, 1, 3, 13, 73, 873, 1873, 2873, 7873, 146, 147, 'VQAAAA', 'DSAAAA', 'VVVVxx'),
+(1553, 472, 1, 1, 3, 13, 53, 553, 1553, 1553, 1553, 106, 107, 'THAAAA', 'ESAAAA', 'AAAAxx'),
+(598, 473, 0, 2, 8, 18, 98, 598, 598, 598, 598, 196, 197, 'AXAAAA', 'FSAAAA', 'HHHHxx'),
+(7191, 474, 1, 3, 1, 11, 91, 191, 1191, 2191, 7191, 182, 183, 'PQAAAA', 'GSAAAA', 'OOOOxx'),
+(8116, 475, 0, 0, 6, 16, 16, 116, 116, 3116, 8116, 32, 33, 'EAAAAA', 'HSAAAA', 'VVVVxx'),
+(2516, 476, 0, 0, 6, 16, 16, 516, 516, 2516, 2516, 32, 33, 'USAAAA', 'ISAAAA', 'AAAAxx'),
+(7750, 477, 0, 2, 0, 10, 50, 750, 1750, 2750, 7750, 100, 101, 'CMAAAA', 'JSAAAA', 'HHHHxx'),
+(6625, 478, 1, 1, 5, 5, 25, 625, 625, 1625, 6625, 50, 51, 'VUAAAA', 'KSAAAA', 'OOOOxx'),
+(8838, 479, 0, 2, 8, 18, 38, 838, 838, 3838, 8838, 76, 77, 'YBAAAA', 'LSAAAA', 'VVVVxx'),
+(4636, 480, 0, 0, 6, 16, 36, 636, 636, 4636, 4636, 72, 73, 'IWAAAA', 'MSAAAA', 'AAAAxx'),
+(7627, 481, 1, 3, 7, 7, 27, 627, 1627, 2627, 7627, 54, 55, 'JHAAAA', 'NSAAAA', 'HHHHxx'),
+(1690, 482, 0, 2, 0, 10, 90, 690, 1690, 1690, 1690, 180, 181, 'ANAAAA', 'OSAAAA', 'OOOOxx'),
+(7071, 483, 1, 3, 1, 11, 71, 71, 1071, 2071, 7071, 142, 143, 'ZLAAAA', 'PSAAAA', 'VVVVxx'),
+(2081, 484, 1, 1, 1, 1, 81, 81, 81, 2081, 2081, 162, 163, 'BCAAAA', 'QSAAAA', 'AAAAxx'),
+(7138, 485, 0, 2, 8, 18, 38, 138, 1138, 2138, 7138, 76, 77, 'OOAAAA', 'RSAAAA', 'HHHHxx'),
+(864, 486, 0, 0, 4, 4, 64, 864, 864, 864, 864, 128, 129, 'GHAAAA', 'SSAAAA', 'OOOOxx'),
+(6392, 487, 0, 0, 2, 12, 92, 392, 392, 1392, 6392, 184, 185, 'WLAAAA', 'TSAAAA', 'VVVVxx'),
+(7544, 488, 0, 0, 4, 4, 44, 544, 1544, 2544, 7544, 88, 89, 'EEAAAA', 'USAAAA', 'AAAAxx'),
+(5438, 489, 0, 2, 8, 18, 38, 438, 1438, 438, 5438, 76, 77, 'EBAAAA', 'VSAAAA', 'HHHHxx'),
+(7099, 490, 1, 3, 9, 19, 99, 99, 1099, 2099, 7099, 198, 199, 'BNAAAA', 'WSAAAA', 'OOOOxx'),
+(5157, 491, 1, 1, 7, 17, 57, 157, 1157, 157, 5157, 114, 115, 'JQAAAA', 'XSAAAA', 'VVVVxx'),
+(3391, 492, 1, 3, 1, 11, 91, 391, 1391, 3391, 3391, 182, 183, 'LAAAAA', 'YSAAAA', 'AAAAxx'),
+(3805, 493, 1, 1, 5, 5, 5, 805, 1805, 3805, 3805, 10, 11, 'JQAAAA', 'ZSAAAA', 'HHHHxx'),
+(2110, 494, 0, 2, 0, 10, 10, 110, 110, 2110, 2110, 20, 21, 'EDAAAA', 'ATAAAA', 'OOOOxx'),
+(3176, 495, 0, 0, 6, 16, 76, 176, 1176, 3176, 3176, 152, 153, 'ESAAAA', 'BTAAAA', 'VVVVxx'),
+(5918, 496, 0, 2, 8, 18, 18, 918, 1918, 918, 5918, 36, 37, 'QTAAAA', 'CTAAAA', 'AAAAxx'),
+(1218, 497, 0, 2, 8, 18, 18, 218, 1218, 1218, 1218, 36, 37, 'WUAAAA', 'DTAAAA', 'HHHHxx'),
+(6683, 498, 1, 3, 3, 3, 83, 683, 683, 1683, 6683, 166, 167, 'BXAAAA', 'ETAAAA', 'OOOOxx'),
+(914, 499, 0, 2, 4, 14, 14, 914, 914, 914, 914, 28, 29, 'EJAAAA', 'FTAAAA', 'VVVVxx'),
+(4737, 500, 1, 1, 7, 17, 37, 737, 737, 4737, 4737, 74, 75, 'FAAAAA', 'GTAAAA', 'AAAAxx'),
+(7286, 501, 0, 2, 6, 6, 86, 286, 1286, 2286, 7286, 172, 173, 'GUAAAA', 'HTAAAA', 'HHHHxx'),
+(9975, 502, 1, 3, 5, 15, 75, 975, 1975, 4975, 9975, 150, 151, 'RTAAAA', 'ITAAAA', 'OOOOxx'),
+(8030, 503, 0, 2, 0, 10, 30, 30, 30, 3030, 8030, 60, 61, 'WWAAAA', 'JTAAAA', 'VVVVxx'),
+(7364, 504, 0, 0, 4, 4, 64, 364, 1364, 2364, 7364, 128, 129, 'GXAAAA', 'KTAAAA', 'AAAAxx'),
+(1389, 505, 1, 1, 9, 9, 89, 389, 1389, 1389, 1389, 178, 179, 'LBAAAA', 'LTAAAA', 'HHHHxx'),
+(4025, 506, 1, 1, 5, 5, 25, 25, 25, 4025, 4025, 50, 51, 'VYAAAA', 'MTAAAA', 'OOOOxx'),
+(4835, 507, 1, 3, 5, 15, 35, 835, 835, 4835, 4835, 70, 71, 'ZDAAAA', 'NTAAAA', 'VVVVxx'),
+(8045, 508, 1, 1, 5, 5, 45, 45, 45, 3045, 8045, 90, 91, 'LXAAAA', 'OTAAAA', 'AAAAxx'),
+(1864, 509, 0, 0, 4, 4, 64, 864, 1864, 1864, 1864, 128, 129, 'STAAAA', 'PTAAAA', 'HHHHxx'),
+(3313, 510, 1, 1, 3, 13, 13, 313, 1313, 3313, 3313, 26, 27, 'LXAAAA', 'QTAAAA', 'OOOOxx'),
+(2384, 511, 0, 0, 4, 4, 84, 384, 384, 2384, 2384, 168, 169, 'SNAAAA', 'RTAAAA', 'VVVVxx'),
+(6115, 512, 1, 3, 5, 15, 15, 115, 115, 1115, 6115, 30, 31, 'FBAAAA', 'STAAAA', 'AAAAxx'),
+(5705, 513, 1, 1, 5, 5, 5, 705, 1705, 705, 5705, 10, 11, 'LLAAAA', 'TTAAAA', 'HHHHxx'),
+(9269, 514, 1, 1, 9, 9, 69, 269, 1269, 4269, 9269, 138, 139, 'NSAAAA', 'UTAAAA', 'OOOOxx'),
+(3379, 515, 1, 3, 9, 19, 79, 379, 1379, 3379, 3379, 158, 159, 'ZZAAAA', 'VTAAAA', 'VVVVxx'),
+(8205, 516, 1, 1, 5, 5, 5, 205, 205, 3205, 8205, 10, 11, 'PDAAAA', 'WTAAAA', 'AAAAxx'),
+(6575, 517, 1, 3, 5, 15, 75, 575, 575, 1575, 6575, 150, 151, 'XSAAAA', 'XTAAAA', 'HHHHxx'),
+(486, 518, 0, 2, 6, 6, 86, 486, 486, 486, 486, 172, 173, 'SSAAAA', 'YTAAAA', 'OOOOxx'),
+(4894, 519, 0, 2, 4, 14, 94, 894, 894, 4894, 4894, 188, 189, 'GGAAAA', 'ZTAAAA', 'VVVVxx'),
+(3090, 520, 0, 2, 0, 10, 90, 90, 1090, 3090, 3090, 180, 181, 'WOAAAA', 'AUAAAA', 'AAAAxx'),
+(759, 521, 1, 3, 9, 19, 59, 759, 759, 759, 759, 118, 119, 'FDAAAA', 'BUAAAA', 'HHHHxx'),
+(4864, 522, 0, 0, 4, 4, 64, 864, 864, 4864, 4864, 128, 129, 'CFAAAA', 'CUAAAA', 'OOOOxx'),
+(4083, 523, 1, 3, 3, 3, 83, 83, 83, 4083, 4083, 166, 167, 'BBAAAA', 'DUAAAA', 'VVVVxx'),
+(6918, 524, 0, 2, 8, 18, 18, 918, 918, 1918, 6918, 36, 37, 'CGAAAA', 'EUAAAA', 'AAAAxx'),
+(8146, 525, 0, 2, 6, 6, 46, 146, 146, 3146, 8146, 92, 93, 'IBAAAA', 'FUAAAA', 'HHHHxx'),
+(1523, 526, 1, 3, 3, 3, 23, 523, 1523, 1523, 1523, 46, 47, 'PGAAAA', 'GUAAAA', 'OOOOxx'),
+(1591, 527, 1, 3, 1, 11, 91, 591, 1591, 1591, 1591, 182, 183, 'FJAAAA', 'HUAAAA', 'VVVVxx'),
+(3343, 528, 1, 3, 3, 3, 43, 343, 1343, 3343, 3343, 86, 87, 'PYAAAA', 'IUAAAA', 'AAAAxx'),
+(1391, 529, 1, 3, 1, 11, 91, 391, 1391, 1391, 1391, 182, 183, 'NBAAAA', 'JUAAAA', 'HHHHxx'),
+(9963, 530, 1, 3, 3, 3, 63, 963, 1963, 4963, 9963, 126, 127, 'FTAAAA', 'KUAAAA', 'OOOOxx'),
+(2423, 531, 1, 3, 3, 3, 23, 423, 423, 2423, 2423, 46, 47, 'FPAAAA', 'LUAAAA', 'VVVVxx'),
+(1822, 532, 0, 2, 2, 2, 22, 822, 1822, 1822, 1822, 44, 45, 'CSAAAA', 'MUAAAA', 'AAAAxx'),
+(8706, 533, 0, 2, 6, 6, 6, 706, 706, 3706, 8706, 12, 13, 'WWAAAA', 'NUAAAA', 'HHHHxx'),
+(3001, 534, 1, 1, 1, 1, 1, 1, 1001, 3001, 3001, 2, 3, 'LLAAAA', 'OUAAAA', 'OOOOxx'),
+(6707, 535, 1, 3, 7, 7, 7, 707, 707, 1707, 6707, 14, 15, 'ZXAAAA', 'PUAAAA', 'VVVVxx'),
+(2121, 536, 1, 1, 1, 1, 21, 121, 121, 2121, 2121, 42, 43, 'PDAAAA', 'QUAAAA', 'AAAAxx'),
+(5814, 537, 0, 2, 4, 14, 14, 814, 1814, 814, 5814, 28, 29, 'QPAAAA', 'RUAAAA', 'HHHHxx'),
+(2659, 538, 1, 3, 9, 19, 59, 659, 659, 2659, 2659, 118, 119, 'HYAAAA', 'SUAAAA', 'OOOOxx'),
+(2016, 539, 0, 0, 6, 16, 16, 16, 16, 2016, 2016, 32, 33, 'OZAAAA', 'TUAAAA', 'VVVVxx'),
+(4286, 540, 0, 2, 6, 6, 86, 286, 286, 4286, 4286, 172, 173, 'WIAAAA', 'UUAAAA', 'AAAAxx'),
+(9205, 541, 1, 1, 5, 5, 5, 205, 1205, 4205, 9205, 10, 11, 'BQAAAA', 'VUAAAA', 'HHHHxx'),
+(3496, 542, 0, 0, 6, 16, 96, 496, 1496, 3496, 3496, 192, 193, 'MEAAAA', 'WUAAAA', 'OOOOxx'),
+(5333, 543, 1, 1, 3, 13, 33, 333, 1333, 333, 5333, 66, 67, 'DXAAAA', 'XUAAAA', 'VVVVxx'),
+(5571, 544, 1, 3, 1, 11, 71, 571, 1571, 571, 5571, 142, 143, 'HGAAAA', 'YUAAAA', 'AAAAxx'),
+(1696, 545, 0, 0, 6, 16, 96, 696, 1696, 1696, 1696, 192, 193, 'GNAAAA', 'ZUAAAA', 'HHHHxx'),
+(4871, 546, 1, 3, 1, 11, 71, 871, 871, 4871, 4871, 142, 143, 'JFAAAA', 'AVAAAA', 'OOOOxx'),
+(4852, 547, 0, 0, 2, 12, 52, 852, 852, 4852, 4852, 104, 105, 'QEAAAA', 'BVAAAA', 'VVVVxx'),
+(8483, 548, 1, 3, 3, 3, 83, 483, 483, 3483, 8483, 166, 167, 'HOAAAA', 'CVAAAA', 'AAAAxx'),
+(1376, 549, 0, 0, 6, 16, 76, 376, 1376, 1376, 1376, 152, 153, 'YAAAAA', 'DVAAAA', 'HHHHxx'),
+(5456, 550, 0, 0, 6, 16, 56, 456, 1456, 456, 5456, 112, 113, 'WBAAAA', 'EVAAAA', 'OOOOxx'),
+(499, 551, 1, 3, 9, 19, 99, 499, 499, 499, 499, 198, 199, 'FTAAAA', 'FVAAAA', 'VVVVxx'),
+(3463, 552, 1, 3, 3, 3, 63, 463, 1463, 3463, 3463, 126, 127, 'FDAAAA', 'GVAAAA', 'AAAAxx'),
+(7426, 553, 0, 2, 6, 6, 26, 426, 1426, 2426, 7426, 52, 53, 'QZAAAA', 'HVAAAA', 'HHHHxx'),
+(5341, 554, 1, 1, 1, 1, 41, 341, 1341, 341, 5341, 82, 83, 'LXAAAA', 'IVAAAA', 'OOOOxx'),
+(9309, 555, 1, 1, 9, 9, 9, 309, 1309, 4309, 9309, 18, 19, 'BUAAAA', 'JVAAAA', 'VVVVxx'),
+(2055, 556, 1, 3, 5, 15, 55, 55, 55, 2055, 2055, 110, 111, 'BBAAAA', 'KVAAAA', 'AAAAxx'),
+(2199, 557, 1, 3, 9, 19, 99, 199, 199, 2199, 2199, 198, 199, 'PGAAAA', 'LVAAAA', 'HHHHxx'),
+(7235, 558, 1, 3, 5, 15, 35, 235, 1235, 2235, 7235, 70, 71, 'HSAAAA', 'MVAAAA', 'OOOOxx'),
+(8661, 559, 1, 1, 1, 1, 61, 661, 661, 3661, 8661, 122, 123, 'DVAAAA', 'NVAAAA', 'VVVVxx'),
+(9494, 560, 0, 2, 4, 14, 94, 494, 1494, 4494, 9494, 188, 189, 'EBAAAA', 'OVAAAA', 'AAAAxx'),
+(935, 561, 1, 3, 5, 15, 35, 935, 935, 935, 935, 70, 71, 'ZJAAAA', 'PVAAAA', 'HHHHxx'),
+(7044, 562, 0, 0, 4, 4, 44, 44, 1044, 2044, 7044, 88, 89, 'YKAAAA', 'QVAAAA', 'OOOOxx'),
+(1974, 563, 0, 2, 4, 14, 74, 974, 1974, 1974, 1974, 148, 149, 'YXAAAA', 'RVAAAA', 'VVVVxx'),
+(9679, 564, 1, 3, 9, 19, 79, 679, 1679, 4679, 9679, 158, 159, 'HIAAAA', 'SVAAAA', 'AAAAxx'),
+(9822, 565, 0, 2, 2, 2, 22, 822, 1822, 4822, 9822, 44, 45, 'UNAAAA', 'TVAAAA', 'HHHHxx'),
+(4088, 566, 0, 0, 8, 8, 88, 88, 88, 4088, 4088, 176, 177, 'GBAAAA', 'UVAAAA', 'OOOOxx'),
+(1749, 567, 1, 1, 9, 9, 49, 749, 1749, 1749, 1749, 98, 99, 'HPAAAA', 'VVAAAA', 'VVVVxx'),
+(2116, 568, 0, 0, 6, 16, 16, 116, 116, 2116, 2116, 32, 33, 'KDAAAA', 'WVAAAA', 'AAAAxx'),
+(976, 569, 0, 0, 6, 16, 76, 976, 976, 976, 976, 152, 153, 'OLAAAA', 'XVAAAA', 'HHHHxx'),
+(8689, 570, 1, 1, 9, 9, 89, 689, 689, 3689, 8689, 178, 179, 'FWAAAA', 'YVAAAA', 'OOOOxx'),
+(2563, 571, 1, 3, 3, 3, 63, 563, 563, 2563, 2563, 126, 127, 'PUAAAA', 'ZVAAAA', 'VVVVxx'),
+(7195, 572, 1, 3, 5, 15, 95, 195, 1195, 2195, 7195, 190, 191, 'TQAAAA', 'AWAAAA', 'AAAAxx'),
+(9985, 573, 1, 1, 5, 5, 85, 985, 1985, 4985, 9985, 170, 171, 'BUAAAA', 'BWAAAA', 'HHHHxx'),
+(7699, 574, 1, 3, 9, 19, 99, 699, 1699, 2699, 7699, 198, 199, 'DKAAAA', 'CWAAAA', 'OOOOxx'),
+(5311, 575, 1, 3, 1, 11, 11, 311, 1311, 311, 5311, 22, 23, 'HWAAAA', 'DWAAAA', 'VVVVxx'),
+(295, 576, 1, 3, 5, 15, 95, 295, 295, 295, 295, 190, 191, 'JLAAAA', 'EWAAAA', 'AAAAxx'),
+(8214, 577, 0, 2, 4, 14, 14, 214, 214, 3214, 8214, 28, 29, 'YDAAAA', 'FWAAAA', 'HHHHxx'),
+(3275, 578, 1, 3, 5, 15, 75, 275, 1275, 3275, 3275, 150, 151, 'ZVAAAA', 'GWAAAA', 'OOOOxx'),
+(9646, 579, 0, 2, 6, 6, 46, 646, 1646, 4646, 9646, 92, 93, 'AHAAAA', 'HWAAAA', 'VVVVxx'),
+(1908, 580, 0, 0, 8, 8, 8, 908, 1908, 1908, 1908, 16, 17, 'KVAAAA', 'IWAAAA', 'AAAAxx'),
+(3858, 581, 0, 2, 8, 18, 58, 858, 1858, 3858, 3858, 116, 117, 'KSAAAA', 'JWAAAA', 'HHHHxx'),
+(9362, 582, 0, 2, 2, 2, 62, 362, 1362, 4362, 9362, 124, 125, 'CWAAAA', 'KWAAAA', 'OOOOxx'),
+(9307, 583, 1, 3, 7, 7, 7, 307, 1307, 4307, 9307, 14, 15, 'ZTAAAA', 'LWAAAA', 'VVVVxx'),
+(6124, 584, 0, 0, 4, 4, 24, 124, 124, 1124, 6124, 48, 49, 'OBAAAA', 'MWAAAA', 'AAAAxx'),
+(2405, 585, 1, 1, 5, 5, 5, 405, 405, 2405, 2405, 10, 11, 'NOAAAA', 'NWAAAA', 'HHHHxx'),
+(8422, 586, 0, 2, 2, 2, 22, 422, 422, 3422, 8422, 44, 45, 'YLAAAA', 'OWAAAA', 'OOOOxx'),
+(393, 587, 1, 1, 3, 13, 93, 393, 393, 393, 393, 186, 187, 'DPAAAA', 'PWAAAA', 'VVVVxx'),
+(8973, 588, 1, 1, 3, 13, 73, 973, 973, 3973, 8973, 146, 147, 'DHAAAA', 'QWAAAA', 'AAAAxx'),
+(5171, 589, 1, 3, 1, 11, 71, 171, 1171, 171, 5171, 142, 143, 'XQAAAA', 'RWAAAA', 'HHHHxx'),
+(4929, 590, 1, 1, 9, 9, 29, 929, 929, 4929, 4929, 58, 59, 'PHAAAA', 'SWAAAA', 'OOOOxx'),
+(6935, 591, 1, 3, 5, 15, 35, 935, 935, 1935, 6935, 70, 71, 'TGAAAA', 'TWAAAA', 'VVVVxx'),
+(8584, 592, 0, 0, 4, 4, 84, 584, 584, 3584, 8584, 168, 169, 'ESAAAA', 'UWAAAA', 'AAAAxx'),
+(1035, 593, 1, 3, 5, 15, 35, 35, 1035, 1035, 1035, 70, 71, 'VNAAAA', 'VWAAAA', 'HHHHxx'),
+(3734, 594, 0, 2, 4, 14, 34, 734, 1734, 3734, 3734, 68, 69, 'QNAAAA', 'WWAAAA', 'OOOOxx'),
+(1458, 595, 0, 2, 8, 18, 58, 458, 1458, 1458, 1458, 116, 117, 'CEAAAA', 'XWAAAA', 'VVVVxx'),
+(8746, 596, 0, 2, 6, 6, 46, 746, 746, 3746, 8746, 92, 93, 'KYAAAA', 'YWAAAA', 'AAAAxx'),
+(1677, 597, 1, 1, 7, 17, 77, 677, 1677, 1677, 1677, 154, 155, 'NMAAAA', 'ZWAAAA', 'HHHHxx'),
+(8502, 598, 0, 2, 2, 2, 2, 502, 502, 3502, 8502, 4, 5, 'APAAAA', 'AXAAAA', 'OOOOxx'),
+(7752, 599, 0, 0, 2, 12, 52, 752, 1752, 2752, 7752, 104, 105, 'EMAAAA', 'BXAAAA', 'VVVVxx'),
+(2556, 600, 0, 0, 6, 16, 56, 556, 556, 2556, 2556, 112, 113, 'IUAAAA', 'CXAAAA', 'AAAAxx'),
+(6426, 601, 0, 2, 6, 6, 26, 426, 426, 1426, 6426, 52, 53, 'ENAAAA', 'DXAAAA', 'HHHHxx'),
+(8420, 602, 0, 0, 0, 0, 20, 420, 420, 3420, 8420, 40, 41, 'WLAAAA', 'EXAAAA', 'OOOOxx'),
+(4462, 603, 0, 2, 2, 2, 62, 462, 462, 4462, 4462, 124, 125, 'QPAAAA', 'FXAAAA', 'VVVVxx'),
+(1378, 604, 0, 2, 8, 18, 78, 378, 1378, 1378, 1378, 156, 157, 'ABAAAA', 'GXAAAA', 'AAAAxx'),
+(1387, 605, 1, 3, 7, 7, 87, 387, 1387, 1387, 1387, 174, 175, 'JBAAAA', 'HXAAAA', 'HHHHxx'),
+(8094, 606, 0, 2, 4, 14, 94, 94, 94, 3094, 8094, 188, 189, 'IZAAAA', 'IXAAAA', 'OOOOxx'),
+(7247, 607, 1, 3, 7, 7, 47, 247, 1247, 2247, 7247, 94, 95, 'TSAAAA', 'JXAAAA', 'VVVVxx'),
+(4261, 608, 1, 1, 1, 1, 61, 261, 261, 4261, 4261, 122, 123, 'XHAAAA', 'KXAAAA', 'AAAAxx'),
+(5029, 609, 1, 1, 9, 9, 29, 29, 1029, 29, 5029, 58, 59, 'LLAAAA', 'LXAAAA', 'HHHHxx'),
+(3625, 610, 1, 1, 5, 5, 25, 625, 1625, 3625, 3625, 50, 51, 'LJAAAA', 'MXAAAA', 'OOOOxx'),
+(8068, 611, 0, 0, 8, 8, 68, 68, 68, 3068, 8068, 136, 137, 'IYAAAA', 'NXAAAA', 'VVVVxx'),
+(102, 612, 0, 2, 2, 2, 2, 102, 102, 102, 102, 4, 5, 'YDAAAA', 'OXAAAA', 'AAAAxx'),
+(5596, 613, 0, 0, 6, 16, 96, 596, 1596, 596, 5596, 192, 193, 'GHAAAA', 'PXAAAA', 'HHHHxx'),
+(5872, 614, 0, 0, 2, 12, 72, 872, 1872, 872, 5872, 144, 145, 'WRAAAA', 'QXAAAA', 'OOOOxx'),
+(4742, 615, 0, 2, 2, 2, 42, 742, 742, 4742, 4742, 84, 85, 'KAAAAA', 'RXAAAA', 'VVVVxx'),
+(2117, 616, 1, 1, 7, 17, 17, 117, 117, 2117, 2117, 34, 35, 'LDAAAA', 'SXAAAA', 'AAAAxx'),
+(3945, 617, 1, 1, 5, 5, 45, 945, 1945, 3945, 3945, 90, 91, 'TVAAAA', 'TXAAAA', 'HHHHxx'),
+(7483, 618, 1, 3, 3, 3, 83, 483, 1483, 2483, 7483, 166, 167, 'VBAAAA', 'UXAAAA', 'OOOOxx'),
+(4455, 619, 1, 3, 5, 15, 55, 455, 455, 4455, 4455, 110, 111, 'JPAAAA', 'VXAAAA', 'VVVVxx'),
+(609, 620, 1, 1, 9, 9, 9, 609, 609, 609, 609, 18, 19, 'LXAAAA', 'WXAAAA', 'AAAAxx'),
+(9829, 621, 1, 1, 9, 9, 29, 829, 1829, 4829, 9829, 58, 59, 'BOAAAA', 'XXAAAA', 'HHHHxx'),
+(4857, 622, 1, 1, 7, 17, 57, 857, 857, 4857, 4857, 114, 115, 'VEAAAA', 'YXAAAA', 'OOOOxx'),
+(3314, 623, 0, 2, 4, 14, 14, 314, 1314, 3314, 3314, 28, 29, 'MXAAAA', 'ZXAAAA', 'VVVVxx'),
+(5353, 624, 1, 1, 3, 13, 53, 353, 1353, 353, 5353, 106, 107, 'XXAAAA', 'AYAAAA', 'AAAAxx'),
+(4909, 625, 1, 1, 9, 9, 9, 909, 909, 4909, 4909, 18, 19, 'VGAAAA', 'BYAAAA', 'HHHHxx'),
+(7597, 626, 1, 1, 7, 17, 97, 597, 1597, 2597, 7597, 194, 195, 'FGAAAA', 'CYAAAA', 'OOOOxx'),
+(2683, 627, 1, 3, 3, 3, 83, 683, 683, 2683, 2683, 166, 167, 'FZAAAA', 'DYAAAA', 'VVVVxx'),
+(3223, 628, 1, 3, 3, 3, 23, 223, 1223, 3223, 3223, 46, 47, 'ZTAAAA', 'EYAAAA', 'AAAAxx'),
+(5363, 629, 1, 3, 3, 3, 63, 363, 1363, 363, 5363, 126, 127, 'HYAAAA', 'FYAAAA', 'HHHHxx'),
+(4578, 630, 0, 2, 8, 18, 78, 578, 578, 4578, 4578, 156, 157, 'CUAAAA', 'GYAAAA', 'OOOOxx'),
+(5544, 631, 0, 0, 4, 4, 44, 544, 1544, 544, 5544, 88, 89, 'GFAAAA', 'HYAAAA', 'VVVVxx'),
+(1589, 632, 1, 1, 9, 9, 89, 589, 1589, 1589, 1589, 178, 179, 'DJAAAA', 'IYAAAA', 'AAAAxx'),
+(7412, 633, 0, 0, 2, 12, 12, 412, 1412, 2412, 7412, 24, 25, 'CZAAAA', 'JYAAAA', 'HHHHxx'),
+(3803, 634, 1, 3, 3, 3, 3, 803, 1803, 3803, 3803, 6, 7, 'HQAAAA', 'KYAAAA', 'OOOOxx'),
+(6179, 635, 1, 3, 9, 19, 79, 179, 179, 1179, 6179, 158, 159, 'RDAAAA', 'LYAAAA', 'VVVVxx'),
+(5588, 636, 0, 0, 8, 8, 88, 588, 1588, 588, 5588, 176, 177, 'YGAAAA', 'MYAAAA', 'AAAAxx'),
+(2134, 637, 0, 2, 4, 14, 34, 134, 134, 2134, 2134, 68, 69, 'CEAAAA', 'NYAAAA', 'HHHHxx'),
+(4383, 638, 1, 3, 3, 3, 83, 383, 383, 4383, 4383, 166, 167, 'PMAAAA', 'OYAAAA', 'OOOOxx'),
+(6995, 639, 1, 3, 5, 15, 95, 995, 995, 1995, 6995, 190, 191, 'BJAAAA', 'PYAAAA', 'VVVVxx'),
+(6598, 640, 0, 2, 8, 18, 98, 598, 598, 1598, 6598, 196, 197, 'UTAAAA', 'QYAAAA', 'AAAAxx'),
+(8731, 641, 1, 3, 1, 11, 31, 731, 731, 3731, 8731, 62, 63, 'VXAAAA', 'RYAAAA', 'HHHHxx'),
+(7177, 642, 1, 1, 7, 17, 77, 177, 1177, 2177, 7177, 154, 155, 'BQAAAA', 'SYAAAA', 'OOOOxx'),
+(6578, 643, 0, 2, 8, 18, 78, 578, 578, 1578, 6578, 156, 157, 'ATAAAA', 'TYAAAA', 'VVVVxx'),
+(9393, 644, 1, 1, 3, 13, 93, 393, 1393, 4393, 9393, 186, 187, 'HXAAAA', 'UYAAAA', 'AAAAxx'),
+(1276, 645, 0, 0, 6, 16, 76, 276, 1276, 1276, 1276, 152, 153, 'CXAAAA', 'VYAAAA', 'HHHHxx'),
+(8766, 646, 0, 2, 6, 6, 66, 766, 766, 3766, 8766, 132, 133, 'EZAAAA', 'WYAAAA', 'OOOOxx'),
+(1015, 647, 1, 3, 5, 15, 15, 15, 1015, 1015, 1015, 30, 31, 'BNAAAA', 'XYAAAA', 'VVVVxx'),
+(4396, 648, 0, 0, 6, 16, 96, 396, 396, 4396, 4396, 192, 193, 'CNAAAA', 'YYAAAA', 'AAAAxx'),
+(5564, 649, 0, 0, 4, 4, 64, 564, 1564, 564, 5564, 128, 129, 'AGAAAA', 'ZYAAAA', 'HHHHxx'),
+(927, 650, 1, 3, 7, 7, 27, 927, 927, 927, 927, 54, 55, 'RJAAAA', 'AZAAAA', 'OOOOxx'),
+(3306, 651, 0, 2, 6, 6, 6, 306, 1306, 3306, 3306, 12, 13, 'EXAAAA', 'BZAAAA', 'VVVVxx'),
+(1615, 652, 1, 3, 5, 15, 15, 615, 1615, 1615, 1615, 30, 31, 'DKAAAA', 'CZAAAA', 'AAAAxx'),
+(4550, 653, 0, 2, 0, 10, 50, 550, 550, 4550, 4550, 100, 101, 'ATAAAA', 'DZAAAA', 'HHHHxx'),
+(2468, 654, 0, 0, 8, 8, 68, 468, 468, 2468, 2468, 136, 137, 'YQAAAA', 'EZAAAA', 'OOOOxx'),
+(5336, 655, 0, 0, 6, 16, 36, 336, 1336, 336, 5336, 72, 73, 'GXAAAA', 'FZAAAA', 'VVVVxx'),
+(4471, 656, 1, 3, 1, 11, 71, 471, 471, 4471, 4471, 142, 143, 'ZPAAAA', 'GZAAAA', 'AAAAxx'),
+(8085, 657, 1, 1, 5, 5, 85, 85, 85, 3085, 8085, 170, 171, 'ZYAAAA', 'HZAAAA', 'HHHHxx'),
+(540, 658, 0, 0, 0, 0, 40, 540, 540, 540, 540, 80, 81, 'UUAAAA', 'IZAAAA', 'OOOOxx'),
+(5108, 659, 0, 0, 8, 8, 8, 108, 1108, 108, 5108, 16, 17, 'MOAAAA', 'JZAAAA', 'VVVVxx'),
+(8015, 660, 1, 3, 5, 15, 15, 15, 15, 3015, 8015, 30, 31, 'HWAAAA', 'KZAAAA', 'AAAAxx'),
+(2857, 661, 1, 1, 7, 17, 57, 857, 857, 2857, 2857, 114, 115, 'XFAAAA', 'LZAAAA', 'HHHHxx'),
+(9472, 662, 0, 0, 2, 12, 72, 472, 1472, 4472, 9472, 144, 145, 'IAAAAA', 'MZAAAA', 'OOOOxx'),
+(5666, 663, 0, 2, 6, 6, 66, 666, 1666, 666, 5666, 132, 133, 'YJAAAA', 'NZAAAA', 'VVVVxx'),
+(3555, 664, 1, 3, 5, 15, 55, 555, 1555, 3555, 3555, 110, 111, 'TGAAAA', 'OZAAAA', 'AAAAxx'),
+(378, 665, 0, 2, 8, 18, 78, 378, 378, 378, 378, 156, 157, 'OOAAAA', 'PZAAAA', 'HHHHxx'),
+(4466, 666, 0, 2, 6, 6, 66, 466, 466, 4466, 4466, 132, 133, 'UPAAAA', 'QZAAAA', 'OOOOxx'),
+(3247, 667, 1, 3, 7, 7, 47, 247, 1247, 3247, 3247, 94, 95, 'XUAAAA', 'RZAAAA', 'VVVVxx'),
+(6570, 668, 0, 2, 0, 10, 70, 570, 570, 1570, 6570, 140, 141, 'SSAAAA', 'SZAAAA', 'AAAAxx'),
+(5655, 669, 1, 3, 5, 15, 55, 655, 1655, 655, 5655, 110, 111, 'NJAAAA', 'TZAAAA', 'HHHHxx'),
+(917, 670, 1, 1, 7, 17, 17, 917, 917, 917, 917, 34, 35, 'HJAAAA', 'UZAAAA', 'OOOOxx'),
+(3637, 671, 1, 1, 7, 17, 37, 637, 1637, 3637, 3637, 74, 75, 'XJAAAA', 'VZAAAA', 'VVVVxx'),
+(3668, 672, 0, 0, 8, 8, 68, 668, 1668, 3668, 3668, 136, 137, 'CLAAAA', 'WZAAAA', 'AAAAxx'),
+(5644, 673, 0, 0, 4, 4, 44, 644, 1644, 644, 5644, 88, 89, 'CJAAAA', 'XZAAAA', 'HHHHxx'),
+(8286, 674, 0, 2, 6, 6, 86, 286, 286, 3286, 8286, 172, 173, 'SGAAAA', 'YZAAAA', 'OOOOxx'),
+(6896, 675, 0, 0, 6, 16, 96, 896, 896, 1896, 6896, 192, 193, 'GFAAAA', 'ZZAAAA', 'VVVVxx'),
+(2870, 676, 0, 2, 0, 10, 70, 870, 870, 2870, 2870, 140, 141, 'KGAAAA', 'AABAAA', 'AAAAxx'),
+(8041, 677, 1, 1, 1, 1, 41, 41, 41, 3041, 8041, 82, 83, 'HXAAAA', 'BABAAA', 'HHHHxx'),
+(8137, 678, 1, 1, 7, 17, 37, 137, 137, 3137, 8137, 74, 75, 'ZAAAAA', 'CABAAA', 'OOOOxx'),
+(4823, 679, 1, 3, 3, 3, 23, 823, 823, 4823, 4823, 46, 47, 'NDAAAA', 'DABAAA', 'VVVVxx'),
+(2438, 680, 0, 2, 8, 18, 38, 438, 438, 2438, 2438, 76, 77, 'UPAAAA', 'EABAAA', 'AAAAxx'),
+(6329, 681, 1, 1, 9, 9, 29, 329, 329, 1329, 6329, 58, 59, 'LJAAAA', 'FABAAA', 'HHHHxx'),
+(623, 682, 1, 3, 3, 3, 23, 623, 623, 623, 623, 46, 47, 'ZXAAAA', 'GABAAA', 'OOOOxx'),
+(1360, 683, 0, 0, 0, 0, 60, 360, 1360, 1360, 1360, 120, 121, 'IAAAAA', 'HABAAA', 'VVVVxx'),
+(7987, 684, 1, 3, 7, 7, 87, 987, 1987, 2987, 7987, 174, 175, 'FVAAAA', 'IABAAA', 'AAAAxx'),
+(9788, 685, 0, 0, 8, 8, 88, 788, 1788, 4788, 9788, 176, 177, 'MMAAAA', 'JABAAA', 'HHHHxx'),
+(3212, 686, 0, 0, 2, 12, 12, 212, 1212, 3212, 3212, 24, 25, 'OTAAAA', 'KABAAA', 'OOOOxx'),
+(2725, 687, 1, 1, 5, 5, 25, 725, 725, 2725, 2725, 50, 51, 'VAAAAA', 'LABAAA', 'VVVVxx'),
+(7837, 688, 1, 1, 7, 17, 37, 837, 1837, 2837, 7837, 74, 75, 'LPAAAA', 'MABAAA', 'AAAAxx'),
+(4746, 689, 0, 2, 6, 6, 46, 746, 746, 4746, 4746, 92, 93, 'OAAAAA', 'NABAAA', 'HHHHxx'),
+(3986, 690, 0, 2, 6, 6, 86, 986, 1986, 3986, 3986, 172, 173, 'IXAAAA', 'OABAAA', 'OOOOxx'),
+(9128, 691, 0, 0, 8, 8, 28, 128, 1128, 4128, 9128, 56, 57, 'CNAAAA', 'PABAAA', 'VVVVxx'),
+(5044, 692, 0, 0, 4, 4, 44, 44, 1044, 44, 5044, 88, 89, 'AMAAAA', 'QABAAA', 'AAAAxx'),
+(8132, 693, 0, 0, 2, 12, 32, 132, 132, 3132, 8132, 64, 65, 'UAAAAA', 'RABAAA', 'HHHHxx'),
+(9992, 694, 0, 0, 2, 12, 92, 992, 1992, 4992, 9992, 184, 185, 'IUAAAA', 'SABAAA', 'OOOOxx'),
+(8468, 695, 0, 0, 8, 8, 68, 468, 468, 3468, 8468, 136, 137, 'SNAAAA', 'TABAAA', 'VVVVxx'),
+(6876, 696, 0, 0, 6, 16, 76, 876, 876, 1876, 6876, 152, 153, 'MEAAAA', 'UABAAA', 'AAAAxx'),
+(3532, 697, 0, 0, 2, 12, 32, 532, 1532, 3532, 3532, 64, 65, 'WFAAAA', 'VABAAA', 'HHHHxx'),
+(2140, 698, 0, 0, 0, 0, 40, 140, 140, 2140, 2140, 80, 81, 'IEAAAA', 'WABAAA', 'OOOOxx'),
+(2183, 699, 1, 3, 3, 3, 83, 183, 183, 2183, 2183, 166, 167, 'ZFAAAA', 'XABAAA', 'VVVVxx'),
+(9766, 700, 0, 2, 6, 6, 66, 766, 1766, 4766, 9766, 132, 133, 'QLAAAA', 'YABAAA', 'AAAAxx'),
+(7943, 701, 1, 3, 3, 3, 43, 943, 1943, 2943, 7943, 86, 87, 'NTAAAA', 'ZABAAA', 'HHHHxx'),
+(9243, 702, 1, 3, 3, 3, 43, 243, 1243, 4243, 9243, 86, 87, 'NRAAAA', 'ABBAAA', 'OOOOxx'),
+(6241, 703, 1, 1, 1, 1, 41, 241, 241, 1241, 6241, 82, 83, 'BGAAAA', 'BBBAAA', 'VVVVxx'),
+(9540, 704, 0, 0, 0, 0, 40, 540, 1540, 4540, 9540, 80, 81, 'YCAAAA', 'CBBAAA', 'AAAAxx'),
+(7418, 705, 0, 2, 8, 18, 18, 418, 1418, 2418, 7418, 36, 37, 'IZAAAA', 'DBBAAA', 'HHHHxx'),
+(1603, 706, 1, 3, 3, 3, 3, 603, 1603, 1603, 1603, 6, 7, 'RJAAAA', 'EBBAAA', 'OOOOxx'),
+(8950, 707, 0, 2, 0, 10, 50, 950, 950, 3950, 8950, 100, 101, 'GGAAAA', 'FBBAAA', 'VVVVxx'),
+(6933, 708, 1, 1, 3, 13, 33, 933, 933, 1933, 6933, 66, 67, 'RGAAAA', 'GBBAAA', 'AAAAxx'),
+(2646, 709, 0, 2, 6, 6, 46, 646, 646, 2646, 2646, 92, 93, 'UXAAAA', 'HBBAAA', 'HHHHxx'),
+(3447, 710, 1, 3, 7, 7, 47, 447, 1447, 3447, 3447, 94, 95, 'PCAAAA', 'IBBAAA', 'OOOOxx'),
+(9957, 711, 1, 1, 7, 17, 57, 957, 1957, 4957, 9957, 114, 115, 'ZSAAAA', 'JBBAAA', 'VVVVxx'),
+(4623, 712, 1, 3, 3, 3, 23, 623, 623, 4623, 4623, 46, 47, 'VVAAAA', 'KBBAAA', 'AAAAxx'),
+(9058, 713, 0, 2, 8, 18, 58, 58, 1058, 4058, 9058, 116, 117, 'KKAAAA', 'LBBAAA', 'HHHHxx'),
+(7361, 714, 1, 1, 1, 1, 61, 361, 1361, 2361, 7361, 122, 123, 'DXAAAA', 'MBBAAA', 'OOOOxx'),
+(2489, 715, 1, 1, 9, 9, 89, 489, 489, 2489, 2489, 178, 179, 'TRAAAA', 'NBBAAA', 'VVVVxx'),
+(7643, 716, 1, 3, 3, 3, 43, 643, 1643, 2643, 7643, 86, 87, 'ZHAAAA', 'OBBAAA', 'AAAAxx'),
+(9166, 717, 0, 2, 6, 6, 66, 166, 1166, 4166, 9166, 132, 133, 'OOAAAA', 'PBBAAA', 'HHHHxx'),
+(7789, 718, 1, 1, 9, 9, 89, 789, 1789, 2789, 7789, 178, 179, 'PNAAAA', 'QBBAAA', 'OOOOxx'),
+(2332, 719, 0, 0, 2, 12, 32, 332, 332, 2332, 2332, 64, 65, 'SLAAAA', 'RBBAAA', 'VVVVxx'),
+(1832, 720, 0, 0, 2, 12, 32, 832, 1832, 1832, 1832, 64, 65, 'MSAAAA', 'SBBAAA', 'AAAAxx'),
+(8375, 721, 1, 3, 5, 15, 75, 375, 375, 3375, 8375, 150, 151, 'DKAAAA', 'TBBAAA', 'HHHHxx'),
+(948, 722, 0, 0, 8, 8, 48, 948, 948, 948, 948, 96, 97, 'MKAAAA', 'UBBAAA', 'OOOOxx'),
+(5613, 723, 1, 1, 3, 13, 13, 613, 1613, 613, 5613, 26, 27, 'XHAAAA', 'VBBAAA', 'VVVVxx'),
+(6310, 724, 0, 2, 0, 10, 10, 310, 310, 1310, 6310, 20, 21, 'SIAAAA', 'WBBAAA', 'AAAAxx'),
+(4254, 725, 0, 2, 4, 14, 54, 254, 254, 4254, 4254, 108, 109, 'QHAAAA', 'XBBAAA', 'HHHHxx'),
+(4260, 726, 0, 0, 0, 0, 60, 260, 260, 4260, 4260, 120, 121, 'WHAAAA', 'YBBAAA', 'OOOOxx'),
+(2060, 727, 0, 0, 0, 0, 60, 60, 60, 2060, 2060, 120, 121, 'GBAAAA', 'ZBBAAA', 'VVVVxx'),
+(4831, 728, 1, 3, 1, 11, 31, 831, 831, 4831, 4831, 62, 63, 'VDAAAA', 'ACBAAA', 'AAAAxx'),
+(6176, 729, 0, 0, 6, 16, 76, 176, 176, 1176, 6176, 152, 153, 'ODAAAA', 'BCBAAA', 'HHHHxx'),
+(6688, 730, 0, 0, 8, 8, 88, 688, 688, 1688, 6688, 176, 177, 'GXAAAA', 'CCBAAA', 'OOOOxx'),
+(5752, 731, 0, 0, 2, 12, 52, 752, 1752, 752, 5752, 104, 105, 'GNAAAA', 'DCBAAA', 'VVVVxx'),
+(8714, 732, 0, 2, 4, 14, 14, 714, 714, 3714, 8714, 28, 29, 'EXAAAA', 'ECBAAA', 'AAAAxx'),
+(6739, 733, 1, 3, 9, 19, 39, 739, 739, 1739, 6739, 78, 79, 'FZAAAA', 'FCBAAA', 'HHHHxx'),
+(7066, 734, 0, 2, 6, 6, 66, 66, 1066, 2066, 7066, 132, 133, 'ULAAAA', 'GCBAAA', 'OOOOxx'),
+(7250, 735, 0, 2, 0, 10, 50, 250, 1250, 2250, 7250, 100, 101, 'WSAAAA', 'HCBAAA', 'VVVVxx'),
+(3161, 736, 1, 1, 1, 1, 61, 161, 1161, 3161, 3161, 122, 123, 'PRAAAA', 'ICBAAA', 'AAAAxx'),
+(1411, 737, 1, 3, 1, 11, 11, 411, 1411, 1411, 1411, 22, 23, 'HCAAAA', 'JCBAAA', 'HHHHxx'),
+(9301, 738, 1, 1, 1, 1, 1, 301, 1301, 4301, 9301, 2, 3, 'TTAAAA', 'KCBAAA', 'OOOOxx'),
+(8324, 739, 0, 0, 4, 4, 24, 324, 324, 3324, 8324, 48, 49, 'EIAAAA', 'LCBAAA', 'VVVVxx'),
+(9641, 740, 1, 1, 1, 1, 41, 641, 1641, 4641, 9641, 82, 83, 'VGAAAA', 'MCBAAA', 'AAAAxx'),
+(7077, 741, 1, 1, 7, 17, 77, 77, 1077, 2077, 7077, 154, 155, 'FMAAAA', 'NCBAAA', 'HHHHxx'),
+(9888, 742, 0, 0, 8, 8, 88, 888, 1888, 4888, 9888, 176, 177, 'IQAAAA', 'OCBAAA', 'OOOOxx'),
+(9909, 743, 1, 1, 9, 9, 9, 909, 1909, 4909, 9909, 18, 19, 'DRAAAA', 'PCBAAA', 'VVVVxx'),
+(2209, 744, 1, 1, 9, 9, 9, 209, 209, 2209, 2209, 18, 19, 'ZGAAAA', 'QCBAAA', 'AAAAxx'),
+(6904, 745, 0, 0, 4, 4, 4, 904, 904, 1904, 6904, 8, 9, 'OFAAAA', 'RCBAAA', 'HHHHxx'),
+(6608, 746, 0, 0, 8, 8, 8, 608, 608, 1608, 6608, 16, 17, 'EUAAAA', 'SCBAAA', 'OOOOxx'),
+(8400, 747, 0, 0, 0, 0, 0, 400, 400, 3400, 8400, 0, 1, 'CLAAAA', 'TCBAAA', 'VVVVxx'),
+(5124, 748, 0, 0, 4, 4, 24, 124, 1124, 124, 5124, 48, 49, 'CPAAAA', 'UCBAAA', 'AAAAxx'),
+(5484, 749, 0, 0, 4, 4, 84, 484, 1484, 484, 5484, 168, 169, 'YCAAAA', 'VCBAAA', 'HHHHxx'),
+(3575, 750, 1, 3, 5, 15, 75, 575, 1575, 3575, 3575, 150, 151, 'NHAAAA', 'WCBAAA', 'OOOOxx'),
+(9723, 751, 1, 3, 3, 3, 23, 723, 1723, 4723, 9723, 46, 47, 'ZJAAAA', 'XCBAAA', 'VVVVxx'),
+(360, 752, 0, 0, 0, 0, 60, 360, 360, 360, 360, 120, 121, 'WNAAAA', 'YCBAAA', 'AAAAxx'),
+(1059, 753, 1, 3, 9, 19, 59, 59, 1059, 1059, 1059, 118, 119, 'TOAAAA', 'ZCBAAA', 'HHHHxx'),
+(4941, 754, 1, 1, 1, 1, 41, 941, 941, 4941, 4941, 82, 83, 'BIAAAA', 'ADBAAA', 'OOOOxx'),
+(2535, 755, 1, 3, 5, 15, 35, 535, 535, 2535, 2535, 70, 71, 'NTAAAA', 'BDBAAA', 'VVVVxx'),
+(4119, 756, 1, 3, 9, 19, 19, 119, 119, 4119, 4119, 38, 39, 'LCAAAA', 'CDBAAA', 'AAAAxx'),
+(3725, 757, 1, 1, 5, 5, 25, 725, 1725, 3725, 3725, 50, 51, 'HNAAAA', 'DDBAAA', 'HHHHxx'),
+(4758, 758, 0, 2, 8, 18, 58, 758, 758, 4758, 4758, 116, 117, 'ABAAAA', 'EDBAAA', 'OOOOxx'),
+(9593, 759, 1, 1, 3, 13, 93, 593, 1593, 4593, 9593, 186, 187, 'ZEAAAA', 'FDBAAA', 'VVVVxx'),
+(4663, 760, 1, 3, 3, 3, 63, 663, 663, 4663, 4663, 126, 127, 'JXAAAA', 'GDBAAA', 'AAAAxx'),
+(7734, 761, 0, 2, 4, 14, 34, 734, 1734, 2734, 7734, 68, 69, 'MLAAAA', 'HDBAAA', 'HHHHxx'),
+(9156, 762, 0, 0, 6, 16, 56, 156, 1156, 4156, 9156, 112, 113, 'EOAAAA', 'IDBAAA', 'OOOOxx'),
+(8120, 763, 0, 0, 0, 0, 20, 120, 120, 3120, 8120, 40, 41, 'IAAAAA', 'JDBAAA', 'VVVVxx'),
+(4385, 764, 1, 1, 5, 5, 85, 385, 385, 4385, 4385, 170, 171, 'RMAAAA', 'KDBAAA', 'AAAAxx'),
+(2926, 765, 0, 2, 6, 6, 26, 926, 926, 2926, 2926, 52, 53, 'OIAAAA', 'LDBAAA', 'HHHHxx'),
+(4186, 766, 0, 2, 6, 6, 86, 186, 186, 4186, 4186, 172, 173, 'AFAAAA', 'MDBAAA', 'OOOOxx'),
+(2508, 767, 0, 0, 8, 8, 8, 508, 508, 2508, 2508, 16, 17, 'MSAAAA', 'NDBAAA', 'VVVVxx'),
+(4012, 768, 0, 0, 2, 12, 12, 12, 12, 4012, 4012, 24, 25, 'IYAAAA', 'ODBAAA', 'AAAAxx'),
+(6266, 769, 0, 2, 6, 6, 66, 266, 266, 1266, 6266, 132, 133, 'AHAAAA', 'PDBAAA', 'HHHHxx'),
+(3709, 770, 1, 1, 9, 9, 9, 709, 1709, 3709, 3709, 18, 19, 'RMAAAA', 'QDBAAA', 'OOOOxx'),
+(7289, 771, 1, 1, 9, 9, 89, 289, 1289, 2289, 7289, 178, 179, 'JUAAAA', 'RDBAAA', 'VVVVxx'),
+(8875, 772, 1, 3, 5, 15, 75, 875, 875, 3875, 8875, 150, 151, 'JDAAAA', 'SDBAAA', 'AAAAxx'),
+(4412, 773, 0, 0, 2, 12, 12, 412, 412, 4412, 4412, 24, 25, 'SNAAAA', 'TDBAAA', 'HHHHxx'),
+(3033, 774, 1, 1, 3, 13, 33, 33, 1033, 3033, 3033, 66, 67, 'RMAAAA', 'UDBAAA', 'OOOOxx'),
+(1645, 775, 1, 1, 5, 5, 45, 645, 1645, 1645, 1645, 90, 91, 'HLAAAA', 'VDBAAA', 'VVVVxx'),
+(3557, 776, 1, 1, 7, 17, 57, 557, 1557, 3557, 3557, 114, 115, 'VGAAAA', 'WDBAAA', 'AAAAxx'),
+(6316, 777, 0, 0, 6, 16, 16, 316, 316, 1316, 6316, 32, 33, 'YIAAAA', 'XDBAAA', 'HHHHxx'),
+(2054, 778, 0, 2, 4, 14, 54, 54, 54, 2054, 2054, 108, 109, 'ABAAAA', 'YDBAAA', 'OOOOxx'),
+(7031, 779, 1, 3, 1, 11, 31, 31, 1031, 2031, 7031, 62, 63, 'LKAAAA', 'ZDBAAA', 'VVVVxx'),
+(3405, 780, 1, 1, 5, 5, 5, 405, 1405, 3405, 3405, 10, 11, 'ZAAAAA', 'AEBAAA', 'AAAAxx'),
+(5343, 781, 1, 3, 3, 3, 43, 343, 1343, 343, 5343, 86, 87, 'NXAAAA', 'BEBAAA', 'HHHHxx'),
+(5240, 782, 0, 0, 0, 0, 40, 240, 1240, 240, 5240, 80, 81, 'OTAAAA', 'CEBAAA', 'OOOOxx'),
+(9650, 783, 0, 2, 0, 10, 50, 650, 1650, 4650, 9650, 100, 101, 'EHAAAA', 'DEBAAA', 'VVVVxx'),
+(3777, 784, 1, 1, 7, 17, 77, 777, 1777, 3777, 3777, 154, 155, 'HPAAAA', 'EEBAAA', 'AAAAxx'),
+(9041, 785, 1, 1, 1, 1, 41, 41, 1041, 4041, 9041, 82, 83, 'TJAAAA', 'FEBAAA', 'HHHHxx'),
+(6923, 786, 1, 3, 3, 3, 23, 923, 923, 1923, 6923, 46, 47, 'HGAAAA', 'GEBAAA', 'OOOOxx'),
+(2977, 787, 1, 1, 7, 17, 77, 977, 977, 2977, 2977, 154, 155, 'NKAAAA', 'HEBAAA', 'VVVVxx'),
+(5500, 788, 0, 0, 0, 0, 0, 500, 1500, 500, 5500, 0, 1, 'ODAAAA', 'IEBAAA', 'AAAAxx'),
+(1044, 789, 0, 0, 4, 4, 44, 44, 1044, 1044, 1044, 88, 89, 'EOAAAA', 'JEBAAA', 'HHHHxx'),
+(434, 790, 0, 2, 4, 14, 34, 434, 434, 434, 434, 68, 69, 'SQAAAA', 'KEBAAA', 'OOOOxx'),
+(611, 791, 1, 3, 1, 11, 11, 611, 611, 611, 611, 22, 23, 'NXAAAA', 'LEBAAA', 'VVVVxx'),
+(5760, 792, 0, 0, 0, 0, 60, 760, 1760, 760, 5760, 120, 121, 'ONAAAA', 'MEBAAA', 'AAAAxx'),
+(2445, 793, 1, 1, 5, 5, 45, 445, 445, 2445, 2445, 90, 91, 'BQAAAA', 'NEBAAA', 'HHHHxx'),
+(7098, 794, 0, 2, 8, 18, 98, 98, 1098, 2098, 7098, 196, 197, 'ANAAAA', 'OEBAAA', 'OOOOxx'),
+(2188, 795, 0, 0, 8, 8, 88, 188, 188, 2188, 2188, 176, 177, 'EGAAAA', 'PEBAAA', 'VVVVxx'),
+(4597, 796, 1, 1, 7, 17, 97, 597, 597, 4597, 4597, 194, 195, 'VUAAAA', 'QEBAAA', 'AAAAxx'),
+(1913, 797, 1, 1, 3, 13, 13, 913, 1913, 1913, 1913, 26, 27, 'PVAAAA', 'REBAAA', 'HHHHxx'),
+(8696, 798, 0, 0, 6, 16, 96, 696, 696, 3696, 8696, 192, 193, 'MWAAAA', 'SEBAAA', 'OOOOxx'),
+(3332, 799, 0, 0, 2, 12, 32, 332, 1332, 3332, 3332, 64, 65, 'EYAAAA', 'TEBAAA', 'VVVVxx'),
+(8760, 800, 0, 0, 0, 0, 60, 760, 760, 3760, 8760, 120, 121, 'YYAAAA', 'UEBAAA', 'AAAAxx'),
+(3215, 801, 1, 3, 5, 15, 15, 215, 1215, 3215, 3215, 30, 31, 'RTAAAA', 'VEBAAA', 'HHHHxx'),
+(1625, 802, 1, 1, 5, 5, 25, 625, 1625, 1625, 1625, 50, 51, 'NKAAAA', 'WEBAAA', 'OOOOxx'),
+(4219, 803, 1, 3, 9, 19, 19, 219, 219, 4219, 4219, 38, 39, 'HGAAAA', 'XEBAAA', 'VVVVxx'),
+(415, 804, 1, 3, 5, 15, 15, 415, 415, 415, 415, 30, 31, 'ZPAAAA', 'YEBAAA', 'AAAAxx'),
+(4242, 805, 0, 2, 2, 2, 42, 242, 242, 4242, 4242, 84, 85, 'EHAAAA', 'ZEBAAA', 'HHHHxx'),
+(8660, 806, 0, 0, 0, 0, 60, 660, 660, 3660, 8660, 120, 121, 'CVAAAA', 'AFBAAA', 'OOOOxx'),
+(6525, 807, 1, 1, 5, 5, 25, 525, 525, 1525, 6525, 50, 51, 'ZQAAAA', 'BFBAAA', 'VVVVxx'),
+(2141, 808, 1, 1, 1, 1, 41, 141, 141, 2141, 2141, 82, 83, 'JEAAAA', 'CFBAAA', 'AAAAxx'),
+(5152, 809, 0, 0, 2, 12, 52, 152, 1152, 152, 5152, 104, 105, 'EQAAAA', 'DFBAAA', 'HHHHxx'),
+(8560, 810, 0, 0, 0, 0, 60, 560, 560, 3560, 8560, 120, 121, 'GRAAAA', 'EFBAAA', 'OOOOxx'),
+(9835, 811, 1, 3, 5, 15, 35, 835, 1835, 4835, 9835, 70, 71, 'HOAAAA', 'FFBAAA', 'VVVVxx'),
+(2657, 812, 1, 1, 7, 17, 57, 657, 657, 2657, 2657, 114, 115, 'FYAAAA', 'GFBAAA', 'AAAAxx'),
+(6085, 813, 1, 1, 5, 5, 85, 85, 85, 1085, 6085, 170, 171, 'BAAAAA', 'HFBAAA', 'HHHHxx'),
+(6698, 814, 0, 2, 8, 18, 98, 698, 698, 1698, 6698, 196, 197, 'QXAAAA', 'IFBAAA', 'OOOOxx'),
+(5421, 815, 1, 1, 1, 1, 21, 421, 1421, 421, 5421, 42, 43, 'NAAAAA', 'JFBAAA', 'VVVVxx'),
+(6661, 816, 1, 1, 1, 1, 61, 661, 661, 1661, 6661, 122, 123, 'FWAAAA', 'KFBAAA', 'AAAAxx'),
+(5645, 817, 1, 1, 5, 5, 45, 645, 1645, 645, 5645, 90, 91, 'DJAAAA', 'LFBAAA', 'HHHHxx'),
+(1248, 818, 0, 0, 8, 8, 48, 248, 1248, 1248, 1248, 96, 97, 'AWAAAA', 'MFBAAA', 'OOOOxx'),
+(5690, 819, 0, 2, 0, 10, 90, 690, 1690, 690, 5690, 180, 181, 'WKAAAA', 'NFBAAA', 'VVVVxx'),
+(4762, 820, 0, 2, 2, 2, 62, 762, 762, 4762, 4762, 124, 125, 'EBAAAA', 'OFBAAA', 'AAAAxx'),
+(1455, 821, 1, 3, 5, 15, 55, 455, 1455, 1455, 1455, 110, 111, 'ZDAAAA', 'PFBAAA', 'HHHHxx'),
+(9846, 822, 0, 2, 6, 6, 46, 846, 1846, 4846, 9846, 92, 93, 'SOAAAA', 'QFBAAA', 'OOOOxx'),
+(5295, 823, 1, 3, 5, 15, 95, 295, 1295, 295, 5295, 190, 191, 'RVAAAA', 'RFBAAA', 'VVVVxx'),
+(2826, 824, 0, 2, 6, 6, 26, 826, 826, 2826, 2826, 52, 53, 'SEAAAA', 'SFBAAA', 'AAAAxx'),
+(7496, 825, 0, 0, 6, 16, 96, 496, 1496, 2496, 7496, 192, 193, 'ICAAAA', 'TFBAAA', 'HHHHxx'),
+(3024, 826, 0, 0, 4, 4, 24, 24, 1024, 3024, 3024, 48, 49, 'IMAAAA', 'UFBAAA', 'OOOOxx'),
+(4945, 827, 1, 1, 5, 5, 45, 945, 945, 4945, 4945, 90, 91, 'FIAAAA', 'VFBAAA', 'VVVVxx'),
+(4404, 828, 0, 0, 4, 4, 4, 404, 404, 4404, 4404, 8, 9, 'KNAAAA', 'WFBAAA', 'AAAAxx'),
+(9302, 829, 0, 2, 2, 2, 2, 302, 1302, 4302, 9302, 4, 5, 'UTAAAA', 'XFBAAA', 'HHHHxx'),
+(1286, 830, 0, 2, 6, 6, 86, 286, 1286, 1286, 1286, 172, 173, 'MXAAAA', 'YFBAAA', 'OOOOxx'),
+(8435, 831, 1, 3, 5, 15, 35, 435, 435, 3435, 8435, 70, 71, 'LMAAAA', 'ZFBAAA', 'VVVVxx'),
+(8969, 832, 1, 1, 9, 9, 69, 969, 969, 3969, 8969, 138, 139, 'ZGAAAA', 'AGBAAA', 'AAAAxx'),
+(3302, 833, 0, 2, 2, 2, 2, 302, 1302, 3302, 3302, 4, 5, 'AXAAAA', 'BGBAAA', 'HHHHxx'),
+(9753, 834, 1, 1, 3, 13, 53, 753, 1753, 4753, 9753, 106, 107, 'DLAAAA', 'CGBAAA', 'OOOOxx'),
+(9374, 835, 0, 2, 4, 14, 74, 374, 1374, 4374, 9374, 148, 149, 'OWAAAA', 'DGBAAA', 'VVVVxx'),
+(4907, 836, 1, 3, 7, 7, 7, 907, 907, 4907, 4907, 14, 15, 'TGAAAA', 'EGBAAA', 'AAAAxx'),
+(1659, 837, 1, 3, 9, 19, 59, 659, 1659, 1659, 1659, 118, 119, 'VLAAAA', 'FGBAAA', 'HHHHxx'),
+(5095, 838, 1, 3, 5, 15, 95, 95, 1095, 95, 5095, 190, 191, 'ZNAAAA', 'GGBAAA', 'OOOOxx'),
+(9446, 839, 0, 2, 6, 6, 46, 446, 1446, 4446, 9446, 92, 93, 'IZAAAA', 'HGBAAA', 'VVVVxx'),
+(8528, 840, 0, 0, 8, 8, 28, 528, 528, 3528, 8528, 56, 57, 'AQAAAA', 'IGBAAA', 'AAAAxx'),
+(4890, 841, 0, 2, 0, 10, 90, 890, 890, 4890, 4890, 180, 181, 'CGAAAA', 'JGBAAA', 'HHHHxx'),
+(1221, 842, 1, 1, 1, 1, 21, 221, 1221, 1221, 1221, 42, 43, 'ZUAAAA', 'KGBAAA', 'OOOOxx'),
+(5583, 843, 1, 3, 3, 3, 83, 583, 1583, 583, 5583, 166, 167, 'TGAAAA', 'LGBAAA', 'VVVVxx'),
+(7303, 844, 1, 3, 3, 3, 3, 303, 1303, 2303, 7303, 6, 7, 'XUAAAA', 'MGBAAA', 'AAAAxx'),
+(406, 845, 0, 2, 6, 6, 6, 406, 406, 406, 406, 12, 13, 'QPAAAA', 'NGBAAA', 'HHHHxx'),
+(7542, 846, 0, 2, 2, 2, 42, 542, 1542, 2542, 7542, 84, 85, 'CEAAAA', 'OGBAAA', 'OOOOxx'),
+(9507, 847, 1, 3, 7, 7, 7, 507, 1507, 4507, 9507, 14, 15, 'RBAAAA', 'PGBAAA', 'VVVVxx'),
+(9511, 848, 1, 3, 1, 11, 11, 511, 1511, 4511, 9511, 22, 23, 'VBAAAA', 'QGBAAA', 'AAAAxx'),
+(1373, 849, 1, 1, 3, 13, 73, 373, 1373, 1373, 1373, 146, 147, 'VAAAAA', 'RGBAAA', 'HHHHxx'),
+(6556, 850, 0, 0, 6, 16, 56, 556, 556, 1556, 6556, 112, 113, 'ESAAAA', 'SGBAAA', 'OOOOxx'),
+(4117, 851, 1, 1, 7, 17, 17, 117, 117, 4117, 4117, 34, 35, 'JCAAAA', 'TGBAAA', 'VVVVxx'),
+(7794, 852, 0, 2, 4, 14, 94, 794, 1794, 2794, 7794, 188, 189, 'UNAAAA', 'UGBAAA', 'AAAAxx'),
+(7170, 853, 0, 2, 0, 10, 70, 170, 1170, 2170, 7170, 140, 141, 'UPAAAA', 'VGBAAA', 'HHHHxx'),
+(5809, 854, 1, 1, 9, 9, 9, 809, 1809, 809, 5809, 18, 19, 'LPAAAA', 'WGBAAA', 'OOOOxx'),
+(7828, 855, 0, 0, 8, 8, 28, 828, 1828, 2828, 7828, 56, 57, 'CPAAAA', 'XGBAAA', 'VVVVxx'),
+(8046, 856, 0, 2, 6, 6, 46, 46, 46, 3046, 8046, 92, 93, 'MXAAAA', 'YGBAAA', 'AAAAxx'),
+(4833, 857, 1, 1, 3, 13, 33, 833, 833, 4833, 4833, 66, 67, 'XDAAAA', 'ZGBAAA', 'HHHHxx'),
+(2107, 858, 1, 3, 7, 7, 7, 107, 107, 2107, 2107, 14, 15, 'BDAAAA', 'AHBAAA', 'OOOOxx'),
+(4276, 859, 0, 0, 6, 16, 76, 276, 276, 4276, 4276, 152, 153, 'MIAAAA', 'BHBAAA', 'VVVVxx'),
+(9536, 860, 0, 0, 6, 16, 36, 536, 1536, 4536, 9536, 72, 73, 'UCAAAA', 'CHBAAA', 'AAAAxx'),
+(5549, 861, 1, 1, 9, 9, 49, 549, 1549, 549, 5549, 98, 99, 'LFAAAA', 'DHBAAA', 'HHHHxx'),
+(6427, 862, 1, 3, 7, 7, 27, 427, 427, 1427, 6427, 54, 55, 'FNAAAA', 'EHBAAA', 'OOOOxx'),
+(1382, 863, 0, 2, 2, 2, 82, 382, 1382, 1382, 1382, 164, 165, 'EBAAAA', 'FHBAAA', 'VVVVxx'),
+(3256, 864, 0, 0, 6, 16, 56, 256, 1256, 3256, 3256, 112, 113, 'GVAAAA', 'GHBAAA', 'AAAAxx'),
+(3270, 865, 0, 2, 0, 10, 70, 270, 1270, 3270, 3270, 140, 141, 'UVAAAA', 'HHBAAA', 'HHHHxx'),
+(4808, 866, 0, 0, 8, 8, 8, 808, 808, 4808, 4808, 16, 17, 'YCAAAA', 'IHBAAA', 'OOOOxx'),
+(7938, 867, 0, 2, 8, 18, 38, 938, 1938, 2938, 7938, 76, 77, 'ITAAAA', 'JHBAAA', 'VVVVxx'),
+(4405, 868, 1, 1, 5, 5, 5, 405, 405, 4405, 4405, 10, 11, 'LNAAAA', 'KHBAAA', 'AAAAxx'),
+(2264, 869, 0, 0, 4, 4, 64, 264, 264, 2264, 2264, 128, 129, 'CJAAAA', 'LHBAAA', 'HHHHxx'),
+(80, 870, 0, 0, 0, 0, 80, 80, 80, 80, 80, 160, 161, 'CDAAAA', 'MHBAAA', 'OOOOxx'),
+(320, 871, 0, 0, 0, 0, 20, 320, 320, 320, 320, 40, 41, 'IMAAAA', 'NHBAAA', 'VVVVxx'),
+(2383, 872, 1, 3, 3, 3, 83, 383, 383, 2383, 2383, 166, 167, 'RNAAAA', 'OHBAAA', 'AAAAxx'),
+(3146, 873, 0, 2, 6, 6, 46, 146, 1146, 3146, 3146, 92, 93, 'ARAAAA', 'PHBAAA', 'HHHHxx'),
+(6911, 874, 1, 3, 1, 11, 11, 911, 911, 1911, 6911, 22, 23, 'VFAAAA', 'QHBAAA', 'OOOOxx'),
+(7377, 875, 1, 1, 7, 17, 77, 377, 1377, 2377, 7377, 154, 155, 'TXAAAA', 'RHBAAA', 'VVVVxx'),
+(9965, 876, 1, 1, 5, 5, 65, 965, 1965, 4965, 9965, 130, 131, 'HTAAAA', 'SHBAAA', 'AAAAxx'),
+(8361, 877, 1, 1, 1, 1, 61, 361, 361, 3361, 8361, 122, 123, 'PJAAAA', 'THBAAA', 'HHHHxx'),
+(9417, 878, 1, 1, 7, 17, 17, 417, 1417, 4417, 9417, 34, 35, 'FYAAAA', 'UHBAAA', 'OOOOxx'),
+(2483, 879, 1, 3, 3, 3, 83, 483, 483, 2483, 2483, 166, 167, 'NRAAAA', 'VHBAAA', 'VVVVxx'),
+(9843, 880, 1, 3, 3, 3, 43, 843, 1843, 4843, 9843, 86, 87, 'POAAAA', 'WHBAAA', 'AAAAxx'),
+(6395, 881, 1, 3, 5, 15, 95, 395, 395, 1395, 6395, 190, 191, 'ZLAAAA', 'XHBAAA', 'HHHHxx'),
+(6444, 882, 0, 0, 4, 4, 44, 444, 444, 1444, 6444, 88, 89, 'WNAAAA', 'YHBAAA', 'OOOOxx'),
+(1820, 883, 0, 0, 0, 0, 20, 820, 1820, 1820, 1820, 40, 41, 'ASAAAA', 'ZHBAAA', 'VVVVxx'),
+(2768, 884, 0, 0, 8, 8, 68, 768, 768, 2768, 2768, 136, 137, 'MCAAAA', 'AIBAAA', 'AAAAxx'),
+(5413, 885, 1, 1, 3, 13, 13, 413, 1413, 413, 5413, 26, 27, 'FAAAAA', 'BIBAAA', 'HHHHxx'),
+(2923, 886, 1, 3, 3, 3, 23, 923, 923, 2923, 2923, 46, 47, 'LIAAAA', 'CIBAAA', 'OOOOxx'),
+(5286, 887, 0, 2, 6, 6, 86, 286, 1286, 286, 5286, 172, 173, 'IVAAAA', 'DIBAAA', 'VVVVxx'),
+(6126, 888, 0, 2, 6, 6, 26, 126, 126, 1126, 6126, 52, 53, 'QBAAAA', 'EIBAAA', 'AAAAxx'),
+(8343, 889, 1, 3, 3, 3, 43, 343, 343, 3343, 8343, 86, 87, 'XIAAAA', 'FIBAAA', 'HHHHxx'),
+(6010, 890, 0, 2, 0, 10, 10, 10, 10, 1010, 6010, 20, 21, 'EXAAAA', 'GIBAAA', 'OOOOxx'),
+(4177, 891, 1, 1, 7, 17, 77, 177, 177, 4177, 4177, 154, 155, 'REAAAA', 'HIBAAA', 'VVVVxx'),
+(5808, 892, 0, 0, 8, 8, 8, 808, 1808, 808, 5808, 16, 17, 'KPAAAA', 'IIBAAA', 'AAAAxx'),
+(4859, 893, 1, 3, 9, 19, 59, 859, 859, 4859, 4859, 118, 119, 'XEAAAA', 'JIBAAA', 'HHHHxx'),
+(9252, 894, 0, 0, 2, 12, 52, 252, 1252, 4252, 9252, 104, 105, 'WRAAAA', 'KIBAAA', 'OOOOxx'),
+(2941, 895, 1, 1, 1, 1, 41, 941, 941, 2941, 2941, 82, 83, 'DJAAAA', 'LIBAAA', 'VVVVxx'),
+(8693, 896, 1, 1, 3, 13, 93, 693, 693, 3693, 8693, 186, 187, 'JWAAAA', 'MIBAAA', 'AAAAxx'),
+(4432, 897, 0, 0, 2, 12, 32, 432, 432, 4432, 4432, 64, 65, 'MOAAAA', 'NIBAAA', 'HHHHxx'),
+(2371, 898, 1, 3, 1, 11, 71, 371, 371, 2371, 2371, 142, 143, 'FNAAAA', 'OIBAAA', 'OOOOxx'),
+(7546, 899, 0, 2, 6, 6, 46, 546, 1546, 2546, 7546, 92, 93, 'GEAAAA', 'PIBAAA', 'VVVVxx'),
+(1369, 900, 1, 1, 9, 9, 69, 369, 1369, 1369, 1369, 138, 139, 'RAAAAA', 'QIBAAA', 'AAAAxx'),
+(4687, 901, 1, 3, 7, 7, 87, 687, 687, 4687, 4687, 174, 175, 'HYAAAA', 'RIBAAA', 'HHHHxx'),
+(8941, 902, 1, 1, 1, 1, 41, 941, 941, 3941, 8941, 82, 83, 'XFAAAA', 'SIBAAA', 'OOOOxx'),
+(226, 903, 0, 2, 6, 6, 26, 226, 226, 226, 226, 52, 53, 'SIAAAA', 'TIBAAA', 'VVVVxx'),
+(3493, 904, 1, 1, 3, 13, 93, 493, 1493, 3493, 3493, 186, 187, 'JEAAAA', 'UIBAAA', 'AAAAxx'),
+(6433, 905, 1, 1, 3, 13, 33, 433, 433, 1433, 6433, 66, 67, 'LNAAAA', 'VIBAAA', 'HHHHxx'),
+(9189, 906, 1, 1, 9, 9, 89, 189, 1189, 4189, 9189, 178, 179, 'LPAAAA', 'WIBAAA', 'OOOOxx'),
+(6027, 907, 1, 3, 7, 7, 27, 27, 27, 1027, 6027, 54, 55, 'VXAAAA', 'XIBAAA', 'VVVVxx'),
+(4615, 908, 1, 3, 5, 15, 15, 615, 615, 4615, 4615, 30, 31, 'NVAAAA', 'YIBAAA', 'AAAAxx'),
+(5320, 909, 0, 0, 0, 0, 20, 320, 1320, 320, 5320, 40, 41, 'QWAAAA', 'ZIBAAA', 'HHHHxx'),
+(7002, 910, 0, 2, 2, 2, 2, 2, 1002, 2002, 7002, 4, 5, 'IJAAAA', 'AJBAAA', 'OOOOxx'),
+(7367, 911, 1, 3, 7, 7, 67, 367, 1367, 2367, 7367, 134, 135, 'JXAAAA', 'BJBAAA', 'VVVVxx'),
+(289, 912, 1, 1, 9, 9, 89, 289, 289, 289, 289, 178, 179, 'DLAAAA', 'CJBAAA', 'AAAAxx'),
+(407, 913, 1, 3, 7, 7, 7, 407, 407, 407, 407, 14, 15, 'RPAAAA', 'DJBAAA', 'HHHHxx'),
+(504, 914, 0, 0, 4, 4, 4, 504, 504, 504, 504, 8, 9, 'KTAAAA', 'EJBAAA', 'OOOOxx'),
+(8301, 915, 1, 1, 1, 1, 1, 301, 301, 3301, 8301, 2, 3, 'HHAAAA', 'FJBAAA', 'VVVVxx'),
+(1396, 916, 0, 0, 6, 16, 96, 396, 1396, 1396, 1396, 192, 193, 'SBAAAA', 'GJBAAA', 'AAAAxx'),
+(4794, 917, 0, 2, 4, 14, 94, 794, 794, 4794, 4794, 188, 189, 'KCAAAA', 'HJBAAA', 'HHHHxx'),
+(6400, 918, 0, 0, 0, 0, 0, 400, 400, 1400, 6400, 0, 1, 'EMAAAA', 'IJBAAA', 'OOOOxx'),
+(1275, 919, 1, 3, 5, 15, 75, 275, 1275, 1275, 1275, 150, 151, 'BXAAAA', 'JJBAAA', 'VVVVxx'),
+(5797, 920, 1, 1, 7, 17, 97, 797, 1797, 797, 5797, 194, 195, 'ZOAAAA', 'KJBAAA', 'AAAAxx'),
+(2221, 921, 1, 1, 1, 1, 21, 221, 221, 2221, 2221, 42, 43, 'LHAAAA', 'LJBAAA', 'HHHHxx'),
+(2504, 922, 0, 0, 4, 4, 4, 504, 504, 2504, 2504, 8, 9, 'ISAAAA', 'MJBAAA', 'OOOOxx'),
+(2143, 923, 1, 3, 3, 3, 43, 143, 143, 2143, 2143, 86, 87, 'LEAAAA', 'NJBAAA', 'VVVVxx'),
+(1083, 924, 1, 3, 3, 3, 83, 83, 1083, 1083, 1083, 166, 167, 'RPAAAA', 'OJBAAA', 'AAAAxx'),
+(6148, 925, 0, 0, 8, 8, 48, 148, 148, 1148, 6148, 96, 97, 'MCAAAA', 'PJBAAA', 'HHHHxx'),
+(3612, 926, 0, 0, 2, 12, 12, 612, 1612, 3612, 3612, 24, 25, 'YIAAAA', 'QJBAAA', 'OOOOxx'),
+(9499, 927, 1, 3, 9, 19, 99, 499, 1499, 4499, 9499, 198, 199, 'JBAAAA', 'RJBAAA', 'VVVVxx'),
+(5773, 928, 1, 1, 3, 13, 73, 773, 1773, 773, 5773, 146, 147, 'BOAAAA', 'SJBAAA', 'AAAAxx'),
+(1014, 929, 0, 2, 4, 14, 14, 14, 1014, 1014, 1014, 28, 29, 'ANAAAA', 'TJBAAA', 'HHHHxx'),
+(1427, 930, 1, 3, 7, 7, 27, 427, 1427, 1427, 1427, 54, 55, 'XCAAAA', 'UJBAAA', 'OOOOxx'),
+(6770, 931, 0, 2, 0, 10, 70, 770, 770, 1770, 6770, 140, 141, 'KAAAAA', 'VJBAAA', 'VVVVxx'),
+(9042, 932, 0, 2, 2, 2, 42, 42, 1042, 4042, 9042, 84, 85, 'UJAAAA', 'WJBAAA', 'AAAAxx'),
+(9892, 933, 0, 0, 2, 12, 92, 892, 1892, 4892, 9892, 184, 185, 'MQAAAA', 'XJBAAA', 'HHHHxx'),
+(1771, 934, 1, 3, 1, 11, 71, 771, 1771, 1771, 1771, 142, 143, 'DQAAAA', 'YJBAAA', 'OOOOxx'),
+(7392, 935, 0, 0, 2, 12, 92, 392, 1392, 2392, 7392, 184, 185, 'IYAAAA', 'ZJBAAA', 'VVVVxx'),
+(4465, 936, 1, 1, 5, 5, 65, 465, 465, 4465, 4465, 130, 131, 'TPAAAA', 'AKBAAA', 'AAAAxx'),
+(278, 937, 0, 2, 8, 18, 78, 278, 278, 278, 278, 156, 157, 'SKAAAA', 'BKBAAA', 'HHHHxx'),
+(7776, 938, 0, 0, 6, 16, 76, 776, 1776, 2776, 7776, 152, 153, 'CNAAAA', 'CKBAAA', 'OOOOxx'),
+(3763, 939, 1, 3, 3, 3, 63, 763, 1763, 3763, 3763, 126, 127, 'TOAAAA', 'DKBAAA', 'VVVVxx'),
+(7503, 940, 1, 3, 3, 3, 3, 503, 1503, 2503, 7503, 6, 7, 'PCAAAA', 'EKBAAA', 'AAAAxx'),
+(3793, 941, 1, 1, 3, 13, 93, 793, 1793, 3793, 3793, 186, 187, 'XPAAAA', 'FKBAAA', 'HHHHxx'),
+(6510, 942, 0, 2, 0, 10, 10, 510, 510, 1510, 6510, 20, 21, 'KQAAAA', 'GKBAAA', 'OOOOxx'),
+(7641, 943, 1, 1, 1, 1, 41, 641, 1641, 2641, 7641, 82, 83, 'XHAAAA', 'HKBAAA', 'VVVVxx'),
+(3228, 944, 0, 0, 8, 8, 28, 228, 1228, 3228, 3228, 56, 57, 'EUAAAA', 'IKBAAA', 'AAAAxx'),
+(194, 945, 0, 2, 4, 14, 94, 194, 194, 194, 194, 188, 189, 'MHAAAA', 'JKBAAA', 'HHHHxx'),
+(8555, 946, 1, 3, 5, 15, 55, 555, 555, 3555, 8555, 110, 111, 'BRAAAA', 'KKBAAA', 'OOOOxx'),
+(4997, 947, 1, 1, 7, 17, 97, 997, 997, 4997, 4997, 194, 195, 'FKAAAA', 'LKBAAA', 'VVVVxx'),
+(8687, 948, 1, 3, 7, 7, 87, 687, 687, 3687, 8687, 174, 175, 'DWAAAA', 'MKBAAA', 'AAAAxx'),
+(6632, 949, 0, 0, 2, 12, 32, 632, 632, 1632, 6632, 64, 65, 'CVAAAA', 'NKBAAA', 'HHHHxx'),
+(9607, 950, 1, 3, 7, 7, 7, 607, 1607, 4607, 9607, 14, 15, 'NFAAAA', 'OKBAAA', 'OOOOxx'),
+(6201, 951, 1, 1, 1, 1, 1, 201, 201, 1201, 6201, 2, 3, 'NEAAAA', 'PKBAAA', 'VVVVxx'),
+(857, 952, 1, 1, 7, 17, 57, 857, 857, 857, 857, 114, 115, 'ZGAAAA', 'QKBAAA', 'AAAAxx'),
+(5623, 953, 1, 3, 3, 3, 23, 623, 1623, 623, 5623, 46, 47, 'HIAAAA', 'RKBAAA', 'HHHHxx'),
+(5979, 954, 1, 3, 9, 19, 79, 979, 1979, 979, 5979, 158, 159, 'ZVAAAA', 'SKBAAA', 'OOOOxx'),
+(2201, 955, 1, 1, 1, 1, 1, 201, 201, 2201, 2201, 2, 3, 'RGAAAA', 'TKBAAA', 'VVVVxx'),
+(3166, 956, 0, 2, 6, 6, 66, 166, 1166, 3166, 3166, 132, 133, 'URAAAA', 'UKBAAA', 'AAAAxx'),
+(6249, 957, 1, 1, 9, 9, 49, 249, 249, 1249, 6249, 98, 99, 'JGAAAA', 'VKBAAA', 'HHHHxx'),
+(3271, 958, 1, 3, 1, 11, 71, 271, 1271, 3271, 3271, 142, 143, 'VVAAAA', 'WKBAAA', 'OOOOxx'),
+(7777, 959, 1, 1, 7, 17, 77, 777, 1777, 2777, 7777, 154, 155, 'DNAAAA', 'XKBAAA', 'VVVVxx'),
+(6732, 960, 0, 0, 2, 12, 32, 732, 732, 1732, 6732, 64, 65, 'YYAAAA', 'YKBAAA', 'AAAAxx'),
+(6297, 961, 1, 1, 7, 17, 97, 297, 297, 1297, 6297, 194, 195, 'FIAAAA', 'ZKBAAA', 'HHHHxx'),
+(5685, 962, 1, 1, 5, 5, 85, 685, 1685, 685, 5685, 170, 171, 'RKAAAA', 'ALBAAA', 'OOOOxx'),
+(9931, 963, 1, 3, 1, 11, 31, 931, 1931, 4931, 9931, 62, 63, 'ZRAAAA', 'BLBAAA', 'VVVVxx'),
+(7485, 964, 1, 1, 5, 5, 85, 485, 1485, 2485, 7485, 170, 171, 'XBAAAA', 'CLBAAA', 'AAAAxx'),
+(386, 965, 0, 2, 6, 6, 86, 386, 386, 386, 386, 172, 173, 'WOAAAA', 'DLBAAA', 'HHHHxx'),
+(8204, 966, 0, 0, 4, 4, 4, 204, 204, 3204, 8204, 8, 9, 'ODAAAA', 'ELBAAA', 'OOOOxx'),
+(3606, 967, 0, 2, 6, 6, 6, 606, 1606, 3606, 3606, 12, 13, 'SIAAAA', 'FLBAAA', 'VVVVxx'),
+(1692, 968, 0, 0, 2, 12, 92, 692, 1692, 1692, 1692, 184, 185, 'CNAAAA', 'GLBAAA', 'AAAAxx'),
+(3002, 969, 0, 2, 2, 2, 2, 2, 1002, 3002, 3002, 4, 5, 'MLAAAA', 'HLBAAA', 'HHHHxx'),
+(9676, 970, 0, 0, 6, 16, 76, 676, 1676, 4676, 9676, 152, 153, 'EIAAAA', 'ILBAAA', 'OOOOxx'),
+(915, 971, 1, 3, 5, 15, 15, 915, 915, 915, 915, 30, 31, 'FJAAAA', 'JLBAAA', 'VVVVxx'),
+(7706, 972, 0, 2, 6, 6, 6, 706, 1706, 2706, 7706, 12, 13, 'KKAAAA', 'KLBAAA', 'AAAAxx'),
+(6080, 973, 0, 0, 0, 0, 80, 80, 80, 1080, 6080, 160, 161, 'WZAAAA', 'LLBAAA', 'HHHHxx'),
+(1860, 974, 0, 0, 0, 0, 60, 860, 1860, 1860, 1860, 120, 121, 'OTAAAA', 'MLBAAA', 'OOOOxx'),
+(1444, 975, 0, 0, 4, 4, 44, 444, 1444, 1444, 1444, 88, 89, 'ODAAAA', 'NLBAAA', 'VVVVxx'),
+(7208, 976, 0, 0, 8, 8, 8, 208, 1208, 2208, 7208, 16, 17, 'GRAAAA', 'OLBAAA', 'AAAAxx'),
+(8554, 977, 0, 2, 4, 14, 54, 554, 554, 3554, 8554, 108, 109, 'ARAAAA', 'PLBAAA', 'HHHHxx'),
+(2028, 978, 0, 0, 8, 8, 28, 28, 28, 2028, 2028, 56, 57, 'AAAAAA', 'QLBAAA', 'OOOOxx'),
+(9893, 979, 1, 1, 3, 13, 93, 893, 1893, 4893, 9893, 186, 187, 'NQAAAA', 'RLBAAA', 'VVVVxx'),
+(4740, 980, 0, 0, 0, 0, 40, 740, 740, 4740, 4740, 80, 81, 'IAAAAA', 'SLBAAA', 'AAAAxx'),
+(6186, 981, 0, 2, 6, 6, 86, 186, 186, 1186, 6186, 172, 173, 'YDAAAA', 'TLBAAA', 'HHHHxx'),
+(6357, 982, 1, 1, 7, 17, 57, 357, 357, 1357, 6357, 114, 115, 'NKAAAA', 'ULBAAA', 'OOOOxx'),
+(3699, 983, 1, 3, 9, 19, 99, 699, 1699, 3699, 3699, 198, 199, 'HMAAAA', 'VLBAAA', 'VVVVxx'),
+(7620, 984, 0, 0, 0, 0, 20, 620, 1620, 2620, 7620, 40, 41, 'CHAAAA', 'WLBAAA', 'AAAAxx'),
+(921, 985, 1, 1, 1, 1, 21, 921, 921, 921, 921, 42, 43, 'LJAAAA', 'XLBAAA', 'HHHHxx'),
+(5506, 986, 0, 2, 6, 6, 6, 506, 1506, 506, 5506, 12, 13, 'UDAAAA', 'YLBAAA', 'OOOOxx'),
+(8851, 987, 1, 3, 1, 11, 51, 851, 851, 3851, 8851, 102, 103, 'LCAAAA', 'ZLBAAA', 'VVVVxx'),
+(3205, 988, 1, 1, 5, 5, 5, 205, 1205, 3205, 3205, 10, 11, 'HTAAAA', 'AMBAAA', 'AAAAxx'),
+(1956, 989, 0, 0, 6, 16, 56, 956, 1956, 1956, 1956, 112, 113, 'GXAAAA', 'BMBAAA', 'HHHHxx'),
+(6272, 990, 0, 0, 2, 12, 72, 272, 272, 1272, 6272, 144, 145, 'GHAAAA', 'CMBAAA', 'OOOOxx'),
+(1509, 991, 1, 1, 9, 9, 9, 509, 1509, 1509, 1509, 18, 19, 'BGAAAA', 'DMBAAA', 'VVVVxx'),
+(53, 992, 1, 1, 3, 13, 53, 53, 53, 53, 53, 106, 107, 'BCAAAA', 'EMBAAA', 'AAAAxx'),
+(213, 993, 1, 1, 3, 13, 13, 213, 213, 213, 213, 26, 27, 'FIAAAA', 'FMBAAA', 'HHHHxx'),
+(4924, 994, 0, 0, 4, 4, 24, 924, 924, 4924, 4924, 48, 49, 'KHAAAA', 'GMBAAA', 'OOOOxx'),
+(2097, 995, 1, 1, 7, 17, 97, 97, 97, 2097, 2097, 194, 195, 'RCAAAA', 'HMBAAA', 'VVVVxx'),
+(4607, 996, 1, 3, 7, 7, 7, 607, 607, 4607, 4607, 14, 15, 'FVAAAA', 'IMBAAA', 'AAAAxx'),
+(1582, 997, 0, 2, 2, 2, 82, 582, 1582, 1582, 1582, 164, 165, 'WIAAAA', 'JMBAAA', 'HHHHxx'),
+(6643, 998, 1, 3, 3, 3, 43, 643, 643, 1643, 6643, 86, 87, 'NVAAAA', 'KMBAAA', 'OOOOxx'),
+(2238, 999, 0, 2, 8, 18, 38, 238, 238, 2238, 2238, 76, 77, 'CIAAAA', 'LMBAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(2942, 1000, 0, 2, 2, 2, 42, 942, 942, 2942, 2942, 84, 85, 'EJAAAA', 'MMBAAA', 'AAAAxx'),
+(1655, 1001, 1, 3, 5, 15, 55, 655, 1655, 1655, 1655, 110, 111, 'RLAAAA', 'NMBAAA', 'HHHHxx'),
+(3226, 1002, 0, 2, 6, 6, 26, 226, 1226, 3226, 3226, 52, 53, 'CUAAAA', 'OMBAAA', 'OOOOxx'),
+(4263, 1003, 1, 3, 3, 3, 63, 263, 263, 4263, 4263, 126, 127, 'ZHAAAA', 'PMBAAA', 'VVVVxx'),
+(960, 1004, 0, 0, 0, 0, 60, 960, 960, 960, 960, 120, 121, 'YKAAAA', 'QMBAAA', 'AAAAxx'),
+(1213, 1005, 1, 1, 3, 13, 13, 213, 1213, 1213, 1213, 26, 27, 'RUAAAA', 'RMBAAA', 'HHHHxx'),
+(1845, 1006, 1, 1, 5, 5, 45, 845, 1845, 1845, 1845, 90, 91, 'ZSAAAA', 'SMBAAA', 'OOOOxx'),
+(6944, 1007, 0, 0, 4, 4, 44, 944, 944, 1944, 6944, 88, 89, 'CHAAAA', 'TMBAAA', 'VVVVxx'),
+(5284, 1008, 0, 0, 4, 4, 84, 284, 1284, 284, 5284, 168, 169, 'GVAAAA', 'UMBAAA', 'AAAAxx'),
+(188, 1009, 0, 0, 8, 8, 88, 188, 188, 188, 188, 176, 177, 'GHAAAA', 'VMBAAA', 'HHHHxx'),
+(748, 1010, 0, 0, 8, 8, 48, 748, 748, 748, 748, 96, 97, 'UCAAAA', 'WMBAAA', 'OOOOxx'),
+(2226, 1011, 0, 2, 6, 6, 26, 226, 226, 2226, 2226, 52, 53, 'QHAAAA', 'XMBAAA', 'VVVVxx'),
+(7342, 1012, 0, 2, 2, 2, 42, 342, 1342, 2342, 7342, 84, 85, 'KWAAAA', 'YMBAAA', 'AAAAxx'),
+(6120, 1013, 0, 0, 0, 0, 20, 120, 120, 1120, 6120, 40, 41, 'KBAAAA', 'ZMBAAA', 'HHHHxx'),
+(536, 1014, 0, 0, 6, 16, 36, 536, 536, 536, 536, 72, 73, 'QUAAAA', 'ANBAAA', 'OOOOxx'),
+(3239, 1015, 1, 3, 9, 19, 39, 239, 1239, 3239, 3239, 78, 79, 'PUAAAA', 'BNBAAA', 'VVVVxx'),
+(2832, 1016, 0, 0, 2, 12, 32, 832, 832, 2832, 2832, 64, 65, 'YEAAAA', 'CNBAAA', 'AAAAxx'),
+(5296, 1017, 0, 0, 6, 16, 96, 296, 1296, 296, 5296, 192, 193, 'SVAAAA', 'DNBAAA', 'HHHHxx'),
+(5795, 1018, 1, 3, 5, 15, 95, 795, 1795, 795, 5795, 190, 191, 'XOAAAA', 'ENBAAA', 'OOOOxx'),
+(6290, 1019, 0, 2, 0, 10, 90, 290, 290, 1290, 6290, 180, 181, 'YHAAAA', 'FNBAAA', 'VVVVxx'),
+(4916, 1020, 0, 0, 6, 16, 16, 916, 916, 4916, 4916, 32, 33, 'CHAAAA', 'GNBAAA', 'AAAAxx'),
+(8366, 1021, 0, 2, 6, 6, 66, 366, 366, 3366, 8366, 132, 133, 'UJAAAA', 'HNBAAA', 'HHHHxx'),
+(4248, 1022, 0, 0, 8, 8, 48, 248, 248, 4248, 4248, 96, 97, 'KHAAAA', 'INBAAA', 'OOOOxx'),
+(6460, 1023, 0, 0, 0, 0, 60, 460, 460, 1460, 6460, 120, 121, 'MOAAAA', 'JNBAAA', 'VVVVxx'),
+(9296, 1024, 0, 0, 6, 16, 96, 296, 1296, 4296, 9296, 192, 193, 'OTAAAA', 'KNBAAA', 'AAAAxx'),
+(3486, 1025, 0, 2, 6, 6, 86, 486, 1486, 3486, 3486, 172, 173, 'CEAAAA', 'LNBAAA', 'HHHHxx'),
+(5664, 1026, 0, 0, 4, 4, 64, 664, 1664, 664, 5664, 128, 129, 'WJAAAA', 'MNBAAA', 'OOOOxx'),
+(7624, 1027, 0, 0, 4, 4, 24, 624, 1624, 2624, 7624, 48, 49, 'GHAAAA', 'NNBAAA', 'VVVVxx'),
+(2790, 1028, 0, 2, 0, 10, 90, 790, 790, 2790, 2790, 180, 181, 'IDAAAA', 'ONBAAA', 'AAAAxx'),
+(682, 1029, 0, 2, 2, 2, 82, 682, 682, 682, 682, 164, 165, 'GAAAAA', 'PNBAAA', 'HHHHxx'),
+(6412, 1030, 0, 0, 2, 12, 12, 412, 412, 1412, 6412, 24, 25, 'QMAAAA', 'QNBAAA', 'OOOOxx'),
+(6882, 1031, 0, 2, 2, 2, 82, 882, 882, 1882, 6882, 164, 165, 'SEAAAA', 'RNBAAA', 'VVVVxx'),
+(1332, 1032, 0, 0, 2, 12, 32, 332, 1332, 1332, 1332, 64, 65, 'GZAAAA', 'SNBAAA', 'AAAAxx'),
+(4911, 1033, 1, 3, 1, 11, 11, 911, 911, 4911, 4911, 22, 23, 'XGAAAA', 'TNBAAA', 'HHHHxx'),
+(3528, 1034, 0, 0, 8, 8, 28, 528, 1528, 3528, 3528, 56, 57, 'SFAAAA', 'UNBAAA', 'OOOOxx'),
+(271, 1035, 1, 3, 1, 11, 71, 271, 271, 271, 271, 142, 143, 'LKAAAA', 'VNBAAA', 'VVVVxx'),
+(7007, 1036, 1, 3, 7, 7, 7, 7, 1007, 2007, 7007, 14, 15, 'NJAAAA', 'WNBAAA', 'AAAAxx'),
+(2198, 1037, 0, 2, 8, 18, 98, 198, 198, 2198, 2198, 196, 197, 'OGAAAA', 'XNBAAA', 'HHHHxx'),
+(4266, 1038, 0, 2, 6, 6, 66, 266, 266, 4266, 4266, 132, 133, 'CIAAAA', 'YNBAAA', 'OOOOxx'),
+(9867, 1039, 1, 3, 7, 7, 67, 867, 1867, 4867, 9867, 134, 135, 'NPAAAA', 'ZNBAAA', 'VVVVxx'),
+(7602, 1040, 0, 2, 2, 2, 2, 602, 1602, 2602, 7602, 4, 5, 'KGAAAA', 'AOBAAA', 'AAAAxx'),
+(7521, 1041, 1, 1, 1, 1, 21, 521, 1521, 2521, 7521, 42, 43, 'HDAAAA', 'BOBAAA', 'HHHHxx'),
+(7200, 1042, 0, 0, 0, 0, 0, 200, 1200, 2200, 7200, 0, 1, 'YQAAAA', 'COBAAA', 'OOOOxx'),
+(4816, 1043, 0, 0, 6, 16, 16, 816, 816, 4816, 4816, 32, 33, 'GDAAAA', 'DOBAAA', 'VVVVxx'),
+(1669, 1044, 1, 1, 9, 9, 69, 669, 1669, 1669, 1669, 138, 139, 'FMAAAA', 'EOBAAA', 'AAAAxx'),
+(4764, 1045, 0, 0, 4, 4, 64, 764, 764, 4764, 4764, 128, 129, 'GBAAAA', 'FOBAAA', 'HHHHxx'),
+(7393, 1046, 1, 1, 3, 13, 93, 393, 1393, 2393, 7393, 186, 187, 'JYAAAA', 'GOBAAA', 'OOOOxx'),
+(7434, 1047, 0, 2, 4, 14, 34, 434, 1434, 2434, 7434, 68, 69, 'YZAAAA', 'HOBAAA', 'VVVVxx'),
+(9079, 1048, 1, 3, 9, 19, 79, 79, 1079, 4079, 9079, 158, 159, 'FLAAAA', 'IOBAAA', 'AAAAxx'),
+(9668, 1049, 0, 0, 8, 8, 68, 668, 1668, 4668, 9668, 136, 137, 'WHAAAA', 'JOBAAA', 'HHHHxx'),
+(7184, 1050, 0, 0, 4, 4, 84, 184, 1184, 2184, 7184, 168, 169, 'IQAAAA', 'KOBAAA', 'OOOOxx'),
+(7347, 1051, 1, 3, 7, 7, 47, 347, 1347, 2347, 7347, 94, 95, 'PWAAAA', 'LOBAAA', 'VVVVxx'),
+(951, 1052, 1, 3, 1, 11, 51, 951, 951, 951, 951, 102, 103, 'PKAAAA', 'MOBAAA', 'AAAAxx'),
+(4513, 1053, 1, 1, 3, 13, 13, 513, 513, 4513, 4513, 26, 27, 'PRAAAA', 'NOBAAA', 'HHHHxx'),
+(2692, 1054, 0, 0, 2, 12, 92, 692, 692, 2692, 2692, 184, 185, 'OZAAAA', 'OOBAAA', 'OOOOxx'),
+(9930, 1055, 0, 2, 0, 10, 30, 930, 1930, 4930, 9930, 60, 61, 'YRAAAA', 'POBAAA', 'VVVVxx'),
+(4516, 1056, 0, 0, 6, 16, 16, 516, 516, 4516, 4516, 32, 33, 'SRAAAA', 'QOBAAA', 'AAAAxx'),
+(1592, 1057, 0, 0, 2, 12, 92, 592, 1592, 1592, 1592, 184, 185, 'GJAAAA', 'ROBAAA', 'HHHHxx'),
+(6312, 1058, 0, 0, 2, 12, 12, 312, 312, 1312, 6312, 24, 25, 'UIAAAA', 'SOBAAA', 'OOOOxx'),
+(185, 1059, 1, 1, 5, 5, 85, 185, 185, 185, 185, 170, 171, 'DHAAAA', 'TOBAAA', 'VVVVxx'),
+(1848, 1060, 0, 0, 8, 8, 48, 848, 1848, 1848, 1848, 96, 97, 'CTAAAA', 'UOBAAA', 'AAAAxx'),
+(5844, 1061, 0, 0, 4, 4, 44, 844, 1844, 844, 5844, 88, 89, 'UQAAAA', 'VOBAAA', 'HHHHxx'),
+(1666, 1062, 0, 2, 6, 6, 66, 666, 1666, 1666, 1666, 132, 133, 'CMAAAA', 'WOBAAA', 'OOOOxx'),
+(5864, 1063, 0, 0, 4, 4, 64, 864, 1864, 864, 5864, 128, 129, 'ORAAAA', 'XOBAAA', 'VVVVxx'),
+(1004, 1064, 0, 0, 4, 4, 4, 4, 1004, 1004, 1004, 8, 9, 'QMAAAA', 'YOBAAA', 'AAAAxx'),
+(1758, 1065, 0, 2, 8, 18, 58, 758, 1758, 1758, 1758, 116, 117, 'QPAAAA', 'ZOBAAA', 'HHHHxx'),
+(8823, 1066, 1, 3, 3, 3, 23, 823, 823, 3823, 8823, 46, 47, 'JBAAAA', 'APBAAA', 'OOOOxx'),
+(129, 1067, 1, 1, 9, 9, 29, 129, 129, 129, 129, 58, 59, 'ZEAAAA', 'BPBAAA', 'VVVVxx'),
+(5703, 1068, 1, 3, 3, 3, 3, 703, 1703, 703, 5703, 6, 7, 'JLAAAA', 'CPBAAA', 'AAAAxx'),
+(3331, 1069, 1, 3, 1, 11, 31, 331, 1331, 3331, 3331, 62, 63, 'DYAAAA', 'DPBAAA', 'HHHHxx'),
+(5791, 1070, 1, 3, 1, 11, 91, 791, 1791, 791, 5791, 182, 183, 'TOAAAA', 'EPBAAA', 'OOOOxx'),
+(4421, 1071, 1, 1, 1, 1, 21, 421, 421, 4421, 4421, 42, 43, 'BOAAAA', 'FPBAAA', 'VVVVxx'),
+(9740, 1072, 0, 0, 0, 0, 40, 740, 1740, 4740, 9740, 80, 81, 'QKAAAA', 'GPBAAA', 'AAAAxx'),
+(798, 1073, 0, 2, 8, 18, 98, 798, 798, 798, 798, 196, 197, 'SEAAAA', 'HPBAAA', 'HHHHxx'),
+(571, 1074, 1, 3, 1, 11, 71, 571, 571, 571, 571, 142, 143, 'ZVAAAA', 'IPBAAA', 'OOOOxx'),
+(7084, 1075, 0, 0, 4, 4, 84, 84, 1084, 2084, 7084, 168, 169, 'MMAAAA', 'JPBAAA', 'VVVVxx'),
+(650, 1076, 0, 2, 0, 10, 50, 650, 650, 650, 650, 100, 101, 'AZAAAA', 'KPBAAA', 'AAAAxx'),
+(1467, 1077, 1, 3, 7, 7, 67, 467, 1467, 1467, 1467, 134, 135, 'LEAAAA', 'LPBAAA', 'HHHHxx'),
+(5446, 1078, 0, 2, 6, 6, 46, 446, 1446, 446, 5446, 92, 93, 'MBAAAA', 'MPBAAA', 'OOOOxx'),
+(830, 1079, 0, 2, 0, 10, 30, 830, 830, 830, 830, 60, 61, 'YFAAAA', 'NPBAAA', 'VVVVxx'),
+(5516, 1080, 0, 0, 6, 16, 16, 516, 1516, 516, 5516, 32, 33, 'EEAAAA', 'OPBAAA', 'AAAAxx'),
+(8520, 1081, 0, 0, 0, 0, 20, 520, 520, 3520, 8520, 40, 41, 'SPAAAA', 'PPBAAA', 'HHHHxx'),
+(1152, 1082, 0, 0, 2, 12, 52, 152, 1152, 1152, 1152, 104, 105, 'ISAAAA', 'QPBAAA', 'OOOOxx'),
+(862, 1083, 0, 2, 2, 2, 62, 862, 862, 862, 862, 124, 125, 'EHAAAA', 'RPBAAA', 'VVVVxx'),
+(454, 1084, 0, 2, 4, 14, 54, 454, 454, 454, 454, 108, 109, 'MRAAAA', 'SPBAAA', 'AAAAxx'),
+(9956, 1085, 0, 0, 6, 16, 56, 956, 1956, 4956, 9956, 112, 113, 'YSAAAA', 'TPBAAA', 'HHHHxx'),
+(1654, 1086, 0, 2, 4, 14, 54, 654, 1654, 1654, 1654, 108, 109, 'QLAAAA', 'UPBAAA', 'OOOOxx'),
+(257, 1087, 1, 1, 7, 17, 57, 257, 257, 257, 257, 114, 115, 'XJAAAA', 'VPBAAA', 'VVVVxx'),
+(5469, 1088, 1, 1, 9, 9, 69, 469, 1469, 469, 5469, 138, 139, 'JCAAAA', 'WPBAAA', 'AAAAxx'),
+(9075, 1089, 1, 3, 5, 15, 75, 75, 1075, 4075, 9075, 150, 151, 'BLAAAA', 'XPBAAA', 'HHHHxx'),
+(7799, 1090, 1, 3, 9, 19, 99, 799, 1799, 2799, 7799, 198, 199, 'ZNAAAA', 'YPBAAA', 'OOOOxx'),
+(2001, 1091, 1, 1, 1, 1, 1, 1, 1, 2001, 2001, 2, 3, 'ZYAAAA', 'ZPBAAA', 'VVVVxx'),
+(9786, 1092, 0, 2, 6, 6, 86, 786, 1786, 4786, 9786, 172, 173, 'KMAAAA', 'AQBAAA', 'AAAAxx'),
+(7281, 1093, 1, 1, 1, 1, 81, 281, 1281, 2281, 7281, 162, 163, 'BUAAAA', 'BQBAAA', 'HHHHxx'),
+(5137, 1094, 1, 1, 7, 17, 37, 137, 1137, 137, 5137, 74, 75, 'PPAAAA', 'CQBAAA', 'OOOOxx'),
+(4053, 1095, 1, 1, 3, 13, 53, 53, 53, 4053, 4053, 106, 107, 'XZAAAA', 'DQBAAA', 'VVVVxx'),
+(7911, 1096, 1, 3, 1, 11, 11, 911, 1911, 2911, 7911, 22, 23, 'HSAAAA', 'EQBAAA', 'AAAAxx'),
+(4298, 1097, 0, 2, 8, 18, 98, 298, 298, 4298, 4298, 196, 197, 'IJAAAA', 'FQBAAA', 'HHHHxx'),
+(4805, 1098, 1, 1, 5, 5, 5, 805, 805, 4805, 4805, 10, 11, 'VCAAAA', 'GQBAAA', 'OOOOxx'),
+(9038, 1099, 0, 2, 8, 18, 38, 38, 1038, 4038, 9038, 76, 77, 'QJAAAA', 'HQBAAA', 'VVVVxx'),
+(8023, 1100, 1, 3, 3, 3, 23, 23, 23, 3023, 8023, 46, 47, 'PWAAAA', 'IQBAAA', 'AAAAxx'),
+(6595, 1101, 1, 3, 5, 15, 95, 595, 595, 1595, 6595, 190, 191, 'RTAAAA', 'JQBAAA', 'HHHHxx'),
+(9831, 1102, 1, 3, 1, 11, 31, 831, 1831, 4831, 9831, 62, 63, 'DOAAAA', 'KQBAAA', 'OOOOxx'),
+(788, 1103, 0, 0, 8, 8, 88, 788, 788, 788, 788, 176, 177, 'IEAAAA', 'LQBAAA', 'VVVVxx'),
+(902, 1104, 0, 2, 2, 2, 2, 902, 902, 902, 902, 4, 5, 'SIAAAA', 'MQBAAA', 'AAAAxx'),
+(9137, 1105, 1, 1, 7, 17, 37, 137, 1137, 4137, 9137, 74, 75, 'LNAAAA', 'NQBAAA', 'HHHHxx'),
+(1744, 1106, 0, 0, 4, 4, 44, 744, 1744, 1744, 1744, 88, 89, 'CPAAAA', 'OQBAAA', 'OOOOxx'),
+(7285, 1107, 1, 1, 5, 5, 85, 285, 1285, 2285, 7285, 170, 171, 'FUAAAA', 'PQBAAA', 'VVVVxx'),
+(7006, 1108, 0, 2, 6, 6, 6, 6, 1006, 2006, 7006, 12, 13, 'MJAAAA', 'QQBAAA', 'AAAAxx'),
+(9236, 1109, 0, 0, 6, 16, 36, 236, 1236, 4236, 9236, 72, 73, 'GRAAAA', 'RQBAAA', 'HHHHxx'),
+(5472, 1110, 0, 0, 2, 12, 72, 472, 1472, 472, 5472, 144, 145, 'MCAAAA', 'SQBAAA', 'OOOOxx'),
+(7975, 1111, 1, 3, 5, 15, 75, 975, 1975, 2975, 7975, 150, 151, 'TUAAAA', 'TQBAAA', 'VVVVxx'),
+(4181, 1112, 1, 1, 1, 1, 81, 181, 181, 4181, 4181, 162, 163, 'VEAAAA', 'UQBAAA', 'AAAAxx'),
+(7677, 1113, 1, 1, 7, 17, 77, 677, 1677, 2677, 7677, 154, 155, 'HJAAAA', 'VQBAAA', 'HHHHxx'),
+(35, 1114, 1, 3, 5, 15, 35, 35, 35, 35, 35, 70, 71, 'JBAAAA', 'WQBAAA', 'OOOOxx'),
+(6813, 1115, 1, 1, 3, 13, 13, 813, 813, 1813, 6813, 26, 27, 'BCAAAA', 'XQBAAA', 'VVVVxx'),
+(6618, 1116, 0, 2, 8, 18, 18, 618, 618, 1618, 6618, 36, 37, 'OUAAAA', 'YQBAAA', 'AAAAxx'),
+(8069, 1117, 1, 1, 9, 9, 69, 69, 69, 3069, 8069, 138, 139, 'JYAAAA', 'ZQBAAA', 'HHHHxx'),
+(3071, 1118, 1, 3, 1, 11, 71, 71, 1071, 3071, 3071, 142, 143, 'DOAAAA', 'ARBAAA', 'OOOOxx'),
+(4390, 1119, 0, 2, 0, 10, 90, 390, 390, 4390, 4390, 180, 181, 'WMAAAA', 'BRBAAA', 'VVVVxx'),
+(7764, 1120, 0, 0, 4, 4, 64, 764, 1764, 2764, 7764, 128, 129, 'QMAAAA', 'CRBAAA', 'AAAAxx'),
+(8163, 1121, 1, 3, 3, 3, 63, 163, 163, 3163, 8163, 126, 127, 'ZBAAAA', 'DRBAAA', 'HHHHxx'),
+(1961, 1122, 1, 1, 1, 1, 61, 961, 1961, 1961, 1961, 122, 123, 'LXAAAA', 'ERBAAA', 'OOOOxx'),
+(1103, 1123, 1, 3, 3, 3, 3, 103, 1103, 1103, 1103, 6, 7, 'LQAAAA', 'FRBAAA', 'VVVVxx'),
+(5486, 1124, 0, 2, 6, 6, 86, 486, 1486, 486, 5486, 172, 173, 'ADAAAA', 'GRBAAA', 'AAAAxx'),
+(9513, 1125, 1, 1, 3, 13, 13, 513, 1513, 4513, 9513, 26, 27, 'XBAAAA', 'HRBAAA', 'HHHHxx'),
+(7311, 1126, 1, 3, 1, 11, 11, 311, 1311, 2311, 7311, 22, 23, 'FVAAAA', 'IRBAAA', 'OOOOxx'),
+(4144, 1127, 0, 0, 4, 4, 44, 144, 144, 4144, 4144, 88, 89, 'KDAAAA', 'JRBAAA', 'VVVVxx'),
+(7901, 1128, 1, 1, 1, 1, 1, 901, 1901, 2901, 7901, 2, 3, 'XRAAAA', 'KRBAAA', 'AAAAxx'),
+(4629, 1129, 1, 1, 9, 9, 29, 629, 629, 4629, 4629, 58, 59, 'BWAAAA', 'LRBAAA', 'HHHHxx'),
+(6858, 1130, 0, 2, 8, 18, 58, 858, 858, 1858, 6858, 116, 117, 'UDAAAA', 'MRBAAA', 'OOOOxx'),
+(125, 1131, 1, 1, 5, 5, 25, 125, 125, 125, 125, 50, 51, 'VEAAAA', 'NRBAAA', 'VVVVxx'),
+(3834, 1132, 0, 2, 4, 14, 34, 834, 1834, 3834, 3834, 68, 69, 'MRAAAA', 'ORBAAA', 'AAAAxx'),
+(8155, 1133, 1, 3, 5, 15, 55, 155, 155, 3155, 8155, 110, 111, 'RBAAAA', 'PRBAAA', 'HHHHxx'),
+(8230, 1134, 0, 2, 0, 10, 30, 230, 230, 3230, 8230, 60, 61, 'OEAAAA', 'QRBAAA', 'OOOOxx'),
+(744, 1135, 0, 0, 4, 4, 44, 744, 744, 744, 744, 88, 89, 'QCAAAA', 'RRBAAA', 'VVVVxx'),
+(357, 1136, 1, 1, 7, 17, 57, 357, 357, 357, 357, 114, 115, 'TNAAAA', 'SRBAAA', 'AAAAxx'),
+(2159, 1137, 1, 3, 9, 19, 59, 159, 159, 2159, 2159, 118, 119, 'BFAAAA', 'TRBAAA', 'HHHHxx'),
+(8559, 1138, 1, 3, 9, 19, 59, 559, 559, 3559, 8559, 118, 119, 'FRAAAA', 'URBAAA', 'OOOOxx'),
+(6866, 1139, 0, 2, 6, 6, 66, 866, 866, 1866, 6866, 132, 133, 'CEAAAA', 'VRBAAA', 'VVVVxx'),
+(3863, 1140, 1, 3, 3, 3, 63, 863, 1863, 3863, 3863, 126, 127, 'PSAAAA', 'WRBAAA', 'AAAAxx'),
+(4193, 1141, 1, 1, 3, 13, 93, 193, 193, 4193, 4193, 186, 187, 'HFAAAA', 'XRBAAA', 'HHHHxx'),
+(3277, 1142, 1, 1, 7, 17, 77, 277, 1277, 3277, 3277, 154, 155, 'BWAAAA', 'YRBAAA', 'OOOOxx'),
+(5577, 1143, 1, 1, 7, 17, 77, 577, 1577, 577, 5577, 154, 155, 'NGAAAA', 'ZRBAAA', 'VVVVxx'),
+(9503, 1144, 1, 3, 3, 3, 3, 503, 1503, 4503, 9503, 6, 7, 'NBAAAA', 'ASBAAA', 'AAAAxx'),
+(7642, 1145, 0, 2, 2, 2, 42, 642, 1642, 2642, 7642, 84, 85, 'YHAAAA', 'BSBAAA', 'HHHHxx'),
+(6197, 1146, 1, 1, 7, 17, 97, 197, 197, 1197, 6197, 194, 195, 'JEAAAA', 'CSBAAA', 'OOOOxx'),
+(8995, 1147, 1, 3, 5, 15, 95, 995, 995, 3995, 8995, 190, 191, 'ZHAAAA', 'DSBAAA', 'VVVVxx'),
+(440, 1148, 0, 0, 0, 0, 40, 440, 440, 440, 440, 80, 81, 'YQAAAA', 'ESBAAA', 'AAAAxx'),
+(8418, 1149, 0, 2, 8, 18, 18, 418, 418, 3418, 8418, 36, 37, 'ULAAAA', 'FSBAAA', 'HHHHxx'),
+(8531, 1150, 1, 3, 1, 11, 31, 531, 531, 3531, 8531, 62, 63, 'DQAAAA', 'GSBAAA', 'OOOOxx'),
+(3790, 1151, 0, 2, 0, 10, 90, 790, 1790, 3790, 3790, 180, 181, 'UPAAAA', 'HSBAAA', 'VVVVxx'),
+(7610, 1152, 0, 2, 0, 10, 10, 610, 1610, 2610, 7610, 20, 21, 'SGAAAA', 'ISBAAA', 'AAAAxx'),
+(1252, 1153, 0, 0, 2, 12, 52, 252, 1252, 1252, 1252, 104, 105, 'EWAAAA', 'JSBAAA', 'HHHHxx'),
+(7559, 1154, 1, 3, 9, 19, 59, 559, 1559, 2559, 7559, 118, 119, 'TEAAAA', 'KSBAAA', 'OOOOxx'),
+(9945, 1155, 1, 1, 5, 5, 45, 945, 1945, 4945, 9945, 90, 91, 'NSAAAA', 'LSBAAA', 'VVVVxx'),
+(9023, 1156, 1, 3, 3, 3, 23, 23, 1023, 4023, 9023, 46, 47, 'BJAAAA', 'MSBAAA', 'AAAAxx'),
+(3516, 1157, 0, 0, 6, 16, 16, 516, 1516, 3516, 3516, 32, 33, 'GFAAAA', 'NSBAAA', 'HHHHxx'),
+(4671, 1158, 1, 3, 1, 11, 71, 671, 671, 4671, 4671, 142, 143, 'RXAAAA', 'OSBAAA', 'OOOOxx'),
+(1465, 1159, 1, 1, 5, 5, 65, 465, 1465, 1465, 1465, 130, 131, 'JEAAAA', 'PSBAAA', 'VVVVxx'),
+(9515, 1160, 1, 3, 5, 15, 15, 515, 1515, 4515, 9515, 30, 31, 'ZBAAAA', 'QSBAAA', 'AAAAxx'),
+(3242, 1161, 0, 2, 2, 2, 42, 242, 1242, 3242, 3242, 84, 85, 'SUAAAA', 'RSBAAA', 'HHHHxx'),
+(1732, 1162, 0, 0, 2, 12, 32, 732, 1732, 1732, 1732, 64, 65, 'QOAAAA', 'SSBAAA', 'OOOOxx'),
+(1678, 1163, 0, 2, 8, 18, 78, 678, 1678, 1678, 1678, 156, 157, 'OMAAAA', 'TSBAAA', 'VVVVxx'),
+(1464, 1164, 0, 0, 4, 4, 64, 464, 1464, 1464, 1464, 128, 129, 'IEAAAA', 'USBAAA', 'AAAAxx'),
+(6546, 1165, 0, 2, 6, 6, 46, 546, 546, 1546, 6546, 92, 93, 'URAAAA', 'VSBAAA', 'HHHHxx'),
+(4448, 1166, 0, 0, 8, 8, 48, 448, 448, 4448, 4448, 96, 97, 'CPAAAA', 'WSBAAA', 'OOOOxx'),
+(9847, 1167, 1, 3, 7, 7, 47, 847, 1847, 4847, 9847, 94, 95, 'TOAAAA', 'XSBAAA', 'VVVVxx'),
+(8264, 1168, 0, 0, 4, 4, 64, 264, 264, 3264, 8264, 128, 129, 'WFAAAA', 'YSBAAA', 'AAAAxx'),
+(1620, 1169, 0, 0, 0, 0, 20, 620, 1620, 1620, 1620, 40, 41, 'IKAAAA', 'ZSBAAA', 'HHHHxx'),
+(9388, 1170, 0, 0, 8, 8, 88, 388, 1388, 4388, 9388, 176, 177, 'CXAAAA', 'ATBAAA', 'OOOOxx'),
+(6445, 1171, 1, 1, 5, 5, 45, 445, 445, 1445, 6445, 90, 91, 'XNAAAA', 'BTBAAA', 'VVVVxx'),
+(4789, 1172, 1, 1, 9, 9, 89, 789, 789, 4789, 4789, 178, 179, 'FCAAAA', 'CTBAAA', 'AAAAxx'),
+(1562, 1173, 0, 2, 2, 2, 62, 562, 1562, 1562, 1562, 124, 125, 'CIAAAA', 'DTBAAA', 'HHHHxx'),
+(7305, 1174, 1, 1, 5, 5, 5, 305, 1305, 2305, 7305, 10, 11, 'ZUAAAA', 'ETBAAA', 'OOOOxx'),
+(6344, 1175, 0, 0, 4, 4, 44, 344, 344, 1344, 6344, 88, 89, 'AKAAAA', 'FTBAAA', 'VVVVxx'),
+(5130, 1176, 0, 2, 0, 10, 30, 130, 1130, 130, 5130, 60, 61, 'IPAAAA', 'GTBAAA', 'AAAAxx'),
+(3284, 1177, 0, 0, 4, 4, 84, 284, 1284, 3284, 3284, 168, 169, 'IWAAAA', 'HTBAAA', 'HHHHxx'),
+(6346, 1178, 0, 2, 6, 6, 46, 346, 346, 1346, 6346, 92, 93, 'CKAAAA', 'ITBAAA', 'OOOOxx'),
+(1061, 1179, 1, 1, 1, 1, 61, 61, 1061, 1061, 1061, 122, 123, 'VOAAAA', 'JTBAAA', 'VVVVxx'),
+(872, 1180, 0, 0, 2, 12, 72, 872, 872, 872, 872, 144, 145, 'OHAAAA', 'KTBAAA', 'AAAAxx'),
+(123, 1181, 1, 3, 3, 3, 23, 123, 123, 123, 123, 46, 47, 'TEAAAA', 'LTBAAA', 'HHHHxx'),
+(7903, 1182, 1, 3, 3, 3, 3, 903, 1903, 2903, 7903, 6, 7, 'ZRAAAA', 'MTBAAA', 'OOOOxx'),
+(560, 1183, 0, 0, 0, 0, 60, 560, 560, 560, 560, 120, 121, 'OVAAAA', 'NTBAAA', 'VVVVxx'),
+(4446, 1184, 0, 2, 6, 6, 46, 446, 446, 4446, 4446, 92, 93, 'APAAAA', 'OTBAAA', 'AAAAxx'),
+(3909, 1185, 1, 1, 9, 9, 9, 909, 1909, 3909, 3909, 18, 19, 'JUAAAA', 'PTBAAA', 'HHHHxx'),
+(669, 1186, 1, 1, 9, 9, 69, 669, 669, 669, 669, 138, 139, 'TZAAAA', 'QTBAAA', 'OOOOxx'),
+(7843, 1187, 1, 3, 3, 3, 43, 843, 1843, 2843, 7843, 86, 87, 'RPAAAA', 'RTBAAA', 'VVVVxx'),
+(2546, 1188, 0, 2, 6, 6, 46, 546, 546, 2546, 2546, 92, 93, 'YTAAAA', 'STBAAA', 'AAAAxx'),
+(6757, 1189, 1, 1, 7, 17, 57, 757, 757, 1757, 6757, 114, 115, 'XZAAAA', 'TTBAAA', 'HHHHxx'),
+(466, 1190, 0, 2, 6, 6, 66, 466, 466, 466, 466, 132, 133, 'YRAAAA', 'UTBAAA', 'OOOOxx'),
+(5556, 1191, 0, 0, 6, 16, 56, 556, 1556, 556, 5556, 112, 113, 'SFAAAA', 'VTBAAA', 'VVVVxx'),
+(7196, 1192, 0, 0, 6, 16, 96, 196, 1196, 2196, 7196, 192, 193, 'UQAAAA', 'WTBAAA', 'AAAAxx'),
+(2947, 1193, 1, 3, 7, 7, 47, 947, 947, 2947, 2947, 94, 95, 'JJAAAA', 'XTBAAA', 'HHHHxx'),
+(6493, 1194, 1, 1, 3, 13, 93, 493, 493, 1493, 6493, 186, 187, 'TPAAAA', 'YTBAAA', 'OOOOxx'),
+(7203, 1195, 1, 3, 3, 3, 3, 203, 1203, 2203, 7203, 6, 7, 'BRAAAA', 'ZTBAAA', 'VVVVxx'),
+(3716, 1196, 0, 0, 6, 16, 16, 716, 1716, 3716, 3716, 32, 33, 'YMAAAA', 'AUBAAA', 'AAAAxx'),
+(8058, 1197, 0, 2, 8, 18, 58, 58, 58, 3058, 8058, 116, 117, 'YXAAAA', 'BUBAAA', 'HHHHxx'),
+(433, 1198, 1, 1, 3, 13, 33, 433, 433, 433, 433, 66, 67, 'RQAAAA', 'CUBAAA', 'OOOOxx'),
+(7649, 1199, 1, 1, 9, 9, 49, 649, 1649, 2649, 7649, 98, 99, 'FIAAAA', 'DUBAAA', 'VVVVxx'),
+(6966, 1200, 0, 2, 6, 6, 66, 966, 966, 1966, 6966, 132, 133, 'YHAAAA', 'EUBAAA', 'AAAAxx'),
+(553, 1201, 1, 1, 3, 13, 53, 553, 553, 553, 553, 106, 107, 'HVAAAA', 'FUBAAA', 'HHHHxx'),
+(3677, 1202, 1, 1, 7, 17, 77, 677, 1677, 3677, 3677, 154, 155, 'LLAAAA', 'GUBAAA', 'OOOOxx'),
+(2344, 1203, 0, 0, 4, 4, 44, 344, 344, 2344, 2344, 88, 89, 'EMAAAA', 'HUBAAA', 'VVVVxx'),
+(7439, 1204, 1, 3, 9, 19, 39, 439, 1439, 2439, 7439, 78, 79, 'DAAAAA', 'IUBAAA', 'AAAAxx'),
+(3910, 1205, 0, 2, 0, 10, 10, 910, 1910, 3910, 3910, 20, 21, 'KUAAAA', 'JUBAAA', 'HHHHxx'),
+(3638, 1206, 0, 2, 8, 18, 38, 638, 1638, 3638, 3638, 76, 77, 'YJAAAA', 'KUBAAA', 'OOOOxx'),
+(6637, 1207, 1, 1, 7, 17, 37, 637, 637, 1637, 6637, 74, 75, 'HVAAAA', 'LUBAAA', 'VVVVxx'),
+(4438, 1208, 0, 2, 8, 18, 38, 438, 438, 4438, 4438, 76, 77, 'SOAAAA', 'MUBAAA', 'AAAAxx'),
+(171, 1209, 1, 3, 1, 11, 71, 171, 171, 171, 171, 142, 143, 'PGAAAA', 'NUBAAA', 'HHHHxx'),
+(310, 1210, 0, 2, 0, 10, 10, 310, 310, 310, 310, 20, 21, 'YLAAAA', 'OUBAAA', 'OOOOxx'),
+(2714, 1211, 0, 2, 4, 14, 14, 714, 714, 2714, 2714, 28, 29, 'KAAAAA', 'PUBAAA', 'VVVVxx'),
+(5199, 1212, 1, 3, 9, 19, 99, 199, 1199, 199, 5199, 198, 199, 'ZRAAAA', 'QUBAAA', 'AAAAxx'),
+(8005, 1213, 1, 1, 5, 5, 5, 5, 5, 3005, 8005, 10, 11, 'XVAAAA', 'RUBAAA', 'HHHHxx'),
+(3188, 1214, 0, 0, 8, 8, 88, 188, 1188, 3188, 3188, 176, 177, 'QSAAAA', 'SUBAAA', 'OOOOxx'),
+(1518, 1215, 0, 2, 8, 18, 18, 518, 1518, 1518, 1518, 36, 37, 'KGAAAA', 'TUBAAA', 'VVVVxx'),
+(6760, 1216, 0, 0, 0, 0, 60, 760, 760, 1760, 6760, 120, 121, 'AAAAAA', 'UUBAAA', 'AAAAxx'),
+(9373, 1217, 1, 1, 3, 13, 73, 373, 1373, 4373, 9373, 146, 147, 'NWAAAA', 'VUBAAA', 'HHHHxx'),
+(1938, 1218, 0, 2, 8, 18, 38, 938, 1938, 1938, 1938, 76, 77, 'OWAAAA', 'WUBAAA', 'OOOOxx'),
+(2865, 1219, 1, 1, 5, 5, 65, 865, 865, 2865, 2865, 130, 131, 'FGAAAA', 'XUBAAA', 'VVVVxx'),
+(3203, 1220, 1, 3, 3, 3, 3, 203, 1203, 3203, 3203, 6, 7, 'FTAAAA', 'YUBAAA', 'AAAAxx'),
+(6025, 1221, 1, 1, 5, 5, 25, 25, 25, 1025, 6025, 50, 51, 'TXAAAA', 'ZUBAAA', 'HHHHxx'),
+(8684, 1222, 0, 0, 4, 4, 84, 684, 684, 3684, 8684, 168, 169, 'AWAAAA', 'AVBAAA', 'OOOOxx'),
+(7732, 1223, 0, 0, 2, 12, 32, 732, 1732, 2732, 7732, 64, 65, 'KLAAAA', 'BVBAAA', 'VVVVxx'),
+(3218, 1224, 0, 2, 8, 18, 18, 218, 1218, 3218, 3218, 36, 37, 'UTAAAA', 'CVBAAA', 'AAAAxx'),
+(525, 1225, 1, 1, 5, 5, 25, 525, 525, 525, 525, 50, 51, 'FUAAAA', 'DVBAAA', 'HHHHxx'),
+(601, 1226, 1, 1, 1, 1, 1, 601, 601, 601, 601, 2, 3, 'DXAAAA', 'EVBAAA', 'OOOOxx'),
+(6091, 1227, 1, 3, 1, 11, 91, 91, 91, 1091, 6091, 182, 183, 'HAAAAA', 'FVBAAA', 'VVVVxx'),
+(4498, 1228, 0, 2, 8, 18, 98, 498, 498, 4498, 4498, 196, 197, 'ARAAAA', 'GVBAAA', 'AAAAxx'),
+(8192, 1229, 0, 0, 2, 12, 92, 192, 192, 3192, 8192, 184, 185, 'CDAAAA', 'HVBAAA', 'HHHHxx'),
+(8006, 1230, 0, 2, 6, 6, 6, 6, 6, 3006, 8006, 12, 13, 'YVAAAA', 'IVBAAA', 'OOOOxx'),
+(6157, 1231, 1, 1, 7, 17, 57, 157, 157, 1157, 6157, 114, 115, 'VCAAAA', 'JVBAAA', 'VVVVxx'),
+(312, 1232, 0, 0, 2, 12, 12, 312, 312, 312, 312, 24, 25, 'AMAAAA', 'KVBAAA', 'AAAAxx'),
+(8652, 1233, 0, 0, 2, 12, 52, 652, 652, 3652, 8652, 104, 105, 'UUAAAA', 'LVBAAA', 'HHHHxx'),
+(2787, 1234, 1, 3, 7, 7, 87, 787, 787, 2787, 2787, 174, 175, 'FDAAAA', 'MVBAAA', 'OOOOxx'),
+(1782, 1235, 0, 2, 2, 2, 82, 782, 1782, 1782, 1782, 164, 165, 'OQAAAA', 'NVBAAA', 'VVVVxx'),
+(23, 1236, 1, 3, 3, 3, 23, 23, 23, 23, 23, 46, 47, 'XAAAAA', 'OVBAAA', 'AAAAxx'),
+(1206, 1237, 0, 2, 6, 6, 6, 206, 1206, 1206, 1206, 12, 13, 'KUAAAA', 'PVBAAA', 'HHHHxx'),
+(1076, 1238, 0, 0, 6, 16, 76, 76, 1076, 1076, 1076, 152, 153, 'KPAAAA', 'QVBAAA', 'OOOOxx'),
+(5379, 1239, 1, 3, 9, 19, 79, 379, 1379, 379, 5379, 158, 159, 'XYAAAA', 'RVBAAA', 'VVVVxx'),
+(2047, 1240, 1, 3, 7, 7, 47, 47, 47, 2047, 2047, 94, 95, 'TAAAAA', 'SVBAAA', 'AAAAxx'),
+(6262, 1241, 0, 2, 2, 2, 62, 262, 262, 1262, 6262, 124, 125, 'WGAAAA', 'TVBAAA', 'HHHHxx'),
+(1840, 1242, 0, 0, 0, 0, 40, 840, 1840, 1840, 1840, 80, 81, 'USAAAA', 'UVBAAA', 'OOOOxx'),
+(2106, 1243, 0, 2, 6, 6, 6, 106, 106, 2106, 2106, 12, 13, 'ADAAAA', 'VVBAAA', 'VVVVxx'),
+(1307, 1244, 1, 3, 7, 7, 7, 307, 1307, 1307, 1307, 14, 15, 'HYAAAA', 'WVBAAA', 'AAAAxx'),
+(735, 1245, 1, 3, 5, 15, 35, 735, 735, 735, 735, 70, 71, 'HCAAAA', 'XVBAAA', 'HHHHxx'),
+(3657, 1246, 1, 1, 7, 17, 57, 657, 1657, 3657, 3657, 114, 115, 'RKAAAA', 'YVBAAA', 'OOOOxx'),
+(3006, 1247, 0, 2, 6, 6, 6, 6, 1006, 3006, 3006, 12, 13, 'QLAAAA', 'ZVBAAA', 'VVVVxx'),
+(1538, 1248, 0, 2, 8, 18, 38, 538, 1538, 1538, 1538, 76, 77, 'EHAAAA', 'AWBAAA', 'AAAAxx'),
+(6098, 1249, 0, 2, 8, 18, 98, 98, 98, 1098, 6098, 196, 197, 'OAAAAA', 'BWBAAA', 'HHHHxx'),
+(5267, 1250, 1, 3, 7, 7, 67, 267, 1267, 267, 5267, 134, 135, 'PUAAAA', 'CWBAAA', 'OOOOxx'),
+(9757, 1251, 1, 1, 7, 17, 57, 757, 1757, 4757, 9757, 114, 115, 'HLAAAA', 'DWBAAA', 'VVVVxx'),
+(1236, 1252, 0, 0, 6, 16, 36, 236, 1236, 1236, 1236, 72, 73, 'OVAAAA', 'EWBAAA', 'AAAAxx'),
+(83, 1253, 1, 3, 3, 3, 83, 83, 83, 83, 83, 166, 167, 'FDAAAA', 'FWBAAA', 'HHHHxx'),
+(9227, 1254, 1, 3, 7, 7, 27, 227, 1227, 4227, 9227, 54, 55, 'XQAAAA', 'GWBAAA', 'OOOOxx'),
+(8772, 1255, 0, 0, 2, 12, 72, 772, 772, 3772, 8772, 144, 145, 'KZAAAA', 'HWBAAA', 'VVVVxx'),
+(8822, 1256, 0, 2, 2, 2, 22, 822, 822, 3822, 8822, 44, 45, 'IBAAAA', 'IWBAAA', 'AAAAxx'),
+(7167, 1257, 1, 3, 7, 7, 67, 167, 1167, 2167, 7167, 134, 135, 'RPAAAA', 'JWBAAA', 'HHHHxx'),
+(6909, 1258, 1, 1, 9, 9, 9, 909, 909, 1909, 6909, 18, 19, 'TFAAAA', 'KWBAAA', 'OOOOxx'),
+(1439, 1259, 1, 3, 9, 19, 39, 439, 1439, 1439, 1439, 78, 79, 'JDAAAA', 'LWBAAA', 'VVVVxx'),
+(2370, 1260, 0, 2, 0, 10, 70, 370, 370, 2370, 2370, 140, 141, 'ENAAAA', 'MWBAAA', 'AAAAxx'),
+(4577, 1261, 1, 1, 7, 17, 77, 577, 577, 4577, 4577, 154, 155, 'BUAAAA', 'NWBAAA', 'HHHHxx'),
+(2575, 1262, 1, 3, 5, 15, 75, 575, 575, 2575, 2575, 150, 151, 'BVAAAA', 'OWBAAA', 'OOOOxx'),
+(2795, 1263, 1, 3, 5, 15, 95, 795, 795, 2795, 2795, 190, 191, 'NDAAAA', 'PWBAAA', 'VVVVxx'),
+(5520, 1264, 0, 0, 0, 0, 20, 520, 1520, 520, 5520, 40, 41, 'IEAAAA', 'QWBAAA', 'AAAAxx'),
+(382, 1265, 0, 2, 2, 2, 82, 382, 382, 382, 382, 164, 165, 'SOAAAA', 'RWBAAA', 'HHHHxx'),
+(6335, 1266, 1, 3, 5, 15, 35, 335, 335, 1335, 6335, 70, 71, 'RJAAAA', 'SWBAAA', 'OOOOxx'),
+(8430, 1267, 0, 2, 0, 10, 30, 430, 430, 3430, 8430, 60, 61, 'GMAAAA', 'TWBAAA', 'VVVVxx'),
+(4131, 1268, 1, 3, 1, 11, 31, 131, 131, 4131, 4131, 62, 63, 'XCAAAA', 'UWBAAA', 'AAAAxx'),
+(9332, 1269, 0, 0, 2, 12, 32, 332, 1332, 4332, 9332, 64, 65, 'YUAAAA', 'VWBAAA', 'HHHHxx'),
+(293, 1270, 1, 1, 3, 13, 93, 293, 293, 293, 293, 186, 187, 'HLAAAA', 'WWBAAA', 'OOOOxx'),
+(2276, 1271, 0, 0, 6, 16, 76, 276, 276, 2276, 2276, 152, 153, 'OJAAAA', 'XWBAAA', 'VVVVxx'),
+(5687, 1272, 1, 3, 7, 7, 87, 687, 1687, 687, 5687, 174, 175, 'TKAAAA', 'YWBAAA', 'AAAAxx'),
+(5862, 1273, 0, 2, 2, 2, 62, 862, 1862, 862, 5862, 124, 125, 'MRAAAA', 'ZWBAAA', 'HHHHxx'),
+(5073, 1274, 1, 1, 3, 13, 73, 73, 1073, 73, 5073, 146, 147, 'DNAAAA', 'AXBAAA', 'OOOOxx'),
+(4170, 1275, 0, 2, 0, 10, 70, 170, 170, 4170, 4170, 140, 141, 'KEAAAA', 'BXBAAA', 'VVVVxx'),
+(5039, 1276, 1, 3, 9, 19, 39, 39, 1039, 39, 5039, 78, 79, 'VLAAAA', 'CXBAAA', 'AAAAxx'),
+(3294, 1277, 0, 2, 4, 14, 94, 294, 1294, 3294, 3294, 188, 189, 'SWAAAA', 'DXBAAA', 'HHHHxx'),
+(6015, 1278, 1, 3, 5, 15, 15, 15, 15, 1015, 6015, 30, 31, 'JXAAAA', 'EXBAAA', 'OOOOxx'),
+(9015, 1279, 1, 3, 5, 15, 15, 15, 1015, 4015, 9015, 30, 31, 'TIAAAA', 'FXBAAA', 'VVVVxx'),
+(9785, 1280, 1, 1, 5, 5, 85, 785, 1785, 4785, 9785, 170, 171, 'JMAAAA', 'GXBAAA', 'AAAAxx'),
+(4312, 1281, 0, 0, 2, 12, 12, 312, 312, 4312, 4312, 24, 25, 'WJAAAA', 'HXBAAA', 'HHHHxx'),
+(6343, 1282, 1, 3, 3, 3, 43, 343, 343, 1343, 6343, 86, 87, 'ZJAAAA', 'IXBAAA', 'OOOOxx'),
+(2161, 1283, 1, 1, 1, 1, 61, 161, 161, 2161, 2161, 122, 123, 'DFAAAA', 'JXBAAA', 'VVVVxx'),
+(4490, 1284, 0, 2, 0, 10, 90, 490, 490, 4490, 4490, 180, 181, 'SQAAAA', 'KXBAAA', 'AAAAxx'),
+(4454, 1285, 0, 2, 4, 14, 54, 454, 454, 4454, 4454, 108, 109, 'IPAAAA', 'LXBAAA', 'HHHHxx'),
+(7647, 1286, 1, 3, 7, 7, 47, 647, 1647, 2647, 7647, 94, 95, 'DIAAAA', 'MXBAAA', 'OOOOxx'),
+(1028, 1287, 0, 0, 8, 8, 28, 28, 1028, 1028, 1028, 56, 57, 'ONAAAA', 'NXBAAA', 'VVVVxx'),
+(2965, 1288, 1, 1, 5, 5, 65, 965, 965, 2965, 2965, 130, 131, 'BKAAAA', 'OXBAAA', 'AAAAxx'),
+(9900, 1289, 0, 0, 0, 0, 0, 900, 1900, 4900, 9900, 0, 1, 'UQAAAA', 'PXBAAA', 'HHHHxx'),
+(5509, 1290, 1, 1, 9, 9, 9, 509, 1509, 509, 5509, 18, 19, 'XDAAAA', 'QXBAAA', 'OOOOxx'),
+(7751, 1291, 1, 3, 1, 11, 51, 751, 1751, 2751, 7751, 102, 103, 'DMAAAA', 'RXBAAA', 'VVVVxx'),
+(9594, 1292, 0, 2, 4, 14, 94, 594, 1594, 4594, 9594, 188, 189, 'AFAAAA', 'SXBAAA', 'AAAAxx'),
+(7632, 1293, 0, 0, 2, 12, 32, 632, 1632, 2632, 7632, 64, 65, 'OHAAAA', 'TXBAAA', 'HHHHxx'),
+(6528, 1294, 0, 0, 8, 8, 28, 528, 528, 1528, 6528, 56, 57, 'CRAAAA', 'UXBAAA', 'OOOOxx'),
+(1041, 1295, 1, 1, 1, 1, 41, 41, 1041, 1041, 1041, 82, 83, 'BOAAAA', 'VXBAAA', 'VVVVxx'),
+(1534, 1296, 0, 2, 4, 14, 34, 534, 1534, 1534, 1534, 68, 69, 'AHAAAA', 'WXBAAA', 'AAAAxx'),
+(4229, 1297, 1, 1, 9, 9, 29, 229, 229, 4229, 4229, 58, 59, 'RGAAAA', 'XXBAAA', 'HHHHxx'),
+(84, 1298, 0, 0, 4, 4, 84, 84, 84, 84, 84, 168, 169, 'GDAAAA', 'YXBAAA', 'OOOOxx'),
+(2189, 1299, 1, 1, 9, 9, 89, 189, 189, 2189, 2189, 178, 179, 'FGAAAA', 'ZXBAAA', 'VVVVxx'),
+(7566, 1300, 0, 2, 6, 6, 66, 566, 1566, 2566, 7566, 132, 133, 'AFAAAA', 'AYBAAA', 'AAAAxx'),
+(707, 1301, 1, 3, 7, 7, 7, 707, 707, 707, 707, 14, 15, 'FBAAAA', 'BYBAAA', 'HHHHxx'),
+(581, 1302, 1, 1, 1, 1, 81, 581, 581, 581, 581, 162, 163, 'JWAAAA', 'CYBAAA', 'OOOOxx'),
+(6753, 1303, 1, 1, 3, 13, 53, 753, 753, 1753, 6753, 106, 107, 'TZAAAA', 'DYBAAA', 'VVVVxx'),
+(8604, 1304, 0, 0, 4, 4, 4, 604, 604, 3604, 8604, 8, 9, 'YSAAAA', 'EYBAAA', 'AAAAxx'),
+(373, 1305, 1, 1, 3, 13, 73, 373, 373, 373, 373, 146, 147, 'JOAAAA', 'FYBAAA', 'HHHHxx'),
+(9635, 1306, 1, 3, 5, 15, 35, 635, 1635, 4635, 9635, 70, 71, 'PGAAAA', 'GYBAAA', 'OOOOxx'),
+(9277, 1307, 1, 1, 7, 17, 77, 277, 1277, 4277, 9277, 154, 155, 'VSAAAA', 'HYBAAA', 'VVVVxx'),
+(7117, 1308, 1, 1, 7, 17, 17, 117, 1117, 2117, 7117, 34, 35, 'TNAAAA', 'IYBAAA', 'AAAAxx'),
+(8564, 1309, 0, 0, 4, 4, 64, 564, 564, 3564, 8564, 128, 129, 'KRAAAA', 'JYBAAA', 'HHHHxx'),
+(1697, 1310, 1, 1, 7, 17, 97, 697, 1697, 1697, 1697, 194, 195, 'HNAAAA', 'KYBAAA', 'OOOOxx'),
+(7840, 1311, 0, 0, 0, 0, 40, 840, 1840, 2840, 7840, 80, 81, 'OPAAAA', 'LYBAAA', 'VVVVxx'),
+(3646, 1312, 0, 2, 6, 6, 46, 646, 1646, 3646, 3646, 92, 93, 'GKAAAA', 'MYBAAA', 'AAAAxx'),
+(368, 1313, 0, 0, 8, 8, 68, 368, 368, 368, 368, 136, 137, 'EOAAAA', 'NYBAAA', 'HHHHxx'),
+(4797, 1314, 1, 1, 7, 17, 97, 797, 797, 4797, 4797, 194, 195, 'NCAAAA', 'OYBAAA', 'OOOOxx'),
+(5300, 1315, 0, 0, 0, 0, 0, 300, 1300, 300, 5300, 0, 1, 'WVAAAA', 'PYBAAA', 'VVVVxx'),
+(7664, 1316, 0, 0, 4, 4, 64, 664, 1664, 2664, 7664, 128, 129, 'UIAAAA', 'QYBAAA', 'AAAAxx'),
+(1466, 1317, 0, 2, 6, 6, 66, 466, 1466, 1466, 1466, 132, 133, 'KEAAAA', 'RYBAAA', 'HHHHxx'),
+(2477, 1318, 1, 1, 7, 17, 77, 477, 477, 2477, 2477, 154, 155, 'HRAAAA', 'SYBAAA', 'OOOOxx'),
+(2036, 1319, 0, 0, 6, 16, 36, 36, 36, 2036, 2036, 72, 73, 'IAAAAA', 'TYBAAA', 'VVVVxx'),
+(3624, 1320, 0, 0, 4, 4, 24, 624, 1624, 3624, 3624, 48, 49, 'KJAAAA', 'UYBAAA', 'AAAAxx'),
+(5099, 1321, 1, 3, 9, 19, 99, 99, 1099, 99, 5099, 198, 199, 'DOAAAA', 'VYBAAA', 'HHHHxx'),
+(1308, 1322, 0, 0, 8, 8, 8, 308, 1308, 1308, 1308, 16, 17, 'IYAAAA', 'WYBAAA', 'OOOOxx'),
+(3704, 1323, 0, 0, 4, 4, 4, 704, 1704, 3704, 3704, 8, 9, 'MMAAAA', 'XYBAAA', 'VVVVxx'),
+(2451, 1324, 1, 3, 1, 11, 51, 451, 451, 2451, 2451, 102, 103, 'HQAAAA', 'YYBAAA', 'AAAAxx'),
+(4898, 1325, 0, 2, 8, 18, 98, 898, 898, 4898, 4898, 196, 197, 'KGAAAA', 'ZYBAAA', 'HHHHxx'),
+(4959, 1326, 1, 3, 9, 19, 59, 959, 959, 4959, 4959, 118, 119, 'TIAAAA', 'AZBAAA', 'OOOOxx'),
+(5942, 1327, 0, 2, 2, 2, 42, 942, 1942, 942, 5942, 84, 85, 'OUAAAA', 'BZBAAA', 'VVVVxx'),
+(2425, 1328, 1, 1, 5, 5, 25, 425, 425, 2425, 2425, 50, 51, 'HPAAAA', 'CZBAAA', 'AAAAxx'),
+(7760, 1329, 0, 0, 0, 0, 60, 760, 1760, 2760, 7760, 120, 121, 'MMAAAA', 'DZBAAA', 'HHHHxx'),
+(6294, 1330, 0, 2, 4, 14, 94, 294, 294, 1294, 6294, 188, 189, 'CIAAAA', 'EZBAAA', 'OOOOxx'),
+(6785, 1331, 1, 1, 5, 5, 85, 785, 785, 1785, 6785, 170, 171, 'ZAAAAA', 'FZBAAA', 'VVVVxx'),
+(3542, 1332, 0, 2, 2, 2, 42, 542, 1542, 3542, 3542, 84, 85, 'GGAAAA', 'GZBAAA', 'AAAAxx'),
+(1809, 1333, 1, 1, 9, 9, 9, 809, 1809, 1809, 1809, 18, 19, 'PRAAAA', 'HZBAAA', 'HHHHxx'),
+(130, 1334, 0, 2, 0, 10, 30, 130, 130, 130, 130, 60, 61, 'AFAAAA', 'IZBAAA', 'OOOOxx'),
+(8672, 1335, 0, 0, 2, 12, 72, 672, 672, 3672, 8672, 144, 145, 'OVAAAA', 'JZBAAA', 'VVVVxx'),
+(2125, 1336, 1, 1, 5, 5, 25, 125, 125, 2125, 2125, 50, 51, 'TDAAAA', 'KZBAAA', 'AAAAxx'),
+(7683, 1337, 1, 3, 3, 3, 83, 683, 1683, 2683, 7683, 166, 167, 'NJAAAA', 'LZBAAA', 'HHHHxx'),
+(7842, 1338, 0, 2, 2, 2, 42, 842, 1842, 2842, 7842, 84, 85, 'QPAAAA', 'MZBAAA', 'OOOOxx'),
+(9584, 1339, 0, 0, 4, 4, 84, 584, 1584, 4584, 9584, 168, 169, 'QEAAAA', 'NZBAAA', 'VVVVxx'),
+(7963, 1340, 1, 3, 3, 3, 63, 963, 1963, 2963, 7963, 126, 127, 'HUAAAA', 'OZBAAA', 'AAAAxx'),
+(8581, 1341, 1, 1, 1, 1, 81, 581, 581, 3581, 8581, 162, 163, 'BSAAAA', 'PZBAAA', 'HHHHxx'),
+(2135, 1342, 1, 3, 5, 15, 35, 135, 135, 2135, 2135, 70, 71, 'DEAAAA', 'QZBAAA', 'OOOOxx'),
+(7352, 1343, 0, 0, 2, 12, 52, 352, 1352, 2352, 7352, 104, 105, 'UWAAAA', 'RZBAAA', 'VVVVxx'),
+(5789, 1344, 1, 1, 9, 9, 89, 789, 1789, 789, 5789, 178, 179, 'ROAAAA', 'SZBAAA', 'AAAAxx'),
+(8490, 1345, 0, 2, 0, 10, 90, 490, 490, 3490, 8490, 180, 181, 'OOAAAA', 'TZBAAA', 'HHHHxx'),
+(2145, 1346, 1, 1, 5, 5, 45, 145, 145, 2145, 2145, 90, 91, 'NEAAAA', 'UZBAAA', 'OOOOxx'),
+(7021, 1347, 1, 1, 1, 1, 21, 21, 1021, 2021, 7021, 42, 43, 'BKAAAA', 'VZBAAA', 'VVVVxx'),
+(3736, 1348, 0, 0, 6, 16, 36, 736, 1736, 3736, 3736, 72, 73, 'SNAAAA', 'WZBAAA', 'AAAAxx'),
+(7396, 1349, 0, 0, 6, 16, 96, 396, 1396, 2396, 7396, 192, 193, 'MYAAAA', 'XZBAAA', 'HHHHxx'),
+(6334, 1350, 0, 2, 4, 14, 34, 334, 334, 1334, 6334, 68, 69, 'QJAAAA', 'YZBAAA', 'OOOOxx'),
+(5461, 1351, 1, 1, 1, 1, 61, 461, 1461, 461, 5461, 122, 123, 'BCAAAA', 'ZZBAAA', 'VVVVxx'),
+(5337, 1352, 1, 1, 7, 17, 37, 337, 1337, 337, 5337, 74, 75, 'HXAAAA', 'AACAAA', 'AAAAxx'),
+(7440, 1353, 0, 0, 0, 0, 40, 440, 1440, 2440, 7440, 80, 81, 'EAAAAA', 'BACAAA', 'HHHHxx'),
+(6879, 1354, 1, 3, 9, 19, 79, 879, 879, 1879, 6879, 158, 159, 'PEAAAA', 'CACAAA', 'OOOOxx'),
+(2432, 1355, 0, 0, 2, 12, 32, 432, 432, 2432, 2432, 64, 65, 'OPAAAA', 'DACAAA', 'VVVVxx'),
+(8529, 1356, 1, 1, 9, 9, 29, 529, 529, 3529, 8529, 58, 59, 'BQAAAA', 'EACAAA', 'AAAAxx'),
+(7859, 1357, 1, 3, 9, 19, 59, 859, 1859, 2859, 7859, 118, 119, 'HQAAAA', 'FACAAA', 'HHHHxx'),
+(15, 1358, 1, 3, 5, 15, 15, 15, 15, 15, 15, 30, 31, 'PAAAAA', 'GACAAA', 'OOOOxx'),
+(7475, 1359, 1, 3, 5, 15, 75, 475, 1475, 2475, 7475, 150, 151, 'NBAAAA', 'HACAAA', 'VVVVxx'),
+(717, 1360, 1, 1, 7, 17, 17, 717, 717, 717, 717, 34, 35, 'PBAAAA', 'IACAAA', 'AAAAxx'),
+(250, 1361, 0, 2, 0, 10, 50, 250, 250, 250, 250, 100, 101, 'QJAAAA', 'JACAAA', 'HHHHxx'),
+(4700, 1362, 0, 0, 0, 0, 0, 700, 700, 4700, 4700, 0, 1, 'UYAAAA', 'KACAAA', 'OOOOxx'),
+(7510, 1363, 0, 2, 0, 10, 10, 510, 1510, 2510, 7510, 20, 21, 'WCAAAA', 'LACAAA', 'VVVVxx'),
+(4562, 1364, 0, 2, 2, 2, 62, 562, 562, 4562, 4562, 124, 125, 'MTAAAA', 'MACAAA', 'AAAAxx'),
+(8075, 1365, 1, 3, 5, 15, 75, 75, 75, 3075, 8075, 150, 151, 'PYAAAA', 'NACAAA', 'HHHHxx'),
+(871, 1366, 1, 3, 1, 11, 71, 871, 871, 871, 871, 142, 143, 'NHAAAA', 'OACAAA', 'OOOOxx'),
+(7161, 1367, 1, 1, 1, 1, 61, 161, 1161, 2161, 7161, 122, 123, 'LPAAAA', 'PACAAA', 'VVVVxx'),
+(9109, 1368, 1, 1, 9, 9, 9, 109, 1109, 4109, 9109, 18, 19, 'JMAAAA', 'QACAAA', 'AAAAxx'),
+(8675, 1369, 1, 3, 5, 15, 75, 675, 675, 3675, 8675, 150, 151, 'RVAAAA', 'RACAAA', 'HHHHxx'),
+(1025, 1370, 1, 1, 5, 5, 25, 25, 1025, 1025, 1025, 50, 51, 'LNAAAA', 'SACAAA', 'OOOOxx'),
+(4065, 1371, 1, 1, 5, 5, 65, 65, 65, 4065, 4065, 130, 131, 'JAAAAA', 'TACAAA', 'VVVVxx'),
+(3511, 1372, 1, 3, 1, 11, 11, 511, 1511, 3511, 3511, 22, 23, 'BFAAAA', 'UACAAA', 'AAAAxx'),
+(9840, 1373, 0, 0, 0, 0, 40, 840, 1840, 4840, 9840, 80, 81, 'MOAAAA', 'VACAAA', 'HHHHxx'),
+(7495, 1374, 1, 3, 5, 15, 95, 495, 1495, 2495, 7495, 190, 191, 'HCAAAA', 'WACAAA', 'OOOOxx'),
+(55, 1375, 1, 3, 5, 15, 55, 55, 55, 55, 55, 110, 111, 'DCAAAA', 'XACAAA', 'VVVVxx'),
+(6151, 1376, 1, 3, 1, 11, 51, 151, 151, 1151, 6151, 102, 103, 'PCAAAA', 'YACAAA', 'AAAAxx'),
+(2512, 1377, 0, 0, 2, 12, 12, 512, 512, 2512, 2512, 24, 25, 'QSAAAA', 'ZACAAA', 'HHHHxx'),
+(5881, 1378, 1, 1, 1, 1, 81, 881, 1881, 881, 5881, 162, 163, 'FSAAAA', 'ABCAAA', 'OOOOxx'),
+(1442, 1379, 0, 2, 2, 2, 42, 442, 1442, 1442, 1442, 84, 85, 'MDAAAA', 'BBCAAA', 'VVVVxx'),
+(1270, 1380, 0, 2, 0, 10, 70, 270, 1270, 1270, 1270, 140, 141, 'WWAAAA', 'CBCAAA', 'AAAAxx'),
+(959, 1381, 1, 3, 9, 19, 59, 959, 959, 959, 959, 118, 119, 'XKAAAA', 'DBCAAA', 'HHHHxx'),
+(8251, 1382, 1, 3, 1, 11, 51, 251, 251, 3251, 8251, 102, 103, 'JFAAAA', 'EBCAAA', 'OOOOxx'),
+(3051, 1383, 1, 3, 1, 11, 51, 51, 1051, 3051, 3051, 102, 103, 'JNAAAA', 'FBCAAA', 'VVVVxx'),
+(5052, 1384, 0, 0, 2, 12, 52, 52, 1052, 52, 5052, 104, 105, 'IMAAAA', 'GBCAAA', 'AAAAxx'),
+(1863, 1385, 1, 3, 3, 3, 63, 863, 1863, 1863, 1863, 126, 127, 'RTAAAA', 'HBCAAA', 'HHHHxx'),
+(344, 1386, 0, 0, 4, 4, 44, 344, 344, 344, 344, 88, 89, 'GNAAAA', 'IBCAAA', 'OOOOxx'),
+(3590, 1387, 0, 2, 0, 10, 90, 590, 1590, 3590, 3590, 180, 181, 'CIAAAA', 'JBCAAA', 'VVVVxx'),
+(4223, 1388, 1, 3, 3, 3, 23, 223, 223, 4223, 4223, 46, 47, 'LGAAAA', 'KBCAAA', 'AAAAxx'),
+(2284, 1389, 0, 0, 4, 4, 84, 284, 284, 2284, 2284, 168, 169, 'WJAAAA', 'LBCAAA', 'HHHHxx'),
+(9425, 1390, 1, 1, 5, 5, 25, 425, 1425, 4425, 9425, 50, 51, 'NYAAAA', 'MBCAAA', 'OOOOxx'),
+(6221, 1391, 1, 1, 1, 1, 21, 221, 221, 1221, 6221, 42, 43, 'HFAAAA', 'NBCAAA', 'VVVVxx'),
+(195, 1392, 1, 3, 5, 15, 95, 195, 195, 195, 195, 190, 191, 'NHAAAA', 'OBCAAA', 'AAAAxx'),
+(1517, 1393, 1, 1, 7, 17, 17, 517, 1517, 1517, 1517, 34, 35, 'JGAAAA', 'PBCAAA', 'HHHHxx'),
+(3791, 1394, 1, 3, 1, 11, 91, 791, 1791, 3791, 3791, 182, 183, 'VPAAAA', 'QBCAAA', 'OOOOxx'),
+(572, 1395, 0, 0, 2, 12, 72, 572, 572, 572, 572, 144, 145, 'AWAAAA', 'RBCAAA', 'VVVVxx'),
+(46, 1396, 0, 2, 6, 6, 46, 46, 46, 46, 46, 92, 93, 'UBAAAA', 'SBCAAA', 'AAAAxx'),
+(9451, 1397, 1, 3, 1, 11, 51, 451, 1451, 4451, 9451, 102, 103, 'NZAAAA', 'TBCAAA', 'HHHHxx'),
+(3359, 1398, 1, 3, 9, 19, 59, 359, 1359, 3359, 3359, 118, 119, 'FZAAAA', 'UBCAAA', 'OOOOxx'),
+(8867, 1399, 1, 3, 7, 7, 67, 867, 867, 3867, 8867, 134, 135, 'BDAAAA', 'VBCAAA', 'VVVVxx'),
+(674, 1400, 0, 2, 4, 14, 74, 674, 674, 674, 674, 148, 149, 'YZAAAA', 'WBCAAA', 'AAAAxx'),
+(2674, 1401, 0, 2, 4, 14, 74, 674, 674, 2674, 2674, 148, 149, 'WYAAAA', 'XBCAAA', 'HHHHxx'),
+(6523, 1402, 1, 3, 3, 3, 23, 523, 523, 1523, 6523, 46, 47, 'XQAAAA', 'YBCAAA', 'OOOOxx'),
+(6210, 1403, 0, 2, 0, 10, 10, 210, 210, 1210, 6210, 20, 21, 'WEAAAA', 'ZBCAAA', 'VVVVxx'),
+(7564, 1404, 0, 0, 4, 4, 64, 564, 1564, 2564, 7564, 128, 129, 'YEAAAA', 'ACCAAA', 'AAAAxx'),
+(4776, 1405, 0, 0, 6, 16, 76, 776, 776, 4776, 4776, 152, 153, 'SBAAAA', 'BCCAAA', 'HHHHxx'),
+(2993, 1406, 1, 1, 3, 13, 93, 993, 993, 2993, 2993, 186, 187, 'DLAAAA', 'CCCAAA', 'OOOOxx'),
+(2969, 1407, 1, 1, 9, 9, 69, 969, 969, 2969, 2969, 138, 139, 'FKAAAA', 'DCCAAA', 'VVVVxx'),
+(1762, 1408, 0, 2, 2, 2, 62, 762, 1762, 1762, 1762, 124, 125, 'UPAAAA', 'ECCAAA', 'AAAAxx'),
+(685, 1409, 1, 1, 5, 5, 85, 685, 685, 685, 685, 170, 171, 'JAAAAA', 'FCCAAA', 'HHHHxx'),
+(5312, 1410, 0, 0, 2, 12, 12, 312, 1312, 312, 5312, 24, 25, 'IWAAAA', 'GCCAAA', 'OOOOxx'),
+(3264, 1411, 0, 0, 4, 4, 64, 264, 1264, 3264, 3264, 128, 129, 'OVAAAA', 'HCCAAA', 'VVVVxx'),
+(7008, 1412, 0, 0, 8, 8, 8, 8, 1008, 2008, 7008, 16, 17, 'OJAAAA', 'ICCAAA', 'AAAAxx'),
+(5167, 1413, 1, 3, 7, 7, 67, 167, 1167, 167, 5167, 134, 135, 'TQAAAA', 'JCCAAA', 'HHHHxx'),
+(3060, 1414, 0, 0, 0, 0, 60, 60, 1060, 3060, 3060, 120, 121, 'SNAAAA', 'KCCAAA', 'OOOOxx'),
+(1752, 1415, 0, 0, 2, 12, 52, 752, 1752, 1752, 1752, 104, 105, 'KPAAAA', 'LCCAAA', 'VVVVxx'),
+(1016, 1416, 0, 0, 6, 16, 16, 16, 1016, 1016, 1016, 32, 33, 'CNAAAA', 'MCCAAA', 'AAAAxx'),
+(7365, 1417, 1, 1, 5, 5, 65, 365, 1365, 2365, 7365, 130, 131, 'HXAAAA', 'NCCAAA', 'HHHHxx'),
+(4358, 1418, 0, 2, 8, 18, 58, 358, 358, 4358, 4358, 116, 117, 'QLAAAA', 'OCCAAA', 'OOOOxx'),
+(2819, 1419, 1, 3, 9, 19, 19, 819, 819, 2819, 2819, 38, 39, 'LEAAAA', 'PCCAAA', 'VVVVxx'),
+(6727, 1420, 1, 3, 7, 7, 27, 727, 727, 1727, 6727, 54, 55, 'TYAAAA', 'QCCAAA', 'AAAAxx'),
+(1459, 1421, 1, 3, 9, 19, 59, 459, 1459, 1459, 1459, 118, 119, 'DEAAAA', 'RCCAAA', 'HHHHxx'),
+(1708, 1422, 0, 0, 8, 8, 8, 708, 1708, 1708, 1708, 16, 17, 'SNAAAA', 'SCCAAA', 'OOOOxx'),
+(471, 1423, 1, 3, 1, 11, 71, 471, 471, 471, 471, 142, 143, 'DSAAAA', 'TCCAAA', 'VVVVxx'),
+(387, 1424, 1, 3, 7, 7, 87, 387, 387, 387, 387, 174, 175, 'XOAAAA', 'UCCAAA', 'AAAAxx'),
+(1166, 1425, 0, 2, 6, 6, 66, 166, 1166, 1166, 1166, 132, 133, 'WSAAAA', 'VCCAAA', 'HHHHxx'),
+(2400, 1426, 0, 0, 0, 0, 0, 400, 400, 2400, 2400, 0, 1, 'IOAAAA', 'WCCAAA', 'OOOOxx'),
+(3584, 1427, 0, 0, 4, 4, 84, 584, 1584, 3584, 3584, 168, 169, 'WHAAAA', 'XCCAAA', 'VVVVxx'),
+(6423, 1428, 1, 3, 3, 3, 23, 423, 423, 1423, 6423, 46, 47, 'BNAAAA', 'YCCAAA', 'AAAAxx'),
+(9520, 1429, 0, 0, 0, 0, 20, 520, 1520, 4520, 9520, 40, 41, 'ECAAAA', 'ZCCAAA', 'HHHHxx'),
+(8080, 1430, 0, 0, 0, 0, 80, 80, 80, 3080, 8080, 160, 161, 'UYAAAA', 'ADCAAA', 'OOOOxx'),
+(5709, 1431, 1, 1, 9, 9, 9, 709, 1709, 709, 5709, 18, 19, 'PLAAAA', 'BDCAAA', 'VVVVxx'),
+(1131, 1432, 1, 3, 1, 11, 31, 131, 1131, 1131, 1131, 62, 63, 'NRAAAA', 'CDCAAA', 'AAAAxx'),
+(8562, 1433, 0, 2, 2, 2, 62, 562, 562, 3562, 8562, 124, 125, 'IRAAAA', 'DDCAAA', 'HHHHxx'),
+(5766, 1434, 0, 2, 6, 6, 66, 766, 1766, 766, 5766, 132, 133, 'UNAAAA', 'EDCAAA', 'OOOOxx'),
+(245, 1435, 1, 1, 5, 5, 45, 245, 245, 245, 245, 90, 91, 'LJAAAA', 'FDCAAA', 'VVVVxx'),
+(9869, 1436, 1, 1, 9, 9, 69, 869, 1869, 4869, 9869, 138, 139, 'PPAAAA', 'GDCAAA', 'AAAAxx'),
+(3533, 1437, 1, 1, 3, 13, 33, 533, 1533, 3533, 3533, 66, 67, 'XFAAAA', 'HDCAAA', 'HHHHxx'),
+(5109, 1438, 1, 1, 9, 9, 9, 109, 1109, 109, 5109, 18, 19, 'NOAAAA', 'IDCAAA', 'OOOOxx'),
+(977, 1439, 1, 1, 7, 17, 77, 977, 977, 977, 977, 154, 155, 'PLAAAA', 'JDCAAA', 'VVVVxx'),
+(1651, 1440, 1, 3, 1, 11, 51, 651, 1651, 1651, 1651, 102, 103, 'NLAAAA', 'KDCAAA', 'AAAAxx'),
+(1357, 1441, 1, 1, 7, 17, 57, 357, 1357, 1357, 1357, 114, 115, 'FAAAAA', 'LDCAAA', 'HHHHxx'),
+(9087, 1442, 1, 3, 7, 7, 87, 87, 1087, 4087, 9087, 174, 175, 'NLAAAA', 'MDCAAA', 'OOOOxx'),
+(3399, 1443, 1, 3, 9, 19, 99, 399, 1399, 3399, 3399, 198, 199, 'TAAAAA', 'NDCAAA', 'VVVVxx'),
+(7543, 1444, 1, 3, 3, 3, 43, 543, 1543, 2543, 7543, 86, 87, 'DEAAAA', 'ODCAAA', 'AAAAxx'),
+(2469, 1445, 1, 1, 9, 9, 69, 469, 469, 2469, 2469, 138, 139, 'ZQAAAA', 'PDCAAA', 'HHHHxx'),
+(8305, 1446, 1, 1, 5, 5, 5, 305, 305, 3305, 8305, 10, 11, 'LHAAAA', 'QDCAAA', 'OOOOxx'),
+(3265, 1447, 1, 1, 5, 5, 65, 265, 1265, 3265, 3265, 130, 131, 'PVAAAA', 'RDCAAA', 'VVVVxx'),
+(9977, 1448, 1, 1, 7, 17, 77, 977, 1977, 4977, 9977, 154, 155, 'TTAAAA', 'SDCAAA', 'AAAAxx'),
+(3961, 1449, 1, 1, 1, 1, 61, 961, 1961, 3961, 3961, 122, 123, 'JWAAAA', 'TDCAAA', 'HHHHxx'),
+(4952, 1450, 0, 0, 2, 12, 52, 952, 952, 4952, 4952, 104, 105, 'MIAAAA', 'UDCAAA', 'OOOOxx'),
+(5173, 1451, 1, 1, 3, 13, 73, 173, 1173, 173, 5173, 146, 147, 'ZQAAAA', 'VDCAAA', 'VVVVxx'),
+(860, 1452, 0, 0, 0, 0, 60, 860, 860, 860, 860, 120, 121, 'CHAAAA', 'WDCAAA', 'AAAAxx'),
+(4523, 1453, 1, 3, 3, 3, 23, 523, 523, 4523, 4523, 46, 47, 'ZRAAAA', 'XDCAAA', 'HHHHxx'),
+(2361, 1454, 1, 1, 1, 1, 61, 361, 361, 2361, 2361, 122, 123, 'VMAAAA', 'YDCAAA', 'OOOOxx'),
+(7877, 1455, 1, 1, 7, 17, 77, 877, 1877, 2877, 7877, 154, 155, 'ZQAAAA', 'ZDCAAA', 'VVVVxx'),
+(3422, 1456, 0, 2, 2, 2, 22, 422, 1422, 3422, 3422, 44, 45, 'QBAAAA', 'AECAAA', 'AAAAxx'),
+(5781, 1457, 1, 1, 1, 1, 81, 781, 1781, 781, 5781, 162, 163, 'JOAAAA', 'BECAAA', 'HHHHxx'),
+(4752, 1458, 0, 0, 2, 12, 52, 752, 752, 4752, 4752, 104, 105, 'UAAAAA', 'CECAAA', 'OOOOxx'),
+(1786, 1459, 0, 2, 6, 6, 86, 786, 1786, 1786, 1786, 172, 173, 'SQAAAA', 'DECAAA', 'VVVVxx'),
+(1892, 1460, 0, 0, 2, 12, 92, 892, 1892, 1892, 1892, 184, 185, 'UUAAAA', 'EECAAA', 'AAAAxx'),
+(6389, 1461, 1, 1, 9, 9, 89, 389, 389, 1389, 6389, 178, 179, 'TLAAAA', 'FECAAA', 'HHHHxx'),
+(8644, 1462, 0, 0, 4, 4, 44, 644, 644, 3644, 8644, 88, 89, 'MUAAAA', 'GECAAA', 'OOOOxx'),
+(9056, 1463, 0, 0, 6, 16, 56, 56, 1056, 4056, 9056, 112, 113, 'IKAAAA', 'HECAAA', 'VVVVxx'),
+(1423, 1464, 1, 3, 3, 3, 23, 423, 1423, 1423, 1423, 46, 47, 'TCAAAA', 'IECAAA', 'AAAAxx'),
+(4901, 1465, 1, 1, 1, 1, 1, 901, 901, 4901, 4901, 2, 3, 'NGAAAA', 'JECAAA', 'HHHHxx'),
+(3859, 1466, 1, 3, 9, 19, 59, 859, 1859, 3859, 3859, 118, 119, 'LSAAAA', 'KECAAA', 'OOOOxx'),
+(2324, 1467, 0, 0, 4, 4, 24, 324, 324, 2324, 2324, 48, 49, 'KLAAAA', 'LECAAA', 'VVVVxx'),
+(8101, 1468, 1, 1, 1, 1, 1, 101, 101, 3101, 8101, 2, 3, 'PZAAAA', 'MECAAA', 'AAAAxx'),
+(8016, 1469, 0, 0, 6, 16, 16, 16, 16, 3016, 8016, 32, 33, 'IWAAAA', 'NECAAA', 'HHHHxx'),
+(5826, 1470, 0, 2, 6, 6, 26, 826, 1826, 826, 5826, 52, 53, 'CQAAAA', 'OECAAA', 'OOOOxx'),
+(8266, 1471, 0, 2, 6, 6, 66, 266, 266, 3266, 8266, 132, 133, 'YFAAAA', 'PECAAA', 'VVVVxx'),
+(7558, 1472, 0, 2, 8, 18, 58, 558, 1558, 2558, 7558, 116, 117, 'SEAAAA', 'QECAAA', 'AAAAxx'),
+(6976, 1473, 0, 0, 6, 16, 76, 976, 976, 1976, 6976, 152, 153, 'IIAAAA', 'RECAAA', 'HHHHxx'),
+(222, 1474, 0, 2, 2, 2, 22, 222, 222, 222, 222, 44, 45, 'OIAAAA', 'SECAAA', 'OOOOxx'),
+(1624, 1475, 0, 0, 4, 4, 24, 624, 1624, 1624, 1624, 48, 49, 'MKAAAA', 'TECAAA', 'VVVVxx'),
+(1250, 1476, 0, 2, 0, 10, 50, 250, 1250, 1250, 1250, 100, 101, 'CWAAAA', 'UECAAA', 'AAAAxx'),
+(1621, 1477, 1, 1, 1, 1, 21, 621, 1621, 1621, 1621, 42, 43, 'JKAAAA', 'VECAAA', 'HHHHxx'),
+(2350, 1478, 0, 2, 0, 10, 50, 350, 350, 2350, 2350, 100, 101, 'KMAAAA', 'WECAAA', 'OOOOxx'),
+(5239, 1479, 1, 3, 9, 19, 39, 239, 1239, 239, 5239, 78, 79, 'NTAAAA', 'XECAAA', 'VVVVxx'),
+(6681, 1480, 1, 1, 1, 1, 81, 681, 681, 1681, 6681, 162, 163, 'ZWAAAA', 'YECAAA', 'AAAAxx'),
+(4983, 1481, 1, 3, 3, 3, 83, 983, 983, 4983, 4983, 166, 167, 'RJAAAA', 'ZECAAA', 'HHHHxx'),
+(7149, 1482, 1, 1, 9, 9, 49, 149, 1149, 2149, 7149, 98, 99, 'ZOAAAA', 'AFCAAA', 'OOOOxx'),
+(3502, 1483, 0, 2, 2, 2, 2, 502, 1502, 3502, 3502, 4, 5, 'SEAAAA', 'BFCAAA', 'VVVVxx'),
+(3133, 1484, 1, 1, 3, 13, 33, 133, 1133, 3133, 3133, 66, 67, 'NQAAAA', 'CFCAAA', 'AAAAxx'),
+(8342, 1485, 0, 2, 2, 2, 42, 342, 342, 3342, 8342, 84, 85, 'WIAAAA', 'DFCAAA', 'HHHHxx'),
+(3041, 1486, 1, 1, 1, 1, 41, 41, 1041, 3041, 3041, 82, 83, 'ZMAAAA', 'EFCAAA', 'OOOOxx'),
+(5383, 1487, 1, 3, 3, 3, 83, 383, 1383, 383, 5383, 166, 167, 'BZAAAA', 'FFCAAA', 'VVVVxx'),
+(3916, 1488, 0, 0, 6, 16, 16, 916, 1916, 3916, 3916, 32, 33, 'QUAAAA', 'GFCAAA', 'AAAAxx'),
+(1438, 1489, 0, 2, 8, 18, 38, 438, 1438, 1438, 1438, 76, 77, 'IDAAAA', 'HFCAAA', 'HHHHxx'),
+(9408, 1490, 0, 0, 8, 8, 8, 408, 1408, 4408, 9408, 16, 17, 'WXAAAA', 'IFCAAA', 'OOOOxx'),
+(5783, 1491, 1, 3, 3, 3, 83, 783, 1783, 783, 5783, 166, 167, 'LOAAAA', 'JFCAAA', 'VVVVxx'),
+(683, 1492, 1, 3, 3, 3, 83, 683, 683, 683, 683, 166, 167, 'HAAAAA', 'KFCAAA', 'AAAAxx'),
+(9381, 1493, 1, 1, 1, 1, 81, 381, 1381, 4381, 9381, 162, 163, 'VWAAAA', 'LFCAAA', 'HHHHxx'),
+(5676, 1494, 0, 0, 6, 16, 76, 676, 1676, 676, 5676, 152, 153, 'IKAAAA', 'MFCAAA', 'OOOOxx'),
+(3224, 1495, 0, 0, 4, 4, 24, 224, 1224, 3224, 3224, 48, 49, 'AUAAAA', 'NFCAAA', 'VVVVxx'),
+(8332, 1496, 0, 0, 2, 12, 32, 332, 332, 3332, 8332, 64, 65, 'MIAAAA', 'OFCAAA', 'AAAAxx'),
+(3372, 1497, 0, 0, 2, 12, 72, 372, 1372, 3372, 3372, 144, 145, 'SZAAAA', 'PFCAAA', 'HHHHxx'),
+(7436, 1498, 0, 0, 6, 16, 36, 436, 1436, 2436, 7436, 72, 73, 'AAAAAA', 'QFCAAA', 'OOOOxx'),
+(5010, 1499, 0, 2, 0, 10, 10, 10, 1010, 10, 5010, 20, 21, 'SKAAAA', 'RFCAAA', 'VVVVxx'),
+(7256, 1500, 0, 0, 6, 16, 56, 256, 1256, 2256, 7256, 112, 113, 'CTAAAA', 'SFCAAA', 'AAAAxx'),
+(961, 1501, 1, 1, 1, 1, 61, 961, 961, 961, 961, 122, 123, 'ZKAAAA', 'TFCAAA', 'HHHHxx'),
+(4182, 1502, 0, 2, 2, 2, 82, 182, 182, 4182, 4182, 164, 165, 'WEAAAA', 'UFCAAA', 'OOOOxx'),
+(639, 1503, 1, 3, 9, 19, 39, 639, 639, 639, 639, 78, 79, 'PYAAAA', 'VFCAAA', 'VVVVxx'),
+(8836, 1504, 0, 0, 6, 16, 36, 836, 836, 3836, 8836, 72, 73, 'WBAAAA', 'WFCAAA', 'AAAAxx'),
+(8705, 1505, 1, 1, 5, 5, 5, 705, 705, 3705, 8705, 10, 11, 'VWAAAA', 'XFCAAA', 'HHHHxx'),
+(32, 1506, 0, 0, 2, 12, 32, 32, 32, 32, 32, 64, 65, 'GBAAAA', 'YFCAAA', 'OOOOxx'),
+(7913, 1507, 1, 1, 3, 13, 13, 913, 1913, 2913, 7913, 26, 27, 'JSAAAA', 'ZFCAAA', 'VVVVxx'),
+(229, 1508, 1, 1, 9, 9, 29, 229, 229, 229, 229, 58, 59, 'VIAAAA', 'AGCAAA', 'AAAAxx'),
+(2393, 1509, 1, 1, 3, 13, 93, 393, 393, 2393, 2393, 186, 187, 'BOAAAA', 'BGCAAA', 'HHHHxx'),
+(2815, 1510, 1, 3, 5, 15, 15, 815, 815, 2815, 2815, 30, 31, 'HEAAAA', 'CGCAAA', 'OOOOxx'),
+(4858, 1511, 0, 2, 8, 18, 58, 858, 858, 4858, 4858, 116, 117, 'WEAAAA', 'DGCAAA', 'VVVVxx'),
+(6283, 1512, 1, 3, 3, 3, 83, 283, 283, 1283, 6283, 166, 167, 'RHAAAA', 'EGCAAA', 'AAAAxx'),
+(4147, 1513, 1, 3, 7, 7, 47, 147, 147, 4147, 4147, 94, 95, 'NDAAAA', 'FGCAAA', 'HHHHxx'),
+(6801, 1514, 1, 1, 1, 1, 1, 801, 801, 1801, 6801, 2, 3, 'PBAAAA', 'GGCAAA', 'OOOOxx'),
+(1011, 1515, 1, 3, 1, 11, 11, 11, 1011, 1011, 1011, 22, 23, 'XMAAAA', 'HGCAAA', 'VVVVxx'),
+(2527, 1516, 1, 3, 7, 7, 27, 527, 527, 2527, 2527, 54, 55, 'FTAAAA', 'IGCAAA', 'AAAAxx'),
+(381, 1517, 1, 1, 1, 1, 81, 381, 381, 381, 381, 162, 163, 'ROAAAA', 'JGCAAA', 'HHHHxx'),
+(3366, 1518, 0, 2, 6, 6, 66, 366, 1366, 3366, 3366, 132, 133, 'MZAAAA', 'KGCAAA', 'OOOOxx'),
+(9636, 1519, 0, 0, 6, 16, 36, 636, 1636, 4636, 9636, 72, 73, 'QGAAAA', 'LGCAAA', 'VVVVxx'),
+(2239, 1520, 1, 3, 9, 19, 39, 239, 239, 2239, 2239, 78, 79, 'DIAAAA', 'MGCAAA', 'AAAAxx'),
+(5911, 1521, 1, 3, 1, 11, 11, 911, 1911, 911, 5911, 22, 23, 'JTAAAA', 'NGCAAA', 'HHHHxx'),
+(449, 1522, 1, 1, 9, 9, 49, 449, 449, 449, 449, 98, 99, 'HRAAAA', 'OGCAAA', 'OOOOxx'),
+(5118, 1523, 0, 2, 8, 18, 18, 118, 1118, 118, 5118, 36, 37, 'WOAAAA', 'PGCAAA', 'VVVVxx'),
+(7684, 1524, 0, 0, 4, 4, 84, 684, 1684, 2684, 7684, 168, 169, 'OJAAAA', 'QGCAAA', 'AAAAxx'),
+(804, 1525, 0, 0, 4, 4, 4, 804, 804, 804, 804, 8, 9, 'YEAAAA', 'RGCAAA', 'HHHHxx'),
+(8378, 1526, 0, 2, 8, 18, 78, 378, 378, 3378, 8378, 156, 157, 'GKAAAA', 'SGCAAA', 'OOOOxx'),
+(9855, 1527, 1, 3, 5, 15, 55, 855, 1855, 4855, 9855, 110, 111, 'BPAAAA', 'TGCAAA', 'VVVVxx'),
+(1995, 1528, 1, 3, 5, 15, 95, 995, 1995, 1995, 1995, 190, 191, 'TYAAAA', 'UGCAAA', 'AAAAxx'),
+(1979, 1529, 1, 3, 9, 19, 79, 979, 1979, 1979, 1979, 158, 159, 'DYAAAA', 'VGCAAA', 'HHHHxx'),
+(4510, 1530, 0, 2, 0, 10, 10, 510, 510, 4510, 4510, 20, 21, 'MRAAAA', 'WGCAAA', 'OOOOxx'),
+(3792, 1531, 0, 0, 2, 12, 92, 792, 1792, 3792, 3792, 184, 185, 'WPAAAA', 'XGCAAA', 'VVVVxx'),
+(3541, 1532, 1, 1, 1, 1, 41, 541, 1541, 3541, 3541, 82, 83, 'FGAAAA', 'YGCAAA', 'AAAAxx'),
+(8847, 1533, 1, 3, 7, 7, 47, 847, 847, 3847, 8847, 94, 95, 'HCAAAA', 'ZGCAAA', 'HHHHxx'),
+(1336, 1534, 0, 0, 6, 16, 36, 336, 1336, 1336, 1336, 72, 73, 'KZAAAA', 'AHCAAA', 'OOOOxx'),
+(6780, 1535, 0, 0, 0, 0, 80, 780, 780, 1780, 6780, 160, 161, 'UAAAAA', 'BHCAAA', 'VVVVxx'),
+(8711, 1536, 1, 3, 1, 11, 11, 711, 711, 3711, 8711, 22, 23, 'BXAAAA', 'CHCAAA', 'AAAAxx'),
+(7839, 1537, 1, 3, 9, 19, 39, 839, 1839, 2839, 7839, 78, 79, 'NPAAAA', 'DHCAAA', 'HHHHxx'),
+(677, 1538, 1, 1, 7, 17, 77, 677, 677, 677, 677, 154, 155, 'BAAAAA', 'EHCAAA', 'OOOOxx'),
+(1574, 1539, 0, 2, 4, 14, 74, 574, 1574, 1574, 1574, 148, 149, 'OIAAAA', 'FHCAAA', 'VVVVxx'),
+(2905, 1540, 1, 1, 5, 5, 5, 905, 905, 2905, 2905, 10, 11, 'THAAAA', 'GHCAAA', 'AAAAxx'),
+(1879, 1541, 1, 3, 9, 19, 79, 879, 1879, 1879, 1879, 158, 159, 'HUAAAA', 'HHCAAA', 'HHHHxx'),
+(7820, 1542, 0, 0, 0, 0, 20, 820, 1820, 2820, 7820, 40, 41, 'UOAAAA', 'IHCAAA', 'OOOOxx'),
+(4308, 1543, 0, 0, 8, 8, 8, 308, 308, 4308, 4308, 16, 17, 'SJAAAA', 'JHCAAA', 'VVVVxx'),
+(4474, 1544, 0, 2, 4, 14, 74, 474, 474, 4474, 4474, 148, 149, 'CQAAAA', 'KHCAAA', 'AAAAxx'),
+(6985, 1545, 1, 1, 5, 5, 85, 985, 985, 1985, 6985, 170, 171, 'RIAAAA', 'LHCAAA', 'HHHHxx'),
+(6929, 1546, 1, 1, 9, 9, 29, 929, 929, 1929, 6929, 58, 59, 'NGAAAA', 'MHCAAA', 'OOOOxx'),
+(777, 1547, 1, 1, 7, 17, 77, 777, 777, 777, 777, 154, 155, 'XDAAAA', 'NHCAAA', 'VVVVxx'),
+(8271, 1548, 1, 3, 1, 11, 71, 271, 271, 3271, 8271, 142, 143, 'DGAAAA', 'OHCAAA', 'AAAAxx'),
+(2389, 1549, 1, 1, 9, 9, 89, 389, 389, 2389, 2389, 178, 179, 'XNAAAA', 'PHCAAA', 'HHHHxx'),
+(946, 1550, 0, 2, 6, 6, 46, 946, 946, 946, 946, 92, 93, 'KKAAAA', 'QHCAAA', 'OOOOxx'),
+(9682, 1551, 0, 2, 2, 2, 82, 682, 1682, 4682, 9682, 164, 165, 'KIAAAA', 'RHCAAA', 'VVVVxx'),
+(8722, 1552, 0, 2, 2, 2, 22, 722, 722, 3722, 8722, 44, 45, 'MXAAAA', 'SHCAAA', 'AAAAxx'),
+(470, 1553, 0, 2, 0, 10, 70, 470, 470, 470, 470, 140, 141, 'CSAAAA', 'THCAAA', 'HHHHxx'),
+(7425, 1554, 1, 1, 5, 5, 25, 425, 1425, 2425, 7425, 50, 51, 'PZAAAA', 'UHCAAA', 'OOOOxx'),
+(2372, 1555, 0, 0, 2, 12, 72, 372, 372, 2372, 2372, 144, 145, 'GNAAAA', 'VHCAAA', 'VVVVxx'),
+(508, 1556, 0, 0, 8, 8, 8, 508, 508, 508, 508, 16, 17, 'OTAAAA', 'WHCAAA', 'AAAAxx'),
+(163, 1557, 1, 3, 3, 3, 63, 163, 163, 163, 163, 126, 127, 'HGAAAA', 'XHCAAA', 'HHHHxx'),
+(6579, 1558, 1, 3, 9, 19, 79, 579, 579, 1579, 6579, 158, 159, 'BTAAAA', 'YHCAAA', 'OOOOxx'),
+(2355, 1559, 1, 3, 5, 15, 55, 355, 355, 2355, 2355, 110, 111, 'PMAAAA', 'ZHCAAA', 'VVVVxx'),
+(70, 1560, 0, 2, 0, 10, 70, 70, 70, 70, 70, 140, 141, 'SCAAAA', 'AICAAA', 'AAAAxx'),
+(651, 1561, 1, 3, 1, 11, 51, 651, 651, 651, 651, 102, 103, 'BZAAAA', 'BICAAA', 'HHHHxx'),
+(4436, 1562, 0, 0, 6, 16, 36, 436, 436, 4436, 4436, 72, 73, 'QOAAAA', 'CICAAA', 'OOOOxx'),
+(4240, 1563, 0, 0, 0, 0, 40, 240, 240, 4240, 4240, 80, 81, 'CHAAAA', 'DICAAA', 'VVVVxx'),
+(2722, 1564, 0, 2, 2, 2, 22, 722, 722, 2722, 2722, 44, 45, 'SAAAAA', 'EICAAA', 'AAAAxx'),
+(8937, 1565, 1, 1, 7, 17, 37, 937, 937, 3937, 8937, 74, 75, 'TFAAAA', 'FICAAA', 'HHHHxx'),
+(8364, 1566, 0, 0, 4, 4, 64, 364, 364, 3364, 8364, 128, 129, 'SJAAAA', 'GICAAA', 'OOOOxx'),
+(8317, 1567, 1, 1, 7, 17, 17, 317, 317, 3317, 8317, 34, 35, 'XHAAAA', 'HICAAA', 'VVVVxx'),
+(8872, 1568, 0, 0, 2, 12, 72, 872, 872, 3872, 8872, 144, 145, 'GDAAAA', 'IICAAA', 'AAAAxx'),
+(5512, 1569, 0, 0, 2, 12, 12, 512, 1512, 512, 5512, 24, 25, 'AEAAAA', 'JICAAA', 'HHHHxx'),
+(6651, 1570, 1, 3, 1, 11, 51, 651, 651, 1651, 6651, 102, 103, 'VVAAAA', 'KICAAA', 'OOOOxx'),
+(5976, 1571, 0, 0, 6, 16, 76, 976, 1976, 976, 5976, 152, 153, 'WVAAAA', 'LICAAA', 'VVVVxx'),
+(3301, 1572, 1, 1, 1, 1, 1, 301, 1301, 3301, 3301, 2, 3, 'ZWAAAA', 'MICAAA', 'AAAAxx'),
+(6784, 1573, 0, 0, 4, 4, 84, 784, 784, 1784, 6784, 168, 169, 'YAAAAA', 'NICAAA', 'HHHHxx'),
+(573, 1574, 1, 1, 3, 13, 73, 573, 573, 573, 573, 146, 147, 'BWAAAA', 'OICAAA', 'OOOOxx'),
+(3015, 1575, 1, 3, 5, 15, 15, 15, 1015, 3015, 3015, 30, 31, 'ZLAAAA', 'PICAAA', 'VVVVxx'),
+(8245, 1576, 1, 1, 5, 5, 45, 245, 245, 3245, 8245, 90, 91, 'DFAAAA', 'QICAAA', 'AAAAxx'),
+(5251, 1577, 1, 3, 1, 11, 51, 251, 1251, 251, 5251, 102, 103, 'ZTAAAA', 'RICAAA', 'HHHHxx'),
+(2281, 1578, 1, 1, 1, 1, 81, 281, 281, 2281, 2281, 162, 163, 'TJAAAA', 'SICAAA', 'OOOOxx'),
+(518, 1579, 0, 2, 8, 18, 18, 518, 518, 518, 518, 36, 37, 'YTAAAA', 'TICAAA', 'VVVVxx'),
+(9839, 1580, 1, 3, 9, 19, 39, 839, 1839, 4839, 9839, 78, 79, 'LOAAAA', 'UICAAA', 'AAAAxx'),
+(4526, 1581, 0, 2, 6, 6, 26, 526, 526, 4526, 4526, 52, 53, 'CSAAAA', 'VICAAA', 'HHHHxx'),
+(1261, 1582, 1, 1, 1, 1, 61, 261, 1261, 1261, 1261, 122, 123, 'NWAAAA', 'WICAAA', 'OOOOxx'),
+(4259, 1583, 1, 3, 9, 19, 59, 259, 259, 4259, 4259, 118, 119, 'VHAAAA', 'XICAAA', 'VVVVxx'),
+(9098, 1584, 0, 2, 8, 18, 98, 98, 1098, 4098, 9098, 196, 197, 'YLAAAA', 'YICAAA', 'AAAAxx'),
+(6037, 1585, 1, 1, 7, 17, 37, 37, 37, 1037, 6037, 74, 75, 'FYAAAA', 'ZICAAA', 'HHHHxx'),
+(4284, 1586, 0, 0, 4, 4, 84, 284, 284, 4284, 4284, 168, 169, 'UIAAAA', 'AJCAAA', 'OOOOxx'),
+(3267, 1587, 1, 3, 7, 7, 67, 267, 1267, 3267, 3267, 134, 135, 'RVAAAA', 'BJCAAA', 'VVVVxx'),
+(5908, 1588, 0, 0, 8, 8, 8, 908, 1908, 908, 5908, 16, 17, 'GTAAAA', 'CJCAAA', 'AAAAxx'),
+(1549, 1589, 1, 1, 9, 9, 49, 549, 1549, 1549, 1549, 98, 99, 'PHAAAA', 'DJCAAA', 'HHHHxx'),
+(8736, 1590, 0, 0, 6, 16, 36, 736, 736, 3736, 8736, 72, 73, 'AYAAAA', 'EJCAAA', 'OOOOxx'),
+(2008, 1591, 0, 0, 8, 8, 8, 8, 8, 2008, 2008, 16, 17, 'GZAAAA', 'FJCAAA', 'VVVVxx'),
+(548, 1592, 0, 0, 8, 8, 48, 548, 548, 548, 548, 96, 97, 'CVAAAA', 'GJCAAA', 'AAAAxx'),
+(8846, 1593, 0, 2, 6, 6, 46, 846, 846, 3846, 8846, 92, 93, 'GCAAAA', 'HJCAAA', 'HHHHxx'),
+(8374, 1594, 0, 2, 4, 14, 74, 374, 374, 3374, 8374, 148, 149, 'CKAAAA', 'IJCAAA', 'OOOOxx'),
+(7986, 1595, 0, 2, 6, 6, 86, 986, 1986, 2986, 7986, 172, 173, 'EVAAAA', 'JJCAAA', 'VVVVxx'),
+(6819, 1596, 1, 3, 9, 19, 19, 819, 819, 1819, 6819, 38, 39, 'HCAAAA', 'KJCAAA', 'AAAAxx'),
+(4418, 1597, 0, 2, 8, 18, 18, 418, 418, 4418, 4418, 36, 37, 'YNAAAA', 'LJCAAA', 'HHHHxx'),
+(833, 1598, 1, 1, 3, 13, 33, 833, 833, 833, 833, 66, 67, 'BGAAAA', 'MJCAAA', 'OOOOxx'),
+(4416, 1599, 0, 0, 6, 16, 16, 416, 416, 4416, 4416, 32, 33, 'WNAAAA', 'NJCAAA', 'VVVVxx'),
+(4902, 1600, 0, 2, 2, 2, 2, 902, 902, 4902, 4902, 4, 5, 'OGAAAA', 'OJCAAA', 'AAAAxx'),
+(6828, 1601, 0, 0, 8, 8, 28, 828, 828, 1828, 6828, 56, 57, 'QCAAAA', 'PJCAAA', 'HHHHxx'),
+(1118, 1602, 0, 2, 8, 18, 18, 118, 1118, 1118, 1118, 36, 37, 'ARAAAA', 'QJCAAA', 'OOOOxx'),
+(9993, 1603, 1, 1, 3, 13, 93, 993, 1993, 4993, 9993, 186, 187, 'JUAAAA', 'RJCAAA', 'VVVVxx'),
+(1430, 1604, 0, 2, 0, 10, 30, 430, 1430, 1430, 1430, 60, 61, 'ADAAAA', 'SJCAAA', 'AAAAxx'),
+(5670, 1605, 0, 2, 0, 10, 70, 670, 1670, 670, 5670, 140, 141, 'CKAAAA', 'TJCAAA', 'HHHHxx'),
+(5424, 1606, 0, 0, 4, 4, 24, 424, 1424, 424, 5424, 48, 49, 'QAAAAA', 'UJCAAA', 'OOOOxx'),
+(5561, 1607, 1, 1, 1, 1, 61, 561, 1561, 561, 5561, 122, 123, 'XFAAAA', 'VJCAAA', 'VVVVxx'),
+(2027, 1608, 1, 3, 7, 7, 27, 27, 27, 2027, 2027, 54, 55, 'ZZAAAA', 'WJCAAA', 'AAAAxx'),
+(6924, 1609, 0, 0, 4, 4, 24, 924, 924, 1924, 6924, 48, 49, 'IGAAAA', 'XJCAAA', 'HHHHxx'),
+(5946, 1610, 0, 2, 6, 6, 46, 946, 1946, 946, 5946, 92, 93, 'SUAAAA', 'YJCAAA', 'OOOOxx'),
+(4294, 1611, 0, 2, 4, 14, 94, 294, 294, 4294, 4294, 188, 189, 'EJAAAA', 'ZJCAAA', 'VVVVxx'),
+(2936, 1612, 0, 0, 6, 16, 36, 936, 936, 2936, 2936, 72, 73, 'YIAAAA', 'AKCAAA', 'AAAAxx'),
+(3855, 1613, 1, 3, 5, 15, 55, 855, 1855, 3855, 3855, 110, 111, 'HSAAAA', 'BKCAAA', 'HHHHxx'),
+(455, 1614, 1, 3, 5, 15, 55, 455, 455, 455, 455, 110, 111, 'NRAAAA', 'CKCAAA', 'OOOOxx'),
+(2918, 1615, 0, 2, 8, 18, 18, 918, 918, 2918, 2918, 36, 37, 'GIAAAA', 'DKCAAA', 'VVVVxx'),
+(448, 1616, 0, 0, 8, 8, 48, 448, 448, 448, 448, 96, 97, 'GRAAAA', 'EKCAAA', 'AAAAxx'),
+(2149, 1617, 1, 1, 9, 9, 49, 149, 149, 2149, 2149, 98, 99, 'REAAAA', 'FKCAAA', 'HHHHxx'),
+(8890, 1618, 0, 2, 0, 10, 90, 890, 890, 3890, 8890, 180, 181, 'YDAAAA', 'GKCAAA', 'OOOOxx'),
+(8919, 1619, 1, 3, 9, 19, 19, 919, 919, 3919, 8919, 38, 39, 'BFAAAA', 'HKCAAA', 'VVVVxx'),
+(4957, 1620, 1, 1, 7, 17, 57, 957, 957, 4957, 4957, 114, 115, 'RIAAAA', 'IKCAAA', 'AAAAxx'),
+(4, 1621, 0, 0, 4, 4, 4, 4, 4, 4, 4, 8, 9, 'EAAAAA', 'JKCAAA', 'HHHHxx'),
+(4837, 1622, 1, 1, 7, 17, 37, 837, 837, 4837, 4837, 74, 75, 'BEAAAA', 'KKCAAA', 'OOOOxx'),
+(3976, 1623, 0, 0, 6, 16, 76, 976, 1976, 3976, 3976, 152, 153, 'YWAAAA', 'LKCAAA', 'VVVVxx'),
+(9459, 1624, 1, 3, 9, 19, 59, 459, 1459, 4459, 9459, 118, 119, 'VZAAAA', 'MKCAAA', 'AAAAxx'),
+(7097, 1625, 1, 1, 7, 17, 97, 97, 1097, 2097, 7097, 194, 195, 'ZMAAAA', 'NKCAAA', 'HHHHxx'),
+(9226, 1626, 0, 2, 6, 6, 26, 226, 1226, 4226, 9226, 52, 53, 'WQAAAA', 'OKCAAA', 'OOOOxx'),
+(5803, 1627, 1, 3, 3, 3, 3, 803, 1803, 803, 5803, 6, 7, 'FPAAAA', 'PKCAAA', 'VVVVxx'),
+(21, 1628, 1, 1, 1, 1, 21, 21, 21, 21, 21, 42, 43, 'VAAAAA', 'QKCAAA', 'AAAAxx'),
+(5275, 1629, 1, 3, 5, 15, 75, 275, 1275, 275, 5275, 150, 151, 'XUAAAA', 'RKCAAA', 'HHHHxx'),
+(3488, 1630, 0, 0, 8, 8, 88, 488, 1488, 3488, 3488, 176, 177, 'EEAAAA', 'SKCAAA', 'OOOOxx'),
+(1595, 1631, 1, 3, 5, 15, 95, 595, 1595, 1595, 1595, 190, 191, 'JJAAAA', 'TKCAAA', 'VVVVxx'),
+(5212, 1632, 0, 0, 2, 12, 12, 212, 1212, 212, 5212, 24, 25, 'MSAAAA', 'UKCAAA', 'AAAAxx'),
+(6574, 1633, 0, 2, 4, 14, 74, 574, 574, 1574, 6574, 148, 149, 'WSAAAA', 'VKCAAA', 'HHHHxx'),
+(7524, 1634, 0, 0, 4, 4, 24, 524, 1524, 2524, 7524, 48, 49, 'KDAAAA', 'WKCAAA', 'OOOOxx'),
+(6100, 1635, 0, 0, 0, 0, 0, 100, 100, 1100, 6100, 0, 1, 'QAAAAA', 'XKCAAA', 'VVVVxx'),
+(1198, 1636, 0, 2, 8, 18, 98, 198, 1198, 1198, 1198, 196, 197, 'CUAAAA', 'YKCAAA', 'AAAAxx'),
+(7345, 1637, 1, 1, 5, 5, 45, 345, 1345, 2345, 7345, 90, 91, 'NWAAAA', 'ZKCAAA', 'HHHHxx'),
+(5020, 1638, 0, 0, 0, 0, 20, 20, 1020, 20, 5020, 40, 41, 'CLAAAA', 'ALCAAA', 'OOOOxx'),
+(6925, 1639, 1, 1, 5, 5, 25, 925, 925, 1925, 6925, 50, 51, 'JGAAAA', 'BLCAAA', 'VVVVxx'),
+(8915, 1640, 1, 3, 5, 15, 15, 915, 915, 3915, 8915, 30, 31, 'XEAAAA', 'CLCAAA', 'AAAAxx'),
+(3088, 1641, 0, 0, 8, 8, 88, 88, 1088, 3088, 3088, 176, 177, 'UOAAAA', 'DLCAAA', 'HHHHxx'),
+(4828, 1642, 0, 0, 8, 8, 28, 828, 828, 4828, 4828, 56, 57, 'SDAAAA', 'ELCAAA', 'OOOOxx'),
+(7276, 1643, 0, 0, 6, 16, 76, 276, 1276, 2276, 7276, 152, 153, 'WTAAAA', 'FLCAAA', 'VVVVxx'),
+(299, 1644, 1, 3, 9, 19, 99, 299, 299, 299, 299, 198, 199, 'NLAAAA', 'GLCAAA', 'AAAAxx'),
+(76, 1645, 0, 0, 6, 16, 76, 76, 76, 76, 76, 152, 153, 'YCAAAA', 'HLCAAA', 'HHHHxx'),
+(8458, 1646, 0, 2, 8, 18, 58, 458, 458, 3458, 8458, 116, 117, 'INAAAA', 'ILCAAA', 'OOOOxx'),
+(7207, 1647, 1, 3, 7, 7, 7, 207, 1207, 2207, 7207, 14, 15, 'FRAAAA', 'JLCAAA', 'VVVVxx'),
+(5585, 1648, 1, 1, 5, 5, 85, 585, 1585, 585, 5585, 170, 171, 'VGAAAA', 'KLCAAA', 'AAAAxx'),
+(3234, 1649, 0, 2, 4, 14, 34, 234, 1234, 3234, 3234, 68, 69, 'KUAAAA', 'LLCAAA', 'HHHHxx'),
+(8001, 1650, 1, 1, 1, 1, 1, 1, 1, 3001, 8001, 2, 3, 'TVAAAA', 'MLCAAA', 'OOOOxx'),
+(1319, 1651, 1, 3, 9, 19, 19, 319, 1319, 1319, 1319, 38, 39, 'TYAAAA', 'NLCAAA', 'VVVVxx'),
+(6342, 1652, 0, 2, 2, 2, 42, 342, 342, 1342, 6342, 84, 85, 'YJAAAA', 'OLCAAA', 'AAAAxx'),
+(9199, 1653, 1, 3, 9, 19, 99, 199, 1199, 4199, 9199, 198, 199, 'VPAAAA', 'PLCAAA', 'HHHHxx'),
+(5696, 1654, 0, 0, 6, 16, 96, 696, 1696, 696, 5696, 192, 193, 'CLAAAA', 'QLCAAA', 'OOOOxx'),
+(2562, 1655, 0, 2, 2, 2, 62, 562, 562, 2562, 2562, 124, 125, 'OUAAAA', 'RLCAAA', 'VVVVxx'),
+(4226, 1656, 0, 2, 6, 6, 26, 226, 226, 4226, 4226, 52, 53, 'OGAAAA', 'SLCAAA', 'AAAAxx'),
+(1184, 1657, 0, 0, 4, 4, 84, 184, 1184, 1184, 1184, 168, 169, 'OTAAAA', 'TLCAAA', 'HHHHxx'),
+(5807, 1658, 1, 3, 7, 7, 7, 807, 1807, 807, 5807, 14, 15, 'JPAAAA', 'ULCAAA', 'OOOOxx'),
+(1890, 1659, 0, 2, 0, 10, 90, 890, 1890, 1890, 1890, 180, 181, 'SUAAAA', 'VLCAAA', 'VVVVxx'),
+(451, 1660, 1, 3, 1, 11, 51, 451, 451, 451, 451, 102, 103, 'JRAAAA', 'WLCAAA', 'AAAAxx'),
+(1049, 1661, 1, 1, 9, 9, 49, 49, 1049, 1049, 1049, 98, 99, 'JOAAAA', 'XLCAAA', 'HHHHxx'),
+(5272, 1662, 0, 0, 2, 12, 72, 272, 1272, 272, 5272, 144, 145, 'UUAAAA', 'YLCAAA', 'OOOOxx'),
+(4588, 1663, 0, 0, 8, 8, 88, 588, 588, 4588, 4588, 176, 177, 'MUAAAA', 'ZLCAAA', 'VVVVxx'),
+(5213, 1664, 1, 1, 3, 13, 13, 213, 1213, 213, 5213, 26, 27, 'NSAAAA', 'AMCAAA', 'AAAAxx'),
+(9543, 1665, 1, 3, 3, 3, 43, 543, 1543, 4543, 9543, 86, 87, 'BDAAAA', 'BMCAAA', 'HHHHxx'),
+(6318, 1666, 0, 2, 8, 18, 18, 318, 318, 1318, 6318, 36, 37, 'AJAAAA', 'CMCAAA', 'OOOOxx'),
+(7992, 1667, 0, 0, 2, 12, 92, 992, 1992, 2992, 7992, 184, 185, 'KVAAAA', 'DMCAAA', 'VVVVxx'),
+(4619, 1668, 1, 3, 9, 19, 19, 619, 619, 4619, 4619, 38, 39, 'RVAAAA', 'EMCAAA', 'AAAAxx'),
+(7189, 1669, 1, 1, 9, 9, 89, 189, 1189, 2189, 7189, 178, 179, 'NQAAAA', 'FMCAAA', 'HHHHxx'),
+(2178, 1670, 0, 2, 8, 18, 78, 178, 178, 2178, 2178, 156, 157, 'UFAAAA', 'GMCAAA', 'OOOOxx'),
+(4928, 1671, 0, 0, 8, 8, 28, 928, 928, 4928, 4928, 56, 57, 'OHAAAA', 'HMCAAA', 'VVVVxx'),
+(3966, 1672, 0, 2, 6, 6, 66, 966, 1966, 3966, 3966, 132, 133, 'OWAAAA', 'IMCAAA', 'AAAAxx'),
+(9790, 1673, 0, 2, 0, 10, 90, 790, 1790, 4790, 9790, 180, 181, 'OMAAAA', 'JMCAAA', 'HHHHxx'),
+(9150, 1674, 0, 2, 0, 10, 50, 150, 1150, 4150, 9150, 100, 101, 'YNAAAA', 'KMCAAA', 'OOOOxx'),
+(313, 1675, 1, 1, 3, 13, 13, 313, 313, 313, 313, 26, 27, 'BMAAAA', 'LMCAAA', 'VVVVxx'),
+(1614, 1676, 0, 2, 4, 14, 14, 614, 1614, 1614, 1614, 28, 29, 'CKAAAA', 'MMCAAA', 'AAAAxx'),
+(1581, 1677, 1, 1, 1, 1, 81, 581, 1581, 1581, 1581, 162, 163, 'VIAAAA', 'NMCAAA', 'HHHHxx'),
+(3674, 1678, 0, 2, 4, 14, 74, 674, 1674, 3674, 3674, 148, 149, 'ILAAAA', 'OMCAAA', 'OOOOxx'),
+(3444, 1679, 0, 0, 4, 4, 44, 444, 1444, 3444, 3444, 88, 89, 'MCAAAA', 'PMCAAA', 'VVVVxx'),
+(1050, 1680, 0, 2, 0, 10, 50, 50, 1050, 1050, 1050, 100, 101, 'KOAAAA', 'QMCAAA', 'AAAAxx'),
+(8241, 1681, 1, 1, 1, 1, 41, 241, 241, 3241, 8241, 82, 83, 'ZEAAAA', 'RMCAAA', 'HHHHxx'),
+(3382, 1682, 0, 2, 2, 2, 82, 382, 1382, 3382, 3382, 164, 165, 'CAAAAA', 'SMCAAA', 'OOOOxx'),
+(7105, 1683, 1, 1, 5, 5, 5, 105, 1105, 2105, 7105, 10, 11, 'HNAAAA', 'TMCAAA', 'VVVVxx'),
+(2957, 1684, 1, 1, 7, 17, 57, 957, 957, 2957, 2957, 114, 115, 'TJAAAA', 'UMCAAA', 'AAAAxx'),
+(6162, 1685, 0, 2, 2, 2, 62, 162, 162, 1162, 6162, 124, 125, 'ADAAAA', 'VMCAAA', 'HHHHxx'),
+(5150, 1686, 0, 2, 0, 10, 50, 150, 1150, 150, 5150, 100, 101, 'CQAAAA', 'WMCAAA', 'OOOOxx'),
+(2622, 1687, 0, 2, 2, 2, 22, 622, 622, 2622, 2622, 44, 45, 'WWAAAA', 'XMCAAA', 'VVVVxx'),
+(2240, 1688, 0, 0, 0, 0, 40, 240, 240, 2240, 2240, 80, 81, 'EIAAAA', 'YMCAAA', 'AAAAxx'),
+(8880, 1689, 0, 0, 0, 0, 80, 880, 880, 3880, 8880, 160, 161, 'ODAAAA', 'ZMCAAA', 'HHHHxx'),
+(9250, 1690, 0, 2, 0, 10, 50, 250, 1250, 4250, 9250, 100, 101, 'URAAAA', 'ANCAAA', 'OOOOxx'),
+(7010, 1691, 0, 2, 0, 10, 10, 10, 1010, 2010, 7010, 20, 21, 'QJAAAA', 'BNCAAA', 'VVVVxx'),
+(1098, 1692, 0, 2, 8, 18, 98, 98, 1098, 1098, 1098, 196, 197, 'GQAAAA', 'CNCAAA', 'AAAAxx'),
+(648, 1693, 0, 0, 8, 8, 48, 648, 648, 648, 648, 96, 97, 'YYAAAA', 'DNCAAA', 'HHHHxx'),
+(5536, 1694, 0, 0, 6, 16, 36, 536, 1536, 536, 5536, 72, 73, 'YEAAAA', 'ENCAAA', 'OOOOxx'),
+(7858, 1695, 0, 2, 8, 18, 58, 858, 1858, 2858, 7858, 116, 117, 'GQAAAA', 'FNCAAA', 'VVVVxx'),
+(7053, 1696, 1, 1, 3, 13, 53, 53, 1053, 2053, 7053, 106, 107, 'HLAAAA', 'GNCAAA', 'AAAAxx'),
+(8681, 1697, 1, 1, 1, 1, 81, 681, 681, 3681, 8681, 162, 163, 'XVAAAA', 'HNCAAA', 'HHHHxx'),
+(8832, 1698, 0, 0, 2, 12, 32, 832, 832, 3832, 8832, 64, 65, 'SBAAAA', 'INCAAA', 'OOOOxx'),
+(6836, 1699, 0, 0, 6, 16, 36, 836, 836, 1836, 6836, 72, 73, 'YCAAAA', 'JNCAAA', 'VVVVxx'),
+(4856, 1700, 0, 0, 6, 16, 56, 856, 856, 4856, 4856, 112, 113, 'UEAAAA', 'KNCAAA', 'AAAAxx'),
+(345, 1701, 1, 1, 5, 5, 45, 345, 345, 345, 345, 90, 91, 'HNAAAA', 'LNCAAA', 'HHHHxx'),
+(6559, 1702, 1, 3, 9, 19, 59, 559, 559, 1559, 6559, 118, 119, 'HSAAAA', 'MNCAAA', 'OOOOxx'),
+(3017, 1703, 1, 1, 7, 17, 17, 17, 1017, 3017, 3017, 34, 35, 'BMAAAA', 'NNCAAA', 'VVVVxx'),
+(4176, 1704, 0, 0, 6, 16, 76, 176, 176, 4176, 4176, 152, 153, 'QEAAAA', 'ONCAAA', 'AAAAxx'),
+(2839, 1705, 1, 3, 9, 19, 39, 839, 839, 2839, 2839, 78, 79, 'FFAAAA', 'PNCAAA', 'HHHHxx'),
+(6065, 1706, 1, 1, 5, 5, 65, 65, 65, 1065, 6065, 130, 131, 'HZAAAA', 'QNCAAA', 'OOOOxx'),
+(7360, 1707, 0, 0, 0, 0, 60, 360, 1360, 2360, 7360, 120, 121, 'CXAAAA', 'RNCAAA', 'VVVVxx'),
+(9527, 1708, 1, 3, 7, 7, 27, 527, 1527, 4527, 9527, 54, 55, 'LCAAAA', 'SNCAAA', 'AAAAxx'),
+(8849, 1709, 1, 1, 9, 9, 49, 849, 849, 3849, 8849, 98, 99, 'JCAAAA', 'TNCAAA', 'HHHHxx'),
+(7274, 1710, 0, 2, 4, 14, 74, 274, 1274, 2274, 7274, 148, 149, 'UTAAAA', 'UNCAAA', 'OOOOxx'),
+(4368, 1711, 0, 0, 8, 8, 68, 368, 368, 4368, 4368, 136, 137, 'AMAAAA', 'VNCAAA', 'VVVVxx'),
+(2488, 1712, 0, 0, 8, 8, 88, 488, 488, 2488, 2488, 176, 177, 'SRAAAA', 'WNCAAA', 'AAAAxx'),
+(4674, 1713, 0, 2, 4, 14, 74, 674, 674, 4674, 4674, 148, 149, 'UXAAAA', 'XNCAAA', 'HHHHxx'),
+(365, 1714, 1, 1, 5, 5, 65, 365, 365, 365, 365, 130, 131, 'BOAAAA', 'YNCAAA', 'OOOOxx'),
+(5897, 1715, 1, 1, 7, 17, 97, 897, 1897, 897, 5897, 194, 195, 'VSAAAA', 'ZNCAAA', 'VVVVxx'),
+(8918, 1716, 0, 2, 8, 18, 18, 918, 918, 3918, 8918, 36, 37, 'AFAAAA', 'AOCAAA', 'AAAAxx'),
+(1988, 1717, 0, 0, 8, 8, 88, 988, 1988, 1988, 1988, 176, 177, 'MYAAAA', 'BOCAAA', 'HHHHxx'),
+(1210, 1718, 0, 2, 0, 10, 10, 210, 1210, 1210, 1210, 20, 21, 'OUAAAA', 'COCAAA', 'OOOOxx'),
+(2945, 1719, 1, 1, 5, 5, 45, 945, 945, 2945, 2945, 90, 91, 'HJAAAA', 'DOCAAA', 'VVVVxx'),
+(555, 1720, 1, 3, 5, 15, 55, 555, 555, 555, 555, 110, 111, 'JVAAAA', 'EOCAAA', 'AAAAxx'),
+(9615, 1721, 1, 3, 5, 15, 15, 615, 1615, 4615, 9615, 30, 31, 'VFAAAA', 'FOCAAA', 'HHHHxx'),
+(9939, 1722, 1, 3, 9, 19, 39, 939, 1939, 4939, 9939, 78, 79, 'HSAAAA', 'GOCAAA', 'OOOOxx'),
+(1216, 1723, 0, 0, 6, 16, 16, 216, 1216, 1216, 1216, 32, 33, 'UUAAAA', 'HOCAAA', 'VVVVxx'),
+(745, 1724, 1, 1, 5, 5, 45, 745, 745, 745, 745, 90, 91, 'RCAAAA', 'IOCAAA', 'AAAAxx'),
+(3326, 1725, 0, 2, 6, 6, 26, 326, 1326, 3326, 3326, 52, 53, 'YXAAAA', 'JOCAAA', 'HHHHxx'),
+(953, 1726, 1, 1, 3, 13, 53, 953, 953, 953, 953, 106, 107, 'RKAAAA', 'KOCAAA', 'OOOOxx'),
+(444, 1727, 0, 0, 4, 4, 44, 444, 444, 444, 444, 88, 89, 'CRAAAA', 'LOCAAA', 'VVVVxx'),
+(280, 1728, 0, 0, 0, 0, 80, 280, 280, 280, 280, 160, 161, 'UKAAAA', 'MOCAAA', 'AAAAxx'),
+(3707, 1729, 1, 3, 7, 7, 7, 707, 1707, 3707, 3707, 14, 15, 'PMAAAA', 'NOCAAA', 'HHHHxx'),
+(1351, 1730, 1, 3, 1, 11, 51, 351, 1351, 1351, 1351, 102, 103, 'ZZAAAA', 'OOCAAA', 'OOOOxx'),
+(1280, 1731, 0, 0, 0, 0, 80, 280, 1280, 1280, 1280, 160, 161, 'GXAAAA', 'POCAAA', 'VVVVxx'),
+(628, 1732, 0, 0, 8, 8, 28, 628, 628, 628, 628, 56, 57, 'EYAAAA', 'QOCAAA', 'AAAAxx'),
+(6198, 1733, 0, 2, 8, 18, 98, 198, 198, 1198, 6198, 196, 197, 'KEAAAA', 'ROCAAA', 'HHHHxx'),
+(1957, 1734, 1, 1, 7, 17, 57, 957, 1957, 1957, 1957, 114, 115, 'HXAAAA', 'SOCAAA', 'OOOOxx'),
+(9241, 1735, 1, 1, 1, 1, 41, 241, 1241, 4241, 9241, 82, 83, 'LRAAAA', 'TOCAAA', 'VVVVxx'),
+(303, 1736, 1, 3, 3, 3, 3, 303, 303, 303, 303, 6, 7, 'RLAAAA', 'UOCAAA', 'AAAAxx'),
+(1945, 1737, 1, 1, 5, 5, 45, 945, 1945, 1945, 1945, 90, 91, 'VWAAAA', 'VOCAAA', 'HHHHxx'),
+(3634, 1738, 0, 2, 4, 14, 34, 634, 1634, 3634, 3634, 68, 69, 'UJAAAA', 'WOCAAA', 'OOOOxx'),
+(4768, 1739, 0, 0, 8, 8, 68, 768, 768, 4768, 4768, 136, 137, 'KBAAAA', 'XOCAAA', 'VVVVxx'),
+(9262, 1740, 0, 2, 2, 2, 62, 262, 1262, 4262, 9262, 124, 125, 'GSAAAA', 'YOCAAA', 'AAAAxx'),
+(2610, 1741, 0, 2, 0, 10, 10, 610, 610, 2610, 2610, 20, 21, 'KWAAAA', 'ZOCAAA', 'HHHHxx'),
+(6640, 1742, 0, 0, 0, 0, 40, 640, 640, 1640, 6640, 80, 81, 'KVAAAA', 'APCAAA', 'OOOOxx'),
+(3338, 1743, 0, 2, 8, 18, 38, 338, 1338, 3338, 3338, 76, 77, 'KYAAAA', 'BPCAAA', 'VVVVxx'),
+(6560, 1744, 0, 0, 0, 0, 60, 560, 560, 1560, 6560, 120, 121, 'ISAAAA', 'CPCAAA', 'AAAAxx'),
+(5986, 1745, 0, 2, 6, 6, 86, 986, 1986, 986, 5986, 172, 173, 'GWAAAA', 'DPCAAA', 'HHHHxx'),
+(2970, 1746, 0, 2, 0, 10, 70, 970, 970, 2970, 2970, 140, 141, 'GKAAAA', 'EPCAAA', 'OOOOxx'),
+(4731, 1747, 1, 3, 1, 11, 31, 731, 731, 4731, 4731, 62, 63, 'ZZAAAA', 'FPCAAA', 'VVVVxx'),
+(9486, 1748, 0, 2, 6, 6, 86, 486, 1486, 4486, 9486, 172, 173, 'WAAAAA', 'GPCAAA', 'AAAAxx'),
+(7204, 1749, 0, 0, 4, 4, 4, 204, 1204, 2204, 7204, 8, 9, 'CRAAAA', 'HPCAAA', 'HHHHxx'),
+(6685, 1750, 1, 1, 5, 5, 85, 685, 685, 1685, 6685, 170, 171, 'DXAAAA', 'IPCAAA', 'OOOOxx'),
+(6852, 1751, 0, 0, 2, 12, 52, 852, 852, 1852, 6852, 104, 105, 'ODAAAA', 'JPCAAA', 'VVVVxx'),
+(2325, 1752, 1, 1, 5, 5, 25, 325, 325, 2325, 2325, 50, 51, 'LLAAAA', 'KPCAAA', 'AAAAxx'),
+(1063, 1753, 1, 3, 3, 3, 63, 63, 1063, 1063, 1063, 126, 127, 'XOAAAA', 'LPCAAA', 'HHHHxx'),
+(6810, 1754, 0, 2, 0, 10, 10, 810, 810, 1810, 6810, 20, 21, 'YBAAAA', 'MPCAAA', 'OOOOxx'),
+(7718, 1755, 0, 2, 8, 18, 18, 718, 1718, 2718, 7718, 36, 37, 'WKAAAA', 'NPCAAA', 'VVVVxx'),
+(1680, 1756, 0, 0, 0, 0, 80, 680, 1680, 1680, 1680, 160, 161, 'QMAAAA', 'OPCAAA', 'AAAAxx'),
+(7402, 1757, 0, 2, 2, 2, 2, 402, 1402, 2402, 7402, 4, 5, 'SYAAAA', 'PPCAAA', 'HHHHxx'),
+(4134, 1758, 0, 2, 4, 14, 34, 134, 134, 4134, 4134, 68, 69, 'ADAAAA', 'QPCAAA', 'OOOOxx'),
+(8232, 1759, 0, 0, 2, 12, 32, 232, 232, 3232, 8232, 64, 65, 'QEAAAA', 'RPCAAA', 'VVVVxx'),
+(6682, 1760, 0, 2, 2, 2, 82, 682, 682, 1682, 6682, 164, 165, 'AXAAAA', 'SPCAAA', 'AAAAxx'),
+(7952, 1761, 0, 0, 2, 12, 52, 952, 1952, 2952, 7952, 104, 105, 'WTAAAA', 'TPCAAA', 'HHHHxx'),
+(5943, 1762, 1, 3, 3, 3, 43, 943, 1943, 943, 5943, 86, 87, 'PUAAAA', 'UPCAAA', 'OOOOxx'),
+(5394, 1763, 0, 2, 4, 14, 94, 394, 1394, 394, 5394, 188, 189, 'MZAAAA', 'VPCAAA', 'VVVVxx'),
+(6554, 1764, 0, 2, 4, 14, 54, 554, 554, 1554, 6554, 108, 109, 'CSAAAA', 'WPCAAA', 'AAAAxx'),
+(8186, 1765, 0, 2, 6, 6, 86, 186, 186, 3186, 8186, 172, 173, 'WCAAAA', 'XPCAAA', 'HHHHxx'),
+(199, 1766, 1, 3, 9, 19, 99, 199, 199, 199, 199, 198, 199, 'RHAAAA', 'YPCAAA', 'OOOOxx'),
+(3386, 1767, 0, 2, 6, 6, 86, 386, 1386, 3386, 3386, 172, 173, 'GAAAAA', 'ZPCAAA', 'VVVVxx'),
+(8974, 1768, 0, 2, 4, 14, 74, 974, 974, 3974, 8974, 148, 149, 'EHAAAA', 'AQCAAA', 'AAAAxx'),
+(8140, 1769, 0, 0, 0, 0, 40, 140, 140, 3140, 8140, 80, 81, 'CBAAAA', 'BQCAAA', 'HHHHxx'),
+(3723, 1770, 1, 3, 3, 3, 23, 723, 1723, 3723, 3723, 46, 47, 'FNAAAA', 'CQCAAA', 'OOOOxx'),
+(8827, 1771, 1, 3, 7, 7, 27, 827, 827, 3827, 8827, 54, 55, 'NBAAAA', 'DQCAAA', 'VVVVxx'),
+(1998, 1772, 0, 2, 8, 18, 98, 998, 1998, 1998, 1998, 196, 197, 'WYAAAA', 'EQCAAA', 'AAAAxx'),
+(879, 1773, 1, 3, 9, 19, 79, 879, 879, 879, 879, 158, 159, 'VHAAAA', 'FQCAAA', 'HHHHxx'),
+(892, 1774, 0, 0, 2, 12, 92, 892, 892, 892, 892, 184, 185, 'IIAAAA', 'GQCAAA', 'OOOOxx'),
+(9468, 1775, 0, 0, 8, 8, 68, 468, 1468, 4468, 9468, 136, 137, 'EAAAAA', 'HQCAAA', 'VVVVxx'),
+(3797, 1776, 1, 1, 7, 17, 97, 797, 1797, 3797, 3797, 194, 195, 'BQAAAA', 'IQCAAA', 'AAAAxx'),
+(8379, 1777, 1, 3, 9, 19, 79, 379, 379, 3379, 8379, 158, 159, 'HKAAAA', 'JQCAAA', 'HHHHxx'),
+(2817, 1778, 1, 1, 7, 17, 17, 817, 817, 2817, 2817, 34, 35, 'JEAAAA', 'KQCAAA', 'OOOOxx'),
+(789, 1779, 1, 1, 9, 9, 89, 789, 789, 789, 789, 178, 179, 'JEAAAA', 'LQCAAA', 'VVVVxx'),
+(3871, 1780, 1, 3, 1, 11, 71, 871, 1871, 3871, 3871, 142, 143, 'XSAAAA', 'MQCAAA', 'AAAAxx'),
+(7931, 1781, 1, 3, 1, 11, 31, 931, 1931, 2931, 7931, 62, 63, 'BTAAAA', 'NQCAAA', 'HHHHxx'),
+(3636, 1782, 0, 0, 6, 16, 36, 636, 1636, 3636, 3636, 72, 73, 'WJAAAA', 'OQCAAA', 'OOOOxx'),
+(699, 1783, 1, 3, 9, 19, 99, 699, 699, 699, 699, 198, 199, 'XAAAAA', 'PQCAAA', 'VVVVxx'),
+(6850, 1784, 0, 2, 0, 10, 50, 850, 850, 1850, 6850, 100, 101, 'MDAAAA', 'QQCAAA', 'AAAAxx'),
+(6394, 1785, 0, 2, 4, 14, 94, 394, 394, 1394, 6394, 188, 189, 'YLAAAA', 'RQCAAA', 'HHHHxx'),
+(3475, 1786, 1, 3, 5, 15, 75, 475, 1475, 3475, 3475, 150, 151, 'RDAAAA', 'SQCAAA', 'OOOOxx'),
+(3026, 1787, 0, 2, 6, 6, 26, 26, 1026, 3026, 3026, 52, 53, 'KMAAAA', 'TQCAAA', 'VVVVxx'),
+(876, 1788, 0, 0, 6, 16, 76, 876, 876, 876, 876, 152, 153, 'SHAAAA', 'UQCAAA', 'AAAAxx'),
+(1992, 1789, 0, 0, 2, 12, 92, 992, 1992, 1992, 1992, 184, 185, 'QYAAAA', 'VQCAAA', 'HHHHxx'),
+(3079, 1790, 1, 3, 9, 19, 79, 79, 1079, 3079, 3079, 158, 159, 'LOAAAA', 'WQCAAA', 'OOOOxx'),
+(8128, 1791, 0, 0, 8, 8, 28, 128, 128, 3128, 8128, 56, 57, 'QAAAAA', 'XQCAAA', 'VVVVxx'),
+(8123, 1792, 1, 3, 3, 3, 23, 123, 123, 3123, 8123, 46, 47, 'LAAAAA', 'YQCAAA', 'AAAAxx'),
+(3285, 1793, 1, 1, 5, 5, 85, 285, 1285, 3285, 3285, 170, 171, 'JWAAAA', 'ZQCAAA', 'HHHHxx'),
+(9315, 1794, 1, 3, 5, 15, 15, 315, 1315, 4315, 9315, 30, 31, 'HUAAAA', 'ARCAAA', 'OOOOxx'),
+(9862, 1795, 0, 2, 2, 2, 62, 862, 1862, 4862, 9862, 124, 125, 'IPAAAA', 'BRCAAA', 'VVVVxx'),
+(2764, 1796, 0, 0, 4, 4, 64, 764, 764, 2764, 2764, 128, 129, 'ICAAAA', 'CRCAAA', 'AAAAxx'),
+(3544, 1797, 0, 0, 4, 4, 44, 544, 1544, 3544, 3544, 88, 89, 'IGAAAA', 'DRCAAA', 'HHHHxx'),
+(7747, 1798, 1, 3, 7, 7, 47, 747, 1747, 2747, 7747, 94, 95, 'ZLAAAA', 'ERCAAA', 'OOOOxx'),
+(7725, 1799, 1, 1, 5, 5, 25, 725, 1725, 2725, 7725, 50, 51, 'DLAAAA', 'FRCAAA', 'VVVVxx'),
+(2449, 1800, 1, 1, 9, 9, 49, 449, 449, 2449, 2449, 98, 99, 'FQAAAA', 'GRCAAA', 'AAAAxx'),
+(8967, 1801, 1, 3, 7, 7, 67, 967, 967, 3967, 8967, 134, 135, 'XGAAAA', 'HRCAAA', 'HHHHxx'),
+(7371, 1802, 1, 3, 1, 11, 71, 371, 1371, 2371, 7371, 142, 143, 'NXAAAA', 'IRCAAA', 'OOOOxx'),
+(2158, 1803, 0, 2, 8, 18, 58, 158, 158, 2158, 2158, 116, 117, 'AFAAAA', 'JRCAAA', 'VVVVxx'),
+(5590, 1804, 0, 2, 0, 10, 90, 590, 1590, 590, 5590, 180, 181, 'AHAAAA', 'KRCAAA', 'AAAAxx'),
+(8072, 1805, 0, 0, 2, 12, 72, 72, 72, 3072, 8072, 144, 145, 'MYAAAA', 'LRCAAA', 'HHHHxx'),
+(1971, 1806, 1, 3, 1, 11, 71, 971, 1971, 1971, 1971, 142, 143, 'VXAAAA', 'MRCAAA', 'OOOOxx'),
+(772, 1807, 0, 0, 2, 12, 72, 772, 772, 772, 772, 144, 145, 'SDAAAA', 'NRCAAA', 'VVVVxx'),
+(3433, 1808, 1, 1, 3, 13, 33, 433, 1433, 3433, 3433, 66, 67, 'BCAAAA', 'ORCAAA', 'AAAAxx'),
+(8419, 1809, 1, 3, 9, 19, 19, 419, 419, 3419, 8419, 38, 39, 'VLAAAA', 'PRCAAA', 'HHHHxx'),
+(1493, 1810, 1, 1, 3, 13, 93, 493, 1493, 1493, 1493, 186, 187, 'LFAAAA', 'QRCAAA', 'OOOOxx'),
+(2584, 1811, 0, 0, 4, 4, 84, 584, 584, 2584, 2584, 168, 169, 'KVAAAA', 'RRCAAA', 'VVVVxx'),
+(9502, 1812, 0, 2, 2, 2, 2, 502, 1502, 4502, 9502, 4, 5, 'MBAAAA', 'SRCAAA', 'AAAAxx'),
+(4673, 1813, 1, 1, 3, 13, 73, 673, 673, 4673, 4673, 146, 147, 'TXAAAA', 'TRCAAA', 'HHHHxx'),
+(7403, 1814, 1, 3, 3, 3, 3, 403, 1403, 2403, 7403, 6, 7, 'TYAAAA', 'URCAAA', 'OOOOxx'),
+(7103, 1815, 1, 3, 3, 3, 3, 103, 1103, 2103, 7103, 6, 7, 'FNAAAA', 'VRCAAA', 'VVVVxx'),
+(7026, 1816, 0, 2, 6, 6, 26, 26, 1026, 2026, 7026, 52, 53, 'GKAAAA', 'WRCAAA', 'AAAAxx'),
+(8574, 1817, 0, 2, 4, 14, 74, 574, 574, 3574, 8574, 148, 149, 'URAAAA', 'XRCAAA', 'HHHHxx'),
+(1366, 1818, 0, 2, 6, 6, 66, 366, 1366, 1366, 1366, 132, 133, 'OAAAAA', 'YRCAAA', 'OOOOxx'),
+(5787, 1819, 1, 3, 7, 7, 87, 787, 1787, 787, 5787, 174, 175, 'POAAAA', 'ZRCAAA', 'VVVVxx'),
+(2552, 1820, 0, 0, 2, 12, 52, 552, 552, 2552, 2552, 104, 105, 'EUAAAA', 'ASCAAA', 'AAAAxx'),
+(4557, 1821, 1, 1, 7, 17, 57, 557, 557, 4557, 4557, 114, 115, 'HTAAAA', 'BSCAAA', 'HHHHxx'),
+(3237, 1822, 1, 1, 7, 17, 37, 237, 1237, 3237, 3237, 74, 75, 'NUAAAA', 'CSCAAA', 'OOOOxx'),
+(6901, 1823, 1, 1, 1, 1, 1, 901, 901, 1901, 6901, 2, 3, 'LFAAAA', 'DSCAAA', 'VVVVxx'),
+(7708, 1824, 0, 0, 8, 8, 8, 708, 1708, 2708, 7708, 16, 17, 'MKAAAA', 'ESCAAA', 'AAAAxx'),
+(2011, 1825, 1, 3, 1, 11, 11, 11, 11, 2011, 2011, 22, 23, 'JZAAAA', 'FSCAAA', 'HHHHxx'),
+(9455, 1826, 1, 3, 5, 15, 55, 455, 1455, 4455, 9455, 110, 111, 'RZAAAA', 'GSCAAA', 'OOOOxx'),
+(5228, 1827, 0, 0, 8, 8, 28, 228, 1228, 228, 5228, 56, 57, 'CTAAAA', 'HSCAAA', 'VVVVxx'),
+(4043, 1828, 1, 3, 3, 3, 43, 43, 43, 4043, 4043, 86, 87, 'NZAAAA', 'ISCAAA', 'AAAAxx'),
+(8242, 1829, 0, 2, 2, 2, 42, 242, 242, 3242, 8242, 84, 85, 'AFAAAA', 'JSCAAA', 'HHHHxx'),
+(6351, 1830, 1, 3, 1, 11, 51, 351, 351, 1351, 6351, 102, 103, 'HKAAAA', 'KSCAAA', 'OOOOxx'),
+(5899, 1831, 1, 3, 9, 19, 99, 899, 1899, 899, 5899, 198, 199, 'XSAAAA', 'LSCAAA', 'VVVVxx'),
+(4849, 1832, 1, 1, 9, 9, 49, 849, 849, 4849, 4849, 98, 99, 'NEAAAA', 'MSCAAA', 'AAAAxx'),
+(9583, 1833, 1, 3, 3, 3, 83, 583, 1583, 4583, 9583, 166, 167, 'PEAAAA', 'NSCAAA', 'HHHHxx'),
+(4994, 1834, 0, 2, 4, 14, 94, 994, 994, 4994, 4994, 188, 189, 'CKAAAA', 'OSCAAA', 'OOOOxx'),
+(9787, 1835, 1, 3, 7, 7, 87, 787, 1787, 4787, 9787, 174, 175, 'LMAAAA', 'PSCAAA', 'VVVVxx'),
+(243, 1836, 1, 3, 3, 3, 43, 243, 243, 243, 243, 86, 87, 'JJAAAA', 'QSCAAA', 'AAAAxx'),
+(3931, 1837, 1, 3, 1, 11, 31, 931, 1931, 3931, 3931, 62, 63, 'FVAAAA', 'RSCAAA', 'HHHHxx'),
+(5945, 1838, 1, 1, 5, 5, 45, 945, 1945, 945, 5945, 90, 91, 'RUAAAA', 'SSCAAA', 'OOOOxx'),
+(1325, 1839, 1, 1, 5, 5, 25, 325, 1325, 1325, 1325, 50, 51, 'ZYAAAA', 'TSCAAA', 'VVVVxx'),
+(4142, 1840, 0, 2, 2, 2, 42, 142, 142, 4142, 4142, 84, 85, 'IDAAAA', 'USCAAA', 'AAAAxx'),
+(1963, 1841, 1, 3, 3, 3, 63, 963, 1963, 1963, 1963, 126, 127, 'NXAAAA', 'VSCAAA', 'HHHHxx'),
+(7041, 1842, 1, 1, 1, 1, 41, 41, 1041, 2041, 7041, 82, 83, 'VKAAAA', 'WSCAAA', 'OOOOxx'),
+(3074, 1843, 0, 2, 4, 14, 74, 74, 1074, 3074, 3074, 148, 149, 'GOAAAA', 'XSCAAA', 'VVVVxx'),
+(3290, 1844, 0, 2, 0, 10, 90, 290, 1290, 3290, 3290, 180, 181, 'OWAAAA', 'YSCAAA', 'AAAAxx'),
+(4146, 1845, 0, 2, 6, 6, 46, 146, 146, 4146, 4146, 92, 93, 'MDAAAA', 'ZSCAAA', 'HHHHxx'),
+(3832, 1846, 0, 0, 2, 12, 32, 832, 1832, 3832, 3832, 64, 65, 'KRAAAA', 'ATCAAA', 'OOOOxx'),
+(2217, 1847, 1, 1, 7, 17, 17, 217, 217, 2217, 2217, 34, 35, 'HHAAAA', 'BTCAAA', 'VVVVxx'),
+(635, 1848, 1, 3, 5, 15, 35, 635, 635, 635, 635, 70, 71, 'LYAAAA', 'CTCAAA', 'AAAAxx'),
+(6967, 1849, 1, 3, 7, 7, 67, 967, 967, 1967, 6967, 134, 135, 'ZHAAAA', 'DTCAAA', 'HHHHxx'),
+(3522, 1850, 0, 2, 2, 2, 22, 522, 1522, 3522, 3522, 44, 45, 'MFAAAA', 'ETCAAA', 'OOOOxx'),
+(2471, 1851, 1, 3, 1, 11, 71, 471, 471, 2471, 2471, 142, 143, 'BRAAAA', 'FTCAAA', 'VVVVxx'),
+(4236, 1852, 0, 0, 6, 16, 36, 236, 236, 4236, 4236, 72, 73, 'YGAAAA', 'GTCAAA', 'AAAAxx'),
+(853, 1853, 1, 1, 3, 13, 53, 853, 853, 853, 853, 106, 107, 'VGAAAA', 'HTCAAA', 'HHHHxx'),
+(3754, 1854, 0, 2, 4, 14, 54, 754, 1754, 3754, 3754, 108, 109, 'KOAAAA', 'ITCAAA', 'OOOOxx'),
+(796, 1855, 0, 0, 6, 16, 96, 796, 796, 796, 796, 192, 193, 'QEAAAA', 'JTCAAA', 'VVVVxx'),
+(4640, 1856, 0, 0, 0, 0, 40, 640, 640, 4640, 4640, 80, 81, 'MWAAAA', 'KTCAAA', 'AAAAxx'),
+(9496, 1857, 0, 0, 6, 16, 96, 496, 1496, 4496, 9496, 192, 193, 'GBAAAA', 'LTCAAA', 'HHHHxx'),
+(6873, 1858, 1, 1, 3, 13, 73, 873, 873, 1873, 6873, 146, 147, 'JEAAAA', 'MTCAAA', 'OOOOxx'),
+(4632, 1859, 0, 0, 2, 12, 32, 632, 632, 4632, 4632, 64, 65, 'EWAAAA', 'NTCAAA', 'VVVVxx'),
+(5758, 1860, 0, 2, 8, 18, 58, 758, 1758, 758, 5758, 116, 117, 'MNAAAA', 'OTCAAA', 'AAAAxx'),
+(6514, 1861, 0, 2, 4, 14, 14, 514, 514, 1514, 6514, 28, 29, 'OQAAAA', 'PTCAAA', 'HHHHxx'),
+(9510, 1862, 0, 2, 0, 10, 10, 510, 1510, 4510, 9510, 20, 21, 'UBAAAA', 'QTCAAA', 'OOOOxx'),
+(8411, 1863, 1, 3, 1, 11, 11, 411, 411, 3411, 8411, 22, 23, 'NLAAAA', 'RTCAAA', 'VVVVxx'),
+(7762, 1864, 0, 2, 2, 2, 62, 762, 1762, 2762, 7762, 124, 125, 'OMAAAA', 'STCAAA', 'AAAAxx'),
+(2225, 1865, 1, 1, 5, 5, 25, 225, 225, 2225, 2225, 50, 51, 'PHAAAA', 'TTCAAA', 'HHHHxx'),
+(4373, 1866, 1, 1, 3, 13, 73, 373, 373, 4373, 4373, 146, 147, 'FMAAAA', 'UTCAAA', 'OOOOxx'),
+(7326, 1867, 0, 2, 6, 6, 26, 326, 1326, 2326, 7326, 52, 53, 'UVAAAA', 'VTCAAA', 'VVVVxx'),
+(8651, 1868, 1, 3, 1, 11, 51, 651, 651, 3651, 8651, 102, 103, 'TUAAAA', 'WTCAAA', 'AAAAxx'),
+(9825, 1869, 1, 1, 5, 5, 25, 825, 1825, 4825, 9825, 50, 51, 'XNAAAA', 'XTCAAA', 'HHHHxx'),
+(2988, 1870, 0, 0, 8, 8, 88, 988, 988, 2988, 2988, 176, 177, 'YKAAAA', 'YTCAAA', 'OOOOxx'),
+(8138, 1871, 0, 2, 8, 18, 38, 138, 138, 3138, 8138, 76, 77, 'ABAAAA', 'ZTCAAA', 'VVVVxx'),
+(7792, 1872, 0, 0, 2, 12, 92, 792, 1792, 2792, 7792, 184, 185, 'SNAAAA', 'AUCAAA', 'AAAAxx'),
+(1232, 1873, 0, 0, 2, 12, 32, 232, 1232, 1232, 1232, 64, 65, 'KVAAAA', 'BUCAAA', 'HHHHxx'),
+(8221, 1874, 1, 1, 1, 1, 21, 221, 221, 3221, 8221, 42, 43, 'FEAAAA', 'CUCAAA', 'OOOOxx'),
+(4044, 1875, 0, 0, 4, 4, 44, 44, 44, 4044, 4044, 88, 89, 'OZAAAA', 'DUCAAA', 'VVVVxx'),
+(1204, 1876, 0, 0, 4, 4, 4, 204, 1204, 1204, 1204, 8, 9, 'IUAAAA', 'EUCAAA', 'AAAAxx'),
+(5145, 1877, 1, 1, 5, 5, 45, 145, 1145, 145, 5145, 90, 91, 'XPAAAA', 'FUCAAA', 'HHHHxx'),
+(7791, 1878, 1, 3, 1, 11, 91, 791, 1791, 2791, 7791, 182, 183, 'RNAAAA', 'GUCAAA', 'OOOOxx'),
+(8270, 1879, 0, 2, 0, 10, 70, 270, 270, 3270, 8270, 140, 141, 'CGAAAA', 'HUCAAA', 'VVVVxx'),
+(9427, 1880, 1, 3, 7, 7, 27, 427, 1427, 4427, 9427, 54, 55, 'PYAAAA', 'IUCAAA', 'AAAAxx'),
+(2152, 1881, 0, 0, 2, 12, 52, 152, 152, 2152, 2152, 104, 105, 'UEAAAA', 'JUCAAA', 'HHHHxx'),
+(7790, 1882, 0, 2, 0, 10, 90, 790, 1790, 2790, 7790, 180, 181, 'QNAAAA', 'KUCAAA', 'OOOOxx'),
+(5301, 1883, 1, 1, 1, 1, 1, 301, 1301, 301, 5301, 2, 3, 'XVAAAA', 'LUCAAA', 'VVVVxx'),
+(626, 1884, 0, 2, 6, 6, 26, 626, 626, 626, 626, 52, 53, 'CYAAAA', 'MUCAAA', 'AAAAxx'),
+(260, 1885, 0, 0, 0, 0, 60, 260, 260, 260, 260, 120, 121, 'AKAAAA', 'NUCAAA', 'HHHHxx'),
+(4369, 1886, 1, 1, 9, 9, 69, 369, 369, 4369, 4369, 138, 139, 'BMAAAA', 'OUCAAA', 'OOOOxx'),
+(5457, 1887, 1, 1, 7, 17, 57, 457, 1457, 457, 5457, 114, 115, 'XBAAAA', 'PUCAAA', 'VVVVxx'),
+(3468, 1888, 0, 0, 8, 8, 68, 468, 1468, 3468, 3468, 136, 137, 'KDAAAA', 'QUCAAA', 'AAAAxx'),
+(2257, 1889, 1, 1, 7, 17, 57, 257, 257, 2257, 2257, 114, 115, 'VIAAAA', 'RUCAAA', 'HHHHxx'),
+(9318, 1890, 0, 2, 8, 18, 18, 318, 1318, 4318, 9318, 36, 37, 'KUAAAA', 'SUCAAA', 'OOOOxx'),
+(8762, 1891, 0, 2, 2, 2, 62, 762, 762, 3762, 8762, 124, 125, 'AZAAAA', 'TUCAAA', 'VVVVxx'),
+(9153, 1892, 1, 1, 3, 13, 53, 153, 1153, 4153, 9153, 106, 107, 'BOAAAA', 'UUCAAA', 'AAAAxx'),
+(9220, 1893, 0, 0, 0, 0, 20, 220, 1220, 4220, 9220, 40, 41, 'QQAAAA', 'VUCAAA', 'HHHHxx'),
+(8003, 1894, 1, 3, 3, 3, 3, 3, 3, 3003, 8003, 6, 7, 'VVAAAA', 'WUCAAA', 'OOOOxx'),
+(7257, 1895, 1, 1, 7, 17, 57, 257, 1257, 2257, 7257, 114, 115, 'DTAAAA', 'XUCAAA', 'VVVVxx'),
+(3930, 1896, 0, 2, 0, 10, 30, 930, 1930, 3930, 3930, 60, 61, 'EVAAAA', 'YUCAAA', 'AAAAxx'),
+(2976, 1897, 0, 0, 6, 16, 76, 976, 976, 2976, 2976, 152, 153, 'MKAAAA', 'ZUCAAA', 'HHHHxx'),
+(2531, 1898, 1, 3, 1, 11, 31, 531, 531, 2531, 2531, 62, 63, 'JTAAAA', 'AVCAAA', 'OOOOxx'),
+(2250, 1899, 0, 2, 0, 10, 50, 250, 250, 2250, 2250, 100, 101, 'OIAAAA', 'BVCAAA', 'VVVVxx'),
+(8549, 1900, 1, 1, 9, 9, 49, 549, 549, 3549, 8549, 98, 99, 'VQAAAA', 'CVCAAA', 'AAAAxx'),
+(7197, 1901, 1, 1, 7, 17, 97, 197, 1197, 2197, 7197, 194, 195, 'VQAAAA', 'DVCAAA', 'HHHHxx'),
+(5916, 1902, 0, 0, 6, 16, 16, 916, 1916, 916, 5916, 32, 33, 'OTAAAA', 'EVCAAA', 'OOOOxx'),
+(5287, 1903, 1, 3, 7, 7, 87, 287, 1287, 287, 5287, 174, 175, 'JVAAAA', 'FVCAAA', 'VVVVxx'),
+(9095, 1904, 1, 3, 5, 15, 95, 95, 1095, 4095, 9095, 190, 191, 'VLAAAA', 'GVCAAA', 'AAAAxx'),
+(7137, 1905, 1, 1, 7, 17, 37, 137, 1137, 2137, 7137, 74, 75, 'NOAAAA', 'HVCAAA', 'HHHHxx'),
+(7902, 1906, 0, 2, 2, 2, 2, 902, 1902, 2902, 7902, 4, 5, 'YRAAAA', 'IVCAAA', 'OOOOxx'),
+(7598, 1907, 0, 2, 8, 18, 98, 598, 1598, 2598, 7598, 196, 197, 'GGAAAA', 'JVCAAA', 'VVVVxx'),
+(5652, 1908, 0, 0, 2, 12, 52, 652, 1652, 652, 5652, 104, 105, 'KJAAAA', 'KVCAAA', 'AAAAxx'),
+(2017, 1909, 1, 1, 7, 17, 17, 17, 17, 2017, 2017, 34, 35, 'PZAAAA', 'LVCAAA', 'HHHHxx'),
+(7255, 1910, 1, 3, 5, 15, 55, 255, 1255, 2255, 7255, 110, 111, 'BTAAAA', 'MVCAAA', 'OOOOxx'),
+(7999, 1911, 1, 3, 9, 19, 99, 999, 1999, 2999, 7999, 198, 199, 'RVAAAA', 'NVCAAA', 'VVVVxx'),
+(5388, 1912, 0, 0, 8, 8, 88, 388, 1388, 388, 5388, 176, 177, 'GZAAAA', 'OVCAAA', 'AAAAxx'),
+(8754, 1913, 0, 2, 4, 14, 54, 754, 754, 3754, 8754, 108, 109, 'SYAAAA', 'PVCAAA', 'HHHHxx'),
+(5415, 1914, 1, 3, 5, 15, 15, 415, 1415, 415, 5415, 30, 31, 'HAAAAA', 'QVCAAA', 'OOOOxx'),
+(8861, 1915, 1, 1, 1, 1, 61, 861, 861, 3861, 8861, 122, 123, 'VCAAAA', 'RVCAAA', 'VVVVxx'),
+(2874, 1916, 0, 2, 4, 14, 74, 874, 874, 2874, 2874, 148, 149, 'OGAAAA', 'SVCAAA', 'AAAAxx'),
+(9910, 1917, 0, 2, 0, 10, 10, 910, 1910, 4910, 9910, 20, 21, 'ERAAAA', 'TVCAAA', 'HHHHxx'),
+(5178, 1918, 0, 2, 8, 18, 78, 178, 1178, 178, 5178, 156, 157, 'ERAAAA', 'UVCAAA', 'OOOOxx'),
+(5698, 1919, 0, 2, 8, 18, 98, 698, 1698, 698, 5698, 196, 197, 'ELAAAA', 'VVCAAA', 'VVVVxx'),
+(8500, 1920, 0, 0, 0, 0, 0, 500, 500, 3500, 8500, 0, 1, 'YOAAAA', 'WVCAAA', 'AAAAxx'),
+(1814, 1921, 0, 2, 4, 14, 14, 814, 1814, 1814, 1814, 28, 29, 'URAAAA', 'XVCAAA', 'HHHHxx'),
+(4968, 1922, 0, 0, 8, 8, 68, 968, 968, 4968, 4968, 136, 137, 'CJAAAA', 'YVCAAA', 'OOOOxx'),
+(2642, 1923, 0, 2, 2, 2, 42, 642, 642, 2642, 2642, 84, 85, 'QXAAAA', 'ZVCAAA', 'VVVVxx'),
+(1578, 1924, 0, 2, 8, 18, 78, 578, 1578, 1578, 1578, 156, 157, 'SIAAAA', 'AWCAAA', 'AAAAxx'),
+(4774, 1925, 0, 2, 4, 14, 74, 774, 774, 4774, 4774, 148, 149, 'QBAAAA', 'BWCAAA', 'HHHHxx'),
+(7062, 1926, 0, 2, 2, 2, 62, 62, 1062, 2062, 7062, 124, 125, 'QLAAAA', 'CWCAAA', 'OOOOxx'),
+(5381, 1927, 1, 1, 1, 1, 81, 381, 1381, 381, 5381, 162, 163, 'ZYAAAA', 'DWCAAA', 'VVVVxx'),
+(7985, 1928, 1, 1, 5, 5, 85, 985, 1985, 2985, 7985, 170, 171, 'DVAAAA', 'EWCAAA', 'AAAAxx'),
+(3850, 1929, 0, 2, 0, 10, 50, 850, 1850, 3850, 3850, 100, 101, 'CSAAAA', 'FWCAAA', 'HHHHxx'),
+(5624, 1930, 0, 0, 4, 4, 24, 624, 1624, 624, 5624, 48, 49, 'IIAAAA', 'GWCAAA', 'OOOOxx'),
+(8948, 1931, 0, 0, 8, 8, 48, 948, 948, 3948, 8948, 96, 97, 'EGAAAA', 'HWCAAA', 'VVVVxx'),
+(995, 1932, 1, 3, 5, 15, 95, 995, 995, 995, 995, 190, 191, 'HMAAAA', 'IWCAAA', 'AAAAxx'),
+(5058, 1933, 0, 2, 8, 18, 58, 58, 1058, 58, 5058, 116, 117, 'OMAAAA', 'JWCAAA', 'HHHHxx'),
+(9670, 1934, 0, 2, 0, 10, 70, 670, 1670, 4670, 9670, 140, 141, 'YHAAAA', 'KWCAAA', 'OOOOxx'),
+(3115, 1935, 1, 3, 5, 15, 15, 115, 1115, 3115, 3115, 30, 31, 'VPAAAA', 'LWCAAA', 'VVVVxx'),
+(4935, 1936, 1, 3, 5, 15, 35, 935, 935, 4935, 4935, 70, 71, 'VHAAAA', 'MWCAAA', 'AAAAxx'),
+(4735, 1937, 1, 3, 5, 15, 35, 735, 735, 4735, 4735, 70, 71, 'DAAAAA', 'NWCAAA', 'HHHHxx'),
+(1348, 1938, 0, 0, 8, 8, 48, 348, 1348, 1348, 1348, 96, 97, 'WZAAAA', 'OWCAAA', 'OOOOxx'),
+(2380, 1939, 0, 0, 0, 0, 80, 380, 380, 2380, 2380, 160, 161, 'ONAAAA', 'PWCAAA', 'VVVVxx'),
+(4246, 1940, 0, 2, 6, 6, 46, 246, 246, 4246, 4246, 92, 93, 'IHAAAA', 'QWCAAA', 'AAAAxx'),
+(522, 1941, 0, 2, 2, 2, 22, 522, 522, 522, 522, 44, 45, 'CUAAAA', 'RWCAAA', 'HHHHxx'),
+(1701, 1942, 1, 1, 1, 1, 1, 701, 1701, 1701, 1701, 2, 3, 'LNAAAA', 'SWCAAA', 'OOOOxx'),
+(9709, 1943, 1, 1, 9, 9, 9, 709, 1709, 4709, 9709, 18, 19, 'LJAAAA', 'TWCAAA', 'VVVVxx'),
+(8829, 1944, 1, 1, 9, 9, 29, 829, 829, 3829, 8829, 58, 59, 'PBAAAA', 'UWCAAA', 'AAAAxx'),
+(7936, 1945, 0, 0, 6, 16, 36, 936, 1936, 2936, 7936, 72, 73, 'GTAAAA', 'VWCAAA', 'HHHHxx'),
+(8474, 1946, 0, 2, 4, 14, 74, 474, 474, 3474, 8474, 148, 149, 'YNAAAA', 'WWCAAA', 'OOOOxx'),
+(4676, 1947, 0, 0, 6, 16, 76, 676, 676, 4676, 4676, 152, 153, 'WXAAAA', 'XWCAAA', 'VVVVxx'),
+(6303, 1948, 1, 3, 3, 3, 3, 303, 303, 1303, 6303, 6, 7, 'LIAAAA', 'YWCAAA', 'AAAAxx'),
+(3485, 1949, 1, 1, 5, 5, 85, 485, 1485, 3485, 3485, 170, 171, 'BEAAAA', 'ZWCAAA', 'HHHHxx'),
+(2695, 1950, 1, 3, 5, 15, 95, 695, 695, 2695, 2695, 190, 191, 'RZAAAA', 'AXCAAA', 'OOOOxx'),
+(8830, 1951, 0, 2, 0, 10, 30, 830, 830, 3830, 8830, 60, 61, 'QBAAAA', 'BXCAAA', 'VVVVxx'),
+(898, 1952, 0, 2, 8, 18, 98, 898, 898, 898, 898, 196, 197, 'OIAAAA', 'CXCAAA', 'AAAAxx'),
+(7268, 1953, 0, 0, 8, 8, 68, 268, 1268, 2268, 7268, 136, 137, 'OTAAAA', 'DXCAAA', 'HHHHxx'),
+(6568, 1954, 0, 0, 8, 8, 68, 568, 568, 1568, 6568, 136, 137, 'QSAAAA', 'EXCAAA', 'OOOOxx'),
+(9724, 1955, 0, 0, 4, 4, 24, 724, 1724, 4724, 9724, 48, 49, 'AKAAAA', 'FXCAAA', 'VVVVxx'),
+(3329, 1956, 1, 1, 9, 9, 29, 329, 1329, 3329, 3329, 58, 59, 'BYAAAA', 'GXCAAA', 'AAAAxx'),
+(9860, 1957, 0, 0, 0, 0, 60, 860, 1860, 4860, 9860, 120, 121, 'GPAAAA', 'HXCAAA', 'HHHHxx'),
+(6833, 1958, 1, 1, 3, 13, 33, 833, 833, 1833, 6833, 66, 67, 'VCAAAA', 'IXCAAA', 'OOOOxx'),
+(5956, 1959, 0, 0, 6, 16, 56, 956, 1956, 956, 5956, 112, 113, 'CVAAAA', 'JXCAAA', 'VVVVxx'),
+(3963, 1960, 1, 3, 3, 3, 63, 963, 1963, 3963, 3963, 126, 127, 'LWAAAA', 'KXCAAA', 'AAAAxx'),
+(883, 1961, 1, 3, 3, 3, 83, 883, 883, 883, 883, 166, 167, 'ZHAAAA', 'LXCAAA', 'HHHHxx'),
+(2761, 1962, 1, 1, 1, 1, 61, 761, 761, 2761, 2761, 122, 123, 'FCAAAA', 'MXCAAA', 'OOOOxx'),
+(4644, 1963, 0, 0, 4, 4, 44, 644, 644, 4644, 4644, 88, 89, 'QWAAAA', 'NXCAAA', 'VVVVxx'),
+(1358, 1964, 0, 2, 8, 18, 58, 358, 1358, 1358, 1358, 116, 117, 'GAAAAA', 'OXCAAA', 'AAAAxx'),
+(2049, 1965, 1, 1, 9, 9, 49, 49, 49, 2049, 2049, 98, 99, 'VAAAAA', 'PXCAAA', 'HHHHxx'),
+(2193, 1966, 1, 1, 3, 13, 93, 193, 193, 2193, 2193, 186, 187, 'JGAAAA', 'QXCAAA', 'OOOOxx'),
+(9435, 1967, 1, 3, 5, 15, 35, 435, 1435, 4435, 9435, 70, 71, 'XYAAAA', 'RXCAAA', 'VVVVxx'),
+(5890, 1968, 0, 2, 0, 10, 90, 890, 1890, 890, 5890, 180, 181, 'OSAAAA', 'SXCAAA', 'AAAAxx'),
+(8149, 1969, 1, 1, 9, 9, 49, 149, 149, 3149, 8149, 98, 99, 'LBAAAA', 'TXCAAA', 'HHHHxx'),
+(423, 1970, 1, 3, 3, 3, 23, 423, 423, 423, 423, 46, 47, 'HQAAAA', 'UXCAAA', 'OOOOxx'),
+(7980, 1971, 0, 0, 0, 0, 80, 980, 1980, 2980, 7980, 160, 161, 'YUAAAA', 'VXCAAA', 'VVVVxx'),
+(9019, 1972, 1, 3, 9, 19, 19, 19, 1019, 4019, 9019, 38, 39, 'XIAAAA', 'WXCAAA', 'AAAAxx'),
+(1647, 1973, 1, 3, 7, 7, 47, 647, 1647, 1647, 1647, 94, 95, 'JLAAAA', 'XXCAAA', 'HHHHxx'),
+(9495, 1974, 1, 3, 5, 15, 95, 495, 1495, 4495, 9495, 190, 191, 'FBAAAA', 'YXCAAA', 'OOOOxx'),
+(3904, 1975, 0, 0, 4, 4, 4, 904, 1904, 3904, 3904, 8, 9, 'EUAAAA', 'ZXCAAA', 'VVVVxx'),
+(5838, 1976, 0, 2, 8, 18, 38, 838, 1838, 838, 5838, 76, 77, 'OQAAAA', 'AYCAAA', 'AAAAxx'),
+(3866, 1977, 0, 2, 6, 6, 66, 866, 1866, 3866, 3866, 132, 133, 'SSAAAA', 'BYCAAA', 'HHHHxx'),
+(3093, 1978, 1, 1, 3, 13, 93, 93, 1093, 3093, 3093, 186, 187, 'ZOAAAA', 'CYCAAA', 'OOOOxx'),
+(9666, 1979, 0, 2, 6, 6, 66, 666, 1666, 4666, 9666, 132, 133, 'UHAAAA', 'DYCAAA', 'VVVVxx'),
+(1246, 1980, 0, 2, 6, 6, 46, 246, 1246, 1246, 1246, 92, 93, 'YVAAAA', 'EYCAAA', 'AAAAxx'),
+(9759, 1981, 1, 3, 9, 19, 59, 759, 1759, 4759, 9759, 118, 119, 'JLAAAA', 'FYCAAA', 'HHHHxx'),
+(7174, 1982, 0, 2, 4, 14, 74, 174, 1174, 2174, 7174, 148, 149, 'YPAAAA', 'GYCAAA', 'OOOOxx'),
+(7678, 1983, 0, 2, 8, 18, 78, 678, 1678, 2678, 7678, 156, 157, 'IJAAAA', 'HYCAAA', 'VVVVxx'),
+(3004, 1984, 0, 0, 4, 4, 4, 4, 1004, 3004, 3004, 8, 9, 'OLAAAA', 'IYCAAA', 'AAAAxx'),
+(5607, 1985, 1, 3, 7, 7, 7, 607, 1607, 607, 5607, 14, 15, 'RHAAAA', 'JYCAAA', 'HHHHxx'),
+(8510, 1986, 0, 2, 0, 10, 10, 510, 510, 3510, 8510, 20, 21, 'IPAAAA', 'KYCAAA', 'OOOOxx'),
+(1483, 1987, 1, 3, 3, 3, 83, 483, 1483, 1483, 1483, 166, 167, 'BFAAAA', 'LYCAAA', 'VVVVxx'),
+(2915, 1988, 1, 3, 5, 15, 15, 915, 915, 2915, 2915, 30, 31, 'DIAAAA', 'MYCAAA', 'AAAAxx'),
+(1548, 1989, 0, 0, 8, 8, 48, 548, 1548, 1548, 1548, 96, 97, 'OHAAAA', 'NYCAAA', 'HHHHxx'),
+(5767, 1990, 1, 3, 7, 7, 67, 767, 1767, 767, 5767, 134, 135, 'VNAAAA', 'OYCAAA', 'OOOOxx'),
+(3214, 1991, 0, 2, 4, 14, 14, 214, 1214, 3214, 3214, 28, 29, 'QTAAAA', 'PYCAAA', 'VVVVxx'),
+(8663, 1992, 1, 3, 3, 3, 63, 663, 663, 3663, 8663, 126, 127, 'FVAAAA', 'QYCAAA', 'AAAAxx'),
+(5425, 1993, 1, 1, 5, 5, 25, 425, 1425, 425, 5425, 50, 51, 'RAAAAA', 'RYCAAA', 'HHHHxx'),
+(8530, 1994, 0, 2, 0, 10, 30, 530, 530, 3530, 8530, 60, 61, 'CQAAAA', 'SYCAAA', 'OOOOxx'),
+(821, 1995, 1, 1, 1, 1, 21, 821, 821, 821, 821, 42, 43, 'PFAAAA', 'TYCAAA', 'VVVVxx'),
+(8816, 1996, 0, 0, 6, 16, 16, 816, 816, 3816, 8816, 32, 33, 'CBAAAA', 'UYCAAA', 'AAAAxx'),
+(9367, 1997, 1, 3, 7, 7, 67, 367, 1367, 4367, 9367, 134, 135, 'HWAAAA', 'VYCAAA', 'HHHHxx'),
+(4138, 1998, 0, 2, 8, 18, 38, 138, 138, 4138, 4138, 76, 77, 'EDAAAA', 'WYCAAA', 'OOOOxx'),
+(94, 1999, 0, 2, 4, 14, 94, 94, 94, 94, 94, 188, 189, 'QDAAAA', 'XYCAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(1858, 2000, 0, 2, 8, 18, 58, 858, 1858, 1858, 1858, 116, 117, 'MTAAAA', 'YYCAAA', 'AAAAxx'),
+(5513, 2001, 1, 1, 3, 13, 13, 513, 1513, 513, 5513, 26, 27, 'BEAAAA', 'ZYCAAA', 'HHHHxx'),
+(9620, 2002, 0, 0, 0, 0, 20, 620, 1620, 4620, 9620, 40, 41, 'AGAAAA', 'AZCAAA', 'OOOOxx'),
+(4770, 2003, 0, 2, 0, 10, 70, 770, 770, 4770, 4770, 140, 141, 'MBAAAA', 'BZCAAA', 'VVVVxx'),
+(5193, 2004, 1, 1, 3, 13, 93, 193, 1193, 193, 5193, 186, 187, 'TRAAAA', 'CZCAAA', 'AAAAxx'),
+(198, 2005, 0, 2, 8, 18, 98, 198, 198, 198, 198, 196, 197, 'QHAAAA', 'DZCAAA', 'HHHHxx'),
+(417, 2006, 1, 1, 7, 17, 17, 417, 417, 417, 417, 34, 35, 'BQAAAA', 'EZCAAA', 'OOOOxx'),
+(173, 2007, 1, 1, 3, 13, 73, 173, 173, 173, 173, 146, 147, 'RGAAAA', 'FZCAAA', 'VVVVxx'),
+(6248, 2008, 0, 0, 8, 8, 48, 248, 248, 1248, 6248, 96, 97, 'IGAAAA', 'GZCAAA', 'AAAAxx'),
+(302, 2009, 0, 2, 2, 2, 2, 302, 302, 302, 302, 4, 5, 'QLAAAA', 'HZCAAA', 'HHHHxx'),
+(8983, 2010, 1, 3, 3, 3, 83, 983, 983, 3983, 8983, 166, 167, 'NHAAAA', 'IZCAAA', 'OOOOxx'),
+(4840, 2011, 0, 0, 0, 0, 40, 840, 840, 4840, 4840, 80, 81, 'EEAAAA', 'JZCAAA', 'VVVVxx'),
+(2876, 2012, 0, 0, 6, 16, 76, 876, 876, 2876, 2876, 152, 153, 'QGAAAA', 'KZCAAA', 'AAAAxx'),
+(5841, 2013, 1, 1, 1, 1, 41, 841, 1841, 841, 5841, 82, 83, 'RQAAAA', 'LZCAAA', 'HHHHxx'),
+(2766, 2014, 0, 2, 6, 6, 66, 766, 766, 2766, 2766, 132, 133, 'KCAAAA', 'MZCAAA', 'OOOOxx'),
+(9482, 2015, 0, 2, 2, 2, 82, 482, 1482, 4482, 9482, 164, 165, 'SAAAAA', 'NZCAAA', 'VVVVxx'),
+(5335, 2016, 1, 3, 5, 15, 35, 335, 1335, 335, 5335, 70, 71, 'FXAAAA', 'OZCAAA', 'AAAAxx'),
+(1502, 2017, 0, 2, 2, 2, 2, 502, 1502, 1502, 1502, 4, 5, 'UFAAAA', 'PZCAAA', 'HHHHxx'),
+(9291, 2018, 1, 3, 1, 11, 91, 291, 1291, 4291, 9291, 182, 183, 'JTAAAA', 'QZCAAA', 'OOOOxx'),
+(8655, 2019, 1, 3, 5, 15, 55, 655, 655, 3655, 8655, 110, 111, 'XUAAAA', 'RZCAAA', 'VVVVxx'),
+(1687, 2020, 1, 3, 7, 7, 87, 687, 1687, 1687, 1687, 174, 175, 'XMAAAA', 'SZCAAA', 'AAAAxx'),
+(8171, 2021, 1, 3, 1, 11, 71, 171, 171, 3171, 8171, 142, 143, 'HCAAAA', 'TZCAAA', 'HHHHxx'),
+(5699, 2022, 1, 3, 9, 19, 99, 699, 1699, 699, 5699, 198, 199, 'FLAAAA', 'UZCAAA', 'OOOOxx'),
+(1462, 2023, 0, 2, 2, 2, 62, 462, 1462, 1462, 1462, 124, 125, 'GEAAAA', 'VZCAAA', 'VVVVxx'),
+(608, 2024, 0, 0, 8, 8, 8, 608, 608, 608, 608, 16, 17, 'KXAAAA', 'WZCAAA', 'AAAAxx'),
+(6860, 2025, 0, 0, 0, 0, 60, 860, 860, 1860, 6860, 120, 121, 'WDAAAA', 'XZCAAA', 'HHHHxx'),
+(6063, 2026, 1, 3, 3, 3, 63, 63, 63, 1063, 6063, 126, 127, 'FZAAAA', 'YZCAAA', 'OOOOxx'),
+(1422, 2027, 0, 2, 2, 2, 22, 422, 1422, 1422, 1422, 44, 45, 'SCAAAA', 'ZZCAAA', 'VVVVxx'),
+(1932, 2028, 0, 0, 2, 12, 32, 932, 1932, 1932, 1932, 64, 65, 'IWAAAA', 'AADAAA', 'AAAAxx'),
+(5065, 2029, 1, 1, 5, 5, 65, 65, 1065, 65, 5065, 130, 131, 'VMAAAA', 'BADAAA', 'HHHHxx'),
+(432, 2030, 0, 0, 2, 12, 32, 432, 432, 432, 432, 64, 65, 'QQAAAA', 'CADAAA', 'OOOOxx'),
+(4680, 2031, 0, 0, 0, 0, 80, 680, 680, 4680, 4680, 160, 161, 'AYAAAA', 'DADAAA', 'VVVVxx'),
+(8172, 2032, 0, 0, 2, 12, 72, 172, 172, 3172, 8172, 144, 145, 'ICAAAA', 'EADAAA', 'AAAAxx'),
+(8668, 2033, 0, 0, 8, 8, 68, 668, 668, 3668, 8668, 136, 137, 'KVAAAA', 'FADAAA', 'HHHHxx'),
+(256, 2034, 0, 0, 6, 16, 56, 256, 256, 256, 256, 112, 113, 'WJAAAA', 'GADAAA', 'OOOOxx'),
+(2500, 2035, 0, 0, 0, 0, 0, 500, 500, 2500, 2500, 0, 1, 'ESAAAA', 'HADAAA', 'VVVVxx'),
+(274, 2036, 0, 2, 4, 14, 74, 274, 274, 274, 274, 148, 149, 'OKAAAA', 'IADAAA', 'AAAAxx'),
+(5907, 2037, 1, 3, 7, 7, 7, 907, 1907, 907, 5907, 14, 15, 'FTAAAA', 'JADAAA', 'HHHHxx'),
+(8587, 2038, 1, 3, 7, 7, 87, 587, 587, 3587, 8587, 174, 175, 'HSAAAA', 'KADAAA', 'OOOOxx'),
+(9942, 2039, 0, 2, 2, 2, 42, 942, 1942, 4942, 9942, 84, 85, 'KSAAAA', 'LADAAA', 'VVVVxx'),
+(116, 2040, 0, 0, 6, 16, 16, 116, 116, 116, 116, 32, 33, 'MEAAAA', 'MADAAA', 'AAAAxx'),
+(7134, 2041, 0, 2, 4, 14, 34, 134, 1134, 2134, 7134, 68, 69, 'KOAAAA', 'NADAAA', 'HHHHxx'),
+(9002, 2042, 0, 2, 2, 2, 2, 2, 1002, 4002, 9002, 4, 5, 'GIAAAA', 'OADAAA', 'OOOOxx'),
+(1209, 2043, 1, 1, 9, 9, 9, 209, 1209, 1209, 1209, 18, 19, 'NUAAAA', 'PADAAA', 'VVVVxx'),
+(9983, 2044, 1, 3, 3, 3, 83, 983, 1983, 4983, 9983, 166, 167, 'ZTAAAA', 'QADAAA', 'AAAAxx'),
+(1761, 2045, 1, 1, 1, 1, 61, 761, 1761, 1761, 1761, 122, 123, 'TPAAAA', 'RADAAA', 'HHHHxx'),
+(7723, 2046, 1, 3, 3, 3, 23, 723, 1723, 2723, 7723, 46, 47, 'BLAAAA', 'SADAAA', 'OOOOxx'),
+(6518, 2047, 0, 2, 8, 18, 18, 518, 518, 1518, 6518, 36, 37, 'SQAAAA', 'TADAAA', 'VVVVxx'),
+(1372, 2048, 0, 0, 2, 12, 72, 372, 1372, 1372, 1372, 144, 145, 'UAAAAA', 'UADAAA', 'AAAAxx'),
+(3587, 2049, 1, 3, 7, 7, 87, 587, 1587, 3587, 3587, 174, 175, 'ZHAAAA', 'VADAAA', 'HHHHxx'),
+(5323, 2050, 1, 3, 3, 3, 23, 323, 1323, 323, 5323, 46, 47, 'TWAAAA', 'WADAAA', 'OOOOxx'),
+(5902, 2051, 0, 2, 2, 2, 2, 902, 1902, 902, 5902, 4, 5, 'ATAAAA', 'XADAAA', 'VVVVxx'),
+(3749, 2052, 1, 1, 9, 9, 49, 749, 1749, 3749, 3749, 98, 99, 'FOAAAA', 'YADAAA', 'AAAAxx'),
+(5965, 2053, 1, 1, 5, 5, 65, 965, 1965, 965, 5965, 130, 131, 'LVAAAA', 'ZADAAA', 'HHHHxx'),
+(663, 2054, 1, 3, 3, 3, 63, 663, 663, 663, 663, 126, 127, 'NZAAAA', 'ABDAAA', 'OOOOxx'),
+(36, 2055, 0, 0, 6, 16, 36, 36, 36, 36, 36, 72, 73, 'KBAAAA', 'BBDAAA', 'VVVVxx'),
+(9782, 2056, 0, 2, 2, 2, 82, 782, 1782, 4782, 9782, 164, 165, 'GMAAAA', 'CBDAAA', 'AAAAxx'),
+(5412, 2057, 0, 0, 2, 12, 12, 412, 1412, 412, 5412, 24, 25, 'EAAAAA', 'DBDAAA', 'HHHHxx'),
+(9961, 2058, 1, 1, 1, 1, 61, 961, 1961, 4961, 9961, 122, 123, 'DTAAAA', 'EBDAAA', 'OOOOxx'),
+(6492, 2059, 0, 0, 2, 12, 92, 492, 492, 1492, 6492, 184, 185, 'SPAAAA', 'FBDAAA', 'VVVVxx'),
+(4234, 2060, 0, 2, 4, 14, 34, 234, 234, 4234, 4234, 68, 69, 'WGAAAA', 'GBDAAA', 'AAAAxx'),
+(4922, 2061, 0, 2, 2, 2, 22, 922, 922, 4922, 4922, 44, 45, 'IHAAAA', 'HBDAAA', 'HHHHxx'),
+(6166, 2062, 0, 2, 6, 6, 66, 166, 166, 1166, 6166, 132, 133, 'EDAAAA', 'IBDAAA', 'OOOOxx'),
+(7019, 2063, 1, 3, 9, 19, 19, 19, 1019, 2019, 7019, 38, 39, 'ZJAAAA', 'JBDAAA', 'VVVVxx'),
+(7805, 2064, 1, 1, 5, 5, 5, 805, 1805, 2805, 7805, 10, 11, 'FOAAAA', 'KBDAAA', 'AAAAxx'),
+(9808, 2065, 0, 0, 8, 8, 8, 808, 1808, 4808, 9808, 16, 17, 'GNAAAA', 'LBDAAA', 'HHHHxx'),
+(2550, 2066, 0, 2, 0, 10, 50, 550, 550, 2550, 2550, 100, 101, 'CUAAAA', 'MBDAAA', 'OOOOxx'),
+(8626, 2067, 0, 2, 6, 6, 26, 626, 626, 3626, 8626, 52, 53, 'UTAAAA', 'NBDAAA', 'VVVVxx'),
+(5649, 2068, 1, 1, 9, 9, 49, 649, 1649, 649, 5649, 98, 99, 'HJAAAA', 'OBDAAA', 'AAAAxx'),
+(3117, 2069, 1, 1, 7, 17, 17, 117, 1117, 3117, 3117, 34, 35, 'XPAAAA', 'PBDAAA', 'HHHHxx'),
+(866, 2070, 0, 2, 6, 6, 66, 866, 866, 866, 866, 132, 133, 'IHAAAA', 'QBDAAA', 'OOOOxx'),
+(2323, 2071, 1, 3, 3, 3, 23, 323, 323, 2323, 2323, 46, 47, 'JLAAAA', 'RBDAAA', 'VVVVxx'),
+(5132, 2072, 0, 0, 2, 12, 32, 132, 1132, 132, 5132, 64, 65, 'KPAAAA', 'SBDAAA', 'AAAAxx'),
+(9222, 2073, 0, 2, 2, 2, 22, 222, 1222, 4222, 9222, 44, 45, 'SQAAAA', 'TBDAAA', 'HHHHxx'),
+(3934, 2074, 0, 2, 4, 14, 34, 934, 1934, 3934, 3934, 68, 69, 'IVAAAA', 'UBDAAA', 'OOOOxx'),
+(4845, 2075, 1, 1, 5, 5, 45, 845, 845, 4845, 4845, 90, 91, 'JEAAAA', 'VBDAAA', 'VVVVxx'),
+(7714, 2076, 0, 2, 4, 14, 14, 714, 1714, 2714, 7714, 28, 29, 'SKAAAA', 'WBDAAA', 'AAAAxx'),
+(9818, 2077, 0, 2, 8, 18, 18, 818, 1818, 4818, 9818, 36, 37, 'QNAAAA', 'XBDAAA', 'HHHHxx'),
+(2219, 2078, 1, 3, 9, 19, 19, 219, 219, 2219, 2219, 38, 39, 'JHAAAA', 'YBDAAA', 'OOOOxx'),
+(6573, 2079, 1, 1, 3, 13, 73, 573, 573, 1573, 6573, 146, 147, 'VSAAAA', 'ZBDAAA', 'VVVVxx'),
+(4555, 2080, 1, 3, 5, 15, 55, 555, 555, 4555, 4555, 110, 111, 'FTAAAA', 'ACDAAA', 'AAAAxx'),
+(7306, 2081, 0, 2, 6, 6, 6, 306, 1306, 2306, 7306, 12, 13, 'AVAAAA', 'BCDAAA', 'HHHHxx'),
+(9313, 2082, 1, 1, 3, 13, 13, 313, 1313, 4313, 9313, 26, 27, 'FUAAAA', 'CCDAAA', 'OOOOxx'),
+(3924, 2083, 0, 0, 4, 4, 24, 924, 1924, 3924, 3924, 48, 49, 'YUAAAA', 'DCDAAA', 'VVVVxx'),
+(5176, 2084, 0, 0, 6, 16, 76, 176, 1176, 176, 5176, 152, 153, 'CRAAAA', 'ECDAAA', 'AAAAxx'),
+(9767, 2085, 1, 3, 7, 7, 67, 767, 1767, 4767, 9767, 134, 135, 'RLAAAA', 'FCDAAA', 'HHHHxx'),
+(905, 2086, 1, 1, 5, 5, 5, 905, 905, 905, 905, 10, 11, 'VIAAAA', 'GCDAAA', 'OOOOxx'),
+(8037, 2087, 1, 1, 7, 17, 37, 37, 37, 3037, 8037, 74, 75, 'DXAAAA', 'HCDAAA', 'VVVVxx'),
+(8133, 2088, 1, 1, 3, 13, 33, 133, 133, 3133, 8133, 66, 67, 'VAAAAA', 'ICDAAA', 'AAAAxx'),
+(2954, 2089, 0, 2, 4, 14, 54, 954, 954, 2954, 2954, 108, 109, 'QJAAAA', 'JCDAAA', 'HHHHxx'),
+(7262, 2090, 0, 2, 2, 2, 62, 262, 1262, 2262, 7262, 124, 125, 'ITAAAA', 'KCDAAA', 'OOOOxx'),
+(8768, 2091, 0, 0, 8, 8, 68, 768, 768, 3768, 8768, 136, 137, 'GZAAAA', 'LCDAAA', 'VVVVxx'),
+(6953, 2092, 1, 1, 3, 13, 53, 953, 953, 1953, 6953, 106, 107, 'LHAAAA', 'MCDAAA', 'AAAAxx'),
+(1984, 2093, 0, 0, 4, 4, 84, 984, 1984, 1984, 1984, 168, 169, 'IYAAAA', 'NCDAAA', 'HHHHxx'),
+(9348, 2094, 0, 0, 8, 8, 48, 348, 1348, 4348, 9348, 96, 97, 'OVAAAA', 'OCDAAA', 'OOOOxx'),
+(7769, 2095, 1, 1, 9, 9, 69, 769, 1769, 2769, 7769, 138, 139, 'VMAAAA', 'PCDAAA', 'VVVVxx'),
+(2994, 2096, 0, 2, 4, 14, 94, 994, 994, 2994, 2994, 188, 189, 'ELAAAA', 'QCDAAA', 'AAAAxx'),
+(5938, 2097, 0, 2, 8, 18, 38, 938, 1938, 938, 5938, 76, 77, 'KUAAAA', 'RCDAAA', 'HHHHxx'),
+(556, 2098, 0, 0, 6, 16, 56, 556, 556, 556, 556, 112, 113, 'KVAAAA', 'SCDAAA', 'OOOOxx'),
+(2577, 2099, 1, 1, 7, 17, 77, 577, 577, 2577, 2577, 154, 155, 'DVAAAA', 'TCDAAA', 'VVVVxx'),
+(8733, 2100, 1, 1, 3, 13, 33, 733, 733, 3733, 8733, 66, 67, 'XXAAAA', 'UCDAAA', 'AAAAxx'),
+(3108, 2101, 0, 0, 8, 8, 8, 108, 1108, 3108, 3108, 16, 17, 'OPAAAA', 'VCDAAA', 'HHHHxx'),
+(4166, 2102, 0, 2, 6, 6, 66, 166, 166, 4166, 4166, 132, 133, 'GEAAAA', 'WCDAAA', 'OOOOxx'),
+(3170, 2103, 0, 2, 0, 10, 70, 170, 1170, 3170, 3170, 140, 141, 'YRAAAA', 'XCDAAA', 'VVVVxx'),
+(8118, 2104, 0, 2, 8, 18, 18, 118, 118, 3118, 8118, 36, 37, 'GAAAAA', 'YCDAAA', 'AAAAxx'),
+(8454, 2105, 0, 2, 4, 14, 54, 454, 454, 3454, 8454, 108, 109, 'ENAAAA', 'ZCDAAA', 'HHHHxx'),
+(5338, 2106, 0, 2, 8, 18, 38, 338, 1338, 338, 5338, 76, 77, 'IXAAAA', 'ADDAAA', 'OOOOxx'),
+(402, 2107, 0, 2, 2, 2, 2, 402, 402, 402, 402, 4, 5, 'MPAAAA', 'BDDAAA', 'VVVVxx'),
+(5673, 2108, 1, 1, 3, 13, 73, 673, 1673, 673, 5673, 146, 147, 'FKAAAA', 'CDDAAA', 'AAAAxx'),
+(4324, 2109, 0, 0, 4, 4, 24, 324, 324, 4324, 4324, 48, 49, 'IKAAAA', 'DDDAAA', 'HHHHxx'),
+(1943, 2110, 1, 3, 3, 3, 43, 943, 1943, 1943, 1943, 86, 87, 'TWAAAA', 'EDDAAA', 'OOOOxx'),
+(7703, 2111, 1, 3, 3, 3, 3, 703, 1703, 2703, 7703, 6, 7, 'HKAAAA', 'FDDAAA', 'VVVVxx'),
+(7180, 2112, 0, 0, 0, 0, 80, 180, 1180, 2180, 7180, 160, 161, 'EQAAAA', 'GDDAAA', 'AAAAxx'),
+(5478, 2113, 0, 2, 8, 18, 78, 478, 1478, 478, 5478, 156, 157, 'SCAAAA', 'HDDAAA', 'HHHHxx'),
+(5775, 2114, 1, 3, 5, 15, 75, 775, 1775, 775, 5775, 150, 151, 'DOAAAA', 'IDDAAA', 'OOOOxx'),
+(6952, 2115, 0, 0, 2, 12, 52, 952, 952, 1952, 6952, 104, 105, 'KHAAAA', 'JDDAAA', 'VVVVxx'),
+(9022, 2116, 0, 2, 2, 2, 22, 22, 1022, 4022, 9022, 44, 45, 'AJAAAA', 'KDDAAA', 'AAAAxx'),
+(547, 2117, 1, 3, 7, 7, 47, 547, 547, 547, 547, 94, 95, 'BVAAAA', 'LDDAAA', 'HHHHxx'),
+(5877, 2118, 1, 1, 7, 17, 77, 877, 1877, 877, 5877, 154, 155, 'BSAAAA', 'MDDAAA', 'OOOOxx'),
+(9580, 2119, 0, 0, 0, 0, 80, 580, 1580, 4580, 9580, 160, 161, 'MEAAAA', 'NDDAAA', 'VVVVxx'),
+(6094, 2120, 0, 2, 4, 14, 94, 94, 94, 1094, 6094, 188, 189, 'KAAAAA', 'ODDAAA', 'AAAAxx'),
+(3398, 2121, 0, 2, 8, 18, 98, 398, 1398, 3398, 3398, 196, 197, 'SAAAAA', 'PDDAAA', 'HHHHxx'),
+(4574, 2122, 0, 2, 4, 14, 74, 574, 574, 4574, 4574, 148, 149, 'YTAAAA', 'QDDAAA', 'OOOOxx'),
+(3675, 2123, 1, 3, 5, 15, 75, 675, 1675, 3675, 3675, 150, 151, 'JLAAAA', 'RDDAAA', 'VVVVxx'),
+(6413, 2124, 1, 1, 3, 13, 13, 413, 413, 1413, 6413, 26, 27, 'RMAAAA', 'SDDAAA', 'AAAAxx'),
+(9851, 2125, 1, 3, 1, 11, 51, 851, 1851, 4851, 9851, 102, 103, 'XOAAAA', 'TDDAAA', 'HHHHxx'),
+(126, 2126, 0, 2, 6, 6, 26, 126, 126, 126, 126, 52, 53, 'WEAAAA', 'UDDAAA', 'OOOOxx'),
+(6803, 2127, 1, 3, 3, 3, 3, 803, 803, 1803, 6803, 6, 7, 'RBAAAA', 'VDDAAA', 'VVVVxx'),
+(6949, 2128, 1, 1, 9, 9, 49, 949, 949, 1949, 6949, 98, 99, 'HHAAAA', 'WDDAAA', 'AAAAxx'),
+(115, 2129, 1, 3, 5, 15, 15, 115, 115, 115, 115, 30, 31, 'LEAAAA', 'XDDAAA', 'HHHHxx'),
+(4165, 2130, 1, 1, 5, 5, 65, 165, 165, 4165, 4165, 130, 131, 'FEAAAA', 'YDDAAA', 'OOOOxx'),
+(201, 2131, 1, 1, 1, 1, 1, 201, 201, 201, 201, 2, 3, 'THAAAA', 'ZDDAAA', 'VVVVxx'),
+(9324, 2132, 0, 0, 4, 4, 24, 324, 1324, 4324, 9324, 48, 49, 'QUAAAA', 'AEDAAA', 'AAAAxx'),
+(6562, 2133, 0, 2, 2, 2, 62, 562, 562, 1562, 6562, 124, 125, 'KSAAAA', 'BEDAAA', 'HHHHxx'),
+(1917, 2134, 1, 1, 7, 17, 17, 917, 1917, 1917, 1917, 34, 35, 'TVAAAA', 'CEDAAA', 'OOOOxx'),
+(558, 2135, 0, 2, 8, 18, 58, 558, 558, 558, 558, 116, 117, 'MVAAAA', 'DEDAAA', 'VVVVxx'),
+(8515, 2136, 1, 3, 5, 15, 15, 515, 515, 3515, 8515, 30, 31, 'NPAAAA', 'EEDAAA', 'AAAAxx'),
+(6321, 2137, 1, 1, 1, 1, 21, 321, 321, 1321, 6321, 42, 43, 'DJAAAA', 'FEDAAA', 'HHHHxx'),
+(6892, 2138, 0, 0, 2, 12, 92, 892, 892, 1892, 6892, 184, 185, 'CFAAAA', 'GEDAAA', 'OOOOxx'),
+(1001, 2139, 1, 1, 1, 1, 1, 1, 1001, 1001, 1001, 2, 3, 'NMAAAA', 'HEDAAA', 'VVVVxx'),
+(2858, 2140, 0, 2, 8, 18, 58, 858, 858, 2858, 2858, 116, 117, 'YFAAAA', 'IEDAAA', 'AAAAxx'),
+(2434, 2141, 0, 2, 4, 14, 34, 434, 434, 2434, 2434, 68, 69, 'QPAAAA', 'JEDAAA', 'HHHHxx'),
+(4460, 2142, 0, 0, 0, 0, 60, 460, 460, 4460, 4460, 120, 121, 'OPAAAA', 'KEDAAA', 'OOOOxx'),
+(5447, 2143, 1, 3, 7, 7, 47, 447, 1447, 447, 5447, 94, 95, 'NBAAAA', 'LEDAAA', 'VVVVxx'),
+(3799, 2144, 1, 3, 9, 19, 99, 799, 1799, 3799, 3799, 198, 199, 'DQAAAA', 'MEDAAA', 'AAAAxx'),
+(4310, 2145, 0, 2, 0, 10, 10, 310, 310, 4310, 4310, 20, 21, 'UJAAAA', 'NEDAAA', 'HHHHxx'),
+(405, 2146, 1, 1, 5, 5, 5, 405, 405, 405, 405, 10, 11, 'PPAAAA', 'OEDAAA', 'OOOOxx'),
+(4573, 2147, 1, 1, 3, 13, 73, 573, 573, 4573, 4573, 146, 147, 'XTAAAA', 'PEDAAA', 'VVVVxx'),
+(706, 2148, 0, 2, 6, 6, 6, 706, 706, 706, 706, 12, 13, 'EBAAAA', 'QEDAAA', 'AAAAxx'),
+(7619, 2149, 1, 3, 9, 19, 19, 619, 1619, 2619, 7619, 38, 39, 'BHAAAA', 'REDAAA', 'HHHHxx'),
+(7959, 2150, 1, 3, 9, 19, 59, 959, 1959, 2959, 7959, 118, 119, 'DUAAAA', 'SEDAAA', 'OOOOxx'),
+(6712, 2151, 0, 0, 2, 12, 12, 712, 712, 1712, 6712, 24, 25, 'EYAAAA', 'TEDAAA', 'VVVVxx'),
+(6959, 2152, 1, 3, 9, 19, 59, 959, 959, 1959, 6959, 118, 119, 'RHAAAA', 'UEDAAA', 'AAAAxx'),
+(9791, 2153, 1, 3, 1, 11, 91, 791, 1791, 4791, 9791, 182, 183, 'PMAAAA', 'VEDAAA', 'HHHHxx'),
+(2112, 2154, 0, 0, 2, 12, 12, 112, 112, 2112, 2112, 24, 25, 'GDAAAA', 'WEDAAA', 'OOOOxx'),
+(9114, 2155, 0, 2, 4, 14, 14, 114, 1114, 4114, 9114, 28, 29, 'OMAAAA', 'XEDAAA', 'VVVVxx'),
+(3506, 2156, 0, 2, 6, 6, 6, 506, 1506, 3506, 3506, 12, 13, 'WEAAAA', 'YEDAAA', 'AAAAxx'),
+(5002, 2157, 0, 2, 2, 2, 2, 2, 1002, 2, 5002, 4, 5, 'KKAAAA', 'ZEDAAA', 'HHHHxx'),
+(3518, 2158, 0, 2, 8, 18, 18, 518, 1518, 3518, 3518, 36, 37, 'IFAAAA', 'AFDAAA', 'OOOOxx'),
+(602, 2159, 0, 2, 2, 2, 2, 602, 602, 602, 602, 4, 5, 'EXAAAA', 'BFDAAA', 'VVVVxx'),
+(9060, 2160, 0, 0, 0, 0, 60, 60, 1060, 4060, 9060, 120, 121, 'MKAAAA', 'CFDAAA', 'AAAAxx'),
+(3292, 2161, 0, 0, 2, 12, 92, 292, 1292, 3292, 3292, 184, 185, 'QWAAAA', 'DFDAAA', 'HHHHxx'),
+(77, 2162, 1, 1, 7, 17, 77, 77, 77, 77, 77, 154, 155, 'ZCAAAA', 'EFDAAA', 'OOOOxx'),
+(1420, 2163, 0, 0, 0, 0, 20, 420, 1420, 1420, 1420, 40, 41, 'QCAAAA', 'FFDAAA', 'VVVVxx'),
+(6001, 2164, 1, 1, 1, 1, 1, 1, 1, 1001, 6001, 2, 3, 'VWAAAA', 'GFDAAA', 'AAAAxx'),
+(7477, 2165, 1, 1, 7, 17, 77, 477, 1477, 2477, 7477, 154, 155, 'PBAAAA', 'HFDAAA', 'HHHHxx'),
+(6655, 2166, 1, 3, 5, 15, 55, 655, 655, 1655, 6655, 110, 111, 'ZVAAAA', 'IFDAAA', 'OOOOxx'),
+(7845, 2167, 1, 1, 5, 5, 45, 845, 1845, 2845, 7845, 90, 91, 'TPAAAA', 'JFDAAA', 'VVVVxx'),
+(8484, 2168, 0, 0, 4, 4, 84, 484, 484, 3484, 8484, 168, 169, 'IOAAAA', 'KFDAAA', 'AAAAxx'),
+(4345, 2169, 1, 1, 5, 5, 45, 345, 345, 4345, 4345, 90, 91, 'DLAAAA', 'LFDAAA', 'HHHHxx'),
+(4250, 2170, 0, 2, 0, 10, 50, 250, 250, 4250, 4250, 100, 101, 'MHAAAA', 'MFDAAA', 'OOOOxx'),
+(2391, 2171, 1, 3, 1, 11, 91, 391, 391, 2391, 2391, 182, 183, 'ZNAAAA', 'NFDAAA', 'VVVVxx'),
+(6884, 2172, 0, 0, 4, 4, 84, 884, 884, 1884, 6884, 168, 169, 'UEAAAA', 'OFDAAA', 'AAAAxx'),
+(7270, 2173, 0, 2, 0, 10, 70, 270, 1270, 2270, 7270, 140, 141, 'QTAAAA', 'PFDAAA', 'HHHHxx'),
+(2499, 2174, 1, 3, 9, 19, 99, 499, 499, 2499, 2499, 198, 199, 'DSAAAA', 'QFDAAA', 'OOOOxx'),
+(7312, 2175, 0, 0, 2, 12, 12, 312, 1312, 2312, 7312, 24, 25, 'GVAAAA', 'RFDAAA', 'VVVVxx'),
+(7113, 2176, 1, 1, 3, 13, 13, 113, 1113, 2113, 7113, 26, 27, 'PNAAAA', 'SFDAAA', 'AAAAxx'),
+(6695, 2177, 1, 3, 5, 15, 95, 695, 695, 1695, 6695, 190, 191, 'NXAAAA', 'TFDAAA', 'HHHHxx'),
+(6521, 2178, 1, 1, 1, 1, 21, 521, 521, 1521, 6521, 42, 43, 'VQAAAA', 'UFDAAA', 'OOOOxx'),
+(272, 2179, 0, 0, 2, 12, 72, 272, 272, 272, 272, 144, 145, 'MKAAAA', 'VFDAAA', 'VVVVxx'),
+(9976, 2180, 0, 0, 6, 16, 76, 976, 1976, 4976, 9976, 152, 153, 'STAAAA', 'WFDAAA', 'AAAAxx'),
+(992, 2181, 0, 0, 2, 12, 92, 992, 992, 992, 992, 184, 185, 'EMAAAA', 'XFDAAA', 'HHHHxx'),
+(6158, 2182, 0, 2, 8, 18, 58, 158, 158, 1158, 6158, 116, 117, 'WCAAAA', 'YFDAAA', 'OOOOxx'),
+(3281, 2183, 1, 1, 1, 1, 81, 281, 1281, 3281, 3281, 162, 163, 'FWAAAA', 'ZFDAAA', 'VVVVxx'),
+(7446, 2184, 0, 2, 6, 6, 46, 446, 1446, 2446, 7446, 92, 93, 'KAAAAA', 'AGDAAA', 'AAAAxx'),
+(4679, 2185, 1, 3, 9, 19, 79, 679, 679, 4679, 4679, 158, 159, 'ZXAAAA', 'BGDAAA', 'HHHHxx'),
+(5203, 2186, 1, 3, 3, 3, 3, 203, 1203, 203, 5203, 6, 7, 'DSAAAA', 'CGDAAA', 'OOOOxx'),
+(9874, 2187, 0, 2, 4, 14, 74, 874, 1874, 4874, 9874, 148, 149, 'UPAAAA', 'DGDAAA', 'VVVVxx'),
+(8371, 2188, 1, 3, 1, 11, 71, 371, 371, 3371, 8371, 142, 143, 'ZJAAAA', 'EGDAAA', 'AAAAxx'),
+(9086, 2189, 0, 2, 6, 6, 86, 86, 1086, 4086, 9086, 172, 173, 'MLAAAA', 'FGDAAA', 'HHHHxx'),
+(430, 2190, 0, 2, 0, 10, 30, 430, 430, 430, 430, 60, 61, 'OQAAAA', 'GGDAAA', 'OOOOxx'),
+(8749, 2191, 1, 1, 9, 9, 49, 749, 749, 3749, 8749, 98, 99, 'NYAAAA', 'HGDAAA', 'VVVVxx'),
+(577, 2192, 1, 1, 7, 17, 77, 577, 577, 577, 577, 154, 155, 'FWAAAA', 'IGDAAA', 'AAAAxx'),
+(4884, 2193, 0, 0, 4, 4, 84, 884, 884, 4884, 4884, 168, 169, 'WFAAAA', 'JGDAAA', 'HHHHxx'),
+(3421, 2194, 1, 1, 1, 1, 21, 421, 1421, 3421, 3421, 42, 43, 'PBAAAA', 'KGDAAA', 'OOOOxx'),
+(2812, 2195, 0, 0, 2, 12, 12, 812, 812, 2812, 2812, 24, 25, 'EEAAAA', 'LGDAAA', 'VVVVxx'),
+(5958, 2196, 0, 2, 8, 18, 58, 958, 1958, 958, 5958, 116, 117, 'EVAAAA', 'MGDAAA', 'AAAAxx'),
+(9901, 2197, 1, 1, 1, 1, 1, 901, 1901, 4901, 9901, 2, 3, 'VQAAAA', 'NGDAAA', 'HHHHxx'),
+(8478, 2198, 0, 2, 8, 18, 78, 478, 478, 3478, 8478, 156, 157, 'COAAAA', 'OGDAAA', 'OOOOxx'),
+(6545, 2199, 1, 1, 5, 5, 45, 545, 545, 1545, 6545, 90, 91, 'TRAAAA', 'PGDAAA', 'VVVVxx'),
+(1479, 2200, 1, 3, 9, 19, 79, 479, 1479, 1479, 1479, 158, 159, 'XEAAAA', 'QGDAAA', 'AAAAxx'),
+(1046, 2201, 0, 2, 6, 6, 46, 46, 1046, 1046, 1046, 92, 93, 'GOAAAA', 'RGDAAA', 'HHHHxx'),
+(6372, 2202, 0, 0, 2, 12, 72, 372, 372, 1372, 6372, 144, 145, 'CLAAAA', 'SGDAAA', 'OOOOxx'),
+(8206, 2203, 0, 2, 6, 6, 6, 206, 206, 3206, 8206, 12, 13, 'QDAAAA', 'TGDAAA', 'VVVVxx'),
+(9544, 2204, 0, 0, 4, 4, 44, 544, 1544, 4544, 9544, 88, 89, 'CDAAAA', 'UGDAAA', 'AAAAxx'),
+(9287, 2205, 1, 3, 7, 7, 87, 287, 1287, 4287, 9287, 174, 175, 'FTAAAA', 'VGDAAA', 'HHHHxx'),
+(6786, 2206, 0, 2, 6, 6, 86, 786, 786, 1786, 6786, 172, 173, 'ABAAAA', 'WGDAAA', 'OOOOxx'),
+(6511, 2207, 1, 3, 1, 11, 11, 511, 511, 1511, 6511, 22, 23, 'LQAAAA', 'XGDAAA', 'VVVVxx'),
+(603, 2208, 1, 3, 3, 3, 3, 603, 603, 603, 603, 6, 7, 'FXAAAA', 'YGDAAA', 'AAAAxx'),
+(2022, 2209, 0, 2, 2, 2, 22, 22, 22, 2022, 2022, 44, 45, 'UZAAAA', 'ZGDAAA', 'HHHHxx'),
+(2086, 2210, 0, 2, 6, 6, 86, 86, 86, 2086, 2086, 172, 173, 'GCAAAA', 'AHDAAA', 'OOOOxx'),
+(1969, 2211, 1, 1, 9, 9, 69, 969, 1969, 1969, 1969, 138, 139, 'TXAAAA', 'BHDAAA', 'VVVVxx'),
+(4841, 2212, 1, 1, 1, 1, 41, 841, 841, 4841, 4841, 82, 83, 'FEAAAA', 'CHDAAA', 'AAAAxx'),
+(5845, 2213, 1, 1, 5, 5, 45, 845, 1845, 845, 5845, 90, 91, 'VQAAAA', 'DHDAAA', 'HHHHxx'),
+(4635, 2214, 1, 3, 5, 15, 35, 635, 635, 4635, 4635, 70, 71, 'HWAAAA', 'EHDAAA', 'OOOOxx'),
+(4658, 2215, 0, 2, 8, 18, 58, 658, 658, 4658, 4658, 116, 117, 'EXAAAA', 'FHDAAA', 'VVVVxx'),
+(2896, 2216, 0, 0, 6, 16, 96, 896, 896, 2896, 2896, 192, 193, 'KHAAAA', 'GHDAAA', 'AAAAxx'),
+(5179, 2217, 1, 3, 9, 19, 79, 179, 1179, 179, 5179, 158, 159, 'FRAAAA', 'HHDAAA', 'HHHHxx'),
+(8667, 2218, 1, 3, 7, 7, 67, 667, 667, 3667, 8667, 134, 135, 'JVAAAA', 'IHDAAA', 'OOOOxx'),
+(7294, 2219, 0, 2, 4, 14, 94, 294, 1294, 2294, 7294, 188, 189, 'OUAAAA', 'JHDAAA', 'VVVVxx'),
+(3706, 2220, 0, 2, 6, 6, 6, 706, 1706, 3706, 3706, 12, 13, 'OMAAAA', 'KHDAAA', 'AAAAxx'),
+(8389, 2221, 1, 1, 9, 9, 89, 389, 389, 3389, 8389, 178, 179, 'RKAAAA', 'LHDAAA', 'HHHHxx'),
+(2486, 2222, 0, 2, 6, 6, 86, 486, 486, 2486, 2486, 172, 173, 'QRAAAA', 'MHDAAA', 'OOOOxx'),
+(8743, 2223, 1, 3, 3, 3, 43, 743, 743, 3743, 8743, 86, 87, 'HYAAAA', 'NHDAAA', 'VVVVxx'),
+(2777, 2224, 1, 1, 7, 17, 77, 777, 777, 2777, 2777, 154, 155, 'VCAAAA', 'OHDAAA', 'AAAAxx'),
+(2113, 2225, 1, 1, 3, 13, 13, 113, 113, 2113, 2113, 26, 27, 'HDAAAA', 'PHDAAA', 'HHHHxx'),
+(2076, 2226, 0, 0, 6, 16, 76, 76, 76, 2076, 2076, 152, 153, 'WBAAAA', 'QHDAAA', 'OOOOxx'),
+(2300, 2227, 0, 0, 0, 0, 0, 300, 300, 2300, 2300, 0, 1, 'MKAAAA', 'RHDAAA', 'VVVVxx'),
+(6894, 2228, 0, 2, 4, 14, 94, 894, 894, 1894, 6894, 188, 189, 'EFAAAA', 'SHDAAA', 'AAAAxx'),
+(6939, 2229, 1, 3, 9, 19, 39, 939, 939, 1939, 6939, 78, 79, 'XGAAAA', 'THDAAA', 'HHHHxx'),
+(446, 2230, 0, 2, 6, 6, 46, 446, 446, 446, 446, 92, 93, 'ERAAAA', 'UHDAAA', 'OOOOxx'),
+(6218, 2231, 0, 2, 8, 18, 18, 218, 218, 1218, 6218, 36, 37, 'EFAAAA', 'VHDAAA', 'VVVVxx'),
+(1295, 2232, 1, 3, 5, 15, 95, 295, 1295, 1295, 1295, 190, 191, 'VXAAAA', 'WHDAAA', 'AAAAxx'),
+(5135, 2233, 1, 3, 5, 15, 35, 135, 1135, 135, 5135, 70, 71, 'NPAAAA', 'XHDAAA', 'HHHHxx'),
+(8122, 2234, 0, 2, 2, 2, 22, 122, 122, 3122, 8122, 44, 45, 'KAAAAA', 'YHDAAA', 'OOOOxx'),
+(316, 2235, 0, 0, 6, 16, 16, 316, 316, 316, 316, 32, 33, 'EMAAAA', 'ZHDAAA', 'VVVVxx'),
+(514, 2236, 0, 2, 4, 14, 14, 514, 514, 514, 514, 28, 29, 'UTAAAA', 'AIDAAA', 'AAAAxx'),
+(7970, 2237, 0, 2, 0, 10, 70, 970, 1970, 2970, 7970, 140, 141, 'OUAAAA', 'BIDAAA', 'HHHHxx'),
+(9350, 2238, 0, 2, 0, 10, 50, 350, 1350, 4350, 9350, 100, 101, 'QVAAAA', 'CIDAAA', 'OOOOxx'),
+(3700, 2239, 0, 0, 0, 0, 0, 700, 1700, 3700, 3700, 0, 1, 'IMAAAA', 'DIDAAA', 'VVVVxx'),
+(582, 2240, 0, 2, 2, 2, 82, 582, 582, 582, 582, 164, 165, 'KWAAAA', 'EIDAAA', 'AAAAxx'),
+(9722, 2241, 0, 2, 2, 2, 22, 722, 1722, 4722, 9722, 44, 45, 'YJAAAA', 'FIDAAA', 'HHHHxx'),
+(7398, 2242, 0, 2, 8, 18, 98, 398, 1398, 2398, 7398, 196, 197, 'OYAAAA', 'GIDAAA', 'OOOOxx'),
+(2265, 2243, 1, 1, 5, 5, 65, 265, 265, 2265, 2265, 130, 131, 'DJAAAA', 'HIDAAA', 'VVVVxx'),
+(3049, 2244, 1, 1, 9, 9, 49, 49, 1049, 3049, 3049, 98, 99, 'HNAAAA', 'IIDAAA', 'AAAAxx'),
+(9121, 2245, 1, 1, 1, 1, 21, 121, 1121, 4121, 9121, 42, 43, 'VMAAAA', 'JIDAAA', 'HHHHxx'),
+(4275, 2246, 1, 3, 5, 15, 75, 275, 275, 4275, 4275, 150, 151, 'LIAAAA', 'KIDAAA', 'OOOOxx'),
+(6567, 2247, 1, 3, 7, 7, 67, 567, 567, 1567, 6567, 134, 135, 'PSAAAA', 'LIDAAA', 'VVVVxx'),
+(6755, 2248, 1, 3, 5, 15, 55, 755, 755, 1755, 6755, 110, 111, 'VZAAAA', 'MIDAAA', 'AAAAxx'),
+(4535, 2249, 1, 3, 5, 15, 35, 535, 535, 4535, 4535, 70, 71, 'LSAAAA', 'NIDAAA', 'HHHHxx'),
+(7968, 2250, 0, 0, 8, 8, 68, 968, 1968, 2968, 7968, 136, 137, 'MUAAAA', 'OIDAAA', 'OOOOxx'),
+(3412, 2251, 0, 0, 2, 12, 12, 412, 1412, 3412, 3412, 24, 25, 'GBAAAA', 'PIDAAA', 'VVVVxx'),
+(6112, 2252, 0, 0, 2, 12, 12, 112, 112, 1112, 6112, 24, 25, 'CBAAAA', 'QIDAAA', 'AAAAxx'),
+(6805, 2253, 1, 1, 5, 5, 5, 805, 805, 1805, 6805, 10, 11, 'TBAAAA', 'RIDAAA', 'HHHHxx'),
+(2880, 2254, 0, 0, 0, 0, 80, 880, 880, 2880, 2880, 160, 161, 'UGAAAA', 'SIDAAA', 'OOOOxx'),
+(7710, 2255, 0, 2, 0, 10, 10, 710, 1710, 2710, 7710, 20, 21, 'OKAAAA', 'TIDAAA', 'VVVVxx'),
+(7949, 2256, 1, 1, 9, 9, 49, 949, 1949, 2949, 7949, 98, 99, 'TTAAAA', 'UIDAAA', 'AAAAxx'),
+(7043, 2257, 1, 3, 3, 3, 43, 43, 1043, 2043, 7043, 86, 87, 'XKAAAA', 'VIDAAA', 'HHHHxx'),
+(9012, 2258, 0, 0, 2, 12, 12, 12, 1012, 4012, 9012, 24, 25, 'QIAAAA', 'WIDAAA', 'OOOOxx'),
+(878, 2259, 0, 2, 8, 18, 78, 878, 878, 878, 878, 156, 157, 'UHAAAA', 'XIDAAA', 'VVVVxx'),
+(7930, 2260, 0, 2, 0, 10, 30, 930, 1930, 2930, 7930, 60, 61, 'ATAAAA', 'YIDAAA', 'AAAAxx'),
+(667, 2261, 1, 3, 7, 7, 67, 667, 667, 667, 667, 134, 135, 'RZAAAA', 'ZIDAAA', 'HHHHxx'),
+(1905, 2262, 1, 1, 5, 5, 5, 905, 1905, 1905, 1905, 10, 11, 'HVAAAA', 'AJDAAA', 'OOOOxx'),
+(4958, 2263, 0, 2, 8, 18, 58, 958, 958, 4958, 4958, 116, 117, 'SIAAAA', 'BJDAAA', 'VVVVxx'),
+(2973, 2264, 1, 1, 3, 13, 73, 973, 973, 2973, 2973, 146, 147, 'JKAAAA', 'CJDAAA', 'AAAAxx'),
+(3631, 2265, 1, 3, 1, 11, 31, 631, 1631, 3631, 3631, 62, 63, 'RJAAAA', 'DJDAAA', 'HHHHxx'),
+(5868, 2266, 0, 0, 8, 8, 68, 868, 1868, 868, 5868, 136, 137, 'SRAAAA', 'EJDAAA', 'OOOOxx'),
+(2873, 2267, 1, 1, 3, 13, 73, 873, 873, 2873, 2873, 146, 147, 'NGAAAA', 'FJDAAA', 'VVVVxx'),
+(6941, 2268, 1, 1, 1, 1, 41, 941, 941, 1941, 6941, 82, 83, 'ZGAAAA', 'GJDAAA', 'AAAAxx'),
+(6384, 2269, 0, 0, 4, 4, 84, 384, 384, 1384, 6384, 168, 169, 'OLAAAA', 'HJDAAA', 'HHHHxx'),
+(3806, 2270, 0, 2, 6, 6, 6, 806, 1806, 3806, 3806, 12, 13, 'KQAAAA', 'IJDAAA', 'OOOOxx'),
+(5079, 2271, 1, 3, 9, 19, 79, 79, 1079, 79, 5079, 158, 159, 'JNAAAA', 'JJDAAA', 'VVVVxx'),
+(1970, 2272, 0, 2, 0, 10, 70, 970, 1970, 1970, 1970, 140, 141, 'UXAAAA', 'KJDAAA', 'AAAAxx'),
+(7810, 2273, 0, 2, 0, 10, 10, 810, 1810, 2810, 7810, 20, 21, 'KOAAAA', 'LJDAAA', 'HHHHxx'),
+(4639, 2274, 1, 3, 9, 19, 39, 639, 639, 4639, 4639, 78, 79, 'LWAAAA', 'MJDAAA', 'OOOOxx'),
+(6527, 2275, 1, 3, 7, 7, 27, 527, 527, 1527, 6527, 54, 55, 'BRAAAA', 'NJDAAA', 'VVVVxx'),
+(8079, 2276, 1, 3, 9, 19, 79, 79, 79, 3079, 8079, 158, 159, 'TYAAAA', 'OJDAAA', 'AAAAxx'),
+(2740, 2277, 0, 0, 0, 0, 40, 740, 740, 2740, 2740, 80, 81, 'KBAAAA', 'PJDAAA', 'HHHHxx'),
+(2337, 2278, 1, 1, 7, 17, 37, 337, 337, 2337, 2337, 74, 75, 'XLAAAA', 'QJDAAA', 'OOOOxx'),
+(6670, 2279, 0, 2, 0, 10, 70, 670, 670, 1670, 6670, 140, 141, 'OWAAAA', 'RJDAAA', 'VVVVxx'),
+(2345, 2280, 1, 1, 5, 5, 45, 345, 345, 2345, 2345, 90, 91, 'FMAAAA', 'SJDAAA', 'AAAAxx'),
+(401, 2281, 1, 1, 1, 1, 1, 401, 401, 401, 401, 2, 3, 'LPAAAA', 'TJDAAA', 'HHHHxx'),
+(2704, 2282, 0, 0, 4, 4, 4, 704, 704, 2704, 2704, 8, 9, 'AAAAAA', 'UJDAAA', 'OOOOxx'),
+(5530, 2283, 0, 2, 0, 10, 30, 530, 1530, 530, 5530, 60, 61, 'SEAAAA', 'VJDAAA', 'VVVVxx'),
+(51, 2284, 1, 3, 1, 11, 51, 51, 51, 51, 51, 102, 103, 'ZBAAAA', 'WJDAAA', 'AAAAxx'),
+(4282, 2285, 0, 2, 2, 2, 82, 282, 282, 4282, 4282, 164, 165, 'SIAAAA', 'XJDAAA', 'HHHHxx'),
+(7336, 2286, 0, 0, 6, 16, 36, 336, 1336, 2336, 7336, 72, 73, 'EWAAAA', 'YJDAAA', 'OOOOxx'),
+(8320, 2287, 0, 0, 0, 0, 20, 320, 320, 3320, 8320, 40, 41, 'AIAAAA', 'ZJDAAA', 'VVVVxx'),
+(7772, 2288, 0, 0, 2, 12, 72, 772, 1772, 2772, 7772, 144, 145, 'YMAAAA', 'AKDAAA', 'AAAAxx'),
+(1894, 2289, 0, 2, 4, 14, 94, 894, 1894, 1894, 1894, 188, 189, 'WUAAAA', 'BKDAAA', 'HHHHxx'),
+(2320, 2290, 0, 0, 0, 0, 20, 320, 320, 2320, 2320, 40, 41, 'GLAAAA', 'CKDAAA', 'OOOOxx'),
+(6232, 2291, 0, 0, 2, 12, 32, 232, 232, 1232, 6232, 64, 65, 'SFAAAA', 'DKDAAA', 'VVVVxx'),
+(2833, 2292, 1, 1, 3, 13, 33, 833, 833, 2833, 2833, 66, 67, 'ZEAAAA', 'EKDAAA', 'AAAAxx'),
+(8265, 2293, 1, 1, 5, 5, 65, 265, 265, 3265, 8265, 130, 131, 'XFAAAA', 'FKDAAA', 'HHHHxx'),
+(4589, 2294, 1, 1, 9, 9, 89, 589, 589, 4589, 4589, 178, 179, 'NUAAAA', 'GKDAAA', 'OOOOxx'),
+(8182, 2295, 0, 2, 2, 2, 82, 182, 182, 3182, 8182, 164, 165, 'SCAAAA', 'HKDAAA', 'VVVVxx'),
+(8337, 2296, 1, 1, 7, 17, 37, 337, 337, 3337, 8337, 74, 75, 'RIAAAA', 'IKDAAA', 'AAAAxx'),
+(8210, 2297, 0, 2, 0, 10, 10, 210, 210, 3210, 8210, 20, 21, 'UDAAAA', 'JKDAAA', 'HHHHxx'),
+(1406, 2298, 0, 2, 6, 6, 6, 406, 1406, 1406, 1406, 12, 13, 'CCAAAA', 'KKDAAA', 'OOOOxx'),
+(4463, 2299, 1, 3, 3, 3, 63, 463, 463, 4463, 4463, 126, 127, 'RPAAAA', 'LKDAAA', 'VVVVxx'),
+(4347, 2300, 1, 3, 7, 7, 47, 347, 347, 4347, 4347, 94, 95, 'FLAAAA', 'MKDAAA', 'AAAAxx'),
+(181, 2301, 1, 1, 1, 1, 81, 181, 181, 181, 181, 162, 163, 'ZGAAAA', 'NKDAAA', 'HHHHxx'),
+(9986, 2302, 0, 2, 6, 6, 86, 986, 1986, 4986, 9986, 172, 173, 'CUAAAA', 'OKDAAA', 'OOOOxx'),
+(661, 2303, 1, 1, 1, 1, 61, 661, 661, 661, 661, 122, 123, 'LZAAAA', 'PKDAAA', 'VVVVxx'),
+(4105, 2304, 1, 1, 5, 5, 5, 105, 105, 4105, 4105, 10, 11, 'XBAAAA', 'QKDAAA', 'AAAAxx'),
+(2187, 2305, 1, 3, 7, 7, 87, 187, 187, 2187, 2187, 174, 175, 'DGAAAA', 'RKDAAA', 'HHHHxx'),
+(1628, 2306, 0, 0, 8, 8, 28, 628, 1628, 1628, 1628, 56, 57, 'QKAAAA', 'SKDAAA', 'OOOOxx'),
+(3119, 2307, 1, 3, 9, 19, 19, 119, 1119, 3119, 3119, 38, 39, 'ZPAAAA', 'TKDAAA', 'VVVVxx'),
+(6804, 2308, 0, 0, 4, 4, 4, 804, 804, 1804, 6804, 8, 9, 'SBAAAA', 'UKDAAA', 'AAAAxx'),
+(9918, 2309, 0, 2, 8, 18, 18, 918, 1918, 4918, 9918, 36, 37, 'MRAAAA', 'VKDAAA', 'HHHHxx'),
+(8916, 2310, 0, 0, 6, 16, 16, 916, 916, 3916, 8916, 32, 33, 'YEAAAA', 'WKDAAA', 'OOOOxx'),
+(6057, 2311, 1, 1, 7, 17, 57, 57, 57, 1057, 6057, 114, 115, 'ZYAAAA', 'XKDAAA', 'VVVVxx'),
+(3622, 2312, 0, 2, 2, 2, 22, 622, 1622, 3622, 3622, 44, 45, 'IJAAAA', 'YKDAAA', 'AAAAxx'),
+(9168, 2313, 0, 0, 8, 8, 68, 168, 1168, 4168, 9168, 136, 137, 'QOAAAA', 'ZKDAAA', 'HHHHxx'),
+(3720, 2314, 0, 0, 0, 0, 20, 720, 1720, 3720, 3720, 40, 41, 'CNAAAA', 'ALDAAA', 'OOOOxx'),
+(9927, 2315, 1, 3, 7, 7, 27, 927, 1927, 4927, 9927, 54, 55, 'VRAAAA', 'BLDAAA', 'VVVVxx'),
+(5616, 2316, 0, 0, 6, 16, 16, 616, 1616, 616, 5616, 32, 33, 'AIAAAA', 'CLDAAA', 'AAAAxx'),
+(5210, 2317, 0, 2, 0, 10, 10, 210, 1210, 210, 5210, 20, 21, 'KSAAAA', 'DLDAAA', 'HHHHxx'),
+(636, 2318, 0, 0, 6, 16, 36, 636, 636, 636, 636, 72, 73, 'MYAAAA', 'ELDAAA', 'OOOOxx'),
+(9936, 2319, 0, 0, 6, 16, 36, 936, 1936, 4936, 9936, 72, 73, 'ESAAAA', 'FLDAAA', 'VVVVxx'),
+(2316, 2320, 0, 0, 6, 16, 16, 316, 316, 2316, 2316, 32, 33, 'CLAAAA', 'GLDAAA', 'AAAAxx'),
+(4363, 2321, 1, 3, 3, 3, 63, 363, 363, 4363, 4363, 126, 127, 'VLAAAA', 'HLDAAA', 'HHHHxx'),
+(7657, 2322, 1, 1, 7, 17, 57, 657, 1657, 2657, 7657, 114, 115, 'NIAAAA', 'ILDAAA', 'OOOOxx'),
+(697, 2323, 1, 1, 7, 17, 97, 697, 697, 697, 697, 194, 195, 'VAAAAA', 'JLDAAA', 'VVVVxx'),
+(912, 2324, 0, 0, 2, 12, 12, 912, 912, 912, 912, 24, 25, 'CJAAAA', 'KLDAAA', 'AAAAxx'),
+(8806, 2325, 0, 2, 6, 6, 6, 806, 806, 3806, 8806, 12, 13, 'SAAAAA', 'LLDAAA', 'HHHHxx'),
+(9698, 2326, 0, 2, 8, 18, 98, 698, 1698, 4698, 9698, 196, 197, 'AJAAAA', 'MLDAAA', 'OOOOxx'),
+(6191, 2327, 1, 3, 1, 11, 91, 191, 191, 1191, 6191, 182, 183, 'DEAAAA', 'NLDAAA', 'VVVVxx'),
+(1188, 2328, 0, 0, 8, 8, 88, 188, 1188, 1188, 1188, 176, 177, 'STAAAA', 'OLDAAA', 'AAAAxx'),
+(7676, 2329, 0, 0, 6, 16, 76, 676, 1676, 2676, 7676, 152, 153, 'GJAAAA', 'PLDAAA', 'HHHHxx'),
+(7073, 2330, 1, 1, 3, 13, 73, 73, 1073, 2073, 7073, 146, 147, 'BMAAAA', 'QLDAAA', 'OOOOxx'),
+(8019, 2331, 1, 3, 9, 19, 19, 19, 19, 3019, 8019, 38, 39, 'LWAAAA', 'RLDAAA', 'VVVVxx'),
+(4726, 2332, 0, 2, 6, 6, 26, 726, 726, 4726, 4726, 52, 53, 'UZAAAA', 'SLDAAA', 'AAAAxx'),
+(4648, 2333, 0, 0, 8, 8, 48, 648, 648, 4648, 4648, 96, 97, 'UWAAAA', 'TLDAAA', 'HHHHxx'),
+(3227, 2334, 1, 3, 7, 7, 27, 227, 1227, 3227, 3227, 54, 55, 'DUAAAA', 'ULDAAA', 'OOOOxx'),
+(7232, 2335, 0, 0, 2, 12, 32, 232, 1232, 2232, 7232, 64, 65, 'ESAAAA', 'VLDAAA', 'VVVVxx'),
+(9761, 2336, 1, 1, 1, 1, 61, 761, 1761, 4761, 9761, 122, 123, 'LLAAAA', 'WLDAAA', 'AAAAxx'),
+(3105, 2337, 1, 1, 5, 5, 5, 105, 1105, 3105, 3105, 10, 11, 'LPAAAA', 'XLDAAA', 'HHHHxx'),
+(5266, 2338, 0, 2, 6, 6, 66, 266, 1266, 266, 5266, 132, 133, 'OUAAAA', 'YLDAAA', 'OOOOxx'),
+(6788, 2339, 0, 0, 8, 8, 88, 788, 788, 1788, 6788, 176, 177, 'CBAAAA', 'ZLDAAA', 'VVVVxx'),
+(2442, 2340, 0, 2, 2, 2, 42, 442, 442, 2442, 2442, 84, 85, 'YPAAAA', 'AMDAAA', 'AAAAxx'),
+(8198, 2341, 0, 2, 8, 18, 98, 198, 198, 3198, 8198, 196, 197, 'IDAAAA', 'BMDAAA', 'HHHHxx'),
+(5806, 2342, 0, 2, 6, 6, 6, 806, 1806, 806, 5806, 12, 13, 'IPAAAA', 'CMDAAA', 'OOOOxx'),
+(8928, 2343, 0, 0, 8, 8, 28, 928, 928, 3928, 8928, 56, 57, 'KFAAAA', 'DMDAAA', 'VVVVxx'),
+(1657, 2344, 1, 1, 7, 17, 57, 657, 1657, 1657, 1657, 114, 115, 'TLAAAA', 'EMDAAA', 'AAAAxx'),
+(9164, 2345, 0, 0, 4, 4, 64, 164, 1164, 4164, 9164, 128, 129, 'MOAAAA', 'FMDAAA', 'HHHHxx'),
+(1851, 2346, 1, 3, 1, 11, 51, 851, 1851, 1851, 1851, 102, 103, 'FTAAAA', 'GMDAAA', 'OOOOxx'),
+(4744, 2347, 0, 0, 4, 4, 44, 744, 744, 4744, 4744, 88, 89, 'MAAAAA', 'HMDAAA', 'VVVVxx'),
+(8055, 2348, 1, 3, 5, 15, 55, 55, 55, 3055, 8055, 110, 111, 'VXAAAA', 'IMDAAA', 'AAAAxx'),
+(1533, 2349, 1, 1, 3, 13, 33, 533, 1533, 1533, 1533, 66, 67, 'ZGAAAA', 'JMDAAA', 'HHHHxx'),
+(1260, 2350, 0, 0, 0, 0, 60, 260, 1260, 1260, 1260, 120, 121, 'MWAAAA', 'KMDAAA', 'OOOOxx'),
+(1290, 2351, 0, 2, 0, 10, 90, 290, 1290, 1290, 1290, 180, 181, 'QXAAAA', 'LMDAAA', 'VVVVxx'),
+(297, 2352, 1, 1, 7, 17, 97, 297, 297, 297, 297, 194, 195, 'LLAAAA', 'MMDAAA', 'AAAAxx'),
+(4145, 2353, 1, 1, 5, 5, 45, 145, 145, 4145, 4145, 90, 91, 'LDAAAA', 'NMDAAA', 'HHHHxx'),
+(863, 2354, 1, 3, 3, 3, 63, 863, 863, 863, 863, 126, 127, 'FHAAAA', 'OMDAAA', 'OOOOxx'),
+(3423, 2355, 1, 3, 3, 3, 23, 423, 1423, 3423, 3423, 46, 47, 'RBAAAA', 'PMDAAA', 'VVVVxx'),
+(8750, 2356, 0, 2, 0, 10, 50, 750, 750, 3750, 8750, 100, 101, 'OYAAAA', 'QMDAAA', 'AAAAxx'),
+(3546, 2357, 0, 2, 6, 6, 46, 546, 1546, 3546, 3546, 92, 93, 'KGAAAA', 'RMDAAA', 'HHHHxx'),
+(3678, 2358, 0, 2, 8, 18, 78, 678, 1678, 3678, 3678, 156, 157, 'MLAAAA', 'SMDAAA', 'OOOOxx'),
+(5313, 2359, 1, 1, 3, 13, 13, 313, 1313, 313, 5313, 26, 27, 'JWAAAA', 'TMDAAA', 'VVVVxx'),
+(6233, 2360, 1, 1, 3, 13, 33, 233, 233, 1233, 6233, 66, 67, 'TFAAAA', 'UMDAAA', 'AAAAxx'),
+(5802, 2361, 0, 2, 2, 2, 2, 802, 1802, 802, 5802, 4, 5, 'EPAAAA', 'VMDAAA', 'HHHHxx'),
+(7059, 2362, 1, 3, 9, 19, 59, 59, 1059, 2059, 7059, 118, 119, 'NLAAAA', 'WMDAAA', 'OOOOxx'),
+(6481, 2363, 1, 1, 1, 1, 81, 481, 481, 1481, 6481, 162, 163, 'HPAAAA', 'XMDAAA', 'VVVVxx'),
+(1596, 2364, 0, 0, 6, 16, 96, 596, 1596, 1596, 1596, 192, 193, 'KJAAAA', 'YMDAAA', 'AAAAxx'),
+(8181, 2365, 1, 1, 1, 1, 81, 181, 181, 3181, 8181, 162, 163, 'RCAAAA', 'ZMDAAA', 'HHHHxx'),
+(5368, 2366, 0, 0, 8, 8, 68, 368, 1368, 368, 5368, 136, 137, 'MYAAAA', 'ANDAAA', 'OOOOxx'),
+(9416, 2367, 0, 0, 6, 16, 16, 416, 1416, 4416, 9416, 32, 33, 'EYAAAA', 'BNDAAA', 'VVVVxx'),
+(9521, 2368, 1, 1, 1, 1, 21, 521, 1521, 4521, 9521, 42, 43, 'FCAAAA', 'CNDAAA', 'AAAAxx'),
+(1042, 2369, 0, 2, 2, 2, 42, 42, 1042, 1042, 1042, 84, 85, 'COAAAA', 'DNDAAA', 'HHHHxx'),
+(4503, 2370, 1, 3, 3, 3, 3, 503, 503, 4503, 4503, 6, 7, 'FRAAAA', 'ENDAAA', 'OOOOxx'),
+(3023, 2371, 1, 3, 3, 3, 23, 23, 1023, 3023, 3023, 46, 47, 'HMAAAA', 'FNDAAA', 'VVVVxx'),
+(1976, 2372, 0, 0, 6, 16, 76, 976, 1976, 1976, 1976, 152, 153, 'AYAAAA', 'GNDAAA', 'AAAAxx'),
+(5610, 2373, 0, 2, 0, 10, 10, 610, 1610, 610, 5610, 20, 21, 'UHAAAA', 'HNDAAA', 'HHHHxx'),
+(7410, 2374, 0, 2, 0, 10, 10, 410, 1410, 2410, 7410, 20, 21, 'AZAAAA', 'INDAAA', 'OOOOxx'),
+(7872, 2375, 0, 0, 2, 12, 72, 872, 1872, 2872, 7872, 144, 145, 'UQAAAA', 'JNDAAA', 'VVVVxx'),
+(8591, 2376, 1, 3, 1, 11, 91, 591, 591, 3591, 8591, 182, 183, 'LSAAAA', 'KNDAAA', 'AAAAxx'),
+(1804, 2377, 0, 0, 4, 4, 4, 804, 1804, 1804, 1804, 8, 9, 'KRAAAA', 'LNDAAA', 'HHHHxx'),
+(5299, 2378, 1, 3, 9, 19, 99, 299, 1299, 299, 5299, 198, 199, 'VVAAAA', 'MNDAAA', 'OOOOxx'),
+(4695, 2379, 1, 3, 5, 15, 95, 695, 695, 4695, 4695, 190, 191, 'PYAAAA', 'NNDAAA', 'VVVVxx'),
+(2672, 2380, 0, 0, 2, 12, 72, 672, 672, 2672, 2672, 144, 145, 'UYAAAA', 'ONDAAA', 'AAAAxx'),
+(585, 2381, 1, 1, 5, 5, 85, 585, 585, 585, 585, 170, 171, 'NWAAAA', 'PNDAAA', 'HHHHxx'),
+(8622, 2382, 0, 2, 2, 2, 22, 622, 622, 3622, 8622, 44, 45, 'QTAAAA', 'QNDAAA', 'OOOOxx'),
+(3780, 2383, 0, 0, 0, 0, 80, 780, 1780, 3780, 3780, 160, 161, 'KPAAAA', 'RNDAAA', 'VVVVxx'),
+(7941, 2384, 1, 1, 1, 1, 41, 941, 1941, 2941, 7941, 82, 83, 'LTAAAA', 'SNDAAA', 'AAAAxx'),
+(3305, 2385, 1, 1, 5, 5, 5, 305, 1305, 3305, 3305, 10, 11, 'DXAAAA', 'TNDAAA', 'HHHHxx'),
+(8653, 2386, 1, 1, 3, 13, 53, 653, 653, 3653, 8653, 106, 107, 'VUAAAA', 'UNDAAA', 'OOOOxx'),
+(5756, 2387, 0, 0, 6, 16, 56, 756, 1756, 756, 5756, 112, 113, 'KNAAAA', 'VNDAAA', 'VVVVxx'),
+(576, 2388, 0, 0, 6, 16, 76, 576, 576, 576, 576, 152, 153, 'EWAAAA', 'WNDAAA', 'AAAAxx'),
+(1915, 2389, 1, 3, 5, 15, 15, 915, 1915, 1915, 1915, 30, 31, 'RVAAAA', 'XNDAAA', 'HHHHxx'),
+(4627, 2390, 1, 3, 7, 7, 27, 627, 627, 4627, 4627, 54, 55, 'ZVAAAA', 'YNDAAA', 'OOOOxx'),
+(920, 2391, 0, 0, 0, 0, 20, 920, 920, 920, 920, 40, 41, 'KJAAAA', 'ZNDAAA', 'VVVVxx'),
+(2537, 2392, 1, 1, 7, 17, 37, 537, 537, 2537, 2537, 74, 75, 'PTAAAA', 'AODAAA', 'AAAAxx'),
+(50, 2393, 0, 2, 0, 10, 50, 50, 50, 50, 50, 100, 101, 'YBAAAA', 'BODAAA', 'HHHHxx'),
+(1313, 2394, 1, 1, 3, 13, 13, 313, 1313, 1313, 1313, 26, 27, 'NYAAAA', 'CODAAA', 'OOOOxx'),
+(8542, 2395, 0, 2, 2, 2, 42, 542, 542, 3542, 8542, 84, 85, 'OQAAAA', 'DODAAA', 'VVVVxx'),
+(6428, 2396, 0, 0, 8, 8, 28, 428, 428, 1428, 6428, 56, 57, 'GNAAAA', 'EODAAA', 'AAAAxx'),
+(4351, 2397, 1, 3, 1, 11, 51, 351, 351, 4351, 4351, 102, 103, 'JLAAAA', 'FODAAA', 'HHHHxx'),
+(2050, 2398, 0, 2, 0, 10, 50, 50, 50, 2050, 2050, 100, 101, 'WAAAAA', 'GODAAA', 'OOOOxx'),
+(5162, 2399, 0, 2, 2, 2, 62, 162, 1162, 162, 5162, 124, 125, 'OQAAAA', 'HODAAA', 'VVVVxx'),
+(8229, 2400, 1, 1, 9, 9, 29, 229, 229, 3229, 8229, 58, 59, 'NEAAAA', 'IODAAA', 'AAAAxx'),
+(7782, 2401, 0, 2, 2, 2, 82, 782, 1782, 2782, 7782, 164, 165, 'INAAAA', 'JODAAA', 'HHHHxx'),
+(1563, 2402, 1, 3, 3, 3, 63, 563, 1563, 1563, 1563, 126, 127, 'DIAAAA', 'KODAAA', 'OOOOxx'),
+(267, 2403, 1, 3, 7, 7, 67, 267, 267, 267, 267, 134, 135, 'HKAAAA', 'LODAAA', 'VVVVxx'),
+(5138, 2404, 0, 2, 8, 18, 38, 138, 1138, 138, 5138, 76, 77, 'QPAAAA', 'MODAAA', 'AAAAxx'),
+(7022, 2405, 0, 2, 2, 2, 22, 22, 1022, 2022, 7022, 44, 45, 'CKAAAA', 'NODAAA', 'HHHHxx'),
+(6705, 2406, 1, 1, 5, 5, 5, 705, 705, 1705, 6705, 10, 11, 'XXAAAA', 'OODAAA', 'OOOOxx'),
+(6190, 2407, 0, 2, 0, 10, 90, 190, 190, 1190, 6190, 180, 181, 'CEAAAA', 'PODAAA', 'VVVVxx'),
+(8226, 2408, 0, 2, 6, 6, 26, 226, 226, 3226, 8226, 52, 53, 'KEAAAA', 'QODAAA', 'AAAAxx'),
+(8882, 2409, 0, 2, 2, 2, 82, 882, 882, 3882, 8882, 164, 165, 'QDAAAA', 'RODAAA', 'HHHHxx'),
+(5181, 2410, 1, 1, 1, 1, 81, 181, 1181, 181, 5181, 162, 163, 'HRAAAA', 'SODAAA', 'OOOOxx'),
+(4598, 2411, 0, 2, 8, 18, 98, 598, 598, 4598, 4598, 196, 197, 'WUAAAA', 'TODAAA', 'VVVVxx'),
+(4882, 2412, 0, 2, 2, 2, 82, 882, 882, 4882, 4882, 164, 165, 'UFAAAA', 'UODAAA', 'AAAAxx'),
+(7490, 2413, 0, 2, 0, 10, 90, 490, 1490, 2490, 7490, 180, 181, 'CCAAAA', 'VODAAA', 'HHHHxx'),
+(5224, 2414, 0, 0, 4, 4, 24, 224, 1224, 224, 5224, 48, 49, 'YSAAAA', 'WODAAA', 'OOOOxx'),
+(2174, 2415, 0, 2, 4, 14, 74, 174, 174, 2174, 2174, 148, 149, 'QFAAAA', 'XODAAA', 'VVVVxx'),
+(3059, 2416, 1, 3, 9, 19, 59, 59, 1059, 3059, 3059, 118, 119, 'RNAAAA', 'YODAAA', 'AAAAxx'),
+(8790, 2417, 0, 2, 0, 10, 90, 790, 790, 3790, 8790, 180, 181, 'CAAAAA', 'ZODAAA', 'HHHHxx'),
+(2222, 2418, 0, 2, 2, 2, 22, 222, 222, 2222, 2222, 44, 45, 'MHAAAA', 'APDAAA', 'OOOOxx'),
+(5473, 2419, 1, 1, 3, 13, 73, 473, 1473, 473, 5473, 146, 147, 'NCAAAA', 'BPDAAA', 'VVVVxx'),
+(937, 2420, 1, 1, 7, 17, 37, 937, 937, 937, 937, 74, 75, 'BKAAAA', 'CPDAAA', 'AAAAxx'),
+(2975, 2421, 1, 3, 5, 15, 75, 975, 975, 2975, 2975, 150, 151, 'LKAAAA', 'DPDAAA', 'HHHHxx'),
+(9569, 2422, 1, 1, 9, 9, 69, 569, 1569, 4569, 9569, 138, 139, 'BEAAAA', 'EPDAAA', 'OOOOxx'),
+(3456, 2423, 0, 0, 6, 16, 56, 456, 1456, 3456, 3456, 112, 113, 'YCAAAA', 'FPDAAA', 'VVVVxx'),
+(6657, 2424, 1, 1, 7, 17, 57, 657, 657, 1657, 6657, 114, 115, 'BWAAAA', 'GPDAAA', 'AAAAxx'),
+(3776, 2425, 0, 0, 6, 16, 76, 776, 1776, 3776, 3776, 152, 153, 'GPAAAA', 'HPDAAA', 'HHHHxx'),
+(6072, 2426, 0, 0, 2, 12, 72, 72, 72, 1072, 6072, 144, 145, 'OZAAAA', 'IPDAAA', 'OOOOxx'),
+(8129, 2427, 1, 1, 9, 9, 29, 129, 129, 3129, 8129, 58, 59, 'RAAAAA', 'JPDAAA', 'VVVVxx'),
+(1085, 2428, 1, 1, 5, 5, 85, 85, 1085, 1085, 1085, 170, 171, 'TPAAAA', 'KPDAAA', 'AAAAxx'),
+(2079, 2429, 1, 3, 9, 19, 79, 79, 79, 2079, 2079, 158, 159, 'ZBAAAA', 'LPDAAA', 'HHHHxx'),
+(1200, 2430, 0, 0, 0, 0, 0, 200, 1200, 1200, 1200, 0, 1, 'EUAAAA', 'MPDAAA', 'OOOOxx'),
+(3276, 2431, 0, 0, 6, 16, 76, 276, 1276, 3276, 3276, 152, 153, 'AWAAAA', 'NPDAAA', 'VVVVxx'),
+(2608, 2432, 0, 0, 8, 8, 8, 608, 608, 2608, 2608, 16, 17, 'IWAAAA', 'OPDAAA', 'AAAAxx'),
+(702, 2433, 0, 2, 2, 2, 2, 702, 702, 702, 702, 4, 5, 'ABAAAA', 'PPDAAA', 'HHHHxx'),
+(5750, 2434, 0, 2, 0, 10, 50, 750, 1750, 750, 5750, 100, 101, 'ENAAAA', 'QPDAAA', 'OOOOxx'),
+(2776, 2435, 0, 0, 6, 16, 76, 776, 776, 2776, 2776, 152, 153, 'UCAAAA', 'RPDAAA', 'VVVVxx'),
+(9151, 2436, 1, 3, 1, 11, 51, 151, 1151, 4151, 9151, 102, 103, 'ZNAAAA', 'SPDAAA', 'AAAAxx'),
+(3282, 2437, 0, 2, 2, 2, 82, 282, 1282, 3282, 3282, 164, 165, 'GWAAAA', 'TPDAAA', 'HHHHxx'),
+(408, 2438, 0, 0, 8, 8, 8, 408, 408, 408, 408, 16, 17, 'SPAAAA', 'UPDAAA', 'OOOOxx'),
+(3473, 2439, 1, 1, 3, 13, 73, 473, 1473, 3473, 3473, 146, 147, 'PDAAAA', 'VPDAAA', 'VVVVxx'),
+(7095, 2440, 1, 3, 5, 15, 95, 95, 1095, 2095, 7095, 190, 191, 'XMAAAA', 'WPDAAA', 'AAAAxx'),
+(3288, 2441, 0, 0, 8, 8, 88, 288, 1288, 3288, 3288, 176, 177, 'MWAAAA', 'XPDAAA', 'HHHHxx'),
+(8215, 2442, 1, 3, 5, 15, 15, 215, 215, 3215, 8215, 30, 31, 'ZDAAAA', 'YPDAAA', 'OOOOxx'),
+(6244, 2443, 0, 0, 4, 4, 44, 244, 244, 1244, 6244, 88, 89, 'EGAAAA', 'ZPDAAA', 'VVVVxx'),
+(8440, 2444, 0, 0, 0, 0, 40, 440, 440, 3440, 8440, 80, 81, 'QMAAAA', 'AQDAAA', 'AAAAxx'),
+(3800, 2445, 0, 0, 0, 0, 0, 800, 1800, 3800, 3800, 0, 1, 'EQAAAA', 'BQDAAA', 'HHHHxx'),
+(7279, 2446, 1, 3, 9, 19, 79, 279, 1279, 2279, 7279, 158, 159, 'ZTAAAA', 'CQDAAA', 'OOOOxx'),
+(9206, 2447, 0, 2, 6, 6, 6, 206, 1206, 4206, 9206, 12, 13, 'CQAAAA', 'DQDAAA', 'VVVVxx'),
+(6465, 2448, 1, 1, 5, 5, 65, 465, 465, 1465, 6465, 130, 131, 'ROAAAA', 'EQDAAA', 'AAAAxx'),
+(4127, 2449, 1, 3, 7, 7, 27, 127, 127, 4127, 4127, 54, 55, 'TCAAAA', 'FQDAAA', 'HHHHxx'),
+(7463, 2450, 1, 3, 3, 3, 63, 463, 1463, 2463, 7463, 126, 127, 'BBAAAA', 'GQDAAA', 'OOOOxx'),
+(5117, 2451, 1, 1, 7, 17, 17, 117, 1117, 117, 5117, 34, 35, 'VOAAAA', 'HQDAAA', 'VVVVxx'),
+(4715, 2452, 1, 3, 5, 15, 15, 715, 715, 4715, 4715, 30, 31, 'JZAAAA', 'IQDAAA', 'AAAAxx'),
+(2010, 2453, 0, 2, 0, 10, 10, 10, 10, 2010, 2010, 20, 21, 'IZAAAA', 'JQDAAA', 'HHHHxx'),
+(6486, 2454, 0, 2, 6, 6, 86, 486, 486, 1486, 6486, 172, 173, 'MPAAAA', 'KQDAAA', 'OOOOxx'),
+(6434, 2455, 0, 2, 4, 14, 34, 434, 434, 1434, 6434, 68, 69, 'MNAAAA', 'LQDAAA', 'VVVVxx'),
+(2151, 2456, 1, 3, 1, 11, 51, 151, 151, 2151, 2151, 102, 103, 'TEAAAA', 'MQDAAA', 'AAAAxx'),
+(4821, 2457, 1, 1, 1, 1, 21, 821, 821, 4821, 4821, 42, 43, 'LDAAAA', 'NQDAAA', 'HHHHxx'),
+(6507, 2458, 1, 3, 7, 7, 7, 507, 507, 1507, 6507, 14, 15, 'HQAAAA', 'OQDAAA', 'OOOOxx'),
+(8741, 2459, 1, 1, 1, 1, 41, 741, 741, 3741, 8741, 82, 83, 'FYAAAA', 'PQDAAA', 'VVVVxx'),
+(6846, 2460, 0, 2, 6, 6, 46, 846, 846, 1846, 6846, 92, 93, 'IDAAAA', 'QQDAAA', 'AAAAxx'),
+(4525, 2461, 1, 1, 5, 5, 25, 525, 525, 4525, 4525, 50, 51, 'BSAAAA', 'RQDAAA', 'HHHHxx'),
+(8299, 2462, 1, 3, 9, 19, 99, 299, 299, 3299, 8299, 198, 199, 'FHAAAA', 'SQDAAA', 'OOOOxx'),
+(5465, 2463, 1, 1, 5, 5, 65, 465, 1465, 465, 5465, 130, 131, 'FCAAAA', 'TQDAAA', 'VVVVxx'),
+(7206, 2464, 0, 2, 6, 6, 6, 206, 1206, 2206, 7206, 12, 13, 'ERAAAA', 'UQDAAA', 'AAAAxx'),
+(2616, 2465, 0, 0, 6, 16, 16, 616, 616, 2616, 2616, 32, 33, 'QWAAAA', 'VQDAAA', 'HHHHxx'),
+(4440, 2466, 0, 0, 0, 0, 40, 440, 440, 4440, 4440, 80, 81, 'UOAAAA', 'WQDAAA', 'OOOOxx'),
+(6109, 2467, 1, 1, 9, 9, 9, 109, 109, 1109, 6109, 18, 19, 'ZAAAAA', 'XQDAAA', 'VVVVxx'),
+(7905, 2468, 1, 1, 5, 5, 5, 905, 1905, 2905, 7905, 10, 11, 'BSAAAA', 'YQDAAA', 'AAAAxx'),
+(6498, 2469, 0, 2, 8, 18, 98, 498, 498, 1498, 6498, 196, 197, 'YPAAAA', 'ZQDAAA', 'HHHHxx'),
+(2034, 2470, 0, 2, 4, 14, 34, 34, 34, 2034, 2034, 68, 69, 'GAAAAA', 'ARDAAA', 'OOOOxx'),
+(7693, 2471, 1, 1, 3, 13, 93, 693, 1693, 2693, 7693, 186, 187, 'XJAAAA', 'BRDAAA', 'VVVVxx'),
+(7511, 2472, 1, 3, 1, 11, 11, 511, 1511, 2511, 7511, 22, 23, 'XCAAAA', 'CRDAAA', 'AAAAxx'),
+(7531, 2473, 1, 3, 1, 11, 31, 531, 1531, 2531, 7531, 62, 63, 'RDAAAA', 'DRDAAA', 'HHHHxx'),
+(6869, 2474, 1, 1, 9, 9, 69, 869, 869, 1869, 6869, 138, 139, 'FEAAAA', 'ERDAAA', 'OOOOxx'),
+(2763, 2475, 1, 3, 3, 3, 63, 763, 763, 2763, 2763, 126, 127, 'HCAAAA', 'FRDAAA', 'VVVVxx'),
+(575, 2476, 1, 3, 5, 15, 75, 575, 575, 575, 575, 150, 151, 'DWAAAA', 'GRDAAA', 'AAAAxx'),
+(8953, 2477, 1, 1, 3, 13, 53, 953, 953, 3953, 8953, 106, 107, 'JGAAAA', 'HRDAAA', 'HHHHxx'),
+(5833, 2478, 1, 1, 3, 13, 33, 833, 1833, 833, 5833, 66, 67, 'JQAAAA', 'IRDAAA', 'OOOOxx'),
+(9035, 2479, 1, 3, 5, 15, 35, 35, 1035, 4035, 9035, 70, 71, 'NJAAAA', 'JRDAAA', 'VVVVxx'),
+(9123, 2480, 1, 3, 3, 3, 23, 123, 1123, 4123, 9123, 46, 47, 'XMAAAA', 'KRDAAA', 'AAAAxx'),
+(206, 2481, 0, 2, 6, 6, 6, 206, 206, 206, 206, 12, 13, 'YHAAAA', 'LRDAAA', 'HHHHxx'),
+(4155, 2482, 1, 3, 5, 15, 55, 155, 155, 4155, 4155, 110, 111, 'VDAAAA', 'MRDAAA', 'OOOOxx'),
+(532, 2483, 0, 0, 2, 12, 32, 532, 532, 532, 532, 64, 65, 'MUAAAA', 'NRDAAA', 'VVVVxx'),
+(1370, 2484, 0, 2, 0, 10, 70, 370, 1370, 1370, 1370, 140, 141, 'SAAAAA', 'ORDAAA', 'AAAAxx'),
+(7656, 2485, 0, 0, 6, 16, 56, 656, 1656, 2656, 7656, 112, 113, 'MIAAAA', 'PRDAAA', 'HHHHxx'),
+(7735, 2486, 1, 3, 5, 15, 35, 735, 1735, 2735, 7735, 70, 71, 'NLAAAA', 'QRDAAA', 'OOOOxx'),
+(2118, 2487, 0, 2, 8, 18, 18, 118, 118, 2118, 2118, 36, 37, 'MDAAAA', 'RRDAAA', 'VVVVxx'),
+(6914, 2488, 0, 2, 4, 14, 14, 914, 914, 1914, 6914, 28, 29, 'YFAAAA', 'SRDAAA', 'AAAAxx'),
+(6277, 2489, 1, 1, 7, 17, 77, 277, 277, 1277, 6277, 154, 155, 'LHAAAA', 'TRDAAA', 'HHHHxx'),
+(6347, 2490, 1, 3, 7, 7, 47, 347, 347, 1347, 6347, 94, 95, 'DKAAAA', 'URDAAA', 'OOOOxx'),
+(4030, 2491, 0, 2, 0, 10, 30, 30, 30, 4030, 4030, 60, 61, 'AZAAAA', 'VRDAAA', 'VVVVxx'),
+(9673, 2492, 1, 1, 3, 13, 73, 673, 1673, 4673, 9673, 146, 147, 'BIAAAA', 'WRDAAA', 'AAAAxx'),
+(2015, 2493, 1, 3, 5, 15, 15, 15, 15, 2015, 2015, 30, 31, 'NZAAAA', 'XRDAAA', 'HHHHxx'),
+(1317, 2494, 1, 1, 7, 17, 17, 317, 1317, 1317, 1317, 34, 35, 'RYAAAA', 'YRDAAA', 'OOOOxx'),
+(404, 2495, 0, 0, 4, 4, 4, 404, 404, 404, 404, 8, 9, 'OPAAAA', 'ZRDAAA', 'VVVVxx'),
+(1604, 2496, 0, 0, 4, 4, 4, 604, 1604, 1604, 1604, 8, 9, 'SJAAAA', 'ASDAAA', 'AAAAxx'),
+(1912, 2497, 0, 0, 2, 12, 12, 912, 1912, 1912, 1912, 24, 25, 'OVAAAA', 'BSDAAA', 'HHHHxx'),
+(5727, 2498, 1, 3, 7, 7, 27, 727, 1727, 727, 5727, 54, 55, 'HMAAAA', 'CSDAAA', 'OOOOxx'),
+(4538, 2499, 0, 2, 8, 18, 38, 538, 538, 4538, 4538, 76, 77, 'OSAAAA', 'DSDAAA', 'VVVVxx'),
+(6868, 2500, 0, 0, 8, 8, 68, 868, 868, 1868, 6868, 136, 137, 'EEAAAA', 'ESDAAA', 'AAAAxx'),
+(9801, 2501, 1, 1, 1, 1, 1, 801, 1801, 4801, 9801, 2, 3, 'ZMAAAA', 'FSDAAA', 'HHHHxx'),
+(1781, 2502, 1, 1, 1, 1, 81, 781, 1781, 1781, 1781, 162, 163, 'NQAAAA', 'GSDAAA', 'OOOOxx'),
+(7061, 2503, 1, 1, 1, 1, 61, 61, 1061, 2061, 7061, 122, 123, 'PLAAAA', 'HSDAAA', 'VVVVxx'),
+(2412, 2504, 0, 0, 2, 12, 12, 412, 412, 2412, 2412, 24, 25, 'UOAAAA', 'ISDAAA', 'AAAAxx'),
+(9191, 2505, 1, 3, 1, 11, 91, 191, 1191, 4191, 9191, 182, 183, 'NPAAAA', 'JSDAAA', 'HHHHxx'),
+(1958, 2506, 0, 2, 8, 18, 58, 958, 1958, 1958, 1958, 116, 117, 'IXAAAA', 'KSDAAA', 'OOOOxx'),
+(2203, 2507, 1, 3, 3, 3, 3, 203, 203, 2203, 2203, 6, 7, 'TGAAAA', 'LSDAAA', 'VVVVxx'),
+(9104, 2508, 0, 0, 4, 4, 4, 104, 1104, 4104, 9104, 8, 9, 'EMAAAA', 'MSDAAA', 'AAAAxx'),
+(3837, 2509, 1, 1, 7, 17, 37, 837, 1837, 3837, 3837, 74, 75, 'PRAAAA', 'NSDAAA', 'HHHHxx'),
+(7055, 2510, 1, 3, 5, 15, 55, 55, 1055, 2055, 7055, 110, 111, 'JLAAAA', 'OSDAAA', 'OOOOxx'),
+(4612, 2511, 0, 0, 2, 12, 12, 612, 612, 4612, 4612, 24, 25, 'KVAAAA', 'PSDAAA', 'VVVVxx'),
+(6420, 2512, 0, 0, 0, 0, 20, 420, 420, 1420, 6420, 40, 41, 'YMAAAA', 'QSDAAA', 'AAAAxx'),
+(613, 2513, 1, 1, 3, 13, 13, 613, 613, 613, 613, 26, 27, 'PXAAAA', 'RSDAAA', 'HHHHxx'),
+(1691, 2514, 1, 3, 1, 11, 91, 691, 1691, 1691, 1691, 182, 183, 'BNAAAA', 'SSDAAA', 'OOOOxx'),
+(33, 2515, 1, 1, 3, 13, 33, 33, 33, 33, 33, 66, 67, 'HBAAAA', 'TSDAAA', 'VVVVxx'),
+(875, 2516, 1, 3, 5, 15, 75, 875, 875, 875, 875, 150, 151, 'RHAAAA', 'USDAAA', 'AAAAxx'),
+(9030, 2517, 0, 2, 0, 10, 30, 30, 1030, 4030, 9030, 60, 61, 'IJAAAA', 'VSDAAA', 'HHHHxx'),
+(4285, 2518, 1, 1, 5, 5, 85, 285, 285, 4285, 4285, 170, 171, 'VIAAAA', 'WSDAAA', 'OOOOxx'),
+(6236, 2519, 0, 0, 6, 16, 36, 236, 236, 1236, 6236, 72, 73, 'WFAAAA', 'XSDAAA', 'VVVVxx'),
+(4702, 2520, 0, 2, 2, 2, 2, 702, 702, 4702, 4702, 4, 5, 'WYAAAA', 'YSDAAA', 'AAAAxx'),
+(3441, 2521, 1, 1, 1, 1, 41, 441, 1441, 3441, 3441, 82, 83, 'JCAAAA', 'ZSDAAA', 'HHHHxx'),
+(2150, 2522, 0, 2, 0, 10, 50, 150, 150, 2150, 2150, 100, 101, 'SEAAAA', 'ATDAAA', 'OOOOxx'),
+(1852, 2523, 0, 0, 2, 12, 52, 852, 1852, 1852, 1852, 104, 105, 'GTAAAA', 'BTDAAA', 'VVVVxx'),
+(7713, 2524, 1, 1, 3, 13, 13, 713, 1713, 2713, 7713, 26, 27, 'RKAAAA', 'CTDAAA', 'AAAAxx'),
+(6849, 2525, 1, 1, 9, 9, 49, 849, 849, 1849, 6849, 98, 99, 'LDAAAA', 'DTDAAA', 'HHHHxx'),
+(3425, 2526, 1, 1, 5, 5, 25, 425, 1425, 3425, 3425, 50, 51, 'TBAAAA', 'ETDAAA', 'OOOOxx'),
+(4681, 2527, 1, 1, 1, 1, 81, 681, 681, 4681, 4681, 162, 163, 'BYAAAA', 'FTDAAA', 'VVVVxx'),
+(1134, 2528, 0, 2, 4, 14, 34, 134, 1134, 1134, 1134, 68, 69, 'QRAAAA', 'GTDAAA', 'AAAAxx'),
+(7462, 2529, 0, 2, 2, 2, 62, 462, 1462, 2462, 7462, 124, 125, 'ABAAAA', 'HTDAAA', 'HHHHxx'),
+(2148, 2530, 0, 0, 8, 8, 48, 148, 148, 2148, 2148, 96, 97, 'QEAAAA', 'ITDAAA', 'OOOOxx'),
+(5921, 2531, 1, 1, 1, 1, 21, 921, 1921, 921, 5921, 42, 43, 'TTAAAA', 'JTDAAA', 'VVVVxx'),
+(118, 2532, 0, 2, 8, 18, 18, 118, 118, 118, 118, 36, 37, 'OEAAAA', 'KTDAAA', 'AAAAxx'),
+(3065, 2533, 1, 1, 5, 5, 65, 65, 1065, 3065, 3065, 130, 131, 'XNAAAA', 'LTDAAA', 'HHHHxx'),
+(6590, 2534, 0, 2, 0, 10, 90, 590, 590, 1590, 6590, 180, 181, 'MTAAAA', 'MTDAAA', 'OOOOxx'),
+(4993, 2535, 1, 1, 3, 13, 93, 993, 993, 4993, 4993, 186, 187, 'BKAAAA', 'NTDAAA', 'VVVVxx'),
+(6818, 2536, 0, 2, 8, 18, 18, 818, 818, 1818, 6818, 36, 37, 'GCAAAA', 'OTDAAA', 'AAAAxx'),
+(1449, 2537, 1, 1, 9, 9, 49, 449, 1449, 1449, 1449, 98, 99, 'TDAAAA', 'PTDAAA', 'HHHHxx'),
+(2039, 2538, 1, 3, 9, 19, 39, 39, 39, 2039, 2039, 78, 79, 'LAAAAA', 'QTDAAA', 'OOOOxx'),
+(2524, 2539, 0, 0, 4, 4, 24, 524, 524, 2524, 2524, 48, 49, 'CTAAAA', 'RTDAAA', 'VVVVxx'),
+(1481, 2540, 1, 1, 1, 1, 81, 481, 1481, 1481, 1481, 162, 163, 'ZEAAAA', 'STDAAA', 'AAAAxx'),
+(6984, 2541, 0, 0, 4, 4, 84, 984, 984, 1984, 6984, 168, 169, 'QIAAAA', 'TTDAAA', 'HHHHxx'),
+(3960, 2542, 0, 0, 0, 0, 60, 960, 1960, 3960, 3960, 120, 121, 'IWAAAA', 'UTDAAA', 'OOOOxx'),
+(1983, 2543, 1, 3, 3, 3, 83, 983, 1983, 1983, 1983, 166, 167, 'HYAAAA', 'VTDAAA', 'VVVVxx'),
+(6379, 2544, 1, 3, 9, 19, 79, 379, 379, 1379, 6379, 158, 159, 'JLAAAA', 'WTDAAA', 'AAAAxx'),
+(8975, 2545, 1, 3, 5, 15, 75, 975, 975, 3975, 8975, 150, 151, 'FHAAAA', 'XTDAAA', 'HHHHxx'),
+(1102, 2546, 0, 2, 2, 2, 2, 102, 1102, 1102, 1102, 4, 5, 'KQAAAA', 'YTDAAA', 'OOOOxx'),
+(2517, 2547, 1, 1, 7, 17, 17, 517, 517, 2517, 2517, 34, 35, 'VSAAAA', 'ZTDAAA', 'VVVVxx'),
+(712, 2548, 0, 0, 2, 12, 12, 712, 712, 712, 712, 24, 25, 'KBAAAA', 'AUDAAA', 'AAAAxx'),
+(5419, 2549, 1, 3, 9, 19, 19, 419, 1419, 419, 5419, 38, 39, 'LAAAAA', 'BUDAAA', 'HHHHxx'),
+(723, 2550, 1, 3, 3, 3, 23, 723, 723, 723, 723, 46, 47, 'VBAAAA', 'CUDAAA', 'OOOOxx'),
+(8057, 2551, 1, 1, 7, 17, 57, 57, 57, 3057, 8057, 114, 115, 'XXAAAA', 'DUDAAA', 'VVVVxx'),
+(7471, 2552, 1, 3, 1, 11, 71, 471, 1471, 2471, 7471, 142, 143, 'JBAAAA', 'EUDAAA', 'AAAAxx'),
+(8855, 2553, 1, 3, 5, 15, 55, 855, 855, 3855, 8855, 110, 111, 'PCAAAA', 'FUDAAA', 'HHHHxx'),
+(5074, 2554, 0, 2, 4, 14, 74, 74, 1074, 74, 5074, 148, 149, 'ENAAAA', 'GUDAAA', 'OOOOxx'),
+(7139, 2555, 1, 3, 9, 19, 39, 139, 1139, 2139, 7139, 78, 79, 'POAAAA', 'HUDAAA', 'VVVVxx'),
+(3833, 2556, 1, 1, 3, 13, 33, 833, 1833, 3833, 3833, 66, 67, 'LRAAAA', 'IUDAAA', 'AAAAxx'),
+(5186, 2557, 0, 2, 6, 6, 86, 186, 1186, 186, 5186, 172, 173, 'MRAAAA', 'JUDAAA', 'HHHHxx'),
+(9436, 2558, 0, 0, 6, 16, 36, 436, 1436, 4436, 9436, 72, 73, 'YYAAAA', 'KUDAAA', 'OOOOxx'),
+(8859, 2559, 1, 3, 9, 19, 59, 859, 859, 3859, 8859, 118, 119, 'TCAAAA', 'LUDAAA', 'VVVVxx'),
+(6943, 2560, 1, 3, 3, 3, 43, 943, 943, 1943, 6943, 86, 87, 'BHAAAA', 'MUDAAA', 'AAAAxx'),
+(2315, 2561, 1, 3, 5, 15, 15, 315, 315, 2315, 2315, 30, 31, 'BLAAAA', 'NUDAAA', 'HHHHxx'),
+(1394, 2562, 0, 2, 4, 14, 94, 394, 1394, 1394, 1394, 188, 189, 'QBAAAA', 'OUDAAA', 'OOOOxx'),
+(8863, 2563, 1, 3, 3, 3, 63, 863, 863, 3863, 8863, 126, 127, 'XCAAAA', 'PUDAAA', 'VVVVxx'),
+(8812, 2564, 0, 0, 2, 12, 12, 812, 812, 3812, 8812, 24, 25, 'YAAAAA', 'QUDAAA', 'AAAAxx'),
+(7498, 2565, 0, 2, 8, 18, 98, 498, 1498, 2498, 7498, 196, 197, 'KCAAAA', 'RUDAAA', 'HHHHxx'),
+(8962, 2566, 0, 2, 2, 2, 62, 962, 962, 3962, 8962, 124, 125, 'SGAAAA', 'SUDAAA', 'OOOOxx'),
+(2533, 2567, 1, 1, 3, 13, 33, 533, 533, 2533, 2533, 66, 67, 'LTAAAA', 'TUDAAA', 'VVVVxx'),
+(8188, 2568, 0, 0, 8, 8, 88, 188, 188, 3188, 8188, 176, 177, 'YCAAAA', 'UUDAAA', 'AAAAxx'),
+(6137, 2569, 1, 1, 7, 17, 37, 137, 137, 1137, 6137, 74, 75, 'BCAAAA', 'VUDAAA', 'HHHHxx'),
+(974, 2570, 0, 2, 4, 14, 74, 974, 974, 974, 974, 148, 149, 'MLAAAA', 'WUDAAA', 'OOOOxx'),
+(2751, 2571, 1, 3, 1, 11, 51, 751, 751, 2751, 2751, 102, 103, 'VBAAAA', 'XUDAAA', 'VVVVxx'),
+(4975, 2572, 1, 3, 5, 15, 75, 975, 975, 4975, 4975, 150, 151, 'JJAAAA', 'YUDAAA', 'AAAAxx'),
+(3411, 2573, 1, 3, 1, 11, 11, 411, 1411, 3411, 3411, 22, 23, 'FBAAAA', 'ZUDAAA', 'HHHHxx'),
+(3143, 2574, 1, 3, 3, 3, 43, 143, 1143, 3143, 3143, 86, 87, 'XQAAAA', 'AVDAAA', 'OOOOxx'),
+(8011, 2575, 1, 3, 1, 11, 11, 11, 11, 3011, 8011, 22, 23, 'DWAAAA', 'BVDAAA', 'VVVVxx'),
+(988, 2576, 0, 0, 8, 8, 88, 988, 988, 988, 988, 176, 177, 'AMAAAA', 'CVDAAA', 'AAAAxx'),
+(4289, 2577, 1, 1, 9, 9, 89, 289, 289, 4289, 4289, 178, 179, 'ZIAAAA', 'DVDAAA', 'HHHHxx'),
+(8105, 2578, 1, 1, 5, 5, 5, 105, 105, 3105, 8105, 10, 11, 'TZAAAA', 'EVDAAA', 'OOOOxx'),
+(9885, 2579, 1, 1, 5, 5, 85, 885, 1885, 4885, 9885, 170, 171, 'FQAAAA', 'FVDAAA', 'VVVVxx'),
+(1002, 2580, 0, 2, 2, 2, 2, 2, 1002, 1002, 1002, 4, 5, 'OMAAAA', 'GVDAAA', 'AAAAxx'),
+(5827, 2581, 1, 3, 7, 7, 27, 827, 1827, 827, 5827, 54, 55, 'DQAAAA', 'HVDAAA', 'HHHHxx'),
+(1228, 2582, 0, 0, 8, 8, 28, 228, 1228, 1228, 1228, 56, 57, 'GVAAAA', 'IVDAAA', 'OOOOxx'),
+(6352, 2583, 0, 0, 2, 12, 52, 352, 352, 1352, 6352, 104, 105, 'IKAAAA', 'JVDAAA', 'VVVVxx'),
+(8868, 2584, 0, 0, 8, 8, 68, 868, 868, 3868, 8868, 136, 137, 'CDAAAA', 'KVDAAA', 'AAAAxx'),
+(3643, 2585, 1, 3, 3, 3, 43, 643, 1643, 3643, 3643, 86, 87, 'DKAAAA', 'LVDAAA', 'HHHHxx'),
+(1468, 2586, 0, 0, 8, 8, 68, 468, 1468, 1468, 1468, 136, 137, 'MEAAAA', 'MVDAAA', 'OOOOxx'),
+(8415, 2587, 1, 3, 5, 15, 15, 415, 415, 3415, 8415, 30, 31, 'RLAAAA', 'NVDAAA', 'VVVVxx'),
+(9631, 2588, 1, 3, 1, 11, 31, 631, 1631, 4631, 9631, 62, 63, 'LGAAAA', 'OVDAAA', 'AAAAxx'),
+(7408, 2589, 0, 0, 8, 8, 8, 408, 1408, 2408, 7408, 16, 17, 'YYAAAA', 'PVDAAA', 'HHHHxx'),
+(1934, 2590, 0, 2, 4, 14, 34, 934, 1934, 1934, 1934, 68, 69, 'KWAAAA', 'QVDAAA', 'OOOOxx'),
+(996, 2591, 0, 0, 6, 16, 96, 996, 996, 996, 996, 192, 193, 'IMAAAA', 'RVDAAA', 'VVVVxx'),
+(8027, 2592, 1, 3, 7, 7, 27, 27, 27, 3027, 8027, 54, 55, 'TWAAAA', 'SVDAAA', 'AAAAxx'),
+(8464, 2593, 0, 0, 4, 4, 64, 464, 464, 3464, 8464, 128, 129, 'ONAAAA', 'TVDAAA', 'HHHHxx'),
+(5007, 2594, 1, 3, 7, 7, 7, 7, 1007, 7, 5007, 14, 15, 'PKAAAA', 'UVDAAA', 'OOOOxx'),
+(8356, 2595, 0, 0, 6, 16, 56, 356, 356, 3356, 8356, 112, 113, 'KJAAAA', 'VVDAAA', 'VVVVxx'),
+(4579, 2596, 1, 3, 9, 19, 79, 579, 579, 4579, 4579, 158, 159, 'DUAAAA', 'WVDAAA', 'AAAAxx'),
+(8513, 2597, 1, 1, 3, 13, 13, 513, 513, 3513, 8513, 26, 27, 'LPAAAA', 'XVDAAA', 'HHHHxx'),
+(383, 2598, 1, 3, 3, 3, 83, 383, 383, 383, 383, 166, 167, 'TOAAAA', 'YVDAAA', 'OOOOxx'),
+(9304, 2599, 0, 0, 4, 4, 4, 304, 1304, 4304, 9304, 8, 9, 'WTAAAA', 'ZVDAAA', 'VVVVxx'),
+(7224, 2600, 0, 0, 4, 4, 24, 224, 1224, 2224, 7224, 48, 49, 'WRAAAA', 'AWDAAA', 'AAAAxx'),
+(6023, 2601, 1, 3, 3, 3, 23, 23, 23, 1023, 6023, 46, 47, 'RXAAAA', 'BWDAAA', 'HHHHxx'),
+(2746, 2602, 0, 2, 6, 6, 46, 746, 746, 2746, 2746, 92, 93, 'QBAAAA', 'CWDAAA', 'OOOOxx'),
+(137, 2603, 1, 1, 7, 17, 37, 137, 137, 137, 137, 74, 75, 'HFAAAA', 'DWDAAA', 'VVVVxx'),
+(9441, 2604, 1, 1, 1, 1, 41, 441, 1441, 4441, 9441, 82, 83, 'DZAAAA', 'EWDAAA', 'AAAAxx'),
+(3690, 2605, 0, 2, 0, 10, 90, 690, 1690, 3690, 3690, 180, 181, 'YLAAAA', 'FWDAAA', 'HHHHxx'),
+(913, 2606, 1, 1, 3, 13, 13, 913, 913, 913, 913, 26, 27, 'DJAAAA', 'GWDAAA', 'OOOOxx'),
+(1768, 2607, 0, 0, 8, 8, 68, 768, 1768, 1768, 1768, 136, 137, 'AQAAAA', 'HWDAAA', 'VVVVxx'),
+(8492, 2608, 0, 0, 2, 12, 92, 492, 492, 3492, 8492, 184, 185, 'QOAAAA', 'IWDAAA', 'AAAAxx'),
+(8083, 2609, 1, 3, 3, 3, 83, 83, 83, 3083, 8083, 166, 167, 'XYAAAA', 'JWDAAA', 'HHHHxx'),
+(4609, 2610, 1, 1, 9, 9, 9, 609, 609, 4609, 4609, 18, 19, 'HVAAAA', 'KWDAAA', 'OOOOxx'),
+(7520, 2611, 0, 0, 0, 0, 20, 520, 1520, 2520, 7520, 40, 41, 'GDAAAA', 'LWDAAA', 'VVVVxx'),
+(4231, 2612, 1, 3, 1, 11, 31, 231, 231, 4231, 4231, 62, 63, 'TGAAAA', 'MWDAAA', 'AAAAxx'),
+(6022, 2613, 0, 2, 2, 2, 22, 22, 22, 1022, 6022, 44, 45, 'QXAAAA', 'NWDAAA', 'HHHHxx'),
+(9784, 2614, 0, 0, 4, 4, 84, 784, 1784, 4784, 9784, 168, 169, 'IMAAAA', 'OWDAAA', 'OOOOxx'),
+(1343, 2615, 1, 3, 3, 3, 43, 343, 1343, 1343, 1343, 86, 87, 'RZAAAA', 'PWDAAA', 'VVVVxx'),
+(7549, 2616, 1, 1, 9, 9, 49, 549, 1549, 2549, 7549, 98, 99, 'JEAAAA', 'QWDAAA', 'AAAAxx'),
+(269, 2617, 1, 1, 9, 9, 69, 269, 269, 269, 269, 138, 139, 'JKAAAA', 'RWDAAA', 'HHHHxx'),
+(1069, 2618, 1, 1, 9, 9, 69, 69, 1069, 1069, 1069, 138, 139, 'DPAAAA', 'SWDAAA', 'OOOOxx'),
+(4610, 2619, 0, 2, 0, 10, 10, 610, 610, 4610, 4610, 20, 21, 'IVAAAA', 'TWDAAA', 'VVVVxx'),
+(482, 2620, 0, 2, 2, 2, 82, 482, 482, 482, 482, 164, 165, 'OSAAAA', 'UWDAAA', 'AAAAxx'),
+(3025, 2621, 1, 1, 5, 5, 25, 25, 1025, 3025, 3025, 50, 51, 'JMAAAA', 'VWDAAA', 'HHHHxx'),
+(7914, 2622, 0, 2, 4, 14, 14, 914, 1914, 2914, 7914, 28, 29, 'KSAAAA', 'WWDAAA', 'OOOOxx'),
+(3198, 2623, 0, 2, 8, 18, 98, 198, 1198, 3198, 3198, 196, 197, 'ATAAAA', 'XWDAAA', 'VVVVxx'),
+(1187, 2624, 1, 3, 7, 7, 87, 187, 1187, 1187, 1187, 174, 175, 'RTAAAA', 'YWDAAA', 'AAAAxx'),
+(4707, 2625, 1, 3, 7, 7, 7, 707, 707, 4707, 4707, 14, 15, 'BZAAAA', 'ZWDAAA', 'HHHHxx'),
+(8279, 2626, 1, 3, 9, 19, 79, 279, 279, 3279, 8279, 158, 159, 'LGAAAA', 'AXDAAA', 'OOOOxx'),
+(6127, 2627, 1, 3, 7, 7, 27, 127, 127, 1127, 6127, 54, 55, 'RBAAAA', 'BXDAAA', 'VVVVxx'),
+(1305, 2628, 1, 1, 5, 5, 5, 305, 1305, 1305, 1305, 10, 11, 'FYAAAA', 'CXDAAA', 'AAAAxx'),
+(4804, 2629, 0, 0, 4, 4, 4, 804, 804, 4804, 4804, 8, 9, 'UCAAAA', 'DXDAAA', 'HHHHxx'),
+(6069, 2630, 1, 1, 9, 9, 69, 69, 69, 1069, 6069, 138, 139, 'LZAAAA', 'EXDAAA', 'OOOOxx'),
+(9229, 2631, 1, 1, 9, 9, 29, 229, 1229, 4229, 9229, 58, 59, 'ZQAAAA', 'FXDAAA', 'VVVVxx'),
+(4703, 2632, 1, 3, 3, 3, 3, 703, 703, 4703, 4703, 6, 7, 'XYAAAA', 'GXDAAA', 'AAAAxx'),
+(6410, 2633, 0, 2, 0, 10, 10, 410, 410, 1410, 6410, 20, 21, 'OMAAAA', 'HXDAAA', 'HHHHxx'),
+(944, 2634, 0, 0, 4, 4, 44, 944, 944, 944, 944, 88, 89, 'IKAAAA', 'IXDAAA', 'OOOOxx'),
+(3744, 2635, 0, 0, 4, 4, 44, 744, 1744, 3744, 3744, 88, 89, 'AOAAAA', 'JXDAAA', 'VVVVxx'),
+(1127, 2636, 1, 3, 7, 7, 27, 127, 1127, 1127, 1127, 54, 55, 'JRAAAA', 'KXDAAA', 'AAAAxx'),
+(6693, 2637, 1, 1, 3, 13, 93, 693, 693, 1693, 6693, 186, 187, 'LXAAAA', 'LXDAAA', 'HHHHxx'),
+(583, 2638, 1, 3, 3, 3, 83, 583, 583, 583, 583, 166, 167, 'LWAAAA', 'MXDAAA', 'OOOOxx'),
+(2684, 2639, 0, 0, 4, 4, 84, 684, 684, 2684, 2684, 168, 169, 'GZAAAA', 'NXDAAA', 'VVVVxx'),
+(6192, 2640, 0, 0, 2, 12, 92, 192, 192, 1192, 6192, 184, 185, 'EEAAAA', 'OXDAAA', 'AAAAxx'),
+(4157, 2641, 1, 1, 7, 17, 57, 157, 157, 4157, 4157, 114, 115, 'XDAAAA', 'PXDAAA', 'HHHHxx'),
+(6470, 2642, 0, 2, 0, 10, 70, 470, 470, 1470, 6470, 140, 141, 'WOAAAA', 'QXDAAA', 'OOOOxx'),
+(8965, 2643, 1, 1, 5, 5, 65, 965, 965, 3965, 8965, 130, 131, 'VGAAAA', 'RXDAAA', 'VVVVxx'),
+(1433, 2644, 1, 1, 3, 13, 33, 433, 1433, 1433, 1433, 66, 67, 'DDAAAA', 'SXDAAA', 'AAAAxx'),
+(4570, 2645, 0, 2, 0, 10, 70, 570, 570, 4570, 4570, 140, 141, 'UTAAAA', 'TXDAAA', 'HHHHxx'),
+(1806, 2646, 0, 2, 6, 6, 6, 806, 1806, 1806, 1806, 12, 13, 'MRAAAA', 'UXDAAA', 'OOOOxx'),
+(1230, 2647, 0, 2, 0, 10, 30, 230, 1230, 1230, 1230, 60, 61, 'IVAAAA', 'VXDAAA', 'VVVVxx'),
+(2283, 2648, 1, 3, 3, 3, 83, 283, 283, 2283, 2283, 166, 167, 'VJAAAA', 'WXDAAA', 'AAAAxx'),
+(6456, 2649, 0, 0, 6, 16, 56, 456, 456, 1456, 6456, 112, 113, 'IOAAAA', 'XXDAAA', 'HHHHxx'),
+(7427, 2650, 1, 3, 7, 7, 27, 427, 1427, 2427, 7427, 54, 55, 'RZAAAA', 'YXDAAA', 'OOOOxx'),
+(8310, 2651, 0, 2, 0, 10, 10, 310, 310, 3310, 8310, 20, 21, 'QHAAAA', 'ZXDAAA', 'VVVVxx'),
+(8103, 2652, 1, 3, 3, 3, 3, 103, 103, 3103, 8103, 6, 7, 'RZAAAA', 'AYDAAA', 'AAAAxx'),
+(3947, 2653, 1, 3, 7, 7, 47, 947, 1947, 3947, 3947, 94, 95, 'VVAAAA', 'BYDAAA', 'HHHHxx'),
+(3414, 2654, 0, 2, 4, 14, 14, 414, 1414, 3414, 3414, 28, 29, 'IBAAAA', 'CYDAAA', 'OOOOxx'),
+(2043, 2655, 1, 3, 3, 3, 43, 43, 43, 2043, 2043, 86, 87, 'PAAAAA', 'DYDAAA', 'VVVVxx'),
+(4393, 2656, 1, 1, 3, 13, 93, 393, 393, 4393, 4393, 186, 187, 'ZMAAAA', 'EYDAAA', 'AAAAxx'),
+(6664, 2657, 0, 0, 4, 4, 64, 664, 664, 1664, 6664, 128, 129, 'IWAAAA', 'FYDAAA', 'HHHHxx'),
+(4545, 2658, 1, 1, 5, 5, 45, 545, 545, 4545, 4545, 90, 91, 'VSAAAA', 'GYDAAA', 'OOOOxx'),
+(7637, 2659, 1, 1, 7, 17, 37, 637, 1637, 2637, 7637, 74, 75, 'THAAAA', 'HYDAAA', 'VVVVxx'),
+(1359, 2660, 1, 3, 9, 19, 59, 359, 1359, 1359, 1359, 118, 119, 'HAAAAA', 'IYDAAA', 'AAAAxx'),
+(5018, 2661, 0, 2, 8, 18, 18, 18, 1018, 18, 5018, 36, 37, 'ALAAAA', 'JYDAAA', 'HHHHxx'),
+(987, 2662, 1, 3, 7, 7, 87, 987, 987, 987, 987, 174, 175, 'ZLAAAA', 'KYDAAA', 'OOOOxx'),
+(1320, 2663, 0, 0, 0, 0, 20, 320, 1320, 1320, 1320, 40, 41, 'UYAAAA', 'LYDAAA', 'VVVVxx'),
+(9311, 2664, 1, 3, 1, 11, 11, 311, 1311, 4311, 9311, 22, 23, 'DUAAAA', 'MYDAAA', 'AAAAxx'),
+(7993, 2665, 1, 1, 3, 13, 93, 993, 1993, 2993, 7993, 186, 187, 'LVAAAA', 'NYDAAA', 'HHHHxx'),
+(7588, 2666, 0, 0, 8, 8, 88, 588, 1588, 2588, 7588, 176, 177, 'WFAAAA', 'OYDAAA', 'OOOOxx'),
+(5983, 2667, 1, 3, 3, 3, 83, 983, 1983, 983, 5983, 166, 167, 'DWAAAA', 'PYDAAA', 'VVVVxx'),
+(4070, 2668, 0, 2, 0, 10, 70, 70, 70, 4070, 4070, 140, 141, 'OAAAAA', 'QYDAAA', 'AAAAxx'),
+(8349, 2669, 1, 1, 9, 9, 49, 349, 349, 3349, 8349, 98, 99, 'DJAAAA', 'RYDAAA', 'HHHHxx'),
+(3810, 2670, 0, 2, 0, 10, 10, 810, 1810, 3810, 3810, 20, 21, 'OQAAAA', 'SYDAAA', 'OOOOxx'),
+(6948, 2671, 0, 0, 8, 8, 48, 948, 948, 1948, 6948, 96, 97, 'GHAAAA', 'TYDAAA', 'VVVVxx'),
+(7153, 2672, 1, 1, 3, 13, 53, 153, 1153, 2153, 7153, 106, 107, 'DPAAAA', 'UYDAAA', 'AAAAxx'),
+(5371, 2673, 1, 3, 1, 11, 71, 371, 1371, 371, 5371, 142, 143, 'PYAAAA', 'VYDAAA', 'HHHHxx'),
+(8316, 2674, 0, 0, 6, 16, 16, 316, 316, 3316, 8316, 32, 33, 'WHAAAA', 'WYDAAA', 'OOOOxx'),
+(5903, 2675, 1, 3, 3, 3, 3, 903, 1903, 903, 5903, 6, 7, 'BTAAAA', 'XYDAAA', 'VVVVxx'),
+(6718, 2676, 0, 2, 8, 18, 18, 718, 718, 1718, 6718, 36, 37, 'KYAAAA', 'YYDAAA', 'AAAAxx'),
+(4759, 2677, 1, 3, 9, 19, 59, 759, 759, 4759, 4759, 118, 119, 'BBAAAA', 'ZYDAAA', 'HHHHxx'),
+(2555, 2678, 1, 3, 5, 15, 55, 555, 555, 2555, 2555, 110, 111, 'HUAAAA', 'AZDAAA', 'OOOOxx'),
+(3457, 2679, 1, 1, 7, 17, 57, 457, 1457, 3457, 3457, 114, 115, 'ZCAAAA', 'BZDAAA', 'VVVVxx'),
+(9626, 2680, 0, 2, 6, 6, 26, 626, 1626, 4626, 9626, 52, 53, 'GGAAAA', 'CZDAAA', 'AAAAxx'),
+(2570, 2681, 0, 2, 0, 10, 70, 570, 570, 2570, 2570, 140, 141, 'WUAAAA', 'DZDAAA', 'HHHHxx'),
+(7964, 2682, 0, 0, 4, 4, 64, 964, 1964, 2964, 7964, 128, 129, 'IUAAAA', 'EZDAAA', 'OOOOxx'),
+(1543, 2683, 1, 3, 3, 3, 43, 543, 1543, 1543, 1543, 86, 87, 'JHAAAA', 'FZDAAA', 'VVVVxx'),
+(929, 2684, 1, 1, 9, 9, 29, 929, 929, 929, 929, 58, 59, 'TJAAAA', 'GZDAAA', 'AAAAxx'),
+(9244, 2685, 0, 0, 4, 4, 44, 244, 1244, 4244, 9244, 88, 89, 'ORAAAA', 'HZDAAA', 'HHHHxx'),
+(9210, 2686, 0, 2, 0, 10, 10, 210, 1210, 4210, 9210, 20, 21, 'GQAAAA', 'IZDAAA', 'OOOOxx'),
+(8334, 2687, 0, 2, 4, 14, 34, 334, 334, 3334, 8334, 68, 69, 'OIAAAA', 'JZDAAA', 'VVVVxx'),
+(9310, 2688, 0, 2, 0, 10, 10, 310, 1310, 4310, 9310, 20, 21, 'CUAAAA', 'KZDAAA', 'AAAAxx'),
+(5024, 2689, 0, 0, 4, 4, 24, 24, 1024, 24, 5024, 48, 49, 'GLAAAA', 'LZDAAA', 'HHHHxx'),
+(8794, 2690, 0, 2, 4, 14, 94, 794, 794, 3794, 8794, 188, 189, 'GAAAAA', 'MZDAAA', 'OOOOxx'),
+(4091, 2691, 1, 3, 1, 11, 91, 91, 91, 4091, 4091, 182, 183, 'JBAAAA', 'NZDAAA', 'VVVVxx'),
+(649, 2692, 1, 1, 9, 9, 49, 649, 649, 649, 649, 98, 99, 'ZYAAAA', 'OZDAAA', 'AAAAxx'),
+(8505, 2693, 1, 1, 5, 5, 5, 505, 505, 3505, 8505, 10, 11, 'DPAAAA', 'PZDAAA', 'HHHHxx'),
+(6652, 2694, 0, 0, 2, 12, 52, 652, 652, 1652, 6652, 104, 105, 'WVAAAA', 'QZDAAA', 'OOOOxx'),
+(8945, 2695, 1, 1, 5, 5, 45, 945, 945, 3945, 8945, 90, 91, 'BGAAAA', 'RZDAAA', 'VVVVxx'),
+(2095, 2696, 1, 3, 5, 15, 95, 95, 95, 2095, 2095, 190, 191, 'PCAAAA', 'SZDAAA', 'AAAAxx'),
+(8676, 2697, 0, 0, 6, 16, 76, 676, 676, 3676, 8676, 152, 153, 'SVAAAA', 'TZDAAA', 'HHHHxx'),
+(3994, 2698, 0, 2, 4, 14, 94, 994, 1994, 3994, 3994, 188, 189, 'QXAAAA', 'UZDAAA', 'OOOOxx'),
+(2859, 2699, 1, 3, 9, 19, 59, 859, 859, 2859, 2859, 118, 119, 'ZFAAAA', 'VZDAAA', 'VVVVxx'),
+(5403, 2700, 1, 3, 3, 3, 3, 403, 1403, 403, 5403, 6, 7, 'VZAAAA', 'WZDAAA', 'AAAAxx'),
+(3254, 2701, 0, 2, 4, 14, 54, 254, 1254, 3254, 3254, 108, 109, 'EVAAAA', 'XZDAAA', 'HHHHxx'),
+(7339, 2702, 1, 3, 9, 19, 39, 339, 1339, 2339, 7339, 78, 79, 'HWAAAA', 'YZDAAA', 'OOOOxx'),
+(7220, 2703, 0, 0, 0, 0, 20, 220, 1220, 2220, 7220, 40, 41, 'SRAAAA', 'ZZDAAA', 'VVVVxx'),
+(4154, 2704, 0, 2, 4, 14, 54, 154, 154, 4154, 4154, 108, 109, 'UDAAAA', 'AAEAAA', 'AAAAxx'),
+(7570, 2705, 0, 2, 0, 10, 70, 570, 1570, 2570, 7570, 140, 141, 'EFAAAA', 'BAEAAA', 'HHHHxx'),
+(2576, 2706, 0, 0, 6, 16, 76, 576, 576, 2576, 2576, 152, 153, 'CVAAAA', 'CAEAAA', 'OOOOxx'),
+(5764, 2707, 0, 0, 4, 4, 64, 764, 1764, 764, 5764, 128, 129, 'SNAAAA', 'DAEAAA', 'VVVVxx'),
+(4314, 2708, 0, 2, 4, 14, 14, 314, 314, 4314, 4314, 28, 29, 'YJAAAA', 'EAEAAA', 'AAAAxx'),
+(2274, 2709, 0, 2, 4, 14, 74, 274, 274, 2274, 2274, 148, 149, 'MJAAAA', 'FAEAAA', 'HHHHxx'),
+(9756, 2710, 0, 0, 6, 16, 56, 756, 1756, 4756, 9756, 112, 113, 'GLAAAA', 'GAEAAA', 'OOOOxx'),
+(8274, 2711, 0, 2, 4, 14, 74, 274, 274, 3274, 8274, 148, 149, 'GGAAAA', 'HAEAAA', 'VVVVxx'),
+(1289, 2712, 1, 1, 9, 9, 89, 289, 1289, 1289, 1289, 178, 179, 'PXAAAA', 'IAEAAA', 'AAAAxx'),
+(7335, 2713, 1, 3, 5, 15, 35, 335, 1335, 2335, 7335, 70, 71, 'DWAAAA', 'JAEAAA', 'HHHHxx'),
+(5351, 2714, 1, 3, 1, 11, 51, 351, 1351, 351, 5351, 102, 103, 'VXAAAA', 'KAEAAA', 'OOOOxx'),
+(8978, 2715, 0, 2, 8, 18, 78, 978, 978, 3978, 8978, 156, 157, 'IHAAAA', 'LAEAAA', 'VVVVxx'),
+(2, 2716, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 'CAAAAA', 'MAEAAA', 'AAAAxx'),
+(8906, 2717, 0, 2, 6, 6, 6, 906, 906, 3906, 8906, 12, 13, 'OEAAAA', 'NAEAAA', 'HHHHxx'),
+(6388, 2718, 0, 0, 8, 8, 88, 388, 388, 1388, 6388, 176, 177, 'SLAAAA', 'OAEAAA', 'OOOOxx'),
+(5675, 2719, 1, 3, 5, 15, 75, 675, 1675, 675, 5675, 150, 151, 'HKAAAA', 'PAEAAA', 'VVVVxx'),
+(255, 2720, 1, 3, 5, 15, 55, 255, 255, 255, 255, 110, 111, 'VJAAAA', 'QAEAAA', 'AAAAxx'),
+(9538, 2721, 0, 2, 8, 18, 38, 538, 1538, 4538, 9538, 76, 77, 'WCAAAA', 'RAEAAA', 'HHHHxx'),
+(1480, 2722, 0, 0, 0, 0, 80, 480, 1480, 1480, 1480, 160, 161, 'YEAAAA', 'SAEAAA', 'OOOOxx'),
+(4015, 2723, 1, 3, 5, 15, 15, 15, 15, 4015, 4015, 30, 31, 'LYAAAA', 'TAEAAA', 'VVVVxx'),
+(5166, 2724, 0, 2, 6, 6, 66, 166, 1166, 166, 5166, 132, 133, 'SQAAAA', 'UAEAAA', 'AAAAxx'),
+(91, 2725, 1, 3, 1, 11, 91, 91, 91, 91, 91, 182, 183, 'NDAAAA', 'VAEAAA', 'HHHHxx'),
+(2958, 2726, 0, 2, 8, 18, 58, 958, 958, 2958, 2958, 116, 117, 'UJAAAA', 'WAEAAA', 'OOOOxx'),
+(9131, 2727, 1, 3, 1, 11, 31, 131, 1131, 4131, 9131, 62, 63, 'FNAAAA', 'XAEAAA', 'VVVVxx'),
+(3944, 2728, 0, 0, 4, 4, 44, 944, 1944, 3944, 3944, 88, 89, 'SVAAAA', 'YAEAAA', 'AAAAxx'),
+(4514, 2729, 0, 2, 4, 14, 14, 514, 514, 4514, 4514, 28, 29, 'QRAAAA', 'ZAEAAA', 'HHHHxx'),
+(5661, 2730, 1, 1, 1, 1, 61, 661, 1661, 661, 5661, 122, 123, 'TJAAAA', 'ABEAAA', 'OOOOxx'),
+(8724, 2731, 0, 0, 4, 4, 24, 724, 724, 3724, 8724, 48, 49, 'OXAAAA', 'BBEAAA', 'VVVVxx'),
+(6408, 2732, 0, 0, 8, 8, 8, 408, 408, 1408, 6408, 16, 17, 'MMAAAA', 'CBEAAA', 'AAAAxx'),
+(5013, 2733, 1, 1, 3, 13, 13, 13, 1013, 13, 5013, 26, 27, 'VKAAAA', 'DBEAAA', 'HHHHxx'),
+(6156, 2734, 0, 0, 6, 16, 56, 156, 156, 1156, 6156, 112, 113, 'UCAAAA', 'EBEAAA', 'OOOOxx'),
+(7350, 2735, 0, 2, 0, 10, 50, 350, 1350, 2350, 7350, 100, 101, 'SWAAAA', 'FBEAAA', 'VVVVxx'),
+(9858, 2736, 0, 2, 8, 18, 58, 858, 1858, 4858, 9858, 116, 117, 'EPAAAA', 'GBEAAA', 'AAAAxx'),
+(895, 2737, 1, 3, 5, 15, 95, 895, 895, 895, 895, 190, 191, 'LIAAAA', 'HBEAAA', 'HHHHxx'),
+(8368, 2738, 0, 0, 8, 8, 68, 368, 368, 3368, 8368, 136, 137, 'WJAAAA', 'IBEAAA', 'OOOOxx'),
+(179, 2739, 1, 3, 9, 19, 79, 179, 179, 179, 179, 158, 159, 'XGAAAA', 'JBEAAA', 'VVVVxx'),
+(4048, 2740, 0, 0, 8, 8, 48, 48, 48, 4048, 4048, 96, 97, 'SZAAAA', 'KBEAAA', 'AAAAxx'),
+(3073, 2741, 1, 1, 3, 13, 73, 73, 1073, 3073, 3073, 146, 147, 'FOAAAA', 'LBEAAA', 'HHHHxx'),
+(321, 2742, 1, 1, 1, 1, 21, 321, 321, 321, 321, 42, 43, 'JMAAAA', 'MBEAAA', 'OOOOxx'),
+(5352, 2743, 0, 0, 2, 12, 52, 352, 1352, 352, 5352, 104, 105, 'WXAAAA', 'NBEAAA', 'VVVVxx'),
+(1940, 2744, 0, 0, 0, 0, 40, 940, 1940, 1940, 1940, 80, 81, 'QWAAAA', 'OBEAAA', 'AAAAxx'),
+(8803, 2745, 1, 3, 3, 3, 3, 803, 803, 3803, 8803, 6, 7, 'PAAAAA', 'PBEAAA', 'HHHHxx'),
+(791, 2746, 1, 3, 1, 11, 91, 791, 791, 791, 791, 182, 183, 'LEAAAA', 'QBEAAA', 'OOOOxx'),
+(9809, 2747, 1, 1, 9, 9, 9, 809, 1809, 4809, 9809, 18, 19, 'HNAAAA', 'RBEAAA', 'VVVVxx'),
+(5519, 2748, 1, 3, 9, 19, 19, 519, 1519, 519, 5519, 38, 39, 'HEAAAA', 'SBEAAA', 'AAAAxx'),
+(7420, 2749, 0, 0, 0, 0, 20, 420, 1420, 2420, 7420, 40, 41, 'KZAAAA', 'TBEAAA', 'HHHHxx'),
+(7541, 2750, 1, 1, 1, 1, 41, 541, 1541, 2541, 7541, 82, 83, 'BEAAAA', 'UBEAAA', 'OOOOxx'),
+(6538, 2751, 0, 2, 8, 18, 38, 538, 538, 1538, 6538, 76, 77, 'MRAAAA', 'VBEAAA', 'VVVVxx'),
+(710, 2752, 0, 2, 0, 10, 10, 710, 710, 710, 710, 20, 21, 'IBAAAA', 'WBEAAA', 'AAAAxx'),
+(9488, 2753, 0, 0, 8, 8, 88, 488, 1488, 4488, 9488, 176, 177, 'YAAAAA', 'XBEAAA', 'HHHHxx'),
+(3135, 2754, 1, 3, 5, 15, 35, 135, 1135, 3135, 3135, 70, 71, 'PQAAAA', 'YBEAAA', 'OOOOxx'),
+(4273, 2755, 1, 1, 3, 13, 73, 273, 273, 4273, 4273, 146, 147, 'JIAAAA', 'ZBEAAA', 'VVVVxx'),
+(629, 2756, 1, 1, 9, 9, 29, 629, 629, 629, 629, 58, 59, 'FYAAAA', 'ACEAAA', 'AAAAxx'),
+(9167, 2757, 1, 3, 7, 7, 67, 167, 1167, 4167, 9167, 134, 135, 'POAAAA', 'BCEAAA', 'HHHHxx'),
+(751, 2758, 1, 3, 1, 11, 51, 751, 751, 751, 751, 102, 103, 'XCAAAA', 'CCEAAA', 'OOOOxx'),
+(1126, 2759, 0, 2, 6, 6, 26, 126, 1126, 1126, 1126, 52, 53, 'IRAAAA', 'DCEAAA', 'VVVVxx'),
+(3724, 2760, 0, 0, 4, 4, 24, 724, 1724, 3724, 3724, 48, 49, 'GNAAAA', 'ECEAAA', 'AAAAxx'),
+(1789, 2761, 1, 1, 9, 9, 89, 789, 1789, 1789, 1789, 178, 179, 'VQAAAA', 'FCEAAA', 'HHHHxx'),
+(792, 2762, 0, 0, 2, 12, 92, 792, 792, 792, 792, 184, 185, 'MEAAAA', 'GCEAAA', 'OOOOxx'),
+(2771, 2763, 1, 3, 1, 11, 71, 771, 771, 2771, 2771, 142, 143, 'PCAAAA', 'HCEAAA', 'VVVVxx'),
+(4313, 2764, 1, 1, 3, 13, 13, 313, 313, 4313, 4313, 26, 27, 'XJAAAA', 'ICEAAA', 'AAAAxx'),
+(9312, 2765, 0, 0, 2, 12, 12, 312, 1312, 4312, 9312, 24, 25, 'EUAAAA', 'JCEAAA', 'HHHHxx'),
+(955, 2766, 1, 3, 5, 15, 55, 955, 955, 955, 955, 110, 111, 'TKAAAA', 'KCEAAA', 'OOOOxx'),
+(6382, 2767, 0, 2, 2, 2, 82, 382, 382, 1382, 6382, 164, 165, 'MLAAAA', 'LCEAAA', 'VVVVxx'),
+(7875, 2768, 1, 3, 5, 15, 75, 875, 1875, 2875, 7875, 150, 151, 'XQAAAA', 'MCEAAA', 'AAAAxx'),
+(7491, 2769, 1, 3, 1, 11, 91, 491, 1491, 2491, 7491, 182, 183, 'DCAAAA', 'NCEAAA', 'HHHHxx'),
+(8193, 2770, 1, 1, 3, 13, 93, 193, 193, 3193, 8193, 186, 187, 'DDAAAA', 'OCEAAA', 'OOOOxx'),
+(968, 2771, 0, 0, 8, 8, 68, 968, 968, 968, 968, 136, 137, 'GLAAAA', 'PCEAAA', 'VVVVxx'),
+(4951, 2772, 1, 3, 1, 11, 51, 951, 951, 4951, 4951, 102, 103, 'LIAAAA', 'QCEAAA', 'AAAAxx'),
+(2204, 2773, 0, 0, 4, 4, 4, 204, 204, 2204, 2204, 8, 9, 'UGAAAA', 'RCEAAA', 'HHHHxx'),
+(2066, 2774, 0, 2, 6, 6, 66, 66, 66, 2066, 2066, 132, 133, 'MBAAAA', 'SCEAAA', 'OOOOxx'),
+(2631, 2775, 1, 3, 1, 11, 31, 631, 631, 2631, 2631, 62, 63, 'FXAAAA', 'TCEAAA', 'VVVVxx'),
+(8947, 2776, 1, 3, 7, 7, 47, 947, 947, 3947, 8947, 94, 95, 'DGAAAA', 'UCEAAA', 'AAAAxx'),
+(8033, 2777, 1, 1, 3, 13, 33, 33, 33, 3033, 8033, 66, 67, 'ZWAAAA', 'VCEAAA', 'HHHHxx'),
+(6264, 2778, 0, 0, 4, 4, 64, 264, 264, 1264, 6264, 128, 129, 'YGAAAA', 'WCEAAA', 'OOOOxx'),
+(7778, 2779, 0, 2, 8, 18, 78, 778, 1778, 2778, 7778, 156, 157, 'ENAAAA', 'XCEAAA', 'VVVVxx'),
+(9701, 2780, 1, 1, 1, 1, 1, 701, 1701, 4701, 9701, 2, 3, 'DJAAAA', 'YCEAAA', 'AAAAxx'),
+(5091, 2781, 1, 3, 1, 11, 91, 91, 1091, 91, 5091, 182, 183, 'VNAAAA', 'ZCEAAA', 'HHHHxx'),
+(7577, 2782, 1, 1, 7, 17, 77, 577, 1577, 2577, 7577, 154, 155, 'LFAAAA', 'ADEAAA', 'OOOOxx'),
+(3345, 2783, 1, 1, 5, 5, 45, 345, 1345, 3345, 3345, 90, 91, 'RYAAAA', 'BDEAAA', 'VVVVxx'),
+(7329, 2784, 1, 1, 9, 9, 29, 329, 1329, 2329, 7329, 58, 59, 'XVAAAA', 'CDEAAA', 'AAAAxx'),
+(7551, 2785, 1, 3, 1, 11, 51, 551, 1551, 2551, 7551, 102, 103, 'LEAAAA', 'DDEAAA', 'HHHHxx'),
+(6207, 2786, 1, 3, 7, 7, 7, 207, 207, 1207, 6207, 14, 15, 'TEAAAA', 'EDEAAA', 'OOOOxx'),
+(8664, 2787, 0, 0, 4, 4, 64, 664, 664, 3664, 8664, 128, 129, 'GVAAAA', 'FDEAAA', 'VVVVxx'),
+(8394, 2788, 0, 2, 4, 14, 94, 394, 394, 3394, 8394, 188, 189, 'WKAAAA', 'GDEAAA', 'AAAAxx'),
+(7324, 2789, 0, 0, 4, 4, 24, 324, 1324, 2324, 7324, 48, 49, 'SVAAAA', 'HDEAAA', 'HHHHxx'),
+(2713, 2790, 1, 1, 3, 13, 13, 713, 713, 2713, 2713, 26, 27, 'JAAAAA', 'IDEAAA', 'OOOOxx'),
+(2230, 2791, 0, 2, 0, 10, 30, 230, 230, 2230, 2230, 60, 61, 'UHAAAA', 'JDEAAA', 'VVVVxx'),
+(9211, 2792, 1, 3, 1, 11, 11, 211, 1211, 4211, 9211, 22, 23, 'HQAAAA', 'KDEAAA', 'AAAAxx'),
+(1296, 2793, 0, 0, 6, 16, 96, 296, 1296, 1296, 1296, 192, 193, 'WXAAAA', 'LDEAAA', 'HHHHxx'),
+(8104, 2794, 0, 0, 4, 4, 4, 104, 104, 3104, 8104, 8, 9, 'SZAAAA', 'MDEAAA', 'OOOOxx'),
+(6916, 2795, 0, 0, 6, 16, 16, 916, 916, 1916, 6916, 32, 33, 'AGAAAA', 'NDEAAA', 'VVVVxx'),
+(2208, 2796, 0, 0, 8, 8, 8, 208, 208, 2208, 2208, 16, 17, 'YGAAAA', 'ODEAAA', 'AAAAxx'),
+(3935, 2797, 1, 3, 5, 15, 35, 935, 1935, 3935, 3935, 70, 71, 'JVAAAA', 'PDEAAA', 'HHHHxx'),
+(7814, 2798, 0, 2, 4, 14, 14, 814, 1814, 2814, 7814, 28, 29, 'OOAAAA', 'QDEAAA', 'OOOOxx'),
+(6508, 2799, 0, 0, 8, 8, 8, 508, 508, 1508, 6508, 16, 17, 'IQAAAA', 'RDEAAA', 'VVVVxx'),
+(1703, 2800, 1, 3, 3, 3, 3, 703, 1703, 1703, 1703, 6, 7, 'NNAAAA', 'SDEAAA', 'AAAAxx'),
+(5640, 2801, 0, 0, 0, 0, 40, 640, 1640, 640, 5640, 80, 81, 'YIAAAA', 'TDEAAA', 'HHHHxx'),
+(6417, 2802, 1, 1, 7, 17, 17, 417, 417, 1417, 6417, 34, 35, 'VMAAAA', 'UDEAAA', 'OOOOxx'),
+(1713, 2803, 1, 1, 3, 13, 13, 713, 1713, 1713, 1713, 26, 27, 'XNAAAA', 'VDEAAA', 'VVVVxx'),
+(5309, 2804, 1, 1, 9, 9, 9, 309, 1309, 309, 5309, 18, 19, 'FWAAAA', 'WDEAAA', 'AAAAxx'),
+(4364, 2805, 0, 0, 4, 4, 64, 364, 364, 4364, 4364, 128, 129, 'WLAAAA', 'XDEAAA', 'HHHHxx'),
+(619, 2806, 1, 3, 9, 19, 19, 619, 619, 619, 619, 38, 39, 'VXAAAA', 'YDEAAA', 'OOOOxx'),
+(9498, 2807, 0, 2, 8, 18, 98, 498, 1498, 4498, 9498, 196, 197, 'IBAAAA', 'ZDEAAA', 'VVVVxx'),
+(2804, 2808, 0, 0, 4, 4, 4, 804, 804, 2804, 2804, 8, 9, 'WDAAAA', 'AEEAAA', 'AAAAxx'),
+(2220, 2809, 0, 0, 0, 0, 20, 220, 220, 2220, 2220, 40, 41, 'KHAAAA', 'BEEAAA', 'HHHHxx'),
+(9542, 2810, 0, 2, 2, 2, 42, 542, 1542, 4542, 9542, 84, 85, 'ADAAAA', 'CEEAAA', 'OOOOxx'),
+(3349, 2811, 1, 1, 9, 9, 49, 349, 1349, 3349, 3349, 98, 99, 'VYAAAA', 'DEEAAA', 'VVVVxx'),
+(9198, 2812, 0, 2, 8, 18, 98, 198, 1198, 4198, 9198, 196, 197, 'UPAAAA', 'EEEAAA', 'AAAAxx'),
+(2727, 2813, 1, 3, 7, 7, 27, 727, 727, 2727, 2727, 54, 55, 'XAAAAA', 'FEEAAA', 'HHHHxx'),
+(3768, 2814, 0, 0, 8, 8, 68, 768, 1768, 3768, 3768, 136, 137, 'YOAAAA', 'GEEAAA', 'OOOOxx'),
+(2334, 2815, 0, 2, 4, 14, 34, 334, 334, 2334, 2334, 68, 69, 'ULAAAA', 'HEEAAA', 'VVVVxx'),
+(7770, 2816, 0, 2, 0, 10, 70, 770, 1770, 2770, 7770, 140, 141, 'WMAAAA', 'IEEAAA', 'AAAAxx'),
+(5963, 2817, 1, 3, 3, 3, 63, 963, 1963, 963, 5963, 126, 127, 'JVAAAA', 'JEEAAA', 'HHHHxx'),
+(4732, 2818, 0, 0, 2, 12, 32, 732, 732, 4732, 4732, 64, 65, 'AAAAAA', 'KEEAAA', 'OOOOxx'),
+(2448, 2819, 0, 0, 8, 8, 48, 448, 448, 2448, 2448, 96, 97, 'EQAAAA', 'LEEAAA', 'VVVVxx'),
+(5998, 2820, 0, 2, 8, 18, 98, 998, 1998, 998, 5998, 196, 197, 'SWAAAA', 'MEEAAA', 'AAAAxx'),
+(8577, 2821, 1, 1, 7, 17, 77, 577, 577, 3577, 8577, 154, 155, 'XRAAAA', 'NEEAAA', 'HHHHxx'),
+(266, 2822, 0, 2, 6, 6, 66, 266, 266, 266, 266, 132, 133, 'GKAAAA', 'OEEAAA', 'OOOOxx'),
+(2169, 2823, 1, 1, 9, 9, 69, 169, 169, 2169, 2169, 138, 139, 'LFAAAA', 'PEEAAA', 'VVVVxx'),
+(8228, 2824, 0, 0, 8, 8, 28, 228, 228, 3228, 8228, 56, 57, 'MEAAAA', 'QEEAAA', 'AAAAxx'),
+(4813, 2825, 1, 1, 3, 13, 13, 813, 813, 4813, 4813, 26, 27, 'DDAAAA', 'REEAAA', 'HHHHxx'),
+(2769, 2826, 1, 1, 9, 9, 69, 769, 769, 2769, 2769, 138, 139, 'NCAAAA', 'SEEAAA', 'OOOOxx'),
+(8382, 2827, 0, 2, 2, 2, 82, 382, 382, 3382, 8382, 164, 165, 'KKAAAA', 'TEEAAA', 'VVVVxx'),
+(1717, 2828, 1, 1, 7, 17, 17, 717, 1717, 1717, 1717, 34, 35, 'BOAAAA', 'UEEAAA', 'AAAAxx'),
+(7178, 2829, 0, 2, 8, 18, 78, 178, 1178, 2178, 7178, 156, 157, 'CQAAAA', 'VEEAAA', 'HHHHxx'),
+(9547, 2830, 1, 3, 7, 7, 47, 547, 1547, 4547, 9547, 94, 95, 'FDAAAA', 'WEEAAA', 'OOOOxx'),
+(8187, 2831, 1, 3, 7, 7, 87, 187, 187, 3187, 8187, 174, 175, 'XCAAAA', 'XEEAAA', 'VVVVxx'),
+(3168, 2832, 0, 0, 8, 8, 68, 168, 1168, 3168, 3168, 136, 137, 'WRAAAA', 'YEEAAA', 'AAAAxx'),
+(2180, 2833, 0, 0, 0, 0, 80, 180, 180, 2180, 2180, 160, 161, 'WFAAAA', 'ZEEAAA', 'HHHHxx'),
+(859, 2834, 1, 3, 9, 19, 59, 859, 859, 859, 859, 118, 119, 'BHAAAA', 'AFEAAA', 'OOOOxx'),
+(1554, 2835, 0, 2, 4, 14, 54, 554, 1554, 1554, 1554, 108, 109, 'UHAAAA', 'BFEAAA', 'VVVVxx'),
+(3567, 2836, 1, 3, 7, 7, 67, 567, 1567, 3567, 3567, 134, 135, 'FHAAAA', 'CFEAAA', 'AAAAxx'),
+(5985, 2837, 1, 1, 5, 5, 85, 985, 1985, 985, 5985, 170, 171, 'FWAAAA', 'DFEAAA', 'HHHHxx'),
+(1, 2838, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 'BAAAAA', 'EFEAAA', 'OOOOxx'),
+(5937, 2839, 1, 1, 7, 17, 37, 937, 1937, 937, 5937, 74, 75, 'JUAAAA', 'FFEAAA', 'VVVVxx'),
+(7594, 2840, 0, 2, 4, 14, 94, 594, 1594, 2594, 7594, 188, 189, 'CGAAAA', 'GFEAAA', 'AAAAxx'),
+(3783, 2841, 1, 3, 3, 3, 83, 783, 1783, 3783, 3783, 166, 167, 'NPAAAA', 'HFEAAA', 'HHHHxx'),
+(6841, 2842, 1, 1, 1, 1, 41, 841, 841, 1841, 6841, 82, 83, 'DDAAAA', 'IFEAAA', 'OOOOxx'),
+(9694, 2843, 0, 2, 4, 14, 94, 694, 1694, 4694, 9694, 188, 189, 'WIAAAA', 'JFEAAA', 'VVVVxx'),
+(4322, 2844, 0, 2, 2, 2, 22, 322, 322, 4322, 4322, 44, 45, 'GKAAAA', 'KFEAAA', 'AAAAxx'),
+(6012, 2845, 0, 0, 2, 12, 12, 12, 12, 1012, 6012, 24, 25, 'GXAAAA', 'LFEAAA', 'HHHHxx'),
+(108, 2846, 0, 0, 8, 8, 8, 108, 108, 108, 108, 16, 17, 'EEAAAA', 'MFEAAA', 'OOOOxx'),
+(3396, 2847, 0, 0, 6, 16, 96, 396, 1396, 3396, 3396, 192, 193, 'QAAAAA', 'NFEAAA', 'VVVVxx'),
+(8643, 2848, 1, 3, 3, 3, 43, 643, 643, 3643, 8643, 86, 87, 'LUAAAA', 'OFEAAA', 'AAAAxx'),
+(6087, 2849, 1, 3, 7, 7, 87, 87, 87, 1087, 6087, 174, 175, 'DAAAAA', 'PFEAAA', 'HHHHxx'),
+(2629, 2850, 1, 1, 9, 9, 29, 629, 629, 2629, 2629, 58, 59, 'DXAAAA', 'QFEAAA', 'OOOOxx'),
+(3009, 2851, 1, 1, 9, 9, 9, 9, 1009, 3009, 3009, 18, 19, 'TLAAAA', 'RFEAAA', 'VVVVxx'),
+(438, 2852, 0, 2, 8, 18, 38, 438, 438, 438, 438, 76, 77, 'WQAAAA', 'SFEAAA', 'AAAAxx'),
+(2480, 2853, 0, 0, 0, 0, 80, 480, 480, 2480, 2480, 160, 161, 'KRAAAA', 'TFEAAA', 'HHHHxx'),
+(936, 2854, 0, 0, 6, 16, 36, 936, 936, 936, 936, 72, 73, 'AKAAAA', 'UFEAAA', 'OOOOxx'),
+(6, 2855, 0, 2, 6, 6, 6, 6, 6, 6, 6, 12, 13, 'GAAAAA', 'VFEAAA', 'VVVVxx'),
+(768, 2856, 0, 0, 8, 8, 68, 768, 768, 768, 768, 136, 137, 'ODAAAA', 'WFEAAA', 'AAAAxx'),
+(1564, 2857, 0, 0, 4, 4, 64, 564, 1564, 1564, 1564, 128, 129, 'EIAAAA', 'XFEAAA', 'HHHHxx'),
+(3236, 2858, 0, 0, 6, 16, 36, 236, 1236, 3236, 3236, 72, 73, 'MUAAAA', 'YFEAAA', 'OOOOxx'),
+(3932, 2859, 0, 0, 2, 12, 32, 932, 1932, 3932, 3932, 64, 65, 'GVAAAA', 'ZFEAAA', 'VVVVxx'),
+(8914, 2860, 0, 2, 4, 14, 14, 914, 914, 3914, 8914, 28, 29, 'WEAAAA', 'AGEAAA', 'AAAAxx'),
+(119, 2861, 1, 3, 9, 19, 19, 119, 119, 119, 119, 38, 39, 'PEAAAA', 'BGEAAA', 'HHHHxx'),
+(6034, 2862, 0, 2, 4, 14, 34, 34, 34, 1034, 6034, 68, 69, 'CYAAAA', 'CGEAAA', 'OOOOxx'),
+(5384, 2863, 0, 0, 4, 4, 84, 384, 1384, 384, 5384, 168, 169, 'CZAAAA', 'DGEAAA', 'VVVVxx'),
+(6885, 2864, 1, 1, 5, 5, 85, 885, 885, 1885, 6885, 170, 171, 'VEAAAA', 'EGEAAA', 'AAAAxx'),
+(232, 2865, 0, 0, 2, 12, 32, 232, 232, 232, 232, 64, 65, 'YIAAAA', 'FGEAAA', 'HHHHxx'),
+(1293, 2866, 1, 1, 3, 13, 93, 293, 1293, 1293, 1293, 186, 187, 'TXAAAA', 'GGEAAA', 'OOOOxx'),
+(9204, 2867, 0, 0, 4, 4, 4, 204, 1204, 4204, 9204, 8, 9, 'AQAAAA', 'HGEAAA', 'VVVVxx'),
+(527, 2868, 1, 3, 7, 7, 27, 527, 527, 527, 527, 54, 55, 'HUAAAA', 'IGEAAA', 'AAAAxx'),
+(6539, 2869, 1, 3, 9, 19, 39, 539, 539, 1539, 6539, 78, 79, 'NRAAAA', 'JGEAAA', 'HHHHxx'),
+(3679, 2870, 1, 3, 9, 19, 79, 679, 1679, 3679, 3679, 158, 159, 'NLAAAA', 'KGEAAA', 'OOOOxx'),
+(8282, 2871, 0, 2, 2, 2, 82, 282, 282, 3282, 8282, 164, 165, 'OGAAAA', 'LGEAAA', 'VVVVxx'),
+(5027, 2872, 1, 3, 7, 7, 27, 27, 1027, 27, 5027, 54, 55, 'JLAAAA', 'MGEAAA', 'AAAAxx'),
+(7694, 2873, 0, 2, 4, 14, 94, 694, 1694, 2694, 7694, 188, 189, 'YJAAAA', 'NGEAAA', 'HHHHxx'),
+(473, 2874, 1, 1, 3, 13, 73, 473, 473, 473, 473, 146, 147, 'FSAAAA', 'OGEAAA', 'OOOOxx'),
+(6325, 2875, 1, 1, 5, 5, 25, 325, 325, 1325, 6325, 50, 51, 'HJAAAA', 'PGEAAA', 'VVVVxx'),
+(8761, 2876, 1, 1, 1, 1, 61, 761, 761, 3761, 8761, 122, 123, 'ZYAAAA', 'QGEAAA', 'AAAAxx'),
+(6184, 2877, 0, 0, 4, 4, 84, 184, 184, 1184, 6184, 168, 169, 'WDAAAA', 'RGEAAA', 'HHHHxx'),
+(419, 2878, 1, 3, 9, 19, 19, 419, 419, 419, 419, 38, 39, 'DQAAAA', 'SGEAAA', 'OOOOxx'),
+(6111, 2879, 1, 3, 1, 11, 11, 111, 111, 1111, 6111, 22, 23, 'BBAAAA', 'TGEAAA', 'VVVVxx'),
+(3836, 2880, 0, 0, 6, 16, 36, 836, 1836, 3836, 3836, 72, 73, 'ORAAAA', 'UGEAAA', 'AAAAxx'),
+(4086, 2881, 0, 2, 6, 6, 86, 86, 86, 4086, 4086, 172, 173, 'EBAAAA', 'VGEAAA', 'HHHHxx'),
+(5818, 2882, 0, 2, 8, 18, 18, 818, 1818, 818, 5818, 36, 37, 'UPAAAA', 'WGEAAA', 'OOOOxx'),
+(4528, 2883, 0, 0, 8, 8, 28, 528, 528, 4528, 4528, 56, 57, 'ESAAAA', 'XGEAAA', 'VVVVxx'),
+(7199, 2884, 1, 3, 9, 19, 99, 199, 1199, 2199, 7199, 198, 199, 'XQAAAA', 'YGEAAA', 'AAAAxx'),
+(1847, 2885, 1, 3, 7, 7, 47, 847, 1847, 1847, 1847, 94, 95, 'BTAAAA', 'ZGEAAA', 'HHHHxx'),
+(2875, 2886, 1, 3, 5, 15, 75, 875, 875, 2875, 2875, 150, 151, 'PGAAAA', 'AHEAAA', 'OOOOxx'),
+(2872, 2887, 0, 0, 2, 12, 72, 872, 872, 2872, 2872, 144, 145, 'MGAAAA', 'BHEAAA', 'VVVVxx'),
+(3972, 2888, 0, 0, 2, 12, 72, 972, 1972, 3972, 3972, 144, 145, 'UWAAAA', 'CHEAAA', 'AAAAxx'),
+(7590, 2889, 0, 2, 0, 10, 90, 590, 1590, 2590, 7590, 180, 181, 'YFAAAA', 'DHEAAA', 'HHHHxx'),
+(1914, 2890, 0, 2, 4, 14, 14, 914, 1914, 1914, 1914, 28, 29, 'QVAAAA', 'EHEAAA', 'OOOOxx'),
+(1658, 2891, 0, 2, 8, 18, 58, 658, 1658, 1658, 1658, 116, 117, 'ULAAAA', 'FHEAAA', 'VVVVxx'),
+(2126, 2892, 0, 2, 6, 6, 26, 126, 126, 2126, 2126, 52, 53, 'UDAAAA', 'GHEAAA', 'AAAAxx'),
+(645, 2893, 1, 1, 5, 5, 45, 645, 645, 645, 645, 90, 91, 'VYAAAA', 'HHEAAA', 'HHHHxx'),
+(6636, 2894, 0, 0, 6, 16, 36, 636, 636, 1636, 6636, 72, 73, 'GVAAAA', 'IHEAAA', 'OOOOxx'),
+(1469, 2895, 1, 1, 9, 9, 69, 469, 1469, 1469, 1469, 138, 139, 'NEAAAA', 'JHEAAA', 'VVVVxx'),
+(1377, 2896, 1, 1, 7, 17, 77, 377, 1377, 1377, 1377, 154, 155, 'ZAAAAA', 'KHEAAA', 'AAAAxx'),
+(8425, 2897, 1, 1, 5, 5, 25, 425, 425, 3425, 8425, 50, 51, 'BMAAAA', 'LHEAAA', 'HHHHxx'),
+(9300, 2898, 0, 0, 0, 0, 0, 300, 1300, 4300, 9300, 0, 1, 'STAAAA', 'MHEAAA', 'OOOOxx'),
+(5355, 2899, 1, 3, 5, 15, 55, 355, 1355, 355, 5355, 110, 111, 'ZXAAAA', 'NHEAAA', 'VVVVxx'),
+(840, 2900, 0, 0, 0, 0, 40, 840, 840, 840, 840, 80, 81, 'IGAAAA', 'OHEAAA', 'AAAAxx'),
+(5185, 2901, 1, 1, 5, 5, 85, 185, 1185, 185, 5185, 170, 171, 'LRAAAA', 'PHEAAA', 'HHHHxx'),
+(6467, 2902, 1, 3, 7, 7, 67, 467, 467, 1467, 6467, 134, 135, 'TOAAAA', 'QHEAAA', 'OOOOxx'),
+(58, 2903, 0, 2, 8, 18, 58, 58, 58, 58, 58, 116, 117, 'GCAAAA', 'RHEAAA', 'VVVVxx'),
+(5051, 2904, 1, 3, 1, 11, 51, 51, 1051, 51, 5051, 102, 103, 'HMAAAA', 'SHEAAA', 'AAAAxx'),
+(8901, 2905, 1, 1, 1, 1, 1, 901, 901, 3901, 8901, 2, 3, 'JEAAAA', 'THEAAA', 'HHHHxx'),
+(1550, 2906, 0, 2, 0, 10, 50, 550, 1550, 1550, 1550, 100, 101, 'QHAAAA', 'UHEAAA', 'OOOOxx'),
+(1698, 2907, 0, 2, 8, 18, 98, 698, 1698, 1698, 1698, 196, 197, 'INAAAA', 'VHEAAA', 'VVVVxx'),
+(802, 2908, 0, 2, 2, 2, 2, 802, 802, 802, 802, 4, 5, 'WEAAAA', 'WHEAAA', 'AAAAxx'),
+(2440, 2909, 0, 0, 0, 0, 40, 440, 440, 2440, 2440, 80, 81, 'WPAAAA', 'XHEAAA', 'HHHHxx'),
+(2260, 2910, 0, 0, 0, 0, 60, 260, 260, 2260, 2260, 120, 121, 'YIAAAA', 'YHEAAA', 'OOOOxx'),
+(8218, 2911, 0, 2, 8, 18, 18, 218, 218, 3218, 8218, 36, 37, 'CEAAAA', 'ZHEAAA', 'VVVVxx'),
+(5144, 2912, 0, 0, 4, 4, 44, 144, 1144, 144, 5144, 88, 89, 'WPAAAA', 'AIEAAA', 'AAAAxx'),
+(4822, 2913, 0, 2, 2, 2, 22, 822, 822, 4822, 4822, 44, 45, 'MDAAAA', 'BIEAAA', 'HHHHxx'),
+(9476, 2914, 0, 0, 6, 16, 76, 476, 1476, 4476, 9476, 152, 153, 'MAAAAA', 'CIEAAA', 'OOOOxx'),
+(7535, 2915, 1, 3, 5, 15, 35, 535, 1535, 2535, 7535, 70, 71, 'VDAAAA', 'DIEAAA', 'VVVVxx'),
+(8738, 2916, 0, 2, 8, 18, 38, 738, 738, 3738, 8738, 76, 77, 'CYAAAA', 'EIEAAA', 'AAAAxx'),
+(7946, 2917, 0, 2, 6, 6, 46, 946, 1946, 2946, 7946, 92, 93, 'QTAAAA', 'FIEAAA', 'HHHHxx'),
+(8143, 2918, 1, 3, 3, 3, 43, 143, 143, 3143, 8143, 86, 87, 'FBAAAA', 'GIEAAA', 'OOOOxx'),
+(2623, 2919, 1, 3, 3, 3, 23, 623, 623, 2623, 2623, 46, 47, 'XWAAAA', 'HIEAAA', 'VVVVxx'),
+(5209, 2920, 1, 1, 9, 9, 9, 209, 1209, 209, 5209, 18, 19, 'JSAAAA', 'IIEAAA', 'AAAAxx'),
+(7674, 2921, 0, 2, 4, 14, 74, 674, 1674, 2674, 7674, 148, 149, 'EJAAAA', 'JIEAAA', 'HHHHxx'),
+(1135, 2922, 1, 3, 5, 15, 35, 135, 1135, 1135, 1135, 70, 71, 'RRAAAA', 'KIEAAA', 'OOOOxx'),
+(424, 2923, 0, 0, 4, 4, 24, 424, 424, 424, 424, 48, 49, 'IQAAAA', 'LIEAAA', 'VVVVxx'),
+(942, 2924, 0, 2, 2, 2, 42, 942, 942, 942, 942, 84, 85, 'GKAAAA', 'MIEAAA', 'AAAAxx'),
+(7813, 2925, 1, 1, 3, 13, 13, 813, 1813, 2813, 7813, 26, 27, 'NOAAAA', 'NIEAAA', 'HHHHxx'),
+(3539, 2926, 1, 3, 9, 19, 39, 539, 1539, 3539, 3539, 78, 79, 'DGAAAA', 'OIEAAA', 'OOOOxx'),
+(2909, 2927, 1, 1, 9, 9, 9, 909, 909, 2909, 2909, 18, 19, 'XHAAAA', 'PIEAAA', 'VVVVxx'),
+(3748, 2928, 0, 0, 8, 8, 48, 748, 1748, 3748, 3748, 96, 97, 'EOAAAA', 'QIEAAA', 'AAAAxx'),
+(2996, 2929, 0, 0, 6, 16, 96, 996, 996, 2996, 2996, 192, 193, 'GLAAAA', 'RIEAAA', 'HHHHxx'),
+(1869, 2930, 1, 1, 9, 9, 69, 869, 1869, 1869, 1869, 138, 139, 'XTAAAA', 'SIEAAA', 'OOOOxx'),
+(8151, 2931, 1, 3, 1, 11, 51, 151, 151, 3151, 8151, 102, 103, 'NBAAAA', 'TIEAAA', 'VVVVxx'),
+(6361, 2932, 1, 1, 1, 1, 61, 361, 361, 1361, 6361, 122, 123, 'RKAAAA', 'UIEAAA', 'AAAAxx'),
+(5568, 2933, 0, 0, 8, 8, 68, 568, 1568, 568, 5568, 136, 137, 'EGAAAA', 'VIEAAA', 'HHHHxx'),
+(2796, 2934, 0, 0, 6, 16, 96, 796, 796, 2796, 2796, 192, 193, 'ODAAAA', 'WIEAAA', 'OOOOxx'),
+(8489, 2935, 1, 1, 9, 9, 89, 489, 489, 3489, 8489, 178, 179, 'NOAAAA', 'XIEAAA', 'VVVVxx'),
+(9183, 2936, 1, 3, 3, 3, 83, 183, 1183, 4183, 9183, 166, 167, 'FPAAAA', 'YIEAAA', 'AAAAxx'),
+(8227, 2937, 1, 3, 7, 7, 27, 227, 227, 3227, 8227, 54, 55, 'LEAAAA', 'ZIEAAA', 'HHHHxx'),
+(1844, 2938, 0, 0, 4, 4, 44, 844, 1844, 1844, 1844, 88, 89, 'YSAAAA', 'AJEAAA', 'OOOOxx'),
+(3975, 2939, 1, 3, 5, 15, 75, 975, 1975, 3975, 3975, 150, 151, 'XWAAAA', 'BJEAAA', 'VVVVxx'),
+(6490, 2940, 0, 2, 0, 10, 90, 490, 490, 1490, 6490, 180, 181, 'QPAAAA', 'CJEAAA', 'AAAAxx'),
+(8303, 2941, 1, 3, 3, 3, 3, 303, 303, 3303, 8303, 6, 7, 'JHAAAA', 'DJEAAA', 'HHHHxx'),
+(7334, 2942, 0, 2, 4, 14, 34, 334, 1334, 2334, 7334, 68, 69, 'CWAAAA', 'EJEAAA', 'OOOOxx'),
+(2382, 2943, 0, 2, 2, 2, 82, 382, 382, 2382, 2382, 164, 165, 'QNAAAA', 'FJEAAA', 'VVVVxx'),
+(177, 2944, 1, 1, 7, 17, 77, 177, 177, 177, 177, 154, 155, 'VGAAAA', 'GJEAAA', 'AAAAxx'),
+(8117, 2945, 1, 1, 7, 17, 17, 117, 117, 3117, 8117, 34, 35, 'FAAAAA', 'HJEAAA', 'HHHHxx'),
+(5485, 2946, 1, 1, 5, 5, 85, 485, 1485, 485, 5485, 170, 171, 'ZCAAAA', 'IJEAAA', 'OOOOxx'),
+(6544, 2947, 0, 0, 4, 4, 44, 544, 544, 1544, 6544, 88, 89, 'SRAAAA', 'JJEAAA', 'VVVVxx'),
+(8517, 2948, 1, 1, 7, 17, 17, 517, 517, 3517, 8517, 34, 35, 'PPAAAA', 'KJEAAA', 'AAAAxx'),
+(2252, 2949, 0, 0, 2, 12, 52, 252, 252, 2252, 2252, 104, 105, 'QIAAAA', 'LJEAAA', 'HHHHxx'),
+(4480, 2950, 0, 0, 0, 0, 80, 480, 480, 4480, 4480, 160, 161, 'IQAAAA', 'MJEAAA', 'OOOOxx'),
+(4785, 2951, 1, 1, 5, 5, 85, 785, 785, 4785, 4785, 170, 171, 'BCAAAA', 'NJEAAA', 'VVVVxx'),
+(9700, 2952, 0, 0, 0, 0, 0, 700, 1700, 4700, 9700, 0, 1, 'CJAAAA', 'OJEAAA', 'AAAAxx'),
+(2122, 2953, 0, 2, 2, 2, 22, 122, 122, 2122, 2122, 44, 45, 'QDAAAA', 'PJEAAA', 'HHHHxx'),
+(8783, 2954, 1, 3, 3, 3, 83, 783, 783, 3783, 8783, 166, 167, 'VZAAAA', 'QJEAAA', 'OOOOxx'),
+(1453, 2955, 1, 1, 3, 13, 53, 453, 1453, 1453, 1453, 106, 107, 'XDAAAA', 'RJEAAA', 'VVVVxx'),
+(3908, 2956, 0, 0, 8, 8, 8, 908, 1908, 3908, 3908, 16, 17, 'IUAAAA', 'SJEAAA', 'AAAAxx'),
+(7707, 2957, 1, 3, 7, 7, 7, 707, 1707, 2707, 7707, 14, 15, 'LKAAAA', 'TJEAAA', 'HHHHxx'),
+(9049, 2958, 1, 1, 9, 9, 49, 49, 1049, 4049, 9049, 98, 99, 'BKAAAA', 'UJEAAA', 'OOOOxx'),
+(654, 2959, 0, 2, 4, 14, 54, 654, 654, 654, 654, 108, 109, 'EZAAAA', 'VJEAAA', 'VVVVxx'),
+(3336, 2960, 0, 0, 6, 16, 36, 336, 1336, 3336, 3336, 72, 73, 'IYAAAA', 'WJEAAA', 'AAAAxx'),
+(622, 2961, 0, 2, 2, 2, 22, 622, 622, 622, 622, 44, 45, 'YXAAAA', 'XJEAAA', 'HHHHxx'),
+(8398, 2962, 0, 2, 8, 18, 98, 398, 398, 3398, 8398, 196, 197, 'ALAAAA', 'YJEAAA', 'OOOOxx'),
+(9193, 2963, 1, 1, 3, 13, 93, 193, 1193, 4193, 9193, 186, 187, 'PPAAAA', 'ZJEAAA', 'VVVVxx'),
+(7896, 2964, 0, 0, 6, 16, 96, 896, 1896, 2896, 7896, 192, 193, 'SRAAAA', 'AKEAAA', 'AAAAxx'),
+(9798, 2965, 0, 2, 8, 18, 98, 798, 1798, 4798, 9798, 196, 197, 'WMAAAA', 'BKEAAA', 'HHHHxx'),
+(2881, 2966, 1, 1, 1, 1, 81, 881, 881, 2881, 2881, 162, 163, 'VGAAAA', 'CKEAAA', 'OOOOxx'),
+(672, 2967, 0, 0, 2, 12, 72, 672, 672, 672, 672, 144, 145, 'WZAAAA', 'DKEAAA', 'VVVVxx'),
+(6743, 2968, 1, 3, 3, 3, 43, 743, 743, 1743, 6743, 86, 87, 'JZAAAA', 'EKEAAA', 'AAAAxx'),
+(8935, 2969, 1, 3, 5, 15, 35, 935, 935, 3935, 8935, 70, 71, 'RFAAAA', 'FKEAAA', 'HHHHxx'),
+(2426, 2970, 0, 2, 6, 6, 26, 426, 426, 2426, 2426, 52, 53, 'IPAAAA', 'GKEAAA', 'OOOOxx'),
+(722, 2971, 0, 2, 2, 2, 22, 722, 722, 722, 722, 44, 45, 'UBAAAA', 'HKEAAA', 'VVVVxx'),
+(5088, 2972, 0, 0, 8, 8, 88, 88, 1088, 88, 5088, 176, 177, 'SNAAAA', 'IKEAAA', 'AAAAxx'),
+(8677, 2973, 1, 1, 7, 17, 77, 677, 677, 3677, 8677, 154, 155, 'TVAAAA', 'JKEAAA', 'HHHHxx'),
+(6963, 2974, 1, 3, 3, 3, 63, 963, 963, 1963, 6963, 126, 127, 'VHAAAA', 'KKEAAA', 'OOOOxx'),
+(1653, 2975, 1, 1, 3, 13, 53, 653, 1653, 1653, 1653, 106, 107, 'PLAAAA', 'LKEAAA', 'VVVVxx'),
+(7295, 2976, 1, 3, 5, 15, 95, 295, 1295, 2295, 7295, 190, 191, 'PUAAAA', 'MKEAAA', 'AAAAxx'),
+(6675, 2977, 1, 3, 5, 15, 75, 675, 675, 1675, 6675, 150, 151, 'TWAAAA', 'NKEAAA', 'HHHHxx'),
+(7183, 2978, 1, 3, 3, 3, 83, 183, 1183, 2183, 7183, 166, 167, 'HQAAAA', 'OKEAAA', 'OOOOxx'),
+(4378, 2979, 0, 2, 8, 18, 78, 378, 378, 4378, 4378, 156, 157, 'KMAAAA', 'PKEAAA', 'VVVVxx'),
+(2157, 2980, 1, 1, 7, 17, 57, 157, 157, 2157, 2157, 114, 115, 'ZEAAAA', 'QKEAAA', 'AAAAxx'),
+(2621, 2981, 1, 1, 1, 1, 21, 621, 621, 2621, 2621, 42, 43, 'VWAAAA', 'RKEAAA', 'HHHHxx'),
+(9278, 2982, 0, 2, 8, 18, 78, 278, 1278, 4278, 9278, 156, 157, 'WSAAAA', 'SKEAAA', 'OOOOxx'),
+(79, 2983, 1, 3, 9, 19, 79, 79, 79, 79, 79, 158, 159, 'BDAAAA', 'TKEAAA', 'VVVVxx'),
+(7358, 2984, 0, 2, 8, 18, 58, 358, 1358, 2358, 7358, 116, 117, 'AXAAAA', 'UKEAAA', 'AAAAxx'),
+(3589, 2985, 1, 1, 9, 9, 89, 589, 1589, 3589, 3589, 178, 179, 'BIAAAA', 'VKEAAA', 'HHHHxx'),
+(1254, 2986, 0, 2, 4, 14, 54, 254, 1254, 1254, 1254, 108, 109, 'GWAAAA', 'WKEAAA', 'OOOOxx'),
+(3490, 2987, 0, 2, 0, 10, 90, 490, 1490, 3490, 3490, 180, 181, 'GEAAAA', 'XKEAAA', 'VVVVxx'),
+(7533, 2988, 1, 1, 3, 13, 33, 533, 1533, 2533, 7533, 66, 67, 'TDAAAA', 'YKEAAA', 'AAAAxx'),
+(2800, 2989, 0, 0, 0, 0, 0, 800, 800, 2800, 2800, 0, 1, 'SDAAAA', 'ZKEAAA', 'HHHHxx'),
+(351, 2990, 1, 3, 1, 11, 51, 351, 351, 351, 351, 102, 103, 'NNAAAA', 'ALEAAA', 'OOOOxx'),
+(4359, 2991, 1, 3, 9, 19, 59, 359, 359, 4359, 4359, 118, 119, 'RLAAAA', 'BLEAAA', 'VVVVxx'),
+(5788, 2992, 0, 0, 8, 8, 88, 788, 1788, 788, 5788, 176, 177, 'QOAAAA', 'CLEAAA', 'AAAAxx'),
+(5521, 2993, 1, 1, 1, 1, 21, 521, 1521, 521, 5521, 42, 43, 'JEAAAA', 'DLEAAA', 'HHHHxx'),
+(3351, 2994, 1, 3, 1, 11, 51, 351, 1351, 3351, 3351, 102, 103, 'XYAAAA', 'ELEAAA', 'OOOOxx'),
+(5129, 2995, 1, 1, 9, 9, 29, 129, 1129, 129, 5129, 58, 59, 'HPAAAA', 'FLEAAA', 'VVVVxx'),
+(315, 2996, 1, 3, 5, 15, 15, 315, 315, 315, 315, 30, 31, 'DMAAAA', 'GLEAAA', 'AAAAxx'),
+(7552, 2997, 0, 0, 2, 12, 52, 552, 1552, 2552, 7552, 104, 105, 'MEAAAA', 'HLEAAA', 'HHHHxx'),
+(9176, 2998, 0, 0, 6, 16, 76, 176, 1176, 4176, 9176, 152, 153, 'YOAAAA', 'ILEAAA', 'OOOOxx'),
+(7458, 2999, 0, 2, 8, 18, 58, 458, 1458, 2458, 7458, 116, 117, 'WAAAAA', 'JLEAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(279, 3000, 1, 3, 9, 19, 79, 279, 279, 279, 279, 158, 159, 'TKAAAA', 'KLEAAA', 'AAAAxx'),
+(738, 3001, 0, 2, 8, 18, 38, 738, 738, 738, 738, 76, 77, 'KCAAAA', 'LLEAAA', 'HHHHxx'),
+(2557, 3002, 1, 1, 7, 17, 57, 557, 557, 2557, 2557, 114, 115, 'JUAAAA', 'MLEAAA', 'OOOOxx'),
+(9395, 3003, 1, 3, 5, 15, 95, 395, 1395, 4395, 9395, 190, 191, 'JXAAAA', 'NLEAAA', 'VVVVxx'),
+(7214, 3004, 0, 2, 4, 14, 14, 214, 1214, 2214, 7214, 28, 29, 'MRAAAA', 'OLEAAA', 'AAAAxx'),
+(6354, 3005, 0, 2, 4, 14, 54, 354, 354, 1354, 6354, 108, 109, 'KKAAAA', 'PLEAAA', 'HHHHxx'),
+(4799, 3006, 1, 3, 9, 19, 99, 799, 799, 4799, 4799, 198, 199, 'PCAAAA', 'QLEAAA', 'OOOOxx'),
+(1231, 3007, 1, 3, 1, 11, 31, 231, 1231, 1231, 1231, 62, 63, 'JVAAAA', 'RLEAAA', 'VVVVxx'),
+(5252, 3008, 0, 0, 2, 12, 52, 252, 1252, 252, 5252, 104, 105, 'AUAAAA', 'SLEAAA', 'AAAAxx'),
+(5250, 3009, 0, 2, 0, 10, 50, 250, 1250, 250, 5250, 100, 101, 'YTAAAA', 'TLEAAA', 'HHHHxx'),
+(9319, 3010, 1, 3, 9, 19, 19, 319, 1319, 4319, 9319, 38, 39, 'LUAAAA', 'ULEAAA', 'OOOOxx'),
+(1724, 3011, 0, 0, 4, 4, 24, 724, 1724, 1724, 1724, 48, 49, 'IOAAAA', 'VLEAAA', 'VVVVxx'),
+(7947, 3012, 1, 3, 7, 7, 47, 947, 1947, 2947, 7947, 94, 95, 'RTAAAA', 'WLEAAA', 'AAAAxx'),
+(1105, 3013, 1, 1, 5, 5, 5, 105, 1105, 1105, 1105, 10, 11, 'NQAAAA', 'XLEAAA', 'HHHHxx'),
+(1417, 3014, 1, 1, 7, 17, 17, 417, 1417, 1417, 1417, 34, 35, 'NCAAAA', 'YLEAAA', 'OOOOxx'),
+(7101, 3015, 1, 1, 1, 1, 1, 101, 1101, 2101, 7101, 2, 3, 'DNAAAA', 'ZLEAAA', 'VVVVxx'),
+(1088, 3016, 0, 0, 8, 8, 88, 88, 1088, 1088, 1088, 176, 177, 'WPAAAA', 'AMEAAA', 'AAAAxx'),
+(979, 3017, 1, 3, 9, 19, 79, 979, 979, 979, 979, 158, 159, 'RLAAAA', 'BMEAAA', 'HHHHxx'),
+(7589, 3018, 1, 1, 9, 9, 89, 589, 1589, 2589, 7589, 178, 179, 'XFAAAA', 'CMEAAA', 'OOOOxx'),
+(8952, 3019, 0, 0, 2, 12, 52, 952, 952, 3952, 8952, 104, 105, 'IGAAAA', 'DMEAAA', 'VVVVxx'),
+(2864, 3020, 0, 0, 4, 4, 64, 864, 864, 2864, 2864, 128, 129, 'EGAAAA', 'EMEAAA', 'AAAAxx'),
+(234, 3021, 0, 2, 4, 14, 34, 234, 234, 234, 234, 68, 69, 'AJAAAA', 'FMEAAA', 'HHHHxx'),
+(7231, 3022, 1, 3, 1, 11, 31, 231, 1231, 2231, 7231, 62, 63, 'DSAAAA', 'GMEAAA', 'OOOOxx'),
+(6792, 3023, 0, 0, 2, 12, 92, 792, 792, 1792, 6792, 184, 185, 'GBAAAA', 'HMEAAA', 'VVVVxx'),
+(4311, 3024, 1, 3, 1, 11, 11, 311, 311, 4311, 4311, 22, 23, 'VJAAAA', 'IMEAAA', 'AAAAxx'),
+(3374, 3025, 0, 2, 4, 14, 74, 374, 1374, 3374, 3374, 148, 149, 'UZAAAA', 'JMEAAA', 'HHHHxx'),
+(3367, 3026, 1, 3, 7, 7, 67, 367, 1367, 3367, 3367, 134, 135, 'NZAAAA', 'KMEAAA', 'OOOOxx'),
+(2598, 3027, 0, 2, 8, 18, 98, 598, 598, 2598, 2598, 196, 197, 'YVAAAA', 'LMEAAA', 'VVVVxx'),
+(1033, 3028, 1, 1, 3, 13, 33, 33, 1033, 1033, 1033, 66, 67, 'TNAAAA', 'MMEAAA', 'AAAAxx'),
+(7803, 3029, 1, 3, 3, 3, 3, 803, 1803, 2803, 7803, 6, 7, 'DOAAAA', 'NMEAAA', 'HHHHxx'),
+(3870, 3030, 0, 2, 0, 10, 70, 870, 1870, 3870, 3870, 140, 141, 'WSAAAA', 'OMEAAA', 'OOOOxx'),
+(4962, 3031, 0, 2, 2, 2, 62, 962, 962, 4962, 4962, 124, 125, 'WIAAAA', 'PMEAAA', 'VVVVxx'),
+(4842, 3032, 0, 2, 2, 2, 42, 842, 842, 4842, 4842, 84, 85, 'GEAAAA', 'QMEAAA', 'AAAAxx'),
+(8814, 3033, 0, 2, 4, 14, 14, 814, 814, 3814, 8814, 28, 29, 'ABAAAA', 'RMEAAA', 'HHHHxx'),
+(3429, 3034, 1, 1, 9, 9, 29, 429, 1429, 3429, 3429, 58, 59, 'XBAAAA', 'SMEAAA', 'OOOOxx'),
+(6550, 3035, 0, 2, 0, 10, 50, 550, 550, 1550, 6550, 100, 101, 'YRAAAA', 'TMEAAA', 'VVVVxx'),
+(6317, 3036, 1, 1, 7, 17, 17, 317, 317, 1317, 6317, 34, 35, 'ZIAAAA', 'UMEAAA', 'AAAAxx'),
+(5023, 3037, 1, 3, 3, 3, 23, 23, 1023, 23, 5023, 46, 47, 'FLAAAA', 'VMEAAA', 'HHHHxx'),
+(5825, 3038, 1, 1, 5, 5, 25, 825, 1825, 825, 5825, 50, 51, 'BQAAAA', 'WMEAAA', 'OOOOxx'),
+(5297, 3039, 1, 1, 7, 17, 97, 297, 1297, 297, 5297, 194, 195, 'TVAAAA', 'XMEAAA', 'VVVVxx'),
+(8764, 3040, 0, 0, 4, 4, 64, 764, 764, 3764, 8764, 128, 129, 'CZAAAA', 'YMEAAA', 'AAAAxx'),
+(5084, 3041, 0, 0, 4, 4, 84, 84, 1084, 84, 5084, 168, 169, 'ONAAAA', 'ZMEAAA', 'HHHHxx'),
+(6808, 3042, 0, 0, 8, 8, 8, 808, 808, 1808, 6808, 16, 17, 'WBAAAA', 'ANEAAA', 'OOOOxx'),
+(1780, 3043, 0, 0, 0, 0, 80, 780, 1780, 1780, 1780, 160, 161, 'MQAAAA', 'BNEAAA', 'VVVVxx'),
+(4092, 3044, 0, 0, 2, 12, 92, 92, 92, 4092, 4092, 184, 185, 'KBAAAA', 'CNEAAA', 'AAAAxx'),
+(3618, 3045, 0, 2, 8, 18, 18, 618, 1618, 3618, 3618, 36, 37, 'EJAAAA', 'DNEAAA', 'HHHHxx'),
+(7299, 3046, 1, 3, 9, 19, 99, 299, 1299, 2299, 7299, 198, 199, 'TUAAAA', 'ENEAAA', 'OOOOxx'),
+(8544, 3047, 0, 0, 4, 4, 44, 544, 544, 3544, 8544, 88, 89, 'QQAAAA', 'FNEAAA', 'VVVVxx'),
+(2359, 3048, 1, 3, 9, 19, 59, 359, 359, 2359, 2359, 118, 119, 'TMAAAA', 'GNEAAA', 'AAAAxx'),
+(1939, 3049, 1, 3, 9, 19, 39, 939, 1939, 1939, 1939, 78, 79, 'PWAAAA', 'HNEAAA', 'HHHHxx'),
+(5834, 3050, 0, 2, 4, 14, 34, 834, 1834, 834, 5834, 68, 69, 'KQAAAA', 'INEAAA', 'OOOOxx'),
+(1997, 3051, 1, 1, 7, 17, 97, 997, 1997, 1997, 1997, 194, 195, 'VYAAAA', 'JNEAAA', 'VVVVxx'),
+(7917, 3052, 1, 1, 7, 17, 17, 917, 1917, 2917, 7917, 34, 35, 'NSAAAA', 'KNEAAA', 'AAAAxx'),
+(2098, 3053, 0, 2, 8, 18, 98, 98, 98, 2098, 2098, 196, 197, 'SCAAAA', 'LNEAAA', 'HHHHxx'),
+(7576, 3054, 0, 0, 6, 16, 76, 576, 1576, 2576, 7576, 152, 153, 'KFAAAA', 'MNEAAA', 'OOOOxx'),
+(376, 3055, 0, 0, 6, 16, 76, 376, 376, 376, 376, 152, 153, 'MOAAAA', 'NNEAAA', 'VVVVxx'),
+(8535, 3056, 1, 3, 5, 15, 35, 535, 535, 3535, 8535, 70, 71, 'HQAAAA', 'ONEAAA', 'AAAAxx'),
+(5659, 3057, 1, 3, 9, 19, 59, 659, 1659, 659, 5659, 118, 119, 'RJAAAA', 'PNEAAA', 'HHHHxx'),
+(2786, 3058, 0, 2, 6, 6, 86, 786, 786, 2786, 2786, 172, 173, 'EDAAAA', 'QNEAAA', 'OOOOxx'),
+(8820, 3059, 0, 0, 0, 0, 20, 820, 820, 3820, 8820, 40, 41, 'GBAAAA', 'RNEAAA', 'VVVVxx'),
+(1229, 3060, 1, 1, 9, 9, 29, 229, 1229, 1229, 1229, 58, 59, 'HVAAAA', 'SNEAAA', 'AAAAxx'),
+(9321, 3061, 1, 1, 1, 1, 21, 321, 1321, 4321, 9321, 42, 43, 'NUAAAA', 'TNEAAA', 'HHHHxx'),
+(7662, 3062, 0, 2, 2, 2, 62, 662, 1662, 2662, 7662, 124, 125, 'SIAAAA', 'UNEAAA', 'OOOOxx'),
+(5535, 3063, 1, 3, 5, 15, 35, 535, 1535, 535, 5535, 70, 71, 'XEAAAA', 'VNEAAA', 'VVVVxx'),
+(4889, 3064, 1, 1, 9, 9, 89, 889, 889, 4889, 4889, 178, 179, 'BGAAAA', 'WNEAAA', 'AAAAxx'),
+(8259, 3065, 1, 3, 9, 19, 59, 259, 259, 3259, 8259, 118, 119, 'RFAAAA', 'XNEAAA', 'HHHHxx'),
+(6789, 3066, 1, 1, 9, 9, 89, 789, 789, 1789, 6789, 178, 179, 'DBAAAA', 'YNEAAA', 'OOOOxx'),
+(5411, 3067, 1, 3, 1, 11, 11, 411, 1411, 411, 5411, 22, 23, 'DAAAAA', 'ZNEAAA', 'VVVVxx'),
+(6992, 3068, 0, 0, 2, 12, 92, 992, 992, 1992, 6992, 184, 185, 'YIAAAA', 'AOEAAA', 'AAAAxx'),
+(7698, 3069, 0, 2, 8, 18, 98, 698, 1698, 2698, 7698, 196, 197, 'CKAAAA', 'BOEAAA', 'HHHHxx'),
+(2342, 3070, 0, 2, 2, 2, 42, 342, 342, 2342, 2342, 84, 85, 'CMAAAA', 'COEAAA', 'OOOOxx'),
+(1501, 3071, 1, 1, 1, 1, 1, 501, 1501, 1501, 1501, 2, 3, 'TFAAAA', 'DOEAAA', 'VVVVxx'),
+(6322, 3072, 0, 2, 2, 2, 22, 322, 322, 1322, 6322, 44, 45, 'EJAAAA', 'EOEAAA', 'AAAAxx'),
+(9861, 3073, 1, 1, 1, 1, 61, 861, 1861, 4861, 9861, 122, 123, 'HPAAAA', 'FOEAAA', 'HHHHxx'),
+(9802, 3074, 0, 2, 2, 2, 2, 802, 1802, 4802, 9802, 4, 5, 'ANAAAA', 'GOEAAA', 'OOOOxx'),
+(4750, 3075, 0, 2, 0, 10, 50, 750, 750, 4750, 4750, 100, 101, 'SAAAAA', 'HOEAAA', 'VVVVxx'),
+(5855, 3076, 1, 3, 5, 15, 55, 855, 1855, 855, 5855, 110, 111, 'FRAAAA', 'IOEAAA', 'AAAAxx'),
+(4304, 3077, 0, 0, 4, 4, 4, 304, 304, 4304, 4304, 8, 9, 'OJAAAA', 'JOEAAA', 'HHHHxx'),
+(2605, 3078, 1, 1, 5, 5, 5, 605, 605, 2605, 2605, 10, 11, 'FWAAAA', 'KOEAAA', 'OOOOxx'),
+(1802, 3079, 0, 2, 2, 2, 2, 802, 1802, 1802, 1802, 4, 5, 'IRAAAA', 'LOEAAA', 'VVVVxx'),
+(9368, 3080, 0, 0, 8, 8, 68, 368, 1368, 4368, 9368, 136, 137, 'IWAAAA', 'MOEAAA', 'AAAAxx'),
+(7107, 3081, 1, 3, 7, 7, 7, 107, 1107, 2107, 7107, 14, 15, 'JNAAAA', 'NOEAAA', 'HHHHxx'),
+(8895, 3082, 1, 3, 5, 15, 95, 895, 895, 3895, 8895, 190, 191, 'DEAAAA', 'OOEAAA', 'OOOOxx'),
+(3750, 3083, 0, 2, 0, 10, 50, 750, 1750, 3750, 3750, 100, 101, 'GOAAAA', 'POEAAA', 'VVVVxx'),
+(8934, 3084, 0, 2, 4, 14, 34, 934, 934, 3934, 8934, 68, 69, 'QFAAAA', 'QOEAAA', 'AAAAxx'),
+(9464, 3085, 0, 0, 4, 4, 64, 464, 1464, 4464, 9464, 128, 129, 'AAAAAA', 'ROEAAA', 'HHHHxx'),
+(1928, 3086, 0, 0, 8, 8, 28, 928, 1928, 1928, 1928, 56, 57, 'EWAAAA', 'SOEAAA', 'OOOOxx'),
+(3196, 3087, 0, 0, 6, 16, 96, 196, 1196, 3196, 3196, 192, 193, 'YSAAAA', 'TOEAAA', 'VVVVxx'),
+(5256, 3088, 0, 0, 6, 16, 56, 256, 1256, 256, 5256, 112, 113, 'EUAAAA', 'UOEAAA', 'AAAAxx'),
+(7119, 3089, 1, 3, 9, 19, 19, 119, 1119, 2119, 7119, 38, 39, 'VNAAAA', 'VOEAAA', 'HHHHxx'),
+(4495, 3090, 1, 3, 5, 15, 95, 495, 495, 4495, 4495, 190, 191, 'XQAAAA', 'WOEAAA', 'OOOOxx'),
+(9292, 3091, 0, 0, 2, 12, 92, 292, 1292, 4292, 9292, 184, 185, 'KTAAAA', 'XOEAAA', 'VVVVxx'),
+(1617, 3092, 1, 1, 7, 17, 17, 617, 1617, 1617, 1617, 34, 35, 'FKAAAA', 'YOEAAA', 'AAAAxx'),
+(481, 3093, 1, 1, 1, 1, 81, 481, 481, 481, 481, 162, 163, 'NSAAAA', 'ZOEAAA', 'HHHHxx'),
+(56, 3094, 0, 0, 6, 16, 56, 56, 56, 56, 56, 112, 113, 'ECAAAA', 'APEAAA', 'OOOOxx'),
+(9120, 3095, 0, 0, 0, 0, 20, 120, 1120, 4120, 9120, 40, 41, 'UMAAAA', 'BPEAAA', 'VVVVxx'),
+(1306, 3096, 0, 2, 6, 6, 6, 306, 1306, 1306, 1306, 12, 13, 'GYAAAA', 'CPEAAA', 'AAAAxx'),
+(7773, 3097, 1, 1, 3, 13, 73, 773, 1773, 2773, 7773, 146, 147, 'ZMAAAA', 'DPEAAA', 'HHHHxx'),
+(4863, 3098, 1, 3, 3, 3, 63, 863, 863, 4863, 4863, 126, 127, 'BFAAAA', 'EPEAAA', 'OOOOxx'),
+(1114, 3099, 0, 2, 4, 14, 14, 114, 1114, 1114, 1114, 28, 29, 'WQAAAA', 'FPEAAA', 'VVVVxx'),
+(8124, 3100, 0, 0, 4, 4, 24, 124, 124, 3124, 8124, 48, 49, 'MAAAAA', 'GPEAAA', 'AAAAxx'),
+(6254, 3101, 0, 2, 4, 14, 54, 254, 254, 1254, 6254, 108, 109, 'OGAAAA', 'HPEAAA', 'HHHHxx'),
+(8109, 3102, 1, 1, 9, 9, 9, 109, 109, 3109, 8109, 18, 19, 'XZAAAA', 'IPEAAA', 'OOOOxx'),
+(1747, 3103, 1, 3, 7, 7, 47, 747, 1747, 1747, 1747, 94, 95, 'FPAAAA', 'JPEAAA', 'VVVVxx'),
+(6185, 3104, 1, 1, 5, 5, 85, 185, 185, 1185, 6185, 170, 171, 'XDAAAA', 'KPEAAA', 'AAAAxx'),
+(3388, 3105, 0, 0, 8, 8, 88, 388, 1388, 3388, 3388, 176, 177, 'IAAAAA', 'LPEAAA', 'HHHHxx'),
+(4905, 3106, 1, 1, 5, 5, 5, 905, 905, 4905, 4905, 10, 11, 'RGAAAA', 'MPEAAA', 'OOOOxx'),
+(5728, 3107, 0, 0, 8, 8, 28, 728, 1728, 728, 5728, 56, 57, 'IMAAAA', 'NPEAAA', 'VVVVxx'),
+(7507, 3108, 1, 3, 7, 7, 7, 507, 1507, 2507, 7507, 14, 15, 'TCAAAA', 'OPEAAA', 'AAAAxx'),
+(5662, 3109, 0, 2, 2, 2, 62, 662, 1662, 662, 5662, 124, 125, 'UJAAAA', 'PPEAAA', 'HHHHxx'),
+(1686, 3110, 0, 2, 6, 6, 86, 686, 1686, 1686, 1686, 172, 173, 'WMAAAA', 'QPEAAA', 'OOOOxx'),
+(5202, 3111, 0, 2, 2, 2, 2, 202, 1202, 202, 5202, 4, 5, 'CSAAAA', 'RPEAAA', 'VVVVxx'),
+(6905, 3112, 1, 1, 5, 5, 5, 905, 905, 1905, 6905, 10, 11, 'PFAAAA', 'SPEAAA', 'AAAAxx'),
+(9577, 3113, 1, 1, 7, 17, 77, 577, 1577, 4577, 9577, 154, 155, 'JEAAAA', 'TPEAAA', 'HHHHxx'),
+(7194, 3114, 0, 2, 4, 14, 94, 194, 1194, 2194, 7194, 188, 189, 'SQAAAA', 'UPEAAA', 'OOOOxx'),
+(7016, 3115, 0, 0, 6, 16, 16, 16, 1016, 2016, 7016, 32, 33, 'WJAAAA', 'VPEAAA', 'VVVVxx'),
+(8905, 3116, 1, 1, 5, 5, 5, 905, 905, 3905, 8905, 10, 11, 'NEAAAA', 'WPEAAA', 'AAAAxx'),
+(3419, 3117, 1, 3, 9, 19, 19, 419, 1419, 3419, 3419, 38, 39, 'NBAAAA', 'XPEAAA', 'HHHHxx'),
+(6881, 3118, 1, 1, 1, 1, 81, 881, 881, 1881, 6881, 162, 163, 'REAAAA', 'YPEAAA', 'OOOOxx'),
+(8370, 3119, 0, 2, 0, 10, 70, 370, 370, 3370, 8370, 140, 141, 'YJAAAA', 'ZPEAAA', 'VVVVxx'),
+(6117, 3120, 1, 1, 7, 17, 17, 117, 117, 1117, 6117, 34, 35, 'HBAAAA', 'AQEAAA', 'AAAAxx'),
+(1636, 3121, 0, 0, 6, 16, 36, 636, 1636, 1636, 1636, 72, 73, 'YKAAAA', 'BQEAAA', 'HHHHxx'),
+(6857, 3122, 1, 1, 7, 17, 57, 857, 857, 1857, 6857, 114, 115, 'TDAAAA', 'CQEAAA', 'OOOOxx'),
+(7163, 3123, 1, 3, 3, 3, 63, 163, 1163, 2163, 7163, 126, 127, 'NPAAAA', 'DQEAAA', 'VVVVxx'),
+(5040, 3124, 0, 0, 0, 0, 40, 40, 1040, 40, 5040, 80, 81, 'WLAAAA', 'EQEAAA', 'AAAAxx'),
+(6263, 3125, 1, 3, 3, 3, 63, 263, 263, 1263, 6263, 126, 127, 'XGAAAA', 'FQEAAA', 'HHHHxx'),
+(4809, 3126, 1, 1, 9, 9, 9, 809, 809, 4809, 4809, 18, 19, 'ZCAAAA', 'GQEAAA', 'OOOOxx'),
+(900, 3127, 0, 0, 0, 0, 0, 900, 900, 900, 900, 0, 1, 'QIAAAA', 'HQEAAA', 'VVVVxx'),
+(3199, 3128, 1, 3, 9, 19, 99, 199, 1199, 3199, 3199, 198, 199, 'BTAAAA', 'IQEAAA', 'AAAAxx'),
+(4156, 3129, 0, 0, 6, 16, 56, 156, 156, 4156, 4156, 112, 113, 'WDAAAA', 'JQEAAA', 'HHHHxx'),
+(3501, 3130, 1, 1, 1, 1, 1, 501, 1501, 3501, 3501, 2, 3, 'REAAAA', 'KQEAAA', 'OOOOxx'),
+(164, 3131, 0, 0, 4, 4, 64, 164, 164, 164, 164, 128, 129, 'IGAAAA', 'LQEAAA', 'VVVVxx'),
+(9548, 3132, 0, 0, 8, 8, 48, 548, 1548, 4548, 9548, 96, 97, 'GDAAAA', 'MQEAAA', 'AAAAxx'),
+(1149, 3133, 1, 1, 9, 9, 49, 149, 1149, 1149, 1149, 98, 99, 'FSAAAA', 'NQEAAA', 'HHHHxx'),
+(1962, 3134, 0, 2, 2, 2, 62, 962, 1962, 1962, 1962, 124, 125, 'MXAAAA', 'OQEAAA', 'OOOOxx'),
+(4072, 3135, 0, 0, 2, 12, 72, 72, 72, 4072, 4072, 144, 145, 'QAAAAA', 'PQEAAA', 'VVVVxx'),
+(4280, 3136, 0, 0, 0, 0, 80, 280, 280, 4280, 4280, 160, 161, 'QIAAAA', 'QQEAAA', 'AAAAxx'),
+(1398, 3137, 0, 2, 8, 18, 98, 398, 1398, 1398, 1398, 196, 197, 'UBAAAA', 'RQEAAA', 'HHHHxx'),
+(725, 3138, 1, 1, 5, 5, 25, 725, 725, 725, 725, 50, 51, 'XBAAAA', 'SQEAAA', 'OOOOxx'),
+(3988, 3139, 0, 0, 8, 8, 88, 988, 1988, 3988, 3988, 176, 177, 'KXAAAA', 'TQEAAA', 'VVVVxx'),
+(5059, 3140, 1, 3, 9, 19, 59, 59, 1059, 59, 5059, 118, 119, 'PMAAAA', 'UQEAAA', 'AAAAxx'),
+(2632, 3141, 0, 0, 2, 12, 32, 632, 632, 2632, 2632, 64, 65, 'GXAAAA', 'VQEAAA', 'HHHHxx'),
+(1909, 3142, 1, 1, 9, 9, 9, 909, 1909, 1909, 1909, 18, 19, 'LVAAAA', 'WQEAAA', 'OOOOxx'),
+(6827, 3143, 1, 3, 7, 7, 27, 827, 827, 1827, 6827, 54, 55, 'PCAAAA', 'XQEAAA', 'VVVVxx'),
+(8156, 3144, 0, 0, 6, 16, 56, 156, 156, 3156, 8156, 112, 113, 'SBAAAA', 'YQEAAA', 'AAAAxx'),
+(1192, 3145, 0, 0, 2, 12, 92, 192, 1192, 1192, 1192, 184, 185, 'WTAAAA', 'ZQEAAA', 'HHHHxx'),
+(9545, 3146, 1, 1, 5, 5, 45, 545, 1545, 4545, 9545, 90, 91, 'DDAAAA', 'AREAAA', 'OOOOxx'),
+(2249, 3147, 1, 1, 9, 9, 49, 249, 249, 2249, 2249, 98, 99, 'NIAAAA', 'BREAAA', 'VVVVxx'),
+(5580, 3148, 0, 0, 0, 0, 80, 580, 1580, 580, 5580, 160, 161, 'QGAAAA', 'CREAAA', 'AAAAxx'),
+(8403, 3149, 1, 3, 3, 3, 3, 403, 403, 3403, 8403, 6, 7, 'FLAAAA', 'DREAAA', 'HHHHxx'),
+(4024, 3150, 0, 0, 4, 4, 24, 24, 24, 4024, 4024, 48, 49, 'UYAAAA', 'EREAAA', 'OOOOxx'),
+(1866, 3151, 0, 2, 6, 6, 66, 866, 1866, 1866, 1866, 132, 133, 'UTAAAA', 'FREAAA', 'VVVVxx'),
+(9251, 3152, 1, 3, 1, 11, 51, 251, 1251, 4251, 9251, 102, 103, 'VRAAAA', 'GREAAA', 'AAAAxx'),
+(9979, 3153, 1, 3, 9, 19, 79, 979, 1979, 4979, 9979, 158, 159, 'VTAAAA', 'HREAAA', 'HHHHxx'),
+(9899, 3154, 1, 3, 9, 19, 99, 899, 1899, 4899, 9899, 198, 199, 'TQAAAA', 'IREAAA', 'OOOOxx'),
+(2540, 3155, 0, 0, 0, 0, 40, 540, 540, 2540, 2540, 80, 81, 'STAAAA', 'JREAAA', 'VVVVxx'),
+(8957, 3156, 1, 1, 7, 17, 57, 957, 957, 3957, 8957, 114, 115, 'NGAAAA', 'KREAAA', 'AAAAxx'),
+(7702, 3157, 0, 2, 2, 2, 2, 702, 1702, 2702, 7702, 4, 5, 'GKAAAA', 'LREAAA', 'HHHHxx'),
+(4211, 3158, 1, 3, 1, 11, 11, 211, 211, 4211, 4211, 22, 23, 'ZFAAAA', 'MREAAA', 'OOOOxx'),
+(6684, 3159, 0, 0, 4, 4, 84, 684, 684, 1684, 6684, 168, 169, 'CXAAAA', 'NREAAA', 'VVVVxx'),
+(3883, 3160, 1, 3, 3, 3, 83, 883, 1883, 3883, 3883, 166, 167, 'JTAAAA', 'OREAAA', 'AAAAxx'),
+(3531, 3161, 1, 3, 1, 11, 31, 531, 1531, 3531, 3531, 62, 63, 'VFAAAA', 'PREAAA', 'HHHHxx'),
+(9178, 3162, 0, 2, 8, 18, 78, 178, 1178, 4178, 9178, 156, 157, 'APAAAA', 'QREAAA', 'OOOOxx'),
+(3389, 3163, 1, 1, 9, 9, 89, 389, 1389, 3389, 3389, 178, 179, 'JAAAAA', 'RREAAA', 'VVVVxx'),
+(7874, 3164, 0, 2, 4, 14, 74, 874, 1874, 2874, 7874, 148, 149, 'WQAAAA', 'SREAAA', 'AAAAxx'),
+(4522, 3165, 0, 2, 2, 2, 22, 522, 522, 4522, 4522, 44, 45, 'YRAAAA', 'TREAAA', 'HHHHxx'),
+(9399, 3166, 1, 3, 9, 19, 99, 399, 1399, 4399, 9399, 198, 199, 'NXAAAA', 'UREAAA', 'OOOOxx'),
+(9083, 3167, 1, 3, 3, 3, 83, 83, 1083, 4083, 9083, 166, 167, 'JLAAAA', 'VREAAA', 'VVVVxx'),
+(1530, 3168, 0, 2, 0, 10, 30, 530, 1530, 1530, 1530, 60, 61, 'WGAAAA', 'WREAAA', 'AAAAxx'),
+(2360, 3169, 0, 0, 0, 0, 60, 360, 360, 2360, 2360, 120, 121, 'UMAAAA', 'XREAAA', 'HHHHxx'),
+(4908, 3170, 0, 0, 8, 8, 8, 908, 908, 4908, 4908, 16, 17, 'UGAAAA', 'YREAAA', 'OOOOxx'),
+(4628, 3171, 0, 0, 8, 8, 28, 628, 628, 4628, 4628, 56, 57, 'AWAAAA', 'ZREAAA', 'VVVVxx'),
+(3889, 3172, 1, 1, 9, 9, 89, 889, 1889, 3889, 3889, 178, 179, 'PTAAAA', 'ASEAAA', 'AAAAxx'),
+(1331, 3173, 1, 3, 1, 11, 31, 331, 1331, 1331, 1331, 62, 63, 'FZAAAA', 'BSEAAA', 'HHHHxx'),
+(1942, 3174, 0, 2, 2, 2, 42, 942, 1942, 1942, 1942, 84, 85, 'SWAAAA', 'CSEAAA', 'OOOOxx'),
+(4734, 3175, 0, 2, 4, 14, 34, 734, 734, 4734, 4734, 68, 69, 'CAAAAA', 'DSEAAA', 'VVVVxx'),
+(8386, 3176, 0, 2, 6, 6, 86, 386, 386, 3386, 8386, 172, 173, 'OKAAAA', 'ESEAAA', 'AAAAxx'),
+(3586, 3177, 0, 2, 6, 6, 86, 586, 1586, 3586, 3586, 172, 173, 'YHAAAA', 'FSEAAA', 'HHHHxx'),
+(2354, 3178, 0, 2, 4, 14, 54, 354, 354, 2354, 2354, 108, 109, 'OMAAAA', 'GSEAAA', 'OOOOxx'),
+(7108, 3179, 0, 0, 8, 8, 8, 108, 1108, 2108, 7108, 16, 17, 'KNAAAA', 'HSEAAA', 'VVVVxx'),
+(1857, 3180, 1, 1, 7, 17, 57, 857, 1857, 1857, 1857, 114, 115, 'LTAAAA', 'ISEAAA', 'AAAAxx'),
+(2544, 3181, 0, 0, 4, 4, 44, 544, 544, 2544, 2544, 88, 89, 'WTAAAA', 'JSEAAA', 'HHHHxx'),
+(819, 3182, 1, 3, 9, 19, 19, 819, 819, 819, 819, 38, 39, 'NFAAAA', 'KSEAAA', 'OOOOxx'),
+(2878, 3183, 0, 2, 8, 18, 78, 878, 878, 2878, 2878, 156, 157, 'SGAAAA', 'LSEAAA', 'VVVVxx'),
+(1772, 3184, 0, 0, 2, 12, 72, 772, 1772, 1772, 1772, 144, 145, 'EQAAAA', 'MSEAAA', 'AAAAxx'),
+(354, 3185, 0, 2, 4, 14, 54, 354, 354, 354, 354, 108, 109, 'QNAAAA', 'NSEAAA', 'HHHHxx'),
+(3259, 3186, 1, 3, 9, 19, 59, 259, 1259, 3259, 3259, 118, 119, 'JVAAAA', 'OSEAAA', 'OOOOxx'),
+(2170, 3187, 0, 2, 0, 10, 70, 170, 170, 2170, 2170, 140, 141, 'MFAAAA', 'PSEAAA', 'VVVVxx'),
+(1190, 3188, 0, 2, 0, 10, 90, 190, 1190, 1190, 1190, 180, 181, 'UTAAAA', 'QSEAAA', 'AAAAxx'),
+(3607, 3189, 1, 3, 7, 7, 7, 607, 1607, 3607, 3607, 14, 15, 'TIAAAA', 'RSEAAA', 'HHHHxx'),
+(4661, 3190, 1, 1, 1, 1, 61, 661, 661, 4661, 4661, 122, 123, 'HXAAAA', 'SSEAAA', 'OOOOxx'),
+(1796, 3191, 0, 0, 6, 16, 96, 796, 1796, 1796, 1796, 192, 193, 'CRAAAA', 'TSEAAA', 'VVVVxx'),
+(1561, 3192, 1, 1, 1, 1, 61, 561, 1561, 1561, 1561, 122, 123, 'BIAAAA', 'USEAAA', 'AAAAxx'),
+(4336, 3193, 0, 0, 6, 16, 36, 336, 336, 4336, 4336, 72, 73, 'UKAAAA', 'VSEAAA', 'HHHHxx'),
+(7550, 3194, 0, 2, 0, 10, 50, 550, 1550, 2550, 7550, 100, 101, 'KEAAAA', 'WSEAAA', 'OOOOxx'),
+(3238, 3195, 0, 2, 8, 18, 38, 238, 1238, 3238, 3238, 76, 77, 'OUAAAA', 'XSEAAA', 'VVVVxx'),
+(9870, 3196, 0, 2, 0, 10, 70, 870, 1870, 4870, 9870, 140, 141, 'QPAAAA', 'YSEAAA', 'AAAAxx'),
+(6502, 3197, 0, 2, 2, 2, 2, 502, 502, 1502, 6502, 4, 5, 'CQAAAA', 'ZSEAAA', 'HHHHxx'),
+(3903, 3198, 1, 3, 3, 3, 3, 903, 1903, 3903, 3903, 6, 7, 'DUAAAA', 'ATEAAA', 'OOOOxx'),
+(2869, 3199, 1, 1, 9, 9, 69, 869, 869, 2869, 2869, 138, 139, 'JGAAAA', 'BTEAAA', 'VVVVxx'),
+(5072, 3200, 0, 0, 2, 12, 72, 72, 1072, 72, 5072, 144, 145, 'CNAAAA', 'CTEAAA', 'AAAAxx'),
+(1201, 3201, 1, 1, 1, 1, 1, 201, 1201, 1201, 1201, 2, 3, 'FUAAAA', 'DTEAAA', 'HHHHxx'),
+(6245, 3202, 1, 1, 5, 5, 45, 245, 245, 1245, 6245, 90, 91, 'FGAAAA', 'ETEAAA', 'OOOOxx'),
+(1402, 3203, 0, 2, 2, 2, 2, 402, 1402, 1402, 1402, 4, 5, 'YBAAAA', 'FTEAAA', 'VVVVxx'),
+(2594, 3204, 0, 2, 4, 14, 94, 594, 594, 2594, 2594, 188, 189, 'UVAAAA', 'GTEAAA', 'AAAAxx'),
+(9171, 3205, 1, 3, 1, 11, 71, 171, 1171, 4171, 9171, 142, 143, 'TOAAAA', 'HTEAAA', 'HHHHxx'),
+(2620, 3206, 0, 0, 0, 0, 20, 620, 620, 2620, 2620, 40, 41, 'UWAAAA', 'ITEAAA', 'OOOOxx'),
+(6309, 3207, 1, 1, 9, 9, 9, 309, 309, 1309, 6309, 18, 19, 'RIAAAA', 'JTEAAA', 'VVVVxx'),
+(1285, 3208, 1, 1, 5, 5, 85, 285, 1285, 1285, 1285, 170, 171, 'LXAAAA', 'KTEAAA', 'AAAAxx'),
+(5466, 3209, 0, 2, 6, 6, 66, 466, 1466, 466, 5466, 132, 133, 'GCAAAA', 'LTEAAA', 'HHHHxx'),
+(168, 3210, 0, 0, 8, 8, 68, 168, 168, 168, 168, 136, 137, 'MGAAAA', 'MTEAAA', 'OOOOxx'),
+(1410, 3211, 0, 2, 0, 10, 10, 410, 1410, 1410, 1410, 20, 21, 'GCAAAA', 'NTEAAA', 'VVVVxx'),
+(6332, 3212, 0, 0, 2, 12, 32, 332, 332, 1332, 6332, 64, 65, 'OJAAAA', 'OTEAAA', 'AAAAxx'),
+(9530, 3213, 0, 2, 0, 10, 30, 530, 1530, 4530, 9530, 60, 61, 'OCAAAA', 'PTEAAA', 'HHHHxx'),
+(7749, 3214, 1, 1, 9, 9, 49, 749, 1749, 2749, 7749, 98, 99, 'BMAAAA', 'QTEAAA', 'OOOOxx'),
+(3656, 3215, 0, 0, 6, 16, 56, 656, 1656, 3656, 3656, 112, 113, 'QKAAAA', 'RTEAAA', 'VVVVxx'),
+(37, 3216, 1, 1, 7, 17, 37, 37, 37, 37, 37, 74, 75, 'LBAAAA', 'STEAAA', 'AAAAxx'),
+(2744, 3217, 0, 0, 4, 4, 44, 744, 744, 2744, 2744, 88, 89, 'OBAAAA', 'TTEAAA', 'HHHHxx'),
+(4206, 3218, 0, 2, 6, 6, 6, 206, 206, 4206, 4206, 12, 13, 'UFAAAA', 'UTEAAA', 'OOOOxx'),
+(1846, 3219, 0, 2, 6, 6, 46, 846, 1846, 1846, 1846, 92, 93, 'ATAAAA', 'VTEAAA', 'VVVVxx'),
+(9913, 3220, 1, 1, 3, 13, 13, 913, 1913, 4913, 9913, 26, 27, 'HRAAAA', 'WTEAAA', 'AAAAxx'),
+(4078, 3221, 0, 2, 8, 18, 78, 78, 78, 4078, 4078, 156, 157, 'WAAAAA', 'XTEAAA', 'HHHHxx'),
+(2080, 3222, 0, 0, 0, 0, 80, 80, 80, 2080, 2080, 160, 161, 'ACAAAA', 'YTEAAA', 'OOOOxx'),
+(4169, 3223, 1, 1, 9, 9, 69, 169, 169, 4169, 4169, 138, 139, 'JEAAAA', 'ZTEAAA', 'VVVVxx'),
+(2070, 3224, 0, 2, 0, 10, 70, 70, 70, 2070, 2070, 140, 141, 'QBAAAA', 'AUEAAA', 'AAAAxx'),
+(4500, 3225, 0, 0, 0, 0, 0, 500, 500, 4500, 4500, 0, 1, 'CRAAAA', 'BUEAAA', 'HHHHxx'),
+(4123, 3226, 1, 3, 3, 3, 23, 123, 123, 4123, 4123, 46, 47, 'PCAAAA', 'CUEAAA', 'OOOOxx'),
+(5594, 3227, 0, 2, 4, 14, 94, 594, 1594, 594, 5594, 188, 189, 'EHAAAA', 'DUEAAA', 'VVVVxx'),
+(9941, 3228, 1, 1, 1, 1, 41, 941, 1941, 4941, 9941, 82, 83, 'JSAAAA', 'EUEAAA', 'AAAAxx'),
+(7154, 3229, 0, 2, 4, 14, 54, 154, 1154, 2154, 7154, 108, 109, 'EPAAAA', 'FUEAAA', 'HHHHxx'),
+(8340, 3230, 0, 0, 0, 0, 40, 340, 340, 3340, 8340, 80, 81, 'UIAAAA', 'GUEAAA', 'OOOOxx'),
+(7110, 3231, 0, 2, 0, 10, 10, 110, 1110, 2110, 7110, 20, 21, 'MNAAAA', 'HUEAAA', 'VVVVxx'),
+(7795, 3232, 1, 3, 5, 15, 95, 795, 1795, 2795, 7795, 190, 191, 'VNAAAA', 'IUEAAA', 'AAAAxx'),
+(132, 3233, 0, 0, 2, 12, 32, 132, 132, 132, 132, 64, 65, 'CFAAAA', 'JUEAAA', 'HHHHxx'),
+(4603, 3234, 1, 3, 3, 3, 3, 603, 603, 4603, 4603, 6, 7, 'BVAAAA', 'KUEAAA', 'OOOOxx'),
+(9720, 3235, 0, 0, 0, 0, 20, 720, 1720, 4720, 9720, 40, 41, 'WJAAAA', 'LUEAAA', 'VVVVxx'),
+(1460, 3236, 0, 0, 0, 0, 60, 460, 1460, 1460, 1460, 120, 121, 'EEAAAA', 'MUEAAA', 'AAAAxx'),
+(4677, 3237, 1, 1, 7, 17, 77, 677, 677, 4677, 4677, 154, 155, 'XXAAAA', 'NUEAAA', 'HHHHxx'),
+(9272, 3238, 0, 0, 2, 12, 72, 272, 1272, 4272, 9272, 144, 145, 'QSAAAA', 'OUEAAA', 'OOOOxx'),
+(2279, 3239, 1, 3, 9, 19, 79, 279, 279, 2279, 2279, 158, 159, 'RJAAAA', 'PUEAAA', 'VVVVxx'),
+(4587, 3240, 1, 3, 7, 7, 87, 587, 587, 4587, 4587, 174, 175, 'LUAAAA', 'QUEAAA', 'AAAAxx'),
+(2244, 3241, 0, 0, 4, 4, 44, 244, 244, 2244, 2244, 88, 89, 'IIAAAA', 'RUEAAA', 'HHHHxx'),
+(742, 3242, 0, 2, 2, 2, 42, 742, 742, 742, 742, 84, 85, 'OCAAAA', 'SUEAAA', 'OOOOxx'),
+(4426, 3243, 0, 2, 6, 6, 26, 426, 426, 4426, 4426, 52, 53, 'GOAAAA', 'TUEAAA', 'VVVVxx'),
+(4571, 3244, 1, 3, 1, 11, 71, 571, 571, 4571, 4571, 142, 143, 'VTAAAA', 'UUEAAA', 'AAAAxx'),
+(4775, 3245, 1, 3, 5, 15, 75, 775, 775, 4775, 4775, 150, 151, 'RBAAAA', 'VUEAAA', 'HHHHxx'),
+(24, 3246, 0, 0, 4, 4, 24, 24, 24, 24, 24, 48, 49, 'YAAAAA', 'WUEAAA', 'OOOOxx'),
+(4175, 3247, 1, 3, 5, 15, 75, 175, 175, 4175, 4175, 150, 151, 'PEAAAA', 'XUEAAA', 'VVVVxx'),
+(9877, 3248, 1, 1, 7, 17, 77, 877, 1877, 4877, 9877, 154, 155, 'XPAAAA', 'YUEAAA', 'AAAAxx'),
+(7271, 3249, 1, 3, 1, 11, 71, 271, 1271, 2271, 7271, 142, 143, 'RTAAAA', 'ZUEAAA', 'HHHHxx'),
+(5468, 3250, 0, 0, 8, 8, 68, 468, 1468, 468, 5468, 136, 137, 'ICAAAA', 'AVEAAA', 'OOOOxx'),
+(6106, 3251, 0, 2, 6, 6, 6, 106, 106, 1106, 6106, 12, 13, 'WAAAAA', 'BVEAAA', 'VVVVxx'),
+(9005, 3252, 1, 1, 5, 5, 5, 5, 1005, 4005, 9005, 10, 11, 'JIAAAA', 'CVEAAA', 'AAAAxx'),
+(109, 3253, 1, 1, 9, 9, 9, 109, 109, 109, 109, 18, 19, 'FEAAAA', 'DVEAAA', 'HHHHxx'),
+(6365, 3254, 1, 1, 5, 5, 65, 365, 365, 1365, 6365, 130, 131, 'VKAAAA', 'EVEAAA', 'OOOOxx'),
+(7437, 3255, 1, 1, 7, 17, 37, 437, 1437, 2437, 7437, 74, 75, 'BAAAAA', 'FVEAAA', 'VVVVxx'),
+(7979, 3256, 1, 3, 9, 19, 79, 979, 1979, 2979, 7979, 158, 159, 'XUAAAA', 'GVEAAA', 'AAAAxx'),
+(6050, 3257, 0, 2, 0, 10, 50, 50, 50, 1050, 6050, 100, 101, 'SYAAAA', 'HVEAAA', 'HHHHxx'),
+(2853, 3258, 1, 1, 3, 13, 53, 853, 853, 2853, 2853, 106, 107, 'TFAAAA', 'IVEAAA', 'OOOOxx'),
+(7603, 3259, 1, 3, 3, 3, 3, 603, 1603, 2603, 7603, 6, 7, 'LGAAAA', 'JVEAAA', 'VVVVxx'),
+(483, 3260, 1, 3, 3, 3, 83, 483, 483, 483, 483, 166, 167, 'PSAAAA', 'KVEAAA', 'AAAAxx'),
+(5994, 3261, 0, 2, 4, 14, 94, 994, 1994, 994, 5994, 188, 189, 'OWAAAA', 'LVEAAA', 'HHHHxx'),
+(6708, 3262, 0, 0, 8, 8, 8, 708, 708, 1708, 6708, 16, 17, 'AYAAAA', 'MVEAAA', 'OOOOxx'),
+(5090, 3263, 0, 2, 0, 10, 90, 90, 1090, 90, 5090, 180, 181, 'UNAAAA', 'NVEAAA', 'VVVVxx'),
+(4608, 3264, 0, 0, 8, 8, 8, 608, 608, 4608, 4608, 16, 17, 'GVAAAA', 'OVEAAA', 'AAAAxx'),
+(4551, 3265, 1, 3, 1, 11, 51, 551, 551, 4551, 4551, 102, 103, 'BTAAAA', 'PVEAAA', 'HHHHxx'),
+(5437, 3266, 1, 1, 7, 17, 37, 437, 1437, 437, 5437, 74, 75, 'DBAAAA', 'QVEAAA', 'OOOOxx'),
+(4130, 3267, 0, 2, 0, 10, 30, 130, 130, 4130, 4130, 60, 61, 'WCAAAA', 'RVEAAA', 'VVVVxx'),
+(6363, 3268, 1, 3, 3, 3, 63, 363, 363, 1363, 6363, 126, 127, 'TKAAAA', 'SVEAAA', 'AAAAxx'),
+(1499, 3269, 1, 3, 9, 19, 99, 499, 1499, 1499, 1499, 198, 199, 'RFAAAA', 'TVEAAA', 'HHHHxx'),
+(384, 3270, 0, 0, 4, 4, 84, 384, 384, 384, 384, 168, 169, 'UOAAAA', 'UVEAAA', 'OOOOxx'),
+(2266, 3271, 0, 2, 6, 6, 66, 266, 266, 2266, 2266, 132, 133, 'EJAAAA', 'VVEAAA', 'VVVVxx'),
+(6018, 3272, 0, 2, 8, 18, 18, 18, 18, 1018, 6018, 36, 37, 'MXAAAA', 'WVEAAA', 'AAAAxx'),
+(7915, 3273, 1, 3, 5, 15, 15, 915, 1915, 2915, 7915, 30, 31, 'LSAAAA', 'XVEAAA', 'HHHHxx'),
+(6167, 3274, 1, 3, 7, 7, 67, 167, 167, 1167, 6167, 134, 135, 'FDAAAA', 'YVEAAA', 'OOOOxx'),
+(9988, 3275, 0, 0, 8, 8, 88, 988, 1988, 4988, 9988, 176, 177, 'EUAAAA', 'ZVEAAA', 'VVVVxx'),
+(6599, 3276, 1, 3, 9, 19, 99, 599, 599, 1599, 6599, 198, 199, 'VTAAAA', 'AWEAAA', 'AAAAxx'),
+(1693, 3277, 1, 1, 3, 13, 93, 693, 1693, 1693, 1693, 186, 187, 'DNAAAA', 'BWEAAA', 'HHHHxx'),
+(5971, 3278, 1, 3, 1, 11, 71, 971, 1971, 971, 5971, 142, 143, 'RVAAAA', 'CWEAAA', 'OOOOxx'),
+(8470, 3279, 0, 2, 0, 10, 70, 470, 470, 3470, 8470, 140, 141, 'UNAAAA', 'DWEAAA', 'VVVVxx'),
+(2807, 3280, 1, 3, 7, 7, 7, 807, 807, 2807, 2807, 14, 15, 'ZDAAAA', 'EWEAAA', 'AAAAxx'),
+(1120, 3281, 0, 0, 0, 0, 20, 120, 1120, 1120, 1120, 40, 41, 'CRAAAA', 'FWEAAA', 'HHHHxx'),
+(5924, 3282, 0, 0, 4, 4, 24, 924, 1924, 924, 5924, 48, 49, 'WTAAAA', 'GWEAAA', 'OOOOxx'),
+(9025, 3283, 1, 1, 5, 5, 25, 25, 1025, 4025, 9025, 50, 51, 'DJAAAA', 'HWEAAA', 'VVVVxx'),
+(9454, 3284, 0, 2, 4, 14, 54, 454, 1454, 4454, 9454, 108, 109, 'QZAAAA', 'IWEAAA', 'AAAAxx'),
+(2259, 3285, 1, 3, 9, 19, 59, 259, 259, 2259, 2259, 118, 119, 'XIAAAA', 'JWEAAA', 'HHHHxx'),
+(5249, 3286, 1, 1, 9, 9, 49, 249, 1249, 249, 5249, 98, 99, 'XTAAAA', 'KWEAAA', 'OOOOxx'),
+(6350, 3287, 0, 2, 0, 10, 50, 350, 350, 1350, 6350, 100, 101, 'GKAAAA', 'LWEAAA', 'VVVVxx'),
+(2930, 3288, 0, 2, 0, 10, 30, 930, 930, 2930, 2930, 60, 61, 'SIAAAA', 'MWEAAA', 'AAAAxx'),
+(6055, 3289, 1, 3, 5, 15, 55, 55, 55, 1055, 6055, 110, 111, 'XYAAAA', 'NWEAAA', 'HHHHxx'),
+(7691, 3290, 1, 3, 1, 11, 91, 691, 1691, 2691, 7691, 182, 183, 'VJAAAA', 'OWEAAA', 'OOOOxx'),
+(1573, 3291, 1, 1, 3, 13, 73, 573, 1573, 1573, 1573, 146, 147, 'NIAAAA', 'PWEAAA', 'VVVVxx'),
+(9943, 3292, 1, 3, 3, 3, 43, 943, 1943, 4943, 9943, 86, 87, 'LSAAAA', 'QWEAAA', 'AAAAxx'),
+(3085, 3293, 1, 1, 5, 5, 85, 85, 1085, 3085, 3085, 170, 171, 'ROAAAA', 'RWEAAA', 'HHHHxx'),
+(5928, 3294, 0, 0, 8, 8, 28, 928, 1928, 928, 5928, 56, 57, 'AUAAAA', 'SWEAAA', 'OOOOxx'),
+(887, 3295, 1, 3, 7, 7, 87, 887, 887, 887, 887, 174, 175, 'DIAAAA', 'TWEAAA', 'VVVVxx'),
+(4630, 3296, 0, 2, 0, 10, 30, 630, 630, 4630, 4630, 60, 61, 'CWAAAA', 'UWEAAA', 'AAAAxx'),
+(9827, 3297, 1, 3, 7, 7, 27, 827, 1827, 4827, 9827, 54, 55, 'ZNAAAA', 'VWEAAA', 'HHHHxx'),
+(8926, 3298, 0, 2, 6, 6, 26, 926, 926, 3926, 8926, 52, 53, 'IFAAAA', 'WWEAAA', 'OOOOxx'),
+(5726, 3299, 0, 2, 6, 6, 26, 726, 1726, 726, 5726, 52, 53, 'GMAAAA', 'XWEAAA', 'VVVVxx'),
+(1569, 3300, 1, 1, 9, 9, 69, 569, 1569, 1569, 1569, 138, 139, 'JIAAAA', 'YWEAAA', 'AAAAxx'),
+(8074, 3301, 0, 2, 4, 14, 74, 74, 74, 3074, 8074, 148, 149, 'OYAAAA', 'ZWEAAA', 'HHHHxx'),
+(7909, 3302, 1, 1, 9, 9, 9, 909, 1909, 2909, 7909, 18, 19, 'FSAAAA', 'AXEAAA', 'OOOOxx'),
+(8367, 3303, 1, 3, 7, 7, 67, 367, 367, 3367, 8367, 134, 135, 'VJAAAA', 'BXEAAA', 'VVVVxx'),
+(7217, 3304, 1, 1, 7, 17, 17, 217, 1217, 2217, 7217, 34, 35, 'PRAAAA', 'CXEAAA', 'AAAAxx'),
+(5254, 3305, 0, 2, 4, 14, 54, 254, 1254, 254, 5254, 108, 109, 'CUAAAA', 'DXEAAA', 'HHHHxx'),
+(1181, 3306, 1, 1, 1, 1, 81, 181, 1181, 1181, 1181, 162, 163, 'LTAAAA', 'EXEAAA', 'OOOOxx'),
+(6907, 3307, 1, 3, 7, 7, 7, 907, 907, 1907, 6907, 14, 15, 'RFAAAA', 'FXEAAA', 'VVVVxx'),
+(5508, 3308, 0, 0, 8, 8, 8, 508, 1508, 508, 5508, 16, 17, 'WDAAAA', 'GXEAAA', 'AAAAxx'),
+(4782, 3309, 0, 2, 2, 2, 82, 782, 782, 4782, 4782, 164, 165, 'YBAAAA', 'HXEAAA', 'HHHHxx'),
+(793, 3310, 1, 1, 3, 13, 93, 793, 793, 793, 793, 186, 187, 'NEAAAA', 'IXEAAA', 'OOOOxx'),
+(5740, 3311, 0, 0, 0, 0, 40, 740, 1740, 740, 5740, 80, 81, 'UMAAAA', 'JXEAAA', 'VVVVxx'),
+(3107, 3312, 1, 3, 7, 7, 7, 107, 1107, 3107, 3107, 14, 15, 'NPAAAA', 'KXEAAA', 'AAAAxx'),
+(1197, 3313, 1, 1, 7, 17, 97, 197, 1197, 1197, 1197, 194, 195, 'BUAAAA', 'LXEAAA', 'HHHHxx'),
+(4376, 3314, 0, 0, 6, 16, 76, 376, 376, 4376, 4376, 152, 153, 'IMAAAA', 'MXEAAA', 'OOOOxx'),
+(6226, 3315, 0, 2, 6, 6, 26, 226, 226, 1226, 6226, 52, 53, 'MFAAAA', 'NXEAAA', 'VVVVxx'),
+(5033, 3316, 1, 1, 3, 13, 33, 33, 1033, 33, 5033, 66, 67, 'PLAAAA', 'OXEAAA', 'AAAAxx'),
+(5494, 3317, 0, 2, 4, 14, 94, 494, 1494, 494, 5494, 188, 189, 'IDAAAA', 'PXEAAA', 'HHHHxx'),
+(3244, 3318, 0, 0, 4, 4, 44, 244, 1244, 3244, 3244, 88, 89, 'UUAAAA', 'QXEAAA', 'OOOOxx'),
+(7670, 3319, 0, 2, 0, 10, 70, 670, 1670, 2670, 7670, 140, 141, 'AJAAAA', 'RXEAAA', 'VVVVxx'),
+(9273, 3320, 1, 1, 3, 13, 73, 273, 1273, 4273, 9273, 146, 147, 'RSAAAA', 'SXEAAA', 'AAAAxx'),
+(5248, 3321, 0, 0, 8, 8, 48, 248, 1248, 248, 5248, 96, 97, 'WTAAAA', 'TXEAAA', 'HHHHxx'),
+(3381, 3322, 1, 1, 1, 1, 81, 381, 1381, 3381, 3381, 162, 163, 'BAAAAA', 'UXEAAA', 'OOOOxx'),
+(4136, 3323, 0, 0, 6, 16, 36, 136, 136, 4136, 4136, 72, 73, 'CDAAAA', 'VXEAAA', 'VVVVxx'),
+(4163, 3324, 1, 3, 3, 3, 63, 163, 163, 4163, 4163, 126, 127, 'DEAAAA', 'WXEAAA', 'AAAAxx'),
+(4270, 3325, 0, 2, 0, 10, 70, 270, 270, 4270, 4270, 140, 141, 'GIAAAA', 'XXEAAA', 'HHHHxx'),
+(1729, 3326, 1, 1, 9, 9, 29, 729, 1729, 1729, 1729, 58, 59, 'NOAAAA', 'YXEAAA', 'OOOOxx'),
+(2778, 3327, 0, 2, 8, 18, 78, 778, 778, 2778, 2778, 156, 157, 'WCAAAA', 'ZXEAAA', 'VVVVxx'),
+(5082, 3328, 0, 2, 2, 2, 82, 82, 1082, 82, 5082, 164, 165, 'MNAAAA', 'AYEAAA', 'AAAAxx'),
+(870, 3329, 0, 2, 0, 10, 70, 870, 870, 870, 870, 140, 141, 'MHAAAA', 'BYEAAA', 'HHHHxx'),
+(4192, 3330, 0, 0, 2, 12, 92, 192, 192, 4192, 4192, 184, 185, 'GFAAAA', 'CYEAAA', 'OOOOxx'),
+(308, 3331, 0, 0, 8, 8, 8, 308, 308, 308, 308, 16, 17, 'WLAAAA', 'DYEAAA', 'VVVVxx'),
+(6783, 3332, 1, 3, 3, 3, 83, 783, 783, 1783, 6783, 166, 167, 'XAAAAA', 'EYEAAA', 'AAAAxx'),
+(7611, 3333, 1, 3, 1, 11, 11, 611, 1611, 2611, 7611, 22, 23, 'TGAAAA', 'FYEAAA', 'HHHHxx'),
+(4221, 3334, 1, 1, 1, 1, 21, 221, 221, 4221, 4221, 42, 43, 'JGAAAA', 'GYEAAA', 'OOOOxx'),
+(6353, 3335, 1, 1, 3, 13, 53, 353, 353, 1353, 6353, 106, 107, 'JKAAAA', 'HYEAAA', 'VVVVxx'),
+(1830, 3336, 0, 2, 0, 10, 30, 830, 1830, 1830, 1830, 60, 61, 'KSAAAA', 'IYEAAA', 'AAAAxx'),
+(2437, 3337, 1, 1, 7, 17, 37, 437, 437, 2437, 2437, 74, 75, 'TPAAAA', 'JYEAAA', 'HHHHxx'),
+(3360, 3338, 0, 0, 0, 0, 60, 360, 1360, 3360, 3360, 120, 121, 'GZAAAA', 'KYEAAA', 'OOOOxx'),
+(1829, 3339, 1, 1, 9, 9, 29, 829, 1829, 1829, 1829, 58, 59, 'JSAAAA', 'LYEAAA', 'VVVVxx'),
+(9475, 3340, 1, 3, 5, 15, 75, 475, 1475, 4475, 9475, 150, 151, 'LAAAAA', 'MYEAAA', 'AAAAxx'),
+(4566, 3341, 0, 2, 6, 6, 66, 566, 566, 4566, 4566, 132, 133, 'QTAAAA', 'NYEAAA', 'HHHHxx'),
+(9944, 3342, 0, 0, 4, 4, 44, 944, 1944, 4944, 9944, 88, 89, 'MSAAAA', 'OYEAAA', 'OOOOxx'),
+(6054, 3343, 0, 2, 4, 14, 54, 54, 54, 1054, 6054, 108, 109, 'WYAAAA', 'PYEAAA', 'VVVVxx'),
+(4722, 3344, 0, 2, 2, 2, 22, 722, 722, 4722, 4722, 44, 45, 'QZAAAA', 'QYEAAA', 'AAAAxx'),
+(2779, 3345, 1, 3, 9, 19, 79, 779, 779, 2779, 2779, 158, 159, 'XCAAAA', 'RYEAAA', 'HHHHxx'),
+(8051, 3346, 1, 3, 1, 11, 51, 51, 51, 3051, 8051, 102, 103, 'RXAAAA', 'SYEAAA', 'OOOOxx'),
+(9671, 3347, 1, 3, 1, 11, 71, 671, 1671, 4671, 9671, 142, 143, 'ZHAAAA', 'TYEAAA', 'VVVVxx'),
+(6084, 3348, 0, 0, 4, 4, 84, 84, 84, 1084, 6084, 168, 169, 'AAAAAA', 'UYEAAA', 'AAAAxx'),
+(3729, 3349, 1, 1, 9, 9, 29, 729, 1729, 3729, 3729, 58, 59, 'LNAAAA', 'VYEAAA', 'HHHHxx'),
+(6627, 3350, 1, 3, 7, 7, 27, 627, 627, 1627, 6627, 54, 55, 'XUAAAA', 'WYEAAA', 'OOOOxx'),
+(4769, 3351, 1, 1, 9, 9, 69, 769, 769, 4769, 4769, 138, 139, 'LBAAAA', 'XYEAAA', 'VVVVxx'),
+(2224, 3352, 0, 0, 4, 4, 24, 224, 224, 2224, 2224, 48, 49, 'OHAAAA', 'YYEAAA', 'AAAAxx'),
+(1404, 3353, 0, 0, 4, 4, 4, 404, 1404, 1404, 1404, 8, 9, 'ACAAAA', 'ZYEAAA', 'HHHHxx'),
+(8532, 3354, 0, 0, 2, 12, 32, 532, 532, 3532, 8532, 64, 65, 'EQAAAA', 'AZEAAA', 'OOOOxx'),
+(6759, 3355, 1, 3, 9, 19, 59, 759, 759, 1759, 6759, 118, 119, 'ZZAAAA', 'BZEAAA', 'VVVVxx'),
+(6404, 3356, 0, 0, 4, 4, 4, 404, 404, 1404, 6404, 8, 9, 'IMAAAA', 'CZEAAA', 'AAAAxx'),
+(3144, 3357, 0, 0, 4, 4, 44, 144, 1144, 3144, 3144, 88, 89, 'YQAAAA', 'DZEAAA', 'HHHHxx'),
+(973, 3358, 1, 1, 3, 13, 73, 973, 973, 973, 973, 146, 147, 'LLAAAA', 'EZEAAA', 'OOOOxx'),
+(9789, 3359, 1, 1, 9, 9, 89, 789, 1789, 4789, 9789, 178, 179, 'NMAAAA', 'FZEAAA', 'VVVVxx'),
+(6181, 3360, 1, 1, 1, 1, 81, 181, 181, 1181, 6181, 162, 163, 'TDAAAA', 'GZEAAA', 'AAAAxx'),
+(1519, 3361, 1, 3, 9, 19, 19, 519, 1519, 1519, 1519, 38, 39, 'LGAAAA', 'HZEAAA', 'HHHHxx'),
+(9729, 3362, 1, 1, 9, 9, 29, 729, 1729, 4729, 9729, 58, 59, 'FKAAAA', 'IZEAAA', 'OOOOxx'),
+(8167, 3363, 1, 3, 7, 7, 67, 167, 167, 3167, 8167, 134, 135, 'DCAAAA', 'JZEAAA', 'VVVVxx'),
+(3830, 3364, 0, 2, 0, 10, 30, 830, 1830, 3830, 3830, 60, 61, 'IRAAAA', 'KZEAAA', 'AAAAxx'),
+(6286, 3365, 0, 2, 6, 6, 86, 286, 286, 1286, 6286, 172, 173, 'UHAAAA', 'LZEAAA', 'HHHHxx'),
+(3047, 3366, 1, 3, 7, 7, 47, 47, 1047, 3047, 3047, 94, 95, 'FNAAAA', 'MZEAAA', 'OOOOxx'),
+(3183, 3367, 1, 3, 3, 3, 83, 183, 1183, 3183, 3183, 166, 167, 'LSAAAA', 'NZEAAA', 'VVVVxx'),
+(6687, 3368, 1, 3, 7, 7, 87, 687, 687, 1687, 6687, 174, 175, 'FXAAAA', 'OZEAAA', 'AAAAxx'),
+(2783, 3369, 1, 3, 3, 3, 83, 783, 783, 2783, 2783, 166, 167, 'BDAAAA', 'PZEAAA', 'HHHHxx'),
+(9920, 3370, 0, 0, 0, 0, 20, 920, 1920, 4920, 9920, 40, 41, 'ORAAAA', 'QZEAAA', 'OOOOxx'),
+(4847, 3371, 1, 3, 7, 7, 47, 847, 847, 4847, 4847, 94, 95, 'LEAAAA', 'RZEAAA', 'VVVVxx'),
+(3645, 3372, 1, 1, 5, 5, 45, 645, 1645, 3645, 3645, 90, 91, 'FKAAAA', 'SZEAAA', 'AAAAxx'),
+(7406, 3373, 0, 2, 6, 6, 6, 406, 1406, 2406, 7406, 12, 13, 'WYAAAA', 'TZEAAA', 'HHHHxx'),
+(6003, 3374, 1, 3, 3, 3, 3, 3, 3, 1003, 6003, 6, 7, 'XWAAAA', 'UZEAAA', 'OOOOxx'),
+(3408, 3375, 0, 0, 8, 8, 8, 408, 1408, 3408, 3408, 16, 17, 'CBAAAA', 'VZEAAA', 'VVVVxx'),
+(4243, 3376, 1, 3, 3, 3, 43, 243, 243, 4243, 4243, 86, 87, 'FHAAAA', 'WZEAAA', 'AAAAxx'),
+(1622, 3377, 0, 2, 2, 2, 22, 622, 1622, 1622, 1622, 44, 45, 'KKAAAA', 'XZEAAA', 'HHHHxx'),
+(5319, 3378, 1, 3, 9, 19, 19, 319, 1319, 319, 5319, 38, 39, 'PWAAAA', 'YZEAAA', 'OOOOxx'),
+(4033, 3379, 1, 1, 3, 13, 33, 33, 33, 4033, 4033, 66, 67, 'DZAAAA', 'ZZEAAA', 'VVVVxx'),
+(8573, 3380, 1, 1, 3, 13, 73, 573, 573, 3573, 8573, 146, 147, 'TRAAAA', 'AAFAAA', 'AAAAxx'),
+(8404, 3381, 0, 0, 4, 4, 4, 404, 404, 3404, 8404, 8, 9, 'GLAAAA', 'BAFAAA', 'HHHHxx'),
+(6993, 3382, 1, 1, 3, 13, 93, 993, 993, 1993, 6993, 186, 187, 'ZIAAAA', 'CAFAAA', 'OOOOxx'),
+(660, 3383, 0, 0, 0, 0, 60, 660, 660, 660, 660, 120, 121, 'KZAAAA', 'DAFAAA', 'VVVVxx'),
+(1136, 3384, 0, 0, 6, 16, 36, 136, 1136, 1136, 1136, 72, 73, 'SRAAAA', 'EAFAAA', 'AAAAxx'),
+(3393, 3385, 1, 1, 3, 13, 93, 393, 1393, 3393, 3393, 186, 187, 'NAAAAA', 'FAFAAA', 'HHHHxx'),
+(9743, 3386, 1, 3, 3, 3, 43, 743, 1743, 4743, 9743, 86, 87, 'TKAAAA', 'GAFAAA', 'OOOOxx'),
+(9705, 3387, 1, 1, 5, 5, 5, 705, 1705, 4705, 9705, 10, 11, 'HJAAAA', 'HAFAAA', 'VVVVxx'),
+(6960, 3388, 0, 0, 0, 0, 60, 960, 960, 1960, 6960, 120, 121, 'SHAAAA', 'IAFAAA', 'AAAAxx'),
+(2753, 3389, 1, 1, 3, 13, 53, 753, 753, 2753, 2753, 106, 107, 'XBAAAA', 'JAFAAA', 'HHHHxx'),
+(906, 3390, 0, 2, 6, 6, 6, 906, 906, 906, 906, 12, 13, 'WIAAAA', 'KAFAAA', 'OOOOxx'),
+(999, 3391, 1, 3, 9, 19, 99, 999, 999, 999, 999, 198, 199, 'LMAAAA', 'LAFAAA', 'VVVVxx'),
+(6927, 3392, 1, 3, 7, 7, 27, 927, 927, 1927, 6927, 54, 55, 'LGAAAA', 'MAFAAA', 'AAAAxx'),
+(4846, 3393, 0, 2, 6, 6, 46, 846, 846, 4846, 4846, 92, 93, 'KEAAAA', 'NAFAAA', 'HHHHxx'),
+(676, 3394, 0, 0, 6, 16, 76, 676, 676, 676, 676, 152, 153, 'AAAAAA', 'OAFAAA', 'OOOOxx'),
+(8612, 3395, 0, 0, 2, 12, 12, 612, 612, 3612, 8612, 24, 25, 'GTAAAA', 'PAFAAA', 'VVVVxx'),
+(4111, 3396, 1, 3, 1, 11, 11, 111, 111, 4111, 4111, 22, 23, 'DCAAAA', 'QAFAAA', 'AAAAxx'),
+(9994, 3397, 0, 2, 4, 14, 94, 994, 1994, 4994, 9994, 188, 189, 'KUAAAA', 'RAFAAA', 'HHHHxx'),
+(4399, 3398, 1, 3, 9, 19, 99, 399, 399, 4399, 4399, 198, 199, 'FNAAAA', 'SAFAAA', 'OOOOxx'),
+(4464, 3399, 0, 0, 4, 4, 64, 464, 464, 4464, 4464, 128, 129, 'SPAAAA', 'TAFAAA', 'VVVVxx'),
+(7316, 3400, 0, 0, 6, 16, 16, 316, 1316, 2316, 7316, 32, 33, 'KVAAAA', 'UAFAAA', 'AAAAxx'),
+(8982, 3401, 0, 2, 2, 2, 82, 982, 982, 3982, 8982, 164, 165, 'MHAAAA', 'VAFAAA', 'HHHHxx'),
+(1871, 3402, 1, 3, 1, 11, 71, 871, 1871, 1871, 1871, 142, 143, 'ZTAAAA', 'WAFAAA', 'OOOOxx'),
+(4082, 3403, 0, 2, 2, 2, 82, 82, 82, 4082, 4082, 164, 165, 'ABAAAA', 'XAFAAA', 'VVVVxx'),
+(3949, 3404, 1, 1, 9, 9, 49, 949, 1949, 3949, 3949, 98, 99, 'XVAAAA', 'YAFAAA', 'AAAAxx'),
+(9352, 3405, 0, 0, 2, 12, 52, 352, 1352, 4352, 9352, 104, 105, 'SVAAAA', 'ZAFAAA', 'HHHHxx'),
+(9638, 3406, 0, 2, 8, 18, 38, 638, 1638, 4638, 9638, 76, 77, 'SGAAAA', 'ABFAAA', 'OOOOxx'),
+(8177, 3407, 1, 1, 7, 17, 77, 177, 177, 3177, 8177, 154, 155, 'NCAAAA', 'BBFAAA', 'VVVVxx'),
+(3499, 3408, 1, 3, 9, 19, 99, 499, 1499, 3499, 3499, 198, 199, 'PEAAAA', 'CBFAAA', 'AAAAxx'),
+(4233, 3409, 1, 1, 3, 13, 33, 233, 233, 4233, 4233, 66, 67, 'VGAAAA', 'DBFAAA', 'HHHHxx'),
+(1953, 3410, 1, 1, 3, 13, 53, 953, 1953, 1953, 1953, 106, 107, 'DXAAAA', 'EBFAAA', 'OOOOxx'),
+(7372, 3411, 0, 0, 2, 12, 72, 372, 1372, 2372, 7372, 144, 145, 'OXAAAA', 'FBFAAA', 'VVVVxx'),
+(5127, 3412, 1, 3, 7, 7, 27, 127, 1127, 127, 5127, 54, 55, 'FPAAAA', 'GBFAAA', 'AAAAxx'),
+(4384, 3413, 0, 0, 4, 4, 84, 384, 384, 4384, 4384, 168, 169, 'QMAAAA', 'HBFAAA', 'HHHHxx'),
+(9964, 3414, 0, 0, 4, 4, 64, 964, 1964, 4964, 9964, 128, 129, 'GTAAAA', 'IBFAAA', 'OOOOxx'),
+(5392, 3415, 0, 0, 2, 12, 92, 392, 1392, 392, 5392, 184, 185, 'KZAAAA', 'JBFAAA', 'VVVVxx'),
+(616, 3416, 0, 0, 6, 16, 16, 616, 616, 616, 616, 32, 33, 'SXAAAA', 'KBFAAA', 'AAAAxx'),
+(591, 3417, 1, 3, 1, 11, 91, 591, 591, 591, 591, 182, 183, 'TWAAAA', 'LBFAAA', 'HHHHxx'),
+(6422, 3418, 0, 2, 2, 2, 22, 422, 422, 1422, 6422, 44, 45, 'ANAAAA', 'MBFAAA', 'OOOOxx'),
+(6551, 3419, 1, 3, 1, 11, 51, 551, 551, 1551, 6551, 102, 103, 'ZRAAAA', 'NBFAAA', 'VVVVxx'),
+(9286, 3420, 0, 2, 6, 6, 86, 286, 1286, 4286, 9286, 172, 173, 'ETAAAA', 'OBFAAA', 'AAAAxx'),
+(3817, 3421, 1, 1, 7, 17, 17, 817, 1817, 3817, 3817, 34, 35, 'VQAAAA', 'PBFAAA', 'HHHHxx'),
+(7717, 3422, 1, 1, 7, 17, 17, 717, 1717, 2717, 7717, 34, 35, 'VKAAAA', 'QBFAAA', 'OOOOxx'),
+(8718, 3423, 0, 2, 8, 18, 18, 718, 718, 3718, 8718, 36, 37, 'IXAAAA', 'RBFAAA', 'VVVVxx'),
+(8608, 3424, 0, 0, 8, 8, 8, 608, 608, 3608, 8608, 16, 17, 'CTAAAA', 'SBFAAA', 'AAAAxx'),
+(2242, 3425, 0, 2, 2, 2, 42, 242, 242, 2242, 2242, 84, 85, 'GIAAAA', 'TBFAAA', 'HHHHxx'),
+(4811, 3426, 1, 3, 1, 11, 11, 811, 811, 4811, 4811, 22, 23, 'BDAAAA', 'UBFAAA', 'OOOOxx'),
+(6838, 3427, 0, 2, 8, 18, 38, 838, 838, 1838, 6838, 76, 77, 'ADAAAA', 'VBFAAA', 'VVVVxx'),
+(787, 3428, 1, 3, 7, 7, 87, 787, 787, 787, 787, 174, 175, 'HEAAAA', 'WBFAAA', 'AAAAxx'),
+(7940, 3429, 0, 0, 0, 0, 40, 940, 1940, 2940, 7940, 80, 81, 'KTAAAA', 'XBFAAA', 'HHHHxx'),
+(336, 3430, 0, 0, 6, 16, 36, 336, 336, 336, 336, 72, 73, 'YMAAAA', 'YBFAAA', 'OOOOxx'),
+(9859, 3431, 1, 3, 9, 19, 59, 859, 1859, 4859, 9859, 118, 119, 'FPAAAA', 'ZBFAAA', 'VVVVxx'),
+(3864, 3432, 0, 0, 4, 4, 64, 864, 1864, 3864, 3864, 128, 129, 'QSAAAA', 'ACFAAA', 'AAAAxx'),
+(7162, 3433, 0, 2, 2, 2, 62, 162, 1162, 2162, 7162, 124, 125, 'MPAAAA', 'BCFAAA', 'HHHHxx'),
+(2071, 3434, 1, 3, 1, 11, 71, 71, 71, 2071, 2071, 142, 143, 'RBAAAA', 'CCFAAA', 'OOOOxx'),
+(7469, 3435, 1, 1, 9, 9, 69, 469, 1469, 2469, 7469, 138, 139, 'HBAAAA', 'DCFAAA', 'VVVVxx'),
+(2917, 3436, 1, 1, 7, 17, 17, 917, 917, 2917, 2917, 34, 35, 'FIAAAA', 'ECFAAA', 'AAAAxx'),
+(7486, 3437, 0, 2, 6, 6, 86, 486, 1486, 2486, 7486, 172, 173, 'YBAAAA', 'FCFAAA', 'HHHHxx'),
+(3355, 3438, 1, 3, 5, 15, 55, 355, 1355, 3355, 3355, 110, 111, 'BZAAAA', 'GCFAAA', 'OOOOxx'),
+(6998, 3439, 0, 2, 8, 18, 98, 998, 998, 1998, 6998, 196, 197, 'EJAAAA', 'HCFAAA', 'VVVVxx'),
+(5498, 3440, 0, 2, 8, 18, 98, 498, 1498, 498, 5498, 196, 197, 'MDAAAA', 'ICFAAA', 'AAAAxx'),
+(5113, 3441, 1, 1, 3, 13, 13, 113, 1113, 113, 5113, 26, 27, 'ROAAAA', 'JCFAAA', 'HHHHxx'),
+(2846, 3442, 0, 2, 6, 6, 46, 846, 846, 2846, 2846, 92, 93, 'MFAAAA', 'KCFAAA', 'OOOOxx'),
+(6834, 3443, 0, 2, 4, 14, 34, 834, 834, 1834, 6834, 68, 69, 'WCAAAA', 'LCFAAA', 'VVVVxx'),
+(8925, 3444, 1, 1, 5, 5, 25, 925, 925, 3925, 8925, 50, 51, 'HFAAAA', 'MCFAAA', 'AAAAxx'),
+(2757, 3445, 1, 1, 7, 17, 57, 757, 757, 2757, 2757, 114, 115, 'BCAAAA', 'NCFAAA', 'HHHHxx'),
+(2775, 3446, 1, 3, 5, 15, 75, 775, 775, 2775, 2775, 150, 151, 'TCAAAA', 'OCFAAA', 'OOOOxx'),
+(6182, 3447, 0, 2, 2, 2, 82, 182, 182, 1182, 6182, 164, 165, 'UDAAAA', 'PCFAAA', 'VVVVxx'),
+(4488, 3448, 0, 0, 8, 8, 88, 488, 488, 4488, 4488, 176, 177, 'QQAAAA', 'QCFAAA', 'AAAAxx'),
+(8523, 3449, 1, 3, 3, 3, 23, 523, 523, 3523, 8523, 46, 47, 'VPAAAA', 'RCFAAA', 'HHHHxx'),
+(52, 3450, 0, 0, 2, 12, 52, 52, 52, 52, 52, 104, 105, 'ACAAAA', 'SCFAAA', 'OOOOxx'),
+(7251, 3451, 1, 3, 1, 11, 51, 251, 1251, 2251, 7251, 102, 103, 'XSAAAA', 'TCFAAA', 'VVVVxx'),
+(6130, 3452, 0, 2, 0, 10, 30, 130, 130, 1130, 6130, 60, 61, 'UBAAAA', 'UCFAAA', 'AAAAxx'),
+(205, 3453, 1, 1, 5, 5, 5, 205, 205, 205, 205, 10, 11, 'XHAAAA', 'VCFAAA', 'HHHHxx'),
+(1186, 3454, 0, 2, 6, 6, 86, 186, 1186, 1186, 1186, 172, 173, 'QTAAAA', 'WCFAAA', 'OOOOxx'),
+(1738, 3455, 0, 2, 8, 18, 38, 738, 1738, 1738, 1738, 76, 77, 'WOAAAA', 'XCFAAA', 'VVVVxx'),
+(9485, 3456, 1, 1, 5, 5, 85, 485, 1485, 4485, 9485, 170, 171, 'VAAAAA', 'YCFAAA', 'AAAAxx'),
+(4235, 3457, 1, 3, 5, 15, 35, 235, 235, 4235, 4235, 70, 71, 'XGAAAA', 'ZCFAAA', 'HHHHxx'),
+(7891, 3458, 1, 3, 1, 11, 91, 891, 1891, 2891, 7891, 182, 183, 'NRAAAA', 'ADFAAA', 'OOOOxx'),
+(4960, 3459, 0, 0, 0, 0, 60, 960, 960, 4960, 4960, 120, 121, 'UIAAAA', 'BDFAAA', 'VVVVxx'),
+(8911, 3460, 1, 3, 1, 11, 11, 911, 911, 3911, 8911, 22, 23, 'TEAAAA', 'CDFAAA', 'AAAAxx'),
+(1219, 3461, 1, 3, 9, 19, 19, 219, 1219, 1219, 1219, 38, 39, 'XUAAAA', 'DDFAAA', 'HHHHxx'),
+(9652, 3462, 0, 0, 2, 12, 52, 652, 1652, 4652, 9652, 104, 105, 'GHAAAA', 'EDFAAA', 'OOOOxx'),
+(9715, 3463, 1, 3, 5, 15, 15, 715, 1715, 4715, 9715, 30, 31, 'RJAAAA', 'FDFAAA', 'VVVVxx'),
+(6629, 3464, 1, 1, 9, 9, 29, 629, 629, 1629, 6629, 58, 59, 'ZUAAAA', 'GDFAAA', 'AAAAxx'),
+(700, 3465, 0, 0, 0, 0, 0, 700, 700, 700, 700, 0, 1, 'YAAAAA', 'HDFAAA', 'HHHHxx'),
+(9819, 3466, 1, 3, 9, 19, 19, 819, 1819, 4819, 9819, 38, 39, 'RNAAAA', 'IDFAAA', 'OOOOxx'),
+(5188, 3467, 0, 0, 8, 8, 88, 188, 1188, 188, 5188, 176, 177, 'ORAAAA', 'JDFAAA', 'VVVVxx'),
+(5367, 3468, 1, 3, 7, 7, 67, 367, 1367, 367, 5367, 134, 135, 'LYAAAA', 'KDFAAA', 'AAAAxx'),
+(6447, 3469, 1, 3, 7, 7, 47, 447, 447, 1447, 6447, 94, 95, 'ZNAAAA', 'LDFAAA', 'HHHHxx'),
+(720, 3470, 0, 0, 0, 0, 20, 720, 720, 720, 720, 40, 41, 'SBAAAA', 'MDFAAA', 'OOOOxx'),
+(9157, 3471, 1, 1, 7, 17, 57, 157, 1157, 4157, 9157, 114, 115, 'FOAAAA', 'NDFAAA', 'VVVVxx'),
+(1082, 3472, 0, 2, 2, 2, 82, 82, 1082, 1082, 1082, 164, 165, 'QPAAAA', 'ODFAAA', 'AAAAxx'),
+(3179, 3473, 1, 3, 9, 19, 79, 179, 1179, 3179, 3179, 158, 159, 'HSAAAA', 'PDFAAA', 'HHHHxx'),
+(4818, 3474, 0, 2, 8, 18, 18, 818, 818, 4818, 4818, 36, 37, 'IDAAAA', 'QDFAAA', 'OOOOxx'),
+(7607, 3475, 1, 3, 7, 7, 7, 607, 1607, 2607, 7607, 14, 15, 'PGAAAA', 'RDFAAA', 'VVVVxx'),
+(2352, 3476, 0, 0, 2, 12, 52, 352, 352, 2352, 2352, 104, 105, 'MMAAAA', 'SDFAAA', 'AAAAxx'),
+(1170, 3477, 0, 2, 0, 10, 70, 170, 1170, 1170, 1170, 140, 141, 'ATAAAA', 'TDFAAA', 'HHHHxx'),
+(4269, 3478, 1, 1, 9, 9, 69, 269, 269, 4269, 4269, 138, 139, 'FIAAAA', 'UDFAAA', 'OOOOxx'),
+(8767, 3479, 1, 3, 7, 7, 67, 767, 767, 3767, 8767, 134, 135, 'FZAAAA', 'VDFAAA', 'VVVVxx'),
+(3984, 3480, 0, 0, 4, 4, 84, 984, 1984, 3984, 3984, 168, 169, 'GXAAAA', 'WDFAAA', 'AAAAxx'),
+(3190, 3481, 0, 2, 0, 10, 90, 190, 1190, 3190, 3190, 180, 181, 'SSAAAA', 'XDFAAA', 'HHHHxx'),
+(7456, 3482, 0, 0, 6, 16, 56, 456, 1456, 2456, 7456, 112, 113, 'UAAAAA', 'YDFAAA', 'OOOOxx'),
+(4348, 3483, 0, 0, 8, 8, 48, 348, 348, 4348, 4348, 96, 97, 'GLAAAA', 'ZDFAAA', 'VVVVxx'),
+(3150, 3484, 0, 2, 0, 10, 50, 150, 1150, 3150, 3150, 100, 101, 'ERAAAA', 'AEFAAA', 'AAAAxx'),
+(8780, 3485, 0, 0, 0, 0, 80, 780, 780, 3780, 8780, 160, 161, 'SZAAAA', 'BEFAAA', 'HHHHxx'),
+(2553, 3486, 1, 1, 3, 13, 53, 553, 553, 2553, 2553, 106, 107, 'FUAAAA', 'CEFAAA', 'OOOOxx'),
+(7526, 3487, 0, 2, 6, 6, 26, 526, 1526, 2526, 7526, 52, 53, 'MDAAAA', 'DEFAAA', 'VVVVxx'),
+(2031, 3488, 1, 3, 1, 11, 31, 31, 31, 2031, 2031, 62, 63, 'DAAAAA', 'EEFAAA', 'AAAAxx'),
+(8793, 3489, 1, 1, 3, 13, 93, 793, 793, 3793, 8793, 186, 187, 'FAAAAA', 'FEFAAA', 'HHHHxx'),
+(1122, 3490, 0, 2, 2, 2, 22, 122, 1122, 1122, 1122, 44, 45, 'ERAAAA', 'GEFAAA', 'OOOOxx'),
+(1855, 3491, 1, 3, 5, 15, 55, 855, 1855, 1855, 1855, 110, 111, 'JTAAAA', 'HEFAAA', 'VVVVxx'),
+(6613, 3492, 1, 1, 3, 13, 13, 613, 613, 1613, 6613, 26, 27, 'JUAAAA', 'IEFAAA', 'AAAAxx'),
+(3231, 3493, 1, 3, 1, 11, 31, 231, 1231, 3231, 3231, 62, 63, 'HUAAAA', 'JEFAAA', 'HHHHxx'),
+(9101, 3494, 1, 1, 1, 1, 1, 101, 1101, 4101, 9101, 2, 3, 'BMAAAA', 'KEFAAA', 'OOOOxx'),
+(4937, 3495, 1, 1, 7, 17, 37, 937, 937, 4937, 4937, 74, 75, 'XHAAAA', 'LEFAAA', 'VVVVxx'),
+(666, 3496, 0, 2, 6, 6, 66, 666, 666, 666, 666, 132, 133, 'QZAAAA', 'MEFAAA', 'AAAAxx'),
+(8943, 3497, 1, 3, 3, 3, 43, 943, 943, 3943, 8943, 86, 87, 'ZFAAAA', 'NEFAAA', 'HHHHxx'),
+(6164, 3498, 0, 0, 4, 4, 64, 164, 164, 1164, 6164, 128, 129, 'CDAAAA', 'OEFAAA', 'OOOOxx'),
+(1081, 3499, 1, 1, 1, 1, 81, 81, 1081, 1081, 1081, 162, 163, 'PPAAAA', 'PEFAAA', 'VVVVxx'),
+(210, 3500, 0, 2, 0, 10, 10, 210, 210, 210, 210, 20, 21, 'CIAAAA', 'QEFAAA', 'AAAAxx'),
+(6024, 3501, 0, 0, 4, 4, 24, 24, 24, 1024, 6024, 48, 49, 'SXAAAA', 'REFAAA', 'HHHHxx'),
+(5715, 3502, 1, 3, 5, 15, 15, 715, 1715, 715, 5715, 30, 31, 'VLAAAA', 'SEFAAA', 'OOOOxx'),
+(8938, 3503, 0, 2, 8, 18, 38, 938, 938, 3938, 8938, 76, 77, 'UFAAAA', 'TEFAAA', 'VVVVxx'),
+(1326, 3504, 0, 2, 6, 6, 26, 326, 1326, 1326, 1326, 52, 53, 'AZAAAA', 'UEFAAA', 'AAAAxx'),
+(7111, 3505, 1, 3, 1, 11, 11, 111, 1111, 2111, 7111, 22, 23, 'NNAAAA', 'VEFAAA', 'HHHHxx'),
+(757, 3506, 1, 1, 7, 17, 57, 757, 757, 757, 757, 114, 115, 'DDAAAA', 'WEFAAA', 'OOOOxx'),
+(8933, 3507, 1, 1, 3, 13, 33, 933, 933, 3933, 8933, 66, 67, 'PFAAAA', 'XEFAAA', 'VVVVxx'),
+(6495, 3508, 1, 3, 5, 15, 95, 495, 495, 1495, 6495, 190, 191, 'VPAAAA', 'YEFAAA', 'AAAAxx'),
+(3134, 3509, 0, 2, 4, 14, 34, 134, 1134, 3134, 3134, 68, 69, 'OQAAAA', 'ZEFAAA', 'HHHHxx'),
+(1304, 3510, 0, 0, 4, 4, 4, 304, 1304, 1304, 1304, 8, 9, 'EYAAAA', 'AFFAAA', 'OOOOxx'),
+(1835, 3511, 1, 3, 5, 15, 35, 835, 1835, 1835, 1835, 70, 71, 'PSAAAA', 'BFFAAA', 'VVVVxx'),
+(7275, 3512, 1, 3, 5, 15, 75, 275, 1275, 2275, 7275, 150, 151, 'VTAAAA', 'CFFAAA', 'AAAAxx'),
+(7337, 3513, 1, 1, 7, 17, 37, 337, 1337, 2337, 7337, 74, 75, 'FWAAAA', 'DFFAAA', 'HHHHxx'),
+(1282, 3514, 0, 2, 2, 2, 82, 282, 1282, 1282, 1282, 164, 165, 'IXAAAA', 'EFFAAA', 'OOOOxx'),
+(6566, 3515, 0, 2, 6, 6, 66, 566, 566, 1566, 6566, 132, 133, 'OSAAAA', 'FFFAAA', 'VVVVxx'),
+(3786, 3516, 0, 2, 6, 6, 86, 786, 1786, 3786, 3786, 172, 173, 'QPAAAA', 'GFFAAA', 'AAAAxx'),
+(5741, 3517, 1, 1, 1, 1, 41, 741, 1741, 741, 5741, 82, 83, 'VMAAAA', 'HFFAAA', 'HHHHxx'),
+(6076, 3518, 0, 0, 6, 16, 76, 76, 76, 1076, 6076, 152, 153, 'SZAAAA', 'IFFAAA', 'OOOOxx'),
+(9998, 3519, 0, 2, 8, 18, 98, 998, 1998, 4998, 9998, 196, 197, 'OUAAAA', 'JFFAAA', 'VVVVxx'),
+(6268, 3520, 0, 0, 8, 8, 68, 268, 268, 1268, 6268, 136, 137, 'CHAAAA', 'KFFAAA', 'AAAAxx'),
+(9647, 3521, 1, 3, 7, 7, 47, 647, 1647, 4647, 9647, 94, 95, 'BHAAAA', 'LFFAAA', 'HHHHxx'),
+(4877, 3522, 1, 1, 7, 17, 77, 877, 877, 4877, 4877, 154, 155, 'PFAAAA', 'MFFAAA', 'OOOOxx'),
+(2652, 3523, 0, 0, 2, 12, 52, 652, 652, 2652, 2652, 104, 105, 'AYAAAA', 'NFFAAA', 'VVVVxx'),
+(1247, 3524, 1, 3, 7, 7, 47, 247, 1247, 1247, 1247, 94, 95, 'ZVAAAA', 'OFFAAA', 'AAAAxx'),
+(2721, 3525, 1, 1, 1, 1, 21, 721, 721, 2721, 2721, 42, 43, 'RAAAAA', 'PFFAAA', 'HHHHxx'),
+(5968, 3526, 0, 0, 8, 8, 68, 968, 1968, 968, 5968, 136, 137, 'OVAAAA', 'QFFAAA', 'OOOOxx'),
+(9570, 3527, 0, 2, 0, 10, 70, 570, 1570, 4570, 9570, 140, 141, 'CEAAAA', 'RFFAAA', 'VVVVxx'),
+(6425, 3528, 1, 1, 5, 5, 25, 425, 425, 1425, 6425, 50, 51, 'DNAAAA', 'SFFAAA', 'AAAAxx'),
+(5451, 3529, 1, 3, 1, 11, 51, 451, 1451, 451, 5451, 102, 103, 'RBAAAA', 'TFFAAA', 'HHHHxx'),
+(5668, 3530, 0, 0, 8, 8, 68, 668, 1668, 668, 5668, 136, 137, 'AKAAAA', 'UFFAAA', 'OOOOxx'),
+(9493, 3531, 1, 1, 3, 13, 93, 493, 1493, 4493, 9493, 186, 187, 'DBAAAA', 'VFFAAA', 'VVVVxx'),
+(7973, 3532, 1, 1, 3, 13, 73, 973, 1973, 2973, 7973, 146, 147, 'RUAAAA', 'WFFAAA', 'AAAAxx'),
+(8250, 3533, 0, 2, 0, 10, 50, 250, 250, 3250, 8250, 100, 101, 'IFAAAA', 'XFFAAA', 'HHHHxx'),
+(82, 3534, 0, 2, 2, 2, 82, 82, 82, 82, 82, 164, 165, 'EDAAAA', 'YFFAAA', 'OOOOxx'),
+(6258, 3535, 0, 2, 8, 18, 58, 258, 258, 1258, 6258, 116, 117, 'SGAAAA', 'ZFFAAA', 'VVVVxx'),
+(9978, 3536, 0, 2, 8, 18, 78, 978, 1978, 4978, 9978, 156, 157, 'UTAAAA', 'AGFAAA', 'AAAAxx'),
+(6930, 3537, 0, 2, 0, 10, 30, 930, 930, 1930, 6930, 60, 61, 'OGAAAA', 'BGFAAA', 'HHHHxx'),
+(3746, 3538, 0, 2, 6, 6, 46, 746, 1746, 3746, 3746, 92, 93, 'COAAAA', 'CGFAAA', 'OOOOxx'),
+(7065, 3539, 1, 1, 5, 5, 65, 65, 1065, 2065, 7065, 130, 131, 'TLAAAA', 'DGFAAA', 'VVVVxx'),
+(4281, 3540, 1, 1, 1, 1, 81, 281, 281, 4281, 4281, 162, 163, 'RIAAAA', 'EGFAAA', 'AAAAxx'),
+(4367, 3541, 1, 3, 7, 7, 67, 367, 367, 4367, 4367, 134, 135, 'ZLAAAA', 'FGFAAA', 'HHHHxx'),
+(9526, 3542, 0, 2, 6, 6, 26, 526, 1526, 4526, 9526, 52, 53, 'KCAAAA', 'GGFAAA', 'OOOOxx'),
+(5880, 3543, 0, 0, 0, 0, 80, 880, 1880, 880, 5880, 160, 161, 'ESAAAA', 'HGFAAA', 'VVVVxx'),
+(8480, 3544, 0, 0, 0, 0, 80, 480, 480, 3480, 8480, 160, 161, 'EOAAAA', 'IGFAAA', 'AAAAxx'),
+(2476, 3545, 0, 0, 6, 16, 76, 476, 476, 2476, 2476, 152, 153, 'GRAAAA', 'JGFAAA', 'HHHHxx'),
+(9074, 3546, 0, 2, 4, 14, 74, 74, 1074, 4074, 9074, 148, 149, 'ALAAAA', 'KGFAAA', 'OOOOxx'),
+(4830, 3547, 0, 2, 0, 10, 30, 830, 830, 4830, 4830, 60, 61, 'UDAAAA', 'LGFAAA', 'VVVVxx'),
+(3207, 3548, 1, 3, 7, 7, 7, 207, 1207, 3207, 3207, 14, 15, 'JTAAAA', 'MGFAAA', 'AAAAxx'),
+(7894, 3549, 0, 2, 4, 14, 94, 894, 1894, 2894, 7894, 188, 189, 'QRAAAA', 'NGFAAA', 'HHHHxx'),
+(3860, 3550, 0, 0, 0, 0, 60, 860, 1860, 3860, 3860, 120, 121, 'MSAAAA', 'OGFAAA', 'OOOOxx'),
+(5293, 3551, 1, 1, 3, 13, 93, 293, 1293, 293, 5293, 186, 187, 'PVAAAA', 'PGFAAA', 'VVVVxx'),
+(6895, 3552, 1, 3, 5, 15, 95, 895, 895, 1895, 6895, 190, 191, 'FFAAAA', 'QGFAAA', 'AAAAxx'),
+(9908, 3553, 0, 0, 8, 8, 8, 908, 1908, 4908, 9908, 16, 17, 'CRAAAA', 'RGFAAA', 'HHHHxx'),
+(9247, 3554, 1, 3, 7, 7, 47, 247, 1247, 4247, 9247, 94, 95, 'RRAAAA', 'SGFAAA', 'OOOOxx'),
+(8110, 3555, 0, 2, 0, 10, 10, 110, 110, 3110, 8110, 20, 21, 'YZAAAA', 'TGFAAA', 'VVVVxx'),
+(4716, 3556, 0, 0, 6, 16, 16, 716, 716, 4716, 4716, 32, 33, 'KZAAAA', 'UGFAAA', 'AAAAxx'),
+(4979, 3557, 1, 3, 9, 19, 79, 979, 979, 4979, 4979, 158, 159, 'NJAAAA', 'VGFAAA', 'HHHHxx'),
+(5280, 3558, 0, 0, 0, 0, 80, 280, 1280, 280, 5280, 160, 161, 'CVAAAA', 'WGFAAA', 'OOOOxx'),
+(8326, 3559, 0, 2, 6, 6, 26, 326, 326, 3326, 8326, 52, 53, 'GIAAAA', 'XGFAAA', 'VVVVxx'),
+(5572, 3560, 0, 0, 2, 12, 72, 572, 1572, 572, 5572, 144, 145, 'IGAAAA', 'YGFAAA', 'AAAAxx'),
+(4665, 3561, 1, 1, 5, 5, 65, 665, 665, 4665, 4665, 130, 131, 'LXAAAA', 'ZGFAAA', 'HHHHxx'),
+(3665, 3562, 1, 1, 5, 5, 65, 665, 1665, 3665, 3665, 130, 131, 'ZKAAAA', 'AHFAAA', 'OOOOxx'),
+(6744, 3563, 0, 0, 4, 4, 44, 744, 744, 1744, 6744, 88, 89, 'KZAAAA', 'BHFAAA', 'VVVVxx'),
+(1897, 3564, 1, 1, 7, 17, 97, 897, 1897, 1897, 1897, 194, 195, 'ZUAAAA', 'CHFAAA', 'AAAAxx'),
+(1220, 3565, 0, 0, 0, 0, 20, 220, 1220, 1220, 1220, 40, 41, 'YUAAAA', 'DHFAAA', 'HHHHxx'),
+(2614, 3566, 0, 2, 4, 14, 14, 614, 614, 2614, 2614, 28, 29, 'OWAAAA', 'EHFAAA', 'OOOOxx'),
+(8509, 3567, 1, 1, 9, 9, 9, 509, 509, 3509, 8509, 18, 19, 'HPAAAA', 'FHFAAA', 'VVVVxx'),
+(8521, 3568, 1, 1, 1, 1, 21, 521, 521, 3521, 8521, 42, 43, 'TPAAAA', 'GHFAAA', 'AAAAxx'),
+(4121, 3569, 1, 1, 1, 1, 21, 121, 121, 4121, 4121, 42, 43, 'NCAAAA', 'HHFAAA', 'HHHHxx'),
+(9663, 3570, 1, 3, 3, 3, 63, 663, 1663, 4663, 9663, 126, 127, 'RHAAAA', 'IHFAAA', 'OOOOxx'),
+(2346, 3571, 0, 2, 6, 6, 46, 346, 346, 2346, 2346, 92, 93, 'GMAAAA', 'JHFAAA', 'VVVVxx'),
+(3370, 3572, 0, 2, 0, 10, 70, 370, 1370, 3370, 3370, 140, 141, 'QZAAAA', 'KHFAAA', 'AAAAxx'),
+(1498, 3573, 0, 2, 8, 18, 98, 498, 1498, 1498, 1498, 196, 197, 'QFAAAA', 'LHFAAA', 'HHHHxx'),
+(7422, 3574, 0, 2, 2, 2, 22, 422, 1422, 2422, 7422, 44, 45, 'MZAAAA', 'MHFAAA', 'OOOOxx'),
+(3472, 3575, 0, 0, 2, 12, 72, 472, 1472, 3472, 3472, 144, 145, 'ODAAAA', 'NHFAAA', 'VVVVxx'),
+(4126, 3576, 0, 2, 6, 6, 26, 126, 126, 4126, 4126, 52, 53, 'SCAAAA', 'OHFAAA', 'AAAAxx'),
+(4494, 3577, 0, 2, 4, 14, 94, 494, 494, 4494, 4494, 188, 189, 'WQAAAA', 'PHFAAA', 'HHHHxx'),
+(6323, 3578, 1, 3, 3, 3, 23, 323, 323, 1323, 6323, 46, 47, 'FJAAAA', 'QHFAAA', 'OOOOxx'),
+(2823, 3579, 1, 3, 3, 3, 23, 823, 823, 2823, 2823, 46, 47, 'PEAAAA', 'RHFAAA', 'VVVVxx'),
+(8596, 3580, 0, 0, 6, 16, 96, 596, 596, 3596, 8596, 192, 193, 'QSAAAA', 'SHFAAA', 'AAAAxx'),
+(6642, 3581, 0, 2, 2, 2, 42, 642, 642, 1642, 6642, 84, 85, 'MVAAAA', 'THFAAA', 'HHHHxx'),
+(9276, 3582, 0, 0, 6, 16, 76, 276, 1276, 4276, 9276, 152, 153, 'USAAAA', 'UHFAAA', 'OOOOxx'),
+(4148, 3583, 0, 0, 8, 8, 48, 148, 148, 4148, 4148, 96, 97, 'ODAAAA', 'VHFAAA', 'VVVVxx'),
+(9770, 3584, 0, 2, 0, 10, 70, 770, 1770, 4770, 9770, 140, 141, 'ULAAAA', 'WHFAAA', 'AAAAxx'),
+(9812, 3585, 0, 0, 2, 12, 12, 812, 1812, 4812, 9812, 24, 25, 'KNAAAA', 'XHFAAA', 'HHHHxx'),
+(4419, 3586, 1, 3, 9, 19, 19, 419, 419, 4419, 4419, 38, 39, 'ZNAAAA', 'YHFAAA', 'OOOOxx'),
+(3802, 3587, 0, 2, 2, 2, 2, 802, 1802, 3802, 3802, 4, 5, 'GQAAAA', 'ZHFAAA', 'VVVVxx'),
+(3210, 3588, 0, 2, 0, 10, 10, 210, 1210, 3210, 3210, 20, 21, 'MTAAAA', 'AIFAAA', 'AAAAxx'),
+(6794, 3589, 0, 2, 4, 14, 94, 794, 794, 1794, 6794, 188, 189, 'IBAAAA', 'BIFAAA', 'HHHHxx'),
+(242, 3590, 0, 2, 2, 2, 42, 242, 242, 242, 242, 84, 85, 'IJAAAA', 'CIFAAA', 'OOOOxx'),
+(962, 3591, 0, 2, 2, 2, 62, 962, 962, 962, 962, 124, 125, 'ALAAAA', 'DIFAAA', 'VVVVxx'),
+(7151, 3592, 1, 3, 1, 11, 51, 151, 1151, 2151, 7151, 102, 103, 'BPAAAA', 'EIFAAA', 'AAAAxx'),
+(9440, 3593, 0, 0, 0, 0, 40, 440, 1440, 4440, 9440, 80, 81, 'CZAAAA', 'FIFAAA', 'HHHHxx'),
+(721, 3594, 1, 1, 1, 1, 21, 721, 721, 721, 721, 42, 43, 'TBAAAA', 'GIFAAA', 'OOOOxx'),
+(2119, 3595, 1, 3, 9, 19, 19, 119, 119, 2119, 2119, 38, 39, 'NDAAAA', 'HIFAAA', 'VVVVxx'),
+(9883, 3596, 1, 3, 3, 3, 83, 883, 1883, 4883, 9883, 166, 167, 'DQAAAA', 'IIFAAA', 'AAAAxx'),
+(5071, 3597, 1, 3, 1, 11, 71, 71, 1071, 71, 5071, 142, 143, 'BNAAAA', 'JIFAAA', 'HHHHxx'),
+(8239, 3598, 1, 3, 9, 19, 39, 239, 239, 3239, 8239, 78, 79, 'XEAAAA', 'KIFAAA', 'OOOOxx'),
+(7451, 3599, 1, 3, 1, 11, 51, 451, 1451, 2451, 7451, 102, 103, 'PAAAAA', 'LIFAAA', 'VVVVxx'),
+(9517, 3600, 1, 1, 7, 17, 17, 517, 1517, 4517, 9517, 34, 35, 'BCAAAA', 'MIFAAA', 'AAAAxx'),
+(9180, 3601, 0, 0, 0, 0, 80, 180, 1180, 4180, 9180, 160, 161, 'CPAAAA', 'NIFAAA', 'HHHHxx'),
+(9327, 3602, 1, 3, 7, 7, 27, 327, 1327, 4327, 9327, 54, 55, 'TUAAAA', 'OIFAAA', 'OOOOxx'),
+(5462, 3603, 0, 2, 2, 2, 62, 462, 1462, 462, 5462, 124, 125, 'CCAAAA', 'PIFAAA', 'VVVVxx'),
+(8306, 3604, 0, 2, 6, 6, 6, 306, 306, 3306, 8306, 12, 13, 'MHAAAA', 'QIFAAA', 'AAAAxx'),
+(6234, 3605, 0, 2, 4, 14, 34, 234, 234, 1234, 6234, 68, 69, 'UFAAAA', 'RIFAAA', 'HHHHxx'),
+(8771, 3606, 1, 3, 1, 11, 71, 771, 771, 3771, 8771, 142, 143, 'JZAAAA', 'SIFAAA', 'OOOOxx'),
+(5853, 3607, 1, 1, 3, 13, 53, 853, 1853, 853, 5853, 106, 107, 'DRAAAA', 'TIFAAA', 'VVVVxx'),
+(8373, 3608, 1, 1, 3, 13, 73, 373, 373, 3373, 8373, 146, 147, 'BKAAAA', 'UIFAAA', 'AAAAxx'),
+(5017, 3609, 1, 1, 7, 17, 17, 17, 1017, 17, 5017, 34, 35, 'ZKAAAA', 'VIFAAA', 'HHHHxx'),
+(8025, 3610, 1, 1, 5, 5, 25, 25, 25, 3025, 8025, 50, 51, 'RWAAAA', 'WIFAAA', 'OOOOxx'),
+(2526, 3611, 0, 2, 6, 6, 26, 526, 526, 2526, 2526, 52, 53, 'ETAAAA', 'XIFAAA', 'VVVVxx'),
+(7419, 3612, 1, 3, 9, 19, 19, 419, 1419, 2419, 7419, 38, 39, 'JZAAAA', 'YIFAAA', 'AAAAxx'),
+(4572, 3613, 0, 0, 2, 12, 72, 572, 572, 4572, 4572, 144, 145, 'WTAAAA', 'ZIFAAA', 'HHHHxx'),
+(7744, 3614, 0, 0, 4, 4, 44, 744, 1744, 2744, 7744, 88, 89, 'WLAAAA', 'AJFAAA', 'OOOOxx'),
+(8825, 3615, 1, 1, 5, 5, 25, 825, 825, 3825, 8825, 50, 51, 'LBAAAA', 'BJFAAA', 'VVVVxx'),
+(6067, 3616, 1, 3, 7, 7, 67, 67, 67, 1067, 6067, 134, 135, 'JZAAAA', 'CJFAAA', 'AAAAxx'),
+(3291, 3617, 1, 3, 1, 11, 91, 291, 1291, 3291, 3291, 182, 183, 'PWAAAA', 'DJFAAA', 'HHHHxx'),
+(7115, 3618, 1, 3, 5, 15, 15, 115, 1115, 2115, 7115, 30, 31, 'RNAAAA', 'EJFAAA', 'OOOOxx'),
+(2626, 3619, 0, 2, 6, 6, 26, 626, 626, 2626, 2626, 52, 53, 'AXAAAA', 'FJFAAA', 'VVVVxx'),
+(4109, 3620, 1, 1, 9, 9, 9, 109, 109, 4109, 4109, 18, 19, 'BCAAAA', 'GJFAAA', 'AAAAxx'),
+(4056, 3621, 0, 0, 6, 16, 56, 56, 56, 4056, 4056, 112, 113, 'AAAAAA', 'HJFAAA', 'HHHHxx'),
+(6811, 3622, 1, 3, 1, 11, 11, 811, 811, 1811, 6811, 22, 23, 'ZBAAAA', 'IJFAAA', 'OOOOxx'),
+(680, 3623, 0, 0, 0, 0, 80, 680, 680, 680, 680, 160, 161, 'EAAAAA', 'JJFAAA', 'VVVVxx'),
+(474, 3624, 0, 2, 4, 14, 74, 474, 474, 474, 474, 148, 149, 'GSAAAA', 'KJFAAA', 'AAAAxx'),
+(9294, 3625, 0, 2, 4, 14, 94, 294, 1294, 4294, 9294, 188, 189, 'MTAAAA', 'LJFAAA', 'HHHHxx'),
+(7555, 3626, 1, 3, 5, 15, 55, 555, 1555, 2555, 7555, 110, 111, 'PEAAAA', 'MJFAAA', 'OOOOxx'),
+(8076, 3627, 0, 0, 6, 16, 76, 76, 76, 3076, 8076, 152, 153, 'QYAAAA', 'NJFAAA', 'VVVVxx'),
+(3840, 3628, 0, 0, 0, 0, 40, 840, 1840, 3840, 3840, 80, 81, 'SRAAAA', 'OJFAAA', 'AAAAxx'),
+(5955, 3629, 1, 3, 5, 15, 55, 955, 1955, 955, 5955, 110, 111, 'BVAAAA', 'PJFAAA', 'HHHHxx'),
+(994, 3630, 0, 2, 4, 14, 94, 994, 994, 994, 994, 188, 189, 'GMAAAA', 'QJFAAA', 'OOOOxx'),
+(2089, 3631, 1, 1, 9, 9, 89, 89, 89, 2089, 2089, 178, 179, 'JCAAAA', 'RJFAAA', 'VVVVxx'),
+(869, 3632, 1, 1, 9, 9, 69, 869, 869, 869, 869, 138, 139, 'LHAAAA', 'SJFAAA', 'AAAAxx'),
+(1223, 3633, 1, 3, 3, 3, 23, 223, 1223, 1223, 1223, 46, 47, 'BVAAAA', 'TJFAAA', 'HHHHxx'),
+(1514, 3634, 0, 2, 4, 14, 14, 514, 1514, 1514, 1514, 28, 29, 'GGAAAA', 'UJFAAA', 'OOOOxx'),
+(4891, 3635, 1, 3, 1, 11, 91, 891, 891, 4891, 4891, 182, 183, 'DGAAAA', 'VJFAAA', 'VVVVxx'),
+(4190, 3636, 0, 2, 0, 10, 90, 190, 190, 4190, 4190, 180, 181, 'EFAAAA', 'WJFAAA', 'AAAAxx'),
+(4377, 3637, 1, 1, 7, 17, 77, 377, 377, 4377, 4377, 154, 155, 'JMAAAA', 'XJFAAA', 'HHHHxx'),
+(9195, 3638, 1, 3, 5, 15, 95, 195, 1195, 4195, 9195, 190, 191, 'RPAAAA', 'YJFAAA', 'OOOOxx'),
+(3827, 3639, 1, 3, 7, 7, 27, 827, 1827, 3827, 3827, 54, 55, 'FRAAAA', 'ZJFAAA', 'VVVVxx'),
+(7386, 3640, 0, 2, 6, 6, 86, 386, 1386, 2386, 7386, 172, 173, 'CYAAAA', 'AKFAAA', 'AAAAxx'),
+(6665, 3641, 1, 1, 5, 5, 65, 665, 665, 1665, 6665, 130, 131, 'JWAAAA', 'BKFAAA', 'HHHHxx'),
+(7514, 3642, 0, 2, 4, 14, 14, 514, 1514, 2514, 7514, 28, 29, 'ADAAAA', 'CKFAAA', 'OOOOxx'),
+(6431, 3643, 1, 3, 1, 11, 31, 431, 431, 1431, 6431, 62, 63, 'JNAAAA', 'DKFAAA', 'VVVVxx'),
+(3251, 3644, 1, 3, 1, 11, 51, 251, 1251, 3251, 3251, 102, 103, 'BVAAAA', 'EKFAAA', 'AAAAxx'),
+(8439, 3645, 1, 3, 9, 19, 39, 439, 439, 3439, 8439, 78, 79, 'PMAAAA', 'FKFAAA', 'HHHHxx'),
+(831, 3646, 1, 3, 1, 11, 31, 831, 831, 831, 831, 62, 63, 'ZFAAAA', 'GKFAAA', 'OOOOxx'),
+(8485, 3647, 1, 1, 5, 5, 85, 485, 485, 3485, 8485, 170, 171, 'JOAAAA', 'HKFAAA', 'VVVVxx'),
+(7314, 3648, 0, 2, 4, 14, 14, 314, 1314, 2314, 7314, 28, 29, 'IVAAAA', 'IKFAAA', 'AAAAxx'),
+(3044, 3649, 0, 0, 4, 4, 44, 44, 1044, 3044, 3044, 88, 89, 'CNAAAA', 'JKFAAA', 'HHHHxx'),
+(4283, 3650, 1, 3, 3, 3, 83, 283, 283, 4283, 4283, 166, 167, 'TIAAAA', 'KKFAAA', 'OOOOxx'),
+(298, 3651, 0, 2, 8, 18, 98, 298, 298, 298, 298, 196, 197, 'MLAAAA', 'LKFAAA', 'VVVVxx'),
+(7114, 3652, 0, 2, 4, 14, 14, 114, 1114, 2114, 7114, 28, 29, 'QNAAAA', 'MKFAAA', 'AAAAxx'),
+(9664, 3653, 0, 0, 4, 4, 64, 664, 1664, 4664, 9664, 128, 129, 'SHAAAA', 'NKFAAA', 'HHHHxx'),
+(5315, 3654, 1, 3, 5, 15, 15, 315, 1315, 315, 5315, 30, 31, 'LWAAAA', 'OKFAAA', 'OOOOxx'),
+(2164, 3655, 0, 0, 4, 4, 64, 164, 164, 2164, 2164, 128, 129, 'GFAAAA', 'PKFAAA', 'VVVVxx'),
+(3390, 3656, 0, 2, 0, 10, 90, 390, 1390, 3390, 3390, 180, 181, 'KAAAAA', 'QKFAAA', 'AAAAxx'),
+(836, 3657, 0, 0, 6, 16, 36, 836, 836, 836, 836, 72, 73, 'EGAAAA', 'RKFAAA', 'HHHHxx'),
+(3316, 3658, 0, 0, 6, 16, 16, 316, 1316, 3316, 3316, 32, 33, 'OXAAAA', 'SKFAAA', 'OOOOxx'),
+(1284, 3659, 0, 0, 4, 4, 84, 284, 1284, 1284, 1284, 168, 169, 'KXAAAA', 'TKFAAA', 'VVVVxx'),
+(2497, 3660, 1, 1, 7, 17, 97, 497, 497, 2497, 2497, 194, 195, 'BSAAAA', 'UKFAAA', 'AAAAxx'),
+(1374, 3661, 0, 2, 4, 14, 74, 374, 1374, 1374, 1374, 148, 149, 'WAAAAA', 'VKFAAA', 'HHHHxx'),
+(9525, 3662, 1, 1, 5, 5, 25, 525, 1525, 4525, 9525, 50, 51, 'JCAAAA', 'WKFAAA', 'OOOOxx'),
+(2911, 3663, 1, 3, 1, 11, 11, 911, 911, 2911, 2911, 22, 23, 'ZHAAAA', 'XKFAAA', 'VVVVxx'),
+(9686, 3664, 0, 2, 6, 6, 86, 686, 1686, 4686, 9686, 172, 173, 'OIAAAA', 'YKFAAA', 'AAAAxx'),
+(584, 3665, 0, 0, 4, 4, 84, 584, 584, 584, 584, 168, 169, 'MWAAAA', 'ZKFAAA', 'HHHHxx'),
+(5653, 3666, 1, 1, 3, 13, 53, 653, 1653, 653, 5653, 106, 107, 'LJAAAA', 'ALFAAA', 'OOOOxx'),
+(4986, 3667, 0, 2, 6, 6, 86, 986, 986, 4986, 4986, 172, 173, 'UJAAAA', 'BLFAAA', 'VVVVxx'),
+(6049, 3668, 1, 1, 9, 9, 49, 49, 49, 1049, 6049, 98, 99, 'RYAAAA', 'CLFAAA', 'AAAAxx'),
+(9891, 3669, 1, 3, 1, 11, 91, 891, 1891, 4891, 9891, 182, 183, 'LQAAAA', 'DLFAAA', 'HHHHxx'),
+(8809, 3670, 1, 1, 9, 9, 9, 809, 809, 3809, 8809, 18, 19, 'VAAAAA', 'ELFAAA', 'OOOOxx'),
+(8598, 3671, 0, 2, 8, 18, 98, 598, 598, 3598, 8598, 196, 197, 'SSAAAA', 'FLFAAA', 'VVVVxx'),
+(2573, 3672, 1, 1, 3, 13, 73, 573, 573, 2573, 2573, 146, 147, 'ZUAAAA', 'GLFAAA', 'AAAAxx'),
+(6864, 3673, 0, 0, 4, 4, 64, 864, 864, 1864, 6864, 128, 129, 'AEAAAA', 'HLFAAA', 'HHHHxx'),
+(7932, 3674, 0, 0, 2, 12, 32, 932, 1932, 2932, 7932, 64, 65, 'CTAAAA', 'ILFAAA', 'OOOOxx'),
+(6605, 3675, 1, 1, 5, 5, 5, 605, 605, 1605, 6605, 10, 11, 'BUAAAA', 'JLFAAA', 'VVVVxx'),
+(9500, 3676, 0, 0, 0, 0, 0, 500, 1500, 4500, 9500, 0, 1, 'KBAAAA', 'KLFAAA', 'AAAAxx'),
+(8742, 3677, 0, 2, 2, 2, 42, 742, 742, 3742, 8742, 84, 85, 'GYAAAA', 'LLFAAA', 'HHHHxx'),
+(9815, 3678, 1, 3, 5, 15, 15, 815, 1815, 4815, 9815, 30, 31, 'NNAAAA', 'MLFAAA', 'OOOOxx'),
+(3319, 3679, 1, 3, 9, 19, 19, 319, 1319, 3319, 3319, 38, 39, 'RXAAAA', 'NLFAAA', 'VVVVxx'),
+(184, 3680, 0, 0, 4, 4, 84, 184, 184, 184, 184, 168, 169, 'CHAAAA', 'OLFAAA', 'AAAAxx'),
+(8886, 3681, 0, 2, 6, 6, 86, 886, 886, 3886, 8886, 172, 173, 'UDAAAA', 'PLFAAA', 'HHHHxx'),
+(7050, 3682, 0, 2, 0, 10, 50, 50, 1050, 2050, 7050, 100, 101, 'ELAAAA', 'QLFAAA', 'OOOOxx'),
+(9781, 3683, 1, 1, 1, 1, 81, 781, 1781, 4781, 9781, 162, 163, 'FMAAAA', 'RLFAAA', 'VVVVxx'),
+(2443, 3684, 1, 3, 3, 3, 43, 443, 443, 2443, 2443, 86, 87, 'ZPAAAA', 'SLFAAA', 'AAAAxx'),
+(1160, 3685, 0, 0, 0, 0, 60, 160, 1160, 1160, 1160, 120, 121, 'QSAAAA', 'TLFAAA', 'HHHHxx'),
+(4600, 3686, 0, 0, 0, 0, 0, 600, 600, 4600, 4600, 0, 1, 'YUAAAA', 'ULFAAA', 'OOOOxx'),
+(813, 3687, 1, 1, 3, 13, 13, 813, 813, 813, 813, 26, 27, 'HFAAAA', 'VLFAAA', 'VVVVxx'),
+(5078, 3688, 0, 2, 8, 18, 78, 78, 1078, 78, 5078, 156, 157, 'INAAAA', 'WLFAAA', 'AAAAxx'),
+(9008, 3689, 0, 0, 8, 8, 8, 8, 1008, 4008, 9008, 16, 17, 'MIAAAA', 'XLFAAA', 'HHHHxx'),
+(9016, 3690, 0, 0, 6, 16, 16, 16, 1016, 4016, 9016, 32, 33, 'UIAAAA', 'YLFAAA', 'OOOOxx'),
+(2747, 3691, 1, 3, 7, 7, 47, 747, 747, 2747, 2747, 94, 95, 'RBAAAA', 'ZLFAAA', 'VVVVxx'),
+(3106, 3692, 0, 2, 6, 6, 6, 106, 1106, 3106, 3106, 12, 13, 'MPAAAA', 'AMFAAA', 'AAAAxx'),
+(8235, 3693, 1, 3, 5, 15, 35, 235, 235, 3235, 8235, 70, 71, 'TEAAAA', 'BMFAAA', 'HHHHxx'),
+(5582, 3694, 0, 2, 2, 2, 82, 582, 1582, 582, 5582, 164, 165, 'SGAAAA', 'CMFAAA', 'OOOOxx'),
+(4334, 3695, 0, 2, 4, 14, 34, 334, 334, 4334, 4334, 68, 69, 'SKAAAA', 'DMFAAA', 'VVVVxx'),
+(1612, 3696, 0, 0, 2, 12, 12, 612, 1612, 1612, 1612, 24, 25, 'AKAAAA', 'EMFAAA', 'AAAAxx'),
+(5650, 3697, 0, 2, 0, 10, 50, 650, 1650, 650, 5650, 100, 101, 'IJAAAA', 'FMFAAA', 'HHHHxx'),
+(6086, 3698, 0, 2, 6, 6, 86, 86, 86, 1086, 6086, 172, 173, 'CAAAAA', 'GMFAAA', 'OOOOxx'),
+(9667, 3699, 1, 3, 7, 7, 67, 667, 1667, 4667, 9667, 134, 135, 'VHAAAA', 'HMFAAA', 'VVVVxx'),
+(4215, 3700, 1, 3, 5, 15, 15, 215, 215, 4215, 4215, 30, 31, 'DGAAAA', 'IMFAAA', 'AAAAxx'),
+(8553, 3701, 1, 1, 3, 13, 53, 553, 553, 3553, 8553, 106, 107, 'ZQAAAA', 'JMFAAA', 'HHHHxx'),
+(9066, 3702, 0, 2, 6, 6, 66, 66, 1066, 4066, 9066, 132, 133, 'SKAAAA', 'KMFAAA', 'OOOOxx'),
+(1092, 3703, 0, 0, 2, 12, 92, 92, 1092, 1092, 1092, 184, 185, 'AQAAAA', 'LMFAAA', 'VVVVxx'),
+(2848, 3704, 0, 0, 8, 8, 48, 848, 848, 2848, 2848, 96, 97, 'OFAAAA', 'MMFAAA', 'AAAAxx'),
+(2765, 3705, 1, 1, 5, 5, 65, 765, 765, 2765, 2765, 130, 131, 'JCAAAA', 'NMFAAA', 'HHHHxx'),
+(6513, 3706, 1, 1, 3, 13, 13, 513, 513, 1513, 6513, 26, 27, 'NQAAAA', 'OMFAAA', 'OOOOxx'),
+(6541, 3707, 1, 1, 1, 1, 41, 541, 541, 1541, 6541, 82, 83, 'PRAAAA', 'PMFAAA', 'VVVVxx'),
+(9617, 3708, 1, 1, 7, 17, 17, 617, 1617, 4617, 9617, 34, 35, 'XFAAAA', 'QMFAAA', 'AAAAxx'),
+(5870, 3709, 0, 2, 0, 10, 70, 870, 1870, 870, 5870, 140, 141, 'URAAAA', 'RMFAAA', 'HHHHxx'),
+(8811, 3710, 1, 3, 1, 11, 11, 811, 811, 3811, 8811, 22, 23, 'XAAAAA', 'SMFAAA', 'OOOOxx'),
+(4529, 3711, 1, 1, 9, 9, 29, 529, 529, 4529, 4529, 58, 59, 'FSAAAA', 'TMFAAA', 'VVVVxx'),
+(161, 3712, 1, 1, 1, 1, 61, 161, 161, 161, 161, 122, 123, 'FGAAAA', 'UMFAAA', 'AAAAxx'),
+(641, 3713, 1, 1, 1, 1, 41, 641, 641, 641, 641, 82, 83, 'RYAAAA', 'VMFAAA', 'HHHHxx'),
+(4767, 3714, 1, 3, 7, 7, 67, 767, 767, 4767, 4767, 134, 135, 'JBAAAA', 'WMFAAA', 'OOOOxx'),
+(6293, 3715, 1, 1, 3, 13, 93, 293, 293, 1293, 6293, 186, 187, 'BIAAAA', 'XMFAAA', 'VVVVxx'),
+(3816, 3716, 0, 0, 6, 16, 16, 816, 1816, 3816, 3816, 32, 33, 'UQAAAA', 'YMFAAA', 'AAAAxx'),
+(4748, 3717, 0, 0, 8, 8, 48, 748, 748, 4748, 4748, 96, 97, 'QAAAAA', 'ZMFAAA', 'HHHHxx'),
+(9924, 3718, 0, 0, 4, 4, 24, 924, 1924, 4924, 9924, 48, 49, 'SRAAAA', 'ANFAAA', 'OOOOxx'),
+(6716, 3719, 0, 0, 6, 16, 16, 716, 716, 1716, 6716, 32, 33, 'IYAAAA', 'BNFAAA', 'VVVVxx'),
+(8828, 3720, 0, 0, 8, 8, 28, 828, 828, 3828, 8828, 56, 57, 'OBAAAA', 'CNFAAA', 'AAAAxx'),
+(4967, 3721, 1, 3, 7, 7, 67, 967, 967, 4967, 4967, 134, 135, 'BJAAAA', 'DNFAAA', 'HHHHxx'),
+(9680, 3722, 0, 0, 0, 0, 80, 680, 1680, 4680, 9680, 160, 161, 'IIAAAA', 'ENFAAA', 'OOOOxx'),
+(2784, 3723, 0, 0, 4, 4, 84, 784, 784, 2784, 2784, 168, 169, 'CDAAAA', 'FNFAAA', 'VVVVxx'),
+(2882, 3724, 0, 2, 2, 2, 82, 882, 882, 2882, 2882, 164, 165, 'WGAAAA', 'GNFAAA', 'AAAAxx'),
+(3641, 3725, 1, 1, 1, 1, 41, 641, 1641, 3641, 3641, 82, 83, 'BKAAAA', 'HNFAAA', 'HHHHxx'),
+(5537, 3726, 1, 1, 7, 17, 37, 537, 1537, 537, 5537, 74, 75, 'ZEAAAA', 'INFAAA', 'OOOOxx'),
+(820, 3727, 0, 0, 0, 0, 20, 820, 820, 820, 820, 40, 41, 'OFAAAA', 'JNFAAA', 'VVVVxx'),
+(5847, 3728, 1, 3, 7, 7, 47, 847, 1847, 847, 5847, 94, 95, 'XQAAAA', 'KNFAAA', 'AAAAxx'),
+(566, 3729, 0, 2, 6, 6, 66, 566, 566, 566, 566, 132, 133, 'UVAAAA', 'LNFAAA', 'HHHHxx'),
+(2246, 3730, 0, 2, 6, 6, 46, 246, 246, 2246, 2246, 92, 93, 'KIAAAA', 'MNFAAA', 'OOOOxx'),
+(6680, 3731, 0, 0, 0, 0, 80, 680, 680, 1680, 6680, 160, 161, 'YWAAAA', 'NNFAAA', 'VVVVxx'),
+(2014, 3732, 0, 2, 4, 14, 14, 14, 14, 2014, 2014, 28, 29, 'MZAAAA', 'ONFAAA', 'AAAAxx'),
+(8355, 3733, 1, 3, 5, 15, 55, 355, 355, 3355, 8355, 110, 111, 'JJAAAA', 'PNFAAA', 'HHHHxx'),
+(1610, 3734, 0, 2, 0, 10, 10, 610, 1610, 1610, 1610, 20, 21, 'YJAAAA', 'QNFAAA', 'OOOOxx'),
+(9719, 3735, 1, 3, 9, 19, 19, 719, 1719, 4719, 9719, 38, 39, 'VJAAAA', 'RNFAAA', 'VVVVxx'),
+(8498, 3736, 0, 2, 8, 18, 98, 498, 498, 3498, 8498, 196, 197, 'WOAAAA', 'SNFAAA', 'AAAAxx'),
+(5883, 3737, 1, 3, 3, 3, 83, 883, 1883, 883, 5883, 166, 167, 'HSAAAA', 'TNFAAA', 'HHHHxx'),
+(7380, 3738, 0, 0, 0, 0, 80, 380, 1380, 2380, 7380, 160, 161, 'WXAAAA', 'UNFAAA', 'OOOOxx'),
+(8865, 3739, 1, 1, 5, 5, 65, 865, 865, 3865, 8865, 130, 131, 'ZCAAAA', 'VNFAAA', 'VVVVxx'),
+(4743, 3740, 1, 3, 3, 3, 43, 743, 743, 4743, 4743, 86, 87, 'LAAAAA', 'WNFAAA', 'AAAAxx'),
+(5086, 3741, 0, 2, 6, 6, 86, 86, 1086, 86, 5086, 172, 173, 'QNAAAA', 'XNFAAA', 'HHHHxx'),
+(2739, 3742, 1, 3, 9, 19, 39, 739, 739, 2739, 2739, 78, 79, 'JBAAAA', 'YNFAAA', 'OOOOxx'),
+(9375, 3743, 1, 3, 5, 15, 75, 375, 1375, 4375, 9375, 150, 151, 'PWAAAA', 'ZNFAAA', 'VVVVxx'),
+(7876, 3744, 0, 0, 6, 16, 76, 876, 1876, 2876, 7876, 152, 153, 'YQAAAA', 'AOFAAA', 'AAAAxx'),
+(453, 3745, 1, 1, 3, 13, 53, 453, 453, 453, 453, 106, 107, 'LRAAAA', 'BOFAAA', 'HHHHxx'),
+(6987, 3746, 1, 3, 7, 7, 87, 987, 987, 1987, 6987, 174, 175, 'TIAAAA', 'COFAAA', 'OOOOxx'),
+(2860, 3747, 0, 0, 0, 0, 60, 860, 860, 2860, 2860, 120, 121, 'AGAAAA', 'DOFAAA', 'VVVVxx'),
+(8372, 3748, 0, 0, 2, 12, 72, 372, 372, 3372, 8372, 144, 145, 'AKAAAA', 'EOFAAA', 'AAAAxx'),
+(2048, 3749, 0, 0, 8, 8, 48, 48, 48, 2048, 2048, 96, 97, 'UAAAAA', 'FOFAAA', 'HHHHxx'),
+(9231, 3750, 1, 3, 1, 11, 31, 231, 1231, 4231, 9231, 62, 63, 'BRAAAA', 'GOFAAA', 'OOOOxx'),
+(634, 3751, 0, 2, 4, 14, 34, 634, 634, 634, 634, 68, 69, 'KYAAAA', 'HOFAAA', 'VVVVxx'),
+(3998, 3752, 0, 2, 8, 18, 98, 998, 1998, 3998, 3998, 196, 197, 'UXAAAA', 'IOFAAA', 'AAAAxx'),
+(4728, 3753, 0, 0, 8, 8, 28, 728, 728, 4728, 4728, 56, 57, 'WZAAAA', 'JOFAAA', 'HHHHxx'),
+(579, 3754, 1, 3, 9, 19, 79, 579, 579, 579, 579, 158, 159, 'HWAAAA', 'KOFAAA', 'OOOOxx'),
+(815, 3755, 1, 3, 5, 15, 15, 815, 815, 815, 815, 30, 31, 'JFAAAA', 'LOFAAA', 'VVVVxx'),
+(1009, 3756, 1, 1, 9, 9, 9, 9, 1009, 1009, 1009, 18, 19, 'VMAAAA', 'MOFAAA', 'AAAAxx'),
+(6596, 3757, 0, 0, 6, 16, 96, 596, 596, 1596, 6596, 192, 193, 'STAAAA', 'NOFAAA', 'HHHHxx'),
+(2793, 3758, 1, 1, 3, 13, 93, 793, 793, 2793, 2793, 186, 187, 'LDAAAA', 'OOFAAA', 'OOOOxx'),
+(9589, 3759, 1, 1, 9, 9, 89, 589, 1589, 4589, 9589, 178, 179, 'VEAAAA', 'POFAAA', 'VVVVxx'),
+(2794, 3760, 0, 2, 4, 14, 94, 794, 794, 2794, 2794, 188, 189, 'MDAAAA', 'QOFAAA', 'AAAAxx'),
+(2551, 3761, 1, 3, 1, 11, 51, 551, 551, 2551, 2551, 102, 103, 'DUAAAA', 'ROFAAA', 'HHHHxx'),
+(1588, 3762, 0, 0, 8, 8, 88, 588, 1588, 1588, 1588, 176, 177, 'CJAAAA', 'SOFAAA', 'OOOOxx'),
+(4443, 3763, 1, 3, 3, 3, 43, 443, 443, 4443, 4443, 86, 87, 'XOAAAA', 'TOFAAA', 'VVVVxx'),
+(5009, 3764, 1, 1, 9, 9, 9, 9, 1009, 9, 5009, 18, 19, 'RKAAAA', 'UOFAAA', 'AAAAxx'),
+(4287, 3765, 1, 3, 7, 7, 87, 287, 287, 4287, 4287, 174, 175, 'XIAAAA', 'VOFAAA', 'HHHHxx'),
+(2167, 3766, 1, 3, 7, 7, 67, 167, 167, 2167, 2167, 134, 135, 'JFAAAA', 'WOFAAA', 'OOOOxx'),
+(2290, 3767, 0, 2, 0, 10, 90, 290, 290, 2290, 2290, 180, 181, 'CKAAAA', 'XOFAAA', 'VVVVxx'),
+(7225, 3768, 1, 1, 5, 5, 25, 225, 1225, 2225, 7225, 50, 51, 'XRAAAA', 'YOFAAA', 'AAAAxx'),
+(8992, 3769, 0, 0, 2, 12, 92, 992, 992, 3992, 8992, 184, 185, 'WHAAAA', 'ZOFAAA', 'HHHHxx'),
+(1540, 3770, 0, 0, 0, 0, 40, 540, 1540, 1540, 1540, 80, 81, 'GHAAAA', 'APFAAA', 'OOOOxx'),
+(2029, 3771, 1, 1, 9, 9, 29, 29, 29, 2029, 2029, 58, 59, 'BAAAAA', 'BPFAAA', 'VVVVxx'),
+(2855, 3772, 1, 3, 5, 15, 55, 855, 855, 2855, 2855, 110, 111, 'VFAAAA', 'CPFAAA', 'AAAAxx'),
+(3534, 3773, 0, 2, 4, 14, 34, 534, 1534, 3534, 3534, 68, 69, 'YFAAAA', 'DPFAAA', 'HHHHxx'),
+(8078, 3774, 0, 2, 8, 18, 78, 78, 78, 3078, 8078, 156, 157, 'SYAAAA', 'EPFAAA', 'OOOOxx'),
+(9778, 3775, 0, 2, 8, 18, 78, 778, 1778, 4778, 9778, 156, 157, 'CMAAAA', 'FPFAAA', 'VVVVxx'),
+(3543, 3776, 1, 3, 3, 3, 43, 543, 1543, 3543, 3543, 86, 87, 'HGAAAA', 'GPFAAA', 'AAAAxx'),
+(4778, 3777, 0, 2, 8, 18, 78, 778, 778, 4778, 4778, 156, 157, 'UBAAAA', 'HPFAAA', 'HHHHxx'),
+(8931, 3778, 1, 3, 1, 11, 31, 931, 931, 3931, 8931, 62, 63, 'NFAAAA', 'IPFAAA', 'OOOOxx'),
+(557, 3779, 1, 1, 7, 17, 57, 557, 557, 557, 557, 114, 115, 'LVAAAA', 'JPFAAA', 'VVVVxx'),
+(5546, 3780, 0, 2, 6, 6, 46, 546, 1546, 546, 5546, 92, 93, 'IFAAAA', 'KPFAAA', 'AAAAxx'),
+(7527, 3781, 1, 3, 7, 7, 27, 527, 1527, 2527, 7527, 54, 55, 'NDAAAA', 'LPFAAA', 'HHHHxx'),
+(5000, 3782, 0, 0, 0, 0, 0, 0, 1000, 0, 5000, 0, 1, 'IKAAAA', 'MPFAAA', 'OOOOxx'),
+(7587, 3783, 1, 3, 7, 7, 87, 587, 1587, 2587, 7587, 174, 175, 'VFAAAA', 'NPFAAA', 'VVVVxx'),
+(3014, 3784, 0, 2, 4, 14, 14, 14, 1014, 3014, 3014, 28, 29, 'YLAAAA', 'OPFAAA', 'AAAAxx'),
+(5276, 3785, 0, 0, 6, 16, 76, 276, 1276, 276, 5276, 152, 153, 'YUAAAA', 'PPFAAA', 'HHHHxx'),
+(6457, 3786, 1, 1, 7, 17, 57, 457, 457, 1457, 6457, 114, 115, 'JOAAAA', 'QPFAAA', 'OOOOxx'),
+(389, 3787, 1, 1, 9, 9, 89, 389, 389, 389, 389, 178, 179, 'ZOAAAA', 'RPFAAA', 'VVVVxx'),
+(7104, 3788, 0, 0, 4, 4, 4, 104, 1104, 2104, 7104, 8, 9, 'GNAAAA', 'SPFAAA', 'AAAAxx'),
+(9995, 3789, 1, 3, 5, 15, 95, 995, 1995, 4995, 9995, 190, 191, 'LUAAAA', 'TPFAAA', 'HHHHxx'),
+(7368, 3790, 0, 0, 8, 8, 68, 368, 1368, 2368, 7368, 136, 137, 'KXAAAA', 'UPFAAA', 'OOOOxx'),
+(3258, 3791, 0, 2, 8, 18, 58, 258, 1258, 3258, 3258, 116, 117, 'IVAAAA', 'VPFAAA', 'VVVVxx'),
+(9208, 3792, 0, 0, 8, 8, 8, 208, 1208, 4208, 9208, 16, 17, 'EQAAAA', 'WPFAAA', 'AAAAxx'),
+(2396, 3793, 0, 0, 6, 16, 96, 396, 396, 2396, 2396, 192, 193, 'EOAAAA', 'XPFAAA', 'HHHHxx'),
+(1715, 3794, 1, 3, 5, 15, 15, 715, 1715, 1715, 1715, 30, 31, 'ZNAAAA', 'YPFAAA', 'OOOOxx'),
+(1240, 3795, 0, 0, 0, 0, 40, 240, 1240, 1240, 1240, 80, 81, 'SVAAAA', 'ZPFAAA', 'VVVVxx'),
+(1952, 3796, 0, 0, 2, 12, 52, 952, 1952, 1952, 1952, 104, 105, 'CXAAAA', 'AQFAAA', 'AAAAxx'),
+(4403, 3797, 1, 3, 3, 3, 3, 403, 403, 4403, 4403, 6, 7, 'JNAAAA', 'BQFAAA', 'HHHHxx'),
+(6333, 3798, 1, 1, 3, 13, 33, 333, 333, 1333, 6333, 66, 67, 'PJAAAA', 'CQFAAA', 'OOOOxx'),
+(2492, 3799, 0, 0, 2, 12, 92, 492, 492, 2492, 2492, 184, 185, 'WRAAAA', 'DQFAAA', 'VVVVxx'),
+(6543, 3800, 1, 3, 3, 3, 43, 543, 543, 1543, 6543, 86, 87, 'RRAAAA', 'EQFAAA', 'AAAAxx'),
+(5548, 3801, 0, 0, 8, 8, 48, 548, 1548, 548, 5548, 96, 97, 'KFAAAA', 'FQFAAA', 'HHHHxx'),
+(3458, 3802, 0, 2, 8, 18, 58, 458, 1458, 3458, 3458, 116, 117, 'ADAAAA', 'GQFAAA', 'OOOOxx'),
+(2588, 3803, 0, 0, 8, 8, 88, 588, 588, 2588, 2588, 176, 177, 'OVAAAA', 'HQFAAA', 'VVVVxx'),
+(1364, 3804, 0, 0, 4, 4, 64, 364, 1364, 1364, 1364, 128, 129, 'MAAAAA', 'IQFAAA', 'AAAAxx'),
+(9856, 3805, 0, 0, 6, 16, 56, 856, 1856, 4856, 9856, 112, 113, 'CPAAAA', 'JQFAAA', 'HHHHxx'),
+(4964, 3806, 0, 0, 4, 4, 64, 964, 964, 4964, 4964, 128, 129, 'YIAAAA', 'KQFAAA', 'OOOOxx'),
+(773, 3807, 1, 1, 3, 13, 73, 773, 773, 773, 773, 146, 147, 'TDAAAA', 'LQFAAA', 'VVVVxx'),
+(6402, 3808, 0, 2, 2, 2, 2, 402, 402, 1402, 6402, 4, 5, 'GMAAAA', 'MQFAAA', 'AAAAxx'),
+(7213, 3809, 1, 1, 3, 13, 13, 213, 1213, 2213, 7213, 26, 27, 'LRAAAA', 'NQFAAA', 'HHHHxx'),
+(3385, 3810, 1, 1, 5, 5, 85, 385, 1385, 3385, 3385, 170, 171, 'FAAAAA', 'OQFAAA', 'OOOOxx'),
+(6005, 3811, 1, 1, 5, 5, 5, 5, 5, 1005, 6005, 10, 11, 'ZWAAAA', 'PQFAAA', 'VVVVxx'),
+(9346, 3812, 0, 2, 6, 6, 46, 346, 1346, 4346, 9346, 92, 93, 'MVAAAA', 'QQFAAA', 'AAAAxx'),
+(1831, 3813, 1, 3, 1, 11, 31, 831, 1831, 1831, 1831, 62, 63, 'LSAAAA', 'RQFAAA', 'HHHHxx'),
+(5406, 3814, 0, 2, 6, 6, 6, 406, 1406, 406, 5406, 12, 13, 'YZAAAA', 'SQFAAA', 'OOOOxx'),
+(2154, 3815, 0, 2, 4, 14, 54, 154, 154, 2154, 2154, 108, 109, 'WEAAAA', 'TQFAAA', 'VVVVxx'),
+(3721, 3816, 1, 1, 1, 1, 21, 721, 1721, 3721, 3721, 42, 43, 'DNAAAA', 'UQFAAA', 'AAAAxx'),
+(2889, 3817, 1, 1, 9, 9, 89, 889, 889, 2889, 2889, 178, 179, 'DHAAAA', 'VQFAAA', 'HHHHxx'),
+(4410, 3818, 0, 2, 0, 10, 10, 410, 410, 4410, 4410, 20, 21, 'QNAAAA', 'WQFAAA', 'OOOOxx'),
+(7102, 3819, 0, 2, 2, 2, 2, 102, 1102, 2102, 7102, 4, 5, 'ENAAAA', 'XQFAAA', 'VVVVxx'),
+(4057, 3820, 1, 1, 7, 17, 57, 57, 57, 4057, 4057, 114, 115, 'BAAAAA', 'YQFAAA', 'AAAAxx'),
+(9780, 3821, 0, 0, 0, 0, 80, 780, 1780, 4780, 9780, 160, 161, 'EMAAAA', 'ZQFAAA', 'HHHHxx'),
+(9481, 3822, 1, 1, 1, 1, 81, 481, 1481, 4481, 9481, 162, 163, 'RAAAAA', 'ARFAAA', 'OOOOxx'),
+(2366, 3823, 0, 2, 6, 6, 66, 366, 366, 2366, 2366, 132, 133, 'ANAAAA', 'BRFAAA', 'VVVVxx'),
+(2708, 3824, 0, 0, 8, 8, 8, 708, 708, 2708, 2708, 16, 17, 'EAAAAA', 'CRFAAA', 'AAAAxx'),
+(7399, 3825, 1, 3, 9, 19, 99, 399, 1399, 2399, 7399, 198, 199, 'PYAAAA', 'DRFAAA', 'HHHHxx'),
+(5234, 3826, 0, 2, 4, 14, 34, 234, 1234, 234, 5234, 68, 69, 'ITAAAA', 'ERFAAA', 'OOOOxx'),
+(1843, 3827, 1, 3, 3, 3, 43, 843, 1843, 1843, 1843, 86, 87, 'XSAAAA', 'FRFAAA', 'VVVVxx'),
+(1006, 3828, 0, 2, 6, 6, 6, 6, 1006, 1006, 1006, 12, 13, 'SMAAAA', 'GRFAAA', 'AAAAxx'),
+(7696, 3829, 0, 0, 6, 16, 96, 696, 1696, 2696, 7696, 192, 193, 'AKAAAA', 'HRFAAA', 'HHHHxx'),
+(6411, 3830, 1, 3, 1, 11, 11, 411, 411, 1411, 6411, 22, 23, 'PMAAAA', 'IRFAAA', 'OOOOxx'),
+(3913, 3831, 1, 1, 3, 13, 13, 913, 1913, 3913, 3913, 26, 27, 'NUAAAA', 'JRFAAA', 'VVVVxx'),
+(2538, 3832, 0, 2, 8, 18, 38, 538, 538, 2538, 2538, 76, 77, 'QTAAAA', 'KRFAAA', 'AAAAxx'),
+(3019, 3833, 1, 3, 9, 19, 19, 19, 1019, 3019, 3019, 38, 39, 'DMAAAA', 'LRFAAA', 'HHHHxx'),
+(107, 3834, 1, 3, 7, 7, 7, 107, 107, 107, 107, 14, 15, 'DEAAAA', 'MRFAAA', 'OOOOxx'),
+(427, 3835, 1, 3, 7, 7, 27, 427, 427, 427, 427, 54, 55, 'LQAAAA', 'NRFAAA', 'VVVVxx'),
+(9849, 3836, 1, 1, 9, 9, 49, 849, 1849, 4849, 9849, 98, 99, 'VOAAAA', 'ORFAAA', 'AAAAxx'),
+(4195, 3837, 1, 3, 5, 15, 95, 195, 195, 4195, 4195, 190, 191, 'JFAAAA', 'PRFAAA', 'HHHHxx'),
+(9215, 3838, 1, 3, 5, 15, 15, 215, 1215, 4215, 9215, 30, 31, 'LQAAAA', 'QRFAAA', 'OOOOxx'),
+(3165, 3839, 1, 1, 5, 5, 65, 165, 1165, 3165, 3165, 130, 131, 'TRAAAA', 'RRFAAA', 'VVVVxx'),
+(3280, 3840, 0, 0, 0, 0, 80, 280, 1280, 3280, 3280, 160, 161, 'EWAAAA', 'SRFAAA', 'AAAAxx'),
+(4477, 3841, 1, 1, 7, 17, 77, 477, 477, 4477, 4477, 154, 155, 'FQAAAA', 'TRFAAA', 'HHHHxx'),
+(5885, 3842, 1, 1, 5, 5, 85, 885, 1885, 885, 5885, 170, 171, 'JSAAAA', 'URFAAA', 'OOOOxx'),
+(3311, 3843, 1, 3, 1, 11, 11, 311, 1311, 3311, 3311, 22, 23, 'JXAAAA', 'VRFAAA', 'VVVVxx'),
+(6453, 3844, 1, 1, 3, 13, 53, 453, 453, 1453, 6453, 106, 107, 'FOAAAA', 'WRFAAA', 'AAAAxx'),
+(8527, 3845, 1, 3, 7, 7, 27, 527, 527, 3527, 8527, 54, 55, 'ZPAAAA', 'XRFAAA', 'HHHHxx'),
+(1921, 3846, 1, 1, 1, 1, 21, 921, 1921, 1921, 1921, 42, 43, 'XVAAAA', 'YRFAAA', 'OOOOxx'),
+(2427, 3847, 1, 3, 7, 7, 27, 427, 427, 2427, 2427, 54, 55, 'JPAAAA', 'ZRFAAA', 'VVVVxx'),
+(3691, 3848, 1, 3, 1, 11, 91, 691, 1691, 3691, 3691, 182, 183, 'ZLAAAA', 'ASFAAA', 'AAAAxx'),
+(3882, 3849, 0, 2, 2, 2, 82, 882, 1882, 3882, 3882, 164, 165, 'ITAAAA', 'BSFAAA', 'HHHHxx'),
+(562, 3850, 0, 2, 2, 2, 62, 562, 562, 562, 562, 124, 125, 'QVAAAA', 'CSFAAA', 'OOOOxx'),
+(377, 3851, 1, 1, 7, 17, 77, 377, 377, 377, 377, 154, 155, 'NOAAAA', 'DSFAAA', 'VVVVxx'),
+(1497, 3852, 1, 1, 7, 17, 97, 497, 1497, 1497, 1497, 194, 195, 'PFAAAA', 'ESFAAA', 'AAAAxx'),
+(4453, 3853, 1, 1, 3, 13, 53, 453, 453, 4453, 4453, 106, 107, 'HPAAAA', 'FSFAAA', 'HHHHxx'),
+(4678, 3854, 0, 2, 8, 18, 78, 678, 678, 4678, 4678, 156, 157, 'YXAAAA', 'GSFAAA', 'OOOOxx'),
+(2234, 3855, 0, 2, 4, 14, 34, 234, 234, 2234, 2234, 68, 69, 'YHAAAA', 'HSFAAA', 'VVVVxx'),
+(1073, 3856, 1, 1, 3, 13, 73, 73, 1073, 1073, 1073, 146, 147, 'HPAAAA', 'ISFAAA', 'AAAAxx'),
+(6479, 3857, 1, 3, 9, 19, 79, 479, 479, 1479, 6479, 158, 159, 'FPAAAA', 'JSFAAA', 'HHHHxx'),
+(5665, 3858, 1, 1, 5, 5, 65, 665, 1665, 665, 5665, 130, 131, 'XJAAAA', 'KSFAAA', 'OOOOxx'),
+(586, 3859, 0, 2, 6, 6, 86, 586, 586, 586, 586, 172, 173, 'OWAAAA', 'LSFAAA', 'VVVVxx'),
+(1584, 3860, 0, 0, 4, 4, 84, 584, 1584, 1584, 1584, 168, 169, 'YIAAAA', 'MSFAAA', 'AAAAxx'),
+(2574, 3861, 0, 2, 4, 14, 74, 574, 574, 2574, 2574, 148, 149, 'AVAAAA', 'NSFAAA', 'HHHHxx'),
+(9833, 3862, 1, 1, 3, 13, 33, 833, 1833, 4833, 9833, 66, 67, 'FOAAAA', 'OSFAAA', 'OOOOxx'),
+(6726, 3863, 0, 2, 6, 6, 26, 726, 726, 1726, 6726, 52, 53, 'SYAAAA', 'PSFAAA', 'VVVVxx'),
+(8497, 3864, 1, 1, 7, 17, 97, 497, 497, 3497, 8497, 194, 195, 'VOAAAA', 'QSFAAA', 'AAAAxx'),
+(2914, 3865, 0, 2, 4, 14, 14, 914, 914, 2914, 2914, 28, 29, 'CIAAAA', 'RSFAAA', 'HHHHxx'),
+(8586, 3866, 0, 2, 6, 6, 86, 586, 586, 3586, 8586, 172, 173, 'GSAAAA', 'SSFAAA', 'OOOOxx'),
+(6973, 3867, 1, 1, 3, 13, 73, 973, 973, 1973, 6973, 146, 147, 'FIAAAA', 'TSFAAA', 'VVVVxx'),
+(1322, 3868, 0, 2, 2, 2, 22, 322, 1322, 1322, 1322, 44, 45, 'WYAAAA', 'USFAAA', 'AAAAxx'),
+(5242, 3869, 0, 2, 2, 2, 42, 242, 1242, 242, 5242, 84, 85, 'QTAAAA', 'VSFAAA', 'HHHHxx'),
+(5581, 3870, 1, 1, 1, 1, 81, 581, 1581, 581, 5581, 162, 163, 'RGAAAA', 'WSFAAA', 'OOOOxx'),
+(1365, 3871, 1, 1, 5, 5, 65, 365, 1365, 1365, 1365, 130, 131, 'NAAAAA', 'XSFAAA', 'VVVVxx'),
+(2818, 3872, 0, 2, 8, 18, 18, 818, 818, 2818, 2818, 36, 37, 'KEAAAA', 'YSFAAA', 'AAAAxx'),
+(3758, 3873, 0, 2, 8, 18, 58, 758, 1758, 3758, 3758, 116, 117, 'OOAAAA', 'ZSFAAA', 'HHHHxx'),
+(2665, 3874, 1, 1, 5, 5, 65, 665, 665, 2665, 2665, 130, 131, 'NYAAAA', 'ATFAAA', 'OOOOxx'),
+(9823, 3875, 1, 3, 3, 3, 23, 823, 1823, 4823, 9823, 46, 47, 'VNAAAA', 'BTFAAA', 'VVVVxx'),
+(7057, 3876, 1, 1, 7, 17, 57, 57, 1057, 2057, 7057, 114, 115, 'LLAAAA', 'CTFAAA', 'AAAAxx'),
+(543, 3877, 1, 3, 3, 3, 43, 543, 543, 543, 543, 86, 87, 'XUAAAA', 'DTFAAA', 'HHHHxx'),
+(4008, 3878, 0, 0, 8, 8, 8, 8, 8, 4008, 4008, 16, 17, 'EYAAAA', 'ETFAAA', 'OOOOxx'),
+(4397, 3879, 1, 1, 7, 17, 97, 397, 397, 4397, 4397, 194, 195, 'DNAAAA', 'FTFAAA', 'VVVVxx'),
+(8533, 3880, 1, 1, 3, 13, 33, 533, 533, 3533, 8533, 66, 67, 'FQAAAA', 'GTFAAA', 'AAAAxx'),
+(9728, 3881, 0, 0, 8, 8, 28, 728, 1728, 4728, 9728, 56, 57, 'EKAAAA', 'HTFAAA', 'HHHHxx'),
+(5198, 3882, 0, 2, 8, 18, 98, 198, 1198, 198, 5198, 196, 197, 'YRAAAA', 'ITFAAA', 'OOOOxx'),
+(5036, 3883, 0, 0, 6, 16, 36, 36, 1036, 36, 5036, 72, 73, 'SLAAAA', 'JTFAAA', 'VVVVxx'),
+(4394, 3884, 0, 2, 4, 14, 94, 394, 394, 4394, 4394, 188, 189, 'ANAAAA', 'KTFAAA', 'AAAAxx'),
+(9633, 3885, 1, 1, 3, 13, 33, 633, 1633, 4633, 9633, 66, 67, 'NGAAAA', 'LTFAAA', 'HHHHxx'),
+(3339, 3886, 1, 3, 9, 19, 39, 339, 1339, 3339, 3339, 78, 79, 'LYAAAA', 'MTFAAA', 'OOOOxx'),
+(9529, 3887, 1, 1, 9, 9, 29, 529, 1529, 4529, 9529, 58, 59, 'NCAAAA', 'NTFAAA', 'VVVVxx'),
+(4780, 3888, 0, 0, 0, 0, 80, 780, 780, 4780, 4780, 160, 161, 'WBAAAA', 'OTFAAA', 'AAAAxx'),
+(4862, 3889, 0, 2, 2, 2, 62, 862, 862, 4862, 4862, 124, 125, 'AFAAAA', 'PTFAAA', 'HHHHxx'),
+(8152, 3890, 0, 0, 2, 12, 52, 152, 152, 3152, 8152, 104, 105, 'OBAAAA', 'QTFAAA', 'OOOOxx'),
+(9330, 3891, 0, 2, 0, 10, 30, 330, 1330, 4330, 9330, 60, 61, 'WUAAAA', 'RTFAAA', 'VVVVxx'),
+(4362, 3892, 0, 2, 2, 2, 62, 362, 362, 4362, 4362, 124, 125, 'ULAAAA', 'STFAAA', 'AAAAxx'),
+(4688, 3893, 0, 0, 8, 8, 88, 688, 688, 4688, 4688, 176, 177, 'IYAAAA', 'TTFAAA', 'HHHHxx'),
+(1903, 3894, 1, 3, 3, 3, 3, 903, 1903, 1903, 1903, 6, 7, 'FVAAAA', 'UTFAAA', 'OOOOxx'),
+(9027, 3895, 1, 3, 7, 7, 27, 27, 1027, 4027, 9027, 54, 55, 'FJAAAA', 'VTFAAA', 'VVVVxx'),
+(5385, 3896, 1, 1, 5, 5, 85, 385, 1385, 385, 5385, 170, 171, 'DZAAAA', 'WTFAAA', 'AAAAxx'),
+(9854, 3897, 0, 2, 4, 14, 54, 854, 1854, 4854, 9854, 108, 109, 'APAAAA', 'XTFAAA', 'HHHHxx'),
+(9033, 3898, 1, 1, 3, 13, 33, 33, 1033, 4033, 9033, 66, 67, 'LJAAAA', 'YTFAAA', 'OOOOxx'),
+(3185, 3899, 1, 1, 5, 5, 85, 185, 1185, 3185, 3185, 170, 171, 'NSAAAA', 'ZTFAAA', 'VVVVxx'),
+(2618, 3900, 0, 2, 8, 18, 18, 618, 618, 2618, 2618, 36, 37, 'SWAAAA', 'AUFAAA', 'AAAAxx'),
+(371, 3901, 1, 3, 1, 11, 71, 371, 371, 371, 371, 142, 143, 'HOAAAA', 'BUFAAA', 'HHHHxx'),
+(3697, 3902, 1, 1, 7, 17, 97, 697, 1697, 3697, 3697, 194, 195, 'FMAAAA', 'CUFAAA', 'OOOOxx'),
+(1682, 3903, 0, 2, 2, 2, 82, 682, 1682, 1682, 1682, 164, 165, 'SMAAAA', 'DUFAAA', 'VVVVxx'),
+(3333, 3904, 1, 1, 3, 13, 33, 333, 1333, 3333, 3333, 66, 67, 'FYAAAA', 'EUFAAA', 'AAAAxx'),
+(1722, 3905, 0, 2, 2, 2, 22, 722, 1722, 1722, 1722, 44, 45, 'GOAAAA', 'FUFAAA', 'HHHHxx'),
+(2009, 3906, 1, 1, 9, 9, 9, 9, 9, 2009, 2009, 18, 19, 'HZAAAA', 'GUFAAA', 'OOOOxx'),
+(3517, 3907, 1, 1, 7, 17, 17, 517, 1517, 3517, 3517, 34, 35, 'HFAAAA', 'HUFAAA', 'VVVVxx'),
+(7640, 3908, 0, 0, 0, 0, 40, 640, 1640, 2640, 7640, 80, 81, 'WHAAAA', 'IUFAAA', 'AAAAxx'),
+(259, 3909, 1, 3, 9, 19, 59, 259, 259, 259, 259, 118, 119, 'ZJAAAA', 'JUFAAA', 'HHHHxx'),
+(1400, 3910, 0, 0, 0, 0, 0, 400, 1400, 1400, 1400, 0, 1, 'WBAAAA', 'KUFAAA', 'OOOOxx'),
+(6663, 3911, 1, 3, 3, 3, 63, 663, 663, 1663, 6663, 126, 127, 'HWAAAA', 'LUFAAA', 'VVVVxx'),
+(1576, 3912, 0, 0, 6, 16, 76, 576, 1576, 1576, 1576, 152, 153, 'QIAAAA', 'MUFAAA', 'AAAAxx'),
+(8843, 3913, 1, 3, 3, 3, 43, 843, 843, 3843, 8843, 86, 87, 'DCAAAA', 'NUFAAA', 'HHHHxx'),
+(9474, 3914, 0, 2, 4, 14, 74, 474, 1474, 4474, 9474, 148, 149, 'KAAAAA', 'OUFAAA', 'OOOOxx'),
+(1597, 3915, 1, 1, 7, 17, 97, 597, 1597, 1597, 1597, 194, 195, 'LJAAAA', 'PUFAAA', 'VVVVxx'),
+(1143, 3916, 1, 3, 3, 3, 43, 143, 1143, 1143, 1143, 86, 87, 'ZRAAAA', 'QUFAAA', 'AAAAxx'),
+(4162, 3917, 0, 2, 2, 2, 62, 162, 162, 4162, 4162, 124, 125, 'CEAAAA', 'RUFAAA', 'HHHHxx'),
+(1301, 3918, 1, 1, 1, 1, 1, 301, 1301, 1301, 1301, 2, 3, 'BYAAAA', 'SUFAAA', 'OOOOxx'),
+(2935, 3919, 1, 3, 5, 15, 35, 935, 935, 2935, 2935, 70, 71, 'XIAAAA', 'TUFAAA', 'VVVVxx'),
+(886, 3920, 0, 2, 6, 6, 86, 886, 886, 886, 886, 172, 173, 'CIAAAA', 'UUFAAA', 'AAAAxx'),
+(1661, 3921, 1, 1, 1, 1, 61, 661, 1661, 1661, 1661, 122, 123, 'XLAAAA', 'VUFAAA', 'HHHHxx'),
+(1026, 3922, 0, 2, 6, 6, 26, 26, 1026, 1026, 1026, 52, 53, 'MNAAAA', 'WUFAAA', 'OOOOxx'),
+(7034, 3923, 0, 2, 4, 14, 34, 34, 1034, 2034, 7034, 68, 69, 'OKAAAA', 'XUFAAA', 'VVVVxx'),
+(2305, 3924, 1, 1, 5, 5, 5, 305, 305, 2305, 2305, 10, 11, 'RKAAAA', 'YUFAAA', 'AAAAxx'),
+(1725, 3925, 1, 1, 5, 5, 25, 725, 1725, 1725, 1725, 50, 51, 'JOAAAA', 'ZUFAAA', 'HHHHxx'),
+(909, 3926, 1, 1, 9, 9, 9, 909, 909, 909, 909, 18, 19, 'ZIAAAA', 'AVFAAA', 'OOOOxx'),
+(9906, 3927, 0, 2, 6, 6, 6, 906, 1906, 4906, 9906, 12, 13, 'ARAAAA', 'BVFAAA', 'VVVVxx'),
+(3309, 3928, 1, 1, 9, 9, 9, 309, 1309, 3309, 3309, 18, 19, 'HXAAAA', 'CVFAAA', 'AAAAxx'),
+(515, 3929, 1, 3, 5, 15, 15, 515, 515, 515, 515, 30, 31, 'VTAAAA', 'DVFAAA', 'HHHHxx'),
+(932, 3930, 0, 0, 2, 12, 32, 932, 932, 932, 932, 64, 65, 'WJAAAA', 'EVFAAA', 'OOOOxx'),
+(8144, 3931, 0, 0, 4, 4, 44, 144, 144, 3144, 8144, 88, 89, 'GBAAAA', 'FVFAAA', 'VVVVxx'),
+(5592, 3932, 0, 0, 2, 12, 92, 592, 1592, 592, 5592, 184, 185, 'CHAAAA', 'GVFAAA', 'AAAAxx'),
+(4003, 3933, 1, 3, 3, 3, 3, 3, 3, 4003, 4003, 6, 7, 'ZXAAAA', 'HVFAAA', 'HHHHxx'),
+(9566, 3934, 0, 2, 6, 6, 66, 566, 1566, 4566, 9566, 132, 133, 'YDAAAA', 'IVFAAA', 'OOOOxx'),
+(4556, 3935, 0, 0, 6, 16, 56, 556, 556, 4556, 4556, 112, 113, 'GTAAAA', 'JVFAAA', 'VVVVxx'),
+(268, 3936, 0, 0, 8, 8, 68, 268, 268, 268, 268, 136, 137, 'IKAAAA', 'KVFAAA', 'AAAAxx'),
+(8107, 3937, 1, 3, 7, 7, 7, 107, 107, 3107, 8107, 14, 15, 'VZAAAA', 'LVFAAA', 'HHHHxx'),
+(5816, 3938, 0, 0, 6, 16, 16, 816, 1816, 816, 5816, 32, 33, 'SPAAAA', 'MVFAAA', 'OOOOxx'),
+(8597, 3939, 1, 1, 7, 17, 97, 597, 597, 3597, 8597, 194, 195, 'RSAAAA', 'NVFAAA', 'VVVVxx'),
+(9611, 3940, 1, 3, 1, 11, 11, 611, 1611, 4611, 9611, 22, 23, 'RFAAAA', 'OVFAAA', 'AAAAxx'),
+(8070, 3941, 0, 2, 0, 10, 70, 70, 70, 3070, 8070, 140, 141, 'KYAAAA', 'PVFAAA', 'HHHHxx'),
+(6040, 3942, 0, 0, 0, 0, 40, 40, 40, 1040, 6040, 80, 81, 'IYAAAA', 'QVFAAA', 'OOOOxx'),
+(3184, 3943, 0, 0, 4, 4, 84, 184, 1184, 3184, 3184, 168, 169, 'MSAAAA', 'RVFAAA', 'VVVVxx'),
+(9656, 3944, 0, 0, 6, 16, 56, 656, 1656, 4656, 9656, 112, 113, 'KHAAAA', 'SVFAAA', 'AAAAxx'),
+(1577, 3945, 1, 1, 7, 17, 77, 577, 1577, 1577, 1577, 154, 155, 'RIAAAA', 'TVFAAA', 'HHHHxx'),
+(1805, 3946, 1, 1, 5, 5, 5, 805, 1805, 1805, 1805, 10, 11, 'LRAAAA', 'UVFAAA', 'OOOOxx'),
+(8268, 3947, 0, 0, 8, 8, 68, 268, 268, 3268, 8268, 136, 137, 'AGAAAA', 'VVFAAA', 'VVVVxx'),
+(3489, 3948, 1, 1, 9, 9, 89, 489, 1489, 3489, 3489, 178, 179, 'FEAAAA', 'WVFAAA', 'AAAAxx'),
+(4564, 3949, 0, 0, 4, 4, 64, 564, 564, 4564, 4564, 128, 129, 'OTAAAA', 'XVFAAA', 'HHHHxx'),
+(4006, 3950, 0, 2, 6, 6, 6, 6, 6, 4006, 4006, 12, 13, 'CYAAAA', 'YVFAAA', 'OOOOxx'),
+(8466, 3951, 0, 2, 6, 6, 66, 466, 466, 3466, 8466, 132, 133, 'QNAAAA', 'ZVFAAA', 'VVVVxx'),
+(938, 3952, 0, 2, 8, 18, 38, 938, 938, 938, 938, 76, 77, 'CKAAAA', 'AWFAAA', 'AAAAxx'),
+(5944, 3953, 0, 0, 4, 4, 44, 944, 1944, 944, 5944, 88, 89, 'QUAAAA', 'BWFAAA', 'HHHHxx'),
+(8363, 3954, 1, 3, 3, 3, 63, 363, 363, 3363, 8363, 126, 127, 'RJAAAA', 'CWFAAA', 'OOOOxx'),
+(5348, 3955, 0, 0, 8, 8, 48, 348, 1348, 348, 5348, 96, 97, 'SXAAAA', 'DWFAAA', 'VVVVxx'),
+(71, 3956, 1, 3, 1, 11, 71, 71, 71, 71, 71, 142, 143, 'TCAAAA', 'EWFAAA', 'AAAAxx'),
+(3620, 3957, 0, 0, 0, 0, 20, 620, 1620, 3620, 3620, 40, 41, 'GJAAAA', 'FWFAAA', 'HHHHxx'),
+(3230, 3958, 0, 2, 0, 10, 30, 230, 1230, 3230, 3230, 60, 61, 'GUAAAA', 'GWFAAA', 'OOOOxx'),
+(6132, 3959, 0, 0, 2, 12, 32, 132, 132, 1132, 6132, 64, 65, 'WBAAAA', 'HWFAAA', 'VVVVxx'),
+(6143, 3960, 1, 3, 3, 3, 43, 143, 143, 1143, 6143, 86, 87, 'HCAAAA', 'IWFAAA', 'AAAAxx'),
+(8781, 3961, 1, 1, 1, 1, 81, 781, 781, 3781, 8781, 162, 163, 'TZAAAA', 'JWFAAA', 'HHHHxx'),
+(5522, 3962, 0, 2, 2, 2, 22, 522, 1522, 522, 5522, 44, 45, 'KEAAAA', 'KWFAAA', 'OOOOxx'),
+(6320, 3963, 0, 0, 0, 0, 20, 320, 320, 1320, 6320, 40, 41, 'CJAAAA', 'LWFAAA', 'VVVVxx'),
+(3923, 3964, 1, 3, 3, 3, 23, 923, 1923, 3923, 3923, 46, 47, 'XUAAAA', 'MWFAAA', 'AAAAxx'),
+(2207, 3965, 1, 3, 7, 7, 7, 207, 207, 2207, 2207, 14, 15, 'XGAAAA', 'NWFAAA', 'HHHHxx'),
+(966, 3966, 0, 2, 6, 6, 66, 966, 966, 966, 966, 132, 133, 'ELAAAA', 'OWFAAA', 'OOOOxx'),
+(9020, 3967, 0, 0, 0, 0, 20, 20, 1020, 4020, 9020, 40, 41, 'YIAAAA', 'PWFAAA', 'VVVVxx'),
+(4616, 3968, 0, 0, 6, 16, 16, 616, 616, 4616, 4616, 32, 33, 'OVAAAA', 'QWFAAA', 'AAAAxx'),
+(8289, 3969, 1, 1, 9, 9, 89, 289, 289, 3289, 8289, 178, 179, 'VGAAAA', 'RWFAAA', 'HHHHxx'),
+(5796, 3970, 0, 0, 6, 16, 96, 796, 1796, 796, 5796, 192, 193, 'YOAAAA', 'SWFAAA', 'OOOOxx'),
+(9259, 3971, 1, 3, 9, 19, 59, 259, 1259, 4259, 9259, 118, 119, 'DSAAAA', 'TWFAAA', 'VVVVxx'),
+(3710, 3972, 0, 2, 0, 10, 10, 710, 1710, 3710, 3710, 20, 21, 'SMAAAA', 'UWFAAA', 'AAAAxx'),
+(251, 3973, 1, 3, 1, 11, 51, 251, 251, 251, 251, 102, 103, 'RJAAAA', 'VWFAAA', 'HHHHxx'),
+(7669, 3974, 1, 1, 9, 9, 69, 669, 1669, 2669, 7669, 138, 139, 'ZIAAAA', 'WWFAAA', 'OOOOxx'),
+(6304, 3975, 0, 0, 4, 4, 4, 304, 304, 1304, 6304, 8, 9, 'MIAAAA', 'XWFAAA', 'VVVVxx'),
+(6454, 3976, 0, 2, 4, 14, 54, 454, 454, 1454, 6454, 108, 109, 'GOAAAA', 'YWFAAA', 'AAAAxx'),
+(1489, 3977, 1, 1, 9, 9, 89, 489, 1489, 1489, 1489, 178, 179, 'HFAAAA', 'ZWFAAA', 'HHHHxx'),
+(715, 3978, 1, 3, 5, 15, 15, 715, 715, 715, 715, 30, 31, 'NBAAAA', 'AXFAAA', 'OOOOxx'),
+(4319, 3979, 1, 3, 9, 19, 19, 319, 319, 4319, 4319, 38, 39, 'DKAAAA', 'BXFAAA', 'VVVVxx'),
+(7112, 3980, 0, 0, 2, 12, 12, 112, 1112, 2112, 7112, 24, 25, 'ONAAAA', 'CXFAAA', 'AAAAxx'),
+(3726, 3981, 0, 2, 6, 6, 26, 726, 1726, 3726, 3726, 52, 53, 'INAAAA', 'DXFAAA', 'HHHHxx'),
+(7727, 3982, 1, 3, 7, 7, 27, 727, 1727, 2727, 7727, 54, 55, 'FLAAAA', 'EXFAAA', 'OOOOxx'),
+(8387, 3983, 1, 3, 7, 7, 87, 387, 387, 3387, 8387, 174, 175, 'PKAAAA', 'FXFAAA', 'VVVVxx'),
+(6555, 3984, 1, 3, 5, 15, 55, 555, 555, 1555, 6555, 110, 111, 'DSAAAA', 'GXFAAA', 'AAAAxx'),
+(1148, 3985, 0, 0, 8, 8, 48, 148, 1148, 1148, 1148, 96, 97, 'ESAAAA', 'HXFAAA', 'HHHHxx'),
+(9000, 3986, 0, 0, 0, 0, 0, 0, 1000, 4000, 9000, 0, 1, 'EIAAAA', 'IXFAAA', 'OOOOxx'),
+(5278, 3987, 0, 2, 8, 18, 78, 278, 1278, 278, 5278, 156, 157, 'AVAAAA', 'JXFAAA', 'VVVVxx'),
+(2388, 3988, 0, 0, 8, 8, 88, 388, 388, 2388, 2388, 176, 177, 'WNAAAA', 'KXFAAA', 'AAAAxx'),
+(7984, 3989, 0, 0, 4, 4, 84, 984, 1984, 2984, 7984, 168, 169, 'CVAAAA', 'LXFAAA', 'HHHHxx'),
+(881, 3990, 1, 1, 1, 1, 81, 881, 881, 881, 881, 162, 163, 'XHAAAA', 'MXFAAA', 'OOOOxx'),
+(6830, 3991, 0, 2, 0, 10, 30, 830, 830, 1830, 6830, 60, 61, 'SCAAAA', 'NXFAAA', 'VVVVxx'),
+(7056, 3992, 0, 0, 6, 16, 56, 56, 1056, 2056, 7056, 112, 113, 'KLAAAA', 'OXFAAA', 'AAAAxx'),
+(7581, 3993, 1, 1, 1, 1, 81, 581, 1581, 2581, 7581, 162, 163, 'PFAAAA', 'PXFAAA', 'HHHHxx'),
+(5214, 3994, 0, 2, 4, 14, 14, 214, 1214, 214, 5214, 28, 29, 'OSAAAA', 'QXFAAA', 'OOOOxx'),
+(2505, 3995, 1, 1, 5, 5, 5, 505, 505, 2505, 2505, 10, 11, 'JSAAAA', 'RXFAAA', 'VVVVxx'),
+(5112, 3996, 0, 0, 2, 12, 12, 112, 1112, 112, 5112, 24, 25, 'QOAAAA', 'SXFAAA', 'AAAAxx'),
+(9884, 3997, 0, 0, 4, 4, 84, 884, 1884, 4884, 9884, 168, 169, 'EQAAAA', 'TXFAAA', 'HHHHxx'),
+(8040, 3998, 0, 0, 0, 0, 40, 40, 40, 3040, 8040, 80, 81, 'GXAAAA', 'UXFAAA', 'OOOOxx'),
+(7033, 3999, 1, 1, 3, 13, 33, 33, 1033, 2033, 7033, 66, 67, 'NKAAAA', 'VXFAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(9343, 4000, 1, 3, 3, 3, 43, 343, 1343, 4343, 9343, 86, 87, 'JVAAAA', 'WXFAAA', 'AAAAxx'),
+(2931, 4001, 1, 3, 1, 11, 31, 931, 931, 2931, 2931, 62, 63, 'TIAAAA', 'XXFAAA', 'HHHHxx'),
+(9024, 4002, 0, 0, 4, 4, 24, 24, 1024, 4024, 9024, 48, 49, 'CJAAAA', 'YXFAAA', 'OOOOxx'),
+(6485, 4003, 1, 1, 5, 5, 85, 485, 485, 1485, 6485, 170, 171, 'LPAAAA', 'ZXFAAA', 'VVVVxx'),
+(3465, 4004, 1, 1, 5, 5, 65, 465, 1465, 3465, 3465, 130, 131, 'HDAAAA', 'AYFAAA', 'AAAAxx'),
+(3357, 4005, 1, 1, 7, 17, 57, 357, 1357, 3357, 3357, 114, 115, 'DZAAAA', 'BYFAAA', 'HHHHxx'),
+(2929, 4006, 1, 1, 9, 9, 29, 929, 929, 2929, 2929, 58, 59, 'RIAAAA', 'CYFAAA', 'OOOOxx'),
+(3086, 4007, 0, 2, 6, 6, 86, 86, 1086, 3086, 3086, 172, 173, 'SOAAAA', 'DYFAAA', 'VVVVxx'),
+(8897, 4008, 1, 1, 7, 17, 97, 897, 897, 3897, 8897, 194, 195, 'FEAAAA', 'EYFAAA', 'AAAAxx'),
+(9688, 4009, 0, 0, 8, 8, 88, 688, 1688, 4688, 9688, 176, 177, 'QIAAAA', 'FYFAAA', 'HHHHxx'),
+(6522, 4010, 0, 2, 2, 2, 22, 522, 522, 1522, 6522, 44, 45, 'WQAAAA', 'GYFAAA', 'OOOOxx'),
+(3241, 4011, 1, 1, 1, 1, 41, 241, 1241, 3241, 3241, 82, 83, 'RUAAAA', 'HYFAAA', 'VVVVxx'),
+(8770, 4012, 0, 2, 0, 10, 70, 770, 770, 3770, 8770, 140, 141, 'IZAAAA', 'IYFAAA', 'AAAAxx'),
+(2884, 4013, 0, 0, 4, 4, 84, 884, 884, 2884, 2884, 168, 169, 'YGAAAA', 'JYFAAA', 'HHHHxx'),
+(9579, 4014, 1, 3, 9, 19, 79, 579, 1579, 4579, 9579, 158, 159, 'LEAAAA', 'KYFAAA', 'OOOOxx'),
+(3125, 4015, 1, 1, 5, 5, 25, 125, 1125, 3125, 3125, 50, 51, 'FQAAAA', 'LYFAAA', 'VVVVxx'),
+(4604, 4016, 0, 0, 4, 4, 4, 604, 604, 4604, 4604, 8, 9, 'CVAAAA', 'MYFAAA', 'AAAAxx'),
+(2682, 4017, 0, 2, 2, 2, 82, 682, 682, 2682, 2682, 164, 165, 'EZAAAA', 'NYFAAA', 'HHHHxx'),
+(254, 4018, 0, 2, 4, 14, 54, 254, 254, 254, 254, 108, 109, 'UJAAAA', 'OYFAAA', 'OOOOxx'),
+(6569, 4019, 1, 1, 9, 9, 69, 569, 569, 1569, 6569, 138, 139, 'RSAAAA', 'PYFAAA', 'VVVVxx'),
+(2686, 4020, 0, 2, 6, 6, 86, 686, 686, 2686, 2686, 172, 173, 'IZAAAA', 'QYFAAA', 'AAAAxx'),
+(2123, 4021, 1, 3, 3, 3, 23, 123, 123, 2123, 2123, 46, 47, 'RDAAAA', 'RYFAAA', 'HHHHxx'),
+(1745, 4022, 1, 1, 5, 5, 45, 745, 1745, 1745, 1745, 90, 91, 'DPAAAA', 'SYFAAA', 'OOOOxx'),
+(247, 4023, 1, 3, 7, 7, 47, 247, 247, 247, 247, 94, 95, 'NJAAAA', 'TYFAAA', 'VVVVxx'),
+(5800, 4024, 0, 0, 0, 0, 0, 800, 1800, 800, 5800, 0, 1, 'CPAAAA', 'UYFAAA', 'AAAAxx'),
+(1121, 4025, 1, 1, 1, 1, 21, 121, 1121, 1121, 1121, 42, 43, 'DRAAAA', 'VYFAAA', 'HHHHxx'),
+(8893, 4026, 1, 1, 3, 13, 93, 893, 893, 3893, 8893, 186, 187, 'BEAAAA', 'WYFAAA', 'OOOOxx'),
+(7819, 4027, 1, 3, 9, 19, 19, 819, 1819, 2819, 7819, 38, 39, 'TOAAAA', 'XYFAAA', 'VVVVxx'),
+(1339, 4028, 1, 3, 9, 19, 39, 339, 1339, 1339, 1339, 78, 79, 'NZAAAA', 'YYFAAA', 'AAAAxx'),
+(5680, 4029, 0, 0, 0, 0, 80, 680, 1680, 680, 5680, 160, 161, 'MKAAAA', 'ZYFAAA', 'HHHHxx'),
+(5093, 4030, 1, 1, 3, 13, 93, 93, 1093, 93, 5093, 186, 187, 'XNAAAA', 'AZFAAA', 'OOOOxx'),
+(3508, 4031, 0, 0, 8, 8, 8, 508, 1508, 3508, 3508, 16, 17, 'YEAAAA', 'BZFAAA', 'VVVVxx'),
+(933, 4032, 1, 1, 3, 13, 33, 933, 933, 933, 933, 66, 67, 'XJAAAA', 'CZFAAA', 'AAAAxx'),
+(1106, 4033, 0, 2, 6, 6, 6, 106, 1106, 1106, 1106, 12, 13, 'OQAAAA', 'DZFAAA', 'HHHHxx'),
+(4386, 4034, 0, 2, 6, 6, 86, 386, 386, 4386, 4386, 172, 173, 'SMAAAA', 'EZFAAA', 'OOOOxx'),
+(5895, 4035, 1, 3, 5, 15, 95, 895, 1895, 895, 5895, 190, 191, 'TSAAAA', 'FZFAAA', 'VVVVxx'),
+(2980, 4036, 0, 0, 0, 0, 80, 980, 980, 2980, 2980, 160, 161, 'QKAAAA', 'GZFAAA', 'AAAAxx'),
+(4400, 4037, 0, 0, 0, 0, 0, 400, 400, 4400, 4400, 0, 1, 'GNAAAA', 'HZFAAA', 'HHHHxx'),
+(7433, 4038, 1, 1, 3, 13, 33, 433, 1433, 2433, 7433, 66, 67, 'XZAAAA', 'IZFAAA', 'OOOOxx'),
+(6110, 4039, 0, 2, 0, 10, 10, 110, 110, 1110, 6110, 20, 21, 'ABAAAA', 'JZFAAA', 'VVVVxx'),
+(867, 4040, 1, 3, 7, 7, 67, 867, 867, 867, 867, 134, 135, 'JHAAAA', 'KZFAAA', 'AAAAxx'),
+(5292, 4041, 0, 0, 2, 12, 92, 292, 1292, 292, 5292, 184, 185, 'OVAAAA', 'LZFAAA', 'HHHHxx'),
+(3926, 4042, 0, 2, 6, 6, 26, 926, 1926, 3926, 3926, 52, 53, 'AVAAAA', 'MZFAAA', 'OOOOxx'),
+(1107, 4043, 1, 3, 7, 7, 7, 107, 1107, 1107, 1107, 14, 15, 'PQAAAA', 'NZFAAA', 'VVVVxx'),
+(7355, 4044, 1, 3, 5, 15, 55, 355, 1355, 2355, 7355, 110, 111, 'XWAAAA', 'OZFAAA', 'AAAAxx'),
+(4689, 4045, 1, 1, 9, 9, 89, 689, 689, 4689, 4689, 178, 179, 'JYAAAA', 'PZFAAA', 'HHHHxx'),
+(4872, 4046, 0, 0, 2, 12, 72, 872, 872, 4872, 4872, 144, 145, 'KFAAAA', 'QZFAAA', 'OOOOxx'),
+(7821, 4047, 1, 1, 1, 1, 21, 821, 1821, 2821, 7821, 42, 43, 'VOAAAA', 'RZFAAA', 'VVVVxx'),
+(7277, 4048, 1, 1, 7, 17, 77, 277, 1277, 2277, 7277, 154, 155, 'XTAAAA', 'SZFAAA', 'AAAAxx'),
+(3268, 4049, 0, 0, 8, 8, 68, 268, 1268, 3268, 3268, 136, 137, 'SVAAAA', 'TZFAAA', 'HHHHxx'),
+(8877, 4050, 1, 1, 7, 17, 77, 877, 877, 3877, 8877, 154, 155, 'LDAAAA', 'UZFAAA', 'OOOOxx'),
+(343, 4051, 1, 3, 3, 3, 43, 343, 343, 343, 343, 86, 87, 'FNAAAA', 'VZFAAA', 'VVVVxx'),
+(621, 4052, 1, 1, 1, 1, 21, 621, 621, 621, 621, 42, 43, 'XXAAAA', 'WZFAAA', 'AAAAxx'),
+(5429, 4053, 1, 1, 9, 9, 29, 429, 1429, 429, 5429, 58, 59, 'VAAAAA', 'XZFAAA', 'HHHHxx'),
+(392, 4054, 0, 0, 2, 12, 92, 392, 392, 392, 392, 184, 185, 'CPAAAA', 'YZFAAA', 'OOOOxx'),
+(6004, 4055, 0, 0, 4, 4, 4, 4, 4, 1004, 6004, 8, 9, 'YWAAAA', 'ZZFAAA', 'VVVVxx'),
+(6377, 4056, 1, 1, 7, 17, 77, 377, 377, 1377, 6377, 154, 155, 'HLAAAA', 'AAGAAA', 'AAAAxx'),
+(3037, 4057, 1, 1, 7, 17, 37, 37, 1037, 3037, 3037, 74, 75, 'VMAAAA', 'BAGAAA', 'HHHHxx'),
+(3514, 4058, 0, 2, 4, 14, 14, 514, 1514, 3514, 3514, 28, 29, 'EFAAAA', 'CAGAAA', 'OOOOxx'),
+(8740, 4059, 0, 0, 0, 0, 40, 740, 740, 3740, 8740, 80, 81, 'EYAAAA', 'DAGAAA', 'VVVVxx'),
+(3877, 4060, 1, 1, 7, 17, 77, 877, 1877, 3877, 3877, 154, 155, 'DTAAAA', 'EAGAAA', 'AAAAxx'),
+(5731, 4061, 1, 3, 1, 11, 31, 731, 1731, 731, 5731, 62, 63, 'LMAAAA', 'FAGAAA', 'HHHHxx'),
+(6407, 4062, 1, 3, 7, 7, 7, 407, 407, 1407, 6407, 14, 15, 'LMAAAA', 'GAGAAA', 'OOOOxx'),
+(2044, 4063, 0, 0, 4, 4, 44, 44, 44, 2044, 2044, 88, 89, 'QAAAAA', 'HAGAAA', 'VVVVxx'),
+(7362, 4064, 0, 2, 2, 2, 62, 362, 1362, 2362, 7362, 124, 125, 'EXAAAA', 'IAGAAA', 'AAAAxx'),
+(5458, 4065, 0, 2, 8, 18, 58, 458, 1458, 458, 5458, 116, 117, 'YBAAAA', 'JAGAAA', 'HHHHxx'),
+(6437, 4066, 1, 1, 7, 17, 37, 437, 437, 1437, 6437, 74, 75, 'PNAAAA', 'KAGAAA', 'OOOOxx'),
+(1051, 4067, 1, 3, 1, 11, 51, 51, 1051, 1051, 1051, 102, 103, 'LOAAAA', 'LAGAAA', 'VVVVxx'),
+(1203, 4068, 1, 3, 3, 3, 3, 203, 1203, 1203, 1203, 6, 7, 'HUAAAA', 'MAGAAA', 'AAAAxx'),
+(2176, 4069, 0, 0, 6, 16, 76, 176, 176, 2176, 2176, 152, 153, 'SFAAAA', 'NAGAAA', 'HHHHxx'),
+(8997, 4070, 1, 1, 7, 17, 97, 997, 997, 3997, 8997, 194, 195, 'BIAAAA', 'OAGAAA', 'OOOOxx'),
+(6378, 4071, 0, 2, 8, 18, 78, 378, 378, 1378, 6378, 156, 157, 'ILAAAA', 'PAGAAA', 'VVVVxx'),
+(6006, 4072, 0, 2, 6, 6, 6, 6, 6, 1006, 6006, 12, 13, 'AXAAAA', 'QAGAAA', 'AAAAxx'),
+(2308, 4073, 0, 0, 8, 8, 8, 308, 308, 2308, 2308, 16, 17, 'UKAAAA', 'RAGAAA', 'HHHHxx'),
+(625, 4074, 1, 1, 5, 5, 25, 625, 625, 625, 625, 50, 51, 'BYAAAA', 'SAGAAA', 'OOOOxx'),
+(7298, 4075, 0, 2, 8, 18, 98, 298, 1298, 2298, 7298, 196, 197, 'SUAAAA', 'TAGAAA', 'VVVVxx'),
+(5575, 4076, 1, 3, 5, 15, 75, 575, 1575, 575, 5575, 150, 151, 'LGAAAA', 'UAGAAA', 'AAAAxx'),
+(3565, 4077, 1, 1, 5, 5, 65, 565, 1565, 3565, 3565, 130, 131, 'DHAAAA', 'VAGAAA', 'HHHHxx'),
+(47, 4078, 1, 3, 7, 7, 47, 47, 47, 47, 47, 94, 95, 'VBAAAA', 'WAGAAA', 'OOOOxx'),
+(2413, 4079, 1, 1, 3, 13, 13, 413, 413, 2413, 2413, 26, 27, 'VOAAAA', 'XAGAAA', 'VVVVxx'),
+(2153, 4080, 1, 1, 3, 13, 53, 153, 153, 2153, 2153, 106, 107, 'VEAAAA', 'YAGAAA', 'AAAAxx'),
+(752, 4081, 0, 0, 2, 12, 52, 752, 752, 752, 752, 104, 105, 'YCAAAA', 'ZAGAAA', 'HHHHxx'),
+(4095, 4082, 1, 3, 5, 15, 95, 95, 95, 4095, 4095, 190, 191, 'NBAAAA', 'ABGAAA', 'OOOOxx'),
+(2518, 4083, 0, 2, 8, 18, 18, 518, 518, 2518, 2518, 36, 37, 'WSAAAA', 'BBGAAA', 'VVVVxx'),
+(3681, 4084, 1, 1, 1, 1, 81, 681, 1681, 3681, 3681, 162, 163, 'PLAAAA', 'CBGAAA', 'AAAAxx'),
+(4213, 4085, 1, 1, 3, 13, 13, 213, 213, 4213, 4213, 26, 27, 'BGAAAA', 'DBGAAA', 'HHHHxx'),
+(2615, 4086, 1, 3, 5, 15, 15, 615, 615, 2615, 2615, 30, 31, 'PWAAAA', 'EBGAAA', 'OOOOxx'),
+(1471, 4087, 1, 3, 1, 11, 71, 471, 1471, 1471, 1471, 142, 143, 'PEAAAA', 'FBGAAA', 'VVVVxx'),
+(7315, 4088, 1, 3, 5, 15, 15, 315, 1315, 2315, 7315, 30, 31, 'JVAAAA', 'GBGAAA', 'AAAAxx'),
+(6013, 4089, 1, 1, 3, 13, 13, 13, 13, 1013, 6013, 26, 27, 'HXAAAA', 'HBGAAA', 'HHHHxx'),
+(3077, 4090, 1, 1, 7, 17, 77, 77, 1077, 3077, 3077, 154, 155, 'JOAAAA', 'IBGAAA', 'OOOOxx'),
+(2190, 4091, 0, 2, 0, 10, 90, 190, 190, 2190, 2190, 180, 181, 'GGAAAA', 'JBGAAA', 'VVVVxx'),
+(528, 4092, 0, 0, 8, 8, 28, 528, 528, 528, 528, 56, 57, 'IUAAAA', 'KBGAAA', 'AAAAxx'),
+(9508, 4093, 0, 0, 8, 8, 8, 508, 1508, 4508, 9508, 16, 17, 'SBAAAA', 'LBGAAA', 'HHHHxx'),
+(2473, 4094, 1, 1, 3, 13, 73, 473, 473, 2473, 2473, 146, 147, 'DRAAAA', 'MBGAAA', 'OOOOxx'),
+(167, 4095, 1, 3, 7, 7, 67, 167, 167, 167, 167, 134, 135, 'LGAAAA', 'NBGAAA', 'VVVVxx'),
+(8448, 4096, 0, 0, 8, 8, 48, 448, 448, 3448, 8448, 96, 97, 'YMAAAA', 'OBGAAA', 'AAAAxx'),
+(7538, 4097, 0, 2, 8, 18, 38, 538, 1538, 2538, 7538, 76, 77, 'YDAAAA', 'PBGAAA', 'HHHHxx'),
+(7638, 4098, 0, 2, 8, 18, 38, 638, 1638, 2638, 7638, 76, 77, 'UHAAAA', 'QBGAAA', 'OOOOxx'),
+(4328, 4099, 0, 0, 8, 8, 28, 328, 328, 4328, 4328, 56, 57, 'MKAAAA', 'RBGAAA', 'VVVVxx'),
+(3812, 4100, 0, 0, 2, 12, 12, 812, 1812, 3812, 3812, 24, 25, 'QQAAAA', 'SBGAAA', 'AAAAxx'),
+(2879, 4101, 1, 3, 9, 19, 79, 879, 879, 2879, 2879, 158, 159, 'TGAAAA', 'TBGAAA', 'HHHHxx'),
+(4741, 4102, 1, 1, 1, 1, 41, 741, 741, 4741, 4741, 82, 83, 'JAAAAA', 'UBGAAA', 'OOOOxx'),
+(9155, 4103, 1, 3, 5, 15, 55, 155, 1155, 4155, 9155, 110, 111, 'DOAAAA', 'VBGAAA', 'VVVVxx'),
+(5151, 4104, 1, 3, 1, 11, 51, 151, 1151, 151, 5151, 102, 103, 'DQAAAA', 'WBGAAA', 'AAAAxx'),
+(5591, 4105, 1, 3, 1, 11, 91, 591, 1591, 591, 5591, 182, 183, 'BHAAAA', 'XBGAAA', 'HHHHxx'),
+(1034, 4106, 0, 2, 4, 14, 34, 34, 1034, 1034, 1034, 68, 69, 'UNAAAA', 'YBGAAA', 'OOOOxx'),
+(765, 4107, 1, 1, 5, 5, 65, 765, 765, 765, 765, 130, 131, 'LDAAAA', 'ZBGAAA', 'VVVVxx'),
+(2664, 4108, 0, 0, 4, 4, 64, 664, 664, 2664, 2664, 128, 129, 'MYAAAA', 'ACGAAA', 'AAAAxx'),
+(6854, 4109, 0, 2, 4, 14, 54, 854, 854, 1854, 6854, 108, 109, 'QDAAAA', 'BCGAAA', 'HHHHxx'),
+(8263, 4110, 1, 3, 3, 3, 63, 263, 263, 3263, 8263, 126, 127, 'VFAAAA', 'CCGAAA', 'OOOOxx'),
+(8658, 4111, 0, 2, 8, 18, 58, 658, 658, 3658, 8658, 116, 117, 'AVAAAA', 'DCGAAA', 'VVVVxx'),
+(587, 4112, 1, 3, 7, 7, 87, 587, 587, 587, 587, 174, 175, 'PWAAAA', 'ECGAAA', 'AAAAxx'),
+(4553, 4113, 1, 1, 3, 13, 53, 553, 553, 4553, 4553, 106, 107, 'DTAAAA', 'FCGAAA', 'HHHHxx'),
+(1368, 4114, 0, 0, 8, 8, 68, 368, 1368, 1368, 1368, 136, 137, 'QAAAAA', 'GCGAAA', 'OOOOxx'),
+(1718, 4115, 0, 2, 8, 18, 18, 718, 1718, 1718, 1718, 36, 37, 'COAAAA', 'HCGAAA', 'VVVVxx'),
+(140, 4116, 0, 0, 0, 0, 40, 140, 140, 140, 140, 80, 81, 'KFAAAA', 'ICGAAA', 'AAAAxx'),
+(8341, 4117, 1, 1, 1, 1, 41, 341, 341, 3341, 8341, 82, 83, 'VIAAAA', 'JCGAAA', 'HHHHxx'),
+(72, 4118, 0, 0, 2, 12, 72, 72, 72, 72, 72, 144, 145, 'UCAAAA', 'KCGAAA', 'OOOOxx'),
+(6589, 4119, 1, 1, 9, 9, 89, 589, 589, 1589, 6589, 178, 179, 'LTAAAA', 'LCGAAA', 'VVVVxx'),
+(2024, 4120, 0, 0, 4, 4, 24, 24, 24, 2024, 2024, 48, 49, 'WZAAAA', 'MCGAAA', 'AAAAxx'),
+(8024, 4121, 0, 0, 4, 4, 24, 24, 24, 3024, 8024, 48, 49, 'QWAAAA', 'NCGAAA', 'HHHHxx'),
+(9564, 4122, 0, 0, 4, 4, 64, 564, 1564, 4564, 9564, 128, 129, 'WDAAAA', 'OCGAAA', 'OOOOxx'),
+(8625, 4123, 1, 1, 5, 5, 25, 625, 625, 3625, 8625, 50, 51, 'TTAAAA', 'PCGAAA', 'VVVVxx'),
+(2680, 4124, 0, 0, 0, 0, 80, 680, 680, 2680, 2680, 160, 161, 'CZAAAA', 'QCGAAA', 'AAAAxx'),
+(4323, 4125, 1, 3, 3, 3, 23, 323, 323, 4323, 4323, 46, 47, 'HKAAAA', 'RCGAAA', 'HHHHxx'),
+(8981, 4126, 1, 1, 1, 1, 81, 981, 981, 3981, 8981, 162, 163, 'LHAAAA', 'SCGAAA', 'OOOOxx'),
+(8909, 4127, 1, 1, 9, 9, 9, 909, 909, 3909, 8909, 18, 19, 'REAAAA', 'TCGAAA', 'VVVVxx'),
+(5288, 4128, 0, 0, 8, 8, 88, 288, 1288, 288, 5288, 176, 177, 'KVAAAA', 'UCGAAA', 'AAAAxx'),
+(2057, 4129, 1, 1, 7, 17, 57, 57, 57, 2057, 2057, 114, 115, 'DBAAAA', 'VCGAAA', 'HHHHxx'),
+(5931, 4130, 1, 3, 1, 11, 31, 931, 1931, 931, 5931, 62, 63, 'DUAAAA', 'WCGAAA', 'OOOOxx'),
+(9794, 4131, 0, 2, 4, 14, 94, 794, 1794, 4794, 9794, 188, 189, 'SMAAAA', 'XCGAAA', 'VVVVxx'),
+(1012, 4132, 0, 0, 2, 12, 12, 12, 1012, 1012, 1012, 24, 25, 'YMAAAA', 'YCGAAA', 'AAAAxx'),
+(5496, 4133, 0, 0, 6, 16, 96, 496, 1496, 496, 5496, 192, 193, 'KDAAAA', 'ZCGAAA', 'HHHHxx'),
+(9182, 4134, 0, 2, 2, 2, 82, 182, 1182, 4182, 9182, 164, 165, 'EPAAAA', 'ADGAAA', 'OOOOxx'),
+(5258, 4135, 0, 2, 8, 18, 58, 258, 1258, 258, 5258, 116, 117, 'GUAAAA', 'BDGAAA', 'VVVVxx'),
+(3050, 4136, 0, 2, 0, 10, 50, 50, 1050, 3050, 3050, 100, 101, 'INAAAA', 'CDGAAA', 'AAAAxx'),
+(2083, 4137, 1, 3, 3, 3, 83, 83, 83, 2083, 2083, 166, 167, 'DCAAAA', 'DDGAAA', 'HHHHxx'),
+(3069, 4138, 1, 1, 9, 9, 69, 69, 1069, 3069, 3069, 138, 139, 'BOAAAA', 'EDGAAA', 'OOOOxx'),
+(8459, 4139, 1, 3, 9, 19, 59, 459, 459, 3459, 8459, 118, 119, 'JNAAAA', 'FDGAAA', 'VVVVxx'),
+(169, 4140, 1, 1, 9, 9, 69, 169, 169, 169, 169, 138, 139, 'NGAAAA', 'GDGAAA', 'AAAAxx'),
+(4379, 4141, 1, 3, 9, 19, 79, 379, 379, 4379, 4379, 158, 159, 'LMAAAA', 'HDGAAA', 'HHHHxx'),
+(5126, 4142, 0, 2, 6, 6, 26, 126, 1126, 126, 5126, 52, 53, 'EPAAAA', 'IDGAAA', 'OOOOxx'),
+(1415, 4143, 1, 3, 5, 15, 15, 415, 1415, 1415, 1415, 30, 31, 'LCAAAA', 'JDGAAA', 'VVVVxx'),
+(1163, 4144, 1, 3, 3, 3, 63, 163, 1163, 1163, 1163, 126, 127, 'TSAAAA', 'KDGAAA', 'AAAAxx'),
+(3500, 4145, 0, 0, 0, 0, 0, 500, 1500, 3500, 3500, 0, 1, 'QEAAAA', 'LDGAAA', 'HHHHxx'),
+(7202, 4146, 0, 2, 2, 2, 2, 202, 1202, 2202, 7202, 4, 5, 'ARAAAA', 'MDGAAA', 'OOOOxx'),
+(747, 4147, 1, 3, 7, 7, 47, 747, 747, 747, 747, 94, 95, 'TCAAAA', 'NDGAAA', 'VVVVxx'),
+(9264, 4148, 0, 0, 4, 4, 64, 264, 1264, 4264, 9264, 128, 129, 'ISAAAA', 'ODGAAA', 'AAAAxx'),
+(8548, 4149, 0, 0, 8, 8, 48, 548, 548, 3548, 8548, 96, 97, 'UQAAAA', 'PDGAAA', 'HHHHxx'),
+(4228, 4150, 0, 0, 8, 8, 28, 228, 228, 4228, 4228, 56, 57, 'QGAAAA', 'QDGAAA', 'OOOOxx'),
+(7122, 4151, 0, 2, 2, 2, 22, 122, 1122, 2122, 7122, 44, 45, 'YNAAAA', 'RDGAAA', 'VVVVxx'),
+(3395, 4152, 1, 3, 5, 15, 95, 395, 1395, 3395, 3395, 190, 191, 'PAAAAA', 'SDGAAA', 'AAAAxx'),
+(5674, 4153, 0, 2, 4, 14, 74, 674, 1674, 674, 5674, 148, 149, 'GKAAAA', 'TDGAAA', 'HHHHxx'),
+(7293, 4154, 1, 1, 3, 13, 93, 293, 1293, 2293, 7293, 186, 187, 'NUAAAA', 'UDGAAA', 'OOOOxx'),
+(737, 4155, 1, 1, 7, 17, 37, 737, 737, 737, 737, 74, 75, 'JCAAAA', 'VDGAAA', 'VVVVxx'),
+(9595, 4156, 1, 3, 5, 15, 95, 595, 1595, 4595, 9595, 190, 191, 'BFAAAA', 'WDGAAA', 'AAAAxx'),
+(594, 4157, 0, 2, 4, 14, 94, 594, 594, 594, 594, 188, 189, 'WWAAAA', 'XDGAAA', 'HHHHxx'),
+(5322, 4158, 0, 2, 2, 2, 22, 322, 1322, 322, 5322, 44, 45, 'SWAAAA', 'YDGAAA', 'OOOOxx'),
+(2933, 4159, 1, 1, 3, 13, 33, 933, 933, 2933, 2933, 66, 67, 'VIAAAA', 'ZDGAAA', 'VVVVxx'),
+(4955, 4160, 1, 3, 5, 15, 55, 955, 955, 4955, 4955, 110, 111, 'PIAAAA', 'AEGAAA', 'AAAAxx'),
+(4073, 4161, 1, 1, 3, 13, 73, 73, 73, 4073, 4073, 146, 147, 'RAAAAA', 'BEGAAA', 'HHHHxx'),
+(7249, 4162, 1, 1, 9, 9, 49, 249, 1249, 2249, 7249, 98, 99, 'VSAAAA', 'CEGAAA', 'OOOOxx'),
+(192, 4163, 0, 0, 2, 12, 92, 192, 192, 192, 192, 184, 185, 'KHAAAA', 'DEGAAA', 'VVVVxx'),
+(2617, 4164, 1, 1, 7, 17, 17, 617, 617, 2617, 2617, 34, 35, 'RWAAAA', 'EEGAAA', 'AAAAxx'),
+(7409, 4165, 1, 1, 9, 9, 9, 409, 1409, 2409, 7409, 18, 19, 'ZYAAAA', 'FEGAAA', 'HHHHxx'),
+(4903, 4166, 1, 3, 3, 3, 3, 903, 903, 4903, 4903, 6, 7, 'PGAAAA', 'GEGAAA', 'OOOOxx'),
+(9797, 4167, 1, 1, 7, 17, 97, 797, 1797, 4797, 9797, 194, 195, 'VMAAAA', 'HEGAAA', 'VVVVxx'),
+(9919, 4168, 1, 3, 9, 19, 19, 919, 1919, 4919, 9919, 38, 39, 'NRAAAA', 'IEGAAA', 'AAAAxx'),
+(1878, 4169, 0, 2, 8, 18, 78, 878, 1878, 1878, 1878, 156, 157, 'GUAAAA', 'JEGAAA', 'HHHHxx'),
+(4851, 4170, 1, 3, 1, 11, 51, 851, 851, 4851, 4851, 102, 103, 'PEAAAA', 'KEGAAA', 'OOOOxx'),
+(5514, 4171, 0, 2, 4, 14, 14, 514, 1514, 514, 5514, 28, 29, 'CEAAAA', 'LEGAAA', 'VVVVxx'),
+(2582, 4172, 0, 2, 2, 2, 82, 582, 582, 2582, 2582, 164, 165, 'IVAAAA', 'MEGAAA', 'AAAAxx'),
+(3564, 4173, 0, 0, 4, 4, 64, 564, 1564, 3564, 3564, 128, 129, 'CHAAAA', 'NEGAAA', 'HHHHxx'),
+(7085, 4174, 1, 1, 5, 5, 85, 85, 1085, 2085, 7085, 170, 171, 'NMAAAA', 'OEGAAA', 'OOOOxx'),
+(3619, 4175, 1, 3, 9, 19, 19, 619, 1619, 3619, 3619, 38, 39, 'FJAAAA', 'PEGAAA', 'VVVVxx'),
+(261, 4176, 1, 1, 1, 1, 61, 261, 261, 261, 261, 122, 123, 'BKAAAA', 'QEGAAA', 'AAAAxx'),
+(7338, 4177, 0, 2, 8, 18, 38, 338, 1338, 2338, 7338, 76, 77, 'GWAAAA', 'REGAAA', 'HHHHxx'),
+(4251, 4178, 1, 3, 1, 11, 51, 251, 251, 4251, 4251, 102, 103, 'NHAAAA', 'SEGAAA', 'OOOOxx'),
+(5360, 4179, 0, 0, 0, 0, 60, 360, 1360, 360, 5360, 120, 121, 'EYAAAA', 'TEGAAA', 'VVVVxx'),
+(5678, 4180, 0, 2, 8, 18, 78, 678, 1678, 678, 5678, 156, 157, 'KKAAAA', 'UEGAAA', 'AAAAxx'),
+(9162, 4181, 0, 2, 2, 2, 62, 162, 1162, 4162, 9162, 124, 125, 'KOAAAA', 'VEGAAA', 'HHHHxx'),
+(5920, 4182, 0, 0, 0, 0, 20, 920, 1920, 920, 5920, 40, 41, 'STAAAA', 'WEGAAA', 'OOOOxx'),
+(7156, 4183, 0, 0, 6, 16, 56, 156, 1156, 2156, 7156, 112, 113, 'GPAAAA', 'XEGAAA', 'VVVVxx'),
+(4271, 4184, 1, 3, 1, 11, 71, 271, 271, 4271, 4271, 142, 143, 'HIAAAA', 'YEGAAA', 'AAAAxx'),
+(4698, 4185, 0, 2, 8, 18, 98, 698, 698, 4698, 4698, 196, 197, 'SYAAAA', 'ZEGAAA', 'HHHHxx'),
+(1572, 4186, 0, 0, 2, 12, 72, 572, 1572, 1572, 1572, 144, 145, 'MIAAAA', 'AFGAAA', 'OOOOxx'),
+(6974, 4187, 0, 2, 4, 14, 74, 974, 974, 1974, 6974, 148, 149, 'GIAAAA', 'BFGAAA', 'VVVVxx'),
+(4291, 4188, 1, 3, 1, 11, 91, 291, 291, 4291, 4291, 182, 183, 'BJAAAA', 'CFGAAA', 'AAAAxx'),
+(4036, 4189, 0, 0, 6, 16, 36, 36, 36, 4036, 4036, 72, 73, 'GZAAAA', 'DFGAAA', 'HHHHxx'),
+(7473, 4190, 1, 1, 3, 13, 73, 473, 1473, 2473, 7473, 146, 147, 'LBAAAA', 'EFGAAA', 'OOOOxx'),
+(4786, 4191, 0, 2, 6, 6, 86, 786, 786, 4786, 4786, 172, 173, 'CCAAAA', 'FFGAAA', 'VVVVxx'),
+(2662, 4192, 0, 2, 2, 2, 62, 662, 662, 2662, 2662, 124, 125, 'KYAAAA', 'GFGAAA', 'AAAAxx'),
+(916, 4193, 0, 0, 6, 16, 16, 916, 916, 916, 916, 32, 33, 'GJAAAA', 'HFGAAA', 'HHHHxx'),
+(668, 4194, 0, 0, 8, 8, 68, 668, 668, 668, 668, 136, 137, 'SZAAAA', 'IFGAAA', 'OOOOxx'),
+(4874, 4195, 0, 2, 4, 14, 74, 874, 874, 4874, 4874, 148, 149, 'MFAAAA', 'JFGAAA', 'VVVVxx'),
+(3752, 4196, 0, 0, 2, 12, 52, 752, 1752, 3752, 3752, 104, 105, 'IOAAAA', 'KFGAAA', 'AAAAxx'),
+(4865, 4197, 1, 1, 5, 5, 65, 865, 865, 4865, 4865, 130, 131, 'DFAAAA', 'LFGAAA', 'HHHHxx'),
+(7052, 4198, 0, 0, 2, 12, 52, 52, 1052, 2052, 7052, 104, 105, 'GLAAAA', 'MFGAAA', 'OOOOxx'),
+(5712, 4199, 0, 0, 2, 12, 12, 712, 1712, 712, 5712, 24, 25, 'SLAAAA', 'NFGAAA', 'VVVVxx'),
+(31, 4200, 1, 3, 1, 11, 31, 31, 31, 31, 31, 62, 63, 'FBAAAA', 'OFGAAA', 'AAAAxx'),
+(4944, 4201, 0, 0, 4, 4, 44, 944, 944, 4944, 4944, 88, 89, 'EIAAAA', 'PFGAAA', 'HHHHxx'),
+(1435, 4202, 1, 3, 5, 15, 35, 435, 1435, 1435, 1435, 70, 71, 'FDAAAA', 'QFGAAA', 'OOOOxx'),
+(501, 4203, 1, 1, 1, 1, 1, 501, 501, 501, 501, 2, 3, 'HTAAAA', 'RFGAAA', 'VVVVxx'),
+(9401, 4204, 1, 1, 1, 1, 1, 401, 1401, 4401, 9401, 2, 3, 'PXAAAA', 'SFGAAA', 'AAAAxx'),
+(5014, 4205, 0, 2, 4, 14, 14, 14, 1014, 14, 5014, 28, 29, 'WKAAAA', 'TFGAAA', 'HHHHxx'),
+(9125, 4206, 1, 1, 5, 5, 25, 125, 1125, 4125, 9125, 50, 51, 'ZMAAAA', 'UFGAAA', 'OOOOxx'),
+(6144, 4207, 0, 0, 4, 4, 44, 144, 144, 1144, 6144, 88, 89, 'ICAAAA', 'VFGAAA', 'VVVVxx'),
+(1743, 4208, 1, 3, 3, 3, 43, 743, 1743, 1743, 1743, 86, 87, 'BPAAAA', 'WFGAAA', 'AAAAxx'),
+(4316, 4209, 0, 0, 6, 16, 16, 316, 316, 4316, 4316, 32, 33, 'AKAAAA', 'XFGAAA', 'HHHHxx'),
+(8212, 4210, 0, 0, 2, 12, 12, 212, 212, 3212, 8212, 24, 25, 'WDAAAA', 'YFGAAA', 'OOOOxx'),
+(7344, 4211, 0, 0, 4, 4, 44, 344, 1344, 2344, 7344, 88, 89, 'MWAAAA', 'ZFGAAA', 'VVVVxx'),
+(2051, 4212, 1, 3, 1, 11, 51, 51, 51, 2051, 2051, 102, 103, 'XAAAAA', 'AGGAAA', 'AAAAxx'),
+(8131, 4213, 1, 3, 1, 11, 31, 131, 131, 3131, 8131, 62, 63, 'TAAAAA', 'BGGAAA', 'HHHHxx'),
+(7023, 4214, 1, 3, 3, 3, 23, 23, 1023, 2023, 7023, 46, 47, 'DKAAAA', 'CGGAAA', 'OOOOxx'),
+(9674, 4215, 0, 2, 4, 14, 74, 674, 1674, 4674, 9674, 148, 149, 'CIAAAA', 'DGGAAA', 'VVVVxx'),
+(4984, 4216, 0, 0, 4, 4, 84, 984, 984, 4984, 4984, 168, 169, 'SJAAAA', 'EGGAAA', 'AAAAxx'),
+(111, 4217, 1, 3, 1, 11, 11, 111, 111, 111, 111, 22, 23, 'HEAAAA', 'FGGAAA', 'HHHHxx'),
+(2296, 4218, 0, 0, 6, 16, 96, 296, 296, 2296, 2296, 192, 193, 'IKAAAA', 'GGGAAA', 'OOOOxx'),
+(5025, 4219, 1, 1, 5, 5, 25, 25, 1025, 25, 5025, 50, 51, 'HLAAAA', 'HGGAAA', 'VVVVxx'),
+(1756, 4220, 0, 0, 6, 16, 56, 756, 1756, 1756, 1756, 112, 113, 'OPAAAA', 'IGGAAA', 'AAAAxx'),
+(2885, 4221, 1, 1, 5, 5, 85, 885, 885, 2885, 2885, 170, 171, 'ZGAAAA', 'JGGAAA', 'HHHHxx'),
+(2541, 4222, 1, 1, 1, 1, 41, 541, 541, 2541, 2541, 82, 83, 'TTAAAA', 'KGGAAA', 'OOOOxx'),
+(1919, 4223, 1, 3, 9, 19, 19, 919, 1919, 1919, 1919, 38, 39, 'VVAAAA', 'LGGAAA', 'VVVVxx'),
+(6496, 4224, 0, 0, 6, 16, 96, 496, 496, 1496, 6496, 192, 193, 'WPAAAA', 'MGGAAA', 'AAAAxx'),
+(6103, 4225, 1, 3, 3, 3, 3, 103, 103, 1103, 6103, 6, 7, 'TAAAAA', 'NGGAAA', 'HHHHxx'),
+(98, 4226, 0, 2, 8, 18, 98, 98, 98, 98, 98, 196, 197, 'UDAAAA', 'OGGAAA', 'OOOOxx'),
+(3727, 4227, 1, 3, 7, 7, 27, 727, 1727, 3727, 3727, 54, 55, 'JNAAAA', 'PGGAAA', 'VVVVxx'),
+(689, 4228, 1, 1, 9, 9, 89, 689, 689, 689, 689, 178, 179, 'NAAAAA', 'QGGAAA', 'AAAAxx'),
+(7181, 4229, 1, 1, 1, 1, 81, 181, 1181, 2181, 7181, 162, 163, 'FQAAAA', 'RGGAAA', 'HHHHxx'),
+(8447, 4230, 1, 3, 7, 7, 47, 447, 447, 3447, 8447, 94, 95, 'XMAAAA', 'SGGAAA', 'OOOOxx'),
+(4569, 4231, 1, 1, 9, 9, 69, 569, 569, 4569, 4569, 138, 139, 'TTAAAA', 'TGGAAA', 'VVVVxx'),
+(8844, 4232, 0, 0, 4, 4, 44, 844, 844, 3844, 8844, 88, 89, 'ECAAAA', 'UGGAAA', 'AAAAxx'),
+(2436, 4233, 0, 0, 6, 16, 36, 436, 436, 2436, 2436, 72, 73, 'SPAAAA', 'VGGAAA', 'HHHHxx'),
+(391, 4234, 1, 3, 1, 11, 91, 391, 391, 391, 391, 182, 183, 'BPAAAA', 'WGGAAA', 'OOOOxx'),
+(3035, 4235, 1, 3, 5, 15, 35, 35, 1035, 3035, 3035, 70, 71, 'TMAAAA', 'XGGAAA', 'VVVVxx'),
+(7583, 4236, 1, 3, 3, 3, 83, 583, 1583, 2583, 7583, 166, 167, 'RFAAAA', 'YGGAAA', 'AAAAxx'),
+(1145, 4237, 1, 1, 5, 5, 45, 145, 1145, 1145, 1145, 90, 91, 'BSAAAA', 'ZGGAAA', 'HHHHxx'),
+(93, 4238, 1, 1, 3, 13, 93, 93, 93, 93, 93, 186, 187, 'PDAAAA', 'AHGAAA', 'OOOOxx'),
+(8896, 4239, 0, 0, 6, 16, 96, 896, 896, 3896, 8896, 192, 193, 'EEAAAA', 'BHGAAA', 'VVVVxx'),
+(6719, 4240, 1, 3, 9, 19, 19, 719, 719, 1719, 6719, 38, 39, 'LYAAAA', 'CHGAAA', 'AAAAxx'),
+(7728, 4241, 0, 0, 8, 8, 28, 728, 1728, 2728, 7728, 56, 57, 'GLAAAA', 'DHGAAA', 'HHHHxx'),
+(1349, 4242, 1, 1, 9, 9, 49, 349, 1349, 1349, 1349, 98, 99, 'XZAAAA', 'EHGAAA', 'OOOOxx'),
+(5349, 4243, 1, 1, 9, 9, 49, 349, 1349, 349, 5349, 98, 99, 'TXAAAA', 'FHGAAA', 'VVVVxx'),
+(3040, 4244, 0, 0, 0, 0, 40, 40, 1040, 3040, 3040, 80, 81, 'YMAAAA', 'GHGAAA', 'AAAAxx'),
+(2414, 4245, 0, 2, 4, 14, 14, 414, 414, 2414, 2414, 28, 29, 'WOAAAA', 'HHGAAA', 'HHHHxx'),
+(5122, 4246, 0, 2, 2, 2, 22, 122, 1122, 122, 5122, 44, 45, 'APAAAA', 'IHGAAA', 'OOOOxx'),
+(9553, 4247, 1, 1, 3, 13, 53, 553, 1553, 4553, 9553, 106, 107, 'LDAAAA', 'JHGAAA', 'VVVVxx'),
+(5987, 4248, 1, 3, 7, 7, 87, 987, 1987, 987, 5987, 174, 175, 'HWAAAA', 'KHGAAA', 'AAAAxx'),
+(5939, 4249, 1, 3, 9, 19, 39, 939, 1939, 939, 5939, 78, 79, 'LUAAAA', 'LHGAAA', 'HHHHxx'),
+(3525, 4250, 1, 1, 5, 5, 25, 525, 1525, 3525, 3525, 50, 51, 'PFAAAA', 'MHGAAA', 'OOOOxx'),
+(1371, 4251, 1, 3, 1, 11, 71, 371, 1371, 1371, 1371, 142, 143, 'TAAAAA', 'NHGAAA', 'VVVVxx'),
+(618, 4252, 0, 2, 8, 18, 18, 618, 618, 618, 618, 36, 37, 'UXAAAA', 'OHGAAA', 'AAAAxx'),
+(6529, 4253, 1, 1, 9, 9, 29, 529, 529, 1529, 6529, 58, 59, 'DRAAAA', 'PHGAAA', 'HHHHxx'),
+(4010, 4254, 0, 2, 0, 10, 10, 10, 10, 4010, 4010, 20, 21, 'GYAAAA', 'QHGAAA', 'OOOOxx'),
+(328, 4255, 0, 0, 8, 8, 28, 328, 328, 328, 328, 56, 57, 'QMAAAA', 'RHGAAA', 'VVVVxx'),
+(6121, 4256, 1, 1, 1, 1, 21, 121, 121, 1121, 6121, 42, 43, 'LBAAAA', 'SHGAAA', 'AAAAxx'),
+(3505, 4257, 1, 1, 5, 5, 5, 505, 1505, 3505, 3505, 10, 11, 'VEAAAA', 'THGAAA', 'HHHHxx'),
+(2033, 4258, 1, 1, 3, 13, 33, 33, 33, 2033, 2033, 66, 67, 'FAAAAA', 'UHGAAA', 'OOOOxx'),
+(4724, 4259, 0, 0, 4, 4, 24, 724, 724, 4724, 4724, 48, 49, 'SZAAAA', 'VHGAAA', 'VVVVxx'),
+(8717, 4260, 1, 1, 7, 17, 17, 717, 717, 3717, 8717, 34, 35, 'HXAAAA', 'WHGAAA', 'AAAAxx'),
+(5639, 4261, 1, 3, 9, 19, 39, 639, 1639, 639, 5639, 78, 79, 'XIAAAA', 'XHGAAA', 'HHHHxx'),
+(3448, 4262, 0, 0, 8, 8, 48, 448, 1448, 3448, 3448, 96, 97, 'QCAAAA', 'YHGAAA', 'OOOOxx'),
+(2919, 4263, 1, 3, 9, 19, 19, 919, 919, 2919, 2919, 38, 39, 'HIAAAA', 'ZHGAAA', 'VVVVxx'),
+(3417, 4264, 1, 1, 7, 17, 17, 417, 1417, 3417, 3417, 34, 35, 'LBAAAA', 'AIGAAA', 'AAAAxx'),
+(943, 4265, 1, 3, 3, 3, 43, 943, 943, 943, 943, 86, 87, 'HKAAAA', 'BIGAAA', 'HHHHxx'),
+(775, 4266, 1, 3, 5, 15, 75, 775, 775, 775, 775, 150, 151, 'VDAAAA', 'CIGAAA', 'OOOOxx'),
+(2333, 4267, 1, 1, 3, 13, 33, 333, 333, 2333, 2333, 66, 67, 'TLAAAA', 'DIGAAA', 'VVVVxx'),
+(4801, 4268, 1, 1, 1, 1, 1, 801, 801, 4801, 4801, 2, 3, 'RCAAAA', 'EIGAAA', 'AAAAxx'),
+(7169, 4269, 1, 1, 9, 9, 69, 169, 1169, 2169, 7169, 138, 139, 'TPAAAA', 'FIGAAA', 'HHHHxx'),
+(2840, 4270, 0, 0, 0, 0, 40, 840, 840, 2840, 2840, 80, 81, 'GFAAAA', 'GIGAAA', 'OOOOxx'),
+(9034, 4271, 0, 2, 4, 14, 34, 34, 1034, 4034, 9034, 68, 69, 'MJAAAA', 'HIGAAA', 'VVVVxx'),
+(6154, 4272, 0, 2, 4, 14, 54, 154, 154, 1154, 6154, 108, 109, 'SCAAAA', 'IIGAAA', 'AAAAxx'),
+(1412, 4273, 0, 0, 2, 12, 12, 412, 1412, 1412, 1412, 24, 25, 'ICAAAA', 'JIGAAA', 'HHHHxx'),
+(2263, 4274, 1, 3, 3, 3, 63, 263, 263, 2263, 2263, 126, 127, 'BJAAAA', 'KIGAAA', 'OOOOxx'),
+(7118, 4275, 0, 2, 8, 18, 18, 118, 1118, 2118, 7118, 36, 37, 'UNAAAA', 'LIGAAA', 'VVVVxx'),
+(1526, 4276, 0, 2, 6, 6, 26, 526, 1526, 1526, 1526, 52, 53, 'SGAAAA', 'MIGAAA', 'AAAAxx'),
+(491, 4277, 1, 3, 1, 11, 91, 491, 491, 491, 491, 182, 183, 'XSAAAA', 'NIGAAA', 'HHHHxx'),
+(9732, 4278, 0, 0, 2, 12, 32, 732, 1732, 4732, 9732, 64, 65, 'IKAAAA', 'OIGAAA', 'OOOOxx'),
+(7067, 4279, 1, 3, 7, 7, 67, 67, 1067, 2067, 7067, 134, 135, 'VLAAAA', 'PIGAAA', 'VVVVxx'),
+(212, 4280, 0, 0, 2, 12, 12, 212, 212, 212, 212, 24, 25, 'EIAAAA', 'QIGAAA', 'AAAAxx'),
+(1955, 4281, 1, 3, 5, 15, 55, 955, 1955, 1955, 1955, 110, 111, 'FXAAAA', 'RIGAAA', 'HHHHxx'),
+(3303, 4282, 1, 3, 3, 3, 3, 303, 1303, 3303, 3303, 6, 7, 'BXAAAA', 'SIGAAA', 'OOOOxx'),
+(2715, 4283, 1, 3, 5, 15, 15, 715, 715, 2715, 2715, 30, 31, 'LAAAAA', 'TIGAAA', 'VVVVxx'),
+(8168, 4284, 0, 0, 8, 8, 68, 168, 168, 3168, 8168, 136, 137, 'ECAAAA', 'UIGAAA', 'AAAAxx'),
+(6799, 4285, 1, 3, 9, 19, 99, 799, 799, 1799, 6799, 198, 199, 'NBAAAA', 'VIGAAA', 'HHHHxx'),
+(5080, 4286, 0, 0, 0, 0, 80, 80, 1080, 80, 5080, 160, 161, 'KNAAAA', 'WIGAAA', 'OOOOxx'),
+(4939, 4287, 1, 3, 9, 19, 39, 939, 939, 4939, 4939, 78, 79, 'ZHAAAA', 'XIGAAA', 'VVVVxx'),
+(6604, 4288, 0, 0, 4, 4, 4, 604, 604, 1604, 6604, 8, 9, 'AUAAAA', 'YIGAAA', 'AAAAxx'),
+(6531, 4289, 1, 3, 1, 11, 31, 531, 531, 1531, 6531, 62, 63, 'FRAAAA', 'ZIGAAA', 'HHHHxx'),
+(9948, 4290, 0, 0, 8, 8, 48, 948, 1948, 4948, 9948, 96, 97, 'QSAAAA', 'AJGAAA', 'OOOOxx'),
+(7923, 4291, 1, 3, 3, 3, 23, 923, 1923, 2923, 7923, 46, 47, 'TSAAAA', 'BJGAAA', 'VVVVxx'),
+(9905, 4292, 1, 1, 5, 5, 5, 905, 1905, 4905, 9905, 10, 11, 'ZQAAAA', 'CJGAAA', 'AAAAxx'),
+(340, 4293, 0, 0, 0, 0, 40, 340, 340, 340, 340, 80, 81, 'CNAAAA', 'DJGAAA', 'HHHHxx'),
+(1721, 4294, 1, 1, 1, 1, 21, 721, 1721, 1721, 1721, 42, 43, 'FOAAAA', 'EJGAAA', 'OOOOxx'),
+(9047, 4295, 1, 3, 7, 7, 47, 47, 1047, 4047, 9047, 94, 95, 'ZJAAAA', 'FJGAAA', 'VVVVxx'),
+(4723, 4296, 1, 3, 3, 3, 23, 723, 723, 4723, 4723, 46, 47, 'RZAAAA', 'GJGAAA', 'AAAAxx'),
+(5748, 4297, 0, 0, 8, 8, 48, 748, 1748, 748, 5748, 96, 97, 'CNAAAA', 'HJGAAA', 'HHHHxx'),
+(6845, 4298, 1, 1, 5, 5, 45, 845, 845, 1845, 6845, 90, 91, 'HDAAAA', 'IJGAAA', 'OOOOxx'),
+(1556, 4299, 0, 0, 6, 16, 56, 556, 1556, 1556, 1556, 112, 113, 'WHAAAA', 'JJGAAA', 'VVVVxx'),
+(9505, 4300, 1, 1, 5, 5, 5, 505, 1505, 4505, 9505, 10, 11, 'PBAAAA', 'KJGAAA', 'AAAAxx'),
+(3573, 4301, 1, 1, 3, 13, 73, 573, 1573, 3573, 3573, 146, 147, 'LHAAAA', 'LJGAAA', 'HHHHxx'),
+(3785, 4302, 1, 1, 5, 5, 85, 785, 1785, 3785, 3785, 170, 171, 'PPAAAA', 'MJGAAA', 'OOOOxx'),
+(2772, 4303, 0, 0, 2, 12, 72, 772, 772, 2772, 2772, 144, 145, 'QCAAAA', 'NJGAAA', 'VVVVxx'),
+(7282, 4304, 0, 2, 2, 2, 82, 282, 1282, 2282, 7282, 164, 165, 'CUAAAA', 'OJGAAA', 'AAAAxx'),
+(8106, 4305, 0, 2, 6, 6, 6, 106, 106, 3106, 8106, 12, 13, 'UZAAAA', 'PJGAAA', 'HHHHxx'),
+(2847, 4306, 1, 3, 7, 7, 47, 847, 847, 2847, 2847, 94, 95, 'NFAAAA', 'QJGAAA', 'OOOOxx'),
+(9803, 4307, 1, 3, 3, 3, 3, 803, 1803, 4803, 9803, 6, 7, 'BNAAAA', 'RJGAAA', 'VVVVxx'),
+(7719, 4308, 1, 3, 9, 19, 19, 719, 1719, 2719, 7719, 38, 39, 'XKAAAA', 'SJGAAA', 'AAAAxx'),
+(4649, 4309, 1, 1, 9, 9, 49, 649, 649, 4649, 4649, 98, 99, 'VWAAAA', 'TJGAAA', 'HHHHxx'),
+(6196, 4310, 0, 0, 6, 16, 96, 196, 196, 1196, 6196, 192, 193, 'IEAAAA', 'UJGAAA', 'OOOOxx'),
+(6026, 4311, 0, 2, 6, 6, 26, 26, 26, 1026, 6026, 52, 53, 'UXAAAA', 'VJGAAA', 'VVVVxx'),
+(1646, 4312, 0, 2, 6, 6, 46, 646, 1646, 1646, 1646, 92, 93, 'ILAAAA', 'WJGAAA', 'AAAAxx'),
+(6526, 4313, 0, 2, 6, 6, 26, 526, 526, 1526, 6526, 52, 53, 'ARAAAA', 'XJGAAA', 'HHHHxx'),
+(5110, 4314, 0, 2, 0, 10, 10, 110, 1110, 110, 5110, 20, 21, 'OOAAAA', 'YJGAAA', 'OOOOxx'),
+(3946, 4315, 0, 2, 6, 6, 46, 946, 1946, 3946, 3946, 92, 93, 'UVAAAA', 'ZJGAAA', 'VVVVxx'),
+(445, 4316, 1, 1, 5, 5, 45, 445, 445, 445, 445, 90, 91, 'DRAAAA', 'AKGAAA', 'AAAAxx'),
+(3249, 4317, 1, 1, 9, 9, 49, 249, 1249, 3249, 3249, 98, 99, 'ZUAAAA', 'BKGAAA', 'HHHHxx'),
+(2501, 4318, 1, 1, 1, 1, 1, 501, 501, 2501, 2501, 2, 3, 'FSAAAA', 'CKGAAA', 'OOOOxx'),
+(3243, 4319, 1, 3, 3, 3, 43, 243, 1243, 3243, 3243, 86, 87, 'TUAAAA', 'DKGAAA', 'VVVVxx'),
+(4701, 4320, 1, 1, 1, 1, 1, 701, 701, 4701, 4701, 2, 3, 'VYAAAA', 'EKGAAA', 'AAAAxx'),
+(472, 4321, 0, 0, 2, 12, 72, 472, 472, 472, 472, 144, 145, 'ESAAAA', 'FKGAAA', 'HHHHxx'),
+(3356, 4322, 0, 0, 6, 16, 56, 356, 1356, 3356, 3356, 112, 113, 'CZAAAA', 'GKGAAA', 'OOOOxx'),
+(9967, 4323, 1, 3, 7, 7, 67, 967, 1967, 4967, 9967, 134, 135, 'JTAAAA', 'HKGAAA', 'VVVVxx'),
+(4292, 4324, 0, 0, 2, 12, 92, 292, 292, 4292, 4292, 184, 185, 'CJAAAA', 'IKGAAA', 'AAAAxx'),
+(7005, 4325, 1, 1, 5, 5, 5, 5, 1005, 2005, 7005, 10, 11, 'LJAAAA', 'JKGAAA', 'HHHHxx'),
+(6267, 4326, 1, 3, 7, 7, 67, 267, 267, 1267, 6267, 134, 135, 'BHAAAA', 'KKGAAA', 'OOOOxx'),
+(6678, 4327, 0, 2, 8, 18, 78, 678, 678, 1678, 6678, 156, 157, 'WWAAAA', 'LKGAAA', 'VVVVxx'),
+(6083, 4328, 1, 3, 3, 3, 83, 83, 83, 1083, 6083, 166, 167, 'ZZAAAA', 'MKGAAA', 'AAAAxx'),
+(760, 4329, 0, 0, 0, 0, 60, 760, 760, 760, 760, 120, 121, 'GDAAAA', 'NKGAAA', 'HHHHxx'),
+(7833, 4330, 1, 1, 3, 13, 33, 833, 1833, 2833, 7833, 66, 67, 'HPAAAA', 'OKGAAA', 'OOOOxx'),
+(2877, 4331, 1, 1, 7, 17, 77, 877, 877, 2877, 2877, 154, 155, 'RGAAAA', 'PKGAAA', 'VVVVxx'),
+(8810, 4332, 0, 2, 0, 10, 10, 810, 810, 3810, 8810, 20, 21, 'WAAAAA', 'QKGAAA', 'AAAAxx'),
+(1560, 4333, 0, 0, 0, 0, 60, 560, 1560, 1560, 1560, 120, 121, 'AIAAAA', 'RKGAAA', 'HHHHxx'),
+(1367, 4334, 1, 3, 7, 7, 67, 367, 1367, 1367, 1367, 134, 135, 'PAAAAA', 'SKGAAA', 'OOOOxx'),
+(8756, 4335, 0, 0, 6, 16, 56, 756, 756, 3756, 8756, 112, 113, 'UYAAAA', 'TKGAAA', 'VVVVxx'),
+(1346, 4336, 0, 2, 6, 6, 46, 346, 1346, 1346, 1346, 92, 93, 'UZAAAA', 'UKGAAA', 'AAAAxx'),
+(6449, 4337, 1, 1, 9, 9, 49, 449, 449, 1449, 6449, 98, 99, 'BOAAAA', 'VKGAAA', 'HHHHxx'),
+(6658, 4338, 0, 2, 8, 18, 58, 658, 658, 1658, 6658, 116, 117, 'CWAAAA', 'WKGAAA', 'OOOOxx'),
+(6745, 4339, 1, 1, 5, 5, 45, 745, 745, 1745, 6745, 90, 91, 'LZAAAA', 'XKGAAA', 'VVVVxx'),
+(4866, 4340, 0, 2, 6, 6, 66, 866, 866, 4866, 4866, 132, 133, 'EFAAAA', 'YKGAAA', 'AAAAxx'),
+(14, 4341, 0, 2, 4, 14, 14, 14, 14, 14, 14, 28, 29, 'OAAAAA', 'ZKGAAA', 'HHHHxx'),
+(4506, 4342, 0, 2, 6, 6, 6, 506, 506, 4506, 4506, 12, 13, 'IRAAAA', 'ALGAAA', 'OOOOxx'),
+(1923, 4343, 1, 3, 3, 3, 23, 923, 1923, 1923, 1923, 46, 47, 'ZVAAAA', 'BLGAAA', 'VVVVxx'),
+(8365, 4344, 1, 1, 5, 5, 65, 365, 365, 3365, 8365, 130, 131, 'TJAAAA', 'CLGAAA', 'AAAAxx'),
+(1279, 4345, 1, 3, 9, 19, 79, 279, 1279, 1279, 1279, 158, 159, 'FXAAAA', 'DLGAAA', 'HHHHxx'),
+(7666, 4346, 0, 2, 6, 6, 66, 666, 1666, 2666, 7666, 132, 133, 'WIAAAA', 'ELGAAA', 'OOOOxx'),
+(7404, 4347, 0, 0, 4, 4, 4, 404, 1404, 2404, 7404, 8, 9, 'UYAAAA', 'FLGAAA', 'VVVVxx'),
+(65, 4348, 1, 1, 5, 5, 65, 65, 65, 65, 65, 130, 131, 'NCAAAA', 'GLGAAA', 'AAAAxx'),
+(5820, 4349, 0, 0, 0, 0, 20, 820, 1820, 820, 5820, 40, 41, 'WPAAAA', 'HLGAAA', 'HHHHxx'),
+(459, 4350, 1, 3, 9, 19, 59, 459, 459, 459, 459, 118, 119, 'RRAAAA', 'ILGAAA', 'OOOOxx'),
+(4787, 4351, 1, 3, 7, 7, 87, 787, 787, 4787, 4787, 174, 175, 'DCAAAA', 'JLGAAA', 'VVVVxx'),
+(5631, 4352, 1, 3, 1, 11, 31, 631, 1631, 631, 5631, 62, 63, 'PIAAAA', 'KLGAAA', 'AAAAxx'),
+(9717, 4353, 1, 1, 7, 17, 17, 717, 1717, 4717, 9717, 34, 35, 'TJAAAA', 'LLGAAA', 'HHHHxx'),
+(2560, 4354, 0, 0, 0, 0, 60, 560, 560, 2560, 2560, 120, 121, 'MUAAAA', 'MLGAAA', 'OOOOxx'),
+(8295, 4355, 1, 3, 5, 15, 95, 295, 295, 3295, 8295, 190, 191, 'BHAAAA', 'NLGAAA', 'VVVVxx'),
+(3596, 4356, 0, 0, 6, 16, 96, 596, 1596, 3596, 3596, 192, 193, 'IIAAAA', 'OLGAAA', 'AAAAxx'),
+(2023, 4357, 1, 3, 3, 3, 23, 23, 23, 2023, 2023, 46, 47, 'VZAAAA', 'PLGAAA', 'HHHHxx'),
+(5055, 4358, 1, 3, 5, 15, 55, 55, 1055, 55, 5055, 110, 111, 'LMAAAA', 'QLGAAA', 'OOOOxx'),
+(763, 4359, 1, 3, 3, 3, 63, 763, 763, 763, 763, 126, 127, 'JDAAAA', 'RLGAAA', 'VVVVxx'),
+(6733, 4360, 1, 1, 3, 13, 33, 733, 733, 1733, 6733, 66, 67, 'ZYAAAA', 'SLGAAA', 'AAAAxx'),
+(9266, 4361, 0, 2, 6, 6, 66, 266, 1266, 4266, 9266, 132, 133, 'KSAAAA', 'TLGAAA', 'HHHHxx'),
+(4479, 4362, 1, 3, 9, 19, 79, 479, 479, 4479, 4479, 158, 159, 'HQAAAA', 'ULGAAA', 'OOOOxx'),
+(1816, 4363, 0, 0, 6, 16, 16, 816, 1816, 1816, 1816, 32, 33, 'WRAAAA', 'VLGAAA', 'VVVVxx'),
+(899, 4364, 1, 3, 9, 19, 99, 899, 899, 899, 899, 198, 199, 'PIAAAA', 'WLGAAA', 'AAAAxx'),
+(230, 4365, 0, 2, 0, 10, 30, 230, 230, 230, 230, 60, 61, 'WIAAAA', 'XLGAAA', 'HHHHxx'),
+(5362, 4366, 0, 2, 2, 2, 62, 362, 1362, 362, 5362, 124, 125, 'GYAAAA', 'YLGAAA', 'OOOOxx'),
+(1609, 4367, 1, 1, 9, 9, 9, 609, 1609, 1609, 1609, 18, 19, 'XJAAAA', 'ZLGAAA', 'VVVVxx'),
+(6750, 4368, 0, 2, 0, 10, 50, 750, 750, 1750, 6750, 100, 101, 'QZAAAA', 'AMGAAA', 'AAAAxx'),
+(9704, 4369, 0, 0, 4, 4, 4, 704, 1704, 4704, 9704, 8, 9, 'GJAAAA', 'BMGAAA', 'HHHHxx'),
+(3991, 4370, 1, 3, 1, 11, 91, 991, 1991, 3991, 3991, 182, 183, 'NXAAAA', 'CMGAAA', 'OOOOxx'),
+(3959, 4371, 1, 3, 9, 19, 59, 959, 1959, 3959, 3959, 118, 119, 'HWAAAA', 'DMGAAA', 'VVVVxx'),
+(9021, 4372, 1, 1, 1, 1, 21, 21, 1021, 4021, 9021, 42, 43, 'ZIAAAA', 'EMGAAA', 'AAAAxx'),
+(7585, 4373, 1, 1, 5, 5, 85, 585, 1585, 2585, 7585, 170, 171, 'TFAAAA', 'FMGAAA', 'HHHHxx'),
+(7083, 4374, 1, 3, 3, 3, 83, 83, 1083, 2083, 7083, 166, 167, 'LMAAAA', 'GMGAAA', 'OOOOxx'),
+(7688, 4375, 0, 0, 8, 8, 88, 688, 1688, 2688, 7688, 176, 177, 'SJAAAA', 'HMGAAA', 'VVVVxx'),
+(2673, 4376, 1, 1, 3, 13, 73, 673, 673, 2673, 2673, 146, 147, 'VYAAAA', 'IMGAAA', 'AAAAxx'),
+(3554, 4377, 0, 2, 4, 14, 54, 554, 1554, 3554, 3554, 108, 109, 'SGAAAA', 'JMGAAA', 'HHHHxx'),
+(7416, 4378, 0, 0, 6, 16, 16, 416, 1416, 2416, 7416, 32, 33, 'GZAAAA', 'KMGAAA', 'OOOOxx'),
+(5672, 4379, 0, 0, 2, 12, 72, 672, 1672, 672, 5672, 144, 145, 'EKAAAA', 'LMGAAA', 'VVVVxx'),
+(1355, 4380, 1, 3, 5, 15, 55, 355, 1355, 1355, 1355, 110, 111, 'DAAAAA', 'MMGAAA', 'AAAAxx'),
+(3149, 4381, 1, 1, 9, 9, 49, 149, 1149, 3149, 3149, 98, 99, 'DRAAAA', 'NMGAAA', 'HHHHxx'),
+(5811, 4382, 1, 3, 1, 11, 11, 811, 1811, 811, 5811, 22, 23, 'NPAAAA', 'OMGAAA', 'OOOOxx'),
+(3759, 4383, 1, 3, 9, 19, 59, 759, 1759, 3759, 3759, 118, 119, 'POAAAA', 'PMGAAA', 'VVVVxx'),
+(5634, 4384, 0, 2, 4, 14, 34, 634, 1634, 634, 5634, 68, 69, 'SIAAAA', 'QMGAAA', 'AAAAxx'),
+(8617, 4385, 1, 1, 7, 17, 17, 617, 617, 3617, 8617, 34, 35, 'LTAAAA', 'RMGAAA', 'HHHHxx'),
+(8949, 4386, 1, 1, 9, 9, 49, 949, 949, 3949, 8949, 98, 99, 'FGAAAA', 'SMGAAA', 'OOOOxx'),
+(3964, 4387, 0, 0, 4, 4, 64, 964, 1964, 3964, 3964, 128, 129, 'MWAAAA', 'TMGAAA', 'VVVVxx'),
+(3852, 4388, 0, 0, 2, 12, 52, 852, 1852, 3852, 3852, 104, 105, 'ESAAAA', 'UMGAAA', 'AAAAxx'),
+(1555, 4389, 1, 3, 5, 15, 55, 555, 1555, 1555, 1555, 110, 111, 'VHAAAA', 'VMGAAA', 'HHHHxx'),
+(6536, 4390, 0, 0, 6, 16, 36, 536, 536, 1536, 6536, 72, 73, 'KRAAAA', 'WMGAAA', 'OOOOxx'),
+(4779, 4391, 1, 3, 9, 19, 79, 779, 779, 4779, 4779, 158, 159, 'VBAAAA', 'XMGAAA', 'VVVVxx'),
+(1893, 4392, 1, 1, 3, 13, 93, 893, 1893, 1893, 1893, 186, 187, 'VUAAAA', 'YMGAAA', 'AAAAxx'),
+(9358, 4393, 0, 2, 8, 18, 58, 358, 1358, 4358, 9358, 116, 117, 'YVAAAA', 'ZMGAAA', 'HHHHxx'),
+(7438, 4394, 0, 2, 8, 18, 38, 438, 1438, 2438, 7438, 76, 77, 'CAAAAA', 'ANGAAA', 'OOOOxx'),
+(941, 4395, 1, 1, 1, 1, 41, 941, 941, 941, 941, 82, 83, 'FKAAAA', 'BNGAAA', 'VVVVxx'),
+(4844, 4396, 0, 0, 4, 4, 44, 844, 844, 4844, 4844, 88, 89, 'IEAAAA', 'CNGAAA', 'AAAAxx'),
+(4745, 4397, 1, 1, 5, 5, 45, 745, 745, 4745, 4745, 90, 91, 'NAAAAA', 'DNGAAA', 'HHHHxx'),
+(1017, 4398, 1, 1, 7, 17, 17, 17, 1017, 1017, 1017, 34, 35, 'DNAAAA', 'ENGAAA', 'OOOOxx'),
+(327, 4399, 1, 3, 7, 7, 27, 327, 327, 327, 327, 54, 55, 'PMAAAA', 'FNGAAA', 'VVVVxx'),
+(3152, 4400, 0, 0, 2, 12, 52, 152, 1152, 3152, 3152, 104, 105, 'GRAAAA', 'GNGAAA', 'AAAAxx'),
+(4711, 4401, 1, 3, 1, 11, 11, 711, 711, 4711, 4711, 22, 23, 'FZAAAA', 'HNGAAA', 'HHHHxx'),
+(141, 4402, 1, 1, 1, 1, 41, 141, 141, 141, 141, 82, 83, 'LFAAAA', 'INGAAA', 'OOOOxx'),
+(1303, 4403, 1, 3, 3, 3, 3, 303, 1303, 1303, 1303, 6, 7, 'DYAAAA', 'JNGAAA', 'VVVVxx'),
+(8873, 4404, 1, 1, 3, 13, 73, 873, 873, 3873, 8873, 146, 147, 'HDAAAA', 'KNGAAA', 'AAAAxx'),
+(8481, 4405, 1, 1, 1, 1, 81, 481, 481, 3481, 8481, 162, 163, 'FOAAAA', 'LNGAAA', 'HHHHxx'),
+(5445, 4406, 1, 1, 5, 5, 45, 445, 1445, 445, 5445, 90, 91, 'LBAAAA', 'MNGAAA', 'OOOOxx'),
+(7868, 4407, 0, 0, 8, 8, 68, 868, 1868, 2868, 7868, 136, 137, 'QQAAAA', 'NNGAAA', 'VVVVxx'),
+(6722, 4408, 0, 2, 2, 2, 22, 722, 722, 1722, 6722, 44, 45, 'OYAAAA', 'ONGAAA', 'AAAAxx'),
+(6628, 4409, 0, 0, 8, 8, 28, 628, 628, 1628, 6628, 56, 57, 'YUAAAA', 'PNGAAA', 'HHHHxx'),
+(7738, 4410, 0, 2, 8, 18, 38, 738, 1738, 2738, 7738, 76, 77, 'QLAAAA', 'QNGAAA', 'OOOOxx'),
+(1018, 4411, 0, 2, 8, 18, 18, 18, 1018, 1018, 1018, 36, 37, 'ENAAAA', 'RNGAAA', 'VVVVxx'),
+(3296, 4412, 0, 0, 6, 16, 96, 296, 1296, 3296, 3296, 192, 193, 'UWAAAA', 'SNGAAA', 'AAAAxx'),
+(1946, 4413, 0, 2, 6, 6, 46, 946, 1946, 1946, 1946, 92, 93, 'WWAAAA', 'TNGAAA', 'HHHHxx'),
+(6603, 4414, 1, 3, 3, 3, 3, 603, 603, 1603, 6603, 6, 7, 'ZTAAAA', 'UNGAAA', 'OOOOxx'),
+(3562, 4415, 0, 2, 2, 2, 62, 562, 1562, 3562, 3562, 124, 125, 'AHAAAA', 'VNGAAA', 'VVVVxx'),
+(1147, 4416, 1, 3, 7, 7, 47, 147, 1147, 1147, 1147, 94, 95, 'DSAAAA', 'WNGAAA', 'AAAAxx'),
+(6031, 4417, 1, 3, 1, 11, 31, 31, 31, 1031, 6031, 62, 63, 'ZXAAAA', 'XNGAAA', 'HHHHxx'),
+(6484, 4418, 0, 0, 4, 4, 84, 484, 484, 1484, 6484, 168, 169, 'KPAAAA', 'YNGAAA', 'OOOOxx'),
+(496, 4419, 0, 0, 6, 16, 96, 496, 496, 496, 496, 192, 193, 'CTAAAA', 'ZNGAAA', 'VVVVxx'),
+(4563, 4420, 1, 3, 3, 3, 63, 563, 563, 4563, 4563, 126, 127, 'NTAAAA', 'AOGAAA', 'AAAAxx'),
+(1037, 4421, 1, 1, 7, 17, 37, 37, 1037, 1037, 1037, 74, 75, 'XNAAAA', 'BOGAAA', 'HHHHxx'),
+(9672, 4422, 0, 0, 2, 12, 72, 672, 1672, 4672, 9672, 144, 145, 'AIAAAA', 'COGAAA', 'OOOOxx'),
+(9053, 4423, 1, 1, 3, 13, 53, 53, 1053, 4053, 9053, 106, 107, 'FKAAAA', 'DOGAAA', 'VVVVxx'),
+(2523, 4424, 1, 3, 3, 3, 23, 523, 523, 2523, 2523, 46, 47, 'BTAAAA', 'EOGAAA', 'AAAAxx'),
+(8519, 4425, 1, 3, 9, 19, 19, 519, 519, 3519, 8519, 38, 39, 'RPAAAA', 'FOGAAA', 'HHHHxx'),
+(8190, 4426, 0, 2, 0, 10, 90, 190, 190, 3190, 8190, 180, 181, 'ADAAAA', 'GOGAAA', 'OOOOxx'),
+(2068, 4427, 0, 0, 8, 8, 68, 68, 68, 2068, 2068, 136, 137, 'OBAAAA', 'HOGAAA', 'VVVVxx'),
+(8569, 4428, 1, 1, 9, 9, 69, 569, 569, 3569, 8569, 138, 139, 'PRAAAA', 'IOGAAA', 'AAAAxx'),
+(6535, 4429, 1, 3, 5, 15, 35, 535, 535, 1535, 6535, 70, 71, 'JRAAAA', 'JOGAAA', 'HHHHxx'),
+(1810, 4430, 0, 2, 0, 10, 10, 810, 1810, 1810, 1810, 20, 21, 'QRAAAA', 'KOGAAA', 'OOOOxx'),
+(3099, 4431, 1, 3, 9, 19, 99, 99, 1099, 3099, 3099, 198, 199, 'FPAAAA', 'LOGAAA', 'VVVVxx'),
+(7466, 4432, 0, 2, 6, 6, 66, 466, 1466, 2466, 7466, 132, 133, 'EBAAAA', 'MOGAAA', 'AAAAxx'),
+(4017, 4433, 1, 1, 7, 17, 17, 17, 17, 4017, 4017, 34, 35, 'NYAAAA', 'NOGAAA', 'HHHHxx'),
+(1097, 4434, 1, 1, 7, 17, 97, 97, 1097, 1097, 1097, 194, 195, 'FQAAAA', 'OOGAAA', 'OOOOxx'),
+(7686, 4435, 0, 2, 6, 6, 86, 686, 1686, 2686, 7686, 172, 173, 'QJAAAA', 'POGAAA', 'VVVVxx'),
+(6742, 4436, 0, 2, 2, 2, 42, 742, 742, 1742, 6742, 84, 85, 'IZAAAA', 'QOGAAA', 'AAAAxx'),
+(5966, 4437, 0, 2, 6, 6, 66, 966, 1966, 966, 5966, 132, 133, 'MVAAAA', 'ROGAAA', 'HHHHxx'),
+(3632, 4438, 0, 0, 2, 12, 32, 632, 1632, 3632, 3632, 64, 65, 'SJAAAA', 'SOGAAA', 'OOOOxx'),
+(8837, 4439, 1, 1, 7, 17, 37, 837, 837, 3837, 8837, 74, 75, 'XBAAAA', 'TOGAAA', 'VVVVxx'),
+(1667, 4440, 1, 3, 7, 7, 67, 667, 1667, 1667, 1667, 134, 135, 'DMAAAA', 'UOGAAA', 'AAAAxx'),
+(8833, 4441, 1, 1, 3, 13, 33, 833, 833, 3833, 8833, 66, 67, 'TBAAAA', 'VOGAAA', 'HHHHxx'),
+(9805, 4442, 1, 1, 5, 5, 5, 805, 1805, 4805, 9805, 10, 11, 'DNAAAA', 'WOGAAA', 'OOOOxx'),
+(3650, 4443, 0, 2, 0, 10, 50, 650, 1650, 3650, 3650, 100, 101, 'KKAAAA', 'XOGAAA', 'VVVVxx'),
+(2237, 4444, 1, 1, 7, 17, 37, 237, 237, 2237, 2237, 74, 75, 'BIAAAA', 'YOGAAA', 'AAAAxx'),
+(9980, 4445, 0, 0, 0, 0, 80, 980, 1980, 4980, 9980, 160, 161, 'WTAAAA', 'ZOGAAA', 'HHHHxx'),
+(2861, 4446, 1, 1, 1, 1, 61, 861, 861, 2861, 2861, 122, 123, 'BGAAAA', 'APGAAA', 'OOOOxx'),
+(1334, 4447, 0, 2, 4, 14, 34, 334, 1334, 1334, 1334, 68, 69, 'IZAAAA', 'BPGAAA', 'VVVVxx'),
+(842, 4448, 0, 2, 2, 2, 42, 842, 842, 842, 842, 84, 85, 'KGAAAA', 'CPGAAA', 'AAAAxx'),
+(1116, 4449, 0, 0, 6, 16, 16, 116, 1116, 1116, 1116, 32, 33, 'YQAAAA', 'DPGAAA', 'HHHHxx'),
+(4055, 4450, 1, 3, 5, 15, 55, 55, 55, 4055, 4055, 110, 111, 'ZZAAAA', 'EPGAAA', 'OOOOxx'),
+(3842, 4451, 0, 2, 2, 2, 42, 842, 1842, 3842, 3842, 84, 85, 'URAAAA', 'FPGAAA', 'VVVVxx'),
+(1886, 4452, 0, 2, 6, 6, 86, 886, 1886, 1886, 1886, 172, 173, 'OUAAAA', 'GPGAAA', 'AAAAxx'),
+(8589, 4453, 1, 1, 9, 9, 89, 589, 589, 3589, 8589, 178, 179, 'JSAAAA', 'HPGAAA', 'HHHHxx'),
+(5873, 4454, 1, 1, 3, 13, 73, 873, 1873, 873, 5873, 146, 147, 'XRAAAA', 'IPGAAA', 'OOOOxx'),
+(7711, 4455, 1, 3, 1, 11, 11, 711, 1711, 2711, 7711, 22, 23, 'PKAAAA', 'JPGAAA', 'VVVVxx'),
+(911, 4456, 1, 3, 1, 11, 11, 911, 911, 911, 911, 22, 23, 'BJAAAA', 'KPGAAA', 'AAAAxx'),
+(5837, 4457, 1, 1, 7, 17, 37, 837, 1837, 837, 5837, 74, 75, 'NQAAAA', 'LPGAAA', 'HHHHxx'),
+(897, 4458, 1, 1, 7, 17, 97, 897, 897, 897, 897, 194, 195, 'NIAAAA', 'MPGAAA', 'OOOOxx'),
+(4299, 4459, 1, 3, 9, 19, 99, 299, 299, 4299, 4299, 198, 199, 'JJAAAA', 'NPGAAA', 'VVVVxx'),
+(7774, 4460, 0, 2, 4, 14, 74, 774, 1774, 2774, 7774, 148, 149, 'ANAAAA', 'OPGAAA', 'AAAAxx'),
+(7832, 4461, 0, 0, 2, 12, 32, 832, 1832, 2832, 7832, 64, 65, 'GPAAAA', 'PPGAAA', 'HHHHxx'),
+(9915, 4462, 1, 3, 5, 15, 15, 915, 1915, 4915, 9915, 30, 31, 'JRAAAA', 'QPGAAA', 'OOOOxx'),
+(9, 4463, 1, 1, 9, 9, 9, 9, 9, 9, 9, 18, 19, 'JAAAAA', 'RPGAAA', 'VVVVxx'),
+(9675, 4464, 1, 3, 5, 15, 75, 675, 1675, 4675, 9675, 150, 151, 'DIAAAA', 'SPGAAA', 'AAAAxx'),
+(7953, 4465, 1, 1, 3, 13, 53, 953, 1953, 2953, 7953, 106, 107, 'XTAAAA', 'TPGAAA', 'HHHHxx'),
+(8912, 4466, 0, 0, 2, 12, 12, 912, 912, 3912, 8912, 24, 25, 'UEAAAA', 'UPGAAA', 'OOOOxx'),
+(4188, 4467, 0, 0, 8, 8, 88, 188, 188, 4188, 4188, 176, 177, 'CFAAAA', 'VPGAAA', 'VVVVxx'),
+(8446, 4468, 0, 2, 6, 6, 46, 446, 446, 3446, 8446, 92, 93, 'WMAAAA', 'WPGAAA', 'AAAAxx'),
+(1600, 4469, 0, 0, 0, 0, 0, 600, 1600, 1600, 1600, 0, 1, 'OJAAAA', 'XPGAAA', 'HHHHxx'),
+(43, 4470, 1, 3, 3, 3, 43, 43, 43, 43, 43, 86, 87, 'RBAAAA', 'YPGAAA', 'OOOOxx'),
+(544, 4471, 0, 0, 4, 4, 44, 544, 544, 544, 544, 88, 89, 'YUAAAA', 'ZPGAAA', 'VVVVxx'),
+(6977, 4472, 1, 1, 7, 17, 77, 977, 977, 1977, 6977, 154, 155, 'JIAAAA', 'AQGAAA', 'AAAAxx'),
+(3191, 4473, 1, 3, 1, 11, 91, 191, 1191, 3191, 3191, 182, 183, 'TSAAAA', 'BQGAAA', 'HHHHxx'),
+(418, 4474, 0, 2, 8, 18, 18, 418, 418, 418, 418, 36, 37, 'CQAAAA', 'CQGAAA', 'OOOOxx'),
+(3142, 4475, 0, 2, 2, 2, 42, 142, 1142, 3142, 3142, 84, 85, 'WQAAAA', 'DQGAAA', 'VVVVxx'),
+(5042, 4476, 0, 2, 2, 2, 42, 42, 1042, 42, 5042, 84, 85, 'YLAAAA', 'EQGAAA', 'AAAAxx'),
+(2194, 4477, 0, 2, 4, 14, 94, 194, 194, 2194, 2194, 188, 189, 'KGAAAA', 'FQGAAA', 'HHHHxx'),
+(2397, 4478, 1, 1, 7, 17, 97, 397, 397, 2397, 2397, 194, 195, 'FOAAAA', 'GQGAAA', 'OOOOxx'),
+(4684, 4479, 0, 0, 4, 4, 84, 684, 684, 4684, 4684, 168, 169, 'EYAAAA', 'HQGAAA', 'VVVVxx'),
+(34, 4480, 0, 2, 4, 14, 34, 34, 34, 34, 34, 68, 69, 'IBAAAA', 'IQGAAA', 'AAAAxx'),
+(3844, 4481, 0, 0, 4, 4, 44, 844, 1844, 3844, 3844, 88, 89, 'WRAAAA', 'JQGAAA', 'HHHHxx'),
+(7824, 4482, 0, 0, 4, 4, 24, 824, 1824, 2824, 7824, 48, 49, 'YOAAAA', 'KQGAAA', 'OOOOxx'),
+(6177, 4483, 1, 1, 7, 17, 77, 177, 177, 1177, 6177, 154, 155, 'PDAAAA', 'LQGAAA', 'VVVVxx'),
+(9657, 4484, 1, 1, 7, 17, 57, 657, 1657, 4657, 9657, 114, 115, 'LHAAAA', 'MQGAAA', 'AAAAxx'),
+(4546, 4485, 0, 2, 6, 6, 46, 546, 546, 4546, 4546, 92, 93, 'WSAAAA', 'NQGAAA', 'HHHHxx'),
+(599, 4486, 1, 3, 9, 19, 99, 599, 599, 599, 599, 198, 199, 'BXAAAA', 'OQGAAA', 'OOOOxx'),
+(153, 4487, 1, 1, 3, 13, 53, 153, 153, 153, 153, 106, 107, 'XFAAAA', 'PQGAAA', 'VVVVxx'),
+(6910, 4488, 0, 2, 0, 10, 10, 910, 910, 1910, 6910, 20, 21, 'UFAAAA', 'QQGAAA', 'AAAAxx'),
+(4408, 4489, 0, 0, 8, 8, 8, 408, 408, 4408, 4408, 16, 17, 'ONAAAA', 'RQGAAA', 'HHHHxx'),
+(1164, 4490, 0, 0, 4, 4, 64, 164, 1164, 1164, 1164, 128, 129, 'USAAAA', 'SQGAAA', 'OOOOxx'),
+(6469, 4491, 1, 1, 9, 9, 69, 469, 469, 1469, 6469, 138, 139, 'VOAAAA', 'TQGAAA', 'VVVVxx'),
+(5996, 4492, 0, 0, 6, 16, 96, 996, 1996, 996, 5996, 192, 193, 'QWAAAA', 'UQGAAA', 'AAAAxx'),
+(2639, 4493, 1, 3, 9, 19, 39, 639, 639, 2639, 2639, 78, 79, 'NXAAAA', 'VQGAAA', 'HHHHxx'),
+(2678, 4494, 0, 2, 8, 18, 78, 678, 678, 2678, 2678, 156, 157, 'AZAAAA', 'WQGAAA', 'OOOOxx'),
+(8392, 4495, 0, 0, 2, 12, 92, 392, 392, 3392, 8392, 184, 185, 'UKAAAA', 'XQGAAA', 'VVVVxx'),
+(1386, 4496, 0, 2, 6, 6, 86, 386, 1386, 1386, 1386, 172, 173, 'IBAAAA', 'YQGAAA', 'AAAAxx'),
+(5125, 4497, 1, 1, 5, 5, 25, 125, 1125, 125, 5125, 50, 51, 'DPAAAA', 'ZQGAAA', 'HHHHxx'),
+(8453, 4498, 1, 1, 3, 13, 53, 453, 453, 3453, 8453, 106, 107, 'DNAAAA', 'ARGAAA', 'OOOOxx'),
+(2369, 4499, 1, 1, 9, 9, 69, 369, 369, 2369, 2369, 138, 139, 'DNAAAA', 'BRGAAA', 'VVVVxx'),
+(1608, 4500, 0, 0, 8, 8, 8, 608, 1608, 1608, 1608, 16, 17, 'WJAAAA', 'CRGAAA', 'AAAAxx'),
+(3781, 4501, 1, 1, 1, 1, 81, 781, 1781, 3781, 3781, 162, 163, 'LPAAAA', 'DRGAAA', 'HHHHxx'),
+(903, 4502, 1, 3, 3, 3, 3, 903, 903, 903, 903, 6, 7, 'TIAAAA', 'ERGAAA', 'OOOOxx'),
+(2099, 4503, 1, 3, 9, 19, 99, 99, 99, 2099, 2099, 198, 199, 'TCAAAA', 'FRGAAA', 'VVVVxx'),
+(538, 4504, 0, 2, 8, 18, 38, 538, 538, 538, 538, 76, 77, 'SUAAAA', 'GRGAAA', 'AAAAxx'),
+(9177, 4505, 1, 1, 7, 17, 77, 177, 1177, 4177, 9177, 154, 155, 'ZOAAAA', 'HRGAAA', 'HHHHxx'),
+(420, 4506, 0, 0, 0, 0, 20, 420, 420, 420, 420, 40, 41, 'EQAAAA', 'IRGAAA', 'OOOOxx'),
+(9080, 4507, 0, 0, 0, 0, 80, 80, 1080, 4080, 9080, 160, 161, 'GLAAAA', 'JRGAAA', 'VVVVxx'),
+(2630, 4508, 0, 2, 0, 10, 30, 630, 630, 2630, 2630, 60, 61, 'EXAAAA', 'KRGAAA', 'AAAAxx'),
+(5978, 4509, 0, 2, 8, 18, 78, 978, 1978, 978, 5978, 156, 157, 'YVAAAA', 'LRGAAA', 'HHHHxx'),
+(9239, 4510, 1, 3, 9, 19, 39, 239, 1239, 4239, 9239, 78, 79, 'JRAAAA', 'MRGAAA', 'OOOOxx'),
+(4372, 4511, 0, 0, 2, 12, 72, 372, 372, 4372, 4372, 144, 145, 'EMAAAA', 'NRGAAA', 'VVVVxx'),
+(4357, 4512, 1, 1, 7, 17, 57, 357, 357, 4357, 4357, 114, 115, 'PLAAAA', 'ORGAAA', 'AAAAxx'),
+(9857, 4513, 1, 1, 7, 17, 57, 857, 1857, 4857, 9857, 114, 115, 'DPAAAA', 'PRGAAA', 'HHHHxx'),
+(7933, 4514, 1, 1, 3, 13, 33, 933, 1933, 2933, 7933, 66, 67, 'DTAAAA', 'QRGAAA', 'OOOOxx'),
+(9574, 4515, 0, 2, 4, 14, 74, 574, 1574, 4574, 9574, 148, 149, 'GEAAAA', 'RRGAAA', 'VVVVxx'),
+(8294, 4516, 0, 2, 4, 14, 94, 294, 294, 3294, 8294, 188, 189, 'AHAAAA', 'SRGAAA', 'AAAAxx'),
+(627, 4517, 1, 3, 7, 7, 27, 627, 627, 627, 627, 54, 55, 'DYAAAA', 'TRGAAA', 'HHHHxx'),
+(3229, 4518, 1, 1, 9, 9, 29, 229, 1229, 3229, 3229, 58, 59, 'FUAAAA', 'URGAAA', 'OOOOxx'),
+(3163, 4519, 1, 3, 3, 3, 63, 163, 1163, 3163, 3163, 126, 127, 'RRAAAA', 'VRGAAA', 'VVVVxx'),
+(7349, 4520, 1, 1, 9, 9, 49, 349, 1349, 2349, 7349, 98, 99, 'RWAAAA', 'WRGAAA', 'AAAAxx'),
+(6889, 4521, 1, 1, 9, 9, 89, 889, 889, 1889, 6889, 178, 179, 'ZEAAAA', 'XRGAAA', 'HHHHxx'),
+(2101, 4522, 1, 1, 1, 1, 1, 101, 101, 2101, 2101, 2, 3, 'VCAAAA', 'YRGAAA', 'OOOOxx'),
+(6476, 4523, 0, 0, 6, 16, 76, 476, 476, 1476, 6476, 152, 153, 'CPAAAA', 'ZRGAAA', 'VVVVxx'),
+(6765, 4524, 1, 1, 5, 5, 65, 765, 765, 1765, 6765, 130, 131, 'FAAAAA', 'ASGAAA', 'AAAAxx'),
+(4204, 4525, 0, 0, 4, 4, 4, 204, 204, 4204, 4204, 8, 9, 'SFAAAA', 'BSGAAA', 'HHHHxx'),
+(5915, 4526, 1, 3, 5, 15, 15, 915, 1915, 915, 5915, 30, 31, 'NTAAAA', 'CSGAAA', 'OOOOxx'),
+(2318, 4527, 0, 2, 8, 18, 18, 318, 318, 2318, 2318, 36, 37, 'ELAAAA', 'DSGAAA', 'VVVVxx'),
+(294, 4528, 0, 2, 4, 14, 94, 294, 294, 294, 294, 188, 189, 'ILAAAA', 'ESGAAA', 'AAAAxx'),
+(5245, 4529, 1, 1, 5, 5, 45, 245, 1245, 245, 5245, 90, 91, 'TTAAAA', 'FSGAAA', 'HHHHxx'),
+(4481, 4530, 1, 1, 1, 1, 81, 481, 481, 4481, 4481, 162, 163, 'JQAAAA', 'GSGAAA', 'OOOOxx'),
+(7754, 4531, 0, 2, 4, 14, 54, 754, 1754, 2754, 7754, 108, 109, 'GMAAAA', 'HSGAAA', 'VVVVxx'),
+(8494, 4532, 0, 2, 4, 14, 94, 494, 494, 3494, 8494, 188, 189, 'SOAAAA', 'ISGAAA', 'AAAAxx'),
+(4014, 4533, 0, 2, 4, 14, 14, 14, 14, 4014, 4014, 28, 29, 'KYAAAA', 'JSGAAA', 'HHHHxx'),
+(2197, 4534, 1, 1, 7, 17, 97, 197, 197, 2197, 2197, 194, 195, 'NGAAAA', 'KSGAAA', 'OOOOxx'),
+(1297, 4535, 1, 1, 7, 17, 97, 297, 1297, 1297, 1297, 194, 195, 'XXAAAA', 'LSGAAA', 'VVVVxx'),
+(1066, 4536, 0, 2, 6, 6, 66, 66, 1066, 1066, 1066, 132, 133, 'APAAAA', 'MSGAAA', 'AAAAxx'),
+(5710, 4537, 0, 2, 0, 10, 10, 710, 1710, 710, 5710, 20, 21, 'QLAAAA', 'NSGAAA', 'HHHHxx'),
+(4100, 4538, 0, 0, 0, 0, 0, 100, 100, 4100, 4100, 0, 1, 'SBAAAA', 'OSGAAA', 'OOOOxx'),
+(7356, 4539, 0, 0, 6, 16, 56, 356, 1356, 2356, 7356, 112, 113, 'YWAAAA', 'PSGAAA', 'VVVVxx'),
+(7658, 4540, 0, 2, 8, 18, 58, 658, 1658, 2658, 7658, 116, 117, 'OIAAAA', 'QSGAAA', 'AAAAxx'),
+(3666, 4541, 0, 2, 6, 6, 66, 666, 1666, 3666, 3666, 132, 133, 'ALAAAA', 'RSGAAA', 'HHHHxx'),
+(9713, 4542, 1, 1, 3, 13, 13, 713, 1713, 4713, 9713, 26, 27, 'PJAAAA', 'SSGAAA', 'OOOOxx'),
+(691, 4543, 1, 3, 1, 11, 91, 691, 691, 691, 691, 182, 183, 'PAAAAA', 'TSGAAA', 'VVVVxx'),
+(3112, 4544, 0, 0, 2, 12, 12, 112, 1112, 3112, 3112, 24, 25, 'SPAAAA', 'USGAAA', 'AAAAxx'),
+(6035, 4545, 1, 3, 5, 15, 35, 35, 35, 1035, 6035, 70, 71, 'DYAAAA', 'VSGAAA', 'HHHHxx'),
+(8353, 4546, 1, 1, 3, 13, 53, 353, 353, 3353, 8353, 106, 107, 'HJAAAA', 'WSGAAA', 'OOOOxx'),
+(5679, 4547, 1, 3, 9, 19, 79, 679, 1679, 679, 5679, 158, 159, 'LKAAAA', 'XSGAAA', 'VVVVxx'),
+(2124, 4548, 0, 0, 4, 4, 24, 124, 124, 2124, 2124, 48, 49, 'SDAAAA', 'YSGAAA', 'AAAAxx'),
+(4714, 4549, 0, 2, 4, 14, 14, 714, 714, 4714, 4714, 28, 29, 'IZAAAA', 'ZSGAAA', 'HHHHxx'),
+(9048, 4550, 0, 0, 8, 8, 48, 48, 1048, 4048, 9048, 96, 97, 'AKAAAA', 'ATGAAA', 'OOOOxx'),
+(7692, 4551, 0, 0, 2, 12, 92, 692, 1692, 2692, 7692, 184, 185, 'WJAAAA', 'BTGAAA', 'VVVVxx'),
+(4542, 4552, 0, 2, 2, 2, 42, 542, 542, 4542, 4542, 84, 85, 'SSAAAA', 'CTGAAA', 'AAAAxx'),
+(8737, 4553, 1, 1, 7, 17, 37, 737, 737, 3737, 8737, 74, 75, 'BYAAAA', 'DTGAAA', 'HHHHxx'),
+(4977, 4554, 1, 1, 7, 17, 77, 977, 977, 4977, 4977, 154, 155, 'LJAAAA', 'ETGAAA', 'OOOOxx'),
+(9349, 4555, 1, 1, 9, 9, 49, 349, 1349, 4349, 9349, 98, 99, 'PVAAAA', 'FTGAAA', 'VVVVxx'),
+(731, 4556, 1, 3, 1, 11, 31, 731, 731, 731, 731, 62, 63, 'DCAAAA', 'GTGAAA', 'AAAAxx'),
+(1788, 4557, 0, 0, 8, 8, 88, 788, 1788, 1788, 1788, 176, 177, 'UQAAAA', 'HTGAAA', 'HHHHxx'),
+(7830, 4558, 0, 2, 0, 10, 30, 830, 1830, 2830, 7830, 60, 61, 'EPAAAA', 'ITGAAA', 'OOOOxx'),
+(3977, 4559, 1, 1, 7, 17, 77, 977, 1977, 3977, 3977, 154, 155, 'ZWAAAA', 'JTGAAA', 'VVVVxx'),
+(2421, 4560, 1, 1, 1, 1, 21, 421, 421, 2421, 2421, 42, 43, 'DPAAAA', 'KTGAAA', 'AAAAxx'),
+(5891, 4561, 1, 3, 1, 11, 91, 891, 1891, 891, 5891, 182, 183, 'PSAAAA', 'LTGAAA', 'HHHHxx'),
+(1111, 4562, 1, 3, 1, 11, 11, 111, 1111, 1111, 1111, 22, 23, 'TQAAAA', 'MTGAAA', 'OOOOxx'),
+(9224, 4563, 0, 0, 4, 4, 24, 224, 1224, 4224, 9224, 48, 49, 'UQAAAA', 'NTGAAA', 'VVVVxx'),
+(9872, 4564, 0, 0, 2, 12, 72, 872, 1872, 4872, 9872, 144, 145, 'SPAAAA', 'OTGAAA', 'AAAAxx'),
+(2433, 4565, 1, 1, 3, 13, 33, 433, 433, 2433, 2433, 66, 67, 'PPAAAA', 'PTGAAA', 'HHHHxx'),
+(1491, 4566, 1, 3, 1, 11, 91, 491, 1491, 1491, 1491, 182, 183, 'JFAAAA', 'QTGAAA', 'OOOOxx'),
+(6653, 4567, 1, 1, 3, 13, 53, 653, 653, 1653, 6653, 106, 107, 'XVAAAA', 'RTGAAA', 'VVVVxx'),
+(1907, 4568, 1, 3, 7, 7, 7, 907, 1907, 1907, 1907, 14, 15, 'JVAAAA', 'STGAAA', 'AAAAxx'),
+(889, 4569, 1, 1, 9, 9, 89, 889, 889, 889, 889, 178, 179, 'FIAAAA', 'TTGAAA', 'HHHHxx'),
+(561, 4570, 1, 1, 1, 1, 61, 561, 561, 561, 561, 122, 123, 'PVAAAA', 'UTGAAA', 'OOOOxx'),
+(7415, 4571, 1, 3, 5, 15, 15, 415, 1415, 2415, 7415, 30, 31, 'FZAAAA', 'VTGAAA', 'VVVVxx'),
+(2703, 4572, 1, 3, 3, 3, 3, 703, 703, 2703, 2703, 6, 7, 'ZZAAAA', 'WTGAAA', 'AAAAxx'),
+(2561, 4573, 1, 1, 1, 1, 61, 561, 561, 2561, 2561, 122, 123, 'NUAAAA', 'XTGAAA', 'HHHHxx'),
+(1257, 4574, 1, 1, 7, 17, 57, 257, 1257, 1257, 1257, 114, 115, 'JWAAAA', 'YTGAAA', 'OOOOxx'),
+(2390, 4575, 0, 2, 0, 10, 90, 390, 390, 2390, 2390, 180, 181, 'YNAAAA', 'ZTGAAA', 'VVVVxx'),
+(3915, 4576, 1, 3, 5, 15, 15, 915, 1915, 3915, 3915, 30, 31, 'PUAAAA', 'AUGAAA', 'AAAAxx'),
+(8476, 4577, 0, 0, 6, 16, 76, 476, 476, 3476, 8476, 152, 153, 'AOAAAA', 'BUGAAA', 'HHHHxx'),
+(607, 4578, 1, 3, 7, 7, 7, 607, 607, 607, 607, 14, 15, 'JXAAAA', 'CUGAAA', 'OOOOxx'),
+(3891, 4579, 1, 3, 1, 11, 91, 891, 1891, 3891, 3891, 182, 183, 'RTAAAA', 'DUGAAA', 'VVVVxx'),
+(7269, 4580, 1, 1, 9, 9, 69, 269, 1269, 2269, 7269, 138, 139, 'PTAAAA', 'EUGAAA', 'AAAAxx'),
+(9537, 4581, 1, 1, 7, 17, 37, 537, 1537, 4537, 9537, 74, 75, 'VCAAAA', 'FUGAAA', 'HHHHxx'),
+(8518, 4582, 0, 2, 8, 18, 18, 518, 518, 3518, 8518, 36, 37, 'QPAAAA', 'GUGAAA', 'OOOOxx'),
+(5221, 4583, 1, 1, 1, 1, 21, 221, 1221, 221, 5221, 42, 43, 'VSAAAA', 'HUGAAA', 'VVVVxx'),
+(3274, 4584, 0, 2, 4, 14, 74, 274, 1274, 3274, 3274, 148, 149, 'YVAAAA', 'IUGAAA', 'AAAAxx'),
+(6677, 4585, 1, 1, 7, 17, 77, 677, 677, 1677, 6677, 154, 155, 'VWAAAA', 'JUGAAA', 'HHHHxx'),
+(3114, 4586, 0, 2, 4, 14, 14, 114, 1114, 3114, 3114, 28, 29, 'UPAAAA', 'KUGAAA', 'OOOOxx'),
+(1966, 4587, 0, 2, 6, 6, 66, 966, 1966, 1966, 1966, 132, 133, 'QXAAAA', 'LUGAAA', 'VVVVxx'),
+(5941, 4588, 1, 1, 1, 1, 41, 941, 1941, 941, 5941, 82, 83, 'NUAAAA', 'MUGAAA', 'AAAAxx'),
+(9463, 4589, 1, 3, 3, 3, 63, 463, 1463, 4463, 9463, 126, 127, 'ZZAAAA', 'NUGAAA', 'HHHHxx'),
+(8966, 4590, 0, 2, 6, 6, 66, 966, 966, 3966, 8966, 132, 133, 'WGAAAA', 'OUGAAA', 'OOOOxx'),
+(4402, 4591, 0, 2, 2, 2, 2, 402, 402, 4402, 4402, 4, 5, 'INAAAA', 'PUGAAA', 'VVVVxx'),
+(3364, 4592, 0, 0, 4, 4, 64, 364, 1364, 3364, 3364, 128, 129, 'KZAAAA', 'QUGAAA', 'AAAAxx'),
+(3698, 4593, 0, 2, 8, 18, 98, 698, 1698, 3698, 3698, 196, 197, 'GMAAAA', 'RUGAAA', 'HHHHxx'),
+(4651, 4594, 1, 3, 1, 11, 51, 651, 651, 4651, 4651, 102, 103, 'XWAAAA', 'SUGAAA', 'OOOOxx'),
+(2127, 4595, 1, 3, 7, 7, 27, 127, 127, 2127, 2127, 54, 55, 'VDAAAA', 'TUGAAA', 'VVVVxx'),
+(3614, 4596, 0, 2, 4, 14, 14, 614, 1614, 3614, 3614, 28, 29, 'AJAAAA', 'UUGAAA', 'AAAAxx'),
+(5430, 4597, 0, 2, 0, 10, 30, 430, 1430, 430, 5430, 60, 61, 'WAAAAA', 'VUGAAA', 'HHHHxx'),
+(3361, 4598, 1, 1, 1, 1, 61, 361, 1361, 3361, 3361, 122, 123, 'HZAAAA', 'WUGAAA', 'OOOOxx'),
+(4798, 4599, 0, 2, 8, 18, 98, 798, 798, 4798, 4798, 196, 197, 'OCAAAA', 'XUGAAA', 'VVVVxx'),
+(8269, 4600, 1, 1, 9, 9, 69, 269, 269, 3269, 8269, 138, 139, 'BGAAAA', 'YUGAAA', 'AAAAxx'),
+(6458, 4601, 0, 2, 8, 18, 58, 458, 458, 1458, 6458, 116, 117, 'KOAAAA', 'ZUGAAA', 'HHHHxx'),
+(3358, 4602, 0, 2, 8, 18, 58, 358, 1358, 3358, 3358, 116, 117, 'EZAAAA', 'AVGAAA', 'OOOOxx'),
+(5898, 4603, 0, 2, 8, 18, 98, 898, 1898, 898, 5898, 196, 197, 'WSAAAA', 'BVGAAA', 'VVVVxx'),
+(1880, 4604, 0, 0, 0, 0, 80, 880, 1880, 1880, 1880, 160, 161, 'IUAAAA', 'CVGAAA', 'AAAAxx'),
+(782, 4605, 0, 2, 2, 2, 82, 782, 782, 782, 782, 164, 165, 'CEAAAA', 'DVGAAA', 'HHHHxx'),
+(3102, 4606, 0, 2, 2, 2, 2, 102, 1102, 3102, 3102, 4, 5, 'IPAAAA', 'EVGAAA', 'OOOOxx'),
+(6366, 4607, 0, 2, 6, 6, 66, 366, 366, 1366, 6366, 132, 133, 'WKAAAA', 'FVGAAA', 'VVVVxx'),
+(399, 4608, 1, 3, 9, 19, 99, 399, 399, 399, 399, 198, 199, 'JPAAAA', 'GVGAAA', 'AAAAxx'),
+(6773, 4609, 1, 1, 3, 13, 73, 773, 773, 1773, 6773, 146, 147, 'NAAAAA', 'HVGAAA', 'HHHHxx'),
+(7942, 4610, 0, 2, 2, 2, 42, 942, 1942, 2942, 7942, 84, 85, 'MTAAAA', 'IVGAAA', 'OOOOxx'),
+(6274, 4611, 0, 2, 4, 14, 74, 274, 274, 1274, 6274, 148, 149, 'IHAAAA', 'JVGAAA', 'VVVVxx'),
+(7447, 4612, 1, 3, 7, 7, 47, 447, 1447, 2447, 7447, 94, 95, 'LAAAAA', 'KVGAAA', 'AAAAxx'),
+(7648, 4613, 0, 0, 8, 8, 48, 648, 1648, 2648, 7648, 96, 97, 'EIAAAA', 'LVGAAA', 'HHHHxx'),
+(3997, 4614, 1, 1, 7, 17, 97, 997, 1997, 3997, 3997, 194, 195, 'TXAAAA', 'MVGAAA', 'OOOOxx'),
+(1759, 4615, 1, 3, 9, 19, 59, 759, 1759, 1759, 1759, 118, 119, 'RPAAAA', 'NVGAAA', 'VVVVxx'),
+(1785, 4616, 1, 1, 5, 5, 85, 785, 1785, 1785, 1785, 170, 171, 'RQAAAA', 'OVGAAA', 'AAAAxx'),
+(8930, 4617, 0, 2, 0, 10, 30, 930, 930, 3930, 8930, 60, 61, 'MFAAAA', 'PVGAAA', 'HHHHxx'),
+(7595, 4618, 1, 3, 5, 15, 95, 595, 1595, 2595, 7595, 190, 191, 'DGAAAA', 'QVGAAA', 'OOOOxx'),
+(6752, 4619, 0, 0, 2, 12, 52, 752, 752, 1752, 6752, 104, 105, 'SZAAAA', 'RVGAAA', 'VVVVxx'),
+(5635, 4620, 1, 3, 5, 15, 35, 635, 1635, 635, 5635, 70, 71, 'TIAAAA', 'SVGAAA', 'AAAAxx'),
+(1579, 4621, 1, 3, 9, 19, 79, 579, 1579, 1579, 1579, 158, 159, 'TIAAAA', 'TVGAAA', 'HHHHxx'),
+(7743, 4622, 1, 3, 3, 3, 43, 743, 1743, 2743, 7743, 86, 87, 'VLAAAA', 'UVGAAA', 'OOOOxx'),
+(5856, 4623, 0, 0, 6, 16, 56, 856, 1856, 856, 5856, 112, 113, 'GRAAAA', 'VVGAAA', 'VVVVxx'),
+(7273, 4624, 1, 1, 3, 13, 73, 273, 1273, 2273, 7273, 146, 147, 'TTAAAA', 'WVGAAA', 'AAAAxx'),
+(1399, 4625, 1, 3, 9, 19, 99, 399, 1399, 1399, 1399, 198, 199, 'VBAAAA', 'XVGAAA', 'HHHHxx'),
+(3694, 4626, 0, 2, 4, 14, 94, 694, 1694, 3694, 3694, 188, 189, 'CMAAAA', 'YVGAAA', 'OOOOxx'),
+(2782, 4627, 0, 2, 2, 2, 82, 782, 782, 2782, 2782, 164, 165, 'ADAAAA', 'ZVGAAA', 'VVVVxx'),
+(6951, 4628, 1, 3, 1, 11, 51, 951, 951, 1951, 6951, 102, 103, 'JHAAAA', 'AWGAAA', 'AAAAxx'),
+(6053, 4629, 1, 1, 3, 13, 53, 53, 53, 1053, 6053, 106, 107, 'VYAAAA', 'BWGAAA', 'HHHHxx'),
+(1753, 4630, 1, 1, 3, 13, 53, 753, 1753, 1753, 1753, 106, 107, 'LPAAAA', 'CWGAAA', 'OOOOxx'),
+(3985, 4631, 1, 1, 5, 5, 85, 985, 1985, 3985, 3985, 170, 171, 'HXAAAA', 'DWGAAA', 'VVVVxx'),
+(6159, 4632, 1, 3, 9, 19, 59, 159, 159, 1159, 6159, 118, 119, 'XCAAAA', 'EWGAAA', 'AAAAxx'),
+(6250, 4633, 0, 2, 0, 10, 50, 250, 250, 1250, 6250, 100, 101, 'KGAAAA', 'FWGAAA', 'HHHHxx'),
+(6240, 4634, 0, 0, 0, 0, 40, 240, 240, 1240, 6240, 80, 81, 'AGAAAA', 'GWGAAA', 'OOOOxx'),
+(6571, 4635, 1, 3, 1, 11, 71, 571, 571, 1571, 6571, 142, 143, 'TSAAAA', 'HWGAAA', 'VVVVxx'),
+(8624, 4636, 0, 0, 4, 4, 24, 624, 624, 3624, 8624, 48, 49, 'STAAAA', 'IWGAAA', 'AAAAxx'),
+(9718, 4637, 0, 2, 8, 18, 18, 718, 1718, 4718, 9718, 36, 37, 'UJAAAA', 'JWGAAA', 'HHHHxx'),
+(5529, 4638, 1, 1, 9, 9, 29, 529, 1529, 529, 5529, 58, 59, 'REAAAA', 'KWGAAA', 'OOOOxx'),
+(7089, 4639, 1, 1, 9, 9, 89, 89, 1089, 2089, 7089, 178, 179, 'RMAAAA', 'LWGAAA', 'VVVVxx'),
+(5488, 4640, 0, 0, 8, 8, 88, 488, 1488, 488, 5488, 176, 177, 'CDAAAA', 'MWGAAA', 'AAAAxx'),
+(5444, 4641, 0, 0, 4, 4, 44, 444, 1444, 444, 5444, 88, 89, 'KBAAAA', 'NWGAAA', 'HHHHxx'),
+(4899, 4642, 1, 3, 9, 19, 99, 899, 899, 4899, 4899, 198, 199, 'LGAAAA', 'OWGAAA', 'OOOOxx'),
+(7928, 4643, 0, 0, 8, 8, 28, 928, 1928, 2928, 7928, 56, 57, 'YSAAAA', 'PWGAAA', 'VVVVxx'),
+(4736, 4644, 0, 0, 6, 16, 36, 736, 736, 4736, 4736, 72, 73, 'EAAAAA', 'QWGAAA', 'AAAAxx'),
+(4317, 4645, 1, 1, 7, 17, 17, 317, 317, 4317, 4317, 34, 35, 'BKAAAA', 'RWGAAA', 'HHHHxx'),
+(1174, 4646, 0, 2, 4, 14, 74, 174, 1174, 1174, 1174, 148, 149, 'ETAAAA', 'SWGAAA', 'OOOOxx'),
+(6138, 4647, 0, 2, 8, 18, 38, 138, 138, 1138, 6138, 76, 77, 'CCAAAA', 'TWGAAA', 'VVVVxx'),
+(3943, 4648, 1, 3, 3, 3, 43, 943, 1943, 3943, 3943, 86, 87, 'RVAAAA', 'UWGAAA', 'AAAAxx'),
+(1545, 4649, 1, 1, 5, 5, 45, 545, 1545, 1545, 1545, 90, 91, 'LHAAAA', 'VWGAAA', 'HHHHxx'),
+(6867, 4650, 1, 3, 7, 7, 67, 867, 867, 1867, 6867, 134, 135, 'DEAAAA', 'WWGAAA', 'OOOOxx'),
+(6832, 4651, 0, 0, 2, 12, 32, 832, 832, 1832, 6832, 64, 65, 'UCAAAA', 'XWGAAA', 'VVVVxx'),
+(2987, 4652, 1, 3, 7, 7, 87, 987, 987, 2987, 2987, 174, 175, 'XKAAAA', 'YWGAAA', 'AAAAxx'),
+(5169, 4653, 1, 1, 9, 9, 69, 169, 1169, 169, 5169, 138, 139, 'VQAAAA', 'ZWGAAA', 'HHHHxx'),
+(8998, 4654, 0, 2, 8, 18, 98, 998, 998, 3998, 8998, 196, 197, 'CIAAAA', 'AXGAAA', 'OOOOxx'),
+(9347, 4655, 1, 3, 7, 7, 47, 347, 1347, 4347, 9347, 94, 95, 'NVAAAA', 'BXGAAA', 'VVVVxx'),
+(4800, 4656, 0, 0, 0, 0, 0, 800, 800, 4800, 4800, 0, 1, 'QCAAAA', 'CXGAAA', 'AAAAxx'),
+(4200, 4657, 0, 0, 0, 0, 0, 200, 200, 4200, 4200, 0, 1, 'OFAAAA', 'DXGAAA', 'HHHHxx'),
+(4046, 4658, 0, 2, 6, 6, 46, 46, 46, 4046, 4046, 92, 93, 'QZAAAA', 'EXGAAA', 'OOOOxx'),
+(7142, 4659, 0, 2, 2, 2, 42, 142, 1142, 2142, 7142, 84, 85, 'SOAAAA', 'FXGAAA', 'VVVVxx'),
+(2733, 4660, 1, 1, 3, 13, 33, 733, 733, 2733, 2733, 66, 67, 'DBAAAA', 'GXGAAA', 'AAAAxx'),
+(1568, 4661, 0, 0, 8, 8, 68, 568, 1568, 1568, 1568, 136, 137, 'IIAAAA', 'HXGAAA', 'HHHHxx'),
+(5105, 4662, 1, 1, 5, 5, 5, 105, 1105, 105, 5105, 10, 11, 'JOAAAA', 'IXGAAA', 'OOOOxx'),
+(9115, 4663, 1, 3, 5, 15, 15, 115, 1115, 4115, 9115, 30, 31, 'PMAAAA', 'JXGAAA', 'VVVVxx'),
+(6475, 4664, 1, 3, 5, 15, 75, 475, 475, 1475, 6475, 150, 151, 'BPAAAA', 'KXGAAA', 'AAAAxx'),
+(3796, 4665, 0, 0, 6, 16, 96, 796, 1796, 3796, 3796, 192, 193, 'AQAAAA', 'LXGAAA', 'HHHHxx'),
+(5410, 4666, 0, 2, 0, 10, 10, 410, 1410, 410, 5410, 20, 21, 'CAAAAA', 'MXGAAA', 'OOOOxx'),
+(4023, 4667, 1, 3, 3, 3, 23, 23, 23, 4023, 4023, 46, 47, 'TYAAAA', 'NXGAAA', 'VVVVxx'),
+(8904, 4668, 0, 0, 4, 4, 4, 904, 904, 3904, 8904, 8, 9, 'MEAAAA', 'OXGAAA', 'AAAAxx'),
+(450, 4669, 0, 2, 0, 10, 50, 450, 450, 450, 450, 100, 101, 'IRAAAA', 'PXGAAA', 'HHHHxx'),
+(8087, 4670, 1, 3, 7, 7, 87, 87, 87, 3087, 8087, 174, 175, 'BZAAAA', 'QXGAAA', 'OOOOxx'),
+(6478, 4671, 0, 2, 8, 18, 78, 478, 478, 1478, 6478, 156, 157, 'EPAAAA', 'RXGAAA', 'VVVVxx'),
+(2696, 4672, 0, 0, 6, 16, 96, 696, 696, 2696, 2696, 192, 193, 'SZAAAA', 'SXGAAA', 'AAAAxx'),
+(1792, 4673, 0, 0, 2, 12, 92, 792, 1792, 1792, 1792, 184, 185, 'YQAAAA', 'TXGAAA', 'HHHHxx'),
+(9699, 4674, 1, 3, 9, 19, 99, 699, 1699, 4699, 9699, 198, 199, 'BJAAAA', 'UXGAAA', 'OOOOxx'),
+(9160, 4675, 0, 0, 0, 0, 60, 160, 1160, 4160, 9160, 120, 121, 'IOAAAA', 'VXGAAA', 'VVVVxx'),
+(9989, 4676, 1, 1, 9, 9, 89, 989, 1989, 4989, 9989, 178, 179, 'FUAAAA', 'WXGAAA', 'AAAAxx'),
+(9568, 4677, 0, 0, 8, 8, 68, 568, 1568, 4568, 9568, 136, 137, 'AEAAAA', 'XXGAAA', 'HHHHxx'),
+(487, 4678, 1, 3, 7, 7, 87, 487, 487, 487, 487, 174, 175, 'TSAAAA', 'YXGAAA', 'OOOOxx'),
+(7863, 4679, 1, 3, 3, 3, 63, 863, 1863, 2863, 7863, 126, 127, 'LQAAAA', 'ZXGAAA', 'VVVVxx'),
+(1884, 4680, 0, 0, 4, 4, 84, 884, 1884, 1884, 1884, 168, 169, 'MUAAAA', 'AYGAAA', 'AAAAxx'),
+(2651, 4681, 1, 3, 1, 11, 51, 651, 651, 2651, 2651, 102, 103, 'ZXAAAA', 'BYGAAA', 'HHHHxx'),
+(8285, 4682, 1, 1, 5, 5, 85, 285, 285, 3285, 8285, 170, 171, 'RGAAAA', 'CYGAAA', 'OOOOxx'),
+(3927, 4683, 1, 3, 7, 7, 27, 927, 1927, 3927, 3927, 54, 55, 'BVAAAA', 'DYGAAA', 'VVVVxx'),
+(4076, 4684, 0, 0, 6, 16, 76, 76, 76, 4076, 4076, 152, 153, 'UAAAAA', 'EYGAAA', 'AAAAxx'),
+(6149, 4685, 1, 1, 9, 9, 49, 149, 149, 1149, 6149, 98, 99, 'NCAAAA', 'FYGAAA', 'HHHHxx'),
+(6581, 4686, 1, 1, 1, 1, 81, 581, 581, 1581, 6581, 162, 163, 'DTAAAA', 'GYGAAA', 'OOOOxx'),
+(8293, 4687, 1, 1, 3, 13, 93, 293, 293, 3293, 8293, 186, 187, 'ZGAAAA', 'HYGAAA', 'VVVVxx'),
+(7665, 4688, 1, 1, 5, 5, 65, 665, 1665, 2665, 7665, 130, 131, 'VIAAAA', 'IYGAAA', 'AAAAxx'),
+(4435, 4689, 1, 3, 5, 15, 35, 435, 435, 4435, 4435, 70, 71, 'POAAAA', 'JYGAAA', 'HHHHxx'),
+(1271, 4690, 1, 3, 1, 11, 71, 271, 1271, 1271, 1271, 142, 143, 'XWAAAA', 'KYGAAA', 'OOOOxx'),
+(3928, 4691, 0, 0, 8, 8, 28, 928, 1928, 3928, 3928, 56, 57, 'CVAAAA', 'LYGAAA', 'VVVVxx'),
+(7045, 4692, 1, 1, 5, 5, 45, 45, 1045, 2045, 7045, 90, 91, 'ZKAAAA', 'MYGAAA', 'AAAAxx'),
+(4943, 4693, 1, 3, 3, 3, 43, 943, 943, 4943, 4943, 86, 87, 'DIAAAA', 'NYGAAA', 'HHHHxx'),
+(8473, 4694, 1, 1, 3, 13, 73, 473, 473, 3473, 8473, 146, 147, 'XNAAAA', 'OYGAAA', 'OOOOxx'),
+(1707, 4695, 1, 3, 7, 7, 7, 707, 1707, 1707, 1707, 14, 15, 'RNAAAA', 'PYGAAA', 'VVVVxx'),
+(7509, 4696, 1, 1, 9, 9, 9, 509, 1509, 2509, 7509, 18, 19, 'VCAAAA', 'QYGAAA', 'AAAAxx'),
+(1593, 4697, 1, 1, 3, 13, 93, 593, 1593, 1593, 1593, 186, 187, 'HJAAAA', 'RYGAAA', 'HHHHxx'),
+(9281, 4698, 1, 1, 1, 1, 81, 281, 1281, 4281, 9281, 162, 163, 'ZSAAAA', 'SYGAAA', 'OOOOxx'),
+(8986, 4699, 0, 2, 6, 6, 86, 986, 986, 3986, 8986, 172, 173, 'QHAAAA', 'TYGAAA', 'VVVVxx'),
+(3740, 4700, 0, 0, 0, 0, 40, 740, 1740, 3740, 3740, 80, 81, 'WNAAAA', 'UYGAAA', 'AAAAxx'),
+(9265, 4701, 1, 1, 5, 5, 65, 265, 1265, 4265, 9265, 130, 131, 'JSAAAA', 'VYGAAA', 'HHHHxx'),
+(1510, 4702, 0, 2, 0, 10, 10, 510, 1510, 1510, 1510, 20, 21, 'CGAAAA', 'WYGAAA', 'OOOOxx'),
+(3022, 4703, 0, 2, 2, 2, 22, 22, 1022, 3022, 3022, 44, 45, 'GMAAAA', 'XYGAAA', 'VVVVxx'),
+(9014, 4704, 0, 2, 4, 14, 14, 14, 1014, 4014, 9014, 28, 29, 'SIAAAA', 'YYGAAA', 'AAAAxx'),
+(6816, 4705, 0, 0, 6, 16, 16, 816, 816, 1816, 6816, 32, 33, 'ECAAAA', 'ZYGAAA', 'HHHHxx'),
+(5518, 4706, 0, 2, 8, 18, 18, 518, 1518, 518, 5518, 36, 37, 'GEAAAA', 'AZGAAA', 'OOOOxx'),
+(4451, 4707, 1, 3, 1, 11, 51, 451, 451, 4451, 4451, 102, 103, 'FPAAAA', 'BZGAAA', 'VVVVxx'),
+(8747, 4708, 1, 3, 7, 7, 47, 747, 747, 3747, 8747, 94, 95, 'LYAAAA', 'CZGAAA', 'AAAAxx'),
+(4646, 4709, 0, 2, 6, 6, 46, 646, 646, 4646, 4646, 92, 93, 'SWAAAA', 'DZGAAA', 'HHHHxx'),
+(7296, 4710, 0, 0, 6, 16, 96, 296, 1296, 2296, 7296, 192, 193, 'QUAAAA', 'EZGAAA', 'OOOOxx'),
+(9644, 4711, 0, 0, 4, 4, 44, 644, 1644, 4644, 9644, 88, 89, 'YGAAAA', 'FZGAAA', 'VVVVxx'),
+(5977, 4712, 1, 1, 7, 17, 77, 977, 1977, 977, 5977, 154, 155, 'XVAAAA', 'GZGAAA', 'AAAAxx'),
+(6270, 4713, 0, 2, 0, 10, 70, 270, 270, 1270, 6270, 140, 141, 'EHAAAA', 'HZGAAA', 'HHHHxx'),
+(5578, 4714, 0, 2, 8, 18, 78, 578, 1578, 578, 5578, 156, 157, 'OGAAAA', 'IZGAAA', 'OOOOxx'),
+(2465, 4715, 1, 1, 5, 5, 65, 465, 465, 2465, 2465, 130, 131, 'VQAAAA', 'JZGAAA', 'VVVVxx'),
+(6436, 4716, 0, 0, 6, 16, 36, 436, 436, 1436, 6436, 72, 73, 'ONAAAA', 'KZGAAA', 'AAAAxx'),
+(8089, 4717, 1, 1, 9, 9, 89, 89, 89, 3089, 8089, 178, 179, 'DZAAAA', 'LZGAAA', 'HHHHxx'),
+(2409, 4718, 1, 1, 9, 9, 9, 409, 409, 2409, 2409, 18, 19, 'ROAAAA', 'MZGAAA', 'OOOOxx'),
+(284, 4719, 0, 0, 4, 4, 84, 284, 284, 284, 284, 168, 169, 'YKAAAA', 'NZGAAA', 'VVVVxx'),
+(5576, 4720, 0, 0, 6, 16, 76, 576, 1576, 576, 5576, 152, 153, 'MGAAAA', 'OZGAAA', 'AAAAxx'),
+(6534, 4721, 0, 2, 4, 14, 34, 534, 534, 1534, 6534, 68, 69, 'IRAAAA', 'PZGAAA', 'HHHHxx'),
+(8848, 4722, 0, 0, 8, 8, 48, 848, 848, 3848, 8848, 96, 97, 'ICAAAA', 'QZGAAA', 'OOOOxx'),
+(4305, 4723, 1, 1, 5, 5, 5, 305, 305, 4305, 4305, 10, 11, 'PJAAAA', 'RZGAAA', 'VVVVxx'),
+(5574, 4724, 0, 2, 4, 14, 74, 574, 1574, 574, 5574, 148, 149, 'KGAAAA', 'SZGAAA', 'AAAAxx'),
+(596, 4725, 0, 0, 6, 16, 96, 596, 596, 596, 596, 192, 193, 'YWAAAA', 'TZGAAA', 'HHHHxx'),
+(1253, 4726, 1, 1, 3, 13, 53, 253, 1253, 1253, 1253, 106, 107, 'FWAAAA', 'UZGAAA', 'OOOOxx'),
+(521, 4727, 1, 1, 1, 1, 21, 521, 521, 521, 521, 42, 43, 'BUAAAA', 'VZGAAA', 'VVVVxx'),
+(8739, 4728, 1, 3, 9, 19, 39, 739, 739, 3739, 8739, 78, 79, 'DYAAAA', 'WZGAAA', 'AAAAxx'),
+(908, 4729, 0, 0, 8, 8, 8, 908, 908, 908, 908, 16, 17, 'YIAAAA', 'XZGAAA', 'HHHHxx'),
+(6937, 4730, 1, 1, 7, 17, 37, 937, 937, 1937, 6937, 74, 75, 'VGAAAA', 'YZGAAA', 'OOOOxx'),
+(4515, 4731, 1, 3, 5, 15, 15, 515, 515, 4515, 4515, 30, 31, 'RRAAAA', 'ZZGAAA', 'VVVVxx'),
+(8630, 4732, 0, 2, 0, 10, 30, 630, 630, 3630, 8630, 60, 61, 'YTAAAA', 'AAHAAA', 'AAAAxx'),
+(7518, 4733, 0, 2, 8, 18, 18, 518, 1518, 2518, 7518, 36, 37, 'EDAAAA', 'BAHAAA', 'HHHHxx'),
+(8300, 4734, 0, 0, 0, 0, 0, 300, 300, 3300, 8300, 0, 1, 'GHAAAA', 'CAHAAA', 'OOOOxx'),
+(8434, 4735, 0, 2, 4, 14, 34, 434, 434, 3434, 8434, 68, 69, 'KMAAAA', 'DAHAAA', 'VVVVxx'),
+(6000, 4736, 0, 0, 0, 0, 0, 0, 0, 1000, 6000, 0, 1, 'UWAAAA', 'EAHAAA', 'AAAAxx'),
+(4508, 4737, 0, 0, 8, 8, 8, 508, 508, 4508, 4508, 16, 17, 'KRAAAA', 'FAHAAA', 'HHHHxx'),
+(7861, 4738, 1, 1, 1, 1, 61, 861, 1861, 2861, 7861, 122, 123, 'JQAAAA', 'GAHAAA', 'OOOOxx'),
+(5953, 4739, 1, 1, 3, 13, 53, 953, 1953, 953, 5953, 106, 107, 'ZUAAAA', 'HAHAAA', 'VVVVxx'),
+(5063, 4740, 1, 3, 3, 3, 63, 63, 1063, 63, 5063, 126, 127, 'TMAAAA', 'IAHAAA', 'AAAAxx'),
+(4501, 4741, 1, 1, 1, 1, 1, 501, 501, 4501, 4501, 2, 3, 'DRAAAA', 'JAHAAA', 'HHHHxx'),
+(7092, 4742, 0, 0, 2, 12, 92, 92, 1092, 2092, 7092, 184, 185, 'UMAAAA', 'KAHAAA', 'OOOOxx'),
+(4388, 4743, 0, 0, 8, 8, 88, 388, 388, 4388, 4388, 176, 177, 'UMAAAA', 'LAHAAA', 'VVVVxx'),
+(1826, 4744, 0, 2, 6, 6, 26, 826, 1826, 1826, 1826, 52, 53, 'GSAAAA', 'MAHAAA', 'AAAAxx'),
+(568, 4745, 0, 0, 8, 8, 68, 568, 568, 568, 568, 136, 137, 'WVAAAA', 'NAHAAA', 'HHHHxx'),
+(8184, 4746, 0, 0, 4, 4, 84, 184, 184, 3184, 8184, 168, 169, 'UCAAAA', 'OAHAAA', 'OOOOxx'),
+(4268, 4747, 0, 0, 8, 8, 68, 268, 268, 4268, 4268, 136, 137, 'EIAAAA', 'PAHAAA', 'VVVVxx'),
+(5798, 4748, 0, 2, 8, 18, 98, 798, 1798, 798, 5798, 196, 197, 'APAAAA', 'QAHAAA', 'AAAAxx'),
+(5190, 4749, 0, 2, 0, 10, 90, 190, 1190, 190, 5190, 180, 181, 'QRAAAA', 'RAHAAA', 'HHHHxx'),
+(1298, 4750, 0, 2, 8, 18, 98, 298, 1298, 1298, 1298, 196, 197, 'YXAAAA', 'SAHAAA', 'OOOOxx'),
+(4035, 4751, 1, 3, 5, 15, 35, 35, 35, 4035, 4035, 70, 71, 'FZAAAA', 'TAHAAA', 'VVVVxx'),
+(4504, 4752, 0, 0, 4, 4, 4, 504, 504, 4504, 4504, 8, 9, 'GRAAAA', 'UAHAAA', 'AAAAxx'),
+(5992, 4753, 0, 0, 2, 12, 92, 992, 1992, 992, 5992, 184, 185, 'MWAAAA', 'VAHAAA', 'HHHHxx'),
+(770, 4754, 0, 2, 0, 10, 70, 770, 770, 770, 770, 140, 141, 'QDAAAA', 'WAHAAA', 'OOOOxx'),
+(7502, 4755, 0, 2, 2, 2, 2, 502, 1502, 2502, 7502, 4, 5, 'OCAAAA', 'XAHAAA', 'VVVVxx'),
+(824, 4756, 0, 0, 4, 4, 24, 824, 824, 824, 824, 48, 49, 'SFAAAA', 'YAHAAA', 'AAAAxx'),
+(7716, 4757, 0, 0, 6, 16, 16, 716, 1716, 2716, 7716, 32, 33, 'UKAAAA', 'ZAHAAA', 'HHHHxx'),
+(5749, 4758, 1, 1, 9, 9, 49, 749, 1749, 749, 5749, 98, 99, 'DNAAAA', 'ABHAAA', 'OOOOxx'),
+(9814, 4759, 0, 2, 4, 14, 14, 814, 1814, 4814, 9814, 28, 29, 'MNAAAA', 'BBHAAA', 'VVVVxx'),
+(350, 4760, 0, 2, 0, 10, 50, 350, 350, 350, 350, 100, 101, 'MNAAAA', 'CBHAAA', 'AAAAxx'),
+(1390, 4761, 0, 2, 0, 10, 90, 390, 1390, 1390, 1390, 180, 181, 'MBAAAA', 'DBHAAA', 'HHHHxx'),
+(6994, 4762, 0, 2, 4, 14, 94, 994, 994, 1994, 6994, 188, 189, 'AJAAAA', 'EBHAAA', 'OOOOxx'),
+(3629, 4763, 1, 1, 9, 9, 29, 629, 1629, 3629, 3629, 58, 59, 'PJAAAA', 'FBHAAA', 'VVVVxx'),
+(9937, 4764, 1, 1, 7, 17, 37, 937, 1937, 4937, 9937, 74, 75, 'FSAAAA', 'GBHAAA', 'AAAAxx'),
+(5285, 4765, 1, 1, 5, 5, 85, 285, 1285, 285, 5285, 170, 171, 'HVAAAA', 'HBHAAA', 'HHHHxx'),
+(3157, 4766, 1, 1, 7, 17, 57, 157, 1157, 3157, 3157, 114, 115, 'LRAAAA', 'IBHAAA', 'OOOOxx'),
+(9549, 4767, 1, 1, 9, 9, 49, 549, 1549, 4549, 9549, 98, 99, 'HDAAAA', 'JBHAAA', 'VVVVxx'),
+(4118, 4768, 0, 2, 8, 18, 18, 118, 118, 4118, 4118, 36, 37, 'KCAAAA', 'KBHAAA', 'AAAAxx'),
+(756, 4769, 0, 0, 6, 16, 56, 756, 756, 756, 756, 112, 113, 'CDAAAA', 'LBHAAA', 'HHHHxx'),
+(5964, 4770, 0, 0, 4, 4, 64, 964, 1964, 964, 5964, 128, 129, 'KVAAAA', 'MBHAAA', 'OOOOxx'),
+(7701, 4771, 1, 1, 1, 1, 1, 701, 1701, 2701, 7701, 2, 3, 'FKAAAA', 'NBHAAA', 'VVVVxx'),
+(1242, 4772, 0, 2, 2, 2, 42, 242, 1242, 1242, 1242, 84, 85, 'UVAAAA', 'OBHAAA', 'AAAAxx'),
+(7890, 4773, 0, 2, 0, 10, 90, 890, 1890, 2890, 7890, 180, 181, 'MRAAAA', 'PBHAAA', 'HHHHxx'),
+(1991, 4774, 1, 3, 1, 11, 91, 991, 1991, 1991, 1991, 182, 183, 'PYAAAA', 'QBHAAA', 'OOOOxx'),
+(110, 4775, 0, 2, 0, 10, 10, 110, 110, 110, 110, 20, 21, 'GEAAAA', 'RBHAAA', 'VVVVxx'),
+(9334, 4776, 0, 2, 4, 14, 34, 334, 1334, 4334, 9334, 68, 69, 'AVAAAA', 'SBHAAA', 'AAAAxx'),
+(6231, 4777, 1, 3, 1, 11, 31, 231, 231, 1231, 6231, 62, 63, 'RFAAAA', 'TBHAAA', 'HHHHxx'),
+(9871, 4778, 1, 3, 1, 11, 71, 871, 1871, 4871, 9871, 142, 143, 'RPAAAA', 'UBHAAA', 'OOOOxx'),
+(9471, 4779, 1, 3, 1, 11, 71, 471, 1471, 4471, 9471, 142, 143, 'HAAAAA', 'VBHAAA', 'VVVVxx'),
+(2697, 4780, 1, 1, 7, 17, 97, 697, 697, 2697, 2697, 194, 195, 'TZAAAA', 'WBHAAA', 'AAAAxx'),
+(4761, 4781, 1, 1, 1, 1, 61, 761, 761, 4761, 4761, 122, 123, 'DBAAAA', 'XBHAAA', 'HHHHxx'),
+(8493, 4782, 1, 1, 3, 13, 93, 493, 493, 3493, 8493, 186, 187, 'ROAAAA', 'YBHAAA', 'OOOOxx'),
+(1045, 4783, 1, 1, 5, 5, 45, 45, 1045, 1045, 1045, 90, 91, 'FOAAAA', 'ZBHAAA', 'VVVVxx'),
+(3403, 4784, 1, 3, 3, 3, 3, 403, 1403, 3403, 3403, 6, 7, 'XAAAAA', 'ACHAAA', 'AAAAxx'),
+(9412, 4785, 0, 0, 2, 12, 12, 412, 1412, 4412, 9412, 24, 25, 'AYAAAA', 'BCHAAA', 'HHHHxx'),
+(7652, 4786, 0, 0, 2, 12, 52, 652, 1652, 2652, 7652, 104, 105, 'IIAAAA', 'CCHAAA', 'OOOOxx'),
+(5866, 4787, 0, 2, 6, 6, 66, 866, 1866, 866, 5866, 132, 133, 'QRAAAA', 'DCHAAA', 'VVVVxx'),
+(6942, 4788, 0, 2, 2, 2, 42, 942, 942, 1942, 6942, 84, 85, 'AHAAAA', 'ECHAAA', 'AAAAxx'),
+(9353, 4789, 1, 1, 3, 13, 53, 353, 1353, 4353, 9353, 106, 107, 'TVAAAA', 'FCHAAA', 'HHHHxx'),
+(2600, 4790, 0, 0, 0, 0, 0, 600, 600, 2600, 2600, 0, 1, 'AWAAAA', 'GCHAAA', 'OOOOxx'),
+(6971, 4791, 1, 3, 1, 11, 71, 971, 971, 1971, 6971, 142, 143, 'DIAAAA', 'HCHAAA', 'VVVVxx'),
+(5391, 4792, 1, 3, 1, 11, 91, 391, 1391, 391, 5391, 182, 183, 'JZAAAA', 'ICHAAA', 'AAAAxx'),
+(7654, 4793, 0, 2, 4, 14, 54, 654, 1654, 2654, 7654, 108, 109, 'KIAAAA', 'JCHAAA', 'HHHHxx'),
+(1797, 4794, 1, 1, 7, 17, 97, 797, 1797, 1797, 1797, 194, 195, 'DRAAAA', 'KCHAAA', 'OOOOxx'),
+(4530, 4795, 0, 2, 0, 10, 30, 530, 530, 4530, 4530, 60, 61, 'GSAAAA', 'LCHAAA', 'VVVVxx'),
+(3130, 4796, 0, 2, 0, 10, 30, 130, 1130, 3130, 3130, 60, 61, 'KQAAAA', 'MCHAAA', 'AAAAxx'),
+(9442, 4797, 0, 2, 2, 2, 42, 442, 1442, 4442, 9442, 84, 85, 'EZAAAA', 'NCHAAA', 'HHHHxx'),
+(6659, 4798, 1, 3, 9, 19, 59, 659, 659, 1659, 6659, 118, 119, 'DWAAAA', 'OCHAAA', 'OOOOxx'),
+(9714, 4799, 0, 2, 4, 14, 14, 714, 1714, 4714, 9714, 28, 29, 'QJAAAA', 'PCHAAA', 'VVVVxx'),
+(3660, 4800, 0, 0, 0, 0, 60, 660, 1660, 3660, 3660, 120, 121, 'UKAAAA', 'QCHAAA', 'AAAAxx'),
+(1906, 4801, 0, 2, 6, 6, 6, 906, 1906, 1906, 1906, 12, 13, 'IVAAAA', 'RCHAAA', 'HHHHxx'),
+(7927, 4802, 1, 3, 7, 7, 27, 927, 1927, 2927, 7927, 54, 55, 'XSAAAA', 'SCHAAA', 'OOOOxx'),
+(1767, 4803, 1, 3, 7, 7, 67, 767, 1767, 1767, 1767, 134, 135, 'ZPAAAA', 'TCHAAA', 'VVVVxx'),
+(5523, 4804, 1, 3, 3, 3, 23, 523, 1523, 523, 5523, 46, 47, 'LEAAAA', 'UCHAAA', 'AAAAxx'),
+(9289, 4805, 1, 1, 9, 9, 89, 289, 1289, 4289, 9289, 178, 179, 'HTAAAA', 'VCHAAA', 'HHHHxx'),
+(2717, 4806, 1, 1, 7, 17, 17, 717, 717, 2717, 2717, 34, 35, 'NAAAAA', 'WCHAAA', 'OOOOxx'),
+(4099, 4807, 1, 3, 9, 19, 99, 99, 99, 4099, 4099, 198, 199, 'RBAAAA', 'XCHAAA', 'VVVVxx'),
+(4387, 4808, 1, 3, 7, 7, 87, 387, 387, 4387, 4387, 174, 175, 'TMAAAA', 'YCHAAA', 'AAAAxx'),
+(8864, 4809, 0, 0, 4, 4, 64, 864, 864, 3864, 8864, 128, 129, 'YCAAAA', 'ZCHAAA', 'HHHHxx'),
+(1774, 4810, 0, 2, 4, 14, 74, 774, 1774, 1774, 1774, 148, 149, 'GQAAAA', 'ADHAAA', 'OOOOxx'),
+(6292, 4811, 0, 0, 2, 12, 92, 292, 292, 1292, 6292, 184, 185, 'AIAAAA', 'BDHAAA', 'VVVVxx'),
+(847, 4812, 1, 3, 7, 7, 47, 847, 847, 847, 847, 94, 95, 'PGAAAA', 'CDHAAA', 'AAAAxx'),
+(5954, 4813, 0, 2, 4, 14, 54, 954, 1954, 954, 5954, 108, 109, 'AVAAAA', 'DDHAAA', 'HHHHxx'),
+(8032, 4814, 0, 0, 2, 12, 32, 32, 32, 3032, 8032, 64, 65, 'YWAAAA', 'EDHAAA', 'OOOOxx'),
+(3295, 4815, 1, 3, 5, 15, 95, 295, 1295, 3295, 3295, 190, 191, 'TWAAAA', 'FDHAAA', 'VVVVxx'),
+(8984, 4816, 0, 0, 4, 4, 84, 984, 984, 3984, 8984, 168, 169, 'OHAAAA', 'GDHAAA', 'AAAAxx'),
+(7809, 4817, 1, 1, 9, 9, 9, 809, 1809, 2809, 7809, 18, 19, 'JOAAAA', 'HDHAAA', 'HHHHxx'),
+(1670, 4818, 0, 2, 0, 10, 70, 670, 1670, 1670, 1670, 140, 141, 'GMAAAA', 'IDHAAA', 'OOOOxx'),
+(7733, 4819, 1, 1, 3, 13, 33, 733, 1733, 2733, 7733, 66, 67, 'LLAAAA', 'JDHAAA', 'VVVVxx'),
+(6187, 4820, 1, 3, 7, 7, 87, 187, 187, 1187, 6187, 174, 175, 'ZDAAAA', 'KDHAAA', 'AAAAxx'),
+(9326, 4821, 0, 2, 6, 6, 26, 326, 1326, 4326, 9326, 52, 53, 'SUAAAA', 'LDHAAA', 'HHHHxx'),
+(2493, 4822, 1, 1, 3, 13, 93, 493, 493, 2493, 2493, 186, 187, 'XRAAAA', 'MDHAAA', 'OOOOxx'),
+(9512, 4823, 0, 0, 2, 12, 12, 512, 1512, 4512, 9512, 24, 25, 'WBAAAA', 'NDHAAA', 'VVVVxx'),
+(4342, 4824, 0, 2, 2, 2, 42, 342, 342, 4342, 4342, 84, 85, 'ALAAAA', 'ODHAAA', 'AAAAxx'),
+(5350, 4825, 0, 2, 0, 10, 50, 350, 1350, 350, 5350, 100, 101, 'UXAAAA', 'PDHAAA', 'HHHHxx'),
+(6009, 4826, 1, 1, 9, 9, 9, 9, 9, 1009, 6009, 18, 19, 'DXAAAA', 'QDHAAA', 'OOOOxx'),
+(1208, 4827, 0, 0, 8, 8, 8, 208, 1208, 1208, 1208, 16, 17, 'MUAAAA', 'RDHAAA', 'VVVVxx'),
+(7014, 4828, 0, 2, 4, 14, 14, 14, 1014, 2014, 7014, 28, 29, 'UJAAAA', 'SDHAAA', 'AAAAxx'),
+(2967, 4829, 1, 3, 7, 7, 67, 967, 967, 2967, 2967, 134, 135, 'DKAAAA', 'TDHAAA', 'HHHHxx'),
+(5831, 4830, 1, 3, 1, 11, 31, 831, 1831, 831, 5831, 62, 63, 'HQAAAA', 'UDHAAA', 'OOOOxx'),
+(3097, 4831, 1, 1, 7, 17, 97, 97, 1097, 3097, 3097, 194, 195, 'DPAAAA', 'VDHAAA', 'VVVVxx'),
+(1528, 4832, 0, 0, 8, 8, 28, 528, 1528, 1528, 1528, 56, 57, 'UGAAAA', 'WDHAAA', 'AAAAxx'),
+(6429, 4833, 1, 1, 9, 9, 29, 429, 429, 1429, 6429, 58, 59, 'HNAAAA', 'XDHAAA', 'HHHHxx'),
+(7320, 4834, 0, 0, 0, 0, 20, 320, 1320, 2320, 7320, 40, 41, 'OVAAAA', 'YDHAAA', 'OOOOxx'),
+(844, 4835, 0, 0, 4, 4, 44, 844, 844, 844, 844, 88, 89, 'MGAAAA', 'ZDHAAA', 'VVVVxx'),
+(7054, 4836, 0, 2, 4, 14, 54, 54, 1054, 2054, 7054, 108, 109, 'ILAAAA', 'AEHAAA', 'AAAAxx'),
+(1643, 4837, 1, 3, 3, 3, 43, 643, 1643, 1643, 1643, 86, 87, 'FLAAAA', 'BEHAAA', 'HHHHxx'),
+(7626, 4838, 0, 2, 6, 6, 26, 626, 1626, 2626, 7626, 52, 53, 'IHAAAA', 'CEHAAA', 'OOOOxx'),
+(8728, 4839, 0, 0, 8, 8, 28, 728, 728, 3728, 8728, 56, 57, 'SXAAAA', 'DEHAAA', 'VVVVxx'),
+(8277, 4840, 1, 1, 7, 17, 77, 277, 277, 3277, 8277, 154, 155, 'JGAAAA', 'EEHAAA', 'AAAAxx'),
+(189, 4841, 1, 1, 9, 9, 89, 189, 189, 189, 189, 178, 179, 'HHAAAA', 'FEHAAA', 'HHHHxx'),
+(3717, 4842, 1, 1, 7, 17, 17, 717, 1717, 3717, 3717, 34, 35, 'ZMAAAA', 'GEHAAA', 'OOOOxx'),
+(1020, 4843, 0, 0, 0, 0, 20, 20, 1020, 1020, 1020, 40, 41, 'GNAAAA', 'HEHAAA', 'VVVVxx'),
+(9234, 4844, 0, 2, 4, 14, 34, 234, 1234, 4234, 9234, 68, 69, 'ERAAAA', 'IEHAAA', 'AAAAxx'),
+(9541, 4845, 1, 1, 1, 1, 41, 541, 1541, 4541, 9541, 82, 83, 'ZCAAAA', 'JEHAAA', 'HHHHxx'),
+(380, 4846, 0, 0, 0, 0, 80, 380, 380, 380, 380, 160, 161, 'QOAAAA', 'KEHAAA', 'OOOOxx'),
+(397, 4847, 1, 1, 7, 17, 97, 397, 397, 397, 397, 194, 195, 'HPAAAA', 'LEHAAA', 'VVVVxx'),
+(835, 4848, 1, 3, 5, 15, 35, 835, 835, 835, 835, 70, 71, 'DGAAAA', 'MEHAAA', 'AAAAxx'),
+(347, 4849, 1, 3, 7, 7, 47, 347, 347, 347, 347, 94, 95, 'JNAAAA', 'NEHAAA', 'HHHHxx'),
+(2490, 4850, 0, 2, 0, 10, 90, 490, 490, 2490, 2490, 180, 181, 'URAAAA', 'OEHAAA', 'OOOOxx'),
+(605, 4851, 1, 1, 5, 5, 5, 605, 605, 605, 605, 10, 11, 'HXAAAA', 'PEHAAA', 'VVVVxx'),
+(7960, 4852, 0, 0, 0, 0, 60, 960, 1960, 2960, 7960, 120, 121, 'EUAAAA', 'QEHAAA', 'AAAAxx'),
+(9681, 4853, 1, 1, 1, 1, 81, 681, 1681, 4681, 9681, 162, 163, 'JIAAAA', 'REHAAA', 'HHHHxx'),
+(5753, 4854, 1, 1, 3, 13, 53, 753, 1753, 753, 5753, 106, 107, 'HNAAAA', 'SEHAAA', 'OOOOxx'),
+(1676, 4855, 0, 0, 6, 16, 76, 676, 1676, 1676, 1676, 152, 153, 'MMAAAA', 'TEHAAA', 'VVVVxx'),
+(5533, 4856, 1, 1, 3, 13, 33, 533, 1533, 533, 5533, 66, 67, 'VEAAAA', 'UEHAAA', 'AAAAxx'),
+(8958, 4857, 0, 2, 8, 18, 58, 958, 958, 3958, 8958, 116, 117, 'OGAAAA', 'VEHAAA', 'HHHHxx'),
+(664, 4858, 0, 0, 4, 4, 64, 664, 664, 664, 664, 128, 129, 'OZAAAA', 'WEHAAA', 'OOOOxx'),
+(3005, 4859, 1, 1, 5, 5, 5, 5, 1005, 3005, 3005, 10, 11, 'PLAAAA', 'XEHAAA', 'VVVVxx'),
+(8576, 4860, 0, 0, 6, 16, 76, 576, 576, 3576, 8576, 152, 153, 'WRAAAA', 'YEHAAA', 'AAAAxx'),
+(7304, 4861, 0, 0, 4, 4, 4, 304, 1304, 2304, 7304, 8, 9, 'YUAAAA', 'ZEHAAA', 'HHHHxx'),
+(3375, 4862, 1, 3, 5, 15, 75, 375, 1375, 3375, 3375, 150, 151, 'VZAAAA', 'AFHAAA', 'OOOOxx'),
+(6336, 4863, 0, 0, 6, 16, 36, 336, 336, 1336, 6336, 72, 73, 'SJAAAA', 'BFHAAA', 'VVVVxx'),
+(1392, 4864, 0, 0, 2, 12, 92, 392, 1392, 1392, 1392, 184, 185, 'OBAAAA', 'CFHAAA', 'AAAAxx'),
+(2925, 4865, 1, 1, 5, 5, 25, 925, 925, 2925, 2925, 50, 51, 'NIAAAA', 'DFHAAA', 'HHHHxx'),
+(1217, 4866, 1, 1, 7, 17, 17, 217, 1217, 1217, 1217, 34, 35, 'VUAAAA', 'EFHAAA', 'OOOOxx'),
+(3714, 4867, 0, 2, 4, 14, 14, 714, 1714, 3714, 3714, 28, 29, 'WMAAAA', 'FFHAAA', 'VVVVxx'),
+(2120, 4868, 0, 0, 0, 0, 20, 120, 120, 2120, 2120, 40, 41, 'ODAAAA', 'GFHAAA', 'AAAAxx'),
+(2845, 4869, 1, 1, 5, 5, 45, 845, 845, 2845, 2845, 90, 91, 'LFAAAA', 'HFHAAA', 'HHHHxx'),
+(3865, 4870, 1, 1, 5, 5, 65, 865, 1865, 3865, 3865, 130, 131, 'RSAAAA', 'IFHAAA', 'OOOOxx'),
+(124, 4871, 0, 0, 4, 4, 24, 124, 124, 124, 124, 48, 49, 'UEAAAA', 'JFHAAA', 'VVVVxx'),
+(865, 4872, 1, 1, 5, 5, 65, 865, 865, 865, 865, 130, 131, 'HHAAAA', 'KFHAAA', 'AAAAxx'),
+(9361, 4873, 1, 1, 1, 1, 61, 361, 1361, 4361, 9361, 122, 123, 'BWAAAA', 'LFHAAA', 'HHHHxx'),
+(6338, 4874, 0, 2, 8, 18, 38, 338, 338, 1338, 6338, 76, 77, 'UJAAAA', 'MFHAAA', 'OOOOxx'),
+(7330, 4875, 0, 2, 0, 10, 30, 330, 1330, 2330, 7330, 60, 61, 'YVAAAA', 'NFHAAA', 'VVVVxx'),
+(513, 4876, 1, 1, 3, 13, 13, 513, 513, 513, 513, 26, 27, 'TTAAAA', 'OFHAAA', 'AAAAxx'),
+(5001, 4877, 1, 1, 1, 1, 1, 1, 1001, 1, 5001, 2, 3, 'JKAAAA', 'PFHAAA', 'HHHHxx'),
+(549, 4878, 1, 1, 9, 9, 49, 549, 549, 549, 549, 98, 99, 'DVAAAA', 'QFHAAA', 'OOOOxx'),
+(1808, 4879, 0, 0, 8, 8, 8, 808, 1808, 1808, 1808, 16, 17, 'ORAAAA', 'RFHAAA', 'VVVVxx'),
+(7168, 4880, 0, 0, 8, 8, 68, 168, 1168, 2168, 7168, 136, 137, 'SPAAAA', 'SFHAAA', 'AAAAxx'),
+(9878, 4881, 0, 2, 8, 18, 78, 878, 1878, 4878, 9878, 156, 157, 'YPAAAA', 'TFHAAA', 'HHHHxx'),
+(233, 4882, 1, 1, 3, 13, 33, 233, 233, 233, 233, 66, 67, 'ZIAAAA', 'UFHAAA', 'OOOOxx'),
+(4262, 4883, 0, 2, 2, 2, 62, 262, 262, 4262, 4262, 124, 125, 'YHAAAA', 'VFHAAA', 'VVVVxx'),
+(7998, 4884, 0, 2, 8, 18, 98, 998, 1998, 2998, 7998, 196, 197, 'QVAAAA', 'WFHAAA', 'AAAAxx'),
+(2419, 4885, 1, 3, 9, 19, 19, 419, 419, 2419, 2419, 38, 39, 'BPAAAA', 'XFHAAA', 'HHHHxx'),
+(9960, 4886, 0, 0, 0, 0, 60, 960, 1960, 4960, 9960, 120, 121, 'CTAAAA', 'YFHAAA', 'OOOOxx'),
+(3523, 4887, 1, 3, 3, 3, 23, 523, 1523, 3523, 3523, 46, 47, 'NFAAAA', 'ZFHAAA', 'VVVVxx'),
+(5440, 4888, 0, 0, 0, 0, 40, 440, 1440, 440, 5440, 80, 81, 'GBAAAA', 'AGHAAA', 'AAAAxx'),
+(3030, 4889, 0, 2, 0, 10, 30, 30, 1030, 3030, 3030, 60, 61, 'OMAAAA', 'BGHAAA', 'HHHHxx'),
+(2745, 4890, 1, 1, 5, 5, 45, 745, 745, 2745, 2745, 90, 91, 'PBAAAA', 'CGHAAA', 'OOOOxx'),
+(7175, 4891, 1, 3, 5, 15, 75, 175, 1175, 2175, 7175, 150, 151, 'ZPAAAA', 'DGHAAA', 'VVVVxx'),
+(640, 4892, 0, 0, 0, 0, 40, 640, 640, 640, 640, 80, 81, 'QYAAAA', 'EGHAAA', 'AAAAxx'),
+(1798, 4893, 0, 2, 8, 18, 98, 798, 1798, 1798, 1798, 196, 197, 'ERAAAA', 'FGHAAA', 'HHHHxx'),
+(7499, 4894, 1, 3, 9, 19, 99, 499, 1499, 2499, 7499, 198, 199, 'LCAAAA', 'GGHAAA', 'OOOOxx'),
+(1924, 4895, 0, 0, 4, 4, 24, 924, 1924, 1924, 1924, 48, 49, 'AWAAAA', 'HGHAAA', 'VVVVxx'),
+(1327, 4896, 1, 3, 7, 7, 27, 327, 1327, 1327, 1327, 54, 55, 'BZAAAA', 'IGHAAA', 'AAAAxx'),
+(73, 4897, 1, 1, 3, 13, 73, 73, 73, 73, 73, 146, 147, 'VCAAAA', 'JGHAAA', 'HHHHxx'),
+(9558, 4898, 0, 2, 8, 18, 58, 558, 1558, 4558, 9558, 116, 117, 'QDAAAA', 'KGHAAA', 'OOOOxx'),
+(818, 4899, 0, 2, 8, 18, 18, 818, 818, 818, 818, 36, 37, 'MFAAAA', 'LGHAAA', 'VVVVxx'),
+(9916, 4900, 0, 0, 6, 16, 16, 916, 1916, 4916, 9916, 32, 33, 'KRAAAA', 'MGHAAA', 'AAAAxx'),
+(2978, 4901, 0, 2, 8, 18, 78, 978, 978, 2978, 2978, 156, 157, 'OKAAAA', 'NGHAAA', 'HHHHxx'),
+(8469, 4902, 1, 1, 9, 9, 69, 469, 469, 3469, 8469, 138, 139, 'TNAAAA', 'OGHAAA', 'OOOOxx'),
+(9845, 4903, 1, 1, 5, 5, 45, 845, 1845, 4845, 9845, 90, 91, 'ROAAAA', 'PGHAAA', 'VVVVxx'),
+(2326, 4904, 0, 2, 6, 6, 26, 326, 326, 2326, 2326, 52, 53, 'MLAAAA', 'QGHAAA', 'AAAAxx'),
+(4032, 4905, 0, 0, 2, 12, 32, 32, 32, 4032, 4032, 64, 65, 'CZAAAA', 'RGHAAA', 'HHHHxx'),
+(5604, 4906, 0, 0, 4, 4, 4, 604, 1604, 604, 5604, 8, 9, 'OHAAAA', 'SGHAAA', 'OOOOxx'),
+(9610, 4907, 0, 2, 0, 10, 10, 610, 1610, 4610, 9610, 20, 21, 'QFAAAA', 'TGHAAA', 'VVVVxx'),
+(5101, 4908, 1, 1, 1, 1, 1, 101, 1101, 101, 5101, 2, 3, 'FOAAAA', 'UGHAAA', 'AAAAxx'),
+(7246, 4909, 0, 2, 6, 6, 46, 246, 1246, 2246, 7246, 92, 93, 'SSAAAA', 'VGHAAA', 'HHHHxx'),
+(1292, 4910, 0, 0, 2, 12, 92, 292, 1292, 1292, 1292, 184, 185, 'SXAAAA', 'WGHAAA', 'OOOOxx'),
+(6235, 4911, 1, 3, 5, 15, 35, 235, 235, 1235, 6235, 70, 71, 'VFAAAA', 'XGHAAA', 'VVVVxx'),
+(1733, 4912, 1, 1, 3, 13, 33, 733, 1733, 1733, 1733, 66, 67, 'ROAAAA', 'YGHAAA', 'AAAAxx'),
+(4647, 4913, 1, 3, 7, 7, 47, 647, 647, 4647, 4647, 94, 95, 'TWAAAA', 'ZGHAAA', 'HHHHxx'),
+(258, 4914, 0, 2, 8, 18, 58, 258, 258, 258, 258, 116, 117, 'YJAAAA', 'AHHAAA', 'OOOOxx'),
+(8438, 4915, 0, 2, 8, 18, 38, 438, 438, 3438, 8438, 76, 77, 'OMAAAA', 'BHHAAA', 'VVVVxx'),
+(7869, 4916, 1, 1, 9, 9, 69, 869, 1869, 2869, 7869, 138, 139, 'RQAAAA', 'CHHAAA', 'AAAAxx'),
+(9691, 4917, 1, 3, 1, 11, 91, 691, 1691, 4691, 9691, 182, 183, 'TIAAAA', 'DHHAAA', 'HHHHxx'),
+(5422, 4918, 0, 2, 2, 2, 22, 422, 1422, 422, 5422, 44, 45, 'OAAAAA', 'EHHAAA', 'OOOOxx'),
+(9630, 4919, 0, 2, 0, 10, 30, 630, 1630, 4630, 9630, 60, 61, 'KGAAAA', 'FHHAAA', 'VVVVxx'),
+(4439, 4920, 1, 3, 9, 19, 39, 439, 439, 4439, 4439, 78, 79, 'TOAAAA', 'GHHAAA', 'AAAAxx'),
+(3140, 4921, 0, 0, 0, 0, 40, 140, 1140, 3140, 3140, 80, 81, 'UQAAAA', 'HHHAAA', 'HHHHxx'),
+(9111, 4922, 1, 3, 1, 11, 11, 111, 1111, 4111, 9111, 22, 23, 'LMAAAA', 'IHHAAA', 'OOOOxx'),
+(4606, 4923, 0, 2, 6, 6, 6, 606, 606, 4606, 4606, 12, 13, 'EVAAAA', 'JHHAAA', 'VVVVxx'),
+(8620, 4924, 0, 0, 0, 0, 20, 620, 620, 3620, 8620, 40, 41, 'OTAAAA', 'KHHAAA', 'AAAAxx'),
+(7849, 4925, 1, 1, 9, 9, 49, 849, 1849, 2849, 7849, 98, 99, 'XPAAAA', 'LHHAAA', 'HHHHxx'),
+(346, 4926, 0, 2, 6, 6, 46, 346, 346, 346, 346, 92, 93, 'INAAAA', 'MHHAAA', 'OOOOxx'),
+(9528, 4927, 0, 0, 8, 8, 28, 528, 1528, 4528, 9528, 56, 57, 'MCAAAA', 'NHHAAA', 'VVVVxx'),
+(1811, 4928, 1, 3, 1, 11, 11, 811, 1811, 1811, 1811, 22, 23, 'RRAAAA', 'OHHAAA', 'AAAAxx'),
+(6068, 4929, 0, 0, 8, 8, 68, 68, 68, 1068, 6068, 136, 137, 'KZAAAA', 'PHHAAA', 'HHHHxx'),
+(6260, 4930, 0, 0, 0, 0, 60, 260, 260, 1260, 6260, 120, 121, 'UGAAAA', 'QHHAAA', 'OOOOxx'),
+(5909, 4931, 1, 1, 9, 9, 9, 909, 1909, 909, 5909, 18, 19, 'HTAAAA', 'RHHAAA', 'VVVVxx'),
+(4518, 4932, 0, 2, 8, 18, 18, 518, 518, 4518, 4518, 36, 37, 'URAAAA', 'SHHAAA', 'AAAAxx'),
+(7530, 4933, 0, 2, 0, 10, 30, 530, 1530, 2530, 7530, 60, 61, 'QDAAAA', 'THHAAA', 'HHHHxx'),
+(3900, 4934, 0, 0, 0, 0, 0, 900, 1900, 3900, 3900, 0, 1, 'AUAAAA', 'UHHAAA', 'OOOOxx'),
+(3969, 4935, 1, 1, 9, 9, 69, 969, 1969, 3969, 3969, 138, 139, 'RWAAAA', 'VHHAAA', 'VVVVxx'),
+(8690, 4936, 0, 2, 0, 10, 90, 690, 690, 3690, 8690, 180, 181, 'GWAAAA', 'WHHAAA', 'AAAAxx'),
+(5532, 4937, 0, 0, 2, 12, 32, 532, 1532, 532, 5532, 64, 65, 'UEAAAA', 'XHHAAA', 'HHHHxx'),
+(5989, 4938, 1, 1, 9, 9, 89, 989, 1989, 989, 5989, 178, 179, 'JWAAAA', 'YHHAAA', 'OOOOxx'),
+(1870, 4939, 0, 2, 0, 10, 70, 870, 1870, 1870, 1870, 140, 141, 'YTAAAA', 'ZHHAAA', 'VVVVxx'),
+(1113, 4940, 1, 1, 3, 13, 13, 113, 1113, 1113, 1113, 26, 27, 'VQAAAA', 'AIHAAA', 'AAAAxx'),
+(5155, 4941, 1, 3, 5, 15, 55, 155, 1155, 155, 5155, 110, 111, 'HQAAAA', 'BIHAAA', 'HHHHxx'),
+(7460, 4942, 0, 0, 0, 0, 60, 460, 1460, 2460, 7460, 120, 121, 'YAAAAA', 'CIHAAA', 'OOOOxx'),
+(6217, 4943, 1, 1, 7, 17, 17, 217, 217, 1217, 6217, 34, 35, 'DFAAAA', 'DIHAAA', 'VVVVxx'),
+(8333, 4944, 1, 1, 3, 13, 33, 333, 333, 3333, 8333, 66, 67, 'NIAAAA', 'EIHAAA', 'AAAAxx'),
+(6341, 4945, 1, 1, 1, 1, 41, 341, 341, 1341, 6341, 82, 83, 'XJAAAA', 'FIHAAA', 'HHHHxx'),
+(6230, 4946, 0, 2, 0, 10, 30, 230, 230, 1230, 6230, 60, 61, 'QFAAAA', 'GIHAAA', 'OOOOxx'),
+(6902, 4947, 0, 2, 2, 2, 2, 902, 902, 1902, 6902, 4, 5, 'MFAAAA', 'HIHAAA', 'VVVVxx'),
+(670, 4948, 0, 2, 0, 10, 70, 670, 670, 670, 670, 140, 141, 'UZAAAA', 'IIHAAA', 'AAAAxx'),
+(805, 4949, 1, 1, 5, 5, 5, 805, 805, 805, 805, 10, 11, 'ZEAAAA', 'JIHAAA', 'HHHHxx'),
+(1340, 4950, 0, 0, 0, 0, 40, 340, 1340, 1340, 1340, 80, 81, 'OZAAAA', 'KIHAAA', 'OOOOxx'),
+(8649, 4951, 1, 1, 9, 9, 49, 649, 649, 3649, 8649, 98, 99, 'RUAAAA', 'LIHAAA', 'VVVVxx'),
+(3887, 4952, 1, 3, 7, 7, 87, 887, 1887, 3887, 3887, 174, 175, 'NTAAAA', 'MIHAAA', 'AAAAxx'),
+(5400, 4953, 0, 0, 0, 0, 0, 400, 1400, 400, 5400, 0, 1, 'SZAAAA', 'NIHAAA', 'HHHHxx'),
+(4354, 4954, 0, 2, 4, 14, 54, 354, 354, 4354, 4354, 108, 109, 'MLAAAA', 'OIHAAA', 'OOOOxx'),
+(950, 4955, 0, 2, 0, 10, 50, 950, 950, 950, 950, 100, 101, 'OKAAAA', 'PIHAAA', 'VVVVxx'),
+(1544, 4956, 0, 0, 4, 4, 44, 544, 1544, 1544, 1544, 88, 89, 'KHAAAA', 'QIHAAA', 'AAAAxx'),
+(3898, 4957, 0, 2, 8, 18, 98, 898, 1898, 3898, 3898, 196, 197, 'YTAAAA', 'RIHAAA', 'HHHHxx'),
+(8038, 4958, 0, 2, 8, 18, 38, 38, 38, 3038, 8038, 76, 77, 'EXAAAA', 'SIHAAA', 'OOOOxx'),
+(1095, 4959, 1, 3, 5, 15, 95, 95, 1095, 1095, 1095, 190, 191, 'DQAAAA', 'TIHAAA', 'VVVVxx'),
+(1748, 4960, 0, 0, 8, 8, 48, 748, 1748, 1748, 1748, 96, 97, 'GPAAAA', 'UIHAAA', 'AAAAxx'),
+(9154, 4961, 0, 2, 4, 14, 54, 154, 1154, 4154, 9154, 108, 109, 'COAAAA', 'VIHAAA', 'HHHHxx'),
+(2182, 4962, 0, 2, 2, 2, 82, 182, 182, 2182, 2182, 164, 165, 'YFAAAA', 'WIHAAA', 'OOOOxx'),
+(6797, 4963, 1, 1, 7, 17, 97, 797, 797, 1797, 6797, 194, 195, 'LBAAAA', 'XIHAAA', 'VVVVxx'),
+(9149, 4964, 1, 1, 9, 9, 49, 149, 1149, 4149, 9149, 98, 99, 'XNAAAA', 'YIHAAA', 'AAAAxx'),
+(7351, 4965, 1, 3, 1, 11, 51, 351, 1351, 2351, 7351, 102, 103, 'TWAAAA', 'ZIHAAA', 'HHHHxx'),
+(2820, 4966, 0, 0, 0, 0, 20, 820, 820, 2820, 2820, 40, 41, 'MEAAAA', 'AJHAAA', 'OOOOxx'),
+(9696, 4967, 0, 0, 6, 16, 96, 696, 1696, 4696, 9696, 192, 193, 'YIAAAA', 'BJHAAA', 'VVVVxx'),
+(253, 4968, 1, 1, 3, 13, 53, 253, 253, 253, 253, 106, 107, 'TJAAAA', 'CJHAAA', 'AAAAxx'),
+(3600, 4969, 0, 0, 0, 0, 0, 600, 1600, 3600, 3600, 0, 1, 'MIAAAA', 'DJHAAA', 'HHHHxx'),
+(3892, 4970, 0, 0, 2, 12, 92, 892, 1892, 3892, 3892, 184, 185, 'STAAAA', 'EJHAAA', 'OOOOxx'),
+(231, 4971, 1, 3, 1, 11, 31, 231, 231, 231, 231, 62, 63, 'XIAAAA', 'FJHAAA', 'VVVVxx'),
+(8331, 4972, 1, 3, 1, 11, 31, 331, 331, 3331, 8331, 62, 63, 'LIAAAA', 'GJHAAA', 'AAAAxx'),
+(403, 4973, 1, 3, 3, 3, 3, 403, 403, 403, 403, 6, 7, 'NPAAAA', 'HJHAAA', 'HHHHxx'),
+(8642, 4974, 0, 2, 2, 2, 42, 642, 642, 3642, 8642, 84, 85, 'KUAAAA', 'IJHAAA', 'OOOOxx'),
+(3118, 4975, 0, 2, 8, 18, 18, 118, 1118, 3118, 3118, 36, 37, 'YPAAAA', 'JJHAAA', 'VVVVxx'),
+(3835, 4976, 1, 3, 5, 15, 35, 835, 1835, 3835, 3835, 70, 71, 'NRAAAA', 'KJHAAA', 'AAAAxx'),
+(1117, 4977, 1, 1, 7, 17, 17, 117, 1117, 1117, 1117, 34, 35, 'ZQAAAA', 'LJHAAA', 'HHHHxx'),
+(7024, 4978, 0, 0, 4, 4, 24, 24, 1024, 2024, 7024, 48, 49, 'EKAAAA', 'MJHAAA', 'OOOOxx'),
+(2636, 4979, 0, 0, 6, 16, 36, 636, 636, 2636, 2636, 72, 73, 'KXAAAA', 'NJHAAA', 'VVVVxx'),
+(3778, 4980, 0, 2, 8, 18, 78, 778, 1778, 3778, 3778, 156, 157, 'IPAAAA', 'OJHAAA', 'AAAAxx'),
+(2003, 4981, 1, 3, 3, 3, 3, 3, 3, 2003, 2003, 6, 7, 'BZAAAA', 'PJHAAA', 'HHHHxx'),
+(5717, 4982, 1, 1, 7, 17, 17, 717, 1717, 717, 5717, 34, 35, 'XLAAAA', 'QJHAAA', 'OOOOxx'),
+(4869, 4983, 1, 1, 9, 9, 69, 869, 869, 4869, 4869, 138, 139, 'HFAAAA', 'RJHAAA', 'VVVVxx'),
+(8921, 4984, 1, 1, 1, 1, 21, 921, 921, 3921, 8921, 42, 43, 'DFAAAA', 'SJHAAA', 'AAAAxx'),
+(888, 4985, 0, 0, 8, 8, 88, 888, 888, 888, 888, 176, 177, 'EIAAAA', 'TJHAAA', 'HHHHxx'),
+(7599, 4986, 1, 3, 9, 19, 99, 599, 1599, 2599, 7599, 198, 199, 'HGAAAA', 'UJHAAA', 'OOOOxx'),
+(8621, 4987, 1, 1, 1, 1, 21, 621, 621, 3621, 8621, 42, 43, 'PTAAAA', 'VJHAAA', 'VVVVxx'),
+(811, 4988, 1, 3, 1, 11, 11, 811, 811, 811, 811, 22, 23, 'FFAAAA', 'WJHAAA', 'AAAAxx'),
+(9147, 4989, 1, 3, 7, 7, 47, 147, 1147, 4147, 9147, 94, 95, 'VNAAAA', 'XJHAAA', 'HHHHxx'),
+(1413, 4990, 1, 1, 3, 13, 13, 413, 1413, 1413, 1413, 26, 27, 'JCAAAA', 'YJHAAA', 'OOOOxx'),
+(5232, 4991, 0, 0, 2, 12, 32, 232, 1232, 232, 5232, 64, 65, 'GTAAAA', 'ZJHAAA', 'VVVVxx'),
+(5912, 4992, 0, 0, 2, 12, 12, 912, 1912, 912, 5912, 24, 25, 'KTAAAA', 'AKHAAA', 'AAAAxx'),
+(3418, 4993, 0, 2, 8, 18, 18, 418, 1418, 3418, 3418, 36, 37, 'MBAAAA', 'BKHAAA', 'HHHHxx'),
+(3912, 4994, 0, 0, 2, 12, 12, 912, 1912, 3912, 3912, 24, 25, 'MUAAAA', 'CKHAAA', 'OOOOxx'),
+(9576, 4995, 0, 0, 6, 16, 76, 576, 1576, 4576, 9576, 152, 153, 'IEAAAA', 'DKHAAA', 'VVVVxx'),
+(4225, 4996, 1, 1, 5, 5, 25, 225, 225, 4225, 4225, 50, 51, 'NGAAAA', 'EKHAAA', 'AAAAxx'),
+(8222, 4997, 0, 2, 2, 2, 22, 222, 222, 3222, 8222, 44, 45, 'GEAAAA', 'FKHAAA', 'HHHHxx'),
+(7013, 4998, 1, 1, 3, 13, 13, 13, 1013, 2013, 7013, 26, 27, 'TJAAAA', 'GKHAAA', 'OOOOxx'),
+(7037, 4999, 1, 1, 7, 17, 37, 37, 1037, 2037, 7037, 74, 75, 'RKAAAA', 'HKHAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(1205, 5000, 1, 1, 5, 5, 5, 205, 1205, 1205, 1205, 10, 11, 'JUAAAA', 'IKHAAA', 'AAAAxx'),
+(8114, 5001, 0, 2, 4, 14, 14, 114, 114, 3114, 8114, 28, 29, 'CAAAAA', 'JKHAAA', 'HHHHxx'),
+(6585, 5002, 1, 1, 5, 5, 85, 585, 585, 1585, 6585, 170, 171, 'HTAAAA', 'KKHAAA', 'OOOOxx'),
+(155, 5003, 1, 3, 5, 15, 55, 155, 155, 155, 155, 110, 111, 'ZFAAAA', 'LKHAAA', 'VVVVxx'),
+(2841, 5004, 1, 1, 1, 1, 41, 841, 841, 2841, 2841, 82, 83, 'HFAAAA', 'MKHAAA', 'AAAAxx'),
+(1996, 5005, 0, 0, 6, 16, 96, 996, 1996, 1996, 1996, 192, 193, 'UYAAAA', 'NKHAAA', 'HHHHxx'),
+(4948, 5006, 0, 0, 8, 8, 48, 948, 948, 4948, 4948, 96, 97, 'IIAAAA', 'OKHAAA', 'OOOOxx'),
+(3304, 5007, 0, 0, 4, 4, 4, 304, 1304, 3304, 3304, 8, 9, 'CXAAAA', 'PKHAAA', 'VVVVxx'),
+(5684, 5008, 0, 0, 4, 4, 84, 684, 1684, 684, 5684, 168, 169, 'QKAAAA', 'QKHAAA', 'AAAAxx'),
+(6962, 5009, 0, 2, 2, 2, 62, 962, 962, 1962, 6962, 124, 125, 'UHAAAA', 'RKHAAA', 'HHHHxx'),
+(8691, 5010, 1, 3, 1, 11, 91, 691, 691, 3691, 8691, 182, 183, 'HWAAAA', 'SKHAAA', 'OOOOxx'),
+(8501, 5011, 1, 1, 1, 1, 1, 501, 501, 3501, 8501, 2, 3, 'ZOAAAA', 'TKHAAA', 'VVVVxx'),
+(4783, 5012, 1, 3, 3, 3, 83, 783, 783, 4783, 4783, 166, 167, 'ZBAAAA', 'UKHAAA', 'AAAAxx'),
+(3762, 5013, 0, 2, 2, 2, 62, 762, 1762, 3762, 3762, 124, 125, 'SOAAAA', 'VKHAAA', 'HHHHxx'),
+(4534, 5014, 0, 2, 4, 14, 34, 534, 534, 4534, 4534, 68, 69, 'KSAAAA', 'WKHAAA', 'OOOOxx'),
+(4999, 5015, 1, 3, 9, 19, 99, 999, 999, 4999, 4999, 198, 199, 'HKAAAA', 'XKHAAA', 'VVVVxx'),
+(4618, 5016, 0, 2, 8, 18, 18, 618, 618, 4618, 4618, 36, 37, 'QVAAAA', 'YKHAAA', 'AAAAxx'),
+(4220, 5017, 0, 0, 0, 0, 20, 220, 220, 4220, 4220, 40, 41, 'IGAAAA', 'ZKHAAA', 'HHHHxx'),
+(3384, 5018, 0, 0, 4, 4, 84, 384, 1384, 3384, 3384, 168, 169, 'EAAAAA', 'ALHAAA', 'OOOOxx'),
+(3036, 5019, 0, 0, 6, 16, 36, 36, 1036, 3036, 3036, 72, 73, 'UMAAAA', 'BLHAAA', 'VVVVxx'),
+(545, 5020, 1, 1, 5, 5, 45, 545, 545, 545, 545, 90, 91, 'ZUAAAA', 'CLHAAA', 'AAAAxx'),
+(9946, 5021, 0, 2, 6, 6, 46, 946, 1946, 4946, 9946, 92, 93, 'OSAAAA', 'DLHAAA', 'HHHHxx'),
+(1985, 5022, 1, 1, 5, 5, 85, 985, 1985, 1985, 1985, 170, 171, 'JYAAAA', 'ELHAAA', 'OOOOxx'),
+(2310, 5023, 0, 2, 0, 10, 10, 310, 310, 2310, 2310, 20, 21, 'WKAAAA', 'FLHAAA', 'VVVVxx'),
+(6563, 5024, 1, 3, 3, 3, 63, 563, 563, 1563, 6563, 126, 127, 'LSAAAA', 'GLHAAA', 'AAAAxx'),
+(4886, 5025, 0, 2, 6, 6, 86, 886, 886, 4886, 4886, 172, 173, 'YFAAAA', 'HLHAAA', 'HHHHxx'),
+(9359, 5026, 1, 3, 9, 19, 59, 359, 1359, 4359, 9359, 118, 119, 'ZVAAAA', 'ILHAAA', 'OOOOxx'),
+(400, 5027, 0, 0, 0, 0, 0, 400, 400, 400, 400, 0, 1, 'KPAAAA', 'JLHAAA', 'VVVVxx'),
+(9742, 5028, 0, 2, 2, 2, 42, 742, 1742, 4742, 9742, 84, 85, 'SKAAAA', 'KLHAAA', 'AAAAxx'),
+(6736, 5029, 0, 0, 6, 16, 36, 736, 736, 1736, 6736, 72, 73, 'CZAAAA', 'LLHAAA', 'HHHHxx'),
+(8166, 5030, 0, 2, 6, 6, 66, 166, 166, 3166, 8166, 132, 133, 'CCAAAA', 'MLHAAA', 'OOOOxx'),
+(861, 5031, 1, 1, 1, 1, 61, 861, 861, 861, 861, 122, 123, 'DHAAAA', 'NLHAAA', 'VVVVxx'),
+(7492, 5032, 0, 0, 2, 12, 92, 492, 1492, 2492, 7492, 184, 185, 'ECAAAA', 'OLHAAA', 'AAAAxx'),
+(1155, 5033, 1, 3, 5, 15, 55, 155, 1155, 1155, 1155, 110, 111, 'LSAAAA', 'PLHAAA', 'HHHHxx'),
+(9769, 5034, 1, 1, 9, 9, 69, 769, 1769, 4769, 9769, 138, 139, 'TLAAAA', 'QLHAAA', 'OOOOxx'),
+(6843, 5035, 1, 3, 3, 3, 43, 843, 843, 1843, 6843, 86, 87, 'FDAAAA', 'RLHAAA', 'VVVVxx'),
+(5625, 5036, 1, 1, 5, 5, 25, 625, 1625, 625, 5625, 50, 51, 'JIAAAA', 'SLHAAA', 'AAAAxx'),
+(1910, 5037, 0, 2, 0, 10, 10, 910, 1910, 1910, 1910, 20, 21, 'MVAAAA', 'TLHAAA', 'HHHHxx'),
+(9796, 5038, 0, 0, 6, 16, 96, 796, 1796, 4796, 9796, 192, 193, 'UMAAAA', 'ULHAAA', 'OOOOxx'),
+(6950, 5039, 0, 2, 0, 10, 50, 950, 950, 1950, 6950, 100, 101, 'IHAAAA', 'VLHAAA', 'VVVVxx'),
+(3084, 5040, 0, 0, 4, 4, 84, 84, 1084, 3084, 3084, 168, 169, 'QOAAAA', 'WLHAAA', 'AAAAxx'),
+(2959, 5041, 1, 3, 9, 19, 59, 959, 959, 2959, 2959, 118, 119, 'VJAAAA', 'XLHAAA', 'HHHHxx'),
+(2093, 5042, 1, 1, 3, 13, 93, 93, 93, 2093, 2093, 186, 187, 'NCAAAA', 'YLHAAA', 'OOOOxx'),
+(2738, 5043, 0, 2, 8, 18, 38, 738, 738, 2738, 2738, 76, 77, 'IBAAAA', 'ZLHAAA', 'VVVVxx'),
+(6406, 5044, 0, 2, 6, 6, 6, 406, 406, 1406, 6406, 12, 13, 'KMAAAA', 'AMHAAA', 'AAAAxx'),
+(9082, 5045, 0, 2, 2, 2, 82, 82, 1082, 4082, 9082, 164, 165, 'ILAAAA', 'BMHAAA', 'HHHHxx'),
+(8568, 5046, 0, 0, 8, 8, 68, 568, 568, 3568, 8568, 136, 137, 'ORAAAA', 'CMHAAA', 'OOOOxx'),
+(3566, 5047, 0, 2, 6, 6, 66, 566, 1566, 3566, 3566, 132, 133, 'EHAAAA', 'DMHAAA', 'VVVVxx'),
+(3016, 5048, 0, 0, 6, 16, 16, 16, 1016, 3016, 3016, 32, 33, 'AMAAAA', 'EMHAAA', 'AAAAxx'),
+(1207, 5049, 1, 3, 7, 7, 7, 207, 1207, 1207, 1207, 14, 15, 'LUAAAA', 'FMHAAA', 'HHHHxx'),
+(4045, 5050, 1, 1, 5, 5, 45, 45, 45, 4045, 4045, 90, 91, 'PZAAAA', 'GMHAAA', 'OOOOxx'),
+(4173, 5051, 1, 1, 3, 13, 73, 173, 173, 4173, 4173, 146, 147, 'NEAAAA', 'HMHAAA', 'VVVVxx'),
+(3939, 5052, 1, 3, 9, 19, 39, 939, 1939, 3939, 3939, 78, 79, 'NVAAAA', 'IMHAAA', 'AAAAxx'),
+(9683, 5053, 1, 3, 3, 3, 83, 683, 1683, 4683, 9683, 166, 167, 'LIAAAA', 'JMHAAA', 'HHHHxx'),
+(1684, 5054, 0, 0, 4, 4, 84, 684, 1684, 1684, 1684, 168, 169, 'UMAAAA', 'KMHAAA', 'OOOOxx'),
+(9271, 5055, 1, 3, 1, 11, 71, 271, 1271, 4271, 9271, 142, 143, 'PSAAAA', 'LMHAAA', 'VVVVxx'),
+(9317, 5056, 1, 1, 7, 17, 17, 317, 1317, 4317, 9317, 34, 35, 'JUAAAA', 'MMHAAA', 'AAAAxx'),
+(5793, 5057, 1, 1, 3, 13, 93, 793, 1793, 793, 5793, 186, 187, 'VOAAAA', 'NMHAAA', 'HHHHxx'),
+(352, 5058, 0, 0, 2, 12, 52, 352, 352, 352, 352, 104, 105, 'ONAAAA', 'OMHAAA', 'OOOOxx'),
+(7328, 5059, 0, 0, 8, 8, 28, 328, 1328, 2328, 7328, 56, 57, 'WVAAAA', 'PMHAAA', 'VVVVxx'),
+(4582, 5060, 0, 2, 2, 2, 82, 582, 582, 4582, 4582, 164, 165, 'GUAAAA', 'QMHAAA', 'AAAAxx'),
+(7413, 5061, 1, 1, 3, 13, 13, 413, 1413, 2413, 7413, 26, 27, 'DZAAAA', 'RMHAAA', 'HHHHxx'),
+(6772, 5062, 0, 0, 2, 12, 72, 772, 772, 1772, 6772, 144, 145, 'MAAAAA', 'SMHAAA', 'OOOOxx'),
+(4973, 5063, 1, 1, 3, 13, 73, 973, 973, 4973, 4973, 146, 147, 'HJAAAA', 'TMHAAA', 'VVVVxx'),
+(7480, 5064, 0, 0, 0, 0, 80, 480, 1480, 2480, 7480, 160, 161, 'SBAAAA', 'UMHAAA', 'AAAAxx'),
+(5555, 5065, 1, 3, 5, 15, 55, 555, 1555, 555, 5555, 110, 111, 'RFAAAA', 'VMHAAA', 'HHHHxx'),
+(4227, 5066, 1, 3, 7, 7, 27, 227, 227, 4227, 4227, 54, 55, 'PGAAAA', 'WMHAAA', 'OOOOxx'),
+(4153, 5067, 1, 1, 3, 13, 53, 153, 153, 4153, 4153, 106, 107, 'TDAAAA', 'XMHAAA', 'VVVVxx'),
+(4601, 5068, 1, 1, 1, 1, 1, 601, 601, 4601, 4601, 2, 3, 'ZUAAAA', 'YMHAAA', 'AAAAxx'),
+(3782, 5069, 0, 2, 2, 2, 82, 782, 1782, 3782, 3782, 164, 165, 'MPAAAA', 'ZMHAAA', 'HHHHxx'),
+(3872, 5070, 0, 0, 2, 12, 72, 872, 1872, 3872, 3872, 144, 145, 'YSAAAA', 'ANHAAA', 'OOOOxx'),
+(893, 5071, 1, 1, 3, 13, 93, 893, 893, 893, 893, 186, 187, 'JIAAAA', 'BNHAAA', 'VVVVxx'),
+(2430, 5072, 0, 2, 0, 10, 30, 430, 430, 2430, 2430, 60, 61, 'MPAAAA', 'CNHAAA', 'AAAAxx'),
+(2591, 5073, 1, 3, 1, 11, 91, 591, 591, 2591, 2591, 182, 183, 'RVAAAA', 'DNHAAA', 'HHHHxx'),
+(264, 5074, 0, 0, 4, 4, 64, 264, 264, 264, 264, 128, 129, 'EKAAAA', 'ENHAAA', 'OOOOxx'),
+(6238, 5075, 0, 2, 8, 18, 38, 238, 238, 1238, 6238, 76, 77, 'YFAAAA', 'FNHAAA', 'VVVVxx'),
+(633, 5076, 1, 1, 3, 13, 33, 633, 633, 633, 633, 66, 67, 'JYAAAA', 'GNHAAA', 'AAAAxx'),
+(1029, 5077, 1, 1, 9, 9, 29, 29, 1029, 1029, 1029, 58, 59, 'PNAAAA', 'HNHAAA', 'HHHHxx'),
+(5934, 5078, 0, 2, 4, 14, 34, 934, 1934, 934, 5934, 68, 69, 'GUAAAA', 'INHAAA', 'OOOOxx'),
+(8694, 5079, 0, 2, 4, 14, 94, 694, 694, 3694, 8694, 188, 189, 'KWAAAA', 'JNHAAA', 'VVVVxx'),
+(7401, 5080, 1, 1, 1, 1, 1, 401, 1401, 2401, 7401, 2, 3, 'RYAAAA', 'KNHAAA', 'AAAAxx'),
+(1165, 5081, 1, 1, 5, 5, 65, 165, 1165, 1165, 1165, 130, 131, 'VSAAAA', 'LNHAAA', 'HHHHxx'),
+(9438, 5082, 0, 2, 8, 18, 38, 438, 1438, 4438, 9438, 76, 77, 'AZAAAA', 'MNHAAA', 'OOOOxx'),
+(4790, 5083, 0, 2, 0, 10, 90, 790, 790, 4790, 4790, 180, 181, 'GCAAAA', 'NNHAAA', 'VVVVxx'),
+(4531, 5084, 1, 3, 1, 11, 31, 531, 531, 4531, 4531, 62, 63, 'HSAAAA', 'ONHAAA', 'AAAAxx'),
+(6099, 5085, 1, 3, 9, 19, 99, 99, 99, 1099, 6099, 198, 199, 'PAAAAA', 'PNHAAA', 'HHHHxx'),
+(8236, 5086, 0, 0, 6, 16, 36, 236, 236, 3236, 8236, 72, 73, 'UEAAAA', 'QNHAAA', 'OOOOxx'),
+(8551, 5087, 1, 3, 1, 11, 51, 551, 551, 3551, 8551, 102, 103, 'XQAAAA', 'RNHAAA', 'VVVVxx'),
+(3128, 5088, 0, 0, 8, 8, 28, 128, 1128, 3128, 3128, 56, 57, 'IQAAAA', 'SNHAAA', 'AAAAxx'),
+(3504, 5089, 0, 0, 4, 4, 4, 504, 1504, 3504, 3504, 8, 9, 'UEAAAA', 'TNHAAA', 'HHHHxx'),
+(9071, 5090, 1, 3, 1, 11, 71, 71, 1071, 4071, 9071, 142, 143, 'XKAAAA', 'UNHAAA', 'OOOOxx'),
+(5930, 5091, 0, 2, 0, 10, 30, 930, 1930, 930, 5930, 60, 61, 'CUAAAA', 'VNHAAA', 'VVVVxx'),
+(6825, 5092, 1, 1, 5, 5, 25, 825, 825, 1825, 6825, 50, 51, 'NCAAAA', 'WNHAAA', 'AAAAxx'),
+(2218, 5093, 0, 2, 8, 18, 18, 218, 218, 2218, 2218, 36, 37, 'IHAAAA', 'XNHAAA', 'HHHHxx'),
+(3604, 5094, 0, 0, 4, 4, 4, 604, 1604, 3604, 3604, 8, 9, 'QIAAAA', 'YNHAAA', 'OOOOxx'),
+(5761, 5095, 1, 1, 1, 1, 61, 761, 1761, 761, 5761, 122, 123, 'PNAAAA', 'ZNHAAA', 'VVVVxx'),
+(5414, 5096, 0, 2, 4, 14, 14, 414, 1414, 414, 5414, 28, 29, 'GAAAAA', 'AOHAAA', 'AAAAxx'),
+(5892, 5097, 0, 0, 2, 12, 92, 892, 1892, 892, 5892, 184, 185, 'QSAAAA', 'BOHAAA', 'HHHHxx'),
+(4080, 5098, 0, 0, 0, 0, 80, 80, 80, 4080, 4080, 160, 161, 'YAAAAA', 'COHAAA', 'OOOOxx'),
+(8018, 5099, 0, 2, 8, 18, 18, 18, 18, 3018, 8018, 36, 37, 'KWAAAA', 'DOHAAA', 'VVVVxx'),
+(1757, 5100, 1, 1, 7, 17, 57, 757, 1757, 1757, 1757, 114, 115, 'PPAAAA', 'EOHAAA', 'AAAAxx'),
+(5854, 5101, 0, 2, 4, 14, 54, 854, 1854, 854, 5854, 108, 109, 'ERAAAA', 'FOHAAA', 'HHHHxx'),
+(1335, 5102, 1, 3, 5, 15, 35, 335, 1335, 1335, 1335, 70, 71, 'JZAAAA', 'GOHAAA', 'OOOOxx'),
+(3811, 5103, 1, 3, 1, 11, 11, 811, 1811, 3811, 3811, 22, 23, 'PQAAAA', 'HOHAAA', 'VVVVxx'),
+(9917, 5104, 1, 1, 7, 17, 17, 917, 1917, 4917, 9917, 34, 35, 'LRAAAA', 'IOHAAA', 'AAAAxx'),
+(5947, 5105, 1, 3, 7, 7, 47, 947, 1947, 947, 5947, 94, 95, 'TUAAAA', 'JOHAAA', 'HHHHxx'),
+(7263, 5106, 1, 3, 3, 3, 63, 263, 1263, 2263, 7263, 126, 127, 'JTAAAA', 'KOHAAA', 'OOOOxx'),
+(1730, 5107, 0, 2, 0, 10, 30, 730, 1730, 1730, 1730, 60, 61, 'OOAAAA', 'LOHAAA', 'VVVVxx'),
+(5747, 5108, 1, 3, 7, 7, 47, 747, 1747, 747, 5747, 94, 95, 'BNAAAA', 'MOHAAA', 'AAAAxx'),
+(3876, 5109, 0, 0, 6, 16, 76, 876, 1876, 3876, 3876, 152, 153, 'CTAAAA', 'NOHAAA', 'HHHHxx'),
+(2762, 5110, 0, 2, 2, 2, 62, 762, 762, 2762, 2762, 124, 125, 'GCAAAA', 'OOHAAA', 'OOOOxx'),
+(7613, 5111, 1, 1, 3, 13, 13, 613, 1613, 2613, 7613, 26, 27, 'VGAAAA', 'POHAAA', 'VVVVxx'),
+(152, 5112, 0, 0, 2, 12, 52, 152, 152, 152, 152, 104, 105, 'WFAAAA', 'QOHAAA', 'AAAAxx'),
+(3941, 5113, 1, 1, 1, 1, 41, 941, 1941, 3941, 3941, 82, 83, 'PVAAAA', 'ROHAAA', 'HHHHxx'),
+(5614, 5114, 0, 2, 4, 14, 14, 614, 1614, 614, 5614, 28, 29, 'YHAAAA', 'SOHAAA', 'OOOOxx'),
+(9279, 5115, 1, 3, 9, 19, 79, 279, 1279, 4279, 9279, 158, 159, 'XSAAAA', 'TOHAAA', 'VVVVxx'),
+(3048, 5116, 0, 0, 8, 8, 48, 48, 1048, 3048, 3048, 96, 97, 'GNAAAA', 'UOHAAA', 'AAAAxx'),
+(6152, 5117, 0, 0, 2, 12, 52, 152, 152, 1152, 6152, 104, 105, 'QCAAAA', 'VOHAAA', 'HHHHxx'),
+(5481, 5118, 1, 1, 1, 1, 81, 481, 1481, 481, 5481, 162, 163, 'VCAAAA', 'WOHAAA', 'OOOOxx'),
+(4675, 5119, 1, 3, 5, 15, 75, 675, 675, 4675, 4675, 150, 151, 'VXAAAA', 'XOHAAA', 'VVVVxx'),
+(3334, 5120, 0, 2, 4, 14, 34, 334, 1334, 3334, 3334, 68, 69, 'GYAAAA', 'YOHAAA', 'AAAAxx'),
+(4691, 5121, 1, 3, 1, 11, 91, 691, 691, 4691, 4691, 182, 183, 'LYAAAA', 'ZOHAAA', 'HHHHxx'),
+(803, 5122, 1, 3, 3, 3, 3, 803, 803, 803, 803, 6, 7, 'XEAAAA', 'APHAAA', 'OOOOxx'),
+(5409, 5123, 1, 1, 9, 9, 9, 409, 1409, 409, 5409, 18, 19, 'BAAAAA', 'BPHAAA', 'VVVVxx'),
+(1054, 5124, 0, 2, 4, 14, 54, 54, 1054, 1054, 1054, 108, 109, 'OOAAAA', 'CPHAAA', 'AAAAxx'),
+(103, 5125, 1, 3, 3, 3, 3, 103, 103, 103, 103, 6, 7, 'ZDAAAA', 'DPHAAA', 'HHHHxx'),
+(8565, 5126, 1, 1, 5, 5, 65, 565, 565, 3565, 8565, 130, 131, 'LRAAAA', 'EPHAAA', 'OOOOxx'),
+(4666, 5127, 0, 2, 6, 6, 66, 666, 666, 4666, 4666, 132, 133, 'MXAAAA', 'FPHAAA', 'VVVVxx'),
+(6634, 5128, 0, 2, 4, 14, 34, 634, 634, 1634, 6634, 68, 69, 'EVAAAA', 'GPHAAA', 'AAAAxx'),
+(5538, 5129, 0, 2, 8, 18, 38, 538, 1538, 538, 5538, 76, 77, 'AFAAAA', 'HPHAAA', 'HHHHxx'),
+(3789, 5130, 1, 1, 9, 9, 89, 789, 1789, 3789, 3789, 178, 179, 'TPAAAA', 'IPHAAA', 'OOOOxx'),
+(4641, 5131, 1, 1, 1, 1, 41, 641, 641, 4641, 4641, 82, 83, 'NWAAAA', 'JPHAAA', 'VVVVxx'),
+(2458, 5132, 0, 2, 8, 18, 58, 458, 458, 2458, 2458, 116, 117, 'OQAAAA', 'KPHAAA', 'AAAAxx'),
+(5667, 5133, 1, 3, 7, 7, 67, 667, 1667, 667, 5667, 134, 135, 'ZJAAAA', 'LPHAAA', 'HHHHxx'),
+(6524, 5134, 0, 0, 4, 4, 24, 524, 524, 1524, 6524, 48, 49, 'YQAAAA', 'MPHAAA', 'OOOOxx'),
+(9179, 5135, 1, 3, 9, 19, 79, 179, 1179, 4179, 9179, 158, 159, 'BPAAAA', 'NPHAAA', 'VVVVxx'),
+(6358, 5136, 0, 2, 8, 18, 58, 358, 358, 1358, 6358, 116, 117, 'OKAAAA', 'OPHAAA', 'AAAAxx'),
+(6668, 5137, 0, 0, 8, 8, 68, 668, 668, 1668, 6668, 136, 137, 'MWAAAA', 'PPHAAA', 'HHHHxx'),
+(6414, 5138, 0, 2, 4, 14, 14, 414, 414, 1414, 6414, 28, 29, 'SMAAAA', 'QPHAAA', 'OOOOxx'),
+(2813, 5139, 1, 1, 3, 13, 13, 813, 813, 2813, 2813, 26, 27, 'FEAAAA', 'RPHAAA', 'VVVVxx'),
+(8927, 5140, 1, 3, 7, 7, 27, 927, 927, 3927, 8927, 54, 55, 'JFAAAA', 'SPHAAA', 'AAAAxx'),
+(8695, 5141, 1, 3, 5, 15, 95, 695, 695, 3695, 8695, 190, 191, 'LWAAAA', 'TPHAAA', 'HHHHxx'),
+(363, 5142, 1, 3, 3, 3, 63, 363, 363, 363, 363, 126, 127, 'ZNAAAA', 'UPHAAA', 'OOOOxx'),
+(9966, 5143, 0, 2, 6, 6, 66, 966, 1966, 4966, 9966, 132, 133, 'ITAAAA', 'VPHAAA', 'VVVVxx'),
+(1323, 5144, 1, 3, 3, 3, 23, 323, 1323, 1323, 1323, 46, 47, 'XYAAAA', 'WPHAAA', 'AAAAxx'),
+(8211, 5145, 1, 3, 1, 11, 11, 211, 211, 3211, 8211, 22, 23, 'VDAAAA', 'XPHAAA', 'HHHHxx'),
+(4375, 5146, 1, 3, 5, 15, 75, 375, 375, 4375, 4375, 150, 151, 'HMAAAA', 'YPHAAA', 'OOOOxx'),
+(3257, 5147, 1, 1, 7, 17, 57, 257, 1257, 3257, 3257, 114, 115, 'HVAAAA', 'ZPHAAA', 'VVVVxx'),
+(6239, 5148, 1, 3, 9, 19, 39, 239, 239, 1239, 6239, 78, 79, 'ZFAAAA', 'AQHAAA', 'AAAAxx'),
+(3602, 5149, 0, 2, 2, 2, 2, 602, 1602, 3602, 3602, 4, 5, 'OIAAAA', 'BQHAAA', 'HHHHxx'),
+(9830, 5150, 0, 2, 0, 10, 30, 830, 1830, 4830, 9830, 60, 61, 'COAAAA', 'CQHAAA', 'OOOOxx'),
+(7826, 5151, 0, 2, 6, 6, 26, 826, 1826, 2826, 7826, 52, 53, 'APAAAA', 'DQHAAA', 'VVVVxx'),
+(2108, 5152, 0, 0, 8, 8, 8, 108, 108, 2108, 2108, 16, 17, 'CDAAAA', 'EQHAAA', 'AAAAxx'),
+(7245, 5153, 1, 1, 5, 5, 45, 245, 1245, 2245, 7245, 90, 91, 'RSAAAA', 'FQHAAA', 'HHHHxx'),
+(8330, 5154, 0, 2, 0, 10, 30, 330, 330, 3330, 8330, 60, 61, 'KIAAAA', 'GQHAAA', 'OOOOxx'),
+(7441, 5155, 1, 1, 1, 1, 41, 441, 1441, 2441, 7441, 82, 83, 'FAAAAA', 'HQHAAA', 'VVVVxx'),
+(9848, 5156, 0, 0, 8, 8, 48, 848, 1848, 4848, 9848, 96, 97, 'UOAAAA', 'IQHAAA', 'AAAAxx'),
+(1226, 5157, 0, 2, 6, 6, 26, 226, 1226, 1226, 1226, 52, 53, 'EVAAAA', 'JQHAAA', 'HHHHxx'),
+(414, 5158, 0, 2, 4, 14, 14, 414, 414, 414, 414, 28, 29, 'YPAAAA', 'KQHAAA', 'OOOOxx'),
+(1273, 5159, 1, 1, 3, 13, 73, 273, 1273, 1273, 1273, 146, 147, 'ZWAAAA', 'LQHAAA', 'VVVVxx'),
+(9866, 5160, 0, 2, 6, 6, 66, 866, 1866, 4866, 9866, 132, 133, 'MPAAAA', 'MQHAAA', 'AAAAxx'),
+(4633, 5161, 1, 1, 3, 13, 33, 633, 633, 4633, 4633, 66, 67, 'FWAAAA', 'NQHAAA', 'HHHHxx'),
+(8727, 5162, 1, 3, 7, 7, 27, 727, 727, 3727, 8727, 54, 55, 'RXAAAA', 'OQHAAA', 'OOOOxx'),
+(5308, 5163, 0, 0, 8, 8, 8, 308, 1308, 308, 5308, 16, 17, 'EWAAAA', 'PQHAAA', 'VVVVxx'),
+(1395, 5164, 1, 3, 5, 15, 95, 395, 1395, 1395, 1395, 190, 191, 'RBAAAA', 'QQHAAA', 'AAAAxx'),
+(1825, 5165, 1, 1, 5, 5, 25, 825, 1825, 1825, 1825, 50, 51, 'FSAAAA', 'RQHAAA', 'HHHHxx'),
+(7606, 5166, 0, 2, 6, 6, 6, 606, 1606, 2606, 7606, 12, 13, 'OGAAAA', 'SQHAAA', 'OOOOxx'),
+(9390, 5167, 0, 2, 0, 10, 90, 390, 1390, 4390, 9390, 180, 181, 'EXAAAA', 'TQHAAA', 'VVVVxx'),
+(2376, 5168, 0, 0, 6, 16, 76, 376, 376, 2376, 2376, 152, 153, 'KNAAAA', 'UQHAAA', 'AAAAxx'),
+(2377, 5169, 1, 1, 7, 17, 77, 377, 377, 2377, 2377, 154, 155, 'LNAAAA', 'VQHAAA', 'HHHHxx'),
+(5346, 5170, 0, 2, 6, 6, 46, 346, 1346, 346, 5346, 92, 93, 'QXAAAA', 'WQHAAA', 'OOOOxx'),
+(4140, 5171, 0, 0, 0, 0, 40, 140, 140, 4140, 4140, 80, 81, 'GDAAAA', 'XQHAAA', 'VVVVxx'),
+(6032, 5172, 0, 0, 2, 12, 32, 32, 32, 1032, 6032, 64, 65, 'AYAAAA', 'YQHAAA', 'AAAAxx'),
+(9453, 5173, 1, 1, 3, 13, 53, 453, 1453, 4453, 9453, 106, 107, 'PZAAAA', 'ZQHAAA', 'HHHHxx'),
+(9297, 5174, 1, 1, 7, 17, 97, 297, 1297, 4297, 9297, 194, 195, 'PTAAAA', 'ARHAAA', 'OOOOxx'),
+(6455, 5175, 1, 3, 5, 15, 55, 455, 455, 1455, 6455, 110, 111, 'HOAAAA', 'BRHAAA', 'VVVVxx'),
+(4458, 5176, 0, 2, 8, 18, 58, 458, 458, 4458, 4458, 116, 117, 'MPAAAA', 'CRHAAA', 'AAAAxx'),
+(9516, 5177, 0, 0, 6, 16, 16, 516, 1516, 4516, 9516, 32, 33, 'ACAAAA', 'DRHAAA', 'HHHHxx'),
+(6211, 5178, 1, 3, 1, 11, 11, 211, 211, 1211, 6211, 22, 23, 'XEAAAA', 'ERHAAA', 'OOOOxx'),
+(526, 5179, 0, 2, 6, 6, 26, 526, 526, 526, 526, 52, 53, 'GUAAAA', 'FRHAAA', 'VVVVxx'),
+(3570, 5180, 0, 2, 0, 10, 70, 570, 1570, 3570, 3570, 140, 141, 'IHAAAA', 'GRHAAA', 'AAAAxx'),
+(4885, 5181, 1, 1, 5, 5, 85, 885, 885, 4885, 4885, 170, 171, 'XFAAAA', 'HRHAAA', 'HHHHxx'),
+(6390, 5182, 0, 2, 0, 10, 90, 390, 390, 1390, 6390, 180, 181, 'ULAAAA', 'IRHAAA', 'OOOOxx'),
+(1606, 5183, 0, 2, 6, 6, 6, 606, 1606, 1606, 1606, 12, 13, 'UJAAAA', 'JRHAAA', 'VVVVxx'),
+(7850, 5184, 0, 2, 0, 10, 50, 850, 1850, 2850, 7850, 100, 101, 'YPAAAA', 'KRHAAA', 'AAAAxx'),
+(3315, 5185, 1, 3, 5, 15, 15, 315, 1315, 3315, 3315, 30, 31, 'NXAAAA', 'LRHAAA', 'HHHHxx'),
+(8322, 5186, 0, 2, 2, 2, 22, 322, 322, 3322, 8322, 44, 45, 'CIAAAA', 'MRHAAA', 'OOOOxx'),
+(3703, 5187, 1, 3, 3, 3, 3, 703, 1703, 3703, 3703, 6, 7, 'LMAAAA', 'NRHAAA', 'VVVVxx'),
+(9489, 5188, 1, 1, 9, 9, 89, 489, 1489, 4489, 9489, 178, 179, 'ZAAAAA', 'ORHAAA', 'AAAAxx'),
+(6104, 5189, 0, 0, 4, 4, 4, 104, 104, 1104, 6104, 8, 9, 'UAAAAA', 'PRHAAA', 'HHHHxx'),
+(3067, 5190, 1, 3, 7, 7, 67, 67, 1067, 3067, 3067, 134, 135, 'ZNAAAA', 'QRHAAA', 'OOOOxx'),
+(2521, 5191, 1, 1, 1, 1, 21, 521, 521, 2521, 2521, 42, 43, 'ZSAAAA', 'RRHAAA', 'VVVVxx'),
+(2581, 5192, 1, 1, 1, 1, 81, 581, 581, 2581, 2581, 162, 163, 'HVAAAA', 'SRHAAA', 'AAAAxx'),
+(595, 5193, 1, 3, 5, 15, 95, 595, 595, 595, 595, 190, 191, 'XWAAAA', 'TRHAAA', 'HHHHxx'),
+(8291, 5194, 1, 3, 1, 11, 91, 291, 291, 3291, 8291, 182, 183, 'XGAAAA', 'URHAAA', 'OOOOxx'),
+(1727, 5195, 1, 3, 7, 7, 27, 727, 1727, 1727, 1727, 54, 55, 'LOAAAA', 'VRHAAA', 'VVVVxx'),
+(6847, 5196, 1, 3, 7, 7, 47, 847, 847, 1847, 6847, 94, 95, 'JDAAAA', 'WRHAAA', 'AAAAxx'),
+(7494, 5197, 0, 2, 4, 14, 94, 494, 1494, 2494, 7494, 188, 189, 'GCAAAA', 'XRHAAA', 'HHHHxx'),
+(7093, 5198, 1, 1, 3, 13, 93, 93, 1093, 2093, 7093, 186, 187, 'VMAAAA', 'YRHAAA', 'OOOOxx'),
+(7357, 5199, 1, 1, 7, 17, 57, 357, 1357, 2357, 7357, 114, 115, 'ZWAAAA', 'ZRHAAA', 'VVVVxx'),
+(620, 5200, 0, 0, 0, 0, 20, 620, 620, 620, 620, 40, 41, 'WXAAAA', 'ASHAAA', 'AAAAxx'),
+(2460, 5201, 0, 0, 0, 0, 60, 460, 460, 2460, 2460, 120, 121, 'QQAAAA', 'BSHAAA', 'HHHHxx'),
+(1598, 5202, 0, 2, 8, 18, 98, 598, 1598, 1598, 1598, 196, 197, 'MJAAAA', 'CSHAAA', 'OOOOxx'),
+(4112, 5203, 0, 0, 2, 12, 12, 112, 112, 4112, 4112, 24, 25, 'ECAAAA', 'DSHAAA', 'VVVVxx'),
+(2956, 5204, 0, 0, 6, 16, 56, 956, 956, 2956, 2956, 112, 113, 'SJAAAA', 'ESHAAA', 'AAAAxx'),
+(3193, 5205, 1, 1, 3, 13, 93, 193, 1193, 3193, 3193, 186, 187, 'VSAAAA', 'FSHAAA', 'HHHHxx'),
+(6356, 5206, 0, 0, 6, 16, 56, 356, 356, 1356, 6356, 112, 113, 'MKAAAA', 'GSHAAA', 'OOOOxx'),
+(730, 5207, 0, 2, 0, 10, 30, 730, 730, 730, 730, 60, 61, 'CCAAAA', 'HSHAAA', 'VVVVxx'),
+(8826, 5208, 0, 2, 6, 6, 26, 826, 826, 3826, 8826, 52, 53, 'MBAAAA', 'ISHAAA', 'AAAAxx'),
+(9036, 5209, 0, 0, 6, 16, 36, 36, 1036, 4036, 9036, 72, 73, 'OJAAAA', 'JSHAAA', 'HHHHxx'),
+(2085, 5210, 1, 1, 5, 5, 85, 85, 85, 2085, 2085, 170, 171, 'FCAAAA', 'KSHAAA', 'OOOOxx'),
+(9007, 5211, 1, 3, 7, 7, 7, 7, 1007, 4007, 9007, 14, 15, 'LIAAAA', 'LSHAAA', 'VVVVxx'),
+(6047, 5212, 1, 3, 7, 7, 47, 47, 47, 1047, 6047, 94, 95, 'PYAAAA', 'MSHAAA', 'AAAAxx'),
+(3953, 5213, 1, 1, 3, 13, 53, 953, 1953, 3953, 3953, 106, 107, 'BWAAAA', 'NSHAAA', 'HHHHxx'),
+(1214, 5214, 0, 2, 4, 14, 14, 214, 1214, 1214, 1214, 28, 29, 'SUAAAA', 'OSHAAA', 'OOOOxx'),
+(4814, 5215, 0, 2, 4, 14, 14, 814, 814, 4814, 4814, 28, 29, 'EDAAAA', 'PSHAAA', 'VVVVxx'),
+(5738, 5216, 0, 2, 8, 18, 38, 738, 1738, 738, 5738, 76, 77, 'SMAAAA', 'QSHAAA', 'AAAAxx'),
+(7176, 5217, 0, 0, 6, 16, 76, 176, 1176, 2176, 7176, 152, 153, 'AQAAAA', 'RSHAAA', 'HHHHxx'),
+(3609, 5218, 1, 1, 9, 9, 9, 609, 1609, 3609, 3609, 18, 19, 'VIAAAA', 'SSHAAA', 'OOOOxx'),
+(592, 5219, 0, 0, 2, 12, 92, 592, 592, 592, 592, 184, 185, 'UWAAAA', 'TSHAAA', 'VVVVxx'),
+(9391, 5220, 1, 3, 1, 11, 91, 391, 1391, 4391, 9391, 182, 183, 'FXAAAA', 'USHAAA', 'AAAAxx'),
+(5345, 5221, 1, 1, 5, 5, 45, 345, 1345, 345, 5345, 90, 91, 'PXAAAA', 'VSHAAA', 'HHHHxx'),
+(1171, 5222, 1, 3, 1, 11, 71, 171, 1171, 1171, 1171, 142, 143, 'BTAAAA', 'WSHAAA', 'OOOOxx'),
+(7238, 5223, 0, 2, 8, 18, 38, 238, 1238, 2238, 7238, 76, 77, 'KSAAAA', 'XSHAAA', 'VVVVxx'),
+(7561, 5224, 1, 1, 1, 1, 61, 561, 1561, 2561, 7561, 122, 123, 'VEAAAA', 'YSHAAA', 'AAAAxx'),
+(5876, 5225, 0, 0, 6, 16, 76, 876, 1876, 876, 5876, 152, 153, 'ASAAAA', 'ZSHAAA', 'HHHHxx'),
+(6611, 5226, 1, 3, 1, 11, 11, 611, 611, 1611, 6611, 22, 23, 'HUAAAA', 'ATHAAA', 'OOOOxx'),
+(7300, 5227, 0, 0, 0, 0, 0, 300, 1300, 2300, 7300, 0, 1, 'UUAAAA', 'BTHAAA', 'VVVVxx'),
+(1506, 5228, 0, 2, 6, 6, 6, 506, 1506, 1506, 1506, 12, 13, 'YFAAAA', 'CTHAAA', 'AAAAxx'),
+(1153, 5229, 1, 1, 3, 13, 53, 153, 1153, 1153, 1153, 106, 107, 'JSAAAA', 'DTHAAA', 'HHHHxx'),
+(3831, 5230, 1, 3, 1, 11, 31, 831, 1831, 3831, 3831, 62, 63, 'JRAAAA', 'ETHAAA', 'OOOOxx'),
+(9255, 5231, 1, 3, 5, 15, 55, 255, 1255, 4255, 9255, 110, 111, 'ZRAAAA', 'FTHAAA', 'VVVVxx'),
+(1841, 5232, 1, 1, 1, 1, 41, 841, 1841, 1841, 1841, 82, 83, 'VSAAAA', 'GTHAAA', 'AAAAxx'),
+(5075, 5233, 1, 3, 5, 15, 75, 75, 1075, 75, 5075, 150, 151, 'FNAAAA', 'HTHAAA', 'HHHHxx'),
+(101, 5234, 1, 1, 1, 1, 1, 101, 101, 101, 101, 2, 3, 'XDAAAA', 'ITHAAA', 'OOOOxx'),
+(2627, 5235, 1, 3, 7, 7, 27, 627, 627, 2627, 2627, 54, 55, 'BXAAAA', 'JTHAAA', 'VVVVxx'),
+(7078, 5236, 0, 2, 8, 18, 78, 78, 1078, 2078, 7078, 156, 157, 'GMAAAA', 'KTHAAA', 'AAAAxx'),
+(2850, 5237, 0, 2, 0, 10, 50, 850, 850, 2850, 2850, 100, 101, 'QFAAAA', 'LTHAAA', 'HHHHxx'),
+(8703, 5238, 1, 3, 3, 3, 3, 703, 703, 3703, 8703, 6, 7, 'TWAAAA', 'MTHAAA', 'OOOOxx'),
+(4101, 5239, 1, 1, 1, 1, 1, 101, 101, 4101, 4101, 2, 3, 'TBAAAA', 'NTHAAA', 'VVVVxx'),
+(318, 5240, 0, 2, 8, 18, 18, 318, 318, 318, 318, 36, 37, 'GMAAAA', 'OTHAAA', 'AAAAxx'),
+(6452, 5241, 0, 0, 2, 12, 52, 452, 452, 1452, 6452, 104, 105, 'EOAAAA', 'PTHAAA', 'HHHHxx'),
+(5558, 5242, 0, 2, 8, 18, 58, 558, 1558, 558, 5558, 116, 117, 'UFAAAA', 'QTHAAA', 'OOOOxx'),
+(3127, 5243, 1, 3, 7, 7, 27, 127, 1127, 3127, 3127, 54, 55, 'HQAAAA', 'RTHAAA', 'VVVVxx'),
+(535, 5244, 1, 3, 5, 15, 35, 535, 535, 535, 535, 70, 71, 'PUAAAA', 'STHAAA', 'AAAAxx'),
+(270, 5245, 0, 2, 0, 10, 70, 270, 270, 270, 270, 140, 141, 'KKAAAA', 'TTHAAA', 'HHHHxx'),
+(4038, 5246, 0, 2, 8, 18, 38, 38, 38, 4038, 4038, 76, 77, 'IZAAAA', 'UTHAAA', 'OOOOxx'),
+(3404, 5247, 0, 0, 4, 4, 4, 404, 1404, 3404, 3404, 8, 9, 'YAAAAA', 'VTHAAA', 'VVVVxx'),
+(2374, 5248, 0, 2, 4, 14, 74, 374, 374, 2374, 2374, 148, 149, 'INAAAA', 'WTHAAA', 'AAAAxx'),
+(6446, 5249, 0, 2, 6, 6, 46, 446, 446, 1446, 6446, 92, 93, 'YNAAAA', 'XTHAAA', 'HHHHxx'),
+(7758, 5250, 0, 2, 8, 18, 58, 758, 1758, 2758, 7758, 116, 117, 'KMAAAA', 'YTHAAA', 'OOOOxx'),
+(356, 5251, 0, 0, 6, 16, 56, 356, 356, 356, 356, 112, 113, 'SNAAAA', 'ZTHAAA', 'VVVVxx'),
+(9197, 5252, 1, 1, 7, 17, 97, 197, 1197, 4197, 9197, 194, 195, 'TPAAAA', 'AUHAAA', 'AAAAxx'),
+(9765, 5253, 1, 1, 5, 5, 65, 765, 1765, 4765, 9765, 130, 131, 'PLAAAA', 'BUHAAA', 'HHHHxx'),
+(4974, 5254, 0, 2, 4, 14, 74, 974, 974, 4974, 4974, 148, 149, 'IJAAAA', 'CUHAAA', 'OOOOxx'),
+(442, 5255, 0, 2, 2, 2, 42, 442, 442, 442, 442, 84, 85, 'ARAAAA', 'DUHAAA', 'VVVVxx'),
+(4349, 5256, 1, 1, 9, 9, 49, 349, 349, 4349, 4349, 98, 99, 'HLAAAA', 'EUHAAA', 'AAAAxx'),
+(6119, 5257, 1, 3, 9, 19, 19, 119, 119, 1119, 6119, 38, 39, 'JBAAAA', 'FUHAAA', 'HHHHxx'),
+(7574, 5258, 0, 2, 4, 14, 74, 574, 1574, 2574, 7574, 148, 149, 'IFAAAA', 'GUHAAA', 'OOOOxx'),
+(4445, 5259, 1, 1, 5, 5, 45, 445, 445, 4445, 4445, 90, 91, 'ZOAAAA', 'HUHAAA', 'VVVVxx'),
+(940, 5260, 0, 0, 0, 0, 40, 940, 940, 940, 940, 80, 81, 'EKAAAA', 'IUHAAA', 'AAAAxx'),
+(1875, 5261, 1, 3, 5, 15, 75, 875, 1875, 1875, 1875, 150, 151, 'DUAAAA', 'JUHAAA', 'HHHHxx'),
+(5951, 5262, 1, 3, 1, 11, 51, 951, 1951, 951, 5951, 102, 103, 'XUAAAA', 'KUHAAA', 'OOOOxx'),
+(9132, 5263, 0, 0, 2, 12, 32, 132, 1132, 4132, 9132, 64, 65, 'GNAAAA', 'LUHAAA', 'VVVVxx'),
+(6913, 5264, 1, 1, 3, 13, 13, 913, 913, 1913, 6913, 26, 27, 'XFAAAA', 'MUHAAA', 'AAAAxx'),
+(3308, 5265, 0, 0, 8, 8, 8, 308, 1308, 3308, 3308, 16, 17, 'GXAAAA', 'NUHAAA', 'HHHHxx'),
+(7553, 5266, 1, 1, 3, 13, 53, 553, 1553, 2553, 7553, 106, 107, 'NEAAAA', 'OUHAAA', 'OOOOxx'),
+(2138, 5267, 0, 2, 8, 18, 38, 138, 138, 2138, 2138, 76, 77, 'GEAAAA', 'PUHAAA', 'VVVVxx'),
+(6252, 5268, 0, 0, 2, 12, 52, 252, 252, 1252, 6252, 104, 105, 'MGAAAA', 'QUHAAA', 'AAAAxx'),
+(2171, 5269, 1, 3, 1, 11, 71, 171, 171, 2171, 2171, 142, 143, 'NFAAAA', 'RUHAAA', 'HHHHxx'),
+(4159, 5270, 1, 3, 9, 19, 59, 159, 159, 4159, 4159, 118, 119, 'ZDAAAA', 'SUHAAA', 'OOOOxx'),
+(2401, 5271, 1, 1, 1, 1, 1, 401, 401, 2401, 2401, 2, 3, 'JOAAAA', 'TUHAAA', 'VVVVxx'),
+(6553, 5272, 1, 1, 3, 13, 53, 553, 553, 1553, 6553, 106, 107, 'BSAAAA', 'UUHAAA', 'AAAAxx'),
+(5217, 5273, 1, 1, 7, 17, 17, 217, 1217, 217, 5217, 34, 35, 'RSAAAA', 'VUHAAA', 'HHHHxx'),
+(1405, 5274, 1, 1, 5, 5, 5, 405, 1405, 1405, 1405, 10, 11, 'BCAAAA', 'WUHAAA', 'OOOOxx'),
+(1494, 5275, 0, 2, 4, 14, 94, 494, 1494, 1494, 1494, 188, 189, 'MFAAAA', 'XUHAAA', 'VVVVxx'),
+(5553, 5276, 1, 1, 3, 13, 53, 553, 1553, 553, 5553, 106, 107, 'PFAAAA', 'YUHAAA', 'AAAAxx'),
+(8296, 5277, 0, 0, 6, 16, 96, 296, 296, 3296, 8296, 192, 193, 'CHAAAA', 'ZUHAAA', 'HHHHxx'),
+(6565, 5278, 1, 1, 5, 5, 65, 565, 565, 1565, 6565, 130, 131, 'NSAAAA', 'AVHAAA', 'OOOOxx'),
+(817, 5279, 1, 1, 7, 17, 17, 817, 817, 817, 817, 34, 35, 'LFAAAA', 'BVHAAA', 'VVVVxx'),
+(6947, 5280, 1, 3, 7, 7, 47, 947, 947, 1947, 6947, 94, 95, 'FHAAAA', 'CVHAAA', 'AAAAxx'),
+(4184, 5281, 0, 0, 4, 4, 84, 184, 184, 4184, 4184, 168, 169, 'YEAAAA', 'DVHAAA', 'HHHHxx'),
+(6577, 5282, 1, 1, 7, 17, 77, 577, 577, 1577, 6577, 154, 155, 'ZSAAAA', 'EVHAAA', 'OOOOxx'),
+(6424, 5283, 0, 0, 4, 4, 24, 424, 424, 1424, 6424, 48, 49, 'CNAAAA', 'FVHAAA', 'VVVVxx'),
+(2482, 5284, 0, 2, 2, 2, 82, 482, 482, 2482, 2482, 164, 165, 'MRAAAA', 'GVHAAA', 'AAAAxx'),
+(6874, 5285, 0, 2, 4, 14, 74, 874, 874, 1874, 6874, 148, 149, 'KEAAAA', 'HVHAAA', 'HHHHxx'),
+(7601, 5286, 1, 1, 1, 1, 1, 601, 1601, 2601, 7601, 2, 3, 'JGAAAA', 'IVHAAA', 'OOOOxx'),
+(4552, 5287, 0, 0, 2, 12, 52, 552, 552, 4552, 4552, 104, 105, 'CTAAAA', 'JVHAAA', 'VVVVxx'),
+(8406, 5288, 0, 2, 6, 6, 6, 406, 406, 3406, 8406, 12, 13, 'ILAAAA', 'KVHAAA', 'AAAAxx'),
+(2924, 5289, 0, 0, 4, 4, 24, 924, 924, 2924, 2924, 48, 49, 'MIAAAA', 'LVHAAA', 'HHHHxx'),
+(8255, 5290, 1, 3, 5, 15, 55, 255, 255, 3255, 8255, 110, 111, 'NFAAAA', 'MVHAAA', 'OOOOxx'),
+(4920, 5291, 0, 0, 0, 0, 20, 920, 920, 4920, 4920, 40, 41, 'GHAAAA', 'NVHAAA', 'VVVVxx'),
+(228, 5292, 0, 0, 8, 8, 28, 228, 228, 228, 228, 56, 57, 'UIAAAA', 'OVHAAA', 'AAAAxx'),
+(9431, 5293, 1, 3, 1, 11, 31, 431, 1431, 4431, 9431, 62, 63, 'TYAAAA', 'PVHAAA', 'HHHHxx'),
+(4021, 5294, 1, 1, 1, 1, 21, 21, 21, 4021, 4021, 42, 43, 'RYAAAA', 'QVHAAA', 'OOOOxx'),
+(2966, 5295, 0, 2, 6, 6, 66, 966, 966, 2966, 2966, 132, 133, 'CKAAAA', 'RVHAAA', 'VVVVxx'),
+(2862, 5296, 0, 2, 2, 2, 62, 862, 862, 2862, 2862, 124, 125, 'CGAAAA', 'SVHAAA', 'AAAAxx'),
+(4303, 5297, 1, 3, 3, 3, 3, 303, 303, 4303, 4303, 6, 7, 'NJAAAA', 'TVHAAA', 'HHHHxx'),
+(9643, 5298, 1, 3, 3, 3, 43, 643, 1643, 4643, 9643, 86, 87, 'XGAAAA', 'UVHAAA', 'OOOOxx'),
+(3008, 5299, 0, 0, 8, 8, 8, 8, 1008, 3008, 3008, 16, 17, 'SLAAAA', 'VVHAAA', 'VVVVxx'),
+(7476, 5300, 0, 0, 6, 16, 76, 476, 1476, 2476, 7476, 152, 153, 'OBAAAA', 'WVHAAA', 'AAAAxx'),
+(3686, 5301, 0, 2, 6, 6, 86, 686, 1686, 3686, 3686, 172, 173, 'ULAAAA', 'XVHAAA', 'HHHHxx'),
+(9051, 5302, 1, 3, 1, 11, 51, 51, 1051, 4051, 9051, 102, 103, 'DKAAAA', 'YVHAAA', 'OOOOxx'),
+(6592, 5303, 0, 0, 2, 12, 92, 592, 592, 1592, 6592, 184, 185, 'OTAAAA', 'ZVHAAA', 'VVVVxx'),
+(924, 5304, 0, 0, 4, 4, 24, 924, 924, 924, 924, 48, 49, 'OJAAAA', 'AWHAAA', 'AAAAxx'),
+(4406, 5305, 0, 2, 6, 6, 6, 406, 406, 4406, 4406, 12, 13, 'MNAAAA', 'BWHAAA', 'HHHHxx'),
+(5233, 5306, 1, 1, 3, 13, 33, 233, 1233, 233, 5233, 66, 67, 'HTAAAA', 'CWHAAA', 'OOOOxx'),
+(8881, 5307, 1, 1, 1, 1, 81, 881, 881, 3881, 8881, 162, 163, 'PDAAAA', 'DWHAAA', 'VVVVxx'),
+(2212, 5308, 0, 0, 2, 12, 12, 212, 212, 2212, 2212, 24, 25, 'CHAAAA', 'EWHAAA', 'AAAAxx'),
+(5804, 5309, 0, 0, 4, 4, 4, 804, 1804, 804, 5804, 8, 9, 'GPAAAA', 'FWHAAA', 'HHHHxx'),
+(2990, 5310, 0, 2, 0, 10, 90, 990, 990, 2990, 2990, 180, 181, 'ALAAAA', 'GWHAAA', 'OOOOxx'),
+(4069, 5311, 1, 1, 9, 9, 69, 69, 69, 4069, 4069, 138, 139, 'NAAAAA', 'HWHAAA', 'VVVVxx'),
+(5380, 5312, 0, 0, 0, 0, 80, 380, 1380, 380, 5380, 160, 161, 'YYAAAA', 'IWHAAA', 'AAAAxx'),
+(5016, 5313, 0, 0, 6, 16, 16, 16, 1016, 16, 5016, 32, 33, 'YKAAAA', 'JWHAAA', 'HHHHxx'),
+(5056, 5314, 0, 0, 6, 16, 56, 56, 1056, 56, 5056, 112, 113, 'MMAAAA', 'KWHAAA', 'OOOOxx'),
+(3732, 5315, 0, 0, 2, 12, 32, 732, 1732, 3732, 3732, 64, 65, 'ONAAAA', 'LWHAAA', 'VVVVxx'),
+(5527, 5316, 1, 3, 7, 7, 27, 527, 1527, 527, 5527, 54, 55, 'PEAAAA', 'MWHAAA', 'AAAAxx'),
+(1151, 5317, 1, 3, 1, 11, 51, 151, 1151, 1151, 1151, 102, 103, 'HSAAAA', 'NWHAAA', 'HHHHxx'),
+(7900, 5318, 0, 0, 0, 0, 0, 900, 1900, 2900, 7900, 0, 1, 'WRAAAA', 'OWHAAA', 'OOOOxx'),
+(1660, 5319, 0, 0, 0, 0, 60, 660, 1660, 1660, 1660, 120, 121, 'WLAAAA', 'PWHAAA', 'VVVVxx'),
+(8064, 5320, 0, 0, 4, 4, 64, 64, 64, 3064, 8064, 128, 129, 'EYAAAA', 'QWHAAA', 'AAAAxx'),
+(8240, 5321, 0, 0, 0, 0, 40, 240, 240, 3240, 8240, 80, 81, 'YEAAAA', 'RWHAAA', 'HHHHxx'),
+(413, 5322, 1, 1, 3, 13, 13, 413, 413, 413, 413, 26, 27, 'XPAAAA', 'SWHAAA', 'OOOOxx'),
+(8311, 5323, 1, 3, 1, 11, 11, 311, 311, 3311, 8311, 22, 23, 'RHAAAA', 'TWHAAA', 'VVVVxx'),
+(1065, 5324, 1, 1, 5, 5, 65, 65, 1065, 1065, 1065, 130, 131, 'ZOAAAA', 'UWHAAA', 'AAAAxx'),
+(2741, 5325, 1, 1, 1, 1, 41, 741, 741, 2741, 2741, 82, 83, 'LBAAAA', 'VWHAAA', 'HHHHxx'),
+(5306, 5326, 0, 2, 6, 6, 6, 306, 1306, 306, 5306, 12, 13, 'CWAAAA', 'WWHAAA', 'OOOOxx'),
+(5464, 5327, 0, 0, 4, 4, 64, 464, 1464, 464, 5464, 128, 129, 'ECAAAA', 'XWHAAA', 'VVVVxx'),
+(4237, 5328, 1, 1, 7, 17, 37, 237, 237, 4237, 4237, 74, 75, 'ZGAAAA', 'YWHAAA', 'AAAAxx'),
+(3822, 5329, 0, 2, 2, 2, 22, 822, 1822, 3822, 3822, 44, 45, 'ARAAAA', 'ZWHAAA', 'HHHHxx'),
+(2548, 5330, 0, 0, 8, 8, 48, 548, 548, 2548, 2548, 96, 97, 'AUAAAA', 'AXHAAA', 'OOOOxx'),
+(2688, 5331, 0, 0, 8, 8, 88, 688, 688, 2688, 2688, 176, 177, 'KZAAAA', 'BXHAAA', 'VVVVxx'),
+(8061, 5332, 1, 1, 1, 1, 61, 61, 61, 3061, 8061, 122, 123, 'BYAAAA', 'CXHAAA', 'AAAAxx'),
+(9340, 5333, 0, 0, 0, 0, 40, 340, 1340, 4340, 9340, 80, 81, 'GVAAAA', 'DXHAAA', 'HHHHxx'),
+(4031, 5334, 1, 3, 1, 11, 31, 31, 31, 4031, 4031, 62, 63, 'BZAAAA', 'EXHAAA', 'OOOOxx'),
+(2635, 5335, 1, 3, 5, 15, 35, 635, 635, 2635, 2635, 70, 71, 'JXAAAA', 'FXHAAA', 'VVVVxx'),
+(809, 5336, 1, 1, 9, 9, 9, 809, 809, 809, 809, 18, 19, 'DFAAAA', 'GXHAAA', 'AAAAxx'),
+(3209, 5337, 1, 1, 9, 9, 9, 209, 1209, 3209, 3209, 18, 19, 'LTAAAA', 'HXHAAA', 'HHHHxx'),
+(3825, 5338, 1, 1, 5, 5, 25, 825, 1825, 3825, 3825, 50, 51, 'DRAAAA', 'IXHAAA', 'OOOOxx'),
+(1448, 5339, 0, 0, 8, 8, 48, 448, 1448, 1448, 1448, 96, 97, 'SDAAAA', 'JXHAAA', 'VVVVxx'),
+(9077, 5340, 1, 1, 7, 17, 77, 77, 1077, 4077, 9077, 154, 155, 'DLAAAA', 'KXHAAA', 'AAAAxx'),
+(3730, 5341, 0, 2, 0, 10, 30, 730, 1730, 3730, 3730, 60, 61, 'MNAAAA', 'LXHAAA', 'HHHHxx'),
+(9596, 5342, 0, 0, 6, 16, 96, 596, 1596, 4596, 9596, 192, 193, 'CFAAAA', 'MXHAAA', 'OOOOxx'),
+(3563, 5343, 1, 3, 3, 3, 63, 563, 1563, 3563, 3563, 126, 127, 'BHAAAA', 'NXHAAA', 'VVVVxx'),
+(4116, 5344, 0, 0, 6, 16, 16, 116, 116, 4116, 4116, 32, 33, 'ICAAAA', 'OXHAAA', 'AAAAxx'),
+(4825, 5345, 1, 1, 5, 5, 25, 825, 825, 4825, 4825, 50, 51, 'PDAAAA', 'PXHAAA', 'HHHHxx'),
+(8376, 5346, 0, 0, 6, 16, 76, 376, 376, 3376, 8376, 152, 153, 'EKAAAA', 'QXHAAA', 'OOOOxx'),
+(3917, 5347, 1, 1, 7, 17, 17, 917, 1917, 3917, 3917, 34, 35, 'RUAAAA', 'RXHAAA', 'VVVVxx'),
+(4407, 5348, 1, 3, 7, 7, 7, 407, 407, 4407, 4407, 14, 15, 'NNAAAA', 'SXHAAA', 'AAAAxx'),
+(8202, 5349, 0, 2, 2, 2, 2, 202, 202, 3202, 8202, 4, 5, 'MDAAAA', 'TXHAAA', 'HHHHxx'),
+(7675, 5350, 1, 3, 5, 15, 75, 675, 1675, 2675, 7675, 150, 151, 'FJAAAA', 'UXHAAA', 'OOOOxx'),
+(4104, 5351, 0, 0, 4, 4, 4, 104, 104, 4104, 4104, 8, 9, 'WBAAAA', 'VXHAAA', 'VVVVxx'),
+(9225, 5352, 1, 1, 5, 5, 25, 225, 1225, 4225, 9225, 50, 51, 'VQAAAA', 'WXHAAA', 'AAAAxx'),
+(2834, 5353, 0, 2, 4, 14, 34, 834, 834, 2834, 2834, 68, 69, 'AFAAAA', 'XXHAAA', 'HHHHxx'),
+(1227, 5354, 1, 3, 7, 7, 27, 227, 1227, 1227, 1227, 54, 55, 'FVAAAA', 'YXHAAA', 'OOOOxx'),
+(3383, 5355, 1, 3, 3, 3, 83, 383, 1383, 3383, 3383, 166, 167, 'DAAAAA', 'ZXHAAA', 'VVVVxx'),
+(67, 5356, 1, 3, 7, 7, 67, 67, 67, 67, 67, 134, 135, 'PCAAAA', 'AYHAAA', 'AAAAxx'),
+(1751, 5357, 1, 3, 1, 11, 51, 751, 1751, 1751, 1751, 102, 103, 'JPAAAA', 'BYHAAA', 'HHHHxx'),
+(8054, 5358, 0, 2, 4, 14, 54, 54, 54, 3054, 8054, 108, 109, 'UXAAAA', 'CYHAAA', 'OOOOxx'),
+(8571, 5359, 1, 3, 1, 11, 71, 571, 571, 3571, 8571, 142, 143, 'RRAAAA', 'DYHAAA', 'VVVVxx'),
+(2466, 5360, 0, 2, 6, 6, 66, 466, 466, 2466, 2466, 132, 133, 'WQAAAA', 'EYHAAA', 'AAAAxx'),
+(9405, 5361, 1, 1, 5, 5, 5, 405, 1405, 4405, 9405, 10, 11, 'TXAAAA', 'FYHAAA', 'HHHHxx'),
+(6883, 5362, 1, 3, 3, 3, 83, 883, 883, 1883, 6883, 166, 167, 'TEAAAA', 'GYHAAA', 'OOOOxx'),
+(4301, 5363, 1, 1, 1, 1, 1, 301, 301, 4301, 4301, 2, 3, 'LJAAAA', 'HYHAAA', 'VVVVxx'),
+(3705, 5364, 1, 1, 5, 5, 5, 705, 1705, 3705, 3705, 10, 11, 'NMAAAA', 'IYHAAA', 'AAAAxx'),
+(5420, 5365, 0, 0, 0, 0, 20, 420, 1420, 420, 5420, 40, 41, 'MAAAAA', 'JYHAAA', 'HHHHxx'),
+(3692, 5366, 0, 0, 2, 12, 92, 692, 1692, 3692, 3692, 184, 185, 'AMAAAA', 'KYHAAA', 'OOOOxx'),
+(6851, 5367, 1, 3, 1, 11, 51, 851, 851, 1851, 6851, 102, 103, 'NDAAAA', 'LYHAAA', 'VVVVxx'),
+(9363, 5368, 1, 3, 3, 3, 63, 363, 1363, 4363, 9363, 126, 127, 'DWAAAA', 'MYHAAA', 'AAAAxx'),
+(2269, 5369, 1, 1, 9, 9, 69, 269, 269, 2269, 2269, 138, 139, 'HJAAAA', 'NYHAAA', 'HHHHxx'),
+(4918, 5370, 0, 2, 8, 18, 18, 918, 918, 4918, 4918, 36, 37, 'EHAAAA', 'OYHAAA', 'OOOOxx'),
+(4297, 5371, 1, 1, 7, 17, 97, 297, 297, 4297, 4297, 194, 195, 'HJAAAA', 'PYHAAA', 'VVVVxx'),
+(1836, 5372, 0, 0, 6, 16, 36, 836, 1836, 1836, 1836, 72, 73, 'QSAAAA', 'QYHAAA', 'AAAAxx'),
+(237, 5373, 1, 1, 7, 17, 37, 237, 237, 237, 237, 74, 75, 'DJAAAA', 'RYHAAA', 'HHHHxx'),
+(6131, 5374, 1, 3, 1, 11, 31, 131, 131, 1131, 6131, 62, 63, 'VBAAAA', 'SYHAAA', 'OOOOxx'),
+(3174, 5375, 0, 2, 4, 14, 74, 174, 1174, 3174, 3174, 148, 149, 'CSAAAA', 'TYHAAA', 'VVVVxx'),
+(9987, 5376, 1, 3, 7, 7, 87, 987, 1987, 4987, 9987, 174, 175, 'DUAAAA', 'UYHAAA', 'AAAAxx'),
+(3630, 5377, 0, 2, 0, 10, 30, 630, 1630, 3630, 3630, 60, 61, 'QJAAAA', 'VYHAAA', 'HHHHxx'),
+(2899, 5378, 1, 3, 9, 19, 99, 899, 899, 2899, 2899, 198, 199, 'NHAAAA', 'WYHAAA', 'OOOOxx'),
+(4079, 5379, 1, 3, 9, 19, 79, 79, 79, 4079, 4079, 158, 159, 'XAAAAA', 'XYHAAA', 'VVVVxx'),
+(5049, 5380, 1, 1, 9, 9, 49, 49, 1049, 49, 5049, 98, 99, 'FMAAAA', 'YYHAAA', 'AAAAxx'),
+(2963, 5381, 1, 3, 3, 3, 63, 963, 963, 2963, 2963, 126, 127, 'ZJAAAA', 'ZYHAAA', 'HHHHxx'),
+(3962, 5382, 0, 2, 2, 2, 62, 962, 1962, 3962, 3962, 124, 125, 'KWAAAA', 'AZHAAA', 'OOOOxx'),
+(7921, 5383, 1, 1, 1, 1, 21, 921, 1921, 2921, 7921, 42, 43, 'RSAAAA', 'BZHAAA', 'VVVVxx'),
+(3967, 5384, 1, 3, 7, 7, 67, 967, 1967, 3967, 3967, 134, 135, 'PWAAAA', 'CZHAAA', 'AAAAxx'),
+(2752, 5385, 0, 0, 2, 12, 52, 752, 752, 2752, 2752, 104, 105, 'WBAAAA', 'DZHAAA', 'HHHHxx'),
+(7944, 5386, 0, 0, 4, 4, 44, 944, 1944, 2944, 7944, 88, 89, 'OTAAAA', 'EZHAAA', 'OOOOxx'),
+(2205, 5387, 1, 1, 5, 5, 5, 205, 205, 2205, 2205, 10, 11, 'VGAAAA', 'FZHAAA', 'VVVVxx'),
+(5035, 5388, 1, 3, 5, 15, 35, 35, 1035, 35, 5035, 70, 71, 'RLAAAA', 'GZHAAA', 'AAAAxx'),
+(1425, 5389, 1, 1, 5, 5, 25, 425, 1425, 1425, 1425, 50, 51, 'VCAAAA', 'HZHAAA', 'HHHHxx'),
+(832, 5390, 0, 0, 2, 12, 32, 832, 832, 832, 832, 64, 65, 'AGAAAA', 'IZHAAA', 'OOOOxx'),
+(1447, 5391, 1, 3, 7, 7, 47, 447, 1447, 1447, 1447, 94, 95, 'RDAAAA', 'JZHAAA', 'VVVVxx'),
+(6108, 5392, 0, 0, 8, 8, 8, 108, 108, 1108, 6108, 16, 17, 'YAAAAA', 'KZHAAA', 'AAAAxx'),
+(4936, 5393, 0, 0, 6, 16, 36, 936, 936, 4936, 4936, 72, 73, 'WHAAAA', 'LZHAAA', 'HHHHxx'),
+(7704, 5394, 0, 0, 4, 4, 4, 704, 1704, 2704, 7704, 8, 9, 'IKAAAA', 'MZHAAA', 'OOOOxx'),
+(142, 5395, 0, 2, 2, 2, 42, 142, 142, 142, 142, 84, 85, 'MFAAAA', 'NZHAAA', 'VVVVxx'),
+(4272, 5396, 0, 0, 2, 12, 72, 272, 272, 4272, 4272, 144, 145, 'IIAAAA', 'OZHAAA', 'AAAAxx'),
+(7667, 5397, 1, 3, 7, 7, 67, 667, 1667, 2667, 7667, 134, 135, 'XIAAAA', 'PZHAAA', 'HHHHxx'),
+(366, 5398, 0, 2, 6, 6, 66, 366, 366, 366, 366, 132, 133, 'COAAAA', 'QZHAAA', 'OOOOxx'),
+(8866, 5399, 0, 2, 6, 6, 66, 866, 866, 3866, 8866, 132, 133, 'ADAAAA', 'RZHAAA', 'VVVVxx'),
+(7712, 5400, 0, 0, 2, 12, 12, 712, 1712, 2712, 7712, 24, 25, 'QKAAAA', 'SZHAAA', 'AAAAxx'),
+(3880, 5401, 0, 0, 0, 0, 80, 880, 1880, 3880, 3880, 160, 161, 'GTAAAA', 'TZHAAA', 'HHHHxx'),
+(4631, 5402, 1, 3, 1, 11, 31, 631, 631, 4631, 4631, 62, 63, 'DWAAAA', 'UZHAAA', 'OOOOxx'),
+(2789, 5403, 1, 1, 9, 9, 89, 789, 789, 2789, 2789, 178, 179, 'HDAAAA', 'VZHAAA', 'VVVVxx'),
+(7720, 5404, 0, 0, 0, 0, 20, 720, 1720, 2720, 7720, 40, 41, 'YKAAAA', 'WZHAAA', 'AAAAxx'),
+(7618, 5405, 0, 2, 8, 18, 18, 618, 1618, 2618, 7618, 36, 37, 'AHAAAA', 'XZHAAA', 'HHHHxx'),
+(4990, 5406, 0, 2, 0, 10, 90, 990, 990, 4990, 4990, 180, 181, 'YJAAAA', 'YZHAAA', 'OOOOxx'),
+(7918, 5407, 0, 2, 8, 18, 18, 918, 1918, 2918, 7918, 36, 37, 'OSAAAA', 'ZZHAAA', 'VVVVxx'),
+(5067, 5408, 1, 3, 7, 7, 67, 67, 1067, 67, 5067, 134, 135, 'XMAAAA', 'AAIAAA', 'AAAAxx'),
+(6370, 5409, 0, 2, 0, 10, 70, 370, 370, 1370, 6370, 140, 141, 'ALAAAA', 'BAIAAA', 'HHHHxx'),
+(2268, 5410, 0, 0, 8, 8, 68, 268, 268, 2268, 2268, 136, 137, 'GJAAAA', 'CAIAAA', 'OOOOxx'),
+(1949, 5411, 1, 1, 9, 9, 49, 949, 1949, 1949, 1949, 98, 99, 'ZWAAAA', 'DAIAAA', 'VVVVxx'),
+(5503, 5412, 1, 3, 3, 3, 3, 503, 1503, 503, 5503, 6, 7, 'RDAAAA', 'EAIAAA', 'AAAAxx'),
+(9951, 5413, 1, 3, 1, 11, 51, 951, 1951, 4951, 9951, 102, 103, 'TSAAAA', 'FAIAAA', 'HHHHxx'),
+(6823, 5414, 1, 3, 3, 3, 23, 823, 823, 1823, 6823, 46, 47, 'LCAAAA', 'GAIAAA', 'OOOOxx'),
+(6287, 5415, 1, 3, 7, 7, 87, 287, 287, 1287, 6287, 174, 175, 'VHAAAA', 'HAIAAA', 'VVVVxx'),
+(6016, 5416, 0, 0, 6, 16, 16, 16, 16, 1016, 6016, 32, 33, 'KXAAAA', 'IAIAAA', 'AAAAxx'),
+(1977, 5417, 1, 1, 7, 17, 77, 977, 1977, 1977, 1977, 154, 155, 'BYAAAA', 'JAIAAA', 'HHHHxx'),
+(8579, 5418, 1, 3, 9, 19, 79, 579, 579, 3579, 8579, 158, 159, 'ZRAAAA', 'KAIAAA', 'OOOOxx'),
+(6204, 5419, 0, 0, 4, 4, 4, 204, 204, 1204, 6204, 8, 9, 'QEAAAA', 'LAIAAA', 'VVVVxx'),
+(9764, 5420, 0, 0, 4, 4, 64, 764, 1764, 4764, 9764, 128, 129, 'OLAAAA', 'MAIAAA', 'AAAAxx'),
+(2005, 5421, 1, 1, 5, 5, 5, 5, 5, 2005, 2005, 10, 11, 'DZAAAA', 'NAIAAA', 'HHHHxx'),
+(1648, 5422, 0, 0, 8, 8, 48, 648, 1648, 1648, 1648, 96, 97, 'KLAAAA', 'OAIAAA', 'OOOOxx'),
+(2457, 5423, 1, 1, 7, 17, 57, 457, 457, 2457, 2457, 114, 115, 'NQAAAA', 'PAIAAA', 'VVVVxx'),
+(2698, 5424, 0, 2, 8, 18, 98, 698, 698, 2698, 2698, 196, 197, 'UZAAAA', 'QAIAAA', 'AAAAxx'),
+(7730, 5425, 0, 2, 0, 10, 30, 730, 1730, 2730, 7730, 60, 61, 'ILAAAA', 'RAIAAA', 'HHHHxx'),
+(7287, 5426, 1, 3, 7, 7, 87, 287, 1287, 2287, 7287, 174, 175, 'HUAAAA', 'SAIAAA', 'OOOOxx'),
+(2937, 5427, 1, 1, 7, 17, 37, 937, 937, 2937, 2937, 74, 75, 'ZIAAAA', 'TAIAAA', 'VVVVxx'),
+(6824, 5428, 0, 0, 4, 4, 24, 824, 824, 1824, 6824, 48, 49, 'MCAAAA', 'UAIAAA', 'AAAAxx'),
+(9256, 5429, 0, 0, 6, 16, 56, 256, 1256, 4256, 9256, 112, 113, 'ASAAAA', 'VAIAAA', 'HHHHxx'),
+(4810, 5430, 0, 2, 0, 10, 10, 810, 810, 4810, 4810, 20, 21, 'ADAAAA', 'WAIAAA', 'OOOOxx'),
+(3869, 5431, 1, 1, 9, 9, 69, 869, 1869, 3869, 3869, 138, 139, 'VSAAAA', 'XAIAAA', 'VVVVxx'),
+(1993, 5432, 1, 1, 3, 13, 93, 993, 1993, 1993, 1993, 186, 187, 'RYAAAA', 'YAIAAA', 'AAAAxx'),
+(6048, 5433, 0, 0, 8, 8, 48, 48, 48, 1048, 6048, 96, 97, 'QYAAAA', 'ZAIAAA', 'HHHHxx'),
+(6922, 5434, 0, 2, 2, 2, 22, 922, 922, 1922, 6922, 44, 45, 'GGAAAA', 'ABIAAA', 'OOOOxx'),
+(8, 5435, 0, 0, 8, 8, 8, 8, 8, 8, 8, 16, 17, 'IAAAAA', 'BBIAAA', 'VVVVxx'),
+(6706, 5436, 0, 2, 6, 6, 6, 706, 706, 1706, 6706, 12, 13, 'YXAAAA', 'CBIAAA', 'AAAAxx'),
+(9159, 5437, 1, 3, 9, 19, 59, 159, 1159, 4159, 9159, 118, 119, 'HOAAAA', 'DBIAAA', 'HHHHxx'),
+(7020, 5438, 0, 0, 0, 0, 20, 20, 1020, 2020, 7020, 40, 41, 'AKAAAA', 'EBIAAA', 'OOOOxx'),
+(767, 5439, 1, 3, 7, 7, 67, 767, 767, 767, 767, 134, 135, 'NDAAAA', 'FBIAAA', 'VVVVxx'),
+(8602, 5440, 0, 2, 2, 2, 2, 602, 602, 3602, 8602, 4, 5, 'WSAAAA', 'GBIAAA', 'AAAAxx'),
+(4442, 5441, 0, 2, 2, 2, 42, 442, 442, 4442, 4442, 84, 85, 'WOAAAA', 'HBIAAA', 'HHHHxx'),
+(2040, 5442, 0, 0, 0, 0, 40, 40, 40, 2040, 2040, 80, 81, 'MAAAAA', 'IBIAAA', 'OOOOxx'),
+(5493, 5443, 1, 1, 3, 13, 93, 493, 1493, 493, 5493, 186, 187, 'HDAAAA', 'JBIAAA', 'VVVVxx'),
+(275, 5444, 1, 3, 5, 15, 75, 275, 275, 275, 275, 150, 151, 'PKAAAA', 'KBIAAA', 'AAAAxx'),
+(8876, 5445, 0, 0, 6, 16, 76, 876, 876, 3876, 8876, 152, 153, 'KDAAAA', 'LBIAAA', 'HHHHxx'),
+(7381, 5446, 1, 1, 1, 1, 81, 381, 1381, 2381, 7381, 162, 163, 'XXAAAA', 'MBIAAA', 'OOOOxx'),
+(1827, 5447, 1, 3, 7, 7, 27, 827, 1827, 1827, 1827, 54, 55, 'HSAAAA', 'NBIAAA', 'VVVVxx'),
+(3537, 5448, 1, 1, 7, 17, 37, 537, 1537, 3537, 3537, 74, 75, 'BGAAAA', 'OBIAAA', 'AAAAxx'),
+(6978, 5449, 0, 2, 8, 18, 78, 978, 978, 1978, 6978, 156, 157, 'KIAAAA', 'PBIAAA', 'HHHHxx'),
+(6160, 5450, 0, 0, 0, 0, 60, 160, 160, 1160, 6160, 120, 121, 'YCAAAA', 'QBIAAA', 'OOOOxx'),
+(9219, 5451, 1, 3, 9, 19, 19, 219, 1219, 4219, 9219, 38, 39, 'PQAAAA', 'RBIAAA', 'VVVVxx'),
+(5034, 5452, 0, 2, 4, 14, 34, 34, 1034, 34, 5034, 68, 69, 'QLAAAA', 'SBIAAA', 'AAAAxx'),
+(8463, 5453, 1, 3, 3, 3, 63, 463, 463, 3463, 8463, 126, 127, 'NNAAAA', 'TBIAAA', 'HHHHxx'),
+(2038, 5454, 0, 2, 8, 18, 38, 38, 38, 2038, 2038, 76, 77, 'KAAAAA', 'UBIAAA', 'OOOOxx'),
+(9562, 5455, 0, 2, 2, 2, 62, 562, 1562, 4562, 9562, 124, 125, 'UDAAAA', 'VBIAAA', 'VVVVxx'),
+(2687, 5456, 1, 3, 7, 7, 87, 687, 687, 2687, 2687, 174, 175, 'JZAAAA', 'WBIAAA', 'AAAAxx'),
+(5092, 5457, 0, 0, 2, 12, 92, 92, 1092, 92, 5092, 184, 185, 'WNAAAA', 'XBIAAA', 'HHHHxx'),
+(539, 5458, 1, 3, 9, 19, 39, 539, 539, 539, 539, 78, 79, 'TUAAAA', 'YBIAAA', 'OOOOxx'),
+(2139, 5459, 1, 3, 9, 19, 39, 139, 139, 2139, 2139, 78, 79, 'HEAAAA', 'ZBIAAA', 'VVVVxx'),
+(9221, 5460, 1, 1, 1, 1, 21, 221, 1221, 4221, 9221, 42, 43, 'RQAAAA', 'ACIAAA', 'AAAAxx'),
+(965, 5461, 1, 1, 5, 5, 65, 965, 965, 965, 965, 130, 131, 'DLAAAA', 'BCIAAA', 'HHHHxx'),
+(6051, 5462, 1, 3, 1, 11, 51, 51, 51, 1051, 6051, 102, 103, 'TYAAAA', 'CCIAAA', 'OOOOxx'),
+(5822, 5463, 0, 2, 2, 2, 22, 822, 1822, 822, 5822, 44, 45, 'YPAAAA', 'DCIAAA', 'VVVVxx'),
+(6397, 5464, 1, 1, 7, 17, 97, 397, 397, 1397, 6397, 194, 195, 'BMAAAA', 'ECIAAA', 'AAAAxx'),
+(2375, 5465, 1, 3, 5, 15, 75, 375, 375, 2375, 2375, 150, 151, 'JNAAAA', 'FCIAAA', 'HHHHxx'),
+(9415, 5466, 1, 3, 5, 15, 15, 415, 1415, 4415, 9415, 30, 31, 'DYAAAA', 'GCIAAA', 'OOOOxx'),
+(6552, 5467, 0, 0, 2, 12, 52, 552, 552, 1552, 6552, 104, 105, 'ASAAAA', 'HCIAAA', 'VVVVxx'),
+(2248, 5468, 0, 0, 8, 8, 48, 248, 248, 2248, 2248, 96, 97, 'MIAAAA', 'ICIAAA', 'AAAAxx'),
+(2611, 5469, 1, 3, 1, 11, 11, 611, 611, 2611, 2611, 22, 23, 'LWAAAA', 'JCIAAA', 'HHHHxx'),
+(9609, 5470, 1, 1, 9, 9, 9, 609, 1609, 4609, 9609, 18, 19, 'PFAAAA', 'KCIAAA', 'OOOOxx'),
+(2132, 5471, 0, 0, 2, 12, 32, 132, 132, 2132, 2132, 64, 65, 'AEAAAA', 'LCIAAA', 'VVVVxx'),
+(8452, 5472, 0, 0, 2, 12, 52, 452, 452, 3452, 8452, 104, 105, 'CNAAAA', 'MCIAAA', 'AAAAxx'),
+(9407, 5473, 1, 3, 7, 7, 7, 407, 1407, 4407, 9407, 14, 15, 'VXAAAA', 'NCIAAA', 'HHHHxx'),
+(2814, 5474, 0, 2, 4, 14, 14, 814, 814, 2814, 2814, 28, 29, 'GEAAAA', 'OCIAAA', 'OOOOxx'),
+(1889, 5475, 1, 1, 9, 9, 89, 889, 1889, 1889, 1889, 178, 179, 'RUAAAA', 'PCIAAA', 'VVVVxx'),
+(7489, 5476, 1, 1, 9, 9, 89, 489, 1489, 2489, 7489, 178, 179, 'BCAAAA', 'QCIAAA', 'AAAAxx'),
+(2255, 5477, 1, 3, 5, 15, 55, 255, 255, 2255, 2255, 110, 111, 'TIAAAA', 'RCIAAA', 'HHHHxx'),
+(3380, 5478, 0, 0, 0, 0, 80, 380, 1380, 3380, 3380, 160, 161, 'AAAAAA', 'SCIAAA', 'OOOOxx'),
+(1167, 5479, 1, 3, 7, 7, 67, 167, 1167, 1167, 1167, 134, 135, 'XSAAAA', 'TCIAAA', 'VVVVxx'),
+(5369, 5480, 1, 1, 9, 9, 69, 369, 1369, 369, 5369, 138, 139, 'NYAAAA', 'UCIAAA', 'AAAAxx'),
+(2378, 5481, 0, 2, 8, 18, 78, 378, 378, 2378, 2378, 156, 157, 'MNAAAA', 'VCIAAA', 'HHHHxx'),
+(8315, 5482, 1, 3, 5, 15, 15, 315, 315, 3315, 8315, 30, 31, 'VHAAAA', 'WCIAAA', 'OOOOxx'),
+(2934, 5483, 0, 2, 4, 14, 34, 934, 934, 2934, 2934, 68, 69, 'WIAAAA', 'XCIAAA', 'VVVVxx'),
+(7924, 5484, 0, 0, 4, 4, 24, 924, 1924, 2924, 7924, 48, 49, 'USAAAA', 'YCIAAA', 'AAAAxx'),
+(2867, 5485, 1, 3, 7, 7, 67, 867, 867, 2867, 2867, 134, 135, 'HGAAAA', 'ZCIAAA', 'HHHHxx'),
+(9141, 5486, 1, 1, 1, 1, 41, 141, 1141, 4141, 9141, 82, 83, 'PNAAAA', 'ADIAAA', 'OOOOxx'),
+(3613, 5487, 1, 1, 3, 13, 13, 613, 1613, 3613, 3613, 26, 27, 'ZIAAAA', 'BDIAAA', 'VVVVxx'),
+(2461, 5488, 1, 1, 1, 1, 61, 461, 461, 2461, 2461, 122, 123, 'RQAAAA', 'CDIAAA', 'AAAAxx'),
+(4567, 5489, 1, 3, 7, 7, 67, 567, 567, 4567, 4567, 134, 135, 'RTAAAA', 'DDIAAA', 'HHHHxx'),
+(2906, 5490, 0, 2, 6, 6, 6, 906, 906, 2906, 2906, 12, 13, 'UHAAAA', 'EDIAAA', 'OOOOxx'),
+(4848, 5491, 0, 0, 8, 8, 48, 848, 848, 4848, 4848, 96, 97, 'MEAAAA', 'FDIAAA', 'VVVVxx'),
+(6614, 5492, 0, 2, 4, 14, 14, 614, 614, 1614, 6614, 28, 29, 'KUAAAA', 'GDIAAA', 'AAAAxx'),
+(6200, 5493, 0, 0, 0, 0, 0, 200, 200, 1200, 6200, 0, 1, 'MEAAAA', 'HDIAAA', 'HHHHxx'),
+(7895, 5494, 1, 3, 5, 15, 95, 895, 1895, 2895, 7895, 190, 191, 'RRAAAA', 'IDIAAA', 'OOOOxx'),
+(6829, 5495, 1, 1, 9, 9, 29, 829, 829, 1829, 6829, 58, 59, 'RCAAAA', 'JDIAAA', 'VVVVxx'),
+(4087, 5496, 1, 3, 7, 7, 87, 87, 87, 4087, 4087, 174, 175, 'FBAAAA', 'KDIAAA', 'AAAAxx'),
+(8787, 5497, 1, 3, 7, 7, 87, 787, 787, 3787, 8787, 174, 175, 'ZZAAAA', 'LDIAAA', 'HHHHxx'),
+(3322, 5498, 0, 2, 2, 2, 22, 322, 1322, 3322, 3322, 44, 45, 'UXAAAA', 'MDIAAA', 'OOOOxx'),
+(9091, 5499, 1, 3, 1, 11, 91, 91, 1091, 4091, 9091, 182, 183, 'RLAAAA', 'NDIAAA', 'VVVVxx'),
+(5268, 5500, 0, 0, 8, 8, 68, 268, 1268, 268, 5268, 136, 137, 'QUAAAA', 'ODIAAA', 'AAAAxx'),
+(2719, 5501, 1, 3, 9, 19, 19, 719, 719, 2719, 2719, 38, 39, 'PAAAAA', 'PDIAAA', 'HHHHxx'),
+(30, 5502, 0, 2, 0, 10, 30, 30, 30, 30, 30, 60, 61, 'EBAAAA', 'QDIAAA', 'OOOOxx'),
+(1975, 5503, 1, 3, 5, 15, 75, 975, 1975, 1975, 1975, 150, 151, 'ZXAAAA', 'RDIAAA', 'VVVVxx'),
+(2641, 5504, 1, 1, 1, 1, 41, 641, 641, 2641, 2641, 82, 83, 'PXAAAA', 'SDIAAA', 'AAAAxx'),
+(8616, 5505, 0, 0, 6, 16, 16, 616, 616, 3616, 8616, 32, 33, 'KTAAAA', 'TDIAAA', 'HHHHxx'),
+(5980, 5506, 0, 0, 0, 0, 80, 980, 1980, 980, 5980, 160, 161, 'AWAAAA', 'UDIAAA', 'OOOOxx'),
+(5170, 5507, 0, 2, 0, 10, 70, 170, 1170, 170, 5170, 140, 141, 'WQAAAA', 'VDIAAA', 'VVVVxx'),
+(1960, 5508, 0, 0, 0, 0, 60, 960, 1960, 1960, 1960, 120, 121, 'KXAAAA', 'WDIAAA', 'AAAAxx'),
+(8141, 5509, 1, 1, 1, 1, 41, 141, 141, 3141, 8141, 82, 83, 'DBAAAA', 'XDIAAA', 'HHHHxx'),
+(6692, 5510, 0, 0, 2, 12, 92, 692, 692, 1692, 6692, 184, 185, 'KXAAAA', 'YDIAAA', 'OOOOxx'),
+(7621, 5511, 1, 1, 1, 1, 21, 621, 1621, 2621, 7621, 42, 43, 'DHAAAA', 'ZDIAAA', 'VVVVxx'),
+(3890, 5512, 0, 2, 0, 10, 90, 890, 1890, 3890, 3890, 180, 181, 'QTAAAA', 'AEIAAA', 'AAAAxx'),
+(4300, 5513, 0, 0, 0, 0, 0, 300, 300, 4300, 4300, 0, 1, 'KJAAAA', 'BEIAAA', 'HHHHxx'),
+(736, 5514, 0, 0, 6, 16, 36, 736, 736, 736, 736, 72, 73, 'ICAAAA', 'CEIAAA', 'OOOOxx'),
+(6626, 5515, 0, 2, 6, 6, 26, 626, 626, 1626, 6626, 52, 53, 'WUAAAA', 'DEIAAA', 'VVVVxx'),
+(1800, 5516, 0, 0, 0, 0, 0, 800, 1800, 1800, 1800, 0, 1, 'GRAAAA', 'EEIAAA', 'AAAAxx'),
+(3430, 5517, 0, 2, 0, 10, 30, 430, 1430, 3430, 3430, 60, 61, 'YBAAAA', 'FEIAAA', 'HHHHxx'),
+(9519, 5518, 1, 3, 9, 19, 19, 519, 1519, 4519, 9519, 38, 39, 'DCAAAA', 'GEIAAA', 'OOOOxx'),
+(5111, 5519, 1, 3, 1, 11, 11, 111, 1111, 111, 5111, 22, 23, 'POAAAA', 'HEIAAA', 'VVVVxx'),
+(6915, 5520, 1, 3, 5, 15, 15, 915, 915, 1915, 6915, 30, 31, 'ZFAAAA', 'IEIAAA', 'AAAAxx'),
+(9246, 5521, 0, 2, 6, 6, 46, 246, 1246, 4246, 9246, 92, 93, 'QRAAAA', 'JEIAAA', 'HHHHxx'),
+(5141, 5522, 1, 1, 1, 1, 41, 141, 1141, 141, 5141, 82, 83, 'TPAAAA', 'KEIAAA', 'OOOOxx'),
+(5922, 5523, 0, 2, 2, 2, 22, 922, 1922, 922, 5922, 44, 45, 'UTAAAA', 'LEIAAA', 'VVVVxx'),
+(3087, 5524, 1, 3, 7, 7, 87, 87, 1087, 3087, 3087, 174, 175, 'TOAAAA', 'MEIAAA', 'AAAAxx'),
+(1859, 5525, 1, 3, 9, 19, 59, 859, 1859, 1859, 1859, 118, 119, 'NTAAAA', 'NEIAAA', 'HHHHxx'),
+(8482, 5526, 0, 2, 2, 2, 82, 482, 482, 3482, 8482, 164, 165, 'GOAAAA', 'OEIAAA', 'OOOOxx'),
+(8414, 5527, 0, 2, 4, 14, 14, 414, 414, 3414, 8414, 28, 29, 'QLAAAA', 'PEIAAA', 'VVVVxx'),
+(6662, 5528, 0, 2, 2, 2, 62, 662, 662, 1662, 6662, 124, 125, 'GWAAAA', 'QEIAAA', 'AAAAxx'),
+(8614, 5529, 0, 2, 4, 14, 14, 614, 614, 3614, 8614, 28, 29, 'ITAAAA', 'REIAAA', 'HHHHxx'),
+(42, 5530, 0, 2, 2, 2, 42, 42, 42, 42, 42, 84, 85, 'QBAAAA', 'SEIAAA', 'OOOOxx'),
+(7582, 5531, 0, 2, 2, 2, 82, 582, 1582, 2582, 7582, 164, 165, 'QFAAAA', 'TEIAAA', 'VVVVxx'),
+(8183, 5532, 1, 3, 3, 3, 83, 183, 183, 3183, 8183, 166, 167, 'TCAAAA', 'UEIAAA', 'AAAAxx'),
+(1299, 5533, 1, 3, 9, 19, 99, 299, 1299, 1299, 1299, 198, 199, 'ZXAAAA', 'VEIAAA', 'HHHHxx'),
+(7004, 5534, 0, 0, 4, 4, 4, 4, 1004, 2004, 7004, 8, 9, 'KJAAAA', 'WEIAAA', 'OOOOxx'),
+(3298, 5535, 0, 2, 8, 18, 98, 298, 1298, 3298, 3298, 196, 197, 'WWAAAA', 'XEIAAA', 'VVVVxx'),
+(7884, 5536, 0, 0, 4, 4, 84, 884, 1884, 2884, 7884, 168, 169, 'GRAAAA', 'YEIAAA', 'AAAAxx'),
+(4191, 5537, 1, 3, 1, 11, 91, 191, 191, 4191, 4191, 182, 183, 'FFAAAA', 'ZEIAAA', 'HHHHxx'),
+(7346, 5538, 0, 2, 6, 6, 46, 346, 1346, 2346, 7346, 92, 93, 'OWAAAA', 'AFIAAA', 'OOOOxx'),
+(7989, 5539, 1, 1, 9, 9, 89, 989, 1989, 2989, 7989, 178, 179, 'HVAAAA', 'BFIAAA', 'VVVVxx'),
+(5719, 5540, 1, 3, 9, 19, 19, 719, 1719, 719, 5719, 38, 39, 'ZLAAAA', 'CFIAAA', 'AAAAxx'),
+(800, 5541, 0, 0, 0, 0, 0, 800, 800, 800, 800, 0, 1, 'UEAAAA', 'DFIAAA', 'HHHHxx'),
+(6509, 5542, 1, 1, 9, 9, 9, 509, 509, 1509, 6509, 18, 19, 'JQAAAA', 'EFIAAA', 'OOOOxx'),
+(4672, 5543, 0, 0, 2, 12, 72, 672, 672, 4672, 4672, 144, 145, 'SXAAAA', 'FFIAAA', 'VVVVxx'),
+(4434, 5544, 0, 2, 4, 14, 34, 434, 434, 4434, 4434, 68, 69, 'OOAAAA', 'GFIAAA', 'AAAAxx'),
+(8309, 5545, 1, 1, 9, 9, 9, 309, 309, 3309, 8309, 18, 19, 'PHAAAA', 'HFIAAA', 'HHHHxx'),
+(5134, 5546, 0, 2, 4, 14, 34, 134, 1134, 134, 5134, 68, 69, 'MPAAAA', 'IFIAAA', 'OOOOxx'),
+(5153, 5547, 1, 1, 3, 13, 53, 153, 1153, 153, 5153, 106, 107, 'FQAAAA', 'JFIAAA', 'VVVVxx'),
+(1522, 5548, 0, 2, 2, 2, 22, 522, 1522, 1522, 1522, 44, 45, 'OGAAAA', 'KFIAAA', 'AAAAxx'),
+(8629, 5549, 1, 1, 9, 9, 29, 629, 629, 3629, 8629, 58, 59, 'XTAAAA', 'LFIAAA', 'HHHHxx'),
+(4549, 5550, 1, 1, 9, 9, 49, 549, 549, 4549, 4549, 98, 99, 'ZSAAAA', 'MFIAAA', 'OOOOxx'),
+(9506, 5551, 0, 2, 6, 6, 6, 506, 1506, 4506, 9506, 12, 13, 'QBAAAA', 'NFIAAA', 'VVVVxx'),
+(6542, 5552, 0, 2, 2, 2, 42, 542, 542, 1542, 6542, 84, 85, 'QRAAAA', 'OFIAAA', 'AAAAxx'),
+(2579, 5553, 1, 3, 9, 19, 79, 579, 579, 2579, 2579, 158, 159, 'FVAAAA', 'PFIAAA', 'HHHHxx'),
+(4664, 5554, 0, 0, 4, 4, 64, 664, 664, 4664, 4664, 128, 129, 'KXAAAA', 'QFIAAA', 'OOOOxx'),
+(696, 5555, 0, 0, 6, 16, 96, 696, 696, 696, 696, 192, 193, 'UAAAAA', 'RFIAAA', 'VVVVxx'),
+(7950, 5556, 0, 2, 0, 10, 50, 950, 1950, 2950, 7950, 100, 101, 'UTAAAA', 'SFIAAA', 'AAAAxx'),
+(5, 5557, 1, 1, 5, 5, 5, 5, 5, 5, 5, 10, 11, 'FAAAAA', 'TFIAAA', 'HHHHxx'),
+(7806, 5558, 0, 2, 6, 6, 6, 806, 1806, 2806, 7806, 12, 13, 'GOAAAA', 'UFIAAA', 'OOOOxx'),
+(2770, 5559, 0, 2, 0, 10, 70, 770, 770, 2770, 2770, 140, 141, 'OCAAAA', 'VFIAAA', 'VVVVxx'),
+(1344, 5560, 0, 0, 4, 4, 44, 344, 1344, 1344, 1344, 88, 89, 'SZAAAA', 'WFIAAA', 'AAAAxx'),
+(511, 5561, 1, 3, 1, 11, 11, 511, 511, 511, 511, 22, 23, 'RTAAAA', 'XFIAAA', 'HHHHxx'),
+(9070, 5562, 0, 2, 0, 10, 70, 70, 1070, 4070, 9070, 140, 141, 'WKAAAA', 'YFIAAA', 'OOOOxx'),
+(2961, 5563, 1, 1, 1, 1, 61, 961, 961, 2961, 2961, 122, 123, 'XJAAAA', 'ZFIAAA', 'VVVVxx'),
+(8031, 5564, 1, 3, 1, 11, 31, 31, 31, 3031, 8031, 62, 63, 'XWAAAA', 'AGIAAA', 'AAAAxx'),
+(326, 5565, 0, 2, 6, 6, 26, 326, 326, 326, 326, 52, 53, 'OMAAAA', 'BGIAAA', 'HHHHxx'),
+(183, 5566, 1, 3, 3, 3, 83, 183, 183, 183, 183, 166, 167, 'BHAAAA', 'CGIAAA', 'OOOOxx'),
+(5917, 5567, 1, 1, 7, 17, 17, 917, 1917, 917, 5917, 34, 35, 'PTAAAA', 'DGIAAA', 'VVVVxx'),
+(8256, 5568, 0, 0, 6, 16, 56, 256, 256, 3256, 8256, 112, 113, 'OFAAAA', 'EGIAAA', 'AAAAxx'),
+(7889, 5569, 1, 1, 9, 9, 89, 889, 1889, 2889, 7889, 178, 179, 'LRAAAA', 'FGIAAA', 'HHHHxx'),
+(9029, 5570, 1, 1, 9, 9, 29, 29, 1029, 4029, 9029, 58, 59, 'HJAAAA', 'GGIAAA', 'OOOOxx'),
+(1316, 5571, 0, 0, 6, 16, 16, 316, 1316, 1316, 1316, 32, 33, 'QYAAAA', 'HGIAAA', 'VVVVxx'),
+(7442, 5572, 0, 2, 2, 2, 42, 442, 1442, 2442, 7442, 84, 85, 'GAAAAA', 'IGIAAA', 'AAAAxx'),
+(2810, 5573, 0, 2, 0, 10, 10, 810, 810, 2810, 2810, 20, 21, 'CEAAAA', 'JGIAAA', 'HHHHxx'),
+(20, 5574, 0, 0, 0, 0, 20, 20, 20, 20, 20, 40, 41, 'UAAAAA', 'KGIAAA', 'OOOOxx'),
+(2306, 5575, 0, 2, 6, 6, 6, 306, 306, 2306, 2306, 12, 13, 'SKAAAA', 'LGIAAA', 'VVVVxx'),
+(4694, 5576, 0, 2, 4, 14, 94, 694, 694, 4694, 4694, 188, 189, 'OYAAAA', 'MGIAAA', 'AAAAxx'),
+(9710, 5577, 0, 2, 0, 10, 10, 710, 1710, 4710, 9710, 20, 21, 'MJAAAA', 'NGIAAA', 'HHHHxx'),
+(1791, 5578, 1, 3, 1, 11, 91, 791, 1791, 1791, 1791, 182, 183, 'XQAAAA', 'OGIAAA', 'OOOOxx'),
+(6730, 5579, 0, 2, 0, 10, 30, 730, 730, 1730, 6730, 60, 61, 'WYAAAA', 'PGIAAA', 'VVVVxx'),
+(359, 5580, 1, 3, 9, 19, 59, 359, 359, 359, 359, 118, 119, 'VNAAAA', 'QGIAAA', 'AAAAxx'),
+(8097, 5581, 1, 1, 7, 17, 97, 97, 97, 3097, 8097, 194, 195, 'LZAAAA', 'RGIAAA', 'HHHHxx'),
+(6147, 5582, 1, 3, 7, 7, 47, 147, 147, 1147, 6147, 94, 95, 'LCAAAA', 'SGIAAA', 'OOOOxx'),
+(643, 5583, 1, 3, 3, 3, 43, 643, 643, 643, 643, 86, 87, 'TYAAAA', 'TGIAAA', 'VVVVxx'),
+(698, 5584, 0, 2, 8, 18, 98, 698, 698, 698, 698, 196, 197, 'WAAAAA', 'UGIAAA', 'AAAAxx'),
+(3881, 5585, 1, 1, 1, 1, 81, 881, 1881, 3881, 3881, 162, 163, 'HTAAAA', 'VGIAAA', 'HHHHxx'),
+(7600, 5586, 0, 0, 0, 0, 0, 600, 1600, 2600, 7600, 0, 1, 'IGAAAA', 'WGIAAA', 'OOOOxx'),
+(1583, 5587, 1, 3, 3, 3, 83, 583, 1583, 1583, 1583, 166, 167, 'XIAAAA', 'XGIAAA', 'VVVVxx'),
+(9612, 5588, 0, 0, 2, 12, 12, 612, 1612, 4612, 9612, 24, 25, 'SFAAAA', 'YGIAAA', 'AAAAxx'),
+(1032, 5589, 0, 0, 2, 12, 32, 32, 1032, 1032, 1032, 64, 65, 'SNAAAA', 'ZGIAAA', 'HHHHxx'),
+(4834, 5590, 0, 2, 4, 14, 34, 834, 834, 4834, 4834, 68, 69, 'YDAAAA', 'AHIAAA', 'OOOOxx'),
+(5076, 5591, 0, 0, 6, 16, 76, 76, 1076, 76, 5076, 152, 153, 'GNAAAA', 'BHIAAA', 'VVVVxx'),
+(3070, 5592, 0, 2, 0, 10, 70, 70, 1070, 3070, 3070, 140, 141, 'COAAAA', 'CHIAAA', 'AAAAxx'),
+(1421, 5593, 1, 1, 1, 1, 21, 421, 1421, 1421, 1421, 42, 43, 'RCAAAA', 'DHIAAA', 'HHHHxx'),
+(8970, 5594, 0, 2, 0, 10, 70, 970, 970, 3970, 8970, 140, 141, 'AHAAAA', 'EHIAAA', 'OOOOxx'),
+(6271, 5595, 1, 3, 1, 11, 71, 271, 271, 1271, 6271, 142, 143, 'FHAAAA', 'FHIAAA', 'VVVVxx'),
+(8547, 5596, 1, 3, 7, 7, 47, 547, 547, 3547, 8547, 94, 95, 'TQAAAA', 'GHIAAA', 'AAAAxx'),
+(1259, 5597, 1, 3, 9, 19, 59, 259, 1259, 1259, 1259, 118, 119, 'LWAAAA', 'HHIAAA', 'HHHHxx'),
+(8328, 5598, 0, 0, 8, 8, 28, 328, 328, 3328, 8328, 56, 57, 'IIAAAA', 'IHIAAA', 'OOOOxx'),
+(1503, 5599, 1, 3, 3, 3, 3, 503, 1503, 1503, 1503, 6, 7, 'VFAAAA', 'JHIAAA', 'VVVVxx'),
+(2253, 5600, 1, 1, 3, 13, 53, 253, 253, 2253, 2253, 106, 107, 'RIAAAA', 'KHIAAA', 'AAAAxx'),
+(7449, 5601, 1, 1, 9, 9, 49, 449, 1449, 2449, 7449, 98, 99, 'NAAAAA', 'LHIAAA', 'HHHHxx'),
+(3579, 5602, 1, 3, 9, 19, 79, 579, 1579, 3579, 3579, 158, 159, 'RHAAAA', 'MHIAAA', 'OOOOxx'),
+(1585, 5603, 1, 1, 5, 5, 85, 585, 1585, 1585, 1585, 170, 171, 'ZIAAAA', 'NHIAAA', 'VVVVxx'),
+(5543, 5604, 1, 3, 3, 3, 43, 543, 1543, 543, 5543, 86, 87, 'FFAAAA', 'OHIAAA', 'AAAAxx'),
+(8627, 5605, 1, 3, 7, 7, 27, 627, 627, 3627, 8627, 54, 55, 'VTAAAA', 'PHIAAA', 'HHHHxx'),
+(8618, 5606, 0, 2, 8, 18, 18, 618, 618, 3618, 8618, 36, 37, 'MTAAAA', 'QHIAAA', 'OOOOxx'),
+(1911, 5607, 1, 3, 1, 11, 11, 911, 1911, 1911, 1911, 22, 23, 'NVAAAA', 'RHIAAA', 'VVVVxx'),
+(2758, 5608, 0, 2, 8, 18, 58, 758, 758, 2758, 2758, 116, 117, 'CCAAAA', 'SHIAAA', 'AAAAxx'),
+(5744, 5609, 0, 0, 4, 4, 44, 744, 1744, 744, 5744, 88, 89, 'YMAAAA', 'THIAAA', 'HHHHxx'),
+(4976, 5610, 0, 0, 6, 16, 76, 976, 976, 4976, 4976, 152, 153, 'KJAAAA', 'UHIAAA', 'OOOOxx'),
+(6380, 5611, 0, 0, 0, 0, 80, 380, 380, 1380, 6380, 160, 161, 'KLAAAA', 'VHIAAA', 'VVVVxx'),
+(1937, 5612, 1, 1, 7, 17, 37, 937, 1937, 1937, 1937, 74, 75, 'NWAAAA', 'WHIAAA', 'AAAAxx'),
+(9903, 5613, 1, 3, 3, 3, 3, 903, 1903, 4903, 9903, 6, 7, 'XQAAAA', 'XHIAAA', 'HHHHxx'),
+(4409, 5614, 1, 1, 9, 9, 9, 409, 409, 4409, 4409, 18, 19, 'PNAAAA', 'YHIAAA', 'OOOOxx'),
+(4133, 5615, 1, 1, 3, 13, 33, 133, 133, 4133, 4133, 66, 67, 'ZCAAAA', 'ZHIAAA', 'VVVVxx'),
+(5263, 5616, 1, 3, 3, 3, 63, 263, 1263, 263, 5263, 126, 127, 'LUAAAA', 'AIIAAA', 'AAAAxx'),
+(7888, 5617, 0, 0, 8, 8, 88, 888, 1888, 2888, 7888, 176, 177, 'KRAAAA', 'BIIAAA', 'HHHHxx'),
+(6060, 5618, 0, 0, 0, 0, 60, 60, 60, 1060, 6060, 120, 121, 'CZAAAA', 'CIIAAA', 'OOOOxx'),
+(2522, 5619, 0, 2, 2, 2, 22, 522, 522, 2522, 2522, 44, 45, 'ATAAAA', 'DIIAAA', 'VVVVxx'),
+(5550, 5620, 0, 2, 0, 10, 50, 550, 1550, 550, 5550, 100, 101, 'MFAAAA', 'EIIAAA', 'AAAAxx'),
+(9396, 5621, 0, 0, 6, 16, 96, 396, 1396, 4396, 9396, 192, 193, 'KXAAAA', 'FIIAAA', 'HHHHxx'),
+(176, 5622, 0, 0, 6, 16, 76, 176, 176, 176, 176, 152, 153, 'UGAAAA', 'GIIAAA', 'OOOOxx'),
+(5148, 5623, 0, 0, 8, 8, 48, 148, 1148, 148, 5148, 96, 97, 'AQAAAA', 'HIIAAA', 'VVVVxx'),
+(6691, 5624, 1, 3, 1, 11, 91, 691, 691, 1691, 6691, 182, 183, 'JXAAAA', 'IIIAAA', 'AAAAxx'),
+(4652, 5625, 0, 0, 2, 12, 52, 652, 652, 4652, 4652, 104, 105, 'YWAAAA', 'JIIAAA', 'HHHHxx'),
+(5096, 5626, 0, 0, 6, 16, 96, 96, 1096, 96, 5096, 192, 193, 'AOAAAA', 'KIIAAA', 'OOOOxx'),
+(2408, 5627, 0, 0, 8, 8, 8, 408, 408, 2408, 2408, 16, 17, 'QOAAAA', 'LIIAAA', 'VVVVxx'),
+(7322, 5628, 0, 2, 2, 2, 22, 322, 1322, 2322, 7322, 44, 45, 'QVAAAA', 'MIIAAA', 'AAAAxx'),
+(6782, 5629, 0, 2, 2, 2, 82, 782, 782, 1782, 6782, 164, 165, 'WAAAAA', 'NIIAAA', 'HHHHxx'),
+(4642, 5630, 0, 2, 2, 2, 42, 642, 642, 4642, 4642, 84, 85, 'OWAAAA', 'OIIAAA', 'OOOOxx'),
+(5427, 5631, 1, 3, 7, 7, 27, 427, 1427, 427, 5427, 54, 55, 'TAAAAA', 'PIIAAA', 'VVVVxx'),
+(4461, 5632, 1, 1, 1, 1, 61, 461, 461, 4461, 4461, 122, 123, 'PPAAAA', 'QIIAAA', 'AAAAxx'),
+(8416, 5633, 0, 0, 6, 16, 16, 416, 416, 3416, 8416, 32, 33, 'SLAAAA', 'RIIAAA', 'HHHHxx'),
+(2593, 5634, 1, 1, 3, 13, 93, 593, 593, 2593, 2593, 186, 187, 'TVAAAA', 'SIIAAA', 'OOOOxx'),
+(6202, 5635, 0, 2, 2, 2, 2, 202, 202, 1202, 6202, 4, 5, 'OEAAAA', 'TIIAAA', 'VVVVxx'),
+(3826, 5636, 0, 2, 6, 6, 26, 826, 1826, 3826, 3826, 52, 53, 'ERAAAA', 'UIIAAA', 'AAAAxx'),
+(4417, 5637, 1, 1, 7, 17, 17, 417, 417, 4417, 4417, 34, 35, 'XNAAAA', 'VIIAAA', 'HHHHxx'),
+(7871, 5638, 1, 3, 1, 11, 71, 871, 1871, 2871, 7871, 142, 143, 'TQAAAA', 'WIIAAA', 'OOOOxx'),
+(5622, 5639, 0, 2, 2, 2, 22, 622, 1622, 622, 5622, 44, 45, 'GIAAAA', 'XIIAAA', 'VVVVxx'),
+(3010, 5640, 0, 2, 0, 10, 10, 10, 1010, 3010, 3010, 20, 21, 'ULAAAA', 'YIIAAA', 'AAAAxx'),
+(3407, 5641, 1, 3, 7, 7, 7, 407, 1407, 3407, 3407, 14, 15, 'BBAAAA', 'ZIIAAA', 'HHHHxx'),
+(1274, 5642, 0, 2, 4, 14, 74, 274, 1274, 1274, 1274, 148, 149, 'AXAAAA', 'AJIAAA', 'OOOOxx'),
+(2828, 5643, 0, 0, 8, 8, 28, 828, 828, 2828, 2828, 56, 57, 'UEAAAA', 'BJIAAA', 'VVVVxx'),
+(3427, 5644, 1, 3, 7, 7, 27, 427, 1427, 3427, 3427, 54, 55, 'VBAAAA', 'CJIAAA', 'AAAAxx'),
+(612, 5645, 0, 0, 2, 12, 12, 612, 612, 612, 612, 24, 25, 'OXAAAA', 'DJIAAA', 'HHHHxx'),
+(8729, 5646, 1, 1, 9, 9, 29, 729, 729, 3729, 8729, 58, 59, 'TXAAAA', 'EJIAAA', 'OOOOxx'),
+(1239, 5647, 1, 3, 9, 19, 39, 239, 1239, 1239, 1239, 78, 79, 'RVAAAA', 'FJIAAA', 'VVVVxx'),
+(8990, 5648, 0, 2, 0, 10, 90, 990, 990, 3990, 8990, 180, 181, 'UHAAAA', 'GJIAAA', 'AAAAxx'),
+(5609, 5649, 1, 1, 9, 9, 9, 609, 1609, 609, 5609, 18, 19, 'THAAAA', 'HJIAAA', 'HHHHxx'),
+(4441, 5650, 1, 1, 1, 1, 41, 441, 441, 4441, 4441, 82, 83, 'VOAAAA', 'IJIAAA', 'OOOOxx'),
+(9078, 5651, 0, 2, 8, 18, 78, 78, 1078, 4078, 9078, 156, 157, 'ELAAAA', 'JJIAAA', 'VVVVxx'),
+(6699, 5652, 1, 3, 9, 19, 99, 699, 699, 1699, 6699, 198, 199, 'RXAAAA', 'KJIAAA', 'AAAAxx'),
+(8390, 5653, 0, 2, 0, 10, 90, 390, 390, 3390, 8390, 180, 181, 'SKAAAA', 'LJIAAA', 'HHHHxx'),
+(5455, 5654, 1, 3, 5, 15, 55, 455, 1455, 455, 5455, 110, 111, 'VBAAAA', 'MJIAAA', 'OOOOxx'),
+(7537, 5655, 1, 1, 7, 17, 37, 537, 1537, 2537, 7537, 74, 75, 'XDAAAA', 'NJIAAA', 'VVVVxx'),
+(4669, 5656, 1, 1, 9, 9, 69, 669, 669, 4669, 4669, 138, 139, 'PXAAAA', 'OJIAAA', 'AAAAxx'),
+(5534, 5657, 0, 2, 4, 14, 34, 534, 1534, 534, 5534, 68, 69, 'WEAAAA', 'PJIAAA', 'HHHHxx'),
+(1920, 5658, 0, 0, 0, 0, 20, 920, 1920, 1920, 1920, 40, 41, 'WVAAAA', 'QJIAAA', 'OOOOxx'),
+(9465, 5659, 1, 1, 5, 5, 65, 465, 1465, 4465, 9465, 130, 131, 'BAAAAA', 'RJIAAA', 'VVVVxx'),
+(4897, 5660, 1, 1, 7, 17, 97, 897, 897, 4897, 4897, 194, 195, 'JGAAAA', 'SJIAAA', 'AAAAxx'),
+(1990, 5661, 0, 2, 0, 10, 90, 990, 1990, 1990, 1990, 180, 181, 'OYAAAA', 'TJIAAA', 'HHHHxx'),
+(7148, 5662, 0, 0, 8, 8, 48, 148, 1148, 2148, 7148, 96, 97, 'YOAAAA', 'UJIAAA', 'OOOOxx'),
+(533, 5663, 1, 1, 3, 13, 33, 533, 533, 533, 533, 66, 67, 'NUAAAA', 'VJIAAA', 'VVVVxx'),
+(4339, 5664, 1, 3, 9, 19, 39, 339, 339, 4339, 4339, 78, 79, 'XKAAAA', 'WJIAAA', 'AAAAxx'),
+(6450, 5665, 0, 2, 0, 10, 50, 450, 450, 1450, 6450, 100, 101, 'COAAAA', 'XJIAAA', 'HHHHxx'),
+(9627, 5666, 1, 3, 7, 7, 27, 627, 1627, 4627, 9627, 54, 55, 'HGAAAA', 'YJIAAA', 'OOOOxx'),
+(5539, 5667, 1, 3, 9, 19, 39, 539, 1539, 539, 5539, 78, 79, 'BFAAAA', 'ZJIAAA', 'VVVVxx'),
+(6758, 5668, 0, 2, 8, 18, 58, 758, 758, 1758, 6758, 116, 117, 'YZAAAA', 'AKIAAA', 'AAAAxx'),
+(3435, 5669, 1, 3, 5, 15, 35, 435, 1435, 3435, 3435, 70, 71, 'DCAAAA', 'BKIAAA', 'HHHHxx'),
+(4350, 5670, 0, 2, 0, 10, 50, 350, 350, 4350, 4350, 100, 101, 'ILAAAA', 'CKIAAA', 'OOOOxx'),
+(9088, 5671, 0, 0, 8, 8, 88, 88, 1088, 4088, 9088, 176, 177, 'OLAAAA', 'DKIAAA', 'VVVVxx'),
+(6368, 5672, 0, 0, 8, 8, 68, 368, 368, 1368, 6368, 136, 137, 'YKAAAA', 'EKIAAA', 'AAAAxx'),
+(6337, 5673, 1, 1, 7, 17, 37, 337, 337, 1337, 6337, 74, 75, 'TJAAAA', 'FKIAAA', 'HHHHxx'),
+(4361, 5674, 1, 1, 1, 1, 61, 361, 361, 4361, 4361, 122, 123, 'TLAAAA', 'GKIAAA', 'OOOOxx'),
+(1719, 5675, 1, 3, 9, 19, 19, 719, 1719, 1719, 1719, 38, 39, 'DOAAAA', 'HKIAAA', 'VVVVxx'),
+(3109, 5676, 1, 1, 9, 9, 9, 109, 1109, 3109, 3109, 18, 19, 'PPAAAA', 'IKIAAA', 'AAAAxx'),
+(7135, 5677, 1, 3, 5, 15, 35, 135, 1135, 2135, 7135, 70, 71, 'LOAAAA', 'JKIAAA', 'HHHHxx'),
+(1964, 5678, 0, 0, 4, 4, 64, 964, 1964, 1964, 1964, 128, 129, 'OXAAAA', 'KKIAAA', 'OOOOxx'),
+(3, 5679, 1, 3, 3, 3, 3, 3, 3, 3, 3, 6, 7, 'DAAAAA', 'LKIAAA', 'VVVVxx'),
+(1868, 5680, 0, 0, 8, 8, 68, 868, 1868, 1868, 1868, 136, 137, 'WTAAAA', 'MKIAAA', 'AAAAxx'),
+(5182, 5681, 0, 2, 2, 2, 82, 182, 1182, 182, 5182, 164, 165, 'IRAAAA', 'NKIAAA', 'HHHHxx'),
+(7567, 5682, 1, 3, 7, 7, 67, 567, 1567, 2567, 7567, 134, 135, 'BFAAAA', 'OKIAAA', 'OOOOxx'),
+(3676, 5683, 0, 0, 6, 16, 76, 676, 1676, 3676, 3676, 152, 153, 'KLAAAA', 'PKIAAA', 'VVVVxx'),
+(9382, 5684, 0, 2, 2, 2, 82, 382, 1382, 4382, 9382, 164, 165, 'WWAAAA', 'QKIAAA', 'AAAAxx'),
+(8645, 5685, 1, 1, 5, 5, 45, 645, 645, 3645, 8645, 90, 91, 'NUAAAA', 'RKIAAA', 'HHHHxx'),
+(2018, 5686, 0, 2, 8, 18, 18, 18, 18, 2018, 2018, 36, 37, 'QZAAAA', 'SKIAAA', 'OOOOxx'),
+(217, 5687, 1, 1, 7, 17, 17, 217, 217, 217, 217, 34, 35, 'JIAAAA', 'TKIAAA', 'VVVVxx'),
+(6793, 5688, 1, 1, 3, 13, 93, 793, 793, 1793, 6793, 186, 187, 'HBAAAA', 'UKIAAA', 'AAAAxx'),
+(7280, 5689, 0, 0, 0, 0, 80, 280, 1280, 2280, 7280, 160, 161, 'AUAAAA', 'VKIAAA', 'HHHHxx'),
+(2168, 5690, 0, 0, 8, 8, 68, 168, 168, 2168, 2168, 136, 137, 'KFAAAA', 'WKIAAA', 'OOOOxx'),
+(5259, 5691, 1, 3, 9, 19, 59, 259, 1259, 259, 5259, 118, 119, 'HUAAAA', 'XKIAAA', 'VVVVxx'),
+(6019, 5692, 1, 3, 9, 19, 19, 19, 19, 1019, 6019, 38, 39, 'NXAAAA', 'YKIAAA', 'AAAAxx'),
+(877, 5693, 1, 1, 7, 17, 77, 877, 877, 877, 877, 154, 155, 'THAAAA', 'ZKIAAA', 'HHHHxx'),
+(4961, 5694, 1, 1, 1, 1, 61, 961, 961, 4961, 4961, 122, 123, 'VIAAAA', 'ALIAAA', 'OOOOxx'),
+(1873, 5695, 1, 1, 3, 13, 73, 873, 1873, 1873, 1873, 146, 147, 'BUAAAA', 'BLIAAA', 'VVVVxx'),
+(13, 5696, 1, 1, 3, 13, 13, 13, 13, 13, 13, 26, 27, 'NAAAAA', 'CLIAAA', 'AAAAxx'),
+(1537, 5697, 1, 1, 7, 17, 37, 537, 1537, 1537, 1537, 74, 75, 'DHAAAA', 'DLIAAA', 'HHHHxx'),
+(3129, 5698, 1, 1, 9, 9, 29, 129, 1129, 3129, 3129, 58, 59, 'JQAAAA', 'ELIAAA', 'OOOOxx'),
+(6473, 5699, 1, 1, 3, 13, 73, 473, 473, 1473, 6473, 146, 147, 'ZOAAAA', 'FLIAAA', 'VVVVxx'),
+(7865, 5700, 1, 1, 5, 5, 65, 865, 1865, 2865, 7865, 130, 131, 'NQAAAA', 'GLIAAA', 'AAAAxx'),
+(7822, 5701, 0, 2, 2, 2, 22, 822, 1822, 2822, 7822, 44, 45, 'WOAAAA', 'HLIAAA', 'HHHHxx'),
+(239, 5702, 1, 3, 9, 19, 39, 239, 239, 239, 239, 78, 79, 'FJAAAA', 'ILIAAA', 'OOOOxx'),
+(2062, 5703, 0, 2, 2, 2, 62, 62, 62, 2062, 2062, 124, 125, 'IBAAAA', 'JLIAAA', 'VVVVxx'),
+(762, 5704, 0, 2, 2, 2, 62, 762, 762, 762, 762, 124, 125, 'IDAAAA', 'KLIAAA', 'AAAAxx'),
+(3764, 5705, 0, 0, 4, 4, 64, 764, 1764, 3764, 3764, 128, 129, 'UOAAAA', 'LLIAAA', 'HHHHxx'),
+(465, 5706, 1, 1, 5, 5, 65, 465, 465, 465, 465, 130, 131, 'XRAAAA', 'MLIAAA', 'OOOOxx'),
+(2587, 5707, 1, 3, 7, 7, 87, 587, 587, 2587, 2587, 174, 175, 'NVAAAA', 'NLIAAA', 'VVVVxx'),
+(8402, 5708, 0, 2, 2, 2, 2, 402, 402, 3402, 8402, 4, 5, 'ELAAAA', 'OLIAAA', 'AAAAxx'),
+(1055, 5709, 1, 3, 5, 15, 55, 55, 1055, 1055, 1055, 110, 111, 'POAAAA', 'PLIAAA', 'HHHHxx'),
+(3072, 5710, 0, 0, 2, 12, 72, 72, 1072, 3072, 3072, 144, 145, 'EOAAAA', 'QLIAAA', 'OOOOxx'),
+(7359, 5711, 1, 3, 9, 19, 59, 359, 1359, 2359, 7359, 118, 119, 'BXAAAA', 'RLIAAA', 'VVVVxx'),
+(6558, 5712, 0, 2, 8, 18, 58, 558, 558, 1558, 6558, 116, 117, 'GSAAAA', 'SLIAAA', 'AAAAxx'),
+(48, 5713, 0, 0, 8, 8, 48, 48, 48, 48, 48, 96, 97, 'WBAAAA', 'TLIAAA', 'HHHHxx'),
+(5382, 5714, 0, 2, 2, 2, 82, 382, 1382, 382, 5382, 164, 165, 'AZAAAA', 'ULIAAA', 'OOOOxx'),
+(947, 5715, 1, 3, 7, 7, 47, 947, 947, 947, 947, 94, 95, 'LKAAAA', 'VLIAAA', 'VVVVxx'),
+(2644, 5716, 0, 0, 4, 4, 44, 644, 644, 2644, 2644, 88, 89, 'SXAAAA', 'WLIAAA', 'AAAAxx'),
+(7516, 5717, 0, 0, 6, 16, 16, 516, 1516, 2516, 7516, 32, 33, 'CDAAAA', 'XLIAAA', 'HHHHxx'),
+(2362, 5718, 0, 2, 2, 2, 62, 362, 362, 2362, 2362, 124, 125, 'WMAAAA', 'YLIAAA', 'OOOOxx'),
+(839, 5719, 1, 3, 9, 19, 39, 839, 839, 839, 839, 78, 79, 'HGAAAA', 'ZLIAAA', 'VVVVxx'),
+(2216, 5720, 0, 0, 6, 16, 16, 216, 216, 2216, 2216, 32, 33, 'GHAAAA', 'AMIAAA', 'AAAAxx'),
+(7673, 5721, 1, 1, 3, 13, 73, 673, 1673, 2673, 7673, 146, 147, 'DJAAAA', 'BMIAAA', 'HHHHxx'),
+(8173, 5722, 1, 1, 3, 13, 73, 173, 173, 3173, 8173, 146, 147, 'JCAAAA', 'CMIAAA', 'OOOOxx'),
+(1630, 5723, 0, 2, 0, 10, 30, 630, 1630, 1630, 1630, 60, 61, 'SKAAAA', 'DMIAAA', 'VVVVxx'),
+(9057, 5724, 1, 1, 7, 17, 57, 57, 1057, 4057, 9057, 114, 115, 'JKAAAA', 'EMIAAA', 'AAAAxx'),
+(4392, 5725, 0, 0, 2, 12, 92, 392, 392, 4392, 4392, 184, 185, 'YMAAAA', 'FMIAAA', 'HHHHxx'),
+(3695, 5726, 1, 3, 5, 15, 95, 695, 1695, 3695, 3695, 190, 191, 'DMAAAA', 'GMIAAA', 'OOOOxx'),
+(5751, 5727, 1, 3, 1, 11, 51, 751, 1751, 751, 5751, 102, 103, 'FNAAAA', 'HMIAAA', 'VVVVxx'),
+(5745, 5728, 1, 1, 5, 5, 45, 745, 1745, 745, 5745, 90, 91, 'ZMAAAA', 'IMIAAA', 'AAAAxx'),
+(7945, 5729, 1, 1, 5, 5, 45, 945, 1945, 2945, 7945, 90, 91, 'PTAAAA', 'JMIAAA', 'HHHHxx'),
+(5174, 5730, 0, 2, 4, 14, 74, 174, 1174, 174, 5174, 148, 149, 'ARAAAA', 'KMIAAA', 'OOOOxx'),
+(3829, 5731, 1, 1, 9, 9, 29, 829, 1829, 3829, 3829, 58, 59, 'HRAAAA', 'LMIAAA', 'VVVVxx'),
+(3317, 5732, 1, 1, 7, 17, 17, 317, 1317, 3317, 3317, 34, 35, 'PXAAAA', 'MMIAAA', 'AAAAxx'),
+(4253, 5733, 1, 1, 3, 13, 53, 253, 253, 4253, 4253, 106, 107, 'PHAAAA', 'NMIAAA', 'HHHHxx'),
+(1291, 5734, 1, 3, 1, 11, 91, 291, 1291, 1291, 1291, 182, 183, 'RXAAAA', 'OMIAAA', 'OOOOxx'),
+(3266, 5735, 0, 2, 6, 6, 66, 266, 1266, 3266, 3266, 132, 133, 'QVAAAA', 'PMIAAA', 'VVVVxx'),
+(2939, 5736, 1, 3, 9, 19, 39, 939, 939, 2939, 2939, 78, 79, 'BJAAAA', 'QMIAAA', 'AAAAxx'),
+(2755, 5737, 1, 3, 5, 15, 55, 755, 755, 2755, 2755, 110, 111, 'ZBAAAA', 'RMIAAA', 'HHHHxx'),
+(6844, 5738, 0, 0, 4, 4, 44, 844, 844, 1844, 6844, 88, 89, 'GDAAAA', 'SMIAAA', 'OOOOxx'),
+(8594, 5739, 0, 2, 4, 14, 94, 594, 594, 3594, 8594, 188, 189, 'OSAAAA', 'TMIAAA', 'VVVVxx'),
+(704, 5740, 0, 0, 4, 4, 4, 704, 704, 704, 704, 8, 9, 'CBAAAA', 'UMIAAA', 'AAAAxx'),
+(1681, 5741, 1, 1, 1, 1, 81, 681, 1681, 1681, 1681, 162, 163, 'RMAAAA', 'VMIAAA', 'HHHHxx'),
+(364, 5742, 0, 0, 4, 4, 64, 364, 364, 364, 364, 128, 129, 'AOAAAA', 'WMIAAA', 'OOOOxx'),
+(2928, 5743, 0, 0, 8, 8, 28, 928, 928, 2928, 2928, 56, 57, 'QIAAAA', 'XMIAAA', 'VVVVxx'),
+(117, 5744, 1, 1, 7, 17, 17, 117, 117, 117, 117, 34, 35, 'NEAAAA', 'YMIAAA', 'AAAAxx'),
+(96, 5745, 0, 0, 6, 16, 96, 96, 96, 96, 96, 192, 193, 'SDAAAA', 'ZMIAAA', 'HHHHxx'),
+(7796, 5746, 0, 0, 6, 16, 96, 796, 1796, 2796, 7796, 192, 193, 'WNAAAA', 'ANIAAA', 'OOOOxx'),
+(3101, 5747, 1, 1, 1, 1, 1, 101, 1101, 3101, 3101, 2, 3, 'HPAAAA', 'BNIAAA', 'VVVVxx'),
+(3397, 5748, 1, 1, 7, 17, 97, 397, 1397, 3397, 3397, 194, 195, 'RAAAAA', 'CNIAAA', 'AAAAxx'),
+(1605, 5749, 1, 1, 5, 5, 5, 605, 1605, 1605, 1605, 10, 11, 'TJAAAA', 'DNIAAA', 'HHHHxx'),
+(4881, 5750, 1, 1, 1, 1, 81, 881, 881, 4881, 4881, 162, 163, 'TFAAAA', 'ENIAAA', 'OOOOxx'),
+(4521, 5751, 1, 1, 1, 1, 21, 521, 521, 4521, 4521, 42, 43, 'XRAAAA', 'FNIAAA', 'VVVVxx'),
+(6430, 5752, 0, 2, 0, 10, 30, 430, 430, 1430, 6430, 60, 61, 'INAAAA', 'GNIAAA', 'AAAAxx'),
+(282, 5753, 0, 2, 2, 2, 82, 282, 282, 282, 282, 164, 165, 'WKAAAA', 'HNIAAA', 'HHHHxx'),
+(9645, 5754, 1, 1, 5, 5, 45, 645, 1645, 4645, 9645, 90, 91, 'ZGAAAA', 'INIAAA', 'OOOOxx'),
+(8946, 5755, 0, 2, 6, 6, 46, 946, 946, 3946, 8946, 92, 93, 'CGAAAA', 'JNIAAA', 'VVVVxx'),
+(5064, 5756, 0, 0, 4, 4, 64, 64, 1064, 64, 5064, 128, 129, 'UMAAAA', 'KNIAAA', 'AAAAxx'),
+(7470, 5757, 0, 2, 0, 10, 70, 470, 1470, 2470, 7470, 140, 141, 'IBAAAA', 'LNIAAA', 'HHHHxx'),
+(5886, 5758, 0, 2, 6, 6, 86, 886, 1886, 886, 5886, 172, 173, 'KSAAAA', 'MNIAAA', 'OOOOxx'),
+(6280, 5759, 0, 0, 0, 0, 80, 280, 280, 1280, 6280, 160, 161, 'OHAAAA', 'NNIAAA', 'VVVVxx'),
+(5247, 5760, 1, 3, 7, 7, 47, 247, 1247, 247, 5247, 94, 95, 'VTAAAA', 'ONIAAA', 'AAAAxx'),
+(412, 5761, 0, 0, 2, 12, 12, 412, 412, 412, 412, 24, 25, 'WPAAAA', 'PNIAAA', 'HHHHxx'),
+(5342, 5762, 0, 2, 2, 2, 42, 342, 1342, 342, 5342, 84, 85, 'MXAAAA', 'QNIAAA', 'OOOOxx'),
+(2271, 5763, 1, 3, 1, 11, 71, 271, 271, 2271, 2271, 142, 143, 'JJAAAA', 'RNIAAA', 'VVVVxx'),
+(849, 5764, 1, 1, 9, 9, 49, 849, 849, 849, 849, 98, 99, 'RGAAAA', 'SNIAAA', 'AAAAxx'),
+(1885, 5765, 1, 1, 5, 5, 85, 885, 1885, 1885, 1885, 170, 171, 'NUAAAA', 'TNIAAA', 'HHHHxx'),
+(5620, 5766, 0, 0, 0, 0, 20, 620, 1620, 620, 5620, 40, 41, 'EIAAAA', 'UNIAAA', 'OOOOxx'),
+(7079, 5767, 1, 3, 9, 19, 79, 79, 1079, 2079, 7079, 158, 159, 'HMAAAA', 'VNIAAA', 'VVVVxx'),
+(5819, 5768, 1, 3, 9, 19, 19, 819, 1819, 819, 5819, 38, 39, 'VPAAAA', 'WNIAAA', 'AAAAxx'),
+(7497, 5769, 1, 1, 7, 17, 97, 497, 1497, 2497, 7497, 194, 195, 'JCAAAA', 'XNIAAA', 'HHHHxx'),
+(5993, 5770, 1, 1, 3, 13, 93, 993, 1993, 993, 5993, 186, 187, 'NWAAAA', 'YNIAAA', 'OOOOxx'),
+(3739, 5771, 1, 3, 9, 19, 39, 739, 1739, 3739, 3739, 78, 79, 'VNAAAA', 'ZNIAAA', 'VVVVxx'),
+(6296, 5772, 0, 0, 6, 16, 96, 296, 296, 1296, 6296, 192, 193, 'EIAAAA', 'AOIAAA', 'AAAAxx'),
+(2716, 5773, 0, 0, 6, 16, 16, 716, 716, 2716, 2716, 32, 33, 'MAAAAA', 'BOIAAA', 'HHHHxx'),
+(1130, 5774, 0, 2, 0, 10, 30, 130, 1130, 1130, 1130, 60, 61, 'MRAAAA', 'COIAAA', 'OOOOxx'),
+(5593, 5775, 1, 1, 3, 13, 93, 593, 1593, 593, 5593, 186, 187, 'DHAAAA', 'DOIAAA', 'VVVVxx'),
+(6972, 5776, 0, 0, 2, 12, 72, 972, 972, 1972, 6972, 144, 145, 'EIAAAA', 'EOIAAA', 'AAAAxx'),
+(8360, 5777, 0, 0, 0, 0, 60, 360, 360, 3360, 8360, 120, 121, 'OJAAAA', 'FOIAAA', 'HHHHxx'),
+(6448, 5778, 0, 0, 8, 8, 48, 448, 448, 1448, 6448, 96, 97, 'AOAAAA', 'GOIAAA', 'OOOOxx'),
+(3689, 5779, 1, 1, 9, 9, 89, 689, 1689, 3689, 3689, 178, 179, 'XLAAAA', 'HOIAAA', 'VVVVxx'),
+(7951, 5780, 1, 3, 1, 11, 51, 951, 1951, 2951, 7951, 102, 103, 'VTAAAA', 'IOIAAA', 'AAAAxx'),
+(2974, 5781, 0, 2, 4, 14, 74, 974, 974, 2974, 2974, 148, 149, 'KKAAAA', 'JOIAAA', 'HHHHxx'),
+(6600, 5782, 0, 0, 0, 0, 0, 600, 600, 1600, 6600, 0, 1, 'WTAAAA', 'KOIAAA', 'OOOOxx'),
+(4662, 5783, 0, 2, 2, 2, 62, 662, 662, 4662, 4662, 124, 125, 'IXAAAA', 'LOIAAA', 'VVVVxx'),
+(4765, 5784, 1, 1, 5, 5, 65, 765, 765, 4765, 4765, 130, 131, 'HBAAAA', 'MOIAAA', 'AAAAxx'),
+(355, 5785, 1, 3, 5, 15, 55, 355, 355, 355, 355, 110, 111, 'RNAAAA', 'NOIAAA', 'HHHHxx'),
+(6228, 5786, 0, 0, 8, 8, 28, 228, 228, 1228, 6228, 56, 57, 'OFAAAA', 'OOIAAA', 'OOOOxx'),
+(964, 5787, 0, 0, 4, 4, 64, 964, 964, 964, 964, 128, 129, 'CLAAAA', 'POIAAA', 'VVVVxx'),
+(3082, 5788, 0, 2, 2, 2, 82, 82, 1082, 3082, 3082, 164, 165, 'OOAAAA', 'QOIAAA', 'AAAAxx'),
+(7028, 5789, 0, 0, 8, 8, 28, 28, 1028, 2028, 7028, 56, 57, 'IKAAAA', 'ROIAAA', 'HHHHxx'),
+(4505, 5790, 1, 1, 5, 5, 5, 505, 505, 4505, 4505, 10, 11, 'HRAAAA', 'SOIAAA', 'OOOOxx'),
+(8961, 5791, 1, 1, 1, 1, 61, 961, 961, 3961, 8961, 122, 123, 'RGAAAA', 'TOIAAA', 'VVVVxx'),
+(9571, 5792, 1, 3, 1, 11, 71, 571, 1571, 4571, 9571, 142, 143, 'DEAAAA', 'UOIAAA', 'AAAAxx'),
+(9394, 5793, 0, 2, 4, 14, 94, 394, 1394, 4394, 9394, 188, 189, 'IXAAAA', 'VOIAAA', 'HHHHxx'),
+(4245, 5794, 1, 1, 5, 5, 45, 245, 245, 4245, 4245, 90, 91, 'HHAAAA', 'WOIAAA', 'OOOOxx'),
+(7560, 5795, 0, 0, 0, 0, 60, 560, 1560, 2560, 7560, 120, 121, 'UEAAAA', 'XOIAAA', 'VVVVxx'),
+(2907, 5796, 1, 3, 7, 7, 7, 907, 907, 2907, 2907, 14, 15, 'VHAAAA', 'YOIAAA', 'AAAAxx'),
+(7817, 5797, 1, 1, 7, 17, 17, 817, 1817, 2817, 7817, 34, 35, 'ROAAAA', 'ZOIAAA', 'HHHHxx'),
+(5408, 5798, 0, 0, 8, 8, 8, 408, 1408, 408, 5408, 16, 17, 'AAAAAA', 'APIAAA', 'OOOOxx'),
+(8092, 5799, 0, 0, 2, 12, 92, 92, 92, 3092, 8092, 184, 185, 'GZAAAA', 'BPIAAA', 'VVVVxx'),
+(1309, 5800, 1, 1, 9, 9, 9, 309, 1309, 1309, 1309, 18, 19, 'JYAAAA', 'CPIAAA', 'AAAAxx'),
+(6673, 5801, 1, 1, 3, 13, 73, 673, 673, 1673, 6673, 146, 147, 'RWAAAA', 'DPIAAA', 'HHHHxx'),
+(1245, 5802, 1, 1, 5, 5, 45, 245, 1245, 1245, 1245, 90, 91, 'XVAAAA', 'EPIAAA', 'OOOOxx'),
+(6790, 5803, 0, 2, 0, 10, 90, 790, 790, 1790, 6790, 180, 181, 'EBAAAA', 'FPIAAA', 'VVVVxx'),
+(8380, 5804, 0, 0, 0, 0, 80, 380, 380, 3380, 8380, 160, 161, 'IKAAAA', 'GPIAAA', 'AAAAxx'),
+(5786, 5805, 0, 2, 6, 6, 86, 786, 1786, 786, 5786, 172, 173, 'OOAAAA', 'HPIAAA', 'HHHHxx'),
+(9590, 5806, 0, 2, 0, 10, 90, 590, 1590, 4590, 9590, 180, 181, 'WEAAAA', 'IPIAAA', 'OOOOxx'),
+(5763, 5807, 1, 3, 3, 3, 63, 763, 1763, 763, 5763, 126, 127, 'RNAAAA', 'JPIAAA', 'VVVVxx'),
+(1345, 5808, 1, 1, 5, 5, 45, 345, 1345, 1345, 1345, 90, 91, 'TZAAAA', 'KPIAAA', 'AAAAxx'),
+(3480, 5809, 0, 0, 0, 0, 80, 480, 1480, 3480, 3480, 160, 161, 'WDAAAA', 'LPIAAA', 'HHHHxx'),
+(7864, 5810, 0, 0, 4, 4, 64, 864, 1864, 2864, 7864, 128, 129, 'MQAAAA', 'MPIAAA', 'OOOOxx'),
+(4853, 5811, 1, 1, 3, 13, 53, 853, 853, 4853, 4853, 106, 107, 'REAAAA', 'NPIAAA', 'VVVVxx'),
+(1445, 5812, 1, 1, 5, 5, 45, 445, 1445, 1445, 1445, 90, 91, 'PDAAAA', 'OPIAAA', 'AAAAxx'),
+(170, 5813, 0, 2, 0, 10, 70, 170, 170, 170, 170, 140, 141, 'OGAAAA', 'PPIAAA', 'HHHHxx'),
+(7348, 5814, 0, 0, 8, 8, 48, 348, 1348, 2348, 7348, 96, 97, 'QWAAAA', 'QPIAAA', 'OOOOxx'),
+(3920, 5815, 0, 0, 0, 0, 20, 920, 1920, 3920, 3920, 40, 41, 'UUAAAA', 'RPIAAA', 'VVVVxx'),
+(3307, 5816, 1, 3, 7, 7, 7, 307, 1307, 3307, 3307, 14, 15, 'FXAAAA', 'SPIAAA', 'AAAAxx'),
+(4584, 5817, 0, 0, 4, 4, 84, 584, 584, 4584, 4584, 168, 169, 'IUAAAA', 'TPIAAA', 'HHHHxx'),
+(3344, 5818, 0, 0, 4, 4, 44, 344, 1344, 3344, 3344, 88, 89, 'QYAAAA', 'UPIAAA', 'OOOOxx'),
+(4360, 5819, 0, 0, 0, 0, 60, 360, 360, 4360, 4360, 120, 121, 'SLAAAA', 'VPIAAA', 'VVVVxx'),
+(8757, 5820, 1, 1, 7, 17, 57, 757, 757, 3757, 8757, 114, 115, 'VYAAAA', 'WPIAAA', 'AAAAxx'),
+(4315, 5821, 1, 3, 5, 15, 15, 315, 315, 4315, 4315, 30, 31, 'ZJAAAA', 'XPIAAA', 'HHHHxx'),
+(5243, 5822, 1, 3, 3, 3, 43, 243, 1243, 243, 5243, 86, 87, 'RTAAAA', 'YPIAAA', 'OOOOxx'),
+(8550, 5823, 0, 2, 0, 10, 50, 550, 550, 3550, 8550, 100, 101, 'WQAAAA', 'ZPIAAA', 'VVVVxx'),
+(159, 5824, 1, 3, 9, 19, 59, 159, 159, 159, 159, 118, 119, 'DGAAAA', 'AQIAAA', 'AAAAxx'),
+(4710, 5825, 0, 2, 0, 10, 10, 710, 710, 4710, 4710, 20, 21, 'EZAAAA', 'BQIAAA', 'HHHHxx'),
+(7179, 5826, 1, 3, 9, 19, 79, 179, 1179, 2179, 7179, 158, 159, 'DQAAAA', 'CQIAAA', 'OOOOxx'),
+(2509, 5827, 1, 1, 9, 9, 9, 509, 509, 2509, 2509, 18, 19, 'NSAAAA', 'DQIAAA', 'VVVVxx'),
+(6981, 5828, 1, 1, 1, 1, 81, 981, 981, 1981, 6981, 162, 163, 'NIAAAA', 'EQIAAA', 'AAAAxx'),
+(5060, 5829, 0, 0, 0, 0, 60, 60, 1060, 60, 5060, 120, 121, 'QMAAAA', 'FQIAAA', 'HHHHxx'),
+(5601, 5830, 1, 1, 1, 1, 1, 601, 1601, 601, 5601, 2, 3, 'LHAAAA', 'GQIAAA', 'OOOOxx'),
+(703, 5831, 1, 3, 3, 3, 3, 703, 703, 703, 703, 6, 7, 'BBAAAA', 'HQIAAA', 'VVVVxx'),
+(8719, 5832, 1, 3, 9, 19, 19, 719, 719, 3719, 8719, 38, 39, 'JXAAAA', 'IQIAAA', 'AAAAxx'),
+(1570, 5833, 0, 2, 0, 10, 70, 570, 1570, 1570, 1570, 140, 141, 'KIAAAA', 'JQIAAA', 'HHHHxx'),
+(1036, 5834, 0, 0, 6, 16, 36, 36, 1036, 1036, 1036, 72, 73, 'WNAAAA', 'KQIAAA', 'OOOOxx'),
+(6703, 5835, 1, 3, 3, 3, 3, 703, 703, 1703, 6703, 6, 7, 'VXAAAA', 'LQIAAA', 'VVVVxx'),
+(252, 5836, 0, 0, 2, 12, 52, 252, 252, 252, 252, 104, 105, 'SJAAAA', 'MQIAAA', 'AAAAxx'),
+(631, 5837, 1, 3, 1, 11, 31, 631, 631, 631, 631, 62, 63, 'HYAAAA', 'NQIAAA', 'HHHHxx'),
+(5098, 5838, 0, 2, 8, 18, 98, 98, 1098, 98, 5098, 196, 197, 'COAAAA', 'OQIAAA', 'OOOOxx'),
+(8346, 5839, 0, 2, 6, 6, 46, 346, 346, 3346, 8346, 92, 93, 'AJAAAA', 'PQIAAA', 'VVVVxx'),
+(4910, 5840, 0, 2, 0, 10, 10, 910, 910, 4910, 4910, 20, 21, 'WGAAAA', 'QQIAAA', 'AAAAxx'),
+(559, 5841, 1, 3, 9, 19, 59, 559, 559, 559, 559, 118, 119, 'NVAAAA', 'RQIAAA', 'HHHHxx'),
+(1477, 5842, 1, 1, 7, 17, 77, 477, 1477, 1477, 1477, 154, 155, 'VEAAAA', 'SQIAAA', 'OOOOxx'),
+(5115, 5843, 1, 3, 5, 15, 15, 115, 1115, 115, 5115, 30, 31, 'TOAAAA', 'TQIAAA', 'VVVVxx'),
+(8784, 5844, 0, 0, 4, 4, 84, 784, 784, 3784, 8784, 168, 169, 'WZAAAA', 'UQIAAA', 'AAAAxx'),
+(4422, 5845, 0, 2, 2, 2, 22, 422, 422, 4422, 4422, 44, 45, 'COAAAA', 'VQIAAA', 'HHHHxx'),
+(2702, 5846, 0, 2, 2, 2, 2, 702, 702, 2702, 2702, 4, 5, 'YZAAAA', 'WQIAAA', 'OOOOxx'),
+(9599, 5847, 1, 3, 9, 19, 99, 599, 1599, 4599, 9599, 198, 199, 'FFAAAA', 'XQIAAA', 'VVVVxx'),
+(2463, 5848, 1, 3, 3, 3, 63, 463, 463, 2463, 2463, 126, 127, 'TQAAAA', 'YQIAAA', 'AAAAxx'),
+(498, 5849, 0, 2, 8, 18, 98, 498, 498, 498, 498, 196, 197, 'ETAAAA', 'ZQIAAA', 'HHHHxx'),
+(494, 5850, 0, 2, 4, 14, 94, 494, 494, 494, 494, 188, 189, 'ATAAAA', 'ARIAAA', 'OOOOxx'),
+(8632, 5851, 0, 0, 2, 12, 32, 632, 632, 3632, 8632, 64, 65, 'AUAAAA', 'BRIAAA', 'VVVVxx'),
+(3449, 5852, 1, 1, 9, 9, 49, 449, 1449, 3449, 3449, 98, 99, 'RCAAAA', 'CRIAAA', 'AAAAxx'),
+(5888, 5853, 0, 0, 8, 8, 88, 888, 1888, 888, 5888, 176, 177, 'MSAAAA', 'DRIAAA', 'HHHHxx'),
+(2211, 5854, 1, 3, 1, 11, 11, 211, 211, 2211, 2211, 22, 23, 'BHAAAA', 'ERIAAA', 'OOOOxx'),
+(2835, 5855, 1, 3, 5, 15, 35, 835, 835, 2835, 2835, 70, 71, 'BFAAAA', 'FRIAAA', 'VVVVxx'),
+(4196, 5856, 0, 0, 6, 16, 96, 196, 196, 4196, 4196, 192, 193, 'KFAAAA', 'GRIAAA', 'AAAAxx'),
+(2177, 5857, 1, 1, 7, 17, 77, 177, 177, 2177, 2177, 154, 155, 'TFAAAA', 'HRIAAA', 'HHHHxx'),
+(1959, 5858, 1, 3, 9, 19, 59, 959, 1959, 1959, 1959, 118, 119, 'JXAAAA', 'IRIAAA', 'OOOOxx'),
+(5172, 5859, 0, 0, 2, 12, 72, 172, 1172, 172, 5172, 144, 145, 'YQAAAA', 'JRIAAA', 'VVVVxx'),
+(7898, 5860, 0, 2, 8, 18, 98, 898, 1898, 2898, 7898, 196, 197, 'URAAAA', 'KRIAAA', 'AAAAxx'),
+(5729, 5861, 1, 1, 9, 9, 29, 729, 1729, 729, 5729, 58, 59, 'JMAAAA', 'LRIAAA', 'HHHHxx'),
+(469, 5862, 1, 1, 9, 9, 69, 469, 469, 469, 469, 138, 139, 'BSAAAA', 'MRIAAA', 'OOOOxx'),
+(4456, 5863, 0, 0, 6, 16, 56, 456, 456, 4456, 4456, 112, 113, 'KPAAAA', 'NRIAAA', 'VVVVxx'),
+(3578, 5864, 0, 2, 8, 18, 78, 578, 1578, 3578, 3578, 156, 157, 'QHAAAA', 'ORIAAA', 'AAAAxx'),
+(8623, 5865, 1, 3, 3, 3, 23, 623, 623, 3623, 8623, 46, 47, 'RTAAAA', 'PRIAAA', 'HHHHxx'),
+(6749, 5866, 1, 1, 9, 9, 49, 749, 749, 1749, 6749, 98, 99, 'PZAAAA', 'QRIAAA', 'OOOOxx'),
+(6735, 5867, 1, 3, 5, 15, 35, 735, 735, 1735, 6735, 70, 71, 'BZAAAA', 'RRIAAA', 'VVVVxx'),
+(5197, 5868, 1, 1, 7, 17, 97, 197, 1197, 197, 5197, 194, 195, 'XRAAAA', 'SRIAAA', 'AAAAxx'),
+(2067, 5869, 1, 3, 7, 7, 67, 67, 67, 2067, 2067, 134, 135, 'NBAAAA', 'TRIAAA', 'HHHHxx'),
+(5600, 5870, 0, 0, 0, 0, 0, 600, 1600, 600, 5600, 0, 1, 'KHAAAA', 'URIAAA', 'OOOOxx'),
+(7741, 5871, 1, 1, 1, 1, 41, 741, 1741, 2741, 7741, 82, 83, 'TLAAAA', 'VRIAAA', 'VVVVxx'),
+(9925, 5872, 1, 1, 5, 5, 25, 925, 1925, 4925, 9925, 50, 51, 'TRAAAA', 'WRIAAA', 'AAAAxx'),
+(9685, 5873, 1, 1, 5, 5, 85, 685, 1685, 4685, 9685, 170, 171, 'NIAAAA', 'XRIAAA', 'HHHHxx'),
+(7622, 5874, 0, 2, 2, 2, 22, 622, 1622, 2622, 7622, 44, 45, 'EHAAAA', 'YRIAAA', 'OOOOxx'),
+(6859, 5875, 1, 3, 9, 19, 59, 859, 859, 1859, 6859, 118, 119, 'VDAAAA', 'ZRIAAA', 'VVVVxx'),
+(3094, 5876, 0, 2, 4, 14, 94, 94, 1094, 3094, 3094, 188, 189, 'APAAAA', 'ASIAAA', 'AAAAxx'),
+(2628, 5877, 0, 0, 8, 8, 28, 628, 628, 2628, 2628, 56, 57, 'CXAAAA', 'BSIAAA', 'HHHHxx'),
+(40, 5878, 0, 0, 0, 0, 40, 40, 40, 40, 40, 80, 81, 'OBAAAA', 'CSIAAA', 'OOOOxx'),
+(1644, 5879, 0, 0, 4, 4, 44, 644, 1644, 1644, 1644, 88, 89, 'GLAAAA', 'DSIAAA', 'VVVVxx'),
+(588, 5880, 0, 0, 8, 8, 88, 588, 588, 588, 588, 176, 177, 'QWAAAA', 'ESIAAA', 'AAAAxx'),
+(7522, 5881, 0, 2, 2, 2, 22, 522, 1522, 2522, 7522, 44, 45, 'IDAAAA', 'FSIAAA', 'HHHHxx'),
+(162, 5882, 0, 2, 2, 2, 62, 162, 162, 162, 162, 124, 125, 'GGAAAA', 'GSIAAA', 'OOOOxx'),
+(3610, 5883, 0, 2, 0, 10, 10, 610, 1610, 3610, 3610, 20, 21, 'WIAAAA', 'HSIAAA', 'VVVVxx'),
+(3561, 5884, 1, 1, 1, 1, 61, 561, 1561, 3561, 3561, 122, 123, 'ZGAAAA', 'ISIAAA', 'AAAAxx'),
+(8185, 5885, 1, 1, 5, 5, 85, 185, 185, 3185, 8185, 170, 171, 'VCAAAA', 'JSIAAA', 'HHHHxx'),
+(7237, 5886, 1, 1, 7, 17, 37, 237, 1237, 2237, 7237, 74, 75, 'JSAAAA', 'KSIAAA', 'OOOOxx'),
+(4592, 5887, 0, 0, 2, 12, 92, 592, 592, 4592, 4592, 184, 185, 'QUAAAA', 'LSIAAA', 'VVVVxx'),
+(7082, 5888, 0, 2, 2, 2, 82, 82, 1082, 2082, 7082, 164, 165, 'KMAAAA', 'MSIAAA', 'AAAAxx'),
+(4719, 5889, 1, 3, 9, 19, 19, 719, 719, 4719, 4719, 38, 39, 'NZAAAA', 'NSIAAA', 'HHHHxx'),
+(3879, 5890, 1, 3, 9, 19, 79, 879, 1879, 3879, 3879, 158, 159, 'FTAAAA', 'OSIAAA', 'OOOOxx'),
+(1662, 5891, 0, 2, 2, 2, 62, 662, 1662, 1662, 1662, 124, 125, 'YLAAAA', 'PSIAAA', 'VVVVxx'),
+(3995, 5892, 1, 3, 5, 15, 95, 995, 1995, 3995, 3995, 190, 191, 'RXAAAA', 'QSIAAA', 'AAAAxx'),
+(5828, 5893, 0, 0, 8, 8, 28, 828, 1828, 828, 5828, 56, 57, 'EQAAAA', 'RSIAAA', 'HHHHxx'),
+(4197, 5894, 1, 1, 7, 17, 97, 197, 197, 4197, 4197, 194, 195, 'LFAAAA', 'SSIAAA', 'OOOOxx'),
+(5146, 5895, 0, 2, 6, 6, 46, 146, 1146, 146, 5146, 92, 93, 'YPAAAA', 'TSIAAA', 'VVVVxx'),
+(753, 5896, 1, 1, 3, 13, 53, 753, 753, 753, 753, 106, 107, 'ZCAAAA', 'USIAAA', 'AAAAxx'),
+(7064, 5897, 0, 0, 4, 4, 64, 64, 1064, 2064, 7064, 128, 129, 'SLAAAA', 'VSIAAA', 'HHHHxx'),
+(1312, 5898, 0, 0, 2, 12, 12, 312, 1312, 1312, 1312, 24, 25, 'MYAAAA', 'WSIAAA', 'OOOOxx'),
+(5573, 5899, 1, 1, 3, 13, 73, 573, 1573, 573, 5573, 146, 147, 'JGAAAA', 'XSIAAA', 'VVVVxx'),
+(7634, 5900, 0, 2, 4, 14, 34, 634, 1634, 2634, 7634, 68, 69, 'QHAAAA', 'YSIAAA', 'AAAAxx'),
+(2459, 5901, 1, 3, 9, 19, 59, 459, 459, 2459, 2459, 118, 119, 'PQAAAA', 'ZSIAAA', 'HHHHxx'),
+(8636, 5902, 0, 0, 6, 16, 36, 636, 636, 3636, 8636, 72, 73, 'EUAAAA', 'ATIAAA', 'OOOOxx'),
+(5318, 5903, 0, 2, 8, 18, 18, 318, 1318, 318, 5318, 36, 37, 'OWAAAA', 'BTIAAA', 'VVVVxx'),
+(1064, 5904, 0, 0, 4, 4, 64, 64, 1064, 1064, 1064, 128, 129, 'YOAAAA', 'CTIAAA', 'AAAAxx'),
+(9779, 5905, 1, 3, 9, 19, 79, 779, 1779, 4779, 9779, 158, 159, 'DMAAAA', 'DTIAAA', 'HHHHxx'),
+(6512, 5906, 0, 0, 2, 12, 12, 512, 512, 1512, 6512, 24, 25, 'MQAAAA', 'ETIAAA', 'OOOOxx'),
+(3572, 5907, 0, 0, 2, 12, 72, 572, 1572, 3572, 3572, 144, 145, 'KHAAAA', 'FTIAAA', 'VVVVxx'),
+(816, 5908, 0, 0, 6, 16, 16, 816, 816, 816, 816, 32, 33, 'KFAAAA', 'GTIAAA', 'AAAAxx'),
+(3978, 5909, 0, 2, 8, 18, 78, 978, 1978, 3978, 3978, 156, 157, 'AXAAAA', 'HTIAAA', 'HHHHxx'),
+(5390, 5910, 0, 2, 0, 10, 90, 390, 1390, 390, 5390, 180, 181, 'IZAAAA', 'ITIAAA', 'OOOOxx'),
+(4685, 5911, 1, 1, 5, 5, 85, 685, 685, 4685, 4685, 170, 171, 'FYAAAA', 'JTIAAA', 'VVVVxx'),
+(3003, 5912, 1, 3, 3, 3, 3, 3, 1003, 3003, 3003, 6, 7, 'NLAAAA', 'KTIAAA', 'AAAAxx'),
+(2638, 5913, 0, 2, 8, 18, 38, 638, 638, 2638, 2638, 76, 77, 'MXAAAA', 'LTIAAA', 'HHHHxx'),
+(9716, 5914, 0, 0, 6, 16, 16, 716, 1716, 4716, 9716, 32, 33, 'SJAAAA', 'MTIAAA', 'OOOOxx'),
+(9598, 5915, 0, 2, 8, 18, 98, 598, 1598, 4598, 9598, 196, 197, 'EFAAAA', 'NTIAAA', 'VVVVxx'),
+(9501, 5916, 1, 1, 1, 1, 1, 501, 1501, 4501, 9501, 2, 3, 'LBAAAA', 'OTIAAA', 'AAAAxx'),
+(1704, 5917, 0, 0, 4, 4, 4, 704, 1704, 1704, 1704, 8, 9, 'ONAAAA', 'PTIAAA', 'HHHHxx'),
+(8609, 5918, 1, 1, 9, 9, 9, 609, 609, 3609, 8609, 18, 19, 'DTAAAA', 'QTIAAA', 'OOOOxx'),
+(5211, 5919, 1, 3, 1, 11, 11, 211, 1211, 211, 5211, 22, 23, 'LSAAAA', 'RTIAAA', 'VVVVxx'),
+(3605, 5920, 1, 1, 5, 5, 5, 605, 1605, 3605, 3605, 10, 11, 'RIAAAA', 'STIAAA', 'AAAAxx'),
+(8730, 5921, 0, 2, 0, 10, 30, 730, 730, 3730, 8730, 60, 61, 'UXAAAA', 'TTIAAA', 'HHHHxx'),
+(4208, 5922, 0, 0, 8, 8, 8, 208, 208, 4208, 4208, 16, 17, 'WFAAAA', 'UTIAAA', 'OOOOxx'),
+(7784, 5923, 0, 0, 4, 4, 84, 784, 1784, 2784, 7784, 168, 169, 'KNAAAA', 'VTIAAA', 'VVVVxx'),
+(7501, 5924, 1, 1, 1, 1, 1, 501, 1501, 2501, 7501, 2, 3, 'NCAAAA', 'WTIAAA', 'AAAAxx'),
+(7862, 5925, 0, 2, 2, 2, 62, 862, 1862, 2862, 7862, 124, 125, 'KQAAAA', 'XTIAAA', 'HHHHxx'),
+(8922, 5926, 0, 2, 2, 2, 22, 922, 922, 3922, 8922, 44, 45, 'EFAAAA', 'YTIAAA', 'OOOOxx'),
+(3857, 5927, 1, 1, 7, 17, 57, 857, 1857, 3857, 3857, 114, 115, 'JSAAAA', 'ZTIAAA', 'VVVVxx'),
+(6393, 5928, 1, 1, 3, 13, 93, 393, 393, 1393, 6393, 186, 187, 'XLAAAA', 'AUIAAA', 'AAAAxx'),
+(506, 5929, 0, 2, 6, 6, 6, 506, 506, 506, 506, 12, 13, 'MTAAAA', 'BUIAAA', 'HHHHxx'),
+(4232, 5930, 0, 0, 2, 12, 32, 232, 232, 4232, 4232, 64, 65, 'UGAAAA', 'CUIAAA', 'OOOOxx'),
+(8991, 5931, 1, 3, 1, 11, 91, 991, 991, 3991, 8991, 182, 183, 'VHAAAA', 'DUIAAA', 'VVVVxx'),
+(8578, 5932, 0, 2, 8, 18, 78, 578, 578, 3578, 8578, 156, 157, 'YRAAAA', 'EUIAAA', 'AAAAxx'),
+(3235, 5933, 1, 3, 5, 15, 35, 235, 1235, 3235, 3235, 70, 71, 'LUAAAA', 'FUIAAA', 'HHHHxx'),
+(963, 5934, 1, 3, 3, 3, 63, 963, 963, 963, 963, 126, 127, 'BLAAAA', 'GUIAAA', 'OOOOxx'),
+(113, 5935, 1, 1, 3, 13, 13, 113, 113, 113, 113, 26, 27, 'JEAAAA', 'HUIAAA', 'VVVVxx'),
+(8234, 5936, 0, 2, 4, 14, 34, 234, 234, 3234, 8234, 68, 69, 'SEAAAA', 'IUIAAA', 'AAAAxx'),
+(2613, 5937, 1, 1, 3, 13, 13, 613, 613, 2613, 2613, 26, 27, 'NWAAAA', 'JUIAAA', 'HHHHxx'),
+(5540, 5938, 0, 0, 0, 0, 40, 540, 1540, 540, 5540, 80, 81, 'CFAAAA', 'KUIAAA', 'OOOOxx'),
+(9727, 5939, 1, 3, 7, 7, 27, 727, 1727, 4727, 9727, 54, 55, 'DKAAAA', 'LUIAAA', 'VVVVxx'),
+(2229, 5940, 1, 1, 9, 9, 29, 229, 229, 2229, 2229, 58, 59, 'THAAAA', 'MUIAAA', 'AAAAxx'),
+(6242, 5941, 0, 2, 2, 2, 42, 242, 242, 1242, 6242, 84, 85, 'CGAAAA', 'NUIAAA', 'HHHHxx'),
+(2502, 5942, 0, 2, 2, 2, 2, 502, 502, 2502, 2502, 4, 5, 'GSAAAA', 'OUIAAA', 'OOOOxx'),
+(6212, 5943, 0, 0, 2, 12, 12, 212, 212, 1212, 6212, 24, 25, 'YEAAAA', 'PUIAAA', 'VVVVxx'),
+(3495, 5944, 1, 3, 5, 15, 95, 495, 1495, 3495, 3495, 190, 191, 'LEAAAA', 'QUIAAA', 'AAAAxx'),
+(2364, 5945, 0, 0, 4, 4, 64, 364, 364, 2364, 2364, 128, 129, 'YMAAAA', 'RUIAAA', 'HHHHxx'),
+(6777, 5946, 1, 1, 7, 17, 77, 777, 777, 1777, 6777, 154, 155, 'RAAAAA', 'SUIAAA', 'OOOOxx'),
+(9811, 5947, 1, 3, 1, 11, 11, 811, 1811, 4811, 9811, 22, 23, 'JNAAAA', 'TUIAAA', 'VVVVxx'),
+(1450, 5948, 0, 2, 0, 10, 50, 450, 1450, 1450, 1450, 100, 101, 'UDAAAA', 'UUIAAA', 'AAAAxx'),
+(5008, 5949, 0, 0, 8, 8, 8, 8, 1008, 8, 5008, 16, 17, 'QKAAAA', 'VUIAAA', 'HHHHxx'),
+(1318, 5950, 0, 2, 8, 18, 18, 318, 1318, 1318, 1318, 36, 37, 'SYAAAA', 'WUIAAA', 'OOOOxx'),
+(3373, 5951, 1, 1, 3, 13, 73, 373, 1373, 3373, 3373, 146, 147, 'TZAAAA', 'XUIAAA', 'VVVVxx'),
+(398, 5952, 0, 2, 8, 18, 98, 398, 398, 398, 398, 196, 197, 'IPAAAA', 'YUIAAA', 'AAAAxx'),
+(3804, 5953, 0, 0, 4, 4, 4, 804, 1804, 3804, 3804, 8, 9, 'IQAAAA', 'ZUIAAA', 'HHHHxx'),
+(9148, 5954, 0, 0, 8, 8, 48, 148, 1148, 4148, 9148, 96, 97, 'WNAAAA', 'AVIAAA', 'OOOOxx'),
+(4382, 5955, 0, 2, 2, 2, 82, 382, 382, 4382, 4382, 164, 165, 'OMAAAA', 'BVIAAA', 'VVVVxx'),
+(4026, 5956, 0, 2, 6, 6, 26, 26, 26, 4026, 4026, 52, 53, 'WYAAAA', 'CVIAAA', 'AAAAxx'),
+(7804, 5957, 0, 0, 4, 4, 4, 804, 1804, 2804, 7804, 8, 9, 'EOAAAA', 'DVIAAA', 'HHHHxx'),
+(6839, 5958, 1, 3, 9, 19, 39, 839, 839, 1839, 6839, 78, 79, 'BDAAAA', 'EVIAAA', 'OOOOxx'),
+(3756, 5959, 0, 0, 6, 16, 56, 756, 1756, 3756, 3756, 112, 113, 'MOAAAA', 'FVIAAA', 'VVVVxx'),
+(6734, 5960, 0, 2, 4, 14, 34, 734, 734, 1734, 6734, 68, 69, 'AZAAAA', 'GVIAAA', 'AAAAxx'),
+(2228, 5961, 0, 0, 8, 8, 28, 228, 228, 2228, 2228, 56, 57, 'SHAAAA', 'HVIAAA', 'HHHHxx'),
+(3273, 5962, 1, 1, 3, 13, 73, 273, 1273, 3273, 3273, 146, 147, 'XVAAAA', 'IVIAAA', 'OOOOxx'),
+(3708, 5963, 0, 0, 8, 8, 8, 708, 1708, 3708, 3708, 16, 17, 'QMAAAA', 'JVIAAA', 'VVVVxx'),
+(4320, 5964, 0, 0, 0, 0, 20, 320, 320, 4320, 4320, 40, 41, 'EKAAAA', 'KVIAAA', 'AAAAxx'),
+(74, 5965, 0, 2, 4, 14, 74, 74, 74, 74, 74, 148, 149, 'WCAAAA', 'LVIAAA', 'HHHHxx'),
+(2520, 5966, 0, 0, 0, 0, 20, 520, 520, 2520, 2520, 40, 41, 'YSAAAA', 'MVIAAA', 'OOOOxx'),
+(9619, 5967, 1, 3, 9, 19, 19, 619, 1619, 4619, 9619, 38, 39, 'ZFAAAA', 'NVIAAA', 'VVVVxx'),
+(1801, 5968, 1, 1, 1, 1, 1, 801, 1801, 1801, 1801, 2, 3, 'HRAAAA', 'OVIAAA', 'AAAAxx'),
+(6399, 5969, 1, 3, 9, 19, 99, 399, 399, 1399, 6399, 198, 199, 'DMAAAA', 'PVIAAA', 'HHHHxx'),
+(8313, 5970, 1, 1, 3, 13, 13, 313, 313, 3313, 8313, 26, 27, 'THAAAA', 'QVIAAA', 'OOOOxx'),
+(7003, 5971, 1, 3, 3, 3, 3, 3, 1003, 2003, 7003, 6, 7, 'JJAAAA', 'RVIAAA', 'VVVVxx'),
+(329, 5972, 1, 1, 9, 9, 29, 329, 329, 329, 329, 58, 59, 'RMAAAA', 'SVIAAA', 'AAAAxx'),
+(9090, 5973, 0, 2, 0, 10, 90, 90, 1090, 4090, 9090, 180, 181, 'QLAAAA', 'TVIAAA', 'HHHHxx'),
+(2299, 5974, 1, 3, 9, 19, 99, 299, 299, 2299, 2299, 198, 199, 'LKAAAA', 'UVIAAA', 'OOOOxx'),
+(3925, 5975, 1, 1, 5, 5, 25, 925, 1925, 3925, 3925, 50, 51, 'ZUAAAA', 'VVIAAA', 'VVVVxx'),
+(8145, 5976, 1, 1, 5, 5, 45, 145, 145, 3145, 8145, 90, 91, 'HBAAAA', 'WVIAAA', 'AAAAxx'),
+(8561, 5977, 1, 1, 1, 1, 61, 561, 561, 3561, 8561, 122, 123, 'HRAAAA', 'XVIAAA', 'HHHHxx'),
+(2797, 5978, 1, 1, 7, 17, 97, 797, 797, 2797, 2797, 194, 195, 'PDAAAA', 'YVIAAA', 'OOOOxx'),
+(1451, 5979, 1, 3, 1, 11, 51, 451, 1451, 1451, 1451, 102, 103, 'VDAAAA', 'ZVIAAA', 'VVVVxx'),
+(7977, 5980, 1, 1, 7, 17, 77, 977, 1977, 2977, 7977, 154, 155, 'VUAAAA', 'AWIAAA', 'AAAAxx'),
+(112, 5981, 0, 0, 2, 12, 12, 112, 112, 112, 112, 24, 25, 'IEAAAA', 'BWIAAA', 'HHHHxx'),
+(5265, 5982, 1, 1, 5, 5, 65, 265, 1265, 265, 5265, 130, 131, 'NUAAAA', 'CWIAAA', 'OOOOxx'),
+(3819, 5983, 1, 3, 9, 19, 19, 819, 1819, 3819, 3819, 38, 39, 'XQAAAA', 'DWIAAA', 'VVVVxx'),
+(3648, 5984, 0, 0, 8, 8, 48, 648, 1648, 3648, 3648, 96, 97, 'IKAAAA', 'EWIAAA', 'AAAAxx'),
+(6306, 5985, 0, 2, 6, 6, 6, 306, 306, 1306, 6306, 12, 13, 'OIAAAA', 'FWIAAA', 'HHHHxx'),
+(2385, 5986, 1, 1, 5, 5, 85, 385, 385, 2385, 2385, 170, 171, 'TNAAAA', 'GWIAAA', 'OOOOxx'),
+(9084, 5987, 0, 0, 4, 4, 84, 84, 1084, 4084, 9084, 168, 169, 'KLAAAA', 'HWIAAA', 'VVVVxx'),
+(4499, 5988, 1, 3, 9, 19, 99, 499, 499, 4499, 4499, 198, 199, 'BRAAAA', 'IWIAAA', 'AAAAxx'),
+(1154, 5989, 0, 2, 4, 14, 54, 154, 1154, 1154, 1154, 108, 109, 'KSAAAA', 'JWIAAA', 'HHHHxx'),
+(6800, 5990, 0, 0, 0, 0, 0, 800, 800, 1800, 6800, 0, 1, 'OBAAAA', 'KWIAAA', 'OOOOxx'),
+(8049, 5991, 1, 1, 9, 9, 49, 49, 49, 3049, 8049, 98, 99, 'PXAAAA', 'LWIAAA', 'VVVVxx'),
+(3733, 5992, 1, 1, 3, 13, 33, 733, 1733, 3733, 3733, 66, 67, 'PNAAAA', 'MWIAAA', 'AAAAxx'),
+(8496, 5993, 0, 0, 6, 16, 96, 496, 496, 3496, 8496, 192, 193, 'UOAAAA', 'NWIAAA', 'HHHHxx'),
+(9952, 5994, 0, 0, 2, 12, 52, 952, 1952, 4952, 9952, 104, 105, 'USAAAA', 'OWIAAA', 'OOOOxx'),
+(9792, 5995, 0, 0, 2, 12, 92, 792, 1792, 4792, 9792, 184, 185, 'QMAAAA', 'PWIAAA', 'VVVVxx'),
+(5081, 5996, 1, 1, 1, 1, 81, 81, 1081, 81, 5081, 162, 163, 'LNAAAA', 'QWIAAA', 'AAAAxx'),
+(7908, 5997, 0, 0, 8, 8, 8, 908, 1908, 2908, 7908, 16, 17, 'ESAAAA', 'RWIAAA', 'HHHHxx'),
+(5398, 5998, 0, 2, 8, 18, 98, 398, 1398, 398, 5398, 196, 197, 'QZAAAA', 'SWIAAA', 'OOOOxx'),
+(8423, 5999, 1, 3, 3, 3, 23, 423, 423, 3423, 8423, 46, 47, 'ZLAAAA', 'TWIAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(3362, 6000, 0, 2, 2, 2, 62, 362, 1362, 3362, 3362, 124, 125, 'IZAAAA', 'UWIAAA', 'AAAAxx'),
+(7767, 6001, 1, 3, 7, 7, 67, 767, 1767, 2767, 7767, 134, 135, 'TMAAAA', 'VWIAAA', 'HHHHxx'),
+(7063, 6002, 1, 3, 3, 3, 63, 63, 1063, 2063, 7063, 126, 127, 'RLAAAA', 'WWIAAA', 'OOOOxx'),
+(8350, 6003, 0, 2, 0, 10, 50, 350, 350, 3350, 8350, 100, 101, 'EJAAAA', 'XWIAAA', 'VVVVxx'),
+(6779, 6004, 1, 3, 9, 19, 79, 779, 779, 1779, 6779, 158, 159, 'TAAAAA', 'YWIAAA', 'AAAAxx'),
+(5742, 6005, 0, 2, 2, 2, 42, 742, 1742, 742, 5742, 84, 85, 'WMAAAA', 'ZWIAAA', 'HHHHxx'),
+(9045, 6006, 1, 1, 5, 5, 45, 45, 1045, 4045, 9045, 90, 91, 'XJAAAA', 'AXIAAA', 'OOOOxx'),
+(8792, 6007, 0, 0, 2, 12, 92, 792, 792, 3792, 8792, 184, 185, 'EAAAAA', 'BXIAAA', 'VVVVxx'),
+(8160, 6008, 0, 0, 0, 0, 60, 160, 160, 3160, 8160, 120, 121, 'WBAAAA', 'CXIAAA', 'AAAAxx'),
+(3061, 6009, 1, 1, 1, 1, 61, 61, 1061, 3061, 3061, 122, 123, 'TNAAAA', 'DXIAAA', 'HHHHxx'),
+(4721, 6010, 1, 1, 1, 1, 21, 721, 721, 4721, 4721, 42, 43, 'PZAAAA', 'EXIAAA', 'OOOOxx'),
+(9817, 6011, 1, 1, 7, 17, 17, 817, 1817, 4817, 9817, 34, 35, 'PNAAAA', 'FXIAAA', 'VVVVxx'),
+(9257, 6012, 1, 1, 7, 17, 57, 257, 1257, 4257, 9257, 114, 115, 'BSAAAA', 'GXIAAA', 'AAAAxx'),
+(7779, 6013, 1, 3, 9, 19, 79, 779, 1779, 2779, 7779, 158, 159, 'FNAAAA', 'HXIAAA', 'HHHHxx'),
+(2663, 6014, 1, 3, 3, 3, 63, 663, 663, 2663, 2663, 126, 127, 'LYAAAA', 'IXIAAA', 'OOOOxx'),
+(3885, 6015, 1, 1, 5, 5, 85, 885, 1885, 3885, 3885, 170, 171, 'LTAAAA', 'JXIAAA', 'VVVVxx'),
+(9469, 6016, 1, 1, 9, 9, 69, 469, 1469, 4469, 9469, 138, 139, 'FAAAAA', 'KXIAAA', 'AAAAxx'),
+(6766, 6017, 0, 2, 6, 6, 66, 766, 766, 1766, 6766, 132, 133, 'GAAAAA', 'LXIAAA', 'HHHHxx'),
+(7173, 6018, 1, 1, 3, 13, 73, 173, 1173, 2173, 7173, 146, 147, 'XPAAAA', 'MXIAAA', 'OOOOxx'),
+(4709, 6019, 1, 1, 9, 9, 9, 709, 709, 4709, 4709, 18, 19, 'DZAAAA', 'NXIAAA', 'VVVVxx'),
+(4210, 6020, 0, 2, 0, 10, 10, 210, 210, 4210, 4210, 20, 21, 'YFAAAA', 'OXIAAA', 'AAAAxx'),
+(3715, 6021, 1, 3, 5, 15, 15, 715, 1715, 3715, 3715, 30, 31, 'XMAAAA', 'PXIAAA', 'HHHHxx'),
+(5089, 6022, 1, 1, 9, 9, 89, 89, 1089, 89, 5089, 178, 179, 'TNAAAA', 'QXIAAA', 'OOOOxx'),
+(1639, 6023, 1, 3, 9, 19, 39, 639, 1639, 1639, 1639, 78, 79, 'BLAAAA', 'RXIAAA', 'VVVVxx'),
+(5757, 6024, 1, 1, 7, 17, 57, 757, 1757, 757, 5757, 114, 115, 'LNAAAA', 'SXIAAA', 'AAAAxx'),
+(3545, 6025, 1, 1, 5, 5, 45, 545, 1545, 3545, 3545, 90, 91, 'JGAAAA', 'TXIAAA', 'HHHHxx'),
+(709, 6026, 1, 1, 9, 9, 9, 709, 709, 709, 709, 18, 19, 'HBAAAA', 'UXIAAA', 'OOOOxx'),
+(6519, 6027, 1, 3, 9, 19, 19, 519, 519, 1519, 6519, 38, 39, 'TQAAAA', 'VXIAAA', 'VVVVxx'),
+(4341, 6028, 1, 1, 1, 1, 41, 341, 341, 4341, 4341, 82, 83, 'ZKAAAA', 'WXIAAA', 'AAAAxx'),
+(2381, 6029, 1, 1, 1, 1, 81, 381, 381, 2381, 2381, 162, 163, 'PNAAAA', 'XXIAAA', 'HHHHxx'),
+(7215, 6030, 1, 3, 5, 15, 15, 215, 1215, 2215, 7215, 30, 31, 'NRAAAA', 'YXIAAA', 'OOOOxx'),
+(9323, 6031, 1, 3, 3, 3, 23, 323, 1323, 4323, 9323, 46, 47, 'PUAAAA', 'ZXIAAA', 'VVVVxx'),
+(3593, 6032, 1, 1, 3, 13, 93, 593, 1593, 3593, 3593, 186, 187, 'FIAAAA', 'AYIAAA', 'AAAAxx'),
+(3123, 6033, 1, 3, 3, 3, 23, 123, 1123, 3123, 3123, 46, 47, 'DQAAAA', 'BYIAAA', 'HHHHxx'),
+(8673, 6034, 1, 1, 3, 13, 73, 673, 673, 3673, 8673, 146, 147, 'PVAAAA', 'CYIAAA', 'OOOOxx'),
+(5094, 6035, 0, 2, 4, 14, 94, 94, 1094, 94, 5094, 188, 189, 'YNAAAA', 'DYIAAA', 'VVVVxx'),
+(6477, 6036, 1, 1, 7, 17, 77, 477, 477, 1477, 6477, 154, 155, 'DPAAAA', 'EYIAAA', 'AAAAxx'),
+(9734, 6037, 0, 2, 4, 14, 34, 734, 1734, 4734, 9734, 68, 69, 'KKAAAA', 'FYIAAA', 'HHHHxx'),
+(2998, 6038, 0, 2, 8, 18, 98, 998, 998, 2998, 2998, 196, 197, 'ILAAAA', 'GYIAAA', 'OOOOxx'),
+(7807, 6039, 1, 3, 7, 7, 7, 807, 1807, 2807, 7807, 14, 15, 'HOAAAA', 'HYIAAA', 'VVVVxx'),
+(5739, 6040, 1, 3, 9, 19, 39, 739, 1739, 739, 5739, 78, 79, 'TMAAAA', 'IYIAAA', 'AAAAxx'),
+(138, 6041, 0, 2, 8, 18, 38, 138, 138, 138, 138, 76, 77, 'IFAAAA', 'JYIAAA', 'HHHHxx'),
+(2403, 6042, 1, 3, 3, 3, 3, 403, 403, 2403, 2403, 6, 7, 'LOAAAA', 'KYIAAA', 'OOOOxx'),
+(2484, 6043, 0, 0, 4, 4, 84, 484, 484, 2484, 2484, 168, 169, 'ORAAAA', 'LYIAAA', 'VVVVxx'),
+(2805, 6044, 1, 1, 5, 5, 5, 805, 805, 2805, 2805, 10, 11, 'XDAAAA', 'MYIAAA', 'AAAAxx'),
+(5189, 6045, 1, 1, 9, 9, 89, 189, 1189, 189, 5189, 178, 179, 'PRAAAA', 'NYIAAA', 'HHHHxx'),
+(8336, 6046, 0, 0, 6, 16, 36, 336, 336, 3336, 8336, 72, 73, 'QIAAAA', 'OYIAAA', 'OOOOxx'),
+(5241, 6047, 1, 1, 1, 1, 41, 241, 1241, 241, 5241, 82, 83, 'PTAAAA', 'PYIAAA', 'VVVVxx'),
+(2612, 6048, 0, 0, 2, 12, 12, 612, 612, 2612, 2612, 24, 25, 'MWAAAA', 'QYIAAA', 'AAAAxx'),
+(2571, 6049, 1, 3, 1, 11, 71, 571, 571, 2571, 2571, 142, 143, 'XUAAAA', 'RYIAAA', 'HHHHxx'),
+(926, 6050, 0, 2, 6, 6, 26, 926, 926, 926, 926, 52, 53, 'QJAAAA', 'SYIAAA', 'OOOOxx'),
+(337, 6051, 1, 1, 7, 17, 37, 337, 337, 337, 337, 74, 75, 'ZMAAAA', 'TYIAAA', 'VVVVxx'),
+(2821, 6052, 1, 1, 1, 1, 21, 821, 821, 2821, 2821, 42, 43, 'NEAAAA', 'UYIAAA', 'AAAAxx'),
+(2658, 6053, 0, 2, 8, 18, 58, 658, 658, 2658, 2658, 116, 117, 'GYAAAA', 'VYIAAA', 'HHHHxx'),
+(9054, 6054, 0, 2, 4, 14, 54, 54, 1054, 4054, 9054, 108, 109, 'GKAAAA', 'WYIAAA', 'OOOOxx'),
+(5492, 6055, 0, 0, 2, 12, 92, 492, 1492, 492, 5492, 184, 185, 'GDAAAA', 'XYIAAA', 'VVVVxx'),
+(7313, 6056, 1, 1, 3, 13, 13, 313, 1313, 2313, 7313, 26, 27, 'HVAAAA', 'YYIAAA', 'AAAAxx'),
+(75, 6057, 1, 3, 5, 15, 75, 75, 75, 75, 75, 150, 151, 'XCAAAA', 'ZYIAAA', 'HHHHxx'),
+(5489, 6058, 1, 1, 9, 9, 89, 489, 1489, 489, 5489, 178, 179, 'DDAAAA', 'AZIAAA', 'OOOOxx'),
+(8413, 6059, 1, 1, 3, 13, 13, 413, 413, 3413, 8413, 26, 27, 'PLAAAA', 'BZIAAA', 'VVVVxx'),
+(3693, 6060, 1, 1, 3, 13, 93, 693, 1693, 3693, 3693, 186, 187, 'BMAAAA', 'CZIAAA', 'AAAAxx'),
+(9820, 6061, 0, 0, 0, 0, 20, 820, 1820, 4820, 9820, 40, 41, 'SNAAAA', 'DZIAAA', 'HHHHxx'),
+(8157, 6062, 1, 1, 7, 17, 57, 157, 157, 3157, 8157, 114, 115, 'TBAAAA', 'EZIAAA', 'OOOOxx'),
+(4161, 6063, 1, 1, 1, 1, 61, 161, 161, 4161, 4161, 122, 123, 'BEAAAA', 'FZIAAA', 'VVVVxx'),
+(8339, 6064, 1, 3, 9, 19, 39, 339, 339, 3339, 8339, 78, 79, 'TIAAAA', 'GZIAAA', 'AAAAxx'),
+(4141, 6065, 1, 1, 1, 1, 41, 141, 141, 4141, 4141, 82, 83, 'HDAAAA', 'HZIAAA', 'HHHHxx'),
+(9001, 6066, 1, 1, 1, 1, 1, 1, 1001, 4001, 9001, 2, 3, 'FIAAAA', 'IZIAAA', 'OOOOxx'),
+(8247, 6067, 1, 3, 7, 7, 47, 247, 247, 3247, 8247, 94, 95, 'FFAAAA', 'JZIAAA', 'VVVVxx'),
+(1182, 6068, 0, 2, 2, 2, 82, 182, 1182, 1182, 1182, 164, 165, 'MTAAAA', 'KZIAAA', 'AAAAxx'),
+(9876, 6069, 0, 0, 6, 16, 76, 876, 1876, 4876, 9876, 152, 153, 'WPAAAA', 'LZIAAA', 'HHHHxx'),
+(4302, 6070, 0, 2, 2, 2, 2, 302, 302, 4302, 4302, 4, 5, 'MJAAAA', 'MZIAAA', 'OOOOxx'),
+(6674, 6071, 0, 2, 4, 14, 74, 674, 674, 1674, 6674, 148, 149, 'SWAAAA', 'NZIAAA', 'VVVVxx'),
+(4214, 6072, 0, 2, 4, 14, 14, 214, 214, 4214, 4214, 28, 29, 'CGAAAA', 'OZIAAA', 'AAAAxx'),
+(5584, 6073, 0, 0, 4, 4, 84, 584, 1584, 584, 5584, 168, 169, 'UGAAAA', 'PZIAAA', 'HHHHxx'),
+(265, 6074, 1, 1, 5, 5, 65, 265, 265, 265, 265, 130, 131, 'FKAAAA', 'QZIAAA', 'OOOOxx'),
+(9207, 6075, 1, 3, 7, 7, 7, 207, 1207, 4207, 9207, 14, 15, 'DQAAAA', 'RZIAAA', 'VVVVxx'),
+(9434, 6076, 0, 2, 4, 14, 34, 434, 1434, 4434, 9434, 68, 69, 'WYAAAA', 'SZIAAA', 'AAAAxx'),
+(2921, 6077, 1, 1, 1, 1, 21, 921, 921, 2921, 2921, 42, 43, 'JIAAAA', 'TZIAAA', 'HHHHxx'),
+(9355, 6078, 1, 3, 5, 15, 55, 355, 1355, 4355, 9355, 110, 111, 'VVAAAA', 'UZIAAA', 'OOOOxx'),
+(8538, 6079, 0, 2, 8, 18, 38, 538, 538, 3538, 8538, 76, 77, 'KQAAAA', 'VZIAAA', 'VVVVxx'),
+(4559, 6080, 1, 3, 9, 19, 59, 559, 559, 4559, 4559, 118, 119, 'JTAAAA', 'WZIAAA', 'AAAAxx'),
+(9175, 6081, 1, 3, 5, 15, 75, 175, 1175, 4175, 9175, 150, 151, 'XOAAAA', 'XZIAAA', 'HHHHxx'),
+(4489, 6082, 1, 1, 9, 9, 89, 489, 489, 4489, 4489, 178, 179, 'RQAAAA', 'YZIAAA', 'OOOOxx'),
+(1485, 6083, 1, 1, 5, 5, 85, 485, 1485, 1485, 1485, 170, 171, 'DFAAAA', 'ZZIAAA', 'VVVVxx'),
+(8853, 6084, 1, 1, 3, 13, 53, 853, 853, 3853, 8853, 106, 107, 'NCAAAA', 'AAJAAA', 'AAAAxx'),
+(9143, 6085, 1, 3, 3, 3, 43, 143, 1143, 4143, 9143, 86, 87, 'RNAAAA', 'BAJAAA', 'HHHHxx'),
+(9551, 6086, 1, 3, 1, 11, 51, 551, 1551, 4551, 9551, 102, 103, 'JDAAAA', 'CAJAAA', 'OOOOxx'),
+(49, 6087, 1, 1, 9, 9, 49, 49, 49, 49, 49, 98, 99, 'XBAAAA', 'DAJAAA', 'VVVVxx'),
+(8351, 6088, 1, 3, 1, 11, 51, 351, 351, 3351, 8351, 102, 103, 'FJAAAA', 'EAJAAA', 'AAAAxx'),
+(9748, 6089, 0, 0, 8, 8, 48, 748, 1748, 4748, 9748, 96, 97, 'YKAAAA', 'FAJAAA', 'HHHHxx'),
+(4536, 6090, 0, 0, 6, 16, 36, 536, 536, 4536, 4536, 72, 73, 'MSAAAA', 'GAJAAA', 'OOOOxx'),
+(930, 6091, 0, 2, 0, 10, 30, 930, 930, 930, 930, 60, 61, 'UJAAAA', 'HAJAAA', 'VVVVxx'),
+(2206, 6092, 0, 2, 6, 6, 6, 206, 206, 2206, 2206, 12, 13, 'WGAAAA', 'IAJAAA', 'AAAAxx'),
+(8004, 6093, 0, 0, 4, 4, 4, 4, 4, 3004, 8004, 8, 9, 'WVAAAA', 'JAJAAA', 'HHHHxx'),
+(219, 6094, 1, 3, 9, 19, 19, 219, 219, 219, 219, 38, 39, 'LIAAAA', 'KAJAAA', 'OOOOxx'),
+(2724, 6095, 0, 0, 4, 4, 24, 724, 724, 2724, 2724, 48, 49, 'UAAAAA', 'LAJAAA', 'VVVVxx'),
+(4868, 6096, 0, 0, 8, 8, 68, 868, 868, 4868, 4868, 136, 137, 'GFAAAA', 'MAJAAA', 'AAAAxx'),
+(5952, 6097, 0, 0, 2, 12, 52, 952, 1952, 952, 5952, 104, 105, 'YUAAAA', 'NAJAAA', 'HHHHxx'),
+(2094, 6098, 0, 2, 4, 14, 94, 94, 94, 2094, 2094, 188, 189, 'OCAAAA', 'OAJAAA', 'OOOOxx'),
+(5707, 6099, 1, 3, 7, 7, 7, 707, 1707, 707, 5707, 14, 15, 'NLAAAA', 'PAJAAA', 'VVVVxx'),
+(5200, 6100, 0, 0, 0, 0, 0, 200, 1200, 200, 5200, 0, 1, 'ASAAAA', 'QAJAAA', 'AAAAxx'),
+(967, 6101, 1, 3, 7, 7, 67, 967, 967, 967, 967, 134, 135, 'FLAAAA', 'RAJAAA', 'HHHHxx'),
+(1982, 6102, 0, 2, 2, 2, 82, 982, 1982, 1982, 1982, 164, 165, 'GYAAAA', 'SAJAAA', 'OOOOxx'),
+(3410, 6103, 0, 2, 0, 10, 10, 410, 1410, 3410, 3410, 20, 21, 'EBAAAA', 'TAJAAA', 'VVVVxx'),
+(174, 6104, 0, 2, 4, 14, 74, 174, 174, 174, 174, 148, 149, 'SGAAAA', 'UAJAAA', 'AAAAxx'),
+(9217, 6105, 1, 1, 7, 17, 17, 217, 1217, 4217, 9217, 34, 35, 'NQAAAA', 'VAJAAA', 'HHHHxx'),
+(9103, 6106, 1, 3, 3, 3, 3, 103, 1103, 4103, 9103, 6, 7, 'DMAAAA', 'WAJAAA', 'OOOOxx'),
+(868, 6107, 0, 0, 8, 8, 68, 868, 868, 868, 868, 136, 137, 'KHAAAA', 'XAJAAA', 'VVVVxx'),
+(8261, 6108, 1, 1, 1, 1, 61, 261, 261, 3261, 8261, 122, 123, 'TFAAAA', 'YAJAAA', 'AAAAxx'),
+(2720, 6109, 0, 0, 0, 0, 20, 720, 720, 2720, 2720, 40, 41, 'QAAAAA', 'ZAJAAA', 'HHHHxx'),
+(2999, 6110, 1, 3, 9, 19, 99, 999, 999, 2999, 2999, 198, 199, 'JLAAAA', 'ABJAAA', 'OOOOxx'),
+(769, 6111, 1, 1, 9, 9, 69, 769, 769, 769, 769, 138, 139, 'PDAAAA', 'BBJAAA', 'VVVVxx'),
+(4533, 6112, 1, 1, 3, 13, 33, 533, 533, 4533, 4533, 66, 67, 'JSAAAA', 'CBJAAA', 'AAAAxx'),
+(2030, 6113, 0, 2, 0, 10, 30, 30, 30, 2030, 2030, 60, 61, 'CAAAAA', 'DBJAAA', 'HHHHxx'),
+(5824, 6114, 0, 0, 4, 4, 24, 824, 1824, 824, 5824, 48, 49, 'AQAAAA', 'EBJAAA', 'OOOOxx'),
+(2328, 6115, 0, 0, 8, 8, 28, 328, 328, 2328, 2328, 56, 57, 'OLAAAA', 'FBJAAA', 'VVVVxx'),
+(9970, 6116, 0, 2, 0, 10, 70, 970, 1970, 4970, 9970, 140, 141, 'MTAAAA', 'GBJAAA', 'AAAAxx'),
+(3192, 6117, 0, 0, 2, 12, 92, 192, 1192, 3192, 3192, 184, 185, 'USAAAA', 'HBJAAA', 'HHHHxx'),
+(3387, 6118, 1, 3, 7, 7, 87, 387, 1387, 3387, 3387, 174, 175, 'HAAAAA', 'IBJAAA', 'OOOOxx'),
+(1936, 6119, 0, 0, 6, 16, 36, 936, 1936, 1936, 1936, 72, 73, 'MWAAAA', 'JBJAAA', 'VVVVxx'),
+(6934, 6120, 0, 2, 4, 14, 34, 934, 934, 1934, 6934, 68, 69, 'SGAAAA', 'KBJAAA', 'AAAAxx'),
+(5615, 6121, 1, 3, 5, 15, 15, 615, 1615, 615, 5615, 30, 31, 'ZHAAAA', 'LBJAAA', 'HHHHxx'),
+(2241, 6122, 1, 1, 1, 1, 41, 241, 241, 2241, 2241, 82, 83, 'FIAAAA', 'MBJAAA', 'OOOOxx'),
+(1842, 6123, 0, 2, 2, 2, 42, 842, 1842, 1842, 1842, 84, 85, 'WSAAAA', 'NBJAAA', 'VVVVxx'),
+(8044, 6124, 0, 0, 4, 4, 44, 44, 44, 3044, 8044, 88, 89, 'KXAAAA', 'OBJAAA', 'AAAAxx'),
+(8902, 6125, 0, 2, 2, 2, 2, 902, 902, 3902, 8902, 4, 5, 'KEAAAA', 'PBJAAA', 'HHHHxx'),
+(4519, 6126, 1, 3, 9, 19, 19, 519, 519, 4519, 4519, 38, 39, 'VRAAAA', 'QBJAAA', 'OOOOxx'),
+(492, 6127, 0, 0, 2, 12, 92, 492, 492, 492, 492, 184, 185, 'YSAAAA', 'RBJAAA', 'VVVVxx'),
+(2694, 6128, 0, 2, 4, 14, 94, 694, 694, 2694, 2694, 188, 189, 'QZAAAA', 'SBJAAA', 'AAAAxx'),
+(5861, 6129, 1, 1, 1, 1, 61, 861, 1861, 861, 5861, 122, 123, 'LRAAAA', 'TBJAAA', 'HHHHxx'),
+(2104, 6130, 0, 0, 4, 4, 4, 104, 104, 2104, 2104, 8, 9, 'YCAAAA', 'UBJAAA', 'OOOOxx'),
+(5376, 6131, 0, 0, 6, 16, 76, 376, 1376, 376, 5376, 152, 153, 'UYAAAA', 'VBJAAA', 'VVVVxx'),
+(3147, 6132, 1, 3, 7, 7, 47, 147, 1147, 3147, 3147, 94, 95, 'BRAAAA', 'WBJAAA', 'AAAAxx'),
+(9880, 6133, 0, 0, 0, 0, 80, 880, 1880, 4880, 9880, 160, 161, 'AQAAAA', 'XBJAAA', 'HHHHxx'),
+(6171, 6134, 1, 3, 1, 11, 71, 171, 171, 1171, 6171, 142, 143, 'JDAAAA', 'YBJAAA', 'OOOOxx'),
+(1850, 6135, 0, 2, 0, 10, 50, 850, 1850, 1850, 1850, 100, 101, 'ETAAAA', 'ZBJAAA', 'VVVVxx'),
+(1775, 6136, 1, 3, 5, 15, 75, 775, 1775, 1775, 1775, 150, 151, 'HQAAAA', 'ACJAAA', 'AAAAxx'),
+(9261, 6137, 1, 1, 1, 1, 61, 261, 1261, 4261, 9261, 122, 123, 'FSAAAA', 'BCJAAA', 'HHHHxx'),
+(9648, 6138, 0, 0, 8, 8, 48, 648, 1648, 4648, 9648, 96, 97, 'CHAAAA', 'CCJAAA', 'OOOOxx'),
+(7846, 6139, 0, 2, 6, 6, 46, 846, 1846, 2846, 7846, 92, 93, 'UPAAAA', 'DCJAAA', 'VVVVxx'),
+(1446, 6140, 0, 2, 6, 6, 46, 446, 1446, 1446, 1446, 92, 93, 'QDAAAA', 'ECJAAA', 'AAAAxx'),
+(3139, 6141, 1, 3, 9, 19, 39, 139, 1139, 3139, 3139, 78, 79, 'TQAAAA', 'FCJAAA', 'HHHHxx'),
+(6142, 6142, 0, 2, 2, 2, 42, 142, 142, 1142, 6142, 84, 85, 'GCAAAA', 'GCJAAA', 'OOOOxx'),
+(5812, 6143, 0, 0, 2, 12, 12, 812, 1812, 812, 5812, 24, 25, 'OPAAAA', 'HCJAAA', 'VVVVxx'),
+(6728, 6144, 0, 0, 8, 8, 28, 728, 728, 1728, 6728, 56, 57, 'UYAAAA', 'ICJAAA', 'AAAAxx'),
+(4428, 6145, 0, 0, 8, 8, 28, 428, 428, 4428, 4428, 56, 57, 'IOAAAA', 'JCJAAA', 'HHHHxx'),
+(502, 6146, 0, 2, 2, 2, 2, 502, 502, 502, 502, 4, 5, 'ITAAAA', 'KCJAAA', 'OOOOxx'),
+(2363, 6147, 1, 3, 3, 3, 63, 363, 363, 2363, 2363, 126, 127, 'XMAAAA', 'LCJAAA', 'VVVVxx'),
+(3808, 6148, 0, 0, 8, 8, 8, 808, 1808, 3808, 3808, 16, 17, 'MQAAAA', 'MCJAAA', 'AAAAxx'),
+(1010, 6149, 0, 2, 0, 10, 10, 10, 1010, 1010, 1010, 20, 21, 'WMAAAA', 'NCJAAA', 'HHHHxx'),
+(9565, 6150, 1, 1, 5, 5, 65, 565, 1565, 4565, 9565, 130, 131, 'XDAAAA', 'OCJAAA', 'OOOOxx'),
+(1587, 6151, 1, 3, 7, 7, 87, 587, 1587, 1587, 1587, 174, 175, 'BJAAAA', 'PCJAAA', 'VVVVxx'),
+(1474, 6152, 0, 2, 4, 14, 74, 474, 1474, 1474, 1474, 148, 149, 'SEAAAA', 'QCJAAA', 'AAAAxx'),
+(6215, 6153, 1, 3, 5, 15, 15, 215, 215, 1215, 6215, 30, 31, 'BFAAAA', 'RCJAAA', 'HHHHxx'),
+(2395, 6154, 1, 3, 5, 15, 95, 395, 395, 2395, 2395, 190, 191, 'DOAAAA', 'SCJAAA', 'OOOOxx'),
+(8753, 6155, 1, 1, 3, 13, 53, 753, 753, 3753, 8753, 106, 107, 'RYAAAA', 'TCJAAA', 'VVVVxx'),
+(2446, 6156, 0, 2, 6, 6, 46, 446, 446, 2446, 2446, 92, 93, 'CQAAAA', 'UCJAAA', 'AAAAxx'),
+(60, 6157, 0, 0, 0, 0, 60, 60, 60, 60, 60, 120, 121, 'ICAAAA', 'VCJAAA', 'HHHHxx'),
+(982, 6158, 0, 2, 2, 2, 82, 982, 982, 982, 982, 164, 165, 'ULAAAA', 'WCJAAA', 'OOOOxx'),
+(6489, 6159, 1, 1, 9, 9, 89, 489, 489, 1489, 6489, 178, 179, 'PPAAAA', 'XCJAAA', 'VVVVxx'),
+(5334, 6160, 0, 2, 4, 14, 34, 334, 1334, 334, 5334, 68, 69, 'EXAAAA', 'YCJAAA', 'AAAAxx'),
+(8540, 6161, 0, 0, 0, 0, 40, 540, 540, 3540, 8540, 80, 81, 'MQAAAA', 'ZCJAAA', 'HHHHxx'),
+(490, 6162, 0, 2, 0, 10, 90, 490, 490, 490, 490, 180, 181, 'WSAAAA', 'ADJAAA', 'OOOOxx'),
+(6763, 6163, 1, 3, 3, 3, 63, 763, 763, 1763, 6763, 126, 127, 'DAAAAA', 'BDJAAA', 'VVVVxx'),
+(8273, 6164, 1, 1, 3, 13, 73, 273, 273, 3273, 8273, 146, 147, 'FGAAAA', 'CDJAAA', 'AAAAxx'),
+(8327, 6165, 1, 3, 7, 7, 27, 327, 327, 3327, 8327, 54, 55, 'HIAAAA', 'DDJAAA', 'HHHHxx'),
+(8541, 6166, 1, 1, 1, 1, 41, 541, 541, 3541, 8541, 82, 83, 'NQAAAA', 'EDJAAA', 'OOOOxx'),
+(3459, 6167, 1, 3, 9, 19, 59, 459, 1459, 3459, 3459, 118, 119, 'BDAAAA', 'FDJAAA', 'VVVVxx'),
+(5557, 6168, 1, 1, 7, 17, 57, 557, 1557, 557, 5557, 114, 115, 'TFAAAA', 'GDJAAA', 'AAAAxx'),
+(158, 6169, 0, 2, 8, 18, 58, 158, 158, 158, 158, 116, 117, 'CGAAAA', 'HDJAAA', 'HHHHxx'),
+(1741, 6170, 1, 1, 1, 1, 41, 741, 1741, 1741, 1741, 82, 83, 'ZOAAAA', 'IDJAAA', 'OOOOxx'),
+(8385, 6171, 1, 1, 5, 5, 85, 385, 385, 3385, 8385, 170, 171, 'NKAAAA', 'JDJAAA', 'VVVVxx'),
+(617, 6172, 1, 1, 7, 17, 17, 617, 617, 617, 617, 34, 35, 'TXAAAA', 'KDJAAA', 'AAAAxx'),
+(3560, 6173, 0, 0, 0, 0, 60, 560, 1560, 3560, 3560, 120, 121, 'YGAAAA', 'LDJAAA', 'HHHHxx'),
+(5216, 6174, 0, 0, 6, 16, 16, 216, 1216, 216, 5216, 32, 33, 'QSAAAA', 'MDJAAA', 'OOOOxx'),
+(8443, 6175, 1, 3, 3, 3, 43, 443, 443, 3443, 8443, 86, 87, 'TMAAAA', 'NDJAAA', 'VVVVxx'),
+(2700, 6176, 0, 0, 0, 0, 0, 700, 700, 2700, 2700, 0, 1, 'WZAAAA', 'ODJAAA', 'AAAAxx'),
+(3661, 6177, 1, 1, 1, 1, 61, 661, 1661, 3661, 3661, 122, 123, 'VKAAAA', 'PDJAAA', 'HHHHxx'),
+(4875, 6178, 1, 3, 5, 15, 75, 875, 875, 4875, 4875, 150, 151, 'NFAAAA', 'QDJAAA', 'OOOOxx'),
+(6721, 6179, 1, 1, 1, 1, 21, 721, 721, 1721, 6721, 42, 43, 'NYAAAA', 'RDJAAA', 'VVVVxx'),
+(3659, 6180, 1, 3, 9, 19, 59, 659, 1659, 3659, 3659, 118, 119, 'TKAAAA', 'SDJAAA', 'AAAAxx'),
+(8944, 6181, 0, 0, 4, 4, 44, 944, 944, 3944, 8944, 88, 89, 'AGAAAA', 'TDJAAA', 'HHHHxx'),
+(9133, 6182, 1, 1, 3, 13, 33, 133, 1133, 4133, 9133, 66, 67, 'HNAAAA', 'UDJAAA', 'OOOOxx'),
+(9882, 6183, 0, 2, 2, 2, 82, 882, 1882, 4882, 9882, 164, 165, 'CQAAAA', 'VDJAAA', 'VVVVxx'),
+(2102, 6184, 0, 2, 2, 2, 2, 102, 102, 2102, 2102, 4, 5, 'WCAAAA', 'WDJAAA', 'AAAAxx'),
+(9445, 6185, 1, 1, 5, 5, 45, 445, 1445, 4445, 9445, 90, 91, 'HZAAAA', 'XDJAAA', 'HHHHxx'),
+(5559, 6186, 1, 3, 9, 19, 59, 559, 1559, 559, 5559, 118, 119, 'VFAAAA', 'YDJAAA', 'OOOOxx'),
+(6096, 6187, 0, 0, 6, 16, 96, 96, 96, 1096, 6096, 192, 193, 'MAAAAA', 'ZDJAAA', 'VVVVxx'),
+(9336, 6188, 0, 0, 6, 16, 36, 336, 1336, 4336, 9336, 72, 73, 'CVAAAA', 'AEJAAA', 'AAAAxx'),
+(2162, 6189, 0, 2, 2, 2, 62, 162, 162, 2162, 2162, 124, 125, 'EFAAAA', 'BEJAAA', 'HHHHxx'),
+(7459, 6190, 1, 3, 9, 19, 59, 459, 1459, 2459, 7459, 118, 119, 'XAAAAA', 'CEJAAA', 'OOOOxx'),
+(3248, 6191, 0, 0, 8, 8, 48, 248, 1248, 3248, 3248, 96, 97, 'YUAAAA', 'DEJAAA', 'VVVVxx'),
+(9539, 6192, 1, 3, 9, 19, 39, 539, 1539, 4539, 9539, 78, 79, 'XCAAAA', 'EEJAAA', 'AAAAxx'),
+(4449, 6193, 1, 1, 9, 9, 49, 449, 449, 4449, 4449, 98, 99, 'DPAAAA', 'FEJAAA', 'HHHHxx'),
+(2809, 6194, 1, 1, 9, 9, 9, 809, 809, 2809, 2809, 18, 19, 'BEAAAA', 'GEJAAA', 'OOOOxx'),
+(7058, 6195, 0, 2, 8, 18, 58, 58, 1058, 2058, 7058, 116, 117, 'MLAAAA', 'HEJAAA', 'VVVVxx'),
+(3512, 6196, 0, 0, 2, 12, 12, 512, 1512, 3512, 3512, 24, 25, 'CFAAAA', 'IEJAAA', 'AAAAxx'),
+(2802, 6197, 0, 2, 2, 2, 2, 802, 802, 2802, 2802, 4, 5, 'UDAAAA', 'JEJAAA', 'HHHHxx'),
+(6289, 6198, 1, 1, 9, 9, 89, 289, 289, 1289, 6289, 178, 179, 'XHAAAA', 'KEJAAA', 'OOOOxx'),
+(1947, 6199, 1, 3, 7, 7, 47, 947, 1947, 1947, 1947, 94, 95, 'XWAAAA', 'LEJAAA', 'VVVVxx'),
+(9572, 6200, 0, 0, 2, 12, 72, 572, 1572, 4572, 9572, 144, 145, 'EEAAAA', 'MEJAAA', 'AAAAxx'),
+(2356, 6201, 0, 0, 6, 16, 56, 356, 356, 2356, 2356, 112, 113, 'QMAAAA', 'NEJAAA', 'HHHHxx'),
+(3039, 6202, 1, 3, 9, 19, 39, 39, 1039, 3039, 3039, 78, 79, 'XMAAAA', 'OEJAAA', 'OOOOxx'),
+(9452, 6203, 0, 0, 2, 12, 52, 452, 1452, 4452, 9452, 104, 105, 'OZAAAA', 'PEJAAA', 'VVVVxx'),
+(6328, 6204, 0, 0, 8, 8, 28, 328, 328, 1328, 6328, 56, 57, 'KJAAAA', 'QEJAAA', 'AAAAxx'),
+(7661, 6205, 1, 1, 1, 1, 61, 661, 1661, 2661, 7661, 122, 123, 'RIAAAA', 'REJAAA', 'HHHHxx'),
+(2566, 6206, 0, 2, 6, 6, 66, 566, 566, 2566, 2566, 132, 133, 'SUAAAA', 'SEJAAA', 'OOOOxx'),
+(6095, 6207, 1, 3, 5, 15, 95, 95, 95, 1095, 6095, 190, 191, 'LAAAAA', 'TEJAAA', 'VVVVxx'),
+(6367, 6208, 1, 3, 7, 7, 67, 367, 367, 1367, 6367, 134, 135, 'XKAAAA', 'UEJAAA', 'AAAAxx'),
+(3368, 6209, 0, 0, 8, 8, 68, 368, 1368, 3368, 3368, 136, 137, 'OZAAAA', 'VEJAAA', 'HHHHxx'),
+(5567, 6210, 1, 3, 7, 7, 67, 567, 1567, 567, 5567, 134, 135, 'DGAAAA', 'WEJAAA', 'OOOOxx'),
+(9834, 6211, 0, 2, 4, 14, 34, 834, 1834, 4834, 9834, 68, 69, 'GOAAAA', 'XEJAAA', 'VVVVxx'),
+(9695, 6212, 1, 3, 5, 15, 95, 695, 1695, 4695, 9695, 190, 191, 'XIAAAA', 'YEJAAA', 'AAAAxx'),
+(7291, 6213, 1, 3, 1, 11, 91, 291, 1291, 2291, 7291, 182, 183, 'LUAAAA', 'ZEJAAA', 'HHHHxx'),
+(4806, 6214, 0, 2, 6, 6, 6, 806, 806, 4806, 4806, 12, 13, 'WCAAAA', 'AFJAAA', 'OOOOxx'),
+(2000, 6215, 0, 0, 0, 0, 0, 0, 0, 2000, 2000, 0, 1, 'YYAAAA', 'BFJAAA', 'VVVVxx'),
+(6817, 6216, 1, 1, 7, 17, 17, 817, 817, 1817, 6817, 34, 35, 'FCAAAA', 'CFJAAA', 'AAAAxx'),
+(8487, 6217, 1, 3, 7, 7, 87, 487, 487, 3487, 8487, 174, 175, 'LOAAAA', 'DFJAAA', 'HHHHxx'),
+(3245, 6218, 1, 1, 5, 5, 45, 245, 1245, 3245, 3245, 90, 91, 'VUAAAA', 'EFJAAA', 'OOOOxx'),
+(632, 6219, 0, 0, 2, 12, 32, 632, 632, 632, 632, 64, 65, 'IYAAAA', 'FFJAAA', 'VVVVxx'),
+(8067, 6220, 1, 3, 7, 7, 67, 67, 67, 3067, 8067, 134, 135, 'HYAAAA', 'GFJAAA', 'AAAAxx'),
+(7140, 6221, 0, 0, 0, 0, 40, 140, 1140, 2140, 7140, 80, 81, 'QOAAAA', 'HFJAAA', 'HHHHxx'),
+(6802, 6222, 0, 2, 2, 2, 2, 802, 802, 1802, 6802, 4, 5, 'QBAAAA', 'IFJAAA', 'OOOOxx'),
+(3980, 6223, 0, 0, 0, 0, 80, 980, 1980, 3980, 3980, 160, 161, 'CXAAAA', 'JFJAAA', 'VVVVxx'),
+(1321, 6224, 1, 1, 1, 1, 21, 321, 1321, 1321, 1321, 42, 43, 'VYAAAA', 'KFJAAA', 'AAAAxx'),
+(2273, 6225, 1, 1, 3, 13, 73, 273, 273, 2273, 2273, 146, 147, 'LJAAAA', 'LFJAAA', 'HHHHxx'),
+(6787, 6226, 1, 3, 7, 7, 87, 787, 787, 1787, 6787, 174, 175, 'BBAAAA', 'MFJAAA', 'OOOOxx'),
+(9480, 6227, 0, 0, 0, 0, 80, 480, 1480, 4480, 9480, 160, 161, 'QAAAAA', 'NFJAAA', 'VVVVxx'),
+(9404, 6228, 0, 0, 4, 4, 4, 404, 1404, 4404, 9404, 8, 9, 'SXAAAA', 'OFJAAA', 'AAAAxx'),
+(3914, 6229, 0, 2, 4, 14, 14, 914, 1914, 3914, 3914, 28, 29, 'OUAAAA', 'PFJAAA', 'HHHHxx'),
+(5507, 6230, 1, 3, 7, 7, 7, 507, 1507, 507, 5507, 14, 15, 'VDAAAA', 'QFJAAA', 'OOOOxx'),
+(1813, 6231, 1, 1, 3, 13, 13, 813, 1813, 1813, 1813, 26, 27, 'TRAAAA', 'RFJAAA', 'VVVVxx'),
+(1999, 6232, 1, 3, 9, 19, 99, 999, 1999, 1999, 1999, 198, 199, 'XYAAAA', 'SFJAAA', 'AAAAxx'),
+(3848, 6233, 0, 0, 8, 8, 48, 848, 1848, 3848, 3848, 96, 97, 'ASAAAA', 'TFJAAA', 'HHHHxx'),
+(9693, 6234, 1, 1, 3, 13, 93, 693, 1693, 4693, 9693, 186, 187, 'VIAAAA', 'UFJAAA', 'OOOOxx'),
+(1353, 6235, 1, 1, 3, 13, 53, 353, 1353, 1353, 1353, 106, 107, 'BAAAAA', 'VFJAAA', 'VVVVxx'),
+(7218, 6236, 0, 2, 8, 18, 18, 218, 1218, 2218, 7218, 36, 37, 'QRAAAA', 'WFJAAA', 'AAAAxx'),
+(8223, 6237, 1, 3, 3, 3, 23, 223, 223, 3223, 8223, 46, 47, 'HEAAAA', 'XFJAAA', 'HHHHxx'),
+(9982, 6238, 0, 2, 2, 2, 82, 982, 1982, 4982, 9982, 164, 165, 'YTAAAA', 'YFJAAA', 'OOOOxx'),
+(8799, 6239, 1, 3, 9, 19, 99, 799, 799, 3799, 8799, 198, 199, 'LAAAAA', 'ZFJAAA', 'VVVVxx'),
+(8929, 6240, 1, 1, 9, 9, 29, 929, 929, 3929, 8929, 58, 59, 'LFAAAA', 'AGJAAA', 'AAAAxx'),
+(4626, 6241, 0, 2, 6, 6, 26, 626, 626, 4626, 4626, 52, 53, 'YVAAAA', 'BGJAAA', 'HHHHxx'),
+(7958, 6242, 0, 2, 8, 18, 58, 958, 1958, 2958, 7958, 116, 117, 'CUAAAA', 'CGJAAA', 'OOOOxx'),
+(3743, 6243, 1, 3, 3, 3, 43, 743, 1743, 3743, 3743, 86, 87, 'ZNAAAA', 'DGJAAA', 'VVVVxx'),
+(8165, 6244, 1, 1, 5, 5, 65, 165, 165, 3165, 8165, 130, 131, 'BCAAAA', 'EGJAAA', 'AAAAxx'),
+(7899, 6245, 1, 3, 9, 19, 99, 899, 1899, 2899, 7899, 198, 199, 'VRAAAA', 'FGJAAA', 'HHHHxx'),
+(8698, 6246, 0, 2, 8, 18, 98, 698, 698, 3698, 8698, 196, 197, 'OWAAAA', 'GGJAAA', 'OOOOxx'),
+(9270, 6247, 0, 2, 0, 10, 70, 270, 1270, 4270, 9270, 140, 141, 'OSAAAA', 'HGJAAA', 'VVVVxx'),
+(6348, 6248, 0, 0, 8, 8, 48, 348, 348, 1348, 6348, 96, 97, 'EKAAAA', 'IGJAAA', 'AAAAxx'),
+(6999, 6249, 1, 3, 9, 19, 99, 999, 999, 1999, 6999, 198, 199, 'FJAAAA', 'JGJAAA', 'HHHHxx'),
+(8467, 6250, 1, 3, 7, 7, 67, 467, 467, 3467, 8467, 134, 135, 'RNAAAA', 'KGJAAA', 'OOOOxx'),
+(3907, 6251, 1, 3, 7, 7, 7, 907, 1907, 3907, 3907, 14, 15, 'HUAAAA', 'LGJAAA', 'VVVVxx'),
+(4738, 6252, 0, 2, 8, 18, 38, 738, 738, 4738, 4738, 76, 77, 'GAAAAA', 'MGJAAA', 'AAAAxx'),
+(248, 6253, 0, 0, 8, 8, 48, 248, 248, 248, 248, 96, 97, 'OJAAAA', 'NGJAAA', 'HHHHxx'),
+(8769, 6254, 1, 1, 9, 9, 69, 769, 769, 3769, 8769, 138, 139, 'HZAAAA', 'OGJAAA', 'OOOOxx'),
+(9922, 6255, 0, 2, 2, 2, 22, 922, 1922, 4922, 9922, 44, 45, 'QRAAAA', 'PGJAAA', 'VVVVxx'),
+(778, 6256, 0, 2, 8, 18, 78, 778, 778, 778, 778, 156, 157, 'YDAAAA', 'QGJAAA', 'AAAAxx'),
+(1233, 6257, 1, 1, 3, 13, 33, 233, 1233, 1233, 1233, 66, 67, 'LVAAAA', 'RGJAAA', 'HHHHxx'),
+(1183, 6258, 1, 3, 3, 3, 83, 183, 1183, 1183, 1183, 166, 167, 'NTAAAA', 'SGJAAA', 'OOOOxx'),
+(2838, 6259, 0, 2, 8, 18, 38, 838, 838, 2838, 2838, 76, 77, 'EFAAAA', 'TGJAAA', 'VVVVxx'),
+(3096, 6260, 0, 0, 6, 16, 96, 96, 1096, 3096, 3096, 192, 193, 'CPAAAA', 'UGJAAA', 'AAAAxx'),
+(8566, 6261, 0, 2, 6, 6, 66, 566, 566, 3566, 8566, 132, 133, 'MRAAAA', 'VGJAAA', 'HHHHxx'),
+(7635, 6262, 1, 3, 5, 15, 35, 635, 1635, 2635, 7635, 70, 71, 'RHAAAA', 'WGJAAA', 'OOOOxx'),
+(5428, 6263, 0, 0, 8, 8, 28, 428, 1428, 428, 5428, 56, 57, 'UAAAAA', 'XGJAAA', 'VVVVxx'),
+(7430, 6264, 0, 2, 0, 10, 30, 430, 1430, 2430, 7430, 60, 61, 'UZAAAA', 'YGJAAA', 'AAAAxx'),
+(7210, 6265, 0, 2, 0, 10, 10, 210, 1210, 2210, 7210, 20, 21, 'IRAAAA', 'ZGJAAA', 'HHHHxx'),
+(4485, 6266, 1, 1, 5, 5, 85, 485, 485, 4485, 4485, 170, 171, 'NQAAAA', 'AHJAAA', 'OOOOxx'),
+(9623, 6267, 1, 3, 3, 3, 23, 623, 1623, 4623, 9623, 46, 47, 'DGAAAA', 'BHJAAA', 'VVVVxx'),
+(3670, 6268, 0, 2, 0, 10, 70, 670, 1670, 3670, 3670, 140, 141, 'ELAAAA', 'CHJAAA', 'AAAAxx'),
+(1575, 6269, 1, 3, 5, 15, 75, 575, 1575, 1575, 1575, 150, 151, 'PIAAAA', 'DHJAAA', 'HHHHxx'),
+(5874, 6270, 0, 2, 4, 14, 74, 874, 1874, 874, 5874, 148, 149, 'YRAAAA', 'EHJAAA', 'OOOOxx'),
+(673, 6271, 1, 1, 3, 13, 73, 673, 673, 673, 673, 146, 147, 'XZAAAA', 'FHJAAA', 'VVVVxx'),
+(9712, 6272, 0, 0, 2, 12, 12, 712, 1712, 4712, 9712, 24, 25, 'OJAAAA', 'GHJAAA', 'AAAAxx'),
+(7729, 6273, 1, 1, 9, 9, 29, 729, 1729, 2729, 7729, 58, 59, 'HLAAAA', 'HHJAAA', 'HHHHxx'),
+(4318, 6274, 0, 2, 8, 18, 18, 318, 318, 4318, 4318, 36, 37, 'CKAAAA', 'IHJAAA', 'OOOOxx'),
+(4143, 6275, 1, 3, 3, 3, 43, 143, 143, 4143, 4143, 86, 87, 'JDAAAA', 'JHJAAA', 'VVVVxx'),
+(4932, 6276, 0, 0, 2, 12, 32, 932, 932, 4932, 4932, 64, 65, 'SHAAAA', 'KHJAAA', 'AAAAxx'),
+(5835, 6277, 1, 3, 5, 15, 35, 835, 1835, 835, 5835, 70, 71, 'LQAAAA', 'LHJAAA', 'HHHHxx'),
+(4966, 6278, 0, 2, 6, 6, 66, 966, 966, 4966, 4966, 132, 133, 'AJAAAA', 'MHJAAA', 'OOOOxx'),
+(6711, 6279, 1, 3, 1, 11, 11, 711, 711, 1711, 6711, 22, 23, 'DYAAAA', 'NHJAAA', 'VVVVxx'),
+(3990, 6280, 0, 2, 0, 10, 90, 990, 1990, 3990, 3990, 180, 181, 'MXAAAA', 'OHJAAA', 'AAAAxx'),
+(990, 6281, 0, 2, 0, 10, 90, 990, 990, 990, 990, 180, 181, 'CMAAAA', 'PHJAAA', 'HHHHxx'),
+(220, 6282, 0, 0, 0, 0, 20, 220, 220, 220, 220, 40, 41, 'MIAAAA', 'QHJAAA', 'OOOOxx'),
+(5693, 6283, 1, 1, 3, 13, 93, 693, 1693, 693, 5693, 186, 187, 'ZKAAAA', 'RHJAAA', 'VVVVxx'),
+(3662, 6284, 0, 2, 2, 2, 62, 662, 1662, 3662, 3662, 124, 125, 'WKAAAA', 'SHJAAA', 'AAAAxx'),
+(7844, 6285, 0, 0, 4, 4, 44, 844, 1844, 2844, 7844, 88, 89, 'SPAAAA', 'THJAAA', 'HHHHxx'),
+(5515, 6286, 1, 3, 5, 15, 15, 515, 1515, 515, 5515, 30, 31, 'DEAAAA', 'UHJAAA', 'OOOOxx'),
+(5551, 6287, 1, 3, 1, 11, 51, 551, 1551, 551, 5551, 102, 103, 'NFAAAA', 'VHJAAA', 'VVVVxx'),
+(2358, 6288, 0, 2, 8, 18, 58, 358, 358, 2358, 2358, 116, 117, 'SMAAAA', 'WHJAAA', 'AAAAxx'),
+(8977, 6289, 1, 1, 7, 17, 77, 977, 977, 3977, 8977, 154, 155, 'HHAAAA', 'XHJAAA', 'HHHHxx'),
+(7040, 6290, 0, 0, 0, 0, 40, 40, 1040, 2040, 7040, 80, 81, 'UKAAAA', 'YHJAAA', 'OOOOxx'),
+(105, 6291, 1, 1, 5, 5, 5, 105, 105, 105, 105, 10, 11, 'BEAAAA', 'ZHJAAA', 'VVVVxx'),
+(4496, 6292, 0, 0, 6, 16, 96, 496, 496, 4496, 4496, 192, 193, 'YQAAAA', 'AIJAAA', 'AAAAxx'),
+(2254, 6293, 0, 2, 4, 14, 54, 254, 254, 2254, 2254, 108, 109, 'SIAAAA', 'BIJAAA', 'HHHHxx'),
+(411, 6294, 1, 3, 1, 11, 11, 411, 411, 411, 411, 22, 23, 'VPAAAA', 'CIJAAA', 'OOOOxx'),
+(2373, 6295, 1, 1, 3, 13, 73, 373, 373, 2373, 2373, 146, 147, 'HNAAAA', 'DIJAAA', 'VVVVxx'),
+(3477, 6296, 1, 1, 7, 17, 77, 477, 1477, 3477, 3477, 154, 155, 'TDAAAA', 'EIJAAA', 'AAAAxx'),
+(8964, 6297, 0, 0, 4, 4, 64, 964, 964, 3964, 8964, 128, 129, 'UGAAAA', 'FIJAAA', 'HHHHxx'),
+(8471, 6298, 1, 3, 1, 11, 71, 471, 471, 3471, 8471, 142, 143, 'VNAAAA', 'GIJAAA', 'OOOOxx'),
+(5776, 6299, 0, 0, 6, 16, 76, 776, 1776, 776, 5776, 152, 153, 'EOAAAA', 'HIJAAA', 'VVVVxx'),
+(9921, 6300, 1, 1, 1, 1, 21, 921, 1921, 4921, 9921, 42, 43, 'PRAAAA', 'IIJAAA', 'AAAAxx'),
+(7816, 6301, 0, 0, 6, 16, 16, 816, 1816, 2816, 7816, 32, 33, 'QOAAAA', 'JIJAAA', 'HHHHxx'),
+(2439, 6302, 1, 3, 9, 19, 39, 439, 439, 2439, 2439, 78, 79, 'VPAAAA', 'KIJAAA', 'OOOOxx'),
+(9298, 6303, 0, 2, 8, 18, 98, 298, 1298, 4298, 9298, 196, 197, 'QTAAAA', 'LIJAAA', 'VVVVxx'),
+(9424, 6304, 0, 0, 4, 4, 24, 424, 1424, 4424, 9424, 48, 49, 'MYAAAA', 'MIJAAA', 'AAAAxx'),
+(3252, 6305, 0, 0, 2, 12, 52, 252, 1252, 3252, 3252, 104, 105, 'CVAAAA', 'NIJAAA', 'HHHHxx'),
+(1401, 6306, 1, 1, 1, 1, 1, 401, 1401, 1401, 1401, 2, 3, 'XBAAAA', 'OIJAAA', 'OOOOxx'),
+(9632, 6307, 0, 0, 2, 12, 32, 632, 1632, 4632, 9632, 64, 65, 'MGAAAA', 'PIJAAA', 'VVVVxx'),
+(370, 6308, 0, 2, 0, 10, 70, 370, 370, 370, 370, 140, 141, 'GOAAAA', 'QIJAAA', 'AAAAxx'),
+(728, 6309, 0, 0, 8, 8, 28, 728, 728, 728, 728, 56, 57, 'ACAAAA', 'RIJAAA', 'HHHHxx'),
+(2888, 6310, 0, 0, 8, 8, 88, 888, 888, 2888, 2888, 176, 177, 'CHAAAA', 'SIJAAA', 'OOOOxx'),
+(1441, 6311, 1, 1, 1, 1, 41, 441, 1441, 1441, 1441, 82, 83, 'LDAAAA', 'TIJAAA', 'VVVVxx'),
+(8308, 6312, 0, 0, 8, 8, 8, 308, 308, 3308, 8308, 16, 17, 'OHAAAA', 'UIJAAA', 'AAAAxx'),
+(2165, 6313, 1, 1, 5, 5, 65, 165, 165, 2165, 2165, 130, 131, 'HFAAAA', 'VIJAAA', 'HHHHxx'),
+(6359, 6314, 1, 3, 9, 19, 59, 359, 359, 1359, 6359, 118, 119, 'PKAAAA', 'WIJAAA', 'OOOOxx'),
+(9637, 6315, 1, 1, 7, 17, 37, 637, 1637, 4637, 9637, 74, 75, 'RGAAAA', 'XIJAAA', 'VVVVxx'),
+(5208, 6316, 0, 0, 8, 8, 8, 208, 1208, 208, 5208, 16, 17, 'ISAAAA', 'YIJAAA', 'AAAAxx'),
+(4705, 6317, 1, 1, 5, 5, 5, 705, 705, 4705, 4705, 10, 11, 'ZYAAAA', 'ZIJAAA', 'HHHHxx'),
+(2341, 6318, 1, 1, 1, 1, 41, 341, 341, 2341, 2341, 82, 83, 'BMAAAA', 'AJJAAA', 'OOOOxx'),
+(8539, 6319, 1, 3, 9, 19, 39, 539, 539, 3539, 8539, 78, 79, 'LQAAAA', 'BJJAAA', 'VVVVxx'),
+(7528, 6320, 0, 0, 8, 8, 28, 528, 1528, 2528, 7528, 56, 57, 'ODAAAA', 'CJJAAA', 'AAAAxx'),
+(7969, 6321, 1, 1, 9, 9, 69, 969, 1969, 2969, 7969, 138, 139, 'NUAAAA', 'DJJAAA', 'HHHHxx'),
+(6381, 6322, 1, 1, 1, 1, 81, 381, 381, 1381, 6381, 162, 163, 'LLAAAA', 'EJJAAA', 'OOOOxx'),
+(4906, 6323, 0, 2, 6, 6, 6, 906, 906, 4906, 4906, 12, 13, 'SGAAAA', 'FJJAAA', 'VVVVxx'),
+(8697, 6324, 1, 1, 7, 17, 97, 697, 697, 3697, 8697, 194, 195, 'NWAAAA', 'GJJAAA', 'AAAAxx'),
+(6301, 6325, 1, 1, 1, 1, 1, 301, 301, 1301, 6301, 2, 3, 'JIAAAA', 'HJJAAA', 'HHHHxx'),
+(7554, 6326, 0, 2, 4, 14, 54, 554, 1554, 2554, 7554, 108, 109, 'OEAAAA', 'IJJAAA', 'OOOOxx'),
+(5107, 6327, 1, 3, 7, 7, 7, 107, 1107, 107, 5107, 14, 15, 'LOAAAA', 'JJJAAA', 'VVVVxx'),
+(5046, 6328, 0, 2, 6, 6, 46, 46, 1046, 46, 5046, 92, 93, 'CMAAAA', 'KJJAAA', 'AAAAxx'),
+(4063, 6329, 1, 3, 3, 3, 63, 63, 63, 4063, 4063, 126, 127, 'HAAAAA', 'LJJAAA', 'HHHHxx'),
+(7580, 6330, 0, 0, 0, 0, 80, 580, 1580, 2580, 7580, 160, 161, 'OFAAAA', 'MJJAAA', 'OOOOxx'),
+(2245, 6331, 1, 1, 5, 5, 45, 245, 245, 2245, 2245, 90, 91, 'JIAAAA', 'NJJAAA', 'VVVVxx'),
+(3711, 6332, 1, 3, 1, 11, 11, 711, 1711, 3711, 3711, 22, 23, 'TMAAAA', 'OJJAAA', 'AAAAxx'),
+(3220, 6333, 0, 0, 0, 0, 20, 220, 1220, 3220, 3220, 40, 41, 'WTAAAA', 'PJJAAA', 'HHHHxx'),
+(6463, 6334, 1, 3, 3, 3, 63, 463, 463, 1463, 6463, 126, 127, 'POAAAA', 'QJJAAA', 'OOOOxx'),
+(8196, 6335, 0, 0, 6, 16, 96, 196, 196, 3196, 8196, 192, 193, 'GDAAAA', 'RJJAAA', 'VVVVxx'),
+(9875, 6336, 1, 3, 5, 15, 75, 875, 1875, 4875, 9875, 150, 151, 'VPAAAA', 'SJJAAA', 'AAAAxx'),
+(1333, 6337, 1, 1, 3, 13, 33, 333, 1333, 1333, 1333, 66, 67, 'HZAAAA', 'TJJAAA', 'HHHHxx'),
+(7880, 6338, 0, 0, 0, 0, 80, 880, 1880, 2880, 7880, 160, 161, 'CRAAAA', 'UJJAAA', 'OOOOxx'),
+(2322, 6339, 0, 2, 2, 2, 22, 322, 322, 2322, 2322, 44, 45, 'ILAAAA', 'VJJAAA', 'VVVVxx'),
+(2163, 6340, 1, 3, 3, 3, 63, 163, 163, 2163, 2163, 126, 127, 'FFAAAA', 'WJJAAA', 'AAAAxx'),
+(421, 6341, 1, 1, 1, 1, 21, 421, 421, 421, 421, 42, 43, 'FQAAAA', 'XJJAAA', 'HHHHxx'),
+(2042, 6342, 0, 2, 2, 2, 42, 42, 42, 2042, 2042, 84, 85, 'OAAAAA', 'YJJAAA', 'OOOOxx'),
+(1424, 6343, 0, 0, 4, 4, 24, 424, 1424, 1424, 1424, 48, 49, 'UCAAAA', 'ZJJAAA', 'VVVVxx'),
+(7870, 6344, 0, 2, 0, 10, 70, 870, 1870, 2870, 7870, 140, 141, 'SQAAAA', 'AKJAAA', 'AAAAxx'),
+(2653, 6345, 1, 1, 3, 13, 53, 653, 653, 2653, 2653, 106, 107, 'BYAAAA', 'BKJAAA', 'HHHHxx'),
+(4216, 6346, 0, 0, 6, 16, 16, 216, 216, 4216, 4216, 32, 33, 'EGAAAA', 'CKJAAA', 'OOOOxx'),
+(1515, 6347, 1, 3, 5, 15, 15, 515, 1515, 1515, 1515, 30, 31, 'HGAAAA', 'DKJAAA', 'VVVVxx'),
+(7860, 6348, 0, 0, 0, 0, 60, 860, 1860, 2860, 7860, 120, 121, 'IQAAAA', 'EKJAAA', 'AAAAxx'),
+(2984, 6349, 0, 0, 4, 4, 84, 984, 984, 2984, 2984, 168, 169, 'UKAAAA', 'FKJAAA', 'HHHHxx'),
+(6269, 6350, 1, 1, 9, 9, 69, 269, 269, 1269, 6269, 138, 139, 'DHAAAA', 'GKJAAA', 'OOOOxx'),
+(2609, 6351, 1, 1, 9, 9, 9, 609, 609, 2609, 2609, 18, 19, 'JWAAAA', 'HKJAAA', 'VVVVxx'),
+(3671, 6352, 1, 3, 1, 11, 71, 671, 1671, 3671, 3671, 142, 143, 'FLAAAA', 'IKJAAA', 'AAAAxx'),
+(4544, 6353, 0, 0, 4, 4, 44, 544, 544, 4544, 4544, 88, 89, 'USAAAA', 'JKJAAA', 'HHHHxx'),
+(4668, 6354, 0, 0, 8, 8, 68, 668, 668, 4668, 4668, 136, 137, 'OXAAAA', 'KKJAAA', 'OOOOxx'),
+(2565, 6355, 1, 1, 5, 5, 65, 565, 565, 2565, 2565, 130, 131, 'RUAAAA', 'LKJAAA', 'VVVVxx'),
+(3126, 6356, 0, 2, 6, 6, 26, 126, 1126, 3126, 3126, 52, 53, 'GQAAAA', 'MKJAAA', 'AAAAxx'),
+(7573, 6357, 1, 1, 3, 13, 73, 573, 1573, 2573, 7573, 146, 147, 'HFAAAA', 'NKJAAA', 'HHHHxx'),
+(1476, 6358, 0, 0, 6, 16, 76, 476, 1476, 1476, 1476, 152, 153, 'UEAAAA', 'OKJAAA', 'OOOOxx'),
+(2146, 6359, 0, 2, 6, 6, 46, 146, 146, 2146, 2146, 92, 93, 'OEAAAA', 'PKJAAA', 'VVVVxx'),
+(9990, 6360, 0, 2, 0, 10, 90, 990, 1990, 4990, 9990, 180, 181, 'GUAAAA', 'QKJAAA', 'AAAAxx'),
+(2530, 6361, 0, 2, 0, 10, 30, 530, 530, 2530, 2530, 60, 61, 'ITAAAA', 'RKJAAA', 'HHHHxx'),
+(9288, 6362, 0, 0, 8, 8, 88, 288, 1288, 4288, 9288, 176, 177, 'GTAAAA', 'SKJAAA', 'OOOOxx'),
+(9755, 6363, 1, 3, 5, 15, 55, 755, 1755, 4755, 9755, 110, 111, 'FLAAAA', 'TKJAAA', 'VVVVxx'),
+(5305, 6364, 1, 1, 5, 5, 5, 305, 1305, 305, 5305, 10, 11, 'BWAAAA', 'UKJAAA', 'AAAAxx'),
+(2495, 6365, 1, 3, 5, 15, 95, 495, 495, 2495, 2495, 190, 191, 'ZRAAAA', 'VKJAAA', 'HHHHxx'),
+(5443, 6366, 1, 3, 3, 3, 43, 443, 1443, 443, 5443, 86, 87, 'JBAAAA', 'WKJAAA', 'OOOOxx'),
+(1930, 6367, 0, 2, 0, 10, 30, 930, 1930, 1930, 1930, 60, 61, 'GWAAAA', 'XKJAAA', 'VVVVxx'),
+(9134, 6368, 0, 2, 4, 14, 34, 134, 1134, 4134, 9134, 68, 69, 'INAAAA', 'YKJAAA', 'AAAAxx'),
+(2844, 6369, 0, 0, 4, 4, 44, 844, 844, 2844, 2844, 88, 89, 'KFAAAA', 'ZKJAAA', 'HHHHxx'),
+(896, 6370, 0, 0, 6, 16, 96, 896, 896, 896, 896, 192, 193, 'MIAAAA', 'ALJAAA', 'OOOOxx'),
+(1330, 6371, 0, 2, 0, 10, 30, 330, 1330, 1330, 1330, 60, 61, 'EZAAAA', 'BLJAAA', 'VVVVxx'),
+(8980, 6372, 0, 0, 0, 0, 80, 980, 980, 3980, 8980, 160, 161, 'KHAAAA', 'CLJAAA', 'AAAAxx'),
+(5940, 6373, 0, 0, 0, 0, 40, 940, 1940, 940, 5940, 80, 81, 'MUAAAA', 'DLJAAA', 'HHHHxx'),
+(6494, 6374, 0, 2, 4, 14, 94, 494, 494, 1494, 6494, 188, 189, 'UPAAAA', 'ELJAAA', 'OOOOxx'),
+(165, 6375, 1, 1, 5, 5, 65, 165, 165, 165, 165, 130, 131, 'JGAAAA', 'FLJAAA', 'VVVVxx'),
+(2510, 6376, 0, 2, 0, 10, 10, 510, 510, 2510, 2510, 20, 21, 'OSAAAA', 'GLJAAA', 'AAAAxx'),
+(9950, 6377, 0, 2, 0, 10, 50, 950, 1950, 4950, 9950, 100, 101, 'SSAAAA', 'HLJAAA', 'HHHHxx'),
+(3854, 6378, 0, 2, 4, 14, 54, 854, 1854, 3854, 3854, 108, 109, 'GSAAAA', 'ILJAAA', 'OOOOxx'),
+(7493, 6379, 1, 1, 3, 13, 93, 493, 1493, 2493, 7493, 186, 187, 'FCAAAA', 'JLJAAA', 'VVVVxx'),
+(4124, 6380, 0, 0, 4, 4, 24, 124, 124, 4124, 4124, 48, 49, 'QCAAAA', 'KLJAAA', 'AAAAxx'),
+(8563, 6381, 1, 3, 3, 3, 63, 563, 563, 3563, 8563, 126, 127, 'JRAAAA', 'LLJAAA', 'HHHHxx'),
+(8735, 6382, 1, 3, 5, 15, 35, 735, 735, 3735, 8735, 70, 71, 'ZXAAAA', 'MLJAAA', 'OOOOxx'),
+(9046, 6383, 0, 2, 6, 6, 46, 46, 1046, 4046, 9046, 92, 93, 'YJAAAA', 'NLJAAA', 'VVVVxx'),
+(1754, 6384, 0, 2, 4, 14, 54, 754, 1754, 1754, 1754, 108, 109, 'MPAAAA', 'OLJAAA', 'AAAAxx'),
+(6954, 6385, 0, 2, 4, 14, 54, 954, 954, 1954, 6954, 108, 109, 'MHAAAA', 'PLJAAA', 'HHHHxx'),
+(4953, 6386, 1, 1, 3, 13, 53, 953, 953, 4953, 4953, 106, 107, 'NIAAAA', 'QLJAAA', 'OOOOxx'),
+(8142, 6387, 0, 2, 2, 2, 42, 142, 142, 3142, 8142, 84, 85, 'EBAAAA', 'RLJAAA', 'VVVVxx'),
+(9661, 6388, 1, 1, 1, 1, 61, 661, 1661, 4661, 9661, 122, 123, 'PHAAAA', 'SLJAAA', 'AAAAxx'),
+(6415, 6389, 1, 3, 5, 15, 15, 415, 415, 1415, 6415, 30, 31, 'TMAAAA', 'TLJAAA', 'HHHHxx'),
+(5782, 6390, 0, 2, 2, 2, 82, 782, 1782, 782, 5782, 164, 165, 'KOAAAA', 'ULJAAA', 'OOOOxx'),
+(7721, 6391, 1, 1, 1, 1, 21, 721, 1721, 2721, 7721, 42, 43, 'ZKAAAA', 'VLJAAA', 'VVVVxx'),
+(580, 6392, 0, 0, 0, 0, 80, 580, 580, 580, 580, 160, 161, 'IWAAAA', 'WLJAAA', 'AAAAxx'),
+(3784, 6393, 0, 0, 4, 4, 84, 784, 1784, 3784, 3784, 168, 169, 'OPAAAA', 'XLJAAA', 'HHHHxx'),
+(9810, 6394, 0, 2, 0, 10, 10, 810, 1810, 4810, 9810, 20, 21, 'INAAAA', 'YLJAAA', 'OOOOxx'),
+(8488, 6395, 0, 0, 8, 8, 88, 488, 488, 3488, 8488, 176, 177, 'MOAAAA', 'ZLJAAA', 'VVVVxx'),
+(6214, 6396, 0, 2, 4, 14, 14, 214, 214, 1214, 6214, 28, 29, 'AFAAAA', 'AMJAAA', 'AAAAxx'),
+(9433, 6397, 1, 1, 3, 13, 33, 433, 1433, 4433, 9433, 66, 67, 'VYAAAA', 'BMJAAA', 'HHHHxx'),
+(9959, 6398, 1, 3, 9, 19, 59, 959, 1959, 4959, 9959, 118, 119, 'BTAAAA', 'CMJAAA', 'OOOOxx'),
+(554, 6399, 0, 2, 4, 14, 54, 554, 554, 554, 554, 108, 109, 'IVAAAA', 'DMJAAA', 'VVVVxx'),
+(6646, 6400, 0, 2, 6, 6, 46, 646, 646, 1646, 6646, 92, 93, 'QVAAAA', 'EMJAAA', 'AAAAxx'),
+(1138, 6401, 0, 2, 8, 18, 38, 138, 1138, 1138, 1138, 76, 77, 'URAAAA', 'FMJAAA', 'HHHHxx'),
+(9331, 6402, 1, 3, 1, 11, 31, 331, 1331, 4331, 9331, 62, 63, 'XUAAAA', 'GMJAAA', 'OOOOxx'),
+(7331, 6403, 1, 3, 1, 11, 31, 331, 1331, 2331, 7331, 62, 63, 'ZVAAAA', 'HMJAAA', 'VVVVxx'),
+(3482, 6404, 0, 2, 2, 2, 82, 482, 1482, 3482, 3482, 164, 165, 'YDAAAA', 'IMJAAA', 'AAAAxx'),
+(3795, 6405, 1, 3, 5, 15, 95, 795, 1795, 3795, 3795, 190, 191, 'ZPAAAA', 'JMJAAA', 'HHHHxx'),
+(2441, 6406, 1, 1, 1, 1, 41, 441, 441, 2441, 2441, 82, 83, 'XPAAAA', 'KMJAAA', 'OOOOxx'),
+(5229, 6407, 1, 1, 9, 9, 29, 229, 1229, 229, 5229, 58, 59, 'DTAAAA', 'LMJAAA', 'VVVVxx'),
+(7012, 6408, 0, 0, 2, 12, 12, 12, 1012, 2012, 7012, 24, 25, 'SJAAAA', 'MMJAAA', 'AAAAxx'),
+(7036, 6409, 0, 0, 6, 16, 36, 36, 1036, 2036, 7036, 72, 73, 'QKAAAA', 'NMJAAA', 'HHHHxx'),
+(8243, 6410, 1, 3, 3, 3, 43, 243, 243, 3243, 8243, 86, 87, 'BFAAAA', 'OMJAAA', 'OOOOxx'),
+(9320, 6411, 0, 0, 0, 0, 20, 320, 1320, 4320, 9320, 40, 41, 'MUAAAA', 'PMJAAA', 'VVVVxx'),
+(4693, 6412, 1, 1, 3, 13, 93, 693, 693, 4693, 4693, 186, 187, 'NYAAAA', 'QMJAAA', 'AAAAxx'),
+(6741, 6413, 1, 1, 1, 1, 41, 741, 741, 1741, 6741, 82, 83, 'HZAAAA', 'RMJAAA', 'HHHHxx'),
+(2997, 6414, 1, 1, 7, 17, 97, 997, 997, 2997, 2997, 194, 195, 'HLAAAA', 'SMJAAA', 'OOOOxx'),
+(4838, 6415, 0, 2, 8, 18, 38, 838, 838, 4838, 4838, 76, 77, 'CEAAAA', 'TMJAAA', 'VVVVxx'),
+(6945, 6416, 1, 1, 5, 5, 45, 945, 945, 1945, 6945, 90, 91, 'DHAAAA', 'UMJAAA', 'AAAAxx'),
+(8253, 6417, 1, 1, 3, 13, 53, 253, 253, 3253, 8253, 106, 107, 'LFAAAA', 'VMJAAA', 'HHHHxx'),
+(8989, 6418, 1, 1, 9, 9, 89, 989, 989, 3989, 8989, 178, 179, 'THAAAA', 'WMJAAA', 'OOOOxx'),
+(2640, 6419, 0, 0, 0, 0, 40, 640, 640, 2640, 2640, 80, 81, 'OXAAAA', 'XMJAAA', 'VVVVxx'),
+(5647, 6420, 1, 3, 7, 7, 47, 647, 1647, 647, 5647, 94, 95, 'FJAAAA', 'YMJAAA', 'AAAAxx'),
+(7186, 6421, 0, 2, 6, 6, 86, 186, 1186, 2186, 7186, 172, 173, 'KQAAAA', 'ZMJAAA', 'HHHHxx'),
+(3278, 6422, 0, 2, 8, 18, 78, 278, 1278, 3278, 3278, 156, 157, 'CWAAAA', 'ANJAAA', 'OOOOxx'),
+(8546, 6423, 0, 2, 6, 6, 46, 546, 546, 3546, 8546, 92, 93, 'SQAAAA', 'BNJAAA', 'VVVVxx'),
+(8297, 6424, 1, 1, 7, 17, 97, 297, 297, 3297, 8297, 194, 195, 'DHAAAA', 'CNJAAA', 'AAAAxx'),
+(9534, 6425, 0, 2, 4, 14, 34, 534, 1534, 4534, 9534, 68, 69, 'SCAAAA', 'DNJAAA', 'HHHHxx'),
+(9618, 6426, 0, 2, 8, 18, 18, 618, 1618, 4618, 9618, 36, 37, 'YFAAAA', 'ENJAAA', 'OOOOxx'),
+(8839, 6427, 1, 3, 9, 19, 39, 839, 839, 3839, 8839, 78, 79, 'ZBAAAA', 'FNJAAA', 'VVVVxx'),
+(7605, 6428, 1, 1, 5, 5, 5, 605, 1605, 2605, 7605, 10, 11, 'NGAAAA', 'GNJAAA', 'AAAAxx'),
+(6421, 6429, 1, 1, 1, 1, 21, 421, 421, 1421, 6421, 42, 43, 'ZMAAAA', 'HNJAAA', 'HHHHxx'),
+(3582, 6430, 0, 2, 2, 2, 82, 582, 1582, 3582, 3582, 164, 165, 'UHAAAA', 'INJAAA', 'OOOOxx'),
+(485, 6431, 1, 1, 5, 5, 85, 485, 485, 485, 485, 170, 171, 'RSAAAA', 'JNJAAA', 'VVVVxx'),
+(1925, 6432, 1, 1, 5, 5, 25, 925, 1925, 1925, 1925, 50, 51, 'BWAAAA', 'KNJAAA', 'AAAAxx'),
+(4296, 6433, 0, 0, 6, 16, 96, 296, 296, 4296, 4296, 192, 193, 'GJAAAA', 'LNJAAA', 'HHHHxx'),
+(8874, 6434, 0, 2, 4, 14, 74, 874, 874, 3874, 8874, 148, 149, 'IDAAAA', 'MNJAAA', 'OOOOxx'),
+(1443, 6435, 1, 3, 3, 3, 43, 443, 1443, 1443, 1443, 86, 87, 'NDAAAA', 'NNJAAA', 'VVVVxx'),
+(4239, 6436, 1, 3, 9, 19, 39, 239, 239, 4239, 4239, 78, 79, 'BHAAAA', 'ONJAAA', 'AAAAxx'),
+(9760, 6437, 0, 0, 0, 0, 60, 760, 1760, 4760, 9760, 120, 121, 'KLAAAA', 'PNJAAA', 'HHHHxx'),
+(136, 6438, 0, 0, 6, 16, 36, 136, 136, 136, 136, 72, 73, 'GFAAAA', 'QNJAAA', 'OOOOxx'),
+(6472, 6439, 0, 0, 2, 12, 72, 472, 472, 1472, 6472, 144, 145, 'YOAAAA', 'RNJAAA', 'VVVVxx'),
+(4896, 6440, 0, 0, 6, 16, 96, 896, 896, 4896, 4896, 192, 193, 'IGAAAA', 'SNJAAA', 'AAAAxx'),
+(9028, 6441, 0, 0, 8, 8, 28, 28, 1028, 4028, 9028, 56, 57, 'GJAAAA', 'TNJAAA', 'HHHHxx'),
+(8354, 6442, 0, 2, 4, 14, 54, 354, 354, 3354, 8354, 108, 109, 'IJAAAA', 'UNJAAA', 'OOOOxx'),
+(8648, 6443, 0, 0, 8, 8, 48, 648, 648, 3648, 8648, 96, 97, 'QUAAAA', 'VNJAAA', 'VVVVxx'),
+(918, 6444, 0, 2, 8, 18, 18, 918, 918, 918, 918, 36, 37, 'IJAAAA', 'WNJAAA', 'AAAAxx'),
+(6606, 6445, 0, 2, 6, 6, 6, 606, 606, 1606, 6606, 12, 13, 'CUAAAA', 'XNJAAA', 'HHHHxx'),
+(2462, 6446, 0, 2, 2, 2, 62, 462, 462, 2462, 2462, 124, 125, 'SQAAAA', 'YNJAAA', 'OOOOxx'),
+(7536, 6447, 0, 0, 6, 16, 36, 536, 1536, 2536, 7536, 72, 73, 'WDAAAA', 'ZNJAAA', 'VVVVxx'),
+(1700, 6448, 0, 0, 0, 0, 0, 700, 1700, 1700, 1700, 0, 1, 'KNAAAA', 'AOJAAA', 'AAAAxx'),
+(6740, 6449, 0, 0, 0, 0, 40, 740, 740, 1740, 6740, 80, 81, 'GZAAAA', 'BOJAAA', 'HHHHxx'),
+(28, 6450, 0, 0, 8, 8, 28, 28, 28, 28, 28, 56, 57, 'CBAAAA', 'COJAAA', 'OOOOxx'),
+(6044, 6451, 0, 0, 4, 4, 44, 44, 44, 1044, 6044, 88, 89, 'MYAAAA', 'DOJAAA', 'VVVVxx'),
+(5053, 6452, 1, 1, 3, 13, 53, 53, 1053, 53, 5053, 106, 107, 'JMAAAA', 'EOJAAA', 'AAAAxx'),
+(4832, 6453, 0, 0, 2, 12, 32, 832, 832, 4832, 4832, 64, 65, 'WDAAAA', 'FOJAAA', 'HHHHxx'),
+(9145, 6454, 1, 1, 5, 5, 45, 145, 1145, 4145, 9145, 90, 91, 'TNAAAA', 'GOJAAA', 'OOOOxx'),
+(5482, 6455, 0, 2, 2, 2, 82, 482, 1482, 482, 5482, 164, 165, 'WCAAAA', 'HOJAAA', 'VVVVxx'),
+(7644, 6456, 0, 0, 4, 4, 44, 644, 1644, 2644, 7644, 88, 89, 'AIAAAA', 'IOJAAA', 'AAAAxx'),
+(2128, 6457, 0, 0, 8, 8, 28, 128, 128, 2128, 2128, 56, 57, 'WDAAAA', 'JOJAAA', 'HHHHxx'),
+(6583, 6458, 1, 3, 3, 3, 83, 583, 583, 1583, 6583, 166, 167, 'FTAAAA', 'KOJAAA', 'OOOOxx'),
+(4224, 6459, 0, 0, 4, 4, 24, 224, 224, 4224, 4224, 48, 49, 'MGAAAA', 'LOJAAA', 'VVVVxx'),
+(5253, 6460, 1, 1, 3, 13, 53, 253, 1253, 253, 5253, 106, 107, 'BUAAAA', 'MOJAAA', 'AAAAxx'),
+(8219, 6461, 1, 3, 9, 19, 19, 219, 219, 3219, 8219, 38, 39, 'DEAAAA', 'NOJAAA', 'HHHHxx'),
+(8113, 6462, 1, 1, 3, 13, 13, 113, 113, 3113, 8113, 26, 27, 'BAAAAA', 'OOJAAA', 'OOOOxx'),
+(3616, 6463, 0, 0, 6, 16, 16, 616, 1616, 3616, 3616, 32, 33, 'CJAAAA', 'POJAAA', 'VVVVxx'),
+(1361, 6464, 1, 1, 1, 1, 61, 361, 1361, 1361, 1361, 122, 123, 'JAAAAA', 'QOJAAA', 'AAAAxx'),
+(949, 6465, 1, 1, 9, 9, 49, 949, 949, 949, 949, 98, 99, 'NKAAAA', 'ROJAAA', 'HHHHxx'),
+(8582, 6466, 0, 2, 2, 2, 82, 582, 582, 3582, 8582, 164, 165, 'CSAAAA', 'SOJAAA', 'OOOOxx'),
+(5104, 6467, 0, 0, 4, 4, 4, 104, 1104, 104, 5104, 8, 9, 'IOAAAA', 'TOJAAA', 'VVVVxx'),
+(6146, 6468, 0, 2, 6, 6, 46, 146, 146, 1146, 6146, 92, 93, 'KCAAAA', 'UOJAAA', 'AAAAxx'),
+(7681, 6469, 1, 1, 1, 1, 81, 681, 1681, 2681, 7681, 162, 163, 'LJAAAA', 'VOJAAA', 'HHHHxx'),
+(1904, 6470, 0, 0, 4, 4, 4, 904, 1904, 1904, 1904, 8, 9, 'GVAAAA', 'WOJAAA', 'OOOOxx'),
+(1989, 6471, 1, 1, 9, 9, 89, 989, 1989, 1989, 1989, 178, 179, 'NYAAAA', 'XOJAAA', 'VVVVxx'),
+(4179, 6472, 1, 3, 9, 19, 79, 179, 179, 4179, 4179, 158, 159, 'TEAAAA', 'YOJAAA', 'AAAAxx'),
+(1739, 6473, 1, 3, 9, 19, 39, 739, 1739, 1739, 1739, 78, 79, 'XOAAAA', 'ZOJAAA', 'HHHHxx'),
+(2447, 6474, 1, 3, 7, 7, 47, 447, 447, 2447, 2447, 94, 95, 'DQAAAA', 'APJAAA', 'OOOOxx'),
+(3029, 6475, 1, 1, 9, 9, 29, 29, 1029, 3029, 3029, 58, 59, 'NMAAAA', 'BPJAAA', 'VVVVxx'),
+(9783, 6476, 1, 3, 3, 3, 83, 783, 1783, 4783, 9783, 166, 167, 'HMAAAA', 'CPJAAA', 'AAAAxx'),
+(8381, 6477, 1, 1, 1, 1, 81, 381, 381, 3381, 8381, 162, 163, 'JKAAAA', 'DPJAAA', 'HHHHxx'),
+(8755, 6478, 1, 3, 5, 15, 55, 755, 755, 3755, 8755, 110, 111, 'TYAAAA', 'EPJAAA', 'OOOOxx'),
+(8384, 6479, 0, 0, 4, 4, 84, 384, 384, 3384, 8384, 168, 169, 'MKAAAA', 'FPJAAA', 'VVVVxx'),
+(7655, 6480, 1, 3, 5, 15, 55, 655, 1655, 2655, 7655, 110, 111, 'LIAAAA', 'GPJAAA', 'AAAAxx'),
+(4766, 6481, 0, 2, 6, 6, 66, 766, 766, 4766, 4766, 132, 133, 'IBAAAA', 'HPJAAA', 'HHHHxx'),
+(3324, 6482, 0, 0, 4, 4, 24, 324, 1324, 3324, 3324, 48, 49, 'WXAAAA', 'IPJAAA', 'OOOOxx'),
+(5022, 6483, 0, 2, 2, 2, 22, 22, 1022, 22, 5022, 44, 45, 'ELAAAA', 'JPJAAA', 'VVVVxx'),
+(2856, 6484, 0, 0, 6, 16, 56, 856, 856, 2856, 2856, 112, 113, 'WFAAAA', 'KPJAAA', 'AAAAxx'),
+(6503, 6485, 1, 3, 3, 3, 3, 503, 503, 1503, 6503, 6, 7, 'DQAAAA', 'LPJAAA', 'HHHHxx'),
+(6872, 6486, 0, 0, 2, 12, 72, 872, 872, 1872, 6872, 144, 145, 'IEAAAA', 'MPJAAA', 'OOOOxx'),
+(1663, 6487, 1, 3, 3, 3, 63, 663, 1663, 1663, 1663, 126, 127, 'ZLAAAA', 'NPJAAA', 'VVVVxx'),
+(6964, 6488, 0, 0, 4, 4, 64, 964, 964, 1964, 6964, 128, 129, 'WHAAAA', 'OPJAAA', 'AAAAxx'),
+(4622, 6489, 0, 2, 2, 2, 22, 622, 622, 4622, 4622, 44, 45, 'UVAAAA', 'PPJAAA', 'HHHHxx'),
+(6089, 6490, 1, 1, 9, 9, 89, 89, 89, 1089, 6089, 178, 179, 'FAAAAA', 'QPJAAA', 'OOOOxx'),
+(8567, 6491, 1, 3, 7, 7, 67, 567, 567, 3567, 8567, 134, 135, 'NRAAAA', 'RPJAAA', 'VVVVxx'),
+(597, 6492, 1, 1, 7, 17, 97, 597, 597, 597, 597, 194, 195, 'ZWAAAA', 'SPJAAA', 'AAAAxx'),
+(4222, 6493, 0, 2, 2, 2, 22, 222, 222, 4222, 4222, 44, 45, 'KGAAAA', 'TPJAAA', 'HHHHxx'),
+(9322, 6494, 0, 2, 2, 2, 22, 322, 1322, 4322, 9322, 44, 45, 'OUAAAA', 'UPJAAA', 'OOOOxx'),
+(624, 6495, 0, 0, 4, 4, 24, 624, 624, 624, 624, 48, 49, 'AYAAAA', 'VPJAAA', 'VVVVxx'),
+(4329, 6496, 1, 1, 9, 9, 29, 329, 329, 4329, 4329, 58, 59, 'NKAAAA', 'WPJAAA', 'AAAAxx'),
+(6781, 6497, 1, 1, 1, 1, 81, 781, 781, 1781, 6781, 162, 163, 'VAAAAA', 'XPJAAA', 'HHHHxx'),
+(1673, 6498, 1, 1, 3, 13, 73, 673, 1673, 1673, 1673, 146, 147, 'JMAAAA', 'YPJAAA', 'OOOOxx'),
+(6633, 6499, 1, 1, 3, 13, 33, 633, 633, 1633, 6633, 66, 67, 'DVAAAA', 'ZPJAAA', 'VVVVxx'),
+(2569, 6500, 1, 1, 9, 9, 69, 569, 569, 2569, 2569, 138, 139, 'VUAAAA', 'AQJAAA', 'AAAAxx'),
+(4995, 6501, 1, 3, 5, 15, 95, 995, 995, 4995, 4995, 190, 191, 'DKAAAA', 'BQJAAA', 'HHHHxx'),
+(2749, 6502, 1, 1, 9, 9, 49, 749, 749, 2749, 2749, 98, 99, 'TBAAAA', 'CQJAAA', 'OOOOxx'),
+(9044, 6503, 0, 0, 4, 4, 44, 44, 1044, 4044, 9044, 88, 89, 'WJAAAA', 'DQJAAA', 'VVVVxx'),
+(5823, 6504, 1, 3, 3, 3, 23, 823, 1823, 823, 5823, 46, 47, 'ZPAAAA', 'EQJAAA', 'AAAAxx'),
+(9366, 6505, 0, 2, 6, 6, 66, 366, 1366, 4366, 9366, 132, 133, 'GWAAAA', 'FQJAAA', 'HHHHxx'),
+(1169, 6506, 1, 1, 9, 9, 69, 169, 1169, 1169, 1169, 138, 139, 'ZSAAAA', 'GQJAAA', 'OOOOxx'),
+(1300, 6507, 0, 0, 0, 0, 0, 300, 1300, 1300, 1300, 0, 1, 'AYAAAA', 'HQJAAA', 'VVVVxx'),
+(9973, 6508, 1, 1, 3, 13, 73, 973, 1973, 4973, 9973, 146, 147, 'PTAAAA', 'IQJAAA', 'AAAAxx'),
+(2092, 6509, 0, 0, 2, 12, 92, 92, 92, 2092, 2092, 184, 185, 'MCAAAA', 'JQJAAA', 'HHHHxx'),
+(9776, 6510, 0, 0, 6, 16, 76, 776, 1776, 4776, 9776, 152, 153, 'AMAAAA', 'KQJAAA', 'OOOOxx'),
+(7612, 6511, 0, 0, 2, 12, 12, 612, 1612, 2612, 7612, 24, 25, 'UGAAAA', 'LQJAAA', 'VVVVxx'),
+(7190, 6512, 0, 2, 0, 10, 90, 190, 1190, 2190, 7190, 180, 181, 'OQAAAA', 'MQJAAA', 'AAAAxx'),
+(5147, 6513, 1, 3, 7, 7, 47, 147, 1147, 147, 5147, 94, 95, 'ZPAAAA', 'NQJAAA', 'HHHHxx'),
+(3722, 6514, 0, 2, 2, 2, 22, 722, 1722, 3722, 3722, 44, 45, 'ENAAAA', 'OQJAAA', 'OOOOxx'),
+(5858, 6515, 0, 2, 8, 18, 58, 858, 1858, 858, 5858, 116, 117, 'IRAAAA', 'PQJAAA', 'VVVVxx'),
+(3204, 6516, 0, 0, 4, 4, 4, 204, 1204, 3204, 3204, 8, 9, 'GTAAAA', 'QQJAAA', 'AAAAxx'),
+(8994, 6517, 0, 2, 4, 14, 94, 994, 994, 3994, 8994, 188, 189, 'YHAAAA', 'RQJAAA', 'HHHHxx'),
+(7478, 6518, 0, 2, 8, 18, 78, 478, 1478, 2478, 7478, 156, 157, 'QBAAAA', 'SQJAAA', 'OOOOxx'),
+(9624, 6519, 0, 0, 4, 4, 24, 624, 1624, 4624, 9624, 48, 49, 'EGAAAA', 'TQJAAA', 'VVVVxx'),
+(6639, 6520, 1, 3, 9, 19, 39, 639, 639, 1639, 6639, 78, 79, 'JVAAAA', 'UQJAAA', 'AAAAxx'),
+(369, 6521, 1, 1, 9, 9, 69, 369, 369, 369, 369, 138, 139, 'FOAAAA', 'VQJAAA', 'HHHHxx'),
+(7766, 6522, 0, 2, 6, 6, 66, 766, 1766, 2766, 7766, 132, 133, 'SMAAAA', 'WQJAAA', 'OOOOxx'),
+(4094, 6523, 0, 2, 4, 14, 94, 94, 94, 4094, 4094, 188, 189, 'MBAAAA', 'XQJAAA', 'VVVVxx'),
+(9556, 6524, 0, 0, 6, 16, 56, 556, 1556, 4556, 9556, 112, 113, 'ODAAAA', 'YQJAAA', 'AAAAxx'),
+(4887, 6525, 1, 3, 7, 7, 87, 887, 887, 4887, 4887, 174, 175, 'ZFAAAA', 'ZQJAAA', 'HHHHxx'),
+(2321, 6526, 1, 1, 1, 1, 21, 321, 321, 2321, 2321, 42, 43, 'HLAAAA', 'ARJAAA', 'OOOOxx'),
+(9201, 6527, 1, 1, 1, 1, 1, 201, 1201, 4201, 9201, 2, 3, 'XPAAAA', 'BRJAAA', 'VVVVxx'),
+(1627, 6528, 1, 3, 7, 7, 27, 627, 1627, 1627, 1627, 54, 55, 'PKAAAA', 'CRJAAA', 'AAAAxx'),
+(150, 6529, 0, 2, 0, 10, 50, 150, 150, 150, 150, 100, 101, 'UFAAAA', 'DRJAAA', 'HHHHxx'),
+(8010, 6530, 0, 2, 0, 10, 10, 10, 10, 3010, 8010, 20, 21, 'CWAAAA', 'ERJAAA', 'OOOOxx'),
+(8026, 6531, 0, 2, 6, 6, 26, 26, 26, 3026, 8026, 52, 53, 'SWAAAA', 'FRJAAA', 'VVVVxx'),
+(5495, 6532, 1, 3, 5, 15, 95, 495, 1495, 495, 5495, 190, 191, 'JDAAAA', 'GRJAAA', 'AAAAxx'),
+(6213, 6533, 1, 1, 3, 13, 13, 213, 213, 1213, 6213, 26, 27, 'ZEAAAA', 'HRJAAA', 'HHHHxx'),
+(6464, 6534, 0, 0, 4, 4, 64, 464, 464, 1464, 6464, 128, 129, 'QOAAAA', 'IRJAAA', 'OOOOxx'),
+(1158, 6535, 0, 2, 8, 18, 58, 158, 1158, 1158, 1158, 116, 117, 'OSAAAA', 'JRJAAA', 'VVVVxx'),
+(8669, 6536, 1, 1, 9, 9, 69, 669, 669, 3669, 8669, 138, 139, 'LVAAAA', 'KRJAAA', 'AAAAxx'),
+(3225, 6537, 1, 1, 5, 5, 25, 225, 1225, 3225, 3225, 50, 51, 'BUAAAA', 'LRJAAA', 'HHHHxx'),
+(1294, 6538, 0, 2, 4, 14, 94, 294, 1294, 1294, 1294, 188, 189, 'UXAAAA', 'MRJAAA', 'OOOOxx'),
+(2166, 6539, 0, 2, 6, 6, 66, 166, 166, 2166, 2166, 132, 133, 'IFAAAA', 'NRJAAA', 'VVVVxx'),
+(9328, 6540, 0, 0, 8, 8, 28, 328, 1328, 4328, 9328, 56, 57, 'UUAAAA', 'ORJAAA', 'AAAAxx'),
+(8431, 6541, 1, 3, 1, 11, 31, 431, 431, 3431, 8431, 62, 63, 'HMAAAA', 'PRJAAA', 'HHHHxx'),
+(7100, 6542, 0, 0, 0, 0, 0, 100, 1100, 2100, 7100, 0, 1, 'CNAAAA', 'QRJAAA', 'OOOOxx'),
+(8126, 6543, 0, 2, 6, 6, 26, 126, 126, 3126, 8126, 52, 53, 'OAAAAA', 'RRJAAA', 'VVVVxx'),
+(2185, 6544, 1, 1, 5, 5, 85, 185, 185, 2185, 2185, 170, 171, 'BGAAAA', 'SRJAAA', 'AAAAxx'),
+(5697, 6545, 1, 1, 7, 17, 97, 697, 1697, 697, 5697, 194, 195, 'DLAAAA', 'TRJAAA', 'HHHHxx'),
+(5531, 6546, 1, 3, 1, 11, 31, 531, 1531, 531, 5531, 62, 63, 'TEAAAA', 'URJAAA', 'OOOOxx'),
+(3020, 6547, 0, 0, 0, 0, 20, 20, 1020, 3020, 3020, 40, 41, 'EMAAAA', 'VRJAAA', 'VVVVxx'),
+(3076, 6548, 0, 0, 6, 16, 76, 76, 1076, 3076, 3076, 152, 153, 'IOAAAA', 'WRJAAA', 'AAAAxx'),
+(9228, 6549, 0, 0, 8, 8, 28, 228, 1228, 4228, 9228, 56, 57, 'YQAAAA', 'XRJAAA', 'HHHHxx'),
+(1734, 6550, 0, 2, 4, 14, 34, 734, 1734, 1734, 1734, 68, 69, 'SOAAAA', 'YRJAAA', 'OOOOxx'),
+(7616, 6551, 0, 0, 6, 16, 16, 616, 1616, 2616, 7616, 32, 33, 'YGAAAA', 'ZRJAAA', 'VVVVxx'),
+(9059, 6552, 1, 3, 9, 19, 59, 59, 1059, 4059, 9059, 118, 119, 'LKAAAA', 'ASJAAA', 'AAAAxx'),
+(323, 6553, 1, 3, 3, 3, 23, 323, 323, 323, 323, 46, 47, 'LMAAAA', 'BSJAAA', 'HHHHxx'),
+(1283, 6554, 1, 3, 3, 3, 83, 283, 1283, 1283, 1283, 166, 167, 'JXAAAA', 'CSJAAA', 'OOOOxx'),
+(9535, 6555, 1, 3, 5, 15, 35, 535, 1535, 4535, 9535, 70, 71, 'TCAAAA', 'DSJAAA', 'VVVVxx'),
+(2580, 6556, 0, 0, 0, 0, 80, 580, 580, 2580, 2580, 160, 161, 'GVAAAA', 'ESJAAA', 'AAAAxx'),
+(7633, 6557, 1, 1, 3, 13, 33, 633, 1633, 2633, 7633, 66, 67, 'PHAAAA', 'FSJAAA', 'HHHHxx'),
+(9497, 6558, 1, 1, 7, 17, 97, 497, 1497, 4497, 9497, 194, 195, 'HBAAAA', 'GSJAAA', 'OOOOxx'),
+(9842, 6559, 0, 2, 2, 2, 42, 842, 1842, 4842, 9842, 84, 85, 'OOAAAA', 'HSJAAA', 'VVVVxx'),
+(3426, 6560, 0, 2, 6, 6, 26, 426, 1426, 3426, 3426, 52, 53, 'UBAAAA', 'ISJAAA', 'AAAAxx'),
+(7650, 6561, 0, 2, 0, 10, 50, 650, 1650, 2650, 7650, 100, 101, 'GIAAAA', 'JSJAAA', 'HHHHxx'),
+(9935, 6562, 1, 3, 5, 15, 35, 935, 1935, 4935, 9935, 70, 71, 'DSAAAA', 'KSJAAA', 'OOOOxx'),
+(9354, 6563, 0, 2, 4, 14, 54, 354, 1354, 4354, 9354, 108, 109, 'UVAAAA', 'LSJAAA', 'VVVVxx'),
+(5569, 6564, 1, 1, 9, 9, 69, 569, 1569, 569, 5569, 138, 139, 'FGAAAA', 'MSJAAA', 'AAAAxx'),
+(5765, 6565, 1, 1, 5, 5, 65, 765, 1765, 765, 5765, 130, 131, 'TNAAAA', 'NSJAAA', 'HHHHxx'),
+(7283, 6566, 1, 3, 3, 3, 83, 283, 1283, 2283, 7283, 166, 167, 'DUAAAA', 'OSJAAA', 'OOOOxx'),
+(1068, 6567, 0, 0, 8, 8, 68, 68, 1068, 1068, 1068, 136, 137, 'CPAAAA', 'PSJAAA', 'VVVVxx'),
+(1641, 6568, 1, 1, 1, 1, 41, 641, 1641, 1641, 1641, 82, 83, 'DLAAAA', 'QSJAAA', 'AAAAxx'),
+(1688, 6569, 0, 0, 8, 8, 88, 688, 1688, 1688, 1688, 176, 177, 'YMAAAA', 'RSJAAA', 'HHHHxx'),
+(1133, 6570, 1, 1, 3, 13, 33, 133, 1133, 1133, 1133, 66, 67, 'PRAAAA', 'SSJAAA', 'OOOOxx'),
+(4493, 6571, 1, 1, 3, 13, 93, 493, 493, 4493, 4493, 186, 187, 'VQAAAA', 'TSJAAA', 'VVVVxx'),
+(3354, 6572, 0, 2, 4, 14, 54, 354, 1354, 3354, 3354, 108, 109, 'AZAAAA', 'USJAAA', 'AAAAxx'),
+(4029, 6573, 1, 1, 9, 9, 29, 29, 29, 4029, 4029, 58, 59, 'ZYAAAA', 'VSJAAA', 'HHHHxx'),
+(6704, 6574, 0, 0, 4, 4, 4, 704, 704, 1704, 6704, 8, 9, 'WXAAAA', 'WSJAAA', 'OOOOxx'),
+(3221, 6575, 1, 1, 1, 1, 21, 221, 1221, 3221, 3221, 42, 43, 'XTAAAA', 'XSJAAA', 'VVVVxx'),
+(9432, 6576, 0, 0, 2, 12, 32, 432, 1432, 4432, 9432, 64, 65, 'UYAAAA', 'YSJAAA', 'AAAAxx'),
+(6990, 6577, 0, 2, 0, 10, 90, 990, 990, 1990, 6990, 180, 181, 'WIAAAA', 'ZSJAAA', 'HHHHxx'),
+(1760, 6578, 0, 0, 0, 0, 60, 760, 1760, 1760, 1760, 120, 121, 'SPAAAA', 'ATJAAA', 'OOOOxx'),
+(4754, 6579, 0, 2, 4, 14, 54, 754, 754, 4754, 4754, 108, 109, 'WAAAAA', 'BTJAAA', 'VVVVxx'),
+(7724, 6580, 0, 0, 4, 4, 24, 724, 1724, 2724, 7724, 48, 49, 'CLAAAA', 'CTJAAA', 'AAAAxx'),
+(9487, 6581, 1, 3, 7, 7, 87, 487, 1487, 4487, 9487, 174, 175, 'XAAAAA', 'DTJAAA', 'HHHHxx'),
+(166, 6582, 0, 2, 6, 6, 66, 166, 166, 166, 166, 132, 133, 'KGAAAA', 'ETJAAA', 'OOOOxx'),
+(5479, 6583, 1, 3, 9, 19, 79, 479, 1479, 479, 5479, 158, 159, 'TCAAAA', 'FTJAAA', 'VVVVxx'),
+(8744, 6584, 0, 0, 4, 4, 44, 744, 744, 3744, 8744, 88, 89, 'IYAAAA', 'GTJAAA', 'AAAAxx'),
+(5746, 6585, 0, 2, 6, 6, 46, 746, 1746, 746, 5746, 92, 93, 'ANAAAA', 'HTJAAA', 'HHHHxx'),
+(907, 6586, 1, 3, 7, 7, 7, 907, 907, 907, 907, 14, 15, 'XIAAAA', 'ITJAAA', 'OOOOxx'),
+(3968, 6587, 0, 0, 8, 8, 68, 968, 1968, 3968, 3968, 136, 137, 'QWAAAA', 'JTJAAA', 'VVVVxx'),
+(5721, 6588, 1, 1, 1, 1, 21, 721, 1721, 721, 5721, 42, 43, 'BMAAAA', 'KTJAAA', 'AAAAxx'),
+(6738, 6589, 0, 2, 8, 18, 38, 738, 738, 1738, 6738, 76, 77, 'EZAAAA', 'LTJAAA', 'HHHHxx'),
+(4097, 6590, 1, 1, 7, 17, 97, 97, 97, 4097, 4097, 194, 195, 'PBAAAA', 'MTJAAA', 'OOOOxx'),
+(8456, 6591, 0, 0, 6, 16, 56, 456, 456, 3456, 8456, 112, 113, 'GNAAAA', 'NTJAAA', 'VVVVxx'),
+(1269, 6592, 1, 1, 9, 9, 69, 269, 1269, 1269, 1269, 138, 139, 'VWAAAA', 'OTJAAA', 'AAAAxx'),
+(7997, 6593, 1, 1, 7, 17, 97, 997, 1997, 2997, 7997, 194, 195, 'PVAAAA', 'PTJAAA', 'HHHHxx'),
+(9457, 6594, 1, 1, 7, 17, 57, 457, 1457, 4457, 9457, 114, 115, 'TZAAAA', 'QTJAAA', 'OOOOxx'),
+(1159, 6595, 1, 3, 9, 19, 59, 159, 1159, 1159, 1159, 118, 119, 'PSAAAA', 'RTJAAA', 'VVVVxx'),
+(1631, 6596, 1, 3, 1, 11, 31, 631, 1631, 1631, 1631, 62, 63, 'TKAAAA', 'STJAAA', 'AAAAxx'),
+(2019, 6597, 1, 3, 9, 19, 19, 19, 19, 2019, 2019, 38, 39, 'RZAAAA', 'TTJAAA', 'HHHHxx'),
+(3186, 6598, 0, 2, 6, 6, 86, 186, 1186, 3186, 3186, 172, 173, 'OSAAAA', 'UTJAAA', 'OOOOxx'),
+(5587, 6599, 1, 3, 7, 7, 87, 587, 1587, 587, 5587, 174, 175, 'XGAAAA', 'VTJAAA', 'VVVVxx'),
+(9172, 6600, 0, 0, 2, 12, 72, 172, 1172, 4172, 9172, 144, 145, 'UOAAAA', 'WTJAAA', 'AAAAxx'),
+(5589, 6601, 1, 1, 9, 9, 89, 589, 1589, 589, 5589, 178, 179, 'ZGAAAA', 'XTJAAA', 'HHHHxx'),
+(5103, 6602, 1, 3, 3, 3, 3, 103, 1103, 103, 5103, 6, 7, 'HOAAAA', 'YTJAAA', 'OOOOxx'),
+(3177, 6603, 1, 1, 7, 17, 77, 177, 1177, 3177, 3177, 154, 155, 'FSAAAA', 'ZTJAAA', 'VVVVxx'),
+(8887, 6604, 1, 3, 7, 7, 87, 887, 887, 3887, 8887, 174, 175, 'VDAAAA', 'AUJAAA', 'AAAAxx'),
+(12, 6605, 0, 0, 2, 12, 12, 12, 12, 12, 12, 24, 25, 'MAAAAA', 'BUJAAA', 'HHHHxx'),
+(8575, 6606, 1, 3, 5, 15, 75, 575, 575, 3575, 8575, 150, 151, 'VRAAAA', 'CUJAAA', 'OOOOxx'),
+(4335, 6607, 1, 3, 5, 15, 35, 335, 335, 4335, 4335, 70, 71, 'TKAAAA', 'DUJAAA', 'VVVVxx'),
+(4581, 6608, 1, 1, 1, 1, 81, 581, 581, 4581, 4581, 162, 163, 'FUAAAA', 'EUJAAA', 'AAAAxx'),
+(4444, 6609, 0, 0, 4, 4, 44, 444, 444, 4444, 4444, 88, 89, 'YOAAAA', 'FUJAAA', 'HHHHxx'),
+(7978, 6610, 0, 2, 8, 18, 78, 978, 1978, 2978, 7978, 156, 157, 'WUAAAA', 'GUJAAA', 'OOOOxx'),
+(3081, 6611, 1, 1, 1, 1, 81, 81, 1081, 3081, 3081, 162, 163, 'NOAAAA', 'HUJAAA', 'VVVVxx'),
+(4059, 6612, 1, 3, 9, 19, 59, 59, 59, 4059, 4059, 118, 119, 'DAAAAA', 'IUJAAA', 'AAAAxx'),
+(5711, 6613, 1, 3, 1, 11, 11, 711, 1711, 711, 5711, 22, 23, 'RLAAAA', 'JUJAAA', 'HHHHxx'),
+(7069, 6614, 1, 1, 9, 9, 69, 69, 1069, 2069, 7069, 138, 139, 'XLAAAA', 'KUJAAA', 'OOOOxx'),
+(6150, 6615, 0, 2, 0, 10, 50, 150, 150, 1150, 6150, 100, 101, 'OCAAAA', 'LUJAAA', 'VVVVxx'),
+(9550, 6616, 0, 2, 0, 10, 50, 550, 1550, 4550, 9550, 100, 101, 'IDAAAA', 'MUJAAA', 'AAAAxx'),
+(7087, 6617, 1, 3, 7, 7, 87, 87, 1087, 2087, 7087, 174, 175, 'PMAAAA', 'NUJAAA', 'HHHHxx'),
+(9557, 6618, 1, 1, 7, 17, 57, 557, 1557, 4557, 9557, 114, 115, 'PDAAAA', 'OUJAAA', 'OOOOxx'),
+(7856, 6619, 0, 0, 6, 16, 56, 856, 1856, 2856, 7856, 112, 113, 'EQAAAA', 'PUJAAA', 'VVVVxx'),
+(1115, 6620, 1, 3, 5, 15, 15, 115, 1115, 1115, 1115, 30, 31, 'XQAAAA', 'QUJAAA', 'AAAAxx'),
+(1086, 6621, 0, 2, 6, 6, 86, 86, 1086, 1086, 1086, 172, 173, 'UPAAAA', 'RUJAAA', 'HHHHxx'),
+(5048, 6622, 0, 0, 8, 8, 48, 48, 1048, 48, 5048, 96, 97, 'EMAAAA', 'SUJAAA', 'OOOOxx'),
+(5168, 6623, 0, 0, 8, 8, 68, 168, 1168, 168, 5168, 136, 137, 'UQAAAA', 'TUJAAA', 'VVVVxx'),
+(6029, 6624, 1, 1, 9, 9, 29, 29, 29, 1029, 6029, 58, 59, 'XXAAAA', 'UUJAAA', 'AAAAxx'),
+(546, 6625, 0, 2, 6, 6, 46, 546, 546, 546, 546, 92, 93, 'AVAAAA', 'VUJAAA', 'HHHHxx'),
+(2908, 6626, 0, 0, 8, 8, 8, 908, 908, 2908, 2908, 16, 17, 'WHAAAA', 'WUJAAA', 'OOOOxx'),
+(779, 6627, 1, 3, 9, 19, 79, 779, 779, 779, 779, 158, 159, 'ZDAAAA', 'XUJAAA', 'VVVVxx'),
+(4202, 6628, 0, 2, 2, 2, 2, 202, 202, 4202, 4202, 4, 5, 'QFAAAA', 'YUJAAA', 'AAAAxx'),
+(9984, 6629, 0, 0, 4, 4, 84, 984, 1984, 4984, 9984, 168, 169, 'AUAAAA', 'ZUJAAA', 'HHHHxx'),
+(4730, 6630, 0, 2, 0, 10, 30, 730, 730, 4730, 4730, 60, 61, 'YZAAAA', 'AVJAAA', 'OOOOxx'),
+(6517, 6631, 1, 1, 7, 17, 17, 517, 517, 1517, 6517, 34, 35, 'RQAAAA', 'BVJAAA', 'VVVVxx'),
+(8410, 6632, 0, 2, 0, 10, 10, 410, 410, 3410, 8410, 20, 21, 'MLAAAA', 'CVJAAA', 'AAAAxx'),
+(4793, 6633, 1, 1, 3, 13, 93, 793, 793, 4793, 4793, 186, 187, 'JCAAAA', 'DVJAAA', 'HHHHxx'),
+(3431, 6634, 1, 3, 1, 11, 31, 431, 1431, 3431, 3431, 62, 63, 'ZBAAAA', 'EVJAAA', 'OOOOxx'),
+(2481, 6635, 1, 1, 1, 1, 81, 481, 481, 2481, 2481, 162, 163, 'LRAAAA', 'FVJAAA', 'VVVVxx'),
+(3905, 6636, 1, 1, 5, 5, 5, 905, 1905, 3905, 3905, 10, 11, 'FUAAAA', 'GVJAAA', 'AAAAxx'),
+(8807, 6637, 1, 3, 7, 7, 7, 807, 807, 3807, 8807, 14, 15, 'TAAAAA', 'HVJAAA', 'HHHHxx'),
+(2660, 6638, 0, 0, 0, 0, 60, 660, 660, 2660, 2660, 120, 121, 'IYAAAA', 'IVJAAA', 'OOOOxx'),
+(4985, 6639, 1, 1, 5, 5, 85, 985, 985, 4985, 4985, 170, 171, 'TJAAAA', 'JVJAAA', 'VVVVxx'),
+(3080, 6640, 0, 0, 0, 0, 80, 80, 1080, 3080, 3080, 160, 161, 'MOAAAA', 'KVJAAA', 'AAAAxx'),
+(1090, 6641, 0, 2, 0, 10, 90, 90, 1090, 1090, 1090, 180, 181, 'YPAAAA', 'LVJAAA', 'HHHHxx'),
+(6917, 6642, 1, 1, 7, 17, 17, 917, 917, 1917, 6917, 34, 35, 'BGAAAA', 'MVJAAA', 'OOOOxx'),
+(5177, 6643, 1, 1, 7, 17, 77, 177, 1177, 177, 5177, 154, 155, 'DRAAAA', 'NVJAAA', 'VVVVxx'),
+(2729, 6644, 1, 1, 9, 9, 29, 729, 729, 2729, 2729, 58, 59, 'ZAAAAA', 'OVJAAA', 'AAAAxx'),
+(9706, 6645, 0, 2, 6, 6, 6, 706, 1706, 4706, 9706, 12, 13, 'IJAAAA', 'PVJAAA', 'HHHHxx'),
+(9929, 6646, 1, 1, 9, 9, 29, 929, 1929, 4929, 9929, 58, 59, 'XRAAAA', 'QVJAAA', 'OOOOxx'),
+(1547, 6647, 1, 3, 7, 7, 47, 547, 1547, 1547, 1547, 94, 95, 'NHAAAA', 'RVJAAA', 'VVVVxx'),
+(2798, 6648, 0, 2, 8, 18, 98, 798, 798, 2798, 2798, 196, 197, 'QDAAAA', 'SVJAAA', 'AAAAxx'),
+(4420, 6649, 0, 0, 0, 0, 20, 420, 420, 4420, 4420, 40, 41, 'AOAAAA', 'TVJAAA', 'HHHHxx'),
+(6771, 6650, 1, 3, 1, 11, 71, 771, 771, 1771, 6771, 142, 143, 'LAAAAA', 'UVJAAA', 'OOOOxx'),
+(2004, 6651, 0, 0, 4, 4, 4, 4, 4, 2004, 2004, 8, 9, 'CZAAAA', 'VVJAAA', 'VVVVxx'),
+(8686, 6652, 0, 2, 6, 6, 86, 686, 686, 3686, 8686, 172, 173, 'CWAAAA', 'WVJAAA', 'AAAAxx'),
+(3663, 6653, 1, 3, 3, 3, 63, 663, 1663, 3663, 3663, 126, 127, 'XKAAAA', 'XVJAAA', 'HHHHxx'),
+(806, 6654, 0, 2, 6, 6, 6, 806, 806, 806, 806, 12, 13, 'AFAAAA', 'YVJAAA', 'OOOOxx'),
+(4309, 6655, 1, 1, 9, 9, 9, 309, 309, 4309, 4309, 18, 19, 'TJAAAA', 'ZVJAAA', 'VVVVxx'),
+(7443, 6656, 1, 3, 3, 3, 43, 443, 1443, 2443, 7443, 86, 87, 'HAAAAA', 'AWJAAA', 'AAAAxx'),
+(5779, 6657, 1, 3, 9, 19, 79, 779, 1779, 779, 5779, 158, 159, 'HOAAAA', 'BWJAAA', 'HHHHxx'),
+(8821, 6658, 1, 1, 1, 1, 21, 821, 821, 3821, 8821, 42, 43, 'HBAAAA', 'CWJAAA', 'OOOOxx'),
+(4198, 6659, 0, 2, 8, 18, 98, 198, 198, 4198, 4198, 196, 197, 'MFAAAA', 'DWJAAA', 'VVVVxx'),
+(8115, 6660, 1, 3, 5, 15, 15, 115, 115, 3115, 8115, 30, 31, 'DAAAAA', 'EWJAAA', 'AAAAxx'),
+(9554, 6661, 0, 2, 4, 14, 54, 554, 1554, 4554, 9554, 108, 109, 'MDAAAA', 'FWJAAA', 'HHHHxx'),
+(8956, 6662, 0, 0, 6, 16, 56, 956, 956, 3956, 8956, 112, 113, 'MGAAAA', 'GWJAAA', 'OOOOxx'),
+(4733, 6663, 1, 1, 3, 13, 33, 733, 733, 4733, 4733, 66, 67, 'BAAAAA', 'HWJAAA', 'VVVVxx'),
+(5417, 6664, 1, 1, 7, 17, 17, 417, 1417, 417, 5417, 34, 35, 'JAAAAA', 'IWJAAA', 'AAAAxx'),
+(4792, 6665, 0, 0, 2, 12, 92, 792, 792, 4792, 4792, 184, 185, 'ICAAAA', 'JWJAAA', 'HHHHxx'),
+(462, 6666, 0, 2, 2, 2, 62, 462, 462, 462, 462, 124, 125, 'URAAAA', 'KWJAAA', 'OOOOxx'),
+(3687, 6667, 1, 3, 7, 7, 87, 687, 1687, 3687, 3687, 174, 175, 'VLAAAA', 'LWJAAA', 'VVVVxx'),
+(2013, 6668, 1, 1, 3, 13, 13, 13, 13, 2013, 2013, 26, 27, 'LZAAAA', 'MWJAAA', 'AAAAxx'),
+(5386, 6669, 0, 2, 6, 6, 86, 386, 1386, 386, 5386, 172, 173, 'EZAAAA', 'NWJAAA', 'HHHHxx'),
+(2816, 6670, 0, 0, 6, 16, 16, 816, 816, 2816, 2816, 32, 33, 'IEAAAA', 'OWJAAA', 'OOOOxx'),
+(7827, 6671, 1, 3, 7, 7, 27, 827, 1827, 2827, 7827, 54, 55, 'BPAAAA', 'PWJAAA', 'VVVVxx'),
+(5077, 6672, 1, 1, 7, 17, 77, 77, 1077, 77, 5077, 154, 155, 'HNAAAA', 'QWJAAA', 'AAAAxx'),
+(6039, 6673, 1, 3, 9, 19, 39, 39, 39, 1039, 6039, 78, 79, 'HYAAAA', 'RWJAAA', 'HHHHxx'),
+(215, 6674, 1, 3, 5, 15, 15, 215, 215, 215, 215, 30, 31, 'HIAAAA', 'SWJAAA', 'OOOOxx'),
+(855, 6675, 1, 3, 5, 15, 55, 855, 855, 855, 855, 110, 111, 'XGAAAA', 'TWJAAA', 'VVVVxx'),
+(9692, 6676, 0, 0, 2, 12, 92, 692, 1692, 4692, 9692, 184, 185, 'UIAAAA', 'UWJAAA', 'AAAAxx'),
+(8391, 6677, 1, 3, 1, 11, 91, 391, 391, 3391, 8391, 182, 183, 'TKAAAA', 'VWJAAA', 'HHHHxx'),
+(8424, 6678, 0, 0, 4, 4, 24, 424, 424, 3424, 8424, 48, 49, 'AMAAAA', 'WWJAAA', 'OOOOxx'),
+(6331, 6679, 1, 3, 1, 11, 31, 331, 331, 1331, 6331, 62, 63, 'NJAAAA', 'XWJAAA', 'VVVVxx'),
+(6561, 6680, 1, 1, 1, 1, 61, 561, 561, 1561, 6561, 122, 123, 'JSAAAA', 'YWJAAA', 'AAAAxx'),
+(8955, 6681, 1, 3, 5, 15, 55, 955, 955, 3955, 8955, 110, 111, 'LGAAAA', 'ZWJAAA', 'HHHHxx'),
+(1764, 6682, 0, 0, 4, 4, 64, 764, 1764, 1764, 1764, 128, 129, 'WPAAAA', 'AXJAAA', 'OOOOxx'),
+(6623, 6683, 1, 3, 3, 3, 23, 623, 623, 1623, 6623, 46, 47, 'TUAAAA', 'BXJAAA', 'VVVVxx'),
+(2900, 6684, 0, 0, 0, 0, 0, 900, 900, 2900, 2900, 0, 1, 'OHAAAA', 'CXJAAA', 'AAAAxx'),
+(7048, 6685, 0, 0, 8, 8, 48, 48, 1048, 2048, 7048, 96, 97, 'CLAAAA', 'DXJAAA', 'HHHHxx'),
+(3843, 6686, 1, 3, 3, 3, 43, 843, 1843, 3843, 3843, 86, 87, 'VRAAAA', 'EXJAAA', 'OOOOxx'),
+(4855, 6687, 1, 3, 5, 15, 55, 855, 855, 4855, 4855, 110, 111, 'TEAAAA', 'FXJAAA', 'VVVVxx'),
+(7383, 6688, 1, 3, 3, 3, 83, 383, 1383, 2383, 7383, 166, 167, 'ZXAAAA', 'GXJAAA', 'AAAAxx'),
+(7765, 6689, 1, 1, 5, 5, 65, 765, 1765, 2765, 7765, 130, 131, 'RMAAAA', 'HXJAAA', 'HHHHxx'),
+(1125, 6690, 1, 1, 5, 5, 25, 125, 1125, 1125, 1125, 50, 51, 'HRAAAA', 'IXJAAA', 'OOOOxx'),
+(755, 6691, 1, 3, 5, 15, 55, 755, 755, 755, 755, 110, 111, 'BDAAAA', 'JXJAAA', 'VVVVxx'),
+(2995, 6692, 1, 3, 5, 15, 95, 995, 995, 2995, 2995, 190, 191, 'FLAAAA', 'KXJAAA', 'AAAAxx'),
+(8907, 6693, 1, 3, 7, 7, 7, 907, 907, 3907, 8907, 14, 15, 'PEAAAA', 'LXJAAA', 'HHHHxx'),
+(9357, 6694, 1, 1, 7, 17, 57, 357, 1357, 4357, 9357, 114, 115, 'XVAAAA', 'MXJAAA', 'OOOOxx'),
+(4469, 6695, 1, 1, 9, 9, 69, 469, 469, 4469, 4469, 138, 139, 'XPAAAA', 'NXJAAA', 'VVVVxx'),
+(2147, 6696, 1, 3, 7, 7, 47, 147, 147, 2147, 2147, 94, 95, 'PEAAAA', 'OXJAAA', 'AAAAxx'),
+(2952, 6697, 0, 0, 2, 12, 52, 952, 952, 2952, 2952, 104, 105, 'OJAAAA', 'PXJAAA', 'HHHHxx'),
+(1324, 6698, 0, 0, 4, 4, 24, 324, 1324, 1324, 1324, 48, 49, 'YYAAAA', 'QXJAAA', 'OOOOxx'),
+(1173, 6699, 1, 1, 3, 13, 73, 173, 1173, 1173, 1173, 146, 147, 'DTAAAA', 'RXJAAA', 'VVVVxx'),
+(3169, 6700, 1, 1, 9, 9, 69, 169, 1169, 3169, 3169, 138, 139, 'XRAAAA', 'SXJAAA', 'AAAAxx'),
+(5149, 6701, 1, 1, 9, 9, 49, 149, 1149, 149, 5149, 98, 99, 'BQAAAA', 'TXJAAA', 'HHHHxx'),
+(9660, 6702, 0, 0, 0, 0, 60, 660, 1660, 4660, 9660, 120, 121, 'OHAAAA', 'UXJAAA', 'OOOOxx'),
+(3446, 6703, 0, 2, 6, 6, 46, 446, 1446, 3446, 3446, 92, 93, 'OCAAAA', 'VXJAAA', 'VVVVxx'),
+(6988, 6704, 0, 0, 8, 8, 88, 988, 988, 1988, 6988, 176, 177, 'UIAAAA', 'WXJAAA', 'AAAAxx'),
+(5829, 6705, 1, 1, 9, 9, 29, 829, 1829, 829, 5829, 58, 59, 'FQAAAA', 'XXJAAA', 'HHHHxx'),
+(7166, 6706, 0, 2, 6, 6, 66, 166, 1166, 2166, 7166, 132, 133, 'QPAAAA', 'YXJAAA', 'OOOOxx'),
+(3940, 6707, 0, 0, 0, 0, 40, 940, 1940, 3940, 3940, 80, 81, 'OVAAAA', 'ZXJAAA', 'VVVVxx'),
+(2645, 6708, 1, 1, 5, 5, 45, 645, 645, 2645, 2645, 90, 91, 'TXAAAA', 'AYJAAA', 'AAAAxx'),
+(478, 6709, 0, 2, 8, 18, 78, 478, 478, 478, 478, 156, 157, 'KSAAAA', 'BYJAAA', 'HHHHxx'),
+(1156, 6710, 0, 0, 6, 16, 56, 156, 1156, 1156, 1156, 112, 113, 'MSAAAA', 'CYJAAA', 'OOOOxx'),
+(2731, 6711, 1, 3, 1, 11, 31, 731, 731, 2731, 2731, 62, 63, 'BBAAAA', 'DYJAAA', 'VVVVxx'),
+(5637, 6712, 1, 1, 7, 17, 37, 637, 1637, 637, 5637, 74, 75, 'VIAAAA', 'EYJAAA', 'AAAAxx'),
+(7517, 6713, 1, 1, 7, 17, 17, 517, 1517, 2517, 7517, 34, 35, 'DDAAAA', 'FYJAAA', 'HHHHxx'),
+(5331, 6714, 1, 3, 1, 11, 31, 331, 1331, 331, 5331, 62, 63, 'BXAAAA', 'GYJAAA', 'OOOOxx'),
+(9640, 6715, 0, 0, 0, 0, 40, 640, 1640, 4640, 9640, 80, 81, 'UGAAAA', 'HYJAAA', 'VVVVxx'),
+(4108, 6716, 0, 0, 8, 8, 8, 108, 108, 4108, 4108, 16, 17, 'ACAAAA', 'IYJAAA', 'AAAAxx'),
+(1087, 6717, 1, 3, 7, 7, 87, 87, 1087, 1087, 1087, 174, 175, 'VPAAAA', 'JYJAAA', 'HHHHxx'),
+(8017, 6718, 1, 1, 7, 17, 17, 17, 17, 3017, 8017, 34, 35, 'JWAAAA', 'KYJAAA', 'OOOOxx'),
+(8795, 6719, 1, 3, 5, 15, 95, 795, 795, 3795, 8795, 190, 191, 'HAAAAA', 'LYJAAA', 'VVVVxx'),
+(7060, 6720, 0, 0, 0, 0, 60, 60, 1060, 2060, 7060, 120, 121, 'OLAAAA', 'MYJAAA', 'AAAAxx'),
+(9450, 6721, 0, 2, 0, 10, 50, 450, 1450, 4450, 9450, 100, 101, 'MZAAAA', 'NYJAAA', 'HHHHxx'),
+(390, 6722, 0, 2, 0, 10, 90, 390, 390, 390, 390, 180, 181, 'APAAAA', 'OYJAAA', 'OOOOxx'),
+(66, 6723, 0, 2, 6, 6, 66, 66, 66, 66, 66, 132, 133, 'OCAAAA', 'PYJAAA', 'VVVVxx'),
+(8789, 6724, 1, 1, 9, 9, 89, 789, 789, 3789, 8789, 178, 179, 'BAAAAA', 'QYJAAA', 'AAAAxx'),
+(9260, 6725, 0, 0, 0, 0, 60, 260, 1260, 4260, 9260, 120, 121, 'ESAAAA', 'RYJAAA', 'HHHHxx'),
+(6679, 6726, 1, 3, 9, 19, 79, 679, 679, 1679, 6679, 158, 159, 'XWAAAA', 'SYJAAA', 'OOOOxx'),
+(9052, 6727, 0, 0, 2, 12, 52, 52, 1052, 4052, 9052, 104, 105, 'EKAAAA', 'TYJAAA', 'VVVVxx'),
+(9561, 6728, 1, 1, 1, 1, 61, 561, 1561, 4561, 9561, 122, 123, 'TDAAAA', 'UYJAAA', 'AAAAxx'),
+(9725, 6729, 1, 1, 5, 5, 25, 725, 1725, 4725, 9725, 50, 51, 'BKAAAA', 'VYJAAA', 'HHHHxx'),
+(6298, 6730, 0, 2, 8, 18, 98, 298, 298, 1298, 6298, 196, 197, 'GIAAAA', 'WYJAAA', 'OOOOxx'),
+(8654, 6731, 0, 2, 4, 14, 54, 654, 654, 3654, 8654, 108, 109, 'WUAAAA', 'XYJAAA', 'VVVVxx'),
+(8725, 6732, 1, 1, 5, 5, 25, 725, 725, 3725, 8725, 50, 51, 'PXAAAA', 'YYJAAA', 'AAAAxx'),
+(9377, 6733, 1, 1, 7, 17, 77, 377, 1377, 4377, 9377, 154, 155, 'RWAAAA', 'ZYJAAA', 'HHHHxx'),
+(3807, 6734, 1, 3, 7, 7, 7, 807, 1807, 3807, 3807, 14, 15, 'LQAAAA', 'AZJAAA', 'OOOOxx'),
+(8048, 6735, 0, 0, 8, 8, 48, 48, 48, 3048, 8048, 96, 97, 'OXAAAA', 'BZJAAA', 'VVVVxx'),
+(764, 6736, 0, 0, 4, 4, 64, 764, 764, 764, 764, 128, 129, 'KDAAAA', 'CZJAAA', 'AAAAxx'),
+(9702, 6737, 0, 2, 2, 2, 2, 702, 1702, 4702, 9702, 4, 5, 'EJAAAA', 'DZJAAA', 'HHHHxx'),
+(8060, 6738, 0, 0, 0, 0, 60, 60, 60, 3060, 8060, 120, 121, 'AYAAAA', 'EZJAAA', 'OOOOxx'),
+(6371, 6739, 1, 3, 1, 11, 71, 371, 371, 1371, 6371, 142, 143, 'BLAAAA', 'FZJAAA', 'VVVVxx'),
+(5237, 6740, 1, 1, 7, 17, 37, 237, 1237, 237, 5237, 74, 75, 'LTAAAA', 'GZJAAA', 'AAAAxx'),
+(743, 6741, 1, 3, 3, 3, 43, 743, 743, 743, 743, 86, 87, 'PCAAAA', 'HZJAAA', 'HHHHxx'),
+(7395, 6742, 1, 3, 5, 15, 95, 395, 1395, 2395, 7395, 190, 191, 'LYAAAA', 'IZJAAA', 'OOOOxx'),
+(3365, 6743, 1, 1, 5, 5, 65, 365, 1365, 3365, 3365, 130, 131, 'LZAAAA', 'JZJAAA', 'VVVVxx'),
+(6667, 6744, 1, 3, 7, 7, 67, 667, 667, 1667, 6667, 134, 135, 'LWAAAA', 'KZJAAA', 'AAAAxx'),
+(3445, 6745, 1, 1, 5, 5, 45, 445, 1445, 3445, 3445, 90, 91, 'NCAAAA', 'LZJAAA', 'HHHHxx'),
+(4019, 6746, 1, 3, 9, 19, 19, 19, 19, 4019, 4019, 38, 39, 'PYAAAA', 'MZJAAA', 'OOOOxx'),
+(7035, 6747, 1, 3, 5, 15, 35, 35, 1035, 2035, 7035, 70, 71, 'PKAAAA', 'NZJAAA', 'VVVVxx'),
+(5274, 6748, 0, 2, 4, 14, 74, 274, 1274, 274, 5274, 148, 149, 'WUAAAA', 'OZJAAA', 'AAAAxx'),
+(519, 6749, 1, 3, 9, 19, 19, 519, 519, 519, 519, 38, 39, 'ZTAAAA', 'PZJAAA', 'HHHHxx'),
+(2801, 6750, 1, 1, 1, 1, 1, 801, 801, 2801, 2801, 2, 3, 'TDAAAA', 'QZJAAA', 'OOOOxx'),
+(3320, 6751, 0, 0, 0, 0, 20, 320, 1320, 3320, 3320, 40, 41, 'SXAAAA', 'RZJAAA', 'VVVVxx'),
+(3153, 6752, 1, 1, 3, 13, 53, 153, 1153, 3153, 3153, 106, 107, 'HRAAAA', 'SZJAAA', 'AAAAxx'),
+(7680, 6753, 0, 0, 0, 0, 80, 680, 1680, 2680, 7680, 160, 161, 'KJAAAA', 'TZJAAA', 'HHHHxx'),
+(8942, 6754, 0, 2, 2, 2, 42, 942, 942, 3942, 8942, 84, 85, 'YFAAAA', 'UZJAAA', 'OOOOxx'),
+(3195, 6755, 1, 3, 5, 15, 95, 195, 1195, 3195, 3195, 190, 191, 'XSAAAA', 'VZJAAA', 'VVVVxx'),
+(2287, 6756, 1, 3, 7, 7, 87, 287, 287, 2287, 2287, 174, 175, 'ZJAAAA', 'WZJAAA', 'AAAAxx'),
+(8325, 6757, 1, 1, 5, 5, 25, 325, 325, 3325, 8325, 50, 51, 'FIAAAA', 'XZJAAA', 'HHHHxx'),
+(2603, 6758, 1, 3, 3, 3, 3, 603, 603, 2603, 2603, 6, 7, 'DWAAAA', 'YZJAAA', 'OOOOxx'),
+(5871, 6759, 1, 3, 1, 11, 71, 871, 1871, 871, 5871, 142, 143, 'VRAAAA', 'ZZJAAA', 'VVVVxx'),
+(1773, 6760, 1, 1, 3, 13, 73, 773, 1773, 1773, 1773, 146, 147, 'FQAAAA', 'AAKAAA', 'AAAAxx'),
+(3323, 6761, 1, 3, 3, 3, 23, 323, 1323, 3323, 3323, 46, 47, 'VXAAAA', 'BAKAAA', 'HHHHxx'),
+(2053, 6762, 1, 1, 3, 13, 53, 53, 53, 2053, 2053, 106, 107, 'ZAAAAA', 'CAKAAA', 'OOOOxx'),
+(4062, 6763, 0, 2, 2, 2, 62, 62, 62, 4062, 4062, 124, 125, 'GAAAAA', 'DAKAAA', 'VVVVxx'),
+(4611, 6764, 1, 3, 1, 11, 11, 611, 611, 4611, 4611, 22, 23, 'JVAAAA', 'EAKAAA', 'AAAAxx'),
+(3451, 6765, 1, 3, 1, 11, 51, 451, 1451, 3451, 3451, 102, 103, 'TCAAAA', 'FAKAAA', 'HHHHxx'),
+(1819, 6766, 1, 3, 9, 19, 19, 819, 1819, 1819, 1819, 38, 39, 'ZRAAAA', 'GAKAAA', 'OOOOxx'),
+(9806, 6767, 0, 2, 6, 6, 6, 806, 1806, 4806, 9806, 12, 13, 'ENAAAA', 'HAKAAA', 'VVVVxx'),
+(6619, 6768, 1, 3, 9, 19, 19, 619, 619, 1619, 6619, 38, 39, 'PUAAAA', 'IAKAAA', 'AAAAxx'),
+(1031, 6769, 1, 3, 1, 11, 31, 31, 1031, 1031, 1031, 62, 63, 'RNAAAA', 'JAKAAA', 'HHHHxx'),
+(1865, 6770, 1, 1, 5, 5, 65, 865, 1865, 1865, 1865, 130, 131, 'TTAAAA', 'KAKAAA', 'OOOOxx'),
+(6282, 6771, 0, 2, 2, 2, 82, 282, 282, 1282, 6282, 164, 165, 'QHAAAA', 'LAKAAA', 'VVVVxx'),
+(1178, 6772, 0, 2, 8, 18, 78, 178, 1178, 1178, 1178, 156, 157, 'ITAAAA', 'MAKAAA', 'AAAAxx'),
+(8007, 6773, 1, 3, 7, 7, 7, 7, 7, 3007, 8007, 14, 15, 'ZVAAAA', 'NAKAAA', 'HHHHxx'),
+(9126, 6774, 0, 2, 6, 6, 26, 126, 1126, 4126, 9126, 52, 53, 'ANAAAA', 'OAKAAA', 'OOOOxx'),
+(9113, 6775, 1, 1, 3, 13, 13, 113, 1113, 4113, 9113, 26, 27, 'NMAAAA', 'PAKAAA', 'VVVVxx'),
+(537, 6776, 1, 1, 7, 17, 37, 537, 537, 537, 537, 74, 75, 'RUAAAA', 'QAKAAA', 'AAAAxx'),
+(6208, 6777, 0, 0, 8, 8, 8, 208, 208, 1208, 6208, 16, 17, 'UEAAAA', 'RAKAAA', 'HHHHxx'),
+(1626, 6778, 0, 2, 6, 6, 26, 626, 1626, 1626, 1626, 52, 53, 'OKAAAA', 'SAKAAA', 'OOOOxx'),
+(7188, 6779, 0, 0, 8, 8, 88, 188, 1188, 2188, 7188, 176, 177, 'MQAAAA', 'TAKAAA', 'VVVVxx'),
+(9216, 6780, 0, 0, 6, 16, 16, 216, 1216, 4216, 9216, 32, 33, 'MQAAAA', 'UAKAAA', 'AAAAxx'),
+(6134, 6781, 0, 2, 4, 14, 34, 134, 134, 1134, 6134, 68, 69, 'YBAAAA', 'VAKAAA', 'HHHHxx'),
+(2074, 6782, 0, 2, 4, 14, 74, 74, 74, 2074, 2074, 148, 149, 'UBAAAA', 'WAKAAA', 'OOOOxx'),
+(6369, 6783, 1, 1, 9, 9, 69, 369, 369, 1369, 6369, 138, 139, 'ZKAAAA', 'XAKAAA', 'VVVVxx'),
+(9306, 6784, 0, 2, 6, 6, 6, 306, 1306, 4306, 9306, 12, 13, 'YTAAAA', 'YAKAAA', 'AAAAxx'),
+(3155, 6785, 1, 3, 5, 15, 55, 155, 1155, 3155, 3155, 110, 111, 'JRAAAA', 'ZAKAAA', 'HHHHxx'),
+(3611, 6786, 1, 3, 1, 11, 11, 611, 1611, 3611, 3611, 22, 23, 'XIAAAA', 'ABKAAA', 'OOOOxx'),
+(6530, 6787, 0, 2, 0, 10, 30, 530, 530, 1530, 6530, 60, 61, 'ERAAAA', 'BBKAAA', 'VVVVxx'),
+(6979, 6788, 1, 3, 9, 19, 79, 979, 979, 1979, 6979, 158, 159, 'LIAAAA', 'CBKAAA', 'AAAAxx'),
+(9129, 6789, 1, 1, 9, 9, 29, 129, 1129, 4129, 9129, 58, 59, 'DNAAAA', 'DBKAAA', 'HHHHxx'),
+(8013, 6790, 1, 1, 3, 13, 13, 13, 13, 3013, 8013, 26, 27, 'FWAAAA', 'EBKAAA', 'OOOOxx'),
+(6926, 6791, 0, 2, 6, 6, 26, 926, 926, 1926, 6926, 52, 53, 'KGAAAA', 'FBKAAA', 'VVVVxx'),
+(1877, 6792, 1, 1, 7, 17, 77, 877, 1877, 1877, 1877, 154, 155, 'FUAAAA', 'GBKAAA', 'AAAAxx'),
+(1882, 6793, 0, 2, 2, 2, 82, 882, 1882, 1882, 1882, 164, 165, 'KUAAAA', 'HBKAAA', 'HHHHxx'),
+(6720, 6794, 0, 0, 0, 0, 20, 720, 720, 1720, 6720, 40, 41, 'MYAAAA', 'IBKAAA', 'OOOOxx'),
+(690, 6795, 0, 2, 0, 10, 90, 690, 690, 690, 690, 180, 181, 'OAAAAA', 'JBKAAA', 'VVVVxx'),
+(143, 6796, 1, 3, 3, 3, 43, 143, 143, 143, 143, 86, 87, 'NFAAAA', 'KBKAAA', 'AAAAxx'),
+(7241, 6797, 1, 1, 1, 1, 41, 241, 1241, 2241, 7241, 82, 83, 'NSAAAA', 'LBKAAA', 'HHHHxx'),
+(6461, 6798, 1, 1, 1, 1, 61, 461, 461, 1461, 6461, 122, 123, 'NOAAAA', 'MBKAAA', 'OOOOxx'),
+(2258, 6799, 0, 2, 8, 18, 58, 258, 258, 2258, 2258, 116, 117, 'WIAAAA', 'NBKAAA', 'VVVVxx'),
+(2280, 6800, 0, 0, 0, 0, 80, 280, 280, 2280, 2280, 160, 161, 'SJAAAA', 'OBKAAA', 'AAAAxx'),
+(7556, 6801, 0, 0, 6, 16, 56, 556, 1556, 2556, 7556, 112, 113, 'QEAAAA', 'PBKAAA', 'HHHHxx'),
+(1038, 6802, 0, 2, 8, 18, 38, 38, 1038, 1038, 1038, 76, 77, 'YNAAAA', 'QBKAAA', 'OOOOxx'),
+(2634, 6803, 0, 2, 4, 14, 34, 634, 634, 2634, 2634, 68, 69, 'IXAAAA', 'RBKAAA', 'VVVVxx'),
+(7847, 6804, 1, 3, 7, 7, 47, 847, 1847, 2847, 7847, 94, 95, 'VPAAAA', 'SBKAAA', 'AAAAxx'),
+(4415, 6805, 1, 3, 5, 15, 15, 415, 415, 4415, 4415, 30, 31, 'VNAAAA', 'TBKAAA', 'HHHHxx'),
+(1933, 6806, 1, 1, 3, 13, 33, 933, 1933, 1933, 1933, 66, 67, 'JWAAAA', 'UBKAAA', 'OOOOxx'),
+(8034, 6807, 0, 2, 4, 14, 34, 34, 34, 3034, 8034, 68, 69, 'AXAAAA', 'VBKAAA', 'VVVVxx'),
+(9233, 6808, 1, 1, 3, 13, 33, 233, 1233, 4233, 9233, 66, 67, 'DRAAAA', 'WBKAAA', 'AAAAxx'),
+(6572, 6809, 0, 0, 2, 12, 72, 572, 572, 1572, 6572, 144, 145, 'USAAAA', 'XBKAAA', 'HHHHxx'),
+(1586, 6810, 0, 2, 6, 6, 86, 586, 1586, 1586, 1586, 172, 173, 'AJAAAA', 'YBKAAA', 'OOOOxx'),
+(8512, 6811, 0, 0, 2, 12, 12, 512, 512, 3512, 8512, 24, 25, 'KPAAAA', 'ZBKAAA', 'VVVVxx'),
+(7421, 6812, 1, 1, 1, 1, 21, 421, 1421, 2421, 7421, 42, 43, 'LZAAAA', 'ACKAAA', 'AAAAxx'),
+(503, 6813, 1, 3, 3, 3, 3, 503, 503, 503, 503, 6, 7, 'JTAAAA', 'BCKAAA', 'HHHHxx'),
+(5332, 6814, 0, 0, 2, 12, 32, 332, 1332, 332, 5332, 64, 65, 'CXAAAA', 'CCKAAA', 'OOOOxx'),
+(2602, 6815, 0, 2, 2, 2, 2, 602, 602, 2602, 2602, 4, 5, 'CWAAAA', 'DCKAAA', 'VVVVxx'),
+(2902, 6816, 0, 2, 2, 2, 2, 902, 902, 2902, 2902, 4, 5, 'QHAAAA', 'ECKAAA', 'AAAAxx'),
+(2979, 6817, 1, 3, 9, 19, 79, 979, 979, 2979, 2979, 158, 159, 'PKAAAA', 'FCKAAA', 'HHHHxx'),
+(1431, 6818, 1, 3, 1, 11, 31, 431, 1431, 1431, 1431, 62, 63, 'BDAAAA', 'GCKAAA', 'OOOOxx'),
+(8639, 6819, 1, 3, 9, 19, 39, 639, 639, 3639, 8639, 78, 79, 'HUAAAA', 'HCKAAA', 'VVVVxx'),
+(4218, 6820, 0, 2, 8, 18, 18, 218, 218, 4218, 4218, 36, 37, 'GGAAAA', 'ICKAAA', 'AAAAxx'),
+(7453, 6821, 1, 1, 3, 13, 53, 453, 1453, 2453, 7453, 106, 107, 'RAAAAA', 'JCKAAA', 'HHHHxx'),
+(5448, 6822, 0, 0, 8, 8, 48, 448, 1448, 448, 5448, 96, 97, 'OBAAAA', 'KCKAAA', 'OOOOxx'),
+(6768, 6823, 0, 0, 8, 8, 68, 768, 768, 1768, 6768, 136, 137, 'IAAAAA', 'LCKAAA', 'VVVVxx'),
+(3104, 6824, 0, 0, 4, 4, 4, 104, 1104, 3104, 3104, 8, 9, 'KPAAAA', 'MCKAAA', 'AAAAxx'),
+(2297, 6825, 1, 1, 7, 17, 97, 297, 297, 2297, 2297, 194, 195, 'JKAAAA', 'NCKAAA', 'HHHHxx'),
+(7994, 6826, 0, 2, 4, 14, 94, 994, 1994, 2994, 7994, 188, 189, 'MVAAAA', 'OCKAAA', 'OOOOxx'),
+(550, 6827, 0, 2, 0, 10, 50, 550, 550, 550, 550, 100, 101, 'EVAAAA', 'PCKAAA', 'VVVVxx'),
+(4777, 6828, 1, 1, 7, 17, 77, 777, 777, 4777, 4777, 154, 155, 'TBAAAA', 'QCKAAA', 'AAAAxx'),
+(5962, 6829, 0, 2, 2, 2, 62, 962, 1962, 962, 5962, 124, 125, 'IVAAAA', 'RCKAAA', 'HHHHxx'),
+(1763, 6830, 1, 3, 3, 3, 63, 763, 1763, 1763, 1763, 126, 127, 'VPAAAA', 'SCKAAA', 'OOOOxx'),
+(3654, 6831, 0, 2, 4, 14, 54, 654, 1654, 3654, 3654, 108, 109, 'OKAAAA', 'TCKAAA', 'VVVVxx'),
+(4106, 6832, 0, 2, 6, 6, 6, 106, 106, 4106, 4106, 12, 13, 'YBAAAA', 'UCKAAA', 'AAAAxx'),
+(5156, 6833, 0, 0, 6, 16, 56, 156, 1156, 156, 5156, 112, 113, 'IQAAAA', 'VCKAAA', 'HHHHxx'),
+(422, 6834, 0, 2, 2, 2, 22, 422, 422, 422, 422, 44, 45, 'GQAAAA', 'WCKAAA', 'OOOOxx'),
+(5011, 6835, 1, 3, 1, 11, 11, 11, 1011, 11, 5011, 22, 23, 'TKAAAA', 'XCKAAA', 'VVVVxx'),
+(218, 6836, 0, 2, 8, 18, 18, 218, 218, 218, 218, 36, 37, 'KIAAAA', 'YCKAAA', 'AAAAxx'),
+(9762, 6837, 0, 2, 2, 2, 62, 762, 1762, 4762, 9762, 124, 125, 'MLAAAA', 'ZCKAAA', 'HHHHxx'),
+(6074, 6838, 0, 2, 4, 14, 74, 74, 74, 1074, 6074, 148, 149, 'QZAAAA', 'ADKAAA', 'OOOOxx'),
+(4060, 6839, 0, 0, 0, 0, 60, 60, 60, 4060, 4060, 120, 121, 'EAAAAA', 'BDKAAA', 'VVVVxx'),
+(8680, 6840, 0, 0, 0, 0, 80, 680, 680, 3680, 8680, 160, 161, 'WVAAAA', 'CDKAAA', 'AAAAxx'),
+(5863, 6841, 1, 3, 3, 3, 63, 863, 1863, 863, 5863, 126, 127, 'NRAAAA', 'DDKAAA', 'HHHHxx'),
+(8042, 6842, 0, 2, 2, 2, 42, 42, 42, 3042, 8042, 84, 85, 'IXAAAA', 'EDKAAA', 'OOOOxx'),
+(2964, 6843, 0, 0, 4, 4, 64, 964, 964, 2964, 2964, 128, 129, 'AKAAAA', 'FDKAAA', 'VVVVxx'),
+(6931, 6844, 1, 3, 1, 11, 31, 931, 931, 1931, 6931, 62, 63, 'PGAAAA', 'GDKAAA', 'AAAAxx'),
+(6715, 6845, 1, 3, 5, 15, 15, 715, 715, 1715, 6715, 30, 31, 'HYAAAA', 'HDKAAA', 'HHHHxx'),
+(5859, 6846, 1, 3, 9, 19, 59, 859, 1859, 859, 5859, 118, 119, 'JRAAAA', 'IDKAAA', 'OOOOxx'),
+(6173, 6847, 1, 1, 3, 13, 73, 173, 173, 1173, 6173, 146, 147, 'LDAAAA', 'JDKAAA', 'VVVVxx'),
+(7788, 6848, 0, 0, 8, 8, 88, 788, 1788, 2788, 7788, 176, 177, 'ONAAAA', 'KDKAAA', 'AAAAxx'),
+(9370, 6849, 0, 2, 0, 10, 70, 370, 1370, 4370, 9370, 140, 141, 'KWAAAA', 'LDKAAA', 'HHHHxx'),
+(3038, 6850, 0, 2, 8, 18, 38, 38, 1038, 3038, 3038, 76, 77, 'WMAAAA', 'MDKAAA', 'OOOOxx'),
+(6483, 6851, 1, 3, 3, 3, 83, 483, 483, 1483, 6483, 166, 167, 'JPAAAA', 'NDKAAA', 'VVVVxx'),
+(7534, 6852, 0, 2, 4, 14, 34, 534, 1534, 2534, 7534, 68, 69, 'UDAAAA', 'ODKAAA', 'AAAAxx'),
+(5769, 6853, 1, 1, 9, 9, 69, 769, 1769, 769, 5769, 138, 139, 'XNAAAA', 'PDKAAA', 'HHHHxx'),
+(9152, 6854, 0, 0, 2, 12, 52, 152, 1152, 4152, 9152, 104, 105, 'AOAAAA', 'QDKAAA', 'OOOOxx'),
+(6251, 6855, 1, 3, 1, 11, 51, 251, 251, 1251, 6251, 102, 103, 'LGAAAA', 'RDKAAA', 'VVVVxx'),
+(9209, 6856, 1, 1, 9, 9, 9, 209, 1209, 4209, 9209, 18, 19, 'FQAAAA', 'SDKAAA', 'AAAAxx'),
+(5365, 6857, 1, 1, 5, 5, 65, 365, 1365, 365, 5365, 130, 131, 'JYAAAA', 'TDKAAA', 'HHHHxx'),
+(509, 6858, 1, 1, 9, 9, 9, 509, 509, 509, 509, 18, 19, 'PTAAAA', 'UDKAAA', 'OOOOxx'),
+(3132, 6859, 0, 0, 2, 12, 32, 132, 1132, 3132, 3132, 64, 65, 'MQAAAA', 'VDKAAA', 'VVVVxx'),
+(5373, 6860, 1, 1, 3, 13, 73, 373, 1373, 373, 5373, 146, 147, 'RYAAAA', 'WDKAAA', 'AAAAxx'),
+(4247, 6861, 1, 3, 7, 7, 47, 247, 247, 4247, 4247, 94, 95, 'JHAAAA', 'XDKAAA', 'HHHHxx'),
+(3491, 6862, 1, 3, 1, 11, 91, 491, 1491, 3491, 3491, 182, 183, 'HEAAAA', 'YDKAAA', 'OOOOxx'),
+(495, 6863, 1, 3, 5, 15, 95, 495, 495, 495, 495, 190, 191, 'BTAAAA', 'ZDKAAA', 'VVVVxx'),
+(1594, 6864, 0, 2, 4, 14, 94, 594, 1594, 1594, 1594, 188, 189, 'IJAAAA', 'AEKAAA', 'AAAAxx'),
+(2243, 6865, 1, 3, 3, 3, 43, 243, 243, 2243, 2243, 86, 87, 'HIAAAA', 'BEKAAA', 'HHHHxx'),
+(7780, 6866, 0, 0, 0, 0, 80, 780, 1780, 2780, 7780, 160, 161, 'GNAAAA', 'CEKAAA', 'OOOOxx'),
+(5632, 6867, 0, 0, 2, 12, 32, 632, 1632, 632, 5632, 64, 65, 'QIAAAA', 'DEKAAA', 'VVVVxx'),
+(2679, 6868, 1, 3, 9, 19, 79, 679, 679, 2679, 2679, 158, 159, 'BZAAAA', 'EEKAAA', 'AAAAxx'),
+(1354, 6869, 0, 2, 4, 14, 54, 354, 1354, 1354, 1354, 108, 109, 'CAAAAA', 'FEKAAA', 'HHHHxx'),
+(180, 6870, 0, 0, 0, 0, 80, 180, 180, 180, 180, 160, 161, 'YGAAAA', 'GEKAAA', 'OOOOxx'),
+(7017, 6871, 1, 1, 7, 17, 17, 17, 1017, 2017, 7017, 34, 35, 'XJAAAA', 'HEKAAA', 'VVVVxx'),
+(1867, 6872, 1, 3, 7, 7, 67, 867, 1867, 1867, 1867, 134, 135, 'VTAAAA', 'IEKAAA', 'AAAAxx'),
+(2213, 6873, 1, 1, 3, 13, 13, 213, 213, 2213, 2213, 26, 27, 'DHAAAA', 'JEKAAA', 'HHHHxx'),
+(8773, 6874, 1, 1, 3, 13, 73, 773, 773, 3773, 8773, 146, 147, 'LZAAAA', 'KEKAAA', 'OOOOxx'),
+(1784, 6875, 0, 0, 4, 4, 84, 784, 1784, 1784, 1784, 168, 169, 'QQAAAA', 'LEKAAA', 'VVVVxx'),
+(5961, 6876, 1, 1, 1, 1, 61, 961, 1961, 961, 5961, 122, 123, 'HVAAAA', 'MEKAAA', 'AAAAxx'),
+(8801, 6877, 1, 1, 1, 1, 1, 801, 801, 3801, 8801, 2, 3, 'NAAAAA', 'NEKAAA', 'HHHHxx'),
+(4860, 6878, 0, 0, 0, 0, 60, 860, 860, 4860, 4860, 120, 121, 'YEAAAA', 'OEKAAA', 'OOOOxx'),
+(2214, 6879, 0, 2, 4, 14, 14, 214, 214, 2214, 2214, 28, 29, 'EHAAAA', 'PEKAAA', 'VVVVxx'),
+(1735, 6880, 1, 3, 5, 15, 35, 735, 1735, 1735, 1735, 70, 71, 'TOAAAA', 'QEKAAA', 'AAAAxx'),
+(578, 6881, 0, 2, 8, 18, 78, 578, 578, 578, 578, 156, 157, 'GWAAAA', 'REKAAA', 'HHHHxx'),
+(7853, 6882, 1, 1, 3, 13, 53, 853, 1853, 2853, 7853, 106, 107, 'BQAAAA', 'SEKAAA', 'OOOOxx'),
+(2215, 6883, 1, 3, 5, 15, 15, 215, 215, 2215, 2215, 30, 31, 'FHAAAA', 'TEKAAA', 'VVVVxx'),
+(4704, 6884, 0, 0, 4, 4, 4, 704, 704, 4704, 4704, 8, 9, 'YYAAAA', 'UEKAAA', 'AAAAxx'),
+(9379, 6885, 1, 3, 9, 19, 79, 379, 1379, 4379, 9379, 158, 159, 'TWAAAA', 'VEKAAA', 'HHHHxx'),
+(9745, 6886, 1, 1, 5, 5, 45, 745, 1745, 4745, 9745, 90, 91, 'VKAAAA', 'WEKAAA', 'OOOOxx'),
+(5636, 6887, 0, 0, 6, 16, 36, 636, 1636, 636, 5636, 72, 73, 'UIAAAA', 'XEKAAA', 'VVVVxx'),
+(4548, 6888, 0, 0, 8, 8, 48, 548, 548, 4548, 4548, 96, 97, 'YSAAAA', 'YEKAAA', 'AAAAxx'),
+(6537, 6889, 1, 1, 7, 17, 37, 537, 537, 1537, 6537, 74, 75, 'LRAAAA', 'ZEKAAA', 'HHHHxx'),
+(7748, 6890, 0, 0, 8, 8, 48, 748, 1748, 2748, 7748, 96, 97, 'AMAAAA', 'AFKAAA', 'OOOOxx'),
+(687, 6891, 1, 3, 7, 7, 87, 687, 687, 687, 687, 174, 175, 'LAAAAA', 'BFKAAA', 'VVVVxx'),
+(1243, 6892, 1, 3, 3, 3, 43, 243, 1243, 1243, 1243, 86, 87, 'VVAAAA', 'CFKAAA', 'AAAAxx'),
+(852, 6893, 0, 0, 2, 12, 52, 852, 852, 852, 852, 104, 105, 'UGAAAA', 'DFKAAA', 'HHHHxx'),
+(785, 6894, 1, 1, 5, 5, 85, 785, 785, 785, 785, 170, 171, 'FEAAAA', 'EFKAAA', 'OOOOxx'),
+(2002, 6895, 0, 2, 2, 2, 2, 2, 2, 2002, 2002, 4, 5, 'AZAAAA', 'FFKAAA', 'VVVVxx'),
+(2748, 6896, 0, 0, 8, 8, 48, 748, 748, 2748, 2748, 96, 97, 'SBAAAA', 'GFKAAA', 'AAAAxx'),
+(6075, 6897, 1, 3, 5, 15, 75, 75, 75, 1075, 6075, 150, 151, 'RZAAAA', 'HFKAAA', 'HHHHxx'),
+(7029, 6898, 1, 1, 9, 9, 29, 29, 1029, 2029, 7029, 58, 59, 'JKAAAA', 'IFKAAA', 'OOOOxx'),
+(7474, 6899, 0, 2, 4, 14, 74, 474, 1474, 2474, 7474, 148, 149, 'MBAAAA', 'JFKAAA', 'VVVVxx'),
+(7755, 6900, 1, 3, 5, 15, 55, 755, 1755, 2755, 7755, 110, 111, 'HMAAAA', 'KFKAAA', 'AAAAxx'),
+(1456, 6901, 0, 0, 6, 16, 56, 456, 1456, 1456, 1456, 112, 113, 'AEAAAA', 'LFKAAA', 'HHHHxx'),
+(2808, 6902, 0, 0, 8, 8, 8, 808, 808, 2808, 2808, 16, 17, 'AEAAAA', 'MFKAAA', 'OOOOxx'),
+(4089, 6903, 1, 1, 9, 9, 89, 89, 89, 4089, 4089, 178, 179, 'HBAAAA', 'NFKAAA', 'VVVVxx'),
+(4718, 6904, 0, 2, 8, 18, 18, 718, 718, 4718, 4718, 36, 37, 'MZAAAA', 'OFKAAA', 'AAAAxx'),
+(910, 6905, 0, 2, 0, 10, 10, 910, 910, 910, 910, 20, 21, 'AJAAAA', 'PFKAAA', 'HHHHxx'),
+(2868, 6906, 0, 0, 8, 8, 68, 868, 868, 2868, 2868, 136, 137, 'IGAAAA', 'QFKAAA', 'OOOOxx'),
+(2103, 6907, 1, 3, 3, 3, 3, 103, 103, 2103, 2103, 6, 7, 'XCAAAA', 'RFKAAA', 'VVVVxx'),
+(2407, 6908, 1, 3, 7, 7, 7, 407, 407, 2407, 2407, 14, 15, 'POAAAA', 'SFKAAA', 'AAAAxx'),
+(4353, 6909, 1, 1, 3, 13, 53, 353, 353, 4353, 4353, 106, 107, 'LLAAAA', 'TFKAAA', 'HHHHxx'),
+(7988, 6910, 0, 0, 8, 8, 88, 988, 1988, 2988, 7988, 176, 177, 'GVAAAA', 'UFKAAA', 'OOOOxx'),
+(2750, 6911, 0, 2, 0, 10, 50, 750, 750, 2750, 2750, 100, 101, 'UBAAAA', 'VFKAAA', 'VVVVxx'),
+(2006, 6912, 0, 2, 6, 6, 6, 6, 6, 2006, 2006, 12, 13, 'EZAAAA', 'WFKAAA', 'AAAAxx'),
+(4617, 6913, 1, 1, 7, 17, 17, 617, 617, 4617, 4617, 34, 35, 'PVAAAA', 'XFKAAA', 'HHHHxx'),
+(1251, 6914, 1, 3, 1, 11, 51, 251, 1251, 1251, 1251, 102, 103, 'DWAAAA', 'YFKAAA', 'OOOOxx'),
+(4590, 6915, 0, 2, 0, 10, 90, 590, 590, 4590, 4590, 180, 181, 'OUAAAA', 'ZFKAAA', 'VVVVxx'),
+(1144, 6916, 0, 0, 4, 4, 44, 144, 1144, 1144, 1144, 88, 89, 'ASAAAA', 'AGKAAA', 'AAAAxx'),
+(7131, 6917, 1, 3, 1, 11, 31, 131, 1131, 2131, 7131, 62, 63, 'HOAAAA', 'BGKAAA', 'HHHHxx'),
+(95, 6918, 1, 3, 5, 15, 95, 95, 95, 95, 95, 190, 191, 'RDAAAA', 'CGKAAA', 'OOOOxx'),
+(4827, 6919, 1, 3, 7, 7, 27, 827, 827, 4827, 4827, 54, 55, 'RDAAAA', 'DGKAAA', 'VVVVxx'),
+(4307, 6920, 1, 3, 7, 7, 7, 307, 307, 4307, 4307, 14, 15, 'RJAAAA', 'EGKAAA', 'AAAAxx'),
+(1505, 6921, 1, 1, 5, 5, 5, 505, 1505, 1505, 1505, 10, 11, 'XFAAAA', 'FGKAAA', 'HHHHxx'),
+(8191, 6922, 1, 3, 1, 11, 91, 191, 191, 3191, 8191, 182, 183, 'BDAAAA', 'GGKAAA', 'OOOOxx'),
+(5037, 6923, 1, 1, 7, 17, 37, 37, 1037, 37, 5037, 74, 75, 'TLAAAA', 'HGKAAA', 'VVVVxx'),
+(7363, 6924, 1, 3, 3, 3, 63, 363, 1363, 2363, 7363, 126, 127, 'FXAAAA', 'IGKAAA', 'AAAAxx'),
+(8427, 6925, 1, 3, 7, 7, 27, 427, 427, 3427, 8427, 54, 55, 'DMAAAA', 'JGKAAA', 'HHHHxx'),
+(5231, 6926, 1, 3, 1, 11, 31, 231, 1231, 231, 5231, 62, 63, 'FTAAAA', 'KGKAAA', 'OOOOxx'),
+(2943, 6927, 1, 3, 3, 3, 43, 943, 943, 2943, 2943, 86, 87, 'FJAAAA', 'LGKAAA', 'VVVVxx'),
+(4624, 6928, 0, 0, 4, 4, 24, 624, 624, 4624, 4624, 48, 49, 'WVAAAA', 'MGKAAA', 'AAAAxx'),
+(2020, 6929, 0, 0, 0, 0, 20, 20, 20, 2020, 2020, 40, 41, 'SZAAAA', 'NGKAAA', 'HHHHxx'),
+(6155, 6930, 1, 3, 5, 15, 55, 155, 155, 1155, 6155, 110, 111, 'TCAAAA', 'OGKAAA', 'OOOOxx'),
+(4381, 6931, 1, 1, 1, 1, 81, 381, 381, 4381, 4381, 162, 163, 'NMAAAA', 'PGKAAA', 'VVVVxx'),
+(1057, 6932, 1, 1, 7, 17, 57, 57, 1057, 1057, 1057, 114, 115, 'ROAAAA', 'QGKAAA', 'AAAAxx'),
+(9010, 6933, 0, 2, 0, 10, 10, 10, 1010, 4010, 9010, 20, 21, 'OIAAAA', 'RGKAAA', 'HHHHxx'),
+(4947, 6934, 1, 3, 7, 7, 47, 947, 947, 4947, 4947, 94, 95, 'HIAAAA', 'SGKAAA', 'OOOOxx'),
+(335, 6935, 1, 3, 5, 15, 35, 335, 335, 335, 335, 70, 71, 'XMAAAA', 'TGKAAA', 'VVVVxx'),
+(6890, 6936, 0, 2, 0, 10, 90, 890, 890, 1890, 6890, 180, 181, 'AFAAAA', 'UGKAAA', 'AAAAxx'),
+(5070, 6937, 0, 2, 0, 10, 70, 70, 1070, 70, 5070, 140, 141, 'ANAAAA', 'VGKAAA', 'HHHHxx'),
+(5270, 6938, 0, 2, 0, 10, 70, 270, 1270, 270, 5270, 140, 141, 'SUAAAA', 'WGKAAA', 'OOOOxx'),
+(8657, 6939, 1, 1, 7, 17, 57, 657, 657, 3657, 8657, 114, 115, 'ZUAAAA', 'XGKAAA', 'VVVVxx'),
+(7625, 6940, 1, 1, 5, 5, 25, 625, 1625, 2625, 7625, 50, 51, 'HHAAAA', 'YGKAAA', 'AAAAxx'),
+(5759, 6941, 1, 3, 9, 19, 59, 759, 1759, 759, 5759, 118, 119, 'NNAAAA', 'ZGKAAA', 'HHHHxx'),
+(9483, 6942, 1, 3, 3, 3, 83, 483, 1483, 4483, 9483, 166, 167, 'TAAAAA', 'AHKAAA', 'OOOOxx'),
+(8304, 6943, 0, 0, 4, 4, 4, 304, 304, 3304, 8304, 8, 9, 'KHAAAA', 'BHKAAA', 'VVVVxx'),
+(296, 6944, 0, 0, 6, 16, 96, 296, 296, 296, 296, 192, 193, 'KLAAAA', 'CHKAAA', 'AAAAxx'),
+(1176, 6945, 0, 0, 6, 16, 76, 176, 1176, 1176, 1176, 152, 153, 'GTAAAA', 'DHKAAA', 'HHHHxx'),
+(2069, 6946, 1, 1, 9, 9, 69, 69, 69, 2069, 2069, 138, 139, 'PBAAAA', 'EHKAAA', 'OOOOxx'),
+(1531, 6947, 1, 3, 1, 11, 31, 531, 1531, 1531, 1531, 62, 63, 'XGAAAA', 'FHKAAA', 'VVVVxx'),
+(5329, 6948, 1, 1, 9, 9, 29, 329, 1329, 329, 5329, 58, 59, 'ZWAAAA', 'GHKAAA', 'AAAAxx'),
+(3702, 6949, 0, 2, 2, 2, 2, 702, 1702, 3702, 3702, 4, 5, 'KMAAAA', 'HHKAAA', 'HHHHxx'),
+(6520, 6950, 0, 0, 0, 0, 20, 520, 520, 1520, 6520, 40, 41, 'UQAAAA', 'IHKAAA', 'OOOOxx'),
+(7310, 6951, 0, 2, 0, 10, 10, 310, 1310, 2310, 7310, 20, 21, 'EVAAAA', 'JHKAAA', 'VVVVxx'),
+(1175, 6952, 1, 3, 5, 15, 75, 175, 1175, 1175, 1175, 150, 151, 'FTAAAA', 'KHKAAA', 'AAAAxx'),
+(9107, 6953, 1, 3, 7, 7, 7, 107, 1107, 4107, 9107, 14, 15, 'HMAAAA', 'LHKAAA', 'HHHHxx'),
+(2737, 6954, 1, 1, 7, 17, 37, 737, 737, 2737, 2737, 74, 75, 'HBAAAA', 'MHKAAA', 'OOOOxx'),
+(3437, 6955, 1, 1, 7, 17, 37, 437, 1437, 3437, 3437, 74, 75, 'FCAAAA', 'NHKAAA', 'VVVVxx'),
+(281, 6956, 1, 1, 1, 1, 81, 281, 281, 281, 281, 162, 163, 'VKAAAA', 'OHKAAA', 'AAAAxx'),
+(6676, 6957, 0, 0, 6, 16, 76, 676, 676, 1676, 6676, 152, 153, 'UWAAAA', 'PHKAAA', 'HHHHxx'),
+(145, 6958, 1, 1, 5, 5, 45, 145, 145, 145, 145, 90, 91, 'PFAAAA', 'QHKAAA', 'OOOOxx'),
+(3172, 6959, 0, 0, 2, 12, 72, 172, 1172, 3172, 3172, 144, 145, 'ASAAAA', 'RHKAAA', 'VVVVxx'),
+(4049, 6960, 1, 1, 9, 9, 49, 49, 49, 4049, 4049, 98, 99, 'TZAAAA', 'SHKAAA', 'AAAAxx'),
+(6042, 6961, 0, 2, 2, 2, 42, 42, 42, 1042, 6042, 84, 85, 'KYAAAA', 'THKAAA', 'HHHHxx'),
+(9122, 6962, 0, 2, 2, 2, 22, 122, 1122, 4122, 9122, 44, 45, 'WMAAAA', 'UHKAAA', 'OOOOxx'),
+(7244, 6963, 0, 0, 4, 4, 44, 244, 1244, 2244, 7244, 88, 89, 'QSAAAA', 'VHKAAA', 'VVVVxx'),
+(5361, 6964, 1, 1, 1, 1, 61, 361, 1361, 361, 5361, 122, 123, 'FYAAAA', 'WHKAAA', 'AAAAxx'),
+(8647, 6965, 1, 3, 7, 7, 47, 647, 647, 3647, 8647, 94, 95, 'PUAAAA', 'XHKAAA', 'HHHHxx'),
+(7956, 6966, 0, 0, 6, 16, 56, 956, 1956, 2956, 7956, 112, 113, 'AUAAAA', 'YHKAAA', 'OOOOxx'),
+(7812, 6967, 0, 0, 2, 12, 12, 812, 1812, 2812, 7812, 24, 25, 'MOAAAA', 'ZHKAAA', 'VVVVxx'),
+(570, 6968, 0, 2, 0, 10, 70, 570, 570, 570, 570, 140, 141, 'YVAAAA', 'AIKAAA', 'AAAAxx'),
+(4115, 6969, 1, 3, 5, 15, 15, 115, 115, 4115, 4115, 30, 31, 'HCAAAA', 'BIKAAA', 'HHHHxx'),
+(1856, 6970, 0, 0, 6, 16, 56, 856, 1856, 1856, 1856, 112, 113, 'KTAAAA', 'CIKAAA', 'OOOOxx'),
+(9582, 6971, 0, 2, 2, 2, 82, 582, 1582, 4582, 9582, 164, 165, 'OEAAAA', 'DIKAAA', 'VVVVxx'),
+(2025, 6972, 1, 1, 5, 5, 25, 25, 25, 2025, 2025, 50, 51, 'XZAAAA', 'EIKAAA', 'AAAAxx'),
+(986, 6973, 0, 2, 6, 6, 86, 986, 986, 986, 986, 172, 173, 'YLAAAA', 'FIKAAA', 'HHHHxx'),
+(8358, 6974, 0, 2, 8, 18, 58, 358, 358, 3358, 8358, 116, 117, 'MJAAAA', 'GIKAAA', 'OOOOxx'),
+(510, 6975, 0, 2, 0, 10, 10, 510, 510, 510, 510, 20, 21, 'QTAAAA', 'HIKAAA', 'VVVVxx'),
+(6101, 6976, 1, 1, 1, 1, 1, 101, 101, 1101, 6101, 2, 3, 'RAAAAA', 'IIKAAA', 'AAAAxx'),
+(4167, 6977, 1, 3, 7, 7, 67, 167, 167, 4167, 4167, 134, 135, 'HEAAAA', 'JIKAAA', 'HHHHxx'),
+(6139, 6978, 1, 3, 9, 19, 39, 139, 139, 1139, 6139, 78, 79, 'DCAAAA', 'KIKAAA', 'OOOOxx'),
+(6912, 6979, 0, 0, 2, 12, 12, 912, 912, 1912, 6912, 24, 25, 'WFAAAA', 'LIKAAA', 'VVVVxx'),
+(339, 6980, 1, 3, 9, 19, 39, 339, 339, 339, 339, 78, 79, 'BNAAAA', 'MIKAAA', 'AAAAxx'),
+(8759, 6981, 1, 3, 9, 19, 59, 759, 759, 3759, 8759, 118, 119, 'XYAAAA', 'NIKAAA', 'HHHHxx'),
+(246, 6982, 0, 2, 6, 6, 46, 246, 246, 246, 246, 92, 93, 'MJAAAA', 'OIKAAA', 'OOOOxx'),
+(2831, 6983, 1, 3, 1, 11, 31, 831, 831, 2831, 2831, 62, 63, 'XEAAAA', 'PIKAAA', 'VVVVxx'),
+(2327, 6984, 1, 3, 7, 7, 27, 327, 327, 2327, 2327, 54, 55, 'NLAAAA', 'QIKAAA', 'AAAAxx'),
+(7001, 6985, 1, 1, 1, 1, 1, 1, 1001, 2001, 7001, 2, 3, 'HJAAAA', 'RIKAAA', 'HHHHxx'),
+(4398, 6986, 0, 2, 8, 18, 98, 398, 398, 4398, 4398, 196, 197, 'ENAAAA', 'SIKAAA', 'OOOOxx'),
+(1495, 6987, 1, 3, 5, 15, 95, 495, 1495, 1495, 1495, 190, 191, 'NFAAAA', 'TIKAAA', 'VVVVxx'),
+(8522, 6988, 0, 2, 2, 2, 22, 522, 522, 3522, 8522, 44, 45, 'UPAAAA', 'UIKAAA', 'AAAAxx'),
+(7090, 6989, 0, 2, 0, 10, 90, 90, 1090, 2090, 7090, 180, 181, 'SMAAAA', 'VIKAAA', 'HHHHxx'),
+(8457, 6990, 1, 1, 7, 17, 57, 457, 457, 3457, 8457, 114, 115, 'HNAAAA', 'WIKAAA', 'OOOOxx'),
+(4238, 6991, 0, 2, 8, 18, 38, 238, 238, 4238, 4238, 76, 77, 'AHAAAA', 'XIKAAA', 'VVVVxx'),
+(6791, 6992, 1, 3, 1, 11, 91, 791, 791, 1791, 6791, 182, 183, 'FBAAAA', 'YIKAAA', 'AAAAxx'),
+(1342, 6993, 0, 2, 2, 2, 42, 342, 1342, 1342, 1342, 84, 85, 'QZAAAA', 'ZIKAAA', 'HHHHxx'),
+(4580, 6994, 0, 0, 0, 0, 80, 580, 580, 4580, 4580, 160, 161, 'EUAAAA', 'AJKAAA', 'OOOOxx'),
+(1475, 6995, 1, 3, 5, 15, 75, 475, 1475, 1475, 1475, 150, 151, 'TEAAAA', 'BJKAAA', 'VVVVxx'),
+(9184, 6996, 0, 0, 4, 4, 84, 184, 1184, 4184, 9184, 168, 169, 'GPAAAA', 'CJKAAA', 'AAAAxx'),
+(1189, 6997, 1, 1, 9, 9, 89, 189, 1189, 1189, 1189, 178, 179, 'TTAAAA', 'DJKAAA', 'HHHHxx'),
+(638, 6998, 0, 2, 8, 18, 38, 638, 638, 638, 638, 76, 77, 'OYAAAA', 'EJKAAA', 'OOOOxx'),
+(5867, 6999, 1, 3, 7, 7, 67, 867, 1867, 867, 5867, 134, 135, 'RRAAAA', 'FJKAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(9911, 7000, 1, 3, 1, 11, 11, 911, 1911, 4911, 9911, 22, 23, 'FRAAAA', 'GJKAAA', 'AAAAxx'),
+(8147, 7001, 1, 3, 7, 7, 47, 147, 147, 3147, 8147, 94, 95, 'JBAAAA', 'HJKAAA', 'HHHHxx'),
+(4492, 7002, 0, 0, 2, 12, 92, 492, 492, 4492, 4492, 184, 185, 'UQAAAA', 'IJKAAA', 'OOOOxx'),
+(385, 7003, 1, 1, 5, 5, 85, 385, 385, 385, 385, 170, 171, 'VOAAAA', 'JJKAAA', 'VVVVxx'),
+(5235, 7004, 1, 3, 5, 15, 35, 235, 1235, 235, 5235, 70, 71, 'JTAAAA', 'KJKAAA', 'AAAAxx'),
+(4812, 7005, 0, 0, 2, 12, 12, 812, 812, 4812, 4812, 24, 25, 'CDAAAA', 'LJKAAA', 'HHHHxx'),
+(9807, 7006, 1, 3, 7, 7, 7, 807, 1807, 4807, 9807, 14, 15, 'FNAAAA', 'MJKAAA', 'OOOOxx'),
+(9588, 7007, 0, 0, 8, 8, 88, 588, 1588, 4588, 9588, 176, 177, 'UEAAAA', 'NJKAAA', 'VVVVxx'),
+(9832, 7008, 0, 0, 2, 12, 32, 832, 1832, 4832, 9832, 64, 65, 'EOAAAA', 'OJKAAA', 'AAAAxx'),
+(3757, 7009, 1, 1, 7, 17, 57, 757, 1757, 3757, 3757, 114, 115, 'NOAAAA', 'PJKAAA', 'HHHHxx'),
+(9703, 7010, 1, 3, 3, 3, 3, 703, 1703, 4703, 9703, 6, 7, 'FJAAAA', 'QJKAAA', 'OOOOxx'),
+(1022, 7011, 0, 2, 2, 2, 22, 22, 1022, 1022, 1022, 44, 45, 'INAAAA', 'RJKAAA', 'VVVVxx'),
+(5165, 7012, 1, 1, 5, 5, 65, 165, 1165, 165, 5165, 130, 131, 'RQAAAA', 'SJKAAA', 'AAAAxx'),
+(7129, 7013, 1, 1, 9, 9, 29, 129, 1129, 2129, 7129, 58, 59, 'FOAAAA', 'TJKAAA', 'HHHHxx'),
+(4164, 7014, 0, 0, 4, 4, 64, 164, 164, 4164, 4164, 128, 129, 'EEAAAA', 'UJKAAA', 'OOOOxx'),
+(7239, 7015, 1, 3, 9, 19, 39, 239, 1239, 2239, 7239, 78, 79, 'LSAAAA', 'VJKAAA', 'VVVVxx'),
+(523, 7016, 1, 3, 3, 3, 23, 523, 523, 523, 523, 46, 47, 'DUAAAA', 'WJKAAA', 'AAAAxx'),
+(4670, 7017, 0, 2, 0, 10, 70, 670, 670, 4670, 4670, 140, 141, 'QXAAAA', 'XJKAAA', 'HHHHxx'),
+(8503, 7018, 1, 3, 3, 3, 3, 503, 503, 3503, 8503, 6, 7, 'BPAAAA', 'YJKAAA', 'OOOOxx'),
+(714, 7019, 0, 2, 4, 14, 14, 714, 714, 714, 714, 28, 29, 'MBAAAA', 'ZJKAAA', 'VVVVxx'),
+(1350, 7020, 0, 2, 0, 10, 50, 350, 1350, 1350, 1350, 100, 101, 'YZAAAA', 'AKKAAA', 'AAAAxx'),
+(8318, 7021, 0, 2, 8, 18, 18, 318, 318, 3318, 8318, 36, 37, 'YHAAAA', 'BKKAAA', 'HHHHxx'),
+(1834, 7022, 0, 2, 4, 14, 34, 834, 1834, 1834, 1834, 68, 69, 'OSAAAA', 'CKKAAA', 'OOOOxx'),
+(4306, 7023, 0, 2, 6, 6, 6, 306, 306, 4306, 4306, 12, 13, 'QJAAAA', 'DKKAAA', 'VVVVxx'),
+(8543, 7024, 1, 3, 3, 3, 43, 543, 543, 3543, 8543, 86, 87, 'PQAAAA', 'EKKAAA', 'AAAAxx'),
+(9397, 7025, 1, 1, 7, 17, 97, 397, 1397, 4397, 9397, 194, 195, 'LXAAAA', 'FKKAAA', 'HHHHxx'),
+(3145, 7026, 1, 1, 5, 5, 45, 145, 1145, 3145, 3145, 90, 91, 'ZQAAAA', 'GKKAAA', 'OOOOxx'),
+(3942, 7027, 0, 2, 2, 2, 42, 942, 1942, 3942, 3942, 84, 85, 'QVAAAA', 'HKKAAA', 'VVVVxx'),
+(8583, 7028, 1, 3, 3, 3, 83, 583, 583, 3583, 8583, 166, 167, 'DSAAAA', 'IKKAAA', 'AAAAxx'),
+(8073, 7029, 1, 1, 3, 13, 73, 73, 73, 3073, 8073, 146, 147, 'NYAAAA', 'JKKAAA', 'HHHHxx'),
+(4940, 7030, 0, 0, 0, 0, 40, 940, 940, 4940, 4940, 80, 81, 'AIAAAA', 'KKKAAA', 'OOOOxx'),
+(9573, 7031, 1, 1, 3, 13, 73, 573, 1573, 4573, 9573, 146, 147, 'FEAAAA', 'LKKAAA', 'VVVVxx'),
+(5325, 7032, 1, 1, 5, 5, 25, 325, 1325, 325, 5325, 50, 51, 'VWAAAA', 'MKKAAA', 'AAAAxx'),
+(1833, 7033, 1, 1, 3, 13, 33, 833, 1833, 1833, 1833, 66, 67, 'NSAAAA', 'NKKAAA', 'HHHHxx'),
+(1337, 7034, 1, 1, 7, 17, 37, 337, 1337, 1337, 1337, 74, 75, 'LZAAAA', 'OKKAAA', 'OOOOxx'),
+(9749, 7035, 1, 1, 9, 9, 49, 749, 1749, 4749, 9749, 98, 99, 'ZKAAAA', 'PKKAAA', 'VVVVxx'),
+(7505, 7036, 1, 1, 5, 5, 5, 505, 1505, 2505, 7505, 10, 11, 'RCAAAA', 'QKKAAA', 'AAAAxx'),
+(9731, 7037, 1, 3, 1, 11, 31, 731, 1731, 4731, 9731, 62, 63, 'HKAAAA', 'RKKAAA', 'HHHHxx'),
+(4098, 7038, 0, 2, 8, 18, 98, 98, 98, 4098, 4098, 196, 197, 'QBAAAA', 'SKKAAA', 'OOOOxx'),
+(1418, 7039, 0, 2, 8, 18, 18, 418, 1418, 1418, 1418, 36, 37, 'OCAAAA', 'TKKAAA', 'VVVVxx'),
+(63, 7040, 1, 3, 3, 3, 63, 63, 63, 63, 63, 126, 127, 'LCAAAA', 'UKKAAA', 'AAAAxx'),
+(9889, 7041, 1, 1, 9, 9, 89, 889, 1889, 4889, 9889, 178, 179, 'JQAAAA', 'VKKAAA', 'HHHHxx'),
+(2871, 7042, 1, 3, 1, 11, 71, 871, 871, 2871, 2871, 142, 143, 'LGAAAA', 'WKKAAA', 'OOOOxx'),
+(1003, 7043, 1, 3, 3, 3, 3, 3, 1003, 1003, 1003, 6, 7, 'PMAAAA', 'XKKAAA', 'VVVVxx'),
+(8796, 7044, 0, 0, 6, 16, 96, 796, 796, 3796, 8796, 192, 193, 'IAAAAA', 'YKKAAA', 'AAAAxx'),
+(22, 7045, 0, 2, 2, 2, 22, 22, 22, 22, 22, 44, 45, 'WAAAAA', 'ZKKAAA', 'HHHHxx'),
+(8244, 7046, 0, 0, 4, 4, 44, 244, 244, 3244, 8244, 88, 89, 'CFAAAA', 'ALKAAA', 'OOOOxx'),
+(2282, 7047, 0, 2, 2, 2, 82, 282, 282, 2282, 2282, 164, 165, 'UJAAAA', 'BLKAAA', 'VVVVxx'),
+(3487, 7048, 1, 3, 7, 7, 87, 487, 1487, 3487, 3487, 174, 175, 'DEAAAA', 'CLKAAA', 'AAAAxx'),
+(8633, 7049, 1, 1, 3, 13, 33, 633, 633, 3633, 8633, 66, 67, 'BUAAAA', 'DLKAAA', 'HHHHxx'),
+(6418, 7050, 0, 2, 8, 18, 18, 418, 418, 1418, 6418, 36, 37, 'WMAAAA', 'ELKAAA', 'OOOOxx'),
+(4682, 7051, 0, 2, 2, 2, 82, 682, 682, 4682, 4682, 164, 165, 'CYAAAA', 'FLKAAA', 'VVVVxx'),
+(4103, 7052, 1, 3, 3, 3, 3, 103, 103, 4103, 4103, 6, 7, 'VBAAAA', 'GLKAAA', 'AAAAxx'),
+(6256, 7053, 0, 0, 6, 16, 56, 256, 256, 1256, 6256, 112, 113, 'QGAAAA', 'HLKAAA', 'HHHHxx'),
+(4040, 7054, 0, 0, 0, 0, 40, 40, 40, 4040, 4040, 80, 81, 'KZAAAA', 'ILKAAA', 'OOOOxx'),
+(9342, 7055, 0, 2, 2, 2, 42, 342, 1342, 4342, 9342, 84, 85, 'IVAAAA', 'JLKAAA', 'VVVVxx'),
+(9969, 7056, 1, 1, 9, 9, 69, 969, 1969, 4969, 9969, 138, 139, 'LTAAAA', 'KLKAAA', 'AAAAxx'),
+(223, 7057, 1, 3, 3, 3, 23, 223, 223, 223, 223, 46, 47, 'PIAAAA', 'LLKAAA', 'HHHHxx'),
+(4593, 7058, 1, 1, 3, 13, 93, 593, 593, 4593, 4593, 186, 187, 'RUAAAA', 'MLKAAA', 'OOOOxx'),
+(44, 7059, 0, 0, 4, 4, 44, 44, 44, 44, 44, 88, 89, 'SBAAAA', 'NLKAAA', 'VVVVxx'),
+(3513, 7060, 1, 1, 3, 13, 13, 513, 1513, 3513, 3513, 26, 27, 'DFAAAA', 'OLKAAA', 'AAAAxx'),
+(5771, 7061, 1, 3, 1, 11, 71, 771, 1771, 771, 5771, 142, 143, 'ZNAAAA', 'PLKAAA', 'HHHHxx'),
+(5083, 7062, 1, 3, 3, 3, 83, 83, 1083, 83, 5083, 166, 167, 'NNAAAA', 'QLKAAA', 'OOOOxx'),
+(3839, 7063, 1, 3, 9, 19, 39, 839, 1839, 3839, 3839, 78, 79, 'RRAAAA', 'RLKAAA', 'VVVVxx'),
+(2986, 7064, 0, 2, 6, 6, 86, 986, 986, 2986, 2986, 172, 173, 'WKAAAA', 'SLKAAA', 'AAAAxx'),
+(2200, 7065, 0, 0, 0, 0, 0, 200, 200, 2200, 2200, 0, 1, 'QGAAAA', 'TLKAAA', 'HHHHxx'),
+(197, 7066, 1, 1, 7, 17, 97, 197, 197, 197, 197, 194, 195, 'PHAAAA', 'ULKAAA', 'OOOOxx'),
+(7455, 7067, 1, 3, 5, 15, 55, 455, 1455, 2455, 7455, 110, 111, 'TAAAAA', 'VLKAAA', 'VVVVxx'),
+(1379, 7068, 1, 3, 9, 19, 79, 379, 1379, 1379, 1379, 158, 159, 'BBAAAA', 'WLKAAA', 'AAAAxx'),
+(4356, 7069, 0, 0, 6, 16, 56, 356, 356, 4356, 4356, 112, 113, 'OLAAAA', 'XLKAAA', 'HHHHxx'),
+(6888, 7070, 0, 0, 8, 8, 88, 888, 888, 1888, 6888, 176, 177, 'YEAAAA', 'YLKAAA', 'OOOOxx'),
+(9139, 7071, 1, 3, 9, 19, 39, 139, 1139, 4139, 9139, 78, 79, 'NNAAAA', 'ZLKAAA', 'VVVVxx'),
+(7682, 7072, 0, 2, 2, 2, 82, 682, 1682, 2682, 7682, 164, 165, 'MJAAAA', 'AMKAAA', 'AAAAxx'),
+(4873, 7073, 1, 1, 3, 13, 73, 873, 873, 4873, 4873, 146, 147, 'LFAAAA', 'BMKAAA', 'HHHHxx'),
+(783, 7074, 1, 3, 3, 3, 83, 783, 783, 783, 783, 166, 167, 'DEAAAA', 'CMKAAA', 'OOOOxx'),
+(6071, 7075, 1, 3, 1, 11, 71, 71, 71, 1071, 6071, 142, 143, 'NZAAAA', 'DMKAAA', 'VVVVxx'),
+(5160, 7076, 0, 0, 0, 0, 60, 160, 1160, 160, 5160, 120, 121, 'MQAAAA', 'EMKAAA', 'AAAAxx'),
+(2291, 7077, 1, 3, 1, 11, 91, 291, 291, 2291, 2291, 182, 183, 'DKAAAA', 'FMKAAA', 'HHHHxx'),
+(187, 7078, 1, 3, 7, 7, 87, 187, 187, 187, 187, 174, 175, 'FHAAAA', 'GMKAAA', 'OOOOxx'),
+(7786, 7079, 0, 2, 6, 6, 86, 786, 1786, 2786, 7786, 172, 173, 'MNAAAA', 'HMKAAA', 'VVVVxx'),
+(3432, 7080, 0, 0, 2, 12, 32, 432, 1432, 3432, 3432, 64, 65, 'ACAAAA', 'IMKAAA', 'AAAAxx'),
+(5450, 7081, 0, 2, 0, 10, 50, 450, 1450, 450, 5450, 100, 101, 'QBAAAA', 'JMKAAA', 'HHHHxx'),
+(2699, 7082, 1, 3, 9, 19, 99, 699, 699, 2699, 2699, 198, 199, 'VZAAAA', 'KMKAAA', 'OOOOxx'),
+(692, 7083, 0, 0, 2, 12, 92, 692, 692, 692, 692, 184, 185, 'QAAAAA', 'LMKAAA', 'VVVVxx'),
+(6081, 7084, 1, 1, 1, 1, 81, 81, 81, 1081, 6081, 162, 163, 'XZAAAA', 'MMKAAA', 'AAAAxx'),
+(4829, 7085, 1, 1, 9, 9, 29, 829, 829, 4829, 4829, 58, 59, 'TDAAAA', 'NMKAAA', 'HHHHxx'),
+(238, 7086, 0, 2, 8, 18, 38, 238, 238, 238, 238, 76, 77, 'EJAAAA', 'OMKAAA', 'OOOOxx'),
+(9100, 7087, 0, 0, 0, 0, 0, 100, 1100, 4100, 9100, 0, 1, 'AMAAAA', 'PMKAAA', 'VVVVxx'),
+(1968, 7088, 0, 0, 8, 8, 68, 968, 1968, 1968, 1968, 136, 137, 'SXAAAA', 'QMKAAA', 'AAAAxx'),
+(1872, 7089, 0, 0, 2, 12, 72, 872, 1872, 1872, 1872, 144, 145, 'AUAAAA', 'RMKAAA', 'HHHHxx'),
+(7051, 7090, 1, 3, 1, 11, 51, 51, 1051, 2051, 7051, 102, 103, 'FLAAAA', 'SMKAAA', 'OOOOxx'),
+(2743, 7091, 1, 3, 3, 3, 43, 743, 743, 2743, 2743, 86, 87, 'NBAAAA', 'TMKAAA', 'VVVVxx'),
+(1237, 7092, 1, 1, 7, 17, 37, 237, 1237, 1237, 1237, 74, 75, 'PVAAAA', 'UMKAAA', 'AAAAxx'),
+(3052, 7093, 0, 0, 2, 12, 52, 52, 1052, 3052, 3052, 104, 105, 'KNAAAA', 'VMKAAA', 'HHHHxx'),
+(8021, 7094, 1, 1, 1, 1, 21, 21, 21, 3021, 8021, 42, 43, 'NWAAAA', 'WMKAAA', 'OOOOxx'),
+(657, 7095, 1, 1, 7, 17, 57, 657, 657, 657, 657, 114, 115, 'HZAAAA', 'XMKAAA', 'VVVVxx'),
+(2236, 7096, 0, 0, 6, 16, 36, 236, 236, 2236, 2236, 72, 73, 'AIAAAA', 'YMKAAA', 'AAAAxx'),
+(7011, 7097, 1, 3, 1, 11, 11, 11, 1011, 2011, 7011, 22, 23, 'RJAAAA', 'ZMKAAA', 'HHHHxx'),
+(4067, 7098, 1, 3, 7, 7, 67, 67, 67, 4067, 4067, 134, 135, 'LAAAAA', 'ANKAAA', 'OOOOxx'),
+(9449, 7099, 1, 1, 9, 9, 49, 449, 1449, 4449, 9449, 98, 99, 'LZAAAA', 'BNKAAA', 'VVVVxx'),
+(7428, 7100, 0, 0, 8, 8, 28, 428, 1428, 2428, 7428, 56, 57, 'SZAAAA', 'CNKAAA', 'AAAAxx'),
+(1272, 7101, 0, 0, 2, 12, 72, 272, 1272, 1272, 1272, 144, 145, 'YWAAAA', 'DNKAAA', 'HHHHxx'),
+(6897, 7102, 1, 1, 7, 17, 97, 897, 897, 1897, 6897, 194, 195, 'HFAAAA', 'ENKAAA', 'OOOOxx'),
+(5839, 7103, 1, 3, 9, 19, 39, 839, 1839, 839, 5839, 78, 79, 'PQAAAA', 'FNKAAA', 'VVVVxx'),
+(6835, 7104, 1, 3, 5, 15, 35, 835, 835, 1835, 6835, 70, 71, 'XCAAAA', 'GNKAAA', 'AAAAxx'),
+(1887, 7105, 1, 3, 7, 7, 87, 887, 1887, 1887, 1887, 174, 175, 'PUAAAA', 'HNKAAA', 'HHHHxx'),
+(1551, 7106, 1, 3, 1, 11, 51, 551, 1551, 1551, 1551, 102, 103, 'RHAAAA', 'INKAAA', 'OOOOxx'),
+(4667, 7107, 1, 3, 7, 7, 67, 667, 667, 4667, 4667, 134, 135, 'NXAAAA', 'JNKAAA', 'VVVVxx'),
+(9603, 7108, 1, 3, 3, 3, 3, 603, 1603, 4603, 9603, 6, 7, 'JFAAAA', 'KNKAAA', 'AAAAxx'),
+(4332, 7109, 0, 0, 2, 12, 32, 332, 332, 4332, 4332, 64, 65, 'QKAAAA', 'LNKAAA', 'HHHHxx'),
+(5681, 7110, 1, 1, 1, 1, 81, 681, 1681, 681, 5681, 162, 163, 'NKAAAA', 'MNKAAA', 'OOOOxx'),
+(8062, 7111, 0, 2, 2, 2, 62, 62, 62, 3062, 8062, 124, 125, 'CYAAAA', 'NNKAAA', 'VVVVxx'),
+(2302, 7112, 0, 2, 2, 2, 2, 302, 302, 2302, 2302, 4, 5, 'OKAAAA', 'ONKAAA', 'AAAAxx'),
+(2825, 7113, 1, 1, 5, 5, 25, 825, 825, 2825, 2825, 50, 51, 'REAAAA', 'PNKAAA', 'HHHHxx'),
+(4527, 7114, 1, 3, 7, 7, 27, 527, 527, 4527, 4527, 54, 55, 'DSAAAA', 'QNKAAA', 'OOOOxx'),
+(4230, 7115, 0, 2, 0, 10, 30, 230, 230, 4230, 4230, 60, 61, 'SGAAAA', 'RNKAAA', 'VVVVxx'),
+(3053, 7116, 1, 1, 3, 13, 53, 53, 1053, 3053, 3053, 106, 107, 'LNAAAA', 'SNKAAA', 'AAAAxx'),
+(983, 7117, 1, 3, 3, 3, 83, 983, 983, 983, 983, 166, 167, 'VLAAAA', 'TNKAAA', 'HHHHxx'),
+(9458, 7118, 0, 2, 8, 18, 58, 458, 1458, 4458, 9458, 116, 117, 'UZAAAA', 'UNKAAA', 'OOOOxx'),
+(4128, 7119, 0, 0, 8, 8, 28, 128, 128, 4128, 4128, 56, 57, 'UCAAAA', 'VNKAAA', 'VVVVxx'),
+(425, 7120, 1, 1, 5, 5, 25, 425, 425, 425, 425, 50, 51, 'JQAAAA', 'WNKAAA', 'AAAAxx'),
+(3911, 7121, 1, 3, 1, 11, 11, 911, 1911, 3911, 3911, 22, 23, 'LUAAAA', 'XNKAAA', 'HHHHxx'),
+(6607, 7122, 1, 3, 7, 7, 7, 607, 607, 1607, 6607, 14, 15, 'DUAAAA', 'YNKAAA', 'OOOOxx'),
+(5431, 7123, 1, 3, 1, 11, 31, 431, 1431, 431, 5431, 62, 63, 'XAAAAA', 'ZNKAAA', 'VVVVxx'),
+(6330, 7124, 0, 2, 0, 10, 30, 330, 330, 1330, 6330, 60, 61, 'MJAAAA', 'AOKAAA', 'AAAAxx'),
+(3592, 7125, 0, 0, 2, 12, 92, 592, 1592, 3592, 3592, 184, 185, 'EIAAAA', 'BOKAAA', 'HHHHxx'),
+(154, 7126, 0, 2, 4, 14, 54, 154, 154, 154, 154, 108, 109, 'YFAAAA', 'COKAAA', 'OOOOxx'),
+(9879, 7127, 1, 3, 9, 19, 79, 879, 1879, 4879, 9879, 158, 159, 'ZPAAAA', 'DOKAAA', 'VVVVxx'),
+(3202, 7128, 0, 2, 2, 2, 2, 202, 1202, 3202, 3202, 4, 5, 'ETAAAA', 'EOKAAA', 'AAAAxx'),
+(3056, 7129, 0, 0, 6, 16, 56, 56, 1056, 3056, 3056, 112, 113, 'ONAAAA', 'FOKAAA', 'HHHHxx'),
+(9890, 7130, 0, 2, 0, 10, 90, 890, 1890, 4890, 9890, 180, 181, 'KQAAAA', 'GOKAAA', 'OOOOxx'),
+(5840, 7131, 0, 0, 0, 0, 40, 840, 1840, 840, 5840, 80, 81, 'QQAAAA', 'HOKAAA', 'VVVVxx'),
+(9804, 7132, 0, 0, 4, 4, 4, 804, 1804, 4804, 9804, 8, 9, 'CNAAAA', 'IOKAAA', 'AAAAxx'),
+(681, 7133, 1, 1, 1, 1, 81, 681, 681, 681, 681, 162, 163, 'FAAAAA', 'JOKAAA', 'HHHHxx'),
+(3443, 7134, 1, 3, 3, 3, 43, 443, 1443, 3443, 3443, 86, 87, 'LCAAAA', 'KOKAAA', 'OOOOxx'),
+(8088, 7135, 0, 0, 8, 8, 88, 88, 88, 3088, 8088, 176, 177, 'CZAAAA', 'LOKAAA', 'VVVVxx'),
+(9447, 7136, 1, 3, 7, 7, 47, 447, 1447, 4447, 9447, 94, 95, 'JZAAAA', 'MOKAAA', 'AAAAxx'),
+(1490, 7137, 0, 2, 0, 10, 90, 490, 1490, 1490, 1490, 180, 181, 'IFAAAA', 'NOKAAA', 'HHHHxx'),
+(3684, 7138, 0, 0, 4, 4, 84, 684, 1684, 3684, 3684, 168, 169, 'SLAAAA', 'OOKAAA', 'OOOOxx'),
+(3113, 7139, 1, 1, 3, 13, 13, 113, 1113, 3113, 3113, 26, 27, 'TPAAAA', 'POKAAA', 'VVVVxx'),
+(9004, 7140, 0, 0, 4, 4, 4, 4, 1004, 4004, 9004, 8, 9, 'IIAAAA', 'QOKAAA', 'AAAAxx'),
+(7147, 7141, 1, 3, 7, 7, 47, 147, 1147, 2147, 7147, 94, 95, 'XOAAAA', 'ROKAAA', 'HHHHxx'),
+(7571, 7142, 1, 3, 1, 11, 71, 571, 1571, 2571, 7571, 142, 143, 'FFAAAA', 'SOKAAA', 'OOOOxx'),
+(5545, 7143, 1, 1, 5, 5, 45, 545, 1545, 545, 5545, 90, 91, 'HFAAAA', 'TOKAAA', 'VVVVxx'),
+(4558, 7144, 0, 2, 8, 18, 58, 558, 558, 4558, 4558, 116, 117, 'ITAAAA', 'UOKAAA', 'AAAAxx'),
+(6206, 7145, 0, 2, 6, 6, 6, 206, 206, 1206, 6206, 12, 13, 'SEAAAA', 'VOKAAA', 'HHHHxx'),
+(5695, 7146, 1, 3, 5, 15, 95, 695, 1695, 695, 5695, 190, 191, 'BLAAAA', 'WOKAAA', 'OOOOxx'),
+(9600, 7147, 0, 0, 0, 0, 0, 600, 1600, 4600, 9600, 0, 1, 'GFAAAA', 'XOKAAA', 'VVVVxx'),
+(5432, 7148, 0, 0, 2, 12, 32, 432, 1432, 432, 5432, 64, 65, 'YAAAAA', 'YOKAAA', 'AAAAxx'),
+(9299, 7149, 1, 3, 9, 19, 99, 299, 1299, 4299, 9299, 198, 199, 'RTAAAA', 'ZOKAAA', 'HHHHxx'),
+(2386, 7150, 0, 2, 6, 6, 86, 386, 386, 2386, 2386, 172, 173, 'UNAAAA', 'APKAAA', 'OOOOxx'),
+(2046, 7151, 0, 2, 6, 6, 46, 46, 46, 2046, 2046, 92, 93, 'SAAAAA', 'BPKAAA', 'VVVVxx'),
+(3293, 7152, 1, 1, 3, 13, 93, 293, 1293, 3293, 3293, 186, 187, 'RWAAAA', 'CPKAAA', 'AAAAxx'),
+(3046, 7153, 0, 2, 6, 6, 46, 46, 1046, 3046, 3046, 92, 93, 'ENAAAA', 'DPKAAA', 'HHHHxx'),
+(214, 7154, 0, 2, 4, 14, 14, 214, 214, 214, 214, 28, 29, 'GIAAAA', 'EPKAAA', 'OOOOxx'),
+(7893, 7155, 1, 1, 3, 13, 93, 893, 1893, 2893, 7893, 186, 187, 'PRAAAA', 'FPKAAA', 'VVVVxx'),
+(891, 7156, 1, 3, 1, 11, 91, 891, 891, 891, 891, 182, 183, 'HIAAAA', 'GPKAAA', 'AAAAxx'),
+(6499, 7157, 1, 3, 9, 19, 99, 499, 499, 1499, 6499, 198, 199, 'ZPAAAA', 'HPKAAA', 'HHHHxx'),
+(5003, 7158, 1, 3, 3, 3, 3, 3, 1003, 3, 5003, 6, 7, 'LKAAAA', 'IPKAAA', 'OOOOxx'),
+(6487, 7159, 1, 3, 7, 7, 87, 487, 487, 1487, 6487, 174, 175, 'NPAAAA', 'JPKAAA', 'VVVVxx'),
+(9403, 7160, 1, 3, 3, 3, 3, 403, 1403, 4403, 9403, 6, 7, 'RXAAAA', 'KPKAAA', 'AAAAxx'),
+(945, 7161, 1, 1, 5, 5, 45, 945, 945, 945, 945, 90, 91, 'JKAAAA', 'LPKAAA', 'HHHHxx'),
+(6713, 7162, 1, 1, 3, 13, 13, 713, 713, 1713, 6713, 26, 27, 'FYAAAA', 'MPKAAA', 'OOOOxx'),
+(9928, 7163, 0, 0, 8, 8, 28, 928, 1928, 4928, 9928, 56, 57, 'WRAAAA', 'NPKAAA', 'VVVVxx'),
+(8585, 7164, 1, 1, 5, 5, 85, 585, 585, 3585, 8585, 170, 171, 'FSAAAA', 'OPKAAA', 'AAAAxx'),
+(4004, 7165, 0, 0, 4, 4, 4, 4, 4, 4004, 4004, 8, 9, 'AYAAAA', 'PPKAAA', 'HHHHxx'),
+(2528, 7166, 0, 0, 8, 8, 28, 528, 528, 2528, 2528, 56, 57, 'GTAAAA', 'QPKAAA', 'OOOOxx'),
+(3350, 7167, 0, 2, 0, 10, 50, 350, 1350, 3350, 3350, 100, 101, 'WYAAAA', 'RPKAAA', 'VVVVxx'),
+(2160, 7168, 0, 0, 0, 0, 60, 160, 160, 2160, 2160, 120, 121, 'CFAAAA', 'SPKAAA', 'AAAAxx'),
+(1521, 7169, 1, 1, 1, 1, 21, 521, 1521, 1521, 1521, 42, 43, 'NGAAAA', 'TPKAAA', 'HHHHxx'),
+(5660, 7170, 0, 0, 0, 0, 60, 660, 1660, 660, 5660, 120, 121, 'SJAAAA', 'UPKAAA', 'OOOOxx'),
+(5755, 7171, 1, 3, 5, 15, 55, 755, 1755, 755, 5755, 110, 111, 'JNAAAA', 'VPKAAA', 'VVVVxx'),
+(7614, 7172, 0, 2, 4, 14, 14, 614, 1614, 2614, 7614, 28, 29, 'WGAAAA', 'WPKAAA', 'AAAAxx'),
+(3121, 7173, 1, 1, 1, 1, 21, 121, 1121, 3121, 3121, 42, 43, 'BQAAAA', 'XPKAAA', 'HHHHxx'),
+(2735, 7174, 1, 3, 5, 15, 35, 735, 735, 2735, 2735, 70, 71, 'FBAAAA', 'YPKAAA', 'OOOOxx'),
+(7506, 7175, 0, 2, 6, 6, 6, 506, 1506, 2506, 7506, 12, 13, 'SCAAAA', 'ZPKAAA', 'VVVVxx'),
+(2693, 7176, 1, 1, 3, 13, 93, 693, 693, 2693, 2693, 186, 187, 'PZAAAA', 'AQKAAA', 'AAAAxx'),
+(2892, 7177, 0, 0, 2, 12, 92, 892, 892, 2892, 2892, 184, 185, 'GHAAAA', 'BQKAAA', 'HHHHxx'),
+(3310, 7178, 0, 2, 0, 10, 10, 310, 1310, 3310, 3310, 20, 21, 'IXAAAA', 'CQKAAA', 'OOOOxx'),
+(3484, 7179, 0, 0, 4, 4, 84, 484, 1484, 3484, 3484, 168, 169, 'AEAAAA', 'DQKAAA', 'VVVVxx'),
+(9733, 7180, 1, 1, 3, 13, 33, 733, 1733, 4733, 9733, 66, 67, 'JKAAAA', 'EQKAAA', 'AAAAxx'),
+(29, 7181, 1, 1, 9, 9, 29, 29, 29, 29, 29, 58, 59, 'DBAAAA', 'FQKAAA', 'HHHHxx'),
+(9013, 7182, 1, 1, 3, 13, 13, 13, 1013, 4013, 9013, 26, 27, 'RIAAAA', 'GQKAAA', 'OOOOxx'),
+(3847, 7183, 1, 3, 7, 7, 47, 847, 1847, 3847, 3847, 94, 95, 'ZRAAAA', 'HQKAAA', 'VVVVxx'),
+(6724, 7184, 0, 0, 4, 4, 24, 724, 724, 1724, 6724, 48, 49, 'QYAAAA', 'IQKAAA', 'AAAAxx'),
+(2559, 7185, 1, 3, 9, 19, 59, 559, 559, 2559, 2559, 118, 119, 'LUAAAA', 'JQKAAA', 'HHHHxx'),
+(5326, 7186, 0, 2, 6, 6, 26, 326, 1326, 326, 5326, 52, 53, 'WWAAAA', 'KQKAAA', 'OOOOxx'),
+(4802, 7187, 0, 2, 2, 2, 2, 802, 802, 4802, 4802, 4, 5, 'SCAAAA', 'LQKAAA', 'VVVVxx'),
+(131, 7188, 1, 3, 1, 11, 31, 131, 131, 131, 131, 62, 63, 'BFAAAA', 'MQKAAA', 'AAAAxx'),
+(1634, 7189, 0, 2, 4, 14, 34, 634, 1634, 1634, 1634, 68, 69, 'WKAAAA', 'NQKAAA', 'HHHHxx'),
+(919, 7190, 1, 3, 9, 19, 19, 919, 919, 919, 919, 38, 39, 'JJAAAA', 'OQKAAA', 'OOOOxx'),
+(9575, 7191, 1, 3, 5, 15, 75, 575, 1575, 4575, 9575, 150, 151, 'HEAAAA', 'PQKAAA', 'VVVVxx'),
+(1256, 7192, 0, 0, 6, 16, 56, 256, 1256, 1256, 1256, 112, 113, 'IWAAAA', 'QQKAAA', 'AAAAxx'),
+(9428, 7193, 0, 0, 8, 8, 28, 428, 1428, 4428, 9428, 56, 57, 'QYAAAA', 'RQKAAA', 'HHHHxx'),
+(5121, 7194, 1, 1, 1, 1, 21, 121, 1121, 121, 5121, 42, 43, 'ZOAAAA', 'SQKAAA', 'OOOOxx'),
+(6584, 7195, 0, 0, 4, 4, 84, 584, 584, 1584, 6584, 168, 169, 'GTAAAA', 'TQKAAA', 'VVVVxx'),
+(7193, 7196, 1, 1, 3, 13, 93, 193, 1193, 2193, 7193, 186, 187, 'RQAAAA', 'UQKAAA', 'AAAAxx'),
+(4047, 7197, 1, 3, 7, 7, 47, 47, 47, 4047, 4047, 94, 95, 'RZAAAA', 'VQKAAA', 'HHHHxx'),
+(104, 7198, 0, 0, 4, 4, 4, 104, 104, 104, 104, 8, 9, 'AEAAAA', 'WQKAAA', 'OOOOxx'),
+(1527, 7199, 1, 3, 7, 7, 27, 527, 1527, 1527, 1527, 54, 55, 'TGAAAA', 'XQKAAA', 'VVVVxx'),
+(3460, 7200, 0, 0, 0, 0, 60, 460, 1460, 3460, 3460, 120, 121, 'CDAAAA', 'YQKAAA', 'AAAAxx'),
+(8526, 7201, 0, 2, 6, 6, 26, 526, 526, 3526, 8526, 52, 53, 'YPAAAA', 'ZQKAAA', 'HHHHxx'),
+(8959, 7202, 1, 3, 9, 19, 59, 959, 959, 3959, 8959, 118, 119, 'PGAAAA', 'ARKAAA', 'OOOOxx'),
+(3633, 7203, 1, 1, 3, 13, 33, 633, 1633, 3633, 3633, 66, 67, 'TJAAAA', 'BRKAAA', 'VVVVxx'),
+(1799, 7204, 1, 3, 9, 19, 99, 799, 1799, 1799, 1799, 198, 199, 'FRAAAA', 'CRKAAA', 'AAAAxx'),
+(461, 7205, 1, 1, 1, 1, 61, 461, 461, 461, 461, 122, 123, 'TRAAAA', 'DRKAAA', 'HHHHxx'),
+(718, 7206, 0, 2, 8, 18, 18, 718, 718, 718, 718, 36, 37, 'QBAAAA', 'ERKAAA', 'OOOOxx'),
+(3219, 7207, 1, 3, 9, 19, 19, 219, 1219, 3219, 3219, 38, 39, 'VTAAAA', 'FRKAAA', 'VVVVxx'),
+(3494, 7208, 0, 2, 4, 14, 94, 494, 1494, 3494, 3494, 188, 189, 'KEAAAA', 'GRKAAA', 'AAAAxx'),
+(9402, 7209, 0, 2, 2, 2, 2, 402, 1402, 4402, 9402, 4, 5, 'QXAAAA', 'HRKAAA', 'HHHHxx'),
+(7983, 7210, 1, 3, 3, 3, 83, 983, 1983, 2983, 7983, 166, 167, 'BVAAAA', 'IRKAAA', 'OOOOxx'),
+(7919, 7211, 1, 3, 9, 19, 19, 919, 1919, 2919, 7919, 38, 39, 'PSAAAA', 'JRKAAA', 'VVVVxx'),
+(8036, 7212, 0, 0, 6, 16, 36, 36, 36, 3036, 8036, 72, 73, 'CXAAAA', 'KRKAAA', 'AAAAxx'),
+(5164, 7213, 0, 0, 4, 4, 64, 164, 1164, 164, 5164, 128, 129, 'QQAAAA', 'LRKAAA', 'HHHHxx'),
+(4160, 7214, 0, 0, 0, 0, 60, 160, 160, 4160, 4160, 120, 121, 'AEAAAA', 'MRKAAA', 'OOOOxx'),
+(5370, 7215, 0, 2, 0, 10, 70, 370, 1370, 370, 5370, 140, 141, 'OYAAAA', 'NRKAAA', 'VVVVxx'),
+(5347, 7216, 1, 3, 7, 7, 47, 347, 1347, 347, 5347, 94, 95, 'RXAAAA', 'ORKAAA', 'AAAAxx'),
+(7109, 7217, 1, 1, 9, 9, 9, 109, 1109, 2109, 7109, 18, 19, 'LNAAAA', 'PRKAAA', 'HHHHxx'),
+(4826, 7218, 0, 2, 6, 6, 26, 826, 826, 4826, 4826, 52, 53, 'QDAAAA', 'QRKAAA', 'OOOOxx'),
+(1338, 7219, 0, 2, 8, 18, 38, 338, 1338, 1338, 1338, 76, 77, 'MZAAAA', 'RRKAAA', 'VVVVxx'),
+(2711, 7220, 1, 3, 1, 11, 11, 711, 711, 2711, 2711, 22, 23, 'HAAAAA', 'SRKAAA', 'AAAAxx'),
+(6299, 7221, 1, 3, 9, 19, 99, 299, 299, 1299, 6299, 198, 199, 'HIAAAA', 'TRKAAA', 'HHHHxx'),
+(1616, 7222, 0, 0, 6, 16, 16, 616, 1616, 1616, 1616, 32, 33, 'EKAAAA', 'URKAAA', 'OOOOxx'),
+(7519, 7223, 1, 3, 9, 19, 19, 519, 1519, 2519, 7519, 38, 39, 'FDAAAA', 'VRKAAA', 'VVVVxx'),
+(1262, 7224, 0, 2, 2, 2, 62, 262, 1262, 1262, 1262, 124, 125, 'OWAAAA', 'WRKAAA', 'AAAAxx'),
+(7228, 7225, 0, 0, 8, 8, 28, 228, 1228, 2228, 7228, 56, 57, 'ASAAAA', 'XRKAAA', 'HHHHxx'),
+(7892, 7226, 0, 0, 2, 12, 92, 892, 1892, 2892, 7892, 184, 185, 'ORAAAA', 'YRKAAA', 'OOOOxx'),
+(7929, 7227, 1, 1, 9, 9, 29, 929, 1929, 2929, 7929, 58, 59, 'ZSAAAA', 'ZRKAAA', 'VVVVxx'),
+(7705, 7228, 1, 1, 5, 5, 5, 705, 1705, 2705, 7705, 10, 11, 'JKAAAA', 'ASKAAA', 'AAAAxx'),
+(3111, 7229, 1, 3, 1, 11, 11, 111, 1111, 3111, 3111, 22, 23, 'RPAAAA', 'BSKAAA', 'HHHHxx'),
+(3066, 7230, 0, 2, 6, 6, 66, 66, 1066, 3066, 3066, 132, 133, 'YNAAAA', 'CSKAAA', 'OOOOxx'),
+(9559, 7231, 1, 3, 9, 19, 59, 559, 1559, 4559, 9559, 118, 119, 'RDAAAA', 'DSKAAA', 'VVVVxx'),
+(3787, 7232, 1, 3, 7, 7, 87, 787, 1787, 3787, 3787, 174, 175, 'RPAAAA', 'ESKAAA', 'AAAAxx'),
+(8710, 7233, 0, 2, 0, 10, 10, 710, 710, 3710, 8710, 20, 21, 'AXAAAA', 'FSKAAA', 'HHHHxx'),
+(4870, 7234, 0, 2, 0, 10, 70, 870, 870, 4870, 4870, 140, 141, 'IFAAAA', 'GSKAAA', 'OOOOxx'),
+(1883, 7235, 1, 3, 3, 3, 83, 883, 1883, 1883, 1883, 166, 167, 'LUAAAA', 'HSKAAA', 'VVVVxx'),
+(9689, 7236, 1, 1, 9, 9, 89, 689, 1689, 4689, 9689, 178, 179, 'RIAAAA', 'ISKAAA', 'AAAAxx'),
+(9491, 7237, 1, 3, 1, 11, 91, 491, 1491, 4491, 9491, 182, 183, 'BBAAAA', 'JSKAAA', 'HHHHxx'),
+(2035, 7238, 1, 3, 5, 15, 35, 35, 35, 2035, 2035, 70, 71, 'HAAAAA', 'KSKAAA', 'OOOOxx'),
+(655, 7239, 1, 3, 5, 15, 55, 655, 655, 655, 655, 110, 111, 'FZAAAA', 'LSKAAA', 'VVVVxx'),
+(6305, 7240, 1, 1, 5, 5, 5, 305, 305, 1305, 6305, 10, 11, 'NIAAAA', 'MSKAAA', 'AAAAxx'),
+(9423, 7241, 1, 3, 3, 3, 23, 423, 1423, 4423, 9423, 46, 47, 'LYAAAA', 'NSKAAA', 'HHHHxx'),
+(283, 7242, 1, 3, 3, 3, 83, 283, 283, 283, 283, 166, 167, 'XKAAAA', 'OSKAAA', 'OOOOxx'),
+(2607, 7243, 1, 3, 7, 7, 7, 607, 607, 2607, 2607, 14, 15, 'HWAAAA', 'PSKAAA', 'VVVVxx'),
+(7740, 7244, 0, 0, 0, 0, 40, 740, 1740, 2740, 7740, 80, 81, 'SLAAAA', 'QSKAAA', 'AAAAxx'),
+(6956, 7245, 0, 0, 6, 16, 56, 956, 956, 1956, 6956, 112, 113, 'OHAAAA', 'RSKAAA', 'HHHHxx'),
+(884, 7246, 0, 0, 4, 4, 84, 884, 884, 884, 884, 168, 169, 'AIAAAA', 'SSKAAA', 'OOOOxx'),
+(5730, 7247, 0, 2, 0, 10, 30, 730, 1730, 730, 5730, 60, 61, 'KMAAAA', 'TSKAAA', 'VVVVxx'),
+(3438, 7248, 0, 2, 8, 18, 38, 438, 1438, 3438, 3438, 76, 77, 'GCAAAA', 'USKAAA', 'AAAAxx'),
+(3250, 7249, 0, 2, 0, 10, 50, 250, 1250, 3250, 3250, 100, 101, 'AVAAAA', 'VSKAAA', 'HHHHxx'),
+(5470, 7250, 0, 2, 0, 10, 70, 470, 1470, 470, 5470, 140, 141, 'KCAAAA', 'WSKAAA', 'OOOOxx'),
+(2037, 7251, 1, 1, 7, 17, 37, 37, 37, 2037, 2037, 74, 75, 'JAAAAA', 'XSKAAA', 'VVVVxx'),
+(6593, 7252, 1, 1, 3, 13, 93, 593, 593, 1593, 6593, 186, 187, 'PTAAAA', 'YSKAAA', 'AAAAxx'),
+(3893, 7253, 1, 1, 3, 13, 93, 893, 1893, 3893, 3893, 186, 187, 'TTAAAA', 'ZSKAAA', 'HHHHxx'),
+(3200, 7254, 0, 0, 0, 0, 0, 200, 1200, 3200, 3200, 0, 1, 'CTAAAA', 'ATKAAA', 'OOOOxx'),
+(7125, 7255, 1, 1, 5, 5, 25, 125, 1125, 2125, 7125, 50, 51, 'BOAAAA', 'BTKAAA', 'VVVVxx'),
+(2295, 7256, 1, 3, 5, 15, 95, 295, 295, 2295, 2295, 190, 191, 'HKAAAA', 'CTKAAA', 'AAAAxx'),
+(2056, 7257, 0, 0, 6, 16, 56, 56, 56, 2056, 2056, 112, 113, 'CBAAAA', 'DTKAAA', 'HHHHxx'),
+(2962, 7258, 0, 2, 2, 2, 62, 962, 962, 2962, 2962, 124, 125, 'YJAAAA', 'ETKAAA', 'OOOOxx'),
+(993, 7259, 1, 1, 3, 13, 93, 993, 993, 993, 993, 186, 187, 'FMAAAA', 'FTKAAA', 'VVVVxx'),
+(9127, 7260, 1, 3, 7, 7, 27, 127, 1127, 4127, 9127, 54, 55, 'BNAAAA', 'GTKAAA', 'AAAAxx'),
+(2075, 7261, 1, 3, 5, 15, 75, 75, 75, 2075, 2075, 150, 151, 'VBAAAA', 'HTKAAA', 'HHHHxx'),
+(9338, 7262, 0, 2, 8, 18, 38, 338, 1338, 4338, 9338, 76, 77, 'EVAAAA', 'ITKAAA', 'OOOOxx'),
+(8100, 7263, 0, 0, 0, 0, 0, 100, 100, 3100, 8100, 0, 1, 'OZAAAA', 'JTKAAA', 'VVVVxx'),
+(5047, 7264, 1, 3, 7, 7, 47, 47, 1047, 47, 5047, 94, 95, 'DMAAAA', 'KTKAAA', 'AAAAxx'),
+(7032, 7265, 0, 0, 2, 12, 32, 32, 1032, 2032, 7032, 64, 65, 'MKAAAA', 'LTKAAA', 'HHHHxx'),
+(6374, 7266, 0, 2, 4, 14, 74, 374, 374, 1374, 6374, 148, 149, 'ELAAAA', 'MTKAAA', 'OOOOxx'),
+(4137, 7267, 1, 1, 7, 17, 37, 137, 137, 4137, 4137, 74, 75, 'DDAAAA', 'NTKAAA', 'VVVVxx'),
+(7132, 7268, 0, 0, 2, 12, 32, 132, 1132, 2132, 7132, 64, 65, 'IOAAAA', 'OTKAAA', 'AAAAxx'),
+(3064, 7269, 0, 0, 4, 4, 64, 64, 1064, 3064, 3064, 128, 129, 'WNAAAA', 'PTKAAA', 'HHHHxx'),
+(3621, 7270, 1, 1, 1, 1, 21, 621, 1621, 3621, 3621, 42, 43, 'HJAAAA', 'QTKAAA', 'OOOOxx'),
+(6199, 7271, 1, 3, 9, 19, 99, 199, 199, 1199, 6199, 198, 199, 'LEAAAA', 'RTKAAA', 'VVVVxx'),
+(4926, 7272, 0, 2, 6, 6, 26, 926, 926, 4926, 4926, 52, 53, 'MHAAAA', 'STKAAA', 'AAAAxx'),
+(8035, 7273, 1, 3, 5, 15, 35, 35, 35, 3035, 8035, 70, 71, 'BXAAAA', 'TTKAAA', 'HHHHxx'),
+(2195, 7274, 1, 3, 5, 15, 95, 195, 195, 2195, 2195, 190, 191, 'LGAAAA', 'UTKAAA', 'OOOOxx'),
+(5366, 7275, 0, 2, 6, 6, 66, 366, 1366, 366, 5366, 132, 133, 'KYAAAA', 'VTKAAA', 'VVVVxx'),
+(3478, 7276, 0, 2, 8, 18, 78, 478, 1478, 3478, 3478, 156, 157, 'UDAAAA', 'WTKAAA', 'AAAAxx'),
+(1926, 7277, 0, 2, 6, 6, 26, 926, 1926, 1926, 1926, 52, 53, 'CWAAAA', 'XTKAAA', 'HHHHxx'),
+(7265, 7278, 1, 1, 5, 5, 65, 265, 1265, 2265, 7265, 130, 131, 'LTAAAA', 'YTKAAA', 'OOOOxx'),
+(7668, 7279, 0, 0, 8, 8, 68, 668, 1668, 2668, 7668, 136, 137, 'YIAAAA', 'ZTKAAA', 'VVVVxx'),
+(3335, 7280, 1, 3, 5, 15, 35, 335, 1335, 3335, 3335, 70, 71, 'HYAAAA', 'AUKAAA', 'AAAAxx'),
+(7660, 7281, 0, 0, 0, 0, 60, 660, 1660, 2660, 7660, 120, 121, 'QIAAAA', 'BUKAAA', 'HHHHxx'),
+(9604, 7282, 0, 0, 4, 4, 4, 604, 1604, 4604, 9604, 8, 9, 'KFAAAA', 'CUKAAA', 'OOOOxx'),
+(7301, 7283, 1, 1, 1, 1, 1, 301, 1301, 2301, 7301, 2, 3, 'VUAAAA', 'DUKAAA', 'VVVVxx'),
+(4475, 7284, 1, 3, 5, 15, 75, 475, 475, 4475, 4475, 150, 151, 'DQAAAA', 'EUKAAA', 'AAAAxx'),
+(9954, 7285, 0, 2, 4, 14, 54, 954, 1954, 4954, 9954, 108, 109, 'WSAAAA', 'FUKAAA', 'HHHHxx'),
+(5723, 7286, 1, 3, 3, 3, 23, 723, 1723, 723, 5723, 46, 47, 'DMAAAA', 'GUKAAA', 'OOOOxx'),
+(2669, 7287, 1, 1, 9, 9, 69, 669, 669, 2669, 2669, 138, 139, 'RYAAAA', 'HUKAAA', 'VVVVxx'),
+(1685, 7288, 1, 1, 5, 5, 85, 685, 1685, 1685, 1685, 170, 171, 'VMAAAA', 'IUKAAA', 'AAAAxx'),
+(2233, 7289, 1, 1, 3, 13, 33, 233, 233, 2233, 2233, 66, 67, 'XHAAAA', 'JUKAAA', 'HHHHxx'),
+(8111, 7290, 1, 3, 1, 11, 11, 111, 111, 3111, 8111, 22, 23, 'ZZAAAA', 'KUKAAA', 'OOOOxx'),
+(7685, 7291, 1, 1, 5, 5, 85, 685, 1685, 2685, 7685, 170, 171, 'PJAAAA', 'LUKAAA', 'VVVVxx'),
+(3773, 7292, 1, 1, 3, 13, 73, 773, 1773, 3773, 3773, 146, 147, 'DPAAAA', 'MUKAAA', 'AAAAxx'),
+(7172, 7293, 0, 0, 2, 12, 72, 172, 1172, 2172, 7172, 144, 145, 'WPAAAA', 'NUKAAA', 'HHHHxx'),
+(1740, 7294, 0, 0, 0, 0, 40, 740, 1740, 1740, 1740, 80, 81, 'YOAAAA', 'OUKAAA', 'OOOOxx'),
+(5416, 7295, 0, 0, 6, 16, 16, 416, 1416, 416, 5416, 32, 33, 'IAAAAA', 'PUKAAA', 'VVVVxx'),
+(1823, 7296, 1, 3, 3, 3, 23, 823, 1823, 1823, 1823, 46, 47, 'DSAAAA', 'QUKAAA', 'AAAAxx'),
+(1668, 7297, 0, 0, 8, 8, 68, 668, 1668, 1668, 1668, 136, 137, 'EMAAAA', 'RUKAAA', 'HHHHxx'),
+(1795, 7298, 1, 3, 5, 15, 95, 795, 1795, 1795, 1795, 190, 191, 'BRAAAA', 'SUKAAA', 'OOOOxx'),
+(8599, 7299, 1, 3, 9, 19, 99, 599, 599, 3599, 8599, 198, 199, 'TSAAAA', 'TUKAAA', 'VVVVxx'),
+(5542, 7300, 0, 2, 2, 2, 42, 542, 1542, 542, 5542, 84, 85, 'EFAAAA', 'UUKAAA', 'AAAAxx'),
+(5658, 7301, 0, 2, 8, 18, 58, 658, 1658, 658, 5658, 116, 117, 'QJAAAA', 'VUKAAA', 'HHHHxx'),
+(9824, 7302, 0, 0, 4, 4, 24, 824, 1824, 4824, 9824, 48, 49, 'WNAAAA', 'WUKAAA', 'OOOOxx'),
+(19, 7303, 1, 3, 9, 19, 19, 19, 19, 19, 19, 38, 39, 'TAAAAA', 'XUKAAA', 'VVVVxx'),
+(9344, 7304, 0, 0, 4, 4, 44, 344, 1344, 4344, 9344, 88, 89, 'KVAAAA', 'YUKAAA', 'AAAAxx'),
+(5900, 7305, 0, 0, 0, 0, 0, 900, 1900, 900, 5900, 0, 1, 'YSAAAA', 'ZUKAAA', 'HHHHxx'),
+(7818, 7306, 0, 2, 8, 18, 18, 818, 1818, 2818, 7818, 36, 37, 'SOAAAA', 'AVKAAA', 'OOOOxx'),
+(8377, 7307, 1, 1, 7, 17, 77, 377, 377, 3377, 8377, 154, 155, 'FKAAAA', 'BVKAAA', 'VVVVxx'),
+(6886, 7308, 0, 2, 6, 6, 86, 886, 886, 1886, 6886, 172, 173, 'WEAAAA', 'CVKAAA', 'AAAAxx'),
+(3201, 7309, 1, 1, 1, 1, 1, 201, 1201, 3201, 3201, 2, 3, 'DTAAAA', 'DVKAAA', 'HHHHxx'),
+(87, 7310, 1, 3, 7, 7, 87, 87, 87, 87, 87, 174, 175, 'JDAAAA', 'EVKAAA', 'OOOOxx'),
+(1089, 7311, 1, 1, 9, 9, 89, 89, 1089, 1089, 1089, 178, 179, 'XPAAAA', 'FVKAAA', 'VVVVxx'),
+(3948, 7312, 0, 0, 8, 8, 48, 948, 1948, 3948, 3948, 96, 97, 'WVAAAA', 'GVKAAA', 'AAAAxx'),
+(6383, 7313, 1, 3, 3, 3, 83, 383, 383, 1383, 6383, 166, 167, 'NLAAAA', 'HVKAAA', 'HHHHxx'),
+(837, 7314, 1, 1, 7, 17, 37, 837, 837, 837, 837, 74, 75, 'FGAAAA', 'IVKAAA', 'OOOOxx'),
+(6285, 7315, 1, 1, 5, 5, 85, 285, 285, 1285, 6285, 170, 171, 'THAAAA', 'JVKAAA', 'VVVVxx'),
+(78, 7316, 0, 2, 8, 18, 78, 78, 78, 78, 78, 156, 157, 'ADAAAA', 'KVKAAA', 'AAAAxx'),
+(4389, 7317, 1, 1, 9, 9, 89, 389, 389, 4389, 4389, 178, 179, 'VMAAAA', 'LVKAAA', 'HHHHxx'),
+(4795, 7318, 1, 3, 5, 15, 95, 795, 795, 4795, 4795, 190, 191, 'LCAAAA', 'MVKAAA', 'OOOOxx'),
+(9369, 7319, 1, 1, 9, 9, 69, 369, 1369, 4369, 9369, 138, 139, 'JWAAAA', 'NVKAAA', 'VVVVxx'),
+(69, 7320, 1, 1, 9, 9, 69, 69, 69, 69, 69, 138, 139, 'RCAAAA', 'OVKAAA', 'AAAAxx'),
+(7689, 7321, 1, 1, 9, 9, 89, 689, 1689, 2689, 7689, 178, 179, 'TJAAAA', 'PVKAAA', 'HHHHxx'),
+(5642, 7322, 0, 2, 2, 2, 42, 642, 1642, 642, 5642, 84, 85, 'AJAAAA', 'QVKAAA', 'OOOOxx'),
+(2348, 7323, 0, 0, 8, 8, 48, 348, 348, 2348, 2348, 96, 97, 'IMAAAA', 'RVKAAA', 'VVVVxx'),
+(9308, 7324, 0, 0, 8, 8, 8, 308, 1308, 4308, 9308, 16, 17, 'AUAAAA', 'SVKAAA', 'AAAAxx'),
+(9093, 7325, 1, 1, 3, 13, 93, 93, 1093, 4093, 9093, 186, 187, 'TLAAAA', 'TVKAAA', 'HHHHxx'),
+(1199, 7326, 1, 3, 9, 19, 99, 199, 1199, 1199, 1199, 198, 199, 'DUAAAA', 'UVKAAA', 'OOOOxx'),
+(307, 7327, 1, 3, 7, 7, 7, 307, 307, 307, 307, 14, 15, 'VLAAAA', 'VVKAAA', 'VVVVxx'),
+(3814, 7328, 0, 2, 4, 14, 14, 814, 1814, 3814, 3814, 28, 29, 'SQAAAA', 'WVKAAA', 'AAAAxx'),
+(8817, 7329, 1, 1, 7, 17, 17, 817, 817, 3817, 8817, 34, 35, 'DBAAAA', 'XVKAAA', 'HHHHxx'),
+(2329, 7330, 1, 1, 9, 9, 29, 329, 329, 2329, 2329, 58, 59, 'PLAAAA', 'YVKAAA', 'OOOOxx'),
+(2932, 7331, 0, 0, 2, 12, 32, 932, 932, 2932, 2932, 64, 65, 'UIAAAA', 'ZVKAAA', 'VVVVxx'),
+(1986, 7332, 0, 2, 6, 6, 86, 986, 1986, 1986, 1986, 172, 173, 'KYAAAA', 'AWKAAA', 'AAAAxx'),
+(5279, 7333, 1, 3, 9, 19, 79, 279, 1279, 279, 5279, 158, 159, 'BVAAAA', 'BWKAAA', 'HHHHxx'),
+(5357, 7334, 1, 1, 7, 17, 57, 357, 1357, 357, 5357, 114, 115, 'BYAAAA', 'CWKAAA', 'OOOOxx'),
+(6778, 7335, 0, 2, 8, 18, 78, 778, 778, 1778, 6778, 156, 157, 'SAAAAA', 'DWKAAA', 'VVVVxx'),
+(2773, 7336, 1, 1, 3, 13, 73, 773, 773, 2773, 2773, 146, 147, 'RCAAAA', 'EWKAAA', 'AAAAxx'),
+(244, 7337, 0, 0, 4, 4, 44, 244, 244, 244, 244, 88, 89, 'KJAAAA', 'FWKAAA', 'HHHHxx'),
+(6900, 7338, 0, 0, 0, 0, 0, 900, 900, 1900, 6900, 0, 1, 'KFAAAA', 'GWKAAA', 'OOOOxx'),
+(4739, 7339, 1, 3, 9, 19, 39, 739, 739, 4739, 4739, 78, 79, 'HAAAAA', 'HWKAAA', 'VVVVxx'),
+(3217, 7340, 1, 1, 7, 17, 17, 217, 1217, 3217, 3217, 34, 35, 'TTAAAA', 'IWKAAA', 'AAAAxx'),
+(7563, 7341, 1, 3, 3, 3, 63, 563, 1563, 2563, 7563, 126, 127, 'XEAAAA', 'JWKAAA', 'HHHHxx'),
+(1807, 7342, 1, 3, 7, 7, 7, 807, 1807, 1807, 1807, 14, 15, 'NRAAAA', 'KWKAAA', 'OOOOxx'),
+(4199, 7343, 1, 3, 9, 19, 99, 199, 199, 4199, 4199, 198, 199, 'NFAAAA', 'LWKAAA', 'VVVVxx'),
+(1077, 7344, 1, 1, 7, 17, 77, 77, 1077, 1077, 1077, 154, 155, 'LPAAAA', 'MWKAAA', 'AAAAxx'),
+(8348, 7345, 0, 0, 8, 8, 48, 348, 348, 3348, 8348, 96, 97, 'CJAAAA', 'NWKAAA', 'HHHHxx'),
+(841, 7346, 1, 1, 1, 1, 41, 841, 841, 841, 841, 82, 83, 'JGAAAA', 'OWKAAA', 'OOOOxx'),
+(8154, 7347, 0, 2, 4, 14, 54, 154, 154, 3154, 8154, 108, 109, 'QBAAAA', 'PWKAAA', 'VVVVxx'),
+(5261, 7348, 1, 1, 1, 1, 61, 261, 1261, 261, 5261, 122, 123, 'JUAAAA', 'QWKAAA', 'AAAAxx'),
+(1950, 7349, 0, 2, 0, 10, 50, 950, 1950, 1950, 1950, 100, 101, 'AXAAAA', 'RWKAAA', 'HHHHxx'),
+(8472, 7350, 0, 0, 2, 12, 72, 472, 472, 3472, 8472, 144, 145, 'WNAAAA', 'SWKAAA', 'OOOOxx'),
+(8745, 7351, 1, 1, 5, 5, 45, 745, 745, 3745, 8745, 90, 91, 'JYAAAA', 'TWKAAA', 'VVVVxx'),
+(8715, 7352, 1, 3, 5, 15, 15, 715, 715, 3715, 8715, 30, 31, 'FXAAAA', 'UWKAAA', 'AAAAxx'),
+(9708, 7353, 0, 0, 8, 8, 8, 708, 1708, 4708, 9708, 16, 17, 'KJAAAA', 'VWKAAA', 'HHHHxx'),
+(5860, 7354, 0, 0, 0, 0, 60, 860, 1860, 860, 5860, 120, 121, 'KRAAAA', 'WWKAAA', 'OOOOxx'),
+(9142, 7355, 0, 2, 2, 2, 42, 142, 1142, 4142, 9142, 84, 85, 'QNAAAA', 'XWKAAA', 'VVVVxx'),
+(6582, 7356, 0, 2, 2, 2, 82, 582, 582, 1582, 6582, 164, 165, 'ETAAAA', 'YWKAAA', 'AAAAxx'),
+(1255, 7357, 1, 3, 5, 15, 55, 255, 1255, 1255, 1255, 110, 111, 'HWAAAA', 'ZWKAAA', 'HHHHxx'),
+(6459, 7358, 1, 3, 9, 19, 59, 459, 459, 1459, 6459, 118, 119, 'LOAAAA', 'AXKAAA', 'OOOOxx'),
+(6327, 7359, 1, 3, 7, 7, 27, 327, 327, 1327, 6327, 54, 55, 'JJAAAA', 'BXKAAA', 'VVVVxx'),
+(4692, 7360, 0, 0, 2, 12, 92, 692, 692, 4692, 4692, 184, 185, 'MYAAAA', 'CXKAAA', 'AAAAxx'),
+(3772, 7361, 0, 0, 2, 12, 72, 772, 1772, 3772, 3772, 144, 145, 'CPAAAA', 'DXKAAA', 'HHHHxx'),
+(4203, 7362, 1, 3, 3, 3, 3, 203, 203, 4203, 4203, 6, 7, 'RFAAAA', 'EXKAAA', 'OOOOxx'),
+(2946, 7363, 0, 2, 6, 6, 46, 946, 946, 2946, 2946, 92, 93, 'IJAAAA', 'FXKAAA', 'VVVVxx'),
+(3524, 7364, 0, 0, 4, 4, 24, 524, 1524, 3524, 3524, 48, 49, 'OFAAAA', 'GXKAAA', 'AAAAxx'),
+(8409, 7365, 1, 1, 9, 9, 9, 409, 409, 3409, 8409, 18, 19, 'LLAAAA', 'HXKAAA', 'HHHHxx'),
+(1824, 7366, 0, 0, 4, 4, 24, 824, 1824, 1824, 1824, 48, 49, 'ESAAAA', 'IXKAAA', 'OOOOxx'),
+(4637, 7367, 1, 1, 7, 17, 37, 637, 637, 4637, 4637, 74, 75, 'JWAAAA', 'JXKAAA', 'VVVVxx'),
+(589, 7368, 1, 1, 9, 9, 89, 589, 589, 589, 589, 178, 179, 'RWAAAA', 'KXKAAA', 'AAAAxx'),
+(484, 7369, 0, 0, 4, 4, 84, 484, 484, 484, 484, 168, 169, 'QSAAAA', 'LXKAAA', 'HHHHxx'),
+(8963, 7370, 1, 3, 3, 3, 63, 963, 963, 3963, 8963, 126, 127, 'TGAAAA', 'MXKAAA', 'OOOOxx'),
+(5502, 7371, 0, 2, 2, 2, 2, 502, 1502, 502, 5502, 4, 5, 'QDAAAA', 'NXKAAA', 'VVVVxx'),
+(6982, 7372, 0, 2, 2, 2, 82, 982, 982, 1982, 6982, 164, 165, 'OIAAAA', 'OXKAAA', 'AAAAxx'),
+(8029, 7373, 1, 1, 9, 9, 29, 29, 29, 3029, 8029, 58, 59, 'VWAAAA', 'PXKAAA', 'HHHHxx'),
+(4395, 7374, 1, 3, 5, 15, 95, 395, 395, 4395, 4395, 190, 191, 'BNAAAA', 'QXKAAA', 'OOOOxx'),
+(2595, 7375, 1, 3, 5, 15, 95, 595, 595, 2595, 2595, 190, 191, 'VVAAAA', 'RXKAAA', 'VVVVxx'),
+(2133, 7376, 1, 1, 3, 13, 33, 133, 133, 2133, 2133, 66, 67, 'BEAAAA', 'SXKAAA', 'AAAAxx'),
+(1414, 7377, 0, 2, 4, 14, 14, 414, 1414, 1414, 1414, 28, 29, 'KCAAAA', 'TXKAAA', 'HHHHxx'),
+(8201, 7378, 1, 1, 1, 1, 1, 201, 201, 3201, 8201, 2, 3, 'LDAAAA', 'UXKAAA', 'OOOOxx'),
+(4706, 7379, 0, 2, 6, 6, 6, 706, 706, 4706, 4706, 12, 13, 'AZAAAA', 'VXKAAA', 'VVVVxx'),
+(5310, 7380, 0, 2, 0, 10, 10, 310, 1310, 310, 5310, 20, 21, 'GWAAAA', 'WXKAAA', 'AAAAxx'),
+(7333, 7381, 1, 1, 3, 13, 33, 333, 1333, 2333, 7333, 66, 67, 'BWAAAA', 'XXKAAA', 'HHHHxx'),
+(9420, 7382, 0, 0, 0, 0, 20, 420, 1420, 4420, 9420, 40, 41, 'IYAAAA', 'YXKAAA', 'OOOOxx'),
+(1383, 7383, 1, 3, 3, 3, 83, 383, 1383, 1383, 1383, 166, 167, 'FBAAAA', 'ZXKAAA', 'VVVVxx'),
+(6225, 7384, 1, 1, 5, 5, 25, 225, 225, 1225, 6225, 50, 51, 'LFAAAA', 'AYKAAA', 'AAAAxx'),
+(2064, 7385, 0, 0, 4, 4, 64, 64, 64, 2064, 2064, 128, 129, 'KBAAAA', 'BYKAAA', 'HHHHxx'),
+(6700, 7386, 0, 0, 0, 0, 0, 700, 700, 1700, 6700, 0, 1, 'SXAAAA', 'CYKAAA', 'OOOOxx'),
+(1352, 7387, 0, 0, 2, 12, 52, 352, 1352, 1352, 1352, 104, 105, 'AAAAAA', 'DYKAAA', 'VVVVxx'),
+(4249, 7388, 1, 1, 9, 9, 49, 249, 249, 4249, 4249, 98, 99, 'LHAAAA', 'EYKAAA', 'AAAAxx'),
+(9429, 7389, 1, 1, 9, 9, 29, 429, 1429, 4429, 9429, 58, 59, 'RYAAAA', 'FYKAAA', 'HHHHxx'),
+(8090, 7390, 0, 2, 0, 10, 90, 90, 90, 3090, 8090, 180, 181, 'EZAAAA', 'GYKAAA', 'OOOOxx'),
+(5378, 7391, 0, 2, 8, 18, 78, 378, 1378, 378, 5378, 156, 157, 'WYAAAA', 'HYKAAA', 'VVVVxx'),
+(9085, 7392, 1, 1, 5, 5, 85, 85, 1085, 4085, 9085, 170, 171, 'LLAAAA', 'IYKAAA', 'AAAAxx'),
+(7468, 7393, 0, 0, 8, 8, 68, 468, 1468, 2468, 7468, 136, 137, 'GBAAAA', 'JYKAAA', 'HHHHxx'),
+(9955, 7394, 1, 3, 5, 15, 55, 955, 1955, 4955, 9955, 110, 111, 'XSAAAA', 'KYKAAA', 'OOOOxx'),
+(8692, 7395, 0, 0, 2, 12, 92, 692, 692, 3692, 8692, 184, 185, 'IWAAAA', 'LYKAAA', 'VVVVxx'),
+(1463, 7396, 1, 3, 3, 3, 63, 463, 1463, 1463, 1463, 126, 127, 'HEAAAA', 'MYKAAA', 'AAAAxx'),
+(3577, 7397, 1, 1, 7, 17, 77, 577, 1577, 3577, 3577, 154, 155, 'PHAAAA', 'NYKAAA', 'HHHHxx'),
+(5654, 7398, 0, 2, 4, 14, 54, 654, 1654, 654, 5654, 108, 109, 'MJAAAA', 'OYKAAA', 'OOOOxx'),
+(7955, 7399, 1, 3, 5, 15, 55, 955, 1955, 2955, 7955, 110, 111, 'ZTAAAA', 'PYKAAA', 'VVVVxx'),
+(4843, 7400, 1, 3, 3, 3, 43, 843, 843, 4843, 4843, 86, 87, 'HEAAAA', 'QYKAAA', 'AAAAxx'),
+(1776, 7401, 0, 0, 6, 16, 76, 776, 1776, 1776, 1776, 152, 153, 'IQAAAA', 'RYKAAA', 'HHHHxx'),
+(2223, 7402, 1, 3, 3, 3, 23, 223, 223, 2223, 2223, 46, 47, 'NHAAAA', 'SYKAAA', 'OOOOxx'),
+(8442, 7403, 0, 2, 2, 2, 42, 442, 442, 3442, 8442, 84, 85, 'SMAAAA', 'TYKAAA', 'VVVVxx'),
+(9738, 7404, 0, 2, 8, 18, 38, 738, 1738, 4738, 9738, 76, 77, 'OKAAAA', 'UYKAAA', 'AAAAxx'),
+(4867, 7405, 1, 3, 7, 7, 67, 867, 867, 4867, 4867, 134, 135, 'FFAAAA', 'VYKAAA', 'HHHHxx'),
+(2983, 7406, 1, 3, 3, 3, 83, 983, 983, 2983, 2983, 166, 167, 'TKAAAA', 'WYKAAA', 'OOOOxx'),
+(3300, 7407, 0, 0, 0, 0, 0, 300, 1300, 3300, 3300, 0, 1, 'YWAAAA', 'XYKAAA', 'VVVVxx'),
+(3815, 7408, 1, 3, 5, 15, 15, 815, 1815, 3815, 3815, 30, 31, 'TQAAAA', 'YYKAAA', 'AAAAxx'),
+(1779, 7409, 1, 3, 9, 19, 79, 779, 1779, 1779, 1779, 158, 159, 'LQAAAA', 'ZYKAAA', 'HHHHxx'),
+(1123, 7410, 1, 3, 3, 3, 23, 123, 1123, 1123, 1123, 46, 47, 'FRAAAA', 'AZKAAA', 'OOOOxx'),
+(4824, 7411, 0, 0, 4, 4, 24, 824, 824, 4824, 4824, 48, 49, 'ODAAAA', 'BZKAAA', 'VVVVxx'),
+(5407, 7412, 1, 3, 7, 7, 7, 407, 1407, 407, 5407, 14, 15, 'ZZAAAA', 'CZKAAA', 'AAAAxx'),
+(5123, 7413, 1, 3, 3, 3, 23, 123, 1123, 123, 5123, 46, 47, 'BPAAAA', 'DZKAAA', 'HHHHxx'),
+(2515, 7414, 1, 3, 5, 15, 15, 515, 515, 2515, 2515, 30, 31, 'TSAAAA', 'EZKAAA', 'OOOOxx'),
+(4781, 7415, 1, 1, 1, 1, 81, 781, 781, 4781, 4781, 162, 163, 'XBAAAA', 'FZKAAA', 'VVVVxx'),
+(7831, 7416, 1, 3, 1, 11, 31, 831, 1831, 2831, 7831, 62, 63, 'FPAAAA', 'GZKAAA', 'AAAAxx'),
+(6946, 7417, 0, 2, 6, 6, 46, 946, 946, 1946, 6946, 92, 93, 'EHAAAA', 'HZKAAA', 'HHHHxx'),
+(1215, 7418, 1, 3, 5, 15, 15, 215, 1215, 1215, 1215, 30, 31, 'TUAAAA', 'IZKAAA', 'OOOOxx'),
+(7783, 7419, 1, 3, 3, 3, 83, 783, 1783, 2783, 7783, 166, 167, 'JNAAAA', 'JZKAAA', 'VVVVxx'),
+(4532, 7420, 0, 0, 2, 12, 32, 532, 532, 4532, 4532, 64, 65, 'ISAAAA', 'KZKAAA', 'AAAAxx'),
+(9068, 7421, 0, 0, 8, 8, 68, 68, 1068, 4068, 9068, 136, 137, 'UKAAAA', 'LZKAAA', 'HHHHxx'),
+(7030, 7422, 0, 2, 0, 10, 30, 30, 1030, 2030, 7030, 60, 61, 'KKAAAA', 'MZKAAA', 'OOOOxx'),
+(436, 7423, 0, 0, 6, 16, 36, 436, 436, 436, 436, 72, 73, 'UQAAAA', 'NZKAAA', 'VVVVxx'),
+(6549, 7424, 1, 1, 9, 9, 49, 549, 549, 1549, 6549, 98, 99, 'XRAAAA', 'OZKAAA', 'AAAAxx'),
+(3348, 7425, 0, 0, 8, 8, 48, 348, 1348, 3348, 3348, 96, 97, 'UYAAAA', 'PZKAAA', 'HHHHxx'),
+(6229, 7426, 1, 1, 9, 9, 29, 229, 229, 1229, 6229, 58, 59, 'PFAAAA', 'QZKAAA', 'OOOOxx'),
+(3933, 7427, 1, 1, 3, 13, 33, 933, 1933, 3933, 3933, 66, 67, 'HVAAAA', 'RZKAAA', 'VVVVxx'),
+(1876, 7428, 0, 0, 6, 16, 76, 876, 1876, 1876, 1876, 152, 153, 'EUAAAA', 'SZKAAA', 'AAAAxx'),
+(8920, 7429, 0, 0, 0, 0, 20, 920, 920, 3920, 8920, 40, 41, 'CFAAAA', 'TZKAAA', 'HHHHxx'),
+(7926, 7430, 0, 2, 6, 6, 26, 926, 1926, 2926, 7926, 52, 53, 'WSAAAA', 'UZKAAA', 'OOOOxx'),
+(8805, 7431, 1, 1, 5, 5, 5, 805, 805, 3805, 8805, 10, 11, 'RAAAAA', 'VZKAAA', 'VVVVxx'),
+(6729, 7432, 1, 1, 9, 9, 29, 729, 729, 1729, 6729, 58, 59, 'VYAAAA', 'WZKAAA', 'AAAAxx'),
+(7397, 7433, 1, 1, 7, 17, 97, 397, 1397, 2397, 7397, 194, 195, 'NYAAAA', 'XZKAAA', 'HHHHxx'),
+(9303, 7434, 1, 3, 3, 3, 3, 303, 1303, 4303, 9303, 6, 7, 'VTAAAA', 'YZKAAA', 'OOOOxx'),
+(4255, 7435, 1, 3, 5, 15, 55, 255, 255, 4255, 4255, 110, 111, 'RHAAAA', 'ZZKAAA', 'VVVVxx'),
+(7229, 7436, 1, 1, 9, 9, 29, 229, 1229, 2229, 7229, 58, 59, 'BSAAAA', 'AALAAA', 'AAAAxx'),
+(854, 7437, 0, 2, 4, 14, 54, 854, 854, 854, 854, 108, 109, 'WGAAAA', 'BALAAA', 'HHHHxx'),
+(6723, 7438, 1, 3, 3, 3, 23, 723, 723, 1723, 6723, 46, 47, 'PYAAAA', 'CALAAA', 'OOOOxx'),
+(9597, 7439, 1, 1, 7, 17, 97, 597, 1597, 4597, 9597, 194, 195, 'DFAAAA', 'DALAAA', 'VVVVxx'),
+(6532, 7440, 0, 0, 2, 12, 32, 532, 532, 1532, 6532, 64, 65, 'GRAAAA', 'EALAAA', 'AAAAxx'),
+(2910, 7441, 0, 2, 0, 10, 10, 910, 910, 2910, 2910, 20, 21, 'YHAAAA', 'FALAAA', 'HHHHxx'),
+(6717, 7442, 1, 1, 7, 17, 17, 717, 717, 1717, 6717, 34, 35, 'JYAAAA', 'GALAAA', 'OOOOxx'),
+(1790, 7443, 0, 2, 0, 10, 90, 790, 1790, 1790, 1790, 180, 181, 'WQAAAA', 'HALAAA', 'VVVVxx'),
+(3761, 7444, 1, 1, 1, 1, 61, 761, 1761, 3761, 3761, 122, 123, 'ROAAAA', 'IALAAA', 'AAAAxx'),
+(1565, 7445, 1, 1, 5, 5, 65, 565, 1565, 1565, 1565, 130, 131, 'FIAAAA', 'JALAAA', 'HHHHxx'),
+(6205, 7446, 1, 1, 5, 5, 5, 205, 205, 1205, 6205, 10, 11, 'REAAAA', 'KALAAA', 'OOOOxx'),
+(2726, 7447, 0, 2, 6, 6, 26, 726, 726, 2726, 2726, 52, 53, 'WAAAAA', 'LALAAA', 'VVVVxx'),
+(799, 7448, 1, 3, 9, 19, 99, 799, 799, 799, 799, 198, 199, 'TEAAAA', 'MALAAA', 'AAAAxx'),
+(3540, 7449, 0, 0, 0, 0, 40, 540, 1540, 3540, 3540, 80, 81, 'EGAAAA', 'NALAAA', 'HHHHxx'),
+(5878, 7450, 0, 2, 8, 18, 78, 878, 1878, 878, 5878, 156, 157, 'CSAAAA', 'OALAAA', 'OOOOxx'),
+(2542, 7451, 0, 2, 2, 2, 42, 542, 542, 2542, 2542, 84, 85, 'UTAAAA', 'PALAAA', 'VVVVxx'),
+(4888, 7452, 0, 0, 8, 8, 88, 888, 888, 4888, 4888, 176, 177, 'AGAAAA', 'QALAAA', 'AAAAxx'),
+(5290, 7453, 0, 2, 0, 10, 90, 290, 1290, 290, 5290, 180, 181, 'MVAAAA', 'RALAAA', 'HHHHxx'),
+(7995, 7454, 1, 3, 5, 15, 95, 995, 1995, 2995, 7995, 190, 191, 'NVAAAA', 'SALAAA', 'OOOOxx'),
+(3519, 7455, 1, 3, 9, 19, 19, 519, 1519, 3519, 3519, 38, 39, 'JFAAAA', 'TALAAA', 'VVVVxx'),
+(3571, 7456, 1, 3, 1, 11, 71, 571, 1571, 3571, 3571, 142, 143, 'JHAAAA', 'UALAAA', 'AAAAxx'),
+(7854, 7457, 0, 2, 4, 14, 54, 854, 1854, 2854, 7854, 108, 109, 'CQAAAA', 'VALAAA', 'HHHHxx'),
+(5184, 7458, 0, 0, 4, 4, 84, 184, 1184, 184, 5184, 168, 169, 'KRAAAA', 'WALAAA', 'OOOOxx'),
+(3498, 7459, 0, 2, 8, 18, 98, 498, 1498, 3498, 3498, 196, 197, 'OEAAAA', 'XALAAA', 'VVVVxx'),
+(1264, 7460, 0, 0, 4, 4, 64, 264, 1264, 1264, 1264, 128, 129, 'QWAAAA', 'YALAAA', 'AAAAxx'),
+(3159, 7461, 1, 3, 9, 19, 59, 159, 1159, 3159, 3159, 118, 119, 'NRAAAA', 'ZALAAA', 'HHHHxx'),
+(5480, 7462, 0, 0, 0, 0, 80, 480, 1480, 480, 5480, 160, 161, 'UCAAAA', 'ABLAAA', 'OOOOxx'),
+(1706, 7463, 0, 2, 6, 6, 6, 706, 1706, 1706, 1706, 12, 13, 'QNAAAA', 'BBLAAA', 'VVVVxx'),
+(4540, 7464, 0, 0, 0, 0, 40, 540, 540, 4540, 4540, 80, 81, 'QSAAAA', 'CBLAAA', 'AAAAxx'),
+(2799, 7465, 1, 3, 9, 19, 99, 799, 799, 2799, 2799, 198, 199, 'RDAAAA', 'DBLAAA', 'HHHHxx'),
+(7389, 7466, 1, 1, 9, 9, 89, 389, 1389, 2389, 7389, 178, 179, 'FYAAAA', 'EBLAAA', 'OOOOxx'),
+(5565, 7467, 1, 1, 5, 5, 65, 565, 1565, 565, 5565, 130, 131, 'BGAAAA', 'FBLAAA', 'VVVVxx'),
+(3896, 7468, 0, 0, 6, 16, 96, 896, 1896, 3896, 3896, 192, 193, 'WTAAAA', 'GBLAAA', 'AAAAxx'),
+(2100, 7469, 0, 0, 0, 0, 0, 100, 100, 2100, 2100, 0, 1, 'UCAAAA', 'HBLAAA', 'HHHHxx'),
+(3507, 7470, 1, 3, 7, 7, 7, 507, 1507, 3507, 3507, 14, 15, 'XEAAAA', 'IBLAAA', 'OOOOxx'),
+(7971, 7471, 1, 3, 1, 11, 71, 971, 1971, 2971, 7971, 142, 143, 'PUAAAA', 'JBLAAA', 'VVVVxx'),
+(2312, 7472, 0, 0, 2, 12, 12, 312, 312, 2312, 2312, 24, 25, 'YKAAAA', 'KBLAAA', 'AAAAxx'),
+(2494, 7473, 0, 2, 4, 14, 94, 494, 494, 2494, 2494, 188, 189, 'YRAAAA', 'LBLAAA', 'HHHHxx'),
+(2474, 7474, 0, 2, 4, 14, 74, 474, 474, 2474, 2474, 148, 149, 'ERAAAA', 'MBLAAA', 'OOOOxx'),
+(3136, 7475, 0, 0, 6, 16, 36, 136, 1136, 3136, 3136, 72, 73, 'QQAAAA', 'NBLAAA', 'VVVVxx'),
+(7242, 7476, 0, 2, 2, 2, 42, 242, 1242, 2242, 7242, 84, 85, 'OSAAAA', 'OBLAAA', 'AAAAxx'),
+(9430, 7477, 0, 2, 0, 10, 30, 430, 1430, 4430, 9430, 60, 61, 'SYAAAA', 'PBLAAA', 'HHHHxx'),
+(1052, 7478, 0, 0, 2, 12, 52, 52, 1052, 1052, 1052, 104, 105, 'MOAAAA', 'QBLAAA', 'OOOOxx'),
+(4172, 7479, 0, 0, 2, 12, 72, 172, 172, 4172, 4172, 144, 145, 'MEAAAA', 'RBLAAA', 'VVVVxx'),
+(970, 7480, 0, 2, 0, 10, 70, 970, 970, 970, 970, 140, 141, 'ILAAAA', 'SBLAAA', 'AAAAxx'),
+(882, 7481, 0, 2, 2, 2, 82, 882, 882, 882, 882, 164, 165, 'YHAAAA', 'TBLAAA', 'HHHHxx'),
+(9799, 7482, 1, 3, 9, 19, 99, 799, 1799, 4799, 9799, 198, 199, 'XMAAAA', 'UBLAAA', 'OOOOxx'),
+(5850, 7483, 0, 2, 0, 10, 50, 850, 1850, 850, 5850, 100, 101, 'ARAAAA', 'VBLAAA', 'VVVVxx'),
+(9473, 7484, 1, 1, 3, 13, 73, 473, 1473, 4473, 9473, 146, 147, 'JAAAAA', 'WBLAAA', 'AAAAxx'),
+(8635, 7485, 1, 3, 5, 15, 35, 635, 635, 3635, 8635, 70, 71, 'DUAAAA', 'XBLAAA', 'HHHHxx'),
+(2349, 7486, 1, 1, 9, 9, 49, 349, 349, 2349, 2349, 98, 99, 'JMAAAA', 'YBLAAA', 'OOOOxx'),
+(2270, 7487, 0, 2, 0, 10, 70, 270, 270, 2270, 2270, 140, 141, 'IJAAAA', 'ZBLAAA', 'VVVVxx'),
+(7887, 7488, 1, 3, 7, 7, 87, 887, 1887, 2887, 7887, 174, 175, 'JRAAAA', 'ACLAAA', 'AAAAxx'),
+(3091, 7489, 1, 3, 1, 11, 91, 91, 1091, 3091, 3091, 182, 183, 'XOAAAA', 'BCLAAA', 'HHHHxx'),
+(3728, 7490, 0, 0, 8, 8, 28, 728, 1728, 3728, 3728, 56, 57, 'KNAAAA', 'CCLAAA', 'OOOOxx'),
+(3658, 7491, 0, 2, 8, 18, 58, 658, 1658, 3658, 3658, 116, 117, 'SKAAAA', 'DCLAAA', 'VVVVxx'),
+(5975, 7492, 1, 3, 5, 15, 75, 975, 1975, 975, 5975, 150, 151, 'VVAAAA', 'ECLAAA', 'AAAAxx'),
+(332, 7493, 0, 0, 2, 12, 32, 332, 332, 332, 332, 64, 65, 'UMAAAA', 'FCLAAA', 'HHHHxx'),
+(7990, 7494, 0, 2, 0, 10, 90, 990, 1990, 2990, 7990, 180, 181, 'IVAAAA', 'GCLAAA', 'OOOOxx'),
+(8688, 7495, 0, 0, 8, 8, 88, 688, 688, 3688, 8688, 176, 177, 'EWAAAA', 'HCLAAA', 'VVVVxx'),
+(9601, 7496, 1, 1, 1, 1, 1, 601, 1601, 4601, 9601, 2, 3, 'HFAAAA', 'ICLAAA', 'AAAAxx'),
+(8401, 7497, 1, 1, 1, 1, 1, 401, 401, 3401, 8401, 2, 3, 'DLAAAA', 'JCLAAA', 'HHHHxx'),
+(8093, 7498, 1, 1, 3, 13, 93, 93, 93, 3093, 8093, 186, 187, 'HZAAAA', 'KCLAAA', 'OOOOxx'),
+(4278, 7499, 0, 2, 8, 18, 78, 278, 278, 4278, 4278, 156, 157, 'OIAAAA', 'LCLAAA', 'VVVVxx'),
+(5467, 7500, 1, 3, 7, 7, 67, 467, 1467, 467, 5467, 134, 135, 'HCAAAA', 'MCLAAA', 'AAAAxx'),
+(3137, 7501, 1, 1, 7, 17, 37, 137, 1137, 3137, 3137, 74, 75, 'RQAAAA', 'NCLAAA', 'HHHHxx'),
+(204, 7502, 0, 0, 4, 4, 4, 204, 204, 204, 204, 8, 9, 'WHAAAA', 'OCLAAA', 'OOOOxx'),
+(8224, 7503, 0, 0, 4, 4, 24, 224, 224, 3224, 8224, 48, 49, 'IEAAAA', 'PCLAAA', 'VVVVxx'),
+(2944, 7504, 0, 0, 4, 4, 44, 944, 944, 2944, 2944, 88, 89, 'GJAAAA', 'QCLAAA', 'AAAAxx'),
+(7593, 7505, 1, 1, 3, 13, 93, 593, 1593, 2593, 7593, 186, 187, 'BGAAAA', 'RCLAAA', 'HHHHxx'),
+(814, 7506, 0, 2, 4, 14, 14, 814, 814, 814, 814, 28, 29, 'IFAAAA', 'SCLAAA', 'OOOOxx'),
+(8047, 7507, 1, 3, 7, 7, 47, 47, 47, 3047, 8047, 94, 95, 'NXAAAA', 'TCLAAA', 'VVVVxx'),
+(7802, 7508, 0, 2, 2, 2, 2, 802, 1802, 2802, 7802, 4, 5, 'COAAAA', 'UCLAAA', 'AAAAxx'),
+(901, 7509, 1, 1, 1, 1, 1, 901, 901, 901, 901, 2, 3, 'RIAAAA', 'VCLAAA', 'HHHHxx'),
+(6168, 7510, 0, 0, 8, 8, 68, 168, 168, 1168, 6168, 136, 137, 'GDAAAA', 'WCLAAA', 'OOOOxx'),
+(2950, 7511, 0, 2, 0, 10, 50, 950, 950, 2950, 2950, 100, 101, 'MJAAAA', 'XCLAAA', 'VVVVxx'),
+(5393, 7512, 1, 1, 3, 13, 93, 393, 1393, 393, 5393, 186, 187, 'LZAAAA', 'YCLAAA', 'AAAAxx'),
+(3585, 7513, 1, 1, 5, 5, 85, 585, 1585, 3585, 3585, 170, 171, 'XHAAAA', 'ZCLAAA', 'HHHHxx'),
+(9392, 7514, 0, 0, 2, 12, 92, 392, 1392, 4392, 9392, 184, 185, 'GXAAAA', 'ADLAAA', 'OOOOxx'),
+(8314, 7515, 0, 2, 4, 14, 14, 314, 314, 3314, 8314, 28, 29, 'UHAAAA', 'BDLAAA', 'VVVVxx'),
+(9972, 7516, 0, 0, 2, 12, 72, 972, 1972, 4972, 9972, 144, 145, 'OTAAAA', 'CDLAAA', 'AAAAxx'),
+(9130, 7517, 0, 2, 0, 10, 30, 130, 1130, 4130, 9130, 60, 61, 'ENAAAA', 'DDLAAA', 'HHHHxx'),
+(975, 7518, 1, 3, 5, 15, 75, 975, 975, 975, 975, 150, 151, 'NLAAAA', 'EDLAAA', 'OOOOxx'),
+(5720, 7519, 0, 0, 0, 0, 20, 720, 1720, 720, 5720, 40, 41, 'AMAAAA', 'FDLAAA', 'VVVVxx'),
+(3769, 7520, 1, 1, 9, 9, 69, 769, 1769, 3769, 3769, 138, 139, 'ZOAAAA', 'GDLAAA', 'AAAAxx'),
+(5303, 7521, 1, 3, 3, 3, 3, 303, 1303, 303, 5303, 6, 7, 'ZVAAAA', 'HDLAAA', 'HHHHxx'),
+(6564, 7522, 0, 0, 4, 4, 64, 564, 564, 1564, 6564, 128, 129, 'MSAAAA', 'IDLAAA', 'OOOOxx'),
+(7855, 7523, 1, 3, 5, 15, 55, 855, 1855, 2855, 7855, 110, 111, 'DQAAAA', 'JDLAAA', 'VVVVxx'),
+(8153, 7524, 1, 1, 3, 13, 53, 153, 153, 3153, 8153, 106, 107, 'PBAAAA', 'KDLAAA', 'AAAAxx'),
+(2292, 7525, 0, 0, 2, 12, 92, 292, 292, 2292, 2292, 184, 185, 'EKAAAA', 'LDLAAA', 'HHHHxx'),
+(3156, 7526, 0, 0, 6, 16, 56, 156, 1156, 3156, 3156, 112, 113, 'KRAAAA', 'MDLAAA', 'OOOOxx'),
+(6580, 7527, 0, 0, 0, 0, 80, 580, 580, 1580, 6580, 160, 161, 'CTAAAA', 'NDLAAA', 'VVVVxx'),
+(5324, 7528, 0, 0, 4, 4, 24, 324, 1324, 324, 5324, 48, 49, 'UWAAAA', 'ODLAAA', 'AAAAxx'),
+(8871, 7529, 1, 3, 1, 11, 71, 871, 871, 3871, 8871, 142, 143, 'FDAAAA', 'PDLAAA', 'HHHHxx'),
+(2543, 7530, 1, 3, 3, 3, 43, 543, 543, 2543, 2543, 86, 87, 'VTAAAA', 'QDLAAA', 'OOOOxx'),
+(7857, 7531, 1, 1, 7, 17, 57, 857, 1857, 2857, 7857, 114, 115, 'FQAAAA', 'RDLAAA', 'VVVVxx'),
+(4084, 7532, 0, 0, 4, 4, 84, 84, 84, 4084, 4084, 168, 169, 'CBAAAA', 'SDLAAA', 'AAAAxx'),
+(9887, 7533, 1, 3, 7, 7, 87, 887, 1887, 4887, 9887, 174, 175, 'HQAAAA', 'TDLAAA', 'HHHHxx'),
+(6940, 7534, 0, 0, 0, 0, 40, 940, 940, 1940, 6940, 80, 81, 'YGAAAA', 'UDLAAA', 'OOOOxx'),
+(3415, 7535, 1, 3, 5, 15, 15, 415, 1415, 3415, 3415, 30, 31, 'JBAAAA', 'VDLAAA', 'VVVVxx'),
+(5012, 7536, 0, 0, 2, 12, 12, 12, 1012, 12, 5012, 24, 25, 'UKAAAA', 'WDLAAA', 'AAAAxx'),
+(3187, 7537, 1, 3, 7, 7, 87, 187, 1187, 3187, 3187, 174, 175, 'PSAAAA', 'XDLAAA', 'HHHHxx'),
+(8556, 7538, 0, 0, 6, 16, 56, 556, 556, 3556, 8556, 112, 113, 'CRAAAA', 'YDLAAA', 'OOOOxx'),
+(7966, 7539, 0, 2, 6, 6, 66, 966, 1966, 2966, 7966, 132, 133, 'KUAAAA', 'ZDLAAA', 'VVVVxx'),
+(7481, 7540, 1, 1, 1, 1, 81, 481, 1481, 2481, 7481, 162, 163, 'TBAAAA', 'AELAAA', 'AAAAxx'),
+(8524, 7541, 0, 0, 4, 4, 24, 524, 524, 3524, 8524, 48, 49, 'WPAAAA', 'BELAAA', 'HHHHxx'),
+(3021, 7542, 1, 1, 1, 1, 21, 21, 1021, 3021, 3021, 42, 43, 'FMAAAA', 'CELAAA', 'OOOOxx'),
+(6045, 7543, 1, 1, 5, 5, 45, 45, 45, 1045, 6045, 90, 91, 'NYAAAA', 'DELAAA', 'VVVVxx'),
+(8022, 7544, 0, 2, 2, 2, 22, 22, 22, 3022, 8022, 44, 45, 'OWAAAA', 'EELAAA', 'AAAAxx'),
+(3626, 7545, 0, 2, 6, 6, 26, 626, 1626, 3626, 3626, 52, 53, 'MJAAAA', 'FELAAA', 'HHHHxx'),
+(1030, 7546, 0, 2, 0, 10, 30, 30, 1030, 1030, 1030, 60, 61, 'QNAAAA', 'GELAAA', 'OOOOxx'),
+(8903, 7547, 1, 3, 3, 3, 3, 903, 903, 3903, 8903, 6, 7, 'LEAAAA', 'HELAAA', 'VVVVxx'),
+(7488, 7548, 0, 0, 8, 8, 88, 488, 1488, 2488, 7488, 176, 177, 'ACAAAA', 'IELAAA', 'AAAAxx'),
+(9293, 7549, 1, 1, 3, 13, 93, 293, 1293, 4293, 9293, 186, 187, 'LTAAAA', 'JELAAA', 'HHHHxx'),
+(4586, 7550, 0, 2, 6, 6, 86, 586, 586, 4586, 4586, 172, 173, 'KUAAAA', 'KELAAA', 'OOOOxx'),
+(9282, 7551, 0, 2, 2, 2, 82, 282, 1282, 4282, 9282, 164, 165, 'ATAAAA', 'LELAAA', 'VVVVxx'),
+(1948, 7552, 0, 0, 8, 8, 48, 948, 1948, 1948, 1948, 96, 97, 'YWAAAA', 'MELAAA', 'AAAAxx'),
+(2534, 7553, 0, 2, 4, 14, 34, 534, 534, 2534, 2534, 68, 69, 'MTAAAA', 'NELAAA', 'HHHHxx'),
+(1150, 7554, 0, 2, 0, 10, 50, 150, 1150, 1150, 1150, 100, 101, 'GSAAAA', 'OELAAA', 'OOOOxx'),
+(4931, 7555, 1, 3, 1, 11, 31, 931, 931, 4931, 4931, 62, 63, 'RHAAAA', 'PELAAA', 'VVVVxx'),
+(2866, 7556, 0, 2, 6, 6, 66, 866, 866, 2866, 2866, 132, 133, 'GGAAAA', 'QELAAA', 'AAAAxx'),
+(6172, 7557, 0, 0, 2, 12, 72, 172, 172, 1172, 6172, 144, 145, 'KDAAAA', 'RELAAA', 'HHHHxx'),
+(4819, 7558, 1, 3, 9, 19, 19, 819, 819, 4819, 4819, 38, 39, 'JDAAAA', 'SELAAA', 'OOOOxx'),
+(569, 7559, 1, 1, 9, 9, 69, 569, 569, 569, 569, 138, 139, 'XVAAAA', 'TELAAA', 'VVVVxx'),
+(1146, 7560, 0, 2, 6, 6, 46, 146, 1146, 1146, 1146, 92, 93, 'CSAAAA', 'UELAAA', 'AAAAxx'),
+(3062, 7561, 0, 2, 2, 2, 62, 62, 1062, 3062, 3062, 124, 125, 'UNAAAA', 'VELAAA', 'HHHHxx'),
+(7690, 7562, 0, 2, 0, 10, 90, 690, 1690, 2690, 7690, 180, 181, 'UJAAAA', 'WELAAA', 'OOOOxx'),
+(8611, 7563, 1, 3, 1, 11, 11, 611, 611, 3611, 8611, 22, 23, 'FTAAAA', 'XELAAA', 'VVVVxx'),
+(1142, 7564, 0, 2, 2, 2, 42, 142, 1142, 1142, 1142, 84, 85, 'YRAAAA', 'YELAAA', 'AAAAxx'),
+(1193, 7565, 1, 1, 3, 13, 93, 193, 1193, 1193, 1193, 186, 187, 'XTAAAA', 'ZELAAA', 'HHHHxx'),
+(2507, 7566, 1, 3, 7, 7, 7, 507, 507, 2507, 2507, 14, 15, 'LSAAAA', 'AFLAAA', 'OOOOxx'),
+(1043, 7567, 1, 3, 3, 3, 43, 43, 1043, 1043, 1043, 86, 87, 'DOAAAA', 'BFLAAA', 'VVVVxx'),
+(7472, 7568, 0, 0, 2, 12, 72, 472, 1472, 2472, 7472, 144, 145, 'KBAAAA', 'CFLAAA', 'AAAAxx'),
+(1817, 7569, 1, 1, 7, 17, 17, 817, 1817, 1817, 1817, 34, 35, 'XRAAAA', 'DFLAAA', 'HHHHxx'),
+(3868, 7570, 0, 0, 8, 8, 68, 868, 1868, 3868, 3868, 136, 137, 'USAAAA', 'EFLAAA', 'OOOOxx'),
+(9031, 7571, 1, 3, 1, 11, 31, 31, 1031, 4031, 9031, 62, 63, 'JJAAAA', 'FFLAAA', 'VVVVxx'),
+(7254, 7572, 0, 2, 4, 14, 54, 254, 1254, 2254, 7254, 108, 109, 'ATAAAA', 'GFLAAA', 'AAAAxx'),
+(5030, 7573, 0, 2, 0, 10, 30, 30, 1030, 30, 5030, 60, 61, 'MLAAAA', 'HFLAAA', 'HHHHxx'),
+(6594, 7574, 0, 2, 4, 14, 94, 594, 594, 1594, 6594, 188, 189, 'QTAAAA', 'IFLAAA', 'OOOOxx'),
+(6862, 7575, 0, 2, 2, 2, 62, 862, 862, 1862, 6862, 124, 125, 'YDAAAA', 'JFLAAA', 'VVVVxx'),
+(1994, 7576, 0, 2, 4, 14, 94, 994, 1994, 1994, 1994, 188, 189, 'SYAAAA', 'KFLAAA', 'AAAAxx'),
+(9017, 7577, 1, 1, 7, 17, 17, 17, 1017, 4017, 9017, 34, 35, 'VIAAAA', 'LFLAAA', 'HHHHxx'),
+(5716, 7578, 0, 0, 6, 16, 16, 716, 1716, 716, 5716, 32, 33, 'WLAAAA', 'MFLAAA', 'OOOOxx'),
+(1900, 7579, 0, 0, 0, 0, 0, 900, 1900, 1900, 1900, 0, 1, 'CVAAAA', 'NFLAAA', 'VVVVxx'),
+(120, 7580, 0, 0, 0, 0, 20, 120, 120, 120, 120, 40, 41, 'QEAAAA', 'OFLAAA', 'AAAAxx'),
+(9003, 7581, 1, 3, 3, 3, 3, 3, 1003, 4003, 9003, 6, 7, 'HIAAAA', 'PFLAAA', 'HHHHxx'),
+(4178, 7582, 0, 2, 8, 18, 78, 178, 178, 4178, 4178, 156, 157, 'SEAAAA', 'QFLAAA', 'OOOOxx'),
+(8777, 7583, 1, 1, 7, 17, 77, 777, 777, 3777, 8777, 154, 155, 'PZAAAA', 'RFLAAA', 'VVVVxx'),
+(3653, 7584, 1, 1, 3, 13, 53, 653, 1653, 3653, 3653, 106, 107, 'NKAAAA', 'SFLAAA', 'AAAAxx'),
+(1137, 7585, 1, 1, 7, 17, 37, 137, 1137, 1137, 1137, 74, 75, 'TRAAAA', 'TFLAAA', 'HHHHxx'),
+(6362, 7586, 0, 2, 2, 2, 62, 362, 362, 1362, 6362, 124, 125, 'SKAAAA', 'UFLAAA', 'OOOOxx'),
+(8537, 7587, 1, 1, 7, 17, 37, 537, 537, 3537, 8537, 74, 75, 'JQAAAA', 'VFLAAA', 'VVVVxx'),
+(1590, 7588, 0, 2, 0, 10, 90, 590, 1590, 1590, 1590, 180, 181, 'EJAAAA', 'WFLAAA', 'AAAAxx'),
+(374, 7589, 0, 2, 4, 14, 74, 374, 374, 374, 374, 148, 149, 'KOAAAA', 'XFLAAA', 'HHHHxx'),
+(2597, 7590, 1, 1, 7, 17, 97, 597, 597, 2597, 2597, 194, 195, 'XVAAAA', 'YFLAAA', 'OOOOxx'),
+(8071, 7591, 1, 3, 1, 11, 71, 71, 71, 3071, 8071, 142, 143, 'LYAAAA', 'ZFLAAA', 'VVVVxx'),
+(9009, 7592, 1, 1, 9, 9, 9, 9, 1009, 4009, 9009, 18, 19, 'NIAAAA', 'AGLAAA', 'AAAAxx'),
+(1978, 7593, 0, 2, 8, 18, 78, 978, 1978, 1978, 1978, 156, 157, 'CYAAAA', 'BGLAAA', 'HHHHxx'),
+(1541, 7594, 1, 1, 1, 1, 41, 541, 1541, 1541, 1541, 82, 83, 'HHAAAA', 'CGLAAA', 'OOOOxx'),
+(4998, 7595, 0, 2, 8, 18, 98, 998, 998, 4998, 4998, 196, 197, 'GKAAAA', 'DGLAAA', 'VVVVxx'),
+(1649, 7596, 1, 1, 9, 9, 49, 649, 1649, 1649, 1649, 98, 99, 'LLAAAA', 'EGLAAA', 'AAAAxx'),
+(5426, 7597, 0, 2, 6, 6, 26, 426, 1426, 426, 5426, 52, 53, 'SAAAAA', 'FGLAAA', 'HHHHxx'),
+(1492, 7598, 0, 0, 2, 12, 92, 492, 1492, 1492, 1492, 184, 185, 'KFAAAA', 'GGLAAA', 'OOOOxx'),
+(9622, 7599, 0, 2, 2, 2, 22, 622, 1622, 4622, 9622, 44, 45, 'CGAAAA', 'HGLAAA', 'VVVVxx'),
+(701, 7600, 1, 1, 1, 1, 1, 701, 701, 701, 701, 2, 3, 'ZAAAAA', 'IGLAAA', 'AAAAxx'),
+(2781, 7601, 1, 1, 1, 1, 81, 781, 781, 2781, 2781, 162, 163, 'ZCAAAA', 'JGLAAA', 'HHHHxx'),
+(3982, 7602, 0, 2, 2, 2, 82, 982, 1982, 3982, 3982, 164, 165, 'EXAAAA', 'KGLAAA', 'OOOOxx'),
+(7259, 7603, 1, 3, 9, 19, 59, 259, 1259, 2259, 7259, 118, 119, 'FTAAAA', 'LGLAAA', 'VVVVxx'),
+(9868, 7604, 0, 0, 8, 8, 68, 868, 1868, 4868, 9868, 136, 137, 'OPAAAA', 'MGLAAA', 'AAAAxx'),
+(564, 7605, 0, 0, 4, 4, 64, 564, 564, 564, 564, 128, 129, 'SVAAAA', 'NGLAAA', 'HHHHxx'),
+(6315, 7606, 1, 3, 5, 15, 15, 315, 315, 1315, 6315, 30, 31, 'XIAAAA', 'OGLAAA', 'OOOOxx'),
+(9092, 7607, 0, 0, 2, 12, 92, 92, 1092, 4092, 9092, 184, 185, 'SLAAAA', 'PGLAAA', 'VVVVxx'),
+(8237, 7608, 1, 1, 7, 17, 37, 237, 237, 3237, 8237, 74, 75, 'VEAAAA', 'QGLAAA', 'AAAAxx'),
+(1513, 7609, 1, 1, 3, 13, 13, 513, 1513, 1513, 1513, 26, 27, 'FGAAAA', 'RGLAAA', 'HHHHxx'),
+(1922, 7610, 0, 2, 2, 2, 22, 922, 1922, 1922, 1922, 44, 45, 'YVAAAA', 'SGLAAA', 'OOOOxx'),
+(5396, 7611, 0, 0, 6, 16, 96, 396, 1396, 396, 5396, 192, 193, 'OZAAAA', 'TGLAAA', 'VVVVxx'),
+(2485, 7612, 1, 1, 5, 5, 85, 485, 485, 2485, 2485, 170, 171, 'PRAAAA', 'UGLAAA', 'AAAAxx'),
+(5774, 7613, 0, 2, 4, 14, 74, 774, 1774, 774, 5774, 148, 149, 'COAAAA', 'VGLAAA', 'HHHHxx'),
+(3983, 7614, 1, 3, 3, 3, 83, 983, 1983, 3983, 3983, 166, 167, 'FXAAAA', 'WGLAAA', 'OOOOxx'),
+(221, 7615, 1, 1, 1, 1, 21, 221, 221, 221, 221, 42, 43, 'NIAAAA', 'XGLAAA', 'VVVVxx'),
+(8662, 7616, 0, 2, 2, 2, 62, 662, 662, 3662, 8662, 124, 125, 'EVAAAA', 'YGLAAA', 'AAAAxx'),
+(2456, 7617, 0, 0, 6, 16, 56, 456, 456, 2456, 2456, 112, 113, 'MQAAAA', 'ZGLAAA', 'HHHHxx'),
+(9736, 7618, 0, 0, 6, 16, 36, 736, 1736, 4736, 9736, 72, 73, 'MKAAAA', 'AHLAAA', 'OOOOxx'),
+(8936, 7619, 0, 0, 6, 16, 36, 936, 936, 3936, 8936, 72, 73, 'SFAAAA', 'BHLAAA', 'VVVVxx'),
+(5395, 7620, 1, 3, 5, 15, 95, 395, 1395, 395, 5395, 190, 191, 'NZAAAA', 'CHLAAA', 'AAAAxx'),
+(9523, 7621, 1, 3, 3, 3, 23, 523, 1523, 4523, 9523, 46, 47, 'HCAAAA', 'DHLAAA', 'HHHHxx'),
+(6980, 7622, 0, 0, 0, 0, 80, 980, 980, 1980, 6980, 160, 161, 'MIAAAA', 'EHLAAA', 'OOOOxx'),
+(2091, 7623, 1, 3, 1, 11, 91, 91, 91, 2091, 2091, 182, 183, 'LCAAAA', 'FHLAAA', 'VVVVxx'),
+(6807, 7624, 1, 3, 7, 7, 7, 807, 807, 1807, 6807, 14, 15, 'VBAAAA', 'GHLAAA', 'AAAAxx'),
+(8818, 7625, 0, 2, 8, 18, 18, 818, 818, 3818, 8818, 36, 37, 'EBAAAA', 'HHLAAA', 'HHHHxx'),
+(5298, 7626, 0, 2, 8, 18, 98, 298, 1298, 298, 5298, 196, 197, 'UVAAAA', 'IHLAAA', 'OOOOxx'),
+(1726, 7627, 0, 2, 6, 6, 26, 726, 1726, 1726, 1726, 52, 53, 'KOAAAA', 'JHLAAA', 'VVVVxx'),
+(3878, 7628, 0, 2, 8, 18, 78, 878, 1878, 3878, 3878, 156, 157, 'ETAAAA', 'KHLAAA', 'AAAAxx'),
+(8700, 7629, 0, 0, 0, 0, 0, 700, 700, 3700, 8700, 0, 1, 'QWAAAA', 'LHLAAA', 'HHHHxx'),
+(5201, 7630, 1, 1, 1, 1, 1, 201, 1201, 201, 5201, 2, 3, 'BSAAAA', 'MHLAAA', 'OOOOxx'),
+(3936, 7631, 0, 0, 6, 16, 36, 936, 1936, 3936, 3936, 72, 73, 'KVAAAA', 'NHLAAA', 'VVVVxx'),
+(776, 7632, 0, 0, 6, 16, 76, 776, 776, 776, 776, 152, 153, 'WDAAAA', 'OHLAAA', 'AAAAxx'),
+(5302, 7633, 0, 2, 2, 2, 2, 302, 1302, 302, 5302, 4, 5, 'YVAAAA', 'PHLAAA', 'HHHHxx'),
+(3595, 7634, 1, 3, 5, 15, 95, 595, 1595, 3595, 3595, 190, 191, 'HIAAAA', 'QHLAAA', 'OOOOxx'),
+(9061, 7635, 1, 1, 1, 1, 61, 61, 1061, 4061, 9061, 122, 123, 'NKAAAA', 'RHLAAA', 'VVVVxx'),
+(6261, 7636, 1, 1, 1, 1, 61, 261, 261, 1261, 6261, 122, 123, 'VGAAAA', 'SHLAAA', 'AAAAxx'),
+(8878, 7637, 0, 2, 8, 18, 78, 878, 878, 3878, 8878, 156, 157, 'MDAAAA', 'THLAAA', 'HHHHxx'),
+(3312, 7638, 0, 0, 2, 12, 12, 312, 1312, 3312, 3312, 24, 25, 'KXAAAA', 'UHLAAA', 'OOOOxx'),
+(9422, 7639, 0, 2, 2, 2, 22, 422, 1422, 4422, 9422, 44, 45, 'KYAAAA', 'VHLAAA', 'VVVVxx'),
+(7321, 7640, 1, 1, 1, 1, 21, 321, 1321, 2321, 7321, 42, 43, 'PVAAAA', 'WHLAAA', 'AAAAxx'),
+(3813, 7641, 1, 1, 3, 13, 13, 813, 1813, 3813, 3813, 26, 27, 'RQAAAA', 'XHLAAA', 'HHHHxx'),
+(5848, 7642, 0, 0, 8, 8, 48, 848, 1848, 848, 5848, 96, 97, 'YQAAAA', 'YHLAAA', 'OOOOxx'),
+(3535, 7643, 1, 3, 5, 15, 35, 535, 1535, 3535, 3535, 70, 71, 'ZFAAAA', 'ZHLAAA', 'VVVVxx'),
+(1040, 7644, 0, 0, 0, 0, 40, 40, 1040, 1040, 1040, 80, 81, 'AOAAAA', 'AILAAA', 'AAAAxx'),
+(8572, 7645, 0, 0, 2, 12, 72, 572, 572, 3572, 8572, 144, 145, 'SRAAAA', 'BILAAA', 'HHHHxx'),
+(5435, 7646, 1, 3, 5, 15, 35, 435, 1435, 435, 5435, 70, 71, 'BBAAAA', 'CILAAA', 'OOOOxx'),
+(8199, 7647, 1, 3, 9, 19, 99, 199, 199, 3199, 8199, 198, 199, 'JDAAAA', 'DILAAA', 'VVVVxx'),
+(8775, 7648, 1, 3, 5, 15, 75, 775, 775, 3775, 8775, 150, 151, 'NZAAAA', 'EILAAA', 'AAAAxx'),
+(7722, 7649, 0, 2, 2, 2, 22, 722, 1722, 2722, 7722, 44, 45, 'ALAAAA', 'FILAAA', 'HHHHxx'),
+(3549, 7650, 1, 1, 9, 9, 49, 549, 1549, 3549, 3549, 98, 99, 'NGAAAA', 'GILAAA', 'OOOOxx'),
+(2578, 7651, 0, 2, 8, 18, 78, 578, 578, 2578, 2578, 156, 157, 'EVAAAA', 'HILAAA', 'VVVVxx'),
+(1695, 7652, 1, 3, 5, 15, 95, 695, 1695, 1695, 1695, 190, 191, 'FNAAAA', 'IILAAA', 'AAAAxx'),
+(1902, 7653, 0, 2, 2, 2, 2, 902, 1902, 1902, 1902, 4, 5, 'EVAAAA', 'JILAAA', 'HHHHxx'),
+(6058, 7654, 0, 2, 8, 18, 58, 58, 58, 1058, 6058, 116, 117, 'AZAAAA', 'KILAAA', 'OOOOxx'),
+(6591, 7655, 1, 3, 1, 11, 91, 591, 591, 1591, 6591, 182, 183, 'NTAAAA', 'LILAAA', 'VVVVxx'),
+(7962, 7656, 0, 2, 2, 2, 62, 962, 1962, 2962, 7962, 124, 125, 'GUAAAA', 'MILAAA', 'AAAAxx'),
+(5612, 7657, 0, 0, 2, 12, 12, 612, 1612, 612, 5612, 24, 25, 'WHAAAA', 'NILAAA', 'HHHHxx'),
+(3341, 7658, 1, 1, 1, 1, 41, 341, 1341, 3341, 3341, 82, 83, 'NYAAAA', 'OILAAA', 'OOOOxx'),
+(5460, 7659, 0, 0, 0, 0, 60, 460, 1460, 460, 5460, 120, 121, 'ACAAAA', 'PILAAA', 'VVVVxx'),
+(2368, 7660, 0, 0, 8, 8, 68, 368, 368, 2368, 2368, 136, 137, 'CNAAAA', 'QILAAA', 'AAAAxx'),
+(8646, 7661, 0, 2, 6, 6, 46, 646, 646, 3646, 8646, 92, 93, 'OUAAAA', 'RILAAA', 'HHHHxx'),
+(4987, 7662, 1, 3, 7, 7, 87, 987, 987, 4987, 4987, 174, 175, 'VJAAAA', 'SILAAA', 'OOOOxx'),
+(9018, 7663, 0, 2, 8, 18, 18, 18, 1018, 4018, 9018, 36, 37, 'WIAAAA', 'TILAAA', 'VVVVxx'),
+(8685, 7664, 1, 1, 5, 5, 85, 685, 685, 3685, 8685, 170, 171, 'BWAAAA', 'UILAAA', 'AAAAxx'),
+(694, 7665, 0, 2, 4, 14, 94, 694, 694, 694, 694, 188, 189, 'SAAAAA', 'VILAAA', 'HHHHxx'),
+(2012, 7666, 0, 0, 2, 12, 12, 12, 12, 2012, 2012, 24, 25, 'KZAAAA', 'WILAAA', 'OOOOxx'),
+(2417, 7667, 1, 1, 7, 17, 17, 417, 417, 2417, 2417, 34, 35, 'ZOAAAA', 'XILAAA', 'VVVVxx'),
+(4022, 7668, 0, 2, 2, 2, 22, 22, 22, 4022, 4022, 44, 45, 'SYAAAA', 'YILAAA', 'AAAAxx'),
+(5935, 7669, 1, 3, 5, 15, 35, 935, 1935, 935, 5935, 70, 71, 'HUAAAA', 'ZILAAA', 'HHHHxx'),
+(1656, 7670, 0, 0, 6, 16, 56, 656, 1656, 1656, 1656, 112, 113, 'SLAAAA', 'AJLAAA', 'OOOOxx'),
+(6195, 7671, 1, 3, 5, 15, 95, 195, 195, 1195, 6195, 190, 191, 'HEAAAA', 'BJLAAA', 'VVVVxx'),
+(3057, 7672, 1, 1, 7, 17, 57, 57, 1057, 3057, 3057, 114, 115, 'PNAAAA', 'CJLAAA', 'AAAAxx'),
+(2852, 7673, 0, 0, 2, 12, 52, 852, 852, 2852, 2852, 104, 105, 'SFAAAA', 'DJLAAA', 'HHHHxx'),
+(4634, 7674, 0, 2, 4, 14, 34, 634, 634, 4634, 4634, 68, 69, 'GWAAAA', 'EJLAAA', 'OOOOxx'),
+(1689, 7675, 1, 1, 9, 9, 89, 689, 1689, 1689, 1689, 178, 179, 'ZMAAAA', 'FJLAAA', 'VVVVxx'),
+(4102, 7676, 0, 2, 2, 2, 2, 102, 102, 4102, 4102, 4, 5, 'UBAAAA', 'GJLAAA', 'AAAAxx'),
+(3287, 7677, 1, 3, 7, 7, 87, 287, 1287, 3287, 3287, 174, 175, 'LWAAAA', 'HJLAAA', 'HHHHxx'),
+(5246, 7678, 0, 2, 6, 6, 46, 246, 1246, 246, 5246, 92, 93, 'UTAAAA', 'IJLAAA', 'OOOOxx'),
+(7450, 7679, 0, 2, 0, 10, 50, 450, 1450, 2450, 7450, 100, 101, 'OAAAAA', 'JJLAAA', 'VVVVxx'),
+(6548, 7680, 0, 0, 8, 8, 48, 548, 548, 1548, 6548, 96, 97, 'WRAAAA', 'KJLAAA', 'AAAAxx'),
+(379, 7681, 1, 3, 9, 19, 79, 379, 379, 379, 379, 158, 159, 'POAAAA', 'LJLAAA', 'HHHHxx'),
+(7435, 7682, 1, 3, 5, 15, 35, 435, 1435, 2435, 7435, 70, 71, 'ZZAAAA', 'MJLAAA', 'OOOOxx'),
+(2041, 7683, 1, 1, 1, 1, 41, 41, 41, 2041, 2041, 82, 83, 'NAAAAA', 'NJLAAA', 'VVVVxx'),
+(8462, 7684, 0, 2, 2, 2, 62, 462, 462, 3462, 8462, 124, 125, 'MNAAAA', 'OJLAAA', 'AAAAxx'),
+(9076, 7685, 0, 0, 6, 16, 76, 76, 1076, 4076, 9076, 152, 153, 'CLAAAA', 'PJLAAA', 'HHHHxx'),
+(761, 7686, 1, 1, 1, 1, 61, 761, 761, 761, 761, 122, 123, 'HDAAAA', 'QJLAAA', 'OOOOxx'),
+(795, 7687, 1, 3, 5, 15, 95, 795, 795, 795, 795, 190, 191, 'PEAAAA', 'RJLAAA', 'VVVVxx'),
+(1671, 7688, 1, 3, 1, 11, 71, 671, 1671, 1671, 1671, 142, 143, 'HMAAAA', 'SJLAAA', 'AAAAxx'),
+(695, 7689, 1, 3, 5, 15, 95, 695, 695, 695, 695, 190, 191, 'TAAAAA', 'TJLAAA', 'HHHHxx'),
+(4981, 7690, 1, 1, 1, 1, 81, 981, 981, 4981, 4981, 162, 163, 'PJAAAA', 'UJLAAA', 'OOOOxx'),
+(1211, 7691, 1, 3, 1, 11, 11, 211, 1211, 1211, 1211, 22, 23, 'PUAAAA', 'VJLAAA', 'VVVVxx'),
+(5914, 7692, 0, 2, 4, 14, 14, 914, 1914, 914, 5914, 28, 29, 'MTAAAA', 'WJLAAA', 'AAAAxx'),
+(9356, 7693, 0, 0, 6, 16, 56, 356, 1356, 4356, 9356, 112, 113, 'WVAAAA', 'XJLAAA', 'HHHHxx'),
+(1500, 7694, 0, 0, 0, 0, 0, 500, 1500, 1500, 1500, 0, 1, 'SFAAAA', 'YJLAAA', 'OOOOxx'),
+(3353, 7695, 1, 1, 3, 13, 53, 353, 1353, 3353, 3353, 106, 107, 'ZYAAAA', 'ZJLAAA', 'VVVVxx'),
+(1060, 7696, 0, 0, 0, 0, 60, 60, 1060, 1060, 1060, 120, 121, 'UOAAAA', 'AKLAAA', 'AAAAxx'),
+(7910, 7697, 0, 2, 0, 10, 10, 910, 1910, 2910, 7910, 20, 21, 'GSAAAA', 'BKLAAA', 'HHHHxx'),
+(1329, 7698, 1, 1, 9, 9, 29, 329, 1329, 1329, 1329, 58, 59, 'DZAAAA', 'CKLAAA', 'OOOOxx'),
+(6011, 7699, 1, 3, 1, 11, 11, 11, 11, 1011, 6011, 22, 23, 'FXAAAA', 'DKLAAA', 'VVVVxx'),
+(7146, 7700, 0, 2, 6, 6, 46, 146, 1146, 2146, 7146, 92, 93, 'WOAAAA', 'EKLAAA', 'AAAAxx'),
+(4602, 7701, 0, 2, 2, 2, 2, 602, 602, 4602, 4602, 4, 5, 'AVAAAA', 'FKLAAA', 'HHHHxx'),
+(6751, 7702, 1, 3, 1, 11, 51, 751, 751, 1751, 6751, 102, 103, 'RZAAAA', 'GKLAAA', 'OOOOxx'),
+(2666, 7703, 0, 2, 6, 6, 66, 666, 666, 2666, 2666, 132, 133, 'OYAAAA', 'HKLAAA', 'VVVVxx'),
+(2785, 7704, 1, 1, 5, 5, 85, 785, 785, 2785, 2785, 170, 171, 'DDAAAA', 'IKLAAA', 'AAAAxx'),
+(5851, 7705, 1, 3, 1, 11, 51, 851, 1851, 851, 5851, 102, 103, 'BRAAAA', 'JKLAAA', 'HHHHxx'),
+(2435, 7706, 1, 3, 5, 15, 35, 435, 435, 2435, 2435, 70, 71, 'RPAAAA', 'KKLAAA', 'OOOOxx'),
+(7429, 7707, 1, 1, 9, 9, 29, 429, 1429, 2429, 7429, 58, 59, 'TZAAAA', 'LKLAAA', 'VVVVxx'),
+(4241, 7708, 1, 1, 1, 1, 41, 241, 241, 4241, 4241, 82, 83, 'DHAAAA', 'MKLAAA', 'AAAAxx'),
+(5691, 7709, 1, 3, 1, 11, 91, 691, 1691, 691, 5691, 182, 183, 'XKAAAA', 'NKLAAA', 'HHHHxx'),
+(7731, 7710, 1, 3, 1, 11, 31, 731, 1731, 2731, 7731, 62, 63, 'JLAAAA', 'OKLAAA', 'OOOOxx'),
+(249, 7711, 1, 1, 9, 9, 49, 249, 249, 249, 249, 98, 99, 'PJAAAA', 'PKLAAA', 'VVVVxx'),
+(1731, 7712, 1, 3, 1, 11, 31, 731, 1731, 1731, 1731, 62, 63, 'POAAAA', 'QKLAAA', 'AAAAxx'),
+(8716, 7713, 0, 0, 6, 16, 16, 716, 716, 3716, 8716, 32, 33, 'GXAAAA', 'RKLAAA', 'HHHHxx'),
+(2670, 7714, 0, 2, 0, 10, 70, 670, 670, 2670, 2670, 140, 141, 'SYAAAA', 'SKLAAA', 'OOOOxx'),
+(4654, 7715, 0, 2, 4, 14, 54, 654, 654, 4654, 4654, 108, 109, 'AXAAAA', 'TKLAAA', 'VVVVxx'),
+(1027, 7716, 1, 3, 7, 7, 27, 27, 1027, 1027, 1027, 54, 55, 'NNAAAA', 'UKLAAA', 'AAAAxx'),
+(1099, 7717, 1, 3, 9, 19, 99, 99, 1099, 1099, 1099, 198, 199, 'HQAAAA', 'VKLAAA', 'HHHHxx'),
+(3617, 7718, 1, 1, 7, 17, 17, 617, 1617, 3617, 3617, 34, 35, 'DJAAAA', 'WKLAAA', 'OOOOxx'),
+(4330, 7719, 0, 2, 0, 10, 30, 330, 330, 4330, 4330, 60, 61, 'OKAAAA', 'XKLAAA', 'VVVVxx'),
+(9750, 7720, 0, 2, 0, 10, 50, 750, 1750, 4750, 9750, 100, 101, 'ALAAAA', 'YKLAAA', 'AAAAxx'),
+(467, 7721, 1, 3, 7, 7, 67, 467, 467, 467, 467, 134, 135, 'ZRAAAA', 'ZKLAAA', 'HHHHxx'),
+(8525, 7722, 1, 1, 5, 5, 25, 525, 525, 3525, 8525, 50, 51, 'XPAAAA', 'ALLAAA', 'OOOOxx'),
+(5990, 7723, 0, 2, 0, 10, 90, 990, 1990, 990, 5990, 180, 181, 'KWAAAA', 'BLLAAA', 'VVVVxx'),
+(4839, 7724, 1, 3, 9, 19, 39, 839, 839, 4839, 4839, 78, 79, 'DEAAAA', 'CLLAAA', 'AAAAxx'),
+(9914, 7725, 0, 2, 4, 14, 14, 914, 1914, 4914, 9914, 28, 29, 'IRAAAA', 'DLLAAA', 'HHHHxx'),
+(7047, 7726, 1, 3, 7, 7, 47, 47, 1047, 2047, 7047, 94, 95, 'BLAAAA', 'ELLAAA', 'OOOOxx'),
+(874, 7727, 0, 2, 4, 14, 74, 874, 874, 874, 874, 148, 149, 'QHAAAA', 'FLLAAA', 'VVVVxx'),
+(6061, 7728, 1, 1, 1, 1, 61, 61, 61, 1061, 6061, 122, 123, 'DZAAAA', 'GLLAAA', 'AAAAxx'),
+(5491, 7729, 1, 3, 1, 11, 91, 491, 1491, 491, 5491, 182, 183, 'FDAAAA', 'HLLAAA', 'HHHHxx'),
+(4344, 7730, 0, 0, 4, 4, 44, 344, 344, 4344, 4344, 88, 89, 'CLAAAA', 'ILLAAA', 'OOOOxx'),
+(1281, 7731, 1, 1, 1, 1, 81, 281, 1281, 1281, 1281, 162, 163, 'HXAAAA', 'JLLAAA', 'VVVVxx'),
+(3597, 7732, 1, 1, 7, 17, 97, 597, 1597, 3597, 3597, 194, 195, 'JIAAAA', 'KLLAAA', 'AAAAxx'),
+(4992, 7733, 0, 0, 2, 12, 92, 992, 992, 4992, 4992, 184, 185, 'AKAAAA', 'LLLAAA', 'HHHHxx'),
+(3849, 7734, 1, 1, 9, 9, 49, 849, 1849, 3849, 3849, 98, 99, 'BSAAAA', 'MLLAAA', 'OOOOxx'),
+(2655, 7735, 1, 3, 5, 15, 55, 655, 655, 2655, 2655, 110, 111, 'DYAAAA', 'NLLAAA', 'VVVVxx'),
+(147, 7736, 1, 3, 7, 7, 47, 147, 147, 147, 147, 94, 95, 'RFAAAA', 'OLLAAA', 'AAAAxx'),
+(9110, 7737, 0, 2, 0, 10, 10, 110, 1110, 4110, 9110, 20, 21, 'KMAAAA', 'PLLAAA', 'HHHHxx'),
+(1637, 7738, 1, 1, 7, 17, 37, 637, 1637, 1637, 1637, 74, 75, 'ZKAAAA', 'QLLAAA', 'OOOOxx'),
+(9826, 7739, 0, 2, 6, 6, 26, 826, 1826, 4826, 9826, 52, 53, 'YNAAAA', 'RLLAAA', 'VVVVxx'),
+(5957, 7740, 1, 1, 7, 17, 57, 957, 1957, 957, 5957, 114, 115, 'DVAAAA', 'SLLAAA', 'AAAAxx'),
+(6932, 7741, 0, 0, 2, 12, 32, 932, 932, 1932, 6932, 64, 65, 'QGAAAA', 'TLLAAA', 'HHHHxx'),
+(9684, 7742, 0, 0, 4, 4, 84, 684, 1684, 4684, 9684, 168, 169, 'MIAAAA', 'ULLAAA', 'OOOOxx'),
+(4653, 7743, 1, 1, 3, 13, 53, 653, 653, 4653, 4653, 106, 107, 'ZWAAAA', 'VLLAAA', 'VVVVxx'),
+(8065, 7744, 1, 1, 5, 5, 65, 65, 65, 3065, 8065, 130, 131, 'FYAAAA', 'WLLAAA', 'AAAAxx'),
+(1202, 7745, 0, 2, 2, 2, 2, 202, 1202, 1202, 1202, 4, 5, 'GUAAAA', 'XLLAAA', 'HHHHxx'),
+(9214, 7746, 0, 2, 4, 14, 14, 214, 1214, 4214, 9214, 28, 29, 'KQAAAA', 'YLLAAA', 'OOOOxx'),
+(196, 7747, 0, 0, 6, 16, 96, 196, 196, 196, 196, 192, 193, 'OHAAAA', 'ZLLAAA', 'VVVVxx'),
+(4486, 7748, 0, 2, 6, 6, 86, 486, 486, 4486, 4486, 172, 173, 'OQAAAA', 'AMLAAA', 'AAAAxx'),
+(2585, 7749, 1, 1, 5, 5, 85, 585, 585, 2585, 2585, 170, 171, 'LVAAAA', 'BMLAAA', 'HHHHxx'),
+(2464, 7750, 0, 0, 4, 4, 64, 464, 464, 2464, 2464, 128, 129, 'UQAAAA', 'CMLAAA', 'OOOOxx'),
+(3467, 7751, 1, 3, 7, 7, 67, 467, 1467, 3467, 3467, 134, 135, 'JDAAAA', 'DMLAAA', 'VVVVxx'),
+(9295, 7752, 1, 3, 5, 15, 95, 295, 1295, 4295, 9295, 190, 191, 'NTAAAA', 'EMLAAA', 'AAAAxx'),
+(517, 7753, 1, 1, 7, 17, 17, 517, 517, 517, 517, 34, 35, 'XTAAAA', 'FMLAAA', 'HHHHxx'),
+(6870, 7754, 0, 2, 0, 10, 70, 870, 870, 1870, 6870, 140, 141, 'GEAAAA', 'GMLAAA', 'OOOOxx'),
+(5732, 7755, 0, 0, 2, 12, 32, 732, 1732, 732, 5732, 64, 65, 'MMAAAA', 'HMLAAA', 'VVVVxx'),
+(9376, 7756, 0, 0, 6, 16, 76, 376, 1376, 4376, 9376, 152, 153, 'QWAAAA', 'IMLAAA', 'AAAAxx'),
+(838, 7757, 0, 2, 8, 18, 38, 838, 838, 838, 838, 76, 77, 'GGAAAA', 'JMLAAA', 'HHHHxx'),
+(9254, 7758, 0, 2, 4, 14, 54, 254, 1254, 4254, 9254, 108, 109, 'YRAAAA', 'KMLAAA', 'OOOOxx'),
+(8879, 7759, 1, 3, 9, 19, 79, 879, 879, 3879, 8879, 158, 159, 'NDAAAA', 'LMLAAA', 'VVVVxx'),
+(6281, 7760, 1, 1, 1, 1, 81, 281, 281, 1281, 6281, 162, 163, 'PHAAAA', 'MMLAAA', 'AAAAxx'),
+(8216, 7761, 0, 0, 6, 16, 16, 216, 216, 3216, 8216, 32, 33, 'AEAAAA', 'NMLAAA', 'HHHHxx'),
+(9213, 7762, 1, 1, 3, 13, 13, 213, 1213, 4213, 9213, 26, 27, 'JQAAAA', 'OMLAAA', 'OOOOxx'),
+(7234, 7763, 0, 2, 4, 14, 34, 234, 1234, 2234, 7234, 68, 69, 'GSAAAA', 'PMLAAA', 'VVVVxx'),
+(5692, 7764, 0, 0, 2, 12, 92, 692, 1692, 692, 5692, 184, 185, 'YKAAAA', 'QMLAAA', 'AAAAxx'),
+(693, 7765, 1, 1, 3, 13, 93, 693, 693, 693, 693, 186, 187, 'RAAAAA', 'RMLAAA', 'HHHHxx'),
+(9050, 7766, 0, 2, 0, 10, 50, 50, 1050, 4050, 9050, 100, 101, 'CKAAAA', 'SMLAAA', 'OOOOxx'),
+(3623, 7767, 1, 3, 3, 3, 23, 623, 1623, 3623, 3623, 46, 47, 'JJAAAA', 'TMLAAA', 'VVVVxx'),
+(2130, 7768, 0, 2, 0, 10, 30, 130, 130, 2130, 2130, 60, 61, 'YDAAAA', 'UMLAAA', 'AAAAxx'),
+(2514, 7769, 0, 2, 4, 14, 14, 514, 514, 2514, 2514, 28, 29, 'SSAAAA', 'VMLAAA', 'HHHHxx'),
+(1812, 7770, 0, 0, 2, 12, 12, 812, 1812, 1812, 1812, 24, 25, 'SRAAAA', 'WMLAAA', 'OOOOxx'),
+(9037, 7771, 1, 1, 7, 17, 37, 37, 1037, 4037, 9037, 74, 75, 'PJAAAA', 'XMLAAA', 'VVVVxx'),
+(5054, 7772, 0, 2, 4, 14, 54, 54, 1054, 54, 5054, 108, 109, 'KMAAAA', 'YMLAAA', 'AAAAxx'),
+(7801, 7773, 1, 1, 1, 1, 1, 801, 1801, 2801, 7801, 2, 3, 'BOAAAA', 'ZMLAAA', 'HHHHxx'),
+(7939, 7774, 1, 3, 9, 19, 39, 939, 1939, 2939, 7939, 78, 79, 'JTAAAA', 'ANLAAA', 'OOOOxx'),
+(7374, 7775, 0, 2, 4, 14, 74, 374, 1374, 2374, 7374, 148, 149, 'QXAAAA', 'BNLAAA', 'VVVVxx'),
+(1058, 7776, 0, 2, 8, 18, 58, 58, 1058, 1058, 1058, 116, 117, 'SOAAAA', 'CNLAAA', 'AAAAxx'),
+(1972, 7777, 0, 0, 2, 12, 72, 972, 1972, 1972, 1972, 144, 145, 'WXAAAA', 'DNLAAA', 'HHHHxx'),
+(3741, 7778, 1, 1, 1, 1, 41, 741, 1741, 3741, 3741, 82, 83, 'XNAAAA', 'ENLAAA', 'OOOOxx'),
+(2227, 7779, 1, 3, 7, 7, 27, 227, 227, 2227, 2227, 54, 55, 'RHAAAA', 'FNLAAA', 'VVVVxx'),
+(304, 7780, 0, 0, 4, 4, 4, 304, 304, 304, 304, 8, 9, 'SLAAAA', 'GNLAAA', 'AAAAxx'),
+(4914, 7781, 0, 2, 4, 14, 14, 914, 914, 4914, 4914, 28, 29, 'AHAAAA', 'HNLAAA', 'HHHHxx'),
+(2428, 7782, 0, 0, 8, 8, 28, 428, 428, 2428, 2428, 56, 57, 'KPAAAA', 'INLAAA', 'OOOOxx'),
+(6660, 7783, 0, 0, 0, 0, 60, 660, 660, 1660, 6660, 120, 121, 'EWAAAA', 'JNLAAA', 'VVVVxx'),
+(2676, 7784, 0, 0, 6, 16, 76, 676, 676, 2676, 2676, 152, 153, 'YYAAAA', 'KNLAAA', 'AAAAxx'),
+(2454, 7785, 0, 2, 4, 14, 54, 454, 454, 2454, 2454, 108, 109, 'KQAAAA', 'LNLAAA', 'HHHHxx'),
+(3798, 7786, 0, 2, 8, 18, 98, 798, 1798, 3798, 3798, 196, 197, 'CQAAAA', 'MNLAAA', 'OOOOxx'),
+(1341, 7787, 1, 1, 1, 1, 41, 341, 1341, 1341, 1341, 82, 83, 'PZAAAA', 'NNLAAA', 'VVVVxx'),
+(1611, 7788, 1, 3, 1, 11, 11, 611, 1611, 1611, 1611, 22, 23, 'ZJAAAA', 'ONLAAA', 'AAAAxx'),
+(2681, 7789, 1, 1, 1, 1, 81, 681, 681, 2681, 2681, 162, 163, 'DZAAAA', 'PNLAAA', 'HHHHxx'),
+(7292, 7790, 0, 0, 2, 12, 92, 292, 1292, 2292, 7292, 184, 185, 'MUAAAA', 'QNLAAA', 'OOOOxx'),
+(7775, 7791, 1, 3, 5, 15, 75, 775, 1775, 2775, 7775, 150, 151, 'BNAAAA', 'RNLAAA', 'VVVVxx'),
+(794, 7792, 0, 2, 4, 14, 94, 794, 794, 794, 794, 188, 189, 'OEAAAA', 'SNLAAA', 'AAAAxx'),
+(8709, 7793, 1, 1, 9, 9, 9, 709, 709, 3709, 8709, 18, 19, 'ZWAAAA', 'TNLAAA', 'HHHHxx'),
+(1901, 7794, 1, 1, 1, 1, 1, 901, 1901, 1901, 1901, 2, 3, 'DVAAAA', 'UNLAAA', 'OOOOxx'),
+(3089, 7795, 1, 1, 9, 9, 89, 89, 1089, 3089, 3089, 178, 179, 'VOAAAA', 'VNLAAA', 'VVVVxx'),
+(7797, 7796, 1, 1, 7, 17, 97, 797, 1797, 2797, 7797, 194, 195, 'XNAAAA', 'WNLAAA', 'AAAAxx'),
+(6070, 7797, 0, 2, 0, 10, 70, 70, 70, 1070, 6070, 140, 141, 'MZAAAA', 'XNLAAA', 'HHHHxx'),
+(2191, 7798, 1, 3, 1, 11, 91, 191, 191, 2191, 2191, 182, 183, 'HGAAAA', 'YNLAAA', 'OOOOxx'),
+(3497, 7799, 1, 1, 7, 17, 97, 497, 1497, 3497, 3497, 194, 195, 'NEAAAA', 'ZNLAAA', 'VVVVxx'),
+(8302, 7800, 0, 2, 2, 2, 2, 302, 302, 3302, 8302, 4, 5, 'IHAAAA', 'AOLAAA', 'AAAAxx'),
+(4365, 7801, 1, 1, 5, 5, 65, 365, 365, 4365, 4365, 130, 131, 'XLAAAA', 'BOLAAA', 'HHHHxx'),
+(3588, 7802, 0, 0, 8, 8, 88, 588, 1588, 3588, 3588, 176, 177, 'AIAAAA', 'COLAAA', 'OOOOxx'),
+(8292, 7803, 0, 0, 2, 12, 92, 292, 292, 3292, 8292, 184, 185, 'YGAAAA', 'DOLAAA', 'VVVVxx'),
+(4696, 7804, 0, 0, 6, 16, 96, 696, 696, 4696, 4696, 192, 193, 'QYAAAA', 'EOLAAA', 'AAAAxx'),
+(5641, 7805, 1, 1, 1, 1, 41, 641, 1641, 641, 5641, 82, 83, 'ZIAAAA', 'FOLAAA', 'HHHHxx'),
+(9386, 7806, 0, 2, 6, 6, 86, 386, 1386, 4386, 9386, 172, 173, 'AXAAAA', 'GOLAAA', 'OOOOxx'),
+(507, 7807, 1, 3, 7, 7, 7, 507, 507, 507, 507, 14, 15, 'NTAAAA', 'HOLAAA', 'VVVVxx'),
+(7201, 7808, 1, 1, 1, 1, 1, 201, 1201, 2201, 7201, 2, 3, 'ZQAAAA', 'IOLAAA', 'AAAAxx'),
+(7785, 7809, 1, 1, 5, 5, 85, 785, 1785, 2785, 7785, 170, 171, 'LNAAAA', 'JOLAAA', 'HHHHxx'),
+(463, 7810, 1, 3, 3, 3, 63, 463, 463, 463, 463, 126, 127, 'VRAAAA', 'KOLAAA', 'OOOOxx'),
+(6656, 7811, 0, 0, 6, 16, 56, 656, 656, 1656, 6656, 112, 113, 'AWAAAA', 'LOLAAA', 'VVVVxx'),
+(807, 7812, 1, 3, 7, 7, 7, 807, 807, 807, 807, 14, 15, 'BFAAAA', 'MOLAAA', 'AAAAxx'),
+(7278, 7813, 0, 2, 8, 18, 78, 278, 1278, 2278, 7278, 156, 157, 'YTAAAA', 'NOLAAA', 'HHHHxx'),
+(6237, 7814, 1, 1, 7, 17, 37, 237, 237, 1237, 6237, 74, 75, 'XFAAAA', 'OOLAAA', 'OOOOxx'),
+(7671, 7815, 1, 3, 1, 11, 71, 671, 1671, 2671, 7671, 142, 143, 'BJAAAA', 'POLAAA', 'VVVVxx'),
+(2235, 7816, 1, 3, 5, 15, 35, 235, 235, 2235, 2235, 70, 71, 'ZHAAAA', 'QOLAAA', 'AAAAxx'),
+(4042, 7817, 0, 2, 2, 2, 42, 42, 42, 4042, 4042, 84, 85, 'MZAAAA', 'ROLAAA', 'HHHHxx'),
+(5273, 7818, 1, 1, 3, 13, 73, 273, 1273, 273, 5273, 146, 147, 'VUAAAA', 'SOLAAA', 'OOOOxx'),
+(7557, 7819, 1, 1, 7, 17, 57, 557, 1557, 2557, 7557, 114, 115, 'REAAAA', 'TOLAAA', 'VVVVxx'),
+(4007, 7820, 1, 3, 7, 7, 7, 7, 7, 4007, 4007, 14, 15, 'DYAAAA', 'UOLAAA', 'AAAAxx'),
+(1428, 7821, 0, 0, 8, 8, 28, 428, 1428, 1428, 1428, 56, 57, 'YCAAAA', 'VOLAAA', 'HHHHxx'),
+(9739, 7822, 1, 3, 9, 19, 39, 739, 1739, 4739, 9739, 78, 79, 'PKAAAA', 'WOLAAA', 'OOOOxx'),
+(7836, 7823, 0, 0, 6, 16, 36, 836, 1836, 2836, 7836, 72, 73, 'KPAAAA', 'XOLAAA', 'VVVVxx'),
+(1777, 7824, 1, 1, 7, 17, 77, 777, 1777, 1777, 1777, 154, 155, 'JQAAAA', 'YOLAAA', 'AAAAxx'),
+(5192, 7825, 0, 0, 2, 12, 92, 192, 1192, 192, 5192, 184, 185, 'SRAAAA', 'ZOLAAA', 'HHHHxx'),
+(7236, 7826, 0, 0, 6, 16, 36, 236, 1236, 2236, 7236, 72, 73, 'ISAAAA', 'APLAAA', 'OOOOxx'),
+(1623, 7827, 1, 3, 3, 3, 23, 623, 1623, 1623, 1623, 46, 47, 'LKAAAA', 'BPLAAA', 'VVVVxx'),
+(8288, 7828, 0, 0, 8, 8, 88, 288, 288, 3288, 8288, 176, 177, 'UGAAAA', 'CPLAAA', 'AAAAxx'),
+(2827, 7829, 1, 3, 7, 7, 27, 827, 827, 2827, 2827, 54, 55, 'TEAAAA', 'DPLAAA', 'HHHHxx'),
+(458, 7830, 0, 2, 8, 18, 58, 458, 458, 458, 458, 116, 117, 'QRAAAA', 'EPLAAA', 'OOOOxx'),
+(1818, 7831, 0, 2, 8, 18, 18, 818, 1818, 1818, 1818, 36, 37, 'YRAAAA', 'FPLAAA', 'VVVVxx'),
+(6837, 7832, 1, 1, 7, 17, 37, 837, 837, 1837, 6837, 74, 75, 'ZCAAAA', 'GPLAAA', 'AAAAxx'),
+(7825, 7833, 1, 1, 5, 5, 25, 825, 1825, 2825, 7825, 50, 51, 'ZOAAAA', 'HPLAAA', 'HHHHxx'),
+(9146, 7834, 0, 2, 6, 6, 46, 146, 1146, 4146, 9146, 92, 93, 'UNAAAA', 'IPLAAA', 'OOOOxx'),
+(8451, 7835, 1, 3, 1, 11, 51, 451, 451, 3451, 8451, 102, 103, 'BNAAAA', 'JPLAAA', 'VVVVxx'),
+(6438, 7836, 0, 2, 8, 18, 38, 438, 438, 1438, 6438, 76, 77, 'QNAAAA', 'KPLAAA', 'AAAAxx'),
+(4020, 7837, 0, 0, 0, 0, 20, 20, 20, 4020, 4020, 40, 41, 'QYAAAA', 'LPLAAA', 'HHHHxx'),
+(4068, 7838, 0, 0, 8, 8, 68, 68, 68, 4068, 4068, 136, 137, 'MAAAAA', 'MPLAAA', 'OOOOxx'),
+(2411, 7839, 1, 3, 1, 11, 11, 411, 411, 2411, 2411, 22, 23, 'TOAAAA', 'NPLAAA', 'VVVVxx'),
+(6222, 7840, 0, 2, 2, 2, 22, 222, 222, 1222, 6222, 44, 45, 'IFAAAA', 'OPLAAA', 'AAAAxx'),
+(3164, 7841, 0, 0, 4, 4, 64, 164, 1164, 3164, 3164, 128, 129, 'SRAAAA', 'PPLAAA', 'HHHHxx'),
+(311, 7842, 1, 3, 1, 11, 11, 311, 311, 311, 311, 22, 23, 'ZLAAAA', 'QPLAAA', 'OOOOxx'),
+(5683, 7843, 1, 3, 3, 3, 83, 683, 1683, 683, 5683, 166, 167, 'PKAAAA', 'RPLAAA', 'VVVVxx'),
+(3993, 7844, 1, 1, 3, 13, 93, 993, 1993, 3993, 3993, 186, 187, 'PXAAAA', 'SPLAAA', 'AAAAxx'),
+(9897, 7845, 1, 1, 7, 17, 97, 897, 1897, 4897, 9897, 194, 195, 'RQAAAA', 'TPLAAA', 'HHHHxx'),
+(6609, 7846, 1, 1, 9, 9, 9, 609, 609, 1609, 6609, 18, 19, 'FUAAAA', 'UPLAAA', 'OOOOxx'),
+(1362, 7847, 0, 2, 2, 2, 62, 362, 1362, 1362, 1362, 124, 125, 'KAAAAA', 'VPLAAA', 'VVVVxx'),
+(3918, 7848, 0, 2, 8, 18, 18, 918, 1918, 3918, 3918, 36, 37, 'SUAAAA', 'WPLAAA', 'AAAAxx'),
+(7376, 7849, 0, 0, 6, 16, 76, 376, 1376, 2376, 7376, 152, 153, 'SXAAAA', 'XPLAAA', 'HHHHxx'),
+(6996, 7850, 0, 0, 6, 16, 96, 996, 996, 1996, 6996, 192, 193, 'CJAAAA', 'YPLAAA', 'OOOOxx'),
+(9567, 7851, 1, 3, 7, 7, 67, 567, 1567, 4567, 9567, 134, 135, 'ZDAAAA', 'ZPLAAA', 'VVVVxx'),
+(7525, 7852, 1, 1, 5, 5, 25, 525, 1525, 2525, 7525, 50, 51, 'LDAAAA', 'AQLAAA', 'AAAAxx'),
+(9069, 7853, 1, 1, 9, 9, 69, 69, 1069, 4069, 9069, 138, 139, 'VKAAAA', 'BQLAAA', 'HHHHxx'),
+(9999, 7854, 1, 3, 9, 19, 99, 999, 1999, 4999, 9999, 198, 199, 'PUAAAA', 'CQLAAA', 'OOOOxx'),
+(9237, 7855, 1, 1, 7, 17, 37, 237, 1237, 4237, 9237, 74, 75, 'HRAAAA', 'DQLAAA', 'VVVVxx'),
+(8441, 7856, 1, 1, 1, 1, 41, 441, 441, 3441, 8441, 82, 83, 'RMAAAA', 'EQLAAA', 'AAAAxx'),
+(6769, 7857, 1, 1, 9, 9, 69, 769, 769, 1769, 6769, 138, 139, 'JAAAAA', 'FQLAAA', 'HHHHxx'),
+(6073, 7858, 1, 1, 3, 13, 73, 73, 73, 1073, 6073, 146, 147, 'PZAAAA', 'GQLAAA', 'OOOOxx'),
+(1091, 7859, 1, 3, 1, 11, 91, 91, 1091, 1091, 1091, 182, 183, 'ZPAAAA', 'HQLAAA', 'VVVVxx'),
+(9886, 7860, 0, 2, 6, 6, 86, 886, 1886, 4886, 9886, 172, 173, 'GQAAAA', 'IQLAAA', 'AAAAxx'),
+(3971, 7861, 1, 3, 1, 11, 71, 971, 1971, 3971, 3971, 142, 143, 'TWAAAA', 'JQLAAA', 'HHHHxx'),
+(4621, 7862, 1, 1, 1, 1, 21, 621, 621, 4621, 4621, 42, 43, 'TVAAAA', 'KQLAAA', 'OOOOxx'),
+(3120, 7863, 0, 0, 0, 0, 20, 120, 1120, 3120, 3120, 40, 41, 'AQAAAA', 'LQLAAA', 'VVVVxx'),
+(9773, 7864, 1, 1, 3, 13, 73, 773, 1773, 4773, 9773, 146, 147, 'XLAAAA', 'MQLAAA', 'AAAAxx'),
+(8712, 7865, 0, 0, 2, 12, 12, 712, 712, 3712, 8712, 24, 25, 'CXAAAA', 'NQLAAA', 'HHHHxx'),
+(801, 7866, 1, 1, 1, 1, 1, 801, 801, 801, 801, 2, 3, 'VEAAAA', 'OQLAAA', 'OOOOxx'),
+(9478, 7867, 0, 2, 8, 18, 78, 478, 1478, 4478, 9478, 156, 157, 'OAAAAA', 'PQLAAA', 'VVVVxx'),
+(3466, 7868, 0, 2, 6, 6, 66, 466, 1466, 3466, 3466, 132, 133, 'IDAAAA', 'QQLAAA', 'AAAAxx'),
+(6326, 7869, 0, 2, 6, 6, 26, 326, 326, 1326, 6326, 52, 53, 'IJAAAA', 'RQLAAA', 'HHHHxx'),
+(1723, 7870, 1, 3, 3, 3, 23, 723, 1723, 1723, 1723, 46, 47, 'HOAAAA', 'SQLAAA', 'OOOOxx'),
+(4978, 7871, 0, 2, 8, 18, 78, 978, 978, 4978, 4978, 156, 157, 'MJAAAA', 'TQLAAA', 'VVVVxx'),
+(2311, 7872, 1, 3, 1, 11, 11, 311, 311, 2311, 2311, 22, 23, 'XKAAAA', 'UQLAAA', 'AAAAxx'),
+(9532, 7873, 0, 0, 2, 12, 32, 532, 1532, 4532, 9532, 64, 65, 'QCAAAA', 'VQLAAA', 'HHHHxx'),
+(3680, 7874, 0, 0, 0, 0, 80, 680, 1680, 3680, 3680, 160, 161, 'OLAAAA', 'WQLAAA', 'OOOOxx'),
+(1244, 7875, 0, 0, 4, 4, 44, 244, 1244, 1244, 1244, 88, 89, 'WVAAAA', 'XQLAAA', 'VVVVxx'),
+(3821, 7876, 1, 1, 1, 1, 21, 821, 1821, 3821, 3821, 42, 43, 'ZQAAAA', 'YQLAAA', 'AAAAxx'),
+(9586, 7877, 0, 2, 6, 6, 86, 586, 1586, 4586, 9586, 172, 173, 'SEAAAA', 'ZQLAAA', 'HHHHxx'),
+(3894, 7878, 0, 2, 4, 14, 94, 894, 1894, 3894, 3894, 188, 189, 'UTAAAA', 'ARLAAA', 'OOOOxx'),
+(6169, 7879, 1, 1, 9, 9, 69, 169, 169, 1169, 6169, 138, 139, 'HDAAAA', 'BRLAAA', 'VVVVxx'),
+(5919, 7880, 1, 3, 9, 19, 19, 919, 1919, 919, 5919, 38, 39, 'RTAAAA', 'CRLAAA', 'AAAAxx'),
+(4187, 7881, 1, 3, 7, 7, 87, 187, 187, 4187, 4187, 174, 175, 'BFAAAA', 'DRLAAA', 'HHHHxx'),
+(5477, 7882, 1, 1, 7, 17, 77, 477, 1477, 477, 5477, 154, 155, 'RCAAAA', 'ERLAAA', 'OOOOxx'),
+(2806, 7883, 0, 2, 6, 6, 6, 806, 806, 2806, 2806, 12, 13, 'YDAAAA', 'FRLAAA', 'VVVVxx'),
+(8158, 7884, 0, 2, 8, 18, 58, 158, 158, 3158, 8158, 116, 117, 'UBAAAA', 'GRLAAA', 'AAAAxx'),
+(7130, 7885, 0, 2, 0, 10, 30, 130, 1130, 2130, 7130, 60, 61, 'GOAAAA', 'HRLAAA', 'HHHHxx'),
+(7133, 7886, 1, 1, 3, 13, 33, 133, 1133, 2133, 7133, 66, 67, 'JOAAAA', 'IRLAAA', 'OOOOxx'),
+(6033, 7887, 1, 1, 3, 13, 33, 33, 33, 1033, 6033, 66, 67, 'BYAAAA', 'JRLAAA', 'VVVVxx'),
+(2415, 7888, 1, 3, 5, 15, 15, 415, 415, 2415, 2415, 30, 31, 'XOAAAA', 'KRLAAA', 'AAAAxx'),
+(8091, 7889, 1, 3, 1, 11, 91, 91, 91, 3091, 8091, 182, 183, 'FZAAAA', 'LRLAAA', 'HHHHxx'),
+(8347, 7890, 1, 3, 7, 7, 47, 347, 347, 3347, 8347, 94, 95, 'BJAAAA', 'MRLAAA', 'OOOOxx'),
+(7879, 7891, 1, 3, 9, 19, 79, 879, 1879, 2879, 7879, 158, 159, 'BRAAAA', 'NRLAAA', 'VVVVxx'),
+(9360, 7892, 0, 0, 0, 0, 60, 360, 1360, 4360, 9360, 120, 121, 'AWAAAA', 'ORLAAA', 'AAAAxx'),
+(3369, 7893, 1, 1, 9, 9, 69, 369, 1369, 3369, 3369, 138, 139, 'PZAAAA', 'PRLAAA', 'HHHHxx'),
+(8536, 7894, 0, 0, 6, 16, 36, 536, 536, 3536, 8536, 72, 73, 'IQAAAA', 'QRLAAA', 'OOOOxx'),
+(8628, 7895, 0, 0, 8, 8, 28, 628, 628, 3628, 8628, 56, 57, 'WTAAAA', 'RRLAAA', 'VVVVxx'),
+(1580, 7896, 0, 0, 0, 0, 80, 580, 1580, 1580, 1580, 160, 161, 'UIAAAA', 'SRLAAA', 'AAAAxx'),
+(705, 7897, 1, 1, 5, 5, 5, 705, 705, 705, 705, 10, 11, 'DBAAAA', 'TRLAAA', 'HHHHxx'),
+(4650, 7898, 0, 2, 0, 10, 50, 650, 650, 4650, 4650, 100, 101, 'WWAAAA', 'URLAAA', 'OOOOxx'),
+(9165, 7899, 1, 1, 5, 5, 65, 165, 1165, 4165, 9165, 130, 131, 'NOAAAA', 'VRLAAA', 'VVVVxx'),
+(4820, 7900, 0, 0, 0, 0, 20, 820, 820, 4820, 4820, 40, 41, 'KDAAAA', 'WRLAAA', 'AAAAxx'),
+(3538, 7901, 0, 2, 8, 18, 38, 538, 1538, 3538, 3538, 76, 77, 'CGAAAA', 'XRLAAA', 'HHHHxx'),
+(9947, 7902, 1, 3, 7, 7, 47, 947, 1947, 4947, 9947, 94, 95, 'PSAAAA', 'YRLAAA', 'OOOOxx'),
+(4954, 7903, 0, 2, 4, 14, 54, 954, 954, 4954, 4954, 108, 109, 'OIAAAA', 'ZRLAAA', 'VVVVxx'),
+(1104, 7904, 0, 0, 4, 4, 4, 104, 1104, 1104, 1104, 8, 9, 'MQAAAA', 'ASLAAA', 'AAAAxx'),
+(8455, 7905, 1, 3, 5, 15, 55, 455, 455, 3455, 8455, 110, 111, 'FNAAAA', 'BSLAAA', 'HHHHxx'),
+(8307, 7906, 1, 3, 7, 7, 7, 307, 307, 3307, 8307, 14, 15, 'NHAAAA', 'CSLAAA', 'OOOOxx'),
+(9203, 7907, 1, 3, 3, 3, 3, 203, 1203, 4203, 9203, 6, 7, 'ZPAAAA', 'DSLAAA', 'VVVVxx'),
+(7565, 7908, 1, 1, 5, 5, 65, 565, 1565, 2565, 7565, 130, 131, 'ZEAAAA', 'ESLAAA', 'AAAAxx'),
+(7745, 7909, 1, 1, 5, 5, 45, 745, 1745, 2745, 7745, 90, 91, 'XLAAAA', 'FSLAAA', 'HHHHxx'),
+(1787, 7910, 1, 3, 7, 7, 87, 787, 1787, 1787, 1787, 174, 175, 'TQAAAA', 'GSLAAA', 'OOOOxx'),
+(4861, 7911, 1, 1, 1, 1, 61, 861, 861, 4861, 4861, 122, 123, 'ZEAAAA', 'HSLAAA', 'VVVVxx'),
+(5183, 7912, 1, 3, 3, 3, 83, 183, 1183, 183, 5183, 166, 167, 'JRAAAA', 'ISLAAA', 'AAAAxx'),
+(529, 7913, 1, 1, 9, 9, 29, 529, 529, 529, 529, 58, 59, 'JUAAAA', 'JSLAAA', 'HHHHxx'),
+(2470, 7914, 0, 2, 0, 10, 70, 470, 470, 2470, 2470, 140, 141, 'ARAAAA', 'KSLAAA', 'OOOOxx'),
+(1267, 7915, 1, 3, 7, 7, 67, 267, 1267, 1267, 1267, 134, 135, 'TWAAAA', 'LSLAAA', 'VVVVxx'),
+(2059, 7916, 1, 3, 9, 19, 59, 59, 59, 2059, 2059, 118, 119, 'FBAAAA', 'MSLAAA', 'AAAAxx'),
+(1862, 7917, 0, 2, 2, 2, 62, 862, 1862, 1862, 1862, 124, 125, 'QTAAAA', 'NSLAAA', 'HHHHxx'),
+(7382, 7918, 0, 2, 2, 2, 82, 382, 1382, 2382, 7382, 164, 165, 'YXAAAA', 'OSLAAA', 'OOOOxx'),
+(4796, 7919, 0, 0, 6, 16, 96, 796, 796, 4796, 4796, 192, 193, 'MCAAAA', 'PSLAAA', 'VVVVxx'),
+(2331, 7920, 1, 3, 1, 11, 31, 331, 331, 2331, 2331, 62, 63, 'RLAAAA', 'QSLAAA', 'AAAAxx'),
+(8870, 7921, 0, 2, 0, 10, 70, 870, 870, 3870, 8870, 140, 141, 'EDAAAA', 'RSLAAA', 'HHHHxx'),
+(9581, 7922, 1, 1, 1, 1, 81, 581, 1581, 4581, 9581, 162, 163, 'NEAAAA', 'SSLAAA', 'OOOOxx'),
+(9063, 7923, 1, 3, 3, 3, 63, 63, 1063, 4063, 9063, 126, 127, 'PKAAAA', 'TSLAAA', 'VVVVxx'),
+(2192, 7924, 0, 0, 2, 12, 92, 192, 192, 2192, 2192, 184, 185, 'IGAAAA', 'USLAAA', 'AAAAxx'),
+(6466, 7925, 0, 2, 6, 6, 66, 466, 466, 1466, 6466, 132, 133, 'SOAAAA', 'VSLAAA', 'HHHHxx'),
+(7096, 7926, 0, 0, 6, 16, 96, 96, 1096, 2096, 7096, 192, 193, 'YMAAAA', 'WSLAAA', 'OOOOxx'),
+(6257, 7927, 1, 1, 7, 17, 57, 257, 257, 1257, 6257, 114, 115, 'RGAAAA', 'XSLAAA', 'VVVVxx'),
+(7009, 7928, 1, 1, 9, 9, 9, 9, 1009, 2009, 7009, 18, 19, 'PJAAAA', 'YSLAAA', 'AAAAxx'),
+(8136, 7929, 0, 0, 6, 16, 36, 136, 136, 3136, 8136, 72, 73, 'YAAAAA', 'ZSLAAA', 'HHHHxx'),
+(1854, 7930, 0, 2, 4, 14, 54, 854, 1854, 1854, 1854, 108, 109, 'ITAAAA', 'ATLAAA', 'OOOOxx'),
+(3644, 7931, 0, 0, 4, 4, 44, 644, 1644, 3644, 3644, 88, 89, 'EKAAAA', 'BTLAAA', 'VVVVxx'),
+(4437, 7932, 1, 1, 7, 17, 37, 437, 437, 4437, 4437, 74, 75, 'ROAAAA', 'CTLAAA', 'AAAAxx'),
+(7209, 7933, 1, 1, 9, 9, 9, 209, 1209, 2209, 7209, 18, 19, 'HRAAAA', 'DTLAAA', 'HHHHxx'),
+(1516, 7934, 0, 0, 6, 16, 16, 516, 1516, 1516, 1516, 32, 33, 'IGAAAA', 'ETLAAA', 'OOOOxx'),
+(822, 7935, 0, 2, 2, 2, 22, 822, 822, 822, 822, 44, 45, 'QFAAAA', 'FTLAAA', 'VVVVxx'),
+(1778, 7936, 0, 2, 8, 18, 78, 778, 1778, 1778, 1778, 156, 157, 'KQAAAA', 'GTLAAA', 'AAAAxx'),
+(8161, 7937, 1, 1, 1, 1, 61, 161, 161, 3161, 8161, 122, 123, 'XBAAAA', 'HTLAAA', 'HHHHxx'),
+(6030, 7938, 0, 2, 0, 10, 30, 30, 30, 1030, 6030, 60, 61, 'YXAAAA', 'ITLAAA', 'OOOOxx'),
+(3515, 7939, 1, 3, 5, 15, 15, 515, 1515, 3515, 3515, 30, 31, 'FFAAAA', 'JTLAAA', 'VVVVxx'),
+(1702, 7940, 0, 2, 2, 2, 2, 702, 1702, 1702, 1702, 4, 5, 'MNAAAA', 'KTLAAA', 'AAAAxx'),
+(2671, 7941, 1, 3, 1, 11, 71, 671, 671, 2671, 2671, 142, 143, 'TYAAAA', 'LTLAAA', 'HHHHxx'),
+(7623, 7942, 1, 3, 3, 3, 23, 623, 1623, 2623, 7623, 46, 47, 'FHAAAA', 'MTLAAA', 'OOOOxx'),
+(9828, 7943, 0, 0, 8, 8, 28, 828, 1828, 4828, 9828, 56, 57, 'AOAAAA', 'NTLAAA', 'VVVVxx'),
+(1888, 7944, 0, 0, 8, 8, 88, 888, 1888, 1888, 1888, 176, 177, 'QUAAAA', 'OTLAAA', 'AAAAxx'),
+(4520, 7945, 0, 0, 0, 0, 20, 520, 520, 4520, 4520, 40, 41, 'WRAAAA', 'PTLAAA', 'HHHHxx'),
+(3461, 7946, 1, 1, 1, 1, 61, 461, 1461, 3461, 3461, 122, 123, 'DDAAAA', 'QTLAAA', 'OOOOxx'),
+(1488, 7947, 0, 0, 8, 8, 88, 488, 1488, 1488, 1488, 176, 177, 'GFAAAA', 'RTLAAA', 'VVVVxx'),
+(7753, 7948, 1, 1, 3, 13, 53, 753, 1753, 2753, 7753, 106, 107, 'FMAAAA', 'STLAAA', 'AAAAxx'),
+(5525, 7949, 1, 1, 5, 5, 25, 525, 1525, 525, 5525, 50, 51, 'NEAAAA', 'TTLAAA', 'HHHHxx'),
+(5220, 7950, 0, 0, 0, 0, 20, 220, 1220, 220, 5220, 40, 41, 'USAAAA', 'UTLAAA', 'OOOOxx'),
+(305, 7951, 1, 1, 5, 5, 5, 305, 305, 305, 305, 10, 11, 'TLAAAA', 'VTLAAA', 'VVVVxx'),
+(7883, 7952, 1, 3, 3, 3, 83, 883, 1883, 2883, 7883, 166, 167, 'FRAAAA', 'WTLAAA', 'AAAAxx'),
+(1222, 7953, 0, 2, 2, 2, 22, 222, 1222, 1222, 1222, 44, 45, 'AVAAAA', 'XTLAAA', 'HHHHxx'),
+(8552, 7954, 0, 0, 2, 12, 52, 552, 552, 3552, 8552, 104, 105, 'YQAAAA', 'YTLAAA', 'OOOOxx'),
+(6097, 7955, 1, 1, 7, 17, 97, 97, 97, 1097, 6097, 194, 195, 'NAAAAA', 'ZTLAAA', 'VVVVxx'),
+(2298, 7956, 0, 2, 8, 18, 98, 298, 298, 2298, 2298, 196, 197, 'KKAAAA', 'AULAAA', 'AAAAxx'),
+(956, 7957, 0, 0, 6, 16, 56, 956, 956, 956, 956, 112, 113, 'UKAAAA', 'BULAAA', 'HHHHxx'),
+(9351, 7958, 1, 3, 1, 11, 51, 351, 1351, 4351, 9351, 102, 103, 'RVAAAA', 'CULAAA', 'OOOOxx'),
+(6669, 7959, 1, 1, 9, 9, 69, 669, 669, 1669, 6669, 138, 139, 'NWAAAA', 'DULAAA', 'VVVVxx'),
+(9383, 7960, 1, 3, 3, 3, 83, 383, 1383, 4383, 9383, 166, 167, 'XWAAAA', 'EULAAA', 'AAAAxx'),
+(1607, 7961, 1, 3, 7, 7, 7, 607, 1607, 1607, 1607, 14, 15, 'VJAAAA', 'FULAAA', 'HHHHxx'),
+(812, 7962, 0, 0, 2, 12, 12, 812, 812, 812, 812, 24, 25, 'GFAAAA', 'GULAAA', 'OOOOxx'),
+(2109, 7963, 1, 1, 9, 9, 9, 109, 109, 2109, 2109, 18, 19, 'DDAAAA', 'HULAAA', 'VVVVxx'),
+(207, 7964, 1, 3, 7, 7, 7, 207, 207, 207, 207, 14, 15, 'ZHAAAA', 'IULAAA', 'AAAAxx'),
+(7124, 7965, 0, 0, 4, 4, 24, 124, 1124, 2124, 7124, 48, 49, 'AOAAAA', 'JULAAA', 'HHHHxx'),
+(9333, 7966, 1, 1, 3, 13, 33, 333, 1333, 4333, 9333, 66, 67, 'ZUAAAA', 'KULAAA', 'OOOOxx'),
+(3262, 7967, 0, 2, 2, 2, 62, 262, 1262, 3262, 3262, 124, 125, 'MVAAAA', 'LULAAA', 'VVVVxx'),
+(1070, 7968, 0, 2, 0, 10, 70, 70, 1070, 1070, 1070, 140, 141, 'EPAAAA', 'MULAAA', 'AAAAxx'),
+(7579, 7969, 1, 3, 9, 19, 79, 579, 1579, 2579, 7579, 158, 159, 'NFAAAA', 'NULAAA', 'HHHHxx'),
+(9283, 7970, 1, 3, 3, 3, 83, 283, 1283, 4283, 9283, 166, 167, 'BTAAAA', 'OULAAA', 'OOOOxx'),
+(4917, 7971, 1, 1, 7, 17, 17, 917, 917, 4917, 4917, 34, 35, 'DHAAAA', 'PULAAA', 'VVVVxx'),
+(1328, 7972, 0, 0, 8, 8, 28, 328, 1328, 1328, 1328, 56, 57, 'CZAAAA', 'QULAAA', 'AAAAxx'),
+(3042, 7973, 0, 2, 2, 2, 42, 42, 1042, 3042, 3042, 84, 85, 'ANAAAA', 'RULAAA', 'HHHHxx'),
+(8352, 7974, 0, 0, 2, 12, 52, 352, 352, 3352, 8352, 104, 105, 'GJAAAA', 'SULAAA', 'OOOOxx'),
+(2710, 7975, 0, 2, 0, 10, 10, 710, 710, 2710, 2710, 20, 21, 'GAAAAA', 'TULAAA', 'VVVVxx'),
+(3330, 7976, 0, 2, 0, 10, 30, 330, 1330, 3330, 3330, 60, 61, 'CYAAAA', 'UULAAA', 'AAAAxx'),
+(2822, 7977, 0, 2, 2, 2, 22, 822, 822, 2822, 2822, 44, 45, 'OEAAAA', 'VULAAA', 'HHHHxx'),
+(5627, 7978, 1, 3, 7, 7, 27, 627, 1627, 627, 5627, 54, 55, 'LIAAAA', 'WULAAA', 'OOOOxx'),
+(7848, 7979, 0, 0, 8, 8, 48, 848, 1848, 2848, 7848, 96, 97, 'WPAAAA', 'XULAAA', 'VVVVxx'),
+(7384, 7980, 0, 0, 4, 4, 84, 384, 1384, 2384, 7384, 168, 169, 'AYAAAA', 'YULAAA', 'AAAAxx'),
+(727, 7981, 1, 3, 7, 7, 27, 727, 727, 727, 727, 54, 55, 'ZBAAAA', 'ZULAAA', 'HHHHxx'),
+(9926, 7982, 0, 2, 6, 6, 26, 926, 1926, 4926, 9926, 52, 53, 'URAAAA', 'AVLAAA', 'OOOOxx'),
+(2647, 7983, 1, 3, 7, 7, 47, 647, 647, 2647, 2647, 94, 95, 'VXAAAA', 'BVLAAA', 'VVVVxx'),
+(6416, 7984, 0, 0, 6, 16, 16, 416, 416, 1416, 6416, 32, 33, 'UMAAAA', 'CVLAAA', 'AAAAxx'),
+(8751, 7985, 1, 3, 1, 11, 51, 751, 751, 3751, 8751, 102, 103, 'PYAAAA', 'DVLAAA', 'HHHHxx'),
+(6515, 7986, 1, 3, 5, 15, 15, 515, 515, 1515, 6515, 30, 31, 'PQAAAA', 'EVLAAA', 'OOOOxx'),
+(2472, 7987, 0, 0, 2, 12, 72, 472, 472, 2472, 2472, 144, 145, 'CRAAAA', 'FVLAAA', 'VVVVxx'),
+(7205, 7988, 1, 1, 5, 5, 5, 205, 1205, 2205, 7205, 10, 11, 'DRAAAA', 'GVLAAA', 'AAAAxx'),
+(9654, 7989, 0, 2, 4, 14, 54, 654, 1654, 4654, 9654, 108, 109, 'IHAAAA', 'HVLAAA', 'HHHHxx'),
+(5646, 7990, 0, 2, 6, 6, 46, 646, 1646, 646, 5646, 92, 93, 'EJAAAA', 'IVLAAA', 'OOOOxx'),
+(4217, 7991, 1, 1, 7, 17, 17, 217, 217, 4217, 4217, 34, 35, 'FGAAAA', 'JVLAAA', 'VVVVxx'),
+(4484, 7992, 0, 0, 4, 4, 84, 484, 484, 4484, 4484, 168, 169, 'MQAAAA', 'KVLAAA', 'AAAAxx'),
+(6654, 7993, 0, 2, 4, 14, 54, 654, 654, 1654, 6654, 108, 109, 'YVAAAA', 'LVLAAA', 'HHHHxx'),
+(4876, 7994, 0, 0, 6, 16, 76, 876, 876, 4876, 4876, 152, 153, 'OFAAAA', 'MVLAAA', 'OOOOxx'),
+(9690, 7995, 0, 2, 0, 10, 90, 690, 1690, 4690, 9690, 180, 181, 'SIAAAA', 'NVLAAA', 'VVVVxx'),
+(2453, 7996, 1, 1, 3, 13, 53, 453, 453, 2453, 2453, 106, 107, 'JQAAAA', 'OVLAAA', 'AAAAxx'),
+(829, 7997, 1, 1, 9, 9, 29, 829, 829, 829, 829, 58, 59, 'XFAAAA', 'PVLAAA', 'HHHHxx'),
+(2547, 7998, 1, 3, 7, 7, 47, 547, 547, 2547, 2547, 94, 95, 'ZTAAAA', 'QVLAAA', 'OOOOxx'),
+(9726, 7999, 0, 2, 6, 6, 26, 726, 1726, 4726, 9726, 52, 53, 'CKAAAA', 'RVLAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(9267, 8000, 1, 3, 7, 7, 67, 267, 1267, 4267, 9267, 134, 135, 'LSAAAA', 'SVLAAA', 'AAAAxx'),
+(7448, 8001, 0, 0, 8, 8, 48, 448, 1448, 2448, 7448, 96, 97, 'MAAAAA', 'TVLAAA', 'HHHHxx'),
+(610, 8002, 0, 2, 0, 10, 10, 610, 610, 610, 610, 20, 21, 'MXAAAA', 'UVLAAA', 'OOOOxx'),
+(2791, 8003, 1, 3, 1, 11, 91, 791, 791, 2791, 2791, 182, 183, 'JDAAAA', 'VVLAAA', 'VVVVxx'),
+(3651, 8004, 1, 3, 1, 11, 51, 651, 1651, 3651, 3651, 102, 103, 'LKAAAA', 'WVLAAA', 'AAAAxx'),
+(5206, 8005, 0, 2, 6, 6, 6, 206, 1206, 206, 5206, 12, 13, 'GSAAAA', 'XVLAAA', 'HHHHxx'),
+(8774, 8006, 0, 2, 4, 14, 74, 774, 774, 3774, 8774, 148, 149, 'MZAAAA', 'YVLAAA', 'OOOOxx'),
+(4753, 8007, 1, 1, 3, 13, 53, 753, 753, 4753, 4753, 106, 107, 'VAAAAA', 'ZVLAAA', 'VVVVxx'),
+(4755, 8008, 1, 3, 5, 15, 55, 755, 755, 4755, 4755, 110, 111, 'XAAAAA', 'AWLAAA', 'AAAAxx'),
+(686, 8009, 0, 2, 6, 6, 86, 686, 686, 686, 686, 172, 173, 'KAAAAA', 'BWLAAA', 'HHHHxx'),
+(8281, 8010, 1, 1, 1, 1, 81, 281, 281, 3281, 8281, 162, 163, 'NGAAAA', 'CWLAAA', 'OOOOxx'),
+(2058, 8011, 0, 2, 8, 18, 58, 58, 58, 2058, 2058, 116, 117, 'EBAAAA', 'DWLAAA', 'VVVVxx'),
+(8900, 8012, 0, 0, 0, 0, 0, 900, 900, 3900, 8900, 0, 1, 'IEAAAA', 'EWLAAA', 'AAAAxx'),
+(8588, 8013, 0, 0, 8, 8, 88, 588, 588, 3588, 8588, 176, 177, 'ISAAAA', 'FWLAAA', 'HHHHxx'),
+(2904, 8014, 0, 0, 4, 4, 4, 904, 904, 2904, 2904, 8, 9, 'SHAAAA', 'GWLAAA', 'OOOOxx'),
+(8917, 8015, 1, 1, 7, 17, 17, 917, 917, 3917, 8917, 34, 35, 'ZEAAAA', 'HWLAAA', 'VVVVxx'),
+(9026, 8016, 0, 2, 6, 6, 26, 26, 1026, 4026, 9026, 52, 53, 'EJAAAA', 'IWLAAA', 'AAAAxx'),
+(2416, 8017, 0, 0, 6, 16, 16, 416, 416, 2416, 2416, 32, 33, 'YOAAAA', 'JWLAAA', 'HHHHxx'),
+(1053, 8018, 1, 1, 3, 13, 53, 53, 1053, 1053, 1053, 106, 107, 'NOAAAA', 'KWLAAA', 'OOOOxx'),
+(7141, 8019, 1, 1, 1, 1, 41, 141, 1141, 2141, 7141, 82, 83, 'ROAAAA', 'LWLAAA', 'VVVVxx'),
+(9771, 8020, 1, 3, 1, 11, 71, 771, 1771, 4771, 9771, 142, 143, 'VLAAAA', 'MWLAAA', 'AAAAxx'),
+(2774, 8021, 0, 2, 4, 14, 74, 774, 774, 2774, 2774, 148, 149, 'SCAAAA', 'NWLAAA', 'HHHHxx'),
+(3213, 8022, 1, 1, 3, 13, 13, 213, 1213, 3213, 3213, 26, 27, 'PTAAAA', 'OWLAAA', 'OOOOxx'),
+(5694, 8023, 0, 2, 4, 14, 94, 694, 1694, 694, 5694, 188, 189, 'ALAAAA', 'PWLAAA', 'VVVVxx'),
+(6631, 8024, 1, 3, 1, 11, 31, 631, 631, 1631, 6631, 62, 63, 'BVAAAA', 'QWLAAA', 'AAAAxx'),
+(6638, 8025, 0, 2, 8, 18, 38, 638, 638, 1638, 6638, 76, 77, 'IVAAAA', 'RWLAAA', 'HHHHxx'),
+(7407, 8026, 1, 3, 7, 7, 7, 407, 1407, 2407, 7407, 14, 15, 'XYAAAA', 'SWLAAA', 'OOOOxx'),
+(8972, 8027, 0, 0, 2, 12, 72, 972, 972, 3972, 8972, 144, 145, 'CHAAAA', 'TWLAAA', 'VVVVxx'),
+(2202, 8028, 0, 2, 2, 2, 2, 202, 202, 2202, 2202, 4, 5, 'SGAAAA', 'UWLAAA', 'AAAAxx'),
+(6135, 8029, 1, 3, 5, 15, 35, 135, 135, 1135, 6135, 70, 71, 'ZBAAAA', 'VWLAAA', 'HHHHxx'),
+(5043, 8030, 1, 3, 3, 3, 43, 43, 1043, 43, 5043, 86, 87, 'ZLAAAA', 'WWLAAA', 'OOOOxx'),
+(5163, 8031, 1, 3, 3, 3, 63, 163, 1163, 163, 5163, 126, 127, 'PQAAAA', 'XWLAAA', 'VVVVxx'),
+(1191, 8032, 1, 3, 1, 11, 91, 191, 1191, 1191, 1191, 182, 183, 'VTAAAA', 'YWLAAA', 'AAAAxx'),
+(6576, 8033, 0, 0, 6, 16, 76, 576, 576, 1576, 6576, 152, 153, 'YSAAAA', 'ZWLAAA', 'HHHHxx'),
+(3455, 8034, 1, 3, 5, 15, 55, 455, 1455, 3455, 3455, 110, 111, 'XCAAAA', 'AXLAAA', 'OOOOxx'),
+(3688, 8035, 0, 0, 8, 8, 88, 688, 1688, 3688, 3688, 176, 177, 'WLAAAA', 'BXLAAA', 'VVVVxx'),
+(4982, 8036, 0, 2, 2, 2, 82, 982, 982, 4982, 4982, 164, 165, 'QJAAAA', 'CXLAAA', 'AAAAxx'),
+(4180, 8037, 0, 0, 0, 0, 80, 180, 180, 4180, 4180, 160, 161, 'UEAAAA', 'DXLAAA', 'HHHHxx'),
+(4708, 8038, 0, 0, 8, 8, 8, 708, 708, 4708, 4708, 16, 17, 'CZAAAA', 'EXLAAA', 'OOOOxx'),
+(1241, 8039, 1, 1, 1, 1, 41, 241, 1241, 1241, 1241, 82, 83, 'TVAAAA', 'FXLAAA', 'VVVVxx'),
+(4921, 8040, 1, 1, 1, 1, 21, 921, 921, 4921, 4921, 42, 43, 'HHAAAA', 'GXLAAA', 'AAAAxx'),
+(3197, 8041, 1, 1, 7, 17, 97, 197, 1197, 3197, 3197, 194, 195, 'ZSAAAA', 'HXLAAA', 'HHHHxx'),
+(8225, 8042, 1, 1, 5, 5, 25, 225, 225, 3225, 8225, 50, 51, 'JEAAAA', 'IXLAAA', 'OOOOxx'),
+(5913, 8043, 1, 1, 3, 13, 13, 913, 1913, 913, 5913, 26, 27, 'LTAAAA', 'JXLAAA', 'VVVVxx'),
+(6387, 8044, 1, 3, 7, 7, 87, 387, 387, 1387, 6387, 174, 175, 'RLAAAA', 'KXLAAA', 'AAAAxx'),
+(2706, 8045, 0, 2, 6, 6, 6, 706, 706, 2706, 2706, 12, 13, 'CAAAAA', 'LXLAAA', 'HHHHxx'),
+(1461, 8046, 1, 1, 1, 1, 61, 461, 1461, 1461, 1461, 122, 123, 'FEAAAA', 'MXLAAA', 'OOOOxx'),
+(7646, 8047, 0, 2, 6, 6, 46, 646, 1646, 2646, 7646, 92, 93, 'CIAAAA', 'NXLAAA', 'VVVVxx'),
+(8066, 8048, 0, 2, 6, 6, 66, 66, 66, 3066, 8066, 132, 133, 'GYAAAA', 'OXLAAA', 'AAAAxx'),
+(4171, 8049, 1, 3, 1, 11, 71, 171, 171, 4171, 4171, 142, 143, 'LEAAAA', 'PXLAAA', 'HHHHxx'),
+(8008, 8050, 0, 0, 8, 8, 8, 8, 8, 3008, 8008, 16, 17, 'AWAAAA', 'QXLAAA', 'OOOOxx'),
+(2088, 8051, 0, 0, 8, 8, 88, 88, 88, 2088, 2088, 176, 177, 'ICAAAA', 'RXLAAA', 'VVVVxx'),
+(7907, 8052, 1, 3, 7, 7, 7, 907, 1907, 2907, 7907, 14, 15, 'DSAAAA', 'SXLAAA', 'AAAAxx'),
+(2429, 8053, 1, 1, 9, 9, 29, 429, 429, 2429, 2429, 58, 59, 'LPAAAA', 'TXLAAA', 'HHHHxx'),
+(9629, 8054, 1, 1, 9, 9, 29, 629, 1629, 4629, 9629, 58, 59, 'JGAAAA', 'UXLAAA', 'OOOOxx'),
+(1470, 8055, 0, 2, 0, 10, 70, 470, 1470, 1470, 1470, 140, 141, 'OEAAAA', 'VXLAAA', 'VVVVxx'),
+(4346, 8056, 0, 2, 6, 6, 46, 346, 346, 4346, 4346, 92, 93, 'ELAAAA', 'WXLAAA', 'AAAAxx'),
+(7219, 8057, 1, 3, 9, 19, 19, 219, 1219, 2219, 7219, 38, 39, 'RRAAAA', 'XXLAAA', 'HHHHxx'),
+(1185, 8058, 1, 1, 5, 5, 85, 185, 1185, 1185, 1185, 170, 171, 'PTAAAA', 'YXLAAA', 'OOOOxx'),
+(8776, 8059, 0, 0, 6, 16, 76, 776, 776, 3776, 8776, 152, 153, 'OZAAAA', 'ZXLAAA', 'VVVVxx'),
+(684, 8060, 0, 0, 4, 4, 84, 684, 684, 684, 684, 168, 169, 'IAAAAA', 'AYLAAA', 'AAAAxx'),
+(2343, 8061, 1, 3, 3, 3, 43, 343, 343, 2343, 2343, 86, 87, 'DMAAAA', 'BYLAAA', 'HHHHxx'),
+(4470, 8062, 0, 2, 0, 10, 70, 470, 470, 4470, 4470, 140, 141, 'YPAAAA', 'CYLAAA', 'OOOOxx'),
+(5116, 8063, 0, 0, 6, 16, 16, 116, 1116, 116, 5116, 32, 33, 'UOAAAA', 'DYLAAA', 'VVVVxx'),
+(1746, 8064, 0, 2, 6, 6, 46, 746, 1746, 1746, 1746, 92, 93, 'EPAAAA', 'EYLAAA', 'AAAAxx'),
+(3216, 8065, 0, 0, 6, 16, 16, 216, 1216, 3216, 3216, 32, 33, 'STAAAA', 'FYLAAA', 'HHHHxx'),
+(4594, 8066, 0, 2, 4, 14, 94, 594, 594, 4594, 4594, 188, 189, 'SUAAAA', 'GYLAAA', 'OOOOxx'),
+(3013, 8067, 1, 1, 3, 13, 13, 13, 1013, 3013, 3013, 26, 27, 'XLAAAA', 'HYLAAA', 'VVVVxx'),
+(2307, 8068, 1, 3, 7, 7, 7, 307, 307, 2307, 2307, 14, 15, 'TKAAAA', 'IYLAAA', 'AAAAxx'),
+(7663, 8069, 1, 3, 3, 3, 63, 663, 1663, 2663, 7663, 126, 127, 'TIAAAA', 'JYLAAA', 'HHHHxx'),
+(8504, 8070, 0, 0, 4, 4, 4, 504, 504, 3504, 8504, 8, 9, 'CPAAAA', 'KYLAAA', 'OOOOxx'),
+(3683, 8071, 1, 3, 3, 3, 83, 683, 1683, 3683, 3683, 166, 167, 'RLAAAA', 'LYLAAA', 'VVVVxx'),
+(144, 8072, 0, 0, 4, 4, 44, 144, 144, 144, 144, 88, 89, 'OFAAAA', 'MYLAAA', 'AAAAxx'),
+(203, 8073, 1, 3, 3, 3, 3, 203, 203, 203, 203, 6, 7, 'VHAAAA', 'NYLAAA', 'HHHHxx'),
+(5255, 8074, 1, 3, 5, 15, 55, 255, 1255, 255, 5255, 110, 111, 'DUAAAA', 'OYLAAA', 'OOOOxx'),
+(4150, 8075, 0, 2, 0, 10, 50, 150, 150, 4150, 4150, 100, 101, 'QDAAAA', 'PYLAAA', 'VVVVxx'),
+(5701, 8076, 1, 1, 1, 1, 1, 701, 1701, 701, 5701, 2, 3, 'HLAAAA', 'QYLAAA', 'AAAAxx'),
+(7400, 8077, 0, 0, 0, 0, 0, 400, 1400, 2400, 7400, 0, 1, 'QYAAAA', 'RYLAAA', 'HHHHxx'),
+(8203, 8078, 1, 3, 3, 3, 3, 203, 203, 3203, 8203, 6, 7, 'NDAAAA', 'SYLAAA', 'OOOOxx'),
+(637, 8079, 1, 1, 7, 17, 37, 637, 637, 637, 637, 74, 75, 'NYAAAA', 'TYLAAA', 'VVVVxx'),
+(2898, 8080, 0, 2, 8, 18, 98, 898, 898, 2898, 2898, 196, 197, 'MHAAAA', 'UYLAAA', 'AAAAxx'),
+(1110, 8081, 0, 2, 0, 10, 10, 110, 1110, 1110, 1110, 20, 21, 'SQAAAA', 'VYLAAA', 'HHHHxx'),
+(6255, 8082, 1, 3, 5, 15, 55, 255, 255, 1255, 6255, 110, 111, 'PGAAAA', 'WYLAAA', 'OOOOxx'),
+(1071, 8083, 1, 3, 1, 11, 71, 71, 1071, 1071, 1071, 142, 143, 'FPAAAA', 'XYLAAA', 'VVVVxx'),
+(541, 8084, 1, 1, 1, 1, 41, 541, 541, 541, 541, 82, 83, 'VUAAAA', 'YYLAAA', 'AAAAxx'),
+(8077, 8085, 1, 1, 7, 17, 77, 77, 77, 3077, 8077, 154, 155, 'RYAAAA', 'ZYLAAA', 'HHHHxx'),
+(6809, 8086, 1, 1, 9, 9, 9, 809, 809, 1809, 6809, 18, 19, 'XBAAAA', 'AZLAAA', 'OOOOxx'),
+(4749, 8087, 1, 1, 9, 9, 49, 749, 749, 4749, 4749, 98, 99, 'RAAAAA', 'BZLAAA', 'VVVVxx'),
+(2886, 8088, 0, 2, 6, 6, 86, 886, 886, 2886, 2886, 172, 173, 'AHAAAA', 'CZLAAA', 'AAAAxx'),
+(5510, 8089, 0, 2, 0, 10, 10, 510, 1510, 510, 5510, 20, 21, 'YDAAAA', 'DZLAAA', 'HHHHxx'),
+(713, 8090, 1, 1, 3, 13, 13, 713, 713, 713, 713, 26, 27, 'LBAAAA', 'EZLAAA', 'OOOOxx'),
+(8388, 8091, 0, 0, 8, 8, 88, 388, 388, 3388, 8388, 176, 177, 'QKAAAA', 'FZLAAA', 'VVVVxx'),
+(9524, 8092, 0, 0, 4, 4, 24, 524, 1524, 4524, 9524, 48, 49, 'ICAAAA', 'GZLAAA', 'AAAAxx'),
+(9949, 8093, 1, 1, 9, 9, 49, 949, 1949, 4949, 9949, 98, 99, 'RSAAAA', 'HZLAAA', 'HHHHxx'),
+(885, 8094, 1, 1, 5, 5, 85, 885, 885, 885, 885, 170, 171, 'BIAAAA', 'IZLAAA', 'OOOOxx'),
+(8699, 8095, 1, 3, 9, 19, 99, 699, 699, 3699, 8699, 198, 199, 'PWAAAA', 'JZLAAA', 'VVVVxx'),
+(2232, 8096, 0, 0, 2, 12, 32, 232, 232, 2232, 2232, 64, 65, 'WHAAAA', 'KZLAAA', 'AAAAxx'),
+(5142, 8097, 0, 2, 2, 2, 42, 142, 1142, 142, 5142, 84, 85, 'UPAAAA', 'LZLAAA', 'HHHHxx'),
+(8891, 8098, 1, 3, 1, 11, 91, 891, 891, 3891, 8891, 182, 183, 'ZDAAAA', 'MZLAAA', 'OOOOxx'),
+(1881, 8099, 1, 1, 1, 1, 81, 881, 1881, 1881, 1881, 162, 163, 'JUAAAA', 'NZLAAA', 'VVVVxx'),
+(3751, 8100, 1, 3, 1, 11, 51, 751, 1751, 3751, 3751, 102, 103, 'HOAAAA', 'OZLAAA', 'AAAAxx'),
+(1896, 8101, 0, 0, 6, 16, 96, 896, 1896, 1896, 1896, 192, 193, 'YUAAAA', 'PZLAAA', 'HHHHxx'),
+(8258, 8102, 0, 2, 8, 18, 58, 258, 258, 3258, 8258, 116, 117, 'QFAAAA', 'QZLAAA', 'OOOOxx'),
+(3820, 8103, 0, 0, 0, 0, 20, 820, 1820, 3820, 3820, 40, 41, 'YQAAAA', 'RZLAAA', 'VVVVxx'),
+(6617, 8104, 1, 1, 7, 17, 17, 617, 617, 1617, 6617, 34, 35, 'NUAAAA', 'SZLAAA', 'AAAAxx'),
+(5100, 8105, 0, 0, 0, 0, 0, 100, 1100, 100, 5100, 0, 1, 'EOAAAA', 'TZLAAA', 'HHHHxx'),
+(4277, 8106, 1, 1, 7, 17, 77, 277, 277, 4277, 4277, 154, 155, 'NIAAAA', 'UZLAAA', 'OOOOxx'),
+(2498, 8107, 0, 2, 8, 18, 98, 498, 498, 2498, 2498, 196, 197, 'CSAAAA', 'VZLAAA', 'VVVVxx'),
+(4343, 8108, 1, 3, 3, 3, 43, 343, 343, 4343, 4343, 86, 87, 'BLAAAA', 'WZLAAA', 'AAAAxx'),
+(8319, 8109, 1, 3, 9, 19, 19, 319, 319, 3319, 8319, 38, 39, 'ZHAAAA', 'XZLAAA', 'HHHHxx'),
+(4803, 8110, 1, 3, 3, 3, 3, 803, 803, 4803, 4803, 6, 7, 'TCAAAA', 'YZLAAA', 'OOOOxx'),
+(3100, 8111, 0, 0, 0, 0, 0, 100, 1100, 3100, 3100, 0, 1, 'GPAAAA', 'ZZLAAA', 'VVVVxx'),
+(428, 8112, 0, 0, 8, 8, 28, 428, 428, 428, 428, 56, 57, 'MQAAAA', 'AAMAAA', 'AAAAxx'),
+(2811, 8113, 1, 3, 1, 11, 11, 811, 811, 2811, 2811, 22, 23, 'DEAAAA', 'BAMAAA', 'HHHHxx'),
+(2989, 8114, 1, 1, 9, 9, 89, 989, 989, 2989, 2989, 178, 179, 'ZKAAAA', 'CAMAAA', 'OOOOxx'),
+(1100, 8115, 0, 0, 0, 0, 0, 100, 1100, 1100, 1100, 0, 1, 'IQAAAA', 'DAMAAA', 'VVVVxx'),
+(6586, 8116, 0, 2, 6, 6, 86, 586, 586, 1586, 6586, 172, 173, 'ITAAAA', 'EAMAAA', 'AAAAxx'),
+(3124, 8117, 0, 0, 4, 4, 24, 124, 1124, 3124, 3124, 48, 49, 'EQAAAA', 'FAMAAA', 'HHHHxx'),
+(1635, 8118, 1, 3, 5, 15, 35, 635, 1635, 1635, 1635, 70, 71, 'XKAAAA', 'GAMAAA', 'OOOOxx'),
+(3888, 8119, 0, 0, 8, 8, 88, 888, 1888, 3888, 3888, 176, 177, 'OTAAAA', 'HAMAAA', 'VVVVxx'),
+(8369, 8120, 1, 1, 9, 9, 69, 369, 369, 3369, 8369, 138, 139, 'XJAAAA', 'IAMAAA', 'AAAAxx'),
+(3148, 8121, 0, 0, 8, 8, 48, 148, 1148, 3148, 3148, 96, 97, 'CRAAAA', 'JAMAAA', 'HHHHxx'),
+(2842, 8122, 0, 2, 2, 2, 42, 842, 842, 2842, 2842, 84, 85, 'IFAAAA', 'KAMAAA', 'OOOOxx'),
+(4965, 8123, 1, 1, 5, 5, 65, 965, 965, 4965, 4965, 130, 131, 'ZIAAAA', 'LAMAAA', 'VVVVxx'),
+(3742, 8124, 0, 2, 2, 2, 42, 742, 1742, 3742, 3742, 84, 85, 'YNAAAA', 'MAMAAA', 'AAAAxx'),
+(5196, 8125, 0, 0, 6, 16, 96, 196, 1196, 196, 5196, 192, 193, 'WRAAAA', 'NAMAAA', 'HHHHxx'),
+(9105, 8126, 1, 1, 5, 5, 5, 105, 1105, 4105, 9105, 10, 11, 'FMAAAA', 'OAMAAA', 'OOOOxx'),
+(6806, 8127, 0, 2, 6, 6, 6, 806, 806, 1806, 6806, 12, 13, 'UBAAAA', 'PAMAAA', 'VVVVxx'),
+(5849, 8128, 1, 1, 9, 9, 49, 849, 1849, 849, 5849, 98, 99, 'ZQAAAA', 'QAMAAA', 'AAAAxx'),
+(6504, 8129, 0, 0, 4, 4, 4, 504, 504, 1504, 6504, 8, 9, 'EQAAAA', 'RAMAAA', 'HHHHxx'),
+(9841, 8130, 1, 1, 1, 1, 41, 841, 1841, 4841, 9841, 82, 83, 'NOAAAA', 'SAMAAA', 'OOOOxx'),
+(457, 8131, 1, 1, 7, 17, 57, 457, 457, 457, 457, 114, 115, 'PRAAAA', 'TAMAAA', 'VVVVxx'),
+(8856, 8132, 0, 0, 6, 16, 56, 856, 856, 3856, 8856, 112, 113, 'QCAAAA', 'UAMAAA', 'AAAAxx'),
+(8043, 8133, 1, 3, 3, 3, 43, 43, 43, 3043, 8043, 86, 87, 'JXAAAA', 'VAMAAA', 'HHHHxx'),
+(5933, 8134, 1, 1, 3, 13, 33, 933, 1933, 933, 5933, 66, 67, 'FUAAAA', 'WAMAAA', 'OOOOxx'),
+(5725, 8135, 1, 1, 5, 5, 25, 725, 1725, 725, 5725, 50, 51, 'FMAAAA', 'XAMAAA', 'VVVVxx'),
+(8607, 8136, 1, 3, 7, 7, 7, 607, 607, 3607, 8607, 14, 15, 'BTAAAA', 'YAMAAA', 'AAAAxx'),
+(9280, 8137, 0, 0, 0, 0, 80, 280, 1280, 4280, 9280, 160, 161, 'YSAAAA', 'ZAMAAA', 'HHHHxx'),
+(6017, 8138, 1, 1, 7, 17, 17, 17, 17, 1017, 6017, 34, 35, 'LXAAAA', 'ABMAAA', 'OOOOxx'),
+(4946, 8139, 0, 2, 6, 6, 46, 946, 946, 4946, 4946, 92, 93, 'GIAAAA', 'BBMAAA', 'VVVVxx'),
+(7373, 8140, 1, 1, 3, 13, 73, 373, 1373, 2373, 7373, 146, 147, 'PXAAAA', 'CBMAAA', 'AAAAxx'),
+(8096, 8141, 0, 0, 6, 16, 96, 96, 96, 3096, 8096, 192, 193, 'KZAAAA', 'DBMAAA', 'HHHHxx'),
+(3178, 8142, 0, 2, 8, 18, 78, 178, 1178, 3178, 3178, 156, 157, 'GSAAAA', 'EBMAAA', 'OOOOxx'),
+(1849, 8143, 1, 1, 9, 9, 49, 849, 1849, 1849, 1849, 98, 99, 'DTAAAA', 'FBMAAA', 'VVVVxx'),
+(8813, 8144, 1, 1, 3, 13, 13, 813, 813, 3813, 8813, 26, 27, 'ZAAAAA', 'GBMAAA', 'AAAAxx'),
+(460, 8145, 0, 0, 0, 0, 60, 460, 460, 460, 460, 120, 121, 'SRAAAA', 'HBMAAA', 'HHHHxx'),
+(7756, 8146, 0, 0, 6, 16, 56, 756, 1756, 2756, 7756, 112, 113, 'IMAAAA', 'IBMAAA', 'OOOOxx'),
+(4425, 8147, 1, 1, 5, 5, 25, 425, 425, 4425, 4425, 50, 51, 'FOAAAA', 'JBMAAA', 'VVVVxx'),
+(1602, 8148, 0, 2, 2, 2, 2, 602, 1602, 1602, 1602, 4, 5, 'QJAAAA', 'KBMAAA', 'AAAAxx'),
+(5981, 8149, 1, 1, 1, 1, 81, 981, 1981, 981, 5981, 162, 163, 'BWAAAA', 'LBMAAA', 'HHHHxx'),
+(8139, 8150, 1, 3, 9, 19, 39, 139, 139, 3139, 8139, 78, 79, 'BBAAAA', 'MBMAAA', 'OOOOxx'),
+(754, 8151, 0, 2, 4, 14, 54, 754, 754, 754, 754, 108, 109, 'ADAAAA', 'NBMAAA', 'VVVVxx'),
+(26, 8152, 0, 2, 6, 6, 26, 26, 26, 26, 26, 52, 53, 'ABAAAA', 'OBMAAA', 'AAAAxx'),
+(106, 8153, 0, 2, 6, 6, 6, 106, 106, 106, 106, 12, 13, 'CEAAAA', 'PBMAAA', 'HHHHxx'),
+(7465, 8154, 1, 1, 5, 5, 65, 465, 1465, 2465, 7465, 130, 131, 'DBAAAA', 'QBMAAA', 'OOOOxx'),
+(1048, 8155, 0, 0, 8, 8, 48, 48, 1048, 1048, 1048, 96, 97, 'IOAAAA', 'RBMAAA', 'VVVVxx'),
+(2303, 8156, 1, 3, 3, 3, 3, 303, 303, 2303, 2303, 6, 7, 'PKAAAA', 'SBMAAA', 'AAAAxx'),
+(5794, 8157, 0, 2, 4, 14, 94, 794, 1794, 794, 5794, 188, 189, 'WOAAAA', 'TBMAAA', 'HHHHxx'),
+(3321, 8158, 1, 1, 1, 1, 21, 321, 1321, 3321, 3321, 42, 43, 'TXAAAA', 'UBMAAA', 'OOOOxx'),
+(6122, 8159, 0, 2, 2, 2, 22, 122, 122, 1122, 6122, 44, 45, 'MBAAAA', 'VBMAAA', 'VVVVxx'),
+(6474, 8160, 0, 2, 4, 14, 74, 474, 474, 1474, 6474, 148, 149, 'APAAAA', 'WBMAAA', 'AAAAxx'),
+(827, 8161, 1, 3, 7, 7, 27, 827, 827, 827, 827, 54, 55, 'VFAAAA', 'XBMAAA', 'HHHHxx'),
+(6616, 8162, 0, 0, 6, 16, 16, 616, 616, 1616, 6616, 32, 33, 'MUAAAA', 'YBMAAA', 'OOOOxx'),
+(2131, 8163, 1, 3, 1, 11, 31, 131, 131, 2131, 2131, 62, 63, 'ZDAAAA', 'ZBMAAA', 'VVVVxx'),
+(5483, 8164, 1, 3, 3, 3, 83, 483, 1483, 483, 5483, 166, 167, 'XCAAAA', 'ACMAAA', 'AAAAxx'),
+(606, 8165, 0, 2, 6, 6, 6, 606, 606, 606, 606, 12, 13, 'IXAAAA', 'BCMAAA', 'HHHHxx'),
+(922, 8166, 0, 2, 2, 2, 22, 922, 922, 922, 922, 44, 45, 'MJAAAA', 'CCMAAA', 'OOOOxx'),
+(8475, 8167, 1, 3, 5, 15, 75, 475, 475, 3475, 8475, 150, 151, 'ZNAAAA', 'DCMAAA', 'VVVVxx'),
+(7645, 8168, 1, 1, 5, 5, 45, 645, 1645, 2645, 7645, 90, 91, 'BIAAAA', 'ECMAAA', 'AAAAxx'),
+(5097, 8169, 1, 1, 7, 17, 97, 97, 1097, 97, 5097, 194, 195, 'BOAAAA', 'FCMAAA', 'HHHHxx'),
+(5377, 8170, 1, 1, 7, 17, 77, 377, 1377, 377, 5377, 154, 155, 'VYAAAA', 'GCMAAA', 'OOOOxx'),
+(6116, 8171, 0, 0, 6, 16, 16, 116, 116, 1116, 6116, 32, 33, 'GBAAAA', 'HCMAAA', 'VVVVxx'),
+(8674, 8172, 0, 2, 4, 14, 74, 674, 674, 3674, 8674, 148, 149, 'QVAAAA', 'ICMAAA', 'AAAAxx'),
+(8063, 8173, 1, 3, 3, 3, 63, 63, 63, 3063, 8063, 126, 127, 'DYAAAA', 'JCMAAA', 'HHHHxx'),
+(5271, 8174, 1, 3, 1, 11, 71, 271, 1271, 271, 5271, 142, 143, 'TUAAAA', 'KCMAAA', 'OOOOxx'),
+(1619, 8175, 1, 3, 9, 19, 19, 619, 1619, 1619, 1619, 38, 39, 'HKAAAA', 'LCMAAA', 'VVVVxx'),
+(6419, 8176, 1, 3, 9, 19, 19, 419, 419, 1419, 6419, 38, 39, 'XMAAAA', 'MCMAAA', 'AAAAxx'),
+(7651, 8177, 1, 3, 1, 11, 51, 651, 1651, 2651, 7651, 102, 103, 'HIAAAA', 'NCMAAA', 'HHHHxx'),
+(2897, 8178, 1, 1, 7, 17, 97, 897, 897, 2897, 2897, 194, 195, 'LHAAAA', 'OCMAAA', 'OOOOxx'),
+(8148, 8179, 0, 0, 8, 8, 48, 148, 148, 3148, 8148, 96, 97, 'KBAAAA', 'PCMAAA', 'VVVVxx'),
+(7461, 8180, 1, 1, 1, 1, 61, 461, 1461, 2461, 7461, 122, 123, 'ZAAAAA', 'QCMAAA', 'AAAAxx'),
+(9186, 8181, 0, 2, 6, 6, 86, 186, 1186, 4186, 9186, 172, 173, 'IPAAAA', 'RCMAAA', 'HHHHxx'),
+(7127, 8182, 1, 3, 7, 7, 27, 127, 1127, 2127, 7127, 54, 55, 'DOAAAA', 'SCMAAA', 'OOOOxx'),
+(8233, 8183, 1, 1, 3, 13, 33, 233, 233, 3233, 8233, 66, 67, 'REAAAA', 'TCMAAA', 'VVVVxx'),
+(9651, 8184, 1, 3, 1, 11, 51, 651, 1651, 4651, 9651, 102, 103, 'FHAAAA', 'UCMAAA', 'AAAAxx'),
+(6746, 8185, 0, 2, 6, 6, 46, 746, 746, 1746, 6746, 92, 93, 'MZAAAA', 'VCMAAA', 'HHHHxx'),
+(7835, 8186, 1, 3, 5, 15, 35, 835, 1835, 2835, 7835, 70, 71, 'JPAAAA', 'WCMAAA', 'OOOOxx'),
+(8815, 8187, 1, 3, 5, 15, 15, 815, 815, 3815, 8815, 30, 31, 'BBAAAA', 'XCMAAA', 'VVVVxx'),
+(6398, 8188, 0, 2, 8, 18, 98, 398, 398, 1398, 6398, 196, 197, 'CMAAAA', 'YCMAAA', 'AAAAxx'),
+(5344, 8189, 0, 0, 4, 4, 44, 344, 1344, 344, 5344, 88, 89, 'OXAAAA', 'ZCMAAA', 'HHHHxx'),
+(8209, 8190, 1, 1, 9, 9, 9, 209, 209, 3209, 8209, 18, 19, 'TDAAAA', 'ADMAAA', 'OOOOxx'),
+(8444, 8191, 0, 0, 4, 4, 44, 444, 444, 3444, 8444, 88, 89, 'UMAAAA', 'BDMAAA', 'VVVVxx'),
+(5669, 8192, 1, 1, 9, 9, 69, 669, 1669, 669, 5669, 138, 139, 'BKAAAA', 'CDMAAA', 'AAAAxx'),
+(2455, 8193, 1, 3, 5, 15, 55, 455, 455, 2455, 2455, 110, 111, 'LQAAAA', 'DDMAAA', 'HHHHxx'),
+(6767, 8194, 1, 3, 7, 7, 67, 767, 767, 1767, 6767, 134, 135, 'HAAAAA', 'EDMAAA', 'OOOOxx'),
+(135, 8195, 1, 3, 5, 15, 35, 135, 135, 135, 135, 70, 71, 'FFAAAA', 'FDMAAA', 'VVVVxx'),
+(3503, 8196, 1, 3, 3, 3, 3, 503, 1503, 3503, 3503, 6, 7, 'TEAAAA', 'GDMAAA', 'AAAAxx'),
+(6102, 8197, 0, 2, 2, 2, 2, 102, 102, 1102, 6102, 4, 5, 'SAAAAA', 'HDMAAA', 'HHHHxx'),
+(7136, 8198, 0, 0, 6, 16, 36, 136, 1136, 2136, 7136, 72, 73, 'MOAAAA', 'IDMAAA', 'OOOOxx'),
+(4933, 8199, 1, 1, 3, 13, 33, 933, 933, 4933, 4933, 66, 67, 'THAAAA', 'JDMAAA', 'VVVVxx'),
+(8804, 8200, 0, 0, 4, 4, 4, 804, 804, 3804, 8804, 8, 9, 'QAAAAA', 'KDMAAA', 'AAAAxx'),
+(3760, 8201, 0, 0, 0, 0, 60, 760, 1760, 3760, 3760, 120, 121, 'QOAAAA', 'LDMAAA', 'HHHHxx'),
+(8603, 8202, 1, 3, 3, 3, 3, 603, 603, 3603, 8603, 6, 7, 'XSAAAA', 'MDMAAA', 'OOOOxx'),
+(7411, 8203, 1, 3, 1, 11, 11, 411, 1411, 2411, 7411, 22, 23, 'BZAAAA', 'NDMAAA', 'VVVVxx'),
+(834, 8204, 0, 2, 4, 14, 34, 834, 834, 834, 834, 68, 69, 'CGAAAA', 'ODMAAA', 'AAAAxx'),
+(7385, 8205, 1, 1, 5, 5, 85, 385, 1385, 2385, 7385, 170, 171, 'BYAAAA', 'PDMAAA', 'HHHHxx'),
+(3696, 8206, 0, 0, 6, 16, 96, 696, 1696, 3696, 3696, 192, 193, 'EMAAAA', 'QDMAAA', 'OOOOxx'),
+(8720, 8207, 0, 0, 0, 0, 20, 720, 720, 3720, 8720, 40, 41, 'KXAAAA', 'RDMAAA', 'VVVVxx'),
+(4539, 8208, 1, 3, 9, 19, 39, 539, 539, 4539, 4539, 78, 79, 'PSAAAA', 'SDMAAA', 'AAAAxx'),
+(9837, 8209, 1, 1, 7, 17, 37, 837, 1837, 4837, 9837, 74, 75, 'JOAAAA', 'TDMAAA', 'HHHHxx'),
+(8595, 8210, 1, 3, 5, 15, 95, 595, 595, 3595, 8595, 190, 191, 'PSAAAA', 'UDMAAA', 'OOOOxx'),
+(3673, 8211, 1, 1, 3, 13, 73, 673, 1673, 3673, 3673, 146, 147, 'HLAAAA', 'VDMAAA', 'VVVVxx'),
+(475, 8212, 1, 3, 5, 15, 75, 475, 475, 475, 475, 150, 151, 'HSAAAA', 'WDMAAA', 'AAAAxx'),
+(2256, 8213, 0, 0, 6, 16, 56, 256, 256, 2256, 2256, 112, 113, 'UIAAAA', 'XDMAAA', 'HHHHxx'),
+(6349, 8214, 1, 1, 9, 9, 49, 349, 349, 1349, 6349, 98, 99, 'FKAAAA', 'YDMAAA', 'OOOOxx'),
+(9968, 8215, 0, 0, 8, 8, 68, 968, 1968, 4968, 9968, 136, 137, 'KTAAAA', 'ZDMAAA', 'VVVVxx'),
+(7261, 8216, 1, 1, 1, 1, 61, 261, 1261, 2261, 7261, 122, 123, 'HTAAAA', 'AEMAAA', 'AAAAxx'),
+(5799, 8217, 1, 3, 9, 19, 99, 799, 1799, 799, 5799, 198, 199, 'BPAAAA', 'BEMAAA', 'HHHHxx'),
+(8159, 8218, 1, 3, 9, 19, 59, 159, 159, 3159, 8159, 118, 119, 'VBAAAA', 'CEMAAA', 'OOOOxx'),
+(92, 8219, 0, 0, 2, 12, 92, 92, 92, 92, 92, 184, 185, 'ODAAAA', 'DEMAAA', 'VVVVxx'),
+(5927, 8220, 1, 3, 7, 7, 27, 927, 1927, 927, 5927, 54, 55, 'ZTAAAA', 'EEMAAA', 'AAAAxx'),
+(7925, 8221, 1, 1, 5, 5, 25, 925, 1925, 2925, 7925, 50, 51, 'VSAAAA', 'FEMAAA', 'HHHHxx'),
+(5836, 8222, 0, 0, 6, 16, 36, 836, 1836, 836, 5836, 72, 73, 'MQAAAA', 'GEMAAA', 'OOOOxx'),
+(7935, 8223, 1, 3, 5, 15, 35, 935, 1935, 2935, 7935, 70, 71, 'FTAAAA', 'HEMAAA', 'VVVVxx'),
+(5505, 8224, 1, 1, 5, 5, 5, 505, 1505, 505, 5505, 10, 11, 'TDAAAA', 'IEMAAA', 'AAAAxx'),
+(5882, 8225, 0, 2, 2, 2, 82, 882, 1882, 882, 5882, 164, 165, 'GSAAAA', 'JEMAAA', 'HHHHxx'),
+(4411, 8226, 1, 3, 1, 11, 11, 411, 411, 4411, 4411, 22, 23, 'RNAAAA', 'KEMAAA', 'OOOOxx'),
+(64, 8227, 0, 0, 4, 4, 64, 64, 64, 64, 64, 128, 129, 'MCAAAA', 'LEMAAA', 'VVVVxx'),
+(2851, 8228, 1, 3, 1, 11, 51, 851, 851, 2851, 2851, 102, 103, 'RFAAAA', 'MEMAAA', 'AAAAxx'),
+(1665, 8229, 1, 1, 5, 5, 65, 665, 1665, 1665, 1665, 130, 131, 'BMAAAA', 'NEMAAA', 'HHHHxx'),
+(2895, 8230, 1, 3, 5, 15, 95, 895, 895, 2895, 2895, 190, 191, 'JHAAAA', 'OEMAAA', 'OOOOxx'),
+(2210, 8231, 0, 2, 0, 10, 10, 210, 210, 2210, 2210, 20, 21, 'AHAAAA', 'PEMAAA', 'VVVVxx'),
+(9873, 8232, 1, 1, 3, 13, 73, 873, 1873, 4873, 9873, 146, 147, 'TPAAAA', 'QEMAAA', 'AAAAxx'),
+(5402, 8233, 0, 2, 2, 2, 2, 402, 1402, 402, 5402, 4, 5, 'UZAAAA', 'REMAAA', 'HHHHxx'),
+(285, 8234, 1, 1, 5, 5, 85, 285, 285, 285, 285, 170, 171, 'ZKAAAA', 'SEMAAA', 'OOOOxx'),
+(8545, 8235, 1, 1, 5, 5, 45, 545, 545, 3545, 8545, 90, 91, 'RQAAAA', 'TEMAAA', 'VVVVxx'),
+(5328, 8236, 0, 0, 8, 8, 28, 328, 1328, 328, 5328, 56, 57, 'YWAAAA', 'UEMAAA', 'AAAAxx'),
+(733, 8237, 1, 1, 3, 13, 33, 733, 733, 733, 733, 66, 67, 'FCAAAA', 'VEMAAA', 'HHHHxx'),
+(7726, 8238, 0, 2, 6, 6, 26, 726, 1726, 2726, 7726, 52, 53, 'ELAAAA', 'WEMAAA', 'OOOOxx'),
+(5418, 8239, 0, 2, 8, 18, 18, 418, 1418, 418, 5418, 36, 37, 'KAAAAA', 'XEMAAA', 'VVVVxx'),
+(7761, 8240, 1, 1, 1, 1, 61, 761, 1761, 2761, 7761, 122, 123, 'NMAAAA', 'YEMAAA', 'AAAAxx'),
+(9263, 8241, 1, 3, 3, 3, 63, 263, 1263, 4263, 9263, 126, 127, 'HSAAAA', 'ZEMAAA', 'HHHHxx'),
+(5579, 8242, 1, 3, 9, 19, 79, 579, 1579, 579, 5579, 158, 159, 'PGAAAA', 'AFMAAA', 'OOOOxx'),
+(5434, 8243, 0, 2, 4, 14, 34, 434, 1434, 434, 5434, 68, 69, 'ABAAAA', 'BFMAAA', 'VVVVxx'),
+(5230, 8244, 0, 2, 0, 10, 30, 230, 1230, 230, 5230, 60, 61, 'ETAAAA', 'CFMAAA', 'AAAAxx'),
+(9981, 8245, 1, 1, 1, 1, 81, 981, 1981, 4981, 9981, 162, 163, 'XTAAAA', 'DFMAAA', 'HHHHxx'),
+(5830, 8246, 0, 2, 0, 10, 30, 830, 1830, 830, 5830, 60, 61, 'GQAAAA', 'EFMAAA', 'OOOOxx'),
+(128, 8247, 0, 0, 8, 8, 28, 128, 128, 128, 128, 56, 57, 'YEAAAA', 'FFMAAA', 'VVVVxx'),
+(2734, 8248, 0, 2, 4, 14, 34, 734, 734, 2734, 2734, 68, 69, 'EBAAAA', 'GFMAAA', 'AAAAxx'),
+(4537, 8249, 1, 1, 7, 17, 37, 537, 537, 4537, 4537, 74, 75, 'NSAAAA', 'HFMAAA', 'HHHHxx'),
+(3899, 8250, 1, 3, 9, 19, 99, 899, 1899, 3899, 3899, 198, 199, 'ZTAAAA', 'IFMAAA', 'OOOOxx'),
+(1000, 8251, 0, 0, 0, 0, 0, 0, 1000, 1000, 1000, 0, 1, 'MMAAAA', 'JFMAAA', 'VVVVxx'),
+(9896, 8252, 0, 0, 6, 16, 96, 896, 1896, 4896, 9896, 192, 193, 'QQAAAA', 'KFMAAA', 'AAAAxx'),
+(3640, 8253, 0, 0, 0, 0, 40, 640, 1640, 3640, 3640, 80, 81, 'AKAAAA', 'LFMAAA', 'HHHHxx'),
+(2568, 8254, 0, 0, 8, 8, 68, 568, 568, 2568, 2568, 136, 137, 'UUAAAA', 'MFMAAA', 'OOOOxx'),
+(2026, 8255, 0, 2, 6, 6, 26, 26, 26, 2026, 2026, 52, 53, 'YZAAAA', 'NFMAAA', 'VVVVxx'),
+(3955, 8256, 1, 3, 5, 15, 55, 955, 1955, 3955, 3955, 110, 111, 'DWAAAA', 'OFMAAA', 'AAAAxx'),
+(7152, 8257, 0, 0, 2, 12, 52, 152, 1152, 2152, 7152, 104, 105, 'CPAAAA', 'PFMAAA', 'HHHHxx'),
+(2402, 8258, 0, 2, 2, 2, 2, 402, 402, 2402, 2402, 4, 5, 'KOAAAA', 'QFMAAA', 'OOOOxx'),
+(9522, 8259, 0, 2, 2, 2, 22, 522, 1522, 4522, 9522, 44, 45, 'GCAAAA', 'RFMAAA', 'VVVVxx'),
+(4011, 8260, 1, 3, 1, 11, 11, 11, 11, 4011, 4011, 22, 23, 'HYAAAA', 'SFMAAA', 'AAAAxx'),
+(3297, 8261, 1, 1, 7, 17, 97, 297, 1297, 3297, 3297, 194, 195, 'VWAAAA', 'TFMAAA', 'HHHHxx'),
+(4915, 8262, 1, 3, 5, 15, 15, 915, 915, 4915, 4915, 30, 31, 'BHAAAA', 'UFMAAA', 'OOOOxx'),
+(5397, 8263, 1, 1, 7, 17, 97, 397, 1397, 397, 5397, 194, 195, 'PZAAAA', 'VFMAAA', 'VVVVxx'),
+(5454, 8264, 0, 2, 4, 14, 54, 454, 1454, 454, 5454, 108, 109, 'UBAAAA', 'WFMAAA', 'AAAAxx'),
+(4568, 8265, 0, 0, 8, 8, 68, 568, 568, 4568, 4568, 136, 137, 'STAAAA', 'XFMAAA', 'HHHHxx'),
+(5875, 8266, 1, 3, 5, 15, 75, 875, 1875, 875, 5875, 150, 151, 'ZRAAAA', 'YFMAAA', 'OOOOxx'),
+(3642, 8267, 0, 2, 2, 2, 42, 642, 1642, 3642, 3642, 84, 85, 'CKAAAA', 'ZFMAAA', 'VVVVxx'),
+(8506, 8268, 0, 2, 6, 6, 6, 506, 506, 3506, 8506, 12, 13, 'EPAAAA', 'AGMAAA', 'AAAAxx'),
+(9621, 8269, 1, 1, 1, 1, 21, 621, 1621, 4621, 9621, 42, 43, 'BGAAAA', 'BGMAAA', 'HHHHxx'),
+(7739, 8270, 1, 3, 9, 19, 39, 739, 1739, 2739, 7739, 78, 79, 'RLAAAA', 'CGMAAA', 'OOOOxx'),
+(3987, 8271, 1, 3, 7, 7, 87, 987, 1987, 3987, 3987, 174, 175, 'JXAAAA', 'DGMAAA', 'VVVVxx'),
+(2090, 8272, 0, 2, 0, 10, 90, 90, 90, 2090, 2090, 180, 181, 'KCAAAA', 'EGMAAA', 'AAAAxx'),
+(3838, 8273, 0, 2, 8, 18, 38, 838, 1838, 3838, 3838, 76, 77, 'QRAAAA', 'FGMAAA', 'HHHHxx'),
+(17, 8274, 1, 1, 7, 17, 17, 17, 17, 17, 17, 34, 35, 'RAAAAA', 'GGMAAA', 'OOOOxx'),
+(3406, 8275, 0, 2, 6, 6, 6, 406, 1406, 3406, 3406, 12, 13, 'ABAAAA', 'HGMAAA', 'VVVVxx'),
+(8312, 8276, 0, 0, 2, 12, 12, 312, 312, 3312, 8312, 24, 25, 'SHAAAA', 'IGMAAA', 'AAAAxx'),
+(4034, 8277, 0, 2, 4, 14, 34, 34, 34, 4034, 4034, 68, 69, 'EZAAAA', 'JGMAAA', 'HHHHxx'),
+(1535, 8278, 1, 3, 5, 15, 35, 535, 1535, 1535, 1535, 70, 71, 'BHAAAA', 'KGMAAA', 'OOOOxx'),
+(7198, 8279, 0, 2, 8, 18, 98, 198, 1198, 2198, 7198, 196, 197, 'WQAAAA', 'LGMAAA', 'VVVVxx'),
+(8885, 8280, 1, 1, 5, 5, 85, 885, 885, 3885, 8885, 170, 171, 'TDAAAA', 'MGMAAA', 'AAAAxx'),
+(4081, 8281, 1, 1, 1, 1, 81, 81, 81, 4081, 4081, 162, 163, 'ZAAAAA', 'NGMAAA', 'HHHHxx'),
+(980, 8282, 0, 0, 0, 0, 80, 980, 980, 980, 980, 160, 161, 'SLAAAA', 'OGMAAA', 'OOOOxx'),
+(551, 8283, 1, 3, 1, 11, 51, 551, 551, 551, 551, 102, 103, 'FVAAAA', 'PGMAAA', 'VVVVxx'),
+(7746, 8284, 0, 2, 6, 6, 46, 746, 1746, 2746, 7746, 92, 93, 'YLAAAA', 'QGMAAA', 'AAAAxx'),
+(4756, 8285, 0, 0, 6, 16, 56, 756, 756, 4756, 4756, 112, 113, 'YAAAAA', 'RGMAAA', 'HHHHxx'),
+(3655, 8286, 1, 3, 5, 15, 55, 655, 1655, 3655, 3655, 110, 111, 'PKAAAA', 'SGMAAA', 'OOOOxx'),
+(7075, 8287, 1, 3, 5, 15, 75, 75, 1075, 2075, 7075, 150, 151, 'DMAAAA', 'TGMAAA', 'VVVVxx'),
+(3950, 8288, 0, 2, 0, 10, 50, 950, 1950, 3950, 3950, 100, 101, 'YVAAAA', 'UGMAAA', 'AAAAxx'),
+(2314, 8289, 0, 2, 4, 14, 14, 314, 314, 2314, 2314, 28, 29, 'ALAAAA', 'VGMAAA', 'HHHHxx'),
+(8432, 8290, 0, 0, 2, 12, 32, 432, 432, 3432, 8432, 64, 65, 'IMAAAA', 'WGMAAA', 'OOOOxx'),
+(62, 8291, 0, 2, 2, 2, 62, 62, 62, 62, 62, 124, 125, 'KCAAAA', 'XGMAAA', 'VVVVxx'),
+(6920, 8292, 0, 0, 0, 0, 20, 920, 920, 1920, 6920, 40, 41, 'EGAAAA', 'YGMAAA', 'AAAAxx'),
+(4077, 8293, 1, 1, 7, 17, 77, 77, 77, 4077, 4077, 154, 155, 'VAAAAA', 'ZGMAAA', 'HHHHxx'),
+(9118, 8294, 0, 2, 8, 18, 18, 118, 1118, 4118, 9118, 36, 37, 'SMAAAA', 'AHMAAA', 'OOOOxx'),
+(5375, 8295, 1, 3, 5, 15, 75, 375, 1375, 375, 5375, 150, 151, 'TYAAAA', 'BHMAAA', 'VVVVxx'),
+(178, 8296, 0, 2, 8, 18, 78, 178, 178, 178, 178, 156, 157, 'WGAAAA', 'CHMAAA', 'AAAAxx'),
+(1079, 8297, 1, 3, 9, 19, 79, 79, 1079, 1079, 1079, 158, 159, 'NPAAAA', 'DHMAAA', 'HHHHxx'),
+(4279, 8298, 1, 3, 9, 19, 79, 279, 279, 4279, 4279, 158, 159, 'PIAAAA', 'EHMAAA', 'OOOOxx'),
+(8436, 8299, 0, 0, 6, 16, 36, 436, 436, 3436, 8436, 72, 73, 'MMAAAA', 'FHMAAA', 'VVVVxx'),
+(1931, 8300, 1, 3, 1, 11, 31, 931, 1931, 1931, 1931, 62, 63, 'HWAAAA', 'GHMAAA', 'AAAAxx'),
+(2096, 8301, 0, 0, 6, 16, 96, 96, 96, 2096, 2096, 192, 193, 'QCAAAA', 'HHMAAA', 'HHHHxx'),
+(1638, 8302, 0, 2, 8, 18, 38, 638, 1638, 1638, 1638, 76, 77, 'ALAAAA', 'IHMAAA', 'OOOOxx'),
+(2788, 8303, 0, 0, 8, 8, 88, 788, 788, 2788, 2788, 176, 177, 'GDAAAA', 'JHMAAA', 'VVVVxx'),
+(4751, 8304, 1, 3, 1, 11, 51, 751, 751, 4751, 4751, 102, 103, 'TAAAAA', 'KHMAAA', 'AAAAxx'),
+(8824, 8305, 0, 0, 4, 4, 24, 824, 824, 3824, 8824, 48, 49, 'KBAAAA', 'LHMAAA', 'HHHHxx'),
+(3098, 8306, 0, 2, 8, 18, 98, 98, 1098, 3098, 3098, 196, 197, 'EPAAAA', 'MHMAAA', 'OOOOxx'),
+(4497, 8307, 1, 1, 7, 17, 97, 497, 497, 4497, 4497, 194, 195, 'ZQAAAA', 'NHMAAA', 'VVVVxx'),
+(5223, 8308, 1, 3, 3, 3, 23, 223, 1223, 223, 5223, 46, 47, 'XSAAAA', 'OHMAAA', 'AAAAxx'),
+(9212, 8309, 0, 0, 2, 12, 12, 212, 1212, 4212, 9212, 24, 25, 'IQAAAA', 'PHMAAA', 'HHHHxx'),
+(4265, 8310, 1, 1, 5, 5, 65, 265, 265, 4265, 4265, 130, 131, 'BIAAAA', 'QHMAAA', 'OOOOxx'),
+(6898, 8311, 0, 2, 8, 18, 98, 898, 898, 1898, 6898, 196, 197, 'IFAAAA', 'RHMAAA', 'VVVVxx'),
+(8808, 8312, 0, 0, 8, 8, 8, 808, 808, 3808, 8808, 16, 17, 'UAAAAA', 'SHMAAA', 'AAAAxx'),
+(5629, 8313, 1, 1, 9, 9, 29, 629, 1629, 629, 5629, 58, 59, 'NIAAAA', 'THMAAA', 'HHHHxx'),
+(3779, 8314, 1, 3, 9, 19, 79, 779, 1779, 3779, 3779, 158, 159, 'JPAAAA', 'UHMAAA', 'OOOOxx'),
+(4972, 8315, 0, 0, 2, 12, 72, 972, 972, 4972, 4972, 144, 145, 'GJAAAA', 'VHMAAA', 'VVVVxx'),
+(4511, 8316, 1, 3, 1, 11, 11, 511, 511, 4511, 4511, 22, 23, 'NRAAAA', 'WHMAAA', 'AAAAxx'),
+(6761, 8317, 1, 1, 1, 1, 61, 761, 761, 1761, 6761, 122, 123, 'BAAAAA', 'XHMAAA', 'HHHHxx'),
+(2335, 8318, 1, 3, 5, 15, 35, 335, 335, 2335, 2335, 70, 71, 'VLAAAA', 'YHMAAA', 'OOOOxx'),
+(732, 8319, 0, 0, 2, 12, 32, 732, 732, 732, 732, 64, 65, 'ECAAAA', 'ZHMAAA', 'VVVVxx'),
+(4757, 8320, 1, 1, 7, 17, 57, 757, 757, 4757, 4757, 114, 115, 'ZAAAAA', 'AIMAAA', 'AAAAxx'),
+(6624, 8321, 0, 0, 4, 4, 24, 624, 624, 1624, 6624, 48, 49, 'UUAAAA', 'BIMAAA', 'HHHHxx'),
+(5869, 8322, 1, 1, 9, 9, 69, 869, 1869, 869, 5869, 138, 139, 'TRAAAA', 'CIMAAA', 'OOOOxx'),
+(5842, 8323, 0, 2, 2, 2, 42, 842, 1842, 842, 5842, 84, 85, 'SQAAAA', 'DIMAAA', 'VVVVxx'),
+(5735, 8324, 1, 3, 5, 15, 35, 735, 1735, 735, 5735, 70, 71, 'PMAAAA', 'EIMAAA', 'AAAAxx'),
+(8276, 8325, 0, 0, 6, 16, 76, 276, 276, 3276, 8276, 152, 153, 'IGAAAA', 'FIMAAA', 'HHHHxx'),
+(7227, 8326, 1, 3, 7, 7, 27, 227, 1227, 2227, 7227, 54, 55, 'ZRAAAA', 'GIMAAA', 'OOOOxx'),
+(4923, 8327, 1, 3, 3, 3, 23, 923, 923, 4923, 4923, 46, 47, 'JHAAAA', 'HIMAAA', 'VVVVxx'),
+(9135, 8328, 1, 3, 5, 15, 35, 135, 1135, 4135, 9135, 70, 71, 'JNAAAA', 'IIMAAA', 'AAAAxx'),
+(5813, 8329, 1, 1, 3, 13, 13, 813, 1813, 813, 5813, 26, 27, 'PPAAAA', 'JIMAAA', 'HHHHxx'),
+(9697, 8330, 1, 1, 7, 17, 97, 697, 1697, 4697, 9697, 194, 195, 'ZIAAAA', 'KIMAAA', 'OOOOxx'),
+(3222, 8331, 0, 2, 2, 2, 22, 222, 1222, 3222, 3222, 44, 45, 'YTAAAA', 'LIMAAA', 'VVVVxx'),
+(2394, 8332, 0, 2, 4, 14, 94, 394, 394, 2394, 2394, 188, 189, 'COAAAA', 'MIMAAA', 'AAAAxx'),
+(5784, 8333, 0, 0, 4, 4, 84, 784, 1784, 784, 5784, 168, 169, 'MOAAAA', 'NIMAAA', 'HHHHxx'),
+(3652, 8334, 0, 0, 2, 12, 52, 652, 1652, 3652, 3652, 104, 105, 'MKAAAA', 'OIMAAA', 'OOOOxx'),
+(8175, 8335, 1, 3, 5, 15, 75, 175, 175, 3175, 8175, 150, 151, 'LCAAAA', 'PIMAAA', 'VVVVxx'),
+(7568, 8336, 0, 0, 8, 8, 68, 568, 1568, 2568, 7568, 136, 137, 'CFAAAA', 'QIMAAA', 'AAAAxx'),
+(6645, 8337, 1, 1, 5, 5, 45, 645, 645, 1645, 6645, 90, 91, 'PVAAAA', 'RIMAAA', 'HHHHxx'),
+(8176, 8338, 0, 0, 6, 16, 76, 176, 176, 3176, 8176, 152, 153, 'MCAAAA', 'SIMAAA', 'OOOOxx'),
+(530, 8339, 0, 2, 0, 10, 30, 530, 530, 530, 530, 60, 61, 'KUAAAA', 'TIMAAA', 'VVVVxx'),
+(5439, 8340, 1, 3, 9, 19, 39, 439, 1439, 439, 5439, 78, 79, 'FBAAAA', 'UIMAAA', 'AAAAxx'),
+(61, 8341, 1, 1, 1, 1, 61, 61, 61, 61, 61, 122, 123, 'JCAAAA', 'VIMAAA', 'HHHHxx'),
+(3951, 8342, 1, 3, 1, 11, 51, 951, 1951, 3951, 3951, 102, 103, 'ZVAAAA', 'WIMAAA', 'OOOOxx'),
+(5283, 8343, 1, 3, 3, 3, 83, 283, 1283, 283, 5283, 166, 167, 'FVAAAA', 'XIMAAA', 'VVVVxx'),
+(7226, 8344, 0, 2, 6, 6, 26, 226, 1226, 2226, 7226, 52, 53, 'YRAAAA', 'YIMAAA', 'AAAAxx'),
+(1954, 8345, 0, 2, 4, 14, 54, 954, 1954, 1954, 1954, 108, 109, 'EXAAAA', 'ZIMAAA', 'HHHHxx'),
+(334, 8346, 0, 2, 4, 14, 34, 334, 334, 334, 334, 68, 69, 'WMAAAA', 'AJMAAA', 'OOOOxx'),
+(3921, 8347, 1, 1, 1, 1, 21, 921, 1921, 3921, 3921, 42, 43, 'VUAAAA', 'BJMAAA', 'VVVVxx'),
+(6276, 8348, 0, 0, 6, 16, 76, 276, 276, 1276, 6276, 152, 153, 'KHAAAA', 'CJMAAA', 'AAAAxx'),
+(3378, 8349, 0, 2, 8, 18, 78, 378, 1378, 3378, 3378, 156, 157, 'YZAAAA', 'DJMAAA', 'HHHHxx'),
+(5236, 8350, 0, 0, 6, 16, 36, 236, 1236, 236, 5236, 72, 73, 'KTAAAA', 'EJMAAA', 'OOOOxx'),
+(7781, 8351, 1, 1, 1, 1, 81, 781, 1781, 2781, 7781, 162, 163, 'HNAAAA', 'FJMAAA', 'VVVVxx'),
+(8601, 8352, 1, 1, 1, 1, 1, 601, 601, 3601, 8601, 2, 3, 'VSAAAA', 'GJMAAA', 'AAAAxx'),
+(1473, 8353, 1, 1, 3, 13, 73, 473, 1473, 1473, 1473, 146, 147, 'REAAAA', 'HJMAAA', 'HHHHxx'),
+(3246, 8354, 0, 2, 6, 6, 46, 246, 1246, 3246, 3246, 92, 93, 'WUAAAA', 'IJMAAA', 'OOOOxx'),
+(3601, 8355, 1, 1, 1, 1, 1, 601, 1601, 3601, 3601, 2, 3, 'NIAAAA', 'JJMAAA', 'VVVVxx'),
+(6861, 8356, 1, 1, 1, 1, 61, 861, 861, 1861, 6861, 122, 123, 'XDAAAA', 'KJMAAA', 'AAAAxx'),
+(9032, 8357, 0, 0, 2, 12, 32, 32, 1032, 4032, 9032, 64, 65, 'KJAAAA', 'LJMAAA', 'HHHHxx'),
+(216, 8358, 0, 0, 6, 16, 16, 216, 216, 216, 216, 32, 33, 'IIAAAA', 'MJMAAA', 'OOOOxx'),
+(3824, 8359, 0, 0, 4, 4, 24, 824, 1824, 3824, 3824, 48, 49, 'CRAAAA', 'NJMAAA', 'VVVVxx'),
+(8486, 8360, 0, 2, 6, 6, 86, 486, 486, 3486, 8486, 172, 173, 'KOAAAA', 'OJMAAA', 'AAAAxx'),
+(276, 8361, 0, 0, 6, 16, 76, 276, 276, 276, 276, 152, 153, 'QKAAAA', 'PJMAAA', 'HHHHxx'),
+(1838, 8362, 0, 2, 8, 18, 38, 838, 1838, 1838, 1838, 76, 77, 'SSAAAA', 'QJMAAA', 'OOOOxx'),
+(6175, 8363, 1, 3, 5, 15, 75, 175, 175, 1175, 6175, 150, 151, 'NDAAAA', 'RJMAAA', 'VVVVxx'),
+(3719, 8364, 1, 3, 9, 19, 19, 719, 1719, 3719, 3719, 38, 39, 'BNAAAA', 'SJMAAA', 'AAAAxx'),
+(6958, 8365, 0, 2, 8, 18, 58, 958, 958, 1958, 6958, 116, 117, 'QHAAAA', 'TJMAAA', 'HHHHxx'),
+(6822, 8366, 0, 2, 2, 2, 22, 822, 822, 1822, 6822, 44, 45, 'KCAAAA', 'UJMAAA', 'OOOOxx'),
+(3318, 8367, 0, 2, 8, 18, 18, 318, 1318, 3318, 3318, 36, 37, 'QXAAAA', 'VJMAAA', 'VVVVxx'),
+(7222, 8368, 0, 2, 2, 2, 22, 222, 1222, 2222, 7222, 44, 45, 'URAAAA', 'WJMAAA', 'AAAAxx'),
+(85, 8369, 1, 1, 5, 5, 85, 85, 85, 85, 85, 170, 171, 'HDAAAA', 'XJMAAA', 'HHHHxx'),
+(5158, 8370, 0, 2, 8, 18, 58, 158, 1158, 158, 5158, 116, 117, 'KQAAAA', 'YJMAAA', 'OOOOxx'),
+(6360, 8371, 0, 0, 0, 0, 60, 360, 360, 1360, 6360, 120, 121, 'QKAAAA', 'ZJMAAA', 'VVVVxx'),
+(2599, 8372, 1, 3, 9, 19, 99, 599, 599, 2599, 2599, 198, 199, 'ZVAAAA', 'AKMAAA', 'AAAAxx'),
+(4002, 8373, 0, 2, 2, 2, 2, 2, 2, 4002, 4002, 4, 5, 'YXAAAA', 'BKMAAA', 'HHHHxx'),
+(6597, 8374, 1, 1, 7, 17, 97, 597, 597, 1597, 6597, 194, 195, 'TTAAAA', 'CKMAAA', 'OOOOxx'),
+(5762, 8375, 0, 2, 2, 2, 62, 762, 1762, 762, 5762, 124, 125, 'QNAAAA', 'DKMAAA', 'VVVVxx'),
+(8383, 8376, 1, 3, 3, 3, 83, 383, 383, 3383, 8383, 166, 167, 'LKAAAA', 'EKMAAA', 'AAAAxx'),
+(4686, 8377, 0, 2, 6, 6, 86, 686, 686, 4686, 4686, 172, 173, 'GYAAAA', 'FKMAAA', 'HHHHxx'),
+(5972, 8378, 0, 0, 2, 12, 72, 972, 1972, 972, 5972, 144, 145, 'SVAAAA', 'GKMAAA', 'OOOOxx'),
+(1432, 8379, 0, 0, 2, 12, 32, 432, 1432, 1432, 1432, 64, 65, 'CDAAAA', 'HKMAAA', 'VVVVxx'),
+(1601, 8380, 1, 1, 1, 1, 1, 601, 1601, 1601, 1601, 2, 3, 'PJAAAA', 'IKMAAA', 'AAAAxx'),
+(3012, 8381, 0, 0, 2, 12, 12, 12, 1012, 3012, 3012, 24, 25, 'WLAAAA', 'JKMAAA', 'HHHHxx'),
+(9345, 8382, 1, 1, 5, 5, 45, 345, 1345, 4345, 9345, 90, 91, 'LVAAAA', 'KKMAAA', 'OOOOxx'),
+(8869, 8383, 1, 1, 9, 9, 69, 869, 869, 3869, 8869, 138, 139, 'DDAAAA', 'LKMAAA', 'VVVVxx'),
+(6612, 8384, 0, 0, 2, 12, 12, 612, 612, 1612, 6612, 24, 25, 'IUAAAA', 'MKMAAA', 'AAAAxx'),
+(262, 8385, 0, 2, 2, 2, 62, 262, 262, 262, 262, 124, 125, 'CKAAAA', 'NKMAAA', 'HHHHxx'),
+(300, 8386, 0, 0, 0, 0, 0, 300, 300, 300, 300, 0, 1, 'OLAAAA', 'OKMAAA', 'OOOOxx'),
+(3045, 8387, 1, 1, 5, 5, 45, 45, 1045, 3045, 3045, 90, 91, 'DNAAAA', 'PKMAAA', 'VVVVxx'),
+(7252, 8388, 0, 0, 2, 12, 52, 252, 1252, 2252, 7252, 104, 105, 'YSAAAA', 'QKMAAA', 'AAAAxx'),
+(9099, 8389, 1, 3, 9, 19, 99, 99, 1099, 4099, 9099, 198, 199, 'ZLAAAA', 'RKMAAA', 'HHHHxx'),
+(9006, 8390, 0, 2, 6, 6, 6, 6, 1006, 4006, 9006, 12, 13, 'KIAAAA', 'SKMAAA', 'OOOOxx'),
+(3078, 8391, 0, 2, 8, 18, 78, 78, 1078, 3078, 3078, 156, 157, 'KOAAAA', 'TKMAAA', 'VVVVxx'),
+(5159, 8392, 1, 3, 9, 19, 59, 159, 1159, 159, 5159, 118, 119, 'LQAAAA', 'UKMAAA', 'AAAAxx'),
+(9329, 8393, 1, 1, 9, 9, 29, 329, 1329, 4329, 9329, 58, 59, 'VUAAAA', 'VKMAAA', 'HHHHxx'),
+(1393, 8394, 1, 1, 3, 13, 93, 393, 1393, 1393, 1393, 186, 187, 'PBAAAA', 'WKMAAA', 'OOOOxx'),
+(5894, 8395, 0, 2, 4, 14, 94, 894, 1894, 894, 5894, 188, 189, 'SSAAAA', 'XKMAAA', 'VVVVxx'),
+(11, 8396, 1, 3, 1, 11, 11, 11, 11, 11, 11, 22, 23, 'LAAAAA', 'YKMAAA', 'AAAAxx'),
+(5606, 8397, 0, 2, 6, 6, 6, 606, 1606, 606, 5606, 12, 13, 'QHAAAA', 'ZKMAAA', 'HHHHxx'),
+(5541, 8398, 1, 1, 1, 1, 41, 541, 1541, 541, 5541, 82, 83, 'DFAAAA', 'ALMAAA', 'OOOOxx'),
+(2689, 8399, 1, 1, 9, 9, 89, 689, 689, 2689, 2689, 178, 179, 'LZAAAA', 'BLMAAA', 'VVVVxx'),
+(1023, 8400, 1, 3, 3, 3, 23, 23, 1023, 1023, 1023, 46, 47, 'JNAAAA', 'CLMAAA', 'AAAAxx'),
+(8134, 8401, 0, 2, 4, 14, 34, 134, 134, 3134, 8134, 68, 69, 'WAAAAA', 'DLMAAA', 'HHHHxx'),
+(5923, 8402, 1, 3, 3, 3, 23, 923, 1923, 923, 5923, 46, 47, 'VTAAAA', 'ELMAAA', 'OOOOxx'),
+(6056, 8403, 0, 0, 6, 16, 56, 56, 56, 1056, 6056, 112, 113, 'YYAAAA', 'FLMAAA', 'VVVVxx'),
+(653, 8404, 1, 1, 3, 13, 53, 653, 653, 653, 653, 106, 107, 'DZAAAA', 'GLMAAA', 'AAAAxx'),
+(367, 8405, 1, 3, 7, 7, 67, 367, 367, 367, 367, 134, 135, 'DOAAAA', 'HLMAAA', 'HHHHxx'),
+(1828, 8406, 0, 0, 8, 8, 28, 828, 1828, 1828, 1828, 56, 57, 'ISAAAA', 'ILMAAA', 'OOOOxx'),
+(6506, 8407, 0, 2, 6, 6, 6, 506, 506, 1506, 6506, 12, 13, 'GQAAAA', 'JLMAAA', 'VVVVxx'),
+(5772, 8408, 0, 0, 2, 12, 72, 772, 1772, 772, 5772, 144, 145, 'AOAAAA', 'KLMAAA', 'AAAAxx'),
+(8052, 8409, 0, 0, 2, 12, 52, 52, 52, 3052, 8052, 104, 105, 'SXAAAA', 'LLMAAA', 'HHHHxx'),
+(2633, 8410, 1, 1, 3, 13, 33, 633, 633, 2633, 2633, 66, 67, 'HXAAAA', 'MLMAAA', 'OOOOxx'),
+(4878, 8411, 0, 2, 8, 18, 78, 878, 878, 4878, 4878, 156, 157, 'QFAAAA', 'NLMAAA', 'VVVVxx'),
+(5621, 8412, 1, 1, 1, 1, 21, 621, 1621, 621, 5621, 42, 43, 'FIAAAA', 'OLMAAA', 'AAAAxx'),
+(41, 8413, 1, 1, 1, 1, 41, 41, 41, 41, 41, 82, 83, 'PBAAAA', 'PLMAAA', 'HHHHxx'),
+(4613, 8414, 1, 1, 3, 13, 13, 613, 613, 4613, 4613, 26, 27, 'LVAAAA', 'QLMAAA', 'OOOOxx'),
+(9389, 8415, 1, 1, 9, 9, 89, 389, 1389, 4389, 9389, 178, 179, 'DXAAAA', 'RLMAAA', 'VVVVxx'),
+(9414, 8416, 0, 2, 4, 14, 14, 414, 1414, 4414, 9414, 28, 29, 'CYAAAA', 'SLMAAA', 'AAAAxx'),
+(3583, 8417, 1, 3, 3, 3, 83, 583, 1583, 3583, 3583, 166, 167, 'VHAAAA', 'TLMAAA', 'HHHHxx'),
+(3454, 8418, 0, 2, 4, 14, 54, 454, 1454, 3454, 3454, 108, 109, 'WCAAAA', 'ULMAAA', 'OOOOxx'),
+(719, 8419, 1, 3, 9, 19, 19, 719, 719, 719, 719, 38, 39, 'RBAAAA', 'VLMAAA', 'VVVVxx'),
+(6188, 8420, 0, 0, 8, 8, 88, 188, 188, 1188, 6188, 176, 177, 'AEAAAA', 'WLMAAA', 'AAAAxx'),
+(2288, 8421, 0, 0, 8, 8, 88, 288, 288, 2288, 2288, 176, 177, 'AKAAAA', 'XLMAAA', 'HHHHxx'),
+(1287, 8422, 1, 3, 7, 7, 87, 287, 1287, 1287, 1287, 174, 175, 'NXAAAA', 'YLMAAA', 'OOOOxx'),
+(1397, 8423, 1, 1, 7, 17, 97, 397, 1397, 1397, 1397, 194, 195, 'TBAAAA', 'ZLMAAA', 'VVVVxx'),
+(7763, 8424, 1, 3, 3, 3, 63, 763, 1763, 2763, 7763, 126, 127, 'PMAAAA', 'AMMAAA', 'AAAAxx'),
+(5194, 8425, 0, 2, 4, 14, 94, 194, 1194, 194, 5194, 188, 189, 'URAAAA', 'BMMAAA', 'HHHHxx'),
+(3167, 8426, 1, 3, 7, 7, 67, 167, 1167, 3167, 3167, 134, 135, 'VRAAAA', 'CMMAAA', 'OOOOxx'),
+(9218, 8427, 0, 2, 8, 18, 18, 218, 1218, 4218, 9218, 36, 37, 'OQAAAA', 'DMMAAA', 'VVVVxx'),
+(2065, 8428, 1, 1, 5, 5, 65, 65, 65, 2065, 2065, 130, 131, 'LBAAAA', 'EMMAAA', 'AAAAxx'),
+(9669, 8429, 1, 1, 9, 9, 69, 669, 1669, 4669, 9669, 138, 139, 'XHAAAA', 'FMMAAA', 'HHHHxx'),
+(146, 8430, 0, 2, 6, 6, 46, 146, 146, 146, 146, 92, 93, 'QFAAAA', 'GMMAAA', 'OOOOxx'),
+(6141, 8431, 1, 1, 1, 1, 41, 141, 141, 1141, 6141, 82, 83, 'FCAAAA', 'HMMAAA', 'VVVVxx'),
+(2843, 8432, 1, 3, 3, 3, 43, 843, 843, 2843, 2843, 86, 87, 'JFAAAA', 'IMMAAA', 'AAAAxx'),
+(7934, 8433, 0, 2, 4, 14, 34, 934, 1934, 2934, 7934, 68, 69, 'ETAAAA', 'JMMAAA', 'HHHHxx'),
+(2536, 8434, 0, 0, 6, 16, 36, 536, 536, 2536, 2536, 72, 73, 'OTAAAA', 'KMMAAA', 'OOOOxx'),
+(7088, 8435, 0, 0, 8, 8, 88, 88, 1088, 2088, 7088, 176, 177, 'QMAAAA', 'LMMAAA', 'VVVVxx'),
+(2519, 8436, 1, 3, 9, 19, 19, 519, 519, 2519, 2519, 38, 39, 'XSAAAA', 'MMMAAA', 'AAAAxx'),
+(6650, 8437, 0, 2, 0, 10, 50, 650, 650, 1650, 6650, 100, 101, 'UVAAAA', 'NMMAAA', 'HHHHxx'),
+(3007, 8438, 1, 3, 7, 7, 7, 7, 1007, 3007, 3007, 14, 15, 'RLAAAA', 'OMMAAA', 'OOOOxx'),
+(4507, 8439, 1, 3, 7, 7, 7, 507, 507, 4507, 4507, 14, 15, 'JRAAAA', 'PMMAAA', 'VVVVxx'),
+(4892, 8440, 0, 0, 2, 12, 92, 892, 892, 4892, 4892, 184, 185, 'EGAAAA', 'QMMAAA', 'AAAAxx'),
+(7159, 8441, 1, 3, 9, 19, 59, 159, 1159, 2159, 7159, 118, 119, 'JPAAAA', 'RMMAAA', 'HHHHxx'),
+(3171, 8442, 1, 3, 1, 11, 71, 171, 1171, 3171, 3171, 142, 143, 'ZRAAAA', 'SMMAAA', 'OOOOxx'),
+(1080, 8443, 0, 0, 0, 0, 80, 80, 1080, 1080, 1080, 160, 161, 'OPAAAA', 'TMMAAA', 'VVVVxx'),
+(7248, 8444, 0, 0, 8, 8, 48, 248, 1248, 2248, 7248, 96, 97, 'USAAAA', 'UMMAAA', 'AAAAxx'),
+(7230, 8445, 0, 2, 0, 10, 30, 230, 1230, 2230, 7230, 60, 61, 'CSAAAA', 'VMMAAA', 'HHHHxx'),
+(3823, 8446, 1, 3, 3, 3, 23, 823, 1823, 3823, 3823, 46, 47, 'BRAAAA', 'WMMAAA', 'OOOOxx'),
+(5517, 8447, 1, 1, 7, 17, 17, 517, 1517, 517, 5517, 34, 35, 'FEAAAA', 'XMMAAA', 'VVVVxx'),
+(1482, 8448, 0, 2, 2, 2, 82, 482, 1482, 1482, 1482, 164, 165, 'AFAAAA', 'YMMAAA', 'AAAAxx'),
+(9953, 8449, 1, 1, 3, 13, 53, 953, 1953, 4953, 9953, 106, 107, 'VSAAAA', 'ZMMAAA', 'HHHHxx'),
+(2754, 8450, 0, 2, 4, 14, 54, 754, 754, 2754, 2754, 108, 109, 'YBAAAA', 'ANMAAA', 'OOOOxx'),
+(3875, 8451, 1, 3, 5, 15, 75, 875, 1875, 3875, 3875, 150, 151, 'BTAAAA', 'BNMAAA', 'VVVVxx'),
+(9800, 8452, 0, 0, 0, 0, 0, 800, 1800, 4800, 9800, 0, 1, 'YMAAAA', 'CNMAAA', 'AAAAxx'),
+(8819, 8453, 1, 3, 9, 19, 19, 819, 819, 3819, 8819, 38, 39, 'FBAAAA', 'DNMAAA', 'HHHHxx'),
+(8267, 8454, 1, 3, 7, 7, 67, 267, 267, 3267, 8267, 134, 135, 'ZFAAAA', 'ENMAAA', 'OOOOxx'),
+(520, 8455, 0, 0, 0, 0, 20, 520, 520, 520, 520, 40, 41, 'AUAAAA', 'FNMAAA', 'VVVVxx'),
+(5770, 8456, 0, 2, 0, 10, 70, 770, 1770, 770, 5770, 140, 141, 'YNAAAA', 'GNMAAA', 'AAAAxx'),
+(2114, 8457, 0, 2, 4, 14, 14, 114, 114, 2114, 2114, 28, 29, 'IDAAAA', 'HNMAAA', 'HHHHxx'),
+(5045, 8458, 1, 1, 5, 5, 45, 45, 1045, 45, 5045, 90, 91, 'BMAAAA', 'INMAAA', 'OOOOxx'),
+(1094, 8459, 0, 2, 4, 14, 94, 94, 1094, 1094, 1094, 188, 189, 'CQAAAA', 'JNMAAA', 'VVVVxx'),
+(8786, 8460, 0, 2, 6, 6, 86, 786, 786, 3786, 8786, 172, 173, 'YZAAAA', 'KNMAAA', 'AAAAxx'),
+(353, 8461, 1, 1, 3, 13, 53, 353, 353, 353, 353, 106, 107, 'PNAAAA', 'LNMAAA', 'HHHHxx'),
+(290, 8462, 0, 2, 0, 10, 90, 290, 290, 290, 290, 180, 181, 'ELAAAA', 'MNMAAA', 'OOOOxx'),
+(3376, 8463, 0, 0, 6, 16, 76, 376, 1376, 3376, 3376, 152, 153, 'WZAAAA', 'NNMAAA', 'VVVVxx'),
+(9305, 8464, 1, 1, 5, 5, 5, 305, 1305, 4305, 9305, 10, 11, 'XTAAAA', 'ONMAAA', 'AAAAxx'),
+(186, 8465, 0, 2, 6, 6, 86, 186, 186, 186, 186, 172, 173, 'EHAAAA', 'PNMAAA', 'HHHHxx'),
+(4817, 8466, 1, 1, 7, 17, 17, 817, 817, 4817, 4817, 34, 35, 'HDAAAA', 'QNMAAA', 'OOOOxx'),
+(4638, 8467, 0, 2, 8, 18, 38, 638, 638, 4638, 4638, 76, 77, 'KWAAAA', 'RNMAAA', 'VVVVxx'),
+(3558, 8468, 0, 2, 8, 18, 58, 558, 1558, 3558, 3558, 116, 117, 'WGAAAA', 'SNMAAA', 'AAAAxx'),
+(9285, 8469, 1, 1, 5, 5, 85, 285, 1285, 4285, 9285, 170, 171, 'DTAAAA', 'TNMAAA', 'HHHHxx'),
+(848, 8470, 0, 0, 8, 8, 48, 848, 848, 848, 848, 96, 97, 'QGAAAA', 'UNMAAA', 'OOOOxx'),
+(8923, 8471, 1, 3, 3, 3, 23, 923, 923, 3923, 8923, 46, 47, 'FFAAAA', 'VNMAAA', 'VVVVxx'),
+(6826, 8472, 0, 2, 6, 6, 26, 826, 826, 1826, 6826, 52, 53, 'OCAAAA', 'WNMAAA', 'AAAAxx'),
+(5187, 8473, 1, 3, 7, 7, 87, 187, 1187, 187, 5187, 174, 175, 'NRAAAA', 'XNMAAA', 'HHHHxx'),
+(2398, 8474, 0, 2, 8, 18, 98, 398, 398, 2398, 2398, 196, 197, 'GOAAAA', 'YNMAAA', 'OOOOxx'),
+(7653, 8475, 1, 1, 3, 13, 53, 653, 1653, 2653, 7653, 106, 107, 'JIAAAA', 'ZNMAAA', 'VVVVxx'),
+(8835, 8476, 1, 3, 5, 15, 35, 835, 835, 3835, 8835, 70, 71, 'VBAAAA', 'AOMAAA', 'AAAAxx'),
+(5736, 8477, 0, 0, 6, 16, 36, 736, 1736, 736, 5736, 72, 73, 'QMAAAA', 'BOMAAA', 'HHHHxx'),
+(1238, 8478, 0, 2, 8, 18, 38, 238, 1238, 1238, 1238, 76, 77, 'QVAAAA', 'COMAAA', 'OOOOxx'),
+(6021, 8479, 1, 1, 1, 1, 21, 21, 21, 1021, 6021, 42, 43, 'PXAAAA', 'DOMAAA', 'VVVVxx'),
+(6815, 8480, 1, 3, 5, 15, 15, 815, 815, 1815, 6815, 30, 31, 'DCAAAA', 'EOMAAA', 'AAAAxx'),
+(2549, 8481, 1, 1, 9, 9, 49, 549, 549, 2549, 2549, 98, 99, 'BUAAAA', 'FOMAAA', 'HHHHxx'),
+(5657, 8482, 1, 1, 7, 17, 57, 657, 1657, 657, 5657, 114, 115, 'PJAAAA', 'GOMAAA', 'OOOOxx'),
+(6855, 8483, 1, 3, 5, 15, 55, 855, 855, 1855, 6855, 110, 111, 'RDAAAA', 'HOMAAA', 'VVVVxx'),
+(1225, 8484, 1, 1, 5, 5, 25, 225, 1225, 1225, 1225, 50, 51, 'DVAAAA', 'IOMAAA', 'AAAAxx'),
+(7452, 8485, 0, 0, 2, 12, 52, 452, 1452, 2452, 7452, 104, 105, 'QAAAAA', 'JOMAAA', 'HHHHxx'),
+(2479, 8486, 1, 3, 9, 19, 79, 479, 479, 2479, 2479, 158, 159, 'JRAAAA', 'KOMAAA', 'OOOOxx'),
+(7974, 8487, 0, 2, 4, 14, 74, 974, 1974, 2974, 7974, 148, 149, 'SUAAAA', 'LOMAAA', 'VVVVxx'),
+(1212, 8488, 0, 0, 2, 12, 12, 212, 1212, 1212, 1212, 24, 25, 'QUAAAA', 'MOMAAA', 'AAAAxx'),
+(8883, 8489, 1, 3, 3, 3, 83, 883, 883, 3883, 8883, 166, 167, 'RDAAAA', 'NOMAAA', 'HHHHxx'),
+(8150, 8490, 0, 2, 0, 10, 50, 150, 150, 3150, 8150, 100, 101, 'MBAAAA', 'OOMAAA', 'OOOOxx'),
+(3392, 8491, 0, 0, 2, 12, 92, 392, 1392, 3392, 3392, 184, 185, 'MAAAAA', 'POMAAA', 'VVVVxx'),
+(6774, 8492, 0, 2, 4, 14, 74, 774, 774, 1774, 6774, 148, 149, 'OAAAAA', 'QOMAAA', 'AAAAxx'),
+(904, 8493, 0, 0, 4, 4, 4, 904, 904, 904, 904, 8, 9, 'UIAAAA', 'ROMAAA', 'HHHHxx'),
+(5068, 8494, 0, 0, 8, 8, 68, 68, 1068, 68, 5068, 136, 137, 'YMAAAA', 'SOMAAA', 'OOOOxx'),
+(9339, 8495, 1, 3, 9, 19, 39, 339, 1339, 4339, 9339, 78, 79, 'FVAAAA', 'TOMAAA', 'VVVVxx'),
+(1062, 8496, 0, 2, 2, 2, 62, 62, 1062, 1062, 1062, 124, 125, 'WOAAAA', 'UOMAAA', 'AAAAxx'),
+(3841, 8497, 1, 1, 1, 1, 41, 841, 1841, 3841, 3841, 82, 83, 'TRAAAA', 'VOMAAA', 'HHHHxx'),
+(8924, 8498, 0, 0, 4, 4, 24, 924, 924, 3924, 8924, 48, 49, 'GFAAAA', 'WOMAAA', 'OOOOxx'),
+(9795, 8499, 1, 3, 5, 15, 95, 795, 1795, 4795, 9795, 190, 191, 'TMAAAA', 'XOMAAA', 'VVVVxx'),
+(3981, 8500, 1, 1, 1, 1, 81, 981, 1981, 3981, 3981, 162, 163, 'DXAAAA', 'YOMAAA', 'AAAAxx'),
+(4290, 8501, 0, 2, 0, 10, 90, 290, 290, 4290, 4290, 180, 181, 'AJAAAA', 'ZOMAAA', 'HHHHxx'),
+(1067, 8502, 1, 3, 7, 7, 67, 67, 1067, 1067, 1067, 134, 135, 'BPAAAA', 'APMAAA', 'OOOOxx'),
+(8679, 8503, 1, 3, 9, 19, 79, 679, 679, 3679, 8679, 158, 159, 'VVAAAA', 'BPMAAA', 'VVVVxx'),
+(2894, 8504, 0, 2, 4, 14, 94, 894, 894, 2894, 2894, 188, 189, 'IHAAAA', 'CPMAAA', 'AAAAxx'),
+(9248, 8505, 0, 0, 8, 8, 48, 248, 1248, 4248, 9248, 96, 97, 'SRAAAA', 'DPMAAA', 'HHHHxx'),
+(1072, 8506, 0, 0, 2, 12, 72, 72, 1072, 1072, 1072, 144, 145, 'GPAAAA', 'EPMAAA', 'OOOOxx'),
+(3510, 8507, 0, 2, 0, 10, 10, 510, 1510, 3510, 3510, 20, 21, 'AFAAAA', 'FPMAAA', 'VVVVxx'),
+(6871, 8508, 1, 3, 1, 11, 71, 871, 871, 1871, 6871, 142, 143, 'HEAAAA', 'GPMAAA', 'AAAAxx'),
+(8701, 8509, 1, 1, 1, 1, 1, 701, 701, 3701, 8701, 2, 3, 'RWAAAA', 'HPMAAA', 'HHHHxx'),
+(8170, 8510, 0, 2, 0, 10, 70, 170, 170, 3170, 8170, 140, 141, 'GCAAAA', 'IPMAAA', 'OOOOxx'),
+(2730, 8511, 0, 2, 0, 10, 30, 730, 730, 2730, 2730, 60, 61, 'ABAAAA', 'JPMAAA', 'VVVVxx'),
+(2668, 8512, 0, 0, 8, 8, 68, 668, 668, 2668, 2668, 136, 137, 'QYAAAA', 'KPMAAA', 'AAAAxx'),
+(8723, 8513, 1, 3, 3, 3, 23, 723, 723, 3723, 8723, 46, 47, 'NXAAAA', 'LPMAAA', 'HHHHxx'),
+(3439, 8514, 1, 3, 9, 19, 39, 439, 1439, 3439, 3439, 78, 79, 'HCAAAA', 'MPMAAA', 'OOOOxx'),
+(6219, 8515, 1, 3, 9, 19, 19, 219, 219, 1219, 6219, 38, 39, 'FFAAAA', 'NPMAAA', 'VVVVxx'),
+(4264, 8516, 0, 0, 4, 4, 64, 264, 264, 4264, 4264, 128, 129, 'AIAAAA', 'OPMAAA', 'AAAAxx'),
+(3929, 8517, 1, 1, 9, 9, 29, 929, 1929, 3929, 3929, 58, 59, 'DVAAAA', 'PPMAAA', 'HHHHxx'),
+(7, 8518, 1, 3, 7, 7, 7, 7, 7, 7, 7, 14, 15, 'HAAAAA', 'QPMAAA', 'OOOOxx'),
+(3737, 8519, 1, 1, 7, 17, 37, 737, 1737, 3737, 3737, 74, 75, 'TNAAAA', 'RPMAAA', 'VVVVxx'),
+(358, 8520, 0, 2, 8, 18, 58, 358, 358, 358, 358, 116, 117, 'UNAAAA', 'SPMAAA', 'AAAAxx'),
+(5128, 8521, 0, 0, 8, 8, 28, 128, 1128, 128, 5128, 56, 57, 'GPAAAA', 'TPMAAA', 'HHHHxx'),
+(7353, 8522, 1, 1, 3, 13, 53, 353, 1353, 2353, 7353, 106, 107, 'VWAAAA', 'UPMAAA', 'OOOOxx'),
+(8758, 8523, 0, 2, 8, 18, 58, 758, 758, 3758, 8758, 116, 117, 'WYAAAA', 'VPMAAA', 'VVVVxx'),
+(7284, 8524, 0, 0, 4, 4, 84, 284, 1284, 2284, 7284, 168, 169, 'EUAAAA', 'WPMAAA', 'AAAAxx'),
+(4037, 8525, 1, 1, 7, 17, 37, 37, 37, 4037, 4037, 74, 75, 'HZAAAA', 'XPMAAA', 'HHHHxx'),
+(435, 8526, 1, 3, 5, 15, 35, 435, 435, 435, 435, 70, 71, 'TQAAAA', 'YPMAAA', 'OOOOxx'),
+(3580, 8527, 0, 0, 0, 0, 80, 580, 1580, 3580, 3580, 160, 161, 'SHAAAA', 'ZPMAAA', 'VVVVxx'),
+(4554, 8528, 0, 2, 4, 14, 54, 554, 554, 4554, 4554, 108, 109, 'ETAAAA', 'AQMAAA', 'AAAAxx'),
+(4337, 8529, 1, 1, 7, 17, 37, 337, 337, 4337, 4337, 74, 75, 'VKAAAA', 'BQMAAA', 'HHHHxx'),
+(512, 8530, 0, 0, 2, 12, 12, 512, 512, 512, 512, 24, 25, 'STAAAA', 'CQMAAA', 'OOOOxx'),
+(2032, 8531, 0, 0, 2, 12, 32, 32, 32, 2032, 2032, 64, 65, 'EAAAAA', 'DQMAAA', 'VVVVxx'),
+(1755, 8532, 1, 3, 5, 15, 55, 755, 1755, 1755, 1755, 110, 111, 'NPAAAA', 'EQMAAA', 'AAAAxx'),
+(9923, 8533, 1, 3, 3, 3, 23, 923, 1923, 4923, 9923, 46, 47, 'RRAAAA', 'FQMAAA', 'HHHHxx'),
+(3747, 8534, 1, 3, 7, 7, 47, 747, 1747, 3747, 3747, 94, 95, 'DOAAAA', 'GQMAAA', 'OOOOxx'),
+(27, 8535, 1, 3, 7, 7, 27, 27, 27, 27, 27, 54, 55, 'BBAAAA', 'HQMAAA', 'VVVVxx'),
+(3075, 8536, 1, 3, 5, 15, 75, 75, 1075, 3075, 3075, 150, 151, 'HOAAAA', 'IQMAAA', 'AAAAxx'),
+(6259, 8537, 1, 3, 9, 19, 59, 259, 259, 1259, 6259, 118, 119, 'TGAAAA', 'JQMAAA', 'HHHHxx'),
+(2940, 8538, 0, 0, 0, 0, 40, 940, 940, 2940, 2940, 80, 81, 'CJAAAA', 'KQMAAA', 'OOOOxx'),
+(5724, 8539, 0, 0, 4, 4, 24, 724, 1724, 724, 5724, 48, 49, 'EMAAAA', 'LQMAAA', 'VVVVxx'),
+(5638, 8540, 0, 2, 8, 18, 38, 638, 1638, 638, 5638, 76, 77, 'WIAAAA', 'MQMAAA', 'AAAAxx'),
+(479, 8541, 1, 3, 9, 19, 79, 479, 479, 479, 479, 158, 159, 'LSAAAA', 'NQMAAA', 'HHHHxx'),
+(4125, 8542, 1, 1, 5, 5, 25, 125, 125, 4125, 4125, 50, 51, 'RCAAAA', 'OQMAAA', 'OOOOxx'),
+(1525, 8543, 1, 1, 5, 5, 25, 525, 1525, 1525, 1525, 50, 51, 'RGAAAA', 'PQMAAA', 'VVVVxx'),
+(7529, 8544, 1, 1, 9, 9, 29, 529, 1529, 2529, 7529, 58, 59, 'PDAAAA', 'QQMAAA', 'AAAAxx'),
+(931, 8545, 1, 3, 1, 11, 31, 931, 931, 931, 931, 62, 63, 'VJAAAA', 'RQMAAA', 'HHHHxx'),
+(5175, 8546, 1, 3, 5, 15, 75, 175, 1175, 175, 5175, 150, 151, 'BRAAAA', 'SQMAAA', 'OOOOxx'),
+(6798, 8547, 0, 2, 8, 18, 98, 798, 798, 1798, 6798, 196, 197, 'MBAAAA', 'TQMAAA', 'VVVVxx'),
+(2111, 8548, 1, 3, 1, 11, 11, 111, 111, 2111, 2111, 22, 23, 'FDAAAA', 'UQMAAA', 'AAAAxx'),
+(6145, 8549, 1, 1, 5, 5, 45, 145, 145, 1145, 6145, 90, 91, 'JCAAAA', 'VQMAAA', 'HHHHxx'),
+(4712, 8550, 0, 0, 2, 12, 12, 712, 712, 4712, 4712, 24, 25, 'GZAAAA', 'WQMAAA', 'OOOOxx'),
+(3110, 8551, 0, 2, 0, 10, 10, 110, 1110, 3110, 3110, 20, 21, 'QPAAAA', 'XQMAAA', 'VVVVxx'),
+(97, 8552, 1, 1, 7, 17, 97, 97, 97, 97, 97, 194, 195, 'TDAAAA', 'YQMAAA', 'AAAAxx'),
+(758, 8553, 0, 2, 8, 18, 58, 758, 758, 758, 758, 116, 117, 'EDAAAA', 'ZQMAAA', 'HHHHxx'),
+(1895, 8554, 1, 3, 5, 15, 95, 895, 1895, 1895, 1895, 190, 191, 'XUAAAA', 'ARMAAA', 'OOOOxx'),
+(5289, 8555, 1, 1, 9, 9, 89, 289, 1289, 289, 5289, 178, 179, 'LVAAAA', 'BRMAAA', 'VVVVxx'),
+(5026, 8556, 0, 2, 6, 6, 26, 26, 1026, 26, 5026, 52, 53, 'ILAAAA', 'CRMAAA', 'AAAAxx'),
+(4725, 8557, 1, 1, 5, 5, 25, 725, 725, 4725, 4725, 50, 51, 'TZAAAA', 'DRMAAA', 'HHHHxx'),
+(1679, 8558, 1, 3, 9, 19, 79, 679, 1679, 1679, 1679, 158, 159, 'PMAAAA', 'ERMAAA', 'OOOOxx'),
+(4433, 8559, 1, 1, 3, 13, 33, 433, 433, 4433, 4433, 66, 67, 'NOAAAA', 'FRMAAA', 'VVVVxx'),
+(5340, 8560, 0, 0, 0, 0, 40, 340, 1340, 340, 5340, 80, 81, 'KXAAAA', 'GRMAAA', 'AAAAxx'),
+(6340, 8561, 0, 0, 0, 0, 40, 340, 340, 1340, 6340, 80, 81, 'WJAAAA', 'HRMAAA', 'HHHHxx'),
+(3261, 8562, 1, 1, 1, 1, 61, 261, 1261, 3261, 3261, 122, 123, 'LVAAAA', 'IRMAAA', 'OOOOxx'),
+(8108, 8563, 0, 0, 8, 8, 8, 108, 108, 3108, 8108, 16, 17, 'WZAAAA', 'JRMAAA', 'VVVVxx'),
+(8785, 8564, 1, 1, 5, 5, 85, 785, 785, 3785, 8785, 170, 171, 'XZAAAA', 'KRMAAA', 'AAAAxx'),
+(7391, 8565, 1, 3, 1, 11, 91, 391, 1391, 2391, 7391, 182, 183, 'HYAAAA', 'LRMAAA', 'HHHHxx'),
+(1496, 8566, 0, 0, 6, 16, 96, 496, 1496, 1496, 1496, 192, 193, 'OFAAAA', 'MRMAAA', 'OOOOxx'),
+(1484, 8567, 0, 0, 4, 4, 84, 484, 1484, 1484, 1484, 168, 169, 'CFAAAA', 'NRMAAA', 'VVVVxx'),
+(5884, 8568, 0, 0, 4, 4, 84, 884, 1884, 884, 5884, 168, 169, 'ISAAAA', 'ORMAAA', 'AAAAxx'),
+(342, 8569, 0, 2, 2, 2, 42, 342, 342, 342, 342, 84, 85, 'ENAAAA', 'PRMAAA', 'HHHHxx'),
+(7659, 8570, 1, 3, 9, 19, 59, 659, 1659, 2659, 7659, 118, 119, 'PIAAAA', 'QRMAAA', 'OOOOxx'),
+(6635, 8571, 1, 3, 5, 15, 35, 635, 635, 1635, 6635, 70, 71, 'FVAAAA', 'RRMAAA', 'VVVVxx'),
+(8507, 8572, 1, 3, 7, 7, 7, 507, 507, 3507, 8507, 14, 15, 'FPAAAA', 'SRMAAA', 'AAAAxx'),
+(2583, 8573, 1, 3, 3, 3, 83, 583, 583, 2583, 2583, 166, 167, 'JVAAAA', 'TRMAAA', 'HHHHxx'),
+(6533, 8574, 1, 1, 3, 13, 33, 533, 533, 1533, 6533, 66, 67, 'HRAAAA', 'URMAAA', 'OOOOxx'),
+(5879, 8575, 1, 3, 9, 19, 79, 879, 1879, 879, 5879, 158, 159, 'DSAAAA', 'VRMAAA', 'VVVVxx'),
+(5511, 8576, 1, 3, 1, 11, 11, 511, 1511, 511, 5511, 22, 23, 'ZDAAAA', 'WRMAAA', 'AAAAxx'),
+(3682, 8577, 0, 2, 2, 2, 82, 682, 1682, 3682, 3682, 164, 165, 'QLAAAA', 'XRMAAA', 'HHHHxx'),
+(7182, 8578, 0, 2, 2, 2, 82, 182, 1182, 2182, 7182, 164, 165, 'GQAAAA', 'YRMAAA', 'OOOOxx'),
+(1409, 8579, 1, 1, 9, 9, 9, 409, 1409, 1409, 1409, 18, 19, 'FCAAAA', 'ZRMAAA', 'VVVVxx'),
+(3363, 8580, 1, 3, 3, 3, 63, 363, 1363, 3363, 3363, 126, 127, 'JZAAAA', 'ASMAAA', 'AAAAxx'),
+(729, 8581, 1, 1, 9, 9, 29, 729, 729, 729, 729, 58, 59, 'BCAAAA', 'BSMAAA', 'HHHHxx'),
+(5857, 8582, 1, 1, 7, 17, 57, 857, 1857, 857, 5857, 114, 115, 'HRAAAA', 'CSMAAA', 'OOOOxx'),
+(235, 8583, 1, 3, 5, 15, 35, 235, 235, 235, 235, 70, 71, 'BJAAAA', 'DSMAAA', 'VVVVxx'),
+(193, 8584, 1, 1, 3, 13, 93, 193, 193, 193, 193, 186, 187, 'LHAAAA', 'ESMAAA', 'AAAAxx'),
+(5586, 8585, 0, 2, 6, 6, 86, 586, 1586, 586, 5586, 172, 173, 'WGAAAA', 'FSMAAA', 'HHHHxx'),
+(6203, 8586, 1, 3, 3, 3, 3, 203, 203, 1203, 6203, 6, 7, 'PEAAAA', 'GSMAAA', 'OOOOxx'),
+(6795, 8587, 1, 3, 5, 15, 95, 795, 795, 1795, 6795, 190, 191, 'JBAAAA', 'HSMAAA', 'VVVVxx'),
+(3211, 8588, 1, 3, 1, 11, 11, 211, 1211, 3211, 3211, 22, 23, 'NTAAAA', 'ISMAAA', 'AAAAxx'),
+(9763, 8589, 1, 3, 3, 3, 63, 763, 1763, 4763, 9763, 126, 127, 'NLAAAA', 'JSMAAA', 'HHHHxx'),
+(9043, 8590, 1, 3, 3, 3, 43, 43, 1043, 4043, 9043, 86, 87, 'VJAAAA', 'KSMAAA', 'OOOOxx'),
+(2854, 8591, 0, 2, 4, 14, 54, 854, 854, 2854, 2854, 108, 109, 'UFAAAA', 'LSMAAA', 'VVVVxx'),
+(565, 8592, 1, 1, 5, 5, 65, 565, 565, 565, 565, 130, 131, 'TVAAAA', 'MSMAAA', 'AAAAxx'),
+(9284, 8593, 0, 0, 4, 4, 84, 284, 1284, 4284, 9284, 168, 169, 'CTAAAA', 'NSMAAA', 'HHHHxx'),
+(7886, 8594, 0, 2, 6, 6, 86, 886, 1886, 2886, 7886, 172, 173, 'IRAAAA', 'OSMAAA', 'OOOOxx'),
+(122, 8595, 0, 2, 2, 2, 22, 122, 122, 122, 122, 44, 45, 'SEAAAA', 'PSMAAA', 'VVVVxx'),
+(4934, 8596, 0, 2, 4, 14, 34, 934, 934, 4934, 4934, 68, 69, 'UHAAAA', 'QSMAAA', 'AAAAxx'),
+(1766, 8597, 0, 2, 6, 6, 66, 766, 1766, 1766, 1766, 132, 133, 'YPAAAA', 'RSMAAA', 'HHHHxx'),
+(2554, 8598, 0, 2, 4, 14, 54, 554, 554, 2554, 2554, 108, 109, 'GUAAAA', 'SSMAAA', 'OOOOxx'),
+(488, 8599, 0, 0, 8, 8, 88, 488, 488, 488, 488, 176, 177, 'USAAAA', 'TSMAAA', 'VVVVxx'),
+(825, 8600, 1, 1, 5, 5, 25, 825, 825, 825, 825, 50, 51, 'TFAAAA', 'USMAAA', 'AAAAxx'),
+(678, 8601, 0, 2, 8, 18, 78, 678, 678, 678, 678, 156, 157, 'CAAAAA', 'VSMAAA', 'HHHHxx'),
+(4543, 8602, 1, 3, 3, 3, 43, 543, 543, 4543, 4543, 86, 87, 'TSAAAA', 'WSMAAA', 'OOOOxx'),
+(1699, 8603, 1, 3, 9, 19, 99, 699, 1699, 1699, 1699, 198, 199, 'JNAAAA', 'XSMAAA', 'VVVVxx'),
+(3771, 8604, 1, 3, 1, 11, 71, 771, 1771, 3771, 3771, 142, 143, 'BPAAAA', 'YSMAAA', 'AAAAxx'),
+(1234, 8605, 0, 2, 4, 14, 34, 234, 1234, 1234, 1234, 68, 69, 'MVAAAA', 'ZSMAAA', 'HHHHxx'),
+(4152, 8606, 0, 0, 2, 12, 52, 152, 152, 4152, 4152, 104, 105, 'SDAAAA', 'ATMAAA', 'OOOOxx'),
+(1632, 8607, 0, 0, 2, 12, 32, 632, 1632, 1632, 1632, 64, 65, 'UKAAAA', 'BTMAAA', 'VVVVxx'),
+(4988, 8608, 0, 0, 8, 8, 88, 988, 988, 4988, 4988, 176, 177, 'WJAAAA', 'CTMAAA', 'AAAAxx'),
+(1980, 8609, 0, 0, 0, 0, 80, 980, 1980, 1980, 1980, 160, 161, 'EYAAAA', 'DTMAAA', 'HHHHxx'),
+(7479, 8610, 1, 3, 9, 19, 79, 479, 1479, 2479, 7479, 158, 159, 'RBAAAA', 'ETMAAA', 'OOOOxx'),
+(2586, 8611, 0, 2, 6, 6, 86, 586, 586, 2586, 2586, 172, 173, 'MVAAAA', 'FTMAAA', 'VVVVxx'),
+(5433, 8612, 1, 1, 3, 13, 33, 433, 1433, 433, 5433, 66, 67, 'ZAAAAA', 'GTMAAA', 'AAAAxx'),
+(2261, 8613, 1, 1, 1, 1, 61, 261, 261, 2261, 2261, 122, 123, 'ZIAAAA', 'HTMAAA', 'HHHHxx'),
+(1180, 8614, 0, 0, 0, 0, 80, 180, 1180, 1180, 1180, 160, 161, 'KTAAAA', 'ITMAAA', 'OOOOxx'),
+(3938, 8615, 0, 2, 8, 18, 38, 938, 1938, 3938, 3938, 76, 77, 'MVAAAA', 'JTMAAA', 'VVVVxx'),
+(6714, 8616, 0, 2, 4, 14, 14, 714, 714, 1714, 6714, 28, 29, 'GYAAAA', 'KTMAAA', 'AAAAxx'),
+(2890, 8617, 0, 2, 0, 10, 90, 890, 890, 2890, 2890, 180, 181, 'EHAAAA', 'LTMAAA', 'HHHHxx'),
+(7379, 8618, 1, 3, 9, 19, 79, 379, 1379, 2379, 7379, 158, 159, 'VXAAAA', 'MTMAAA', 'OOOOxx'),
+(5896, 8619, 0, 0, 6, 16, 96, 896, 1896, 896, 5896, 192, 193, 'USAAAA', 'NTMAAA', 'VVVVxx'),
+(5949, 8620, 1, 1, 9, 9, 49, 949, 1949, 949, 5949, 98, 99, 'VUAAAA', 'OTMAAA', 'AAAAxx'),
+(3194, 8621, 0, 2, 4, 14, 94, 194, 1194, 3194, 3194, 188, 189, 'WSAAAA', 'PTMAAA', 'HHHHxx'),
+(9325, 8622, 1, 1, 5, 5, 25, 325, 1325, 4325, 9325, 50, 51, 'RUAAAA', 'QTMAAA', 'OOOOxx'),
+(9531, 8623, 1, 3, 1, 11, 31, 531, 1531, 4531, 9531, 62, 63, 'PCAAAA', 'RTMAAA', 'VVVVxx'),
+(711, 8624, 1, 3, 1, 11, 11, 711, 711, 711, 711, 22, 23, 'JBAAAA', 'STMAAA', 'AAAAxx'),
+(2450, 8625, 0, 2, 0, 10, 50, 450, 450, 2450, 2450, 100, 101, 'GQAAAA', 'TTMAAA', 'HHHHxx'),
+(1929, 8626, 1, 1, 9, 9, 29, 929, 1929, 1929, 1929, 58, 59, 'FWAAAA', 'UTMAAA', 'OOOOxx'),
+(6165, 8627, 1, 1, 5, 5, 65, 165, 165, 1165, 6165, 130, 131, 'DDAAAA', 'VTMAAA', 'VVVVxx'),
+(4050, 8628, 0, 2, 0, 10, 50, 50, 50, 4050, 4050, 100, 101, 'UZAAAA', 'WTMAAA', 'AAAAxx'),
+(9011, 8629, 1, 3, 1, 11, 11, 11, 1011, 4011, 9011, 22, 23, 'PIAAAA', 'XTMAAA', 'HHHHxx'),
+(7916, 8630, 0, 0, 6, 16, 16, 916, 1916, 2916, 7916, 32, 33, 'MSAAAA', 'YTMAAA', 'OOOOxx'),
+(9136, 8631, 0, 0, 6, 16, 36, 136, 1136, 4136, 9136, 72, 73, 'KNAAAA', 'ZTMAAA', 'VVVVxx'),
+(8782, 8632, 0, 2, 2, 2, 82, 782, 782, 3782, 8782, 164, 165, 'UZAAAA', 'AUMAAA', 'AAAAxx'),
+(8491, 8633, 1, 3, 1, 11, 91, 491, 491, 3491, 8491, 182, 183, 'POAAAA', 'BUMAAA', 'HHHHxx'),
+(5114, 8634, 0, 2, 4, 14, 14, 114, 1114, 114, 5114, 28, 29, 'SOAAAA', 'CUMAAA', 'OOOOxx'),
+(5815, 8635, 1, 3, 5, 15, 15, 815, 1815, 815, 5815, 30, 31, 'RPAAAA', 'DUMAAA', 'VVVVxx'),
+(5628, 8636, 0, 0, 8, 8, 28, 628, 1628, 628, 5628, 56, 57, 'MIAAAA', 'EUMAAA', 'AAAAxx'),
+(810, 8637, 0, 2, 0, 10, 10, 810, 810, 810, 810, 20, 21, 'EFAAAA', 'FUMAAA', 'HHHHxx'),
+(6178, 8638, 0, 2, 8, 18, 78, 178, 178, 1178, 6178, 156, 157, 'QDAAAA', 'GUMAAA', 'OOOOxx'),
+(2619, 8639, 1, 3, 9, 19, 19, 619, 619, 2619, 2619, 38, 39, 'TWAAAA', 'HUMAAA', 'VVVVxx'),
+(3340, 8640, 0, 0, 0, 0, 40, 340, 1340, 3340, 3340, 80, 81, 'MYAAAA', 'IUMAAA', 'AAAAxx'),
+(2491, 8641, 1, 3, 1, 11, 91, 491, 491, 2491, 2491, 182, 183, 'VRAAAA', 'JUMAAA', 'HHHHxx'),
+(3574, 8642, 0, 2, 4, 14, 74, 574, 1574, 3574, 3574, 148, 149, 'MHAAAA', 'KUMAAA', 'OOOOxx'),
+(6754, 8643, 0, 2, 4, 14, 54, 754, 754, 1754, 6754, 108, 109, 'UZAAAA', 'LUMAAA', 'VVVVxx'),
+(1566, 8644, 0, 2, 6, 6, 66, 566, 1566, 1566, 1566, 132, 133, 'GIAAAA', 'MUMAAA', 'AAAAxx'),
+(9174, 8645, 0, 2, 4, 14, 74, 174, 1174, 4174, 9174, 148, 149, 'WOAAAA', 'NUMAAA', 'HHHHxx'),
+(1520, 8646, 0, 0, 0, 0, 20, 520, 1520, 1520, 1520, 40, 41, 'MGAAAA', 'OUMAAA', 'OOOOxx'),
+(2691, 8647, 1, 3, 1, 11, 91, 691, 691, 2691, 2691, 182, 183, 'NZAAAA', 'PUMAAA', 'VVVVxx'),
+(6961, 8648, 1, 1, 1, 1, 61, 961, 961, 1961, 6961, 122, 123, 'THAAAA', 'QUMAAA', 'AAAAxx'),
+(5722, 8649, 0, 2, 2, 2, 22, 722, 1722, 722, 5722, 44, 45, 'CMAAAA', 'RUMAAA', 'HHHHxx'),
+(9707, 8650, 1, 3, 7, 7, 7, 707, 1707, 4707, 9707, 14, 15, 'JJAAAA', 'SUMAAA', 'OOOOxx'),
+(2891, 8651, 1, 3, 1, 11, 91, 891, 891, 2891, 2891, 182, 183, 'FHAAAA', 'TUMAAA', 'VVVVxx'),
+(341, 8652, 1, 1, 1, 1, 41, 341, 341, 341, 341, 82, 83, 'DNAAAA', 'UUMAAA', 'AAAAxx'),
+(4690, 8653, 0, 2, 0, 10, 90, 690, 690, 4690, 4690, 180, 181, 'KYAAAA', 'VUMAAA', 'HHHHxx'),
+(7841, 8654, 1, 1, 1, 1, 41, 841, 1841, 2841, 7841, 82, 83, 'PPAAAA', 'WUMAAA', 'OOOOxx'),
+(6615, 8655, 1, 3, 5, 15, 15, 615, 615, 1615, 6615, 30, 31, 'LUAAAA', 'XUMAAA', 'VVVVxx'),
+(9169, 8656, 1, 1, 9, 9, 69, 169, 1169, 4169, 9169, 138, 139, 'ROAAAA', 'YUMAAA', 'AAAAxx'),
+(6689, 8657, 1, 1, 9, 9, 89, 689, 689, 1689, 6689, 178, 179, 'HXAAAA', 'ZUMAAA', 'HHHHxx'),
+(8721, 8658, 1, 1, 1, 1, 21, 721, 721, 3721, 8721, 42, 43, 'LXAAAA', 'AVMAAA', 'OOOOxx'),
+(7508, 8659, 0, 0, 8, 8, 8, 508, 1508, 2508, 7508, 16, 17, 'UCAAAA', 'BVMAAA', 'VVVVxx'),
+(8631, 8660, 1, 3, 1, 11, 31, 631, 631, 3631, 8631, 62, 63, 'ZTAAAA', 'CVMAAA', 'AAAAxx'),
+(480, 8661, 0, 0, 0, 0, 80, 480, 480, 480, 480, 160, 161, 'MSAAAA', 'DVMAAA', 'HHHHxx'),
+(7094, 8662, 0, 2, 4, 14, 94, 94, 1094, 2094, 7094, 188, 189, 'WMAAAA', 'EVMAAA', 'OOOOxx'),
+(319, 8663, 1, 3, 9, 19, 19, 319, 319, 319, 319, 38, 39, 'HMAAAA', 'FVMAAA', 'VVVVxx'),
+(9421, 8664, 1, 1, 1, 1, 21, 421, 1421, 4421, 9421, 42, 43, 'JYAAAA', 'GVMAAA', 'AAAAxx'),
+(4352, 8665, 0, 0, 2, 12, 52, 352, 352, 4352, 4352, 104, 105, 'KLAAAA', 'HVMAAA', 'HHHHxx'),
+(5019, 8666, 1, 3, 9, 19, 19, 19, 1019, 19, 5019, 38, 39, 'BLAAAA', 'IVMAAA', 'OOOOxx'),
+(3956, 8667, 0, 0, 6, 16, 56, 956, 1956, 3956, 3956, 112, 113, 'EWAAAA', 'JVMAAA', 'VVVVxx'),
+(114, 8668, 0, 2, 4, 14, 14, 114, 114, 114, 114, 28, 29, 'KEAAAA', 'KVMAAA', 'AAAAxx'),
+(1196, 8669, 0, 0, 6, 16, 96, 196, 1196, 1196, 1196, 192, 193, 'AUAAAA', 'LVMAAA', 'HHHHxx'),
+(1407, 8670, 1, 3, 7, 7, 7, 407, 1407, 1407, 1407, 14, 15, 'DCAAAA', 'MVMAAA', 'OOOOxx'),
+(7432, 8671, 0, 0, 2, 12, 32, 432, 1432, 2432, 7432, 64, 65, 'WZAAAA', 'NVMAAA', 'VVVVxx'),
+(3141, 8672, 1, 1, 1, 1, 41, 141, 1141, 3141, 3141, 82, 83, 'VQAAAA', 'OVMAAA', 'AAAAxx'),
+(2073, 8673, 1, 1, 3, 13, 73, 73, 73, 2073, 2073, 146, 147, 'TBAAAA', 'PVMAAA', 'HHHHxx'),
+(3400, 8674, 0, 0, 0, 0, 0, 400, 1400, 3400, 3400, 0, 1, 'UAAAAA', 'QVMAAA', 'OOOOxx'),
+(505, 8675, 1, 1, 5, 5, 5, 505, 505, 505, 505, 10, 11, 'LTAAAA', 'RVMAAA', 'VVVVxx'),
+(1263, 8676, 1, 3, 3, 3, 63, 263, 1263, 1263, 1263, 126, 127, 'PWAAAA', 'SVMAAA', 'AAAAxx'),
+(190, 8677, 0, 2, 0, 10, 90, 190, 190, 190, 190, 180, 181, 'IHAAAA', 'TVMAAA', 'HHHHxx'),
+(6686, 8678, 0, 2, 6, 6, 86, 686, 686, 1686, 6686, 172, 173, 'EXAAAA', 'UVMAAA', 'OOOOxx'),
+(9821, 8679, 1, 1, 1, 1, 21, 821, 1821, 4821, 9821, 42, 43, 'TNAAAA', 'VVMAAA', 'VVVVxx'),
+(1119, 8680, 1, 3, 9, 19, 19, 119, 1119, 1119, 1119, 38, 39, 'BRAAAA', 'WVMAAA', 'AAAAxx'),
+(2955, 8681, 1, 3, 5, 15, 55, 955, 955, 2955, 2955, 110, 111, 'RJAAAA', 'XVMAAA', 'HHHHxx'),
+(224, 8682, 0, 0, 4, 4, 24, 224, 224, 224, 224, 48, 49, 'QIAAAA', 'YVMAAA', 'OOOOxx'),
+(7562, 8683, 0, 2, 2, 2, 62, 562, 1562, 2562, 7562, 124, 125, 'WEAAAA', 'ZVMAAA', 'VVVVxx'),
+(8845, 8684, 1, 1, 5, 5, 45, 845, 845, 3845, 8845, 90, 91, 'FCAAAA', 'AWMAAA', 'AAAAxx'),
+(5405, 8685, 1, 1, 5, 5, 5, 405, 1405, 405, 5405, 10, 11, 'XZAAAA', 'BWMAAA', 'HHHHxx'),
+(9192, 8686, 0, 0, 2, 12, 92, 192, 1192, 4192, 9192, 184, 185, 'OPAAAA', 'CWMAAA', 'OOOOxx'),
+(4927, 8687, 1, 3, 7, 7, 27, 927, 927, 4927, 4927, 54, 55, 'NHAAAA', 'DWMAAA', 'VVVVxx'),
+(997, 8688, 1, 1, 7, 17, 97, 997, 997, 997, 997, 194, 195, 'JMAAAA', 'EWMAAA', 'AAAAxx'),
+(989, 8689, 1, 1, 9, 9, 89, 989, 989, 989, 989, 178, 179, 'BMAAAA', 'FWMAAA', 'HHHHxx'),
+(7258, 8690, 0, 2, 8, 18, 58, 258, 1258, 2258, 7258, 116, 117, 'ETAAAA', 'GWMAAA', 'OOOOxx'),
+(6899, 8691, 1, 3, 9, 19, 99, 899, 899, 1899, 6899, 198, 199, 'JFAAAA', 'HWMAAA', 'VVVVxx'),
+(1770, 8692, 0, 2, 0, 10, 70, 770, 1770, 1770, 1770, 140, 141, 'CQAAAA', 'IWMAAA', 'AAAAxx'),
+(4423, 8693, 1, 3, 3, 3, 23, 423, 423, 4423, 4423, 46, 47, 'DOAAAA', 'JWMAAA', 'HHHHxx'),
+(5671, 8694, 1, 3, 1, 11, 71, 671, 1671, 671, 5671, 142, 143, 'DKAAAA', 'KWMAAA', 'OOOOxx'),
+(8393, 8695, 1, 1, 3, 13, 93, 393, 393, 3393, 8393, 186, 187, 'VKAAAA', 'LWMAAA', 'VVVVxx'),
+(4355, 8696, 1, 3, 5, 15, 55, 355, 355, 4355, 4355, 110, 111, 'NLAAAA', 'MWMAAA', 'AAAAxx'),
+(3919, 8697, 1, 3, 9, 19, 19, 919, 1919, 3919, 3919, 38, 39, 'TUAAAA', 'NWMAAA', 'HHHHxx'),
+(338, 8698, 0, 2, 8, 18, 38, 338, 338, 338, 338, 76, 77, 'ANAAAA', 'OWMAAA', 'OOOOxx'),
+(5790, 8699, 0, 2, 0, 10, 90, 790, 1790, 790, 5790, 180, 181, 'SOAAAA', 'PWMAAA', 'VVVVxx'),
+(1452, 8700, 0, 0, 2, 12, 52, 452, 1452, 1452, 1452, 104, 105, 'WDAAAA', 'QWMAAA', 'AAAAxx'),
+(939, 8701, 1, 3, 9, 19, 39, 939, 939, 939, 939, 78, 79, 'DKAAAA', 'RWMAAA', 'HHHHxx'),
+(8913, 8702, 1, 1, 3, 13, 13, 913, 913, 3913, 8913, 26, 27, 'VEAAAA', 'SWMAAA', 'OOOOxx'),
+(7157, 8703, 1, 1, 7, 17, 57, 157, 1157, 2157, 7157, 114, 115, 'HPAAAA', 'TWMAAA', 'VVVVxx'),
+(7240, 8704, 0, 0, 0, 0, 40, 240, 1240, 2240, 7240, 80, 81, 'MSAAAA', 'UWMAAA', 'AAAAxx'),
+(3492, 8705, 0, 0, 2, 12, 92, 492, 1492, 3492, 3492, 184, 185, 'IEAAAA', 'VWMAAA', 'HHHHxx'),
+(3464, 8706, 0, 0, 4, 4, 64, 464, 1464, 3464, 3464, 128, 129, 'GDAAAA', 'WWMAAA', 'OOOOxx'),
+(388, 8707, 0, 0, 8, 8, 88, 388, 388, 388, 388, 176, 177, 'YOAAAA', 'XWMAAA', 'VVVVxx'),
+(4135, 8708, 1, 3, 5, 15, 35, 135, 135, 4135, 4135, 70, 71, 'BDAAAA', 'YWMAAA', 'AAAAxx'),
+(1194, 8709, 0, 2, 4, 14, 94, 194, 1194, 1194, 1194, 188, 189, 'YTAAAA', 'ZWMAAA', 'HHHHxx'),
+(5476, 8710, 0, 0, 6, 16, 76, 476, 1476, 476, 5476, 152, 153, 'QCAAAA', 'AXMAAA', 'OOOOxx'),
+(9844, 8711, 0, 0, 4, 4, 44, 844, 1844, 4844, 9844, 88, 89, 'QOAAAA', 'BXMAAA', 'VVVVxx'),
+(9364, 8712, 0, 0, 4, 4, 64, 364, 1364, 4364, 9364, 128, 129, 'EWAAAA', 'CXMAAA', 'AAAAxx'),
+(5238, 8713, 0, 2, 8, 18, 38, 238, 1238, 238, 5238, 76, 77, 'MTAAAA', 'DXMAAA', 'HHHHxx'),
+(3712, 8714, 0, 0, 2, 12, 12, 712, 1712, 3712, 3712, 24, 25, 'UMAAAA', 'EXMAAA', 'OOOOxx'),
+(6189, 8715, 1, 1, 9, 9, 89, 189, 189, 1189, 6189, 178, 179, 'BEAAAA', 'FXMAAA', 'VVVVxx'),
+(5257, 8716, 1, 1, 7, 17, 57, 257, 1257, 257, 5257, 114, 115, 'FUAAAA', 'GXMAAA', 'AAAAxx'),
+(81, 8717, 1, 1, 1, 1, 81, 81, 81, 81, 81, 162, 163, 'DDAAAA', 'HXMAAA', 'HHHHxx'),
+(3289, 8718, 1, 1, 9, 9, 89, 289, 1289, 3289, 3289, 178, 179, 'NWAAAA', 'IXMAAA', 'OOOOxx'),
+(1177, 8719, 1, 1, 7, 17, 77, 177, 1177, 1177, 1177, 154, 155, 'HTAAAA', 'JXMAAA', 'VVVVxx'),
+(5038, 8720, 0, 2, 8, 18, 38, 38, 1038, 38, 5038, 76, 77, 'ULAAAA', 'KXMAAA', 'AAAAxx'),
+(325, 8721, 1, 1, 5, 5, 25, 325, 325, 325, 325, 50, 51, 'NMAAAA', 'LXMAAA', 'HHHHxx'),
+(7221, 8722, 1, 1, 1, 1, 21, 221, 1221, 2221, 7221, 42, 43, 'TRAAAA', 'MXMAAA', 'OOOOxx'),
+(7123, 8723, 1, 3, 3, 3, 23, 123, 1123, 2123, 7123, 46, 47, 'ZNAAAA', 'NXMAAA', 'VVVVxx'),
+(6364, 8724, 0, 0, 4, 4, 64, 364, 364, 1364, 6364, 128, 129, 'UKAAAA', 'OXMAAA', 'AAAAxx'),
+(4468, 8725, 0, 0, 8, 8, 68, 468, 468, 4468, 4468, 136, 137, 'WPAAAA', 'PXMAAA', 'HHHHxx'),
+(9185, 8726, 1, 1, 5, 5, 85, 185, 1185, 4185, 9185, 170, 171, 'HPAAAA', 'QXMAAA', 'OOOOxx'),
+(4158, 8727, 0, 2, 8, 18, 58, 158, 158, 4158, 4158, 116, 117, 'YDAAAA', 'RXMAAA', 'VVVVxx'),
+(9439, 8728, 1, 3, 9, 19, 39, 439, 1439, 4439, 9439, 78, 79, 'BZAAAA', 'SXMAAA', 'AAAAxx'),
+(7759, 8729, 1, 3, 9, 19, 59, 759, 1759, 2759, 7759, 118, 119, 'LMAAAA', 'TXMAAA', 'HHHHxx'),
+(3325, 8730, 1, 1, 5, 5, 25, 325, 1325, 3325, 3325, 50, 51, 'XXAAAA', 'UXMAAA', 'OOOOxx'),
+(7991, 8731, 1, 3, 1, 11, 91, 991, 1991, 2991, 7991, 182, 183, 'JVAAAA', 'VXMAAA', 'VVVVxx'),
+(1650, 8732, 0, 2, 0, 10, 50, 650, 1650, 1650, 1650, 100, 101, 'MLAAAA', 'WXMAAA', 'AAAAxx'),
+(8395, 8733, 1, 3, 5, 15, 95, 395, 395, 3395, 8395, 190, 191, 'XKAAAA', 'XXMAAA', 'HHHHxx'),
+(286, 8734, 0, 2, 6, 6, 86, 286, 286, 286, 286, 172, 173, 'ALAAAA', 'YXMAAA', 'OOOOxx'),
+(1507, 8735, 1, 3, 7, 7, 7, 507, 1507, 1507, 1507, 14, 15, 'ZFAAAA', 'ZXMAAA', 'VVVVxx'),
+(4122, 8736, 0, 2, 2, 2, 22, 122, 122, 4122, 4122, 44, 45, 'OCAAAA', 'AYMAAA', 'AAAAxx'),
+(2625, 8737, 1, 1, 5, 5, 25, 625, 625, 2625, 2625, 50, 51, 'ZWAAAA', 'BYMAAA', 'HHHHxx'),
+(1140, 8738, 0, 0, 0, 0, 40, 140, 1140, 1140, 1140, 80, 81, 'WRAAAA', 'CYMAAA', 'OOOOxx'),
+(5262, 8739, 0, 2, 2, 2, 62, 262, 1262, 262, 5262, 124, 125, 'KUAAAA', 'DYMAAA', 'VVVVxx'),
+(4919, 8740, 1, 3, 9, 19, 19, 919, 919, 4919, 4919, 38, 39, 'FHAAAA', 'EYMAAA', 'AAAAxx'),
+(7266, 8741, 0, 2, 6, 6, 66, 266, 1266, 2266, 7266, 132, 133, 'MTAAAA', 'FYMAAA', 'HHHHxx'),
+(630, 8742, 0, 2, 0, 10, 30, 630, 630, 630, 630, 60, 61, 'GYAAAA', 'GYMAAA', 'OOOOxx'),
+(2129, 8743, 1, 1, 9, 9, 29, 129, 129, 2129, 2129, 58, 59, 'XDAAAA', 'HYMAAA', 'VVVVxx'),
+(9552, 8744, 0, 0, 2, 12, 52, 552, 1552, 4552, 9552, 104, 105, 'KDAAAA', 'IYMAAA', 'AAAAxx'),
+(3018, 8745, 0, 2, 8, 18, 18, 18, 1018, 3018, 3018, 36, 37, 'CMAAAA', 'JYMAAA', 'HHHHxx'),
+(7145, 8746, 1, 1, 5, 5, 45, 145, 1145, 2145, 7145, 90, 91, 'VOAAAA', 'KYMAAA', 'OOOOxx'),
+(1633, 8747, 1, 1, 3, 13, 33, 633, 1633, 1633, 1633, 66, 67, 'VKAAAA', 'LYMAAA', 'VVVVxx'),
+(7957, 8748, 1, 1, 7, 17, 57, 957, 1957, 2957, 7957, 114, 115, 'BUAAAA', 'MYMAAA', 'AAAAxx'),
+(774, 8749, 0, 2, 4, 14, 74, 774, 774, 774, 774, 148, 149, 'UDAAAA', 'NYMAAA', 'HHHHxx'),
+(9371, 8750, 1, 3, 1, 11, 71, 371, 1371, 4371, 9371, 142, 143, 'LWAAAA', 'OYMAAA', 'OOOOxx'),
+(6007, 8751, 1, 3, 7, 7, 7, 7, 7, 1007, 6007, 14, 15, 'BXAAAA', 'PYMAAA', 'VVVVxx'),
+(5277, 8752, 1, 1, 7, 17, 77, 277, 1277, 277, 5277, 154, 155, 'ZUAAAA', 'QYMAAA', 'AAAAxx'),
+(9426, 8753, 0, 2, 6, 6, 26, 426, 1426, 4426, 9426, 52, 53, 'OYAAAA', 'RYMAAA', 'HHHHxx'),
+(9190, 8754, 0, 2, 0, 10, 90, 190, 1190, 4190, 9190, 180, 181, 'MPAAAA', 'SYMAAA', 'OOOOxx'),
+(8996, 8755, 0, 0, 6, 16, 96, 996, 996, 3996, 8996, 192, 193, 'AIAAAA', 'TYMAAA', 'VVVVxx'),
+(3409, 8756, 1, 1, 9, 9, 9, 409, 1409, 3409, 3409, 18, 19, 'DBAAAA', 'UYMAAA', 'AAAAxx'),
+(7212, 8757, 0, 0, 2, 12, 12, 212, 1212, 2212, 7212, 24, 25, 'KRAAAA', 'VYMAAA', 'HHHHxx'),
+(416, 8758, 0, 0, 6, 16, 16, 416, 416, 416, 416, 32, 33, 'AQAAAA', 'WYMAAA', 'OOOOxx'),
+(7211, 8759, 1, 3, 1, 11, 11, 211, 1211, 2211, 7211, 22, 23, 'JRAAAA', 'XYMAAA', 'VVVVxx'),
+(7454, 8760, 0, 2, 4, 14, 54, 454, 1454, 2454, 7454, 108, 109, 'SAAAAA', 'YYMAAA', 'AAAAxx'),
+(8417, 8761, 1, 1, 7, 17, 17, 417, 417, 3417, 8417, 34, 35, 'TLAAAA', 'ZYMAAA', 'HHHHxx'),
+(5562, 8762, 0, 2, 2, 2, 62, 562, 1562, 562, 5562, 124, 125, 'YFAAAA', 'AZMAAA', 'OOOOxx'),
+(4996, 8763, 0, 0, 6, 16, 96, 996, 996, 4996, 4996, 192, 193, 'EKAAAA', 'BZMAAA', 'VVVVxx'),
+(5718, 8764, 0, 2, 8, 18, 18, 718, 1718, 718, 5718, 36, 37, 'YLAAAA', 'CZMAAA', 'AAAAxx'),
+(7838, 8765, 0, 2, 8, 18, 38, 838, 1838, 2838, 7838, 76, 77, 'MPAAAA', 'DZMAAA', 'HHHHxx'),
+(7715, 8766, 1, 3, 5, 15, 15, 715, 1715, 2715, 7715, 30, 31, 'TKAAAA', 'EZMAAA', 'OOOOxx'),
+(2780, 8767, 0, 0, 0, 0, 80, 780, 780, 2780, 2780, 160, 161, 'YCAAAA', 'FZMAAA', 'VVVVxx'),
+(1013, 8768, 1, 1, 3, 13, 13, 13, 1013, 1013, 1013, 26, 27, 'ZMAAAA', 'GZMAAA', 'AAAAxx'),
+(8465, 8769, 1, 1, 5, 5, 65, 465, 465, 3465, 8465, 130, 131, 'PNAAAA', 'HZMAAA', 'HHHHxx'),
+(7976, 8770, 0, 0, 6, 16, 76, 976, 1976, 2976, 7976, 152, 153, 'UUAAAA', 'IZMAAA', 'OOOOxx'),
+(7150, 8771, 0, 2, 0, 10, 50, 150, 1150, 2150, 7150, 100, 101, 'APAAAA', 'JZMAAA', 'VVVVxx'),
+(6471, 8772, 1, 3, 1, 11, 71, 471, 471, 1471, 6471, 142, 143, 'XOAAAA', 'KZMAAA', 'AAAAxx'),
+(1927, 8773, 1, 3, 7, 7, 27, 927, 1927, 1927, 1927, 54, 55, 'DWAAAA', 'LZMAAA', 'HHHHxx'),
+(227, 8774, 1, 3, 7, 7, 27, 227, 227, 227, 227, 54, 55, 'TIAAAA', 'MZMAAA', 'OOOOxx'),
+(6462, 8775, 0, 2, 2, 2, 62, 462, 462, 1462, 6462, 124, 125, 'OOAAAA', 'NZMAAA', 'VVVVxx'),
+(5227, 8776, 1, 3, 7, 7, 27, 227, 1227, 227, 5227, 54, 55, 'BTAAAA', 'OZMAAA', 'AAAAxx'),
+(1074, 8777, 0, 2, 4, 14, 74, 74, 1074, 1074, 1074, 148, 149, 'IPAAAA', 'PZMAAA', 'HHHHxx'),
+(9448, 8778, 0, 0, 8, 8, 48, 448, 1448, 4448, 9448, 96, 97, 'KZAAAA', 'QZMAAA', 'OOOOxx'),
+(4459, 8779, 1, 3, 9, 19, 59, 459, 459, 4459, 4459, 118, 119, 'NPAAAA', 'RZMAAA', 'VVVVxx'),
+(2478, 8780, 0, 2, 8, 18, 78, 478, 478, 2478, 2478, 156, 157, 'IRAAAA', 'SZMAAA', 'AAAAxx'),
+(5005, 8781, 1, 1, 5, 5, 5, 5, 1005, 5, 5005, 10, 11, 'NKAAAA', 'TZMAAA', 'HHHHxx'),
+(2418, 8782, 0, 2, 8, 18, 18, 418, 418, 2418, 2418, 36, 37, 'APAAAA', 'UZMAAA', 'OOOOxx'),
+(6991, 8783, 1, 3, 1, 11, 91, 991, 991, 1991, 6991, 182, 183, 'XIAAAA', 'VZMAAA', 'VVVVxx'),
+(4729, 8784, 1, 1, 9, 9, 29, 729, 729, 4729, 4729, 58, 59, 'XZAAAA', 'WZMAAA', 'AAAAxx'),
+(3548, 8785, 0, 0, 8, 8, 48, 548, 1548, 3548, 3548, 96, 97, 'MGAAAA', 'XZMAAA', 'HHHHxx'),
+(9616, 8786, 0, 0, 6, 16, 16, 616, 1616, 4616, 9616, 32, 33, 'WFAAAA', 'YZMAAA', 'OOOOxx'),
+(2901, 8787, 1, 1, 1, 1, 1, 901, 901, 2901, 2901, 2, 3, 'PHAAAA', 'ZZMAAA', 'VVVVxx'),
+(10, 8788, 0, 2, 0, 10, 10, 10, 10, 10, 10, 20, 21, 'KAAAAA', 'AANAAA', 'AAAAxx'),
+(2637, 8789, 1, 1, 7, 17, 37, 637, 637, 2637, 2637, 74, 75, 'LXAAAA', 'BANAAA', 'HHHHxx'),
+(6747, 8790, 1, 3, 7, 7, 47, 747, 747, 1747, 6747, 94, 95, 'NZAAAA', 'CANAAA', 'OOOOxx'),
+(797, 8791, 1, 1, 7, 17, 97, 797, 797, 797, 797, 194, 195, 'REAAAA', 'DANAAA', 'VVVVxx'),
+(7609, 8792, 1, 1, 9, 9, 9, 609, 1609, 2609, 7609, 18, 19, 'RGAAAA', 'EANAAA', 'AAAAxx'),
+(8290, 8793, 0, 2, 0, 10, 90, 290, 290, 3290, 8290, 180, 181, 'WGAAAA', 'FANAAA', 'HHHHxx'),
+(8765, 8794, 1, 1, 5, 5, 65, 765, 765, 3765, 8765, 130, 131, 'DZAAAA', 'GANAAA', 'OOOOxx'),
+(8053, 8795, 1, 1, 3, 13, 53, 53, 53, 3053, 8053, 106, 107, 'TXAAAA', 'HANAAA', 'VVVVxx'),
+(5602, 8796, 0, 2, 2, 2, 2, 602, 1602, 602, 5602, 4, 5, 'MHAAAA', 'IANAAA', 'AAAAxx'),
+(3672, 8797, 0, 0, 2, 12, 72, 672, 1672, 3672, 3672, 144, 145, 'GLAAAA', 'JANAAA', 'HHHHxx'),
+(7513, 8798, 1, 1, 3, 13, 13, 513, 1513, 2513, 7513, 26, 27, 'ZCAAAA', 'KANAAA', 'OOOOxx'),
+(3462, 8799, 0, 2, 2, 2, 62, 462, 1462, 3462, 3462, 124, 125, 'EDAAAA', 'LANAAA', 'VVVVxx'),
+(4457, 8800, 1, 1, 7, 17, 57, 457, 457, 4457, 4457, 114, 115, 'LPAAAA', 'MANAAA', 'AAAAxx'),
+(6547, 8801, 1, 3, 7, 7, 47, 547, 547, 1547, 6547, 94, 95, 'VRAAAA', 'NANAAA', 'HHHHxx'),
+(7417, 8802, 1, 1, 7, 17, 17, 417, 1417, 2417, 7417, 34, 35, 'HZAAAA', 'OANAAA', 'OOOOxx'),
+(8641, 8803, 1, 1, 1, 1, 41, 641, 641, 3641, 8641, 82, 83, 'JUAAAA', 'PANAAA', 'VVVVxx'),
+(149, 8804, 1, 1, 9, 9, 49, 149, 149, 149, 149, 98, 99, 'TFAAAA', 'QANAAA', 'AAAAxx'),
+(5041, 8805, 1, 1, 1, 1, 41, 41, 1041, 41, 5041, 82, 83, 'XLAAAA', 'RANAAA', 'HHHHxx'),
+(9232, 8806, 0, 0, 2, 12, 32, 232, 1232, 4232, 9232, 64, 65, 'CRAAAA', 'SANAAA', 'OOOOxx'),
+(3603, 8807, 1, 3, 3, 3, 3, 603, 1603, 3603, 3603, 6, 7, 'PIAAAA', 'TANAAA', 'VVVVxx'),
+(2792, 8808, 0, 0, 2, 12, 92, 792, 792, 2792, 2792, 184, 185, 'KDAAAA', 'UANAAA', 'AAAAxx'),
+(6620, 8809, 0, 0, 0, 0, 20, 620, 620, 1620, 6620, 40, 41, 'QUAAAA', 'VANAAA', 'HHHHxx'),
+(4000, 8810, 0, 0, 0, 0, 0, 0, 0, 4000, 4000, 0, 1, 'WXAAAA', 'WANAAA', 'OOOOxx'),
+(659, 8811, 1, 3, 9, 19, 59, 659, 659, 659, 659, 118, 119, 'JZAAAA', 'XANAAA', 'VVVVxx'),
+(8174, 8812, 0, 2, 4, 14, 74, 174, 174, 3174, 8174, 148, 149, 'KCAAAA', 'YANAAA', 'AAAAxx'),
+(4599, 8813, 1, 3, 9, 19, 99, 599, 599, 4599, 4599, 198, 199, 'XUAAAA', 'ZANAAA', 'HHHHxx'),
+(7851, 8814, 1, 3, 1, 11, 51, 851, 1851, 2851, 7851, 102, 103, 'ZPAAAA', 'ABNAAA', 'OOOOxx'),
+(6284, 8815, 0, 0, 4, 4, 84, 284, 284, 1284, 6284, 168, 169, 'SHAAAA', 'BBNAAA', 'VVVVxx'),
+(7116, 8816, 0, 0, 6, 16, 16, 116, 1116, 2116, 7116, 32, 33, 'SNAAAA', 'CBNAAA', 'AAAAxx'),
+(5595, 8817, 1, 3, 5, 15, 95, 595, 1595, 595, 5595, 190, 191, 'FHAAAA', 'DBNAAA', 'HHHHxx'),
+(2903, 8818, 1, 3, 3, 3, 3, 903, 903, 2903, 2903, 6, 7, 'RHAAAA', 'EBNAAA', 'OOOOxx'),
+(5948, 8819, 0, 0, 8, 8, 48, 948, 1948, 948, 5948, 96, 97, 'UUAAAA', 'FBNAAA', 'VVVVxx'),
+(225, 8820, 1, 1, 5, 5, 25, 225, 225, 225, 225, 50, 51, 'RIAAAA', 'GBNAAA', 'AAAAxx'),
+(524, 8821, 0, 0, 4, 4, 24, 524, 524, 524, 524, 48, 49, 'EUAAAA', 'HBNAAA', 'HHHHxx'),
+(7639, 8822, 1, 3, 9, 19, 39, 639, 1639, 2639, 7639, 78, 79, 'VHAAAA', 'IBNAAA', 'OOOOxx'),
+(7297, 8823, 1, 1, 7, 17, 97, 297, 1297, 2297, 7297, 194, 195, 'RUAAAA', 'JBNAAA', 'VVVVxx'),
+(2606, 8824, 0, 2, 6, 6, 6, 606, 606, 2606, 2606, 12, 13, 'GWAAAA', 'KBNAAA', 'AAAAxx'),
+(4771, 8825, 1, 3, 1, 11, 71, 771, 771, 4771, 4771, 142, 143, 'NBAAAA', 'LBNAAA', 'HHHHxx'),
+(8162, 8826, 0, 2, 2, 2, 62, 162, 162, 3162, 8162, 124, 125, 'YBAAAA', 'MBNAAA', 'OOOOxx'),
+(8999, 8827, 1, 3, 9, 19, 99, 999, 999, 3999, 8999, 198, 199, 'DIAAAA', 'NBNAAA', 'VVVVxx'),
+(2309, 8828, 1, 1, 9, 9, 9, 309, 309, 2309, 2309, 18, 19, 'VKAAAA', 'OBNAAA', 'AAAAxx'),
+(3594, 8829, 0, 2, 4, 14, 94, 594, 1594, 3594, 3594, 188, 189, 'GIAAAA', 'PBNAAA', 'HHHHxx'),
+(6092, 8830, 0, 0, 2, 12, 92, 92, 92, 1092, 6092, 184, 185, 'IAAAAA', 'QBNAAA', 'OOOOxx'),
+(7467, 8831, 1, 3, 7, 7, 67, 467, 1467, 2467, 7467, 134, 135, 'FBAAAA', 'RBNAAA', 'VVVVxx'),
+(6986, 8832, 0, 2, 6, 6, 86, 986, 986, 1986, 6986, 172, 173, 'SIAAAA', 'SBNAAA', 'AAAAxx'),
+(9898, 8833, 0, 2, 8, 18, 98, 898, 1898, 4898, 9898, 196, 197, 'SQAAAA', 'TBNAAA', 'HHHHxx'),
+(9578, 8834, 0, 2, 8, 18, 78, 578, 1578, 4578, 9578, 156, 157, 'KEAAAA', 'UBNAAA', 'OOOOxx'),
+(156, 8835, 0, 0, 6, 16, 56, 156, 156, 156, 156, 112, 113, 'AGAAAA', 'VBNAAA', 'VVVVxx'),
+(5810, 8836, 0, 2, 0, 10, 10, 810, 1810, 810, 5810, 20, 21, 'MPAAAA', 'WBNAAA', 'AAAAxx'),
+(790, 8837, 0, 2, 0, 10, 90, 790, 790, 790, 790, 180, 181, 'KEAAAA', 'XBNAAA', 'HHHHxx'),
+(6840, 8838, 0, 0, 0, 0, 40, 840, 840, 1840, 6840, 80, 81, 'CDAAAA', 'YBNAAA', 'OOOOxx'),
+(6725, 8839, 1, 1, 5, 5, 25, 725, 725, 1725, 6725, 50, 51, 'RYAAAA', 'ZBNAAA', 'VVVVxx'),
+(5528, 8840, 0, 0, 8, 8, 28, 528, 1528, 528, 5528, 56, 57, 'QEAAAA', 'ACNAAA', 'AAAAxx'),
+(4120, 8841, 0, 0, 0, 0, 20, 120, 120, 4120, 4120, 40, 41, 'MCAAAA', 'BCNAAA', 'HHHHxx'),
+(6694, 8842, 0, 2, 4, 14, 94, 694, 694, 1694, 6694, 188, 189, 'MXAAAA', 'CCNAAA', 'OOOOxx'),
+(3552, 8843, 0, 0, 2, 12, 52, 552, 1552, 3552, 3552, 104, 105, 'QGAAAA', 'DCNAAA', 'VVVVxx'),
+(1478, 8844, 0, 2, 8, 18, 78, 478, 1478, 1478, 1478, 156, 157, 'WEAAAA', 'ECNAAA', 'AAAAxx'),
+(8084, 8845, 0, 0, 4, 4, 84, 84, 84, 3084, 8084, 168, 169, 'YYAAAA', 'FCNAAA', 'HHHHxx'),
+(7578, 8846, 0, 2, 8, 18, 78, 578, 1578, 2578, 7578, 156, 157, 'MFAAAA', 'GCNAAA', 'OOOOxx'),
+(6314, 8847, 0, 2, 4, 14, 14, 314, 314, 1314, 6314, 28, 29, 'WIAAAA', 'HCNAAA', 'VVVVxx'),
+(6123, 8848, 1, 3, 3, 3, 23, 123, 123, 1123, 6123, 46, 47, 'NBAAAA', 'ICNAAA', 'AAAAxx'),
+(9443, 8849, 1, 3, 3, 3, 43, 443, 1443, 4443, 9443, 86, 87, 'FZAAAA', 'JCNAAA', 'HHHHxx'),
+(9628, 8850, 0, 0, 8, 8, 28, 628, 1628, 4628, 9628, 56, 57, 'IGAAAA', 'KCNAAA', 'OOOOxx'),
+(8508, 8851, 0, 0, 8, 8, 8, 508, 508, 3508, 8508, 16, 17, 'GPAAAA', 'LCNAAA', 'VVVVxx'),
+(5552, 8852, 0, 0, 2, 12, 52, 552, 1552, 552, 5552, 104, 105, 'OFAAAA', 'MCNAAA', 'AAAAxx'),
+(5327, 8853, 1, 3, 7, 7, 27, 327, 1327, 327, 5327, 54, 55, 'XWAAAA', 'NCNAAA', 'HHHHxx'),
+(7771, 8854, 1, 3, 1, 11, 71, 771, 1771, 2771, 7771, 142, 143, 'XMAAAA', 'OCNAAA', 'OOOOxx'),
+(8932, 8855, 0, 0, 2, 12, 32, 932, 932, 3932, 8932, 64, 65, 'OFAAAA', 'PCNAAA', 'VVVVxx'),
+(3526, 8856, 0, 2, 6, 6, 26, 526, 1526, 3526, 3526, 52, 53, 'QFAAAA', 'QCNAAA', 'AAAAxx'),
+(4340, 8857, 0, 0, 0, 0, 40, 340, 340, 4340, 4340, 80, 81, 'YKAAAA', 'RCNAAA', 'HHHHxx'),
+(9419, 8858, 1, 3, 9, 19, 19, 419, 1419, 4419, 9419, 38, 39, 'HYAAAA', 'SCNAAA', 'OOOOxx'),
+(8421, 8859, 1, 1, 1, 1, 21, 421, 421, 3421, 8421, 42, 43, 'XLAAAA', 'TCNAAA', 'VVVVxx'),
+(7431, 8860, 1, 3, 1, 11, 31, 431, 1431, 2431, 7431, 62, 63, 'VZAAAA', 'UCNAAA', 'AAAAxx'),
+(172, 8861, 0, 0, 2, 12, 72, 172, 172, 172, 172, 144, 145, 'QGAAAA', 'VCNAAA', 'HHHHxx'),
+(3279, 8862, 1, 3, 9, 19, 79, 279, 1279, 3279, 3279, 158, 159, 'DWAAAA', 'WCNAAA', 'OOOOxx'),
+(1508, 8863, 0, 0, 8, 8, 8, 508, 1508, 1508, 1508, 16, 17, 'AGAAAA', 'XCNAAA', 'VVVVxx'),
+(7091, 8864, 1, 3, 1, 11, 91, 91, 1091, 2091, 7091, 182, 183, 'TMAAAA', 'YCNAAA', 'AAAAxx'),
+(1419, 8865, 1, 3, 9, 19, 19, 419, 1419, 1419, 1419, 38, 39, 'PCAAAA', 'ZCNAAA', 'HHHHxx'),
+(3032, 8866, 0, 0, 2, 12, 32, 32, 1032, 3032, 3032, 64, 65, 'QMAAAA', 'ADNAAA', 'OOOOxx'),
+(8683, 8867, 1, 3, 3, 3, 83, 683, 683, 3683, 8683, 166, 167, 'ZVAAAA', 'BDNAAA', 'VVVVxx'),
+(4763, 8868, 1, 3, 3, 3, 63, 763, 763, 4763, 4763, 126, 127, 'FBAAAA', 'CDNAAA', 'AAAAxx'),
+(4424, 8869, 0, 0, 4, 4, 24, 424, 424, 4424, 4424, 48, 49, 'EOAAAA', 'DDNAAA', 'HHHHxx'),
+(8640, 8870, 0, 0, 0, 0, 40, 640, 640, 3640, 8640, 80, 81, 'IUAAAA', 'EDNAAA', 'OOOOxx'),
+(7187, 8871, 1, 3, 7, 7, 87, 187, 1187, 2187, 7187, 174, 175, 'LQAAAA', 'FDNAAA', 'VVVVxx'),
+(6247, 8872, 1, 3, 7, 7, 47, 247, 247, 1247, 6247, 94, 95, 'HGAAAA', 'GDNAAA', 'AAAAxx'),
+(7340, 8873, 0, 0, 0, 0, 40, 340, 1340, 2340, 7340, 80, 81, 'IWAAAA', 'HDNAAA', 'HHHHxx'),
+(182, 8874, 0, 2, 2, 2, 82, 182, 182, 182, 182, 164, 165, 'AHAAAA', 'IDNAAA', 'OOOOxx'),
+(2948, 8875, 0, 0, 8, 8, 48, 948, 948, 2948, 2948, 96, 97, 'KJAAAA', 'JDNAAA', 'VVVVxx'),
+(9462, 8876, 0, 2, 2, 2, 62, 462, 1462, 4462, 9462, 124, 125, 'YZAAAA', 'KDNAAA', 'AAAAxx'),
+(5997, 8877, 1, 1, 7, 17, 97, 997, 1997, 997, 5997, 194, 195, 'RWAAAA', 'LDNAAA', 'HHHHxx'),
+(5608, 8878, 0, 0, 8, 8, 8, 608, 1608, 608, 5608, 16, 17, 'SHAAAA', 'MDNAAA', 'OOOOxx'),
+(1472, 8879, 0, 0, 2, 12, 72, 472, 1472, 1472, 1472, 144, 145, 'QEAAAA', 'NDNAAA', 'VVVVxx'),
+(277, 8880, 1, 1, 7, 17, 77, 277, 277, 277, 277, 154, 155, 'RKAAAA', 'ODNAAA', 'AAAAxx'),
+(4807, 8881, 1, 3, 7, 7, 7, 807, 807, 4807, 4807, 14, 15, 'XCAAAA', 'PDNAAA', 'HHHHxx'),
+(4969, 8882, 1, 1, 9, 9, 69, 969, 969, 4969, 4969, 138, 139, 'DJAAAA', 'QDNAAA', 'OOOOxx'),
+(5611, 8883, 1, 3, 1, 11, 11, 611, 1611, 611, 5611, 22, 23, 'VHAAAA', 'RDNAAA', 'VVVVxx'),
+(372, 8884, 0, 0, 2, 12, 72, 372, 372, 372, 372, 144, 145, 'IOAAAA', 'SDNAAA', 'AAAAxx'),
+(6666, 8885, 0, 2, 6, 6, 66, 666, 666, 1666, 6666, 132, 133, 'KWAAAA', 'TDNAAA', 'HHHHxx'),
+(476, 8886, 0, 0, 6, 16, 76, 476, 476, 476, 476, 152, 153, 'ISAAAA', 'UDNAAA', 'OOOOxx'),
+(5225, 8887, 1, 1, 5, 5, 25, 225, 1225, 225, 5225, 50, 51, 'ZSAAAA', 'VDNAAA', 'VVVVxx'),
+(5143, 8888, 1, 3, 3, 3, 43, 143, 1143, 143, 5143, 86, 87, 'VPAAAA', 'WDNAAA', 'AAAAxx'),
+(1853, 8889, 1, 1, 3, 13, 53, 853, 1853, 1853, 1853, 106, 107, 'HTAAAA', 'XDNAAA', 'HHHHxx'),
+(675, 8890, 1, 3, 5, 15, 75, 675, 675, 675, 675, 150, 151, 'ZZAAAA', 'YDNAAA', 'OOOOxx'),
+(5643, 8891, 1, 3, 3, 3, 43, 643, 1643, 643, 5643, 86, 87, 'BJAAAA', 'ZDNAAA', 'VVVVxx'),
+(5317, 8892, 1, 1, 7, 17, 17, 317, 1317, 317, 5317, 34, 35, 'NWAAAA', 'AENAAA', 'AAAAxx'),
+(8102, 8893, 0, 2, 2, 2, 2, 102, 102, 3102, 8102, 4, 5, 'QZAAAA', 'BENAAA', 'HHHHxx'),
+(978, 8894, 0, 2, 8, 18, 78, 978, 978, 978, 978, 156, 157, 'QLAAAA', 'CENAAA', 'OOOOxx'),
+(4620, 8895, 0, 0, 0, 0, 20, 620, 620, 4620, 4620, 40, 41, 'SVAAAA', 'DENAAA', 'VVVVxx'),
+(151, 8896, 1, 3, 1, 11, 51, 151, 151, 151, 151, 102, 103, 'VFAAAA', 'EENAAA', 'AAAAxx'),
+(972, 8897, 0, 0, 2, 12, 72, 972, 972, 972, 972, 144, 145, 'KLAAAA', 'FENAAA', 'HHHHxx'),
+(6820, 8898, 0, 0, 0, 0, 20, 820, 820, 1820, 6820, 40, 41, 'ICAAAA', 'GENAAA', 'OOOOxx'),
+(7387, 8899, 1, 3, 7, 7, 87, 387, 1387, 2387, 7387, 174, 175, 'DYAAAA', 'HENAAA', 'VVVVxx'),
+(9634, 8900, 0, 2, 4, 14, 34, 634, 1634, 4634, 9634, 68, 69, 'OGAAAA', 'IENAAA', 'AAAAxx'),
+(6308, 8901, 0, 0, 8, 8, 8, 308, 308, 1308, 6308, 16, 17, 'QIAAAA', 'JENAAA', 'HHHHxx'),
+(8323, 8902, 1, 3, 3, 3, 23, 323, 323, 3323, 8323, 46, 47, 'DIAAAA', 'KENAAA', 'OOOOxx'),
+(6672, 8903, 0, 0, 2, 12, 72, 672, 672, 1672, 6672, 144, 145, 'QWAAAA', 'LENAAA', 'VVVVxx'),
+(8283, 8904, 1, 3, 3, 3, 83, 283, 283, 3283, 8283, 166, 167, 'PGAAAA', 'MENAAA', 'AAAAxx'),
+(7996, 8905, 0, 0, 6, 16, 96, 996, 1996, 2996, 7996, 192, 193, 'OVAAAA', 'NENAAA', 'HHHHxx'),
+(6488, 8906, 0, 0, 8, 8, 88, 488, 488, 1488, 6488, 176, 177, 'OPAAAA', 'OENAAA', 'OOOOxx'),
+(2365, 8907, 1, 1, 5, 5, 65, 365, 365, 2365, 2365, 130, 131, 'ZMAAAA', 'PENAAA', 'VVVVxx'),
+(9746, 8908, 0, 2, 6, 6, 46, 746, 1746, 4746, 9746, 92, 93, 'WKAAAA', 'QENAAA', 'AAAAxx'),
+(8605, 8909, 1, 1, 5, 5, 5, 605, 605, 3605, 8605, 10, 11, 'ZSAAAA', 'RENAAA', 'HHHHxx'),
+(3342, 8910, 0, 2, 2, 2, 42, 342, 1342, 3342, 3342, 84, 85, 'OYAAAA', 'SENAAA', 'OOOOxx'),
+(8429, 8911, 1, 1, 9, 9, 29, 429, 429, 3429, 8429, 58, 59, 'FMAAAA', 'TENAAA', 'VVVVxx'),
+(1162, 8912, 0, 2, 2, 2, 62, 162, 1162, 1162, 1162, 124, 125, 'SSAAAA', 'UENAAA', 'AAAAxx'),
+(531, 8913, 1, 3, 1, 11, 31, 531, 531, 531, 531, 62, 63, 'LUAAAA', 'VENAAA', 'HHHHxx'),
+(8408, 8914, 0, 0, 8, 8, 8, 408, 408, 3408, 8408, 16, 17, 'KLAAAA', 'WENAAA', 'OOOOxx'),
+(8862, 8915, 0, 2, 2, 2, 62, 862, 862, 3862, 8862, 124, 125, 'WCAAAA', 'XENAAA', 'VVVVxx'),
+(5843, 8916, 1, 3, 3, 3, 43, 843, 1843, 843, 5843, 86, 87, 'TQAAAA', 'YENAAA', 'AAAAxx'),
+(8704, 8917, 0, 0, 4, 4, 4, 704, 704, 3704, 8704, 8, 9, 'UWAAAA', 'ZENAAA', 'HHHHxx'),
+(7070, 8918, 0, 2, 0, 10, 70, 70, 1070, 2070, 7070, 140, 141, 'YLAAAA', 'AFNAAA', 'OOOOxx'),
+(9119, 8919, 1, 3, 9, 19, 19, 119, 1119, 4119, 9119, 38, 39, 'TMAAAA', 'BFNAAA', 'VVVVxx'),
+(8344, 8920, 0, 0, 4, 4, 44, 344, 344, 3344, 8344, 88, 89, 'YIAAAA', 'CFNAAA', 'AAAAxx'),
+(8979, 8921, 1, 3, 9, 19, 79, 979, 979, 3979, 8979, 158, 159, 'JHAAAA', 'DFNAAA', 'HHHHxx'),
+(2971, 8922, 1, 3, 1, 11, 71, 971, 971, 2971, 2971, 142, 143, 'HKAAAA', 'EFNAAA', 'OOOOxx'),
+(7700, 8923, 0, 0, 0, 0, 0, 700, 1700, 2700, 7700, 0, 1, 'EKAAAA', 'FFNAAA', 'VVVVxx'),
+(8280, 8924, 0, 0, 0, 0, 80, 280, 280, 3280, 8280, 160, 161, 'MGAAAA', 'GFNAAA', 'AAAAxx'),
+(9096, 8925, 0, 0, 6, 16, 96, 96, 1096, 4096, 9096, 192, 193, 'WLAAAA', 'HFNAAA', 'HHHHxx'),
+(99, 8926, 1, 3, 9, 19, 99, 99, 99, 99, 99, 198, 199, 'VDAAAA', 'IFNAAA', 'OOOOxx'),
+(6696, 8927, 0, 0, 6, 16, 96, 696, 696, 1696, 6696, 192, 193, 'OXAAAA', 'JFNAAA', 'VVVVxx'),
+(9490, 8928, 0, 2, 0, 10, 90, 490, 1490, 4490, 9490, 180, 181, 'ABAAAA', 'KFNAAA', 'AAAAxx'),
+(9073, 8929, 1, 1, 3, 13, 73, 73, 1073, 4073, 9073, 146, 147, 'ZKAAAA', 'LFNAAA', 'HHHHxx'),
+(1861, 8930, 1, 1, 1, 1, 61, 861, 1861, 1861, 1861, 122, 123, 'PTAAAA', 'MFNAAA', 'OOOOxx'),
+(4413, 8931, 1, 1, 3, 13, 13, 413, 413, 4413, 4413, 26, 27, 'TNAAAA', 'NFNAAA', 'VVVVxx'),
+(6002, 8932, 0, 2, 2, 2, 2, 2, 2, 1002, 6002, 4, 5, 'WWAAAA', 'OFNAAA', 'AAAAxx'),
+(439, 8933, 1, 3, 9, 19, 39, 439, 439, 439, 439, 78, 79, 'XQAAAA', 'PFNAAA', 'HHHHxx'),
+(5449, 8934, 1, 1, 9, 9, 49, 449, 1449, 449, 5449, 98, 99, 'PBAAAA', 'QFNAAA', 'OOOOxx'),
+(9737, 8935, 1, 1, 7, 17, 37, 737, 1737, 4737, 9737, 74, 75, 'NKAAAA', 'RFNAAA', 'VVVVxx'),
+(1898, 8936, 0, 2, 8, 18, 98, 898, 1898, 1898, 1898, 196, 197, 'AVAAAA', 'SFNAAA', 'AAAAxx'),
+(4189, 8937, 1, 1, 9, 9, 89, 189, 189, 4189, 4189, 178, 179, 'DFAAAA', 'TFNAAA', 'HHHHxx'),
+(1408, 8938, 0, 0, 8, 8, 8, 408, 1408, 1408, 1408, 16, 17, 'ECAAAA', 'UFNAAA', 'OOOOxx'),
+(394, 8939, 0, 2, 4, 14, 94, 394, 394, 394, 394, 188, 189, 'EPAAAA', 'VFNAAA', 'VVVVxx'),
+(1935, 8940, 1, 3, 5, 15, 35, 935, 1935, 1935, 1935, 70, 71, 'LWAAAA', 'WFNAAA', 'AAAAxx'),
+(3965, 8941, 1, 1, 5, 5, 65, 965, 1965, 3965, 3965, 130, 131, 'NWAAAA', 'XFNAAA', 'HHHHxx'),
+(6821, 8942, 1, 1, 1, 1, 21, 821, 821, 1821, 6821, 42, 43, 'JCAAAA', 'YFNAAA', 'OOOOxx'),
+(349, 8943, 1, 1, 9, 9, 49, 349, 349, 349, 349, 98, 99, 'LNAAAA', 'ZFNAAA', 'VVVVxx'),
+(8428, 8944, 0, 0, 8, 8, 28, 428, 428, 3428, 8428, 56, 57, 'EMAAAA', 'AGNAAA', 'AAAAxx'),
+(8200, 8945, 0, 0, 0, 0, 0, 200, 200, 3200, 8200, 0, 1, 'KDAAAA', 'BGNAAA', 'HHHHxx'),
+(1737, 8946, 1, 1, 7, 17, 37, 737, 1737, 1737, 1737, 74, 75, 'VOAAAA', 'CGNAAA', 'OOOOxx'),
+(6516, 8947, 0, 0, 6, 16, 16, 516, 516, 1516, 6516, 32, 33, 'QQAAAA', 'DGNAAA', 'VVVVxx'),
+(5441, 8948, 1, 1, 1, 1, 41, 441, 1441, 441, 5441, 82, 83, 'HBAAAA', 'EGNAAA', 'AAAAxx'),
+(5999, 8949, 1, 3, 9, 19, 99, 999, 1999, 999, 5999, 198, 199, 'TWAAAA', 'FGNAAA', 'HHHHxx'),
+(1539, 8950, 1, 3, 9, 19, 39, 539, 1539, 1539, 1539, 78, 79, 'FHAAAA', 'GGNAAA', 'OOOOxx'),
+(9067, 8951, 1, 3, 7, 7, 67, 67, 1067, 4067, 9067, 134, 135, 'TKAAAA', 'HGNAAA', 'VVVVxx'),
+(4061, 8952, 1, 1, 1, 1, 61, 61, 61, 4061, 4061, 122, 123, 'FAAAAA', 'IGNAAA', 'AAAAxx'),
+(1642, 8953, 0, 2, 2, 2, 42, 642, 1642, 1642, 1642, 84, 85, 'ELAAAA', 'JGNAAA', 'HHHHxx'),
+(4657, 8954, 1, 1, 7, 17, 57, 657, 657, 4657, 4657, 114, 115, 'DXAAAA', 'KGNAAA', 'OOOOxx'),
+(9934, 8955, 0, 2, 4, 14, 34, 934, 1934, 4934, 9934, 68, 69, 'CSAAAA', 'LGNAAA', 'VVVVxx'),
+(6385, 8956, 1, 1, 5, 5, 85, 385, 385, 1385, 6385, 170, 171, 'PLAAAA', 'MGNAAA', 'AAAAxx'),
+(6775, 8957, 1, 3, 5, 15, 75, 775, 775, 1775, 6775, 150, 151, 'PAAAAA', 'NGNAAA', 'HHHHxx'),
+(3873, 8958, 1, 1, 3, 13, 73, 873, 1873, 3873, 3873, 146, 147, 'ZSAAAA', 'OGNAAA', 'OOOOxx'),
+(3862, 8959, 0, 2, 2, 2, 62, 862, 1862, 3862, 3862, 124, 125, 'OSAAAA', 'PGNAAA', 'VVVVxx'),
+(1224, 8960, 0, 0, 4, 4, 24, 224, 1224, 1224, 1224, 48, 49, 'CVAAAA', 'QGNAAA', 'AAAAxx'),
+(4483, 8961, 1, 3, 3, 3, 83, 483, 483, 4483, 4483, 166, 167, 'LQAAAA', 'RGNAAA', 'HHHHxx'),
+(3685, 8962, 1, 1, 5, 5, 85, 685, 1685, 3685, 3685, 170, 171, 'TLAAAA', 'SGNAAA', 'OOOOxx'),
+(6082, 8963, 0, 2, 2, 2, 82, 82, 82, 1082, 6082, 164, 165, 'YZAAAA', 'TGNAAA', 'VVVVxx'),
+(7798, 8964, 0, 2, 8, 18, 98, 798, 1798, 2798, 7798, 196, 197, 'YNAAAA', 'UGNAAA', 'AAAAxx'),
+(9039, 8965, 1, 3, 9, 19, 39, 39, 1039, 4039, 9039, 78, 79, 'RJAAAA', 'VGNAAA', 'HHHHxx'),
+(985, 8966, 1, 1, 5, 5, 85, 985, 985, 985, 985, 170, 171, 'XLAAAA', 'WGNAAA', 'OOOOxx'),
+(5389, 8967, 1, 1, 9, 9, 89, 389, 1389, 389, 5389, 178, 179, 'HZAAAA', 'XGNAAA', 'VVVVxx'),
+(1716, 8968, 0, 0, 6, 16, 16, 716, 1716, 1716, 1716, 32, 33, 'AOAAAA', 'YGNAAA', 'AAAAxx'),
+(4209, 8969, 1, 1, 9, 9, 9, 209, 209, 4209, 4209, 18, 19, 'XFAAAA', 'ZGNAAA', 'HHHHxx'),
+(746, 8970, 0, 2, 6, 6, 46, 746, 746, 746, 746, 92, 93, 'SCAAAA', 'AHNAAA', 'OOOOxx'),
+(6295, 8971, 1, 3, 5, 15, 95, 295, 295, 1295, 6295, 190, 191, 'DIAAAA', 'BHNAAA', 'VVVVxx'),
+(9754, 8972, 0, 2, 4, 14, 54, 754, 1754, 4754, 9754, 108, 109, 'ELAAAA', 'CHNAAA', 'AAAAxx'),
+(2336, 8973, 0, 0, 6, 16, 36, 336, 336, 2336, 2336, 72, 73, 'WLAAAA', 'DHNAAA', 'HHHHxx'),
+(3701, 8974, 1, 1, 1, 1, 1, 701, 1701, 3701, 3701, 2, 3, 'JMAAAA', 'EHNAAA', 'OOOOxx'),
+(3551, 8975, 1, 3, 1, 11, 51, 551, 1551, 3551, 3551, 102, 103, 'PGAAAA', 'FHNAAA', 'VVVVxx'),
+(8516, 8976, 0, 0, 6, 16, 16, 516, 516, 3516, 8516, 32, 33, 'OPAAAA', 'GHNAAA', 'AAAAxx'),
+(9290, 8977, 0, 2, 0, 10, 90, 290, 1290, 4290, 9290, 180, 181, 'ITAAAA', 'HHNAAA', 'HHHHxx'),
+(5686, 8978, 0, 2, 6, 6, 86, 686, 1686, 686, 5686, 172, 173, 'SKAAAA', 'IHNAAA', 'OOOOxx'),
+(2893, 8979, 1, 1, 3, 13, 93, 893, 893, 2893, 2893, 186, 187, 'HHAAAA', 'JHNAAA', 'VVVVxx'),
+(6279, 8980, 1, 3, 9, 19, 79, 279, 279, 1279, 6279, 158, 159, 'NHAAAA', 'KHNAAA', 'AAAAxx'),
+(2278, 8981, 0, 2, 8, 18, 78, 278, 278, 2278, 2278, 156, 157, 'QJAAAA', 'LHNAAA', 'HHHHxx'),
+(1618, 8982, 0, 2, 8, 18, 18, 618, 1618, 1618, 1618, 36, 37, 'GKAAAA', 'MHNAAA', 'OOOOxx'),
+(3450, 8983, 0, 2, 0, 10, 50, 450, 1450, 3450, 3450, 100, 101, 'SCAAAA', 'NHNAAA', 'VVVVxx'),
+(8857, 8984, 1, 1, 7, 17, 57, 857, 857, 3857, 8857, 114, 115, 'RCAAAA', 'OHNAAA', 'AAAAxx'),
+(1005, 8985, 1, 1, 5, 5, 5, 5, 1005, 1005, 1005, 10, 11, 'RMAAAA', 'PHNAAA', 'HHHHxx'),
+(4727, 8986, 1, 3, 7, 7, 27, 727, 727, 4727, 4727, 54, 55, 'VZAAAA', 'QHNAAA', 'OOOOxx'),
+(7617, 8987, 1, 1, 7, 17, 17, 617, 1617, 2617, 7617, 34, 35, 'ZGAAAA', 'RHNAAA', 'VVVVxx'),
+(2021, 8988, 1, 1, 1, 1, 21, 21, 21, 2021, 2021, 42, 43, 'TZAAAA', 'SHNAAA', 'AAAAxx'),
+(9124, 8989, 0, 0, 4, 4, 24, 124, 1124, 4124, 9124, 48, 49, 'YMAAAA', 'THNAAA', 'HHHHxx'),
+(3175, 8990, 1, 3, 5, 15, 75, 175, 1175, 3175, 3175, 150, 151, 'DSAAAA', 'UHNAAA', 'OOOOxx'),
+(2949, 8991, 1, 1, 9, 9, 49, 949, 949, 2949, 2949, 98, 99, 'LJAAAA', 'VHNAAA', 'VVVVxx'),
+(2424, 8992, 0, 0, 4, 4, 24, 424, 424, 2424, 2424, 48, 49, 'GPAAAA', 'WHNAAA', 'AAAAxx'),
+(4791, 8993, 1, 3, 1, 11, 91, 791, 791, 4791, 4791, 182, 183, 'HCAAAA', 'XHNAAA', 'HHHHxx'),
+(7500, 8994, 0, 0, 0, 0, 0, 500, 1500, 2500, 7500, 0, 1, 'MCAAAA', 'YHNAAA', 'OOOOxx'),
+(4893, 8995, 1, 1, 3, 13, 93, 893, 893, 4893, 4893, 186, 187, 'FGAAAA', 'ZHNAAA', 'VVVVxx'),
+(121, 8996, 1, 1, 1, 1, 21, 121, 121, 121, 121, 42, 43, 'REAAAA', 'AINAAA', 'AAAAxx'),
+(1965, 8997, 1, 1, 5, 5, 65, 965, 1965, 1965, 1965, 130, 131, 'PXAAAA', 'BINAAA', 'HHHHxx'),
+(2972, 8998, 0, 0, 2, 12, 72, 972, 972, 2972, 2972, 144, 145, 'IKAAAA', 'CINAAA', 'OOOOxx'),
+(662, 8999, 0, 2, 2, 2, 62, 662, 662, 662, 662, 124, 125, 'MZAAAA', 'DINAAA', 'VVVVxx');
+
+INSERT INTO tenk2 VALUES
+(7074, 9000, 0, 2, 4, 14, 74, 74, 1074, 2074, 7074, 148, 149, 'CMAAAA', 'EINAAA', 'AAAAxx'),
+(981, 9001, 1, 1, 1, 1, 81, 981, 981, 981, 981, 162, 163, 'TLAAAA', 'FINAAA', 'HHHHxx'),
+(3520, 9002, 0, 0, 0, 0, 20, 520, 1520, 3520, 3520, 40, 41, 'KFAAAA', 'GINAAA', 'OOOOxx'),
+(6540, 9003, 0, 0, 0, 0, 40, 540, 540, 1540, 6540, 80, 81, 'ORAAAA', 'HINAAA', 'VVVVxx'),
+(6648, 9004, 0, 0, 8, 8, 48, 648, 648, 1648, 6648, 96, 97, 'SVAAAA', 'IINAAA', 'AAAAxx'),
+(7076, 9005, 0, 0, 6, 16, 76, 76, 1076, 2076, 7076, 152, 153, 'EMAAAA', 'JINAAA', 'HHHHxx'),
+(6919, 9006, 1, 3, 9, 19, 19, 919, 919, 1919, 6919, 38, 39, 'DGAAAA', 'KINAAA', 'OOOOxx'),
+(1108, 9007, 0, 0, 8, 8, 8, 108, 1108, 1108, 1108, 16, 17, 'QQAAAA', 'LINAAA', 'VVVVxx'),
+(317, 9008, 1, 1, 7, 17, 17, 317, 317, 317, 317, 34, 35, 'FMAAAA', 'MINAAA', 'AAAAxx'),
+(3483, 9009, 1, 3, 3, 3, 83, 483, 1483, 3483, 3483, 166, 167, 'ZDAAAA', 'NINAAA', 'HHHHxx'),
+(6764, 9010, 0, 0, 4, 4, 64, 764, 764, 1764, 6764, 128, 129, 'EAAAAA', 'OINAAA', 'OOOOxx'),
+(1235, 9011, 1, 3, 5, 15, 35, 235, 1235, 1235, 1235, 70, 71, 'NVAAAA', 'PINAAA', 'VVVVxx'),
+(7121, 9012, 1, 1, 1, 1, 21, 121, 1121, 2121, 7121, 42, 43, 'XNAAAA', 'QINAAA', 'AAAAxx'),
+(426, 9013, 0, 2, 6, 6, 26, 426, 426, 426, 426, 52, 53, 'KQAAAA', 'RINAAA', 'HHHHxx'),
+(6880, 9014, 0, 0, 0, 0, 80, 880, 880, 1880, 6880, 160, 161, 'QEAAAA', 'SINAAA', 'OOOOxx'),
+(5401, 9015, 1, 1, 1, 1, 1, 401, 1401, 401, 5401, 2, 3, 'TZAAAA', 'TINAAA', 'VVVVxx'),
+(7323, 9016, 1, 3, 3, 3, 23, 323, 1323, 2323, 7323, 46, 47, 'RVAAAA', 'UINAAA', 'AAAAxx'),
+(9751, 9017, 1, 3, 1, 11, 51, 751, 1751, 4751, 9751, 102, 103, 'BLAAAA', 'VINAAA', 'HHHHxx'),
+(3436, 9018, 0, 0, 6, 16, 36, 436, 1436, 3436, 3436, 72, 73, 'ECAAAA', 'WINAAA', 'OOOOxx'),
+(7319, 9019, 1, 3, 9, 19, 19, 319, 1319, 2319, 7319, 38, 39, 'NVAAAA', 'XINAAA', 'VVVVxx'),
+(7882, 9020, 0, 2, 2, 2, 82, 882, 1882, 2882, 7882, 164, 165, 'ERAAAA', 'YINAAA', 'AAAAxx'),
+(8260, 9021, 0, 0, 0, 0, 60, 260, 260, 3260, 8260, 120, 121, 'SFAAAA', 'ZINAAA', 'HHHHxx'),
+(9758, 9022, 0, 2, 8, 18, 58, 758, 1758, 4758, 9758, 116, 117, 'ILAAAA', 'AJNAAA', 'OOOOxx'),
+(4205, 9023, 1, 1, 5, 5, 5, 205, 205, 4205, 4205, 10, 11, 'TFAAAA', 'BJNAAA', 'VVVVxx'),
+(8884, 9024, 0, 0, 4, 4, 84, 884, 884, 3884, 8884, 168, 169, 'SDAAAA', 'CJNAAA', 'AAAAxx'),
+(1112, 9025, 0, 0, 2, 12, 12, 112, 1112, 1112, 1112, 24, 25, 'UQAAAA', 'DJNAAA', 'HHHHxx'),
+(2186, 9026, 0, 2, 6, 6, 86, 186, 186, 2186, 2186, 172, 173, 'CGAAAA', 'EJNAAA', 'OOOOxx'),
+(8666, 9027, 0, 2, 6, 6, 66, 666, 666, 3666, 8666, 132, 133, 'IVAAAA', 'FJNAAA', 'VVVVxx'),
+(4325, 9028, 1, 1, 5, 5, 25, 325, 325, 4325, 4325, 50, 51, 'JKAAAA', 'GJNAAA', 'AAAAxx'),
+(4912, 9029, 0, 0, 2, 12, 12, 912, 912, 4912, 4912, 24, 25, 'YGAAAA', 'HJNAAA', 'HHHHxx'),
+(6497, 9030, 1, 1, 7, 17, 97, 497, 497, 1497, 6497, 194, 195, 'XPAAAA', 'IJNAAA', 'OOOOxx'),
+(9072, 9031, 0, 0, 2, 12, 72, 72, 1072, 4072, 9072, 144, 145, 'YKAAAA', 'JJNAAA', 'VVVVxx'),
+(8899, 9032, 1, 3, 9, 19, 99, 899, 899, 3899, 8899, 198, 199, 'HEAAAA', 'KJNAAA', 'AAAAxx'),
+(5619, 9033, 1, 3, 9, 19, 19, 619, 1619, 619, 5619, 38, 39, 'DIAAAA', 'LJNAAA', 'HHHHxx'),
+(4110, 9034, 0, 2, 0, 10, 10, 110, 110, 4110, 4110, 20, 21, 'CCAAAA', 'MJNAAA', 'OOOOxx'),
+(7025, 9035, 1, 1, 5, 5, 25, 25, 1025, 2025, 7025, 50, 51, 'FKAAAA', 'NJNAAA', 'VVVVxx'),
+(5605, 9036, 1, 1, 5, 5, 5, 605, 1605, 605, 5605, 10, 11, 'PHAAAA', 'OJNAAA', 'AAAAxx'),
+(2572, 9037, 0, 0, 2, 12, 72, 572, 572, 2572, 2572, 144, 145, 'YUAAAA', 'PJNAAA', 'HHHHxx'),
+(3895, 9038, 1, 3, 5, 15, 95, 895, 1895, 3895, 3895, 190, 191, 'VTAAAA', 'QJNAAA', 'OOOOxx'),
+(9138, 9039, 0, 2, 8, 18, 38, 138, 1138, 4138, 9138, 76, 77, 'MNAAAA', 'RJNAAA', 'VVVVxx'),
+(4713, 9040, 1, 1, 3, 13, 13, 713, 713, 4713, 4713, 26, 27, 'HZAAAA', 'SJNAAA', 'AAAAxx'),
+(6079, 9041, 1, 3, 9, 19, 79, 79, 79, 1079, 6079, 158, 159, 'VZAAAA', 'TJNAAA', 'HHHHxx'),
+(8898, 9042, 0, 2, 8, 18, 98, 898, 898, 3898, 8898, 196, 197, 'GEAAAA', 'UJNAAA', 'OOOOxx'),
+(2650, 9043, 0, 2, 0, 10, 50, 650, 650, 2650, 2650, 100, 101, 'YXAAAA', 'VJNAAA', 'VVVVxx'),
+(5316, 9044, 0, 0, 6, 16, 16, 316, 1316, 316, 5316, 32, 33, 'MWAAAA', 'WJNAAA', 'AAAAxx'),
+(5133, 9045, 1, 1, 3, 13, 33, 133, 1133, 133, 5133, 66, 67, 'LPAAAA', 'XJNAAA', 'HHHHxx'),
+(2184, 9046, 0, 0, 4, 4, 84, 184, 184, 2184, 2184, 168, 169, 'AGAAAA', 'YJNAAA', 'OOOOxx'),
+(2728, 9047, 0, 0, 8, 8, 28, 728, 728, 2728, 2728, 56, 57, 'YAAAAA', 'ZJNAAA', 'VVVVxx'),
+(6737, 9048, 1, 1, 7, 17, 37, 737, 737, 1737, 6737, 74, 75, 'DZAAAA', 'AKNAAA', 'AAAAxx'),
+(1128, 9049, 0, 0, 8, 8, 28, 128, 1128, 1128, 1128, 56, 57, 'KRAAAA', 'BKNAAA', 'HHHHxx'),
+(9662, 9050, 0, 2, 2, 2, 62, 662, 1662, 4662, 9662, 124, 125, 'QHAAAA', 'CKNAAA', 'OOOOxx'),
+(9384, 9051, 0, 0, 4, 4, 84, 384, 1384, 4384, 9384, 168, 169, 'YWAAAA', 'DKNAAA', 'VVVVxx'),
+(4576, 9052, 0, 0, 6, 16, 76, 576, 576, 4576, 4576, 152, 153, 'AUAAAA', 'EKNAAA', 'AAAAxx'),
+(9613, 9053, 1, 1, 3, 13, 13, 613, 1613, 4613, 9613, 26, 27, 'TFAAAA', 'FKNAAA', 'HHHHxx'),
+(4001, 9054, 1, 1, 1, 1, 1, 1, 1, 4001, 4001, 2, 3, 'XXAAAA', 'GKNAAA', 'OOOOxx'),
+(3628, 9055, 0, 0, 8, 8, 28, 628, 1628, 3628, 3628, 56, 57, 'OJAAAA', 'HKNAAA', 'VVVVxx'),
+(6968, 9056, 0, 0, 8, 8, 68, 968, 968, 1968, 6968, 136, 137, 'AIAAAA', 'IKNAAA', 'AAAAxx'),
+(6491, 9057, 1, 3, 1, 11, 91, 491, 491, 1491, 6491, 182, 183, 'RPAAAA', 'JKNAAA', 'HHHHxx'),
+(1265, 9058, 1, 1, 5, 5, 65, 265, 1265, 1265, 1265, 130, 131, 'RWAAAA', 'KKNAAA', 'OOOOxx'),
+(6128, 9059, 0, 0, 8, 8, 28, 128, 128, 1128, 6128, 56, 57, 'SBAAAA', 'LKNAAA', 'VVVVxx'),
+(4274, 9060, 0, 2, 4, 14, 74, 274, 274, 4274, 4274, 148, 149, 'KIAAAA', 'MKNAAA', 'AAAAxx'),
+(3598, 9061, 0, 2, 8, 18, 98, 598, 1598, 3598, 3598, 196, 197, 'KIAAAA', 'NKNAAA', 'HHHHxx'),
+(7961, 9062, 1, 1, 1, 1, 61, 961, 1961, 2961, 7961, 122, 123, 'FUAAAA', 'OKNAAA', 'OOOOxx'),
+(2643, 9063, 1, 3, 3, 3, 43, 643, 643, 2643, 2643, 86, 87, 'RXAAAA', 'PKNAAA', 'VVVVxx'),
+(4547, 9064, 1, 3, 7, 7, 47, 547, 547, 4547, 4547, 94, 95, 'XSAAAA', 'QKNAAA', 'AAAAxx'),
+(3568, 9065, 0, 0, 8, 8, 68, 568, 1568, 3568, 3568, 136, 137, 'GHAAAA', 'RKNAAA', 'HHHHxx'),
+(8954, 9066, 0, 2, 4, 14, 54, 954, 954, 3954, 8954, 108, 109, 'KGAAAA', 'SKNAAA', 'OOOOxx'),
+(8802, 9067, 0, 2, 2, 2, 2, 802, 802, 3802, 8802, 4, 5, 'OAAAAA', 'TKNAAA', 'VVVVxx'),
+(7829, 9068, 1, 1, 9, 9, 29, 829, 1829, 2829, 7829, 58, 59, 'DPAAAA', 'UKNAAA', 'AAAAxx'),
+(1008, 9069, 0, 0, 8, 8, 8, 8, 1008, 1008, 1008, 16, 17, 'UMAAAA', 'VKNAAA', 'HHHHxx'),
+(3627, 9070, 1, 3, 7, 7, 27, 627, 1627, 3627, 3627, 54, 55, 'NJAAAA', 'WKNAAA', 'OOOOxx'),
+(3999, 9071, 1, 3, 9, 19, 99, 999, 1999, 3999, 3999, 198, 199, 'VXAAAA', 'XKNAAA', 'VVVVxx'),
+(7697, 9072, 1, 1, 7, 17, 97, 697, 1697, 2697, 7697, 194, 195, 'BKAAAA', 'YKNAAA', 'AAAAxx'),
+(9380, 9073, 0, 0, 0, 0, 80, 380, 1380, 4380, 9380, 160, 161, 'UWAAAA', 'ZKNAAA', 'HHHHxx'),
+(2707, 9074, 1, 3, 7, 7, 7, 707, 707, 2707, 2707, 14, 15, 'DAAAAA', 'ALNAAA', 'OOOOxx'),
+(4430, 9075, 0, 2, 0, 10, 30, 430, 430, 4430, 4430, 60, 61, 'KOAAAA', 'BLNAAA', 'VVVVxx'),
+(6440, 9076, 0, 0, 0, 0, 40, 440, 440, 1440, 6440, 80, 81, 'SNAAAA', 'CLNAAA', 'AAAAxx'),
+(9958, 9077, 0, 2, 8, 18, 58, 958, 1958, 4958, 9958, 116, 117, 'ATAAAA', 'DLNAAA', 'HHHHxx'),
+(7592, 9078, 0, 0, 2, 12, 92, 592, 1592, 2592, 7592, 184, 185, 'AGAAAA', 'ELNAAA', 'OOOOxx'),
+(7852, 9079, 0, 0, 2, 12, 52, 852, 1852, 2852, 7852, 104, 105, 'AQAAAA', 'FLNAAA', 'VVVVxx'),
+(9253, 9080, 1, 1, 3, 13, 53, 253, 1253, 4253, 9253, 106, 107, 'XRAAAA', 'GLNAAA', 'AAAAxx'),
+(5910, 9081, 0, 2, 0, 10, 10, 910, 1910, 910, 5910, 20, 21, 'ITAAAA', 'HLNAAA', 'HHHHxx'),
+(7487, 9082, 1, 3, 7, 7, 87, 487, 1487, 2487, 7487, 174, 175, 'ZBAAAA', 'ILNAAA', 'OOOOxx'),
+(6324, 9083, 0, 0, 4, 4, 24, 324, 324, 1324, 6324, 48, 49, 'GJAAAA', 'JLNAAA', 'VVVVxx'),
+(5792, 9084, 0, 0, 2, 12, 92, 792, 1792, 792, 5792, 184, 185, 'UOAAAA', 'KLNAAA', 'AAAAxx'),
+(7390, 9085, 0, 2, 0, 10, 90, 390, 1390, 2390, 7390, 180, 181, 'GYAAAA', 'LLNAAA', 'HHHHxx'),
+(8534, 9086, 0, 2, 4, 14, 34, 534, 534, 3534, 8534, 68, 69, 'GQAAAA', 'MLNAAA', 'OOOOxx'),
+(2690, 9087, 0, 2, 0, 10, 90, 690, 690, 2690, 2690, 180, 181, 'MZAAAA', 'NLNAAA', 'VVVVxx'),
+(3992, 9088, 0, 0, 2, 12, 92, 992, 1992, 3992, 3992, 184, 185, 'OXAAAA', 'OLNAAA', 'AAAAxx'),
+(6928, 9089, 0, 0, 8, 8, 28, 928, 928, 1928, 6928, 56, 57, 'MGAAAA', 'PLNAAA', 'HHHHxx'),
+(7815, 9090, 1, 3, 5, 15, 15, 815, 1815, 2815, 7815, 30, 31, 'POAAAA', 'QLNAAA', 'OOOOxx'),
+(9477, 9091, 1, 1, 7, 17, 77, 477, 1477, 4477, 9477, 154, 155, 'NAAAAA', 'RLNAAA', 'VVVVxx'),
+(497, 9092, 1, 1, 7, 17, 97, 497, 497, 497, 497, 194, 195, 'DTAAAA', 'SLNAAA', 'AAAAxx'),
+(7532, 9093, 0, 0, 2, 12, 32, 532, 1532, 2532, 7532, 64, 65, 'SDAAAA', 'TLNAAA', 'HHHHxx'),
+(9838, 9094, 0, 2, 8, 18, 38, 838, 1838, 4838, 9838, 76, 77, 'KOAAAA', 'ULNAAA', 'OOOOxx'),
+(1557, 9095, 1, 1, 7, 17, 57, 557, 1557, 1557, 1557, 114, 115, 'XHAAAA', 'VLNAAA', 'VVVVxx'),
+(2467, 9096, 1, 3, 7, 7, 67, 467, 467, 2467, 2467, 134, 135, 'XQAAAA', 'WLNAAA', 'AAAAxx'),
+(2367, 9097, 1, 3, 7, 7, 67, 367, 367, 2367, 2367, 134, 135, 'BNAAAA', 'XLNAAA', 'HHHHxx'),
+(5677, 9098, 1, 1, 7, 17, 77, 677, 1677, 677, 5677, 154, 155, 'JKAAAA', 'YLNAAA', 'OOOOxx'),
+(6193, 9099, 1, 1, 3, 13, 93, 193, 193, 1193, 6193, 186, 187, 'FEAAAA', 'ZLNAAA', 'VVVVxx'),
+(7126, 9100, 0, 2, 6, 6, 26, 126, 1126, 2126, 7126, 52, 53, 'COAAAA', 'AMNAAA', 'AAAAxx'),
+(5264, 9101, 0, 0, 4, 4, 64, 264, 1264, 264, 5264, 128, 129, 'MUAAAA', 'BMNAAA', 'HHHHxx'),
+(850, 9102, 0, 2, 0, 10, 50, 850, 850, 850, 850, 100, 101, 'SGAAAA', 'CMNAAA', 'OOOOxx'),
+(4854, 9103, 0, 2, 4, 14, 54, 854, 854, 4854, 4854, 108, 109, 'SEAAAA', 'DMNAAA', 'VVVVxx'),
+(4414, 9104, 0, 2, 4, 14, 14, 414, 414, 4414, 4414, 28, 29, 'UNAAAA', 'EMNAAA', 'AAAAxx'),
+(8971, 9105, 1, 3, 1, 11, 71, 971, 971, 3971, 8971, 142, 143, 'BHAAAA', 'FMNAAA', 'HHHHxx'),
+(9240, 9106, 0, 0, 0, 0, 40, 240, 1240, 4240, 9240, 80, 81, 'KRAAAA', 'GMNAAA', 'OOOOxx'),
+(7341, 9107, 1, 1, 1, 1, 41, 341, 1341, 2341, 7341, 82, 83, 'JWAAAA', 'HMNAAA', 'VVVVxx'),
+(3151, 9108, 1, 3, 1, 11, 51, 151, 1151, 3151, 3151, 102, 103, 'FRAAAA', 'IMNAAA', 'AAAAxx'),
+(1742, 9109, 0, 2, 2, 2, 42, 742, 1742, 1742, 1742, 84, 85, 'APAAAA', 'JMNAAA', 'HHHHxx'),
+(1347, 9110, 1, 3, 7, 7, 47, 347, 1347, 1347, 1347, 94, 95, 'VZAAAA', 'KMNAAA', 'OOOOxx'),
+(9418, 9111, 0, 2, 8, 18, 18, 418, 1418, 4418, 9418, 36, 37, 'GYAAAA', 'LMNAAA', 'VVVVxx'),
+(5452, 9112, 0, 0, 2, 12, 52, 452, 1452, 452, 5452, 104, 105, 'SBAAAA', 'MMNAAA', 'AAAAxx'),
+(8637, 9113, 1, 1, 7, 17, 37, 637, 637, 3637, 8637, 74, 75, 'FUAAAA', 'NMNAAA', 'HHHHxx'),
+(8287, 9114, 1, 3, 7, 7, 87, 287, 287, 3287, 8287, 174, 175, 'TGAAAA', 'OMNAAA', 'OOOOxx'),
+(9865, 9115, 1, 1, 5, 5, 65, 865, 1865, 4865, 9865, 130, 131, 'LPAAAA', 'PMNAAA', 'VVVVxx'),
+(1664, 9116, 0, 0, 4, 4, 64, 664, 1664, 1664, 1664, 128, 129, 'AMAAAA', 'QMNAAA', 'AAAAxx'),
+(9933, 9117, 1, 1, 3, 13, 33, 933, 1933, 4933, 9933, 66, 67, 'BSAAAA', 'RMNAAA', 'HHHHxx'),
+(3416, 9118, 0, 0, 6, 16, 16, 416, 1416, 3416, 3416, 32, 33, 'KBAAAA', 'SMNAAA', 'OOOOxx'),
+(7981, 9119, 1, 1, 1, 1, 81, 981, 1981, 2981, 7981, 162, 163, 'ZUAAAA', 'TMNAAA', 'VVVVxx'),
+(1981, 9120, 1, 1, 1, 1, 81, 981, 1981, 1981, 1981, 162, 163, 'FYAAAA', 'UMNAAA', 'AAAAxx'),
+(441, 9121, 1, 1, 1, 1, 41, 441, 441, 441, 441, 82, 83, 'ZQAAAA', 'VMNAAA', 'HHHHxx'),
+(1380, 9122, 0, 0, 0, 0, 80, 380, 1380, 1380, 1380, 160, 161, 'CBAAAA', 'WMNAAA', 'OOOOxx'),
+(7325, 9123, 1, 1, 5, 5, 25, 325, 1325, 2325, 7325, 50, 51, 'TVAAAA', 'XMNAAA', 'VVVVxx'),
+(5682, 9124, 0, 2, 2, 2, 82, 682, 1682, 682, 5682, 164, 165, 'OKAAAA', 'YMNAAA', 'AAAAxx'),
+(1024, 9125, 0, 0, 4, 4, 24, 24, 1024, 1024, 1024, 48, 49, 'KNAAAA', 'ZMNAAA', 'HHHHxx'),
+(1096, 9126, 0, 0, 6, 16, 96, 96, 1096, 1096, 1096, 192, 193, 'EQAAAA', 'ANNAAA', 'OOOOxx'),
+(4717, 9127, 1, 1, 7, 17, 17, 717, 717, 4717, 4717, 34, 35, 'LZAAAA', 'BNNAAA', 'VVVVxx'),
+(7948, 9128, 0, 0, 8, 8, 48, 948, 1948, 2948, 7948, 96, 97, 'STAAAA', 'CNNAAA', 'AAAAxx'),
+(4074, 9129, 0, 2, 4, 14, 74, 74, 74, 4074, 4074, 148, 149, 'SAAAAA', 'DNNAAA', 'HHHHxx'),
+(211, 9130, 1, 3, 1, 11, 11, 211, 211, 211, 211, 22, 23, 'DIAAAA', 'ENNAAA', 'OOOOxx'),
+(8993, 9131, 1, 1, 3, 13, 93, 993, 993, 3993, 8993, 186, 187, 'XHAAAA', 'FNNAAA', 'VVVVxx'),
+(4509, 9132, 1, 1, 9, 9, 9, 509, 509, 4509, 4509, 18, 19, 'LRAAAA', 'GNNAAA', 'AAAAxx'),
+(823, 9133, 1, 3, 3, 3, 23, 823, 823, 823, 823, 46, 47, 'RFAAAA', 'HNNAAA', 'HHHHxx'),
+(4747, 9134, 1, 3, 7, 7, 47, 747, 747, 4747, 4747, 94, 95, 'PAAAAA', 'INNAAA', 'OOOOxx'),
+(6955, 9135, 1, 3, 5, 15, 55, 955, 955, 1955, 6955, 110, 111, 'NHAAAA', 'JNNAAA', 'VVVVxx'),
+(7922, 9136, 0, 2, 2, 2, 22, 922, 1922, 2922, 7922, 44, 45, 'SSAAAA', 'KNNAAA', 'AAAAxx'),
+(6936, 9137, 0, 0, 6, 16, 36, 936, 936, 1936, 6936, 72, 73, 'UGAAAA', 'LNNAAA', 'HHHHxx'),
+(1546, 9138, 0, 2, 6, 6, 46, 546, 1546, 1546, 1546, 92, 93, 'MHAAAA', 'MNNAAA', 'OOOOxx'),
+(9836, 9139, 0, 0, 6, 16, 36, 836, 1836, 4836, 9836, 72, 73, 'IOAAAA', 'NNNAAA', 'VVVVxx'),
+(5626, 9140, 0, 2, 6, 6, 26, 626, 1626, 626, 5626, 52, 53, 'KIAAAA', 'ONNAAA', 'AAAAxx'),
+(4879, 9141, 1, 3, 9, 19, 79, 879, 879, 4879, 4879, 158, 159, 'RFAAAA', 'PNNAAA', 'HHHHxx'),
+(8590, 9142, 0, 2, 0, 10, 90, 590, 590, 3590, 8590, 180, 181, 'KSAAAA', 'QNNAAA', 'OOOOxx'),
+(8842, 9143, 0, 2, 2, 2, 42, 842, 842, 3842, 8842, 84, 85, 'CCAAAA', 'RNNAAA', 'VVVVxx'),
+(6505, 9144, 1, 1, 5, 5, 5, 505, 505, 1505, 6505, 10, 11, 'FQAAAA', 'SNNAAA', 'AAAAxx'),
+(2803, 9145, 1, 3, 3, 3, 3, 803, 803, 2803, 2803, 6, 7, 'VDAAAA', 'TNNAAA', 'HHHHxx'),
+(9258, 9146, 0, 2, 8, 18, 58, 258, 1258, 4258, 9258, 116, 117, 'CSAAAA', 'UNNAAA', 'OOOOxx'),
+(741, 9147, 1, 1, 1, 1, 41, 741, 741, 741, 741, 82, 83, 'NCAAAA', 'VNNAAA', 'VVVVxx'),
+(1457, 9148, 1, 1, 7, 17, 57, 457, 1457, 1457, 1457, 114, 115, 'BEAAAA', 'WNNAAA', 'AAAAxx'),
+(5777, 9149, 1, 1, 7, 17, 77, 777, 1777, 777, 5777, 154, 155, 'FOAAAA', 'XNNAAA', 'HHHHxx'),
+(2883, 9150, 1, 3, 3, 3, 83, 883, 883, 2883, 2883, 166, 167, 'XGAAAA', 'YNNAAA', 'OOOOxx'),
+(6610, 9151, 0, 2, 0, 10, 10, 610, 610, 1610, 6610, 20, 21, 'GUAAAA', 'ZNNAAA', 'VVVVxx'),
+(4331, 9152, 1, 3, 1, 11, 31, 331, 331, 4331, 4331, 62, 63, 'PKAAAA', 'AONAAA', 'AAAAxx'),
+(2712, 9153, 0, 0, 2, 12, 12, 712, 712, 2712, 2712, 24, 25, 'IAAAAA', 'BONAAA', 'HHHHxx'),
+(9268, 9154, 0, 0, 8, 8, 68, 268, 1268, 4268, 9268, 136, 137, 'MSAAAA', 'CONAAA', 'OOOOxx'),
+(410, 9155, 0, 2, 0, 10, 10, 410, 410, 410, 410, 20, 21, 'UPAAAA', 'DONAAA', 'VVVVxx'),
+(9411, 9156, 1, 3, 1, 11, 11, 411, 1411, 4411, 9411, 22, 23, 'ZXAAAA', 'EONAAA', 'AAAAxx'),
+(4683, 9157, 1, 3, 3, 3, 83, 683, 683, 4683, 4683, 166, 167, 'DYAAAA', 'FONAAA', 'HHHHxx'),
+(7072, 9158, 0, 0, 2, 12, 72, 72, 1072, 2072, 7072, 144, 145, 'AMAAAA', 'GONAAA', 'OOOOxx'),
+(5050, 9159, 0, 2, 0, 10, 50, 50, 1050, 50, 5050, 100, 101, 'GMAAAA', 'HONAAA', 'VVVVxx'),
+(5932, 9160, 0, 0, 2, 12, 32, 932, 1932, 932, 5932, 64, 65, 'EUAAAA', 'IONAAA', 'AAAAxx'),
+(2756, 9161, 0, 0, 6, 16, 56, 756, 756, 2756, 2756, 112, 113, 'ACAAAA', 'JONAAA', 'HHHHxx'),
+(9813, 9162, 1, 1, 3, 13, 13, 813, 1813, 4813, 9813, 26, 27, 'LNAAAA', 'KONAAA', 'OOOOxx'),
+(7388, 9163, 0, 0, 8, 8, 88, 388, 1388, 2388, 7388, 176, 177, 'EYAAAA', 'LONAAA', 'VVVVxx'),
+(2596, 9164, 0, 0, 6, 16, 96, 596, 596, 2596, 2596, 192, 193, 'WVAAAA', 'MONAAA', 'AAAAxx'),
+(5102, 9165, 0, 2, 2, 2, 2, 102, 1102, 102, 5102, 4, 5, 'GOAAAA', 'NONAAA', 'HHHHxx'),
+(208, 9166, 0, 0, 8, 8, 8, 208, 208, 208, 208, 16, 17, 'AIAAAA', 'OONAAA', 'OOOOxx'),
+(86, 9167, 0, 2, 6, 6, 86, 86, 86, 86, 86, 172, 173, 'IDAAAA', 'PONAAA', 'VVVVxx'),
+(8127, 9168, 1, 3, 7, 7, 27, 127, 127, 3127, 8127, 54, 55, 'PAAAAA', 'QONAAA', 'AAAAxx'),
+(5154, 9169, 0, 2, 4, 14, 54, 154, 1154, 154, 5154, 108, 109, 'GQAAAA', 'RONAAA', 'HHHHxx'),
+(4491, 9170, 1, 3, 1, 11, 91, 491, 491, 4491, 4491, 182, 183, 'TQAAAA', 'SONAAA', 'OOOOxx'),
+(7423, 9171, 1, 3, 3, 3, 23, 423, 1423, 2423, 7423, 46, 47, 'NZAAAA', 'TONAAA', 'VVVVxx'),
+(6441, 9172, 1, 1, 1, 1, 41, 441, 441, 1441, 6441, 82, 83, 'TNAAAA', 'UONAAA', 'AAAAxx'),
+(2920, 9173, 0, 0, 0, 0, 20, 920, 920, 2920, 2920, 40, 41, 'IIAAAA', 'VONAAA', 'HHHHxx'),
+(6386, 9174, 0, 2, 6, 6, 86, 386, 386, 1386, 6386, 172, 173, 'QLAAAA', 'WONAAA', 'OOOOxx'),
+(9744, 9175, 0, 0, 4, 4, 44, 744, 1744, 4744, 9744, 88, 89, 'UKAAAA', 'XONAAA', 'VVVVxx'),
+(2667, 9176, 1, 3, 7, 7, 67, 667, 667, 2667, 2667, 134, 135, 'PYAAAA', 'YONAAA', 'AAAAxx'),
+(5754, 9177, 0, 2, 4, 14, 54, 754, 1754, 754, 5754, 108, 109, 'INAAAA', 'ZONAAA', 'HHHHxx'),
+(4645, 9178, 1, 1, 5, 5, 45, 645, 645, 4645, 4645, 90, 91, 'RWAAAA', 'APNAAA', 'OOOOxx'),
+(4327, 9179, 1, 3, 7, 7, 27, 327, 327, 4327, 4327, 54, 55, 'LKAAAA', 'BPNAAA', 'VVVVxx'),
+(843, 9180, 1, 3, 3, 3, 43, 843, 843, 843, 843, 86, 87, 'LGAAAA', 'CPNAAA', 'AAAAxx'),
+(4085, 9181, 1, 1, 5, 5, 85, 85, 85, 4085, 4085, 170, 171, 'DBAAAA', 'DPNAAA', 'HHHHxx'),
+(2849, 9182, 1, 1, 9, 9, 49, 849, 849, 2849, 2849, 98, 99, 'PFAAAA', 'EPNAAA', 'OOOOxx'),
+(5734, 9183, 0, 2, 4, 14, 34, 734, 1734, 734, 5734, 68, 69, 'OMAAAA', 'FPNAAA', 'VVVVxx'),
+(5307, 9184, 1, 3, 7, 7, 7, 307, 1307, 307, 5307, 14, 15, 'DWAAAA', 'GPNAAA', 'AAAAxx'),
+(8433, 9185, 1, 1, 3, 13, 33, 433, 433, 3433, 8433, 66, 67, 'JMAAAA', 'HPNAAA', 'HHHHxx'),
+(3031, 9186, 1, 3, 1, 11, 31, 31, 1031, 3031, 3031, 62, 63, 'PMAAAA', 'IPNAAA', 'OOOOxx'),
+(5714, 9187, 0, 2, 4, 14, 14, 714, 1714, 714, 5714, 28, 29, 'ULAAAA', 'JPNAAA', 'VVVVxx'),
+(5969, 9188, 1, 1, 9, 9, 69, 969, 1969, 969, 5969, 138, 139, 'PVAAAA', 'KPNAAA', 'AAAAxx'),
+(2532, 9189, 0, 0, 2, 12, 32, 532, 532, 2532, 2532, 64, 65, 'KTAAAA', 'LPNAAA', 'HHHHxx'),
+(5219, 9190, 1, 3, 9, 19, 19, 219, 1219, 219, 5219, 38, 39, 'TSAAAA', 'MPNAAA', 'OOOOxx'),
+(7343, 9191, 1, 3, 3, 3, 43, 343, 1343, 2343, 7343, 86, 87, 'LWAAAA', 'NPNAAA', 'VVVVxx'),
+(9089, 9192, 1, 1, 9, 9, 89, 89, 1089, 4089, 9089, 178, 179, 'PLAAAA', 'OPNAAA', 'AAAAxx'),
+(9337, 9193, 1, 1, 7, 17, 37, 337, 1337, 4337, 9337, 74, 75, 'DVAAAA', 'PPNAAA', 'HHHHxx'),
+(5131, 9194, 1, 3, 1, 11, 31, 131, 1131, 131, 5131, 62, 63, 'JPAAAA', 'QPNAAA', 'OOOOxx'),
+(6253, 9195, 1, 1, 3, 13, 53, 253, 253, 1253, 6253, 106, 107, 'NGAAAA', 'RPNAAA', 'VVVVxx'),
+(5140, 9196, 0, 0, 0, 0, 40, 140, 1140, 140, 5140, 80, 81, 'SPAAAA', 'SPNAAA', 'AAAAxx'),
+(2953, 9197, 1, 1, 3, 13, 53, 953, 953, 2953, 2953, 106, 107, 'PJAAAA', 'TPNAAA', 'HHHHxx'),
+(4293, 9198, 1, 1, 3, 13, 93, 293, 293, 4293, 4293, 186, 187, 'DJAAAA', 'UPNAAA', 'OOOOxx'),
+(9974, 9199, 0, 2, 4, 14, 74, 974, 1974, 4974, 9974, 148, 149, 'QTAAAA', 'VPNAAA', 'VVVVxx'),
+(5061, 9200, 1, 1, 1, 1, 61, 61, 1061, 61, 5061, 122, 123, 'RMAAAA', 'WPNAAA', 'AAAAxx'),
+(8570, 9201, 0, 2, 0, 10, 70, 570, 570, 3570, 8570, 140, 141, 'QRAAAA', 'XPNAAA', 'HHHHxx'),
+(9504, 9202, 0, 0, 4, 4, 4, 504, 1504, 4504, 9504, 8, 9, 'OBAAAA', 'YPNAAA', 'OOOOxx'),
+(604, 9203, 0, 0, 4, 4, 4, 604, 604, 604, 604, 8, 9, 'GXAAAA', 'ZPNAAA', 'VVVVxx'),
+(4991, 9204, 1, 3, 1, 11, 91, 991, 991, 4991, 4991, 182, 183, 'ZJAAAA', 'AQNAAA', 'AAAAxx'),
+(880, 9205, 0, 0, 0, 0, 80, 880, 880, 880, 880, 160, 161, 'WHAAAA', 'BQNAAA', 'HHHHxx'),
+(3861, 9206, 1, 1, 1, 1, 61, 861, 1861, 3861, 3861, 122, 123, 'NSAAAA', 'CQNAAA', 'OOOOxx'),
+(8262, 9207, 0, 2, 2, 2, 62, 262, 262, 3262, 8262, 124, 125, 'UFAAAA', 'DQNAAA', 'VVVVxx'),
+(5689, 9208, 1, 1, 9, 9, 89, 689, 1689, 689, 5689, 178, 179, 'VKAAAA', 'EQNAAA', 'AAAAxx'),
+(1793, 9209, 1, 1, 3, 13, 93, 793, 1793, 1793, 1793, 186, 187, 'ZQAAAA', 'FQNAAA', 'HHHHxx'),
+(2661, 9210, 1, 1, 1, 1, 61, 661, 661, 2661, 2661, 122, 123, 'JYAAAA', 'GQNAAA', 'OOOOxx'),
+(7954, 9211, 0, 2, 4, 14, 54, 954, 1954, 2954, 7954, 108, 109, 'YTAAAA', 'HQNAAA', 'VVVVxx'),
+(1874, 9212, 0, 2, 4, 14, 74, 874, 1874, 1874, 1874, 148, 149, 'CUAAAA', 'IQNAAA', 'AAAAxx'),
+(2982, 9213, 0, 2, 2, 2, 82, 982, 982, 2982, 2982, 164, 165, 'SKAAAA', 'JQNAAA', 'HHHHxx'),
+(331, 9214, 1, 3, 1, 11, 31, 331, 331, 331, 331, 62, 63, 'TMAAAA', 'KQNAAA', 'OOOOxx'),
+(5021, 9215, 1, 1, 1, 1, 21, 21, 1021, 21, 5021, 42, 43, 'DLAAAA', 'LQNAAA', 'VVVVxx'),
+(9894, 9216, 0, 2, 4, 14, 94, 894, 1894, 4894, 9894, 188, 189, 'OQAAAA', 'MQNAAA', 'AAAAxx'),
+(7709, 9217, 1, 1, 9, 9, 9, 709, 1709, 2709, 7709, 18, 19, 'NKAAAA', 'NQNAAA', 'HHHHxx'),
+(4980, 9218, 0, 0, 0, 0, 80, 980, 980, 4980, 4980, 160, 161, 'OJAAAA', 'OQNAAA', 'OOOOxx'),
+(8249, 9219, 1, 1, 9, 9, 49, 249, 249, 3249, 8249, 98, 99, 'HFAAAA', 'PQNAAA', 'VVVVxx'),
+(7120, 9220, 0, 0, 0, 0, 20, 120, 1120, 2120, 7120, 40, 41, 'WNAAAA', 'QQNAAA', 'AAAAxx'),
+(7464, 9221, 0, 0, 4, 4, 64, 464, 1464, 2464, 7464, 128, 129, 'CBAAAA', 'RQNAAA', 'HHHHxx'),
+(8086, 9222, 0, 2, 6, 6, 86, 86, 86, 3086, 8086, 172, 173, 'AZAAAA', 'SQNAAA', 'OOOOxx'),
+(3509, 9223, 1, 1, 9, 9, 9, 509, 1509, 3509, 3509, 18, 19, 'ZEAAAA', 'TQNAAA', 'VVVVxx'),
+(3902, 9224, 0, 2, 2, 2, 2, 902, 1902, 3902, 3902, 4, 5, 'CUAAAA', 'UQNAAA', 'AAAAxx'),
+(9907, 9225, 1, 3, 7, 7, 7, 907, 1907, 4907, 9907, 14, 15, 'BRAAAA', 'VQNAAA', 'HHHHxx'),
+(6278, 9226, 0, 2, 8, 18, 78, 278, 278, 1278, 6278, 156, 157, 'MHAAAA', 'WQNAAA', 'OOOOxx'),
+(9316, 9227, 0, 0, 6, 16, 16, 316, 1316, 4316, 9316, 32, 33, 'IUAAAA', 'XQNAAA', 'VVVVxx'),
+(2824, 9228, 0, 0, 4, 4, 24, 824, 824, 2824, 2824, 48, 49, 'QEAAAA', 'YQNAAA', 'AAAAxx'),
+(1558, 9229, 0, 2, 8, 18, 58, 558, 1558, 1558, 1558, 116, 117, 'YHAAAA', 'ZQNAAA', 'HHHHxx'),
+(5436, 9230, 0, 0, 6, 16, 36, 436, 1436, 436, 5436, 72, 73, 'CBAAAA', 'ARNAAA', 'OOOOxx'),
+(1161, 9231, 1, 1, 1, 1, 61, 161, 1161, 1161, 1161, 122, 123, 'RSAAAA', 'BRNAAA', 'VVVVxx'),
+(7569, 9232, 1, 1, 9, 9, 69, 569, 1569, 2569, 7569, 138, 139, 'DFAAAA', 'CRNAAA', 'AAAAxx'),
+(9614, 9233, 0, 2, 4, 14, 14, 614, 1614, 4614, 9614, 28, 29, 'UFAAAA', 'DRNAAA', 'HHHHxx'),
+(6970, 9234, 0, 2, 0, 10, 70, 970, 970, 1970, 6970, 140, 141, 'CIAAAA', 'ERNAAA', 'OOOOxx'),
+(2422, 9235, 0, 2, 2, 2, 22, 422, 422, 2422, 2422, 44, 45, 'EPAAAA', 'FRNAAA', 'VVVVxx'),
+(8860, 9236, 0, 0, 0, 0, 60, 860, 860, 3860, 8860, 120, 121, 'UCAAAA', 'GRNAAA', 'AAAAxx'),
+(9912, 9237, 0, 0, 2, 12, 12, 912, 1912, 4912, 9912, 24, 25, 'GRAAAA', 'HRNAAA', 'HHHHxx'),
+(1109, 9238, 1, 1, 9, 9, 9, 109, 1109, 1109, 1109, 18, 19, 'RQAAAA', 'IRNAAA', 'OOOOxx'),
+(3286, 9239, 0, 2, 6, 6, 86, 286, 1286, 3286, 3286, 172, 173, 'KWAAAA', 'JRNAAA', 'VVVVxx'),
+(2277, 9240, 1, 1, 7, 17, 77, 277, 277, 2277, 2277, 154, 155, 'PJAAAA', 'KRNAAA', 'AAAAxx'),
+(8656, 9241, 0, 0, 6, 16, 56, 656, 656, 3656, 8656, 112, 113, 'YUAAAA', 'LRNAAA', 'HHHHxx'),
+(4656, 9242, 0, 0, 6, 16, 56, 656, 656, 4656, 4656, 112, 113, 'CXAAAA', 'MRNAAA', 'OOOOxx'),
+(6965, 9243, 1, 1, 5, 5, 65, 965, 965, 1965, 6965, 130, 131, 'XHAAAA', 'NRNAAA', 'VVVVxx'),
+(7591, 9244, 1, 3, 1, 11, 91, 591, 1591, 2591, 7591, 182, 183, 'ZFAAAA', 'ORNAAA', 'AAAAxx'),
+(4883, 9245, 1, 3, 3, 3, 83, 883, 883, 4883, 4883, 166, 167, 'VFAAAA', 'PRNAAA', 'HHHHxx'),
+(452, 9246, 0, 0, 2, 12, 52, 452, 452, 452, 452, 104, 105, 'KRAAAA', 'QRNAAA', 'OOOOxx'),
+(4018, 9247, 0, 2, 8, 18, 18, 18, 18, 4018, 4018, 36, 37, 'OYAAAA', 'RRNAAA', 'VVVVxx'),
+(4066, 9248, 0, 2, 6, 6, 66, 66, 66, 4066, 4066, 132, 133, 'KAAAAA', 'SRNAAA', 'AAAAxx'),
+(6480, 9249, 0, 0, 0, 0, 80, 480, 480, 1480, 6480, 160, 161, 'GPAAAA', 'TRNAAA', 'HHHHxx'),
+(8634, 9250, 0, 2, 4, 14, 34, 634, 634, 3634, 8634, 68, 69, 'CUAAAA', 'URNAAA', 'OOOOxx'),
+(9387, 9251, 1, 3, 7, 7, 87, 387, 1387, 4387, 9387, 174, 175, 'BXAAAA', 'VRNAAA', 'VVVVxx'),
+(3476, 9252, 0, 0, 6, 16, 76, 476, 1476, 3476, 3476, 152, 153, 'SDAAAA', 'WRNAAA', 'AAAAxx'),
+(5995, 9253, 1, 3, 5, 15, 95, 995, 1995, 995, 5995, 190, 191, 'PWAAAA', 'XRNAAA', 'HHHHxx'),
+(9677, 9254, 1, 1, 7, 17, 77, 677, 1677, 4677, 9677, 154, 155, 'FIAAAA', 'YRNAAA', 'OOOOxx'),
+(3884, 9255, 0, 0, 4, 4, 84, 884, 1884, 3884, 3884, 168, 169, 'KTAAAA', 'ZRNAAA', 'VVVVxx'),
+(6500, 9256, 0, 0, 0, 0, 0, 500, 500, 1500, 6500, 0, 1, 'AQAAAA', 'ASNAAA', 'AAAAxx'),
+(7972, 9257, 0, 0, 2, 12, 72, 972, 1972, 2972, 7972, 144, 145, 'QUAAAA', 'BSNAAA', 'HHHHxx'),
+(5281, 9258, 1, 1, 1, 1, 81, 281, 1281, 281, 5281, 162, 163, 'DVAAAA', 'CSNAAA', 'OOOOxx'),
+(1288, 9259, 0, 0, 8, 8, 88, 288, 1288, 1288, 1288, 176, 177, 'OXAAAA', 'DSNAAA', 'VVVVxx'),
+(4366, 9260, 0, 2, 6, 6, 66, 366, 366, 4366, 4366, 132, 133, 'YLAAAA', 'ESNAAA', 'AAAAxx'),
+(6557, 9261, 1, 1, 7, 17, 57, 557, 557, 1557, 6557, 114, 115, 'FSAAAA', 'FSNAAA', 'HHHHxx'),
+(7086, 9262, 0, 2, 6, 6, 86, 86, 1086, 2086, 7086, 172, 173, 'OMAAAA', 'GSNAAA', 'OOOOxx'),
+(6588, 9263, 0, 0, 8, 8, 88, 588, 588, 1588, 6588, 176, 177, 'KTAAAA', 'HSNAAA', 'VVVVxx'),
+(9062, 9264, 0, 2, 2, 2, 62, 62, 1062, 4062, 9062, 124, 125, 'OKAAAA', 'ISNAAA', 'AAAAxx'),
+(9230, 9265, 0, 2, 0, 10, 30, 230, 1230, 4230, 9230, 60, 61, 'ARAAAA', 'JSNAAA', 'HHHHxx'),
+(7672, 9266, 0, 0, 2, 12, 72, 672, 1672, 2672, 7672, 144, 145, 'CJAAAA', 'KSNAAA', 'OOOOxx'),
+(5204, 9267, 0, 0, 4, 4, 4, 204, 1204, 204, 5204, 8, 9, 'ESAAAA', 'LSNAAA', 'VVVVxx'),
+(2836, 9268, 0, 0, 6, 16, 36, 836, 836, 2836, 2836, 72, 73, 'CFAAAA', 'MSNAAA', 'AAAAxx'),
+(7165, 9269, 1, 1, 5, 5, 65, 165, 1165, 2165, 7165, 130, 131, 'PPAAAA', 'NSNAAA', 'HHHHxx'),
+(971, 9270, 1, 3, 1, 11, 71, 971, 971, 971, 971, 142, 143, 'JLAAAA', 'OSNAAA', 'OOOOxx'),
+(3851, 9271, 1, 3, 1, 11, 51, 851, 1851, 3851, 3851, 102, 103, 'DSAAAA', 'PSNAAA', 'VVVVxx'),
+(8593, 9272, 1, 1, 3, 13, 93, 593, 593, 3593, 8593, 186, 187, 'NSAAAA', 'QSNAAA', 'AAAAxx'),
+(7742, 9273, 0, 2, 2, 2, 42, 742, 1742, 2742, 7742, 84, 85, 'ULAAAA', 'RSNAAA', 'HHHHxx'),
+(2887, 9274, 1, 3, 7, 7, 87, 887, 887, 2887, 2887, 174, 175, 'BHAAAA', 'SSNAAA', 'OOOOxx'),
+(8479, 9275, 1, 3, 9, 19, 79, 479, 479, 3479, 8479, 158, 159, 'DOAAAA', 'TSNAAA', 'VVVVxx'),
+(9514, 9276, 0, 2, 4, 14, 14, 514, 1514, 4514, 9514, 28, 29, 'YBAAAA', 'USNAAA', 'AAAAxx'),
+(273, 9277, 1, 1, 3, 13, 73, 273, 273, 273, 273, 146, 147, 'NKAAAA', 'VSNAAA', 'HHHHxx'),
+(2938, 9278, 0, 2, 8, 18, 38, 938, 938, 2938, 2938, 76, 77, 'AJAAAA', 'WSNAAA', 'OOOOxx'),
+(9793, 9279, 1, 1, 3, 13, 93, 793, 1793, 4793, 9793, 186, 187, 'RMAAAA', 'XSNAAA', 'VVVVxx'),
+(8050, 9280, 0, 2, 0, 10, 50, 50, 50, 3050, 8050, 100, 101, 'QXAAAA', 'YSNAAA', 'AAAAxx'),
+(6702, 9281, 0, 2, 2, 2, 2, 702, 702, 1702, 6702, 4, 5, 'UXAAAA', 'ZSNAAA', 'HHHHxx'),
+(7290, 9282, 0, 2, 0, 10, 90, 290, 1290, 2290, 7290, 180, 181, 'KUAAAA', 'ATNAAA', 'OOOOxx'),
+(1837, 9283, 1, 1, 7, 17, 37, 837, 1837, 1837, 1837, 74, 75, 'RSAAAA', 'BTNAAA', 'VVVVxx'),
+(3206, 9284, 0, 2, 6, 6, 6, 206, 1206, 3206, 3206, 12, 13, 'ITAAAA', 'CTNAAA', 'AAAAxx'),
+(4925, 9285, 1, 1, 5, 5, 25, 925, 925, 4925, 4925, 50, 51, 'LHAAAA', 'DTNAAA', 'HHHHxx'),
+(5066, 9286, 0, 2, 6, 6, 66, 66, 1066, 66, 5066, 132, 133, 'WMAAAA', 'ETNAAA', 'OOOOxx'),
+(3401, 9287, 1, 1, 1, 1, 1, 401, 1401, 3401, 3401, 2, 3, 'VAAAAA', 'FTNAAA', 'VVVVxx'),
+(3474, 9288, 0, 2, 4, 14, 74, 474, 1474, 3474, 3474, 148, 149, 'QDAAAA', 'GTNAAA', 'AAAAxx'),
+(57, 9289, 1, 1, 7, 17, 57, 57, 57, 57, 57, 114, 115, 'FCAAAA', 'HTNAAA', 'HHHHxx'),
+(2082, 9290, 0, 2, 2, 2, 82, 82, 82, 2082, 2082, 164, 165, 'CCAAAA', 'ITNAAA', 'OOOOxx'),
+(100, 9291, 0, 0, 0, 0, 0, 100, 100, 100, 100, 0, 1, 'WDAAAA', 'JTNAAA', 'VVVVxx'),
+(9665, 9292, 1, 1, 5, 5, 65, 665, 1665, 4665, 9665, 130, 131, 'THAAAA', 'KTNAAA', 'AAAAxx'),
+(8284, 9293, 0, 0, 4, 4, 84, 284, 284, 3284, 8284, 168, 169, 'QGAAAA', 'LTNAAA', 'HHHHxx'),
+(958, 9294, 0, 2, 8, 18, 58, 958, 958, 958, 958, 116, 117, 'WKAAAA', 'MTNAAA', 'OOOOxx'),
+(5282, 9295, 0, 2, 2, 2, 82, 282, 1282, 282, 5282, 164, 165, 'EVAAAA', 'NTNAAA', 'VVVVxx'),
+(4257, 9296, 1, 1, 7, 17, 57, 257, 257, 4257, 4257, 114, 115, 'THAAAA', 'OTNAAA', 'AAAAxx'),
+(3160, 9297, 0, 0, 0, 0, 60, 160, 1160, 3160, 3160, 120, 121, 'ORAAAA', 'PTNAAA', 'HHHHxx'),
+(8449, 9298, 1, 1, 9, 9, 49, 449, 449, 3449, 8449, 98, 99, 'ZMAAAA', 'QTNAAA', 'OOOOxx'),
+(500, 9299, 0, 0, 0, 0, 0, 500, 500, 500, 500, 0, 1, 'GTAAAA', 'RTNAAA', 'VVVVxx'),
+(6432, 9300, 0, 0, 2, 12, 32, 432, 432, 1432, 6432, 64, 65, 'KNAAAA', 'STNAAA', 'AAAAxx'),
+(6220, 9301, 0, 0, 0, 0, 20, 220, 220, 1220, 6220, 40, 41, 'GFAAAA', 'TTNAAA', 'HHHHxx'),
+(7233, 9302, 1, 1, 3, 13, 33, 233, 1233, 2233, 7233, 66, 67, 'FSAAAA', 'UTNAAA', 'OOOOxx'),
+(2723, 9303, 1, 3, 3, 3, 23, 723, 723, 2723, 2723, 46, 47, 'TAAAAA', 'VTNAAA', 'VVVVxx'),
+(1899, 9304, 1, 3, 9, 19, 99, 899, 1899, 1899, 1899, 198, 199, 'BVAAAA', 'WTNAAA', 'AAAAxx'),
+(7158, 9305, 0, 2, 8, 18, 58, 158, 1158, 2158, 7158, 116, 117, 'IPAAAA', 'XTNAAA', 'HHHHxx'),
+(202, 9306, 0, 2, 2, 2, 2, 202, 202, 202, 202, 4, 5, 'UHAAAA', 'YTNAAA', 'OOOOxx'),
+(2286, 9307, 0, 2, 6, 6, 86, 286, 286, 2286, 2286, 172, 173, 'YJAAAA', 'ZTNAAA', 'VVVVxx'),
+(5356, 9308, 0, 0, 6, 16, 56, 356, 1356, 356, 5356, 112, 113, 'AYAAAA', 'AUNAAA', 'AAAAxx'),
+(3809, 9309, 1, 1, 9, 9, 9, 809, 1809, 3809, 3809, 18, 19, 'NQAAAA', 'BUNAAA', 'HHHHxx'),
+(3979, 9310, 1, 3, 9, 19, 79, 979, 1979, 3979, 3979, 158, 159, 'BXAAAA', 'CUNAAA', 'OOOOxx'),
+(8359, 9311, 1, 3, 9, 19, 59, 359, 359, 3359, 8359, 118, 119, 'NJAAAA', 'DUNAAA', 'VVVVxx'),
+(3479, 9312, 1, 3, 9, 19, 79, 479, 1479, 3479, 3479, 158, 159, 'VDAAAA', 'EUNAAA', 'AAAAxx'),
+(4895, 9313, 1, 3, 5, 15, 95, 895, 895, 4895, 4895, 190, 191, 'HGAAAA', 'FUNAAA', 'HHHHxx'),
+(6059, 9314, 1, 3, 9, 19, 59, 59, 59, 1059, 6059, 118, 119, 'BZAAAA', 'GUNAAA', 'OOOOxx'),
+(9560, 9315, 0, 0, 0, 0, 60, 560, 1560, 4560, 9560, 120, 121, 'SDAAAA', 'HUNAAA', 'VVVVxx'),
+(6756, 9316, 0, 0, 6, 16, 56, 756, 756, 1756, 6756, 112, 113, 'WZAAAA', 'IUNAAA', 'AAAAxx'),
+(7504, 9317, 0, 0, 4, 4, 4, 504, 1504, 2504, 7504, 8, 9, 'QCAAAA', 'JUNAAA', 'HHHHxx'),
+(6762, 9318, 0, 2, 2, 2, 62, 762, 762, 1762, 6762, 124, 125, 'CAAAAA', 'KUNAAA', 'OOOOxx'),
+(5304, 9319, 0, 0, 4, 4, 4, 304, 1304, 304, 5304, 8, 9, 'AWAAAA', 'LUNAAA', 'VVVVxx'),
+(9533, 9320, 1, 1, 3, 13, 33, 533, 1533, 4533, 9533, 66, 67, 'RCAAAA', 'MUNAAA', 'AAAAxx'),
+(6649, 9321, 1, 1, 9, 9, 49, 649, 649, 1649, 6649, 98, 99, 'TVAAAA', 'NUNAAA', 'HHHHxx'),
+(38, 9322, 0, 2, 8, 18, 38, 38, 38, 38, 38, 76, 77, 'MBAAAA', 'OUNAAA', 'OOOOxx'),
+(5713, 9323, 1, 1, 3, 13, 13, 713, 1713, 713, 5713, 26, 27, 'TLAAAA', 'PUNAAA', 'VVVVxx'),
+(3000, 9324, 0, 0, 0, 0, 0, 0, 1000, 3000, 3000, 0, 1, 'KLAAAA', 'QUNAAA', 'AAAAxx'),
+(3738, 9325, 0, 2, 8, 18, 38, 738, 1738, 3738, 3738, 76, 77, 'UNAAAA', 'RUNAAA', 'HHHHxx'),
+(3327, 9326, 1, 3, 7, 7, 27, 327, 1327, 3327, 3327, 54, 55, 'ZXAAAA', 'SUNAAA', 'OOOOxx'),
+(3922, 9327, 0, 2, 2, 2, 22, 922, 1922, 3922, 3922, 44, 45, 'WUAAAA', 'TUNAAA', 'VVVVxx'),
+(9245, 9328, 1, 1, 5, 5, 45, 245, 1245, 4245, 9245, 90, 91, 'PRAAAA', 'UUNAAA', 'AAAAxx'),
+(2172, 9329, 0, 0, 2, 12, 72, 172, 172, 2172, 2172, 144, 145, 'OFAAAA', 'VUNAAA', 'HHHHxx'),
+(7128, 9330, 0, 0, 8, 8, 28, 128, 1128, 2128, 7128, 56, 57, 'EOAAAA', 'WUNAAA', 'OOOOxx'),
+(1195, 9331, 1, 3, 5, 15, 95, 195, 1195, 1195, 1195, 190, 191, 'ZTAAAA', 'XUNAAA', 'VVVVxx'),
+(8445, 9332, 1, 1, 5, 5, 45, 445, 445, 3445, 8445, 90, 91, 'VMAAAA', 'YUNAAA', 'AAAAxx'),
+(8638, 9333, 0, 2, 8, 18, 38, 638, 638, 3638, 8638, 76, 77, 'GUAAAA', 'ZUNAAA', 'HHHHxx'),
+(1249, 9334, 1, 1, 9, 9, 49, 249, 1249, 1249, 1249, 98, 99, 'BWAAAA', 'AVNAAA', 'OOOOxx'),
+(8659, 9335, 1, 3, 9, 19, 59, 659, 659, 3659, 8659, 118, 119, 'BVAAAA', 'BVNAAA', 'VVVVxx'),
+(3556, 9336, 0, 0, 6, 16, 56, 556, 1556, 3556, 3556, 112, 113, 'UGAAAA', 'CVNAAA', 'AAAAxx'),
+(3347, 9337, 1, 3, 7, 7, 47, 347, 1347, 3347, 3347, 94, 95, 'TYAAAA', 'DVNAAA', 'HHHHxx'),
+(3260, 9338, 0, 0, 0, 0, 60, 260, 1260, 3260, 3260, 120, 121, 'KVAAAA', 'EVNAAA', 'OOOOxx'),
+(5139, 9339, 1, 3, 9, 19, 39, 139, 1139, 139, 5139, 78, 79, 'RPAAAA', 'FVNAAA', 'VVVVxx'),
+(9991, 9340, 1, 3, 1, 11, 91, 991, 1991, 4991, 9991, 182, 183, 'HUAAAA', 'GVNAAA', 'AAAAxx'),
+(5499, 9341, 1, 3, 9, 19, 99, 499, 1499, 499, 5499, 198, 199, 'NDAAAA', 'HVNAAA', 'HHHHxx'),
+(8082, 9342, 0, 2, 2, 2, 82, 82, 82, 3082, 8082, 164, 165, 'WYAAAA', 'IVNAAA', 'OOOOxx'),
+(1640, 9343, 0, 0, 0, 0, 40, 640, 1640, 1640, 1640, 80, 81, 'CLAAAA', 'JVNAAA', 'VVVVxx'),
+(8726, 9344, 0, 2, 6, 6, 26, 726, 726, 3726, 8726, 52, 53, 'QXAAAA', 'KVNAAA', 'AAAAxx'),
+(2339, 9345, 1, 3, 9, 19, 39, 339, 339, 2339, 2339, 78, 79, 'ZLAAAA', 'LVNAAA', 'HHHHxx'),
+(2601, 9346, 1, 1, 1, 1, 1, 601, 601, 2601, 2601, 2, 3, 'BWAAAA', 'MVNAAA', 'OOOOxx'),
+(9940, 9347, 0, 0, 0, 0, 40, 940, 1940, 4940, 9940, 80, 81, 'ISAAAA', 'NVNAAA', 'VVVVxx'),
+(4185, 9348, 1, 1, 5, 5, 85, 185, 185, 4185, 4185, 170, 171, 'ZEAAAA', 'OVNAAA', 'AAAAxx'),
+(9546, 9349, 0, 2, 6, 6, 46, 546, 1546, 4546, 9546, 92, 93, 'EDAAAA', 'PVNAAA', 'HHHHxx'),
+(5218, 9350, 0, 2, 8, 18, 18, 218, 1218, 218, 5218, 36, 37, 'SSAAAA', 'QVNAAA', 'OOOOxx'),
+(4374, 9351, 0, 2, 4, 14, 74, 374, 374, 4374, 4374, 148, 149, 'GMAAAA', 'RVNAAA', 'VVVVxx'),
+(288, 9352, 0, 0, 8, 8, 88, 288, 288, 288, 288, 176, 177, 'CLAAAA', 'SVNAAA', 'AAAAxx'),
+(7445, 9353, 1, 1, 5, 5, 45, 445, 1445, 2445, 7445, 90, 91, 'JAAAAA', 'TVNAAA', 'HHHHxx'),
+(1710, 9354, 0, 2, 0, 10, 10, 710, 1710, 1710, 1710, 20, 21, 'UNAAAA', 'UVNAAA', 'OOOOxx'),
+(6409, 9355, 1, 1, 9, 9, 9, 409, 409, 1409, 6409, 18, 19, 'NMAAAA', 'VVNAAA', 'VVVVxx'),
+(7982, 9356, 0, 2, 2, 2, 82, 982, 1982, 2982, 7982, 164, 165, 'AVAAAA', 'WVNAAA', 'AAAAxx'),
+(4950, 9357, 0, 2, 0, 10, 50, 950, 950, 4950, 4950, 100, 101, 'KIAAAA', 'XVNAAA', 'HHHHxx'),
+(9242, 9358, 0, 2, 2, 2, 42, 242, 1242, 4242, 9242, 84, 85, 'MRAAAA', 'YVNAAA', 'OOOOxx'),
+(3272, 9359, 0, 0, 2, 12, 72, 272, 1272, 3272, 3272, 144, 145, 'WVAAAA', 'ZVNAAA', 'VVVVxx'),
+(739, 9360, 1, 3, 9, 19, 39, 739, 739, 739, 739, 78, 79, 'LCAAAA', 'AWNAAA', 'AAAAxx'),
+(5526, 9361, 0, 2, 6, 6, 26, 526, 1526, 526, 5526, 52, 53, 'OEAAAA', 'BWNAAA', 'HHHHxx'),
+(8189, 9362, 1, 1, 9, 9, 89, 189, 189, 3189, 8189, 178, 179, 'ZCAAAA', 'CWNAAA', 'OOOOxx'),
+(9106, 9363, 0, 2, 6, 6, 6, 106, 1106, 4106, 9106, 12, 13, 'GMAAAA', 'DWNAAA', 'VVVVxx'),
+(9775, 9364, 1, 3, 5, 15, 75, 775, 1775, 4775, 9775, 150, 151, 'ZLAAAA', 'EWNAAA', 'AAAAxx'),
+(4643, 9365, 1, 3, 3, 3, 43, 643, 643, 4643, 4643, 86, 87, 'PWAAAA', 'FWNAAA', 'HHHHxx'),
+(8396, 9366, 0, 0, 6, 16, 96, 396, 396, 3396, 8396, 192, 193, 'YKAAAA', 'GWNAAA', 'OOOOxx'),
+(3255, 9367, 1, 3, 5, 15, 55, 255, 1255, 3255, 3255, 110, 111, 'FVAAAA', 'HWNAAA', 'VVVVxx'),
+(301, 9368, 1, 1, 1, 1, 1, 301, 301, 301, 301, 2, 3, 'PLAAAA', 'IWNAAA', 'AAAAxx'),
+(6014, 9369, 0, 2, 4, 14, 14, 14, 14, 1014, 6014, 28, 29, 'IXAAAA', 'JWNAAA', 'HHHHxx'),
+(6046, 9370, 0, 2, 6, 6, 46, 46, 46, 1046, 6046, 92, 93, 'OYAAAA', 'KWNAAA', 'OOOOxx'),
+(984, 9371, 0, 0, 4, 4, 84, 984, 984, 984, 984, 168, 169, 'WLAAAA', 'LWNAAA', 'VVVVxx'),
+(2420, 9372, 0, 0, 0, 0, 20, 420, 420, 2420, 2420, 40, 41, 'CPAAAA', 'MWNAAA', 'AAAAxx'),
+(2922, 9373, 0, 2, 2, 2, 22, 922, 922, 2922, 2922, 44, 45, 'KIAAAA', 'NWNAAA', 'HHHHxx'),
+(2317, 9374, 1, 1, 7, 17, 17, 317, 317, 2317, 2317, 34, 35, 'DLAAAA', 'OWNAAA', 'OOOOxx'),
+(7332, 9375, 0, 0, 2, 12, 32, 332, 1332, 2332, 7332, 64, 65, 'AWAAAA', 'PWNAAA', 'VVVVxx'),
+(6451, 9376, 1, 3, 1, 11, 51, 451, 451, 1451, 6451, 102, 103, 'DOAAAA', 'QWNAAA', 'AAAAxx'),
+(2589, 9377, 1, 1, 9, 9, 89, 589, 589, 2589, 2589, 178, 179, 'PVAAAA', 'RWNAAA', 'HHHHxx'),
+(4333, 9378, 1, 1, 3, 13, 33, 333, 333, 4333, 4333, 66, 67, 'RKAAAA', 'SWNAAA', 'OOOOxx'),
+(8650, 9379, 0, 2, 0, 10, 50, 650, 650, 3650, 8650, 100, 101, 'SUAAAA', 'TWNAAA', 'VVVVxx'),
+(6856, 9380, 0, 0, 6, 16, 56, 856, 856, 1856, 6856, 112, 113, 'SDAAAA', 'UWNAAA', 'AAAAxx'),
+(4194, 9381, 0, 2, 4, 14, 94, 194, 194, 4194, 4194, 188, 189, 'IFAAAA', 'VWNAAA', 'HHHHxx'),
+(6246, 9382, 0, 2, 6, 6, 46, 246, 246, 1246, 6246, 92, 93, 'GGAAAA', 'WWNAAA', 'OOOOxx'),
+(4371, 9383, 1, 3, 1, 11, 71, 371, 371, 4371, 4371, 142, 143, 'DMAAAA', 'XWNAAA', 'VVVVxx'),
+(1388, 9384, 0, 0, 8, 8, 88, 388, 1388, 1388, 1388, 176, 177, 'KBAAAA', 'YWNAAA', 'AAAAxx'),
+(1056, 9385, 0, 0, 6, 16, 56, 56, 1056, 1056, 1056, 112, 113, 'QOAAAA', 'ZWNAAA', 'HHHHxx'),
+(6041, 9386, 1, 1, 1, 1, 41, 41, 41, 1041, 6041, 82, 83, 'JYAAAA', 'AXNAAA', 'OOOOxx'),
+(6153, 9387, 1, 1, 3, 13, 53, 153, 153, 1153, 6153, 106, 107, 'RCAAAA', 'BXNAAA', 'VVVVxx'),
+(8450, 9388, 0, 2, 0, 10, 50, 450, 450, 3450, 8450, 100, 101, 'ANAAAA', 'CXNAAA', 'AAAAxx'),
+(3469, 9389, 1, 1, 9, 9, 69, 469, 1469, 3469, 3469, 138, 139, 'LDAAAA', 'DXNAAA', 'HHHHxx'),
+(5226, 9390, 0, 2, 6, 6, 26, 226, 1226, 226, 5226, 52, 53, 'ATAAAA', 'EXNAAA', 'OOOOxx'),
+(8112, 9391, 0, 0, 2, 12, 12, 112, 112, 3112, 8112, 24, 25, 'AAAAAA', 'FXNAAA', 'VVVVxx'),
+(647, 9392, 1, 3, 7, 7, 47, 647, 647, 647, 647, 94, 95, 'XYAAAA', 'GXNAAA', 'AAAAxx'),
+(2567, 9393, 1, 3, 7, 7, 67, 567, 567, 2567, 2567, 134, 135, 'TUAAAA', 'HXNAAA', 'HHHHxx'),
+(9064, 9394, 0, 0, 4, 4, 64, 64, 1064, 4064, 9064, 128, 129, 'QKAAAA', 'IXNAAA', 'OOOOxx'),
+(5161, 9395, 1, 1, 1, 1, 61, 161, 1161, 161, 5161, 122, 123, 'NQAAAA', 'JXNAAA', 'VVVVxx'),
+(5260, 9396, 0, 0, 0, 0, 60, 260, 1260, 260, 5260, 120, 121, 'IUAAAA', 'KXNAAA', 'AAAAxx'),
+(8988, 9397, 0, 0, 8, 8, 88, 988, 988, 3988, 8988, 176, 177, 'SHAAAA', 'LXNAAA', 'HHHHxx'),
+(9678, 9398, 0, 2, 8, 18, 78, 678, 1678, 4678, 9678, 156, 157, 'GIAAAA', 'MXNAAA', 'OOOOxx'),
+(6853, 9399, 1, 1, 3, 13, 53, 853, 853, 1853, 6853, 106, 107, 'PDAAAA', 'NXNAAA', 'VVVVxx'),
+(5294, 9400, 0, 2, 4, 14, 94, 294, 1294, 294, 5294, 188, 189, 'QVAAAA', 'OXNAAA', 'AAAAxx'),
+(9864, 9401, 0, 0, 4, 4, 64, 864, 1864, 4864, 9864, 128, 129, 'KPAAAA', 'PXNAAA', 'HHHHxx'),
+(8702, 9402, 0, 2, 2, 2, 2, 702, 702, 3702, 8702, 4, 5, 'SWAAAA', 'QXNAAA', 'OOOOxx'),
+(1132, 9403, 0, 0, 2, 12, 32, 132, 1132, 1132, 1132, 64, 65, 'ORAAAA', 'RXNAAA', 'VVVVxx'),
+(1524, 9404, 0, 0, 4, 4, 24, 524, 1524, 1524, 1524, 48, 49, 'QGAAAA', 'SXNAAA', 'AAAAxx'),
+(4560, 9405, 0, 0, 0, 0, 60, 560, 560, 4560, 4560, 120, 121, 'KTAAAA', 'TXNAAA', 'HHHHxx'),
+(2137, 9406, 1, 1, 7, 17, 37, 137, 137, 2137, 2137, 74, 75, 'FEAAAA', 'UXNAAA', 'OOOOxx'),
+(3283, 9407, 1, 3, 3, 3, 83, 283, 1283, 3283, 3283, 166, 167, 'HWAAAA', 'VXNAAA', 'VVVVxx'),
+(3377, 9408, 1, 1, 7, 17, 77, 377, 1377, 3377, 3377, 154, 155, 'XZAAAA', 'WXNAAA', 'AAAAxx'),
+(2267, 9409, 1, 3, 7, 7, 67, 267, 267, 2267, 2267, 134, 135, 'FJAAAA', 'XXNAAA', 'HHHHxx'),
+(8987, 9410, 1, 3, 7, 7, 87, 987, 987, 3987, 8987, 174, 175, 'RHAAAA', 'YXNAAA', 'OOOOxx'),
+(6709, 9411, 1, 1, 9, 9, 9, 709, 709, 1709, 6709, 18, 19, 'BYAAAA', 'ZXNAAA', 'VVVVxx'),
+(8059, 9412, 1, 3, 9, 19, 59, 59, 59, 3059, 8059, 118, 119, 'ZXAAAA', 'AYNAAA', 'AAAAxx'),
+(3402, 9413, 0, 2, 2, 2, 2, 402, 1402, 3402, 3402, 4, 5, 'WAAAAA', 'BYNAAA', 'HHHHxx'),
+(6443, 9414, 1, 3, 3, 3, 43, 443, 443, 1443, 6443, 86, 87, 'VNAAAA', 'CYNAAA', 'OOOOxx'),
+(8858, 9415, 0, 2, 8, 18, 58, 858, 858, 3858, 8858, 116, 117, 'SCAAAA', 'DYNAAA', 'VVVVxx'),
+(3974, 9416, 0, 2, 4, 14, 74, 974, 1974, 3974, 3974, 148, 149, 'WWAAAA', 'EYNAAA', 'AAAAxx'),
+(3521, 9417, 1, 1, 1, 1, 21, 521, 1521, 3521, 3521, 42, 43, 'LFAAAA', 'FYNAAA', 'HHHHxx'),
+(9509, 9418, 1, 1, 9, 9, 9, 509, 1509, 4509, 9509, 18, 19, 'TBAAAA', 'GYNAAA', 'OOOOxx'),
+(5442, 9419, 0, 2, 2, 2, 42, 442, 1442, 442, 5442, 84, 85, 'IBAAAA', 'HYNAAA', 'VVVVxx'),
+(8968, 9420, 0, 0, 8, 8, 68, 968, 968, 3968, 8968, 136, 137, 'YGAAAA', 'IYNAAA', 'AAAAxx'),
+(333, 9421, 1, 1, 3, 13, 33, 333, 333, 333, 333, 66, 67, 'VMAAAA', 'JYNAAA', 'HHHHxx'),
+(952, 9422, 0, 0, 2, 12, 52, 952, 952, 952, 952, 104, 105, 'QKAAAA', 'KYNAAA', 'OOOOxx'),
+(7482, 9423, 0, 2, 2, 2, 82, 482, 1482, 2482, 7482, 164, 165, 'UBAAAA', 'LYNAAA', 'VVVVxx'),
+(1486, 9424, 0, 2, 6, 6, 86, 486, 1486, 1486, 1486, 172, 173, 'EFAAAA', 'MYNAAA', 'AAAAxx'),
+(1815, 9425, 1, 3, 5, 15, 15, 815, 1815, 1815, 1815, 30, 31, 'VRAAAA', 'NYNAAA', 'HHHHxx'),
+(7937, 9426, 1, 1, 7, 17, 37, 937, 1937, 2937, 7937, 74, 75, 'HTAAAA', 'OYNAAA', 'OOOOxx'),
+(1436, 9427, 0, 0, 6, 16, 36, 436, 1436, 1436, 1436, 72, 73, 'GDAAAA', 'PYNAAA', 'VVVVxx'),
+(3470, 9428, 0, 2, 0, 10, 70, 470, 1470, 3470, 3470, 140, 141, 'MDAAAA', 'QYNAAA', 'AAAAxx'),
+(8195, 9429, 1, 3, 5, 15, 95, 195, 195, 3195, 8195, 190, 191, 'FDAAAA', 'RYNAAA', 'HHHHxx'),
+(6906, 9430, 0, 2, 6, 6, 6, 906, 906, 1906, 6906, 12, 13, 'QFAAAA', 'SYNAAA', 'OOOOxx'),
+(2539, 9431, 1, 3, 9, 19, 39, 539, 539, 2539, 2539, 78, 79, 'RTAAAA', 'TYNAAA', 'VVVVxx'),
+(5988, 9432, 0, 0, 8, 8, 88, 988, 1988, 988, 5988, 176, 177, 'IWAAAA', 'UYNAAA', 'AAAAxx'),
+(8908, 9433, 0, 0, 8, 8, 8, 908, 908, 3908, 8908, 16, 17, 'QEAAAA', 'VYNAAA', 'HHHHxx'),
+(2319, 9434, 1, 3, 9, 19, 19, 319, 319, 2319, 2319, 38, 39, 'FLAAAA', 'WYNAAA', 'OOOOxx'),
+(3263, 9435, 1, 3, 3, 3, 63, 263, 1263, 3263, 3263, 126, 127, 'NVAAAA', 'XYNAAA', 'VVVVxx'),
+(4039, 9436, 1, 3, 9, 19, 39, 39, 39, 4039, 4039, 78, 79, 'JZAAAA', 'YYNAAA', 'AAAAxx'),
+(6373, 9437, 1, 1, 3, 13, 73, 373, 373, 1373, 6373, 146, 147, 'DLAAAA', 'ZYNAAA', 'HHHHxx'),
+(1168, 9438, 0, 0, 8, 8, 68, 168, 1168, 1168, 1168, 136, 137, 'YSAAAA', 'AZNAAA', 'OOOOxx'),
+(8338, 9439, 0, 2, 8, 18, 38, 338, 338, 3338, 8338, 76, 77, 'SIAAAA', 'BZNAAA', 'VVVVxx'),
+(1172, 9440, 0, 0, 2, 12, 72, 172, 1172, 1172, 1172, 144, 145, 'CTAAAA', 'CZNAAA', 'AAAAxx'),
+(200, 9441, 0, 0, 0, 0, 0, 200, 200, 200, 200, 0, 1, 'SHAAAA', 'DZNAAA', 'HHHHxx'),
+(6355, 9442, 1, 3, 5, 15, 55, 355, 355, 1355, 6355, 110, 111, 'LKAAAA', 'EZNAAA', 'OOOOxx'),
+(7768, 9443, 0, 0, 8, 8, 68, 768, 1768, 2768, 7768, 136, 137, 'UMAAAA', 'FZNAAA', 'VVVVxx'),
+(25, 9444, 1, 1, 5, 5, 25, 25, 25, 25, 25, 50, 51, 'ZAAAAA', 'GZNAAA', 'AAAAxx'),
+(7144, 9445, 0, 0, 4, 4, 44, 144, 1144, 2144, 7144, 88, 89, 'UOAAAA', 'HZNAAA', 'HHHHxx'),
+(8671, 9446, 1, 3, 1, 11, 71, 671, 671, 3671, 8671, 142, 143, 'NVAAAA', 'IZNAAA', 'OOOOxx'),
+(9163, 9447, 1, 3, 3, 3, 63, 163, 1163, 4163, 9163, 126, 127, 'LOAAAA', 'JZNAAA', 'VVVVxx'),
+(8889, 9448, 1, 1, 9, 9, 89, 889, 889, 3889, 8889, 178, 179, 'XDAAAA', 'KZNAAA', 'AAAAxx'),
+(5950, 9449, 0, 2, 0, 10, 50, 950, 1950, 950, 5950, 100, 101, 'WUAAAA', 'LZNAAA', 'HHHHxx'),
+(6163, 9450, 1, 3, 3, 3, 63, 163, 163, 1163, 6163, 126, 127, 'BDAAAA', 'MZNAAA', 'OOOOxx'),
+(8119, 9451, 1, 3, 9, 19, 19, 119, 119, 3119, 8119, 38, 39, 'HAAAAA', 'NZNAAA', 'VVVVxx'),
+(1416, 9452, 0, 0, 6, 16, 16, 416, 1416, 1416, 1416, 32, 33, 'MCAAAA', 'OZNAAA', 'AAAAxx'),
+(4132, 9453, 0, 0, 2, 12, 32, 132, 132, 4132, 4132, 64, 65, 'YCAAAA', 'PZNAAA', 'HHHHxx'),
+(2294, 9454, 0, 2, 4, 14, 94, 294, 294, 2294, 2294, 188, 189, 'GKAAAA', 'QZNAAA', 'OOOOxx'),
+(9094, 9455, 0, 2, 4, 14, 94, 94, 1094, 4094, 9094, 188, 189, 'ULAAAA', 'RZNAAA', 'VVVVxx'),
+(4168, 9456, 0, 0, 8, 8, 68, 168, 168, 4168, 4168, 136, 137, 'IEAAAA', 'SZNAAA', 'AAAAxx'),
+(9108, 9457, 0, 0, 8, 8, 8, 108, 1108, 4108, 9108, 16, 17, 'IMAAAA', 'TZNAAA', 'HHHHxx'),
+(5706, 9458, 0, 2, 6, 6, 6, 706, 1706, 706, 5706, 12, 13, 'MLAAAA', 'UZNAAA', 'OOOOxx'),
+(2231, 9459, 1, 3, 1, 11, 31, 231, 231, 2231, 2231, 62, 63, 'VHAAAA', 'VZNAAA', 'VVVVxx'),
+(2173, 9460, 1, 1, 3, 13, 73, 173, 173, 2173, 2173, 146, 147, 'PFAAAA', 'WZNAAA', 'AAAAxx'),
+(90, 9461, 0, 2, 0, 10, 90, 90, 90, 90, 90, 180, 181, 'MDAAAA', 'XZNAAA', 'HHHHxx'),
+(9996, 9462, 0, 0, 6, 16, 96, 996, 1996, 4996, 9996, 192, 193, 'MUAAAA', 'YZNAAA', 'OOOOxx'),
+(330, 9463, 0, 2, 0, 10, 30, 330, 330, 330, 330, 60, 61, 'SMAAAA', 'ZZNAAA', 'VVVVxx'),
+(2052, 9464, 0, 0, 2, 12, 52, 52, 52, 2052, 2052, 104, 105, 'YAAAAA', 'AAOAAA', 'AAAAxx'),
+(1093, 9465, 1, 1, 3, 13, 93, 93, 1093, 1093, 1093, 186, 187, 'BQAAAA', 'BAOAAA', 'HHHHxx'),
+(5817, 9466, 1, 1, 7, 17, 17, 817, 1817, 817, 5817, 34, 35, 'TPAAAA', 'CAOAAA', 'OOOOxx'),
+(1559, 9467, 1, 3, 9, 19, 59, 559, 1559, 1559, 1559, 118, 119, 'ZHAAAA', 'DAOAAA', 'VVVVxx'),
+(8405, 9468, 1, 1, 5, 5, 5, 405, 405, 3405, 8405, 10, 11, 'HLAAAA', 'EAOAAA', 'AAAAxx'),
+(9962, 9469, 0, 2, 2, 2, 62, 962, 1962, 4962, 9962, 124, 125, 'ETAAAA', 'FAOAAA', 'HHHHxx'),
+(9461, 9470, 1, 1, 1, 1, 61, 461, 1461, 4461, 9461, 122, 123, 'XZAAAA', 'GAOAAA', 'OOOOxx'),
+(3028, 9471, 0, 0, 8, 8, 28, 28, 1028, 3028, 3028, 56, 57, 'MMAAAA', 'HAOAAA', 'VVVVxx'),
+(6814, 9472, 0, 2, 4, 14, 14, 814, 814, 1814, 6814, 28, 29, 'CCAAAA', 'IAOAAA', 'AAAAxx'),
+(9587, 9473, 1, 3, 7, 7, 87, 587, 1587, 4587, 9587, 174, 175, 'TEAAAA', 'JAOAAA', 'HHHHxx'),
+(6863, 9474, 1, 3, 3, 3, 63, 863, 863, 1863, 6863, 126, 127, 'ZDAAAA', 'KAOAAA', 'OOOOxx'),
+(4963, 9475, 1, 3, 3, 3, 63, 963, 963, 4963, 4963, 126, 127, 'XIAAAA', 'LAOAAA', 'VVVVxx'),
+(7811, 9476, 1, 3, 1, 11, 11, 811, 1811, 2811, 7811, 22, 23, 'LOAAAA', 'MAOAAA', 'AAAAxx'),
+(7608, 9477, 0, 0, 8, 8, 8, 608, 1608, 2608, 7608, 16, 17, 'QGAAAA', 'NAOAAA', 'HHHHxx'),
+(5321, 9478, 1, 1, 1, 1, 21, 321, 1321, 321, 5321, 42, 43, 'RWAAAA', 'OAOAAA', 'OOOOxx'),
+(9971, 9479, 1, 3, 1, 11, 71, 971, 1971, 4971, 9971, 142, 143, 'NTAAAA', 'PAOAAA', 'VVVVxx'),
+(6161, 9480, 1, 1, 1, 1, 61, 161, 161, 1161, 6161, 122, 123, 'ZCAAAA', 'QAOAAA', 'AAAAxx'),
+(2181, 9481, 1, 1, 1, 1, 81, 181, 181, 2181, 2181, 162, 163, 'XFAAAA', 'RAOAAA', 'HHHHxx'),
+(3828, 9482, 0, 0, 8, 8, 28, 828, 1828, 3828, 3828, 56, 57, 'GRAAAA', 'SAOAAA', 'OOOOxx'),
+(348, 9483, 0, 0, 8, 8, 48, 348, 348, 348, 348, 96, 97, 'KNAAAA', 'TAOAAA', 'VVVVxx'),
+(5459, 9484, 1, 3, 9, 19, 59, 459, 1459, 459, 5459, 118, 119, 'ZBAAAA', 'UAOAAA', 'AAAAxx'),
+(9406, 9485, 0, 2, 6, 6, 6, 406, 1406, 4406, 9406, 12, 13, 'UXAAAA', 'VAOAAA', 'HHHHxx'),
+(9852, 9486, 0, 0, 2, 12, 52, 852, 1852, 4852, 9852, 104, 105, 'YOAAAA', 'WAOAAA', 'OOOOxx'),
+(3095, 9487, 1, 3, 5, 15, 95, 95, 1095, 3095, 3095, 190, 191, 'BPAAAA', 'XAOAAA', 'VVVVxx'),
+(5597, 9488, 1, 1, 7, 17, 97, 597, 1597, 597, 5597, 194, 195, 'HHAAAA', 'YAOAAA', 'AAAAxx'),
+(8841, 9489, 1, 1, 1, 1, 41, 841, 841, 3841, 8841, 82, 83, 'BCAAAA', 'ZAOAAA', 'HHHHxx'),
+(3536, 9490, 0, 0, 6, 16, 36, 536, 1536, 3536, 3536, 72, 73, 'AGAAAA', 'ABOAAA', 'OOOOxx'),
+(4009, 9491, 1, 1, 9, 9, 9, 9, 9, 4009, 4009, 18, 19, 'FYAAAA', 'BBOAAA', 'VVVVxx'),
+(7366, 9492, 0, 2, 6, 6, 66, 366, 1366, 2366, 7366, 132, 133, 'IXAAAA', 'CBOAAA', 'AAAAxx'),
+(7327, 9493, 1, 3, 7, 7, 27, 327, 1327, 2327, 7327, 54, 55, 'VVAAAA', 'DBOAAA', 'HHHHxx'),
+(1613, 9494, 1, 1, 3, 13, 13, 613, 1613, 1613, 1613, 26, 27, 'BKAAAA', 'EBOAAA', 'OOOOxx'),
+(8619, 9495, 1, 3, 9, 19, 19, 619, 619, 3619, 8619, 38, 39, 'NTAAAA', 'FBOAAA', 'VVVVxx'),
+(4880, 9496, 0, 0, 0, 0, 80, 880, 880, 4880, 4880, 160, 161, 'SFAAAA', 'GBOAAA', 'AAAAxx'),
+(1552, 9497, 0, 0, 2, 12, 52, 552, 1552, 1552, 1552, 104, 105, 'SHAAAA', 'HBOAAA', 'HHHHxx'),
+(7636, 9498, 0, 0, 6, 16, 36, 636, 1636, 2636, 7636, 72, 73, 'SHAAAA', 'IBOAAA', 'OOOOxx'),
+(8397, 9499, 1, 1, 7, 17, 97, 397, 397, 3397, 8397, 194, 195, 'ZKAAAA', 'JBOAAA', 'VVVVxx'),
+(6224, 9500, 0, 0, 4, 4, 24, 224, 224, 1224, 6224, 48, 49, 'KFAAAA', 'KBOAAA', 'AAAAxx'),
+(9102, 9501, 0, 2, 2, 2, 2, 102, 1102, 4102, 9102, 4, 5, 'CMAAAA', 'LBOAAA', 'HHHHxx'),
+(7906, 9502, 0, 2, 6, 6, 6, 906, 1906, 2906, 7906, 12, 13, 'CSAAAA', 'MBOAAA', 'OOOOxx'),
+(9467, 9503, 1, 3, 7, 7, 67, 467, 1467, 4467, 9467, 134, 135, 'DAAAAA', 'NBOAAA', 'VVVVxx'),
+(828, 9504, 0, 0, 8, 8, 28, 828, 828, 828, 828, 56, 57, 'WFAAAA', 'OBOAAA', 'AAAAxx'),
+(9585, 9505, 1, 1, 5, 5, 85, 585, 1585, 4585, 9585, 170, 171, 'REAAAA', 'PBOAAA', 'HHHHxx'),
+(925, 9506, 1, 1, 5, 5, 25, 925, 925, 925, 925, 50, 51, 'PJAAAA', 'QBOAAA', 'OOOOxx'),
+(7375, 9507, 1, 3, 5, 15, 75, 375, 1375, 2375, 7375, 150, 151, 'RXAAAA', 'RBOAAA', 'VVVVxx'),
+(4027, 9508, 1, 3, 7, 7, 27, 27, 27, 4027, 4027, 54, 55, 'XYAAAA', 'SBOAAA', 'AAAAxx'),
+(766, 9509, 0, 2, 6, 6, 66, 766, 766, 766, 766, 132, 133, 'MDAAAA', 'TBOAAA', 'HHHHxx'),
+(5633, 9510, 1, 1, 3, 13, 33, 633, 1633, 633, 5633, 66, 67, 'RIAAAA', 'UBOAAA', 'OOOOxx'),
+(5648, 9511, 0, 0, 8, 8, 48, 648, 1648, 648, 5648, 96, 97, 'GJAAAA', 'VBOAAA', 'VVVVxx'),
+(148, 9512, 0, 0, 8, 8, 48, 148, 148, 148, 148, 96, 97, 'SFAAAA', 'WBOAAA', 'AAAAxx'),
+(2072, 9513, 0, 0, 2, 12, 72, 72, 72, 2072, 2072, 144, 145, 'SBAAAA', 'XBOAAA', 'HHHHxx'),
+(431, 9514, 1, 3, 1, 11, 31, 431, 431, 431, 431, 62, 63, 'PQAAAA', 'YBOAAA', 'OOOOxx'),
+(1711, 9515, 1, 3, 1, 11, 11, 711, 1711, 1711, 1711, 22, 23, 'VNAAAA', 'ZBOAAA', 'VVVVxx'),
+(9378, 9516, 0, 2, 8, 18, 78, 378, 1378, 4378, 9378, 156, 157, 'SWAAAA', 'ACOAAA', 'AAAAxx'),
+(6776, 9517, 0, 0, 6, 16, 76, 776, 776, 1776, 6776, 152, 153, 'QAAAAA', 'BCOAAA', 'HHHHxx'),
+(6842, 9518, 0, 2, 2, 2, 42, 842, 842, 1842, 6842, 84, 85, 'EDAAAA', 'CCOAAA', 'OOOOxx'),
+(2656, 9519, 0, 0, 6, 16, 56, 656, 656, 2656, 2656, 112, 113, 'EYAAAA', 'DCOAAA', 'VVVVxx'),
+(3116, 9520, 0, 0, 6, 16, 16, 116, 1116, 3116, 3116, 32, 33, 'WPAAAA', 'ECOAAA', 'AAAAxx'),
+(7904, 9521, 0, 0, 4, 4, 4, 904, 1904, 2904, 7904, 8, 9, 'ASAAAA', 'FCOAAA', 'HHHHxx'),
+(3529, 9522, 1, 1, 9, 9, 29, 529, 1529, 3529, 3529, 58, 59, 'TFAAAA', 'GCOAAA', 'OOOOxx'),
+(3240, 9523, 0, 0, 0, 0, 40, 240, 1240, 3240, 3240, 80, 81, 'QUAAAA', 'HCOAAA', 'VVVVxx'),
+(5801, 9524, 1, 1, 1, 1, 1, 801, 1801, 801, 5801, 2, 3, 'DPAAAA', 'ICOAAA', 'AAAAxx'),
+(4090, 9525, 0, 2, 0, 10, 90, 90, 90, 4090, 4090, 180, 181, 'IBAAAA', 'JCOAAA', 'HHHHxx'),
+(7687, 9526, 1, 3, 7, 7, 87, 687, 1687, 2687, 7687, 174, 175, 'RJAAAA', 'KCOAAA', 'OOOOxx'),
+(9711, 9527, 1, 3, 1, 11, 11, 711, 1711, 4711, 9711, 22, 23, 'NJAAAA', 'LCOAAA', 'VVVVxx'),
+(4760, 9528, 0, 0, 0, 0, 60, 760, 760, 4760, 4760, 120, 121, 'CBAAAA', 'MCOAAA', 'AAAAxx'),
+(5524, 9529, 0, 0, 4, 4, 24, 524, 1524, 524, 5524, 48, 49, 'MEAAAA', 'NCOAAA', 'HHHHxx'),
+(2251, 9530, 1, 3, 1, 11, 51, 251, 251, 2251, 2251, 102, 103, 'PIAAAA', 'OCOAAA', 'OOOOxx'),
+(1511, 9531, 1, 3, 1, 11, 11, 511, 1511, 1511, 1511, 22, 23, 'DGAAAA', 'PCOAAA', 'VVVVxx'),
+(5991, 9532, 1, 3, 1, 11, 91, 991, 1991, 991, 5991, 182, 183, 'LWAAAA', 'QCOAAA', 'AAAAxx'),
+(7808, 9533, 0, 0, 8, 8, 8, 808, 1808, 2808, 7808, 16, 17, 'IOAAAA', 'RCOAAA', 'HHHHxx'),
+(8708, 9534, 0, 0, 8, 8, 8, 708, 708, 3708, 8708, 16, 17, 'YWAAAA', 'SCOAAA', 'OOOOxx'),
+(8939, 9535, 1, 3, 9, 19, 39, 939, 939, 3939, 8939, 78, 79, 'VFAAAA', 'TCOAAA', 'VVVVxx'),
+(4295, 9536, 1, 3, 5, 15, 95, 295, 295, 4295, 4295, 190, 191, 'FJAAAA', 'UCOAAA', 'AAAAxx'),
+(5905, 9537, 1, 1, 5, 5, 5, 905, 1905, 905, 5905, 10, 11, 'DTAAAA', 'VCOAAA', 'HHHHxx'),
+(2649, 9538, 1, 1, 9, 9, 49, 649, 649, 2649, 2649, 98, 99, 'XXAAAA', 'WCOAAA', 'OOOOxx'),
+(2347, 9539, 1, 3, 7, 7, 47, 347, 347, 2347, 2347, 94, 95, 'HMAAAA', 'XCOAAA', 'VVVVxx'),
+(6339, 9540, 1, 3, 9, 19, 39, 339, 339, 1339, 6339, 78, 79, 'VJAAAA', 'YCOAAA', 'AAAAxx'),
+(292, 9541, 0, 0, 2, 12, 92, 292, 292, 292, 292, 184, 185, 'GLAAAA', 'ZCOAAA', 'HHHHxx'),
+(9314, 9542, 0, 2, 4, 14, 14, 314, 1314, 4314, 9314, 28, 29, 'GUAAAA', 'ADOAAA', 'OOOOxx'),
+(6893, 9543, 1, 1, 3, 13, 93, 893, 893, 1893, 6893, 186, 187, 'DFAAAA', 'BDOAAA', 'VVVVxx'),
+(3970, 9544, 0, 2, 0, 10, 70, 970, 1970, 3970, 3970, 140, 141, 'SWAAAA', 'CDOAAA', 'AAAAxx'),
+(1652, 9545, 0, 0, 2, 12, 52, 652, 1652, 1652, 1652, 104, 105, 'OLAAAA', 'DDOAAA', 'HHHHxx'),
+(4326, 9546, 0, 2, 6, 6, 26, 326, 326, 4326, 4326, 52, 53, 'KKAAAA', 'EDOAAA', 'OOOOxx'),
+(7881, 9547, 1, 1, 1, 1, 81, 881, 1881, 2881, 7881, 162, 163, 'DRAAAA', 'FDOAAA', 'VVVVxx'),
+(5291, 9548, 1, 3, 1, 11, 91, 291, 1291, 291, 5291, 182, 183, 'NVAAAA', 'GDOAAA', 'AAAAxx'),
+(957, 9549, 1, 1, 7, 17, 57, 957, 957, 957, 957, 114, 115, 'VKAAAA', 'HDOAAA', 'HHHHxx'),
+(2313, 9550, 1, 1, 3, 13, 13, 313, 313, 2313, 2313, 26, 27, 'ZKAAAA', 'IDOAAA', 'OOOOxx'),
+(5463, 9551, 1, 3, 3, 3, 63, 463, 1463, 463, 5463, 126, 127, 'DCAAAA', 'JDOAAA', 'VVVVxx'),
+(1268, 9552, 0, 0, 8, 8, 68, 268, 1268, 1268, 1268, 136, 137, 'UWAAAA', 'KDOAAA', 'AAAAxx'),
+(5028, 9553, 0, 0, 8, 8, 28, 28, 1028, 28, 5028, 56, 57, 'KLAAAA', 'LDOAAA', 'HHHHxx'),
+(656, 9554, 0, 0, 6, 16, 56, 656, 656, 656, 656, 112, 113, 'GZAAAA', 'MDOAAA', 'OOOOxx'),
+(9274, 9555, 0, 2, 4, 14, 74, 274, 1274, 4274, 9274, 148, 149, 'SSAAAA', 'NDOAAA', 'VVVVxx'),
+(8217, 9556, 1, 1, 7, 17, 17, 217, 217, 3217, 8217, 34, 35, 'BEAAAA', 'ODOAAA', 'AAAAxx'),
+(2175, 9557, 1, 3, 5, 15, 75, 175, 175, 2175, 2175, 150, 151, 'RFAAAA', 'PDOAAA', 'HHHHxx'),
+(6028, 9558, 0, 0, 8, 8, 28, 28, 28, 1028, 6028, 56, 57, 'WXAAAA', 'QDOAAA', 'OOOOxx'),
+(7584, 9559, 0, 0, 4, 4, 84, 584, 1584, 2584, 7584, 168, 169, 'SFAAAA', 'RDOAAA', 'VVVVxx'),
+(4114, 9560, 0, 2, 4, 14, 14, 114, 114, 4114, 4114, 28, 29, 'GCAAAA', 'SDOAAA', 'AAAAxx'),
+(8894, 9561, 0, 2, 4, 14, 94, 894, 894, 3894, 8894, 188, 189, 'CEAAAA', 'TDOAAA', 'HHHHxx'),
+(781, 9562, 1, 1, 1, 1, 81, 781, 781, 781, 781, 162, 163, 'BEAAAA', 'UDOAAA', 'OOOOxx'),
+(133, 9563, 1, 1, 3, 13, 33, 133, 133, 133, 133, 66, 67, 'DFAAAA', 'VDOAAA', 'VVVVxx'),
+(7572, 9564, 0, 0, 2, 12, 72, 572, 1572, 2572, 7572, 144, 145, 'GFAAAA', 'WDOAAA', 'AAAAxx'),
+(8514, 9565, 0, 2, 4, 14, 14, 514, 514, 3514, 8514, 28, 29, 'MPAAAA', 'XDOAAA', 'HHHHxx'),
+(3352, 9566, 0, 0, 2, 12, 52, 352, 1352, 3352, 3352, 104, 105, 'YYAAAA', 'YDOAAA', 'OOOOxx'),
+(8098, 9567, 0, 2, 8, 18, 98, 98, 98, 3098, 8098, 196, 197, 'MZAAAA', 'ZDOAAA', 'VVVVxx'),
+(9116, 9568, 0, 0, 6, 16, 16, 116, 1116, 4116, 9116, 32, 33, 'QMAAAA', 'AEOAAA', 'AAAAxx'),
+(9444, 9569, 0, 0, 4, 4, 44, 444, 1444, 4444, 9444, 88, 89, 'GZAAAA', 'BEOAAA', 'HHHHxx'),
+(2590, 9570, 0, 2, 0, 10, 90, 590, 590, 2590, 2590, 180, 181, 'QVAAAA', 'CEOAAA', 'OOOOxx'),
+(7302, 9571, 0, 2, 2, 2, 2, 302, 1302, 2302, 7302, 4, 5, 'WUAAAA', 'DEOAAA', 'VVVVxx'),
+(7444, 9572, 0, 0, 4, 4, 44, 444, 1444, 2444, 7444, 88, 89, 'IAAAAA', 'EEOAAA', 'AAAAxx'),
+(8748, 9573, 0, 0, 8, 8, 48, 748, 748, 3748, 8748, 96, 97, 'MYAAAA', 'FEOAAA', 'HHHHxx'),
+(7615, 9574, 1, 3, 5, 15, 15, 615, 1615, 2615, 7615, 30, 31, 'XGAAAA', 'GEOAAA', 'OOOOxx'),
+(6090, 9575, 0, 2, 0, 10, 90, 90, 90, 1090, 6090, 180, 181, 'GAAAAA', 'HEOAAA', 'VVVVxx'),
+(1529, 9576, 1, 1, 9, 9, 29, 529, 1529, 1529, 1529, 58, 59, 'VGAAAA', 'IEOAAA', 'AAAAxx'),
+(9398, 9577, 0, 2, 8, 18, 98, 398, 1398, 4398, 9398, 196, 197, 'MXAAAA', 'JEOAAA', 'HHHHxx'),
+(6114, 9578, 0, 2, 4, 14, 14, 114, 114, 1114, 6114, 28, 29, 'EBAAAA', 'KEOAAA', 'OOOOxx'),
+(2736, 9579, 0, 0, 6, 16, 36, 736, 736, 2736, 2736, 72, 73, 'GBAAAA', 'LEOAAA', 'VVVVxx'),
+(468, 9580, 0, 0, 8, 8, 68, 468, 468, 468, 468, 136, 137, 'ASAAAA', 'MEOAAA', 'AAAAxx'),
+(1487, 9581, 1, 3, 7, 7, 87, 487, 1487, 1487, 1487, 174, 175, 'FFAAAA', 'NEOAAA', 'HHHHxx'),
+(4784, 9582, 0, 0, 4, 4, 84, 784, 784, 4784, 4784, 168, 169, 'ACAAAA', 'OEOAAA', 'OOOOxx'),
+(6731, 9583, 1, 3, 1, 11, 31, 731, 731, 1731, 6731, 62, 63, 'XYAAAA', 'PEOAAA', 'VVVVxx'),
+(3328, 9584, 0, 0, 8, 8, 28, 328, 1328, 3328, 3328, 56, 57, 'AYAAAA', 'QEOAAA', 'AAAAxx'),
+(6891, 9585, 1, 3, 1, 11, 91, 891, 891, 1891, 6891, 182, 183, 'BFAAAA', 'REOAAA', 'HHHHxx'),
+(8039, 9586, 1, 3, 9, 19, 39, 39, 39, 3039, 8039, 78, 79, 'FXAAAA', 'SEOAAA', 'OOOOxx'),
+(4064, 9587, 0, 0, 4, 4, 64, 64, 64, 4064, 4064, 128, 129, 'IAAAAA', 'TEOAAA', 'VVVVxx'),
+(542, 9588, 0, 2, 2, 2, 42, 542, 542, 542, 542, 84, 85, 'WUAAAA', 'UEOAAA', 'AAAAxx'),
+(1039, 9589, 1, 3, 9, 19, 39, 39, 1039, 1039, 1039, 78, 79, 'ZNAAAA', 'VEOAAA', 'HHHHxx'),
+(5603, 9590, 1, 3, 3, 3, 3, 603, 1603, 603, 5603, 6, 7, 'NHAAAA', 'WEOAAA', 'OOOOxx'),
+(6641, 9591, 1, 1, 1, 1, 41, 641, 641, 1641, 6641, 82, 83, 'LVAAAA', 'XEOAAA', 'VVVVxx'),
+(6307, 9592, 1, 3, 7, 7, 7, 307, 307, 1307, 6307, 14, 15, 'PIAAAA', 'YEOAAA', 'AAAAxx'),
+(5354, 9593, 0, 2, 4, 14, 54, 354, 1354, 354, 5354, 108, 109, 'YXAAAA', 'ZEOAAA', 'HHHHxx'),
+(7878, 9594, 0, 2, 8, 18, 78, 878, 1878, 2878, 7878, 156, 157, 'ARAAAA', 'AFOAAA', 'OOOOxx'),
+(6391, 9595, 1, 3, 1, 11, 91, 391, 391, 1391, 6391, 182, 183, 'VLAAAA', 'BFOAAA', 'VVVVxx'),
+(4575, 9596, 1, 3, 5, 15, 75, 575, 575, 4575, 4575, 150, 151, 'ZTAAAA', 'CFOAAA', 'AAAAxx'),
+(6644, 9597, 0, 0, 4, 4, 44, 644, 644, 1644, 6644, 88, 89, 'OVAAAA', 'DFOAAA', 'HHHHxx'),
+(5207, 9598, 1, 3, 7, 7, 7, 207, 1207, 207, 5207, 14, 15, 'HSAAAA', 'EFOAAA', 'OOOOxx'),
+(1736, 9599, 0, 0, 6, 16, 36, 736, 1736, 1736, 1736, 72, 73, 'UOAAAA', 'FFOAAA', 'VVVVxx'),
+(3547, 9600, 1, 3, 7, 7, 47, 547, 1547, 3547, 3547, 94, 95, 'LGAAAA', 'GFOAAA', 'AAAAxx'),
+(6647, 9601, 1, 3, 7, 7, 47, 647, 647, 1647, 6647, 94, 95, 'RVAAAA', 'HFOAAA', 'HHHHxx'),
+(4107, 9602, 1, 3, 7, 7, 7, 107, 107, 4107, 4107, 14, 15, 'ZBAAAA', 'IFOAAA', 'OOOOxx'),
+(8125, 9603, 1, 1, 5, 5, 25, 125, 125, 3125, 8125, 50, 51, 'NAAAAA', 'JFOAAA', 'VVVVxx'),
+(9223, 9604, 1, 3, 3, 3, 23, 223, 1223, 4223, 9223, 46, 47, 'TQAAAA', 'KFOAAA', 'AAAAxx'),
+(6903, 9605, 1, 3, 3, 3, 3, 903, 903, 1903, 6903, 6, 7, 'NFAAAA', 'LFOAAA', 'HHHHxx'),
+(3639, 9606, 1, 3, 9, 19, 39, 639, 1639, 3639, 3639, 78, 79, 'ZJAAAA', 'MFOAAA', 'OOOOxx'),
+(9606, 9607, 0, 2, 6, 6, 6, 606, 1606, 4606, 9606, 12, 13, 'MFAAAA', 'NFOAAA', 'VVVVxx'),
+(3232, 9608, 0, 0, 2, 12, 32, 232, 1232, 3232, 3232, 64, 65, 'IUAAAA', 'OFOAAA', 'AAAAxx'),
+(2063, 9609, 1, 3, 3, 3, 63, 63, 63, 2063, 2063, 126, 127, 'JBAAAA', 'PFOAAA', 'HHHHxx'),
+(3731, 9610, 1, 3, 1, 11, 31, 731, 1731, 3731, 3731, 62, 63, 'NNAAAA', 'QFOAAA', 'OOOOxx'),
+(2558, 9611, 0, 2, 8, 18, 58, 558, 558, 2558, 2558, 116, 117, 'KUAAAA', 'RFOAAA', 'VVVVxx'),
+(2357, 9612, 1, 1, 7, 17, 57, 357, 357, 2357, 2357, 114, 115, 'RMAAAA', 'SFOAAA', 'AAAAxx'),
+(6008, 9613, 0, 0, 8, 8, 8, 8, 8, 1008, 6008, 16, 17, 'CXAAAA', 'TFOAAA', 'HHHHxx'),
+(8246, 9614, 0, 2, 6, 6, 46, 246, 246, 3246, 8246, 92, 93, 'EFAAAA', 'UFOAAA', 'OOOOxx'),
+(8220, 9615, 0, 0, 0, 0, 20, 220, 220, 3220, 8220, 40, 41, 'EEAAAA', 'VFOAAA', 'VVVVxx'),
+(1075, 9616, 1, 3, 5, 15, 75, 75, 1075, 1075, 1075, 150, 151, 'JPAAAA', 'WFOAAA', 'AAAAxx'),
+(2410, 9617, 0, 2, 0, 10, 10, 410, 410, 2410, 2410, 20, 21, 'SOAAAA', 'XFOAAA', 'HHHHxx'),
+(3253, 9618, 1, 1, 3, 13, 53, 253, 1253, 3253, 3253, 106, 107, 'DVAAAA', 'YFOAAA', 'OOOOxx'),
+(4370, 9619, 0, 2, 0, 10, 70, 370, 370, 4370, 4370, 140, 141, 'CMAAAA', 'ZFOAAA', 'VVVVxx'),
+(8426, 9620, 0, 2, 6, 6, 26, 426, 426, 3426, 8426, 52, 53, 'CMAAAA', 'AGOAAA', 'AAAAxx'),
+(2262, 9621, 0, 2, 2, 2, 62, 262, 262, 2262, 2262, 124, 125, 'AJAAAA', 'BGOAAA', 'HHHHxx'),
+(4149, 9622, 1, 1, 9, 9, 49, 149, 149, 4149, 4149, 98, 99, 'PDAAAA', 'CGOAAA', 'OOOOxx'),
+(2732, 9623, 0, 0, 2, 12, 32, 732, 732, 2732, 2732, 64, 65, 'CBAAAA', 'DGOAAA', 'VVVVxx'),
+(8606, 9624, 0, 2, 6, 6, 6, 606, 606, 3606, 8606, 12, 13, 'ATAAAA', 'EGOAAA', 'AAAAxx'),
+(6311, 9625, 1, 3, 1, 11, 11, 311, 311, 1311, 6311, 22, 23, 'TIAAAA', 'FGOAAA', 'HHHHxx'),
+(7223, 9626, 1, 3, 3, 3, 23, 223, 1223, 2223, 7223, 46, 47, 'VRAAAA', 'GGOAAA', 'OOOOxx'),
+(3054, 9627, 0, 2, 4, 14, 54, 54, 1054, 3054, 3054, 108, 109, 'MNAAAA', 'HGOAAA', 'VVVVxx'),
+(3952, 9628, 0, 0, 2, 12, 52, 952, 1952, 3952, 3952, 104, 105, 'AWAAAA', 'IGOAAA', 'AAAAxx'),
+(8252, 9629, 0, 0, 2, 12, 52, 252, 252, 3252, 8252, 104, 105, 'KFAAAA', 'JGOAAA', 'HHHHxx'),
+(6020, 9630, 0, 0, 0, 0, 20, 20, 20, 1020, 6020, 40, 41, 'OXAAAA', 'KGOAAA', 'OOOOxx'),
+(3846, 9631, 0, 2, 6, 6, 46, 846, 1846, 3846, 3846, 92, 93, 'YRAAAA', 'LGOAAA', 'VVVVxx'),
+(3755, 9632, 1, 3, 5, 15, 55, 755, 1755, 3755, 3755, 110, 111, 'LOAAAA', 'MGOAAA', 'AAAAxx'),
+(3765, 9633, 1, 1, 5, 5, 65, 765, 1765, 3765, 3765, 130, 131, 'VOAAAA', 'NGOAAA', 'HHHHxx'),
+(3434, 9634, 0, 2, 4, 14, 34, 434, 1434, 3434, 3434, 68, 69, 'CCAAAA', 'OGOAAA', 'OOOOxx'),
+(1381, 9635, 1, 1, 1, 1, 81, 381, 1381, 1381, 1381, 162, 163, 'DBAAAA', 'PGOAAA', 'VVVVxx'),
+(287, 9636, 1, 3, 7, 7, 87, 287, 287, 287, 287, 174, 175, 'BLAAAA', 'QGOAAA', 'AAAAxx'),
+(4476, 9637, 0, 0, 6, 16, 76, 476, 476, 4476, 4476, 152, 153, 'EQAAAA', 'RGOAAA', 'HHHHxx'),
+(2916, 9638, 0, 0, 6, 16, 16, 916, 916, 2916, 2916, 32, 33, 'EIAAAA', 'SGOAAA', 'OOOOxx'),
+(4517, 9639, 1, 1, 7, 17, 17, 517, 517, 4517, 4517, 34, 35, 'TRAAAA', 'TGOAAA', 'VVVVxx'),
+(4561, 9640, 1, 1, 1, 1, 61, 561, 561, 4561, 4561, 122, 123, 'LTAAAA', 'UGOAAA', 'AAAAxx'),
+(5106, 9641, 0, 2, 6, 6, 6, 106, 1106, 106, 5106, 12, 13, 'KOAAAA', 'VGOAAA', 'HHHHxx'),
+(2077, 9642, 1, 1, 7, 17, 77, 77, 77, 2077, 2077, 154, 155, 'XBAAAA', 'WGOAAA', 'OOOOxx'),
+(5269, 9643, 1, 1, 9, 9, 69, 269, 1269, 269, 5269, 138, 139, 'RUAAAA', 'XGOAAA', 'VVVVxx'),
+(5688, 9644, 0, 0, 8, 8, 88, 688, 1688, 688, 5688, 176, 177, 'UKAAAA', 'YGOAAA', 'AAAAxx'),
+(8831, 9645, 1, 3, 1, 11, 31, 831, 831, 3831, 8831, 62, 63, 'RBAAAA', 'ZGOAAA', 'HHHHxx'),
+(3867, 9646, 1, 3, 7, 7, 67, 867, 1867, 3867, 3867, 134, 135, 'TSAAAA', 'AHOAAA', 'OOOOxx'),
+(6062, 9647, 0, 2, 2, 2, 62, 62, 62, 1062, 6062, 124, 125, 'EZAAAA', 'BHOAAA', 'VVVVxx'),
+(8460, 9648, 0, 0, 0, 0, 60, 460, 460, 3460, 8460, 120, 121, 'KNAAAA', 'CHOAAA', 'AAAAxx'),
+(3138, 9649, 0, 2, 8, 18, 38, 138, 1138, 3138, 3138, 76, 77, 'SQAAAA', 'DHOAAA', 'HHHHxx'),
+(3173, 9650, 1, 1, 3, 13, 73, 173, 1173, 3173, 3173, 146, 147, 'BSAAAA', 'EHOAAA', 'OOOOxx'),
+(7018, 9651, 0, 2, 8, 18, 18, 18, 1018, 2018, 7018, 36, 37, 'YJAAAA', 'FHOAAA', 'VVVVxx'),
+(4836, 9652, 0, 0, 6, 16, 36, 836, 836, 4836, 4836, 72, 73, 'AEAAAA', 'GHOAAA', 'AAAAxx'),
+(1007, 9653, 1, 3, 7, 7, 7, 7, 1007, 1007, 1007, 14, 15, 'TMAAAA', 'HHOAAA', 'HHHHxx'),
+(658, 9654, 0, 2, 8, 18, 58, 658, 658, 658, 658, 116, 117, 'IZAAAA', 'IHOAAA', 'OOOOxx'),
+(5205, 9655, 1, 1, 5, 5, 5, 205, 1205, 205, 5205, 10, 11, 'FSAAAA', 'JHOAAA', 'VVVVxx'),
+(5805, 9656, 1, 1, 5, 5, 5, 805, 1805, 805, 5805, 10, 11, 'HPAAAA', 'KHOAAA', 'AAAAxx'),
+(5959, 9657, 1, 3, 9, 19, 59, 959, 1959, 959, 5959, 118, 119, 'FVAAAA', 'LHOAAA', 'HHHHxx'),
+(2863, 9658, 1, 3, 3, 3, 63, 863, 863, 2863, 2863, 126, 127, 'DGAAAA', 'MHOAAA', 'OOOOxx'),
+(7272, 9659, 0, 0, 2, 12, 72, 272, 1272, 2272, 7272, 144, 145, 'STAAAA', 'NHOAAA', 'VVVVxx'),
+(8437, 9660, 1, 1, 7, 17, 37, 437, 437, 3437, 8437, 74, 75, 'NMAAAA', 'OHOAAA', 'AAAAxx'),
+(4900, 9661, 0, 0, 0, 0, 0, 900, 900, 4900, 4900, 0, 1, 'MGAAAA', 'PHOAAA', 'HHHHxx'),
+(890, 9662, 0, 2, 0, 10, 90, 890, 890, 890, 890, 180, 181, 'GIAAAA', 'QHOAAA', 'OOOOxx'),
+(3530, 9663, 0, 2, 0, 10, 30, 530, 1530, 3530, 3530, 60, 61, 'UFAAAA', 'RHOAAA', 'VVVVxx'),
+(6209, 9664, 1, 1, 9, 9, 9, 209, 209, 1209, 6209, 18, 19, 'VEAAAA', 'SHOAAA', 'AAAAxx'),
+(4595, 9665, 1, 3, 5, 15, 95, 595, 595, 4595, 4595, 190, 191, 'TUAAAA', 'THOAAA', 'HHHHxx'),
+(5982, 9666, 0, 2, 2, 2, 82, 982, 1982, 982, 5982, 164, 165, 'CWAAAA', 'UHOAAA', 'OOOOxx'),
+(1101, 9667, 1, 1, 1, 1, 1, 101, 1101, 1101, 1101, 2, 3, 'JQAAAA', 'VHOAAA', 'VVVVxx'),
+(9555, 9668, 1, 3, 5, 15, 55, 555, 1555, 4555, 9555, 110, 111, 'NDAAAA', 'WHOAAA', 'AAAAxx'),
+(1918, 9669, 0, 2, 8, 18, 18, 918, 1918, 1918, 1918, 36, 37, 'UVAAAA', 'XHOAAA', 'HHHHxx'),
+(3527, 9670, 1, 3, 7, 7, 27, 527, 1527, 3527, 3527, 54, 55, 'RFAAAA', 'YHOAAA', 'OOOOxx'),
+(7309, 9671, 1, 1, 9, 9, 9, 309, 1309, 2309, 7309, 18, 19, 'DVAAAA', 'ZHOAAA', 'VVVVxx'),
+(8213, 9672, 1, 1, 3, 13, 13, 213, 213, 3213, 8213, 26, 27, 'XDAAAA', 'AIOAAA', 'AAAAxx'),
+(306, 9673, 0, 2, 6, 6, 6, 306, 306, 306, 306, 12, 13, 'ULAAAA', 'BIOAAA', 'HHHHxx'),
+(845, 9674, 1, 1, 5, 5, 45, 845, 845, 845, 845, 90, 91, 'NGAAAA', 'CIOAAA', 'OOOOxx'),
+(16, 9675, 0, 0, 6, 16, 16, 16, 16, 16, 16, 32, 33, 'QAAAAA', 'DIOAAA', 'VVVVxx'),
+(437, 9676, 1, 1, 7, 17, 37, 437, 437, 437, 437, 74, 75, 'VQAAAA', 'EIOAAA', 'AAAAxx'),
+(9518, 9677, 0, 2, 8, 18, 18, 518, 1518, 4518, 9518, 36, 37, 'CCAAAA', 'FIOAAA', 'HHHHxx'),
+(2142, 9678, 0, 2, 2, 2, 42, 142, 142, 2142, 2142, 84, 85, 'KEAAAA', 'GIOAAA', 'OOOOxx'),
+(8121, 9679, 1, 1, 1, 1, 21, 121, 121, 3121, 8121, 42, 43, 'JAAAAA', 'HIOAAA', 'VVVVxx'),
+(7354, 9680, 0, 2, 4, 14, 54, 354, 1354, 2354, 7354, 108, 109, 'WWAAAA', 'IIOAAA', 'AAAAxx'),
+(1720, 9681, 0, 0, 0, 0, 20, 720, 1720, 1720, 1720, 40, 41, 'EOAAAA', 'JIOAAA', 'HHHHxx'),
+(6078, 9682, 0, 2, 8, 18, 78, 78, 78, 1078, 6078, 156, 157, 'UZAAAA', 'KIOAAA', 'OOOOxx'),
+(5929, 9683, 1, 1, 9, 9, 29, 929, 1929, 929, 5929, 58, 59, 'BUAAAA', 'LIOAAA', 'VVVVxx'),
+(3856, 9684, 0, 0, 6, 16, 56, 856, 1856, 3856, 3856, 112, 113, 'ISAAAA', 'MIOAAA', 'AAAAxx'),
+(3424, 9685, 0, 0, 4, 4, 24, 424, 1424, 3424, 3424, 48, 49, 'SBAAAA', 'NIOAAA', 'HHHHxx'),
+(1712, 9686, 0, 0, 2, 12, 12, 712, 1712, 1712, 1712, 24, 25, 'WNAAAA', 'OIOAAA', 'OOOOxx'),
+(2340, 9687, 0, 0, 0, 0, 40, 340, 340, 2340, 2340, 80, 81, 'AMAAAA', 'PIOAAA', 'VVVVxx'),
+(5570, 9688, 0, 2, 0, 10, 70, 570, 1570, 570, 5570, 140, 141, 'GGAAAA', 'QIOAAA', 'AAAAxx'),
+(8734, 9689, 0, 2, 4, 14, 34, 734, 734, 3734, 8734, 68, 69, 'YXAAAA', 'RIOAAA', 'HHHHxx'),
+(6077, 9690, 1, 1, 7, 17, 77, 77, 77, 1077, 6077, 154, 155, 'TZAAAA', 'SIOAAA', 'OOOOxx'),
+(2960, 9691, 0, 0, 0, 0, 60, 960, 960, 2960, 2960, 120, 121, 'WJAAAA', 'TIOAAA', 'VVVVxx'),
+(5062, 9692, 0, 2, 2, 2, 62, 62, 1062, 62, 5062, 124, 125, 'SMAAAA', 'UIOAAA', 'AAAAxx'),
+(1532, 9693, 0, 0, 2, 12, 32, 532, 1532, 1532, 1532, 64, 65, 'YGAAAA', 'VIOAAA', 'HHHHxx'),
+(8298, 9694, 0, 2, 8, 18, 98, 298, 298, 3298, 8298, 196, 197, 'EHAAAA', 'WIOAAA', 'OOOOxx'),
+(2496, 9695, 0, 0, 6, 16, 96, 496, 496, 2496, 2496, 192, 193, 'ASAAAA', 'XIOAAA', 'VVVVxx'),
+(8412, 9696, 0, 0, 2, 12, 12, 412, 412, 3412, 8412, 24, 25, 'OLAAAA', 'YIOAAA', 'AAAAxx'),
+(724, 9697, 0, 0, 4, 4, 24, 724, 724, 724, 724, 48, 49, 'WBAAAA', 'ZIOAAA', 'HHHHxx'),
+(1019, 9698, 1, 3, 9, 19, 19, 19, 1019, 1019, 1019, 38, 39, 'FNAAAA', 'AJOAAA', 'OOOOxx'),
+(6265, 9699, 1, 1, 5, 5, 65, 265, 265, 1265, 6265, 130, 131, 'ZGAAAA', 'BJOAAA', 'VVVVxx'),
+(740, 9700, 0, 0, 0, 0, 40, 740, 740, 740, 740, 80, 81, 'MCAAAA', 'CJOAAA', 'AAAAxx'),
+(8495, 9701, 1, 3, 5, 15, 95, 495, 495, 3495, 8495, 190, 191, 'TOAAAA', 'DJOAAA', 'HHHHxx'),
+(6983, 9702, 1, 3, 3, 3, 83, 983, 983, 1983, 6983, 166, 167, 'PIAAAA', 'EJOAAA', 'OOOOxx'),
+(991, 9703, 1, 3, 1, 11, 91, 991, 991, 991, 991, 182, 183, 'DMAAAA', 'FJOAAA', 'VVVVxx'),
+(3189, 9704, 1, 1, 9, 9, 89, 189, 1189, 3189, 3189, 178, 179, 'RSAAAA', 'GJOAAA', 'AAAAxx'),
+(4487, 9705, 1, 3, 7, 7, 87, 487, 487, 4487, 4487, 174, 175, 'PQAAAA', 'HJOAAA', 'HHHHxx'),
+(5554, 9706, 0, 2, 4, 14, 54, 554, 1554, 554, 5554, 108, 109, 'QFAAAA', 'IJOAAA', 'OOOOxx'),
+(1258, 9707, 0, 2, 8, 18, 58, 258, 1258, 1258, 1258, 116, 117, 'KWAAAA', 'JJOAAA', 'VVVVxx'),
+(5359, 9708, 1, 3, 9, 19, 59, 359, 1359, 359, 5359, 118, 119, 'DYAAAA', 'KJOAAA', 'AAAAxx'),
+(2709, 9709, 1, 1, 9, 9, 9, 709, 709, 2709, 2709, 18, 19, 'FAAAAA', 'LJOAAA', 'HHHHxx'),
+(361, 9710, 1, 1, 1, 1, 61, 361, 361, 361, 361, 122, 123, 'XNAAAA', 'MJOAAA', 'OOOOxx'),
+(4028, 9711, 0, 0, 8, 8, 28, 28, 28, 4028, 4028, 56, 57, 'YYAAAA', 'NJOAAA', 'VVVVxx'),
+(3735, 9712, 1, 3, 5, 15, 35, 735, 1735, 3735, 3735, 70, 71, 'RNAAAA', 'OJOAAA', 'AAAAxx'),
+(4427, 9713, 1, 3, 7, 7, 27, 427, 427, 4427, 4427, 54, 55, 'HOAAAA', 'PJOAAA', 'HHHHxx'),
+(7540, 9714, 0, 0, 0, 0, 40, 540, 1540, 2540, 7540, 80, 81, 'AEAAAA', 'QJOAAA', 'OOOOxx'),
+(3569, 9715, 1, 1, 9, 9, 69, 569, 1569, 3569, 3569, 138, 139, 'HHAAAA', 'RJOAAA', 'VVVVxx'),
+(1916, 9716, 0, 0, 6, 16, 16, 916, 1916, 1916, 1916, 32, 33, 'SVAAAA', 'SJOAAA', 'AAAAxx'),
+(7596, 9717, 0, 0, 6, 16, 96, 596, 1596, 2596, 7596, 192, 193, 'EGAAAA', 'TJOAAA', 'HHHHxx'),
+(9721, 9718, 1, 1, 1, 1, 21, 721, 1721, 4721, 9721, 42, 43, 'XJAAAA', 'UJOAAA', 'OOOOxx'),
+(4429, 9719, 1, 1, 9, 9, 29, 429, 429, 4429, 4429, 58, 59, 'JOAAAA', 'VJOAAA', 'VVVVxx'),
+(3471, 9720, 1, 3, 1, 11, 71, 471, 1471, 3471, 3471, 142, 143, 'NDAAAA', 'WJOAAA', 'AAAAxx'),
+(1157, 9721, 1, 1, 7, 17, 57, 157, 1157, 1157, 1157, 114, 115, 'NSAAAA', 'XJOAAA', 'HHHHxx'),
+(5700, 9722, 0, 0, 0, 0, 0, 700, 1700, 700, 5700, 0, 1, 'GLAAAA', 'YJOAAA', 'OOOOxx'),
+(4431, 9723, 1, 3, 1, 11, 31, 431, 431, 4431, 4431, 62, 63, 'LOAAAA', 'ZJOAAA', 'VVVVxx'),
+(9409, 9724, 1, 1, 9, 9, 9, 409, 1409, 4409, 9409, 18, 19, 'XXAAAA', 'AKOAAA', 'AAAAxx'),
+(8752, 9725, 0, 0, 2, 12, 52, 752, 752, 3752, 8752, 104, 105, 'QYAAAA', 'BKOAAA', 'HHHHxx'),
+(9484, 9726, 0, 0, 4, 4, 84, 484, 1484, 4484, 9484, 168, 169, 'UAAAAA', 'CKOAAA', 'OOOOxx'),
+(1266, 9727, 0, 2, 6, 6, 66, 266, 1266, 1266, 1266, 132, 133, 'SWAAAA', 'DKOAAA', 'VVVVxx'),
+(9097, 9728, 1, 1, 7, 17, 97, 97, 1097, 4097, 9097, 194, 195, 'XLAAAA', 'EKOAAA', 'AAAAxx'),
+(3068, 9729, 0, 0, 8, 8, 68, 68, 1068, 3068, 3068, 136, 137, 'AOAAAA', 'FKOAAA', 'HHHHxx'),
+(5490, 9730, 0, 2, 0, 10, 90, 490, 1490, 490, 5490, 180, 181, 'EDAAAA', 'GKOAAA', 'OOOOxx'),
+(1375, 9731, 1, 3, 5, 15, 75, 375, 1375, 1375, 1375, 150, 151, 'XAAAAA', 'HKOAAA', 'VVVVxx'),
+(2487, 9732, 1, 3, 7, 7, 87, 487, 487, 2487, 2487, 174, 175, 'RRAAAA', 'IKOAAA', 'AAAAxx'),
+(1705, 9733, 1, 1, 5, 5, 5, 705, 1705, 1705, 1705, 10, 11, 'PNAAAA', 'JKOAAA', 'HHHHxx'),
+(1571, 9734, 1, 3, 1, 11, 71, 571, 1571, 1571, 1571, 142, 143, 'LIAAAA', 'KKOAAA', 'OOOOxx'),
+(4005, 9735, 1, 1, 5, 5, 5, 5, 5, 4005, 4005, 10, 11, 'BYAAAA', 'LKOAAA', 'VVVVxx'),
+(5497, 9736, 1, 1, 7, 17, 97, 497, 1497, 497, 5497, 194, 195, 'LDAAAA', 'MKOAAA', 'AAAAxx'),
+(2144, 9737, 0, 0, 4, 4, 44, 144, 144, 2144, 2144, 88, 89, 'MEAAAA', 'NKOAAA', 'HHHHxx'),
+(4052, 9738, 0, 0, 2, 12, 52, 52, 52, 4052, 4052, 104, 105, 'WZAAAA', 'OKOAAA', 'OOOOxx'),
+(4942, 9739, 0, 2, 2, 2, 42, 942, 942, 4942, 4942, 84, 85, 'CIAAAA', 'PKOAAA', 'VVVVxx'),
+(5504, 9740, 0, 0, 4, 4, 4, 504, 1504, 504, 5504, 8, 9, 'SDAAAA', 'QKOAAA', 'AAAAxx'),
+(2913, 9741, 1, 1, 3, 13, 13, 913, 913, 2913, 2913, 26, 27, 'BIAAAA', 'RKOAAA', 'HHHHxx'),
+(5617, 9742, 1, 1, 7, 17, 17, 617, 1617, 617, 5617, 34, 35, 'BIAAAA', 'SKOAAA', 'OOOOxx'),
+(8179, 9743, 1, 3, 9, 19, 79, 179, 179, 3179, 8179, 158, 159, 'PCAAAA', 'TKOAAA', 'VVVVxx'),
+(9437, 9744, 1, 1, 7, 17, 37, 437, 1437, 4437, 9437, 74, 75, 'ZYAAAA', 'UKOAAA', 'AAAAxx'),
+(1821, 9745, 1, 1, 1, 1, 21, 821, 1821, 1821, 1821, 42, 43, 'BSAAAA', 'VKOAAA', 'HHHHxx'),
+(5737, 9746, 1, 1, 7, 17, 37, 737, 1737, 737, 5737, 74, 75, 'RMAAAA', 'WKOAAA', 'OOOOxx'),
+(4207, 9747, 1, 3, 7, 7, 7, 207, 207, 4207, 4207, 14, 15, 'VFAAAA', 'XKOAAA', 'VVVVxx'),
+(4815, 9748, 1, 3, 5, 15, 15, 815, 815, 4815, 4815, 30, 31, 'FDAAAA', 'YKOAAA', 'AAAAxx'),
+(8707, 9749, 1, 3, 7, 7, 7, 707, 707, 3707, 8707, 14, 15, 'XWAAAA', 'ZKOAAA', 'HHHHxx'),
+(5970, 9750, 0, 2, 0, 10, 70, 970, 1970, 970, 5970, 140, 141, 'QVAAAA', 'ALOAAA', 'OOOOxx'),
+(5501, 9751, 1, 1, 1, 1, 1, 501, 1501, 501, 5501, 2, 3, 'PDAAAA', 'BLOAAA', 'VVVVxx'),
+(4013, 9752, 1, 1, 3, 13, 13, 13, 13, 4013, 4013, 26, 27, 'JYAAAA', 'CLOAAA', 'AAAAxx'),
+(9235, 9753, 1, 3, 5, 15, 35, 235, 1235, 4235, 9235, 70, 71, 'FRAAAA', 'DLOAAA', 'HHHHxx'),
+(2503, 9754, 1, 3, 3, 3, 3, 503, 503, 2503, 2503, 6, 7, 'HSAAAA', 'ELOAAA', 'OOOOxx'),
+(9181, 9755, 1, 1, 1, 1, 81, 181, 1181, 4181, 9181, 162, 163, 'DPAAAA', 'FLOAAA', 'VVVVxx'),
+(2289, 9756, 1, 1, 9, 9, 89, 289, 289, 2289, 2289, 178, 179, 'BKAAAA', 'GLOAAA', 'AAAAxx'),
+(4256, 9757, 0, 0, 6, 16, 56, 256, 256, 4256, 4256, 112, 113, 'SHAAAA', 'HLOAAA', 'HHHHxx'),
+(191, 9758, 1, 3, 1, 11, 91, 191, 191, 191, 191, 182, 183, 'JHAAAA', 'ILOAAA', 'OOOOxx'),
+(9655, 9759, 1, 3, 5, 15, 55, 655, 1655, 4655, 9655, 110, 111, 'JHAAAA', 'JLOAAA', 'VVVVxx'),
+(8615, 9760, 1, 3, 5, 15, 15, 615, 615, 3615, 8615, 30, 31, 'JTAAAA', 'KLOAAA', 'AAAAxx'),
+(3011, 9761, 1, 3, 1, 11, 11, 11, 1011, 3011, 3011, 22, 23, 'VLAAAA', 'LLOAAA', 'HHHHxx'),
+(6376, 9762, 0, 0, 6, 16, 76, 376, 376, 1376, 6376, 152, 153, 'GLAAAA', 'MLOAAA', 'OOOOxx'),
+(68, 9763, 0, 0, 8, 8, 68, 68, 68, 68, 68, 136, 137, 'QCAAAA', 'NLOAAA', 'VVVVxx'),
+(4720, 9764, 0, 0, 0, 0, 20, 720, 720, 4720, 4720, 40, 41, 'OZAAAA', 'OLOAAA', 'AAAAxx'),
+(6848, 9765, 0, 0, 8, 8, 48, 848, 848, 1848, 6848, 96, 97, 'KDAAAA', 'PLOAAA', 'HHHHxx'),
+(456, 9766, 0, 0, 6, 16, 56, 456, 456, 456, 456, 112, 113, 'ORAAAA', 'QLOAAA', 'OOOOxx'),
+(5887, 9767, 1, 3, 7, 7, 87, 887, 1887, 887, 5887, 174, 175, 'LSAAAA', 'RLOAAA', 'VVVVxx'),
+(9249, 9768, 1, 1, 9, 9, 49, 249, 1249, 4249, 9249, 98, 99, 'TRAAAA', 'SLOAAA', 'AAAAxx'),
+(4041, 9769, 1, 1, 1, 1, 41, 41, 41, 4041, 4041, 82, 83, 'LZAAAA', 'TLOAAA', 'HHHHxx'),
+(2304, 9770, 0, 0, 4, 4, 4, 304, 304, 2304, 2304, 8, 9, 'QKAAAA', 'ULOAAA', 'OOOOxx'),
+(8763, 9771, 1, 3, 3, 3, 63, 763, 763, 3763, 8763, 126, 127, 'BZAAAA', 'VLOAAA', 'VVVVxx'),
+(2115, 9772, 1, 3, 5, 15, 15, 115, 115, 2115, 2115, 30, 31, 'JDAAAA', 'WLOAAA', 'AAAAxx'),
+(8014, 9773, 0, 2, 4, 14, 14, 14, 14, 3014, 8014, 28, 29, 'GWAAAA', 'XLOAAA', 'HHHHxx'),
+(9895, 9774, 1, 3, 5, 15, 95, 895, 1895, 4895, 9895, 190, 191, 'PQAAAA', 'YLOAAA', 'OOOOxx'),
+(671, 9775, 1, 3, 1, 11, 71, 671, 671, 671, 671, 142, 143, 'VZAAAA', 'ZLOAAA', 'VVVVxx'),
+(3774, 9776, 0, 2, 4, 14, 74, 774, 1774, 3774, 3774, 148, 149, 'EPAAAA', 'AMOAAA', 'AAAAxx'),
+(134, 9777, 0, 2, 4, 14, 34, 134, 134, 134, 134, 68, 69, 'EFAAAA', 'BMOAAA', 'HHHHxx'),
+(534, 9778, 0, 2, 4, 14, 34, 534, 534, 534, 534, 68, 69, 'OUAAAA', 'CMOAAA', 'OOOOxx'),
+(7308, 9779, 0, 0, 8, 8, 8, 308, 1308, 2308, 7308, 16, 17, 'CVAAAA', 'DMOAAA', 'VVVVxx'),
+(5244, 9780, 0, 0, 4, 4, 44, 244, 1244, 244, 5244, 88, 89, 'STAAAA', 'EMOAAA', 'AAAAxx'),
+(1512, 9781, 0, 0, 2, 12, 12, 512, 1512, 1512, 1512, 24, 25, 'EGAAAA', 'FMOAAA', 'HHHHxx'),
+(8960, 9782, 0, 0, 0, 0, 60, 960, 960, 3960, 8960, 120, 121, 'QGAAAA', 'GMOAAA', 'OOOOxx'),
+(6602, 9783, 0, 2, 2, 2, 2, 602, 602, 1602, 6602, 4, 5, 'YTAAAA', 'HMOAAA', 'VVVVxx'),
+(593, 9784, 1, 1, 3, 13, 93, 593, 593, 593, 593, 186, 187, 'VWAAAA', 'IMOAAA', 'AAAAxx'),
+(2353, 9785, 1, 1, 3, 13, 53, 353, 353, 2353, 2353, 106, 107, 'NMAAAA', 'JMOAAA', 'HHHHxx'),
+(4139, 9786, 1, 3, 9, 19, 39, 139, 139, 4139, 4139, 78, 79, 'FDAAAA', 'KMOAAA', 'OOOOxx'),
+(3063, 9787, 1, 3, 3, 3, 63, 63, 1063, 3063, 3063, 126, 127, 'VNAAAA', 'LMOAAA', 'VVVVxx'),
+(652, 9788, 0, 0, 2, 12, 52, 652, 652, 652, 652, 104, 105, 'CZAAAA', 'MMOAAA', 'AAAAxx'),
+(7405, 9789, 1, 1, 5, 5, 5, 405, 1405, 2405, 7405, 10, 11, 'VYAAAA', 'NMOAAA', 'HHHHxx'),
+(3034, 9790, 0, 2, 4, 14, 34, 34, 1034, 3034, 3034, 68, 69, 'SMAAAA', 'OMOAAA', 'OOOOxx'),
+(4614, 9791, 0, 2, 4, 14, 14, 614, 614, 4614, 4614, 28, 29, 'MVAAAA', 'PMOAAA', 'VVVVxx'),
+(2351, 9792, 1, 3, 1, 11, 51, 351, 351, 2351, 2351, 102, 103, 'LMAAAA', 'QMOAAA', 'AAAAxx'),
+(8208, 9793, 0, 0, 8, 8, 8, 208, 208, 3208, 8208, 16, 17, 'SDAAAA', 'RMOAAA', 'HHHHxx'),
+(5475, 9794, 1, 3, 5, 15, 75, 475, 1475, 475, 5475, 150, 151, 'PCAAAA', 'SMOAAA', 'OOOOxx'),
+(6875, 9795, 1, 3, 5, 15, 75, 875, 875, 1875, 6875, 150, 151, 'LEAAAA', 'TMOAAA', 'VVVVxx'),
+(563, 9796, 1, 3, 3, 3, 63, 563, 563, 563, 563, 126, 127, 'RVAAAA', 'UMOAAA', 'AAAAxx'),
+(3346, 9797, 0, 2, 6, 6, 46, 346, 1346, 3346, 3346, 92, 93, 'SYAAAA', 'VMOAAA', 'HHHHxx'),
+(291, 9798, 1, 3, 1, 11, 91, 291, 291, 291, 291, 182, 183, 'FLAAAA', 'WMOAAA', 'OOOOxx'),
+(6345, 9799, 1, 1, 5, 5, 45, 345, 345, 1345, 6345, 90, 91, 'BKAAAA', 'XMOAAA', 'VVVVxx'),
+(8099, 9800, 1, 3, 9, 19, 99, 99, 99, 3099, 8099, 198, 199, 'NZAAAA', 'YMOAAA', 'AAAAxx'),
+(2078, 9801, 0, 2, 8, 18, 78, 78, 78, 2078, 2078, 156, 157, 'YBAAAA', 'ZMOAAA', 'HHHHxx'),
+(8238, 9802, 0, 2, 8, 18, 38, 238, 238, 3238, 8238, 76, 77, 'WEAAAA', 'ANOAAA', 'OOOOxx'),
+(4482, 9803, 0, 2, 2, 2, 82, 482, 482, 4482, 4482, 164, 165, 'KQAAAA', 'BNOAAA', 'VVVVxx'),
+(716, 9804, 0, 0, 6, 16, 16, 716, 716, 716, 716, 32, 33, 'OBAAAA', 'CNOAAA', 'AAAAxx'),
+(7288, 9805, 0, 0, 8, 8, 88, 288, 1288, 2288, 7288, 176, 177, 'IUAAAA', 'DNOAAA', 'HHHHxx'),
+(5906, 9806, 0, 2, 6, 6, 6, 906, 1906, 906, 5906, 12, 13, 'ETAAAA', 'ENOAAA', 'OOOOxx'),
+(5618, 9807, 0, 2, 8, 18, 18, 618, 1618, 618, 5618, 36, 37, 'CIAAAA', 'FNOAAA', 'VVVVxx'),
+(1141, 9808, 1, 1, 1, 1, 41, 141, 1141, 1141, 1141, 82, 83, 'XRAAAA', 'GNOAAA', 'AAAAxx'),
+(8231, 9809, 1, 3, 1, 11, 31, 231, 231, 3231, 8231, 62, 63, 'PEAAAA', 'HNOAAA', 'HHHHxx'),
+(3713, 9810, 1, 1, 3, 13, 13, 713, 1713, 3713, 3713, 26, 27, 'VMAAAA', 'INOAAA', 'OOOOxx'),
+(9158, 9811, 0, 2, 8, 18, 58, 158, 1158, 4158, 9158, 116, 117, 'GOAAAA', 'JNOAAA', 'VVVVxx'),
+(4051, 9812, 1, 3, 1, 11, 51, 51, 51, 4051, 4051, 102, 103, 'VZAAAA', 'KNOAAA', 'AAAAxx'),
+(1973, 9813, 1, 1, 3, 13, 73, 973, 1973, 1973, 1973, 146, 147, 'XXAAAA', 'LNOAAA', 'HHHHxx'),
+(6710, 9814, 0, 2, 0, 10, 10, 710, 710, 1710, 6710, 20, 21, 'CYAAAA', 'MNOAAA', 'OOOOxx'),
+(1021, 9815, 1, 1, 1, 1, 21, 21, 1021, 1021, 1021, 42, 43, 'HNAAAA', 'NNOAAA', 'VVVVxx'),
+(2196, 9816, 0, 0, 6, 16, 96, 196, 196, 2196, 2196, 192, 193, 'MGAAAA', 'ONOAAA', 'AAAAxx'),
+(8335, 9817, 1, 3, 5, 15, 35, 335, 335, 3335, 8335, 70, 71, 'PIAAAA', 'PNOAAA', 'HHHHxx'),
+(2272, 9818, 0, 0, 2, 12, 72, 272, 272, 2272, 2272, 144, 145, 'KJAAAA', 'QNOAAA', 'OOOOxx'),
+(3818, 9819, 0, 2, 8, 18, 18, 818, 1818, 3818, 3818, 36, 37, 'WQAAAA', 'RNOAAA', 'VVVVxx'),
+(679, 9820, 1, 3, 9, 19, 79, 679, 679, 679, 679, 158, 159, 'DAAAAA', 'SNOAAA', 'AAAAxx'),
+(7512, 9821, 0, 0, 2, 12, 12, 512, 1512, 2512, 7512, 24, 25, 'YCAAAA', 'TNOAAA', 'HHHHxx'),
+(493, 9822, 1, 1, 3, 13, 93, 493, 493, 493, 493, 186, 187, 'ZSAAAA', 'UNOAAA', 'OOOOxx'),
+(5663, 9823, 1, 3, 3, 3, 63, 663, 1663, 663, 5663, 126, 127, 'VJAAAA', 'VNOAAA', 'VVVVxx'),
+(4655, 9824, 1, 3, 5, 15, 55, 655, 655, 4655, 4655, 110, 111, 'BXAAAA', 'WNOAAA', 'AAAAxx'),
+(3996, 9825, 0, 0, 6, 16, 96, 996, 1996, 3996, 3996, 192, 193, 'SXAAAA', 'XNOAAA', 'HHHHxx'),
+(8797, 9826, 1, 1, 7, 17, 97, 797, 797, 3797, 8797, 194, 195, 'JAAAAA', 'YNOAAA', 'OOOOxx'),
+(2991, 9827, 1, 3, 1, 11, 91, 991, 991, 2991, 2991, 182, 183, 'BLAAAA', 'ZNOAAA', 'VVVVxx'),
+(7038, 9828, 0, 2, 8, 18, 38, 38, 1038, 2038, 7038, 76, 77, 'SKAAAA', 'AOOAAA', 'AAAAxx'),
+(4174, 9829, 0, 2, 4, 14, 74, 174, 174, 4174, 4174, 148, 149, 'OEAAAA', 'BOOAAA', 'HHHHxx'),
+(6908, 9830, 0, 0, 8, 8, 8, 908, 908, 1908, 6908, 16, 17, 'SFAAAA', 'COOAAA', 'OOOOxx'),
+(8477, 9831, 1, 1, 7, 17, 77, 477, 477, 3477, 8477, 154, 155, 'BOAAAA', 'DOOAAA', 'VVVVxx'),
+(3576, 9832, 0, 0, 6, 16, 76, 576, 1576, 3576, 3576, 152, 153, 'OHAAAA', 'EOOAAA', 'AAAAxx'),
+(2685, 9833, 1, 1, 5, 5, 85, 685, 685, 2685, 2685, 170, 171, 'HZAAAA', 'FOOAAA', 'HHHHxx'),
+(9161, 9834, 1, 1, 1, 1, 61, 161, 1161, 4161, 9161, 122, 123, 'JOAAAA', 'GOOAAA', 'OOOOxx'),
+(2951, 9835, 1, 3, 1, 11, 51, 951, 951, 2951, 2951, 102, 103, 'NJAAAA', 'HOOAAA', 'VVVVxx'),
+(8362, 9836, 0, 2, 2, 2, 62, 362, 362, 3362, 8362, 124, 125, 'QJAAAA', 'IOOAAA', 'AAAAxx'),
+(2379, 9837, 1, 3, 9, 19, 79, 379, 379, 2379, 2379, 158, 159, 'NNAAAA', 'JOOAAA', 'HHHHxx'),
+(1277, 9838, 1, 1, 7, 17, 77, 277, 1277, 1277, 1277, 154, 155, 'DXAAAA', 'KOOAAA', 'OOOOxx'),
+(1728, 9839, 0, 0, 8, 8, 28, 728, 1728, 1728, 1728, 56, 57, 'MOAAAA', 'LOOAAA', 'VVVVxx'),
+(9816, 9840, 0, 0, 6, 16, 16, 816, 1816, 4816, 9816, 32, 33, 'ONAAAA', 'MOOAAA', 'AAAAxx'),
+(6288, 9841, 0, 0, 8, 8, 88, 288, 288, 1288, 6288, 176, 177, 'WHAAAA', 'NOOAAA', 'HHHHxx'),
+(8985, 9842, 1, 1, 5, 5, 85, 985, 985, 3985, 8985, 170, 171, 'PHAAAA', 'OOOAAA', 'OOOOxx'),
+(771, 9843, 1, 3, 1, 11, 71, 771, 771, 771, 771, 142, 143, 'RDAAAA', 'POOAAA', 'VVVVxx'),
+(464, 9844, 0, 0, 4, 4, 64, 464, 464, 464, 464, 128, 129, 'WRAAAA', 'QOOAAA', 'AAAAxx'),
+(9625, 9845, 1, 1, 5, 5, 25, 625, 1625, 4625, 9625, 50, 51, 'FGAAAA', 'ROOAAA', 'HHHHxx'),
+(9608, 9846, 0, 0, 8, 8, 8, 608, 1608, 4608, 9608, 16, 17, 'OFAAAA', 'SOOAAA', 'OOOOxx'),
+(9170, 9847, 0, 2, 0, 10, 70, 170, 1170, 4170, 9170, 140, 141, 'SOAAAA', 'TOOAAA', 'VVVVxx'),
+(9658, 9848, 0, 2, 8, 18, 58, 658, 1658, 4658, 9658, 116, 117, 'MHAAAA', 'UOOAAA', 'AAAAxx'),
+(7515, 9849, 1, 3, 5, 15, 15, 515, 1515, 2515, 7515, 30, 31, 'BDAAAA', 'VOOAAA', 'HHHHxx'),
+(9400, 9850, 0, 0, 0, 0, 0, 400, 1400, 4400, 9400, 0, 1, 'OXAAAA', 'WOOAAA', 'OOOOxx'),
+(2045, 9851, 1, 1, 5, 5, 45, 45, 45, 2045, 2045, 90, 91, 'RAAAAA', 'XOOAAA', 'VVVVxx'),
+(324, 9852, 0, 0, 4, 4, 24, 324, 324, 324, 324, 48, 49, 'MMAAAA', 'YOOAAA', 'AAAAxx'),
+(4252, 9853, 0, 0, 2, 12, 52, 252, 252, 4252, 4252, 104, 105, 'OHAAAA', 'ZOOAAA', 'HHHHxx'),
+(8329, 9854, 1, 1, 9, 9, 29, 329, 329, 3329, 8329, 58, 59, 'JIAAAA', 'APOAAA', 'OOOOxx'),
+(4472, 9855, 0, 0, 2, 12, 72, 472, 472, 4472, 4472, 144, 145, 'AQAAAA', 'BPOAAA', 'VVVVxx'),
+(1047, 9856, 1, 3, 7, 7, 47, 47, 1047, 1047, 1047, 94, 95, 'HOAAAA', 'CPOAAA', 'AAAAxx'),
+(9341, 9857, 1, 1, 1, 1, 41, 341, 1341, 4341, 9341, 82, 83, 'HVAAAA', 'DPOAAA', 'HHHHxx'),
+(7000, 9858, 0, 0, 0, 0, 0, 0, 1000, 2000, 7000, 0, 1, 'GJAAAA', 'EPOAAA', 'OOOOxx'),
+(1429, 9859, 1, 1, 9, 9, 29, 429, 1429, 1429, 1429, 58, 59, 'ZCAAAA', 'FPOAAA', 'VVVVxx'),
+(2701, 9860, 1, 1, 1, 1, 1, 701, 701, 2701, 2701, 2, 3, 'XZAAAA', 'GPOAAA', 'AAAAxx'),
+(6630, 9861, 0, 2, 0, 10, 30, 630, 630, 1630, 6630, 60, 61, 'AVAAAA', 'HPOAAA', 'HHHHxx'),
+(3669, 9862, 1, 1, 9, 9, 69, 669, 1669, 3669, 3669, 138, 139, 'DLAAAA', 'IPOAAA', 'OOOOxx'),
+(8613, 9863, 1, 1, 3, 13, 13, 613, 613, 3613, 8613, 26, 27, 'HTAAAA', 'JPOAAA', 'VVVVxx'),
+(7080, 9864, 0, 0, 0, 0, 80, 80, 1080, 2080, 7080, 160, 161, 'IMAAAA', 'KPOAAA', 'AAAAxx'),
+(8788, 9865, 0, 0, 8, 8, 88, 788, 788, 3788, 8788, 176, 177, 'AAAAAA', 'LPOAAA', 'HHHHxx'),
+(6291, 9866, 1, 3, 1, 11, 91, 291, 291, 1291, 6291, 182, 183, 'ZHAAAA', 'MPOAAA', 'OOOOxx'),
+(7885, 9867, 1, 1, 5, 5, 85, 885, 1885, 2885, 7885, 170, 171, 'HRAAAA', 'NPOAAA', 'VVVVxx'),
+(7160, 9868, 0, 0, 0, 0, 60, 160, 1160, 2160, 7160, 120, 121, 'KPAAAA', 'OPOAAA', 'AAAAxx'),
+(6140, 9869, 0, 0, 0, 0, 40, 140, 140, 1140, 6140, 80, 81, 'ECAAAA', 'PPOAAA', 'HHHHxx'),
+(9881, 9870, 1, 1, 1, 1, 81, 881, 1881, 4881, 9881, 162, 163, 'BQAAAA', 'QPOAAA', 'OOOOxx'),
+(9140, 9871, 0, 0, 0, 0, 40, 140, 1140, 4140, 9140, 80, 81, 'ONAAAA', 'RPOAAA', 'VVVVxx'),
+(644, 9872, 0, 0, 4, 4, 44, 644, 644, 644, 644, 88, 89, 'UYAAAA', 'SPOAAA', 'AAAAxx'),
+(3667, 9873, 1, 3, 7, 7, 67, 667, 1667, 3667, 3667, 134, 135, 'BLAAAA', 'TPOAAA', 'HHHHxx'),
+(2675, 9874, 1, 3, 5, 15, 75, 675, 675, 2675, 2675, 150, 151, 'XYAAAA', 'UPOAAA', 'OOOOxx'),
+(9492, 9875, 0, 0, 2, 12, 92, 492, 1492, 4492, 9492, 184, 185, 'CBAAAA', 'VPOAAA', 'VVVVxx'),
+(5004, 9876, 0, 0, 4, 4, 4, 4, 1004, 4, 5004, 8, 9, 'MKAAAA', 'WPOAAA', 'AAAAxx'),
+(9456, 9877, 0, 0, 6, 16, 56, 456, 1456, 4456, 9456, 112, 113, 'SZAAAA', 'XPOAAA', 'HHHHxx'),
+(8197, 9878, 1, 1, 7, 17, 97, 197, 197, 3197, 8197, 194, 195, 'HDAAAA', 'YPOAAA', 'OOOOxx'),
+(2837, 9879, 1, 1, 7, 17, 37, 837, 837, 2837, 2837, 74, 75, 'DFAAAA', 'ZPOAAA', 'VVVVxx'),
+(127, 9880, 1, 3, 7, 7, 27, 127, 127, 127, 127, 54, 55, 'XEAAAA', 'AQOAAA', 'AAAAxx'),
+(9772, 9881, 0, 0, 2, 12, 72, 772, 1772, 4772, 9772, 144, 145, 'WLAAAA', 'BQOAAA', 'HHHHxx'),
+(5743, 9882, 1, 3, 3, 3, 43, 743, 1743, 743, 5743, 86, 87, 'XMAAAA', 'CQOAAA', 'OOOOxx'),
+(2007, 9883, 1, 3, 7, 7, 7, 7, 7, 2007, 2007, 14, 15, 'FZAAAA', 'DQOAAA', 'VVVVxx'),
+(7586, 9884, 0, 2, 6, 6, 86, 586, 1586, 2586, 7586, 172, 173, 'UFAAAA', 'EQOAAA', 'AAAAxx'),
+(45, 9885, 1, 1, 5, 5, 45, 45, 45, 45, 45, 90, 91, 'TBAAAA', 'FQOAAA', 'HHHHxx'),
+(6482, 9886, 0, 2, 2, 2, 82, 482, 482, 1482, 6482, 164, 165, 'IPAAAA', 'GQOAAA', 'OOOOxx'),
+(4565, 9887, 1, 1, 5, 5, 65, 565, 565, 4565, 4565, 130, 131, 'PTAAAA', 'HQOAAA', 'VVVVxx'),
+(6975, 9888, 1, 3, 5, 15, 75, 975, 975, 1975, 6975, 150, 151, 'HIAAAA', 'IQOAAA', 'AAAAxx'),
+(7260, 9889, 0, 0, 0, 0, 60, 260, 1260, 2260, 7260, 120, 121, 'GTAAAA', 'JQOAAA', 'HHHHxx'),
+(2830, 9890, 0, 2, 0, 10, 30, 830, 830, 2830, 2830, 60, 61, 'WEAAAA', 'KQOAAA', 'OOOOxx'),
+(9365, 9891, 1, 1, 5, 5, 65, 365, 1365, 4365, 9365, 130, 131, 'FWAAAA', 'LQOAAA', 'VVVVxx'),
+(8207, 9892, 1, 3, 7, 7, 7, 207, 207, 3207, 8207, 14, 15, 'RDAAAA', 'MQOAAA', 'AAAAxx'),
+(2506, 9893, 0, 2, 6, 6, 6, 506, 506, 2506, 2506, 12, 13, 'KSAAAA', 'NQOAAA', 'HHHHxx'),
+(8081, 9894, 1, 1, 1, 1, 81, 81, 81, 3081, 8081, 162, 163, 'VYAAAA', 'OQOAAA', 'OOOOxx'),
+(8678, 9895, 0, 2, 8, 18, 78, 678, 678, 3678, 8678, 156, 157, 'UVAAAA', 'PQOAAA', 'VVVVxx'),
+(9932, 9896, 0, 0, 2, 12, 32, 932, 1932, 4932, 9932, 64, 65, 'ASAAAA', 'QQOAAA', 'AAAAxx'),
+(447, 9897, 1, 3, 7, 7, 47, 447, 447, 447, 447, 94, 95, 'FRAAAA', 'RQOAAA', 'HHHHxx'),
+(9187, 9898, 1, 3, 7, 7, 87, 187, 1187, 4187, 9187, 174, 175, 'JPAAAA', 'SQOAAA', 'OOOOxx'),
+(89, 9899, 1, 1, 9, 9, 89, 89, 89, 89, 89, 178, 179, 'LDAAAA', 'TQOAAA', 'VVVVxx'),
+(7027, 9900, 1, 3, 7, 7, 27, 27, 1027, 2027, 7027, 54, 55, 'HKAAAA', 'UQOAAA', 'AAAAxx'),
+(1536, 9901, 0, 0, 6, 16, 36, 536, 1536, 1536, 1536, 72, 73, 'CHAAAA', 'VQOAAA', 'HHHHxx'),
+(160, 9902, 0, 0, 0, 0, 60, 160, 160, 160, 160, 120, 121, 'EGAAAA', 'WQOAAA', 'OOOOxx'),
+(7679, 9903, 1, 3, 9, 19, 79, 679, 1679, 2679, 7679, 158, 159, 'JJAAAA', 'XQOAAA', 'VVVVxx'),
+(5973, 9904, 1, 1, 3, 13, 73, 973, 1973, 973, 5973, 146, 147, 'TVAAAA', 'YQOAAA', 'AAAAxx'),
+(4401, 9905, 1, 1, 1, 1, 1, 401, 401, 4401, 4401, 2, 3, 'HNAAAA', 'ZQOAAA', 'HHHHxx'),
+(395, 9906, 1, 3, 5, 15, 95, 395, 395, 395, 395, 190, 191, 'FPAAAA', 'AROAAA', 'OOOOxx'),
+(4904, 9907, 0, 0, 4, 4, 4, 904, 904, 4904, 4904, 8, 9, 'QGAAAA', 'BROAAA', 'VVVVxx'),
+(2759, 9908, 1, 3, 9, 19, 59, 759, 759, 2759, 2759, 118, 119, 'DCAAAA', 'CROAAA', 'AAAAxx'),
+(8713, 9909, 1, 1, 3, 13, 13, 713, 713, 3713, 8713, 26, 27, 'DXAAAA', 'DROAAA', 'HHHHxx'),
+(3770, 9910, 0, 2, 0, 10, 70, 770, 1770, 3770, 3770, 140, 141, 'APAAAA', 'EROAAA', 'OOOOxx'),
+(8272, 9911, 0, 0, 2, 12, 72, 272, 272, 3272, 8272, 144, 145, 'EGAAAA', 'FROAAA', 'VVVVxx'),
+(5358, 9912, 0, 2, 8, 18, 58, 358, 1358, 358, 5358, 116, 117, 'CYAAAA', 'GROAAA', 'AAAAxx'),
+(9747, 9913, 1, 3, 7, 7, 47, 747, 1747, 4747, 9747, 94, 95, 'XKAAAA', 'HROAAA', 'HHHHxx'),
+(1567, 9914, 1, 3, 7, 7, 67, 567, 1567, 1567, 1567, 134, 135, 'HIAAAA', 'IROAAA', 'OOOOxx'),
+(2136, 9915, 0, 0, 6, 16, 36, 136, 136, 2136, 2136, 72, 73, 'EEAAAA', 'JROAAA', 'VVVVxx'),
+(314, 9916, 0, 2, 4, 14, 14, 314, 314, 314, 314, 28, 29, 'CMAAAA', 'KROAAA', 'AAAAxx'),
+(4583, 9917, 1, 3, 3, 3, 83, 583, 583, 4583, 4583, 166, 167, 'HUAAAA', 'LROAAA', 'HHHHxx'),
+(375, 9918, 1, 3, 5, 15, 75, 375, 375, 375, 375, 150, 151, 'LOAAAA', 'MROAAA', 'OOOOxx'),
+(5566, 9919, 0, 2, 6, 6, 66, 566, 1566, 566, 5566, 132, 133, 'CGAAAA', 'NROAAA', 'VVVVxx'),
+(6865, 9920, 1, 1, 5, 5, 65, 865, 865, 1865, 6865, 130, 131, 'BEAAAA', 'OROAAA', 'AAAAxx'),
+(894, 9921, 0, 2, 4, 14, 94, 894, 894, 894, 894, 188, 189, 'KIAAAA', 'PROAAA', 'HHHHxx'),
+(5399, 9922, 1, 3, 9, 19, 99, 399, 1399, 399, 5399, 198, 199, 'RZAAAA', 'QROAAA', 'OOOOxx'),
+(1385, 9923, 1, 1, 5, 5, 85, 385, 1385, 1385, 1385, 170, 171, 'HBAAAA', 'RROAAA', 'VVVVxx'),
+(2156, 9924, 0, 0, 6, 16, 56, 156, 156, 2156, 2156, 112, 113, 'YEAAAA', 'SROAAA', 'AAAAxx'),
+(9659, 9925, 1, 3, 9, 19, 59, 659, 1659, 4659, 9659, 118, 119, 'NHAAAA', 'TROAAA', 'HHHHxx'),
+(477, 9926, 1, 1, 7, 17, 77, 477, 477, 477, 477, 154, 155, 'JSAAAA', 'UROAAA', 'OOOOxx'),
+(8194, 9927, 0, 2, 4, 14, 94, 194, 194, 3194, 8194, 188, 189, 'EDAAAA', 'VROAAA', 'VVVVxx'),
+(3937, 9928, 1, 1, 7, 17, 37, 937, 1937, 3937, 3937, 74, 75, 'LVAAAA', 'WROAAA', 'AAAAxx'),
+(3745, 9929, 1, 1, 5, 5, 45, 745, 1745, 3745, 3745, 90, 91, 'BOAAAA', 'XROAAA', 'HHHHxx'),
+(4096, 9930, 0, 0, 6, 16, 96, 96, 96, 4096, 4096, 192, 193, 'OBAAAA', 'YROAAA', 'OOOOxx'),
+(5487, 9931, 1, 3, 7, 7, 87, 487, 1487, 487, 5487, 174, 175, 'BDAAAA', 'ZROAAA', 'VVVVxx'),
+(2475, 9932, 1, 3, 5, 15, 75, 475, 475, 2475, 2475, 150, 151, 'FRAAAA', 'ASOAAA', 'AAAAxx'),
+(6105, 9933, 1, 1, 5, 5, 5, 105, 105, 1105, 6105, 10, 11, 'VAAAAA', 'BSOAAA', 'HHHHxx'),
+(6036, 9934, 0, 0, 6, 16, 36, 36, 36, 1036, 6036, 72, 73, 'EYAAAA', 'CSOAAA', 'OOOOxx'),
+(1315, 9935, 1, 3, 5, 15, 15, 315, 1315, 1315, 1315, 30, 31, 'PYAAAA', 'DSOAAA', 'VVVVxx'),
+(4473, 9936, 1, 1, 3, 13, 73, 473, 473, 4473, 4473, 146, 147, 'BQAAAA', 'ESOAAA', 'AAAAxx'),
+(4016, 9937, 0, 0, 6, 16, 16, 16, 16, 4016, 4016, 32, 33, 'MYAAAA', 'FSOAAA', 'HHHHxx'),
+(8135, 9938, 1, 3, 5, 15, 35, 135, 135, 3135, 8135, 70, 71, 'XAAAAA', 'GSOAAA', 'OOOOxx'),
+(8892, 9939, 0, 0, 2, 12, 92, 892, 892, 3892, 8892, 184, 185, 'AEAAAA', 'HSOAAA', 'VVVVxx'),
+(4850, 9940, 0, 2, 0, 10, 50, 850, 850, 4850, 4850, 100, 101, 'OEAAAA', 'ISOAAA', 'AAAAxx'),
+(2545, 9941, 1, 1, 5, 5, 45, 545, 545, 2545, 2545, 90, 91, 'XTAAAA', 'JSOAAA', 'HHHHxx'),
+(3788, 9942, 0, 0, 8, 8, 88, 788, 1788, 3788, 3788, 176, 177, 'SPAAAA', 'KSOAAA', 'OOOOxx'),
+(1672, 9943, 0, 0, 2, 12, 72, 672, 1672, 1672, 1672, 144, 145, 'IMAAAA', 'LSOAAA', 'VVVVxx'),
+(3664, 9944, 0, 0, 4, 4, 64, 664, 1664, 3664, 3664, 128, 129, 'YKAAAA', 'MSOAAA', 'AAAAxx'),
+(3775, 9945, 1, 3, 5, 15, 75, 775, 1775, 3775, 3775, 150, 151, 'FPAAAA', 'NSOAAA', 'HHHHxx'),
+(3103, 9946, 1, 3, 3, 3, 3, 103, 1103, 3103, 3103, 6, 7, 'JPAAAA', 'OSOAAA', 'OOOOxx'),
+(9335, 9947, 1, 3, 5, 15, 35, 335, 1335, 4335, 9335, 70, 71, 'BVAAAA', 'PSOAAA', 'VVVVxx'),
+(9200, 9948, 0, 0, 0, 0, 0, 200, 1200, 4200, 9200, 0, 1, 'WPAAAA', 'QSOAAA', 'AAAAxx'),
+(8665, 9949, 1, 1, 5, 5, 65, 665, 665, 3665, 8665, 130, 131, 'HVAAAA', 'RSOAAA', 'HHHHxx'),
+(1356, 9950, 0, 0, 6, 16, 56, 356, 1356, 1356, 1356, 112, 113, 'EAAAAA', 'SSOAAA', 'OOOOxx'),
+(6118, 9951, 0, 2, 8, 18, 18, 118, 118, 1118, 6118, 36, 37, 'IBAAAA', 'TSOAAA', 'VVVVxx'),
+(4605, 9952, 1, 1, 5, 5, 5, 605, 605, 4605, 4605, 10, 11, 'DVAAAA', 'USOAAA', 'AAAAxx'),
+(5651, 9953, 1, 3, 1, 11, 51, 651, 1651, 651, 5651, 102, 103, 'JJAAAA', 'VSOAAA', 'HHHHxx'),
+(9055, 9954, 1, 3, 5, 15, 55, 55, 1055, 4055, 9055, 110, 111, 'HKAAAA', 'WSOAAA', 'OOOOxx'),
+(8461, 9955, 1, 1, 1, 1, 61, 461, 461, 3461, 8461, 122, 123, 'LNAAAA', 'XSOAAA', 'VVVVxx'),
+(6107, 9956, 1, 3, 7, 7, 7, 107, 107, 1107, 6107, 14, 15, 'XAAAAA', 'YSOAAA', 'AAAAxx'),
+(1967, 9957, 1, 3, 7, 7, 67, 967, 1967, 1967, 1967, 134, 135, 'RXAAAA', 'ZSOAAA', 'HHHHxx'),
+(8910, 9958, 0, 2, 0, 10, 10, 910, 910, 3910, 8910, 20, 21, 'SEAAAA', 'ATOAAA', 'OOOOxx'),
+(8257, 9959, 1, 1, 7, 17, 57, 257, 257, 3257, 8257, 114, 115, 'PFAAAA', 'BTOAAA', 'VVVVxx'),
+(851, 9960, 1, 3, 1, 11, 51, 851, 851, 851, 851, 102, 103, 'TGAAAA', 'CTOAAA', 'AAAAxx'),
+(7823, 9961, 1, 3, 3, 3, 23, 823, 1823, 2823, 7823, 46, 47, 'XOAAAA', 'DTOAAA', 'HHHHxx'),
+(3208, 9962, 0, 0, 8, 8, 8, 208, 1208, 3208, 3208, 16, 17, 'KTAAAA', 'ETOAAA', 'OOOOxx'),
+(856, 9963, 0, 0, 6, 16, 56, 856, 856, 856, 856, 112, 113, 'YGAAAA', 'FTOAAA', 'VVVVxx'),
+(2654, 9964, 0, 2, 4, 14, 54, 654, 654, 2654, 2654, 108, 109, 'CYAAAA', 'GTOAAA', 'AAAAxx'),
+(7185, 9965, 1, 1, 5, 5, 85, 185, 1185, 2185, 7185, 170, 171, 'JQAAAA', 'HTOAAA', 'HHHHxx'),
+(309, 9966, 1, 1, 9, 9, 9, 309, 309, 309, 309, 18, 19, 'XLAAAA', 'ITOAAA', 'OOOOxx'),
+(9752, 9967, 0, 0, 2, 12, 52, 752, 1752, 4752, 9752, 104, 105, 'CLAAAA', 'JTOAAA', 'VVVVxx'),
+(6405, 9968, 1, 1, 5, 5, 5, 405, 405, 1405, 6405, 10, 11, 'JMAAAA', 'KTOAAA', 'AAAAxx'),
+(6113, 9969, 1, 1, 3, 13, 13, 113, 113, 1113, 6113, 26, 27, 'DBAAAA', 'LTOAAA', 'HHHHxx'),
+(9774, 9970, 0, 2, 4, 14, 74, 774, 1774, 4774, 9774, 148, 149, 'YLAAAA', 'MTOAAA', 'OOOOxx'),
+(1674, 9971, 0, 2, 4, 14, 74, 674, 1674, 1674, 1674, 148, 149, 'KMAAAA', 'NTOAAA', 'VVVVxx'),
+(9602, 9972, 0, 2, 2, 2, 2, 602, 1602, 4602, 9602, 4, 5, 'IFAAAA', 'OTOAAA', 'AAAAxx'),
+(1363, 9973, 1, 3, 3, 3, 63, 363, 1363, 1363, 1363, 126, 127, 'LAAAAA', 'PTOAAA', 'HHHHxx'),
+(6887, 9974, 1, 3, 7, 7, 87, 887, 887, 1887, 6887, 174, 175, 'XEAAAA', 'QTOAAA', 'OOOOxx'),
+(6170, 9975, 0, 2, 0, 10, 70, 170, 170, 1170, 6170, 140, 141, 'IDAAAA', 'RTOAAA', 'VVVVxx'),
+(8888, 9976, 0, 0, 8, 8, 88, 888, 888, 3888, 8888, 176, 177, 'WDAAAA', 'STOAAA', 'AAAAxx'),
+(2981, 9977, 1, 1, 1, 1, 81, 981, 981, 2981, 2981, 162, 163, 'RKAAAA', 'TTOAAA', 'HHHHxx'),
+(7369, 9978, 1, 1, 9, 9, 69, 369, 1369, 2369, 7369, 138, 139, 'LXAAAA', 'UTOAAA', 'OOOOxx'),
+(6227, 9979, 1, 3, 7, 7, 27, 227, 227, 1227, 6227, 54, 55, 'NFAAAA', 'VTOAAA', 'VVVVxx'),
+(8002, 9980, 0, 2, 2, 2, 2, 2, 2, 3002, 8002, 4, 5, 'UVAAAA', 'WTOAAA', 'AAAAxx'),
+(4288, 9981, 0, 0, 8, 8, 88, 288, 288, 4288, 4288, 176, 177, 'YIAAAA', 'XTOAAA', 'HHHHxx'),
+(5136, 9982, 0, 0, 6, 16, 36, 136, 1136, 136, 5136, 72, 73, 'OPAAAA', 'YTOAAA', 'OOOOxx'),
+(1084, 9983, 0, 0, 4, 4, 84, 84, 1084, 1084, 1084, 168, 169, 'SPAAAA', 'ZTOAAA', 'VVVVxx'),
+(9117, 9984, 1, 1, 7, 17, 17, 117, 1117, 4117, 9117, 34, 35, 'RMAAAA', 'AUOAAA', 'AAAAxx'),
+(2406, 9985, 0, 2, 6, 6, 6, 406, 406, 2406, 2406, 12, 13, 'OOAAAA', 'BUOAAA', 'HHHHxx'),
+(1384, 9986, 0, 0, 4, 4, 84, 384, 1384, 1384, 1384, 168, 169, 'GBAAAA', 'CUOAAA', 'OOOOxx'),
+(9194, 9987, 0, 2, 4, 14, 94, 194, 1194, 4194, 9194, 188, 189, 'QPAAAA', 'DUOAAA', 'VVVVxx'),
+(858, 9988, 0, 2, 8, 18, 58, 858, 858, 858, 858, 116, 117, 'AHAAAA', 'EUOAAA', 'AAAAxx'),
+(8592, 9989, 0, 0, 2, 12, 92, 592, 592, 3592, 8592, 184, 185, 'MSAAAA', 'FUOAAA', 'HHHHxx'),
+(4773, 9990, 1, 1, 3, 13, 73, 773, 773, 4773, 4773, 146, 147, 'PBAAAA', 'GUOAAA', 'OOOOxx'),
+(4093, 9991, 1, 1, 3, 13, 93, 93, 93, 4093, 4093, 186, 187, 'LBAAAA', 'HUOAAA', 'VVVVxx'),
+(6587, 9992, 1, 3, 7, 7, 87, 587, 587, 1587, 6587, 174, 175, 'JTAAAA', 'IUOAAA', 'AAAAxx'),
+(6093, 9993, 1, 1, 3, 13, 93, 93, 93, 1093, 6093, 186, 187, 'JAAAAA', 'JUOAAA', 'HHHHxx'),
+(429, 9994, 1, 1, 9, 9, 29, 429, 429, 429, 429, 58, 59, 'NQAAAA', 'KUOAAA', 'OOOOxx'),
+(5780, 9995, 0, 0, 0, 0, 80, 780, 1780, 780, 5780, 160, 161, 'IOAAAA', 'LUOAAA', 'VVVVxx'),
+(1783, 9996, 1, 3, 3, 3, 83, 783, 1783, 1783, 1783, 166, 167, 'PQAAAA', 'MUOAAA', 'AAAAxx'),
+(2992, 9997, 0, 0, 2, 12, 92, 992, 992, 2992, 2992, 184, 185, 'CLAAAA', 'NUOAAA', 'HHHHxx'),
+(0, 9998, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'AAAAAA', 'OUOAAA', 'OOOOxx'),
+(2968, 9999, 0, 0, 8, 8, 68, 968, 968, 2968, 2968, 136, 137, 'EKAAAA', 'PUOAAA', 'VVVVxx');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/tenk2_0.sql b/yql/essentials/tests/postgresql/initscripts/tenk2_0.sql
new file mode 100644
index 0000000000..500d6d0639
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/tenk2_0.sql
@@ -0,0 +1,19 @@
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/testjsonb.sql b/yql/essentials/tests/postgresql/initscripts/testjsonb.sql
new file mode 100644
index 0000000000..38196a73bb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/testjsonb.sql
@@ -0,0 +1,1018 @@
+CREATE TABLE testjsonb (
+ j jsonb
+);
+
+INSERT INTO testjsonb VALUES
+('{"line":1, "date":"CB", "node":"AA"}'::jsonb),
+('{"cleaned":false, "status":59, "line":2, "disabled":false, "node":"CBB"}'::jsonb),
+('{"indexed":true, "status":35, "line":3, "disabled":false, "wait":"CAA", "subtitle":"BA", "user":"CCA"}'::jsonb),
+('{"line":4, "disabled":true, "space":"BB"}'::jsonb),
+('{"cleaned":false, "line":5, "wait":"BB", "query":"CAC", "coauthors":"ACA", "node":"CBA"}'::jsonb),
+('{"world":"CB", "query":"CBC", "indexed":false, "line":6, "pos":92, "date":"AAB", "space":"CB", "coauthors":"ACA", "node":"CBC"}'::jsonb),
+('{"state":98, "org":43, "line":7, "pos":97}'::jsonb),
+('{"auth":"BB", "title":"CAC", "query":"BA", "status":94, "line":8, "coauthors":"BBB"}'::jsonb),
+('{"auth":"BAC", "title":"CAA", "wait":"CA", "bad":true, "query":"AA", "indexed":true, "line":9, "pos":56}'::jsonb),
+('{"title":"AAC", "bad":true, "user":"AAB", "query":"AC", "line":10, "node":"AB"}'::jsonb),
+('{"world":"CAC", "user":"AB", "query":"ACA", "indexed":true, "line":11, "space":"CB"}'::jsonb),
+('{"line":12, "pos":72, "abstract":"BBA", "space":"AAC"}'::jsonb),
+('{}'::jsonb),
+('{"world":"CC", "query":"AA", "line":14, "disabled":false, "date":"CAC", "coauthors":"AB"}'::jsonb),
+('{"org":68, "title":"BBB", "query":"BAC", "line":15, "public":false}'::jsonb),
+('{"org":73, "user":"AA", "indexed":true, "line":16, "date":"CCC", "public":true, "coauthors":"AB"}'::jsonb),
+('{"indexed":false, "line":17}'::jsonb),
+('{"state":23, "auth":"BCC", "org":38, "status":28, "line":18, "disabled":false, "abstract":"CB"}'::jsonb),
+('{"state":99, "auth":"CA", "indexed":true, "line":19, "date":"BA"}'::jsonb),
+('{"wait":"CBA", "user":"BBA", "indexed":true, "line":20, "disabled":false, "abstract":"BA", "date":"ABA"}'::jsonb),
+('{"org":10, "query":"AC", "indexed":false, "line":21, "disabled":true, "abstract":"CA", "pos":44}'::jsonb),
+('{"state":65, "title":"AC", "user":"AAC", "cleaned":true, "status":93, "line":22, "abstract":"ABC", "node":"CCC"}'::jsonb),
+('{"subtitle":"AC", "user":"CCC", "line":23}'::jsonb),
+('{"state":67, "world":"ACB", "bad":true, "user":"CB", "line":24, "disabled":true}'::jsonb),
+('{}'::jsonb),
+('{"state":65, "title":"CBC", "wait":"AAC", "bad":true, "query":"ACA", "line":26, "disabled":false, "space":"CA"}'::jsonb),
+('{"auth":"BAA", "state":68, "indexed":true, "line":27, "space":"BA"}'::jsonb),
+('{"indexed":false, "line":28, "disabled":true, "space":"CC", "node":"BB"}'::jsonb),
+('{"auth":"BAB", "org":80, "title":"BBA", "query":"BBC", "status":3, "line":29}'::jsonb),
+('{"title":"AC", "status":16, "cleaned":true, "line":30}'::jsonb),
+('{"state":39, "world":"AAB", "user":"BB", "line":31, "disabled":true}'::jsonb),
+('{"wait":"BC", "bad":false, "query":"AA", "line":32, "coauthors":"CAC"}'::jsonb),
+('{"line":33, "pos":97}'::jsonb),
+('{"title":"AA", "world":"CCA", "wait":"CC", "bad":true, "status":86, "line":34, "disabled":true, "node":"ACA"}'::jsonb),
+('{}'::jsonb),
+('{"world":"BCC", "title":"ACB", "org":61, "status":99, "cleaned":true, "line":36, "pos":76, "space":"ACC", "coauthors":"AA", "node":"CB"}'::jsonb),
+('{"title":"CAA", "cleaned":false, "line":37, "abstract":"ACA", "node":"BC"}'::jsonb),
+('{"auth":"BC", "title":"BA", "world":"ACA", "indexed":true, "line":38, "abstract":"AAA", "public":true}'::jsonb),
+('{"org":90, "line":39, "public":false}'::jsonb),
+('{"state":16, "indexed":true, "line":40, "pos":53}'::jsonb),
+('{"auth":"AAB", "wait":"CAC", "status":44, "line":41}'::jsonb),
+('{"subtitle":"ACA", "bad":true, "line":42}'::jsonb),
+('{"org":19, "world":"BC", "user":"ABA", "indexed":false, "line":43, "disabled":true, "pos":48, "abstract":"CAB", "space":"CCB"}'::jsonb),
+('{"indexed":false, "line":44}'::jsonb),
+('{"indexed":true, "line":45}'::jsonb),
+('{"status":84, "line":46, "date":"CCC"}'::jsonb),
+('{"state":94, "title":"BAB", "bad":true, "user":"BBB", "indexed":true, "line":47, "public":false}'::jsonb),
+('{"org":90, "subtitle":"BAC", "query":"CAC", "cleaned":false, "line":48, "disabled":true, "abstract":"CC", "pos":17, "space":"BCA"}'::jsonb),
+('{"world":"CBC", "line":49}'::jsonb),
+('{"org":24, "line":50, "date":"CA", "public":false}'::jsonb),
+('{"world":"BC", "indexed":true, "status":44, "line":51, "pos":59, "date":"BA", "public":true}'::jsonb),
+('{"org":98, "line":52}'::jsonb),
+('{"title":"CA", "world":"ABC", "subtitle":"CBB", "line":53, "abstract":"BBA", "date":"ACB", "node":"CA"}'::jsonb),
+('{"user":"BAB", "cleaned":true, "line":54}'::jsonb),
+('{"subtitle":"CAA", "line":55, "disabled":false, "pos":55, "abstract":"AB", "public":false, "coauthors":"AA"}'::jsonb),
+('{"wait":"CC", "user":"CC", "cleaned":true, "line":56, "pos":73, "node":"ABC"}'::jsonb),
+('{"title":"BCC", "wait":"ABC", "indexed":true, "line":57, "disabled":false}'::jsonb),
+('{"org":42, "title":"BB", "line":58, "disabled":true, "public":true, "coauthors":"BCC"}'::jsonb),
+('{"wait":"CAB", "title":"CCB", "query":"BAC", "status":66, "line":59, "disabled":true}'::jsonb),
+('{"user":"CAC", "line":60}'::jsonb),
+('{"user":"BBB", "line":61, "disabled":false, "pos":31}'::jsonb),
+('{"org":18, "line":62, "coauthors":"CCC", "node":"CA"}'::jsonb),
+('{"line":63, "coauthors":"AB"}'::jsonb),
+('{"org":25, "wait":"CA", "line":64, "abstract":"BA", "date":"BBB"}'::jsonb),
+('{"title":"CB", "wait":"CC", "bad":false, "user":"BBB", "line":65, "abstract":"ACA", "public":true}'::jsonb),
+('{"line":66, "coauthors":"AC"}'::jsonb),
+('{"state":20, "wait":"CCB", "bad":true, "line":67, "abstract":"CB"}'::jsonb),
+('{"state":79, "wait":"BAC", "bad":false, "status":11, "line":68, "abstract":"BC", "public":true, "coauthors":"CBA"}'::jsonb),
+('{"state":39, "title":"CCA", "bad":false, "query":"BBA", "line":69, "pos":42, "public":false}'::jsonb),
+('{"title":"BC", "subtitle":"CA", "query":"BC", "line":70}'::jsonb),
+('{}'::jsonb),
+('{"bad":true, "query":"BBB", "line":72}'::jsonb),
+('{"state":35, "world":"CC", "bad":false, "line":73, "space":"BB", "public":false}'::jsonb),
+('{"title":"ACC", "wait":"CAB", "subtitle":"CB", "status":19, "line":74, "disabled":false, "space":"BAA", "coauthors":"CBC", "node":"AC"}'::jsonb),
+('{"subtitle":"BCB", "indexed":false, "status":83, "line":75, "public":true}'::jsonb),
+('{"state":32, "line":76, "disabled":false, "pos":66, "space":"CC"}'::jsonb),
+('{"state":43, "cleaned":true, "line":77}'::jsonb),
+('{}'::jsonb),
+('{"state":97, "wait":"CBA", "indexed":false, "cleaned":false, "line":79, "abstract":"CB", "date":"ACC", "public":false}'::jsonb),
+('{"user":"AAB", "line":80, "pos":85, "date":"AC"}'::jsonb),
+('{"world":"AC", "wait":"CC", "subtitle":"AAB", "bad":false, "cleaned":false, "line":81, "pos":91, "node":"CCC"}'::jsonb),
+('{}'::jsonb),
+('{"org":87, "bad":false, "user":"AAC", "query":"CCC", "line":83, "disabled":false, "abstract":"AC", "date":"CCA", "public":false}'::jsonb),
+('{"state":50, "line":84}'::jsonb),
+('{"wait":"AA", "subtitle":"AA", "query":"BB", "status":97, "line":85, "disabled":true, "abstract":"CB"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"CA", "query":"BC", "line":87}'::jsonb),
+('{}'::jsonb),
+('{"title":"CC", "line":89, "disabled":false, "pos":49, "date":"CCB", "space":"CB", "node":"BB"}'::jsonb),
+('{"auth":"CC", "wait":"AA", "title":"BC", "bad":true, "line":90}'::jsonb),
+('{"state":37, "org":85, "indexed":false, "line":91, "space":"CAA", "public":true, "coauthors":"BA"}'::jsonb),
+('{"wait":"BBB", "title":"BBC", "org":95, "subtitle":"AC", "line":92, "pos":23, "date":"AC", "public":true, "space":"BBC"}'::jsonb),
+('{"org":48, "user":"AC", "line":93, "space":"CCC"}'::jsonb),
+('{}'::jsonb),
+('{"state":77, "wait":"ABA", "subtitle":"AC", "user":"BA", "status":43, "line":95, "public":false}'::jsonb),
+('{"title":"CA", "indexed":true, "status":26, "line":96}'::jsonb),
+('{"auth":"BCA", "subtitle":"ACC", "user":"CA", "line":97, "disabled":false, "node":"ACB"}'::jsonb),
+('{"query":"BB", "line":98, "coauthors":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"AA", "title":"ACB", "org":58, "subtitle":"AC", "bad":false, "cleaned":false, "line":100, "space":"ACC", "public":true}'::jsonb),
+('{"subtitle":"AAB", "bad":false, "line":101, "public":true}'::jsonb),
+('{"subtitle":"AAA", "indexed":false, "cleaned":false, "line":102, "disabled":true, "pos":35}'::jsonb),
+('{}'::jsonb),
+('{"world":"CAC", "org":10, "query":"AAA", "cleaned":true, "status":79, "indexed":true, "line":104, "pos":65, "public":false, "node":"BAB"}'::jsonb),
+('{"bad":false, "line":105, "abstract":"BA", "node":"CBB"}'::jsonb),
+('{"world":"BB", "wait":"BAA", "title":"ACA", "line":106, "date":"CBC", "space":"BA"}'::jsonb),
+('{"state":92, "wait":"CAC", "title":"AAA", "bad":false, "line":107, "abstract":"CBC", "date":"BCC", "public":false}'::jsonb),
+('{"title":"CCC", "indexed":true, "line":108, "abstract":"ACB", "public":false, "coauthors":"ABB"}'::jsonb),
+('{"auth":"BB", "query":"ACC", "status":68, "line":109}'::jsonb),
+('{"user":"CC", "cleaned":false, "indexed":true, "line":110, "date":"BAA", "space":"BCB"}'::jsonb),
+('{"auth":"CC", "org":4, "wait":"BAC", "bad":false, "indexed":false, "line":111, "pos":55, "node":"BBC"}'::jsonb),
+('{"line":112, "disabled":true}'::jsonb),
+('{"org":66, "cleaned":true, "indexed":false, "line":113, "pos":96}'::jsonb),
+('{"world":"CA", "title":"ACA", "org":83, "query":"BAC", "user":"BBC", "indexed":false, "line":114}'::jsonb),
+('{"subtitle":"BCC", "line":115, "space":"AA", "public":true, "node":"CBA"}'::jsonb),
+('{"state":77, "status":23, "line":116}'::jsonb),
+('{"bad":false, "status":4, "line":117, "node":"CC"}'::jsonb),
+('{"state":99, "title":"BCC", "query":"AC", "status":98, "line":118, "date":"BA"}'::jsonb),
+('{"status":55, "line":119, "public":false, "coauthors":"BBA", "node":"BCA"}'::jsonb),
+('{"query":"CAA", "status":40, "indexed":false, "line":120, "disabled":false, "coauthors":"CA"}'::jsonb),
+('{"title":"BBC", "org":82, "subtitle":"ACB", "line":121, "abstract":"BB", "node":"CC"}'::jsonb),
+('{"state":66, "world":"AB", "subtitle":"BA", "query":"CB", "line":122, "abstract":"BBC", "pos":65, "date":"BAB"}'::jsonb),
+('{"state":96, "title":"CBC", "status":44, "line":123, "abstract":"BA", "space":"ACA", "node":"AAC"}'::jsonb),
+('{"auth":"CA", "state":59, "bad":false, "cleaned":false, "line":124, "pos":41, "date":"BBA", "coauthors":"ABB"}'::jsonb),
+('{"wait":"ACC", "line":125}'::jsonb),
+('{"org":30, "wait":"CBB", "subtitle":"CCA", "cleaned":true, "line":126, "date":"AC", "node":"ABC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BBA", "org":66, "subtitle":"CCB", "bad":true, "cleaned":false, "line":128, "abstract":"BB", "public":true, "coauthors":"BA"}'::jsonb),
+('{"subtitle":"AC", "bad":false, "user":"BAA", "line":129, "date":"BCB", "node":"BAC"}'::jsonb),
+('{"wait":"CC", "subtitle":"CA", "line":130, "disabled":false, "pos":49, "node":"BA"}'::jsonb),
+('{"indexed":false, "line":131, "pos":79, "date":"AAA", "node":"CAC"}'::jsonb),
+('{"wait":"AC", "world":"CB", "title":"AAA", "user":"ABC", "indexed":false, "status":15, "line":132, "coauthors":"BA"}'::jsonb),
+('{"state":96, "bad":true, "line":133, "disabled":false, "space":"BAC", "coauthors":"ABA"}'::jsonb),
+('{"world":"BAC", "line":134}'::jsonb),
+('{"title":"CCC", "line":135, "coauthors":"CC"}'::jsonb),
+('{"cleaned":true, "line":136}'::jsonb),
+('{"bad":true, "query":"CCA", "user":"CA", "cleaned":false, "line":137, "disabled":true}'::jsonb),
+('{}'::jsonb),
+('{"world":"CC", "subtitle":"BBB", "line":139}'::jsonb),
+('{"wait":"CA", "status":2, "line":140}'::jsonb),
+('{"world":"BC", "bad":false, "user":"BBC", "query":"ACB", "line":141, "pos":33, "space":"ACA"}'::jsonb),
+('{"state":92, "title":"CA", "bad":true, "query":"AB", "line":142, "abstract":"BA", "date":"ABB", "space":"BC", "coauthors":"CAA"}'::jsonb),
+('{"state":79, "query":"AB", "user":"CCA", "indexed":true, "cleaned":true, "line":143, "public":true}'::jsonb),
+('{"org":37, "query":"CA", "cleaned":true, "line":144, "disabled":true, "date":"CC"}'::jsonb),
+('{"wait":"AC", "title":"CBA", "user":"AAA", "status":24, "line":145, "date":"CBC", "public":false, "coauthors":"BAC", "node":"ACC"}'::jsonb),
+('{"user":"CA", "indexed":true, "line":146, "disabled":false, "coauthors":"BA"}'::jsonb),
+('{"wait":"BC", "org":35, "bad":false, "query":"CBB", "line":147, "date":"AAA", "public":false, "space":"BBB"}'::jsonb),
+('{"org":56, "user":"AB", "indexed":true, "line":148}'::jsonb),
+('{}'::jsonb),
+('{"title":"CBB", "org":78, "subtitle":"CBA", "bad":true, "user":"AAB", "line":150, "disabled":true, "abstract":"BAC"}'::jsonb),
+('{"world":"CCA", "query":"BC", "cleaned":true, "indexed":false, "line":151, "abstract":"BC", "pos":43, "coauthors":"AB", "node":"CBA"}'::jsonb),
+('{"auth":"ABA", "status":13, "line":152, "date":"AA"}'::jsonb),
+('{"world":"CA", "line":153, "space":"CBC"}'::jsonb),
+('{"world":"BA", "user":"BBB", "status":72, "line":154}'::jsonb),
+('{"auth":"ABB", "line":155, "disabled":true, "node":"BBC"}'::jsonb),
+('{"world":"BBB", "bad":false, "line":156, "abstract":"CBC"}'::jsonb),
+('{"line":157, "pos":60, "node":"ACC"}'::jsonb),
+('{"line":158, "node":"CC"}'::jsonb),
+('{"line":159, "public":true}'::jsonb),
+('{}'::jsonb),
+('{"query":"BA", "status":53, "cleaned":false, "line":161, "public":true}'::jsonb),
+('{"line":162, "date":"CC"}'::jsonb),
+('{}'::jsonb),
+('{"title":"BC", "bad":false, "query":"CC", "line":164, "abstract":"CCB", "date":"BA"}'::jsonb),
+('{"status":36, "line":165}'::jsonb),
+('{"title":"AB", "bad":false, "status":64, "line":166, "abstract":"AB", "coauthors":"AA", "node":"AA"}'::jsonb),
+('{"wait":"AA", "line":167}'::jsonb),
+('{"subtitle":"CBC", "user":"AC", "cleaned":false, "line":168, "disabled":true, "coauthors":"BAB", "node":"CC"}'::jsonb),
+('{"state":34, "status":73, "cleaned":true, "line":169, "abstract":"BC", "public":false, "space":"BBC", "node":"BAA"}'::jsonb),
+('{"state":10, "auth":"BBB", "bad":true, "indexed":false, "status":34, "line":170, "abstract":"BC"}'::jsonb),
+('{"subtitle":"AAA", "bad":false, "user":"ACA", "status":53, "line":171, "disabled":false, "date":"AAA"}'::jsonb),
+('{"subtitle":"CB", "query":"CC", "indexed":true, "line":172, "node":"BBC"}'::jsonb),
+('{"state":5, "world":"ABC", "bad":false, "line":173, "public":false}'::jsonb),
+('{"subtitle":"AC", "line":174}'::jsonb),
+('{"auth":"AC", "org":72, "query":"CA", "indexed":false, "cleaned":true, "line":175, "disabled":true, "pos":54}'::jsonb),
+('{"title":"BCB", "bad":false, "line":176, "pos":35, "coauthors":"AAC", "node":"ABB"}'::jsonb),
+('{"title":"BB", "cleaned":true, "status":26, "line":177}'::jsonb),
+('{"state":61, "wait":"BB", "world":"CB", "query":"BAB", "line":178, "abstract":"BB", "date":"CBB", "space":"CA", "node":"AB"}'::jsonb),
+('{"wait":"CA", "cleaned":false, "indexed":true, "line":179, "space":"CBC"}'::jsonb),
+('{"org":68, "line":180}'::jsonb),
+('{"wait":"ABB", "subtitle":"CCC", "cleaned":true, "line":181, "abstract":"BC", "coauthors":"BA"}'::jsonb),
+('{"title":"ACA", "subtitle":"AAB", "line":182, "node":"BAC"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"BA", "query":"BBB", "indexed":true, "cleaned":true, "line":185, "node":"BCC"}'::jsonb),
+('{"org":6, "title":"BCC", "user":"BA", "line":186, "pos":67, "abstract":"CBA", "coauthors":"CBB", "node":"CBC"}'::jsonb),
+('{"org":50, "title":"CAB", "subtitle":"CB", "query":"CBB", "line":187, "coauthors":"CA", "node":"CC"}'::jsonb),
+('{"bad":false, "line":188, "node":"CCB"}'::jsonb),
+('{"org":4, "world":"AAC", "query":"CAC", "line":189, "pos":90, "node":"AC"}'::jsonb),
+('{"state":86, "line":190, "pos":79}'::jsonb),
+('{"org":98, "title":"AAC", "cleaned":true, "line":191, "space":"BC", "coauthors":"AA"}'::jsonb),
+('{"wait":"CAA", "bad":false, "user":"BC", "status":23, "line":192, "disabled":true, "date":"CA", "coauthors":"BBB"}'::jsonb),
+('{"status":26, "line":193, "disabled":true}'::jsonb),
+('{"world":"CA", "subtitle":"CCC", "query":"ABB", "status":86, "line":194, "pos":97, "space":"CAC"}'::jsonb),
+('{"cleaned":true, "line":195}'::jsonb),
+('{"state":53, "org":84, "wait":"BC", "query":"BCC", "line":196, "disabled":true, "abstract":"AAC", "node":"CAC"}'::jsonb),
+('{"state":25, "status":70, "cleaned":false, "line":197, "disabled":true, "space":"AA", "public":false}'::jsonb),
+('{"org":82, "subtitle":"AAC", "line":198}'::jsonb),
+('{"org":87, "bad":true, "status":69, "line":199, "public":false}'::jsonb),
+('{"wait":"CC", "org":60, "subtitle":"BCA", "bad":true, "cleaned":false, "indexed":true, "line":200, "date":"BA"}'::jsonb),
+('{"state":9, "world":"CAA", "org":78, "user":"ACB", "cleaned":true, "line":201, "disabled":true, "abstract":"ACC", "public":false}'::jsonb),
+('{"state":50, "world":"AAA", "title":"CAA", "user":"AB", "status":37, "line":202, "disabled":false}'::jsonb),
+('{"org":36, "subtitle":"CB", "query":"BAA", "status":35, "line":203, "abstract":"CC"}'::jsonb),
+('{"auth":"CCC", "bad":true, "query":"CB", "status":84, "line":204, "disabled":false, "date":"BB"}'::jsonb),
+('{"auth":"AC", "query":"BA", "indexed":false, "line":205, "date":"AAB", "space":"ABB"}'::jsonb),
+('{"state":30, "world":"CCA", "query":"CC", "user":"BAA", "line":206}'::jsonb),
+('{"title":"CAB", "wait":"BAB", "bad":true, "query":"BCB", "indexed":true, "status":48, "cleaned":true, "line":207, "node":"ACB"}'::jsonb),
+('{"state":97, "subtitle":"BC", "status":99, "line":208, "abstract":"CB"}'::jsonb),
+('{"title":"CA", "world":"BBA", "bad":true, "indexed":false, "cleaned":false, "status":82, "line":209, "disabled":false, "pos":44, "space":"ACA"}'::jsonb),
+('{"line":210, "public":true}'::jsonb),
+('{"line":211, "space":"BBC", "node":"AAA"}'::jsonb),
+('{"wait":"BAA", "org":50, "line":212, "abstract":"BB", "public":true, "space":"AB"}'::jsonb),
+('{"line":213, "pos":57, "date":"CC", "space":"AC"}'::jsonb),
+('{"state":23, "user":"BAB", "query":"BCB", "line":214, "abstract":"BAB"}'::jsonb),
+('{"world":"ACB", "org":21, "line":215, "abstract":"AC", "public":false}'::jsonb),
+('{"state":14, "wait":"ACB", "org":79, "title":"BB", "subtitle":"BA", "line":216}'::jsonb),
+('{"wait":"BC", "line":217, "date":"BB"}'::jsonb),
+('{"wait":"AC", "user":"BB", "indexed":false, "status":83, "line":218}'::jsonb),
+('{"auth":"BC", "org":9, "user":"BA", "status":31, "line":219, "disabled":false}'::jsonb),
+('{"state":80, "world":"BA", "wait":"CA", "line":220, "pos":65, "node":"CAC"}'::jsonb),
+('{"wait":"AC", "subtitle":"ABB", "status":79, "indexed":true, "line":221, "abstract":"AC", "pos":33, "space":"BA"}'::jsonb),
+('{"state":69, "org":83, "world":"CBC", "subtitle":"CAC", "cleaned":false, "line":222, "space":"BC", "node":"CCA"}'::jsonb),
+('{"line":223, "abstract":"BC"}'::jsonb),
+('{}'::jsonb),
+('{"world":"BB", "title":"BC", "bad":false, "query":"BBC", "cleaned":false, "line":225, "disabled":false, "public":true}'::jsonb),
+('{"line":226, "date":"AC"}'::jsonb),
+('{"auth":"CB", "subtitle":"AB", "indexed":false, "status":2, "line":227, "pos":53, "space":"AB", "coauthors":"BCA"}'::jsonb),
+('{"title":"ABA", "org":36, "line":228, "space":"AA"}'::jsonb),
+('{"world":"AB", "line":229, "pos":78, "date":"BC", "space":"CC"}'::jsonb),
+('{"wait":"BBC", "org":47, "cleaned":true, "status":5, "line":230, "pos":2, "date":"CCA"}'::jsonb),
+('{"line":231, "coauthors":"CB"}'::jsonb),
+('{"state":1, "user":"CAA", "cleaned":false, "line":232, "date":"BA", "public":true, "coauthors":"AAA", "node":"BCC"}'::jsonb),
+('{"auth":"AB", "world":"CAC", "query":"BC", "cleaned":true, "line":233, "pos":47, "space":"AB", "node":"AB"}'::jsonb),
+('{"title":"CAA", "line":234, "pos":9, "public":true, "node":"AB"}'::jsonb),
+('{"auth":"CCA", "title":"AA", "org":6, "subtitle":"CA", "cleaned":true, "status":12, "indexed":false, "line":235, "space":"ABB"}'::jsonb),
+('{"auth":"CA", "bad":false, "query":"BC", "status":61, "cleaned":false, "line":236, "disabled":true, "public":true}'::jsonb),
+('{"user":"BCB", "line":237, "pos":70, "node":"CBA"}'::jsonb),
+('{"query":"CCB", "line":238, "disabled":true, "coauthors":"BAB", "node":"BC"}'::jsonb),
+('{"auth":"AC", "org":73, "title":"CA", "bad":false, "status":94, "line":239, "abstract":"CC"}'::jsonb),
+('{"subtitle":"BC", "indexed":false, "line":240, "disabled":true}'::jsonb),
+('{"auth":"AAC", "org":73, "title":"CB", "bad":true, "query":"CA", "cleaned":true, "line":241, "disabled":false, "public":false}'::jsonb),
+('{"line":242, "public":false}'::jsonb),
+('{"auth":"AC", "title":"BC", "status":61, "line":243, "disabled":false}'::jsonb),
+('{"auth":"ABB", "bad":false, "indexed":false, "line":244, "abstract":"BAB", "date":"ABC", "coauthors":"BC"}'::jsonb),
+('{"query":"BA", "line":245, "disabled":false, "space":"BAB"}'::jsonb),
+('{"world":"BCC", "bad":false, "indexed":false, "line":246, "disabled":true, "pos":80, "public":false, "coauthors":"BC"}'::jsonb),
+('{"indexed":true, "line":247}'::jsonb),
+('{"wait":"CCA", "subtitle":"CBB", "bad":false, "line":248, "pos":83, "public":false, "space":"BA"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"ABA", "org":13, "title":"BA", "bad":false, "indexed":true, "line":250, "disabled":false, "abstract":"BBA", "date":"AB"}'::jsonb),
+('{"state":37, "title":"AAA", "bad":false, "line":251, "disabled":false, "coauthors":"CBC"}'::jsonb),
+('{"auth":"ACB", "world":"AC", "title":"CAA", "subtitle":"BCA", "bad":false, "status":32, "line":252, "pos":84}'::jsonb),
+('{"query":"BA", "indexed":false, "status":0, "line":253, "abstract":"CCB", "pos":48, "date":"AC", "space":"AAC"}'::jsonb),
+('{"subtitle":"BBA", "line":254, "node":"AAA"}'::jsonb),
+('{"query":"AC", "user":"CAA", "status":13, "line":255, "public":true, "coauthors":"BCC"}'::jsonb),
+('{"auth":"AAA", "state":31, "line":256}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"wait":"AC", "query":"AAA", "cleaned":true, "indexed":false, "line":259, "pos":89, "coauthors":"BCA", "node":"BC"}'::jsonb),
+('{"world":"CC", "query":"BB", "line":260}'::jsonb),
+('{}'::jsonb),
+('{"org":99, "bad":false, "user":"ABA", "line":262, "abstract":"BA", "coauthors":"BCC"}'::jsonb),
+('{"auth":"CAC", "world":"CBC", "subtitle":"CA", "bad":false, "status":22, "line":263, "pos":4, "public":true, "node":"BB"}'::jsonb),
+('{"wait":"BB", "subtitle":"BCC", "indexed":true, "line":264, "node":"CAC"}'::jsonb),
+('{"subtitle":"BB", "query":"CBB", "line":265}'::jsonb),
+('{"state":35, "query":"AA", "line":266, "coauthors":"AAA"}'::jsonb),
+('{"status":6, "line":267, "pos":66}'::jsonb),
+('{"auth":"BAA", "subtitle":"CCA", "bad":false, "query":"CCB", "line":268, "public":true, "space":"CAB", "node":"CAC"}'::jsonb),
+('{"world":"AC", "org":58, "user":"AC", "line":269, "node":"AB"}'::jsonb),
+('{"auth":"BCB", "org":36, "title":"AB", "line":270, "abstract":"CAB", "date":"CAB", "public":true, "coauthors":"CB", "node":"AB"}'::jsonb),
+('{"cleaned":true, "line":271}'::jsonb),
+('{"world":"ACC", "cleaned":true, "status":11, "line":272, "disabled":false, "abstract":"AA", "space":"BCA", "node":"BA"}'::jsonb),
+('{"cleaned":true, "line":273, "pos":50, "public":true}'::jsonb),
+('{"status":95, "line":274, "abstract":"BB", "coauthors":"AC"}'::jsonb),
+('{"auth":"BCC", "state":80, "cleaned":true, "line":275, "abstract":"AC"}'::jsonb),
+('{"wait":"BA", "line":276}'::jsonb),
+('{"org":62, "subtitle":"CAA", "query":"BA", "user":"BCC", "indexed":false, "line":277, "disabled":false, "abstract":"ACA", "date":"AB"}'::jsonb),
+('{"org":63, "bad":true, "line":278, "pos":26, "coauthors":"BA"}'::jsonb),
+('{"auth":"CBB", "indexed":false, "line":279, "pos":40, "space":"CA", "coauthors":"CC"}'::jsonb),
+('{"auth":"BA", "line":280, "abstract":"AAA", "public":true, "coauthors":"CAC"}'::jsonb),
+('{"org":10, "status":16, "line":281, "date":"CCC", "space":"AC"}'::jsonb),
+('{"org":76, "user":"BBC", "indexed":false, "line":282, "pos":56, "node":"CBA"}'::jsonb),
+('{"auth":"CA", "subtitle":"AB", "query":"AA", "indexed":true, "line":283, "disabled":false, "coauthors":"ABC", "node":"CAA"}'::jsonb),
+('{"title":"BA", "status":91, "line":284, "pos":7, "coauthors":"BB"}'::jsonb),
+('{"wait":"CCA", "line":285, "public":true}'::jsonb),
+('{"world":"AC", "line":286, "disabled":true}'::jsonb),
+('{"line":287, "abstract":"AAA"}'::jsonb),
+('{"user":"CCB", "status":50, "line":288, "public":false}'::jsonb),
+('{"state":41, "world":"CCC", "query":"AA", "line":289, "disabled":true, "pos":49, "public":false}'::jsonb),
+('{"wait":"CBC", "line":290, "abstract":"CCA", "space":"BBC"}'::jsonb),
+('{"auth":"CCB", "world":"BAB", "user":"CCC", "status":93, "line":291, "pos":77, "node":"BAC"}'::jsonb),
+('{"wait":"BCC", "org":8, "user":"AC", "cleaned":true, "line":292, "disabled":true, "pos":67, "date":"AA"}'::jsonb),
+('{"org":56, "query":"BCA", "line":293, "pos":81, "coauthors":"AAA", "node":"CAB"}'::jsonb),
+('{"world":"CB", "subtitle":"CBC", "bad":true, "query":"ACB", "indexed":false, "line":294, "pos":58, "date":"BC", "node":"CB"}'::jsonb),
+('{"wait":"BC", "user":"CA", "line":295}'::jsonb),
+('{"world":"ABA", "wait":"BA", "user":"BB", "status":65, "line":296, "pos":45, "date":"BB"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BA", "user":"AA", "indexed":false, "line":299, "space":"ABA", "public":false, "coauthors":"BC"}'::jsonb),
+('{"line":300, "space":"ABA"}'::jsonb),
+('{"state":36, "org":16, "world":"BBC", "status":13, "line":301, "public":false}'::jsonb),
+('{"subtitle":"CB", "user":"BC", "line":302, "date":"AA", "coauthors":"CAC"}'::jsonb),
+('{"wait":"CBC", "indexed":true, "cleaned":true, "line":303, "date":"ACC", "public":true}'::jsonb),
+('{"user":"CAC", "status":81, "line":304, "node":"CAB"}'::jsonb),
+('{"title":"CBB", "org":89, "subtitle":"CAA", "user":"CCA", "indexed":true, "line":305}'::jsonb),
+('{"state":10, "title":"CBA", "org":66, "cleaned":true, "line":306, "pos":59, "coauthors":"CAC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"AAA", "world":"AC", "wait":"ACA", "subtitle":"BAA", "status":64, "line":308, "node":"CCA"}'::jsonb),
+('{"state":31, "world":"CCC", "title":"BCB", "cleaned":false, "status":11, "line":309, "disabled":true, "date":"AA"}'::jsonb),
+('{"title":"BC", "subtitle":"CB", "indexed":false, "line":310, "disabled":true, "abstract":"BA", "space":"ACA"}'::jsonb),
+('{"wait":"ABB", "cleaned":true, "indexed":false, "line":311, "space":"CAB"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"CA", "line":313}'::jsonb),
+('{"org":91, "title":"CAB", "line":314, "date":"CA"}'::jsonb),
+('{}'::jsonb),
+('{"state":65, "line":316, "node":"CC"}'::jsonb),
+('{"line":317, "space":"AA"}'::jsonb),
+('{}'::jsonb),
+('{"wait":"AA", "indexed":true, "line":319}'::jsonb),
+('{"wait":"BB", "org":42, "world":"AC", "subtitle":"ACC", "indexed":true, "line":320, "disabled":true}'::jsonb),
+('{}'::jsonb),
+('{"auth":"CAC", "line":322}'::jsonb),
+('{}'::jsonb),
+('{"line":324, "pos":38, "space":"CC", "node":"BBC"}'::jsonb),
+('{"title":"CC", "line":325, "public":true, "coauthors":"BAC", "node":"ACC"}'::jsonb),
+('{"world":"CC", "subtitle":"BBC", "bad":false, "user":"BA", "line":326, "date":"AAA", "space":"AA"}'::jsonb),
+('{"state":81, "title":"BC", "wait":"BA", "indexed":false, "status":48, "line":327, "coauthors":"AB"}'::jsonb),
+('{"line":328, "space":"ABB"}'::jsonb),
+('{"line":329, "date":"CCA"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BB", "world":"BAB", "subtitle":"BA", "query":"ABB", "line":331, "disabled":true, "date":"AAA", "node":"BC"}'::jsonb),
+('{"auth":"ABA", "title":"CC", "user":"CBA", "line":332, "disabled":true, "space":"ACC"}'::jsonb),
+('{"org":98, "subtitle":"ACB", "line":333, "abstract":"BC", "public":false, "coauthors":"BC", "node":"ABA"}'::jsonb),
+('{}'::jsonb),
+('{"world":"BC", "subtitle":"BAC", "user":"AB", "query":"BAA", "cleaned":true, "line":335, "space":"AC", "node":"BAA"}'::jsonb),
+('{"state":76, "indexed":true, "cleaned":false, "line":336, "node":"CAC"}'::jsonb),
+('{"org":95, "status":84, "line":337}'::jsonb),
+('{}'::jsonb),
+('{"world":"BBA", "title":"BCC", "subtitle":"ACB", "query":"BA", "line":339, "space":"ABC", "node":"AC"}'::jsonb),
+('{"title":"CBB", "user":"CBA", "cleaned":true, "line":340, "public":true, "space":"CB", "coauthors":"CAB"}'::jsonb),
+('{"wait":"AA", "status":82, "line":341}'::jsonb),
+('{"world":"CC", "line":342}'::jsonb),
+('{"auth":"BAB", "title":"CAC", "query":"BCC", "indexed":true, "line":343}'::jsonb),
+('{"org":77, "world":"BAC", "subtitle":"AA", "user":"ABA", "line":344}'::jsonb),
+('{"state":99, "org":56, "world":"CC", "title":"CAB", "wait":"CB", "subtitle":"BCC", "line":345, "pos":65}'::jsonb),
+('{"state":68, "org":97, "title":"AA", "indexed":true, "line":346, "node":"CC"}'::jsonb),
+('{"state":3, "title":"CBC", "user":"BAA", "status":98, "line":347, "disabled":true, "pos":96, "date":"BBA"}'::jsonb),
+('{"auth":"BAA", "world":"ABB", "line":348, "disabled":false, "abstract":"ACA", "pos":66, "space":"CCC", "coauthors":"CBB", "node":"BC"}'::jsonb),
+('{}'::jsonb),
+('{"status":54, "line":350}'::jsonb),
+('{"wait":"CC", "query":"ABA", "user":"AB", "status":76, "cleaned":false, "line":351, "abstract":"CBA"}'::jsonb),
+('{"line":352, "disabled":true, "public":false}'::jsonb),
+('{"state":93, "org":92, "status":88, "line":353, "space":"AB", "coauthors":"CB"}'::jsonb),
+('{"org":34, "wait":"ABC", "world":"CBA", "bad":false, "query":"BB", "indexed":false, "line":354, "date":"CB", "public":true}'::jsonb),
+('{"wait":"CBA", "title":"CAC", "cleaned":true, "indexed":true, "line":355, "pos":9, "date":"CAA"}'::jsonb),
+('{"user":"BC", "indexed":false, "cleaned":true, "status":73, "line":356, "disabled":true, "space":"CB"}'::jsonb),
+('{"state":20, "cleaned":false, "line":357, "pos":28, "abstract":"CCB", "space":"BC"}'::jsonb),
+('{"state":17, "wait":"ABC", "query":"CB", "cleaned":false, "status":4, "line":358, "disabled":false}'::jsonb),
+('{}'::jsonb),
+('{"state":83, "world":"CC", "org":53, "cleaned":false, "status":64, "line":360, "abstract":"CBC", "coauthors":"BC"}'::jsonb),
+('{"title":"BB", "indexed":false, "line":361}'::jsonb),
+('{"state":49, "wait":"BCA", "line":362}'::jsonb),
+('{"world":"CCC", "title":"CA", "query":"CCC", "cleaned":true, "line":363, "space":"AA", "coauthors":"AAC"}'::jsonb),
+('{"state":8, "wait":"BBB", "line":364, "pos":70, "public":false, "space":"BAA", "coauthors":"AB"}'::jsonb),
+('{"state":20, "indexed":false, "status":87, "cleaned":true, "line":365, "public":true}'::jsonb),
+('{}'::jsonb),
+('{"state":92, "title":"CCC", "subtitle":"CAB", "status":39, "line":367}'::jsonb),
+('{"state":54, "org":38, "line":368}'::jsonb),
+('{}'::jsonb),
+('{"auth":"ACA", "subtitle":"CBC", "status":52, "line":370, "date":"ACC", "public":true}'::jsonb),
+('{"indexed":true, "line":371, "pos":98, "node":"CBA"}'::jsonb),
+('{"world":"BA", "status":40, "line":372, "coauthors":"AA"}'::jsonb),
+('{}'::jsonb),
+('{"query":"BA", "indexed":false, "cleaned":true, "line":374, "date":"BCC"}'::jsonb),
+('{"query":"CA", "indexed":true, "line":375, "public":false}'::jsonb),
+('{"auth":"CCA", "wait":"BBC", "bad":false, "status":91, "line":376, "abstract":"BBC", "date":"ABA"}'::jsonb),
+('{"user":"BA", "query":"CB", "status":86, "indexed":false, "line":377, "pos":83, "abstract":"BCC", "space":"CBC", "public":true}'::jsonb),
+('{"title":"ACA", "org":15, "wait":"CBC", "status":85, "line":378}'::jsonb),
+('{"state":57, "bad":true, "line":379, "abstract":"BC", "date":"CAC"}'::jsonb),
+('{"world":"CC", "cleaned":true, "line":380}'::jsonb),
+('{"title":"CB", "subtitle":"AC", "line":381, "public":false}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"status":12, "line":384, "coauthors":"CC"}'::jsonb),
+('{"auth":"BAC", "bad":false, "line":385, "abstract":"CBB", "public":false, "space":"BBC"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"world":"BBC", "bad":true, "status":71, "cleaned":false, "line":388, "node":"BB"}'::jsonb),
+('{"cleaned":false, "line":389}'::jsonb),
+('{"state":73, "line":390}'::jsonb),
+('{"wait":"BB", "org":5, "subtitle":"BAA", "bad":false, "indexed":false, "line":391, "public":false, "node":"BAA"}'::jsonb),
+('{"auth":"CCC", "org":51, "bad":false, "cleaned":true, "line":392, "space":"AC", "node":"CC"}'::jsonb),
+('{}'::jsonb),
+('{"line":394, "abstract":"ACC", "public":true}'::jsonb),
+('{"org":44, "subtitle":"BAC", "query":"BAC", "line":395}'::jsonb),
+('{"wait":"BC", "line":396}'::jsonb),
+('{"state":68, "world":"AB", "title":"ABB", "user":"CBC", "cleaned":false, "indexed":true, "line":397, "abstract":"BA", "pos":11}'::jsonb),
+('{"world":"CA", "title":"AB", "subtitle":"BC", "user":"BCB", "line":398}'::jsonb),
+('{"bad":true, "query":"BCC", "line":399}'::jsonb),
+('{"wait":"BB", "user":"BB", "cleaned":true, "indexed":false, "line":400, "date":"BC", "public":false}'::jsonb),
+('{}'::jsonb),
+('{"wait":"BA", "line":402}'::jsonb),
+('{"title":"AC", "subtitle":"BCB", "query":"BA", "line":403}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BA", "org":19, "query":"CCB", "line":405, "pos":82, "date":"CAA"}'::jsonb),
+('{"state":26, "world":"CB", "subtitle":"AB", "cleaned":false, "line":406, "disabled":true, "date":"AC"}'::jsonb),
+('{}'::jsonb),
+('{"state":11, "bad":true, "indexed":true, "line":408, "pos":79, "abstract":"BA", "date":"CB", "space":"BBA"}'::jsonb),
+('{"auth":"AC", "status":59, "line":409}'::jsonb),
+('{"org":15, "line":410, "disabled":true, "date":"BAC", "space":"CCA"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"state":65, "world":"AB", "status":69, "line":413, "space":"BA"}'::jsonb),
+('{}'::jsonb),
+('{"title":"CCB", "line":415}'::jsonb),
+('{"title":"BAB", "subtitle":"CA", "indexed":false, "line":416, "public":true}'::jsonb),
+('{"wait":"CAB", "user":"CAB", "cleaned":true, "line":417, "date":"BC", "coauthors":"BBA"}'::jsonb),
+('{"subtitle":"ABA", "user":"BB", "query":"AA", "indexed":true, "line":418, "pos":8, "space":"BB", "coauthors":"CBA"}'::jsonb),
+('{"state":11, "indexed":true, "line":419, "node":"AA"}'::jsonb),
+('{"state":86, "cleaned":false, "line":420, "pos":2, "node":"CBC"}'::jsonb),
+('{"org":73, "line":421, "disabled":false}'::jsonb),
+('{"query":"BAC", "user":"CB", "status":69, "line":422}'::jsonb),
+('{"status":22, "line":423}'::jsonb),
+('{"auth":"CB", "wait":"CCA", "world":"AAB", "line":424, "disabled":false, "space":"BA", "public":false}'::jsonb),
+('{"state":81, "world":"AC", "subtitle":"CBA", "bad":true, "cleaned":false, "indexed":true, "line":425, "date":"AAB", "coauthors":"BC", "node":"BAC"}'::jsonb),
+('{"wait":"CB", "query":"BCC", "status":97, "line":426}'::jsonb),
+('{"org":47, "query":"CB", "cleaned":true, "line":427, "date":"CC"}'::jsonb),
+('{"org":33, "query":"AC", "status":48, "indexed":false, "line":428, "disabled":true, "abstract":"BC", "space":"ACC"}'::jsonb),
+('{"org":10, "query":"AB", "line":429, "pos":77, "date":"BC"}'::jsonb),
+('{"line":430, "pos":7, "abstract":"CCA", "space":"AA"}'::jsonb),
+('{"bad":false, "user":"CA", "query":"CAB", "line":431, "node":"AC"}'::jsonb),
+('{"auth":"CA", "bad":false, "line":432}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BAA", "org":98, "title":"CCC", "world":"BAC", "line":434, "public":true}'::jsonb),
+('{"state":54, "wait":"AA", "user":"BBA", "indexed":false, "line":435, "disabled":true, "pos":12, "space":"AB"}'::jsonb),
+('{"world":"AC", "title":"CA", "query":"AAA", "line":436, "space":"AB", "coauthors":"AA"}'::jsonb),
+('{"auth":"CB", "wait":"CCC", "bad":false, "line":437, "pos":42, "date":"ABC", "space":"AB", "coauthors":"ABC"}'::jsonb),
+('{"auth":"CBB", "title":"BB", "query":"CB", "line":438, "pos":15, "abstract":"BC", "node":"BBB"}'::jsonb),
+('{"title":"CC", "line":439, "disabled":false}'::jsonb),
+('{"title":"AB", "line":440, "disabled":false}'::jsonb),
+('{"org":3, "bad":true, "user":"BCB", "query":"AB", "indexed":false, "cleaned":true, "line":441, "disabled":false, "space":"BA", "node":"BB"}'::jsonb),
+('{"state":62, "user":"BCC", "status":12, "line":442, "pos":58, "date":"CC", "node":"CB"}'::jsonb),
+('{"world":"BCB", "bad":true, "line":443, "space":"AAB"}'::jsonb),
+('{"state":56, "bad":false, "cleaned":false, "line":444, "disabled":false, "date":"CA", "space":"BBB", "public":true}'::jsonb),
+('{}'::jsonb),
+('{"org":31, "world":"ABC", "cleaned":true, "line":446, "disabled":true, "public":true, "coauthors":"CB"}'::jsonb),
+('{"state":54, "indexed":true, "line":447}'::jsonb),
+('{"state":98, "title":"AC", "wait":"AAC", "world":"BC", "bad":false, "line":448, "disabled":true, "public":true, "node":"ABB"}'::jsonb),
+('{"world":"AAC", "indexed":true, "line":449, "disabled":true, "pos":61}'::jsonb),
+('{"org":56, "title":"CA", "line":450}'::jsonb),
+('{"auth":"BBB", "line":451, "pos":58, "date":"BB", "space":"ABA"}'::jsonb),
+('{"auth":"AB", "world":"CA", "cleaned":true, "line":452}'::jsonb),
+('{"bad":true, "line":453, "disabled":true, "abstract":"AC", "pos":20, "date":"ABB", "node":"CAB"}'::jsonb),
+('{}'::jsonb),
+('{"state":91, "wait":"AC", "org":96, "world":"AA", "subtitle":"BBC", "query":"AA", "cleaned":true, "line":455, "public":false}'::jsonb),
+('{"status":99, "line":456, "disabled":true}'::jsonb),
+('{"org":86, "line":457, "public":true, "coauthors":"AC"}'::jsonb),
+('{"status":14, "cleaned":true, "line":458, "disabled":true}'::jsonb),
+('{"world":"AB", "user":"CB", "query":"AAB", "line":459, "pos":66, "public":false, "node":"BBA"}'::jsonb),
+('{"state":58, "world":"BB", "wait":"CBA", "title":"BCA", "line":460, "pos":95, "abstract":"CCA", "space":"BC", "coauthors":"CB"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"CAC", "title":"AB", "query":"BBA", "user":"CB", "line":462, "abstract":"BCC", "pos":89, "coauthors":"ABB"}'::jsonb),
+('{"org":13, "bad":false, "query":"AA", "status":49, "line":463, "disabled":false}'::jsonb),
+('{"bad":true, "cleaned":false, "line":464, "coauthors":"BB"}'::jsonb),
+('{"org":14, "query":"BA", "line":465, "pos":25, "abstract":"BBA", "space":"AAA", "node":"CAC"}'::jsonb),
+('{"org":63, "title":"CA", "subtitle":"ACC", "query":"BAC", "status":76, "line":466, "abstract":"ACA"}'::jsonb),
+('{"wait":"BA", "subtitle":"BC", "line":467, "disabled":false, "abstract":"AC"}'::jsonb),
+('{"org":76, "title":"CA", "query":"AB", "line":468, "public":false}'::jsonb),
+('{"state":95, "world":"AC", "bad":false, "status":65, "cleaned":false, "line":469, "disabled":false}'::jsonb),
+('{"wait":"AB", "subtitle":"AA", "bad":false, "user":"CC", "query":"BBC", "status":6, "line":470, "date":"CCC"}'::jsonb),
+('{"state":82, "bad":true, "indexed":true, "line":471, "date":"BB", "coauthors":"AAA"}'::jsonb),
+('{}'::jsonb),
+('{"state":12, "auth":"ACB", "world":"CBC", "bad":false, "indexed":true, "line":473, "date":"CA", "space":"ABB", "coauthors":"CC"}'::jsonb),
+('{"subtitle":"AA", "bad":false, "user":"ACC", "line":474, "pos":86, "abstract":"CAC", "space":"BBA"}'::jsonb),
+('{"cleaned":true, "line":475}'::jsonb),
+('{"title":"CC", "wait":"BB", "status":6, "line":476, "abstract":"ACC", "date":"CB", "space":"BA", "public":true}'::jsonb),
+('{"state":96, "wait":"BA", "org":30, "subtitle":"BB", "user":"CBB", "status":19, "line":477}'::jsonb),
+('{"state":78, "org":99, "title":"CC", "line":478, "node":"BAB"}'::jsonb),
+('{"world":"CBC", "bad":false, "line":479, "date":"ACB", "public":true, "node":"CB"}'::jsonb),
+('{"state":0, "query":"ABC", "status":65, "line":480, "disabled":true, "space":"CBA", "node":"BA"}'::jsonb),
+('{"auth":"BAC", "org":24, "subtitle":"BBC", "bad":false, "user":"CAC", "line":481, "date":"BBB", "public":true, "coauthors":"CBA"}'::jsonb),
+('{"org":18, "bad":true, "cleaned":false, "status":3, "indexed":true, "line":482, "date":"BB", "coauthors":"ACC"}'::jsonb),
+('{"wait":"CB", "user":"AC", "line":483, "disabled":false}'::jsonb),
+('{"world":"AC", "subtitle":"AA", "query":"AAB", "line":484, "disabled":true, "space":"CAA"}'::jsonb),
+('{"line":485, "pos":2, "space":"CA"}'::jsonb),
+('{"org":42, "indexed":false, "line":486, "date":"CB"}'::jsonb),
+('{"org":3, "wait":"CAA", "subtitle":"CA", "cleaned":true, "line":487, "disabled":true}'::jsonb),
+('{"org":68, "subtitle":"CCB", "query":"CAA", "cleaned":false, "status":46, "line":488, "pos":87, "public":false, "node":"BC"}'::jsonb),
+('{}'::jsonb),
+('{"status":60, "cleaned":false, "line":490, "space":"CC", "node":"BCB"}'::jsonb),
+('{"state":42, "org":9, "subtitle":"CBA", "user":"BA", "status":96, "line":491, "pos":36}'::jsonb),
+('{"state":16, "title":"BCC", "user":"ABC", "indexed":false, "status":24, "line":492, "disabled":true, "node":"CBC"}'::jsonb),
+('{"auth":"CC", "wait":"BBB", "line":493, "disabled":false, "public":false, "coauthors":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"wait":"BB", "title":"BBC", "subtitle":"BA", "status":3, "cleaned":false, "line":495, "disabled":false, "coauthors":"AB", "node":"BAC"}'::jsonb),
+('{}'::jsonb),
+('{"query":"CC", "indexed":false, "line":497, "coauthors":"CAC", "node":"BC"}'::jsonb),
+('{"auth":"BBA", "state":68, "line":498}'::jsonb),
+('{"state":21, "title":"CCB", "wait":"AAA", "subtitle":"CCC", "user":"BAA", "indexed":true, "line":499, "coauthors":"BB"}'::jsonb),
+('{"auth":"AAA", "subtitle":"CC", "bad":true, "user":"CC", "indexed":true, "line":500, "disabled":true, "date":"AB", "node":"AC"}'::jsonb),
+('{"auth":"BB", "title":"CCA", "user":"BA", "cleaned":true, "line":501, "pos":37, "space":"BA", "public":false}'::jsonb),
+('{"auth":"BCA", "line":502, "date":"BA"}'::jsonb),
+('{"world":"ABA", "bad":true, "indexed":false, "line":503, "disabled":true, "abstract":"AC", "pos":1, "public":false}'::jsonb),
+('{"auth":"BBB", "subtitle":"ACB", "line":504, "space":"AC", "node":"BB"}'::jsonb),
+('{"auth":"CAC", "state":19, "title":"ACA", "wait":"BA", "query":"CC", "line":505}'::jsonb),
+('{"subtitle":"BC", "cleaned":false, "indexed":false, "line":506, "date":"CAB", "public":false, "node":"ABC"}'::jsonb),
+('{"state":87, "wait":"CCC", "query":"CAC", "user":"CBB", "line":507, "abstract":"BBC", "date":"AA", "coauthors":"CA"}'::jsonb),
+('{"auth":"AC", "subtitle":"BC", "bad":false, "query":"ABA", "user":"CBB", "indexed":true, "cleaned":false, "line":508, "coauthors":"BA"}'::jsonb),
+('{"auth":"AA", "title":"ABA", "subtitle":"CCA", "query":"CC", "line":509, "pos":27, "node":"CBB"}'::jsonb),
+('{"org":5, "title":"CAC", "subtitle":"BBB", "line":510, "pos":76, "abstract":"AAB", "space":"AA"}'::jsonb),
+('{"bad":true, "line":511}'::jsonb),
+('{"wait":"ACB", "indexed":false, "line":512}'::jsonb),
+('{"auth":"CBA", "world":"BA", "bad":true, "user":"CBA", "query":"CC", "line":513, "public":false, "coauthors":"CC"}'::jsonb),
+('{}'::jsonb),
+('{"state":97, "wait":"BB", "line":515, "date":"CBC", "space":"CA"}'::jsonb),
+('{"auth":"CBC", "line":516, "disabled":true}'::jsonb),
+('{"state":91, "user":"CCA", "line":517, "coauthors":"BA", "node":"CBA"}'::jsonb),
+('{"bad":false, "cleaned":true, "line":518, "space":"AAB"}'::jsonb),
+('{}'::jsonb),
+('{"title":"CA", "cleaned":false, "status":38, "line":520}'::jsonb),
+('{"auth":"BCA", "world":"AC", "org":71, "user":"CA", "line":521, "abstract":"AAB"}'::jsonb),
+('{"bad":true, "line":522, "pos":28, "abstract":"BAA"}'::jsonb),
+('{"line":523, "coauthors":"CBC", "node":"AAB"}'::jsonb),
+('{"status":51, "cleaned":false, "line":524}'::jsonb),
+('{"query":"AAB", "line":525, "disabled":true, "date":"AA", "public":true, "coauthors":"CA"}'::jsonb),
+('{"org":15, "user":"AC", "cleaned":false, "line":526, "coauthors":"CAC", "node":"BAB"}'::jsonb),
+('{"world":"ABA", "line":527, "disabled":true, "public":true}'::jsonb),
+('{"auth":"BBC", "state":48, "bad":false, "line":528, "abstract":"BB", "date":"BAC", "space":"BA", "public":true}'::jsonb),
+('{"auth":"BA", "wait":"CAC", "subtitle":"ABC", "query":"CB", "indexed":false, "cleaned":false, "line":529, "disabled":true, "date":"CA"}'::jsonb),
+('{"wait":"AC", "world":"ABA", "org":55, "bad":true, "indexed":true, "line":530, "pos":32, "space":"BCA", "public":true}'::jsonb),
+('{"title":"CBC", "wait":"BAA", "line":531}'::jsonb),
+('{"world":"AA", "line":532, "pos":35, "space":"AAB", "public":true}'::jsonb),
+('{"line":533, "space":"AB", "coauthors":"BA"}'::jsonb),
+('{"auth":"CBC", "world":"BB", "line":534, "space":"ACA", "coauthors":"CBB"}'::jsonb),
+('{"wait":"ACA", "status":47, "line":535, "public":true, "node":"BAA"}'::jsonb),
+('{"org":16, "subtitle":"BBB", "line":536, "abstract":"AC", "space":"CB", "coauthors":"CC", "node":"CBC"}'::jsonb),
+('{"wait":"AAB", "line":537, "abstract":"AB", "space":"CAC"}'::jsonb),
+('{"query":"CAC", "line":538}'::jsonb),
+('{"world":"AC", "query":"AAA", "indexed":false, "status":18, "line":539, "pos":62, "space":"BC", "coauthors":"BAC"}'::jsonb),
+('{"org":30, "world":"AA", "query":"BC", "user":"BAC", "status":12, "cleaned":true, "line":540, "space":"AB"}'::jsonb),
+('{"org":30, "user":"CCB", "query":"BB", "cleaned":false, "line":541, "disabled":true, "public":true, "node":"CBA"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"ABB", "bad":true, "line":543}'::jsonb),
+('{"subtitle":"BBB", "bad":true, "line":544, "pos":43, "coauthors":"ABB"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"AB", "user":"BA", "line":546, "node":"CB"}'::jsonb),
+('{"title":"BBB", "user":"AA", "line":547, "abstract":"CBB", "pos":45}'::jsonb),
+('{"wait":"CCB", "title":"AC", "world":"AAA", "line":548, "abstract":"BBC", "pos":23, "coauthors":"ACC"}'::jsonb),
+('{"org":55, "subtitle":"BA", "line":549, "disabled":true, "date":"CB", "space":"AA"}'::jsonb),
+('{"org":39, "cleaned":true, "line":550, "public":false}'::jsonb),
+('{"state":41, "auth":"CC", "world":"CB", "line":551, "space":"AAB"}'::jsonb),
+('{}'::jsonb),
+('{"state":26, "bad":false, "query":"BAA", "status":84, "indexed":true, "line":553, "disabled":false, "coauthors":"CC", "node":"CBB"}'::jsonb),
+('{"world":"ABA", "user":"CCC", "query":"ABB", "line":554, "space":"ABC", "node":"AAA"}'::jsonb),
+('{"state":18, "wait":"CCB", "bad":true, "user":"BA", "line":555, "space":"CC", "coauthors":"BB", "node":"BBB"}'::jsonb),
+('{"auth":"AA", "state":71, "subtitle":"AA", "query":"ACC", "indexed":true, "line":556, "space":"BAB", "public":false}'::jsonb),
+('{"indexed":true, "cleaned":true, "line":557, "disabled":false, "abstract":"AB"}'::jsonb),
+('{"auth":"BCC", "title":"ACB", "world":"BCA", "user":"BAB", "cleaned":false, "line":558, "space":"BB", "coauthors":"CBC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"ACC", "org":18, "wait":"AB", "status":1, "indexed":true, "line":560}'::jsonb),
+('{"status":8, "line":561, "abstract":"BA", "public":false}'::jsonb),
+('{"state":27, "title":"ABA", "bad":true, "query":"AAB", "indexed":false, "line":562, "pos":86, "public":true, "coauthors":"BA"}'::jsonb),
+('{}'::jsonb),
+('{"title":"BAC", "wait":"CCC", "user":"BA", "line":564, "disabled":false, "date":"BB", "public":true, "space":"CB", "coauthors":"CCB"}'::jsonb),
+('{"wait":"CAA", "line":565, "pos":80, "space":"AB"}'::jsonb),
+('{"auth":"CBB", "subtitle":"BCA", "user":"CB", "line":566, "abstract":"BC", "date":"AB"}'::jsonb),
+('{"title":"CCB", "status":78, "line":567, "pos":68, "node":"BA"}'::jsonb),
+('{"auth":"BC", "query":"AB", "line":568, "space":"AB", "node":"BB"}'::jsonb),
+('{}'::jsonb),
+('{"line":570, "pos":54}'::jsonb),
+('{"world":"BBB", "user":"CC", "indexed":true, "line":571, "abstract":"CC", "coauthors":"BA", "node":"ABB"}'::jsonb),
+('{"state":41, "line":572}'::jsonb),
+('{"subtitle":"CBC", "cleaned":true, "line":573, "node":"BCB"}'::jsonb),
+('{"title":"ABA", "line":574, "pos":27, "space":"CC"}'::jsonb),
+('{"status":29, "indexed":false, "cleaned":false, "line":575, "pos":52, "public":false, "coauthors":"ACC"}'::jsonb),
+('{"title":"BBB", "org":86, "wait":"AAA", "user":"CC", "query":"CA", "line":576, "disabled":false, "date":"AB", "node":"BC"}'::jsonb),
+('{"line":577, "abstract":"CAA", "date":"BB"}'::jsonb),
+('{"auth":"CCC", "subtitle":"BBB", "query":"ABA", "line":578, "pos":99, "space":"CCB", "public":true, "coauthors":"ACA", "node":"ACB"}'::jsonb),
+('{"wait":"BCC", "line":579}'::jsonb),
+('{"state":99, "world":"BAC", "user":"CA", "line":580}'::jsonb),
+('{"state":55, "world":"AAA", "title":"AAA", "cleaned":false, "line":581, "date":"AC", "public":true, "node":"AA"}'::jsonb),
+('{"query":"ACC", "cleaned":true, "line":582, "disabled":false}'::jsonb),
+('{"auth":"AAB", "query":"BAC", "line":583}'::jsonb),
+('{"auth":"AA", "user":"BAC", "line":584}'::jsonb),
+('{}'::jsonb),
+('{"org":96, "wait":"BC", "bad":false, "cleaned":false, "status":96, "line":586, "pos":95}'::jsonb),
+('{"auth":"BC", "subtitle":"BCB", "bad":true, "user":"BBC", "line":587, "pos":79, "node":"BA"}'::jsonb),
+('{"state":55, "line":588}'::jsonb),
+('{"title":"ABC", "world":"AB", "subtitle":"CBC", "user":"BA", "query":"BAB", "line":589, "date":"AC", "node":"CB"}'::jsonb),
+('{"world":"BAA", "bad":false, "user":"AAB", "cleaned":false, "indexed":false, "line":590}'::jsonb),
+('{"title":"CB", "wait":"BC", "subtitle":"BAC", "cleaned":true, "line":591, "disabled":false, "abstract":"CBB", "public":false, "node":"ACC"}'::jsonb),
+('{"user":"BC", "line":592, "public":false}'::jsonb),
+('{}'::jsonb),
+('{"wait":"CC", "org":57, "title":"BAC", "line":594, "abstract":"AA"}'::jsonb),
+('{"auth":"BBC", "state":3, "world":"AAC", "query":"BA", "line":595, "coauthors":"BB"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"CC", "user":"CC", "line":597}'::jsonb),
+('{"wait":"BBA", "user":"AAA", "line":598, "space":"ACB", "node":"AA"}'::jsonb),
+('{"auth":"BB", "user":"ABA", "line":599, "abstract":"AB", "node":"BA"}'::jsonb),
+('{}'::jsonb),
+('{"world":"AAA", "user":"BB", "cleaned":false, "line":601, "space":"AC", "coauthors":"ABB"}'::jsonb),
+('{"title":"CAB", "bad":false, "line":602, "coauthors":"ABB"}'::jsonb),
+('{}'::jsonb),
+('{"world":"CCC", "org":79, "line":604}'::jsonb),
+('{"org":56, "query":"AB", "cleaned":true, "indexed":true, "status":20, "line":605, "public":true, "coauthors":"ACA"}'::jsonb),
+('{"auth":"BBC", "org":13, "subtitle":"CC", "bad":true, "user":"ABC", "line":606, "date":"CA", "public":false}'::jsonb),
+('{"query":"BA", "line":607}'::jsonb),
+('{"bad":true, "line":608, "pos":12, "coauthors":"CB"}'::jsonb),
+('{"bad":false, "status":42, "line":609}'::jsonb),
+('{}'::jsonb),
+('{"bad":true, "line":611}'::jsonb),
+('{"auth":"CCA", "subtitle":"BC", "bad":true, "query":"CAA", "cleaned":false, "line":612, "public":false, "node":"CBA"}'::jsonb),
+('{"org":65, "query":"BC", "line":613}'::jsonb),
+('{}'::jsonb),
+('{"wait":"BAC", "title":"AAB", "user":"CAC", "line":615, "pos":69, "space":"CC", "node":"AAC"}'::jsonb),
+('{"bad":false, "line":616, "abstract":"AB", "pos":65, "coauthors":"BBB"}'::jsonb),
+('{}'::jsonb),
+('{"org":38, "world":"BA", "line":618, "coauthors":"AA", "node":"BC"}'::jsonb),
+('{"cleaned":false, "line":619, "disabled":false}'::jsonb),
+('{"auth":"BC", "line":620, "pos":79, "date":"AB", "coauthors":"BAA", "node":"CB"}'::jsonb),
+('{"auth":"CAA", "title":"CB", "user":"BAC", "cleaned":false, "line":621, "public":false, "space":"CBA"}'::jsonb),
+('{}'::jsonb),
+('{"bad":false, "status":12, "line":623}'::jsonb),
+('{"auth":"BBB", "wait":"BAC", "org":36, "title":"AB", "indexed":false, "cleaned":false, "line":624, "date":"AB", "coauthors":"CB"}'::jsonb),
+('{"wait":"AA", "subtitle":"AB", "query":"CCB", "line":625, "node":"CBB"}'::jsonb),
+('{"wait":"BC", "subtitle":"BA", "bad":true, "user":"AA", "line":626, "pos":3, "date":"BB"}'::jsonb),
+('{"org":28, "user":"BC", "query":"AC", "status":63, "line":627, "pos":45, "public":true, "node":"BC"}'::jsonb),
+('{"query":"BC", "status":47, "line":628, "disabled":false, "date":"CA", "public":false}'::jsonb),
+('{}'::jsonb),
+('{"wait":"CB", "line":630, "pos":67, "coauthors":"AC"}'::jsonb),
+('{"org":33, "world":"BBB", "query":"BB", "status":92, "line":631}'::jsonb),
+('{"state":65, "title":"AC", "world":"CBC", "query":"CBC", "line":632, "date":"CAC", "space":"CC", "coauthors":"CC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"CC", "query":"BCA", "status":46, "line":634, "disabled":false, "pos":69}'::jsonb),
+('{"wait":"CB", "line":635, "pos":34}'::jsonb),
+('{"state":9, "wait":"CC", "status":23, "line":636, "disabled":true, "date":"BB", "space":"AC"}'::jsonb),
+('{"user":"CCB", "indexed":false, "cleaned":true, "line":637, "pos":65, "date":"AA", "public":true}'::jsonb),
+('{"auth":"BC", "wait":"AB", "title":"BB", "bad":true, "line":638, "abstract":"ACC", "date":"BC", "public":false}'::jsonb),
+('{"state":44, "auth":"BC", "world":"CBC", "line":639, "disabled":false, "date":"CAA"}'::jsonb),
+('{"world":"CB", "title":"ACB", "user":"BA", "query":"AA", "line":640, "disabled":true, "space":"AC"}'::jsonb),
+('{"state":37, "line":641, "disabled":true, "pos":66}'::jsonb),
+('{"world":"AAA", "bad":true, "user":"AAA", "query":"BA", "line":642, "disabled":true, "coauthors":"CBC"}'::jsonb),
+('{"world":"BA", "title":"ABB", "org":96, "bad":false, "query":"AAA", "status":75, "cleaned":false, "line":643, "space":"BA"}'::jsonb),
+('{"state":36, "org":66, "subtitle":"AA", "query":"CA", "cleaned":true, "status":79, "line":644, "date":"CB"}'::jsonb),
+('{"wait":"BC", "line":645, "date":"CBA", "space":"BCB", "public":true, "node":"ABA"}'::jsonb),
+('{"auth":"BB", "org":37, "query":"CAA", "indexed":true, "line":646, "abstract":"CBA", "coauthors":"CBA"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"state":58, "world":"BAB", "org":11, "user":"CC", "line":649}'::jsonb),
+('{"title":"CB", "status":19, "line":650, "disabled":false, "public":false, "coauthors":"AA"}'::jsonb),
+('{"user":"BBC", "indexed":true, "line":651, "disabled":true, "pos":8}'::jsonb),
+('{"query":"CC", "cleaned":true, "indexed":false, "line":652, "pos":67, "date":"AA"}'::jsonb),
+('{"auth":"AAC", "line":653, "disabled":true, "public":false, "coauthors":"AAA", "node":"CBB"}'::jsonb),
+('{"bad":true, "query":"AC", "line":654, "disabled":false}'::jsonb),
+('{"world":"CCA", "org":15, "bad":false, "user":"CCC", "line":655, "public":true, "space":"CC"}'::jsonb),
+('{"line":656, "coauthors":"BBB"}'::jsonb),
+('{"title":"BA", "line":657, "date":"ACB"}'::jsonb),
+('{"user":"BC", "query":"CC", "cleaned":true, "line":658, "pos":51, "abstract":"BA"}'::jsonb),
+('{"subtitle":"CCA", "user":"CCA", "cleaned":false, "line":659, "abstract":"BA", "pos":95, "date":"CA"}'::jsonb),
+('{"auth":"CA", "state":23, "org":19, "bad":false, "user":"BCB", "indexed":false, "line":660, "date":"ABA"}'::jsonb),
+('{"state":64, "org":97, "bad":false, "indexed":false, "line":661, "space":"BAB", "coauthors":"BB", "node":"BA"}'::jsonb),
+('{"status":11, "line":662}'::jsonb),
+('{"title":"BCC", "org":44, "subtitle":"ACB", "cleaned":false, "line":663, "pos":58}'::jsonb),
+('{"auth":"ABB", "bad":true, "line":664, "pos":82, "coauthors":"CC", "node":"AB"}'::jsonb),
+('{"bad":false, "cleaned":true, "status":25, "line":665, "disabled":false, "abstract":"BB", "public":true}'::jsonb),
+('{"wait":"AC", "user":"CB", "line":666, "pos":71, "abstract":"ACA", "coauthors":"CBB"}'::jsonb),
+('{"title":"AA", "bad":true, "user":"BB", "line":667, "date":"CA", "space":"BC", "node":"CC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"AAB", "line":669}'::jsonb),
+('{"wait":"AAC", "query":"ABA", "status":35, "line":670, "disabled":false, "pos":56}'::jsonb),
+('{"org":3, "line":671}'::jsonb),
+('{"state":46, "bad":false, "cleaned":true, "line":672}'::jsonb),
+('{"state":30, "org":9, "status":72, "line":673, "abstract":"ACA", "coauthors":"CB"}'::jsonb),
+('{"auth":"BB", "wait":"CA", "title":"BBB", "bad":true, "user":"AAA", "status":86, "indexed":false, "line":674, "node":"BCC"}'::jsonb),
+('{"indexed":true, "line":675, "pos":63}'::jsonb),
+('{"bad":true, "query":"CBB", "status":5, "line":676, "abstract":"CCC", "public":false, "space":"BB"}'::jsonb),
+('{"title":"BBB", "org":60, "bad":true, "cleaned":false, "line":677, "pos":82, "date":"BAA", "space":"BB", "coauthors":"CAA"}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"state":73, "bad":false, "cleaned":false, "line":680, "abstract":"CA", "date":"CCA", "space":"CB"}'::jsonb),
+('{"state":92, "query":"CC", "line":681, "abstract":"AB", "date":"BBB", "public":true, "coauthors":"CBA"}'::jsonb),
+('{"subtitle":"CCA", "line":682}'::jsonb),
+('{"world":"BAC", "subtitle":"AC", "line":683, "disabled":true, "abstract":"AA", "pos":55, "space":"AC", "node":"CA"}'::jsonb),
+('{"state":75, "world":"ACA", "query":"BC", "line":684, "coauthors":"AAC"}'::jsonb),
+('{"status":21, "line":685}'::jsonb),
+('{"state":39, "wait":"CB", "title":"CBC", "query":"BB", "cleaned":true, "line":686, "disabled":false}'::jsonb),
+('{"world":"CCA", "wait":"AB", "user":"CC", "query":"BB", "cleaned":true, "line":687}'::jsonb),
+('{"auth":"CAC", "state":94, "wait":"ACC", "title":"BBC", "user":"BB", "line":688, "disabled":false, "pos":16, "coauthors":"AAC"}'::jsonb),
+('{}'::jsonb),
+('{"org":43, "line":690}'::jsonb),
+('{}'::jsonb),
+('{"state":4, "title":"CA", "subtitle":"AA", "query":"BC", "line":692, "pos":57, "date":"BCA", "public":false, "coauthors":"ABB"}'::jsonb),
+('{"wait":"BBA", "line":693}'::jsonb),
+('{"auth":"BCA", "bad":false, "user":"BBA", "line":694, "disabled":false, "date":"CC", "public":true, "coauthors":"CB"}'::jsonb),
+('{"state":66, "wait":"BB", "user":"CC", "indexed":true, "line":695, "pos":99, "space":"BCA"}'::jsonb),
+('{"org":1, "line":696, "disabled":false, "space":"BCC", "coauthors":"BC"}'::jsonb),
+('{"auth":"BC", "cleaned":true, "indexed":false, "line":697, "space":"CBB"}'::jsonb),
+('{"wait":"AC", "indexed":false, "line":698, "pos":44}'::jsonb),
+('{"wait":"AA", "title":"BBB", "org":31, "indexed":true, "line":699, "disabled":false}'::jsonb),
+('{"auth":"BB", "world":"ACC", "bad":true, "indexed":false, "line":700, "abstract":"CB", "pos":5, "space":"ACB", "node":"CC"}'::jsonb),
+('{"cleaned":false, "line":701, "space":"CB"}'::jsonb),
+('{"line":702, "space":"CCC"}'::jsonb),
+('{"world":"CA", "subtitle":"ABA", "line":703, "pos":5, "date":"BA", "coauthors":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"line":705, "date":"BBB"}'::jsonb),
+('{"state":10, "query":"CB", "status":70, "line":706, "abstract":"ABA", "date":"BC"}'::jsonb),
+('{"auth":"CB", "line":707}'::jsonb),
+('{"wait":"BBA", "cleaned":true, "line":708, "pos":94, "date":"CBC"}'::jsonb),
+('{"state":86, "org":5, "world":"BB", "indexed":false, "line":709, "date":"BBB", "space":"CA", "public":true}'::jsonb),
+('{"world":"ACA", "query":"ABC", "status":40, "line":710, "disabled":true, "public":true, "node":"CA"}'::jsonb),
+('{"bad":true, "line":711}'::jsonb),
+('{"query":"AB", "line":712, "coauthors":"BBC", "node":"AA"}'::jsonb),
+('{"user":"ABB", "line":713, "public":false, "space":"AAA", "node":"BBA"}'::jsonb),
+('{"auth":"AC", "wait":"BAC", "bad":true, "line":714, "public":false}'::jsonb),
+('{"line":715, "abstract":"CA", "public":false}'::jsonb),
+('{"user":"AC", "indexed":true, "line":716, "coauthors":"CB"}'::jsonb),
+('{"state":4, "title":"ABB", "org":26, "indexed":true, "line":717, "public":true, "coauthors":"CCA", "node":"AC"}'::jsonb),
+('{"wait":"CA", "title":"CCA", "world":"CCC", "line":718, "abstract":"ACA"}'::jsonb),
+('{"auth":"ACA", "org":29, "subtitle":"AA", "user":"CA", "status":24, "indexed":true, "line":719, "public":false, "node":"CA"}'::jsonb),
+('{}'::jsonb),
+('{"line":721, "disabled":true, "abstract":"BAC"}'::jsonb),
+('{"world":"BC", "line":722}'::jsonb),
+('{"state":27, "auth":"AA", "title":"BC", "world":"CC", "query":"BCC", "line":723, "disabled":true, "pos":9, "public":false, "node":"BCC"}'::jsonb),
+('{"org":78, "wait":"ABA", "cleaned":true, "indexed":true, "line":724, "date":"ACB", "space":"AA"}'::jsonb),
+('{"state":60, "line":725}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"wait":"ABA", "title":"CAC", "user":"CCC", "line":728}'::jsonb),
+('{"wait":"CC", "indexed":true, "status":39, "line":729, "disabled":true, "public":false}'::jsonb),
+('{"auth":"CB", "subtitle":"BBA", "line":730, "coauthors":"CAC"}'::jsonb),
+('{"world":"CBB", "line":731, "space":"BCB"}'::jsonb),
+('{"cleaned":true, "line":732}'::jsonb),
+('{"org":67, "bad":true, "line":733, "pos":9, "node":"ACC"}'::jsonb),
+('{"world":"BC", "wait":"CAC", "org":58, "subtitle":"ACC", "bad":true, "query":"CAA", "line":734, "abstract":"BCA", "pos":1, "public":true}'::jsonb),
+('{"state":45, "query":"AB", "indexed":false, "line":735, "pos":82, "date":"BC", "public":false, "coauthors":"BA"}'::jsonb),
+('{"state":68, "title":"BC", "cleaned":true, "status":34, "line":736, "disabled":true, "node":"BBB"}'::jsonb),
+('{"auth":"AC", "line":737}'::jsonb),
+('{"line":738, "date":"BA", "space":"CCC", "public":false}'::jsonb),
+('{"line":739, "node":"BAA"}'::jsonb),
+('{"org":72, "title":"BC", "line":740, "pos":51, "coauthors":"CA"}'::jsonb),
+('{"state":72, "user":"CCB", "query":"ACA", "line":741}'::jsonb),
+('{"org":80, "subtitle":"BBA", "bad":true, "user":"BC", "line":742, "pos":52, "coauthors":"BCA"}'::jsonb),
+('{}'::jsonb),
+('{"query":"BC", "line":744, "abstract":"AB", "public":false, "node":"BAC"}'::jsonb),
+('{"world":"CAC", "line":745}'::jsonb),
+('{"auth":"CBB", "title":"AA", "user":"AB", "line":746, "pos":35, "public":false, "space":"AAB"}'::jsonb),
+('{"state":69, "world":"AB", "org":78, "subtitle":"BA", "bad":false, "line":747, "node":"AAA"}'::jsonb),
+('{"bad":true, "line":748, "public":true}'::jsonb),
+('{"wait":"BC", "org":47, "query":"BBB", "line":749}'::jsonb),
+('{"title":"BBB", "line":750}'::jsonb),
+('{"org":33, "query":"CB", "line":751, "disabled":true}'::jsonb),
+('{"subtitle":"BB", "line":752, "space":"CC"}'::jsonb),
+('{"org":89, "line":753}'::jsonb),
+('{"auth":"ABA", "line":754, "coauthors":"ACC"}'::jsonb),
+('{"subtitle":"BA", "line":755, "pos":47}'::jsonb),
+('{"state":81, "subtitle":"CB", "query":"AB", "status":25, "cleaned":false, "line":756, "pos":72, "date":"BA", "coauthors":"BCA"}'::jsonb),
+('{"state":46, "status":88, "line":757, "disabled":false, "public":true}'::jsonb),
+('{"world":"AB", "line":758, "disabled":true, "abstract":"BB", "coauthors":"AAA"}'::jsonb),
+('{"query":"AC", "line":759, "abstract":"AAB"}'::jsonb),
+('{"auth":"BC", "indexed":false, "line":760, "abstract":"BA", "node":"CAA"}'::jsonb),
+('{"state":10, "auth":"BAC", "title":"BC", "query":"BCA", "cleaned":true, "line":761, "disabled":true, "space":"ACC", "coauthors":"ABA"}'::jsonb),
+('{"line":762, "disabled":true, "pos":43}'::jsonb),
+('{"world":"CBA", "user":"BBC", "indexed":true, "line":763}'::jsonb),
+('{"wait":"ACB", "query":"BA", "status":22, "line":764, "pos":70, "abstract":"BAC", "public":false, "space":"BC"}'::jsonb),
+('{}'::jsonb),
+('{"line":766, "disabled":false, "abstract":"CBC", "date":"CA"}'::jsonb),
+('{"title":"CC", "bad":true, "user":"BCC", "indexed":false, "line":767, "date":"BCB", "node":"AAA"}'::jsonb),
+('{"title":"CB", "line":768, "abstract":"AA", "node":"ABB"}'::jsonb),
+('{"org":21, "user":"ABC", "line":769, "abstract":"BB", "date":"CBB", "space":"CC"}'::jsonb),
+('{"auth":"AC", "org":66, "user":"CC", "line":770, "public":false, "space":"CA", "coauthors":"AA"}'::jsonb),
+('{"org":58, "line":771, "coauthors":"BCC", "node":"AC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BC", "wait":"CC", "line":773, "abstract":"ACC", "pos":98, "date":"CCC", "space":"ABB", "node":"CB"}'::jsonb),
+('{}'::jsonb),
+('{"query":"BC", "user":"AC", "indexed":true, "line":775, "abstract":"AAA"}'::jsonb),
+('{"subtitle":"BAA", "indexed":false, "line":776}'::jsonb),
+('{"line":777, "pos":33, "date":"CCB", "public":true}'::jsonb),
+('{"world":"BCA", "bad":true, "line":778}'::jsonb),
+('{"auth":"CA", "line":779, "date":"AC", "space":"CAC"}'::jsonb),
+('{"title":"BB", "bad":false, "cleaned":true, "line":780, "disabled":false, "date":"BAB", "space":"ACB"}'::jsonb),
+('{"auth":"CAC", "title":"AAB", "subtitle":"CA", "bad":false, "line":781, "disabled":false, "space":"CB"}'::jsonb),
+('{"state":78, "auth":"AC", "bad":true, "status":46, "line":782, "abstract":"CCA", "pos":97, "public":true}'::jsonb),
+('{"user":"BBA", "line":783}'::jsonb),
+('{}'::jsonb),
+('{"state":63, "title":"CA", "cleaned":true, "line":785, "abstract":"BA", "space":"BCC"}'::jsonb),
+('{"line":786, "node":"CAC"}'::jsonb),
+('{"line":787, "pos":65}'::jsonb),
+('{"line":788, "space":"ABB"}'::jsonb),
+('{}'::jsonb),
+('{"org":14, "line":790, "abstract":"CAB", "coauthors":"BBC"}'::jsonb),
+('{"subtitle":"CBA", "cleaned":false, "line":791, "disabled":false, "pos":57, "node":"CB"}'::jsonb),
+('{"auth":"CAA", "org":84, "wait":"AB", "indexed":true, "status":51, "line":792, "abstract":"CC"}'::jsonb),
+('{"org":72, "bad":true, "line":793, "space":"ACA"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BC", "state":76, "wait":"CC", "user":"ABB", "cleaned":false, "line":795, "pos":99, "abstract":"CA"}'::jsonb),
+('{"wait":"CCA", "world":"CBC", "line":796, "date":"CB", "public":false}'::jsonb),
+('{"state":49, "line":797, "coauthors":"CC"}'::jsonb),
+('{"wait":"BBB", "title":"ABB", "org":74, "line":798, "disabled":false, "pos":34, "space":"BB"}'::jsonb),
+('{"line":799, "abstract":"CB"}'::jsonb),
+('{"state":84, "user":"ABB", "cleaned":false, "status":18, "line":800, "disabled":true, "date":"CCA", "node":"BA"}'::jsonb),
+('{"state":81, "auth":"CB", "world":"CA", "user":"CAA", "line":801, "date":"AC", "space":"CBC", "coauthors":"BCB"}'::jsonb),
+('{"org":4, "line":802, "disabled":false, "abstract":"ABA", "public":false}'::jsonb),
+('{"auth":"CBC", "state":99, "cleaned":true, "line":803, "disabled":true, "space":"BC", "node":"BBC"}'::jsonb),
+('{"auth":"AC", "wait":"CA", "cleaned":false, "line":804, "pos":54, "date":"BAA", "public":true, "space":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"BCB", "wait":"BCC", "subtitle":"AAA", "line":806}'::jsonb),
+('{"line":807, "disabled":false, "space":"ACA"}'::jsonb),
+('{"org":96, "query":"CBA", "line":808, "disabled":false, "pos":74, "space":"CA", "public":false}'::jsonb),
+('{}'::jsonb),
+('{"state":12, "title":"AA", "bad":false, "status":20, "line":810, "disabled":true, "coauthors":"CAC", "node":"AB"}'::jsonb),
+('{"auth":"ABC", "line":811, "date":"CA"}'::jsonb),
+('{"title":"AB", "indexed":false, "line":812, "disabled":false, "node":"AAC"}'::jsonb),
+('{}'::jsonb),
+('{"world":"CBA", "status":15, "line":814, "abstract":"CBA"}'::jsonb),
+('{"status":49, "line":815, "pos":49}'::jsonb),
+('{"subtitle":"CAB", "line":816}'::jsonb),
+('{}'::jsonb),
+('{}'::jsonb),
+('{"world":"CAC", "title":"CB", "wait":"AA", "query":"CA", "indexed":true, "line":819, "disabled":true}'::jsonb),
+('{"auth":"ABB", "wait":"AC", "query":"CC", "cleaned":true, "indexed":false, "line":820, "abstract":"AA", "public":false, "node":"AB"}'::jsonb),
+('{"org":5, "wait":"BA", "indexed":true, "line":821, "node":"AB"}'::jsonb),
+('{"title":"CC", "wait":"CC", "bad":false, "query":"BCC", "indexed":false, "line":822, "pos":27, "date":"CB", "node":"CBA"}'::jsonb),
+('{"query":"BC", "status":28, "line":823, "public":false}'::jsonb),
+('{"status":1, "line":824, "abstract":"BB"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"AA", "title":"BC", "query":"CA", "status":33, "line":826}'::jsonb),
+('{"state":9, "title":"BB", "subtitle":"ACC", "bad":true, "query":"BA", "status":41, "line":827, "abstract":"ACB", "public":false}'::jsonb),
+('{"auth":"AB", "subtitle":"CAB", "line":828, "public":false, "coauthors":"AB", "node":"BAC"}'::jsonb),
+('{"line":829, "disabled":false, "public":true, "node":"CBC"}'::jsonb),
+('{"auth":"BAB", "line":830}'::jsonb),
+('{"wait":"BBA", "bad":true, "indexed":false, "line":831, "space":"BB"}'::jsonb),
+('{"org":70, "wait":"BC", "world":"AC", "indexed":true, "status":96, "line":832, "disabled":true, "space":"AB"}'::jsonb),
+('{"state":8, "world":"BAB", "bad":true, "indexed":true, "status":18, "line":833, "date":"BA", "space":"BA"}'::jsonb),
+('{"query":"AB", "line":834}'::jsonb),
+('{"bad":true, "status":5, "line":835}'::jsonb),
+('{"world":"BAC", "subtitle":"BB", "bad":false, "user":"AB", "indexed":false, "cleaned":true, "line":836}'::jsonb),
+('{"line":837, "public":false}'::jsonb),
+('{"line":838, "pos":7}'::jsonb),
+('{"auth":"CA", "query":"ABB", "indexed":true, "line":839, "public":true}'::jsonb),
+('{"wait":"CC", "bad":false, "line":840, "date":"AAB", "public":false, "coauthors":"BCB"}'::jsonb),
+('{"auth":"AB", "state":97, "org":24, "line":841, "pos":41, "node":"BC"}'::jsonb),
+('{"wait":"BB", "world":"CBA", "user":"BAA", "status":18, "line":842, "date":"BAB", "public":true}'::jsonb),
+('{"title":"BA", "subtitle":"CA", "query":"CCB", "line":843, "space":"BB"}'::jsonb),
+('{"auth":"BB", "world":"ACA", "line":844, "pos":29}'::jsonb),
+('{"state":65, "org":40, "query":"CAA", "user":"AB", "indexed":false, "cleaned":false, "line":845}'::jsonb),
+('{"title":"CB", "cleaned":false, "indexed":false, "line":846}'::jsonb),
+('{"wait":"CAA", "indexed":false, "line":847, "disabled":false}'::jsonb),
+('{}'::jsonb),
+('{"title":"CB", "query":"CC", "line":849, "abstract":"CB", "pos":10, "public":true}'::jsonb),
+('{"auth":"CB", "subtitle":"BA", "cleaned":true, "line":850, "disabled":true, "pos":84}'::jsonb),
+('{"org":45, "wait":"BA", "query":"CCC", "line":851, "date":"BCA", "coauthors":"CAB"}'::jsonb),
+('{"state":84, "title":"CB", "line":852, "pos":71, "space":"CA"}'::jsonb),
+('{"line":853, "public":true, "node":"AA"}'::jsonb),
+('{"subtitle":"BC", "user":"AB", "cleaned":true, "line":854, "public":true}'::jsonb),
+('{"state":26, "wait":"BA", "world":"BBB", "user":"BB", "status":53, "line":855, "abstract":"ABA", "pos":72, "space":"AC"}'::jsonb),
+('{"line":856, "public":false, "coauthors":"CA"}'::jsonb),
+('{"wait":"ABB", "subtitle":"CBA", "line":857, "pos":44}'::jsonb),
+('{"auth":"ABA", "wait":"CC", "org":0, "bad":true, "query":"BB", "line":858, "disabled":false, "public":true}'::jsonb),
+('{"bad":false, "user":"AA", "line":859, "pos":90}'::jsonb),
+('{"world":"BCC", "title":"BAA", "bad":false, "user":"CAA", "query":"BBC", "line":860, "date":"CAA", "space":"BCB", "public":true, "coauthors":"CB"}'::jsonb),
+('{"title":"BAB", "world":"BC", "subtitle":"AA", "cleaned":false, "status":9, "line":861, "pos":95}'::jsonb),
+('{"title":"AC", "line":862}'::jsonb),
+('{"wait":"CB", "bad":false, "status":89, "line":863, "coauthors":"AB"}'::jsonb),
+('{"subtitle":"ACC", "indexed":true, "cleaned":true, "line":864}'::jsonb),
+('{"title":"AB", "subtitle":"CBB", "query":"ACA", "indexed":true, "line":865, "disabled":true}'::jsonb),
+('{"title":"BC", "world":"BB", "query":"AA", "user":"ACB", "status":43, "cleaned":false, "line":866, "coauthors":"CBC", "node":"ACB"}'::jsonb),
+('{}'::jsonb),
+('{"org":25, "wait":"AC", "indexed":false, "line":868, "disabled":false, "abstract":"CA", "pos":48}'::jsonb),
+('{"bad":true, "status":34, "line":869, "pos":32, "date":"AC", "public":true, "node":"AA"}'::jsonb),
+('{"state":33, "wait":"AAC", "indexed":true, "status":20, "line":870, "abstract":"BA"}'::jsonb),
+('{"wait":"CCC", "subtitle":"AC", "line":871, "disabled":false, "space":"BA", "public":true, "coauthors":"BCC"}'::jsonb),
+('{"status":49, "line":872}'::jsonb),
+('{"state":90, "title":"ACC", "world":"CBB", "subtitle":"BAB", "bad":false, "status":94, "line":873, "abstract":"CB"}'::jsonb),
+('{"title":"BCB", "line":874}'::jsonb),
+('{"cleaned":false, "line":875}'::jsonb),
+('{"wait":"BAA", "subtitle":"BBC", "line":876}'::jsonb),
+('{"auth":"AB", "org":35, "bad":false, "indexed":false, "line":877, "coauthors":"BBA"}'::jsonb),
+('{"line":878, "public":false}'::jsonb),
+('{}'::jsonb),
+('{"auth":"CB", "wait":"CBC", "indexed":false, "line":880, "public":true}'::jsonb),
+('{"query":"CC", "status":4, "line":881, "disabled":true, "node":"CA"}'::jsonb),
+('{"title":"BB", "line":882}'::jsonb),
+('{"state":53, "bad":false, "cleaned":false, "status":63, "line":883, "coauthors":"BAA"}'::jsonb),
+('{"auth":"ACA", "world":"AC", "user":"CBC", "line":884, "date":"BCA", "node":"BBC"}'::jsonb),
+('{"auth":"BAB", "state":11, "world":"CB", "org":77, "query":"BA", "cleaned":false, "line":885, "space":"AC"}'::jsonb),
+('{"world":"CA", "user":"CA", "line":886, "node":"CB"}'::jsonb),
+('{"state":32, "org":50, "wait":"AA", "line":887, "disabled":false, "space":"BBA", "public":false}'::jsonb),
+('{"cleaned":true, "line":888, "pos":70, "node":"ABC"}'::jsonb),
+('{"org":63, "user":"AAB", "query":"BB", "line":889, "date":"BC", "space":"CBB", "node":"ABC"}'::jsonb),
+('{"wait":"BB", "user":"BB", "query":"CB", "line":890, "space":"BB", "coauthors":"BA", "node":"ABC"}'::jsonb),
+('{"auth":"BC", "world":"CC", "subtitle":"CB", "line":891, "public":false, "coauthors":"BC"}'::jsonb),
+('{"state":13, "org":38, "line":892, "coauthors":"BC", "node":"ABC"}'::jsonb),
+('{"auth":"CC", "world":"CAC", "line":893, "date":"BBA", "node":"CBC"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"AA", "line":895, "coauthors":"BB"}'::jsonb),
+('{"auth":"AA", "state":76, "status":85, "line":896, "date":"CCC", "public":true, "coauthors":"AB"}'::jsonb),
+('{"auth":"AB", "indexed":true, "cleaned":false, "line":897}'::jsonb),
+('{"line":898, "coauthors":"CBB"}'::jsonb),
+('{}'::jsonb),
+('{"wait":"ACC", "line":900, "abstract":"BBA"}'::jsonb),
+('{"auth":"AA", "wait":"BCB", "cleaned":false, "line":901, "abstract":"AAC"}'::jsonb),
+('{"state":68, "title":"AC", "subtitle":"BB", "line":902}'::jsonb),
+('{"state":41, "wait":"ABA", "bad":false, "user":"BBA", "status":46, "line":903, "node":"AAB"}'::jsonb),
+('{}'::jsonb),
+('{"cleaned":false, "line":905, "pos":33}'::jsonb),
+('{"bad":false, "query":"BA", "line":906, "pos":48, "space":"CB", "public":true}'::jsonb),
+('{"query":"CB", "indexed":true, "line":907, "pos":41, "abstract":"CBB", "space":"BA", "public":false, "node":"BC"}'::jsonb),
+('{"title":"AB", "line":908}'::jsonb),
+('{"auth":"BC", "title":"CB", "line":909, "disabled":false, "space":"CA", "public":true, "coauthors":"BC"}'::jsonb),
+('{"world":"AA", "user":"ABA", "indexed":false, "line":910, "abstract":"CC"}'::jsonb),
+('{"auth":"CCA", "indexed":false, "line":911, "date":"AC", "public":false}'::jsonb),
+('{"world":"AAB", "bad":true, "line":912}'::jsonb),
+('{"subtitle":"CBB", "line":913, "public":true}'::jsonb),
+('{"wait":"CB", "line":914, "disabled":false, "pos":71, "date":"BA", "space":"CBA", "public":false, "coauthors":"BB"}'::jsonb),
+('{"org":67, "wait":"CA", "bad":false, "line":915, "disabled":false, "public":true}'::jsonb),
+('{}'::jsonb),
+('{"line":917, "date":"CB"}'::jsonb),
+('{"auth":"CBB", "world":"AAA", "status":83, "indexed":false, "line":918, "disabled":true, "date":"CBA", "coauthors":"ACC"}'::jsonb),
+('{"wait":"AB", "title":"BA", "status":33, "line":919, "disabled":false}'::jsonb),
+('{"wait":"ACB", "cleaned":false, "line":920, "abstract":"AA", "coauthors":"BCB"}'::jsonb),
+('{"wait":"ABB", "org":40, "world":"BC", "subtitle":"CA", "user":"AAC", "status":14, "indexed":true, "line":921, "pos":66}'::jsonb),
+('{"auth":"BA", "org":22, "wait":"BAB", "bad":true, "user":"ACC", "status":32, "line":922}'::jsonb),
+('{"world":"BA", "query":"CAB", "status":0, "line":923}'::jsonb),
+('{"org":84, "bad":true, "line":924, "coauthors":"BAB"}'::jsonb),
+('{"auth":"ACC", "subtitle":"AAA", "query":"CCA", "cleaned":false, "line":925, "pos":60, "space":"BC"}'::jsonb),
+('{"wait":"BC", "subtitle":"CCC", "bad":false, "cleaned":false, "indexed":false, "line":926, "public":false, "coauthors":"AC"}'::jsonb),
+('{"auth":"CA", "state":91, "org":6, "world":"AA", "wait":"ABB", "query":"AAC", "line":927, "date":"CA", "node":"BAC"}'::jsonb),
+('{"world":"BCA", "query":"AA", "user":"BBC", "line":928, "disabled":false}'::jsonb),
+('{"world":"CBC", "user":"CBC", "line":929, "date":"CAC"}'::jsonb),
+('{"world":"BCB", "bad":false, "user":"BB", "line":930}'::jsonb),
+('{"auth":"CA", "world":"AA", "query":"ABA", "user":"AA", "indexed":true, "line":931, "coauthors":"BBC"}'::jsonb),
+('{"auth":"BAA", "bad":true, "line":932, "disabled":false, "pos":93, "abstract":"CCA", "date":"BBA", "coauthors":"AA"}'::jsonb),
+('{"line":933, "space":"CAB", "node":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"status":60, "cleaned":true, "indexed":true, "line":935, "pos":35, "space":"CAB", "node":"BBB"}'::jsonb),
+('{"wait":"AAA", "bad":true, "status":26, "line":936, "abstract":"ACB", "space":"BBA", "coauthors":"CCC"}'::jsonb),
+('{"title":"BA", "bad":true, "line":937, "date":"BBA", "public":true}'::jsonb),
+('{}'::jsonb),
+('{"query":"BA", "user":"BA", "line":939, "disabled":true}'::jsonb),
+('{"line":940, "date":"CC"}'::jsonb),
+('{"wait":"CAB", "query":"BCA", "user":"BC", "line":941, "pos":8, "coauthors":"ACC"}'::jsonb),
+('{"line":942, "space":"BA"}'::jsonb),
+('{"auth":"CA", "org":11, "line":943, "pos":99}'::jsonb),
+('{"org":83, "line":944, "disabled":false, "date":"BBA", "space":"AC", "node":"AC"}'::jsonb),
+('{"world":"CCA", "line":945, "node":"BC"}'::jsonb),
+('{"org":95, "title":"CA", "world":"BA", "line":946, "pos":36, "coauthors":"CA"}'::jsonb),
+('{"state":93, "line":947}'::jsonb),
+('{"cleaned":false, "status":5, "line":948, "abstract":"BB", "public":false, "coauthors":"ABC"}'::jsonb),
+('{"world":"CA", "org":61, "bad":false, "query":"CC", "cleaned":true, "line":949, "pos":14, "space":"CC"}'::jsonb),
+('{"state":91, "line":950, "abstract":"BA", "date":"AB"}'::jsonb),
+('{"auth":"BBC", "line":951, "date":"BB"}'::jsonb),
+('{"auth":"BAB", "line":952, "disabled":true, "node":"AAA"}'::jsonb),
+('{"auth":"CAA", "subtitle":"ABA", "bad":true, "line":953}'::jsonb),
+('{"auth":"CA", "wait":"BB", "org":12, "user":"BCC", "cleaned":false, "line":954, "public":false, "coauthors":"AA"}'::jsonb),
+('{"org":93, "cleaned":true, "line":955, "disabled":true, "public":true, "node":"ACA"}'::jsonb),
+('{"line":956, "pos":10}'::jsonb),
+('{"org":74, "world":"CCC", "subtitle":"AB", "user":"AAA", "cleaned":true, "line":957, "pos":70, "public":true, "node":"CC"}'::jsonb),
+('{"state":51, "line":958}'::jsonb),
+('{"world":"CCA", "title":"BCB", "user":"AB", "indexed":true, "line":959, "disabled":true, "pos":21, "date":"CBC"}'::jsonb),
+('{"org":86, "wait":"BC", "query":"BB", "user":"AA", "indexed":true, "line":960, "pos":58, "date":"AB"}'::jsonb),
+('{"line":961, "node":"CC"}'::jsonb),
+('{"auth":"BCB", "world":"ACC", "subtitle":"CA", "bad":true, "user":"BA", "indexed":false, "line":962, "public":false}'::jsonb),
+('{}'::jsonb),
+('{"status":37, "line":964}'::jsonb),
+('{"state":70, "status":76, "indexed":false, "line":965, "disabled":true, "space":"BB"}'::jsonb),
+('{}'::jsonb),
+('{"state":67, "world":"CA", "title":"AA", "line":967, "abstract":"BA", "space":"BAA"}'::jsonb),
+('{"auth":"CA", "world":"AA", "bad":true, "query":"BC", "status":53, "indexed":false, "line":968, "date":"AB", "node":"BAA"}'::jsonb),
+('{"query":"AC", "cleaned":true, "line":969, "abstract":"BC", "space":"CAB", "coauthors":"BAA"}'::jsonb),
+('{"wait":"BCA", "world":"CB", "title":"BC", "indexed":false, "line":970, "disabled":true, "pos":70, "date":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"subtitle":"BC", "query":"AA", "line":972}'::jsonb),
+('{"line":973, "public":true}'::jsonb),
+('{"org":75, "world":"AAB", "subtitle":"BB", "user":"CC", "line":974, "space":"CA"}'::jsonb),
+('{"auth":"BCB", "cleaned":true, "line":975}'::jsonb),
+('{"title":"BAC", "user":"CB", "line":976, "public":false}'::jsonb),
+('{"subtitle":"BAC", "indexed":false, "cleaned":false, "line":977, "disabled":false, "abstract":"ABC", "space":"ABA"}'::jsonb),
+('{"state":63, "bad":false, "line":978, "pos":93, "node":"AAC"}'::jsonb),
+('{}'::jsonb),
+('{"cleaned":false, "line":980, "abstract":"CCB"}'::jsonb),
+('{"state":40, "title":"ABA", "subtitle":"CAB", "query":"BC", "line":981, "date":"CA", "coauthors":"AB"}'::jsonb),
+('{}'::jsonb),
+('{"auth":"ABA", "subtitle":"ACC", "user":"AA", "query":"AC", "cleaned":true, "line":983, "date":"ACB", "node":"CB"}'::jsonb),
+('{"state":32, "title":"ABC", "org":58, "status":95, "line":984, "disabled":true, "pos":6, "space":"CBB"}'::jsonb),
+('{"title":"BCC", "subtitle":"CCC", "user":"BBC", "line":985, "public":false, "coauthors":"CCB", "node":"AA"}'::jsonb),
+('{"subtitle":"ACA", "query":"BCC", "status":43, "cleaned":true, "indexed":true, "line":986, "abstract":"CAC"}'::jsonb),
+('{}'::jsonb),
+('{"world":"CAB", "org":21, "indexed":true, "line":988, "abstract":"ABC"}'::jsonb),
+('{"title":"CBC", "status":66, "line":989}'::jsonb),
+('{}'::jsonb),
+('{"array":[5]}'::jsonb),
+('{"array":["foo", "bar", "baz"]}'::jsonb),
+('{"array":["bar", "baz", "foo"]}'::jsonb),
+('{"array":["bar", "baz"]}'::jsonb),
+('{"array":["baz", "foo"]}'::jsonb),
+('{"line":991, "abstract":"BA", "node":"BBB"}'::jsonb),
+('{"line":992, "disabled":true, "pos":29, "public":false}'::jsonb),
+('{"state":53, "wait":"CB", "subtitle":"CCC", "line":993, "date":"CAC", "public":false, "coauthors":"BB"}'::jsonb),
+('{"wait":"CBA", "title":"CA", "subtitle":"BB", "user":"BAA", "line":994, "disabled":true, "date":"BB", "coauthors":"CCC", "node":"CC"}'::jsonb),
+('{"title":"BB", "user":"AA", "query":"CAA", "status":43, "line":995, "pos":6, "abstract":"CC", "public":true}'::jsonb),
+('{"wait":"AC", "query":"BA", "line":996, "coauthors":"BB", "node":"CCC"}'::jsonb),
+('{"auth":"BC", "title":"CAC", "subtitle":"BA", "line":997, "date":"BAA"}'::jsonb),
+('{"wait":"AB", "user":"ABC", "line":998, "pos":41, "node":"CAC"}'::jsonb),
+('{"state":4, "title":"AC", "bad":true, "status":59, "line":999, "disabled":true}'::jsonb),
+('{"user":"BC", "line":1000}'::jsonb),
+('{"wait":null, "line":1000}'::jsonb),
+('{"age":25}'::jsonb),
+('{"age":25.0}'::jsonb),
+('{"foo": {"bar": "baz"}}'::jsonb),
+('{"foo": {"blah": "baz"}}'::jsonb),
+('{"fool": {"bar": "baz"}}'::jsonb),
+('{}'::jsonb);
+
diff --git a/yql/essentials/tests/postgresql/initscripts/text_tbl.sql b/yql/essentials/tests/postgresql/initscripts/text_tbl.sql
new file mode 100644
index 0000000000..8ce36055d3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/text_tbl.sql
@@ -0,0 +1,9 @@
+CREATE TABLE TEXT_TBL (f1 text);
+
+INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+
+CREATE TABLE text_tbl (f1 text);
+INSERT INTO text_tbl
+SELECT * from TEXT_TBL;
+
diff --git a/yql/essentials/tests/postgresql/initscripts/time_tbl.sql b/yql/essentials/tests/postgresql/initscripts/time_tbl.sql
new file mode 100644
index 0000000000..1315dab3ae
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/time_tbl.sql
@@ -0,0 +1,14 @@
+CREATE TABLE TIME_TBL (f1 time(2));
+
+INSERT INTO TIME_TBL VALUES ('00:00');
+INSERT INTO TIME_TBL VALUES ('01:00');
+
+INSERT INTO TIME_TBL VALUES ('02:03'); --INSERT INTO TIME_TBL VALUES ('02:03 PST');
+INSERT INTO TIME_TBL VALUES ('11:59'); --INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+INSERT INTO TIME_TBL VALUES ('12:00');
+INSERT INTO TIME_TBL VALUES ('12:01');
+INSERT INTO TIME_TBL VALUES ('23:59');
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39'); -- INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39'); -- INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/timestamp_tbl.sql b/yql/essentials/tests/postgresql/initscripts/timestamp_tbl.sql
new file mode 100644
index 0000000000..3eacbc6d6d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/timestamp_tbl.sql
@@ -0,0 +1,142 @@
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+
+/*
+originals:
+
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 18:32:01 PDT');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+
+Restore 'em after timezone got supported in literals
+*/
+
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01.4');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01.5');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01.6');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 18:32:01');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/timestamptz_tbl.sql b/yql/essentials/tests/postgresql/initscripts/timestamptz_tbl.sql
new file mode 100644
index 0000000000..0b31853462
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/timestamptz_tbl.sql
@@ -0,0 +1,78 @@
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+
+-- TODO: this script isn't fully ok until YQL-17942 gets fixed
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+-- timestamps at different timezones
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 America/New_York');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 18:32:01 PDT');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/timetz_tbl.sql b/yql/essentials/tests/postgresql/initscripts/timetz_tbl.sql
new file mode 100644
index 0000000000..08b52e8a41
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/timetz_tbl.sql
@@ -0,0 +1,34 @@
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+
+/*
+originals:
+
+INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+
+Restore 'em after timezone got supported in literals
+*/
+
+INSERT INTO TIMETZ_TBL VALUES ('00:01-07');
+INSERT INTO TIMETZ_TBL VALUES ('01:00-07');
+INSERT INTO TIMETZ_TBL VALUES ('02:03-07');
+INSERT INTO TIMETZ_TBL VALUES ('07:07-08');
+INSERT INTO TIMETZ_TBL VALUES ('08:08-04');
+INSERT INTO TIMETZ_TBL VALUES ('11:59-07');
+INSERT INTO TIMETZ_TBL VALUES ('12:00-07');
+INSERT INTO TIMETZ_TBL VALUES ('12:01-07');
+INSERT INTO TIMETZ_TBL VALUES ('23:59-07');
+INSERT INTO TIMETZ_TBL VALUES ('23:59:59.99-07');
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39-05');
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39-04');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/tmp.sql b/yql/essentials/tests/postgresql/initscripts/tmp.sql
new file mode 100644
index 0000000000..5dd8c74c59
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/tmp.sql
@@ -0,0 +1,1009 @@
+CREATE TABLE tmp (
+ two int4,
+ stringu1 name,
+ ten int4,
+ string4 name
+);
+
+INSERT INTO tmp VALUES
+(1, 'AAAAAA', 7, 'AAAAxx'),
+(1, 'BAAAAA', 1, 'HHHHxx'),
+(0, 'CAAAAA', 4, 'OOOOxx'),
+(1, 'DAAAAA', 1, 'VVVVxx'),
+(1, 'EAAAAA', 3, 'AAAAxx'),
+(1, 'FAAAAA', 9, 'HHHHxx'),
+(0, 'GAAAAA', 0, 'OOOOxx'),
+(1, 'HAAAAA', 3, 'VVVVxx'),
+(1, 'IAAAAA', 5, 'AAAAxx'),
+(0, 'JAAAAA', 0, 'HHHHxx'),
+(1, 'KAAAAA', 9, 'OOOOxx'),
+(0, 'LAAAAA', 4, 'VVVVxx'),
+(0, 'MAAAAA', 0, 'AAAAxx'),
+(1, 'NAAAAA', 1, 'HHHHxx'),
+(0, 'OAAAAA', 6, 'OOOOxx'),
+(0, 'PAAAAA', 4, 'VVVVxx'),
+(0, 'QAAAAA', 8, 'AAAAxx'),
+(0, 'RAAAAA', 2, 'HHHHxx'),
+(0, 'SAAAAA', 4, 'OOOOxx'),
+(1, 'TAAAAA', 3, 'VVVVxx'),
+(1, 'UAAAAA', 5, 'AAAAxx'),
+(1, 'VAAAAA', 7, 'HHHHxx'),
+(0, 'WAAAAA', 6, 'OOOOxx'),
+(1, 'XAAAAA', 9, 'VVVVxx'),
+(0, 'YAAAAA', 6, 'AAAAxx'),
+(0, 'ZAAAAA', 6, 'HHHHxx'),
+(1, 'ABAAAA', 9, 'OOOOxx'),
+(1, 'BBAAAA', 5, 'VVVVxx'),
+(0, 'CBAAAA', 4, 'AAAAxx'),
+(0, 'DBAAAA', 0, 'HHHHxx'),
+(1, 'EBAAAA', 9, 'OOOOxx'),
+(0, 'FBAAAA', 8, 'VVVVxx'),
+(1, 'GBAAAA', 9, 'AAAAxx'),
+(1, 'HBAAAA', 3, 'HHHHxx'),
+(0, 'IBAAAA', 8, 'OOOOxx'),
+(0, 'JBAAAA', 8, 'VVVVxx'),
+(0, 'KBAAAA', 0, 'AAAAxx'),
+(1, 'LBAAAA', 9, 'HHHHxx'),
+(1, 'MBAAAA', 5, 'OOOOxx'),
+(0, 'NBAAAA', 6, 'VVVVxx'),
+(0, 'OBAAAA', 8, 'AAAAxx'),
+(0, 'PBAAAA', 4, 'HHHHxx'),
+(1, 'QBAAAA', 3, 'OOOOxx'),
+(0, 'RBAAAA', 0, 'VVVVxx'),
+(1, 'SBAAAA', 1, 'AAAAxx'),
+(0, 'TBAAAA', 4, 'HHHHxx'),
+(0, 'UBAAAA', 2, 'OOOOxx'),
+(1, 'VBAAAA', 9, 'VVVVxx'),
+(0, 'WBAAAA', 6, 'AAAAxx'),
+(1, 'XBAAAA', 9, 'HHHHxx'),
+(1, 'YBAAAA', 1, 'OOOOxx'),
+(0, 'ZBAAAA', 0, 'VVVVxx'),
+(0, 'ACAAAA', 8, 'AAAAxx'),
+(0, 'BCAAAA', 6, 'HHHHxx'),
+(0, 'CCAAAA', 6, 'OOOOxx'),
+(1, 'DCAAAA', 7, 'VVVVxx'),
+(1, 'ECAAAA', 3, 'AAAAxx'),
+(1, 'FCAAAA', 5, 'HHHHxx'),
+(0, 'GCAAAA', 4, 'OOOOxx'),
+(1, 'HCAAAA', 3, 'VVVVxx'),
+(0, 'ICAAAA', 6, 'AAAAxx'),
+(1, 'JCAAAA', 3, 'HHHHxx'),
+(1, 'KCAAAA', 3, 'OOOOxx'),
+(1, 'LCAAAA', 7, 'VVVVxx'),
+(1, 'MCAAAA', 5, 'AAAAxx'),
+(1, 'NCAAAA', 1, 'HHHHxx'),
+(0, 'OCAAAA', 6, 'OOOOxx'),
+(1, 'PCAAAA', 1, 'VVVVxx'),
+(1, 'QCAAAA', 5, 'AAAAxx'),
+(1, 'RCAAAA', 7, 'HHHHxx'),
+(0, 'SCAAAA', 0, 'OOOOxx'),
+(1, 'TCAAAA', 7, 'VVVVxx'),
+(0, 'UCAAAA', 8, 'AAAAxx'),
+(0, 'VCAAAA', 8, 'HHHHxx'),
+(0, 'WCAAAA', 2, 'OOOOxx'),
+(1, 'XCAAAA', 7, 'VVVVxx'),
+(1, 'YCAAAA', 1, 'AAAAxx'),
+(1, 'ZCAAAA', 1, 'HHHHxx'),
+(0, 'ADAAAA', 2, 'OOOOxx'),
+(1, 'BDAAAA', 1, 'VVVVxx'),
+(1, 'CDAAAA', 5, 'AAAAxx'),
+(1, 'DDAAAA', 9, 'HHHHxx'),
+(0, 'EDAAAA', 2, 'OOOOxx'),
+(1, 'FDAAAA', 1, 'VVVVxx'),
+(1, 'GDAAAA', 5, 'AAAAxx'),
+(1, 'HDAAAA', 5, 'HHHHxx'),
+(0, 'IDAAAA', 2, 'OOOOxx'),
+(0, 'JDAAAA', 2, 'VVVVxx'),
+(0, 'KDAAAA', 4, 'AAAAxx'),
+(0, 'LDAAAA', 4, 'HHHHxx'),
+(0, 'MDAAAA', 6, 'OOOOxx'),
+(0, 'NDAAAA', 4, 'VVVVxx'),
+(0, 'ODAAAA', 4, 'AAAAxx'),
+(0, 'PDAAAA', 8, 'HHHHxx'),
+(0, 'QDAAAA', 2, 'OOOOxx'),
+(0, 'RDAAAA', 0, 'VVVVxx'),
+(1, 'SDAAAA', 3, 'AAAAxx'),
+(0, 'TDAAAA', 6, 'HHHHxx'),
+(0, 'UDAAAA', 6, 'OOOOxx'),
+(0, 'VDAAAA', 6, 'VVVVxx'),
+(0, 'WDAAAA', 2, 'AAAAxx'),
+(1, 'XDAAAA', 9, 'HHHHxx'),
+(0, 'YDAAAA', 6, 'OOOOxx'),
+(1, 'ZDAAAA', 3, 'VVVVxx'),
+(1, 'AEAAAA', 1, 'AAAAxx'),
+(1, 'BEAAAA', 9, 'HHHHxx'),
+(1, 'CEAAAA', 9, 'OOOOxx'),
+(0, 'DEAAAA', 6, 'VVVVxx'),
+(0, 'EEAAAA', 2, 'AAAAxx'),
+(1, 'FEAAAA', 5, 'HHHHxx'),
+(0, 'GEAAAA', 2, 'OOOOxx'),
+(1, 'HEAAAA', 1, 'VVVVxx'),
+(0, 'IEAAAA', 8, 'AAAAxx'),
+(1, 'JEAAAA', 7, 'HHHHxx'),
+(0, 'KEAAAA', 8, 'OOOOxx'),
+(0, 'LEAAAA', 6, 'VVVVxx'),
+(1, 'MEAAAA', 9, 'AAAAxx'),
+(1, 'NEAAAA', 1, 'HHHHxx'),
+(1, 'OEAAAA', 5, 'OOOOxx'),
+(0, 'PEAAAA', 8, 'VVVVxx'),
+(0, 'QEAAAA', 6, 'AAAAxx'),
+(0, 'REAAAA', 4, 'HHHHxx'),
+(1, 'SEAAAA', 7, 'OOOOxx'),
+(0, 'TEAAAA', 6, 'VVVVxx'),
+(1, 'UEAAAA', 7, 'AAAAxx'),
+(0, 'VEAAAA', 4, 'HHHHxx'),
+(1, 'WEAAAA', 7, 'OOOOxx'),
+(0, 'XEAAAA', 2, 'VVVVxx'),
+(1, 'YEAAAA', 9, 'AAAAxx'),
+(0, 'ZEAAAA', 2, 'HHHHxx'),
+(1, 'AFAAAA', 5, 'OOOOxx'),
+(1, 'BFAAAA', 9, 'VVVVxx'),
+(1, 'CFAAAA', 7, 'AAAAxx'),
+(1, 'DFAAAA', 5, 'HHHHxx'),
+(0, 'EFAAAA', 4, 'OOOOxx'),
+(1, 'FFAAAA', 5, 'VVVVxx'),
+(0, 'GFAAAA', 4, 'AAAAxx'),
+(1, 'HFAAAA', 9, 'HHHHxx'),
+(0, 'IFAAAA', 8, 'OOOOxx'),
+(1, 'JFAAAA', 1, 'VVVVxx'),
+(1, 'KFAAAA', 1, 'AAAAxx'),
+(0, 'LFAAAA', 4, 'HHHHxx'),
+(1, 'MFAAAA', 3, 'OOOOxx'),
+(0, 'NFAAAA', 4, 'VVVVxx'),
+(1, 'OFAAAA', 5, 'AAAAxx'),
+(0, 'PFAAAA', 8, 'HHHHxx'),
+(1, 'QFAAAA', 3, 'OOOOxx'),
+(0, 'RFAAAA', 4, 'VVVVxx'),
+(1, 'SFAAAA', 3, 'AAAAxx'),
+(1, 'TFAAAA', 5, 'HHHHxx'),
+(1, 'UFAAAA', 3, 'OOOOxx'),
+(1, 'VFAAAA', 7, 'VVVVxx'),
+(1, 'WFAAAA', 9, 'AAAAxx'),
+(1, 'XFAAAA', 5, 'HHHHxx'),
+(1, 'YFAAAA', 5, 'OOOOxx'),
+(0, 'ZFAAAA', 2, 'VVVVxx'),
+(1, 'AGAAAA', 7, 'AAAAxx'),
+(0, 'BGAAAA', 4, 'HHHHxx'),
+(1, 'CGAAAA', 5, 'OOOOxx'),
+(1, 'DGAAAA', 5, 'VVVVxx'),
+(0, 'EGAAAA', 4, 'AAAAxx'),
+(0, 'FGAAAA', 8, 'HHHHxx'),
+(1, 'GGAAAA', 1, 'OOOOxx'),
+(0, 'HGAAAA', 2, 'VVVVxx'),
+(0, 'IGAAAA', 4, 'AAAAxx'),
+(1, 'JGAAAA', 9, 'HHHHxx'),
+(0, 'KGAAAA', 2, 'OOOOxx'),
+(1, 'LGAAAA', 5, 'VVVVxx'),
+(1, 'MGAAAA', 3, 'AAAAxx'),
+(1, 'NGAAAA', 7, 'HHHHxx'),
+(1, 'OGAAAA', 5, 'OOOOxx'),
+(1, 'PGAAAA', 5, 'VVVVxx'),
+(0, 'QGAAAA', 6, 'AAAAxx'),
+(1, 'RGAAAA', 1, 'HHHHxx'),
+(1, 'SGAAAA', 7, 'OOOOxx'),
+(0, 'TGAAAA', 8, 'VVVVxx'),
+(1, 'UGAAAA', 7, 'AAAAxx'),
+(1, 'VGAAAA', 5, 'HHHHxx'),
+(0, 'WGAAAA', 8, 'OOOOxx'),
+(0, 'XGAAAA', 4, 'VVVVxx'),
+(0, 'YGAAAA', 6, 'AAAAxx'),
+(1, 'ZGAAAA', 1, 'HHHHxx'),
+(0, 'AHAAAA', 2, 'OOOOxx'),
+(1, 'BHAAAA', 3, 'VVVVxx'),
+(0, 'CHAAAA', 8, 'AAAAxx'),
+(0, 'DHAAAA', 4, 'HHHHxx'),
+(0, 'EHAAAA', 6, 'OOOOxx'),
+(1, 'FHAAAA', 7, 'VVVVxx'),
+(0, 'GHAAAA', 2, 'AAAAxx'),
+(0, 'HHAAAA', 4, 'HHHHxx'),
+(1, 'IHAAAA', 7, 'OOOOxx'),
+(0, 'JHAAAA', 4, 'VVVVxx'),
+(0, 'KHAAAA', 0, 'AAAAxx'),
+(1, 'LHAAAA', 9, 'HHHHxx'),
+(1, 'MHAAAA', 3, 'OOOOxx'),
+(0, 'NHAAAA', 8, 'VVVVxx'),
+(1, 'OHAAAA', 3, 'AAAAxx'),
+(1, 'PHAAAA', 9, 'HHHHxx'),
+(0, 'QHAAAA', 8, 'OOOOxx'),
+(0, 'RHAAAA', 6, 'VVVVxx'),
+(1, 'SHAAAA', 7, 'AAAAxx'),
+(1, 'THAAAA', 5, 'HHHHxx'),
+(0, 'UHAAAA', 2, 'OOOOxx'),
+(0, 'VHAAAA', 2, 'VVVVxx'),
+(0, 'WHAAAA', 8, 'AAAAxx'),
+(0, 'XHAAAA', 4, 'HHHHxx'),
+(1, 'YHAAAA', 5, 'OOOOxx'),
+(1, 'ZHAAAA', 5, 'VVVVxx'),
+(1, 'AIAAAA', 5, 'AAAAxx'),
+(1, 'BIAAAA', 5, 'HHHHxx'),
+(0, 'CIAAAA', 0, 'OOOOxx'),
+(1, 'DIAAAA', 9, 'VVVVxx'),
+(1, 'EIAAAA', 9, 'AAAAxx'),
+(0, 'FIAAAA', 0, 'HHHHxx'),
+(1, 'GIAAAA', 1, 'OOOOxx'),
+(1, 'HIAAAA', 7, 'VVVVxx'),
+(1, 'IIAAAA', 5, 'AAAAxx'),
+(0, 'JIAAAA', 4, 'HHHHxx'),
+(0, 'KIAAAA', 0, 'OOOOxx'),
+(0, 'LIAAAA', 4, 'VVVVxx'),
+(0, 'MIAAAA', 8, 'AAAAxx'),
+(1, 'NIAAAA', 9, 'HHHHxx'),
+(0, 'OIAAAA', 2, 'OOOOxx'),
+(0, 'PIAAAA', 8, 'VVVVxx'),
+(1, 'QIAAAA', 1, 'AAAAxx'),
+(0, 'RIAAAA', 2, 'HHHHxx'),
+(1, 'SIAAAA', 9, 'OOOOxx'),
+(1, 'TIAAAA', 9, 'VVVVxx'),
+(0, 'UIAAAA', 2, 'AAAAxx'),
+(0, 'VIAAAA', 4, 'HHHHxx'),
+(1, 'WIAAAA', 3, 'OOOOxx'),
+(0, 'XIAAAA', 0, 'VVVVxx'),
+(1, 'YIAAAA', 7, 'AAAAxx'),
+(0, 'ZIAAAA', 6, 'HHHHxx'),
+(0, 'AJAAAA', 0, 'OOOOxx'),
+(1, 'BJAAAA', 7, 'VVVVxx'),
+(0, 'CJAAAA', 2, 'AAAAxx'),
+(0, 'DJAAAA', 6, 'HHHHxx'),
+(0, 'EJAAAA', 4, 'OOOOxx'),
+(1, 'FJAAAA', 9, 'VVVVxx'),
+(0, 'GJAAAA', 4, 'AAAAxx'),
+(1, 'HJAAAA', 3, 'HHHHxx'),
+(1, 'IJAAAA', 9, 'OOOOxx'),
+(1, 'JJAAAA', 1, 'VVVVxx'),
+(1, 'KJAAAA', 9, 'AAAAxx'),
+(0, 'LJAAAA', 2, 'HHHHxx'),
+(1, 'MJAAAA', 9, 'OOOOxx'),
+(1, 'NJAAAA', 7, 'VVVVxx'),
+(1, 'OJAAAA', 9, 'AAAAxx'),
+(0, 'PJAAAA', 8, 'HHHHxx'),
+(0, 'QJAAAA', 8, 'OOOOxx'),
+(1, 'RJAAAA', 7, 'VVVVxx'),
+(1, 'SJAAAA', 1, 'AAAAxx'),
+(0, 'TJAAAA', 0, 'HHHHxx'),
+(0, 'UJAAAA', 2, 'OOOOxx'),
+(0, 'VJAAAA', 4, 'VVVVxx'),
+(0, 'WJAAAA', 8, 'AAAAxx'),
+(0, 'XJAAAA', 0, 'HHHHxx'),
+(0, 'YJAAAA', 6, 'OOOOxx'),
+(1, 'ZJAAAA', 7, 'VVVVxx'),
+(1, 'AKAAAA', 1, 'AAAAxx'),
+(1, 'BKAAAA', 3, 'HHHHxx'),
+(0, 'CKAAAA', 0, 'OOOOxx'),
+(0, 'DKAAAA', 6, 'VVVVxx'),
+(0, 'EKAAAA', 0, 'AAAAxx'),
+(1, 'FKAAAA', 3, 'HHHHxx'),
+(1, 'GKAAAA', 9, 'OOOOxx'),
+(0, 'HKAAAA', 4, 'VVVVxx'),
+(1, 'IKAAAA', 1, 'AAAAxx'),
+(1, 'JKAAAA', 7, 'HHHHxx'),
+(1, 'KKAAAA', 3, 'OOOOxx'),
+(1, 'LKAAAA', 3, 'VVVVxx'),
+(0, 'MKAAAA', 6, 'AAAAxx'),
+(1, 'NKAAAA', 7, 'HHHHxx'),
+(0, 'OKAAAA', 2, 'OOOOxx'),
+(1, 'PKAAAA', 9, 'VVVVxx'),
+(1, 'QKAAAA', 7, 'AAAAxx'),
+(0, 'RKAAAA', 4, 'HHHHxx'),
+(0, 'SKAAAA', 8, 'OOOOxx'),
+(0, 'TKAAAA', 8, 'VVVVxx'),
+(0, 'UKAAAA', 6, 'AAAAxx'),
+(1, 'VKAAAA', 1, 'HHHHxx'),
+(1, 'WKAAAA', 3, 'OOOOxx'),
+(0, 'XKAAAA', 4, 'VVVVxx'),
+(0, 'YKAAAA', 4, 'AAAAxx'),
+(0, 'ZKAAAA', 2, 'HHHHxx'),
+(0, 'ALAAAA', 6, 'OOOOxx'),
+(0, 'BLAAAA', 2, 'VVVVxx'),
+(0, 'CLAAAA', 6, 'AAAAxx'),
+(0, 'DLAAAA', 8, 'HHHHxx'),
+(0, 'ELAAAA', 8, 'OOOOxx'),
+(0, 'FLAAAA', 6, 'VVVVxx'),
+(1, 'GLAAAA', 5, 'AAAAxx'),
+(1, 'HLAAAA', 3, 'HHHHxx'),
+(1, 'ILAAAA', 3, 'OOOOxx'),
+(0, 'JLAAAA', 6, 'VVVVxx'),
+(1, 'KLAAAA', 3, 'AAAAxx'),
+(0, 'LLAAAA', 2, 'HHHHxx'),
+(0, 'MLAAAA', 0, 'OOOOxx'),
+(0, 'NLAAAA', 6, 'VVVVxx'),
+(0, 'OLAAAA', 4, 'AAAAxx'),
+(0, 'PLAAAA', 2, 'HHHHxx'),
+(1, 'QLAAAA', 1, 'OOOOxx'),
+(0, 'RLAAAA', 6, 'VVVVxx'),
+(1, 'SLAAAA', 5, 'AAAAxx'),
+(1, 'TLAAAA', 9, 'HHHHxx'),
+(0, 'ULAAAA', 0, 'OOOOxx'),
+(1, 'VLAAAA', 3, 'VVVVxx'),
+(0, 'WLAAAA', 0, 'AAAAxx'),
+(0, 'XLAAAA', 0, 'HHHHxx'),
+(0, 'YLAAAA', 8, 'OOOOxx'),
+(1, 'ZLAAAA', 5, 'VVVVxx'),
+(1, 'AMAAAA', 1, 'AAAAxx'),
+(0, 'BMAAAA', 8, 'HHHHxx'),
+(1, 'CMAAAA', 3, 'OOOOxx'),
+(0, 'DMAAAA', 4, 'VVVVxx'),
+(1, 'EMAAAA', 3, 'AAAAxx'),
+(0, 'FMAAAA', 6, 'HHHHxx'),
+(1, 'GMAAAA', 9, 'OOOOxx'),
+(0, 'HMAAAA', 4, 'VVVVxx'),
+(0, 'IMAAAA', 8, 'AAAAxx'),
+(1, 'JMAAAA', 3, 'HHHHxx'),
+(0, 'KMAAAA', 0, 'OOOOxx'),
+(0, 'LMAAAA', 0, 'VVVVxx'),
+(0, 'MMAAAA', 4, 'AAAAxx'),
+(0, 'NMAAAA', 6, 'HHHHxx'),
+(0, 'OMAAAA', 2, 'OOOOxx'),
+(0, 'PMAAAA', 6, 'VVVVxx'),
+(1, 'QMAAAA', 3, 'AAAAxx'),
+(1, 'RMAAAA', 7, 'HHHHxx'),
+(0, 'SMAAAA', 6, 'OOOOxx'),
+(1, 'TMAAAA', 7, 'VVVVxx'),
+(1, 'UMAAAA', 3, 'AAAAxx'),
+(0, 'VMAAAA', 0, 'HHHHxx'),
+(0, 'WMAAAA', 2, 'OOOOxx'),
+(0, 'XMAAAA', 8, 'VVVVxx'),
+(0, 'YMAAAA', 4, 'AAAAxx'),
+(0, 'ZMAAAA', 0, 'HHHHxx'),
+(1, 'ANAAAA', 5, 'OOOOxx'),
+(0, 'BNAAAA', 4, 'VVVVxx'),
+(0, 'CNAAAA', 6, 'AAAAxx'),
+(0, 'DNAAAA', 0, 'HHHHxx'),
+(0, 'ENAAAA', 6, 'OOOOxx'),
+(0, 'FNAAAA', 6, 'VVVVxx'),
+(0, 'GNAAAA', 0, 'AAAAxx'),
+(0, 'HNAAAA', 6, 'HHHHxx'),
+(1, 'INAAAA', 1, 'OOOOxx'),
+(1, 'JNAAAA', 9, 'VVVVxx'),
+(1, 'KNAAAA', 5, 'AAAAxx'),
+(0, 'LNAAAA', 2, 'HHHHxx'),
+(0, 'MNAAAA', 0, 'OOOOxx'),
+(0, 'NNAAAA', 2, 'VVVVxx'),
+(0, 'ONAAAA', 0, 'AAAAxx'),
+(1, 'PNAAAA', 9, 'HHHHxx'),
+(0, 'QNAAAA', 8, 'OOOOxx'),
+(0, 'RNAAAA', 4, 'VVVVxx'),
+(0, 'SNAAAA', 4, 'AAAAxx'),
+(1, 'TNAAAA', 9, 'HHHHxx'),
+(1, 'UNAAAA', 7, 'OOOOxx'),
+(1, 'VNAAAA', 9, 'VVVVxx'),
+(0, 'WNAAAA', 2, 'AAAAxx'),
+(1, 'XNAAAA', 7, 'HHHHxx'),
+(1, 'YNAAAA', 7, 'OOOOxx'),
+(0, 'ZNAAAA', 2, 'VVVVxx'),
+(0, 'AOAAAA', 0, 'AAAAxx'),
+(0, 'BOAAAA', 8, 'HHHHxx'),
+(0, 'COAAAA', 2, 'OOOOxx'),
+(1, 'DOAAAA', 7, 'VVVVxx'),
+(1, 'EOAAAA', 5, 'AAAAxx'),
+(0, 'FOAAAA', 0, 'HHHHxx'),
+(0, 'GOAAAA', 2, 'OOOOxx'),
+(0, 'HOAAAA', 2, 'VVVVxx'),
+(0, 'IOAAAA', 6, 'AAAAxx'),
+(0, 'JOAAAA', 6, 'HHHHxx'),
+(0, 'KOAAAA', 0, 'OOOOxx'),
+(1, 'LOAAAA', 1, 'VVVVxx'),
+(1, 'MOAAAA', 1, 'AAAAxx'),
+(1, 'NOAAAA', 9, 'HHHHxx'),
+(1, 'OOAAAA', 7, 'OOOOxx'),
+(1, 'POAAAA', 3, 'VVVVxx'),
+(0, 'QOAAAA', 6, 'AAAAxx'),
+(0, 'ROAAAA', 0, 'HHHHxx'),
+(0, 'SOAAAA', 0, 'OOOOxx'),
+(1, 'TOAAAA', 5, 'VVVVxx'),
+(0, 'UOAAAA', 2, 'AAAAxx'),
+(0, 'VOAAAA', 8, 'HHHHxx'),
+(1, 'WOAAAA', 5, 'OOOOxx'),
+(1, 'XOAAAA', 1, 'VVVVxx'),
+(0, 'YOAAAA', 2, 'AAAAxx'),
+(1, 'ZOAAAA', 3, 'HHHHxx'),
+(1, 'APAAAA', 3, 'OOOOxx'),
+(1, 'BPAAAA', 5, 'VVVVxx'),
+(1, 'CPAAAA', 7, 'AAAAxx'),
+(1, 'DPAAAA', 5, 'HHHHxx'),
+(0, 'EPAAAA', 2, 'OOOOxx'),
+(1, 'FPAAAA', 7, 'VVVVxx'),
+(1, 'GPAAAA', 9, 'AAAAxx'),
+(0, 'HPAAAA', 4, 'HHHHxx'),
+(0, 'IPAAAA', 4, 'OOOOxx'),
+(1, 'JPAAAA', 5, 'VVVVxx'),
+(0, 'KPAAAA', 8, 'AAAAxx'),
+(1, 'LPAAAA', 7, 'HHHHxx'),
+(0, 'MPAAAA', 0, 'OOOOxx'),
+(0, 'NPAAAA', 4, 'VVVVxx'),
+(1, 'OPAAAA', 5, 'AAAAxx'),
+(0, 'PPAAAA', 6, 'HHHHxx'),
+(1, 'QPAAAA', 9, 'OOOOxx'),
+(1, 'RPAAAA', 5, 'VVVVxx'),
+(1, 'SPAAAA', 9, 'AAAAxx'),
+(1, 'TPAAAA', 1, 'HHHHxx'),
+(1, 'UPAAAA', 9, 'OOOOxx'),
+(1, 'VPAAAA', 7, 'VVVVxx'),
+(0, 'WPAAAA', 8, 'AAAAxx'),
+(1, 'XPAAAA', 7, 'HHHHxx'),
+(0, 'YPAAAA', 0, 'OOOOxx'),
+(0, 'ZPAAAA', 8, 'VVVVxx'),
+(0, 'AQAAAA', 4, 'AAAAxx'),
+(1, 'BQAAAA', 5, 'HHHHxx'),
+(1, 'CQAAAA', 1, 'OOOOxx'),
+(1, 'DQAAAA', 5, 'VVVVxx'),
+(0, 'EQAAAA', 6, 'AAAAxx'),
+(0, 'FQAAAA', 8, 'HHHHxx'),
+(1, 'GQAAAA', 9, 'OOOOxx'),
+(0, 'HQAAAA', 2, 'VVVVxx'),
+(0, 'IQAAAA', 2, 'AAAAxx'),
+(1, 'JQAAAA', 1, 'HHHHxx'),
+(1, 'KQAAAA', 1, 'OOOOxx'),
+(1, 'LQAAAA', 1, 'VVVVxx'),
+(0, 'MQAAAA', 0, 'AAAAxx'),
+(1, 'NQAAAA', 9, 'HHHHxx'),
+(1, 'OQAAAA', 1, 'OOOOxx'),
+(1, 'PQAAAA', 3, 'VVVVxx'),
+(0, 'QQAAAA', 6, 'AAAAxx'),
+(1, 'RQAAAA', 1, 'HHHHxx'),
+(0, 'SQAAAA', 0, 'OOOOxx'),
+(1, 'TQAAAA', 1, 'VVVVxx'),
+(1, 'UQAAAA', 9, 'AAAAxx'),
+(0, 'VQAAAA', 8, 'HHHHxx'),
+(0, 'WQAAAA', 0, 'OOOOxx'),
+(1, 'XQAAAA', 5, 'VVVVxx'),
+(1, 'YQAAAA', 7, 'AAAAxx'),
+(0, 'ZQAAAA', 4, 'HHHHxx'),
+(0, 'ARAAAA', 6, 'OOOOxx'),
+(0, 'BRAAAA', 0, 'VVVVxx'),
+(0, 'CRAAAA', 0, 'AAAAxx'),
+(0, 'DRAAAA', 6, 'HHHHxx'),
+(1, 'ERAAAA', 9, 'OOOOxx'),
+(1, 'FRAAAA', 7, 'VVVVxx'),
+(0, 'GRAAAA', 2, 'AAAAxx'),
+(0, 'HRAAAA', 6, 'HHHHxx'),
+(1, 'IRAAAA', 3, 'OOOOxx'),
+(0, 'JRAAAA', 2, 'VVVVxx'),
+(1, 'KRAAAA', 5, 'AAAAxx'),
+(0, 'LRAAAA', 6, 'HHHHxx'),
+(0, 'MRAAAA', 4, 'OOOOxx'),
+(0, 'NRAAAA', 0, 'VVVVxx'),
+(0, 'ORAAAA', 0, 'AAAAxx'),
+(0, 'PRAAAA', 0, 'HHHHxx'),
+(1, 'QRAAAA', 7, 'OOOOxx'),
+(1, 'RRAAAA', 9, 'VVVVxx'),
+(0, 'SRAAAA', 4, 'AAAAxx'),
+(1, 'TRAAAA', 9, 'HHHHxx'),
+(1, 'URAAAA', 5, 'OOOOxx'),
+(1, 'VRAAAA', 9, 'VVVVxx'),
+(0, 'WRAAAA', 6, 'AAAAxx'),
+(0, 'XRAAAA', 0, 'HHHHxx'),
+(1, 'YRAAAA', 7, 'OOOOxx'),
+(1, 'ZRAAAA', 7, 'VVVVxx'),
+(0, 'ASAAAA', 6, 'AAAAxx'),
+(0, 'BSAAAA', 4, 'HHHHxx'),
+(1, 'CSAAAA', 1, 'OOOOxx'),
+(1, 'DSAAAA', 5, 'VVVVxx'),
+(1, 'ESAAAA', 9, 'AAAAxx'),
+(1, 'FSAAAA', 7, 'HHHHxx'),
+(1, 'GSAAAA', 1, 'OOOOxx'),
+(0, 'HSAAAA', 4, 'VVVVxx'),
+(0, 'ISAAAA', 6, 'AAAAxx'),
+(1, 'JSAAAA', 3, 'HHHHxx'),
+(0, 'KSAAAA', 8, 'OOOOxx'),
+(0, 'LSAAAA', 4, 'VVVVxx'),
+(1, 'MSAAAA', 1, 'AAAAxx'),
+(0, 'NSAAAA', 8, 'HHHHxx'),
+(1, 'OSAAAA', 9, 'OOOOxx'),
+(0, 'PSAAAA', 0, 'VVVVxx'),
+(0, 'QSAAAA', 4, 'AAAAxx'),
+(1, 'RSAAAA', 5, 'HHHHxx'),
+(1, 'SSAAAA', 7, 'OOOOxx'),
+(1, 'TSAAAA', 7, 'VVVVxx'),
+(0, 'USAAAA', 4, 'AAAAxx'),
+(0, 'VSAAAA', 6, 'HHHHxx'),
+(1, 'WSAAAA', 5, 'OOOOxx'),
+(0, 'XSAAAA', 0, 'VVVVxx'),
+(1, 'YSAAAA', 5, 'AAAAxx'),
+(0, 'ZSAAAA', 0, 'HHHHxx'),
+(0, 'ATAAAA', 8, 'OOOOxx'),
+(0, 'BTAAAA', 8, 'VVVVxx'),
+(1, 'CTAAAA', 3, 'AAAAxx'),
+(1, 'DTAAAA', 3, 'HHHHxx'),
+(1, 'ETAAAA', 9, 'OOOOxx'),
+(0, 'FTAAAA', 0, 'VVVVxx'),
+(0, 'GTAAAA', 6, 'AAAAxx'),
+(1, 'HTAAAA', 3, 'HHHHxx'),
+(0, 'ITAAAA', 6, 'OOOOxx'),
+(0, 'JTAAAA', 4, 'VVVVxx'),
+(0, 'KTAAAA', 8, 'AAAAxx'),
+(1, 'LTAAAA', 7, 'HHHHxx'),
+(0, 'MTAAAA', 4, 'OOOOxx'),
+(0, 'NTAAAA', 2, 'VVVVxx'),
+(1, 'OTAAAA', 7, 'AAAAxx'),
+(0, 'PTAAAA', 8, 'HHHHxx'),
+(1, 'QTAAAA', 3, 'OOOOxx'),
+(1, 'RTAAAA', 7, 'VVVVxx'),
+(0, 'STAAAA', 6, 'AAAAxx'),
+(1, 'TTAAAA', 1, 'HHHHxx'),
+(1, 'UTAAAA', 3, 'OOOOxx'),
+(1, 'VTAAAA', 9, 'VVVVxx'),
+(1, 'WTAAAA', 5, 'AAAAxx'),
+(1, 'XTAAAA', 3, 'HHHHxx'),
+(0, 'YTAAAA', 4, 'OOOOxx'),
+(0, 'ZTAAAA', 2, 'VVVVxx'),
+(0, 'AUAAAA', 0, 'AAAAxx'),
+(1, 'BUAAAA', 1, 'HHHHxx'),
+(0, 'CUAAAA', 8, 'OOOOxx'),
+(1, 'DUAAAA', 1, 'VVVVxx'),
+(1, 'EUAAAA', 1, 'AAAAxx'),
+(0, 'FUAAAA', 8, 'HHHHxx'),
+(0, 'GUAAAA', 2, 'OOOOxx'),
+(1, 'HUAAAA', 3, 'VVVVxx'),
+(1, 'IUAAAA', 7, 'AAAAxx'),
+(0, 'JUAAAA', 8, 'HHHHxx'),
+(1, 'KUAAAA', 9, 'OOOOxx'),
+(0, 'LUAAAA', 8, 'VVVVxx'),
+(0, 'MUAAAA', 4, 'AAAAxx'),
+(1, 'NUAAAA', 9, 'HHHHxx'),
+(1, 'OUAAAA', 9, 'OOOOxx'),
+(1, 'PUAAAA', 7, 'VVVVxx'),
+(0, 'QUAAAA', 8, 'AAAAxx'),
+(0, 'RUAAAA', 2, 'HHHHxx'),
+(1, 'SUAAAA', 1, 'OOOOxx'),
+(1, 'TUAAAA', 9, 'VVVVxx'),
+(1, 'UUAAAA', 3, 'AAAAxx'),
+(1, 'VUAAAA', 5, 'HHHHxx'),
+(0, 'WUAAAA', 4, 'OOOOxx'),
+(1, 'XUAAAA', 7, 'VVVVxx'),
+(0, 'YUAAAA', 6, 'AAAAxx'),
+(1, 'ZUAAAA', 3, 'HHHHxx'),
+(1, 'AVAAAA', 5, 'OOOOxx'),
+(0, 'BVAAAA', 8, 'VVVVxx'),
+(1, 'CVAAAA', 1, 'AAAAxx'),
+(0, 'DVAAAA', 8, 'HHHHxx'),
+(0, 'EVAAAA', 6, 'OOOOxx'),
+(1, 'FVAAAA', 7, 'VVVVxx'),
+(1, 'GVAAAA', 9, 'AAAAxx'),
+(1, 'HVAAAA', 1, 'HHHHxx'),
+(1, 'IVAAAA', 1, 'OOOOxx'),
+(0, 'JVAAAA', 0, 'VVVVxx'),
+(0, 'KVAAAA', 4, 'AAAAxx'),
+(0, 'LVAAAA', 2, 'HHHHxx'),
+(1, 'MVAAAA', 3, 'OOOOxx'),
+(0, 'NVAAAA', 4, 'VVVVxx'),
+(1, 'OVAAAA', 1, 'AAAAxx'),
+(0, 'PVAAAA', 4, 'HHHHxx'),
+(0, 'QVAAAA', 4, 'OOOOxx'),
+(0, 'RVAAAA', 0, 'VVVVxx'),
+(0, 'SVAAAA', 2, 'AAAAxx'),
+(0, 'TVAAAA', 6, 'HHHHxx'),
+(1, 'UVAAAA', 1, 'OOOOxx'),
+(0, 'VVAAAA', 6, 'VVVVxx'),
+(0, 'WVAAAA', 2, 'AAAAxx'),
+(0, 'XVAAAA', 0, 'HHHHxx'),
+(1, 'YVAAAA', 7, 'OOOOxx'),
+(0, 'ZVAAAA', 0, 'VVVVxx'),
+(1, 'AWAAAA', 9, 'AAAAxx'),
+(1, 'BWAAAA', 9, 'HHHHxx'),
+(1, 'CWAAAA', 5, 'OOOOxx'),
+(0, 'DWAAAA', 0, 'VVVVxx'),
+(0, 'EWAAAA', 6, 'AAAAxx'),
+(0, 'FWAAAA', 6, 'HHHHxx'),
+(1, 'GWAAAA', 5, 'OOOOxx'),
+(0, 'HWAAAA', 6, 'VVVVxx'),
+(0, 'IWAAAA', 2, 'AAAAxx'),
+(0, 'JWAAAA', 8, 'HHHHxx'),
+(1, 'KWAAAA', 5, 'OOOOxx'),
+(0, 'LWAAAA', 6, 'VVVVxx'),
+(0, 'MWAAAA', 2, 'AAAAxx'),
+(0, 'NWAAAA', 2, 'HHHHxx'),
+(1, 'OWAAAA', 5, 'OOOOxx'),
+(1, 'PWAAAA', 5, 'VVVVxx'),
+(1, 'QWAAAA', 3, 'AAAAxx'),
+(1, 'RWAAAA', 3, 'HHHHxx'),
+(1, 'SWAAAA', 1, 'OOOOxx'),
+(1, 'TWAAAA', 3, 'VVVVxx'),
+(1, 'UWAAAA', 3, 'AAAAxx'),
+(1, 'VWAAAA', 9, 'HHHHxx'),
+(1, 'WWAAAA', 5, 'OOOOxx'),
+(1, 'XWAAAA', 7, 'VVVVxx'),
+(0, 'YWAAAA', 4, 'AAAAxx'),
+(1, 'ZWAAAA', 1, 'HHHHxx'),
+(1, 'AXAAAA', 1, 'OOOOxx'),
+(1, 'BXAAAA', 1, 'VVVVxx'),
+(1, 'CXAAAA', 5, 'AAAAxx'),
+(0, 'DXAAAA', 8, 'HHHHxx'),
+(1, 'EXAAAA', 1, 'OOOOxx'),
+(0, 'FXAAAA', 4, 'VVVVxx'),
+(0, 'GXAAAA', 6, 'AAAAxx'),
+(0, 'HXAAAA', 8, 'HHHHxx'),
+(0, 'IXAAAA', 8, 'OOOOxx'),
+(1, 'JXAAAA', 1, 'VVVVxx'),
+(1, 'KXAAAA', 5, 'AAAAxx'),
+(0, 'LXAAAA', 2, 'HHHHxx'),
+(1, 'MXAAAA', 5, 'OOOOxx'),
+(0, 'NXAAAA', 6, 'VVVVxx'),
+(1, 'OXAAAA', 9, 'AAAAxx'),
+(0, 'PXAAAA', 0, 'HHHHxx'),
+(1, 'QXAAAA', 9, 'OOOOxx'),
+(1, 'RXAAAA', 1, 'VVVVxx'),
+(0, 'SXAAAA', 8, 'AAAAxx'),
+(0, 'TXAAAA', 6, 'HHHHxx'),
+(0, 'UXAAAA', 2, 'OOOOxx'),
+(1, 'VXAAAA', 9, 'VVVVxx'),
+(1, 'WXAAAA', 1, 'AAAAxx'),
+(1, 'XXAAAA', 3, 'HHHHxx'),
+(0, 'YXAAAA', 0, 'OOOOxx'),
+(1, 'ZXAAAA', 1, 'VVVVxx'),
+(0, 'AYAAAA', 0, 'AAAAxx'),
+(1, 'BYAAAA', 3, 'HHHHxx'),
+(0, 'CYAAAA', 0, 'OOOOxx'),
+(1, 'DYAAAA', 5, 'VVVVxx'),
+(0, 'EYAAAA', 8, 'AAAAxx'),
+(1, 'FYAAAA', 5, 'HHHHxx'),
+(0, 'GYAAAA', 2, 'OOOOxx'),
+(0, 'HYAAAA', 8, 'VVVVxx'),
+(0, 'IYAAAA', 0, 'AAAAxx'),
+(0, 'JYAAAA', 2, 'HHHHxx'),
+(1, 'KYAAAA', 3, 'OOOOxx'),
+(0, 'LYAAAA', 2, 'VVVVxx'),
+(1, 'MYAAAA', 3, 'AAAAxx'),
+(0, 'NYAAAA', 8, 'HHHHxx'),
+(1, 'OYAAAA', 9, 'OOOOxx'),
+(0, 'PYAAAA', 6, 'VVVVxx'),
+(0, 'QYAAAA', 6, 'AAAAxx'),
+(1, 'RYAAAA', 3, 'HHHHxx'),
+(0, 'SYAAAA', 4, 'OOOOxx'),
+(1, 'TYAAAA', 3, 'VVVVxx'),
+(0, 'UYAAAA', 2, 'AAAAxx'),
+(1, 'VYAAAA', 9, 'HHHHxx'),
+(0, 'WYAAAA', 4, 'OOOOxx'),
+(1, 'XYAAAA', 7, 'VVVVxx'),
+(1, 'YYAAAA', 3, 'AAAAxx'),
+(0, 'ZYAAAA', 4, 'HHHHxx'),
+(0, 'AZAAAA', 2, 'OOOOxx'),
+(0, 'BZAAAA', 4, 'VVVVxx'),
+(0, 'CZAAAA', 0, 'AAAAxx'),
+(0, 'DZAAAA', 8, 'HHHHxx'),
+(0, 'EZAAAA', 2, 'OOOOxx'),
+(0, 'FZAAAA', 2, 'VVVVxx'),
+(1, 'GZAAAA', 5, 'AAAAxx'),
+(0, 'HZAAAA', 0, 'HHHHxx'),
+(1, 'IZAAAA', 3, 'OOOOxx'),
+(0, 'JZAAAA', 2, 'VVVVxx'),
+(0, 'KZAAAA', 2, 'AAAAxx'),
+(1, 'LZAAAA', 3, 'HHHHxx'),
+(1, 'MZAAAA', 9, 'OOOOxx'),
+(0, 'NZAAAA', 6, 'VVVVxx'),
+(1, 'OZAAAA', 5, 'AAAAxx'),
+(1, 'PZAAAA', 3, 'HHHHxx'),
+(0, 'QZAAAA', 8, 'OOOOxx'),
+(1, 'RZAAAA', 5, 'VVVVxx'),
+(0, 'SZAAAA', 2, 'AAAAxx'),
+(0, 'TZAAAA', 4, 'HHHHxx'),
+(0, 'UZAAAA', 0, 'OOOOxx'),
+(0, 'VZAAAA', 2, 'VVVVxx'),
+(0, 'WZAAAA', 2, 'AAAAxx'),
+(1, 'XZAAAA', 1, 'HHHHxx'),
+(0, 'YZAAAA', 6, 'OOOOxx'),
+(0, 'ZZAAAA', 0, 'VVVVxx'),
+(1, 'AABAAA', 9, 'AAAAxx'),
+(0, 'BABAAA', 0, 'HHHHxx'),
+(0, 'CABAAA', 2, 'OOOOxx'),
+(1, 'DABAAA', 9, 'VVVVxx'),
+(1, 'EABAAA', 3, 'AAAAxx'),
+(1, 'FABAAA', 1, 'HHHHxx'),
+(0, 'GABAAA', 6, 'OOOOxx'),
+(1, 'HABAAA', 5, 'VVVVxx'),
+(0, 'IABAAA', 4, 'AAAAxx'),
+(1, 'JABAAA', 9, 'HHHHxx'),
+(1, 'KABAAA', 3, 'OOOOxx'),
+(1, 'LABAAA', 1, 'VVVVxx'),
+(0, 'MABAAA', 0, 'AAAAxx'),
+(1, 'NABAAA', 5, 'HHHHxx'),
+(1, 'OABAAA', 3, 'OOOOxx'),
+(0, 'PABAAA', 0, 'VVVVxx'),
+(1, 'QABAAA', 3, 'AAAAxx'),
+(1, 'RABAAA', 7, 'HHHHxx'),
+(0, 'SABAAA', 8, 'OOOOxx'),
+(0, 'TABAAA', 4, 'VVVVxx'),
+(1, 'UABAAA', 9, 'AAAAxx'),
+(0, 'VABAAA', 4, 'HHHHxx'),
+(0, 'WABAAA', 8, 'OOOOxx'),
+(1, 'XABAAA', 9, 'VVVVxx'),
+(1, 'YABAAA', 1, 'AAAAxx'),
+(0, 'ZABAAA', 0, 'HHHHxx'),
+(0, 'ABBAAA', 2, 'OOOOxx'),
+(1, 'BBBAAA', 5, 'VVVVxx'),
+(1, 'CBBAAA', 5, 'AAAAxx'),
+(1, 'DBBAAA', 9, 'HHHHxx'),
+(1, 'EBBAAA', 3, 'OOOOxx'),
+(0, 'FBBAAA', 2, 'VVVVxx'),
+(0, 'GBBAAA', 2, 'AAAAxx'),
+(0, 'HBBAAA', 2, 'HHHHxx'),
+(0, 'IBBAAA', 2, 'OOOOxx'),
+(1, 'JBBAAA', 7, 'VVVVxx'),
+(0, 'KBBAAA', 8, 'AAAAxx'),
+(0, 'LBBAAA', 8, 'HHHHxx'),
+(1, 'MBBAAA', 7, 'OOOOxx'),
+(0, 'NBBAAA', 0, 'VVVVxx'),
+(0, 'OBBAAA', 2, 'AAAAxx'),
+(1, 'PBBAAA', 3, 'HHHHxx'),
+(1, 'QBBAAA', 7, 'OOOOxx'),
+(1, 'RBBAAA', 3, 'VVVVxx'),
+(1, 'SBBAAA', 9, 'AAAAxx'),
+(0, 'TBBAAA', 8, 'HHHHxx'),
+(1, 'UBBAAA', 5, 'OOOOxx'),
+(1, 'VBBAAA', 9, 'VVVVxx'),
+(0, 'WBBAAA', 6, 'AAAAxx'),
+(1, 'XBBAAA', 5, 'HHHHxx'),
+(0, 'YBBAAA', 8, 'OOOOxx'),
+(0, 'ZBBAAA', 8, 'VVVVxx'),
+(1, 'ACBAAA', 5, 'AAAAxx'),
+(1, 'BCBAAA', 3, 'HHHHxx'),
+(0, 'CCBAAA', 4, 'OOOOxx'),
+(1, 'DCBAAA', 7, 'VVVVxx'),
+(0, 'ECBAAA', 0, 'AAAAxx'),
+(1, 'FCBAAA', 1, 'HHHHxx'),
+(1, 'GCBAAA', 7, 'OOOOxx'),
+(0, 'HCBAAA', 0, 'VVVVxx'),
+(1, 'ICBAAA', 5, 'AAAAxx'),
+(1, 'JCBAAA', 1, 'HHHHxx'),
+(1, 'KCBAAA', 3, 'OOOOxx'),
+(0, 'LCBAAA', 8, 'VVVVxx'),
+(1, 'MCBAAA', 3, 'AAAAxx'),
+(0, 'NCBAAA', 4, 'HHHHxx'),
+(0, 'OCBAAA', 8, 'OOOOxx'),
+(0, 'PCBAAA', 6, 'VVVVxx'),
+(0, 'QCBAAA', 8, 'AAAAxx'),
+(1, 'RCBAAA', 5, 'HHHHxx'),
+(0, 'SCBAAA', 8, 'OOOOxx'),
+(0, 'TCBAAA', 0, 'VVVVxx'),
+(0, 'UCBAAA', 8, 'AAAAxx'),
+(1, 'VCBAAA', 9, 'HHHHxx'),
+(1, 'WCBAAA', 9, 'OOOOxx'),
+(0, 'XCBAAA', 0, 'VVVVxx'),
+(0, 'YCBAAA', 6, 'AAAAxx'),
+(1, 'ZCBAAA', 7, 'HHHHxx'),
+(1, 'ADBAAA', 5, 'OOOOxx'),
+(1, 'BDBAAA', 3, 'VVVVxx'),
+(1, 'CDBAAA', 9, 'AAAAxx'),
+(1, 'DDBAAA', 7, 'HHHHxx'),
+(1, 'EDBAAA', 1, 'OOOOxx'),
+(0, 'FDBAAA', 0, 'VVVVxx'),
+(0, 'GDBAAA', 6, 'AAAAxx'),
+(0, 'HDBAAA', 4, 'HHHHxx'),
+(1, 'IDBAAA', 7, 'OOOOxx'),
+(1, 'JDBAAA', 1, 'VVVVxx'),
+(1, 'KDBAAA', 7, 'AAAAxx'),
+(0, 'LDBAAA', 4, 'HHHHxx'),
+(0, 'MDBAAA', 8, 'OOOOxx'),
+(1, 'NDBAAA', 3, 'VVVVxx'),
+(0, 'ODBAAA', 6, 'AAAAxx'),
+(0, 'PDBAAA', 0, 'HHHHxx'),
+(0, 'QDBAAA', 4, 'OOOOxx'),
+(0, 'RDBAAA', 4, 'VVVVxx'),
+(1, 'SDBAAA', 1, 'AAAAxx'),
+(0, 'TDBAAA', 0, 'HHHHxx'),
+(1, 'UDBAAA', 5, 'OOOOxx'),
+(0, 'VDBAAA', 8, 'VVVVxx'),
+(0, 'WDBAAA', 0, 'AAAAxx'),
+(1, 'XDBAAA', 3, 'HHHHxx'),
+(1, 'YDBAAA', 9, 'OOOOxx'),
+(1, 'ZDBAAA', 9, 'VVVVxx'),
+(1, 'AEBAAA', 1, 'AAAAxx'),
+(0, 'BEBAAA', 6, 'HHHHxx'),
+(0, 'CEBAAA', 4, 'OOOOxx'),
+(1, 'DEBAAA', 3, 'VVVVxx'),
+(1, 'EEBAAA', 3, 'AAAAxx'),
+(1, 'FEBAAA', 5, 'HHHHxx'),
+(1, 'GEBAAA', 1, 'OOOOxx'),
+(1, 'HEBAAA', 5, 'VVVVxx'),
+(1, 'IEBAAA', 1, 'AAAAxx'),
+(1, 'JEBAAA', 9, 'HHHHxx'),
+(1, 'KEBAAA', 9, 'OOOOxx'),
+(1, 'LEBAAA', 1, 'VVVVxx'),
+(0, 'MEBAAA', 2, 'AAAAxx'),
+(0, 'NEBAAA', 4, 'HHHHxx'),
+(0, 'OEBAAA', 4, 'OOOOxx'),
+(1, 'PEBAAA', 1, 'VVVVxx'),
+(0, 'QEBAAA', 4, 'AAAAxx'),
+(1, 'REBAAA', 5, 'HHHHxx'),
+(1, 'SEBAAA', 7, 'OOOOxx'),
+(1, 'TEBAAA', 1, 'VVVVxx'),
+(1, 'UEBAAA', 3, 'AAAAxx'),
+(1, 'VEBAAA', 5, 'HHHHxx'),
+(0, 'WEBAAA', 6, 'OOOOxx'),
+(1, 'XEBAAA', 1, 'VVVVxx'),
+(0, 'YEBAAA', 2, 'AAAAxx'),
+(0, 'ZEBAAA', 8, 'HHHHxx'),
+(1, 'AFBAAA', 7, 'OOOOxx'),
+(0, 'BFBAAA', 4, 'VVVVxx'),
+(1, 'CFBAAA', 7, 'AAAAxx'),
+(1, 'DFBAAA', 7, 'HHHHxx'),
+(1, 'EFBAAA', 9, 'OOOOxx'),
+(0, 'FFBAAA', 2, 'VVVVxx'),
+(0, 'GFBAAA', 6, 'AAAAxx'),
+(1, 'HFBAAA', 9, 'HHHHxx'),
+(0, 'IFBAAA', 4, 'OOOOxx'),
+(1, 'JFBAAA', 3, 'VVVVxx'),
+(0, 'KFBAAA', 4, 'AAAAxx'),
+(1, 'LFBAAA', 1, 'HHHHxx'),
+(0, 'MFBAAA', 8, 'OOOOxx'),
+(1, 'NFBAAA', 3, 'VVVVxx'),
+(1, 'OFBAAA', 9, 'AAAAxx'),
+(0, 'PFBAAA', 4, 'HHHHxx'),
+(1, 'QFBAAA', 7, 'OOOOxx'),
+(1, 'RFBAAA', 7, 'VVVVxx'),
+(1, 'SFBAAA', 3, 'AAAAxx'),
+(1, 'TFBAAA', 1, 'HHHHxx'),
+(1, 'UFBAAA', 1, 'OOOOxx'),
+(0, 'VFBAAA', 4, 'VVVVxx'),
+(0, 'WFBAAA', 0, 'AAAAxx'),
+(1, 'XFBAAA', 1, 'HHHHxx'),
+(0, 'YFBAAA', 0, 'OOOOxx'),
+(0, 'ZFBAAA', 4, 'VVVVxx'),
+(1, 'AGBAAA', 7, 'AAAAxx'),
+(0, 'BGBAAA', 4, 'HHHHxx'),
+(1, 'CGBAAA', 5, 'OOOOxx'),
+(1, 'DGBAAA', 9, 'VVVVxx'),
+(1, 'EGBAAA', 3, 'AAAAxx'),
+(1, 'FGBAAA', 7, 'HHHHxx'),
+(0, 'GGBAAA', 2, 'OOOOxx'),
+(1, 'HGBAAA', 3, 'VVVVxx'),
+(1, 'IGBAAA', 1, 'AAAAxx'),
+(1, 'JGBAAA', 7, 'HHHHxx'),
+(1, 'KGBAAA', 1, 'OOOOxx'),
+(1, 'LGBAAA', 1, 'VVVVxx'),
+(1, 'MGBAAA', 7, 'AAAAxx'),
+(1, 'NGBAAA', 1, 'HHHHxx'),
+(0, 'OGBAAA', 6, 'OOOOxx'),
+(0, 'PGBAAA', 8, 'VVVVxx'),
+(0, 'QGBAAA', 2, 'AAAAxx'),
+(1, 'RGBAAA', 5, 'HHHHxx'),
+(1, 'SGBAAA', 7, 'OOOOxx'),
+(1, 'TGBAAA', 5, 'VVVVxx'),
+(1, 'UGBAAA', 7, 'AAAAxx'),
+(0, 'VGBAAA', 8, 'HHHHxx'),
+(1, 'WGBAAA', 9, 'OOOOxx'),
+(1, 'XGBAAA', 3, 'VVVVxx'),
+(1, 'YGBAAA', 3, 'AAAAxx'),
+(0, 'ZGBAAA', 8, 'HHHHxx'),
+(0, 'AHBAAA', 0, 'OOOOxx'),
+(0, 'BHBAAA', 8, 'VVVVxx'),
+(1, 'CHBAAA', 5, 'AAAAxx'),
+(0, 'DHBAAA', 0, 'HHHHxx'),
+(0, 'EHBAAA', 0, 'OOOOxx'),
+(1, 'FHBAAA', 5, 'VVVVxx'),
+(1, 'GHBAAA', 7, 'AAAAxx'),
+(1, 'HHBAAA', 9, 'HHHHxx'),
+(1, 'IHBAAA', 5, 'OOOOxx'),
+(0, 'JHBAAA', 0, 'VVVVxx'),
+(0, 'KHBAAA', 2, 'AAAAxx'),
+(1, 'LHBAAA', 7, 'HHHHxx'),
+(1, 'MHBAAA', 5, 'OOOOxx'),
+(1, 'NHBAAA', 5, 'VVVVxx'),
+(1, 'OHBAAA', 1, 'AAAAxx'),
+(1, 'PHBAAA', 1, 'HHHHxx'),
+(1, 'QHBAAA', 7, 'OOOOxx'),
+(0, 'RHBAAA', 6, 'VVVVxx'),
+(0, 'SHBAAA', 6, 'AAAAxx'),
+(0, 'THBAAA', 8, 'HHHHxx'),
+(0, 'UHBAAA', 0, 'OOOOxx'),
+(0, 'VHBAAA', 4, 'VVVVxx'),
+(1, 'WHBAAA', 1, 'AAAAxx'),
+(1, 'XHBAAA', 7, 'HHHHxx'),
+(1, 'YHBAAA', 7, 'OOOOxx'),
+(0, 'ZHBAAA', 2, 'VVVVxx'),
+(1, 'AIBAAA', 5, 'AAAAxx'),
+(1, 'BIBAAA', 9, 'HHHHxx'),
+(0, 'CIBAAA', 2, 'OOOOxx'),
+(0, 'DIBAAA', 6, 'VVVVxx'),
+(1, 'EIBAAA', 5, 'AAAAxx'),
+(0, 'FIBAAA', 4, 'HHHHxx'),
+(0, 'GIBAAA', 4, 'OOOOxx'),
+(0, 'HIBAAA', 2, 'VVVVxx'),
+(0, 'IIBAAA', 0, 'AAAAxx'),
+(0, 'JIBAAA', 2, 'HHHHxx'),
+(1, 'KIBAAA', 5, 'OOOOxx'),
+(0, 'LIBAAA', 0, 'VVVVxx'),
+(0, 'MIBAAA', 8, 'AAAAxx'),
+(1, 'NIBAAA', 3, 'HHHHxx'),
+(1, 'OIBAAA', 3, 'OOOOxx'),
+(0, 'PIBAAA', 2, 'VVVVxx'),
+(1, 'QIBAAA', 9, 'AAAAxx'),
+(0, 'RIBAAA', 0, 'HHHHxx'),
+(1, 'SIBAAA', 7, 'OOOOxx'),
+(1, 'TIBAAA', 3, 'VVVVxx'),
+(0, 'UIBAAA', 2, 'AAAAxx'),
+(1, 'VIBAAA', 1, 'HHHHxx'),
+(0, 'WIBAAA', 8, 'OOOOxx'),
+(0, 'XIBAAA', 2, 'VVVVxx'),
+(0, 'YIBAAA', 8, 'AAAAxx'),
+(0, 'ZIBAAA', 6, 'HHHHxx'),
+(0, 'AJBAAA', 8, 'OOOOxx'),
+(0, 'BJBAAA', 0, 'VVVVxx'),
+(1, 'CJBAAA', 9, 'AAAAxx'),
+(0, 'DJBAAA', 0, 'HHHHxx'),
+(1, 'EJBAAA', 7, 'OOOOxx'),
+(1, 'FJBAAA', 9, 'VVVVxx'),
+(1, 'GJBAAA', 3, 'AAAAxx'),
+(0, 'HJBAAA', 2, 'HHHHxx'),
+(0, 'IJBAAA', 6, 'OOOOxx'),
+(0, 'JJBAAA', 2, 'VVVVxx'),
+(1, 'KJBAAA', 1, 'AAAAxx'),
+(1, 'LJBAAA', 9, 'HHHHxx'),
+(0, 'MJBAAA', 8, 'OOOOxx'),
+(1, 'NJBAAA', 5, 'VVVVxx'),
+(1, 'OJBAAA', 5, 'AAAAxx'),
+(0, 'PJBAAA', 6, 'HHHHxx'),
+(0, 'QJBAAA', 6, 'OOOOxx'),
+(0, 'RJBAAA', 6, 'VVVVxx'),
+(1, 'SJBAAA', 7, 'AAAAxx'),
+(0, 'TJBAAA', 8, 'HHHHxx'),
+(0, 'UJBAAA', 6, 'OOOOxx'),
+(1, 'VJBAAA', 1, 'VVVVxx'),
+(0, 'WJBAAA', 6, 'AAAAxx'),
+(1, 'XJBAAA', 7, 'HHHHxx'),
+(0, 'YJBAAA', 6, 'OOOOxx'),
+(0, 'ZJBAAA', 8, 'VVVVxx'),
+(1, 'AKBAAA', 9, 'AAAAxx'),
+(1, 'BKBAAA', 7, 'HHHHxx'),
+(0, 'CKBAAA', 2, 'OOOOxx'),
+(0, 'DKBAAA', 0, 'VVVVxx'),
+(1, 'EKBAAA', 3, 'AAAAxx'),
+(1, 'FKBAAA', 1, 'HHHHxx'),
+(1, 'GKBAAA', 7, 'OOOOxx'),
+(1, 'HKBAAA', 7, 'VVVVxx'),
+(1, 'IKBAAA', 1, 'AAAAxx'),
+(0, 'JKBAAA', 8, 'HHHHxx'),
+(0, 'KKBAAA', 0, 'OOOOxx'),
+(1, 'LKBAAA', 5, 'VVVVxx'),
+(1, 'MKBAAA', 1, 'AAAAxx'),
+(0, 'NKBAAA', 4, 'HHHHxx'),
+(1, 'OKBAAA', 5, 'OOOOxx'),
+(0, 'PKBAAA', 2, 'VVVVxx'),
+(1, 'QKBAAA', 1, 'AAAAxx'),
+(1, 'RKBAAA', 3, 'HHHHxx'),
+(1, 'SKBAAA', 7, 'OOOOxx'),
+(1, 'TKBAAA', 7, 'VVVVxx'),
+(1, 'UKBAAA', 7, 'AAAAxx'),
+(0, 'VKBAAA', 0, 'HHHHxx'),
+(0, 'WKBAAA', 8, 'OOOOxx'),
+(1, 'XKBAAA', 3, 'VVVVxx'),
+(0, 'YKBAAA', 8, 'AAAAxx'),
+(0, 'ZKBAAA', 2, 'HHHHxx'),
+(0, 'ALBAAA', 8, 'OOOOxx'),
+(1, 'BLBAAA', 1, 'VVVVxx'),
+(1, 'CLBAAA', 7, 'AAAAxx'),
+(0, 'DLBAAA', 0, 'HHHHxx'),
+(0, 'ELBAAA', 0, 'OOOOxx'),
+(1, 'FLBAAA', 1, 'VVVVxx'),
+(1, 'GLBAAA', 3, 'AAAAxx'),
+(0, 'HLBAAA', 6, 'HHHHxx'),
+(0, 'ILBAAA', 2, 'OOOOxx'),
+(0, 'JLBAAA', 8, 'VVVVxx'),
+(0, 'KLBAAA', 0, 'AAAAxx'),
+(0, 'LLBAAA', 6, 'HHHHxx'),
+(1, 'MLBAAA', 3, 'OOOOxx'),
+(1, 'NLBAAA', 1, 'VVVVxx'),
+(0, 'OLBAAA', 4, 'AAAAxx'),
+(1, 'PLBAAA', 9, 'HHHHxx'),
+(0, 'QLBAAA', 6, 'OOOOxx'),
+(1, 'RLBAAA', 3, 'VVVVxx'),
+(0, 'SLBAAA', 6, 'AAAAxx'),
+(1, 'TLBAAA', 9, 'HHHHxx'),
+(0, 'ULBAAA', 8, 'OOOOxx'),
+(1, 'VLBAAA', 7, 'VVVVxx'),
+(1, 'WLBAAA', 3, 'AAAAxx'),
+(0, 'XLBAAA', 2, 'HHHHxx'),
+(0, 'YLBAAA', 0, 'OOOOxx'),
+(0, 'ZLBAAA', 0, 'VVVVxx'),
+(1, 'AMBAAA', 3, 'AAAAxx'),
+(1, 'BMBAAA', 1, 'HHHHxx'),
+(0, 'CMBAAA', 2, 'OOOOxx'),
+(1, 'DMBAAA', 7, 'VVVVxx'),
+(0, 'EMBAAA', 2, 'AAAAxx'),
+(1, 'FMBAAA', 7, 'HHHHxx'),
+(1, 'GMBAAA', 9, 'OOOOxx'),
+(1, 'HMBAAA', 9, 'VVVVxx'),
+(0, 'IMBAAA', 4, 'AAAAxx'),
+(0, 'JMBAAA', 4, 'HHHHxx'),
+(0, 'KMBAAA', 0, 'OOOOxx'),
+(0, 'LMBAAA', 8, 'VVVVxx');
+
diff --git a/yql/essentials/tests/postgresql/initscripts/varchar_tbl.sql b/yql/essentials/tests/postgresql/initscripts/varchar_tbl.sql
new file mode 100644
index 0000000000..cb6b7af447
--- /dev/null
+++ b/yql/essentials/tests/postgresql/initscripts/varchar_tbl.sql
@@ -0,0 +1,11 @@
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+
+CREATE TABLE varchar_tbl(f1 varchar(4));
+INSERT INTO varchar_tbl
+SELECT * from VARCHAR_TBL;
+
diff --git a/yql/essentials/tests/postgresql/make-tests.sh b/yql/essentials/tests/postgresql/make-tests.sh
new file mode 100755
index 0000000000..0edccae9b7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/make-tests.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+../../tools/pg-make-test/pg-make-test \
+ --srcdir=original/cases \
+ --patchdir=patches \
+ --initscriptscfg=testinits.cfg \
+ --initscriptsdir=initscripts \
+ --dstdir=cases \
+ --runner=../../tools/pgrun/pgrun \
+ --splitter="../../tools/pgrun/pgrun split-statements" \
+ --udf=../../udfs/common/set/libset_udf.so \
+ --udf=../../udfs/common/re2/libre2_udf.so \
+ --report=pg_tests.csv \
+ $@
+
diff --git a/yql/essentials/tests/postgresql/original.sh b/yql/essentials/tests/postgresql/original.sh
new file mode 100755
index 0000000000..0f4d603122
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+ya make -tt -DORIGINAL $@
diff --git a/yql/essentials/tests/postgresql/original/cases/aggregates.out b/yql/essentials/tests/postgresql/original/cases/aggregates.out
new file mode 100644
index 0000000000..5949996ebc
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/aggregates.out
@@ -0,0 +1,2815 @@
+--
+-- AGGREGATES
+--
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+SELECT avg(four) AS avg_1 FROM onek;
+ avg_1
+--------------------
+ 1.5000000000000000
+(1 row)
+
+SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
+ avg_32
+---------------------
+ 32.6666666666666667
+(1 row)
+
+-- In 7.1, avg(float4) is computed using float8 arithmetic.
+-- Round the result to 3 digits to avoid platform-specific results.
+SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
+ avg_107_943
+-------------
+ 107.943
+(1 row)
+
+SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
+ avg_3_4
+---------
+ 3.4
+(1 row)
+
+SELECT sum(four) AS sum_1500 FROM onek;
+ sum_1500
+----------
+ 1500
+(1 row)
+
+SELECT sum(a) AS sum_198 FROM aggtest;
+ sum_198
+---------
+ 198
+(1 row)
+
+SELECT sum(b) AS avg_431_773 FROM aggtest;
+ avg_431_773
+-------------
+ 431.773
+(1 row)
+
+SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
+ avg_6_8
+---------
+ 6.8
+(1 row)
+
+SELECT max(four) AS max_3 FROM onek;
+ max_3
+-------
+ 3
+(1 row)
+
+SELECT max(a) AS max_100 FROM aggtest;
+ max_100
+---------
+ 100
+(1 row)
+
+SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
+ max_324_78
+------------
+ 324.78
+(1 row)
+
+SELECT max(student.gpa) AS max_3_7 FROM student;
+ max_3_7
+---------
+ 3.7
+(1 row)
+
+SELECT stddev_pop(b) FROM aggtest;
+ stddev_pop
+-----------------
+ 131.10703231895
+(1 row)
+
+SELECT stddev_samp(b) FROM aggtest;
+ stddev_samp
+------------------
+ 151.389360803998
+(1 row)
+
+SELECT var_pop(b) FROM aggtest;
+ var_pop
+------------------
+ 17189.0539234823
+(1 row)
+
+SELECT var_samp(b) FROM aggtest;
+ var_samp
+------------------
+ 22918.7385646431
+(1 row)
+
+SELECT stddev_pop(b::numeric) FROM aggtest;
+ stddev_pop
+------------------
+ 131.107032862199
+(1 row)
+
+SELECT stddev_samp(b::numeric) FROM aggtest;
+ stddev_samp
+------------------
+ 151.389361431288
+(1 row)
+
+SELECT var_pop(b::numeric) FROM aggtest;
+ var_pop
+--------------------
+ 17189.054065929769
+(1 row)
+
+SELECT var_samp(b::numeric) FROM aggtest;
+ var_samp
+--------------------
+ 22918.738754573025
+(1 row)
+
+-- population variance is defined for a single tuple, sample variance
+-- is not
+SELECT var_pop(1.0::float8), var_samp(2.0::float8);
+ var_pop | var_samp
+---------+----------
+ 0 |
+(1 row)
+
+SELECT stddev_pop(3.0::float8), stddev_samp(4.0::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ 0 |
+(1 row)
+
+SELECT var_pop('inf'::float8), var_samp('inf'::float8);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::float8), stddev_samp('inf'::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::float8), var_samp('nan'::float8);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::float8), stddev_samp('nan'::float8);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop(1.0::float4), var_samp(2.0::float4);
+ var_pop | var_samp
+---------+----------
+ 0 |
+(1 row)
+
+SELECT stddev_pop(3.0::float4), stddev_samp(4.0::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ 0 |
+(1 row)
+
+SELECT var_pop('inf'::float4), var_samp('inf'::float4);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::float4), stddev_samp('inf'::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::float4), var_samp('nan'::float4);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::float4), stddev_samp('nan'::float4);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop(1.0::numeric), var_samp(2.0::numeric);
+ var_pop | var_samp
+---------+----------
+ 0 |
+(1 row)
+
+SELECT stddev_pop(3.0::numeric), stddev_samp(4.0::numeric);
+ stddev_pop | stddev_samp
+------------+-------------
+ 0 |
+(1 row)
+
+SELECT var_pop('inf'::numeric), var_samp('inf'::numeric);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('inf'::numeric), stddev_samp('inf'::numeric);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+SELECT var_pop('nan'::numeric), var_samp('nan'::numeric);
+ var_pop | var_samp
+---------+----------
+ NaN |
+(1 row)
+
+SELECT stddev_pop('nan'::numeric), stddev_samp('nan'::numeric);
+ stddev_pop | stddev_samp
+------------+-------------
+ NaN |
+(1 row)
+
+-- verify correct results for null and NaN inputs
+select sum(null::int4) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::int8) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::numeric) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select sum(null::float8) from generate_series(1,3);
+ sum
+-----
+
+(1 row)
+
+select avg(null::int4) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::int8) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::numeric) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select avg(null::float8) from generate_series(1,3);
+ avg
+-----
+
+(1 row)
+
+select sum('NaN'::numeric) from generate_series(1,3);
+ sum
+-----
+ NaN
+(1 row)
+
+select avg('NaN'::numeric) from generate_series(1,3);
+ avg
+-----
+ NaN
+(1 row)
+
+-- verify correct results for infinite inputs
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('1'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('1')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+-----+-----+---------
+ NaN | NaN | NaN
+(1 row)
+
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+ sum | avg | var_pop
+-----------+-----------+---------
+ -Infinity | -Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('1'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('1')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+----------+----------+---------
+ Infinity | Infinity | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+ sum | avg | var_pop
+-----+-----+---------
+ NaN | NaN | NaN
+(1 row)
+
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+ sum | avg | var_pop
+-----------+-----------+---------
+ -Infinity | -Infinity | NaN
+(1 row)
+
+-- test accuracy with a large input offset
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x);
+ avg | var_pop
+-----------+---------
+ 100000005 | 2.5
+(1 row)
+
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (7000000000005), (7000000000007)) v(x);
+ avg | var_pop
+---------------+---------
+ 7000000000006 | 1
+(1 row)
+
+-- SQL2003 binary aggregates
+SELECT regr_count(b, a) FROM aggtest;
+ regr_count
+------------
+ 4
+(1 row)
+
+SELECT regr_sxx(b, a) FROM aggtest;
+ regr_sxx
+----------
+ 5099
+(1 row)
+
+SELECT regr_syy(b, a) FROM aggtest;
+ regr_syy
+------------------
+ 68756.2156939293
+(1 row)
+
+SELECT regr_sxy(b, a) FROM aggtest;
+ regr_sxy
+------------------
+ 2614.51582155004
+(1 row)
+
+SELECT regr_avgx(b, a), regr_avgy(b, a) FROM aggtest;
+ regr_avgx | regr_avgy
+-----------+------------------
+ 49.5 | 107.943152273074
+(1 row)
+
+SELECT regr_r2(b, a) FROM aggtest;
+ regr_r2
+--------------------
+ 0.0194977982031803
+(1 row)
+
+SELECT regr_slope(b, a), regr_intercept(b, a) FROM aggtest;
+ regr_slope | regr_intercept
+-------------------+------------------
+ 0.512750700441271 | 82.5619926012309
+(1 row)
+
+SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest;
+ covar_pop | covar_samp
+-----------------+------------------
+ 653.62895538751 | 871.505273850014
+(1 row)
+
+SELECT corr(b, a) FROM aggtest;
+ corr
+-------------------
+ 0.139634516517873
+(1 row)
+
+-- check single-tuple behavior
+SELECT covar_pop(1::float8,2::float8), covar_samp(3::float8,4::float8);
+ covar_pop | covar_samp
+-----------+------------
+ 0 |
+(1 row)
+
+SELECT covar_pop(1::float8,'inf'::float8), covar_samp(3::float8,'inf'::float8);
+ covar_pop | covar_samp
+-----------+------------
+ NaN |
+(1 row)
+
+SELECT covar_pop(1::float8,'nan'::float8), covar_samp(3::float8,'nan'::float8);
+ covar_pop | covar_samp
+-----------+------------
+ NaN |
+(1 row)
+
+-- test accum and combine functions directly
+CREATE TABLE regr_test (x float8, y float8);
+INSERT INTO regr_test VALUES (10,150),(20,250),(30,350),(80,540),(100,200);
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30,80);
+ count | sum | regr_sxx | sum | regr_syy | regr_sxy
+-------+-----+----------+------+----------+----------
+ 4 | 140 | 2900 | 1290 | 83075 | 15050
+(1 row)
+
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test;
+ count | sum | regr_sxx | sum | regr_syy | regr_sxy
+-------+-----+----------+------+----------+----------
+ 5 | 240 | 6280 | 1490 | 95080 | 8680
+(1 row)
+
+SELECT float8_accum('{4,140,2900}'::float8[], 100);
+ float8_accum
+--------------
+ {5,240,6280}
+(1 row)
+
+SELECT float8_regr_accum('{4,140,2900,1290,83075,15050}'::float8[], 200, 100);
+ float8_regr_accum
+------------------------------
+ {5,240,6280,1490,95080,8680}
+(1 row)
+
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30);
+ count | sum | regr_sxx | sum | regr_syy | regr_sxy
+-------+-----+----------+-----+----------+----------
+ 3 | 60 | 200 | 750 | 20000 | 2000
+(1 row)
+
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (80,100);
+ count | sum | regr_sxx | sum | regr_syy | regr_sxy
+-------+-----+----------+-----+----------+----------
+ 2 | 180 | 200 | 740 | 57800 | -3400
+(1 row)
+
+SELECT float8_combine('{3,60,200}'::float8[], '{0,0,0}'::float8[]);
+ float8_combine
+----------------
+ {3,60,200}
+(1 row)
+
+SELECT float8_combine('{0,0,0}'::float8[], '{2,180,200}'::float8[]);
+ float8_combine
+----------------
+ {2,180,200}
+(1 row)
+
+SELECT float8_combine('{3,60,200}'::float8[], '{2,180,200}'::float8[]);
+ float8_combine
+----------------
+ {5,240,6280}
+(1 row)
+
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{0,0,0,0,0,0}'::float8[]);
+ float8_regr_combine
+---------------------------
+ {3,60,200,750,20000,2000}
+(1 row)
+
+SELECT float8_regr_combine('{0,0,0,0,0,0}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+ float8_regr_combine
+-----------------------------
+ {2,180,200,740,57800,-3400}
+(1 row)
+
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+ float8_regr_combine
+------------------------------
+ {5,240,6280,1490,95080,8680}
+(1 row)
+
+DROP TABLE regr_test;
+-- test count, distinct
+SELECT count(four) AS cnt_1000 FROM onek;
+ cnt_1000
+----------
+ 1000
+(1 row)
+
+SELECT count(DISTINCT four) AS cnt_4 FROM onek;
+ cnt_4
+-------
+ 4
+(1 row)
+
+select ten, count(*), sum(four) from onek
+group by ten order by ten;
+ ten | count | sum
+-----+-------+-----
+ 0 | 100 | 100
+ 1 | 100 | 200
+ 2 | 100 | 100
+ 3 | 100 | 200
+ 4 | 100 | 100
+ 5 | 100 | 200
+ 6 | 100 | 100
+ 7 | 100 | 200
+ 8 | 100 | 100
+ 9 | 100 | 200
+(10 rows)
+
+select ten, count(four), sum(DISTINCT four) from onek
+group by ten order by ten;
+ ten | count | sum
+-----+-------+-----
+ 0 | 100 | 2
+ 1 | 100 | 4
+ 2 | 100 | 2
+ 3 | 100 | 4
+ 4 | 100 | 2
+ 5 | 100 | 4
+ 6 | 100 | 2
+ 7 | 100 | 4
+ 8 | 100 | 2
+ 9 | 100 | 4
+(10 rows)
+
+-- user-defined aggregates
+SELECT newavg(four) AS avg_1 FROM onek;
+ avg_1
+--------------------
+ 1.5000000000000000
+(1 row)
+
+SELECT newsum(four) AS sum_1500 FROM onek;
+ sum_1500
+----------
+ 1500
+(1 row)
+
+SELECT newcnt(four) AS cnt_1000 FROM onek;
+ cnt_1000
+----------
+ 1000
+(1 row)
+
+SELECT newcnt(*) AS cnt_1000 FROM onek;
+ cnt_1000
+----------
+ 1000
+(1 row)
+
+SELECT oldcnt(*) AS cnt_1000 FROM onek;
+ cnt_1000
+----------
+ 1000
+(1 row)
+
+SELECT sum2(q1,q2) FROM int8_tbl;
+ sum2
+-------------------
+ 18271560493827981
+(1 row)
+
+-- test for outer-level aggregates
+-- this should work
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+ ten | sum
+-----+-----
+ 0 | 2
+ 2 | 2
+ 4 | 2
+ 6 | 2
+ 8 | 2
+(5 rows)
+
+-- this should fail because subquery has an agg of its own in WHERE
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b
+ where sum(distinct a.four + b.four) = b.four);
+ERROR: aggregate functions are not allowed in WHERE
+LINE 4: where sum(distinct a.four + b.four) = b.four)...
+ ^
+-- Test handling of sublinks within outer-level aggregates.
+-- Per bug report from Daniel Grace.
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+from tenk1 o;
+ max
+------
+ 9999
+(1 row)
+
+-- Test handling of Params within aggregate arguments in hashed aggregation.
+-- Per bug report from Jeevan Chalke.
+explain (verbose, costs off)
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+ QUERY PLAN
+------------------------------------------------------------------
+ Sort
+ Output: s1.s1, s2.s2, (sum((s1.s1 + s2.s2)))
+ Sort Key: s1.s1, s2.s2
+ -> Nested Loop
+ Output: s1.s1, s2.s2, (sum((s1.s1 + s2.s2)))
+ -> Function Scan on pg_catalog.generate_series s1
+ Output: s1.s1
+ Function Call: generate_series(1, 3)
+ -> HashAggregate
+ Output: s2.s2, sum((s1.s1 + s2.s2))
+ Group Key: s2.s2
+ -> Function Scan on pg_catalog.generate_series s2
+ Output: s2.s2
+ Function Call: generate_series(1, 3)
+(14 rows)
+
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+ s1 | s2 | sm
+----+----+----
+ 1 | 1 | 2
+ 1 | 2 | 3
+ 1 | 3 | 4
+ 2 | 1 | 3
+ 2 | 2 | 4
+ 2 | 3 | 5
+ 3 | 1 | 4
+ 3 | 2 | 5
+ 3 | 3 | 6
+(9 rows)
+
+explain (verbose, costs off)
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+ QUERY PLAN
+-------------------------------------------------------------------
+ Function Scan on pg_catalog.generate_series x
+ Output: (SubPlan 1)
+ Function Call: generate_series(1, 3)
+ SubPlan 1
+ -> Sort
+ Output: (sum((x.x + y.y))), y.y
+ Sort Key: (sum((x.x + y.y)))
+ -> HashAggregate
+ Output: sum((x.x + y.y)), y.y
+ Group Key: y.y
+ -> Function Scan on pg_catalog.generate_series y
+ Output: y.y
+ Function Call: generate_series(1, 3)
+(13 rows)
+
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+ array
+---------
+ {2,3,4}
+ {3,4,5}
+ {4,5,6}
+(3 rows)
+
+--
+-- test for bitwise integer aggregates
+--
+CREATE TEMPORARY TABLE bitwise_test(
+ i2 INT2,
+ i4 INT4,
+ i8 INT8,
+ i INTEGER,
+ x INT2,
+ y BIT(4)
+);
+-- empty case
+SELECT
+ BIT_AND(i2) AS "?",
+ BIT_OR(i4) AS "?",
+ BIT_XOR(i8) AS "?"
+FROM bitwise_test;
+ ? | ? | ?
+---+---+---
+ | |
+(1 row)
+
+COPY bitwise_test FROM STDIN NULL 'null';
+SELECT
+ BIT_AND(i2) AS "1",
+ BIT_AND(i4) AS "1",
+ BIT_AND(i8) AS "1",
+ BIT_AND(i) AS "?",
+ BIT_AND(x) AS "0",
+ BIT_AND(y) AS "0100",
+ BIT_OR(i2) AS "7",
+ BIT_OR(i4) AS "7",
+ BIT_OR(i8) AS "7",
+ BIT_OR(i) AS "?",
+ BIT_OR(x) AS "7",
+ BIT_OR(y) AS "1101",
+ BIT_XOR(i2) AS "5",
+ BIT_XOR(i4) AS "5",
+ BIT_XOR(i8) AS "5",
+ BIT_XOR(i) AS "?",
+ BIT_XOR(x) AS "7",
+ BIT_XOR(y) AS "1101"
+FROM bitwise_test;
+ 1 | 1 | 1 | ? | 0 | 0100 | 7 | 7 | 7 | ? | 7 | 1101 | 5 | 5 | 5 | ? | 7 | 1101
+---+---+---+---+---+------+---+---+---+---+---+------+---+---+---+---+---+------
+ 1 | 1 | 1 | 1 | 0 | 0100 | 7 | 7 | 7 | 3 | 7 | 1101 | 5 | 5 | 5 | 2 | 7 | 1101
+(1 row)
+
+--
+-- test boolean aggregates
+--
+-- first test all possible transition and final states
+SELECT
+ -- boolean and transitions
+ -- null because strict
+ booland_statefunc(NULL, NULL) IS NULL AS "t",
+ booland_statefunc(TRUE, NULL) IS NULL AS "t",
+ booland_statefunc(FALSE, NULL) IS NULL AS "t",
+ booland_statefunc(NULL, TRUE) IS NULL AS "t",
+ booland_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- and actual computations
+ booland_statefunc(TRUE, TRUE) AS "t",
+ NOT booland_statefunc(TRUE, FALSE) AS "t",
+ NOT booland_statefunc(FALSE, TRUE) AS "t",
+ NOT booland_statefunc(FALSE, FALSE) AS "t";
+ t | t | t | t | t | t | t | t | t
+---+---+---+---+---+---+---+---+---
+ t | t | t | t | t | t | t | t | t
+(1 row)
+
+SELECT
+ -- boolean or transitions
+ -- null because strict
+ boolor_statefunc(NULL, NULL) IS NULL AS "t",
+ boolor_statefunc(TRUE, NULL) IS NULL AS "t",
+ boolor_statefunc(FALSE, NULL) IS NULL AS "t",
+ boolor_statefunc(NULL, TRUE) IS NULL AS "t",
+ boolor_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- actual computations
+ boolor_statefunc(TRUE, TRUE) AS "t",
+ boolor_statefunc(TRUE, FALSE) AS "t",
+ boolor_statefunc(FALSE, TRUE) AS "t",
+ NOT boolor_statefunc(FALSE, FALSE) AS "t";
+ t | t | t | t | t | t | t | t | t
+---+---+---+---+---+---+---+---+---
+ t | t | t | t | t | t | t | t | t
+(1 row)
+
+CREATE TEMPORARY TABLE bool_test(
+ b1 BOOL,
+ b2 BOOL,
+ b3 BOOL,
+ b4 BOOL);
+-- empty case
+SELECT
+ BOOL_AND(b1) AS "n",
+ BOOL_OR(b3) AS "n"
+FROM bool_test;
+ n | n
+---+---
+ |
+(1 row)
+
+COPY bool_test FROM STDIN NULL 'null';
+SELECT
+ BOOL_AND(b1) AS "f",
+ BOOL_AND(b2) AS "t",
+ BOOL_AND(b3) AS "f",
+ BOOL_AND(b4) AS "n",
+ BOOL_AND(NOT b2) AS "f",
+ BOOL_AND(NOT b3) AS "t"
+FROM bool_test;
+ f | t | f | n | f | t
+---+---+---+---+---+---
+ f | t | f | | f | t
+(1 row)
+
+SELECT
+ EVERY(b1) AS "f",
+ EVERY(b2) AS "t",
+ EVERY(b3) AS "f",
+ EVERY(b4) AS "n",
+ EVERY(NOT b2) AS "f",
+ EVERY(NOT b3) AS "t"
+FROM bool_test;
+ f | t | f | n | f | t
+---+---+---+---+---+---
+ f | t | f | | f | t
+(1 row)
+
+SELECT
+ BOOL_OR(b1) AS "t",
+ BOOL_OR(b2) AS "t",
+ BOOL_OR(b3) AS "f",
+ BOOL_OR(b4) AS "n",
+ BOOL_OR(NOT b2) AS "f",
+ BOOL_OR(NOT b3) AS "t"
+FROM bool_test;
+ t | t | f | n | f | t
+---+---+---+---+---+---
+ t | t | f | | f | t
+(1 row)
+
+--
+-- Test cases that should be optimized into indexscans instead of
+-- the generic aggregate implementation.
+--
+-- Basic cases
+explain (costs off)
+ select min(unique1) from tenk1;
+ QUERY PLAN
+------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 IS NOT NULL)
+(5 rows)
+
+select min(unique1) from tenk1;
+ min
+-----
+ 0
+(1 row)
+
+explain (costs off)
+ select max(unique1) from tenk1;
+ QUERY PLAN
+---------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique1 on tenk1
+ Index Cond: (unique1 IS NOT NULL)
+(5 rows)
+
+select max(unique1) from tenk1;
+ max
+------
+ 9999
+(1 row)
+
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 < 42;
+ QUERY PLAN
+------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique1 on tenk1
+ Index Cond: ((unique1 IS NOT NULL) AND (unique1 < 42))
+(5 rows)
+
+select max(unique1) from tenk1 where unique1 < 42;
+ max
+-----
+ 41
+(1 row)
+
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42;
+ QUERY PLAN
+------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique1 on tenk1
+ Index Cond: ((unique1 IS NOT NULL) AND (unique1 > 42))
+(5 rows)
+
+select max(unique1) from tenk1 where unique1 > 42;
+ max
+------
+ 9999
+(1 row)
+
+-- the planner may choose a generic aggregate here if parallel query is
+-- enabled, since that plan will be parallel safe and the "optimized"
+-- plan, which has almost identical cost, will not be. we want to test
+-- the optimized plan, so temporarily disable parallel query.
+begin;
+set local max_parallel_workers_per_gather = 0;
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42000;
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique1 on tenk1
+ Index Cond: ((unique1 IS NOT NULL) AND (unique1 > 42000))
+(5 rows)
+
+select max(unique1) from tenk1 where unique1 > 42000;
+ max
+-----
+
+(1 row)
+
+rollback;
+-- multi-column index (uses tenk1_thous_tenthous)
+explain (costs off)
+ select max(tenthous) from tenk1 where thousand = 33;
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_thous_tenthous on tenk1
+ Index Cond: ((thousand = 33) AND (tenthous IS NOT NULL))
+(5 rows)
+
+select max(tenthous) from tenk1 where thousand = 33;
+ max
+------
+ 9033
+(1 row)
+
+explain (costs off)
+ select min(tenthous) from tenk1 where thousand = 33;
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan using tenk1_thous_tenthous on tenk1
+ Index Cond: ((thousand = 33) AND (tenthous IS NOT NULL))
+(5 rows)
+
+select min(tenthous) from tenk1 where thousand = 33;
+ min
+-----
+ 33
+(1 row)
+
+-- check parameter propagation into an indexscan subquery
+explain (costs off)
+ select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Seq Scan on int4_tbl
+ SubPlan 2
+ -> Result
+ InitPlan 1 (returns $1)
+ -> Limit
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: ((unique1 IS NOT NULL) AND (unique1 > int4_tbl.f1))
+(7 rows)
+
+select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+ f1 | gt
+-------------+----
+ 0 | 1
+ 123456 |
+ -123456 | 0
+ 2147483647 |
+ -2147483647 | 0
+(5 rows)
+
+-- check some cases that were handled incorrectly in 8.3.0
+explain (costs off)
+ select distinct max(unique2) from tenk1;
+ QUERY PLAN
+---------------------------------------------------------------------
+ HashAggregate
+ Group Key: $0
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique2 on tenk1
+ Index Cond: (unique2 IS NOT NULL)
+ -> Result
+(7 rows)
+
+select distinct max(unique2) from tenk1;
+ max
+------
+ 9999
+(1 row)
+
+explain (costs off)
+ select max(unique2) from tenk1 order by 1;
+ QUERY PLAN
+---------------------------------------------------------------------
+ Sort
+ Sort Key: ($0)
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique2 on tenk1
+ Index Cond: (unique2 IS NOT NULL)
+ -> Result
+(7 rows)
+
+select max(unique2) from tenk1 order by 1;
+ max
+------
+ 9999
+(1 row)
+
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2);
+ QUERY PLAN
+---------------------------------------------------------------------
+ Sort
+ Sort Key: ($0)
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique2 on tenk1
+ Index Cond: (unique2 IS NOT NULL)
+ -> Result
+(7 rows)
+
+select max(unique2) from tenk1 order by max(unique2);
+ max
+------
+ 9999
+(1 row)
+
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2)+1;
+ QUERY PLAN
+---------------------------------------------------------------------
+ Sort
+ Sort Key: (($0 + 1))
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique2 on tenk1
+ Index Cond: (unique2 IS NOT NULL)
+ -> Result
+(7 rows)
+
+select max(unique2) from tenk1 order by max(unique2)+1;
+ max
+------
+ 9999
+(1 row)
+
+explain (costs off)
+ select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+ QUERY PLAN
+---------------------------------------------------------------------
+ Sort
+ Sort Key: (generate_series(1, 3)) DESC
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Index Only Scan Backward using tenk1_unique2 on tenk1
+ Index Cond: (unique2 IS NOT NULL)
+ -> ProjectSet
+ -> Result
+(8 rows)
+
+select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+ max | g
+------+---
+ 9999 | 3
+ 9999 | 2
+ 9999 | 1
+(3 rows)
+
+-- interesting corner case: constant gets optimized into a seqscan
+explain (costs off)
+ select max(100) from tenk1;
+ QUERY PLAN
+----------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Result
+ One-Time Filter: (100 IS NOT NULL)
+ -> Seq Scan on tenk1
+(6 rows)
+
+select max(100) from tenk1;
+ max
+-----
+ 100
+(1 row)
+
+-- try it on an inheritance tree
+create table minmaxtest(f1 int);
+create table minmaxtest1() inherits (minmaxtest);
+create table minmaxtest2() inherits (minmaxtest);
+create table minmaxtest3() inherits (minmaxtest);
+create index minmaxtesti on minmaxtest(f1);
+create index minmaxtest1i on minmaxtest1(f1);
+create index minmaxtest2i on minmaxtest2(f1 desc);
+create index minmaxtest3i on minmaxtest3(f1) where f1 is not null;
+insert into minmaxtest values(11), (12);
+insert into minmaxtest1 values(13), (14);
+insert into minmaxtest2 values(15), (16);
+insert into minmaxtest3 values(17), (18);
+explain (costs off)
+ select min(f1), max(f1) from minmaxtest;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------
+ Result
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Merge Append
+ Sort Key: minmaxtest.f1
+ -> Index Only Scan using minmaxtesti on minmaxtest minmaxtest_1
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest1i on minmaxtest1 minmaxtest_2
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest2i on minmaxtest2 minmaxtest_3
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest3i on minmaxtest3 minmaxtest_4
+ InitPlan 2 (returns $1)
+ -> Limit
+ -> Merge Append
+ Sort Key: minmaxtest_5.f1 DESC
+ -> Index Only Scan Backward using minmaxtesti on minmaxtest minmaxtest_6
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest1i on minmaxtest1 minmaxtest_7
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest2i on minmaxtest2 minmaxtest_8
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest3i on minmaxtest3 minmaxtest_9
+(23 rows)
+
+select min(f1), max(f1) from minmaxtest;
+ min | max
+-----+-----
+ 11 | 18
+(1 row)
+
+-- DISTINCT doesn't do anything useful here, but it shouldn't fail
+explain (costs off)
+ select distinct min(f1), max(f1) from minmaxtest;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------
+ Unique
+ InitPlan 1 (returns $0)
+ -> Limit
+ -> Merge Append
+ Sort Key: minmaxtest.f1
+ -> Index Only Scan using minmaxtesti on minmaxtest minmaxtest_1
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest1i on minmaxtest1 minmaxtest_2
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest2i on minmaxtest2 minmaxtest_3
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest3i on minmaxtest3 minmaxtest_4
+ InitPlan 2 (returns $1)
+ -> Limit
+ -> Merge Append
+ Sort Key: minmaxtest_5.f1 DESC
+ -> Index Only Scan Backward using minmaxtesti on minmaxtest minmaxtest_6
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest1i on minmaxtest1 minmaxtest_7
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan using minmaxtest2i on minmaxtest2 minmaxtest_8
+ Index Cond: (f1 IS NOT NULL)
+ -> Index Only Scan Backward using minmaxtest3i on minmaxtest3 minmaxtest_9
+ -> Sort
+ Sort Key: ($0), ($1)
+ -> Result
+(26 rows)
+
+select distinct min(f1), max(f1) from minmaxtest;
+ min | max
+-----+-----
+ 11 | 18
+(1 row)
+
+drop table minmaxtest cascade;
+NOTICE: drop cascades to 3 other objects
+DETAIL: drop cascades to table minmaxtest1
+drop cascades to table minmaxtest2
+drop cascades to table minmaxtest3
+-- check for correct detection of nested-aggregate errors
+select max(min(unique1)) from tenk1;
+ERROR: aggregate function calls cannot be nested
+LINE 1: select max(min(unique1)) from tenk1;
+ ^
+select (select max(min(unique1)) from int8_tbl) from tenk1;
+ERROR: aggregate function calls cannot be nested
+LINE 1: select (select max(min(unique1)) from int8_tbl) from tenk1;
+ ^
+--
+-- Test removal of redundant GROUP BY columns
+--
+create temp table t1 (a int, b int, c int, d int, primary key (a, b));
+create temp table t2 (x int, y int, z int, primary key (x, y));
+create temp table t3 (a int, b int, c int, primary key(a, b) deferrable);
+-- Non-primary-key columns can be removed from GROUP BY
+explain (costs off) select * from t1 group by a,b,c,d;
+ QUERY PLAN
+----------------------
+ HashAggregate
+ Group Key: a, b
+ -> Seq Scan on t1
+(3 rows)
+
+-- No removal can happen if the complete PK is not present in GROUP BY
+explain (costs off) select a,c from t1 group by a,c,d;
+ QUERY PLAN
+----------------------
+ HashAggregate
+ Group Key: a, c, d
+ -> Seq Scan on t1
+(3 rows)
+
+-- Test removal across multiple relations
+explain (costs off) select *
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.y,t2.z;
+ QUERY PLAN
+------------------------------------------------------
+ HashAggregate
+ Group Key: t1.a, t1.b, t2.x, t2.y
+ -> Hash Join
+ Hash Cond: ((t2.x = t1.a) AND (t2.y = t1.b))
+ -> Seq Scan on t2
+ -> Hash
+ -> Seq Scan on t1
+(7 rows)
+
+-- Test case where t1 can be optimized but not t2
+explain (costs off) select t1.*,t2.x,t2.z
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.z;
+ QUERY PLAN
+------------------------------------------------------
+ HashAggregate
+ Group Key: t1.a, t1.b, t2.x, t2.z
+ -> Hash Join
+ Hash Cond: ((t2.x = t1.a) AND (t2.y = t1.b))
+ -> Seq Scan on t2
+ -> Hash
+ -> Seq Scan on t1
+(7 rows)
+
+-- Cannot optimize when PK is deferrable
+explain (costs off) select * from t3 group by a,b,c;
+ QUERY PLAN
+----------------------
+ HashAggregate
+ Group Key: a, b, c
+ -> Seq Scan on t3
+(3 rows)
+
+create temp table t1c () inherits (t1);
+-- Ensure we don't remove any columns when t1 has a child table
+explain (costs off) select * from t1 group by a,b,c,d;
+ QUERY PLAN
+-------------------------------------
+ HashAggregate
+ Group Key: t1.a, t1.b, t1.c, t1.d
+ -> Append
+ -> Seq Scan on t1 t1_1
+ -> Seq Scan on t1c t1_2
+(5 rows)
+
+-- Okay to remove columns if we're only querying the parent.
+explain (costs off) select * from only t1 group by a,b,c,d;
+ QUERY PLAN
+----------------------
+ HashAggregate
+ Group Key: a, b
+ -> Seq Scan on t1
+(3 rows)
+
+create temp table p_t1 (
+ a int,
+ b int,
+ c int,
+ d int,
+ primary key(a,b)
+) partition by list(a);
+create temp table p_t1_1 partition of p_t1 for values in(1);
+create temp table p_t1_2 partition of p_t1 for values in(2);
+-- Ensure we can remove non-PK columns for partitioned tables.
+explain (costs off) select * from p_t1 group by a,b,c,d;
+ QUERY PLAN
+--------------------------------
+ HashAggregate
+ Group Key: p_t1.a, p_t1.b
+ -> Append
+ -> Seq Scan on p_t1_1
+ -> Seq Scan on p_t1_2
+(5 rows)
+
+drop table t1 cascade;
+NOTICE: drop cascades to table t1c
+drop table t2;
+drop table t3;
+drop table p_t1;
+--
+-- Test GROUP BY matching of join columns that are type-coerced due to USING
+--
+create temp table t1(f1 int, f2 bigint);
+create temp table t2(f1 bigint, f22 bigint);
+select f1 from t1 left join t2 using (f1) group by f1;
+ f1
+----
+(0 rows)
+
+select f1 from t1 left join t2 using (f1) group by t1.f1;
+ f1
+----
+(0 rows)
+
+select t1.f1 from t1 left join t2 using (f1) group by t1.f1;
+ f1
+----
+(0 rows)
+
+-- only this one should fail:
+select t1.f1 from t1 left join t2 using (f1) group by f1;
+ERROR: column "t1.f1" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: select t1.f1 from t1 left join t2 using (f1) group by f1;
+ ^
+drop table t1, t2;
+--
+-- Test combinations of DISTINCT and/or ORDER BY
+--
+select array_agg(a order by b)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+ array_agg
+-----------
+ {3,4,2,1}
+(1 row)
+
+select array_agg(a order by a)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+ array_agg
+-----------
+ {1,2,3,4}
+(1 row)
+
+select array_agg(a order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+ array_agg
+-----------
+ {4,3,2,1}
+(1 row)
+
+select array_agg(b order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+ array_agg
+-----------
+ {2,1,3,4}
+(1 row)
+
+select array_agg(distinct a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+ array_agg
+--------------
+ {1,2,3,NULL}
+(1 row)
+
+select array_agg(distinct a order by a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+ array_agg
+--------------
+ {1,2,3,NULL}
+(1 row)
+
+select array_agg(distinct a order by a desc)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+ array_agg
+--------------
+ {NULL,3,2,1}
+(1 row)
+
+select array_agg(distinct a order by a desc nulls last)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+ array_agg
+--------------
+ {3,2,1,NULL}
+(1 row)
+
+-- multi-arg aggs, strict/nonstrict, distinct/order by
+select aggfstr(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+ aggfstr
+---------------------------------------
+ {"(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+ aggfns
+-----------------------------------------------
+ {"(1,3,foo)","(0,,)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select aggfstr(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+ aggfstr
+---------------------------------------
+ {"(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+ aggfns
+-----------------------------------------------
+ {"(0,,)","(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select aggfstr(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+ aggfstr
+---------------------------------------
+ {"(3,1,baz)","(2,2,bar)","(1,3,foo)"}
+(1 row)
+
+select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+ aggfns
+-----------------------------------------------
+ {"(3,1,baz)","(2,2,bar)","(1,3,foo)","(0,,)"}
+(1 row)
+
+-- test specific code paths
+select aggfns(distinct a,a,c order by c using ~<~,a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+ aggfns
+------------------------------------------------
+ {"(2,2,bar)","(3,3,baz)","(1,1,foo)","(0,0,)"}
+(1 row)
+
+select aggfns(distinct a,a,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+ aggfns
+------------------------------------------------
+ {"(2,2,bar)","(3,3,baz)","(1,1,foo)","(0,0,)"}
+(1 row)
+
+select aggfns(distinct a,a,c order by a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+ aggfns
+------------------------------------------------
+ {"(0,0,)","(1,1,foo)","(2,2,bar)","(3,3,baz)"}
+(1 row)
+
+select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+ aggfns
+-----------------------------------------------
+ {"(0,,)","(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+-- check node I/O via view creation and usage, also deparsing logic
+create view agg_view1 as
+ select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(1,3,foo)","(0,,)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(v.a, v.b, v.c) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(0,,)","(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(DISTINCT v.a, v.b, v.c) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c),+
+ generate_series(1, 3) i(i);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(3,1,baz)","(2,2,bar)","(1,3,foo)","(0,,)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(DISTINCT v.a, v.b, v.c ORDER BY v.b) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c),+
+ generate_series(1, 3) i(i);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by b+1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(3,1,baz)","(2,2,bar)","(1,3,foo)","(0,,)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(v.a, v.b, v.c ORDER BY (v.b + 1)) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(a,a,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+select * from agg_view1;
+ aggfns
+------------------------------------------------
+ {"(3,3,baz)","(2,2,bar)","(1,1,foo)","(0,0,)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(v.a, v.a, v.c ORDER BY v.b) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(2,2,bar)","(3,1,baz)","(1,3,foo)","(0,,)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(v.a, v.b, v.c ORDER BY v.c USING ~<~ NULLS LAST) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c);
+(1 row)
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+select * from agg_view1;
+ aggfns
+-----------------------------------------------
+ {"(0,,)","(1,3,foo)","(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+select pg_get_viewdef('agg_view1'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------
+ SELECT aggfns(DISTINCT v.a, v.b, v.c ORDER BY v.a, v.c USING ~<~ NULLS LAST, v.b) AS aggfns +
+ FROM ( VALUES (1,3,'foo'::text), (0,NULL::integer,NULL::text), (2,2,'bar'::text), (3,1,'baz'::text)) v(a, b, c),+
+ generate_series(1, 2) i(i);
+(1 row)
+
+drop view agg_view1;
+-- incorrect DISTINCT usage errors
+select aggfns(distinct a,b,c order by i)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select aggfns(distinct a,b,c order by i)
+ ^
+select aggfns(distinct a,b,c order by a,b+1)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select aggfns(distinct a,b,c order by a,b+1)
+ ^
+select aggfns(distinct a,b,c order by a,b,i,c)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select aggfns(distinct a,b,c order by a,b,i,c)
+ ^
+select aggfns(distinct a,a,c order by a,b)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select aggfns(distinct a,a,c order by a,b)
+ ^
+-- string_agg tests
+select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
+ string_agg
+----------------
+ aaaa,bbbb,cccc
+(1 row)
+
+select string_agg(a,',') from (values('aaaa'),(null),('bbbb'),('cccc')) g(a);
+ string_agg
+----------------
+ aaaa,bbbb,cccc
+(1 row)
+
+select string_agg(a,'AB') from (values(null),(null),('bbbb'),('cccc')) g(a);
+ string_agg
+------------
+ bbbbABcccc
+(1 row)
+
+select string_agg(a,',') from (values(null),(null)) g(a);
+ string_agg
+------------
+
+(1 row)
+
+-- check some implicit casting cases, as per bug #5564
+select string_agg(distinct f1, ',' order by f1) from varchar_tbl; -- ok
+ string_agg
+------------
+ a,ab,abcd
+(1 row)
+
+select string_agg(distinct f1::text, ',' order by f1) from varchar_tbl; -- not ok
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select string_agg(distinct f1::text, ',' order by f1) from v...
+ ^
+select string_agg(distinct f1, ',' order by f1::text) from varchar_tbl; -- not ok
+ERROR: in an aggregate with DISTINCT, ORDER BY expressions must appear in argument list
+LINE 1: select string_agg(distinct f1, ',' order by f1::text) from v...
+ ^
+select string_agg(distinct f1::text, ',' order by f1::text) from varchar_tbl; -- ok
+ string_agg
+------------
+ a,ab,abcd
+(1 row)
+
+-- string_agg bytea tests
+create table bytea_test_table(v bytea);
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+
+(1 row)
+
+insert into bytea_test_table values(decode('ff','hex'));
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+ \xff
+(1 row)
+
+insert into bytea_test_table values(decode('aa','hex'));
+select string_agg(v, '') from bytea_test_table;
+ string_agg
+------------
+ \xffaa
+(1 row)
+
+select string_agg(v, NULL) from bytea_test_table;
+ string_agg
+------------
+ \xffaa
+(1 row)
+
+select string_agg(v, decode('ee', 'hex')) from bytea_test_table;
+ string_agg
+------------
+ \xffeeaa
+(1 row)
+
+drop table bytea_test_table;
+-- FILTER tests
+select min(unique1) filter (where unique1 > 100) from tenk1;
+ min
+-----
+ 101
+(1 row)
+
+select sum(1/ten) filter (where ten > 0) from tenk1;
+ sum
+------
+ 1000
+(1 row)
+
+select ten, sum(distinct four) filter (where four::text ~ '123') from onek a
+group by ten;
+ ten | sum
+-----+-----
+ 0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ 5 |
+ 6 |
+ 7 |
+ 8 |
+ 9 |
+(10 rows)
+
+select ten, sum(distinct four) filter (where four > 10) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+ ten | sum
+-----+-----
+ 0 |
+ 2 |
+ 4 |
+ 6 |
+ 8 |
+(5 rows)
+
+select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0')
+from (values ('a', 'b')) AS v(foo,bar);
+ max
+-----
+ a
+(1 row)
+
+-- outer reference in FILTER (PostgreSQL extension)
+select (select count(*)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+ count
+-------
+ 1
+ 1
+(2 rows)
+
+select (select count(*) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- outer query is aggregation query
+ count
+-------
+ 2
+(1 row)
+
+select (select count(inner_c) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+ count
+-------
+ 1
+ 1
+(2 rows)
+
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1))
+ filter (where o.unique1 < 10))
+from tenk1 o; -- outer query is aggregation query
+ max
+------
+ 9998
+(1 row)
+
+-- subquery in FILTER clause (PostgreSQL extension)
+select sum(unique1) FILTER (WHERE
+ unique1 IN (SELECT unique1 FROM onek where unique1 < 100)) FROM tenk1;
+ sum
+------
+ 4950
+(1 row)
+
+-- exercise lots of aggregate parts with FILTER
+select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+ aggfns
+---------------------------
+ {"(2,2,bar)","(3,1,baz)"}
+(1 row)
+
+-- check handling of bare boolean Var in FILTER
+select max(0) filter (where b1) from bool_test;
+ max
+-----
+ 0
+(1 row)
+
+select (select max(0) filter (where b1)) from bool_test;
+ max
+-----
+ 0
+(1 row)
+
+-- check for correct detection of nested-aggregate errors in FILTER
+select max(unique1) filter (where sum(ten) > 0) from tenk1;
+ERROR: aggregate functions are not allowed in FILTER
+LINE 1: select max(unique1) filter (where sum(ten) > 0) from tenk1;
+ ^
+select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
+ERROR: aggregate function calls cannot be nested
+LINE 1: select (select max(unique1) filter (where sum(ten) > 0) from...
+ ^
+select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
+ERROR: aggregate functions are not allowed in FILTER
+LINE 1: select max(unique1) filter (where bool_or(ten > 0)) from ten...
+ ^
+select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
+ERROR: aggregate function calls cannot be nested
+LINE 1: select (select max(unique1) filter (where bool_or(ten > 0)) ...
+ ^
+-- ordered-set aggregates
+select p, percentile_cont(p) within group (order by x::float8)
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+ p | percentile_cont
+------+-----------------
+ 0 | 1
+ 0.1 | 1.4
+ 0.25 | 2
+ 0.4 | 2.6
+ 0.5 | 3
+ 0.6 | 3.4
+ 0.75 | 4
+ 0.9 | 4.6
+ 1 | 5
+(9 rows)
+
+select p, percentile_cont(p order by p) within group (order by x) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+ERROR: cannot use multiple ORDER BY clauses with WITHIN GROUP
+LINE 1: select p, percentile_cont(p order by p) within group (order ...
+ ^
+select p, sum() within group (order by x::float8) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+ERROR: sum is not an ordered-set aggregate, so it cannot have WITHIN GROUP
+LINE 1: select p, sum() within group (order by x::float8)
+ ^
+select p, percentile_cont(p,p) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+ERROR: WITHIN GROUP is required for ordered-set aggregate percentile_cont
+LINE 1: select p, percentile_cont(p,p)
+ ^
+select percentile_cont(0.5) within group (order by b) from aggtest;
+ percentile_cont
+------------------
+ 53.4485001564026
+(1 row)
+
+select percentile_cont(0.5) within group (order by b), sum(b) from aggtest;
+ percentile_cont | sum
+------------------+---------
+ 53.4485001564026 | 431.773
+(1 row)
+
+select percentile_cont(0.5) within group (order by thousand) from tenk1;
+ percentile_cont
+-----------------
+ 499.5
+(1 row)
+
+select percentile_disc(0.5) within group (order by thousand) from tenk1;
+ percentile_disc
+-----------------
+ 499
+(1 row)
+
+select rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+ rank
+------
+ 5
+(1 row)
+
+select cume_dist(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+ cume_dist
+-----------
+ 0.875
+(1 row)
+
+select percent_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4),(5)) v(x);
+ percent_rank
+--------------
+ 0.5
+(1 row)
+
+select dense_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+ dense_rank
+------------
+ 3
+(1 row)
+
+select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group (order by thousand)
+from tenk1;
+ percentile_disc
+----------------------------
+ {0,99,249,499,749,899,999}
+(1 row)
+
+select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by thousand)
+from tenk1;
+ percentile_cont
+-----------------------------
+ {0,249.75,499.5,749.25,999}
+(1 row)
+
+select percentile_disc(array[[null,1,0.5],[0.75,0.25,null]]) within group (order by thousand)
+from tenk1;
+ percentile_disc
+---------------------------------
+ {{NULL,999,499},{749,249,NULL}}
+(1 row)
+
+select percentile_cont(array[0,1,0.25,0.75,0.5,1,0.3,0.32,0.35,0.38,0.4]) within group (order by x)
+from generate_series(1,6) x;
+ percentile_cont
+------------------------------------------
+ {1,6,2.25,4.75,3.5,6,2.5,2.6,2.75,2.9,3}
+(1 row)
+
+select ten, mode() within group (order by string4) from tenk1 group by ten;
+ ten | mode
+-----+--------
+ 0 | HHHHxx
+ 1 | OOOOxx
+ 2 | VVVVxx
+ 3 | OOOOxx
+ 4 | HHHHxx
+ 5 | HHHHxx
+ 6 | OOOOxx
+ 7 | AAAAxx
+ 8 | VVVVxx
+ 9 | VVVVxx
+(10 rows)
+
+select percentile_disc(array[0.25,0.5,0.75]) within group (order by x)
+from unnest('{fred,jim,fred,jack,jill,fred,jill,jim,jim,sheila,jim,sheila}'::text[]) u(x);
+ percentile_disc
+-----------------
+ {fred,jill,jim}
+(1 row)
+
+-- check collation propagates up in suitable cases:
+select pg_collation_for(percentile_disc(1) within group (order by x collate "POSIX"))
+ from (values ('fred'),('jim')) v(x);
+ pg_collation_for
+------------------
+ "POSIX"
+(1 row)
+
+-- ordered-set aggs created with CREATE AGGREGATE
+select test_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+ test_rank
+-----------
+ 5
+(1 row)
+
+select test_percentile_disc(0.5) within group (order by thousand) from tenk1;
+ test_percentile_disc
+----------------------
+ 499
+(1 row)
+
+-- ordered-set aggs can't use ungrouped vars in direct args:
+select rank(x) within group (order by x) from generate_series(1,5) x;
+ERROR: column "x.x" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: select rank(x) within group (order by x) from generate_serie...
+ ^
+DETAIL: Direct arguments of an ordered-set aggregate must use only grouped columns.
+-- outer-level agg can't use a grouped arg of a lower level, either:
+select array(select percentile_disc(a) within group (order by x)
+ from (values (0.3),(0.7)) v(a) group by a)
+ from generate_series(1,5) g(x);
+ERROR: outer-level aggregate cannot contain a lower-level variable in its direct arguments
+LINE 1: select array(select percentile_disc(a) within group (order b...
+ ^
+-- agg in the direct args is a grouping violation, too:
+select rank(sum(x)) within group (order by x) from generate_series(1,5) x;
+ERROR: aggregate function calls cannot be nested
+LINE 1: select rank(sum(x)) within group (order by x) from generate_...
+ ^
+-- hypothetical-set type unification and argument-count failures:
+select rank(3) within group (order by x) from (values ('fred'),('jim')) v(x);
+ERROR: WITHIN GROUP types text and integer cannot be matched
+LINE 1: select rank(3) within group (order by x) from (values ('fred...
+ ^
+select rank(3) within group (order by stringu1,stringu2) from tenk1;
+ERROR: function rank(integer, name, name) does not exist
+LINE 1: select rank(3) within group (order by stringu1,stringu2) fro...
+ ^
+HINT: To use the hypothetical-set aggregate rank, the number of hypothetical direct arguments (here 1) must match the number of ordering columns (here 2).
+select rank('fred') within group (order by x) from generate_series(1,5) x;
+ERROR: invalid input syntax for type integer: "fred"
+LINE 1: select rank('fred') within group (order by x) from generate_...
+ ^
+select rank('adam'::text collate "C") within group (order by x collate "POSIX")
+ from (values ('fred'),('jim')) v(x);
+ERROR: collation mismatch between explicit collations "C" and "POSIX"
+LINE 1: ...adam'::text collate "C") within group (order by x collate "P...
+ ^
+-- hypothetical-set type unification successes:
+select rank('adam'::varchar) within group (order by x) from (values ('fred'),('jim')) v(x);
+ rank
+------
+ 1
+(1 row)
+
+select rank('3') within group (order by x) from generate_series(1,5) x;
+ rank
+------
+ 3
+(1 row)
+
+-- divide by zero check
+select percent_rank(0) within group (order by x) from generate_series(1,0) x;
+ percent_rank
+--------------
+ 0
+(1 row)
+
+-- deparse and multiple features:
+create view aggordview1 as
+select ten,
+ percentile_disc(0.5) within group (order by thousand) as p50,
+ percentile_disc(0.5) within group (order by thousand) filter (where hundred=1) as px,
+ rank(5,'AZZZZ',50) within group (order by hundred, string4 desc, hundred)
+ from tenk1
+ group by ten order by ten;
+select pg_get_viewdef('aggordview1');
+ pg_get_viewdef
+-------------------------------------------------------------------------------------------------------------------------------
+ SELECT tenk1.ten, +
+ percentile_disc((0.5)::double precision) WITHIN GROUP (ORDER BY tenk1.thousand) AS p50, +
+ percentile_disc((0.5)::double precision) WITHIN GROUP (ORDER BY tenk1.thousand) FILTER (WHERE (tenk1.hundred = 1)) AS px,+
+ rank(5, 'AZZZZ'::name, 50) WITHIN GROUP (ORDER BY tenk1.hundred, tenk1.string4 DESC, tenk1.hundred) AS rank +
+ FROM tenk1 +
+ GROUP BY tenk1.ten +
+ ORDER BY tenk1.ten;
+(1 row)
+
+select * from aggordview1 order by ten;
+ ten | p50 | px | rank
+-----+-----+-----+------
+ 0 | 490 | | 101
+ 1 | 491 | 401 | 101
+ 2 | 492 | | 101
+ 3 | 493 | | 101
+ 4 | 494 | | 101
+ 5 | 495 | | 67
+ 6 | 496 | | 1
+ 7 | 497 | | 1
+ 8 | 498 | | 1
+ 9 | 499 | | 1
+(10 rows)
+
+drop view aggordview1;
+-- variadic aggregates
+select least_agg(q1,q2) from int8_tbl;
+ least_agg
+-------------------
+ -4567890123456789
+(1 row)
+
+select least_agg(variadic array[q1,q2]) from int8_tbl;
+ least_agg
+-------------------
+ -4567890123456789
+(1 row)
+
+select cleast_agg(q1,q2) from int8_tbl;
+ cleast_agg
+-------------------
+ -4567890123456789
+(1 row)
+
+select cleast_agg(4.5,f1) from int4_tbl;
+ cleast_agg
+-------------
+ -2147483647
+(1 row)
+
+select cleast_agg(variadic array[4.5,f1]) from int4_tbl;
+ cleast_agg
+-------------
+ -2147483647
+(1 row)
+
+select pg_typeof(cleast_agg(variadic array[4.5,f1])) from int4_tbl;
+ pg_typeof
+-----------
+ numeric
+(1 row)
+
+-- test aggregates with common transition functions share the same states
+begin work;
+create type avg_state as (total bigint, count bigint);
+create or replace function avg_transfn(state avg_state, n int) returns avg_state as
+$$
+declare new_state avg_state;
+begin
+ raise notice 'avg_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state.total := n;
+ new_state.count := 1;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state.total := state.total + n;
+ state.count := state.count + 1;
+ return state;
+ end if;
+
+ return null;
+end
+$$ language plpgsql;
+create function avg_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total / state.count;
+ end if;
+end
+$$ language plpgsql;
+create function sum_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total;
+ end if;
+end
+$$ language plpgsql;
+create aggregate my_avg(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn
+);
+create aggregate my_sum(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn
+);
+-- aggregate state should be shared as aggs are the same.
+select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+ my_avg | my_avg
+--------+--------
+ 2 | 2
+(1 row)
+
+-- aggregate state should be shared as transfn is the same for both aggs.
+select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+ my_avg | my_sum
+--------+--------
+ 2 | 4
+(1 row)
+
+-- same as previous one, but with DISTINCT, which requires sorting the input.
+select my_avg(distinct one),my_sum(distinct one) from (values(1),(3),(1)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+ my_avg | my_sum
+--------+--------
+ 2 | 4
+(1 row)
+
+-- shouldn't share states due to the distinctness not matching.
+select my_avg(distinct one),my_sum(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+ my_avg | my_sum
+--------+--------
+ 2 | 4
+(1 row)
+
+-- shouldn't share states due to the filter clause not matching.
+select my_avg(one) filter (where one > 1),my_sum(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+NOTICE: avg_transfn called with 3
+ my_avg | my_sum
+--------+--------
+ 3 | 4
+(1 row)
+
+-- this should not share the state due to different input columns.
+select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 2
+NOTICE: avg_transfn called with 3
+NOTICE: avg_transfn called with 4
+ my_avg | my_sum
+--------+--------
+ 2 | 6
+(1 row)
+
+-- exercise cases where OSAs share state
+select
+ percentile_cont(0.5) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+ percentile_cont | percentile_disc
+-----------------+-----------------
+ 4 | 3
+(1 row)
+
+select
+ percentile_cont(0.25) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+ percentile_cont | percentile_disc
+-----------------+-----------------
+ 2.5 | 3
+(1 row)
+
+-- these can't share state currently
+select
+ rank(4) within group (order by a),
+ dense_rank(4) within group (order by a)
+from (values(1),(3),(5),(7)) t(a);
+ rank | dense_rank
+------+------------
+ 3 | 3
+(1 row)
+
+-- test that aggs with the same sfunc and initcond share the same agg state
+create aggregate my_sum_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn,
+ initcond = '(10,0)'
+);
+create aggregate my_avg_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(10,0)'
+);
+create aggregate my_avg_init2(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(4,0)'
+);
+-- state should be shared if INITCONDs are matching
+select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+ my_sum_init | my_avg_init
+-------------+-------------
+ 14 | 7
+(1 row)
+
+-- Varying INITCONDs should cause the states not to be shared.
+select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 1
+NOTICE: avg_transfn called with 3
+NOTICE: avg_transfn called with 3
+ my_sum_init | my_avg_init2
+-------------+--------------
+ 14 | 4
+(1 row)
+
+rollback;
+-- test aggregate state sharing to ensure it works if one aggregate has a
+-- finalfn and the other one has none.
+begin work;
+create or replace function sum_transfn(state int4, n int4) returns int4 as
+$$
+declare new_state int4;
+begin
+ raise notice 'sum_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state := n;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state := state + n;
+ return state;
+ end if;
+
+ return null;
+end
+$$ language plpgsql;
+create function halfsum_finalfn(state int4) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state / 2;
+ end if;
+end
+$$ language plpgsql;
+create aggregate my_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn
+);
+create aggregate my_half_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn,
+ finalfunc = halfsum_finalfn
+);
+-- Agg state should be shared even though my_sum has no finalfn
+select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+NOTICE: sum_transfn called with 1
+NOTICE: sum_transfn called with 2
+NOTICE: sum_transfn called with 3
+NOTICE: sum_transfn called with 4
+ my_sum | my_half_sum
+--------+-------------
+ 10 | 5
+(1 row)
+
+rollback;
+-- test that the aggregate transition logic correctly handles
+-- transition / combine functions returning NULL
+-- First test the case of a normal transition function returning NULL
+BEGIN;
+CREATE FUNCTION balkifnull(int8, int4)
+RETURNS int8
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = balkifnull(int8, int4),
+ STYPE = int8,
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+SELECT balk(hundred) FROM tenk1;
+ balk
+------
+
+(1 row)
+
+ROLLBACK;
+-- Secondly test the case of a parallel aggregate combiner function
+-- returning NULL. For that use normal transition function, but a
+-- combiner function returning NULL.
+BEGIN;
+CREATE FUNCTION balkifnull(int8, int8)
+RETURNS int8
+PARALLEL SAFE
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = int4_sum(int8, int4),
+ STYPE = int8,
+ COMBINEFUNC = balkifnull(int8, int8),
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+-- force use of parallelism
+ALTER TABLE tenk1 set (parallel_workers = 4);
+SET LOCAL parallel_setup_cost=0;
+SET LOCAL max_parallel_workers_per_gather=4;
+EXPLAIN (COSTS OFF) SELECT balk(hundred) FROM tenk1;
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Finalize Aggregate
+ -> Gather
+ Workers Planned: 4
+ -> Partial Aggregate
+ -> Parallel Index Only Scan using tenk1_hundred on tenk1
+(5 rows)
+
+SELECT balk(hundred) FROM tenk1;
+ balk
+------
+
+(1 row)
+
+ROLLBACK;
+-- test coverage for aggregate combine/serial/deserial functions
+BEGIN;
+SET parallel_setup_cost = 0;
+SET parallel_tuple_cost = 0;
+SET min_parallel_table_scan_size = 0;
+SET max_parallel_workers_per_gather = 4;
+SET parallel_leader_participation = off;
+SET enable_indexonlyscan = off;
+-- variance(int4) covers numeric_poly_combine
+-- sum(int8) covers int8_avg_combine
+-- regr_count(float8, float8) covers int8inc_float8_float8 and aggregates with > 1 arg
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Finalize Aggregate
+ Output: variance(tenk1.unique1), sum((tenk1.unique1)::bigint), regr_count((tenk1.unique1)::double precision, (tenk1.unique1)::double precision)
+ -> Gather
+ Output: (PARTIAL variance(tenk1.unique1)), (PARTIAL sum((tenk1.unique1)::bigint)), (PARTIAL regr_count((tenk1.unique1)::double precision, (tenk1.unique1)::double precision))
+ Workers Planned: 4
+ -> Partial Aggregate
+ Output: PARTIAL variance(tenk1.unique1), PARTIAL sum((tenk1.unique1)::bigint), PARTIAL regr_count((tenk1.unique1)::double precision, (tenk1.unique1)::double precision)
+ -> Parallel Append
+ -> Parallel Seq Scan on public.tenk1
+ Output: tenk1.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_1
+ Output: tenk1_1.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_2
+ Output: tenk1_2.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_3
+ Output: tenk1_3.unique1
+(16 rows)
+
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+ variance | sum | regr_count
+----------------------+-----------+------------
+ 8333541.588539713493 | 199980000 | 40000
+(1 row)
+
+-- variance(int8) covers numeric_combine
+-- avg(numeric) covers numeric_avg_combine
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------
+ Finalize Aggregate
+ Output: variance((tenk1.unique1)::bigint), avg((tenk1.unique1)::numeric)
+ -> Gather
+ Output: (PARTIAL variance((tenk1.unique1)::bigint)), (PARTIAL avg((tenk1.unique1)::numeric))
+ Workers Planned: 4
+ -> Partial Aggregate
+ Output: PARTIAL variance((tenk1.unique1)::bigint), PARTIAL avg((tenk1.unique1)::numeric)
+ -> Parallel Append
+ -> Parallel Seq Scan on public.tenk1
+ Output: tenk1.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_1
+ Output: tenk1_1.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_2
+ Output: tenk1_2.unique1
+ -> Parallel Seq Scan on public.tenk1 tenk1_3
+ Output: tenk1_3.unique1
+(16 rows)
+
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+ variance | avg
+----------------------+-----------------------
+ 8333541.588539713493 | 4999.5000000000000000
+(1 row)
+
+ROLLBACK;
+-- test coverage for dense_rank
+SELECT dense_rank(x) WITHIN GROUP (ORDER BY x) FROM (VALUES (1),(1),(2),(2),(3),(3)) v(x) GROUP BY (x) ORDER BY 1;
+ dense_rank
+------------
+ 1
+ 1
+ 1
+(3 rows)
+
+-- Ensure that the STRICT checks for aggregates does not take NULLness
+-- of ORDER BY columns into account. See bug report around
+-- 2a505161-2727-2473-7c46-591ed108ac52@email.cz
+SELECT min(x ORDER BY y) FROM (VALUES(1, NULL)) AS d(x,y);
+ min
+-----
+ 1
+(1 row)
+
+SELECT min(x ORDER BY y) FROM (VALUES(1, 2)) AS d(x,y);
+ min
+-----
+ 1
+(1 row)
+
+-- check collation-sensitive matching between grouping expressions
+select v||'a', case v||'a' when 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+ ?column? | case | count
+----------+------+-------
+ aa | 1 | 1
+ ba | 0 | 1
+(2 rows)
+
+select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+ ?column? | case | count
+----------+------+-------
+ aa | 1 | 1
+ ba | 0 | 1
+(2 rows)
+
+-- Make sure that generation of HashAggregate for uniqification purposes
+-- does not lead to array overflow due to unexpected duplicate hash keys
+-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
+set enable_memoize to off;
+explain (costs off)
+ select 1 from tenk1
+ where (hundred, thousand) in (select twothousand, twothousand from onek);
+ QUERY PLAN
+-------------------------------------------------------------
+ Hash Join
+ Hash Cond: (tenk1.hundred = onek.twothousand)
+ -> Seq Scan on tenk1
+ Filter: (hundred = thousand)
+ -> Hash
+ -> HashAggregate
+ Group Key: onek.twothousand, onek.twothousand
+ -> Seq Scan on onek
+(8 rows)
+
+reset enable_memoize;
+--
+-- Hash Aggregation Spill tests
+--
+set enable_sort=false;
+set work_mem='64kB';
+select unique1, count(*), sum(twothousand) from tenk1
+group by unique1
+having sum(fivethous) > 4975
+order by sum(twothousand);
+ unique1 | count | sum
+---------+-------+------
+ 4976 | 1 | 976
+ 4977 | 1 | 977
+ 4978 | 1 | 978
+ 4979 | 1 | 979
+ 4980 | 1 | 980
+ 4981 | 1 | 981
+ 4982 | 1 | 982
+ 4983 | 1 | 983
+ 4984 | 1 | 984
+ 4985 | 1 | 985
+ 4986 | 1 | 986
+ 4987 | 1 | 987
+ 4988 | 1 | 988
+ 4989 | 1 | 989
+ 4990 | 1 | 990
+ 4991 | 1 | 991
+ 4992 | 1 | 992
+ 4993 | 1 | 993
+ 4994 | 1 | 994
+ 4995 | 1 | 995
+ 4996 | 1 | 996
+ 4997 | 1 | 997
+ 4998 | 1 | 998
+ 4999 | 1 | 999
+ 9976 | 1 | 1976
+ 9977 | 1 | 1977
+ 9978 | 1 | 1978
+ 9979 | 1 | 1979
+ 9980 | 1 | 1980
+ 9981 | 1 | 1981
+ 9982 | 1 | 1982
+ 9983 | 1 | 1983
+ 9984 | 1 | 1984
+ 9985 | 1 | 1985
+ 9986 | 1 | 1986
+ 9987 | 1 | 1987
+ 9988 | 1 | 1988
+ 9989 | 1 | 1989
+ 9990 | 1 | 1990
+ 9991 | 1 | 1991
+ 9992 | 1 | 1992
+ 9993 | 1 | 1993
+ 9994 | 1 | 1994
+ 9995 | 1 | 1995
+ 9996 | 1 | 1996
+ 9997 | 1 | 1997
+ 9998 | 1 | 1998
+ 9999 | 1 | 1999
+(48 rows)
+
+set work_mem to default;
+set enable_sort to default;
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+set work_mem='64kB';
+create table agg_data_2k as
+select g from generate_series(0, 1999) g;
+analyze agg_data_2k;
+create table agg_data_20k as
+select g from generate_series(0, 19999) g;
+analyze agg_data_20k;
+-- Produce results with sorting.
+set enable_hashagg = false;
+set jit_above_cost = 0;
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+ QUERY PLAN
+--------------------------------------
+ GroupAggregate
+ Group Key: ((g % 10000))
+ -> Sort
+ Sort Key: ((g % 10000))
+ -> Seq Scan on agg_data_20k
+(5 rows)
+
+create table agg_group_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+create table agg_group_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+set jit_above_cost to default;
+create table agg_group_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+create table agg_group_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+-- Produce results with hash aggregation
+set enable_hashagg = true;
+set enable_sort = false;
+set jit_above_cost = 0;
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+ QUERY PLAN
+--------------------------------
+ HashAggregate
+ Group Key: (g % 10000)
+ -> Seq Scan on agg_data_20k
+(3 rows)
+
+create table agg_hash_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+create table agg_hash_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+set jit_above_cost to default;
+create table agg_hash_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+create table agg_hash_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+set enable_sort = true;
+set work_mem to default;
+-- Compare group aggregation results to hash aggregation results
+(select * from agg_hash_1 except select * from agg_group_1)
+ union all
+(select * from agg_group_1 except select * from agg_hash_1);
+ c1 | c2 | c3
+----+----+----
+(0 rows)
+
+(select * from agg_hash_2 except select * from agg_group_2)
+ union all
+(select * from agg_group_2 except select * from agg_hash_2);
+ a | c1 | c2 | c3
+---+----+----+----
+(0 rows)
+
+(select * from agg_hash_3 except select * from agg_group_3)
+ union all
+(select * from agg_group_3 except select * from agg_hash_3);
+ c1 | c2 | c3
+----+----+----
+(0 rows)
+
+(select * from agg_hash_4 except select * from agg_group_4)
+ union all
+(select * from agg_group_4 except select * from agg_hash_4);
+ c1 | c2 | c3
+----+----+----
+(0 rows)
+
+drop table agg_group_1;
+drop table agg_group_2;
+drop table agg_group_3;
+drop table agg_group_4;
+drop table agg_hash_1;
+drop table agg_hash_2;
+drop table agg_hash_3;
+drop table agg_hash_4;
diff --git a/yql/essentials/tests/postgresql/original/cases/aggregates.sql b/yql/essentials/tests/postgresql/original/cases/aggregates.sql
new file mode 100644
index 0000000000..7cf86465e9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/aggregates.sql
@@ -0,0 +1,1247 @@
+--
+-- AGGREGATES
+--
+
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+
+SELECT avg(four) AS avg_1 FROM onek;
+
+SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
+
+-- In 7.1, avg(float4) is computed using float8 arithmetic.
+-- Round the result to 3 digits to avoid platform-specific results.
+
+SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
+
+SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
+
+
+SELECT sum(four) AS sum_1500 FROM onek;
+SELECT sum(a) AS sum_198 FROM aggtest;
+SELECT sum(b) AS avg_431_773 FROM aggtest;
+SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
+
+SELECT max(four) AS max_3 FROM onek;
+SELECT max(a) AS max_100 FROM aggtest;
+SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
+SELECT max(student.gpa) AS max_3_7 FROM student;
+
+SELECT stddev_pop(b) FROM aggtest;
+SELECT stddev_samp(b) FROM aggtest;
+SELECT var_pop(b) FROM aggtest;
+SELECT var_samp(b) FROM aggtest;
+
+SELECT stddev_pop(b::numeric) FROM aggtest;
+SELECT stddev_samp(b::numeric) FROM aggtest;
+SELECT var_pop(b::numeric) FROM aggtest;
+SELECT var_samp(b::numeric) FROM aggtest;
+
+-- population variance is defined for a single tuple, sample variance
+-- is not
+SELECT var_pop(1.0::float8), var_samp(2.0::float8);
+SELECT stddev_pop(3.0::float8), stddev_samp(4.0::float8);
+SELECT var_pop('inf'::float8), var_samp('inf'::float8);
+SELECT stddev_pop('inf'::float8), stddev_samp('inf'::float8);
+SELECT var_pop('nan'::float8), var_samp('nan'::float8);
+SELECT stddev_pop('nan'::float8), stddev_samp('nan'::float8);
+SELECT var_pop(1.0::float4), var_samp(2.0::float4);
+SELECT stddev_pop(3.0::float4), stddev_samp(4.0::float4);
+SELECT var_pop('inf'::float4), var_samp('inf'::float4);
+SELECT stddev_pop('inf'::float4), stddev_samp('inf'::float4);
+SELECT var_pop('nan'::float4), var_samp('nan'::float4);
+SELECT stddev_pop('nan'::float4), stddev_samp('nan'::float4);
+SELECT var_pop(1.0::numeric), var_samp(2.0::numeric);
+SELECT stddev_pop(3.0::numeric), stddev_samp(4.0::numeric);
+SELECT var_pop('inf'::numeric), var_samp('inf'::numeric);
+SELECT stddev_pop('inf'::numeric), stddev_samp('inf'::numeric);
+SELECT var_pop('nan'::numeric), var_samp('nan'::numeric);
+SELECT stddev_pop('nan'::numeric), stddev_samp('nan'::numeric);
+
+-- verify correct results for null and NaN inputs
+select sum(null::int4) from generate_series(1,3);
+select sum(null::int8) from generate_series(1,3);
+select sum(null::numeric) from generate_series(1,3);
+select sum(null::float8) from generate_series(1,3);
+select avg(null::int4) from generate_series(1,3);
+select avg(null::int8) from generate_series(1,3);
+select avg(null::numeric) from generate_series(1,3);
+select avg(null::float8) from generate_series(1,3);
+select sum('NaN'::numeric) from generate_series(1,3);
+select avg('NaN'::numeric) from generate_series(1,3);
+
+-- verify correct results for infinite inputs
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('1'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('1')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+SELECT sum(x::float8), avg(x::float8), var_pop(x::float8)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('1'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('1')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('infinity'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('infinity')) v(x);
+SELECT sum(x::numeric), avg(x::numeric), var_pop(x::numeric)
+FROM (VALUES ('-infinity'), ('-infinity')) v(x);
+
+-- test accuracy with a large input offset
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x);
+SELECT avg(x::float8), var_pop(x::float8)
+FROM (VALUES (7000000000005), (7000000000007)) v(x);
+
+-- SQL2003 binary aggregates
+SELECT regr_count(b, a) FROM aggtest;
+SELECT regr_sxx(b, a) FROM aggtest;
+SELECT regr_syy(b, a) FROM aggtest;
+SELECT regr_sxy(b, a) FROM aggtest;
+SELECT regr_avgx(b, a), regr_avgy(b, a) FROM aggtest;
+SELECT regr_r2(b, a) FROM aggtest;
+SELECT regr_slope(b, a), regr_intercept(b, a) FROM aggtest;
+SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest;
+SELECT corr(b, a) FROM aggtest;
+
+-- check single-tuple behavior
+SELECT covar_pop(1::float8,2::float8), covar_samp(3::float8,4::float8);
+SELECT covar_pop(1::float8,'inf'::float8), covar_samp(3::float8,'inf'::float8);
+SELECT covar_pop(1::float8,'nan'::float8), covar_samp(3::float8,'nan'::float8);
+
+-- test accum and combine functions directly
+CREATE TABLE regr_test (x float8, y float8);
+INSERT INTO regr_test VALUES (10,150),(20,250),(30,350),(80,540),(100,200);
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30,80);
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test;
+SELECT float8_accum('{4,140,2900}'::float8[], 100);
+SELECT float8_regr_accum('{4,140,2900,1290,83075,15050}'::float8[], 200, 100);
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (10,20,30);
+SELECT count(*), sum(x), regr_sxx(y,x), sum(y),regr_syy(y,x), regr_sxy(y,x)
+FROM regr_test WHERE x IN (80,100);
+SELECT float8_combine('{3,60,200}'::float8[], '{0,0,0}'::float8[]);
+SELECT float8_combine('{0,0,0}'::float8[], '{2,180,200}'::float8[]);
+SELECT float8_combine('{3,60,200}'::float8[], '{2,180,200}'::float8[]);
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{0,0,0,0,0,0}'::float8[]);
+SELECT float8_regr_combine('{0,0,0,0,0,0}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+SELECT float8_regr_combine('{3,60,200,750,20000,2000}'::float8[],
+ '{2,180,200,740,57800,-3400}'::float8[]);
+DROP TABLE regr_test;
+
+-- test count, distinct
+SELECT count(four) AS cnt_1000 FROM onek;
+SELECT count(DISTINCT four) AS cnt_4 FROM onek;
+
+select ten, count(*), sum(four) from onek
+group by ten order by ten;
+
+select ten, count(four), sum(DISTINCT four) from onek
+group by ten order by ten;
+
+-- user-defined aggregates
+SELECT newavg(four) AS avg_1 FROM onek;
+SELECT newsum(four) AS sum_1500 FROM onek;
+SELECT newcnt(four) AS cnt_1000 FROM onek;
+SELECT newcnt(*) AS cnt_1000 FROM onek;
+SELECT oldcnt(*) AS cnt_1000 FROM onek;
+SELECT sum2(q1,q2) FROM int8_tbl;
+
+-- test for outer-level aggregates
+
+-- this should work
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+
+-- this should fail because subquery has an agg of its own in WHERE
+select ten, sum(distinct four) from onek a
+group by ten
+having exists (select 1 from onek b
+ where sum(distinct a.four + b.four) = b.four);
+
+-- Test handling of sublinks within outer-level aggregates.
+-- Per bug report from Daniel Grace.
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
+from tenk1 o;
+
+-- Test handling of Params within aggregate arguments in hashed aggregation.
+-- Per bug report from Jeevan Chalke.
+explain (verbose, costs off)
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+select s1, s2, sm
+from generate_series(1, 3) s1,
+ lateral (select s2, sum(s1 + s2) sm
+ from generate_series(1, 3) s2 group by s2) ss
+order by 1, 2;
+
+explain (verbose, costs off)
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+select array(select sum(x+y) s
+ from generate_series(1,3) y group by y order by s)
+ from generate_series(1,3) x;
+
+--
+-- test for bitwise integer aggregates
+--
+CREATE TEMPORARY TABLE bitwise_test(
+ i2 INT2,
+ i4 INT4,
+ i8 INT8,
+ i INTEGER,
+ x INT2,
+ y BIT(4)
+);
+
+-- empty case
+SELECT
+ BIT_AND(i2) AS "?",
+ BIT_OR(i4) AS "?",
+ BIT_XOR(i8) AS "?"
+FROM bitwise_test;
+
+COPY bitwise_test FROM STDIN NULL 'null';
+1 1 1 1 1 B0101
+3 3 3 null 2 B0100
+7 7 7 3 4 B1100
+\.
+
+SELECT
+ BIT_AND(i2) AS "1",
+ BIT_AND(i4) AS "1",
+ BIT_AND(i8) AS "1",
+ BIT_AND(i) AS "?",
+ BIT_AND(x) AS "0",
+ BIT_AND(y) AS "0100",
+
+ BIT_OR(i2) AS "7",
+ BIT_OR(i4) AS "7",
+ BIT_OR(i8) AS "7",
+ BIT_OR(i) AS "?",
+ BIT_OR(x) AS "7",
+ BIT_OR(y) AS "1101",
+
+ BIT_XOR(i2) AS "5",
+ BIT_XOR(i4) AS "5",
+ BIT_XOR(i8) AS "5",
+ BIT_XOR(i) AS "?",
+ BIT_XOR(x) AS "7",
+ BIT_XOR(y) AS "1101"
+FROM bitwise_test;
+
+--
+-- test boolean aggregates
+--
+-- first test all possible transition and final states
+
+SELECT
+ -- boolean and transitions
+ -- null because strict
+ booland_statefunc(NULL, NULL) IS NULL AS "t",
+ booland_statefunc(TRUE, NULL) IS NULL AS "t",
+ booland_statefunc(FALSE, NULL) IS NULL AS "t",
+ booland_statefunc(NULL, TRUE) IS NULL AS "t",
+ booland_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- and actual computations
+ booland_statefunc(TRUE, TRUE) AS "t",
+ NOT booland_statefunc(TRUE, FALSE) AS "t",
+ NOT booland_statefunc(FALSE, TRUE) AS "t",
+ NOT booland_statefunc(FALSE, FALSE) AS "t";
+
+SELECT
+ -- boolean or transitions
+ -- null because strict
+ boolor_statefunc(NULL, NULL) IS NULL AS "t",
+ boolor_statefunc(TRUE, NULL) IS NULL AS "t",
+ boolor_statefunc(FALSE, NULL) IS NULL AS "t",
+ boolor_statefunc(NULL, TRUE) IS NULL AS "t",
+ boolor_statefunc(NULL, FALSE) IS NULL AS "t",
+ -- actual computations
+ boolor_statefunc(TRUE, TRUE) AS "t",
+ boolor_statefunc(TRUE, FALSE) AS "t",
+ boolor_statefunc(FALSE, TRUE) AS "t",
+ NOT boolor_statefunc(FALSE, FALSE) AS "t";
+
+CREATE TEMPORARY TABLE bool_test(
+ b1 BOOL,
+ b2 BOOL,
+ b3 BOOL,
+ b4 BOOL);
+
+-- empty case
+SELECT
+ BOOL_AND(b1) AS "n",
+ BOOL_OR(b3) AS "n"
+FROM bool_test;
+
+COPY bool_test FROM STDIN NULL 'null';
+TRUE null FALSE null
+FALSE TRUE null null
+null TRUE FALSE null
+\.
+
+SELECT
+ BOOL_AND(b1) AS "f",
+ BOOL_AND(b2) AS "t",
+ BOOL_AND(b3) AS "f",
+ BOOL_AND(b4) AS "n",
+ BOOL_AND(NOT b2) AS "f",
+ BOOL_AND(NOT b3) AS "t"
+FROM bool_test;
+
+SELECT
+ EVERY(b1) AS "f",
+ EVERY(b2) AS "t",
+ EVERY(b3) AS "f",
+ EVERY(b4) AS "n",
+ EVERY(NOT b2) AS "f",
+ EVERY(NOT b3) AS "t"
+FROM bool_test;
+
+SELECT
+ BOOL_OR(b1) AS "t",
+ BOOL_OR(b2) AS "t",
+ BOOL_OR(b3) AS "f",
+ BOOL_OR(b4) AS "n",
+ BOOL_OR(NOT b2) AS "f",
+ BOOL_OR(NOT b3) AS "t"
+FROM bool_test;
+
+--
+-- Test cases that should be optimized into indexscans instead of
+-- the generic aggregate implementation.
+--
+
+-- Basic cases
+explain (costs off)
+ select min(unique1) from tenk1;
+select min(unique1) from tenk1;
+explain (costs off)
+ select max(unique1) from tenk1;
+select max(unique1) from tenk1;
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 < 42;
+select max(unique1) from tenk1 where unique1 < 42;
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42;
+select max(unique1) from tenk1 where unique1 > 42;
+
+-- the planner may choose a generic aggregate here if parallel query is
+-- enabled, since that plan will be parallel safe and the "optimized"
+-- plan, which has almost identical cost, will not be. we want to test
+-- the optimized plan, so temporarily disable parallel query.
+begin;
+set local max_parallel_workers_per_gather = 0;
+explain (costs off)
+ select max(unique1) from tenk1 where unique1 > 42000;
+select max(unique1) from tenk1 where unique1 > 42000;
+rollback;
+
+-- multi-column index (uses tenk1_thous_tenthous)
+explain (costs off)
+ select max(tenthous) from tenk1 where thousand = 33;
+select max(tenthous) from tenk1 where thousand = 33;
+explain (costs off)
+ select min(tenthous) from tenk1 where thousand = 33;
+select min(tenthous) from tenk1 where thousand = 33;
+
+-- check parameter propagation into an indexscan subquery
+explain (costs off)
+ select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
+ from int4_tbl;
+
+-- check some cases that were handled incorrectly in 8.3.0
+explain (costs off)
+ select distinct max(unique2) from tenk1;
+select distinct max(unique2) from tenk1;
+explain (costs off)
+ select max(unique2) from tenk1 order by 1;
+select max(unique2) from tenk1 order by 1;
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2);
+select max(unique2) from tenk1 order by max(unique2);
+explain (costs off)
+ select max(unique2) from tenk1 order by max(unique2)+1;
+select max(unique2) from tenk1 order by max(unique2)+1;
+explain (costs off)
+ select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
+
+-- interesting corner case: constant gets optimized into a seqscan
+explain (costs off)
+ select max(100) from tenk1;
+select max(100) from tenk1;
+
+-- try it on an inheritance tree
+create table minmaxtest(f1 int);
+create table minmaxtest1() inherits (minmaxtest);
+create table minmaxtest2() inherits (minmaxtest);
+create table minmaxtest3() inherits (minmaxtest);
+create index minmaxtesti on minmaxtest(f1);
+create index minmaxtest1i on minmaxtest1(f1);
+create index minmaxtest2i on minmaxtest2(f1 desc);
+create index minmaxtest3i on minmaxtest3(f1) where f1 is not null;
+
+insert into minmaxtest values(11), (12);
+insert into minmaxtest1 values(13), (14);
+insert into minmaxtest2 values(15), (16);
+insert into minmaxtest3 values(17), (18);
+
+explain (costs off)
+ select min(f1), max(f1) from minmaxtest;
+select min(f1), max(f1) from minmaxtest;
+
+-- DISTINCT doesn't do anything useful here, but it shouldn't fail
+explain (costs off)
+ select distinct min(f1), max(f1) from minmaxtest;
+select distinct min(f1), max(f1) from minmaxtest;
+
+drop table minmaxtest cascade;
+
+-- check for correct detection of nested-aggregate errors
+select max(min(unique1)) from tenk1;
+select (select max(min(unique1)) from int8_tbl) from tenk1;
+
+--
+-- Test removal of redundant GROUP BY columns
+--
+
+create temp table t1 (a int, b int, c int, d int, primary key (a, b));
+create temp table t2 (x int, y int, z int, primary key (x, y));
+create temp table t3 (a int, b int, c int, primary key(a, b) deferrable);
+
+-- Non-primary-key columns can be removed from GROUP BY
+explain (costs off) select * from t1 group by a,b,c,d;
+
+-- No removal can happen if the complete PK is not present in GROUP BY
+explain (costs off) select a,c from t1 group by a,c,d;
+
+-- Test removal across multiple relations
+explain (costs off) select *
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.y,t2.z;
+
+-- Test case where t1 can be optimized but not t2
+explain (costs off) select t1.*,t2.x,t2.z
+from t1 inner join t2 on t1.a = t2.x and t1.b = t2.y
+group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.z;
+
+-- Cannot optimize when PK is deferrable
+explain (costs off) select * from t3 group by a,b,c;
+
+create temp table t1c () inherits (t1);
+
+-- Ensure we don't remove any columns when t1 has a child table
+explain (costs off) select * from t1 group by a,b,c,d;
+
+-- Okay to remove columns if we're only querying the parent.
+explain (costs off) select * from only t1 group by a,b,c,d;
+
+create temp table p_t1 (
+ a int,
+ b int,
+ c int,
+ d int,
+ primary key(a,b)
+) partition by list(a);
+create temp table p_t1_1 partition of p_t1 for values in(1);
+create temp table p_t1_2 partition of p_t1 for values in(2);
+
+-- Ensure we can remove non-PK columns for partitioned tables.
+explain (costs off) select * from p_t1 group by a,b,c,d;
+
+drop table t1 cascade;
+drop table t2;
+drop table t3;
+drop table p_t1;
+
+--
+-- Test GROUP BY matching of join columns that are type-coerced due to USING
+--
+
+create temp table t1(f1 int, f2 bigint);
+create temp table t2(f1 bigint, f22 bigint);
+
+select f1 from t1 left join t2 using (f1) group by f1;
+select f1 from t1 left join t2 using (f1) group by t1.f1;
+select t1.f1 from t1 left join t2 using (f1) group by t1.f1;
+-- only this one should fail:
+select t1.f1 from t1 left join t2 using (f1) group by f1;
+
+drop table t1, t2;
+
+--
+-- Test combinations of DISTINCT and/or ORDER BY
+--
+
+select array_agg(a order by b)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+select array_agg(a order by a)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+select array_agg(a order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+select array_agg(b order by a desc)
+ from (values (1,4),(2,3),(3,1),(4,2)) v(a,b);
+
+select array_agg(distinct a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+select array_agg(distinct a order by a)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+select array_agg(distinct a order by a desc)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+select array_agg(distinct a order by a desc nulls last)
+ from (values (1),(2),(1),(3),(null),(2)) v(a);
+
+-- multi-arg aggs, strict/nonstrict, distinct/order by
+
+select aggfstr(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+
+select aggfstr(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+
+select aggfstr(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+
+-- test specific code paths
+
+select aggfns(distinct a,a,c order by c using ~<~,a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+select aggfns(distinct a,a,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+select aggfns(distinct a,a,c order by a)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+
+-- check node I/O via view creation and usage, also deparsing logic
+
+create view agg_view1 as
+ select aggfns(a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,3) i;
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by b+1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(a,a,c order by b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(a,b,c order by c using ~<~)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+create or replace view agg_view1 as
+ select aggfns(distinct a,b,c order by a,c using ~<~,b)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+
+select * from agg_view1;
+select pg_get_viewdef('agg_view1'::regclass);
+
+drop view agg_view1;
+
+-- incorrect DISTINCT usage errors
+
+select aggfns(distinct a,b,c order by i)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+select aggfns(distinct a,b,c order by a,b+1)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+select aggfns(distinct a,b,c order by a,b,i,c)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+select aggfns(distinct a,a,c order by a,b)
+ from (values (1,1,'foo')) v(a,b,c), generate_series(1,2) i;
+
+-- string_agg tests
+select string_agg(a,',') from (values('aaaa'),('bbbb'),('cccc')) g(a);
+select string_agg(a,',') from (values('aaaa'),(null),('bbbb'),('cccc')) g(a);
+select string_agg(a,'AB') from (values(null),(null),('bbbb'),('cccc')) g(a);
+select string_agg(a,',') from (values(null),(null)) g(a);
+
+-- check some implicit casting cases, as per bug #5564
+select string_agg(distinct f1, ',' order by f1) from varchar_tbl; -- ok
+select string_agg(distinct f1::text, ',' order by f1) from varchar_tbl; -- not ok
+select string_agg(distinct f1, ',' order by f1::text) from varchar_tbl; -- not ok
+select string_agg(distinct f1::text, ',' order by f1::text) from varchar_tbl; -- ok
+
+-- string_agg bytea tests
+create table bytea_test_table(v bytea);
+
+select string_agg(v, '') from bytea_test_table;
+
+insert into bytea_test_table values(decode('ff','hex'));
+
+select string_agg(v, '') from bytea_test_table;
+
+insert into bytea_test_table values(decode('aa','hex'));
+
+select string_agg(v, '') from bytea_test_table;
+select string_agg(v, NULL) from bytea_test_table;
+select string_agg(v, decode('ee', 'hex')) from bytea_test_table;
+
+drop table bytea_test_table;
+
+-- FILTER tests
+
+select min(unique1) filter (where unique1 > 100) from tenk1;
+
+select sum(1/ten) filter (where ten > 0) from tenk1;
+
+select ten, sum(distinct four) filter (where four::text ~ '123') from onek a
+group by ten;
+
+select ten, sum(distinct four) filter (where four > 10) from onek a
+group by ten
+having exists (select 1 from onek b where sum(distinct a.four) = b.four);
+
+select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0')
+from (values ('a', 'b')) AS v(foo,bar);
+
+-- outer reference in FILTER (PostgreSQL extension)
+select (select count(*)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+select (select count(*) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- outer query is aggregation query
+select (select count(inner_c) filter (where outer_c <> 0)
+ from (values (1)) t0(inner_c))
+from (values (2),(3)) t1(outer_c); -- inner query is aggregation query
+select
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1))
+ filter (where o.unique1 < 10))
+from tenk1 o; -- outer query is aggregation query
+
+-- subquery in FILTER clause (PostgreSQL extension)
+select sum(unique1) FILTER (WHERE
+ unique1 IN (SELECT unique1 FROM onek where unique1 < 100)) FROM tenk1;
+
+-- exercise lots of aggregate parts with FILTER
+select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
+ from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c),
+ generate_series(1,2) i;
+
+-- check handling of bare boolean Var in FILTER
+select max(0) filter (where b1) from bool_test;
+select (select max(0) filter (where b1)) from bool_test;
+
+-- check for correct detection of nested-aggregate errors in FILTER
+select max(unique1) filter (where sum(ten) > 0) from tenk1;
+select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
+select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
+select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
+
+
+-- ordered-set aggregates
+
+select p, percentile_cont(p) within group (order by x::float8)
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+
+select p, percentile_cont(p order by p) within group (order by x) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+
+select p, sum() within group (order by x::float8) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+
+select p, percentile_cont(p,p) -- error
+from generate_series(1,5) x,
+ (values (0::float8),(0.1),(0.25),(0.4),(0.5),(0.6),(0.75),(0.9),(1)) v(p)
+group by p order by p;
+
+select percentile_cont(0.5) within group (order by b) from aggtest;
+select percentile_cont(0.5) within group (order by b), sum(b) from aggtest;
+select percentile_cont(0.5) within group (order by thousand) from tenk1;
+select percentile_disc(0.5) within group (order by thousand) from tenk1;
+select rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+select cume_dist(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+select percent_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4),(5)) v(x);
+select dense_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+
+select percentile_disc(array[0,0.1,0.25,0.5,0.75,0.9,1]) within group (order by thousand)
+from tenk1;
+select percentile_cont(array[0,0.25,0.5,0.75,1]) within group (order by thousand)
+from tenk1;
+select percentile_disc(array[[null,1,0.5],[0.75,0.25,null]]) within group (order by thousand)
+from tenk1;
+select percentile_cont(array[0,1,0.25,0.75,0.5,1,0.3,0.32,0.35,0.38,0.4]) within group (order by x)
+from generate_series(1,6) x;
+
+select ten, mode() within group (order by string4) from tenk1 group by ten;
+
+select percentile_disc(array[0.25,0.5,0.75]) within group (order by x)
+from unnest('{fred,jim,fred,jack,jill,fred,jill,jim,jim,sheila,jim,sheila}'::text[]) u(x);
+
+-- check collation propagates up in suitable cases:
+select pg_collation_for(percentile_disc(1) within group (order by x collate "POSIX"))
+ from (values ('fred'),('jim')) v(x);
+
+-- ordered-set aggs created with CREATE AGGREGATE
+select test_rank(3) within group (order by x)
+from (values (1),(1),(2),(2),(3),(3),(4)) v(x);
+select test_percentile_disc(0.5) within group (order by thousand) from tenk1;
+
+-- ordered-set aggs can't use ungrouped vars in direct args:
+select rank(x) within group (order by x) from generate_series(1,5) x;
+
+-- outer-level agg can't use a grouped arg of a lower level, either:
+select array(select percentile_disc(a) within group (order by x)
+ from (values (0.3),(0.7)) v(a) group by a)
+ from generate_series(1,5) g(x);
+
+-- agg in the direct args is a grouping violation, too:
+select rank(sum(x)) within group (order by x) from generate_series(1,5) x;
+
+-- hypothetical-set type unification and argument-count failures:
+select rank(3) within group (order by x) from (values ('fred'),('jim')) v(x);
+select rank(3) within group (order by stringu1,stringu2) from tenk1;
+select rank('fred') within group (order by x) from generate_series(1,5) x;
+select rank('adam'::text collate "C") within group (order by x collate "POSIX")
+ from (values ('fred'),('jim')) v(x);
+-- hypothetical-set type unification successes:
+select rank('adam'::varchar) within group (order by x) from (values ('fred'),('jim')) v(x);
+select rank('3') within group (order by x) from generate_series(1,5) x;
+
+-- divide by zero check
+select percent_rank(0) within group (order by x) from generate_series(1,0) x;
+
+-- deparse and multiple features:
+create view aggordview1 as
+select ten,
+ percentile_disc(0.5) within group (order by thousand) as p50,
+ percentile_disc(0.5) within group (order by thousand) filter (where hundred=1) as px,
+ rank(5,'AZZZZ',50) within group (order by hundred, string4 desc, hundred)
+ from tenk1
+ group by ten order by ten;
+
+select pg_get_viewdef('aggordview1');
+select * from aggordview1 order by ten;
+drop view aggordview1;
+
+-- variadic aggregates
+select least_agg(q1,q2) from int8_tbl;
+select least_agg(variadic array[q1,q2]) from int8_tbl;
+
+select cleast_agg(q1,q2) from int8_tbl;
+select cleast_agg(4.5,f1) from int4_tbl;
+select cleast_agg(variadic array[4.5,f1]) from int4_tbl;
+select pg_typeof(cleast_agg(variadic array[4.5,f1])) from int4_tbl;
+
+-- test aggregates with common transition functions share the same states
+begin work;
+
+create type avg_state as (total bigint, count bigint);
+
+create or replace function avg_transfn(state avg_state, n int) returns avg_state as
+$$
+declare new_state avg_state;
+begin
+ raise notice 'avg_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state.total := n;
+ new_state.count := 1;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state.total := state.total + n;
+ state.count := state.count + 1;
+ return state;
+ end if;
+
+ return null;
+end
+$$ language plpgsql;
+
+create function avg_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total / state.count;
+ end if;
+end
+$$ language plpgsql;
+
+create function sum_finalfn(state avg_state) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state.total;
+ end if;
+end
+$$ language plpgsql;
+
+create aggregate my_avg(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn
+);
+
+create aggregate my_sum(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn
+);
+
+-- aggregate state should be shared as aggs are the same.
+select my_avg(one),my_avg(one) from (values(1),(3)) t(one);
+
+-- aggregate state should be shared as transfn is the same for both aggs.
+select my_avg(one),my_sum(one) from (values(1),(3)) t(one);
+
+-- same as previous one, but with DISTINCT, which requires sorting the input.
+select my_avg(distinct one),my_sum(distinct one) from (values(1),(3),(1)) t(one);
+
+-- shouldn't share states due to the distinctness not matching.
+select my_avg(distinct one),my_sum(one) from (values(1),(3)) t(one);
+
+-- shouldn't share states due to the filter clause not matching.
+select my_avg(one) filter (where one > 1),my_sum(one) from (values(1),(3)) t(one);
+
+-- this should not share the state due to different input columns.
+select my_avg(one),my_sum(two) from (values(1,2),(3,4)) t(one,two);
+
+-- exercise cases where OSAs share state
+select
+ percentile_cont(0.5) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+
+select
+ percentile_cont(0.25) within group (order by a),
+ percentile_disc(0.5) within group (order by a)
+from (values(1::float8),(3),(5),(7)) t(a);
+
+-- these can't share state currently
+select
+ rank(4) within group (order by a),
+ dense_rank(4) within group (order by a)
+from (values(1),(3),(5),(7)) t(a);
+
+-- test that aggs with the same sfunc and initcond share the same agg state
+create aggregate my_sum_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = sum_finalfn,
+ initcond = '(10,0)'
+);
+
+create aggregate my_avg_init(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(10,0)'
+);
+
+create aggregate my_avg_init2(int4)
+(
+ stype = avg_state,
+ sfunc = avg_transfn,
+ finalfunc = avg_finalfn,
+ initcond = '(4,0)'
+);
+
+-- state should be shared if INITCONDs are matching
+select my_sum_init(one),my_avg_init(one) from (values(1),(3)) t(one);
+
+-- Varying INITCONDs should cause the states not to be shared.
+select my_sum_init(one),my_avg_init2(one) from (values(1),(3)) t(one);
+
+rollback;
+
+-- test aggregate state sharing to ensure it works if one aggregate has a
+-- finalfn and the other one has none.
+begin work;
+
+create or replace function sum_transfn(state int4, n int4) returns int4 as
+$$
+declare new_state int4;
+begin
+ raise notice 'sum_transfn called with %', n;
+ if state is null then
+ if n is not null then
+ new_state := n;
+ return new_state;
+ end if;
+ return null;
+ elsif n is not null then
+ state := state + n;
+ return state;
+ end if;
+
+ return null;
+end
+$$ language plpgsql;
+
+create function halfsum_finalfn(state int4) returns int4 as
+$$
+begin
+ if state is null then
+ return NULL;
+ else
+ return state / 2;
+ end if;
+end
+$$ language plpgsql;
+
+create aggregate my_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn
+);
+
+create aggregate my_half_sum(int4)
+(
+ stype = int4,
+ sfunc = sum_transfn,
+ finalfunc = halfsum_finalfn
+);
+
+-- Agg state should be shared even though my_sum has no finalfn
+select my_sum(one),my_half_sum(one) from (values(1),(2),(3),(4)) t(one);
+
+rollback;
+
+
+-- test that the aggregate transition logic correctly handles
+-- transition / combine functions returning NULL
+
+-- First test the case of a normal transition function returning NULL
+BEGIN;
+CREATE FUNCTION balkifnull(int8, int4)
+RETURNS int8
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = balkifnull(int8, int4),
+ STYPE = int8,
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+
+SELECT balk(hundred) FROM tenk1;
+
+ROLLBACK;
+
+-- Secondly test the case of a parallel aggregate combiner function
+-- returning NULL. For that use normal transition function, but a
+-- combiner function returning NULL.
+BEGIN;
+CREATE FUNCTION balkifnull(int8, int8)
+RETURNS int8
+PARALLEL SAFE
+STRICT
+LANGUAGE plpgsql AS $$
+BEGIN
+ IF $1 IS NULL THEN
+ RAISE 'erroneously called with NULL argument';
+ END IF;
+ RETURN NULL;
+END$$;
+
+CREATE AGGREGATE balk(int4)
+(
+ SFUNC = int4_sum(int8, int4),
+ STYPE = int8,
+ COMBINEFUNC = balkifnull(int8, int8),
+ PARALLEL = SAFE,
+ INITCOND = '0'
+);
+
+-- force use of parallelism
+ALTER TABLE tenk1 set (parallel_workers = 4);
+SET LOCAL parallel_setup_cost=0;
+SET LOCAL max_parallel_workers_per_gather=4;
+
+EXPLAIN (COSTS OFF) SELECT balk(hundred) FROM tenk1;
+SELECT balk(hundred) FROM tenk1;
+
+ROLLBACK;
+
+-- test coverage for aggregate combine/serial/deserial functions
+BEGIN;
+
+SET parallel_setup_cost = 0;
+SET parallel_tuple_cost = 0;
+SET min_parallel_table_scan_size = 0;
+SET max_parallel_workers_per_gather = 4;
+SET parallel_leader_participation = off;
+SET enable_indexonlyscan = off;
+
+-- variance(int4) covers numeric_poly_combine
+-- sum(int8) covers int8_avg_combine
+-- regr_count(float8, float8) covers int8inc_float8_float8 and aggregates with > 1 arg
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+
+SELECT variance(unique1::int4), sum(unique1::int8), regr_count(unique1::float8, unique1::float8)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+
+-- variance(int8) covers numeric_combine
+-- avg(numeric) covers numeric_avg_combine
+EXPLAIN (COSTS OFF, VERBOSE)
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+
+SELECT variance(unique1::int8), avg(unique1::numeric)
+FROM (SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1
+ UNION ALL SELECT * FROM tenk1) u;
+
+ROLLBACK;
+
+-- test coverage for dense_rank
+SELECT dense_rank(x) WITHIN GROUP (ORDER BY x) FROM (VALUES (1),(1),(2),(2),(3),(3)) v(x) GROUP BY (x) ORDER BY 1;
+
+
+-- Ensure that the STRICT checks for aggregates does not take NULLness
+-- of ORDER BY columns into account. See bug report around
+-- 2a505161-2727-2473-7c46-591ed108ac52@email.cz
+SELECT min(x ORDER BY y) FROM (VALUES(1, NULL)) AS d(x,y);
+SELECT min(x ORDER BY y) FROM (VALUES(1, 2)) AS d(x,y);
+
+-- check collation-sensitive matching between grouping expressions
+select v||'a', case v||'a' when 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
+ from unnest(array['a','b']) u(v)
+ group by v||'a' order by 1;
+
+-- Make sure that generation of HashAggregate for uniqification purposes
+-- does not lead to array overflow due to unexpected duplicate hash keys
+-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
+set enable_memoize to off;
+explain (costs off)
+ select 1 from tenk1
+ where (hundred, thousand) in (select twothousand, twothousand from onek);
+reset enable_memoize;
+
+--
+-- Hash Aggregation Spill tests
+--
+
+set enable_sort=false;
+set work_mem='64kB';
+
+select unique1, count(*), sum(twothousand) from tenk1
+group by unique1
+having sum(fivethous) > 4975
+order by sum(twothousand);
+
+set work_mem to default;
+set enable_sort to default;
+
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+
+set work_mem='64kB';
+
+create table agg_data_2k as
+select g from generate_series(0, 1999) g;
+analyze agg_data_2k;
+
+create table agg_data_20k as
+select g from generate_series(0, 19999) g;
+analyze agg_data_20k;
+
+-- Produce results with sorting.
+
+set enable_hashagg = false;
+
+set jit_above_cost = 0;
+
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+
+create table agg_group_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+
+create table agg_group_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+
+set jit_above_cost to default;
+
+create table agg_group_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+
+create table agg_group_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+
+-- Produce results with hash aggregation
+
+set enable_hashagg = true;
+set enable_sort = false;
+
+set jit_above_cost = 0;
+
+explain (costs off)
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+
+create table agg_hash_1 as
+select g%10000 as c1, sum(g::numeric) as c2, count(*) as c3
+ from agg_data_20k group by g%10000;
+
+create table agg_hash_2 as
+select * from
+ (values (100), (300), (500)) as r(a),
+ lateral (
+ select (g/2)::numeric as c1,
+ array_agg(g::numeric) as c2,
+ count(*) as c3
+ from agg_data_2k
+ where g < r.a
+ group by g/2) as s;
+
+set jit_above_cost to default;
+
+create table agg_hash_3 as
+select (g/2)::numeric as c1, sum(7::int4) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+
+create table agg_hash_4 as
+select (g/2)::numeric as c1, array_agg(g::numeric) as c2, count(*) as c3
+ from agg_data_2k group by g/2;
+
+set enable_sort = true;
+set work_mem to default;
+
+-- Compare group aggregation results to hash aggregation results
+
+(select * from agg_hash_1 except select * from agg_group_1)
+ union all
+(select * from agg_group_1 except select * from agg_hash_1);
+
+(select * from agg_hash_2 except select * from agg_group_2)
+ union all
+(select * from agg_group_2 except select * from agg_hash_2);
+
+(select * from agg_hash_3 except select * from agg_group_3)
+ union all
+(select * from agg_group_3 except select * from agg_hash_3);
+
+(select * from agg_hash_4 except select * from agg_group_4)
+ union all
+(select * from agg_group_4 except select * from agg_hash_4);
+
+drop table agg_group_1;
+drop table agg_group_2;
+drop table agg_group_3;
+drop table agg_group_4;
+drop table agg_hash_1;
+drop table agg_hash_2;
+drop table agg_hash_3;
+drop table agg_hash_4;
diff --git a/yql/essentials/tests/postgresql/original/cases/alter_table.out b/yql/essentials/tests/postgresql/original/cases/alter_table.out
new file mode 100644
index 0000000000..77c95d6051
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/alter_table.out
@@ -0,0 +1,4593 @@
+--
+-- ALTER_TABLE
+--
+-- Clean up in case a prior regression run failed
+SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_alter_table_user1;
+RESET client_min_messages;
+CREATE USER regress_alter_table_user1;
+--
+-- add attribute
+--
+CREATE TABLE attmp (initial int4);
+COMMENT ON TABLE attmp_wrong IS 'table comment';
+ERROR: relation "attmp_wrong" does not exist
+COMMENT ON TABLE attmp IS 'table comment';
+COMMENT ON TABLE attmp IS NULL;
+ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
+ERROR: column name "xmin" conflicts with a system column name
+ALTER TABLE attmp ADD COLUMN a int4 default 3;
+ALTER TABLE attmp ADD COLUMN b name;
+ALTER TABLE attmp ADD COLUMN c text;
+ALTER TABLE attmp ADD COLUMN d float8;
+ALTER TABLE attmp ADD COLUMN e float4;
+ALTER TABLE attmp ADD COLUMN f int2;
+ALTER TABLE attmp ADD COLUMN g polygon;
+ALTER TABLE attmp ADD COLUMN i char;
+ALTER TABLE attmp ADD COLUMN k int4;
+ALTER TABLE attmp ADD COLUMN l tid;
+ALTER TABLE attmp ADD COLUMN m xid;
+ALTER TABLE attmp ADD COLUMN n oidvector;
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+ALTER TABLE attmp ADD COLUMN q point;
+ALTER TABLE attmp ADD COLUMN r lseg;
+ALTER TABLE attmp ADD COLUMN s path;
+ALTER TABLE attmp ADD COLUMN t box;
+ALTER TABLE attmp ADD COLUMN v timestamp;
+ALTER TABLE attmp ADD COLUMN w interval;
+ALTER TABLE attmp ADD COLUMN x float8[];
+ALTER TABLE attmp ADD COLUMN y float4[];
+ALTER TABLE attmp ADD COLUMN z int2[];
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+SELECT * FROM attmp;
+ initial | a | b | c | d | e | f | g | i | k | l | m | n | p | q | r | s | t | v | w | x | y | z
+---------+---+------+------+-----+-----+---+-----------------------+---+--------+-------+-----+-----------------+---+-----------+-----------------------+-----------------------------+---------------------+--------------------------+------------------+-----------+-----------+-----------
+ | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | c | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | t | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
+(1 row)
+
+DROP TABLE attmp;
+-- the wolf bug - schema mods caused inconsistent row descriptors
+CREATE TABLE attmp (
+ initial int4
+);
+ALTER TABLE attmp ADD COLUMN a int4;
+ALTER TABLE attmp ADD COLUMN b name;
+ALTER TABLE attmp ADD COLUMN c text;
+ALTER TABLE attmp ADD COLUMN d float8;
+ALTER TABLE attmp ADD COLUMN e float4;
+ALTER TABLE attmp ADD COLUMN f int2;
+ALTER TABLE attmp ADD COLUMN g polygon;
+ALTER TABLE attmp ADD COLUMN i char;
+ALTER TABLE attmp ADD COLUMN k int4;
+ALTER TABLE attmp ADD COLUMN l tid;
+ALTER TABLE attmp ADD COLUMN m xid;
+ALTER TABLE attmp ADD COLUMN n oidvector;
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+ALTER TABLE attmp ADD COLUMN q point;
+ALTER TABLE attmp ADD COLUMN r lseg;
+ALTER TABLE attmp ADD COLUMN s path;
+ALTER TABLE attmp ADD COLUMN t box;
+ALTER TABLE attmp ADD COLUMN v timestamp;
+ALTER TABLE attmp ADD COLUMN w interval;
+ALTER TABLE attmp ADD COLUMN x float8[];
+ALTER TABLE attmp ADD COLUMN y float4[];
+ALTER TABLE attmp ADD COLUMN z int2[];
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+SELECT * FROM attmp;
+ initial | a | b | c | d | e | f | g | i | k | l | m | n | p | q | r | s | t | v | w | x | y | z
+---------+---+------+------+-----+-----+---+-----------------------+---+--------+-------+-----+-----------------+---+-----------+-----------------------+-----------------------------+---------------------+--------------------------+------------------+-----------+-----------+-----------
+ | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | c | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | t | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
+(1 row)
+
+CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
+ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+ERROR: column number must be in range from 1 to 32767
+LINE 1: ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+ ^
+ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
+ERROR: cannot alter statistics on non-expression column "a" of index "attmp_idx"
+HINT: Alter statistics on table column instead.
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
+\d+ attmp_idx
+ Index "public.attmp_idx"
+ Column | Type | Key? | Definition | Storage | Stats target
+--------+------------------+------+------------+---------+--------------
+ a | integer | yes | a | plain |
+ expr | double precision | yes | (d + e) | plain | 1000
+ b | cstring | yes | b | plain |
+btree, for table "public.attmp"
+
+ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
+ERROR: cannot alter statistics on non-expression column "b" of index "attmp_idx"
+HINT: Alter statistics on table column instead.
+ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
+ERROR: column number 4 of relation "attmp_idx" does not exist
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
+DROP TABLE attmp;
+-- fails with incorrect object type
+CREATE VIEW at_v1 AS SELECT 1 as a;
+ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
+ERROR: "at_v1" is not a table, materialized view, index, partitioned index, or foreign table
+DROP VIEW at_v1;
+--
+-- rename - check on both non-temp and temp tables
+--
+CREATE TABLE attmp (regtable int);
+CREATE TEMP TABLE attmp (attmptable int);
+ALTER TABLE attmp RENAME TO attmp_new;
+SELECT * FROM attmp;
+ regtable
+----------
+(0 rows)
+
+SELECT * FROM attmp_new;
+ attmptable
+------------
+(0 rows)
+
+ALTER TABLE attmp RENAME TO attmp_new2;
+SELECT * FROM attmp; -- should fail
+ERROR: relation "attmp" does not exist
+LINE 1: SELECT * FROM attmp;
+ ^
+SELECT * FROM attmp_new;
+ attmptable
+------------
+(0 rows)
+
+SELECT * FROM attmp_new2;
+ regtable
+----------
+(0 rows)
+
+DROP TABLE attmp_new;
+DROP TABLE attmp_new2;
+-- check rename of partitioned tables and indexes also
+CREATE TABLE part_attmp (a int primary key) partition by range (a);
+CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
+ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
+ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
+ALTER TABLE part_attmp RENAME TO part_at2tmp;
+ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
+SET ROLE regress_alter_table_user1;
+ALTER INDEX part_attmp_index RENAME TO fail;
+ERROR: must be owner of index part_attmp_index
+ALTER INDEX part_attmp1_index RENAME TO fail;
+ERROR: must be owner of index part_attmp1_index
+ALTER TABLE part_at2tmp RENAME TO fail;
+ERROR: must be owner of table part_at2tmp
+ALTER TABLE part_at2tmp1 RENAME TO fail;
+ERROR: must be owner of table part_at2tmp1
+RESET ROLE;
+DROP TABLE part_at2tmp;
+--
+-- check renaming to a table's array type's autogenerated name
+-- (the array type's name should get out of the way)
+--
+CREATE TABLE attmp_array (id int);
+CREATE TABLE attmp_array2 (id int);
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ typname
+--------------
+ _attmp_array
+(1 row)
+
+SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
+ typname
+---------------
+ _attmp_array2
+(1 row)
+
+ALTER TABLE attmp_array2 RENAME TO _attmp_array;
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ typname
+---------------
+ __attmp_array
+(1 row)
+
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ typname
+----------------
+ ___attmp_array
+(1 row)
+
+DROP TABLE _attmp_array;
+DROP TABLE attmp_array;
+-- renaming to table's own array type's name is an interesting corner case
+CREATE TABLE attmp_array (id int);
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ typname
+--------------
+ _attmp_array
+(1 row)
+
+ALTER TABLE attmp_array RENAME TO _attmp_array;
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+ typname
+---------------
+ __attmp_array
+(1 row)
+
+DROP TABLE _attmp_array;
+-- ALTER TABLE ... RENAME on non-table relations
+-- renaming indexes (FIXME: this should probably test the index's functionality)
+ALTER INDEX IF EXISTS __onek_unique1 RENAME TO attmp_onek_unique1;
+NOTICE: relation "__onek_unique1" does not exist, skipping
+ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
+NOTICE: relation "__attmp_onek_unique1" does not exist, skipping
+ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
+ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
+SET ROLE regress_alter_table_user1;
+ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
+ERROR: must be owner of index onek_unique1
+RESET ROLE;
+-- rename statements with mismatching statement and object types
+CREATE TABLE alter_idx_rename_test (a INT);
+CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
+CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
+CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
+BEGIN;
+ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
+ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+ relation | mode
+--------------------------------+---------------------
+ alter_idx_rename_test_2 | AccessExclusiveLock
+ alter_idx_rename_test_parted_2 | AccessExclusiveLock
+(2 rows)
+
+COMMIT;
+BEGIN;
+ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
+ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+ relation | mode
+------------------------------------+--------------------------
+ alter_idx_rename_test_idx_2 | ShareUpdateExclusiveLock
+ alter_idx_rename_test_parted_idx_2 | ShareUpdateExclusiveLock
+(2 rows)
+
+COMMIT;
+BEGIN;
+ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
+ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+ relation | mode
+------------------------------------+---------------------
+ alter_idx_rename_test_idx_3 | AccessExclusiveLock
+ alter_idx_rename_test_parted_idx_3 | AccessExclusiveLock
+(2 rows)
+
+COMMIT;
+DROP TABLE alter_idx_rename_test_2;
+-- renaming views
+CREATE VIEW attmp_view (unique1) AS SELECT unique1 FROM tenk1;
+ALTER TABLE attmp_view RENAME TO attmp_view_new;
+SET ROLE regress_alter_table_user1;
+ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
+ERROR: must be owner of view attmp_view_new
+RESET ROLE;
+-- hack to ensure we get an indexscan here
+set enable_seqscan to off;
+set enable_bitmapscan to off;
+-- 5 values, sorted
+SELECT unique1 FROM tenk1 WHERE unique1 < 5;
+ unique1
+---------
+ 0
+ 1
+ 2
+ 3
+ 4
+(5 rows)
+
+reset enable_seqscan;
+reset enable_bitmapscan;
+DROP VIEW attmp_view_new;
+-- toast-like relation name
+alter table stud_emp rename to pg_toast_stud_emp;
+alter table pg_toast_stud_emp rename to stud_emp;
+-- renaming index should rename constraint as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+-- renaming constraint
+ALTER TABLE onek ADD CONSTRAINT onek_check_constraint CHECK (unique1 >= 0);
+ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
+ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
+-- renaming constraint should rename index as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+DROP INDEX onek_unique1_constraint; -- to see whether it's there
+ERROR: cannot drop index onek_unique1_constraint because constraint onek_unique1_constraint on table onek requires it
+HINT: You can drop constraint onek_unique1_constraint on table onek instead.
+ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
+DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
+ERROR: cannot drop index onek_unique1_constraint_foo because constraint onek_unique1_constraint_foo on table onek requires it
+HINT: You can drop constraint onek_unique1_constraint_foo on table onek instead.
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+-- renaming constraints vs. inheritance
+CREATE TABLE constraint_rename_test (a int CONSTRAINT con1 CHECK (a > 0), b int, c int);
+\d constraint_rename_test
+ Table "public.constraint_rename_test"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+Check constraints:
+ "con1" CHECK (a > 0)
+
+CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
+NOTICE: merging column "a" with inherited definition
+NOTICE: merging constraint "con1" with inherited definition
+\d constraint_rename_test2
+ Table "public.constraint_rename_test2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+ d | integer | | |
+Check constraints:
+ "con1" CHECK (a > 0)
+Inherits: constraint_rename_test
+
+ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
+ERROR: cannot rename inherited constraint "con1"
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
+ERROR: inherited constraint "con1" must be renamed in child tables too
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
+\d constraint_rename_test
+ Table "public.constraint_rename_test"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+Check constraints:
+ "con1foo" CHECK (a > 0)
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d constraint_rename_test2
+ Table "public.constraint_rename_test2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+ d | integer | | |
+Check constraints:
+ "con1foo" CHECK (a > 0)
+Inherits: constraint_rename_test
+
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
+\d constraint_rename_test
+ Table "public.constraint_rename_test"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+Check constraints:
+ "con1foo" CHECK (a > 0)
+ "con2bar" CHECK (b > 0) NO INHERIT
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d constraint_rename_test2
+ Table "public.constraint_rename_test2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | integer | | |
+ d | integer | | |
+Check constraints:
+ "con1foo" CHECK (a > 0)
+Inherits: constraint_rename_test
+
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
+\d constraint_rename_test
+ Table "public.constraint_rename_test"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | not null |
+ b | integer | | |
+ c | integer | | |
+Indexes:
+ "con3foo" PRIMARY KEY, btree (a)
+Check constraints:
+ "con1foo" CHECK (a > 0)
+ "con2bar" CHECK (b > 0) NO INHERIT
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d constraint_rename_test2
+ Table "public.constraint_rename_test2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | not null |
+ b | integer | | |
+ c | integer | | |
+ d | integer | | |
+Check constraints:
+ "con1foo" CHECK (a > 0)
+Inherits: constraint_rename_test
+
+DROP TABLE constraint_rename_test2;
+DROP TABLE constraint_rename_test;
+ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
+NOTICE: relation "constraint_not_exist" does not exist, skipping
+ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
+NOTICE: relation "constraint_rename_test" does not exist, skipping
+-- renaming constraints with cache reset of target relation
+CREATE TABLE constraint_rename_cache (a int,
+ CONSTRAINT chk_a CHECK (a > 0),
+ PRIMARY KEY (a));
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT chk_a TO chk_a_new;
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT constraint_rename_cache_pkey TO constraint_rename_pkey_new;
+CREATE TABLE like_constraint_rename_cache
+ (LIKE constraint_rename_cache INCLUDING ALL);
+\d like_constraint_rename_cache
+ Table "public.like_constraint_rename_cache"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | not null |
+Indexes:
+ "like_constraint_rename_cache_pkey" PRIMARY KEY, btree (a)
+Check constraints:
+ "chk_a_new" CHECK (a > 0)
+
+DROP TABLE constraint_rename_cache;
+DROP TABLE like_constraint_rename_cache;
+-- FOREIGN KEY CONSTRAINT adding TEST
+CREATE TABLE attmp2 (a int primary key);
+CREATE TABLE attmp3 (a int, b int);
+CREATE TABLE attmp4 (a int, b int, unique(a,b));
+CREATE TABLE attmp5 (a int, b int);
+-- Insert rows into attmp2 (pktable)
+INSERT INTO attmp2 values (1);
+INSERT INTO attmp2 values (2);
+INSERT INTO attmp2 values (3);
+INSERT INTO attmp2 values (4);
+-- Insert rows into attmp3
+INSERT INTO attmp3 values (1,10);
+INSERT INTO attmp3 values (1,20);
+INSERT INTO attmp3 values (5,50);
+-- Try (and fail) to add constraint due to invalid source columns
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(c) references attmp2 match full;
+ERROR: column "c" referenced in foreign key constraint does not exist
+-- Try (and fail) to add constraint due to invalid destination columns explicitly given
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(a) references attmp2(b) match full;
+ERROR: column "b" referenced in foreign key constraint does not exist
+-- Try (and fail) to add constraint due to invalid data
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+ERROR: insert or update on table "attmp3" violates foreign key constraint "attmpconstr"
+DETAIL: Key (a)=(5) is not present in table "attmp2".
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+-- Try (and succeed)
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+ALTER TABLE attmp3 drop constraint attmpconstr;
+INSERT INTO attmp3 values (5,50);
+-- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full NOT VALID;
+ALTER TABLE attmp3 validate constraint attmpconstr;
+ERROR: insert or update on table "attmp3" violates foreign key constraint "attmpconstr"
+DETAIL: Key (a)=(5) is not present in table "attmp2".
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+-- Try (and succeed) and repeat to show it works on already valid constraint
+ALTER TABLE attmp3 validate constraint attmpconstr;
+ALTER TABLE attmp3 validate constraint attmpconstr;
+-- Try a non-verified CHECK constraint
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10); -- fail
+ERROR: check constraint "b_greater_than_ten" of relation "attmp3" is violated by some row
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
+ERROR: check constraint "b_greater_than_ten" of relation "attmp3" is violated by some row
+DELETE FROM attmp3 WHERE NOT b > 10;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+-- Test inherited NOT VALID CHECK constraints
+select * from attmp3;
+ a | b
+---+----
+ 1 | 20
+(1 row)
+
+CREATE TABLE attmp6 () INHERITS (attmp3);
+CREATE TABLE attmp7 () INHERITS (attmp3);
+INSERT INTO attmp6 VALUES (6, 30), (7, 16);
+ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
+ERROR: check constraint "b_le_20" of relation "attmp6" is violated by some row
+DELETE FROM attmp6 WHERE b > 20;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
+-- An already validated constraint must not be revalidated
+CREATE FUNCTION boo(int) RETURNS int IMMUTABLE STRICT LANGUAGE plpgsql AS $$ BEGIN RAISE NOTICE 'boo: %', $1; RETURN $1; END; $$;
+INSERT INTO attmp7 VALUES (8, 18);
+ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
+NOTICE: boo: 18
+ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
+NOTICE: merging constraint "identity" with inherited definition
+ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
+NOTICE: boo: 20
+NOTICE: boo: 16
+-- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
+create table parent_noinh_convalid (a int);
+create table child_noinh_convalid () inherits (parent_noinh_convalid);
+insert into parent_noinh_convalid values (1);
+insert into child_noinh_convalid values (1);
+alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
+-- fail, because of the row in parent
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+ERROR: check constraint "check_a_is_2" of relation "parent_noinh_convalid" is violated by some row
+delete from only parent_noinh_convalid;
+-- ok (parent itself contains no violating rows)
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+select convalidated from pg_constraint where conrelid = 'parent_noinh_convalid'::regclass and conname = 'check_a_is_2';
+ convalidated
+--------------
+ t
+(1 row)
+
+-- cleanup
+drop table parent_noinh_convalid, child_noinh_convalid;
+-- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
+-- attmp4 is a,b
+ALTER TABLE attmp5 add constraint attmpconstr foreign key(a) references attmp4(a) match full;
+ERROR: there is no unique constraint matching given keys for referenced table "attmp4"
+DROP TABLE attmp7;
+DROP TABLE attmp6;
+DROP TABLE attmp5;
+DROP TABLE attmp4;
+DROP TABLE attmp3;
+DROP TABLE attmp2;
+-- NOT VALID with plan invalidation -- ensure we don't use a constraint for
+-- exclusion until validated
+set constraint_exclusion TO 'partition';
+create table nv_parent (d date, check (false) no inherit not valid);
+-- not valid constraint added at creation time should automatically become valid
+\d nv_parent
+ Table "public.nv_parent"
+ Column | Type | Collation | Nullable | Default
+--------+------+-----------+----------+---------
+ d | date | | |
+Check constraints:
+ "nv_parent_check" CHECK (false) NO INHERIT
+
+create table nv_child_2010 () inherits (nv_parent);
+create table nv_child_2011 () inherits (nv_parent);
+alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
+alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
+explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Append
+ -> Seq Scan on nv_parent nv_parent_1
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+ -> Seq Scan on nv_child_2010 nv_parent_2
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+ -> Seq Scan on nv_child_2011 nv_parent_3
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+(7 rows)
+
+create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
+explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Append
+ -> Seq Scan on nv_parent nv_parent_1
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+ -> Seq Scan on nv_child_2010 nv_parent_2
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+ -> Seq Scan on nv_child_2011 nv_parent_3
+ Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
+(7 rows)
+
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Append
+ -> Seq Scan on nv_parent nv_parent_1
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+ -> Seq Scan on nv_child_2010 nv_parent_2
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+ -> Seq Scan on nv_child_2011 nv_parent_3
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+ -> Seq Scan on nv_child_2009 nv_parent_4
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+(9 rows)
+
+-- after validation, the constraint should be used
+alter table nv_child_2011 VALIDATE CONSTRAINT nv_child_2011_d_check;
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Append
+ -> Seq Scan on nv_parent nv_parent_1
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+ -> Seq Scan on nv_child_2010 nv_parent_2
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+ -> Seq Scan on nv_child_2009 nv_parent_3
+ Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
+(7 rows)
+
+-- add an inherited NOT VALID constraint
+alter table nv_parent add check (d between '2001-01-01'::date and '2099-12-31'::date) not valid;
+\d nv_child_2009
+ Table "public.nv_child_2009"
+ Column | Type | Collation | Nullable | Default
+--------+------+-----------+----------+---------
+ d | date | | |
+Check constraints:
+ "nv_child_2009_d_check" CHECK (d >= '01-01-2009'::date AND d <= '12-31-2009'::date)
+ "nv_parent_d_check" CHECK (d >= '01-01-2001'::date AND d <= '12-31-2099'::date) NOT VALID
+Inherits: nv_parent
+
+-- we leave nv_parent and children around to help test pg_dump logic
+-- Foreign key adding test with mixed types
+-- Note: these tables are TEMP to avoid name conflicts when this test
+-- is run in parallel with foreign_key.sql.
+CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 inet);
+-- This next should fail, because int=inet does not exist
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: inet and integer.
+-- This should also fail for the same reason, but here we
+-- give the column name
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: inet and integer.
+DROP TABLE FKTABLE;
+-- This should succeed, even though they are different types,
+-- because int=int8 exists and is a member of the integer opfamily
+CREATE TEMP TABLE FKTABLE (ftest1 int8);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+INSERT INTO FKTABLE VALUES(43); -- should fail
+ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey"
+DETAIL: Key (ftest1)=(43) is not present in table "pktable".
+DROP TABLE FKTABLE;
+-- This should fail, because we'd have to cast numeric to int which is
+-- not an implicit coercion (or use numeric=numeric, but that's not part
+-- of the integer opfamily)
+CREATE TEMP TABLE FKTABLE (ftest1 numeric);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: numeric and integer.
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- On the other hand, this should work because int implicitly promotes to
+-- numeric, and we allow promotion on the FK side
+CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+INSERT INTO FKTABLE VALUES(43); -- should fail
+ERROR: insert or update on table "fktable" violates foreign key constraint "fktable_ftest1_fkey"
+DETAIL: Key (ftest1)=(43) is not present in table "pktable".
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
+ PRIMARY KEY(ptest1, ptest2));
+-- This should fail, because we just chose really odd types
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
+ERROR: foreign key constraint "fktable_ftest1_ftest2_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: cidr and integer.
+DROP TABLE FKTABLE;
+-- Again, so should this...
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest1, ptest2);
+ERROR: foreign key constraint "fktable_ftest1_ftest2_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: cidr and integer.
+DROP TABLE FKTABLE;
+-- This fails because we mixed up the column ordering
+CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest2, ptest1);
+ERROR: foreign key constraint "fktable_ftest1_ftest2_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest2" are of incompatible types: integer and inet.
+-- As does this...
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
+ references pktable(ptest1, ptest2);
+ERROR: foreign key constraint "fktable_ftest2_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest2" and "ptest1" are of incompatible types: inet and integer.
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- Test that ALTER CONSTRAINT updates trigger deferrability properly
+CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'pktable'::regclass
+ORDER BY 1,2,3;
+ conname | tgfoid | tgtype | tgdeferrable | tginitdeferred
+---------+------------------------+--------+--------------+----------------
+ fkdd | "RI_FKey_cascade_del" | 9 | f | f
+ fkdd | "RI_FKey_noaction_upd" | 17 | t | t
+ fkdd2 | "RI_FKey_cascade_del" | 9 | f | f
+ fkdd2 | "RI_FKey_noaction_upd" | 17 | t | t
+ fkdi | "RI_FKey_cascade_del" | 9 | f | f
+ fkdi | "RI_FKey_noaction_upd" | 17 | t | f
+ fkdi2 | "RI_FKey_cascade_del" | 9 | f | f
+ fkdi2 | "RI_FKey_noaction_upd" | 17 | t | f
+ fknd | "RI_FKey_cascade_del" | 9 | f | f
+ fknd | "RI_FKey_noaction_upd" | 17 | f | f
+ fknd2 | "RI_FKey_cascade_del" | 9 | f | f
+ fknd2 | "RI_FKey_noaction_upd" | 17 | f | f
+(12 rows)
+
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'fktable'::regclass
+ORDER BY 1,2,3;
+ conname | tgfoid | tgtype | tgdeferrable | tginitdeferred
+---------+---------------------+--------+--------------+----------------
+ fkdd | "RI_FKey_check_ins" | 5 | t | t
+ fkdd | "RI_FKey_check_upd" | 17 | t | t
+ fkdd2 | "RI_FKey_check_ins" | 5 | t | t
+ fkdd2 | "RI_FKey_check_upd" | 17 | t | t
+ fkdi | "RI_FKey_check_ins" | 5 | t | f
+ fkdi | "RI_FKey_check_upd" | 17 | t | f
+ fkdi2 | "RI_FKey_check_ins" | 5 | t | f
+ fkdi2 | "RI_FKey_check_upd" | 17 | t | f
+ fknd | "RI_FKey_check_ins" | 5 | f | f
+ fknd | "RI_FKey_check_upd" | 17 | f | f
+ fknd2 | "RI_FKey_check_ins" | 5 | f | f
+ fknd2 | "RI_FKey_check_upd" | 17 | f | f
+(12 rows)
+
+-- temp tables should go away by themselves, need not drop them.
+-- test check constraint adding
+create table atacc1 ( test int );
+-- add a check constraint
+alter table atacc1 add constraint atacc_test1 check (test>3);
+-- should fail
+insert into atacc1 (test) values (2);
+ERROR: new row for relation "atacc1" violates check constraint "atacc_test1"
+DETAIL: Failing row contains (2).
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails when added
+create table atacc1 ( test int );
+-- insert a soon to be failing row
+insert into atacc1 (test) values (2);
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test>3);
+ERROR: check constraint "atacc_test1" of relation "atacc1" is violated by some row
+insert into atacc1 (test) values (4);
+drop table atacc1;
+-- let's do one where the check fails because the column doesn't exist
+create table atacc1 ( test int );
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test1>3);
+ERROR: column "test1" does not exist
+HINT: Perhaps you meant to reference the column "atacc1.test".
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int, test3 int);
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
+-- should fail
+insert into atacc1 (test,test2,test3) values (4,4,2);
+ERROR: new row for relation "atacc1" violates check constraint "atacc_test1"
+DETAIL: Failing row contains (4, 4, 2).
+-- should succeed
+insert into atacc1 (test,test2,test3) values (4,4,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int check (test>3), test2 int);
+alter table atacc1 add check (test2>test);
+-- should fail for $2
+insert into atacc1 (test2, test) values (3, 4);
+ERROR: new row for relation "atacc1" violates check constraint "atacc1_check"
+DETAIL: Failing row contains (4, 3).
+drop table atacc1;
+-- inheritance related tests
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+alter table atacc2 add constraint foo check (test2>0);
+-- fail and then succeed on atacc2
+insert into atacc2 (test2) values (-3);
+ERROR: new row for relation "atacc2" violates check constraint "foo"
+DETAIL: Failing row contains (-3).
+insert into atacc2 (test2) values (3);
+-- fail and then succeed on atacc3
+insert into atacc3 (test2) values (-3);
+ERROR: new row for relation "atacc3" violates check constraint "foo"
+DETAIL: Failing row contains (null, -3, null).
+insert into atacc3 (test2) values (3);
+drop table atacc3;
+drop table atacc2;
+drop table atacc1;
+-- same things with one created with INHERIT
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+alter table atacc3 no inherit atacc2;
+-- fail
+alter table atacc3 no inherit atacc2;
+ERROR: relation "atacc2" is not a parent of relation "atacc3"
+-- make sure it really isn't a child
+insert into atacc3 (test2) values (3);
+select test2 from atacc2;
+ test2
+-------
+(0 rows)
+
+-- fail due to missing constraint
+alter table atacc2 add constraint foo check (test2>0);
+alter table atacc3 inherit atacc2;
+ERROR: child table is missing constraint "foo"
+-- fail due to missing column
+alter table atacc3 rename test2 to testx;
+alter table atacc3 inherit atacc2;
+ERROR: child table is missing column "test2"
+-- fail due to mismatched data type
+alter table atacc3 add test2 bool;
+alter table atacc3 inherit atacc2;
+ERROR: child table "atacc3" has different type for column "test2"
+alter table atacc3 drop test2;
+-- succeed
+alter table atacc3 add test2 int;
+update atacc3 set test2 = 4 where test2 is null;
+alter table atacc3 add constraint foo check (test2>0);
+alter table atacc3 inherit atacc2;
+-- fail due to duplicates and circular inheritance
+alter table atacc3 inherit atacc2;
+ERROR: relation "atacc2" would be inherited from more than once
+alter table atacc2 inherit atacc3;
+ERROR: circular inheritance not allowed
+DETAIL: "atacc3" is already a child of "atacc2".
+alter table atacc2 inherit atacc2;
+ERROR: circular inheritance not allowed
+DETAIL: "atacc2" is already a child of "atacc2".
+-- test that we really are a child now (should see 4 not 3 and cascade should go through)
+select test2 from atacc2;
+ test2
+-------
+ 4
+(1 row)
+
+drop table atacc2 cascade;
+NOTICE: drop cascades to table atacc3
+drop table atacc1;
+-- adding only to a parent is allowed as of 9.2
+create table atacc1 (test int);
+create table atacc2 (test2 int) inherits (atacc1);
+-- ok:
+alter table atacc1 add constraint foo check (test>0) no inherit;
+-- check constraint is not there on child
+insert into atacc2 (test) values (-3);
+-- check constraint is there on parent
+insert into atacc1 (test) values (-3);
+ERROR: new row for relation "atacc1" violates check constraint "foo"
+DETAIL: Failing row contains (-3).
+insert into atacc1 (test) values (3);
+-- fail, violating row:
+alter table atacc2 add constraint foo check (test>0) no inherit;
+ERROR: check constraint "foo" of relation "atacc2" is violated by some row
+drop table atacc2;
+drop table atacc1;
+-- test unique constraint adding
+create table atacc1 ( test int ) ;
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test);
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should fail
+insert into atacc1 (test) values (2);
+ERROR: duplicate key value violates unique constraint "atacc_test1"
+DETAIL: Key (test)=(2) already exists.
+-- should succeed
+insert into atacc1 (test) values (4);
+-- try to create duplicates via alter table using - should fail
+alter table atacc1 alter column test type integer using 0;
+ERROR: could not create unique index "atacc_test1"
+DETAIL: Key (test)=(0) is duplicated.
+drop table atacc1;
+-- let's do one where the unique constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test);
+ERROR: could not create unique index "atacc_test1"
+DETAIL: Key (test)=(2) is duplicated.
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the unique constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test1);
+ERROR: column "test1" named in key does not exist
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test, test2);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+ERROR: duplicate key value violates unique constraint "atacc_test1"
+DETAIL: Key (test, test2)=(4, 4) already exists.
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, unique(test));
+alter table atacc1 add unique (test2);
+-- should fail for @@ second one @@
+insert into atacc1 (test2, test) values (3, 3);
+insert into atacc1 (test2, test) values (2, 3);
+ERROR: duplicate key value violates unique constraint "atacc1_test_key"
+DETAIL: Key (test)=(3) already exists.
+drop table atacc1;
+-- test primary key constraint adding
+create table atacc1 ( id serial, test int) ;
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test);
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should fail
+insert into atacc1 (test) values (2);
+ERROR: duplicate key value violates unique constraint "atacc_test1"
+DETAIL: Key (test)=(2) already exists.
+-- should succeed
+insert into atacc1 (test) values (4);
+-- inserting NULL should fail
+insert into atacc1 (test) values(NULL);
+ERROR: null value in column "test" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (4, null).
+-- try adding a second primary key (should fail)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+ERROR: multiple primary keys for table "atacc1" are not allowed
+-- drop first primary key constraint
+alter table atacc1 drop constraint atacc_test1 restrict;
+-- try adding a primary key on oid (should succeed)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+drop table atacc1;
+-- let's do one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+ERROR: could not create unique index "atacc_test1"
+DETAIL: Key (test)=(2) is duplicated.
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do another one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing row
+insert into atacc1 (test) values (NULL);
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+ERROR: column "test" of relation "atacc1" contains null values
+insert into atacc1 (test) values (3);
+drop table atacc1;
+-- let's do one where the primary key constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+-- add a primary key constraint (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test1);
+ERROR: column "test1" of relation "atacc1" does not exist
+drop table atacc1;
+-- adding a new column as primary key to a non-empty table.
+-- should fail unless the column has a non-null default value.
+create table atacc1 ( test int );
+insert into atacc1 (test) values (0);
+-- add a primary key column without a default (fails).
+alter table atacc1 add column test2 int primary key;
+ERROR: column "test2" of relation "atacc1" contains null values
+-- now add a primary key column with a default (succeeds).
+alter table atacc1 add column test2 int default 0 primary key;
+drop table atacc1;
+-- this combination used to have order-of-execution problems (bug #15580)
+create table atacc1 (a int);
+insert into atacc1 values(1);
+alter table atacc1
+ add column b float8 not null default random(),
+ add primary key(a);
+drop table atacc1;
+-- additionally, we've seen issues with foreign key validation not being
+-- properly delayed until after a table rewrite. Check that works ok.
+create table atacc1 (a int primary key);
+alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
+alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
+drop table atacc1;
+-- we've also seen issues with check constraints being validated at the wrong
+-- time when there's a pending table rewrite.
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,1);
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+drop table atacc1;
+-- same as above, but ensure the constraint violation is detected
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,2);
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+ERROR: check constraint "atacc1_chk" of relation "atacc1" is violated by some row
+drop table atacc1;
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test, test2);
+-- try adding a second primary key - should fail
+alter table atacc1 add constraint atacc_test2 primary key (test);
+ERROR: multiple primary keys for table "atacc1" are not allowed
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+ERROR: duplicate key value violates unique constraint "atacc_test1"
+DETAIL: Key (test, test2)=(4, 4) already exists.
+insert into atacc1 (test,test2) values (NULL,3);
+ERROR: null value in column "test" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (null, 3).
+insert into atacc1 (test,test2) values (3, NULL);
+ERROR: null value in column "test2" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (3, null).
+insert into atacc1 (test,test2) values (NULL,NULL);
+ERROR: null value in column "test" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (null, null).
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, primary key(test));
+-- only first should succeed
+insert into atacc1 (test2, test) values (3, 3);
+insert into atacc1 (test2, test) values (2, 3);
+ERROR: duplicate key value violates unique constraint "atacc1_pkey"
+DETAIL: Key (test)=(3) already exists.
+insert into atacc1 (test2, test) values (1, NULL);
+ERROR: null value in column "test" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (null, 1).
+drop table atacc1;
+-- alter table / alter column [set/drop] not null tests
+-- try altering system catalogs, should fail
+alter table pg_class alter column relname drop not null;
+ERROR: permission denied: "pg_class" is a system catalog
+alter table pg_class alter relname set not null;
+ERROR: permission denied: "pg_class" is a system catalog
+-- try altering non-existent table, should fail
+alter table non_existent alter column bar set not null;
+ERROR: relation "non_existent" does not exist
+alter table non_existent alter column bar drop not null;
+ERROR: relation "non_existent" does not exist
+-- test setting columns to null and not null and vice versa
+-- test checking for null values and primary key
+create table atacc1 (test int not null);
+alter table atacc1 add constraint "atacc1_pkey" primary key (test);
+alter table atacc1 alter column test drop not null;
+ERROR: column "test" is in a primary key
+alter table atacc1 drop constraint "atacc1_pkey";
+alter table atacc1 alter column test drop not null;
+insert into atacc1 values (null);
+alter table atacc1 alter test set not null;
+ERROR: column "test" of relation "atacc1" contains null values
+delete from atacc1;
+alter table atacc1 alter test set not null;
+-- try altering a non-existent column, should fail
+alter table atacc1 alter bar set not null;
+ERROR: column "bar" of relation "atacc1" does not exist
+alter table atacc1 alter bar drop not null;
+ERROR: column "bar" of relation "atacc1" does not exist
+-- try creating a view and altering that, should fail
+create view myview as select * from atacc1;
+alter table myview alter column test drop not null;
+ERROR: "myview" is not a table or foreign table
+alter table myview alter column test set not null;
+ERROR: "myview" is not a table or foreign table
+drop view myview;
+drop table atacc1;
+-- set not null verified by constraints
+create table atacc1 (test_a int, test_b int);
+insert into atacc1 values (null, 1);
+-- constraint not cover all values, should fail
+alter table atacc1 add constraint atacc1_constr_or check(test_a is not null or test_b < 10);
+alter table atacc1 alter test_a set not null;
+ERROR: column "test_a" of relation "atacc1" contains null values
+alter table atacc1 drop constraint atacc1_constr_or;
+-- not valid constraint, should fail
+alter table atacc1 add constraint atacc1_constr_invalid check(test_a is not null) not valid;
+alter table atacc1 alter test_a set not null;
+ERROR: column "test_a" of relation "atacc1" contains null values
+alter table atacc1 drop constraint atacc1_constr_invalid;
+-- with valid constraint
+update atacc1 set test_a = 1;
+alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
+alter table atacc1 alter test_a set not null;
+delete from atacc1;
+insert into atacc1 values (2, null);
+alter table atacc1 alter test_a drop not null;
+-- test multiple set not null at same time
+-- test_a checked by atacc1_constr_a_valid, test_b should fail by table scan
+alter table atacc1 alter test_a set not null, alter test_b set not null;
+ERROR: column "test_b" of relation "atacc1" contains null values
+-- commands order has no importance
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+ERROR: column "test_b" of relation "atacc1" contains null values
+-- valid one by table scan, one by check constraints
+update atacc1 set test_b = 1;
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+alter table atacc1 alter test_a drop not null, alter test_b drop not null;
+-- both column has check constraints
+alter table atacc1 add constraint atacc1_constr_b_valid check(test_b is not null);
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+drop table atacc1;
+-- test inheritance
+create table parent (a int);
+create table child (b varchar(255)) inherits (parent);
+alter table parent alter a set not null;
+insert into parent values (NULL);
+ERROR: null value in column "a" of relation "parent" violates not-null constraint
+DETAIL: Failing row contains (null).
+insert into child (a, b) values (NULL, 'foo');
+ERROR: null value in column "a" of relation "child" violates not-null constraint
+DETAIL: Failing row contains (null, foo).
+alter table parent alter a drop not null;
+insert into parent values (NULL);
+insert into child (a, b) values (NULL, 'foo');
+alter table only parent alter a set not null;
+ERROR: column "a" of relation "parent" contains null values
+alter table child alter a set not null;
+ERROR: column "a" of relation "child" contains null values
+delete from parent;
+alter table only parent alter a set not null;
+insert into parent values (NULL);
+ERROR: null value in column "a" of relation "parent" violates not-null constraint
+DETAIL: Failing row contains (null).
+alter table child alter a set not null;
+insert into child (a, b) values (NULL, 'foo');
+ERROR: null value in column "a" of relation "child" violates not-null constraint
+DETAIL: Failing row contains (null, foo).
+delete from child;
+alter table child alter a set not null;
+insert into child (a, b) values (NULL, 'foo');
+ERROR: null value in column "a" of relation "child" violates not-null constraint
+DETAIL: Failing row contains (null, foo).
+drop table child;
+drop table parent;
+-- test setting and removing default values
+create table def_test (
+ c1 int4 default 5,
+ c2 text default 'initial_default'
+);
+insert into def_test default values;
+alter table def_test alter column c1 drop default;
+insert into def_test default values;
+alter table def_test alter column c2 drop default;
+insert into def_test default values;
+alter table def_test alter column c1 set default 10;
+alter table def_test alter column c2 set default 'new_default';
+insert into def_test default values;
+select * from def_test;
+ c1 | c2
+----+-----------------
+ 5 | initial_default
+ | initial_default
+ |
+ 10 | new_default
+(4 rows)
+
+-- set defaults to an incorrect type: this should fail
+alter table def_test alter column c1 set default 'wrong_datatype';
+ERROR: invalid input syntax for type integer: "wrong_datatype"
+alter table def_test alter column c2 set default 20;
+-- set defaults on a non-existent column: this should fail
+alter table def_test alter column c3 set default 30;
+ERROR: column "c3" of relation "def_test" does not exist
+-- set defaults on views: we need to create a view, add a rule
+-- to allow insertions into it, and then alter the view to add
+-- a default
+create view def_view_test as select * from def_test;
+create rule def_view_test_ins as
+ on insert to def_view_test
+ do instead insert into def_test select new.*;
+insert into def_view_test default values;
+alter table def_view_test alter column c1 set default 45;
+insert into def_view_test default values;
+alter table def_view_test alter column c2 set default 'view_default';
+insert into def_view_test default values;
+select * from def_view_test;
+ c1 | c2
+----+-----------------
+ 5 | initial_default
+ | initial_default
+ |
+ 10 | new_default
+ |
+ 45 |
+ 45 | view_default
+(7 rows)
+
+drop rule def_view_test_ins on def_view_test;
+drop view def_view_test;
+drop table def_test;
+-- alter table / drop column tests
+-- try altering system catalogs, should fail
+alter table pg_class drop column relname;
+ERROR: permission denied: "pg_class" is a system catalog
+-- try altering non-existent table, should fail
+alter table nosuchtable drop column bar;
+ERROR: relation "nosuchtable" does not exist
+-- test dropping columns
+create table atacc1 (a int4 not null, b int4, c int4 not null, d int4);
+insert into atacc1 values (1, 2, 3, 4);
+alter table atacc1 drop a;
+alter table atacc1 drop a;
+ERROR: column "a" of relation "atacc1" does not exist
+-- SELECTs
+select * from atacc1;
+ b | c | d
+---+---+---
+ 2 | 3 | 4
+(1 row)
+
+select * from atacc1 order by a;
+ERROR: column "a" does not exist
+LINE 1: select * from atacc1 order by a;
+ ^
+select * from atacc1 order by "........pg.dropped.1........";
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: select * from atacc1 order by "........pg.dropped.1........"...
+ ^
+select * from atacc1 group by a;
+ERROR: column "a" does not exist
+LINE 1: select * from atacc1 group by a;
+ ^
+select * from atacc1 group by "........pg.dropped.1........";
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: select * from atacc1 group by "........pg.dropped.1........"...
+ ^
+select atacc1.* from atacc1;
+ b | c | d
+---+---+---
+ 2 | 3 | 4
+(1 row)
+
+select a from atacc1;
+ERROR: column "a" does not exist
+LINE 1: select a from atacc1;
+ ^
+select atacc1.a from atacc1;
+ERROR: column atacc1.a does not exist
+LINE 1: select atacc1.a from atacc1;
+ ^
+select b,c,d from atacc1;
+ b | c | d
+---+---+---
+ 2 | 3 | 4
+(1 row)
+
+select a,b,c,d from atacc1;
+ERROR: column "a" does not exist
+LINE 1: select a,b,c,d from atacc1;
+ ^
+select * from atacc1 where a = 1;
+ERROR: column "a" does not exist
+LINE 1: select * from atacc1 where a = 1;
+ ^
+select "........pg.dropped.1........" from atacc1;
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: select "........pg.dropped.1........" from atacc1;
+ ^
+select atacc1."........pg.dropped.1........" from atacc1;
+ERROR: column atacc1.........pg.dropped.1........ does not exist
+LINE 1: select atacc1."........pg.dropped.1........" from atacc1;
+ ^
+select "........pg.dropped.1........",b,c,d from atacc1;
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: select "........pg.dropped.1........",b,c,d from atacc1;
+ ^
+select * from atacc1 where "........pg.dropped.1........" = 1;
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: select * from atacc1 where "........pg.dropped.1........" = ...
+ ^
+-- UPDATEs
+update atacc1 set a = 3;
+ERROR: column "a" of relation "atacc1" does not exist
+LINE 1: update atacc1 set a = 3;
+ ^
+update atacc1 set b = 2 where a = 3;
+ERROR: column "a" does not exist
+LINE 1: update atacc1 set b = 2 where a = 3;
+ ^
+update atacc1 set "........pg.dropped.1........" = 3;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+LINE 1: update atacc1 set "........pg.dropped.1........" = 3;
+ ^
+update atacc1 set b = 2 where "........pg.dropped.1........" = 3;
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: update atacc1 set b = 2 where "........pg.dropped.1........"...
+ ^
+-- INSERTs
+insert into atacc1 values (10, 11, 12, 13);
+ERROR: INSERT has more expressions than target columns
+LINE 1: insert into atacc1 values (10, 11, 12, 13);
+ ^
+insert into atacc1 values (default, 11, 12, 13);
+ERROR: INSERT has more expressions than target columns
+LINE 1: insert into atacc1 values (default, 11, 12, 13);
+ ^
+insert into atacc1 values (11, 12, 13);
+insert into atacc1 (a) values (10);
+ERROR: column "a" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 (a) values (10);
+ ^
+insert into atacc1 (a) values (default);
+ERROR: column "a" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 (a) values (default);
+ ^
+insert into atacc1 (a,b,c,d) values (10,11,12,13);
+ERROR: column "a" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 (a,b,c,d) values (10,11,12,13);
+ ^
+insert into atacc1 (a,b,c,d) values (default,11,12,13);
+ERROR: column "a" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 (a,b,c,d) values (default,11,12,13);
+ ^
+insert into atacc1 (b,c,d) values (11,12,13);
+insert into atacc1 ("........pg.dropped.1........") values (10);
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 ("........pg.dropped.1........") values (...
+ ^
+insert into atacc1 ("........pg.dropped.1........") values (default);
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 ("........pg.dropped.1........") values (...
+ ^
+insert into atacc1 ("........pg.dropped.1........",b,c,d) values (10,11,12,13);
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 ("........pg.dropped.1........",b,c,d) va...
+ ^
+insert into atacc1 ("........pg.dropped.1........",b,c,d) values (default,11,12,13);
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+LINE 1: insert into atacc1 ("........pg.dropped.1........",b,c,d) va...
+ ^
+-- DELETEs
+delete from atacc1 where a = 3;
+ERROR: column "a" does not exist
+LINE 1: delete from atacc1 where a = 3;
+ ^
+delete from atacc1 where "........pg.dropped.1........" = 3;
+ERROR: column "........pg.dropped.1........" does not exist
+LINE 1: delete from atacc1 where "........pg.dropped.1........" = 3;
+ ^
+delete from atacc1;
+-- try dropping a non-existent column, should fail
+alter table atacc1 drop bar;
+ERROR: column "bar" of relation "atacc1" does not exist
+-- try removing an oid column, should succeed (as it's nonexistent)
+alter table atacc1 SET WITHOUT OIDS;
+-- try adding an oid column, should fail (not supported)
+alter table atacc1 SET WITH OIDS;
+ERROR: syntax error at or near "WITH"
+LINE 1: alter table atacc1 SET WITH OIDS;
+ ^
+-- try dropping the xmin column, should fail
+alter table atacc1 drop xmin;
+ERROR: cannot drop system column "xmin"
+-- try creating a view and altering that, should fail
+create view myview as select * from atacc1;
+select * from myview;
+ b | c | d
+---+---+---
+(0 rows)
+
+alter table myview drop d;
+ERROR: "myview" is not a table, composite type, or foreign table
+drop view myview;
+-- test some commands to make sure they fail on the dropped column
+analyze atacc1(a);
+ERROR: column "a" of relation "atacc1" does not exist
+analyze atacc1("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+vacuum analyze atacc1(a);
+ERROR: column "a" of relation "atacc1" does not exist
+vacuum analyze atacc1("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+comment on column atacc1.a is 'testing';
+ERROR: column "a" of relation "atacc1" does not exist
+comment on column atacc1."........pg.dropped.1........" is 'testing';
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a set storage plain;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" set storage plain;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a set statistics 0;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" set statistics 0;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a set default 3;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" set default 3;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a drop default;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" drop default;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a set not null;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" set not null;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 alter a drop not null;
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 alter "........pg.dropped.1........" drop not null;
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 rename a to x;
+ERROR: column "a" does not exist
+alter table atacc1 rename "........pg.dropped.1........" to x;
+ERROR: column "........pg.dropped.1........" does not exist
+alter table atacc1 add primary key(a);
+ERROR: column "a" of relation "atacc1" does not exist
+alter table atacc1 add primary key("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" of relation "atacc1" does not exist
+alter table atacc1 add unique(a);
+ERROR: column "a" named in key does not exist
+alter table atacc1 add unique("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" named in key does not exist
+alter table atacc1 add check (a > 3);
+ERROR: column "a" does not exist
+alter table atacc1 add check ("........pg.dropped.1........" > 3);
+ERROR: column "........pg.dropped.1........" does not exist
+create table atacc2 (id int4 unique);
+alter table atacc1 add foreign key (a) references atacc2(id);
+ERROR: column "a" referenced in foreign key constraint does not exist
+alter table atacc1 add foreign key ("........pg.dropped.1........") references atacc2(id);
+ERROR: column "........pg.dropped.1........" referenced in foreign key constraint does not exist
+alter table atacc2 add foreign key (id) references atacc1(a);
+ERROR: column "a" referenced in foreign key constraint does not exist
+alter table atacc2 add foreign key (id) references atacc1("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" referenced in foreign key constraint does not exist
+drop table atacc2;
+create index "testing_idx" on atacc1(a);
+ERROR: column "a" does not exist
+create index "testing_idx" on atacc1("........pg.dropped.1........");
+ERROR: column "........pg.dropped.1........" does not exist
+-- test create as and select into
+insert into atacc1 values (21, 22, 23);
+create table attest1 as select * from atacc1;
+select * from attest1;
+ b | c | d
+----+----+----
+ 21 | 22 | 23
+(1 row)
+
+drop table attest1;
+select * into attest2 from atacc1;
+select * from attest2;
+ b | c | d
+----+----+----
+ 21 | 22 | 23
+(1 row)
+
+drop table attest2;
+-- try dropping all columns
+alter table atacc1 drop c;
+alter table atacc1 drop d;
+alter table atacc1 drop b;
+select * from atacc1;
+--
+(1 row)
+
+drop table atacc1;
+-- test constraint error reporting in presence of dropped columns
+create table atacc1 (id serial primary key, value int check (value < 10));
+insert into atacc1(value) values (100);
+ERROR: new row for relation "atacc1" violates check constraint "atacc1_value_check"
+DETAIL: Failing row contains (1, 100).
+alter table atacc1 drop column value;
+alter table atacc1 add column value int check (value < 10);
+insert into atacc1(value) values (100);
+ERROR: new row for relation "atacc1" violates check constraint "atacc1_value_check"
+DETAIL: Failing row contains (2, 100).
+insert into atacc1(id, value) values (null, 0);
+ERROR: null value in column "id" of relation "atacc1" violates not-null constraint
+DETAIL: Failing row contains (null, 0).
+drop table atacc1;
+-- test inheritance
+create table parent (a int, b int, c int);
+insert into parent values (1, 2, 3);
+alter table parent drop a;
+create table child (d varchar(255)) inherits (parent);
+insert into child values (12, 13, 'testing');
+select * from parent;
+ b | c
+----+----
+ 2 | 3
+ 12 | 13
+(2 rows)
+
+select * from child;
+ b | c | d
+----+----+---------
+ 12 | 13 | testing
+(1 row)
+
+alter table parent drop c;
+select * from parent;
+ b
+----
+ 2
+ 12
+(2 rows)
+
+select * from child;
+ b | d
+----+---------
+ 12 | testing
+(1 row)
+
+drop table child;
+drop table parent;
+-- check error cases for inheritance column merging
+create table parent (a float8, b numeric(10,4), c text collate "C");
+create table child (a float4) inherits (parent); -- fail
+NOTICE: merging column "a" with inherited definition
+ERROR: column "a" has a type conflict
+DETAIL: double precision versus real
+create table child (b decimal(10,7)) inherits (parent); -- fail
+NOTICE: moving and merging column "b" with inherited definition
+DETAIL: User-specified column moved to the position of the inherited column.
+ERROR: column "b" has a type conflict
+DETAIL: numeric(10,4) versus numeric(10,7)
+create table child (c text collate "POSIX") inherits (parent); -- fail
+NOTICE: moving and merging column "c" with inherited definition
+DETAIL: User-specified column moved to the position of the inherited column.
+ERROR: column "c" has a collation conflict
+DETAIL: "C" versus "POSIX"
+create table child (a double precision, b decimal(10,4)) inherits (parent);
+NOTICE: merging column "a" with inherited definition
+NOTICE: merging column "b" with inherited definition
+drop table child;
+drop table parent;
+-- test copy in/out
+create table attest (a int4, b int4, c int4);
+insert into attest values (1,2,3);
+alter table attest drop a;
+copy attest to stdout;
+2 3
+copy attest(a) to stdout;
+ERROR: column "a" of relation "attest" does not exist
+copy attest("........pg.dropped.1........") to stdout;
+ERROR: column "........pg.dropped.1........" of relation "attest" does not exist
+copy attest from stdin;
+ERROR: extra data after last expected column
+CONTEXT: COPY attest, line 1: "10 11 12"
+select * from attest;
+ b | c
+---+---
+ 2 | 3
+(1 row)
+
+copy attest from stdin;
+select * from attest;
+ b | c
+----+----
+ 2 | 3
+ 21 | 22
+(2 rows)
+
+copy attest(a) from stdin;
+ERROR: column "a" of relation "attest" does not exist
+copy attest("........pg.dropped.1........") from stdin;
+ERROR: column "........pg.dropped.1........" of relation "attest" does not exist
+copy attest(b,c) from stdin;
+select * from attest;
+ b | c
+----+----
+ 2 | 3
+ 21 | 22
+ 31 | 32
+(3 rows)
+
+drop table attest;
+-- test inheritance
+create table dropColumn (a int, b int, e int);
+create table dropColumnChild (c int) inherits (dropColumn);
+create table dropColumnAnother (d int) inherits (dropColumnChild);
+-- these two should fail
+alter table dropColumnchild drop column a;
+ERROR: cannot drop inherited column "a"
+alter table only dropColumnChild drop column b;
+ERROR: cannot drop inherited column "b"
+-- these three should work
+alter table only dropColumn drop column e;
+alter table dropColumnChild drop column c;
+alter table dropColumn drop column a;
+create table renameColumn (a int);
+create table renameColumnChild (b int) inherits (renameColumn);
+create table renameColumnAnother (c int) inherits (renameColumnChild);
+-- these three should fail
+alter table renameColumnChild rename column a to d;
+ERROR: cannot rename inherited column "a"
+alter table only renameColumnChild rename column a to d;
+ERROR: inherited column "a" must be renamed in child tables too
+alter table only renameColumn rename column a to d;
+ERROR: inherited column "a" must be renamed in child tables too
+-- these should work
+alter table renameColumn rename column a to d;
+alter table renameColumnChild rename column b to a;
+-- these should work
+alter table if exists doesnt_exist_tab rename column a to d;
+NOTICE: relation "doesnt_exist_tab" does not exist, skipping
+alter table if exists doesnt_exist_tab rename column b to a;
+NOTICE: relation "doesnt_exist_tab" does not exist, skipping
+-- this should work
+alter table renameColumn add column w int;
+-- this should fail
+alter table only renameColumn add column x int;
+ERROR: column must be added to child tables too
+-- Test corner cases in dropping of inherited columns
+create table p1 (f1 int, f2 int);
+create table c1 (f1 int not null) inherits(p1);
+NOTICE: merging column "f1" with inherited definition
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+ERROR: cannot drop inherited column "f1"
+-- should work
+alter table p1 drop column f1;
+-- c1.f1 is still there, but no longer inherited
+select f1 from c1;
+ f1
+----
+(0 rows)
+
+alter table c1 drop column f1;
+select f1 from c1;
+ERROR: column "f1" does not exist
+LINE 1: select f1 from c1;
+ ^
+HINT: Perhaps you meant to reference the column "c1.f2".
+drop table p1 cascade;
+NOTICE: drop cascades to table c1
+create table p1 (f1 int, f2 int);
+create table c1 () inherits(p1);
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+ERROR: cannot drop inherited column "f1"
+alter table p1 drop column f1;
+-- c1.f1 is dropped now, since there is no local definition for it
+select f1 from c1;
+ERROR: column "f1" does not exist
+LINE 1: select f1 from c1;
+ ^
+HINT: Perhaps you meant to reference the column "c1.f2".
+drop table p1 cascade;
+NOTICE: drop cascades to table c1
+create table p1 (f1 int, f2 int);
+create table c1 () inherits(p1);
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+ERROR: cannot drop inherited column "f1"
+alter table only p1 drop column f1;
+-- c1.f1 is NOT dropped, but must now be considered non-inherited
+alter table c1 drop column f1;
+drop table p1 cascade;
+NOTICE: drop cascades to table c1
+create table p1 (f1 int, f2 int);
+create table c1 (f1 int not null) inherits(p1);
+NOTICE: merging column "f1" with inherited definition
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+ERROR: cannot drop inherited column "f1"
+alter table only p1 drop column f1;
+-- c1.f1 is still there, but no longer inherited
+alter table c1 drop column f1;
+drop table p1 cascade;
+NOTICE: drop cascades to table c1
+create table p1(id int, name text);
+create table p2(id2 int, name text, height int);
+create table c1(age int) inherits(p1,p2);
+NOTICE: merging multiple inherited definitions of column "name"
+create table gc1() inherits (c1);
+select relname, attname, attinhcount, attislocal
+from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
+where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
+order by relname, attnum;
+ relname | attname | attinhcount | attislocal
+---------+---------+-------------+------------
+ c1 | id | 1 | f
+ c1 | name | 2 | f
+ c1 | id2 | 1 | f
+ c1 | height | 1 | f
+ c1 | age | 0 | t
+ gc1 | id | 1 | f
+ gc1 | name | 1 | f
+ gc1 | id2 | 1 | f
+ gc1 | height | 1 | f
+ gc1 | age | 1 | f
+ p1 | id | 0 | t
+ p1 | name | 0 | t
+ p2 | id2 | 0 | t
+ p2 | name | 0 | t
+ p2 | height | 0 | t
+(15 rows)
+
+-- should work
+alter table only p1 drop column name;
+-- should work. Now c1.name is local and inhcount is 0.
+alter table p2 drop column name;
+-- should be rejected since its inherited
+alter table gc1 drop column name;
+ERROR: cannot drop inherited column "name"
+-- should work, and drop gc1.name along
+alter table c1 drop column name;
+-- should fail: column does not exist
+alter table gc1 drop column name;
+ERROR: column "name" of relation "gc1" does not exist
+-- should work and drop the attribute in all tables
+alter table p2 drop column height;
+-- IF EXISTS test
+create table dropColumnExists ();
+alter table dropColumnExists drop column non_existing; --fail
+ERROR: column "non_existing" of relation "dropcolumnexists" does not exist
+alter table dropColumnExists drop column if exists non_existing; --succeed
+NOTICE: column "non_existing" of relation "dropcolumnexists" does not exist, skipping
+select relname, attname, attinhcount, attislocal
+from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
+where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
+order by relname, attnum;
+ relname | attname | attinhcount | attislocal
+---------+---------+-------------+------------
+ c1 | id | 1 | f
+ c1 | id2 | 1 | f
+ c1 | age | 0 | t
+ gc1 | id | 1 | f
+ gc1 | id2 | 1 | f
+ gc1 | age | 1 | f
+ p1 | id | 0 | t
+ p2 | id2 | 0 | t
+(8 rows)
+
+drop table p1, p2 cascade;
+NOTICE: drop cascades to 2 other objects
+DETAIL: drop cascades to table c1
+drop cascades to table gc1
+-- test attinhcount tracking with merged columns
+create table depth0();
+create table depth1(c text) inherits (depth0);
+create table depth2() inherits (depth1);
+alter table depth0 add c text;
+NOTICE: merging definition of column "c" for child "depth1"
+select attrelid::regclass, attname, attinhcount, attislocal
+from pg_attribute
+where attnum > 0 and attrelid::regclass in ('depth0', 'depth1', 'depth2')
+order by attrelid::regclass::text, attnum;
+ attrelid | attname | attinhcount | attislocal
+----------+---------+-------------+------------
+ depth0 | c | 0 | t
+ depth1 | c | 1 | t
+ depth2 | c | 1 | f
+(3 rows)
+
+-- test renumbering of child-table columns in inherited operations
+create table p1 (f1 int);
+create table c1 (f2 text, f3 int) inherits (p1);
+alter table p1 add column a1 int check (a1 > 0);
+alter table p1 add column f2 text;
+NOTICE: merging definition of column "f2" for child "c1"
+insert into p1 values (1,2,'abc');
+insert into c1 values(11,'xyz',33,0); -- should fail
+ERROR: new row for relation "c1" violates check constraint "p1_a1_check"
+DETAIL: Failing row contains (11, xyz, 33, 0).
+insert into c1 values(11,'xyz',33,22);
+select * from p1;
+ f1 | a1 | f2
+----+----+-----
+ 1 | 2 | abc
+ 11 | 22 | xyz
+(2 rows)
+
+update p1 set a1 = a1 + 1, f2 = upper(f2);
+select * from p1;
+ f1 | a1 | f2
+----+----+-----
+ 1 | 3 | ABC
+ 11 | 23 | XYZ
+(2 rows)
+
+drop table p1 cascade;
+NOTICE: drop cascades to table c1
+-- test that operations with a dropped column do not try to reference
+-- its datatype
+create domain mytype as text;
+create temp table foo (f1 text, f2 mytype, f3 text);
+insert into foo values('bb','cc','dd');
+select * from foo;
+ f1 | f2 | f3
+----+----+----
+ bb | cc | dd
+(1 row)
+
+drop domain mytype cascade;
+NOTICE: drop cascades to column f2 of table foo
+select * from foo;
+ f1 | f3
+----+----
+ bb | dd
+(1 row)
+
+insert into foo values('qq','rr');
+select * from foo;
+ f1 | f3
+----+----
+ bb | dd
+ qq | rr
+(2 rows)
+
+update foo set f3 = 'zz';
+select * from foo;
+ f1 | f3
+----+----
+ bb | zz
+ qq | zz
+(2 rows)
+
+select f3,max(f1) from foo group by f3;
+ f3 | max
+----+-----
+ zz | qq
+(1 row)
+
+-- Simple tests for alter table column type
+alter table foo alter f1 TYPE integer; -- fails
+ERROR: column "f1" cannot be cast automatically to type integer
+HINT: You might need to specify "USING f1::integer".
+alter table foo alter f1 TYPE varchar(10);
+create table anothertab (atcol1 serial8, atcol2 boolean,
+ constraint anothertab_chk check (atcol1 <= 3));
+insert into anothertab (atcol1, atcol2) values (default, true);
+insert into anothertab (atcol1, atcol2) values (default, false);
+select * from anothertab;
+ atcol1 | atcol2
+--------+--------
+ 1 | t
+ 2 | f
+(2 rows)
+
+alter table anothertab alter column atcol1 type boolean; -- fails
+ERROR: column "atcol1" cannot be cast automatically to type boolean
+HINT: You might need to specify "USING atcol1::boolean".
+alter table anothertab alter column atcol1 type boolean using atcol1::int; -- fails
+ERROR: result of USING clause for column "atcol1" cannot be cast automatically to type boolean
+HINT: You might need to add an explicit cast.
+alter table anothertab alter column atcol1 type integer;
+select * from anothertab;
+ atcol1 | atcol2
+--------+--------
+ 1 | t
+ 2 | f
+(2 rows)
+
+insert into anothertab (atcol1, atcol2) values (45, null); -- fails
+ERROR: new row for relation "anothertab" violates check constraint "anothertab_chk"
+DETAIL: Failing row contains (45, null).
+insert into anothertab (atcol1, atcol2) values (default, null);
+select * from anothertab;
+ atcol1 | atcol2
+--------+--------
+ 1 | t
+ 2 | f
+ 3 |
+(3 rows)
+
+alter table anothertab alter column atcol2 type text
+ using case when atcol2 is true then 'IT WAS TRUE'
+ when atcol2 is false then 'IT WAS FALSE'
+ else 'IT WAS NULL!' end;
+select * from anothertab;
+ atcol1 | atcol2
+--------+--------------
+ 1 | IT WAS TRUE
+ 2 | IT WAS FALSE
+ 3 | IT WAS NULL!
+(3 rows)
+
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end; -- fails
+ERROR: default for column "atcol1" cannot be cast automatically to type boolean
+alter table anothertab alter column atcol1 drop default;
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end; -- fails
+ERROR: operator does not exist: boolean <= integer
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+alter table anothertab drop constraint anothertab_chk;
+alter table anothertab drop constraint anothertab_chk; -- fails
+ERROR: constraint "anothertab_chk" of relation "anothertab" does not exist
+alter table anothertab drop constraint IF EXISTS anothertab_chk; -- succeeds
+NOTICE: constraint "anothertab_chk" of relation "anothertab" does not exist, skipping
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end;
+select * from anothertab;
+ atcol1 | atcol2
+--------+--------------
+ f | IT WAS TRUE
+ t | IT WAS FALSE
+ f | IT WAS NULL!
+(3 rows)
+
+drop table anothertab;
+-- Test index handling in alter table column type (cf. bugs #15835, #15865)
+create table anothertab(f1 int primary key, f2 int unique,
+ f3 int, f4 int, f5 int);
+alter table anothertab
+ add exclude using btree (f3 with =);
+alter table anothertab
+ add exclude using btree (f4 with =) where (f4 is not null);
+alter table anothertab
+ add exclude using btree (f4 with =) where (f5 > 0);
+alter table anothertab
+ add unique(f1,f4);
+create index on anothertab(f2,f3);
+create unique index on anothertab(f4);
+\d anothertab
+ Table "public.anothertab"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ f1 | integer | | not null |
+ f2 | integer | | |
+ f3 | integer | | |
+ f4 | integer | | |
+ f5 | integer | | |
+Indexes:
+ "anothertab_pkey" PRIMARY KEY, btree (f1)
+ "anothertab_f1_f4_key" UNIQUE CONSTRAINT, btree (f1, f4)
+ "anothertab_f2_f3_idx" btree (f2, f3)
+ "anothertab_f2_key" UNIQUE CONSTRAINT, btree (f2)
+ "anothertab_f3_excl" EXCLUDE USING btree (f3 WITH =)
+ "anothertab_f4_excl" EXCLUDE USING btree (f4 WITH =) WHERE (f4 IS NOT NULL)
+ "anothertab_f4_excl1" EXCLUDE USING btree (f4 WITH =) WHERE (f5 > 0)
+ "anothertab_f4_idx" UNIQUE, btree (f4)
+
+alter table anothertab alter column f1 type bigint;
+alter table anothertab
+ alter column f2 type bigint,
+ alter column f3 type bigint,
+ alter column f4 type bigint;
+alter table anothertab alter column f5 type bigint;
+\d anothertab
+ Table "public.anothertab"
+ Column | Type | Collation | Nullable | Default
+--------+--------+-----------+----------+---------
+ f1 | bigint | | not null |
+ f2 | bigint | | |
+ f3 | bigint | | |
+ f4 | bigint | | |
+ f5 | bigint | | |
+Indexes:
+ "anothertab_pkey" PRIMARY KEY, btree (f1)
+ "anothertab_f1_f4_key" UNIQUE CONSTRAINT, btree (f1, f4)
+ "anothertab_f2_f3_idx" btree (f2, f3)
+ "anothertab_f2_key" UNIQUE CONSTRAINT, btree (f2)
+ "anothertab_f3_excl" EXCLUDE USING btree (f3 WITH =)
+ "anothertab_f4_excl" EXCLUDE USING btree (f4 WITH =) WHERE (f4 IS NOT NULL)
+ "anothertab_f4_excl1" EXCLUDE USING btree (f4 WITH =) WHERE (f5 > 0)
+ "anothertab_f4_idx" UNIQUE, btree (f4)
+
+drop table anothertab;
+-- test that USING expressions are parsed before column alter type / drop steps
+create table another (f1 int, f2 text, f3 text);
+insert into another values(1, 'one', 'uno');
+insert into another values(2, 'two', 'due');
+insert into another values(3, 'three', 'tre');
+select * from another;
+ f1 | f2 | f3
+----+-------+-----
+ 1 | one | uno
+ 2 | two | due
+ 3 | three | tre
+(3 rows)
+
+alter table another
+ alter f1 type text using f2 || ' and ' || f3 || ' more',
+ alter f2 type bigint using f1 * 10,
+ drop column f3;
+select * from another;
+ f1 | f2
+--------------------+----
+ one and uno more | 10
+ two and due more | 20
+ three and tre more | 30
+(3 rows)
+
+drop table another;
+-- Create an index that skips WAL, then perform a SET DATA TYPE that skips
+-- rewriting the index.
+begin;
+create table skip_wal_skip_rewrite_index (c varchar(10) primary key);
+alter table skip_wal_skip_rewrite_index alter c type varchar(20);
+commit;
+-- We disallow changing table's row type if it's used for storage
+create table at_tab1 (a int, b text);
+create table at_tab2 (x int, y at_tab1);
+alter table at_tab1 alter column b type varchar; -- fails
+ERROR: cannot alter table "at_tab1" because column "at_tab2.y" uses its row type
+drop table at_tab2;
+-- Use of row type in an expression is defended differently
+create table at_tab2 (x int, y text, check((x,y)::at_tab1 = (1,'42')::at_tab1));
+alter table at_tab1 alter column b type varchar; -- allowed, but ...
+insert into at_tab2 values(1,'42'); -- ... this will fail
+ERROR: ROW() column has type text instead of type character varying
+drop table at_tab1, at_tab2;
+-- Check it for a partitioned table, too
+create table at_tab1 (a int, b text) partition by list(a);
+create table at_tab2 (x int, y at_tab1);
+alter table at_tab1 alter column b type varchar; -- fails
+ERROR: cannot alter table "at_tab1" because column "at_tab2.y" uses its row type
+drop table at_tab1, at_tab2;
+-- Alter column type that's part of a partitioned index
+create table at_partitioned (a int, b text) partition by range (a);
+create table at_part_1 partition of at_partitioned for values from (0) to (1000);
+insert into at_partitioned values (512, '0.123');
+create table at_part_2 (b text, a int);
+insert into at_part_2 values ('1.234', 1024);
+create index on at_partitioned (b);
+create index on at_partitioned (a);
+\d at_part_1
+ Table "public.at_part_1"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+Partition of: at_partitioned FOR VALUES FROM (0) TO (1000)
+Indexes:
+ "at_part_1_a_idx" btree (a)
+ "at_part_1_b_idx" btree (b)
+
+\d at_part_2
+ Table "public.at_part_2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ b | text | | |
+ a | integer | | |
+
+alter table at_partitioned attach partition at_part_2 for values from (1000) to (2000);
+\d at_part_2
+ Table "public.at_part_2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ b | text | | |
+ a | integer | | |
+Partition of: at_partitioned FOR VALUES FROM (1000) TO (2000)
+Indexes:
+ "at_part_2_a_idx" btree (a)
+ "at_part_2_b_idx" btree (b)
+
+alter table at_partitioned alter column b type numeric using b::numeric;
+\d at_part_1
+ Table "public.at_part_1"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | numeric | | |
+Partition of: at_partitioned FOR VALUES FROM (0) TO (1000)
+Indexes:
+ "at_part_1_a_idx" btree (a)
+ "at_part_1_b_idx" btree (b)
+
+\d at_part_2
+ Table "public.at_part_2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ b | numeric | | |
+ a | integer | | |
+Partition of: at_partitioned FOR VALUES FROM (1000) TO (2000)
+Indexes:
+ "at_part_2_a_idx" btree (a)
+ "at_part_2_b_idx" btree (b)
+
+drop table at_partitioned;
+-- Alter column type when no table rewrite is required
+-- Also check that comments are preserved
+create table at_partitioned(id int, name varchar(64), unique (id, name))
+ partition by hash(id);
+comment on constraint at_partitioned_id_name_key on at_partitioned is 'parent constraint';
+comment on index at_partitioned_id_name_key is 'parent index';
+create table at_partitioned_0 partition of at_partitioned
+ for values with (modulus 2, remainder 0);
+comment on constraint at_partitioned_0_id_name_key on at_partitioned_0 is 'child 0 constraint';
+comment on index at_partitioned_0_id_name_key is 'child 0 index';
+create table at_partitioned_1 partition of at_partitioned
+ for values with (modulus 2, remainder 1);
+comment on constraint at_partitioned_1_id_name_key on at_partitioned_1 is 'child 1 constraint';
+comment on index at_partitioned_1_id_name_key is 'child 1 index';
+insert into at_partitioned values(1, 'foo');
+insert into at_partitioned values(3, 'bar');
+create temp table old_oids as
+ select relname, oid as oldoid, relfilenode as oldfilenode
+ from pg_class where relname like 'at_partitioned%';
+select relname,
+ c.oid = oldoid as orig_oid,
+ case relfilenode
+ when 0 then 'none'
+ when c.oid then 'own'
+ when oldfilenode then 'orig'
+ else 'OTHER'
+ end as storage,
+ obj_description(c.oid, 'pg_class') as desc
+ from pg_class c left join old_oids using (relname)
+ where relname like 'at_partitioned%'
+ order by relname;
+ relname | orig_oid | storage | desc
+------------------------------+----------+---------+---------------
+ at_partitioned | t | none |
+ at_partitioned_0 | t | own |
+ at_partitioned_0_id_name_key | t | own | child 0 index
+ at_partitioned_1 | t | own |
+ at_partitioned_1_id_name_key | t | own | child 1 index
+ at_partitioned_id_name_key | t | none | parent index
+(6 rows)
+
+select conname, obj_description(oid, 'pg_constraint') as desc
+ from pg_constraint where conname like 'at_partitioned%'
+ order by conname;
+ conname | desc
+------------------------------+--------------------
+ at_partitioned_0_id_name_key | child 0 constraint
+ at_partitioned_1_id_name_key | child 1 constraint
+ at_partitioned_id_name_key | parent constraint
+(3 rows)
+
+alter table at_partitioned alter column name type varchar(127);
+-- Note: these tests currently show the wrong behavior for comments :-(
+select relname,
+ c.oid = oldoid as orig_oid,
+ case relfilenode
+ when 0 then 'none'
+ when c.oid then 'own'
+ when oldfilenode then 'orig'
+ else 'OTHER'
+ end as storage,
+ obj_description(c.oid, 'pg_class') as desc
+ from pg_class c left join old_oids using (relname)
+ where relname like 'at_partitioned%'
+ order by relname;
+ relname | orig_oid | storage | desc
+------------------------------+----------+---------+--------------
+ at_partitioned | t | none |
+ at_partitioned_0 | t | own |
+ at_partitioned_0_id_name_key | f | own | parent index
+ at_partitioned_1 | t | own |
+ at_partitioned_1_id_name_key | f | own | parent index
+ at_partitioned_id_name_key | f | none | parent index
+(6 rows)
+
+select conname, obj_description(oid, 'pg_constraint') as desc
+ from pg_constraint where conname like 'at_partitioned%'
+ order by conname;
+ conname | desc
+------------------------------+-------------------
+ at_partitioned_0_id_name_key |
+ at_partitioned_1_id_name_key |
+ at_partitioned_id_name_key | parent constraint
+(3 rows)
+
+-- Don't remove this DROP, it exposes bug #15672
+drop table at_partitioned;
+-- disallow recursive containment of row types
+create temp table recur1 (f1 int);
+alter table recur1 add column f2 recur1; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
+alter table recur1 add column f2 recur1[]; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
+create domain array_of_recur1 as recur1[];
+alter table recur1 add column f2 array_of_recur1; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
+create temp table recur2 (f1 int, f2 recur1);
+alter table recur1 add column f2 recur2; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
+alter table recur1 add column f2 int;
+alter table recur1 alter column f2 type recur2; -- fails
+ERROR: composite type recur1 cannot be made a member of itself
+-- SET STORAGE may need to add a TOAST table
+create table test_storage (a text);
+alter table test_storage alter a set storage plain;
+alter table test_storage add b int default 0; -- rewrite table to remove its TOAST table
+alter table test_storage alter a set storage extended; -- re-add TOAST table
+select reltoastrelid <> 0 as has_toast_table
+from pg_class
+where oid = 'test_storage'::regclass;
+ has_toast_table
+-----------------
+ t
+(1 row)
+
+-- test that SET STORAGE propagates to index correctly
+create index test_storage_idx on test_storage (b, a);
+alter table test_storage alter column a set storage external;
+\d+ test_storage
+ Table "public.test_storage"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | external | |
+ b | integer | | | 0 | plain | |
+Indexes:
+ "test_storage_idx" btree (b, a)
+
+\d+ test_storage_idx
+ Index "public.test_storage_idx"
+ Column | Type | Key? | Definition | Storage | Stats target
+--------+---------+------+------------+----------+--------------
+ b | integer | yes | b | plain |
+ a | text | yes | a | external |
+btree, for table "public.test_storage"
+
+-- ALTER COLUMN TYPE with a check constraint and a child table (bug #13779)
+CREATE TABLE test_inh_check (a float check (a > 10.2), b float);
+CREATE TABLE test_inh_check_child() INHERITS(test_inh_check);
+\d test_inh_check
+ Table "public.test_inh_check"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | double precision | | |
+ b | double precision | | |
+Check constraints:
+ "test_inh_check_a_check" CHECK (a > 10.2::double precision)
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d test_inh_check_child
+ Table "public.test_inh_check_child"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | double precision | | |
+ b | double precision | | |
+Check constraints:
+ "test_inh_check_a_check" CHECK (a > 10.2::double precision)
+Inherits: test_inh_check
+
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ relname | conname | coninhcount | conislocal | connoinherit
+----------------------+------------------------+-------------+------------+--------------
+ test_inh_check | test_inh_check_a_check | 0 | t | f
+ test_inh_check_child | test_inh_check_a_check | 1 | f | f
+(2 rows)
+
+ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
+\d test_inh_check
+ Table "public.test_inh_check"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | numeric | | |
+ b | double precision | | |
+Check constraints:
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d test_inh_check_child
+ Table "public.test_inh_check_child"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | numeric | | |
+ b | double precision | | |
+Check constraints:
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Inherits: test_inh_check
+
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ relname | conname | coninhcount | conislocal | connoinherit
+----------------------+------------------------+-------------+------------+--------------
+ test_inh_check | test_inh_check_a_check | 0 | t | f
+ test_inh_check_child | test_inh_check_a_check | 1 | f | f
+(2 rows)
+
+-- also try noinherit, local, and local+inherited cases
+ALTER TABLE test_inh_check ADD CONSTRAINT bnoinherit CHECK (b > 100) NO INHERIT;
+ALTER TABLE test_inh_check_child ADD CONSTRAINT blocal CHECK (b < 1000);
+ALTER TABLE test_inh_check_child ADD CONSTRAINT bmerged CHECK (b > 1);
+ALTER TABLE test_inh_check ADD CONSTRAINT bmerged CHECK (b > 1);
+NOTICE: merging constraint "bmerged" with inherited definition
+\d test_inh_check
+ Table "public.test_inh_check"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | numeric | | |
+ b | double precision | | |
+Check constraints:
+ "bmerged" CHECK (b > 1::double precision)
+ "bnoinherit" CHECK (b > 100::double precision) NO INHERIT
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d test_inh_check_child
+ Table "public.test_inh_check_child"
+ Column | Type | Collation | Nullable | Default
+--------+------------------+-----------+----------+---------
+ a | numeric | | |
+ b | double precision | | |
+Check constraints:
+ "blocal" CHECK (b < 1000::double precision)
+ "bmerged" CHECK (b > 1::double precision)
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Inherits: test_inh_check
+
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ relname | conname | coninhcount | conislocal | connoinherit
+----------------------+------------------------+-------------+------------+--------------
+ test_inh_check | bmerged | 0 | t | f
+ test_inh_check | bnoinherit | 0 | t | t
+ test_inh_check | test_inh_check_a_check | 0 | t | f
+ test_inh_check_child | blocal | 0 | t | f
+ test_inh_check_child | bmerged | 1 | t | f
+ test_inh_check_child | test_inh_check_a_check | 1 | f | f
+(6 rows)
+
+ALTER TABLE test_inh_check ALTER COLUMN b TYPE numeric;
+NOTICE: merging constraint "bmerged" with inherited definition
+\d test_inh_check
+ Table "public.test_inh_check"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | numeric | | |
+ b | numeric | | |
+Check constraints:
+ "bmerged" CHECK (b::double precision > 1::double precision)
+ "bnoinherit" CHECK (b::double precision > 100::double precision) NO INHERIT
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Number of child tables: 1 (Use \d+ to list them.)
+
+\d test_inh_check_child
+ Table "public.test_inh_check_child"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | numeric | | |
+ b | numeric | | |
+Check constraints:
+ "blocal" CHECK (b::double precision < 1000::double precision)
+ "bmerged" CHECK (b::double precision > 1::double precision)
+ "test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
+Inherits: test_inh_check
+
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ relname | conname | coninhcount | conislocal | connoinherit
+----------------------+------------------------+-------------+------------+--------------
+ test_inh_check | bmerged | 0 | t | f
+ test_inh_check | bnoinherit | 0 | t | t
+ test_inh_check | test_inh_check_a_check | 0 | t | f
+ test_inh_check_child | blocal | 0 | t | f
+ test_inh_check_child | bmerged | 1 | t | f
+ test_inh_check_child | test_inh_check_a_check | 1 | f | f
+(6 rows)
+
+-- ALTER COLUMN TYPE with different schema in children
+-- Bug at https://postgr.es/m/20170102225618.GA10071@telsasoft.com
+CREATE TABLE test_type_diff (f1 int);
+CREATE TABLE test_type_diff_c (extra smallint) INHERITS (test_type_diff);
+ALTER TABLE test_type_diff ADD COLUMN f2 int;
+INSERT INTO test_type_diff_c VALUES (1, 2, 3);
+ALTER TABLE test_type_diff ALTER COLUMN f2 TYPE bigint USING f2::bigint;
+CREATE TABLE test_type_diff2 (int_two int2, int_four int4, int_eight int8);
+CREATE TABLE test_type_diff2_c1 (int_four int4, int_eight int8, int_two int2);
+CREATE TABLE test_type_diff2_c2 (int_eight int8, int_two int2, int_four int4);
+CREATE TABLE test_type_diff2_c3 (int_two int2, int_four int4, int_eight int8);
+ALTER TABLE test_type_diff2_c1 INHERIT test_type_diff2;
+ALTER TABLE test_type_diff2_c2 INHERIT test_type_diff2;
+ALTER TABLE test_type_diff2_c3 INHERIT test_type_diff2;
+INSERT INTO test_type_diff2_c1 VALUES (1, 2, 3);
+INSERT INTO test_type_diff2_c2 VALUES (4, 5, 6);
+INSERT INTO test_type_diff2_c3 VALUES (7, 8, 9);
+ALTER TABLE test_type_diff2 ALTER COLUMN int_four TYPE int8 USING int_four::int8;
+-- whole-row references are disallowed
+ALTER TABLE test_type_diff2 ALTER COLUMN int_four TYPE int4 USING (pg_column_size(test_type_diff2));
+ERROR: cannot convert whole-row table reference
+DETAIL: USING expression contains a whole-row table reference.
+-- check for rollback of ANALYZE corrupting table property flags (bug #11638)
+CREATE TABLE check_fk_presence_1 (id int PRIMARY KEY, t text);
+CREATE TABLE check_fk_presence_2 (id int REFERENCES check_fk_presence_1, t text);
+BEGIN;
+ALTER TABLE check_fk_presence_2 DROP CONSTRAINT check_fk_presence_2_id_fkey;
+ANALYZE check_fk_presence_2;
+ROLLBACK;
+\d check_fk_presence_2
+ Table "public.check_fk_presence_2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+ t | text | | |
+Foreign-key constraints:
+ "check_fk_presence_2_id_fkey" FOREIGN KEY (id) REFERENCES check_fk_presence_1(id)
+
+DROP TABLE check_fk_presence_1, check_fk_presence_2;
+-- check column addition within a view (bug #14876)
+create table at_base_table(id int, stuff text);
+insert into at_base_table values (23, 'skidoo');
+create view at_view_1 as select * from at_base_table bt;
+create view at_view_2 as select *, to_json(v1) as j from at_view_1 v1;
+\d+ at_view_1
+ View "public.at_view_1"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------+-----------+----------+---------+----------+-------------
+ id | integer | | | | plain |
+ stuff | text | | | | extended |
+View definition:
+ SELECT bt.id,
+ bt.stuff
+ FROM at_base_table bt;
+
+\d+ at_view_2
+ View "public.at_view_2"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------+-----------+----------+---------+----------+-------------
+ id | integer | | | | plain |
+ stuff | text | | | | extended |
+ j | json | | | | extended |
+View definition:
+ SELECT v1.id,
+ v1.stuff,
+ to_json(v1.*) AS j
+ FROM at_view_1 v1;
+
+explain (verbose, costs off) select * from at_view_2;
+ QUERY PLAN
+----------------------------------------------------------
+ Seq Scan on public.at_base_table bt
+ Output: bt.id, bt.stuff, to_json(ROW(bt.id, bt.stuff))
+(2 rows)
+
+select * from at_view_2;
+ id | stuff | j
+----+--------+----------------------------
+ 23 | skidoo | {"id":23,"stuff":"skidoo"}
+(1 row)
+
+create or replace view at_view_1 as select *, 2+2 as more from at_base_table bt;
+\d+ at_view_1
+ View "public.at_view_1"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------+-----------+----------+---------+----------+-------------
+ id | integer | | | | plain |
+ stuff | text | | | | extended |
+ more | integer | | | | plain |
+View definition:
+ SELECT bt.id,
+ bt.stuff,
+ 2 + 2 AS more
+ FROM at_base_table bt;
+
+\d+ at_view_2
+ View "public.at_view_2"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------+-----------+----------+---------+----------+-------------
+ id | integer | | | | plain |
+ stuff | text | | | | extended |
+ j | json | | | | extended |
+View definition:
+ SELECT v1.id,
+ v1.stuff,
+ to_json(v1.*) AS j
+ FROM at_view_1 v1;
+
+explain (verbose, costs off) select * from at_view_2;
+ QUERY PLAN
+----------------------------------------------------------------
+ Seq Scan on public.at_base_table bt
+ Output: bt.id, bt.stuff, to_json(ROW(bt.id, bt.stuff, NULL))
+(2 rows)
+
+select * from at_view_2;
+ id | stuff | j
+----+--------+----------------------------------------
+ 23 | skidoo | {"id":23,"stuff":"skidoo","more":null}
+(1 row)
+
+drop view at_view_2;
+drop view at_view_1;
+drop table at_base_table;
+-- check adding a column not iself requiring a rewrite, together with
+-- a column requiring a default (bug #16038)
+-- ensure that rewrites aren't silently optimized away, removing the
+-- value of the test
+CREATE FUNCTION check_ddl_rewrite(p_tablename regclass, p_ddl text)
+RETURNS boolean
+LANGUAGE plpgsql AS $$
+DECLARE
+ v_relfilenode oid;
+BEGIN
+ v_relfilenode := relfilenode FROM pg_class WHERE oid = p_tablename;
+
+ EXECUTE p_ddl;
+
+ RETURN v_relfilenode <> (SELECT relfilenode FROM pg_class WHERE oid = p_tablename);
+END;
+$$;
+CREATE TABLE rewrite_test(col text);
+INSERT INTO rewrite_test VALUES ('something');
+INSERT INTO rewrite_test VALUES (NULL);
+-- empty[12] don't need rewrite, but notempty[12]_rewrite will force one
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty1 text,
+ ADD COLUMN notempty1_rewrite serial;
+$$);
+ check_ddl_rewrite
+-------------------
+ t
+(1 row)
+
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty2_rewrite serial,
+ ADD COLUMN empty2 text;
+$$);
+ check_ddl_rewrite
+-------------------
+ t
+(1 row)
+
+-- also check that fast defaults cause no problem, first without rewrite
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty3 text,
+ ADD COLUMN notempty3_norewrite int default 42;
+$$);
+ check_ddl_rewrite
+-------------------
+ f
+(1 row)
+
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty4_norewrite int default 42,
+ ADD COLUMN empty4 text;
+$$);
+ check_ddl_rewrite
+-------------------
+ f
+(1 row)
+
+-- then with rewrite
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty5 text,
+ ADD COLUMN notempty5_norewrite int default 42,
+ ADD COLUMN notempty5_rewrite serial;
+$$);
+ check_ddl_rewrite
+-------------------
+ t
+(1 row)
+
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty6_rewrite serial,
+ ADD COLUMN empty6 text,
+ ADD COLUMN notempty6_norewrite int default 42;
+$$);
+ check_ddl_rewrite
+-------------------
+ t
+(1 row)
+
+-- cleanup
+DROP FUNCTION check_ddl_rewrite(regclass, text);
+DROP TABLE rewrite_test;
+--
+-- lock levels
+--
+drop type lockmodes;
+ERROR: type "lockmodes" does not exist
+create type lockmodes as enum (
+ 'SIReadLock'
+,'AccessShareLock'
+,'RowShareLock'
+,'RowExclusiveLock'
+,'ShareUpdateExclusiveLock'
+,'ShareLock'
+,'ShareRowExclusiveLock'
+,'ExclusiveLock'
+,'AccessExclusiveLock'
+);
+drop view my_locks;
+ERROR: view "my_locks" does not exist
+create or replace view my_locks as
+select case when c.relname like 'pg_toast%' then 'pg_toast' else c.relname end, max(mode::lockmodes) as max_lockmode
+from pg_locks l join pg_class c on l.relation = c.oid
+where virtualtransaction = (
+ select virtualtransaction
+ from pg_locks
+ where transactionid = pg_current_xact_id()::xid)
+and locktype = 'relation'
+and relnamespace != (select oid from pg_namespace where nspname = 'pg_catalog')
+and c.relname != 'my_locks'
+group by c.relname;
+create table alterlock (f1 int primary key, f2 text);
+insert into alterlock values (1, 'foo');
+create table alterlock2 (f3 int primary key, f1 int);
+insert into alterlock2 values (1, 1);
+begin; alter table alterlock alter column f2 set statistics 150;
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+(1 row)
+
+rollback;
+begin; alter table alterlock cluster on alterlock_pkey;
+select * from my_locks order by 1;
+ relname | max_lockmode
+----------------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ alterlock_pkey | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock set without cluster;
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+(1 row)
+
+commit;
+begin; alter table alterlock set (fillfactor = 100);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ pg_toast | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock reset (fillfactor);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ pg_toast | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock set (toast.autovacuum_enabled = off);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ pg_toast | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock set (autovacuum_enabled = off);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ pg_toast | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock alter column f2 set (n_distinct = 1);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+(1 row)
+
+rollback;
+-- test that mixing options with different lock levels works as expected
+begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+--------------------------
+ alterlock | ShareUpdateExclusiveLock
+ pg_toast | ShareUpdateExclusiveLock
+(2 rows)
+
+commit;
+begin; alter table alterlock alter column f2 set storage extended;
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+---------------------
+ alterlock | AccessExclusiveLock
+(1 row)
+
+rollback;
+begin; alter table alterlock alter column f2 set default 'x';
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+---------------------
+ alterlock | AccessExclusiveLock
+(1 row)
+
+rollback;
+begin;
+create trigger ttdummy
+ before delete or update on alterlock
+ for each row
+ execute procedure
+ ttdummy (1, 1);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------+-----------------------
+ alterlock | ShareRowExclusiveLock
+(1 row)
+
+rollback;
+begin;
+select * from my_locks order by 1;
+ relname | max_lockmode
+---------+--------------
+(0 rows)
+
+alter table alterlock2 add foreign key (f1) references alterlock (f1);
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------------+-----------------------
+ alterlock | ShareRowExclusiveLock
+ alterlock2 | ShareRowExclusiveLock
+ alterlock2_pkey | AccessShareLock
+ alterlock_pkey | AccessShareLock
+(4 rows)
+
+rollback;
+begin;
+alter table alterlock2
+add constraint alterlock2nv foreign key (f1) references alterlock (f1) NOT VALID;
+select * from my_locks order by 1;
+ relname | max_lockmode
+------------+-----------------------
+ alterlock | ShareRowExclusiveLock
+ alterlock2 | ShareRowExclusiveLock
+(2 rows)
+
+commit;
+begin;
+alter table alterlock2 validate constraint alterlock2nv;
+select * from my_locks order by 1;
+ relname | max_lockmode
+-----------------+--------------------------
+ alterlock | RowShareLock
+ alterlock2 | ShareUpdateExclusiveLock
+ alterlock2_pkey | AccessShareLock
+ alterlock_pkey | AccessShareLock
+(4 rows)
+
+rollback;
+create or replace view my_locks as
+select case when c.relname like 'pg_toast%' then 'pg_toast' else c.relname end, max(mode::lockmodes) as max_lockmode
+from pg_locks l join pg_class c on l.relation = c.oid
+where virtualtransaction = (
+ select virtualtransaction
+ from pg_locks
+ where transactionid = pg_current_xact_id()::xid)
+and locktype = 'relation'
+and relnamespace != (select oid from pg_namespace where nspname = 'pg_catalog')
+and c.relname = 'my_locks'
+group by c.relname;
+-- raise exception
+alter table my_locks set (autovacuum_enabled = false);
+ERROR: unrecognized parameter "autovacuum_enabled"
+alter view my_locks set (autovacuum_enabled = false);
+ERROR: unrecognized parameter "autovacuum_enabled"
+alter table my_locks reset (autovacuum_enabled);
+alter view my_locks reset (autovacuum_enabled);
+begin;
+alter view my_locks set (security_barrier=off);
+select * from my_locks order by 1;
+ relname | max_lockmode
+----------+---------------------
+ my_locks | AccessExclusiveLock
+(1 row)
+
+alter view my_locks reset (security_barrier);
+rollback;
+-- this test intentionally applies the ALTER TABLE command against a view, but
+-- uses a view option so we expect this to succeed. This form of SQL is
+-- accepted for historical reasons, as shown in the docs for ALTER VIEW
+begin;
+alter table my_locks set (security_barrier=off);
+select * from my_locks order by 1;
+ relname | max_lockmode
+----------+---------------------
+ my_locks | AccessExclusiveLock
+(1 row)
+
+alter table my_locks reset (security_barrier);
+rollback;
+-- cleanup
+drop table alterlock2;
+drop table alterlock;
+drop view my_locks;
+drop type lockmodes;
+--
+-- alter function
+--
+create function test_strict(text) returns text as
+ 'select coalesce($1, ''got passed a null'');'
+ language sql returns null on null input;
+select test_strict(NULL);
+ test_strict
+-------------
+
+(1 row)
+
+alter function test_strict(text) called on null input;
+select test_strict(NULL);
+ test_strict
+-------------------
+ got passed a null
+(1 row)
+
+create function non_strict(text) returns text as
+ 'select coalesce($1, ''got passed a null'');'
+ language sql called on null input;
+select non_strict(NULL);
+ non_strict
+-------------------
+ got passed a null
+(1 row)
+
+alter function non_strict(text) returns null on null input;
+select non_strict(NULL);
+ non_strict
+------------
+
+(1 row)
+
+--
+-- alter object set schema
+--
+create schema alter1;
+create schema alter2;
+create table alter1.t1(f1 serial primary key, f2 int check (f2 > 0));
+create view alter1.v1 as select * from alter1.t1;
+create function alter1.plus1(int) returns int as 'select $1+1' language sql;
+create domain alter1.posint integer check (value > 0);
+create type alter1.ctype as (f1 int, f2 text);
+create function alter1.same(alter1.ctype, alter1.ctype) returns boolean language sql
+as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
+create operator alter1.=(procedure = alter1.same, leftarg = alter1.ctype, rightarg = alter1.ctype);
+create operator class alter1.ctype_hash_ops default for type alter1.ctype using hash as
+ operator 1 alter1.=(alter1.ctype, alter1.ctype);
+create conversion alter1.latin1_to_utf8 for 'latin1' to 'utf8' from iso8859_1_to_utf8;
+create text search parser alter1.prs(start = prsd_start, gettoken = prsd_nexttoken, end = prsd_end, lextypes = prsd_lextype);
+create text search configuration alter1.cfg(parser = alter1.prs);
+create text search template alter1.tmpl(init = dsimple_init, lexize = dsimple_lexize);
+create text search dictionary alter1.dict(template = alter1.tmpl);
+insert into alter1.t1(f2) values(11);
+insert into alter1.t1(f2) values(12);
+alter table alter1.t1 set schema alter1; -- no-op, same schema
+alter table alter1.t1 set schema alter2;
+alter table alter1.v1 set schema alter2;
+alter function alter1.plus1(int) set schema alter2;
+alter domain alter1.posint set schema alter2;
+alter operator class alter1.ctype_hash_ops using hash set schema alter2;
+alter operator family alter1.ctype_hash_ops using hash set schema alter2;
+alter operator alter1.=(alter1.ctype, alter1.ctype) set schema alter2;
+alter function alter1.same(alter1.ctype, alter1.ctype) set schema alter2;
+alter type alter1.ctype set schema alter1; -- no-op, same schema
+alter type alter1.ctype set schema alter2;
+alter conversion alter1.latin1_to_utf8 set schema alter2;
+alter text search parser alter1.prs set schema alter2;
+alter text search configuration alter1.cfg set schema alter2;
+alter text search template alter1.tmpl set schema alter2;
+alter text search dictionary alter1.dict set schema alter2;
+-- this should succeed because nothing is left in alter1
+drop schema alter1;
+insert into alter2.t1(f2) values(13);
+insert into alter2.t1(f2) values(14);
+select * from alter2.t1;
+ f1 | f2
+----+----
+ 1 | 11
+ 2 | 12
+ 3 | 13
+ 4 | 14
+(4 rows)
+
+select * from alter2.v1;
+ f1 | f2
+----+----
+ 1 | 11
+ 2 | 12
+ 3 | 13
+ 4 | 14
+(4 rows)
+
+select alter2.plus1(41);
+ plus1
+-------
+ 42
+(1 row)
+
+-- clean up
+drop schema alter2 cascade;
+NOTICE: drop cascades to 13 other objects
+DETAIL: drop cascades to table alter2.t1
+drop cascades to view alter2.v1
+drop cascades to function alter2.plus1(integer)
+drop cascades to type alter2.posint
+drop cascades to type alter2.ctype
+drop cascades to function alter2.same(alter2.ctype,alter2.ctype)
+drop cascades to operator alter2.=(alter2.ctype,alter2.ctype)
+drop cascades to operator family alter2.ctype_hash_ops for access method hash
+drop cascades to conversion alter2.latin1_to_utf8
+drop cascades to text search parser alter2.prs
+drop cascades to text search configuration alter2.cfg
+drop cascades to text search template alter2.tmpl
+drop cascades to text search dictionary alter2.dict
+--
+-- composite types
+--
+CREATE TYPE test_type AS (a int);
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+
+ALTER TYPE nosuchtype ADD ATTRIBUTE b text; -- fails
+ERROR: relation "nosuchtype" does not exist
+ALTER TYPE test_type ADD ATTRIBUTE b text;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+
+ALTER TYPE test_type ADD ATTRIBUTE b text; -- fails
+ERROR: column "b" of relation "test_type" already exists
+ALTER TYPE test_type ALTER ATTRIBUTE b SET DATA TYPE varchar;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+-------------------+-----------+----------+---------
+ a | integer | | |
+ b | character varying | | |
+
+ALTER TYPE test_type ALTER ATTRIBUTE b SET DATA TYPE integer;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+
+ALTER TYPE test_type DROP ATTRIBUTE b;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+
+ALTER TYPE test_type DROP ATTRIBUTE c; -- fails
+ERROR: column "c" of relation "test_type" does not exist
+ALTER TYPE test_type DROP ATTRIBUTE IF EXISTS c;
+NOTICE: column "c" of relation "test_type" does not exist, skipping
+ALTER TYPE test_type DROP ATTRIBUTE a, ADD ATTRIBUTE d boolean;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ d | boolean | | |
+
+ALTER TYPE test_type RENAME ATTRIBUTE a TO aa;
+ERROR: column "a" does not exist
+ALTER TYPE test_type RENAME ATTRIBUTE d TO dd;
+\d test_type
+ Composite type "public.test_type"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ dd | boolean | | |
+
+DROP TYPE test_type;
+CREATE TYPE test_type1 AS (a int, b text);
+CREATE TABLE test_tbl1 (x int, y test_type1);
+ALTER TYPE test_type1 ALTER ATTRIBUTE b TYPE varchar; -- fails
+ERROR: cannot alter type "test_type1" because column "test_tbl1.y" uses it
+CREATE TYPE test_type2 AS (a int, b text);
+CREATE TABLE test_tbl2 OF test_type2;
+CREATE TABLE test_tbl2_subclass () INHERITS (test_tbl2);
+\d test_type2
+ Composite type "public.test_type2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+
+\d test_tbl2
+ Table "public.test_tbl2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+Number of child tables: 1 (Use \d+ to list them.)
+Typed table of type: test_type2
+
+ALTER TYPE test_type2 ADD ATTRIBUTE c text; -- fails
+ERROR: cannot alter type "test_type2" because it is the type of a typed table
+HINT: Use ALTER ... CASCADE to alter the typed tables too.
+ALTER TYPE test_type2 ADD ATTRIBUTE c text CASCADE;
+\d test_type2
+ Composite type "public.test_type2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+ c | text | | |
+
+\d test_tbl2
+ Table "public.test_tbl2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | text | | |
+ c | text | | |
+Number of child tables: 1 (Use \d+ to list them.)
+Typed table of type: test_type2
+
+ALTER TYPE test_type2 ALTER ATTRIBUTE b TYPE varchar; -- fails
+ERROR: cannot alter type "test_type2" because it is the type of a typed table
+HINT: Use ALTER ... CASCADE to alter the typed tables too.
+ALTER TYPE test_type2 ALTER ATTRIBUTE b TYPE varchar CASCADE;
+\d test_type2
+ Composite type "public.test_type2"
+ Column | Type | Collation | Nullable | Default
+--------+-------------------+-----------+----------+---------
+ a | integer | | |
+ b | character varying | | |
+ c | text | | |
+
+\d test_tbl2
+ Table "public.test_tbl2"
+ Column | Type | Collation | Nullable | Default
+--------+-------------------+-----------+----------+---------
+ a | integer | | |
+ b | character varying | | |
+ c | text | | |
+Number of child tables: 1 (Use \d+ to list them.)
+Typed table of type: test_type2
+
+ALTER TYPE test_type2 DROP ATTRIBUTE b; -- fails
+ERROR: cannot alter type "test_type2" because it is the type of a typed table
+HINT: Use ALTER ... CASCADE to alter the typed tables too.
+ALTER TYPE test_type2 DROP ATTRIBUTE b CASCADE;
+\d test_type2
+ Composite type "public.test_type2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ c | text | | |
+
+\d test_tbl2
+ Table "public.test_tbl2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ c | text | | |
+Number of child tables: 1 (Use \d+ to list them.)
+Typed table of type: test_type2
+
+ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa; -- fails
+ERROR: cannot alter type "test_type2" because it is the type of a typed table
+HINT: Use ALTER ... CASCADE to alter the typed tables too.
+ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa CASCADE;
+\d test_type2
+ Composite type "public.test_type2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ aa | integer | | |
+ c | text | | |
+
+\d test_tbl2
+ Table "public.test_tbl2"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ aa | integer | | |
+ c | text | | |
+Number of child tables: 1 (Use \d+ to list them.)
+Typed table of type: test_type2
+
+\d test_tbl2_subclass
+ Table "public.test_tbl2_subclass"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ aa | integer | | |
+ c | text | | |
+Inherits: test_tbl2
+
+DROP TABLE test_tbl2_subclass;
+CREATE TYPE test_typex AS (a int, b text);
+CREATE TABLE test_tblx (x int, y test_typex check ((y).a > 0));
+ALTER TYPE test_typex DROP ATTRIBUTE a; -- fails
+ERROR: cannot drop column a of composite type test_typex because other objects depend on it
+DETAIL: constraint test_tblx_y_check on table test_tblx depends on column a of composite type test_typex
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+ALTER TYPE test_typex DROP ATTRIBUTE a CASCADE;
+NOTICE: drop cascades to constraint test_tblx_y_check on table test_tblx
+\d test_tblx
+ Table "public.test_tblx"
+ Column | Type | Collation | Nullable | Default
+--------+------------+-----------+----------+---------
+ x | integer | | |
+ y | test_typex | | |
+
+DROP TABLE test_tblx;
+DROP TYPE test_typex;
+-- This test isn't that interesting on its own, but the purpose is to leave
+-- behind a table to test pg_upgrade with. The table has a composite type
+-- column in it, and the composite type has a dropped attribute.
+CREATE TYPE test_type3 AS (a int);
+CREATE TABLE test_tbl3 (c) AS SELECT '(1)'::test_type3;
+ALTER TYPE test_type3 DROP ATTRIBUTE a, ADD ATTRIBUTE b int;
+CREATE TYPE test_type_empty AS ();
+DROP TYPE test_type_empty;
+--
+-- typed tables: OF / NOT OF
+--
+CREATE TYPE tt_t0 AS (z inet, x int, y numeric(8,2));
+ALTER TYPE tt_t0 DROP ATTRIBUTE z;
+CREATE TABLE tt0 (x int NOT NULL, y numeric(8,2)); -- OK
+CREATE TABLE tt1 (x int, y bigint); -- wrong base type
+CREATE TABLE tt2 (x int, y numeric(9,2)); -- wrong typmod
+CREATE TABLE tt3 (y numeric(8,2), x int); -- wrong column order
+CREATE TABLE tt4 (x int); -- too few columns
+CREATE TABLE tt5 (x int, y numeric(8,2), z int); -- too few columns
+CREATE TABLE tt6 () INHERITS (tt0); -- can't have a parent
+CREATE TABLE tt7 (x int, q text, y numeric(8,2));
+ALTER TABLE tt7 DROP q; -- OK
+ALTER TABLE tt0 OF tt_t0;
+ALTER TABLE tt1 OF tt_t0;
+ERROR: table "tt1" has different type for column "y"
+ALTER TABLE tt2 OF tt_t0;
+ERROR: table "tt2" has different type for column "y"
+ALTER TABLE tt3 OF tt_t0;
+ERROR: table has column "y" where type requires "x"
+ALTER TABLE tt4 OF tt_t0;
+ERROR: table is missing column "y"
+ALTER TABLE tt5 OF tt_t0;
+ERROR: table has extra column "z"
+ALTER TABLE tt6 OF tt_t0;
+ERROR: typed tables cannot inherit
+ALTER TABLE tt7 OF tt_t0;
+CREATE TYPE tt_t1 AS (x int, y numeric(8,2));
+ALTER TABLE tt7 OF tt_t1; -- reassign an already-typed table
+ALTER TABLE tt7 NOT OF;
+\d tt7
+ Table "public.tt7"
+ Column | Type | Collation | Nullable | Default
+--------+--------------+-----------+----------+---------
+ x | integer | | |
+ y | numeric(8,2) | | |
+
+-- make sure we can drop a constraint on the parent but it remains on the child
+CREATE TABLE test_drop_constr_parent (c text CHECK (c IS NOT NULL));
+CREATE TABLE test_drop_constr_child () INHERITS (test_drop_constr_parent);
+ALTER TABLE ONLY test_drop_constr_parent DROP CONSTRAINT "test_drop_constr_parent_c_check";
+-- should fail
+INSERT INTO test_drop_constr_child (c) VALUES (NULL);
+ERROR: new row for relation "test_drop_constr_child" violates check constraint "test_drop_constr_parent_c_check"
+DETAIL: Failing row contains (null).
+DROP TABLE test_drop_constr_parent CASCADE;
+NOTICE: drop cascades to table test_drop_constr_child
+--
+-- IF EXISTS test
+--
+ALTER TABLE IF EXISTS tt8 ADD COLUMN f int;
+NOTICE: relation "tt8" does not exist, skipping
+ALTER TABLE IF EXISTS tt8 ADD CONSTRAINT xxx PRIMARY KEY(f);
+NOTICE: relation "tt8" does not exist, skipping
+ALTER TABLE IF EXISTS tt8 ADD CHECK (f BETWEEN 0 AND 10);
+NOTICE: relation "tt8" does not exist, skipping
+ALTER TABLE IF EXISTS tt8 ALTER COLUMN f SET DEFAULT 0;
+NOTICE: relation "tt8" does not exist, skipping
+ALTER TABLE IF EXISTS tt8 RENAME COLUMN f TO f1;
+NOTICE: relation "tt8" does not exist, skipping
+ALTER TABLE IF EXISTS tt8 SET SCHEMA alter2;
+NOTICE: relation "tt8" does not exist, skipping
+CREATE TABLE tt8(a int);
+CREATE SCHEMA alter2;
+ALTER TABLE IF EXISTS tt8 ADD COLUMN f int;
+ALTER TABLE IF EXISTS tt8 ADD CONSTRAINT xxx PRIMARY KEY(f);
+ALTER TABLE IF EXISTS tt8 ADD CHECK (f BETWEEN 0 AND 10);
+ALTER TABLE IF EXISTS tt8 ALTER COLUMN f SET DEFAULT 0;
+ALTER TABLE IF EXISTS tt8 RENAME COLUMN f TO f1;
+ALTER TABLE IF EXISTS tt8 SET SCHEMA alter2;
+\d alter2.tt8
+ Table "alter2.tt8"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ f1 | integer | | not null | 0
+Indexes:
+ "xxx" PRIMARY KEY, btree (f1)
+Check constraints:
+ "tt8_f_check" CHECK (f1 >= 0 AND f1 <= 10)
+
+DROP TABLE alter2.tt8;
+DROP SCHEMA alter2;
+--
+-- Check conflicts between index and CHECK constraint names
+--
+CREATE TABLE tt9(c integer);
+ALTER TABLE tt9 ADD CHECK(c > 1);
+ALTER TABLE tt9 ADD CHECK(c > 2); -- picks nonconflicting name
+ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 3);
+ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 4); -- fail, dup name
+ERROR: constraint "foo" for relation "tt9" already exists
+ALTER TABLE tt9 ADD UNIQUE(c);
+ALTER TABLE tt9 ADD UNIQUE(c); -- picks nonconflicting name
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key UNIQUE(c); -- fail, dup name
+ERROR: relation "tt9_c_key" already exists
+ALTER TABLE tt9 ADD CONSTRAINT foo UNIQUE(c); -- fail, dup name
+ERROR: constraint "foo" for relation "tt9" already exists
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key CHECK(c > 5); -- fail, dup name
+ERROR: constraint "tt9_c_key" for relation "tt9" already exists
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key2 CHECK(c > 6);
+ALTER TABLE tt9 ADD UNIQUE(c); -- picks nonconflicting name
+\d tt9
+ Table "public.tt9"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c | integer | | |
+Indexes:
+ "tt9_c_key" UNIQUE CONSTRAINT, btree (c)
+ "tt9_c_key1" UNIQUE CONSTRAINT, btree (c)
+ "tt9_c_key3" UNIQUE CONSTRAINT, btree (c)
+Check constraints:
+ "foo" CHECK (c > 3)
+ "tt9_c_check" CHECK (c > 1)
+ "tt9_c_check1" CHECK (c > 2)
+ "tt9_c_key2" CHECK (c > 6)
+
+DROP TABLE tt9;
+-- Check that comments on constraints and indexes are not lost at ALTER TABLE.
+CREATE TABLE comment_test (
+ id int,
+ positive_col int CHECK (positive_col > 0),
+ indexed_col int,
+ CONSTRAINT comment_test_pk PRIMARY KEY (id));
+CREATE INDEX comment_test_index ON comment_test(indexed_col);
+COMMENT ON COLUMN comment_test.id IS 'Column ''id'' on comment_test';
+COMMENT ON INDEX comment_test_index IS 'Simple index on comment_test';
+COMMENT ON CONSTRAINT comment_test_positive_col_check ON comment_test IS 'CHECK constraint on comment_test.positive_col';
+COMMENT ON CONSTRAINT comment_test_pk ON comment_test IS 'PRIMARY KEY constraint of comment_test';
+COMMENT ON INDEX comment_test_pk IS 'Index backing the PRIMARY KEY of comment_test';
+SELECT col_description('comment_test'::regclass, 1) as comment;
+ comment
+-----------------------------
+ Column 'id' on comment_test
+(1 row)
+
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
+ index | comment
+--------------------+-----------------------------------------------
+ comment_test_index | Simple index on comment_test
+ comment_test_pk | Index backing the PRIMARY KEY of comment_test
+(2 rows)
+
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
+ constraint | comment
+---------------------------------+-----------------------------------------------
+ comment_test_pk | PRIMARY KEY constraint of comment_test
+ comment_test_positive_col_check | CHECK constraint on comment_test.positive_col
+(2 rows)
+
+-- Change the datatype of all the columns. ALTER TABLE is optimized to not
+-- rebuild an index if the new data type is binary compatible with the old
+-- one. Check do a dummy ALTER TABLE that doesn't change the datatype
+-- first, to test that no-op codepath, and another one that does.
+ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE bigint;
+-- Check that the comments are intact.
+SELECT col_description('comment_test'::regclass, 1) as comment;
+ comment
+-----------------------------
+ Column 'id' on comment_test
+(1 row)
+
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
+ index | comment
+--------------------+-----------------------------------------------
+ comment_test_index | Simple index on comment_test
+ comment_test_pk | Index backing the PRIMARY KEY of comment_test
+(2 rows)
+
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
+ constraint | comment
+---------------------------------+-----------------------------------------------
+ comment_test_pk | PRIMARY KEY constraint of comment_test
+ comment_test_positive_col_check | CHECK constraint on comment_test.positive_col
+(2 rows)
+
+-- Check compatibility for foreign keys and comments. This is done
+-- separately as rebuilding the column type of the parent leads
+-- to an error and would reduce the test scope.
+CREATE TABLE comment_test_child (
+ id text CONSTRAINT comment_test_child_fk REFERENCES comment_test);
+CREATE INDEX comment_test_child_fk ON comment_test_child(id);
+COMMENT ON COLUMN comment_test_child.id IS 'Column ''id'' on comment_test_child';
+COMMENT ON INDEX comment_test_child_fk IS 'Index backing the FOREIGN KEY of comment_test_child';
+COMMENT ON CONSTRAINT comment_test_child_fk ON comment_test_child IS 'FOREIGN KEY constraint of comment_test_child';
+-- Change column type of parent
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE int USING id::integer;
+ERROR: foreign key constraint "comment_test_child_fk" cannot be implemented
+DETAIL: Key columns "id" and "id" are of incompatible types: text and integer.
+-- Comments should be intact
+SELECT col_description('comment_test_child'::regclass, 1) as comment;
+ comment
+-----------------------------------
+ Column 'id' on comment_test_child
+(1 row)
+
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test_child'::regclass ORDER BY 1, 2;
+ index | comment
+-----------------------+-----------------------------------------------------
+ comment_test_child_fk | Index backing the FOREIGN KEY of comment_test_child
+(1 row)
+
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test_child'::regclass ORDER BY 1, 2;
+ constraint | comment
+-----------------------+----------------------------------------------
+ comment_test_child_fk | FOREIGN KEY constraint of comment_test_child
+(1 row)
+
+-- Check that we map relation oids to filenodes and back correctly. Only
+-- display bad mappings so the test output doesn't change all the time. A
+-- filenode function call can return NULL for a relation dropped concurrently
+-- with the call's surrounding query, so ignore a NULL mapped_oid for
+-- relations that no longer exist after all calls finish.
+CREATE TEMP TABLE filenode_mapping AS
+SELECT
+ oid, mapped_oid, reltablespace, relfilenode, relname
+FROM pg_class,
+ pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) AS mapped_oid
+WHERE relkind IN ('r', 'i', 'S', 't', 'm') AND mapped_oid IS DISTINCT FROM oid;
+SELECT m.* FROM filenode_mapping m LEFT JOIN pg_class c ON c.oid = m.oid
+WHERE c.oid IS NOT NULL OR m.mapped_oid IS NOT NULL;
+ oid | mapped_oid | reltablespace | relfilenode | relname
+-----+------------+---------------+-------------+---------
+(0 rows)
+
+-- Checks on creating and manipulation of user defined relations in
+-- pg_catalog.
+SHOW allow_system_table_mods;
+ allow_system_table_mods
+-------------------------
+ off
+(1 row)
+
+-- disallowed because of search_path issues with pg_dump
+CREATE TABLE pg_catalog.new_system_table();
+ERROR: permission denied to create "pg_catalog.new_system_table"
+DETAIL: System catalog modifications are currently disallowed.
+-- instead create in public first, move to catalog
+CREATE TABLE new_system_table(id serial primary key, othercol text);
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+ALTER TABLE new_system_table SET SCHEMA public;
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+-- will be ignored -- already there:
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+ALTER TABLE new_system_table RENAME TO old_system_table;
+CREATE INDEX old_system_table__othercol ON old_system_table (othercol);
+INSERT INTO old_system_table(othercol) VALUES ('somedata'), ('otherdata');
+UPDATE old_system_table SET id = -id;
+DELETE FROM old_system_table WHERE othercol = 'somedata';
+TRUNCATE old_system_table;
+ALTER TABLE old_system_table DROP CONSTRAINT new_system_table_pkey;
+ALTER TABLE old_system_table DROP COLUMN othercol;
+DROP TABLE old_system_table;
+-- set logged
+CREATE UNLOGGED TABLE unlogged1(f1 SERIAL PRIMARY KEY, f2 TEXT);
+-- check relpersistence of an unlogged table
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1'
+ORDER BY relname;
+ relname | relkind | relpersistence
+------------------+---------+----------------
+ toast index | i | u
+ toast table | t | u
+ unlogged1 | r | u
+ unlogged1_f1_seq | S | p
+ unlogged1_pkey | i | u
+(5 rows)
+
+CREATE UNLOGGED TABLE unlogged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged1); -- foreign key
+CREATE UNLOGGED TABLE unlogged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged3); -- self-referencing foreign key
+ALTER TABLE unlogged3 SET LOGGED; -- skip self-referencing foreign key
+ALTER TABLE unlogged2 SET LOGGED; -- fails because a foreign key to an unlogged table exists
+ERROR: could not change table "unlogged2" to logged because it references unlogged table "unlogged1"
+ALTER TABLE unlogged1 SET LOGGED;
+-- check relpersistence of an unlogged table after changing to permanent
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1'
+ORDER BY relname;
+ relname | relkind | relpersistence
+------------------+---------+----------------
+ toast index | i | p
+ toast table | t | p
+ unlogged1 | r | p
+ unlogged1_f1_seq | S | p
+ unlogged1_pkey | i | p
+(5 rows)
+
+ALTER TABLE unlogged1 SET LOGGED; -- silently do nothing
+DROP TABLE unlogged3;
+DROP TABLE unlogged2;
+DROP TABLE unlogged1;
+-- set unlogged
+CREATE TABLE logged1(f1 SERIAL PRIMARY KEY, f2 TEXT);
+-- check relpersistence of a permanent table
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^logged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1'
+ORDER BY relname;
+ relname | relkind | relpersistence
+----------------+---------+----------------
+ logged1 | r | p
+ logged1_f1_seq | S | p
+ logged1_pkey | i | p
+ toast index | i | p
+ toast table | t | p
+(5 rows)
+
+CREATE TABLE logged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged1); -- foreign key
+CREATE TABLE logged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged3); -- self-referencing foreign key
+ALTER TABLE logged1 SET UNLOGGED; -- fails because a foreign key from a permanent table exists
+ERROR: could not change table "logged1" to unlogged because it references logged table "logged2"
+ALTER TABLE logged3 SET UNLOGGED; -- skip self-referencing foreign key
+ALTER TABLE logged2 SET UNLOGGED;
+ALTER TABLE logged1 SET UNLOGGED;
+-- check relpersistence of a permanent table after changing to unlogged
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^logged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1'
+ORDER BY relname;
+ relname | relkind | relpersistence
+----------------+---------+----------------
+ logged1 | r | u
+ logged1_f1_seq | S | p
+ logged1_pkey | i | u
+ toast index | i | u
+ toast table | t | u
+(5 rows)
+
+ALTER TABLE logged1 SET UNLOGGED; -- silently do nothing
+DROP TABLE logged3;
+DROP TABLE logged2;
+DROP TABLE logged1;
+-- test ADD COLUMN IF NOT EXISTS
+CREATE TABLE test_add_column(c1 integer);
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer;
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer; -- fail because c2 already exists
+ERROR: column "c2" of relation "test_add_column" already exists
+ALTER TABLE ONLY test_add_column
+ ADD COLUMN c2 integer; -- fail because c2 already exists
+ERROR: column "c2" of relation "test_add_column" already exists
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer; -- skipping because c2 already exists
+NOTICE: column "c2" of relation "test_add_column" already exists, skipping
+ALTER TABLE ONLY test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer; -- skipping because c2 already exists
+NOTICE: column "c2" of relation "test_add_column" already exists, skipping
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer, -- fail because c2 already exists
+ ADD COLUMN c3 integer primary key;
+ERROR: column "c2" of relation "test_add_column" already exists
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN c3 integer primary key;
+NOTICE: column "c2" of relation "test_add_column" already exists, skipping
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN IF NOT EXISTS c3 integer primary key; -- skipping because c3 already exists
+NOTICE: column "c2" of relation "test_add_column" already exists, skipping
+NOTICE: column "c3" of relation "test_add_column" already exists, skipping
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN IF NOT EXISTS c3 integer, -- skipping because c3 already exists
+ ADD COLUMN c4 integer REFERENCES test_add_column;
+NOTICE: column "c2" of relation "test_add_column" already exists, skipping
+NOTICE: column "c3" of relation "test_add_column" already exists, skipping
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+ c4 | integer | | |
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+Foreign-key constraints:
+ "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+Referenced by:
+ TABLE "test_add_column" CONSTRAINT "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c4 integer REFERENCES test_add_column;
+NOTICE: column "c4" of relation "test_add_column" already exists, skipping
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+ c4 | integer | | |
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+Foreign-key constraints:
+ "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+Referenced by:
+ TABLE "test_add_column" CONSTRAINT "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c5 SERIAL CHECK (c5 > 8);
+\d test_add_column
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------------------------------------------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+ c4 | integer | | |
+ c5 | integer | | not null | nextval('test_add_column_c5_seq'::regclass)
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+Check constraints:
+ "test_add_column_c5_check" CHECK (c5 > 8)
+Foreign-key constraints:
+ "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+Referenced by:
+ TABLE "test_add_column" CONSTRAINT "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c5 SERIAL CHECK (c5 > 10);
+NOTICE: column "c5" of relation "test_add_column" already exists, skipping
+\d test_add_column*
+ Table "public.test_add_column"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------------------------------------------
+ c1 | integer | | |
+ c2 | integer | | |
+ c3 | integer | | not null |
+ c4 | integer | | |
+ c5 | integer | | not null | nextval('test_add_column_c5_seq'::regclass)
+Indexes:
+ "test_add_column_pkey" PRIMARY KEY, btree (c3)
+Check constraints:
+ "test_add_column_c5_check" CHECK (c5 > 8)
+Foreign-key constraints:
+ "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+Referenced by:
+ TABLE "test_add_column" CONSTRAINT "test_add_column_c4_fkey" FOREIGN KEY (c4) REFERENCES test_add_column(c3)
+
+ Sequence "public.test_add_column_c5_seq"
+ Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
+---------+-------+---------+------------+-----------+---------+-------
+ integer | 1 | 1 | 2147483647 | 1 | no | 1
+Owned by: public.test_add_column.c5
+
+ Index "public.test_add_column_pkey"
+ Column | Type | Key? | Definition
+--------+---------+------+------------
+ c3 | integer | yes | c3
+primary key, btree, for table "public.test_add_column"
+
+DROP TABLE test_add_column;
+\d test_add_column*
+-- assorted cases with multiple ALTER TABLE steps
+CREATE TABLE ataddindex(f1 INT);
+INSERT INTO ataddindex VALUES (42), (43);
+CREATE UNIQUE INDEX ataddindexi0 ON ataddindex(f1);
+ALTER TABLE ataddindex
+ ADD PRIMARY KEY USING INDEX ataddindexi0,
+ ALTER f1 TYPE BIGINT;
+\d ataddindex
+ Table "public.ataddindex"
+ Column | Type | Collation | Nullable | Default
+--------+--------+-----------+----------+---------
+ f1 | bigint | | not null |
+Indexes:
+ "ataddindexi0" PRIMARY KEY, btree (f1)
+
+DROP TABLE ataddindex;
+CREATE TABLE ataddindex(f1 VARCHAR(10));
+INSERT INTO ataddindex(f1) VALUES ('foo'), ('a');
+ALTER TABLE ataddindex
+ ALTER f1 SET DATA TYPE TEXT,
+ ADD EXCLUDE ((f1 LIKE 'a') WITH =);
+\d ataddindex
+ Table "public.ataddindex"
+ Column | Type | Collation | Nullable | Default
+--------+------+-----------+----------+---------
+ f1 | text | | |
+Indexes:
+ "ataddindex_expr_excl" EXCLUDE USING btree ((f1 ~~ 'a'::text) WITH =)
+
+DROP TABLE ataddindex;
+CREATE TABLE ataddindex(id int, ref_id int);
+ALTER TABLE ataddindex
+ ADD PRIMARY KEY (id),
+ ADD FOREIGN KEY (ref_id) REFERENCES ataddindex;
+\d ataddindex
+ Table "public.ataddindex"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | not null |
+ ref_id | integer | | |
+Indexes:
+ "ataddindex_pkey" PRIMARY KEY, btree (id)
+Foreign-key constraints:
+ "ataddindex_ref_id_fkey" FOREIGN KEY (ref_id) REFERENCES ataddindex(id)
+Referenced by:
+ TABLE "ataddindex" CONSTRAINT "ataddindex_ref_id_fkey" FOREIGN KEY (ref_id) REFERENCES ataddindex(id)
+
+DROP TABLE ataddindex;
+CREATE TABLE ataddindex(id int, ref_id int);
+ALTER TABLE ataddindex
+ ADD UNIQUE (id),
+ ADD FOREIGN KEY (ref_id) REFERENCES ataddindex (id);
+\d ataddindex
+ Table "public.ataddindex"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+ ref_id | integer | | |
+Indexes:
+ "ataddindex_id_key" UNIQUE CONSTRAINT, btree (id)
+Foreign-key constraints:
+ "ataddindex_ref_id_fkey" FOREIGN KEY (ref_id) REFERENCES ataddindex(id)
+Referenced by:
+ TABLE "ataddindex" CONSTRAINT "ataddindex_ref_id_fkey" FOREIGN KEY (ref_id) REFERENCES ataddindex(id)
+
+DROP TABLE ataddindex;
+-- unsupported constraint types for partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (a, (a+b+1));
+ALTER TABLE partitioned ADD EXCLUDE USING gist (a WITH &&);
+ERROR: exclusion constraints are not supported on partitioned tables
+LINE 1: ALTER TABLE partitioned ADD EXCLUDE USING gist (a WITH &&);
+ ^
+-- cannot drop column that is part of the partition key
+ALTER TABLE partitioned DROP COLUMN a;
+ERROR: cannot drop column "a" because it is part of the partition key of relation "partitioned"
+ALTER TABLE partitioned ALTER COLUMN a TYPE char(5);
+ERROR: cannot alter column "a" because it is part of the partition key of relation "partitioned"
+ALTER TABLE partitioned DROP COLUMN b;
+ERROR: cannot drop column "b" because it is part of the partition key of relation "partitioned"
+ALTER TABLE partitioned ALTER COLUMN b TYPE char(5);
+ERROR: cannot alter column "b" because it is part of the partition key of relation "partitioned"
+-- partitioned table cannot participate in regular inheritance
+CREATE TABLE nonpartitioned (
+ a int,
+ b int
+);
+ALTER TABLE partitioned INHERIT nonpartitioned;
+ERROR: cannot change inheritance of partitioned table
+ALTER TABLE nonpartitioned INHERIT partitioned;
+ERROR: cannot inherit from partitioned table "partitioned"
+-- cannot add NO INHERIT constraint to partitioned tables
+ALTER TABLE partitioned ADD CONSTRAINT chk_a CHECK (a > 0) NO INHERIT;
+ERROR: cannot add NO INHERIT constraint to partitioned table "partitioned"
+DROP TABLE partitioned, nonpartitioned;
+--
+-- ATTACH PARTITION
+--
+-- check that target table is partitioned
+CREATE TABLE unparted (
+ a int
+);
+CREATE TABLE fail_part (like unparted);
+ALTER TABLE unparted ATTACH PARTITION fail_part FOR VALUES IN ('a');
+ERROR: table "unparted" is not partitioned
+DROP TABLE unparted, fail_part;
+-- check that partition bound is compatible
+CREATE TABLE list_parted (
+ a int NOT NULL,
+ b char(2) COLLATE "C",
+ CONSTRAINT check_a CHECK (a > 0)
+) PARTITION BY LIST (a);
+CREATE TABLE fail_part (LIKE list_parted);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES FROM (1) TO (10);
+ERROR: invalid bound specification for a list partition
+LINE 1: ...list_parted ATTACH PARTITION fail_part FOR VALUES FROM (1) T...
+ ^
+DROP TABLE fail_part;
+-- check that the table being attached exists
+ALTER TABLE list_parted ATTACH PARTITION nonexistent FOR VALUES IN (1);
+ERROR: relation "nonexistent" does not exist
+-- check ownership of the source table
+CREATE ROLE regress_test_me;
+CREATE ROLE regress_test_not_me;
+CREATE TABLE not_owned_by_me (LIKE list_parted);
+ALTER TABLE not_owned_by_me OWNER TO regress_test_not_me;
+SET SESSION AUTHORIZATION regress_test_me;
+CREATE TABLE owned_by_me (
+ a int
+) PARTITION BY LIST (a);
+ALTER TABLE owned_by_me ATTACH PARTITION not_owned_by_me FOR VALUES IN (1);
+ERROR: must be owner of table not_owned_by_me
+RESET SESSION AUTHORIZATION;
+DROP TABLE owned_by_me, not_owned_by_me;
+DROP ROLE regress_test_not_me;
+DROP ROLE regress_test_me;
+-- check that the table being attached is not part of regular inheritance
+CREATE TABLE parent (LIKE list_parted);
+CREATE TABLE child () INHERITS (parent);
+ALTER TABLE list_parted ATTACH PARTITION child FOR VALUES IN (1);
+ERROR: cannot attach inheritance child as partition
+ALTER TABLE list_parted ATTACH PARTITION parent FOR VALUES IN (1);
+ERROR: cannot attach inheritance parent as partition
+DROP TABLE parent CASCADE;
+NOTICE: drop cascades to table child
+-- check any TEMP-ness
+CREATE TEMP TABLE temp_parted (a int) PARTITION BY LIST (a);
+CREATE TABLE perm_part (a int);
+ALTER TABLE temp_parted ATTACH PARTITION perm_part FOR VALUES IN (1);
+ERROR: cannot attach a permanent relation as partition of temporary relation "temp_parted"
+DROP TABLE temp_parted, perm_part;
+-- check that the table being attached is not a typed table
+CREATE TYPE mytype AS (a int);
+CREATE TABLE fail_part OF mytype;
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: cannot attach a typed table as partition
+DROP TYPE mytype CASCADE;
+NOTICE: drop cascades to table fail_part
+-- check that the table being attached has only columns present in the parent
+CREATE TABLE fail_part (like list_parted, c int);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: table "fail_part" contains column "c" not found in parent "list_parted"
+DETAIL: The new partition may contain only the columns present in parent.
+DROP TABLE fail_part;
+-- check that the table being attached has every column of the parent
+CREATE TABLE fail_part (a int NOT NULL);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: child table is missing column "b"
+DROP TABLE fail_part;
+-- check that columns match in type, collation and NOT NULL status
+CREATE TABLE fail_part (
+ b char(3),
+ a int NOT NULL
+);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: child table "fail_part" has different type for column "b"
+ALTER TABLE fail_part ALTER b TYPE char (2) COLLATE "POSIX";
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: child table "fail_part" has different collation for column "b"
+DROP TABLE fail_part;
+-- check that the table being attached has all constraints of the parent
+CREATE TABLE fail_part (
+ b char(2) COLLATE "C",
+ a int NOT NULL
+);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: child table is missing constraint "check_a"
+-- check that the constraint matches in definition with parent's constraint
+ALTER TABLE fail_part ADD CONSTRAINT check_a CHECK (a >= 0);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: child table "fail_part" has different definition for check constraint "check_a"
+DROP TABLE fail_part;
+-- check the attributes and constraints after partition is attached
+CREATE TABLE part_1 (
+ a int NOT NULL,
+ b char(2) COLLATE "C",
+ CONSTRAINT check_a CHECK (a > 0)
+);
+ALTER TABLE list_parted ATTACH PARTITION part_1 FOR VALUES IN (1);
+-- attislocal and conislocal are always false for merged attributes and constraints respectively.
+SELECT attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_1'::regclass AND attnum > 0;
+ attislocal | attinhcount
+------------+-------------
+ f | 1
+ f | 1
+(2 rows)
+
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_1'::regclass AND conname = 'check_a';
+ conislocal | coninhcount
+------------+-------------
+ f | 1
+(1 row)
+
+-- check that the new partition won't overlap with an existing partition
+CREATE TABLE fail_part (LIKE part_1 INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ERROR: partition "fail_part" would overlap partition "part_1"
+LINE 1: ...LE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ ^
+DROP TABLE fail_part;
+-- check that an existing table can be attached as a default partition
+CREATE TABLE def_part (LIKE list_parted INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION def_part DEFAULT;
+-- check attaching default partition fails if a default partition already
+-- exists
+CREATE TABLE fail_def_part (LIKE part_1 INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION fail_def_part DEFAULT;
+ERROR: partition "fail_def_part" conflicts with existing default partition "def_part"
+LINE 1: ...ER TABLE list_parted ATTACH PARTITION fail_def_part DEFAULT;
+ ^
+-- check validation when attaching list partitions
+CREATE TABLE list_parted2 (
+ a int,
+ b char
+) PARTITION BY LIST (a);
+-- check that violating rows are correctly reported
+CREATE TABLE part_2 (LIKE list_parted2);
+INSERT INTO part_2 VALUES (3, 'a');
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+ERROR: partition constraint of relation "part_2" is violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM part_2;
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+-- check partition cannot be attached if default has some row for its values
+CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+INSERT INTO list_parted2_def VALUES (11, 'z');
+CREATE TABLE part_3 (LIKE list_parted2);
+ALTER TABLE list_parted2 ATTACH PARTITION part_3 FOR VALUES IN (11);
+ERROR: updated partition constraint for default partition "list_parted2_def" would be violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM list_parted2_def WHERE a = 11;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3 FOR VALUES IN (11);
+-- adding constraints that describe the desired partition constraint
+-- (or more restrictive) will help skip the validation scan
+CREATE TABLE part_3_4 (
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IN (3))
+);
+-- however, if a list partition does not accept nulls, there should be
+-- an explicit NOT NULL constraint on the partition key column for the
+-- validation scan to be skipped;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3_4 FOR VALUES IN (3, 4);
+-- adding a NOT NULL constraint will cause the scan to be skipped
+ALTER TABLE list_parted2 DETACH PARTITION part_3_4;
+ALTER TABLE part_3_4 ALTER a SET NOT NULL;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3_4 FOR VALUES IN (3, 4);
+-- check if default partition scan skipped
+ALTER TABLE list_parted2_def ADD CONSTRAINT check_a CHECK (a IN (5, 6));
+CREATE TABLE part_55_66 PARTITION OF list_parted2 FOR VALUES IN (55, 66);
+-- check validation when attaching range partitions
+CREATE TABLE range_parted (
+ a int,
+ b int
+) PARTITION BY RANGE (a, b);
+-- check that violating rows are correctly reported
+CREATE TABLE part1 (
+ a int NOT NULL CHECK (a = 1),
+ b int NOT NULL CHECK (b >= 1 AND b <= 10)
+);
+INSERT INTO part1 VALUES (1, 10);
+-- Remember the TO bound is exclusive
+ALTER TABLE range_parted ATTACH PARTITION part1 FOR VALUES FROM (1, 1) TO (1, 10);
+ERROR: partition constraint of relation "part1" is violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM part1;
+ALTER TABLE range_parted ATTACH PARTITION part1 FOR VALUES FROM (1, 1) TO (1, 10);
+-- adding constraints that describe the desired partition constraint
+-- (or more restrictive) will help skip the validation scan
+CREATE TABLE part2 (
+ a int NOT NULL CHECK (a = 1),
+ b int NOT NULL CHECK (b >= 10 AND b < 18)
+);
+ALTER TABLE range_parted ATTACH PARTITION part2 FOR VALUES FROM (1, 10) TO (1, 20);
+-- Create default partition
+CREATE TABLE partr_def1 PARTITION OF range_parted DEFAULT;
+-- Only one default partition is allowed, hence, following should give error
+CREATE TABLE partr_def2 (LIKE part1 INCLUDING CONSTRAINTS);
+ALTER TABLE range_parted ATTACH PARTITION partr_def2 DEFAULT;
+ERROR: partition "partr_def2" conflicts with existing default partition "partr_def1"
+LINE 1: ...LTER TABLE range_parted ATTACH PARTITION partr_def2 DEFAULT;
+ ^
+-- Overlapping partitions cannot be attached, hence, following should give error
+INSERT INTO partr_def1 VALUES (2, 10);
+CREATE TABLE part3 (LIKE range_parted);
+ALTER TABLE range_parted ATTACH partition part3 FOR VALUES FROM (2, 10) TO (2, 20);
+ERROR: updated partition constraint for default partition "partr_def1" would be violated by some row
+-- Attaching partitions should be successful when there are no overlapping rows
+ALTER TABLE range_parted ATTACH partition part3 FOR VALUES FROM (3, 10) TO (3, 20);
+-- check that leaf partitions are scanned when attaching a partitioned
+-- table
+CREATE TABLE part_5 (
+ LIKE list_parted2
+) PARTITION BY LIST (b);
+-- check that violating rows are correctly reported
+CREATE TABLE part_5_a PARTITION OF part_5 FOR VALUES IN ('a');
+INSERT INTO part_5_a (a, b) VALUES (6, 'a');
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+ERROR: partition constraint of relation "part_5_a" is violated by some row
+-- delete the faulting row and also add a constraint to skip the scan
+DELETE FROM part_5_a WHERE a NOT IN (3);
+ALTER TABLE part_5 ADD CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 5);
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+ALTER TABLE list_parted2 DETACH PARTITION part_5;
+ALTER TABLE part_5 DROP CONSTRAINT check_a;
+-- scan should again be skipped, even though NOT NULL is now a column property
+ALTER TABLE part_5 ADD CONSTRAINT check_a CHECK (a IN (5)), ALTER a SET NOT NULL;
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+-- Check the case where attnos of the partitioning columns in the table being
+-- attached differs from the parent. It should not affect the constraint-
+-- checking logic that allows to skip the scan.
+CREATE TABLE part_6 (
+ c int,
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 6)
+);
+ALTER TABLE part_6 DROP c;
+ALTER TABLE list_parted2 ATTACH PARTITION part_6 FOR VALUES IN (6);
+-- Similar to above, but the table being attached is a partitioned table
+-- whose partition has still different attnos for the root partitioning
+-- columns.
+CREATE TABLE part_7 (
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
+) PARTITION BY LIST (b);
+CREATE TABLE part_7_a_null (
+ c int,
+ d int,
+ e int,
+ LIKE list_parted2, -- 'a' will have attnum = 4
+ CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'),
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
+);
+ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
+ALTER TABLE part_7 ATTACH PARTITION part_7_a_null FOR VALUES IN ('a', null);
+ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
+-- Same example, but check this time that the constraint correctly detects
+-- violating rows
+ALTER TABLE list_parted2 DETACH PARTITION part_7;
+ALTER TABLE part_7 DROP CONSTRAINT check_a; -- thusly, scan won't be skipped
+INSERT INTO part_7 (a, b) VALUES (8, null), (9, 'a');
+SELECT tableoid::regclass, a, b FROM part_7 order by a;
+ tableoid | a | b
+---------------+---+---
+ part_7_a_null | 8 |
+ part_7_a_null | 9 | a
+(2 rows)
+
+ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
+ERROR: partition constraint of relation "part_7_a_null" is violated by some row
+-- check that leaf partitions of default partition are scanned when
+-- attaching a partitioned table.
+ALTER TABLE part_5 DROP CONSTRAINT check_a;
+CREATE TABLE part5_def PARTITION OF part_5 DEFAULT PARTITION BY LIST(a);
+CREATE TABLE part5_def_p1 PARTITION OF part5_def FOR VALUES IN (5);
+INSERT INTO part5_def_p1 VALUES (5, 'y');
+CREATE TABLE part5_p1 (LIKE part_5);
+ALTER TABLE part_5 ATTACH PARTITION part5_p1 FOR VALUES IN ('y');
+ERROR: updated partition constraint for default partition "part5_def_p1" would be violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM part5_def_p1 WHERE b = 'y';
+ALTER TABLE part_5 ATTACH PARTITION part5_p1 FOR VALUES IN ('y');
+-- check that the table being attached is not already a partition
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+ERROR: "part_2" is already a partition
+-- check that circular inheritance is not allowed
+ALTER TABLE part_5 ATTACH PARTITION list_parted2 FOR VALUES IN ('b');
+ERROR: circular inheritance not allowed
+DETAIL: "part_5" is already a child of "list_parted2".
+ALTER TABLE list_parted2 ATTACH PARTITION list_parted2 FOR VALUES IN (0);
+ERROR: circular inheritance not allowed
+DETAIL: "list_parted2" is already a child of "list_parted2".
+-- If a partitioned table being created or an existing table being attached
+-- as a partition does not have a constraint that would allow validation scan
+-- to be skipped, but an individual partition does, then the partition's
+-- validation scan is skipped.
+CREATE TABLE quuux (a int, b text) PARTITION BY LIST (a);
+CREATE TABLE quuux_default PARTITION OF quuux DEFAULT PARTITION BY LIST (b);
+CREATE TABLE quuux_default1 PARTITION OF quuux_default (
+ CONSTRAINT check_1 CHECK (a IS NOT NULL AND a = 1)
+) FOR VALUES IN ('b');
+CREATE TABLE quuux1 (a int, b text);
+ALTER TABLE quuux ATTACH PARTITION quuux1 FOR VALUES IN (1); -- validate!
+CREATE TABLE quuux2 (a int, b text);
+ALTER TABLE quuux ATTACH PARTITION quuux2 FOR VALUES IN (2); -- skip validation
+DROP TABLE quuux1, quuux2;
+-- should validate for quuux1, but not for quuux2
+CREATE TABLE quuux1 PARTITION OF quuux FOR VALUES IN (1);
+CREATE TABLE quuux2 PARTITION OF quuux FOR VALUES IN (2);
+DROP TABLE quuux;
+-- check validation when attaching hash partitions
+-- Use hand-rolled hash functions and operator class to get predictable result
+-- on different machines. part_test_int4_ops is defined in insert.sql.
+-- check that the new partition won't overlap with an existing partition
+CREATE TABLE hash_parted (
+ a int,
+ b int
+) PARTITION BY HASH (a part_test_int4_ops);
+CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 4, REMAINDER 0);
+CREATE TABLE fail_part (LIKE hpart_1);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+ERROR: partition "fail_part" would overlap partition "hpart_1"
+LINE 1: ...hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODU...
+ ^
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+ERROR: partition "fail_part" would overlap partition "hpart_1"
+LINE 1: ...hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODU...
+ ^
+DROP TABLE fail_part;
+-- check validation when attaching hash partitions
+-- check that violating rows are correctly reported
+CREATE TABLE hpart_2 (LIKE hash_parted);
+INSERT INTO hpart_2 VALUES (3, 0);
+ALTER TABLE hash_parted ATTACH PARTITION hpart_2 FOR VALUES WITH (MODULUS 4, REMAINDER 1);
+ERROR: partition constraint of relation "hpart_2" is violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM hpart_2;
+ALTER TABLE hash_parted ATTACH PARTITION hpart_2 FOR VALUES WITH (MODULUS 4, REMAINDER 1);
+-- check that leaf partitions are scanned when attaching a partitioned
+-- table
+CREATE TABLE hpart_5 (
+ LIKE hash_parted
+) PARTITION BY LIST (b);
+-- check that violating rows are correctly reported
+CREATE TABLE hpart_5_a PARTITION OF hpart_5 FOR VALUES IN ('1', '2', '3');
+INSERT INTO hpart_5_a (a, b) VALUES (7, 1);
+ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+ERROR: partition constraint of relation "hpart_5_a" is violated by some row
+-- should be ok after deleting the bad row
+DELETE FROM hpart_5_a;
+ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+-- check that the table being attach is with valid modulus and remainder value
+CREATE TABLE fail_part(LIKE hash_parted);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+ERROR: modulus for hash partition must be an integer value greater than zero
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+ERROR: remainder for hash partition must be less than modulus
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 3, REMAINDER 2);
+ERROR: every hash partition modulus must be a factor of the next larger modulus
+DETAIL: The new modulus 3 is not a factor of 4, the modulus of existing partition "hpart_1".
+DROP TABLE fail_part;
+-- fails with incorrect object type
+CREATE VIEW at_v1 AS SELECT 1 as a;
+ALTER TABLE at_v1 ATTACH PARTITION dummy default;
+ERROR: "at_v1" is not a table or partitioned index
+DROP VIEW at_v1;
+--
+-- DETACH PARTITION
+--
+-- check that the table is partitioned at all
+CREATE TABLE regular_table (a int);
+ALTER TABLE regular_table DETACH PARTITION any_name;
+ERROR: table "regular_table" is not partitioned
+DROP TABLE regular_table;
+-- check that the partition being detached exists at all
+ALTER TABLE list_parted2 DETACH PARTITION part_4;
+ERROR: relation "part_4" does not exist
+ALTER TABLE hash_parted DETACH PARTITION hpart_4;
+ERROR: relation "hpart_4" does not exist
+-- check that the partition being detached is actually a partition of the parent
+CREATE TABLE not_a_part (a int);
+ALTER TABLE list_parted2 DETACH PARTITION not_a_part;
+ERROR: relation "not_a_part" is not a partition of relation "list_parted2"
+ALTER TABLE list_parted2 DETACH PARTITION part_1;
+ERROR: relation "part_1" is not a partition of relation "list_parted2"
+ALTER TABLE hash_parted DETACH PARTITION not_a_part;
+ERROR: relation "not_a_part" is not a partition of relation "hash_parted"
+DROP TABLE not_a_part;
+-- check that, after being detached, attinhcount/coninhcount is dropped to 0 and
+-- attislocal/conislocal is set to true
+ALTER TABLE list_parted2 DETACH PARTITION part_3_4;
+SELECT attinhcount, attislocal FROM pg_attribute WHERE attrelid = 'part_3_4'::regclass AND attnum > 0;
+ attinhcount | attislocal
+-------------+------------
+ 0 | t
+ 0 | t
+(2 rows)
+
+SELECT coninhcount, conislocal FROM pg_constraint WHERE conrelid = 'part_3_4'::regclass AND conname = 'check_a';
+ coninhcount | conislocal
+-------------+------------
+ 0 | t
+(1 row)
+
+DROP TABLE part_3_4;
+-- check that a detached partition is not dropped on dropping a partitioned table
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE(a);
+CREATE TABLE part_rp PARTITION OF range_parted2 FOR VALUES FROM (0) to (100);
+ALTER TABLE range_parted2 DETACH PARTITION part_rp;
+DROP TABLE range_parted2;
+SELECT * from part_rp;
+ a
+---
+(0 rows)
+
+DROP TABLE part_rp;
+-- concurrent detach
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE(a);
+CREATE TABLE part_rp PARTITION OF range_parted2 FOR VALUES FROM (0) to (100);
+BEGIN;
+-- doesn't work in a partition block
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+ERROR: ALTER TABLE ... DETACH CONCURRENTLY cannot run inside a transaction block
+COMMIT;
+CREATE TABLE part_rpd PARTITION OF range_parted2 DEFAULT;
+-- doesn't work if there's a default partition
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+ERROR: cannot detach partitions concurrently when a default partition exists
+-- doesn't work for the default partition
+ALTER TABLE range_parted2 DETACH PARTITION part_rpd CONCURRENTLY;
+ERROR: cannot detach partitions concurrently when a default partition exists
+DROP TABLE part_rpd;
+-- works fine
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+\d+ range_parted2
+ Partitioned table "public.range_parted2"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+Partition key: RANGE (a)
+Number of partitions: 0
+
+-- constraint should be created
+\d part_rp
+ Table "public.part_rp"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+Check constraints:
+ "part_rp_a_check" CHECK (a IS NOT NULL AND a >= 0 AND a < 100)
+
+CREATE TABLE part_rp100 PARTITION OF range_parted2 (CHECK (a>=123 AND a<133 AND a IS NOT NULL)) FOR VALUES FROM (100) to (200);
+ALTER TABLE range_parted2 DETACH PARTITION part_rp100 CONCURRENTLY;
+-- redundant constraint should not be created
+\d part_rp100
+ Table "public.part_rp100"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+Check constraints:
+ "part_rp100_a_check" CHECK (a >= 123 AND a < 133 AND a IS NOT NULL)
+
+DROP TABLE range_parted2;
+-- Check ALTER TABLE commands for partitioned tables and partitions
+-- cannot add/drop column to/from *only* the parent
+ALTER TABLE ONLY list_parted2 ADD COLUMN c int;
+ERROR: column must be added to child tables too
+ALTER TABLE ONLY list_parted2 DROP COLUMN b;
+ERROR: cannot drop column from only the partitioned table when partitions exist
+HINT: Do not specify the ONLY keyword.
+-- cannot add a column to partition or drop an inherited one
+ALTER TABLE part_2 ADD COLUMN c text;
+ERROR: cannot add column to a partition
+ALTER TABLE part_2 DROP COLUMN b;
+ERROR: cannot drop inherited column "b"
+-- Nor rename, alter type
+ALTER TABLE part_2 RENAME COLUMN b to c;
+ERROR: cannot rename inherited column "b"
+ALTER TABLE part_2 ALTER COLUMN b TYPE text;
+ERROR: cannot alter inherited column "b"
+-- cannot add/drop NOT NULL or check constraints to *only* the parent, when
+-- partitions exist
+ALTER TABLE ONLY list_parted2 ALTER b SET NOT NULL;
+ERROR: constraint must be added to child tables too
+DETAIL: Column "b" of relation "part_2" is not already NOT NULL.
+HINT: Do not specify the ONLY keyword.
+ALTER TABLE ONLY list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz');
+ERROR: constraint must be added to child tables too
+ALTER TABLE list_parted2 ALTER b SET NOT NULL;
+ALTER TABLE ONLY list_parted2 ALTER b DROP NOT NULL;
+ERROR: cannot remove constraint from only the partitioned table when partitions exist
+HINT: Do not specify the ONLY keyword.
+ALTER TABLE list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz');
+ALTER TABLE ONLY list_parted2 DROP CONSTRAINT check_b;
+ERROR: cannot remove constraint from only the partitioned table when partitions exist
+HINT: Do not specify the ONLY keyword.
+-- It's alright though, if no partitions are yet created
+CREATE TABLE parted_no_parts (a int) PARTITION BY LIST (a);
+ALTER TABLE ONLY parted_no_parts ALTER a SET NOT NULL;
+ALTER TABLE ONLY parted_no_parts ADD CONSTRAINT check_a CHECK (a > 0);
+ALTER TABLE ONLY parted_no_parts ALTER a DROP NOT NULL;
+ALTER TABLE ONLY parted_no_parts DROP CONSTRAINT check_a;
+DROP TABLE parted_no_parts;
+-- cannot drop inherited NOT NULL or check constraints from partition
+ALTER TABLE list_parted2 ALTER b SET NOT NULL, ADD CONSTRAINT check_a2 CHECK (a > 0);
+ALTER TABLE part_2 ALTER b DROP NOT NULL;
+ERROR: column "b" is marked NOT NULL in parent table
+ALTER TABLE part_2 DROP CONSTRAINT check_a2;
+ERROR: cannot drop inherited constraint "check_a2" of relation "part_2"
+-- Doesn't make sense to add NO INHERIT constraints on partitioned tables
+ALTER TABLE list_parted2 add constraint check_b2 check (b <> 'zz') NO INHERIT;
+ERROR: cannot add NO INHERIT constraint to partitioned table "list_parted2"
+-- check that a partition cannot participate in regular inheritance
+CREATE TABLE inh_test () INHERITS (part_2);
+ERROR: cannot inherit from partition "part_2"
+CREATE TABLE inh_test (LIKE part_2);
+ALTER TABLE inh_test INHERIT part_2;
+ERROR: cannot inherit from a partition
+ALTER TABLE part_2 INHERIT inh_test;
+ERROR: cannot change inheritance of a partition
+-- cannot drop or alter type of partition key columns of lower level
+-- partitioned tables; for example, part_5, which is list_parted2's
+-- partition, is partitioned on b;
+ALTER TABLE list_parted2 DROP COLUMN b;
+ERROR: cannot drop column "b" because it is part of the partition key of relation "part_5"
+ALTER TABLE list_parted2 ALTER COLUMN b TYPE text;
+ERROR: cannot alter column "b" because it is part of the partition key of relation "part_5"
+-- dropping non-partition key columns should be allowed on the parent table.
+ALTER TABLE list_parted DROP COLUMN b;
+SELECT * FROM list_parted;
+ a
+---
+(0 rows)
+
+-- cleanup
+DROP TABLE list_parted, list_parted2, range_parted;
+DROP TABLE fail_def_part;
+DROP TABLE hash_parted;
+-- more tests for certain multi-level partitioning scenarios
+create table p (a int, b int) partition by range (a, b);
+create table p1 (b int, a int not null) partition by range (b);
+create table p11 (like p1);
+alter table p11 drop a;
+alter table p11 add a int;
+alter table p11 drop a;
+alter table p11 add a int not null;
+-- attnum for key attribute 'a' is different in p, p1, and p11
+select attrelid::regclass, attname, attnum
+from pg_attribute
+where attname = 'a'
+ and (attrelid = 'p'::regclass
+ or attrelid = 'p1'::regclass
+ or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
+ attrelid | attname | attnum
+----------+---------+--------
+ p | a | 1
+ p1 | a | 2
+ p11 | a | 4
+(3 rows)
+
+alter table p1 attach partition p11 for values from (2) to (5);
+insert into p1 (a, b) values (2, 3);
+-- check that partition validation scan correctly detects violating rows
+alter table p attach partition p1 for values from (1, 2) to (1, 10);
+ERROR: partition constraint of relation "p11" is violated by some row
+-- cleanup
+drop table p;
+drop table p1;
+-- validate constraint on partitioned tables should only scan leaf partitions
+create table parted_validate_test (a int) partition by list (a);
+create table parted_validate_test_1 partition of parted_validate_test for values in (0, 1);
+alter table parted_validate_test add constraint parted_validate_test_chka check (a > 0) not valid;
+alter table parted_validate_test validate constraint parted_validate_test_chka;
+drop table parted_validate_test;
+-- test alter column options
+CREATE TABLE attmp(i integer);
+INSERT INTO attmp VALUES (1);
+ALTER TABLE attmp ALTER COLUMN i SET (n_distinct = 1, n_distinct_inherited = 2);
+ALTER TABLE attmp ALTER COLUMN i RESET (n_distinct_inherited);
+ANALYZE attmp;
+DROP TABLE attmp;
+DROP USER regress_alter_table_user1;
+-- check that violating rows are correctly reported when attaching as the
+-- default partition
+create table defpart_attach_test (a int) partition by list (a);
+create table defpart_attach_test1 partition of defpart_attach_test for values in (1);
+create table defpart_attach_test_d (b int, a int);
+alter table defpart_attach_test_d drop b;
+insert into defpart_attach_test_d values (1), (2);
+-- error because its constraint as the default partition would be violated
+-- by the row containing 1
+alter table defpart_attach_test attach partition defpart_attach_test_d default;
+ERROR: partition constraint of relation "defpart_attach_test_d" is violated by some row
+delete from defpart_attach_test_d where a = 1;
+alter table defpart_attach_test_d add check (a > 1);
+-- should be attached successfully and without needing to be scanned
+alter table defpart_attach_test attach partition defpart_attach_test_d default;
+-- check that attaching a partition correctly reports any rows in the default
+-- partition that should not be there for the new partition to be attached
+-- successfully
+create table defpart_attach_test_2 (like defpart_attach_test_d);
+alter table defpart_attach_test attach partition defpart_attach_test_2 for values in (2);
+ERROR: updated partition constraint for default partition "defpart_attach_test_d" would be violated by some row
+drop table defpart_attach_test;
+-- check combinations of temporary and permanent relations when attaching
+-- partitions.
+create table perm_part_parent (a int) partition by list (a);
+create temp table temp_part_parent (a int) partition by list (a);
+create table perm_part_child (a int);
+create temp table temp_part_child (a int);
+alter table temp_part_parent attach partition perm_part_child default; -- error
+ERROR: cannot attach a permanent relation as partition of temporary relation "temp_part_parent"
+alter table perm_part_parent attach partition temp_part_child default; -- error
+ERROR: cannot attach a temporary relation as partition of permanent relation "perm_part_parent"
+alter table temp_part_parent attach partition temp_part_child default; -- ok
+drop table perm_part_parent cascade;
+drop table temp_part_parent cascade;
+-- check that attaching partitions to a table while it is being used is
+-- prevented
+create table tab_part_attach (a int) partition by list (a);
+create or replace function func_part_attach() returns trigger
+ language plpgsql as $$
+ begin
+ execute 'create table tab_part_attach_1 (a int)';
+ execute 'alter table tab_part_attach attach partition tab_part_attach_1 for values in (1)';
+ return null;
+ end $$;
+create trigger trig_part_attach before insert on tab_part_attach
+ for each statement execute procedure func_part_attach();
+insert into tab_part_attach values (1);
+ERROR: cannot ALTER TABLE "tab_part_attach" because it is being used by active queries in this session
+CONTEXT: SQL statement "alter table tab_part_attach attach partition tab_part_attach_1 for values in (1)"
+PL/pgSQL function func_part_attach() line 4 at EXECUTE
+drop table tab_part_attach;
+drop function func_part_attach();
+-- test case where the partitioning operator is a SQL function whose
+-- evaluation results in the table's relcache being rebuilt partway through
+-- the execution of an ATTACH PARTITION command
+create function at_test_sql_partop (int4, int4) returns int language sql
+as $$ select case when $1 = $2 then 0 when $1 > $2 then 1 else -1 end; $$;
+create operator class at_test_sql_partop for type int4 using btree as
+ operator 1 < (int4, int4), operator 2 <= (int4, int4),
+ operator 3 = (int4, int4), operator 4 >= (int4, int4),
+ operator 5 > (int4, int4), function 1 at_test_sql_partop(int4, int4);
+create table at_test_sql_partop (a int) partition by range (a at_test_sql_partop);
+create table at_test_sql_partop_1 (a int);
+alter table at_test_sql_partop attach partition at_test_sql_partop_1 for values from (0) to (10);
+drop table at_test_sql_partop;
+drop operator class at_test_sql_partop using btree;
+drop function at_test_sql_partop;
+/* Test case for bug #16242 */
+-- We create a parent and child where the child has missing
+-- non-null attribute values, and arrange to pass them through
+-- tuple conversion from the child to the parent tupdesc
+create table bar1 (a integer, b integer not null default 1)
+ partition by range (a);
+create table bar2 (a integer);
+insert into bar2 values (1);
+alter table bar2 add column b integer not null default 1;
+-- (at this point bar2 contains tuple with natts=1)
+alter table bar1 attach partition bar2 default;
+-- this works:
+select * from bar1;
+ a | b
+---+---
+ 1 | 1
+(1 row)
+
+-- this exercises tuple conversion:
+create function xtrig()
+ returns trigger language plpgsql
+as $$
+ declare
+ r record;
+ begin
+ for r in select * from old loop
+ raise info 'a=%, b=%', r.a, r.b;
+ end loop;
+ return NULL;
+ end;
+$$;
+create trigger xtrig
+ after update on bar1
+ referencing old table as old
+ for each statement execute procedure xtrig();
+update bar1 set a = a + 1;
+INFO: a=1, b=1
+/* End test case for bug #16242 */
+/* Test case for bug #17409 */
+create table attbl (p1 int constraint pk_attbl primary key);
+create table atref (c1 int references attbl(p1));
+cluster attbl using pk_attbl;
+alter table attbl alter column p1 set data type bigint;
+alter table atref alter column c1 set data type bigint;
+drop table attbl, atref;
+create table attbl (p1 int constraint pk_attbl primary key);
+alter table attbl replica identity using index pk_attbl;
+create table atref (c1 int references attbl(p1));
+alter table attbl alter column p1 set data type bigint;
+alter table atref alter column c1 set data type bigint;
+drop table attbl, atref;
+/* End test case for bug #17409 */
+-- Test that ALTER TABLE rewrite preserves a clustered index
+-- for normal indexes and indexes on constraints.
+create table alttype_cluster (a int);
+alter table alttype_cluster add primary key (a);
+create index alttype_cluster_ind on alttype_cluster (a);
+alter table alttype_cluster cluster on alttype_cluster_ind;
+-- Normal index remains clustered.
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+ indexrelid | indisclustered
+----------------------+----------------
+ alttype_cluster_ind | t
+ alttype_cluster_pkey | f
+(2 rows)
+
+alter table alttype_cluster alter a type bigint;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+ indexrelid | indisclustered
+----------------------+----------------
+ alttype_cluster_ind | t
+ alttype_cluster_pkey | f
+(2 rows)
+
+-- Constraint index remains clustered.
+alter table alttype_cluster cluster on alttype_cluster_pkey;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+ indexrelid | indisclustered
+----------------------+----------------
+ alttype_cluster_ind | f
+ alttype_cluster_pkey | t
+(2 rows)
+
+alter table alttype_cluster alter a type int;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+ indexrelid | indisclustered
+----------------------+----------------
+ alttype_cluster_ind | f
+ alttype_cluster_pkey | t
+(2 rows)
+
+drop table alttype_cluster;
+--
+-- Check that attaching or detaching a partitioned partition correctly leads
+-- to its partitions' constraint being updated to reflect the parent's
+-- newly added/removed constraint
+create table target_parted (a int, b int) partition by list (a);
+create table attach_parted (a int, b int) partition by list (b);
+create table attach_parted_part1 partition of attach_parted for values in (1);
+-- insert a row directly into the leaf partition so that its partition
+-- constraint is built and stored in the relcache
+insert into attach_parted_part1 values (1, 1);
+-- the following better invalidate the partition constraint of the leaf
+-- partition too...
+alter table target_parted attach partition attach_parted for values in (1);
+-- ...such that the following insert fails
+insert into attach_parted_part1 values (2, 1);
+ERROR: new row for relation "attach_parted_part1" violates partition constraint
+DETAIL: Failing row contains (2, 1).
+-- ...and doesn't when the partition is detached along with its own partition
+alter table target_parted detach partition attach_parted;
+insert into attach_parted_part1 values (2, 1);
diff --git a/yql/essentials/tests/postgresql/original/cases/alter_table.sql b/yql/essentials/tests/postgresql/original/cases/alter_table.sql
new file mode 100644
index 0000000000..6ef9dd437b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/alter_table.sql
@@ -0,0 +1,3030 @@
+--
+-- ALTER_TABLE
+--
+
+-- Clean up in case a prior regression run failed
+SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_alter_table_user1;
+RESET client_min_messages;
+
+CREATE USER regress_alter_table_user1;
+
+--
+-- add attribute
+--
+
+CREATE TABLE attmp (initial int4);
+
+COMMENT ON TABLE attmp_wrong IS 'table comment';
+COMMENT ON TABLE attmp IS 'table comment';
+COMMENT ON TABLE attmp IS NULL;
+
+ALTER TABLE attmp ADD COLUMN xmin integer; -- fails
+
+ALTER TABLE attmp ADD COLUMN a int4 default 3;
+
+ALTER TABLE attmp ADD COLUMN b name;
+
+ALTER TABLE attmp ADD COLUMN c text;
+
+ALTER TABLE attmp ADD COLUMN d float8;
+
+ALTER TABLE attmp ADD COLUMN e float4;
+
+ALTER TABLE attmp ADD COLUMN f int2;
+
+ALTER TABLE attmp ADD COLUMN g polygon;
+
+ALTER TABLE attmp ADD COLUMN i char;
+
+ALTER TABLE attmp ADD COLUMN k int4;
+
+ALTER TABLE attmp ADD COLUMN l tid;
+
+ALTER TABLE attmp ADD COLUMN m xid;
+
+ALTER TABLE attmp ADD COLUMN n oidvector;
+
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+
+ALTER TABLE attmp ADD COLUMN q point;
+
+ALTER TABLE attmp ADD COLUMN r lseg;
+
+ALTER TABLE attmp ADD COLUMN s path;
+
+ALTER TABLE attmp ADD COLUMN t box;
+
+ALTER TABLE attmp ADD COLUMN v timestamp;
+
+ALTER TABLE attmp ADD COLUMN w interval;
+
+ALTER TABLE attmp ADD COLUMN x float8[];
+
+ALTER TABLE attmp ADD COLUMN y float4[];
+
+ALTER TABLE attmp ADD COLUMN z int2[];
+
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+
+SELECT * FROM attmp;
+
+DROP TABLE attmp;
+
+-- the wolf bug - schema mods caused inconsistent row descriptors
+CREATE TABLE attmp (
+ initial int4
+);
+
+ALTER TABLE attmp ADD COLUMN a int4;
+
+ALTER TABLE attmp ADD COLUMN b name;
+
+ALTER TABLE attmp ADD COLUMN c text;
+
+ALTER TABLE attmp ADD COLUMN d float8;
+
+ALTER TABLE attmp ADD COLUMN e float4;
+
+ALTER TABLE attmp ADD COLUMN f int2;
+
+ALTER TABLE attmp ADD COLUMN g polygon;
+
+ALTER TABLE attmp ADD COLUMN i char;
+
+ALTER TABLE attmp ADD COLUMN k int4;
+
+ALTER TABLE attmp ADD COLUMN l tid;
+
+ALTER TABLE attmp ADD COLUMN m xid;
+
+ALTER TABLE attmp ADD COLUMN n oidvector;
+
+--ALTER TABLE attmp ADD COLUMN o lock;
+ALTER TABLE attmp ADD COLUMN p boolean;
+
+ALTER TABLE attmp ADD COLUMN q point;
+
+ALTER TABLE attmp ADD COLUMN r lseg;
+
+ALTER TABLE attmp ADD COLUMN s path;
+
+ALTER TABLE attmp ADD COLUMN t box;
+
+ALTER TABLE attmp ADD COLUMN v timestamp;
+
+ALTER TABLE attmp ADD COLUMN w interval;
+
+ALTER TABLE attmp ADD COLUMN x float8[];
+
+ALTER TABLE attmp ADD COLUMN y float4[];
+
+ALTER TABLE attmp ADD COLUMN z int2[];
+
+INSERT INTO attmp (a, b, c, d, e, f, g, i, k, l, m, n, p, q, r, s, t,
+ v, w, x, y, z)
+ VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
+ 'c',
+ 314159, '(1,1)', '512',
+ '1 2 3 4 5 6 7 8', true, '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
+ '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
+ 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
+
+SELECT * FROM attmp;
+
+CREATE INDEX attmp_idx ON attmp (a, (d + e), b);
+
+ALTER INDEX attmp_idx ALTER COLUMN 0 SET STATISTICS 1000;
+
+ALTER INDEX attmp_idx ALTER COLUMN 1 SET STATISTICS 1000;
+
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS 1000;
+
+\d+ attmp_idx
+
+ALTER INDEX attmp_idx ALTER COLUMN 3 SET STATISTICS 1000;
+
+ALTER INDEX attmp_idx ALTER COLUMN 4 SET STATISTICS 1000;
+
+ALTER INDEX attmp_idx ALTER COLUMN 2 SET STATISTICS -1;
+
+DROP TABLE attmp;
+
+-- fails with incorrect object type
+CREATE VIEW at_v1 AS SELECT 1 as a;
+ALTER TABLE at_v1 ALTER COLUMN a SET STATISTICS 0;
+DROP VIEW at_v1;
+
+--
+-- rename - check on both non-temp and temp tables
+--
+CREATE TABLE attmp (regtable int);
+CREATE TEMP TABLE attmp (attmptable int);
+
+ALTER TABLE attmp RENAME TO attmp_new;
+
+SELECT * FROM attmp;
+SELECT * FROM attmp_new;
+
+ALTER TABLE attmp RENAME TO attmp_new2;
+
+SELECT * FROM attmp; -- should fail
+SELECT * FROM attmp_new;
+SELECT * FROM attmp_new2;
+
+DROP TABLE attmp_new;
+DROP TABLE attmp_new2;
+
+-- check rename of partitioned tables and indexes also
+CREATE TABLE part_attmp (a int primary key) partition by range (a);
+CREATE TABLE part_attmp1 PARTITION OF part_attmp FOR VALUES FROM (0) TO (100);
+ALTER INDEX part_attmp_pkey RENAME TO part_attmp_index;
+ALTER INDEX part_attmp1_pkey RENAME TO part_attmp1_index;
+ALTER TABLE part_attmp RENAME TO part_at2tmp;
+ALTER TABLE part_attmp1 RENAME TO part_at2tmp1;
+SET ROLE regress_alter_table_user1;
+ALTER INDEX part_attmp_index RENAME TO fail;
+ALTER INDEX part_attmp1_index RENAME TO fail;
+ALTER TABLE part_at2tmp RENAME TO fail;
+ALTER TABLE part_at2tmp1 RENAME TO fail;
+RESET ROLE;
+DROP TABLE part_at2tmp;
+
+--
+-- check renaming to a table's array type's autogenerated name
+-- (the array type's name should get out of the way)
+--
+CREATE TABLE attmp_array (id int);
+CREATE TABLE attmp_array2 (id int);
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+SELECT typname FROM pg_type WHERE oid = 'attmp_array2[]'::regtype;
+ALTER TABLE attmp_array2 RENAME TO _attmp_array;
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+DROP TABLE _attmp_array;
+DROP TABLE attmp_array;
+
+-- renaming to table's own array type's name is an interesting corner case
+CREATE TABLE attmp_array (id int);
+SELECT typname FROM pg_type WHERE oid = 'attmp_array[]'::regtype;
+ALTER TABLE attmp_array RENAME TO _attmp_array;
+SELECT typname FROM pg_type WHERE oid = '_attmp_array[]'::regtype;
+DROP TABLE _attmp_array;
+
+-- ALTER TABLE ... RENAME on non-table relations
+-- renaming indexes (FIXME: this should probably test the index's functionality)
+ALTER INDEX IF EXISTS __onek_unique1 RENAME TO attmp_onek_unique1;
+ALTER INDEX IF EXISTS __attmp_onek_unique1 RENAME TO onek_unique1;
+
+ALTER INDEX onek_unique1 RENAME TO attmp_onek_unique1;
+ALTER INDEX attmp_onek_unique1 RENAME TO onek_unique1;
+
+SET ROLE regress_alter_table_user1;
+ALTER INDEX onek_unique1 RENAME TO fail; -- permission denied
+RESET ROLE;
+
+-- rename statements with mismatching statement and object types
+CREATE TABLE alter_idx_rename_test (a INT);
+CREATE INDEX alter_idx_rename_test_idx ON alter_idx_rename_test (a);
+CREATE TABLE alter_idx_rename_test_parted (a INT) PARTITION BY LIST (a);
+CREATE INDEX alter_idx_rename_test_parted_idx ON alter_idx_rename_test_parted (a);
+BEGIN;
+ALTER INDEX alter_idx_rename_test RENAME TO alter_idx_rename_test_2;
+ALTER INDEX alter_idx_rename_test_parted RENAME TO alter_idx_rename_test_parted_2;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+COMMIT;
+BEGIN;
+ALTER INDEX alter_idx_rename_test_idx RENAME TO alter_idx_rename_test_idx_2;
+ALTER INDEX alter_idx_rename_test_parted_idx RENAME TO alter_idx_rename_test_parted_idx_2;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+COMMIT;
+BEGIN;
+ALTER TABLE alter_idx_rename_test_idx_2 RENAME TO alter_idx_rename_test_idx_3;
+ALTER TABLE alter_idx_rename_test_parted_idx_2 RENAME TO alter_idx_rename_test_parted_idx_3;
+SELECT relation::regclass, mode FROM pg_locks
+WHERE pid = pg_backend_pid() AND locktype = 'relation'
+ AND relation::regclass::text LIKE 'alter\_idx%'
+ORDER BY relation::regclass::text COLLATE "C";
+COMMIT;
+DROP TABLE alter_idx_rename_test_2;
+
+-- renaming views
+CREATE VIEW attmp_view (unique1) AS SELECT unique1 FROM tenk1;
+ALTER TABLE attmp_view RENAME TO attmp_view_new;
+
+SET ROLE regress_alter_table_user1;
+ALTER VIEW attmp_view_new RENAME TO fail; -- permission denied
+RESET ROLE;
+
+-- hack to ensure we get an indexscan here
+set enable_seqscan to off;
+set enable_bitmapscan to off;
+-- 5 values, sorted
+SELECT unique1 FROM tenk1 WHERE unique1 < 5;
+reset enable_seqscan;
+reset enable_bitmapscan;
+
+DROP VIEW attmp_view_new;
+-- toast-like relation name
+alter table stud_emp rename to pg_toast_stud_emp;
+alter table pg_toast_stud_emp rename to stud_emp;
+
+-- renaming index should rename constraint as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+ALTER INDEX onek_unique1_constraint RENAME TO onek_unique1_constraint_foo;
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+
+-- renaming constraint
+ALTER TABLE onek ADD CONSTRAINT onek_check_constraint CHECK (unique1 >= 0);
+ALTER TABLE onek RENAME CONSTRAINT onek_check_constraint TO onek_check_constraint_foo;
+ALTER TABLE onek DROP CONSTRAINT onek_check_constraint_foo;
+
+-- renaming constraint should rename index as well
+ALTER TABLE onek ADD CONSTRAINT onek_unique1_constraint UNIQUE (unique1);
+DROP INDEX onek_unique1_constraint; -- to see whether it's there
+ALTER TABLE onek RENAME CONSTRAINT onek_unique1_constraint TO onek_unique1_constraint_foo;
+DROP INDEX onek_unique1_constraint_foo; -- to see whether it's there
+ALTER TABLE onek DROP CONSTRAINT onek_unique1_constraint_foo;
+
+-- renaming constraints vs. inheritance
+CREATE TABLE constraint_rename_test (a int CONSTRAINT con1 CHECK (a > 0), b int, c int);
+\d constraint_rename_test
+CREATE TABLE constraint_rename_test2 (a int CONSTRAINT con1 CHECK (a > 0), d int) INHERITS (constraint_rename_test);
+\d constraint_rename_test2
+ALTER TABLE constraint_rename_test2 RENAME CONSTRAINT con1 TO con1foo; -- fail
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- fail
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con1 TO con1foo; -- ok
+\d constraint_rename_test
+\d constraint_rename_test2
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con2 CHECK (b > 0) NO INHERIT;
+ALTER TABLE ONLY constraint_rename_test RENAME CONSTRAINT con2 TO con2foo; -- ok
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con2foo TO con2bar; -- ok
+\d constraint_rename_test
+\d constraint_rename_test2
+ALTER TABLE constraint_rename_test ADD CONSTRAINT con3 PRIMARY KEY (a);
+ALTER TABLE constraint_rename_test RENAME CONSTRAINT con3 TO con3foo; -- ok
+\d constraint_rename_test
+\d constraint_rename_test2
+DROP TABLE constraint_rename_test2;
+DROP TABLE constraint_rename_test;
+ALTER TABLE IF EXISTS constraint_not_exist RENAME CONSTRAINT con3 TO con3foo; -- ok
+ALTER TABLE IF EXISTS constraint_rename_test ADD CONSTRAINT con4 UNIQUE (a);
+
+-- renaming constraints with cache reset of target relation
+CREATE TABLE constraint_rename_cache (a int,
+ CONSTRAINT chk_a CHECK (a > 0),
+ PRIMARY KEY (a));
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT chk_a TO chk_a_new;
+ALTER TABLE constraint_rename_cache
+ RENAME CONSTRAINT constraint_rename_cache_pkey TO constraint_rename_pkey_new;
+CREATE TABLE like_constraint_rename_cache
+ (LIKE constraint_rename_cache INCLUDING ALL);
+\d like_constraint_rename_cache
+DROP TABLE constraint_rename_cache;
+DROP TABLE like_constraint_rename_cache;
+
+-- FOREIGN KEY CONSTRAINT adding TEST
+
+CREATE TABLE attmp2 (a int primary key);
+
+CREATE TABLE attmp3 (a int, b int);
+
+CREATE TABLE attmp4 (a int, b int, unique(a,b));
+
+CREATE TABLE attmp5 (a int, b int);
+
+-- Insert rows into attmp2 (pktable)
+INSERT INTO attmp2 values (1);
+INSERT INTO attmp2 values (2);
+INSERT INTO attmp2 values (3);
+INSERT INTO attmp2 values (4);
+
+-- Insert rows into attmp3
+INSERT INTO attmp3 values (1,10);
+INSERT INTO attmp3 values (1,20);
+INSERT INTO attmp3 values (5,50);
+
+-- Try (and fail) to add constraint due to invalid source columns
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(c) references attmp2 match full;
+
+-- Try (and fail) to add constraint due to invalid destination columns explicitly given
+ALTER TABLE attmp3 add constraint attmpconstr foreign key(a) references attmp2(b) match full;
+
+-- Try (and fail) to add constraint due to invalid data
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+
+-- Try (and succeed)
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full;
+ALTER TABLE attmp3 drop constraint attmpconstr;
+
+INSERT INTO attmp3 values (5,50);
+
+-- Try NOT VALID and then VALIDATE CONSTRAINT, but fails. Delete failure then re-validate
+ALTER TABLE attmp3 add constraint attmpconstr foreign key (a) references attmp2 match full NOT VALID;
+ALTER TABLE attmp3 validate constraint attmpconstr;
+
+-- Delete failing row
+DELETE FROM attmp3 where a=5;
+
+-- Try (and succeed) and repeat to show it works on already valid constraint
+ALTER TABLE attmp3 validate constraint attmpconstr;
+ALTER TABLE attmp3 validate constraint attmpconstr;
+
+-- Try a non-verified CHECK constraint
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10); -- fail
+ALTER TABLE attmp3 ADD CONSTRAINT b_greater_than_ten CHECK (b > 10) NOT VALID; -- succeeds
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- fails
+DELETE FROM attmp3 WHERE NOT b > 10;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_greater_than_ten; -- succeeds
+
+-- Test inherited NOT VALID CHECK constraints
+select * from attmp3;
+CREATE TABLE attmp6 () INHERITS (attmp3);
+CREATE TABLE attmp7 () INHERITS (attmp3);
+
+INSERT INTO attmp6 VALUES (6, 30), (7, 16);
+ALTER TABLE attmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- fails
+DELETE FROM attmp6 WHERE b > 20;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT b_le_20; -- succeeds
+
+-- An already validated constraint must not be revalidated
+CREATE FUNCTION boo(int) RETURNS int IMMUTABLE STRICT LANGUAGE plpgsql AS $$ BEGIN RAISE NOTICE 'boo: %', $1; RETURN $1; END; $$;
+INSERT INTO attmp7 VALUES (8, 18);
+ALTER TABLE attmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
+ALTER TABLE attmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
+ALTER TABLE attmp3 VALIDATE CONSTRAINT identity;
+
+-- A NO INHERIT constraint should not be looked for in children during VALIDATE CONSTRAINT
+create table parent_noinh_convalid (a int);
+create table child_noinh_convalid () inherits (parent_noinh_convalid);
+insert into parent_noinh_convalid values (1);
+insert into child_noinh_convalid values (1);
+alter table parent_noinh_convalid add constraint check_a_is_2 check (a = 2) no inherit not valid;
+-- fail, because of the row in parent
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+delete from only parent_noinh_convalid;
+-- ok (parent itself contains no violating rows)
+alter table parent_noinh_convalid validate constraint check_a_is_2;
+select convalidated from pg_constraint where conrelid = 'parent_noinh_convalid'::regclass and conname = 'check_a_is_2';
+-- cleanup
+drop table parent_noinh_convalid, child_noinh_convalid;
+
+-- Try (and fail) to create constraint from attmp5(a) to attmp4(a) - unique constraint on
+-- attmp4 is a,b
+
+ALTER TABLE attmp5 add constraint attmpconstr foreign key(a) references attmp4(a) match full;
+
+DROP TABLE attmp7;
+
+DROP TABLE attmp6;
+
+DROP TABLE attmp5;
+
+DROP TABLE attmp4;
+
+DROP TABLE attmp3;
+
+DROP TABLE attmp2;
+
+-- NOT VALID with plan invalidation -- ensure we don't use a constraint for
+-- exclusion until validated
+set constraint_exclusion TO 'partition';
+create table nv_parent (d date, check (false) no inherit not valid);
+-- not valid constraint added at creation time should automatically become valid
+\d nv_parent
+
+create table nv_child_2010 () inherits (nv_parent);
+create table nv_child_2011 () inherits (nv_parent);
+alter table nv_child_2010 add check (d between '2010-01-01'::date and '2010-12-31'::date) not valid;
+alter table nv_child_2011 add check (d between '2011-01-01'::date and '2011-12-31'::date) not valid;
+explain (costs off) select * from nv_parent where d between '2011-08-01' and '2011-08-31';
+create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
+explain (costs off) select * from nv_parent where d between '2011-08-01'::date and '2011-08-31'::date;
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+-- after validation, the constraint should be used
+alter table nv_child_2011 VALIDATE CONSTRAINT nv_child_2011_d_check;
+explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
+
+-- add an inherited NOT VALID constraint
+alter table nv_parent add check (d between '2001-01-01'::date and '2099-12-31'::date) not valid;
+\d nv_child_2009
+-- we leave nv_parent and children around to help test pg_dump logic
+
+-- Foreign key adding test with mixed types
+
+-- Note: these tables are TEMP to avoid name conflicts when this test
+-- is run in parallel with foreign_key.sql.
+
+CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 inet);
+-- This next should fail, because int=inet does not exist
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+-- This should also fail for the same reason, but here we
+-- give the column name
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
+DROP TABLE FKTABLE;
+-- This should succeed, even though they are different types,
+-- because int=int8 exists and is a member of the integer opfamily
+CREATE TEMP TABLE FKTABLE (ftest1 int8);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+INSERT INTO FKTABLE VALUES(43); -- should fail
+DROP TABLE FKTABLE;
+-- This should fail, because we'd have to cast numeric to int which is
+-- not an implicit coercion (or use numeric=numeric, but that's not part
+-- of the integer opfamily)
+CREATE TEMP TABLE FKTABLE (ftest1 numeric);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+-- On the other hand, this should work because int implicitly promotes to
+-- numeric, and we allow promotion on the FK side
+CREATE TEMP TABLE PKTABLE (ptest1 numeric PRIMARY KEY);
+INSERT INTO PKTABLE VALUES(42);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
+-- Check it actually works
+INSERT INTO FKTABLE VALUES(42); -- should succeed
+INSERT INTO FKTABLE VALUES(43); -- should fail
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+
+CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 inet,
+ PRIMARY KEY(ptest1, ptest2));
+-- This should fail, because we just chose really odd types
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
+DROP TABLE FKTABLE;
+-- Again, so should this...
+CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest1, ptest2);
+DROP TABLE FKTABLE;
+-- This fails because we mixed up the column ordering
+CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
+ references pktable(ptest2, ptest1);
+-- As does this...
+ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
+ references pktable(ptest1, ptest2);
+DROP TABLE FKTABLE;
+DROP TABLE PKTABLE;
+
+-- Test that ALTER CONSTRAINT updates trigger deferrability properly
+
+CREATE TEMP TABLE PKTABLE (ptest1 int primary key);
+CREATE TEMP TABLE FKTABLE (ftest1 int);
+
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;
+
+ALTER TABLE FKTABLE ADD CONSTRAINT fknd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fknd2 NOT DEFERRABLE;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdd2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdd2 DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE FKTABLE ADD CONSTRAINT fkdi2 FOREIGN KEY(ftest1) REFERENCES pktable
+ ON DELETE CASCADE ON UPDATE NO ACTION NOT DEFERRABLE;
+ALTER TABLE FKTABLE ALTER CONSTRAINT fkdi2 DEFERRABLE INITIALLY IMMEDIATE;
+
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'pktable'::regclass
+ORDER BY 1,2,3;
+SELECT conname, tgfoid::regproc, tgtype, tgdeferrable, tginitdeferred
+FROM pg_trigger JOIN pg_constraint con ON con.oid = tgconstraint
+WHERE tgrelid = 'fktable'::regclass
+ORDER BY 1,2,3;
+
+-- temp tables should go away by themselves, need not drop them.
+
+-- test check constraint adding
+
+create table atacc1 ( test int );
+-- add a check constraint
+alter table atacc1 add constraint atacc_test1 check (test>3);
+-- should fail
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+drop table atacc1;
+
+-- let's do one where the check fails when added
+create table atacc1 ( test int );
+-- insert a soon to be failing row
+insert into atacc1 (test) values (2);
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test>3);
+insert into atacc1 (test) values (4);
+drop table atacc1;
+
+-- let's do one where the check fails because the column doesn't exist
+create table atacc1 ( test int );
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test1>3);
+drop table atacc1;
+
+-- something a little more complicated
+create table atacc1 ( test int, test2 int, test3 int);
+-- add a check constraint (fails)
+alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
+-- should fail
+insert into atacc1 (test,test2,test3) values (4,4,2);
+-- should succeed
+insert into atacc1 (test,test2,test3) values (4,4,5);
+drop table atacc1;
+
+-- lets do some naming tests
+create table atacc1 (test int check (test>3), test2 int);
+alter table atacc1 add check (test2>test);
+-- should fail for $2
+insert into atacc1 (test2, test) values (3, 4);
+drop table atacc1;
+
+-- inheritance related tests
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+alter table atacc2 add constraint foo check (test2>0);
+-- fail and then succeed on atacc2
+insert into atacc2 (test2) values (-3);
+insert into atacc2 (test2) values (3);
+-- fail and then succeed on atacc3
+insert into atacc3 (test2) values (-3);
+insert into atacc3 (test2) values (3);
+drop table atacc3;
+drop table atacc2;
+drop table atacc1;
+
+-- same things with one created with INHERIT
+create table atacc1 (test int);
+create table atacc2 (test2 int);
+create table atacc3 (test3 int) inherits (atacc1, atacc2);
+alter table atacc3 no inherit atacc2;
+-- fail
+alter table atacc3 no inherit atacc2;
+-- make sure it really isn't a child
+insert into atacc3 (test2) values (3);
+select test2 from atacc2;
+-- fail due to missing constraint
+alter table atacc2 add constraint foo check (test2>0);
+alter table atacc3 inherit atacc2;
+-- fail due to missing column
+alter table atacc3 rename test2 to testx;
+alter table atacc3 inherit atacc2;
+-- fail due to mismatched data type
+alter table atacc3 add test2 bool;
+alter table atacc3 inherit atacc2;
+alter table atacc3 drop test2;
+-- succeed
+alter table atacc3 add test2 int;
+update atacc3 set test2 = 4 where test2 is null;
+alter table atacc3 add constraint foo check (test2>0);
+alter table atacc3 inherit atacc2;
+-- fail due to duplicates and circular inheritance
+alter table atacc3 inherit atacc2;
+alter table atacc2 inherit atacc3;
+alter table atacc2 inherit atacc2;
+-- test that we really are a child now (should see 4 not 3 and cascade should go through)
+select test2 from atacc2;
+drop table atacc2 cascade;
+drop table atacc1;
+
+-- adding only to a parent is allowed as of 9.2
+
+create table atacc1 (test int);
+create table atacc2 (test2 int) inherits (atacc1);
+-- ok:
+alter table atacc1 add constraint foo check (test>0) no inherit;
+-- check constraint is not there on child
+insert into atacc2 (test) values (-3);
+-- check constraint is there on parent
+insert into atacc1 (test) values (-3);
+insert into atacc1 (test) values (3);
+-- fail, violating row:
+alter table atacc2 add constraint foo check (test>0) no inherit;
+drop table atacc2;
+drop table atacc1;
+
+-- test unique constraint adding
+
+create table atacc1 ( test int ) ;
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test);
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should fail
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+-- try to create duplicates via alter table using - should fail
+alter table atacc1 alter column test type integer using 0;
+drop table atacc1;
+
+-- let's do one where the unique constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+
+-- let's do one where the unique constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+-- add a unique constraint (fails)
+alter table atacc1 add constraint atacc_test1 unique (test1);
+drop table atacc1;
+
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- add a unique constraint
+alter table atacc1 add constraint atacc_test1 unique (test, test2);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, unique(test));
+alter table atacc1 add unique (test2);
+-- should fail for @@ second one @@
+insert into atacc1 (test2, test) values (3, 3);
+insert into atacc1 (test2, test) values (2, 3);
+drop table atacc1;
+
+-- test primary key constraint adding
+
+create table atacc1 ( id serial, test int) ;
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test);
+-- insert first value
+insert into atacc1 (test) values (2);
+-- should fail
+insert into atacc1 (test) values (2);
+-- should succeed
+insert into atacc1 (test) values (4);
+-- inserting NULL should fail
+insert into atacc1 (test) values(NULL);
+-- try adding a second primary key (should fail)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+-- drop first primary key constraint
+alter table atacc1 drop constraint atacc_test1 restrict;
+-- try adding a primary key on oid (should succeed)
+alter table atacc1 add constraint atacc_oid1 primary key(id);
+drop table atacc1;
+
+-- let's do one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing rows
+insert into atacc1 (test) values (2);
+insert into atacc1 (test) values (2);
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+
+-- let's do another one where the primary key constraint fails when added
+create table atacc1 ( test int );
+-- insert soon to be failing row
+insert into atacc1 (test) values (NULL);
+-- add a primary key (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test);
+insert into atacc1 (test) values (3);
+drop table atacc1;
+
+-- let's do one where the primary key constraint fails
+-- because the column doesn't exist
+create table atacc1 ( test int );
+-- add a primary key constraint (fails)
+alter table atacc1 add constraint atacc_test1 primary key (test1);
+drop table atacc1;
+
+-- adding a new column as primary key to a non-empty table.
+-- should fail unless the column has a non-null default value.
+create table atacc1 ( test int );
+insert into atacc1 (test) values (0);
+-- add a primary key column without a default (fails).
+alter table atacc1 add column test2 int primary key;
+-- now add a primary key column with a default (succeeds).
+alter table atacc1 add column test2 int default 0 primary key;
+drop table atacc1;
+
+-- this combination used to have order-of-execution problems (bug #15580)
+create table atacc1 (a int);
+insert into atacc1 values(1);
+alter table atacc1
+ add column b float8 not null default random(),
+ add primary key(a);
+drop table atacc1;
+
+-- additionally, we've seen issues with foreign key validation not being
+-- properly delayed until after a table rewrite. Check that works ok.
+create table atacc1 (a int primary key);
+alter table atacc1 add constraint atacc1_fkey foreign key (a) references atacc1 (a) not valid;
+alter table atacc1 validate constraint atacc1_fkey, alter a type bigint;
+drop table atacc1;
+
+-- we've also seen issues with check constraints being validated at the wrong
+-- time when there's a pending table rewrite.
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,1);
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+drop table atacc1;
+
+-- same as above, but ensure the constraint violation is detected
+create table atacc1 (a bigint, b int);
+insert into atacc1 values(1,2);
+alter table atacc1 add constraint atacc1_chk check(b = 1) not valid;
+alter table atacc1 validate constraint atacc1_chk, alter a type int;
+drop table atacc1;
+
+-- something a little more complicated
+create table atacc1 ( test int, test2 int);
+-- add a primary key constraint
+alter table atacc1 add constraint atacc_test1 primary key (test, test2);
+-- try adding a second primary key - should fail
+alter table atacc1 add constraint atacc_test2 primary key (test);
+-- insert initial value
+insert into atacc1 (test,test2) values (4,4);
+-- should fail
+insert into atacc1 (test,test2) values (4,4);
+insert into atacc1 (test,test2) values (NULL,3);
+insert into atacc1 (test,test2) values (3, NULL);
+insert into atacc1 (test,test2) values (NULL,NULL);
+-- should all succeed
+insert into atacc1 (test,test2) values (4,5);
+insert into atacc1 (test,test2) values (5,4);
+insert into atacc1 (test,test2) values (5,5);
+drop table atacc1;
+
+-- lets do some naming tests
+create table atacc1 (test int, test2 int, primary key(test));
+-- only first should succeed
+insert into atacc1 (test2, test) values (3, 3);
+insert into atacc1 (test2, test) values (2, 3);
+insert into atacc1 (test2, test) values (1, NULL);
+drop table atacc1;
+
+-- alter table / alter column [set/drop] not null tests
+-- try altering system catalogs, should fail
+alter table pg_class alter column relname drop not null;
+alter table pg_class alter relname set not null;
+
+-- try altering non-existent table, should fail
+alter table non_existent alter column bar set not null;
+alter table non_existent alter column bar drop not null;
+
+-- test setting columns to null and not null and vice versa
+-- test checking for null values and primary key
+create table atacc1 (test int not null);
+alter table atacc1 add constraint "atacc1_pkey" primary key (test);
+alter table atacc1 alter column test drop not null;
+alter table atacc1 drop constraint "atacc1_pkey";
+alter table atacc1 alter column test drop not null;
+insert into atacc1 values (null);
+alter table atacc1 alter test set not null;
+delete from atacc1;
+alter table atacc1 alter test set not null;
+
+-- try altering a non-existent column, should fail
+alter table atacc1 alter bar set not null;
+alter table atacc1 alter bar drop not null;
+
+-- try creating a view and altering that, should fail
+create view myview as select * from atacc1;
+alter table myview alter column test drop not null;
+alter table myview alter column test set not null;
+drop view myview;
+
+drop table atacc1;
+
+-- set not null verified by constraints
+create table atacc1 (test_a int, test_b int);
+insert into atacc1 values (null, 1);
+-- constraint not cover all values, should fail
+alter table atacc1 add constraint atacc1_constr_or check(test_a is not null or test_b < 10);
+alter table atacc1 alter test_a set not null;
+alter table atacc1 drop constraint atacc1_constr_or;
+-- not valid constraint, should fail
+alter table atacc1 add constraint atacc1_constr_invalid check(test_a is not null) not valid;
+alter table atacc1 alter test_a set not null;
+alter table atacc1 drop constraint atacc1_constr_invalid;
+-- with valid constraint
+update atacc1 set test_a = 1;
+alter table atacc1 add constraint atacc1_constr_a_valid check(test_a is not null);
+alter table atacc1 alter test_a set not null;
+delete from atacc1;
+
+insert into atacc1 values (2, null);
+alter table atacc1 alter test_a drop not null;
+-- test multiple set not null at same time
+-- test_a checked by atacc1_constr_a_valid, test_b should fail by table scan
+alter table atacc1 alter test_a set not null, alter test_b set not null;
+-- commands order has no importance
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+
+-- valid one by table scan, one by check constraints
+update atacc1 set test_b = 1;
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+
+alter table atacc1 alter test_a drop not null, alter test_b drop not null;
+-- both column has check constraints
+alter table atacc1 add constraint atacc1_constr_b_valid check(test_b is not null);
+alter table atacc1 alter test_b set not null, alter test_a set not null;
+drop table atacc1;
+
+-- test inheritance
+create table parent (a int);
+create table child (b varchar(255)) inherits (parent);
+
+alter table parent alter a set not null;
+insert into parent values (NULL);
+insert into child (a, b) values (NULL, 'foo');
+alter table parent alter a drop not null;
+insert into parent values (NULL);
+insert into child (a, b) values (NULL, 'foo');
+alter table only parent alter a set not null;
+alter table child alter a set not null;
+delete from parent;
+alter table only parent alter a set not null;
+insert into parent values (NULL);
+alter table child alter a set not null;
+insert into child (a, b) values (NULL, 'foo');
+delete from child;
+alter table child alter a set not null;
+insert into child (a, b) values (NULL, 'foo');
+drop table child;
+drop table parent;
+
+-- test setting and removing default values
+create table def_test (
+ c1 int4 default 5,
+ c2 text default 'initial_default'
+);
+insert into def_test default values;
+alter table def_test alter column c1 drop default;
+insert into def_test default values;
+alter table def_test alter column c2 drop default;
+insert into def_test default values;
+alter table def_test alter column c1 set default 10;
+alter table def_test alter column c2 set default 'new_default';
+insert into def_test default values;
+select * from def_test;
+
+-- set defaults to an incorrect type: this should fail
+alter table def_test alter column c1 set default 'wrong_datatype';
+alter table def_test alter column c2 set default 20;
+
+-- set defaults on a non-existent column: this should fail
+alter table def_test alter column c3 set default 30;
+
+-- set defaults on views: we need to create a view, add a rule
+-- to allow insertions into it, and then alter the view to add
+-- a default
+create view def_view_test as select * from def_test;
+create rule def_view_test_ins as
+ on insert to def_view_test
+ do instead insert into def_test select new.*;
+insert into def_view_test default values;
+alter table def_view_test alter column c1 set default 45;
+insert into def_view_test default values;
+alter table def_view_test alter column c2 set default 'view_default';
+insert into def_view_test default values;
+select * from def_view_test;
+
+drop rule def_view_test_ins on def_view_test;
+drop view def_view_test;
+drop table def_test;
+
+-- alter table / drop column tests
+-- try altering system catalogs, should fail
+alter table pg_class drop column relname;
+
+-- try altering non-existent table, should fail
+alter table nosuchtable drop column bar;
+
+-- test dropping columns
+create table atacc1 (a int4 not null, b int4, c int4 not null, d int4);
+insert into atacc1 values (1, 2, 3, 4);
+alter table atacc1 drop a;
+alter table atacc1 drop a;
+
+-- SELECTs
+select * from atacc1;
+select * from atacc1 order by a;
+select * from atacc1 order by "........pg.dropped.1........";
+select * from atacc1 group by a;
+select * from atacc1 group by "........pg.dropped.1........";
+select atacc1.* from atacc1;
+select a from atacc1;
+select atacc1.a from atacc1;
+select b,c,d from atacc1;
+select a,b,c,d from atacc1;
+select * from atacc1 where a = 1;
+select "........pg.dropped.1........" from atacc1;
+select atacc1."........pg.dropped.1........" from atacc1;
+select "........pg.dropped.1........",b,c,d from atacc1;
+select * from atacc1 where "........pg.dropped.1........" = 1;
+
+-- UPDATEs
+update atacc1 set a = 3;
+update atacc1 set b = 2 where a = 3;
+update atacc1 set "........pg.dropped.1........" = 3;
+update atacc1 set b = 2 where "........pg.dropped.1........" = 3;
+
+-- INSERTs
+insert into atacc1 values (10, 11, 12, 13);
+insert into atacc1 values (default, 11, 12, 13);
+insert into atacc1 values (11, 12, 13);
+insert into atacc1 (a) values (10);
+insert into atacc1 (a) values (default);
+insert into atacc1 (a,b,c,d) values (10,11,12,13);
+insert into atacc1 (a,b,c,d) values (default,11,12,13);
+insert into atacc1 (b,c,d) values (11,12,13);
+insert into atacc1 ("........pg.dropped.1........") values (10);
+insert into atacc1 ("........pg.dropped.1........") values (default);
+insert into atacc1 ("........pg.dropped.1........",b,c,d) values (10,11,12,13);
+insert into atacc1 ("........pg.dropped.1........",b,c,d) values (default,11,12,13);
+
+-- DELETEs
+delete from atacc1 where a = 3;
+delete from atacc1 where "........pg.dropped.1........" = 3;
+delete from atacc1;
+
+-- try dropping a non-existent column, should fail
+alter table atacc1 drop bar;
+
+-- try removing an oid column, should succeed (as it's nonexistent)
+alter table atacc1 SET WITHOUT OIDS;
+
+-- try adding an oid column, should fail (not supported)
+alter table atacc1 SET WITH OIDS;
+
+-- try dropping the xmin column, should fail
+alter table atacc1 drop xmin;
+
+-- try creating a view and altering that, should fail
+create view myview as select * from atacc1;
+select * from myview;
+alter table myview drop d;
+drop view myview;
+
+-- test some commands to make sure they fail on the dropped column
+analyze atacc1(a);
+analyze atacc1("........pg.dropped.1........");
+vacuum analyze atacc1(a);
+vacuum analyze atacc1("........pg.dropped.1........");
+comment on column atacc1.a is 'testing';
+comment on column atacc1."........pg.dropped.1........" is 'testing';
+alter table atacc1 alter a set storage plain;
+alter table atacc1 alter "........pg.dropped.1........" set storage plain;
+alter table atacc1 alter a set statistics 0;
+alter table atacc1 alter "........pg.dropped.1........" set statistics 0;
+alter table atacc1 alter a set default 3;
+alter table atacc1 alter "........pg.dropped.1........" set default 3;
+alter table atacc1 alter a drop default;
+alter table atacc1 alter "........pg.dropped.1........" drop default;
+alter table atacc1 alter a set not null;
+alter table atacc1 alter "........pg.dropped.1........" set not null;
+alter table atacc1 alter a drop not null;
+alter table atacc1 alter "........pg.dropped.1........" drop not null;
+alter table atacc1 rename a to x;
+alter table atacc1 rename "........pg.dropped.1........" to x;
+alter table atacc1 add primary key(a);
+alter table atacc1 add primary key("........pg.dropped.1........");
+alter table atacc1 add unique(a);
+alter table atacc1 add unique("........pg.dropped.1........");
+alter table atacc1 add check (a > 3);
+alter table atacc1 add check ("........pg.dropped.1........" > 3);
+create table atacc2 (id int4 unique);
+alter table atacc1 add foreign key (a) references atacc2(id);
+alter table atacc1 add foreign key ("........pg.dropped.1........") references atacc2(id);
+alter table atacc2 add foreign key (id) references atacc1(a);
+alter table atacc2 add foreign key (id) references atacc1("........pg.dropped.1........");
+drop table atacc2;
+create index "testing_idx" on atacc1(a);
+create index "testing_idx" on atacc1("........pg.dropped.1........");
+
+-- test create as and select into
+insert into atacc1 values (21, 22, 23);
+create table attest1 as select * from atacc1;
+select * from attest1;
+drop table attest1;
+select * into attest2 from atacc1;
+select * from attest2;
+drop table attest2;
+
+-- try dropping all columns
+alter table atacc1 drop c;
+alter table atacc1 drop d;
+alter table atacc1 drop b;
+select * from atacc1;
+
+drop table atacc1;
+
+-- test constraint error reporting in presence of dropped columns
+create table atacc1 (id serial primary key, value int check (value < 10));
+insert into atacc1(value) values (100);
+alter table atacc1 drop column value;
+alter table atacc1 add column value int check (value < 10);
+insert into atacc1(value) values (100);
+insert into atacc1(id, value) values (null, 0);
+drop table atacc1;
+
+-- test inheritance
+create table parent (a int, b int, c int);
+insert into parent values (1, 2, 3);
+alter table parent drop a;
+create table child (d varchar(255)) inherits (parent);
+insert into child values (12, 13, 'testing');
+
+select * from parent;
+select * from child;
+alter table parent drop c;
+select * from parent;
+select * from child;
+
+drop table child;
+drop table parent;
+
+-- check error cases for inheritance column merging
+create table parent (a float8, b numeric(10,4), c text collate "C");
+
+create table child (a float4) inherits (parent); -- fail
+create table child (b decimal(10,7)) inherits (parent); -- fail
+create table child (c text collate "POSIX") inherits (parent); -- fail
+create table child (a double precision, b decimal(10,4)) inherits (parent);
+
+drop table child;
+drop table parent;
+
+-- test copy in/out
+create table attest (a int4, b int4, c int4);
+insert into attest values (1,2,3);
+alter table attest drop a;
+copy attest to stdout;
+copy attest(a) to stdout;
+copy attest("........pg.dropped.1........") to stdout;
+copy attest from stdin;
+10 11 12
+\.
+select * from attest;
+copy attest from stdin;
+21 22
+\.
+select * from attest;
+copy attest(a) from stdin;
+copy attest("........pg.dropped.1........") from stdin;
+copy attest(b,c) from stdin;
+31 32
+\.
+select * from attest;
+drop table attest;
+
+-- test inheritance
+
+create table dropColumn (a int, b int, e int);
+create table dropColumnChild (c int) inherits (dropColumn);
+create table dropColumnAnother (d int) inherits (dropColumnChild);
+
+-- these two should fail
+alter table dropColumnchild drop column a;
+alter table only dropColumnChild drop column b;
+
+
+
+-- these three should work
+alter table only dropColumn drop column e;
+alter table dropColumnChild drop column c;
+alter table dropColumn drop column a;
+
+create table renameColumn (a int);
+create table renameColumnChild (b int) inherits (renameColumn);
+create table renameColumnAnother (c int) inherits (renameColumnChild);
+
+-- these three should fail
+alter table renameColumnChild rename column a to d;
+alter table only renameColumnChild rename column a to d;
+alter table only renameColumn rename column a to d;
+
+-- these should work
+alter table renameColumn rename column a to d;
+alter table renameColumnChild rename column b to a;
+
+-- these should work
+alter table if exists doesnt_exist_tab rename column a to d;
+alter table if exists doesnt_exist_tab rename column b to a;
+
+-- this should work
+alter table renameColumn add column w int;
+
+-- this should fail
+alter table only renameColumn add column x int;
+
+
+-- Test corner cases in dropping of inherited columns
+
+create table p1 (f1 int, f2 int);
+create table c1 (f1 int not null) inherits(p1);
+
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+-- should work
+alter table p1 drop column f1;
+-- c1.f1 is still there, but no longer inherited
+select f1 from c1;
+alter table c1 drop column f1;
+select f1 from c1;
+
+drop table p1 cascade;
+
+create table p1 (f1 int, f2 int);
+create table c1 () inherits(p1);
+
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+alter table p1 drop column f1;
+-- c1.f1 is dropped now, since there is no local definition for it
+select f1 from c1;
+
+drop table p1 cascade;
+
+create table p1 (f1 int, f2 int);
+create table c1 () inherits(p1);
+
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+alter table only p1 drop column f1;
+-- c1.f1 is NOT dropped, but must now be considered non-inherited
+alter table c1 drop column f1;
+
+drop table p1 cascade;
+
+create table p1 (f1 int, f2 int);
+create table c1 (f1 int not null) inherits(p1);
+
+-- should be rejected since c1.f1 is inherited
+alter table c1 drop column f1;
+alter table only p1 drop column f1;
+-- c1.f1 is still there, but no longer inherited
+alter table c1 drop column f1;
+
+drop table p1 cascade;
+
+create table p1(id int, name text);
+create table p2(id2 int, name text, height int);
+create table c1(age int) inherits(p1,p2);
+create table gc1() inherits (c1);
+
+select relname, attname, attinhcount, attislocal
+from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
+where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
+order by relname, attnum;
+
+-- should work
+alter table only p1 drop column name;
+-- should work. Now c1.name is local and inhcount is 0.
+alter table p2 drop column name;
+-- should be rejected since its inherited
+alter table gc1 drop column name;
+-- should work, and drop gc1.name along
+alter table c1 drop column name;
+-- should fail: column does not exist
+alter table gc1 drop column name;
+-- should work and drop the attribute in all tables
+alter table p2 drop column height;
+
+-- IF EXISTS test
+create table dropColumnExists ();
+alter table dropColumnExists drop column non_existing; --fail
+alter table dropColumnExists drop column if exists non_existing; --succeed
+
+select relname, attname, attinhcount, attislocal
+from pg_class join pg_attribute on (pg_class.oid = pg_attribute.attrelid)
+where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
+order by relname, attnum;
+
+drop table p1, p2 cascade;
+
+-- test attinhcount tracking with merged columns
+
+create table depth0();
+create table depth1(c text) inherits (depth0);
+create table depth2() inherits (depth1);
+alter table depth0 add c text;
+
+select attrelid::regclass, attname, attinhcount, attislocal
+from pg_attribute
+where attnum > 0 and attrelid::regclass in ('depth0', 'depth1', 'depth2')
+order by attrelid::regclass::text, attnum;
+
+-- test renumbering of child-table columns in inherited operations
+
+create table p1 (f1 int);
+create table c1 (f2 text, f3 int) inherits (p1);
+
+alter table p1 add column a1 int check (a1 > 0);
+alter table p1 add column f2 text;
+
+insert into p1 values (1,2,'abc');
+insert into c1 values(11,'xyz',33,0); -- should fail
+insert into c1 values(11,'xyz',33,22);
+
+select * from p1;
+update p1 set a1 = a1 + 1, f2 = upper(f2);
+select * from p1;
+
+drop table p1 cascade;
+
+-- test that operations with a dropped column do not try to reference
+-- its datatype
+
+create domain mytype as text;
+create temp table foo (f1 text, f2 mytype, f3 text);
+
+insert into foo values('bb','cc','dd');
+select * from foo;
+
+drop domain mytype cascade;
+
+select * from foo;
+insert into foo values('qq','rr');
+select * from foo;
+update foo set f3 = 'zz';
+select * from foo;
+select f3,max(f1) from foo group by f3;
+
+-- Simple tests for alter table column type
+alter table foo alter f1 TYPE integer; -- fails
+alter table foo alter f1 TYPE varchar(10);
+
+create table anothertab (atcol1 serial8, atcol2 boolean,
+ constraint anothertab_chk check (atcol1 <= 3));
+
+insert into anothertab (atcol1, atcol2) values (default, true);
+insert into anothertab (atcol1, atcol2) values (default, false);
+select * from anothertab;
+
+alter table anothertab alter column atcol1 type boolean; -- fails
+alter table anothertab alter column atcol1 type boolean using atcol1::int; -- fails
+alter table anothertab alter column atcol1 type integer;
+
+select * from anothertab;
+
+insert into anothertab (atcol1, atcol2) values (45, null); -- fails
+insert into anothertab (atcol1, atcol2) values (default, null);
+
+select * from anothertab;
+
+alter table anothertab alter column atcol2 type text
+ using case when atcol2 is true then 'IT WAS TRUE'
+ when atcol2 is false then 'IT WAS FALSE'
+ else 'IT WAS NULL!' end;
+
+select * from anothertab;
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end; -- fails
+alter table anothertab alter column atcol1 drop default;
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end; -- fails
+alter table anothertab drop constraint anothertab_chk;
+alter table anothertab drop constraint anothertab_chk; -- fails
+alter table anothertab drop constraint IF EXISTS anothertab_chk; -- succeeds
+
+alter table anothertab alter column atcol1 type boolean
+ using case when atcol1 % 2 = 0 then true else false end;
+
+select * from anothertab;
+
+drop table anothertab;
+
+-- Test index handling in alter table column type (cf. bugs #15835, #15865)
+create table anothertab(f1 int primary key, f2 int unique,
+ f3 int, f4 int, f5 int);
+alter table anothertab
+ add exclude using btree (f3 with =);
+alter table anothertab
+ add exclude using btree (f4 with =) where (f4 is not null);
+alter table anothertab
+ add exclude using btree (f4 with =) where (f5 > 0);
+alter table anothertab
+ add unique(f1,f4);
+create index on anothertab(f2,f3);
+create unique index on anothertab(f4);
+
+\d anothertab
+alter table anothertab alter column f1 type bigint;
+alter table anothertab
+ alter column f2 type bigint,
+ alter column f3 type bigint,
+ alter column f4 type bigint;
+alter table anothertab alter column f5 type bigint;
+\d anothertab
+
+drop table anothertab;
+
+-- test that USING expressions are parsed before column alter type / drop steps
+create table another (f1 int, f2 text, f3 text);
+
+insert into another values(1, 'one', 'uno');
+insert into another values(2, 'two', 'due');
+insert into another values(3, 'three', 'tre');
+
+select * from another;
+
+alter table another
+ alter f1 type text using f2 || ' and ' || f3 || ' more',
+ alter f2 type bigint using f1 * 10,
+ drop column f3;
+
+select * from another;
+
+drop table another;
+
+-- Create an index that skips WAL, then perform a SET DATA TYPE that skips
+-- rewriting the index.
+begin;
+create table skip_wal_skip_rewrite_index (c varchar(10) primary key);
+alter table skip_wal_skip_rewrite_index alter c type varchar(20);
+commit;
+
+-- We disallow changing table's row type if it's used for storage
+create table at_tab1 (a int, b text);
+create table at_tab2 (x int, y at_tab1);
+alter table at_tab1 alter column b type varchar; -- fails
+drop table at_tab2;
+-- Use of row type in an expression is defended differently
+create table at_tab2 (x int, y text, check((x,y)::at_tab1 = (1,'42')::at_tab1));
+alter table at_tab1 alter column b type varchar; -- allowed, but ...
+insert into at_tab2 values(1,'42'); -- ... this will fail
+drop table at_tab1, at_tab2;
+-- Check it for a partitioned table, too
+create table at_tab1 (a int, b text) partition by list(a);
+create table at_tab2 (x int, y at_tab1);
+alter table at_tab1 alter column b type varchar; -- fails
+drop table at_tab1, at_tab2;
+
+-- Alter column type that's part of a partitioned index
+create table at_partitioned (a int, b text) partition by range (a);
+create table at_part_1 partition of at_partitioned for values from (0) to (1000);
+insert into at_partitioned values (512, '0.123');
+create table at_part_2 (b text, a int);
+insert into at_part_2 values ('1.234', 1024);
+create index on at_partitioned (b);
+create index on at_partitioned (a);
+\d at_part_1
+\d at_part_2
+alter table at_partitioned attach partition at_part_2 for values from (1000) to (2000);
+\d at_part_2
+alter table at_partitioned alter column b type numeric using b::numeric;
+\d at_part_1
+\d at_part_2
+drop table at_partitioned;
+
+-- Alter column type when no table rewrite is required
+-- Also check that comments are preserved
+create table at_partitioned(id int, name varchar(64), unique (id, name))
+ partition by hash(id);
+comment on constraint at_partitioned_id_name_key on at_partitioned is 'parent constraint';
+comment on index at_partitioned_id_name_key is 'parent index';
+create table at_partitioned_0 partition of at_partitioned
+ for values with (modulus 2, remainder 0);
+comment on constraint at_partitioned_0_id_name_key on at_partitioned_0 is 'child 0 constraint';
+comment on index at_partitioned_0_id_name_key is 'child 0 index';
+create table at_partitioned_1 partition of at_partitioned
+ for values with (modulus 2, remainder 1);
+comment on constraint at_partitioned_1_id_name_key on at_partitioned_1 is 'child 1 constraint';
+comment on index at_partitioned_1_id_name_key is 'child 1 index';
+insert into at_partitioned values(1, 'foo');
+insert into at_partitioned values(3, 'bar');
+
+create temp table old_oids as
+ select relname, oid as oldoid, relfilenode as oldfilenode
+ from pg_class where relname like 'at_partitioned%';
+
+select relname,
+ c.oid = oldoid as orig_oid,
+ case relfilenode
+ when 0 then 'none'
+ when c.oid then 'own'
+ when oldfilenode then 'orig'
+ else 'OTHER'
+ end as storage,
+ obj_description(c.oid, 'pg_class') as desc
+ from pg_class c left join old_oids using (relname)
+ where relname like 'at_partitioned%'
+ order by relname;
+
+select conname, obj_description(oid, 'pg_constraint') as desc
+ from pg_constraint where conname like 'at_partitioned%'
+ order by conname;
+
+alter table at_partitioned alter column name type varchar(127);
+
+-- Note: these tests currently show the wrong behavior for comments :-(
+
+select relname,
+ c.oid = oldoid as orig_oid,
+ case relfilenode
+ when 0 then 'none'
+ when c.oid then 'own'
+ when oldfilenode then 'orig'
+ else 'OTHER'
+ end as storage,
+ obj_description(c.oid, 'pg_class') as desc
+ from pg_class c left join old_oids using (relname)
+ where relname like 'at_partitioned%'
+ order by relname;
+
+select conname, obj_description(oid, 'pg_constraint') as desc
+ from pg_constraint where conname like 'at_partitioned%'
+ order by conname;
+
+-- Don't remove this DROP, it exposes bug #15672
+drop table at_partitioned;
+
+-- disallow recursive containment of row types
+create temp table recur1 (f1 int);
+alter table recur1 add column f2 recur1; -- fails
+alter table recur1 add column f2 recur1[]; -- fails
+create domain array_of_recur1 as recur1[];
+alter table recur1 add column f2 array_of_recur1; -- fails
+create temp table recur2 (f1 int, f2 recur1);
+alter table recur1 add column f2 recur2; -- fails
+alter table recur1 add column f2 int;
+alter table recur1 alter column f2 type recur2; -- fails
+
+-- SET STORAGE may need to add a TOAST table
+create table test_storage (a text);
+alter table test_storage alter a set storage plain;
+alter table test_storage add b int default 0; -- rewrite table to remove its TOAST table
+alter table test_storage alter a set storage extended; -- re-add TOAST table
+
+select reltoastrelid <> 0 as has_toast_table
+from pg_class
+where oid = 'test_storage'::regclass;
+
+-- test that SET STORAGE propagates to index correctly
+create index test_storage_idx on test_storage (b, a);
+alter table test_storage alter column a set storage external;
+\d+ test_storage
+\d+ test_storage_idx
+
+-- ALTER COLUMN TYPE with a check constraint and a child table (bug #13779)
+CREATE TABLE test_inh_check (a float check (a > 10.2), b float);
+CREATE TABLE test_inh_check_child() INHERITS(test_inh_check);
+\d test_inh_check
+\d test_inh_check_child
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
+\d test_inh_check
+\d test_inh_check_child
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+-- also try noinherit, local, and local+inherited cases
+ALTER TABLE test_inh_check ADD CONSTRAINT bnoinherit CHECK (b > 100) NO INHERIT;
+ALTER TABLE test_inh_check_child ADD CONSTRAINT blocal CHECK (b < 1000);
+ALTER TABLE test_inh_check_child ADD CONSTRAINT bmerged CHECK (b > 1);
+ALTER TABLE test_inh_check ADD CONSTRAINT bmerged CHECK (b > 1);
+\d test_inh_check
+\d test_inh_check_child
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+ALTER TABLE test_inh_check ALTER COLUMN b TYPE numeric;
+\d test_inh_check
+\d test_inh_check_child
+select relname, conname, coninhcount, conislocal, connoinherit
+ from pg_constraint c, pg_class r
+ where relname like 'test_inh_check%' and c.conrelid = r.oid
+ order by 1, 2;
+
+-- ALTER COLUMN TYPE with different schema in children
+-- Bug at https://postgr.es/m/20170102225618.GA10071@telsasoft.com
+CREATE TABLE test_type_diff (f1 int);
+CREATE TABLE test_type_diff_c (extra smallint) INHERITS (test_type_diff);
+ALTER TABLE test_type_diff ADD COLUMN f2 int;
+INSERT INTO test_type_diff_c VALUES (1, 2, 3);
+ALTER TABLE test_type_diff ALTER COLUMN f2 TYPE bigint USING f2::bigint;
+
+CREATE TABLE test_type_diff2 (int_two int2, int_four int4, int_eight int8);
+CREATE TABLE test_type_diff2_c1 (int_four int4, int_eight int8, int_two int2);
+CREATE TABLE test_type_diff2_c2 (int_eight int8, int_two int2, int_four int4);
+CREATE TABLE test_type_diff2_c3 (int_two int2, int_four int4, int_eight int8);
+ALTER TABLE test_type_diff2_c1 INHERIT test_type_diff2;
+ALTER TABLE test_type_diff2_c2 INHERIT test_type_diff2;
+ALTER TABLE test_type_diff2_c3 INHERIT test_type_diff2;
+INSERT INTO test_type_diff2_c1 VALUES (1, 2, 3);
+INSERT INTO test_type_diff2_c2 VALUES (4, 5, 6);
+INSERT INTO test_type_diff2_c3 VALUES (7, 8, 9);
+ALTER TABLE test_type_diff2 ALTER COLUMN int_four TYPE int8 USING int_four::int8;
+-- whole-row references are disallowed
+ALTER TABLE test_type_diff2 ALTER COLUMN int_four TYPE int4 USING (pg_column_size(test_type_diff2));
+
+-- check for rollback of ANALYZE corrupting table property flags (bug #11638)
+CREATE TABLE check_fk_presence_1 (id int PRIMARY KEY, t text);
+CREATE TABLE check_fk_presence_2 (id int REFERENCES check_fk_presence_1, t text);
+BEGIN;
+ALTER TABLE check_fk_presence_2 DROP CONSTRAINT check_fk_presence_2_id_fkey;
+ANALYZE check_fk_presence_2;
+ROLLBACK;
+\d check_fk_presence_2
+DROP TABLE check_fk_presence_1, check_fk_presence_2;
+
+-- check column addition within a view (bug #14876)
+create table at_base_table(id int, stuff text);
+insert into at_base_table values (23, 'skidoo');
+create view at_view_1 as select * from at_base_table bt;
+create view at_view_2 as select *, to_json(v1) as j from at_view_1 v1;
+\d+ at_view_1
+\d+ at_view_2
+explain (verbose, costs off) select * from at_view_2;
+select * from at_view_2;
+
+create or replace view at_view_1 as select *, 2+2 as more from at_base_table bt;
+\d+ at_view_1
+\d+ at_view_2
+explain (verbose, costs off) select * from at_view_2;
+select * from at_view_2;
+
+drop view at_view_2;
+drop view at_view_1;
+drop table at_base_table;
+
+-- check adding a column not iself requiring a rewrite, together with
+-- a column requiring a default (bug #16038)
+
+-- ensure that rewrites aren't silently optimized away, removing the
+-- value of the test
+CREATE FUNCTION check_ddl_rewrite(p_tablename regclass, p_ddl text)
+RETURNS boolean
+LANGUAGE plpgsql AS $$
+DECLARE
+ v_relfilenode oid;
+BEGIN
+ v_relfilenode := relfilenode FROM pg_class WHERE oid = p_tablename;
+
+ EXECUTE p_ddl;
+
+ RETURN v_relfilenode <> (SELECT relfilenode FROM pg_class WHERE oid = p_tablename);
+END;
+$$;
+
+CREATE TABLE rewrite_test(col text);
+INSERT INTO rewrite_test VALUES ('something');
+INSERT INTO rewrite_test VALUES (NULL);
+
+-- empty[12] don't need rewrite, but notempty[12]_rewrite will force one
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty1 text,
+ ADD COLUMN notempty1_rewrite serial;
+$$);
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty2_rewrite serial,
+ ADD COLUMN empty2 text;
+$$);
+-- also check that fast defaults cause no problem, first without rewrite
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty3 text,
+ ADD COLUMN notempty3_norewrite int default 42;
+$$);
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty4_norewrite int default 42,
+ ADD COLUMN empty4 text;
+$$);
+-- then with rewrite
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN empty5 text,
+ ADD COLUMN notempty5_norewrite int default 42,
+ ADD COLUMN notempty5_rewrite serial;
+$$);
+SELECT check_ddl_rewrite('rewrite_test', $$
+ ALTER TABLE rewrite_test
+ ADD COLUMN notempty6_rewrite serial,
+ ADD COLUMN empty6 text,
+ ADD COLUMN notempty6_norewrite int default 42;
+$$);
+
+-- cleanup
+DROP FUNCTION check_ddl_rewrite(regclass, text);
+DROP TABLE rewrite_test;
+
+--
+-- lock levels
+--
+drop type lockmodes;
+create type lockmodes as enum (
+ 'SIReadLock'
+,'AccessShareLock'
+,'RowShareLock'
+,'RowExclusiveLock'
+,'ShareUpdateExclusiveLock'
+,'ShareLock'
+,'ShareRowExclusiveLock'
+,'ExclusiveLock'
+,'AccessExclusiveLock'
+);
+
+drop view my_locks;
+create or replace view my_locks as
+select case when c.relname like 'pg_toast%' then 'pg_toast' else c.relname end, max(mode::lockmodes) as max_lockmode
+from pg_locks l join pg_class c on l.relation = c.oid
+where virtualtransaction = (
+ select virtualtransaction
+ from pg_locks
+ where transactionid = pg_current_xact_id()::xid)
+and locktype = 'relation'
+and relnamespace != (select oid from pg_namespace where nspname = 'pg_catalog')
+and c.relname != 'my_locks'
+group by c.relname;
+
+create table alterlock (f1 int primary key, f2 text);
+insert into alterlock values (1, 'foo');
+create table alterlock2 (f3 int primary key, f1 int);
+insert into alterlock2 values (1, 1);
+
+begin; alter table alterlock alter column f2 set statistics 150;
+select * from my_locks order by 1;
+rollback;
+
+begin; alter table alterlock cluster on alterlock_pkey;
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock set without cluster;
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock set (fillfactor = 100);
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock reset (fillfactor);
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock set (toast.autovacuum_enabled = off);
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock set (autovacuum_enabled = off);
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock alter column f2 set (n_distinct = 1);
+select * from my_locks order by 1;
+rollback;
+
+-- test that mixing options with different lock levels works as expected
+begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
+select * from my_locks order by 1;
+commit;
+
+begin; alter table alterlock alter column f2 set storage extended;
+select * from my_locks order by 1;
+rollback;
+
+begin; alter table alterlock alter column f2 set default 'x';
+select * from my_locks order by 1;
+rollback;
+
+begin;
+create trigger ttdummy
+ before delete or update on alterlock
+ for each row
+ execute procedure
+ ttdummy (1, 1);
+select * from my_locks order by 1;
+rollback;
+
+begin;
+select * from my_locks order by 1;
+alter table alterlock2 add foreign key (f1) references alterlock (f1);
+select * from my_locks order by 1;
+rollback;
+
+begin;
+alter table alterlock2
+add constraint alterlock2nv foreign key (f1) references alterlock (f1) NOT VALID;
+select * from my_locks order by 1;
+commit;
+begin;
+alter table alterlock2 validate constraint alterlock2nv;
+select * from my_locks order by 1;
+rollback;
+
+create or replace view my_locks as
+select case when c.relname like 'pg_toast%' then 'pg_toast' else c.relname end, max(mode::lockmodes) as max_lockmode
+from pg_locks l join pg_class c on l.relation = c.oid
+where virtualtransaction = (
+ select virtualtransaction
+ from pg_locks
+ where transactionid = pg_current_xact_id()::xid)
+and locktype = 'relation'
+and relnamespace != (select oid from pg_namespace where nspname = 'pg_catalog')
+and c.relname = 'my_locks'
+group by c.relname;
+
+-- raise exception
+alter table my_locks set (autovacuum_enabled = false);
+alter view my_locks set (autovacuum_enabled = false);
+alter table my_locks reset (autovacuum_enabled);
+alter view my_locks reset (autovacuum_enabled);
+
+begin;
+alter view my_locks set (security_barrier=off);
+select * from my_locks order by 1;
+alter view my_locks reset (security_barrier);
+rollback;
+
+-- this test intentionally applies the ALTER TABLE command against a view, but
+-- uses a view option so we expect this to succeed. This form of SQL is
+-- accepted for historical reasons, as shown in the docs for ALTER VIEW
+begin;
+alter table my_locks set (security_barrier=off);
+select * from my_locks order by 1;
+alter table my_locks reset (security_barrier);
+rollback;
+
+-- cleanup
+drop table alterlock2;
+drop table alterlock;
+drop view my_locks;
+drop type lockmodes;
+
+--
+-- alter function
+--
+create function test_strict(text) returns text as
+ 'select coalesce($1, ''got passed a null'');'
+ language sql returns null on null input;
+select test_strict(NULL);
+alter function test_strict(text) called on null input;
+select test_strict(NULL);
+
+create function non_strict(text) returns text as
+ 'select coalesce($1, ''got passed a null'');'
+ language sql called on null input;
+select non_strict(NULL);
+alter function non_strict(text) returns null on null input;
+select non_strict(NULL);
+
+--
+-- alter object set schema
+--
+
+create schema alter1;
+create schema alter2;
+
+create table alter1.t1(f1 serial primary key, f2 int check (f2 > 0));
+
+create view alter1.v1 as select * from alter1.t1;
+
+create function alter1.plus1(int) returns int as 'select $1+1' language sql;
+
+create domain alter1.posint integer check (value > 0);
+
+create type alter1.ctype as (f1 int, f2 text);
+
+create function alter1.same(alter1.ctype, alter1.ctype) returns boolean language sql
+as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
+
+create operator alter1.=(procedure = alter1.same, leftarg = alter1.ctype, rightarg = alter1.ctype);
+
+create operator class alter1.ctype_hash_ops default for type alter1.ctype using hash as
+ operator 1 alter1.=(alter1.ctype, alter1.ctype);
+
+create conversion alter1.latin1_to_utf8 for 'latin1' to 'utf8' from iso8859_1_to_utf8;
+
+create text search parser alter1.prs(start = prsd_start, gettoken = prsd_nexttoken, end = prsd_end, lextypes = prsd_lextype);
+create text search configuration alter1.cfg(parser = alter1.prs);
+create text search template alter1.tmpl(init = dsimple_init, lexize = dsimple_lexize);
+create text search dictionary alter1.dict(template = alter1.tmpl);
+
+insert into alter1.t1(f2) values(11);
+insert into alter1.t1(f2) values(12);
+
+alter table alter1.t1 set schema alter1; -- no-op, same schema
+alter table alter1.t1 set schema alter2;
+alter table alter1.v1 set schema alter2;
+alter function alter1.plus1(int) set schema alter2;
+alter domain alter1.posint set schema alter2;
+alter operator class alter1.ctype_hash_ops using hash set schema alter2;
+alter operator family alter1.ctype_hash_ops using hash set schema alter2;
+alter operator alter1.=(alter1.ctype, alter1.ctype) set schema alter2;
+alter function alter1.same(alter1.ctype, alter1.ctype) set schema alter2;
+alter type alter1.ctype set schema alter1; -- no-op, same schema
+alter type alter1.ctype set schema alter2;
+alter conversion alter1.latin1_to_utf8 set schema alter2;
+alter text search parser alter1.prs set schema alter2;
+alter text search configuration alter1.cfg set schema alter2;
+alter text search template alter1.tmpl set schema alter2;
+alter text search dictionary alter1.dict set schema alter2;
+
+-- this should succeed because nothing is left in alter1
+drop schema alter1;
+
+insert into alter2.t1(f2) values(13);
+insert into alter2.t1(f2) values(14);
+
+select * from alter2.t1;
+
+select * from alter2.v1;
+
+select alter2.plus1(41);
+
+-- clean up
+drop schema alter2 cascade;
+
+--
+-- composite types
+--
+
+CREATE TYPE test_type AS (a int);
+\d test_type
+
+ALTER TYPE nosuchtype ADD ATTRIBUTE b text; -- fails
+
+ALTER TYPE test_type ADD ATTRIBUTE b text;
+\d test_type
+
+ALTER TYPE test_type ADD ATTRIBUTE b text; -- fails
+
+ALTER TYPE test_type ALTER ATTRIBUTE b SET DATA TYPE varchar;
+\d test_type
+
+ALTER TYPE test_type ALTER ATTRIBUTE b SET DATA TYPE integer;
+\d test_type
+
+ALTER TYPE test_type DROP ATTRIBUTE b;
+\d test_type
+
+ALTER TYPE test_type DROP ATTRIBUTE c; -- fails
+
+ALTER TYPE test_type DROP ATTRIBUTE IF EXISTS c;
+
+ALTER TYPE test_type DROP ATTRIBUTE a, ADD ATTRIBUTE d boolean;
+\d test_type
+
+ALTER TYPE test_type RENAME ATTRIBUTE a TO aa;
+ALTER TYPE test_type RENAME ATTRIBUTE d TO dd;
+\d test_type
+
+DROP TYPE test_type;
+
+CREATE TYPE test_type1 AS (a int, b text);
+CREATE TABLE test_tbl1 (x int, y test_type1);
+ALTER TYPE test_type1 ALTER ATTRIBUTE b TYPE varchar; -- fails
+
+CREATE TYPE test_type2 AS (a int, b text);
+CREATE TABLE test_tbl2 OF test_type2;
+CREATE TABLE test_tbl2_subclass () INHERITS (test_tbl2);
+\d test_type2
+\d test_tbl2
+
+ALTER TYPE test_type2 ADD ATTRIBUTE c text; -- fails
+ALTER TYPE test_type2 ADD ATTRIBUTE c text CASCADE;
+\d test_type2
+\d test_tbl2
+
+ALTER TYPE test_type2 ALTER ATTRIBUTE b TYPE varchar; -- fails
+ALTER TYPE test_type2 ALTER ATTRIBUTE b TYPE varchar CASCADE;
+\d test_type2
+\d test_tbl2
+
+ALTER TYPE test_type2 DROP ATTRIBUTE b; -- fails
+ALTER TYPE test_type2 DROP ATTRIBUTE b CASCADE;
+\d test_type2
+\d test_tbl2
+
+ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa; -- fails
+ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa CASCADE;
+\d test_type2
+\d test_tbl2
+\d test_tbl2_subclass
+
+DROP TABLE test_tbl2_subclass;
+
+CREATE TYPE test_typex AS (a int, b text);
+CREATE TABLE test_tblx (x int, y test_typex check ((y).a > 0));
+ALTER TYPE test_typex DROP ATTRIBUTE a; -- fails
+ALTER TYPE test_typex DROP ATTRIBUTE a CASCADE;
+\d test_tblx
+DROP TABLE test_tblx;
+DROP TYPE test_typex;
+
+-- This test isn't that interesting on its own, but the purpose is to leave
+-- behind a table to test pg_upgrade with. The table has a composite type
+-- column in it, and the composite type has a dropped attribute.
+CREATE TYPE test_type3 AS (a int);
+CREATE TABLE test_tbl3 (c) AS SELECT '(1)'::test_type3;
+ALTER TYPE test_type3 DROP ATTRIBUTE a, ADD ATTRIBUTE b int;
+
+CREATE TYPE test_type_empty AS ();
+DROP TYPE test_type_empty;
+
+--
+-- typed tables: OF / NOT OF
+--
+
+CREATE TYPE tt_t0 AS (z inet, x int, y numeric(8,2));
+ALTER TYPE tt_t0 DROP ATTRIBUTE z;
+CREATE TABLE tt0 (x int NOT NULL, y numeric(8,2)); -- OK
+CREATE TABLE tt1 (x int, y bigint); -- wrong base type
+CREATE TABLE tt2 (x int, y numeric(9,2)); -- wrong typmod
+CREATE TABLE tt3 (y numeric(8,2), x int); -- wrong column order
+CREATE TABLE tt4 (x int); -- too few columns
+CREATE TABLE tt5 (x int, y numeric(8,2), z int); -- too few columns
+CREATE TABLE tt6 () INHERITS (tt0); -- can't have a parent
+CREATE TABLE tt7 (x int, q text, y numeric(8,2));
+ALTER TABLE tt7 DROP q; -- OK
+
+ALTER TABLE tt0 OF tt_t0;
+ALTER TABLE tt1 OF tt_t0;
+ALTER TABLE tt2 OF tt_t0;
+ALTER TABLE tt3 OF tt_t0;
+ALTER TABLE tt4 OF tt_t0;
+ALTER TABLE tt5 OF tt_t0;
+ALTER TABLE tt6 OF tt_t0;
+ALTER TABLE tt7 OF tt_t0;
+
+CREATE TYPE tt_t1 AS (x int, y numeric(8,2));
+ALTER TABLE tt7 OF tt_t1; -- reassign an already-typed table
+ALTER TABLE tt7 NOT OF;
+\d tt7
+
+-- make sure we can drop a constraint on the parent but it remains on the child
+CREATE TABLE test_drop_constr_parent (c text CHECK (c IS NOT NULL));
+CREATE TABLE test_drop_constr_child () INHERITS (test_drop_constr_parent);
+ALTER TABLE ONLY test_drop_constr_parent DROP CONSTRAINT "test_drop_constr_parent_c_check";
+-- should fail
+INSERT INTO test_drop_constr_child (c) VALUES (NULL);
+DROP TABLE test_drop_constr_parent CASCADE;
+
+--
+-- IF EXISTS test
+--
+ALTER TABLE IF EXISTS tt8 ADD COLUMN f int;
+ALTER TABLE IF EXISTS tt8 ADD CONSTRAINT xxx PRIMARY KEY(f);
+ALTER TABLE IF EXISTS tt8 ADD CHECK (f BETWEEN 0 AND 10);
+ALTER TABLE IF EXISTS tt8 ALTER COLUMN f SET DEFAULT 0;
+ALTER TABLE IF EXISTS tt8 RENAME COLUMN f TO f1;
+ALTER TABLE IF EXISTS tt8 SET SCHEMA alter2;
+
+CREATE TABLE tt8(a int);
+CREATE SCHEMA alter2;
+
+ALTER TABLE IF EXISTS tt8 ADD COLUMN f int;
+ALTER TABLE IF EXISTS tt8 ADD CONSTRAINT xxx PRIMARY KEY(f);
+ALTER TABLE IF EXISTS tt8 ADD CHECK (f BETWEEN 0 AND 10);
+ALTER TABLE IF EXISTS tt8 ALTER COLUMN f SET DEFAULT 0;
+ALTER TABLE IF EXISTS tt8 RENAME COLUMN f TO f1;
+ALTER TABLE IF EXISTS tt8 SET SCHEMA alter2;
+
+\d alter2.tt8
+
+DROP TABLE alter2.tt8;
+DROP SCHEMA alter2;
+
+--
+-- Check conflicts between index and CHECK constraint names
+--
+CREATE TABLE tt9(c integer);
+ALTER TABLE tt9 ADD CHECK(c > 1);
+ALTER TABLE tt9 ADD CHECK(c > 2); -- picks nonconflicting name
+ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 3);
+ALTER TABLE tt9 ADD CONSTRAINT foo CHECK(c > 4); -- fail, dup name
+ALTER TABLE tt9 ADD UNIQUE(c);
+ALTER TABLE tt9 ADD UNIQUE(c); -- picks nonconflicting name
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key UNIQUE(c); -- fail, dup name
+ALTER TABLE tt9 ADD CONSTRAINT foo UNIQUE(c); -- fail, dup name
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key CHECK(c > 5); -- fail, dup name
+ALTER TABLE tt9 ADD CONSTRAINT tt9_c_key2 CHECK(c > 6);
+ALTER TABLE tt9 ADD UNIQUE(c); -- picks nonconflicting name
+\d tt9
+DROP TABLE tt9;
+
+
+-- Check that comments on constraints and indexes are not lost at ALTER TABLE.
+CREATE TABLE comment_test (
+ id int,
+ positive_col int CHECK (positive_col > 0),
+ indexed_col int,
+ CONSTRAINT comment_test_pk PRIMARY KEY (id));
+CREATE INDEX comment_test_index ON comment_test(indexed_col);
+
+COMMENT ON COLUMN comment_test.id IS 'Column ''id'' on comment_test';
+COMMENT ON INDEX comment_test_index IS 'Simple index on comment_test';
+COMMENT ON CONSTRAINT comment_test_positive_col_check ON comment_test IS 'CHECK constraint on comment_test.positive_col';
+COMMENT ON CONSTRAINT comment_test_pk ON comment_test IS 'PRIMARY KEY constraint of comment_test';
+COMMENT ON INDEX comment_test_pk IS 'Index backing the PRIMARY KEY of comment_test';
+
+SELECT col_description('comment_test'::regclass, 1) as comment;
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
+
+-- Change the datatype of all the columns. ALTER TABLE is optimized to not
+-- rebuild an index if the new data type is binary compatible with the old
+-- one. Check do a dummy ALTER TABLE that doesn't change the datatype
+-- first, to test that no-op codepath, and another one that does.
+ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN indexed_col SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE int;
+ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE bigint;
+
+-- Check that the comments are intact.
+SELECT col_description('comment_test'::regclass, 1) as comment;
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
+
+-- Check compatibility for foreign keys and comments. This is done
+-- separately as rebuilding the column type of the parent leads
+-- to an error and would reduce the test scope.
+CREATE TABLE comment_test_child (
+ id text CONSTRAINT comment_test_child_fk REFERENCES comment_test);
+CREATE INDEX comment_test_child_fk ON comment_test_child(id);
+COMMENT ON COLUMN comment_test_child.id IS 'Column ''id'' on comment_test_child';
+COMMENT ON INDEX comment_test_child_fk IS 'Index backing the FOREIGN KEY of comment_test_child';
+COMMENT ON CONSTRAINT comment_test_child_fk ON comment_test_child IS 'FOREIGN KEY constraint of comment_test_child';
+
+-- Change column type of parent
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE text;
+ALTER TABLE comment_test ALTER COLUMN id SET DATA TYPE int USING id::integer;
+
+-- Comments should be intact
+SELECT col_description('comment_test_child'::regclass, 1) as comment;
+SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test_child'::regclass ORDER BY 1, 2;
+SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test_child'::regclass ORDER BY 1, 2;
+
+-- Check that we map relation oids to filenodes and back correctly. Only
+-- display bad mappings so the test output doesn't change all the time. A
+-- filenode function call can return NULL for a relation dropped concurrently
+-- with the call's surrounding query, so ignore a NULL mapped_oid for
+-- relations that no longer exist after all calls finish.
+CREATE TEMP TABLE filenode_mapping AS
+SELECT
+ oid, mapped_oid, reltablespace, relfilenode, relname
+FROM pg_class,
+ pg_filenode_relation(reltablespace, pg_relation_filenode(oid)) AS mapped_oid
+WHERE relkind IN ('r', 'i', 'S', 't', 'm') AND mapped_oid IS DISTINCT FROM oid;
+
+SELECT m.* FROM filenode_mapping m LEFT JOIN pg_class c ON c.oid = m.oid
+WHERE c.oid IS NOT NULL OR m.mapped_oid IS NOT NULL;
+
+-- Checks on creating and manipulation of user defined relations in
+-- pg_catalog.
+
+SHOW allow_system_table_mods;
+-- disallowed because of search_path issues with pg_dump
+CREATE TABLE pg_catalog.new_system_table();
+-- instead create in public first, move to catalog
+CREATE TABLE new_system_table(id serial primary key, othercol text);
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+ALTER TABLE new_system_table SET SCHEMA public;
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+-- will be ignored -- already there:
+ALTER TABLE new_system_table SET SCHEMA pg_catalog;
+ALTER TABLE new_system_table RENAME TO old_system_table;
+CREATE INDEX old_system_table__othercol ON old_system_table (othercol);
+INSERT INTO old_system_table(othercol) VALUES ('somedata'), ('otherdata');
+UPDATE old_system_table SET id = -id;
+DELETE FROM old_system_table WHERE othercol = 'somedata';
+TRUNCATE old_system_table;
+ALTER TABLE old_system_table DROP CONSTRAINT new_system_table_pkey;
+ALTER TABLE old_system_table DROP COLUMN othercol;
+DROP TABLE old_system_table;
+
+-- set logged
+CREATE UNLOGGED TABLE unlogged1(f1 SERIAL PRIMARY KEY, f2 TEXT);
+-- check relpersistence of an unlogged table
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1'
+ORDER BY relname;
+CREATE UNLOGGED TABLE unlogged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged1); -- foreign key
+CREATE UNLOGGED TABLE unlogged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged3); -- self-referencing foreign key
+ALTER TABLE unlogged3 SET LOGGED; -- skip self-referencing foreign key
+ALTER TABLE unlogged2 SET LOGGED; -- fails because a foreign key to an unlogged table exists
+ALTER TABLE unlogged1 SET LOGGED;
+-- check relpersistence of an unlogged table after changing to permanent
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^unlogged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^unlogged1'
+ORDER BY relname;
+ALTER TABLE unlogged1 SET LOGGED; -- silently do nothing
+DROP TABLE unlogged3;
+DROP TABLE unlogged2;
+DROP TABLE unlogged1;
+-- set unlogged
+CREATE TABLE logged1(f1 SERIAL PRIMARY KEY, f2 TEXT);
+-- check relpersistence of a permanent table
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^logged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1'
+ORDER BY relname;
+CREATE TABLE logged2(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged1); -- foreign key
+CREATE TABLE logged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES logged3); -- self-referencing foreign key
+ALTER TABLE logged1 SET UNLOGGED; -- fails because a foreign key from a permanent table exists
+ALTER TABLE logged3 SET UNLOGGED; -- skip self-referencing foreign key
+ALTER TABLE logged2 SET UNLOGGED;
+ALTER TABLE logged1 SET UNLOGGED;
+-- check relpersistence of a permanent table after changing to unlogged
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^logged1'
+UNION ALL
+SELECT 'toast table', t.relkind, t.relpersistence FROM pg_class r JOIN pg_class t ON t.oid = r.reltoastrelid WHERE r.relname ~ '^logged1'
+UNION ALL
+SELECT 'toast index', ri.relkind, ri.relpersistence FROM pg_class r join pg_class t ON t.oid = r.reltoastrelid JOIN pg_index i ON i.indrelid = t.oid JOIN pg_class ri ON ri.oid = i.indexrelid WHERE r.relname ~ '^logged1'
+ORDER BY relname;
+ALTER TABLE logged1 SET UNLOGGED; -- silently do nothing
+DROP TABLE logged3;
+DROP TABLE logged2;
+DROP TABLE logged1;
+
+-- test ADD COLUMN IF NOT EXISTS
+CREATE TABLE test_add_column(c1 integer);
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer;
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer; -- fail because c2 already exists
+ALTER TABLE ONLY test_add_column
+ ADD COLUMN c2 integer; -- fail because c2 already exists
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer; -- skipping because c2 already exists
+ALTER TABLE ONLY test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer; -- skipping because c2 already exists
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN c2 integer, -- fail because c2 already exists
+ ADD COLUMN c3 integer primary key;
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN c3 integer primary key;
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN IF NOT EXISTS c3 integer primary key; -- skipping because c3 already exists
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c2 integer, -- skipping because c2 already exists
+ ADD COLUMN IF NOT EXISTS c3 integer, -- skipping because c3 already exists
+ ADD COLUMN c4 integer REFERENCES test_add_column;
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c4 integer REFERENCES test_add_column;
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c5 SERIAL CHECK (c5 > 8);
+\d test_add_column
+ALTER TABLE test_add_column
+ ADD COLUMN IF NOT EXISTS c5 SERIAL CHECK (c5 > 10);
+\d test_add_column*
+DROP TABLE test_add_column;
+\d test_add_column*
+
+-- assorted cases with multiple ALTER TABLE steps
+CREATE TABLE ataddindex(f1 INT);
+INSERT INTO ataddindex VALUES (42), (43);
+CREATE UNIQUE INDEX ataddindexi0 ON ataddindex(f1);
+ALTER TABLE ataddindex
+ ADD PRIMARY KEY USING INDEX ataddindexi0,
+ ALTER f1 TYPE BIGINT;
+\d ataddindex
+DROP TABLE ataddindex;
+
+CREATE TABLE ataddindex(f1 VARCHAR(10));
+INSERT INTO ataddindex(f1) VALUES ('foo'), ('a');
+ALTER TABLE ataddindex
+ ALTER f1 SET DATA TYPE TEXT,
+ ADD EXCLUDE ((f1 LIKE 'a') WITH =);
+\d ataddindex
+DROP TABLE ataddindex;
+
+CREATE TABLE ataddindex(id int, ref_id int);
+ALTER TABLE ataddindex
+ ADD PRIMARY KEY (id),
+ ADD FOREIGN KEY (ref_id) REFERENCES ataddindex;
+\d ataddindex
+DROP TABLE ataddindex;
+
+CREATE TABLE ataddindex(id int, ref_id int);
+ALTER TABLE ataddindex
+ ADD UNIQUE (id),
+ ADD FOREIGN KEY (ref_id) REFERENCES ataddindex (id);
+\d ataddindex
+DROP TABLE ataddindex;
+
+-- unsupported constraint types for partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (a, (a+b+1));
+ALTER TABLE partitioned ADD EXCLUDE USING gist (a WITH &&);
+
+-- cannot drop column that is part of the partition key
+ALTER TABLE partitioned DROP COLUMN a;
+ALTER TABLE partitioned ALTER COLUMN a TYPE char(5);
+ALTER TABLE partitioned DROP COLUMN b;
+ALTER TABLE partitioned ALTER COLUMN b TYPE char(5);
+
+-- partitioned table cannot participate in regular inheritance
+CREATE TABLE nonpartitioned (
+ a int,
+ b int
+);
+ALTER TABLE partitioned INHERIT nonpartitioned;
+ALTER TABLE nonpartitioned INHERIT partitioned;
+
+-- cannot add NO INHERIT constraint to partitioned tables
+ALTER TABLE partitioned ADD CONSTRAINT chk_a CHECK (a > 0) NO INHERIT;
+
+DROP TABLE partitioned, nonpartitioned;
+
+--
+-- ATTACH PARTITION
+--
+
+-- check that target table is partitioned
+CREATE TABLE unparted (
+ a int
+);
+CREATE TABLE fail_part (like unparted);
+ALTER TABLE unparted ATTACH PARTITION fail_part FOR VALUES IN ('a');
+DROP TABLE unparted, fail_part;
+
+-- check that partition bound is compatible
+CREATE TABLE list_parted (
+ a int NOT NULL,
+ b char(2) COLLATE "C",
+ CONSTRAINT check_a CHECK (a > 0)
+) PARTITION BY LIST (a);
+CREATE TABLE fail_part (LIKE list_parted);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES FROM (1) TO (10);
+DROP TABLE fail_part;
+
+-- check that the table being attached exists
+ALTER TABLE list_parted ATTACH PARTITION nonexistent FOR VALUES IN (1);
+
+-- check ownership of the source table
+CREATE ROLE regress_test_me;
+CREATE ROLE regress_test_not_me;
+CREATE TABLE not_owned_by_me (LIKE list_parted);
+ALTER TABLE not_owned_by_me OWNER TO regress_test_not_me;
+SET SESSION AUTHORIZATION regress_test_me;
+CREATE TABLE owned_by_me (
+ a int
+) PARTITION BY LIST (a);
+ALTER TABLE owned_by_me ATTACH PARTITION not_owned_by_me FOR VALUES IN (1);
+RESET SESSION AUTHORIZATION;
+DROP TABLE owned_by_me, not_owned_by_me;
+DROP ROLE regress_test_not_me;
+DROP ROLE regress_test_me;
+
+-- check that the table being attached is not part of regular inheritance
+CREATE TABLE parent (LIKE list_parted);
+CREATE TABLE child () INHERITS (parent);
+ALTER TABLE list_parted ATTACH PARTITION child FOR VALUES IN (1);
+ALTER TABLE list_parted ATTACH PARTITION parent FOR VALUES IN (1);
+DROP TABLE parent CASCADE;
+
+-- check any TEMP-ness
+CREATE TEMP TABLE temp_parted (a int) PARTITION BY LIST (a);
+CREATE TABLE perm_part (a int);
+ALTER TABLE temp_parted ATTACH PARTITION perm_part FOR VALUES IN (1);
+DROP TABLE temp_parted, perm_part;
+
+-- check that the table being attached is not a typed table
+CREATE TYPE mytype AS (a int);
+CREATE TABLE fail_part OF mytype;
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TYPE mytype CASCADE;
+
+-- check that the table being attached has only columns present in the parent
+CREATE TABLE fail_part (like list_parted, c int);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TABLE fail_part;
+
+-- check that the table being attached has every column of the parent
+CREATE TABLE fail_part (a int NOT NULL);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TABLE fail_part;
+
+-- check that columns match in type, collation and NOT NULL status
+CREATE TABLE fail_part (
+ b char(3),
+ a int NOT NULL
+);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+ALTER TABLE fail_part ALTER b TYPE char (2) COLLATE "POSIX";
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TABLE fail_part;
+
+-- check that the table being attached has all constraints of the parent
+CREATE TABLE fail_part (
+ b char(2) COLLATE "C",
+ a int NOT NULL
+);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+
+-- check that the constraint matches in definition with parent's constraint
+ALTER TABLE fail_part ADD CONSTRAINT check_a CHECK (a >= 0);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TABLE fail_part;
+
+-- check the attributes and constraints after partition is attached
+CREATE TABLE part_1 (
+ a int NOT NULL,
+ b char(2) COLLATE "C",
+ CONSTRAINT check_a CHECK (a > 0)
+);
+ALTER TABLE list_parted ATTACH PARTITION part_1 FOR VALUES IN (1);
+-- attislocal and conislocal are always false for merged attributes and constraints respectively.
+SELECT attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_1'::regclass AND attnum > 0;
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_1'::regclass AND conname = 'check_a';
+
+-- check that the new partition won't overlap with an existing partition
+CREATE TABLE fail_part (LIKE part_1 INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION fail_part FOR VALUES IN (1);
+DROP TABLE fail_part;
+-- check that an existing table can be attached as a default partition
+CREATE TABLE def_part (LIKE list_parted INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION def_part DEFAULT;
+-- check attaching default partition fails if a default partition already
+-- exists
+CREATE TABLE fail_def_part (LIKE part_1 INCLUDING CONSTRAINTS);
+ALTER TABLE list_parted ATTACH PARTITION fail_def_part DEFAULT;
+
+-- check validation when attaching list partitions
+CREATE TABLE list_parted2 (
+ a int,
+ b char
+) PARTITION BY LIST (a);
+
+-- check that violating rows are correctly reported
+CREATE TABLE part_2 (LIKE list_parted2);
+INSERT INTO part_2 VALUES (3, 'a');
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+
+-- should be ok after deleting the bad row
+DELETE FROM part_2;
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+
+-- check partition cannot be attached if default has some row for its values
+CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+INSERT INTO list_parted2_def VALUES (11, 'z');
+CREATE TABLE part_3 (LIKE list_parted2);
+ALTER TABLE list_parted2 ATTACH PARTITION part_3 FOR VALUES IN (11);
+-- should be ok after deleting the bad row
+DELETE FROM list_parted2_def WHERE a = 11;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3 FOR VALUES IN (11);
+
+-- adding constraints that describe the desired partition constraint
+-- (or more restrictive) will help skip the validation scan
+CREATE TABLE part_3_4 (
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IN (3))
+);
+
+-- however, if a list partition does not accept nulls, there should be
+-- an explicit NOT NULL constraint on the partition key column for the
+-- validation scan to be skipped;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3_4 FOR VALUES IN (3, 4);
+
+-- adding a NOT NULL constraint will cause the scan to be skipped
+ALTER TABLE list_parted2 DETACH PARTITION part_3_4;
+ALTER TABLE part_3_4 ALTER a SET NOT NULL;
+ALTER TABLE list_parted2 ATTACH PARTITION part_3_4 FOR VALUES IN (3, 4);
+
+-- check if default partition scan skipped
+ALTER TABLE list_parted2_def ADD CONSTRAINT check_a CHECK (a IN (5, 6));
+CREATE TABLE part_55_66 PARTITION OF list_parted2 FOR VALUES IN (55, 66);
+
+-- check validation when attaching range partitions
+CREATE TABLE range_parted (
+ a int,
+ b int
+) PARTITION BY RANGE (a, b);
+
+-- check that violating rows are correctly reported
+CREATE TABLE part1 (
+ a int NOT NULL CHECK (a = 1),
+ b int NOT NULL CHECK (b >= 1 AND b <= 10)
+);
+INSERT INTO part1 VALUES (1, 10);
+-- Remember the TO bound is exclusive
+ALTER TABLE range_parted ATTACH PARTITION part1 FOR VALUES FROM (1, 1) TO (1, 10);
+
+-- should be ok after deleting the bad row
+DELETE FROM part1;
+ALTER TABLE range_parted ATTACH PARTITION part1 FOR VALUES FROM (1, 1) TO (1, 10);
+
+-- adding constraints that describe the desired partition constraint
+-- (or more restrictive) will help skip the validation scan
+CREATE TABLE part2 (
+ a int NOT NULL CHECK (a = 1),
+ b int NOT NULL CHECK (b >= 10 AND b < 18)
+);
+ALTER TABLE range_parted ATTACH PARTITION part2 FOR VALUES FROM (1, 10) TO (1, 20);
+
+-- Create default partition
+CREATE TABLE partr_def1 PARTITION OF range_parted DEFAULT;
+
+-- Only one default partition is allowed, hence, following should give error
+CREATE TABLE partr_def2 (LIKE part1 INCLUDING CONSTRAINTS);
+ALTER TABLE range_parted ATTACH PARTITION partr_def2 DEFAULT;
+
+-- Overlapping partitions cannot be attached, hence, following should give error
+INSERT INTO partr_def1 VALUES (2, 10);
+CREATE TABLE part3 (LIKE range_parted);
+ALTER TABLE range_parted ATTACH partition part3 FOR VALUES FROM (2, 10) TO (2, 20);
+
+-- Attaching partitions should be successful when there are no overlapping rows
+ALTER TABLE range_parted ATTACH partition part3 FOR VALUES FROM (3, 10) TO (3, 20);
+
+-- check that leaf partitions are scanned when attaching a partitioned
+-- table
+CREATE TABLE part_5 (
+ LIKE list_parted2
+) PARTITION BY LIST (b);
+
+-- check that violating rows are correctly reported
+CREATE TABLE part_5_a PARTITION OF part_5 FOR VALUES IN ('a');
+INSERT INTO part_5_a (a, b) VALUES (6, 'a');
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+
+-- delete the faulting row and also add a constraint to skip the scan
+DELETE FROM part_5_a WHERE a NOT IN (3);
+ALTER TABLE part_5 ADD CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 5);
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+ALTER TABLE list_parted2 DETACH PARTITION part_5;
+ALTER TABLE part_5 DROP CONSTRAINT check_a;
+
+-- scan should again be skipped, even though NOT NULL is now a column property
+ALTER TABLE part_5 ADD CONSTRAINT check_a CHECK (a IN (5)), ALTER a SET NOT NULL;
+ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
+
+-- Check the case where attnos of the partitioning columns in the table being
+-- attached differs from the parent. It should not affect the constraint-
+-- checking logic that allows to skip the scan.
+CREATE TABLE part_6 (
+ c int,
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 6)
+);
+ALTER TABLE part_6 DROP c;
+ALTER TABLE list_parted2 ATTACH PARTITION part_6 FOR VALUES IN (6);
+
+-- Similar to above, but the table being attached is a partitioned table
+-- whose partition has still different attnos for the root partitioning
+-- columns.
+CREATE TABLE part_7 (
+ LIKE list_parted2,
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
+) PARTITION BY LIST (b);
+CREATE TABLE part_7_a_null (
+ c int,
+ d int,
+ e int,
+ LIKE list_parted2, -- 'a' will have attnum = 4
+ CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'),
+ CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
+);
+ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
+ALTER TABLE part_7 ATTACH PARTITION part_7_a_null FOR VALUES IN ('a', null);
+ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
+
+-- Same example, but check this time that the constraint correctly detects
+-- violating rows
+ALTER TABLE list_parted2 DETACH PARTITION part_7;
+ALTER TABLE part_7 DROP CONSTRAINT check_a; -- thusly, scan won't be skipped
+INSERT INTO part_7 (a, b) VALUES (8, null), (9, 'a');
+SELECT tableoid::regclass, a, b FROM part_7 order by a;
+ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
+
+-- check that leaf partitions of default partition are scanned when
+-- attaching a partitioned table.
+ALTER TABLE part_5 DROP CONSTRAINT check_a;
+CREATE TABLE part5_def PARTITION OF part_5 DEFAULT PARTITION BY LIST(a);
+CREATE TABLE part5_def_p1 PARTITION OF part5_def FOR VALUES IN (5);
+INSERT INTO part5_def_p1 VALUES (5, 'y');
+CREATE TABLE part5_p1 (LIKE part_5);
+ALTER TABLE part_5 ATTACH PARTITION part5_p1 FOR VALUES IN ('y');
+-- should be ok after deleting the bad row
+DELETE FROM part5_def_p1 WHERE b = 'y';
+ALTER TABLE part_5 ATTACH PARTITION part5_p1 FOR VALUES IN ('y');
+
+-- check that the table being attached is not already a partition
+ALTER TABLE list_parted2 ATTACH PARTITION part_2 FOR VALUES IN (2);
+
+-- check that circular inheritance is not allowed
+ALTER TABLE part_5 ATTACH PARTITION list_parted2 FOR VALUES IN ('b');
+ALTER TABLE list_parted2 ATTACH PARTITION list_parted2 FOR VALUES IN (0);
+
+-- If a partitioned table being created or an existing table being attached
+-- as a partition does not have a constraint that would allow validation scan
+-- to be skipped, but an individual partition does, then the partition's
+-- validation scan is skipped.
+CREATE TABLE quuux (a int, b text) PARTITION BY LIST (a);
+CREATE TABLE quuux_default PARTITION OF quuux DEFAULT PARTITION BY LIST (b);
+CREATE TABLE quuux_default1 PARTITION OF quuux_default (
+ CONSTRAINT check_1 CHECK (a IS NOT NULL AND a = 1)
+) FOR VALUES IN ('b');
+CREATE TABLE quuux1 (a int, b text);
+ALTER TABLE quuux ATTACH PARTITION quuux1 FOR VALUES IN (1); -- validate!
+CREATE TABLE quuux2 (a int, b text);
+ALTER TABLE quuux ATTACH PARTITION quuux2 FOR VALUES IN (2); -- skip validation
+DROP TABLE quuux1, quuux2;
+-- should validate for quuux1, but not for quuux2
+CREATE TABLE quuux1 PARTITION OF quuux FOR VALUES IN (1);
+CREATE TABLE quuux2 PARTITION OF quuux FOR VALUES IN (2);
+DROP TABLE quuux;
+
+-- check validation when attaching hash partitions
+
+-- Use hand-rolled hash functions and operator class to get predictable result
+-- on different machines. part_test_int4_ops is defined in insert.sql.
+
+-- check that the new partition won't overlap with an existing partition
+CREATE TABLE hash_parted (
+ a int,
+ b int
+) PARTITION BY HASH (a part_test_int4_ops);
+CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 4, REMAINDER 0);
+CREATE TABLE fail_part (LIKE hpart_1);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+DROP TABLE fail_part;
+
+-- check validation when attaching hash partitions
+
+-- check that violating rows are correctly reported
+CREATE TABLE hpart_2 (LIKE hash_parted);
+INSERT INTO hpart_2 VALUES (3, 0);
+ALTER TABLE hash_parted ATTACH PARTITION hpart_2 FOR VALUES WITH (MODULUS 4, REMAINDER 1);
+
+-- should be ok after deleting the bad row
+DELETE FROM hpart_2;
+ALTER TABLE hash_parted ATTACH PARTITION hpart_2 FOR VALUES WITH (MODULUS 4, REMAINDER 1);
+
+-- check that leaf partitions are scanned when attaching a partitioned
+-- table
+CREATE TABLE hpart_5 (
+ LIKE hash_parted
+) PARTITION BY LIST (b);
+
+-- check that violating rows are correctly reported
+CREATE TABLE hpart_5_a PARTITION OF hpart_5 FOR VALUES IN ('1', '2', '3');
+INSERT INTO hpart_5_a (a, b) VALUES (7, 1);
+ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+
+-- should be ok after deleting the bad row
+DELETE FROM hpart_5_a;
+ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+
+-- check that the table being attach is with valid modulus and remainder value
+CREATE TABLE fail_part(LIKE hash_parted);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 3, REMAINDER 2);
+DROP TABLE fail_part;
+
+-- fails with incorrect object type
+CREATE VIEW at_v1 AS SELECT 1 as a;
+ALTER TABLE at_v1 ATTACH PARTITION dummy default;
+DROP VIEW at_v1;
+
+--
+-- DETACH PARTITION
+--
+
+-- check that the table is partitioned at all
+CREATE TABLE regular_table (a int);
+ALTER TABLE regular_table DETACH PARTITION any_name;
+DROP TABLE regular_table;
+
+-- check that the partition being detached exists at all
+ALTER TABLE list_parted2 DETACH PARTITION part_4;
+ALTER TABLE hash_parted DETACH PARTITION hpart_4;
+
+-- check that the partition being detached is actually a partition of the parent
+CREATE TABLE not_a_part (a int);
+ALTER TABLE list_parted2 DETACH PARTITION not_a_part;
+ALTER TABLE list_parted2 DETACH PARTITION part_1;
+
+ALTER TABLE hash_parted DETACH PARTITION not_a_part;
+DROP TABLE not_a_part;
+
+-- check that, after being detached, attinhcount/coninhcount is dropped to 0 and
+-- attislocal/conislocal is set to true
+ALTER TABLE list_parted2 DETACH PARTITION part_3_4;
+SELECT attinhcount, attislocal FROM pg_attribute WHERE attrelid = 'part_3_4'::regclass AND attnum > 0;
+SELECT coninhcount, conislocal FROM pg_constraint WHERE conrelid = 'part_3_4'::regclass AND conname = 'check_a';
+DROP TABLE part_3_4;
+
+-- check that a detached partition is not dropped on dropping a partitioned table
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE(a);
+CREATE TABLE part_rp PARTITION OF range_parted2 FOR VALUES FROM (0) to (100);
+ALTER TABLE range_parted2 DETACH PARTITION part_rp;
+DROP TABLE range_parted2;
+SELECT * from part_rp;
+DROP TABLE part_rp;
+
+-- concurrent detach
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE(a);
+CREATE TABLE part_rp PARTITION OF range_parted2 FOR VALUES FROM (0) to (100);
+BEGIN;
+-- doesn't work in a partition block
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+COMMIT;
+CREATE TABLE part_rpd PARTITION OF range_parted2 DEFAULT;
+-- doesn't work if there's a default partition
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+-- doesn't work for the default partition
+ALTER TABLE range_parted2 DETACH PARTITION part_rpd CONCURRENTLY;
+DROP TABLE part_rpd;
+-- works fine
+ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
+\d+ range_parted2
+-- constraint should be created
+\d part_rp
+CREATE TABLE part_rp100 PARTITION OF range_parted2 (CHECK (a>=123 AND a<133 AND a IS NOT NULL)) FOR VALUES FROM (100) to (200);
+ALTER TABLE range_parted2 DETACH PARTITION part_rp100 CONCURRENTLY;
+-- redundant constraint should not be created
+\d part_rp100
+DROP TABLE range_parted2;
+
+-- Check ALTER TABLE commands for partitioned tables and partitions
+
+-- cannot add/drop column to/from *only* the parent
+ALTER TABLE ONLY list_parted2 ADD COLUMN c int;
+ALTER TABLE ONLY list_parted2 DROP COLUMN b;
+
+-- cannot add a column to partition or drop an inherited one
+ALTER TABLE part_2 ADD COLUMN c text;
+ALTER TABLE part_2 DROP COLUMN b;
+
+-- Nor rename, alter type
+ALTER TABLE part_2 RENAME COLUMN b to c;
+ALTER TABLE part_2 ALTER COLUMN b TYPE text;
+
+-- cannot add/drop NOT NULL or check constraints to *only* the parent, when
+-- partitions exist
+ALTER TABLE ONLY list_parted2 ALTER b SET NOT NULL;
+ALTER TABLE ONLY list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz');
+
+ALTER TABLE list_parted2 ALTER b SET NOT NULL;
+ALTER TABLE ONLY list_parted2 ALTER b DROP NOT NULL;
+ALTER TABLE list_parted2 ADD CONSTRAINT check_b CHECK (b <> 'zz');
+ALTER TABLE ONLY list_parted2 DROP CONSTRAINT check_b;
+
+-- It's alright though, if no partitions are yet created
+CREATE TABLE parted_no_parts (a int) PARTITION BY LIST (a);
+ALTER TABLE ONLY parted_no_parts ALTER a SET NOT NULL;
+ALTER TABLE ONLY parted_no_parts ADD CONSTRAINT check_a CHECK (a > 0);
+ALTER TABLE ONLY parted_no_parts ALTER a DROP NOT NULL;
+ALTER TABLE ONLY parted_no_parts DROP CONSTRAINT check_a;
+DROP TABLE parted_no_parts;
+
+-- cannot drop inherited NOT NULL or check constraints from partition
+ALTER TABLE list_parted2 ALTER b SET NOT NULL, ADD CONSTRAINT check_a2 CHECK (a > 0);
+ALTER TABLE part_2 ALTER b DROP NOT NULL;
+ALTER TABLE part_2 DROP CONSTRAINT check_a2;
+
+-- Doesn't make sense to add NO INHERIT constraints on partitioned tables
+ALTER TABLE list_parted2 add constraint check_b2 check (b <> 'zz') NO INHERIT;
+
+-- check that a partition cannot participate in regular inheritance
+CREATE TABLE inh_test () INHERITS (part_2);
+CREATE TABLE inh_test (LIKE part_2);
+ALTER TABLE inh_test INHERIT part_2;
+ALTER TABLE part_2 INHERIT inh_test;
+
+-- cannot drop or alter type of partition key columns of lower level
+-- partitioned tables; for example, part_5, which is list_parted2's
+-- partition, is partitioned on b;
+ALTER TABLE list_parted2 DROP COLUMN b;
+ALTER TABLE list_parted2 ALTER COLUMN b TYPE text;
+
+-- dropping non-partition key columns should be allowed on the parent table.
+ALTER TABLE list_parted DROP COLUMN b;
+SELECT * FROM list_parted;
+
+-- cleanup
+DROP TABLE list_parted, list_parted2, range_parted;
+DROP TABLE fail_def_part;
+DROP TABLE hash_parted;
+
+-- more tests for certain multi-level partitioning scenarios
+create table p (a int, b int) partition by range (a, b);
+create table p1 (b int, a int not null) partition by range (b);
+create table p11 (like p1);
+alter table p11 drop a;
+alter table p11 add a int;
+alter table p11 drop a;
+alter table p11 add a int not null;
+-- attnum for key attribute 'a' is different in p, p1, and p11
+select attrelid::regclass, attname, attnum
+from pg_attribute
+where attname = 'a'
+ and (attrelid = 'p'::regclass
+ or attrelid = 'p1'::regclass
+ or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
+
+alter table p1 attach partition p11 for values from (2) to (5);
+
+insert into p1 (a, b) values (2, 3);
+-- check that partition validation scan correctly detects violating rows
+alter table p attach partition p1 for values from (1, 2) to (1, 10);
+
+-- cleanup
+drop table p;
+drop table p1;
+
+-- validate constraint on partitioned tables should only scan leaf partitions
+create table parted_validate_test (a int) partition by list (a);
+create table parted_validate_test_1 partition of parted_validate_test for values in (0, 1);
+alter table parted_validate_test add constraint parted_validate_test_chka check (a > 0) not valid;
+alter table parted_validate_test validate constraint parted_validate_test_chka;
+drop table parted_validate_test;
+-- test alter column options
+CREATE TABLE attmp(i integer);
+INSERT INTO attmp VALUES (1);
+ALTER TABLE attmp ALTER COLUMN i SET (n_distinct = 1, n_distinct_inherited = 2);
+ALTER TABLE attmp ALTER COLUMN i RESET (n_distinct_inherited);
+ANALYZE attmp;
+DROP TABLE attmp;
+
+DROP USER regress_alter_table_user1;
+
+-- check that violating rows are correctly reported when attaching as the
+-- default partition
+create table defpart_attach_test (a int) partition by list (a);
+create table defpart_attach_test1 partition of defpart_attach_test for values in (1);
+create table defpart_attach_test_d (b int, a int);
+alter table defpart_attach_test_d drop b;
+insert into defpart_attach_test_d values (1), (2);
+
+-- error because its constraint as the default partition would be violated
+-- by the row containing 1
+alter table defpart_attach_test attach partition defpart_attach_test_d default;
+delete from defpart_attach_test_d where a = 1;
+alter table defpart_attach_test_d add check (a > 1);
+
+-- should be attached successfully and without needing to be scanned
+alter table defpart_attach_test attach partition defpart_attach_test_d default;
+
+-- check that attaching a partition correctly reports any rows in the default
+-- partition that should not be there for the new partition to be attached
+-- successfully
+create table defpart_attach_test_2 (like defpart_attach_test_d);
+alter table defpart_attach_test attach partition defpart_attach_test_2 for values in (2);
+
+drop table defpart_attach_test;
+
+-- check combinations of temporary and permanent relations when attaching
+-- partitions.
+create table perm_part_parent (a int) partition by list (a);
+create temp table temp_part_parent (a int) partition by list (a);
+create table perm_part_child (a int);
+create temp table temp_part_child (a int);
+alter table temp_part_parent attach partition perm_part_child default; -- error
+alter table perm_part_parent attach partition temp_part_child default; -- error
+alter table temp_part_parent attach partition temp_part_child default; -- ok
+drop table perm_part_parent cascade;
+drop table temp_part_parent cascade;
+
+-- check that attaching partitions to a table while it is being used is
+-- prevented
+create table tab_part_attach (a int) partition by list (a);
+create or replace function func_part_attach() returns trigger
+ language plpgsql as $$
+ begin
+ execute 'create table tab_part_attach_1 (a int)';
+ execute 'alter table tab_part_attach attach partition tab_part_attach_1 for values in (1)';
+ return null;
+ end $$;
+create trigger trig_part_attach before insert on tab_part_attach
+ for each statement execute procedure func_part_attach();
+insert into tab_part_attach values (1);
+drop table tab_part_attach;
+drop function func_part_attach();
+
+-- test case where the partitioning operator is a SQL function whose
+-- evaluation results in the table's relcache being rebuilt partway through
+-- the execution of an ATTACH PARTITION command
+create function at_test_sql_partop (int4, int4) returns int language sql
+as $$ select case when $1 = $2 then 0 when $1 > $2 then 1 else -1 end; $$;
+create operator class at_test_sql_partop for type int4 using btree as
+ operator 1 < (int4, int4), operator 2 <= (int4, int4),
+ operator 3 = (int4, int4), operator 4 >= (int4, int4),
+ operator 5 > (int4, int4), function 1 at_test_sql_partop(int4, int4);
+create table at_test_sql_partop (a int) partition by range (a at_test_sql_partop);
+create table at_test_sql_partop_1 (a int);
+alter table at_test_sql_partop attach partition at_test_sql_partop_1 for values from (0) to (10);
+drop table at_test_sql_partop;
+drop operator class at_test_sql_partop using btree;
+drop function at_test_sql_partop;
+
+
+/* Test case for bug #16242 */
+
+-- We create a parent and child where the child has missing
+-- non-null attribute values, and arrange to pass them through
+-- tuple conversion from the child to the parent tupdesc
+create table bar1 (a integer, b integer not null default 1)
+ partition by range (a);
+create table bar2 (a integer);
+insert into bar2 values (1);
+alter table bar2 add column b integer not null default 1;
+-- (at this point bar2 contains tuple with natts=1)
+alter table bar1 attach partition bar2 default;
+
+-- this works:
+select * from bar1;
+
+-- this exercises tuple conversion:
+create function xtrig()
+ returns trigger language plpgsql
+as $$
+ declare
+ r record;
+ begin
+ for r in select * from old loop
+ raise info 'a=%, b=%', r.a, r.b;
+ end loop;
+ return NULL;
+ end;
+$$;
+create trigger xtrig
+ after update on bar1
+ referencing old table as old
+ for each statement execute procedure xtrig();
+
+update bar1 set a = a + 1;
+
+/* End test case for bug #16242 */
+
+/* Test case for bug #17409 */
+
+create table attbl (p1 int constraint pk_attbl primary key);
+create table atref (c1 int references attbl(p1));
+cluster attbl using pk_attbl;
+alter table attbl alter column p1 set data type bigint;
+alter table atref alter column c1 set data type bigint;
+drop table attbl, atref;
+
+create table attbl (p1 int constraint pk_attbl primary key);
+alter table attbl replica identity using index pk_attbl;
+create table atref (c1 int references attbl(p1));
+alter table attbl alter column p1 set data type bigint;
+alter table atref alter column c1 set data type bigint;
+drop table attbl, atref;
+
+/* End test case for bug #17409 */
+
+-- Test that ALTER TABLE rewrite preserves a clustered index
+-- for normal indexes and indexes on constraints.
+create table alttype_cluster (a int);
+alter table alttype_cluster add primary key (a);
+create index alttype_cluster_ind on alttype_cluster (a);
+alter table alttype_cluster cluster on alttype_cluster_ind;
+-- Normal index remains clustered.
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+alter table alttype_cluster alter a type bigint;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+-- Constraint index remains clustered.
+alter table alttype_cluster cluster on alttype_cluster_pkey;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+alter table alttype_cluster alter a type int;
+select indexrelid::regclass, indisclustered from pg_index
+ where indrelid = 'alttype_cluster'::regclass
+ order by indexrelid::regclass::text;
+drop table alttype_cluster;
+
+--
+-- Check that attaching or detaching a partitioned partition correctly leads
+-- to its partitions' constraint being updated to reflect the parent's
+-- newly added/removed constraint
+create table target_parted (a int, b int) partition by list (a);
+create table attach_parted (a int, b int) partition by list (b);
+create table attach_parted_part1 partition of attach_parted for values in (1);
+-- insert a row directly into the leaf partition so that its partition
+-- constraint is built and stored in the relcache
+insert into attach_parted_part1 values (1, 1);
+-- the following better invalidate the partition constraint of the leaf
+-- partition too...
+alter table target_parted attach partition attach_parted for values in (1);
+-- ...such that the following insert fails
+insert into attach_parted_part1 values (2, 1);
+-- ...and doesn't when the partition is detached along with its own partition
+alter table target_parted detach partition attach_parted;
+insert into attach_parted_part1 values (2, 1);
diff --git a/yql/essentials/tests/postgresql/original/cases/arrays.out b/yql/essentials/tests/postgresql/original/cases/arrays.out
new file mode 100644
index 0000000000..4923cf36d6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/arrays.out
@@ -0,0 +1,2436 @@
+--
+-- ARRAYS
+--
+CREATE TABLE arrtest (
+ a int2[],
+ b int4[][][],
+ c name[],
+ d text[][],
+ e float8[],
+ f char(5)[],
+ g varchar(5)[]
+);
+--
+-- 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}}}', '{}', '{}', '{}', '{}');
+UPDATE arrtest SET e[0] = '1.1';
+UPDATE arrtest SET e[1] = '2.2';
+INSERT INTO arrtest (f)
+ VALUES ('{"too long"}');
+ERROR: value too long for type character(5)
+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"}');
+INSERT INTO arrtest (a, b[1:2], c, d[1:2])
+ VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}');
+INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch
+ERROR: subscripted assignment to "b" requires type integer but expression is of type timestamp with time zone
+LINE 1: INSERT INTO arrtest (b[2]) VALUES(now());
+ ^
+HINT: You will need to rewrite or cast the expression.
+INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch
+ERROR: subscripted assignment to "b" requires type integer[] but expression is of type timestamp with time zone
+LINE 1: INSERT INTO arrtest (b[1:2]) VALUES(now());
+ ^
+HINT: You will need to rewrite or cast the expression.
+SELECT * FROM arrtest;
+ a | b | c | d | e | f | g
+-------------+-----------------+-----------+---------------+-----------------+-----------------+-------------
+ {1,2,3,4,5} | {{{0,0},{1,2}}} | {} | {} | [0:1]={1.1,2.2} | {} | {}
+ {11,12,23} | {{3,4},{4,5}} | {foobar} | {{elt1,elt2}} | {3.4,6.7} | {"abc ",abcde} | {abc,abcde}
+ {} | {3,4} | {foo,bar} | {bar,foo} | | |
+(3 rows)
+
+SELECT arrtest.a[1],
+ arrtest.b[1][1][1],
+ arrtest.c[1],
+ arrtest.d[1][1],
+ arrtest.e[0]
+ FROM arrtest;
+ a | b | c | d | e
+----+---+--------+------+-----
+ 1 | 0 | | | 1.1
+ 11 | | foobar | elt1 |
+ | | foo | |
+(3 rows)
+
+SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
+ FROM arrtest;
+ a | b | c | d | e
+----+---+--------+------+-----
+ 1 | 0 | | | 1.1
+ 11 | | foobar | elt1 |
+ | | foo | |
+(3 rows)
+
+SELECT a[1:3],
+ b[1:1][1:2][1:2],
+ c[1:2],
+ d[1:1][1:2]
+ FROM arrtest;
+ a | b | c | d
+------------+-----------------+-----------+---------------
+ {1,2,3} | {{{0,0},{1,2}}} | {} | {}
+ {11,12,23} | {} | {foobar} | {{elt1,elt2}}
+ {} | {} | {foo,bar} | {}
+(3 rows)
+
+SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c
+ FROM arrtest;
+ a | b | c
+---+---+---
+ 1 | 3 |
+ 1 | 2 | 1
+ | 1 | 1
+(3 rows)
+
+SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c
+ FROM arrtest;
+ a | b | c
+-------+-----------------+-------
+ [1:5] | [1:1][1:2][1:2] |
+ [1:3] | [1:2][1:2] | [1:1]
+ | [1:2] | [1:2]
+(3 rows)
+
+-- returns nothing
+SELECT *
+ FROM arrtest
+ WHERE a[1] < 5 and
+ c = '{"foobar"}'::_name;
+ a | b | c | d | e | f | g
+---+---+---+---+---+---+---
+(0 rows)
+
+UPDATE arrtest
+ SET a[1:2] = '{16,25}'
+ WHERE NOT a = '{}'::_int2;
+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]';
+UPDATE arrtest
+ SET c[2:2] = '{"new_word"}'
+ WHERE array_dims(c) is not null;
+SELECT a,b,c FROM arrtest;
+ a | b | c
+---------------+-----------------------+-------------------
+ {16,25,3,4,5} | {{{113,142},{1,147}}} | {}
+ {} | {3,4} | {foo,new_word}
+ {16,25,23} | {{3,4},{4,5}} | {foobar,new_word}
+(3 rows)
+
+SELECT a[1:3],
+ b[1:1][1:2][1:2],
+ c[1:2],
+ d[1:1][2:2]
+ FROM arrtest;
+ a | b | c | d
+------------+-----------------------+-------------------+----------
+ {16,25,3} | {{{113,142},{1,147}}} | {} | {}
+ {} | {} | {foo,new_word} | {}
+ {16,25,23} | {} | {foobar,new_word} | {{elt2}}
+(3 rows)
+
+SELECT b[1:1][2][2],
+ d[1:1][2]
+ FROM arrtest;
+ b | d
+-----------------------+---------------
+ {{{113,142},{1,147}}} | {}
+ {} | {}
+ {} | {{elt1,elt2}}
+(3 rows)
+
+INSERT INTO arrtest(a) VALUES('{1,null,3}');
+SELECT a FROM arrtest;
+ a
+---------------
+ {16,25,3,4,5}
+ {}
+ {16,25,23}
+ {1,NULL,3}
+(4 rows)
+
+UPDATE arrtest SET a[4] = NULL WHERE a[2] IS NULL;
+SELECT a FROM arrtest WHERE a[2] IS NULL;
+ a
+-----------------
+ [4:4]={NULL}
+ {1,NULL,3,NULL}
+(2 rows)
+
+DELETE FROM arrtest WHERE a[2] IS NULL AND b IS NULL;
+SELECT a,b,c FROM arrtest;
+ a | b | c
+---------------+-----------------------+-------------------
+ {16,25,3,4,5} | {{{113,142},{1,147}}} | {}
+ {16,25,23} | {{3,4},{4,5}} | {foobar,new_word}
+ [4:4]={NULL} | {3,4} | {foo,new_word}
+(3 rows)
+
+-- test mixed slice/scalar subscripting
+select '{{1,2,3},{4,5,6},{7,8,9}}'::int[];
+ int4
+---------------------------
+ {{1,2,3},{4,5,6},{7,8,9}}
+(1 row)
+
+select ('{{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2];
+ int4
+---------------
+ {{1,2},{4,5}}
+(1 row)
+
+select '[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[];
+ int4
+--------------------------------------
+ [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
+(1 row)
+
+select ('[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2];
+ int4
+---------------
+ {{5,6},{8,9}}
+(1 row)
+
+--
+-- check subscription corner cases
+--
+-- More subscripts than MAXDIM (6)
+SELECT ('{}'::int[])[1][2][3][4][5][6][7];
+ERROR: number of array dimensions (7) exceeds the maximum allowed (6)
+-- NULL index yields NULL when selecting
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL][1];
+ int4
+------
+
+(1 row)
+
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL:1][1];
+ int4
+------
+
+(1 row)
+
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][1:NULL][1];
+ int4
+------
+
+(1 row)
+
+-- NULL index in assignment is an error
+UPDATE arrtest
+ SET c[NULL] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+ERROR: array subscript in assignment must not be null
+UPDATE arrtest
+ SET c[NULL:1] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+ERROR: array subscript in assignment must not be null
+UPDATE arrtest
+ SET c[1:NULL] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+ERROR: array subscript in assignment must not be null
+-- Un-subscriptable type
+SELECT (now())[1];
+ERROR: cannot subscript type timestamp with time zone because it does not support subscripting
+LINE 1: SELECT (now())[1];
+ ^
+-- test slices with empty lower and/or upper index
+CREATE TEMP TABLE arrtest_s (
+ a int2[],
+ b int2[][]
+);
+INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}');
+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}}');
+SELECT * FROM arrtest_s;
+ a | b
+-------------------+--------------------------------------
+ {1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}}
+ [0:4]={1,2,3,4,5} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
+(2 rows)
+
+SELECT a[:3], b[:2][:2] FROM arrtest_s;
+ a | b
+-----------+---------------------------
+ {1,2,3} | {{1,2},{4,5}}
+ {1,2,3,4} | {{1,2,3},{4,5,6},{7,8,9}}
+(2 rows)
+
+SELECT a[2:], b[2:][2:] FROM arrtest_s;
+ a | b
+-----------+---------------
+ {2,3,4,5} | {{5,6},{8,9}}
+ {3,4,5} | {{9}}
+(2 rows)
+
+SELECT a[:], b[:] FROM arrtest_s;
+ a | b
+-------------+---------------------------
+ {1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}}
+ {1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}}
+(2 rows)
+
+-- updates
+UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14,15}}'
+ WHERE array_lower(a,1) = 1;
+SELECT * FROM arrtest_s;
+ a | b
+-------------------+--------------------------------------
+ [0:4]={1,2,3,4,5} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
+ {11,12,13,4,5} | {{11,12,3},{14,15,6},{7,8,9}}
+(2 rows)
+
+UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28,29}}';
+SELECT * FROM arrtest_s;
+ a | b
+---------------------+---------------------------------------
+ [0:4]={1,2,3,23,24} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,25}}
+ {11,12,23,24,25} | {{11,12,3},{14,25,26},{7,28,29}}
+(2 rows)
+
+UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}';
+SELECT * FROM arrtest_s;
+ a | b
+------------------------+---------------------------------------
+ [0:4]={11,12,13,14,15} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,25}}
+ {11,12,13,14,15} | {{11,12,3},{14,25,26},{7,28,29}}
+(2 rows)
+
+UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; -- fail, too small
+ERROR: source array too small
+INSERT INTO arrtest_s VALUES(NULL, NULL);
+UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}'; -- fail, no good with null
+ERROR: array slice subscript must provide both boundaries
+DETAIL: When assigning to a slice of an empty array value, slice boundaries must be fully specified.
+-- check with fixed-length-array type, such as point
+SELECT f1[0:1] FROM POINT_TBL;
+ERROR: slices of fixed-length arrays not implemented
+SELECT f1[0:] FROM POINT_TBL;
+ERROR: slices of fixed-length arrays not implemented
+SELECT f1[:1] FROM POINT_TBL;
+ERROR: slices of fixed-length arrays not implemented
+SELECT f1[:] FROM POINT_TBL;
+ERROR: slices of fixed-length arrays not implemented
+-- 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 *;
+ f1
+----
+
+(1 row)
+
+INSERT INTO point_tbl(f1[0]) VALUES(0) RETURNING *;
+ f1
+----
+
+(1 row)
+
+-- NULL assignments get ignored
+UPDATE point_tbl SET f1[0] = NULL WHERE f1::text = '(10,10)'::point::text RETURNING *;
+ f1
+---------
+ (10,10)
+(1 row)
+
+-- but non-NULL subscript assignments work
+UPDATE point_tbl SET f1[0] = -10, f1[1] = -10 WHERE f1::text = '(10,10)'::point::text RETURNING *;
+ f1
+-----------
+ (-10,-10)
+(1 row)
+
+-- but not to expand the range
+UPDATE point_tbl SET f1[3] = 10 WHERE f1::text = '(-10,-10)'::point::text RETURNING *;
+ERROR: array subscript out of range
+--
+-- test array extension
+--
+CREATE TEMP TABLE arrtest1 (i int[], t text[]);
+insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']);
+select * from arrtest1;
+ i | t
+--------------+---------------------
+ {1,2,NULL,4} | {one,two,NULL,four}
+(1 row)
+
+update arrtest1 set i[2] = 22, t[2] = 'twenty-two';
+select * from arrtest1;
+ i | t
+---------------+----------------------------
+ {1,22,NULL,4} | {one,twenty-two,NULL,four}
+(1 row)
+
+update arrtest1 set i[5] = 5, t[5] = 'five';
+select * from arrtest1;
+ i | t
+-----------------+---------------------------------
+ {1,22,NULL,4,5} | {one,twenty-two,NULL,four,five}
+(1 row)
+
+update arrtest1 set i[8] = 8, t[8] = 'eight';
+select * from arrtest1;
+ i | t
+-----------------------------+-------------------------------------------------
+ {1,22,NULL,4,5,NULL,NULL,8} | {one,twenty-two,NULL,four,five,NULL,NULL,eight}
+(1 row)
+
+update arrtest1 set i[0] = 0, t[0] = 'zero';
+select * from arrtest1;
+ i | t
+-------------------------------------+------------------------------------------------------------
+ [0:8]={0,1,22,NULL,4,5,NULL,NULL,8} | [0:8]={zero,one,twenty-two,NULL,four,five,NULL,NULL,eight}
+(1 row)
+
+update arrtest1 set i[-3] = -3, t[-3] = 'minus-three';
+select * from arrtest1;
+ i | t
+---------------------------------------------------+-----------------------------------------------------------------------------------
+ [-3:8]={-3,NULL,NULL,0,1,22,NULL,4,5,NULL,NULL,8} | [-3:8]={minus-three,NULL,NULL,zero,one,twenty-two,NULL,four,five,NULL,NULL,eight}
+(1 row)
+
+update arrtest1 set i[0:2] = array[10,11,12], t[0:2] = array['ten','eleven','twelve'];
+select * from arrtest1;
+ i | t
+-----------------------------------------------------+---------------------------------------------------------------------------------
+ [-3:8]={-3,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,8} | [-3:8]={minus-three,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,eight}
+(1 row)
+
+update arrtest1 set i[8:10] = array[18,null,20], t[8:10] = array['p18',null,'p20'];
+select * from arrtest1;
+ i | t
+---------------------------------------------------------------+-----------------------------------------------------------------------------------------
+ [-3:10]={-3,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20} | [-3:10]={minus-three,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20}
+(1 row)
+
+update arrtest1 set i[11:12] = array[null,22], t[11:12] = array[null,'p22'];
+select * from arrtest1;
+ i | t
+-----------------------------------------------------------------------+--------------------------------------------------------------------------------------------------
+ [-3:12]={-3,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20,NULL,22} | [-3:12]={minus-three,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20,NULL,p22}
+(1 row)
+
+update arrtest1 set i[15:16] = array[null,26], t[15:16] = array[null,'p26'];
+select * from arrtest1;
+ i | t
+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------
+ [-3:16]={-3,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20,NULL,22,NULL,NULL,NULL,26} | [-3:16]={minus-three,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20,NULL,p22,NULL,NULL,NULL,p26}
+(1 row)
+
+update arrtest1 set i[-5:-3] = array[-15,-14,-13], t[-5:-3] = array['m15','m14','m13'];
+select * from arrtest1;
+ i | t
+--------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------
+ [-5:16]={-15,-14,-13,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20,NULL,22,NULL,NULL,NULL,26} | [-5:16]={m15,m14,m13,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20,NULL,p22,NULL,NULL,NULL,p26}
+(1 row)
+
+update arrtest1 set i[-7:-6] = array[-17,null], t[-7:-6] = array['m17',null];
+select * from arrtest1;
+ i | t
+-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------
+ [-7:16]={-17,NULL,-15,-14,-13,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20,NULL,22,NULL,NULL,NULL,26} | [-7:16]={m17,NULL,m15,m14,m13,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20,NULL,p22,NULL,NULL,NULL,p26}
+(1 row)
+
+update arrtest1 set i[-12:-10] = array[-22,null,-20], t[-12:-10] = array['m22',null,'m20'];
+select * from arrtest1;
+ i | t
+-----------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------
+ [-12:16]={-22,NULL,-20,NULL,NULL,-17,NULL,-15,-14,-13,NULL,NULL,10,11,12,NULL,4,5,NULL,NULL,18,NULL,20,NULL,22,NULL,NULL,NULL,26} | [-12:16]={m22,NULL,m20,NULL,NULL,m17,NULL,m15,m14,m13,NULL,NULL,ten,eleven,twelve,NULL,four,five,NULL,NULL,p18,NULL,p20,NULL,p22,NULL,NULL,NULL,p26}
+(1 row)
+
+delete from arrtest1;
+insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']);
+select * from arrtest1;
+ i | t
+--------------+---------------------
+ {1,2,NULL,4} | {one,two,NULL,four}
+(1 row)
+
+update arrtest1 set i[0:5] = array[0,1,2,null,4,5], t[0:5] = array['z','p1','p2',null,'p4','p5'];
+select * from arrtest1;
+ i | t
+------------------------+----------------------------
+ [0:5]={0,1,2,NULL,4,5} | [0:5]={z,p1,p2,NULL,p4,p5}
+(1 row)
+
+--
+-- array expressions and operators
+--
+-- table creation and INSERTs
+CREATE TEMP TABLE arrtest2 (i integer ARRAY[4], f float8[], n numeric[], t text[], d timestamp[]);
+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[]
+);
+-- some more test data
+CREATE TEMP TABLE arrtest_f (f0 int, f1 text, f2 float8);
+insert into arrtest_f values(1,'cat1',1.21);
+insert into arrtest_f values(2,'cat1',1.24);
+insert into arrtest_f values(3,'cat1',1.18);
+insert into arrtest_f values(4,'cat1',1.26);
+insert into arrtest_f values(5,'cat1',1.15);
+insert into arrtest_f values(6,'cat2',1.15);
+insert into arrtest_f values(7,'cat2',1.26);
+insert into arrtest_f values(8,'cat2',1.32);
+insert into arrtest_f values(9,'cat2',1.30);
+CREATE TEMP TABLE arrtest_i (f0 int, f1 text, f2 int);
+insert into arrtest_i values(1,'cat1',21);
+insert into arrtest_i values(2,'cat1',24);
+insert into arrtest_i values(3,'cat1',18);
+insert into arrtest_i values(4,'cat1',26);
+insert into arrtest_i values(5,'cat1',15);
+insert into arrtest_i values(6,'cat2',15);
+insert into arrtest_i values(7,'cat2',26);
+insert into arrtest_i values(8,'cat2',32);
+insert into arrtest_i values(9,'cat2',30);
+-- 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;
+ 131 | 221
+-----+-----
+ 131 | 221
+(1 row)
+
+SELECT ARRAY[[[[[['hello'],['world']]]]]];
+ array
+---------------------------
+ {{{{{{hello},{world}}}}}}
+(1 row)
+
+SELECT ARRAY[ARRAY['hello'],ARRAY['world']];
+ array
+-------------------
+ {{hello},{world}}
+(1 row)
+
+SELECT ARRAY(select f2 from arrtest_f order by f2) AS "ARRAY";
+ ARRAY
+-----------------------------------------------
+ {1.15,1.15,1.18,1.21,1.24,1.26,1.26,1.3,1.32}
+(1 row)
+
+-- with nulls
+SELECT '{1,null,3}'::int[];
+ int4
+------------
+ {1,NULL,3}
+(1 row)
+
+SELECT ARRAY[1,NULL,3];
+ array
+------------
+ {1,NULL,3}
+(1 row)
+
+-- functions
+SELECT array_append(array[42], 6) AS "{42,6}";
+ {42,6}
+--------
+ {42,6}
+(1 row)
+
+SELECT array_prepend(6, array[42]) AS "{6,42}";
+ {6,42}
+--------
+ {6,42}
+(1 row)
+
+SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}";
+ {1,2,3,4}
+-----------
+ {1,2,3,4}
+(1 row)
+
+SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}";
+ {{1,2},{3,4},{5,6}}
+---------------------
+ {{1,2},{3,4},{5,6}}
+(1 row)
+
+SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}";
+ {{3,4},{5,6},{1,2}}
+---------------------
+ {{3,4},{5,6},{1,2}}
+(1 row)
+
+SELECT array_position(ARRAY[1,2,3,4,5], 4);
+ array_position
+----------------
+ 4
+(1 row)
+
+SELECT array_position(ARRAY[5,3,4,2,1], 4);
+ array_position
+----------------
+ 3
+(1 row)
+
+SELECT array_position(ARRAY[[1,2],[3,4]], 3);
+ERROR: searching for elements in multidimensional arrays is not supported
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon');
+ array_position
+----------------
+ 2
+(1 row)
+
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat');
+ array_position
+----------------
+ 7
+(1 row)
+
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL);
+ array_position
+----------------
+
+(1 row)
+
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL);
+ array_position
+----------------
+ 6
+(1 row)
+
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat');
+ array_position
+----------------
+ 8
+(1 row)
+
+SELECT array_positions(NULL, 10);
+ array_positions
+-----------------
+
+(1 row)
+
+SELECT array_positions(NULL, NULL::int);
+ array_positions
+-----------------
+
+(1 row)
+
+SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4);
+ array_positions
+-----------------
+ {4,10}
+(1 row)
+
+SELECT array_positions(ARRAY[[1,2],[3,4]], 4);
+ERROR: searching for elements in multidimensional arrays is not supported
+SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL);
+ array_positions
+-----------------
+ {}
+(1 row)
+
+SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL);
+ array_positions
+-----------------
+ {4,10}
+(1 row)
+
+SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10
+ FROM generate_series(1,100) g(i)),
+ 'AAAAAAAAAAAAAAAAAAAAAAAAA5'), 1);
+ array_length
+--------------
+ 10
+(1 row)
+
+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;
+NOTICE: 2
+NOTICE: 4
+NOTICE: 7
+SELECT array_position('[2:4]={1,2,3}'::int[], 1);
+ array_position
+----------------
+ 2
+(1 row)
+
+SELECT array_positions('[2:4]={1,2,3}'::int[], 1);
+ array_positions
+-----------------
+ {2}
+(1 row)
+
+SELECT
+ array_position(ids, (1, 1)),
+ array_positions(ids, (1, 1))
+ FROM
+(VALUES
+ (ARRAY[(0, 0), (1, 1)]),
+ (ARRAY[(1, 1)])
+) AS f (ids);
+ array_position | array_positions
+----------------+-----------------
+ 2 | {2}
+ 1 | {1}
+(2 rows)
+
+-- operators
+SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]];
+ a
+---------------
+ {16,25,3,4,5}
+(1 row)
+
+SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE";
+ FALSE
+-------
+ f
+(1 row)
+
+SELECT ARRAY[1,2] || 3 AS "{1,2,3}";
+ {1,2,3}
+---------
+ {1,2,3}
+(1 row)
+
+SELECT 0 || ARRAY[1,2] AS "{0,1,2}";
+ {0,1,2}
+---------
+ {0,1,2}
+(1 row)
+
+SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}";
+ {1,2,3,4}
+-----------
+ {1,2,3,4}
+(1 row)
+
+SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY";
+ ARRAY
+--------------------------------------
+ {{{hello,world}},{{happy,birthday}}}
+(1 row)
+
+SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}";
+ {{1,2},{3,4},{5,6}}
+---------------------
+ {{1,2},{3,4},{5,6}}
+(1 row)
+
+SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}";
+ {0,0,1,1,2,2}
+---------------
+ {0,0,1,1,2,2}
+(1 row)
+
+SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}";
+ {0,1,2,3}
+-----------
+ {0,1,2,3}
+(1 row)
+
+SELECT ARRAY[1.1] || ARRAY[2,3,4];
+ ?column?
+-------------
+ {1.1,2,3,4}
+(1 row)
+
+SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x);
+ ?column?
+-----------------------------------
+ {"(1,2)","(3,4)","(1,2)","(3,4)"}
+(1 row)
+
+SELECT ROW(1,2) || array_agg(x) FROM (VALUES (ROW(3,4)), (ROW(5,6))) v(x);
+ ?column?
+---------------------------
+ {"(1,2)","(3,4)","(5,6)"}
+(1 row)
+
+SELECT * FROM array_op_test WHERE i @> '{32}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
+(6 rows)
+
+SELECT * FROM array_op_test WHERE i && '{32}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
+(6 rows)
+
+SELECT * FROM array_op_test WHERE i @> '{17}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 12 | {17,99,18,52,91,72,0,43,96,23} | {AAAAA33250,AAAAAAAAAAAAAAAAAAA85420,AAAAAAAAAAA33576}
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 19 | {52,82,17,74,23,46,69,51,75} | {AAAAAAAAAAAAA73084,AAAAA75968,AAAAAAAAAAAAAAAA14047,AAAAAAA80240,AAAAAAAAAAAAAAAAAAA1205,A68938}
+ 53 | {38,17} | {AAAAAAAAAAA21658}
+ 65 | {61,5,76,59,17} | {AAAAAA99807,AAAAA64741,AAAAAAAAAAA53908,AA21643,AAAAAAAAA10012}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+(8 rows)
+
+SELECT * FROM array_op_test WHERE i && '{17}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 12 | {17,99,18,52,91,72,0,43,96,23} | {AAAAA33250,AAAAAAAAAAAAAAAAAAA85420,AAAAAAAAAAA33576}
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 19 | {52,82,17,74,23,46,69,51,75} | {AAAAAAAAAAAAA73084,AAAAA75968,AAAAAAAAAAAAAAAA14047,AAAAAAA80240,AAAAAAAAAAAAAAAAAAA1205,A68938}
+ 53 | {38,17} | {AAAAAAAAAAA21658}
+ 65 | {61,5,76,59,17} | {AAAAAA99807,AAAAA64741,AAAAAAAAAAA53908,AA21643,AAAAAAAAA10012}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+(8 rows)
+
+SELECT * FROM array_op_test WHERE i @> '{32,17}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+(3 rows)
+
+SELECT * FROM array_op_test WHERE i && '{32,17}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+------------------------------------------------------------------------------------------------------------------------------------
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 12 | {17,99,18,52,91,72,0,43,96,23} | {AAAAA33250,AAAAAAAAAAAAAAAAAAA85420,AAAAAAAAAAA33576}
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 19 | {52,82,17,74,23,46,69,51,75} | {AAAAAAAAAAAAA73084,AAAAA75968,AAAAAAAAAAAAAAAA14047,AAAAAAA80240,AAAAAAAAAAAAAAAAAAA1205,A68938}
+ 53 | {38,17} | {AAAAAAAAAAA21658}
+ 65 | {61,5,76,59,17} | {AAAAAA99807,AAAAA64741,AAAAAAAAAAA53908,AA21643,AAAAAAAAA10012}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
+(11 rows)
+
+SELECT * FROM array_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------+----------------------------------------------------------------------------------------------------------------------------
+ 40 | {34} | {AAAAAAAAAAAAAA10611,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAA31334,AAAAA70466,AAAAAAAA81587,AAAAAAA74623}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 101 | {} | {}
+(4 rows)
+
+SELECT * FROM array_op_test WHERE i = '{}' ORDER BY seqno;
+ seqno | i | t
+-------+----+----
+ 101 | {} | {}
+(1 row)
+
+SELECT * FROM array_op_test WHERE i @> '{}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 1 | {92,75,71,52,64,83} | {AAAAAAAA44066,AAAAAA1059,AAAAAAAAAAA176,AAAAAAA48038}
+ 2 | {3,6} | {AAAAAA98232,AAAAAAAA79710,AAAAAAAAAAAAAAAAA69675,AAAAAAAAAAAAAAAA55798,AAAAAAAAA12793}
+ 3 | {37,64,95,43,3,41,13,30,11,43} | {AAAAAAAAAA48845,AAAAA75968,AAAAA95309,AAA54451,AAAAAAAAAA22292,AAAAAAA99836,A96617,AA17009,AAAAAAAAAAAAAA95246}
+ 4 | {71,39,99,55,33,75,45} | {AAAAAAAAA53663,AAAAAAAAAAAAAAA67062,AAAAAAAAAA64777,AAA99043,AAAAAAAAAAAAAAAAAAA91804,39557}
+ 5 | {50,42,77,50,4} | {AAAAAAAAAAAAAAAAA26540,AAAAAAA79710,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA176,AAAAA95309,AAAAAAAAAAA46154,AAAAAA66777,AAAAAAAAA27249,AAAAAAAAAA64777,AAAAAAAAAAAAAAAAAAA70104}
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 7 | {12,51,88,64,8} | {AAAAAAAAAAAAAAAAAA12591,AAAAAAAAAAAAAAAAA50407,AAAAAAAAAAAA67946}
+ 8 | {60,84} | {AAAAAAA81898,AAAAAA1059,AAAAAAAAAAAA81511,AAAAA961,AAAAAAAAAAAAAAAA31334,AAAAA64741,AA6416,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAAAA50407}
+ 9 | {56,52,35,27,80,44,81,22} | {AAAAAAAAAAAAAAA73034,AAAAAAAAAAAAA7929,AAAAAAA66161,AA88409,39557,A27153,AAAAAAAA9523,AAAAAAAAAAA99000}
+ 10 | {71,5,45} | {AAAAAAAAAAA21658,AAAAAAAAAAAA21089,AAA54451,AAAAAAAAAAAAAAAAAA54141,AAAAAAAAAAAAAA28620,AAAAAAAAAAA21658,AAAAAAAAAAA74076,AAAAAAAAA27249}
+ 11 | {41,86,74,48,22,74,47,50} | {AAAAAAAA9523,AAAAAAAAAAAA37562,AAAAAAAAAAAAAAAA14047,AAAAAAAAAAA46154,AAAA41702,AAAAAAAAAAAAAAAAA764,AAAAA62737,39557}
+ 12 | {17,99,18,52,91,72,0,43,96,23} | {AAAAA33250,AAAAAAAAAAAAAAAAAAA85420,AAAAAAAAAAA33576}
+ 13 | {3,52,34,23} | {AAAAAA98232,AAAA49534,AAAAAAAAAAA21658}
+ 14 | {78,57,19} | {AAAA8857,AAAAAAAAAAAAAAA73034,AAAAAAAA81587,AAAAAAAAAAAAAAA68526,AAAAA75968,AAAAAAAAAAAAAA65909,AAAAAAAAA10012,AAAAAAAAAAAAAA65909}
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 16 | {14,63,85,11} | {AAAAAA66777}
+ 17 | {7,10,81,85} | {AAAAAA43678,AAAAAAA12144,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAAAAA15356}
+ 18 | {1} | {AAAAAAAAAAA33576,AAAAA95309,64261,AAA59323,AAAAAAAAAAAAAA95246,55847,AAAAAAAAAAAA67946,AAAAAAAAAAAAAAAAAA64374}
+ 19 | {52,82,17,74,23,46,69,51,75} | {AAAAAAAAAAAAA73084,AAAAA75968,AAAAAAAAAAAAAAAA14047,AAAAAAA80240,AAAAAAAAAAAAAAAAAAA1205,A68938}
+ 20 | {72,89,70,51,54,37,8,49,79} | {AAAAAA58494}
+ 21 | {2,8,65,10,5,79,43} | {AAAAAAAAAAAAAAAAA88852,AAAAAAAAAAAAAAAAAAA91804,AAAAA64669,AAAAAAAAAAAAAAAA1443,AAAAAAAAAAAAAAAA23657,AAAAA12179,AAAAAAAAAAAAAAAAA88852,AAAAAAAAAAAAAAAA31334,AAAAAAAAAAAAAAAA41303,AAAAAAAAAAAAAAAAAAA85420}
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 23 | {40,90,5,38,72,40,30,10,43,55} | {A6053,AAAAAAAAAAA6119,AA44673,AAAAAAAAAAAAAAAAA764,AA17009,AAAAA17383,AAAAA70514,AAAAA33250,AAAAA95309,AAAAAAAAAAAA37562}
+ 24 | {94,61,99,35,48} | {AAAAAAAAAAA50956,AAAAAAAAAAA15165,AAAA85070,AAAAAAAAAAAAAAA36627,AAAAA961,AAAAAAAAAA55219}
+ 25 | {31,1,10,11,27,79,38} | {AAAAAAAAAAAAAAAAAA59334,45449}
+ 26 | {71,10,9,69,75} | {47735,AAAAAAA21462,AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAAAAA91804,AAAAAAAAA72121,AAAAAAAAAAAAAAAAAAA1205,AAAAA41597,AAAA8857,AAAAAAAAAAAAAAAAAAA15356,AA17009}
+ 27 | {94} | {AA6416,A6053,AAAAAAA21462,AAAAAAA57334,AAAAAAAAAAAAAAAAAA12591,AA88409,AAAAAAAAAAAAA70254}
+ 28 | {14,33,6,34,14} | {AAAAAAAAAAAAAAA13198,AAAAAAAA69452,AAAAAAAAAAA82945,AAAAAAA12144,AAAAAAAAA72121,AAAAAAAAAA18601}
+ 29 | {39,21} | {AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAAAAA38885,AAAA85070,AAAAAAAAAAAAAAAAAAA70104,AAAAA66674,AAAAAAAAAAAAA62007,AAAAAAAA69452,AAAAAAA1242,AAAAAAAAAAAAAAAA1729,AAAA35194}
+ 30 | {26,81,47,91,34} | {AAAAAAAAAAAAAAAAAAA70104,AAAAAAA80240}
+ 31 | {80,24,18,21,54} | {AAAAAAAAAAAAAAA13198,AAAAAAAAAAAAAAAAAAA70415,A27153,AAAAAAAAA53663,AAAAAAAAAAAAAAAAA50407,A68938}
+ 32 | {58,79,82,80,67,75,98,10,41} | {AAAAAAAAAAAAAAAAAA61286,AAA54451,AAAAAAAAAAAAAAAAAAA87527,A96617,51533}
+ 33 | {74,73} | {A85417,AAAAAAA56483,AAAAA17383,AAAAAAAAAAAAA62159,AAAAAAAAAAAA52814,AAAAAAAAAAAAA85723,AAAAAAAAAAAAAAAAAA55796}
+ 34 | {70,45} | {AAAAAAAAAAAAAAAAAA71621,AAAAAAAAAAAAAA28620,AAAAAAAAAA55219,AAAAAAAA23648,AAAAAAAAAA22292,AAAAAAA1242}
+ 35 | {23,40} | {AAAAAAAAAAAA52814,AAAA48949,AAAAAAAAA34727,AAAA8857,AAAAAAAAAAAAAAAAAAA62179,AAAAAAAAAAAAAAA68526,AAAAAAA99836,AAAAAAAA50094,AAAA91194,AAAAAAAAAAAAA73084}
+ 36 | {79,82,14,52,30,5,79} | {AAAAAAAAA53663,AAAAAAAAAAAAAAAA55798,AAAAAAAAAAAAAAAAAAA89194,AA88409,AAAAAAAAAAAAAAA81326,AAAAAAAAAAAAAAAAA63050,AAAAAAAAAAAAAAAA33598}
+ 37 | {53,11,81,39,3,78,58,64,74} | {AAAAAAAAAAAAAAAAAAA17075,AAAAAAA66161,AAAAAAAA23648,AAAAAAAAAAAAAA10611}
+ 38 | {59,5,4,95,28} | {AAAAAAAAAAA82945,A96617,47735,AAAAA12179,AAAAA64669,AAAAAA99807,AA74433,AAAAAAAAAAAAAAAAA59387}
+ 39 | {82,43,99,16,74} | {AAAAAAAAAAAAAAA67062,AAAAAAA57334,AAAAAAAAAAAAAA65909,A27153,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAA64777,AAAAAAAAAAAA81511,AAAAAAAAAAAAAA65909,AAAAAAAAAAAAAA28620}
+ 40 | {34} | {AAAAAAAAAAAAAA10611,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAA31334,AAAAA70466,AAAAAAAA81587,AAAAAAA74623}
+ 41 | {19,26,63,12,93,73,27,94} | {AAAAAAA79710,AAAAAAAAAA55219,AAAA41702,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAAA71621,AAAAAAAAAAAAAAAAA63050,AAAAAAA99836,AAAAAAAAAAAAAA8666}
+ 42 | {15,76,82,75,8,91} | {AAAAAAAAAAA176,AAAAAA38063,45449,AAAAAA54032,AAAAAAA81898,AA6416,AAAAAAAAAAAAAAAAAAA62179,45449,AAAAA60038,AAAAAAAA81587}
+ 43 | {39,87,91,97,79,28} | {AAAAAAAAAAA74076,A96617,AAAAAAAAAAAAAAAAAAA89194,AAAAAAAAAAAAAAAAAA55796,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAA67946}
+ 44 | {40,58,68,29,54} | {AAAAAAA81898,AAAAAA66777,AAAAAA98232}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 46 | {53,24} | {AAAAAAAAAAA53908,AAAAAA54032,AAAAA17383,AAAA48949,AAAAAAAAAA18601,AAAAA64669,45449,AAAAAAAAAAA98051,AAAAAAAAAAAAAAAAAA71621}
+ 47 | {98,23,64,12,75,61} | {AAA59323,AAAAA95309,AAAAAAAAAAAAAAAA31334,AAAAAAAAA27249,AAAAA17383,AAAAAAAAAAAA37562,AAAAAA1059,A84822,55847,AAAAA70466}
+ 48 | {76,14} | {AAAAAAAAAAAAA59671,AAAAAAAAAAAAAAAAAAA91804,AAAAAA66777,AAAAAAAAAAAAAAAAAAA89194,AAAAAAAAAAAAAAA36627,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAA73084,AAAAAAA79710,AAAAAAAAAAAAAAA40402,AAAAAAAAAAAAAAAAAAA65037}
+ 49 | {56,5,54,37,49} | {AA21643,AAAAAAAAAAA92631,AAAAAAAA81587}
+ 50 | {20,12,37,64,93} | {AAAAAAAAAA5483,AAAAAAAAAAAAAAAAAAA1205,AA6416,AAAAAAAAAAAAAAAAA63050,AAAAAAAAAAAAAAAAAA47955}
+ 51 | {47} | {AAAAAAAAAAAAAA96505,AAAAAAAAAAAAAAAAAA36842,AAAAA95309,AAAAAAAA81587,AA6416,AAAA91194,AAAAAA58494,AAAAAA1059,AAAAAAAA69452}
+ 52 | {89,0} | {AAAAAAAAAAAAAAAAAA47955,AAAAAAA48038,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAAAAA73084,AAAAA70466,AAAAAAAAAAAAAAAAA764,AAAAAAAAAAA46154,AA66862}
+ 53 | {38,17} | {AAAAAAAAAAA21658}
+ 54 | {70,47} | {AAAAAAAAAAAAAAAAAA54141,AAAAA40681,AAAAAAA48038,AAAAAAAAAAAAAAAA29150,AAAAA41597,AAAAAAAAAAAAAAAAAA59334,AA15322}
+ 55 | {47,79,47,64,72,25,71,24,93} | {AAAAAAAAAAAAAAAAAA55796,AAAAA62737}
+ 56 | {33,7,60,54,93,90,77,85,39} | {AAAAAAAAAAAAAAAAAA32918,AA42406}
+ 57 | {23,45,10,42,36,21,9,96} | {AAAAAAAAAAAAAAAAAAA70415}
+ 58 | {92} | {AAAAAAAAAAAAAAAA98414,AAAAAAAA23648,AAAAAAAAAAAAAAAAAA55796,AA25381,AAAAAAAAAAA6119}
+ 59 | {9,69,46,77} | {39557,AAAAAAA89932,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAAAAAAAAA26540,AAA20874,AA6416,AAAAAAAAAAAAAAAAAA47955}
+ 60 | {62,2,59,38,89} | {AAAAAAA89932,AAAAAAAAAAAAAAAAAAA15356,AA99927,AA17009,AAAAAAAAAAAAAAA35875}
+ 61 | {72,2,44,95,54,54,13} | {AAAAAAAAAAAAAAAAAAA91804}
+ 62 | {83,72,29,73} | {AAAAAAAAAAAAA15097,AAAA8857,AAAAAAAAAAAA35809,AAAAAAAAAAAA52814,AAAAAAAAAAAAAAAAAAA38885,AAAAAAAAAAAAAAAAAA24183,AAAAAA43678,A96617}
+ 63 | {11,4,61,87} | {AAAAAAAAA27249,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAA13198,AAA20874,39557,51533,AAAAAAAAAAA53908,AAAAAAAAAAAAAA96505,AAAAAAAA78938}
+ 64 | {26,19,34,24,81,78} | {A96617,AAAAAAAAAAAAAAAAAAA70104,A68938,AAAAAAAAAAA53908,AAAAAAAAAAAAAAA453,AA17009,AAAAAAA80240}
+ 65 | {61,5,76,59,17} | {AAAAAA99807,AAAAA64741,AAAAAAAAAAA53908,AA21643,AAAAAAAAA10012}
+ 66 | {31,23,70,52,4,33,48,25} | {AAAAAAAAAAAAAAAAA69675,AAAAAAAA50094,AAAAAAAAAAA92631,AAAA35194,39557,AAAAAAA99836}
+ 67 | {31,94,7,10} | {AAAAAA38063,A96617,AAAA35194,AAAAAAAAAAAA67946}
+ 68 | {90,43,38} | {AA75092,AAAAAAAAAAAAAAAAA69675,AAAAAAAAAAA92631,AAAAAAAAA10012,AAAAAAAAAAAAA7929,AA21643}
+ 69 | {67,35,99,85,72,86,44} | {AAAAAAAAAAAAAAAAAAA1205,AAAAAAAA50094,AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAAAAAAA47955}
+ 70 | {56,70,83} | {AAAA41702,AAAAAAAAAAA82945,AA21643,AAAAAAAAAAA99000,A27153,AA25381,AAAAAAAAAAAAAA96505,AAAAAAA1242}
+ 71 | {74,26} | {AAAAAAAAAAA50956,AA74433,AAAAAAA21462,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAA36627,AAAAAAAAAAAAA70254,AAAAAAAAAA43419,39557}
+ 72 | {22,1,16,78,20,91,83} | {47735,AAAAAAA56483,AAAAAAAAAAAAA93788,AA42406,AAAAAAAAAAAAA73084,AAAAAAAA72908,AAAAAAAAAAAAAAAAAA61286,AAAAA66674,AAAAAAAAAAAAAAAAA50407}
+ 73 | {88,25,96,78,65,15,29,19} | {AAA54451,AAAAAAAAA27249,AAAAAAA9228,AAAAAAAAAAAAAAA67062,AAAAAAAAAAAAAAAAAAA70415,AAAAA17383,AAAAAAAAAAAAAAAA33598}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 75 | {12,96,83,24,71,89,55} | {AAAA48949,AAAAAAAA29716,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAAA67946,AAAAAAAAAAAAAAAA29150,AAA28075,AAAAAAAAAAAAAAAAA43052}
+ 76 | {92,55,10,7} | {AAAAAAAAAAAAAAA67062}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 78 | {55,89,44,84,34} | {AAAAAAAAAAA6119,AAAAAAAAAAAAAA8666,AA99927,AA42406,AAAAAAA81898,AAAAAAA9228,AAAAAAAAAAA92631,AA21643,AAAAAAAAAAAAAA28620}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+ 80 | {74,89,44,80,0} | {AAAA35194,AAAAAAAA79710,AAA20874,AAAAAAAAAAAAAAAAAAA70104,AAAAAAAAAAAAA73084,AAAAAAA57334,AAAAAAA9228,AAAAAAAAAAAAA62007}
+ 81 | {63,77,54,48,61,53,97} | {AAAAAAAAAAAAAAA81326,AAAAAAAAAA22292,AA25381,AAAAAAAAAAA74076,AAAAAAA81898,AAAAAAAAA72121}
+ 82 | {34,60,4,79,78,16,86,89,42,50} | {AAAAA40681,AAAAAAAAAAAAAAAAAA12591,AAAAAAA80240,AAAAAAAAAAAAAAAA55798,AAAAAAAAAAAAAAAAAAA70104}
+ 83 | {14,10} | {AAAAAAAAAA22292,AAAAAAAAAAAAA70254,AAAAAAAAAAA6119}
+ 84 | {11,83,35,13,96,94} | {AAAAA95309,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAAAAA24183}
+ 85 | {39,60} | {AAAAAAAAAAAAAAAA55798,AAAAAAAAAA22292,AAAAAAA66161,AAAAAAA21462,AAAAAAAAAAAAAAAAAA12591,55847,AAAAAA98232,AAAAAAAAAAA46154}
+ 86 | {33,81,72,74,45,36,82} | {AAAAAAAA81587,AAAAAAAAAAAAAA96505,45449,AAAA80176}
+ 87 | {57,27,50,12,97,68} | {AAAAAAAAAAAAAAAAA26540,AAAAAAAAA10012,AAAAAAAAAAAA35809,AAAAAAAAAAAAAAAA29150,AAAAAAAAAAA82945,AAAAAA66777,31228,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAA96505}
+ 88 | {41,90,77,24,6,24} | {AAAA35194,AAAA35194,AAAAAAA80240,AAAAAAAAAAA46154,AAAAAA58494,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAAA59334,AAAAAAAAAAAAAAAAAAA91804,AA74433}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+ 90 | {88,75} | {AAAAA60038,AAAAAAAA23648,AAAAAAAAAAA99000,AAAA41702,AAAAAAAAAAAAA22860,AAAAAAAAAAAAAAA68526}
+ 91 | {78} | {AAAAAAAAAAAAA62007,AAA99043}
+ 92 | {85,63,49,45} | {AAAAAAA89932,AAAAAAAAAAAAA22860,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAAA21089}
+ 93 | {11} | {AAAAAAAAAAA176,AAAAAAAAAAAAAA8666,AAAAAAAAAAAAAAA453,AAAAAAAAAAAAA85723,A68938,AAAAAAAAAAAAA9821,AAAAAAA48038,AAAAAAAAAAAAAAAAA59387,AA99927,AAAAA17383}
+ 94 | {98,9,85,62,88,91,60,61,38,86} | {AAAAAAAA81587,AAAAA17383,AAAAAAAA81587}
+ 95 | {47,77} | {AAAAAAAAAAAAAAAAA764,AAAAAAAAAAA74076,AAAAAAAAAA18107,AAAAA40681,AAAAAAAAAAAAAAA35875,AAAAA60038,AAAAAAA56483}
+ 96 | {23,97,43} | {AAAAAAAAAA646,A87088}
+ 97 | {54,2,86,65} | {47735,AAAAAAA99836,AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAA29150,AAAAAAA80240,AAAAAAAAAAAAAAAA98414,AAAAAAA56483,AAAAAAAAAAAAAAAA29150,AAAAAAA39692,AA21643}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 99 | {37,86} | {AAAAAAAAAAAAAAAAAA32918,AAAAA70514,AAAAAAAAA10012,AAAAAAAAAAAAAAAAA59387,AAAAAAAAAA64777,AAAAAAAAAAAAAAAAAAA15356}
+ 100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
+ 101 | {} | {}
+ 102 | {NULL} | {NULL}
+(102 rows)
+
+SELECT * FROM array_op_test WHERE i && '{}' ORDER BY seqno;
+ seqno | i | t
+-------+---+---
+(0 rows)
+
+SELECT * FROM array_op_test WHERE i <@ '{}' ORDER BY seqno;
+ seqno | i | t
+-------+----+----
+ 101 | {} | {}
+(1 row)
+
+SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
+ seqno | i | t
+-------+--------+--------
+ 102 | {NULL} | {NULL}
+(1 row)
+
+SELECT * FROM array_op_test WHERE i @> '{NULL}' ORDER BY seqno;
+ seqno | i | t
+-------+---+---
+(0 rows)
+
+SELECT * FROM array_op_test WHERE i && '{NULL}' ORDER BY seqno;
+ seqno | i | t
+-------+---+---
+(0 rows)
+
+SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
+ seqno | i | t
+-------+----+----
+ 101 | {} | {}
+(1 row)
+
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
+ seqno | i | t
+-------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 72 | {22,1,16,78,20,91,83} | {47735,AAAAAAA56483,AAAAAAAAAAAAA93788,AA42406,AAAAAAAAAAAAA73084,AAAAAAAA72908,AAAAAAAAAAAAAAAAAA61286,AAAAA66674,AAAAAAAAAAAAAAAAA50407}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+(4 rows)
+
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno;
+ seqno | i | t
+-------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 72 | {22,1,16,78,20,91,83} | {47735,AAAAAAA56483,AAAAAAAAAAAAA93788,AA42406,AAAAAAAAAAAAA73084,AAAAAAAA72908,AAAAAAAAAAAAAAAAAA61286,AAAAA66674,AAAAAAAAAAAAAAAAA50407}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+(4 rows)
+
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
+ seqno | i | t
+-------+------------------+--------------------------------------------------------------------
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+ 96 | {23,97,43} | {AAAAAAAAAA646,A87088}
+(3 rows)
+
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno;
+ seqno | i | t
+-------+------------------+--------------------------------------------------------------------
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+ 96 | {23,97,43} | {AAAAAAAAAA646,A87088}
+(3 rows)
+
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+ seqno | i | t
+-------+------+--------------------------------------------------------------------
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+(1 row)
+
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+ seqno | i | t
+-------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 72 | {22,1,16,78,20,91,83} | {47735,AAAAAAA56483,AAAAAAAAAAAAA93788,AA42406,AAAAAAAAAAAAA73084,AAAAAAAA72908,AAAAAAAAAAAAAAAAAA61286,AAAAA66674,AAAAAAAAAAAAAAAAA50407}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+ 96 | {23,97,43} | {AAAAAAAAAA646,A87088}
+(6 rows)
+
+SELECT * FROM array_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+ seqno | i | t
+-------+--------------------+-----------------------------------------------------------------------------------------------------------
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 101 | {} | {}
+(3 rows)
+
+SELECT * FROM array_op_test WHERE t = '{}' ORDER BY seqno;
+ seqno | i | t
+-------+----+----
+ 101 | {} | {}
+(1 row)
+
+SELECT * FROM array_op_test WHERE t @> '{}' ORDER BY seqno;
+ seqno | i | t
+-------+---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 1 | {92,75,71,52,64,83} | {AAAAAAAA44066,AAAAAA1059,AAAAAAAAAAA176,AAAAAAA48038}
+ 2 | {3,6} | {AAAAAA98232,AAAAAAAA79710,AAAAAAAAAAAAAAAAA69675,AAAAAAAAAAAAAAAA55798,AAAAAAAAA12793}
+ 3 | {37,64,95,43,3,41,13,30,11,43} | {AAAAAAAAAA48845,AAAAA75968,AAAAA95309,AAA54451,AAAAAAAAAA22292,AAAAAAA99836,A96617,AA17009,AAAAAAAAAAAAAA95246}
+ 4 | {71,39,99,55,33,75,45} | {AAAAAAAAA53663,AAAAAAAAAAAAAAA67062,AAAAAAAAAA64777,AAA99043,AAAAAAAAAAAAAAAAAAA91804,39557}
+ 5 | {50,42,77,50,4} | {AAAAAAAAAAAAAAAAA26540,AAAAAAA79710,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA176,AAAAA95309,AAAAAAAAAAA46154,AAAAAA66777,AAAAAAAAA27249,AAAAAAAAAA64777,AAAAAAAAAAAAAAAAAAA70104}
+ 6 | {39,35,5,94,17,92,60,32} | {AAAAAAAAAAAAAAA35875,AAAAAAAAAAAAAAAA23657}
+ 7 | {12,51,88,64,8} | {AAAAAAAAAAAAAAAAAA12591,AAAAAAAAAAAAAAAAA50407,AAAAAAAAAAAA67946}
+ 8 | {60,84} | {AAAAAAA81898,AAAAAA1059,AAAAAAAAAAAA81511,AAAAA961,AAAAAAAAAAAAAAAA31334,AAAAA64741,AA6416,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAAAA50407}
+ 9 | {56,52,35,27,80,44,81,22} | {AAAAAAAAAAAAAAA73034,AAAAAAAAAAAAA7929,AAAAAAA66161,AA88409,39557,A27153,AAAAAAAA9523,AAAAAAAAAAA99000}
+ 10 | {71,5,45} | {AAAAAAAAAAA21658,AAAAAAAAAAAA21089,AAA54451,AAAAAAAAAAAAAAAAAA54141,AAAAAAAAAAAAAA28620,AAAAAAAAAAA21658,AAAAAAAAAAA74076,AAAAAAAAA27249}
+ 11 | {41,86,74,48,22,74,47,50} | {AAAAAAAA9523,AAAAAAAAAAAA37562,AAAAAAAAAAAAAAAA14047,AAAAAAAAAAA46154,AAAA41702,AAAAAAAAAAAAAAAAA764,AAAAA62737,39557}
+ 12 | {17,99,18,52,91,72,0,43,96,23} | {AAAAA33250,AAAAAAAAAAAAAAAAAAA85420,AAAAAAAAAAA33576}
+ 13 | {3,52,34,23} | {AAAAAA98232,AAAA49534,AAAAAAAAAAA21658}
+ 14 | {78,57,19} | {AAAA8857,AAAAAAAAAAAAAAA73034,AAAAAAAA81587,AAAAAAAAAAAAAAA68526,AAAAA75968,AAAAAAAAAAAAAA65909,AAAAAAAAA10012,AAAAAAAAAAAAAA65909}
+ 15 | {17,14,16,63,67} | {AA6416,AAAAAAAAAA646,AAAAA95309}
+ 16 | {14,63,85,11} | {AAAAAA66777}
+ 17 | {7,10,81,85} | {AAAAAA43678,AAAAAAA12144,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAAAAA15356}
+ 18 | {1} | {AAAAAAAAAAA33576,AAAAA95309,64261,AAA59323,AAAAAAAAAAAAAA95246,55847,AAAAAAAAAAAA67946,AAAAAAAAAAAAAAAAAA64374}
+ 19 | {52,82,17,74,23,46,69,51,75} | {AAAAAAAAAAAAA73084,AAAAA75968,AAAAAAAAAAAAAAAA14047,AAAAAAA80240,AAAAAAAAAAAAAAAAAAA1205,A68938}
+ 20 | {72,89,70,51,54,37,8,49,79} | {AAAAAA58494}
+ 21 | {2,8,65,10,5,79,43} | {AAAAAAAAAAAAAAAAA88852,AAAAAAAAAAAAAAAAAAA91804,AAAAA64669,AAAAAAAAAAAAAAAA1443,AAAAAAAAAAAAAAAA23657,AAAAA12179,AAAAAAAAAAAAAAAAA88852,AAAAAAAAAAAAAAAA31334,AAAAAAAAAAAAAAAA41303,AAAAAAAAAAAAAAAAAAA85420}
+ 22 | {11,6,56,62,53,30} | {AAAAAAAA72908}
+ 23 | {40,90,5,38,72,40,30,10,43,55} | {A6053,AAAAAAAAAAA6119,AA44673,AAAAAAAAAAAAAAAAA764,AA17009,AAAAA17383,AAAAA70514,AAAAA33250,AAAAA95309,AAAAAAAAAAAA37562}
+ 24 | {94,61,99,35,48} | {AAAAAAAAAAA50956,AAAAAAAAAAA15165,AAAA85070,AAAAAAAAAAAAAAA36627,AAAAA961,AAAAAAAAAA55219}
+ 25 | {31,1,10,11,27,79,38} | {AAAAAAAAAAAAAAAAAA59334,45449}
+ 26 | {71,10,9,69,75} | {47735,AAAAAAA21462,AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAAAAA91804,AAAAAAAAA72121,AAAAAAAAAAAAAAAAAAA1205,AAAAA41597,AAAA8857,AAAAAAAAAAAAAAAAAAA15356,AA17009}
+ 27 | {94} | {AA6416,A6053,AAAAAAA21462,AAAAAAA57334,AAAAAAAAAAAAAAAAAA12591,AA88409,AAAAAAAAAAAAA70254}
+ 28 | {14,33,6,34,14} | {AAAAAAAAAAAAAAA13198,AAAAAAAA69452,AAAAAAAAAAA82945,AAAAAAA12144,AAAAAAAAA72121,AAAAAAAAAA18601}
+ 29 | {39,21} | {AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAAAAA38885,AAAA85070,AAAAAAAAAAAAAAAAAAA70104,AAAAA66674,AAAAAAAAAAAAA62007,AAAAAAAA69452,AAAAAAA1242,AAAAAAAAAAAAAAAA1729,AAAA35194}
+ 30 | {26,81,47,91,34} | {AAAAAAAAAAAAAAAAAAA70104,AAAAAAA80240}
+ 31 | {80,24,18,21,54} | {AAAAAAAAAAAAAAA13198,AAAAAAAAAAAAAAAAAAA70415,A27153,AAAAAAAAA53663,AAAAAAAAAAAAAAAAA50407,A68938}
+ 32 | {58,79,82,80,67,75,98,10,41} | {AAAAAAAAAAAAAAAAAA61286,AAA54451,AAAAAAAAAAAAAAAAAAA87527,A96617,51533}
+ 33 | {74,73} | {A85417,AAAAAAA56483,AAAAA17383,AAAAAAAAAAAAA62159,AAAAAAAAAAAA52814,AAAAAAAAAAAAA85723,AAAAAAAAAAAAAAAAAA55796}
+ 34 | {70,45} | {AAAAAAAAAAAAAAAAAA71621,AAAAAAAAAAAAAA28620,AAAAAAAAAA55219,AAAAAAAA23648,AAAAAAAAAA22292,AAAAAAA1242}
+ 35 | {23,40} | {AAAAAAAAAAAA52814,AAAA48949,AAAAAAAAA34727,AAAA8857,AAAAAAAAAAAAAAAAAAA62179,AAAAAAAAAAAAAAA68526,AAAAAAA99836,AAAAAAAA50094,AAAA91194,AAAAAAAAAAAAA73084}
+ 36 | {79,82,14,52,30,5,79} | {AAAAAAAAA53663,AAAAAAAAAAAAAAAA55798,AAAAAAAAAAAAAAAAAAA89194,AA88409,AAAAAAAAAAAAAAA81326,AAAAAAAAAAAAAAAAA63050,AAAAAAAAAAAAAAAA33598}
+ 37 | {53,11,81,39,3,78,58,64,74} | {AAAAAAAAAAAAAAAAAAA17075,AAAAAAA66161,AAAAAAAA23648,AAAAAAAAAAAAAA10611}
+ 38 | {59,5,4,95,28} | {AAAAAAAAAAA82945,A96617,47735,AAAAA12179,AAAAA64669,AAAAAA99807,AA74433,AAAAAAAAAAAAAAAAA59387}
+ 39 | {82,43,99,16,74} | {AAAAAAAAAAAAAAA67062,AAAAAAA57334,AAAAAAAAAAAAAA65909,A27153,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAA64777,AAAAAAAAAAAA81511,AAAAAAAAAAAAAA65909,AAAAAAAAAAAAAA28620}
+ 40 | {34} | {AAAAAAAAAAAAAA10611,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAA50956,AAAAAAAAAAAAAAAA31334,AAAAA70466,AAAAAAAA81587,AAAAAAA74623}
+ 41 | {19,26,63,12,93,73,27,94} | {AAAAAAA79710,AAAAAAAAAA55219,AAAA41702,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAAA71621,AAAAAAAAAAAAAAAAA63050,AAAAAAA99836,AAAAAAAAAAAAAA8666}
+ 42 | {15,76,82,75,8,91} | {AAAAAAAAAAA176,AAAAAA38063,45449,AAAAAA54032,AAAAAAA81898,AA6416,AAAAAAAAAAAAAAAAAAA62179,45449,AAAAA60038,AAAAAAAA81587}
+ 43 | {39,87,91,97,79,28} | {AAAAAAAAAAA74076,A96617,AAAAAAAAAAAAAAAAAAA89194,AAAAAAAAAAAAAAAAAA55796,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAA67946}
+ 44 | {40,58,68,29,54} | {AAAAAAA81898,AAAAAA66777,AAAAAA98232}
+ 45 | {99,45} | {AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}
+ 46 | {53,24} | {AAAAAAAAAAA53908,AAAAAA54032,AAAAA17383,AAAA48949,AAAAAAAAAA18601,AAAAA64669,45449,AAAAAAAAAAA98051,AAAAAAAAAAAAAAAAAA71621}
+ 47 | {98,23,64,12,75,61} | {AAA59323,AAAAA95309,AAAAAAAAAAAAAAAA31334,AAAAAAAAA27249,AAAAA17383,AAAAAAAAAAAA37562,AAAAAA1059,A84822,55847,AAAAA70466}
+ 48 | {76,14} | {AAAAAAAAAAAAA59671,AAAAAAAAAAAAAAAAAAA91804,AAAAAA66777,AAAAAAAAAAAAAAAAAAA89194,AAAAAAAAAAAAAAA36627,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAA73084,AAAAAAA79710,AAAAAAAAAAAAAAA40402,AAAAAAAAAAAAAAAAAAA65037}
+ 49 | {56,5,54,37,49} | {AA21643,AAAAAAAAAAA92631,AAAAAAAA81587}
+ 50 | {20,12,37,64,93} | {AAAAAAAAAA5483,AAAAAAAAAAAAAAAAAAA1205,AA6416,AAAAAAAAAAAAAAAAA63050,AAAAAAAAAAAAAAAAAA47955}
+ 51 | {47} | {AAAAAAAAAAAAAA96505,AAAAAAAAAAAAAAAAAA36842,AAAAA95309,AAAAAAAA81587,AA6416,AAAA91194,AAAAAA58494,AAAAAA1059,AAAAAAAA69452}
+ 52 | {89,0} | {AAAAAAAAAAAAAAAAAA47955,AAAAAAA48038,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAAAAA73084,AAAAA70466,AAAAAAAAAAAAAAAAA764,AAAAAAAAAAA46154,AA66862}
+ 53 | {38,17} | {AAAAAAAAAAA21658}
+ 54 | {70,47} | {AAAAAAAAAAAAAAAAAA54141,AAAAA40681,AAAAAAA48038,AAAAAAAAAAAAAAAA29150,AAAAA41597,AAAAAAAAAAAAAAAAAA59334,AA15322}
+ 55 | {47,79,47,64,72,25,71,24,93} | {AAAAAAAAAAAAAAAAAA55796,AAAAA62737}
+ 56 | {33,7,60,54,93,90,77,85,39} | {AAAAAAAAAAAAAAAAAA32918,AA42406}
+ 57 | {23,45,10,42,36,21,9,96} | {AAAAAAAAAAAAAAAAAAA70415}
+ 58 | {92} | {AAAAAAAAAAAAAAAA98414,AAAAAAAA23648,AAAAAAAAAAAAAAAAAA55796,AA25381,AAAAAAAAAAA6119}
+ 59 | {9,69,46,77} | {39557,AAAAAAA89932,AAAAAAAAAAAAAAAAA43052,AAAAAAAAAAAAAAAAA26540,AAA20874,AA6416,AAAAAAAAAAAAAAAAAA47955}
+ 60 | {62,2,59,38,89} | {AAAAAAA89932,AAAAAAAAAAAAAAAAAAA15356,AA99927,AA17009,AAAAAAAAAAAAAAA35875}
+ 61 | {72,2,44,95,54,54,13} | {AAAAAAAAAAAAAAAAAAA91804}
+ 62 | {83,72,29,73} | {AAAAAAAAAAAAA15097,AAAA8857,AAAAAAAAAAAA35809,AAAAAAAAAAAA52814,AAAAAAAAAAAAAAAAAAA38885,AAAAAAAAAAAAAAAAAA24183,AAAAAA43678,A96617}
+ 63 | {11,4,61,87} | {AAAAAAAAA27249,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAA13198,AAA20874,39557,51533,AAAAAAAAAAA53908,AAAAAAAAAAAAAA96505,AAAAAAAA78938}
+ 64 | {26,19,34,24,81,78} | {A96617,AAAAAAAAAAAAAAAAAAA70104,A68938,AAAAAAAAAAA53908,AAAAAAAAAAAAAAA453,AA17009,AAAAAAA80240}
+ 65 | {61,5,76,59,17} | {AAAAAA99807,AAAAA64741,AAAAAAAAAAA53908,AA21643,AAAAAAAAA10012}
+ 66 | {31,23,70,52,4,33,48,25} | {AAAAAAAAAAAAAAAAA69675,AAAAAAAA50094,AAAAAAAAAAA92631,AAAA35194,39557,AAAAAAA99836}
+ 67 | {31,94,7,10} | {AAAAAA38063,A96617,AAAA35194,AAAAAAAAAAAA67946}
+ 68 | {90,43,38} | {AA75092,AAAAAAAAAAAAAAAAA69675,AAAAAAAAAAA92631,AAAAAAAAA10012,AAAAAAAAAAAAA7929,AA21643}
+ 69 | {67,35,99,85,72,86,44} | {AAAAAAAAAAAAAAAAAAA1205,AAAAAAAA50094,AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAAAAAAA47955}
+ 70 | {56,70,83} | {AAAA41702,AAAAAAAAAAA82945,AA21643,AAAAAAAAAAA99000,A27153,AA25381,AAAAAAAAAAAAAA96505,AAAAAAA1242}
+ 71 | {74,26} | {AAAAAAAAAAA50956,AA74433,AAAAAAA21462,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAA36627,AAAAAAAAAAAAA70254,AAAAAAAAAA43419,39557}
+ 72 | {22,1,16,78,20,91,83} | {47735,AAAAAAA56483,AAAAAAAAAAAAA93788,AA42406,AAAAAAAAAAAAA73084,AAAAAAAA72908,AAAAAAAAAAAAAAAAAA61286,AAAAA66674,AAAAAAAAAAAAAAAAA50407}
+ 73 | {88,25,96,78,65,15,29,19} | {AAA54451,AAAAAAAAA27249,AAAAAAA9228,AAAAAAAAAAAAAAA67062,AAAAAAAAAAAAAAAAAAA70415,AAAAA17383,AAAAAAAAAAAAAAAA33598}
+ 74 | {32} | {AAAAAAAAAAAAAAAA1729,AAAAAAAAAAAAA22860,AAAAAA99807,AAAAA17383,AAAAAAAAAAAAAAA67062,AAAAAAAAAAA15165,AAAAAAAAAAA50956}
+ 75 | {12,96,83,24,71,89,55} | {AAAA48949,AAAAAAAA29716,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAAA67946,AAAAAAAAAAAAAAAA29150,AAA28075,AAAAAAAAAAAAAAAAA43052}
+ 76 | {92,55,10,7} | {AAAAAAAAAAAAAAA67062}
+ 77 | {97,15,32,17,55,59,18,37,50,39} | {AAAAAAAAAAAA67946,AAAAAA54032,AAAAAAAA81587,55847,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAAAAA43052,AAAAAA75463,AAAA49534,AAAAAAAA44066}
+ 78 | {55,89,44,84,34} | {AAAAAAAAAAA6119,AAAAAAAAAAAAAA8666,AA99927,AA42406,AAAAAAA81898,AAAAAAA9228,AAAAAAAAAAA92631,AA21643,AAAAAAAAAAAAAA28620}
+ 79 | {45} | {AAAAAAAAAA646,AAAAAAAAAAAAAAAAAAA70415,AAAAAA43678,AAAAAAAA72908}
+ 80 | {74,89,44,80,0} | {AAAA35194,AAAAAAAA79710,AAA20874,AAAAAAAAAAAAAAAAAAA70104,AAAAAAAAAAAAA73084,AAAAAAA57334,AAAAAAA9228,AAAAAAAAAAAAA62007}
+ 81 | {63,77,54,48,61,53,97} | {AAAAAAAAAAAAAAA81326,AAAAAAAAAA22292,AA25381,AAAAAAAAAAA74076,AAAAAAA81898,AAAAAAAAA72121}
+ 82 | {34,60,4,79,78,16,86,89,42,50} | {AAAAA40681,AAAAAAAAAAAAAAAAAA12591,AAAAAAA80240,AAAAAAAAAAAAAAAA55798,AAAAAAAAAAAAAAAAAAA70104}
+ 83 | {14,10} | {AAAAAAAAAA22292,AAAAAAAAAAAAA70254,AAAAAAAAAAA6119}
+ 84 | {11,83,35,13,96,94} | {AAAAA95309,AAAAAAAAAAAAAAAAAA32918,AAAAAAAAAAAAAAAAAA24183}
+ 85 | {39,60} | {AAAAAAAAAAAAAAAA55798,AAAAAAAAAA22292,AAAAAAA66161,AAAAAAA21462,AAAAAAAAAAAAAAAAAA12591,55847,AAAAAA98232,AAAAAAAAAAA46154}
+ 86 | {33,81,72,74,45,36,82} | {AAAAAAAA81587,AAAAAAAAAAAAAA96505,45449,AAAA80176}
+ 87 | {57,27,50,12,97,68} | {AAAAAAAAAAAAAAAAA26540,AAAAAAAAA10012,AAAAAAAAAAAA35809,AAAAAAAAAAAAAAAA29150,AAAAAAAAAAA82945,AAAAAA66777,31228,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAA28620,AAAAAAAAAAAAAA96505}
+ 88 | {41,90,77,24,6,24} | {AAAA35194,AAAA35194,AAAAAAA80240,AAAAAAAAAAA46154,AAAAAA58494,AAAAAAAAAAAAAAAAAAA17075,AAAAAAAAAAAAAAAAAA59334,AAAAAAAAAAAAAAAAAAA91804,AA74433}
+ 89 | {40,32,17,6,30,88} | {AA44673,AAAAAAAAAAA6119,AAAAAAAAAAAAAAAA23657,AAAAAAAAAAAAAAAAAA47955,AAAAAAAAAAAAAAAA33598,AAAAAAAAAAA33576,AA44673}
+ 90 | {88,75} | {AAAAA60038,AAAAAAAA23648,AAAAAAAAAAA99000,AAAA41702,AAAAAAAAAAAAA22860,AAAAAAAAAAAAAAA68526}
+ 91 | {78} | {AAAAAAAAAAAAA62007,AAA99043}
+ 92 | {85,63,49,45} | {AAAAAAA89932,AAAAAAAAAAAAA22860,AAAAAAAAAAAAAAAAAAA1205,AAAAAAAAAAAA21089}
+ 93 | {11} | {AAAAAAAAAAA176,AAAAAAAAAAAAAA8666,AAAAAAAAAAAAAAA453,AAAAAAAAAAAAA85723,A68938,AAAAAAAAAAAAA9821,AAAAAAA48038,AAAAAAAAAAAAAAAAA59387,AA99927,AAAAA17383}
+ 94 | {98,9,85,62,88,91,60,61,38,86} | {AAAAAAAA81587,AAAAA17383,AAAAAAAA81587}
+ 95 | {47,77} | {AAAAAAAAAAAAAAAAA764,AAAAAAAAAAA74076,AAAAAAAAAA18107,AAAAA40681,AAAAAAAAAAAAAAA35875,AAAAA60038,AAAAAAA56483}
+ 96 | {23,97,43} | {AAAAAAAAAA646,A87088}
+ 97 | {54,2,86,65} | {47735,AAAAAAA99836,AAAAAAAAAAAAAAAAA6897,AAAAAAAAAAAAAAAA29150,AAAAAAA80240,AAAAAAAAAAAAAAAA98414,AAAAAAA56483,AAAAAAAAAAAAAAAA29150,AAAAAAA39692,AA21643}
+ 98 | {38,34,32,89} | {AAAAAAAAAAAAAAAAAA71621,AAAA8857,AAAAAAAAAAAAAAAAAAA65037,AAAAAAAAAAAAAAAA31334,AAAAAAAAAA48845}
+ 99 | {37,86} | {AAAAAAAAAAAAAAAAAA32918,AAAAA70514,AAAAAAAAA10012,AAAAAAAAAAAAAAAAA59387,AAAAAAAAAA64777,AAAAAAAAAAAAAAAAAAA15356}
+ 100 | {85,32,57,39,49,84,32,3,30} | {AAAAAAA80240,AAAAAAAAAAAAAAAA1729,AAAAA60038,AAAAAAAAAAA92631,AAAAAAAA9523}
+ 101 | {} | {}
+ 102 | {NULL} | {NULL}
+(102 rows)
+
+SELECT * FROM array_op_test WHERE t && '{}' ORDER BY seqno;
+ seqno | i | t
+-------+---+---
+(0 rows)
+
+SELECT * FROM array_op_test WHERE t <@ '{}' ORDER BY seqno;
+ seqno | i | t
+-------+----+----
+ 101 | {} | {}
+(1 row)
+
+-- array casts
+SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}";
+ {1,2,3}
+---------
+ {1,2,3}
+(1 row)
+
+SELECT pg_typeof(ARRAY[1,2,3]::text[]::int[]::float8[]) AS "double precision[]";
+ double precision[]
+--------------------
+ double precision[]
+(1 row)
+
+SELECT ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[] AS "{{a,bc},{def,hijk}}";
+ {{a,bc},{def,hijk}}
+---------------------
+ {{a,bc},{def,hijk}}
+(1 row)
+
+SELECT pg_typeof(ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[]) AS "character varying[]";
+ character varying[]
+---------------------
+ character varying[]
+(1 row)
+
+SELECT CAST(ARRAY[[[[[['a','bb','ccc']]]]]] as text[]) as "{{{{{{a,bb,ccc}}}}}}";
+ {{{{{{a,bb,ccc}}}}}}
+----------------------
+ {{{{{{a,bb,ccc}}}}}}
+(1 row)
+
+SELECT NULL::text[]::int[] AS "NULL";
+ NULL
+------
+
+(1 row)
+
+-- scalar op any/all (array)
+select 33 = any ('{1,2,3}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 = any ('{1,2,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+select 33 = all ('{1,2,33}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 >= all ('{1,2,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+-- boundary cases
+select null::int >= all ('{1,2,33}');
+ ?column?
+----------
+
+(1 row)
+
+select null::int >= all ('{}');
+ ?column?
+----------
+ t
+(1 row)
+
+select null::int >= any ('{}');
+ ?column?
+----------
+ f
+(1 row)
+
+-- cross-datatype
+select 33.4 = any (array[1,2,3]);
+ ?column?
+----------
+ f
+(1 row)
+
+select 33.4 > all (array[1,2,3]);
+ ?column?
+----------
+ t
+(1 row)
+
+-- errors
+select 33 * any ('{1,2,3}');
+ERROR: op ANY/ALL (array) requires operator to yield boolean
+LINE 1: select 33 * any ('{1,2,3}');
+ ^
+select 33 * any (44);
+ERROR: op ANY/ALL (array) requires array on right side
+LINE 1: select 33 * any (44);
+ ^
+-- nulls
+select 33 = any (null::int[]);
+ ?column?
+----------
+
+(1 row)
+
+select null::int = any ('{1,2,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = any ('{1,null,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = any ('{1,null,33}');
+ ?column?
+----------
+ t
+(1 row)
+
+select 33 = all (null::int[]);
+ ?column?
+----------
+
+(1 row)
+
+select null::int = all ('{1,2,3}');
+ ?column?
+----------
+
+(1 row)
+
+select 33 = all ('{1,null,3}');
+ ?column?
+----------
+ f
+(1 row)
+
+select 33 = all ('{33,null,33}');
+ ?column?
+----------
+
+(1 row)
+
+-- nulls later in the bitmap
+SELECT -1 != ALL(ARRAY(SELECT NULLIF(g.i, 900) FROM generate_series(1,1000) g(i)));
+ ?column?
+----------
+
+(1 row)
+
+-- test indexes on arrays
+create temp table arr_tbl (f1 int[] unique);
+insert into arr_tbl values ('{1,2,3}');
+insert into arr_tbl values ('{1,2}');
+-- failure expected:
+insert into arr_tbl values ('{1,2,3}');
+ERROR: duplicate key value violates unique constraint "arr_tbl_f1_key"
+DETAIL: Key (f1)=({1,2,3}) already exists.
+insert into arr_tbl values ('{2,3,4}');
+insert into arr_tbl values ('{1,5,3}');
+insert into arr_tbl values ('{1,2,10}');
+set enable_seqscan to off;
+set enable_bitmapscan to off;
+select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}';
+ f1
+----------
+ {1,2,10}
+ {1,5,3}
+(2 rows)
+
+select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}';
+ f1
+----------
+ {1,2,3}
+ {1,2,10}
+(2 rows)
+
+-- test ON CONFLICT DO UPDATE with arrays
+create temp table arr_pk_tbl (pk int4 primary key, f1 int[]);
+insert into arr_pk_tbl values (1, '{1,2,3}');
+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;
+ pk | f1
+----+---------
+ 1 | {3,2,5}
+(1 row)
+
+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;
+ pk | f1
+----+------------
+ 1 | {6,7,NULL}
+(1 row)
+
+-- 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;
+reset enable_bitmapscan;
+-- test [not] (like|ilike) (any|all) (...)
+select 'foo' like any (array['%a', '%o']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' like any (array['%a', '%b']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' like all (array['f%', '%o']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' like all (array['f%', '%b']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' not like any (array['%a', '%b']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' not like all (array['%a', '%o']); -- f
+ ?column?
+----------
+ f
+(1 row)
+
+select 'foo' ilike any (array['%A', '%O']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+select 'foo' ilike all (array['F%', '%O']); -- t
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- General array parser tests
+--
+-- none of the following should be accepted
+select '{{1,{2}},{2,3}}'::text[];
+ERROR: malformed array literal: "{{1,{2}},{2,3}}"
+LINE 1: select '{{1,{2}},{2,3}}'::text[];
+ ^
+DETAIL: Unexpected "{" character.
+select '{{},{}}'::text[];
+ERROR: malformed array literal: "{{},{}}"
+LINE 1: select '{{},{}}'::text[];
+ ^
+DETAIL: Unexpected "}" character.
+select E'{{1,2},\\{2,3}}'::text[];
+ERROR: malformed array literal: "{{1,2},\{2,3}}"
+LINE 1: select E'{{1,2},\\{2,3}}'::text[];
+ ^
+DETAIL: Unexpected "\" character.
+select '{{"1 2" x},{3}}'::text[];
+ERROR: malformed array literal: "{{"1 2" x},{3}}"
+LINE 1: select '{{"1 2" x},{3}}'::text[];
+ ^
+DETAIL: Unexpected array element.
+select '{}}'::text[];
+ERROR: malformed array literal: "{}}"
+LINE 1: select '{}}'::text[];
+ ^
+DETAIL: Junk after closing right brace.
+select '{ }}'::text[];
+ERROR: malformed array literal: "{ }}"
+LINE 1: select '{ }}'::text[];
+ ^
+DETAIL: Junk after closing right brace.
+select array[];
+ERROR: cannot determine type of empty array
+LINE 1: select array[];
+ ^
+HINT: Explicitly cast to the desired type, for example ARRAY[]::integer[].
+-- none of the above should be accepted
+-- all of the following should be accepted
+select '{}'::text[];
+ text
+------
+ {}
+(1 row)
+
+select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[];
+ text
+-----------------------------------------------
+ {{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}
+(1 row)
+
+select '{0 second ,0 second}'::interval[];
+ interval
+---------------
+ {"@ 0","@ 0"}
+(1 row)
+
+select '{ { "," } , { 3 } }'::text[];
+ text
+-------------
+ {{","},{3}}
+(1 row)
+
+select ' { { " 0 second " , 0 second } }'::text[];
+ text
+-------------------------------
+ {{" 0 second ","0 second"}}
+(1 row)
+
+select '{
+ 0 second,
+ @ 1 hour @ 42 minutes @ 20 seconds
+ }'::interval[];
+ interval
+------------------------------------
+ {"@ 0","@ 1 hour 42 mins 20 secs"}
+(1 row)
+
+select array[]::text[];
+ array
+-------
+ {}
+(1 row)
+
+select '[0:1]={1.1,2.2}'::float8[];
+ float8
+-----------------
+ [0:1]={1.1,2.2}
+(1 row)
+
+-- all of the above should be accepted
+-- tests for array aggregates
+CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]);
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{1,2,3,4}','{{grey,red},{blue,blue}}','{1.6, 0.0}');
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{1,2,3}','{{grey,red},{grey,blue}}','{1.6}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+ max | min | max | min | max | min
+-----------+---------+--------------------------+--------------------------+---------+-------
+ {1,2,3,4} | {1,2,3} | {{grey,red},{grey,blue}} | {{grey,red},{blue,blue}} | {1.6,0} | {1.6}
+(1 row)
+
+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}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+ max | min | max | min | max | min
+---------------+---------+--------------------------------+--------------------------+-----------------------+-------
+ {3,3,2,4,5,6} | {1,2,3} | {{white,yellow},{pink,orange}} | {{grey,red},{blue,blue}} | {2.1,3.3,1.8,1.7,1.6} | {1.6}
+(1 row)
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{2}','{{black,red},{green,orange}}','{1.6,2.2,2.6,0.4}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+ max | min | max | min | max | min
+---------------+---------+--------------------------------+------------------------------+-----------------------+-------
+ {3,3,2,4,5,6} | {1,2,3} | {{white,yellow},{pink,orange}} | {{black,red},{green,orange}} | {2.1,3.3,1.8,1.7,1.6} | {1.6}
+(1 row)
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{4,2,6,7,8,1}','{{red},{black},{purple},{blue},{blue}}',NULL);
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+ max | min | max | min | max | min
+---------------+---------+--------------------------------+------------------------------+-----------------------+-------
+ {4,2,6,7,8,1} | {1,2,3} | {{white,yellow},{pink,orange}} | {{black,red},{green,orange}} | {2.1,3.3,1.8,1.7,1.6} | {1.6}
+(1 row)
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{}','{{pink,white,blue,red,grey,orange}}','{2.1,1.87,1.4,2.2}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+ max | min | max | min | max | min
+---------------+-----+--------------------------------+------------------------------+-----------------------+-------
+ {4,2,6,7,8,1} | {} | {{white,yellow},{pink,orange}} | {{black,red},{green,orange}} | {2.1,3.3,1.8,1.7,1.6} | {1.6}
+(1 row)
+
+-- A few simple tests for arrays of composite types
+create type comptype as (f1 int, f2 text);
+create table comptable (c1 comptype, c2 comptype[]);
+-- 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]);
+-- check that implicitly named array type _comptype isn't a problem
+create type _comptype as enum('fooey');
+select * from comptable;
+ c1 | c2
+---------+-----------------------
+ (1,foo) | {"(2,bar)","(3,baz)"}
+(1 row)
+
+select c2[2].f2 from comptable;
+ f2
+-----
+ baz
+(1 row)
+
+drop type _comptype;
+drop table comptable;
+drop type comptype;
+create or replace function unnest1(anyarray)
+returns setof anyelement as $$
+select $1[s] from generate_subscripts($1,1) g(s);
+$$ language sql immutable;
+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;
+select * from unnest1(array[1,2,3]);
+ unnest1
+---------
+ 1
+ 2
+ 3
+(3 rows)
+
+select * from unnest2(array[[1,2,3],[4,5,6]]);
+ unnest2
+---------
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+(6 rows)
+
+drop function unnest1(anyarray);
+drop function unnest2(anyarray);
+select array_fill(null::integer, array[3,3],array[2,2]);
+ array_fill
+-----------------------------------------------------------------
+ [2:4][2:4]={{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}
+(1 row)
+
+select array_fill(null::integer, array[3,3]);
+ array_fill
+------------------------------------------------------
+ {{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}
+(1 row)
+
+select array_fill(null::text, array[3,3],array[2,2]);
+ array_fill
+-----------------------------------------------------------------
+ [2:4][2:4]={{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}
+(1 row)
+
+select array_fill(null::text, array[3,3]);
+ array_fill
+------------------------------------------------------
+ {{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}
+(1 row)
+
+select array_fill(7, array[3,3],array[2,2]);
+ array_fill
+--------------------------------------
+ [2:4][2:4]={{7,7,7},{7,7,7},{7,7,7}}
+(1 row)
+
+select array_fill(7, array[3,3]);
+ array_fill
+---------------------------
+ {{7,7,7},{7,7,7},{7,7,7}}
+(1 row)
+
+select array_fill('juhu'::text, array[3,3],array[2,2]);
+ array_fill
+-----------------------------------------------------------------
+ [2:4][2:4]={{juhu,juhu,juhu},{juhu,juhu,juhu},{juhu,juhu,juhu}}
+(1 row)
+
+select array_fill('juhu'::text, array[3,3]);
+ array_fill
+------------------------------------------------------
+ {{juhu,juhu,juhu},{juhu,juhu,juhu},{juhu,juhu,juhu}}
+(1 row)
+
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, array[0]) as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}') as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}', '{}') as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
+-- raise exception
+select array_fill(1, null, array[2,2]);
+ERROR: dimension array or low bound array cannot be null
+select array_fill(1, array[2,2], null);
+ERROR: dimension array or low bound array cannot be null
+select array_fill(1, array[2,2], '{}');
+ERROR: wrong number of array subscripts
+DETAIL: Low bound array has different size than dimensions array.
+select array_fill(1, array[3,3], array[1,1,1]);
+ERROR: wrong number of array subscripts
+DETAIL: Low bound array has different size than dimensions array.
+select array_fill(1, array[1,2,null]);
+ERROR: dimension values cannot be null
+select array_fill(1, array[[1,2],[3,4]]);
+ERROR: wrong number of array subscripts
+DETAIL: Dimension array must be one dimensional.
+select string_to_array('1|2|3', '|');
+ string_to_array
+-----------------
+ {1,2,3}
+(1 row)
+
+select string_to_array('1|2|3|', '|');
+ string_to_array
+-----------------
+ {1,2,3,""}
+(1 row)
+
+select string_to_array('1||2|3||', '||');
+ string_to_array
+-----------------
+ {1,2|3,""}
+(1 row)
+
+select string_to_array('1|2|3', '');
+ string_to_array
+-----------------
+ {1|2|3}
+(1 row)
+
+select string_to_array('', '|');
+ string_to_array
+-----------------
+ {}
+(1 row)
+
+select string_to_array('1|2|3', NULL);
+ string_to_array
+-----------------
+ {1,|,2,|,3}
+(1 row)
+
+select string_to_array(NULL, '|') IS NULL;
+ ?column?
+----------
+ t
+(1 row)
+
+select string_to_array('abc', '');
+ string_to_array
+-----------------
+ {abc}
+(1 row)
+
+select string_to_array('abc', '', 'abc');
+ string_to_array
+-----------------
+ {NULL}
+(1 row)
+
+select string_to_array('abc', ',');
+ string_to_array
+-----------------
+ {abc}
+(1 row)
+
+select string_to_array('abc', ',', 'abc');
+ string_to_array
+-----------------
+ {NULL}
+(1 row)
+
+select string_to_array('1,2,3,4,,6', ',');
+ string_to_array
+-----------------
+ {1,2,3,4,"",6}
+(1 row)
+
+select string_to_array('1,2,3,4,,6', ',', '');
+ string_to_array
+------------------
+ {1,2,3,4,NULL,6}
+(1 row)
+
+select string_to_array('1,2,3,4,*,6', ',', '*');
+ string_to_array
+------------------
+ {1,2,3,4,NULL,6}
+(1 row)
+
+select v, v is null as "is null" from string_to_table('1|2|3', '|') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+(3 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3|', '|') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ | f
+(4 rows)
+
+select v, v is null as "is null" from string_to_table('1||2|3||', '||') g(v);
+ v | is null
+-----+---------
+ 1 | f
+ 2|3 | f
+ | f
+(3 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3', '') g(v);
+ v | is null
+-------+---------
+ 1|2|3 | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('', '|') g(v);
+ v | is null
+---+---------
+(0 rows)
+
+select v, v is null as "is null" from string_to_table('1|2|3', NULL) g(v);
+ v | is null
+---+---------
+ 1 | f
+ | | f
+ 2 | f
+ | | f
+ 3 | f
+(5 rows)
+
+select v, v is null as "is null" from string_to_table(NULL, '|') g(v);
+ v | is null
+---+---------
+(0 rows)
+
+select v, v is null as "is null" from string_to_table('abc', '') g(v);
+ v | is null
+-----+---------
+ abc | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', '', 'abc') g(v);
+ v | is null
+---+---------
+ | t
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', ',') g(v);
+ v | is null
+-----+---------
+ abc | f
+(1 row)
+
+select v, v is null as "is null" from string_to_table('abc', ',', 'abc') g(v);
+ v | is null
+---+---------
+ | t
+(1 row)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | f
+ 6 | f
+(6 rows)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',', '') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | t
+ 6 | f
+(6 rows)
+
+select v, v is null as "is null" from string_to_table('1,2,3,4,*,6', ',', '*') g(v);
+ v | is null
+---+---------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | t
+ 6 | f
+(6 rows)
+
+select array_to_string(NULL::int4[], ',') IS NULL;
+ ?column?
+----------
+ t
+(1 row)
+
+select array_to_string('{}'::int4[], ',');
+ array_to_string
+-----------------
+
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',');
+ array_to_string
+-----------------
+ 1,2,3,4,6
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',', '*');
+ array_to_string
+-----------------
+ 1,2,3,4,*,6
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], NULL);
+ array_to_string
+-----------------
+
+(1 row)
+
+select array_to_string(array[1,2,3,4,NULL,6], ',', NULL);
+ array_to_string
+-----------------
+ 1,2,3,4,6
+(1 row)
+
+select array_to_string(string_to_array('1|2|3', '|'), '|');
+ array_to_string
+-----------------
+ 1|2|3
+(1 row)
+
+select array_length(array[1,2,3], 1);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 0);
+ array_length
+--------------
+
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 1);
+ array_length
+--------------
+ 2
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 2);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 3);
+ array_length
+--------------
+
+(1 row)
+
+select cardinality(NULL::int[]);
+ cardinality
+-------------
+
+(1 row)
+
+select cardinality('{}'::int[]);
+ cardinality
+-------------
+ 0
+(1 row)
+
+select cardinality(array[1,2,3]);
+ cardinality
+-------------
+ 3
+(1 row)
+
+select cardinality('[2:4]={5,6,7}'::int[]);
+ cardinality
+-------------
+ 3
+(1 row)
+
+select cardinality('{{1,2}}'::int[]);
+ cardinality
+-------------
+ 2
+(1 row)
+
+select cardinality('{{1,2},{3,4},{5,6}}'::int[]);
+ cardinality
+-------------
+ 6
+(1 row)
+
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
+ cardinality
+-------------
+ 8
+(1 row)
+
+-- array_agg(anynonarray)
+select array_agg(unique1) from (select unique1 from tenk1 where unique1 < 15 order by unique1) ss;
+ array_agg
+--------------------------------------
+ {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}
+(1 row)
+
+select array_agg(ten) from (select ten from tenk1 where unique1 < 15 order by unique1) ss;
+ array_agg
+---------------------------------
+ {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4}
+(1 row)
+
+select array_agg(nullif(ten, 4)) from (select ten from tenk1 where unique1 < 15 order by unique1) ss;
+ array_agg
+---------------------------------------
+ {0,1,2,3,NULL,5,6,7,8,9,0,1,2,3,NULL}
+(1 row)
+
+select array_agg(unique1) from tenk1 where unique1 < -15;
+ array_agg
+-----------
+
+(1 row)
+
+-- array_agg(anyarray)
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3,4}'::int[])) v(ar);
+ array_agg
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select array_agg(distinct ar order by ar desc)
+ from (select array[i / 2] from generate_series(1,10) a(i)) b(ar);
+ array_agg
+---------------------------
+ {{5},{4},{3},{2},{1},{0}}
+(1 row)
+
+select array_agg(ar)
+ from (select array_agg(array[i, i+1, i-1])
+ from generate_series(1,2) a(i)) b(ar);
+ array_agg
+---------------------
+ {{{1,2,0},{2,3,1}}}
+(1 row)
+
+select array_agg(array[i+1.2, i+1.3, i+1.4]) from generate_series(1,3) g(i);
+ array_agg
+---------------------------------------------
+ {{2.2,2.3,2.4},{3.2,3.3,3.4},{4.2,4.3,4.4}}
+(1 row)
+
+select array_agg(array['Hello', i::text]) from generate_series(9,11) g(i);
+ array_agg
+-----------------------------------
+ {{Hello,9},{Hello,10},{Hello,11}}
+(1 row)
+
+select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i);
+ array_agg
+--------------------------------------
+ {{1,1,2},{2,2,3},{3,NULL,4},{4,4,5}}
+(1 row)
+
+-- errors
+select array_agg('{}'::int[]) from generate_series(1,2);
+ERROR: cannot accumulate empty arrays
+select array_agg(null::int[]) from generate_series(1,2);
+ERROR: cannot accumulate null arrays
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3}'::int[])) v(ar);
+ERROR: cannot accumulate arrays of different dimensionality
+select unnest(array[1,2,3]);
+ unnest
+--------
+ 1
+ 2
+ 3
+(3 rows)
+
+select * from unnest(array[1,2,3]);
+ unnest
+--------
+ 1
+ 2
+ 3
+(3 rows)
+
+select unnest(array[1,2,3,4.5]::float8[]);
+ unnest
+--------
+ 1
+ 2
+ 3
+ 4.5
+(4 rows)
+
+select unnest(array[1,2,3,4.5]::numeric[]);
+ unnest
+--------
+ 1
+ 2
+ 3
+ 4.5
+(4 rows)
+
+select unnest(array[1,2,3,null,4,null,null,5,6]);
+ unnest
+--------
+ 1
+ 2
+ 3
+
+ 4
+
+
+ 5
+ 6
+(9 rows)
+
+select unnest(array[1,2,3,null,4,null,null,5,6]::text[]);
+ unnest
+--------
+ 1
+ 2
+ 3
+
+ 4
+
+
+ 5
+ 6
+(9 rows)
+
+select abs(unnest(array[1,2,null,-3]));
+ abs
+-----
+ 1
+ 2
+
+ 3
+(4 rows)
+
+select array_remove(array[1,2,2,3], 2);
+ array_remove
+--------------
+ {1,3}
+(1 row)
+
+select array_remove(array[1,2,2,3], 5);
+ array_remove
+--------------
+ {1,2,2,3}
+(1 row)
+
+select array_remove(array[1,NULL,NULL,3], NULL);
+ array_remove
+--------------
+ {1,3}
+(1 row)
+
+select array_remove(array['A','CC','D','C','RR'], 'RR');
+ array_remove
+--------------
+ {A,CC,D,C}
+(1 row)
+
+select array_remove(array[1.0, 2.1, 3.3], 1);
+ array_remove
+--------------
+ {2.1,3.3}
+(1 row)
+
+select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed
+ERROR: removing elements from multidimensional arrays is not supported
+select array_remove(array['X','X','X'], 'X') = '{}';
+ ?column?
+----------
+ t
+(1 row)
+
+select array_replace(array[1,2,5,4],5,3);
+ array_replace
+---------------
+ {1,2,3,4}
+(1 row)
+
+select array_replace(array[1,2,5,4],5,NULL);
+ array_replace
+---------------
+ {1,2,NULL,4}
+(1 row)
+
+select array_replace(array[1,2,NULL,4,NULL],NULL,5);
+ array_replace
+---------------
+ {1,2,5,4,5}
+(1 row)
+
+select array_replace(array['A','B','DD','B'],'B','CC');
+ array_replace
+---------------
+ {A,CC,DD,CC}
+(1 row)
+
+select array_replace(array[1,NULL,3],NULL,NULL);
+ array_replace
+---------------
+ {1,NULL,3}
+(1 row)
+
+select array_replace(array['AB',NULL,'CDE'],NULL,'12');
+ array_replace
+---------------
+ {AB,12,CDE}
+(1 row)
+
+-- array(select array-value ...)
+select array(select array[i,i/2] from generate_series(1,5) i);
+ array
+---------------------------------
+ {{1,0},{2,1},{3,1},{4,2},{5,2}}
+(1 row)
+
+select array(select array['Hello', i::text] from generate_series(9,11) i);
+ array
+-----------------------------------
+ {{Hello,9},{Hello,10},{Hello,11}}
+(1 row)
+
+-- Insert/update on a column that is array of composite
+create temp table t1 (f1 int8_tbl[]);
+insert into t1 (f1[5].q1) values(42);
+select * from t1;
+ f1
+-----------------
+ [5:5]={"(42,)"}
+(1 row)
+
+update t1 set f1[5].q2 = 43;
+select * from t1;
+ f1
+-------------------
+ [5:5]={"(42,43)"}
+(1 row)
+
+-- Check that arrays of composites are safely detoasted when needed
+create temp table src (f1 text);
+insert into src
+ select string_agg(random()::text,'') from generate_series(1,10000);
+create type textandtext as (c1 text, c2 text);
+create temp table dest (f1 textandtext[]);
+insert into dest select array[row(f1,f1)::textandtext] from src;
+select length(md5((f1[1]).c2)) from dest;
+ length
+--------
+ 32
+(1 row)
+
+delete from src;
+select length(md5((f1[1]).c2)) from dest;
+ length
+--------
+ 32
+(1 row)
+
+truncate table src;
+drop table src;
+select length(md5((f1[1]).c2)) from dest;
+ length
+--------
+ 32
+(1 row)
+
+drop table dest;
+drop type textandtext;
+-- 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);
+ op | wb_n1 | wb_n2 | wb_n3 | wb_f1 | wb_f2 | wb_f3
+------------------+-------+-------+-------+-------+-------+-------
+ -5.2 | 0 | 0 | 1 | 0 | 0 | 1
+ -0.0000000001 | 0 | 0 | 2 | 0 | 0 | 2
+ 0.000000000001 | 0 | 1 | 2 | 0 | 1 | 2
+ 1 | 1 | 1 | 2 | 1 | 1 | 2
+ 1.99999999999999 | 1 | 1 | 2 | 1 | 1 | 2
+ 2 | 1 | 1 | 3 | 1 | 1 | 3
+ 2.00000000000001 | 1 | 1 | 3 | 1 | 1 | 3
+ 3 | 2 | 1 | 3 | 2 | 1 | 3
+ 4 | 2 | 1 | 3 | 2 | 1 | 3
+ 4.5 | 2 | 1 | 3 | 2 | 1 | 3
+ 5 | 3 | 1 | 3 | 3 | 1 | 3
+ 5.5 | 3 | 2 | 3 | 3 | 2 | 3
+ 6 | 3 | 2 | 3 | 3 | 2 | 3
+ 7 | 3 | 2 | 3 | 3 | 2 | 3
+ 8 | 3 | 2 | 3 | 3 | 2 | 3
+ 9 | 3 | 2 | 3 | 3 | 2 | 3
+ 9.99999999999999 | 3 | 3 | 3 | 3 | 3 | 3
+ 10 | 4 | 3 | 3 | 4 | 3 | 3
+ 10.0000000000001 | 4 | 3 | 3 | 4 | 3 | 3
+(19 rows)
+
+-- 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);
+ op | wb
+------+----
+ -5.2 | 0
+ 4 | 2
+ 77 | 3
+ NaN | 5
+(4 rows)
+
+-- 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;
+ op | wb_1
+----+------
+ 0 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 2
+ 4 | 2
+ 5 | 3
+ 6 | 3
+ 7 | 3
+ 8 | 3
+ 9 | 3
+ 10 | 4
+ 11 | 4
+(12 rows)
+
+SELECT width_bucket(now(),
+ array['yesterday', 'today', 'tomorrow']::timestamptz[]);
+ width_bucket
+--------------
+ 2
+(1 row)
+
+-- corner cases
+SELECT width_bucket(5, ARRAY[3]);
+ width_bucket
+--------------
+ 1
+(1 row)
+
+SELECT width_bucket(5, '{}');
+ width_bucket
+--------------
+ 0
+(1 row)
+
+-- error cases
+SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]);
+ERROR: function width_bucket(text, integer[]) does not exist
+LINE 1: SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]);
+ ^
+HINT: No function matches the given name and argument types. You might need to add explicit type casts.
+SELECT width_bucket(5, ARRAY[3, 4, NULL]);
+ERROR: thresholds array must not contain NULLs
+SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]);
+ERROR: thresholds must be one-dimensional array
+-- 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);
+ arr | trim_array
+-------------------------------+-----------------
+ {1,2,3,4,5,6} | {1,2,3,4}
+ {1,2} | {}
+ [10:16]={1,2,3,4,5,6,7} | {1,2,3,4,5}
+ [-15:-10]={1,2,3,4,5,6} | {1,2,3,4}
+ {{1,10},{2,20},{3,30},{4,40}} | {{1,10},{2,20}}
+(5 rows)
+
+SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail
+ERROR: number of elements to trim must be between 0 and 3
+SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail
+ERROR: number of elements to trim must be between 0 and 3
+SELECT trim_array(ARRAY[]::int[], 1); -- fail
+ERROR: number of elements to trim must be between 0 and 0
diff --git a/yql/essentials/tests/postgresql/original/cases/arrays.sql b/yql/essentials/tests/postgresql/original/cases/arrays.sql
new file mode 100644
index 0000000000..5eedc4c3ce
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/arrays.sql
@@ -0,0 +1,740 @@
+--
+-- ARRAYS
+--
+
+CREATE TABLE arrtest (
+ a int2[],
+ b int4[][][],
+ c name[],
+ d text[][],
+ e float8[],
+ f char(5)[],
+ g varchar(5)[]
+);
+
+--
+-- 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}}}', '{}', '{}', '{}', '{}');
+
+UPDATE arrtest SET e[0] = '1.1';
+
+UPDATE arrtest SET e[1] = '2.2';
+
+INSERT INTO arrtest (f)
+ VALUES ('{"too long"}');
+
+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"}');
+
+INSERT INTO arrtest (a, b[1:2], c, d[1:2])
+ VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}');
+
+INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch
+
+INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch
+
+SELECT * FROM arrtest;
+
+SELECT arrtest.a[1],
+ arrtest.b[1][1][1],
+ arrtest.c[1],
+ arrtest.d[1][1],
+ arrtest.e[0]
+ FROM arrtest;
+
+SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
+ FROM arrtest;
+
+SELECT a[1:3],
+ b[1:1][1:2][1:2],
+ c[1:2],
+ d[1:1][1:2]
+ FROM arrtest;
+
+SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c
+ FROM arrtest;
+
+SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c
+ FROM arrtest;
+
+-- returns nothing
+SELECT *
+ FROM arrtest
+ WHERE a[1] < 5 and
+ c = '{"foobar"}'::_name;
+
+UPDATE arrtest
+ SET a[1:2] = '{16,25}'
+ WHERE NOT a = '{}'::_int2;
+
+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]';
+
+UPDATE arrtest
+ SET c[2:2] = '{"new_word"}'
+ WHERE array_dims(c) is not null;
+
+SELECT a,b,c FROM arrtest;
+
+SELECT a[1:3],
+ b[1:1][1:2][1:2],
+ c[1:2],
+ d[1:1][2:2]
+ FROM arrtest;
+
+SELECT b[1:1][2][2],
+ d[1:1][2]
+ FROM arrtest;
+
+INSERT INTO arrtest(a) VALUES('{1,null,3}');
+SELECT a FROM arrtest;
+UPDATE arrtest SET a[4] = NULL WHERE a[2] IS NULL;
+SELECT a FROM arrtest WHERE a[2] IS NULL;
+DELETE FROM arrtest WHERE a[2] IS NULL AND b IS NULL;
+SELECT a,b,c FROM arrtest;
+
+-- test mixed slice/scalar subscripting
+select '{{1,2,3},{4,5,6},{7,8,9}}'::int[];
+select ('{{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2];
+select '[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[];
+select ('[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2];
+
+--
+-- check subscription corner cases
+--
+-- More subscripts than MAXDIM (6)
+SELECT ('{}'::int[])[1][2][3][4][5][6][7];
+-- NULL index yields NULL when selecting
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL][1];
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL:1][1];
+SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][1:NULL][1];
+-- NULL index in assignment is an error
+UPDATE arrtest
+ SET c[NULL] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+UPDATE arrtest
+ SET c[NULL:1] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+UPDATE arrtest
+ SET c[1:NULL] = '{"can''t assign"}'
+ WHERE array_dims(c) is not null;
+-- Un-subscriptable type
+SELECT (now())[1];
+
+-- test slices with empty lower and/or upper index
+CREATE TEMP TABLE arrtest_s (
+ a int2[],
+ b int2[][]
+);
+INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}');
+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}}');
+
+SELECT * FROM arrtest_s;
+SELECT a[:3], b[:2][:2] FROM arrtest_s;
+SELECT a[2:], b[2:][2:] FROM arrtest_s;
+SELECT a[:], b[:] FROM arrtest_s;
+
+-- updates
+UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14,15}}'
+ WHERE array_lower(a,1) = 1;
+SELECT * FROM arrtest_s;
+UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28,29}}';
+SELECT * FROM arrtest_s;
+UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}';
+SELECT * FROM arrtest_s;
+UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; -- fail, too small
+INSERT INTO arrtest_s VALUES(NULL, NULL);
+UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}'; -- fail, no good with null
+
+-- check with fixed-length-array type, such as point
+SELECT f1[0:1] FROM POINT_TBL;
+SELECT f1[0:] FROM POINT_TBL;
+SELECT f1[:1] FROM POINT_TBL;
+SELECT f1[:] FROM POINT_TBL;
+
+-- 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 *;
+INSERT INTO point_tbl(f1[0]) VALUES(0) RETURNING *;
+-- NULL assignments get ignored
+UPDATE point_tbl SET f1[0] = NULL WHERE f1::text = '(10,10)'::point::text RETURNING *;
+-- but non-NULL subscript assignments work
+UPDATE point_tbl SET f1[0] = -10, f1[1] = -10 WHERE f1::text = '(10,10)'::point::text RETURNING *;
+-- but not to expand the range
+UPDATE point_tbl SET f1[3] = 10 WHERE f1::text = '(-10,-10)'::point::text RETURNING *;
+
+--
+-- test array extension
+--
+CREATE TEMP TABLE arrtest1 (i int[], t text[]);
+insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']);
+select * from arrtest1;
+update arrtest1 set i[2] = 22, t[2] = 'twenty-two';
+select * from arrtest1;
+update arrtest1 set i[5] = 5, t[5] = 'five';
+select * from arrtest1;
+update arrtest1 set i[8] = 8, t[8] = 'eight';
+select * from arrtest1;
+update arrtest1 set i[0] = 0, t[0] = 'zero';
+select * from arrtest1;
+update arrtest1 set i[-3] = -3, t[-3] = 'minus-three';
+select * from arrtest1;
+update arrtest1 set i[0:2] = array[10,11,12], t[0:2] = array['ten','eleven','twelve'];
+select * from arrtest1;
+update arrtest1 set i[8:10] = array[18,null,20], t[8:10] = array['p18',null,'p20'];
+select * from arrtest1;
+update arrtest1 set i[11:12] = array[null,22], t[11:12] = array[null,'p22'];
+select * from arrtest1;
+update arrtest1 set i[15:16] = array[null,26], t[15:16] = array[null,'p26'];
+select * from arrtest1;
+update arrtest1 set i[-5:-3] = array[-15,-14,-13], t[-5:-3] = array['m15','m14','m13'];
+select * from arrtest1;
+update arrtest1 set i[-7:-6] = array[-17,null], t[-7:-6] = array['m17',null];
+select * from arrtest1;
+update arrtest1 set i[-12:-10] = array[-22,null,-20], t[-12:-10] = array['m22',null,'m20'];
+select * from arrtest1;
+delete from arrtest1;
+insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']);
+select * from arrtest1;
+update arrtest1 set i[0:5] = array[0,1,2,null,4,5], t[0:5] = array['z','p1','p2',null,'p4','p5'];
+select * from arrtest1;
+
+--
+-- array expressions and operators
+--
+
+-- table creation and INSERTs
+CREATE TEMP TABLE arrtest2 (i integer ARRAY[4], f float8[], n numeric[], t text[], d timestamp[]);
+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[]
+);
+
+-- some more test data
+CREATE TEMP TABLE arrtest_f (f0 int, f1 text, f2 float8);
+insert into arrtest_f values(1,'cat1',1.21);
+insert into arrtest_f values(2,'cat1',1.24);
+insert into arrtest_f values(3,'cat1',1.18);
+insert into arrtest_f values(4,'cat1',1.26);
+insert into arrtest_f values(5,'cat1',1.15);
+insert into arrtest_f values(6,'cat2',1.15);
+insert into arrtest_f values(7,'cat2',1.26);
+insert into arrtest_f values(8,'cat2',1.32);
+insert into arrtest_f values(9,'cat2',1.30);
+
+CREATE TEMP TABLE arrtest_i (f0 int, f1 text, f2 int);
+insert into arrtest_i values(1,'cat1',21);
+insert into arrtest_i values(2,'cat1',24);
+insert into arrtest_i values(3,'cat1',18);
+insert into arrtest_i values(4,'cat1',26);
+insert into arrtest_i values(5,'cat1',15);
+insert into arrtest_i values(6,'cat2',15);
+insert into arrtest_i values(7,'cat2',26);
+insert into arrtest_i values(8,'cat2',32);
+insert into arrtest_i values(9,'cat2',30);
+
+-- 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;
+SELECT ARRAY[[[[[['hello'],['world']]]]]];
+SELECT ARRAY[ARRAY['hello'],ARRAY['world']];
+SELECT ARRAY(select f2 from arrtest_f order by f2) AS "ARRAY";
+
+-- with nulls
+SELECT '{1,null,3}'::int[];
+SELECT ARRAY[1,NULL,3];
+
+-- functions
+SELECT array_append(array[42], 6) AS "{42,6}";
+SELECT array_prepend(6, array[42]) AS "{6,42}";
+SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}";
+SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}";
+SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}";
+
+SELECT array_position(ARRAY[1,2,3,4,5], 4);
+SELECT array_position(ARRAY[5,3,4,2,1], 4);
+SELECT array_position(ARRAY[[1,2],[3,4]], 3);
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon');
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat');
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL);
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL);
+SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat');
+
+SELECT array_positions(NULL, 10);
+SELECT array_positions(NULL, NULL::int);
+SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4);
+SELECT array_positions(ARRAY[[1,2],[3,4]], 4);
+SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL);
+SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL);
+SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10
+ FROM generate_series(1,100) g(i)),
+ 'AAAAAAAAAAAAAAAAAAAAAAAAA5'), 1);
+
+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;
+
+SELECT array_position('[2:4]={1,2,3}'::int[], 1);
+SELECT array_positions('[2:4]={1,2,3}'::int[], 1);
+
+SELECT
+ array_position(ids, (1, 1)),
+ array_positions(ids, (1, 1))
+ FROM
+(VALUES
+ (ARRAY[(0, 0), (1, 1)]),
+ (ARRAY[(1, 1)])
+) AS f (ids);
+
+-- operators
+SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]];
+SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE";
+SELECT ARRAY[1,2] || 3 AS "{1,2,3}";
+SELECT 0 || ARRAY[1,2] AS "{0,1,2}";
+SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}";
+SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY";
+SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}";
+SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}";
+SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}";
+SELECT ARRAY[1.1] || ARRAY[2,3,4];
+SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x);
+SELECT ROW(1,2) || array_agg(x) FROM (VALUES (ROW(3,4)), (ROW(5,6))) v(x);
+
+SELECT * FROM array_op_test WHERE i @> '{32}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i && '{32}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i && '{17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{32,17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i && '{32,17}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i = '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i && '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i <@ '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i @> '{NULL}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i && '{NULL}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
+
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t = '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t @> '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t && '{}' ORDER BY seqno;
+SELECT * FROM array_op_test WHERE t <@ '{}' ORDER BY seqno;
+
+-- array casts
+SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}";
+SELECT pg_typeof(ARRAY[1,2,3]::text[]::int[]::float8[]) AS "double precision[]";
+SELECT ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[] AS "{{a,bc},{def,hijk}}";
+SELECT pg_typeof(ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[]) AS "character varying[]";
+SELECT CAST(ARRAY[[[[[['a','bb','ccc']]]]]] as text[]) as "{{{{{{a,bb,ccc}}}}}}";
+SELECT NULL::text[]::int[] AS "NULL";
+
+-- scalar op any/all (array)
+select 33 = any ('{1,2,3}');
+select 33 = any ('{1,2,33}');
+select 33 = all ('{1,2,33}');
+select 33 >= all ('{1,2,33}');
+-- boundary cases
+select null::int >= all ('{1,2,33}');
+select null::int >= all ('{}');
+select null::int >= any ('{}');
+-- cross-datatype
+select 33.4 = any (array[1,2,3]);
+select 33.4 > all (array[1,2,3]);
+-- errors
+select 33 * any ('{1,2,3}');
+select 33 * any (44);
+-- nulls
+select 33 = any (null::int[]);
+select null::int = any ('{1,2,3}');
+select 33 = any ('{1,null,3}');
+select 33 = any ('{1,null,33}');
+select 33 = all (null::int[]);
+select null::int = all ('{1,2,3}');
+select 33 = all ('{1,null,3}');
+select 33 = all ('{33,null,33}');
+-- nulls later in the bitmap
+SELECT -1 != ALL(ARRAY(SELECT NULLIF(g.i, 900) FROM generate_series(1,1000) g(i)));
+
+-- test indexes on arrays
+create temp table arr_tbl (f1 int[] unique);
+insert into arr_tbl values ('{1,2,3}');
+insert into arr_tbl values ('{1,2}');
+-- failure expected:
+insert into arr_tbl values ('{1,2,3}');
+insert into arr_tbl values ('{2,3,4}');
+insert into arr_tbl values ('{1,5,3}');
+insert into arr_tbl values ('{1,2,10}');
+
+set enable_seqscan to off;
+set enable_bitmapscan to off;
+select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}';
+select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}';
+
+-- test ON CONFLICT DO UPDATE with arrays
+create temp table arr_pk_tbl (pk int4 primary key, f1 int[]);
+insert into arr_pk_tbl values (1, '{1,2,3}');
+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;
+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;
+
+-- 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;
+reset enable_bitmapscan;
+
+-- test [not] (like|ilike) (any|all) (...)
+select 'foo' like any (array['%a', '%o']); -- t
+select 'foo' like any (array['%a', '%b']); -- f
+select 'foo' like all (array['f%', '%o']); -- t
+select 'foo' like all (array['f%', '%b']); -- f
+select 'foo' not like any (array['%a', '%b']); -- t
+select 'foo' not like all (array['%a', '%o']); -- f
+select 'foo' ilike any (array['%A', '%O']); -- t
+select 'foo' ilike all (array['F%', '%O']); -- t
+
+--
+-- General array parser tests
+--
+
+-- none of the following should be accepted
+select '{{1,{2}},{2,3}}'::text[];
+select '{{},{}}'::text[];
+select E'{{1,2},\\{2,3}}'::text[];
+select '{{"1 2" x},{3}}'::text[];
+select '{}}'::text[];
+select '{ }}'::text[];
+select array[];
+-- none of the above should be accepted
+
+-- all of the following should be accepted
+select '{}'::text[];
+select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[];
+select '{0 second ,0 second}'::interval[];
+select '{ { "," } , { 3 } }'::text[];
+select ' { { " 0 second " , 0 second } }'::text[];
+select '{
+ 0 second,
+ @ 1 hour @ 42 minutes @ 20 seconds
+ }'::interval[];
+select array[]::text[];
+select '[0:1]={1.1,2.2}'::float8[];
+-- all of the above should be accepted
+
+-- tests for array aggregates
+CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]);
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{1,2,3,4}','{{grey,red},{blue,blue}}','{1.6, 0.0}');
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{1,2,3}','{{grey,red},{grey,blue}}','{1.6}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+
+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}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{2}','{{black,red},{green,orange}}','{1.6,2.2,2.6,0.4}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{4,2,6,7,8,1}','{{red},{black},{purple},{blue},{blue}}',NULL);
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+
+INSERT INTO arraggtest (f1, f2, f3) VALUES
+('{}','{{pink,white,blue,red,grey,orange}}','{2.1,1.87,1.4,2.2}');
+SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest;
+
+-- A few simple tests for arrays of composite types
+
+create type comptype as (f1 int, f2 text);
+
+create table comptable (c1 comptype, c2 comptype[]);
+
+-- 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]);
+
+-- check that implicitly named array type _comptype isn't a problem
+create type _comptype as enum('fooey');
+
+select * from comptable;
+select c2[2].f2 from comptable;
+
+drop type _comptype;
+drop table comptable;
+drop type comptype;
+
+create or replace function unnest1(anyarray)
+returns setof anyelement as $$
+select $1[s] from generate_subscripts($1,1) g(s);
+$$ language sql immutable;
+
+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;
+
+select * from unnest1(array[1,2,3]);
+select * from unnest2(array[[1,2,3],[4,5,6]]);
+
+drop function unnest1(anyarray);
+drop function unnest2(anyarray);
+
+select array_fill(null::integer, array[3,3],array[2,2]);
+select array_fill(null::integer, array[3,3]);
+select array_fill(null::text, array[3,3],array[2,2]);
+select array_fill(null::text, array[3,3]);
+select array_fill(7, array[3,3],array[2,2]);
+select array_fill(7, array[3,3]);
+select array_fill('juhu'::text, array[3,3],array[2,2]);
+select array_fill('juhu'::text, array[3,3]);
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, array[0]) as a) ss;
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}') as a) ss;
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}', '{}') as a) ss;
+-- raise exception
+select array_fill(1, null, array[2,2]);
+select array_fill(1, array[2,2], null);
+select array_fill(1, array[2,2], '{}');
+select array_fill(1, array[3,3], array[1,1,1]);
+select array_fill(1, array[1,2,null]);
+select array_fill(1, array[[1,2],[3,4]]);
+
+select string_to_array('1|2|3', '|');
+select string_to_array('1|2|3|', '|');
+select string_to_array('1||2|3||', '||');
+select string_to_array('1|2|3', '');
+select string_to_array('', '|');
+select string_to_array('1|2|3', NULL);
+select string_to_array(NULL, '|') IS NULL;
+select string_to_array('abc', '');
+select string_to_array('abc', '', 'abc');
+select string_to_array('abc', ',');
+select string_to_array('abc', ',', 'abc');
+select string_to_array('1,2,3,4,,6', ',');
+select string_to_array('1,2,3,4,,6', ',', '');
+select string_to_array('1,2,3,4,*,6', ',', '*');
+
+select v, v is null as "is null" from string_to_table('1|2|3', '|') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3|', '|') g(v);
+select v, v is null as "is null" from string_to_table('1||2|3||', '||') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3', '') g(v);
+select v, v is null as "is null" from string_to_table('', '|') g(v);
+select v, v is null as "is null" from string_to_table('1|2|3', NULL) g(v);
+select v, v is null as "is null" from string_to_table(NULL, '|') g(v);
+select v, v is null as "is null" from string_to_table('abc', '') g(v);
+select v, v is null as "is null" from string_to_table('abc', '', 'abc') g(v);
+select v, v is null as "is null" from string_to_table('abc', ',') g(v);
+select v, v is null as "is null" from string_to_table('abc', ',', 'abc') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',', '') g(v);
+select v, v is null as "is null" from string_to_table('1,2,3,4,*,6', ',', '*') g(v);
+
+select array_to_string(NULL::int4[], ',') IS NULL;
+select array_to_string('{}'::int4[], ',');
+select array_to_string(array[1,2,3,4,NULL,6], ',');
+select array_to_string(array[1,2,3,4,NULL,6], ',', '*');
+select array_to_string(array[1,2,3,4,NULL,6], NULL);
+select array_to_string(array[1,2,3,4,NULL,6], ',', NULL);
+
+select array_to_string(string_to_array('1|2|3', '|'), '|');
+
+select array_length(array[1,2,3], 1);
+select array_length(array[[1,2,3], [4,5,6]], 0);
+select array_length(array[[1,2,3], [4,5,6]], 1);
+select array_length(array[[1,2,3], [4,5,6]], 2);
+select array_length(array[[1,2,3], [4,5,6]], 3);
+
+select cardinality(NULL::int[]);
+select cardinality('{}'::int[]);
+select cardinality(array[1,2,3]);
+select cardinality('[2:4]={5,6,7}'::int[]);
+select cardinality('{{1,2}}'::int[]);
+select cardinality('{{1,2},{3,4},{5,6}}'::int[]);
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
+
+-- array_agg(anynonarray)
+select array_agg(unique1) from (select unique1 from tenk1 where unique1 < 15 order by unique1) ss;
+select array_agg(ten) from (select ten from tenk1 where unique1 < 15 order by unique1) ss;
+select array_agg(nullif(ten, 4)) from (select ten from tenk1 where unique1 < 15 order by unique1) ss;
+select array_agg(unique1) from tenk1 where unique1 < -15;
+
+-- array_agg(anyarray)
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3,4}'::int[])) v(ar);
+select array_agg(distinct ar order by ar desc)
+ from (select array[i / 2] from generate_series(1,10) a(i)) b(ar);
+select array_agg(ar)
+ from (select array_agg(array[i, i+1, i-1])
+ from generate_series(1,2) a(i)) b(ar);
+select array_agg(array[i+1.2, i+1.3, i+1.4]) from generate_series(1,3) g(i);
+select array_agg(array['Hello', i::text]) from generate_series(9,11) g(i);
+select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i);
+-- errors
+select array_agg('{}'::int[]) from generate_series(1,2);
+select array_agg(null::int[]) from generate_series(1,2);
+select array_agg(ar)
+ from (values ('{1,2}'::int[]), ('{3}'::int[])) v(ar);
+
+select unnest(array[1,2,3]);
+select * from unnest(array[1,2,3]);
+select unnest(array[1,2,3,4.5]::float8[]);
+select unnest(array[1,2,3,4.5]::numeric[]);
+select unnest(array[1,2,3,null,4,null,null,5,6]);
+select unnest(array[1,2,3,null,4,null,null,5,6]::text[]);
+select abs(unnest(array[1,2,null,-3]));
+select array_remove(array[1,2,2,3], 2);
+select array_remove(array[1,2,2,3], 5);
+select array_remove(array[1,NULL,NULL,3], NULL);
+select array_remove(array['A','CC','D','C','RR'], 'RR');
+select array_remove(array[1.0, 2.1, 3.3], 1);
+select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed
+select array_remove(array['X','X','X'], 'X') = '{}';
+select array_replace(array[1,2,5,4],5,3);
+select array_replace(array[1,2,5,4],5,NULL);
+select array_replace(array[1,2,NULL,4,NULL],NULL,5);
+select array_replace(array['A','B','DD','B'],'B','CC');
+select array_replace(array[1,NULL,3],NULL,NULL);
+select array_replace(array['AB',NULL,'CDE'],NULL,'12');
+
+-- array(select array-value ...)
+select array(select array[i,i/2] from generate_series(1,5) i);
+select array(select array['Hello', i::text] from generate_series(9,11) i);
+
+-- Insert/update on a column that is array of composite
+
+create temp table t1 (f1 int8_tbl[]);
+insert into t1 (f1[5].q1) values(42);
+select * from t1;
+update t1 set f1[5].q2 = 43;
+select * from t1;
+
+-- Check that arrays of composites are safely detoasted when needed
+
+create temp table src (f1 text);
+insert into src
+ select string_agg(random()::text,'') from generate_series(1,10000);
+create type textandtext as (c1 text, c2 text);
+create temp table dest (f1 textandtext[]);
+insert into dest select array[row(f1,f1)::textandtext] from src;
+select length(md5((f1[1]).c2)) from dest;
+delete from src;
+select length(md5((f1[1]).c2)) from dest;
+truncate table src;
+drop table src;
+select length(md5((f1[1]).c2)) from dest;
+drop table dest;
+drop type textandtext;
+
+-- 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);
+
+-- 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);
+
+-- 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;
+
+SELECT width_bucket(now(),
+ array['yesterday', 'today', 'tomorrow']::timestamptz[]);
+
+-- corner cases
+SELECT width_bucket(5, ARRAY[3]);
+SELECT width_bucket(5, '{}');
+
+-- error cases
+SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]);
+SELECT width_bucket(5, ARRAY[3, 4, NULL]);
+SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]);
+
+-- 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);
+
+SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail
+SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail
+SELECT trim_array(ARRAY[]::int[], 1); -- fail
diff --git a/yql/essentials/tests/postgresql/original/cases/bit.out b/yql/essentials/tests/postgresql/original/cases/bit.out
new file mode 100644
index 0000000000..a5aab9c0e3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/bit.out
@@ -0,0 +1,748 @@
+--
+-- BIT types
+--
+--
+-- Build tables for testing
+--
+CREATE TABLE BIT_TABLE(b BIT(11));
+INSERT INTO BIT_TABLE VALUES (B'10'); -- too short
+ERROR: bit string length 2 does not match type bit(11)
+INSERT INTO BIT_TABLE VALUES (B'00000000000');
+INSERT INTO BIT_TABLE VALUES (B'11011000000');
+INSERT INTO BIT_TABLE VALUES (B'01010101010');
+INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long
+ERROR: bit string length 12 does not match type bit(11)
+--INSERT INTO BIT_TABLE VALUES ('X554');
+--INSERT INTO BIT_TABLE VALUES ('X555');
+SELECT * FROM BIT_TABLE;
+ b
+-------------
+ 00000000000
+ 11011000000
+ 01010101010
+(3 rows)
+
+CREATE TABLE VARBIT_TABLE(v BIT VARYING(11));
+INSERT INTO VARBIT_TABLE VALUES (B'');
+INSERT INTO VARBIT_TABLE VALUES (B'0');
+INSERT INTO VARBIT_TABLE VALUES (B'010101');
+INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
+INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long
+ERROR: bit string too long for type bit varying(11)
+--INSERT INTO VARBIT_TABLE VALUES ('X554');
+--INSERT INTO VARBIT_TABLE VALUES ('X555');
+SELECT * FROM VARBIT_TABLE;
+ v
+-------------
+
+ 0
+ 010101
+ 01010101010
+(4 rows)
+
+-- Concatenation
+SELECT v, b, (v || b) AS concat
+ FROM BIT_TABLE, VARBIT_TABLE
+ ORDER BY 3;
+ v | b | concat
+-------------+-------------+------------------------
+ | 00000000000 | 00000000000
+ 0 | 00000000000 | 000000000000
+ 0 | 01010101010 | 001010101010
+ 010101 | 00000000000 | 01010100000000000
+ | 01010101010 | 01010101010
+ 01010101010 | 00000000000 | 0101010101000000000000
+ 01010101010 | 01010101010 | 0101010101001010101010
+ 010101 | 01010101010 | 01010101010101010
+ 01010101010 | 11011000000 | 0101010101011011000000
+ 010101 | 11011000000 | 01010111011000000
+ 0 | 11011000000 | 011011000000
+ | 11011000000 | 11011000000
+(12 rows)
+
+-- Length
+SELECT b, length(b) AS lb
+ FROM BIT_TABLE;
+ b | lb
+-------------+----
+ 00000000000 | 11
+ 11011000000 | 11
+ 01010101010 | 11
+(3 rows)
+
+SELECT v, length(v) AS lv
+ FROM VARBIT_TABLE;
+ v | lv
+-------------+----
+ | 0
+ 0 | 1
+ 010101 | 6
+ 01010101010 | 11
+(4 rows)
+
+-- Substring
+SELECT b,
+ SUBSTRING(b FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(b FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(b FROM 6) AS sub_6
+ FROM BIT_TABLE;
+ b | sub_2_4 | sub_7_13 | sub_6
+-------------+---------+----------+--------
+ 00000000000 | 0000 | 00000 | 000000
+ 11011000000 | 1011 | 00000 | 000000
+ 01010101010 | 1010 | 01010 | 101010
+(3 rows)
+
+SELECT v,
+ SUBSTRING(v FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(v FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(v FROM 6) AS sub_6
+ FROM VARBIT_TABLE;
+ v | sub_2_4 | sub_7_13 | sub_6
+-------------+---------+----------+--------
+ | | |
+ 0 | | |
+ 010101 | 1010 | | 1
+ 01010101010 | 1010 | 01010 | 101010
+(4 rows)
+
+-- test overflow cases
+SELECT SUBSTRING('01010101'::bit(8) FROM 2 FOR 2147483646) AS "1010101";
+ 1010101
+---------
+ 1010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR 2147483646) AS "01010101";
+ 01010101
+----------
+ 01010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+SELECT SUBSTRING('01010101'::varbit FROM 2 FOR 2147483646) AS "1010101";
+ 1010101
+---------
+ 1010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR 2147483646) AS "01010101";
+ 01010101
+----------
+ 01010101
+(1 row)
+
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+--- Bit operations
+DROP TABLE varbit_table;
+CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16));
+COPY varbit_table FROM stdin;
+SELECT a, b, ~a AS "~ a", a & b AS "a & b",
+ a | b AS "a | b", a # b AS "a # b" FROM varbit_table;
+ a | b | ~ a | a & b | a | b | a # b
+------------------+------------------+------------------+------------------+------------------+------------------
+ 00001111 | 00010000 | 11110000 | 00000000 | 00011111 | 00011111
+ 00011111 | 00010001 | 11100000 | 00010001 | 00011111 | 00001110
+ 00101111 | 00010010 | 11010000 | 00000010 | 00111111 | 00111101
+ 00111111 | 00010011 | 11000000 | 00010011 | 00111111 | 00101100
+ 10001111 | 00000100 | 01110000 | 00000100 | 10001111 | 10001011
+ 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111
+ 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100
+ 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000
+ 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111
+ 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001
+(10 rows)
+
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table;
+ a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b
+------------------+------------------+-----+------+-----+------+-----+------
+ 00001111 | 00010000 | t | t | f | f | f | t
+ 00011111 | 00010001 | f | f | f | t | t | t
+ 00101111 | 00010010 | f | f | f | t | t | t
+ 00111111 | 00010011 | f | f | f | t | t | t
+ 10001111 | 00000100 | f | f | f | t | t | t
+ 0000000000001111 | 0000000000010000 | t | t | f | f | f | t
+ 0000000100100011 | 1111111111111111 | t | t | f | f | f | t
+ 0010010001101000 | 0010010001101000 | f | t | t | t | f | f
+ 1111101001010000 | 0000010110101111 | f | f | f | t | t | t
+ 0001001000110100 | 1111111111110101 | t | t | f | f | f | t
+(10 rows)
+
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table;
+ a | a<<4 | b | b>>2
+------------------+------------------+------------------+------------------
+ 00001111 | 11110000 | 00010000 | 00000100
+ 00011111 | 11110000 | 00010001 | 00000100
+ 00101111 | 11110000 | 00010010 | 00000100
+ 00111111 | 11110000 | 00010011 | 00000100
+ 10001111 | 11110000 | 00000100 | 00000001
+ 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100
+ 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111
+ 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010
+ 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011
+ 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101
+(10 rows)
+
+DROP TABLE varbit_table;
+--- Bit operations
+DROP TABLE bit_table;
+CREATE TABLE bit_table (a BIT(16), b BIT(16));
+COPY bit_table FROM stdin;
+SELECT a,b,~a AS "~ a",a & b AS "a & b",
+ a|b AS "a | b", a # b AS "a # b" FROM bit_table;
+ a | b | ~ a | a & b | a | b | a # b
+------------------+------------------+------------------+------------------+------------------+------------------
+ 0000111100000000 | 0001000000000000 | 1111000011111111 | 0000000000000000 | 0001111100000000 | 0001111100000000
+ 0001111100000000 | 0001000100000000 | 1110000011111111 | 0001000100000000 | 0001111100000000 | 0000111000000000
+ 0010111100000000 | 0001001000000000 | 1101000011111111 | 0000001000000000 | 0011111100000000 | 0011110100000000
+ 0011111100000000 | 0001001100000000 | 1100000011111111 | 0001001100000000 | 0011111100000000 | 0010110000000000
+ 1000111100000000 | 0000010000000000 | 0111000011111111 | 0000010000000000 | 1000111100000000 | 1000101100000000
+ 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111
+ 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100
+ 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000
+ 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111
+ 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001
+(10 rows)
+
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table;
+ a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b
+------------------+------------------+-----+------+-----+------+-----+------
+ 0000111100000000 | 0001000000000000 | t | t | f | f | f | t
+ 0001111100000000 | 0001000100000000 | f | f | f | t | t | t
+ 0010111100000000 | 0001001000000000 | f | f | f | t | t | t
+ 0011111100000000 | 0001001100000000 | f | f | f | t | t | t
+ 1000111100000000 | 0000010000000000 | f | f | f | t | t | t
+ 0000000000001111 | 0000000000010000 | t | t | f | f | f | t
+ 0000000100100011 | 1111111111111111 | t | t | f | f | f | t
+ 0010010001101000 | 0010010001101000 | f | t | t | t | f | f
+ 1111101001010000 | 0000010110101111 | f | f | f | t | t | t
+ 0001001000110100 | 1111111111110101 | t | t | f | f | f | t
+(10 rows)
+
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table;
+ a | a<<4 | b | b>>2
+------------------+------------------+------------------+------------------
+ 0000111100000000 | 1111000000000000 | 0001000000000000 | 0000010000000000
+ 0001111100000000 | 1111000000000000 | 0001000100000000 | 0000010001000000
+ 0010111100000000 | 1111000000000000 | 0001001000000000 | 0000010010000000
+ 0011111100000000 | 1111000000000000 | 0001001100000000 | 0000010011000000
+ 1000111100000000 | 1111000000000000 | 0000010000000000 | 0000000100000000
+ 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100
+ 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111
+ 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010
+ 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011
+ 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101
+(10 rows)
+
+DROP TABLE bit_table;
+-- The following should fail
+select B'001' & B'10';
+ERROR: cannot AND bit strings of different sizes
+select B'0111' | B'011';
+ERROR: cannot OR bit strings of different sizes
+select B'0010' # B'011101';
+ERROR: cannot XOR bit strings of different sizes
+-- More position tests, checking all the boundary cases
+SELECT POSITION(B'1010' IN B'0000101'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'1010' IN B'00001010'); -- 5
+ position
+----------
+ 5
+(1 row)
+
+SELECT POSITION(B'1010' IN B'00000101'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'1010' IN B'000001010'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'' IN B'00001010'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'0' IN B''); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'' IN B''); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3
+ position
+----------
+ 3
+(1 row)
+
+SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5
+ position
+----------
+ 5
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'11101011'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'011101011'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'00011101011'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'11101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+ position
+----------
+ 4
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+ position
+----------
+ 6
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14
+ position
+----------
+ 14
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15
+ position
+----------
+ 15
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17
+ position
+----------
+ 17
+(1 row)
+
+SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19
+ position
+----------
+ 19
+(1 row)
+
+SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1
+ position
+----------
+ 1
+(1 row)
+
+SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2
+ position
+----------
+ 2
+(1 row)
+
+SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0
+ position
+----------
+ 0
+(1 row)
+
+-- Shifting
+CREATE TABLE BIT_SHIFT_TABLE(b BIT(16));
+INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000');
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE;
+SELECT POSITION(B'1101' IN b),
+ POSITION(B'11011' IN b),
+ b
+ FROM BIT_SHIFT_TABLE ;
+ position | position | b
+----------+----------+------------------
+ 1 | 1 | 1101100000000000
+ 2 | 2 | 0110110000000000
+ 3 | 3 | 0011011000000000
+ 4 | 4 | 0001101100000000
+ 5 | 5 | 0000110110000000
+ 6 | 6 | 0000011011000000
+ 7 | 7 | 0000001101100000
+ 8 | 8 | 0000000110110000
+ 9 | 9 | 0000000011011000
+ 10 | 10 | 0000000001101100
+ 11 | 11 | 0000000000110110
+ 12 | 12 | 0000000000011011
+ 13 | 0 | 0000000000001101
+ 0 | 0 | 0000000000000110
+ 0 | 0 | 0000000000000011
+ 0 | 0 | 0000000000000001
+(16 rows)
+
+SELECT b, b >> 1 AS bsr, b << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr | bsl
+------------------+------------------+------------------
+ 1101100000000000 | 0110110000000000 | 1011000000000000
+ 0110110000000000 | 0011011000000000 | 1101100000000000
+ 0011011000000000 | 0001101100000000 | 0110110000000000
+ 0001101100000000 | 0000110110000000 | 0011011000000000
+ 0000110110000000 | 0000011011000000 | 0001101100000000
+ 0000011011000000 | 0000001101100000 | 0000110110000000
+ 0000001101100000 | 0000000110110000 | 0000011011000000
+ 0000000110110000 | 0000000011011000 | 0000001101100000
+ 0000000011011000 | 0000000001101100 | 0000000110110000
+ 0000000001101100 | 0000000000110110 | 0000000011011000
+ 0000000000110110 | 0000000000011011 | 0000000001101100
+ 0000000000011011 | 0000000000001101 | 0000000000110110
+ 0000000000001101 | 0000000000000110 | 0000000000011010
+ 0000000000000110 | 0000000000000011 | 0000000000001100
+ 0000000000000011 | 0000000000000001 | 0000000000000110
+ 0000000000000001 | 0000000000000000 | 0000000000000010
+(16 rows)
+
+SELECT b, b >> 8 AS bsr8, b << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr8 | bsl8
+------------------+------------------+------------------
+ 1101100000000000 | 0000000011011000 | 0000000000000000
+ 0110110000000000 | 0000000001101100 | 0000000000000000
+ 0011011000000000 | 0000000000110110 | 0000000000000000
+ 0001101100000000 | 0000000000011011 | 0000000000000000
+ 0000110110000000 | 0000000000001101 | 1000000000000000
+ 0000011011000000 | 0000000000000110 | 1100000000000000
+ 0000001101100000 | 0000000000000011 | 0110000000000000
+ 0000000110110000 | 0000000000000001 | 1011000000000000
+ 0000000011011000 | 0000000000000000 | 1101100000000000
+ 0000000001101100 | 0000000000000000 | 0110110000000000
+ 0000000000110110 | 0000000000000000 | 0011011000000000
+ 0000000000011011 | 0000000000000000 | 0001101100000000
+ 0000000000001101 | 0000000000000000 | 0000110100000000
+ 0000000000000110 | 0000000000000000 | 0000011000000000
+ 0000000000000011 | 0000000000000000 | 0000001100000000
+ 0000000000000001 | 0000000000000000 | 0000000100000000
+(16 rows)
+
+SELECT b::bit(15), b::bit(15) >> 1 AS bsr, b::bit(15) << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr | bsl
+-----------------+-----------------+-----------------
+ 110110000000000 | 011011000000000 | 101100000000000
+ 011011000000000 | 001101100000000 | 110110000000000
+ 001101100000000 | 000110110000000 | 011011000000000
+ 000110110000000 | 000011011000000 | 001101100000000
+ 000011011000000 | 000001101100000 | 000110110000000
+ 000001101100000 | 000000110110000 | 000011011000000
+ 000000110110000 | 000000011011000 | 000001101100000
+ 000000011011000 | 000000001101100 | 000000110110000
+ 000000001101100 | 000000000110110 | 000000011011000
+ 000000000110110 | 000000000011011 | 000000001101100
+ 000000000011011 | 000000000001101 | 000000000110110
+ 000000000001101 | 000000000000110 | 000000000011010
+ 000000000000110 | 000000000000011 | 000000000001100
+ 000000000000011 | 000000000000001 | 000000000000110
+ 000000000000001 | 000000000000000 | 000000000000010
+ 000000000000000 | 000000000000000 | 000000000000000
+(16 rows)
+
+SELECT b::bit(15), b::bit(15) >> 8 AS bsr8, b::bit(15) << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+ b | bsr8 | bsl8
+-----------------+-----------------+-----------------
+ 110110000000000 | 000000001101100 | 000000000000000
+ 011011000000000 | 000000000110110 | 000000000000000
+ 001101100000000 | 000000000011011 | 000000000000000
+ 000110110000000 | 000000000001101 | 000000000000000
+ 000011011000000 | 000000000000110 | 100000000000000
+ 000001101100000 | 000000000000011 | 110000000000000
+ 000000110110000 | 000000000000001 | 011000000000000
+ 000000011011000 | 000000000000000 | 101100000000000
+ 000000001101100 | 000000000000000 | 110110000000000
+ 000000000110110 | 000000000000000 | 011011000000000
+ 000000000011011 | 000000000000000 | 001101100000000
+ 000000000001101 | 000000000000000 | 000110100000000
+ 000000000000110 | 000000000000000 | 000011000000000
+ 000000000000011 | 000000000000000 | 000001100000000
+ 000000000000001 | 000000000000000 | 000000100000000
+ 000000000000000 | 000000000000000 | 000000000000000
+(16 rows)
+
+CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20));
+INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011');
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE;
+SELECT POSITION(B'1101' IN v),
+ POSITION(B'11011' IN v),
+ v
+ FROM VARBIT_SHIFT_TABLE ;
+ position | position | v
+----------+----------+----------------------
+ 1 | 1 | 11011
+ 2 | 2 | 011011
+ 3 | 3 | 0011011
+ 4 | 4 | 00011011
+ 5 | 5 | 000011011
+ 6 | 6 | 0000011011
+ 7 | 7 | 00000011011
+ 8 | 8 | 000000011011
+ 9 | 9 | 0000000011011
+ 10 | 10 | 00000000011011
+ 11 | 11 | 000000000011011
+ 12 | 12 | 0000000000011011
+ 13 | 13 | 00000000000011011
+ 14 | 14 | 000000000000011011
+ 15 | 15 | 0000000000000011011
+ 16 | 16 | 00000000000000011011
+(16 rows)
+
+SELECT v, v >> 1 AS vsr, v << 1 AS vsl
+ FROM VARBIT_SHIFT_TABLE ;
+ v | vsr | vsl
+----------------------+----------------------+----------------------
+ 11011 | 01101 | 10110
+ 011011 | 001101 | 110110
+ 0011011 | 0001101 | 0110110
+ 00011011 | 00001101 | 00110110
+ 000011011 | 000001101 | 000110110
+ 0000011011 | 0000001101 | 0000110110
+ 00000011011 | 00000001101 | 00000110110
+ 000000011011 | 000000001101 | 000000110110
+ 0000000011011 | 0000000001101 | 0000000110110
+ 00000000011011 | 00000000001101 | 00000000110110
+ 000000000011011 | 000000000001101 | 000000000110110
+ 0000000000011011 | 0000000000001101 | 0000000000110110
+ 00000000000011011 | 00000000000001101 | 00000000000110110
+ 000000000000011011 | 000000000000001101 | 000000000000110110
+ 0000000000000011011 | 0000000000000001101 | 0000000000000110110
+ 00000000000000011011 | 00000000000000001101 | 00000000000000110110
+(16 rows)
+
+SELECT v, v >> 8 AS vsr8, v << 8 AS vsl8
+ FROM VARBIT_SHIFT_TABLE ;
+ v | vsr8 | vsl8
+----------------------+----------------------+----------------------
+ 11011 | 00000 | 00000
+ 011011 | 000000 | 000000
+ 0011011 | 0000000 | 0000000
+ 00011011 | 00000000 | 00000000
+ 000011011 | 000000000 | 100000000
+ 0000011011 | 0000000000 | 1100000000
+ 00000011011 | 00000000000 | 01100000000
+ 000000011011 | 000000000000 | 101100000000
+ 0000000011011 | 0000000000000 | 1101100000000
+ 00000000011011 | 00000000000000 | 01101100000000
+ 000000000011011 | 000000000000000 | 001101100000000
+ 0000000000011011 | 0000000000000000 | 0001101100000000
+ 00000000000011011 | 00000000000000000 | 00001101100000000
+ 000000000000011011 | 000000000000000000 | 000001101100000000
+ 0000000000000011011 | 0000000000000000000 | 0000001101100000000
+ 00000000000000011011 | 00000000000000000000 | 00000001101100000000
+(16 rows)
+
+DROP TABLE BIT_SHIFT_TABLE;
+DROP TABLE VARBIT_SHIFT_TABLE;
+-- Get/Set bit
+SELECT get_bit(B'0101011000100', 10);
+ get_bit
+---------
+ 1
+(1 row)
+
+SELECT set_bit(B'0101011000100100', 15, 1);
+ set_bit
+------------------
+ 0101011000100101
+(1 row)
+
+SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+ERROR: bit index 16 out of valid range (0..15)
+-- Overlay
+SELECT overlay(B'0101011100' placing '001' from 2 for 3);
+ overlay
+------------
+ 0001011100
+(1 row)
+
+SELECT overlay(B'0101011100' placing '101' from 6);
+ overlay
+------------
+ 0101010100
+(1 row)
+
+SELECT overlay(B'0101011100' placing '001' from 11);
+ overlay
+---------------
+ 0101011100001
+(1 row)
+
+SELECT overlay(B'0101011100' placing '001' from 20);
+ overlay
+---------------
+ 0101011100001
+(1 row)
+
+-- bit_count
+SELECT bit_count(B'0101011100'::bit(10));
+ bit_count
+-----------
+ 5
+(1 row)
+
+SELECT bit_count(B'1111111111'::bit(10));
+ bit_count
+-----------
+ 10
+(1 row)
+
+-- This table is intentionally left around to exercise pg_dump/pg_upgrade
+CREATE TABLE bit_defaults(
+ b1 bit(4) DEFAULT '1001',
+ b2 bit(4) DEFAULT B'0101',
+ b3 bit varying(5) DEFAULT '1001',
+ b4 bit varying(5) DEFAULT B'0101'
+);
+\d bit_defaults
+ Table "public.bit_defaults"
+ Column | Type | Collation | Nullable | Default
+--------+----------------+-----------+----------+---------------------
+ b1 | bit(4) | | | '1001'::"bit"
+ b2 | bit(4) | | | '0101'::"bit"
+ b3 | bit varying(5) | | | '1001'::bit varying
+ b4 | bit varying(5) | | | '0101'::"bit"
+
+INSERT INTO bit_defaults DEFAULT VALUES;
+TABLE bit_defaults;
+ b1 | b2 | b3 | b4
+------+------+------+------
+ 1001 | 0101 | 1001 | 0101
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/bit.sql b/yql/essentials/tests/postgresql/original/cases/bit.sql
new file mode 100644
index 0000000000..0a424e796b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/bit.sql
@@ -0,0 +1,231 @@
+--
+-- BIT types
+--
+
+--
+-- Build tables for testing
+--
+
+CREATE TABLE BIT_TABLE(b BIT(11));
+
+INSERT INTO BIT_TABLE VALUES (B'10'); -- too short
+INSERT INTO BIT_TABLE VALUES (B'00000000000');
+INSERT INTO BIT_TABLE VALUES (B'11011000000');
+INSERT INTO BIT_TABLE VALUES (B'01010101010');
+INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long
+--INSERT INTO BIT_TABLE VALUES ('X554');
+--INSERT INTO BIT_TABLE VALUES ('X555');
+
+SELECT * FROM BIT_TABLE;
+
+CREATE TABLE VARBIT_TABLE(v BIT VARYING(11));
+
+INSERT INTO VARBIT_TABLE VALUES (B'');
+INSERT INTO VARBIT_TABLE VALUES (B'0');
+INSERT INTO VARBIT_TABLE VALUES (B'010101');
+INSERT INTO VARBIT_TABLE VALUES (B'01010101010');
+INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long
+--INSERT INTO VARBIT_TABLE VALUES ('X554');
+--INSERT INTO VARBIT_TABLE VALUES ('X555');
+SELECT * FROM VARBIT_TABLE;
+
+
+-- Concatenation
+SELECT v, b, (v || b) AS concat
+ FROM BIT_TABLE, VARBIT_TABLE
+ ORDER BY 3;
+
+-- Length
+SELECT b, length(b) AS lb
+ FROM BIT_TABLE;
+SELECT v, length(v) AS lv
+ FROM VARBIT_TABLE;
+
+-- Substring
+SELECT b,
+ SUBSTRING(b FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(b FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(b FROM 6) AS sub_6
+ FROM BIT_TABLE;
+SELECT v,
+ SUBSTRING(v FROM 2 FOR 4) AS sub_2_4,
+ SUBSTRING(v FROM 7 FOR 13) AS sub_7_13,
+ SUBSTRING(v FROM 6) AS sub_6
+ FROM VARBIT_TABLE;
+
+-- test overflow cases
+SELECT SUBSTRING('01010101'::bit(8) FROM 2 FOR 2147483646) AS "1010101";
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR 2147483646) AS "01010101";
+SELECT SUBSTRING('01010101'::bit(8) FROM -10 FOR -2147483646) AS "error";
+SELECT SUBSTRING('01010101'::varbit FROM 2 FOR 2147483646) AS "1010101";
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR 2147483646) AS "01010101";
+SELECT SUBSTRING('01010101'::varbit FROM -10 FOR -2147483646) AS "error";
+
+--- Bit operations
+DROP TABLE varbit_table;
+CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16));
+COPY varbit_table FROM stdin;
+X0F X10
+X1F X11
+X2F X12
+X3F X13
+X8F X04
+X000F X0010
+X0123 XFFFF
+X2468 X2468
+XFA50 X05AF
+X1234 XFFF5
+\.
+
+SELECT a, b, ~a AS "~ a", a & b AS "a & b",
+ a | b AS "a | b", a # b AS "a # b" FROM varbit_table;
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table;
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table;
+
+DROP TABLE varbit_table;
+
+--- Bit operations
+DROP TABLE bit_table;
+CREATE TABLE bit_table (a BIT(16), b BIT(16));
+COPY bit_table FROM stdin;
+X0F00 X1000
+X1F00 X1100
+X2F00 X1200
+X3F00 X1300
+X8F00 X0400
+X000F X0010
+X0123 XFFFF
+X2468 X2468
+XFA50 X05AF
+X1234 XFFF5
+\.
+
+SELECT a,b,~a AS "~ a",a & b AS "a & b",
+ a|b AS "a | b", a # b AS "a # b" FROM bit_table;
+SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b",
+ a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table;
+SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table;
+
+DROP TABLE bit_table;
+
+
+-- The following should fail
+select B'001' & B'10';
+select B'0111' | B'011';
+select B'0010' # B'011101';
+
+-- More position tests, checking all the boundary cases
+SELECT POSITION(B'1010' IN B'0000101'); -- 0
+SELECT POSITION(B'1010' IN B'00001010'); -- 5
+SELECT POSITION(B'1010' IN B'00000101'); -- 0
+SELECT POSITION(B'1010' IN B'000001010'); -- 6
+
+SELECT POSITION(B'' IN B'00001010'); -- 1
+SELECT POSITION(B'0' IN B''); -- 0
+SELECT POSITION(B'' IN B''); -- 0
+SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3
+SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3
+SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3
+SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5
+
+SELECT POSITION(B'11101011' IN B'11101011'); -- 1
+SELECT POSITION(B'11101011' IN B'011101011'); -- 2
+SELECT POSITION(B'11101011' IN B'00011101011'); -- 4
+SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+
+SELECT POSITION(B'111010110' IN B'11101011'); -- 0
+SELECT POSITION(B'111010110' IN B'011101011'); -- 0
+SELECT POSITION(B'111010110' IN B'00011101011'); -- 0
+SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0
+
+SELECT POSITION(B'111010110' IN B'111010110'); -- 1
+SELECT POSITION(B'111010110' IN B'0111010110'); -- 2
+SELECT POSITION(B'111010110' IN B'000111010110'); -- 4
+SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6
+
+SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0
+SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0
+
+SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14
+SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15
+SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17
+SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19
+
+SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1
+SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2
+SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0
+
+
+-- Shifting
+
+CREATE TABLE BIT_SHIFT_TABLE(b BIT(16));
+INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000');
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE;
+INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE;
+SELECT POSITION(B'1101' IN b),
+ POSITION(B'11011' IN b),
+ b
+ FROM BIT_SHIFT_TABLE ;
+SELECT b, b >> 1 AS bsr, b << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+SELECT b, b >> 8 AS bsr8, b << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+SELECT b::bit(15), b::bit(15) >> 1 AS bsr, b::bit(15) << 1 AS bsl
+ FROM BIT_SHIFT_TABLE ;
+SELECT b::bit(15), b::bit(15) >> 8 AS bsr8, b::bit(15) << 8 AS bsl8
+ FROM BIT_SHIFT_TABLE ;
+
+
+CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20));
+INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011');
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE;
+INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE;
+SELECT POSITION(B'1101' IN v),
+ POSITION(B'11011' IN v),
+ v
+ FROM VARBIT_SHIFT_TABLE ;
+SELECT v, v >> 1 AS vsr, v << 1 AS vsl
+ FROM VARBIT_SHIFT_TABLE ;
+SELECT v, v >> 8 AS vsr8, v << 8 AS vsl8
+ FROM VARBIT_SHIFT_TABLE ;
+
+DROP TABLE BIT_SHIFT_TABLE;
+DROP TABLE VARBIT_SHIFT_TABLE;
+
+-- Get/Set bit
+SELECT get_bit(B'0101011000100', 10);
+SELECT set_bit(B'0101011000100100', 15, 1);
+SELECT set_bit(B'0101011000100100', 16, 1); -- fail
+
+-- Overlay
+SELECT overlay(B'0101011100' placing '001' from 2 for 3);
+SELECT overlay(B'0101011100' placing '101' from 6);
+SELECT overlay(B'0101011100' placing '001' from 11);
+SELECT overlay(B'0101011100' placing '001' from 20);
+
+-- bit_count
+SELECT bit_count(B'0101011100'::bit(10));
+SELECT bit_count(B'1111111111'::bit(10));
+
+-- This table is intentionally left around to exercise pg_dump/pg_upgrade
+CREATE TABLE bit_defaults(
+ b1 bit(4) DEFAULT '1001',
+ b2 bit(4) DEFAULT B'0101',
+ b3 bit varying(5) DEFAULT '1001',
+ b4 bit varying(5) DEFAULT B'0101'
+);
+\d bit_defaults
+INSERT INTO bit_defaults DEFAULT VALUES;
+TABLE bit_defaults;
diff --git a/yql/essentials/tests/postgresql/original/cases/boolean.out b/yql/essentials/tests/postgresql/original/cases/boolean.out
new file mode 100644
index 0000000000..4728fe2dfd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/boolean.out
@@ -0,0 +1,559 @@
+--
+-- BOOLEAN
+--
+--
+-- sanity check - if this fails go insane!
+--
+SELECT 1 AS one;
+ one
+-----
+ 1
+(1 row)
+
+-- ******************testing built-in type bool********************
+-- check bool input syntax
+SELECT true AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT false AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool ' f ' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'true' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'test' AS error;
+ERROR: invalid input syntax for type boolean: "test"
+LINE 1: SELECT bool 'test' AS error;
+ ^
+SELECT bool 'false' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'foo' AS error;
+ERROR: invalid input syntax for type boolean: "foo"
+LINE 1: SELECT bool 'foo' AS error;
+ ^
+SELECT bool 'y' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'yes' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'yeah' AS error;
+ERROR: invalid input syntax for type boolean: "yeah"
+LINE 1: SELECT bool 'yeah' AS error;
+ ^
+SELECT bool 'n' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'no' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'nay' AS error;
+ERROR: invalid input syntax for type boolean: "nay"
+LINE 1: SELECT bool 'nay' AS error;
+ ^
+SELECT bool 'on' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'off' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'of' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 'o' AS error;
+ERROR: invalid input syntax for type boolean: "o"
+LINE 1: SELECT bool 'o' AS error;
+ ^
+SELECT bool 'on_' AS error;
+ERROR: invalid input syntax for type boolean: "on_"
+LINE 1: SELECT bool 'on_' AS error;
+ ^
+SELECT bool 'off_' AS error;
+ERROR: invalid input syntax for type boolean: "off_"
+LINE 1: SELECT bool 'off_' AS error;
+ ^
+SELECT bool '1' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool '11' AS error;
+ERROR: invalid input syntax for type boolean: "11"
+LINE 1: SELECT bool '11' AS error;
+ ^
+SELECT bool '0' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool '000' AS error;
+ERROR: invalid input syntax for type boolean: "000"
+LINE 1: SELECT bool '000' AS error;
+ ^
+SELECT bool '' AS error;
+ERROR: invalid input syntax for type boolean: ""
+LINE 1: SELECT bool '' AS error;
+ ^
+-- and, or, not in qualifications
+SELECT bool 't' or bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' and bool 'f' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT not bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' = bool 'f' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT bool 't' <> bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' > bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 't' >= bool 'f' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'f' < bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT bool 'f' <= bool 't' AS true;
+ true
+------
+ t
+(1 row)
+
+-- explicit casts to/from text
+SELECT 'TrUe'::text::boolean AS true, 'fAlse'::text::boolean AS false;
+ true | false
+------+-------
+ t | f
+(1 row)
+
+SELECT ' true '::text::boolean AS true,
+ ' FALSE'::text::boolean AS false;
+ true | false
+------+-------
+ t | f
+(1 row)
+
+SELECT true::boolean::text AS true, false::boolean::text AS false;
+ true | false
+------+-------
+ true | false
+(1 row)
+
+SELECT ' tru e '::text::boolean AS invalid; -- error
+ERROR: invalid input syntax for type boolean: " tru e "
+SELECT ''::text::boolean AS invalid; -- error
+ERROR: invalid input syntax for type boolean: ""
+CREATE TABLE BOOLTBL1 (f1 bool);
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 't');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'True');
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'true');
+-- BOOLTBL1 should be full of true's at this point
+SELECT BOOLTBL1.* FROM BOOLTBL1;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'true';
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 <> bool 'false';
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE booleq(bool 'false', f1);
+ f1
+----
+(0 rows)
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'f');
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'false';
+ f1
+----
+ f
+(1 row)
+
+CREATE TABLE BOOLTBL2 (f1 bool);
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'f');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'false');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False');
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
+-- This is now an invalid expression
+-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
+INSERT INTO BOOLTBL2 (f1)
+ VALUES (bool 'XXX');
+ERROR: invalid input syntax for type boolean: "XXX"
+LINE 2: VALUES (bool 'XXX');
+ ^
+-- BOOLTBL2 should be full of false's at this point
+SELECT BOOLTBL2.* FROM BOOLTBL2;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 <> BOOLTBL1.f1;
+ f1 | f1
+----+----
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+(12 rows)
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE boolne(BOOLTBL2.f1,BOOLTBL1.f1);
+ f1 | f1
+----+----
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+(12 rows)
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 and BOOLTBL1.f1 = bool 'false';
+ f1 | f1
+----+----
+ f | f
+ f | f
+ f | f
+ f | f
+(4 rows)
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 or BOOLTBL1.f1 = bool 'true'
+ ORDER BY BOOLTBL1.f1, BOOLTBL2.f1;
+ f1 | f1
+----+----
+ f | f
+ f | f
+ f | f
+ f | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+ t | f
+(16 rows)
+
+--
+-- SQL syntax
+-- Try all combinations to ensure that we get nothing when we expect nothing
+-- - thomas 2000-01-04
+--
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS TRUE;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT FALSE;
+ f1
+----
+ t
+ t
+ t
+(3 rows)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS FALSE;
+ f1
+----
+ f
+(1 row)
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT TRUE;
+ f1
+----
+ f
+(1 row)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS TRUE;
+ f1
+----
+(0 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT FALSE;
+ f1
+----
+(0 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS FALSE;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT TRUE;
+ f1
+----
+ f
+ f
+ f
+ f
+(4 rows)
+
+--
+-- Tests for BooleanTest
+--
+CREATE TABLE BOOLTBL3 (d text, b bool, o int);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('true', true, 1);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('false', false, 2);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
+SELECT
+ d,
+ b IS TRUE AS istrue,
+ b IS NOT TRUE AS isnottrue,
+ b IS FALSE AS isfalse,
+ b IS NOT FALSE AS isnotfalse,
+ b IS UNKNOWN AS isunknown,
+ b IS NOT UNKNOWN AS isnotunknown
+FROM booltbl3 ORDER BY o;
+ d | istrue | isnottrue | isfalse | isnotfalse | isunknown | isnotunknown
+-------+--------+-----------+---------+------------+-----------+--------------
+ true | t | f | f | t | f | t
+ false | f | t | t | f | f | t
+ null | f | t | f | t | t | f
+(3 rows)
+
+-- Test to make sure short-circuiting and NULL handling is
+-- correct. Use a table as source to prevent constant simplification
+-- to interfer.
+CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+INSERT INTO booltbl4 VALUES (false, true, null);
+\pset null '(null)'
+-- AND expression need to return null if there's any nulls and not all
+-- of the value are true
+SELECT istrue AND isnul AND istrue FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT istrue AND istrue AND isnul FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isnul AND istrue AND istrue FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+-- OR expression need to return null if there's any nulls and none
+-- of the value is true
+SELECT isfalse OR isnul OR isfalse FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse OR isfalse OR isnul FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+ ?column?
+----------
+ (null)
+(1 row)
+
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Clean up
+-- Many tables are retained by the regression test, but these do not seem
+-- particularly useful so just get rid of them for now.
+-- - thomas 1997-11-30
+--
+DROP TABLE BOOLTBL1;
+DROP TABLE BOOLTBL2;
+DROP TABLE BOOLTBL3;
+DROP TABLE BOOLTBL4;
diff --git a/yql/essentials/tests/postgresql/original/cases/boolean.sql b/yql/essentials/tests/postgresql/original/cases/boolean.sql
new file mode 100644
index 0000000000..4dd47aaf9d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/boolean.sql
@@ -0,0 +1,262 @@
+--
+-- BOOLEAN
+--
+
+--
+-- sanity check - if this fails go insane!
+--
+SELECT 1 AS one;
+
+
+-- ******************testing built-in type bool********************
+
+-- check bool input syntax
+
+SELECT true AS true;
+
+SELECT false AS false;
+
+SELECT bool 't' AS true;
+
+SELECT bool ' f ' AS false;
+
+SELECT bool 'true' AS true;
+
+SELECT bool 'test' AS error;
+
+SELECT bool 'false' AS false;
+
+SELECT bool 'foo' AS error;
+
+SELECT bool 'y' AS true;
+
+SELECT bool 'yes' AS true;
+
+SELECT bool 'yeah' AS error;
+
+SELECT bool 'n' AS false;
+
+SELECT bool 'no' AS false;
+
+SELECT bool 'nay' AS error;
+
+SELECT bool 'on' AS true;
+
+SELECT bool 'off' AS false;
+
+SELECT bool 'of' AS false;
+
+SELECT bool 'o' AS error;
+
+SELECT bool 'on_' AS error;
+
+SELECT bool 'off_' AS error;
+
+SELECT bool '1' AS true;
+
+SELECT bool '11' AS error;
+
+SELECT bool '0' AS false;
+
+SELECT bool '000' AS error;
+
+SELECT bool '' AS error;
+
+-- and, or, not in qualifications
+
+SELECT bool 't' or bool 'f' AS true;
+
+SELECT bool 't' and bool 'f' AS false;
+
+SELECT not bool 'f' AS true;
+
+SELECT bool 't' = bool 'f' AS false;
+
+SELECT bool 't' <> bool 'f' AS true;
+
+SELECT bool 't' > bool 'f' AS true;
+
+SELECT bool 't' >= bool 'f' AS true;
+
+SELECT bool 'f' < bool 't' AS true;
+
+SELECT bool 'f' <= bool 't' AS true;
+
+-- explicit casts to/from text
+SELECT 'TrUe'::text::boolean AS true, 'fAlse'::text::boolean AS false;
+SELECT ' true '::text::boolean AS true,
+ ' FALSE'::text::boolean AS false;
+SELECT true::boolean::text AS true, false::boolean::text AS false;
+
+SELECT ' tru e '::text::boolean AS invalid; -- error
+SELECT ''::text::boolean AS invalid; -- error
+
+CREATE TABLE BOOLTBL1 (f1 bool);
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 't');
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'True');
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'true');
+
+
+-- BOOLTBL1 should be full of true's at this point
+SELECT BOOLTBL1.* FROM BOOLTBL1;
+
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'true';
+
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 <> bool 'false';
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE booleq(bool 'false', f1);
+
+INSERT INTO BOOLTBL1 (f1) VALUES (bool 'f');
+
+SELECT BOOLTBL1.*
+ FROM BOOLTBL1
+ WHERE f1 = bool 'false';
+
+
+CREATE TABLE BOOLTBL2 (f1 bool);
+
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'f');
+
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'false');
+
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False');
+
+INSERT INTO BOOLTBL2 (f1) VALUES (bool 'FALSE');
+
+-- This is now an invalid expression
+-- For pre-v6.3 this evaluated to false - thomas 1997-10-23
+INSERT INTO BOOLTBL2 (f1)
+ VALUES (bool 'XXX');
+
+-- BOOLTBL2 should be full of false's at this point
+SELECT BOOLTBL2.* FROM BOOLTBL2;
+
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 <> BOOLTBL1.f1;
+
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE boolne(BOOLTBL2.f1,BOOLTBL1.f1);
+
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 and BOOLTBL1.f1 = bool 'false';
+
+
+SELECT BOOLTBL1.*, BOOLTBL2.*
+ FROM BOOLTBL1, BOOLTBL2
+ WHERE BOOLTBL2.f1 = BOOLTBL1.f1 or BOOLTBL1.f1 = bool 'true'
+ ORDER BY BOOLTBL1.f1, BOOLTBL2.f1;
+
+--
+-- SQL syntax
+-- Try all combinations to ensure that we get nothing when we expect nothing
+-- - thomas 2000-01-04
+--
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS TRUE;
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT FALSE;
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS FALSE;
+
+SELECT f1
+ FROM BOOLTBL1
+ WHERE f1 IS NOT TRUE;
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS TRUE;
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT FALSE;
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS FALSE;
+
+SELECT f1
+ FROM BOOLTBL2
+ WHERE f1 IS NOT TRUE;
+
+--
+-- Tests for BooleanTest
+--
+CREATE TABLE BOOLTBL3 (d text, b bool, o int);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('true', true, 1);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('false', false, 2);
+INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
+
+SELECT
+ d,
+ b IS TRUE AS istrue,
+ b IS NOT TRUE AS isnottrue,
+ b IS FALSE AS isfalse,
+ b IS NOT FALSE AS isnotfalse,
+ b IS UNKNOWN AS isunknown,
+ b IS NOT UNKNOWN AS isnotunknown
+FROM booltbl3 ORDER BY o;
+
+
+-- Test to make sure short-circuiting and NULL handling is
+-- correct. Use a table as source to prevent constant simplification
+-- to interfer.
+CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+INSERT INTO booltbl4 VALUES (false, true, null);
+\pset null '(null)'
+
+-- AND expression need to return null if there's any nulls and not all
+-- of the value are true
+SELECT istrue AND isnul AND istrue FROM booltbl4;
+SELECT istrue AND istrue AND isnul FROM booltbl4;
+SELECT isnul AND istrue AND istrue FROM booltbl4;
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+
+-- OR expression need to return null if there's any nulls and none
+-- of the value is true
+SELECT isfalse OR isnul OR isfalse FROM booltbl4;
+SELECT isfalse OR isfalse OR isnul FROM booltbl4;
+SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+
+
+--
+-- Clean up
+-- Many tables are retained by the regression test, but these do not seem
+-- particularly useful so just get rid of them for now.
+-- - thomas 1997-11-30
+--
+
+DROP TABLE BOOLTBL1;
+
+DROP TABLE BOOLTBL2;
+
+DROP TABLE BOOLTBL3;
+
+DROP TABLE BOOLTBL4;
diff --git a/yql/essentials/tests/postgresql/original/cases/case.out b/yql/essentials/tests/postgresql/original/cases/case.out
new file mode 100644
index 0000000000..f5136c17ab
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/case.out
@@ -0,0 +1,419 @@
+--
+-- CASE
+-- Test the case statement
+--
+CREATE TABLE CASE_TBL (
+ i integer,
+ f double precision
+);
+CREATE TABLE CASE2_TBL (
+ i integer,
+ j integer
+);
+INSERT INTO CASE_TBL VALUES (1, 10.1);
+INSERT INTO CASE_TBL VALUES (2, 20.2);
+INSERT INTO CASE_TBL VALUES (3, -30.3);
+INSERT INTO CASE_TBL VALUES (4, NULL);
+INSERT INTO CASE2_TBL VALUES (1, -1);
+INSERT INTO CASE2_TBL VALUES (2, -2);
+INSERT INTO CASE2_TBL VALUES (3, -3);
+INSERT INTO CASE2_TBL VALUES (2, -4);
+INSERT INTO CASE2_TBL VALUES (1, NULL);
+INSERT INTO CASE2_TBL VALUES (NULL, -6);
+--
+-- Simplest examples without tables
+--
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ END AS "Simple WHEN";
+ One | Simple WHEN
+-----+-------------
+ 3 | 3
+(1 row)
+
+SELECT '<NULL>' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ END AS "Simple default";
+ One | Simple default
+--------+----------------
+ <NULL> |
+(1 row)
+
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ ELSE 4
+ END AS "Simple ELSE";
+ One | Simple ELSE
+-----+-------------
+ 3 | 3
+(1 row)
+
+SELECT '4' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ ELSE 4
+ END AS "ELSE default";
+ One | ELSE default
+-----+--------------
+ 4 | 4
+(1 row)
+
+SELECT '6' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ WHEN 4 < 5 THEN 6
+ ELSE 7
+ END AS "Two WHEN with default";
+ One | Two WHEN with default
+-----+-----------------------
+ 6 | 6
+(1 row)
+
+SELECT '7' AS "None",
+ CASE WHEN random() < 0 THEN 1
+ END AS "NULL on no matches";
+ None | NULL on no matches
+------+--------------------
+ 7 |
+(1 row)
+
+-- Constant-expression folding shouldn't evaluate unreachable subexpressions
+SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
+ case
+------
+ 1
+(1 row)
+
+SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END;
+ case
+------
+ 1
+(1 row)
+
+-- However we do not currently suppress folding of potentially
+-- reachable subexpressions
+SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl;
+ERROR: division by zero
+-- Test for cases involving untyped literals in test expression
+SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+ case
+------
+ 1
+(1 row)
+
+--
+-- Examples of targets involving tables
+--
+SELECT
+ CASE
+ WHEN i >= 3 THEN i
+ END AS ">= 3 or Null"
+ FROM CASE_TBL;
+ >= 3 or Null
+--------------
+
+
+ 3
+ 4
+(4 rows)
+
+SELECT
+ CASE WHEN i >= 3 THEN (i + i)
+ ELSE i
+ END AS "Simplest Math"
+ FROM CASE_TBL;
+ Simplest Math
+---------------
+ 1
+ 2
+ 6
+ 8
+(4 rows)
+
+SELECT i AS "Value",
+ CASE WHEN (i < 0) THEN 'small'
+ WHEN (i = 0) THEN 'zero'
+ WHEN (i = 1) THEN 'one'
+ WHEN (i = 2) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+ Value | Category
+-------+----------
+ 1 | one
+ 2 | two
+ 3 | big
+ 4 | big
+(4 rows)
+
+SELECT
+ CASE WHEN ((i < 0) or (i < 0)) THEN 'small'
+ WHEN ((i = 0) or (i = 0)) THEN 'zero'
+ WHEN ((i = 1) or (i = 1)) THEN 'one'
+ WHEN ((i = 2) or (i = 2)) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+ Category
+----------
+ one
+ two
+ big
+ big
+(4 rows)
+
+--
+-- Examples of qualifications involving tables
+--
+--
+-- NULLIF() and COALESCE()
+-- Shorthand forms for typical CASE constructs
+-- defined in the SQL standard.
+--
+SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
+ i | f
+---+---
+ 4 |
+(1 row)
+
+SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2;
+ i | f
+---+---
+(0 rows)
+
+SELECT COALESCE(a.f, b.i, b.j)
+ FROM CASE_TBL a, CASE2_TBL b;
+ coalesce
+----------
+ 10.1
+ 20.2
+ -30.3
+ 1
+ 10.1
+ 20.2
+ -30.3
+ 2
+ 10.1
+ 20.2
+ -30.3
+ 3
+ 10.1
+ 20.2
+ -30.3
+ 2
+ 10.1
+ 20.2
+ -30.3
+ 1
+ 10.1
+ 20.2
+ -30.3
+ -6
+(24 rows)
+
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(a.f, b.i, b.j) = 2;
+ i | f | i | j
+---+---+---+----
+ 4 | | 2 | -2
+ 4 | | 2 | -4
+(2 rows)
+
+SELECT NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
+ NULLIF(b.i, 4) AS "NULLIF(b.i,4)"
+ FROM CASE_TBL a, CASE2_TBL b;
+ NULLIF(a.i,b.i) | NULLIF(b.i,4)
+-----------------+---------------
+ | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 1 | 2
+ | 2
+ 3 | 2
+ 4 | 2
+ 1 | 3
+ 2 | 3
+ | 3
+ 4 | 3
+ 1 | 2
+ | 2
+ 3 | 2
+ 4 | 2
+ | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+(24 rows)
+
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(f,b.i) = 2;
+ i | f | i | j
+---+---+---+----
+ 4 | | 2 | -2
+ 4 | | 2 | -4
+(2 rows)
+
+-- Tests for constant subexpression simplification
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 2) = 2;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 1) IS NOT NULL;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, null) = 2;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+--
+-- Examples of updates involving tables
+--
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 3 THEN (- i)
+ ELSE (2 * i) END;
+SELECT * FROM CASE_TBL;
+ i | f
+----+-------
+ 2 | 10.1
+ 4 | 20.2
+ -3 | -30.3
+ -4 |
+(4 rows)
+
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 2 THEN (2 * i)
+ ELSE (3 * i) END;
+SELECT * FROM CASE_TBL;
+ i | f
+-----+-------
+ 4 | 10.1
+ 8 | 20.2
+ -9 | -30.3
+ -12 |
+(4 rows)
+
+UPDATE CASE_TBL
+ SET i = CASE WHEN b.i >= 2 THEN (2 * j)
+ ELSE (3 * j) END
+ FROM CASE2_TBL b
+ WHERE j = -CASE_TBL.i;
+SELECT * FROM CASE_TBL;
+ i | f
+-----+-------
+ 8 | 20.2
+ -9 | -30.3
+ -12 |
+ -8 | 10.1
+(4 rows)
+
+--
+-- Nested CASE expressions
+--
+-- This test exercises a bug caused by aliasing econtext->caseValue_isNull
+-- with the isNull argument of the inner CASE's CaseExpr evaluation. After
+-- evaluating the vol(null) expression in the inner CASE's second WHEN-clause,
+-- the isNull flag for the case test value incorrectly became true, causing
+-- the third WHEN-clause not to match. The volatile function calls are needed
+-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+CREATE FUNCTION vol(text) returns text as
+ 'begin return $1; end' language plpgsql volatile;
+SELECT CASE
+ (CASE vol('bar')
+ WHEN 'foo' THEN 'it was foo!'
+ WHEN vol(null) THEN 'null input'
+ WHEN 'bar' THEN 'it was bar!' END
+ )
+ WHEN 'it was foo!' THEN 'foo recognized'
+ WHEN 'it was bar!' THEN 'bar recognized'
+ ELSE 'unrecognized' END;
+ case
+----------------
+ bar recognized
+(1 row)
+
+-- In this case, we can't inline the SQL function without confusing things.
+CREATE DOMAIN foodomain AS text;
+CREATE FUNCTION volfoo(text) returns foodomain as
+ 'begin return $1::foodomain; end' language plpgsql volatile;
+CREATE FUNCTION inline_eq(foodomain, foodomain) returns boolean as
+ 'SELECT CASE $2::text WHEN $1::text THEN true ELSE false END' language sql;
+CREATE OPERATOR = (procedure = inline_eq,
+ leftarg = foodomain, rightarg = foodomain);
+SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo' END;
+ case
+------------
+ is not foo
+(1 row)
+
+ROLLBACK;
+-- Test multiple evaluation of a CASE arg that is a read/write object (#14472)
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+CREATE DOMAIN arrdomain AS int[];
+CREATE FUNCTION make_ad(int,int) returns arrdomain as
+ 'declare x arrdomain;
+ begin
+ x := array[$1,$2];
+ return x;
+ end' language plpgsql volatile;
+CREATE FUNCTION ad_eq(arrdomain, arrdomain) returns boolean as
+ 'begin return array_eq($1, $2); end' language plpgsql;
+CREATE OPERATOR = (procedure = ad_eq,
+ leftarg = arrdomain, rightarg = arrdomain);
+SELECT CASE make_ad(1,2)
+ WHEN array[2,4]::arrdomain THEN 'wrong'
+ WHEN array[2,5]::arrdomain THEN 'still wrong'
+ WHEN array[1,2]::arrdomain THEN 'right'
+ END;
+ case
+-------
+ right
+(1 row)
+
+ROLLBACK;
+-- Test interaction of CASE with ArrayCoerceExpr (bug #15471)
+BEGIN;
+CREATE TYPE casetestenum AS ENUM ('e', 'f', 'g');
+SELECT
+ CASE 'foo'::text
+ WHEN 'foo' THEN ARRAY['a', 'b', 'c', 'd'] || enum_range(NULL::casetestenum)::text[]
+ ELSE ARRAY['x', 'y']
+ END;
+ array
+-----------------
+ {a,b,c,d,e,f,g}
+(1 row)
+
+ROLLBACK;
+--
+-- Clean up
+--
+DROP TABLE CASE_TBL;
+DROP TABLE CASE2_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/case.sql b/yql/essentials/tests/postgresql/original/cases/case.sql
new file mode 100644
index 0000000000..83fe43be6b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/case.sql
@@ -0,0 +1,265 @@
+--
+-- CASE
+-- Test the case statement
+--
+
+CREATE TABLE CASE_TBL (
+ i integer,
+ f double precision
+);
+
+CREATE TABLE CASE2_TBL (
+ i integer,
+ j integer
+);
+
+INSERT INTO CASE_TBL VALUES (1, 10.1);
+INSERT INTO CASE_TBL VALUES (2, 20.2);
+INSERT INTO CASE_TBL VALUES (3, -30.3);
+INSERT INTO CASE_TBL VALUES (4, NULL);
+
+INSERT INTO CASE2_TBL VALUES (1, -1);
+INSERT INTO CASE2_TBL VALUES (2, -2);
+INSERT INTO CASE2_TBL VALUES (3, -3);
+INSERT INTO CASE2_TBL VALUES (2, -4);
+INSERT INTO CASE2_TBL VALUES (1, NULL);
+INSERT INTO CASE2_TBL VALUES (NULL, -6);
+
+--
+-- Simplest examples without tables
+--
+
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ END AS "Simple WHEN";
+
+SELECT '<NULL>' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ END AS "Simple default";
+
+SELECT '3' AS "One",
+ CASE
+ WHEN 1 < 2 THEN 3
+ ELSE 4
+ END AS "Simple ELSE";
+
+SELECT '4' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ ELSE 4
+ END AS "ELSE default";
+
+SELECT '6' AS "One",
+ CASE
+ WHEN 1 > 2 THEN 3
+ WHEN 4 < 5 THEN 6
+ ELSE 7
+ END AS "Two WHEN with default";
+
+
+SELECT '7' AS "None",
+ CASE WHEN random() < 0 THEN 1
+ END AS "NULL on no matches";
+
+-- Constant-expression folding shouldn't evaluate unreachable subexpressions
+SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
+SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END;
+
+-- However we do not currently suppress folding of potentially
+-- reachable subexpressions
+SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl;
+
+-- Test for cases involving untyped literals in test expression
+SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+
+--
+-- Examples of targets involving tables
+--
+
+SELECT
+ CASE
+ WHEN i >= 3 THEN i
+ END AS ">= 3 or Null"
+ FROM CASE_TBL;
+
+SELECT
+ CASE WHEN i >= 3 THEN (i + i)
+ ELSE i
+ END AS "Simplest Math"
+ FROM CASE_TBL;
+
+SELECT i AS "Value",
+ CASE WHEN (i < 0) THEN 'small'
+ WHEN (i = 0) THEN 'zero'
+ WHEN (i = 1) THEN 'one'
+ WHEN (i = 2) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+
+SELECT
+ CASE WHEN ((i < 0) or (i < 0)) THEN 'small'
+ WHEN ((i = 0) or (i = 0)) THEN 'zero'
+ WHEN ((i = 1) or (i = 1)) THEN 'one'
+ WHEN ((i = 2) or (i = 2)) THEN 'two'
+ ELSE 'big'
+ END AS "Category"
+ FROM CASE_TBL;
+
+--
+-- Examples of qualifications involving tables
+--
+
+--
+-- NULLIF() and COALESCE()
+-- Shorthand forms for typical CASE constructs
+-- defined in the SQL standard.
+--
+
+SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
+
+SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2;
+
+SELECT COALESCE(a.f, b.i, b.j)
+ FROM CASE_TBL a, CASE2_TBL b;
+
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(a.f, b.i, b.j) = 2;
+
+SELECT NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
+ NULLIF(b.i, 4) AS "NULLIF(b.i,4)"
+ FROM CASE_TBL a, CASE2_TBL b;
+
+SELECT *
+ FROM CASE_TBL a, CASE2_TBL b
+ WHERE COALESCE(f,b.i) = 2;
+
+-- Tests for constant subexpression simplification
+
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 2) = 2;
+
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, 1) IS NOT NULL;
+
+explain (costs off)
+SELECT * FROM CASE_TBL WHERE NULLIF(1, null) = 2;
+
+--
+-- Examples of updates involving tables
+--
+
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 3 THEN (- i)
+ ELSE (2 * i) END;
+
+SELECT * FROM CASE_TBL;
+
+UPDATE CASE_TBL
+ SET i = CASE WHEN i >= 2 THEN (2 * i)
+ ELSE (3 * i) END;
+
+SELECT * FROM CASE_TBL;
+
+UPDATE CASE_TBL
+ SET i = CASE WHEN b.i >= 2 THEN (2 * j)
+ ELSE (3 * j) END
+ FROM CASE2_TBL b
+ WHERE j = -CASE_TBL.i;
+
+SELECT * FROM CASE_TBL;
+
+--
+-- Nested CASE expressions
+--
+
+-- This test exercises a bug caused by aliasing econtext->caseValue_isNull
+-- with the isNull argument of the inner CASE's CaseExpr evaluation. After
+-- evaluating the vol(null) expression in the inner CASE's second WHEN-clause,
+-- the isNull flag for the case test value incorrectly became true, causing
+-- the third WHEN-clause not to match. The volatile function calls are needed
+-- to prevent constant-folding in the planner, which would hide the bug.
+
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+
+CREATE FUNCTION vol(text) returns text as
+ 'begin return $1; end' language plpgsql volatile;
+
+SELECT CASE
+ (CASE vol('bar')
+ WHEN 'foo' THEN 'it was foo!'
+ WHEN vol(null) THEN 'null input'
+ WHEN 'bar' THEN 'it was bar!' END
+ )
+ WHEN 'it was foo!' THEN 'foo recognized'
+ WHEN 'it was bar!' THEN 'bar recognized'
+ ELSE 'unrecognized' END;
+
+-- In this case, we can't inline the SQL function without confusing things.
+CREATE DOMAIN foodomain AS text;
+
+CREATE FUNCTION volfoo(text) returns foodomain as
+ 'begin return $1::foodomain; end' language plpgsql volatile;
+
+CREATE FUNCTION inline_eq(foodomain, foodomain) returns boolean as
+ 'SELECT CASE $2::text WHEN $1::text THEN true ELSE false END' language sql;
+
+CREATE OPERATOR = (procedure = inline_eq,
+ leftarg = foodomain, rightarg = foodomain);
+
+SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo' END;
+
+ROLLBACK;
+
+-- Test multiple evaluation of a CASE arg that is a read/write object (#14472)
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+
+CREATE DOMAIN arrdomain AS int[];
+
+CREATE FUNCTION make_ad(int,int) returns arrdomain as
+ 'declare x arrdomain;
+ begin
+ x := array[$1,$2];
+ return x;
+ end' language plpgsql volatile;
+
+CREATE FUNCTION ad_eq(arrdomain, arrdomain) returns boolean as
+ 'begin return array_eq($1, $2); end' language plpgsql;
+
+CREATE OPERATOR = (procedure = ad_eq,
+ leftarg = arrdomain, rightarg = arrdomain);
+
+SELECT CASE make_ad(1,2)
+ WHEN array[2,4]::arrdomain THEN 'wrong'
+ WHEN array[2,5]::arrdomain THEN 'still wrong'
+ WHEN array[1,2]::arrdomain THEN 'right'
+ END;
+
+ROLLBACK;
+
+-- Test interaction of CASE with ArrayCoerceExpr (bug #15471)
+BEGIN;
+
+CREATE TYPE casetestenum AS ENUM ('e', 'f', 'g');
+
+SELECT
+ CASE 'foo'::text
+ WHEN 'foo' THEN ARRAY['a', 'b', 'c', 'd'] || enum_range(NULL::casetestenum)::text[]
+ ELSE ARRAY['x', 'y']
+ END;
+
+ROLLBACK;
+
+--
+-- Clean up
+--
+
+DROP TABLE CASE_TBL;
+DROP TABLE CASE2_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/char.out b/yql/essentials/tests/postgresql/original/cases/char.out
new file mode 100644
index 0000000000..d515b3ce34
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/char.out
@@ -0,0 +1,122 @@
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+ true
+------
+ t
+(1 row)
+
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character(1)
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM CHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+(5 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+(6 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ c
+(1 row)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ c
+(2 rows)
+
+DROP TABLE CHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character(4)
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM CHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/char.sql b/yql/essentials/tests/postgresql/original/cases/char.sql
new file mode 100644
index 0000000000..79e6e565ba
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/char.sql
@@ -0,0 +1,75 @@
+--
+-- CHAR
+--
+
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+
+SELECT char 'c' = char 'c' AS true;
+
+--
+-- Build a table for testing
+--
+
+CREATE TABLE CHAR_TBL(f1 char);
+
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+
+
+SELECT * FROM CHAR_TBL;
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+
+DROP TABLE CHAR_TBL;
+
+--
+-- Now test longer arrays of char
+--
+
+CREATE TABLE CHAR_TBL(f1 char(4));
+
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+
+SELECT * FROM CHAR_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/char_1.out b/yql/essentials/tests/postgresql/original/cases/char_1.out
new file mode 100644
index 0000000000..6c917c0b68
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/char_1.out
@@ -0,0 +1,122 @@
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+ true
+------
+ t
+(1 row)
+
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character(1)
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM CHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+ 1
+ 2
+ 3
+
+(4 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+ 1
+ 2
+ 3
+
+(5 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ A
+ c
+(2 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ A
+ c
+(3 rows)
+
+DROP TABLE CHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character(4)
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM CHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/char_2.out b/yql/essentials/tests/postgresql/original/cases/char_2.out
new file mode 100644
index 0000000000..9a54658632
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/char_2.out
@@ -0,0 +1,122 @@
+--
+-- CHAR
+--
+-- fixed-length by value
+-- internally passed by value if <= 4 bytes in storage
+SELECT char 'c' = char 'c' AS true;
+ true
+------
+ t
+(1 row)
+
+--
+-- Build a table for testing
+--
+CREATE TABLE CHAR_TBL(f1 char);
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO CHAR_TBL (f1) VALUES ('1');
+INSERT INTO CHAR_TBL (f1) VALUES (2);
+INSERT INTO CHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO CHAR_TBL (f1) VALUES ('');
+-- try char's of greater than 1 length
+INSERT INTO CHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character(1)
+INSERT INTO CHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM CHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+
+(1 row)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+
+(2 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+ c
+(5 rows)
+
+SELECT c.*
+ FROM CHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+ c
+(6 rows)
+
+DROP TABLE CHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE CHAR_TBL(f1 char(4));
+INSERT INTO CHAR_TBL (f1) VALUES ('a');
+INSERT INTO CHAR_TBL (f1) VALUES ('ab');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character(4)
+INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM CHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/comments.out b/yql/essentials/tests/postgresql/original/cases/comments.out
new file mode 100644
index 0000000000..33f612e633
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/comments.out
@@ -0,0 +1,65 @@
+--
+-- COMMENTS
+--
+SELECT 'trailing' AS first; -- trailing single line
+ first
+----------
+ trailing
+(1 row)
+
+SELECT /* embedded single line */ 'embedded' AS second;
+ second
+----------
+ embedded
+(1 row)
+
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+ third
+-------
+ both
+(1 row)
+
+SELECT 'before multi-line' AS fourth;
+ fourth
+-------------------
+ before multi-line
+(1 row)
+
+/* This is an example of SQL which should not execute:
+ * select 'multi-line';
+ */
+SELECT 'after multi-line' AS fifth;
+ fifth
+------------------
+ after multi-line
+(1 row)
+
+--
+-- Nested comments
+--
+/*
+SELECT 'trailing' as x1; -- inside block comment
+*/
+/* This block comment surrounds a query which itself has a block comment...
+SELECT /* embedded single line */ 'embedded' AS x2;
+*/
+SELECT -- continued after the following block comments...
+/* Deeply nested comment.
+ This includes a single apostrophe to make sure we aren't decoding this part as a string.
+SELECT 'deep nest' AS n1;
+/* Second level of nesting...
+SELECT 'deeper nest' as n2;
+/* Third level of nesting...
+SELECT 'deepest nest' as n3;
+*/
+Hoo boy. Still two deep...
+*/
+Now just one deep...
+*/
+'deeply nested example' AS sixth;
+ sixth
+-----------------------
+ deeply nested example
+(1 row)
+
+/* and this is the end of the file */
diff --git a/yql/essentials/tests/postgresql/original/cases/comments.sql b/yql/essentials/tests/postgresql/original/cases/comments.sql
new file mode 100644
index 0000000000..e47db1ae59
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/comments.sql
@@ -0,0 +1,42 @@
+--
+-- COMMENTS
+--
+
+SELECT 'trailing' AS first; -- trailing single line
+SELECT /* embedded single line */ 'embedded' AS second;
+SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
+
+SELECT 'before multi-line' AS fourth;
+/* This is an example of SQL which should not execute:
+ * select 'multi-line';
+ */
+SELECT 'after multi-line' AS fifth;
+
+--
+-- Nested comments
+--
+
+/*
+SELECT 'trailing' as x1; -- inside block comment
+*/
+
+/* This block comment surrounds a query which itself has a block comment...
+SELECT /* embedded single line */ 'embedded' AS x2;
+*/
+
+SELECT -- continued after the following block comments...
+/* Deeply nested comment.
+ This includes a single apostrophe to make sure we aren't decoding this part as a string.
+SELECT 'deep nest' AS n1;
+/* Second level of nesting...
+SELECT 'deeper nest' as n2;
+/* Third level of nesting...
+SELECT 'deepest nest' as n3;
+*/
+Hoo boy. Still two deep...
+*/
+Now just one deep...
+*/
+'deeply nested example' AS sixth;
+
+/* and this is the end of the file */
diff --git a/yql/essentials/tests/postgresql/original/cases/create_misc.out b/yql/essentials/tests/postgresql/original/cases/create_misc.out
new file mode 100644
index 0000000000..41bc4d7750
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/create_misc.out
@@ -0,0 +1,151 @@
+--
+-- CREATE_MISC
+--
+-- CLASS POPULATION
+-- (any resemblance to real life is purely coincidental)
+--
+INSERT INTO tenk2 SELECT * FROM tenk1;
+CREATE TABLE onek2 AS SELECT * FROM onek;
+INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000;
+SELECT *
+ INTO TABLE Bprime
+ FROM tenk1
+ WHERE unique2 < 1000;
+INSERT INTO hobbies_r (name, person)
+ SELECT 'posthacking', p.name
+ FROM person* p
+ WHERE p.name = 'mike' or p.name = 'jeff';
+INSERT INTO hobbies_r (name, person)
+ SELECT 'basketball', p.name
+ FROM person p
+ WHERE p.name = 'joe' or p.name = 'sally';
+INSERT INTO hobbies_r (name) VALUES ('skywalking');
+INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
+INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
+INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
+INSERT INTO city VALUES
+('Podunk', '(1,2),(3,4)', '100,127,1000'),
+('Gotham', '(1000,34),(1100,334)', '123456,127,-1000,6789');
+TABLE city;
+ name | location | budget
+--------+----------------------+-----------------------
+ Podunk | (3,4),(1,2) | 100,127,1000,0
+ Gotham | (1100,334),(1000,34) | 123456,127,-1000,6789
+(2 rows)
+
+SELECT *
+ INTO TABLE ramp
+ FROM road
+ WHERE name ~ '.*Ramp';
+INSERT INTO ihighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'I- .*';
+INSERT INTO shighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'State Hwy.*';
+UPDATE shighway
+ SET surface = 'asphalt';
+INSERT INTO a_star (class, a) VALUES ('a', 1);
+INSERT INTO a_star (class, a) VALUES ('a', 2);
+INSERT INTO a_star (class) VALUES ('a');
+INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text);
+INSERT INTO b_star (class, a) VALUES ('b', 4);
+INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text);
+INSERT INTO b_star (class) VALUES ('b');
+INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::name);
+INSERT INTO c_star (class, a) VALUES ('c', 6);
+INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::name);
+INSERT INTO c_star (class) VALUES ('c');
+INSERT INTO d_star (class, a, b, c, d)
+ VALUES ('d', 7, 'grumble'::text, 'hi sunita'::name, '0.0'::float8);
+INSERT INTO d_star (class, a, b, c)
+ VALUES ('d', 8, 'stumble'::text, 'hi koko'::name);
+INSERT INTO d_star (class, a, b, d)
+ VALUES ('d', 9, 'rumble'::text, '1.1'::float8);
+INSERT INTO d_star (class, a, c, d)
+ VALUES ('d', 10, 'hi kristin'::name, '10.01'::float8);
+INSERT INTO d_star (class, b, c, d)
+ VALUES ('d', 'crumble'::text, 'hi boris'::name, '100.001'::float8);
+INSERT INTO d_star (class, a, b)
+ VALUES ('d', 11, 'fumble'::text);
+INSERT INTO d_star (class, a, c)
+ VALUES ('d', 12, 'hi avi'::name);
+INSERT INTO d_star (class, a, d)
+ VALUES ('d', 13, '1000.0001'::float8);
+INSERT INTO d_star (class, b, c)
+ VALUES ('d', 'tumble'::text, 'hi andrew'::name);
+INSERT INTO d_star (class, b, d)
+ VALUES ('d', 'humble'::text, '10000.00001'::float8);
+INSERT INTO d_star (class, c, d)
+ VALUES ('d', 'hi ginger'::name, '100000.000001'::float8);
+INSERT INTO d_star (class, a) VALUES ('d', 14);
+INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text);
+INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name);
+INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8);
+INSERT INTO d_star (class) VALUES ('d');
+INSERT INTO e_star (class, a, c, e)
+ VALUES ('e', 15, 'hi carol'::name, '-1'::int2);
+INSERT INTO e_star (class, a, c)
+ VALUES ('e', 16, 'hi bob'::name);
+INSERT INTO e_star (class, a, e)
+ VALUES ('e', 17, '-2'::int2);
+INSERT INTO e_star (class, c, e)
+ VALUES ('e', 'hi michelle'::name, '-3'::int2);
+INSERT INTO e_star (class, a)
+ VALUES ('e', 18);
+INSERT INTO e_star (class, c)
+ VALUES ('e', 'hi elisa'::name);
+INSERT INTO e_star (class, e)
+ VALUES ('e', '-4'::int2);
+INSERT INTO f_star (class, a, c, e, f)
+ VALUES ('f', 19, 'hi claire'::name, '-5'::int2, '(1,3),(2,4)'::polygon);
+INSERT INTO f_star (class, a, c, e)
+ VALUES ('f', 20, 'hi mike'::name, '-6'::int2);
+INSERT INTO f_star (class, a, c, f)
+ VALUES ('f', 21, 'hi marcel'::name, '(11,44),(22,55),(33,66)'::polygon);
+INSERT INTO f_star (class, a, e, f)
+ VALUES ('f', 22, '-7'::int2, '(111,555),(222,666),(333,777),(444,888)'::polygon);
+INSERT INTO f_star (class, c, e, f)
+ VALUES ('f', 'hi keith'::name, '-8'::int2,
+ '(1111,3333),(2222,4444)'::polygon);
+INSERT INTO f_star (class, a, c)
+ VALUES ('f', 24, 'hi marc'::name);
+INSERT INTO f_star (class, a, e)
+ VALUES ('f', 25, '-9'::int2);
+INSERT INTO f_star (class, a, f)
+ VALUES ('f', 26, '(11111,33333),(22222,44444)'::polygon);
+INSERT INTO f_star (class, c, e)
+ VALUES ('f', 'hi allison'::name, '-10'::int2);
+INSERT INTO f_star (class, c, f)
+ VALUES ('f', 'hi jeff'::name,
+ '(111111,333333),(222222,444444)'::polygon);
+INSERT INTO f_star (class, e, f)
+ VALUES ('f', '-11'::int2, '(1111111,3333333),(2222222,4444444)'::polygon);
+INSERT INTO f_star (class, a) VALUES ('f', 27);
+INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::name);
+INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
+INSERT INTO f_star (class, f)
+ VALUES ('f', '(11111111,33333333),(22222222,44444444)'::polygon);
+INSERT INTO f_star (class) VALUES ('f');
+-- Analyze the X_star tables for better plan stability in later tests
+ANALYZE a_star;
+ANALYZE b_star;
+ANALYZE c_star;
+ANALYZE d_star;
+ANALYZE e_star;
+ANALYZE f_star;
+--
+-- for internal portal (cursor) tests
+--
+CREATE TABLE iportaltest (
+ i int4,
+ d float4,
+ p polygon
+);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
+INSERT INTO iportaltest (i, d, p)
+ VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
diff --git a/yql/essentials/tests/postgresql/original/cases/create_misc.sql b/yql/essentials/tests/postgresql/original/cases/create_misc.sql
new file mode 100644
index 0000000000..c7d0d064c3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/create_misc.sql
@@ -0,0 +1,217 @@
+--
+-- CREATE_MISC
+--
+
+-- CLASS POPULATION
+-- (any resemblance to real life is purely coincidental)
+--
+
+INSERT INTO tenk2 SELECT * FROM tenk1;
+
+CREATE TABLE onek2 AS SELECT * FROM onek;
+
+INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000;
+
+SELECT *
+ INTO TABLE Bprime
+ FROM tenk1
+ WHERE unique2 < 1000;
+
+INSERT INTO hobbies_r (name, person)
+ SELECT 'posthacking', p.name
+ FROM person* p
+ WHERE p.name = 'mike' or p.name = 'jeff';
+
+INSERT INTO hobbies_r (name, person)
+ SELECT 'basketball', p.name
+ FROM person p
+ WHERE p.name = 'joe' or p.name = 'sally';
+
+INSERT INTO hobbies_r (name) VALUES ('skywalking');
+
+INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking');
+
+INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking');
+
+INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball');
+
+INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking');
+
+INSERT INTO city VALUES
+('Podunk', '(1,2),(3,4)', '100,127,1000'),
+('Gotham', '(1000,34),(1100,334)', '123456,127,-1000,6789');
+TABLE city;
+
+SELECT *
+ INTO TABLE ramp
+ FROM road
+ WHERE name ~ '.*Ramp';
+
+INSERT INTO ihighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'I- .*';
+
+INSERT INTO shighway
+ SELECT *
+ FROM road
+ WHERE name ~ 'State Hwy.*';
+
+UPDATE shighway
+ SET surface = 'asphalt';
+
+INSERT INTO a_star (class, a) VALUES ('a', 1);
+
+INSERT INTO a_star (class, a) VALUES ('a', 2);
+
+INSERT INTO a_star (class) VALUES ('a');
+
+INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text);
+
+INSERT INTO b_star (class, a) VALUES ('b', 4);
+
+INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text);
+
+INSERT INTO b_star (class) VALUES ('b');
+
+INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::name);
+
+INSERT INTO c_star (class, a) VALUES ('c', 6);
+
+INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::name);
+
+INSERT INTO c_star (class) VALUES ('c');
+
+INSERT INTO d_star (class, a, b, c, d)
+ VALUES ('d', 7, 'grumble'::text, 'hi sunita'::name, '0.0'::float8);
+
+INSERT INTO d_star (class, a, b, c)
+ VALUES ('d', 8, 'stumble'::text, 'hi koko'::name);
+
+INSERT INTO d_star (class, a, b, d)
+ VALUES ('d', 9, 'rumble'::text, '1.1'::float8);
+
+INSERT INTO d_star (class, a, c, d)
+ VALUES ('d', 10, 'hi kristin'::name, '10.01'::float8);
+
+INSERT INTO d_star (class, b, c, d)
+ VALUES ('d', 'crumble'::text, 'hi boris'::name, '100.001'::float8);
+
+INSERT INTO d_star (class, a, b)
+ VALUES ('d', 11, 'fumble'::text);
+
+INSERT INTO d_star (class, a, c)
+ VALUES ('d', 12, 'hi avi'::name);
+
+INSERT INTO d_star (class, a, d)
+ VALUES ('d', 13, '1000.0001'::float8);
+
+INSERT INTO d_star (class, b, c)
+ VALUES ('d', 'tumble'::text, 'hi andrew'::name);
+
+INSERT INTO d_star (class, b, d)
+ VALUES ('d', 'humble'::text, '10000.00001'::float8);
+
+INSERT INTO d_star (class, c, d)
+ VALUES ('d', 'hi ginger'::name, '100000.000001'::float8);
+
+INSERT INTO d_star (class, a) VALUES ('d', 14);
+
+INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text);
+
+INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name);
+
+INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8);
+
+INSERT INTO d_star (class) VALUES ('d');
+
+INSERT INTO e_star (class, a, c, e)
+ VALUES ('e', 15, 'hi carol'::name, '-1'::int2);
+
+INSERT INTO e_star (class, a, c)
+ VALUES ('e', 16, 'hi bob'::name);
+
+INSERT INTO e_star (class, a, e)
+ VALUES ('e', 17, '-2'::int2);
+
+INSERT INTO e_star (class, c, e)
+ VALUES ('e', 'hi michelle'::name, '-3'::int2);
+
+INSERT INTO e_star (class, a)
+ VALUES ('e', 18);
+
+INSERT INTO e_star (class, c)
+ VALUES ('e', 'hi elisa'::name);
+
+INSERT INTO e_star (class, e)
+ VALUES ('e', '-4'::int2);
+
+INSERT INTO f_star (class, a, c, e, f)
+ VALUES ('f', 19, 'hi claire'::name, '-5'::int2, '(1,3),(2,4)'::polygon);
+
+INSERT INTO f_star (class, a, c, e)
+ VALUES ('f', 20, 'hi mike'::name, '-6'::int2);
+
+INSERT INTO f_star (class, a, c, f)
+ VALUES ('f', 21, 'hi marcel'::name, '(11,44),(22,55),(33,66)'::polygon);
+
+INSERT INTO f_star (class, a, e, f)
+ VALUES ('f', 22, '-7'::int2, '(111,555),(222,666),(333,777),(444,888)'::polygon);
+
+INSERT INTO f_star (class, c, e, f)
+ VALUES ('f', 'hi keith'::name, '-8'::int2,
+ '(1111,3333),(2222,4444)'::polygon);
+
+INSERT INTO f_star (class, a, c)
+ VALUES ('f', 24, 'hi marc'::name);
+
+INSERT INTO f_star (class, a, e)
+ VALUES ('f', 25, '-9'::int2);
+
+INSERT INTO f_star (class, a, f)
+ VALUES ('f', 26, '(11111,33333),(22222,44444)'::polygon);
+
+INSERT INTO f_star (class, c, e)
+ VALUES ('f', 'hi allison'::name, '-10'::int2);
+
+INSERT INTO f_star (class, c, f)
+ VALUES ('f', 'hi jeff'::name,
+ '(111111,333333),(222222,444444)'::polygon);
+
+INSERT INTO f_star (class, e, f)
+ VALUES ('f', '-11'::int2, '(1111111,3333333),(2222222,4444444)'::polygon);
+
+INSERT INTO f_star (class, a) VALUES ('f', 27);
+
+INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::name);
+
+INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
+
+INSERT INTO f_star (class, f)
+ VALUES ('f', '(11111111,33333333),(22222222,44444444)'::polygon);
+
+INSERT INTO f_star (class) VALUES ('f');
+
+-- Analyze the X_star tables for better plan stability in later tests
+ANALYZE a_star;
+ANALYZE b_star;
+ANALYZE c_star;
+ANALYZE d_star;
+ANALYZE e_star;
+ANALYZE f_star;
+
+
+--
+-- for internal portal (cursor) tests
+--
+CREATE TABLE iportaltest (
+ i int4,
+ d float4,
+ p polygon
+);
+
+INSERT INTO iportaltest (i, d, p)
+ VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
+
+INSERT INTO iportaltest (i, d, p)
+ VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
diff --git a/yql/essentials/tests/postgresql/original/cases/create_table.out b/yql/essentials/tests/postgresql/original/cases/create_table.out
new file mode 100644
index 0000000000..a958b84979
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/create_table.out
@@ -0,0 +1,1321 @@
+--
+-- CREATE_TABLE
+--
+--
+-- CLASS DEFINITIONS
+--
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+CREATE TABLE person (
+ name text,
+ age int4,
+ location point
+);
+CREATE TABLE emp (
+ salary int4,
+ manager name
+) INHERITS (person);
+CREATE TABLE student (
+ gpa float8
+) INHERITS (person);
+CREATE TABLE stud_emp (
+ percent int4
+) INHERITS (emp, student);
+NOTICE: merging multiple inherited definitions of column "name"
+NOTICE: merging multiple inherited definitions of column "age"
+NOTICE: merging multiple inherited definitions of column "location"
+CREATE TABLE city (
+ name name,
+ location box,
+ budget city_budget
+);
+CREATE TABLE dept (
+ dname name,
+ mgrname text
+);
+CREATE TABLE slow_emp4000 (
+ home_base box
+);
+CREATE TABLE fast_emp4000 (
+ home_base box
+);
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+CREATE TABLE ihighway () INHERITS (road);
+CREATE TABLE shighway (
+ surface text
+) INHERITS (road);
+CREATE TABLE real_city (
+ pop int4,
+ cname text,
+ outline path
+);
+--
+-- test the "star" operators a bit more thoroughly -- this time,
+-- throw in lots of NULL fields...
+--
+-- a is the type root
+-- b and c inherit from a (one-level single inheritance)
+-- d inherits from b and c (two-level multiple inheritance)
+-- e inherits from c (two-level single inheritance)
+-- f inherits from e (three-level single inheritance)
+--
+CREATE TABLE a_star (
+ class char,
+ a int4
+);
+CREATE TABLE b_star (
+ b text
+) INHERITS (a_star);
+CREATE TABLE c_star (
+ c name
+) INHERITS (a_star);
+CREATE TABLE d_star (
+ d float8
+) INHERITS (b_star, c_star);
+NOTICE: merging multiple inherited definitions of column "class"
+NOTICE: merging multiple inherited definitions of column "a"
+CREATE TABLE e_star (
+ e int2
+) INHERITS (c_star);
+CREATE TABLE f_star (
+ f polygon
+) INHERITS (e_star);
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+CREATE TABLE hash_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE hash_name_heap (
+ seqno int4,
+ random name
+);
+CREATE TABLE hash_txt_heap (
+ seqno int4,
+ random text
+);
+CREATE TABLE hash_f8_heap (
+ seqno int4,
+ random float8
+);
+-- don't include the hash_ovfl_heap stuff in the distribution
+-- the data set is too large for what it's worth
+--
+-- CREATE TABLE hash_ovfl_heap (
+-- x int4,
+-- y int4
+-- );
+CREATE TABLE bt_i4_heap (
+ seqno int4,
+ random int4
+);
+CREATE TABLE bt_name_heap (
+ seqno name,
+ random int4
+);
+CREATE TABLE bt_txt_heap (
+ seqno text,
+ random int4
+);
+CREATE TABLE bt_f8_heap (
+ seqno float8,
+ random int4
+);
+CREATE TABLE array_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE array_index_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+CREATE TABLE testjsonb (
+ j jsonb
+);
+CREATE TABLE unknowntab (
+ u unknown -- fail
+);
+ERROR: column "u" has pseudo-type unknown
+CREATE TYPE unknown_comptype AS (
+ u unknown -- fail
+);
+ERROR: column "u" has pseudo-type unknown
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text,
+ a tsvector
+);
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text
+);
+NOTICE: relation "test_tsvector" already exists, skipping
+-- invalid: non-lowercase quoted reloptions identifiers
+CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
+ERROR: unrecognized parameter "Fillfactor"
+CREATE UNLOGGED TABLE unlogged1 (a int primary key); -- OK
+CREATE TEMPORARY TABLE unlogged2 (a int primary key); -- OK
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+ relname | relkind | relpersistence
+----------------+---------+----------------
+ unlogged1 | r | u
+ unlogged1_pkey | i | u
+ unlogged2 | r | t
+ unlogged2_pkey | i | t
+(4 rows)
+
+REINDEX INDEX unlogged1_pkey;
+REINDEX INDEX unlogged2_pkey;
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+ relname | relkind | relpersistence
+----------------+---------+----------------
+ unlogged1 | r | u
+ unlogged1_pkey | i | u
+ unlogged2 | r | t
+ unlogged2_pkey | i | t
+(4 rows)
+
+DROP TABLE unlogged2;
+INSERT INTO unlogged1 VALUES (42);
+CREATE UNLOGGED TABLE public.unlogged2 (a int primary key); -- also OK
+CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key); -- not OK
+ERROR: only temporary relations may be created in temporary schemas
+LINE 1: CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key);
+ ^
+CREATE TABLE pg_temp.implicitly_temp (a int primary key); -- OK
+CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+CREATE TEMP TABLE pg_temp.doubly_temp (a int primary key); -- also OK
+CREATE TEMP TABLE public.temp_to_perm (a int primary key); -- not OK
+ERROR: cannot create temporary relation in non-temporary schema
+LINE 1: CREATE TEMP TABLE public.temp_to_perm (a int primary key);
+ ^
+DROP TABLE unlogged1, public.unlogged2;
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ERROR: relation "as_select1" already exists
+CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+NOTICE: relation "as_select1" already exists, skipping
+DROP TABLE as_select1;
+PREPARE select1 AS SELECT 1 as a;
+CREATE TABLE as_select1 AS EXECUTE select1;
+CREATE TABLE as_select1 AS EXECUTE select1;
+ERROR: relation "as_select1" already exists
+SELECT * FROM as_select1;
+ a
+---
+ 1
+(1 row)
+
+CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
+NOTICE: relation "as_select1" already exists, skipping
+DROP TABLE as_select1;
+DEALLOCATE select1;
+-- create an extra wide table to test for issues related to that
+-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
+\set ECHO none
+INSERT INTO extra_wide_table(firstc, lastc) VALUES('first col', 'last col');
+SELECT firstc, lastc FROM extra_wide_table;
+ firstc | lastc
+-----------+----------
+ first col | last col
+(1 row)
+
+-- check that tables with oids cannot be created anymore
+CREATE TABLE withoid() WITH OIDS;
+ERROR: syntax error at or near "OIDS"
+LINE 1: CREATE TABLE withoid() WITH OIDS;
+ ^
+CREATE TABLE withoid() WITH (oids);
+ERROR: tables declared WITH OIDS are not supported
+CREATE TABLE withoid() WITH (oids = true);
+ERROR: tables declared WITH OIDS are not supported
+-- but explicitly not adding oids is still supported
+CREATE TEMP TABLE withoutoid() WITHOUT OIDS; DROP TABLE withoutoid;
+CREATE TEMP TABLE withoutoid() WITH (oids = false); DROP TABLE withoutoid;
+-- check restriction with default expressions
+-- invalid use of column reference in default expressions
+CREATE TABLE default_expr_column (id int DEFAULT (id));
+ERROR: cannot use column reference in DEFAULT expression
+LINE 1: CREATE TABLE default_expr_column (id int DEFAULT (id));
+ ^
+CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
+ERROR: cannot use column reference in DEFAULT expression
+LINE 1: CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
+ ^
+CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
+ERROR: cannot use column reference in DEFAULT expression
+LINE 1: ...TE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
+ ^
+-- invalid column definition
+CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
+ERROR: cannot use column reference in DEFAULT expression
+LINE 1: ...TABLE default_expr_non_column (a int DEFAULT (avg(non_existe...
+ ^
+-- invalid use of aggregate
+CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
+ERROR: aggregate functions are not allowed in DEFAULT expressions
+LINE 1: CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
+ ^
+-- invalid use of subquery
+CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
+ERROR: cannot use subquery in DEFAULT expression
+LINE 1: CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
+ ^
+-- invalid use of set-returning function
+CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
+ERROR: set-returning functions are not allowed in DEFAULT expressions
+LINE 1: CREATE TABLE default_expr_agg (a int DEFAULT (generate_serie...
+ ^
+-- Verify that subtransaction rollback restores rd_createSubid.
+BEGIN;
+CREATE TABLE remember_create_subid (c int);
+SAVEPOINT q; DROP TABLE remember_create_subid; ROLLBACK TO q;
+COMMIT;
+DROP TABLE remember_create_subid;
+-- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+CREATE TABLE remember_node_subid (c int);
+BEGIN;
+ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+SAVEPOINT q; DROP TABLE remember_node_subid; ROLLBACK TO q;
+COMMIT;
+DROP TABLE remember_node_subid;
+--
+-- Partitioned tables
+--
+-- cannot combine INHERITS and PARTITION BY (although grammar allows)
+CREATE TABLE partitioned (
+ a int
+) INHERITS (some_table) PARTITION BY LIST (a);
+ERROR: cannot create partitioned table as inheritance child
+-- cannot use more than 1 column as partition key for list partitioned table
+CREATE TABLE partitioned (
+ a1 int,
+ a2 int
+) PARTITION BY LIST (a1, a2); -- fail
+ERROR: cannot use "list" partition strategy with more than one column
+-- unsupported constraint type for partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ EXCLUDE USING gist (a WITH &&)
+) PARTITION BY RANGE (a);
+ERROR: exclusion constraints are not supported on partitioned tables
+LINE 3: EXCLUDE USING gist (a WITH &&)
+ ^
+-- prevent using prohibited expressions in the key
+CREATE FUNCTION retset (a int) RETURNS SETOF int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (retset(a));
+ERROR: set-returning functions are not allowed in partition key expressions
+DROP FUNCTION retset(int);
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((avg(a)));
+ERROR: aggregate functions are not allowed in partition key expressions
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE ((avg(a) OVER (PARTITION BY b)));
+ERROR: window functions are not allowed in partition key expressions
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY LIST ((a LIKE (SELECT 1)));
+ERROR: cannot use subquery in partition key expression
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((42));
+ERROR: cannot use constant expression as partition key
+CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (const_func());
+ERROR: cannot use constant expression as partition key
+DROP FUNCTION const_func();
+-- only accept valid partitioning strategy
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY MAGIC (a);
+ERROR: unrecognized partitioning strategy "magic"
+-- specified column must be present in the table
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (b);
+ERROR: column "b" named in partition key does not exist
+LINE 3: ) PARTITION BY RANGE (b);
+ ^
+-- cannot use system columns in partition key
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (xmin);
+ERROR: cannot use system column "xmin" in partition key
+LINE 3: ) PARTITION BY RANGE (xmin);
+ ^
+-- cannot use pseudotypes
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (((a, b)));
+ERROR: partition key column 1 has pseudo-type record
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (a, ('unknown'));
+ERROR: partition key column 2 has pseudo-type unknown
+-- functions in key must be immutable
+CREATE FUNCTION immut_func (a int) RETURNS int AS $$ SELECT a + random()::int; $$ LANGUAGE SQL;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (immut_func(a));
+ERROR: functions in partition key expression must be marked IMMUTABLE
+DROP FUNCTION immut_func(int);
+-- prevent using columns of unsupported types in key (type must have a btree operator class)
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a);
+ERROR: data type point has no default operator class for access method "btree"
+HINT: You must specify a btree operator class or define a default btree operator class for the data type.
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a point_ops);
+ERROR: operator class "point_ops" does not exist for access method "btree"
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a);
+ERROR: data type point has no default operator class for access method "btree"
+HINT: You must specify a btree operator class or define a default btree operator class for the data type.
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a point_ops);
+ERROR: operator class "point_ops" does not exist for access method "btree"
+-- cannot add NO INHERIT constraints to partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ CONSTRAINT check_a CHECK (a > 0) NO INHERIT
+) PARTITION BY RANGE (a);
+ERROR: cannot add NO INHERIT constraint to partitioned table "partitioned"
+-- some checks after successful creation of a partitioned table
+CREATE FUNCTION plusone(a int) RETURNS INT AS $$ SELECT a+1; $$ LANGUAGE SQL;
+CREATE TABLE partitioned (
+ a int,
+ b int,
+ c text,
+ d text
+) PARTITION BY RANGE (a oid_ops, plusone(b), c collate "default", d collate "C");
+-- check relkind
+SELECT relkind FROM pg_class WHERE relname = 'partitioned';
+ relkind
+---------
+ p
+(1 row)
+
+-- prevent a function referenced in partition key from being dropped
+DROP FUNCTION plusone(int);
+ERROR: cannot drop function plusone(integer) because other objects depend on it
+DETAIL: table partitioned depends on function plusone(integer)
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+-- partitioned table cannot participate in regular inheritance
+CREATE TABLE partitioned2 (
+ a int,
+ b text
+) PARTITION BY RANGE ((a+1), substr(b, 1, 5));
+CREATE TABLE fail () INHERITS (partitioned2);
+ERROR: cannot inherit from partitioned table "partitioned2"
+-- Partition key in describe output
+\d partitioned
+ Partitioned table "public.partitioned"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+ b | integer | | |
+ c | text | | |
+ d | text | | |
+Partition key: RANGE (a oid_ops, plusone(b), c, d COLLATE "C")
+Number of partitions: 0
+
+\d+ partitioned2
+ Partitioned table "public.partitioned2"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | integer | | | | plain | |
+ b | text | | | | extended | |
+Partition key: RANGE (((a + 1)), substr(b, 1, 5))
+Number of partitions: 0
+
+INSERT INTO partitioned2 VALUES (1, 'hello');
+ERROR: no partition of relation "partitioned2" found for row
+DETAIL: Partition key of the failing row contains ((a + 1), substr(b, 1, 5)) = (2, hello).
+CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
+\d+ part2_1
+ Table "public.part2_1"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | integer | | | | plain | |
+ b | text | | | | extended | |
+Partition of: partitioned2 FOR VALUES FROM ('-1', 'aaaaa') TO (100, 'ccccc')
+Partition constraint: (((a + 1) IS NOT NULL) AND (substr(b, 1, 5) IS NOT NULL) AND (((a + 1) > '-1'::integer) OR (((a + 1) = '-1'::integer) AND (substr(b, 1, 5) >= 'aaaaa'::text))) AND (((a + 1) < 100) OR (((a + 1) = 100) AND (substr(b, 1, 5) < 'ccccc'::text))))
+
+DROP TABLE partitioned, partitioned2;
+-- check reference to partitioned table's rowtype in partition descriptor
+create table partitioned (a int, b int)
+ partition by list ((row(a, b)::partitioned));
+create table partitioned1
+ partition of partitioned for values in ('(1,2)'::partitioned);
+create table partitioned2
+ partition of partitioned for values in ('(2,4)'::partitioned);
+explain (costs off)
+select * from partitioned where row(a,b)::partitioned = '(1,2)'::partitioned;
+ QUERY PLAN
+-----------------------------------------------------------
+ Seq Scan on partitioned1 partitioned
+ Filter: (ROW(a, b)::partitioned = '(1,2)'::partitioned)
+(2 rows)
+
+drop table partitioned;
+-- whole-row Var in partition key works too
+create table partitioned (a int, b int)
+ partition by list ((partitioned));
+create table partitioned1
+ partition of partitioned for values in ('(1,2)');
+create table partitioned2
+ partition of partitioned for values in ('(2,4)');
+explain (costs off)
+select * from partitioned where partitioned = '(1,2)'::partitioned;
+ QUERY PLAN
+-----------------------------------------------------------------
+ Seq Scan on partitioned1 partitioned
+ Filter: ((partitioned.*)::partitioned = '(1,2)'::partitioned)
+(2 rows)
+
+\d+ partitioned1
+ Table "public.partitioned1"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+ b | integer | | | | plain | |
+Partition of: partitioned FOR VALUES IN ('(1,2)')
+Partition constraint: (((partitioned1.*)::partitioned IS DISTINCT FROM NULL) AND ((partitioned1.*)::partitioned = '(1,2)'::partitioned))
+
+drop table partitioned;
+-- check that dependencies of partition columns are handled correctly
+create domain intdom1 as int;
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (a);
+alter table partitioned drop column a; -- fail
+ERROR: cannot drop column "a" because it is part of the partition key of relation "partitioned"
+drop domain intdom1; -- fail, requires cascade
+ERROR: cannot drop type intdom1 because other objects depend on it
+DETAIL: table partitioned depends on type intdom1
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+drop domain intdom1 cascade;
+NOTICE: drop cascades to table partitioned
+table partitioned; -- gone
+ERROR: relation "partitioned" does not exist
+LINE 1: table partitioned;
+ ^
+-- likewise for columns used in partition expressions
+create domain intdom1 as int;
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (plusone(a));
+alter table partitioned drop column a; -- fail
+ERROR: cannot drop column "a" because it is part of the partition key of relation "partitioned"
+drop domain intdom1; -- fail, requires cascade
+ERROR: cannot drop type intdom1 because other objects depend on it
+DETAIL: table partitioned depends on type intdom1
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+drop domain intdom1 cascade;
+NOTICE: drop cascades to table partitioned
+table partitioned; -- gone
+ERROR: relation "partitioned" does not exist
+LINE 1: table partitioned;
+ ^
+--
+-- Partitions
+--
+-- check partition bound syntax
+CREATE TABLE list_parted (
+ a int
+) PARTITION BY LIST (a);
+CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
+CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
+CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
+CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
+\d+ list_parted
+ Partitioned table "public.list_parted"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+Partition key: LIST (a)
+Partitions: part_null FOR VALUES IN (NULL),
+ part_p1 FOR VALUES IN (1),
+ part_p2 FOR VALUES IN (2),
+ part_p3 FOR VALUES IN (3)
+
+-- forbidden expressions for partition bound with list partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
+ERROR: cannot use column reference in partition bound expression
+LINE 1: ...expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
+ERROR: cannot use column reference in partition bound expression
+LINE 1: ...expr_fail PARTITION OF list_parted FOR VALUES IN (somename.s...
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
+ERROR: cannot use column reference in partition bound expression
+LINE 1: ..._bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
+ERROR: cannot use column reference in partition bound expression
+LINE 1: ...s_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
+ERROR: cannot use column reference in partition bound expression
+LINE 1: ..._fail PARTITION OF list_parted FOR VALUES IN (sum(somename))...
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
+ERROR: aggregate functions are not allowed in partition bound
+LINE 1: ...s_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
+ERROR: cannot use subquery in partition bound
+LINE 1: ...expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1)...
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
+ERROR: set-returning functions are not allowed in partition bound
+LINE 1: ...expr_fail PARTITION OF list_parted FOR VALUES IN (generate_s...
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
+ERROR: collations are not supported by type integer
+LINE 1: ...ail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "P...
+ ^
+-- syntax does not allow empty list of values for list partitions
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+ERROR: syntax error at or near ")"
+LINE 1: ...E TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+ ^
+-- trying to specify range for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES FROM (1) TO (2);
+ERROR: invalid bound specification for a list partition
+LINE 1: ...BLE fail_part PARTITION OF list_parted FOR VALUES FROM (1) T...
+ ^
+-- trying to specify modulus and remainder for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ERROR: invalid bound specification for a list partition
+LINE 1: ...BLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODU...
+ ^
+-- check default partition cannot be created more than once
+CREATE TABLE part_default PARTITION OF list_parted DEFAULT;
+CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
+ERROR: partition "fail_default_part" conflicts with existing default partition "part_default"
+LINE 1: ...TE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
+ ^
+-- specified literal can't be cast to the partition column data type
+CREATE TABLE bools (
+ a bool
+) PARTITION BY LIST (a);
+CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
+ERROR: specified value cannot be cast to type boolean for column "a"
+LINE 1: ...REATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
+ ^
+DROP TABLE bools;
+-- specified literal can be cast, and the cast might not be immutable
+CREATE TABLE moneyp (
+ a money
+) PARTITION BY LIST (a);
+CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
+CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
+CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
+DROP TABLE moneyp;
+-- cast is immutable
+CREATE TABLE bigintp (
+ a bigint
+) PARTITION BY LIST (a);
+CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
+-- fails due to overlap:
+CREATE TABLE bigintp_10_2 PARTITION OF bigintp FOR VALUES IN ('10');
+ERROR: partition "bigintp_10_2" would overlap partition "bigintp_10"
+LINE 1: ...ABLE bigintp_10_2 PARTITION OF bigintp FOR VALUES IN ('10');
+ ^
+DROP TABLE bigintp;
+CREATE TABLE range_parted (
+ a date
+) PARTITION BY RANGE (a);
+-- forbidden expressions for partition bounds with range partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename) TO ('2019-01-01');
+ERROR: cannot use column reference in partition bound expression
+LINE 2: FOR VALUES FROM (somename) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename.somename) TO ('2019-01-01');
+ERROR: cannot use column reference in partition bound expression
+LINE 2: FOR VALUES FROM (somename.somename) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (a) TO ('2019-01-01');
+ERROR: cannot use column reference in partition bound expression
+LINE 2: FOR VALUES FROM (a) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(a)) TO ('2019-01-01');
+ERROR: cannot use column reference in partition bound expression
+LINE 2: FOR VALUES FROM (max(a)) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(somename)) TO ('2019-01-01');
+ERROR: cannot use column reference in partition bound expression
+LINE 2: FOR VALUES FROM (max(somename)) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max('2019-02-01'::date)) TO ('2019-01-01');
+ERROR: aggregate functions are not allowed in partition bound
+LINE 2: FOR VALUES FROM (max('2019-02-01'::date)) TO ('2019-01-01'...
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM ((select 1)) TO ('2019-01-01');
+ERROR: cannot use subquery in partition bound
+LINE 2: FOR VALUES FROM ((select 1)) TO ('2019-01-01');
+ ^
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (generate_series(1, 3)) TO ('2019-01-01');
+ERROR: set-returning functions are not allowed in partition bound
+LINE 2: FOR VALUES FROM (generate_series(1, 3)) TO ('2019-01-01');
+ ^
+-- trying to specify list for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES IN ('a');
+ERROR: invalid bound specification for a range partition
+LINE 1: ...BLE fail_part PARTITION OF range_parted FOR VALUES IN ('a');
+ ^
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ERROR: invalid bound specification for a range partition
+LINE 1: ...LE fail_part PARTITION OF range_parted FOR VALUES WITH (MODU...
+ ^
+-- each of start and end bounds must have same number of values as the
+-- length of the partition key
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('z');
+ERROR: FROM must specify exactly one value per partitioning column
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
+ERROR: TO must specify exactly one value per partitioning column
+-- cannot specify null values in range bounds
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM (null) TO (maxvalue);
+ERROR: cannot specify NULL in range bound
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+ERROR: invalid bound specification for a range partition
+LINE 1: ...LE fail_part PARTITION OF range_parted FOR VALUES WITH (MODU...
+ ^
+-- check partition bound syntax for the hash partition
+CREATE TABLE hash_parted (
+ a int
+) PARTITION BY HASH (a);
+CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
+CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
+CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
+CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
+-- modulus 25 is factor of modulus of 50 but 10 is not a factor of 25.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
+ERROR: every hash partition modulus must be a factor of the next larger modulus
+DETAIL: The new modulus 25 is not divisible by 10, the modulus of existing partition "hpart_4".
+-- previous modulus 50 is factor of 150 but this modulus is not a factor of next modulus 200.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
+ERROR: every hash partition modulus must be a factor of the next larger modulus
+DETAIL: The new modulus 150 is not a factor of 200, the modulus of existing partition "hpart_3".
+-- overlapping remainders
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
+ERROR: partition "fail_part" would overlap partition "hpart_4"
+LINE 1: ...BLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODU...
+ ^
+-- trying to specify range for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES FROM ('a', 1) TO ('z');
+ERROR: invalid bound specification for a hash partition
+LINE 1: ...BLE fail_part PARTITION OF hash_parted FOR VALUES FROM ('a',...
+ ^
+-- trying to specify list value for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES IN (1000);
+ERROR: invalid bound specification for a hash partition
+LINE 1: ...BLE fail_part PARTITION OF hash_parted FOR VALUES IN (1000);
+ ^
+-- trying to create default partition for the hash partitioned table
+CREATE TABLE fail_default_part PARTITION OF hash_parted DEFAULT;
+ERROR: a hash-partitioned table may not have a default partition
+-- check if compatible with the specified parent
+-- cannot create as partition of a non-partitioned table
+CREATE TABLE unparted (
+ a int
+);
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
+ERROR: "unparted" is not partitioned
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+ERROR: "unparted" is not partitioned
+DROP TABLE unparted;
+-- cannot create a permanent rel as partition of a temp rel
+CREATE TEMP TABLE temp_parted (
+ a int
+) PARTITION BY LIST (a);
+CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
+ERROR: cannot create a permanent relation as partition of temporary relation "temp_parted"
+DROP TABLE temp_parted;
+-- check for partition bound overlap and other invalid specifications
+CREATE TABLE list_parted2 (
+ a varchar
+) PARTITION BY LIST (a);
+CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
+CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
+CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
+ERROR: partition "fail_part" would overlap partition "part_null_z"
+LINE 1: ...LE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
+ ^
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
+ERROR: partition "fail_part" would overlap partition "part_ab"
+LINE 1: ...ail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
+ ^
+-- check default partition overlap
+INSERT INTO list_parted2 VALUES('X');
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
+ERROR: updated partition constraint for default partition "list_parted2_def" would be violated by some row
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE (a);
+-- trying to create range partition with empty range
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (0);
+ERROR: empty range bound specified for partition "fail_part"
+LINE 1: ..._part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (0);
+ ^
+DETAIL: Specified lower bound (1) is greater than or equal to upper bound (0).
+-- note that the range '[1, 1)' has no elements
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (1);
+ERROR: empty range bound specified for partition "fail_part"
+LINE 1: ..._part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (1);
+ ^
+DETAIL: Specified lower bound (1) is greater than or equal to upper bound (1).
+CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
+ERROR: partition "fail_part" would overlap partition "part0"
+LINE 1: ..._part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) ...
+ ^
+CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
+ERROR: partition "fail_part" would overlap partition "part0"
+LINE 1: ..._part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1)...
+ ^
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
+ERROR: partition "fail_part" would overlap partition "part1"
+LINE 1: ..._part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (max...
+ ^
+CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
+CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
+ERROR: partition "fail_part" would overlap partition "part2"
+LINE 1: ...art PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
+ ^
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
+ERROR: partition "fail_part" would overlap partition "part2"
+LINE 1: ...art PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
+ ^
+-- Create a default partition for range partitioned table
+CREATE TABLE range2_default PARTITION OF range_parted2 DEFAULT;
+-- More than one default partition is not allowed, so this should give error
+CREATE TABLE fail_default_part PARTITION OF range_parted2 DEFAULT;
+ERROR: partition "fail_default_part" conflicts with existing default partition "range2_default"
+LINE 1: ... TABLE fail_default_part PARTITION OF range_parted2 DEFAULT;
+ ^
+-- Check if the range for default partitions overlap
+INSERT INTO range_parted2 VALUES (85);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
+ERROR: updated partition constraint for default partition "range2_default" would be violated by some row
+CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
+-- now check for multi-column range partition key
+CREATE TABLE range_parted3 (
+ a int,
+ b int
+) PARTITION BY RANGE (a, (b+1));
+CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
+ERROR: partition "fail_part" would overlap partition "part00"
+LINE 1: ..._part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalu...
+ ^
+CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
+CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
+CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
+ERROR: partition "fail_part" would overlap partition "part12"
+LINE 1: ...rt PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1,...
+ ^
+CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
+-- cannot create a partition that says column b is allowed to range
+-- from -infinity to +infinity, while there exist partitions that have
+-- more specific ranges
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, maxvalue);
+ERROR: partition "fail_part" would overlap partition "part10"
+LINE 1: ..._part PARTITION OF range_parted3 FOR VALUES FROM (1, minvalu...
+ ^
+-- check for partition bound overlap and other invalid specifications for the hash partition
+CREATE TABLE hash_parted2 (
+ a varchar
+) PARTITION BY HASH (a);
+CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
+-- overlap with part_4
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+ERROR: partition "fail_part" would overlap partition "h2part_4"
+LINE 1: ...LE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODU...
+ ^
+-- modulus must be greater than zero
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+ERROR: modulus for hash partition must be an integer value greater than zero
+-- remainder must be greater than or equal to zero and less than modulus
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+ERROR: remainder for hash partition must be less than modulus
+-- check schema propagation from parent
+CREATE TABLE parted (
+ a text,
+ b int NOT NULL DEFAULT 0,
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) PARTITION BY LIST (a);
+CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+-- only inherited attributes (never local ones)
+SELECT attname, attislocal, attinhcount FROM pg_attribute
+ WHERE attrelid = 'part_a'::regclass and attnum > 0
+ ORDER BY attnum;
+ attname | attislocal | attinhcount
+---------+------------+-------------
+ a | f | 1
+ b | f | 1
+(2 rows)
+
+-- able to specify column default, column constraint, and table constraint
+-- first check the "column specified more than once" error
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL,
+ b DEFAULT 1,
+ b CHECK (b >= 0),
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) FOR VALUES IN ('b');
+ERROR: column "b" specified more than once
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL DEFAULT 1,
+ CONSTRAINT check_a CHECK (length(a) > 0),
+ CONSTRAINT check_b CHECK (b >= 0)
+) FOR VALUES IN ('b');
+NOTICE: merging constraint "check_a" with inherited definition
+-- conislocal should be false for any merged constraints, true otherwise
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass ORDER BY conislocal, coninhcount;
+ conislocal | coninhcount
+------------+-------------
+ f | 1
+ t | 0
+(2 rows)
+
+-- Once check_b is added to the parent, it should be made non-local for part_b
+ALTER TABLE parted ADD CONSTRAINT check_b CHECK (b >= 0);
+NOTICE: merging constraint "check_b" with inherited definition
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+ conislocal | coninhcount
+------------+-------------
+ f | 1
+ f | 1
+(2 rows)
+
+-- Neither check_a nor check_b are droppable from part_b
+ALTER TABLE part_b DROP CONSTRAINT check_a;
+ERROR: cannot drop inherited constraint "check_a" of relation "part_b"
+ALTER TABLE part_b DROP CONSTRAINT check_b;
+ERROR: cannot drop inherited constraint "check_b" of relation "part_b"
+-- And dropping it from parted should leave no trace of them on part_b, unlike
+-- traditional inheritance where they will be left behind, because they would
+-- be local constraints.
+ALTER TABLE parted DROP CONSTRAINT check_a, DROP CONSTRAINT check_b;
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+ conislocal | coninhcount
+------------+-------------
+(0 rows)
+
+-- specify PARTITION BY for a partition
+CREATE TABLE fail_part_col_not_found PARTITION OF parted FOR VALUES IN ('c') PARTITION BY RANGE (c);
+ERROR: column "c" named in partition key does not exist
+LINE 1: ...TITION OF parted FOR VALUES IN ('c') PARTITION BY RANGE (c);
+ ^
+CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
+-- create a level-2 partition
+CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
+-- check that NOT NULL and default value are inherited correctly
+create table parted_notnull_inh_test (a int default 1, b int not null default 0) partition by list (a);
+create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
+insert into parted_notnull_inh_test (b) values (null);
+ERROR: null value in column "b" of relation "parted_notnull_inh_test1" violates not-null constraint
+DETAIL: Failing row contains (1, null).
+-- note that while b's default is overriden, a's default is preserved
+\d parted_notnull_inh_test1
+ Table "public.parted_notnull_inh_test1"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | not null | 1
+ b | integer | | not null | 1
+Partition of: parted_notnull_inh_test FOR VALUES IN (1)
+
+drop table parted_notnull_inh_test;
+-- check that collations are assigned in partition bound expressions
+create table parted_boolean_col (a bool, b text) partition by list(a);
+create table parted_boolean_less partition of parted_boolean_col
+ for values in ('foo' < 'bar');
+create table parted_boolean_greater partition of parted_boolean_col
+ for values in ('foo' > 'bar');
+drop table parted_boolean_col;
+-- check for a conflicting COLLATE clause
+create table parted_collate_must_match (a text collate "C", b text collate "C")
+ partition by range (a);
+-- on the partition key
+create table parted_collate_must_match1 partition of parted_collate_must_match
+ (a collate "POSIX") for values from ('a') to ('m');
+-- on another column
+create table parted_collate_must_match2 partition of parted_collate_must_match
+ (b collate "POSIX") for values from ('m') to ('z');
+drop table parted_collate_must_match;
+-- check that non-matching collations for partition bound
+-- expressions are coerced to the right collation
+create table test_part_coll_posix (a text) partition by range (a collate "POSIX");
+-- ok, collation is implicitly coerced
+create table test_part_coll partition of test_part_coll_posix for values from ('a' collate "C") to ('g');
+-- ok
+create table test_part_coll2 partition of test_part_coll_posix for values from ('g') to ('m');
+-- ok, collation is implicitly coerced
+create table test_part_coll_cast partition of test_part_coll_posix for values from (name 'm' collate "C") to ('s');
+-- ok; partition collation silently overrides the default collation of type 'name'
+create table test_part_coll_cast2 partition of test_part_coll_posix for values from (name 's') to ('z');
+drop table test_part_coll_posix;
+-- Partition bound in describe output
+\d+ part_b
+ Table "public.part_b"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | not null | 1 | plain | |
+Partition of: parted FOR VALUES IN ('b')
+Partition constraint: ((a IS NOT NULL) AND (a = 'b'::text))
+
+-- Both partition bound and partition key in describe output
+\d+ part_c
+ Partitioned table "public.part_c"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | not null | 0 | plain | |
+Partition of: parted FOR VALUES IN ('c')
+Partition constraint: ((a IS NOT NULL) AND (a = 'c'::text))
+Partition key: RANGE (b)
+Partitions: part_c_1_10 FOR VALUES FROM (1) TO (10)
+
+-- a level-2 partition's constraint will include the parent's expressions
+\d+ part_c_1_10
+ Table "public.part_c_1_10"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | not null | 0 | plain | |
+Partition of: part_c FOR VALUES FROM (1) TO (10)
+Partition constraint: ((a IS NOT NULL) AND (a = 'c'::text) AND (b IS NOT NULL) AND (b >= 1) AND (b < 10))
+
+-- Show partition count in the parent's describe output
+-- Tempted to include \d+ output listing partitions with bound info but
+-- output could vary depending on the order in which partition oids are
+-- returned.
+\d parted
+ Partitioned table "public.parted"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | text | | |
+ b | integer | | not null | 0
+Partition key: LIST (a)
+Number of partitions: 3 (Use \d+ to list them.)
+
+\d hash_parted
+ Partitioned table "public.hash_parted"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+Partition key: HASH (a)
+Number of partitions: 4 (Use \d+ to list them.)
+
+-- check that we get the expected partition constraints
+CREATE TABLE range_parted4 (a int, b int, c int) PARTITION BY RANGE (abs(a), abs(b), c);
+CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
+\d+ unbounded_range_part
+ Table "public.unbounded_range_part"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+ b | integer | | | | plain | |
+ c | integer | | | | plain | |
+Partition of: range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE)
+Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL))
+
+DROP TABLE unbounded_range_part;
+CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
+\d+ range_parted4_1
+ Table "public.range_parted4_1"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+ b | integer | | | | plain | |
+ c | integer | | | | plain | |
+Partition of: range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE)
+Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND (abs(a) <= 1))
+
+CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
+\d+ range_parted4_2
+ Table "public.range_parted4_2"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+ b | integer | | | | plain | |
+ c | integer | | | | plain | |
+Partition of: range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE)
+Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND ((abs(a) > 3) OR ((abs(a) = 3) AND (abs(b) > 4)) OR ((abs(a) = 3) AND (abs(b) = 4) AND (c >= 5))) AND ((abs(a) < 6) OR ((abs(a) = 6) AND (abs(b) <= 7))))
+
+CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
+\d+ range_parted4_3
+ Table "public.range_parted4_3"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+ b | integer | | | | plain | |
+ c | integer | | | | plain | |
+Partition of: range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE)
+Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND ((abs(a) > 6) OR ((abs(a) = 6) AND (abs(b) >= 8))) AND (abs(a) <= 9))
+
+DROP TABLE range_parted4;
+-- user-defined operator class in partition key
+CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql
+ AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 1 ELSE -1 END; $$;
+CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
+ OPERATOR 1 < (int4,int4), OPERATOR 2 <= (int4,int4),
+ OPERATOR 3 = (int4,int4), OPERATOR 4 >= (int4,int4),
+ OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4);
+CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
+CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
+INSERT INTO partkey_t VALUES (100);
+INSERT INTO partkey_t VALUES (200);
+-- cleanup
+DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
+DROP TABLE partkey_t, hash_parted, hash_parted2;
+DROP OPERATOR CLASS test_int4_ops USING btree;
+DROP FUNCTION my_int4_sort(int4,int4);
+-- comments on partitioned tables columns
+CREATE TABLE parted_col_comment (a int, b text) PARTITION BY LIST (a);
+COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
+COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
+SELECT obj_description('parted_col_comment'::regclass);
+ obj_description
+----------------------
+ Am partitioned table
+(1 row)
+
+\d+ parted_col_comment
+ Partitioned table "public.parted_col_comment"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+---------------
+ a | integer | | | | plain | | Partition key
+ b | text | | | | extended | |
+Partition key: LIST (a)
+Number of partitions: 0
+
+DROP TABLE parted_col_comment;
+-- list partitioning on array type column
+CREATE TABLE arrlp (a int[]) PARTITION BY LIST (a);
+CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
+\d+ arrlp12
+ Table "public.arrlp12"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+-----------+-----------+----------+---------+----------+--------------+-------------
+ a | integer[] | | | | extended | |
+Partition of: arrlp FOR VALUES IN ('{1}', '{2}')
+Partition constraint: ((a IS NOT NULL) AND ((a = '{1}'::integer[]) OR (a = '{2}'::integer[])))
+
+DROP TABLE arrlp;
+-- partition on boolean column
+create table boolspart (a bool) partition by list (a);
+create table boolspart_t partition of boolspart for values in (true);
+create table boolspart_f partition of boolspart for values in (false);
+\d+ boolspart
+ Partitioned table "public.boolspart"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | boolean | | | | plain | |
+Partition key: LIST (a)
+Partitions: boolspart_f FOR VALUES IN (false),
+ boolspart_t FOR VALUES IN (true)
+
+drop table boolspart;
+-- partitions mixing temporary and permanent relations
+create table perm_parted (a int) partition by list (a);
+create temporary table temp_parted (a int) partition by list (a);
+create table perm_part partition of temp_parted default; -- error
+ERROR: cannot create a permanent relation as partition of temporary relation "temp_parted"
+create temp table temp_part partition of perm_parted default; -- error
+ERROR: cannot create a temporary relation as partition of permanent relation "perm_parted"
+create temp table temp_part partition of temp_parted default; -- ok
+drop table perm_parted cascade;
+drop table temp_parted cascade;
+-- check that adding partitions to a table while it is being used is prevented
+create table tab_part_create (a int) partition by list (a);
+create or replace function func_part_create() returns trigger
+ language plpgsql as $$
+ begin
+ execute 'create table tab_part_create_1 partition of tab_part_create for values in (1)';
+ return null;
+ end $$;
+create trigger trig_part_create before insert on tab_part_create
+ for each statement execute procedure func_part_create();
+insert into tab_part_create values (1);
+ERROR: cannot CREATE TABLE .. PARTITION OF "tab_part_create" because it is being used by active queries in this session
+CONTEXT: SQL statement "create table tab_part_create_1 partition of tab_part_create for values in (1)"
+PL/pgSQL function func_part_create() line 3 at EXECUTE
+drop table tab_part_create;
+drop function func_part_create();
+-- test using a volatile expression as partition bound
+create table volatile_partbound_test (partkey timestamp) partition by range (partkey);
+create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
+create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
+-- this should go into the partition volatile_partbound_test2
+insert into volatile_partbound_test values (current_timestamp);
+select tableoid::regclass from volatile_partbound_test;
+ tableoid
+--------------------------
+ volatile_partbound_test2
+(1 row)
+
+drop table volatile_partbound_test;
+-- test the case where a check constraint on default partition allows
+-- to avoid scanning it when adding a new partition
+create table defcheck (a int, b int) partition by list (b);
+create table defcheck_def (a int, c int, b int);
+alter table defcheck_def drop c;
+alter table defcheck attach partition defcheck_def default;
+alter table defcheck_def add check (b <= 0 and b is not null);
+create table defcheck_1 partition of defcheck for values in (1, null);
+-- test that complex default partition constraints are enforced correctly
+insert into defcheck_def values (0, 0);
+create table defcheck_0 partition of defcheck for values in (0);
+ERROR: updated partition constraint for default partition "defcheck_def" would be violated by some row
+drop table defcheck;
+-- tests of column drop with partition tables and indexes using
+-- predicates and expressions.
+create table part_column_drop (
+ useless_1 int,
+ id int,
+ useless_2 int,
+ d int,
+ b int,
+ useless_3 int
+) partition by range (id);
+alter table part_column_drop drop column useless_1;
+alter table part_column_drop drop column useless_2;
+alter table part_column_drop drop column useless_3;
+create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
+create index part_column_drop_b_expr on part_column_drop((b = 1));
+create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
+create index part_column_drop_d_expr on part_column_drop((d = 2));
+create table part_column_drop_1_10 partition of
+ part_column_drop for values from (1) to (10);
+\d part_column_drop
+ Partitioned table "public.part_column_drop"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+ d | integer | | |
+ b | integer | | |
+Partition key: RANGE (id)
+Indexes:
+ "part_column_drop_b_expr" btree ((b = 1))
+ "part_column_drop_b_pred" btree (b) WHERE b = 1
+ "part_column_drop_d_expr" btree ((d = 2))
+ "part_column_drop_d_pred" btree (d) WHERE d = 2
+Number of partitions: 1 (Use \d+ to list them.)
+
+\d part_column_drop_1_10
+ Table "public.part_column_drop_1_10"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+ d | integer | | |
+ b | integer | | |
+Partition of: part_column_drop FOR VALUES FROM (1) TO (10)
+Indexes:
+ "part_column_drop_1_10_b_idx" btree (b) WHERE b = 1
+ "part_column_drop_1_10_d_idx" btree (d) WHERE d = 2
+ "part_column_drop_1_10_expr_idx" btree ((b = 1))
+ "part_column_drop_1_10_expr_idx1" btree ((d = 2))
+
+drop table part_column_drop;
diff --git a/yql/essentials/tests/postgresql/original/cases/create_table.sql b/yql/essentials/tests/postgresql/original/cases/create_table.sql
new file mode 100644
index 0000000000..cc41f58ba2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/create_table.sql
@@ -0,0 +1,977 @@
+--
+-- CREATE_TABLE
+--
+
+--
+-- CLASS DEFINITIONS
+--
+CREATE TABLE hobbies_r (
+ name text,
+ person text
+);
+
+CREATE TABLE equipment_r (
+ name text,
+ hobby text
+);
+
+CREATE TABLE onek (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+CREATE TABLE tenk1 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+CREATE TABLE tenk2 (
+ unique1 int4,
+ unique2 int4,
+ two int4,
+ four int4,
+ ten int4,
+ twenty int4,
+ hundred int4,
+ thousand int4,
+ twothousand int4,
+ fivethous int4,
+ tenthous int4,
+ odd int4,
+ even int4,
+ stringu1 name,
+ stringu2 name,
+ string4 name
+);
+
+
+CREATE TABLE person (
+ name text,
+ age int4,
+ location point
+);
+
+
+CREATE TABLE emp (
+ salary int4,
+ manager name
+) INHERITS (person);
+
+
+CREATE TABLE student (
+ gpa float8
+) INHERITS (person);
+
+
+CREATE TABLE stud_emp (
+ percent int4
+) INHERITS (emp, student);
+
+
+CREATE TABLE city (
+ name name,
+ location box,
+ budget city_budget
+);
+
+CREATE TABLE dept (
+ dname name,
+ mgrname text
+);
+
+CREATE TABLE slow_emp4000 (
+ home_base box
+);
+
+CREATE TABLE fast_emp4000 (
+ home_base box
+);
+
+CREATE TABLE road (
+ name text,
+ thepath path
+);
+
+CREATE TABLE ihighway () INHERITS (road);
+
+CREATE TABLE shighway (
+ surface text
+) INHERITS (road);
+
+CREATE TABLE real_city (
+ pop int4,
+ cname text,
+ outline path
+);
+
+--
+-- test the "star" operators a bit more thoroughly -- this time,
+-- throw in lots of NULL fields...
+--
+-- a is the type root
+-- b and c inherit from a (one-level single inheritance)
+-- d inherits from b and c (two-level multiple inheritance)
+-- e inherits from c (two-level single inheritance)
+-- f inherits from e (three-level single inheritance)
+--
+CREATE TABLE a_star (
+ class char,
+ a int4
+);
+
+CREATE TABLE b_star (
+ b text
+) INHERITS (a_star);
+
+CREATE TABLE c_star (
+ c name
+) INHERITS (a_star);
+
+CREATE TABLE d_star (
+ d float8
+) INHERITS (b_star, c_star);
+
+CREATE TABLE e_star (
+ e int2
+) INHERITS (c_star);
+
+CREATE TABLE f_star (
+ f polygon
+) INHERITS (e_star);
+
+CREATE TABLE aggtest (
+ a int2,
+ b float4
+);
+
+CREATE TABLE hash_i4_heap (
+ seqno int4,
+ random int4
+);
+
+CREATE TABLE hash_name_heap (
+ seqno int4,
+ random name
+);
+
+CREATE TABLE hash_txt_heap (
+ seqno int4,
+ random text
+);
+
+CREATE TABLE hash_f8_heap (
+ seqno int4,
+ random float8
+);
+
+-- don't include the hash_ovfl_heap stuff in the distribution
+-- the data set is too large for what it's worth
+--
+-- CREATE TABLE hash_ovfl_heap (
+-- x int4,
+-- y int4
+-- );
+
+CREATE TABLE bt_i4_heap (
+ seqno int4,
+ random int4
+);
+
+CREATE TABLE bt_name_heap (
+ seqno name,
+ random int4
+);
+
+CREATE TABLE bt_txt_heap (
+ seqno text,
+ random int4
+);
+
+CREATE TABLE bt_f8_heap (
+ seqno float8,
+ random int4
+);
+
+CREATE TABLE array_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+
+CREATE TABLE array_index_op_test (
+ seqno int4,
+ i int4[],
+ t text[]
+);
+
+CREATE TABLE testjsonb (
+ j jsonb
+);
+
+CREATE TABLE unknowntab (
+ u unknown -- fail
+);
+
+CREATE TYPE unknown_comptype AS (
+ u unknown -- fail
+);
+
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text,
+ a tsvector
+);
+
+CREATE TABLE IF NOT EXISTS test_tsvector(
+ t text
+);
+
+-- invalid: non-lowercase quoted reloptions identifiers
+CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
+
+CREATE UNLOGGED TABLE unlogged1 (a int primary key); -- OK
+CREATE TEMPORARY TABLE unlogged2 (a int primary key); -- OK
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+REINDEX INDEX unlogged1_pkey;
+REINDEX INDEX unlogged2_pkey;
+SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+DROP TABLE unlogged2;
+INSERT INTO unlogged1 VALUES (42);
+CREATE UNLOGGED TABLE public.unlogged2 (a int primary key); -- also OK
+CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key); -- not OK
+CREATE TABLE pg_temp.implicitly_temp (a int primary key); -- OK
+CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+CREATE TEMP TABLE pg_temp.doubly_temp (a int primary key); -- also OK
+CREATE TEMP TABLE public.temp_to_perm (a int primary key); -- not OK
+DROP TABLE unlogged1, public.unlogged2;
+
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+CREATE TABLE IF NOT EXISTS as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+DROP TABLE as_select1;
+
+PREPARE select1 AS SELECT 1 as a;
+CREATE TABLE as_select1 AS EXECUTE select1;
+CREATE TABLE as_select1 AS EXECUTE select1;
+SELECT * FROM as_select1;
+CREATE TABLE IF NOT EXISTS as_select1 AS EXECUTE select1;
+DROP TABLE as_select1;
+DEALLOCATE select1;
+
+-- create an extra wide table to test for issues related to that
+-- (temporarily hide query, to avoid the long CREATE TABLE stmt)
+\set ECHO none
+SELECT 'CREATE TABLE extra_wide_table(firstc text, '|| array_to_string(array_agg('c'||i||' bool'),',')||', lastc text);'
+FROM generate_series(1, 1100) g(i)
+\gexec
+\set ECHO all
+INSERT INTO extra_wide_table(firstc, lastc) VALUES('first col', 'last col');
+SELECT firstc, lastc FROM extra_wide_table;
+
+-- check that tables with oids cannot be created anymore
+CREATE TABLE withoid() WITH OIDS;
+CREATE TABLE withoid() WITH (oids);
+CREATE TABLE withoid() WITH (oids = true);
+
+-- but explicitly not adding oids is still supported
+CREATE TEMP TABLE withoutoid() WITHOUT OIDS; DROP TABLE withoutoid;
+CREATE TEMP TABLE withoutoid() WITH (oids = false); DROP TABLE withoutoid;
+
+-- check restriction with default expressions
+-- invalid use of column reference in default expressions
+CREATE TABLE default_expr_column (id int DEFAULT (id));
+CREATE TABLE default_expr_column (id int DEFAULT (bar.id));
+CREATE TABLE default_expr_agg_column (id int DEFAULT (avg(id)));
+-- invalid column definition
+CREATE TABLE default_expr_non_column (a int DEFAULT (avg(non_existent)));
+-- invalid use of aggregate
+CREATE TABLE default_expr_agg (a int DEFAULT (avg(1)));
+-- invalid use of subquery
+CREATE TABLE default_expr_agg (a int DEFAULT (select 1));
+-- invalid use of set-returning function
+CREATE TABLE default_expr_agg (a int DEFAULT (generate_series(1,3)));
+
+-- Verify that subtransaction rollback restores rd_createSubid.
+BEGIN;
+CREATE TABLE remember_create_subid (c int);
+SAVEPOINT q; DROP TABLE remember_create_subid; ROLLBACK TO q;
+COMMIT;
+DROP TABLE remember_create_subid;
+
+-- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+CREATE TABLE remember_node_subid (c int);
+BEGIN;
+ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+SAVEPOINT q; DROP TABLE remember_node_subid; ROLLBACK TO q;
+COMMIT;
+DROP TABLE remember_node_subid;
+
+--
+-- Partitioned tables
+--
+
+-- cannot combine INHERITS and PARTITION BY (although grammar allows)
+CREATE TABLE partitioned (
+ a int
+) INHERITS (some_table) PARTITION BY LIST (a);
+
+-- cannot use more than 1 column as partition key for list partitioned table
+CREATE TABLE partitioned (
+ a1 int,
+ a2 int
+) PARTITION BY LIST (a1, a2); -- fail
+
+-- unsupported constraint type for partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ EXCLUDE USING gist (a WITH &&)
+) PARTITION BY RANGE (a);
+
+-- prevent using prohibited expressions in the key
+CREATE FUNCTION retset (a int) RETURNS SETOF int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (retset(a));
+DROP FUNCTION retset(int);
+
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((avg(a)));
+
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE ((avg(a) OVER (PARTITION BY b)));
+
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY LIST ((a LIKE (SELECT 1)));
+
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE ((42));
+
+CREATE FUNCTION const_func () RETURNS int AS $$ SELECT 1; $$ LANGUAGE SQL IMMUTABLE;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (const_func());
+DROP FUNCTION const_func();
+
+-- only accept valid partitioning strategy
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY MAGIC (a);
+
+-- specified column must be present in the table
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (b);
+
+-- cannot use system columns in partition key
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (xmin);
+
+-- cannot use pseudotypes
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (((a, b)));
+CREATE TABLE partitioned (
+ a int,
+ b int
+) PARTITION BY RANGE (a, ('unknown'));
+
+-- functions in key must be immutable
+CREATE FUNCTION immut_func (a int) RETURNS int AS $$ SELECT a + random()::int; $$ LANGUAGE SQL;
+CREATE TABLE partitioned (
+ a int
+) PARTITION BY RANGE (immut_func(a));
+DROP FUNCTION immut_func(int);
+
+-- prevent using columns of unsupported types in key (type must have a btree operator class)
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a);
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY LIST (a point_ops);
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a);
+CREATE TABLE partitioned (
+ a point
+) PARTITION BY RANGE (a point_ops);
+
+-- cannot add NO INHERIT constraints to partitioned tables
+CREATE TABLE partitioned (
+ a int,
+ CONSTRAINT check_a CHECK (a > 0) NO INHERIT
+) PARTITION BY RANGE (a);
+
+-- some checks after successful creation of a partitioned table
+CREATE FUNCTION plusone(a int) RETURNS INT AS $$ SELECT a+1; $$ LANGUAGE SQL;
+
+CREATE TABLE partitioned (
+ a int,
+ b int,
+ c text,
+ d text
+) PARTITION BY RANGE (a oid_ops, plusone(b), c collate "default", d collate "C");
+
+-- check relkind
+SELECT relkind FROM pg_class WHERE relname = 'partitioned';
+
+-- prevent a function referenced in partition key from being dropped
+DROP FUNCTION plusone(int);
+
+-- partitioned table cannot participate in regular inheritance
+CREATE TABLE partitioned2 (
+ a int,
+ b text
+) PARTITION BY RANGE ((a+1), substr(b, 1, 5));
+CREATE TABLE fail () INHERITS (partitioned2);
+
+-- Partition key in describe output
+\d partitioned
+\d+ partitioned2
+
+INSERT INTO partitioned2 VALUES (1, 'hello');
+CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
+\d+ part2_1
+
+DROP TABLE partitioned, partitioned2;
+
+-- check reference to partitioned table's rowtype in partition descriptor
+create table partitioned (a int, b int)
+ partition by list ((row(a, b)::partitioned));
+create table partitioned1
+ partition of partitioned for values in ('(1,2)'::partitioned);
+create table partitioned2
+ partition of partitioned for values in ('(2,4)'::partitioned);
+explain (costs off)
+select * from partitioned where row(a,b)::partitioned = '(1,2)'::partitioned;
+drop table partitioned;
+
+-- whole-row Var in partition key works too
+create table partitioned (a int, b int)
+ partition by list ((partitioned));
+create table partitioned1
+ partition of partitioned for values in ('(1,2)');
+create table partitioned2
+ partition of partitioned for values in ('(2,4)');
+explain (costs off)
+select * from partitioned where partitioned = '(1,2)'::partitioned;
+\d+ partitioned1
+drop table partitioned;
+
+-- check that dependencies of partition columns are handled correctly
+create domain intdom1 as int;
+
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (a);
+
+alter table partitioned drop column a; -- fail
+
+drop domain intdom1; -- fail, requires cascade
+
+drop domain intdom1 cascade;
+
+table partitioned; -- gone
+
+-- likewise for columns used in partition expressions
+create domain intdom1 as int;
+
+create table partitioned (
+ a intdom1,
+ b text
+) partition by range (plusone(a));
+
+alter table partitioned drop column a; -- fail
+
+drop domain intdom1; -- fail, requires cascade
+
+drop domain intdom1 cascade;
+
+table partitioned; -- gone
+
+
+--
+-- Partitions
+--
+
+-- check partition bound syntax
+
+CREATE TABLE list_parted (
+ a int
+) PARTITION BY LIST (a);
+CREATE TABLE part_p1 PARTITION OF list_parted FOR VALUES IN ('1');
+CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
+CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
+CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
+\d+ list_parted
+
+-- forbidden expressions for partition bound with list partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename.somename);
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (a);
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(a));
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(somename));
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (sum(1));
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((select 1));
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (generate_series(4, 6));
+CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN ((1+1) collate "POSIX");
+
+-- syntax does not allow empty list of values for list partitions
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES IN ();
+-- trying to specify range for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES FROM (1) TO (2);
+-- trying to specify modulus and remainder for list partitioned table
+CREATE TABLE fail_part PARTITION OF list_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+
+-- check default partition cannot be created more than once
+CREATE TABLE part_default PARTITION OF list_parted DEFAULT;
+CREATE TABLE fail_default_part PARTITION OF list_parted DEFAULT;
+
+-- specified literal can't be cast to the partition column data type
+CREATE TABLE bools (
+ a bool
+) PARTITION BY LIST (a);
+CREATE TABLE bools_true PARTITION OF bools FOR VALUES IN (1);
+DROP TABLE bools;
+
+-- specified literal can be cast, and the cast might not be immutable
+CREATE TABLE moneyp (
+ a money
+) PARTITION BY LIST (a);
+CREATE TABLE moneyp_10 PARTITION OF moneyp FOR VALUES IN (10);
+CREATE TABLE moneyp_11 PARTITION OF moneyp FOR VALUES IN ('11');
+CREATE TABLE moneyp_12 PARTITION OF moneyp FOR VALUES IN (to_char(12, '99')::int);
+DROP TABLE moneyp;
+
+-- cast is immutable
+CREATE TABLE bigintp (
+ a bigint
+) PARTITION BY LIST (a);
+CREATE TABLE bigintp_10 PARTITION OF bigintp FOR VALUES IN (10);
+-- fails due to overlap:
+CREATE TABLE bigintp_10_2 PARTITION OF bigintp FOR VALUES IN ('10');
+DROP TABLE bigintp;
+
+CREATE TABLE range_parted (
+ a date
+) PARTITION BY RANGE (a);
+
+-- forbidden expressions for partition bounds with range partitioned table
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (somename.somename) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (a) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(a)) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max(somename)) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (max('2019-02-01'::date)) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM ((select 1)) TO ('2019-01-01');
+CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
+ FOR VALUES FROM (generate_series(1, 3)) TO ('2019-01-01');
+
+-- trying to specify list for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES IN ('a');
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+-- each of start and end bounds must have same number of values as the
+-- length of the partition key
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('z');
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM ('a') TO ('z', 1);
+
+-- cannot specify null values in range bounds
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES FROM (null) TO (maxvalue);
+
+-- trying to specify modulus and remainder for range partitioned table
+CREATE TABLE fail_part PARTITION OF range_parted FOR VALUES WITH (MODULUS 10, REMAINDER 1);
+
+-- check partition bound syntax for the hash partition
+CREATE TABLE hash_parted (
+ a int
+) PARTITION BY HASH (a);
+CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 0);
+CREATE TABLE hpart_2 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 50, REMAINDER 1);
+CREATE TABLE hpart_3 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 200, REMAINDER 2);
+CREATE TABLE hpart_4 PARTITION OF hash_parted FOR VALUES WITH (MODULUS 10, REMAINDER 3);
+-- modulus 25 is factor of modulus of 50 but 10 is not a factor of 25.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 25, REMAINDER 3);
+-- previous modulus 50 is factor of 150 but this modulus is not a factor of next modulus 200.
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 150, REMAINDER 3);
+-- overlapping remainders
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES WITH (MODULUS 100, REMAINDER 3);
+-- trying to specify range for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES FROM ('a', 1) TO ('z');
+-- trying to specify list value for the hash partitioned table
+CREATE TABLE fail_part PARTITION OF hash_parted FOR VALUES IN (1000);
+
+-- trying to create default partition for the hash partitioned table
+CREATE TABLE fail_default_part PARTITION OF hash_parted DEFAULT;
+
+-- check if compatible with the specified parent
+
+-- cannot create as partition of a non-partitioned table
+CREATE TABLE unparted (
+ a int
+);
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES IN ('a');
+CREATE TABLE fail_part PARTITION OF unparted FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+DROP TABLE unparted;
+
+-- cannot create a permanent rel as partition of a temp rel
+CREATE TEMP TABLE temp_parted (
+ a int
+) PARTITION BY LIST (a);
+CREATE TABLE fail_part PARTITION OF temp_parted FOR VALUES IN ('a');
+DROP TABLE temp_parted;
+
+-- check for partition bound overlap and other invalid specifications
+
+CREATE TABLE list_parted2 (
+ a varchar
+) PARTITION BY LIST (a);
+CREATE TABLE part_null_z PARTITION OF list_parted2 FOR VALUES IN (null, 'z');
+CREATE TABLE part_ab PARTITION OF list_parted2 FOR VALUES IN ('a', 'b');
+CREATE TABLE list_parted2_def PARTITION OF list_parted2 DEFAULT;
+
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN (null);
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('b', 'c');
+-- check default partition overlap
+INSERT INTO list_parted2 VALUES('X');
+CREATE TABLE fail_part PARTITION OF list_parted2 FOR VALUES IN ('W', 'X', 'Y');
+
+CREATE TABLE range_parted2 (
+ a int
+) PARTITION BY RANGE (a);
+
+-- trying to create range partition with empty range
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (0);
+-- note that the range '[1, 1)' has no elements
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (1) TO (1);
+
+CREATE TABLE part0 PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (1);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (minvalue) TO (2);
+CREATE TABLE part1 PARTITION OF range_parted2 FOR VALUES FROM (1) TO (10);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (-1) TO (1);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (9) TO (maxvalue);
+CREATE TABLE part2 PARTITION OF range_parted2 FOR VALUES FROM (20) TO (30);
+CREATE TABLE part3 PARTITION OF range_parted2 FOR VALUES FROM (30) TO (40);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (30);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (10) TO (50);
+
+-- Create a default partition for range partitioned table
+CREATE TABLE range2_default PARTITION OF range_parted2 DEFAULT;
+
+-- More than one default partition is not allowed, so this should give error
+CREATE TABLE fail_default_part PARTITION OF range_parted2 DEFAULT;
+
+-- Check if the range for default partitions overlap
+INSERT INTO range_parted2 VALUES (85);
+CREATE TABLE fail_part PARTITION OF range_parted2 FOR VALUES FROM (80) TO (90);
+CREATE TABLE part4 PARTITION OF range_parted2 FOR VALUES FROM (90) TO (100);
+
+-- now check for multi-column range partition key
+CREATE TABLE range_parted3 (
+ a int,
+ b int
+) PARTITION BY RANGE (a, (b+1));
+
+CREATE TABLE part00 PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, maxvalue);
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (0, minvalue) TO (0, 1);
+
+CREATE TABLE part10 PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, 1);
+CREATE TABLE part11 PARTITION OF range_parted3 FOR VALUES FROM (1, 1) TO (1, 10);
+CREATE TABLE part12 PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, maxvalue);
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, 10) TO (1, 20);
+CREATE TABLE range3_default PARTITION OF range_parted3 DEFAULT;
+
+-- cannot create a partition that says column b is allowed to range
+-- from -infinity to +infinity, while there exist partitions that have
+-- more specific ranges
+CREATE TABLE fail_part PARTITION OF range_parted3 FOR VALUES FROM (1, minvalue) TO (1, maxvalue);
+
+-- check for partition bound overlap and other invalid specifications for the hash partition
+CREATE TABLE hash_parted2 (
+ a varchar
+) PARTITION BY HASH (a);
+CREATE TABLE h2part_1 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 4, REMAINDER 2);
+CREATE TABLE h2part_2 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 0);
+CREATE TABLE h2part_3 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 4);
+CREATE TABLE h2part_4 PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 5);
+-- overlap with part_4
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+-- modulus must be greater than zero
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
+-- remainder must be greater than or equal to zero and less than modulus
+CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
+
+-- check schema propagation from parent
+
+CREATE TABLE parted (
+ a text,
+ b int NOT NULL DEFAULT 0,
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) PARTITION BY LIST (a);
+
+CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+
+-- only inherited attributes (never local ones)
+SELECT attname, attislocal, attinhcount FROM pg_attribute
+ WHERE attrelid = 'part_a'::regclass and attnum > 0
+ ORDER BY attnum;
+
+-- able to specify column default, column constraint, and table constraint
+
+-- first check the "column specified more than once" error
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL,
+ b DEFAULT 1,
+ b CHECK (b >= 0),
+ CONSTRAINT check_a CHECK (length(a) > 0)
+) FOR VALUES IN ('b');
+
+CREATE TABLE part_b PARTITION OF parted (
+ b NOT NULL DEFAULT 1,
+ CONSTRAINT check_a CHECK (length(a) > 0),
+ CONSTRAINT check_b CHECK (b >= 0)
+) FOR VALUES IN ('b');
+-- conislocal should be false for any merged constraints, true otherwise
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass ORDER BY conislocal, coninhcount;
+
+-- Once check_b is added to the parent, it should be made non-local for part_b
+ALTER TABLE parted ADD CONSTRAINT check_b CHECK (b >= 0);
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+
+-- Neither check_a nor check_b are droppable from part_b
+ALTER TABLE part_b DROP CONSTRAINT check_a;
+ALTER TABLE part_b DROP CONSTRAINT check_b;
+
+-- And dropping it from parted should leave no trace of them on part_b, unlike
+-- traditional inheritance where they will be left behind, because they would
+-- be local constraints.
+ALTER TABLE parted DROP CONSTRAINT check_a, DROP CONSTRAINT check_b;
+SELECT conislocal, coninhcount FROM pg_constraint WHERE conrelid = 'part_b'::regclass;
+
+-- specify PARTITION BY for a partition
+CREATE TABLE fail_part_col_not_found PARTITION OF parted FOR VALUES IN ('c') PARTITION BY RANGE (c);
+CREATE TABLE part_c PARTITION OF parted (b WITH OPTIONS NOT NULL DEFAULT 0) FOR VALUES IN ('c') PARTITION BY RANGE ((b));
+
+-- create a level-2 partition
+CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
+
+-- check that NOT NULL and default value are inherited correctly
+create table parted_notnull_inh_test (a int default 1, b int not null default 0) partition by list (a);
+create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
+insert into parted_notnull_inh_test (b) values (null);
+-- note that while b's default is overriden, a's default is preserved
+\d parted_notnull_inh_test1
+drop table parted_notnull_inh_test;
+
+-- check that collations are assigned in partition bound expressions
+create table parted_boolean_col (a bool, b text) partition by list(a);
+create table parted_boolean_less partition of parted_boolean_col
+ for values in ('foo' < 'bar');
+create table parted_boolean_greater partition of parted_boolean_col
+ for values in ('foo' > 'bar');
+drop table parted_boolean_col;
+
+-- check for a conflicting COLLATE clause
+create table parted_collate_must_match (a text collate "C", b text collate "C")
+ partition by range (a);
+-- on the partition key
+create table parted_collate_must_match1 partition of parted_collate_must_match
+ (a collate "POSIX") for values from ('a') to ('m');
+-- on another column
+create table parted_collate_must_match2 partition of parted_collate_must_match
+ (b collate "POSIX") for values from ('m') to ('z');
+drop table parted_collate_must_match;
+
+-- check that non-matching collations for partition bound
+-- expressions are coerced to the right collation
+
+create table test_part_coll_posix (a text) partition by range (a collate "POSIX");
+-- ok, collation is implicitly coerced
+create table test_part_coll partition of test_part_coll_posix for values from ('a' collate "C") to ('g');
+-- ok
+create table test_part_coll2 partition of test_part_coll_posix for values from ('g') to ('m');
+-- ok, collation is implicitly coerced
+create table test_part_coll_cast partition of test_part_coll_posix for values from (name 'm' collate "C") to ('s');
+-- ok; partition collation silently overrides the default collation of type 'name'
+create table test_part_coll_cast2 partition of test_part_coll_posix for values from (name 's') to ('z');
+
+drop table test_part_coll_posix;
+
+-- Partition bound in describe output
+\d+ part_b
+
+-- Both partition bound and partition key in describe output
+\d+ part_c
+
+-- a level-2 partition's constraint will include the parent's expressions
+\d+ part_c_1_10
+
+-- Show partition count in the parent's describe output
+-- Tempted to include \d+ output listing partitions with bound info but
+-- output could vary depending on the order in which partition oids are
+-- returned.
+\d parted
+\d hash_parted
+
+-- check that we get the expected partition constraints
+CREATE TABLE range_parted4 (a int, b int, c int) PARTITION BY RANGE (abs(a), abs(b), c);
+CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
+\d+ unbounded_range_part
+DROP TABLE unbounded_range_part;
+CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
+\d+ range_parted4_1
+CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
+\d+ range_parted4_2
+CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
+\d+ range_parted4_3
+DROP TABLE range_parted4;
+
+-- user-defined operator class in partition key
+CREATE FUNCTION my_int4_sort(int4,int4) RETURNS int LANGUAGE sql
+ AS $$ SELECT CASE WHEN $1 = $2 THEN 0 WHEN $1 > $2 THEN 1 ELSE -1 END; $$;
+CREATE OPERATOR CLASS test_int4_ops FOR TYPE int4 USING btree AS
+ OPERATOR 1 < (int4,int4), OPERATOR 2 <= (int4,int4),
+ OPERATOR 3 = (int4,int4), OPERATOR 4 >= (int4,int4),
+ OPERATOR 5 > (int4,int4), FUNCTION 1 my_int4_sort(int4,int4);
+CREATE TABLE partkey_t (a int4) PARTITION BY RANGE (a test_int4_ops);
+CREATE TABLE partkey_t_1 PARTITION OF partkey_t FOR VALUES FROM (0) TO (1000);
+INSERT INTO partkey_t VALUES (100);
+INSERT INTO partkey_t VALUES (200);
+
+-- cleanup
+DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
+DROP TABLE partkey_t, hash_parted, hash_parted2;
+DROP OPERATOR CLASS test_int4_ops USING btree;
+DROP FUNCTION my_int4_sort(int4,int4);
+
+-- comments on partitioned tables columns
+CREATE TABLE parted_col_comment (a int, b text) PARTITION BY LIST (a);
+COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
+COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
+SELECT obj_description('parted_col_comment'::regclass);
+\d+ parted_col_comment
+DROP TABLE parted_col_comment;
+
+-- list partitioning on array type column
+CREATE TABLE arrlp (a int[]) PARTITION BY LIST (a);
+CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
+\d+ arrlp12
+DROP TABLE arrlp;
+
+-- partition on boolean column
+create table boolspart (a bool) partition by list (a);
+create table boolspart_t partition of boolspart for values in (true);
+create table boolspart_f partition of boolspart for values in (false);
+\d+ boolspart
+drop table boolspart;
+
+-- partitions mixing temporary and permanent relations
+create table perm_parted (a int) partition by list (a);
+create temporary table temp_parted (a int) partition by list (a);
+create table perm_part partition of temp_parted default; -- error
+create temp table temp_part partition of perm_parted default; -- error
+create temp table temp_part partition of temp_parted default; -- ok
+drop table perm_parted cascade;
+drop table temp_parted cascade;
+
+-- check that adding partitions to a table while it is being used is prevented
+create table tab_part_create (a int) partition by list (a);
+create or replace function func_part_create() returns trigger
+ language plpgsql as $$
+ begin
+ execute 'create table tab_part_create_1 partition of tab_part_create for values in (1)';
+ return null;
+ end $$;
+create trigger trig_part_create before insert on tab_part_create
+ for each statement execute procedure func_part_create();
+insert into tab_part_create values (1);
+drop table tab_part_create;
+drop function func_part_create();
+
+-- test using a volatile expression as partition bound
+create table volatile_partbound_test (partkey timestamp) partition by range (partkey);
+create table volatile_partbound_test1 partition of volatile_partbound_test for values from (minvalue) to (current_timestamp);
+create table volatile_partbound_test2 partition of volatile_partbound_test for values from (current_timestamp) to (maxvalue);
+-- this should go into the partition volatile_partbound_test2
+insert into volatile_partbound_test values (current_timestamp);
+select tableoid::regclass from volatile_partbound_test;
+drop table volatile_partbound_test;
+
+-- test the case where a check constraint on default partition allows
+-- to avoid scanning it when adding a new partition
+create table defcheck (a int, b int) partition by list (b);
+create table defcheck_def (a int, c int, b int);
+alter table defcheck_def drop c;
+alter table defcheck attach partition defcheck_def default;
+alter table defcheck_def add check (b <= 0 and b is not null);
+create table defcheck_1 partition of defcheck for values in (1, null);
+
+-- test that complex default partition constraints are enforced correctly
+insert into defcheck_def values (0, 0);
+create table defcheck_0 partition of defcheck for values in (0);
+drop table defcheck;
+
+-- tests of column drop with partition tables and indexes using
+-- predicates and expressions.
+create table part_column_drop (
+ useless_1 int,
+ id int,
+ useless_2 int,
+ d int,
+ b int,
+ useless_3 int
+) partition by range (id);
+alter table part_column_drop drop column useless_1;
+alter table part_column_drop drop column useless_2;
+alter table part_column_drop drop column useless_3;
+create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
+create index part_column_drop_b_expr on part_column_drop((b = 1));
+create index part_column_drop_d_pred on part_column_drop(d) where d = 2;
+create index part_column_drop_d_expr on part_column_drop((d = 2));
+create table part_column_drop_1_10 partition of
+ part_column_drop for values from (1) to (10);
+\d part_column_drop
+\d part_column_drop_1_10
+drop table part_column_drop;
diff --git a/yql/essentials/tests/postgresql/original/cases/date.out b/yql/essentials/tests/postgresql/original/cases/date.out
new file mode 100644
index 0000000000..c8b0566ff4
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/date.out
@@ -0,0 +1,1497 @@
+--
+-- DATE
+--
+CREATE TABLE DATE_TBL (f1 date);
+INSERT INTO DATE_TBL VALUES ('1957-04-09');
+INSERT INTO DATE_TBL VALUES ('1957-06-13');
+INSERT INTO DATE_TBL VALUES ('1996-02-28');
+INSERT INTO DATE_TBL VALUES ('1996-02-29');
+INSERT INTO DATE_TBL VALUES ('1996-03-01');
+INSERT INTO DATE_TBL VALUES ('1996-03-02');
+INSERT INTO DATE_TBL VALUES ('1997-02-28');
+INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ERROR: date/time field value out of range: "1997-02-29"
+LINE 1: INSERT INTO DATE_TBL VALUES ('1997-02-29');
+ ^
+INSERT INTO DATE_TBL VALUES ('1997-03-01');
+INSERT INTO DATE_TBL VALUES ('1997-03-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-01');
+INSERT INTO DATE_TBL VALUES ('2000-04-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-03');
+INSERT INTO DATE_TBL VALUES ('2038-04-08');
+INSERT INTO DATE_TBL VALUES ('2039-04-09');
+INSERT INTO DATE_TBL VALUES ('2040-04-10');
+INSERT INTO DATE_TBL VALUES ('2040-04-10 BC');
+SELECT f1 FROM DATE_TBL;
+ f1
+---------------
+ 04-09-1957
+ 06-13-1957
+ 02-28-1996
+ 02-29-1996
+ 03-01-1996
+ 03-02-1996
+ 02-28-1997
+ 03-01-1997
+ 03-02-1997
+ 04-01-2000
+ 04-02-2000
+ 04-03-2000
+ 04-08-2038
+ 04-09-2039
+ 04-10-2040
+ 04-10-2040 BC
+(16 rows)
+
+SELECT f1 FROM DATE_TBL WHERE f1 < '2000-01-01';
+ f1
+---------------
+ 04-09-1957
+ 06-13-1957
+ 02-28-1996
+ 02-29-1996
+ 03-01-1996
+ 03-02-1996
+ 02-28-1997
+ 03-01-1997
+ 03-02-1997
+ 04-10-2040 BC
+(10 rows)
+
+SELECT f1 FROM DATE_TBL
+ WHERE f1 BETWEEN '2000-01-01' AND '2001-01-01';
+ f1
+------------
+ 04-01-2000
+ 04-02-2000
+ 04-03-2000
+(3 rows)
+
+--
+-- Check all the documented input formats
+--
+SET datestyle TO iso; -- display results in ISO
+SET datestyle TO ymd;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '1/8/1999';
+ERROR: date/time field value out of range: "1/8/1999"
+LINE 1: SELECT date '1/8/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1/18/1999';
+ERROR: date/time field value out of range: "1/18/1999"
+LINE 1: SELECT date '1/18/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '18/1/1999';
+ERROR: date/time field value out of range: "18/1/1999"
+LINE 1: SELECT date '18/1/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01/02/03';
+ date
+------------
+ 2001-02-03
+(1 row)
+
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'January 8, 99 BC';
+ERROR: date/time field value out of range: "January 8, 99 BC"
+LINE 1: SELECT date 'January 8, 99 BC';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '99-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-99';
+ERROR: date/time field value out of range: "08-Jan-99"
+LINE 1: SELECT date '08-Jan-99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-99';
+ERROR: date/time field value out of range: "Jan-08-99"
+LINE 1: SELECT date 'Jan-08-99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '99 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 99';
+ERROR: date/time field value out of range: "08 Jan 99"
+LINE 1: SELECT date '08 Jan 99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 99';
+ERROR: date/time field value out of range: "Jan 08 99"
+LINE 1: SELECT date 'Jan 08 99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-01-99';
+ERROR: date/time field value out of range: "08-01-99"
+LINE 1: SELECT date '08-01-99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '08-01-1999';
+ERROR: date/time field value out of range: "08-01-1999"
+LINE 1: SELECT date '08-01-1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01-08-99';
+ERROR: date/time field value out of range: "01-08-99"
+LINE 1: SELECT date '01-08-99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01-08-1999';
+ERROR: date/time field value out of range: "01-08-1999"
+LINE 1: SELECT date '01-08-1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '99-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 01 99';
+ERROR: date/time field value out of range: "08 01 99"
+LINE 1: SELECT date '08 01 99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '08 01 1999';
+ERROR: date/time field value out of range: "08 01 1999"
+LINE 1: SELECT date '08 01 1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01 08 99';
+ERROR: date/time field value out of range: "01 08 99"
+LINE 1: SELECT date '01 08 99';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01 08 1999';
+ERROR: date/time field value out of range: "01 08 1999"
+LINE 1: SELECT date '01 08 1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '99 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SET datestyle TO dmy;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '1/8/1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '1/18/1999';
+ERROR: date/time field value out of range: "1/18/1999"
+LINE 1: SELECT date '1/18/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '18/1/1999';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '01/02/03';
+ date
+------------
+ 2003-02-01
+(1 row)
+
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'January 8, 99 BC';
+ date
+---------------
+ 0099-01-08 BC
+(1 row)
+
+SELECT date '99-Jan-08';
+ERROR: date/time field value out of range: "99-Jan-08"
+LINE 1: SELECT date '99-Jan-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '99 Jan 08';
+ERROR: date/time field value out of range: "99 Jan 08"
+LINE 1: SELECT date '99 Jan 08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 Jan';
+ERROR: invalid input syntax for type date: "99 08 Jan"
+LINE 1: SELECT date '99 08 Jan';
+ ^
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-01-08';
+ERROR: date/time field value out of range: "99-01-08"
+LINE 1: SELECT date '99-01-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-01-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-01-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01-08-99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01-08-1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99-08-01';
+ERROR: date/time field value out of range: "99-08-01"
+LINE 1: SELECT date '99-08-01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 01 08';
+ERROR: date/time field value out of range: "99 01 08"
+LINE 1: SELECT date '99 01 08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 01 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 01 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01 08 99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01 08 1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 08 01';
+ERROR: date/time field value out of range: "99 08 01"
+LINE 1: SELECT date '99 08 01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SET datestyle TO mdy;
+SELECT date 'January 8, 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999-01-18';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '1/8/1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1/18/1999';
+ date
+------------
+ 1999-01-18
+(1 row)
+
+SELECT date '18/1/1999';
+ERROR: date/time field value out of range: "18/1/1999"
+LINE 1: SELECT date '18/1/1999';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '01/02/03';
+ date
+------------
+ 2003-01-02
+(1 row)
+
+SELECT date '19990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '990108';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '1999.008';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'J2451187';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'January 8, 99 BC';
+ date
+---------------
+ 0099-01-08 BC
+(1 row)
+
+SELECT date '99-Jan-08';
+ERROR: date/time field value out of range: "99-Jan-08"
+LINE 1: SELECT date '99-Jan-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-Jan-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-Jan-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-Jan';
+ERROR: invalid input syntax for type date: "99-08-Jan"
+LINE 1: SELECT date '99-08-Jan';
+ ^
+SELECT date '1999-08-Jan';
+ERROR: invalid input syntax for type date: "1999-08-Jan"
+LINE 1: SELECT date '1999-08-Jan';
+ ^
+SELECT date '99 Jan 08';
+ERROR: invalid input syntax for type date: "99 Jan 08"
+LINE 1: SELECT date '99 Jan 08';
+ ^
+SELECT date '1999 Jan 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 Jan 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date 'Jan 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 Jan';
+ERROR: invalid input syntax for type date: "99 08 Jan"
+LINE 1: SELECT date '99 08 Jan';
+ ^
+SELECT date '1999 08 Jan';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-01-08';
+ERROR: date/time field value out of range: "99-01-08"
+LINE 1: SELECT date '99-01-08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-01-08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08-01-99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '08-01-1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01-08-99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01-08-1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99-08-01';
+ERROR: date/time field value out of range: "99-08-01"
+LINE 1: SELECT date '99-08-01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999-08-01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '99 01 08';
+ERROR: date/time field value out of range: "99 01 08"
+LINE 1: SELECT date '99 01 08';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 01 08';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '08 01 99';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '08 01 1999';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+SELECT date '01 08 99';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '01 08 1999';
+ date
+------------
+ 1999-01-08
+(1 row)
+
+SELECT date '99 08 01';
+ERROR: date/time field value out of range: "99 08 01"
+LINE 1: SELECT date '99 08 01';
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+SELECT date '1999 08 01';
+ date
+------------
+ 1999-08-01
+(1 row)
+
+-- Check upper and lower limits of date range
+SELECT date '4714-11-24 BC';
+ date
+---------------
+ 4714-11-24 BC
+(1 row)
+
+SELECT date '4714-11-23 BC'; -- out of range
+ERROR: date out of range: "4714-11-23 BC"
+LINE 1: SELECT date '4714-11-23 BC';
+ ^
+SELECT date '5874897-12-31';
+ date
+---------------
+ 5874897-12-31
+(1 row)
+
+SELECT date '5874898-01-01'; -- out of range
+ERROR: date out of range: "5874898-01-01"
+LINE 1: SELECT date '5874898-01-01';
+ ^
+RESET datestyle;
+--
+-- Simple math
+-- Leave most of it for the horology tests
+--
+SELECT f1 - date '2000-01-01' AS "Days From 2K" FROM DATE_TBL;
+ Days From 2K
+--------------
+ -15607
+ -15542
+ -1403
+ -1402
+ -1401
+ -1400
+ -1037
+ -1036
+ -1035
+ 91
+ 92
+ 93
+ 13977
+ 14343
+ 14710
+ -1475115
+(16 rows)
+
+SELECT f1 - date 'epoch' AS "Days From Epoch" FROM DATE_TBL;
+ Days From Epoch
+-----------------
+ -4650
+ -4585
+ 9554
+ 9555
+ 9556
+ 9557
+ 9920
+ 9921
+ 9922
+ 11048
+ 11049
+ 11050
+ 24934
+ 25300
+ 25667
+ -1464158
+(16 rows)
+
+SELECT date 'yesterday' - date 'today' AS "One day";
+ One day
+---------
+ -1
+(1 row)
+
+SELECT date 'today' - date 'tomorrow' AS "One day";
+ One day
+---------
+ -1
+(1 row)
+
+SELECT date 'yesterday' - date 'tomorrow' AS "Two days";
+ Two days
+----------
+ -2
+(1 row)
+
+SELECT date 'tomorrow' - date 'today' AS "One day";
+ One day
+---------
+ 1
+(1 row)
+
+SELECT date 'today' - date 'yesterday' AS "One day";
+ One day
+---------
+ 1
+(1 row)
+
+SELECT date 'tomorrow' - date 'yesterday' AS "Two days";
+ Two days
+----------
+ 2
+(1 row)
+
+--
+-- test extract!
+--
+SELECT f1 as "date",
+ date_part('year', f1) AS year,
+ date_part('month', f1) AS month,
+ date_part('day', f1) AS day,
+ date_part('quarter', f1) AS quarter,
+ date_part('decade', f1) AS decade,
+ date_part('century', f1) AS century,
+ date_part('millennium', f1) AS millennium,
+ date_part('isoyear', f1) AS isoyear,
+ date_part('week', f1) AS week,
+ date_part('dow', f1) AS dow,
+ date_part('isodow', f1) AS isodow,
+ date_part('doy', f1) AS doy,
+ date_part('julian', f1) AS julian,
+ date_part('epoch', f1) AS epoch
+ FROM date_tbl;
+ date | year | month | day | quarter | decade | century | millennium | isoyear | week | dow | isodow | doy | julian | epoch
+---------------+-------+-------+-----+---------+--------+---------+------------+---------+------+-----+--------+-----+---------+---------------
+ 04-09-1957 | 1957 | 4 | 9 | 2 | 195 | 20 | 2 | 1957 | 15 | 2 | 2 | 99 | 2435938 | -401760000
+ 06-13-1957 | 1957 | 6 | 13 | 2 | 195 | 20 | 2 | 1957 | 24 | 4 | 4 | 164 | 2436003 | -396144000
+ 02-28-1996 | 1996 | 2 | 28 | 1 | 199 | 20 | 2 | 1996 | 9 | 3 | 3 | 59 | 2450142 | 825465600
+ 02-29-1996 | 1996 | 2 | 29 | 1 | 199 | 20 | 2 | 1996 | 9 | 4 | 4 | 60 | 2450143 | 825552000
+ 03-01-1996 | 1996 | 3 | 1 | 1 | 199 | 20 | 2 | 1996 | 9 | 5 | 5 | 61 | 2450144 | 825638400
+ 03-02-1996 | 1996 | 3 | 2 | 1 | 199 | 20 | 2 | 1996 | 9 | 6 | 6 | 62 | 2450145 | 825724800
+ 02-28-1997 | 1997 | 2 | 28 | 1 | 199 | 20 | 2 | 1997 | 9 | 5 | 5 | 59 | 2450508 | 857088000
+ 03-01-1997 | 1997 | 3 | 1 | 1 | 199 | 20 | 2 | 1997 | 9 | 6 | 6 | 60 | 2450509 | 857174400
+ 03-02-1997 | 1997 | 3 | 2 | 1 | 199 | 20 | 2 | 1997 | 9 | 0 | 7 | 61 | 2450510 | 857260800
+ 04-01-2000 | 2000 | 4 | 1 | 2 | 200 | 20 | 2 | 2000 | 13 | 6 | 6 | 92 | 2451636 | 954547200
+ 04-02-2000 | 2000 | 4 | 2 | 2 | 200 | 20 | 2 | 2000 | 13 | 0 | 7 | 93 | 2451637 | 954633600
+ 04-03-2000 | 2000 | 4 | 3 | 2 | 200 | 20 | 2 | 2000 | 14 | 1 | 1 | 94 | 2451638 | 954720000
+ 04-08-2038 | 2038 | 4 | 8 | 2 | 203 | 21 | 3 | 2038 | 14 | 4 | 4 | 98 | 2465522 | 2154297600
+ 04-09-2039 | 2039 | 4 | 9 | 2 | 203 | 21 | 3 | 2039 | 14 | 6 | 6 | 99 | 2465888 | 2185920000
+ 04-10-2040 | 2040 | 4 | 10 | 2 | 204 | 21 | 3 | 2040 | 15 | 2 | 2 | 101 | 2466255 | 2217628800
+ 04-10-2040 BC | -2040 | 4 | 10 | 2 | -204 | -21 | -3 | -2040 | 15 | 1 | 1 | 100 | 976430 | -126503251200
+(16 rows)
+
+--
+-- epoch
+--
+SELECT EXTRACT(EPOCH FROM DATE '1970-01-01'); -- 0
+ extract
+---------
+ 0
+(1 row)
+
+--
+-- century
+--
+SELECT EXTRACT(CENTURY FROM DATE '0101-12-31 BC'); -- -2
+ extract
+---------
+ -2
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0100-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01 AD'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '1900-12-31'); -- 19
+ extract
+---------
+ 19
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '1901-01-01'); -- 20
+ extract
+---------
+ 20
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2000-12-31'); -- 20
+ extract
+---------
+ 20
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2001-01-01'); -- 21
+ extract
+---------
+ 21
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM CURRENT_DATE)>=21 AS True; -- true
+ true
+------
+ t
+(1 row)
+
+--
+-- millennium
+--
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-01-01 AD'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '1000-12-31'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '1001-01-01'); -- 2
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2000-12-31'); -- 2
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2001-01-01'); -- 3
+ extract
+---------
+ 3
+(1 row)
+
+-- next test to be fixed on the turn of the next millennium;-)
+SELECT EXTRACT(MILLENNIUM FROM CURRENT_DATE); -- 3
+ extract
+---------
+ 3
+(1 row)
+
+--
+-- decade
+--
+SELECT EXTRACT(DECADE FROM DATE '1994-12-25'); -- 199
+ extract
+---------
+ 199
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0010-01-01'); -- 1
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0009-12-31'); -- 0
+ extract
+---------
+ 0
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0001-01-01 BC'); -- 0
+ extract
+---------
+ 0
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0002-12-31 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0011-01-01 BC'); -- -1
+ extract
+---------
+ -1
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '0012-12-31 BC'); -- -2
+ extract
+---------
+ -2
+(1 row)
+
+--
+-- all possible fields
+--
+SELECT EXTRACT(MICROSECONDS FROM DATE '2020-08-11');
+ERROR: date units "microseconds" not supported
+SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+ERROR: date units "milliseconds" not supported
+SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+ERROR: date units "second" not supported
+SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+ERROR: date units "minute" not supported
+SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+ERROR: date units "hour" not supported
+SELECT EXTRACT(DAY FROM DATE '2020-08-11');
+ extract
+---------
+ 11
+(1 row)
+
+SELECT EXTRACT(MONTH FROM DATE '2020-08-11');
+ extract
+---------
+ 8
+(1 row)
+
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11');
+ extract
+---------
+ 2020
+(1 row)
+
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11 BC');
+ extract
+---------
+ -2020
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE '2020-08-11');
+ extract
+---------
+ 202
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE '2020-08-11');
+ extract
+---------
+ 21
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE '2020-08-11');
+ extract
+---------
+ 3
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11');
+ extract
+---------
+ 2020
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11 BC');
+ extract
+---------
+ -2020
+(1 row)
+
+SELECT EXTRACT(QUARTER FROM DATE '2020-08-11');
+ extract
+---------
+ 3
+(1 row)
+
+SELECT EXTRACT(WEEK FROM DATE '2020-08-11');
+ extract
+---------
+ 33
+(1 row)
+
+SELECT EXTRACT(DOW FROM DATE '2020-08-11');
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(DOW FROM DATE '2020-08-16');
+ extract
+---------
+ 0
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-11');
+ extract
+---------
+ 2
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-16');
+ extract
+---------
+ 7
+(1 row)
+
+SELECT EXTRACT(DOY FROM DATE '2020-08-11');
+ extract
+---------
+ 224
+(1 row)
+
+SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+ERROR: date units "timezone" not supported
+SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+ERROR: date units "timezone_m" not supported
+SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+ERROR: date units "timezone_h" not supported
+SELECT EXTRACT(EPOCH FROM DATE '2020-08-11');
+ extract
+------------
+ 1597104000
+(1 row)
+
+SELECT EXTRACT(JULIAN FROM DATE '2020-08-11');
+ extract
+---------
+ 2459073
+(1 row)
+
+--
+-- test trunc function!
+--
+SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
+ date_trunc
+--------------------------
+ Thu Jan 01 00:00:00 1001
+(1 row)
+
+SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
+ date_trunc
+------------------------------
+ Thu Jan 01 00:00:00 1001 PST
+(1 row)
+
+SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
+ date_trunc
+--------------------------
+ Tue Jan 01 00:00:00 1901
+(1 row)
+
+SELECT DATE_TRUNC('CENTURY', DATE '1970-03-20'); -- 1901
+ date_trunc
+------------------------------
+ Tue Jan 01 00:00:00 1901 PST
+(1 row)
+
+SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
+ date_trunc
+------------------------------
+ Mon Jan 01 00:00:00 2001 PST
+(1 row)
+
+SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
+ date_trunc
+------------------------------
+ Mon Jan 01 00:00:00 0001 PST
+(1 row)
+
+SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
+ date_trunc
+---------------------------------
+ Tue Jan 01 00:00:00 0100 PST BC
+(1 row)
+
+SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
+ date_trunc
+------------------------------
+ Mon Jan 01 00:00:00 1990 PST
+(1 row)
+
+SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
+ date_trunc
+---------------------------------
+ Sat Jan 01 00:00:00 0001 PST BC
+(1 row)
+
+SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
+ date_trunc
+---------------------------------
+ Mon Jan 01 00:00:00 0011 PST BC
+(1 row)
+
+--
+-- test infinity
+--
+select 'infinity'::date, '-infinity'::date;
+ date | date
+----------+-----------
+ infinity | -infinity
+(1 row)
+
+select 'infinity'::date > 'today'::date as t;
+ t
+---
+ t
+(1 row)
+
+select '-infinity'::date < 'today'::date as t;
+ t
+---
+ t
+(1 row)
+
+select isfinite('infinity'::date), isfinite('-infinity'::date), isfinite('today'::date);
+ isfinite | isfinite | isfinite
+----------+----------+----------
+ f | f | t
+(1 row)
+
+--
+-- oscillating fields from non-finite date:
+--
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DAY FROM DATE '-infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+-- all supported fields
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(MONTH FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(QUARTER FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(WEEK FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DOW FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(ISODOW FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+SELECT EXTRACT(DOY FROM DATE 'infinity'); -- NULL
+ extract
+---------
+
+(1 row)
+
+--
+-- monotonic fields from non-finite date:
+--
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM DATE '-infinity'); -- -Infinity
+ extract
+-----------
+ -Infinity
+(1 row)
+
+-- all supported fields
+SELECT EXTRACT(YEAR FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(DECADE FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(MILLENNIUM FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(JULIAN FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(ISOYEAR FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+ extract
+----------
+ Infinity
+(1 row)
+
+--
+-- wrong fields from non-finite date:
+--
+SELECT EXTRACT(MICROSEC FROM DATE 'infinity'); -- error
+ERROR: date units "microsec" not recognized
+-- test constructors
+select make_date(2013, 7, 15);
+ make_date
+------------
+ 07-15-2013
+(1 row)
+
+select make_date(-44, 3, 15);
+ make_date
+---------------
+ 03-15-0044 BC
+(1 row)
+
+select make_time(8, 20, 0.0);
+ make_time
+-----------
+ 08:20:00
+(1 row)
+
+-- should fail
+select make_date(0, 7, 15);
+ERROR: date field value out of range: 0-07-15
+select make_date(2013, 2, 30);
+ERROR: date field value out of range: 2013-02-30
+select make_date(2013, 13, 1);
+ERROR: date field value out of range: 2013-13-01
+select make_date(2013, 11, -1);
+ERROR: date field value out of range: 2013-11--1
+select make_time(10, 55, 100.1);
+ERROR: time field value out of range: 10:55:100.1
+select make_time(24, 0, 2.1);
+ERROR: time field value out of range: 24:00:2.1
diff --git a/yql/essentials/tests/postgresql/original/cases/date.sql b/yql/essentials/tests/postgresql/original/cases/date.sql
new file mode 100644
index 0000000000..8f7435b767
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/date.sql
@@ -0,0 +1,366 @@
+--
+-- DATE
+--
+
+CREATE TABLE DATE_TBL (f1 date);
+
+INSERT INTO DATE_TBL VALUES ('1957-04-09');
+INSERT INTO DATE_TBL VALUES ('1957-06-13');
+INSERT INTO DATE_TBL VALUES ('1996-02-28');
+INSERT INTO DATE_TBL VALUES ('1996-02-29');
+INSERT INTO DATE_TBL VALUES ('1996-03-01');
+INSERT INTO DATE_TBL VALUES ('1996-03-02');
+INSERT INTO DATE_TBL VALUES ('1997-02-28');
+INSERT INTO DATE_TBL VALUES ('1997-02-29');
+INSERT INTO DATE_TBL VALUES ('1997-03-01');
+INSERT INTO DATE_TBL VALUES ('1997-03-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-01');
+INSERT INTO DATE_TBL VALUES ('2000-04-02');
+INSERT INTO DATE_TBL VALUES ('2000-04-03');
+INSERT INTO DATE_TBL VALUES ('2038-04-08');
+INSERT INTO DATE_TBL VALUES ('2039-04-09');
+INSERT INTO DATE_TBL VALUES ('2040-04-10');
+INSERT INTO DATE_TBL VALUES ('2040-04-10 BC');
+
+SELECT f1 FROM DATE_TBL;
+
+SELECT f1 FROM DATE_TBL WHERE f1 < '2000-01-01';
+
+SELECT f1 FROM DATE_TBL
+ WHERE f1 BETWEEN '2000-01-01' AND '2001-01-01';
+
+--
+-- Check all the documented input formats
+--
+SET datestyle TO iso; -- display results in ISO
+
+SET datestyle TO ymd;
+
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '1/8/1999';
+SELECT date '1/18/1999';
+SELECT date '18/1/1999';
+SELECT date '01/02/03';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date 'January 8, 99 BC';
+
+SELECT date '99-Jan-08';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-99';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-99';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+
+SELECT date '99 Jan 08';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 99';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 99';
+SELECT date 'Jan 08 1999';
+SELECT date '99 08 Jan';
+SELECT date '1999 08 Jan';
+
+SELECT date '99-01-08';
+SELECT date '1999-01-08';
+SELECT date '08-01-99';
+SELECT date '08-01-1999';
+SELECT date '01-08-99';
+SELECT date '01-08-1999';
+SELECT date '99-08-01';
+SELECT date '1999-08-01';
+
+SELECT date '99 01 08';
+SELECT date '1999 01 08';
+SELECT date '08 01 99';
+SELECT date '08 01 1999';
+SELECT date '01 08 99';
+SELECT date '01 08 1999';
+SELECT date '99 08 01';
+SELECT date '1999 08 01';
+
+SET datestyle TO dmy;
+
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '1/8/1999';
+SELECT date '1/18/1999';
+SELECT date '18/1/1999';
+SELECT date '01/02/03';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date 'January 8, 99 BC';
+
+SELECT date '99-Jan-08';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-99';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-99';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+
+SELECT date '99 Jan 08';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 99';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 99';
+SELECT date 'Jan 08 1999';
+SELECT date '99 08 Jan';
+SELECT date '1999 08 Jan';
+
+SELECT date '99-01-08';
+SELECT date '1999-01-08';
+SELECT date '08-01-99';
+SELECT date '08-01-1999';
+SELECT date '01-08-99';
+SELECT date '01-08-1999';
+SELECT date '99-08-01';
+SELECT date '1999-08-01';
+
+SELECT date '99 01 08';
+SELECT date '1999 01 08';
+SELECT date '08 01 99';
+SELECT date '08 01 1999';
+SELECT date '01 08 99';
+SELECT date '01 08 1999';
+SELECT date '99 08 01';
+SELECT date '1999 08 01';
+
+SET datestyle TO mdy;
+
+SELECT date 'January 8, 1999';
+SELECT date '1999-01-08';
+SELECT date '1999-01-18';
+SELECT date '1/8/1999';
+SELECT date '1/18/1999';
+SELECT date '18/1/1999';
+SELECT date '01/02/03';
+SELECT date '19990108';
+SELECT date '990108';
+SELECT date '1999.008';
+SELECT date 'J2451187';
+SELECT date 'January 8, 99 BC';
+
+SELECT date '99-Jan-08';
+SELECT date '1999-Jan-08';
+SELECT date '08-Jan-99';
+SELECT date '08-Jan-1999';
+SELECT date 'Jan-08-99';
+SELECT date 'Jan-08-1999';
+SELECT date '99-08-Jan';
+SELECT date '1999-08-Jan';
+
+SELECT date '99 Jan 08';
+SELECT date '1999 Jan 08';
+SELECT date '08 Jan 99';
+SELECT date '08 Jan 1999';
+SELECT date 'Jan 08 99';
+SELECT date 'Jan 08 1999';
+SELECT date '99 08 Jan';
+SELECT date '1999 08 Jan';
+
+SELECT date '99-01-08';
+SELECT date '1999-01-08';
+SELECT date '08-01-99';
+SELECT date '08-01-1999';
+SELECT date '01-08-99';
+SELECT date '01-08-1999';
+SELECT date '99-08-01';
+SELECT date '1999-08-01';
+
+SELECT date '99 01 08';
+SELECT date '1999 01 08';
+SELECT date '08 01 99';
+SELECT date '08 01 1999';
+SELECT date '01 08 99';
+SELECT date '01 08 1999';
+SELECT date '99 08 01';
+SELECT date '1999 08 01';
+
+-- Check upper and lower limits of date range
+SELECT date '4714-11-24 BC';
+SELECT date '4714-11-23 BC'; -- out of range
+SELECT date '5874897-12-31';
+SELECT date '5874898-01-01'; -- out of range
+
+RESET datestyle;
+
+--
+-- Simple math
+-- Leave most of it for the horology tests
+--
+
+SELECT f1 - date '2000-01-01' AS "Days From 2K" FROM DATE_TBL;
+
+SELECT f1 - date 'epoch' AS "Days From Epoch" FROM DATE_TBL;
+
+SELECT date 'yesterday' - date 'today' AS "One day";
+
+SELECT date 'today' - date 'tomorrow' AS "One day";
+
+SELECT date 'yesterday' - date 'tomorrow' AS "Two days";
+
+SELECT date 'tomorrow' - date 'today' AS "One day";
+
+SELECT date 'today' - date 'yesterday' AS "One day";
+
+SELECT date 'tomorrow' - date 'yesterday' AS "Two days";
+
+--
+-- test extract!
+--
+SELECT f1 as "date",
+ date_part('year', f1) AS year,
+ date_part('month', f1) AS month,
+ date_part('day', f1) AS day,
+ date_part('quarter', f1) AS quarter,
+ date_part('decade', f1) AS decade,
+ date_part('century', f1) AS century,
+ date_part('millennium', f1) AS millennium,
+ date_part('isoyear', f1) AS isoyear,
+ date_part('week', f1) AS week,
+ date_part('dow', f1) AS dow,
+ date_part('isodow', f1) AS isodow,
+ date_part('doy', f1) AS doy,
+ date_part('julian', f1) AS julian,
+ date_part('epoch', f1) AS epoch
+ FROM date_tbl;
+--
+-- epoch
+--
+SELECT EXTRACT(EPOCH FROM DATE '1970-01-01'); -- 0
+--
+-- century
+--
+SELECT EXTRACT(CENTURY FROM DATE '0101-12-31 BC'); -- -2
+SELECT EXTRACT(CENTURY FROM DATE '0100-12-31 BC'); -- -1
+SELECT EXTRACT(CENTURY FROM DATE '0001-12-31 BC'); -- -1
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01'); -- 1
+SELECT EXTRACT(CENTURY FROM DATE '0001-01-01 AD'); -- 1
+SELECT EXTRACT(CENTURY FROM DATE '1900-12-31'); -- 19
+SELECT EXTRACT(CENTURY FROM DATE '1901-01-01'); -- 20
+SELECT EXTRACT(CENTURY FROM DATE '2000-12-31'); -- 20
+SELECT EXTRACT(CENTURY FROM DATE '2001-01-01'); -- 21
+SELECT EXTRACT(CENTURY FROM CURRENT_DATE)>=21 AS True; -- true
+--
+-- millennium
+--
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-12-31 BC'); -- -1
+SELECT EXTRACT(MILLENNIUM FROM DATE '0001-01-01 AD'); -- 1
+SELECT EXTRACT(MILLENNIUM FROM DATE '1000-12-31'); -- 1
+SELECT EXTRACT(MILLENNIUM FROM DATE '1001-01-01'); -- 2
+SELECT EXTRACT(MILLENNIUM FROM DATE '2000-12-31'); -- 2
+SELECT EXTRACT(MILLENNIUM FROM DATE '2001-01-01'); -- 3
+-- next test to be fixed on the turn of the next millennium;-)
+SELECT EXTRACT(MILLENNIUM FROM CURRENT_DATE); -- 3
+--
+-- decade
+--
+SELECT EXTRACT(DECADE FROM DATE '1994-12-25'); -- 199
+SELECT EXTRACT(DECADE FROM DATE '0010-01-01'); -- 1
+SELECT EXTRACT(DECADE FROM DATE '0009-12-31'); -- 0
+SELECT EXTRACT(DECADE FROM DATE '0001-01-01 BC'); -- 0
+SELECT EXTRACT(DECADE FROM DATE '0002-12-31 BC'); -- -1
+SELECT EXTRACT(DECADE FROM DATE '0011-01-01 BC'); -- -1
+SELECT EXTRACT(DECADE FROM DATE '0012-12-31 BC'); -- -2
+--
+-- all possible fields
+--
+SELECT EXTRACT(MICROSECONDS FROM DATE '2020-08-11');
+SELECT EXTRACT(MILLISECONDS FROM DATE '2020-08-11');
+SELECT EXTRACT(SECOND FROM DATE '2020-08-11');
+SELECT EXTRACT(MINUTE FROM DATE '2020-08-11');
+SELECT EXTRACT(HOUR FROM DATE '2020-08-11');
+SELECT EXTRACT(DAY FROM DATE '2020-08-11');
+SELECT EXTRACT(MONTH FROM DATE '2020-08-11');
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11');
+SELECT EXTRACT(YEAR FROM DATE '2020-08-11 BC');
+SELECT EXTRACT(DECADE FROM DATE '2020-08-11');
+SELECT EXTRACT(CENTURY FROM DATE '2020-08-11');
+SELECT EXTRACT(MILLENNIUM FROM DATE '2020-08-11');
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11');
+SELECT EXTRACT(ISOYEAR FROM DATE '2020-08-11 BC');
+SELECT EXTRACT(QUARTER FROM DATE '2020-08-11');
+SELECT EXTRACT(WEEK FROM DATE '2020-08-11');
+SELECT EXTRACT(DOW FROM DATE '2020-08-11');
+SELECT EXTRACT(DOW FROM DATE '2020-08-16');
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-11');
+SELECT EXTRACT(ISODOW FROM DATE '2020-08-16');
+SELECT EXTRACT(DOY FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE_M FROM DATE '2020-08-11');
+SELECT EXTRACT(TIMEZONE_H FROM DATE '2020-08-11');
+SELECT EXTRACT(EPOCH FROM DATE '2020-08-11');
+SELECT EXTRACT(JULIAN FROM DATE '2020-08-11');
+--
+-- test trunc function!
+--
+SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
+SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
+SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
+SELECT DATE_TRUNC('CENTURY', DATE '1970-03-20'); -- 1901
+SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
+SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
+SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
+SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
+SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
+SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
+--
+-- test infinity
+--
+select 'infinity'::date, '-infinity'::date;
+select 'infinity'::date > 'today'::date as t;
+select '-infinity'::date < 'today'::date as t;
+select isfinite('infinity'::date), isfinite('-infinity'::date), isfinite('today'::date);
+--
+-- oscillating fields from non-finite date:
+--
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DAY FROM DATE '-infinity'); -- NULL
+-- all supported fields
+SELECT EXTRACT(DAY FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(MONTH FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(QUARTER FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(WEEK FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DOW FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(ISODOW FROM DATE 'infinity'); -- NULL
+SELECT EXTRACT(DOY FROM DATE 'infinity'); -- NULL
+--
+-- monotonic fields from non-finite date:
+--
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(EPOCH FROM DATE '-infinity'); -- -Infinity
+-- all supported fields
+SELECT EXTRACT(YEAR FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(DECADE FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(CENTURY FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(MILLENNIUM FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(JULIAN FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(ISOYEAR FROM DATE 'infinity'); -- Infinity
+SELECT EXTRACT(EPOCH FROM DATE 'infinity'); -- Infinity
+--
+-- wrong fields from non-finite date:
+--
+SELECT EXTRACT(MICROSEC FROM DATE 'infinity'); -- error
+
+-- test constructors
+select make_date(2013, 7, 15);
+select make_date(-44, 3, 15);
+select make_time(8, 20, 0.0);
+-- should fail
+select make_date(0, 7, 15);
+select make_date(2013, 2, 30);
+select make_date(2013, 13, 1);
+select make_date(2013, 11, -1);
+select make_time(10, 55, 100.1);
+select make_time(24, 0, 2.1);
diff --git a/yql/essentials/tests/postgresql/original/cases/dbsize.out b/yql/essentials/tests/postgresql/original/cases/dbsize.out
new file mode 100644
index 0000000000..29804aee8b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/dbsize.out
@@ -0,0 +1,188 @@
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::bigint), (1000::bigint), (1000000::bigint),
+ (1000000000::bigint), (1000000000000::bigint),
+ (1000000000000000::bigint)) x(size);
+ size | pg_size_pretty | pg_size_pretty
+------------------+----------------+----------------
+ 10 | 10 bytes | -10 bytes
+ 1000 | 1000 bytes | -1000 bytes
+ 1000000 | 977 kB | -977 kB
+ 1000000000 | 954 MB | -954 MB
+ 1000000000000 | 931 GB | -931 GB
+ 1000000000000000 | 909 TB | -909 TB
+(6 rows)
+
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::numeric), (1000::numeric), (1000000::numeric),
+ (1000000000::numeric), (1000000000000::numeric),
+ (1000000000000000::numeric),
+ (10.5::numeric), (1000.5::numeric), (1000000.5::numeric),
+ (1000000000.5::numeric), (1000000000000.5::numeric),
+ (1000000000000000.5::numeric)) x(size);
+ size | pg_size_pretty | pg_size_pretty
+--------------------+----------------+----------------
+ 10 | 10 bytes | -10 bytes
+ 1000 | 1000 bytes | -1000 bytes
+ 1000000 | 977 kB | -977 kB
+ 1000000000 | 954 MB | -954 MB
+ 1000000000000 | 931 GB | -931 GB
+ 1000000000000000 | 909 TB | -909 TB
+ 10.5 | 10.5 bytes | -10.5 bytes
+ 1000.5 | 1000.5 bytes | -1000.5 bytes
+ 1000000.5 | 977 kB | -977 kB
+ 1000000000.5 | 954 MB | -954 MB
+ 1000000000000.5 | 931 GB | -931 GB
+ 1000000000000000.5 | 909 TB | -909 TB
+(12 rows)
+
+-- test where units change up
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::bigint), (10240::bigint),
+ (10485247::bigint), (10485248::bigint),
+ (10736893951::bigint), (10736893952::bigint),
+ (10994579406847::bigint), (10994579406848::bigint),
+ (11258449312612351::bigint), (11258449312612352::bigint)) x(size);
+ size | pg_size_pretty | pg_size_pretty
+-------------------+----------------+----------------
+ 10239 | 10239 bytes | -10239 bytes
+ 10240 | 10 kB | -10 kB
+ 10485247 | 10239 kB | -10239 kB
+ 10485248 | 10 MB | -10 MB
+ 10736893951 | 10239 MB | -10239 MB
+ 10736893952 | 10 GB | -10 GB
+ 10994579406847 | 10239 GB | -10239 GB
+ 10994579406848 | 10 TB | -10 TB
+ 11258449312612351 | 10239 TB | -10239 TB
+ 11258449312612352 | 10240 TB | -10240 TB
+(10 rows)
+
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::numeric), (10240::numeric),
+ (10485247::numeric), (10485248::numeric),
+ (10736893951::numeric), (10736893952::numeric),
+ (10994579406847::numeric), (10994579406848::numeric),
+ (11258449312612351::numeric), (11258449312612352::numeric)) x(size);
+ size | pg_size_pretty | pg_size_pretty
+-------------------+----------------+----------------
+ 10239 | 10239 bytes | -10239 bytes
+ 10240 | 10 kB | -10 kB
+ 10485247 | 10239 kB | -10239 kB
+ 10485248 | 10 MB | -10 MB
+ 10736893951 | 10239 MB | -10239 MB
+ 10736893952 | 10 GB | -10 GB
+ 10994579406847 | 10239 GB | -10239 GB
+ 10994579406848 | 10 TB | -10 TB
+ 11258449312612351 | 10239 TB | -10239 TB
+ 11258449312612352 | 10240 TB | -10240 TB
+(10 rows)
+
+-- pg_size_bytes() tests
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
+ ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
+ size | pg_size_bytes
+----------+------------------
+ 1 | 1
+ 123bytes | 123
+ 1kB | 1024
+ 1MB | 1048576
+ 1 GB | 1073741824
+ 1.5 GB | 1610612736
+ 1TB | 1099511627776
+ 3000 TB | 3298534883328000
+ 1e6 MB | 1048576000000
+(9 rows)
+
+-- case-insensitive units are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
+ ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
+ size | pg_size_bytes
+----------+------------------
+ 1 | 1
+ 123bYteS | 123
+ 1kb | 1024
+ 1mb | 1048576
+ 1 Gb | 1073741824
+ 1.5 gB | 1610612736
+ 1tb | 1099511627776
+ 3000 tb | 3298534883328000
+ 1e6 mb | 1048576000000
+(9 rows)
+
+-- negative numbers are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
+ ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
+ size | pg_size_bytes
+-----------+-------------------
+ -1 | -1
+ -123bytes | -123
+ -1kb | -1024
+ -1mb | -1048576
+ -1 Gb | -1073741824
+ -1.5 gB | -1610612736
+ -1tb | -1099511627776
+ -3000 TB | -3298534883328000
+ -10e-1 MB | -1048576
+(9 rows)
+
+-- different cases with allowed points
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
+ ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
+ size | pg_size_bytes
+--------+---------------
+ -1. | -1
+ -1.kb | -1024
+ -1. kb | -1024
+ -0. gb | 0
+ -.1 | 0
+ -.1kb | -102
+ -.1 kb | -102
+ -.0 gb | 0
+(8 rows)
+
+-- invalid inputs
+SELECT pg_size_bytes('1 AB');
+ERROR: invalid size: "1 AB"
+DETAIL: Invalid size unit: "AB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('1 AB A');
+ERROR: invalid size: "1 AB A"
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('1 AB A ');
+ERROR: invalid size: "1 AB A "
+DETAIL: Invalid size unit: "AB A".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('9223372036854775807.9');
+ERROR: bigint out of range
+SELECT pg_size_bytes('1e100');
+ERROR: bigint out of range
+SELECT pg_size_bytes('1e1000000000000000000');
+ERROR: value overflows numeric format
+SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+ERROR: invalid size: "1 byte"
+DETAIL: Invalid size unit: "byte".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('');
+ERROR: invalid size: ""
+SELECT pg_size_bytes('kb');
+ERROR: invalid size: "kb"
+SELECT pg_size_bytes('..');
+ERROR: invalid size: ".."
+SELECT pg_size_bytes('-.');
+ERROR: invalid size: "-."
+SELECT pg_size_bytes('-.kb');
+ERROR: invalid size: "-.kb"
+SELECT pg_size_bytes('-. kb');
+ERROR: invalid size: "-. kb"
+SELECT pg_size_bytes('.+912');
+ERROR: invalid size: ".+912"
+SELECT pg_size_bytes('+912+ kB');
+ERROR: invalid size: "+912+ kB"
+DETAIL: Invalid size unit: "+ kB".
+HINT: Valid units are "bytes", "kB", "MB", "GB", and "TB".
+SELECT pg_size_bytes('++123 kB');
+ERROR: invalid size: "++123 kB"
diff --git a/yql/essentials/tests/postgresql/original/cases/dbsize.sql b/yql/essentials/tests/postgresql/original/cases/dbsize.sql
new file mode 100644
index 0000000000..6a45c5eb1c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/dbsize.sql
@@ -0,0 +1,67 @@
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::bigint), (1000::bigint), (1000000::bigint),
+ (1000000000::bigint), (1000000000000::bigint),
+ (1000000000000000::bigint)) x(size);
+
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10::numeric), (1000::numeric), (1000000::numeric),
+ (1000000000::numeric), (1000000000000::numeric),
+ (1000000000000000::numeric),
+ (10.5::numeric), (1000.5::numeric), (1000000.5::numeric),
+ (1000000000.5::numeric), (1000000000000.5::numeric),
+ (1000000000000000.5::numeric)) x(size);
+
+-- test where units change up
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::bigint), (10240::bigint),
+ (10485247::bigint), (10485248::bigint),
+ (10736893951::bigint), (10736893952::bigint),
+ (10994579406847::bigint), (10994579406848::bigint),
+ (11258449312612351::bigint), (11258449312612352::bigint)) x(size);
+
+SELECT size, pg_size_pretty(size), pg_size_pretty(-1 * size) FROM
+ (VALUES (10239::numeric), (10240::numeric),
+ (10485247::numeric), (10485248::numeric),
+ (10736893951::numeric), (10736893952::numeric),
+ (10994579406847::numeric), (10994579406848::numeric),
+ (11258449312612351::numeric), (11258449312612352::numeric)) x(size);
+
+-- pg_size_bytes() tests
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bytes'), ('1kB'), ('1MB'), (' 1 GB'), ('1.5 GB '),
+ ('1TB'), ('3000 TB'), ('1e6 MB')) x(size);
+
+-- case-insensitive units are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('1'), ('123bYteS'), ('1kb'), ('1mb'), (' 1 Gb'), ('1.5 gB '),
+ ('1tb'), ('3000 tb'), ('1e6 mb')) x(size);
+
+-- negative numbers are supported
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1'), ('-123bytes'), ('-1kb'), ('-1mb'), (' -1 Gb'), ('-1.5 gB '),
+ ('-1tb'), ('-3000 TB'), ('-10e-1 MB')) x(size);
+
+-- different cases with allowed points
+SELECT size, pg_size_bytes(size) FROM
+ (VALUES ('-1.'), ('-1.kb'), ('-1. kb'), ('-0. gb'),
+ ('-.1'), ('-.1kb'), ('-.1 kb'), ('-.0 gb')) x(size);
+
+-- invalid inputs
+SELECT pg_size_bytes('1 AB');
+SELECT pg_size_bytes('1 AB A');
+SELECT pg_size_bytes('1 AB A ');
+SELECT pg_size_bytes('9223372036854775807.9');
+SELECT pg_size_bytes('1e100');
+SELECT pg_size_bytes('1e1000000000000000000');
+SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported
+SELECT pg_size_bytes('');
+
+SELECT pg_size_bytes('kb');
+SELECT pg_size_bytes('..');
+SELECT pg_size_bytes('-.');
+SELECT pg_size_bytes('-.kb');
+SELECT pg_size_bytes('-. kb');
+
+SELECT pg_size_bytes('.+912');
+SELECT pg_size_bytes('+912+ kB');
+SELECT pg_size_bytes('++123 kB');
diff --git a/yql/essentials/tests/postgresql/original/cases/delete.out b/yql/essentials/tests/postgresql/original/cases/delete.out
new file mode 100644
index 0000000000..e7eb3285f8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/delete.out
@@ -0,0 +1,33 @@
+CREATE TABLE delete_test (
+ id SERIAL PRIMARY KEY,
+ a INT,
+ b text
+);
+INSERT INTO delete_test (a) VALUES (10);
+INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000));
+INSERT INTO delete_test (a) VALUES (100);
+-- allow an alias to be specified for DELETE's target table
+DELETE FROM delete_test AS dt WHERE dt.a > 75;
+-- if an alias is specified, don't allow the original table name
+-- to be referenced
+DELETE FROM delete_test dt WHERE delete_test.a > 25;
+ERROR: invalid reference to FROM-clause entry for table "delete_test"
+LINE 1: DELETE FROM delete_test dt WHERE delete_test.a > 25;
+ ^
+HINT: Perhaps you meant to reference the table alias "dt".
+SELECT id, a, char_length(b) FROM delete_test;
+ id | a | char_length
+----+----+-------------
+ 1 | 10 |
+ 2 | 50 | 10000
+(2 rows)
+
+-- delete a row with a TOASTed value
+DELETE FROM delete_test WHERE a > 25;
+SELECT id, a, char_length(b) FROM delete_test;
+ id | a | char_length
+----+----+-------------
+ 1 | 10 |
+(1 row)
+
+DROP TABLE delete_test;
diff --git a/yql/essentials/tests/postgresql/original/cases/delete.sql b/yql/essentials/tests/postgresql/original/cases/delete.sql
new file mode 100644
index 0000000000..d8cb99e93c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/delete.sql
@@ -0,0 +1,25 @@
+CREATE TABLE delete_test (
+ id SERIAL PRIMARY KEY,
+ a INT,
+ b text
+);
+
+INSERT INTO delete_test (a) VALUES (10);
+INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000));
+INSERT INTO delete_test (a) VALUES (100);
+
+-- allow an alias to be specified for DELETE's target table
+DELETE FROM delete_test AS dt WHERE dt.a > 75;
+
+-- if an alias is specified, don't allow the original table name
+-- to be referenced
+DELETE FROM delete_test dt WHERE delete_test.a > 25;
+
+SELECT id, a, char_length(b) FROM delete_test;
+
+-- delete a row with a TOASTed value
+DELETE FROM delete_test WHERE a > 25;
+
+SELECT id, a, char_length(b) FROM delete_test;
+
+DROP TABLE delete_test;
diff --git a/yql/essentials/tests/postgresql/original/cases/expressions.out b/yql/essentials/tests/postgresql/original/cases/expressions.out
new file mode 100644
index 0000000000..9699d86cc6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/expressions.out
@@ -0,0 +1,381 @@
+--
+-- expression evaluation tests that don't fit into a more specific file
+--
+--
+-- Tests for SQLVAlueFunction
+--
+-- current_date (always matches because of transactional behaviour)
+SELECT date(now())::text = current_date::text;
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_time / localtime
+SELECT now()::timetz::text = current_time::text;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT now()::timetz(4)::text = current_time(4)::text;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT now()::time::text = localtime::text;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT now()::time(3)::text = localtime(3)::text;
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_timestamp / localtimestamp (always matches because of transactional behaviour)
+SELECT current_timestamp = NOW();
+ ?column?
+----------
+ t
+(1 row)
+
+-- precision
+SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
+ ?column?
+----------
+ t
+(1 row)
+
+-- localtimestamp
+SELECT now()::timestamp::text = localtimestamp::text;
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_role/user/user is tested in rolnames.sql
+-- current database / catalog
+SELECT current_catalog = current_database();
+ ?column?
+----------
+ t
+(1 row)
+
+-- current_schema
+SELECT current_schema;
+ current_schema
+----------------
+ public
+(1 row)
+
+SET search_path = 'notme';
+SELECT current_schema;
+ current_schema
+----------------
+
+(1 row)
+
+SET search_path = 'pg_catalog';
+SELECT current_schema;
+ current_schema
+----------------
+ pg_catalog
+(1 row)
+
+RESET search_path;
+--
+-- Tests for BETWEEN
+--
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+ QUERY PLAN
+-----------------------------------------------------------------------------
+ Aggregate
+ -> Seq Scan on date_tbl
+ Filter: ((f1 >= '01-01-1997'::date) AND (f1 <= '01-01-1998'::date))
+(3 rows)
+
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+ count
+-------
+ 3
+(1 row)
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Aggregate
+ -> Seq Scan on date_tbl
+ Filter: ((f1 < '01-01-1997'::date) OR (f1 > '01-01-1998'::date))
+(3 rows)
+
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+ count
+-------
+ 13
+(1 row)
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------
+ Aggregate
+ -> Seq Scan on date_tbl
+ Filter: (((f1 >= '01-01-1997'::date) AND (f1 <= '01-01-1998'::date)) OR ((f1 >= '01-01-1998'::date) AND (f1 <= '01-01-1997'::date)))
+(3 rows)
+
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+ count
+-------
+ 3
+(1 row)
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------
+ Aggregate
+ -> Seq Scan on date_tbl
+ Filter: (((f1 < '01-01-1997'::date) OR (f1 > '01-01-1998'::date)) AND ((f1 < '01-01-1998'::date) OR (f1 > '01-01-1997'::date)))
+(3 rows)
+
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+ count
+-------
+ 13
+(1 row)
+
+--
+-- Test parsing of a no-op cast to a type with unspecified typmod
+--
+begin;
+create table numeric_tbl (f1 numeric(18,3), f2 numeric);
+create view numeric_view as
+ select
+ f1, f1::numeric(16,4) as f1164, f1::numeric as f1n,
+ f2, f2::numeric(16,4) as f2164, f2::numeric as f2n
+ from numeric_tbl;
+\d+ numeric_view
+ View "public.numeric_view"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------------+-----------+----------+---------+---------+-------------
+ f1 | numeric(18,3) | | | | main |
+ f1164 | numeric(16,4) | | | | main |
+ f1n | numeric | | | | main |
+ f2 | numeric | | | | main |
+ f2164 | numeric(16,4) | | | | main |
+ f2n | numeric | | | | main |
+View definition:
+ SELECT numeric_tbl.f1,
+ numeric_tbl.f1::numeric(16,4) AS f1164,
+ numeric_tbl.f1::numeric AS f1n,
+ numeric_tbl.f2,
+ numeric_tbl.f2::numeric(16,4) AS f2164,
+ numeric_tbl.f2 AS f2n
+ FROM numeric_tbl;
+
+explain (verbose, costs off) select * from numeric_view;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------------------------------
+ Seq Scan on public.numeric_tbl
+ Output: numeric_tbl.f1, (numeric_tbl.f1)::numeric(16,4), (numeric_tbl.f1)::numeric, numeric_tbl.f2, (numeric_tbl.f2)::numeric(16,4), numeric_tbl.f2
+(2 rows)
+
+-- bpchar, lacking planner support for its length coercion function,
+-- could behave differently
+create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
+create view bpchar_view as
+ select
+ f1, f1::character(14) as f114, f1::bpchar as f1n,
+ f2, f2::character(14) as f214, f2::bpchar as f2n
+ from bpchar_tbl;
+\d+ bpchar_view
+ View "public.bpchar_view"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+--------+---------------+-----------+----------+---------+----------+-------------
+ f1 | character(16) | | | | extended |
+ f114 | character(14) | | | | extended |
+ f1n | bpchar | | | | extended |
+ f2 | bpchar | | | | extended |
+ f214 | character(14) | | | | extended |
+ f2n | bpchar | | | | extended |
+View definition:
+ SELECT bpchar_tbl.f1,
+ bpchar_tbl.f1::character(14) AS f114,
+ bpchar_tbl.f1::bpchar AS f1n,
+ bpchar_tbl.f2,
+ bpchar_tbl.f2::character(14) AS f214,
+ bpchar_tbl.f2 AS f2n
+ FROM bpchar_tbl;
+
+explain (verbose, costs off) select * from bpchar_view
+ where f1::bpchar = 'foo';
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------
+ Index Scan using bpchar_tbl_f1_key on public.bpchar_tbl
+ Output: bpchar_tbl.f1, (bpchar_tbl.f1)::character(14), (bpchar_tbl.f1)::bpchar, bpchar_tbl.f2, (bpchar_tbl.f2)::character(14), bpchar_tbl.f2
+ Index Cond: ((bpchar_tbl.f1)::bpchar = 'foo'::bpchar)
+(3 rows)
+
+rollback;
+--
+-- Ordinarily, IN/NOT IN can be converted to a ScalarArrayOpExpr
+-- with a suitably-chosen array type.
+--
+explain (verbose, costs off)
+select random() IN (1, 4, 8.0);
+ QUERY PLAN
+------------------------------------------------------------
+ Result
+ Output: (random() = ANY ('{1,4,8}'::double precision[]))
+(2 rows)
+
+explain (verbose, costs off)
+select random()::int IN (1, 4, 8.0);
+ QUERY PLAN
+---------------------------------------------------------------------------
+ Result
+ Output: (((random())::integer)::numeric = ANY ('{1,4,8.0}'::numeric[]))
+(2 rows)
+
+-- However, if there's not a common supertype for the IN elements,
+-- we should instead try to produce "x = v1 OR x = v2 OR ...".
+-- In most cases that'll fail for lack of all the requisite = operators,
+-- but it can succeed sometimes. So this should complain about lack of
+-- an = operator, not about cast failure.
+select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+ERROR: operator does not exist: point = box
+LINE 1: select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+ ^
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+--
+-- Tests for ScalarArrayOpExpr with a hashfn
+--
+-- create a stable function so that the tests below are not
+-- evaluated using the planner's constant folding.
+begin;
+create function return_int_input(int) returns int as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+create function return_text_input(text) returns text as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ?column?
+----------
+ t
+(1 row)
+
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ?column?
+----------
+
+(1 row)
+
+select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+ ?column?
+----------
+
+(1 row)
+
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+ ?column?
+----------
+ t
+(1 row)
+
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+ ?column?
+----------
+
+(1 row)
+
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+ ?column?
+----------
+
+(1 row)
+
+select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+ ?column?
+----------
+ t
+(1 row)
+
+rollback;
+-- Test with non-strict equality function.
+-- We need to create our own type for this.
+begin;
+create type myint;
+create function myintin(cstring) returns myint strict immutable language
+ internal as 'int4in';
+NOTICE: return type myint is only a shell
+create function myintout(myint) returns cstring strict immutable language
+ internal as 'int4out';
+NOTICE: argument type myint is only a shell
+create function myinthash(myint) returns integer strict immutable language
+ internal as 'hashint4';
+NOTICE: argument type myint is only a shell
+create type myint (input = myintin, output = myintout, like = int4);
+create cast (int4 as myint) without function;
+create cast (myint as int4) without function;
+create function myinteq(myint, myint) returns bool as $$
+begin
+ if $1 is null and $2 is null then
+ return true;
+ else
+ return $1::int = $2::int;
+ end if;
+end;
+$$ language plpgsql immutable;
+create operator = (
+ leftarg = myint,
+ rightarg = myint,
+ commutator = =,
+ negator = <>,
+ procedure = myinteq,
+ restrict = eqsel,
+ join = eqjoinsel,
+ merges
+);
+create operator class myint_ops
+default for type myint using hash as
+ operator 1 = (myint, myint),
+ function 1 myinthash(myint);
+create table inttest (a myint);
+insert into inttest values(1::myint),(null);
+-- try an array with enough elements to cause hashing
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
+ a
+---
+ 1
+
+(2 rows)
+
+-- ensure the result matched with the non-hashed version. We simply remove
+-- some array elements so that we don't reach the hashing threshold.
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
+ a
+---
+ 1
+
+(2 rows)
+
+rollback;
diff --git a/yql/essentials/tests/postgresql/original/cases/expressions.sql b/yql/essentials/tests/postgresql/original/cases/expressions.sql
new file mode 100644
index 0000000000..f9f9f97efa
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/expressions.sql
@@ -0,0 +1,205 @@
+--
+-- expression evaluation tests that don't fit into a more specific file
+--
+
+--
+-- Tests for SQLVAlueFunction
+--
+
+
+-- current_date (always matches because of transactional behaviour)
+SELECT date(now())::text = current_date::text;
+
+
+-- current_time / localtime
+SELECT now()::timetz::text = current_time::text;
+SELECT now()::timetz(4)::text = current_time(4)::text;
+SELECT now()::time::text = localtime::text;
+SELECT now()::time(3)::text = localtime(3)::text;
+
+-- current_timestamp / localtimestamp (always matches because of transactional behaviour)
+SELECT current_timestamp = NOW();
+-- precision
+SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
+-- localtimestamp
+SELECT now()::timestamp::text = localtimestamp::text;
+
+-- current_role/user/user is tested in rolnames.sql
+
+-- current database / catalog
+SELECT current_catalog = current_database();
+
+-- current_schema
+SELECT current_schema;
+SET search_path = 'notme';
+SELECT current_schema;
+SET search_path = 'pg_catalog';
+SELECT current_schema;
+RESET search_path;
+
+
+--
+-- Tests for BETWEEN
+--
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+select count(*) from date_tbl
+ where f1 between '1997-01-01' and '1998-01-01';
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+select count(*) from date_tbl
+ where f1 not between '1997-01-01' and '1998-01-01';
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+select count(*) from date_tbl
+ where f1 between symmetric '1997-01-01' and '1998-01-01';
+
+explain (costs off)
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+select count(*) from date_tbl
+ where f1 not between symmetric '1997-01-01' and '1998-01-01';
+
+
+--
+-- Test parsing of a no-op cast to a type with unspecified typmod
+--
+begin;
+
+create table numeric_tbl (f1 numeric(18,3), f2 numeric);
+
+create view numeric_view as
+ select
+ f1, f1::numeric(16,4) as f1164, f1::numeric as f1n,
+ f2, f2::numeric(16,4) as f2164, f2::numeric as f2n
+ from numeric_tbl;
+
+\d+ numeric_view
+
+explain (verbose, costs off) select * from numeric_view;
+
+-- bpchar, lacking planner support for its length coercion function,
+-- could behave differently
+
+create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
+
+create view bpchar_view as
+ select
+ f1, f1::character(14) as f114, f1::bpchar as f1n,
+ f2, f2::character(14) as f214, f2::bpchar as f2n
+ from bpchar_tbl;
+
+\d+ bpchar_view
+
+explain (verbose, costs off) select * from bpchar_view
+ where f1::bpchar = 'foo';
+
+rollback;
+
+
+--
+-- Ordinarily, IN/NOT IN can be converted to a ScalarArrayOpExpr
+-- with a suitably-chosen array type.
+--
+explain (verbose, costs off)
+select random() IN (1, 4, 8.0);
+explain (verbose, costs off)
+select random()::int IN (1, 4, 8.0);
+-- However, if there's not a common supertype for the IN elements,
+-- we should instead try to produce "x = v1 OR x = v2 OR ...".
+-- In most cases that'll fail for lack of all the requisite = operators,
+-- but it can succeed sometimes. So this should complain about lack of
+-- an = operator, not about cast failure.
+select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
+
+
+--
+-- Tests for ScalarArrayOpExpr with a hashfn
+--
+
+-- create a stable function so that the tests below are not
+-- evaluated using the planner's constant folding.
+begin;
+
+create function return_int_input(int) returns int as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+
+create function return_text_input(text) returns text as $$
+begin
+ return $1;
+end;
+$$ language plpgsql stable;
+
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
+select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
+select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
+select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
+
+rollback;
+
+-- Test with non-strict equality function.
+-- We need to create our own type for this.
+
+begin;
+
+create type myint;
+create function myintin(cstring) returns myint strict immutable language
+ internal as 'int4in';
+create function myintout(myint) returns cstring strict immutable language
+ internal as 'int4out';
+create function myinthash(myint) returns integer strict immutable language
+ internal as 'hashint4';
+
+create type myint (input = myintin, output = myintout, like = int4);
+
+create cast (int4 as myint) without function;
+create cast (myint as int4) without function;
+
+create function myinteq(myint, myint) returns bool as $$
+begin
+ if $1 is null and $2 is null then
+ return true;
+ else
+ return $1::int = $2::int;
+ end if;
+end;
+$$ language plpgsql immutable;
+
+create operator = (
+ leftarg = myint,
+ rightarg = myint,
+ commutator = =,
+ negator = <>,
+ procedure = myinteq,
+ restrict = eqsel,
+ join = eqjoinsel,
+ merges
+);
+
+create operator class myint_ops
+default for type myint using hash as
+ operator 1 = (myint, myint),
+ function 1 myinthash(myint);
+
+create table inttest (a myint);
+insert into inttest values(1::myint),(null);
+
+-- try an array with enough elements to cause hashing
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
+-- ensure the result matched with the non-hashed version. We simply remove
+-- some array elements so that we don't reach the hashing threshold.
+select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
+
+rollback;
diff --git a/yql/essentials/tests/postgresql/original/cases/float4.out b/yql/essentials/tests/postgresql/original/cases/float4.out
new file mode 100644
index 0000000000..6ad5d00aa2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/float4.out
@@ -0,0 +1,961 @@
+--
+-- FLOAT4
+--
+CREATE TABLE FLOAT4_TBL (f1 float4);
+INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+-- test for over and under flow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+ERROR: "10e70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ERROR: "-10e70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ERROR: "10e-70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ERROR: "-10e-70" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+ERROR: value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+ERROR: value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ERROR: "10e400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ERROR: "-10e400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ERROR: "10e-400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ERROR: "-10e-400" is out of range for type real
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+ ^
+-- bad input
+INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type real: ""
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type real: " "
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ERROR: invalid input syntax for type real: "xyz"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ERROR: invalid input syntax for type real: "5.0.0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type real: "5 . 0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ERROR: invalid input syntax for type real: "5. 0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ERROR: invalid input syntax for type real: " - 3.0"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+ ^
+INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type real: "123 5"
+LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+ ^
+-- special inputs
+SELECT 'NaN'::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'nan'::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT ' NAN '::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'infinity'::float4;
+ float4
+----------
+ Infinity
+(1 row)
+
+SELECT ' -INFINiTY '::float4;
+ float4
+-----------
+ -Infinity
+(1 row)
+
+-- bad special inputs
+SELECT 'N A N'::float4;
+ERROR: invalid input syntax for type real: "N A N"
+LINE 1: SELECT 'N A N'::float4;
+ ^
+SELECT 'NaN x'::float4;
+ERROR: invalid input syntax for type real: "NaN x"
+LINE 1: SELECT 'NaN x'::float4;
+ ^
+SELECT ' INFINITY x'::float4;
+ERROR: invalid input syntax for type real: " INFINITY x"
+LINE 1: SELECT ' INFINITY x'::float4;
+ ^
+SELECT 'Infinity'::float4 + 100.0;
+ ?column?
+----------
+ Infinity
+(1 row)
+
+SELECT 'Infinity'::float4 / 'Infinity'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '42'::float4 / 'Infinity'::float4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT 'nan'::float4 / 'nan'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::float4 / '0'::float4;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::numeric::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT * FROM FLOAT4_TBL;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(5 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+ f1
+--------
+ 1004.3
+(1 row)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e-20
+(3 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+ f1
+---------------
+ 0
+ -34.84
+ 1.2345679e-20
+(3 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e-20
+(4 rows)
+
+SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+----------------
+ 1004.3 | -10043
+ 1.2345679e+20 | -1.2345678e+21
+ 1.2345679e-20 | -1.2345678e-19
+(3 rows)
+
+SELECT f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+---------------
+ 1004.3 | 994.3
+ 1.2345679e+20 | 1.2345679e+20
+ 1.2345679e-20 | -10
+(3 rows)
+
+SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+----------------
+ 1004.3 | -100.43
+ 1.2345679e+20 | -1.2345679e+19
+ 1.2345679e-20 | -1.2345679e-21
+(3 rows)
+
+SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+---------------+---------------
+ 1004.3 | 1014.3
+ 1.2345679e+20 | 1.2345679e+20
+ 1.2345679e-20 | 10
+(3 rows)
+
+-- test divide by zero
+SELECT f.f1 / '0.0' from FLOAT4_TBL f;
+ERROR: division by zero
+SELECT * FROM FLOAT4_TBL;
+ f1
+---------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345679e+20
+ 1.2345679e-20
+(5 rows)
+
+-- test the unary float4abs operator
+SELECT f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+ f1 | abs_f1
+---------------+---------------
+ 0 | 0
+ 1004.3 | 1004.3
+ -34.84 | 34.84
+ 1.2345679e+20 | 1.2345679e+20
+ 1.2345679e-20 | 1.2345679e-20
+(5 rows)
+
+UPDATE FLOAT4_TBL
+ SET f1 = FLOAT4_TBL.f1 * '-1'
+ WHERE FLOAT4_TBL.f1 > '0.0';
+SELECT * FROM FLOAT4_TBL;
+ f1
+----------------
+ 0
+ -34.84
+ -1004.3
+ -1.2345679e+20
+ -1.2345679e-20
+(5 rows)
+
+-- test edge-case coercions to integer
+SELECT '32767.4'::float4::int2;
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT '32767.6'::float4::int2;
+ERROR: smallint out of range
+SELECT '-32768.4'::float4::int2;
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT '-32768.6'::float4::int2;
+ERROR: smallint out of range
+SELECT '2147483520'::float4::int4;
+ int4
+------------
+ 2147483520
+(1 row)
+
+SELECT '2147483647'::float4::int4;
+ERROR: integer out of range
+SELECT '-2147483648.5'::float4::int4;
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT '-2147483900'::float4::int4;
+ERROR: integer out of range
+SELECT '9223369837831520256'::float4::int8;
+ int8
+---------------------
+ 9223369837831520256
+(1 row)
+
+SELECT '9223372036854775807'::float4::int8;
+ERROR: bigint out of range
+SELECT '-9223372036854775808.5'::float4::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT '-9223380000000000000'::float4::int8;
+ERROR: bigint out of range
+-- Test for correct input rounding in edge cases.
+-- These lists are from Paxson 1991, excluding subnormals and
+-- inputs of over 9 sig. digits.
+SELECT float4send('5e-20'::float4);
+ float4send
+------------
+ \x1f6c1e4a
+(1 row)
+
+SELECT float4send('67e14'::float4);
+ float4send
+------------
+ \x59be6cea
+(1 row)
+
+SELECT float4send('985e15'::float4);
+ float4send
+------------
+ \x5d5ab6c4
+(1 row)
+
+SELECT float4send('55895e-16'::float4);
+ float4send
+------------
+ \x2cc4a9bd
+(1 row)
+
+SELECT float4send('7038531e-32'::float4);
+ float4send
+------------
+ \x15ae43fd
+(1 row)
+
+SELECT float4send('702990899e-20'::float4);
+ float4send
+------------
+ \x2cf757ca
+(1 row)
+
+SELECT float4send('3e-23'::float4);
+ float4send
+------------
+ \x1a111234
+(1 row)
+
+SELECT float4send('57e18'::float4);
+ float4send
+------------
+ \x6045c22c
+(1 row)
+
+SELECT float4send('789e-35'::float4);
+ float4send
+------------
+ \x0a23de70
+(1 row)
+
+SELECT float4send('2539e-18'::float4);
+ float4send
+------------
+ \x2736f449
+(1 row)
+
+SELECT float4send('76173e28'::float4);
+ float4send
+------------
+ \x7616398a
+(1 row)
+
+SELECT float4send('887745e-11'::float4);
+ float4send
+------------
+ \x3714f05c
+(1 row)
+
+SELECT float4send('5382571e-37'::float4);
+ float4send
+------------
+ \x0d2eaca7
+(1 row)
+
+SELECT float4send('82381273e-35'::float4);
+ float4send
+------------
+ \x128289d1
+(1 row)
+
+SELECT float4send('750486563e-38'::float4);
+ float4send
+------------
+ \x0f18377e
+(1 row)
+
+-- Test that the smallest possible normalized input value inputs
+-- correctly, either in 9-significant-digit or shortest-decimal
+-- format.
+--
+-- exact val is 1.1754943508...
+-- shortest val is 1.1754944000
+-- midpoint to next val is 1.1754944208...
+SELECT float4send('1.17549435e-38'::float4);
+ float4send
+------------
+ \x00800000
+(1 row)
+
+SELECT float4send('1.1754944e-38'::float4);
+ float4send
+------------
+ \x00800000
+(1 row)
+
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+create type xfloat4;
+create function xfloat4in(cstring) returns xfloat4 immutable strict
+ language internal as 'int4in';
+NOTICE: return type xfloat4 is only a shell
+create function xfloat4out(xfloat4) returns cstring immutable strict
+ language internal as 'int4out';
+NOTICE: argument type xfloat4 is only a shell
+create type xfloat4 (input = xfloat4in, output = xfloat4out, like = float4);
+create cast (xfloat4 as float4) without function;
+create cast (float4 as xfloat4) without function;
+create cast (xfloat4 as integer) without function;
+create cast (integer as xfloat4) without function;
+-- float4: seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+with testdata(bits) as (values
+ -- small subnormals
+ (x'00000001'),
+ (x'00000002'), (x'00000003'),
+ (x'00000010'), (x'00000011'), (x'00000100'), (x'00000101'),
+ (x'00004000'), (x'00004001'), (x'00080000'), (x'00080001'),
+ -- stress values
+ (x'0053c4f4'), -- 7693e-42
+ (x'006c85c4'), -- 996622e-44
+ (x'0041ca76'), -- 60419369e-46
+ (x'004b7678'), -- 6930161142e-48
+ -- taken from upstream testsuite
+ (x'00000007'),
+ (x'00424fe2'),
+ -- borderline between subnormal and normal
+ (x'007ffff0'), (x'007ffff1'), (x'007ffffe'), (x'007fffff'))
+select float4send(flt) as ibits,
+ flt
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+ ibits | flt
+------------+---------------
+ \x00000001 | 1e-45
+ \x00000002 | 3e-45
+ \x00000003 | 4e-45
+ \x00000010 | 2.2e-44
+ \x00000011 | 2.4e-44
+ \x00000100 | 3.59e-43
+ \x00000101 | 3.6e-43
+ \x00004000 | 2.2959e-41
+ \x00004001 | 2.296e-41
+ \x00080000 | 7.34684e-40
+ \x00080001 | 7.34685e-40
+ \x0053c4f4 | 7.693e-39
+ \x006c85c4 | 9.96622e-39
+ \x0041ca76 | 6.041937e-39
+ \x004b7678 | 6.930161e-39
+ \x00000007 | 1e-44
+ \x00424fe2 | 6.0898e-39
+ \x007ffff0 | 1.1754921e-38
+ \x007ffff1 | 1.1754922e-38
+ \x007ffffe | 1.1754941e-38
+ \x007fffff | 1.1754942e-38
+(21 rows)
+
+with testdata(bits) as (values
+ (x'00000000'),
+ -- smallest normal values
+ (x'00800000'), (x'00800001'), (x'00800004'), (x'00800005'),
+ (x'00800006'),
+ -- small normal values chosen for short vs. long output
+ (x'008002f1'), (x'008002f2'), (x'008002f3'),
+ (x'00800e17'), (x'00800e18'), (x'00800e19'),
+ -- assorted values (random mantissae)
+ (x'01000001'), (x'01102843'), (x'01a52c98'),
+ (x'0219c229'), (x'02e4464d'), (x'037343c1'), (x'03a91b36'),
+ (x'047ada65'), (x'0496fe87'), (x'0550844f'), (x'05999da3'),
+ (x'060ea5e2'), (x'06e63c45'), (x'07f1e548'), (x'0fc5282b'),
+ (x'1f850283'), (x'2874a9d6'),
+ -- values around 5e-08
+ (x'3356bf94'), (x'3356bf95'), (x'3356bf96'),
+ -- around 1e-07
+ (x'33d6bf94'), (x'33d6bf95'), (x'33d6bf96'),
+ -- around 3e-07 .. 1e-04
+ (x'34a10faf'), (x'34a10fb0'), (x'34a10fb1'),
+ (x'350637bc'), (x'350637bd'), (x'350637be'),
+ (x'35719786'), (x'35719787'), (x'35719788'),
+ (x'358637bc'), (x'358637bd'), (x'358637be'),
+ (x'36a7c5ab'), (x'36a7c5ac'), (x'36a7c5ad'),
+ (x'3727c5ab'), (x'3727c5ac'), (x'3727c5ad'),
+ -- format crossover at 1e-04
+ (x'38d1b714'), (x'38d1b715'), (x'38d1b716'),
+ (x'38d1b717'), (x'38d1b718'), (x'38d1b719'),
+ (x'38d1b71a'), (x'38d1b71b'), (x'38d1b71c'),
+ (x'38d1b71d'),
+ --
+ (x'38dffffe'), (x'38dfffff'), (x'38e00000'),
+ (x'38efffff'), (x'38f00000'), (x'38f00001'),
+ (x'3a83126e'), (x'3a83126f'), (x'3a831270'),
+ (x'3c23d709'), (x'3c23d70a'), (x'3c23d70b'),
+ (x'3dcccccc'), (x'3dcccccd'), (x'3dccccce'),
+ -- chosen to need 9 digits for 3dcccd70
+ (x'3dcccd6f'), (x'3dcccd70'), (x'3dcccd71'),
+ --
+ (x'3effffff'), (x'3f000000'), (x'3f000001'),
+ (x'3f333332'), (x'3f333333'), (x'3f333334'),
+ -- approach 1.0 with increasing numbers of 9s
+ (x'3f666665'), (x'3f666666'), (x'3f666667'),
+ (x'3f7d70a3'), (x'3f7d70a4'), (x'3f7d70a5'),
+ (x'3f7fbe76'), (x'3f7fbe77'), (x'3f7fbe78'),
+ (x'3f7ff971'), (x'3f7ff972'), (x'3f7ff973'),
+ (x'3f7fff57'), (x'3f7fff58'), (x'3f7fff59'),
+ (x'3f7fffee'), (x'3f7fffef'),
+ -- values very close to 1
+ (x'3f7ffff0'), (x'3f7ffff1'), (x'3f7ffff2'),
+ (x'3f7ffff3'), (x'3f7ffff4'), (x'3f7ffff5'),
+ (x'3f7ffff6'), (x'3f7ffff7'), (x'3f7ffff8'),
+ (x'3f7ffff9'), (x'3f7ffffa'), (x'3f7ffffb'),
+ (x'3f7ffffc'), (x'3f7ffffd'), (x'3f7ffffe'),
+ (x'3f7fffff'),
+ (x'3f800000'),
+ (x'3f800001'), (x'3f800002'), (x'3f800003'),
+ (x'3f800004'), (x'3f800005'), (x'3f800006'),
+ (x'3f800007'), (x'3f800008'), (x'3f800009'),
+ -- values 1 to 1.1
+ (x'3f80000f'), (x'3f800010'), (x'3f800011'),
+ (x'3f800012'), (x'3f800013'), (x'3f800014'),
+ (x'3f800017'), (x'3f800018'), (x'3f800019'),
+ (x'3f80001a'), (x'3f80001b'), (x'3f80001c'),
+ (x'3f800029'), (x'3f80002a'), (x'3f80002b'),
+ (x'3f800053'), (x'3f800054'), (x'3f800055'),
+ (x'3f800346'), (x'3f800347'), (x'3f800348'),
+ (x'3f8020c4'), (x'3f8020c5'), (x'3f8020c6'),
+ (x'3f8147ad'), (x'3f8147ae'), (x'3f8147af'),
+ (x'3f8ccccc'), (x'3f8ccccd'), (x'3f8cccce'),
+ --
+ (x'3fc90fdb'), -- pi/2
+ (x'402df854'), -- e
+ (x'40490fdb'), -- pi
+ --
+ (x'409fffff'), (x'40a00000'), (x'40a00001'),
+ (x'40afffff'), (x'40b00000'), (x'40b00001'),
+ (x'411fffff'), (x'41200000'), (x'41200001'),
+ (x'42c7ffff'), (x'42c80000'), (x'42c80001'),
+ (x'4479ffff'), (x'447a0000'), (x'447a0001'),
+ (x'461c3fff'), (x'461c4000'), (x'461c4001'),
+ (x'47c34fff'), (x'47c35000'), (x'47c35001'),
+ (x'497423ff'), (x'49742400'), (x'49742401'),
+ (x'4b18967f'), (x'4b189680'), (x'4b189681'),
+ (x'4cbebc1f'), (x'4cbebc20'), (x'4cbebc21'),
+ (x'4e6e6b27'), (x'4e6e6b28'), (x'4e6e6b29'),
+ (x'501502f8'), (x'501502f9'), (x'501502fa'),
+ (x'51ba43b6'), (x'51ba43b7'), (x'51ba43b8'),
+ -- stress values
+ (x'1f6c1e4a'), -- 5e-20
+ (x'59be6cea'), -- 67e14
+ (x'5d5ab6c4'), -- 985e15
+ (x'2cc4a9bd'), -- 55895e-16
+ (x'15ae43fd'), -- 7038531e-32
+ (x'2cf757ca'), -- 702990899e-20
+ (x'665ba998'), -- 25933168707e13
+ (x'743c3324'), -- 596428896559e20
+ -- exercise fixed-point memmoves
+ (x'47f1205a'),
+ (x'4640e6ae'),
+ (x'449a5225'),
+ (x'42f6e9d5'),
+ (x'414587dd'),
+ (x'3f9e064b'),
+ -- these cases come from the upstream's testsuite
+ -- BoundaryRoundEven
+ (x'4c000004'),
+ (x'50061c46'),
+ (x'510006a8'),
+ -- ExactValueRoundEven
+ (x'48951f84'),
+ (x'45fd1840'),
+ -- LotsOfTrailingZeros
+ (x'39800000'),
+ (x'3b200000'),
+ (x'3b900000'),
+ (x'3bd00000'),
+ -- Regression
+ (x'63800000'),
+ (x'4b000000'),
+ (x'4b800000'),
+ (x'4c000001'),
+ (x'4c800b0d'),
+ (x'00d24584'),
+ (x'00d90b88'),
+ (x'45803f34'),
+ (x'4f9f24f7'),
+ (x'3a8722c3'),
+ (x'5c800041'),
+ (x'15ae43fd'),
+ (x'5d4cccfb'),
+ (x'4c800001'),
+ (x'57800ed8'),
+ (x'5f000000'),
+ (x'700000f0'),
+ (x'5f23e9ac'),
+ (x'5e9502f9'),
+ (x'5e8012b1'),
+ (x'3c000028'),
+ (x'60cde861'),
+ (x'03aa2a50'),
+ (x'43480000'),
+ (x'4c000000'),
+ -- LooksLikePow5
+ (x'5D1502F9'),
+ (x'5D9502F9'),
+ (x'5E1502F9'),
+ -- OutputLength
+ (x'3f99999a'),
+ (x'3f9d70a4'),
+ (x'3f9df3b6'),
+ (x'3f9e0419'),
+ (x'3f9e0610'),
+ (x'3f9e064b'),
+ (x'3f9e0651'),
+ (x'03d20cfe')
+)
+select float4send(flt) as ibits,
+ flt,
+ flt::text::float4 as r_flt,
+ float4send(flt::text::float4) as obits,
+ float4send(flt::text::float4) = float4send(flt) as correct
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+ ibits | flt | r_flt | obits | correct
+------------+----------------+----------------+------------+---------
+ \x00000000 | 0 | 0 | \x00000000 | t
+ \x00800000 | 1.1754944e-38 | 1.1754944e-38 | \x00800000 | t
+ \x00800001 | 1.1754945e-38 | 1.1754945e-38 | \x00800001 | t
+ \x00800004 | 1.1754949e-38 | 1.1754949e-38 | \x00800004 | t
+ \x00800005 | 1.175495e-38 | 1.175495e-38 | \x00800005 | t
+ \x00800006 | 1.1754952e-38 | 1.1754952e-38 | \x00800006 | t
+ \x008002f1 | 1.1755999e-38 | 1.1755999e-38 | \x008002f1 | t
+ \x008002f2 | 1.1756e-38 | 1.1756e-38 | \x008002f2 | t
+ \x008002f3 | 1.1756001e-38 | 1.1756001e-38 | \x008002f3 | t
+ \x00800e17 | 1.1759998e-38 | 1.1759998e-38 | \x00800e17 | t
+ \x00800e18 | 1.176e-38 | 1.176e-38 | \x00800e18 | t
+ \x00800e19 | 1.1760001e-38 | 1.1760001e-38 | \x00800e19 | t
+ \x01000001 | 2.350989e-38 | 2.350989e-38 | \x01000001 | t
+ \x01102843 | 2.647751e-38 | 2.647751e-38 | \x01102843 | t
+ \x01a52c98 | 6.0675416e-38 | 6.0675416e-38 | \x01a52c98 | t
+ \x0219c229 | 1.1296386e-37 | 1.1296386e-37 | \x0219c229 | t
+ \x02e4464d | 3.354194e-37 | 3.354194e-37 | \x02e4464d | t
+ \x037343c1 | 7.148906e-37 | 7.148906e-37 | \x037343c1 | t
+ \x03a91b36 | 9.939175e-37 | 9.939175e-37 | \x03a91b36 | t
+ \x047ada65 | 2.948764e-36 | 2.948764e-36 | \x047ada65 | t
+ \x0496fe87 | 3.5498577e-36 | 3.5498577e-36 | \x0496fe87 | t
+ \x0550844f | 9.804414e-36 | 9.804414e-36 | \x0550844f | t
+ \x05999da3 | 1.4445957e-35 | 1.4445957e-35 | \x05999da3 | t
+ \x060ea5e2 | 2.6829103e-35 | 2.6829103e-35 | \x060ea5e2 | t
+ \x06e63c45 | 8.660494e-35 | 8.660494e-35 | \x06e63c45 | t
+ \x07f1e548 | 3.639641e-34 | 3.639641e-34 | \x07f1e548 | t
+ \x0fc5282b | 1.9441172e-29 | 1.9441172e-29 | \x0fc5282b | t
+ \x1f850283 | 5.6331846e-20 | 5.6331846e-20 | \x1f850283 | t
+ \x2874a9d6 | 1.3581548e-14 | 1.3581548e-14 | \x2874a9d6 | t
+ \x3356bf94 | 4.9999997e-08 | 4.9999997e-08 | \x3356bf94 | t
+ \x3356bf95 | 5e-08 | 5e-08 | \x3356bf95 | t
+ \x3356bf96 | 5.0000004e-08 | 5.0000004e-08 | \x3356bf96 | t
+ \x33d6bf94 | 9.9999994e-08 | 9.9999994e-08 | \x33d6bf94 | t
+ \x33d6bf95 | 1e-07 | 1e-07 | \x33d6bf95 | t
+ \x33d6bf96 | 1.0000001e-07 | 1.0000001e-07 | \x33d6bf96 | t
+ \x34a10faf | 2.9999998e-07 | 2.9999998e-07 | \x34a10faf | t
+ \x34a10fb0 | 3e-07 | 3e-07 | \x34a10fb0 | t
+ \x34a10fb1 | 3.0000004e-07 | 3.0000004e-07 | \x34a10fb1 | t
+ \x350637bc | 4.9999994e-07 | 4.9999994e-07 | \x350637bc | t
+ \x350637bd | 5e-07 | 5e-07 | \x350637bd | t
+ \x350637be | 5.0000006e-07 | 5.0000006e-07 | \x350637be | t
+ \x35719786 | 8.999999e-07 | 8.999999e-07 | \x35719786 | t
+ \x35719787 | 9e-07 | 9e-07 | \x35719787 | t
+ \x35719788 | 9.0000003e-07 | 9.0000003e-07 | \x35719788 | t
+ \x358637bc | 9.999999e-07 | 9.999999e-07 | \x358637bc | t
+ \x358637bd | 1e-06 | 1e-06 | \x358637bd | t
+ \x358637be | 1.0000001e-06 | 1.0000001e-06 | \x358637be | t
+ \x36a7c5ab | 4.9999994e-06 | 4.9999994e-06 | \x36a7c5ab | t
+ \x36a7c5ac | 5e-06 | 5e-06 | \x36a7c5ac | t
+ \x36a7c5ad | 5.0000003e-06 | 5.0000003e-06 | \x36a7c5ad | t
+ \x3727c5ab | 9.999999e-06 | 9.999999e-06 | \x3727c5ab | t
+ \x3727c5ac | 1e-05 | 1e-05 | \x3727c5ac | t
+ \x3727c5ad | 1.0000001e-05 | 1.0000001e-05 | \x3727c5ad | t
+ \x38d1b714 | 9.9999976e-05 | 9.9999976e-05 | \x38d1b714 | t
+ \x38d1b715 | 9.999998e-05 | 9.999998e-05 | \x38d1b715 | t
+ \x38d1b716 | 9.999999e-05 | 9.999999e-05 | \x38d1b716 | t
+ \x38d1b717 | 0.0001 | 0.0001 | \x38d1b717 | t
+ \x38d1b718 | 0.000100000005 | 0.000100000005 | \x38d1b718 | t
+ \x38d1b719 | 0.00010000001 | 0.00010000001 | \x38d1b719 | t
+ \x38d1b71a | 0.00010000002 | 0.00010000002 | \x38d1b71a | t
+ \x38d1b71b | 0.00010000003 | 0.00010000003 | \x38d1b71b | t
+ \x38d1b71c | 0.000100000034 | 0.000100000034 | \x38d1b71c | t
+ \x38d1b71d | 0.00010000004 | 0.00010000004 | \x38d1b71d | t
+ \x38dffffe | 0.00010681151 | 0.00010681151 | \x38dffffe | t
+ \x38dfffff | 0.000106811516 | 0.000106811516 | \x38dfffff | t
+ \x38e00000 | 0.00010681152 | 0.00010681152 | \x38e00000 | t
+ \x38efffff | 0.00011444091 | 0.00011444091 | \x38efffff | t
+ \x38f00000 | 0.00011444092 | 0.00011444092 | \x38f00000 | t
+ \x38f00001 | 0.000114440925 | 0.000114440925 | \x38f00001 | t
+ \x3a83126e | 0.0009999999 | 0.0009999999 | \x3a83126e | t
+ \x3a83126f | 0.001 | 0.001 | \x3a83126f | t
+ \x3a831270 | 0.0010000002 | 0.0010000002 | \x3a831270 | t
+ \x3c23d709 | 0.009999999 | 0.009999999 | \x3c23d709 | t
+ \x3c23d70a | 0.01 | 0.01 | \x3c23d70a | t
+ \x3c23d70b | 0.010000001 | 0.010000001 | \x3c23d70b | t
+ \x3dcccccc | 0.099999994 | 0.099999994 | \x3dcccccc | t
+ \x3dcccccd | 0.1 | 0.1 | \x3dcccccd | t
+ \x3dccccce | 0.10000001 | 0.10000001 | \x3dccccce | t
+ \x3dcccd6f | 0.10000121 | 0.10000121 | \x3dcccd6f | t
+ \x3dcccd70 | 0.100001216 | 0.100001216 | \x3dcccd70 | t
+ \x3dcccd71 | 0.10000122 | 0.10000122 | \x3dcccd71 | t
+ \x3effffff | 0.49999997 | 0.49999997 | \x3effffff | t
+ \x3f000000 | 0.5 | 0.5 | \x3f000000 | t
+ \x3f000001 | 0.50000006 | 0.50000006 | \x3f000001 | t
+ \x3f333332 | 0.6999999 | 0.6999999 | \x3f333332 | t
+ \x3f333333 | 0.7 | 0.7 | \x3f333333 | t
+ \x3f333334 | 0.70000005 | 0.70000005 | \x3f333334 | t
+ \x3f666665 | 0.8999999 | 0.8999999 | \x3f666665 | t
+ \x3f666666 | 0.9 | 0.9 | \x3f666666 | t
+ \x3f666667 | 0.90000004 | 0.90000004 | \x3f666667 | t
+ \x3f7d70a3 | 0.98999995 | 0.98999995 | \x3f7d70a3 | t
+ \x3f7d70a4 | 0.99 | 0.99 | \x3f7d70a4 | t
+ \x3f7d70a5 | 0.99000007 | 0.99000007 | \x3f7d70a5 | t
+ \x3f7fbe76 | 0.99899995 | 0.99899995 | \x3f7fbe76 | t
+ \x3f7fbe77 | 0.999 | 0.999 | \x3f7fbe77 | t
+ \x3f7fbe78 | 0.9990001 | 0.9990001 | \x3f7fbe78 | t
+ \x3f7ff971 | 0.9998999 | 0.9998999 | \x3f7ff971 | t
+ \x3f7ff972 | 0.9999 | 0.9999 | \x3f7ff972 | t
+ \x3f7ff973 | 0.99990004 | 0.99990004 | \x3f7ff973 | t
+ \x3f7fff57 | 0.9999899 | 0.9999899 | \x3f7fff57 | t
+ \x3f7fff58 | 0.99999 | 0.99999 | \x3f7fff58 | t
+ \x3f7fff59 | 0.99999005 | 0.99999005 | \x3f7fff59 | t
+ \x3f7fffee | 0.9999989 | 0.9999989 | \x3f7fffee | t
+ \x3f7fffef | 0.999999 | 0.999999 | \x3f7fffef | t
+ \x3f7ffff0 | 0.99999905 | 0.99999905 | \x3f7ffff0 | t
+ \x3f7ffff1 | 0.9999991 | 0.9999991 | \x3f7ffff1 | t
+ \x3f7ffff2 | 0.99999917 | 0.99999917 | \x3f7ffff2 | t
+ \x3f7ffff3 | 0.9999992 | 0.9999992 | \x3f7ffff3 | t
+ \x3f7ffff4 | 0.9999993 | 0.9999993 | \x3f7ffff4 | t
+ \x3f7ffff5 | 0.99999934 | 0.99999934 | \x3f7ffff5 | t
+ \x3f7ffff6 | 0.9999994 | 0.9999994 | \x3f7ffff6 | t
+ \x3f7ffff7 | 0.99999946 | 0.99999946 | \x3f7ffff7 | t
+ \x3f7ffff8 | 0.9999995 | 0.9999995 | \x3f7ffff8 | t
+ \x3f7ffff9 | 0.9999996 | 0.9999996 | \x3f7ffff9 | t
+ \x3f7ffffa | 0.99999964 | 0.99999964 | \x3f7ffffa | t
+ \x3f7ffffb | 0.9999997 | 0.9999997 | \x3f7ffffb | t
+ \x3f7ffffc | 0.99999976 | 0.99999976 | \x3f7ffffc | t
+ \x3f7ffffd | 0.9999998 | 0.9999998 | \x3f7ffffd | t
+ \x3f7ffffe | 0.9999999 | 0.9999999 | \x3f7ffffe | t
+ \x3f7fffff | 0.99999994 | 0.99999994 | \x3f7fffff | t
+ \x3f800000 | 1 | 1 | \x3f800000 | t
+ \x3f800001 | 1.0000001 | 1.0000001 | \x3f800001 | t
+ \x3f800002 | 1.0000002 | 1.0000002 | \x3f800002 | t
+ \x3f800003 | 1.0000004 | 1.0000004 | \x3f800003 | t
+ \x3f800004 | 1.0000005 | 1.0000005 | \x3f800004 | t
+ \x3f800005 | 1.0000006 | 1.0000006 | \x3f800005 | t
+ \x3f800006 | 1.0000007 | 1.0000007 | \x3f800006 | t
+ \x3f800007 | 1.0000008 | 1.0000008 | \x3f800007 | t
+ \x3f800008 | 1.000001 | 1.000001 | \x3f800008 | t
+ \x3f800009 | 1.0000011 | 1.0000011 | \x3f800009 | t
+ \x3f80000f | 1.0000018 | 1.0000018 | \x3f80000f | t
+ \x3f800010 | 1.0000019 | 1.0000019 | \x3f800010 | t
+ \x3f800011 | 1.000002 | 1.000002 | \x3f800011 | t
+ \x3f800012 | 1.0000021 | 1.0000021 | \x3f800012 | t
+ \x3f800013 | 1.0000023 | 1.0000023 | \x3f800013 | t
+ \x3f800014 | 1.0000024 | 1.0000024 | \x3f800014 | t
+ \x3f800017 | 1.0000027 | 1.0000027 | \x3f800017 | t
+ \x3f800018 | 1.0000029 | 1.0000029 | \x3f800018 | t
+ \x3f800019 | 1.000003 | 1.000003 | \x3f800019 | t
+ \x3f80001a | 1.0000031 | 1.0000031 | \x3f80001a | t
+ \x3f80001b | 1.0000032 | 1.0000032 | \x3f80001b | t
+ \x3f80001c | 1.0000033 | 1.0000033 | \x3f80001c | t
+ \x3f800029 | 1.0000049 | 1.0000049 | \x3f800029 | t
+ \x3f80002a | 1.000005 | 1.000005 | \x3f80002a | t
+ \x3f80002b | 1.0000051 | 1.0000051 | \x3f80002b | t
+ \x3f800053 | 1.0000099 | 1.0000099 | \x3f800053 | t
+ \x3f800054 | 1.00001 | 1.00001 | \x3f800054 | t
+ \x3f800055 | 1.0000101 | 1.0000101 | \x3f800055 | t
+ \x3f800346 | 1.0000999 | 1.0000999 | \x3f800346 | t
+ \x3f800347 | 1.0001 | 1.0001 | \x3f800347 | t
+ \x3f800348 | 1.0001001 | 1.0001001 | \x3f800348 | t
+ \x3f8020c4 | 1.0009999 | 1.0009999 | \x3f8020c4 | t
+ \x3f8020c5 | 1.001 | 1.001 | \x3f8020c5 | t
+ \x3f8020c6 | 1.0010002 | 1.0010002 | \x3f8020c6 | t
+ \x3f8147ad | 1.0099999 | 1.0099999 | \x3f8147ad | t
+ \x3f8147ae | 1.01 | 1.01 | \x3f8147ae | t
+ \x3f8147af | 1.0100001 | 1.0100001 | \x3f8147af | t
+ \x3f8ccccc | 1.0999999 | 1.0999999 | \x3f8ccccc | t
+ \x3f8ccccd | 1.1 | 1.1 | \x3f8ccccd | t
+ \x3f8cccce | 1.1000001 | 1.1000001 | \x3f8cccce | t
+ \x3fc90fdb | 1.5707964 | 1.5707964 | \x3fc90fdb | t
+ \x402df854 | 2.7182817 | 2.7182817 | \x402df854 | t
+ \x40490fdb | 3.1415927 | 3.1415927 | \x40490fdb | t
+ \x409fffff | 4.9999995 | 4.9999995 | \x409fffff | t
+ \x40a00000 | 5 | 5 | \x40a00000 | t
+ \x40a00001 | 5.0000005 | 5.0000005 | \x40a00001 | t
+ \x40afffff | 5.4999995 | 5.4999995 | \x40afffff | t
+ \x40b00000 | 5.5 | 5.5 | \x40b00000 | t
+ \x40b00001 | 5.5000005 | 5.5000005 | \x40b00001 | t
+ \x411fffff | 9.999999 | 9.999999 | \x411fffff | t
+ \x41200000 | 10 | 10 | \x41200000 | t
+ \x41200001 | 10.000001 | 10.000001 | \x41200001 | t
+ \x42c7ffff | 99.99999 | 99.99999 | \x42c7ffff | t
+ \x42c80000 | 100 | 100 | \x42c80000 | t
+ \x42c80001 | 100.00001 | 100.00001 | \x42c80001 | t
+ \x4479ffff | 999.99994 | 999.99994 | \x4479ffff | t
+ \x447a0000 | 1000 | 1000 | \x447a0000 | t
+ \x447a0001 | 1000.00006 | 1000.00006 | \x447a0001 | t
+ \x461c3fff | 9999.999 | 9999.999 | \x461c3fff | t
+ \x461c4000 | 10000 | 10000 | \x461c4000 | t
+ \x461c4001 | 10000.001 | 10000.001 | \x461c4001 | t
+ \x47c34fff | 99999.99 | 99999.99 | \x47c34fff | t
+ \x47c35000 | 100000 | 100000 | \x47c35000 | t
+ \x47c35001 | 100000.01 | 100000.01 | \x47c35001 | t
+ \x497423ff | 999999.94 | 999999.94 | \x497423ff | t
+ \x49742400 | 1e+06 | 1e+06 | \x49742400 | t
+ \x49742401 | 1.00000006e+06 | 1.00000006e+06 | \x49742401 | t
+ \x4b18967f | 9.999999e+06 | 9.999999e+06 | \x4b18967f | t
+ \x4b189680 | 1e+07 | 1e+07 | \x4b189680 | t
+ \x4b189681 | 1.0000001e+07 | 1.0000001e+07 | \x4b189681 | t
+ \x4cbebc1f | 9.999999e+07 | 9.999999e+07 | \x4cbebc1f | t
+ \x4cbebc20 | 1e+08 | 1e+08 | \x4cbebc20 | t
+ \x4cbebc21 | 1.0000001e+08 | 1.0000001e+08 | \x4cbebc21 | t
+ \x4e6e6b27 | 9.9999994e+08 | 9.9999994e+08 | \x4e6e6b27 | t
+ \x4e6e6b28 | 1e+09 | 1e+09 | \x4e6e6b28 | t
+ \x4e6e6b29 | 1.00000006e+09 | 1.00000006e+09 | \x4e6e6b29 | t
+ \x501502f8 | 9.999999e+09 | 9.999999e+09 | \x501502f8 | t
+ \x501502f9 | 1e+10 | 1e+10 | \x501502f9 | t
+ \x501502fa | 1.0000001e+10 | 1.0000001e+10 | \x501502fa | t
+ \x51ba43b6 | 9.999999e+10 | 9.999999e+10 | \x51ba43b6 | t
+ \x51ba43b7 | 1e+11 | 1e+11 | \x51ba43b7 | t
+ \x51ba43b8 | 1.0000001e+11 | 1.0000001e+11 | \x51ba43b8 | t
+ \x1f6c1e4a | 5e-20 | 5e-20 | \x1f6c1e4a | t
+ \x59be6cea | 6.7e+15 | 6.7e+15 | \x59be6cea | t
+ \x5d5ab6c4 | 9.85e+17 | 9.85e+17 | \x5d5ab6c4 | t
+ \x2cc4a9bd | 5.5895e-12 | 5.5895e-12 | \x2cc4a9bd | t
+ \x15ae43fd | 7.038531e-26 | 7.038531e-26 | \x15ae43fd | t
+ \x2cf757ca | 7.0299088e-12 | 7.0299088e-12 | \x2cf757ca | t
+ \x665ba998 | 2.5933168e+23 | 2.5933168e+23 | \x665ba998 | t
+ \x743c3324 | 5.9642887e+31 | 5.9642887e+31 | \x743c3324 | t
+ \x47f1205a | 123456.7 | 123456.7 | \x47f1205a | t
+ \x4640e6ae | 12345.67 | 12345.67 | \x4640e6ae | t
+ \x449a5225 | 1234.567 | 1234.567 | \x449a5225 | t
+ \x42f6e9d5 | 123.4567 | 123.4567 | \x42f6e9d5 | t
+ \x414587dd | 12.34567 | 12.34567 | \x414587dd | t
+ \x3f9e064b | 1.234567 | 1.234567 | \x3f9e064b | t
+ \x4c000004 | 3.3554448e+07 | 3.3554448e+07 | \x4c000004 | t
+ \x50061c46 | 8.999999e+09 | 8.999999e+09 | \x50061c46 | t
+ \x510006a8 | 3.4366718e+10 | 3.4366718e+10 | \x510006a8 | t
+ \x48951f84 | 305404.12 | 305404.12 | \x48951f84 | t
+ \x45fd1840 | 8099.0312 | 8099.0312 | \x45fd1840 | t
+ \x39800000 | 0.00024414062 | 0.00024414062 | \x39800000 | t
+ \x3b200000 | 0.0024414062 | 0.0024414062 | \x3b200000 | t
+ \x3b900000 | 0.0043945312 | 0.0043945312 | \x3b900000 | t
+ \x3bd00000 | 0.0063476562 | 0.0063476562 | \x3bd00000 | t
+ \x63800000 | 4.7223665e+21 | 4.7223665e+21 | \x63800000 | t
+ \x4b000000 | 8.388608e+06 | 8.388608e+06 | \x4b000000 | t
+ \x4b800000 | 1.6777216e+07 | 1.6777216e+07 | \x4b800000 | t
+ \x4c000001 | 3.3554436e+07 | 3.3554436e+07 | \x4c000001 | t
+ \x4c800b0d | 6.7131496e+07 | 6.7131496e+07 | \x4c800b0d | t
+ \x00d24584 | 1.9310392e-38 | 1.9310392e-38 | \x00d24584 | t
+ \x00d90b88 | 1.993244e-38 | 1.993244e-38 | \x00d90b88 | t
+ \x45803f34 | 4103.9004 | 4103.9004 | \x45803f34 | t
+ \x4f9f24f7 | 5.3399997e+09 | 5.3399997e+09 | \x4f9f24f7 | t
+ \x3a8722c3 | 0.0010310042 | 0.0010310042 | \x3a8722c3 | t
+ \x5c800041 | 2.882326e+17 | 2.882326e+17 | \x5c800041 | t
+ \x15ae43fd | 7.038531e-26 | 7.038531e-26 | \x15ae43fd | t
+ \x5d4cccfb | 9.223404e+17 | 9.223404e+17 | \x5d4cccfb | t
+ \x4c800001 | 6.710887e+07 | 6.710887e+07 | \x4c800001 | t
+ \x57800ed8 | 2.816025e+14 | 2.816025e+14 | \x57800ed8 | t
+ \x5f000000 | 9.223372e+18 | 9.223372e+18 | \x5f000000 | t
+ \x700000f0 | 1.5846086e+29 | 1.5846086e+29 | \x700000f0 | t
+ \x5f23e9ac | 1.1811161e+19 | 1.1811161e+19 | \x5f23e9ac | t
+ \x5e9502f9 | 5.368709e+18 | 5.368709e+18 | \x5e9502f9 | t
+ \x5e8012b1 | 4.6143166e+18 | 4.6143166e+18 | \x5e8012b1 | t
+ \x3c000028 | 0.007812537 | 0.007812537 | \x3c000028 | t
+ \x60cde861 | 1.18697725e+20 | 1.18697725e+20 | \x60cde861 | t
+ \x03aa2a50 | 1.00014165e-36 | 1.00014165e-36 | \x03aa2a50 | t
+ \x43480000 | 200 | 200 | \x43480000 | t
+ \x4c000000 | 3.3554432e+07 | 3.3554432e+07 | \x4c000000 | t
+ \x5d1502f9 | 6.7108864e+17 | 6.7108864e+17 | \x5d1502f9 | t
+ \x5d9502f9 | 1.3421773e+18 | 1.3421773e+18 | \x5d9502f9 | t
+ \x5e1502f9 | 2.6843546e+18 | 2.6843546e+18 | \x5e1502f9 | t
+ \x3f99999a | 1.2 | 1.2 | \x3f99999a | t
+ \x3f9d70a4 | 1.23 | 1.23 | \x3f9d70a4 | t
+ \x3f9df3b6 | 1.234 | 1.234 | \x3f9df3b6 | t
+ \x3f9e0419 | 1.2345 | 1.2345 | \x3f9e0419 | t
+ \x3f9e0610 | 1.23456 | 1.23456 | \x3f9e0610 | t
+ \x3f9e064b | 1.234567 | 1.234567 | \x3f9e064b | t
+ \x3f9e0651 | 1.2345678 | 1.2345678 | \x3f9e0651 | t
+ \x03d20cfe | 1.23456735e-36 | 1.23456735e-36 | \x03d20cfe | t
+(261 rows)
+
+-- clean up, lest opr_sanity complain
+drop type xfloat4 cascade;
+NOTICE: drop cascades to 6 other objects
+DETAIL: drop cascades to function xfloat4in(cstring)
+drop cascades to function xfloat4out(xfloat4)
+drop cascades to cast from xfloat4 to real
+drop cascades to cast from real to xfloat4
+drop cascades to cast from xfloat4 to integer
+drop cascades to cast from integer to xfloat4
diff --git a/yql/essentials/tests/postgresql/original/cases/float4.sql b/yql/essentials/tests/postgresql/original/cases/float4.sql
new file mode 100644
index 0000000000..612486ecbd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/float4.sql
@@ -0,0 +1,354 @@
+--
+-- FLOAT4
+--
+
+CREATE TABLE FLOAT4_TBL (f1 float4);
+
+INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
+
+-- test for over and under flow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'::float8);
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'::float8);
+
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-400');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-400');
+
+-- bad input
+INSERT INTO FLOAT4_TBL(f1) VALUES ('');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
+INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
+INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
+
+-- special inputs
+SELECT 'NaN'::float4;
+SELECT 'nan'::float4;
+SELECT ' NAN '::float4;
+SELECT 'infinity'::float4;
+SELECT ' -INFINiTY '::float4;
+-- bad special inputs
+SELECT 'N A N'::float4;
+SELECT 'NaN x'::float4;
+SELECT ' INFINITY x'::float4;
+
+SELECT 'Infinity'::float4 + 100.0;
+SELECT 'Infinity'::float4 / 'Infinity'::float4;
+SELECT '42'::float4 / 'Infinity'::float4;
+SELECT 'nan'::float4 / 'nan'::float4;
+SELECT 'nan'::float4 / '0'::float4;
+SELECT 'nan'::numeric::float4;
+
+SELECT * FROM FLOAT4_TBL;
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3';
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3';
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1;
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3';
+
+SELECT f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1;
+
+SELECT f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3';
+
+SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+ WHERE f.f1 > '0.0';
+
+-- test divide by zero
+SELECT f.f1 / '0.0' from FLOAT4_TBL f;
+
+SELECT * FROM FLOAT4_TBL;
+
+-- test the unary float4abs operator
+SELECT f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f;
+
+UPDATE FLOAT4_TBL
+ SET f1 = FLOAT4_TBL.f1 * '-1'
+ WHERE FLOAT4_TBL.f1 > '0.0';
+
+SELECT * FROM FLOAT4_TBL;
+
+-- test edge-case coercions to integer
+SELECT '32767.4'::float4::int2;
+SELECT '32767.6'::float4::int2;
+SELECT '-32768.4'::float4::int2;
+SELECT '-32768.6'::float4::int2;
+SELECT '2147483520'::float4::int4;
+SELECT '2147483647'::float4::int4;
+SELECT '-2147483648.5'::float4::int4;
+SELECT '-2147483900'::float4::int4;
+SELECT '9223369837831520256'::float4::int8;
+SELECT '9223372036854775807'::float4::int8;
+SELECT '-9223372036854775808.5'::float4::int8;
+SELECT '-9223380000000000000'::float4::int8;
+
+-- Test for correct input rounding in edge cases.
+-- These lists are from Paxson 1991, excluding subnormals and
+-- inputs of over 9 sig. digits.
+
+SELECT float4send('5e-20'::float4);
+SELECT float4send('67e14'::float4);
+SELECT float4send('985e15'::float4);
+SELECT float4send('55895e-16'::float4);
+SELECT float4send('7038531e-32'::float4);
+SELECT float4send('702990899e-20'::float4);
+
+SELECT float4send('3e-23'::float4);
+SELECT float4send('57e18'::float4);
+SELECT float4send('789e-35'::float4);
+SELECT float4send('2539e-18'::float4);
+SELECT float4send('76173e28'::float4);
+SELECT float4send('887745e-11'::float4);
+SELECT float4send('5382571e-37'::float4);
+SELECT float4send('82381273e-35'::float4);
+SELECT float4send('750486563e-38'::float4);
+
+-- Test that the smallest possible normalized input value inputs
+-- correctly, either in 9-significant-digit or shortest-decimal
+-- format.
+--
+-- exact val is 1.1754943508...
+-- shortest val is 1.1754944000
+-- midpoint to next val is 1.1754944208...
+
+SELECT float4send('1.17549435e-38'::float4);
+SELECT float4send('1.1754944e-38'::float4);
+
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+
+create type xfloat4;
+create function xfloat4in(cstring) returns xfloat4 immutable strict
+ language internal as 'int4in';
+create function xfloat4out(xfloat4) returns cstring immutable strict
+ language internal as 'int4out';
+create type xfloat4 (input = xfloat4in, output = xfloat4out, like = float4);
+create cast (xfloat4 as float4) without function;
+create cast (float4 as xfloat4) without function;
+create cast (xfloat4 as integer) without function;
+create cast (integer as xfloat4) without function;
+
+-- float4: seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+
+with testdata(bits) as (values
+ -- small subnormals
+ (x'00000001'),
+ (x'00000002'), (x'00000003'),
+ (x'00000010'), (x'00000011'), (x'00000100'), (x'00000101'),
+ (x'00004000'), (x'00004001'), (x'00080000'), (x'00080001'),
+ -- stress values
+ (x'0053c4f4'), -- 7693e-42
+ (x'006c85c4'), -- 996622e-44
+ (x'0041ca76'), -- 60419369e-46
+ (x'004b7678'), -- 6930161142e-48
+ -- taken from upstream testsuite
+ (x'00000007'),
+ (x'00424fe2'),
+ -- borderline between subnormal and normal
+ (x'007ffff0'), (x'007ffff1'), (x'007ffffe'), (x'007fffff'))
+select float4send(flt) as ibits,
+ flt
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+
+with testdata(bits) as (values
+ (x'00000000'),
+ -- smallest normal values
+ (x'00800000'), (x'00800001'), (x'00800004'), (x'00800005'),
+ (x'00800006'),
+ -- small normal values chosen for short vs. long output
+ (x'008002f1'), (x'008002f2'), (x'008002f3'),
+ (x'00800e17'), (x'00800e18'), (x'00800e19'),
+ -- assorted values (random mantissae)
+ (x'01000001'), (x'01102843'), (x'01a52c98'),
+ (x'0219c229'), (x'02e4464d'), (x'037343c1'), (x'03a91b36'),
+ (x'047ada65'), (x'0496fe87'), (x'0550844f'), (x'05999da3'),
+ (x'060ea5e2'), (x'06e63c45'), (x'07f1e548'), (x'0fc5282b'),
+ (x'1f850283'), (x'2874a9d6'),
+ -- values around 5e-08
+ (x'3356bf94'), (x'3356bf95'), (x'3356bf96'),
+ -- around 1e-07
+ (x'33d6bf94'), (x'33d6bf95'), (x'33d6bf96'),
+ -- around 3e-07 .. 1e-04
+ (x'34a10faf'), (x'34a10fb0'), (x'34a10fb1'),
+ (x'350637bc'), (x'350637bd'), (x'350637be'),
+ (x'35719786'), (x'35719787'), (x'35719788'),
+ (x'358637bc'), (x'358637bd'), (x'358637be'),
+ (x'36a7c5ab'), (x'36a7c5ac'), (x'36a7c5ad'),
+ (x'3727c5ab'), (x'3727c5ac'), (x'3727c5ad'),
+ -- format crossover at 1e-04
+ (x'38d1b714'), (x'38d1b715'), (x'38d1b716'),
+ (x'38d1b717'), (x'38d1b718'), (x'38d1b719'),
+ (x'38d1b71a'), (x'38d1b71b'), (x'38d1b71c'),
+ (x'38d1b71d'),
+ --
+ (x'38dffffe'), (x'38dfffff'), (x'38e00000'),
+ (x'38efffff'), (x'38f00000'), (x'38f00001'),
+ (x'3a83126e'), (x'3a83126f'), (x'3a831270'),
+ (x'3c23d709'), (x'3c23d70a'), (x'3c23d70b'),
+ (x'3dcccccc'), (x'3dcccccd'), (x'3dccccce'),
+ -- chosen to need 9 digits for 3dcccd70
+ (x'3dcccd6f'), (x'3dcccd70'), (x'3dcccd71'),
+ --
+ (x'3effffff'), (x'3f000000'), (x'3f000001'),
+ (x'3f333332'), (x'3f333333'), (x'3f333334'),
+ -- approach 1.0 with increasing numbers of 9s
+ (x'3f666665'), (x'3f666666'), (x'3f666667'),
+ (x'3f7d70a3'), (x'3f7d70a4'), (x'3f7d70a5'),
+ (x'3f7fbe76'), (x'3f7fbe77'), (x'3f7fbe78'),
+ (x'3f7ff971'), (x'3f7ff972'), (x'3f7ff973'),
+ (x'3f7fff57'), (x'3f7fff58'), (x'3f7fff59'),
+ (x'3f7fffee'), (x'3f7fffef'),
+ -- values very close to 1
+ (x'3f7ffff0'), (x'3f7ffff1'), (x'3f7ffff2'),
+ (x'3f7ffff3'), (x'3f7ffff4'), (x'3f7ffff5'),
+ (x'3f7ffff6'), (x'3f7ffff7'), (x'3f7ffff8'),
+ (x'3f7ffff9'), (x'3f7ffffa'), (x'3f7ffffb'),
+ (x'3f7ffffc'), (x'3f7ffffd'), (x'3f7ffffe'),
+ (x'3f7fffff'),
+ (x'3f800000'),
+ (x'3f800001'), (x'3f800002'), (x'3f800003'),
+ (x'3f800004'), (x'3f800005'), (x'3f800006'),
+ (x'3f800007'), (x'3f800008'), (x'3f800009'),
+ -- values 1 to 1.1
+ (x'3f80000f'), (x'3f800010'), (x'3f800011'),
+ (x'3f800012'), (x'3f800013'), (x'3f800014'),
+ (x'3f800017'), (x'3f800018'), (x'3f800019'),
+ (x'3f80001a'), (x'3f80001b'), (x'3f80001c'),
+ (x'3f800029'), (x'3f80002a'), (x'3f80002b'),
+ (x'3f800053'), (x'3f800054'), (x'3f800055'),
+ (x'3f800346'), (x'3f800347'), (x'3f800348'),
+ (x'3f8020c4'), (x'3f8020c5'), (x'3f8020c6'),
+ (x'3f8147ad'), (x'3f8147ae'), (x'3f8147af'),
+ (x'3f8ccccc'), (x'3f8ccccd'), (x'3f8cccce'),
+ --
+ (x'3fc90fdb'), -- pi/2
+ (x'402df854'), -- e
+ (x'40490fdb'), -- pi
+ --
+ (x'409fffff'), (x'40a00000'), (x'40a00001'),
+ (x'40afffff'), (x'40b00000'), (x'40b00001'),
+ (x'411fffff'), (x'41200000'), (x'41200001'),
+ (x'42c7ffff'), (x'42c80000'), (x'42c80001'),
+ (x'4479ffff'), (x'447a0000'), (x'447a0001'),
+ (x'461c3fff'), (x'461c4000'), (x'461c4001'),
+ (x'47c34fff'), (x'47c35000'), (x'47c35001'),
+ (x'497423ff'), (x'49742400'), (x'49742401'),
+ (x'4b18967f'), (x'4b189680'), (x'4b189681'),
+ (x'4cbebc1f'), (x'4cbebc20'), (x'4cbebc21'),
+ (x'4e6e6b27'), (x'4e6e6b28'), (x'4e6e6b29'),
+ (x'501502f8'), (x'501502f9'), (x'501502fa'),
+ (x'51ba43b6'), (x'51ba43b7'), (x'51ba43b8'),
+ -- stress values
+ (x'1f6c1e4a'), -- 5e-20
+ (x'59be6cea'), -- 67e14
+ (x'5d5ab6c4'), -- 985e15
+ (x'2cc4a9bd'), -- 55895e-16
+ (x'15ae43fd'), -- 7038531e-32
+ (x'2cf757ca'), -- 702990899e-20
+ (x'665ba998'), -- 25933168707e13
+ (x'743c3324'), -- 596428896559e20
+ -- exercise fixed-point memmoves
+ (x'47f1205a'),
+ (x'4640e6ae'),
+ (x'449a5225'),
+ (x'42f6e9d5'),
+ (x'414587dd'),
+ (x'3f9e064b'),
+ -- these cases come from the upstream's testsuite
+ -- BoundaryRoundEven
+ (x'4c000004'),
+ (x'50061c46'),
+ (x'510006a8'),
+ -- ExactValueRoundEven
+ (x'48951f84'),
+ (x'45fd1840'),
+ -- LotsOfTrailingZeros
+ (x'39800000'),
+ (x'3b200000'),
+ (x'3b900000'),
+ (x'3bd00000'),
+ -- Regression
+ (x'63800000'),
+ (x'4b000000'),
+ (x'4b800000'),
+ (x'4c000001'),
+ (x'4c800b0d'),
+ (x'00d24584'),
+ (x'00d90b88'),
+ (x'45803f34'),
+ (x'4f9f24f7'),
+ (x'3a8722c3'),
+ (x'5c800041'),
+ (x'15ae43fd'),
+ (x'5d4cccfb'),
+ (x'4c800001'),
+ (x'57800ed8'),
+ (x'5f000000'),
+ (x'700000f0'),
+ (x'5f23e9ac'),
+ (x'5e9502f9'),
+ (x'5e8012b1'),
+ (x'3c000028'),
+ (x'60cde861'),
+ (x'03aa2a50'),
+ (x'43480000'),
+ (x'4c000000'),
+ -- LooksLikePow5
+ (x'5D1502F9'),
+ (x'5D9502F9'),
+ (x'5E1502F9'),
+ -- OutputLength
+ (x'3f99999a'),
+ (x'3f9d70a4'),
+ (x'3f9df3b6'),
+ (x'3f9e0419'),
+ (x'3f9e0610'),
+ (x'3f9e064b'),
+ (x'3f9e0651'),
+ (x'03d20cfe')
+)
+select float4send(flt) as ibits,
+ flt,
+ flt::text::float4 as r_flt,
+ float4send(flt::text::float4) as obits,
+ float4send(flt::text::float4) = float4send(flt) as correct
+ from (select bits::integer::xfloat4::float4 as flt
+ from testdata
+ offset 0) s;
+
+-- clean up, lest opr_sanity complain
+drop type xfloat4 cascade;
diff --git a/yql/essentials/tests/postgresql/original/cases/float8.out b/yql/essentials/tests/postgresql/original/cases/float8.out
new file mode 100644
index 0000000000..fc4212b32d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/float8.out
@@ -0,0 +1,1382 @@
+--
+-- FLOAT8
+--
+CREATE TABLE FLOAT8_TBL(f1 float8);
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+-- test for underflow and overflow handling
+SELECT '10e400'::float8;
+ERROR: "10e400" is out of range for type double precision
+LINE 1: SELECT '10e400'::float8;
+ ^
+SELECT '-10e400'::float8;
+ERROR: "-10e400" is out of range for type double precision
+LINE 1: SELECT '-10e400'::float8;
+ ^
+SELECT '10e-400'::float8;
+ERROR: "10e-400" is out of range for type double precision
+LINE 1: SELECT '10e-400'::float8;
+ ^
+SELECT '-10e-400'::float8;
+ERROR: "-10e-400" is out of range for type double precision
+LINE 1: SELECT '-10e-400'::float8;
+ ^
+-- test smallest normalized input
+SELECT float8send('2.2250738585072014E-308'::float8);
+ float8send
+--------------------
+ \x0010000000000000
+(1 row)
+
+-- bad input
+INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type double precision: ""
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type double precision: " "
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ERROR: invalid input syntax for type double precision: "xyz"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ERROR: invalid input syntax for type double precision: "5.0.0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type double precision: "5 . 0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ERROR: invalid input syntax for type double precision: "5. 0"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ERROR: invalid input syntax for type double precision: " - 3"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type double precision: "123 5"
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+ ^
+-- special inputs
+SELECT 'NaN'::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'nan'::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT ' NAN '::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'infinity'::float8;
+ float8
+----------
+ Infinity
+(1 row)
+
+SELECT ' -INFINiTY '::float8;
+ float8
+-----------
+ -Infinity
+(1 row)
+
+-- bad special inputs
+SELECT 'N A N'::float8;
+ERROR: invalid input syntax for type double precision: "N A N"
+LINE 1: SELECT 'N A N'::float8;
+ ^
+SELECT 'NaN x'::float8;
+ERROR: invalid input syntax for type double precision: "NaN x"
+LINE 1: SELECT 'NaN x'::float8;
+ ^
+SELECT ' INFINITY x'::float8;
+ERROR: invalid input syntax for type double precision: " INFINITY x"
+LINE 1: SELECT ' INFINITY x'::float8;
+ ^
+SELECT 'Infinity'::float8 + 100.0;
+ ?column?
+----------
+ Infinity
+(1 row)
+
+SELECT 'Infinity'::float8 / 'Infinity'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '42'::float8 / 'Infinity'::float8;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT 'nan'::float8 / 'nan'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::float8 / '0'::float8;
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT 'nan'::numeric::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT * FROM FLOAT8_TBL;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(5 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+ f1
+--------
+ 1004.3
+(1 row)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e-200
+(3 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+ f1
+----------------------
+ 0
+ -34.84
+ 1.2345678901234e-200
+(3 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e-200
+(4 rows)
+
+SELECT f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+-----------------------
+ 1004.3 | -10043
+ 1.2345678901234e+200 | -1.2345678901234e+201
+ 1.2345678901234e-200 | -1.2345678901234e-199
+(3 rows)
+
+SELECT f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+----------------------
+ 1004.3 | 994.3
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | -10
+(3 rows)
+
+SELECT f.f1, f.f1 / '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+-----------------------
+ 1004.3 | -100.42999999999999
+ 1.2345678901234e+200 | -1.2345678901234e+199
+ 1.2345678901234e-200 | -1.2345678901234e-201
+(3 rows)
+
+SELECT f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | x
+----------------------+----------------------
+ 1004.3 | 1014.3
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 10
+(3 rows)
+
+SELECT f.f1 ^ '2.0' AS square_f1
+ FROM FLOAT8_TBL f where f.f1 = '1004.3';
+ square_f1
+--------------------
+ 1008618.4899999999
+(1 row)
+
+-- absolute value
+SELECT f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+ f1 | abs_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004.3
+ -34.84 | 34.84
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 1.2345678901234e-200
+(5 rows)
+
+-- truncate
+SELECT f.f1, trunc(f.f1) AS trunc_f1
+ FROM FLOAT8_TBL f;
+ f1 | trunc_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004
+ -34.84 | -34
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 0
+(5 rows)
+
+-- round
+SELECT f.f1, round(f.f1) AS round_f1
+ FROM FLOAT8_TBL f;
+ f1 | round_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 1004
+ -34.84 | -35
+ 1.2345678901234e+200 | 1.2345678901234e+200
+ 1.2345678901234e-200 | 0
+(5 rows)
+
+-- ceil / ceiling
+select ceil(f1) as ceil_f1 from float8_tbl f;
+ ceil_f1
+----------------------
+ 0
+ 1005
+ -34
+ 1.2345678901234e+200
+ 1
+(5 rows)
+
+select ceiling(f1) as ceiling_f1 from float8_tbl f;
+ ceiling_f1
+----------------------
+ 0
+ 1005
+ -34
+ 1.2345678901234e+200
+ 1
+(5 rows)
+
+-- floor
+select floor(f1) as floor_f1 from float8_tbl f;
+ floor_f1
+----------------------
+ 0
+ 1004
+ -35
+ 1.2345678901234e+200
+ 0
+(5 rows)
+
+-- sign
+select sign(f1) as sign_f1 from float8_tbl f;
+ sign_f1
+---------
+ 0
+ 1
+ -1
+ 1
+ 1
+(5 rows)
+
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+-- square root
+SELECT sqrt(float8 '64') AS eight;
+ eight
+-------
+ 8
+(1 row)
+
+SELECT |/ float8 '64' AS eight;
+ eight
+-------
+ 8
+(1 row)
+
+SELECT f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | sqrt_f1
+----------------------+-----------------------
+ 1004.3 | 31.6906926399535
+ 1.2345678901234e+200 | 1.11111110611109e+100
+ 1.2345678901234e-200 | 1.11111110611109e-100
+(3 rows)
+
+-- power
+SELECT power(float8 '144', float8 '0.5');
+ power
+-------
+ 12
+(1 row)
+
+SELECT power(float8 'NaN', float8 '0.5');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '144', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 'NaN', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '-1', float8 'NaN');
+ power
+-------
+ NaN
+(1 row)
+
+SELECT power(float8 '1', float8 'NaN');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 'NaN', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 'inf', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-inf', float8 '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '0', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '0', float8 '-inf');
+ERROR: zero raised to a negative power is undefined
+SELECT power(float8 '1', float8 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '1', float8 '-inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-1', float8 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '-1', float8 '-inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power(float8 '0.1', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '-0.1', float8 'inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '1.1', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-1.1', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '0.1', float8 '-inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-0.1', float8 '-inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '1.1', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 '-1.1', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 'inf', float8 '-2');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power(float8 'inf', float8 '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 'inf', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 'inf', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+-- Intel's icc misoptimizes the code that controls the sign of this result,
+-- even with -mp1. Pending a fix for that, only test for "is it zero".
+SELECT power(float8 '-inf', float8 '-2') = '0';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT power(float8 '-inf', float8 '-3');
+ power
+-------
+ -0
+(1 row)
+
+SELECT power(float8 '-inf', float8 '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '3');
+ power
+-----------
+ -Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '3.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power(float8 '-inf', float8 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power(float8 '-inf', float8 '-inf');
+ power
+-------
+ 0
+(1 row)
+
+-- take exp of ln(f.f1)
+SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+ f1 | exp_ln_f1
+----------------------+-----------------------
+ 1004.3 | 1004.3
+ 1.2345678901234e+200 | 1.23456789012338e+200
+ 1.2345678901234e-200 | 1.23456789012339e-200
+(3 rows)
+
+-- check edge cases for exp
+SELECT exp('inf'::float8), exp('-inf'::float8), exp('nan'::float8);
+ exp | exp | exp
+----------+-----+-----
+ Infinity | 0 | NaN
+(1 row)
+
+-- cube root
+SELECT ||/ float8 '27' AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+ f1 | cbrt_f1
+----------------------+----------------------
+ 0 | 0
+ 1004.3 | 10.014312837827
+ -34.84 | -3.26607421344208
+ 1.2345678901234e+200 | 4.97933859234765e+66
+ 1.2345678901234e-200 | 2.3112042409018e-67
+(5 rows)
+
+SELECT * FROM FLOAT8_TBL;
+ f1
+----------------------
+ 0
+ 1004.3
+ -34.84
+ 1.2345678901234e+200
+ 1.2345678901234e-200
+(5 rows)
+
+UPDATE FLOAT8_TBL
+ SET f1 = FLOAT8_TBL.f1 * '-1'
+ WHERE FLOAT8_TBL.f1 > '0.0';
+SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+ERROR: value out of range: overflow
+SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+ERROR: value out of range: overflow
+SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+ERROR: cannot take logarithm of zero
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+ERROR: cannot take logarithm of a negative number
+SELECT exp(f.f1) from FLOAT8_TBL f;
+ERROR: value out of range: underflow
+SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+ERROR: division by zero
+SELECT * FROM FLOAT8_TBL;
+ f1
+-----------------------
+ 0
+ -34.84
+ -1004.3
+ -1.2345678901234e+200
+ -1.2345678901234e-200
+(5 rows)
+
+-- hyperbolic functions
+-- we run these with extra_float_digits = 0 too, since different platforms
+-- tend to produce results that vary in the last place.
+SELECT sinh(float8 '1');
+ sinh
+-----------------
+ 1.1752011936438
+(1 row)
+
+SELECT cosh(float8 '1');
+ cosh
+------------------
+ 1.54308063481524
+(1 row)
+
+SELECT tanh(float8 '1');
+ tanh
+-------------------
+ 0.761594155955765
+(1 row)
+
+SELECT asinh(float8 '1');
+ asinh
+-------------------
+ 0.881373587019543
+(1 row)
+
+SELECT acosh(float8 '2');
+ acosh
+------------------
+ 1.31695789692482
+(1 row)
+
+SELECT atanh(float8 '0.5');
+ atanh
+-------------------
+ 0.549306144334055
+(1 row)
+
+-- test Inf/NaN cases for hyperbolic functions
+SELECT sinh(float8 'infinity');
+ sinh
+----------
+ Infinity
+(1 row)
+
+SELECT sinh(float8 '-infinity');
+ sinh
+-----------
+ -Infinity
+(1 row)
+
+SELECT sinh(float8 'nan');
+ sinh
+------
+ NaN
+(1 row)
+
+SELECT cosh(float8 'infinity');
+ cosh
+----------
+ Infinity
+(1 row)
+
+SELECT cosh(float8 '-infinity');
+ cosh
+----------
+ Infinity
+(1 row)
+
+SELECT cosh(float8 'nan');
+ cosh
+------
+ NaN
+(1 row)
+
+SELECT tanh(float8 'infinity');
+ tanh
+------
+ 1
+(1 row)
+
+SELECT tanh(float8 '-infinity');
+ tanh
+------
+ -1
+(1 row)
+
+SELECT tanh(float8 'nan');
+ tanh
+------
+ NaN
+(1 row)
+
+SELECT asinh(float8 'infinity');
+ asinh
+----------
+ Infinity
+(1 row)
+
+SELECT asinh(float8 '-infinity');
+ asinh
+-----------
+ -Infinity
+(1 row)
+
+SELECT asinh(float8 'nan');
+ asinh
+-------
+ NaN
+(1 row)
+
+-- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+-- SELECT acosh(float8 'infinity');
+SELECT acosh(float8 '-infinity');
+ERROR: input is out of range
+SELECT acosh(float8 'nan');
+ acosh
+-------
+ NaN
+(1 row)
+
+SELECT atanh(float8 'infinity');
+ERROR: input is out of range
+SELECT atanh(float8 '-infinity');
+ERROR: input is out of range
+SELECT atanh(float8 'nan');
+ atanh
+-------
+ NaN
+(1 row)
+
+RESET extra_float_digits;
+-- test for over- and underflow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+ERROR: "10e400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ERROR: "-10e400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ERROR: "10e-400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ ^
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ERROR: "-10e-400" is out of range for type double precision
+LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ ^
+-- maintain external table consistency across platforms
+-- delete all values and reinsert well-behaved ones
+DELETE FROM FLOAT8_TBL;
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+SELECT * FROM FLOAT8_TBL;
+ f1
+-----------------------
+ 0
+ -34.84
+ -1004.3
+ -1.2345678901234e+200
+ -1.2345678901234e-200
+(5 rows)
+
+-- test edge-case coercions to integer
+SELECT '32767.4'::float8::int2;
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT '32767.6'::float8::int2;
+ERROR: smallint out of range
+SELECT '-32768.4'::float8::int2;
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT '-32768.6'::float8::int2;
+ERROR: smallint out of range
+SELECT '2147483647.4'::float8::int4;
+ int4
+------------
+ 2147483647
+(1 row)
+
+SELECT '2147483647.6'::float8::int4;
+ERROR: integer out of range
+SELECT '-2147483648.4'::float8::int4;
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT '-2147483648.6'::float8::int4;
+ERROR: integer out of range
+SELECT '9223372036854773760'::float8::int8;
+ int8
+---------------------
+ 9223372036854773760
+(1 row)
+
+SELECT '9223372036854775807'::float8::int8;
+ERROR: bigint out of range
+SELECT '-9223372036854775808.5'::float8::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT '-9223372036854780000'::float8::int8;
+ERROR: bigint out of range
+-- test exact cases for trigonometric functions in degrees
+SELECT x,
+ sind(x),
+ sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
+FROM (VALUES (0), (30), (90), (150), (180),
+ (210), (270), (330), (360)) AS t(x);
+ x | sind | sind_exact
+-----+------+------------
+ 0 | 0 | t
+ 30 | 0.5 | t
+ 90 | 1 | t
+ 150 | 0.5 | t
+ 180 | 0 | t
+ 210 | -0.5 | t
+ 270 | -1 | t
+ 330 | -0.5 | t
+ 360 | 0 | t
+(9 rows)
+
+SELECT x,
+ cosd(x),
+ cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
+FROM (VALUES (0), (60), (90), (120), (180),
+ (240), (270), (300), (360)) AS t(x);
+ x | cosd | cosd_exact
+-----+------+------------
+ 0 | 1 | t
+ 60 | 0.5 | t
+ 90 | 0 | t
+ 120 | -0.5 | t
+ 180 | -1 | t
+ 240 | -0.5 | t
+ 270 | 0 | t
+ 300 | 0.5 | t
+ 360 | 1 | t
+(9 rows)
+
+SELECT x,
+ tand(x),
+ tand(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS tand_exact,
+ cotd(x),
+ cotd(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS cotd_exact
+FROM (VALUES (0), (45), (90), (135), (180),
+ (225), (270), (315), (360)) AS t(x);
+ x | tand | tand_exact | cotd | cotd_exact
+-----+-----------+------------+-----------+------------
+ 0 | 0 | t | Infinity | t
+ 45 | 1 | t | 1 | t
+ 90 | Infinity | t | 0 | t
+ 135 | -1 | t | -1 | t
+ 180 | 0 | t | -Infinity | t
+ 225 | 1 | t | 1 | t
+ 270 | -Infinity | t | 0 | t
+ 315 | -1 | t | -1 | t
+ 360 | 0 | t | Infinity | t
+(9 rows)
+
+SELECT x,
+ asind(x),
+ asind(x) IN (-90,-30,0,30,90) AS asind_exact,
+ acosd(x),
+ acosd(x) IN (0,60,90,120,180) AS acosd_exact
+FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
+ x | asind | asind_exact | acosd | acosd_exact
+------+-------+-------------+-------+-------------
+ -1 | -90 | t | 180 | t
+ -0.5 | -30 | t | 120 | t
+ 0 | 0 | t | 90 | t
+ 0.5 | 30 | t | 60 | t
+ 1 | 90 | t | 0 | t
+(5 rows)
+
+SELECT x,
+ atand(x),
+ atand(x) IN (-90,-45,0,45,90) AS atand_exact
+FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
+ ('Infinity'::float8)) AS t(x);
+ x | atand | atand_exact
+-----------+-------+-------------
+ -Infinity | -90 | t
+ -1 | -45 | t
+ 0 | 0 | t
+ 1 | 45 | t
+ Infinity | 90 | t
+(5 rows)
+
+SELECT x, y,
+ atan2d(y, x),
+ atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
+FROM (SELECT 10*cosd(a), 10*sind(a)
+ FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
+ x | y | atan2d | atan2d_exact
+-----+-----+--------+--------------
+ 10 | 0 | 0 | t
+ 0 | 10 | 90 | t
+ -10 | 0 | 180 | t
+ 0 | -10 | -90 | t
+ 10 | 0 | 0 | t
+(5 rows)
+
+--
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+create type xfloat8;
+create function xfloat8in(cstring) returns xfloat8 immutable strict
+ language internal as 'int8in';
+NOTICE: return type xfloat8 is only a shell
+create function xfloat8out(xfloat8) returns cstring immutable strict
+ language internal as 'int8out';
+NOTICE: argument type xfloat8 is only a shell
+create type xfloat8 (input = xfloat8in, output = xfloat8out, like = float8);
+create cast (xfloat8 as float8) without function;
+create cast (float8 as xfloat8) without function;
+create cast (xfloat8 as bigint) without function;
+create cast (bigint as xfloat8) without function;
+-- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+with testdata(bits) as (values
+ -- small subnormals
+ (x'0000000000000001'),
+ (x'0000000000000002'), (x'0000000000000003'),
+ (x'0000000000001000'), (x'0000000100000000'),
+ (x'0000010000000000'), (x'0000010100000000'),
+ (x'0000400000000000'), (x'0000400100000000'),
+ (x'0000800000000000'), (x'0000800000000001'),
+ -- these values taken from upstream testsuite
+ (x'00000000000f4240'),
+ (x'00000000016e3600'),
+ (x'0000008cdcdea440'),
+ -- borderline between subnormal and normal
+ (x'000ffffffffffff0'), (x'000ffffffffffff1'),
+ (x'000ffffffffffffe'), (x'000fffffffffffff'))
+select float8send(flt) as ibits,
+ flt
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+ ibits | flt
+--------------------+-------------------------
+ \x0000000000000001 | 5e-324
+ \x0000000000000002 | 1e-323
+ \x0000000000000003 | 1.5e-323
+ \x0000000000001000 | 2.0237e-320
+ \x0000000100000000 | 2.121995791e-314
+ \x0000010000000000 | 5.43230922487e-312
+ \x0000010100000000 | 5.45352918278e-312
+ \x0000400000000000 | 3.4766779039175e-310
+ \x0000400100000000 | 3.4768901034966e-310
+ \x0000800000000000 | 6.953355807835e-310
+ \x0000800000000001 | 6.95335580783505e-310
+ \x00000000000f4240 | 4.940656e-318
+ \x00000000016e3600 | 1.18575755e-316
+ \x0000008cdcdea440 | 2.989102097996e-312
+ \x000ffffffffffff0 | 2.2250738585071935e-308
+ \x000ffffffffffff1 | 2.225073858507194e-308
+ \x000ffffffffffffe | 2.2250738585072004e-308
+ \x000fffffffffffff | 2.225073858507201e-308
+(18 rows)
+
+-- round-trip tests
+with testdata(bits) as (values
+ (x'0000000000000000'),
+ -- smallest normal values
+ (x'0010000000000000'), (x'0010000000000001'),
+ (x'0010000000000002'), (x'0018000000000000'),
+ --
+ (x'3ddb7cdfd9d7bdba'), (x'3ddb7cdfd9d7bdbb'), (x'3ddb7cdfd9d7bdbc'),
+ (x'3e112e0be826d694'), (x'3e112e0be826d695'), (x'3e112e0be826d696'),
+ (x'3e45798ee2308c39'), (x'3e45798ee2308c3a'), (x'3e45798ee2308c3b'),
+ (x'3e7ad7f29abcaf47'), (x'3e7ad7f29abcaf48'), (x'3e7ad7f29abcaf49'),
+ (x'3eb0c6f7a0b5ed8c'), (x'3eb0c6f7a0b5ed8d'), (x'3eb0c6f7a0b5ed8e'),
+ (x'3ee4f8b588e368ef'), (x'3ee4f8b588e368f0'), (x'3ee4f8b588e368f1'),
+ (x'3f1a36e2eb1c432c'), (x'3f1a36e2eb1c432d'), (x'3f1a36e2eb1c432e'),
+ (x'3f50624dd2f1a9fb'), (x'3f50624dd2f1a9fc'), (x'3f50624dd2f1a9fd'),
+ (x'3f847ae147ae147a'), (x'3f847ae147ae147b'), (x'3f847ae147ae147c'),
+ (x'3fb9999999999999'), (x'3fb999999999999a'), (x'3fb999999999999b'),
+ -- values very close to 1
+ (x'3feffffffffffff0'), (x'3feffffffffffff1'), (x'3feffffffffffff2'),
+ (x'3feffffffffffff3'), (x'3feffffffffffff4'), (x'3feffffffffffff5'),
+ (x'3feffffffffffff6'), (x'3feffffffffffff7'), (x'3feffffffffffff8'),
+ (x'3feffffffffffff9'), (x'3feffffffffffffa'), (x'3feffffffffffffb'),
+ (x'3feffffffffffffc'), (x'3feffffffffffffd'), (x'3feffffffffffffe'),
+ (x'3fefffffffffffff'),
+ (x'3ff0000000000000'),
+ (x'3ff0000000000001'), (x'3ff0000000000002'), (x'3ff0000000000003'),
+ (x'3ff0000000000004'), (x'3ff0000000000005'), (x'3ff0000000000006'),
+ (x'3ff0000000000007'), (x'3ff0000000000008'), (x'3ff0000000000009'),
+ --
+ (x'3ff921fb54442d18'),
+ (x'4005bf0a8b14576a'),
+ (x'400921fb54442d18'),
+ --
+ (x'4023ffffffffffff'), (x'4024000000000000'), (x'4024000000000001'),
+ (x'4058ffffffffffff'), (x'4059000000000000'), (x'4059000000000001'),
+ (x'408f3fffffffffff'), (x'408f400000000000'), (x'408f400000000001'),
+ (x'40c387ffffffffff'), (x'40c3880000000000'), (x'40c3880000000001'),
+ (x'40f869ffffffffff'), (x'40f86a0000000000'), (x'40f86a0000000001'),
+ (x'412e847fffffffff'), (x'412e848000000000'), (x'412e848000000001'),
+ (x'416312cfffffffff'), (x'416312d000000000'), (x'416312d000000001'),
+ (x'4197d783ffffffff'), (x'4197d78400000000'), (x'4197d78400000001'),
+ (x'41cdcd64ffffffff'), (x'41cdcd6500000000'), (x'41cdcd6500000001'),
+ (x'4202a05f1fffffff'), (x'4202a05f20000000'), (x'4202a05f20000001'),
+ (x'42374876e7ffffff'), (x'42374876e8000000'), (x'42374876e8000001'),
+ (x'426d1a94a1ffffff'), (x'426d1a94a2000000'), (x'426d1a94a2000001'),
+ (x'42a2309ce53fffff'), (x'42a2309ce5400000'), (x'42a2309ce5400001'),
+ (x'42d6bcc41e8fffff'), (x'42d6bcc41e900000'), (x'42d6bcc41e900001'),
+ (x'430c6bf52633ffff'), (x'430c6bf526340000'), (x'430c6bf526340001'),
+ (x'4341c37937e07fff'), (x'4341c37937e08000'), (x'4341c37937e08001'),
+ (x'4376345785d89fff'), (x'4376345785d8a000'), (x'4376345785d8a001'),
+ (x'43abc16d674ec7ff'), (x'43abc16d674ec800'), (x'43abc16d674ec801'),
+ (x'43e158e460913cff'), (x'43e158e460913d00'), (x'43e158e460913d01'),
+ (x'4415af1d78b58c3f'), (x'4415af1d78b58c40'), (x'4415af1d78b58c41'),
+ (x'444b1ae4d6e2ef4f'), (x'444b1ae4d6e2ef50'), (x'444b1ae4d6e2ef51'),
+ (x'4480f0cf064dd591'), (x'4480f0cf064dd592'), (x'4480f0cf064dd593'),
+ (x'44b52d02c7e14af5'), (x'44b52d02c7e14af6'), (x'44b52d02c7e14af7'),
+ (x'44ea784379d99db3'), (x'44ea784379d99db4'), (x'44ea784379d99db5'),
+ (x'45208b2a2c280290'), (x'45208b2a2c280291'), (x'45208b2a2c280292'),
+ --
+ (x'7feffffffffffffe'), (x'7fefffffffffffff'),
+ -- round to even tests (+ve)
+ (x'4350000000000002'),
+ (x'4350000000002e06'),
+ (x'4352000000000003'),
+ (x'4352000000000004'),
+ (x'4358000000000003'),
+ (x'4358000000000004'),
+ (x'435f000000000020'),
+ -- round to even tests (-ve)
+ (x'c350000000000002'),
+ (x'c350000000002e06'),
+ (x'c352000000000003'),
+ (x'c352000000000004'),
+ (x'c358000000000003'),
+ (x'c358000000000004'),
+ (x'c35f000000000020'),
+ -- exercise fixed-point memmoves
+ (x'42dc12218377de66'),
+ (x'42a674e79c5fe51f'),
+ (x'4271f71fb04cb74c'),
+ (x'423cbe991a145879'),
+ (x'4206fee0e1a9e061'),
+ (x'41d26580b487e6b4'),
+ (x'419d6f34540ca453'),
+ (x'41678c29dcd6e9dc'),
+ (x'4132d687e3df217d'),
+ (x'40fe240c9fcb68c8'),
+ (x'40c81cd6e63c53d3'),
+ (x'40934a4584fd0fdc'),
+ (x'405edd3c07fb4c93'),
+ (x'4028b0fcd32f7076'),
+ (x'3ff3c0ca428c59f8'),
+ -- these cases come from the upstream's testsuite
+ -- LotsOfTrailingZeros)
+ (x'3e60000000000000'),
+ -- Regression
+ (x'c352bd2668e077c4'),
+ (x'434018601510c000'),
+ (x'43d055dc36f24000'),
+ (x'43e052961c6f8000'),
+ (x'3ff3c0ca2a5b1d5d'),
+ -- LooksLikePow5
+ (x'4830f0cf064dd592'),
+ (x'4840f0cf064dd592'),
+ (x'4850f0cf064dd592'),
+ -- OutputLength
+ (x'3ff3333333333333'),
+ (x'3ff3ae147ae147ae'),
+ (x'3ff3be76c8b43958'),
+ (x'3ff3c083126e978d'),
+ (x'3ff3c0c1fc8f3238'),
+ (x'3ff3c0c9539b8887'),
+ (x'3ff3c0ca2a5b1d5d'),
+ (x'3ff3c0ca4283de1b'),
+ (x'3ff3c0ca43db770a'),
+ (x'3ff3c0ca428abd53'),
+ (x'3ff3c0ca428c1d2b'),
+ (x'3ff3c0ca428c51f2'),
+ (x'3ff3c0ca428c58fc'),
+ (x'3ff3c0ca428c59dd'),
+ (x'3ff3c0ca428c59f8'),
+ (x'3ff3c0ca428c59fb'),
+ -- 32-bit chunking
+ (x'40112e0be8047a7d'),
+ (x'40112e0be815a889'),
+ (x'40112e0be826d695'),
+ (x'40112e0be83804a1'),
+ (x'40112e0be84932ad'),
+ -- MinMaxShift
+ (x'0040000000000000'),
+ (x'007fffffffffffff'),
+ (x'0290000000000000'),
+ (x'029fffffffffffff'),
+ (x'4350000000000000'),
+ (x'435fffffffffffff'),
+ (x'1330000000000000'),
+ (x'133fffffffffffff'),
+ (x'3a6fa7161a4d6e0c')
+)
+select float8send(flt) as ibits,
+ flt,
+ flt::text::float8 as r_flt,
+ float8send(flt::text::float8) as obits,
+ float8send(flt::text::float8) = float8send(flt) as correct
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+ ibits | flt | r_flt | obits | correct
+--------------------+-------------------------+-------------------------+--------------------+---------
+ \x0000000000000000 | 0 | 0 | \x0000000000000000 | t
+ \x0010000000000000 | 2.2250738585072014e-308 | 2.2250738585072014e-308 | \x0010000000000000 | t
+ \x0010000000000001 | 2.225073858507202e-308 | 2.225073858507202e-308 | \x0010000000000001 | t
+ \x0010000000000002 | 2.2250738585072024e-308 | 2.2250738585072024e-308 | \x0010000000000002 | t
+ \x0018000000000000 | 3.337610787760802e-308 | 3.337610787760802e-308 | \x0018000000000000 | t
+ \x3ddb7cdfd9d7bdba | 9.999999999999999e-11 | 9.999999999999999e-11 | \x3ddb7cdfd9d7bdba | t
+ \x3ddb7cdfd9d7bdbb | 1e-10 | 1e-10 | \x3ddb7cdfd9d7bdbb | t
+ \x3ddb7cdfd9d7bdbc | 1.0000000000000002e-10 | 1.0000000000000002e-10 | \x3ddb7cdfd9d7bdbc | t
+ \x3e112e0be826d694 | 9.999999999999999e-10 | 9.999999999999999e-10 | \x3e112e0be826d694 | t
+ \x3e112e0be826d695 | 1e-09 | 1e-09 | \x3e112e0be826d695 | t
+ \x3e112e0be826d696 | 1.0000000000000003e-09 | 1.0000000000000003e-09 | \x3e112e0be826d696 | t
+ \x3e45798ee2308c39 | 9.999999999999999e-09 | 9.999999999999999e-09 | \x3e45798ee2308c39 | t
+ \x3e45798ee2308c3a | 1e-08 | 1e-08 | \x3e45798ee2308c3a | t
+ \x3e45798ee2308c3b | 1.0000000000000002e-08 | 1.0000000000000002e-08 | \x3e45798ee2308c3b | t
+ \x3e7ad7f29abcaf47 | 9.999999999999998e-08 | 9.999999999999998e-08 | \x3e7ad7f29abcaf47 | t
+ \x3e7ad7f29abcaf48 | 1e-07 | 1e-07 | \x3e7ad7f29abcaf48 | t
+ \x3e7ad7f29abcaf49 | 1.0000000000000001e-07 | 1.0000000000000001e-07 | \x3e7ad7f29abcaf49 | t
+ \x3eb0c6f7a0b5ed8c | 9.999999999999997e-07 | 9.999999999999997e-07 | \x3eb0c6f7a0b5ed8c | t
+ \x3eb0c6f7a0b5ed8d | 1e-06 | 1e-06 | \x3eb0c6f7a0b5ed8d | t
+ \x3eb0c6f7a0b5ed8e | 1.0000000000000002e-06 | 1.0000000000000002e-06 | \x3eb0c6f7a0b5ed8e | t
+ \x3ee4f8b588e368ef | 9.999999999999997e-06 | 9.999999999999997e-06 | \x3ee4f8b588e368ef | t
+ \x3ee4f8b588e368f0 | 9.999999999999999e-06 | 9.999999999999999e-06 | \x3ee4f8b588e368f0 | t
+ \x3ee4f8b588e368f1 | 1e-05 | 1e-05 | \x3ee4f8b588e368f1 | t
+ \x3f1a36e2eb1c432c | 9.999999999999999e-05 | 9.999999999999999e-05 | \x3f1a36e2eb1c432c | t
+ \x3f1a36e2eb1c432d | 0.0001 | 0.0001 | \x3f1a36e2eb1c432d | t
+ \x3f1a36e2eb1c432e | 0.00010000000000000002 | 0.00010000000000000002 | \x3f1a36e2eb1c432e | t
+ \x3f50624dd2f1a9fb | 0.0009999999999999998 | 0.0009999999999999998 | \x3f50624dd2f1a9fb | t
+ \x3f50624dd2f1a9fc | 0.001 | 0.001 | \x3f50624dd2f1a9fc | t
+ \x3f50624dd2f1a9fd | 0.0010000000000000002 | 0.0010000000000000002 | \x3f50624dd2f1a9fd | t
+ \x3f847ae147ae147a | 0.009999999999999998 | 0.009999999999999998 | \x3f847ae147ae147a | t
+ \x3f847ae147ae147b | 0.01 | 0.01 | \x3f847ae147ae147b | t
+ \x3f847ae147ae147c | 0.010000000000000002 | 0.010000000000000002 | \x3f847ae147ae147c | t
+ \x3fb9999999999999 | 0.09999999999999999 | 0.09999999999999999 | \x3fb9999999999999 | t
+ \x3fb999999999999a | 0.1 | 0.1 | \x3fb999999999999a | t
+ \x3fb999999999999b | 0.10000000000000002 | 0.10000000000000002 | \x3fb999999999999b | t
+ \x3feffffffffffff0 | 0.9999999999999982 | 0.9999999999999982 | \x3feffffffffffff0 | t
+ \x3feffffffffffff1 | 0.9999999999999983 | 0.9999999999999983 | \x3feffffffffffff1 | t
+ \x3feffffffffffff2 | 0.9999999999999984 | 0.9999999999999984 | \x3feffffffffffff2 | t
+ \x3feffffffffffff3 | 0.9999999999999986 | 0.9999999999999986 | \x3feffffffffffff3 | t
+ \x3feffffffffffff4 | 0.9999999999999987 | 0.9999999999999987 | \x3feffffffffffff4 | t
+ \x3feffffffffffff5 | 0.9999999999999988 | 0.9999999999999988 | \x3feffffffffffff5 | t
+ \x3feffffffffffff6 | 0.9999999999999989 | 0.9999999999999989 | \x3feffffffffffff6 | t
+ \x3feffffffffffff7 | 0.999999999999999 | 0.999999999999999 | \x3feffffffffffff7 | t
+ \x3feffffffffffff8 | 0.9999999999999991 | 0.9999999999999991 | \x3feffffffffffff8 | t
+ \x3feffffffffffff9 | 0.9999999999999992 | 0.9999999999999992 | \x3feffffffffffff9 | t
+ \x3feffffffffffffa | 0.9999999999999993 | 0.9999999999999993 | \x3feffffffffffffa | t
+ \x3feffffffffffffb | 0.9999999999999994 | 0.9999999999999994 | \x3feffffffffffffb | t
+ \x3feffffffffffffc | 0.9999999999999996 | 0.9999999999999996 | \x3feffffffffffffc | t
+ \x3feffffffffffffd | 0.9999999999999997 | 0.9999999999999997 | \x3feffffffffffffd | t
+ \x3feffffffffffffe | 0.9999999999999998 | 0.9999999999999998 | \x3feffffffffffffe | t
+ \x3fefffffffffffff | 0.9999999999999999 | 0.9999999999999999 | \x3fefffffffffffff | t
+ \x3ff0000000000000 | 1 | 1 | \x3ff0000000000000 | t
+ \x3ff0000000000001 | 1.0000000000000002 | 1.0000000000000002 | \x3ff0000000000001 | t
+ \x3ff0000000000002 | 1.0000000000000004 | 1.0000000000000004 | \x3ff0000000000002 | t
+ \x3ff0000000000003 | 1.0000000000000007 | 1.0000000000000007 | \x3ff0000000000003 | t
+ \x3ff0000000000004 | 1.0000000000000009 | 1.0000000000000009 | \x3ff0000000000004 | t
+ \x3ff0000000000005 | 1.000000000000001 | 1.000000000000001 | \x3ff0000000000005 | t
+ \x3ff0000000000006 | 1.0000000000000013 | 1.0000000000000013 | \x3ff0000000000006 | t
+ \x3ff0000000000007 | 1.0000000000000016 | 1.0000000000000016 | \x3ff0000000000007 | t
+ \x3ff0000000000008 | 1.0000000000000018 | 1.0000000000000018 | \x3ff0000000000008 | t
+ \x3ff0000000000009 | 1.000000000000002 | 1.000000000000002 | \x3ff0000000000009 | t
+ \x3ff921fb54442d18 | 1.5707963267948966 | 1.5707963267948966 | \x3ff921fb54442d18 | t
+ \x4005bf0a8b14576a | 2.7182818284590455 | 2.7182818284590455 | \x4005bf0a8b14576a | t
+ \x400921fb54442d18 | 3.141592653589793 | 3.141592653589793 | \x400921fb54442d18 | t
+ \x4023ffffffffffff | 9.999999999999998 | 9.999999999999998 | \x4023ffffffffffff | t
+ \x4024000000000000 | 10 | 10 | \x4024000000000000 | t
+ \x4024000000000001 | 10.000000000000002 | 10.000000000000002 | \x4024000000000001 | t
+ \x4058ffffffffffff | 99.99999999999999 | 99.99999999999999 | \x4058ffffffffffff | t
+ \x4059000000000000 | 100 | 100 | \x4059000000000000 | t
+ \x4059000000000001 | 100.00000000000001 | 100.00000000000001 | \x4059000000000001 | t
+ \x408f3fffffffffff | 999.9999999999999 | 999.9999999999999 | \x408f3fffffffffff | t
+ \x408f400000000000 | 1000 | 1000 | \x408f400000000000 | t
+ \x408f400000000001 | 1000.0000000000001 | 1000.0000000000001 | \x408f400000000001 | t
+ \x40c387ffffffffff | 9999.999999999998 | 9999.999999999998 | \x40c387ffffffffff | t
+ \x40c3880000000000 | 10000 | 10000 | \x40c3880000000000 | t
+ \x40c3880000000001 | 10000.000000000002 | 10000.000000000002 | \x40c3880000000001 | t
+ \x40f869ffffffffff | 99999.99999999999 | 99999.99999999999 | \x40f869ffffffffff | t
+ \x40f86a0000000000 | 100000 | 100000 | \x40f86a0000000000 | t
+ \x40f86a0000000001 | 100000.00000000001 | 100000.00000000001 | \x40f86a0000000001 | t
+ \x412e847fffffffff | 999999.9999999999 | 999999.9999999999 | \x412e847fffffffff | t
+ \x412e848000000000 | 1000000 | 1000000 | \x412e848000000000 | t
+ \x412e848000000001 | 1000000.0000000001 | 1000000.0000000001 | \x412e848000000001 | t
+ \x416312cfffffffff | 9999999.999999998 | 9999999.999999998 | \x416312cfffffffff | t
+ \x416312d000000000 | 10000000 | 10000000 | \x416312d000000000 | t
+ \x416312d000000001 | 10000000.000000002 | 10000000.000000002 | \x416312d000000001 | t
+ \x4197d783ffffffff | 99999999.99999999 | 99999999.99999999 | \x4197d783ffffffff | t
+ \x4197d78400000000 | 100000000 | 100000000 | \x4197d78400000000 | t
+ \x4197d78400000001 | 100000000.00000001 | 100000000.00000001 | \x4197d78400000001 | t
+ \x41cdcd64ffffffff | 999999999.9999999 | 999999999.9999999 | \x41cdcd64ffffffff | t
+ \x41cdcd6500000000 | 1000000000 | 1000000000 | \x41cdcd6500000000 | t
+ \x41cdcd6500000001 | 1000000000.0000001 | 1000000000.0000001 | \x41cdcd6500000001 | t
+ \x4202a05f1fffffff | 9999999999.999998 | 9999999999.999998 | \x4202a05f1fffffff | t
+ \x4202a05f20000000 | 10000000000 | 10000000000 | \x4202a05f20000000 | t
+ \x4202a05f20000001 | 10000000000.000002 | 10000000000.000002 | \x4202a05f20000001 | t
+ \x42374876e7ffffff | 99999999999.99998 | 99999999999.99998 | \x42374876e7ffffff | t
+ \x42374876e8000000 | 100000000000 | 100000000000 | \x42374876e8000000 | t
+ \x42374876e8000001 | 100000000000.00002 | 100000000000.00002 | \x42374876e8000001 | t
+ \x426d1a94a1ffffff | 999999999999.9999 | 999999999999.9999 | \x426d1a94a1ffffff | t
+ \x426d1a94a2000000 | 1000000000000 | 1000000000000 | \x426d1a94a2000000 | t
+ \x426d1a94a2000001 | 1000000000000.0001 | 1000000000000.0001 | \x426d1a94a2000001 | t
+ \x42a2309ce53fffff | 9999999999999.998 | 9999999999999.998 | \x42a2309ce53fffff | t
+ \x42a2309ce5400000 | 10000000000000 | 10000000000000 | \x42a2309ce5400000 | t
+ \x42a2309ce5400001 | 10000000000000.002 | 10000000000000.002 | \x42a2309ce5400001 | t
+ \x42d6bcc41e8fffff | 99999999999999.98 | 99999999999999.98 | \x42d6bcc41e8fffff | t
+ \x42d6bcc41e900000 | 100000000000000 | 100000000000000 | \x42d6bcc41e900000 | t
+ \x42d6bcc41e900001 | 100000000000000.02 | 100000000000000.02 | \x42d6bcc41e900001 | t
+ \x430c6bf52633ffff | 999999999999999.9 | 999999999999999.9 | \x430c6bf52633ffff | t
+ \x430c6bf526340000 | 1e+15 | 1e+15 | \x430c6bf526340000 | t
+ \x430c6bf526340001 | 1.0000000000000001e+15 | 1.0000000000000001e+15 | \x430c6bf526340001 | t
+ \x4341c37937e07fff | 9.999999999999998e+15 | 9.999999999999998e+15 | \x4341c37937e07fff | t
+ \x4341c37937e08000 | 1e+16 | 1e+16 | \x4341c37937e08000 | t
+ \x4341c37937e08001 | 1.0000000000000002e+16 | 1.0000000000000002e+16 | \x4341c37937e08001 | t
+ \x4376345785d89fff | 9.999999999999998e+16 | 9.999999999999998e+16 | \x4376345785d89fff | t
+ \x4376345785d8a000 | 1e+17 | 1e+17 | \x4376345785d8a000 | t
+ \x4376345785d8a001 | 1.0000000000000002e+17 | 1.0000000000000002e+17 | \x4376345785d8a001 | t
+ \x43abc16d674ec7ff | 9.999999999999999e+17 | 9.999999999999999e+17 | \x43abc16d674ec7ff | t
+ \x43abc16d674ec800 | 1e+18 | 1e+18 | \x43abc16d674ec800 | t
+ \x43abc16d674ec801 | 1.0000000000000001e+18 | 1.0000000000000001e+18 | \x43abc16d674ec801 | t
+ \x43e158e460913cff | 9.999999999999998e+18 | 9.999999999999998e+18 | \x43e158e460913cff | t
+ \x43e158e460913d00 | 1e+19 | 1e+19 | \x43e158e460913d00 | t
+ \x43e158e460913d01 | 1.0000000000000002e+19 | 1.0000000000000002e+19 | \x43e158e460913d01 | t
+ \x4415af1d78b58c3f | 9.999999999999998e+19 | 9.999999999999998e+19 | \x4415af1d78b58c3f | t
+ \x4415af1d78b58c40 | 1e+20 | 1e+20 | \x4415af1d78b58c40 | t
+ \x4415af1d78b58c41 | 1.0000000000000002e+20 | 1.0000000000000002e+20 | \x4415af1d78b58c41 | t
+ \x444b1ae4d6e2ef4f | 9.999999999999999e+20 | 9.999999999999999e+20 | \x444b1ae4d6e2ef4f | t
+ \x444b1ae4d6e2ef50 | 1e+21 | 1e+21 | \x444b1ae4d6e2ef50 | t
+ \x444b1ae4d6e2ef51 | 1.0000000000000001e+21 | 1.0000000000000001e+21 | \x444b1ae4d6e2ef51 | t
+ \x4480f0cf064dd591 | 9.999999999999998e+21 | 9.999999999999998e+21 | \x4480f0cf064dd591 | t
+ \x4480f0cf064dd592 | 1e+22 | 1e+22 | \x4480f0cf064dd592 | t
+ \x4480f0cf064dd593 | 1.0000000000000002e+22 | 1.0000000000000002e+22 | \x4480f0cf064dd593 | t
+ \x44b52d02c7e14af5 | 9.999999999999997e+22 | 9.999999999999997e+22 | \x44b52d02c7e14af5 | t
+ \x44b52d02c7e14af6 | 9.999999999999999e+22 | 9.999999999999999e+22 | \x44b52d02c7e14af6 | t
+ \x44b52d02c7e14af7 | 1.0000000000000001e+23 | 1.0000000000000001e+23 | \x44b52d02c7e14af7 | t
+ \x44ea784379d99db3 | 9.999999999999998e+23 | 9.999999999999998e+23 | \x44ea784379d99db3 | t
+ \x44ea784379d99db4 | 1e+24 | 1e+24 | \x44ea784379d99db4 | t
+ \x44ea784379d99db5 | 1.0000000000000001e+24 | 1.0000000000000001e+24 | \x44ea784379d99db5 | t
+ \x45208b2a2c280290 | 9.999999999999999e+24 | 9.999999999999999e+24 | \x45208b2a2c280290 | t
+ \x45208b2a2c280291 | 1e+25 | 1e+25 | \x45208b2a2c280291 | t
+ \x45208b2a2c280292 | 1.0000000000000003e+25 | 1.0000000000000003e+25 | \x45208b2a2c280292 | t
+ \x7feffffffffffffe | 1.7976931348623155e+308 | 1.7976931348623155e+308 | \x7feffffffffffffe | t
+ \x7fefffffffffffff | 1.7976931348623157e+308 | 1.7976931348623157e+308 | \x7fefffffffffffff | t
+ \x4350000000000002 | 1.8014398509481992e+16 | 1.8014398509481992e+16 | \x4350000000000002 | t
+ \x4350000000002e06 | 1.8014398509529112e+16 | 1.8014398509529112e+16 | \x4350000000002e06 | t
+ \x4352000000000003 | 2.0266198323167244e+16 | 2.0266198323167244e+16 | \x4352000000000003 | t
+ \x4352000000000004 | 2.0266198323167248e+16 | 2.0266198323167248e+16 | \x4352000000000004 | t
+ \x4358000000000003 | 2.7021597764222988e+16 | 2.7021597764222988e+16 | \x4358000000000003 | t
+ \x4358000000000004 | 2.7021597764222992e+16 | 2.7021597764222992e+16 | \x4358000000000004 | t
+ \x435f000000000020 | 3.4902897112121472e+16 | 3.4902897112121472e+16 | \x435f000000000020 | t
+ \xc350000000000002 | -1.8014398509481992e+16 | -1.8014398509481992e+16 | \xc350000000000002 | t
+ \xc350000000002e06 | -1.8014398509529112e+16 | -1.8014398509529112e+16 | \xc350000000002e06 | t
+ \xc352000000000003 | -2.0266198323167244e+16 | -2.0266198323167244e+16 | \xc352000000000003 | t
+ \xc352000000000004 | -2.0266198323167248e+16 | -2.0266198323167248e+16 | \xc352000000000004 | t
+ \xc358000000000003 | -2.7021597764222988e+16 | -2.7021597764222988e+16 | \xc358000000000003 | t
+ \xc358000000000004 | -2.7021597764222992e+16 | -2.7021597764222992e+16 | \xc358000000000004 | t
+ \xc35f000000000020 | -3.4902897112121472e+16 | -3.4902897112121472e+16 | \xc35f000000000020 | t
+ \x42dc12218377de66 | 123456789012345.6 | 123456789012345.6 | \x42dc12218377de66 | t
+ \x42a674e79c5fe51f | 12345678901234.56 | 12345678901234.56 | \x42a674e79c5fe51f | t
+ \x4271f71fb04cb74c | 1234567890123.456 | 1234567890123.456 | \x4271f71fb04cb74c | t
+ \x423cbe991a145879 | 123456789012.3456 | 123456789012.3456 | \x423cbe991a145879 | t
+ \x4206fee0e1a9e061 | 12345678901.23456 | 12345678901.23456 | \x4206fee0e1a9e061 | t
+ \x41d26580b487e6b4 | 1234567890.123456 | 1234567890.123456 | \x41d26580b487e6b4 | t
+ \x419d6f34540ca453 | 123456789.0123456 | 123456789.0123456 | \x419d6f34540ca453 | t
+ \x41678c29dcd6e9dc | 12345678.90123456 | 12345678.90123456 | \x41678c29dcd6e9dc | t
+ \x4132d687e3df217d | 1234567.890123456 | 1234567.890123456 | \x4132d687e3df217d | t
+ \x40fe240c9fcb68c8 | 123456.7890123456 | 123456.7890123456 | \x40fe240c9fcb68c8 | t
+ \x40c81cd6e63c53d3 | 12345.67890123456 | 12345.67890123456 | \x40c81cd6e63c53d3 | t
+ \x40934a4584fd0fdc | 1234.567890123456 | 1234.567890123456 | \x40934a4584fd0fdc | t
+ \x405edd3c07fb4c93 | 123.4567890123456 | 123.4567890123456 | \x405edd3c07fb4c93 | t
+ \x4028b0fcd32f7076 | 12.34567890123456 | 12.34567890123456 | \x4028b0fcd32f7076 | t
+ \x3ff3c0ca428c59f8 | 1.234567890123456 | 1.234567890123456 | \x3ff3c0ca428c59f8 | t
+ \x3e60000000000000 | 2.9802322387695312e-08 | 2.9802322387695312e-08 | \x3e60000000000000 | t
+ \xc352bd2668e077c4 | -2.1098088986959632e+16 | -2.1098088986959632e+16 | \xc352bd2668e077c4 | t
+ \x434018601510c000 | 9.0608011534336e+15 | 9.0608011534336e+15 | \x434018601510c000 | t
+ \x43d055dc36f24000 | 4.708356024711512e+18 | 4.708356024711512e+18 | \x43d055dc36f24000 | t
+ \x43e052961c6f8000 | 9.409340012568248e+18 | 9.409340012568248e+18 | \x43e052961c6f8000 | t
+ \x3ff3c0ca2a5b1d5d | 1.2345678 | 1.2345678 | \x3ff3c0ca2a5b1d5d | t
+ \x4830f0cf064dd592 | 5.764607523034235e+39 | 5.764607523034235e+39 | \x4830f0cf064dd592 | t
+ \x4840f0cf064dd592 | 1.152921504606847e+40 | 1.152921504606847e+40 | \x4840f0cf064dd592 | t
+ \x4850f0cf064dd592 | 2.305843009213694e+40 | 2.305843009213694e+40 | \x4850f0cf064dd592 | t
+ \x3ff3333333333333 | 1.2 | 1.2 | \x3ff3333333333333 | t
+ \x3ff3ae147ae147ae | 1.23 | 1.23 | \x3ff3ae147ae147ae | t
+ \x3ff3be76c8b43958 | 1.234 | 1.234 | \x3ff3be76c8b43958 | t
+ \x3ff3c083126e978d | 1.2345 | 1.2345 | \x3ff3c083126e978d | t
+ \x3ff3c0c1fc8f3238 | 1.23456 | 1.23456 | \x3ff3c0c1fc8f3238 | t
+ \x3ff3c0c9539b8887 | 1.234567 | 1.234567 | \x3ff3c0c9539b8887 | t
+ \x3ff3c0ca2a5b1d5d | 1.2345678 | 1.2345678 | \x3ff3c0ca2a5b1d5d | t
+ \x3ff3c0ca4283de1b | 1.23456789 | 1.23456789 | \x3ff3c0ca4283de1b | t
+ \x3ff3c0ca43db770a | 1.234567895 | 1.234567895 | \x3ff3c0ca43db770a | t
+ \x3ff3c0ca428abd53 | 1.2345678901 | 1.2345678901 | \x3ff3c0ca428abd53 | t
+ \x3ff3c0ca428c1d2b | 1.23456789012 | 1.23456789012 | \x3ff3c0ca428c1d2b | t
+ \x3ff3c0ca428c51f2 | 1.234567890123 | 1.234567890123 | \x3ff3c0ca428c51f2 | t
+ \x3ff3c0ca428c58fc | 1.2345678901234 | 1.2345678901234 | \x3ff3c0ca428c58fc | t
+ \x3ff3c0ca428c59dd | 1.23456789012345 | 1.23456789012345 | \x3ff3c0ca428c59dd | t
+ \x3ff3c0ca428c59f8 | 1.234567890123456 | 1.234567890123456 | \x3ff3c0ca428c59f8 | t
+ \x3ff3c0ca428c59fb | 1.2345678901234567 | 1.2345678901234567 | \x3ff3c0ca428c59fb | t
+ \x40112e0be8047a7d | 4.294967294 | 4.294967294 | \x40112e0be8047a7d | t
+ \x40112e0be815a889 | 4.294967295 | 4.294967295 | \x40112e0be815a889 | t
+ \x40112e0be826d695 | 4.294967296 | 4.294967296 | \x40112e0be826d695 | t
+ \x40112e0be83804a1 | 4.294967297 | 4.294967297 | \x40112e0be83804a1 | t
+ \x40112e0be84932ad | 4.294967298 | 4.294967298 | \x40112e0be84932ad | t
+ \x0040000000000000 | 1.7800590868057611e-307 | 1.7800590868057611e-307 | \x0040000000000000 | t
+ \x007fffffffffffff | 2.8480945388892175e-306 | 2.8480945388892175e-306 | \x007fffffffffffff | t
+ \x0290000000000000 | 2.446494580089078e-296 | 2.446494580089078e-296 | \x0290000000000000 | t
+ \x029fffffffffffff | 4.8929891601781557e-296 | 4.8929891601781557e-296 | \x029fffffffffffff | t
+ \x4350000000000000 | 1.8014398509481984e+16 | 1.8014398509481984e+16 | \x4350000000000000 | t
+ \x435fffffffffffff | 3.6028797018963964e+16 | 3.6028797018963964e+16 | \x435fffffffffffff | t
+ \x1330000000000000 | 2.900835519859558e-216 | 2.900835519859558e-216 | \x1330000000000000 | t
+ \x133fffffffffffff | 5.801671039719115e-216 | 5.801671039719115e-216 | \x133fffffffffffff | t
+ \x3a6fa7161a4d6e0c | 3.196104012172126e-27 | 3.196104012172126e-27 | \x3a6fa7161a4d6e0c | t
+(209 rows)
+
+-- clean up, lest opr_sanity complain
+drop type xfloat8 cascade;
+NOTICE: drop cascades to 6 other objects
+DETAIL: drop cascades to function xfloat8in(cstring)
+drop cascades to function xfloat8out(xfloat8)
+drop cascades to cast from xfloat8 to double precision
+drop cascades to cast from double precision to xfloat8
+drop cascades to cast from xfloat8 to bigint
+drop cascades to cast from bigint to xfloat8
diff --git a/yql/essentials/tests/postgresql/original/cases/float8.sql b/yql/essentials/tests/postgresql/original/cases/float8.sql
new file mode 100644
index 0000000000..97f0c3bb2f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/float8.sql
@@ -0,0 +1,500 @@
+--
+-- FLOAT8
+--
+
+CREATE TABLE FLOAT8_TBL(f1 float8);
+
+INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+
+-- test for underflow and overflow handling
+SELECT '10e400'::float8;
+SELECT '-10e400'::float8;
+SELECT '10e-400'::float8;
+SELECT '-10e-400'::float8;
+
+-- test smallest normalized input
+SELECT float8send('2.2250738585072014E-308'::float8);
+
+-- bad input
+INSERT INTO FLOAT8_TBL(f1) VALUES ('');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
+INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
+
+-- special inputs
+SELECT 'NaN'::float8;
+SELECT 'nan'::float8;
+SELECT ' NAN '::float8;
+SELECT 'infinity'::float8;
+SELECT ' -INFINiTY '::float8;
+-- bad special inputs
+SELECT 'N A N'::float8;
+SELECT 'NaN x'::float8;
+SELECT ' INFINITY x'::float8;
+
+SELECT 'Infinity'::float8 + 100.0;
+SELECT 'Infinity'::float8 / 'Infinity'::float8;
+SELECT '42'::float8 / 'Infinity'::float8;
+SELECT 'nan'::float8 / 'nan'::float8;
+SELECT 'nan'::float8 / '0'::float8;
+SELECT 'nan'::numeric::float8;
+
+SELECT * FROM FLOAT8_TBL;
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+
+SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+
+SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+
+SELECT f.f1, f.f1 * '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 + '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 / '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1, f.f1 - '-10' AS x
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+SELECT f.f1 ^ '2.0' AS square_f1
+ FROM FLOAT8_TBL f where f.f1 = '1004.3';
+
+-- absolute value
+SELECT f.f1, @f.f1 AS abs_f1
+ FROM FLOAT8_TBL f;
+
+-- truncate
+SELECT f.f1, trunc(f.f1) AS trunc_f1
+ FROM FLOAT8_TBL f;
+
+-- round
+SELECT f.f1, round(f.f1) AS round_f1
+ FROM FLOAT8_TBL f;
+
+-- ceil / ceiling
+select ceil(f1) as ceil_f1 from float8_tbl f;
+select ceiling(f1) as ceiling_f1 from float8_tbl f;
+
+-- floor
+select floor(f1) as floor_f1 from float8_tbl f;
+
+-- sign
+select sign(f1) as sign_f1 from float8_tbl f;
+
+-- avoid bit-exact output here because operations may not be bit-exact.
+SET extra_float_digits = 0;
+
+-- square root
+SELECT sqrt(float8 '64') AS eight;
+
+SELECT |/ float8 '64' AS eight;
+
+SELECT f.f1, |/f.f1 AS sqrt_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+-- power
+SELECT power(float8 '144', float8 '0.5');
+SELECT power(float8 'NaN', float8 '0.5');
+SELECT power(float8 '144', float8 'NaN');
+SELECT power(float8 'NaN', float8 'NaN');
+SELECT power(float8 '-1', float8 'NaN');
+SELECT power(float8 '1', float8 'NaN');
+SELECT power(float8 'NaN', float8 '0');
+SELECT power(float8 'inf', float8 '0');
+SELECT power(float8 '-inf', float8 '0');
+SELECT power(float8 '0', float8 'inf');
+SELECT power(float8 '0', float8 '-inf');
+SELECT power(float8 '1', float8 'inf');
+SELECT power(float8 '1', float8 '-inf');
+SELECT power(float8 '-1', float8 'inf');
+SELECT power(float8 '-1', float8 '-inf');
+SELECT power(float8 '0.1', float8 'inf');
+SELECT power(float8 '-0.1', float8 'inf');
+SELECT power(float8 '1.1', float8 'inf');
+SELECT power(float8 '-1.1', float8 'inf');
+SELECT power(float8 '0.1', float8 '-inf');
+SELECT power(float8 '-0.1', float8 '-inf');
+SELECT power(float8 '1.1', float8 '-inf');
+SELECT power(float8 '-1.1', float8 '-inf');
+SELECT power(float8 'inf', float8 '-2');
+SELECT power(float8 'inf', float8 '2');
+SELECT power(float8 'inf', float8 'inf');
+SELECT power(float8 'inf', float8 '-inf');
+-- Intel's icc misoptimizes the code that controls the sign of this result,
+-- even with -mp1. Pending a fix for that, only test for "is it zero".
+SELECT power(float8 '-inf', float8 '-2') = '0';
+SELECT power(float8 '-inf', float8 '-3');
+SELECT power(float8 '-inf', float8 '2');
+SELECT power(float8 '-inf', float8 '3');
+SELECT power(float8 '-inf', float8 '3.5');
+SELECT power(float8 '-inf', float8 'inf');
+SELECT power(float8 '-inf', float8 '-inf');
+
+-- take exp of ln(f.f1)
+SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
+ FROM FLOAT8_TBL f
+ WHERE f.f1 > '0.0';
+
+-- check edge cases for exp
+SELECT exp('inf'::float8), exp('-inf'::float8), exp('nan'::float8);
+
+-- cube root
+SELECT ||/ float8 '27' AS three;
+
+SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+
+
+SELECT * FROM FLOAT8_TBL;
+
+UPDATE FLOAT8_TBL
+ SET f1 = FLOAT8_TBL.f1 * '-1'
+ WHERE FLOAT8_TBL.f1 > '0.0';
+
+SELECT f.f1 * '1e200' from FLOAT8_TBL f;
+
+SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
+
+SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
+
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
+
+SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
+
+SELECT exp(f.f1) from FLOAT8_TBL f;
+
+SELECT f.f1 / '0.0' from FLOAT8_TBL f;
+
+SELECT * FROM FLOAT8_TBL;
+
+-- hyperbolic functions
+-- we run these with extra_float_digits = 0 too, since different platforms
+-- tend to produce results that vary in the last place.
+SELECT sinh(float8 '1');
+SELECT cosh(float8 '1');
+SELECT tanh(float8 '1');
+SELECT asinh(float8 '1');
+SELECT acosh(float8 '2');
+SELECT atanh(float8 '0.5');
+-- test Inf/NaN cases for hyperbolic functions
+SELECT sinh(float8 'infinity');
+SELECT sinh(float8 '-infinity');
+SELECT sinh(float8 'nan');
+SELECT cosh(float8 'infinity');
+SELECT cosh(float8 '-infinity');
+SELECT cosh(float8 'nan');
+SELECT tanh(float8 'infinity');
+SELECT tanh(float8 '-infinity');
+SELECT tanh(float8 'nan');
+SELECT asinh(float8 'infinity');
+SELECT asinh(float8 '-infinity');
+SELECT asinh(float8 'nan');
+-- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
+-- SELECT acosh(float8 'infinity');
+SELECT acosh(float8 '-infinity');
+SELECT acosh(float8 'nan');
+SELECT atanh(float8 'infinity');
+SELECT atanh(float8 '-infinity');
+SELECT atanh(float8 'nan');
+
+RESET extra_float_digits;
+
+-- test for over- and underflow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+
+-- maintain external table consistency across platforms
+-- delete all values and reinsert well-behaved ones
+
+DELETE FROM FLOAT8_TBL;
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+
+SELECT * FROM FLOAT8_TBL;
+
+-- test edge-case coercions to integer
+SELECT '32767.4'::float8::int2;
+SELECT '32767.6'::float8::int2;
+SELECT '-32768.4'::float8::int2;
+SELECT '-32768.6'::float8::int2;
+SELECT '2147483647.4'::float8::int4;
+SELECT '2147483647.6'::float8::int4;
+SELECT '-2147483648.4'::float8::int4;
+SELECT '-2147483648.6'::float8::int4;
+SELECT '9223372036854773760'::float8::int8;
+SELECT '9223372036854775807'::float8::int8;
+SELECT '-9223372036854775808.5'::float8::int8;
+SELECT '-9223372036854780000'::float8::int8;
+
+-- test exact cases for trigonometric functions in degrees
+
+SELECT x,
+ sind(x),
+ sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
+FROM (VALUES (0), (30), (90), (150), (180),
+ (210), (270), (330), (360)) AS t(x);
+
+SELECT x,
+ cosd(x),
+ cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
+FROM (VALUES (0), (60), (90), (120), (180),
+ (240), (270), (300), (360)) AS t(x);
+
+SELECT x,
+ tand(x),
+ tand(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS tand_exact,
+ cotd(x),
+ cotd(x) IN ('-Infinity'::float8,-1,0,
+ 1,'Infinity'::float8) AS cotd_exact
+FROM (VALUES (0), (45), (90), (135), (180),
+ (225), (270), (315), (360)) AS t(x);
+
+SELECT x,
+ asind(x),
+ asind(x) IN (-90,-30,0,30,90) AS asind_exact,
+ acosd(x),
+ acosd(x) IN (0,60,90,120,180) AS acosd_exact
+FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
+
+SELECT x,
+ atand(x),
+ atand(x) IN (-90,-45,0,45,90) AS atand_exact
+FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
+ ('Infinity'::float8)) AS t(x);
+
+SELECT x, y,
+ atan2d(y, x),
+ atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
+FROM (SELECT 10*cosd(a), 10*sind(a)
+ FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
+
+--
+-- test output (and round-trip safety) of various values.
+-- To ensure we're testing what we think we're testing, start with
+-- float values specified by bit patterns (as a useful side effect,
+-- this means we'll fail on non-IEEE platforms).
+
+create type xfloat8;
+create function xfloat8in(cstring) returns xfloat8 immutable strict
+ language internal as 'int8in';
+create function xfloat8out(xfloat8) returns cstring immutable strict
+ language internal as 'int8out';
+create type xfloat8 (input = xfloat8in, output = xfloat8out, like = float8);
+create cast (xfloat8 as float8) without function;
+create cast (float8 as xfloat8) without function;
+create cast (xfloat8 as bigint) without function;
+create cast (bigint as xfloat8) without function;
+
+-- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
+
+-- we don't care to assume the platform's strtod() handles subnormals
+-- correctly; those are "use at your own risk". However we do test
+-- subnormal outputs, since those are under our control.
+
+with testdata(bits) as (values
+ -- small subnormals
+ (x'0000000000000001'),
+ (x'0000000000000002'), (x'0000000000000003'),
+ (x'0000000000001000'), (x'0000000100000000'),
+ (x'0000010000000000'), (x'0000010100000000'),
+ (x'0000400000000000'), (x'0000400100000000'),
+ (x'0000800000000000'), (x'0000800000000001'),
+ -- these values taken from upstream testsuite
+ (x'00000000000f4240'),
+ (x'00000000016e3600'),
+ (x'0000008cdcdea440'),
+ -- borderline between subnormal and normal
+ (x'000ffffffffffff0'), (x'000ffffffffffff1'),
+ (x'000ffffffffffffe'), (x'000fffffffffffff'))
+select float8send(flt) as ibits,
+ flt
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+
+-- round-trip tests
+
+with testdata(bits) as (values
+ (x'0000000000000000'),
+ -- smallest normal values
+ (x'0010000000000000'), (x'0010000000000001'),
+ (x'0010000000000002'), (x'0018000000000000'),
+ --
+ (x'3ddb7cdfd9d7bdba'), (x'3ddb7cdfd9d7bdbb'), (x'3ddb7cdfd9d7bdbc'),
+ (x'3e112e0be826d694'), (x'3e112e0be826d695'), (x'3e112e0be826d696'),
+ (x'3e45798ee2308c39'), (x'3e45798ee2308c3a'), (x'3e45798ee2308c3b'),
+ (x'3e7ad7f29abcaf47'), (x'3e7ad7f29abcaf48'), (x'3e7ad7f29abcaf49'),
+ (x'3eb0c6f7a0b5ed8c'), (x'3eb0c6f7a0b5ed8d'), (x'3eb0c6f7a0b5ed8e'),
+ (x'3ee4f8b588e368ef'), (x'3ee4f8b588e368f0'), (x'3ee4f8b588e368f1'),
+ (x'3f1a36e2eb1c432c'), (x'3f1a36e2eb1c432d'), (x'3f1a36e2eb1c432e'),
+ (x'3f50624dd2f1a9fb'), (x'3f50624dd2f1a9fc'), (x'3f50624dd2f1a9fd'),
+ (x'3f847ae147ae147a'), (x'3f847ae147ae147b'), (x'3f847ae147ae147c'),
+ (x'3fb9999999999999'), (x'3fb999999999999a'), (x'3fb999999999999b'),
+ -- values very close to 1
+ (x'3feffffffffffff0'), (x'3feffffffffffff1'), (x'3feffffffffffff2'),
+ (x'3feffffffffffff3'), (x'3feffffffffffff4'), (x'3feffffffffffff5'),
+ (x'3feffffffffffff6'), (x'3feffffffffffff7'), (x'3feffffffffffff8'),
+ (x'3feffffffffffff9'), (x'3feffffffffffffa'), (x'3feffffffffffffb'),
+ (x'3feffffffffffffc'), (x'3feffffffffffffd'), (x'3feffffffffffffe'),
+ (x'3fefffffffffffff'),
+ (x'3ff0000000000000'),
+ (x'3ff0000000000001'), (x'3ff0000000000002'), (x'3ff0000000000003'),
+ (x'3ff0000000000004'), (x'3ff0000000000005'), (x'3ff0000000000006'),
+ (x'3ff0000000000007'), (x'3ff0000000000008'), (x'3ff0000000000009'),
+ --
+ (x'3ff921fb54442d18'),
+ (x'4005bf0a8b14576a'),
+ (x'400921fb54442d18'),
+ --
+ (x'4023ffffffffffff'), (x'4024000000000000'), (x'4024000000000001'),
+ (x'4058ffffffffffff'), (x'4059000000000000'), (x'4059000000000001'),
+ (x'408f3fffffffffff'), (x'408f400000000000'), (x'408f400000000001'),
+ (x'40c387ffffffffff'), (x'40c3880000000000'), (x'40c3880000000001'),
+ (x'40f869ffffffffff'), (x'40f86a0000000000'), (x'40f86a0000000001'),
+ (x'412e847fffffffff'), (x'412e848000000000'), (x'412e848000000001'),
+ (x'416312cfffffffff'), (x'416312d000000000'), (x'416312d000000001'),
+ (x'4197d783ffffffff'), (x'4197d78400000000'), (x'4197d78400000001'),
+ (x'41cdcd64ffffffff'), (x'41cdcd6500000000'), (x'41cdcd6500000001'),
+ (x'4202a05f1fffffff'), (x'4202a05f20000000'), (x'4202a05f20000001'),
+ (x'42374876e7ffffff'), (x'42374876e8000000'), (x'42374876e8000001'),
+ (x'426d1a94a1ffffff'), (x'426d1a94a2000000'), (x'426d1a94a2000001'),
+ (x'42a2309ce53fffff'), (x'42a2309ce5400000'), (x'42a2309ce5400001'),
+ (x'42d6bcc41e8fffff'), (x'42d6bcc41e900000'), (x'42d6bcc41e900001'),
+ (x'430c6bf52633ffff'), (x'430c6bf526340000'), (x'430c6bf526340001'),
+ (x'4341c37937e07fff'), (x'4341c37937e08000'), (x'4341c37937e08001'),
+ (x'4376345785d89fff'), (x'4376345785d8a000'), (x'4376345785d8a001'),
+ (x'43abc16d674ec7ff'), (x'43abc16d674ec800'), (x'43abc16d674ec801'),
+ (x'43e158e460913cff'), (x'43e158e460913d00'), (x'43e158e460913d01'),
+ (x'4415af1d78b58c3f'), (x'4415af1d78b58c40'), (x'4415af1d78b58c41'),
+ (x'444b1ae4d6e2ef4f'), (x'444b1ae4d6e2ef50'), (x'444b1ae4d6e2ef51'),
+ (x'4480f0cf064dd591'), (x'4480f0cf064dd592'), (x'4480f0cf064dd593'),
+ (x'44b52d02c7e14af5'), (x'44b52d02c7e14af6'), (x'44b52d02c7e14af7'),
+ (x'44ea784379d99db3'), (x'44ea784379d99db4'), (x'44ea784379d99db5'),
+ (x'45208b2a2c280290'), (x'45208b2a2c280291'), (x'45208b2a2c280292'),
+ --
+ (x'7feffffffffffffe'), (x'7fefffffffffffff'),
+ -- round to even tests (+ve)
+ (x'4350000000000002'),
+ (x'4350000000002e06'),
+ (x'4352000000000003'),
+ (x'4352000000000004'),
+ (x'4358000000000003'),
+ (x'4358000000000004'),
+ (x'435f000000000020'),
+ -- round to even tests (-ve)
+ (x'c350000000000002'),
+ (x'c350000000002e06'),
+ (x'c352000000000003'),
+ (x'c352000000000004'),
+ (x'c358000000000003'),
+ (x'c358000000000004'),
+ (x'c35f000000000020'),
+ -- exercise fixed-point memmoves
+ (x'42dc12218377de66'),
+ (x'42a674e79c5fe51f'),
+ (x'4271f71fb04cb74c'),
+ (x'423cbe991a145879'),
+ (x'4206fee0e1a9e061'),
+ (x'41d26580b487e6b4'),
+ (x'419d6f34540ca453'),
+ (x'41678c29dcd6e9dc'),
+ (x'4132d687e3df217d'),
+ (x'40fe240c9fcb68c8'),
+ (x'40c81cd6e63c53d3'),
+ (x'40934a4584fd0fdc'),
+ (x'405edd3c07fb4c93'),
+ (x'4028b0fcd32f7076'),
+ (x'3ff3c0ca428c59f8'),
+ -- these cases come from the upstream's testsuite
+ -- LotsOfTrailingZeros)
+ (x'3e60000000000000'),
+ -- Regression
+ (x'c352bd2668e077c4'),
+ (x'434018601510c000'),
+ (x'43d055dc36f24000'),
+ (x'43e052961c6f8000'),
+ (x'3ff3c0ca2a5b1d5d'),
+ -- LooksLikePow5
+ (x'4830f0cf064dd592'),
+ (x'4840f0cf064dd592'),
+ (x'4850f0cf064dd592'),
+ -- OutputLength
+ (x'3ff3333333333333'),
+ (x'3ff3ae147ae147ae'),
+ (x'3ff3be76c8b43958'),
+ (x'3ff3c083126e978d'),
+ (x'3ff3c0c1fc8f3238'),
+ (x'3ff3c0c9539b8887'),
+ (x'3ff3c0ca2a5b1d5d'),
+ (x'3ff3c0ca4283de1b'),
+ (x'3ff3c0ca43db770a'),
+ (x'3ff3c0ca428abd53'),
+ (x'3ff3c0ca428c1d2b'),
+ (x'3ff3c0ca428c51f2'),
+ (x'3ff3c0ca428c58fc'),
+ (x'3ff3c0ca428c59dd'),
+ (x'3ff3c0ca428c59f8'),
+ (x'3ff3c0ca428c59fb'),
+ -- 32-bit chunking
+ (x'40112e0be8047a7d'),
+ (x'40112e0be815a889'),
+ (x'40112e0be826d695'),
+ (x'40112e0be83804a1'),
+ (x'40112e0be84932ad'),
+ -- MinMaxShift
+ (x'0040000000000000'),
+ (x'007fffffffffffff'),
+ (x'0290000000000000'),
+ (x'029fffffffffffff'),
+ (x'4350000000000000'),
+ (x'435fffffffffffff'),
+ (x'1330000000000000'),
+ (x'133fffffffffffff'),
+ (x'3a6fa7161a4d6e0c')
+)
+select float8send(flt) as ibits,
+ flt,
+ flt::text::float8 as r_flt,
+ float8send(flt::text::float8) as obits,
+ float8send(flt::text::float8) = float8send(flt) as correct
+ from (select bits::bigint::xfloat8::float8 as flt
+ from testdata
+ offset 0) s;
+
+-- clean up, lest opr_sanity complain
+drop type xfloat8 cascade;
diff --git a/yql/essentials/tests/postgresql/original/cases/functional_deps.out b/yql/essentials/tests/postgresql/original/cases/functional_deps.out
new file mode 100644
index 0000000000..32381b8ae7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/functional_deps.out
@@ -0,0 +1,232 @@
+-- from http://www.depesz.com/index.php/2010/04/19/getting-unique-elements/
+CREATE TEMP TABLE articles (
+ id int CONSTRAINT articles_pkey PRIMARY KEY,
+ keywords text,
+ title text UNIQUE NOT NULL,
+ body text UNIQUE,
+ created date
+);
+CREATE TEMP TABLE articles_in_category (
+ article_id int,
+ category_id int,
+ changed date,
+ PRIMARY KEY (article_id, category_id)
+);
+-- test functional dependencies based on primary keys/unique constraints
+-- base tables
+-- group by primary key (OK)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+ id | keywords | title | body | created
+----+----------+-------+------+---------
+(0 rows)
+
+-- group by unique not null (fail/todo)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY title;
+ERROR: column "articles.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT id, keywords, title, body, created
+ ^
+-- group by unique nullable (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+ERROR: column "articles.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT id, keywords, title, body, created
+ ^
+-- group by something else (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY keywords;
+ERROR: column "articles.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT id, keywords, title, body, created
+ ^
+-- multiple tables
+-- group by primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+ id | keywords | title | body | created
+----+----------+-------+------+---------
+(0 rows)
+
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+ERROR: column "a.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+-- JOIN syntax
+-- group by left table's primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+ id | keywords | title | body | created
+----+----------+-------+------+---------
+(0 rows)
+
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+ERROR: column "a.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT a.id, a.keywords, a.title, a.body, a.created
+ ^
+-- group by right table's (composite) primary key (OK)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.category_id, aic.article_id;
+ changed
+---------
+(0 rows)
+
+-- group by right table's partial primary key (fail)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id;
+ERROR: column "aic.changed" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT aic.changed
+ ^
+-- example from documentation
+CREATE TEMP TABLE products (product_id int, name text, price numeric);
+CREATE TEMP TABLE sales (product_id int, units int);
+-- OK
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id, p.name, p.price;
+ product_id | name | sales
+------------+------+-------
+(0 rows)
+
+-- fail
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+ERROR: column "p.name" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ ^
+ALTER TABLE products ADD PRIMARY KEY (product_id);
+-- OK now
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+ product_id | name | sales
+------------+------+-------
+(0 rows)
+
+-- Drupal example, http://drupal.org/node/555530
+CREATE TEMP TABLE node (
+ nid SERIAL,
+ vid integer NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid integer NOT NULL default '0',
+ status integer NOT NULL default '1',
+ created integer NOT NULL default '0',
+ -- snip
+ PRIMARY KEY (nid, vid)
+);
+CREATE TEMP TABLE users (
+ uid integer NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ -- snip
+ PRIMARY KEY (uid),
+ UNIQUE (name)
+);
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid, u.name;
+ uid | name
+-----+------
+(0 rows)
+
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid;
+ uid | name
+-----+------
+(0 rows)
+
+-- Check views and dependencies
+-- fail
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+ERROR: column "articles.id" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 2: SELECT id, keywords, title, body, created
+ ^
+-- OK
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+-- fail
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it
+DETAIL: view fdv1 depends on constraint articles_pkey on table articles
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+DROP VIEW fdv1;
+-- multiple dependencies
+CREATE TEMP VIEW fdv2 AS
+SELECT a.id, a.keywords, a.title, aic.category_id, aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id, aic.category_id, aic.article_id;
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it
+DETAIL: view fdv2 depends on constraint articles_pkey on table articles
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+ALTER TABLE articles_in_category DROP CONSTRAINT articles_in_category_pkey RESTRICT; --fail
+ERROR: cannot drop constraint articles_in_category_pkey on table articles_in_category because other objects depend on it
+DETAIL: view fdv2 depends on constraint articles_in_category_pkey on table articles_in_category
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+DROP VIEW fdv2;
+-- nested queries
+CREATE TEMP VIEW fdv3 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id
+UNION
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it
+DETAIL: view fdv3 depends on constraint articles_pkey on table articles
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+DROP VIEW fdv3;
+CREATE TEMP VIEW fdv4 AS
+SELECT * FROM articles WHERE title IN (SELECT title FROM articles GROUP BY id);
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ERROR: cannot drop constraint articles_pkey on table articles because other objects depend on it
+DETAIL: view fdv4 depends on constraint articles_pkey on table articles
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+DROP VIEW fdv4;
+-- prepared query plans: this results in failure on reuse
+PREPARE foo AS
+ SELECT id, keywords, title, body, created
+ FROM articles
+ GROUP BY id;
+EXECUTE foo;
+ id | keywords | title | body | created
+----+----------+-------+------+---------
+(0 rows)
+
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+EXECUTE foo; -- fail
+ERROR: column "articles.keywords" must appear in the GROUP BY clause or be used in an aggregate function
diff --git a/yql/essentials/tests/postgresql/original/cases/functional_deps.sql b/yql/essentials/tests/postgresql/original/cases/functional_deps.sql
new file mode 100644
index 0000000000..406490b995
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/functional_deps.sql
@@ -0,0 +1,210 @@
+-- from http://www.depesz.com/index.php/2010/04/19/getting-unique-elements/
+
+CREATE TEMP TABLE articles (
+ id int CONSTRAINT articles_pkey PRIMARY KEY,
+ keywords text,
+ title text UNIQUE NOT NULL,
+ body text UNIQUE,
+ created date
+);
+
+CREATE TEMP TABLE articles_in_category (
+ article_id int,
+ category_id int,
+ changed date,
+ PRIMARY KEY (article_id, category_id)
+);
+
+-- test functional dependencies based on primary keys/unique constraints
+
+-- base tables
+
+-- group by primary key (OK)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+
+-- group by unique not null (fail/todo)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY title;
+
+-- group by unique nullable (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+
+-- group by something else (fail)
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY keywords;
+
+-- multiple tables
+
+-- group by primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a, articles_in_category AS aic
+WHERE a.id = aic.article_id AND aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+
+-- JOIN syntax
+
+-- group by left table's primary key (OK)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id;
+
+-- group by something else (fail)
+SELECT a.id, a.keywords, a.title, a.body, a.created
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id, aic.category_id;
+
+-- group by right table's (composite) primary key (OK)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.category_id, aic.article_id;
+
+-- group by right table's partial primary key (fail)
+SELECT aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY aic.article_id;
+
+
+-- example from documentation
+
+CREATE TEMP TABLE products (product_id int, name text, price numeric);
+CREATE TEMP TABLE sales (product_id int, units int);
+
+-- OK
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id, p.name, p.price;
+
+-- fail
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+
+ALTER TABLE products ADD PRIMARY KEY (product_id);
+
+-- OK now
+SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
+ FROM products p LEFT JOIN sales s USING (product_id)
+ GROUP BY product_id;
+
+
+-- Drupal example, http://drupal.org/node/555530
+
+CREATE TEMP TABLE node (
+ nid SERIAL,
+ vid integer NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid integer NOT NULL default '0',
+ status integer NOT NULL default '1',
+ created integer NOT NULL default '0',
+ -- snip
+ PRIMARY KEY (nid, vid)
+);
+
+CREATE TEMP TABLE users (
+ uid integer NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ -- snip
+ PRIMARY KEY (uid),
+ UNIQUE (name)
+);
+
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid, u.name;
+
+-- OK
+SELECT u.uid, u.name FROM node n
+INNER JOIN users u ON u.uid = n.uid
+WHERE n.type = 'blog' AND n.status = 1
+GROUP BY u.uid;
+
+
+-- Check views and dependencies
+
+-- fail
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY body;
+
+-- OK
+CREATE TEMP VIEW fdv1 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+
+-- fail
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+
+DROP VIEW fdv1;
+
+
+-- multiple dependencies
+CREATE TEMP VIEW fdv2 AS
+SELECT a.id, a.keywords, a.title, aic.category_id, aic.changed
+FROM articles AS a JOIN articles_in_category AS aic ON a.id = aic.article_id
+WHERE aic.category_id in (14,62,70,53,138)
+GROUP BY a.id, aic.category_id, aic.article_id;
+
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+ALTER TABLE articles_in_category DROP CONSTRAINT articles_in_category_pkey RESTRICT; --fail
+
+DROP VIEW fdv2;
+
+
+-- nested queries
+
+CREATE TEMP VIEW fdv3 AS
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id
+UNION
+SELECT id, keywords, title, body, created
+FROM articles
+GROUP BY id;
+
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+
+DROP VIEW fdv3;
+
+
+CREATE TEMP VIEW fdv4 AS
+SELECT * FROM articles WHERE title IN (SELECT title FROM articles GROUP BY id);
+
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT; -- fail
+
+DROP VIEW fdv4;
+
+
+-- prepared query plans: this results in failure on reuse
+
+PREPARE foo AS
+ SELECT id, keywords, title, body, created
+ FROM articles
+ GROUP BY id;
+
+EXECUTE foo;
+
+ALTER TABLE articles DROP CONSTRAINT articles_pkey RESTRICT;
+
+EXECUTE foo; -- fail
diff --git a/yql/essentials/tests/postgresql/original/cases/horology.out b/yql/essentials/tests/postgresql/original/cases/horology.out
new file mode 100644
index 0000000000..4b865e73f3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/horology.out
@@ -0,0 +1,3344 @@
+--
+-- HOROLOGY
+--
+SET DateStyle = 'Postgres, MDY';
+SHOW TimeZone; -- Many of these tests depend on the prevailing setting
+ TimeZone
+----------
+ PST8PDT
+(1 row)
+
+--
+-- Test various input formats
+--
+SELECT timestamp with time zone '20011227 040506+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 12:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227 040506-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 04:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227 040506.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227 040506.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227T040506+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 12:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227T040506-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 04:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227T040506.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '20011227T040506.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '2001-12-27 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '2001.12.27 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '2001/12/27 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '12/27/2001 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+-- should fail in mdy mode:
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08"
+LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'...
+ ^
+HINT: Perhaps you need a different "datestyle" setting.
+set datestyle to dmy;
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu 27 Dec 04:05:06.789 2001 PST
+(1 row)
+
+reset datestyle;
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 08:00:00 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 00:00:00 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271.5+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 20:00:00 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271.5-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 12:00:00 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271 04:05:06+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 12:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271 04:05:06-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 04:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271T040506+08';
+ timestamptz
+------------------------------
+ Wed Dec 26 12:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271T040506-08';
+ timestamptz
+------------------------------
+ Thu Dec 27 04:05:06 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271T040506.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone 'J2452271T040506.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+-- German/European-style dates with periods as delimiters
+SELECT timestamp with time zone '12.27.2001 04:05:06.789+08';
+ timestamptz
+----------------------------------
+ Wed Dec 26 12:05:06.789 2001 PST
+(1 row)
+
+SELECT timestamp with time zone '12.27.2001 04:05:06.789-08';
+ timestamptz
+----------------------------------
+ Thu Dec 27 04:05:06.789 2001 PST
+(1 row)
+
+SET DateStyle = 'German';
+SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
+ timestamptz
+-----------------------------
+ 26.12.2001 12:05:06.789 PST
+(1 row)
+
+SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
+ timestamptz
+-----------------------------
+ 27.12.2001 04:05:06.789 PST
+(1 row)
+
+SET DateStyle = 'ISO';
+-- As of 7.4, allow time without time zone having a time zone specified
+SELECT time without time zone '040506.789+08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone '040506.789-08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone 'T040506.789+08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time without time zone 'T040506.789-08';
+ time
+--------------
+ 04:05:06.789
+(1 row)
+
+SELECT time with time zone '040506.789+08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone '040506.789-08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SELECT time with time zone 'T040506.789+08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone 'T040506.789-08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SELECT time with time zone 'T040506.789 +08';
+ timetz
+-----------------
+ 04:05:06.789+08
+(1 row)
+
+SELECT time with time zone 'T040506.789 -08';
+ timetz
+-----------------
+ 04:05:06.789-08
+(1 row)
+
+SET DateStyle = 'Postgres, MDY';
+-- Check Julian dates BC
+SELECT date 'J1520447' AS "Confucius' Birthday";
+ Confucius' Birthday
+---------------------
+ 09-28-0551 BC
+(1 row)
+
+SELECT date 'J0' AS "Julian Epoch";
+ Julian Epoch
+---------------
+ 11-24-4714 BC
+(1 row)
+
+--
+-- date, time arithmetic
+--
+SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
+ Date + Time
+--------------------------
+ Tue Feb 03 04:05:06 1981
+(1 row)
+
+SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+ Date + Time PST
+------------------------------
+ Sun Feb 03 04:05:06 1991 PST
+(1 row)
+
+SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+ Date + Time UTC
+------------------------------
+ Fri Feb 02 20:05:06 2001 PST
+(1 row)
+
+SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
+ Add Two Years
+--------------------------
+ Wed Feb 03 00:00:00 1993
+(1 row)
+
+SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
+ Subtract Two Years
+--------------------------
+ Mon Dec 13 00:00:00 1999
+(1 row)
+
+-- subtract time from date should not make sense; use interval instead
+SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
+ Subtract Time
+--------------------------
+ Sat Feb 02 19:54:54 1991
+(1 row)
+
+SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+ERROR: operator does not exist: date - time with time zone
+LINE 1: SELECT date '1991-02-03' - time with time zone '04:05:06 UTC...
+ ^
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+--
+-- timestamp, interval arithmetic
+--
+SELECT timestamp without time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+ Feb 29
+--------------------------
+ Thu Feb 29 23:59:59 1996
+(1 row)
+
+SELECT timestamp without time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+ Feb 28
+--------------------------
+ Sun Feb 28 23:59:59 1999
+(1 row)
+
+SELECT timestamp without time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+ Feb 29
+--------------------------
+ Tue Feb 29 23:59:59 2000
+(1 row)
+
+SELECT timestamp without time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+ Dec 31
+--------------------------
+ Fri Dec 31 23:59:59 1999
+(1 row)
+
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
+ Feb 23, 285506
+----------------------------
+ Fri Feb 23 00:00:00 285506
+(1 row)
+
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
+ Jan 20, 288244
+----------------------------
+ Sat Jan 20 00:00:00 288244
+(1 row)
+
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
+ Dec 31, 294276
+----------------------------
+ Sun Dec 31 00:00:00 294276
+(1 row)
+
+SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
+ 106751991 Days
+------------------
+ @ 106751991 days
+(1 row)
+
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - thomas 97/04/26
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
+ True
+------
+ t
+(1 row)
+
+-- Convert from date and time to timestamp
+-- This test used to be timestamp(date,time) but no longer allowed by grammar
+-- to enable support for SQL99 timestamp type syntax.
+SELECT date '1994-01-01' + time '11:00' AS "Jan_01_1994_11am";
+ Jan_01_1994_11am
+--------------------------
+ Sat Jan 01 11:00:00 1994
+(1 row)
+
+SELECT date '1994-01-01' + time '10:00' AS "Jan_01_1994_10am";
+ Jan_01_1994_10am
+--------------------------
+ Sat Jan 01 10:00:00 1994
+(1 row)
+
+SELECT date '1994-01-01' + timetz '11:00-5' AS "Jan_01_1994_8am";
+ Jan_01_1994_8am
+------------------------------
+ Sat Jan 01 08:00:00 1994 PST
+(1 row)
+
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+ Jan_01_1994_8am
+------------------------------
+ Sat Jan 01 08:00:00 1994 PST
+(1 row)
+
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+ one_year
+-----------------------------
+ -infinity
+ infinity
+ Fri Jan 01 00:00:00 1971
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:02 1998
+ Tue Feb 10 17:32:01.4 1998
+ Tue Feb 10 17:32:01.5 1998
+ Tue Feb 10 17:32:01.6 1998
+ Fri Jan 02 00:00:00 1998
+ Fri Jan 02 03:04:05 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Wed Jun 10 17:32:01 1998
+ Sun Sep 22 18:19:20 2002
+ Thu Mar 15 08:14:01 2001
+ Thu Mar 15 13:14:02 2001
+ Thu Mar 15 12:14:03 2001
+ Thu Mar 15 03:14:04 2001
+ Thu Mar 15 02:14:05 2001
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:00 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Wed Jun 10 18:32:01 1998
+ Tue Feb 10 17:32:01 1998
+ Wed Feb 11 17:32:01 1998
+ Thu Feb 12 17:32:01 1998
+ Fri Feb 13 17:32:01 1998
+ Sat Feb 14 17:32:01 1998
+ Sun Feb 15 17:32:01 1998
+ Mon Feb 16 17:32:01 1998
+ Thu Feb 16 17:32:01 0096 BC
+ Sun Feb 16 17:32:01 0098
+ Fri Feb 16 17:32:01 0598
+ Wed Feb 16 17:32:01 1098
+ Sun Feb 16 17:32:01 1698
+ Fri Feb 16 17:32:01 1798
+ Wed Feb 16 17:32:01 1898
+ Mon Feb 16 17:32:01 1998
+ Sun Feb 16 17:32:01 2098
+ Fri Feb 28 17:32:01 1997
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Thu Jan 01 17:32:01 1998
+ Sat Feb 28 17:32:01 1998
+ Sun Mar 01 17:32:01 1998
+ Wed Dec 30 17:32:01 1998
+ Thu Dec 31 17:32:01 1998
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+ Mon Dec 31 17:32:01 2001
+ Tue Jan 01 17:32:01 2002
+(65 rows)
+
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+ one_year
+-----------------------------
+ -infinity
+ infinity
+ Wed Jan 01 00:00:00 1969
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:02 1996
+ Sat Feb 10 17:32:01.4 1996
+ Sat Feb 10 17:32:01.5 1996
+ Sat Feb 10 17:32:01.6 1996
+ Tue Jan 02 00:00:00 1996
+ Tue Jan 02 03:04:05 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Mon Jun 10 17:32:01 1996
+ Fri Sep 22 18:19:20 2000
+ Mon Mar 15 08:14:01 1999
+ Mon Mar 15 13:14:02 1999
+ Mon Mar 15 12:14:03 1999
+ Mon Mar 15 03:14:04 1999
+ Mon Mar 15 02:14:05 1999
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:00 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Mon Jun 10 18:32:01 1996
+ Sat Feb 10 17:32:01 1996
+ Sun Feb 11 17:32:01 1996
+ Mon Feb 12 17:32:01 1996
+ Tue Feb 13 17:32:01 1996
+ Wed Feb 14 17:32:01 1996
+ Thu Feb 15 17:32:01 1996
+ Fri Feb 16 17:32:01 1996
+ Mon Feb 16 17:32:01 0098 BC
+ Thu Feb 16 17:32:01 0096
+ Tue Feb 16 17:32:01 0596
+ Sun Feb 16 17:32:01 1096
+ Thu Feb 16 17:32:01 1696
+ Tue Feb 16 17:32:01 1796
+ Sun Feb 16 17:32:01 1896
+ Fri Feb 16 17:32:01 1996
+ Thu Feb 16 17:32:01 2096
+ Tue Feb 28 17:32:01 1995
+ Tue Feb 28 17:32:01 1995
+ Wed Mar 01 17:32:01 1995
+ Sat Dec 30 17:32:01 1995
+ Sun Dec 31 17:32:01 1995
+ Mon Jan 01 17:32:01 1996
+ Wed Feb 28 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Thu Dec 31 17:32:01 1998
+ Fri Jan 01 17:32:01 1999
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+(65 rows)
+
+SELECT timestamp with time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+ Feb 29
+------------------------------
+ Thu Feb 29 23:59:59 1996 PST
+(1 row)
+
+SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+ Feb 28
+------------------------------
+ Sun Feb 28 23:59:59 1999 PST
+(1 row)
+
+SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+ Feb 29
+------------------------------
+ Tue Feb 29 23:59:59 2000 PST
+(1 row)
+
+SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+ Dec 31
+------------------------------
+ Fri Dec 31 23:59:59 1999 PST
+(1 row)
+
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
+ True
+------
+ t
+(1 row)
+
+-- timestamp with time zone, interval arithmetic around DST change
+-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
+SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
+ Apr 3, 12:00
+------------------------------
+ Sun Apr 03 12:00:00 2005 CDT
+(1 row)
+
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
+ Apr 3, 13:00
+------------------------------
+ Sun Apr 03 13:00:00 2005 CDT
+(1 row)
+
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
+ Apr 2, 12:00
+------------------------------
+ Sat Apr 02 12:00:00 2005 CST
+(1 row)
+
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
+ Apr 2, 11:00
+------------------------------
+ Sat Apr 02 11:00:00 2005 CST
+(1 row)
+
+RESET TIME ZONE;
+SELECT timestamptz(date '1994-01-01', time '11:00') AS "Jan_01_1994_10am";
+ Jan_01_1994_10am
+------------------------------
+ Sat Jan 01 11:00:00 1994 PST
+(1 row)
+
+SELECT timestamptz(date '1994-01-01', time '10:00') AS "Jan_01_1994_9am";
+ Jan_01_1994_9am
+------------------------------
+ Sat Jan 01 10:00:00 1994 PST
+(1 row)
+
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-8') AS "Jan_01_1994_11am";
+ Jan_01_1994_11am
+------------------------------
+ Sat Jan 01 11:00:00 1994 PST
+(1 row)
+
+SELECT timestamptz(date '1994-01-01', time with time zone '10:00-8') AS "Jan_01_1994_10am";
+ Jan_01_1994_10am
+------------------------------
+ Sat Jan 01 10:00:00 1994 PST
+(1 row)
+
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+ Jan_01_1994_8am
+------------------------------
+ Sat Jan 01 08:00:00 1994 PST
+(1 row)
+
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+ one_year
+---------------------------------
+ -infinity
+ infinity
+ Thu Dec 31 16:00:00 1970 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:02 1998 PST
+ Tue Feb 10 17:32:01.4 1998 PST
+ Tue Feb 10 17:32:01.5 1998 PST
+ Tue Feb 10 17:32:01.6 1998 PST
+ Fri Jan 02 00:00:00 1998 PST
+ Fri Jan 02 03:04:05 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Wed Jun 10 17:32:01 1998 PDT
+ Sun Sep 22 18:19:20 2002 PDT
+ Thu Mar 15 08:14:01 2001 PST
+ Thu Mar 15 04:14:02 2001 PST
+ Thu Mar 15 02:14:03 2001 PST
+ Thu Mar 15 03:14:04 2001 PST
+ Thu Mar 15 01:14:05 2001 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:00 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 17:32:01 1998 PST
+ Tue Feb 10 09:32:01 1998 PST
+ Tue Feb 10 09:32:01 1998 PST
+ Tue Feb 10 09:32:01 1998 PST
+ Tue Feb 10 14:32:01 1998 PST
+ Fri Jul 10 14:32:01 1998 PDT
+ Wed Jun 10 18:32:01 1998 PDT
+ Tue Feb 10 17:32:01 1998 PST
+ Wed Feb 11 17:32:01 1998 PST
+ Thu Feb 12 17:32:01 1998 PST
+ Fri Feb 13 17:32:01 1998 PST
+ Sat Feb 14 17:32:01 1998 PST
+ Sun Feb 15 17:32:01 1998 PST
+ Mon Feb 16 17:32:01 1998 PST
+ Thu Feb 16 17:32:01 0096 PST BC
+ Sun Feb 16 17:32:01 0098 PST
+ Fri Feb 16 17:32:01 0598 PST
+ Wed Feb 16 17:32:01 1098 PST
+ Sun Feb 16 17:32:01 1698 PST
+ Fri Feb 16 17:32:01 1798 PST
+ Wed Feb 16 17:32:01 1898 PST
+ Mon Feb 16 17:32:01 1998 PST
+ Sun Feb 16 17:32:01 2098 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Sat Mar 01 17:32:01 1997 PST
+ Tue Dec 30 17:32:01 1997 PST
+ Wed Dec 31 17:32:01 1997 PST
+ Thu Jan 01 17:32:01 1998 PST
+ Sat Feb 28 17:32:01 1998 PST
+ Sun Mar 01 17:32:01 1998 PST
+ Wed Dec 30 17:32:01 1998 PST
+ Thu Dec 31 17:32:01 1998 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+ Mon Dec 31 17:32:01 2001 PST
+ Tue Jan 01 17:32:01 2002 PST
+(66 rows)
+
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+ one_year
+---------------------------------
+ -infinity
+ infinity
+ Tue Dec 31 16:00:00 1968 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:02 1996 PST
+ Sat Feb 10 17:32:01.4 1996 PST
+ Sat Feb 10 17:32:01.5 1996 PST
+ Sat Feb 10 17:32:01.6 1996 PST
+ Tue Jan 02 00:00:00 1996 PST
+ Tue Jan 02 03:04:05 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Mon Jun 10 17:32:01 1996 PDT
+ Fri Sep 22 18:19:20 2000 PDT
+ Mon Mar 15 08:14:01 1999 PST
+ Mon Mar 15 04:14:02 1999 PST
+ Mon Mar 15 02:14:03 1999 PST
+ Mon Mar 15 03:14:04 1999 PST
+ Mon Mar 15 01:14:05 1999 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:00 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 17:32:01 1996 PST
+ Sat Feb 10 09:32:01 1996 PST
+ Sat Feb 10 09:32:01 1996 PST
+ Sat Feb 10 09:32:01 1996 PST
+ Sat Feb 10 14:32:01 1996 PST
+ Wed Jul 10 14:32:01 1996 PDT
+ Mon Jun 10 18:32:01 1996 PDT
+ Sat Feb 10 17:32:01 1996 PST
+ Sun Feb 11 17:32:01 1996 PST
+ Mon Feb 12 17:32:01 1996 PST
+ Tue Feb 13 17:32:01 1996 PST
+ Wed Feb 14 17:32:01 1996 PST
+ Thu Feb 15 17:32:01 1996 PST
+ Fri Feb 16 17:32:01 1996 PST
+ Mon Feb 16 17:32:01 0098 PST BC
+ Thu Feb 16 17:32:01 0096 PST
+ Tue Feb 16 17:32:01 0596 PST
+ Sun Feb 16 17:32:01 1096 PST
+ Thu Feb 16 17:32:01 1696 PST
+ Tue Feb 16 17:32:01 1796 PST
+ Sun Feb 16 17:32:01 1896 PST
+ Fri Feb 16 17:32:01 1996 PST
+ Thu Feb 16 17:32:01 2096 PST
+ Tue Feb 28 17:32:01 1995 PST
+ Tue Feb 28 17:32:01 1995 PST
+ Wed Mar 01 17:32:01 1995 PST
+ Sat Dec 30 17:32:01 1995 PST
+ Sun Dec 31 17:32:01 1995 PST
+ Mon Jan 01 17:32:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Thu Dec 31 17:32:01 1998 PST
+ Fri Jan 01 17:32:01 1999 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+(66 rows)
+
+--
+-- time, interval arithmetic
+--
+SELECT CAST(time '01:02' AS interval) AS "+01:02";
+ +01:02
+-----------------
+ @ 1 hour 2 mins
+(1 row)
+
+SELECT CAST(interval '02:03' AS time) AS "02:03:00";
+ 02:03:00
+----------
+ 02:03:00
+(1 row)
+
+SELECT time '01:30' + interval '02:01' AS "03:31:00";
+ 03:31:00
+----------
+ 03:31:00
+(1 row)
+
+SELECT time '01:30' - interval '02:01' AS "23:29:00";
+ 23:29:00
+----------
+ 23:29:00
+(1 row)
+
+SELECT time '02:30' + interval '36:01' AS "14:31:00";
+ 14:31:00
+----------
+ 14:31:00
+(1 row)
+
+SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+ERROR: cannot cast type time with time zone to interval
+LINE 1: SELECT CAST(time with time zone '01:02-08' AS interval) AS "...
+ ^
+SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+ERROR: cannot cast type interval to time with time zone
+LINE 1: SELECT CAST(interval '02:03' AS time with time zone) AS "02:...
+ ^
+SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
+ 23:29:00-08
+-------------
+ 23:29:00-08
+(1 row)
+
+SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
+ 14:31:00-08
+-------------
+ 14:31:00-08
+(1 row)
+
+-- These two tests cannot be used because they default to current timezone,
+-- which may be either -08 or -07 depending on the time of year.
+-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
+-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
+-- Try the following two tests instead, as a poor substitute
+SELECT CAST(CAST(date 'today' + time with time zone '05:30'
+ + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+SELECT CAST(cast(date 'today' + time with time zone '03:30'
+ + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
+ 07:31:00
+----------
+ 07:31:00
+(1 row)
+
+SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract"
+ FROM TIMESTAMP_TBL t, INTERVAL_TBL i
+ WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01'
+ AND i.f1 BETWEEN '00:00' AND '23:00'
+ ORDER BY 1,2;
+ t | i | add | subtract
+----------------------------+-----------+----------------------------+----------------------------
+ Wed Feb 28 17:32:01 1996 | @ 1 min | Wed Feb 28 17:33:01 1996 | Wed Feb 28 17:31:01 1996
+ Wed Feb 28 17:32:01 1996 | @ 5 hours | Wed Feb 28 22:32:01 1996 | Wed Feb 28 12:32:01 1996
+ Thu Feb 29 17:32:01 1996 | @ 1 min | Thu Feb 29 17:33:01 1996 | Thu Feb 29 17:31:01 1996
+ Thu Feb 29 17:32:01 1996 | @ 5 hours | Thu Feb 29 22:32:01 1996 | Thu Feb 29 12:32:01 1996
+ Fri Mar 01 17:32:01 1996 | @ 1 min | Fri Mar 01 17:33:01 1996 | Fri Mar 01 17:31:01 1996
+ Fri Mar 01 17:32:01 1996 | @ 5 hours | Fri Mar 01 22:32:01 1996 | Fri Mar 01 12:32:01 1996
+ Mon Dec 30 17:32:01 1996 | @ 1 min | Mon Dec 30 17:33:01 1996 | Mon Dec 30 17:31:01 1996
+ Mon Dec 30 17:32:01 1996 | @ 5 hours | Mon Dec 30 22:32:01 1996 | Mon Dec 30 12:32:01 1996
+ Tue Dec 31 17:32:01 1996 | @ 1 min | Tue Dec 31 17:33:01 1996 | Tue Dec 31 17:31:01 1996
+ Tue Dec 31 17:32:01 1996 | @ 5 hours | Tue Dec 31 22:32:01 1996 | Tue Dec 31 12:32:01 1996
+ Wed Jan 01 17:32:01 1997 | @ 1 min | Wed Jan 01 17:33:01 1997 | Wed Jan 01 17:31:01 1997
+ Wed Jan 01 17:32:01 1997 | @ 5 hours | Wed Jan 01 22:32:01 1997 | Wed Jan 01 12:32:01 1997
+ Thu Jan 02 00:00:00 1997 | @ 1 min | Thu Jan 02 00:01:00 1997 | Wed Jan 01 23:59:00 1997
+ Thu Jan 02 00:00:00 1997 | @ 5 hours | Thu Jan 02 05:00:00 1997 | Wed Jan 01 19:00:00 1997
+ Thu Jan 02 03:04:05 1997 | @ 1 min | Thu Jan 02 03:05:05 1997 | Thu Jan 02 03:03:05 1997
+ Thu Jan 02 03:04:05 1997 | @ 5 hours | Thu Jan 02 08:04:05 1997 | Wed Jan 01 22:04:05 1997
+ Mon Feb 10 17:32:00 1997 | @ 1 min | Mon Feb 10 17:33:00 1997 | Mon Feb 10 17:31:00 1997
+ Mon Feb 10 17:32:00 1997 | @ 5 hours | Mon Feb 10 22:32:00 1997 | Mon Feb 10 12:32:00 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 1 min | Mon Feb 10 17:33:01 1997 | Mon Feb 10 17:31:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01 1997 | @ 5 hours | Mon Feb 10 22:32:01 1997 | Mon Feb 10 12:32:01 1997
+ Mon Feb 10 17:32:01.4 1997 | @ 1 min | Mon Feb 10 17:33:01.4 1997 | Mon Feb 10 17:31:01.4 1997
+ Mon Feb 10 17:32:01.4 1997 | @ 5 hours | Mon Feb 10 22:32:01.4 1997 | Mon Feb 10 12:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997 | @ 1 min | Mon Feb 10 17:33:01.5 1997 | Mon Feb 10 17:31:01.5 1997
+ Mon Feb 10 17:32:01.5 1997 | @ 5 hours | Mon Feb 10 22:32:01.5 1997 | Mon Feb 10 12:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997 | @ 1 min | Mon Feb 10 17:33:01.6 1997 | Mon Feb 10 17:31:01.6 1997
+ Mon Feb 10 17:32:01.6 1997 | @ 5 hours | Mon Feb 10 22:32:01.6 1997 | Mon Feb 10 12:32:01.6 1997
+ Mon Feb 10 17:32:02 1997 | @ 1 min | Mon Feb 10 17:33:02 1997 | Mon Feb 10 17:31:02 1997
+ Mon Feb 10 17:32:02 1997 | @ 5 hours | Mon Feb 10 22:32:02 1997 | Mon Feb 10 12:32:02 1997
+ Tue Feb 11 17:32:01 1997 | @ 1 min | Tue Feb 11 17:33:01 1997 | Tue Feb 11 17:31:01 1997
+ Tue Feb 11 17:32:01 1997 | @ 5 hours | Tue Feb 11 22:32:01 1997 | Tue Feb 11 12:32:01 1997
+ Wed Feb 12 17:32:01 1997 | @ 1 min | Wed Feb 12 17:33:01 1997 | Wed Feb 12 17:31:01 1997
+ Wed Feb 12 17:32:01 1997 | @ 5 hours | Wed Feb 12 22:32:01 1997 | Wed Feb 12 12:32:01 1997
+ Thu Feb 13 17:32:01 1997 | @ 1 min | Thu Feb 13 17:33:01 1997 | Thu Feb 13 17:31:01 1997
+ Thu Feb 13 17:32:01 1997 | @ 5 hours | Thu Feb 13 22:32:01 1997 | Thu Feb 13 12:32:01 1997
+ Fri Feb 14 17:32:01 1997 | @ 1 min | Fri Feb 14 17:33:01 1997 | Fri Feb 14 17:31:01 1997
+ Fri Feb 14 17:32:01 1997 | @ 5 hours | Fri Feb 14 22:32:01 1997 | Fri Feb 14 12:32:01 1997
+ Sat Feb 15 17:32:01 1997 | @ 1 min | Sat Feb 15 17:33:01 1997 | Sat Feb 15 17:31:01 1997
+ Sat Feb 15 17:32:01 1997 | @ 5 hours | Sat Feb 15 22:32:01 1997 | Sat Feb 15 12:32:01 1997
+ Sun Feb 16 17:32:01 1997 | @ 1 min | Sun Feb 16 17:33:01 1997 | Sun Feb 16 17:31:01 1997
+ Sun Feb 16 17:32:01 1997 | @ 1 min | Sun Feb 16 17:33:01 1997 | Sun Feb 16 17:31:01 1997
+ Sun Feb 16 17:32:01 1997 | @ 5 hours | Sun Feb 16 22:32:01 1997 | Sun Feb 16 12:32:01 1997
+ Sun Feb 16 17:32:01 1997 | @ 5 hours | Sun Feb 16 22:32:01 1997 | Sun Feb 16 12:32:01 1997
+ Fri Feb 28 17:32:01 1997 | @ 1 min | Fri Feb 28 17:33:01 1997 | Fri Feb 28 17:31:01 1997
+ Fri Feb 28 17:32:01 1997 | @ 5 hours | Fri Feb 28 22:32:01 1997 | Fri Feb 28 12:32:01 1997
+ Sat Mar 01 17:32:01 1997 | @ 1 min | Sat Mar 01 17:33:01 1997 | Sat Mar 01 17:31:01 1997
+ Sat Mar 01 17:32:01 1997 | @ 5 hours | Sat Mar 01 22:32:01 1997 | Sat Mar 01 12:32:01 1997
+ Tue Jun 10 17:32:01 1997 | @ 1 min | Tue Jun 10 17:33:01 1997 | Tue Jun 10 17:31:01 1997
+ Tue Jun 10 17:32:01 1997 | @ 5 hours | Tue Jun 10 22:32:01 1997 | Tue Jun 10 12:32:01 1997
+ Tue Jun 10 18:32:01 1997 | @ 1 min | Tue Jun 10 18:33:01 1997 | Tue Jun 10 18:31:01 1997
+ Tue Jun 10 18:32:01 1997 | @ 5 hours | Tue Jun 10 23:32:01 1997 | Tue Jun 10 13:32:01 1997
+ Tue Dec 30 17:32:01 1997 | @ 1 min | Tue Dec 30 17:33:01 1997 | Tue Dec 30 17:31:01 1997
+ Tue Dec 30 17:32:01 1997 | @ 5 hours | Tue Dec 30 22:32:01 1997 | Tue Dec 30 12:32:01 1997
+ Wed Dec 31 17:32:01 1997 | @ 1 min | Wed Dec 31 17:33:01 1997 | Wed Dec 31 17:31:01 1997
+ Wed Dec 31 17:32:01 1997 | @ 5 hours | Wed Dec 31 22:32:01 1997 | Wed Dec 31 12:32:01 1997
+ Fri Dec 31 17:32:01 1999 | @ 1 min | Fri Dec 31 17:33:01 1999 | Fri Dec 31 17:31:01 1999
+ Fri Dec 31 17:32:01 1999 | @ 5 hours | Fri Dec 31 22:32:01 1999 | Fri Dec 31 12:32:01 1999
+ Sat Jan 01 17:32:01 2000 | @ 1 min | Sat Jan 01 17:33:01 2000 | Sat Jan 01 17:31:01 2000
+ Sat Jan 01 17:32:01 2000 | @ 5 hours | Sat Jan 01 22:32:01 2000 | Sat Jan 01 12:32:01 2000
+ Wed Mar 15 02:14:05 2000 | @ 1 min | Wed Mar 15 02:15:05 2000 | Wed Mar 15 02:13:05 2000
+ Wed Mar 15 02:14:05 2000 | @ 5 hours | Wed Mar 15 07:14:05 2000 | Tue Mar 14 21:14:05 2000
+ Wed Mar 15 03:14:04 2000 | @ 1 min | Wed Mar 15 03:15:04 2000 | Wed Mar 15 03:13:04 2000
+ Wed Mar 15 03:14:04 2000 | @ 5 hours | Wed Mar 15 08:14:04 2000 | Tue Mar 14 22:14:04 2000
+ Wed Mar 15 08:14:01 2000 | @ 1 min | Wed Mar 15 08:15:01 2000 | Wed Mar 15 08:13:01 2000
+ Wed Mar 15 08:14:01 2000 | @ 5 hours | Wed Mar 15 13:14:01 2000 | Wed Mar 15 03:14:01 2000
+ Wed Mar 15 12:14:03 2000 | @ 1 min | Wed Mar 15 12:15:03 2000 | Wed Mar 15 12:13:03 2000
+ Wed Mar 15 12:14:03 2000 | @ 5 hours | Wed Mar 15 17:14:03 2000 | Wed Mar 15 07:14:03 2000
+ Wed Mar 15 13:14:02 2000 | @ 1 min | Wed Mar 15 13:15:02 2000 | Wed Mar 15 13:13:02 2000
+ Wed Mar 15 13:14:02 2000 | @ 5 hours | Wed Mar 15 18:14:02 2000 | Wed Mar 15 08:14:02 2000
+ Sun Dec 31 17:32:01 2000 | @ 1 min | Sun Dec 31 17:33:01 2000 | Sun Dec 31 17:31:01 2000
+ Sun Dec 31 17:32:01 2000 | @ 5 hours | Sun Dec 31 22:32:01 2000 | Sun Dec 31 12:32:01 2000
+(104 rows)
+
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIME_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+ t | i | add | subtract
+-------------+-------------------------------+-------------+-------------
+ 00:00:00 | @ 14 secs ago | 23:59:46 | 00:00:14
+ 00:00:00 | @ 1 min | 00:01:00 | 23:59:00
+ 00:00:00 | @ 5 hours | 05:00:00 | 19:00:00
+ 00:00:00 | @ 1 day 2 hours 3 mins 4 secs | 02:03:04 | 21:56:56
+ 00:00:00 | @ 10 days | 00:00:00 | 00:00:00
+ 00:00:00 | @ 3 mons | 00:00:00 | 00:00:00
+ 00:00:00 | @ 5 mons | 00:00:00 | 00:00:00
+ 00:00:00 | @ 5 mons 12 hours | 12:00:00 | 12:00:00
+ 00:00:00 | @ 6 years | 00:00:00 | 00:00:00
+ 00:00:00 | @ 34 years | 00:00:00 | 00:00:00
+ 01:00:00 | @ 14 secs ago | 00:59:46 | 01:00:14
+ 01:00:00 | @ 1 min | 01:01:00 | 00:59:00
+ 01:00:00 | @ 5 hours | 06:00:00 | 20:00:00
+ 01:00:00 | @ 1 day 2 hours 3 mins 4 secs | 03:03:04 | 22:56:56
+ 01:00:00 | @ 10 days | 01:00:00 | 01:00:00
+ 01:00:00 | @ 3 mons | 01:00:00 | 01:00:00
+ 01:00:00 | @ 5 mons | 01:00:00 | 01:00:00
+ 01:00:00 | @ 5 mons 12 hours | 13:00:00 | 13:00:00
+ 01:00:00 | @ 6 years | 01:00:00 | 01:00:00
+ 01:00:00 | @ 34 years | 01:00:00 | 01:00:00
+ 02:03:00 | @ 14 secs ago | 02:02:46 | 02:03:14
+ 02:03:00 | @ 1 min | 02:04:00 | 02:02:00
+ 02:03:00 | @ 5 hours | 07:03:00 | 21:03:00
+ 02:03:00 | @ 1 day 2 hours 3 mins 4 secs | 04:06:04 | 23:59:56
+ 02:03:00 | @ 10 days | 02:03:00 | 02:03:00
+ 02:03:00 | @ 3 mons | 02:03:00 | 02:03:00
+ 02:03:00 | @ 5 mons | 02:03:00 | 02:03:00
+ 02:03:00 | @ 5 mons 12 hours | 14:03:00 | 14:03:00
+ 02:03:00 | @ 6 years | 02:03:00 | 02:03:00
+ 02:03:00 | @ 34 years | 02:03:00 | 02:03:00
+ 11:59:00 | @ 14 secs ago | 11:58:46 | 11:59:14
+ 11:59:00 | @ 1 min | 12:00:00 | 11:58:00
+ 11:59:00 | @ 5 hours | 16:59:00 | 06:59:00
+ 11:59:00 | @ 1 day 2 hours 3 mins 4 secs | 14:02:04 | 09:55:56
+ 11:59:00 | @ 10 days | 11:59:00 | 11:59:00
+ 11:59:00 | @ 3 mons | 11:59:00 | 11:59:00
+ 11:59:00 | @ 5 mons | 11:59:00 | 11:59:00
+ 11:59:00 | @ 5 mons 12 hours | 23:59:00 | 23:59:00
+ 11:59:00 | @ 6 years | 11:59:00 | 11:59:00
+ 11:59:00 | @ 34 years | 11:59:00 | 11:59:00
+ 12:00:00 | @ 14 secs ago | 11:59:46 | 12:00:14
+ 12:00:00 | @ 1 min | 12:01:00 | 11:59:00
+ 12:00:00 | @ 5 hours | 17:00:00 | 07:00:00
+ 12:00:00 | @ 1 day 2 hours 3 mins 4 secs | 14:03:04 | 09:56:56
+ 12:00:00 | @ 10 days | 12:00:00 | 12:00:00
+ 12:00:00 | @ 3 mons | 12:00:00 | 12:00:00
+ 12:00:00 | @ 5 mons | 12:00:00 | 12:00:00
+ 12:00:00 | @ 5 mons 12 hours | 00:00:00 | 00:00:00
+ 12:00:00 | @ 6 years | 12:00:00 | 12:00:00
+ 12:00:00 | @ 34 years | 12:00:00 | 12:00:00
+ 12:01:00 | @ 14 secs ago | 12:00:46 | 12:01:14
+ 12:01:00 | @ 1 min | 12:02:00 | 12:00:00
+ 12:01:00 | @ 5 hours | 17:01:00 | 07:01:00
+ 12:01:00 | @ 1 day 2 hours 3 mins 4 secs | 14:04:04 | 09:57:56
+ 12:01:00 | @ 10 days | 12:01:00 | 12:01:00
+ 12:01:00 | @ 3 mons | 12:01:00 | 12:01:00
+ 12:01:00 | @ 5 mons | 12:01:00 | 12:01:00
+ 12:01:00 | @ 5 mons 12 hours | 00:01:00 | 00:01:00
+ 12:01:00 | @ 6 years | 12:01:00 | 12:01:00
+ 12:01:00 | @ 34 years | 12:01:00 | 12:01:00
+ 15:36:39 | @ 14 secs ago | 15:36:25 | 15:36:53
+ 15:36:39 | @ 14 secs ago | 15:36:25 | 15:36:53
+ 15:36:39 | @ 1 min | 15:37:39 | 15:35:39
+ 15:36:39 | @ 1 min | 15:37:39 | 15:35:39
+ 15:36:39 | @ 5 hours | 20:36:39 | 10:36:39
+ 15:36:39 | @ 5 hours | 20:36:39 | 10:36:39
+ 15:36:39 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43 | 13:33:35
+ 15:36:39 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43 | 13:33:35
+ 15:36:39 | @ 10 days | 15:36:39 | 15:36:39
+ 15:36:39 | @ 10 days | 15:36:39 | 15:36:39
+ 15:36:39 | @ 3 mons | 15:36:39 | 15:36:39
+ 15:36:39 | @ 3 mons | 15:36:39 | 15:36:39
+ 15:36:39 | @ 5 mons | 15:36:39 | 15:36:39
+ 15:36:39 | @ 5 mons | 15:36:39 | 15:36:39
+ 15:36:39 | @ 5 mons 12 hours | 03:36:39 | 03:36:39
+ 15:36:39 | @ 5 mons 12 hours | 03:36:39 | 03:36:39
+ 15:36:39 | @ 6 years | 15:36:39 | 15:36:39
+ 15:36:39 | @ 6 years | 15:36:39 | 15:36:39
+ 15:36:39 | @ 34 years | 15:36:39 | 15:36:39
+ 15:36:39 | @ 34 years | 15:36:39 | 15:36:39
+ 23:59:00 | @ 14 secs ago | 23:58:46 | 23:59:14
+ 23:59:00 | @ 1 min | 00:00:00 | 23:58:00
+ 23:59:00 | @ 5 hours | 04:59:00 | 18:59:00
+ 23:59:00 | @ 1 day 2 hours 3 mins 4 secs | 02:02:04 | 21:55:56
+ 23:59:00 | @ 10 days | 23:59:00 | 23:59:00
+ 23:59:00 | @ 3 mons | 23:59:00 | 23:59:00
+ 23:59:00 | @ 5 mons | 23:59:00 | 23:59:00
+ 23:59:00 | @ 5 mons 12 hours | 11:59:00 | 11:59:00
+ 23:59:00 | @ 6 years | 23:59:00 | 23:59:00
+ 23:59:00 | @ 34 years | 23:59:00 | 23:59:00
+ 23:59:59.99 | @ 14 secs ago | 23:59:45.99 | 00:00:13.99
+ 23:59:59.99 | @ 1 min | 00:00:59.99 | 23:58:59.99
+ 23:59:59.99 | @ 5 hours | 04:59:59.99 | 18:59:59.99
+ 23:59:59.99 | @ 1 day 2 hours 3 mins 4 secs | 02:03:03.99 | 21:56:55.99
+ 23:59:59.99 | @ 10 days | 23:59:59.99 | 23:59:59.99
+ 23:59:59.99 | @ 3 mons | 23:59:59.99 | 23:59:59.99
+ 23:59:59.99 | @ 5 mons | 23:59:59.99 | 23:59:59.99
+ 23:59:59.99 | @ 5 mons 12 hours | 11:59:59.99 | 11:59:59.99
+ 23:59:59.99 | @ 6 years | 23:59:59.99 | 23:59:59.99
+ 23:59:59.99 | @ 34 years | 23:59:59.99 | 23:59:59.99
+(100 rows)
+
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIMETZ_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+ t | i | add | subtract
+----------------+-------------------------------+----------------+----------------
+ 00:01:00-07 | @ 14 secs ago | 00:00:46-07 | 00:01:14-07
+ 00:01:00-07 | @ 1 min | 00:02:00-07 | 00:00:00-07
+ 00:01:00-07 | @ 5 hours | 05:01:00-07 | 19:01:00-07
+ 00:01:00-07 | @ 1 day 2 hours 3 mins 4 secs | 02:04:04-07 | 21:57:56-07
+ 00:01:00-07 | @ 10 days | 00:01:00-07 | 00:01:00-07
+ 00:01:00-07 | @ 3 mons | 00:01:00-07 | 00:01:00-07
+ 00:01:00-07 | @ 5 mons | 00:01:00-07 | 00:01:00-07
+ 00:01:00-07 | @ 5 mons 12 hours | 12:01:00-07 | 12:01:00-07
+ 00:01:00-07 | @ 6 years | 00:01:00-07 | 00:01:00-07
+ 00:01:00-07 | @ 34 years | 00:01:00-07 | 00:01:00-07
+ 01:00:00-07 | @ 14 secs ago | 00:59:46-07 | 01:00:14-07
+ 01:00:00-07 | @ 1 min | 01:01:00-07 | 00:59:00-07
+ 01:00:00-07 | @ 5 hours | 06:00:00-07 | 20:00:00-07
+ 01:00:00-07 | @ 1 day 2 hours 3 mins 4 secs | 03:03:04-07 | 22:56:56-07
+ 01:00:00-07 | @ 10 days | 01:00:00-07 | 01:00:00-07
+ 01:00:00-07 | @ 3 mons | 01:00:00-07 | 01:00:00-07
+ 01:00:00-07 | @ 5 mons | 01:00:00-07 | 01:00:00-07
+ 01:00:00-07 | @ 5 mons 12 hours | 13:00:00-07 | 13:00:00-07
+ 01:00:00-07 | @ 6 years | 01:00:00-07 | 01:00:00-07
+ 01:00:00-07 | @ 34 years | 01:00:00-07 | 01:00:00-07
+ 02:03:00-07 | @ 14 secs ago | 02:02:46-07 | 02:03:14-07
+ 02:03:00-07 | @ 1 min | 02:04:00-07 | 02:02:00-07
+ 02:03:00-07 | @ 5 hours | 07:03:00-07 | 21:03:00-07
+ 02:03:00-07 | @ 1 day 2 hours 3 mins 4 secs | 04:06:04-07 | 23:59:56-07
+ 02:03:00-07 | @ 10 days | 02:03:00-07 | 02:03:00-07
+ 02:03:00-07 | @ 3 mons | 02:03:00-07 | 02:03:00-07
+ 02:03:00-07 | @ 5 mons | 02:03:00-07 | 02:03:00-07
+ 02:03:00-07 | @ 5 mons 12 hours | 14:03:00-07 | 14:03:00-07
+ 02:03:00-07 | @ 6 years | 02:03:00-07 | 02:03:00-07
+ 02:03:00-07 | @ 34 years | 02:03:00-07 | 02:03:00-07
+ 08:08:00-04 | @ 14 secs ago | 08:07:46-04 | 08:08:14-04
+ 08:08:00-04 | @ 1 min | 08:09:00-04 | 08:07:00-04
+ 08:08:00-04 | @ 5 hours | 13:08:00-04 | 03:08:00-04
+ 08:08:00-04 | @ 1 day 2 hours 3 mins 4 secs | 10:11:04-04 | 06:04:56-04
+ 08:08:00-04 | @ 10 days | 08:08:00-04 | 08:08:00-04
+ 08:08:00-04 | @ 3 mons | 08:08:00-04 | 08:08:00-04
+ 08:08:00-04 | @ 5 mons | 08:08:00-04 | 08:08:00-04
+ 08:08:00-04 | @ 5 mons 12 hours | 20:08:00-04 | 20:08:00-04
+ 08:08:00-04 | @ 6 years | 08:08:00-04 | 08:08:00-04
+ 08:08:00-04 | @ 34 years | 08:08:00-04 | 08:08:00-04
+ 07:07:00-08 | @ 14 secs ago | 07:06:46-08 | 07:07:14-08
+ 07:07:00-08 | @ 1 min | 07:08:00-08 | 07:06:00-08
+ 07:07:00-08 | @ 5 hours | 12:07:00-08 | 02:07:00-08
+ 07:07:00-08 | @ 1 day 2 hours 3 mins 4 secs | 09:10:04-08 | 05:03:56-08
+ 07:07:00-08 | @ 10 days | 07:07:00-08 | 07:07:00-08
+ 07:07:00-08 | @ 3 mons | 07:07:00-08 | 07:07:00-08
+ 07:07:00-08 | @ 5 mons | 07:07:00-08 | 07:07:00-08
+ 07:07:00-08 | @ 5 mons 12 hours | 19:07:00-08 | 19:07:00-08
+ 07:07:00-08 | @ 6 years | 07:07:00-08 | 07:07:00-08
+ 07:07:00-08 | @ 34 years | 07:07:00-08 | 07:07:00-08
+ 11:59:00-07 | @ 14 secs ago | 11:58:46-07 | 11:59:14-07
+ 11:59:00-07 | @ 1 min | 12:00:00-07 | 11:58:00-07
+ 11:59:00-07 | @ 5 hours | 16:59:00-07 | 06:59:00-07
+ 11:59:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:02:04-07 | 09:55:56-07
+ 11:59:00-07 | @ 10 days | 11:59:00-07 | 11:59:00-07
+ 11:59:00-07 | @ 3 mons | 11:59:00-07 | 11:59:00-07
+ 11:59:00-07 | @ 5 mons | 11:59:00-07 | 11:59:00-07
+ 11:59:00-07 | @ 5 mons 12 hours | 23:59:00-07 | 23:59:00-07
+ 11:59:00-07 | @ 6 years | 11:59:00-07 | 11:59:00-07
+ 11:59:00-07 | @ 34 years | 11:59:00-07 | 11:59:00-07
+ 12:00:00-07 | @ 14 secs ago | 11:59:46-07 | 12:00:14-07
+ 12:00:00-07 | @ 1 min | 12:01:00-07 | 11:59:00-07
+ 12:00:00-07 | @ 5 hours | 17:00:00-07 | 07:00:00-07
+ 12:00:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:03:04-07 | 09:56:56-07
+ 12:00:00-07 | @ 10 days | 12:00:00-07 | 12:00:00-07
+ 12:00:00-07 | @ 3 mons | 12:00:00-07 | 12:00:00-07
+ 12:00:00-07 | @ 5 mons | 12:00:00-07 | 12:00:00-07
+ 12:00:00-07 | @ 5 mons 12 hours | 00:00:00-07 | 00:00:00-07
+ 12:00:00-07 | @ 6 years | 12:00:00-07 | 12:00:00-07
+ 12:00:00-07 | @ 34 years | 12:00:00-07 | 12:00:00-07
+ 12:01:00-07 | @ 14 secs ago | 12:00:46-07 | 12:01:14-07
+ 12:01:00-07 | @ 1 min | 12:02:00-07 | 12:00:00-07
+ 12:01:00-07 | @ 5 hours | 17:01:00-07 | 07:01:00-07
+ 12:01:00-07 | @ 1 day 2 hours 3 mins 4 secs | 14:04:04-07 | 09:57:56-07
+ 12:01:00-07 | @ 10 days | 12:01:00-07 | 12:01:00-07
+ 12:01:00-07 | @ 3 mons | 12:01:00-07 | 12:01:00-07
+ 12:01:00-07 | @ 5 mons | 12:01:00-07 | 12:01:00-07
+ 12:01:00-07 | @ 5 mons 12 hours | 00:01:00-07 | 00:01:00-07
+ 12:01:00-07 | @ 6 years | 12:01:00-07 | 12:01:00-07
+ 12:01:00-07 | @ 34 years | 12:01:00-07 | 12:01:00-07
+ 15:36:39-04 | @ 14 secs ago | 15:36:25-04 | 15:36:53-04
+ 15:36:39-04 | @ 1 min | 15:37:39-04 | 15:35:39-04
+ 15:36:39-04 | @ 5 hours | 20:36:39-04 | 10:36:39-04
+ 15:36:39-04 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43-04 | 13:33:35-04
+ 15:36:39-04 | @ 10 days | 15:36:39-04 | 15:36:39-04
+ 15:36:39-04 | @ 3 mons | 15:36:39-04 | 15:36:39-04
+ 15:36:39-04 | @ 5 mons | 15:36:39-04 | 15:36:39-04
+ 15:36:39-04 | @ 5 mons 12 hours | 03:36:39-04 | 03:36:39-04
+ 15:36:39-04 | @ 6 years | 15:36:39-04 | 15:36:39-04
+ 15:36:39-04 | @ 34 years | 15:36:39-04 | 15:36:39-04
+ 15:36:39-05 | @ 14 secs ago | 15:36:25-05 | 15:36:53-05
+ 15:36:39-05 | @ 1 min | 15:37:39-05 | 15:35:39-05
+ 15:36:39-05 | @ 5 hours | 20:36:39-05 | 10:36:39-05
+ 15:36:39-05 | @ 1 day 2 hours 3 mins 4 secs | 17:39:43-05 | 13:33:35-05
+ 15:36:39-05 | @ 10 days | 15:36:39-05 | 15:36:39-05
+ 15:36:39-05 | @ 3 mons | 15:36:39-05 | 15:36:39-05
+ 15:36:39-05 | @ 5 mons | 15:36:39-05 | 15:36:39-05
+ 15:36:39-05 | @ 5 mons 12 hours | 03:36:39-05 | 03:36:39-05
+ 15:36:39-05 | @ 6 years | 15:36:39-05 | 15:36:39-05
+ 15:36:39-05 | @ 34 years | 15:36:39-05 | 15:36:39-05
+ 23:59:00-07 | @ 14 secs ago | 23:58:46-07 | 23:59:14-07
+ 23:59:00-07 | @ 1 min | 00:00:00-07 | 23:58:00-07
+ 23:59:00-07 | @ 5 hours | 04:59:00-07 | 18:59:00-07
+ 23:59:00-07 | @ 1 day 2 hours 3 mins 4 secs | 02:02:04-07 | 21:55:56-07
+ 23:59:00-07 | @ 10 days | 23:59:00-07 | 23:59:00-07
+ 23:59:00-07 | @ 3 mons | 23:59:00-07 | 23:59:00-07
+ 23:59:00-07 | @ 5 mons | 23:59:00-07 | 23:59:00-07
+ 23:59:00-07 | @ 5 mons 12 hours | 11:59:00-07 | 11:59:00-07
+ 23:59:00-07 | @ 6 years | 23:59:00-07 | 23:59:00-07
+ 23:59:00-07 | @ 34 years | 23:59:00-07 | 23:59:00-07
+ 23:59:59.99-07 | @ 14 secs ago | 23:59:45.99-07 | 00:00:13.99-07
+ 23:59:59.99-07 | @ 1 min | 00:00:59.99-07 | 23:58:59.99-07
+ 23:59:59.99-07 | @ 5 hours | 04:59:59.99-07 | 18:59:59.99-07
+ 23:59:59.99-07 | @ 1 day 2 hours 3 mins 4 secs | 02:03:03.99-07 | 21:56:55.99-07
+ 23:59:59.99-07 | @ 10 days | 23:59:59.99-07 | 23:59:59.99-07
+ 23:59:59.99-07 | @ 3 mons | 23:59:59.99-07 | 23:59:59.99-07
+ 23:59:59.99-07 | @ 5 mons | 23:59:59.99-07 | 23:59:59.99-07
+ 23:59:59.99-07 | @ 5 mons 12 hours | 11:59:59.99-07 | 11:59:59.99-07
+ 23:59:59.99-07 | @ 6 years | 23:59:59.99-07 | 23:59:59.99-07
+ 23:59:59.99-07 | @ 34 years | 23:59:59.99-07 | 23:59:59.99-07
+(120 rows)
+
+-- SQL9x OVERLAPS operator
+-- test with time zone
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ False
+-------
+ f
+(1 row)
+
+-- test without time zone
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+ False
+-------
+ f
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+ False
+-------
+ f
+(1 row)
+
+-- test time and interval
+SELECT (time '00:00', time '01:00')
+ OVERLAPS (time '00:30', time '01:30') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '00:30', interval '1 hour') AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 hour') AS "False";
+ False
+-------
+ f
+(1 row)
+
+-- SQL99 seems to want this to be false (and we conform to the spec).
+-- istm that this *should* return true, on the theory that time
+-- intervals can wrap around the day boundary - thomas 2001-09-25
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 day') AS "False";
+ False
+-------
+ f
+(1 row)
+
+CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
+-- get some candidate input values
+INSERT INTO TEMP_TIMESTAMP (f1)
+ SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
+ OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
+SELECT f1 AS "timestamp"
+ FROM TEMP_TIMESTAMP
+ ORDER BY "timestamp";
+ timestamp
+------------------------------
+ Thu Jan 01 00:00:00 1970 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+ Wed Mar 15 02:14:05 2000 PST
+ Wed Mar 15 03:14:04 2000 PST
+ Wed Mar 15 08:14:01 2000 PST
+ Wed Mar 15 12:14:03 2000 PST
+ Wed Mar 15 13:14:02 2000 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+ Sat Sep 22 18:19:20 2001 PDT
+(16 rows)
+
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 + t.f1 AS plus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ ORDER BY plus, "timestamp", "interval";
+ timestamp | interval | plus
+------------------------------+-------------------------------+------------------------------
+ Thu Jan 01 00:00:00 1970 PST | @ 14 secs ago | Wed Dec 31 23:59:46 1969 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 1 min | Thu Jan 01 00:01:00 1970 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 5 hours | Thu Jan 01 05:00:00 1970 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Jan 02 02:03:04 1970 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 10 days | Sun Jan 11 00:00:00 1970 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 3 mons | Wed Apr 01 00:00:00 1970 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 5 mons | Mon Jun 01 00:00:00 1970 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 5 mons 12 hours | Mon Jun 01 12:00:00 1970 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 6 years | Thu Jan 01 00:00:00 1976 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 14 secs ago | Wed Feb 28 17:31:47 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 1 min | Wed Feb 28 17:33:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 5 hours | Wed Feb 28 22:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 14 secs ago | Thu Feb 29 17:31:47 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 1 min | Thu Feb 29 17:33:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Feb 29 19:35:05 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 5 hours | Thu Feb 29 22:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 14 secs ago | Fri Mar 01 17:31:47 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 1 min | Fri Mar 01 17:33:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Mar 01 19:35:05 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 5 hours | Fri Mar 01 22:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Mar 02 19:35:05 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 10 days | Sat Mar 09 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 10 days | Sun Mar 10 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 10 days | Mon Mar 11 17:32:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 3 mons | Tue May 28 17:32:01 1996 PDT
+ Thu Feb 29 17:32:01 1996 PST | @ 3 mons | Wed May 29 17:32:01 1996 PDT
+ Fri Mar 01 17:32:01 1996 PST | @ 3 mons | Sat Jun 01 17:32:01 1996 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Sun Jul 28 17:32:01 1996 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Mon Jul 29 05:32:01 1996 PDT
+ Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Mon Jul 29 17:32:01 1996 PDT
+ Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Tue Jul 30 05:32:01 1996 PDT
+ Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Thu Aug 01 17:32:01 1996 PDT
+ Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Aug 02 05:32:01 1996 PDT
+ Mon Dec 30 17:32:01 1996 PST | @ 14 secs ago | Mon Dec 30 17:31:47 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 1 min | Mon Dec 30 17:33:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 5 hours | Mon Dec 30 22:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 14 secs ago | Tue Dec 31 17:31:47 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 1 min | Tue Dec 31 17:33:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Dec 31 19:35:05 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 5 hours | Tue Dec 31 22:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Wed Jan 01 19:35:05 1997 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 10 days | Thu Jan 09 17:32:01 1997 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 10 days | Fri Jan 10 17:32:01 1997 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 3 mons | Sun Mar 30 17:32:01 1997 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 3 mons | Mon Mar 31 17:32:01 1997 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 5 mons | Fri May 30 17:32:01 1997 PDT
+ Mon Dec 30 17:32:01 1996 PST | @ 5 mons 12 hours | Sat May 31 05:32:01 1997 PDT
+ Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Sat May 31 17:32:01 1997 PDT
+ Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Jun 01 05:32:01 1997 PDT
+ Fri Dec 31 17:32:01 1999 PST | @ 14 secs ago | Fri Dec 31 17:31:47 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 1 min | Fri Dec 31 17:33:01 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 5 hours | Fri Dec 31 22:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 14 secs ago | Sat Jan 01 17:31:47 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 1 min | Sat Jan 01 17:33:01 2000 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Jan 01 19:35:05 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 5 hours | Sat Jan 01 22:32:01 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Jan 02 19:35:05 2000 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 10 days | Mon Jan 10 17:32:01 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 10 days | Tue Jan 11 17:32:01 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 14 secs ago | Wed Mar 15 02:13:51 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 1 min | Wed Mar 15 02:15:05 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 14 secs ago | Wed Mar 15 03:13:50 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 1 min | Wed Mar 15 03:15:04 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 5 hours | Wed Mar 15 07:14:05 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 14 secs ago | Wed Mar 15 08:13:47 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 5 hours | Wed Mar 15 08:14:04 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 1 min | Wed Mar 15 08:15:01 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 14 secs ago | Wed Mar 15 12:13:49 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 1 min | Wed Mar 15 12:15:03 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 14 secs ago | Wed Mar 15 13:13:48 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 5 hours | Wed Mar 15 13:14:01 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 1 min | Wed Mar 15 13:15:02 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 5 hours | Wed Mar 15 17:14:03 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 5 hours | Wed Mar 15 18:14:02 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 04:17:09 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 05:17:08 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 10:17:05 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 14:17:07 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Mar 16 15:17:06 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 10 days | Sat Mar 25 02:14:05 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 10 days | Sat Mar 25 03:14:04 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 10 days | Sat Mar 25 08:14:01 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 10 days | Sat Mar 25 12:14:03 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 10 days | Sat Mar 25 13:14:02 2000 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 3 mons | Fri Mar 31 17:32:01 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 3 mons | Sat Apr 01 17:32:01 2000 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 5 mons | Wed May 31 17:32:01 2000 PDT
+ Fri Dec 31 17:32:01 1999 PST | @ 5 mons 12 hours | Thu Jun 01 05:32:01 2000 PDT
+ Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Thu Jun 01 17:32:01 2000 PDT
+ Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 02 05:32:01 2000 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 3 mons | Thu Jun 15 02:14:05 2000 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 3 mons | Thu Jun 15 03:14:04 2000 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 3 mons | Thu Jun 15 08:14:01 2000 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 3 mons | Thu Jun 15 12:14:03 2000 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 3 mons | Thu Jun 15 13:14:02 2000 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 5 mons | Tue Aug 15 02:14:05 2000 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 5 mons | Tue Aug 15 03:14:04 2000 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 5 mons | Tue Aug 15 08:14:01 2000 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 5 mons | Tue Aug 15 12:14:03 2000 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 5 mons | Tue Aug 15 13:14:02 2000 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 5 mons 12 hours | Tue Aug 15 14:14:05 2000 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 5 mons 12 hours | Tue Aug 15 15:14:04 2000 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 5 mons 12 hours | Tue Aug 15 20:14:01 2000 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 5 mons 12 hours | Wed Aug 16 00:14:03 2000 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 5 mons 12 hours | Wed Aug 16 01:14:02 2000 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 14 secs ago | Sun Dec 31 17:31:47 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 1 min | Sun Dec 31 17:33:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 5 hours | Sun Dec 31 22:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 14 secs ago | Mon Jan 01 17:31:47 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 1 min | Mon Jan 01 17:33:01 2001 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Mon Jan 01 19:35:05 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 5 hours | Mon Jan 01 22:32:01 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Jan 02 19:35:05 2001 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 10 days | Wed Jan 10 17:32:01 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 10 days | Thu Jan 11 17:32:01 2001 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 3 mons | Sat Mar 31 17:32:01 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 3 mons | Sun Apr 01 17:32:01 2001 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Thu May 31 17:32:01 2001 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Fri Jun 01 05:32:01 2001 PDT
+ Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Fri Jun 01 17:32:01 2001 PDT
+ Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Sat Jun 02 05:32:01 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 14 secs ago | Sat Sep 22 18:19:06 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 1 min | Sat Sep 22 18:20:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 hours | Sat Sep 22 23:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 1 day 2 hours 3 mins 4 secs | Sun Sep 23 20:22:24 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 10 days | Tue Oct 02 18:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 3 mons | Sat Dec 22 18:19:20 2001 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 mons | Fri Feb 22 18:19:20 2002 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 mons 12 hours | Sat Feb 23 06:19:20 2002 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 6 years | Thu Feb 28 17:32:01 2002 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 6 years | Thu Feb 28 17:32:01 2002 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 6 years | Fri Mar 01 17:32:01 2002 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 6 years | Mon Dec 30 17:32:01 2002 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 6 years | Tue Dec 31 17:32:01 2002 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 34 years | Thu Jan 01 00:00:00 2004 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 6 years | Sat Dec 31 17:32:01 2005 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 6 years | Sun Jan 01 17:32:01 2006 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 6 years | Wed Mar 15 02:14:05 2006 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 6 years | Wed Mar 15 03:14:04 2006 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 6 years | Wed Mar 15 08:14:01 2006 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 6 years | Wed Mar 15 12:14:03 2006 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 6 years | Wed Mar 15 13:14:02 2006 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 6 years | Sun Dec 31 17:32:01 2006 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 6 years | Mon Jan 01 17:32:01 2007 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 6 years | Sat Sep 22 18:19:20 2007 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 34 years | Thu Feb 28 17:32:01 2030 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 34 years | Thu Feb 28 17:32:01 2030 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 34 years | Fri Mar 01 17:32:01 2030 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 34 years | Mon Dec 30 17:32:01 2030 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 34 years | Tue Dec 31 17:32:01 2030 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 34 years | Sat Dec 31 17:32:01 2033 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 34 years | Sun Jan 01 17:32:01 2034 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 34 years | Wed Mar 15 02:14:05 2034 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 34 years | Wed Mar 15 03:14:04 2034 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 34 years | Wed Mar 15 08:14:01 2034 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 34 years | Wed Mar 15 12:14:03 2034 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 34 years | Wed Mar 15 13:14:02 2034 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 34 years | Sun Dec 31 17:32:01 2034 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 34 years | Mon Jan 01 17:32:01 2035 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 34 years | Sat Sep 22 18:19:20 2035 PDT
+(160 rows)
+
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 - t.f1 AS minus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ WHERE isfinite(d.f1)
+ ORDER BY minus, "timestamp", "interval";
+ timestamp | interval | minus
+------------------------------+-------------------------------+------------------------------
+ Thu Jan 01 00:00:00 1970 PST | @ 34 years | Wed Jan 01 00:00:00 1936 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 34 years | Wed Feb 28 17:32:01 1962 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 34 years | Wed Feb 28 17:32:01 1962 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 34 years | Thu Mar 01 17:32:01 1962 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 34 years | Sun Dec 30 17:32:01 1962 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 34 years | Mon Dec 31 17:32:01 1962 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 6 years | Wed Jan 01 00:00:00 1964 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 34 years | Fri Dec 31 17:32:01 1965 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 34 years | Sat Jan 01 17:32:01 1966 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 34 years | Tue Mar 15 02:14:05 1966 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 34 years | Tue Mar 15 03:14:04 1966 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 34 years | Tue Mar 15 08:14:01 1966 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 34 years | Tue Mar 15 12:14:03 1966 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 34 years | Tue Mar 15 13:14:02 1966 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 34 years | Sat Dec 31 17:32:01 1966 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 34 years | Sun Jan 01 17:32:01 1967 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 34 years | Fri Sep 22 18:19:20 1967 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 5 mons 12 hours | Thu Jul 31 12:00:00 1969 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 5 mons | Fri Aug 01 00:00:00 1969 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 3 mons | Wed Oct 01 00:00:00 1969 PDT
+ Thu Jan 01 00:00:00 1970 PST | @ 10 days | Mon Dec 22 00:00:00 1969 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Dec 30 21:56:56 1969 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 5 hours | Wed Dec 31 19:00:00 1969 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 1 min | Wed Dec 31 23:59:00 1969 PST
+ Thu Jan 01 00:00:00 1970 PST | @ 14 secs ago | Thu Jan 01 00:00:14 1970 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 6 years | Wed Feb 28 17:32:01 1990 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 6 years | Wed Feb 28 17:32:01 1990 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 6 years | Thu Mar 01 17:32:01 1990 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 6 years | Sun Dec 30 17:32:01 1990 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 6 years | Mon Dec 31 17:32:01 1990 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 6 years | Fri Dec 31 17:32:01 1993 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 6 years | Sat Jan 01 17:32:01 1994 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 6 years | Tue Mar 15 02:14:05 1994 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 6 years | Tue Mar 15 03:14:04 1994 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 6 years | Tue Mar 15 08:14:01 1994 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 6 years | Tue Mar 15 12:14:03 1994 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 6 years | Tue Mar 15 13:14:02 1994 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 6 years | Sat Dec 31 17:32:01 1994 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 6 years | Sun Jan 01 17:32:01 1995 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 6 years | Fri Sep 22 18:19:20 1995 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 5 mons 12 hours | Thu Sep 28 05:32:01 1995 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 5 mons | Thu Sep 28 17:32:01 1995 PDT
+ Thu Feb 29 17:32:01 1996 PST | @ 5 mons 12 hours | Fri Sep 29 05:32:01 1995 PDT
+ Thu Feb 29 17:32:01 1996 PST | @ 5 mons | Fri Sep 29 17:32:01 1995 PDT
+ Fri Mar 01 17:32:01 1996 PST | @ 5 mons 12 hours | Sun Oct 01 05:32:01 1995 PDT
+ Fri Mar 01 17:32:01 1996 PST | @ 5 mons | Sun Oct 01 17:32:01 1995 PDT
+ Wed Feb 28 17:32:01 1996 PST | @ 3 mons | Tue Nov 28 17:32:01 1995 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 3 mons | Wed Nov 29 17:32:01 1995 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 3 mons | Fri Dec 01 17:32:01 1995 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 10 days | Sun Feb 18 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 10 days | Mon Feb 19 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 10 days | Tue Feb 20 17:32:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Feb 27 15:28:57 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 5 hours | Wed Feb 28 12:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Wed Feb 28 15:28:57 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 1 min | Wed Feb 28 17:31:01 1996 PST
+ Wed Feb 28 17:32:01 1996 PST | @ 14 secs ago | Wed Feb 28 17:32:15 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 5 hours | Thu Feb 29 12:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Feb 29 15:28:57 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 1 min | Thu Feb 29 17:31:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST | @ 14 secs ago | Thu Feb 29 17:32:15 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 5 hours | Fri Mar 01 12:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 1 min | Fri Mar 01 17:31:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST | @ 14 secs ago | Fri Mar 01 17:32:15 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 5 mons 12 hours | Tue Jul 30 05:32:01 1996 PDT
+ Mon Dec 30 17:32:01 1996 PST | @ 5 mons | Tue Jul 30 17:32:01 1996 PDT
+ Tue Dec 31 17:32:01 1996 PST | @ 5 mons 12 hours | Wed Jul 31 05:32:01 1996 PDT
+ Tue Dec 31 17:32:01 1996 PST | @ 5 mons | Wed Jul 31 17:32:01 1996 PDT
+ Mon Dec 30 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 17:32:01 1996 PDT
+ Tue Dec 31 17:32:01 1996 PST | @ 3 mons | Mon Sep 30 17:32:01 1996 PDT
+ Mon Dec 30 17:32:01 1996 PST | @ 10 days | Fri Dec 20 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 10 days | Sat Dec 21 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Dec 29 15:28:57 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 5 hours | Mon Dec 30 12:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 1 day 2 hours 3 mins 4 secs | Mon Dec 30 15:28:57 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 1 min | Mon Dec 30 17:31:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST | @ 14 secs ago | Mon Dec 30 17:32:15 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 5 hours | Tue Dec 31 12:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 1 min | Tue Dec 31 17:31:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST | @ 14 secs ago | Tue Dec 31 17:32:15 1996 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 5 mons 12 hours | Sat Jul 31 05:32:01 1999 PDT
+ Fri Dec 31 17:32:01 1999 PST | @ 5 mons | Sat Jul 31 17:32:01 1999 PDT
+ Sat Jan 01 17:32:01 2000 PST | @ 5 mons 12 hours | Sun Aug 01 05:32:01 1999 PDT
+ Sat Jan 01 17:32:01 2000 PST | @ 5 mons | Sun Aug 01 17:32:01 1999 PDT
+ Fri Dec 31 17:32:01 1999 PST | @ 3 mons | Thu Sep 30 17:32:01 1999 PDT
+ Sat Jan 01 17:32:01 2000 PST | @ 3 mons | Fri Oct 01 17:32:01 1999 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 5 mons 12 hours | Thu Oct 14 14:14:05 1999 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 5 mons 12 hours | Thu Oct 14 15:14:04 1999 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 5 mons 12 hours | Thu Oct 14 20:14:01 1999 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 5 mons 12 hours | Fri Oct 15 00:14:03 1999 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 5 mons 12 hours | Fri Oct 15 01:14:02 1999 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 5 mons | Fri Oct 15 02:14:05 1999 PDT
+ Wed Mar 15 03:14:04 2000 PST | @ 5 mons | Fri Oct 15 03:14:04 1999 PDT
+ Wed Mar 15 08:14:01 2000 PST | @ 5 mons | Fri Oct 15 08:14:01 1999 PDT
+ Wed Mar 15 12:14:03 2000 PST | @ 5 mons | Fri Oct 15 12:14:03 1999 PDT
+ Wed Mar 15 13:14:02 2000 PST | @ 5 mons | Fri Oct 15 13:14:02 1999 PDT
+ Wed Mar 15 02:14:05 2000 PST | @ 3 mons | Wed Dec 15 02:14:05 1999 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 3 mons | Wed Dec 15 03:14:04 1999 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 3 mons | Wed Dec 15 08:14:01 1999 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 3 mons | Wed Dec 15 12:14:03 1999 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 3 mons | Wed Dec 15 13:14:02 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 10 days | Tue Dec 21 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 10 days | Wed Dec 22 17:32:01 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 1 day 2 hours 3 mins 4 secs | Thu Dec 30 15:28:57 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 5 hours | Fri Dec 31 12:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Fri Dec 31 15:28:57 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 1 min | Fri Dec 31 17:31:01 1999 PST
+ Fri Dec 31 17:32:01 1999 PST | @ 14 secs ago | Fri Dec 31 17:32:15 1999 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 5 hours | Sat Jan 01 12:32:01 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 1 min | Sat Jan 01 17:31:01 2000 PST
+ Sat Jan 01 17:32:01 2000 PST | @ 14 secs ago | Sat Jan 01 17:32:15 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 10 days | Sun Mar 05 02:14:05 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 10 days | Sun Mar 05 03:14:04 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 10 days | Sun Mar 05 08:14:01 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 10 days | Sun Mar 05 12:14:03 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 10 days | Sun Mar 05 13:14:02 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 00:11:01 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 01:11:00 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 06:10:57 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 10:10:59 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Tue Mar 14 11:10:58 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 5 hours | Tue Mar 14 21:14:05 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 5 hours | Tue Mar 14 22:14:04 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 1 min | Wed Mar 15 02:13:05 2000 PST
+ Wed Mar 15 02:14:05 2000 PST | @ 14 secs ago | Wed Mar 15 02:14:19 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 1 min | Wed Mar 15 03:13:04 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 5 hours | Wed Mar 15 03:14:01 2000 PST
+ Wed Mar 15 03:14:04 2000 PST | @ 14 secs ago | Wed Mar 15 03:14:18 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 5 hours | Wed Mar 15 07:14:03 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 1 min | Wed Mar 15 08:13:01 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 5 hours | Wed Mar 15 08:14:02 2000 PST
+ Wed Mar 15 08:14:01 2000 PST | @ 14 secs ago | Wed Mar 15 08:14:15 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 1 min | Wed Mar 15 12:13:03 2000 PST
+ Wed Mar 15 12:14:03 2000 PST | @ 14 secs ago | Wed Mar 15 12:14:17 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 1 min | Wed Mar 15 13:13:02 2000 PST
+ Wed Mar 15 13:14:02 2000 PST | @ 14 secs ago | Wed Mar 15 13:14:16 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 5 mons 12 hours | Mon Jul 31 05:32:01 2000 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 5 mons | Mon Jul 31 17:32:01 2000 PDT
+ Mon Jan 01 17:32:01 2001 PST | @ 5 mons 12 hours | Tue Aug 01 05:32:01 2000 PDT
+ Mon Jan 01 17:32:01 2001 PST | @ 5 mons | Tue Aug 01 17:32:01 2000 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 3 mons | Sat Sep 30 17:32:01 2000 PDT
+ Mon Jan 01 17:32:01 2001 PST | @ 3 mons | Sun Oct 01 17:32:01 2000 PDT
+ Sun Dec 31 17:32:01 2000 PST | @ 10 days | Thu Dec 21 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 10 days | Fri Dec 22 17:32:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 1 day 2 hours 3 mins 4 secs | Sat Dec 30 15:28:57 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 5 hours | Sun Dec 31 12:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 1 day 2 hours 3 mins 4 secs | Sun Dec 31 15:28:57 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 1 min | Sun Dec 31 17:31:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST | @ 14 secs ago | Sun Dec 31 17:32:15 2000 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 5 hours | Mon Jan 01 12:32:01 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 1 min | Mon Jan 01 17:31:01 2001 PST
+ Mon Jan 01 17:32:01 2001 PST | @ 14 secs ago | Mon Jan 01 17:32:15 2001 PST
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 mons 12 hours | Sun Apr 22 06:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 mons | Sun Apr 22 18:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 3 mons | Fri Jun 22 18:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 10 days | Wed Sep 12 18:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 1 day 2 hours 3 mins 4 secs | Fri Sep 21 16:16:16 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 5 hours | Sat Sep 22 13:19:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 1 min | Sat Sep 22 18:18:20 2001 PDT
+ Sat Sep 22 18:19:20 2001 PDT | @ 14 secs ago | Sat Sep 22 18:19:34 2001 PDT
+(160 rows)
+
+SELECT d.f1 AS "timestamp",
+ timestamp with time zone '1980-01-06 00:00 GMT' AS gpstime_zero,
+ d.f1 - timestamp with time zone '1980-01-06 00:00 GMT' AS difference
+ FROM TEMP_TIMESTAMP d
+ ORDER BY difference;
+ timestamp | gpstime_zero | difference
+------------------------------+------------------------------+-------------------------------------
+ Thu Jan 01 00:00:00 1970 PST | Sat Jan 05 16:00:00 1980 PST | @ 3656 days 16 hours ago
+ Wed Feb 28 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5898 days 1 hour 32 mins 1 sec
+ Thu Feb 29 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5899 days 1 hour 32 mins 1 sec
+ Fri Mar 01 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 5900 days 1 hour 32 mins 1 sec
+ Mon Dec 30 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 6204 days 1 hour 32 mins 1 sec
+ Tue Dec 31 17:32:01 1996 PST | Sat Jan 05 16:00:00 1980 PST | @ 6205 days 1 hour 32 mins 1 sec
+ Fri Dec 31 17:32:01 1999 PST | Sat Jan 05 16:00:00 1980 PST | @ 7300 days 1 hour 32 mins 1 sec
+ Sat Jan 01 17:32:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7301 days 1 hour 32 mins 1 sec
+ Wed Mar 15 02:14:05 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 10 hours 14 mins 5 secs
+ Wed Mar 15 03:14:04 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 11 hours 14 mins 4 secs
+ Wed Mar 15 08:14:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 16 hours 14 mins 1 sec
+ Wed Mar 15 12:14:03 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 20 hours 14 mins 3 secs
+ Wed Mar 15 13:14:02 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7374 days 21 hours 14 mins 2 secs
+ Sun Dec 31 17:32:01 2000 PST | Sat Jan 05 16:00:00 1980 PST | @ 7666 days 1 hour 32 mins 1 sec
+ Mon Jan 01 17:32:01 2001 PST | Sat Jan 05 16:00:00 1980 PST | @ 7667 days 1 hour 32 mins 1 sec
+ Sat Sep 22 18:19:20 2001 PDT | Sat Jan 05 16:00:00 1980 PST | @ 7931 days 1 hour 19 mins 20 secs
+(16 rows)
+
+SELECT d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS difference
+ FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
+ ORDER BY timestamp1, timestamp2, difference;
+ timestamp1 | timestamp2 | difference
+------------------------------+------------------------------+-------------------------------------------
+ Thu Jan 01 00:00:00 1970 PST | Thu Jan 01 00:00:00 1970 PST | @ 0
+ Thu Jan 01 00:00:00 1970 PST | Wed Feb 28 17:32:01 1996 PST | @ 9554 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Thu Feb 29 17:32:01 1996 PST | @ 9555 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Fri Mar 01 17:32:01 1996 PST | @ 9556 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Mon Dec 30 17:32:01 1996 PST | @ 9860 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Tue Dec 31 17:32:01 1996 PST | @ 9861 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Fri Dec 31 17:32:01 1999 PST | @ 10956 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Sat Jan 01 17:32:01 2000 PST | @ 10957 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 02:14:05 2000 PST | @ 11031 days 2 hours 14 mins 5 secs ago
+ Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 03:14:04 2000 PST | @ 11031 days 3 hours 14 mins 4 secs ago
+ Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 08:14:01 2000 PST | @ 11031 days 8 hours 14 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 12:14:03 2000 PST | @ 11031 days 12 hours 14 mins 3 secs ago
+ Thu Jan 01 00:00:00 1970 PST | Wed Mar 15 13:14:02 2000 PST | @ 11031 days 13 hours 14 mins 2 secs ago
+ Thu Jan 01 00:00:00 1970 PST | Sun Dec 31 17:32:01 2000 PST | @ 11322 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Mon Jan 01 17:32:01 2001 PST | @ 11323 days 17 hours 32 mins 1 sec ago
+ Thu Jan 01 00:00:00 1970 PST | Sat Sep 22 18:19:20 2001 PDT | @ 11587 days 17 hours 19 mins 20 secs ago
+ Wed Feb 28 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9554 days 17 hours 32 mins 1 sec
+ Wed Feb 28 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 0
+ Wed Feb 28 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 1 day ago
+ Wed Feb 28 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 2 days ago
+ Wed Feb 28 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 306 days ago
+ Wed Feb 28 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 307 days ago
+ Wed Feb 28 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1402 days ago
+ Wed Feb 28 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1403 days ago
+ Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1476 days 8 hours 42 mins 4 secs ago
+ Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1476 days 9 hours 42 mins 3 secs ago
+ Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1476 days 14 hours 42 mins ago
+ Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1476 days 18 hours 42 mins 2 secs ago
+ Wed Feb 28 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1476 days 19 hours 42 mins 1 sec ago
+ Wed Feb 28 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1768 days ago
+ Wed Feb 28 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1769 days ago
+ Wed Feb 28 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2032 days 23 hours 47 mins 19 secs ago
+ Thu Feb 29 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9555 days 17 hours 32 mins 1 sec
+ Thu Feb 29 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 1 day
+ Thu Feb 29 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 0
+ Thu Feb 29 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 1 day ago
+ Thu Feb 29 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 305 days ago
+ Thu Feb 29 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 306 days ago
+ Thu Feb 29 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1401 days ago
+ Thu Feb 29 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1402 days ago
+ Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1475 days 8 hours 42 mins 4 secs ago
+ Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1475 days 9 hours 42 mins 3 secs ago
+ Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1475 days 14 hours 42 mins ago
+ Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1475 days 18 hours 42 mins 2 secs ago
+ Thu Feb 29 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1475 days 19 hours 42 mins 1 sec ago
+ Thu Feb 29 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1767 days ago
+ Thu Feb 29 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1768 days ago
+ Thu Feb 29 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2031 days 23 hours 47 mins 19 secs ago
+ Fri Mar 01 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9556 days 17 hours 32 mins 1 sec
+ Fri Mar 01 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 2 days
+ Fri Mar 01 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 1 day
+ Fri Mar 01 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 0
+ Fri Mar 01 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 304 days ago
+ Fri Mar 01 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 305 days ago
+ Fri Mar 01 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1400 days ago
+ Fri Mar 01 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1401 days ago
+ Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1474 days 8 hours 42 mins 4 secs ago
+ Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1474 days 9 hours 42 mins 3 secs ago
+ Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1474 days 14 hours 42 mins ago
+ Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1474 days 18 hours 42 mins 2 secs ago
+ Fri Mar 01 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1474 days 19 hours 42 mins 1 sec ago
+ Fri Mar 01 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1766 days ago
+ Fri Mar 01 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1767 days ago
+ Fri Mar 01 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 2030 days 23 hours 47 mins 19 secs ago
+ Mon Dec 30 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9860 days 17 hours 32 mins 1 sec
+ Mon Dec 30 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 306 days
+ Mon Dec 30 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 305 days
+ Mon Dec 30 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 304 days
+ Mon Dec 30 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 0
+ Mon Dec 30 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 1 day ago
+ Mon Dec 30 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1096 days ago
+ Mon Dec 30 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1097 days ago
+ Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1170 days 8 hours 42 mins 4 secs ago
+ Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1170 days 9 hours 42 mins 3 secs ago
+ Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1170 days 14 hours 42 mins ago
+ Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1170 days 18 hours 42 mins 2 secs ago
+ Mon Dec 30 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1170 days 19 hours 42 mins 1 sec ago
+ Mon Dec 30 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1462 days ago
+ Mon Dec 30 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1463 days ago
+ Mon Dec 30 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 1726 days 23 hours 47 mins 19 secs ago
+ Tue Dec 31 17:32:01 1996 PST | Thu Jan 01 00:00:00 1970 PST | @ 9861 days 17 hours 32 mins 1 sec
+ Tue Dec 31 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST | @ 307 days
+ Tue Dec 31 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST | @ 306 days
+ Tue Dec 31 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST | @ 305 days
+ Tue Dec 31 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST | @ 1 day
+ Tue Dec 31 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST | @ 0
+ Tue Dec 31 17:32:01 1996 PST | Fri Dec 31 17:32:01 1999 PST | @ 1095 days ago
+ Tue Dec 31 17:32:01 1996 PST | Sat Jan 01 17:32:01 2000 PST | @ 1096 days ago
+ Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 02:14:05 2000 PST | @ 1169 days 8 hours 42 mins 4 secs ago
+ Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 03:14:04 2000 PST | @ 1169 days 9 hours 42 mins 3 secs ago
+ Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 08:14:01 2000 PST | @ 1169 days 14 hours 42 mins ago
+ Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 12:14:03 2000 PST | @ 1169 days 18 hours 42 mins 2 secs ago
+ Tue Dec 31 17:32:01 1996 PST | Wed Mar 15 13:14:02 2000 PST | @ 1169 days 19 hours 42 mins 1 sec ago
+ Tue Dec 31 17:32:01 1996 PST | Sun Dec 31 17:32:01 2000 PST | @ 1461 days ago
+ Tue Dec 31 17:32:01 1996 PST | Mon Jan 01 17:32:01 2001 PST | @ 1462 days ago
+ Tue Dec 31 17:32:01 1996 PST | Sat Sep 22 18:19:20 2001 PDT | @ 1725 days 23 hours 47 mins 19 secs ago
+ Fri Dec 31 17:32:01 1999 PST | Thu Jan 01 00:00:00 1970 PST | @ 10956 days 17 hours 32 mins 1 sec
+ Fri Dec 31 17:32:01 1999 PST | Wed Feb 28 17:32:01 1996 PST | @ 1402 days
+ Fri Dec 31 17:32:01 1999 PST | Thu Feb 29 17:32:01 1996 PST | @ 1401 days
+ Fri Dec 31 17:32:01 1999 PST | Fri Mar 01 17:32:01 1996 PST | @ 1400 days
+ Fri Dec 31 17:32:01 1999 PST | Mon Dec 30 17:32:01 1996 PST | @ 1096 days
+ Fri Dec 31 17:32:01 1999 PST | Tue Dec 31 17:32:01 1996 PST | @ 1095 days
+ Fri Dec 31 17:32:01 1999 PST | Fri Dec 31 17:32:01 1999 PST | @ 0
+ Fri Dec 31 17:32:01 1999 PST | Sat Jan 01 17:32:01 2000 PST | @ 1 day ago
+ Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 02:14:05 2000 PST | @ 74 days 8 hours 42 mins 4 secs ago
+ Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 03:14:04 2000 PST | @ 74 days 9 hours 42 mins 3 secs ago
+ Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 08:14:01 2000 PST | @ 74 days 14 hours 42 mins ago
+ Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 12:14:03 2000 PST | @ 74 days 18 hours 42 mins 2 secs ago
+ Fri Dec 31 17:32:01 1999 PST | Wed Mar 15 13:14:02 2000 PST | @ 74 days 19 hours 42 mins 1 sec ago
+ Fri Dec 31 17:32:01 1999 PST | Sun Dec 31 17:32:01 2000 PST | @ 366 days ago
+ Fri Dec 31 17:32:01 1999 PST | Mon Jan 01 17:32:01 2001 PST | @ 367 days ago
+ Fri Dec 31 17:32:01 1999 PST | Sat Sep 22 18:19:20 2001 PDT | @ 630 days 23 hours 47 mins 19 secs ago
+ Sat Jan 01 17:32:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 10957 days 17 hours 32 mins 1 sec
+ Sat Jan 01 17:32:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1403 days
+ Sat Jan 01 17:32:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1402 days
+ Sat Jan 01 17:32:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1401 days
+ Sat Jan 01 17:32:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1097 days
+ Sat Jan 01 17:32:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1096 days
+ Sat Jan 01 17:32:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 1 day
+ Sat Jan 01 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 0
+ Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 73 days 8 hours 42 mins 4 secs ago
+ Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 73 days 9 hours 42 mins 3 secs ago
+ Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 73 days 14 hours 42 mins ago
+ Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 73 days 18 hours 42 mins 2 secs ago
+ Sat Jan 01 17:32:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 73 days 19 hours 42 mins 1 sec ago
+ Sat Jan 01 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 365 days ago
+ Sat Jan 01 17:32:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 366 days ago
+ Sat Jan 01 17:32:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 629 days 23 hours 47 mins 19 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 2 hours 14 mins 5 secs
+ Wed Mar 15 02:14:05 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 8 hours 42 mins 4 secs
+ Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 0
+ Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 59 mins 59 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 5 hours 59 mins 56 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 9 hours 59 mins 58 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 10 hours 59 mins 57 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 15 hours 17 mins 56 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 15 hours 17 mins 56 secs ago
+ Wed Mar 15 02:14:05 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 15 hours 5 mins 15 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 3 hours 14 mins 4 secs
+ Wed Mar 15 03:14:04 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 9 hours 42 mins 3 secs
+ Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 59 mins 59 secs
+ Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 0
+ Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 4 hours 59 mins 57 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 8 hours 59 mins 59 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 9 hours 59 mins 58 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 14 hours 17 mins 57 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 14 hours 17 mins 57 secs ago
+ Wed Mar 15 03:14:04 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 14 hours 5 mins 16 secs ago
+ Wed Mar 15 08:14:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 8 hours 14 mins 1 sec
+ Wed Mar 15 08:14:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 14 hours 42 mins
+ Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 5 hours 59 mins 56 secs
+ Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 4 hours 59 mins 57 secs
+ Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 0
+ Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 4 hours 2 secs ago
+ Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 5 hours 1 sec ago
+ Wed Mar 15 08:14:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 9 hours 18 mins ago
+ Wed Mar 15 08:14:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 9 hours 18 mins ago
+ Wed Mar 15 08:14:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 9 hours 5 mins 19 secs ago
+ Wed Mar 15 12:14:03 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 12 hours 14 mins 3 secs
+ Wed Mar 15 12:14:03 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 18 hours 42 mins 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 9 hours 59 mins 58 secs
+ Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 8 hours 59 mins 59 secs
+ Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 4 hours 2 secs
+ Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 0
+ Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 59 mins 59 secs ago
+ Wed Mar 15 12:14:03 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 5 hours 17 mins 58 secs ago
+ Wed Mar 15 12:14:03 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 5 hours 17 mins 58 secs ago
+ Wed Mar 15 12:14:03 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 5 hours 5 mins 17 secs ago
+ Wed Mar 15 13:14:02 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11031 days 13 hours 14 mins 2 secs
+ Wed Mar 15 13:14:02 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1476 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1475 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1474 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1170 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1169 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 74 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 73 days 19 hours 42 mins 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 10 hours 59 mins 57 secs
+ Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 9 hours 59 mins 58 secs
+ Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 5 hours 1 sec
+ Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 59 mins 59 secs
+ Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 0
+ Wed Mar 15 13:14:02 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 291 days 4 hours 17 mins 59 secs ago
+ Wed Mar 15 13:14:02 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 292 days 4 hours 17 mins 59 secs ago
+ Wed Mar 15 13:14:02 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 556 days 4 hours 5 mins 18 secs ago
+ Sun Dec 31 17:32:01 2000 PST | Thu Jan 01 00:00:00 1970 PST | @ 11322 days 17 hours 32 mins 1 sec
+ Sun Dec 31 17:32:01 2000 PST | Wed Feb 28 17:32:01 1996 PST | @ 1768 days
+ Sun Dec 31 17:32:01 2000 PST | Thu Feb 29 17:32:01 1996 PST | @ 1767 days
+ Sun Dec 31 17:32:01 2000 PST | Fri Mar 01 17:32:01 1996 PST | @ 1766 days
+ Sun Dec 31 17:32:01 2000 PST | Mon Dec 30 17:32:01 1996 PST | @ 1462 days
+ Sun Dec 31 17:32:01 2000 PST | Tue Dec 31 17:32:01 1996 PST | @ 1461 days
+ Sun Dec 31 17:32:01 2000 PST | Fri Dec 31 17:32:01 1999 PST | @ 366 days
+ Sun Dec 31 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST | @ 365 days
+ Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 02:14:05 2000 PST | @ 291 days 15 hours 17 mins 56 secs
+ Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 03:14:04 2000 PST | @ 291 days 14 hours 17 mins 57 secs
+ Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 08:14:01 2000 PST | @ 291 days 9 hours 18 mins
+ Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 12:14:03 2000 PST | @ 291 days 5 hours 17 mins 58 secs
+ Sun Dec 31 17:32:01 2000 PST | Wed Mar 15 13:14:02 2000 PST | @ 291 days 4 hours 17 mins 59 secs
+ Sun Dec 31 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST | @ 0
+ Sun Dec 31 17:32:01 2000 PST | Mon Jan 01 17:32:01 2001 PST | @ 1 day ago
+ Sun Dec 31 17:32:01 2000 PST | Sat Sep 22 18:19:20 2001 PDT | @ 264 days 23 hours 47 mins 19 secs ago
+ Mon Jan 01 17:32:01 2001 PST | Thu Jan 01 00:00:00 1970 PST | @ 11323 days 17 hours 32 mins 1 sec
+ Mon Jan 01 17:32:01 2001 PST | Wed Feb 28 17:32:01 1996 PST | @ 1769 days
+ Mon Jan 01 17:32:01 2001 PST | Thu Feb 29 17:32:01 1996 PST | @ 1768 days
+ Mon Jan 01 17:32:01 2001 PST | Fri Mar 01 17:32:01 1996 PST | @ 1767 days
+ Mon Jan 01 17:32:01 2001 PST | Mon Dec 30 17:32:01 1996 PST | @ 1463 days
+ Mon Jan 01 17:32:01 2001 PST | Tue Dec 31 17:32:01 1996 PST | @ 1462 days
+ Mon Jan 01 17:32:01 2001 PST | Fri Dec 31 17:32:01 1999 PST | @ 367 days
+ Mon Jan 01 17:32:01 2001 PST | Sat Jan 01 17:32:01 2000 PST | @ 366 days
+ Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 02:14:05 2000 PST | @ 292 days 15 hours 17 mins 56 secs
+ Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 03:14:04 2000 PST | @ 292 days 14 hours 17 mins 57 secs
+ Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 08:14:01 2000 PST | @ 292 days 9 hours 18 mins
+ Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 12:14:03 2000 PST | @ 292 days 5 hours 17 mins 58 secs
+ Mon Jan 01 17:32:01 2001 PST | Wed Mar 15 13:14:02 2000 PST | @ 292 days 4 hours 17 mins 59 secs
+ Mon Jan 01 17:32:01 2001 PST | Sun Dec 31 17:32:01 2000 PST | @ 1 day
+ Mon Jan 01 17:32:01 2001 PST | Mon Jan 01 17:32:01 2001 PST | @ 0
+ Mon Jan 01 17:32:01 2001 PST | Sat Sep 22 18:19:20 2001 PDT | @ 263 days 23 hours 47 mins 19 secs ago
+ Sat Sep 22 18:19:20 2001 PDT | Thu Jan 01 00:00:00 1970 PST | @ 11587 days 17 hours 19 mins 20 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Feb 28 17:32:01 1996 PST | @ 2032 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Thu Feb 29 17:32:01 1996 PST | @ 2031 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Fri Mar 01 17:32:01 1996 PST | @ 2030 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Mon Dec 30 17:32:01 1996 PST | @ 1726 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Tue Dec 31 17:32:01 1996 PST | @ 1725 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Fri Dec 31 17:32:01 1999 PST | @ 630 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Sat Jan 01 17:32:01 2000 PST | @ 629 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 02:14:05 2000 PST | @ 556 days 15 hours 5 mins 15 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 03:14:04 2000 PST | @ 556 days 14 hours 5 mins 16 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 08:14:01 2000 PST | @ 556 days 9 hours 5 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 12:14:03 2000 PST | @ 556 days 5 hours 5 mins 17 secs
+ Sat Sep 22 18:19:20 2001 PDT | Wed Mar 15 13:14:02 2000 PST | @ 556 days 4 hours 5 mins 18 secs
+ Sat Sep 22 18:19:20 2001 PDT | Sun Dec 31 17:32:01 2000 PST | @ 264 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Mon Jan 01 17:32:01 2001 PST | @ 263 days 23 hours 47 mins 19 secs
+ Sat Sep 22 18:19:20 2001 PDT | Sat Sep 22 18:19:20 2001 PDT | @ 0
+(256 rows)
+
+--
+-- Conversions
+--
+SELECT f1 AS "timestamp", date(f1) AS date
+ FROM TEMP_TIMESTAMP
+ WHERE f1 <> timestamp 'now'
+ ORDER BY date, "timestamp";
+ timestamp | date
+------------------------------+------------
+ Thu Jan 01 00:00:00 1970 PST | 01-01-1970
+ Wed Feb 28 17:32:01 1996 PST | 02-28-1996
+ Thu Feb 29 17:32:01 1996 PST | 02-29-1996
+ Fri Mar 01 17:32:01 1996 PST | 03-01-1996
+ Mon Dec 30 17:32:01 1996 PST | 12-30-1996
+ Tue Dec 31 17:32:01 1996 PST | 12-31-1996
+ Fri Dec 31 17:32:01 1999 PST | 12-31-1999
+ Sat Jan 01 17:32:01 2000 PST | 01-01-2000
+ Wed Mar 15 02:14:05 2000 PST | 03-15-2000
+ Wed Mar 15 03:14:04 2000 PST | 03-15-2000
+ Wed Mar 15 08:14:01 2000 PST | 03-15-2000
+ Wed Mar 15 12:14:03 2000 PST | 03-15-2000
+ Wed Mar 15 13:14:02 2000 PST | 03-15-2000
+ Sun Dec 31 17:32:01 2000 PST | 12-31-2000
+ Mon Jan 01 17:32:01 2001 PST | 01-01-2001
+ Sat Sep 22 18:19:20 2001 PDT | 09-22-2001
+(16 rows)
+
+DROP TABLE TEMP_TIMESTAMP;
+--
+-- Comparisons between datetime types, especially overflow cases
+---
+SELECT '2202020-10-05'::date::timestamp; -- fail
+ERROR: date out of range for timestamp
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
+ f
+---
+ f
+(1 row)
+
+SELECT '2202020-10-05'::date::timestamptz; -- fail
+ERROR: date out of range for timestamp
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
+ f
+---
+ f
+(1 row)
+
+-- This conversion may work depending on timezone
+SELECT '4714-11-24 BC'::date::timestamptz;
+ timestamptz
+---------------------------------
+ Mon Nov 24 00:00:00 4714 PST BC
+(1 row)
+
+SET TimeZone = 'UTC-2';
+SELECT '4714-11-24 BC'::date::timestamptz; -- fail
+ERROR: date out of range for timestamp
+SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
+ t
+---
+ t
+(1 row)
+
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
+ t
+---
+ t
+(1 row)
+
+RESET TimeZone;
+--
+-- Formats
+--
+SET DateStyle TO 'US,Postgres';
+SHOW DateStyle;
+ DateStyle
+---------------
+ Postgres, MDY
+(1 row)
+
+SELECT d1 AS us_postgres FROM TIMESTAMP_TBL;
+ us_postgres
+-----------------------------
+ -infinity
+ infinity
+ Thu Jan 01 00:00:00 1970
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:02 1997
+ Mon Feb 10 17:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997
+ Thu Jan 02 00:00:00 1997
+ Thu Jan 02 03:04:05 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 17:32:01 1997
+ Sat Sep 22 18:19:20 2001
+ Wed Mar 15 08:14:01 2000
+ Wed Mar 15 13:14:02 2000
+ Wed Mar 15 12:14:03 2000
+ Wed Mar 15 03:14:04 2000
+ Wed Mar 15 02:14:05 2000
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:00 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 18:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Feb 11 17:32:01 1997
+ Wed Feb 12 17:32:01 1997
+ Thu Feb 13 17:32:01 1997
+ Fri Feb 14 17:32:01 1997
+ Sat Feb 15 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Tue Feb 16 17:32:01 0097 BC
+ Sat Feb 16 17:32:01 0097
+ Thu Feb 16 17:32:01 0597
+ Tue Feb 16 17:32:01 1097
+ Sat Feb 16 17:32:01 1697
+ Thu Feb 16 17:32:01 1797
+ Tue Feb 16 17:32:01 1897
+ Sun Feb 16 17:32:01 1997
+ Sat Feb 16 17:32:01 2097
+ Wed Feb 28 17:32:01 1996
+ Thu Feb 29 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Wed Jan 01 17:32:01 1997
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+(65 rows)
+
+SET DateStyle TO 'US,ISO';
+SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
+ us_iso
+------------------------
+ -infinity
+ infinity
+ 1970-01-01 00:00:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:02
+ 1997-02-10 17:32:01.4
+ 1997-02-10 17:32:01.5
+ 1997-02-10 17:32:01.6
+ 1997-01-02 00:00:00
+ 1997-01-02 03:04:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 17:32:01
+ 2001-09-22 18:19:20
+ 2000-03-15 08:14:01
+ 2000-03-15 13:14:02
+ 2000-03-15 12:14:03
+ 2000-03-15 03:14:04
+ 2000-03-15 02:14:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 18:32:01
+ 1997-02-10 17:32:01
+ 1997-02-11 17:32:01
+ 1997-02-12 17:32:01
+ 1997-02-13 17:32:01
+ 1997-02-14 17:32:01
+ 1997-02-15 17:32:01
+ 1997-02-16 17:32:01
+ 0097-02-16 17:32:01 BC
+ 0097-02-16 17:32:01
+ 0597-02-16 17:32:01
+ 1097-02-16 17:32:01
+ 1697-02-16 17:32:01
+ 1797-02-16 17:32:01
+ 1897-02-16 17:32:01
+ 1997-02-16 17:32:01
+ 2097-02-16 17:32:01
+ 1996-02-28 17:32:01
+ 1996-02-29 17:32:01
+ 1996-03-01 17:32:01
+ 1996-12-30 17:32:01
+ 1996-12-31 17:32:01
+ 1997-01-01 17:32:01
+ 1997-02-28 17:32:01
+ 1997-03-01 17:32:01
+ 1997-12-30 17:32:01
+ 1997-12-31 17:32:01
+ 1999-12-31 17:32:01
+ 2000-01-01 17:32:01
+ 2000-12-31 17:32:01
+ 2001-01-01 17:32:01
+(65 rows)
+
+SET DateStyle TO 'US,SQL';
+SHOW DateStyle;
+ DateStyle
+-----------
+ SQL, MDY
+(1 row)
+
+SELECT d1 AS us_sql FROM TIMESTAMP_TBL;
+ us_sql
+------------------------
+ -infinity
+ infinity
+ 01/01/1970 00:00:00
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:02
+ 02/10/1997 17:32:01.4
+ 02/10/1997 17:32:01.5
+ 02/10/1997 17:32:01.6
+ 01/02/1997 00:00:00
+ 01/02/1997 03:04:05
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 06/10/1997 17:32:01
+ 09/22/2001 18:19:20
+ 03/15/2000 08:14:01
+ 03/15/2000 13:14:02
+ 03/15/2000 12:14:03
+ 03/15/2000 03:14:04
+ 03/15/2000 02:14:05
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:00
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 02/10/1997 17:32:01
+ 06/10/1997 18:32:01
+ 02/10/1997 17:32:01
+ 02/11/1997 17:32:01
+ 02/12/1997 17:32:01
+ 02/13/1997 17:32:01
+ 02/14/1997 17:32:01
+ 02/15/1997 17:32:01
+ 02/16/1997 17:32:01
+ 02/16/0097 17:32:01 BC
+ 02/16/0097 17:32:01
+ 02/16/0597 17:32:01
+ 02/16/1097 17:32:01
+ 02/16/1697 17:32:01
+ 02/16/1797 17:32:01
+ 02/16/1897 17:32:01
+ 02/16/1997 17:32:01
+ 02/16/2097 17:32:01
+ 02/28/1996 17:32:01
+ 02/29/1996 17:32:01
+ 03/01/1996 17:32:01
+ 12/30/1996 17:32:01
+ 12/31/1996 17:32:01
+ 01/01/1997 17:32:01
+ 02/28/1997 17:32:01
+ 03/01/1997 17:32:01
+ 12/30/1997 17:32:01
+ 12/31/1997 17:32:01
+ 12/31/1999 17:32:01
+ 01/01/2000 17:32:01
+ 12/31/2000 17:32:01
+ 01/01/2001 17:32:01
+(65 rows)
+
+SET DateStyle TO 'European,Postgres';
+SHOW DateStyle;
+ DateStyle
+---------------
+ Postgres, DMY
+(1 row)
+
+INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
+SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
+ one
+-----
+ 1
+(1 row)
+
+SELECT d1 AS european_postgres FROM TIMESTAMP_TBL;
+ european_postgres
+-----------------------------
+ -infinity
+ infinity
+ Thu 01 Jan 00:00:00 1970
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:02 1997
+ Mon 10 Feb 17:32:01.4 1997
+ Mon 10 Feb 17:32:01.5 1997
+ Mon 10 Feb 17:32:01.6 1997
+ Thu 02 Jan 00:00:00 1997
+ Thu 02 Jan 03:04:05 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Tue 10 Jun 17:32:01 1997
+ Sat 22 Sep 18:19:20 2001
+ Wed 15 Mar 08:14:01 2000
+ Wed 15 Mar 13:14:02 2000
+ Wed 15 Mar 12:14:03 2000
+ Wed 15 Mar 03:14:04 2000
+ Wed 15 Mar 02:14:05 2000
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:00 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Tue 10 Jun 18:32:01 1997
+ Mon 10 Feb 17:32:01 1997
+ Tue 11 Feb 17:32:01 1997
+ Wed 12 Feb 17:32:01 1997
+ Thu 13 Feb 17:32:01 1997
+ Fri 14 Feb 17:32:01 1997
+ Sat 15 Feb 17:32:01 1997
+ Sun 16 Feb 17:32:01 1997
+ Tue 16 Feb 17:32:01 0097 BC
+ Sat 16 Feb 17:32:01 0097
+ Thu 16 Feb 17:32:01 0597
+ Tue 16 Feb 17:32:01 1097
+ Sat 16 Feb 17:32:01 1697
+ Thu 16 Feb 17:32:01 1797
+ Tue 16 Feb 17:32:01 1897
+ Sun 16 Feb 17:32:01 1997
+ Sat 16 Feb 17:32:01 2097
+ Wed 28 Feb 17:32:01 1996
+ Thu 29 Feb 17:32:01 1996
+ Fri 01 Mar 17:32:01 1996
+ Mon 30 Dec 17:32:01 1996
+ Tue 31 Dec 17:32:01 1996
+ Wed 01 Jan 17:32:01 1997
+ Fri 28 Feb 17:32:01 1997
+ Sat 01 Mar 17:32:01 1997
+ Tue 30 Dec 17:32:01 1997
+ Wed 31 Dec 17:32:01 1997
+ Fri 31 Dec 17:32:01 1999
+ Sat 01 Jan 17:32:01 2000
+ Sun 31 Dec 17:32:01 2000
+ Mon 01 Jan 17:32:01 2001
+ Thu 13 Jun 00:00:00 1957
+(66 rows)
+
+SET DateStyle TO 'European,ISO';
+SHOW DateStyle;
+ DateStyle
+-----------
+ ISO, DMY
+(1 row)
+
+SELECT d1 AS european_iso FROM TIMESTAMP_TBL;
+ european_iso
+------------------------
+ -infinity
+ infinity
+ 1970-01-01 00:00:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:02
+ 1997-02-10 17:32:01.4
+ 1997-02-10 17:32:01.5
+ 1997-02-10 17:32:01.6
+ 1997-01-02 00:00:00
+ 1997-01-02 03:04:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 17:32:01
+ 2001-09-22 18:19:20
+ 2000-03-15 08:14:01
+ 2000-03-15 13:14:02
+ 2000-03-15 12:14:03
+ 2000-03-15 03:14:04
+ 2000-03-15 02:14:05
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:00
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-02-10 17:32:01
+ 1997-06-10 18:32:01
+ 1997-02-10 17:32:01
+ 1997-02-11 17:32:01
+ 1997-02-12 17:32:01
+ 1997-02-13 17:32:01
+ 1997-02-14 17:32:01
+ 1997-02-15 17:32:01
+ 1997-02-16 17:32:01
+ 0097-02-16 17:32:01 BC
+ 0097-02-16 17:32:01
+ 0597-02-16 17:32:01
+ 1097-02-16 17:32:01
+ 1697-02-16 17:32:01
+ 1797-02-16 17:32:01
+ 1897-02-16 17:32:01
+ 1997-02-16 17:32:01
+ 2097-02-16 17:32:01
+ 1996-02-28 17:32:01
+ 1996-02-29 17:32:01
+ 1996-03-01 17:32:01
+ 1996-12-30 17:32:01
+ 1996-12-31 17:32:01
+ 1997-01-01 17:32:01
+ 1997-02-28 17:32:01
+ 1997-03-01 17:32:01
+ 1997-12-30 17:32:01
+ 1997-12-31 17:32:01
+ 1999-12-31 17:32:01
+ 2000-01-01 17:32:01
+ 2000-12-31 17:32:01
+ 2001-01-01 17:32:01
+ 1957-06-13 00:00:00
+(66 rows)
+
+SET DateStyle TO 'European,SQL';
+SHOW DateStyle;
+ DateStyle
+-----------
+ SQL, DMY
+(1 row)
+
+SELECT d1 AS european_sql FROM TIMESTAMP_TBL;
+ european_sql
+------------------------
+ -infinity
+ infinity
+ 01/01/1970 00:00:00
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:02
+ 10/02/1997 17:32:01.4
+ 10/02/1997 17:32:01.5
+ 10/02/1997 17:32:01.6
+ 02/01/1997 00:00:00
+ 02/01/1997 03:04:05
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/06/1997 17:32:01
+ 22/09/2001 18:19:20
+ 15/03/2000 08:14:01
+ 15/03/2000 13:14:02
+ 15/03/2000 12:14:03
+ 15/03/2000 03:14:04
+ 15/03/2000 02:14:05
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:00
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/02/1997 17:32:01
+ 10/06/1997 18:32:01
+ 10/02/1997 17:32:01
+ 11/02/1997 17:32:01
+ 12/02/1997 17:32:01
+ 13/02/1997 17:32:01
+ 14/02/1997 17:32:01
+ 15/02/1997 17:32:01
+ 16/02/1997 17:32:01
+ 16/02/0097 17:32:01 BC
+ 16/02/0097 17:32:01
+ 16/02/0597 17:32:01
+ 16/02/1097 17:32:01
+ 16/02/1697 17:32:01
+ 16/02/1797 17:32:01
+ 16/02/1897 17:32:01
+ 16/02/1997 17:32:01
+ 16/02/2097 17:32:01
+ 28/02/1996 17:32:01
+ 29/02/1996 17:32:01
+ 01/03/1996 17:32:01
+ 30/12/1996 17:32:01
+ 31/12/1996 17:32:01
+ 01/01/1997 17:32:01
+ 28/02/1997 17:32:01
+ 01/03/1997 17:32:01
+ 30/12/1997 17:32:01
+ 31/12/1997 17:32:01
+ 31/12/1999 17:32:01
+ 01/01/2000 17:32:01
+ 31/12/2000 17:32:01
+ 01/01/2001 17:32:01
+ 13/06/1957 00:00:00
+(66 rows)
+
+RESET DateStyle;
+--
+-- to_timestamp()
+--
+SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
+ to_timestamp
+------------------------------
+ Sat Feb 16 08:14:30 0097 PST
+(1 row)
+
+SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
+ to_timestamp
+------------------------------
+ Sat Feb 16 08:14:30 0097 PST
+(1 row)
+
+SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Fri Mar 18 23:38:15 2011 PDT
+(1 row)
+
+SELECT to_timestamp('1985 January 12', 'YYYY FMMonth DD');
+ to_timestamp
+------------------------------
+ Sat Jan 12 00:00:00 1985 PST
+(1 row)
+
+SELECT to_timestamp('1985 FMMonth 12', 'YYYY "FMMonth" DD');
+ to_timestamp
+------------------------------
+ Sat Jan 12 00:00:00 1985 PST
+(1 row)
+
+SELECT to_timestamp('1985 \ 12', 'YYYY \\ DD');
+ to_timestamp
+------------------------------
+ Sat Jan 12 00:00:00 1985 PST
+(1 row)
+
+SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
+ '"My birthday-> Year:" YYYY, "Month:" FMMonth, "Day:" DD');
+ to_timestamp
+------------------------------
+ Sun May 16 00:00:00 1976 PDT
+(1 row)
+
+SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
+ to_timestamp
+------------------------------
+ Sat Aug 21 00:00:00 1582 PST
+(1 row)
+
+SELECT to_timestamp('15 "text between quote marks" 98 54 45',
+ E'HH24 "\\"text between quote marks\\"" YY MI SS');
+ to_timestamp
+------------------------------
+ Thu Jan 01 15:54:45 1998 PST
+(1 row)
+
+SELECT to_timestamp('05121445482000', 'MMDDHH24MISSYYYY');
+ to_timestamp
+------------------------------
+ Fri May 12 14:45:48 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000January09Sunday', 'YYYYFMMonthDDFMDay');
+ to_timestamp
+------------------------------
+ Sun Jan 09 00:00:00 2000 PST
+(1 row)
+
+SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+ERROR: invalid value "/Feb/16" for "Mon"
+DETAIL: The given value did not match any of the allowed values for this field.
+SELECT to_timestamp('97/Feb/16', 'YY:Mon:DD');
+ to_timestamp
+------------------------------
+ Sun Feb 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
+ to_timestamp
+------------------------------
+ Sun Feb 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('97/Feb/16', 'FXYY/Mon/DD');
+ to_timestamp
+------------------------------
+ Sun Feb 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('19971116', 'YYYYMMDD');
+ to_timestamp
+------------------------------
+ Sun Nov 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('20000-1116', 'YYYY-MMDD');
+ to_timestamp
+-------------------------------
+ Thu Nov 16 00:00:00 20000 PST
+(1 row)
+
+SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
+ to_timestamp
+------------------------------
+ Sun Nov 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
+ to_timestamp
+---------------------------------
+ Tue Nov 16 00:00:00 1997 PST BC
+(1 row)
+
+SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
+ to_timestamp
+------------------------------
+ Sun Nov 16 00:00:00 1997 PST
+(1 row)
+
+SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
+ to_timestamp
+---------------------------------
+ Tue Nov 16 00:00:00 1997 PST BC
+(1 row)
+
+SELECT to_timestamp('9-1116', 'Y-MMDD');
+ to_timestamp
+------------------------------
+ Mon Nov 16 00:00:00 2009 PST
+(1 row)
+
+SELECT to_timestamp('95-1116', 'YY-MMDD');
+ to_timestamp
+------------------------------
+ Thu Nov 16 00:00:00 1995 PST
+(1 row)
+
+SELECT to_timestamp('995-1116', 'YYY-MMDD');
+ to_timestamp
+------------------------------
+ Thu Nov 16 00:00:00 1995 PST
+(1 row)
+
+SELECT to_timestamp('2005426', 'YYYYWWD');
+ to_timestamp
+------------------------------
+ Sat Oct 15 00:00:00 2005 PDT
+(1 row)
+
+SELECT to_timestamp('2005300', 'YYYYDDD');
+ to_timestamp
+------------------------------
+ Thu Oct 27 00:00:00 2005 PDT
+(1 row)
+
+SELECT to_timestamp('2005527', 'IYYYIWID');
+ to_timestamp
+------------------------------
+ Sun Jan 01 00:00:00 2006 PST
+(1 row)
+
+SELECT to_timestamp('005527', 'IYYIWID');
+ to_timestamp
+------------------------------
+ Sun Jan 01 00:00:00 2006 PST
+(1 row)
+
+SELECT to_timestamp('05527', 'IYIWID');
+ to_timestamp
+------------------------------
+ Sun Jan 01 00:00:00 2006 PST
+(1 row)
+
+SELECT to_timestamp('5527', 'IIWID');
+ to_timestamp
+------------------------------
+ Sun Jan 01 00:00:00 2006 PST
+(1 row)
+
+SELECT to_timestamp('2005364', 'IYYYIDDD');
+ to_timestamp
+------------------------------
+ Sun Jan 01 00:00:00 2006 PST
+(1 row)
+
+SELECT to_timestamp('20050302', 'YYYYMMDD');
+ to_timestamp
+------------------------------
+ Wed Mar 02 00:00:00 2005 PST
+(1 row)
+
+SELECT to_timestamp('2005 03 02', 'YYYYMMDD');
+ to_timestamp
+------------------------------
+ Wed Mar 02 00:00:00 2005 PST
+(1 row)
+
+SELECT to_timestamp(' 2005 03 02', 'YYYYMMDD');
+ to_timestamp
+------------------------------
+ Wed Mar 02 00:00:00 2005 PST
+(1 row)
+
+SELECT to_timestamp(' 20050302', 'YYYYMMDD');
+ to_timestamp
+------------------------------
+ Wed Mar 02 00:00:00 2005 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 AM', 'YYYY-MM-DD HH12:MI PM');
+ to_timestamp
+------------------------------
+ Sun Dec 18 11:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 PM', 'YYYY-MM-DD HH12:MI PM');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 A.M.', 'YYYY-MM-DD HH12:MI P.M.');
+ to_timestamp
+------------------------------
+ Sun Dec 18 11:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 P.M.', 'YYYY-MM-DD HH12:MI P.M.');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 +05', 'YYYY-MM-DD HH12:MI TZH');
+ to_timestamp
+------------------------------
+ Sat Dec 17 22:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
+ to_timestamp
+------------------------------
+ Sun Dec 18 08:38:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+ to_timestamp
+------------------------------
+ Sat Dec 17 22:18:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+ to_timestamp
+------------------------------
+ Sun Dec 18 08:58:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
+ to_timestamp
+------------------------------
+ Sun Dec 18 03:18:00 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+ERROR: formatting field "TZ" is only supported in to_char
+SELECT to_timestamp('2018-11-02 12:34:56.025', 'YYYY-MM-DD HH24:MI:SS.MS');
+ to_timestamp
+----------------------------------
+ Fri Nov 02 12:34:56.025 2018 PDT
+(1 row)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+------------------------------
+ 1 | Fri Nov 02 12:34:56 2018 PDT
+ 2 | Fri Nov 02 12:34:56 2018 PDT
+ 3 | Fri Nov 02 12:34:56 2018 PDT
+ 4 | Fri Nov 02 12:34:56 2018 PDT
+ 5 | Fri Nov 02 12:34:56 2018 PDT
+ 6 | Fri Nov 02 12:34:56 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+--------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.1 2018 PDT
+ 3 | Fri Nov 02 12:34:56.1 2018 PDT
+ 4 | Fri Nov 02 12:34:56.1 2018 PDT
+ 5 | Fri Nov 02 12:34:56.1 2018 PDT
+ 6 | Fri Nov 02 12:34:56.1 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+---------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.12 2018 PDT
+ 3 | Fri Nov 02 12:34:56.12 2018 PDT
+ 4 | Fri Nov 02 12:34:56.12 2018 PDT
+ 5 | Fri Nov 02 12:34:56.12 2018 PDT
+ 6 | Fri Nov 02 12:34:56.12 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+----------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.12 2018 PDT
+ 3 | Fri Nov 02 12:34:56.123 2018 PDT
+ 4 | Fri Nov 02 12:34:56.123 2018 PDT
+ 5 | Fri Nov 02 12:34:56.123 2018 PDT
+ 6 | Fri Nov 02 12:34:56.123 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+-----------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.12 2018 PDT
+ 3 | Fri Nov 02 12:34:56.123 2018 PDT
+ 4 | Fri Nov 02 12:34:56.1234 2018 PDT
+ 5 | Fri Nov 02 12:34:56.1234 2018 PDT
+ 6 | Fri Nov 02 12:34:56.1234 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+------------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.12 2018 PDT
+ 3 | Fri Nov 02 12:34:56.123 2018 PDT
+ 4 | Fri Nov 02 12:34:56.1235 2018 PDT
+ 5 | Fri Nov 02 12:34:56.12345 2018 PDT
+ 6 | Fri Nov 02 12:34:56.12345 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ i | to_timestamp
+---+-------------------------------------
+ 1 | Fri Nov 02 12:34:56.1 2018 PDT
+ 2 | Fri Nov 02 12:34:56.12 2018 PDT
+ 3 | Fri Nov 02 12:34:56.123 2018 PDT
+ 4 | Fri Nov 02 12:34:56.1235 2018 PDT
+ 5 | Fri Nov 02 12:34:56.12346 2018 PDT
+ 6 | Fri Nov 02 12:34:56.123456 2018 PDT
+(6 rows)
+
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+ERROR: date/time field value out of range: "2018-11-02 12:34:56.123456789"
+SELECT to_date('1 4 1902', 'Q MM YYYY'); -- Q is ignored
+ to_date
+------------
+ 04-01-1902
+(1 row)
+
+SELECT to_date('3 4 21 01', 'W MM CC YY');
+ to_date
+------------
+ 04-15-2001
+(1 row)
+
+SELECT to_date('2458872', 'J');
+ to_date
+------------
+ 01-23-2020
+(1 row)
+
+--
+-- Check handling of BC dates
+--
+SELECT to_date('44-02-01 BC','YYYY-MM-DD BC');
+ to_date
+---------------
+ 02-01-0044 BC
+(1 row)
+
+SELECT to_date('-44-02-01','YYYY-MM-DD');
+ to_date
+---------------
+ 02-01-0044 BC
+(1 row)
+
+SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
+ to_date
+------------
+ 02-01-0044
+(1 row)
+
+SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+ to_timestamp
+---------------------------------
+ Fri Feb 01 11:12:13 0044 PST BC
+(1 row)
+
+SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+---------------------------------
+ Fri Feb 01 11:12:13 0044 PST BC
+(1 row)
+
+SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+ to_timestamp
+------------------------------
+ Mon Feb 01 11:12:13 0044 PST
+(1 row)
+
+--
+-- Check handling of multiple spaces in format and/or input
+--
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+ to_timestamp
+------------------------------
+ Sun Dec 18 23:38:15 2011 PST
+(1 row)
+
+SELECT to_timestamp('2000+ JUN', 'YYYY/MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp(' 2000 +JUN', 'YYYY/MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp(' 2000 +JUN', 'YYYY//MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000 +JUN', 'YYYY//MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000 + JUN', 'YYYY MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000 ++ JUN', 'YYYY MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+ERROR: invalid value "+" for "MON"
+DETAIL: The given value did not match any of the allowed values for this field.
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+ to_timestamp
+------------------------------
+ Thu Jun 01 00:00:00 2000 PDT
+(1 row)
+
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+ to_timestamp
+------------------------------
+ Sat Jan 01 02:00:00 2000 PST
+(1 row)
+
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+ to_timestamp
+------------------------------
+ Fri Dec 31 06:00:00 1999 PST
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 12 18', 'YYYYxMMxDD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011x 12x 18', 'YYYYxMMxDD');
+ to_date
+------------
+ 12-18-2011
+(1 row)
+
+SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+ERROR: invalid value "x1" for "MM"
+DETAIL: Value must be an integer.
+--
+-- Check errors for some incorrect usages of to_timestamp() and to_date()
+--
+-- Mixture of date conventions (ISO week and Gregorian):
+SELECT to_timestamp('2005527', 'YYYYIWID');
+ERROR: invalid combination of date conventions
+HINT: Do not mix Gregorian and ISO week date conventions in a formatting template.
+-- Insufficient characters in the source string:
+SELECT to_timestamp('19971', 'YYYYMMDD');
+ERROR: source string too short for "MM" formatting field
+DETAIL: Field requires 2 characters, but only 1 remain.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+-- Insufficient digit characters for a single node:
+SELECT to_timestamp('19971)24', 'YYYYMMDD');
+ERROR: invalid value "1)" for "MM"
+DETAIL: Field requires 2 characters, but only 1 could be parsed.
+HINT: If your source string is not fixed-width, try using the "FM" modifier.
+-- We don't accept full-length day or month names if short form is specified:
+SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
+ERROR: invalid value "da" for "DD"
+DETAIL: Value must be an integer.
+SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+ERROR: invalid value "uary" for "YYYY"
+DETAIL: Value must be an integer.
+SELECT to_timestamp('Fri 1-Jan-1999', 'DY DD MON YYYY'); -- ok
+ to_timestamp
+------------------------------
+ Fri Jan 01 00:00:00 1999 PST
+(1 row)
+
+-- Value clobbering:
+SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
+ERROR: conflicting values for "Mon" field in formatting string
+DETAIL: This value contradicts a previous setting for the same field type.
+-- Non-numeric input:
+SELECT to_timestamp('199711xy', 'YYYYMMDD');
+ERROR: invalid value "xy" for "DD"
+DETAIL: Value must be an integer.
+-- Input that doesn't fit in an int:
+SELECT to_timestamp('10000000000', 'FMYYYY');
+ERROR: value for "YYYY" in source string is out of range
+DETAIL: Value must be in the range -2147483648 to 2147483647.
+-- Out-of-range and not-quite-out-of-range fields:
+SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 25:00:00"
+SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 15:60:00"
+SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-06-13 15:50:60"
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+ to_timestamp
+------------------------------
+ Mon Jun 13 15:50:55 2016 PDT
+(1 row)
+
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+ERROR: hour "15" is invalid for the 12-hour clock
+HINT: Use the 24-hour clock, or give an hour between 1 and 12.
+SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-13-01 15:50:55"
+SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2016-02-30 15:50:55"
+SELECT to_timestamp('2016-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+ to_timestamp
+------------------------------
+ Mon Feb 29 15:50:55 2016 PST
+(1 row)
+
+SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+ERROR: date/time field value out of range: "2015-02-29 15:50:55"
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSS'); -- ok
+ to_timestamp
+------------------------------
+ Wed Feb 11 23:53:20 2015 PST
+(1 row)
+
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+ERROR: date/time field value out of range: "2015-02-11 86400"
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSSS'); -- ok
+ to_timestamp
+------------------------------
+ Wed Feb 11 23:53:20 2015 PST
+(1 row)
+
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+ERROR: date/time field value out of range: "2015-02-11 86400"
+SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2016-13-10"
+SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2016-02-30"
+SELECT to_date('2016-02-29', 'YYYY-MM-DD'); -- ok
+ to_date
+------------
+ 02-29-2016
+(1 row)
+
+SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+ERROR: date/time field value out of range: "2015-02-29"
+SELECT to_date('2015 365', 'YYYY DDD'); -- ok
+ to_date
+------------
+ 12-31-2015
+(1 row)
+
+SELECT to_date('2015 366', 'YYYY DDD');
+ERROR: date/time field value out of range: "2015 366"
+SELECT to_date('2016 365', 'YYYY DDD'); -- ok
+ to_date
+------------
+ 12-30-2016
+(1 row)
+
+SELECT to_date('2016 366', 'YYYY DDD'); -- ok
+ to_date
+------------
+ 12-31-2016
+(1 row)
+
+SELECT to_date('2016 367', 'YYYY DDD');
+ERROR: date/time field value out of range: "2016 367"
+SELECT to_date('0000-02-01','YYYY-MM-DD'); -- allowed, though it shouldn't be
+ to_date
+---------------
+ 02-01-0001 BC
+(1 row)
+
+--
+-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
+--
+SET TIME ZONE 'America/New_York';
+SET TIME ZONE '-1.5';
+SHOW TIME ZONE;
+ TimeZone
+----------------
+ <-01:30>+01:30
+(1 row)
+
+SELECT '2012-12-12 12:00'::timestamptz;
+ timestamptz
+---------------------------------
+ Wed Dec 12 12:00:00 2012 -01:30
+(1 row)
+
+SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
+ timestamptz
+---------------------------------
+ Wed Dec 12 15:30:00 2012 -01:30
+(1 row)
+
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
+ to_char
+----------------------------
+ 2012-12-12 12:00:00 -01:30
+(1 row)
+
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
+ to_char
+------------------
+ 2012-12-12 43200
+(1 row)
+
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
+ to_char
+------------------
+ 2012-12-12 43200
+(1 row)
+
+RESET TIME ZONE;
diff --git a/yql/essentials/tests/postgresql/original/cases/horology.sql b/yql/essentials/tests/postgresql/original/cases/horology.sql
new file mode 100644
index 0000000000..78091112ca
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/horology.sql
@@ -0,0 +1,570 @@
+--
+-- HOROLOGY
+--
+SET DateStyle = 'Postgres, MDY';
+
+SHOW TimeZone; -- Many of these tests depend on the prevailing setting
+
+--
+-- Test various input formats
+--
+SELECT timestamp with time zone '20011227 040506+08';
+SELECT timestamp with time zone '20011227 040506-08';
+SELECT timestamp with time zone '20011227 040506.789+08';
+SELECT timestamp with time zone '20011227 040506.789-08';
+SELECT timestamp with time zone '20011227T040506+08';
+SELECT timestamp with time zone '20011227T040506-08';
+SELECT timestamp with time zone '20011227T040506.789+08';
+SELECT timestamp with time zone '20011227T040506.789-08';
+SELECT timestamp with time zone '2001-12-27 04:05:06.789-08';
+SELECT timestamp with time zone '2001.12.27 04:05:06.789-08';
+SELECT timestamp with time zone '2001/12/27 04:05:06.789-08';
+SELECT timestamp with time zone '12/27/2001 04:05:06.789-08';
+-- should fail in mdy mode:
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+set datestyle to dmy;
+SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
+reset datestyle;
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08';
+SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789-08';
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789+08';
+SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-08';
+SELECT timestamp with time zone 'J2452271+08';
+SELECT timestamp with time zone 'J2452271-08';
+SELECT timestamp with time zone 'J2452271.5+08';
+SELECT timestamp with time zone 'J2452271.5-08';
+SELECT timestamp with time zone 'J2452271 04:05:06+08';
+SELECT timestamp with time zone 'J2452271 04:05:06-08';
+SELECT timestamp with time zone 'J2452271T040506+08';
+SELECT timestamp with time zone 'J2452271T040506-08';
+SELECT timestamp with time zone 'J2452271T040506.789+08';
+SELECT timestamp with time zone 'J2452271T040506.789-08';
+-- German/European-style dates with periods as delimiters
+SELECT timestamp with time zone '12.27.2001 04:05:06.789+08';
+SELECT timestamp with time zone '12.27.2001 04:05:06.789-08';
+SET DateStyle = 'German';
+SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
+SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
+SET DateStyle = 'ISO';
+-- As of 7.4, allow time without time zone having a time zone specified
+SELECT time without time zone '040506.789+08';
+SELECT time without time zone '040506.789-08';
+SELECT time without time zone 'T040506.789+08';
+SELECT time without time zone 'T040506.789-08';
+SELECT time with time zone '040506.789+08';
+SELECT time with time zone '040506.789-08';
+SELECT time with time zone 'T040506.789+08';
+SELECT time with time zone 'T040506.789-08';
+SELECT time with time zone 'T040506.789 +08';
+SELECT time with time zone 'T040506.789 -08';
+SET DateStyle = 'Postgres, MDY';
+-- Check Julian dates BC
+SELECT date 'J1520447' AS "Confucius' Birthday";
+SELECT date 'J0' AS "Julian Epoch";
+
+--
+-- date, time arithmetic
+--
+
+SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
+SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
+SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
+SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
+SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
+-- subtract time from date should not make sense; use interval instead
+SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
+SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
+
+--
+-- timestamp, interval arithmetic
+--
+
+SELECT timestamp without time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+SELECT timestamp without time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+SELECT timestamp without time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+SELECT timestamp without time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
+SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
+SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
+
+-- Shorthand values
+-- Not directly usable for regression testing since these are not constants.
+-- So, just try to test parser and hope for the best - thomas 97/04/26
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
+SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
+SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
+SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
+SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
+SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
+SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
+
+-- Convert from date and time to timestamp
+-- This test used to be timestamp(date,time) but no longer allowed by grammar
+-- to enable support for SQL99 timestamp type syntax.
+SELECT date '1994-01-01' + time '11:00' AS "Jan_01_1994_11am";
+SELECT date '1994-01-01' + time '10:00' AS "Jan_01_1994_10am";
+SELECT date '1994-01-01' + timetz '11:00-5' AS "Jan_01_1994_8am";
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMP_TBL;
+
+SELECT timestamp with time zone '1996-03-01' - interval '1 second' AS "Feb 29";
+SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
+SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
+SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
+
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
+SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
+SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
+SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
+
+-- timestamp with time zone, interval arithmetic around DST change
+-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
+SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
+SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
+SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
+RESET TIME ZONE;
+
+
+SELECT timestamptz(date '1994-01-01', time '11:00') AS "Jan_01_1994_10am";
+SELECT timestamptz(date '1994-01-01', time '10:00') AS "Jan_01_1994_9am";
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-8') AS "Jan_01_1994_11am";
+SELECT timestamptz(date '1994-01-01', time with time zone '10:00-8') AS "Jan_01_1994_10am";
+SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
+
+SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
+
+--
+-- time, interval arithmetic
+--
+
+SELECT CAST(time '01:02' AS interval) AS "+01:02";
+SELECT CAST(interval '02:03' AS time) AS "02:03:00";
+SELECT time '01:30' + interval '02:01' AS "03:31:00";
+SELECT time '01:30' - interval '02:01' AS "23:29:00";
+SELECT time '02:30' + interval '36:01' AS "14:31:00";
+SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
+SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
+SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
+SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
+SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
+
+-- These two tests cannot be used because they default to current timezone,
+-- which may be either -08 or -07 depending on the time of year.
+-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
+-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
+-- Try the following two tests instead, as a poor substitute
+
+SELECT CAST(CAST(date 'today' + time with time zone '05:30'
+ + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
+
+SELECT CAST(cast(date 'today' + time with time zone '03:30'
+ + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
+
+SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract"
+ FROM TIMESTAMP_TBL t, INTERVAL_TBL i
+ WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01'
+ AND i.f1 BETWEEN '00:00' AND '23:00'
+ ORDER BY 1,2;
+
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIME_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+
+SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
+ FROM TIMETZ_TBL t, INTERVAL_TBL i
+ ORDER BY 1,2;
+
+-- SQL9x OVERLAPS operator
+-- test with time zone
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
+
+SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+
+SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
+
+SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+
+-- test without time zone
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
+
+SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+
+SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
+
+SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
+ OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
+
+-- test time and interval
+SELECT (time '00:00', time '01:00')
+ OVERLAPS (time '00:30', time '01:30') AS "True";
+
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '00:30', interval '1 hour') AS "True";
+
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 hour') AS "False";
+
+-- SQL99 seems to want this to be false (and we conform to the spec).
+-- istm that this *should* return true, on the theory that time
+-- intervals can wrap around the day boundary - thomas 2001-09-25
+SELECT (time '00:00', interval '1 hour')
+ OVERLAPS (time '01:30', interval '1 day') AS "False";
+
+CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
+
+-- get some candidate input values
+
+INSERT INTO TEMP_TIMESTAMP (f1)
+ SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
+ OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
+
+SELECT f1 AS "timestamp"
+ FROM TEMP_TIMESTAMP
+ ORDER BY "timestamp";
+
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 + t.f1 AS plus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ ORDER BY plus, "timestamp", "interval";
+
+SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 - t.f1 AS minus
+ FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
+ WHERE isfinite(d.f1)
+ ORDER BY minus, "timestamp", "interval";
+
+SELECT d.f1 AS "timestamp",
+ timestamp with time zone '1980-01-06 00:00 GMT' AS gpstime_zero,
+ d.f1 - timestamp with time zone '1980-01-06 00:00 GMT' AS difference
+ FROM TEMP_TIMESTAMP d
+ ORDER BY difference;
+
+SELECT d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS difference
+ FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
+ ORDER BY timestamp1, timestamp2, difference;
+
+--
+-- Conversions
+--
+
+SELECT f1 AS "timestamp", date(f1) AS date
+ FROM TEMP_TIMESTAMP
+ WHERE f1 <> timestamp 'now'
+ ORDER BY date, "timestamp";
+
+DROP TABLE TEMP_TIMESTAMP;
+
+--
+-- Comparisons between datetime types, especially overflow cases
+---
+
+SELECT '2202020-10-05'::date::timestamp; -- fail
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
+SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
+
+SELECT '2202020-10-05'::date::timestamptz; -- fail
+SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
+
+-- This conversion may work depending on timezone
+SELECT '4714-11-24 BC'::date::timestamptz;
+SET TimeZone = 'UTC-2';
+SELECT '4714-11-24 BC'::date::timestamptz; -- fail
+
+SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
+
+SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
+SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
+
+RESET TimeZone;
+
+--
+-- Formats
+--
+
+SET DateStyle TO 'US,Postgres';
+
+SHOW DateStyle;
+
+SELECT d1 AS us_postgres FROM TIMESTAMP_TBL;
+
+SET DateStyle TO 'US,ISO';
+
+SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
+
+SET DateStyle TO 'US,SQL';
+
+SHOW DateStyle;
+
+SELECT d1 AS us_sql FROM TIMESTAMP_TBL;
+
+SET DateStyle TO 'European,Postgres';
+
+SHOW DateStyle;
+
+INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
+
+SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
+
+SELECT d1 AS european_postgres FROM TIMESTAMP_TBL;
+
+SET DateStyle TO 'European,ISO';
+
+SHOW DateStyle;
+
+SELECT d1 AS european_iso FROM TIMESTAMP_TBL;
+
+SET DateStyle TO 'European,SQL';
+
+SHOW DateStyle;
+
+SELECT d1 AS european_sql FROM TIMESTAMP_TBL;
+
+RESET DateStyle;
+
+--
+-- to_timestamp()
+--
+
+SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
+
+SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
+
+SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
+
+SELECT to_timestamp('1985 January 12', 'YYYY FMMonth DD');
+
+SELECT to_timestamp('1985 FMMonth 12', 'YYYY "FMMonth" DD');
+
+SELECT to_timestamp('1985 \ 12', 'YYYY \\ DD');
+
+SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
+ '"My birthday-> Year:" YYYY, "Month:" FMMonth, "Day:" DD');
+
+SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
+
+SELECT to_timestamp('15 "text between quote marks" 98 54 45',
+ E'HH24 "\\"text between quote marks\\"" YY MI SS');
+
+SELECT to_timestamp('05121445482000', 'MMDDHH24MISSYYYY');
+
+SELECT to_timestamp('2000January09Sunday', 'YYYYFMMonthDDFMDay');
+
+SELECT to_timestamp('97/Feb/16', 'YYMonDD');
+
+SELECT to_timestamp('97/Feb/16', 'YY:Mon:DD');
+
+SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
+
+SELECT to_timestamp('97/Feb/16', 'FXYY/Mon/DD');
+
+SELECT to_timestamp('19971116', 'YYYYMMDD');
+
+SELECT to_timestamp('20000-1116', 'YYYY-MMDD');
+
+SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
+SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
+
+SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
+SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
+
+SELECT to_timestamp('9-1116', 'Y-MMDD');
+
+SELECT to_timestamp('95-1116', 'YY-MMDD');
+
+SELECT to_timestamp('995-1116', 'YYY-MMDD');
+
+SELECT to_timestamp('2005426', 'YYYYWWD');
+
+SELECT to_timestamp('2005300', 'YYYYDDD');
+
+SELECT to_timestamp('2005527', 'IYYYIWID');
+
+SELECT to_timestamp('005527', 'IYYIWID');
+
+SELECT to_timestamp('05527', 'IYIWID');
+
+SELECT to_timestamp('5527', 'IIWID');
+
+SELECT to_timestamp('2005364', 'IYYYIDDD');
+
+SELECT to_timestamp('20050302', 'YYYYMMDD');
+
+SELECT to_timestamp('2005 03 02', 'YYYYMMDD');
+
+SELECT to_timestamp(' 2005 03 02', 'YYYYMMDD');
+
+SELECT to_timestamp(' 20050302', 'YYYYMMDD');
+
+SELECT to_timestamp('2011-12-18 11:38 AM', 'YYYY-MM-DD HH12:MI PM');
+SELECT to_timestamp('2011-12-18 11:38 PM', 'YYYY-MM-DD HH12:MI PM');
+
+SELECT to_timestamp('2011-12-18 11:38 A.M.', 'YYYY-MM-DD HH12:MI P.M.');
+SELECT to_timestamp('2011-12-18 11:38 P.M.', 'YYYY-MM-DD HH12:MI P.M.');
+
+SELECT to_timestamp('2011-12-18 11:38 +05', 'YYYY-MM-DD HH12:MI TZH');
+SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
+SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
+SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
+
+SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ'); -- NYI
+
+SELECT to_timestamp('2018-11-02 12:34:56.025', 'YYYY-MM-DD HH24:MI:SS.MS');
+
+SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
+
+SELECT to_date('1 4 1902', 'Q MM YYYY'); -- Q is ignored
+SELECT to_date('3 4 21 01', 'W MM CC YY');
+SELECT to_date('2458872', 'J');
+
+--
+-- Check handling of BC dates
+--
+
+SELECT to_date('44-02-01 BC','YYYY-MM-DD BC');
+SELECT to_date('-44-02-01','YYYY-MM-DD');
+SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
+SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
+
+--
+-- Check handling of multiple spaces in format and/or input
+--
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD HH24:MI:SS');
+
+SELECT to_timestamp('2000+ JUN', 'YYYY/MON');
+SELECT to_timestamp(' 2000 +JUN', 'YYYY/MON');
+SELECT to_timestamp(' 2000 +JUN', 'YYYY//MON');
+SELECT to_timestamp('2000 +JUN', 'YYYY//MON');
+SELECT to_timestamp('2000 + JUN', 'YYYY MON');
+SELECT to_timestamp('2000 ++ JUN', 'YYYY MON');
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+SELECT to_timestamp('2000 + + JUN', 'YYYY MON');
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+SELECT to_timestamp('2000 -10', 'YYYY TZH');
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+SELECT to_date('2011 12 18', 'YYYY MM DD');
+
+SELECT to_date('2011 12 18', 'YYYYxMMxDD');
+SELECT to_date('2011x 12x 18', 'YYYYxMMxDD');
+SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
+
+--
+-- Check errors for some incorrect usages of to_timestamp() and to_date()
+--
+
+-- Mixture of date conventions (ISO week and Gregorian):
+SELECT to_timestamp('2005527', 'YYYYIWID');
+
+-- Insufficient characters in the source string:
+SELECT to_timestamp('19971', 'YYYYMMDD');
+
+-- Insufficient digit characters for a single node:
+SELECT to_timestamp('19971)24', 'YYYYMMDD');
+
+-- We don't accept full-length day or month names if short form is specified:
+SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
+SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
+SELECT to_timestamp('Fri 1-Jan-1999', 'DY DD MON YYYY'); -- ok
+
+-- Value clobbering:
+SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
+
+-- Non-numeric input:
+SELECT to_timestamp('199711xy', 'YYYYMMDD');
+
+-- Input that doesn't fit in an int:
+SELECT to_timestamp('10000000000', 'FMYYYY');
+
+-- Out-of-range and not-quite-out-of-range fields:
+SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
+SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2016-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS'); -- ok
+SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSS'); -- ok
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
+SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSSS'); -- ok
+SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
+SELECT to_date('2016-13-10', 'YYYY-MM-DD');
+SELECT to_date('2016-02-30', 'YYYY-MM-DD');
+SELECT to_date('2016-02-29', 'YYYY-MM-DD'); -- ok
+SELECT to_date('2015-02-29', 'YYYY-MM-DD');
+SELECT to_date('2015 365', 'YYYY DDD'); -- ok
+SELECT to_date('2015 366', 'YYYY DDD');
+SELECT to_date('2016 365', 'YYYY DDD'); -- ok
+SELECT to_date('2016 366', 'YYYY DDD'); -- ok
+SELECT to_date('2016 367', 'YYYY DDD');
+SELECT to_date('0000-02-01','YYYY-MM-DD'); -- allowed, though it shouldn't be
+
+--
+-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
+--
+
+SET TIME ZONE 'America/New_York';
+SET TIME ZONE '-1.5';
+
+SHOW TIME ZONE;
+
+SELECT '2012-12-12 12:00'::timestamptz;
+SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
+
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
+SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
+
+RESET TIME ZONE;
diff --git a/yql/essentials/tests/postgresql/original/cases/insert.out b/yql/essentials/tests/postgresql/original/cases/insert.out
new file mode 100644
index 0000000000..5063a3dc22
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/insert.out
@@ -0,0 +1,1004 @@
+--
+-- insert with DEFAULT in the target_list
+--
+create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
+ERROR: null value in column "col2" of relation "inserttest" violates not-null constraint
+DETAIL: Failing row contains (null, null, testing).
+insert into inserttest (col2, col3) values (3, DEFAULT);
+insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
+insert into inserttest values (DEFAULT, 5, 'test');
+insert into inserttest values (DEFAULT, 7);
+select * from inserttest;
+ col1 | col2 | col3
+------+------+---------
+ | 3 | testing
+ | 5 | testing
+ | 5 | test
+ | 7 | testing
+(4 rows)
+
+--
+-- insert with similar expression / target_list values (all fail)
+--
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
+ERROR: INSERT has more target columns than expressions
+LINE 1: insert into inserttest (col1, col2, col3) values (DEFAULT, D...
+ ^
+insert into inserttest (col1, col2, col3) values (1, 2);
+ERROR: INSERT has more target columns than expressions
+LINE 1: insert into inserttest (col1, col2, col3) values (1, 2);
+ ^
+insert into inserttest (col1) values (1, 2);
+ERROR: INSERT has more expressions than target columns
+LINE 1: insert into inserttest (col1) values (1, 2);
+ ^
+insert into inserttest (col1) values (DEFAULT, DEFAULT);
+ERROR: INSERT has more expressions than target columns
+LINE 1: insert into inserttest (col1) values (DEFAULT, DEFAULT);
+ ^
+select * from inserttest;
+ col1 | col2 | col3
+------+------+---------
+ | 3 | testing
+ | 5 | testing
+ | 5 | test
+ | 7 | testing
+(4 rows)
+
+--
+-- VALUES test
+--
+insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
+ ((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
+select * from inserttest;
+ col1 | col2 | col3
+------+------+-----------------
+ | 3 | testing
+ | 5 | testing
+ | 5 | test
+ | 7 | testing
+ 10 | 20 | 40
+ -1 | 2 | testing
+ 2 | 3 | values are fun!
+(7 rows)
+
+--
+-- TOASTed value test
+--
+insert into inserttest values(30, 50, repeat('x', 10000));
+select col1, col2, char_length(col3) from inserttest;
+ col1 | col2 | char_length
+------+------+-------------
+ | 3 | 7
+ | 5 | 7
+ | 5 | 4
+ | 7 | 7
+ 10 | 20 | 2
+ -1 | 2 | 7
+ 2 | 3 | 15
+ 30 | 50 | 10000
+(8 rows)
+
+drop table inserttest;
+--
+-- tuple larger than fillfactor
+--
+CREATE TABLE large_tuple_test (a int, b text) WITH (fillfactor = 10);
+ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
+-- create page w/ free space in range [nearlyEmptyFreeSpace, MaxHeapTupleSize)
+INSERT INTO large_tuple_test (select 1, NULL);
+-- should still fit on the page
+INSERT INTO large_tuple_test (select 2, repeat('a', 1000));
+SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
+ pg_size_pretty
+----------------
+ 8192 bytes
+(1 row)
+
+-- add small record to the second page
+INSERT INTO large_tuple_test (select 3, NULL);
+-- now this tuple won't fit on the second page, but the insert should
+-- still succeed by extending the relation
+INSERT INTO large_tuple_test (select 4, repeat('a', 8126));
+DROP TABLE large_tuple_test;
+--
+-- check indirection (field/array assignment), cf bug #14265
+--
+-- these tests are aware that transformInsertStmt has 3 separate code paths
+--
+create type insert_test_type as (if1 int, if2 text[]);
+create table inserttest (f1 int, f2 int[],
+ f3 insert_test_type, f4 insert_test_type[]);
+insert into inserttest (f2[1], f2[2]) values (1,2);
+insert into inserttest (f2[1], f2[2]) values (3,4), (5,6);
+insert into inserttest (f2[1], f2[2]) select 7,8;
+insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
+ERROR: cannot set an array element to DEFAULT
+LINE 1: insert into inserttest (f2[1], f2[2]) values (1,default);
+ ^
+insert into inserttest (f3.if1, f3.if2) values (1,array['foo']);
+insert into inserttest (f3.if1, f3.if2) values (1,'{foo}'), (2,'{bar}');
+insert into inserttest (f3.if1, f3.if2) select 3, '{baz,quux}';
+insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
+ERROR: cannot set a subfield to DEFAULT
+LINE 1: insert into inserttest (f3.if1, f3.if2) values (1,default);
+ ^
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar');
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+insert into inserttest (f3.if2[1], f3.if2[2]) select 'bear', 'beer';
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar');
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) select 'bear', 'beer';
+select * from inserttest;
+ f1 | f2 | f3 | f4
+----+-------+------------------+------------------------
+ | {1,2} | |
+ | {3,4} | |
+ | {5,6} | |
+ | {7,8} | |
+ | | (1,{foo}) |
+ | | (1,{foo}) |
+ | | (2,{bar}) |
+ | | (3,"{baz,quux}") |
+ | | (,"{foo,bar}") |
+ | | (,"{foo,bar}") |
+ | | (,"{baz,quux}") |
+ | | (,"{bear,beer}") |
+ | | | {"(,\"{foo,bar}\")"}
+ | | | {"(,\"{foo,bar}\")"}
+ | | | {"(,\"{baz,quux}\")"}
+ | | | {"(,\"{bear,beer}\")"}
+(16 rows)
+
+-- also check reverse-listing
+create table inserttest2 (f1 bigint, f2 text);
+create rule irule1 as on insert to inserttest2 do also
+ insert into inserttest (f3.if2[1], f3.if2[2])
+ values (new.f1,new.f2);
+create rule irule2 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ values (1,'fool'),(new.f1,new.f2);
+create rule irule3 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ select new.f1, new.f2;
+\d+ inserttest2
+ Table "public.inserttest2"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+--------+-----------+----------+---------+----------+--------------+-------------
+ f1 | bigint | | | | plain | |
+ f2 | text | | | | extended | |
+Rules:
+ irule1 AS
+ ON INSERT TO inserttest2 DO INSERT INTO inserttest (f3.if2[1], f3.if2[2])
+ VALUES (new.f1, new.f2)
+ irule2 AS
+ ON INSERT TO inserttest2 DO INSERT INTO inserttest (f4[1].if1, f4[1].if2[2]) VALUES (1,'fool'::text), (new.f1,new.f2)
+ irule3 AS
+ ON INSERT TO inserttest2 DO INSERT INTO inserttest (f4[1].if1, f4[1].if2[2]) SELECT new.f1,
+ new.f2
+
+drop table inserttest2;
+drop table inserttest;
+drop type insert_test_type;
+-- direct partition inserts should check partition bound constraint
+create table range_parted (
+ a text,
+ b int
+) partition by range (a, (b+0));
+-- no partitions, so fail
+insert into range_parted values ('a', 11);
+ERROR: no partition of relation "range_parted" found for row
+DETAIL: Partition key of the failing row contains (a, (b + 0)) = (a, 11).
+create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
+create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
+create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
+create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
+-- fail
+insert into part1 values ('a', 11);
+ERROR: new row for relation "part1" violates partition constraint
+DETAIL: Failing row contains (a, 11).
+insert into part1 values ('b', 1);
+ERROR: new row for relation "part1" violates partition constraint
+DETAIL: Failing row contains (b, 1).
+-- ok
+insert into part1 values ('a', 1);
+-- fail
+insert into part4 values ('b', 21);
+ERROR: new row for relation "part4" violates partition constraint
+DETAIL: Failing row contains (b, 21).
+insert into part4 values ('a', 10);
+ERROR: new row for relation "part4" violates partition constraint
+DETAIL: Failing row contains (a, 10).
+-- ok
+insert into part4 values ('b', 10);
+-- fail (partition key a has a NOT NULL constraint)
+insert into part1 values (null);
+ERROR: new row for relation "part1" violates partition constraint
+DETAIL: Failing row contains (null, null).
+-- fail (expression key (b+0) cannot be null either)
+insert into part1 values (1);
+ERROR: new row for relation "part1" violates partition constraint
+DETAIL: Failing row contains (1, null).
+create table list_parted (
+ a text,
+ b int
+) partition by list (lower(a));
+create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
+create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
+create table part_null partition of list_parted FOR VALUES IN (null);
+-- fail
+insert into part_aa_bb values ('cc', 1);
+ERROR: new row for relation "part_aa_bb" violates partition constraint
+DETAIL: Failing row contains (cc, 1).
+insert into part_aa_bb values ('AAa', 1);
+ERROR: new row for relation "part_aa_bb" violates partition constraint
+DETAIL: Failing row contains (AAa, 1).
+insert into part_aa_bb values (null);
+ERROR: new row for relation "part_aa_bb" violates partition constraint
+DETAIL: Failing row contains (null, null).
+-- ok
+insert into part_cc_dd values ('cC', 1);
+insert into part_null values (null, 0);
+-- check in case of multi-level partitioned table
+create table part_ee_ff partition of list_parted for values in ('ee', 'ff') partition by range (b);
+create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
+create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
+-- test default partition
+create table part_default partition of list_parted default;
+-- Negative test: a row, which would fit in other partition, does not fit
+-- default partition, even when inserted directly
+insert into part_default values ('aa', 2);
+ERROR: new row for relation "part_default" violates partition constraint
+DETAIL: Failing row contains (aa, 2).
+insert into part_default values (null, 2);
+ERROR: new row for relation "part_default" violates partition constraint
+DETAIL: Failing row contains (null, 2).
+-- ok
+insert into part_default values ('Zz', 2);
+-- test if default partition works as expected for multi-level partitioned
+-- table as well as when default partition itself is further partitioned
+drop table part_default;
+create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
+create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
+create table part_xx_yy_defpart partition of part_xx_yy default;
+create table part_default partition of list_parted default partition by range(b);
+create table part_default_p1 partition of part_default for values from (20) to (30);
+create table part_default_p2 partition of part_default for values from (30) to (40);
+-- fail
+insert into part_ee_ff1 values ('EE', 11);
+ERROR: new row for relation "part_ee_ff1" violates partition constraint
+DETAIL: Failing row contains (EE, 11).
+insert into part_default_p2 values ('gg', 43);
+ERROR: new row for relation "part_default_p2" violates partition constraint
+DETAIL: Failing row contains (gg, 43).
+-- fail (even the parent's, ie, part_ee_ff's partition constraint applies)
+insert into part_ee_ff1 values ('cc', 1);
+ERROR: new row for relation "part_ee_ff1" violates partition constraint
+DETAIL: Failing row contains (cc, 1).
+insert into part_default values ('gg', 43);
+ERROR: no partition of relation "part_default" found for row
+DETAIL: Partition key of the failing row contains (b) = (43).
+-- ok
+insert into part_ee_ff1 values ('ff', 1);
+insert into part_ee_ff2 values ('ff', 11);
+insert into part_default_p1 values ('cd', 25);
+insert into part_default_p2 values ('de', 35);
+insert into list_parted values ('ab', 21);
+insert into list_parted values ('xx', 1);
+insert into list_parted values ('yy', 2);
+select tableoid::regclass, * from list_parted;
+ tableoid | a | b
+--------------------+----+----
+ part_cc_dd | cC | 1
+ part_ee_ff1 | ff | 1
+ part_ee_ff2 | ff | 11
+ part_xx_yy_p1 | xx | 1
+ part_xx_yy_defpart | yy | 2
+ part_null | | 0
+ part_default_p1 | cd | 25
+ part_default_p1 | ab | 21
+ part_default_p2 | de | 35
+(9 rows)
+
+-- Check tuple routing for partitioned tables
+-- fail
+insert into range_parted values ('a', 0);
+ERROR: no partition of relation "range_parted" found for row
+DETAIL: Partition key of the failing row contains (a, (b + 0)) = (a, 0).
+-- ok
+insert into range_parted values ('a', 1);
+insert into range_parted values ('a', 10);
+-- fail
+insert into range_parted values ('a', 20);
+ERROR: no partition of relation "range_parted" found for row
+DETAIL: Partition key of the failing row contains (a, (b + 0)) = (a, 20).
+-- ok
+insert into range_parted values ('b', 1);
+insert into range_parted values ('b', 10);
+-- fail (partition key (b+0) is null)
+insert into range_parted values ('a');
+ERROR: no partition of relation "range_parted" found for row
+DETAIL: Partition key of the failing row contains (a, (b + 0)) = (a, null).
+-- Check default partition
+create table part_def partition of range_parted default;
+-- fail
+insert into part_def values ('b', 10);
+ERROR: new row for relation "part_def" violates partition constraint
+DETAIL: Failing row contains (b, 10).
+-- ok
+insert into part_def values ('c', 10);
+insert into range_parted values (null, null);
+insert into range_parted values ('a', null);
+insert into range_parted values (null, 19);
+insert into range_parted values ('b', 20);
+select tableoid::regclass, * from range_parted;
+ tableoid | a | b
+----------+---+----
+ part1 | a | 1
+ part1 | a | 1
+ part2 | a | 10
+ part3 | b | 1
+ part4 | b | 10
+ part4 | b | 10
+ part_def | c | 10
+ part_def | |
+ part_def | a |
+ part_def | | 19
+ part_def | b | 20
+(11 rows)
+
+-- ok
+insert into list_parted values (null, 1);
+insert into list_parted (a) values ('aA');
+-- fail (partition of part_ee_ff not found in both cases)
+insert into list_parted values ('EE', 0);
+ERROR: no partition of relation "part_ee_ff" found for row
+DETAIL: Partition key of the failing row contains (b) = (0).
+insert into part_ee_ff values ('EE', 0);
+ERROR: no partition of relation "part_ee_ff" found for row
+DETAIL: Partition key of the failing row contains (b) = (0).
+-- ok
+insert into list_parted values ('EE', 1);
+insert into part_ee_ff values ('EE', 10);
+select tableoid::regclass, * from list_parted;
+ tableoid | a | b
+--------------------+----+----
+ part_aa_bb | aA |
+ part_cc_dd | cC | 1
+ part_ee_ff1 | ff | 1
+ part_ee_ff1 | EE | 1
+ part_ee_ff2 | ff | 11
+ part_ee_ff2 | EE | 10
+ part_xx_yy_p1 | xx | 1
+ part_xx_yy_defpart | yy | 2
+ part_null | | 0
+ part_null | | 1
+ part_default_p1 | cd | 25
+ part_default_p1 | ab | 21
+ part_default_p2 | de | 35
+(13 rows)
+
+-- some more tests to exercise tuple-routing with multi-level partitioning
+create table part_gg partition of list_parted for values in ('gg') partition by range (b);
+create table part_gg1 partition of part_gg for values from (minvalue) to (1);
+create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
+create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
+create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
+create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
+create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
+create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
+truncate list_parted;
+insert into list_parted values ('aa'), ('cc');
+insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
+insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
+insert into list_parted (b) values (1);
+select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
+ tableoid | a | min_b | max_b
+---------------+----+-------+-------
+ part_aa_bb | aa | |
+ part_cc_dd | cc | |
+ part_ee_ff1 | Ff | 1 | 9
+ part_ee_ff2 | Ff | 10 | 19
+ part_ee_ff3_1 | Ff | 20 | 24
+ part_ee_ff3_2 | Ff | 25 | 29
+ part_gg2_1 | gg | 1 | 4
+ part_gg2_2 | gg | 5 | 9
+ part_null | | 1 | 1
+(9 rows)
+
+-- direct partition inserts should check hash partition bound constraint
+-- Use hand-rolled hash functions and operator classes to get predictable
+-- result on different machines. The hash function for int4 simply returns
+-- the sum of the values passed to it and the one for text returns the length
+-- of the non-empty string value passed to it or 0.
+create or replace function part_hashint4_noop(value int4, seed int8)
+returns int8 as $$
+select value + seed;
+$$ language sql immutable;
+create operator class part_test_int4_ops
+for type int4
+using hash as
+operator 1 =,
+function 2 part_hashint4_noop(int4, int8);
+create or replace function part_hashtext_length(value text, seed int8)
+RETURNS int8 AS $$
+select length(coalesce(value, ''))::int8
+$$ language sql immutable;
+create operator class part_test_text_ops
+for type text
+using hash as
+operator 1 =,
+function 2 part_hashtext_length(text, int8);
+create table hash_parted (
+ a int
+) partition by hash (a part_test_int4_ops);
+create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
+create table hpart1 partition of hash_parted for values with (modulus 4, remainder 1);
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+create table hpart3 partition of hash_parted for values with (modulus 4, remainder 3);
+insert into hash_parted values(generate_series(1,10));
+-- direct insert of values divisible by 4 - ok;
+insert into hpart0 values(12),(16);
+-- fail;
+insert into hpart0 values(11);
+ERROR: new row for relation "hpart0" violates partition constraint
+DETAIL: Failing row contains (11).
+-- 11 % 4 -> 3 remainder i.e. valid data for hpart3 partition
+insert into hpart3 values(11);
+-- view data
+select tableoid::regclass as part, a, a%4 as "remainder = a % 4"
+from hash_parted order by part;
+ part | a | remainder = a % 4
+--------+----+-------------------
+ hpart0 | 4 | 0
+ hpart0 | 8 | 0
+ hpart0 | 12 | 0
+ hpart0 | 16 | 0
+ hpart1 | 1 | 1
+ hpart1 | 5 | 1
+ hpart1 | 9 | 1
+ hpart2 | 2 | 2
+ hpart2 | 6 | 2
+ hpart2 | 10 | 2
+ hpart3 | 3 | 3
+ hpart3 | 7 | 3
+ hpart3 | 11 | 3
+(13 rows)
+
+-- test \d+ output on a table which has both partitioned and unpartitioned
+-- partitions
+\d+ list_parted
+ Partitioned table "public.list_parted"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition key: LIST (lower(a))
+Partitions: part_aa_bb FOR VALUES IN ('aa', 'bb'),
+ part_cc_dd FOR VALUES IN ('cc', 'dd'),
+ part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED,
+ part_gg FOR VALUES IN ('gg'), PARTITIONED,
+ part_null FOR VALUES IN (NULL),
+ part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED,
+ part_default DEFAULT, PARTITIONED
+
+-- cleanup
+drop table range_parted, list_parted;
+drop table hash_parted;
+-- test that a default partition added as the first partition accepts any value
+-- including null
+create table list_parted (a int) partition by list (a);
+create table part_default partition of list_parted default;
+\d+ part_default
+ Table "public.part_default"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ a | integer | | | | plain | |
+Partition of: list_parted DEFAULT
+No partition constraint
+
+insert into part_default values (null);
+insert into part_default values (1);
+insert into part_default values (-1);
+select tableoid::regclass, a from list_parted;
+ tableoid | a
+--------------+----
+ part_default |
+ part_default | 1
+ part_default | -1
+(3 rows)
+
+-- cleanup
+drop table list_parted;
+-- more tests for certain multi-level partitioning scenarios
+create table mlparted (a int, b int) partition by range (a, b);
+create table mlparted1 (b int not null, a int not null) partition by range ((b+0));
+create table mlparted11 (like mlparted1);
+alter table mlparted11 drop a;
+alter table mlparted11 add a int;
+alter table mlparted11 drop a;
+alter table mlparted11 add a int not null;
+-- attnum for key attribute 'a' is different in mlparted, mlparted1, and mlparted11
+select attrelid::regclass, attname, attnum
+from pg_attribute
+where attname = 'a'
+ and (attrelid = 'mlparted'::regclass
+ or attrelid = 'mlparted1'::regclass
+ or attrelid = 'mlparted11'::regclass)
+order by attrelid::regclass::text;
+ attrelid | attname | attnum
+------------+---------+--------
+ mlparted | a | 1
+ mlparted1 | a | 2
+ mlparted11 | a | 4
+(3 rows)
+
+alter table mlparted1 attach partition mlparted11 for values from (2) to (5);
+alter table mlparted attach partition mlparted1 for values from (1, 2) to (1, 10);
+-- check that "(1, 2)" is correctly routed to mlparted11.
+insert into mlparted values (1, 2);
+select tableoid::regclass, * from mlparted;
+ tableoid | a | b
+------------+---+---
+ mlparted11 | 1 | 2
+(1 row)
+
+-- check that proper message is shown after failure to route through mlparted1
+insert into mlparted (a, b) values (1, 5);
+ERROR: no partition of relation "mlparted1" found for row
+DETAIL: Partition key of the failing row contains ((b + 0)) = (5).
+truncate mlparted;
+alter table mlparted add constraint check_b check (b = 3);
+-- have a BR trigger modify the row such that the check_b is violated
+create function mlparted11_trig_fn()
+returns trigger AS
+$$
+begin
+ NEW.b := 4;
+ return NEW;
+end;
+$$
+language plpgsql;
+create trigger mlparted11_trig before insert ON mlparted11
+ for each row execute procedure mlparted11_trig_fn();
+-- check that the correct row is shown when constraint check_b fails after
+-- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due
+-- to the BR trigger mlparted11_trig_fn)
+insert into mlparted values (1, 2);
+ERROR: new row for relation "mlparted11" violates check constraint "check_b"
+DETAIL: Failing row contains (1, 4).
+drop trigger mlparted11_trig on mlparted11;
+drop function mlparted11_trig_fn();
+-- check that inserting into an internal partition successfully results in
+-- checking its partition constraint before inserting into the leaf partition
+-- selected by tuple-routing
+insert into mlparted1 (a, b) values (2, 3);
+ERROR: new row for relation "mlparted1" violates partition constraint
+DETAIL: Failing row contains (3, 2).
+-- check routing error through a list partitioned table when the key is null
+create table lparted_nonullpart (a int, b char) partition by list (b);
+create table lparted_nonullpart_a partition of lparted_nonullpart for values in ('a');
+insert into lparted_nonullpart values (1);
+ERROR: no partition of relation "lparted_nonullpart" found for row
+DETAIL: Partition key of the failing row contains (b) = (null).
+drop table lparted_nonullpart;
+-- check that RETURNING works correctly with tuple-routing
+alter table mlparted drop constraint check_b;
+create table mlparted12 partition of mlparted1 for values from (5) to (10);
+create table mlparted2 (b int not null, a int not null);
+alter table mlparted attach partition mlparted2 for values from (1, 10) to (1, 20);
+create table mlparted3 partition of mlparted for values from (1, 20) to (1, 30);
+create table mlparted4 (like mlparted);
+alter table mlparted4 drop a;
+alter table mlparted4 add a int not null;
+alter table mlparted attach partition mlparted4 for values from (1, 30) to (1, 40);
+with ins (a, b, c) as
+ (insert into mlparted (b, a) select s.a, 1 from generate_series(2, 39) s(a) returning tableoid::regclass, *)
+ select a, b, min(c), max(c) from ins group by a, b order by 1;
+ a | b | min | max
+------------+---+-----+-----
+ mlparted11 | 1 | 2 | 4
+ mlparted12 | 1 | 5 | 9
+ mlparted2 | 1 | 10 | 19
+ mlparted3 | 1 | 20 | 29
+ mlparted4 | 1 | 30 | 39
+(5 rows)
+
+alter table mlparted add c text;
+create table mlparted5 (c text, a int not null, b int not null) partition by list (c);
+create table mlparted5a (a int not null, c text, b int not null);
+alter table mlparted5 attach partition mlparted5a for values in ('a');
+alter table mlparted attach partition mlparted5 for values from (1, 40) to (1, 50);
+alter table mlparted add constraint check_b check (a = 1 and b < 45);
+insert into mlparted values (1, 45, 'a');
+ERROR: new row for relation "mlparted5a" violates check constraint "check_b"
+DETAIL: Failing row contains (1, 45, a).
+create function mlparted5abrtrig_func() returns trigger as $$ begin new.c = 'b'; return new; end; $$ language plpgsql;
+create trigger mlparted5abrtrig before insert on mlparted5a for each row execute procedure mlparted5abrtrig_func();
+insert into mlparted5 (a, b, c) values (1, 40, 'a');
+ERROR: new row for relation "mlparted5a" violates partition constraint
+DETAIL: Failing row contains (b, 1, 40).
+drop table mlparted5;
+alter table mlparted drop constraint check_b;
+-- Check multi-level default partition
+create table mlparted_def partition of mlparted default partition by range(a);
+create table mlparted_def1 partition of mlparted_def for values from (40) to (50);
+create table mlparted_def2 partition of mlparted_def for values from (50) to (60);
+insert into mlparted values (40, 100);
+insert into mlparted_def1 values (42, 100);
+insert into mlparted_def2 values (54, 50);
+-- fail
+insert into mlparted values (70, 100);
+ERROR: no partition of relation "mlparted_def" found for row
+DETAIL: Partition key of the failing row contains (a) = (70).
+insert into mlparted_def1 values (52, 50);
+ERROR: new row for relation "mlparted_def1" violates partition constraint
+DETAIL: Failing row contains (52, 50, null).
+insert into mlparted_def2 values (34, 50);
+ERROR: new row for relation "mlparted_def2" violates partition constraint
+DETAIL: Failing row contains (34, 50, null).
+-- ok
+create table mlparted_defd partition of mlparted_def default;
+insert into mlparted values (70, 100);
+select tableoid::regclass, * from mlparted_def;
+ tableoid | a | b | c
+---------------+----+-----+---
+ mlparted_def1 | 40 | 100 |
+ mlparted_def1 | 42 | 100 |
+ mlparted_def2 | 54 | 50 |
+ mlparted_defd | 70 | 100 |
+(4 rows)
+
+-- Check multi-level tuple routing with attributes dropped from the
+-- top-most parent. First remove the last attribute.
+alter table mlparted add d int, add e int;
+alter table mlparted drop e;
+create table mlparted5 partition of mlparted
+ for values from (1, 40) to (1, 50) partition by range (c);
+create table mlparted5_ab partition of mlparted5
+ for values from ('a') to ('c') partition by list (c);
+-- This partitioned table should remain with no partitions.
+create table mlparted5_cd partition of mlparted5
+ for values from ('c') to ('e') partition by list (c);
+create table mlparted5_a partition of mlparted5_ab for values in ('a');
+create table mlparted5_b (d int, b int, c text, a int);
+alter table mlparted5_ab attach partition mlparted5_b for values in ('b');
+truncate mlparted;
+insert into mlparted values (1, 2, 'a', 1);
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+ERROR: no partition of relation "mlparted5_cd" found for row
+DETAIL: Partition key of the failing row contains (c) = (c).
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+ERROR: no partition of relation "mlparted5" found for row
+DETAIL: Partition key of the failing row contains (c) = (f).
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+ tableoid | a | b | c | d
+-------------+---+----+---+---
+ mlparted11 | 1 | 2 | a | 1
+ mlparted5_a | 1 | 40 | a | 1
+ mlparted5_b | 1 | 45 | b | 1
+(3 rows)
+
+alter table mlparted drop d;
+truncate mlparted;
+-- Remove the before last attribute.
+alter table mlparted add e int, add d int;
+alter table mlparted drop e;
+insert into mlparted values (1, 2, 'a', 1);
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+ERROR: no partition of relation "mlparted5_cd" found for row
+DETAIL: Partition key of the failing row contains (c) = (c).
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+ERROR: no partition of relation "mlparted5" found for row
+DETAIL: Partition key of the failing row contains (c) = (f).
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+ tableoid | a | b | c | d
+-------------+---+----+---+---
+ mlparted11 | 1 | 2 | a | 1
+ mlparted5_a | 1 | 40 | a | 1
+ mlparted5_b | 1 | 45 | b | 1
+(3 rows)
+
+alter table mlparted drop d;
+drop table mlparted5;
+-- check that message shown after failure to find a partition shows the
+-- appropriate key description (or none) in various situations
+create table key_desc (a int, b int) partition by list ((a+0));
+create table key_desc_1 partition of key_desc for values in (1) partition by range (b);
+create user regress_insert_other_user;
+grant select (a) on key_desc_1 to regress_insert_other_user;
+grant insert on key_desc to regress_insert_other_user;
+set role regress_insert_other_user;
+-- no key description is shown
+insert into key_desc values (1, 1);
+ERROR: no partition of relation "key_desc_1" found for row
+reset role;
+grant select (b) on key_desc_1 to regress_insert_other_user;
+set role regress_insert_other_user;
+-- key description (b)=(1) is now shown
+insert into key_desc values (1, 1);
+ERROR: no partition of relation "key_desc_1" found for row
+DETAIL: Partition key of the failing row contains (b) = (1).
+-- key description is not shown if key contains expression
+insert into key_desc values (2, 1);
+ERROR: no partition of relation "key_desc" found for row
+reset role;
+revoke all on key_desc from regress_insert_other_user;
+revoke all on key_desc_1 from regress_insert_other_user;
+drop role regress_insert_other_user;
+drop table key_desc, key_desc_1;
+-- test minvalue/maxvalue restrictions
+create table mcrparted (a int, b int, c int) partition by range (a, abs(b), c);
+create table mcrparted0 partition of mcrparted for values from (minvalue, 0, 0) to (1, maxvalue, maxvalue);
+ERROR: every bound following MINVALUE must also be MINVALUE
+LINE 1: ...partition of mcrparted for values from (minvalue, 0, 0) to (...
+ ^
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, minvalue);
+ERROR: every bound following MAXVALUE must also be MAXVALUE
+LINE 1: ...r values from (10, 6, minvalue) to (10, maxvalue, minvalue);
+ ^
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, 0) to (30, 20, minvalue);
+ERROR: every bound following MINVALUE must also be MINVALUE
+LINE 1: ...ition of mcrparted for values from (21, minvalue, 0) to (30,...
+ ^
+-- check multi-column range partitioning expression enforces the same
+-- constraint as what tuple-routing would determine it to be
+create table mcrparted0 partition of mcrparted for values from (minvalue, minvalue, minvalue) to (1, maxvalue, maxvalue);
+create table mcrparted1 partition of mcrparted for values from (2, 1, minvalue) to (10, 5, 10);
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, maxvalue);
+create table mcrparted3 partition of mcrparted for values from (11, 1, 1) to (20, 10, 10);
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, minvalue) to (30, 20, maxvalue);
+create table mcrparted5 partition of mcrparted for values from (30, 21, 20) to (maxvalue, maxvalue, maxvalue);
+-- null not allowed in range partition
+insert into mcrparted values (null, null, null);
+ERROR: no partition of relation "mcrparted" found for row
+DETAIL: Partition key of the failing row contains (a, abs(b), c) = (null, null, null).
+-- routed to mcrparted0
+insert into mcrparted values (0, 1, 1);
+insert into mcrparted0 values (0, 1, 1);
+-- routed to mcparted1
+insert into mcrparted values (9, 1000, 1);
+insert into mcrparted1 values (9, 1000, 1);
+insert into mcrparted values (10, 5, -1);
+insert into mcrparted1 values (10, 5, -1);
+insert into mcrparted values (2, 1, 0);
+insert into mcrparted1 values (2, 1, 0);
+-- routed to mcparted2
+insert into mcrparted values (10, 6, 1000);
+insert into mcrparted2 values (10, 6, 1000);
+insert into mcrparted values (10, 1000, 1000);
+insert into mcrparted2 values (10, 1000, 1000);
+-- no partition exists, nor does mcrparted3 accept it
+insert into mcrparted values (11, 1, -1);
+ERROR: no partition of relation "mcrparted" found for row
+DETAIL: Partition key of the failing row contains (a, abs(b), c) = (11, 1, -1).
+insert into mcrparted3 values (11, 1, -1);
+ERROR: new row for relation "mcrparted3" violates partition constraint
+DETAIL: Failing row contains (11, 1, -1).
+-- routed to mcrparted5
+insert into mcrparted values (30, 21, 20);
+insert into mcrparted5 values (30, 21, 20);
+insert into mcrparted4 values (30, 21, 20); -- error
+ERROR: new row for relation "mcrparted4" violates partition constraint
+DETAIL: Failing row contains (30, 21, 20).
+-- check rows
+select tableoid::regclass::text, * from mcrparted order by 1;
+ tableoid | a | b | c
+------------+----+------+------
+ mcrparted0 | 0 | 1 | 1
+ mcrparted0 | 0 | 1 | 1
+ mcrparted1 | 9 | 1000 | 1
+ mcrparted1 | 9 | 1000 | 1
+ mcrparted1 | 10 | 5 | -1
+ mcrparted1 | 10 | 5 | -1
+ mcrparted1 | 2 | 1 | 0
+ mcrparted1 | 2 | 1 | 0
+ mcrparted2 | 10 | 6 | 1000
+ mcrparted2 | 10 | 6 | 1000
+ mcrparted2 | 10 | 1000 | 1000
+ mcrparted2 | 10 | 1000 | 1000
+ mcrparted5 | 30 | 21 | 20
+ mcrparted5 | 30 | 21 | 20
+(14 rows)
+
+-- cleanup
+drop table mcrparted;
+-- check that a BR constraint can't make partition contain violating rows
+create table brtrigpartcon (a int, b text) partition by list (a);
+create table brtrigpartcon1 partition of brtrigpartcon for values in (1);
+create or replace function brtrigpartcon1trigf() returns trigger as $$begin new.a := 2; return new; end$$ language plpgsql;
+create trigger brtrigpartcon1trig before insert on brtrigpartcon1 for each row execute procedure brtrigpartcon1trigf();
+insert into brtrigpartcon values (1, 'hi there');
+ERROR: new row for relation "brtrigpartcon1" violates partition constraint
+DETAIL: Failing row contains (2, hi there).
+insert into brtrigpartcon1 values (1, 'hi there');
+ERROR: new row for relation "brtrigpartcon1" violates partition constraint
+DETAIL: Failing row contains (2, hi there).
+-- check that the message shows the appropriate column description in a
+-- situation where the partitioned table is not the primary ModifyTable node
+create table inserttest3 (f1 text default 'foo', f2 text default 'bar', f3 int);
+create role regress_coldesc_role;
+grant insert on inserttest3 to regress_coldesc_role;
+grant insert on brtrigpartcon to regress_coldesc_role;
+revoke select on brtrigpartcon from regress_coldesc_role;
+set role regress_coldesc_role;
+with result as (insert into brtrigpartcon values (1, 'hi there') returning 1)
+ insert into inserttest3 (f3) select * from result;
+ERROR: new row for relation "brtrigpartcon1" violates partition constraint
+DETAIL: Failing row contains (a, b) = (2, hi there).
+reset role;
+-- cleanup
+revoke all on inserttest3 from regress_coldesc_role;
+revoke all on brtrigpartcon from regress_coldesc_role;
+drop role regress_coldesc_role;
+drop table inserttest3;
+drop table brtrigpartcon;
+drop function brtrigpartcon1trigf();
+-- check that "do nothing" BR triggers work with tuple-routing
+create table donothingbrtrig_test (a int, b text) partition by list (a);
+create table donothingbrtrig_test1 (b text, a int);
+create table donothingbrtrig_test2 (c text, b text, a int);
+alter table donothingbrtrig_test2 drop column c;
+create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
+create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
+alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
+insert into donothingbrtrig_test values (1, 'foo'), (2, 'bar');
+NOTICE: b: foo
+NOTICE: b: bar
+copy donothingbrtrig_test from stdout;
+NOTICE: b: baz
+NOTICE: b: qux
+select tableoid::regclass, * from donothingbrtrig_test;
+ tableoid | a | b
+----------+---+---
+(0 rows)
+
+-- cleanup
+drop table donothingbrtrig_test;
+drop function donothingbrtrig_func();
+-- check multi-column range partitioning with minvalue/maxvalue constraints
+create table mcrparted (a text, b int) partition by range(a, b);
+create table mcrparted1_lt_b partition of mcrparted for values from (minvalue, minvalue) to ('b', minvalue);
+create table mcrparted2_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
+create table mcrparted3_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
+create table mcrparted4_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
+create table mcrparted5_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
+create table mcrparted6_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
+create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
+create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, maxvalue);
+\d+ mcrparted
+ Partitioned table "public.mcrparted"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition key: RANGE (a, b)
+Partitions: mcrparted1_lt_b FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVALUE),
+ mcrparted2_b FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE),
+ mcrparted3_c_to_common FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE),
+ mcrparted4_common_lt_0 FOR VALUES FROM ('common', MINVALUE) TO ('common', 0),
+ mcrparted5_common_0_to_10 FOR VALUES FROM ('common', 0) TO ('common', 10),
+ mcrparted6_common_ge_10 FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE),
+ mcrparted7_gt_common_lt_d FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE),
+ mcrparted8_ge_d FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
+
+\d+ mcrparted1_lt_b
+ Table "public.mcrparted1_lt_b"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a < 'b'::text))
+
+\d+ mcrparted2_b
+ Table "public.mcrparted2_b"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'b'::text) AND (a < 'c'::text))
+
+\d+ mcrparted3_c_to_common
+ Table "public.mcrparted3_c_to_common"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'c'::text) AND (a < 'common'::text))
+
+\d+ mcrparted4_common_lt_0
+ Table "public.mcrparted4_common_lt_0"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('common', MINVALUE) TO ('common', 0)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b < 0))
+
+\d+ mcrparted5_common_0_to_10
+ Table "public.mcrparted5_common_0_to_10"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('common', 0) TO ('common', 10)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 0) AND (b < 10))
+
+\d+ mcrparted6_common_ge_10
+ Table "public.mcrparted6_common_ge_10"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 10))
+
+\d+ mcrparted7_gt_common_lt_d
+ Table "public.mcrparted7_gt_common_lt_d"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a > 'common'::text) AND (a < 'd'::text))
+
+\d+ mcrparted8_ge_d
+ Table "public.mcrparted8_ge_d"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | integer | | | | plain | |
+Partition of: mcrparted FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
+Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'd'::text))
+
+insert into mcrparted values ('aaa', 0), ('b', 0), ('bz', 10), ('c', -10),
+ ('comm', -10), ('common', -10), ('common', 0), ('common', 10),
+ ('commons', 0), ('d', -10), ('e', 0);
+select tableoid::regclass, * from mcrparted order by a, b;
+ tableoid | a | b
+---------------------------+---------+-----
+ mcrparted1_lt_b | aaa | 0
+ mcrparted2_b | b | 0
+ mcrparted2_b | bz | 10
+ mcrparted3_c_to_common | c | -10
+ mcrparted3_c_to_common | comm | -10
+ mcrparted4_common_lt_0 | common | -10
+ mcrparted5_common_0_to_10 | common | 0
+ mcrparted6_common_ge_10 | common | 10
+ mcrparted7_gt_common_lt_d | commons | 0
+ mcrparted8_ge_d | d | -10
+ mcrparted8_ge_d | e | 0
+(11 rows)
+
+drop table mcrparted;
+-- check that wholerow vars in the RETURNING list work with partitioned tables
+create table returningwrtest (a int) partition by list (a);
+create table returningwrtest1 partition of returningwrtest for values in (1);
+insert into returningwrtest values (1) returning returningwrtest;
+ returningwrtest
+-----------------
+ (1)
+(1 row)
+
+-- check also that the wholerow vars in RETURNING list are converted as needed
+alter table returningwrtest add b text;
+create table returningwrtest2 (b text, c int, a int);
+alter table returningwrtest2 drop c;
+alter table returningwrtest attach partition returningwrtest2 for values in (2);
+insert into returningwrtest values (2, 'foo') returning returningwrtest;
+ returningwrtest
+-----------------
+ (2,foo)
+(1 row)
+
+drop table returningwrtest;
diff --git a/yql/essentials/tests/postgresql/original/cases/insert.sql b/yql/essentials/tests/postgresql/original/cases/insert.sql
new file mode 100644
index 0000000000..bfaa8a3b27
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/insert.sql
@@ -0,0 +1,626 @@
+--
+-- insert with DEFAULT in the target_list
+--
+create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
+insert into inserttest (col2, col3) values (3, DEFAULT);
+insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
+insert into inserttest values (DEFAULT, 5, 'test');
+insert into inserttest values (DEFAULT, 7);
+
+select * from inserttest;
+
+--
+-- insert with similar expression / target_list values (all fail)
+--
+insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
+insert into inserttest (col1, col2, col3) values (1, 2);
+insert into inserttest (col1) values (1, 2);
+insert into inserttest (col1) values (DEFAULT, DEFAULT);
+
+select * from inserttest;
+
+--
+-- VALUES test
+--
+insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
+ ((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
+
+select * from inserttest;
+
+--
+-- TOASTed value test
+--
+insert into inserttest values(30, 50, repeat('x', 10000));
+
+select col1, col2, char_length(col3) from inserttest;
+
+drop table inserttest;
+
+--
+-- tuple larger than fillfactor
+--
+CREATE TABLE large_tuple_test (a int, b text) WITH (fillfactor = 10);
+ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
+
+-- create page w/ free space in range [nearlyEmptyFreeSpace, MaxHeapTupleSize)
+INSERT INTO large_tuple_test (select 1, NULL);
+
+-- should still fit on the page
+INSERT INTO large_tuple_test (select 2, repeat('a', 1000));
+SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
+
+-- add small record to the second page
+INSERT INTO large_tuple_test (select 3, NULL);
+
+-- now this tuple won't fit on the second page, but the insert should
+-- still succeed by extending the relation
+INSERT INTO large_tuple_test (select 4, repeat('a', 8126));
+
+DROP TABLE large_tuple_test;
+
+--
+-- check indirection (field/array assignment), cf bug #14265
+--
+-- these tests are aware that transformInsertStmt has 3 separate code paths
+--
+
+create type insert_test_type as (if1 int, if2 text[]);
+
+create table inserttest (f1 int, f2 int[],
+ f3 insert_test_type, f4 insert_test_type[]);
+
+insert into inserttest (f2[1], f2[2]) values (1,2);
+insert into inserttest (f2[1], f2[2]) values (3,4), (5,6);
+insert into inserttest (f2[1], f2[2]) select 7,8;
+insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
+
+insert into inserttest (f3.if1, f3.if2) values (1,array['foo']);
+insert into inserttest (f3.if1, f3.if2) values (1,'{foo}'), (2,'{bar}');
+insert into inserttest (f3.if1, f3.if2) select 3, '{baz,quux}';
+insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
+
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar');
+insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+insert into inserttest (f3.if2[1], f3.if2[2]) select 'bear', 'beer';
+
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar');
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar'), ('baz', 'quux');
+insert into inserttest (f4[1].if2[1], f4[1].if2[2]) select 'bear', 'beer';
+
+select * from inserttest;
+
+-- also check reverse-listing
+create table inserttest2 (f1 bigint, f2 text);
+create rule irule1 as on insert to inserttest2 do also
+ insert into inserttest (f3.if2[1], f3.if2[2])
+ values (new.f1,new.f2);
+create rule irule2 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ values (1,'fool'),(new.f1,new.f2);
+create rule irule3 as on insert to inserttest2 do also
+ insert into inserttest (f4[1].if1, f4[1].if2[2])
+ select new.f1, new.f2;
+\d+ inserttest2
+
+drop table inserttest2;
+drop table inserttest;
+drop type insert_test_type;
+
+-- direct partition inserts should check partition bound constraint
+create table range_parted (
+ a text,
+ b int
+) partition by range (a, (b+0));
+
+-- no partitions, so fail
+insert into range_parted values ('a', 11);
+
+create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
+create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
+create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
+create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
+
+-- fail
+insert into part1 values ('a', 11);
+insert into part1 values ('b', 1);
+-- ok
+insert into part1 values ('a', 1);
+-- fail
+insert into part4 values ('b', 21);
+insert into part4 values ('a', 10);
+-- ok
+insert into part4 values ('b', 10);
+
+-- fail (partition key a has a NOT NULL constraint)
+insert into part1 values (null);
+-- fail (expression key (b+0) cannot be null either)
+insert into part1 values (1);
+
+create table list_parted (
+ a text,
+ b int
+) partition by list (lower(a));
+create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
+create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
+create table part_null partition of list_parted FOR VALUES IN (null);
+
+-- fail
+insert into part_aa_bb values ('cc', 1);
+insert into part_aa_bb values ('AAa', 1);
+insert into part_aa_bb values (null);
+-- ok
+insert into part_cc_dd values ('cC', 1);
+insert into part_null values (null, 0);
+
+-- check in case of multi-level partitioned table
+create table part_ee_ff partition of list_parted for values in ('ee', 'ff') partition by range (b);
+create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
+create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
+
+-- test default partition
+create table part_default partition of list_parted default;
+-- Negative test: a row, which would fit in other partition, does not fit
+-- default partition, even when inserted directly
+insert into part_default values ('aa', 2);
+insert into part_default values (null, 2);
+-- ok
+insert into part_default values ('Zz', 2);
+-- test if default partition works as expected for multi-level partitioned
+-- table as well as when default partition itself is further partitioned
+drop table part_default;
+create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
+create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
+create table part_xx_yy_defpart partition of part_xx_yy default;
+create table part_default partition of list_parted default partition by range(b);
+create table part_default_p1 partition of part_default for values from (20) to (30);
+create table part_default_p2 partition of part_default for values from (30) to (40);
+
+-- fail
+insert into part_ee_ff1 values ('EE', 11);
+insert into part_default_p2 values ('gg', 43);
+-- fail (even the parent's, ie, part_ee_ff's partition constraint applies)
+insert into part_ee_ff1 values ('cc', 1);
+insert into part_default values ('gg', 43);
+-- ok
+insert into part_ee_ff1 values ('ff', 1);
+insert into part_ee_ff2 values ('ff', 11);
+insert into part_default_p1 values ('cd', 25);
+insert into part_default_p2 values ('de', 35);
+insert into list_parted values ('ab', 21);
+insert into list_parted values ('xx', 1);
+insert into list_parted values ('yy', 2);
+select tableoid::regclass, * from list_parted;
+
+-- Check tuple routing for partitioned tables
+
+-- fail
+insert into range_parted values ('a', 0);
+-- ok
+insert into range_parted values ('a', 1);
+insert into range_parted values ('a', 10);
+-- fail
+insert into range_parted values ('a', 20);
+-- ok
+insert into range_parted values ('b', 1);
+insert into range_parted values ('b', 10);
+-- fail (partition key (b+0) is null)
+insert into range_parted values ('a');
+
+-- Check default partition
+create table part_def partition of range_parted default;
+-- fail
+insert into part_def values ('b', 10);
+-- ok
+insert into part_def values ('c', 10);
+insert into range_parted values (null, null);
+insert into range_parted values ('a', null);
+insert into range_parted values (null, 19);
+insert into range_parted values ('b', 20);
+
+select tableoid::regclass, * from range_parted;
+-- ok
+insert into list_parted values (null, 1);
+insert into list_parted (a) values ('aA');
+-- fail (partition of part_ee_ff not found in both cases)
+insert into list_parted values ('EE', 0);
+insert into part_ee_ff values ('EE', 0);
+-- ok
+insert into list_parted values ('EE', 1);
+insert into part_ee_ff values ('EE', 10);
+select tableoid::regclass, * from list_parted;
+
+-- some more tests to exercise tuple-routing with multi-level partitioning
+create table part_gg partition of list_parted for values in ('gg') partition by range (b);
+create table part_gg1 partition of part_gg for values from (minvalue) to (1);
+create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
+create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
+create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
+
+create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
+create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
+create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
+
+truncate list_parted;
+insert into list_parted values ('aa'), ('cc');
+insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
+insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
+insert into list_parted (b) values (1);
+select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
+
+-- direct partition inserts should check hash partition bound constraint
+
+-- Use hand-rolled hash functions and operator classes to get predictable
+-- result on different machines. The hash function for int4 simply returns
+-- the sum of the values passed to it and the one for text returns the length
+-- of the non-empty string value passed to it or 0.
+
+create or replace function part_hashint4_noop(value int4, seed int8)
+returns int8 as $$
+select value + seed;
+$$ language sql immutable;
+
+create operator class part_test_int4_ops
+for type int4
+using hash as
+operator 1 =,
+function 2 part_hashint4_noop(int4, int8);
+
+create or replace function part_hashtext_length(value text, seed int8)
+RETURNS int8 AS $$
+select length(coalesce(value, ''))::int8
+$$ language sql immutable;
+
+create operator class part_test_text_ops
+for type text
+using hash as
+operator 1 =,
+function 2 part_hashtext_length(text, int8);
+
+create table hash_parted (
+ a int
+) partition by hash (a part_test_int4_ops);
+create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
+create table hpart1 partition of hash_parted for values with (modulus 4, remainder 1);
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+create table hpart3 partition of hash_parted for values with (modulus 4, remainder 3);
+
+insert into hash_parted values(generate_series(1,10));
+
+-- direct insert of values divisible by 4 - ok;
+insert into hpart0 values(12),(16);
+-- fail;
+insert into hpart0 values(11);
+-- 11 % 4 -> 3 remainder i.e. valid data for hpart3 partition
+insert into hpart3 values(11);
+
+-- view data
+select tableoid::regclass as part, a, a%4 as "remainder = a % 4"
+from hash_parted order by part;
+
+-- test \d+ output on a table which has both partitioned and unpartitioned
+-- partitions
+\d+ list_parted
+
+-- cleanup
+drop table range_parted, list_parted;
+drop table hash_parted;
+
+-- test that a default partition added as the first partition accepts any value
+-- including null
+create table list_parted (a int) partition by list (a);
+create table part_default partition of list_parted default;
+\d+ part_default
+insert into part_default values (null);
+insert into part_default values (1);
+insert into part_default values (-1);
+select tableoid::regclass, a from list_parted;
+-- cleanup
+drop table list_parted;
+
+-- more tests for certain multi-level partitioning scenarios
+create table mlparted (a int, b int) partition by range (a, b);
+create table mlparted1 (b int not null, a int not null) partition by range ((b+0));
+create table mlparted11 (like mlparted1);
+alter table mlparted11 drop a;
+alter table mlparted11 add a int;
+alter table mlparted11 drop a;
+alter table mlparted11 add a int not null;
+-- attnum for key attribute 'a' is different in mlparted, mlparted1, and mlparted11
+select attrelid::regclass, attname, attnum
+from pg_attribute
+where attname = 'a'
+ and (attrelid = 'mlparted'::regclass
+ or attrelid = 'mlparted1'::regclass
+ or attrelid = 'mlparted11'::regclass)
+order by attrelid::regclass::text;
+
+alter table mlparted1 attach partition mlparted11 for values from (2) to (5);
+alter table mlparted attach partition mlparted1 for values from (1, 2) to (1, 10);
+
+-- check that "(1, 2)" is correctly routed to mlparted11.
+insert into mlparted values (1, 2);
+select tableoid::regclass, * from mlparted;
+
+-- check that proper message is shown after failure to route through mlparted1
+insert into mlparted (a, b) values (1, 5);
+
+truncate mlparted;
+alter table mlparted add constraint check_b check (b = 3);
+
+-- have a BR trigger modify the row such that the check_b is violated
+create function mlparted11_trig_fn()
+returns trigger AS
+$$
+begin
+ NEW.b := 4;
+ return NEW;
+end;
+$$
+language plpgsql;
+create trigger mlparted11_trig before insert ON mlparted11
+ for each row execute procedure mlparted11_trig_fn();
+
+-- check that the correct row is shown when constraint check_b fails after
+-- "(1, 2)" is routed to mlparted11 (actually "(1, 4)" would be shown due
+-- to the BR trigger mlparted11_trig_fn)
+insert into mlparted values (1, 2);
+drop trigger mlparted11_trig on mlparted11;
+drop function mlparted11_trig_fn();
+
+-- check that inserting into an internal partition successfully results in
+-- checking its partition constraint before inserting into the leaf partition
+-- selected by tuple-routing
+insert into mlparted1 (a, b) values (2, 3);
+
+-- check routing error through a list partitioned table when the key is null
+create table lparted_nonullpart (a int, b char) partition by list (b);
+create table lparted_nonullpart_a partition of lparted_nonullpart for values in ('a');
+insert into lparted_nonullpart values (1);
+drop table lparted_nonullpart;
+
+-- check that RETURNING works correctly with tuple-routing
+alter table mlparted drop constraint check_b;
+create table mlparted12 partition of mlparted1 for values from (5) to (10);
+create table mlparted2 (b int not null, a int not null);
+alter table mlparted attach partition mlparted2 for values from (1, 10) to (1, 20);
+create table mlparted3 partition of mlparted for values from (1, 20) to (1, 30);
+create table mlparted4 (like mlparted);
+alter table mlparted4 drop a;
+alter table mlparted4 add a int not null;
+alter table mlparted attach partition mlparted4 for values from (1, 30) to (1, 40);
+with ins (a, b, c) as
+ (insert into mlparted (b, a) select s.a, 1 from generate_series(2, 39) s(a) returning tableoid::regclass, *)
+ select a, b, min(c), max(c) from ins group by a, b order by 1;
+
+alter table mlparted add c text;
+create table mlparted5 (c text, a int not null, b int not null) partition by list (c);
+create table mlparted5a (a int not null, c text, b int not null);
+alter table mlparted5 attach partition mlparted5a for values in ('a');
+alter table mlparted attach partition mlparted5 for values from (1, 40) to (1, 50);
+alter table mlparted add constraint check_b check (a = 1 and b < 45);
+insert into mlparted values (1, 45, 'a');
+create function mlparted5abrtrig_func() returns trigger as $$ begin new.c = 'b'; return new; end; $$ language plpgsql;
+create trigger mlparted5abrtrig before insert on mlparted5a for each row execute procedure mlparted5abrtrig_func();
+insert into mlparted5 (a, b, c) values (1, 40, 'a');
+drop table mlparted5;
+alter table mlparted drop constraint check_b;
+
+-- Check multi-level default partition
+create table mlparted_def partition of mlparted default partition by range(a);
+create table mlparted_def1 partition of mlparted_def for values from (40) to (50);
+create table mlparted_def2 partition of mlparted_def for values from (50) to (60);
+insert into mlparted values (40, 100);
+insert into mlparted_def1 values (42, 100);
+insert into mlparted_def2 values (54, 50);
+-- fail
+insert into mlparted values (70, 100);
+insert into mlparted_def1 values (52, 50);
+insert into mlparted_def2 values (34, 50);
+-- ok
+create table mlparted_defd partition of mlparted_def default;
+insert into mlparted values (70, 100);
+
+select tableoid::regclass, * from mlparted_def;
+
+-- Check multi-level tuple routing with attributes dropped from the
+-- top-most parent. First remove the last attribute.
+alter table mlparted add d int, add e int;
+alter table mlparted drop e;
+create table mlparted5 partition of mlparted
+ for values from (1, 40) to (1, 50) partition by range (c);
+create table mlparted5_ab partition of mlparted5
+ for values from ('a') to ('c') partition by list (c);
+-- This partitioned table should remain with no partitions.
+create table mlparted5_cd partition of mlparted5
+ for values from ('c') to ('e') partition by list (c);
+create table mlparted5_a partition of mlparted5_ab for values in ('a');
+create table mlparted5_b (d int, b int, c text, a int);
+alter table mlparted5_ab attach partition mlparted5_b for values in ('b');
+truncate mlparted;
+insert into mlparted values (1, 2, 'a', 1);
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+alter table mlparted drop d;
+truncate mlparted;
+-- Remove the before last attribute.
+alter table mlparted add e int, add d int;
+alter table mlparted drop e;
+insert into mlparted values (1, 2, 'a', 1);
+insert into mlparted values (1, 40, 'a', 1); -- goes to mlparted5_a
+insert into mlparted values (1, 45, 'b', 1); -- goes to mlparted5_b
+insert into mlparted values (1, 45, 'c', 1); -- goes to mlparted5_cd, fails
+insert into mlparted values (1, 45, 'f', 1); -- goes to mlparted5, fails
+select tableoid::regclass, * from mlparted order by a, b, c, d;
+alter table mlparted drop d;
+drop table mlparted5;
+
+-- check that message shown after failure to find a partition shows the
+-- appropriate key description (or none) in various situations
+create table key_desc (a int, b int) partition by list ((a+0));
+create table key_desc_1 partition of key_desc for values in (1) partition by range (b);
+
+create user regress_insert_other_user;
+grant select (a) on key_desc_1 to regress_insert_other_user;
+grant insert on key_desc to regress_insert_other_user;
+
+set role regress_insert_other_user;
+-- no key description is shown
+insert into key_desc values (1, 1);
+
+reset role;
+grant select (b) on key_desc_1 to regress_insert_other_user;
+set role regress_insert_other_user;
+-- key description (b)=(1) is now shown
+insert into key_desc values (1, 1);
+
+-- key description is not shown if key contains expression
+insert into key_desc values (2, 1);
+reset role;
+revoke all on key_desc from regress_insert_other_user;
+revoke all on key_desc_1 from regress_insert_other_user;
+drop role regress_insert_other_user;
+drop table key_desc, key_desc_1;
+
+-- test minvalue/maxvalue restrictions
+create table mcrparted (a int, b int, c int) partition by range (a, abs(b), c);
+create table mcrparted0 partition of mcrparted for values from (minvalue, 0, 0) to (1, maxvalue, maxvalue);
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, minvalue);
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, 0) to (30, 20, minvalue);
+
+-- check multi-column range partitioning expression enforces the same
+-- constraint as what tuple-routing would determine it to be
+create table mcrparted0 partition of mcrparted for values from (minvalue, minvalue, minvalue) to (1, maxvalue, maxvalue);
+create table mcrparted1 partition of mcrparted for values from (2, 1, minvalue) to (10, 5, 10);
+create table mcrparted2 partition of mcrparted for values from (10, 6, minvalue) to (10, maxvalue, maxvalue);
+create table mcrparted3 partition of mcrparted for values from (11, 1, 1) to (20, 10, 10);
+create table mcrparted4 partition of mcrparted for values from (21, minvalue, minvalue) to (30, 20, maxvalue);
+create table mcrparted5 partition of mcrparted for values from (30, 21, 20) to (maxvalue, maxvalue, maxvalue);
+
+-- null not allowed in range partition
+insert into mcrparted values (null, null, null);
+
+-- routed to mcrparted0
+insert into mcrparted values (0, 1, 1);
+insert into mcrparted0 values (0, 1, 1);
+
+-- routed to mcparted1
+insert into mcrparted values (9, 1000, 1);
+insert into mcrparted1 values (9, 1000, 1);
+insert into mcrparted values (10, 5, -1);
+insert into mcrparted1 values (10, 5, -1);
+insert into mcrparted values (2, 1, 0);
+insert into mcrparted1 values (2, 1, 0);
+
+-- routed to mcparted2
+insert into mcrparted values (10, 6, 1000);
+insert into mcrparted2 values (10, 6, 1000);
+insert into mcrparted values (10, 1000, 1000);
+insert into mcrparted2 values (10, 1000, 1000);
+
+-- no partition exists, nor does mcrparted3 accept it
+insert into mcrparted values (11, 1, -1);
+insert into mcrparted3 values (11, 1, -1);
+
+-- routed to mcrparted5
+insert into mcrparted values (30, 21, 20);
+insert into mcrparted5 values (30, 21, 20);
+insert into mcrparted4 values (30, 21, 20); -- error
+
+-- check rows
+select tableoid::regclass::text, * from mcrparted order by 1;
+
+-- cleanup
+drop table mcrparted;
+
+-- check that a BR constraint can't make partition contain violating rows
+create table brtrigpartcon (a int, b text) partition by list (a);
+create table brtrigpartcon1 partition of brtrigpartcon for values in (1);
+create or replace function brtrigpartcon1trigf() returns trigger as $$begin new.a := 2; return new; end$$ language plpgsql;
+create trigger brtrigpartcon1trig before insert on brtrigpartcon1 for each row execute procedure brtrigpartcon1trigf();
+insert into brtrigpartcon values (1, 'hi there');
+insert into brtrigpartcon1 values (1, 'hi there');
+
+-- check that the message shows the appropriate column description in a
+-- situation where the partitioned table is not the primary ModifyTable node
+create table inserttest3 (f1 text default 'foo', f2 text default 'bar', f3 int);
+create role regress_coldesc_role;
+grant insert on inserttest3 to regress_coldesc_role;
+grant insert on brtrigpartcon to regress_coldesc_role;
+revoke select on brtrigpartcon from regress_coldesc_role;
+set role regress_coldesc_role;
+with result as (insert into brtrigpartcon values (1, 'hi there') returning 1)
+ insert into inserttest3 (f3) select * from result;
+reset role;
+
+-- cleanup
+revoke all on inserttest3 from regress_coldesc_role;
+revoke all on brtrigpartcon from regress_coldesc_role;
+drop role regress_coldesc_role;
+drop table inserttest3;
+drop table brtrigpartcon;
+drop function brtrigpartcon1trigf();
+
+-- check that "do nothing" BR triggers work with tuple-routing
+create table donothingbrtrig_test (a int, b text) partition by list (a);
+create table donothingbrtrig_test1 (b text, a int);
+create table donothingbrtrig_test2 (c text, b text, a int);
+alter table donothingbrtrig_test2 drop column c;
+create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
+create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
+alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
+insert into donothingbrtrig_test values (1, 'foo'), (2, 'bar');
+copy donothingbrtrig_test from stdout;
+1 baz
+2 qux
+\.
+select tableoid::regclass, * from donothingbrtrig_test;
+
+-- cleanup
+drop table donothingbrtrig_test;
+drop function donothingbrtrig_func();
+
+-- check multi-column range partitioning with minvalue/maxvalue constraints
+create table mcrparted (a text, b int) partition by range(a, b);
+create table mcrparted1_lt_b partition of mcrparted for values from (minvalue, minvalue) to ('b', minvalue);
+create table mcrparted2_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
+create table mcrparted3_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
+create table mcrparted4_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
+create table mcrparted5_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
+create table mcrparted6_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
+create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
+create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, maxvalue);
+
+\d+ mcrparted
+\d+ mcrparted1_lt_b
+\d+ mcrparted2_b
+\d+ mcrparted3_c_to_common
+\d+ mcrparted4_common_lt_0
+\d+ mcrparted5_common_0_to_10
+\d+ mcrparted6_common_ge_10
+\d+ mcrparted7_gt_common_lt_d
+\d+ mcrparted8_ge_d
+
+insert into mcrparted values ('aaa', 0), ('b', 0), ('bz', 10), ('c', -10),
+ ('comm', -10), ('common', -10), ('common', 0), ('common', 10),
+ ('commons', 0), ('d', -10), ('e', 0);
+select tableoid::regclass, * from mcrparted order by a, b;
+drop table mcrparted;
+
+-- check that wholerow vars in the RETURNING list work with partitioned tables
+create table returningwrtest (a int) partition by list (a);
+create table returningwrtest1 partition of returningwrtest for values in (1);
+insert into returningwrtest values (1) returning returningwrtest;
+
+-- check also that the wholerow vars in RETURNING list are converted as needed
+alter table returningwrtest add b text;
+create table returningwrtest2 (b text, c int, a int);
+alter table returningwrtest2 drop c;
+alter table returningwrtest attach partition returningwrtest2 for values in (2);
+insert into returningwrtest values (2, 'foo') returning returningwrtest;
+drop table returningwrtest;
diff --git a/yql/essentials/tests/postgresql/original/cases/int2.out b/yql/essentials/tests/postgresql/original/cases/int2.out
new file mode 100644
index 0000000000..8a64df725c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int2.out
@@ -0,0 +1,312 @@
+--
+-- INT2
+--
+CREATE TABLE INT2_TBL(f1 int2);
+INSERT INTO INT2_TBL(f1) VALUES ('0 ');
+INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
+INSERT INTO INT2_TBL(f1) VALUES (' -1234');
+INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ERROR: invalid input syntax for type smallint: "34.5"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+ ^
+-- largest and smallest values
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+-- bad input values -- should give errors
+INSERT INTO INT2_TBL(f1) VALUES ('100000');
+ERROR: value "100000" is out of range for type smallint
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('100000');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ERROR: invalid input syntax for type smallint: "asdf"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type smallint: " "
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ERROR: invalid input syntax for type smallint: "- 1234"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ERROR: invalid input syntax for type smallint: "4 444"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ERROR: invalid input syntax for type smallint: "123 dt"
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+ ^
+INSERT INTO INT2_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type smallint: ""
+LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('');
+ ^
+SELECT * FROM INT2_TBL;
+ f1
+--------
+ 0
+ 1234
+ -1234
+ 32767
+ -32767
+(5 rows)
+
+SELECT * FROM INT2_TBL AS f(a, b);
+ERROR: table "f" has 1 columns available but 2 columns specified
+SELECT * FROM (TABLE int2_tbl) AS s (a, b);
+ERROR: table "s" has 1 columns available but 2 columns specified
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
+ f1
+--------
+ 1234
+ -1234
+ 32767
+ -32767
+(4 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
+ f1
+--------
+ 1234
+ -1234
+ 32767
+ -32767
+(4 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
+ f1
+--------
+ -1234
+ -32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
+ f1
+--------
+ -1234
+ -32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
+ f1
+--------
+ 0
+ -1234
+ -32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
+ f1
+--------
+ 0
+ -1234
+ -32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
+ f1
+-------
+ 1234
+ 32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
+ f1
+-------
+ 1234
+ 32767
+(2 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
+ f1
+-------
+ 0
+ 1234
+ 32767
+(3 rows)
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
+ f1
+-------
+ 0
+ 1234
+ 32767
+(3 rows)
+
+-- positive odds
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+ f1
+-------
+ 32767
+(1 row)
+
+-- any evens
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+ f1
+-------
+ 0
+ 1234
+ -1234
+(3 rows)
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i
+WHERE abs(f1) < 16384;
+ f1 | x
+-------+-------
+ 0 | 0
+ 1234 | 2468
+ -1234 | -2468
+(3 rows)
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 2468
+ -1234 | -2468
+ 32767 | 65534
+ -32767 | -65534
+(5 rows)
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i
+WHERE f1 < 32766;
+ f1 | x
+--------+--------
+ 0 | 2
+ 1234 | 1236
+ -1234 | -1232
+ -32767 | -32765
+(4 rows)
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 2
+ 1234 | 1236
+ -1234 | -1232
+ 32767 | 32769
+ -32767 | -32765
+(5 rows)
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+ERROR: smallint out of range
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i
+WHERE f1 > -32767;
+ f1 | x
+-------+-------
+ 0 | -2
+ 1234 | 1232
+ -1234 | -1236
+ 32767 | 32765
+(4 rows)
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | -2
+ 1234 | 1232
+ -1234 | -1236
+ 32767 | 32765
+ -32767 | -32769
+(5 rows)
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 617
+ -1234 | -617
+ 32767 | 16383
+ -32767 | -16383
+(5 rows)
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
+ f1 | x
+--------+--------
+ 0 | 0
+ 1234 | 617
+ -1234 | -617
+ 32767 | 16383
+ -32767 | -16383
+(5 rows)
+
+-- corner cases
+SELECT (-1::int2<<15)::text;
+ text
+--------
+ -32768
+(1 row)
+
+SELECT ((-1::int2<<15)+1::int2)::text;
+ text
+--------
+ -32767
+(1 row)
+
+-- check sane handling of INT16_MIN overflow cases
+SELECT (-32768)::int2 * (-1)::int2;
+ERROR: smallint out of range
+SELECT (-32768)::int2 / (-1)::int2;
+ERROR: smallint out of range
+SELECT (-32768)::int2 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int2_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int2_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/int2.sql b/yql/essentials/tests/postgresql/original/cases/int2.sql
new file mode 100644
index 0000000000..2f5ea64e3b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int2.sql
@@ -0,0 +1,118 @@
+--
+-- INT2
+--
+
+CREATE TABLE INT2_TBL(f1 int2);
+
+INSERT INTO INT2_TBL(f1) VALUES ('0 ');
+
+INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
+
+INSERT INTO INT2_TBL(f1) VALUES (' -1234');
+
+INSERT INTO INT2_TBL(f1) VALUES ('34.5');
+
+-- largest and smallest values
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+
+-- bad input values -- should give errors
+INSERT INTO INT2_TBL(f1) VALUES ('100000');
+INSERT INTO INT2_TBL(f1) VALUES ('asdf');
+INSERT INTO INT2_TBL(f1) VALUES (' ');
+INSERT INTO INT2_TBL(f1) VALUES ('- 1234');
+INSERT INTO INT2_TBL(f1) VALUES ('4 444');
+INSERT INTO INT2_TBL(f1) VALUES ('123 dt');
+INSERT INTO INT2_TBL(f1) VALUES ('');
+
+
+SELECT * FROM INT2_TBL;
+
+SELECT * FROM INT2_TBL AS f(a, b);
+
+SELECT * FROM (TABLE int2_tbl) AS s (a, b);
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
+
+SELECT i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
+
+-- positive odds
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+
+-- any evens
+SELECT i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i
+WHERE abs(f1) < 16384;
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i
+WHERE f1 < 32766;
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i
+WHERE f1 > -32767;
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
+
+-- corner cases
+SELECT (-1::int2<<15)::text;
+SELECT ((-1::int2<<15)+1::int2)::text;
+
+-- check sane handling of INT16_MIN overflow cases
+SELECT (-32768)::int2 * (-1)::int2;
+SELECT (-32768)::int2 / (-1)::int2;
+SELECT (-32768)::int2 % (-1)::int2;
+
+-- check rounding when casting from float
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+
+-- check rounding when casting from numeric
+SELECT x, x::int2 AS int2_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
diff --git a/yql/essentials/tests/postgresql/original/cases/int4.out b/yql/essentials/tests/postgresql/original/cases/int4.out
new file mode 100644
index 0000000000..9d20b3380f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int4.out
@@ -0,0 +1,439 @@
+--
+-- INT4
+--
+CREATE TABLE INT4_TBL(f1 int4);
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ERROR: invalid input syntax for type integer: "34.5"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+ ^
+-- largest and smallest values
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+-- bad input values -- should give errors
+INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+ERROR: value "1000000000000" is out of range for type integer
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ERROR: invalid input syntax for type integer: "asdf"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type integer: " "
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ERROR: invalid input syntax for type integer: " asdf "
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ERROR: invalid input syntax for type integer: "- 1234"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ERROR: invalid input syntax for type integer: "123 5"
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+ ^
+INSERT INTO INT4_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type integer: ""
+LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('');
+ ^
+SELECT * FROM INT4_TBL;
+ f1
+-------------
+ 0
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(5 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0';
+ f1
+-------------
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(4 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0';
+ f1
+-------------
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(4 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int2 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int4 '0';
+ f1
+----
+ 0
+(1 row)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int2 '0';
+ f1
+-------------
+ -123456
+ -2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int4 '0';
+ f1
+-------------
+ -123456
+ -2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0';
+ f1
+-------------
+ 0
+ -123456
+ -2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0';
+ f1
+-------------
+ 0
+ -123456
+ -2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int2 '0';
+ f1
+------------
+ 123456
+ 2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int4 '0';
+ f1
+------------
+ 123456
+ 2147483647
+(2 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0';
+ f1
+------------
+ 0
+ 123456
+ 2147483647
+(3 rows)
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0';
+ f1
+------------
+ 0
+ 123456
+ 2147483647
+(3 rows)
+
+-- positive odds
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+ f1
+------------
+ 2147483647
+(1 row)
+
+-- any evens
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+ f1
+---------
+ 0
+ 123456
+ -123456
+(3 rows)
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+ f1 | x
+---------+---------
+ 0 | 0
+ 123456 | 246912
+ -123456 | -246912
+(3 rows)
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+ f1 | x
+---------+---------
+ 0 | 0
+ 123456 | 246912
+ -123456 | -246912
+(3 rows)
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+ f1 | x
+-------------+-------------
+ 0 | 2
+ 123456 | 123458
+ -123456 | -123454
+ -2147483647 | -2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+ f1 | x
+-------------+-------------
+ 0 | 2
+ 123456 | 123458
+ -123456 | -123454
+ -2147483647 | -2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+ f1 | x
+------------+------------
+ 0 | -2
+ 123456 | 123454
+ -123456 | -123458
+ 2147483647 | 2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+ERROR: integer out of range
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+ f1 | x
+------------+------------
+ 0 | -2
+ 123456 | 123454
+ -123456 | -123458
+ 2147483647 | 2147483645
+(4 rows)
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i;
+ f1 | x
+-------------+-------------
+ 0 | 0
+ 123456 | 61728
+ -123456 | -61728
+ 2147483647 | 1073741823
+ -2147483647 | -1073741823
+(5 rows)
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i;
+ f1 | x
+-------------+-------------
+ 0 | 0
+ 123456 | 61728
+ -123456 | -61728
+ 2147483647 | 1073741823
+ -2147483647 | -1073741823
+(5 rows)
+
+--
+-- more complex expressions
+--
+-- variations on unary minus parsing
+SELECT -2+3 AS one;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 4-2 AS two;
+ two
+-----
+ 2
+(1 row)
+
+SELECT 2- -1 AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT 2 - -2 AS four;
+ four
+------
+ 4
+(1 row)
+
+SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT int4 '1000' < int4 '999' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+ ten
+-----
+ 10
+(1 row)
+
+SELECT 2 + 2 / 2 AS three;
+ three
+-------
+ 3
+(1 row)
+
+SELECT (2 + 2) / 2 AS two;
+ two
+-----
+ 2
+(1 row)
+
+-- corner case
+SELECT (-1::int4<<31)::text;
+ text
+-------------
+ -2147483648
+(1 row)
+
+SELECT ((-1::int4<<31)+1)::text;
+ text
+-------------
+ -2147483647
+(1 row)
+
+-- check sane handling of INT_MIN overflow cases
+SELECT (-2147483648)::int4 * (-1)::int4;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 / (-1)::int4;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 % (-1)::int4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-2147483648)::int4 * (-1)::int2;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 / (-1)::int2;
+ERROR: integer out of range
+SELECT (-2147483648)::int4 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int4_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int4_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 6410818::int4),
+ (61866666::int4, 6410818::int4),
+ (-61866666::int4, 6410818::int4),
+ ((-2147483648)::int4, 1::int4),
+ ((-2147483648)::int4, 2147483647::int4),
+ ((-2147483648)::int4, 1073741824::int4)) AS v(a, b);
+ a | b | gcd | gcd | gcd | gcd
+-------------+------------+------------+------------+------------+------------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | 6410818 | 6410818 | 6410818 | 6410818 | 6410818
+ 61866666 | 6410818 | 1466 | 1466 | 1466 | 1466
+ -61866666 | 6410818 | 1466 | 1466 | 1466 | 1466
+ -2147483648 | 1 | 1 | 1 | 1 | 1
+ -2147483648 | 2147483647 | 1 | 1 | 1 | 1
+ -2147483648 | 1073741824 | 1073741824 | 1073741824 | 1073741824 | 1073741824
+(7 rows)
+
+SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+ERROR: integer out of range
+SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+ERROR: integer out of range
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 42::int4),
+ (42::int4, 42::int4),
+ (330::int4, 462::int4),
+ (-330::int4, 462::int4),
+ ((-2147483648)::int4, 0::int4)) AS v(a, b);
+ a | b | lcm | lcm | lcm | lcm
+-------------+-----+------+------+------+------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | 42 | 0 | 0 | 0 | 0
+ 42 | 42 | 42 | 42 | 42 | 42
+ 330 | 462 | 2310 | 2310 | 2310 | 2310
+ -330 | 462 | 2310 | 2310 | 2310 | 2310
+ -2147483648 | 0 | 0 | 0 | 0 | 0
+(6 rows)
+
+SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+ERROR: integer out of range
+SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
+ERROR: integer out of range
diff --git a/yql/essentials/tests/postgresql/original/cases/int4.sql b/yql/essentials/tests/postgresql/original/cases/int4.sql
new file mode 100644
index 0000000000..55ec07a147
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int4.sql
@@ -0,0 +1,178 @@
+--
+-- INT4
+--
+
+CREATE TABLE INT4_TBL(f1 int4);
+
+INSERT INTO INT4_TBL(f1) VALUES (' 0 ');
+
+INSERT INTO INT4_TBL(f1) VALUES ('123456 ');
+
+INSERT INTO INT4_TBL(f1) VALUES (' -123456');
+
+INSERT INTO INT4_TBL(f1) VALUES ('34.5');
+
+-- largest and smallest values
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+
+-- bad input values -- should give errors
+INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
+INSERT INTO INT4_TBL(f1) VALUES ('asdf');
+INSERT INTO INT4_TBL(f1) VALUES (' ');
+INSERT INTO INT4_TBL(f1) VALUES (' asdf ');
+INSERT INTO INT4_TBL(f1) VALUES ('- 1234');
+INSERT INTO INT4_TBL(f1) VALUES ('123 5');
+INSERT INTO INT4_TBL(f1) VALUES ('');
+
+
+SELECT * FROM INT4_TBL;
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 = int4 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 < int4 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 > int4 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0';
+
+SELECT i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0';
+
+-- positive odds
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
+
+-- any evens
+SELECT i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i
+WHERE abs(f1) < 1073741824;
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i
+WHERE f1 < 2147483646;
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i
+WHERE f1 > -2147483647;
+
+SELECT i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i;
+
+SELECT i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i;
+
+--
+-- more complex expressions
+--
+
+-- variations on unary minus parsing
+SELECT -2+3 AS one;
+
+SELECT 4-2 AS two;
+
+SELECT 2- -1 AS three;
+
+SELECT 2 - -2 AS four;
+
+SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true;
+
+SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true;
+
+SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true;
+
+SELECT int4 '1000' < int4 '999' AS false;
+
+SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
+
+SELECT 2 + 2 / 2 AS three;
+
+SELECT (2 + 2) / 2 AS two;
+
+-- corner case
+SELECT (-1::int4<<31)::text;
+SELECT ((-1::int4<<31)+1)::text;
+
+-- check sane handling of INT_MIN overflow cases
+SELECT (-2147483648)::int4 * (-1)::int4;
+SELECT (-2147483648)::int4 / (-1)::int4;
+SELECT (-2147483648)::int4 % (-1)::int4;
+SELECT (-2147483648)::int4 * (-1)::int2;
+SELECT (-2147483648)::int4 / (-1)::int2;
+SELECT (-2147483648)::int4 % (-1)::int2;
+
+-- check rounding when casting from float
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+
+-- check rounding when casting from numeric
+SELECT x, x::int4 AS int4_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 6410818::int4),
+ (61866666::int4, 6410818::int4),
+ (-61866666::int4, 6410818::int4),
+ ((-2147483648)::int4, 1::int4),
+ ((-2147483648)::int4, 2147483647::int4),
+ ((-2147483648)::int4, 1073741824::int4)) AS v(a, b);
+
+SELECT gcd((-2147483648)::int4, 0::int4); -- overflow
+SELECT gcd((-2147483648)::int4, (-2147483648)::int4); -- overflow
+
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int4, 0::int4),
+ (0::int4, 42::int4),
+ (42::int4, 42::int4),
+ (330::int4, 462::int4),
+ (-330::int4, 462::int4),
+ ((-2147483648)::int4, 0::int4)) AS v(a, b);
+
+SELECT lcm((-2147483648)::int4, 1::int4); -- overflow
+SELECT lcm(2147483647::int4, 2147483646::int4); -- overflow
diff --git a/yql/essentials/tests/postgresql/original/cases/int8.out b/yql/essentials/tests/postgresql/original/cases/int8.out
new file mode 100644
index 0000000000..36540ec456
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int8.out
@@ -0,0 +1,934 @@
+--
+-- INT8
+-- Test int8 64-bit integers.
+--
+CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+-- bad inputs
+INSERT INTO INT8_TBL(q1) VALUES (' ');
+ERROR: invalid input syntax for type bigint: " "
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' ');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ERROR: invalid input syntax for type bigint: "xxx"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+ERROR: value "3908203590239580293850293850329485" is out of range for type bigint
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('39082035902395802938502938...
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+ERROR: value "-1204982019841029840928340329840934" is out of range for type bigint
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340...
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ERROR: invalid input syntax for type bigint: "- 123"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ERROR: invalid input syntax for type bigint: " 345 5"
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+ ^
+INSERT INTO INT8_TBL(q1) VALUES ('');
+ERROR: invalid input syntax for type bigint: ""
+LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('');
+ ^
+SELECT * FROM INT8_TBL;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 > q1;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+ q1 | q2
+----+----
+(0 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+ plus | minus
+------------------+-------------------
+ 123 | -123
+ 123 | -123
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+ q1 | q2 | plus
+------------------+-------------------+------------------
+ 123 | 456 | 579
+ 123 | 4567890123456789 | 4567890123456912
+ 4567890123456789 | 123 | 4567890123456912
+ 4567890123456789 | 4567890123456789 | 9135780246913578
+ 4567890123456789 | -4567890123456789 | 0
+(5 rows)
+
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+ q1 | q2 | minus
+------------------+-------------------+-------------------
+ 123 | 456 | -333
+ 123 | 4567890123456789 | -4567890123456666
+ 4567890123456789 | 123 | 4567890123456666
+ 4567890123456789 | 4567890123456789 | 0
+ 4567890123456789 | -4567890123456789 | 9135780246913578
+(5 rows)
+
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ERROR: bigint out of range
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+ q1 | q2 | multiply
+------------------+------------------+--------------------
+ 123 | 456 | 56088
+ 123 | 4567890123456789 | 561850485185185047
+ 4567890123456789 | 123 | 561850485185185047
+(3 rows)
+
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+ q1 | q2 | divide | mod
+------------------+-------------------+----------------+-----
+ 123 | 456 | 0 | 123
+ 123 | 4567890123456789 | 0 | 123
+ 4567890123456789 | 123 | 37137318076884 | 57
+ 4567890123456789 | 4567890123456789 | 1 | 0
+ 4567890123456789 | -4567890123456789 | -1 | 0
+(5 rows)
+
+SELECT q1, float8(q1) FROM INT8_TBL;
+ q1 | float8
+------------------+-----------------------
+ 123 | 123
+ 123 | 123
+ 4567890123456789 | 4.567890123456789e+15
+ 4567890123456789 | 4.567890123456789e+15
+ 4567890123456789 | 4.567890123456789e+15
+(5 rows)
+
+SELECT q2, float8(q2) FROM INT8_TBL;
+ q2 | float8
+-------------------+------------------------
+ 456 | 456
+ 4567890123456789 | 4.567890123456789e+15
+ 123 | 123
+ 4567890123456789 | 4.567890123456789e+15
+ -4567890123456789 | -4.567890123456789e+15
+(5 rows)
+
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+ plus4
+------------------
+ 160
+ 160
+ 4567890123456826
+ 4567890123456826
+ 4567890123456826
+(5 rows)
+
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+ minus4
+-------------------
+ -86
+ -86
+ -4567890123456752
+ -4567890123456752
+ -4567890123456752
+(5 rows)
+
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+ 8plus4 | 8minus4 | 8mul4 | 8div4
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+ 4plus8 | 4minus8 | 4mul8 | 4div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+ 8plus2 | 8minus2 | 8mul2 | 8div2
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+ 2plus8 | 2minus8 | 2mul8 | 2div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+SELECT q2, abs(q2) FROM INT8_TBL;
+ q2 | abs
+-------------------+------------------
+ 456 | 456
+ 4567890123456789 | 4567890123456789
+ 123 | 123
+ 4567890123456789 | 4567890123456789
+ -4567890123456789 | 4567890123456789
+(5 rows)
+
+SELECT min(q1), min(q2) FROM INT8_TBL;
+ min | min
+-----+-------------------
+ 123 | -4567890123456789
+(1 row)
+
+SELECT max(q1), max(q2) FROM INT8_TBL;
+ max | max
+------------------+------------------
+ 4567890123456789 | 4567890123456789
+(1 row)
+
+-- TO_CHAR()
+--
+SELECT to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+ FROM INT8_TBL;
+ to_char | to_char
+------------------------+------------------------
+ 123 | 456
+ 123 | 4,567,890,123,456,789
+ 4,567,890,123,456,789 | 123
+ 4,567,890,123,456,789 | 4,567,890,123,456,789
+ 4,567,890,123,456,789 | -4,567,890,123,456,789
+(5 rows)
+
+SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ FROM INT8_TBL;
+ to_char | to_char
+--------------------------------+--------------------------------
+ 123.000,000 | 456.000,000
+ 123.000,000 | 4,567,890,123,456,789.000,000
+ 4,567,890,123,456,789.000,000 | 123.000,000
+ 4,567,890,123,456,789.000,000 | 4,567,890,123,456,789.000,000
+ 4,567,890,123,456,789.000,000 | -4,567,890,123,456,789.000,000
+(5 rows)
+
+SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ FROM INT8_TBL;
+ to_char | to_char
+--------------------+------------------------
+ <123> | <456.000>
+ <123> | <4567890123456789.000>
+ <4567890123456789> | <123.000>
+ <4567890123456789> | <4567890123456789.000>
+ <4567890123456789> | 4567890123456789.000
+(5 rows)
+
+SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ FROM INT8_TBL;
+ to_char | to_char
+-------------------+-------------------
+ 123- | -456
+ 123- | -4567890123456789
+ 4567890123456789- | -123
+ 4567890123456789- | -4567890123456789
+ 4567890123456789- | +4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 456
+ 4567890123456789
+ 123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +456
+ +4567890123456789
+ +123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+ to_char
+--------------------
+ 456TH
+ 4567890123456789TH
+ 123RD
+ 4567890123456789TH
+ <4567890123456789>
+(5 rows)
+
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+ to_char
+---------------------
+ + 456th
+ +4567890123456789th
+ + 123rd
+ +4567890123456789th
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +0000000000000456
+ +4567890123456789
+ +0000000000000123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+ to_char
+-----------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+ to_char
+------------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+ to_char
+--------------------
+ 456.
+ 4567890123456789.
+ 123.
+ 4567890123456789.
+ -4567890123456789.
+(5 rows)
+
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+ to_char
+-------------------------------------------
+ +4 5 6 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ +1 2 3 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ -4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+(5 rows)
+
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+ to_char
+-----------------------------------------------------------
+ text 9999 "text between quote marks" 456
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ text 9999 "text between quote marks" 123
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ -45678 text 9012 9999 345 "text between quote marks" 6789
+(5 rows)
+
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ + 456
+ 456789+0123456789
+ + 123
+ 456789+0123456789
+ 456789-0123456789
+(5 rows)
+
+-- check min/max values and overflow behavior
+select '-9223372036854775808'::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR: value "-9223372036854775809" is out of range for type bigint
+LINE 1: select '-9223372036854775809'::int8;
+ ^
+select '9223372036854775807'::int8;
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR: value "9223372036854775808" is out of range for type bigint
+LINE 1: select '9223372036854775808'::int8;
+ ^
+select -('-9223372036854775807'::int8);
+ ?column?
+---------------------
+ 9223372036854775807
+(1 row)
+
+select -('-9223372036854775808'::int8);
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 / '0'::int8;
+ERROR: division by zero
+select '9223372036854775800'::int8 % '0'::int8;
+ERROR: division by zero
+select abs('-9223372036854775808'::int8);
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '100'::int4;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '100'::int4;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '100'::int4;
+ERROR: bigint out of range
+select '100'::int4 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-100'::int4 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int4 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 + '100'::int2;
+ERROR: bigint out of range
+select '-9223372036854775800'::int8 - '100'::int2;
+ERROR: bigint out of range
+select '9223372036854775800'::int8 * '100'::int2;
+ERROR: bigint out of range
+select '-9223372036854775808'::int8 / '0'::int2;
+ERROR: division by zero
+select '100'::int2 + '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '-100'::int2 - '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int2 * '9223372036854775800'::int8;
+ERROR: bigint out of range
+select '100'::int2 / '0'::int8;
+ERROR: division by zero
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 = 456;
+ q1
+-----
+ 123
+(1 row)
+
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 <> 456;
+ERROR: integer out of range
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 = 456;
+ q1
+-----
+ 123
+(1 row)
+
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 <> 456;
+ERROR: smallint out of range
+SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
+ int8 | int8
+------+------
+ 42 | -37
+(1 row)
+
+SELECT CAST(q1 AS float4), CAST(q2 AS float8) FROM INT8_TBL;
+ q1 | q2
+-------------+------------------------
+ 123 | 456
+ 123 | 4.567890123456789e+15
+ 4.56789e+15 | 123
+ 4.56789e+15 | 4.567890123456789e+15
+ 4.56789e+15 | -4.567890123456789e+15
+(5 rows)
+
+SELECT CAST('36854775807.0'::float4 AS int8);
+ int8
+-------------
+ 36854775808
+(1 row)
+
+SELECT CAST('922337203685477580700.0'::float8 AS int8);
+ERROR: bigint out of range
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ERROR: OID out of range
+SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
+ oid
+------
+ 1259
+(1 row)
+
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+ q1 | q2 | and | or | xor | not
+------------------+-------------------+------------------+------------------+------------------+-------------------
+ 123 | 456 | 72 | 507 | 435 | -124
+ 123 | 4567890123456789 | 17 | 4567890123456895 | 4567890123456878 | -124
+ 4567890123456789 | 123 | 17 | 4567890123456895 | 4567890123456878 | -4567890123456790
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 0 | -4567890123456790
+ 4567890123456789 | -4567890123456789 | 1 | -1 | -2 | -4567890123456790
+(5 rows)
+
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+ q1 | shl | shr
+------------------+-------------------+-----------------
+ 123 | 492 | 15
+ 123 | 492 | 15
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+(5 rows)
+
+-- generate_series
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
+ generate_series
+------------------
+ 4567890123456789
+ 4567890123456790
+ 4567890123456791
+ 4567890123456792
+ 4567890123456793
+ 4567890123456794
+ 4567890123456795
+ 4567890123456796
+ 4567890123456797
+ 4567890123456798
+ 4567890123456799
+(11 rows)
+
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+ERROR: step size cannot equal zero
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
+ generate_series
+------------------
+ 4567890123456789
+ 4567890123456791
+ 4567890123456793
+ 4567890123456795
+ 4567890123456797
+ 4567890123456799
+(6 rows)
+
+-- corner case
+SELECT (-1::int8<<63)::text;
+ text
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT ((-1::int8<<63)+1)::text;
+ text
+----------------------
+ -9223372036854775807
+(1 row)
+
+-- check sane handling of INT64_MIN overflow cases
+SELECT (-9223372036854775808)::int8 * (-1)::int8;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int8;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int8;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-9223372036854775808)::int8 * (-1)::int4;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int4;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int4;
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT (-9223372036854775808)::int8 * (-1)::int2;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 / (-1)::int2;
+ERROR: bigint out of range
+SELECT (-9223372036854775808)::int8 % (-1)::int2;
+ ?column?
+----------
+ 0
+(1 row)
+
+-- check rounding when casting from float
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+ x | int8_value
+------+------------
+ -2.5 | -2
+ -1.5 | -2
+ -0.5 | 0
+ 0 | 0
+ 0.5 | 0
+ 1.5 | 2
+ 2.5 | 2
+(7 rows)
+
+-- check rounding when casting from numeric
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+ x | int8_value
+------+------------
+ -2.5 | -3
+ -1.5 | -2
+ -0.5 | -1
+ 0.0 | 0
+ 0.5 | 1
+ 1.5 | 2
+ 2.5 | 3
+(7 rows)
+
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 1::int8),
+ ((-9223372036854775808)::int8, 9223372036854775807::int8),
+ ((-9223372036854775808)::int8, 4611686018427387904::int8)) AS v(a, b);
+ a | b | gcd | gcd | gcd | gcd
+----------------------+---------------------+---------------------+---------------------+---------------------+---------------------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | 29893644334 | 29893644334 | 29893644334 | 29893644334 | 29893644334
+ 288484263558 | 29893644334 | 6835958 | 6835958 | 6835958 | 6835958
+ -288484263558 | 29893644334 | 6835958 | 6835958 | 6835958 | 6835958
+ -9223372036854775808 | 1 | 1 | 1 | 1 | 1
+ -9223372036854775808 | 9223372036854775807 | 1 | 1 | 1 | 1
+ -9223372036854775808 | 4611686018427387904 | 4611686018427387904 | 4611686018427387904 | 4611686018427387904 | 4611686018427387904
+(7 rows)
+
+SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+ERROR: bigint out of range
+SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+ERROR: bigint out of range
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (29893644334::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 0::int8)) AS v(a, b);
+ a | b | lcm | lcm | lcm | lcm
+----------------------+-------------+------------------+------------------+------------------+------------------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | 29893644334 | 0 | 0 | 0 | 0
+ 29893644334 | 29893644334 | 29893644334 | 29893644334 | 29893644334 | 29893644334
+ 288484263558 | 29893644334 | 1261541684539134 | 1261541684539134 | 1261541684539134 | 1261541684539134
+ -288484263558 | 29893644334 | 1261541684539134 | 1261541684539134 | 1261541684539134 | 1261541684539134
+ -9223372036854775808 | 0 | 0 | 0 | 0 | 0
+(6 rows)
+
+SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+ERROR: bigint out of range
+SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
+ERROR: bigint out of range
diff --git a/yql/essentials/tests/postgresql/original/cases/int8.sql b/yql/essentials/tests/postgresql/original/cases/int8.sql
new file mode 100644
index 0000000000..32940b4daa
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/int8.sql
@@ -0,0 +1,252 @@
+--
+-- INT8
+-- Test int8 64-bit integers.
+--
+CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+
+INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+
+-- bad inputs
+INSERT INTO INT8_TBL(q1) VALUES (' ');
+INSERT INTO INT8_TBL(q1) VALUES ('xxx');
+INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
+INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
+INSERT INTO INT8_TBL(q1) VALUES ('- 123');
+INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
+INSERT INTO INT8_TBL(q1) VALUES ('');
+
+SELECT * FROM INT8_TBL;
+
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+SELECT * FROM INT8_TBL WHERE 123 > q1;
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+
+
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+
+SELECT q1, float8(q1) FROM INT8_TBL;
+SELECT q2, float8(q2) FROM INT8_TBL;
+
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+
+SELECT q2, abs(q2) FROM INT8_TBL;
+SELECT min(q1), min(q2) FROM INT8_TBL;
+SELECT max(q1), max(q2) FROM INT8_TBL;
+
+
+-- TO_CHAR()
+--
+SELECT to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+ FROM INT8_TBL;
+
+SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ FROM INT8_TBL;
+
+SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ FROM INT8_TBL;
+
+SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ FROM INT8_TBL;
+
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+
+-- check min/max values and overflow behavior
+
+select '-9223372036854775808'::int8;
+select '-9223372036854775809'::int8;
+select '9223372036854775807'::int8;
+select '9223372036854775808'::int8;
+
+select -('-9223372036854775807'::int8);
+select -('-9223372036854775808'::int8);
+
+select '9223372036854775800'::int8 + '9223372036854775800'::int8;
+select '-9223372036854775800'::int8 + '-9223372036854775800'::int8;
+
+select '9223372036854775800'::int8 - '-9223372036854775800'::int8;
+select '-9223372036854775800'::int8 - '9223372036854775800'::int8;
+
+select '9223372036854775800'::int8 * '9223372036854775800'::int8;
+
+select '9223372036854775800'::int8 / '0'::int8;
+select '9223372036854775800'::int8 % '0'::int8;
+
+select abs('-9223372036854775808'::int8);
+
+select '9223372036854775800'::int8 + '100'::int4;
+select '-9223372036854775800'::int8 - '100'::int4;
+select '9223372036854775800'::int8 * '100'::int4;
+
+select '100'::int4 + '9223372036854775800'::int8;
+select '-100'::int4 - '9223372036854775800'::int8;
+select '100'::int4 * '9223372036854775800'::int8;
+
+select '9223372036854775800'::int8 + '100'::int2;
+select '-9223372036854775800'::int8 - '100'::int2;
+select '9223372036854775800'::int8 * '100'::int2;
+select '-9223372036854775808'::int8 / '0'::int2;
+
+select '100'::int2 + '9223372036854775800'::int8;
+select '-100'::int2 - '9223372036854775800'::int8;
+select '100'::int2 * '9223372036854775800'::int8;
+select '100'::int2 / '0'::int8;
+
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 = 456;
+SELECT CAST(q1 AS int4) FROM int8_tbl WHERE q2 <> 456;
+
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 = 456;
+SELECT CAST(q1 AS int2) FROM int8_tbl WHERE q2 <> 456;
+
+SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
+
+SELECT CAST(q1 AS float4), CAST(q2 AS float8) FROM INT8_TBL;
+SELECT CAST('36854775807.0'::float4 AS int8);
+SELECT CAST('922337203685477580700.0'::float8 AS int8);
+
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
+
+
+-- bit operations
+
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+
+
+-- generate_series
+
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 0);
+SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
+
+-- corner case
+SELECT (-1::int8<<63)::text;
+SELECT ((-1::int8<<63)+1)::text;
+
+-- check sane handling of INT64_MIN overflow cases
+SELECT (-9223372036854775808)::int8 * (-1)::int8;
+SELECT (-9223372036854775808)::int8 / (-1)::int8;
+SELECT (-9223372036854775808)::int8 % (-1)::int8;
+SELECT (-9223372036854775808)::int8 * (-1)::int4;
+SELECT (-9223372036854775808)::int8 / (-1)::int4;
+SELECT (-9223372036854775808)::int8 % (-1)::int4;
+SELECT (-9223372036854775808)::int8 * (-1)::int2;
+SELECT (-9223372036854775808)::int8 / (-1)::int2;
+SELECT (-9223372036854775808)::int8 % (-1)::int2;
+
+-- check rounding when casting from float
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::float8),
+ (-1.5::float8),
+ (-0.5::float8),
+ (0.0::float8),
+ (0.5::float8),
+ (1.5::float8),
+ (2.5::float8)) t(x);
+
+-- check rounding when casting from numeric
+SELECT x, x::int8 AS int8_value
+FROM (VALUES (-2.5::numeric),
+ (-1.5::numeric),
+ (-0.5::numeric),
+ (0.0::numeric),
+ (0.5::numeric),
+ (1.5::numeric),
+ (2.5::numeric)) t(x);
+
+-- test gcd()
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(b, a), gcd(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 1::int8),
+ ((-9223372036854775808)::int8, 9223372036854775807::int8),
+ ((-9223372036854775808)::int8, 4611686018427387904::int8)) AS v(a, b);
+
+SELECT gcd((-9223372036854775808)::int8, 0::int8); -- overflow
+SELECT gcd((-9223372036854775808)::int8, (-9223372036854775808)::int8); -- overflow
+
+-- test lcm()
+SELECT a, b, lcm(a, b), lcm(a, -b), lcm(b, a), lcm(-b, a)
+FROM (VALUES (0::int8, 0::int8),
+ (0::int8, 29893644334::int8),
+ (29893644334::int8, 29893644334::int8),
+ (288484263558::int8, 29893644334::int8),
+ (-288484263558::int8, 29893644334::int8),
+ ((-9223372036854775808)::int8, 0::int8)) AS v(a, b);
+
+SELECT lcm((-9223372036854775808)::int8, 1::int8); -- overflow
+SELECT lcm(9223372036854775807::int8, 9223372036854775806::int8); -- overflow
diff --git a/yql/essentials/tests/postgresql/original/cases/interval.out b/yql/essentials/tests/postgresql/original/cases/interval.out
new file mode 100644
index 0000000000..8e2d535543
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/interval.out
@@ -0,0 +1,1045 @@
+--
+-- INTERVAL
+--
+SET DATESTYLE = 'ISO';
+SET IntervalStyle to postgres;
+-- check acceptance of "time zone style"
+SELECT INTERVAL '01:00' AS "One hour";
+ One hour
+----------
+ 01:00:00
+(1 row)
+
+SELECT INTERVAL '+02:00' AS "Two hours";
+ Two hours
+-----------
+ 02:00:00
+(1 row)
+
+SELECT INTERVAL '-08:00' AS "Eight hours";
+ Eight hours
+-------------
+ -08:00:00
+(1 row)
+
+SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
+ 22 hours ago...
+-------------------
+ -1 days +02:03:00
+(1 row)
+
+SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
+ 22 hours ago...
+-------------------
+ -1 days +02:03:00
+(1 row)
+
+SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
+ Ten days twelve hours
+-----------------------
+ 10 days 12:00:00
+(1 row)
+
+SELECT INTERVAL '1.5 months' AS "One month 15 days";
+ One month 15 days
+-------------------
+ 1 mon 15 days
+(1 row)
+
+SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
+ 9 years...
+----------------------------------
+ 9 years 1 mon -12 days +13:14:00
+(1 row)
+
+CREATE TABLE INTERVAL_TBL (f1 interval);
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+-- badly formatted interval
+INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
+ERROR: invalid input syntax for type interval: "badly formatted interval"
+LINE 1: INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted inter...
+ ^
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ERROR: invalid input syntax for type interval: "@ 30 eons ago"
+LINE 1: INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+ ^
+-- test interval operators
+SELECT * FROM INTERVAL_TBL;
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 10 days
+ 34 years
+ 3 mons
+ -00:00:14
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(10 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 34 years
+ 3 mons
+ -00:00:14
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(9 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
+ f1
+-----------
+ 00:01:00
+ 05:00:00
+ -00:00:14
+(3 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
+ f1
+-----------
+ 00:01:00
+ 05:00:00
+ -00:00:14
+(3 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
+ f1
+----------
+ 34 years
+(1 row)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
+ f1
+-----------------
+ 34 years
+ 3 mons
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(5 rows)
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
+ f1
+-----------------
+ 00:01:00
+ 05:00:00
+ 10 days
+ 34 years
+ 3 mons
+ 1 day 02:03:04
+ 6 years
+ 5 mons
+ 5 mons 12:00:00
+(9 rows)
+
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL r1, INTERVAL_TBL r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+ f1 | f1
+-----------------+-----------------
+ 00:01:00 | -00:00:14
+ 05:00:00 | -00:00:14
+ 05:00:00 | 00:01:00
+ 1 day 02:03:04 | -00:00:14
+ 1 day 02:03:04 | 00:01:00
+ 1 day 02:03:04 | 05:00:00
+ 10 days | -00:00:14
+ 10 days | 00:01:00
+ 10 days | 05:00:00
+ 10 days | 1 day 02:03:04
+ 3 mons | -00:00:14
+ 3 mons | 00:01:00
+ 3 mons | 05:00:00
+ 3 mons | 1 day 02:03:04
+ 3 mons | 10 days
+ 5 mons | -00:00:14
+ 5 mons | 00:01:00
+ 5 mons | 05:00:00
+ 5 mons | 1 day 02:03:04
+ 5 mons | 10 days
+ 5 mons | 3 mons
+ 5 mons 12:00:00 | -00:00:14
+ 5 mons 12:00:00 | 00:01:00
+ 5 mons 12:00:00 | 05:00:00
+ 5 mons 12:00:00 | 1 day 02:03:04
+ 5 mons 12:00:00 | 10 days
+ 5 mons 12:00:00 | 3 mons
+ 5 mons 12:00:00 | 5 mons
+ 6 years | -00:00:14
+ 6 years | 00:01:00
+ 6 years | 05:00:00
+ 6 years | 1 day 02:03:04
+ 6 years | 10 days
+ 6 years | 3 mons
+ 6 years | 5 mons
+ 6 years | 5 mons 12:00:00
+ 34 years | -00:00:14
+ 34 years | 00:01:00
+ 34 years | 05:00:00
+ 34 years | 1 day 02:03:04
+ 34 years | 10 days
+ 34 years | 3 mons
+ 34 years | 5 mons
+ 34 years | 5 mons 12:00:00
+ 34 years | 6 years
+(45 rows)
+
+-- Test intervals that are large enough to overflow 64 bits in comparisons
+CREATE TEMP TABLE INTERVAL_TBL_OF (f1 interval);
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES
+ ('2147483647 days 2147483647 months'),
+ ('2147483647 days -2147483648 months'),
+ ('1 year'),
+ ('-2147483648 days 2147483647 months'),
+ ('-2147483648 days -2147483648 months');
+-- these should fail as out-of-range
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+ERROR: interval field value out of range: "2147483648 days"
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+ERROR: interval field value out of range: "-2147483649 days"
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days')...
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+ERROR: interval out of range
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years')...
+ ^
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+ERROR: interval out of range
+LINE 1: INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years'...
+ ^
+-- Test edge-case overflow detection in interval multiplication
+select extract(epoch from '256 microseconds'::interval * (2^55)::float8);
+ERROR: interval out of range
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL_OF r1, INTERVAL_TBL_OF r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+ f1 | f1
+-------------------------------------------+-------------------------------------------
+ -178956970 years -8 mons +2147483647 days | -178956970 years -8 mons -2147483648 days
+ 1 year | -178956970 years -8 mons -2147483648 days
+ 1 year | -178956970 years -8 mons +2147483647 days
+ 178956970 years 7 mons -2147483648 days | -178956970 years -8 mons -2147483648 days
+ 178956970 years 7 mons -2147483648 days | -178956970 years -8 mons +2147483647 days
+ 178956970 years 7 mons -2147483648 days | 1 year
+ 178956970 years 7 mons 2147483647 days | -178956970 years -8 mons -2147483648 days
+ 178956970 years 7 mons 2147483647 days | -178956970 years -8 mons +2147483647 days
+ 178956970 years 7 mons 2147483647 days | 1 year
+ 178956970 years 7 mons 2147483647 days | 178956970 years 7 mons -2147483648 days
+(10 rows)
+
+CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
+SET enable_seqscan TO false;
+EXPLAIN (COSTS OFF)
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+ QUERY PLAN
+--------------------------------------------------------------------
+ Index Only Scan using interval_tbl_of_f1_idx on interval_tbl_of r1
+(1 row)
+
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+ f1
+-------------------------------------------
+ -178956970 years -8 mons -2147483648 days
+ -178956970 years -8 mons +2147483647 days
+ 1 year
+ 178956970 years 7 mons -2147483648 days
+ 178956970 years 7 mons 2147483647 days
+(5 rows)
+
+RESET enable_seqscan;
+DROP TABLE INTERVAL_TBL_OF;
+-- Test multiplication and division with intervals.
+-- Floating point arithmetic rounding errors can lead to unexpected results,
+-- though the code attempts to do the right thing and round up to days and
+-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
+-- Note that it is expected for some day components to be greater than 29 and
+-- some time components be greater than 23:59:59 due to how intervals are
+-- stored internally.
+CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
+COPY INTERVAL_MULDIV_TBL FROM STDIN;
+SELECT span * 0.3 AS product
+FROM INTERVAL_MULDIV_TBL;
+ product
+------------------------------------
+ 1 year 12 days 122:24:00
+ -1 years -12 days +93:36:00
+ -3 days -14:24:00
+ 2 mons 13 days 01:22:28.8
+ -10 mons +120 days 37:28:21.6567
+ 1 mon 6 days
+ 4 mons 6 days
+ 24 years 11 mons 320 days 16:48:00
+(8 rows)
+
+SELECT span * 8.2 AS product
+FROM INTERVAL_MULDIV_TBL;
+ product
+---------------------------------------------
+ 28 years 104 days 2961:36:00
+ -28 years -104 days +2942:24:00
+ -98 days -09:36:00
+ 6 years 1 mon -197 days +93:34:27.2
+ -24 years -7 mons +3946 days 640:15:11.9498
+ 2 years 8 mons 24 days
+ 9 years 6 mons 24 days
+ 682 years 7 mons 8215 days 19:12:00
+(8 rows)
+
+SELECT span / 10 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+ quotient
+----------------------------------
+ 4 mons 4 days 40:48:00
+ -4 mons -4 days +31:12:00
+ -1 days -04:48:00
+ 25 days -15:32:30.4
+ -3 mons +30 days 12:29:27.2189
+ 12 days
+ 1 mon 12 days
+ 8 years 3 mons 126 days 21:36:00
+(8 rows)
+
+SELECT span / 100 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+ quotient
+-------------------------
+ 12 days 13:40:48
+ -12 days -06:28:48
+ -02:52:48
+ 2 days 10:26:44.96
+ -6 days +01:14:56.72189
+ 1 day 04:48:00
+ 4 days 04:48:00
+ 9 mons 39 days 16:33:36
+(8 rows)
+
+DROP TABLE INTERVAL_MULDIV_TBL;
+SET DATESTYLE = 'postgres';
+SET IntervalStyle to postgres_verbose;
+SELECT * FROM INTERVAL_TBL;
+ f1
+-------------------------------
+ @ 1 min
+ @ 5 hours
+ @ 10 days
+ @ 34 years
+ @ 3 mons
+ @ 14 secs ago
+ @ 1 day 2 hours 3 mins 4 secs
+ @ 6 years
+ @ 5 mons
+ @ 5 mons 12 hours
+(10 rows)
+
+-- test avg(interval), which is somewhat fragile since people have been
+-- known to change the allowed input syntax for type interval without
+-- updating pg_aggregate.agginitval
+select avg(f1) from interval_tbl;
+ avg
+-------------------------------------------------
+ @ 4 years 1 mon 10 days 4 hours 18 mins 23 secs
+(1 row)
+
+-- test long interval input
+select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
+ interval
+--------------------------------------------
+ @ 4541 years 4 mons 4 days 17 mins 31 secs
+(1 row)
+
+-- test long interval output
+-- Note: the actual maximum length of the interval output is longer,
+-- but we need the test to work for both integer and floating-point
+-- timestamps.
+select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
+ interval
+---------------------------------------------------------------------------------------
+ @ 100000000 years 10 mons -1000000000 days -100000 hours -10 mins -10.000001 secs ago
+(1 row)
+
+-- test justify_hours() and justify_days()
+SELECT justify_hours(interval '6 months 3 days 52 hours 3 minutes 2 seconds') as "6 mons 5 days 4 hours 3 mins 2 seconds";
+ 6 mons 5 days 4 hours 3 mins 2 seconds
+----------------------------------------
+ @ 6 mons 5 days 4 hours 3 mins 2 secs
+(1 row)
+
+SELECT justify_days(interval '6 months 36 days 5 hours 4 minutes 3 seconds') as "7 mons 6 days 5 hours 4 mins 3 seconds";
+ 7 mons 6 days 5 hours 4 mins 3 seconds
+----------------------------------------
+ @ 7 mons 6 days 5 hours 4 mins 3 secs
+(1 row)
+
+-- test justify_interval()
+SELECT justify_interval(interval '1 month -1 hour') as "1 month -1 hour";
+ 1 month -1 hour
+--------------------
+ @ 29 days 23 hours
+(1 row)
+
+-- test fractional second input, and detection of duplicate units
+SET DATESTYLE = 'ISO';
+SET IntervalStyle TO postgres;
+SELECT '1 millisecond'::interval, '1 microsecond'::interval,
+ '500 seconds 99 milliseconds 51 microseconds'::interval;
+ interval | interval | interval
+--------------+-----------------+-----------------
+ 00:00:00.001 | 00:00:00.000001 | 00:08:20.099051
+(1 row)
+
+SELECT '3 days 5 milliseconds'::interval;
+ interval
+---------------------
+ 3 days 00:00:00.005
+(1 row)
+
+SELECT '1 second 2 seconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "1 second 2 seconds"
+LINE 1: SELECT '1 second 2 seconds'::interval;
+ ^
+SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "10 milliseconds 20 milliseconds"
+LINE 1: SELECT '10 milliseconds 20 milliseconds'::interval;
+ ^
+SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "5.5 seconds 3 milliseconds"
+LINE 1: SELECT '5.5 seconds 3 milliseconds'::interval;
+ ^
+SELECT '1:20:05 5 microseconds'::interval; -- error
+ERROR: invalid input syntax for type interval: "1:20:05 5 microseconds"
+LINE 1: SELECT '1:20:05 5 microseconds'::interval;
+ ^
+SELECT '1 day 1 day'::interval; -- error
+ERROR: invalid input syntax for type interval: "1 day 1 day"
+LINE 1: SELECT '1 day 1 day'::interval;
+ ^
+SELECT interval '1-2'; -- SQL year-month literal
+ interval
+---------------
+ 1 year 2 mons
+(1 row)
+
+SELECT interval '999' second; -- oversize leading field is ok
+ interval
+----------
+ 00:16:39
+(1 row)
+
+SELECT interval '999' minute;
+ interval
+----------
+ 16:39:00
+(1 row)
+
+SELECT interval '999' hour;
+ interval
+-----------
+ 999:00:00
+(1 row)
+
+SELECT interval '999' day;
+ interval
+----------
+ 999 days
+(1 row)
+
+SELECT interval '999' month;
+ interval
+-----------------
+ 83 years 3 mons
+(1 row)
+
+-- test SQL-spec syntaxes for restricted field sets
+SELECT interval '1' year;
+ interval
+----------
+ 1 year
+(1 row)
+
+SELECT interval '2' month;
+ interval
+----------
+ 2 mons
+(1 row)
+
+SELECT interval '3' day;
+ interval
+----------
+ 3 days
+(1 row)
+
+SELECT interval '4' hour;
+ interval
+----------
+ 04:00:00
+(1 row)
+
+SELECT interval '5' minute;
+ interval
+----------
+ 00:05:00
+(1 row)
+
+SELECT interval '6' second;
+ interval
+----------
+ 00:00:06
+(1 row)
+
+SELECT interval '1' year to month;
+ interval
+----------
+ 1 mon
+(1 row)
+
+SELECT interval '1-2' year to month;
+ interval
+---------------
+ 1 year 2 mons
+(1 row)
+
+SELECT interval '1 2' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2:03' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to hour;
+ interval
+----------------
+ 1 day 02:00:00
+(1 row)
+
+SELECT interval '1 2' day to minute;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to minute;
+ ^
+SELECT interval '1 2:03' day to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2' day to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to second;
+ ^
+SELECT interval '1 2:03' day to second;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' day to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 2' hour to minute;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' hour to minute;
+ ^
+SELECT interval '1 2:03' hour to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' hour to minute;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2' hour to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' hour to second;
+ ^
+SELECT interval '1 2:03' hour to second;
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03:04' hour to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 2' minute to second;
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' minute to second;
+ ^
+SELECT interval '1 2:03' minute to second;
+ interval
+----------------
+ 1 day 00:02:03
+(1 row)
+
+SELECT interval '1 2:03:04' minute to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 +2:03' minute to second;
+ interval
+----------------
+ 1 day 00:02:03
+(1 row)
+
+SELECT interval '1 +2:03:04' minute to second;
+ interval
+----------------
+ 1 day 02:03:04
+(1 row)
+
+SELECT interval '1 -2:03' minute to second;
+ interval
+-----------------
+ 1 day -00:02:03
+(1 row)
+
+SELECT interval '1 -2:03:04' minute to second;
+ interval
+-----------------
+ 1 day -02:03:04
+(1 row)
+
+SELECT interval '123 11' day to hour; -- ok
+ interval
+-------------------
+ 123 days 11:00:00
+(1 row)
+
+SELECT interval '123 11' day; -- not ok
+ERROR: invalid input syntax for type interval: "123 11"
+LINE 1: SELECT interval '123 11' day;
+ ^
+SELECT interval '123 11'; -- not ok, too ambiguous
+ERROR: invalid input syntax for type interval: "123 11"
+LINE 1: SELECT interval '123 11';
+ ^
+SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+ERROR: invalid input syntax for type interval: "123 2:03 -2:04"
+LINE 1: SELECT interval '123 2:03 -2:04';
+ ^
+-- test syntaxes for restricted precision
+SELECT interval(0) '1 day 01:23:45.6789';
+ interval
+----------------
+ 1 day 01:23:46
+(1 row)
+
+SELECT interval(2) '1 day 01:23:45.6789';
+ interval
+-------------------
+ 1 day 01:23:45.68
+(1 row)
+
+SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
+ interval
+-------------
+ 00:12:34.57
+(1 row)
+
+SELECT interval '1.234' second;
+ interval
+--------------
+ 00:00:01.234
+(1 row)
+
+SELECT interval '1.234' second(2);
+ interval
+-------------
+ 00:00:01.23
+(1 row)
+
+SELECT interval '1 2.345' day to second(2);
+ERROR: invalid input syntax for type interval: "1 2.345"
+LINE 1: SELECT interval '1 2.345' day to second(2);
+ ^
+SELECT interval '1 2:03' day to second(2);
+ interval
+----------------
+ 1 day 02:03:00
+(1 row)
+
+SELECT interval '1 2:03.4567' day to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.46
+(1 row)
+
+SELECT interval '1 2:03:04.5678' day to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+SELECT interval '1 2.345' hour to second(2);
+ERROR: invalid input syntax for type interval: "1 2.345"
+LINE 1: SELECT interval '1 2.345' hour to second(2);
+ ^
+SELECT interval '1 2:03.45678' hour to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.46
+(1 row)
+
+SELECT interval '1 2:03:04.5678' hour to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+SELECT interval '1 2.3456' minute to second(2);
+ERROR: invalid input syntax for type interval: "1 2.3456"
+LINE 1: SELECT interval '1 2.3456' minute to second(2);
+ ^
+SELECT interval '1 2:03.5678' minute to second(2);
+ interval
+-------------------
+ 1 day 00:02:03.57
+(1 row)
+
+SELECT interval '1 2:03:04.5678' minute to second(2);
+ interval
+-------------------
+ 1 day 02:03:04.57
+(1 row)
+
+-- test casting to restricted precision (bug #14479)
+SELECT f1, f1::INTERVAL DAY TO MINUTE AS "minutes",
+ (f1 + INTERVAL '1 month')::INTERVAL MONTH::INTERVAL YEAR AS "years"
+ FROM interval_tbl;
+ f1 | minutes | years
+-----------------+-----------------+----------
+ 00:01:00 | 00:01:00 | 00:00:00
+ 05:00:00 | 05:00:00 | 00:00:00
+ 10 days | 10 days | 00:00:00
+ 34 years | 34 years | 34 years
+ 3 mons | 3 mons | 00:00:00
+ -00:00:14 | 00:00:00 | 00:00:00
+ 1 day 02:03:04 | 1 day 02:03:00 | 00:00:00
+ 6 years | 6 years | 6 years
+ 5 mons | 5 mons | 00:00:00
+ 5 mons 12:00:00 | 5 mons 12:00:00 | 00:00:00
+(10 rows)
+
+-- test inputting and outputting SQL standard interval literals
+SET IntervalStyle TO sql_standard;
+SELECT interval '0' AS "zero",
+ interval '1-2' year to month AS "year-month",
+ interval '1 2:03:04' day to second AS "day-time",
+ - interval '1-2' AS "negative year-month",
+ - interval '1 2:03:04' AS "negative day-time";
+ zero | year-month | day-time | negative year-month | negative day-time
+------+------------+-----------+---------------------+-------------------
+ 0 | 1-2 | 1 2:03:04 | -1-2 | -1 2:03:04
+(1 row)
+
+-- test input of some not-quite-standard interval values in the sql style
+SET IntervalStyle TO postgres;
+SELECT interval '+1 -1:00:00',
+ interval '-1 +1:00:00',
+ interval '+1-2 -3 +4:05:06.789',
+ interval '-1-2 +3 -4:05:06.789';
+ interval | interval | interval | interval
+-----------------+-------------------+-------------------------------------+----------------------------------------
+ 1 day -01:00:00 | -1 days +01:00:00 | 1 year 2 mons -3 days +04:05:06.789 | -1 years -2 mons +3 days -04:05:06.789
+(1 row)
+
+-- test output of couple non-standard interval values in the sql style
+SET IntervalStyle TO sql_standard;
+SELECT interval '1 day -1 hours',
+ interval '-1 days +1 hours',
+ interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds',
+ - interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds';
+ interval | interval | interval | ?column?
+------------------+------------------+----------------------+----------------------
+ +0-0 +1 -1:00:00 | +0-0 -1 +1:00:00 | +1-2 -3 +4:05:06.789 | -1-2 +3 -4:05:06.789
+(1 row)
+
+-- test outputting iso8601 intervals
+SET IntervalStyle to iso_8601;
+select interval '0' AS "zero",
+ interval '1-2' AS "a year 2 months",
+ interval '1 2:03:04' AS "a bit over a day",
+ interval '2:03:04.45679' AS "a bit over 2 hours",
+ (interval '1-2' + interval '3 4:05:06.7') AS "all fields",
+ (interval '1-2' - interval '3 4:05:06.7') AS "mixed sign",
+ (- interval '1-2' + interval '3 4:05:06.7') AS "negative";
+ zero | a year 2 months | a bit over a day | a bit over 2 hours | all fields | mixed sign | negative
+------+-----------------+------------------+--------------------+------------------+----------------------+--------------------
+ PT0S | P1Y2M | P1DT2H3M4S | PT2H3M4.45679S | P1Y2M3DT4H5M6.7S | P1Y2M-3DT-4H-5M-6.7S | P-1Y-2M3DT4H5M6.7S
+(1 row)
+
+-- test inputting ISO 8601 4.4.2.1 "Format With Time Unit Designators"
+SET IntervalStyle to sql_standard;
+select interval 'P0Y' AS "zero",
+ interval 'P1Y2M' AS "a year 2 months",
+ interval 'P1W' AS "a week",
+ interval 'P1DT2H3M4S' AS "a bit over a day",
+ interval 'P1Y2M3DT4H5M6.7S' AS "all fields",
+ interval 'P-1Y-2M-3DT-4H-5M-6.7S' AS "negative",
+ interval 'PT-0.1S' AS "fractional second";
+ zero | a year 2 months | a week | a bit over a day | all fields | negative | fractional second
+------+-----------------+-----------+------------------+--------------------+--------------------+-------------------
+ 0 | 1-2 | 7 0:00:00 | 1 2:03:04 | +1-2 +3 +4:05:06.7 | -1-2 -3 -4:05:06.7 | -0:00:00.1
+(1 row)
+
+-- test inputting ISO 8601 4.4.2.2 "Alternative Format"
+SET IntervalStyle to postgres;
+select interval 'P00021015T103020' AS "ISO8601 Basic Format",
+ interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
+ ISO8601 Basic Format | ISO8601 Extended Format
+----------------------------------+----------------------------------
+ 2 years 10 mons 15 days 10:30:20 | 2 years 10 mons 15 days 10:30:20
+(1 row)
+
+-- Make sure optional ISO8601 alternative format fields are optional.
+select interval 'P0002' AS "year only",
+ interval 'P0002-10' AS "year month",
+ interval 'P0002-10-15' AS "year month day",
+ interval 'P0002T1S' AS "year only plus time",
+ interval 'P0002-10T1S' AS "year month plus time",
+ interval 'P0002-10-15T1S' AS "year month day plus time",
+ interval 'PT10' AS "hour only",
+ interval 'PT10:30' AS "hour minute";
+ year only | year month | year month day | year only plus time | year month plus time | year month day plus time | hour only | hour minute
+-----------+-----------------+-------------------------+---------------------+--------------------------+----------------------------------+-----------+-------------
+ 2 years | 2 years 10 mons | 2 years 10 mons 15 days | 2 years 00:00:01 | 2 years 10 mons 00:00:01 | 2 years 10 mons 15 days 00:00:01 | 10:00:00 | 10:30:00
+(1 row)
+
+-- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
+SET IntervalStyle to postgres_verbose;
+select interval '-10 mons -3 days +03:55:06.70';
+ interval
+--------------------------------------------------
+ @ 10 mons 3 days -3 hours -55 mins -6.7 secs ago
+(1 row)
+
+select interval '1 year 2 mons 3 days 04:05:06.699999';
+ interval
+-----------------------------------------------------
+ @ 1 year 2 mons 3 days 4 hours 5 mins 6.699999 secs
+(1 row)
+
+select interval '0:0:0.7', interval '@ 0.70 secs', interval '0.7 seconds';
+ interval | interval | interval
+------------+------------+------------
+ @ 0.7 secs | @ 0.7 secs | @ 0.7 secs
+(1 row)
+
+-- check that '30 days' equals '1 month' according to the hash function
+select '30 days'::interval = '1 month'::interval as t;
+ t
+---
+ t
+(1 row)
+
+select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
+ t
+---
+ t
+(1 row)
+
+-- numeric constructor
+select make_interval(years := 2);
+ make_interval
+---------------
+ @ 2 years
+(1 row)
+
+select make_interval(years := 1, months := 6);
+ make_interval
+-----------------
+ @ 1 year 6 mons
+(1 row)
+
+select make_interval(years := 1, months := -1, weeks := 5, days := -7, hours := 25, mins := -180);
+ make_interval
+----------------------------
+ @ 11 mons 28 days 22 hours
+(1 row)
+
+select make_interval() = make_interval(years := 0, months := 0, weeks := 0, days := 0, mins := 0, secs := 0.0);
+ ?column?
+----------
+ t
+(1 row)
+
+select make_interval(hours := -2, mins := -10, secs := -25.3);
+ make_interval
+---------------------------------
+ @ 2 hours 10 mins 25.3 secs ago
+(1 row)
+
+select make_interval(years := 'inf'::float::int);
+ERROR: integer out of range
+select make_interval(months := 'NaN'::float::int);
+ERROR: integer out of range
+select make_interval(secs := 'inf');
+ERROR: interval out of range
+select make_interval(secs := 'NaN');
+ERROR: interval out of range
+select make_interval(secs := 7e12);
+ make_interval
+------------------------------------
+ @ 1944444444 hours 26 mins 40 secs
+(1 row)
+
+--
+-- test EXTRACT
+--
+SELECT f1,
+ EXTRACT(MICROSECOND FROM f1) AS MICROSECOND,
+ EXTRACT(MILLISECOND FROM f1) AS MILLISECOND,
+ EXTRACT(SECOND FROM f1) AS SECOND,
+ EXTRACT(MINUTE FROM f1) AS MINUTE,
+ EXTRACT(HOUR FROM f1) AS HOUR,
+ EXTRACT(DAY FROM f1) AS DAY,
+ EXTRACT(MONTH FROM f1) AS MONTH,
+ EXTRACT(QUARTER FROM f1) AS QUARTER,
+ EXTRACT(YEAR FROM f1) AS YEAR,
+ EXTRACT(DECADE FROM f1) AS DECADE,
+ EXTRACT(CENTURY FROM f1) AS CENTURY,
+ EXTRACT(MILLENNIUM FROM f1) AS MILLENNIUM,
+ EXTRACT(EPOCH FROM f1) AS EPOCH
+ FROM INTERVAL_TBL;
+ f1 | microsecond | millisecond | second | minute | hour | day | month | quarter | year | decade | century | millennium | epoch
+-------------------------------+-------------+-------------+------------+--------+------+-----+-------+---------+------+--------+---------+------------+-------------------
+ @ 1 min | 0 | 0.000 | 0.000000 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 60.000000
+ @ 5 hours | 0 | 0.000 | 0.000000 | 0 | 5 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 18000.000000
+ @ 10 days | 0 | 0.000 | 0.000000 | 0 | 0 | 10 | 0 | 1 | 0 | 0 | 0 | 0 | 864000.000000
+ @ 34 years | 0 | 0.000 | 0.000000 | 0 | 0 | 0 | 0 | 1 | 34 | 3 | 0 | 0 | 1072958400.000000
+ @ 3 mons | 0 | 0.000 | 0.000000 | 0 | 0 | 0 | 3 | 2 | 0 | 0 | 0 | 0 | 7776000.000000
+ @ 14 secs ago | -14000000 | -14000.000 | -14.000000 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | -14.000000
+ @ 1 day 2 hours 3 mins 4 secs | 4000000 | 4000.000 | 4.000000 | 3 | 2 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 93784.000000
+ @ 6 years | 0 | 0.000 | 0.000000 | 0 | 0 | 0 | 0 | 1 | 6 | 0 | 0 | 0 | 189345600.000000
+ @ 5 mons | 0 | 0.000 | 0.000000 | 0 | 0 | 0 | 5 | 2 | 0 | 0 | 0 | 0 | 12960000.000000
+ @ 5 mons 12 hours | 0 | 0.000 | 0.000000 | 0 | 12 | 0 | 5 | 2 | 0 | 0 | 0 | 0 | 13003200.000000
+(10 rows)
+
+SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+ERROR: interval units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+ERROR: interval units "timezone" not supported
+SELECT EXTRACT(DECADE FROM INTERVAL '100 y');
+ extract
+---------
+ 10
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '99 y');
+ extract
+---------
+ 9
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '-99 y');
+ extract
+---------
+ -9
+(1 row)
+
+SELECT EXTRACT(DECADE FROM INTERVAL '-100 y');
+ extract
+---------
+ -10
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '100 y');
+ extract
+---------
+ 1
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '99 y');
+ extract
+---------
+ 0
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '-99 y');
+ extract
+---------
+ 0
+(1 row)
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '-100 y');
+ extract
+---------
+ -1
+(1 row)
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT f1,
+ date_part('microsecond', f1) AS microsecond,
+ date_part('millisecond', f1) AS millisecond,
+ date_part('second', f1) AS second,
+ date_part('epoch', f1) AS epoch
+ FROM INTERVAL_TBL;
+ f1 | microsecond | millisecond | second | epoch
+-------------------------------+-------------+-------------+--------+------------
+ @ 1 min | 0 | 0 | 0 | 60
+ @ 5 hours | 0 | 0 | 0 | 18000
+ @ 10 days | 0 | 0 | 0 | 864000
+ @ 34 years | 0 | 0 | 0 | 1072958400
+ @ 3 mons | 0 | 0 | 0 | 7776000
+ @ 14 secs ago | -14000000 | -14000 | -14 | -14
+ @ 1 day 2 hours 3 mins 4 secs | 4000000 | 4000 | 4 | 93784
+ @ 6 years | 0 | 0 | 0 | 189345600
+ @ 5 mons | 0 | 0 | 0 | 12960000
+ @ 5 mons 12 hours | 0 | 0 | 0 | 13003200
+(10 rows)
+
+-- internal overflow test case
+SELECT extract(epoch from interval '1000000000 days');
+ extract
+-----------------------
+ 86400000000000.000000
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/interval.sql b/yql/essentials/tests/postgresql/original/cases/interval.sql
new file mode 100644
index 0000000000..6d532398bd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/interval.sql
@@ -0,0 +1,357 @@
+--
+-- INTERVAL
+--
+
+SET DATESTYLE = 'ISO';
+SET IntervalStyle to postgres;
+
+-- check acceptance of "time zone style"
+SELECT INTERVAL '01:00' AS "One hour";
+SELECT INTERVAL '+02:00' AS "Two hours";
+SELECT INTERVAL '-08:00' AS "Eight hours";
+SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
+SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
+SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
+SELECT INTERVAL '1.5 months' AS "One month 15 days";
+SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
+
+CREATE TABLE INTERVAL_TBL (f1 interval);
+
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
+
+-- badly formatted interval
+INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
+INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
+
+-- test interval operators
+
+SELECT * FROM INTERVAL_TBL;
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
+
+SELECT * FROM INTERVAL_TBL
+ WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
+
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL r1, INTERVAL_TBL r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+
+-- Test intervals that are large enough to overflow 64 bits in comparisons
+CREATE TEMP TABLE INTERVAL_TBL_OF (f1 interval);
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES
+ ('2147483647 days 2147483647 months'),
+ ('2147483647 days -2147483648 months'),
+ ('1 year'),
+ ('-2147483648 days 2147483647 months'),
+ ('-2147483648 days -2147483648 months');
+-- these should fail as out-of-range
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483648 days');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483649 days');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('2147483647 years');
+INSERT INTO INTERVAL_TBL_OF (f1) VALUES ('-2147483648 years');
+
+-- Test edge-case overflow detection in interval multiplication
+select extract(epoch from '256 microseconds'::interval * (2^55)::float8);
+
+SELECT r1.*, r2.*
+ FROM INTERVAL_TBL_OF r1, INTERVAL_TBL_OF r2
+ WHERE r1.f1 > r2.f1
+ ORDER BY r1.f1, r2.f1;
+
+CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
+SET enable_seqscan TO false;
+EXPLAIN (COSTS OFF)
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
+RESET enable_seqscan;
+
+DROP TABLE INTERVAL_TBL_OF;
+
+-- Test multiplication and division with intervals.
+-- Floating point arithmetic rounding errors can lead to unexpected results,
+-- though the code attempts to do the right thing and round up to days and
+-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
+-- Note that it is expected for some day components to be greater than 29 and
+-- some time components be greater than 23:59:59 due to how intervals are
+-- stored internally.
+
+CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
+COPY INTERVAL_MULDIV_TBL FROM STDIN;
+41 mon 12 days 360:00
+-41 mon -12 days +360:00
+-12 days
+9 mon -27 days 12:34:56
+-3 years 482 days 76:54:32.189
+4 mon
+14 mon
+999 mon 999 days
+\.
+
+SELECT span * 0.3 AS product
+FROM INTERVAL_MULDIV_TBL;
+
+SELECT span * 8.2 AS product
+FROM INTERVAL_MULDIV_TBL;
+
+SELECT span / 10 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+
+SELECT span / 100 AS quotient
+FROM INTERVAL_MULDIV_TBL;
+
+DROP TABLE INTERVAL_MULDIV_TBL;
+
+SET DATESTYLE = 'postgres';
+SET IntervalStyle to postgres_verbose;
+
+SELECT * FROM INTERVAL_TBL;
+
+-- test avg(interval), which is somewhat fragile since people have been
+-- known to change the allowed input syntax for type interval without
+-- updating pg_aggregate.agginitval
+
+select avg(f1) from interval_tbl;
+
+-- test long interval input
+select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
+
+-- test long interval output
+-- Note: the actual maximum length of the interval output is longer,
+-- but we need the test to work for both integer and floating-point
+-- timestamps.
+select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
+
+-- test justify_hours() and justify_days()
+
+SELECT justify_hours(interval '6 months 3 days 52 hours 3 minutes 2 seconds') as "6 mons 5 days 4 hours 3 mins 2 seconds";
+SELECT justify_days(interval '6 months 36 days 5 hours 4 minutes 3 seconds') as "7 mons 6 days 5 hours 4 mins 3 seconds";
+
+-- test justify_interval()
+
+SELECT justify_interval(interval '1 month -1 hour') as "1 month -1 hour";
+
+-- test fractional second input, and detection of duplicate units
+SET DATESTYLE = 'ISO';
+SET IntervalStyle TO postgres;
+
+SELECT '1 millisecond'::interval, '1 microsecond'::interval,
+ '500 seconds 99 milliseconds 51 microseconds'::interval;
+SELECT '3 days 5 milliseconds'::interval;
+
+SELECT '1 second 2 seconds'::interval; -- error
+SELECT '10 milliseconds 20 milliseconds'::interval; -- error
+SELECT '5.5 seconds 3 milliseconds'::interval; -- error
+SELECT '1:20:05 5 microseconds'::interval; -- error
+SELECT '1 day 1 day'::interval; -- error
+SELECT interval '1-2'; -- SQL year-month literal
+SELECT interval '999' second; -- oversize leading field is ok
+SELECT interval '999' minute;
+SELECT interval '999' hour;
+SELECT interval '999' day;
+SELECT interval '999' month;
+
+-- test SQL-spec syntaxes for restricted field sets
+SELECT interval '1' year;
+SELECT interval '2' month;
+SELECT interval '3' day;
+SELECT interval '4' hour;
+SELECT interval '5' minute;
+SELECT interval '6' second;
+SELECT interval '1' year to month;
+SELECT interval '1-2' year to month;
+SELECT interval '1 2' day to hour;
+SELECT interval '1 2:03' day to hour;
+SELECT interval '1 2:03:04' day to hour;
+SELECT interval '1 2' day to minute;
+SELECT interval '1 2:03' day to minute;
+SELECT interval '1 2:03:04' day to minute;
+SELECT interval '1 2' day to second;
+SELECT interval '1 2:03' day to second;
+SELECT interval '1 2:03:04' day to second;
+SELECT interval '1 2' hour to minute;
+SELECT interval '1 2:03' hour to minute;
+SELECT interval '1 2:03:04' hour to minute;
+SELECT interval '1 2' hour to second;
+SELECT interval '1 2:03' hour to second;
+SELECT interval '1 2:03:04' hour to second;
+SELECT interval '1 2' minute to second;
+SELECT interval '1 2:03' minute to second;
+SELECT interval '1 2:03:04' minute to second;
+SELECT interval '1 +2:03' minute to second;
+SELECT interval '1 +2:03:04' minute to second;
+SELECT interval '1 -2:03' minute to second;
+SELECT interval '1 -2:03:04' minute to second;
+SELECT interval '123 11' day to hour; -- ok
+SELECT interval '123 11' day; -- not ok
+SELECT interval '123 11'; -- not ok, too ambiguous
+SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
+
+-- test syntaxes for restricted precision
+SELECT interval(0) '1 day 01:23:45.6789';
+SELECT interval(2) '1 day 01:23:45.6789';
+SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
+SELECT interval '1.234' second;
+SELECT interval '1.234' second(2);
+SELECT interval '1 2.345' day to second(2);
+SELECT interval '1 2:03' day to second(2);
+SELECT interval '1 2:03.4567' day to second(2);
+SELECT interval '1 2:03:04.5678' day to second(2);
+SELECT interval '1 2.345' hour to second(2);
+SELECT interval '1 2:03.45678' hour to second(2);
+SELECT interval '1 2:03:04.5678' hour to second(2);
+SELECT interval '1 2.3456' minute to second(2);
+SELECT interval '1 2:03.5678' minute to second(2);
+SELECT interval '1 2:03:04.5678' minute to second(2);
+
+-- test casting to restricted precision (bug #14479)
+SELECT f1, f1::INTERVAL DAY TO MINUTE AS "minutes",
+ (f1 + INTERVAL '1 month')::INTERVAL MONTH::INTERVAL YEAR AS "years"
+ FROM interval_tbl;
+
+-- test inputting and outputting SQL standard interval literals
+SET IntervalStyle TO sql_standard;
+SELECT interval '0' AS "zero",
+ interval '1-2' year to month AS "year-month",
+ interval '1 2:03:04' day to second AS "day-time",
+ - interval '1-2' AS "negative year-month",
+ - interval '1 2:03:04' AS "negative day-time";
+
+-- test input of some not-quite-standard interval values in the sql style
+SET IntervalStyle TO postgres;
+SELECT interval '+1 -1:00:00',
+ interval '-1 +1:00:00',
+ interval '+1-2 -3 +4:05:06.789',
+ interval '-1-2 +3 -4:05:06.789';
+
+-- test output of couple non-standard interval values in the sql style
+SET IntervalStyle TO sql_standard;
+SELECT interval '1 day -1 hours',
+ interval '-1 days +1 hours',
+ interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds',
+ - interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds';
+
+-- test outputting iso8601 intervals
+SET IntervalStyle to iso_8601;
+select interval '0' AS "zero",
+ interval '1-2' AS "a year 2 months",
+ interval '1 2:03:04' AS "a bit over a day",
+ interval '2:03:04.45679' AS "a bit over 2 hours",
+ (interval '1-2' + interval '3 4:05:06.7') AS "all fields",
+ (interval '1-2' - interval '3 4:05:06.7') AS "mixed sign",
+ (- interval '1-2' + interval '3 4:05:06.7') AS "negative";
+
+-- test inputting ISO 8601 4.4.2.1 "Format With Time Unit Designators"
+SET IntervalStyle to sql_standard;
+select interval 'P0Y' AS "zero",
+ interval 'P1Y2M' AS "a year 2 months",
+ interval 'P1W' AS "a week",
+ interval 'P1DT2H3M4S' AS "a bit over a day",
+ interval 'P1Y2M3DT4H5M6.7S' AS "all fields",
+ interval 'P-1Y-2M-3DT-4H-5M-6.7S' AS "negative",
+ interval 'PT-0.1S' AS "fractional second";
+
+-- test inputting ISO 8601 4.4.2.2 "Alternative Format"
+SET IntervalStyle to postgres;
+select interval 'P00021015T103020' AS "ISO8601 Basic Format",
+ interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
+
+-- Make sure optional ISO8601 alternative format fields are optional.
+select interval 'P0002' AS "year only",
+ interval 'P0002-10' AS "year month",
+ interval 'P0002-10-15' AS "year month day",
+ interval 'P0002T1S' AS "year only plus time",
+ interval 'P0002-10T1S' AS "year month plus time",
+ interval 'P0002-10-15T1S' AS "year month day plus time",
+ interval 'PT10' AS "hour only",
+ interval 'PT10:30' AS "hour minute";
+
+-- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
+SET IntervalStyle to postgres_verbose;
+select interval '-10 mons -3 days +03:55:06.70';
+select interval '1 year 2 mons 3 days 04:05:06.699999';
+select interval '0:0:0.7', interval '@ 0.70 secs', interval '0.7 seconds';
+
+-- check that '30 days' equals '1 month' according to the hash function
+select '30 days'::interval = '1 month'::interval as t;
+select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
+
+-- numeric constructor
+select make_interval(years := 2);
+select make_interval(years := 1, months := 6);
+select make_interval(years := 1, months := -1, weeks := 5, days := -7, hours := 25, mins := -180);
+
+select make_interval() = make_interval(years := 0, months := 0, weeks := 0, days := 0, mins := 0, secs := 0.0);
+select make_interval(hours := -2, mins := -10, secs := -25.3);
+
+select make_interval(years := 'inf'::float::int);
+select make_interval(months := 'NaN'::float::int);
+select make_interval(secs := 'inf');
+select make_interval(secs := 'NaN');
+select make_interval(secs := 7e12);
+
+--
+-- test EXTRACT
+--
+SELECT f1,
+ EXTRACT(MICROSECOND FROM f1) AS MICROSECOND,
+ EXTRACT(MILLISECOND FROM f1) AS MILLISECOND,
+ EXTRACT(SECOND FROM f1) AS SECOND,
+ EXTRACT(MINUTE FROM f1) AS MINUTE,
+ EXTRACT(HOUR FROM f1) AS HOUR,
+ EXTRACT(DAY FROM f1) AS DAY,
+ EXTRACT(MONTH FROM f1) AS MONTH,
+ EXTRACT(QUARTER FROM f1) AS QUARTER,
+ EXTRACT(YEAR FROM f1) AS YEAR,
+ EXTRACT(DECADE FROM f1) AS DECADE,
+ EXTRACT(CENTURY FROM f1) AS CENTURY,
+ EXTRACT(MILLENNIUM FROM f1) AS MILLENNIUM,
+ EXTRACT(EPOCH FROM f1) AS EPOCH
+ FROM INTERVAL_TBL;
+
+SELECT EXTRACT(FORTNIGHT FROM INTERVAL '2 days'); -- error
+SELECT EXTRACT(TIMEZONE FROM INTERVAL '2 days'); -- error
+
+SELECT EXTRACT(DECADE FROM INTERVAL '100 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '99 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '-99 y');
+SELECT EXTRACT(DECADE FROM INTERVAL '-100 y');
+
+SELECT EXTRACT(CENTURY FROM INTERVAL '100 y');
+SELECT EXTRACT(CENTURY FROM INTERVAL '99 y');
+SELECT EXTRACT(CENTURY FROM INTERVAL '-99 y');
+SELECT EXTRACT(CENTURY FROM INTERVAL '-100 y');
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT f1,
+ date_part('microsecond', f1) AS microsecond,
+ date_part('millisecond', f1) AS millisecond,
+ date_part('second', f1) AS second,
+ date_part('epoch', f1) AS epoch
+ FROM INTERVAL_TBL;
+
+-- internal overflow test case
+SELECT extract(epoch from interval '1000000000 days');
diff --git a/yql/essentials/tests/postgresql/original/cases/join.out b/yql/essentials/tests/postgresql/original/cases/join.out
new file mode 100644
index 0000000000..5c56304504
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/join.out
@@ -0,0 +1,6628 @@
+--
+-- JOIN
+-- Test JOIN clauses
+--
+CREATE TABLE J1_TBL (
+ i integer,
+ j integer,
+ t text
+);
+CREATE TABLE J2_TBL (
+ i integer,
+ k integer
+);
+INSERT INTO J1_TBL VALUES (1, 4, 'one');
+INSERT INTO J1_TBL VALUES (2, 3, 'two');
+INSERT INTO J1_TBL VALUES (3, 2, 'three');
+INSERT INTO J1_TBL VALUES (4, 1, 'four');
+INSERT INTO J1_TBL VALUES (5, 0, 'five');
+INSERT INTO J1_TBL VALUES (6, 6, 'six');
+INSERT INTO J1_TBL VALUES (7, 7, 'seven');
+INSERT INTO J1_TBL VALUES (8, 8, 'eight');
+INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
+INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
+INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
+INSERT INTO J2_TBL VALUES (1, -1);
+INSERT INTO J2_TBL VALUES (2, 2);
+INSERT INTO J2_TBL VALUES (3, -3);
+INSERT INTO J2_TBL VALUES (2, 4);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (0, NULL);
+INSERT INTO J2_TBL VALUES (NULL, NULL);
+INSERT INTO J2_TBL VALUES (NULL, 0);
+-- useful in some tests below
+create temp table onerow();
+insert into onerow default values;
+analyze onerow;
+--
+-- CORRELATION NAMES
+-- Make sure that table/column aliases are supported
+-- before diving into more complex join syntax.
+--
+SELECT *
+ FROM J1_TBL AS tx;
+ i | j | t
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL tx;
+ i | j | t
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL AS t1 (a, b, c);
+ a | b | c
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c);
+ a | b | c
+---+---+-------
+ 1 | 4 | one
+ 2 | 3 | two
+ 3 | 2 | three
+ 4 | 1 | four
+ 5 | 0 | five
+ 6 | 6 | six
+ 7 | 7 | seven
+ 8 | 8 | eight
+ 0 | | zero
+ | | null
+ | 0 | zero
+(11 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e);
+ a | b | c | d | e
+---+---+-------+---+----
+ 1 | 4 | one | 1 | -1
+ 2 | 3 | two | 1 | -1
+ 3 | 2 | three | 1 | -1
+ 4 | 1 | four | 1 | -1
+ 5 | 0 | five | 1 | -1
+ 6 | 6 | six | 1 | -1
+ 7 | 7 | seven | 1 | -1
+ 8 | 8 | eight | 1 | -1
+ 0 | | zero | 1 | -1
+ | | null | 1 | -1
+ | 0 | zero | 1 | -1
+ 1 | 4 | one | 2 | 2
+ 2 | 3 | two | 2 | 2
+ 3 | 2 | three | 2 | 2
+ 4 | 1 | four | 2 | 2
+ 5 | 0 | five | 2 | 2
+ 6 | 6 | six | 2 | 2
+ 7 | 7 | seven | 2 | 2
+ 8 | 8 | eight | 2 | 2
+ 0 | | zero | 2 | 2
+ | | null | 2 | 2
+ | 0 | zero | 2 | 2
+ 1 | 4 | one | 3 | -3
+ 2 | 3 | two | 3 | -3
+ 3 | 2 | three | 3 | -3
+ 4 | 1 | four | 3 | -3
+ 5 | 0 | five | 3 | -3
+ 6 | 6 | six | 3 | -3
+ 7 | 7 | seven | 3 | -3
+ 8 | 8 | eight | 3 | -3
+ 0 | | zero | 3 | -3
+ | | null | 3 | -3
+ | 0 | zero | 3 | -3
+ 1 | 4 | one | 2 | 4
+ 2 | 3 | two | 2 | 4
+ 3 | 2 | three | 2 | 4
+ 4 | 1 | four | 2 | 4
+ 5 | 0 | five | 2 | 4
+ 6 | 6 | six | 2 | 4
+ 7 | 7 | seven | 2 | 4
+ 8 | 8 | eight | 2 | 4
+ 0 | | zero | 2 | 4
+ | | null | 2 | 4
+ | 0 | zero | 2 | 4
+ 1 | 4 | one | 5 | -5
+ 2 | 3 | two | 5 | -5
+ 3 | 2 | three | 5 | -5
+ 4 | 1 | four | 5 | -5
+ 5 | 0 | five | 5 | -5
+ 6 | 6 | six | 5 | -5
+ 7 | 7 | seven | 5 | -5
+ 8 | 8 | eight | 5 | -5
+ 0 | | zero | 5 | -5
+ | | null | 5 | -5
+ | 0 | zero | 5 | -5
+ 1 | 4 | one | 5 | -5
+ 2 | 3 | two | 5 | -5
+ 3 | 2 | three | 5 | -5
+ 4 | 1 | four | 5 | -5
+ 5 | 0 | five | 5 | -5
+ 6 | 6 | six | 5 | -5
+ 7 | 7 | seven | 5 | -5
+ 8 | 8 | eight | 5 | -5
+ 0 | | zero | 5 | -5
+ | | null | 5 | -5
+ | 0 | zero | 5 | -5
+ 1 | 4 | one | 0 |
+ 2 | 3 | two | 0 |
+ 3 | 2 | three | 0 |
+ 4 | 1 | four | 0 |
+ 5 | 0 | five | 0 |
+ 6 | 6 | six | 0 |
+ 7 | 7 | seven | 0 |
+ 8 | 8 | eight | 0 |
+ 0 | | zero | 0 |
+ | | null | 0 |
+ | 0 | zero | 0 |
+ 1 | 4 | one | |
+ 2 | 3 | two | |
+ 3 | 2 | three | |
+ 4 | 1 | four | |
+ 5 | 0 | five | |
+ 6 | 6 | six | |
+ 7 | 7 | seven | |
+ 8 | 8 | eight | |
+ 0 | | zero | |
+ | | null | |
+ | 0 | zero | |
+ 1 | 4 | one | | 0
+ 2 | 3 | two | | 0
+ 3 | 2 | three | | 0
+ 4 | 1 | four | | 0
+ 5 | 0 | five | | 0
+ 6 | 6 | six | | 0
+ 7 | 7 | seven | | 0
+ 8 | 8 | eight | | 0
+ 0 | | zero | | 0
+ | | null | | 0
+ | 0 | zero | | 0
+(99 rows)
+
+SELECT t1.a, t2.e
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
+ WHERE t1.a = t2.d;
+ a | e
+---+----
+ 0 |
+ 1 | -1
+ 2 | 2
+ 2 | 4
+ 3 | -3
+ 5 | -5
+ 5 | -5
+(7 rows)
+
+--
+-- CROSS JOIN
+-- Qualifications are not allowed on cross joins,
+-- which degenerate into a standard unqualified inner join.
+--
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL;
+ i | j | t | i | k
+---+---+-------+---+----
+ 1 | 4 | one | 1 | -1
+ 2 | 3 | two | 1 | -1
+ 3 | 2 | three | 1 | -1
+ 4 | 1 | four | 1 | -1
+ 5 | 0 | five | 1 | -1
+ 6 | 6 | six | 1 | -1
+ 7 | 7 | seven | 1 | -1
+ 8 | 8 | eight | 1 | -1
+ 0 | | zero | 1 | -1
+ | | null | 1 | -1
+ | 0 | zero | 1 | -1
+ 1 | 4 | one | 2 | 2
+ 2 | 3 | two | 2 | 2
+ 3 | 2 | three | 2 | 2
+ 4 | 1 | four | 2 | 2
+ 5 | 0 | five | 2 | 2
+ 6 | 6 | six | 2 | 2
+ 7 | 7 | seven | 2 | 2
+ 8 | 8 | eight | 2 | 2
+ 0 | | zero | 2 | 2
+ | | null | 2 | 2
+ | 0 | zero | 2 | 2
+ 1 | 4 | one | 3 | -3
+ 2 | 3 | two | 3 | -3
+ 3 | 2 | three | 3 | -3
+ 4 | 1 | four | 3 | -3
+ 5 | 0 | five | 3 | -3
+ 6 | 6 | six | 3 | -3
+ 7 | 7 | seven | 3 | -3
+ 8 | 8 | eight | 3 | -3
+ 0 | | zero | 3 | -3
+ | | null | 3 | -3
+ | 0 | zero | 3 | -3
+ 1 | 4 | one | 2 | 4
+ 2 | 3 | two | 2 | 4
+ 3 | 2 | three | 2 | 4
+ 4 | 1 | four | 2 | 4
+ 5 | 0 | five | 2 | 4
+ 6 | 6 | six | 2 | 4
+ 7 | 7 | seven | 2 | 4
+ 8 | 8 | eight | 2 | 4
+ 0 | | zero | 2 | 4
+ | | null | 2 | 4
+ | 0 | zero | 2 | 4
+ 1 | 4 | one | 5 | -5
+ 2 | 3 | two | 5 | -5
+ 3 | 2 | three | 5 | -5
+ 4 | 1 | four | 5 | -5
+ 5 | 0 | five | 5 | -5
+ 6 | 6 | six | 5 | -5
+ 7 | 7 | seven | 5 | -5
+ 8 | 8 | eight | 5 | -5
+ 0 | | zero | 5 | -5
+ | | null | 5 | -5
+ | 0 | zero | 5 | -5
+ 1 | 4 | one | 5 | -5
+ 2 | 3 | two | 5 | -5
+ 3 | 2 | three | 5 | -5
+ 4 | 1 | four | 5 | -5
+ 5 | 0 | five | 5 | -5
+ 6 | 6 | six | 5 | -5
+ 7 | 7 | seven | 5 | -5
+ 8 | 8 | eight | 5 | -5
+ 0 | | zero | 5 | -5
+ | | null | 5 | -5
+ | 0 | zero | 5 | -5
+ 1 | 4 | one | 0 |
+ 2 | 3 | two | 0 |
+ 3 | 2 | three | 0 |
+ 4 | 1 | four | 0 |
+ 5 | 0 | five | 0 |
+ 6 | 6 | six | 0 |
+ 7 | 7 | seven | 0 |
+ 8 | 8 | eight | 0 |
+ 0 | | zero | 0 |
+ | | null | 0 |
+ | 0 | zero | 0 |
+ 1 | 4 | one | |
+ 2 | 3 | two | |
+ 3 | 2 | three | |
+ 4 | 1 | four | |
+ 5 | 0 | five | |
+ 6 | 6 | six | |
+ 7 | 7 | seven | |
+ 8 | 8 | eight | |
+ 0 | | zero | |
+ | | null | |
+ | 0 | zero | |
+ 1 | 4 | one | | 0
+ 2 | 3 | two | | 0
+ 3 | 2 | three | | 0
+ 4 | 1 | four | | 0
+ 5 | 0 | five | | 0
+ 6 | 6 | six | | 0
+ 7 | 7 | seven | | 0
+ 8 | 8 | eight | | 0
+ 0 | | zero | | 0
+ | | null | | 0
+ | 0 | zero | | 0
+(99 rows)
+
+-- ambiguous column
+SELECT i, k, t
+ FROM J1_TBL CROSS JOIN J2_TBL;
+ERROR: column reference "i" is ambiguous
+LINE 1: SELECT i, k, t
+ ^
+-- resolve previous ambiguity by specifying the table name
+SELECT t1.i, k, t
+ FROM J1_TBL t1 CROSS JOIN J2_TBL t2;
+ i | k | t
+---+----+-------
+ 1 | -1 | one
+ 2 | -1 | two
+ 3 | -1 | three
+ 4 | -1 | four
+ 5 | -1 | five
+ 6 | -1 | six
+ 7 | -1 | seven
+ 8 | -1 | eight
+ 0 | -1 | zero
+ | -1 | null
+ | -1 | zero
+ 1 | 2 | one
+ 2 | 2 | two
+ 3 | 2 | three
+ 4 | 2 | four
+ 5 | 2 | five
+ 6 | 2 | six
+ 7 | 2 | seven
+ 8 | 2 | eight
+ 0 | 2 | zero
+ | 2 | null
+ | 2 | zero
+ 1 | -3 | one
+ 2 | -3 | two
+ 3 | -3 | three
+ 4 | -3 | four
+ 5 | -3 | five
+ 6 | -3 | six
+ 7 | -3 | seven
+ 8 | -3 | eight
+ 0 | -3 | zero
+ | -3 | null
+ | -3 | zero
+ 1 | 4 | one
+ 2 | 4 | two
+ 3 | 4 | three
+ 4 | 4 | four
+ 5 | 4 | five
+ 6 | 4 | six
+ 7 | 4 | seven
+ 8 | 4 | eight
+ 0 | 4 | zero
+ | 4 | null
+ | 4 | zero
+ 1 | -5 | one
+ 2 | -5 | two
+ 3 | -5 | three
+ 4 | -5 | four
+ 5 | -5 | five
+ 6 | -5 | six
+ 7 | -5 | seven
+ 8 | -5 | eight
+ 0 | -5 | zero
+ | -5 | null
+ | -5 | zero
+ 1 | -5 | one
+ 2 | -5 | two
+ 3 | -5 | three
+ 4 | -5 | four
+ 5 | -5 | five
+ 6 | -5 | six
+ 7 | -5 | seven
+ 8 | -5 | eight
+ 0 | -5 | zero
+ | -5 | null
+ | -5 | zero
+ 1 | | one
+ 2 | | two
+ 3 | | three
+ 4 | | four
+ 5 | | five
+ 6 | | six
+ 7 | | seven
+ 8 | | eight
+ 0 | | zero
+ | | null
+ | | zero
+ 1 | | one
+ 2 | | two
+ 3 | | three
+ 4 | | four
+ 5 | | five
+ 6 | | six
+ 7 | | seven
+ 8 | | eight
+ 0 | | zero
+ | | null
+ | | zero
+ 1 | 0 | one
+ 2 | 0 | two
+ 3 | 0 | three
+ 4 | 0 | four
+ 5 | 0 | five
+ 6 | 0 | six
+ 7 | 0 | seven
+ 8 | 0 | eight
+ 0 | 0 | zero
+ | 0 | null
+ | 0 | zero
+(99 rows)
+
+SELECT ii, tt, kk
+ FROM (J1_TBL CROSS JOIN J2_TBL)
+ AS tx (ii, jj, tt, ii2, kk);
+ ii | tt | kk
+----+-------+----
+ 1 | one | -1
+ 2 | two | -1
+ 3 | three | -1
+ 4 | four | -1
+ 5 | five | -1
+ 6 | six | -1
+ 7 | seven | -1
+ 8 | eight | -1
+ 0 | zero | -1
+ | null | -1
+ | zero | -1
+ 1 | one | 2
+ 2 | two | 2
+ 3 | three | 2
+ 4 | four | 2
+ 5 | five | 2
+ 6 | six | 2
+ 7 | seven | 2
+ 8 | eight | 2
+ 0 | zero | 2
+ | null | 2
+ | zero | 2
+ 1 | one | -3
+ 2 | two | -3
+ 3 | three | -3
+ 4 | four | -3
+ 5 | five | -3
+ 6 | six | -3
+ 7 | seven | -3
+ 8 | eight | -3
+ 0 | zero | -3
+ | null | -3
+ | zero | -3
+ 1 | one | 4
+ 2 | two | 4
+ 3 | three | 4
+ 4 | four | 4
+ 5 | five | 4
+ 6 | six | 4
+ 7 | seven | 4
+ 8 | eight | 4
+ 0 | zero | 4
+ | null | 4
+ | zero | 4
+ 1 | one | -5
+ 2 | two | -5
+ 3 | three | -5
+ 4 | four | -5
+ 5 | five | -5
+ 6 | six | -5
+ 7 | seven | -5
+ 8 | eight | -5
+ 0 | zero | -5
+ | null | -5
+ | zero | -5
+ 1 | one | -5
+ 2 | two | -5
+ 3 | three | -5
+ 4 | four | -5
+ 5 | five | -5
+ 6 | six | -5
+ 7 | seven | -5
+ 8 | eight | -5
+ 0 | zero | -5
+ | null | -5
+ | zero | -5
+ 1 | one |
+ 2 | two |
+ 3 | three |
+ 4 | four |
+ 5 | five |
+ 6 | six |
+ 7 | seven |
+ 8 | eight |
+ 0 | zero |
+ | null |
+ | zero |
+ 1 | one |
+ 2 | two |
+ 3 | three |
+ 4 | four |
+ 5 | five |
+ 6 | six |
+ 7 | seven |
+ 8 | eight |
+ 0 | zero |
+ | null |
+ | zero |
+ 1 | one | 0
+ 2 | two | 0
+ 3 | three | 0
+ 4 | four | 0
+ 5 | five | 0
+ 6 | six | 0
+ 7 | seven | 0
+ 8 | eight | 0
+ 0 | zero | 0
+ | null | 0
+ | zero | 0
+(99 rows)
+
+SELECT tx.ii, tx.jj, tx.kk
+ FROM (J1_TBL t1 (a, b, c) CROSS JOIN J2_TBL t2 (d, e))
+ AS tx (ii, jj, tt, ii2, kk);
+ ii | jj | kk
+----+----+----
+ 1 | 4 | -1
+ 2 | 3 | -1
+ 3 | 2 | -1
+ 4 | 1 | -1
+ 5 | 0 | -1
+ 6 | 6 | -1
+ 7 | 7 | -1
+ 8 | 8 | -1
+ 0 | | -1
+ | | -1
+ | 0 | -1
+ 1 | 4 | 2
+ 2 | 3 | 2
+ 3 | 2 | 2
+ 4 | 1 | 2
+ 5 | 0 | 2
+ 6 | 6 | 2
+ 7 | 7 | 2
+ 8 | 8 | 2
+ 0 | | 2
+ | | 2
+ | 0 | 2
+ 1 | 4 | -3
+ 2 | 3 | -3
+ 3 | 2 | -3
+ 4 | 1 | -3
+ 5 | 0 | -3
+ 6 | 6 | -3
+ 7 | 7 | -3
+ 8 | 8 | -3
+ 0 | | -3
+ | | -3
+ | 0 | -3
+ 1 | 4 | 4
+ 2 | 3 | 4
+ 3 | 2 | 4
+ 4 | 1 | 4
+ 5 | 0 | 4
+ 6 | 6 | 4
+ 7 | 7 | 4
+ 8 | 8 | 4
+ 0 | | 4
+ | | 4
+ | 0 | 4
+ 1 | 4 | -5
+ 2 | 3 | -5
+ 3 | 2 | -5
+ 4 | 1 | -5
+ 5 | 0 | -5
+ 6 | 6 | -5
+ 7 | 7 | -5
+ 8 | 8 | -5
+ 0 | | -5
+ | | -5
+ | 0 | -5
+ 1 | 4 | -5
+ 2 | 3 | -5
+ 3 | 2 | -5
+ 4 | 1 | -5
+ 5 | 0 | -5
+ 6 | 6 | -5
+ 7 | 7 | -5
+ 8 | 8 | -5
+ 0 | | -5
+ | | -5
+ | 0 | -5
+ 1 | 4 |
+ 2 | 3 |
+ 3 | 2 |
+ 4 | 1 |
+ 5 | 0 |
+ 6 | 6 |
+ 7 | 7 |
+ 8 | 8 |
+ 0 | |
+ | |
+ | 0 |
+ 1 | 4 |
+ 2 | 3 |
+ 3 | 2 |
+ 4 | 1 |
+ 5 | 0 |
+ 6 | 6 |
+ 7 | 7 |
+ 8 | 8 |
+ 0 | |
+ | |
+ | 0 |
+ 1 | 4 | 0
+ 2 | 3 | 0
+ 3 | 2 | 0
+ 4 | 1 | 0
+ 5 | 0 | 0
+ 6 | 6 | 0
+ 7 | 7 | 0
+ 8 | 8 | 0
+ 0 | | 0
+ | | 0
+ | 0 | 0
+(99 rows)
+
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b;
+ i | j | t | i | k | i | k
+---+---+-------+---+----+---+----
+ 1 | 4 | one | 1 | -1 | 1 | -1
+ 1 | 4 | one | 1 | -1 | 2 | 2
+ 1 | 4 | one | 1 | -1 | 3 | -3
+ 1 | 4 | one | 1 | -1 | 2 | 4
+ 1 | 4 | one | 1 | -1 | 5 | -5
+ 1 | 4 | one | 1 | -1 | 5 | -5
+ 1 | 4 | one | 1 | -1 | 0 |
+ 1 | 4 | one | 1 | -1 | |
+ 1 | 4 | one | 1 | -1 | | 0
+ 2 | 3 | two | 1 | -1 | 1 | -1
+ 2 | 3 | two | 1 | -1 | 2 | 2
+ 2 | 3 | two | 1 | -1 | 3 | -3
+ 2 | 3 | two | 1 | -1 | 2 | 4
+ 2 | 3 | two | 1 | -1 | 5 | -5
+ 2 | 3 | two | 1 | -1 | 5 | -5
+ 2 | 3 | two | 1 | -1 | 0 |
+ 2 | 3 | two | 1 | -1 | |
+ 2 | 3 | two | 1 | -1 | | 0
+ 3 | 2 | three | 1 | -1 | 1 | -1
+ 3 | 2 | three | 1 | -1 | 2 | 2
+ 3 | 2 | three | 1 | -1 | 3 | -3
+ 3 | 2 | three | 1 | -1 | 2 | 4
+ 3 | 2 | three | 1 | -1 | 5 | -5
+ 3 | 2 | three | 1 | -1 | 5 | -5
+ 3 | 2 | three | 1 | -1 | 0 |
+ 3 | 2 | three | 1 | -1 | |
+ 3 | 2 | three | 1 | -1 | | 0
+ 4 | 1 | four | 1 | -1 | 1 | -1
+ 4 | 1 | four | 1 | -1 | 2 | 2
+ 4 | 1 | four | 1 | -1 | 3 | -3
+ 4 | 1 | four | 1 | -1 | 2 | 4
+ 4 | 1 | four | 1 | -1 | 5 | -5
+ 4 | 1 | four | 1 | -1 | 5 | -5
+ 4 | 1 | four | 1 | -1 | 0 |
+ 4 | 1 | four | 1 | -1 | |
+ 4 | 1 | four | 1 | -1 | | 0
+ 5 | 0 | five | 1 | -1 | 1 | -1
+ 5 | 0 | five | 1 | -1 | 2 | 2
+ 5 | 0 | five | 1 | -1 | 3 | -3
+ 5 | 0 | five | 1 | -1 | 2 | 4
+ 5 | 0 | five | 1 | -1 | 5 | -5
+ 5 | 0 | five | 1 | -1 | 5 | -5
+ 5 | 0 | five | 1 | -1 | 0 |
+ 5 | 0 | five | 1 | -1 | |
+ 5 | 0 | five | 1 | -1 | | 0
+ 6 | 6 | six | 1 | -1 | 1 | -1
+ 6 | 6 | six | 1 | -1 | 2 | 2
+ 6 | 6 | six | 1 | -1 | 3 | -3
+ 6 | 6 | six | 1 | -1 | 2 | 4
+ 6 | 6 | six | 1 | -1 | 5 | -5
+ 6 | 6 | six | 1 | -1 | 5 | -5
+ 6 | 6 | six | 1 | -1 | 0 |
+ 6 | 6 | six | 1 | -1 | |
+ 6 | 6 | six | 1 | -1 | | 0
+ 7 | 7 | seven | 1 | -1 | 1 | -1
+ 7 | 7 | seven | 1 | -1 | 2 | 2
+ 7 | 7 | seven | 1 | -1 | 3 | -3
+ 7 | 7 | seven | 1 | -1 | 2 | 4
+ 7 | 7 | seven | 1 | -1 | 5 | -5
+ 7 | 7 | seven | 1 | -1 | 5 | -5
+ 7 | 7 | seven | 1 | -1 | 0 |
+ 7 | 7 | seven | 1 | -1 | |
+ 7 | 7 | seven | 1 | -1 | | 0
+ 8 | 8 | eight | 1 | -1 | 1 | -1
+ 8 | 8 | eight | 1 | -1 | 2 | 2
+ 8 | 8 | eight | 1 | -1 | 3 | -3
+ 8 | 8 | eight | 1 | -1 | 2 | 4
+ 8 | 8 | eight | 1 | -1 | 5 | -5
+ 8 | 8 | eight | 1 | -1 | 5 | -5
+ 8 | 8 | eight | 1 | -1 | 0 |
+ 8 | 8 | eight | 1 | -1 | |
+ 8 | 8 | eight | 1 | -1 | | 0
+ 0 | | zero | 1 | -1 | 1 | -1
+ 0 | | zero | 1 | -1 | 2 | 2
+ 0 | | zero | 1 | -1 | 3 | -3
+ 0 | | zero | 1 | -1 | 2 | 4
+ 0 | | zero | 1 | -1 | 5 | -5
+ 0 | | zero | 1 | -1 | 5 | -5
+ 0 | | zero | 1 | -1 | 0 |
+ 0 | | zero | 1 | -1 | |
+ 0 | | zero | 1 | -1 | | 0
+ | | null | 1 | -1 | 1 | -1
+ | | null | 1 | -1 | 2 | 2
+ | | null | 1 | -1 | 3 | -3
+ | | null | 1 | -1 | 2 | 4
+ | | null | 1 | -1 | 5 | -5
+ | | null | 1 | -1 | 5 | -5
+ | | null | 1 | -1 | 0 |
+ | | null | 1 | -1 | |
+ | | null | 1 | -1 | | 0
+ | 0 | zero | 1 | -1 | 1 | -1
+ | 0 | zero | 1 | -1 | 2 | 2
+ | 0 | zero | 1 | -1 | 3 | -3
+ | 0 | zero | 1 | -1 | 2 | 4
+ | 0 | zero | 1 | -1 | 5 | -5
+ | 0 | zero | 1 | -1 | 5 | -5
+ | 0 | zero | 1 | -1 | 0 |
+ | 0 | zero | 1 | -1 | |
+ | 0 | zero | 1 | -1 | | 0
+ 1 | 4 | one | 2 | 2 | 1 | -1
+ 1 | 4 | one | 2 | 2 | 2 | 2
+ 1 | 4 | one | 2 | 2 | 3 | -3
+ 1 | 4 | one | 2 | 2 | 2 | 4
+ 1 | 4 | one | 2 | 2 | 5 | -5
+ 1 | 4 | one | 2 | 2 | 5 | -5
+ 1 | 4 | one | 2 | 2 | 0 |
+ 1 | 4 | one | 2 | 2 | |
+ 1 | 4 | one | 2 | 2 | | 0
+ 2 | 3 | two | 2 | 2 | 1 | -1
+ 2 | 3 | two | 2 | 2 | 2 | 2
+ 2 | 3 | two | 2 | 2 | 3 | -3
+ 2 | 3 | two | 2 | 2 | 2 | 4
+ 2 | 3 | two | 2 | 2 | 5 | -5
+ 2 | 3 | two | 2 | 2 | 5 | -5
+ 2 | 3 | two | 2 | 2 | 0 |
+ 2 | 3 | two | 2 | 2 | |
+ 2 | 3 | two | 2 | 2 | | 0
+ 3 | 2 | three | 2 | 2 | 1 | -1
+ 3 | 2 | three | 2 | 2 | 2 | 2
+ 3 | 2 | three | 2 | 2 | 3 | -3
+ 3 | 2 | three | 2 | 2 | 2 | 4
+ 3 | 2 | three | 2 | 2 | 5 | -5
+ 3 | 2 | three | 2 | 2 | 5 | -5
+ 3 | 2 | three | 2 | 2 | 0 |
+ 3 | 2 | three | 2 | 2 | |
+ 3 | 2 | three | 2 | 2 | | 0
+ 4 | 1 | four | 2 | 2 | 1 | -1
+ 4 | 1 | four | 2 | 2 | 2 | 2
+ 4 | 1 | four | 2 | 2 | 3 | -3
+ 4 | 1 | four | 2 | 2 | 2 | 4
+ 4 | 1 | four | 2 | 2 | 5 | -5
+ 4 | 1 | four | 2 | 2 | 5 | -5
+ 4 | 1 | four | 2 | 2 | 0 |
+ 4 | 1 | four | 2 | 2 | |
+ 4 | 1 | four | 2 | 2 | | 0
+ 5 | 0 | five | 2 | 2 | 1 | -1
+ 5 | 0 | five | 2 | 2 | 2 | 2
+ 5 | 0 | five | 2 | 2 | 3 | -3
+ 5 | 0 | five | 2 | 2 | 2 | 4
+ 5 | 0 | five | 2 | 2 | 5 | -5
+ 5 | 0 | five | 2 | 2 | 5 | -5
+ 5 | 0 | five | 2 | 2 | 0 |
+ 5 | 0 | five | 2 | 2 | |
+ 5 | 0 | five | 2 | 2 | | 0
+ 6 | 6 | six | 2 | 2 | 1 | -1
+ 6 | 6 | six | 2 | 2 | 2 | 2
+ 6 | 6 | six | 2 | 2 | 3 | -3
+ 6 | 6 | six | 2 | 2 | 2 | 4
+ 6 | 6 | six | 2 | 2 | 5 | -5
+ 6 | 6 | six | 2 | 2 | 5 | -5
+ 6 | 6 | six | 2 | 2 | 0 |
+ 6 | 6 | six | 2 | 2 | |
+ 6 | 6 | six | 2 | 2 | | 0
+ 7 | 7 | seven | 2 | 2 | 1 | -1
+ 7 | 7 | seven | 2 | 2 | 2 | 2
+ 7 | 7 | seven | 2 | 2 | 3 | -3
+ 7 | 7 | seven | 2 | 2 | 2 | 4
+ 7 | 7 | seven | 2 | 2 | 5 | -5
+ 7 | 7 | seven | 2 | 2 | 5 | -5
+ 7 | 7 | seven | 2 | 2 | 0 |
+ 7 | 7 | seven | 2 | 2 | |
+ 7 | 7 | seven | 2 | 2 | | 0
+ 8 | 8 | eight | 2 | 2 | 1 | -1
+ 8 | 8 | eight | 2 | 2 | 2 | 2
+ 8 | 8 | eight | 2 | 2 | 3 | -3
+ 8 | 8 | eight | 2 | 2 | 2 | 4
+ 8 | 8 | eight | 2 | 2 | 5 | -5
+ 8 | 8 | eight | 2 | 2 | 5 | -5
+ 8 | 8 | eight | 2 | 2 | 0 |
+ 8 | 8 | eight | 2 | 2 | |
+ 8 | 8 | eight | 2 | 2 | | 0
+ 0 | | zero | 2 | 2 | 1 | -1
+ 0 | | zero | 2 | 2 | 2 | 2
+ 0 | | zero | 2 | 2 | 3 | -3
+ 0 | | zero | 2 | 2 | 2 | 4
+ 0 | | zero | 2 | 2 | 5 | -5
+ 0 | | zero | 2 | 2 | 5 | -5
+ 0 | | zero | 2 | 2 | 0 |
+ 0 | | zero | 2 | 2 | |
+ 0 | | zero | 2 | 2 | | 0
+ | | null | 2 | 2 | 1 | -1
+ | | null | 2 | 2 | 2 | 2
+ | | null | 2 | 2 | 3 | -3
+ | | null | 2 | 2 | 2 | 4
+ | | null | 2 | 2 | 5 | -5
+ | | null | 2 | 2 | 5 | -5
+ | | null | 2 | 2 | 0 |
+ | | null | 2 | 2 | |
+ | | null | 2 | 2 | | 0
+ | 0 | zero | 2 | 2 | 1 | -1
+ | 0 | zero | 2 | 2 | 2 | 2
+ | 0 | zero | 2 | 2 | 3 | -3
+ | 0 | zero | 2 | 2 | 2 | 4
+ | 0 | zero | 2 | 2 | 5 | -5
+ | 0 | zero | 2 | 2 | 5 | -5
+ | 0 | zero | 2 | 2 | 0 |
+ | 0 | zero | 2 | 2 | |
+ | 0 | zero | 2 | 2 | | 0
+ 1 | 4 | one | 3 | -3 | 1 | -1
+ 1 | 4 | one | 3 | -3 | 2 | 2
+ 1 | 4 | one | 3 | -3 | 3 | -3
+ 1 | 4 | one | 3 | -3 | 2 | 4
+ 1 | 4 | one | 3 | -3 | 5 | -5
+ 1 | 4 | one | 3 | -3 | 5 | -5
+ 1 | 4 | one | 3 | -3 | 0 |
+ 1 | 4 | one | 3 | -3 | |
+ 1 | 4 | one | 3 | -3 | | 0
+ 2 | 3 | two | 3 | -3 | 1 | -1
+ 2 | 3 | two | 3 | -3 | 2 | 2
+ 2 | 3 | two | 3 | -3 | 3 | -3
+ 2 | 3 | two | 3 | -3 | 2 | 4
+ 2 | 3 | two | 3 | -3 | 5 | -5
+ 2 | 3 | two | 3 | -3 | 5 | -5
+ 2 | 3 | two | 3 | -3 | 0 |
+ 2 | 3 | two | 3 | -3 | |
+ 2 | 3 | two | 3 | -3 | | 0
+ 3 | 2 | three | 3 | -3 | 1 | -1
+ 3 | 2 | three | 3 | -3 | 2 | 2
+ 3 | 2 | three | 3 | -3 | 3 | -3
+ 3 | 2 | three | 3 | -3 | 2 | 4
+ 3 | 2 | three | 3 | -3 | 5 | -5
+ 3 | 2 | three | 3 | -3 | 5 | -5
+ 3 | 2 | three | 3 | -3 | 0 |
+ 3 | 2 | three | 3 | -3 | |
+ 3 | 2 | three | 3 | -3 | | 0
+ 4 | 1 | four | 3 | -3 | 1 | -1
+ 4 | 1 | four | 3 | -3 | 2 | 2
+ 4 | 1 | four | 3 | -3 | 3 | -3
+ 4 | 1 | four | 3 | -3 | 2 | 4
+ 4 | 1 | four | 3 | -3 | 5 | -5
+ 4 | 1 | four | 3 | -3 | 5 | -5
+ 4 | 1 | four | 3 | -3 | 0 |
+ 4 | 1 | four | 3 | -3 | |
+ 4 | 1 | four | 3 | -3 | | 0
+ 5 | 0 | five | 3 | -3 | 1 | -1
+ 5 | 0 | five | 3 | -3 | 2 | 2
+ 5 | 0 | five | 3 | -3 | 3 | -3
+ 5 | 0 | five | 3 | -3 | 2 | 4
+ 5 | 0 | five | 3 | -3 | 5 | -5
+ 5 | 0 | five | 3 | -3 | 5 | -5
+ 5 | 0 | five | 3 | -3 | 0 |
+ 5 | 0 | five | 3 | -3 | |
+ 5 | 0 | five | 3 | -3 | | 0
+ 6 | 6 | six | 3 | -3 | 1 | -1
+ 6 | 6 | six | 3 | -3 | 2 | 2
+ 6 | 6 | six | 3 | -3 | 3 | -3
+ 6 | 6 | six | 3 | -3 | 2 | 4
+ 6 | 6 | six | 3 | -3 | 5 | -5
+ 6 | 6 | six | 3 | -3 | 5 | -5
+ 6 | 6 | six | 3 | -3 | 0 |
+ 6 | 6 | six | 3 | -3 | |
+ 6 | 6 | six | 3 | -3 | | 0
+ 7 | 7 | seven | 3 | -3 | 1 | -1
+ 7 | 7 | seven | 3 | -3 | 2 | 2
+ 7 | 7 | seven | 3 | -3 | 3 | -3
+ 7 | 7 | seven | 3 | -3 | 2 | 4
+ 7 | 7 | seven | 3 | -3 | 5 | -5
+ 7 | 7 | seven | 3 | -3 | 5 | -5
+ 7 | 7 | seven | 3 | -3 | 0 |
+ 7 | 7 | seven | 3 | -3 | |
+ 7 | 7 | seven | 3 | -3 | | 0
+ 8 | 8 | eight | 3 | -3 | 1 | -1
+ 8 | 8 | eight | 3 | -3 | 2 | 2
+ 8 | 8 | eight | 3 | -3 | 3 | -3
+ 8 | 8 | eight | 3 | -3 | 2 | 4
+ 8 | 8 | eight | 3 | -3 | 5 | -5
+ 8 | 8 | eight | 3 | -3 | 5 | -5
+ 8 | 8 | eight | 3 | -3 | 0 |
+ 8 | 8 | eight | 3 | -3 | |
+ 8 | 8 | eight | 3 | -3 | | 0
+ 0 | | zero | 3 | -3 | 1 | -1
+ 0 | | zero | 3 | -3 | 2 | 2
+ 0 | | zero | 3 | -3 | 3 | -3
+ 0 | | zero | 3 | -3 | 2 | 4
+ 0 | | zero | 3 | -3 | 5 | -5
+ 0 | | zero | 3 | -3 | 5 | -5
+ 0 | | zero | 3 | -3 | 0 |
+ 0 | | zero | 3 | -3 | |
+ 0 | | zero | 3 | -3 | | 0
+ | | null | 3 | -3 | 1 | -1
+ | | null | 3 | -3 | 2 | 2
+ | | null | 3 | -3 | 3 | -3
+ | | null | 3 | -3 | 2 | 4
+ | | null | 3 | -3 | 5 | -5
+ | | null | 3 | -3 | 5 | -5
+ | | null | 3 | -3 | 0 |
+ | | null | 3 | -3 | |
+ | | null | 3 | -3 | | 0
+ | 0 | zero | 3 | -3 | 1 | -1
+ | 0 | zero | 3 | -3 | 2 | 2
+ | 0 | zero | 3 | -3 | 3 | -3
+ | 0 | zero | 3 | -3 | 2 | 4
+ | 0 | zero | 3 | -3 | 5 | -5
+ | 0 | zero | 3 | -3 | 5 | -5
+ | 0 | zero | 3 | -3 | 0 |
+ | 0 | zero | 3 | -3 | |
+ | 0 | zero | 3 | -3 | | 0
+ 1 | 4 | one | 2 | 4 | 1 | -1
+ 1 | 4 | one | 2 | 4 | 2 | 2
+ 1 | 4 | one | 2 | 4 | 3 | -3
+ 1 | 4 | one | 2 | 4 | 2 | 4
+ 1 | 4 | one | 2 | 4 | 5 | -5
+ 1 | 4 | one | 2 | 4 | 5 | -5
+ 1 | 4 | one | 2 | 4 | 0 |
+ 1 | 4 | one | 2 | 4 | |
+ 1 | 4 | one | 2 | 4 | | 0
+ 2 | 3 | two | 2 | 4 | 1 | -1
+ 2 | 3 | two | 2 | 4 | 2 | 2
+ 2 | 3 | two | 2 | 4 | 3 | -3
+ 2 | 3 | two | 2 | 4 | 2 | 4
+ 2 | 3 | two | 2 | 4 | 5 | -5
+ 2 | 3 | two | 2 | 4 | 5 | -5
+ 2 | 3 | two | 2 | 4 | 0 |
+ 2 | 3 | two | 2 | 4 | |
+ 2 | 3 | two | 2 | 4 | | 0
+ 3 | 2 | three | 2 | 4 | 1 | -1
+ 3 | 2 | three | 2 | 4 | 2 | 2
+ 3 | 2 | three | 2 | 4 | 3 | -3
+ 3 | 2 | three | 2 | 4 | 2 | 4
+ 3 | 2 | three | 2 | 4 | 5 | -5
+ 3 | 2 | three | 2 | 4 | 5 | -5
+ 3 | 2 | three | 2 | 4 | 0 |
+ 3 | 2 | three | 2 | 4 | |
+ 3 | 2 | three | 2 | 4 | | 0
+ 4 | 1 | four | 2 | 4 | 1 | -1
+ 4 | 1 | four | 2 | 4 | 2 | 2
+ 4 | 1 | four | 2 | 4 | 3 | -3
+ 4 | 1 | four | 2 | 4 | 2 | 4
+ 4 | 1 | four | 2 | 4 | 5 | -5
+ 4 | 1 | four | 2 | 4 | 5 | -5
+ 4 | 1 | four | 2 | 4 | 0 |
+ 4 | 1 | four | 2 | 4 | |
+ 4 | 1 | four | 2 | 4 | | 0
+ 5 | 0 | five | 2 | 4 | 1 | -1
+ 5 | 0 | five | 2 | 4 | 2 | 2
+ 5 | 0 | five | 2 | 4 | 3 | -3
+ 5 | 0 | five | 2 | 4 | 2 | 4
+ 5 | 0 | five | 2 | 4 | 5 | -5
+ 5 | 0 | five | 2 | 4 | 5 | -5
+ 5 | 0 | five | 2 | 4 | 0 |
+ 5 | 0 | five | 2 | 4 | |
+ 5 | 0 | five | 2 | 4 | | 0
+ 6 | 6 | six | 2 | 4 | 1 | -1
+ 6 | 6 | six | 2 | 4 | 2 | 2
+ 6 | 6 | six | 2 | 4 | 3 | -3
+ 6 | 6 | six | 2 | 4 | 2 | 4
+ 6 | 6 | six | 2 | 4 | 5 | -5
+ 6 | 6 | six | 2 | 4 | 5 | -5
+ 6 | 6 | six | 2 | 4 | 0 |
+ 6 | 6 | six | 2 | 4 | |
+ 6 | 6 | six | 2 | 4 | | 0
+ 7 | 7 | seven | 2 | 4 | 1 | -1
+ 7 | 7 | seven | 2 | 4 | 2 | 2
+ 7 | 7 | seven | 2 | 4 | 3 | -3
+ 7 | 7 | seven | 2 | 4 | 2 | 4
+ 7 | 7 | seven | 2 | 4 | 5 | -5
+ 7 | 7 | seven | 2 | 4 | 5 | -5
+ 7 | 7 | seven | 2 | 4 | 0 |
+ 7 | 7 | seven | 2 | 4 | |
+ 7 | 7 | seven | 2 | 4 | | 0
+ 8 | 8 | eight | 2 | 4 | 1 | -1
+ 8 | 8 | eight | 2 | 4 | 2 | 2
+ 8 | 8 | eight | 2 | 4 | 3 | -3
+ 8 | 8 | eight | 2 | 4 | 2 | 4
+ 8 | 8 | eight | 2 | 4 | 5 | -5
+ 8 | 8 | eight | 2 | 4 | 5 | -5
+ 8 | 8 | eight | 2 | 4 | 0 |
+ 8 | 8 | eight | 2 | 4 | |
+ 8 | 8 | eight | 2 | 4 | | 0
+ 0 | | zero | 2 | 4 | 1 | -1
+ 0 | | zero | 2 | 4 | 2 | 2
+ 0 | | zero | 2 | 4 | 3 | -3
+ 0 | | zero | 2 | 4 | 2 | 4
+ 0 | | zero | 2 | 4 | 5 | -5
+ 0 | | zero | 2 | 4 | 5 | -5
+ 0 | | zero | 2 | 4 | 0 |
+ 0 | | zero | 2 | 4 | |
+ 0 | | zero | 2 | 4 | | 0
+ | | null | 2 | 4 | 1 | -1
+ | | null | 2 | 4 | 2 | 2
+ | | null | 2 | 4 | 3 | -3
+ | | null | 2 | 4 | 2 | 4
+ | | null | 2 | 4 | 5 | -5
+ | | null | 2 | 4 | 5 | -5
+ | | null | 2 | 4 | 0 |
+ | | null | 2 | 4 | |
+ | | null | 2 | 4 | | 0
+ | 0 | zero | 2 | 4 | 1 | -1
+ | 0 | zero | 2 | 4 | 2 | 2
+ | 0 | zero | 2 | 4 | 3 | -3
+ | 0 | zero | 2 | 4 | 2 | 4
+ | 0 | zero | 2 | 4 | 5 | -5
+ | 0 | zero | 2 | 4 | 5 | -5
+ | 0 | zero | 2 | 4 | 0 |
+ | 0 | zero | 2 | 4 | |
+ | 0 | zero | 2 | 4 | | 0
+ 1 | 4 | one | 5 | -5 | 1 | -1
+ 1 | 4 | one | 5 | -5 | 2 | 2
+ 1 | 4 | one | 5 | -5 | 3 | -3
+ 1 | 4 | one | 5 | -5 | 2 | 4
+ 1 | 4 | one | 5 | -5 | 5 | -5
+ 1 | 4 | one | 5 | -5 | 5 | -5
+ 1 | 4 | one | 5 | -5 | 0 |
+ 1 | 4 | one | 5 | -5 | |
+ 1 | 4 | one | 5 | -5 | | 0
+ 2 | 3 | two | 5 | -5 | 1 | -1
+ 2 | 3 | two | 5 | -5 | 2 | 2
+ 2 | 3 | two | 5 | -5 | 3 | -3
+ 2 | 3 | two | 5 | -5 | 2 | 4
+ 2 | 3 | two | 5 | -5 | 5 | -5
+ 2 | 3 | two | 5 | -5 | 5 | -5
+ 2 | 3 | two | 5 | -5 | 0 |
+ 2 | 3 | two | 5 | -5 | |
+ 2 | 3 | two | 5 | -5 | | 0
+ 3 | 2 | three | 5 | -5 | 1 | -1
+ 3 | 2 | three | 5 | -5 | 2 | 2
+ 3 | 2 | three | 5 | -5 | 3 | -3
+ 3 | 2 | three | 5 | -5 | 2 | 4
+ 3 | 2 | three | 5 | -5 | 5 | -5
+ 3 | 2 | three | 5 | -5 | 5 | -5
+ 3 | 2 | three | 5 | -5 | 0 |
+ 3 | 2 | three | 5 | -5 | |
+ 3 | 2 | three | 5 | -5 | | 0
+ 4 | 1 | four | 5 | -5 | 1 | -1
+ 4 | 1 | four | 5 | -5 | 2 | 2
+ 4 | 1 | four | 5 | -5 | 3 | -3
+ 4 | 1 | four | 5 | -5 | 2 | 4
+ 4 | 1 | four | 5 | -5 | 5 | -5
+ 4 | 1 | four | 5 | -5 | 5 | -5
+ 4 | 1 | four | 5 | -5 | 0 |
+ 4 | 1 | four | 5 | -5 | |
+ 4 | 1 | four | 5 | -5 | | 0
+ 5 | 0 | five | 5 | -5 | 1 | -1
+ 5 | 0 | five | 5 | -5 | 2 | 2
+ 5 | 0 | five | 5 | -5 | 3 | -3
+ 5 | 0 | five | 5 | -5 | 2 | 4
+ 5 | 0 | five | 5 | -5 | 5 | -5
+ 5 | 0 | five | 5 | -5 | 5 | -5
+ 5 | 0 | five | 5 | -5 | 0 |
+ 5 | 0 | five | 5 | -5 | |
+ 5 | 0 | five | 5 | -5 | | 0
+ 6 | 6 | six | 5 | -5 | 1 | -1
+ 6 | 6 | six | 5 | -5 | 2 | 2
+ 6 | 6 | six | 5 | -5 | 3 | -3
+ 6 | 6 | six | 5 | -5 | 2 | 4
+ 6 | 6 | six | 5 | -5 | 5 | -5
+ 6 | 6 | six | 5 | -5 | 5 | -5
+ 6 | 6 | six | 5 | -5 | 0 |
+ 6 | 6 | six | 5 | -5 | |
+ 6 | 6 | six | 5 | -5 | | 0
+ 7 | 7 | seven | 5 | -5 | 1 | -1
+ 7 | 7 | seven | 5 | -5 | 2 | 2
+ 7 | 7 | seven | 5 | -5 | 3 | -3
+ 7 | 7 | seven | 5 | -5 | 2 | 4
+ 7 | 7 | seven | 5 | -5 | 5 | -5
+ 7 | 7 | seven | 5 | -5 | 5 | -5
+ 7 | 7 | seven | 5 | -5 | 0 |
+ 7 | 7 | seven | 5 | -5 | |
+ 7 | 7 | seven | 5 | -5 | | 0
+ 8 | 8 | eight | 5 | -5 | 1 | -1
+ 8 | 8 | eight | 5 | -5 | 2 | 2
+ 8 | 8 | eight | 5 | -5 | 3 | -3
+ 8 | 8 | eight | 5 | -5 | 2 | 4
+ 8 | 8 | eight | 5 | -5 | 5 | -5
+ 8 | 8 | eight | 5 | -5 | 5 | -5
+ 8 | 8 | eight | 5 | -5 | 0 |
+ 8 | 8 | eight | 5 | -5 | |
+ 8 | 8 | eight | 5 | -5 | | 0
+ 0 | | zero | 5 | -5 | 1 | -1
+ 0 | | zero | 5 | -5 | 2 | 2
+ 0 | | zero | 5 | -5 | 3 | -3
+ 0 | | zero | 5 | -5 | 2 | 4
+ 0 | | zero | 5 | -5 | 5 | -5
+ 0 | | zero | 5 | -5 | 5 | -5
+ 0 | | zero | 5 | -5 | 0 |
+ 0 | | zero | 5 | -5 | |
+ 0 | | zero | 5 | -5 | | 0
+ | | null | 5 | -5 | 1 | -1
+ | | null | 5 | -5 | 2 | 2
+ | | null | 5 | -5 | 3 | -3
+ | | null | 5 | -5 | 2 | 4
+ | | null | 5 | -5 | 5 | -5
+ | | null | 5 | -5 | 5 | -5
+ | | null | 5 | -5 | 0 |
+ | | null | 5 | -5 | |
+ | | null | 5 | -5 | | 0
+ | 0 | zero | 5 | -5 | 1 | -1
+ | 0 | zero | 5 | -5 | 2 | 2
+ | 0 | zero | 5 | -5 | 3 | -3
+ | 0 | zero | 5 | -5 | 2 | 4
+ | 0 | zero | 5 | -5 | 5 | -5
+ | 0 | zero | 5 | -5 | 5 | -5
+ | 0 | zero | 5 | -5 | 0 |
+ | 0 | zero | 5 | -5 | |
+ | 0 | zero | 5 | -5 | | 0
+ 1 | 4 | one | 5 | -5 | 1 | -1
+ 1 | 4 | one | 5 | -5 | 2 | 2
+ 1 | 4 | one | 5 | -5 | 3 | -3
+ 1 | 4 | one | 5 | -5 | 2 | 4
+ 1 | 4 | one | 5 | -5 | 5 | -5
+ 1 | 4 | one | 5 | -5 | 5 | -5
+ 1 | 4 | one | 5 | -5 | 0 |
+ 1 | 4 | one | 5 | -5 | |
+ 1 | 4 | one | 5 | -5 | | 0
+ 2 | 3 | two | 5 | -5 | 1 | -1
+ 2 | 3 | two | 5 | -5 | 2 | 2
+ 2 | 3 | two | 5 | -5 | 3 | -3
+ 2 | 3 | two | 5 | -5 | 2 | 4
+ 2 | 3 | two | 5 | -5 | 5 | -5
+ 2 | 3 | two | 5 | -5 | 5 | -5
+ 2 | 3 | two | 5 | -5 | 0 |
+ 2 | 3 | two | 5 | -5 | |
+ 2 | 3 | two | 5 | -5 | | 0
+ 3 | 2 | three | 5 | -5 | 1 | -1
+ 3 | 2 | three | 5 | -5 | 2 | 2
+ 3 | 2 | three | 5 | -5 | 3 | -3
+ 3 | 2 | three | 5 | -5 | 2 | 4
+ 3 | 2 | three | 5 | -5 | 5 | -5
+ 3 | 2 | three | 5 | -5 | 5 | -5
+ 3 | 2 | three | 5 | -5 | 0 |
+ 3 | 2 | three | 5 | -5 | |
+ 3 | 2 | three | 5 | -5 | | 0
+ 4 | 1 | four | 5 | -5 | 1 | -1
+ 4 | 1 | four | 5 | -5 | 2 | 2
+ 4 | 1 | four | 5 | -5 | 3 | -3
+ 4 | 1 | four | 5 | -5 | 2 | 4
+ 4 | 1 | four | 5 | -5 | 5 | -5
+ 4 | 1 | four | 5 | -5 | 5 | -5
+ 4 | 1 | four | 5 | -5 | 0 |
+ 4 | 1 | four | 5 | -5 | |
+ 4 | 1 | four | 5 | -5 | | 0
+ 5 | 0 | five | 5 | -5 | 1 | -1
+ 5 | 0 | five | 5 | -5 | 2 | 2
+ 5 | 0 | five | 5 | -5 | 3 | -3
+ 5 | 0 | five | 5 | -5 | 2 | 4
+ 5 | 0 | five | 5 | -5 | 5 | -5
+ 5 | 0 | five | 5 | -5 | 5 | -5
+ 5 | 0 | five | 5 | -5 | 0 |
+ 5 | 0 | five | 5 | -5 | |
+ 5 | 0 | five | 5 | -5 | | 0
+ 6 | 6 | six | 5 | -5 | 1 | -1
+ 6 | 6 | six | 5 | -5 | 2 | 2
+ 6 | 6 | six | 5 | -5 | 3 | -3
+ 6 | 6 | six | 5 | -5 | 2 | 4
+ 6 | 6 | six | 5 | -5 | 5 | -5
+ 6 | 6 | six | 5 | -5 | 5 | -5
+ 6 | 6 | six | 5 | -5 | 0 |
+ 6 | 6 | six | 5 | -5 | |
+ 6 | 6 | six | 5 | -5 | | 0
+ 7 | 7 | seven | 5 | -5 | 1 | -1
+ 7 | 7 | seven | 5 | -5 | 2 | 2
+ 7 | 7 | seven | 5 | -5 | 3 | -3
+ 7 | 7 | seven | 5 | -5 | 2 | 4
+ 7 | 7 | seven | 5 | -5 | 5 | -5
+ 7 | 7 | seven | 5 | -5 | 5 | -5
+ 7 | 7 | seven | 5 | -5 | 0 |
+ 7 | 7 | seven | 5 | -5 | |
+ 7 | 7 | seven | 5 | -5 | | 0
+ 8 | 8 | eight | 5 | -5 | 1 | -1
+ 8 | 8 | eight | 5 | -5 | 2 | 2
+ 8 | 8 | eight | 5 | -5 | 3 | -3
+ 8 | 8 | eight | 5 | -5 | 2 | 4
+ 8 | 8 | eight | 5 | -5 | 5 | -5
+ 8 | 8 | eight | 5 | -5 | 5 | -5
+ 8 | 8 | eight | 5 | -5 | 0 |
+ 8 | 8 | eight | 5 | -5 | |
+ 8 | 8 | eight | 5 | -5 | | 0
+ 0 | | zero | 5 | -5 | 1 | -1
+ 0 | | zero | 5 | -5 | 2 | 2
+ 0 | | zero | 5 | -5 | 3 | -3
+ 0 | | zero | 5 | -5 | 2 | 4
+ 0 | | zero | 5 | -5 | 5 | -5
+ 0 | | zero | 5 | -5 | 5 | -5
+ 0 | | zero | 5 | -5 | 0 |
+ 0 | | zero | 5 | -5 | |
+ 0 | | zero | 5 | -5 | | 0
+ | | null | 5 | -5 | 1 | -1
+ | | null | 5 | -5 | 2 | 2
+ | | null | 5 | -5 | 3 | -3
+ | | null | 5 | -5 | 2 | 4
+ | | null | 5 | -5 | 5 | -5
+ | | null | 5 | -5 | 5 | -5
+ | | null | 5 | -5 | 0 |
+ | | null | 5 | -5 | |
+ | | null | 5 | -5 | | 0
+ | 0 | zero | 5 | -5 | 1 | -1
+ | 0 | zero | 5 | -5 | 2 | 2
+ | 0 | zero | 5 | -5 | 3 | -3
+ | 0 | zero | 5 | -5 | 2 | 4
+ | 0 | zero | 5 | -5 | 5 | -5
+ | 0 | zero | 5 | -5 | 5 | -5
+ | 0 | zero | 5 | -5 | 0 |
+ | 0 | zero | 5 | -5 | |
+ | 0 | zero | 5 | -5 | | 0
+ 1 | 4 | one | 0 | | 1 | -1
+ 1 | 4 | one | 0 | | 2 | 2
+ 1 | 4 | one | 0 | | 3 | -3
+ 1 | 4 | one | 0 | | 2 | 4
+ 1 | 4 | one | 0 | | 5 | -5
+ 1 | 4 | one | 0 | | 5 | -5
+ 1 | 4 | one | 0 | | 0 |
+ 1 | 4 | one | 0 | | |
+ 1 | 4 | one | 0 | | | 0
+ 2 | 3 | two | 0 | | 1 | -1
+ 2 | 3 | two | 0 | | 2 | 2
+ 2 | 3 | two | 0 | | 3 | -3
+ 2 | 3 | two | 0 | | 2 | 4
+ 2 | 3 | two | 0 | | 5 | -5
+ 2 | 3 | two | 0 | | 5 | -5
+ 2 | 3 | two | 0 | | 0 |
+ 2 | 3 | two | 0 | | |
+ 2 | 3 | two | 0 | | | 0
+ 3 | 2 | three | 0 | | 1 | -1
+ 3 | 2 | three | 0 | | 2 | 2
+ 3 | 2 | three | 0 | | 3 | -3
+ 3 | 2 | three | 0 | | 2 | 4
+ 3 | 2 | three | 0 | | 5 | -5
+ 3 | 2 | three | 0 | | 5 | -5
+ 3 | 2 | three | 0 | | 0 |
+ 3 | 2 | three | 0 | | |
+ 3 | 2 | three | 0 | | | 0
+ 4 | 1 | four | 0 | | 1 | -1
+ 4 | 1 | four | 0 | | 2 | 2
+ 4 | 1 | four | 0 | | 3 | -3
+ 4 | 1 | four | 0 | | 2 | 4
+ 4 | 1 | four | 0 | | 5 | -5
+ 4 | 1 | four | 0 | | 5 | -5
+ 4 | 1 | four | 0 | | 0 |
+ 4 | 1 | four | 0 | | |
+ 4 | 1 | four | 0 | | | 0
+ 5 | 0 | five | 0 | | 1 | -1
+ 5 | 0 | five | 0 | | 2 | 2
+ 5 | 0 | five | 0 | | 3 | -3
+ 5 | 0 | five | 0 | | 2 | 4
+ 5 | 0 | five | 0 | | 5 | -5
+ 5 | 0 | five | 0 | | 5 | -5
+ 5 | 0 | five | 0 | | 0 |
+ 5 | 0 | five | 0 | | |
+ 5 | 0 | five | 0 | | | 0
+ 6 | 6 | six | 0 | | 1 | -1
+ 6 | 6 | six | 0 | | 2 | 2
+ 6 | 6 | six | 0 | | 3 | -3
+ 6 | 6 | six | 0 | | 2 | 4
+ 6 | 6 | six | 0 | | 5 | -5
+ 6 | 6 | six | 0 | | 5 | -5
+ 6 | 6 | six | 0 | | 0 |
+ 6 | 6 | six | 0 | | |
+ 6 | 6 | six | 0 | | | 0
+ 7 | 7 | seven | 0 | | 1 | -1
+ 7 | 7 | seven | 0 | | 2 | 2
+ 7 | 7 | seven | 0 | | 3 | -3
+ 7 | 7 | seven | 0 | | 2 | 4
+ 7 | 7 | seven | 0 | | 5 | -5
+ 7 | 7 | seven | 0 | | 5 | -5
+ 7 | 7 | seven | 0 | | 0 |
+ 7 | 7 | seven | 0 | | |
+ 7 | 7 | seven | 0 | | | 0
+ 8 | 8 | eight | 0 | | 1 | -1
+ 8 | 8 | eight | 0 | | 2 | 2
+ 8 | 8 | eight | 0 | | 3 | -3
+ 8 | 8 | eight | 0 | | 2 | 4
+ 8 | 8 | eight | 0 | | 5 | -5
+ 8 | 8 | eight | 0 | | 5 | -5
+ 8 | 8 | eight | 0 | | 0 |
+ 8 | 8 | eight | 0 | | |
+ 8 | 8 | eight | 0 | | | 0
+ 0 | | zero | 0 | | 1 | -1
+ 0 | | zero | 0 | | 2 | 2
+ 0 | | zero | 0 | | 3 | -3
+ 0 | | zero | 0 | | 2 | 4
+ 0 | | zero | 0 | | 5 | -5
+ 0 | | zero | 0 | | 5 | -5
+ 0 | | zero | 0 | | 0 |
+ 0 | | zero | 0 | | |
+ 0 | | zero | 0 | | | 0
+ | | null | 0 | | 1 | -1
+ | | null | 0 | | 2 | 2
+ | | null | 0 | | 3 | -3
+ | | null | 0 | | 2 | 4
+ | | null | 0 | | 5 | -5
+ | | null | 0 | | 5 | -5
+ | | null | 0 | | 0 |
+ | | null | 0 | | |
+ | | null | 0 | | | 0
+ | 0 | zero | 0 | | 1 | -1
+ | 0 | zero | 0 | | 2 | 2
+ | 0 | zero | 0 | | 3 | -3
+ | 0 | zero | 0 | | 2 | 4
+ | 0 | zero | 0 | | 5 | -5
+ | 0 | zero | 0 | | 5 | -5
+ | 0 | zero | 0 | | 0 |
+ | 0 | zero | 0 | | |
+ | 0 | zero | 0 | | | 0
+ 1 | 4 | one | | | 1 | -1
+ 1 | 4 | one | | | 2 | 2
+ 1 | 4 | one | | | 3 | -3
+ 1 | 4 | one | | | 2 | 4
+ 1 | 4 | one | | | 5 | -5
+ 1 | 4 | one | | | 5 | -5
+ 1 | 4 | one | | | 0 |
+ 1 | 4 | one | | | |
+ 1 | 4 | one | | | | 0
+ 2 | 3 | two | | | 1 | -1
+ 2 | 3 | two | | | 2 | 2
+ 2 | 3 | two | | | 3 | -3
+ 2 | 3 | two | | | 2 | 4
+ 2 | 3 | two | | | 5 | -5
+ 2 | 3 | two | | | 5 | -5
+ 2 | 3 | two | | | 0 |
+ 2 | 3 | two | | | |
+ 2 | 3 | two | | | | 0
+ 3 | 2 | three | | | 1 | -1
+ 3 | 2 | three | | | 2 | 2
+ 3 | 2 | three | | | 3 | -3
+ 3 | 2 | three | | | 2 | 4
+ 3 | 2 | three | | | 5 | -5
+ 3 | 2 | three | | | 5 | -5
+ 3 | 2 | three | | | 0 |
+ 3 | 2 | three | | | |
+ 3 | 2 | three | | | | 0
+ 4 | 1 | four | | | 1 | -1
+ 4 | 1 | four | | | 2 | 2
+ 4 | 1 | four | | | 3 | -3
+ 4 | 1 | four | | | 2 | 4
+ 4 | 1 | four | | | 5 | -5
+ 4 | 1 | four | | | 5 | -5
+ 4 | 1 | four | | | 0 |
+ 4 | 1 | four | | | |
+ 4 | 1 | four | | | | 0
+ 5 | 0 | five | | | 1 | -1
+ 5 | 0 | five | | | 2 | 2
+ 5 | 0 | five | | | 3 | -3
+ 5 | 0 | five | | | 2 | 4
+ 5 | 0 | five | | | 5 | -5
+ 5 | 0 | five | | | 5 | -5
+ 5 | 0 | five | | | 0 |
+ 5 | 0 | five | | | |
+ 5 | 0 | five | | | | 0
+ 6 | 6 | six | | | 1 | -1
+ 6 | 6 | six | | | 2 | 2
+ 6 | 6 | six | | | 3 | -3
+ 6 | 6 | six | | | 2 | 4
+ 6 | 6 | six | | | 5 | -5
+ 6 | 6 | six | | | 5 | -5
+ 6 | 6 | six | | | 0 |
+ 6 | 6 | six | | | |
+ 6 | 6 | six | | | | 0
+ 7 | 7 | seven | | | 1 | -1
+ 7 | 7 | seven | | | 2 | 2
+ 7 | 7 | seven | | | 3 | -3
+ 7 | 7 | seven | | | 2 | 4
+ 7 | 7 | seven | | | 5 | -5
+ 7 | 7 | seven | | | 5 | -5
+ 7 | 7 | seven | | | 0 |
+ 7 | 7 | seven | | | |
+ 7 | 7 | seven | | | | 0
+ 8 | 8 | eight | | | 1 | -1
+ 8 | 8 | eight | | | 2 | 2
+ 8 | 8 | eight | | | 3 | -3
+ 8 | 8 | eight | | | 2 | 4
+ 8 | 8 | eight | | | 5 | -5
+ 8 | 8 | eight | | | 5 | -5
+ 8 | 8 | eight | | | 0 |
+ 8 | 8 | eight | | | |
+ 8 | 8 | eight | | | | 0
+ 0 | | zero | | | 1 | -1
+ 0 | | zero | | | 2 | 2
+ 0 | | zero | | | 3 | -3
+ 0 | | zero | | | 2 | 4
+ 0 | | zero | | | 5 | -5
+ 0 | | zero | | | 5 | -5
+ 0 | | zero | | | 0 |
+ 0 | | zero | | | |
+ 0 | | zero | | | | 0
+ | | null | | | 1 | -1
+ | | null | | | 2 | 2
+ | | null | | | 3 | -3
+ | | null | | | 2 | 4
+ | | null | | | 5 | -5
+ | | null | | | 5 | -5
+ | | null | | | 0 |
+ | | null | | | |
+ | | null | | | | 0
+ | 0 | zero | | | 1 | -1
+ | 0 | zero | | | 2 | 2
+ | 0 | zero | | | 3 | -3
+ | 0 | zero | | | 2 | 4
+ | 0 | zero | | | 5 | -5
+ | 0 | zero | | | 5 | -5
+ | 0 | zero | | | 0 |
+ | 0 | zero | | | |
+ | 0 | zero | | | | 0
+ 1 | 4 | one | | 0 | 1 | -1
+ 1 | 4 | one | | 0 | 2 | 2
+ 1 | 4 | one | | 0 | 3 | -3
+ 1 | 4 | one | | 0 | 2 | 4
+ 1 | 4 | one | | 0 | 5 | -5
+ 1 | 4 | one | | 0 | 5 | -5
+ 1 | 4 | one | | 0 | 0 |
+ 1 | 4 | one | | 0 | |
+ 1 | 4 | one | | 0 | | 0
+ 2 | 3 | two | | 0 | 1 | -1
+ 2 | 3 | two | | 0 | 2 | 2
+ 2 | 3 | two | | 0 | 3 | -3
+ 2 | 3 | two | | 0 | 2 | 4
+ 2 | 3 | two | | 0 | 5 | -5
+ 2 | 3 | two | | 0 | 5 | -5
+ 2 | 3 | two | | 0 | 0 |
+ 2 | 3 | two | | 0 | |
+ 2 | 3 | two | | 0 | | 0
+ 3 | 2 | three | | 0 | 1 | -1
+ 3 | 2 | three | | 0 | 2 | 2
+ 3 | 2 | three | | 0 | 3 | -3
+ 3 | 2 | three | | 0 | 2 | 4
+ 3 | 2 | three | | 0 | 5 | -5
+ 3 | 2 | three | | 0 | 5 | -5
+ 3 | 2 | three | | 0 | 0 |
+ 3 | 2 | three | | 0 | |
+ 3 | 2 | three | | 0 | | 0
+ 4 | 1 | four | | 0 | 1 | -1
+ 4 | 1 | four | | 0 | 2 | 2
+ 4 | 1 | four | | 0 | 3 | -3
+ 4 | 1 | four | | 0 | 2 | 4
+ 4 | 1 | four | | 0 | 5 | -5
+ 4 | 1 | four | | 0 | 5 | -5
+ 4 | 1 | four | | 0 | 0 |
+ 4 | 1 | four | | 0 | |
+ 4 | 1 | four | | 0 | | 0
+ 5 | 0 | five | | 0 | 1 | -1
+ 5 | 0 | five | | 0 | 2 | 2
+ 5 | 0 | five | | 0 | 3 | -3
+ 5 | 0 | five | | 0 | 2 | 4
+ 5 | 0 | five | | 0 | 5 | -5
+ 5 | 0 | five | | 0 | 5 | -5
+ 5 | 0 | five | | 0 | 0 |
+ 5 | 0 | five | | 0 | |
+ 5 | 0 | five | | 0 | | 0
+ 6 | 6 | six | | 0 | 1 | -1
+ 6 | 6 | six | | 0 | 2 | 2
+ 6 | 6 | six | | 0 | 3 | -3
+ 6 | 6 | six | | 0 | 2 | 4
+ 6 | 6 | six | | 0 | 5 | -5
+ 6 | 6 | six | | 0 | 5 | -5
+ 6 | 6 | six | | 0 | 0 |
+ 6 | 6 | six | | 0 | |
+ 6 | 6 | six | | 0 | | 0
+ 7 | 7 | seven | | 0 | 1 | -1
+ 7 | 7 | seven | | 0 | 2 | 2
+ 7 | 7 | seven | | 0 | 3 | -3
+ 7 | 7 | seven | | 0 | 2 | 4
+ 7 | 7 | seven | | 0 | 5 | -5
+ 7 | 7 | seven | | 0 | 5 | -5
+ 7 | 7 | seven | | 0 | 0 |
+ 7 | 7 | seven | | 0 | |
+ 7 | 7 | seven | | 0 | | 0
+ 8 | 8 | eight | | 0 | 1 | -1
+ 8 | 8 | eight | | 0 | 2 | 2
+ 8 | 8 | eight | | 0 | 3 | -3
+ 8 | 8 | eight | | 0 | 2 | 4
+ 8 | 8 | eight | | 0 | 5 | -5
+ 8 | 8 | eight | | 0 | 5 | -5
+ 8 | 8 | eight | | 0 | 0 |
+ 8 | 8 | eight | | 0 | |
+ 8 | 8 | eight | | 0 | | 0
+ 0 | | zero | | 0 | 1 | -1
+ 0 | | zero | | 0 | 2 | 2
+ 0 | | zero | | 0 | 3 | -3
+ 0 | | zero | | 0 | 2 | 4
+ 0 | | zero | | 0 | 5 | -5
+ 0 | | zero | | 0 | 5 | -5
+ 0 | | zero | | 0 | 0 |
+ 0 | | zero | | 0 | |
+ 0 | | zero | | 0 | | 0
+ | | null | | 0 | 1 | -1
+ | | null | | 0 | 2 | 2
+ | | null | | 0 | 3 | -3
+ | | null | | 0 | 2 | 4
+ | | null | | 0 | 5 | -5
+ | | null | | 0 | 5 | -5
+ | | null | | 0 | 0 |
+ | | null | | 0 | |
+ | | null | | 0 | | 0
+ | 0 | zero | | 0 | 1 | -1
+ | 0 | zero | | 0 | 2 | 2
+ | 0 | zero | | 0 | 3 | -3
+ | 0 | zero | | 0 | 2 | 4
+ | 0 | zero | | 0 | 5 | -5
+ | 0 | zero | | 0 | 5 | -5
+ | 0 | zero | | 0 | 0 |
+ | 0 | zero | | 0 | |
+ | 0 | zero | | 0 | | 0
+(891 rows)
+
+--
+--
+-- Inner joins (equi-joins)
+--
+--
+--
+-- Inner joins (equi-joins) with USING clause
+-- The USING syntax changes the shape of the resulting table
+-- by including a column in the USING clause only once in the result.
+--
+-- Inner equi-join on specified column
+SELECT *
+ FROM J1_TBL INNER JOIN J2_TBL USING (i);
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+-- Same as above, slightly different syntax
+SELECT *
+ FROM J1_TBL JOIN J2_TBL USING (i);
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
+ ORDER BY a, d;
+ a | b | c | d
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, b) USING (b)
+ ORDER BY b, t1.a;
+ b | a | c | a
+---+---+-------+---
+ 0 | 5 | five |
+ 0 | | zero |
+ 2 | 3 | three | 2
+ 4 | 1 | one | 2
+(4 rows)
+
+-- test join using aliases
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) WHERE J1_TBL.t = 'one'; -- ok
+ i | j | t | k
+---+---+-----+----
+ 1 | 4 | one | -1
+(1 row)
+
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one'; -- ok
+ i | j | t | k
+---+---+-----+----
+ 1 | 4 | one | -1
+(1 row)
+
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i)) AS x WHERE J1_TBL.t = 'one'; -- error
+ERROR: invalid reference to FROM-clause entry for table "j1_tbl"
+LINE 1: ... * FROM (J1_TBL JOIN J2_TBL USING (i)) AS x WHERE J1_TBL.t =...
+ ^
+HINT: There is an entry for table "j1_tbl", but it cannot be referenced from this part of the query.
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.i = 1; -- ok
+ i | j | t | k
+---+---+-----+----
+ 1 | 4 | one | -1
+(1 row)
+
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.t = 'one'; -- error
+ERROR: column x.t does not exist
+LINE 1: ...CT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.t = 'one...
+ ^
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i) AS x) AS xx WHERE x.i = 1; -- error (XXX could use better hint)
+ERROR: missing FROM-clause entry for table "x"
+LINE 1: ...ROM (J1_TBL JOIN J2_TBL USING (i) AS x) AS xx WHERE x.i = 1;
+ ^
+SELECT * FROM J1_TBL a1 JOIN J2_TBL a2 USING (i) AS a1; -- error
+ERROR: table name "a1" specified more than once
+SELECT x.* FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ i
+---
+ 1
+(1 row)
+
+SELECT ROW(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ row
+-----
+ (1)
+(1 row)
+
+SELECT row_to_json(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+ row_to_json
+-------------
+ {"i":1}
+(1 row)
+
+--
+-- NATURAL JOIN
+-- Inner equi-join on all columns with the same name
+--
+SELECT *
+ FROM J1_TBL NATURAL JOIN J2_TBL;
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d);
+ a | b | c | d
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
+ a | b | c | d
+---+---+------+---
+ 0 | | zero |
+ 2 | 3 | two | 2
+ 4 | 1 | four | 2
+(3 rows)
+
+-- mismatch number of columns
+-- currently, Postgres will fill in with underlying names
+SELECT *
+ FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a);
+ a | b | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+(7 rows)
+
+--
+-- Inner joins (equi-joins)
+--
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i);
+ i | j | t | i | k
+---+---+-------+---+----
+ 0 | | zero | 0 |
+ 1 | 4 | one | 1 | -1
+ 2 | 3 | two | 2 | 2
+ 2 | 3 | two | 2 | 4
+ 3 | 2 | three | 3 | -3
+ 5 | 0 | five | 5 | -5
+ 5 | 0 | five | 5 | -5
+(7 rows)
+
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
+ i | j | t | i | k
+---+---+------+---+---
+ 0 | | zero | | 0
+ 2 | 3 | two | 2 | 2
+ 4 | 1 | four | 2 | 4
+(3 rows)
+
+--
+-- Non-equi-joins
+--
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i <= J2_TBL.k);
+ i | j | t | i | k
+---+---+-------+---+---
+ 1 | 4 | one | 2 | 2
+ 2 | 3 | two | 2 | 2
+ 0 | | zero | 2 | 2
+ 1 | 4 | one | 2 | 4
+ 2 | 3 | two | 2 | 4
+ 3 | 2 | three | 2 | 4
+ 4 | 1 | four | 2 | 4
+ 0 | | zero | 2 | 4
+ 0 | | zero | | 0
+(9 rows)
+
+--
+-- Outer joins
+-- Note that OUTER is a noise word
+--
+SELECT *
+ FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 4 | 1 | four |
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ 6 | 6 | six |
+ 7 | 7 | seven |
+ 8 | 8 | eight |
+ | | null |
+ | 0 | zero |
+(13 rows)
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 4 | 1 | four |
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ 6 | 6 | six |
+ 7 | 7 | seven |
+ 8 | 8 | eight |
+ | | null |
+ | 0 | zero |
+(13 rows)
+
+SELECT *
+ FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ | | |
+ | | | 0
+(9 rows)
+
+SELECT *
+ FROM J1_TBL RIGHT JOIN J2_TBL USING (i);
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ | | |
+ | | | 0
+(9 rows)
+
+SELECT *
+ FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 4 | 1 | four |
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ 6 | 6 | six |
+ 7 | 7 | seven |
+ 8 | 8 | eight |
+ | | | 0
+ | | null |
+ | 0 | zero |
+ | | |
+(15 rows)
+
+SELECT *
+ FROM J1_TBL FULL JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+ i | j | t | k
+---+---+-------+----
+ 0 | | zero |
+ 1 | 4 | one | -1
+ 2 | 3 | two | 2
+ 2 | 3 | two | 4
+ 3 | 2 | three | -3
+ 4 | 1 | four |
+ 5 | 0 | five | -5
+ 5 | 0 | five | -5
+ 6 | 6 | six |
+ 7 | 7 | seven |
+ 8 | 8 | eight |
+ | | | 0
+ | | null |
+ | 0 | zero |
+ | | |
+(15 rows)
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1);
+ i | j | t | k
+---+---+---+---
+(0 rows)
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (i = 1);
+ i | j | t | k
+---+---+-----+----
+ 1 | 4 | one | -1
+(1 row)
+
+--
+-- semijoin selectivity for <>
+--
+explain (costs off)
+select * from int4_tbl i4, tenk1 a
+where exists(select * from tenk1 b
+ where a.twothousand = b.twothousand and a.fivethous <> b.fivethous)
+ and i4.f1 = a.tenthous;
+ QUERY PLAN
+----------------------------------------------
+ Hash Semi Join
+ Hash Cond: (a.twothousand = b.twothousand)
+ Join Filter: (a.fivethous <> b.fivethous)
+ -> Hash Join
+ Hash Cond: (a.tenthous = i4.f1)
+ -> Seq Scan on tenk1 a
+ -> Hash
+ -> Seq Scan on int4_tbl i4
+ -> Hash
+ -> Seq Scan on tenk1 b
+(10 rows)
+
+--
+-- More complicated constructs
+--
+--
+-- Multiway full join
+--
+CREATE TABLE t1 (name TEXT, n INTEGER);
+CREATE TABLE t2 (name TEXT, n INTEGER);
+CREATE TABLE t3 (name TEXT, n INTEGER);
+INSERT INTO t1 VALUES ( 'bb', 11 );
+INSERT INTO t2 VALUES ( 'bb', 12 );
+INSERT INTO t2 VALUES ( 'cc', 22 );
+INSERT INTO t2 VALUES ( 'ee', 42 );
+INSERT INTO t3 VALUES ( 'bb', 13 );
+INSERT INTO t3 VALUES ( 'cc', 23 );
+INSERT INTO t3 VALUES ( 'dd', 33 );
+SELECT * FROM t1 FULL JOIN t2 USING (name) FULL JOIN t3 USING (name);
+ name | n | n | n
+------+----+----+----
+ bb | 11 | 12 | 13
+ cc | | 22 | 23
+ dd | | | 33
+ ee | | 42 |
+(4 rows)
+
+--
+-- Test interactions of join syntax and subqueries
+--
+-- Basic cases (we expect planner to pull up the subquery here)
+SELECT * FROM
+(SELECT * FROM t2) as s2
+INNER JOIN
+(SELECT * FROM t3) s3
+USING (name);
+ name | n | n
+------+----+----
+ bb | 12 | 13
+ cc | 22 | 23
+(2 rows)
+
+SELECT * FROM
+(SELECT * FROM t2) as s2
+LEFT JOIN
+(SELECT * FROM t3) s3
+USING (name);
+ name | n | n
+------+----+----
+ bb | 12 | 13
+ cc | 22 | 23
+ ee | 42 |
+(3 rows)
+
+SELECT * FROM
+(SELECT * FROM t2) as s2
+FULL JOIN
+(SELECT * FROM t3) s3
+USING (name);
+ name | n | n
+------+----+----
+ bb | 12 | 13
+ cc | 22 | 23
+ dd | | 33
+ ee | 42 |
+(4 rows)
+
+-- Cases with non-nullable expressions in subquery results;
+-- make sure these go to null as expected
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+ name | s2_n | s2_2 | s3_n | s3_2
+------+------+------+------+------
+ bb | 12 | 2 | 13 | 3
+ cc | 22 | 2 | 23 | 3
+(2 rows)
+
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL LEFT JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+ name | s2_n | s2_2 | s3_n | s3_2
+------+------+------+------+------
+ bb | 12 | 2 | 13 | 3
+ cc | 22 | 2 | 23 | 3
+ ee | 42 | 2 | |
+(3 rows)
+
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+ name | s2_n | s2_2 | s3_n | s3_2
+------+------+------+------+------
+ bb | 12 | 2 | 13 | 3
+ cc | 22 | 2 | 23 | 3
+ dd | | | 33 | 3
+ ee | 42 | 2 | |
+(4 rows)
+
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL INNER JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+ name | s1_n | s1_1 | s2_n | s2_2 | s3_n | s3_2
+------+------+------+------+------+------+------
+ bb | 11 | 1 | 12 | 2 | 13 | 3
+(1 row)
+
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL FULL JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+ name | s1_n | s1_1 | s2_n | s2_2 | s3_n | s3_2
+------+------+------+------+------+------+------
+ bb | 11 | 1 | 12 | 2 | 13 | 3
+ cc | | | 22 | 2 | 23 | 3
+ dd | | | | | 33 | 3
+ ee | | | 42 | 2 | |
+(4 rows)
+
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+ name | s1_n | s2_n | s3_n
+------+------+------+------
+ bb | 11 | 12 | 13
+ cc | | 22 | 23
+ dd | | | 33
+ ee | | 42 |
+(4 rows)
+
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+ name | s1_n | s2_n | s2_2 | s3_n
+------+------+------+------+------
+ bb | 11 | 12 | 2 | 13
+ cc | | 22 | 2 | 23
+ dd | | | | 33
+ ee | | 42 | 2 |
+(4 rows)
+
+-- Constants as join keys can also be problematic
+SELECT * FROM
+ (SELECT name, n as s1_n FROM t1) as s1
+FULL JOIN
+ (SELECT name, 2 as s2_n FROM t2) as s2
+ON (s1_n = s2_n);
+ name | s1_n | name | s2_n
+------+------+------+------
+ | | bb | 2
+ | | cc | 2
+ | | ee | 2
+ bb | 11 | |
+(4 rows)
+
+-- Test for propagation of nullability constraints into sub-joins
+create temp table x (x1 int, x2 int);
+insert into x values (1,11);
+insert into x values (2,22);
+insert into x values (3,null);
+insert into x values (4,44);
+insert into x values (5,null);
+create temp table y (y1 int, y2 int);
+insert into y values (1,111);
+insert into y values (2,222);
+insert into y values (3,333);
+insert into y values (4,null);
+select * from x;
+ x1 | x2
+----+----
+ 1 | 11
+ 2 | 22
+ 3 |
+ 4 | 44
+ 5 |
+(5 rows)
+
+select * from y;
+ y1 | y2
+----+-----
+ 1 | 111
+ 2 | 222
+ 3 | 333
+ 4 |
+(4 rows)
+
+select * from x left join y on (x1 = y1 and x2 is not null);
+ x1 | x2 | y1 | y2
+----+----+----+-----
+ 1 | 11 | 1 | 111
+ 2 | 22 | 2 | 222
+ 3 | | |
+ 4 | 44 | 4 |
+ 5 | | |
+(5 rows)
+
+select * from x left join y on (x1 = y1 and y2 is not null);
+ x1 | x2 | y1 | y2
+----+----+----+-----
+ 1 | 11 | 1 | 111
+ 2 | 22 | 2 | 222
+ 3 | | 3 | 333
+ 4 | 44 | |
+ 5 | | |
+(5 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | 3 |
+ 4 | 44 | 4 | | 4 | 44
+ 5 | | | | 5 |
+(5 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and x2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | |
+ 4 | 44 | 4 | | 4 | 44
+ 5 | | | | |
+(5 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and y2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | 3 |
+ 4 | 44 | 4 | | |
+ 5 | | | | |
+(5 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and xx2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | |
+ 4 | 44 | 4 | | 4 | 44
+ 5 | | | | |
+(5 rows)
+
+-- these should NOT give the same answers as above
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (x2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 4 | 44 | 4 | | 4 | 44
+(3 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (y2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 3 | | 3 | 333 | 3 |
+(3 rows)
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (xx2 is not null);
+ x1 | x2 | y1 | y2 | xx1 | xx2
+----+----+----+-----+-----+-----
+ 1 | 11 | 1 | 111 | 1 | 11
+ 2 | 22 | 2 | 222 | 2 | 22
+ 4 | 44 | 4 | | 4 | 44
+(3 rows)
+
+--
+-- regression test: check for bug with propagation of implied equality
+-- to outside an IN
+--
+select count(*) from tenk1 a where unique1 in
+ (select unique1 from tenk1 b join tenk1 c using (unique1)
+ where b.unique2 = 42);
+ count
+-------
+ 1
+(1 row)
+
+--
+-- regression test: check for failure to generate a plan with multiple
+-- degenerate IN clauses
+--
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+ count
+-------
+ 1
+(1 row)
+
+-- try that with GEQO too
+begin;
+set geqo = on;
+set geqo_threshold = 2;
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+ count
+-------
+ 1
+(1 row)
+
+rollback;
+--
+-- regression test: be sure we cope with proven-dummy append rels
+--
+explain (costs off)
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+ aa | bb | unique1 | unique1
+----+----+---------+---------
+(0 rows)
+
+--
+-- regression test: check handling of empty-FROM subquery underneath outer join
+--
+explain (costs off)
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+ QUERY PLAN
+-------------------------------------------
+ Sort
+ Sort Key: i1.q1, i1.q2
+ -> Hash Left Join
+ Hash Cond: (i1.q2 = i2.q2)
+ -> Seq Scan on int8_tbl i1
+ -> Hash
+ -> Seq Scan on int8_tbl i2
+ Filter: (q1 = 123)
+(8 rows)
+
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+ q1 | q2 | q1 | q2 | x
+------------------+-------------------+-----+------------------+-----
+ 123 | 456 | 123 | 456 | 123
+ 123 | 4567890123456789 | 123 | 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789 | | |
+ 4567890123456789 | 123 | | |
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 123
+(5 rows)
+
+--
+-- regression test: check a case where join_clause_is_movable_into() gives
+-- an imprecise result, causing an assertion failure
+--
+select count(*)
+from
+ (select t3.tenthous as x1, coalesce(t1.stringu1, t2.stringu1) as x2
+ from tenk1 t1
+ left join tenk1 t2 on t1.unique1 = t2.unique1
+ join tenk1 t3 on t1.unique2 = t3.unique2) ss,
+ tenk1 t4,
+ tenk1 t5
+where t4.thousand = t5.unique1 and ss.x1 = t4.tenthous and ss.x2 = t5.stringu1;
+ count
+-------
+ 1000
+(1 row)
+
+--
+-- regression test: check a case where we formerly missed including an EC
+-- enforcement clause because it was expected to be handled at scan level
+--
+explain (costs off)
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ -> Aggregate
+ -> Seq Scan on int4_tbl i4b
+ -> Nested Loop
+ Join Filter: ((sum(i4b.f1)) = ((sum(i4a.f1) + 1)))
+ -> Aggregate
+ -> Seq Scan on int4_tbl i4a
+ -> Index Only Scan using tenk1_thous_tenthous on tenk1 t
+ Index Cond: ((thousand = (sum(i4b.f1))) AND (tenthous = ((((sum(i4a.f1) + 1)) + (sum(i4b.f1))) + 999)))
+(9 rows)
+
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+ f1 | f1 | thousand | tenthous
+----+----+----------+----------
+(0 rows)
+
+--
+-- check a case where we formerly got confused by conflicting sort orders
+-- in redundant merge join path keys
+--
+explain (costs off)
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+ QUERY PLAN
+-----------------------------------------------------------------
+ Merge Full Join
+ Merge Cond: ((j2_tbl.i = j1_tbl.i) AND (j2_tbl.k = j1_tbl.i))
+ -> Sort
+ Sort Key: j2_tbl.i DESC, j2_tbl.k
+ -> Seq Scan on j2_tbl
+ -> Sort
+ Sort Key: j1_tbl.i DESC
+ -> Seq Scan on j1_tbl
+(8 rows)
+
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+ i | j | t | i | k
+---+---+-------+---+----
+ | | | | 0
+ | | | |
+ | 0 | zero | |
+ | | null | |
+ 8 | 8 | eight | |
+ 7 | 7 | seven | |
+ 6 | 6 | six | |
+ | | | 5 | -5
+ | | | 5 | -5
+ 5 | 0 | five | |
+ 4 | 1 | four | |
+ | | | 3 | -3
+ 3 | 2 | three | |
+ 2 | 3 | two | 2 | 2
+ | | | 2 | 4
+ | | | 1 | -1
+ | | | 0 |
+ 1 | 4 | one | |
+ 0 | | zero | |
+(19 rows)
+
+--
+-- a different check for handling of redundant sort keys in merge joins
+--
+explain (costs off)
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+ QUERY PLAN
+----------------------------------------------------------------------------------
+ Aggregate
+ -> Merge Left Join
+ Merge Cond: (x.thousand = y.unique2)
+ Join Filter: ((x.twothousand = y.hundred) AND (x.fivethous = y.unique2))
+ -> Sort
+ Sort Key: x.thousand, x.twothousand, x.fivethous
+ -> Seq Scan on tenk1 x
+ -> Materialize
+ -> Index Scan using tenk1_unique2 on tenk1 y
+(9 rows)
+
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+ count
+-------
+ 10000
+(1 row)
+
+--
+-- Clean up
+--
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE J1_TBL;
+DROP TABLE J2_TBL;
+-- Both DELETE and UPDATE allow the specification of additional tables
+-- to "join" against to determine which rows should be modified.
+CREATE TEMP TABLE t1 (a int, b int);
+CREATE TEMP TABLE t2 (a int, b int);
+CREATE TEMP TABLE t3 (x int, y int);
+INSERT INTO t1 VALUES (5, 10);
+INSERT INTO t1 VALUES (15, 20);
+INSERT INTO t1 VALUES (100, 100);
+INSERT INTO t1 VALUES (200, 1000);
+INSERT INTO t2 VALUES (200, 2000);
+INSERT INTO t3 VALUES (5, 20);
+INSERT INTO t3 VALUES (6, 7);
+INSERT INTO t3 VALUES (7, 8);
+INSERT INTO t3 VALUES (500, 100);
+DELETE FROM t3 USING t1 table1 WHERE t3.x = table1.a;
+SELECT * FROM t3;
+ x | y
+-----+-----
+ 6 | 7
+ 7 | 8
+ 500 | 100
+(3 rows)
+
+DELETE FROM t3 USING t1 JOIN t2 USING (a) WHERE t3.x > t1.a;
+SELECT * FROM t3;
+ x | y
+---+---
+ 6 | 7
+ 7 | 8
+(2 rows)
+
+DELETE FROM t3 USING t3 t3_other WHERE t3.x = t3_other.x AND t3.y = t3_other.y;
+SELECT * FROM t3;
+ x | y
+---+---
+(0 rows)
+
+-- Test join against inheritance tree
+create temp table t2a () inherits (t2);
+insert into t2a values (200, 2001);
+select * from t1 left join t2 on (t1.a = t2.a);
+ a | b | a | b
+-----+------+-----+------
+ 5 | 10 | |
+ 15 | 20 | |
+ 100 | 100 | |
+ 200 | 1000 | 200 | 2000
+ 200 | 1000 | 200 | 2001
+(5 rows)
+
+-- Test matching of column name with wrong alias
+select t1.x from t1 join t3 on (t1.a = t3.x);
+ERROR: column t1.x does not exist
+LINE 1: select t1.x from t1 join t3 on (t1.a = t3.x);
+ ^
+HINT: Perhaps you meant to reference the column "t3.x".
+-- Test matching of locking clause with wrong alias
+select t1.*, t2.*, unnamed_join.* from
+ t1 join t2 on (t1.a = t2.a), t3 as unnamed_join
+ for update of unnamed_join;
+ a | b | a | b | x | y
+---+---+---+---+---+---
+(0 rows)
+
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of unnamed_join;
+ a | x | y
+---+---+---
+(0 rows)
+
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of foo;
+ERROR: FOR UPDATE cannot be applied to a join
+LINE 3: for update of foo;
+ ^
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of foo;
+ERROR: relation "foo" in FOR UPDATE clause not found in FROM clause
+LINE 3: for update of foo;
+ ^
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of bar;
+ERROR: FOR UPDATE cannot be applied to a join
+LINE 3: for update of bar;
+ ^
+--
+-- regression test for 8.1 merge right join bug
+--
+CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
+INSERT INTO tt1 VALUES (1, 11);
+INSERT INTO tt1 VALUES (2, NULL);
+CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
+INSERT INTO tt2 VALUES (21, 11);
+INSERT INTO tt2 VALUES (22, 11);
+set enable_hashjoin to off;
+set enable_nestloop to off;
+-- these should give the same results
+select tt1.*, tt2.* from tt1 left join tt2 on tt1.joincol = tt2.joincol;
+ tt1_id | joincol | tt2_id | joincol
+--------+---------+--------+---------
+ 1 | 11 | 21 | 11
+ 1 | 11 | 22 | 11
+ 2 | | |
+(3 rows)
+
+select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol;
+ tt1_id | joincol | tt2_id | joincol
+--------+---------+--------+---------
+ 1 | 11 | 21 | 11
+ 1 | 11 | 22 | 11
+ 2 | | |
+(3 rows)
+
+reset enable_hashjoin;
+reset enable_nestloop;
+--
+-- regression test for bug #13908 (hash join with skew tuples & nbatch increase)
+--
+set work_mem to '64kB';
+set enable_mergejoin to off;
+set enable_memoize to off;
+explain (costs off)
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+ QUERY PLAN
+------------------------------------------------------------
+ Aggregate
+ -> Hash Join
+ Hash Cond: (a.hundred = b.thousand)
+ -> Index Only Scan using tenk1_hundred on tenk1 a
+ -> Hash
+ -> Seq Scan on tenk1 b
+ Filter: ((fivethous % 10) < 10)
+(7 rows)
+
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+ count
+--------
+ 100000
+(1 row)
+
+reset work_mem;
+reset enable_mergejoin;
+reset enable_memoize;
+--
+-- regression test for 8.2 bug with improper re-ordering of left joins
+--
+create temp table tt3(f1 int, f2 text);
+insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
+create index tt3i on tt3(f1);
+analyze tt3;
+create temp table tt4(f1 int);
+insert into tt4 values (0),(1),(9999);
+analyze tt4;
+SELECT a.f1
+FROM tt4 a
+LEFT JOIN (
+ SELECT b.f1
+ FROM tt3 b LEFT JOIN tt3 c ON (b.f1 = c.f1)
+ WHERE c.f1 IS NULL
+) AS d ON (a.f1 = d.f1)
+WHERE d.f1 IS NULL;
+ f1
+------
+ 0
+ 1
+ 9999
+(3 rows)
+
+--
+-- regression test for proper handling of outer joins within antijoins
+--
+create temp table tt4x(c1 int, c2 int, c3 int);
+explain (costs off)
+select * from tt4x t1
+where not exists (
+ select 1 from tt4x t2
+ left join tt4x t3 on t2.c3 = t3.c1
+ left join ( select t5.c1 as c1
+ from tt4x t4 left join tt4x t5 on t4.c2 = t5.c1
+ ) a1 on t3.c2 = a1.c1
+ where t1.c1 = t2.c2
+);
+ QUERY PLAN
+---------------------------------------------------------
+ Hash Anti Join
+ Hash Cond: (t1.c1 = t2.c2)
+ -> Seq Scan on tt4x t1
+ -> Hash
+ -> Merge Right Join
+ Merge Cond: (t5.c1 = t3.c2)
+ -> Merge Join
+ Merge Cond: (t4.c2 = t5.c1)
+ -> Sort
+ Sort Key: t4.c2
+ -> Seq Scan on tt4x t4
+ -> Sort
+ Sort Key: t5.c1
+ -> Seq Scan on tt4x t5
+ -> Sort
+ Sort Key: t3.c2
+ -> Merge Left Join
+ Merge Cond: (t2.c3 = t3.c1)
+ -> Sort
+ Sort Key: t2.c3
+ -> Seq Scan on tt4x t2
+ -> Sort
+ Sort Key: t3.c1
+ -> Seq Scan on tt4x t3
+(24 rows)
+
+--
+-- regression test for problems of the sort depicted in bug #3494
+--
+create temp table tt5(f1 int, f2 int);
+create temp table tt6(f1 int, f2 int);
+insert into tt5 values(1, 10);
+insert into tt5 values(1, 11);
+insert into tt6 values(1, 9);
+insert into tt6 values(1, 2);
+insert into tt6 values(2, 9);
+select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
+ f1 | f2 | f1 | f2
+----+----+----+----
+ 1 | 10 | 1 | 9
+(1 row)
+
+--
+-- regression test for problems of the sort depicted in bug #3588
+--
+create temp table xx (pkxx int);
+create temp table yy (pkyy int, pkxx int);
+insert into xx values (1);
+insert into xx values (2);
+insert into xx values (3);
+insert into yy values (101, 1);
+insert into yy values (201, 2);
+insert into yy values (301, NULL);
+select yy.pkyy as yy_pkyy, yy.pkxx as yy_pkxx, yya.pkyy as yya_pkyy,
+ xxa.pkxx as xxa_pkxx, xxb.pkxx as xxb_pkxx
+from yy
+ left join (SELECT * FROM yy where pkyy = 101) as yya ON yy.pkyy = yya.pkyy
+ left join xx xxa on yya.pkxx = xxa.pkxx
+ left join xx xxb on coalesce (xxa.pkxx, 1) = xxb.pkxx;
+ yy_pkyy | yy_pkxx | yya_pkyy | xxa_pkxx | xxb_pkxx
+---------+---------+----------+----------+----------
+ 101 | 1 | 101 | 1 | 1
+ 201 | 2 | | | 1
+ 301 | | | | 1
+(3 rows)
+
+--
+-- regression test for improper pushing of constants across outer-join clauses
+-- (as seen in early 8.2.x releases)
+--
+create temp table zt1 (f1 int primary key);
+create temp table zt2 (f2 int primary key);
+create temp table zt3 (f3 int primary key);
+insert into zt1 values(53);
+insert into zt2 values(53);
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zt1 on (f3 = f1)
+where f2 = 53;
+ f2 | f3 | f1
+----+----+----
+ 53 | |
+(1 row)
+
+create temp view zv1 as select *,'dummy'::text AS junk from zt1;
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zv1 on (f3 = f1)
+where f2 = 53;
+ f2 | f3 | f1 | junk
+----+----+----+------
+ 53 | | |
+(1 row)
+
+--
+-- regression test for improper extraction of OR indexqual conditions
+-- (as seen in early 8.3.x releases)
+--
+select a.unique2, a.ten, b.tenthous, b.unique2, b.hundred
+from tenk1 a left join tenk1 b on a.unique2 = b.tenthous
+where a.unique1 = 42 and
+ ((b.unique2 is null and a.ten = 2) or b.hundred = 3);
+ unique2 | ten | tenthous | unique2 | hundred
+---------+-----+----------+---------+---------
+(0 rows)
+
+--
+-- test proper positioning of one-time quals in EXISTS (8.4devel bug)
+--
+prepare foo(bool) as
+ select count(*) from tenk1 a left join tenk1 b
+ on (a.unique2 = b.unique1 and exists
+ (select 1 from tenk1 c where c.thousand = b.unique2 and $1));
+execute foo(true);
+ count
+-------
+ 10000
+(1 row)
+
+execute foo(false);
+ count
+-------
+ 10000
+(1 row)
+
+--
+-- test for sane behavior with noncanonical merge clauses, per bug #4926
+--
+begin;
+set enable_mergejoin = 1;
+set enable_hashjoin = 0;
+set enable_nestloop = 0;
+create temp table a (i integer);
+create temp table b (x integer, y integer);
+select * from a left join b on i = x and i = y and x = i;
+ i | x | y
+---+---+---
+(0 rows)
+
+rollback;
+--
+-- test handling of merge clauses using record_ops
+--
+begin;
+create type mycomptype as (id int, v bigint);
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+ QUERY PLAN
+----------------------------------------------------------
+ Merge Join
+ Merge Cond: (a.idv = b.idv)
+ -> Index Only Scan using tidv_idv_idx on tidv a
+ -> Materialize
+ -> Index Only Scan using tidv_idv_idx on tidv b
+(5 rows)
+
+set enable_mergejoin = 0;
+set enable_hashjoin = 0;
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+ QUERY PLAN
+----------------------------------------------------
+ Nested Loop
+ -> Seq Scan on tidv a
+ -> Index Only Scan using tidv_idv_idx on tidv b
+ Index Cond: (idv = a.idv)
+(4 rows)
+
+rollback;
+--
+-- test NULL behavior of whole-row Vars, per bug #5025
+--
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+ q2 | count
+-------------------+-------
+ -4567890123456789 | 0
+ 123 | 2
+ 456 | 0
+ 4567890123456789 | 6
+(4 rows)
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+ q2 | count
+-------------------+-------
+ -4567890123456789 | 0
+ 123 | 2
+ 456 | 0
+ 4567890123456789 | 6
+(4 rows)
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl offset 0) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+ q2 | count
+-------------------+-------
+ -4567890123456789 | 0
+ 123 | 2
+ 456 | 0
+ 4567890123456789 | 6
+(4 rows)
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join
+ (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2
+ on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+ q2 | count
+-------------------+-------
+ -4567890123456789 | 0
+ 123 | 2
+ 456 | 0
+ 4567890123456789 | 6
+(4 rows)
+
+--
+-- test incorrect failure to NULL pulled-up subexpressions
+--
+begin;
+create temp table a (
+ code char not null,
+ constraint a_pk primary key (code)
+);
+create temp table b (
+ a char not null,
+ num integer not null,
+ constraint b_pk primary key (a, num)
+);
+create temp table c (
+ name char not null,
+ a char,
+ constraint c_pk primary key (name)
+);
+insert into a (code) values ('p');
+insert into a (code) values ('q');
+insert into b (a, num) values ('p', 1);
+insert into b (a, num) values ('p', 2);
+insert into c (name, a) values ('A', 'p');
+insert into c (name, a) values ('B', 'q');
+insert into c (name, a) values ('C', null);
+select c.name, ss.code, ss.b_cnt, ss.const
+from c left join
+ (select a.code, coalesce(b_grp.cnt, 0) as b_cnt, -1 as const
+ from a left join
+ (select count(1) as cnt, b.a from b group by b.a) as b_grp
+ on a.code = b_grp.a
+ ) as ss
+ on (c.a = ss.code)
+order by c.name;
+ name | code | b_cnt | const
+------+------+-------+-------
+ A | p | 2 | -1
+ B | q | 0 | -1
+ C | | |
+(3 rows)
+
+rollback;
+--
+-- test incorrect handling of placeholders that only appear in targetlists,
+-- per bug #6154
+--
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+ key1 | key3 | value2 | value3
+------+------+--------+--------
+ 1 | 1 | 1 | 1
+(1 row)
+
+-- test the path using join aliases, too
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, value2, COALESCE(value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+ key1 | key3 | value2 | value3
+------+------+--------+--------
+ 1 | 1 | 1 | 1
+(1 row)
+
+--
+-- test case where a PlaceHolderVar is used as a nestloop parameter
+--
+EXPLAIN (COSTS OFF)
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------
+ Nested Loop
+ -> Hash Full Join
+ Hash Cond: ((COALESCE(a.q1, '0'::bigint)) = (COALESCE(b.q2, '-1'::bigint)))
+ -> Seq Scan on int8_tbl a
+ -> Hash
+ -> Seq Scan on int8_tbl b
+ -> Index Scan using tenk1_unique2 on tenk1 c
+ Index Cond: (unique2 = COALESCE((COALESCE(a.q1, '0'::bigint)), (COALESCE(b.q2, '-1'::bigint))))
+(8 rows)
+
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+ qq | unique1
+-----+---------
+ 123 | 4596
+ 123 | 4596
+ 456 | 7318
+(3 rows)
+
+--
+-- nested nestloops can require nested PlaceHolderVars
+--
+create temp table nt1 (
+ id int primary key,
+ a1 boolean,
+ a2 boolean
+);
+create temp table nt2 (
+ id int primary key,
+ nt1_id int,
+ b1 boolean,
+ b2 boolean,
+ foreign key (nt1_id) references nt1(id)
+);
+create temp table nt3 (
+ id int primary key,
+ nt2_id int,
+ c1 boolean,
+ foreign key (nt2_id) references nt2(id)
+);
+insert into nt1 values (1,true,true);
+insert into nt1 values (2,true,false);
+insert into nt1 values (3,false,false);
+insert into nt2 values (1,1,true,true);
+insert into nt2 values (2,2,true,false);
+insert into nt2 values (3,3,false,false);
+insert into nt3 values (1,1,true);
+insert into nt3 values (2,2,false);
+insert into nt3 values (3,3,true);
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+ QUERY PLAN
+-----------------------------------------------
+ Nested Loop
+ -> Nested Loop
+ -> Index Scan using nt3_pkey on nt3
+ Index Cond: (id = 1)
+ -> Index Scan using nt2_pkey on nt2
+ Index Cond: (id = nt3.nt2_id)
+ -> Index Only Scan using nt1_pkey on nt1
+ Index Cond: (id = nt2.nt1_id)
+ Filter: (nt2.b1 AND (id IS NOT NULL))
+(9 rows)
+
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+ id
+----
+ 1
+(1 row)
+
+--
+-- test case where a PlaceHolderVar is propagated into a subquery
+--
+explain (costs off)
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+ QUERY PLAN
+-----------------------------------------------------------
+ Sort
+ Sort Key: t1.q1, t1.q2
+ -> Hash Left Join
+ Hash Cond: (t1.q2 = t2.q1)
+ Filter: (1 = (SubPlan 1))
+ -> Seq Scan on int8_tbl t1
+ -> Hash
+ -> Seq Scan on int8_tbl t2
+ SubPlan 1
+ -> Limit
+ -> Result
+ One-Time Filter: ((42) IS NOT NULL)
+ -> Seq Scan on int8_tbl t3
+(13 rows)
+
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+ q1 | q2 | x | y
+------------------+------------------+------------------+----
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 123 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 123 | 123 | 42
+ 4567890123456789 | 123 | 123 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 42
+(8 rows)
+
+--
+-- variant where a PlaceHolderVar is needed at a join, but not above the join
+--
+explain (costs off)
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+ QUERY PLAN
+--------------------------------------------------
+ Nested Loop
+ -> Nested Loop
+ -> Seq Scan on int4_tbl i41
+ Filter: (f1 > 0)
+ -> Nested Loop
+ Join Filter: (i41.f1 = i42.f1)
+ -> Seq Scan on int8_tbl i81
+ -> Materialize
+ -> Seq Scan on int4_tbl i42
+ -> Materialize
+ -> Seq Scan on int4_tbl i43
+ Filter: (f1 > 1)
+(12 rows)
+
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+ f1 | x
+------------+---
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 123456 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+ 2147483647 | 1
+(20 rows)
+
+--
+-- test the corner cases FULL JOIN ON TRUE and FULL JOIN ON FALSE
+--
+select * from int4_tbl a full join int4_tbl b on true;
+ f1 | f1
+-------------+-------------
+ 0 | 0
+ 0 | 123456
+ 0 | -123456
+ 0 | 2147483647
+ 0 | -2147483647
+ 123456 | 0
+ 123456 | 123456
+ 123456 | -123456
+ 123456 | 2147483647
+ 123456 | -2147483647
+ -123456 | 0
+ -123456 | 123456
+ -123456 | -123456
+ -123456 | 2147483647
+ -123456 | -2147483647
+ 2147483647 | 0
+ 2147483647 | 123456
+ 2147483647 | -123456
+ 2147483647 | 2147483647
+ 2147483647 | -2147483647
+ -2147483647 | 0
+ -2147483647 | 123456
+ -2147483647 | -123456
+ -2147483647 | 2147483647
+ -2147483647 | -2147483647
+(25 rows)
+
+select * from int4_tbl a full join int4_tbl b on false;
+ f1 | f1
+-------------+-------------
+ | 0
+ | 123456
+ | -123456
+ | 2147483647
+ | -2147483647
+ 0 |
+ 123456 |
+ -123456 |
+ 2147483647 |
+ -2147483647 |
+(10 rows)
+
+--
+-- test for ability to use a cartesian join when necessary
+--
+create temp table q1 as select 1 as q1;
+create temp table q2 as select 0 as q2;
+analyze q1;
+analyze q2;
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where q1 = thousand or q2 = thousand;
+ QUERY PLAN
+------------------------------------------------------------------------
+ Hash Join
+ Hash Cond: (tenk1.twothousand = int4_tbl.f1)
+ -> Nested Loop
+ -> Nested Loop
+ -> Seq Scan on q1
+ -> Seq Scan on q2
+ -> Bitmap Heap Scan on tenk1
+ Recheck Cond: ((q1.q1 = thousand) OR (q2.q2 = thousand))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = q1.q1)
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = q2.q2)
+ -> Hash
+ -> Seq Scan on int4_tbl
+(15 rows)
+
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where thousand = (q1 + q2);
+ QUERY PLAN
+--------------------------------------------------------------
+ Hash Join
+ Hash Cond: (tenk1.twothousand = int4_tbl.f1)
+ -> Nested Loop
+ -> Nested Loop
+ -> Seq Scan on q1
+ -> Seq Scan on q2
+ -> Bitmap Heap Scan on tenk1
+ Recheck Cond: (thousand = (q1.q1 + q2.q2))
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = (q1.q1 + q2.q2))
+ -> Hash
+ -> Seq Scan on int4_tbl
+(12 rows)
+
+--
+-- test ability to generate a suitable plan for a star-schema query
+--
+explain (costs off)
+select * from
+ tenk1, int8_tbl a, int8_tbl b
+where thousand = a.q1 and tenthous = b.q1 and a.q2 = 1 and b.q2 = 2;
+ QUERY PLAN
+---------------------------------------------------------------------
+ Nested Loop
+ -> Seq Scan on int8_tbl b
+ Filter: (q2 = 2)
+ -> Nested Loop
+ -> Seq Scan on int8_tbl a
+ Filter: (q2 = 1)
+ -> Index Scan using tenk1_thous_tenthous on tenk1
+ Index Cond: ((thousand = a.q1) AND (tenthous = b.q1))
+(8 rows)
+
+--
+-- test a corner case in which we shouldn't apply the star-schema optimization
+--
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+ QUERY PLAN
+-----------------------------------------------------------------------
+ Nested Loop
+ -> Nested Loop
+ Join Filter: (t1.stringu1 > t2.stringu2)
+ -> Nested Loop
+ -> Nested Loop
+ -> Seq Scan on onerow
+ -> Seq Scan on onerow onerow_1
+ -> Index Scan using tenk1_unique2 on tenk1 t1
+ Index Cond: ((unique2 = (11)) AND (unique2 < 42))
+ -> Index Scan using tenk1_unique1 on tenk1 t2
+ Index Cond: (unique1 = (3))
+ -> Seq Scan on int4_tbl i1
+ Filter: (f1 = 0)
+(13 rows)
+
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+ unique2 | stringu1 | unique1 | stringu2
+---------+----------+---------+----------
+ 11 | WFAAAA | 3 | LKIAAA
+(1 row)
+
+-- variant that isn't quite a star-schema case
+select ss1.d1 from
+ tenk1 as t1
+ inner join tenk1 as t2
+ on t1.tenthous = t2.ten
+ inner join
+ int8_tbl as i8
+ left join int4_tbl as i4
+ inner join (select 64::information_schema.cardinal_number as d1
+ from tenk1 t3,
+ lateral (select abs(t3.unique1) + random()) ss0(x)
+ where t3.fivethous < 0) as ss1
+ on i4.f1 = ss1.d1
+ on i8.q1 = i4.f1
+ on t1.tenthous = ss1.d1
+where t1.unique1 < i4.f1;
+ d1
+----
+(0 rows)
+
+-- this variant is foldable by the remove-useless-RESULT-RTEs code
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+ QUERY PLAN
+-----------------------------------------------------------------
+ Nested Loop
+ Join Filter: (t1.stringu1 > t2.stringu2)
+ -> Nested Loop
+ -> Seq Scan on int4_tbl i1
+ Filter: (f1 = 0)
+ -> Index Scan using tenk1_unique2 on tenk1 t1
+ Index Cond: ((unique2 = (11)) AND (unique2 < 42))
+ -> Index Scan using tenk1_unique1 on tenk1 t2
+ Index Cond: (unique1 = (3))
+(9 rows)
+
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+ unique2 | stringu1 | unique1 | stringu2
+---------+----------+---------+----------
+ 11 | WFAAAA | 3 | LKIAAA
+(1 row)
+
+-- Here's a variant that we can't fold too aggressively, though,
+-- or we end up with noplace to evaluate the lateral PHV
+explain (verbose, costs off)
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+ QUERY PLAN
+---------------------------
+ Nested Loop
+ Output: 1, (2), ((2))
+ -> Result
+ Output: 2
+ -> Limit
+ Output: ((2))
+ -> Result
+ Output: (2)
+(8 rows)
+
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+ x | y | z
+---+---+---
+ 1 | 2 | 2
+(1 row)
+
+-- Test proper handling of appendrel PHVs during useless-RTE removal
+explain (costs off)
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+ QUERY PLAN
+---------------------------------------
+ Nested Loop
+ -> Result
+ -> Append
+ -> Result
+ -> Result
+ One-Time Filter: (true)
+(6 rows)
+
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+ z | a | b
+---+---+---
+ 0 | t | t
+ 0 | t | t
+(2 rows)
+
+--
+-- test inlining of immutable functions
+--
+create function f_immutable_int4(i integer) returns integer as
+$$ begin return i; end; $$ language plpgsql immutable;
+-- check optimization of function scan with join
+explain (costs off)
+select unique1 from tenk1, (select * from f_immutable_int4(1) x) x
+where x = unique1;
+ QUERY PLAN
+----------------------------------------------
+ Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = 1)
+(2 rows)
+
+explain (verbose, costs off)
+select unique1, x.*
+from tenk1, (select *, random() from f_immutable_int4(1) x) x
+where x = unique1;
+ QUERY PLAN
+-----------------------------------------------------------
+ Nested Loop
+ Output: tenk1.unique1, (1), (random())
+ -> Result
+ Output: 1, random()
+ -> Index Only Scan using tenk1_unique1 on public.tenk1
+ Output: tenk1.unique1
+ Index Cond: (tenk1.unique1 = (1))
+(7 rows)
+
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = unique1;
+ QUERY PLAN
+----------------------------------------------
+ Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = 1)
+(2 rows)
+
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x = unique1;
+ QUERY PLAN
+----------------------------------------------
+ Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = 1)
+(2 rows)
+
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x in (select 17);
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+explain (costs off)
+select unique1, x from tenk1 join f_immutable_int4(1) x on unique1 = x;
+ QUERY PLAN
+----------------------------------------------
+ Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = 1)
+(2 rows)
+
+explain (costs off)
+select unique1, x from tenk1 left join f_immutable_int4(1) x on unique1 = x;
+ QUERY PLAN
+----------------------------------------------------
+ Nested Loop Left Join
+ Join Filter: (tenk1.unique1 = 1)
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Materialize
+ -> Result
+(5 rows)
+
+explain (costs off)
+select unique1, x from tenk1 right join f_immutable_int4(1) x on unique1 = x;
+ QUERY PLAN
+----------------------------------------------------
+ Nested Loop Left Join
+ -> Result
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = 1)
+(4 rows)
+
+explain (costs off)
+select unique1, x from tenk1 full join f_immutable_int4(1) x on unique1 = x;
+ QUERY PLAN
+----------------------------------------------------
+ Merge Full Join
+ Merge Cond: (tenk1.unique1 = (1))
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Sort
+ Sort Key: (1)
+ -> Result
+(6 rows)
+
+-- check that pullup of a const function allows further const-folding
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = 42;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+-- test inlining of immutable functions with PlaceHolderVars
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 or i4 = 42) AS b3
+ from nt2 as nt2
+ left join
+ f_immutable_int4(0) i4
+ on i4 = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+ QUERY PLAN
+----------------------------------------------
+ Nested Loop Left Join
+ Filter: ((nt2.b1 OR ((0) = 42)))
+ -> Index Scan using nt3_pkey on nt3
+ Index Cond: (id = 1)
+ -> Nested Loop Left Join
+ Join Filter: (0 = nt2.nt1_id)
+ -> Index Scan using nt2_pkey on nt2
+ Index Cond: (id = nt3.nt2_id)
+ -> Result
+(9 rows)
+
+drop function f_immutable_int4(int);
+-- test inlining when function returns composite
+create function mki8(bigint, bigint) returns int8_tbl as
+$$select row($1,$2)::int8_tbl$$ language sql;
+create function mki4(int) returns int4_tbl as
+$$select row($1)::int4_tbl$$ language sql;
+explain (verbose, costs off)
+select * from mki8(1,2);
+ QUERY PLAN
+------------------------------------
+ Function Scan on mki8
+ Output: q1, q2
+ Function Call: '(1,2)'::int8_tbl
+(3 rows)
+
+select * from mki8(1,2);
+ q1 | q2
+----+----
+ 1 | 2
+(1 row)
+
+explain (verbose, costs off)
+select * from mki4(42);
+ QUERY PLAN
+-----------------------------------
+ Function Scan on mki4
+ Output: f1
+ Function Call: '(42)'::int4_tbl
+(3 rows)
+
+select * from mki4(42);
+ f1
+----
+ 42
+(1 row)
+
+drop function mki8(bigint, bigint);
+drop function mki4(int);
+--
+-- test extraction of restriction OR clauses from join OR clause
+-- (we used to only do this for indexable clauses)
+--
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.hundred = 4);
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------
+ Nested Loop
+ Join Filter: (((a.unique1 = 1) AND (b.unique1 = 2)) OR ((a.unique2 = 3) AND (b.hundred = 4)))
+ -> Bitmap Heap Scan on tenk1 b
+ Recheck Cond: ((unique1 = 2) OR (hundred = 4))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_unique1
+ Index Cond: (unique1 = 2)
+ -> Bitmap Index Scan on tenk1_hundred
+ Index Cond: (hundred = 4)
+ -> Materialize
+ -> Bitmap Heap Scan on tenk1 a
+ Recheck Cond: ((unique1 = 1) OR (unique2 = 3))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_unique1
+ Index Cond: (unique1 = 1)
+ -> Bitmap Index Scan on tenk1_unique2
+ Index Cond: (unique2 = 3)
+(17 rows)
+
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.ten = 4);
+ QUERY PLAN
+---------------------------------------------------------------------------------------------
+ Nested Loop
+ Join Filter: (((a.unique1 = 1) AND (b.unique1 = 2)) OR ((a.unique2 = 3) AND (b.ten = 4)))
+ -> Seq Scan on tenk1 b
+ Filter: ((unique1 = 2) OR (ten = 4))
+ -> Materialize
+ -> Bitmap Heap Scan on tenk1 a
+ Recheck Cond: ((unique1 = 1) OR (unique2 = 3))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_unique1
+ Index Cond: (unique1 = 1)
+ -> Bitmap Index Scan on tenk1_unique2
+ Index Cond: (unique2 = 3)
+(12 rows)
+
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or
+ ((a.unique2 = 3 or a.unique2 = 7) and b.hundred = 4);
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Join Filter: (((a.unique1 = 1) AND (b.unique1 = 2)) OR (((a.unique2 = 3) OR (a.unique2 = 7)) AND (b.hundred = 4)))
+ -> Bitmap Heap Scan on tenk1 b
+ Recheck Cond: ((unique1 = 2) OR (hundred = 4))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_unique1
+ Index Cond: (unique1 = 2)
+ -> Bitmap Index Scan on tenk1_hundred
+ Index Cond: (hundred = 4)
+ -> Materialize
+ -> Bitmap Heap Scan on tenk1 a
+ Recheck Cond: ((unique1 = 1) OR (unique2 = 3) OR (unique2 = 7))
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_unique1
+ Index Cond: (unique1 = 1)
+ -> Bitmap Index Scan on tenk1_unique2
+ Index Cond: (unique2 = 3)
+ -> Bitmap Index Scan on tenk1_unique2
+ Index Cond: (unique2 = 7)
+(19 rows)
+
+--
+-- test placement of movable quals in a parameterized join tree
+--
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten = t3.ten
+where t1.unique1 = 1;
+ QUERY PLAN
+--------------------------------------------------------
+ Nested Loop Left Join
+ -> Index Scan using tenk1_unique1 on tenk1 t1
+ Index Cond: (unique1 = 1)
+ -> Nested Loop
+ Join Filter: (t1.ten = t3.ten)
+ -> Bitmap Heap Scan on tenk1 t2
+ Recheck Cond: (t1.hundred = hundred)
+ -> Bitmap Index Scan on tenk1_hundred
+ Index Cond: (hundred = t1.hundred)
+ -> Index Scan using tenk1_unique2 on tenk1 t3
+ Index Cond: (unique2 = t2.thousand)
+(11 rows)
+
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten + t2.ten = t3.ten
+where t1.unique1 = 1;
+ QUERY PLAN
+--------------------------------------------------------
+ Nested Loop Left Join
+ -> Index Scan using tenk1_unique1 on tenk1 t1
+ Index Cond: (unique1 = 1)
+ -> Nested Loop
+ Join Filter: ((t1.ten + t2.ten) = t3.ten)
+ -> Bitmap Heap Scan on tenk1 t2
+ Recheck Cond: (t1.hundred = hundred)
+ -> Bitmap Index Scan on tenk1_hundred
+ Index Cond: (hundred = t1.hundred)
+ -> Index Scan using tenk1_unique2 on tenk1 t3
+ Index Cond: (unique2 = t2.thousand)
+(11 rows)
+
+explain (costs off)
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Aggregate
+ -> Nested Loop Left Join
+ Join Filter: (a.unique2 = b.unique1)
+ -> Nested Loop
+ -> Nested Loop
+ -> Seq Scan on int4_tbl
+ -> Bitmap Heap Scan on tenk1 b
+ Recheck Cond: (thousand = int4_tbl.f1)
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = int4_tbl.f1)
+ -> Index Scan using tenk1_unique1 on tenk1 a
+ Index Cond: (unique1 = b.unique2)
+ -> Index Only Scan using tenk1_thous_tenthous on tenk1 c
+ Index Cond: (thousand = a.thousand)
+(14 rows)
+
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+ count
+-------
+ 10
+(1 row)
+
+explain (costs off)
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------
+ Sort
+ Sort Key: b.unique1
+ -> Nested Loop Left Join
+ -> Seq Scan on int4_tbl i2
+ -> Nested Loop Left Join
+ Join Filter: (b.unique1 = 42)
+ -> Nested Loop
+ -> Nested Loop
+ -> Seq Scan on int4_tbl i1
+ -> Index Scan using tenk1_thous_tenthous on tenk1 b
+ Index Cond: ((thousand = i1.f1) AND (tenthous = i2.f1))
+ -> Index Scan using tenk1_unique1 on tenk1 a
+ Index Cond: (unique1 = b.unique2)
+ -> Index Only Scan using tenk1_thous_tenthous on tenk1 c
+ Index Cond: (thousand = a.thousand)
+(15 rows)
+
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+ unique1
+---------
+ 0
+
+
+
+
+(5 rows)
+
+explain (costs off)
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Nested Loop Left Join
+ Filter: ((COALESCE(tenk1.unique1, '-1'::integer) + int8_tbl.q1) = 122)
+ -> Seq Scan on int8_tbl
+ -> Index Scan using tenk1_unique2 on tenk1
+ Index Cond: (unique2 = int8_tbl.q2)
+(5 rows)
+
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+ unique1 | q1 | fault
+---------+-----+-------
+ | 123 | 122
+(1 row)
+
+explain (costs off)
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+ QUERY PLAN
+-------------------------------------------------------------
+ Nested Loop Left Join
+ -> Values Scan on "*VALUES*"
+ -> Hash Right Join
+ Hash Cond: (u1.u1y = "*VALUES*_1".column2)
+ Filter: ("*VALUES*_1".column1 = "*VALUES*".column1)
+ -> Function Scan on unnest u1
+ -> Hash
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+ v1x | v1ys | v2x | v2y | u1y
+-----+---------+-----+-----+-----
+ 1 | {10,20} | 1 | 10 | 10
+ 2 | {20,30} | 2 | 20 | 20
+(2 rows)
+
+--
+-- test handling of potential equivalence clauses above outer joins
+--
+explain (costs off)
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+ QUERY PLAN
+--------------------------------------------------------------------------------------
+ Nested Loop Left Join
+ Filter: ((COALESCE(b.thousand, 123) = a.q1) AND (a.q1 = COALESCE(b.hundred, 123)))
+ -> Seq Scan on int8_tbl a
+ -> Index Scan using tenk1_unique2 on tenk1 b
+ Index Cond: (unique2 = a.q1)
+(5 rows)
+
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+ q1 | unique2 | thousand | hundred
+----+---------+----------+---------
+(0 rows)
+
+explain (costs off)
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+ QUERY PLAN
+--------------------------------------------------------------------
+ Nested Loop Left Join
+ Filter: (CASE WHEN (b.unique2 IS NULL) THEN a.f1 ELSE 0 END = 0)
+ -> Seq Scan on int4_tbl a
+ -> Index Only Scan using tenk1_unique2 on tenk1 b
+ Index Cond: (unique2 = a.f1)
+(5 rows)
+
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+ f1 | unique2 | case
+----+---------+------
+ 0 | 0 | 0
+(1 row)
+
+--
+-- another case with equivalence clauses above outer joins (bug #8591)
+--
+explain (costs off)
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------
+ Nested Loop Left Join
+ -> Nested Loop Left Join
+ Filter: (COALESCE(b.twothousand, a.twothousand) = 44)
+ -> Index Scan using tenk1_unique2 on tenk1 a
+ Index Cond: (unique2 < 10)
+ -> Bitmap Heap Scan on tenk1 b
+ Recheck Cond: (thousand = a.unique1)
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = a.unique1)
+ -> Index Scan using tenk1_unique2 on tenk1 c
+ Index Cond: ((unique2 = COALESCE(b.twothousand, a.twothousand)) AND (unique2 = 44))
+(11 rows)
+
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+ unique1 | unique1 | unique1 | coalesce
+---------+---------+---------+----------
+(0 rows)
+
+--
+-- check handling of join aliases when flattening multiple levels of subquery
+--
+explain (verbose, costs off)
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Nested Loop Left Join
+ Output: "*VALUES*".column1, i1.f1, (666)
+ Join Filter: ("*VALUES*".column1 = i1.f1)
+ -> Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1
+ -> Materialize
+ Output: i1.f1, (666)
+ -> Nested Loop Left Join
+ Output: i1.f1, 666
+ -> Seq Scan on public.int4_tbl i1
+ Output: i1.f1
+ -> Index Only Scan using tenk1_unique2 on public.tenk1 i2
+ Output: i2.unique2
+ Index Cond: (i2.unique2 = i1.f1)
+(14 rows)
+
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+ foo1_id | foo3_id | bug_field
+---------+---------+-----------
+ 0 | 0 | 666
+ 1 | |
+(2 rows)
+
+--
+-- test successful handling of nested outer joins with degenerate join quals
+--
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ QUERY PLAN
+----------------------------------------------------------------------
+ Hash Left Join
+ Output: t1.f1
+ Hash Cond: (i8.q2 = i4.f1)
+ -> Nested Loop Left Join
+ Output: t1.f1, i8.q2
+ Join Filter: (t1.f1 = '***'::text)
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ -> Materialize
+ Output: i8.q2
+ -> Hash Right Join
+ Output: i8.q2
+ Hash Cond: ((NULL::integer) = i8b1.q2)
+ -> Hash Join
+ Output: i8.q2, (NULL::integer)
+ Hash Cond: (i8.q1 = i8b2.q1)
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ -> Hash
+ Output: i8b2.q1, (NULL::integer)
+ -> Seq Scan on public.int8_tbl i8b2
+ Output: i8b2.q1, NULL::integer
+ -> Hash
+ Output: i8b1.q2
+ -> Seq Scan on public.int8_tbl i8b1
+ Output: i8b1.q2
+ -> Hash
+ Output: i4.f1
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+(30 rows)
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Hash Left Join
+ Output: t1.f1
+ Hash Cond: (i8.q2 = i4.f1)
+ -> Nested Loop Left Join
+ Output: t1.f1, i8.q2
+ Join Filter: (t1.f1 = '***'::text)
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ -> Materialize
+ Output: i8.q2
+ -> Hash Right Join
+ Output: i8.q2
+ Hash Cond: ((NULL::integer) = i8b1.q2)
+ -> Hash Right Join
+ Output: i8.q2, (NULL::integer)
+ Hash Cond: (i8b2.q1 = i8.q1)
+ -> Nested Loop
+ Output: i8b2.q1, NULL::integer
+ -> Seq Scan on public.int8_tbl i8b2
+ Output: i8b2.q1, i8b2.q2
+ -> Materialize
+ -> Seq Scan on public.int4_tbl i4b2
+ -> Hash
+ Output: i8.q1, i8.q2
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ -> Hash
+ Output: i8b1.q2
+ -> Seq Scan on public.int8_tbl i8b1
+ Output: i8b1.q2
+ -> Hash
+ Output: i4.f1
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+(34 rows)
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Hash Left Join
+ Output: t1.f1
+ Hash Cond: (i8.q2 = i4.f1)
+ -> Nested Loop Left Join
+ Output: t1.f1, i8.q2
+ Join Filter: (t1.f1 = '***'::text)
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ -> Materialize
+ Output: i8.q2
+ -> Hash Right Join
+ Output: i8.q2
+ Hash Cond: ((NULL::integer) = i8b1.q2)
+ -> Hash Right Join
+ Output: i8.q2, (NULL::integer)
+ Hash Cond: (i8b2.q1 = i8.q1)
+ -> Hash Join
+ Output: i8b2.q1, NULL::integer
+ Hash Cond: (i8b2.q1 = i4b2.f1)
+ -> Seq Scan on public.int8_tbl i8b2
+ Output: i8b2.q1, i8b2.q2
+ -> Hash
+ Output: i4b2.f1
+ -> Seq Scan on public.int4_tbl i4b2
+ Output: i4b2.f1
+ -> Hash
+ Output: i8.q1, i8.q2
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ -> Hash
+ Output: i8b1.q2
+ -> Seq Scan on public.int8_tbl i8b1
+ Output: i8b1.q2
+ -> Hash
+ Output: i4.f1
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+(37 rows)
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+ QUERY PLAN
+--------------------------------------------------------
+ Nested Loop Left Join
+ Output: t1.f1, i8.q1, i8.q2, t2.f1, i4.f1
+ -> Seq Scan on public.text_tbl t2
+ Output: t2.f1
+ -> Materialize
+ Output: i8.q1, i8.q2, i4.f1, t1.f1
+ -> Nested Loop
+ Output: i8.q1, i8.q2, i4.f1, t1.f1
+ -> Nested Loop Left Join
+ Output: i8.q1, i8.q2, i4.f1
+ Join Filter: (i8.q1 = i4.f1)
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ Filter: (i8.q2 = 456)
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ Filter: (t1.f1 = 'doh!'::text)
+(19 rows)
+
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+ f1 | q1 | q2 | f1 | f1
+------+-----+-----+-------------------+----
+ doh! | 123 | 456 | doh! |
+ doh! | 123 | 456 | hi de ho neighbor |
+(2 rows)
+
+--
+-- test for appropriate join order in the presence of lateral references
+--
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+ QUERY PLAN
+--------------------------------------------------
+ Nested Loop
+ Output: t1.f1, i8.q1, i8.q2, (i8.q1), t2.f1
+ Join Filter: (t1.f1 = t2.f1)
+ -> Nested Loop Left Join
+ Output: t1.f1, i8.q1, i8.q2
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ -> Materialize
+ Output: i8.q1, i8.q2
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ Filter: (i8.q2 = 123)
+ -> Memoize
+ Output: (i8.q1), t2.f1
+ Cache Key: i8.q1
+ Cache Mode: binary
+ -> Limit
+ Output: (i8.q1), t2.f1
+ -> Seq Scan on public.text_tbl t2
+ Output: i8.q1, t2.f1
+(20 rows)
+
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+ f1 | q1 | q2 | q1 | f1
+------+------------------+-----+------------------+------
+ doh! | 4567890123456789 | 123 | 4567890123456789 | doh!
+(1 row)
+
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+ QUERY PLAN
+-------------------------------------------------------------------
+ Nested Loop
+ Output: t1.f1, i8.q1, i8.q2, (i8.q1), t2.f1, ((i8.q1)), (t2.f1)
+ Join Filter: (t1.f1 = (t2.f1))
+ -> Nested Loop
+ Output: t1.f1, i8.q1, i8.q2, (i8.q1), t2.f1
+ -> Nested Loop Left Join
+ Output: t1.f1, i8.q1, i8.q2
+ -> Seq Scan on public.text_tbl t1
+ Output: t1.f1
+ -> Materialize
+ Output: i8.q1, i8.q2
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ Filter: (i8.q2 = 123)
+ -> Memoize
+ Output: (i8.q1), t2.f1
+ Cache Key: i8.q1
+ Cache Mode: binary
+ -> Limit
+ Output: (i8.q1), t2.f1
+ -> Seq Scan on public.text_tbl t2
+ Output: i8.q1, t2.f1
+ -> Memoize
+ Output: ((i8.q1)), (t2.f1)
+ Cache Key: (i8.q1), t2.f1
+ Cache Mode: binary
+ -> Limit
+ Output: ((i8.q1)), (t2.f1)
+ -> Seq Scan on public.text_tbl t3
+ Output: (i8.q1), t2.f1
+(30 rows)
+
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+ f1 | q1 | q2 | q1 | f1 | q1 | f1
+------+------------------+-----+------------------+------+------------------+------
+ doh! | 4567890123456789 | 123 | 4567890123456789 | doh! | 4567890123456789 | doh!
+(1 row)
+
+explain (verbose, costs off)
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+ QUERY PLAN
+----------------------------------------------------------
+ Nested Loop
+ Output: 1
+ -> Nested Loop Left Join
+ Output: tt1.f1, tt4.f1
+ -> Nested Loop
+ Output: tt1.f1
+ -> Seq Scan on public.text_tbl tt1
+ Output: tt1.f1
+ Filter: (tt1.f1 = 'foo'::text)
+ -> Seq Scan on public.text_tbl tt2
+ Output: tt2.f1
+ -> Materialize
+ Output: tt4.f1
+ -> Nested Loop Left Join
+ Output: tt4.f1
+ Join Filter: (tt3.f1 = tt4.f1)
+ -> Seq Scan on public.text_tbl tt3
+ Output: tt3.f1
+ Filter: (tt3.f1 = 'foo'::text)
+ -> Seq Scan on public.text_tbl tt4
+ Output: tt4.f1
+ Filter: (tt4.f1 = 'foo'::text)
+ -> Memoize
+ Output: ss1.c0
+ Cache Key: tt4.f1
+ Cache Mode: binary
+ -> Subquery Scan on ss1
+ Output: ss1.c0
+ Filter: (ss1.c0 = 'foo'::text)
+ -> Limit
+ Output: (tt4.f1)
+ -> Seq Scan on public.text_tbl tt5
+ Output: tt4.f1
+(33 rows)
+
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+ ?column?
+----------
+(0 rows)
+
+--
+-- check a case in which a PlaceHolderVar forces join order
+--
+explain (verbose, costs off)
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+ QUERY PLAN
+------------------------------------------------------------------------
+ Nested Loop
+ Output: (i41.f1), (i8.q1), (i8.q2), (i42.f1), (i43.f1), ((42))
+ -> Hash Join
+ Output: i41.f1, i42.f1, i8.q1, i8.q2, i43.f1, 42
+ Hash Cond: (i41.f1 = i42.f1)
+ -> Nested Loop
+ Output: i8.q1, i8.q2, i43.f1, i41.f1
+ -> Nested Loop
+ Output: i8.q1, i8.q2, i43.f1
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ Filter: (i8.q1 = 0)
+ -> Seq Scan on public.int4_tbl i43
+ Output: i43.f1
+ Filter: (i43.f1 = 0)
+ -> Seq Scan on public.int4_tbl i41
+ Output: i41.f1
+ -> Hash
+ Output: i42.f1
+ -> Seq Scan on public.int4_tbl i42
+ Output: i42.f1
+ -> Limit
+ Output: (i41.f1), (i8.q1), (i8.q2), (i42.f1), (i43.f1), ((42))
+ -> Seq Scan on public.text_tbl
+ Output: i41.f1, i8.q1, i8.q2, i42.f1, i43.f1, (42)
+(25 rows)
+
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+ f1 | q1 | q2 | c1 | c2 | c3
+----+----+----+----+----+----
+(0 rows)
+
+--
+-- test successful handling of full join underneath left join (bug #14105)
+--
+explain (costs off)
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+ QUERY PLAN
+---------------------------------------
+ Nested Loop Left Join
+ -> Result
+ -> Hash Full Join
+ Hash Cond: (a1.unique1 = (1))
+ Filter: (1 = COALESCE((1)))
+ -> Seq Scan on tenk1 a1
+ -> Hash
+ -> Result
+(8 rows)
+
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+ id | unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | id
+----+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+----
+ 1 | 1 | 2838 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | EFEAAA | OOOOxx | 1
+(1 row)
+
+--
+-- test ability to push constants through outer join clauses
+--
+explain (costs off)
+ select * from int4_tbl a left join tenk1 b on f1 = unique2 where f1 = 0;
+ QUERY PLAN
+-------------------------------------------------
+ Nested Loop Left Join
+ Join Filter: (a.f1 = b.unique2)
+ -> Seq Scan on int4_tbl a
+ Filter: (f1 = 0)
+ -> Index Scan using tenk1_unique2 on tenk1 b
+ Index Cond: (unique2 = 0)
+(6 rows)
+
+explain (costs off)
+ select * from tenk1 a full join tenk1 b using(unique2) where unique2 = 42;
+ QUERY PLAN
+-------------------------------------------------
+ Merge Full Join
+ Merge Cond: (a.unique2 = b.unique2)
+ -> Index Scan using tenk1_unique2 on tenk1 a
+ Index Cond: (unique2 = 42)
+ -> Index Scan using tenk1_unique2 on tenk1 b
+ Index Cond: (unique2 = 42)
+(6 rows)
+
+--
+-- test that quals attached to an outer join have correct semantics,
+-- specifically that they don't re-use expressions computed below the join;
+-- we force a mergejoin so that coalesce(b.q1, 1) appears as a join input
+--
+set enable_hashjoin to off;
+set enable_nestloop to off;
+explain (verbose, costs off)
+ select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+ QUERY PLAN
+---------------------------------------------------------
+ Merge Left Join
+ Output: a.q2, b.q1
+ Merge Cond: (a.q2 = (COALESCE(b.q1, '1'::bigint)))
+ Filter: (COALESCE(b.q1, '1'::bigint) > 0)
+ -> Sort
+ Output: a.q2
+ Sort Key: a.q2
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q2
+ -> Sort
+ Output: b.q1, (COALESCE(b.q1, '1'::bigint))
+ Sort Key: (COALESCE(b.q1, '1'::bigint))
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, COALESCE(b.q1, '1'::bigint)
+(14 rows)
+
+select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+ q2 | q1
+-------------------+------------------
+ -4567890123456789 |
+ 123 | 123
+ 123 | 123
+ 456 |
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(10 rows)
+
+reset enable_hashjoin;
+reset enable_nestloop;
+--
+-- test join removal
+--
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY, b_id int);
+CREATE TEMP TABLE b (id int PRIMARY KEY, c_id int);
+CREATE TEMP TABLE c (id int PRIMARY KEY);
+CREATE TEMP TABLE d (a int, b int);
+INSERT INTO a VALUES (0, 0), (1, NULL);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+INSERT INTO c VALUES (0), (1);
+INSERT INTO d VALUES (1,3), (2,2), (3,1);
+-- all three cases should be optimizable into a simple seqscan
+explain (costs off) SELECT a.* FROM a LEFT JOIN b ON a.b_id = b.id;
+ QUERY PLAN
+---------------
+ Seq Scan on a
+(1 row)
+
+explain (costs off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
+ QUERY PLAN
+---------------
+ Seq Scan on b
+(1 row)
+
+explain (costs off)
+ SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
+ ON (a.b_id = b.id);
+ QUERY PLAN
+---------------
+ Seq Scan on a
+(1 row)
+
+-- check optimization of outer join within another special join
+explain (costs off)
+select id from a where id in (
+ select b.id from b left join c on b.id = c.id
+);
+ QUERY PLAN
+----------------------------
+ Hash Join
+ Hash Cond: (a.id = b.id)
+ -> Seq Scan on a
+ -> Hash
+ -> Seq Scan on b
+(5 rows)
+
+-- check that join removal works for a left join when joining a subquery
+-- that is guaranteed to be unique by its GROUP BY clause
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id and d.b = s.c_id;
+ QUERY PLAN
+---------------
+ Seq Scan on d
+(1 row)
+
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id and d.b = s.c_id;
+ QUERY PLAN
+---------------
+ Seq Scan on d
+(1 row)
+
+-- join removal is not possible when the GROUP BY contains a column that is
+-- not in the join condition. (Note: as of 9.6, we notice that b.id is a
+-- primary key and so drop b.c_id from the GROUP BY of the resulting plan;
+-- but this happens too late for join removal in the outer plan level.)
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id;
+ QUERY PLAN
+------------------------------------------
+ Merge Right Join
+ Merge Cond: (b.id = d.a)
+ -> Group
+ Group Key: b.id
+ -> Index Scan using b_pkey on b
+ -> Sort
+ Sort Key: d.a
+ -> Seq Scan on d
+(8 rows)
+
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id;
+ QUERY PLAN
+--------------------------------------
+ Merge Right Join
+ Merge Cond: (b.id = d.a)
+ -> Unique
+ -> Sort
+ Sort Key: b.id, b.c_id
+ -> Seq Scan on b
+ -> Sort
+ Sort Key: d.a
+ -> Seq Scan on d
+(9 rows)
+
+-- check join removal works when uniqueness of the join condition is enforced
+-- by a UNION
+explain (costs off)
+select d.* from d left join (select id from a union select id from b) s
+ on d.a = s.id;
+ QUERY PLAN
+---------------
+ Seq Scan on d
+(1 row)
+
+-- check join removal with a cross-type comparison operator
+explain (costs off)
+select i8.* from int8_tbl i8 left join (select f1 from int4_tbl group by f1) i4
+ on i8.q1 = i4.f1;
+ QUERY PLAN
+-------------------------
+ Seq Scan on int8_tbl i8
+(1 row)
+
+-- check join removal with lateral references
+explain (costs off)
+select 1 from (select a.id FROM a left join b on a.b_id = b.id) q,
+ lateral generate_series(1, q.id) gs(i) where q.id = gs.i;
+ QUERY PLAN
+-------------------------------------------
+ Nested Loop
+ -> Seq Scan on a
+ -> Function Scan on generate_series gs
+ Filter: (a.id = i)
+(4 rows)
+
+rollback;
+create temp table parent (k int primary key, pd int);
+create temp table child (k int unique, cd int);
+insert into parent values (1, 10), (2, 20), (3, 30);
+insert into child values (1, 100), (4, 400);
+-- this case is optimizable
+select p.* from parent p left join child c on (p.k = c.k);
+ k | pd
+---+----
+ 1 | 10
+ 2 | 20
+ 3 | 30
+(3 rows)
+
+explain (costs off)
+ select p.* from parent p left join child c on (p.k = c.k);
+ QUERY PLAN
+----------------------
+ Seq Scan on parent p
+(1 row)
+
+-- this case is not
+select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+ k | pd | linked
+---+----+--------
+ 1 | 10 | t
+ 2 | 20 |
+ 3 | 30 |
+(3 rows)
+
+explain (costs off)
+ select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+ QUERY PLAN
+---------------------------------
+ Hash Left Join
+ Hash Cond: (p.k = c.k)
+ -> Seq Scan on parent p
+ -> Hash
+ -> Seq Scan on child c
+(5 rows)
+
+-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+ k | pd
+---+----
+(0 rows)
+
+explain (costs off)
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+ QUERY PLAN
+------------------------------------------------
+ Result
+ One-Time Filter: false
+ -> Index Scan using parent_pkey on parent p
+ Index Cond: (k = 1)
+(4 rows)
+
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+ k | pd
+---+----
+(0 rows)
+
+explain (costs off)
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+-- bug 5255: this is not optimizable by join removal
+begin;
+CREATE TEMP TABLE a (id int PRIMARY KEY);
+CREATE TEMP TABLE b (id int PRIMARY KEY, a_id int);
+INSERT INTO a VALUES (0), (1);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ id | a_id | id
+----+------+----
+ 1 | |
+(1 row)
+
+SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+ id | a_id
+----+------
+ 1 |
+(1 row)
+
+rollback;
+-- another join removal bug: this is not optimizable, either
+begin;
+create temp table innertab (id int8 primary key, dat1 int8);
+insert into innertab values(123, 42);
+SELECT * FROM
+ (SELECT 1 AS x) ss1
+ LEFT JOIN
+ (SELECT q1, q2, COALESCE(dat1, q1) AS y
+ FROM int8_tbl LEFT JOIN innertab ON q2 = id) ss2
+ ON true;
+ x | q1 | q2 | y
+---+------------------+-------------------+------------------
+ 1 | 123 | 456 | 123
+ 1 | 123 | 4567890123456789 | 123
+ 1 | 4567890123456789 | 123 | 42
+ 1 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 1 | 4567890123456789 | -4567890123456789 | 4567890123456789
+(5 rows)
+
+rollback;
+-- another join removal bug: we must clean up correctly when removing a PHV
+begin;
+create temp table uniquetbl (f1 text unique);
+explain (costs off)
+select t1.* from
+ uniquetbl as t1
+ left join (select *, '***'::text as d1 from uniquetbl) t2
+ on t1.f1 = t2.f1
+ left join uniquetbl t3
+ on t2.d1 = t3.f1;
+ QUERY PLAN
+--------------------------
+ Seq Scan on uniquetbl t1
+(1 row)
+
+explain (costs off)
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Nested Loop
+ Join Filter: (CASE t1.ten WHEN 0 THEN 'doh!'::text ELSE NULL::text END = t0.f1)
+ -> Nested Loop
+ -> Seq Scan on int4_tbl i4
+ -> Index Scan using tenk1_unique2 on tenk1 t1
+ Index Cond: (unique2 = i4.f1)
+ Filter: (stringu2 !~* CASE ten WHEN 0 THEN 'doh!'::text ELSE NULL::text END)
+ -> Materialize
+ -> Seq Scan on text_tbl t0
+(9 rows)
+
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+ f1
+------
+ doh!
+(1 row)
+
+rollback;
+-- test case to expose miscomputation of required relid set for a PHV
+explain (verbose, costs off)
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+ QUERY PLAN
+-------------------------------------------------------------
+ Nested Loop Left Join
+ Output: i8.q1, i8.q2, ((i4.f1 + 1)), t.unique2
+ -> Nested Loop Left Join
+ Output: i8.q1, i8.q2, (i4.f1 + 1)
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ Filter: (i8.q2 = 456)
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+ Filter: (i4.f1 = 1)
+ -> Index Only Scan using tenk1_unique2 on public.tenk1 t
+ Output: t.unique2
+ Index Cond: (t.unique2 = ((i4.f1 + 1)))
+(13 rows)
+
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+ q1 | q2 | v | unique2
+-----+-----+---+---------
+ 123 | 456 | |
+(1 row)
+
+-- and check a related issue where we miscompute required relids for
+-- a PHV that's been translated to a child rel
+create temp table parttbl (a integer primary key) partition by range (a);
+create temp table parttbl1 partition of parttbl for values from (1) to (100);
+insert into parttbl values (11), (12);
+explain (costs off)
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+ QUERY PLAN
+------------------------------------
+ Nested Loop
+ -> Seq Scan on int4_tbl
+ Filter: (f1 = 0)
+ -> Seq Scan on parttbl1 parttbl
+ Filter: (a = 12)
+(5 rows)
+
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+ a | phv | f1
+----+-----+----
+ 12 | 12 | 0
+(1 row)
+
+-- bug #8444: we've historically allowed duplicate aliases within aliased JOINs
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = f1; -- error
+ERROR: column reference "f1" is ambiguous
+LINE 2: ..._tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = f1;
+ ^
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = y.f1; -- error
+ERROR: invalid reference to FROM-clause entry for table "y"
+LINE 2: ...bl x join (int4_tbl x cross join int4_tbl y) j on q1 = y.f1;
+ ^
+HINT: There is an entry for table "y", but it cannot be referenced from this part of the query.
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y(ff)) j on q1 = f1; -- ok
+ q1 | q2 | f1 | ff
+----+----+----+----
+(0 rows)
+
+--
+-- Test hints given on incorrect column references are useful
+--
+select t1.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t1" suggestion
+ERROR: column t1.uunique1 does not exist
+LINE 1: select t1.uunique1 from
+ ^
+HINT: Perhaps you meant to reference the column "t1.unique1".
+select t2.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t2" suggestion
+ERROR: column t2.uunique1 does not exist
+LINE 1: select t2.uunique1 from
+ ^
+HINT: Perhaps you meant to reference the column "t2.unique1".
+select uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, suggest both at once
+ERROR: column "uunique1" does not exist
+LINE 1: select uunique1 from
+ ^
+HINT: Perhaps you meant to reference the column "t1.unique1" or the column "t2.unique1".
+--
+-- Take care to reference the correct RTE
+--
+select atts.relid::regclass, s.* from pg_stats s join
+ pg_attribute a on s.attname = a.attname and s.tablename =
+ a.attrelid::regclass::text join (select unnest(indkey) attnum,
+ indexrelid from pg_index i) atts on atts.attnum = a.attnum where
+ schemaname != 'pg_catalog';
+ERROR: column atts.relid does not exist
+LINE 1: select atts.relid::regclass, s.* from pg_stats s join
+ ^
+--
+-- Test LATERAL
+--
+select unique2, x.*
+from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+ unique2 | f1
+---------+----
+ 9998 | 0
+(1 row)
+
+explain (costs off)
+ select unique2, x.*
+ from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+ QUERY PLAN
+-------------------------------------------------
+ Nested Loop
+ -> Seq Scan on int4_tbl b
+ -> Index Scan using tenk1_unique1 on tenk1 a
+ Index Cond: (unique1 = b.f1)
+(4 rows)
+
+select unique2, x.*
+from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+ unique2 | f1
+---------+----
+ 9998 | 0
+(1 row)
+
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+ QUERY PLAN
+-----------------------------------------------
+ Nested Loop
+ -> Seq Scan on int4_tbl x
+ -> Index Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = x.f1)
+(4 rows)
+
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x cross join lateral (select unique2 from tenk1 where f1 = unique1) ss;
+ QUERY PLAN
+-----------------------------------------------
+ Nested Loop
+ -> Seq Scan on int4_tbl x
+ -> Index Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = x.f1)
+(4 rows)
+
+select unique2, x.*
+from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+ unique2 | f1
+---------+-------------
+ 9998 | 0
+ | 123456
+ | -123456
+ | 2147483647
+ | -2147483647
+(5 rows)
+
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+ QUERY PLAN
+-----------------------------------------------
+ Nested Loop Left Join
+ -> Seq Scan on int4_tbl x
+ -> Index Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = x.f1)
+(4 rows)
+
+-- check scoping of lateral versus parent references
+-- the first of these should return int8_tbl.q2, the second int8_tbl.q1
+select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+ q1 | q2 | r
+------------------+-------------------+-------------------
+ 123 | 456 | 456
+ 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | -4567890123456789
+(5 rows)
+
+select *, (select r from (select q1 as q2) x, lateral (select q2 as r) y) from int8_tbl;
+ q1 | q2 | r
+------------------+-------------------+------------------
+ 123 | 456 | 123
+ 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789
+(5 rows)
+
+-- lateral with function in FROM
+select count(*) from tenk1 a, lateral generate_series(1,two) g;
+ count
+-------
+ 5000
+(1 row)
+
+explain (costs off)
+ select count(*) from tenk1 a, lateral generate_series(1,two) g;
+ QUERY PLAN
+------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Seq Scan on tenk1 a
+ -> Memoize
+ Cache Key: a.two
+ Cache Mode: binary
+ -> Function Scan on generate_series g
+(7 rows)
+
+explain (costs off)
+ select count(*) from tenk1 a cross join lateral generate_series(1,two) g;
+ QUERY PLAN
+------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Seq Scan on tenk1 a
+ -> Memoize
+ Cache Key: a.two
+ Cache Mode: binary
+ -> Function Scan on generate_series g
+(7 rows)
+
+-- don't need the explicit LATERAL keyword for functions
+explain (costs off)
+ select count(*) from tenk1 a, generate_series(1,two) g;
+ QUERY PLAN
+------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Seq Scan on tenk1 a
+ -> Memoize
+ Cache Key: a.two
+ Cache Mode: binary
+ -> Function Scan on generate_series g
+(7 rows)
+
+-- lateral with UNION ALL subselect
+explain (costs off)
+ select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+ QUERY PLAN
+------------------------------------------
+ Nested Loop
+ -> Function Scan on generate_series g
+ -> Append
+ -> Seq Scan on int8_tbl a
+ Filter: (g.g = q1)
+ -> Seq Scan on int8_tbl b
+ Filter: (g.g = q2)
+(7 rows)
+
+select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+ g | q1 | q2
+-----+------------------+------------------
+ 123 | 123 | 456
+ 123 | 123 | 4567890123456789
+ 123 | 4567890123456789 | 123
+(3 rows)
+
+-- lateral with VALUES
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+ QUERY PLAN
+------------------------------------------------------------
+ Aggregate
+ -> Merge Join
+ Merge Cond: (a.unique1 = b.unique2)
+ -> Index Only Scan using tenk1_unique1 on tenk1 a
+ -> Index Only Scan using tenk1_unique2 on tenk1 b
+(5 rows)
+
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+ count
+-------
+ 10000
+(1 row)
+
+-- lateral with VALUES, no flattening possible
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+ QUERY PLAN
+------------------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Nested Loop
+ -> Index Only Scan using tenk1_unique1 on tenk1 a
+ -> Values Scan on "*VALUES*"
+ -> Memoize
+ Cache Key: "*VALUES*".column1
+ Cache Mode: logical
+ -> Index Only Scan using tenk1_unique2 on tenk1 b
+ Index Cond: (unique2 = "*VALUES*".column1)
+(10 rows)
+
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+ count
+-------
+ 10000
+(1 row)
+
+-- lateral injecting a strange outer join condition
+explain (costs off)
+ select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+ QUERY PLAN
+------------------------------------------------
+ Sort
+ Sort Key: a.q1, a.q2, x.q1, x.q2, (a.q1)
+ -> Nested Loop
+ -> Seq Scan on int8_tbl a
+ -> Hash Right Join
+ Hash Cond: ((a.q1) = x.q2)
+ -> Seq Scan on int4_tbl y
+ -> Hash
+ -> Seq Scan on int8_tbl x
+(9 rows)
+
+select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+ q1 | q2 | q1 | q2 | z
+------------------+-------------------+------------------+-------------------+------------------
+ 123 | 456 | 123 | 456 |
+ 123 | 456 | 123 | 4567890123456789 |
+ 123 | 456 | 4567890123456789 | -4567890123456789 |
+ 123 | 456 | 4567890123456789 | 123 | 123
+ 123 | 456 | 4567890123456789 | 123 | 123
+ 123 | 456 | 4567890123456789 | 123 | 123
+ 123 | 456 | 4567890123456789 | 123 | 123
+ 123 | 456 | 4567890123456789 | 123 | 123
+ 123 | 456 | 4567890123456789 | 4567890123456789 |
+ 123 | 4567890123456789 | 123 | 456 |
+ 123 | 4567890123456789 | 123 | 4567890123456789 |
+ 123 | 4567890123456789 | 4567890123456789 | -4567890123456789 |
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 |
+ 4567890123456789 | -4567890123456789 | 123 | 456 |
+ 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | -4567890123456789 |
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 123 |
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 456 |
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 4567890123456789 | -4567890123456789 |
+ 4567890123456789 | 123 | 4567890123456789 | 123 |
+ 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 123 | 456 |
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789 |
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 |
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+(57 rows)
+
+-- lateral reference to a join alias variable
+select * from (select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (select x) ss2(y);
+ x | f1 | y
+---+----+---
+ 0 | 0 | 0
+(1 row)
+
+select * from (select f1 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (values(x)) ss2(y);
+ x | f1 | y
+-------------+-------------+-------------
+ 0 | 0 | 0
+ 123456 | 123456 | 123456
+ -123456 | -123456 | -123456
+ 2147483647 | 2147483647 | 2147483647
+ -2147483647 | -2147483647 | -2147483647
+(5 rows)
+
+select * from ((select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1) j,
+ lateral (select x) ss2(y);
+ x | f1 | y
+---+----+---
+ 0 | 0 | 0
+(1 row)
+
+-- lateral references requiring pullup
+select * from (values(1)) x(lb),
+ lateral generate_series(lb,4) x4;
+ lb | x4
+----+----
+ 1 | 1
+ 1 | 2
+ 1 | 3
+ 1 | 4
+(4 rows)
+
+select * from (select f1/1000000000 from int4_tbl) x(lb),
+ lateral generate_series(lb,4) x4;
+ lb | x4
+----+----
+ 0 | 0
+ 0 | 1
+ 0 | 2
+ 0 | 3
+ 0 | 4
+ 0 | 0
+ 0 | 1
+ 0 | 2
+ 0 | 3
+ 0 | 4
+ 0 | 0
+ 0 | 1
+ 0 | 2
+ 0 | 3
+ 0 | 4
+ 2 | 2
+ 2 | 3
+ 2 | 4
+ -2 | -2
+ -2 | -1
+ -2 | 0
+ -2 | 1
+ -2 | 2
+ -2 | 3
+ -2 | 4
+(25 rows)
+
+select * from (values(1)) x(lb),
+ lateral (values(lb)) y(lbcopy);
+ lb | lbcopy
+----+--------
+ 1 | 1
+(1 row)
+
+select * from (values(1)) x(lb),
+ lateral (select lb from int4_tbl) y(lbcopy);
+ lb | lbcopy
+----+--------
+ 1 | 1
+ 1 | 1
+ 1 | 1
+ 1 | 1
+ 1 | 1
+(5 rows)
+
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (values(x.q1,y.q1,y.q2)) v(xq1,yq1,yq2);
+ q1 | q2 | q1 | q2 | xq1 | yq1 | yq2
+------------------+-------------------+------------------+-------------------+------------------+------------------+-------------------
+ 123 | 456 | | | 123 | |
+ 123 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | -4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 456 | 4567890123456789 | 123 | 456
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789 | | | 4567890123456789 | |
+(10 rows)
+
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+ q1 | q2 | q1 | q2 | xq1 | yq1 | yq2
+------------------+-------------------+------------------+-------------------+------------------+------------------+-------------------
+ 123 | 456 | | | 123 | |
+ 123 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 123 | 4567890123456789 | -4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 456 | 4567890123456789 | 123 | 456
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789 | | | 4567890123456789 | |
+(10 rows)
+
+select x.* from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 123 | 4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(10 rows)
+
+select v.* from
+ (int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+ vx | vy
+-------------------+-------------------
+ 123 |
+ 456 |
+ 123 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 123 | 456
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 |
+ -4567890123456789 |
+(20 rows)
+
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+ vx | vy
+-------------------+-------------------
+ 4567890123456789 | 123
+ 123 | 456
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 123 |
+ 456 |
+ 4567890123456789 |
+ -4567890123456789 |
+(20 rows)
+
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 from onerow union all select x.q2,y.q2 from onerow) v(vx,vy);
+ vx | vy
+-------------------+-------------------
+ 4567890123456789 | 123
+ 123 | 456
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 123 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+ 123 |
+ 456 |
+ 4567890123456789 |
+ -4567890123456789 |
+(20 rows)
+
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+ QUERY PLAN
+------------------------------------------
+ Nested Loop Left Join
+ Output: a.q1, a.q2, b.q1, b.q2, (a.q2)
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q1, a.q2
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, b.q2, a.q2
+ Filter: (a.q2 = b.q1)
+(7 rows)
+
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+ q1 | q2 | q1 | q2 | x
+------------------+-------------------+------------------+-------------------+------------------
+ 123 | 456 | | |
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 456 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | | |
+(10 rows)
+
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+ QUERY PLAN
+------------------------------------------------------------------
+ Nested Loop Left Join
+ Output: a.q1, a.q2, b.q1, b.q2, (COALESCE(a.q2, '42'::bigint))
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q1, a.q2
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, b.q2, COALESCE(a.q2, '42'::bigint)
+ Filter: (a.q2 = b.q1)
+(7 rows)
+
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+ q1 | q2 | q1 | q2 | x
+------------------+-------------------+------------------+-------------------+------------------
+ 123 | 456 | | |
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 123 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789
+ 4567890123456789 | 123 | 123 | 456 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | -4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | | |
+(10 rows)
+
+-- lateral can result in join conditions appearing below their
+-- real semantic level
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+ QUERY PLAN
+-------------------------------------------
+ Hash Left Join
+ Output: i.f1, j.f1
+ Hash Cond: (i.f1 = j.f1)
+ -> Seq Scan on public.int4_tbl i
+ Output: i.f1
+ -> Hash
+ Output: j.f1
+ -> Seq Scan on public.int2_tbl j
+ Output: j.f1
+(9 rows)
+
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+ f1 | f1
+-------------+----
+ 0 | 0
+ 123456 |
+ -123456 |
+ 2147483647 |
+ -2147483647 |
+(5 rows)
+
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+ QUERY PLAN
+-------------------------------------
+ Nested Loop Left Join
+ Output: i.f1, (COALESCE(i.*))
+ -> Seq Scan on public.int4_tbl i
+ Output: i.f1, i.*
+ -> Seq Scan on public.int2_tbl j
+ Output: j.f1, COALESCE(i.*)
+ Filter: (i.f1 = j.f1)
+(7 rows)
+
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+ f1 | coalesce
+-------------+----------
+ 0 | (0)
+ 123456 |
+ -123456 |
+ 2147483647 |
+ -2147483647 |
+(5 rows)
+
+explain (verbose, costs off)
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+ QUERY PLAN
+-------------------------------------------------
+ Nested Loop
+ Output: a.f1, b.f1, c.q1, c.q2
+ -> Seq Scan on public.int4_tbl a
+ Output: a.f1
+ -> Hash Left Join
+ Output: b.f1, c.q1, c.q2
+ Hash Cond: (b.f1 = c.q1)
+ -> Seq Scan on public.int4_tbl b
+ Output: b.f1
+ -> Hash
+ Output: c.q1, c.q2
+ -> Seq Scan on public.int8_tbl c
+ Output: c.q1, c.q2
+ Filter: (a.f1 = c.q2)
+(14 rows)
+
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+ f1 | f1 | q1 | q2
+-------------+-------------+----+----
+ 0 | 0 | |
+ 0 | 123456 | |
+ 0 | -123456 | |
+ 0 | 2147483647 | |
+ 0 | -2147483647 | |
+ 123456 | 0 | |
+ 123456 | 123456 | |
+ 123456 | -123456 | |
+ 123456 | 2147483647 | |
+ 123456 | -2147483647 | |
+ -123456 | 0 | |
+ -123456 | 123456 | |
+ -123456 | -123456 | |
+ -123456 | 2147483647 | |
+ -123456 | -2147483647 | |
+ 2147483647 | 0 | |
+ 2147483647 | 123456 | |
+ 2147483647 | -123456 | |
+ 2147483647 | 2147483647 | |
+ 2147483647 | -2147483647 | |
+ -2147483647 | 0 | |
+ -2147483647 | 123456 | |
+ -2147483647 | -123456 | |
+ -2147483647 | 2147483647 | |
+ -2147483647 | -2147483647 | |
+(25 rows)
+
+-- lateral reference in a PlaceHolderVar evaluated at join level
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+ QUERY PLAN
+-------------------------------------------------------------
+ Nested Loop Left Join
+ Output: a.q1, a.q2, b.q1, c.q1, (LEAST(a.q1, b.q1, c.q1))
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q1, a.q2
+ -> Nested Loop
+ Output: b.q1, c.q1, LEAST(a.q1, b.q1, c.q1)
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, b.q2
+ Filter: (a.q2 = b.q1)
+ -> Seq Scan on public.int8_tbl c
+ Output: c.q1, c.q2
+(11 rows)
+
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+ q1 | q2 | bq1 | cq1 | least
+------------------+-------------------+------------------+------------------+------------------
+ 123 | 456 | | |
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 123 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 123 | 123
+ 4567890123456789 | 123 | 123 | 123 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 123 | 123
+ 4567890123456789 | 123 | 123 | 123 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 123 | 123 | 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 123 | 123
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789 | | |
+(42 rows)
+
+-- case requiring nested PlaceHolderVars
+explain (verbose, costs off)
+select * from
+ int8_tbl c left join (
+ int8_tbl a left join (select q1, coalesce(q2,42) as x from int8_tbl b) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select ss2.y offset 0) ss3;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: c.q1, c.q2, a.q1, a.q2, b.q1, (COALESCE(b.q2, '42'::bigint)), d.q1, (COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2)), ((COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2)))
+ -> Hash Right Join
+ Output: c.q1, c.q2, a.q1, a.q2, b.q1, d.q1, (COALESCE(b.q2, '42'::bigint)), (COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2))
+ Hash Cond: (d.q1 = c.q2)
+ -> Nested Loop
+ Output: a.q1, a.q2, b.q1, d.q1, (COALESCE(b.q2, '42'::bigint)), (COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2))
+ -> Hash Left Join
+ Output: a.q1, a.q2, b.q1, (COALESCE(b.q2, '42'::bigint))
+ Hash Cond: (a.q2 = b.q1)
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q1, a.q2
+ -> Hash
+ Output: b.q1, (COALESCE(b.q2, '42'::bigint))
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, COALESCE(b.q2, '42'::bigint)
+ -> Seq Scan on public.int8_tbl d
+ Output: d.q1, COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2)
+ -> Hash
+ Output: c.q1, c.q2
+ -> Seq Scan on public.int8_tbl c
+ Output: c.q1, c.q2
+ -> Result
+ Output: (COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2))
+(24 rows)
+
+-- case that breaks the old ph_may_need optimization
+explain (verbose, costs off)
+select c.*,a.*,ss1.q1,ss2.q1,ss3.* from
+ int8_tbl c left join (
+ int8_tbl a left join
+ (select q1, coalesce(q2,f1) as x from int8_tbl b, int4_tbl b2
+ where q1 < f1) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select * from int4_tbl i where ss2.y > f1) ss3;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: c.q1, c.q2, a.q1, a.q2, b.q1, d.q1, i.f1
+ Join Filter: ((COALESCE((COALESCE(b.q2, (b2.f1)::bigint)), d.q2)) > i.f1)
+ -> Hash Right Join
+ Output: c.q1, c.q2, a.q1, a.q2, b.q1, d.q1, (COALESCE((COALESCE(b.q2, (b2.f1)::bigint)), d.q2))
+ Hash Cond: (d.q1 = c.q2)
+ -> Nested Loop
+ Output: a.q1, a.q2, b.q1, d.q1, (COALESCE((COALESCE(b.q2, (b2.f1)::bigint)), d.q2))
+ -> Hash Right Join
+ Output: a.q1, a.q2, b.q1, (COALESCE(b.q2, (b2.f1)::bigint))
+ Hash Cond: (b.q1 = a.q2)
+ -> Nested Loop
+ Output: b.q1, COALESCE(b.q2, (b2.f1)::bigint)
+ Join Filter: (b.q1 < b2.f1)
+ -> Seq Scan on public.int8_tbl b
+ Output: b.q1, b.q2
+ -> Materialize
+ Output: b2.f1
+ -> Seq Scan on public.int4_tbl b2
+ Output: b2.f1
+ -> Hash
+ Output: a.q1, a.q2
+ -> Seq Scan on public.int8_tbl a
+ Output: a.q1, a.q2
+ -> Seq Scan on public.int8_tbl d
+ Output: d.q1, COALESCE((COALESCE(b.q2, (b2.f1)::bigint)), d.q2)
+ -> Hash
+ Output: c.q1, c.q2
+ -> Seq Scan on public.int8_tbl c
+ Output: c.q1, c.q2
+ -> Materialize
+ Output: i.f1
+ -> Seq Scan on public.int4_tbl i
+ Output: i.f1
+(34 rows)
+
+-- check processing of postponed quals (bug #9041)
+explain (verbose, costs off)
+select * from
+ (select 1 as x offset 0) x cross join (select 2 as y offset 0) y
+ left join lateral (
+ select * from (select 3 as z offset 0) z where z.z = x.x
+ ) zz on zz.z = y.y;
+ QUERY PLAN
+----------------------------------------------
+ Nested Loop Left Join
+ Output: (1), (2), (3)
+ Join Filter: (((3) = (1)) AND ((3) = (2)))
+ -> Nested Loop
+ Output: (1), (2)
+ -> Result
+ Output: 1
+ -> Result
+ Output: 2
+ -> Result
+ Output: 3
+(11 rows)
+
+-- check dummy rels with lateral references (bug #15694)
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl where false) ss on true;
+ QUERY PLAN
+--------------------------------------
+ Nested Loop Left Join
+ Output: i8.q1, i8.q2, f1, (i8.q2)
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ -> Result
+ Output: f1, i8.q2
+ One-Time Filter: false
+(7 rows)
+
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl i1, int4_tbl i2 where false) ss on true;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop Left Join
+ Output: i8.q1, i8.q2, f1, f1, (i8.q2)
+ -> Seq Scan on public.int8_tbl i8
+ Output: i8.q1, i8.q2
+ -> Result
+ Output: f1, f1, i8.q2
+ One-Time Filter: false
+(7 rows)
+
+-- check handling of nested appendrels inside LATERAL
+select * from
+ ((select 2 as v) union all (select 3 as v)) as q1
+ cross join lateral
+ ((select * from
+ ((select 4 as v) union all (select 5 as v)) as q3)
+ union all
+ (select q1.v)
+ ) as q2;
+ v | v
+---+---
+ 2 | 4
+ 2 | 5
+ 2 | 2
+ 3 | 4
+ 3 | 5
+ 3 | 3
+(6 rows)
+
+-- check the number of columns specified
+SELECT * FROM (int8_tbl i cross join int4_tbl j) ss(a,b,c,d);
+ERROR: join expression "ss" has 3 columns available but 4 columns specified
+-- check we don't try to do a unique-ified semijoin with LATERAL
+explain (verbose, costs off)
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+ QUERY PLAN
+----------------------------------------------------------------------
+ Nested Loop
+ Output: "*VALUES*".column1, "*VALUES*".column2, int4_tbl.f1
+ -> Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1, "*VALUES*".column2
+ -> Nested Loop Semi Join
+ Output: int4_tbl.f1
+ Join Filter: (int4_tbl.f1 = tenk1.unique1)
+ -> Seq Scan on public.int4_tbl
+ Output: int4_tbl.f1
+ -> Materialize
+ Output: tenk1.unique1
+ -> Index Scan using tenk1_unique2 on public.tenk1
+ Output: tenk1.unique1
+ Index Cond: (tenk1.unique2 = "*VALUES*".column2)
+(14 rows)
+
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+ id | x | f1
+----+------+----
+ 0 | 9998 | 0
+(1 row)
+
+-- check proper extParam/allParam handling (this isn't exactly a LATERAL issue,
+-- but we can make the test case much more compact with LATERAL)
+explain (verbose, costs off)
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+ QUERY PLAN
+-----------------------------------------------------------------
+ Nested Loop
+ Output: "*VALUES*".column1, t1.q1, t1.q2, ss2.q1, ss2.q2
+ -> Seq Scan on public.int8_tbl t1
+ Output: t1.q1, t1.q2
+ -> Nested Loop
+ Output: "*VALUES*".column1, ss2.q1, ss2.q2
+ -> Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1
+ -> Subquery Scan on ss2
+ Output: ss2.q1, ss2.q2
+ Filter: (t1.q1 = ss2.q2)
+ -> Seq Scan on public.int8_tbl t2
+ Output: t2.q1, t2.q2
+ Filter: (SubPlan 3)
+ SubPlan 3
+ -> Result
+ Output: t3.q2
+ One-Time Filter: $4
+ InitPlan 1 (returns $2)
+ -> Result
+ Output: GREATEST($0, t2.q2)
+ InitPlan 2 (returns $4)
+ -> Result
+ Output: ($3 = 0)
+ -> Seq Scan on public.int8_tbl t3
+ Output: t3.q1, t3.q2
+ Filter: (t3.q2 = $2)
+(27 rows)
+
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+ id | q1 | q2 | q1 | q2
+----+------------------+-------------------+------------------+------------------
+ 0 | 4567890123456789 | 123 | 4567890123456789 | 4567890123456789
+ 0 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789
+ 0 | 4567890123456789 | -4567890123456789 | 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- test some error cases where LATERAL should have been used but wasn't
+select f1,g from int4_tbl a, (select f1 as g) ss;
+ERROR: column "f1" does not exist
+LINE 1: select f1,g from int4_tbl a, (select f1 as g) ss;
+ ^
+HINT: There is a column named "f1" in table "a", but it cannot be referenced from this part of the query.
+select f1,g from int4_tbl a, (select a.f1 as g) ss;
+ERROR: invalid reference to FROM-clause entry for table "a"
+LINE 1: select f1,g from int4_tbl a, (select a.f1 as g) ss;
+ ^
+HINT: There is an entry for table "a", but it cannot be referenced from this part of the query.
+select f1,g from int4_tbl a cross join (select f1 as g) ss;
+ERROR: column "f1" does not exist
+LINE 1: select f1,g from int4_tbl a cross join (select f1 as g) ss;
+ ^
+HINT: There is a column named "f1" in table "a", but it cannot be referenced from this part of the query.
+select f1,g from int4_tbl a cross join (select a.f1 as g) ss;
+ERROR: invalid reference to FROM-clause entry for table "a"
+LINE 1: select f1,g from int4_tbl a cross join (select a.f1 as g) ss...
+ ^
+HINT: There is an entry for table "a", but it cannot be referenced from this part of the query.
+-- SQL:2008 says the left table is in scope but illegal to access here
+select f1,g from int4_tbl a right join lateral generate_series(0, a.f1) g on true;
+ERROR: invalid reference to FROM-clause entry for table "a"
+LINE 1: ... int4_tbl a right join lateral generate_series(0, a.f1) g on...
+ ^
+DETAIL: The combining JOIN type must be INNER or LEFT for a LATERAL reference.
+select f1,g from int4_tbl a full join lateral generate_series(0, a.f1) g on true;
+ERROR: invalid reference to FROM-clause entry for table "a"
+LINE 1: ...m int4_tbl a full join lateral generate_series(0, a.f1) g on...
+ ^
+DETAIL: The combining JOIN type must be INNER or LEFT for a LATERAL reference.
+-- check we complain about ambiguous table references
+select * from
+ int8_tbl x cross join (int4_tbl x cross join lateral (select x.f1) ss);
+ERROR: table reference "x" is ambiguous
+LINE 2: ...cross join (int4_tbl x cross join lateral (select x.f1) ss);
+ ^
+-- LATERAL can be used to put an aggregate into the FROM clause of its query
+select 1 from tenk1 a, lateral (select max(a.unique1) from int4_tbl b) ss;
+ERROR: aggregate functions are not allowed in FROM clause of their own query level
+LINE 1: select 1 from tenk1 a, lateral (select max(a.unique1) from i...
+ ^
+-- check behavior of LATERAL in UPDATE/DELETE
+create temp table xx1 as select f1 as x1, -f1 as x2 from int4_tbl;
+-- error, can't do this:
+update xx1 set x2 = f1 from (select * from int4_tbl where f1 = x1) ss;
+ERROR: column "x1" does not exist
+LINE 1: ... set x2 = f1 from (select * from int4_tbl where f1 = x1) ss;
+ ^
+HINT: There is a column named "x1" in table "xx1", but it cannot be referenced from this part of the query.
+update xx1 set x2 = f1 from (select * from int4_tbl where f1 = xx1.x1) ss;
+ERROR: invalid reference to FROM-clause entry for table "xx1"
+LINE 1: ...t x2 = f1 from (select * from int4_tbl where f1 = xx1.x1) ss...
+ ^
+HINT: There is an entry for table "xx1", but it cannot be referenced from this part of the query.
+-- can't do it even with LATERAL:
+update xx1 set x2 = f1 from lateral (select * from int4_tbl where f1 = x1) ss;
+ERROR: invalid reference to FROM-clause entry for table "xx1"
+LINE 1: ...= f1 from lateral (select * from int4_tbl where f1 = x1) ss;
+ ^
+HINT: There is an entry for table "xx1", but it cannot be referenced from this part of the query.
+-- we might in future allow something like this, but for now it's an error:
+update xx1 set x2 = f1 from xx1, lateral (select * from int4_tbl where f1 = x1) ss;
+ERROR: table name "xx1" specified more than once
+-- also errors:
+delete from xx1 using (select * from int4_tbl where f1 = x1) ss;
+ERROR: column "x1" does not exist
+LINE 1: ...te from xx1 using (select * from int4_tbl where f1 = x1) ss;
+ ^
+HINT: There is a column named "x1" in table "xx1", but it cannot be referenced from this part of the query.
+delete from xx1 using (select * from int4_tbl where f1 = xx1.x1) ss;
+ERROR: invalid reference to FROM-clause entry for table "xx1"
+LINE 1: ...from xx1 using (select * from int4_tbl where f1 = xx1.x1) ss...
+ ^
+HINT: There is an entry for table "xx1", but it cannot be referenced from this part of the query.
+delete from xx1 using lateral (select * from int4_tbl where f1 = x1) ss;
+ERROR: invalid reference to FROM-clause entry for table "xx1"
+LINE 1: ...xx1 using lateral (select * from int4_tbl where f1 = x1) ss;
+ ^
+HINT: There is an entry for table "xx1", but it cannot be referenced from this part of the query.
+--
+-- test LATERAL reference propagation down a multi-level inheritance hierarchy
+-- produced for a multi-level partitioned table hierarchy.
+--
+create table join_pt1 (a int, b int, c varchar) partition by range(a);
+create table join_pt1p1 partition of join_pt1 for values from (0) to (100) partition by range(b);
+create table join_pt1p2 partition of join_pt1 for values from (100) to (200);
+create table join_pt1p1p1 partition of join_pt1p1 for values from (0) to (100);
+insert into join_pt1 values (1, 1, 'x'), (101, 101, 'y');
+create table join_ut1 (a int, b int, c varchar);
+insert into join_ut1 values (101, 101, 'y'), (2, 2, 'z');
+explain (verbose, costs off)
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+ QUERY PLAN
+--------------------------------------------------------------------
+ Sort
+ Output: t1.b, (LEAST(t1.a, t2.a, t3.a)), t1.a
+ Sort Key: t1.a
+ -> Nested Loop Left Join
+ Output: t1.b, (LEAST(t1.a, t2.a, t3.a)), t1.a
+ -> Seq Scan on public.join_ut1 t1
+ Output: t1.a, t1.b, t1.c
+ -> Hash Join
+ Output: t2.a, LEAST(t1.a, t2.a, t3.a)
+ Hash Cond: (t3.b = t2.a)
+ -> Seq Scan on public.join_ut1 t3
+ Output: t3.a, t3.b, t3.c
+ -> Hash
+ Output: t2.a
+ -> Append
+ -> Seq Scan on public.join_pt1p1p1 t2_1
+ Output: t2_1.a
+ Filter: (t1.a = t2_1.a)
+ -> Seq Scan on public.join_pt1p2 t2_2
+ Output: t2_2.a
+ Filter: (t1.a = t2_2.a)
+(21 rows)
+
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+ b | phv
+-----+-----
+ 2 |
+ 101 | 101
+(2 rows)
+
+drop table join_pt1;
+drop table join_ut1;
+--
+-- test estimation behavior with multi-column foreign key and constant qual
+--
+begin;
+create table fkest (x integer, x10 integer, x10b integer, x100 integer);
+insert into fkest select x, x/10, x/10, x/100 from generate_series(1,1000) x;
+create unique index on fkest(x, x10, x100);
+analyze fkest;
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+ QUERY PLAN
+-----------------------------------------------------------
+ Nested Loop
+ -> Hash Join
+ Hash Cond: ((f2.x = f1.x) AND (f2.x10b = f1.x10))
+ -> Seq Scan on fkest f2
+ Filter: (x100 = 2)
+ -> Hash
+ -> Seq Scan on fkest f1
+ Filter: (x100 = 2)
+ -> Index Scan using fkest_x_x10_x100_idx on fkest f3
+ Index Cond: (x = f1.x)
+(10 rows)
+
+alter table fkest add constraint fk
+ foreign key (x, x10b, x100) references fkest (x, x10, x100);
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+ QUERY PLAN
+-----------------------------------------------------
+ Hash Join
+ Hash Cond: ((f2.x = f1.x) AND (f2.x10b = f1.x10))
+ -> Hash Join
+ Hash Cond: (f3.x = f2.x)
+ -> Seq Scan on fkest f3
+ -> Hash
+ -> Seq Scan on fkest f2
+ Filter: (x100 = 2)
+ -> Hash
+ -> Seq Scan on fkest f1
+ Filter: (x100 = 2)
+(11 rows)
+
+rollback;
+--
+-- test that foreign key join estimation performs sanely for outer joins
+--
+begin;
+create table fkest (a int, b int, c int unique, primary key(a,b));
+create table fkest1 (a int, b int, primary key(a,b));
+insert into fkest select x/10, x%10, x from generate_series(1,1000) x;
+insert into fkest1 select x/10, x%10 from generate_series(1,1000) x;
+alter table fkest1
+ add constraint fkest1_a_b_fkey foreign key (a,b) references fkest;
+analyze fkest;
+analyze fkest1;
+explain (costs off)
+select *
+from fkest f
+ left join fkest1 f1 on f.a = f1.a and f.b = f1.b
+ left join fkest1 f2 on f.a = f2.a and f.b = f2.b
+ left join fkest1 f3 on f.a = f3.a and f.b = f3.b
+where f.c = 1;
+ QUERY PLAN
+------------------------------------------------------------------
+ Nested Loop Left Join
+ -> Nested Loop Left Join
+ -> Nested Loop Left Join
+ -> Index Scan using fkest_c_key on fkest f
+ Index Cond: (c = 1)
+ -> Index Only Scan using fkest1_pkey on fkest1 f1
+ Index Cond: ((a = f.a) AND (b = f.b))
+ -> Index Only Scan using fkest1_pkey on fkest1 f2
+ Index Cond: ((a = f.a) AND (b = f.b))
+ -> Index Only Scan using fkest1_pkey on fkest1 f3
+ Index Cond: ((a = f.a) AND (b = f.b))
+(11 rows)
+
+rollback;
+--
+-- test planner's ability to mark joins as unique
+--
+create table j1 (id int primary key);
+create table j2 (id int primary key);
+create table j3 (id int);
+insert into j1 values(1),(2),(3);
+insert into j2 values(1),(2),(3);
+insert into j3 values(1),(1);
+analyze j1;
+analyze j2;
+analyze j3;
+-- ensure join is properly marked as unique
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id = j2.id;
+ QUERY PLAN
+-----------------------------------
+ Hash Join
+ Output: j1.id, j2.id
+ Inner Unique: true
+ Hash Cond: (j1.id = j2.id)
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Hash
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(10 rows)
+
+-- ensure join is not unique when not an equi-join
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id > j2.id;
+ QUERY PLAN
+-----------------------------------
+ Nested Loop
+ Output: j1.id, j2.id
+ Join Filter: (j1.id > j2.id)
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Materialize
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(9 rows)
+
+-- ensure non-unique rel is not chosen as inner
+explain (verbose, costs off)
+select * from j1 inner join j3 on j1.id = j3.id;
+ QUERY PLAN
+-----------------------------------
+ Hash Join
+ Output: j1.id, j3.id
+ Inner Unique: true
+ Hash Cond: (j3.id = j1.id)
+ -> Seq Scan on public.j3
+ Output: j3.id
+ -> Hash
+ Output: j1.id
+ -> Seq Scan on public.j1
+ Output: j1.id
+(10 rows)
+
+-- ensure left join is marked as unique
+explain (verbose, costs off)
+select * from j1 left join j2 on j1.id = j2.id;
+ QUERY PLAN
+-----------------------------------
+ Hash Left Join
+ Output: j1.id, j2.id
+ Inner Unique: true
+ Hash Cond: (j1.id = j2.id)
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Hash
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(10 rows)
+
+-- ensure right join is marked as unique
+explain (verbose, costs off)
+select * from j1 right join j2 on j1.id = j2.id;
+ QUERY PLAN
+-----------------------------------
+ Hash Left Join
+ Output: j1.id, j2.id
+ Inner Unique: true
+ Hash Cond: (j2.id = j1.id)
+ -> Seq Scan on public.j2
+ Output: j2.id
+ -> Hash
+ Output: j1.id
+ -> Seq Scan on public.j1
+ Output: j1.id
+(10 rows)
+
+-- ensure full join is marked as unique
+explain (verbose, costs off)
+select * from j1 full join j2 on j1.id = j2.id;
+ QUERY PLAN
+-----------------------------------
+ Hash Full Join
+ Output: j1.id, j2.id
+ Inner Unique: true
+ Hash Cond: (j1.id = j2.id)
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Hash
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(10 rows)
+
+-- a clauseless (cross) join can't be unique
+explain (verbose, costs off)
+select * from j1 cross join j2;
+ QUERY PLAN
+-----------------------------------
+ Nested Loop
+ Output: j1.id, j2.id
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Materialize
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(8 rows)
+
+-- ensure a natural join is marked as unique
+explain (verbose, costs off)
+select * from j1 natural join j2;
+ QUERY PLAN
+-----------------------------------
+ Hash Join
+ Output: j1.id
+ Inner Unique: true
+ Hash Cond: (j1.id = j2.id)
+ -> Seq Scan on public.j1
+ Output: j1.id
+ -> Hash
+ Output: j2.id
+ -> Seq Scan on public.j2
+ Output: j2.id
+(10 rows)
+
+-- ensure a distinct clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select distinct id from j3) j3 on j1.id = j3.id;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop
+ Output: j1.id, j3.id
+ Inner Unique: true
+ Join Filter: (j1.id = j3.id)
+ -> Unique
+ Output: j3.id
+ -> Sort
+ Output: j3.id
+ Sort Key: j3.id
+ -> Seq Scan on public.j3
+ Output: j3.id
+ -> Seq Scan on public.j1
+ Output: j1.id
+(13 rows)
+
+-- ensure group by clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select id from j3 group by id) j3 on j1.id = j3.id;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop
+ Output: j1.id, j3.id
+ Inner Unique: true
+ Join Filter: (j1.id = j3.id)
+ -> Group
+ Output: j3.id
+ Group Key: j3.id
+ -> Sort
+ Output: j3.id
+ Sort Key: j3.id
+ -> Seq Scan on public.j3
+ Output: j3.id
+ -> Seq Scan on public.j1
+ Output: j1.id
+(14 rows)
+
+drop table j1;
+drop table j2;
+drop table j3;
+-- test more complex permutations of unique joins
+create table j1 (id1 int, id2 int, primary key(id1,id2));
+create table j2 (id1 int, id2 int, primary key(id1,id2));
+create table j3 (id1 int, id2 int, primary key(id1,id2));
+insert into j1 values(1,1),(1,2);
+insert into j2 values(1,1);
+insert into j3 values(1,1);
+analyze j1;
+analyze j2;
+analyze j3;
+-- ensure there's no unique join when not all columns which are part of the
+-- unique index are seen in the join clause
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1;
+ QUERY PLAN
+------------------------------------------
+ Nested Loop
+ Output: j1.id1, j1.id2, j2.id1, j2.id2
+ Join Filter: (j1.id1 = j2.id1)
+ -> Seq Scan on public.j2
+ Output: j2.id1, j2.id2
+ -> Seq Scan on public.j1
+ Output: j1.id1, j1.id2
+(7 rows)
+
+-- ensure proper unique detection with multiple join quals
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2;
+ QUERY PLAN
+----------------------------------------------------------
+ Nested Loop
+ Output: j1.id1, j1.id2, j2.id1, j2.id2
+ Inner Unique: true
+ Join Filter: ((j1.id1 = j2.id1) AND (j1.id2 = j2.id2))
+ -> Seq Scan on public.j2
+ Output: j2.id1, j2.id2
+ -> Seq Scan on public.j1
+ Output: j1.id1, j1.id2
+(8 rows)
+
+-- ensure we don't detect the join to be unique when quals are not part of the
+-- join condition
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+ QUERY PLAN
+------------------------------------------
+ Nested Loop
+ Output: j1.id1, j1.id2, j2.id1, j2.id2
+ Join Filter: (j1.id1 = j2.id1)
+ -> Seq Scan on public.j1
+ Output: j1.id1, j1.id2
+ Filter: (j1.id2 = 1)
+ -> Seq Scan on public.j2
+ Output: j2.id1, j2.id2
+(8 rows)
+
+-- as above, but for left joins.
+explain (verbose, costs off)
+select * from j1
+left join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+ QUERY PLAN
+------------------------------------------
+ Nested Loop Left Join
+ Output: j1.id1, j1.id2, j2.id1, j2.id2
+ Join Filter: (j1.id1 = j2.id1)
+ -> Seq Scan on public.j1
+ Output: j1.id1, j1.id2
+ Filter: (j1.id2 = 1)
+ -> Seq Scan on public.j2
+ Output: j2.id1, j2.id2
+(8 rows)
+
+-- validate logic in merge joins which skips mark and restore.
+-- it should only do this if all quals which were used to detect the unique
+-- are present as join quals, and not plain quals.
+set enable_nestloop to 0;
+set enable_hashjoin to 0;
+set enable_sort to 0;
+-- create indexes that will be preferred over the PKs to perform the join
+create index j1_id1_idx on j1 (id1) where id1 % 1000 = 1;
+create index j2_id1_idx on j2 (id1) where id1 % 1000 = 1;
+-- need an additional row in j2, if we want j2_id1_idx to be preferred
+insert into j2 values(1,2);
+analyze j2;
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+ QUERY PLAN
+-----------------------------------------
+ Merge Join
+ Merge Cond: (j1.id1 = j2.id1)
+ Join Filter: (j1.id2 = j2.id2)
+ -> Index Scan using j1_id1_idx on j1
+ -> Index Scan using j2_id1_idx on j2
+(5 rows)
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+ id1 | id2 | id1 | id2
+-----+-----+-----+-----
+ 1 | 1 | 1 | 1
+ 1 | 2 | 1 | 2
+(2 rows)
+
+-- Exercise array keys mark/restore B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+ QUERY PLAN
+----------------------------------------------------
+ Merge Join
+ Merge Cond: (j1.id1 = j2.id1)
+ Join Filter: (j1.id2 = j2.id2)
+ -> Index Scan using j1_id1_idx on j1
+ -> Index Scan using j2_id1_idx on j2
+ Index Cond: (id1 = ANY ('{1}'::integer[]))
+(6 rows)
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+ id1 | id2 | id1 | id2
+-----+-----+-----+-----
+ 1 | 1 | 1 | 1
+ 1 | 2 | 1 | 2
+(2 rows)
+
+-- Exercise array keys "find extreme element" B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+ QUERY PLAN
+-------------------------------------------------------
+ Merge Join
+ Merge Cond: (j1.id1 = j2.id1)
+ Join Filter: (j1.id2 = j2.id2)
+ -> Index Scan using j1_id1_idx on j1
+ -> Index Only Scan using j2_pkey on j2
+ Index Cond: (id1 >= ANY ('{1,5}'::integer[]))
+ Filter: ((id1 % 1000) = 1)
+(7 rows)
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+ id1 | id2 | id1 | id2
+-----+-----+-----+-----
+ 1 | 1 | 1 | 1
+ 1 | 2 | 1 | 2
+(2 rows)
+
+reset enable_nestloop;
+reset enable_hashjoin;
+reset enable_sort;
+drop table j1;
+drop table j2;
+drop table j3;
+-- check that semijoin inner is not seen as unique for a portion of the outerrel
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from tenk1 t3
+ where t3.thousand = t1.unique1 and t3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+ QUERY PLAN
+---------------------------------------------------------------------------------
+ Nested Loop
+ Output: t1.unique1, t2.hundred
+ -> Hash Join
+ Output: t1.unique1, t3.tenthous
+ Hash Cond: (t3.thousand = t1.unique1)
+ -> HashAggregate
+ Output: t3.thousand, t3.tenthous
+ Group Key: t3.thousand, t3.tenthous
+ -> Index Only Scan using tenk1_thous_tenthous on public.tenk1 t3
+ Output: t3.thousand, t3.tenthous
+ -> Hash
+ Output: t1.unique1
+ -> Index Only Scan using onek_unique1 on public.onek t1
+ Output: t1.unique1
+ Index Cond: (t1.unique1 < 1)
+ -> Index Only Scan using tenk1_hundred on public.tenk1 t2
+ Output: t2.hundred
+ Index Cond: (t2.hundred = t3.tenthous)
+(18 rows)
+
+-- ... unless it actually is unique
+create table j3 as select unique1, tenthous from onek;
+vacuum analyze j3;
+create unique index on j3(unique1, tenthous);
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from j3
+ where j3.unique1 = t1.unique1 and j3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+ QUERY PLAN
+------------------------------------------------------------------------
+ Nested Loop
+ Output: t1.unique1, t2.hundred
+ -> Nested Loop
+ Output: t1.unique1, j3.tenthous
+ -> Index Only Scan using onek_unique1 on public.onek t1
+ Output: t1.unique1
+ Index Cond: (t1.unique1 < 1)
+ -> Index Only Scan using j3_unique1_tenthous_idx on public.j3
+ Output: j3.unique1, j3.tenthous
+ Index Cond: (j3.unique1 = t1.unique1)
+ -> Index Only Scan using tenk1_hundred on public.tenk1 t2
+ Output: t2.hundred
+ Index Cond: (t2.hundred = j3.tenthous)
+(13 rows)
+
+drop table j3;
diff --git a/yql/essentials/tests/postgresql/original/cases/join.sql b/yql/essentials/tests/postgresql/original/cases/join.sql
new file mode 100644
index 0000000000..eb24a727e7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/join.sql
@@ -0,0 +1,2325 @@
+--
+-- JOIN
+-- Test JOIN clauses
+--
+
+CREATE TABLE J1_TBL (
+ i integer,
+ j integer,
+ t text
+);
+
+CREATE TABLE J2_TBL (
+ i integer,
+ k integer
+);
+
+
+INSERT INTO J1_TBL VALUES (1, 4, 'one');
+INSERT INTO J1_TBL VALUES (2, 3, 'two');
+INSERT INTO J1_TBL VALUES (3, 2, 'three');
+INSERT INTO J1_TBL VALUES (4, 1, 'four');
+INSERT INTO J1_TBL VALUES (5, 0, 'five');
+INSERT INTO J1_TBL VALUES (6, 6, 'six');
+INSERT INTO J1_TBL VALUES (7, 7, 'seven');
+INSERT INTO J1_TBL VALUES (8, 8, 'eight');
+INSERT INTO J1_TBL VALUES (0, NULL, 'zero');
+INSERT INTO J1_TBL VALUES (NULL, NULL, 'null');
+INSERT INTO J1_TBL VALUES (NULL, 0, 'zero');
+
+INSERT INTO J2_TBL VALUES (1, -1);
+INSERT INTO J2_TBL VALUES (2, 2);
+INSERT INTO J2_TBL VALUES (3, -3);
+INSERT INTO J2_TBL VALUES (2, 4);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (5, -5);
+INSERT INTO J2_TBL VALUES (0, NULL);
+INSERT INTO J2_TBL VALUES (NULL, NULL);
+INSERT INTO J2_TBL VALUES (NULL, 0);
+
+-- useful in some tests below
+create temp table onerow();
+insert into onerow default values;
+analyze onerow;
+
+
+--
+-- CORRELATION NAMES
+-- Make sure that table/column aliases are supported
+-- before diving into more complex join syntax.
+--
+
+SELECT *
+ FROM J1_TBL AS tx;
+
+SELECT *
+ FROM J1_TBL tx;
+
+SELECT *
+ FROM J1_TBL AS t1 (a, b, c);
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c);
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e);
+
+SELECT t1.a, t2.e
+ FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
+ WHERE t1.a = t2.d;
+
+
+--
+-- CROSS JOIN
+-- Qualifications are not allowed on cross joins,
+-- which degenerate into a standard unqualified inner join.
+--
+
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL;
+
+-- ambiguous column
+SELECT i, k, t
+ FROM J1_TBL CROSS JOIN J2_TBL;
+
+-- resolve previous ambiguity by specifying the table name
+SELECT t1.i, k, t
+ FROM J1_TBL t1 CROSS JOIN J2_TBL t2;
+
+SELECT ii, tt, kk
+ FROM (J1_TBL CROSS JOIN J2_TBL)
+ AS tx (ii, jj, tt, ii2, kk);
+
+SELECT tx.ii, tx.jj, tx.kk
+ FROM (J1_TBL t1 (a, b, c) CROSS JOIN J2_TBL t2 (d, e))
+ AS tx (ii, jj, tt, ii2, kk);
+
+SELECT *
+ FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b;
+
+
+--
+--
+-- Inner joins (equi-joins)
+--
+--
+
+--
+-- Inner joins (equi-joins) with USING clause
+-- The USING syntax changes the shape of the resulting table
+-- by including a column in the USING clause only once in the result.
+--
+
+-- Inner equi-join on specified column
+SELECT *
+ FROM J1_TBL INNER JOIN J2_TBL USING (i);
+
+-- Same as above, slightly different syntax
+SELECT *
+ FROM J1_TBL JOIN J2_TBL USING (i);
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
+ ORDER BY a, d;
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, b) USING (b)
+ ORDER BY b, t1.a;
+
+-- test join using aliases
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) WHERE J1_TBL.t = 'one'; -- ok
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one'; -- ok
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i)) AS x WHERE J1_TBL.t = 'one'; -- error
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.i = 1; -- ok
+SELECT * FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE x.t = 'one'; -- error
+SELECT * FROM (J1_TBL JOIN J2_TBL USING (i) AS x) AS xx WHERE x.i = 1; -- error (XXX could use better hint)
+SELECT * FROM J1_TBL a1 JOIN J2_TBL a2 USING (i) AS a1; -- error
+SELECT x.* FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+SELECT ROW(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+SELECT row_to_json(x.*) FROM J1_TBL JOIN J2_TBL USING (i) AS x WHERE J1_TBL.t = 'one';
+
+--
+-- NATURAL JOIN
+-- Inner equi-join on all columns with the same name
+--
+
+SELECT *
+ FROM J1_TBL NATURAL JOIN J2_TBL;
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d);
+
+SELECT *
+ FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
+
+-- mismatch number of columns
+-- currently, Postgres will fill in with underlying names
+SELECT *
+ FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a);
+
+
+--
+-- Inner joins (equi-joins)
+--
+
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i);
+
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
+
+
+--
+-- Non-equi-joins
+--
+
+SELECT *
+ FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i <= J2_TBL.k);
+
+
+--
+-- Outer joins
+-- Note that OUTER is a noise word
+--
+
+SELECT *
+ FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+
+SELECT *
+ FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
+
+SELECT *
+ FROM J1_TBL RIGHT JOIN J2_TBL USING (i);
+
+SELECT *
+ FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+
+SELECT *
+ FROM J1_TBL FULL JOIN J2_TBL USING (i)
+ ORDER BY i, k, t;
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (k = 1);
+
+SELECT *
+ FROM J1_TBL LEFT JOIN J2_TBL USING (i) WHERE (i = 1);
+
+--
+-- semijoin selectivity for <>
+--
+explain (costs off)
+select * from int4_tbl i4, tenk1 a
+where exists(select * from tenk1 b
+ where a.twothousand = b.twothousand and a.fivethous <> b.fivethous)
+ and i4.f1 = a.tenthous;
+
+
+--
+-- More complicated constructs
+--
+
+--
+-- Multiway full join
+--
+
+CREATE TABLE t1 (name TEXT, n INTEGER);
+CREATE TABLE t2 (name TEXT, n INTEGER);
+CREATE TABLE t3 (name TEXT, n INTEGER);
+
+INSERT INTO t1 VALUES ( 'bb', 11 );
+INSERT INTO t2 VALUES ( 'bb', 12 );
+INSERT INTO t2 VALUES ( 'cc', 22 );
+INSERT INTO t2 VALUES ( 'ee', 42 );
+INSERT INTO t3 VALUES ( 'bb', 13 );
+INSERT INTO t3 VALUES ( 'cc', 23 );
+INSERT INTO t3 VALUES ( 'dd', 33 );
+
+SELECT * FROM t1 FULL JOIN t2 USING (name) FULL JOIN t3 USING (name);
+
+--
+-- Test interactions of join syntax and subqueries
+--
+
+-- Basic cases (we expect planner to pull up the subquery here)
+SELECT * FROM
+(SELECT * FROM t2) as s2
+INNER JOIN
+(SELECT * FROM t3) s3
+USING (name);
+
+SELECT * FROM
+(SELECT * FROM t2) as s2
+LEFT JOIN
+(SELECT * FROM t3) s3
+USING (name);
+
+SELECT * FROM
+(SELECT * FROM t2) as s2
+FULL JOIN
+(SELECT * FROM t3) s3
+USING (name);
+
+-- Cases with non-nullable expressions in subquery results;
+-- make sure these go to null as expected
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL LEFT JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+
+SELECT * FROM
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL INNER JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL INNER JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+
+SELECT * FROM
+(SELECT name, n as s1_n, 1 as s1_1 FROM t1) as s1
+NATURAL FULL JOIN
+(SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+NATURAL FULL JOIN
+(SELECT name, n as s3_n, 3 as s3_2 FROM t3) s3;
+
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+
+SELECT * FROM
+(SELECT name, n as s1_n FROM t1) as s1
+NATURAL FULL JOIN
+ (SELECT * FROM
+ (SELECT name, n as s2_n, 2 as s2_2 FROM t2) as s2
+ NATURAL FULL JOIN
+ (SELECT name, n as s3_n FROM t3) as s3
+ ) ss2;
+
+-- Constants as join keys can also be problematic
+SELECT * FROM
+ (SELECT name, n as s1_n FROM t1) as s1
+FULL JOIN
+ (SELECT name, 2 as s2_n FROM t2) as s2
+ON (s1_n = s2_n);
+
+
+-- Test for propagation of nullability constraints into sub-joins
+
+create temp table x (x1 int, x2 int);
+insert into x values (1,11);
+insert into x values (2,22);
+insert into x values (3,null);
+insert into x values (4,44);
+insert into x values (5,null);
+
+create temp table y (y1 int, y2 int);
+insert into y values (1,111);
+insert into y values (2,222);
+insert into y values (3,333);
+insert into y values (4,null);
+
+select * from x;
+select * from y;
+
+select * from x left join y on (x1 = y1 and x2 is not null);
+select * from x left join y on (x1 = y1 and y2 is not null);
+
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and x2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and y2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1 and xx2 is not null);
+-- these should NOT give the same answers as above
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (x2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (y2 is not null);
+select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
+on (x1 = xx1) where (xx2 is not null);
+
+--
+-- regression test: check for bug with propagation of implied equality
+-- to outside an IN
+--
+select count(*) from tenk1 a where unique1 in
+ (select unique1 from tenk1 b join tenk1 c using (unique1)
+ where b.unique2 = 42);
+
+--
+-- regression test: check for failure to generate a plan with multiple
+-- degenerate IN clauses
+--
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+
+-- try that with GEQO too
+begin;
+set geqo = on;
+set geqo_threshold = 2;
+select count(*) from tenk1 x where
+ x.unique1 in (select a.f1 from int4_tbl a,float8_tbl b where a.f1=b.f1) and
+ x.unique1 = 0 and
+ x.unique1 in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=bb.f1);
+rollback;
+
+--
+-- regression test: be sure we cope with proven-dummy append rels
+--
+explain (costs off)
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+
+select aa, bb, unique1, unique1
+ from tenk1 right join b on aa = unique1
+ where bb < bb and bb is null;
+
+--
+-- regression test: check handling of empty-FROM subquery underneath outer join
+--
+explain (costs off)
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+
+select * from int8_tbl i1 left join (int8_tbl i2 join
+ (select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
+order by 1, 2;
+
+--
+-- regression test: check a case where join_clause_is_movable_into() gives
+-- an imprecise result, causing an assertion failure
+--
+select count(*)
+from
+ (select t3.tenthous as x1, coalesce(t1.stringu1, t2.stringu1) as x2
+ from tenk1 t1
+ left join tenk1 t2 on t1.unique1 = t2.unique1
+ join tenk1 t3 on t1.unique2 = t3.unique2) ss,
+ tenk1 t4,
+ tenk1 t5
+where t4.thousand = t5.unique1 and ss.x1 = t4.tenthous and ss.x2 = t5.stringu1;
+
+--
+-- regression test: check a case where we formerly missed including an EC
+-- enforcement clause because it was expected to be handled at scan level
+--
+explain (costs off)
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+
+select a.f1, b.f1, t.thousand, t.tenthous from
+ tenk1 t,
+ (select sum(f1)+1 as f1 from int4_tbl i4a) a,
+ (select sum(f1) as f1 from int4_tbl i4b) b
+where b.f1 = t.thousand and a.f1 = b.f1 and (a.f1+b.f1+999) = t.tenthous;
+
+--
+-- check a case where we formerly got confused by conflicting sort orders
+-- in redundant merge join path keys
+--
+explain (costs off)
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+
+select * from
+ j1_tbl full join
+ (select * from j2_tbl order by j2_tbl.i desc, j2_tbl.k asc) j2_tbl
+ on j1_tbl.i = j2_tbl.i and j1_tbl.i = j2_tbl.k;
+
+--
+-- a different check for handling of redundant sort keys in merge joins
+--
+explain (costs off)
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+
+select count(*) from
+ (select * from tenk1 x order by x.thousand, x.twothousand, x.fivethous) x
+ left join
+ (select * from tenk1 y order by y.unique2) y
+ on x.thousand = y.unique2 and x.twothousand = y.hundred and x.fivethous = y.unique2;
+
+
+--
+-- Clean up
+--
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+DROP TABLE J1_TBL;
+DROP TABLE J2_TBL;
+
+-- Both DELETE and UPDATE allow the specification of additional tables
+-- to "join" against to determine which rows should be modified.
+
+CREATE TEMP TABLE t1 (a int, b int);
+CREATE TEMP TABLE t2 (a int, b int);
+CREATE TEMP TABLE t3 (x int, y int);
+
+INSERT INTO t1 VALUES (5, 10);
+INSERT INTO t1 VALUES (15, 20);
+INSERT INTO t1 VALUES (100, 100);
+INSERT INTO t1 VALUES (200, 1000);
+INSERT INTO t2 VALUES (200, 2000);
+INSERT INTO t3 VALUES (5, 20);
+INSERT INTO t3 VALUES (6, 7);
+INSERT INTO t3 VALUES (7, 8);
+INSERT INTO t3 VALUES (500, 100);
+
+DELETE FROM t3 USING t1 table1 WHERE t3.x = table1.a;
+SELECT * FROM t3;
+DELETE FROM t3 USING t1 JOIN t2 USING (a) WHERE t3.x > t1.a;
+SELECT * FROM t3;
+DELETE FROM t3 USING t3 t3_other WHERE t3.x = t3_other.x AND t3.y = t3_other.y;
+SELECT * FROM t3;
+
+-- Test join against inheritance tree
+
+create temp table t2a () inherits (t2);
+
+insert into t2a values (200, 2001);
+
+select * from t1 left join t2 on (t1.a = t2.a);
+
+-- Test matching of column name with wrong alias
+
+select t1.x from t1 join t3 on (t1.a = t3.x);
+
+-- Test matching of locking clause with wrong alias
+
+select t1.*, t2.*, unnamed_join.* from
+ t1 join t2 on (t1.a = t2.a), t3 as unnamed_join
+ for update of unnamed_join;
+
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of unnamed_join;
+
+select foo.*, unnamed_join.* from
+ t1 join t2 using (a) as foo, t3 as unnamed_join
+ for update of foo;
+
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of foo;
+
+select bar.*, unnamed_join.* from
+ (t1 join t2 using (a) as foo) as bar, t3 as unnamed_join
+ for update of bar;
+
+--
+-- regression test for 8.1 merge right join bug
+--
+
+CREATE TEMP TABLE tt1 ( tt1_id int4, joincol int4 );
+INSERT INTO tt1 VALUES (1, 11);
+INSERT INTO tt1 VALUES (2, NULL);
+
+CREATE TEMP TABLE tt2 ( tt2_id int4, joincol int4 );
+INSERT INTO tt2 VALUES (21, 11);
+INSERT INTO tt2 VALUES (22, 11);
+
+set enable_hashjoin to off;
+set enable_nestloop to off;
+
+-- these should give the same results
+
+select tt1.*, tt2.* from tt1 left join tt2 on tt1.joincol = tt2.joincol;
+
+select tt1.*, tt2.* from tt2 right join tt1 on tt1.joincol = tt2.joincol;
+
+reset enable_hashjoin;
+reset enable_nestloop;
+
+--
+-- regression test for bug #13908 (hash join with skew tuples & nbatch increase)
+--
+
+set work_mem to '64kB';
+set enable_mergejoin to off;
+set enable_memoize to off;
+
+explain (costs off)
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+select count(*) from tenk1 a, tenk1 b
+ where a.hundred = b.thousand and (b.fivethous % 10) < 10;
+
+reset work_mem;
+reset enable_mergejoin;
+reset enable_memoize;
+
+--
+-- regression test for 8.2 bug with improper re-ordering of left joins
+--
+
+create temp table tt3(f1 int, f2 text);
+insert into tt3 select x, repeat('xyzzy', 100) from generate_series(1,10000) x;
+create index tt3i on tt3(f1);
+analyze tt3;
+
+create temp table tt4(f1 int);
+insert into tt4 values (0),(1),(9999);
+analyze tt4;
+
+SELECT a.f1
+FROM tt4 a
+LEFT JOIN (
+ SELECT b.f1
+ FROM tt3 b LEFT JOIN tt3 c ON (b.f1 = c.f1)
+ WHERE c.f1 IS NULL
+) AS d ON (a.f1 = d.f1)
+WHERE d.f1 IS NULL;
+
+--
+-- regression test for proper handling of outer joins within antijoins
+--
+
+create temp table tt4x(c1 int, c2 int, c3 int);
+
+explain (costs off)
+select * from tt4x t1
+where not exists (
+ select 1 from tt4x t2
+ left join tt4x t3 on t2.c3 = t3.c1
+ left join ( select t5.c1 as c1
+ from tt4x t4 left join tt4x t5 on t4.c2 = t5.c1
+ ) a1 on t3.c2 = a1.c1
+ where t1.c1 = t2.c2
+);
+
+--
+-- regression test for problems of the sort depicted in bug #3494
+--
+
+create temp table tt5(f1 int, f2 int);
+create temp table tt6(f1 int, f2 int);
+
+insert into tt5 values(1, 10);
+insert into tt5 values(1, 11);
+
+insert into tt6 values(1, 9);
+insert into tt6 values(1, 2);
+insert into tt6 values(2, 9);
+
+select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
+
+--
+-- regression test for problems of the sort depicted in bug #3588
+--
+
+create temp table xx (pkxx int);
+create temp table yy (pkyy int, pkxx int);
+
+insert into xx values (1);
+insert into xx values (2);
+insert into xx values (3);
+
+insert into yy values (101, 1);
+insert into yy values (201, 2);
+insert into yy values (301, NULL);
+
+select yy.pkyy as yy_pkyy, yy.pkxx as yy_pkxx, yya.pkyy as yya_pkyy,
+ xxa.pkxx as xxa_pkxx, xxb.pkxx as xxb_pkxx
+from yy
+ left join (SELECT * FROM yy where pkyy = 101) as yya ON yy.pkyy = yya.pkyy
+ left join xx xxa on yya.pkxx = xxa.pkxx
+ left join xx xxb on coalesce (xxa.pkxx, 1) = xxb.pkxx;
+
+--
+-- regression test for improper pushing of constants across outer-join clauses
+-- (as seen in early 8.2.x releases)
+--
+
+create temp table zt1 (f1 int primary key);
+create temp table zt2 (f2 int primary key);
+create temp table zt3 (f3 int primary key);
+insert into zt1 values(53);
+insert into zt2 values(53);
+
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zt1 on (f3 = f1)
+where f2 = 53;
+
+create temp view zv1 as select *,'dummy'::text AS junk from zt1;
+
+select * from
+ zt2 left join zt3 on (f2 = f3)
+ left join zv1 on (f3 = f1)
+where f2 = 53;
+
+--
+-- regression test for improper extraction of OR indexqual conditions
+-- (as seen in early 8.3.x releases)
+--
+
+select a.unique2, a.ten, b.tenthous, b.unique2, b.hundred
+from tenk1 a left join tenk1 b on a.unique2 = b.tenthous
+where a.unique1 = 42 and
+ ((b.unique2 is null and a.ten = 2) or b.hundred = 3);
+
+--
+-- test proper positioning of one-time quals in EXISTS (8.4devel bug)
+--
+prepare foo(bool) as
+ select count(*) from tenk1 a left join tenk1 b
+ on (a.unique2 = b.unique1 and exists
+ (select 1 from tenk1 c where c.thousand = b.unique2 and $1));
+execute foo(true);
+execute foo(false);
+
+--
+-- test for sane behavior with noncanonical merge clauses, per bug #4926
+--
+
+begin;
+
+set enable_mergejoin = 1;
+set enable_hashjoin = 0;
+set enable_nestloop = 0;
+
+create temp table a (i integer);
+create temp table b (x integer, y integer);
+
+select * from a left join b on i = x and i = y and x = i;
+
+rollback;
+
+--
+-- test handling of merge clauses using record_ops
+--
+begin;
+
+create type mycomptype as (id int, v bigint);
+
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+
+set enable_mergejoin = 0;
+set enable_hashjoin = 0;
+
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+
+rollback;
+
+--
+-- test NULL behavior of whole-row Vars, per bug #5025
+--
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join (select * from int8_tbl offset 0) t2 on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+
+select t1.q2, count(t2.*)
+from int8_tbl t1 left join
+ (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2
+ on (t1.q2 = t2.q1)
+group by t1.q2 order by 1;
+
+--
+-- test incorrect failure to NULL pulled-up subexpressions
+--
+begin;
+
+create temp table a (
+ code char not null,
+ constraint a_pk primary key (code)
+);
+create temp table b (
+ a char not null,
+ num integer not null,
+ constraint b_pk primary key (a, num)
+);
+create temp table c (
+ name char not null,
+ a char,
+ constraint c_pk primary key (name)
+);
+
+insert into a (code) values ('p');
+insert into a (code) values ('q');
+insert into b (a, num) values ('p', 1);
+insert into b (a, num) values ('p', 2);
+insert into c (name, a) values ('A', 'p');
+insert into c (name, a) values ('B', 'q');
+insert into c (name, a) values ('C', null);
+
+select c.name, ss.code, ss.b_cnt, ss.const
+from c left join
+ (select a.code, coalesce(b_grp.cnt, 0) as b_cnt, -1 as const
+ from a left join
+ (select count(1) as cnt, b.a from b group by b.a) as b_grp
+ on a.code = b_grp.a
+ ) as ss
+ on (c.a = ss.code)
+order by c.name;
+
+rollback;
+
+--
+-- test incorrect handling of placeholders that only appear in targetlists,
+-- per bug #6154
+--
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, sub4.value2, COALESCE(sub4.value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+
+-- test the path using join aliases, too
+SELECT * FROM
+( SELECT 1 as key1 ) sub1
+LEFT JOIN
+( SELECT sub3.key3, value2, COALESCE(value2, 66) as value3 FROM
+ ( SELECT 1 as key3 ) sub3
+ LEFT JOIN
+ ( SELECT sub5.key5, COALESCE(sub6.value1, 1) as value2 FROM
+ ( SELECT 1 as key5 ) sub5
+ LEFT JOIN
+ ( SELECT 2 as key6, 42 as value1 ) sub6
+ ON sub5.key5 = sub6.key6
+ ) sub4
+ ON sub4.key5 = sub3.key3
+) sub2
+ON sub1.key1 = sub2.key3;
+
+--
+-- test case where a PlaceHolderVar is used as a nestloop parameter
+--
+
+EXPLAIN (COSTS OFF)
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+
+SELECT qq, unique1
+ FROM
+ ( SELECT COALESCE(q1, 0) AS qq FROM int8_tbl a ) AS ss1
+ FULL OUTER JOIN
+ ( SELECT COALESCE(q2, -1) AS qq FROM int8_tbl b ) AS ss2
+ USING (qq)
+ INNER JOIN tenk1 c ON qq = unique2;
+
+--
+-- nested nestloops can require nested PlaceHolderVars
+--
+
+create temp table nt1 (
+ id int primary key,
+ a1 boolean,
+ a2 boolean
+);
+create temp table nt2 (
+ id int primary key,
+ nt1_id int,
+ b1 boolean,
+ b2 boolean,
+ foreign key (nt1_id) references nt1(id)
+);
+create temp table nt3 (
+ id int primary key,
+ nt2_id int,
+ c1 boolean,
+ foreign key (nt2_id) references nt2(id)
+);
+
+insert into nt1 values (1,true,true);
+insert into nt1 values (2,true,false);
+insert into nt1 values (3,false,false);
+insert into nt2 values (1,1,true,true);
+insert into nt2 values (2,2,true,false);
+insert into nt2 values (3,3,false,false);
+insert into nt3 values (1,1,true);
+insert into nt3 values (2,2,false);
+insert into nt3 values (3,3,true);
+
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 and ss1.a3) AS b3
+ from nt2 as nt2
+ left join
+ (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
+ on ss1.id = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+
+--
+-- test case where a PlaceHolderVar is propagated into a subquery
+--
+
+explain (costs off)
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+
+select * from
+ int8_tbl t1 left join
+ (select q1 as x, 42 as y from int8_tbl t2) ss
+ on t1.q2 = ss.x
+where
+ 1 = (select 1 from int8_tbl t3 where ss.y is not null limit 1)
+order by 1,2;
+
+--
+-- variant where a PlaceHolderVar is needed at a join, but not above the join
+--
+
+explain (costs off)
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+
+select * from
+ int4_tbl as i41,
+ lateral
+ (select 1 as x from
+ (select i41.f1 as lat,
+ i42.f1 as loc from
+ int8_tbl as i81, int4_tbl as i42) as ss1
+ right join int4_tbl as i43 on (i43.f1 > 1)
+ where ss1.loc = ss1.lat) as ss2
+where i41.f1 > 0;
+
+--
+-- test the corner cases FULL JOIN ON TRUE and FULL JOIN ON FALSE
+--
+select * from int4_tbl a full join int4_tbl b on true;
+select * from int4_tbl a full join int4_tbl b on false;
+
+--
+-- test for ability to use a cartesian join when necessary
+--
+
+create temp table q1 as select 1 as q1;
+create temp table q2 as select 0 as q2;
+analyze q1;
+analyze q2;
+
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where q1 = thousand or q2 = thousand;
+
+explain (costs off)
+select * from
+ tenk1 join int4_tbl on f1 = twothousand,
+ q1, q2
+where thousand = (q1 + q2);
+
+--
+-- test ability to generate a suitable plan for a star-schema query
+--
+
+explain (costs off)
+select * from
+ tenk1, int8_tbl a, int8_tbl b
+where thousand = a.q1 and tenthous = b.q1 and a.q2 = 1 and b.q2 = 2;
+
+--
+-- test a corner case in which we shouldn't apply the star-schema optimization
+--
+
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (select 1,0 from onerow) v1(x1,x2)
+ left join (select 3,1 from onerow) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+
+-- variant that isn't quite a star-schema case
+
+select ss1.d1 from
+ tenk1 as t1
+ inner join tenk1 as t2
+ on t1.tenthous = t2.ten
+ inner join
+ int8_tbl as i8
+ left join int4_tbl as i4
+ inner join (select 64::information_schema.cardinal_number as d1
+ from tenk1 t3,
+ lateral (select abs(t3.unique1) + random()) ss0(x)
+ where t3.fivethous < 0) as ss1
+ on i4.f1 = ss1.d1
+ on i8.q1 = i4.f1
+ on t1.tenthous = ss1.d1
+where t1.unique1 < i4.f1;
+
+-- this variant is foldable by the remove-useless-RESULT-RTEs code
+
+explain (costs off)
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+
+select t1.unique2, t1.stringu1, t2.unique1, t2.stringu2 from
+ tenk1 t1
+ inner join int4_tbl i1
+ left join (select v1.x2, v2.y1, 11 AS d1
+ from (values(1,0)) v1(x1,x2)
+ left join (values(3,1)) v2(y1,y2)
+ on v1.x1 = v2.y2) subq1
+ on (i1.f1 = subq1.x2)
+ on (t1.unique2 = subq1.d1)
+ left join tenk1 t2
+ on (subq1.y1 = t2.unique1)
+where t1.unique2 < 42 and t1.stringu1 > t2.stringu2;
+
+-- Here's a variant that we can't fold too aggressively, though,
+-- or we end up with noplace to evaluate the lateral PHV
+explain (verbose, costs off)
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+select * from
+ (select 1 as x) ss1 left join (select 2 as y) ss2 on (true),
+ lateral (select ss2.y as z limit 1) ss3;
+
+-- Test proper handling of appendrel PHVs during useless-RTE removal
+explain (costs off)
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+
+select * from
+ (select 0 as z) as t1
+ left join
+ (select true as a) as t2
+ on true,
+ lateral (select true as b
+ union all
+ select a as b) as t3
+where b;
+
+--
+-- test inlining of immutable functions
+--
+create function f_immutable_int4(i integer) returns integer as
+$$ begin return i; end; $$ language plpgsql immutable;
+
+-- check optimization of function scan with join
+explain (costs off)
+select unique1 from tenk1, (select * from f_immutable_int4(1) x) x
+where x = unique1;
+
+explain (verbose, costs off)
+select unique1, x.*
+from tenk1, (select *, random() from f_immutable_int4(1) x) x
+where x = unique1;
+
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = unique1;
+
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x = unique1;
+
+explain (costs off)
+select unique1 from tenk1, lateral f_immutable_int4(1) x where x in (select 17);
+
+explain (costs off)
+select unique1, x from tenk1 join f_immutable_int4(1) x on unique1 = x;
+
+explain (costs off)
+select unique1, x from tenk1 left join f_immutable_int4(1) x on unique1 = x;
+
+explain (costs off)
+select unique1, x from tenk1 right join f_immutable_int4(1) x on unique1 = x;
+
+explain (costs off)
+select unique1, x from tenk1 full join f_immutable_int4(1) x on unique1 = x;
+
+-- check that pullup of a const function allows further const-folding
+explain (costs off)
+select unique1 from tenk1, f_immutable_int4(1) x where x = 42;
+
+-- test inlining of immutable functions with PlaceHolderVars
+explain (costs off)
+select nt3.id
+from nt3 as nt3
+ left join
+ (select nt2.*, (nt2.b1 or i4 = 42) AS b3
+ from nt2 as nt2
+ left join
+ f_immutable_int4(0) i4
+ on i4 = nt2.nt1_id
+ ) as ss2
+ on ss2.id = nt3.nt2_id
+where nt3.id = 1 and ss2.b3;
+
+drop function f_immutable_int4(int);
+
+-- test inlining when function returns composite
+
+create function mki8(bigint, bigint) returns int8_tbl as
+$$select row($1,$2)::int8_tbl$$ language sql;
+
+create function mki4(int) returns int4_tbl as
+$$select row($1)::int4_tbl$$ language sql;
+
+explain (verbose, costs off)
+select * from mki8(1,2);
+select * from mki8(1,2);
+
+explain (verbose, costs off)
+select * from mki4(42);
+select * from mki4(42);
+
+drop function mki8(bigint, bigint);
+drop function mki4(int);
+
+--
+-- test extraction of restriction OR clauses from join OR clause
+-- (we used to only do this for indexable clauses)
+--
+
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.hundred = 4);
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or (a.unique2 = 3 and b.ten = 4);
+explain (costs off)
+select * from tenk1 a join tenk1 b on
+ (a.unique1 = 1 and b.unique1 = 2) or
+ ((a.unique2 = 3 or a.unique2 = 7) and b.hundred = 4);
+
+--
+-- test placement of movable quals in a parameterized join tree
+--
+
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten = t3.ten
+where t1.unique1 = 1;
+
+explain (costs off)
+select * from tenk1 t1 left join
+ (tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
+ on t1.hundred = t2.hundred and t1.ten + t2.ten = t3.ten
+where t1.unique1 = 1;
+
+explain (costs off)
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+
+select count(*) from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on a.unique2 = b.unique1 and c.thousand = a.thousand
+ join int4_tbl on b.thousand = f1;
+
+explain (costs off)
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+
+select b.unique1 from
+ tenk1 a join tenk1 b on a.unique1 = b.unique2
+ left join tenk1 c on b.unique1 = 42 and c.thousand = a.thousand
+ join int4_tbl i1 on b.thousand = f1
+ right join int4_tbl i2 on i2.f1 = b.tenthous
+ order by 1;
+
+explain (costs off)
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+
+select * from
+(
+ select unique1, q1, coalesce(unique1, -1) + q1 as fault
+ from int8_tbl left join tenk1 on (q2 = unique2)
+) ss
+where fault = 122
+order by fault;
+
+explain (costs off)
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+
+select * from
+(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
+left join (values (1, 10), (2, 20)) as v2(v2x,v2y) on v2x = v1x
+left join unnest(v1ys) as u1(u1y) on u1y = v2y;
+
+--
+-- test handling of potential equivalence clauses above outer joins
+--
+
+explain (costs off)
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+
+select q1, unique2, thousand, hundred
+ from int8_tbl a left join tenk1 b on q1 = unique2
+ where coalesce(thousand,123) = q1 and q1 = coalesce(hundred,123);
+
+explain (costs off)
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+
+select f1, unique2, case when unique2 is null then f1 else 0 end
+ from int4_tbl a left join tenk1 b on f1 = unique2
+ where (case when unique2 is null then f1 else 0 end) = 0;
+
+--
+-- another case with equivalence clauses above outer joins (bug #8591)
+--
+
+explain (costs off)
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+
+select a.unique1, b.unique1, c.unique1, coalesce(b.twothousand, a.twothousand)
+ from tenk1 a left join tenk1 b on b.thousand = a.unique1 left join tenk1 c on c.unique2 = coalesce(b.twothousand, a.twothousand)
+ where a.unique2 < 10 and coalesce(b.twothousand, a.twothousand) = 44;
+
+--
+-- check handling of join aliases when flattening multiple levels of subquery
+--
+
+explain (verbose, costs off)
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+
+select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
+ (values (0),(1)) foo1(join_key)
+left join
+ (select join_key, bug_field from
+ (select ss1.join_key, ss1.bug_field from
+ (select f1 as join_key, 666 as bug_field from int4_tbl i1) ss1
+ ) foo2
+ left join
+ (select unique2 as join_key from tenk1 i2) ss2
+ using (join_key)
+ ) foo3
+using (join_key);
+
+--
+-- test successful handling of nested outer joins with degenerate join quals
+--
+
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+explain (verbose, costs off)
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+select t1.* from
+ text_tbl t1
+ left join (select *, '***'::text as d1 from int8_tbl i8b1) b1
+ left join int8_tbl i8
+ left join (select *, null::int as d2 from int8_tbl i8b2, int4_tbl i4b2
+ where q1 = f1) b2
+ on (i8.q1 = b2.q1)
+ on (b2.d2 = b1.q2)
+ on (t1.f1 = b1.d1)
+ left join int4_tbl i4
+ on (i8.q2 = i4.f1);
+
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+
+select * from
+ text_tbl t1
+ inner join int8_tbl i8
+ on i8.q2 = 456
+ right join text_tbl t2
+ on t1.f1 = 'doh!'
+ left join int4_tbl i4
+ on i8.q1 = i4.f1;
+
+--
+-- test for appropriate join order in the presence of lateral references
+--
+
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
+where t1.f1 = ss.f1;
+
+explain (verbose, costs off)
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+
+select * from
+ text_tbl t1
+ left join int8_tbl i8
+ on i8.q2 = 123,
+ lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss1,
+ lateral (select ss1.* from text_tbl t3 limit 1) as ss2
+where t1.f1 = ss2.f1;
+
+explain (verbose, costs off)
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+
+select 1 from
+ text_tbl as tt1
+ inner join text_tbl as tt2 on (tt1.f1 = 'foo')
+ left join text_tbl as tt3 on (tt3.f1 = 'foo')
+ left join text_tbl as tt4 on (tt3.f1 = tt4.f1),
+ lateral (select tt4.f1 as c0 from text_tbl as tt5 limit 1) as ss1
+where tt1.f1 = ss1.c0;
+
+--
+-- check a case in which a PlaceHolderVar forces join order
+--
+
+explain (verbose, costs off)
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+
+select ss2.* from
+ int4_tbl i41
+ left join int8_tbl i8
+ join (select i42.f1 as c1, i43.f1 as c2, 42 as c3
+ from int4_tbl i42, int4_tbl i43) ss1
+ on i8.q1 = ss1.c2
+ on i41.f1 = ss1.c1,
+ lateral (select i41.*, i8.*, ss1.* from text_tbl limit 1) ss2
+where ss1.c2 = 0;
+
+--
+-- test successful handling of full join underneath left join (bug #14105)
+--
+
+explain (costs off)
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+
+select * from
+ (select 1 as id) as xx
+ left join
+ (tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
+ on (xx.id = coalesce(yy.id));
+
+--
+-- test ability to push constants through outer join clauses
+--
+
+explain (costs off)
+ select * from int4_tbl a left join tenk1 b on f1 = unique2 where f1 = 0;
+
+explain (costs off)
+ select * from tenk1 a full join tenk1 b using(unique2) where unique2 = 42;
+
+--
+-- test that quals attached to an outer join have correct semantics,
+-- specifically that they don't re-use expressions computed below the join;
+-- we force a mergejoin so that coalesce(b.q1, 1) appears as a join input
+--
+
+set enable_hashjoin to off;
+set enable_nestloop to off;
+
+explain (verbose, costs off)
+ select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+select a.q2, b.q1
+ from int8_tbl a left join int8_tbl b on a.q2 = coalesce(b.q1, 1)
+ where coalesce(b.q1, 1) > 0;
+
+reset enable_hashjoin;
+reset enable_nestloop;
+
+--
+-- test join removal
+--
+
+begin;
+
+CREATE TEMP TABLE a (id int PRIMARY KEY, b_id int);
+CREATE TEMP TABLE b (id int PRIMARY KEY, c_id int);
+CREATE TEMP TABLE c (id int PRIMARY KEY);
+CREATE TEMP TABLE d (a int, b int);
+INSERT INTO a VALUES (0, 0), (1, NULL);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+INSERT INTO c VALUES (0), (1);
+INSERT INTO d VALUES (1,3), (2,2), (3,1);
+
+-- all three cases should be optimizable into a simple seqscan
+explain (costs off) SELECT a.* FROM a LEFT JOIN b ON a.b_id = b.id;
+explain (costs off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
+explain (costs off)
+ SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
+ ON (a.b_id = b.id);
+
+-- check optimization of outer join within another special join
+explain (costs off)
+select id from a where id in (
+ select b.id from b left join c on b.id = c.id
+);
+
+-- check that join removal works for a left join when joining a subquery
+-- that is guaranteed to be unique by its GROUP BY clause
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id and d.b = s.c_id;
+
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id and d.b = s.c_id;
+
+-- join removal is not possible when the GROUP BY contains a column that is
+-- not in the join condition. (Note: as of 9.6, we notice that b.id is a
+-- primary key and so drop b.c_id from the GROUP BY of the resulting plan;
+-- but this happens too late for join removal in the outer plan level.)
+explain (costs off)
+select d.* from d left join (select * from b group by b.id, b.c_id) s
+ on d.a = s.id;
+
+-- similarly, but keying off a DISTINCT clause
+explain (costs off)
+select d.* from d left join (select distinct * from b) s
+ on d.a = s.id;
+
+-- check join removal works when uniqueness of the join condition is enforced
+-- by a UNION
+explain (costs off)
+select d.* from d left join (select id from a union select id from b) s
+ on d.a = s.id;
+
+-- check join removal with a cross-type comparison operator
+explain (costs off)
+select i8.* from int8_tbl i8 left join (select f1 from int4_tbl group by f1) i4
+ on i8.q1 = i4.f1;
+
+-- check join removal with lateral references
+explain (costs off)
+select 1 from (select a.id FROM a left join b on a.b_id = b.id) q,
+ lateral generate_series(1, q.id) gs(i) where q.id = gs.i;
+
+rollback;
+
+create temp table parent (k int primary key, pd int);
+create temp table child (k int unique, cd int);
+insert into parent values (1, 10), (2, 20), (3, 30);
+insert into child values (1, 100), (4, 400);
+
+-- this case is optimizable
+select p.* from parent p left join child c on (p.k = c.k);
+explain (costs off)
+ select p.* from parent p left join child c on (p.k = c.k);
+
+-- this case is not
+select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+explain (costs off)
+ select p.*, linked from parent p
+ left join (select c.*, true as linked from child c) as ss
+ on (p.k = ss.k);
+
+-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+explain (costs off)
+select p.* from
+ parent p left join child c on (p.k = c.k)
+ where p.k = 1 and p.k = 2;
+
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+explain (costs off)
+select p.* from
+ (parent p left join child c on (p.k = c.k)) join parent x on p.k = x.k
+ where p.k = 1 and p.k = 2;
+
+-- bug 5255: this is not optimizable by join removal
+begin;
+
+CREATE TEMP TABLE a (id int PRIMARY KEY);
+CREATE TEMP TABLE b (id int PRIMARY KEY, a_id int);
+INSERT INTO a VALUES (0), (1);
+INSERT INTO b VALUES (0, 0), (1, NULL);
+
+SELECT * FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+SELECT b.* FROM b LEFT JOIN a ON (b.a_id = a.id) WHERE (a.id IS NULL OR a.id > 0);
+
+rollback;
+
+-- another join removal bug: this is not optimizable, either
+begin;
+
+create temp table innertab (id int8 primary key, dat1 int8);
+insert into innertab values(123, 42);
+
+SELECT * FROM
+ (SELECT 1 AS x) ss1
+ LEFT JOIN
+ (SELECT q1, q2, COALESCE(dat1, q1) AS y
+ FROM int8_tbl LEFT JOIN innertab ON q2 = id) ss2
+ ON true;
+
+rollback;
+
+-- another join removal bug: we must clean up correctly when removing a PHV
+begin;
+
+create temp table uniquetbl (f1 text unique);
+
+explain (costs off)
+select t1.* from
+ uniquetbl as t1
+ left join (select *, '***'::text as d1 from uniquetbl) t2
+ on t1.f1 = t2.f1
+ left join uniquetbl t3
+ on t2.d1 = t3.f1;
+
+explain (costs off)
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+
+select t0.*
+from
+ text_tbl t0
+ left join
+ (select case t1.ten when 0 then 'doh!'::text else null::text end as case1,
+ t1.stringu2
+ from tenk1 t1
+ join int4_tbl i4 ON i4.f1 = t1.unique2
+ left join uniquetbl u1 ON u1.f1 = t1.string4) ss
+ on t0.f1 = ss.case1
+where ss.stringu2 !~* ss.case1;
+
+rollback;
+
+-- test case to expose miscomputation of required relid set for a PHV
+explain (verbose, costs off)
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+
+select i8.*, ss.v, t.unique2
+ from int8_tbl i8
+ left join int4_tbl i4 on i4.f1 = 1
+ left join lateral (select i4.f1 + 1 as v) as ss on true
+ left join tenk1 t on t.unique2 = ss.v
+where q2 = 456;
+
+-- and check a related issue where we miscompute required relids for
+-- a PHV that's been translated to a child rel
+create temp table parttbl (a integer primary key) partition by range (a);
+create temp table parttbl1 partition of parttbl for values from (1) to (100);
+insert into parttbl values (11), (12);
+explain (costs off)
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+
+select * from
+ (select *, 12 as phv from parttbl) as ss
+ right join int4_tbl on true
+where ss.a = ss.phv and f1 = 0;
+
+-- bug #8444: we've historically allowed duplicate aliases within aliased JOINs
+
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = f1; -- error
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = y.f1; -- error
+select * from
+ int8_tbl x join (int4_tbl x cross join int4_tbl y(ff)) j on q1 = f1; -- ok
+
+--
+-- Test hints given on incorrect column references are useful
+--
+
+select t1.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t1" suggestion
+select t2.uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, prefer "t2" suggestion
+select uunique1 from
+ tenk1 t1 join tenk2 t2 on t1.two = t2.two; -- error, suggest both at once
+
+--
+-- Take care to reference the correct RTE
+--
+
+select atts.relid::regclass, s.* from pg_stats s join
+ pg_attribute a on s.attname = a.attname and s.tablename =
+ a.attrelid::regclass::text join (select unnest(indkey) attnum,
+ indexrelid from pg_index i) atts on atts.attnum = a.attnum where
+ schemaname != 'pg_catalog';
+
+--
+-- Test LATERAL
+--
+
+select unique2, x.*
+from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+explain (costs off)
+ select unique2, x.*
+ from tenk1 a, lateral (select * from int4_tbl b where f1 = a.unique1) x;
+select unique2, x.*
+from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x, lateral (select unique2 from tenk1 where f1 = unique1) ss;
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x cross join lateral (select unique2 from tenk1 where f1 = unique1) ss;
+select unique2, x.*
+from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+explain (costs off)
+ select unique2, x.*
+ from int4_tbl x left join lateral (select unique1, unique2 from tenk1 where f1 = unique1) ss on true;
+
+-- check scoping of lateral versus parent references
+-- the first of these should return int8_tbl.q2, the second int8_tbl.q1
+select *, (select r from (select q1 as q2) x, (select q2 as r) y) from int8_tbl;
+select *, (select r from (select q1 as q2) x, lateral (select q2 as r) y) from int8_tbl;
+
+-- lateral with function in FROM
+select count(*) from tenk1 a, lateral generate_series(1,two) g;
+explain (costs off)
+ select count(*) from tenk1 a, lateral generate_series(1,two) g;
+explain (costs off)
+ select count(*) from tenk1 a cross join lateral generate_series(1,two) g;
+-- don't need the explicit LATERAL keyword for functions
+explain (costs off)
+ select count(*) from tenk1 a, generate_series(1,two) g;
+
+-- lateral with UNION ALL subselect
+explain (costs off)
+ select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+select * from generate_series(100,200) g,
+ lateral (select * from int8_tbl a where g = q1 union all
+ select * from int8_tbl b where g = q2) ss;
+
+-- lateral with VALUES
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
+
+-- lateral with VALUES, no flattening possible
+explain (costs off)
+ select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+select count(*) from tenk1 a,
+ tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
+
+-- lateral injecting a strange outer join condition
+explain (costs off)
+ select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+select * from int8_tbl a,
+ int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
+ on x.q2 = ss.z
+ order by a.q1, a.q2, x.q1, x.q2, ss.z;
+
+-- lateral reference to a join alias variable
+select * from (select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (select x) ss2(y);
+select * from (select f1 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1,
+ lateral (values(x)) ss2(y);
+select * from ((select f1/2 as x from int4_tbl) ss1 join int4_tbl i4 on x = f1) j,
+ lateral (select x) ss2(y);
+
+-- lateral references requiring pullup
+select * from (values(1)) x(lb),
+ lateral generate_series(lb,4) x4;
+select * from (select f1/1000000000 from int4_tbl) x(lb),
+ lateral generate_series(lb,4) x4;
+select * from (values(1)) x(lb),
+ lateral (values(lb)) y(lbcopy);
+select * from (values(1)) x(lb),
+ lateral (select lb from int4_tbl) y(lbcopy);
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (values(x.q1,y.q1,y.q2)) v(xq1,yq1,yq2);
+select * from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+select x.* from
+ int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1,
+ lateral (select x.q1,y.q1,y.q2) v(xq1,yq1,yq2);
+select v.* from
+ (int8_tbl x left join (select q1,coalesce(q2,0) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 union all select x.q2,y.q2) v(vx,vy);
+select v.* from
+ (int8_tbl x left join (select q1,(select coalesce(q2,0)) q2 from int8_tbl) y on x.q2 = y.q1)
+ left join int4_tbl z on z.f1 = x.q2,
+ lateral (select x.q1,y.q1 from onerow union all select x.q2,y.q2 from onerow) v(vx,vy);
+
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+select * from
+ int8_tbl a left join
+ lateral (select *, a.q2 as x from int8_tbl b) ss on a.q2 = ss.q1;
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+select * from
+ int8_tbl a left join
+ lateral (select *, coalesce(a.q2, 42) as x from int8_tbl b) ss on a.q2 = ss.q1;
+
+-- lateral can result in join conditions appearing below their
+-- real semantic level
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+select * from int4_tbl i left join
+ lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
+explain (verbose, costs off)
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+select * from int4_tbl i left join
+ lateral (select coalesce(i) from int2_tbl j where i.f1 = j.f1) k on true;
+explain (verbose, costs off)
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+select * from int4_tbl a,
+ lateral (
+ select * from int4_tbl b left join int8_tbl c on (b.f1 = q1 and a.f1 = q2)
+ ) ss;
+
+-- lateral reference in a PlaceHolderVar evaluated at join level
+explain (verbose, costs off)
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+select * from
+ int8_tbl a left join lateral
+ (select b.q1 as bq1, c.q1 as cq1, least(a.q1,b.q1,c.q1) from
+ int8_tbl b cross join int8_tbl c) ss
+ on a.q2 = ss.bq1;
+
+-- case requiring nested PlaceHolderVars
+explain (verbose, costs off)
+select * from
+ int8_tbl c left join (
+ int8_tbl a left join (select q1, coalesce(q2,42) as x from int8_tbl b) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select ss2.y offset 0) ss3;
+
+-- case that breaks the old ph_may_need optimization
+explain (verbose, costs off)
+select c.*,a.*,ss1.q1,ss2.q1,ss3.* from
+ int8_tbl c left join (
+ int8_tbl a left join
+ (select q1, coalesce(q2,f1) as x from int8_tbl b, int4_tbl b2
+ where q1 < f1) ss1
+ on a.q2 = ss1.q1
+ cross join
+ lateral (select q1, coalesce(ss1.x,q2) as y from int8_tbl d) ss2
+ ) on c.q2 = ss2.q1,
+ lateral (select * from int4_tbl i where ss2.y > f1) ss3;
+
+-- check processing of postponed quals (bug #9041)
+explain (verbose, costs off)
+select * from
+ (select 1 as x offset 0) x cross join (select 2 as y offset 0) y
+ left join lateral (
+ select * from (select 3 as z offset 0) z where z.z = x.x
+ ) zz on zz.z = y.y;
+
+-- check dummy rels with lateral references (bug #15694)
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl where false) ss on true;
+explain (verbose, costs off)
+select * from int8_tbl i8 left join lateral
+ (select *, i8.q2 from int4_tbl i1, int4_tbl i2 where false) ss on true;
+
+-- check handling of nested appendrels inside LATERAL
+select * from
+ ((select 2 as v) union all (select 3 as v)) as q1
+ cross join lateral
+ ((select * from
+ ((select 4 as v) union all (select 5 as v)) as q3)
+ union all
+ (select q1.v)
+ ) as q2;
+
+-- check the number of columns specified
+SELECT * FROM (int8_tbl i cross join int4_tbl j) ss(a,b,c,d);
+
+-- check we don't try to do a unique-ified semijoin with LATERAL
+explain (verbose, costs off)
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+select * from
+ (values (0,9998), (1,1000)) v(id,x),
+ lateral (select f1 from int4_tbl
+ where f1 = any (select unique1 from tenk1
+ where unique2 = v.x offset 0)) ss;
+
+-- check proper extParam/allParam handling (this isn't exactly a LATERAL issue,
+-- but we can make the test case much more compact with LATERAL)
+explain (verbose, costs off)
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+
+select * from (values (0), (1)) v(id),
+lateral (select * from int8_tbl t1,
+ lateral (select * from
+ (select * from int8_tbl t2
+ where q1 = any (select q2 from int8_tbl t3
+ where q2 = (select greatest(t1.q1,t2.q2))
+ and (select v.id=0)) offset 0) ss2) ss
+ where t1.q1 = ss.q2) ss0;
+
+-- test some error cases where LATERAL should have been used but wasn't
+select f1,g from int4_tbl a, (select f1 as g) ss;
+select f1,g from int4_tbl a, (select a.f1 as g) ss;
+select f1,g from int4_tbl a cross join (select f1 as g) ss;
+select f1,g from int4_tbl a cross join (select a.f1 as g) ss;
+-- SQL:2008 says the left table is in scope but illegal to access here
+select f1,g from int4_tbl a right join lateral generate_series(0, a.f1) g on true;
+select f1,g from int4_tbl a full join lateral generate_series(0, a.f1) g on true;
+-- check we complain about ambiguous table references
+select * from
+ int8_tbl x cross join (int4_tbl x cross join lateral (select x.f1) ss);
+-- LATERAL can be used to put an aggregate into the FROM clause of its query
+select 1 from tenk1 a, lateral (select max(a.unique1) from int4_tbl b) ss;
+
+-- check behavior of LATERAL in UPDATE/DELETE
+
+create temp table xx1 as select f1 as x1, -f1 as x2 from int4_tbl;
+
+-- error, can't do this:
+update xx1 set x2 = f1 from (select * from int4_tbl where f1 = x1) ss;
+update xx1 set x2 = f1 from (select * from int4_tbl where f1 = xx1.x1) ss;
+-- can't do it even with LATERAL:
+update xx1 set x2 = f1 from lateral (select * from int4_tbl where f1 = x1) ss;
+-- we might in future allow something like this, but for now it's an error:
+update xx1 set x2 = f1 from xx1, lateral (select * from int4_tbl where f1 = x1) ss;
+
+-- also errors:
+delete from xx1 using (select * from int4_tbl where f1 = x1) ss;
+delete from xx1 using (select * from int4_tbl where f1 = xx1.x1) ss;
+delete from xx1 using lateral (select * from int4_tbl where f1 = x1) ss;
+
+--
+-- test LATERAL reference propagation down a multi-level inheritance hierarchy
+-- produced for a multi-level partitioned table hierarchy.
+--
+create table join_pt1 (a int, b int, c varchar) partition by range(a);
+create table join_pt1p1 partition of join_pt1 for values from (0) to (100) partition by range(b);
+create table join_pt1p2 partition of join_pt1 for values from (100) to (200);
+create table join_pt1p1p1 partition of join_pt1p1 for values from (0) to (100);
+insert into join_pt1 values (1, 1, 'x'), (101, 101, 'y');
+create table join_ut1 (a int, b int, c varchar);
+insert into join_ut1 values (101, 101, 'y'), (2, 2, 'z');
+explain (verbose, costs off)
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+select t1.b, ss.phv from join_ut1 t1 left join lateral
+ (select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
+ from join_pt1 t2 join join_ut1 t3 on t2.a = t3.b) ss
+ on t1.a = ss.t2a order by t1.a;
+
+drop table join_pt1;
+drop table join_ut1;
+
+--
+-- test estimation behavior with multi-column foreign key and constant qual
+--
+
+begin;
+
+create table fkest (x integer, x10 integer, x10b integer, x100 integer);
+insert into fkest select x, x/10, x/10, x/100 from generate_series(1,1000) x;
+create unique index on fkest(x, x10, x100);
+analyze fkest;
+
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+
+alter table fkest add constraint fk
+ foreign key (x, x10b, x100) references fkest (x, x10, x100);
+
+explain (costs off)
+select * from fkest f1
+ join fkest f2 on (f1.x = f2.x and f1.x10 = f2.x10b and f1.x100 = f2.x100)
+ join fkest f3 on f1.x = f3.x
+ where f1.x100 = 2;
+
+rollback;
+
+--
+-- test that foreign key join estimation performs sanely for outer joins
+--
+
+begin;
+
+create table fkest (a int, b int, c int unique, primary key(a,b));
+create table fkest1 (a int, b int, primary key(a,b));
+
+insert into fkest select x/10, x%10, x from generate_series(1,1000) x;
+insert into fkest1 select x/10, x%10 from generate_series(1,1000) x;
+
+alter table fkest1
+ add constraint fkest1_a_b_fkey foreign key (a,b) references fkest;
+
+analyze fkest;
+analyze fkest1;
+
+explain (costs off)
+select *
+from fkest f
+ left join fkest1 f1 on f.a = f1.a and f.b = f1.b
+ left join fkest1 f2 on f.a = f2.a and f.b = f2.b
+ left join fkest1 f3 on f.a = f3.a and f.b = f3.b
+where f.c = 1;
+
+rollback;
+
+--
+-- test planner's ability to mark joins as unique
+--
+
+create table j1 (id int primary key);
+create table j2 (id int primary key);
+create table j3 (id int);
+
+insert into j1 values(1),(2),(3);
+insert into j2 values(1),(2),(3);
+insert into j3 values(1),(1);
+
+analyze j1;
+analyze j2;
+analyze j3;
+
+-- ensure join is properly marked as unique
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id = j2.id;
+
+-- ensure join is not unique when not an equi-join
+explain (verbose, costs off)
+select * from j1 inner join j2 on j1.id > j2.id;
+
+-- ensure non-unique rel is not chosen as inner
+explain (verbose, costs off)
+select * from j1 inner join j3 on j1.id = j3.id;
+
+-- ensure left join is marked as unique
+explain (verbose, costs off)
+select * from j1 left join j2 on j1.id = j2.id;
+
+-- ensure right join is marked as unique
+explain (verbose, costs off)
+select * from j1 right join j2 on j1.id = j2.id;
+
+-- ensure full join is marked as unique
+explain (verbose, costs off)
+select * from j1 full join j2 on j1.id = j2.id;
+
+-- a clauseless (cross) join can't be unique
+explain (verbose, costs off)
+select * from j1 cross join j2;
+
+-- ensure a natural join is marked as unique
+explain (verbose, costs off)
+select * from j1 natural join j2;
+
+-- ensure a distinct clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select distinct id from j3) j3 on j1.id = j3.id;
+
+-- ensure group by clause allows the inner to become unique
+explain (verbose, costs off)
+select * from j1
+inner join (select id from j3 group by id) j3 on j1.id = j3.id;
+
+drop table j1;
+drop table j2;
+drop table j3;
+
+-- test more complex permutations of unique joins
+
+create table j1 (id1 int, id2 int, primary key(id1,id2));
+create table j2 (id1 int, id2 int, primary key(id1,id2));
+create table j3 (id1 int, id2 int, primary key(id1,id2));
+
+insert into j1 values(1,1),(1,2);
+insert into j2 values(1,1);
+insert into j3 values(1,1);
+
+analyze j1;
+analyze j2;
+analyze j3;
+
+-- ensure there's no unique join when not all columns which are part of the
+-- unique index are seen in the join clause
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1;
+
+-- ensure proper unique detection with multiple join quals
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2;
+
+-- ensure we don't detect the join to be unique when quals are not part of the
+-- join condition
+explain (verbose, costs off)
+select * from j1
+inner join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+
+-- as above, but for left joins.
+explain (verbose, costs off)
+select * from j1
+left join j2 on j1.id1 = j2.id1 where j1.id2 = 1;
+
+-- validate logic in merge joins which skips mark and restore.
+-- it should only do this if all quals which were used to detect the unique
+-- are present as join quals, and not plain quals.
+set enable_nestloop to 0;
+set enable_hashjoin to 0;
+set enable_sort to 0;
+
+-- create indexes that will be preferred over the PKs to perform the join
+create index j1_id1_idx on j1 (id1) where id1 % 1000 = 1;
+create index j2_id1_idx on j2 (id1) where id1 % 1000 = 1;
+
+-- need an additional row in j2, if we want j2_id1_idx to be preferred
+insert into j2 values(1,2);
+analyze j2;
+
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1;
+
+-- Exercise array keys mark/restore B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 = any (array[1]);
+
+-- Exercise array keys "find extreme element" B-Tree code
+explain (costs off) select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+
+select * from j1
+inner join j2 on j1.id1 = j2.id1 and j1.id2 = j2.id2
+where j1.id1 % 1000 = 1 and j2.id1 % 1000 = 1 and j2.id1 >= any (array[1,5]);
+
+reset enable_nestloop;
+reset enable_hashjoin;
+reset enable_sort;
+
+drop table j1;
+drop table j2;
+drop table j3;
+
+-- check that semijoin inner is not seen as unique for a portion of the outerrel
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from tenk1 t3
+ where t3.thousand = t1.unique1 and t3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+
+-- ... unless it actually is unique
+create table j3 as select unique1, tenthous from onek;
+vacuum analyze j3;
+create unique index on j3(unique1, tenthous);
+
+explain (verbose, costs off)
+select t1.unique1, t2.hundred
+from onek t1, tenk1 t2
+where exists (select 1 from j3
+ where j3.unique1 = t1.unique1 and j3.tenthous = t2.hundred)
+ and t1.unique1 < 1;
+
+drop table j3;
diff --git a/yql/essentials/tests/postgresql/original/cases/json.out b/yql/essentials/tests/postgresql/original/cases/json.out
new file mode 100644
index 0000000000..e9d6e9faf2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/json.out
@@ -0,0 +1,2638 @@
+-- Strings.
+SELECT '""'::json; -- OK.
+ json
+------
+ ""
+(1 row)
+
+SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT $$''$$::json;
+ ^
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+SELECT '"abc"'::json; -- OK
+ json
+-------
+ "abc"
+(1 row)
+
+SELECT '"abc'::json; -- ERROR, quotes not closed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc'::json;
+ ^
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"abc
+def"'::json; -- ERROR, unescaped newline in string constant
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc
+ ^
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"\n\"\\"'::json; -- OK, legal escapes
+ json
+----------
+ "\n\"\\"
+(1 row)
+
+SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\v"'::json;
+ ^
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::json; -- OK
+ json
+------
+ 1
+(1 row)
+
+SELECT '0'::json; -- OK
+ json
+------
+ 0
+(1 row)
+
+SELECT '01'::json; -- ERROR, not valid according to JSON spec
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '01'::json;
+ ^
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+SELECT '0.1'::json; -- OK
+ json
+------
+ 0.1
+(1 row)
+
+SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8
+ json
+---------------------
+ 9223372036854775808
+(1 row)
+
+SELECT '1e100'::json; -- OK
+ json
+-------
+ 1e100
+(1 row)
+
+SELECT '1.3e100'::json; -- OK
+ json
+---------
+ 1.3e100
+(1 row)
+
+SELECT '1f2'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1f2'::json;
+ ^
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+SELECT '0.x1'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '0.x1'::json;
+ ^
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+SELECT '1.3ex100'::json; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1.3ex100'::json;
+ ^
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+-- Arrays.
+SELECT '[]'::json; -- OK
+ json
+------
+ []
+(1 row)
+
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::json; -- OK
+ json
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+(1 row)
+
+SELECT '[1,2]'::json; -- OK
+ json
+-------
+ [1,2]
+(1 row)
+
+SELECT '[1,2,]'::json; -- ERROR, trailing comma
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2,]'::json;
+ ^
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+SELECT '[1,2'::json; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2'::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,[2]'::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+-- Objects.
+SELECT '{}'::json; -- OK
+ json
+------
+ {}
+(1 row)
+
+SELECT '{"abc"}'::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"}'::json;
+ ^
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+SELECT '{"abc":1}'::json; -- OK
+ json
+-----------
+ {"abc":1}
+(1 row)
+
+SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{1:"abc"}'::json;
+ ^
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc",1}'::json;
+ ^
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"=1}'::json;
+ ^
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"::1}'::json;
+ ^
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+ json
+---------------------------------------------------------
+ {"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}
+(1 row)
+
+SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1:2}'::json;
+ ^
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+SELECT '{"abc":1,3}'::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1,3}'::json;
+ ^
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+-- Recursion.
+SET max_stack_depth = '100kB';
+SELECT repeat('[', 10000)::json;
+ERROR: stack depth limit exceeded
+HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+SELECT repeat('{"a":', 10000)::json;
+ERROR: stack depth limit exceeded
+HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+RESET max_stack_depth;
+-- Miscellaneous stuff.
+SELECT 'true'::json; -- OK
+ json
+------
+ true
+(1 row)
+
+SELECT 'false'::json; -- OK
+ json
+-------
+ false
+(1 row)
+
+SELECT 'null'::json; -- OK
+ json
+------
+ null
+(1 row)
+
+SELECT ' true '::json; -- OK, even with extra whitespace
+ json
+--------
+ true
+(1 row)
+
+SELECT 'true false'::json; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true false'::json;
+ ^
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+SELECT 'true, false'::json; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true, false'::json;
+ ^
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+SELECT 'truf'::json; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'truf'::json;
+ ^
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+SELECT 'trues'::json; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'trues'::json;
+ ^
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+SELECT ''::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ''::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+SELECT ' '::json; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ' '::json;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::json; -- OK
+ json
+------------------------------
+ { +
+ "one": 1, +
+ "two":"two",+
+ "three": +
+ true}
+(1 row)
+
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::json;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+-- ERROR missing value for last field
+--constructors
+-- array_to_json
+SELECT array_to_json(array(select 1 as a));
+ array_to_json
+---------------
+ [1]
+(1 row)
+
+SELECT array_to_json(array_agg(q),false) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+ array_to_json
+---------------------------------------------
+ [{"b":1,"c":2},{"b":2,"c":4},{"b":3,"c":6}]
+(1 row)
+
+SELECT array_to_json(array_agg(q),true) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+ array_to_json
+-----------------
+ [{"b":1,"c":2},+
+ {"b":2,"c":4},+
+ {"b":3,"c":6}]
+(1 row)
+
+SELECT array_to_json(array_agg(q),false)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+ array_to_json
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ [{"b":"a1","c":4,"z":[{"f1":1,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]},{"b":"a1","c":5,"z":[{"f1":1,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]},{"b":"a2","c":4,"z":[{"f1":2,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]},{"b":"a2","c":5,"z":[{"f1":2,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}]
+(1 row)
+
+SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x;
+ array_to_json
+----------------
+ [5,6,7,8,9,10]
+(1 row)
+
+SELECT array_to_json('{{1,5},{99,100}}'::int[]);
+ array_to_json
+------------------
+ [[1,5],[99,100]]
+(1 row)
+
+-- row_to_json
+SELECT row_to_json(row(1,'foo'));
+ row_to_json
+---------------------
+ {"f1":1,"f2":"foo"}
+(1 row)
+
+SELECT row_to_json(q)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+ row_to_json
+--------------------------------------------------------------------
+ {"b":"a1","c":4,"z":[{"f1":1,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}
+ {"b":"a1","c":5,"z":[{"f1":1,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}
+ {"b":"a2","c":4,"z":[{"f1":2,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}
+ {"b":"a2","c":5,"z":[{"f1":2,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}
+(4 rows)
+
+SELECT row_to_json(q,true)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+ row_to_json
+-----------------------------------------------------
+ {"b":"a1", +
+ "c":4, +
+ "z":[{"f1":1,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}
+ {"b":"a1", +
+ "c":5, +
+ "z":[{"f1":1,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}
+ {"b":"a2", +
+ "c":4, +
+ "z":[{"f1":2,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}
+ {"b":"a2", +
+ "c":5, +
+ "z":[{"f1":2,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}
+(4 rows)
+
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+SELECT row_to_json(q,true)
+FROM rows q;
+ row_to_json
+--------------
+ {"x":1, +
+ "y":"txt1"}
+ {"x":2, +
+ "y":"txt2"}
+ {"x":3, +
+ "y":"txt3"}
+(3 rows)
+
+SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
+ row_to_json
+-----------------------
+ {"f1":[5,6,7,8,9,10]}
+(1 row)
+
+-- anyarray column
+analyze rows;
+select attname, to_json(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 1;
+ attname | histogram_bounds
+---------+------------------------
+ x | [1,2,3]
+ y | ["txt1","txt2","txt3"]
+(2 rows)
+
+-- to_json, timestamps
+select to_json(timestamp '2014-05-28 12:22:35.614298');
+ to_json
+------------------------------
+ "2014-05-28T12:22:35.614298"
+(1 row)
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ to_json
+------------------------------------
+ "2014-05-29T02:52:35.614298+10:30"
+(1 row)
+
+SET LOCAL TIME ZONE -8;
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+ to_json
+------------------------------------
+ "2014-05-28T08:22:35.614298-08:00"
+(1 row)
+
+COMMIT;
+select to_json(date '2014-05-28');
+ to_json
+--------------
+ "2014-05-28"
+(1 row)
+
+select to_json(date 'Infinity');
+ to_json
+------------
+ "infinity"
+(1 row)
+
+select to_json(date '-Infinity');
+ to_json
+-------------
+ "-infinity"
+(1 row)
+
+select to_json(timestamp 'Infinity');
+ to_json
+------------
+ "infinity"
+(1 row)
+
+select to_json(timestamp '-Infinity');
+ to_json
+-------------
+ "-infinity"
+(1 row)
+
+select to_json(timestamptz 'Infinity');
+ to_json
+------------
+ "infinity"
+(1 row)
+
+select to_json(timestamptz '-Infinity');
+ to_json
+-------------
+ "-infinity"
+(1 row)
+
+--json_agg
+SELECT json_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+ json_agg
+-----------------------------------------------------------------------
+ [{"b":"a1","c":4,"z":[{"f1":1,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}, +
+ {"b":"a1","c":5,"z":[{"f1":1,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}, +
+ {"b":"a2","c":4,"z":[{"f1":2,"f2":[1,2,3]},{"f1":4,"f2":[4,5,6]}]}, +
+ {"b":"a2","c":5,"z":[{"f1":2,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]}]
+(1 row)
+
+SELECT json_agg(q ORDER BY x, y)
+ FROM rows q;
+ json_agg
+-----------------------
+ [{"x":1,"y":"txt1"}, +
+ {"x":2,"y":"txt2"}, +
+ {"x":3,"y":"txt3"}]
+(1 row)
+
+UPDATE rows SET x = NULL WHERE x = 1;
+SELECT json_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+ json_agg
+--------------------------
+ [{"x":null,"y":"txt1"}, +
+ {"x":2,"y":"txt2"}, +
+ {"x":3,"y":"txt3"}]
+(1 row)
+
+-- non-numeric output
+SELECT row_to_json(q)
+FROM (SELECT 'NaN'::float8 AS "float8field") q;
+ row_to_json
+-----------------------
+ {"float8field":"NaN"}
+(1 row)
+
+SELECT row_to_json(q)
+FROM (SELECT 'Infinity'::float8 AS "float8field") q;
+ row_to_json
+----------------------------
+ {"float8field":"Infinity"}
+(1 row)
+
+SELECT row_to_json(q)
+FROM (SELECT '-Infinity'::float8 AS "float8field") q;
+ row_to_json
+-----------------------------
+ {"float8field":"-Infinity"}
+(1 row)
+
+-- json input
+SELECT row_to_json(q)
+FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q;
+ row_to_json
+------------------------------------------------------------------
+ {"jsonfield":{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}}
+(1 row)
+
+-- json extraction functions
+CREATE TEMP TABLE test_json (
+ json_type text,
+ test_json json
+);
+INSERT INTO test_json VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json->'field2'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+ "val2"
+(1 row)
+
+SELECT test_json->>'field2'
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+ val2
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ "two"
+(1 row)
+
+SELECT test_json -> -1
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json->>2
+FROM test_json
+WHERE json_type = 'array';
+ ?column?
+----------
+ two
+(1 row)
+
+SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ 4
+(1 row)
+
+SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object';
+ ?column?
+----------
+ {"f1":9}
+(1 row)
+
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'scalar';
+ERROR: cannot call json_object_keys on a scalar
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'array';
+ERROR: cannot call json_object_keys on an array
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'object';
+ json_object_keys
+------------------
+ field1
+ field2
+ field3
+ field4
+ field5
+ field6
+(6 rows)
+
+-- test extending object_keys resultset - initial resultset size is 256
+select count(*) from
+ (select json_object_keys(json_object(array_agg(g)))
+ from (select unnest(array['f'||n,n::text])as g
+ from generate_series(1,300) as n) x ) y;
+ count
+-------
+ 300
+(1 row)
+
+-- nulls
+select (test_json->'field3') is null as expect_false
+from test_json
+where json_type = 'object';
+ expect_false
+--------------
+ f
+(1 row)
+
+select (test_json->>'field3') is null as expect_true
+from test_json
+where json_type = 'object';
+ expect_true
+-------------
+ t
+(1 row)
+
+select (test_json->3) is null as expect_false
+from test_json
+where json_type = 'array';
+ expect_false
+--------------
+ f
+(1 row)
+
+select (test_json->>3) is null as expect_true
+from test_json
+where json_type = 'array';
+ expect_true
+-------------
+ t
+(1 row)
+
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::json -> 'b';
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::json -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::json ->> 'b';
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+-- array length
+SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+ json_array_length
+-------------------
+ 5
+(1 row)
+
+SELECT json_array_length('[]');
+ json_array_length
+-------------------
+ 0
+(1 row)
+
+SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+ERROR: cannot get array length of a non-array
+SELECT json_array_length('4');
+ERROR: cannot get array length of a scalar
+-- each
+select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+ json_each
+-------------------
+ (f1,"[1,2,3]")
+ (f2,"{""f3"":1}")
+ (f4,null)
+(3 rows)
+
+select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1,2,3]
+ f2 | {"f3":1}
+ f4 | null
+ f5 | 99
+ f6 | "stringy"
+(5 rows)
+
+select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+ json_each_text
+-------------------
+ (f1,"[1,2,3]")
+ (f2,"{""f3"":1}")
+ (f4,)
+ (f5,null)
+(4 rows)
+
+select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+----------
+ f1 | [1,2,3]
+ f2 | {"f3":1}
+ f4 |
+ f5 | 99
+ f6 | stringy
+(5 rows)
+
+-- extract_path, extract_path_as_text
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ json_extract_path
+-------------------
+ "stringy"
+(1 row)
+
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ json_extract_path
+-------------------
+ {"f3":1}
+(1 row)
+
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ json_extract_path
+-------------------
+ "f3"
+(1 row)
+
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ json_extract_path
+-------------------
+ 1
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ json_extract_path_text
+------------------------
+ stringy
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ json_extract_path_text
+------------------------
+ {"f3":1}
+(1 row)
+
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ json_extract_path_text
+------------------------
+ f3
+(1 row)
+
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ json_extract_path_text
+------------------------
+ 1
+(1 row)
+
+-- extract_path nulls
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+-- extract_path operators
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6'];
+ ?column?
+-----------
+ "stringy"
+(1 row)
+
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+ ?column?
+----------
+ {"f3":1}
+(1 row)
+
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+ ?column?
+----------
+ "f3"
+(1 row)
+
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1'];
+ ?column?
+----------
+ 1
+(1 row)
+
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+ ?column?
+----------
+ stringy
+(1 row)
+
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+ ?column?
+----------
+ {"f3":1}
+(1 row)
+
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+ ?column?
+----------
+ f3
+(1 row)
+
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1'];
+ ?column?
+----------
+ 1
+(1 row)
+
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::json #> '{}';
+ ?column?
+---------------------------
+ {"a": {"b":{"c": "foo"}}}
+(1 row)
+
+select '[1,2,3]'::json #> '{}';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+select '"foo"'::json #> '{}';
+ ?column?
+----------
+ "foo"
+(1 row)
+
+select '42'::json #> '{}';
+ ?column?
+----------
+ 42
+(1 row)
+
+select 'null'::json #> '{}';
+ ?column?
+----------
+ null
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+ ?column?
+--------------------
+ {"b":{"c": "foo"}}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+ ?column?
+--------------
+ {"c": "foo"}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+ ?column?
+----------
+ "foo"
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+ ?column?
+----------
+ "cc"
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+ ?column?
+----------
+ "cc"
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::json #> array['z'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::json #> array['f2'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::json #> array['0'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+ ?column?
+---------------------------
+ {"a": {"b":{"c": "foo"}}}
+(1 row)
+
+select '[1,2,3]'::json #>> '{}';
+ ?column?
+----------
+ [1,2,3]
+(1 row)
+
+select '"foo"'::json #>> '{}';
+ ?column?
+----------
+ foo
+(1 row)
+
+select '42'::json #>> '{}';
+ ?column?
+----------
+ 42
+(1 row)
+
+select 'null'::json #>> '{}';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+ ?column?
+--------------------
+ {"b":{"c": "foo"}}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+ ?column?
+--------------
+ {"c": "foo"}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+ ?column?
+----------
+ foo
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+ ?column?
+----------
+ cc
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+ ?column?
+----------
+ cc
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::json #>> array['z'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::json #>> array['f2'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::json #>> array['0'];
+ ?column?
+----------
+
+(1 row)
+
+-- array_elements
+select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ json_array_elements
+-----------------------
+ 1
+ true
+ [1,[2,3]]
+ null
+ {"f1":1,"f2":[7,8,9]}
+ false
+ "stringy"
+(7 rows)
+
+select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+-----------------------
+ 1
+ true
+ [1,[2,3]]
+ null
+ {"f1":1,"f2":[7,8,9]}
+ false
+ "stringy"
+(7 rows)
+
+select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ json_array_elements_text
+--------------------------
+ 1
+ true
+ [1,[2,3]]
+
+ {"f1":1,"f2":[7,8,9]}
+ false
+ stringy
+(7 rows)
+
+select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+-----------------------
+ 1
+ true
+ [1,[2,3]]
+
+ {"f1":1,"f2":[7,8,9]}
+ false
+ stringy
+(7 rows)
+
+-- populate_record
+create type jpop as (a text, b int, c timestamp);
+CREATE DOMAIN js_int_not_null AS int NOT NULL;
+CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+create type j_unordered_pair as (x int, y int);
+create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y);
+CREATE TYPE jsrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d js_int_array_1d,
+ ia2d js_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jpop,
+ reca jpop[]
+);
+CREATE TYPE jsrec_i_not_null AS (
+ i js_int_not_null
+);
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+---
+ blurfl | |
+(1 row)
+
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+---
+ blurfl | |
+(1 row)
+
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q;
+ a | b | c
+-----------------+---+---
+ [100,200,false] | |
+(1 row)
+
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q;
+ a | b | c
+-----------------+---+--------------------------
+ [100,200,false] | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q;
+ERROR: invalid input syntax for type timestamp: "[100,200,false]"
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q;
+ a | b | c
+---+---+--------------------------
+ x | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q;
+ERROR: domain js_int_not_null does not allow null values
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q;
+ERROR: domain js_int_not_null does not allow null values
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q;
+ i
+-------
+ 12345
+(1 row)
+
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q;
+ ia
+----
+
+(1 row)
+
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia".
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
+ ia
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q;
+ ia
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia".
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
+ ia
+---------
+ {1,2,3}
+(1 row)
+
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q;
+ ia1
+-----
+
+(1 row)
+
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia1".
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
+ ia1
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q;
+ ia1
+-----------
+ {{1,2,3}}
+(1 row)
+
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q;
+ ia1d
+------
+
+(1 row)
+
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia1d".
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
+ERROR: value for domain js_int_array_1d violates check constraint "js_int_array_1d_check"
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q;
+ ia1d
+------------
+ {1,2,NULL}
+(1 row)
+
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q;
+ ia2
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+ ia2
+------------------
+ {{1,2},{NULL,4}}
+(1 row)
+
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q;
+ ia2
+-----
+ {}
+(1 row)
+
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia2".
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+ERROR: value for domain js_int_array_2d violates check constraint "js_int_array_2d_check"
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+ ia2d
+----------------------
+ {{1,2,3},{NULL,5,6}}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q;
+ ia3
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+ ia3
+------------------
+ {{1,2},{NULL,4}}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+ ia3
+-----
+ {}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+ ia3
+-------------------
+ {{{1,2}},{{3,4}}}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+ ia3
+-------------------------------
+ {{{1,2},{3,4}},{{5,6},{7,8}}}
+(1 row)
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
+ ta
+----
+
+(1 row)
+
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ta".
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
+ ta
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ta".
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
+ c
+---
+
+(1 row)
+
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q;
+ c
+------------
+ aaa
+(1 row)
+
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q;
+ c
+------------
+ aaaaaaaaaa
+(1 row)
+
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q;
+ERROR: value too long for type character(10)
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q;
+ ca
+----
+
+(1 row)
+
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ca".
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
+ ca
+-----------------------------------------------
+ {"1 ","2 ",NULL,"4 "}
+(1 row)
+
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+ERROR: value too long for type character(10)
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ca".
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
+ js
+----
+
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q;
+ js
+------
+ true
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q;
+ js
+--------
+ 123.45
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q;
+ js
+----------
+ "123.45"
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q;
+ js
+-------
+ "abc"
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+ js
+--------------------------------------
+ [123, "123", null, {"key": "value"}]
+(1 row)
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ js
+--------------------------------------
+ {"a": "bbb", "b": null, "c": 123.45}
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q;
+ jsb
+-----
+
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q;
+ jsb
+------
+ true
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q;
+ jsb
+--------
+ 123.45
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q;
+ jsb
+----------
+ "123.45"
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q;
+ jsb
+-------
+ "abc"
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+ jsb
+--------------------------------------
+ [123, "123", null, {"key": "value"}]
+(1 row)
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ jsb
+--------------------------------------
+ {"a": "bbb", "b": null, "c": 123.45}
+(1 row)
+
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q;
+ jsa
+-----
+
+(1 row)
+
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "jsa".
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
+ jsa
+--------------------
+ {1,"\"2\"",NULL,4}
+(1 row)
+
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+ jsa
+----------------------------------------------------------
+ {"\"aaa\"",NULL,"[1, 2, \"3\", {}]","{ \"k\" : \"v\" }"}
+(1 row)
+
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q;
+ERROR: cannot call populate_composite on a scalar
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q;
+ERROR: cannot call populate_composite on an array
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+ rec
+-----------------------------------
+ (abc,,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+ rec
+-------------------------------------
+ (abc,42,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "reca".
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
+ERROR: cannot call populate_composite on a scalar
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+ reca
+--------------------------------------------------------
+ {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+ reca
+-------------------------------------------
+ {"(abc,42,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+ reca
+-------------------------------------------
+ {"(abc,42,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT rec FROM json_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+ rec
+------------------------------------
+ (abc,3,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+-- anonymous record type
+SELECT json_populate_record(null::record, '{"x": 0, "y": 1}');
+ERROR: could not determine row type for result of json_populate_record
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+ json_populate_record
+----------------------
+ (0,1)
+(1 row)
+
+SELECT * FROM
+ json_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+ x | y
+-----+---
+ 776 |
+(1 row)
+
+-- composite domain
+SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}');
+ json_populate_record
+----------------------
+ (0,1)
+(1 row)
+
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}');
+ json_populate_record
+----------------------
+ (0,2)
+(1 row)
+
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}');
+ERROR: value for domain j_ordered_pair violates check constraint "j_ordered_pair_check"
+-- populate_recordset
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+---------------+----+--------------------------
+ [100,200,300] | 99 |
+ {"z":true} | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ERROR: invalid input syntax for type timestamp: "[100,200,300]"
+create type jpop2 as (a int, b json, c int, d int);
+select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q;
+ a | b | c | d
+---+---------+---+---
+ 2 | {"z":4} | 3 | 6
+(1 row)
+
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+---------------+----+--------------------------
+ [100,200,300] | 99 |
+ {"z":true} | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+-- anonymous record type
+SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+ERROR: could not determine row type for result of json_populate_recordset
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+ json_populate_recordset
+-------------------------
+ (0,1)
+(1 row)
+
+SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+ i | json_populate_recordset
+---+-------------------------
+ 1 | (42,50)
+ 1 | (1,43)
+ 2 | (42,50)
+ 2 | (2,43)
+(4 rows)
+
+SELECT * FROM
+ json_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+ x | y
+-----+---
+ 776 |
+(1 row)
+
+-- empty array is a corner case
+SELECT json_populate_recordset(null::record, '[]');
+ERROR: could not determine row type for result of json_populate_recordset
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT json_populate_recordset(row(1,2), '[]');
+ json_populate_recordset
+-------------------------
+(0 rows)
+
+SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q;
+ a | b | c
+---+---+---
+(0 rows)
+
+SELECT * FROM
+ json_populate_recordset(null::record, '[]') AS (x int, y int);
+ x | y
+---+---
+(0 rows)
+
+-- composite domain
+SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]');
+ json_populate_recordset
+-------------------------
+ (0,1)
+(1 row)
+
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]');
+ json_populate_recordset
+-------------------------
+ (0,2)
+ (1,3)
+(2 rows)
+
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]');
+ERROR: value for domain j_ordered_pair violates check constraint "j_ordered_pair_check"
+-- negative cases where the wrong record type is supplied
+select * from json_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned row contains 1 attribute, but query expects 2.
+select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned type integer at ordinal position 1, but query expects text.
+select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned row contains 3 attributes, but query expects 2.
+select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned type integer at ordinal position 1, but query expects text.
+-- test type info caching in json_populate_record()
+CREATE TEMP TABLE jspoptest (js json);
+INSERT INTO jspoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::json
+FROM generate_series(1, 3);
+SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest;
+ i | ia | ia1 | ia2 | ia3 | ia1d | ia2d | t | ta | c | ca | ts | js | jsb | jsa | rec | reca
+---+----+-----+-----+-----+------+------+---+----+---+----+----+----+-----+--------------------+-----------------------------------+--------------------------------------------------------
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+(3 rows)
+
+DROP TYPE jsrec;
+DROP TYPE jsrec_i_not_null;
+DROP DOMAIN js_int_not_null;
+DROP DOMAIN js_int_array_1d;
+DROP DOMAIN js_int_array_2d;
+DROP DOMAIN j_ordered_pair;
+DROP TYPE j_unordered_pair;
+--json_typeof() function
+select value, json_typeof(value)
+ from (values (json '123.4'),
+ (json '-1'),
+ (json '"foo"'),
+ (json 'true'),
+ (json 'false'),
+ (json 'null'),
+ (json '[1, 2, 3]'),
+ (json '[]'),
+ (json '{"x":"foo", "y":123}'),
+ (json '{}'),
+ (NULL::json))
+ as data(value);
+ value | json_typeof
+----------------------+-------------
+ 123.4 | number
+ -1 | number
+ "foo" | string
+ true | boolean
+ false | boolean
+ null | null
+ [1, 2, 3] | array
+ [] | array
+ {"x":"foo", "y":123} | object
+ {} | object
+ |
+(11 rows)
+
+-- json_build_array, json_build_object, json_object_agg
+SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ json_build_array
+-----------------------------------------------------------------------
+ ["a", 1, "b", 1.2, "c", true, "d", null, "e", {"x": 3, "y": [1,2,3]}]
+(1 row)
+
+SELECT json_build_array('a', NULL); -- ok
+ json_build_array
+------------------
+ ["a", null]
+(1 row)
+
+SELECT json_build_array(VARIADIC NULL::text[]); -- ok
+ json_build_array
+------------------
+
+(1 row)
+
+SELECT json_build_array(VARIADIC '{}'::text[]); -- ok
+ json_build_array
+------------------
+ []
+(1 row)
+
+SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+ json_build_array
+------------------
+ ["a", "b", "c"]
+(1 row)
+
+SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ json_build_array
+------------------
+ ["a", null]
+(1 row)
+
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ json_build_array
+----------------------
+ ["1", "2", "3", "4"]
+(1 row)
+
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ json_build_array
+------------------
+ [1, 2, 3, 4]
+(1 row)
+
+SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ json_build_array
+--------------------
+ [1, 4, 2, 5, 3, 6]
+(1 row)
+
+SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ json_build_object
+----------------------------------------------------------------------------
+ {"a" : 1, "b" : 1.2, "c" : true, "d" : null, "e" : {"x": 3, "y": [1,2,3]}}
+(1 row)
+
+SELECT json_build_object(
+ 'a', json_build_object('b',false,'c',99),
+ 'd', json_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+ json_build_object
+-------------------------------------------------------------------------------------------------
+ {"a" : {"b" : false, "c" : 99}, "d" : {"e" : [9,8,7], "f" : {"relkind":"r","name":"pg_class"}}}
+(1 row)
+
+SELECT json_build_object('{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object('a', 'b', 'c'); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+SELECT json_build_object('a', NULL); -- ok
+ json_build_object
+-------------------
+ {"a" : null}
+(1 row)
+
+SELECT json_build_object(VARIADIC NULL::text[]); -- ok
+ json_build_object
+-------------------
+
+(1 row)
+
+SELECT json_build_object(VARIADIC '{}'::text[]); -- ok
+ json_build_object
+-------------------
+ {}
+(1 row)
+
+SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of json_build_object() must consist of alternating keys and values.
+SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ json_build_object
+-------------------
+ {"a" : null}
+(1 row)
+
+SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ json_build_object
+------------------------
+ {"1" : "2", "3" : "4"}
+(1 row)
+
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ json_build_object
+--------------------
+ {"1" : 2, "3" : 4}
+(1 row)
+
+SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ json_build_object
+-----------------------------
+ {"1" : 4, "2" : 5, "3" : 6}
+(1 row)
+
+-- empty objects/arrays
+SELECT json_build_array();
+ json_build_array
+------------------
+ []
+(1 row)
+
+SELECT json_build_object();
+ json_build_object
+-------------------
+ {}
+(1 row)
+
+-- make sure keys are quoted
+SELECT json_build_object(1,2);
+ json_build_object
+-------------------
+ {"1" : 2}
+(1 row)
+
+-- keys must be scalar and not null
+SELECT json_build_object(null,2);
+ERROR: argument 1 cannot be null
+HINT: Object keys should be text.
+SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object(json '{"a":1,"b":2}', 3);
+ERROR: key value must be scalar, not array, composite, or json
+SELECT json_build_object('{1,2,3}'::int[], 3);
+ERROR: key value must be scalar, not array, composite, or json
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type)))
+FROM foo;
+ json_build_object
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"turbines" : { "847001" : {"name" : "t15", "type" : "GE1043"}, "847002" : {"name" : "t16", "type" : "GE1043"}, "847003" : {"name" : "sub-alpha", "type" : "GESS90"} }}
+(1 row)
+
+SELECT json_object_agg(name, type) FROM foo;
+ json_object_agg
+----------------------------------------------------------------
+ { "t15" : "GE1043", "t16" : "GE1043", "sub-alpha" : "GESS90" }
+(1 row)
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT json_object_agg(name, type) FROM foo;
+ERROR: field name must not be null
+-- json_object
+-- empty object, one dimension
+SELECT json_object('{}');
+ json_object
+-------------
+ {}
+(1 row)
+
+-- empty object, two dimensions
+SELECT json_object('{}', '{}');
+ json_object
+-------------
+ {}
+(1 row)
+
+-- one dimension
+SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+ json_object
+-------------------------------------------------------
+ {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"}
+(1 row)
+
+-- same but with two dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ json_object
+-------------------------------------------------------
+ {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"}
+(1 row)
+
+-- odd number error
+SELECT json_object('{a,b,c}');
+ERROR: array must have even number of elements
+-- one column error
+SELECT json_object('{{a},{b}}');
+ERROR: array must have two columns
+-- too many columns error
+SELECT json_object('{{a,b,c},{b,c,d}}');
+ERROR: array must have two columns
+-- too many dimensions error
+SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+ERROR: wrong number of array subscripts
+--two argument form of json_object
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+ json_object
+------------------------------------------------------
+ {"a" : "1", "b" : "2", "c" : "3", "d e f" : "a b c"}
+(1 row)
+
+-- too many dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ERROR: wrong number of array subscripts
+-- mismatched dimensions
+select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+ERROR: mismatched array dimensions
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ERROR: mismatched array dimensions
+-- null key error
+select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+ERROR: null value not allowed for object key
+-- empty key is allowed
+select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+ json_object
+-----------------------------------------------------
+ {"a" : "1", "b" : "2", "" : "3", "d e f" : "a b c"}
+(1 row)
+
+-- json_to_record and json_to_recordset
+select * from json_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+ a | b | d
+---+-----+---
+ 1 | foo |
+(1 row)
+
+select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+ a | b | c
+---+-----+---
+ 1 | foo |
+ 2 | bar | t
+(2 rows)
+
+select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]')
+ as x(a int, b json, c boolean);
+ a | b | c
+---+-------------+---
+ 1 | {"d":"foo"} | t
+ 2 | {"d":"bar"} | f
+(2 rows)
+
+select *, c is null as c_is_null
+from json_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::json)
+ as t(a int, b json, c text, x int, ca char(5)[], ia int[][], r jpop);
+ a | b | c | x | ca | ia | r | c_is_null
+---+-----------------+---+---+-------------------+---------------+------------+-----------
+ 1 | {"c":16, "d":2} | | 8 | {"1 2 ","3 "} | {{1,2},{3,4}} | (aaa,123,) | t
+(1 row)
+
+select *, c is null as c_is_null
+from json_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::json)
+ as t(a int, b json, c text, x int);
+ a | b | c | x | c_is_null
+---+-----------------+---+---+-----------
+ 1 | {"c":16, "d":2} | | 8 | t
+(1 row)
+
+select * from json_to_record('{"ia": null}') as x(ia _int4);
+ ia
+----
+
+(1 row)
+
+select * from json_to_record('{"ia": 123}') as x(ia _int4);
+ERROR: expected JSON array
+HINT: See the value of key "ia".
+select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+ ia
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+ ia
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia".
+select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+ ia2
+---------
+ {1,2,3}
+(1 row)
+
+select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+ ia2
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+ ia2
+-----------------
+ {{{1},{2},{3}}}
+(1 row)
+
+select * from json_to_record('{"out": {"key": 1}}') as x(out json);
+ out
+------------
+ {"key": 1}
+(1 row)
+
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out json);
+ out
+--------------
+ [{"key": 1}]
+(1 row)
+
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+ out
+----------------
+ "{\"key\": 1}"
+(1 row)
+
+select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb);
+ out
+------------
+ {"key": 1}
+(1 row)
+
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+ out
+--------------
+ [{"key": 1}]
+(1 row)
+
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+ out
+----------------
+ "{\"key\": 1}"
+(1 row)
+
+-- json_strip_nulls
+select json_strip_nulls(null);
+ json_strip_nulls
+------------------
+
+(1 row)
+
+select json_strip_nulls('1');
+ json_strip_nulls
+------------------
+ 1
+(1 row)
+
+select json_strip_nulls('"a string"');
+ json_strip_nulls
+------------------
+ "a string"
+(1 row)
+
+select json_strip_nulls('null');
+ json_strip_nulls
+------------------
+ null
+(1 row)
+
+select json_strip_nulls('[1,2,null,3,4]');
+ json_strip_nulls
+------------------
+ [1,2,null,3,4]
+(1 row)
+
+select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+ json_strip_nulls
+------------------------------------
+ {"a":1,"c":[2,null,3],"d":{"e":4}}
+(1 row)
+
+select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+ json_strip_nulls
+---------------------
+ [1,{"a":1,"c":2},3]
+(1 row)
+
+-- an empty object is not null and should not be stripped
+select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+ json_strip_nulls
+------------------
+ {"a":{},"d":{}}
+(1 row)
+
+-- json to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+ to_tsvector
+---------------------------------------------------------------------------
+ 'aaa':1 'bbb':2 'ccc':4 'ddd':3 'eee':6 'fff':7 'ggg':8 'hhh':10 'iii':11
+(1 row)
+
+-- json to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+ to_tsvector
+---------------------------------------------------------------------------
+ 'aaa':1 'bbb':2 'ccc':4 'ddd':3 'eee':6 'fff':7 'ggg':8 'hhh':10 'iii':11
+(1 row)
+
+-- json to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json);
+ to_tsvector
+----------------------------------------------------------------------------
+ 'aaa':1 'bbb':3 'ccc':5 'ddd':4 'eee':8 'fff':9 'ggg':10 'hhh':12 'iii':13
+(1 row)
+
+-- json to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::json);
+ to_tsvector
+---------------------------------
+ 'aaa':1 'bbb':3 'ccc':5 'ddd':4
+(1 row)
+
+-- json_to_tsvector
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+ json_to_tsvector
+----------------------------------------------------------------------------------------
+ '123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ json_to_tsvector
+--------------------------------
+ 'b':2 'c':4 'd':6 'f':8 'g':10
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ json_to_tsvector
+------------------
+ 'aaa':1 'bbb':3
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ json_to_tsvector
+------------------
+ '123':1 '456':3
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ json_to_tsvector
+-------------------
+ 'fals':3 'true':1
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ json_to_tsvector
+---------------------------------
+ '123':5 '456':7 'aaa':1 'bbb':3
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+ json_to_tsvector
+----------------------------------------------------------------------------------------
+ '123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+ json_to_tsvector
+--------------------------------
+ 'b':2 'c':4 'd':6 'f':8 'g':10
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+ json_to_tsvector
+------------------
+ 'aaa':1 'bbb':3
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+ json_to_tsvector
+------------------
+ '123':1 '456':3
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+ json_to_tsvector
+-------------------
+ 'fals':3 'true':1
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+ json_to_tsvector
+---------------------------------
+ '123':5 '456':7 'aaa':1 'bbb':3
+(1 row)
+
+-- to_tsvector corner cases
+select to_tsvector('""'::json);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('{}'::json);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('[]'::json);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('null'::json);
+ to_tsvector
+-------------
+
+(1 row)
+
+-- json_to_tsvector corner cases
+select json_to_tsvector('""'::json, '"all"');
+ json_to_tsvector
+------------------
+
+(1 row)
+
+select json_to_tsvector('{}'::json, '"all"');
+ json_to_tsvector
+------------------
+
+(1 row)
+
+select json_to_tsvector('[]'::json, '"all"');
+ json_to_tsvector
+------------------
+
+(1 row)
+
+select json_to_tsvector('null'::json, '"all"');
+ json_to_tsvector
+------------------
+
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""');
+ERROR: wrong flag in flag array: ""
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}');
+ERROR: wrong flag type, only arrays and scalars are allowed
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]');
+ json_to_tsvector
+------------------
+
+(1 row)
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null');
+ERROR: flag array element is not a string
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
+ERROR: flag array element is not a string
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+-- ts_headline for json
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ts_headline
+---------------------------------------------------------------------------------------------------------
+ {"a":"aaa <b>bbb</b>","b":{"c":"ccc <b>ddd</b> fff","c1":"ccc1 ddd1"},"d":["ggg <b>hhh</b>","iii jjj"]}
+(1 row)
+
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+ ts_headline
+----------------------------------------------------------------------------------------
+ {"a":"aaa <b>bbb</b>","b":{"c":"ccc <b>ddd</b> fff"},"d":["ggg <b>hhh</b>","iii jjj"]}
+(1 row)
+
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ts_headline
+------------------------------------------------------------------------------------------
+ {"a":"aaa <bbb>","b":{"c":"ccc <ddd> fff","c1":"ccc1 ddd1"},"d":["ggg <hhh>","iii jjj"]}
+(1 row)
+
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ts_headline
+------------------------------------------------------------------------------------------
+ {"a":"aaa <bbb>","b":{"c":"ccc <ddd> fff","c1":"ccc1 ddd1"},"d":["ggg <hhh>","iii jjj"]}
+(1 row)
+
+-- corner cases for ts_headline with json
+select ts_headline('null'::json, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ null
+(1 row)
+
+select ts_headline('{}'::json, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ {}
+(1 row)
+
+select ts_headline('[]'::json, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ []
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/json.sql b/yql/essentials/tests/postgresql/original/cases/json.sql
new file mode 100644
index 0000000000..e366c6f51b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/json.sql
@@ -0,0 +1,852 @@
+-- Strings.
+SELECT '""'::json; -- OK.
+SELECT $$''$$::json; -- ERROR, single quotes are not allowed
+SELECT '"abc"'::json; -- OK
+SELECT '"abc'::json; -- ERROR, quotes not closed
+SELECT '"abc
+def"'::json; -- ERROR, unescaped newline in string constant
+SELECT '"\n\"\\"'::json; -- OK, legal escapes
+SELECT '"\v"'::json; -- ERROR, not a valid JSON escape
+-- see json_encoding test for input with unicode escapes
+
+-- Numbers.
+SELECT '1'::json; -- OK
+SELECT '0'::json; -- OK
+SELECT '01'::json; -- ERROR, not valid according to JSON spec
+SELECT '0.1'::json; -- OK
+SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8
+SELECT '1e100'::json; -- OK
+SELECT '1.3e100'::json; -- OK
+SELECT '1f2'::json; -- ERROR
+SELECT '0.x1'::json; -- ERROR
+SELECT '1.3ex100'::json; -- ERROR
+
+-- Arrays.
+SELECT '[]'::json; -- OK
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::json; -- OK
+SELECT '[1,2]'::json; -- OK
+SELECT '[1,2,]'::json; -- ERROR, trailing comma
+SELECT '[1,2'::json; -- ERROR, no closing bracket
+SELECT '[1,[2]'::json; -- ERROR, no closing bracket
+
+-- Objects.
+SELECT '{}'::json; -- OK
+SELECT '{"abc"}'::json; -- ERROR, no value
+SELECT '{"abc":1}'::json; -- OK
+SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings
+SELECT '{"abc",1}'::json; -- ERROR, wrong separator
+SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator
+SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+SELECT '{"abc":1,3}'::json; -- ERROR, no value
+
+-- Recursion.
+SET max_stack_depth = '100kB';
+SELECT repeat('[', 10000)::json;
+SELECT repeat('{"a":', 10000)::json;
+RESET max_stack_depth;
+
+-- Miscellaneous stuff.
+SELECT 'true'::json; -- OK
+SELECT 'false'::json; -- OK
+SELECT 'null'::json; -- OK
+SELECT ' true '::json; -- OK, even with extra whitespace
+SELECT 'true false'::json; -- ERROR, too many values
+SELECT 'true, false'::json; -- ERROR, too many values
+SELECT 'truf'::json; -- ERROR, not a keyword
+SELECT 'trues'::json; -- ERROR, not a keyword
+SELECT ''::json; -- ERROR, no value
+SELECT ' '::json; -- ERROR, no value
+
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::json; -- OK
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::json;
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json;
+-- ERROR missing value for last field
+
+--constructors
+-- array_to_json
+
+SELECT array_to_json(array(select 1 as a));
+SELECT array_to_json(array_agg(q),false) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+SELECT array_to_json(array_agg(q),true) from (select x as b, x * 2 as c from generate_series(1,3) x) q;
+SELECT array_to_json(array_agg(q),false)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x;
+SELECT array_to_json('{{1,5},{99,100}}'::int[]);
+
+-- row_to_json
+SELECT row_to_json(row(1,'foo'));
+
+SELECT row_to_json(q)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+
+SELECT row_to_json(q,true)
+FROM (SELECT $$a$$ || x AS b,
+ y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+
+SELECT row_to_json(q,true)
+FROM rows q;
+
+SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
+
+-- anyarray column
+
+analyze rows;
+
+select attname, to_json(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 1;
+
+-- to_json, timestamps
+
+select to_json(timestamp '2014-05-28 12:22:35.614298');
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+SET LOCAL TIME ZONE -8;
+select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
+COMMIT;
+
+select to_json(date '2014-05-28');
+
+select to_json(date 'Infinity');
+select to_json(date '-Infinity');
+select to_json(timestamp 'Infinity');
+select to_json(timestamp '-Infinity');
+select to_json(timestamptz 'Infinity');
+select to_json(timestamptz '-Infinity');
+
+--json_agg
+
+SELECT json_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+
+SELECT json_agg(q ORDER BY x, y)
+ FROM rows q;
+
+UPDATE rows SET x = NULL WHERE x = 1;
+
+SELECT json_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+
+-- non-numeric output
+SELECT row_to_json(q)
+FROM (SELECT 'NaN'::float8 AS "float8field") q;
+
+SELECT row_to_json(q)
+FROM (SELECT 'Infinity'::float8 AS "float8field") q;
+
+SELECT row_to_json(q)
+FROM (SELECT '-Infinity'::float8 AS "float8field") q;
+
+-- json input
+SELECT row_to_json(q)
+FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q;
+
+
+-- json extraction functions
+
+CREATE TEMP TABLE test_json (
+ json_type text,
+ test_json json
+);
+
+INSERT INTO test_json VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'scalar';
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'array';
+
+SELECT test_json -> 'x'
+FROM test_json
+WHERE json_type = 'object';
+
+SELECT test_json->'field2'
+FROM test_json
+WHERE json_type = 'object';
+
+SELECT test_json->>'field2'
+FROM test_json
+WHERE json_type = 'object';
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'scalar';
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'array';
+
+SELECT test_json -> -1
+FROM test_json
+WHERE json_type = 'array';
+
+SELECT test_json -> 2
+FROM test_json
+WHERE json_type = 'object';
+
+SELECT test_json->>2
+FROM test_json
+WHERE json_type = 'array';
+
+SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array';
+SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array';
+
+SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object';
+SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object';
+SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object';
+
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'scalar';
+
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'array';
+
+SELECT json_object_keys(test_json)
+FROM test_json
+WHERE json_type = 'object';
+
+-- test extending object_keys resultset - initial resultset size is 256
+
+select count(*) from
+ (select json_object_keys(json_object(array_agg(g)))
+ from (select unnest(array['f'||n,n::text])as g
+ from generate_series(1,300) as n) x ) y;
+
+-- nulls
+
+select (test_json->'field3') is null as expect_false
+from test_json
+where json_type = 'object';
+
+select (test_json->>'field3') is null as expect_true
+from test_json
+where json_type = 'object';
+
+select (test_json->3) is null as expect_false
+from test_json
+where json_type = 'array';
+
+select (test_json->>3) is null as expect_true
+from test_json
+where json_type = 'array';
+
+-- corner cases
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> '';
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z';
+select '{"a": "c", "b": null}'::json -> 'b';
+select '"foo"'::json -> 1;
+select '"foo"'::json -> 'z';
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> '';
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z';
+select '{"a": "c", "b": null}'::json ->> 'b';
+select '"foo"'::json ->> 1;
+select '"foo"'::json ->> 'z';
+
+-- array length
+
+SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+
+SELECT json_array_length('[]');
+
+SELECT json_array_length('{"f1":1,"f2":[5,6]}');
+
+SELECT json_array_length('4');
+
+-- each
+
+select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+
+select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+
+-- extract_path, extract_path_as_text
+
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+
+-- extract_path nulls
+
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false;
+select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true;
+select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false;
+select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true;
+
+-- extract_path operators
+
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6'];
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2'];
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0'];
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1'];
+
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6'];
+select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2'];
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0'];
+select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1'];
+
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::json #> '{}';
+select '[1,2,3]'::json #> '{}';
+select '"foo"'::json #> '{}';
+select '42'::json #> '{}';
+select 'null'::json #> '{}';
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a'];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', ''];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b'];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c'];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d'];
+select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b'];
+select '[{"b": "c"}, {"b": null}]'::json #> array['1','b'];
+select '"foo"'::json #> array['z'];
+select '42'::json #> array['f2'];
+select '42'::json #> array['0'];
+
+select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}';
+select '[1,2,3]'::json #>> '{}';
+select '"foo"'::json #>> '{}';
+select '42'::json #>> '{}';
+select 'null'::json #>> '{}';
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a'];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', ''];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b'];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c'];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d'];
+select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b'];
+select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b'];
+select '"foo"'::json #>> array['z'];
+select '42'::json #>> array['f2'];
+select '42'::json #>> array['0'];
+
+-- array_elements
+
+select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+
+-- populate_record
+create type jpop as (a text, b int, c timestamp);
+
+CREATE DOMAIN js_int_not_null AS int NOT NULL;
+CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+
+create type j_unordered_pair as (x int, y int);
+create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y);
+
+CREATE TYPE jsrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d js_int_array_1d,
+ ia2d js_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jpop,
+ reca jpop[]
+);
+
+CREATE TYPE jsrec_i_not_null AS (
+ i js_int_not_null
+);
+
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+
+select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q;
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q;
+
+select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q;
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q;
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q;
+
+select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q;
+
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q;
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q;
+SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q;
+
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q;
+SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q;
+
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q;
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q;
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q;
+SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q;
+
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q;
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q;
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q;
+SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q;
+
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q;
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q;
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q;
+SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q;
+
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q;
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q;
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q;
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q;
+SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q;
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q;
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q;
+SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q;
+
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q;
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q;
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q;
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q;
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q;
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q;
+SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q;
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q;
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q;
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q;
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+
+SELECT rec FROM json_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+
+-- anonymous record type
+SELECT json_populate_record(null::record, '{"x": 0, "y": 1}');
+SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+SELECT * FROM
+ json_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+
+-- composite domain
+SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}');
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}');
+SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}');
+
+-- populate_recordset
+
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+
+create type jpop2 as (a int, b json, c int, d int);
+select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q;
+
+select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+
+-- anonymous record type
+SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+SELECT * FROM
+ json_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+
+-- empty array is a corner case
+SELECT json_populate_recordset(null::record, '[]');
+SELECT json_populate_recordset(row(1,2), '[]');
+SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q;
+SELECT * FROM
+ json_populate_recordset(null::record, '[]') AS (x int, y int);
+
+-- composite domain
+SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]');
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]');
+SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]');
+
+-- negative cases where the wrong record type is supplied
+select * from json_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+
+-- test type info caching in json_populate_record()
+CREATE TEMP TABLE jspoptest (js json);
+
+INSERT INTO jspoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::json
+FROM generate_series(1, 3);
+
+SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest;
+
+DROP TYPE jsrec;
+DROP TYPE jsrec_i_not_null;
+DROP DOMAIN js_int_not_null;
+DROP DOMAIN js_int_array_1d;
+DROP DOMAIN js_int_array_2d;
+DROP DOMAIN j_ordered_pair;
+DROP TYPE j_unordered_pair;
+
+--json_typeof() function
+select value, json_typeof(value)
+ from (values (json '123.4'),
+ (json '-1'),
+ (json '"foo"'),
+ (json 'true'),
+ (json 'false'),
+ (json 'null'),
+ (json '[1, 2, 3]'),
+ (json '[]'),
+ (json '{"x":"foo", "y":123}'),
+ (json '{}'),
+ (NULL::json))
+ as data(value);
+
+-- json_build_array, json_build_object, json_object_agg
+
+SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+SELECT json_build_array('a', NULL); -- ok
+SELECT json_build_array(VARIADIC NULL::text[]); -- ok
+SELECT json_build_array(VARIADIC '{}'::text[]); -- ok
+SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+
+SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+
+SELECT json_build_object(
+ 'a', json_build_object('b',false,'c',99),
+ 'd', json_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+SELECT json_build_object('{a,b,c}'::text[]); -- error
+SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+SELECT json_build_object('a', 'b', 'c'); -- error
+SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL
+SELECT json_build_object('a', NULL); -- ok
+SELECT json_build_object(VARIADIC NULL::text[]); -- ok
+SELECT json_build_object(VARIADIC '{}'::text[]); -- ok
+SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+
+-- empty objects/arrays
+SELECT json_build_array();
+
+SELECT json_build_object();
+
+-- make sure keys are quoted
+SELECT json_build_object(1,2);
+
+-- keys must be scalar and not null
+SELECT json_build_object(null,2);
+
+SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+
+SELECT json_build_object(json '{"a":1,"b":2}', 3);
+
+SELECT json_build_object('{1,2,3}'::int[], 3);
+
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+
+SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type)))
+FROM foo;
+
+SELECT json_object_agg(name, type) FROM foo;
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT json_object_agg(name, type) FROM foo;
+
+-- json_object
+
+-- empty object, one dimension
+SELECT json_object('{}');
+
+-- empty object, two dimensions
+SELECT json_object('{}', '{}');
+
+-- one dimension
+SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+
+-- same but with two dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+
+-- odd number error
+SELECT json_object('{a,b,c}');
+
+-- one column error
+SELECT json_object('{{a},{b}}');
+
+-- too many columns error
+SELECT json_object('{{a,b,c},{b,c,d}}');
+
+-- too many dimensions error
+SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+
+--two argument form of json_object
+
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+
+-- too many dimensions
+SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+
+-- mismatched dimensions
+
+select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+
+select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+
+-- null key error
+
+select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+
+-- empty key is allowed
+
+select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+
+
+-- json_to_record and json_to_recordset
+
+select * from json_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+
+select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+
+select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]')
+ as x(a int, b json, c boolean);
+
+select *, c is null as c_is_null
+from json_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::json)
+ as t(a int, b json, c text, x int, ca char(5)[], ia int[][], r jpop);
+
+select *, c is null as c_is_null
+from json_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::json)
+ as t(a int, b json, c text, x int);
+
+select * from json_to_record('{"ia": null}') as x(ia _int4);
+select * from json_to_record('{"ia": 123}') as x(ia _int4);
+select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+
+select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+
+select * from json_to_record('{"out": {"key": 1}}') as x(out json);
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out json);
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb);
+select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+
+-- json_strip_nulls
+
+select json_strip_nulls(null);
+
+select json_strip_nulls('1');
+
+select json_strip_nulls('"a string"');
+
+select json_strip_nulls('null');
+
+select json_strip_nulls('[1,2,null,3,4]');
+
+select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+
+select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+
+-- an empty object is not null and should not be stripped
+select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+
+-- json to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+
+-- json to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json);
+
+-- json to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json);
+
+-- json to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::json);
+
+-- json_to_tsvector
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]');
+
+-- to_tsvector corner cases
+select to_tsvector('""'::json);
+select to_tsvector('{}'::json);
+select to_tsvector('[]'::json);
+select to_tsvector('null'::json);
+
+-- json_to_tsvector corner cases
+select json_to_tsvector('""'::json, '"all"');
+select json_to_tsvector('{}'::json, '"all"');
+select json_to_tsvector('[]'::json, '"all"');
+select json_to_tsvector('null'::json, '"all"');
+
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null');
+select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
+
+-- ts_headline for json
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'));
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+
+-- corner cases for ts_headline with json
+select ts_headline('null'::json, tsquery('aaa & bbb'));
+select ts_headline('{}'::json, tsquery('aaa & bbb'));
+select ts_headline('[]'::json, tsquery('aaa & bbb'));
diff --git a/yql/essentials/tests/postgresql/original/cases/json_encoding.out b/yql/essentials/tests/postgresql/original/cases/json_encoding.out
new file mode 100644
index 0000000000..f343f74fe1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/json_encoding.out
@@ -0,0 +1,262 @@
+--
+-- encoding-sensitive tests for json and jsonb
+--
+-- We provide expected-results files for UTF8 (json_encoding.out)
+-- and for SQL_ASCII (json_encoding_1.out). Skip otherwise.
+SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+ AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+---------------------
+ UTF8
+(1 row)
+
+-- first json
+-- basic unicode input
+SELECT '"\u"'::json; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+SELECT '"\u00"'::json; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u00"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u000g"'::json;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+SELECT '"\u0000"'::json; -- OK, legal escape
+ json
+----------
+ "\u0000"
+(1 row)
+
+SELECT '"\uaBcD"'::json; -- OK, uppercase and lower case both OK
+ json
+----------
+ "\uaBcD"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select json '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------------
+ "\ud83d\ude04\ud83d\udc36"
+(1 row)
+
+select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type json
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ERROR: invalid input syntax for type json
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+--handling of simple unicode escapes
+select json '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+ correct_in_utf8
+---------------------------------------
+ { "a": "the Copyright \u00a9 sign" }
+(1 row)
+
+select json '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+ correct_everywhere
+-------------------------------------
+ { "a": "dollar \u0024 character" }
+(1 row)
+
+select json '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+ not_an_escape
+--------------------------------------
+ { "a": "dollar \\u0024 character" }
+(1 row)
+
+select json '{ "a": "null \u0000 escape" }' as not_unescaped;
+ not_unescaped
+--------------------------------
+ { "a": "null \u0000 escape" }
+(1 row)
+
+select json '{ "a": "null \\u0000 escape" }' as not_an_escape;
+ not_an_escape
+---------------------------------
+ { "a": "null \\u0000 escape" }
+(1 row)
+
+select json '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------
+ the Copyright © sign
+(1 row)
+
+select json '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+ correct_everywhere
+--------------------
+ dollar $ character
+(1 row)
+
+select json '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+ not_an_escape
+-------------------------
+ dollar \u0024 character
+(1 row)
+
+select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ERROR: unsupported Unicode escape sequence
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+select json '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+ not_an_escape
+--------------------
+ null \u0000 escape
+(1 row)
+
+-- then jsonb
+-- basic unicode input
+SELECT '"\u"'::jsonb; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u"
+SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u00"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u00"
+SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\u000g"'::jsonb;
+ ^
+DETAIL: "\u" must be followed by four hexadecimal digits.
+CONTEXT: JSON data, line 1: "\u000g...
+SELECT '"\u0045"'::jsonb; -- OK, legal escape
+ jsonb
+-------
+ "E"
+(1 row)
+
+SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '"\u0000"'::jsonb;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: ...
+-- use octet_length here so we don't get an odd unicode char in the
+-- output
+SELECT octet_length('"\uaBcD"'::jsonb::text); -- OK, uppercase and lower case both OK
+ octet_length
+--------------
+ 5
+(1 row)
+
+-- handling of unicode surrogate pairs
+SELECT octet_length((jsonb '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a')::text) AS correct_in_utf8;
+ correct_in_utf8
+-----------------
+ 10
+(1 row)
+
+SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a';
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ud83dX" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+ERROR: invalid input syntax for type json
+LINE 1: SELECT jsonb '{ "a": "\ude04X" }' -> 'a';
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+CONTEXT: JSON data, line 1: { "a":...
+-- handling of simple unicode escapes
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+ correct_in_utf8
+-------------------------------
+ {"a": "the Copyright © sign"}
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+ correct_everywhere
+-----------------------------
+ {"a": "dollar $ character"}
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+ not_an_escape
+-----------------------------------
+ {"a": "dollar \\u0024 character"}
+(1 row)
+
+SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "null \\u0000 escape" }' as not_an_escape;
+ not_an_escape
+------------------------------
+ {"a": "null \\u0000 escape"}
+(1 row)
+
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+ correct_in_utf8
+----------------------
+ the Copyright © sign
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+ correct_everywhere
+--------------------
+ dollar $ character
+(1 row)
+
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+ not_an_escape
+-------------------------
+ dollar \u0024 character
+(1 row)
+
+SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fai...
+ ^
+DETAIL: \u0000 cannot be converted to text.
+CONTEXT: JSON data, line 1: { "a":...
+SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+ not_an_escape
+--------------------
+ null \u0000 escape
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/json_encoding.sql b/yql/essentials/tests/postgresql/original/cases/json_encoding.sql
new file mode 100644
index 0000000000..d7fac69733
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/json_encoding.sql
@@ -0,0 +1,78 @@
+--
+-- encoding-sensitive tests for json and jsonb
+--
+
+-- We provide expected-results files for UTF8 (json_encoding.out)
+-- and for SQL_ASCII (json_encoding_1.out). Skip otherwise.
+SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+ AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+
+SELECT getdatabaseencoding(); -- just to label the results files
+
+-- first json
+
+-- basic unicode input
+SELECT '"\u"'::json; -- ERROR, incomplete escape
+SELECT '"\u00"'::json; -- ERROR, incomplete escape
+SELECT '"\u000g"'::json; -- ERROR, g is not a hex digit
+SELECT '"\u0000"'::json; -- OK, legal escape
+SELECT '"\uaBcD"'::json; -- OK, uppercase and lower case both OK
+
+-- handling of unicode surrogate pairs
+
+select json '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
+select json '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+select json '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+select json '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+select json '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+
+--handling of simple unicode escapes
+
+select json '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+select json '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+select json '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+select json '{ "a": "null \u0000 escape" }' as not_unescaped;
+select json '{ "a": "null \\u0000 escape" }' as not_an_escape;
+
+select json '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+select json '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+select json '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+select json '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+select json '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
+
+-- then jsonb
+
+-- basic unicode input
+SELECT '"\u"'::jsonb; -- ERROR, incomplete escape
+SELECT '"\u00"'::jsonb; -- ERROR, incomplete escape
+SELECT '"\u000g"'::jsonb; -- ERROR, g is not a hex digit
+SELECT '"\u0045"'::jsonb; -- OK, legal escape
+SELECT '"\u0000"'::jsonb; -- ERROR, we don't support U+0000
+-- use octet_length here so we don't get an odd unicode char in the
+-- output
+SELECT octet_length('"\uaBcD"'::jsonb::text); -- OK, uppercase and lower case both OK
+
+-- handling of unicode surrogate pairs
+
+SELECT octet_length((jsonb '{ "a": "\ud83d\ude04\ud83d\udc36" }' -> 'a')::text) AS correct_in_utf8;
+SELECT jsonb '{ "a": "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
+SELECT jsonb '{ "a": "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
+SELECT jsonb '{ "a": "\ud83dX" }' -> 'a'; -- orphan high surrogate
+SELECT jsonb '{ "a": "\ude04X" }' -> 'a'; -- orphan low surrogate
+
+-- handling of simple unicode escapes
+
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' as correct_in_utf8;
+SELECT jsonb '{ "a": "dollar \u0024 character" }' as correct_everywhere;
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' as not_an_escape;
+SELECT jsonb '{ "a": "null \u0000 escape" }' as fails;
+SELECT jsonb '{ "a": "null \\u0000 escape" }' as not_an_escape;
+
+SELECT jsonb '{ "a": "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
+SELECT jsonb '{ "a": "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
+SELECT jsonb '{ "a": "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
+SELECT jsonb '{ "a": "null \u0000 escape" }' ->> 'a' as fails;
+SELECT jsonb '{ "a": "null \\u0000 escape" }' ->> 'a' as not_an_escape;
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonb.out b/yql/essentials/tests/postgresql/original/cases/jsonb.out
new file mode 100644
index 0000000000..a9cd145aec
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonb.out
@@ -0,0 +1,5511 @@
+-- Strings.
+SELECT '""'::jsonb; -- OK.
+ jsonb
+-------
+ ""
+(1 row)
+
+SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT $$''$$::jsonb;
+ ^
+DETAIL: Token "'" is invalid.
+CONTEXT: JSON data, line 1: '...
+SELECT '"abc"'::jsonb; -- OK
+ jsonb
+-------
+ "abc"
+(1 row)
+
+SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc'::jsonb;
+ ^
+DETAIL: Token ""abc" is invalid.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"abc
+def"'::jsonb; -- ERROR, unescaped newline in string constant
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"abc
+ ^
+DETAIL: Character with value 0x0a must be escaped.
+CONTEXT: JSON data, line 1: "abc
+SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
+ jsonb
+----------
+ "\n\"\\"
+(1 row)
+
+SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '"\v"'::jsonb;
+ ^
+DETAIL: Escape sequence "\v" is invalid.
+CONTEXT: JSON data, line 1: "\v...
+-- see json_encoding test for input with unicode escapes
+-- Numbers.
+SELECT '1'::jsonb; -- OK
+ jsonb
+-------
+ 1
+(1 row)
+
+SELECT '0'::jsonb; -- OK
+ jsonb
+-------
+ 0
+(1 row)
+
+SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '01'::jsonb;
+ ^
+DETAIL: Token "01" is invalid.
+CONTEXT: JSON data, line 1: 01
+SELECT '0.1'::jsonb; -- OK
+ jsonb
+-------
+ 0.1
+(1 row)
+
+SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8
+ jsonb
+---------------------
+ 9223372036854775808
+(1 row)
+
+SELECT '1e100'::jsonb; -- OK
+ jsonb
+-------------------------------------------------------------------------------------------------------
+ 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+(1 row)
+
+SELECT '1.3e100'::jsonb; -- OK
+ jsonb
+-------------------------------------------------------------------------------------------------------
+ 13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+(1 row)
+
+SELECT '1f2'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1f2'::jsonb;
+ ^
+DETAIL: Token "1f2" is invalid.
+CONTEXT: JSON data, line 1: 1f2
+SELECT '0.x1'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '0.x1'::jsonb;
+ ^
+DETAIL: Token "0.x1" is invalid.
+CONTEXT: JSON data, line 1: 0.x1
+SELECT '1.3ex100'::jsonb; -- ERROR
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '1.3ex100'::jsonb;
+ ^
+DETAIL: Token "1.3ex100" is invalid.
+CONTEXT: JSON data, line 1: 1.3ex100
+-- Arrays.
+SELECT '[]'::jsonb; -- OK
+ jsonb
+-------
+ []
+(1 row)
+
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::jsonb; -- OK
+ jsonb
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+(1 row)
+
+SELECT '[1,2]'::jsonb; -- OK
+ jsonb
+--------
+ [1, 2]
+(1 row)
+
+SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2,]'::jsonb;
+ ^
+DETAIL: Expected JSON value, but found "]".
+CONTEXT: JSON data, line 1: [1,2,]
+SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,2'::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,2
+SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '[1,[2]'::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1: [1,[2]
+-- Objects.
+SELECT '{}'::jsonb; -- OK
+ jsonb
+-------
+ {}
+(1 row)
+
+SELECT '{"abc"}'::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"}'::jsonb;
+ ^
+DETAIL: Expected ":", but found "}".
+CONTEXT: JSON data, line 1: {"abc"}
+SELECT '{"abc":1}'::jsonb; -- OK
+ jsonb
+------------
+ {"abc": 1}
+(1 row)
+
+SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{1:"abc"}'::jsonb;
+ ^
+DETAIL: Expected string or "}", but found "1".
+CONTEXT: JSON data, line 1: {1...
+SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc",1}'::jsonb;
+ ^
+DETAIL: Expected ":", but found ",".
+CONTEXT: JSON data, line 1: {"abc",...
+SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"=1}'::jsonb;
+ ^
+DETAIL: Token "=" is invalid.
+CONTEXT: JSON data, line 1: {"abc"=...
+SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc"::1}'::jsonb;
+ ^
+DETAIL: Expected JSON value, but found ":".
+CONTEXT: JSON data, line 1: {"abc"::...
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+ jsonb
+--------------------------------------------------------------------
+ {"abc": 1, "def": 2, "ghi": [3, 4], "hij": {"klm": 5, "nop": [6]}}
+(1 row)
+
+SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1:2}'::jsonb;
+ ^
+DETAIL: Expected "," or "}", but found ":".
+CONTEXT: JSON data, line 1: {"abc":1:...
+SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{"abc":1,3}'::jsonb;
+ ^
+DETAIL: Expected string, but found "3".
+CONTEXT: JSON data, line 1: {"abc":1,3...
+-- Recursion.
+SET max_stack_depth = '100kB';
+SELECT repeat('[', 10000)::jsonb;
+ERROR: stack depth limit exceeded
+HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+SELECT repeat('{"a":', 10000)::jsonb;
+ERROR: stack depth limit exceeded
+HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+RESET max_stack_depth;
+-- Miscellaneous stuff.
+SELECT 'true'::jsonb; -- OK
+ jsonb
+-------
+ true
+(1 row)
+
+SELECT 'false'::jsonb; -- OK
+ jsonb
+-------
+ false
+(1 row)
+
+SELECT 'null'::jsonb; -- OK
+ jsonb
+-------
+ null
+(1 row)
+
+SELECT ' true '::jsonb; -- OK, even with extra whitespace
+ jsonb
+-------
+ true
+(1 row)
+
+SELECT 'true false'::jsonb; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true false'::jsonb;
+ ^
+DETAIL: Expected end of input, but found "false".
+CONTEXT: JSON data, line 1: true false
+SELECT 'true, false'::jsonb; -- ERROR, too many values
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'true, false'::jsonb;
+ ^
+DETAIL: Expected end of input, but found ",".
+CONTEXT: JSON data, line 1: true,...
+SELECT 'truf'::jsonb; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'truf'::jsonb;
+ ^
+DETAIL: Token "truf" is invalid.
+CONTEXT: JSON data, line 1: truf
+SELECT 'trues'::jsonb; -- ERROR, not a keyword
+ERROR: invalid input syntax for type json
+LINE 1: SELECT 'trues'::jsonb;
+ ^
+DETAIL: Token "trues" is invalid.
+CONTEXT: JSON data, line 1: trues
+SELECT ''::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ''::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+SELECT ' '::jsonb; -- ERROR, no value
+ERROR: invalid input syntax for type json
+LINE 1: SELECT ' '::jsonb;
+ ^
+DETAIL: The input string ended unexpectedly.
+CONTEXT: JSON data, line 1:
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::jsonb; -- OK
+ jsonb
+-----------------------------------------
+ {"one": 1, "two": "two", "three": true}
+(1 row)
+
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::jsonb;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found ",".
+CONTEXT: JSON data, line 3: "two":,...
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb;
+ERROR: invalid input syntax for type json
+LINE 1: SELECT '{
+ ^
+DETAIL: Expected JSON value, but found "}".
+CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":}
+-- ERROR missing value for last field
+-- make sure jsonb is passed through json generators without being escaped
+SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']);
+ array_to_json
+--------------------------
+ [{"a": 1},{"b": [2, 3]}]
+(1 row)
+
+-- anyarray column
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+analyze rows;
+select attname, to_jsonb(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 1;
+ attname | histogram_bounds
+---------+--------------------------
+ x | [1, 2, 3]
+ y | ["txt1", "txt2", "txt3"]
+(2 rows)
+
+-- to_jsonb, timestamps
+select to_jsonb(timestamp '2014-05-28 12:22:35.614298');
+ to_jsonb
+------------------------------
+ "2014-05-28T12:22:35.614298"
+(1 row)
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ to_jsonb
+------------------------------------
+ "2014-05-29T02:52:35.614298+10:30"
+(1 row)
+
+SET LOCAL TIME ZONE -8;
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+ to_jsonb
+------------------------------------
+ "2014-05-28T08:22:35.614298-08:00"
+(1 row)
+
+COMMIT;
+select to_jsonb(date '2014-05-28');
+ to_jsonb
+--------------
+ "2014-05-28"
+(1 row)
+
+select to_jsonb(date 'Infinity');
+ to_jsonb
+------------
+ "infinity"
+(1 row)
+
+select to_jsonb(date '-Infinity');
+ to_jsonb
+-------------
+ "-infinity"
+(1 row)
+
+select to_jsonb(timestamp 'Infinity');
+ to_jsonb
+------------
+ "infinity"
+(1 row)
+
+select to_jsonb(timestamp '-Infinity');
+ to_jsonb
+-------------
+ "-infinity"
+(1 row)
+
+select to_jsonb(timestamptz 'Infinity');
+ to_jsonb
+------------
+ "infinity"
+(1 row)
+
+select to_jsonb(timestamptz '-Infinity');
+ to_jsonb
+-------------
+ "-infinity"
+(1 row)
+
+--jsonb_agg
+SELECT jsonb_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+ jsonb_agg
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ [{"b": "a1", "c": 4, "z": [{"f1": 1, "f2": [1, 2, 3]}, {"f1": 4, "f2": [4, 5, 6]}]}, {"b": "a1", "c": 5, "z": [{"f1": 1, "f2": [1, 2, 3]}, {"f1": 5, "f2": [4, 5, 6]}]}, {"b": "a2", "c": 4, "z": [{"f1": 2, "f2": [1, 2, 3]}, {"f1": 4, "f2": [4, 5, 6]}]}, {"b": "a2", "c": 5, "z": [{"f1": 2, "f2": [1, 2, 3]}, {"f1": 5, "f2": [4, 5, 6]}]}]
+(1 row)
+
+SELECT jsonb_agg(q ORDER BY x, y)
+ FROM rows q;
+ jsonb_agg
+-----------------------------------------------------------------------
+ [{"x": 1, "y": "txt1"}, {"x": 2, "y": "txt2"}, {"x": 3, "y": "txt3"}]
+(1 row)
+
+UPDATE rows SET x = NULL WHERE x = 1;
+SELECT jsonb_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+ jsonb_agg
+--------------------------------------------------------------------------
+ [{"x": null, "y": "txt1"}, {"x": 2, "y": "txt2"}, {"x": 3, "y": "txt3"}]
+(1 row)
+
+-- jsonb extraction functions
+CREATE TEMP TABLE test_jsonb (
+ json_type text,
+ test_json jsonb
+);
+INSERT INTO test_jsonb VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ "val2"
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ val2
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+ "two"
+(1 row)
+
+SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+-----------
+ {"f1": 9}
+(1 row)
+
+SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+ 4
+(1 row)
+
+SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+-----------
+ {"f1": 9}
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar';
+ ?column?
+----------
+
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array';
+ ?column?
+----------
+ two
+(1 row)
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object';
+ ?column?
+----------
+
+(1 row)
+
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar';
+ERROR: cannot call jsonb_object_keys on a scalar
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array';
+ERROR: cannot call jsonb_object_keys on an array
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object';
+ jsonb_object_keys
+-------------------
+ field1
+ field2
+ field3
+ field4
+ field5
+ field6
+(6 rows)
+
+-- nulls
+SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object';
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object';
+ expect_true
+-------------
+ t
+(1 row)
+
+SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array';
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array';
+ expect_true
+-------------
+ t
+(1 row)
+
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::jsonb -> 'b';
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::jsonb -> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb -> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> '';
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1;
+ ?column?
+-------------
+ {"b": "cc"}
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3;
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": "c", "b": null}'::jsonb ->> 'b';
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb ->> 1;
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb ->> 'z';
+ ?column?
+----------
+
+(1 row)
+
+-- equality and inequality
+SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+-- containment
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+ jsonb_contains
+----------------
+ t
+(1 row)
+
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}');
+ jsonb_contains
+----------------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ t
+(1 row)
+
+SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}');
+ jsonb_contained
+-----------------
+ f
+(1 row)
+
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+ ?column?
+----------
+ f
+(1 row)
+
+-- Raw scalar may contain another raw scalar, array may contain a raw scalar
+SELECT '[5]'::jsonb @> '[5]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '5'::jsonb @> '5';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '[5]'::jsonb @> '5';
+ ?column?
+----------
+ t
+(1 row)
+
+-- But a raw scalar cannot contain an array
+SELECT '5'::jsonb @> '[5]';
+ ?column?
+----------
+ f
+(1 row)
+
+-- In general, one thing should always contain itself. Test array containment:
+SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb;
+ ?column?
+----------
+ t
+(1 row)
+
+-- array containment string matching confusion bug
+SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}';
+ ?column?
+----------
+ f
+(1 row)
+
+-- array length
+SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+ jsonb_array_length
+--------------------
+ 5
+(1 row)
+
+SELECT jsonb_array_length('[]');
+ jsonb_array_length
+--------------------
+ 0
+(1 row)
+
+SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+ERROR: cannot get array length of a non-array
+SELECT jsonb_array_length('4');
+ERROR: cannot get array length of a scalar
+-- each
+SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+ jsonb_each
+--------------------
+ (f1,"[1, 2, 3]")
+ (f2,"{""f3"": 1}")
+ (f4,null)
+(3 rows)
+
+SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ q
+------------------------------------------------------
+ (1,"""first""")
+ (a,"{""1"": ""first"", ""b"": ""c"", ""c"": ""b""}")
+ (b,"[1, 2]")
+ (c,"""cc""")
+ (n,null)
+(5 rows)
+
+SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1, 2, 3]
+ f2 | {"f3": 1}
+ f4 | null
+ f5 | 99
+ f6 | "stringy"
+(5 rows)
+
+SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ key | value
+-----+------------------------------------
+ 1 | "first"
+ a | {"1": "first", "b": "c", "c": "b"}
+ b | [1, 2]
+ c | "cc"
+ n | null
+(5 rows)
+
+SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+ jsonb_each_text
+--------------------
+ (f1,"[1, 2, 3]")
+ (f2,"{""f3"": 1}")
+ (f4,)
+ (f5,null)
+(4 rows)
+
+SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ q
+------------------------------------------------------
+ (1,first)
+ (a,"{""1"": ""first"", ""b"": ""c"", ""c"": ""b""}")
+ (b,"[1, 2]")
+ (c,cc)
+ (n,)
+(5 rows)
+
+SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+ key | value
+-----+-----------
+ f1 | [1, 2, 3]
+ f2 | {"f3": 1}
+ f4 |
+ f5 | 99
+ f6 | stringy
+(5 rows)
+
+SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+ key | value
+-----+------------------------------------
+ 1 | first
+ a | {"1": "first", "b": "c", "c": "b"}
+ b | [1, 2]
+ c | cc
+ n |
+(5 rows)
+
+-- exists
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c');
+ jsonb_exists
+--------------
+ f
+(1 row)
+
+SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a');
+ jsonb_exists
+--------------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'b';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'c';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+-- array exists - array elements should behave as keys
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+ count
+-------
+ 3
+(1 row)
+
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+ count
+-------
+ 0
+(1 row)
+
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+ count
+-------
+ 1
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']);
+ jsonb_exists_any
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']);
+ jsonb_exists_any
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]);
+ jsonb_exists_any
+------------------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']);
+ jsonb_exists_all
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']);
+ jsonb_exists_all
+------------------
+ f
+(1 row)
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]);
+ jsonb_exists_all
+------------------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d'];
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b'];
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[];
+ ?column?
+----------
+ t
+(1 row)
+
+-- typeof
+SELECT jsonb_typeof('{}') AS object;
+ object
+--------
+ object
+(1 row)
+
+SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object;
+ object
+--------
+ object
+(1 row)
+
+SELECT jsonb_typeof('[]') AS array;
+ array
+-------
+ array
+(1 row)
+
+SELECT jsonb_typeof('["a", 1]') AS array;
+ array
+-------
+ array
+(1 row)
+
+SELECT jsonb_typeof('null') AS "null";
+ null
+------
+ null
+(1 row)
+
+SELECT jsonb_typeof('1') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('-1') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('1.0') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('1e2') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('-1.0') AS number;
+ number
+--------
+ number
+(1 row)
+
+SELECT jsonb_typeof('true') AS boolean;
+ boolean
+---------
+ boolean
+(1 row)
+
+SELECT jsonb_typeof('false') AS boolean;
+ boolean
+---------
+ boolean
+(1 row)
+
+SELECT jsonb_typeof('"hello"') AS string;
+ string
+--------
+ string
+(1 row)
+
+SELECT jsonb_typeof('"true"') AS string;
+ string
+--------
+ string
+(1 row)
+
+SELECT jsonb_typeof('"1.0"') AS string;
+ string
+--------
+ string
+(1 row)
+
+-- jsonb_build_array, jsonb_build_object, jsonb_object_agg
+SELECT jsonb_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ jsonb_build_array
+-------------------------------------------------------------------------
+ ["a", 1, "b", 1.2, "c", true, "d", null, "e", {"x": 3, "y": [1, 2, 3]}]
+(1 row)
+
+SELECT jsonb_build_array('a', NULL); -- ok
+ jsonb_build_array
+-------------------
+ ["a", null]
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok
+ jsonb_build_array
+-------------------
+
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok
+ jsonb_build_array
+-------------------
+ []
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+ jsonb_build_array
+-------------------
+ ["a", "b", "c"]
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ jsonb_build_array
+-------------------
+ ["a", null]
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ jsonb_build_array
+----------------------
+ ["1", "2", "3", "4"]
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ jsonb_build_array
+-------------------
+ [1, 2, 3, 4]
+(1 row)
+
+SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ jsonb_build_array
+--------------------
+ [1, 4, 2, 5, 3, 6]
+(1 row)
+
+SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+ jsonb_build_object
+-------------------------------------------------------------------------
+ {"a": 1, "b": 1.2, "c": true, "d": null, "e": {"x": 3, "y": [1, 2, 3]}}
+(1 row)
+
+SELECT jsonb_build_object(
+ 'a', jsonb_build_object('b',false,'c',99),
+ 'd', jsonb_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+ jsonb_build_object
+------------------------------------------------------------------------------------------------
+ {"a": {"b": false, "c": 99}, "d": {"e": [9, 8, 7], "f": {"name": "pg_class", "relkind": "r"}}}
+(1 row)
+
+SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of jsonb_build_object() must consist of alternating keys and values.
+SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+ERROR: key value must be scalar, not array, composite, or json
+SELECT jsonb_build_object('a', 'b', 'c'); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of jsonb_build_object() must consist of alternating keys and values.
+SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL
+ERROR: argument 1: key must not be null
+SELECT jsonb_build_object('a', NULL); -- ok
+ jsonb_build_object
+--------------------
+ {"a": null}
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok
+ jsonb_build_object
+--------------------
+
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok
+ jsonb_build_object
+--------------------
+ {}
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+ERROR: argument list must have even number of elements
+HINT: The arguments of jsonb_build_object() must consist of alternating keys and values.
+SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+ jsonb_build_object
+--------------------
+ {"a": null}
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+ERROR: argument 1: key must not be null
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+ jsonb_build_object
+----------------------
+ {"1": "2", "3": "4"}
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+ jsonb_build_object
+--------------------
+ {"1": 2, "3": 4}
+(1 row)
+
+SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+ jsonb_build_object
+--------------------------
+ {"1": 4, "2": 5, "3": 6}
+(1 row)
+
+-- empty objects/arrays
+SELECT jsonb_build_array();
+ jsonb_build_array
+-------------------
+ []
+(1 row)
+
+SELECT jsonb_build_object();
+ jsonb_build_object
+--------------------
+ {}
+(1 row)
+
+-- make sure keys are quoted
+SELECT jsonb_build_object(1,2);
+ jsonb_build_object
+--------------------
+ {"1": 2}
+(1 row)
+
+-- keys must be scalar and not null
+SELECT jsonb_build_object(null,2);
+ERROR: argument 1: key must not be null
+SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+ERROR: key value must be scalar, not array, composite, or json
+SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+ERROR: key value must be scalar, not array, composite, or json
+SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+ERROR: key value must be scalar, not array, composite, or json
+-- handling of NULL values
+SELECT jsonb_object_agg(1, NULL::jsonb);
+ jsonb_object_agg
+------------------
+ {"1": null}
+(1 row)
+
+SELECT jsonb_object_agg(NULL, '{"a":1}');
+ERROR: field name must not be null
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type)))
+FROM foo;
+ jsonb_build_object
+-------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"turbines": {"847001": {"name": "t15", "type": "GE1043"}, "847002": {"name": "t16", "type": "GE1043"}, "847003": {"name": "sub-alpha", "type": "GESS90"}}}
+(1 row)
+
+SELECT jsonb_object_agg(name, type) FROM foo;
+ jsonb_object_agg
+-----------------------------------------------------------
+ {"t15": "GE1043", "t16": "GE1043", "sub-alpha": "GESS90"}
+(1 row)
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT jsonb_object_agg(name, type) FROM foo;
+ERROR: field name must not be null
+-- jsonb_object
+-- empty object, one dimension
+SELECT jsonb_object('{}');
+ jsonb_object
+--------------
+ {}
+(1 row)
+
+-- empty object, two dimensions
+SELECT jsonb_object('{}', '{}');
+ jsonb_object
+--------------
+ {}
+(1 row)
+
+-- one dimension
+SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+ jsonb_object
+---------------------------------------------------
+ {"3": null, "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- same but with two dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ jsonb_object
+---------------------------------------------------
+ {"3": null, "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- odd number error
+SELECT jsonb_object('{a,b,c}');
+ERROR: array must have even number of elements
+-- one column error
+SELECT jsonb_object('{{a},{b}}');
+ERROR: array must have two columns
+-- too many columns error
+SELECT jsonb_object('{{a,b,c},{b,c,d}}');
+ERROR: array must have two columns
+-- too many dimensions error
+SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+ERROR: wrong number of array subscripts
+--two argument form of jsonb_object
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+ jsonb_object
+--------------------------------------------------
+ {"a": "1", "b": "2", "c": "3", "d e f": "a b c"}
+(1 row)
+
+-- too many dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+ERROR: wrong number of array subscripts
+-- mismatched dimensions
+select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+ERROR: mismatched array dimensions
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+ERROR: mismatched array dimensions
+-- null key error
+select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+ERROR: null value not allowed for object key
+-- empty key is allowed
+select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+ jsonb_object
+-------------------------------------------------
+ {"": "3", "a": "1", "b": "2", "d e f": "a b c"}
+(1 row)
+
+-- extract_path, extract_path_as_text
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ jsonb_extract_path
+--------------------
+ "stringy"
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ jsonb_extract_path
+--------------------
+ {"f3": 1}
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ jsonb_extract_path
+--------------------
+ "f3"
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ jsonb_extract_path
+--------------------
+ 1
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+ jsonb_extract_path_text
+-------------------------
+ stringy
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+ jsonb_extract_path_text
+-------------------------
+ {"f3": 1}
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+ jsonb_extract_path_text
+-------------------------
+ f3
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+ jsonb_extract_path_text
+-------------------------
+ 1
+(1 row)
+
+-- extract_path nulls
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false;
+ expect_false
+--------------
+ f
+(1 row)
+
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true;
+ expect_true
+-------------
+ t
+(1 row)
+
+-- extract_path operators
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6'];
+ ?column?
+-----------
+ "stringy"
+(1 row)
+
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+ ?column?
+-----------
+ {"f3": 1}
+(1 row)
+
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+ ?column?
+----------
+ "f3"
+(1 row)
+
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1'];
+ ?column?
+----------
+ 1
+(1 row)
+
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+ ?column?
+----------
+ stringy
+(1 row)
+
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+ ?column?
+-----------
+ {"f3": 1}
+(1 row)
+
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+ ?column?
+----------
+ f3
+(1 row)
+
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1'];
+ ?column?
+----------
+ 1
+(1 row)
+
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
+ ?column?
+----------------------------
+ {"a": {"b": {"c": "foo"}}}
+(1 row)
+
+select '[1,2,3]'::jsonb #> '{}';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+select '"foo"'::jsonb #> '{}';
+ ?column?
+----------
+ "foo"
+(1 row)
+
+select '42'::jsonb #> '{}';
+ ?column?
+----------
+ 42
+(1 row)
+
+select 'null'::jsonb #> '{}';
+ ?column?
+----------
+ null
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+ ?column?
+---------------------
+ {"b": {"c": "foo"}}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+ ?column?
+--------------
+ {"c": "foo"}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+ ?column?
+----------
+ "foo"
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+ ?column?
+----------
+ "cc"
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+ ?column?
+----------
+ "cc"
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+ ?column?
+----------
+ null
+(1 row)
+
+select '"foo"'::jsonb #> array['z'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::jsonb #> array['f2'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::jsonb #> array['0'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+ ?column?
+----------------------------
+ {"a": {"b": {"c": "foo"}}}
+(1 row)
+
+select '[1,2,3]'::jsonb #>> '{}';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+select '"foo"'::jsonb #>> '{}';
+ ?column?
+----------
+ foo
+(1 row)
+
+select '42'::jsonb #>> '{}';
+ ?column?
+----------
+ 42
+(1 row)
+
+select 'null'::jsonb #>> '{}';
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+ ?column?
+---------------------
+ {"b": {"c": "foo"}}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+ ?column?
+--------------
+ {"c": "foo"}
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+ ?column?
+----------
+ foo
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+ ?column?
+----------
+
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+ ?column?
+----------
+ cc
+(1 row)
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+ ?column?
+----------
+ cc
+(1 row)
+
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+ ?column?
+----------
+
+(1 row)
+
+select '"foo"'::jsonb #>> array['z'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::jsonb #>> array['f2'];
+ ?column?
+----------
+
+(1 row)
+
+select '42'::jsonb #>> array['0'];
+ ?column?
+----------
+
+(1 row)
+
+-- array_elements
+SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]');
+ jsonb_array_elements
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+ null
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+(6 rows)
+
+SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q;
+ value
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+ null
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+(6 rows)
+
+SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+ jsonb_array_elements_text
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+ stringy
+(7 rows)
+
+SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+ value
+----------------------------
+ 1
+ true
+ [1, [2, 3]]
+
+ {"f1": 1, "f2": [7, 8, 9]}
+ false
+ stringy
+(7 rows)
+
+-- populate_record
+CREATE TYPE jbpop AS (a text, b int, c timestamp);
+CREATE DOMAIN jsb_int_not_null AS int NOT NULL;
+CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+create type jb_unordered_pair as (x int, y int);
+create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y);
+CREATE TYPE jsbrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d jsb_int_array_1d,
+ ia2d jsb_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jbpop,
+ reca jbpop[]
+);
+CREATE TYPE jsbrec_i_not_null AS (
+ i jsb_int_not_null
+);
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+---
+ blurfl | |
+(1 row)
+
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+---
+ blurfl | |
+(1 row)
+
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+ a | b | c
+-------------------+---+---
+ [100, 200, false] | |
+(1 row)
+
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+ a | b | c
+-------------------+---+--------------------------
+ [100, 200, false] | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q;
+ERROR: invalid input syntax for type timestamp: "[100, 200, false]"
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q;
+ a | b | c
+---+---+--------------------------
+ x | 3 | Mon Dec 31 15:30:56 2012
+(1 row)
+
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q;
+ERROR: domain jsb_int_not_null does not allow null values
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q;
+ERROR: domain jsb_int_not_null does not allow null values
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q;
+ i
+-------
+ 12345
+(1 row)
+
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q;
+ ia
+----
+
+(1 row)
+
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia".
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
+ ia
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q;
+ ia
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia".
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
+ ia
+---------
+ {1,2,3}
+(1 row)
+
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q;
+ ia1
+-----
+
+(1 row)
+
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia1".
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
+ ia1
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q;
+ ia1
+-----------
+ {{1,2,3}}
+(1 row)
+
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q;
+ ia1d
+------
+
+(1 row)
+
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ia1d".
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
+ERROR: value for domain jsb_int_array_1d violates check constraint "jsb_int_array_1d_check"
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q;
+ ia1d
+------------
+ {1,2,NULL}
+(1 row)
+
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q;
+ ia2
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+ ia2
+------------------
+ {{1,2},{NULL,4}}
+(1 row)
+
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q;
+ ia2
+-----
+ {}
+(1 row)
+
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia2".
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+ERROR: value for domain jsb_int_array_2d violates check constraint "jsb_int_array_2d_check"
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+ ia2d
+----------------------
+ {{1,2,3},{NULL,5,6}}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q;
+ ia3
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+ ia3
+------------------
+ {{1,2},{NULL,4}}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+ ia3
+-----
+ {}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+ ia3
+-------------------
+ {{{1,2}},{{3,4}}}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+ ia3
+-------------------------------
+ {{{1,2},{3,4}},{{5,6},{7,8}}}
+(1 row)
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
+ ta
+----
+
+(1 row)
+
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ta".
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
+ ta
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ta".
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
+ c
+---
+
+(1 row)
+
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q;
+ c
+------------
+ aaa
+(1 row)
+
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q;
+ c
+------------
+ aaaaaaaaaa
+(1 row)
+
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q;
+ERROR: value too long for type character(10)
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q;
+ ca
+----
+
+(1 row)
+
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "ca".
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
+ ca
+-----------------------------------------------
+ {"1 ","2 ",NULL,"4 "}
+(1 row)
+
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+ERROR: value too long for type character(10)
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ca".
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
+ js
+----
+
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q;
+ js
+------
+ true
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q;
+ js
+--------
+ 123.45
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q;
+ js
+----------
+ "123.45"
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q;
+ js
+-------
+ "abc"
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+ js
+--------------------------------------
+ [123, "123", null, {"key": "value"}]
+(1 row)
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ js
+--------------------------------------
+ {"a": "bbb", "b": null, "c": 123.45}
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q;
+ jsb
+-----
+
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q;
+ jsb
+------
+ true
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q;
+ jsb
+--------
+ 123.45
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q;
+ jsb
+----------
+ "123.45"
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q;
+ jsb
+-------
+ "abc"
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+ jsb
+--------------------------------------
+ [123, "123", null, {"key": "value"}]
+(1 row)
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+ jsb
+--------------------------------------
+ {"a": "bbb", "b": null, "c": 123.45}
+(1 row)
+
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q;
+ jsa
+-----
+
+(1 row)
+
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "jsa".
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
+ jsa
+--------------------
+ {1,"\"2\"",NULL,4}
+(1 row)
+
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+ jsa
+-------------------------------------------------------
+ {"\"aaa\"",NULL,"[1, 2, \"3\", {}]","{\"k\": \"v\"}"}
+(1 row)
+
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q;
+ERROR: cannot call populate_composite on a scalar
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q;
+ERROR: cannot call populate_composite on an array
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+ rec
+-----------------------------------
+ (abc,,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+ rec
+-------------------------------------
+ (abc,42,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
+ERROR: expected JSON array
+HINT: See the value of key "reca".
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
+ERROR: cannot call populate_composite on a scalar
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+ reca
+--------------------------------------------------------
+ {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+ reca
+-------------------------------------------
+ {"(abc,42,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+ reca
+-------------------------------------------
+ {"(abc,42,\"Thu Jan 02 00:00:00 2003\")"}
+(1 row)
+
+SELECT rec FROM jsonb_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+ rec
+------------------------------------
+ (abc,3,"Thu Jan 02 00:00:00 2003")
+(1 row)
+
+-- anonymous record type
+SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}');
+ERROR: could not determine row type for result of jsonb_populate_record
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+ jsonb_populate_record
+-----------------------
+ (0,1)
+(1 row)
+
+SELECT * FROM
+ jsonb_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+ x | y
+-----+---
+ 776 |
+(1 row)
+
+-- composite domain
+SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}');
+ jsonb_populate_record
+-----------------------
+ (0,1)
+(1 row)
+
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}');
+ jsonb_populate_record
+-----------------------
+ (0,2)
+(1 row)
+
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}');
+ERROR: value for domain jb_ordered_pair violates check constraint "jb_ordered_pair_check"
+-- populate_recordset
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+-----------------+----+--------------------------
+ [100, 200, 300] | 99 |
+ {"z": true} | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ERROR: invalid input syntax for type timestamp: "[100, 200, 300]"
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+---+--------------------------
+ blurfl | |
+ | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+--------+----+--------------------------
+ blurfl | 99 |
+ def | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+ a | b | c
+-----------------+----+--------------------------
+ [100, 200, 300] | 99 |
+ {"z": true} | 3 | Fri Jan 20 10:42:53 2012
+(2 rows)
+
+-- anonymous record type
+SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+ERROR: could not determine row type for result of jsonb_populate_recordset
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+ jsonb_populate_recordset
+--------------------------
+ (0,1)
+(1 row)
+
+SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+ i | jsonb_populate_recordset
+---+--------------------------
+ 1 | (42,50)
+ 1 | (1,43)
+ 2 | (42,50)
+ 2 | (2,43)
+(4 rows)
+
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+ x | y
+-----+---
+ 776 |
+(1 row)
+
+-- empty array is a corner case
+SELECT jsonb_populate_recordset(null::record, '[]');
+ERROR: could not determine row type for result of jsonb_populate_recordset
+HINT: Provide a non-null record argument, or call the function in the FROM clause using a column definition list.
+SELECT jsonb_populate_recordset(row(1,2), '[]');
+ jsonb_populate_recordset
+--------------------------
+(0 rows)
+
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q;
+ a | b | c
+---+---+---
+(0 rows)
+
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[]') AS (x int, y int);
+ x | y
+---+---
+(0 rows)
+
+-- composite domain
+SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]');
+ jsonb_populate_recordset
+--------------------------
+ (0,1)
+(1 row)
+
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]');
+ jsonb_populate_recordset
+--------------------------
+ (0,2)
+ (1,3)
+(2 rows)
+
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]');
+ERROR: value for domain jb_ordered_pair violates check constraint "jb_ordered_pair_check"
+-- negative cases where the wrong record type is supplied
+select * from jsonb_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned row contains 1 attribute, but query expects 2.
+select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned type integer at ordinal position 1, but query expects text.
+select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned row contains 3 attributes, but query expects 2.
+select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+ERROR: function return row and query-specified return row do not match
+DETAIL: Returned type integer at ordinal position 1, but query expects text.
+-- jsonb_to_record and jsonb_to_recordset
+select * from jsonb_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+ a | b | d
+---+-----+---
+ 1 | foo |
+(1 row)
+
+select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+ a | b | c
+---+-----+---
+ 1 | foo |
+ 2 | bar | t
+(2 rows)
+
+select *, c is null as c_is_null
+from jsonb_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::jsonb)
+ as t(a int, b jsonb, c text, x int, ca char(5)[], ia int[][], r jbpop);
+ a | b | c | x | ca | ia | r | c_is_null
+---+-------------------+---+---+-------------------+---------------+------------+-----------
+ 1 | {"c": 16, "d": 2} | | 8 | {"1 2 ","3 "} | {{1,2},{3,4}} | (aaa,123,) | t
+(1 row)
+
+select *, c is null as c_is_null
+from jsonb_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::jsonb)
+ as t(a int, b jsonb, c text, x int);
+ a | b | c | x | c_is_null
+---+-------------------+---+---+-----------
+ 1 | {"c": 16, "d": 2} | | 8 | t
+(1 row)
+
+select * from jsonb_to_record('{"ia": null}') as x(ia _int4);
+ ia
+----
+
+(1 row)
+
+select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
+ERROR: expected JSON array
+HINT: See the value of key "ia".
+select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+ ia
+--------------
+ {1,2,NULL,4}
+(1 row)
+
+select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+ ia
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+ERROR: expected JSON array
+HINT: See the array element [1] of key "ia".
+select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+ERROR: malformed JSON array
+DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
+select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+ ia2
+---------
+ {1,2,3}
+(1 row)
+
+select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+ ia2
+---------------
+ {{1,2},{3,4}}
+(1 row)
+
+select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+ ia2
+-----------------
+ {{{1},{2},{3}}}
+(1 row)
+
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json);
+ out
+------------
+ {"key": 1}
+(1 row)
+
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json);
+ out
+--------------
+ [{"key": 1}]
+(1 row)
+
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+ out
+----------------
+ "{\"key\": 1}"
+(1 row)
+
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb);
+ out
+------------
+ {"key": 1}
+(1 row)
+
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+ out
+--------------
+ [{"key": 1}]
+(1 row)
+
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+ out
+----------------
+ "{\"key\": 1}"
+(1 row)
+
+-- test type info caching in jsonb_populate_record()
+CREATE TEMP TABLE jsbpoptest (js jsonb);
+INSERT INTO jsbpoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::jsonb
+FROM generate_series(1, 3);
+SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest;
+ i | ia | ia1 | ia2 | ia3 | ia1d | ia2d | t | ta | c | ca | ts | js | jsb | jsa | rec | reca
+---+----+-----+-----+-----+------+------+---+----+---+----+----+----+-----+--------------------+-----------------------------------+--------------------------------------------------------
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+ | | | | | | | | | | | | | | {1,"\"2\"",NULL,4} | (abc,,"Thu Jan 02 00:00:00 2003") | {"(abc,456,)",NULL,"(,,\"Thu Jan 02 00:00:00 2003\")"}
+(3 rows)
+
+DROP TYPE jsbrec;
+DROP TYPE jsbrec_i_not_null;
+DROP DOMAIN jsb_int_not_null;
+DROP DOMAIN jsb_int_array_1d;
+DROP DOMAIN jsb_int_array_2d;
+DROP DOMAIN jb_ordered_pair;
+DROP TYPE jb_unordered_pair;
+-- indexing
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+ count
+-------
+ 42
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+CREATE INDEX jidx ON testjsonb USING gin (j);
+SET enable_seqscan = off;
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
+ count
+-------
+ 3
+(1 row)
+
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+ count
+-------
+ 42
+(1 row)
+
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ QUERY PLAN
+-----------------------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on testjsonb
+ Recheck Cond: (j @@ '($."wait" == null)'::jsonpath)
+ -> Bitmap Index Scan on jidx
+ Index Cond: (j @@ '($."wait" == null)'::jsonpath)
+(5 rows)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+ count
+-------
+ 0
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+ count
+-------
+ 337
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+ count
+-------
+ 42
+(1 row)
+
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ QUERY PLAN
+-------------------------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on testjsonb
+ Recheck Cond: (j @? '$."wait"?(@ == null)'::jsonpath)
+ -> Bitmap Index Scan on jidx
+ Index Cond: (j @? '$."wait"?(@ == null)'::jsonpath)
+(5 rows)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+-- array exists - array elements should behave as keys (for GIN index scans too)
+CREATE INDEX jidx_array ON testjsonb USING gin((j->'array'));
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+ count
+-------
+ 3
+(1 row)
+
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+ count
+-------
+ 0
+(1 row)
+
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+ count
+-------
+ 1
+(1 row)
+
+RESET enable_seqscan;
+SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+ count
+-------
+ 4791
+(1 row)
+
+SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+ key | count
+-----------+-------
+ line | 884
+ query | 207
+ pos | 203
+ node | 202
+ space | 197
+ status | 195
+ public | 194
+ title | 190
+ wait | 190
+ org | 189
+ user | 189
+ coauthors | 188
+ disabled | 185
+ indexed | 184
+ cleaned | 180
+ bad | 179
+ date | 179
+ world | 176
+ state | 172
+ subtitle | 169
+ auth | 168
+ abstract | 161
+ array | 5
+ age | 2
+ foo | 2
+ fool | 1
+(26 rows)
+
+-- sort/hash
+SELECT count(distinct j) FROM testjsonb;
+ count
+-------
+ 894
+(1 row)
+
+SET enable_hashagg = off;
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+ count
+-------
+ 894
+(1 row)
+
+SET enable_hashagg = on;
+SET enable_sort = off;
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+ count
+-------
+ 894
+(1 row)
+
+SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+ j
+----
+ {}
+(1 row)
+
+SET enable_sort = on;
+RESET enable_hashagg;
+RESET enable_sort;
+DROP INDEX jidx;
+DROP INDEX jidx_array;
+-- btree
+CREATE INDEX jidx ON testjsonb USING btree (j);
+SET enable_seqscan = off;
+SELECT count(*) FROM testjsonb WHERE j > '{"p":1}';
+ count
+-------
+ 884
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}';
+ count
+-------
+ 1
+(1 row)
+
+--gin path opclass
+DROP INDEX jidx;
+CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops);
+SET enable_seqscan = off;
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+ count
+-------
+ 2
+(1 row)
+
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+ count
+-------
+ 1012
+(1 row)
+
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ QUERY PLAN
+-------------------------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on testjsonb
+ Recheck Cond: (j @? '$."wait"?(@ == null)'::jsonpath)
+ -> Bitmap Index Scan on jidx
+ Index Cond: (j @? '$."wait"?(@ == null)'::jsonpath)
+(5 rows)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+ count
+-------
+ 1
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+ count
+-------
+ 15
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+ count
+-------
+ 2
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+ count
+-------
+ 3
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+ count
+-------
+ 1012
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+ count
+-------
+ 194
+(1 row)
+
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+ count
+-------
+ 0
+(1 row)
+
+RESET enable_seqscan;
+DROP INDEX jidx;
+-- nested tests
+SELECT '{"ff":{"a":12,"b":16}}'::jsonb;
+ jsonb
+----------------------------
+ {"ff": {"a": 12, "b": 16}}
+(1 row)
+
+SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb;
+ jsonb
+---------------------------------------
+ {"ff": {"a": 12, "b": 16}, "qq": 123}
+(1 row)
+
+SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb;
+ jsonb
+--------------------------------------------------------------------------------------------------
+ {"aa": ["a", "aaa"], "qq": {"a": 12, "b": 16, "c": ["c1", "c2"], "d": {"d1": "d3", "d2": "d2"}}}
+(1 row)
+
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2"],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+ jsonb
+------------------------------------------------------------------------------------------------------
+ {"aa": ["a", "aaa"], "qq": {"a": "12", "b": "16", "c": ["c1", "c2"], "d": {"d1": "d1", "d2": "d2"}}}
+(1 row)
+
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2",["c3"],{"c4":4}],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+ jsonb
+-------------------------------------------------------------------------------------------------------------------------
+ {"aa": ["a", "aaa"], "qq": {"a": "12", "b": "16", "c": ["c1", "c2", ["c3"], {"c4": 4}], "d": {"d1": "d1", "d2": "d2"}}}
+(1 row)
+
+SELECT '{"ff":["a","aaa"]}'::jsonb;
+ jsonb
+----------------------
+ {"ff": ["a", "aaa"]}
+(1 row)
+
+SELECT
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff',
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq',
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f,
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t,
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x';
+ ?column? | ?column? | f | t | ?column?
+--------------------+----------+---+---+----------
+ {"a": 12, "b": 16} | 123 | f | t | [1, 2]
+(1 row)
+
+-- nested containment
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}';
+ ?column?
+----------
+ t
+(1 row)
+
+-- check some corner cases for indexed nested containment (bug #13756)
+create temp table nestjsonb (j jsonb);
+insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
+insert into nestjsonb (j) values ('[[14,2,3]]');
+insert into nestjsonb (j) values ('[1,[14,2,3]]');
+create index on nestjsonb using gin(j jsonb_path_ops);
+set enable_seqscan = on;
+set enable_bitmapscan = off;
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '{"c":3}';
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '[[14]]';
+ j
+-----------------
+ [[14, 2, 3]]
+ [1, [14, 2, 3]]
+(2 rows)
+
+set enable_seqscan = off;
+set enable_bitmapscan = on;
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '{"c":3}';
+ j
+---------------------------------------------------
+ {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
+(1 row)
+
+select * from nestjsonb where j @> '[[14]]';
+ j
+-----------------
+ [[14, 2, 3]]
+ [1, [14, 2, 3]]
+(2 rows)
+
+reset enable_seqscan;
+reset enable_bitmapscan;
+-- nested object field / array index lookup
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n';
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a';
+ ?column?
+----------
+ 1
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b';
+ ?column?
+----------
+ [1, 2]
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c';
+ ?column?
+----------
+ {"1": 2}
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd';
+ ?column?
+---------------
+ {"1": [2, 3]}
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1';
+ ?column?
+----------
+ [2, 3]
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e';
+ ?column?
+----------
+
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error
+ ?column?
+----------
+
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 0;
+ ?column?
+----------
+ "a"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 1;
+ ?column?
+----------
+ "b"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 2;
+ ?column?
+----------
+ "c"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3;
+ ?column?
+----------
+ [1, 2]
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 4;
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 5;
+ ?column?
+----------
+
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -1;
+ ?column?
+----------
+ null
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -5;
+ ?column?
+----------
+ "a"
+(1 row)
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -6;
+ ?column?
+----------
+
+(1 row)
+
+--nested path extraction
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}';
+ ?column?
+----------
+
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+ ?column?
+----------
+ "b"
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+ ?column?
+-----------
+ [1, 2, 3]
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+ ?column?
+----------
+ 1
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}';
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}';
+ ?column?
+----------
+ 3
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}';
+ ?column?
+----------
+
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}';
+ ?column?
+----------
+ 3
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}';
+ ?column?
+----------
+ 1
+(1 row)
+
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}';
+ ?column?
+----------
+
+(1 row)
+
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+ ?column?
+----------
+ 0
+(1 row)
+
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}';
+ ?column?
+----------
+ [3, 4]
+(1 row)
+
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}';
+ ?column?
+---------------
+ {"5": "five"}
+(1 row)
+
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}';
+ ?column?
+----------
+ "five"
+(1 row)
+
+--nested exists
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e';
+ ?column?
+----------
+ f
+(1 row)
+
+-- jsonb_strip_nulls
+select jsonb_strip_nulls(null);
+ jsonb_strip_nulls
+-------------------
+
+(1 row)
+
+select jsonb_strip_nulls('1');
+ jsonb_strip_nulls
+-------------------
+ 1
+(1 row)
+
+select jsonb_strip_nulls('"a string"');
+ jsonb_strip_nulls
+-------------------
+ "a string"
+(1 row)
+
+select jsonb_strip_nulls('null');
+ jsonb_strip_nulls
+-------------------
+ null
+(1 row)
+
+select jsonb_strip_nulls('[1,2,null,3,4]');
+ jsonb_strip_nulls
+--------------------
+ [1, 2, null, 3, 4]
+(1 row)
+
+select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+ jsonb_strip_nulls
+--------------------------------------------
+ {"a": 1, "c": [2, null, 3], "d": {"e": 4}}
+(1 row)
+
+select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+ jsonb_strip_nulls
+--------------------------
+ [1, {"a": 1, "c": 2}, 3]
+(1 row)
+
+-- an empty object is not null and should not be stripped
+select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+ jsonb_strip_nulls
+--------------------
+ {"a": {}, "d": {}}
+(1 row)
+
+select jsonb_pretty('{"a": "test", "b": [1, 2, 3], "c": "test3", "d":{"dd": "test4", "dd2":{"ddd": "test5"}}}');
+ jsonb_pretty
+----------------------------
+ { +
+ "a": "test", +
+ "b": [ +
+ 1, +
+ 2, +
+ 3 +
+ ], +
+ "c": "test3", +
+ "d": { +
+ "dd": "test4", +
+ "dd2": { +
+ "ddd": "test5"+
+ } +
+ } +
+ }
+(1 row)
+
+select jsonb_pretty('[{"f1":1,"f2":null},2,null,[[{"x":true},6,7],8],3]');
+ jsonb_pretty
+---------------------------
+ [ +
+ { +
+ "f1": 1, +
+ "f2": null +
+ }, +
+ 2, +
+ null, +
+ [ +
+ [ +
+ { +
+ "x": true+
+ }, +
+ 6, +
+ 7 +
+ ], +
+ 8 +
+ ], +
+ 3 +
+ ]
+(1 row)
+
+select jsonb_pretty('{"a":["b", "c"], "d": {"e":"f"}}');
+ jsonb_pretty
+------------------
+ { +
+ "a": [ +
+ "b", +
+ "c" +
+ ], +
+ "d": { +
+ "e": "f"+
+ } +
+ }
+(1 row)
+
+select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}');
+ jsonb_concat
+-------------------------------------------------------------------
+ {"a": [1, 2], "c": {"c1": 1, "c2": 2}, "d": "test", "g": "test2"}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+ ?column?
+---------------------------------------------
+ {"b": "g", "aa": 1, "cq": "l", "fg": false}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}';
+ ?column?
+---------------------------------------
+ {"b": 2, "aa": 1, "aq": "l", "cq": 3}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}';
+ ?column?
+------------------------------
+ {"b": 2, "aa": "l", "cq": 3}
+(1 row)
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}';
+ ?column?
+----------------------------
+ {"b": 2, "aa": 1, "cq": 3}
+(1 row)
+
+select '["a", "b"]'::jsonb || '["c"]';
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '["a", "b"]'::jsonb || '["c", "d"]';
+ ?column?
+----------------------
+ ["a", "b", "c", "d"]
+(1 row)
+
+select '["c"]' || '["a", "b"]'::jsonb;
+ ?column?
+-----------------
+ ["c", "a", "b"]
+(1 row)
+
+select '["a", "b"]'::jsonb || '"c"';
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '"c"' || '["a", "b"]'::jsonb;
+ ?column?
+-----------------
+ ["c", "a", "b"]
+(1 row)
+
+select '[]'::jsonb || '["a"]'::jsonb;
+ ?column?
+----------
+ ["a"]
+(1 row)
+
+select '[]'::jsonb || '"a"'::jsonb;
+ ?column?
+----------
+ ["a"]
+(1 row)
+
+select '"b"'::jsonb || '"a"'::jsonb;
+ ?column?
+------------
+ ["b", "a"]
+(1 row)
+
+select '{}'::jsonb || '{"a":"b"}'::jsonb;
+ ?column?
+------------
+ {"a": "b"}
+(1 row)
+
+select '[]'::jsonb || '{"a":"b"}'::jsonb;
+ ?column?
+--------------
+ [{"a": "b"}]
+(1 row)
+
+select '{"a":"b"}'::jsonb || '[]'::jsonb;
+ ?column?
+--------------
+ [{"a": "b"}]
+(1 row)
+
+select '"a"'::jsonb || '{"a":1}';
+ ?column?
+-----------------
+ ["a", {"a": 1}]
+(1 row)
+
+select '{"a":1}' || '"a"'::jsonb;
+ ?column?
+-----------------
+ [{"a": 1}, "a"]
+(1 row)
+
+select '[3]'::jsonb || '{}'::jsonb;
+ ?column?
+----------
+ [3, {}]
+(1 row)
+
+select '3'::jsonb || '[]'::jsonb;
+ ?column?
+----------
+ [3]
+(1 row)
+
+select '3'::jsonb || '4'::jsonb;
+ ?column?
+----------
+ [3, 4]
+(1 row)
+
+select '3'::jsonb || '{}'::jsonb;
+ ?column?
+----------
+ [3, {}]
+(1 row)
+
+select '["a", "b"]'::jsonb || '{"c":1}';
+ ?column?
+----------------------
+ ["a", "b", {"c": 1}]
+(1 row)
+
+select '{"c": 1}'::jsonb || '["a", "b"]';
+ ?column?
+----------------------
+ [{"c": 1}, "a", "b"]
+(1 row)
+
+select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+ ?column?
+------------------------------------
+ {"b": "g", "cq": "l", "fg": false}
+(1 row)
+
+select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a');
+ jsonb_delete
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a');
+ jsonb_delete
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b');
+ jsonb_delete
+------------------
+ {"a": 1, "c": 3}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c');
+ jsonb_delete
+------------------
+ {"a": 1, "b": 2}
+(1 row)
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd');
+ jsonb_delete
+--------------------------
+ {"a": 1, "b": 2, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'a';
+ ?column?
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select '{"a":null , "b":2, "c":3}'::jsonb - 'a';
+ ?column?
+------------------
+ {"b": 2, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'b';
+ ?column?
+------------------
+ {"a": 1, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'c';
+ ?column?
+------------------
+ {"a": 1, "b": 2}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'd';
+ ?column?
+--------------------------
+ {"a": 1, "b": 2, "c": 3}
+(1 row)
+
+select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb);
+ ?column?
+----------
+ t
+(1 row)
+
+select '["a","b","c"]'::jsonb - 3;
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 2;
+ ?column?
+------------
+ ["a", "b"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 1;
+ ?column?
+------------
+ ["a", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - 0;
+ ?column?
+------------
+ ["b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -1;
+ ?column?
+------------
+ ["a", "b"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -2;
+ ?column?
+------------
+ ["a", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -3;
+ ?column?
+------------
+ ["b", "c"]
+(1 row)
+
+select '["a","b","c"]'::jsonb - -4;
+ ?column?
+-----------------
+ ["a", "b", "c"]
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[];
+ ?column?
+------------------
+ {"a": 1, "c": 3}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[];
+ ?column?
+----------
+ {"a": 1}
+(1 row)
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[];
+ ?column?
+--------------------------
+ {"a": 1, "b": 2, "c": 3}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]');
+ jsonb_set
+--------------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": [1, 2, 3]}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]');
+ jsonb_set
+-----------------------------------------------------------------------------
+ {"a": 1, "b": [1, [1, 2, 3]], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]');
+ jsonb_set
+-----------------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [[1, 2, 3], 3]}, "n": null}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]');
+ERROR: path element at position 2 is null
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}');
+ jsonb_set
+-------------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": {"1": 2}}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}');
+ jsonb_set
+----------------------------------------------------------------------------
+ {"a": 1, "b": [1, {"1": 2}], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}');
+ jsonb_set
+----------------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [{"1": 2}, 3]}, "n": null}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}');
+ERROR: path element at position 2 is null
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+ jsonb_set
+--------------------------------------------------------------------------
+ {"a": 1, "b": [1, "test"], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+ jsonb_set
+---------------------------------------------------------------------------------
+ {"a": 1, "b": [1, {"f": "test"}], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}');
+ jsonb_delete_path
+----------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}}
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}');
+ jsonb_delete_path
+------------------------------------------------------------------
+ {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}');
+ jsonb_delete_path
+------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}';
+ ?column?
+----------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}';
+ ?column?
+------------------------------------------------------------------
+ {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null}
+(1 row)
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+ERROR: path element at position 2 is not an integer: "-1e"
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}';
+ ?column?
+------------------------------------------------------------------
+ {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null}
+(1 row)
+
+-- empty structure and error conditions for delete and replace
+select '"a"'::jsonb - 'a'; -- error
+ERROR: cannot delete from scalar
+select '{}'::jsonb - 'a';
+ ?column?
+----------
+ {}
+(1 row)
+
+select '[]'::jsonb - 'a';
+ ?column?
+----------
+ []
+(1 row)
+
+select '"a"'::jsonb - 1; -- error
+ERROR: cannot delete from scalar
+select '{}'::jsonb - 1; -- error
+ERROR: cannot delete from object using integer index
+select '[]'::jsonb - 1;
+ ?column?
+----------
+ []
+(1 row)
+
+select '"a"'::jsonb #- '{a}'; -- error
+ERROR: cannot delete path in scalar
+select '{}'::jsonb #- '{a}';
+ ?column?
+----------
+ {}
+(1 row)
+
+select '[]'::jsonb #- '{a}';
+ ?column?
+----------
+ []
+(1 row)
+
+select jsonb_set('"a"','{a}','"b"'); --error
+ERROR: cannot set path in scalar
+select jsonb_set('{}','{a}','"b"', false);
+ jsonb_set
+-----------
+ {}
+(1 row)
+
+select jsonb_set('[]','{1}','"b"', false);
+ jsonb_set
+-----------
+ []
+(1 row)
+
+select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false);
+ jsonb_set
+-------------------------
+ [[2, 3, 4], 2, null, 3]
+(1 row)
+
+-- jsonb_set adding instead of replacing
+-- prepend to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}');
+ jsonb_set
+-------------------------------------------------------
+ {"a": 1, "b": [{"foo": 123}, 0, 1, 2], "c": {"d": 4}}
+(1 row)
+
+-- append to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}');
+ jsonb_set
+-------------------------------------------------------
+ {"a": 1, "b": [0, 1, 2, {"foo": 123}], "c": {"d": 4}}
+(1 row)
+
+-- check nesting levels addition
+select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}');
+ jsonb_set
+---------------------------------------------------------------------
+ {"a": 1, "b": [4, 5, [0, 1, 2, {"foo": 123}], 6, 7], "c": {"d": 4}}
+(1 row)
+
+-- add new key
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}');
+ jsonb_set
+------------------------------------------------------------
+ {"a": 1, "b": [0, 1, 2], "c": {"d": 4, "e": {"foo": 123}}}
+(1 row)
+
+-- adding doesn't do anything if elements before last aren't present
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}');
+ jsonb_set
+-----------------------------------------
+ {"a": 1, "b": [0, 1, 2], "c": {"d": 4}}
+(1 row)
+
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+ jsonb_set
+-----------------------------------------
+ {"a": 1, "b": [0, 1, 2], "c": {"d": 4}}
+(1 row)
+
+-- add to empty object
+select jsonb_set('{}','{x}','{"foo":123}');
+ jsonb_set
+---------------------
+ {"x": {"foo": 123}}
+(1 row)
+
+--add to empty array
+select jsonb_set('[]','{0}','{"foo":123}');
+ jsonb_set
+----------------
+ [{"foo": 123}]
+(1 row)
+
+select jsonb_set('[]','{99}','{"foo":123}');
+ jsonb_set
+----------------
+ [{"foo": 123}]
+(1 row)
+
+select jsonb_set('[]','{-99}','{"foo":123}');
+ jsonb_set
+----------------
+ [{"foo": 123}]
+(1 row)
+
+select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+ERROR: path element at position 2 is not an integer: "non_integer"
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+ERROR: path element at position 3 is not an integer: "non_integer"
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+ERROR: path element at position 3 is null
+-- jsonb_set_lax
+\pset null NULL
+-- pass though non nulls to jsonb_set
+select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ;
+ jsonb_set_lax
+------------------
+ {"a": 1, "b": 5}
+(1 row)
+
+select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+ jsonb_set_lax
+--------------------------
+ {"a": 1, "b": 2, "d": 6}
+(1 row)
+
+-- using the default treatment
+select jsonb_set_lax('{"a":1,"b":2}','{b}',null);
+ jsonb_set_lax
+---------------------
+ {"a": 1, "b": null}
+(1 row)
+
+select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+ jsonb_set_lax
+-----------------------------
+ {"a": 1, "b": 2, "d": null}
+(1 row)
+
+-- errors
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null);
+ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception"
+-- explicit treatments
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception;
+ERROR: JSON value must not be null
+DETAIL: Exception was raised because null_value_treatment is "raise_exception".
+HINT: To avoid, either change the null_value_treatment argument or ensure that an SQL NULL is not passed.
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target;
+ return_target
+------------------
+ {"a": 1, "b": 2}
+(1 row)
+
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key;
+ delete_key
+------------
+ {"a": 1}
+(1 row)
+
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null;
+ use_json_null
+---------------------
+ {"a": 1, "b": null}
+(1 row)
+
+\pset null ''
+-- jsonb_insert
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": [0, "new_value", 1, 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, "new_value", 2]}
+(1 row)
+
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+ jsonb_insert
+------------------------------------------------------------
+ {"a": {"b": {"c": [0, 1, "new_value", "test1", "test2"]}}}
+(1 row)
+
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true);
+ jsonb_insert
+------------------------------------------------------------
+ {"a": {"b": {"c": [0, 1, "test1", "new_value", "test2"]}}}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+ jsonb_insert
+----------------------------------
+ {"a": [0, {"b": "value"}, 1, 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+ jsonb_insert
+----------------------------------------
+ {"a": [0, ["value1", "value2"], 1, 2]}
+(1 row)
+
+-- edge cases
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": ["new_value", 0, 1, 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, "new_value", 1, 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, "new_value", 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, 2, "new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, "new_value", 2]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true);
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, 2, "new_value"]}
+(1 row)
+
+select jsonb_insert('[]', '{1}', '"new_value"');
+ jsonb_insert
+---------------
+ ["new_value"]
+(1 row)
+
+select jsonb_insert('[]', '{1}', '"new_value"', true);
+ jsonb_insert
+---------------
+ ["new_value"]
+(1 row)
+
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+ jsonb_insert
+----------------------
+ {"a": ["new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true);
+ jsonb_insert
+----------------------
+ {"a": ["new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": [0, 1, 2, "new_value"]}
+(1 row)
+
+select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+ jsonb_insert
+-------------------------------
+ {"a": ["new_value", 0, 1, 2]}
+(1 row)
+
+-- jsonb_insert should be able to insert new value for objects, but not to replace
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"');
+ jsonb_insert
+-----------------------------------------
+ {"a": {"b": "value", "c": "new_value"}}
+(1 row)
+
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true);
+ jsonb_insert
+-----------------------------------------
+ {"a": {"b": "value", "c": "new_value"}}
+(1 row)
+
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+ERROR: cannot replace existing key
+HINT: Try using the function jsonb_set to replace key value.
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+ERROR: cannot replace existing key
+HINT: Try using the function jsonb_set to replace key value.
+-- jsonb subscript
+select ('123'::jsonb)['a'];
+ jsonb
+-------
+
+(1 row)
+
+select ('123'::jsonb)[0];
+ jsonb
+-------
+
+(1 row)
+
+select ('123'::jsonb)[NULL];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": 1}'::jsonb)['a'];
+ jsonb
+-------
+ 1
+(1 row)
+
+select ('{"a": 1}'::jsonb)[0];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": 1}'::jsonb)['not_exist'];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": 1}'::jsonb)[NULL];
+ jsonb
+-------
+
+(1 row)
+
+select ('[1, "2", null]'::jsonb)['a'];
+ jsonb
+-------
+
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[0];
+ jsonb
+-------
+ 1
+(1 row)
+
+select ('[1, "2", null]'::jsonb)['1'];
+ jsonb
+-------
+ "2"
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[1.0];
+ERROR: subscript type numeric is not supported
+LINE 1: select ('[1, "2", null]'::jsonb)[1.0];
+ ^
+HINT: jsonb subscript must be coercible to either integer or text.
+select ('[1, "2", null]'::jsonb)[2];
+ jsonb
+-------
+ null
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[3];
+ jsonb
+-------
+
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[-2];
+ jsonb
+-------
+ "2"
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[1]['a'];
+ jsonb
+-------
+
+(1 row)
+
+select ('[1, "2", null]'::jsonb)[1][0];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b'];
+ jsonb
+-------
+ "c"
+(1 row)
+
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'];
+ jsonb
+-----------
+ [1, 2, 3]
+(1 row)
+
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1];
+ jsonb
+-------
+ 2
+(1 row)
+
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a'];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1'];
+ jsonb
+---------------
+ {"a2": "aaa"}
+(1 row)
+
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2'];
+ jsonb
+-------
+ "aaa"
+(1 row)
+
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3'];
+ jsonb
+-------
+
+(1 row)
+
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'];
+ jsonb
+-----------------------
+ ["aaa", "bbb", "ccc"]
+(1 row)
+
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2];
+ jsonb
+-------
+ "ccc"
+(1 row)
+
+-- slices are not supported
+select ('{"a": 1}'::jsonb)['a':'b'];
+ERROR: jsonb subscript does not support slices
+LINE 1: select ('{"a": 1}'::jsonb)['a':'b'];
+ ^
+select ('[1, "2", null]'::jsonb)[1:2];
+ERROR: jsonb subscript does not support slices
+LINE 1: select ('[1, "2", null]'::jsonb)[1:2];
+ ^
+select ('[1, "2", null]'::jsonb)[:2];
+ERROR: jsonb subscript does not support slices
+LINE 1: select ('[1, "2", null]'::jsonb)[:2];
+ ^
+select ('[1, "2", null]'::jsonb)[1:];
+ERROR: jsonb subscript does not support slices
+LINE 1: select ('[1, "2", null]'::jsonb)[1:];
+ ^
+select ('[1, "2", null]'::jsonb)[:];
+ERROR: jsonb subscript does not support slices
+create TEMP TABLE test_jsonb_subscript (
+ id int,
+ test_json jsonb
+);
+insert into test_jsonb_subscript values
+(1, '{}'), -- empty jsonb
+(2, '{"key": "value"}'); -- jsonb with data
+-- update empty jsonb
+update test_jsonb_subscript set test_json['a'] = '1' where id = 1;
+select * from test_jsonb_subscript;
+ id | test_json
+----+------------------
+ 2 | {"key": "value"}
+ 1 | {"a": 1}
+(2 rows)
+
+-- update jsonb with some data
+update test_jsonb_subscript set test_json['a'] = '1' where id = 2;
+select * from test_jsonb_subscript;
+ id | test_json
+----+--------------------------
+ 1 | {"a": 1}
+ 2 | {"a": 1, "key": "value"}
+(2 rows)
+
+-- replace jsonb
+update test_jsonb_subscript set test_json['a'] = '"test"';
+select * from test_jsonb_subscript;
+ id | test_json
+----+-------------------------------
+ 1 | {"a": "test"}
+ 2 | {"a": "test", "key": "value"}
+(2 rows)
+
+-- replace by object
+update test_jsonb_subscript set test_json['a'] = '{"b": 1}'::jsonb;
+select * from test_jsonb_subscript;
+ id | test_json
+----+---------------------------------
+ 1 | {"a": {"b": 1}}
+ 2 | {"a": {"b": 1}, "key": "value"}
+(2 rows)
+
+-- replace by array
+update test_jsonb_subscript set test_json['a'] = '[1, 2, 3]'::jsonb;
+select * from test_jsonb_subscript;
+ id | test_json
+----+----------------------------------
+ 1 | {"a": [1, 2, 3]}
+ 2 | {"a": [1, 2, 3], "key": "value"}
+(2 rows)
+
+-- use jsonb subscription in where clause
+select * from test_jsonb_subscript where test_json['key'] = '"value"';
+ id | test_json
+----+----------------------------------
+ 2 | {"a": [1, 2, 3], "key": "value"}
+(1 row)
+
+select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"';
+ id | test_json
+----+-----------
+(0 rows)
+
+select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"';
+ id | test_json
+----+-----------
+(0 rows)
+
+-- NULL
+update test_jsonb_subscript set test_json[NULL] = '1';
+ERROR: jsonb subscript in assignment must not be null
+update test_jsonb_subscript set test_json['another_key'] = NULL;
+select * from test_jsonb_subscript;
+ id | test_json
+----+-------------------------------------------------------
+ 1 | {"a": [1, 2, 3], "another_key": null}
+ 2 | {"a": [1, 2, 3], "key": "value", "another_key": null}
+(2 rows)
+
+-- NULL as jsonb source
+insert into test_jsonb_subscript values (3, NULL);
+update test_jsonb_subscript set test_json['a'] = '1' where id = 3;
+select * from test_jsonb_subscript;
+ id | test_json
+----+-------------------------------------------------------
+ 1 | {"a": [1, 2, 3], "another_key": null}
+ 2 | {"a": [1, 2, 3], "key": "value", "another_key": null}
+ 3 | {"a": 1}
+(3 rows)
+
+update test_jsonb_subscript set test_json = NULL where id = 3;
+update test_jsonb_subscript set test_json[0] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+---------------------------------------------------------------
+ 1 | {"0": 1, "a": [1, 2, 3], "another_key": null}
+ 2 | {"0": 1, "a": [1, 2, 3], "key": "value", "another_key": null}
+ 3 | [1]
+(3 rows)
+
+-- Fill the gaps logic
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[0]');
+update test_jsonb_subscript set test_json[5] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+--------------------------------
+ 1 | [0, null, null, null, null, 1]
+(1 row)
+
+update test_jsonb_subscript set test_json[-4] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+-----------------------------
+ 1 | [0, null, 1, null, null, 1]
+(1 row)
+
+update test_jsonb_subscript set test_json[-8] = '1';
+ERROR: path element at position 1 is out of range: -8
+select * from test_jsonb_subscript;
+ id | test_json
+----+-----------------------------
+ 1 | [0, null, 1, null, null, 1]
+(1 row)
+
+-- keep consistent values position
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+update test_jsonb_subscript set test_json[5] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+-----------------------------------
+ 1 | [null, null, null, null, null, 1]
+(1 row)
+
+-- create the whole path
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a'][0]['b'][0]['c'] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+----------------------------
+ 1 | {"a": [{"b": [{"c": 1}]}]}
+(1 row)
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a'][2]['b'][2]['c'][2] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+------------------------------------------------------------------
+ 1 | {"a": [null, null, {"b": [null, null, {"c": [null, null, 1]}]}]}
+(1 row)
+
+-- create the whole path with already existing keys
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"b": 1}');
+update test_jsonb_subscript set test_json['a'][0] = '2';
+select * from test_jsonb_subscript;
+ id | test_json
+----+--------------------
+ 1 | {"a": [2], "b": 1}
+(1 row)
+
+-- the start jsonb is an object, first subscript is treated as a key
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json[0]['a'] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+-----------------
+ 1 | {"0": {"a": 1}}
+(1 row)
+
+-- the start jsonb is an array
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+update test_jsonb_subscript set test_json[0]['a'] = '1';
+update test_jsonb_subscript set test_json[2]['b'] = '2';
+select * from test_jsonb_subscript;
+ id | test_json
+----+----------------------------
+ 1 | [{"a": 1}, null, {"b": 2}]
+(1 row)
+
+-- overwriting an existing path
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a']['b'][1] = '1';
+update test_jsonb_subscript set test_json['a']['b'][10] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+----------------------------------------------------------------------------
+ 1 | {"a": {"b": [null, 1, null, null, null, null, null, null, null, null, 1]}}
+(1 row)
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+update test_jsonb_subscript set test_json[0][0][0] = '1';
+update test_jsonb_subscript set test_json[0][0][1] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+------------
+ 1 | [[[1, 1]]]
+(1 row)
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a']['b'][10] = '1';
+update test_jsonb_subscript set test_json['a'][10][10] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+------------------------------------------------------------------------------------------------------------------------------------------------------
+ 1 | {"a": {"b": [null, null, null, null, null, null, null, null, null, null, 1], "10": [null, null, null, null, null, null, null, null, null, null, 1]}}
+(1 row)
+
+-- an empty sub element
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": {}}');
+update test_jsonb_subscript set test_json['a']['b']['c'][2] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+--------------------------------------
+ 1 | {"a": {"b": {"c": [null, null, 1]}}}
+(1 row)
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": []}');
+update test_jsonb_subscript set test_json['a'][1]['c'][2] = '1';
+select * from test_jsonb_subscript;
+ id | test_json
+----+---------------------------------------
+ 1 | {"a": [null, {"c": [null, null, 1]}]}
+(1 row)
+
+-- trying replace assuming a composite object, but it's an element or a value
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": 1}');
+update test_jsonb_subscript set test_json['a']['b'] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+update test_jsonb_subscript set test_json['a']['b']['c'] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+update test_jsonb_subscript set test_json['a'][0] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+update test_jsonb_subscript set test_json['a'][0]['c'] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+update test_jsonb_subscript set test_json['a'][0][0] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+-- trying replace assuming a composite object, but it's a raw scalar
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, 'null');
+update test_jsonb_subscript set test_json[0] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+update test_jsonb_subscript set test_json[0][0] = '1';
+ERROR: cannot replace existing key
+DETAIL: The path assumes key is a composite object, but it is a scalar value.
+-- jsonb to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+ to_tsvector
+---------------------------------------------------------------------------
+ 'aaa':1 'bbb':2 'ccc':4 'ddd':3 'eee':6 'fff':7 'ggg':8 'hhh':10 'iii':11
+(1 row)
+
+-- jsonb to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+ to_tsvector
+---------------------------------------------------------------------------
+ 'aaa':1 'bbb':2 'ccc':4 'ddd':3 'eee':6 'fff':7 'ggg':8 'hhh':10 'iii':11
+(1 row)
+
+-- jsonb to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::jsonb);
+ to_tsvector
+----------------------------------------------------------------------------
+ 'aaa':1 'bbb':3 'ccc':5 'ddd':4 'eee':8 'fff':9 'ggg':10 'hhh':12 'iii':13
+(1 row)
+
+-- jsonb to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::jsonb);
+ to_tsvector
+---------------------------------
+ 'aaa':1 'bbb':3 'ccc':5 'ddd':4
+(1 row)
+
+-- jsonb_to_tsvector
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+ jsonb_to_tsvector
+----------------------------------------------------------------------------------------
+ '123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ jsonb_to_tsvector
+--------------------------------
+ 'b':2 'c':4 'd':6 'f':8 'g':10
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ jsonb_to_tsvector
+-------------------
+ 'aaa':1 'bbb':3
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ jsonb_to_tsvector
+-------------------
+ '123':1 '456':3
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ jsonb_to_tsvector
+-------------------
+ 'fals':3 'true':1
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ jsonb_to_tsvector
+---------------------------------
+ '123':5 '456':7 'aaa':1 'bbb':3
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+ jsonb_to_tsvector
+----------------------------------------------------------------------------------------
+ '123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+ jsonb_to_tsvector
+--------------------------------
+ 'b':2 'c':4 'd':6 'f':8 'g':10
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+ jsonb_to_tsvector
+-------------------
+ 'aaa':1 'bbb':3
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+ jsonb_to_tsvector
+-------------------
+ '123':1 '456':3
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+ jsonb_to_tsvector
+-------------------
+ 'fals':3 'true':1
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+ jsonb_to_tsvector
+---------------------------------
+ '123':5 '456':7 'aaa':1 'bbb':3
+(1 row)
+
+-- to_tsvector corner cases
+select to_tsvector('""'::jsonb);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('{}'::jsonb);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('[]'::jsonb);
+ to_tsvector
+-------------
+
+(1 row)
+
+select to_tsvector('null'::jsonb);
+ to_tsvector
+-------------
+
+(1 row)
+
+-- jsonb_to_tsvector corner cases
+select jsonb_to_tsvector('""'::jsonb, '"all"');
+ jsonb_to_tsvector
+-------------------
+
+(1 row)
+
+select jsonb_to_tsvector('{}'::jsonb, '"all"');
+ jsonb_to_tsvector
+-------------------
+
+(1 row)
+
+select jsonb_to_tsvector('[]'::jsonb, '"all"');
+ jsonb_to_tsvector
+-------------------
+
+(1 row)
+
+select jsonb_to_tsvector('null'::jsonb, '"all"');
+ jsonb_to_tsvector
+-------------------
+
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""');
+ERROR: wrong flag in flag array: ""
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}');
+ERROR: wrong flag type, only arrays and scalars are allowed
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]');
+ jsonb_to_tsvector
+-------------------
+
+(1 row)
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null');
+ERROR: flag array element is not a string
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
+ERROR: flag array element is not a string
+HINT: Possible values are: "string", "numeric", "boolean", "key", and "all".
+-- ts_headline for jsonb
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ts_headline
+------------------------------------------------------------------------------------------------------------------
+ {"a": "aaa <b>bbb</b>", "b": {"c": "ccc <b>ddd</b> fff", "c1": "ccc1 ddd1"}, "d": ["ggg <b>hhh</b>", "iii jjj"]}
+(1 row)
+
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+ ts_headline
+-----------------------------------------------------------------------------------------------
+ {"a": "aaa <b>bbb</b>", "b": {"c": "ccc <b>ddd</b> fff"}, "d": ["ggg <b>hhh</b>", "iii jjj"]}
+(1 row)
+
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ts_headline
+---------------------------------------------------------------------------------------------------
+ {"a": "aaa <bbb>", "b": {"c": "ccc <ddd> fff", "c1": "ccc1 ddd1"}, "d": ["ggg <hhh>", "iii jjj"]}
+(1 row)
+
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+ ts_headline
+---------------------------------------------------------------------------------------------------
+ {"a": "aaa <bbb>", "b": {"c": "ccc <ddd> fff", "c1": "ccc1 ddd1"}, "d": ["ggg <hhh>", "iii jjj"]}
+(1 row)
+
+-- corner cases for ts_headline with jsonb
+select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ null
+(1 row)
+
+select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ {}
+(1 row)
+
+select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+ ts_headline
+-------------
+ []
+(1 row)
+
+-- casts
+select 'true'::jsonb::bool;
+ bool
+------
+ t
+(1 row)
+
+select '[]'::jsonb::bool;
+ERROR: cannot cast jsonb array to type boolean
+select '1.0'::jsonb::float;
+ float8
+--------
+ 1
+(1 row)
+
+select '[1.0]'::jsonb::float;
+ERROR: cannot cast jsonb array to type double precision
+select '12345'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '"hello"'::jsonb::int4;
+ERROR: cannot cast jsonb string to type integer
+select '12345'::jsonb::numeric;
+ numeric
+---------
+ 12345
+(1 row)
+
+select '{}'::jsonb::numeric;
+ERROR: cannot cast jsonb object to type numeric
+select '12345.05'::jsonb::numeric;
+ numeric
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::float4;
+ float4
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::float8;
+ float8
+----------
+ 12345.05
+(1 row)
+
+select '12345.05'::jsonb::int2;
+ int2
+-------
+ 12345
+(1 row)
+
+select '12345.05'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '12345.05'::jsonb::int8;
+ int8
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric;
+ numeric
+------------------------------------------------------
+ 12345.0000000000000000000000000000000000000000000005
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4;
+ float4
+--------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8;
+ float8
+--------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2;
+ int2
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4;
+ int4
+-------
+ 12345
+(1 row)
+
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8;
+ int8
+-------
+ 12345
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonb.sql b/yql/essentials/tests/postgresql/original/cases/jsonb.sql
new file mode 100644
index 0000000000..5016f29c15
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonb.sql
@@ -0,0 +1,1484 @@
+-- Strings.
+SELECT '""'::jsonb; -- OK.
+SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
+SELECT '"abc"'::jsonb; -- OK
+SELECT '"abc'::jsonb; -- ERROR, quotes not closed
+SELECT '"abc
+def"'::jsonb; -- ERROR, unescaped newline in string constant
+SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
+SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape
+-- see json_encoding test for input with unicode escapes
+
+-- Numbers.
+SELECT '1'::jsonb; -- OK
+SELECT '0'::jsonb; -- OK
+SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec
+SELECT '0.1'::jsonb; -- OK
+SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8
+SELECT '1e100'::jsonb; -- OK
+SELECT '1.3e100'::jsonb; -- OK
+SELECT '1f2'::jsonb; -- ERROR
+SELECT '0.x1'::jsonb; -- ERROR
+SELECT '1.3ex100'::jsonb; -- ERROR
+
+-- Arrays.
+SELECT '[]'::jsonb; -- OK
+SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::jsonb; -- OK
+SELECT '[1,2]'::jsonb; -- OK
+SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma
+SELECT '[1,2'::jsonb; -- ERROR, no closing bracket
+SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket
+
+-- Objects.
+SELECT '{}'::jsonb; -- OK
+SELECT '{"abc"}'::jsonb; -- ERROR, no value
+SELECT '{"abc":1}'::jsonb; -- OK
+SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings
+SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator
+SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator
+SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator
+SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+
+-- Recursion.
+SET max_stack_depth = '100kB';
+SELECT repeat('[', 10000)::jsonb;
+SELECT repeat('{"a":', 10000)::jsonb;
+RESET max_stack_depth;
+
+-- Miscellaneous stuff.
+SELECT 'true'::jsonb; -- OK
+SELECT 'false'::jsonb; -- OK
+SELECT 'null'::jsonb; -- OK
+SELECT ' true '::jsonb; -- OK, even with extra whitespace
+SELECT 'true false'::jsonb; -- ERROR, too many values
+SELECT 'true, false'::jsonb; -- ERROR, too many values
+SELECT 'truf'::jsonb; -- ERROR, not a keyword
+SELECT 'trues'::jsonb; -- ERROR, not a keyword
+SELECT ''::jsonb; -- ERROR, no value
+SELECT ' '::jsonb; -- ERROR, no value
+
+-- Multi-line JSON input to check ERROR reporting
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "three":
+ true}'::jsonb; -- OK
+SELECT '{
+ "one": 1,
+ "two":,"two", -- ERROR extraneous comma before field "two"
+ "three":
+ true}'::jsonb;
+SELECT '{
+ "one": 1,
+ "two":"two",
+ "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb;
+-- ERROR missing value for last field
+
+-- make sure jsonb is passed through json generators without being escaped
+SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']);
+
+-- anyarray column
+
+CREATE TEMP TABLE rows AS
+SELECT x, 'txt' || x as y
+FROM generate_series(1,3) AS x;
+
+analyze rows;
+
+select attname, to_jsonb(histogram_bounds) histogram_bounds
+from pg_stats
+where tablename = 'rows' and
+ schemaname = pg_my_temp_schema()::regnamespace::text
+order by 1;
+
+-- to_jsonb, timestamps
+
+select to_jsonb(timestamp '2014-05-28 12:22:35.614298');
+
+BEGIN;
+SET LOCAL TIME ZONE 10.5;
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+SET LOCAL TIME ZONE -8;
+select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04');
+COMMIT;
+
+select to_jsonb(date '2014-05-28');
+
+select to_jsonb(date 'Infinity');
+select to_jsonb(date '-Infinity');
+select to_jsonb(timestamp 'Infinity');
+select to_jsonb(timestamp '-Infinity');
+select to_jsonb(timestamptz 'Infinity');
+select to_jsonb(timestamptz '-Infinity');
+
+--jsonb_agg
+
+SELECT jsonb_agg(q)
+ FROM ( SELECT $$a$$ || x AS b, y AS c,
+ ARRAY[ROW(x.*,ARRAY[1,2,3]),
+ ROW(y.*,ARRAY[4,5,6])] AS z
+ FROM generate_series(1,2) x,
+ generate_series(4,5) y) q;
+
+SELECT jsonb_agg(q ORDER BY x, y)
+ FROM rows q;
+
+UPDATE rows SET x = NULL WHERE x = 1;
+
+SELECT jsonb_agg(q ORDER BY x NULLS FIRST, y)
+ FROM rows q;
+
+-- jsonb extraction functions
+CREATE TEMP TABLE test_jsonb (
+ json_type text,
+ test_json jsonb
+);
+
+INSERT INTO test_jsonb VALUES
+('scalar','"a scalar"'),
+('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'),
+('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}');
+
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object';
+
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object';
+
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object';
+
+SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array';
+
+SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object';
+SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object';
+
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar';
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array';
+SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object';
+
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar';
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array';
+SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object';
+
+-- nulls
+SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object';
+SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object';
+SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array';
+SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array';
+
+-- corner cases
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> '';
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z';
+select '{"a": "c", "b": null}'::jsonb -> 'b';
+select '"foo"'::jsonb -> 1;
+select '"foo"'::jsonb -> 'z';
+
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1;
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z';
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> '';
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3;
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z';
+select '{"a": "c", "b": null}'::jsonb ->> 'b';
+select '"foo"'::jsonb ->> 1;
+select '"foo"'::jsonb ->> 'z';
+
+-- equality and inequality
+SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb;
+SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb;
+
+SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb;
+SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb;
+
+-- containment
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}');
+SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}');
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}';
+SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}';
+
+SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb;
+SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
+SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb;
+SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb;
+SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb;
+SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb;
+
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}');
+SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}');
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}';
+-- Raw scalar may contain another raw scalar, array may contain a raw scalar
+SELECT '[5]'::jsonb @> '[5]';
+SELECT '5'::jsonb @> '5';
+SELECT '[5]'::jsonb @> '5';
+-- But a raw scalar cannot contain an array
+SELECT '5'::jsonb @> '[5]';
+-- In general, one thing should always contain itself. Test array containment:
+SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb;
+SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb;
+-- array containment string matching confusion bug
+SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}';
+
+-- array length
+SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
+SELECT jsonb_array_length('[]');
+SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}');
+SELECT jsonb_array_length('4');
+
+-- each
+SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
+SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+
+SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}');
+SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q;
+SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q;
+
+-- exists
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a');
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b');
+SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c');
+SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a');
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'a';
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'b';
+SELECT jsonb '{"a":null, "b":"qq"}' ? 'c';
+SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a';
+-- array exists - array elements should behave as keys
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']);
+SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]);
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[];
+
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']);
+SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]);
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b'];
+SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[];
+
+-- typeof
+SELECT jsonb_typeof('{}') AS object;
+SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object;
+SELECT jsonb_typeof('[]') AS array;
+SELECT jsonb_typeof('["a", 1]') AS array;
+SELECT jsonb_typeof('null') AS "null";
+SELECT jsonb_typeof('1') AS number;
+SELECT jsonb_typeof('-1') AS number;
+SELECT jsonb_typeof('1.0') AS number;
+SELECT jsonb_typeof('1e2') AS number;
+SELECT jsonb_typeof('-1.0') AS number;
+SELECT jsonb_typeof('true') AS boolean;
+SELECT jsonb_typeof('false') AS boolean;
+SELECT jsonb_typeof('"hello"') AS string;
+SELECT jsonb_typeof('"true"') AS string;
+SELECT jsonb_typeof('"1.0"') AS string;
+
+-- jsonb_build_array, jsonb_build_object, jsonb_object_agg
+
+SELECT jsonb_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+SELECT jsonb_build_array('a', NULL); -- ok
+SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok
+SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok
+SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok
+SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok
+SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok
+SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+
+SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}');
+
+SELECT jsonb_build_object(
+ 'a', jsonb_build_object('b',false,'c',99),
+ 'd', jsonb_build_object('e',array[9,8,7]::int[],
+ 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r)));
+SELECT jsonb_build_object('{a,b,c}'::text[]); -- error
+SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array
+SELECT jsonb_build_object('a', 'b', 'c'); -- error
+SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL
+SELECT jsonb_build_object('a', NULL); -- ok
+SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok
+SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok
+SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error
+SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok
+SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok
+SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok
+SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok
+
+-- empty objects/arrays
+SELECT jsonb_build_array();
+
+SELECT jsonb_build_object();
+
+-- make sure keys are quoted
+SELECT jsonb_build_object(1,2);
+
+-- keys must be scalar and not null
+SELECT jsonb_build_object(null,2);
+
+SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r;
+
+SELECT jsonb_build_object(json '{"a":1,"b":2}', 3);
+
+SELECT jsonb_build_object('{1,2,3}'::int[], 3);
+
+-- handling of NULL values
+SELECT jsonb_object_agg(1, NULL::jsonb);
+SELECT jsonb_object_agg(NULL, '{"a":1}');
+
+CREATE TEMP TABLE foo (serial_num int, name text, type text);
+INSERT INTO foo VALUES (847001,'t15','GE1043');
+INSERT INTO foo VALUES (847002,'t16','GE1043');
+INSERT INTO foo VALUES (847003,'sub-alpha','GESS90');
+
+SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type)))
+FROM foo;
+
+SELECT jsonb_object_agg(name, type) FROM foo;
+
+INSERT INTO foo VALUES (999999, NULL, 'bar');
+SELECT jsonb_object_agg(name, type) FROM foo;
+
+-- jsonb_object
+
+-- empty object, one dimension
+SELECT jsonb_object('{}');
+
+-- empty object, two dimensions
+SELECT jsonb_object('{}', '{}');
+
+-- one dimension
+SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}');
+
+-- same but with two dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+
+-- odd number error
+SELECT jsonb_object('{a,b,c}');
+
+-- one column error
+SELECT jsonb_object('{{a},{b}}');
+
+-- too many columns error
+SELECT jsonb_object('{{a,b,c},{b,c,d}}');
+
+-- too many dimensions error
+SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}');
+
+--two argument form of jsonb_object
+
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}');
+
+-- too many dimensions
+SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}');
+
+-- mismatched dimensions
+
+select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}');
+
+select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}');
+
+-- null key error
+
+select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}');
+
+-- empty key is allowed
+
+select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}');
+
+
+
+-- extract_path, extract_path_as_text
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6');
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2');
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text);
+SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text);
+
+-- extract_path nulls
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false;
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true;
+SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false;
+SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true;
+
+-- extract_path operators
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6'];
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2'];
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0'];
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1'];
+
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6'];
+SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2'];
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0'];
+SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1'];
+
+-- corner cases for same
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
+select '[1,2,3]'::jsonb #> '{}';
+select '"foo"'::jsonb #> '{}';
+select '42'::jsonb #> '{}';
+select 'null'::jsonb #> '{}';
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', ''];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b'];
+select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b'];
+select '"foo"'::jsonb #> array['z'];
+select '42'::jsonb #> array['f2'];
+select '42'::jsonb #> array['0'];
+
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}';
+select '[1,2,3]'::jsonb #>> '{}';
+select '"foo"'::jsonb #>> '{}';
+select '42'::jsonb #>> '{}';
+select 'null'::jsonb #>> '{}';
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', ''];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d'];
+select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b'];
+select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b'];
+select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b'];
+select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b'];
+select '"foo"'::jsonb #>> array['z'];
+select '42'::jsonb #>> array['f2'];
+select '42'::jsonb #>> array['0'];
+
+-- array_elements
+SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]');
+SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q;
+SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]');
+SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q;
+
+-- populate_record
+CREATE TYPE jbpop AS (a text, b int, c timestamp);
+
+CREATE DOMAIN jsb_int_not_null AS int NOT NULL;
+CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3);
+CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3);
+
+create type jb_unordered_pair as (x int, y int);
+create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y);
+
+CREATE TYPE jsbrec AS (
+ i int,
+ ia _int4,
+ ia1 int[],
+ ia2 int[][],
+ ia3 int[][][],
+ ia1d jsb_int_array_1d,
+ ia2d jsb_int_array_2d,
+ t text,
+ ta text[],
+ c char(10),
+ ca char(10)[],
+ ts timestamp,
+ js json,
+ jsb jsonb,
+ jsa json[],
+ rec jbpop,
+ reca jbpop[]
+);
+
+CREATE TYPE jsbrec_i_not_null AS (
+ i jsb_int_not_null
+);
+
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q;
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q;
+
+SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q;
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q;
+
+SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q;
+
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q;
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q;
+SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q;
+
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q;
+SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q;
+
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q;
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q;
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q;
+SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q;
+
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q;
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q;
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q;
+SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q;
+
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q;
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q;
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q;
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q;
+SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q;
+
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q;
+SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q;
+
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q;
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q;
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q;
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q;
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q;
+SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q;
+
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q;
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q;
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q;
+SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q;
+
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q;
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q;
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q;
+SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q;
+
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q;
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q;
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q;
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q;
+SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q;
+
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q;
+SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q;
+
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q;
+SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q;
+
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q;
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q;
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q;
+SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q;
+
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q;
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q;
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q;
+SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q;
+
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q;
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q;
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q;
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q;
+SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q;
+
+SELECT rec FROM jsonb_populate_record(
+ row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+ row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec,
+ '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}'
+) q;
+
+-- anonymous record type
+SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}');
+SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}');
+SELECT * FROM
+ jsonb_populate_record(null::record, '{"x": 776}') AS (x int, y int);
+
+-- composite domain
+SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}');
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}');
+SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}');
+
+-- populate_recordset
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q;
+SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
+
+-- anonymous record type
+SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]');
+SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]');
+SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]')
+FROM (VALUES (1),(2)) v(i);
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int);
+
+-- empty array is a corner case
+SELECT jsonb_populate_recordset(null::record, '[]');
+SELECT jsonb_populate_recordset(row(1,2), '[]');
+SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q;
+SELECT * FROM
+ jsonb_populate_recordset(null::record, '[]') AS (x int, y int);
+
+-- composite domain
+SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]');
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]');
+SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]');
+
+-- negative cases where the wrong record type is supplied
+select * from jsonb_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text);
+select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text);
+
+-- jsonb_to_record and jsonb_to_recordset
+
+select * from jsonb_to_record('{"a":1,"b":"foo","c":"bar"}')
+ as x(a int, b text, d text);
+
+select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]')
+ as x(a int, b text, c boolean);
+
+select *, c is null as c_is_null
+from jsonb_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::jsonb)
+ as t(a int, b jsonb, c text, x int, ca char(5)[], ia int[][], r jbpop);
+
+select *, c is null as c_is_null
+from jsonb_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::jsonb)
+ as t(a int, b jsonb, c text, x int);
+
+select * from jsonb_to_record('{"ia": null}') as x(ia _int4);
+select * from jsonb_to_record('{"ia": 123}') as x(ia _int4);
+select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4);
+select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4);
+select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4);
+select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4);
+
+select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]);
+select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]);
+select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]);
+
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json);
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json);
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json);
+select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb);
+select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb);
+select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb);
+
+-- test type info caching in jsonb_populate_record()
+CREATE TEMP TABLE jsbpoptest (js jsonb);
+
+INSERT INTO jsbpoptest
+SELECT '{
+ "jsa": [1, "2", null, 4],
+ "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2},
+ "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]
+}'::jsonb
+FROM generate_series(1, 3);
+
+SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest;
+
+DROP TYPE jsbrec;
+DROP TYPE jsbrec_i_not_null;
+DROP DOMAIN jsb_int_not_null;
+DROP DOMAIN jsb_int_array_1d;
+DROP DOMAIN jsb_int_array_2d;
+DROP DOMAIN jb_ordered_pair;
+DROP TYPE jb_unordered_pair;
+
+-- indexing
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+
+CREATE INDEX jidx ON testjsonb USING gin (j);
+SET enable_seqscan = off;
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}';
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+SELECT count(*) FROM testjsonb WHERE j ? 'public';
+SELECT count(*) FROM testjsonb WHERE j ? 'bar';
+SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled'];
+SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled'];
+
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)';
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+
+-- array exists - array elements should behave as keys (for GIN index scans too)
+CREATE INDEX jidx_array ON testjsonb USING gin((j->'array'));
+SELECT count(*) from testjsonb WHERE j->'array' ? 'bar';
+-- type sensitive array exists - should return no rows (since "exists" only
+-- matches strings that are either object keys or array elements)
+SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text;
+-- However, a raw scalar is *contained* within the array
+SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb;
+
+RESET enable_seqscan;
+
+SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow;
+SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key;
+
+-- sort/hash
+SELECT count(distinct j) FROM testjsonb;
+SET enable_hashagg = off;
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+SET enable_hashagg = on;
+SET enable_sort = off;
+SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2;
+SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j);
+SET enable_sort = on;
+
+RESET enable_hashagg;
+RESET enable_sort;
+
+DROP INDEX jidx;
+DROP INDEX jidx_array;
+-- btree
+CREATE INDEX jidx ON testjsonb USING btree (j);
+SET enable_seqscan = off;
+
+SELECT count(*) FROM testjsonb WHERE j > '{"p":1}';
+SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}';
+
+--gin path opclass
+DROP INDEX jidx;
+CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops);
+SET enable_seqscan = off;
+
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}';
+SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}';
+-- exercise GIN_SEARCH_MODE_ALL
+SELECT count(*) FROM testjsonb WHERE j @> '{}';
+
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))';
+SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"';
+SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))';
+SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)';
+
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)';
+SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)';
+SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")';
+SELECT count(*) FROM testjsonb WHERE j @? '$';
+SELECT count(*) FROM testjsonb WHERE j @? '$.public';
+SELECT count(*) FROM testjsonb WHERE j @? '$.bar';
+
+RESET enable_seqscan;
+DROP INDEX jidx;
+
+-- nested tests
+SELECT '{"ff":{"a":12,"b":16}}'::jsonb;
+SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb;
+SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb;
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2"],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2",["c3"],{"c4":4}],"d":{"d1":"d1","d2":"d2"}}}'::jsonb;
+SELECT '{"ff":["a","aaa"]}'::jsonb;
+
+SELECT
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff',
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq',
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f,
+ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t,
+ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x';
+
+-- nested containment
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}';
+SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}';
+SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]';
+SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]';
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]';
+SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]';
+
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}';
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}';
+SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}';
+
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}';
+SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}';
+
+-- check some corner cases for indexed nested containment (bug #13756)
+create temp table nestjsonb (j jsonb);
+insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}');
+insert into nestjsonb (j) values ('[[14,2,3]]');
+insert into nestjsonb (j) values ('[1,[14,2,3]]');
+create index on nestjsonb using gin(j jsonb_path_ops);
+
+set enable_seqscan = on;
+set enable_bitmapscan = off;
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+select * from nestjsonb where j @> '{"c":3}';
+select * from nestjsonb where j @> '[[14]]';
+set enable_seqscan = off;
+set enable_bitmapscan = on;
+select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
+select * from nestjsonb where j @> '{"c":3}';
+select * from nestjsonb where j @> '[[14]]';
+reset enable_seqscan;
+reset enable_bitmapscan;
+
+-- nested object field / array index lookup
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error
+
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 0;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 2;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 4;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> 5;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -1;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -5;
+SELECT '["a","b","c",[1,2],null]'::jsonb -> -6;
+
+--nested path extraction
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}';
+SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}';
+
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}';
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}';
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}';
+SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}';
+
+--nested exists
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd';
+SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e';
+
+-- jsonb_strip_nulls
+
+select jsonb_strip_nulls(null);
+
+select jsonb_strip_nulls('1');
+
+select jsonb_strip_nulls('"a string"');
+
+select jsonb_strip_nulls('null');
+
+select jsonb_strip_nulls('[1,2,null,3,4]');
+
+select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}');
+
+select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]');
+
+-- an empty object is not null and should not be stripped
+select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }');
+
+
+select jsonb_pretty('{"a": "test", "b": [1, 2, 3], "c": "test3", "d":{"dd": "test4", "dd2":{"ddd": "test5"}}}');
+select jsonb_pretty('[{"f1":1,"f2":null},2,null,[[{"x":true},6,7],8],3]');
+select jsonb_pretty('{"a":["b", "c"], "d": {"e":"f"}}');
+
+select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}');
+
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}';
+select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}';
+
+select '["a", "b"]'::jsonb || '["c"]';
+select '["a", "b"]'::jsonb || '["c", "d"]';
+select '["c"]' || '["a", "b"]'::jsonb;
+
+select '["a", "b"]'::jsonb || '"c"';
+select '"c"' || '["a", "b"]'::jsonb;
+
+select '[]'::jsonb || '["a"]'::jsonb;
+select '[]'::jsonb || '"a"'::jsonb;
+select '"b"'::jsonb || '"a"'::jsonb;
+select '{}'::jsonb || '{"a":"b"}'::jsonb;
+select '[]'::jsonb || '{"a":"b"}'::jsonb;
+select '{"a":"b"}'::jsonb || '[]'::jsonb;
+
+select '"a"'::jsonb || '{"a":1}';
+select '{"a":1}' || '"a"'::jsonb;
+
+select '[3]'::jsonb || '{}'::jsonb;
+select '3'::jsonb || '[]'::jsonb;
+select '3'::jsonb || '4'::jsonb;
+select '3'::jsonb || '{}'::jsonb;
+
+select '["a", "b"]'::jsonb || '{"c":1}';
+select '{"c": 1}'::jsonb || '["a", "b"]';
+
+select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}';
+
+select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb);
+select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb);
+
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a');
+select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c');
+select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd');
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'a';
+select '{"a":null , "b":2, "c":3}'::jsonb - 'a';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'b';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'c';
+select '{"a":1 , "b":2, "c":3}'::jsonb - 'd';
+select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb);
+
+select '["a","b","c"]'::jsonb - 3;
+select '["a","b","c"]'::jsonb - 2;
+select '["a","b","c"]'::jsonb - 1;
+select '["a","b","c"]'::jsonb - 0;
+select '["a","b","c"]'::jsonb - -1;
+select '["a","b","c"]'::jsonb - -2;
+select '["a","b","c"]'::jsonb - -3;
+select '["a","b","c"]'::jsonb - -4;
+
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[];
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[];
+select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[];
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]');
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}');
+
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"');
+select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}');
+
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}');
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}');
+select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}');
+
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}';
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}';
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript
+select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}';
+
+
+-- empty structure and error conditions for delete and replace
+
+select '"a"'::jsonb - 'a'; -- error
+select '{}'::jsonb - 'a';
+select '[]'::jsonb - 'a';
+select '"a"'::jsonb - 1; -- error
+select '{}'::jsonb - 1; -- error
+select '[]'::jsonb - 1;
+select '"a"'::jsonb #- '{a}'; -- error
+select '{}'::jsonb #- '{a}';
+select '[]'::jsonb #- '{a}';
+select jsonb_set('"a"','{a}','"b"'); --error
+select jsonb_set('{}','{a}','"b"', false);
+select jsonb_set('[]','{1}','"b"', false);
+select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false);
+
+-- jsonb_set adding instead of replacing
+
+-- prepend to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}');
+-- append to array
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}');
+-- check nesting levels addition
+select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}');
+-- add new key
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}');
+-- adding doesn't do anything if elements before last aren't present
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}');
+select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}');
+-- add to empty object
+select jsonb_set('{}','{x}','{"foo":123}');
+--add to empty array
+select jsonb_set('[]','{0}','{"foo":123}');
+select jsonb_set('[]','{99}','{"foo":123}');
+select jsonb_set('[]','{-99}','{"foo":123}');
+select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"');
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"');
+select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"');
+
+-- jsonb_set_lax
+
+\pset null NULL
+
+-- pass though non nulls to jsonb_set
+select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ;
+select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ;
+-- using the default treatment
+select jsonb_set_lax('{"a":1,"b":2}','{b}',null);
+select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true);
+-- errors
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null);
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment');
+-- explicit treatments
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception;
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target;
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key;
+select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null;
+
+\pset null ''
+
+-- jsonb_insert
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"');
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true);
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"');
+select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}');
+select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]');
+
+-- edge cases
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"');
+select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"');
+select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"');
+select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true);
+select jsonb_insert('[]', '{1}', '"new_value"');
+select jsonb_insert('[]', '{1}', '"new_value"', true);
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"');
+select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true);
+select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"');
+select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"');
+
+-- jsonb_insert should be able to insert new value for objects, but not to replace
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"');
+select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true);
+
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"');
+select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true);
+
+-- jsonb subscript
+select ('123'::jsonb)['a'];
+select ('123'::jsonb)[0];
+select ('123'::jsonb)[NULL];
+select ('{"a": 1}'::jsonb)['a'];
+select ('{"a": 1}'::jsonb)[0];
+select ('{"a": 1}'::jsonb)['not_exist'];
+select ('{"a": 1}'::jsonb)[NULL];
+select ('[1, "2", null]'::jsonb)['a'];
+select ('[1, "2", null]'::jsonb)[0];
+select ('[1, "2", null]'::jsonb)['1'];
+select ('[1, "2", null]'::jsonb)[1.0];
+select ('[1, "2", null]'::jsonb)[2];
+select ('[1, "2", null]'::jsonb)[3];
+select ('[1, "2", null]'::jsonb)[-2];
+select ('[1, "2", null]'::jsonb)[1]['a'];
+select ('[1, "2", null]'::jsonb)[1][0];
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b'];
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'];
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1];
+select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a'];
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1'];
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2'];
+select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3'];
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'];
+select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2];
+
+-- slices are not supported
+select ('{"a": 1}'::jsonb)['a':'b'];
+select ('[1, "2", null]'::jsonb)[1:2];
+select ('[1, "2", null]'::jsonb)[:2];
+select ('[1, "2", null]'::jsonb)[1:];
+select ('[1, "2", null]'::jsonb)[:];
+
+create TEMP TABLE test_jsonb_subscript (
+ id int,
+ test_json jsonb
+);
+
+insert into test_jsonb_subscript values
+(1, '{}'), -- empty jsonb
+(2, '{"key": "value"}'); -- jsonb with data
+
+-- update empty jsonb
+update test_jsonb_subscript set test_json['a'] = '1' where id = 1;
+select * from test_jsonb_subscript;
+
+-- update jsonb with some data
+update test_jsonb_subscript set test_json['a'] = '1' where id = 2;
+select * from test_jsonb_subscript;
+
+-- replace jsonb
+update test_jsonb_subscript set test_json['a'] = '"test"';
+select * from test_jsonb_subscript;
+
+-- replace by object
+update test_jsonb_subscript set test_json['a'] = '{"b": 1}'::jsonb;
+select * from test_jsonb_subscript;
+
+-- replace by array
+update test_jsonb_subscript set test_json['a'] = '[1, 2, 3]'::jsonb;
+select * from test_jsonb_subscript;
+
+-- use jsonb subscription in where clause
+select * from test_jsonb_subscript where test_json['key'] = '"value"';
+select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"';
+select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"';
+
+-- NULL
+update test_jsonb_subscript set test_json[NULL] = '1';
+update test_jsonb_subscript set test_json['another_key'] = NULL;
+select * from test_jsonb_subscript;
+
+-- NULL as jsonb source
+insert into test_jsonb_subscript values (3, NULL);
+update test_jsonb_subscript set test_json['a'] = '1' where id = 3;
+select * from test_jsonb_subscript;
+
+update test_jsonb_subscript set test_json = NULL where id = 3;
+update test_jsonb_subscript set test_json[0] = '1';
+select * from test_jsonb_subscript;
+
+-- Fill the gaps logic
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[0]');
+
+update test_jsonb_subscript set test_json[5] = '1';
+select * from test_jsonb_subscript;
+
+update test_jsonb_subscript set test_json[-4] = '1';
+select * from test_jsonb_subscript;
+
+update test_jsonb_subscript set test_json[-8] = '1';
+select * from test_jsonb_subscript;
+
+-- keep consistent values position
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+
+update test_jsonb_subscript set test_json[5] = '1';
+select * from test_jsonb_subscript;
+
+-- create the whole path
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a'][0]['b'][0]['c'] = '1';
+select * from test_jsonb_subscript;
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a'][2]['b'][2]['c'][2] = '1';
+select * from test_jsonb_subscript;
+
+-- create the whole path with already existing keys
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"b": 1}');
+update test_jsonb_subscript set test_json['a'][0] = '2';
+select * from test_jsonb_subscript;
+
+-- the start jsonb is an object, first subscript is treated as a key
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json[0]['a'] = '1';
+select * from test_jsonb_subscript;
+
+-- the start jsonb is an array
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+update test_jsonb_subscript set test_json[0]['a'] = '1';
+update test_jsonb_subscript set test_json[2]['b'] = '2';
+select * from test_jsonb_subscript;
+
+-- overwriting an existing path
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a']['b'][1] = '1';
+update test_jsonb_subscript set test_json['a']['b'][10] = '1';
+select * from test_jsonb_subscript;
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '[]');
+update test_jsonb_subscript set test_json[0][0][0] = '1';
+update test_jsonb_subscript set test_json[0][0][1] = '1';
+select * from test_jsonb_subscript;
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{}');
+update test_jsonb_subscript set test_json['a']['b'][10] = '1';
+update test_jsonb_subscript set test_json['a'][10][10] = '1';
+select * from test_jsonb_subscript;
+
+-- an empty sub element
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": {}}');
+update test_jsonb_subscript set test_json['a']['b']['c'][2] = '1';
+select * from test_jsonb_subscript;
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": []}');
+update test_jsonb_subscript set test_json['a'][1]['c'][2] = '1';
+select * from test_jsonb_subscript;
+
+-- trying replace assuming a composite object, but it's an element or a value
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, '{"a": 1}');
+update test_jsonb_subscript set test_json['a']['b'] = '1';
+update test_jsonb_subscript set test_json['a']['b']['c'] = '1';
+update test_jsonb_subscript set test_json['a'][0] = '1';
+update test_jsonb_subscript set test_json['a'][0]['c'] = '1';
+update test_jsonb_subscript set test_json['a'][0][0] = '1';
+
+-- trying replace assuming a composite object, but it's a raw scalar
+
+delete from test_jsonb_subscript;
+insert into test_jsonb_subscript values (1, 'null');
+update test_jsonb_subscript set test_json[0] = '1';
+update test_jsonb_subscript set test_json[0][0] = '1';
+
+-- jsonb to tsvector
+select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+
+-- jsonb to tsvector with config
+select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb);
+
+-- jsonb to tsvector with stop words
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::jsonb);
+
+-- jsonb to tsvector with numeric values
+select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::jsonb);
+
+-- jsonb_to_tsvector
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]');
+
+-- to_tsvector corner cases
+select to_tsvector('""'::jsonb);
+select to_tsvector('{}'::jsonb);
+select to_tsvector('[]'::jsonb);
+select to_tsvector('null'::jsonb);
+
+-- jsonb_to_tsvector corner cases
+select jsonb_to_tsvector('""'::jsonb, '"all"');
+select jsonb_to_tsvector('{}'::jsonb, '"all"');
+select jsonb_to_tsvector('[]'::jsonb, '"all"');
+select jsonb_to_tsvector('null'::jsonb, '"all"');
+
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null');
+select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
+
+-- ts_headline for jsonb
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'));
+select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >');
+
+-- corner cases for ts_headline with jsonb
+select ts_headline('null'::jsonb, tsquery('aaa & bbb'));
+select ts_headline('{}'::jsonb, tsquery('aaa & bbb'));
+select ts_headline('[]'::jsonb, tsquery('aaa & bbb'));
+
+-- casts
+select 'true'::jsonb::bool;
+select '[]'::jsonb::bool;
+select '1.0'::jsonb::float;
+select '[1.0]'::jsonb::float;
+select '12345'::jsonb::int4;
+select '"hello"'::jsonb::int4;
+select '12345'::jsonb::numeric;
+select '{}'::jsonb::numeric;
+select '12345.05'::jsonb::numeric;
+select '12345.05'::jsonb::float4;
+select '12345.05'::jsonb::float8;
+select '12345.05'::jsonb::int2;
+select '12345.05'::jsonb::int4;
+select '12345.05'::jsonb::int8;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4;
+select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8;
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.out b/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.out
new file mode 100644
index 0000000000..508ddd797e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.out
@@ -0,0 +1,2539 @@
+select jsonb '{"a": 12}' @? '$';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '1';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.a.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.a + 2';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 12}' @? '$.b + 2';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{"a": {"a": 12}}' @? '$.a.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"a": 12}}' @? '$.*.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? '$.*.a';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? '$.*.b';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"b": {"a": 12}}' @? 'strict $.*.b';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{}' @? '$.*';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": 1}' @? '$.*';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{1}';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{2}';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{3}';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[]' @? '$[*]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? '$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[1]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? 'strict $[1]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb_path_query('[1]', 'strict $[1]');
+ERROR: jsonpath array subscript is out of bounds
+select jsonb_path_query('[1]', 'strict $[1]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb '[1]' @? 'lax $[10000000000000000]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1]' @? 'strict $[10000000000000000]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb_path_query('[1]', 'lax $[10000000000000000]');
+ERROR: jsonpath array subscript is out of integer range
+select jsonb_path_query('[1]', 'strict $[10000000000000000]');
+ERROR: jsonpath array subscript is out of integer range
+select jsonb '[1]' @? '$[0]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.3]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.5]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[0.9]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1]' @? '$[1.2]';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1]' @? 'strict $[1.2]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] > @.b[*])';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? 'strict $ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": [1,2,3], "b": [3,4,null]}' @? '$ ? (@.a[*] >= @.b[*])';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '1' @? '$ ? ((@ == "1") is unknown)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '1' @? '$ ? ((@ == 1) is unknown)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => false);
+ jsonb_path_exists
+-------------------
+ t
+(1 row)
+
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => true);
+ jsonb_path_exists
+-------------------
+ t
+(1 row)
+
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => false);
+ERROR: jsonpath member accessor can only be applied to an object
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => true);
+ jsonb_path_exists
+-------------------
+
+(1 row)
+
+select jsonb_path_query('1', 'lax $.a');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('1', 'strict $.a');
+ERROR: jsonpath member accessor can only be applied to an object
+select jsonb_path_query('1', 'strict $.*');
+ERROR: jsonpath wildcard member accessor can only be applied to an object
+select jsonb_path_query('1', 'strict $.a', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('1', 'strict $.*', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'lax $.a');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $.a');
+ERROR: jsonpath member accessor can only be applied to an object
+select jsonb_path_query('[]', 'strict $.a', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{}', 'lax $.a');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{}', 'strict $.a');
+ERROR: JSON object does not contain key "a"
+select jsonb_path_query('{}', 'strict $.a', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('1', 'strict $[1]');
+ERROR: jsonpath array accessor can only be applied to an array
+select jsonb_path_query('1', 'strict $[*]');
+ERROR: jsonpath wildcard array accessor can only be applied to an array
+select jsonb_path_query('[]', 'strict $[1]');
+ERROR: jsonpath array subscript is out of bounds
+select jsonb_path_query('[]', 'strict $["a"]');
+ERROR: jsonpath array subscript is not a single numeric value
+select jsonb_path_query('1', 'strict $[1]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('1', 'strict $[*]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $[1]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $["a"]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.a');
+ jsonb_path_query
+------------------
+ 12
+(1 row)
+
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.b');
+ jsonb_path_query
+------------------
+ {"a": 13}
+(1 row)
+
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.*');
+ jsonb_path_query
+------------------
+ 12
+ {"a": 13}
+(2 rows)
+
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', 'lax $.*.a');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].a');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].*');
+ jsonb_path_query
+------------------
+ 13
+ 14
+(2 rows)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0].a');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[1].a');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[2].a');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0,1].a');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10].a');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10 / 0].a');
+ERROR: division by zero
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}, "ccc", true]', '$[2.5 - 1 to $.size() - 2]');
+ jsonb_path_query
+------------------
+ {"a": 13}
+ {"b": 14}
+ "ccc"
+(3 rows)
+
+select jsonb_path_query('1', 'lax $[0]');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('1', 'lax $[*]');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('[1]', 'lax $[0]');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('[1]', 'lax $[*]');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('[1,2,3]', 'lax $[*]');
+ jsonb_path_query
+------------------
+ 1
+ 2
+ 3
+(3 rows)
+
+select jsonb_path_query('[1,2,3]', 'strict $[*].a');
+ERROR: jsonpath member accessor can only be applied to an object
+select jsonb_path_query('[1,2,3]', 'strict $[*].a', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', '$[last]');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', '$[last ? (exists(last))]');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $[last]');
+ERROR: jsonpath array subscript is out of bounds
+select jsonb_path_query('[]', 'strict $[last]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[1]', '$[last]');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('[1,2,3]', '$[last]');
+ jsonb_path_query
+------------------
+ 3
+(1 row)
+
+select jsonb_path_query('[1,2,3]', '$[last - 1]');
+ jsonb_path_query
+------------------
+ 2
+(1 row)
+
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "number")]');
+ jsonb_path_query
+------------------
+ 3
+(1 row)
+
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]');
+ERROR: jsonpath array subscript is not a single numeric value
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select * from jsonb_path_query('{"a": 10}', '$');
+ jsonb_path_query
+------------------
+ {"a": 10}
+(1 row)
+
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+ERROR: could not find jsonpath variable "value"
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+ERROR: "vars" argument is not an object
+DETAIL: Jsonpath parameters should be encoded as key-value pairs of "vars" object.
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+ERROR: "vars" argument is not an object
+DETAIL: Jsonpath parameters should be encoded as key-value pairs of "vars" object.
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+ jsonb_path_query
+------------------
+ {"a": 10}
+(1 row)
+
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+ jsonb_path_query
+------------------
+ 10
+(1 row)
+
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+ jsonb_path_query
+------------------
+ 10
+ 11
+ 12
+(3 rows)
+
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+ jsonb_path_query
+------------------
+ 10
+ 11
+(2 rows)
+
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+ jsonb_path_query
+------------------
+ 10
+ 11
+ 12
+(3 rows)
+
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+ jsonb_path_query
+------------------
+ "1"
+(1 row)
+
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+ jsonb_path_query
+------------------
+ "1"
+(1 row)
+
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+ jsonb_path_query
+------------------
+ null
+(1 row)
+
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+ jsonb_path_query
+------------------
+ 1
+ "2"
+(2 rows)
+
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+ jsonb_path_query
+------------------
+ null
+(1 row)
+
+select * from jsonb_path_query('{}', '$ ? (@ == @)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**');
+ jsonb_path_query
+------------------
+ {"a": {"b": 1}}
+ {"b": 1}
+ 1
+(3 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}');
+ jsonb_path_query
+------------------
+ {"a": {"b": 1}}
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}');
+ jsonb_path_query
+------------------
+ {"a": {"b": 1}}
+ {"b": 1}
+ 1
+(3 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}');
+ jsonb_path_query
+------------------
+ {"b": 1}
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}');
+ jsonb_path_query
+------------------
+ {"b": 1}
+ 1
+(2 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2}');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2 to last}');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{3 to last}');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{last}');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{2 to 3}.b ? (@ > 0)');
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{0}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1}.b ? ( @ > 0)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{2 to 3}.b ? ( @ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x))');
+ jsonb_path_query
+------------------
+ {"x": 2}
+(1 row)
+
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.y))');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x ? (@ >= 2) ))');
+ jsonb_path_query
+------------------
+ {"x": 2}
+(1 row)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x))');
+ jsonb_path_query
+------------------
+ {"x": 2}
+(1 row)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x + "3"))');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? ((exists (@.x + "3")) is unknown)');
+ jsonb_path_query
+------------------
+ {"x": 2}
+ {"y": 3}
+(2 rows)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? (exists (@.x))');
+ jsonb_path_query
+------------------
+ {"x": 2}
+(1 row)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? ((exists (@.x)) is unknown)');
+ jsonb_path_query
+------------------
+ {"y": 3}
+(1 row)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? (exists (@[*].x))');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? ((exists (@[*].x)) is unknown)');
+ jsonb_path_query
+----------------------
+ [{"x": 2}, {"y": 3}]
+(1 row)
+
+--test ternary logic
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true && $y == true) ||
+ @ == false && !($x == true && $y == true) ||
+ @ == null && ($x == true && $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x && y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+ x | y | x && y
+--------+--------+--------
+ true | true | true
+ true | false | false
+ true | "null" | null
+ false | true | false
+ false | false | false
+ false | "null" | false
+ "null" | true | null
+ "null" | false | false
+ "null" | "null" | null
+(9 rows)
+
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true || $y == true) ||
+ @ == false && !($x == true || $y == true) ||
+ @ == null && ($x == true || $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x || y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+ x | y | x || y
+--------+--------+--------
+ true | true | true
+ true | false | true
+ true | "null" | true
+ false | true | true
+ false | false | false
+ false | "null" | null
+ "null" | true | true
+ "null" | false | null
+ "null" | "null" | null
+(9 rows)
+
+select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$ ? (@.a == @.b)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? ($.c.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.* ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 1, "b":1}' @? '$.** ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.** ? (@.a == @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == 1 + 1)');
+ jsonb_path_query
+------------------
+ {"a": 2, "b": 1}
+(1 row)
+
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (1 + 1))');
+ jsonb_path_query
+------------------
+ {"a": 2, "b": 1}
+(1 row)
+
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == @.b + 1)');
+ jsonb_path_query
+------------------
+ {"a": 2, "b": 1}
+(1 row)
+
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (@.b + 1))');
+ jsonb_path_query
+------------------
+ {"a": 2, "b": 1}
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -1)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -@.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 2, "b":1}}' @? '$.** ? (@.a == 1 - - @.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - +@.b)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +2)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +3)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -2)';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -3)';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '1' @? '$ ? ($ > 0)';
+ ?column?
+----------
+ t
+(1 row)
+
+-- arithmetic errors
+select jsonb_path_query('[1,2,0,3]', '$[*] ? (2 / @ > 0)');
+ jsonb_path_query
+------------------
+ 1
+ 2
+ 3
+(3 rows)
+
+select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is unknown)');
+ jsonb_path_query
+------------------
+ 0
+(1 row)
+
+select jsonb_path_query('0', '1 / $');
+ERROR: division by zero
+select jsonb_path_query('0', '1 / $ + 2');
+ERROR: division by zero
+select jsonb_path_query('0', '-(3 + 1 % $)');
+ERROR: division by zero
+select jsonb_path_query('1', '$ + "2"');
+ERROR: right operand of jsonpath operator + is not a single numeric value
+select jsonb_path_query('[1, 2]', '3 * $');
+ERROR: right operand of jsonpath operator * is not a single numeric value
+select jsonb_path_query('"a"', '-$');
+ERROR: operand of unary jsonpath operator - is not a numeric value
+select jsonb_path_query('[1,"2",3]', '+$');
+ERROR: operand of unary jsonpath operator + is not a numeric value
+select jsonb_path_query('1', '$ + "2"', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[1, 2]', '3 * $', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('"a"', '-$', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[1,"2",3]', '+$', silent => true);
+ jsonb_path_query
+------------------
+ 1
+(1 row)
+
+select jsonb '["1",2,0,3]' @? '-$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '[1,"2",0,3]' @? '-$[*]';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '["1",2,0,3]' @? 'strict -$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1,"2",0,3]' @? 'strict -$[*]';
+ ?column?
+----------
+
+(1 row)
+
+-- unwrapping of operator arguments in lax mode
+select jsonb_path_query('{"a": [2]}', 'lax $.a * 3');
+ jsonb_path_query
+------------------
+ 6
+(1 row)
+
+select jsonb_path_query('{"a": [2]}', 'lax $.a + 3');
+ jsonb_path_query
+------------------
+ 5
+(1 row)
+
+select jsonb_path_query('{"a": [2, 3, 4]}', 'lax -$.a');
+ jsonb_path_query
+------------------
+ -2
+ -3
+ -4
+(3 rows)
+
+-- should fail
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3');
+ERROR: left operand of jsonpath operator * is not a single numeric value
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+-- extension: boolean expressions
+select jsonb_path_query('2', '$ > 1');
+ jsonb_path_query
+------------------
+ true
+(1 row)
+
+select jsonb_path_query('2', '$ <= 1');
+ jsonb_path_query
+------------------
+ false
+(1 row)
+
+select jsonb_path_query('2', '$ == "2"');
+ jsonb_path_query
+------------------
+ null
+(1 row)
+
+select jsonb '2' @? '$ == "2"';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '2' @@ '$ > 1';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '2' @@ '$ <= 1';
+ ?column?
+----------
+ f
+(1 row)
+
+select jsonb '2' @@ '$ == "2"';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '2' @@ '1';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '{}' @@ '$';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[]' @@ '$';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[1,2,3]' @@ '$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb '[]' @@ '$[*]';
+ ?column?
+----------
+
+(1 row)
+
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
+ jsonb_path_match
+------------------
+ f
+(1 row)
+
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => false);
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => true);
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => false);
+ jsonb_path_match
+------------------
+
+(1 row)
+
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => true);
+ jsonb_path_match
+------------------
+
+(1 row)
+
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$.type()');
+ jsonb_path_query
+------------------
+ "array"
+(1 row)
+
+select jsonb_path_query('[null,1,true,"a",[],{}]', 'lax $.type()');
+ jsonb_path_query
+------------------
+ "array"
+(1 row)
+
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$[*].type()');
+ jsonb_path_query
+------------------
+ "null"
+ "number"
+ "boolean"
+ "string"
+ "array"
+ "object"
+(6 rows)
+
+select jsonb_path_query('null', 'null.type()');
+ jsonb_path_query
+------------------
+ "null"
+(1 row)
+
+select jsonb_path_query('null', 'true.type()');
+ jsonb_path_query
+------------------
+ "boolean"
+(1 row)
+
+select jsonb_path_query('null', '(123).type()');
+ jsonb_path_query
+------------------
+ "number"
+(1 row)
+
+select jsonb_path_query('null', '"123".type()');
+ jsonb_path_query
+------------------
+ "string"
+(1 row)
+
+select jsonb_path_query('{"a": 2}', '($.a - 5).abs() + 10');
+ jsonb_path_query
+------------------
+ 13
+(1 row)
+
+select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() % 4.3');
+ jsonb_path_query
+------------------
+ -1.7
+(1 row)
+
+select jsonb_path_query('[1, 2, 3]', '($[*] > 2) ? (@ == true)');
+ jsonb_path_query
+------------------
+ true
+(1 row)
+
+select jsonb_path_query('[1, 2, 3]', '($[*] > 3).type()');
+ jsonb_path_query
+------------------
+ "boolean"
+(1 row)
+
+select jsonb_path_query('[1, 2, 3]', '($[*].a > 3).type()');
+ jsonb_path_query
+------------------
+ "boolean"
+(1 row)
+
+select jsonb_path_query('[1, 2, 3]', 'strict ($[*].a > 3).type()');
+ jsonb_path_query
+------------------
+ "null"
+(1 row)
+
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()');
+ERROR: jsonpath item method .size() can only be applied to an array
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'lax $[*].size()');
+ jsonb_path_query
+------------------
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 3
+ 1
+ 1
+(9 rows)
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].abs()');
+ jsonb_path_query
+------------------
+ 0
+ 1
+ 2
+ 3.4
+ 5.6
+(5 rows)
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor()');
+ jsonb_path_query
+------------------
+ 0
+ 1
+ -2
+ -4
+ 5
+(5 rows)
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling()');
+ jsonb_path_query
+------------------
+ 0
+ 1
+ -2
+ -3
+ 6
+(5 rows)
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs()');
+ jsonb_path_query
+------------------
+ 0
+ 1
+ 2
+ 3
+ 6
+(5 rows)
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs().type()');
+ jsonb_path_query
+------------------
+ "number"
+ "number"
+ "number"
+ "number"
+ "number"
+(5 rows)
+
+select jsonb_path_query('[{},1]', '$[*].keyvalue()');
+ERROR: jsonpath item method .keyvalue() can only be applied to an object
+select jsonb_path_query('[{},1]', '$[*].keyvalue()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{}', '$.keyvalue()');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{"a": 1, "b": [1, 2], "c": {"a": "bbb"}}', '$.keyvalue()');
+ jsonb_path_query
+----------------------------------------------
+ {"id": 0, "key": "a", "value": 1}
+ {"id": 0, "key": "b", "value": [1, 2]}
+ {"id": 0, "key": "c", "value": {"a": "bbb"}}
+(3 rows)
+
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', '$[*].keyvalue()');
+ jsonb_path_query
+-----------------------------------------------
+ {"id": 12, "key": "a", "value": 1}
+ {"id": 12, "key": "b", "value": [1, 2]}
+ {"id": 72, "key": "c", "value": {"a": "bbb"}}
+(3 rows)
+
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue()');
+ERROR: jsonpath item method .keyvalue() can only be applied to an object
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'lax $.keyvalue()');
+ jsonb_path_query
+-----------------------------------------------
+ {"id": 12, "key": "a", "value": 1}
+ {"id": 12, "key": "b", "value": [1, 2]}
+ {"id": 72, "key": "c", "value": {"a": "bbb"}}
+(3 rows)
+
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue().a');
+ERROR: jsonpath item method .keyvalue() can only be applied to an object
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue()';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue().key';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_path_query('null', '$.double()');
+ERROR: jsonpath item method .double() can only be applied to a string or numeric value
+select jsonb_path_query('true', '$.double()');
+ERROR: jsonpath item method .double() can only be applied to a string or numeric value
+select jsonb_path_query('null', '$.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('true', '$.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', '$.double()');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $.double()');
+ERROR: jsonpath item method .double() can only be applied to a string or numeric value
+select jsonb_path_query('{}', '$.double()');
+ERROR: jsonpath item method .double() can only be applied to a string or numeric value
+select jsonb_path_query('[]', 'strict $.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{}', '$.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('1.23', '$.double()');
+ jsonb_path_query
+------------------
+ 1.23
+(1 row)
+
+select jsonb_path_query('"1.23"', '$.double()');
+ jsonb_path_query
+------------------
+ 1.23
+(1 row)
+
+select jsonb_path_query('"1.23aaa"', '$.double()');
+ERROR: string argument of jsonpath item method .double() is not a valid representation of a double precision number
+select jsonb_path_query('1e1000', '$.double()');
+ERROR: numeric argument of jsonpath item method .double() is out of range for type double precision
+select jsonb_path_query('"nan"', '$.double()');
+ERROR: string argument of jsonpath item method .double() is not a valid representation of a double precision number
+select jsonb_path_query('"NaN"', '$.double()');
+ERROR: string argument of jsonpath item method .double() is not a valid representation of a double precision number
+select jsonb_path_query('"inf"', '$.double()');
+ERROR: string argument of jsonpath item method .double() is not a valid representation of a double precision number
+select jsonb_path_query('"-inf"', '$.double()');
+ERROR: string argument of jsonpath item method .double() is not a valid representation of a double precision number
+select jsonb_path_query('"inf"', '$.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('"-inf"', '$.double()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('{}', '$.abs()');
+ERROR: jsonpath item method .abs() can only be applied to a numeric value
+select jsonb_path_query('true', '$.floor()');
+ERROR: jsonpath item method .floor() can only be applied to a numeric value
+select jsonb_path_query('"1.2"', '$.ceiling()');
+ERROR: jsonpath item method .ceiling() can only be applied to a numeric value
+select jsonb_path_query('{}', '$.abs()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('true', '$.floor()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('"1.2"', '$.ceiling()', silent => true);
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('["", "a", "abc", "abcabc"]', '$[*] ? (@ starts with "abc")');
+ jsonb_path_query
+------------------
+ "abc"
+ "abcabc"
+(2 rows)
+
+select jsonb_path_query('["", "a", "abc", "abcabc"]', 'strict $ ? (@[*] starts with "abc")');
+ jsonb_path_query
+----------------------------
+ ["", "a", "abc", "abcabc"]
+(1 row)
+
+select jsonb_path_query('["", "a", "abd", "abdabc"]', 'strict $ ? (@[*] starts with "abc")');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? (@[*] starts with "abc")');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? ((@[*] starts with "abc") is unknown)');
+ jsonb_path_query
+----------------------------
+ ["abc", "abcabc", null, 1]
+(1 row)
+
+select jsonb_path_query('[[null, 1, "abc", "abcabc"]]', 'lax $ ? (@[*] starts with "abc")');
+ jsonb_path_query
+----------------------------
+ [null, 1, "abc", "abcabc"]
+(1 row)
+
+select jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? ((@[*] starts with "abc") is unknown)');
+ jsonb_path_query
+----------------------------
+ [null, 1, "abd", "abdabc"]
+(1 row)
+
+select jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ? ((@ starts with "abc") is unknown)');
+ jsonb_path_query
+------------------
+ null
+ 1
+(2 rows)
+
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c")');
+ jsonb_path_query
+------------------
+ "abc"
+ "abdacb"
+(2 rows)
+
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "i")');
+ jsonb_path_query
+------------------
+ "abc"
+ "aBdC"
+ "abdacb"
+(3 rows)
+
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "m")');
+ jsonb_path_query
+------------------
+ "abc"
+ "abdacb"
+ "adc\nabc"
+(3 rows)
+
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "s")');
+ jsonb_path_query
+------------------
+ "abc"
+ "abdacb"
+ "ab\nadc"
+(3 rows)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "q")');
+ jsonb_path_query
+------------------
+ "a\\b"
+ "^a\\b$"
+(2 rows)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "")');
+ jsonb_path_query
+------------------
+ "a\b"
+(1 row)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "q")');
+ jsonb_path_query
+------------------
+ "^a\\b$"
+(1 row)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "q")');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "iq")');
+ jsonb_path_query
+------------------
+ "^a\\b$"
+(1 row)
+
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "")');
+ jsonb_path_query
+------------------
+ "a\b"
+(1 row)
+
+select jsonb_path_query('null', '$.datetime()');
+ERROR: jsonpath item method .datetime() can only be applied to a string
+select jsonb_path_query('true', '$.datetime()');
+ERROR: jsonpath item method .datetime() can only be applied to a string
+select jsonb_path_query('1', '$.datetime()');
+ERROR: jsonpath item method .datetime() can only be applied to a string
+select jsonb_path_query('[]', '$.datetime()');
+ jsonb_path_query
+------------------
+(0 rows)
+
+select jsonb_path_query('[]', 'strict $.datetime()');
+ERROR: jsonpath item method .datetime() can only be applied to a string
+select jsonb_path_query('{}', '$.datetime()');
+ERROR: jsonpath item method .datetime() can only be applied to a string
+select jsonb_path_query('"bogus"', '$.datetime()');
+ERROR: datetime format is not recognized: "bogus"
+HINT: Use a datetime template argument to specify the input data format.
+select jsonb_path_query('"12:34"', '$.datetime("aaa")');
+ERROR: invalid datetime format separator: "a"
+select jsonb_path_query('"aaaa"', '$.datetime("HH24")');
+ERROR: invalid value "aa" for "HH24"
+DETAIL: Value must be an integer.
+select jsonb '"10-03-2017"' @? '$.datetime("dd-mm-yyyy")';
+ ?column?
+----------
+ t
+(1 row)
+
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy")');
+ jsonb_path_query
+------------------
+ "2017-03-10"
+(1 row)
+
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy").type()');
+ jsonb_path_query
+------------------
+ "date"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy")');
+ERROR: trailing characters remain in input string after datetime format
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy").type()');
+ERROR: trailing characters remain in input string after datetime format
+select jsonb_path_query('"10-03-2017 12:34"', ' $.datetime("dd-mm-yyyy HH24:MI").type()');
+ jsonb_path_query
+-------------------------------
+ "timestamp without time zone"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM").type()');
+ jsonb_path_query
+----------------------------
+ "timestamp with time zone"
+(1 row)
+
+select jsonb_path_query('"12:34:56"', '$.datetime("HH24:MI:SS").type()');
+ jsonb_path_query
+--------------------------
+ "time without time zone"
+(1 row)
+
+select jsonb_path_query('"12:34:56 +05:20"', '$.datetime("HH24:MI:SS TZH:TZM").type()');
+ jsonb_path_query
+-----------------------
+ "time with time zone"
+(1 row)
+
+select jsonb_path_query('"10-03-2017T12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ jsonb_path_query
+-----------------------
+ "2017-03-10T12:34:56"
+(1 row)
+
+select jsonb_path_query('"10-03-2017t12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ERROR: unmatched format character "T"
+select jsonb_path_query('"10-03-2017 12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+ERROR: unmatched format character "T"
+set time zone '+00';
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+ jsonb_path_query
+-----------------------
+ "2017-03-10T12:34:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ERROR: input string is too short for datetime format
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00+05:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00-05:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00+05:20"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00-05:20"
+(1 row)
+
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+ jsonb_path_query
+------------------
+ "12:34:00"
+(1 row)
+
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+ERROR: input string is too short for datetime format
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+ jsonb_path_query
+------------------
+ "12:34:00+05:00"
+(1 row)
+
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+ jsonb_path_query
+------------------
+ "12:34:00-05:00"
+(1 row)
+
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ jsonb_path_query
+------------------
+ "12:34:00+05:20"
+(1 row)
+
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ jsonb_path_query
+------------------
+ "12:34:00-05:20"
+(1 row)
+
+set time zone '+10';
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+ jsonb_path_query
+-----------------------
+ "2017-03-10T12:34:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ERROR: input string is too short for datetime format
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00+05:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00-05:00"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00+05:20"
+(1 row)
+
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:00-05:20"
+(1 row)
+
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+ jsonb_path_query
+------------------
+ "12:34:00"
+(1 row)
+
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+ERROR: input string is too short for datetime format
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+ jsonb_path_query
+------------------
+ "12:34:00+05:00"
+(1 row)
+
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+ jsonb_path_query
+------------------
+ "12:34:00-05:00"
+(1 row)
+
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ jsonb_path_query
+------------------
+ "12:34:00+05:20"
+(1 row)
+
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+ jsonb_path_query
+------------------
+ "12:34:00-05:20"
+(1 row)
+
+set time zone default;
+select jsonb_path_query('"2017-03-10"', '$.datetime().type()');
+ jsonb_path_query
+------------------
+ "date"
+(1 row)
+
+select jsonb_path_query('"2017-03-10"', '$.datetime()');
+ jsonb_path_query
+------------------
+ "2017-03-10"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime().type()');
+ jsonb_path_query
+-------------------------------
+ "timestamp without time zone"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime()');
+ jsonb_path_query
+-----------------------
+ "2017-03-10T12:34:56"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime().type()');
+ jsonb_path_query
+----------------------------
+ "timestamp with time zone"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime()');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:56+03:00"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime().type()');
+ jsonb_path_query
+----------------------------
+ "timestamp with time zone"
+(1 row)
+
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime()');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:56+03:10"
+(1 row)
+
+select jsonb_path_query('"2017-03-10T12:34:56+3:10"', '$.datetime()');
+ jsonb_path_query
+-----------------------------
+ "2017-03-10T12:34:56+03:10"
+(1 row)
+
+select jsonb_path_query('"2017-03-10t12:34:56+3:10"', '$.datetime()');
+ERROR: datetime format is not recognized: "2017-03-10t12:34:56+3:10"
+HINT: Use a datetime template argument to specify the input data format.
+select jsonb_path_query('"12:34:56"', '$.datetime().type()');
+ jsonb_path_query
+--------------------------
+ "time without time zone"
+(1 row)
+
+select jsonb_path_query('"12:34:56"', '$.datetime()');
+ jsonb_path_query
+------------------
+ "12:34:56"
+(1 row)
+
+select jsonb_path_query('"12:34:56+3"', '$.datetime().type()');
+ jsonb_path_query
+-----------------------
+ "time with time zone"
+(1 row)
+
+select jsonb_path_query('"12:34:56+3"', '$.datetime()');
+ jsonb_path_query
+------------------
+ "12:34:56+03:00"
+(1 row)
+
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime().type()');
+ jsonb_path_query
+-----------------------
+ "time with time zone"
+(1 row)
+
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime()');
+ jsonb_path_query
+------------------
+ "12:34:56+03:10"
+(1 row)
+
+set time zone '+00';
+-- date comparison
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+ERROR: cannot convert value from date to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+ERROR: cannot convert value from date to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+ERROR: cannot convert value from date to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10"
+ "2017-03-10T00:00:00"
+ "2017-03-10T03:00:00+03:00"
+(3 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10"
+ "2017-03-11"
+ "2017-03-10T00:00:00"
+ "2017-03-10T12:34:56"
+ "2017-03-10T03:00:00+03:00"
+(5 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-09"
+ "2017-03-10T01:02:03+04:00"
+(2 rows)
+
+-- time comparison
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+ jsonb_path_query_tz
+---------------------
+ "12:35:00"
+ "12:35:00+00:00"
+(2 rows)
+
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+ jsonb_path_query_tz
+---------------------
+ "12:35:00"
+ "12:36:00"
+ "12:35:00+00:00"
+(3 rows)
+
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+ jsonb_path_query_tz
+---------------------
+ "12:34:00"
+ "12:35:00+01:00"
+ "13:35:00+01:00"
+(3 rows)
+
+-- timetz comparison
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+ERROR: cannot convert value from time to timetz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+ jsonb_path_query_tz
+---------------------
+ "12:35:00+01:00"
+(1 row)
+
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+ jsonb_path_query_tz
+---------------------
+ "12:35:00+01:00"
+ "12:36:00+01:00"
+ "12:35:00-02:00"
+ "11:35:00"
+ "12:35:00"
+(5 rows)
+
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+ jsonb_path_query_tz
+---------------------
+ "12:34:00+01:00"
+ "12:35:00+02:00"
+ "10:35:00"
+(3 rows)
+
+-- timestamp comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:35:00"
+ "2017-03-10T13:35:00+01:00"
+(2 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:35:00"
+ "2017-03-10T12:36:00"
+ "2017-03-10T13:35:00+01:00"
+ "2017-03-10T12:35:00-01:00"
+ "2017-03-11"
+(5 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:34:00"
+ "2017-03-10T12:35:00+01:00"
+ "2017-03-10"
+(3 rows)
+
+-- timestamptz comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ERROR: cannot convert value from timestamp to timestamptz without time zone usage
+HINT: Use *_tz() function for time zone support.
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:35:00+01:00"
+ "2017-03-10T11:35:00"
+(2 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:35:00+01:00"
+ "2017-03-10T12:36:00+01:00"
+ "2017-03-10T12:35:00-02:00"
+ "2017-03-10T11:35:00"
+ "2017-03-10T12:35:00"
+ "2017-03-11"
+(6 rows)
+
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+ jsonb_path_query_tz
+-----------------------------
+ "2017-03-10T12:34:00+01:00"
+ "2017-03-10T12:35:00+02:00"
+ "2017-03-10T10:35:00"
+ "2017-03-10"
+(4 rows)
+
+-- overflow during comparison
+select jsonb_path_query('"1000000-01-01"', '$.datetime() > "2020-01-01 12:00:00".datetime()'::jsonpath);
+ jsonb_path_query
+------------------
+ true
+(1 row)
+
+set time zone default;
+-- jsonpath operators
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*]');
+ jsonb_path_query
+------------------
+ {"a": 1}
+ {"a": 2}
+(2 rows)
+
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*] ? (@.a > 10)');
+ jsonb_path_query
+------------------
+(0 rows)
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ERROR: JSON object does not contain key "a"
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+ jsonb_path_query_array
+------------------------
+ [1, 2]
+(1 row)
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ jsonb_path_query_array
+------------------------
+ [1]
+(1 row)
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ jsonb_path_query_array
+------------------------
+ []
+(1 row)
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+ jsonb_path_query_array
+------------------------
+ [2, 3]
+(1 row)
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+ jsonb_path_query_array
+------------------------
+ []
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+ERROR: JSON object does not contain key "a"
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a', silent => true);
+ jsonb_path_query_first
+------------------------
+ 1
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+ jsonb_path_query_first
+------------------------
+ 1
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+ jsonb_path_query_first
+------------------------
+ 1
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+ jsonb_path_query_first
+------------------------
+
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+ jsonb_path_query_first
+------------------------
+ 2
+(1 row)
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+ jsonb_path_query_first
+------------------------
+
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+ jsonb_path_exists
+-------------------
+ t
+(1 row)
+
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
+ jsonb_path_exists
+-------------------
+ t
+(1 row)
+
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 3, "max": 4}');
+ jsonb_path_exists
+-------------------
+ f
+(1 row)
+
+SELECT jsonb_path_match('true', '$', silent => false);
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
+SELECT jsonb_path_match('false', '$', silent => false);
+ jsonb_path_match
+------------------
+ f
+(1 row)
+
+SELECT jsonb_path_match('null', '$', silent => false);
+ jsonb_path_match
+------------------
+
+(1 row)
+
+SELECT jsonb_path_match('1', '$', silent => true);
+ jsonb_path_match
+------------------
+
+(1 row)
+
+SELECT jsonb_path_match('1', '$', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb_path_match('"a"', '$', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb_path_match('{}', '$', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb_path_match('[true]', '$', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb_path_match('{}', 'lax $.a', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb_path_match('{}', 'strict $.a', silent => false);
+ERROR: JSON object does not contain key "a"
+SELECT jsonb_path_match('{}', 'strict $.a', silent => true);
+ jsonb_path_match
+------------------
+
+(1 row)
+
+SELECT jsonb_path_match('[true, true]', '$[*]', silent => false);
+ERROR: single boolean result is expected
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+ jsonb_path_match
+------------------
+ t
+(1 row)
+
+-- test string comparison (Unicode codepoint collation)
+WITH str(j, num) AS
+(
+ SELECT jsonb_build_object('s', s), num
+ FROM unnest('{"", "a", "ab", "abc", "abcd", "b", "A", "AB", "ABC", "ABc", "ABcD", "B"}'::text[]) WITH ORDINALITY AS a(s, num)
+)
+SELECT
+ s1.j, s2.j,
+ jsonb_path_query_first(s1.j, '$.s < $s', vars => s2.j) lt,
+ jsonb_path_query_first(s1.j, '$.s <= $s', vars => s2.j) le,
+ jsonb_path_query_first(s1.j, '$.s == $s', vars => s2.j) eq,
+ jsonb_path_query_first(s1.j, '$.s >= $s', vars => s2.j) ge,
+ jsonb_path_query_first(s1.j, '$.s > $s', vars => s2.j) gt
+FROM str s1, str s2
+ORDER BY s1.num, s2.num;
+ j | j | lt | le | eq | ge | gt
+---------------+---------------+-------+-------+-------+-------+-------
+ {"s": ""} | {"s": ""} | false | true | true | true | false
+ {"s": ""} | {"s": "a"} | true | true | false | false | false
+ {"s": ""} | {"s": "ab"} | true | true | false | false | false
+ {"s": ""} | {"s": "abc"} | true | true | false | false | false
+ {"s": ""} | {"s": "abcd"} | true | true | false | false | false
+ {"s": ""} | {"s": "b"} | true | true | false | false | false
+ {"s": ""} | {"s": "A"} | true | true | false | false | false
+ {"s": ""} | {"s": "AB"} | true | true | false | false | false
+ {"s": ""} | {"s": "ABC"} | true | true | false | false | false
+ {"s": ""} | {"s": "ABc"} | true | true | false | false | false
+ {"s": ""} | {"s": "ABcD"} | true | true | false | false | false
+ {"s": ""} | {"s": "B"} | true | true | false | false | false
+ {"s": "a"} | {"s": ""} | false | false | false | true | true
+ {"s": "a"} | {"s": "a"} | false | true | true | true | false
+ {"s": "a"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "a"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "a"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "a"} | {"s": "b"} | true | true | false | false | false
+ {"s": "a"} | {"s": "A"} | false | false | false | true | true
+ {"s": "a"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "a"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "a"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "a"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "a"} | {"s": "B"} | false | false | false | true | true
+ {"s": "ab"} | {"s": ""} | false | false | false | true | true
+ {"s": "ab"} | {"s": "a"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "ab"} | false | true | true | true | false
+ {"s": "ab"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "ab"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "ab"} | {"s": "b"} | true | true | false | false | false
+ {"s": "ab"} | {"s": "A"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "ab"} | {"s": "B"} | false | false | false | true | true
+ {"s": "abc"} | {"s": ""} | false | false | false | true | true
+ {"s": "abc"} | {"s": "a"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "ab"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "abc"} | false | true | true | true | false
+ {"s": "abc"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "abc"} | {"s": "b"} | true | true | false | false | false
+ {"s": "abc"} | {"s": "A"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "abc"} | {"s": "B"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": ""} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "a"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "ab"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "abc"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "abcd"} | false | true | true | true | false
+ {"s": "abcd"} | {"s": "b"} | true | true | false | false | false
+ {"s": "abcd"} | {"s": "A"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "abcd"} | {"s": "B"} | false | false | false | true | true
+ {"s": "b"} | {"s": ""} | false | false | false | true | true
+ {"s": "b"} | {"s": "a"} | false | false | false | true | true
+ {"s": "b"} | {"s": "ab"} | false | false | false | true | true
+ {"s": "b"} | {"s": "abc"} | false | false | false | true | true
+ {"s": "b"} | {"s": "abcd"} | false | false | false | true | true
+ {"s": "b"} | {"s": "b"} | false | true | true | true | false
+ {"s": "b"} | {"s": "A"} | false | false | false | true | true
+ {"s": "b"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "b"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "b"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "b"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "b"} | {"s": "B"} | false | false | false | true | true
+ {"s": "A"} | {"s": ""} | false | false | false | true | true
+ {"s": "A"} | {"s": "a"} | true | true | false | false | false
+ {"s": "A"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "A"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "A"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "A"} | {"s": "b"} | true | true | false | false | false
+ {"s": "A"} | {"s": "A"} | false | true | true | true | false
+ {"s": "A"} | {"s": "AB"} | true | true | false | false | false
+ {"s": "A"} | {"s": "ABC"} | true | true | false | false | false
+ {"s": "A"} | {"s": "ABc"} | true | true | false | false | false
+ {"s": "A"} | {"s": "ABcD"} | true | true | false | false | false
+ {"s": "A"} | {"s": "B"} | true | true | false | false | false
+ {"s": "AB"} | {"s": ""} | false | false | false | true | true
+ {"s": "AB"} | {"s": "a"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "b"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "A"} | false | false | false | true | true
+ {"s": "AB"} | {"s": "AB"} | false | true | true | true | false
+ {"s": "AB"} | {"s": "ABC"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "ABc"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "ABcD"} | true | true | false | false | false
+ {"s": "AB"} | {"s": "B"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": ""} | false | false | false | true | true
+ {"s": "ABC"} | {"s": "a"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "b"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "A"} | false | false | false | true | true
+ {"s": "ABC"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "ABC"} | {"s": "ABC"} | false | true | true | true | false
+ {"s": "ABC"} | {"s": "ABc"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "ABcD"} | true | true | false | false | false
+ {"s": "ABC"} | {"s": "B"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": ""} | false | false | false | true | true
+ {"s": "ABc"} | {"s": "a"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "b"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "A"} | false | false | false | true | true
+ {"s": "ABc"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "ABc"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "ABc"} | {"s": "ABc"} | false | true | true | true | false
+ {"s": "ABc"} | {"s": "ABcD"} | true | true | false | false | false
+ {"s": "ABc"} | {"s": "B"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": ""} | false | false | false | true | true
+ {"s": "ABcD"} | {"s": "a"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": "b"} | true | true | false | false | false
+ {"s": "ABcD"} | {"s": "A"} | false | false | false | true | true
+ {"s": "ABcD"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "ABcD"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "ABcD"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "ABcD"} | {"s": "ABcD"} | false | true | true | true | false
+ {"s": "ABcD"} | {"s": "B"} | true | true | false | false | false
+ {"s": "B"} | {"s": ""} | false | false | false | true | true
+ {"s": "B"} | {"s": "a"} | true | true | false | false | false
+ {"s": "B"} | {"s": "ab"} | true | true | false | false | false
+ {"s": "B"} | {"s": "abc"} | true | true | false | false | false
+ {"s": "B"} | {"s": "abcd"} | true | true | false | false | false
+ {"s": "B"} | {"s": "b"} | true | true | false | false | false
+ {"s": "B"} | {"s": "A"} | false | false | false | true | true
+ {"s": "B"} | {"s": "AB"} | false | false | false | true | true
+ {"s": "B"} | {"s": "ABC"} | false | false | false | true | true
+ {"s": "B"} | {"s": "ABc"} | false | false | false | true | true
+ {"s": "B"} | {"s": "ABcD"} | false | false | false | true | true
+ {"s": "B"} | {"s": "B"} | false | true | true | true | false
+(144 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.sql b/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.sql
new file mode 100644
index 0000000000..60f73cb059
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonb_jsonpath.sql
@@ -0,0 +1,587 @@
+select jsonb '{"a": 12}' @? '$';
+select jsonb '{"a": 12}' @? '1';
+select jsonb '{"a": 12}' @? '$.a.b';
+select jsonb '{"a": 12}' @? '$.b';
+select jsonb '{"a": 12}' @? '$.a + 2';
+select jsonb '{"a": 12}' @? '$.b + 2';
+select jsonb '{"a": {"a": 12}}' @? '$.a.a';
+select jsonb '{"a": {"a": 12}}' @? '$.*.a';
+select jsonb '{"b": {"a": 12}}' @? '$.*.a';
+select jsonb '{"b": {"a": 12}}' @? '$.*.b';
+select jsonb '{"b": {"a": 12}}' @? 'strict $.*.b';
+select jsonb '{}' @? '$.*';
+select jsonb '{"a": 1}' @? '$.*';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{1}';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{2}';
+select jsonb '{"a": {"b": 1}}' @? 'lax $.**{3}';
+select jsonb '[]' @? '$[*]';
+select jsonb '[1]' @? '$[*]';
+select jsonb '[1]' @? '$[1]';
+select jsonb '[1]' @? 'strict $[1]';
+select jsonb_path_query('[1]', 'strict $[1]');
+select jsonb_path_query('[1]', 'strict $[1]', silent => true);
+select jsonb '[1]' @? 'lax $[10000000000000000]';
+select jsonb '[1]' @? 'strict $[10000000000000000]';
+select jsonb_path_query('[1]', 'lax $[10000000000000000]');
+select jsonb_path_query('[1]', 'strict $[10000000000000000]');
+select jsonb '[1]' @? '$[0]';
+select jsonb '[1]' @? '$[0.3]';
+select jsonb '[1]' @? '$[0.5]';
+select jsonb '[1]' @? '$[0.9]';
+select jsonb '[1]' @? '$[1.2]';
+select jsonb '[1]' @? 'strict $[1.2]';
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] > @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,5]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,"5"]}' @? 'strict $ ? (@.a[*] >= @.b[*])';
+select jsonb '{"a": [1,2,3], "b": [3,4,null]}' @? '$ ? (@.a[*] >= @.b[*])';
+select jsonb '1' @? '$ ? ((@ == "1") is unknown)';
+select jsonb '1' @? '$ ? ((@ == 1) is unknown)';
+select jsonb '[{"a": 1}, {"a": 2}]' @? '$[0 to 1] ? (@.a > 1)';
+
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => false);
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', silent => true);
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => false);
+select jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'strict $[*].a', silent => true);
+
+select jsonb_path_query('1', 'lax $.a');
+select jsonb_path_query('1', 'strict $.a');
+select jsonb_path_query('1', 'strict $.*');
+select jsonb_path_query('1', 'strict $.a', silent => true);
+select jsonb_path_query('1', 'strict $.*', silent => true);
+select jsonb_path_query('[]', 'lax $.a');
+select jsonb_path_query('[]', 'strict $.a');
+select jsonb_path_query('[]', 'strict $.a', silent => true);
+select jsonb_path_query('{}', 'lax $.a');
+select jsonb_path_query('{}', 'strict $.a');
+select jsonb_path_query('{}', 'strict $.a', silent => true);
+
+select jsonb_path_query('1', 'strict $[1]');
+select jsonb_path_query('1', 'strict $[*]');
+select jsonb_path_query('[]', 'strict $[1]');
+select jsonb_path_query('[]', 'strict $["a"]');
+select jsonb_path_query('1', 'strict $[1]', silent => true);
+select jsonb_path_query('1', 'strict $[*]', silent => true);
+select jsonb_path_query('[]', 'strict $[1]', silent => true);
+select jsonb_path_query('[]', 'strict $["a"]', silent => true);
+
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.a');
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.b');
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', '$.*');
+select jsonb_path_query('{"a": 12, "b": {"a": 13}}', 'lax $.*.a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[*].*');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[1].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[2].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0,1].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}]', 'lax $[0 to 10 / 0].a');
+select jsonb_path_query('[12, {"a": 13}, {"b": 14}, "ccc", true]', '$[2.5 - 1 to $.size() - 2]');
+select jsonb_path_query('1', 'lax $[0]');
+select jsonb_path_query('1', 'lax $[*]');
+select jsonb_path_query('[1]', 'lax $[0]');
+select jsonb_path_query('[1]', 'lax $[*]');
+select jsonb_path_query('[1,2,3]', 'lax $[*]');
+select jsonb_path_query('[1,2,3]', 'strict $[*].a');
+select jsonb_path_query('[1,2,3]', 'strict $[*].a', silent => true);
+select jsonb_path_query('[]', '$[last]');
+select jsonb_path_query('[]', '$[last ? (exists(last))]');
+select jsonb_path_query('[]', 'strict $[last]');
+select jsonb_path_query('[]', 'strict $[last]', silent => true);
+select jsonb_path_query('[1]', '$[last]');
+select jsonb_path_query('[1,2,3]', '$[last]');
+select jsonb_path_query('[1,2,3]', '$[last - 1]');
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "number")]');
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]');
+select jsonb_path_query('[1,2,3]', '$[last ? (@.type() == "string")]', silent => true);
+
+select * from jsonb_path_query('{"a": 10}', '$');
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '1');
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '[{"value" : 13}]');
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 13}');
+select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)', '{"value" : 8}');
+select * from jsonb_path_query('{"a": 10}', '$.a ? (@ < $value)', '{"value" : 13}');
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[*] ? (@ < $value)', '{"value" : 13}');
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0,1] ? (@ < $x.value)', '{"x": {"value" : 13}}');
+select * from jsonb_path_query('[10,11,12,13,14,15]', '$[0 to 2] ? (@ < $value)', '{"value" : 15}');
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == "1")');
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : "1"}');
+select * from jsonb_path_query('[1,"1",2,"2",null]', '$[*] ? (@ == $value)', '{"value" : null}');
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ != null)');
+select * from jsonb_path_query('[1, "2", null]', '$[*] ? (@ == null)');
+select * from jsonb_path_query('{}', '$ ? (@ == @)');
+select * from jsonb_path_query('[]', 'strict $ ? (@ == @)');
+
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{2 to last}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{3 to last}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{last}');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"b": 1}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{0 to last}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to last}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{1 to 2}.b ? (@ > 0)');
+select jsonb_path_query('{"a": {"c": {"b": 1}}}', 'lax $.**{2 to 3}.b ? (@ > 0)');
+
+select jsonb '{"a": {"b": 1}}' @? '$.**.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{0}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"b": 1}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{0 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to last}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{1 to 2}.b ? ( @ > 0)';
+select jsonb '{"a": {"c": {"b": 1}}}' @? '$.**{2 to 3}.b ? ( @ > 0)';
+
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x))');
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.y))');
+select jsonb_path_query('{"g": {"x": 2}}', '$.g ? (exists (@.x ? (@ >= 2) ))');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x))');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? (exists (@.x + "3"))');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'lax $.g ? ((exists (@.x + "3")) is unknown)');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? (exists (@.x))');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g[*] ? ((exists (@.x)) is unknown)');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? (exists (@[*].x))');
+select jsonb_path_query('{"g": [{"x": 2}, {"y": 3}]}', 'strict $.g ? ((exists (@[*].x)) is unknown)');
+
+--test ternary logic
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true && $y == true) ||
+ @ == false && !($x == true && $y == true) ||
+ @ == null && ($x == true && $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x && y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+
+select
+ x, y,
+ jsonb_path_query(
+ '[true, false, null]',
+ '$[*] ? (@ == true && ($x == true || $y == true) ||
+ @ == false && !($x == true || $y == true) ||
+ @ == null && ($x == true || $y == true) is unknown)',
+ jsonb_build_object('x', x, 'y', y)
+ ) as "x || y"
+from
+ (values (jsonb 'true'), ('false'), ('"null"')) x(x),
+ (values (jsonb 'true'), ('false'), ('"null"')) y(y);
+
+select jsonb '{"a": 1, "b":1}' @? '$ ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$ ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.c ? ($.c.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.* ? (@.a == @.b)';
+select jsonb '{"a": 1, "b":1}' @? '$.** ? (@.a == @.b)';
+select jsonb '{"c": {"a": 1, "b":1}}' @? '$.** ? (@.a == @.b)';
+
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == 1 + 1)');
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (1 + 1))');
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == @.b + 1)');
+select jsonb_path_query('{"c": {"a": 2, "b":1}}', '$.** ? (@.a == (@.b + 1))');
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - 1)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -1)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == -@.b)';
+select jsonb '{"c": {"a": -1, "b":1}}' @? '$.** ? (@.a == - @.b)';
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - @.b)';
+select jsonb '{"c": {"a": 2, "b":1}}' @? '$.** ? (@.a == 1 - - @.b)';
+select jsonb '{"c": {"a": 0, "b":1}}' @? '$.** ? (@.a == 1 - +@.b)';
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +2)';
+select jsonb '[1,2,3]' @? '$ ? (+@[*] > +3)';
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -2)';
+select jsonb '[1,2,3]' @? '$ ? (-@[*] < -3)';
+select jsonb '1' @? '$ ? ($ > 0)';
+
+-- arithmetic errors
+select jsonb_path_query('[1,2,0,3]', '$[*] ? (2 / @ > 0)');
+select jsonb_path_query('[1,2,0,3]', '$[*] ? ((2 / @ > 0) is unknown)');
+select jsonb_path_query('0', '1 / $');
+select jsonb_path_query('0', '1 / $ + 2');
+select jsonb_path_query('0', '-(3 + 1 % $)');
+select jsonb_path_query('1', '$ + "2"');
+select jsonb_path_query('[1, 2]', '3 * $');
+select jsonb_path_query('"a"', '-$');
+select jsonb_path_query('[1,"2",3]', '+$');
+select jsonb_path_query('1', '$ + "2"', silent => true);
+select jsonb_path_query('[1, 2]', '3 * $', silent => true);
+select jsonb_path_query('"a"', '-$', silent => true);
+select jsonb_path_query('[1,"2",3]', '+$', silent => true);
+select jsonb '["1",2,0,3]' @? '-$[*]';
+select jsonb '[1,"2",0,3]' @? '-$[*]';
+select jsonb '["1",2,0,3]' @? 'strict -$[*]';
+select jsonb '[1,"2",0,3]' @? 'strict -$[*]';
+
+-- unwrapping of operator arguments in lax mode
+select jsonb_path_query('{"a": [2]}', 'lax $.a * 3');
+select jsonb_path_query('{"a": [2]}', 'lax $.a + 3');
+select jsonb_path_query('{"a": [2, 3, 4]}', 'lax -$.a');
+-- should fail
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3');
+select jsonb_path_query('{"a": [1, 2]}', 'lax $.a * 3', silent => true);
+
+-- extension: boolean expressions
+select jsonb_path_query('2', '$ > 1');
+select jsonb_path_query('2', '$ <= 1');
+select jsonb_path_query('2', '$ == "2"');
+select jsonb '2' @? '$ == "2"';
+
+select jsonb '2' @@ '$ > 1';
+select jsonb '2' @@ '$ <= 1';
+select jsonb '2' @@ '$ == "2"';
+select jsonb '2' @@ '1';
+select jsonb '{}' @@ '$';
+select jsonb '[]' @@ '$';
+select jsonb '[1,2,3]' @@ '$[*]';
+select jsonb '[]' @@ '$[*]';
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] > $x) [1]', '{"x": 1}');
+select jsonb_path_match('[[1, true], [2, false]]', 'strict $[*] ? (@[0] < $x) [1]', '{"x": 2}');
+
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => false);
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'lax exists($[*].a)', silent => true);
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => false);
+select jsonb_path_match('[{"a": 1}, {"a": 2}, 3]', 'strict exists($[*].a)', silent => true);
+
+
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$.type()');
+select jsonb_path_query('[null,1,true,"a",[],{}]', 'lax $.type()');
+select jsonb_path_query('[null,1,true,"a",[],{}]', '$[*].type()');
+select jsonb_path_query('null', 'null.type()');
+select jsonb_path_query('null', 'true.type()');
+select jsonb_path_query('null', '(123).type()');
+select jsonb_path_query('null', '"123".type()');
+
+select jsonb_path_query('{"a": 2}', '($.a - 5).abs() + 10');
+select jsonb_path_query('{"a": 2.5}', '-($.a * $.a).floor() % 4.3');
+select jsonb_path_query('[1, 2, 3]', '($[*] > 2) ? (@ == true)');
+select jsonb_path_query('[1, 2, 3]', '($[*] > 3).type()');
+select jsonb_path_query('[1, 2, 3]', '($[*].a > 3).type()');
+select jsonb_path_query('[1, 2, 3]', 'strict ($[*].a > 3).type()');
+
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()');
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'strict $[*].size()', silent => true);
+select jsonb_path_query('[1,null,true,"11",[],[1],[1,2,3],{},{"a":1,"b":2}]', 'lax $[*].size()');
+
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].abs()');
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].floor()');
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling()');
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs()');
+select jsonb_path_query('[0, 1, -2, -3.4, 5.6]', '$[*].ceiling().abs().type()');
+
+select jsonb_path_query('[{},1]', '$[*].keyvalue()');
+select jsonb_path_query('[{},1]', '$[*].keyvalue()', silent => true);
+select jsonb_path_query('{}', '$.keyvalue()');
+select jsonb_path_query('{"a": 1, "b": [1, 2], "c": {"a": "bbb"}}', '$.keyvalue()');
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', '$[*].keyvalue()');
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue()');
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'lax $.keyvalue()');
+select jsonb_path_query('[{"a": 1, "b": [1, 2]}, {"c": {"a": "bbb"}}]', 'strict $.keyvalue().a');
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue()';
+select jsonb '{"a": 1, "b": [1, 2]}' @? 'lax $.keyvalue().key';
+
+select jsonb_path_query('null', '$.double()');
+select jsonb_path_query('true', '$.double()');
+select jsonb_path_query('null', '$.double()', silent => true);
+select jsonb_path_query('true', '$.double()', silent => true);
+select jsonb_path_query('[]', '$.double()');
+select jsonb_path_query('[]', 'strict $.double()');
+select jsonb_path_query('{}', '$.double()');
+select jsonb_path_query('[]', 'strict $.double()', silent => true);
+select jsonb_path_query('{}', '$.double()', silent => true);
+select jsonb_path_query('1.23', '$.double()');
+select jsonb_path_query('"1.23"', '$.double()');
+select jsonb_path_query('"1.23aaa"', '$.double()');
+select jsonb_path_query('1e1000', '$.double()');
+select jsonb_path_query('"nan"', '$.double()');
+select jsonb_path_query('"NaN"', '$.double()');
+select jsonb_path_query('"inf"', '$.double()');
+select jsonb_path_query('"-inf"', '$.double()');
+select jsonb_path_query('"inf"', '$.double()', silent => true);
+select jsonb_path_query('"-inf"', '$.double()', silent => true);
+
+select jsonb_path_query('{}', '$.abs()');
+select jsonb_path_query('true', '$.floor()');
+select jsonb_path_query('"1.2"', '$.ceiling()');
+select jsonb_path_query('{}', '$.abs()', silent => true);
+select jsonb_path_query('true', '$.floor()', silent => true);
+select jsonb_path_query('"1.2"', '$.ceiling()', silent => true);
+
+select jsonb_path_query('["", "a", "abc", "abcabc"]', '$[*] ? (@ starts with "abc")');
+select jsonb_path_query('["", "a", "abc", "abcabc"]', 'strict $ ? (@[*] starts with "abc")');
+select jsonb_path_query('["", "a", "abd", "abdabc"]', 'strict $ ? (@[*] starts with "abc")');
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? (@[*] starts with "abc")');
+select jsonb_path_query('["abc", "abcabc", null, 1]', 'strict $ ? ((@[*] starts with "abc") is unknown)');
+select jsonb_path_query('[[null, 1, "abc", "abcabc"]]', 'lax $ ? (@[*] starts with "abc")');
+select jsonb_path_query('[[null, 1, "abd", "abdabc"]]', 'lax $ ? ((@[*] starts with "abc") is unknown)');
+select jsonb_path_query('[null, 1, "abd", "abdabc"]', 'lax $[*] ? ((@ starts with "abc") is unknown)');
+
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c")');
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "i")');
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "m")');
+select jsonb_path_query('[null, 1, "abc", "abd", "aBdC", "abdacb", "babc", "adc\nabc", "ab\nadc"]', 'lax $[*] ? (@ like_regex "^ab.*c" flag "s")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "q")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b" flag "")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "q")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "q")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\B$" flag "iq")');
+select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$" flag "")');
+
+select jsonb_path_query('null', '$.datetime()');
+select jsonb_path_query('true', '$.datetime()');
+select jsonb_path_query('1', '$.datetime()');
+select jsonb_path_query('[]', '$.datetime()');
+select jsonb_path_query('[]', 'strict $.datetime()');
+select jsonb_path_query('{}', '$.datetime()');
+select jsonb_path_query('"bogus"', '$.datetime()');
+select jsonb_path_query('"12:34"', '$.datetime("aaa")');
+select jsonb_path_query('"aaaa"', '$.datetime("HH24")');
+
+select jsonb '"10-03-2017"' @? '$.datetime("dd-mm-yyyy")';
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy")');
+select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy").type()');
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy")');
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy").type()');
+
+select jsonb_path_query('"10-03-2017 12:34"', ' $.datetime("dd-mm-yyyy HH24:MI").type()');
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM").type()');
+select jsonb_path_query('"12:34:56"', '$.datetime("HH24:MI:SS").type()');
+select jsonb_path_query('"12:34:56 +05:20"', '$.datetime("HH24:MI:SS TZH:TZM").type()');
+
+select jsonb_path_query('"10-03-2017T12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+select jsonb_path_query('"10-03-2017t12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+select jsonb_path_query('"10-03-2017 12:34:56"', '$.datetime("dd-mm-yyyy\"T\"HH24:MI:SS")');
+
+set time zone '+00';
+
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+
+set time zone '+10';
+
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI")');
+select jsonb_path_query('"10-03-2017 12:34"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 +05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 -05"', '$.datetime("dd-mm-yyyy HH24:MI TZH")');
+select jsonb_path_query('"10-03-2017 12:34 +05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+select jsonb_path_query('"10-03-2017 12:34 -05:20"', '$.datetime("dd-mm-yyyy HH24:MI TZH:TZM")');
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI")');
+select jsonb_path_query('"12:34"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 +05"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 -05"', '$.datetime("HH24:MI TZH")');
+select jsonb_path_query('"12:34 +05:20"', '$.datetime("HH24:MI TZH:TZM")');
+select jsonb_path_query('"12:34 -05:20"', '$.datetime("HH24:MI TZH:TZM")');
+
+set time zone default;
+
+select jsonb_path_query('"2017-03-10"', '$.datetime().type()');
+select jsonb_path_query('"2017-03-10"', '$.datetime()');
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime().type()');
+select jsonb_path_query('"2017-03-10 12:34:56"', '$.datetime()');
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime().type()');
+select jsonb_path_query('"2017-03-10 12:34:56+3"', '$.datetime()');
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime().type()');
+select jsonb_path_query('"2017-03-10 12:34:56+3:10"', '$.datetime()');
+select jsonb_path_query('"2017-03-10T12:34:56+3:10"', '$.datetime()');
+select jsonb_path_query('"2017-03-10t12:34:56+3:10"', '$.datetime()');
+select jsonb_path_query('"12:34:56"', '$.datetime().type()');
+select jsonb_path_query('"12:34:56"', '$.datetime()');
+select jsonb_path_query('"12:34:56+3"', '$.datetime().type()');
+select jsonb_path_query('"12:34:56+3"', '$.datetime()');
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime().type()');
+select jsonb_path_query('"12:34:56+3:10"', '$.datetime()');
+
+set time zone '+00';
+
+-- date comparison
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+select jsonb_path_query(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ == "10.03.2017".datetime("dd.mm.yyyy"))');
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ >= "10.03.2017".datetime("dd.mm.yyyy"))');
+select jsonb_path_query_tz(
+ '["2017-03-10", "2017-03-11", "2017-03-09", "12:34:56", "01:02:03+04", "2017-03-10 00:00:00", "2017-03-10 12:34:56", "2017-03-10 01:02:03+04", "2017-03-10 03:00:00+03"]',
+ '$[*].datetime() ? (@ < "10.03.2017".datetime("dd.mm.yyyy"))');
+
+-- time comparison
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+select jsonb_path_query(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ == "12:35".datetime("HH24:MI"))');
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ >= "12:35".datetime("HH24:MI"))');
+select jsonb_path_query_tz(
+ '["12:34:00", "12:35:00", "12:36:00", "12:35:00+00", "12:35:00+01", "13:35:00+01", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00+01"]',
+ '$[*].datetime() ? (@ < "12:35".datetime("HH24:MI"))');
+
+-- timetz comparison
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+select jsonb_path_query(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ == "12:35 +1".datetime("HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ >= "12:35 +1".datetime("HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["12:34:00+01", "12:35:00+01", "12:36:00+01", "12:35:00+02", "12:35:00-02", "10:35:00", "11:35:00", "12:35:00", "2017-03-10", "2017-03-10 12:35:00", "2017-03-10 12:35:00 +1"]',
+ '$[*].datetime() ? (@ < "12:35 +1".datetime("HH24:MI TZH"))');
+
+-- timestamp comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+select jsonb_path_query(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00", "2017-03-10 12:35:00", "2017-03-10 12:36:00", "2017-03-10 12:35:00+01", "2017-03-10 13:35:00+01", "2017-03-10 12:35:00-01", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35".datetime("dd.mm.yyyy HH24:MI"))');
+
+-- timestamptz comparison
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+select jsonb_path_query(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ == "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ >= "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+select jsonb_path_query_tz(
+ '["2017-03-10 12:34:00+01", "2017-03-10 12:35:00+01", "2017-03-10 12:36:00+01", "2017-03-10 12:35:00+02", "2017-03-10 12:35:00-02", "2017-03-10 10:35:00", "2017-03-10 11:35:00", "2017-03-10 12:35:00", "2017-03-10", "2017-03-11", "12:34:56", "12:34:56+01"]',
+ '$[*].datetime() ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))');
+
+-- overflow during comparison
+select jsonb_path_query('"1000000-01-01"', '$.datetime() > "2020-01-01 12:00:00".datetime()'::jsonpath);
+
+set time zone default;
+
+-- jsonpath operators
+
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*]');
+SELECT jsonb_path_query('[{"a": 1}, {"a": 2}]', '$[*] ? (@.a > 10)');
+
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a');
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+SELECT jsonb_path_query_array('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a');
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {}]', 'strict $[*].a', silent => true);
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a');
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ == 1)');
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 10)');
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 1, "max": 4}');
+SELECT jsonb_path_query_first('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*].a ? (@ > $min && @ < $max)', vars => '{"min": 3, "max": 4}');
+
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*].a ? (@ > 1)';
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @? '$[*] ? (@.a > 2)';
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}]', '$[*].a ? (@ > 1)');
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 1, "max": 4}');
+SELECT jsonb_path_exists('[{"a": 1}, {"a": 2}, {"a": 3}, {"a": 5}]', '$[*] ? (@.a > $min && @.a < $max)', vars => '{"min": 3, "max": 4}');
+
+SELECT jsonb_path_match('true', '$', silent => false);
+SELECT jsonb_path_match('false', '$', silent => false);
+SELECT jsonb_path_match('null', '$', silent => false);
+SELECT jsonb_path_match('1', '$', silent => true);
+SELECT jsonb_path_match('1', '$', silent => false);
+SELECT jsonb_path_match('"a"', '$', silent => false);
+SELECT jsonb_path_match('{}', '$', silent => false);
+SELECT jsonb_path_match('[true]', '$', silent => false);
+SELECT jsonb_path_match('{}', 'lax $.a', silent => false);
+SELECT jsonb_path_match('{}', 'strict $.a', silent => false);
+SELECT jsonb_path_match('{}', 'strict $.a', silent => true);
+SELECT jsonb_path_match('[true, true]', '$[*]', silent => false);
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 1';
+SELECT jsonb '[{"a": 1}, {"a": 2}]' @@ '$[*].a > 2';
+SELECT jsonb_path_match('[{"a": 1}, {"a": 2}]', '$[*].a > 1');
+
+-- test string comparison (Unicode codepoint collation)
+WITH str(j, num) AS
+(
+ SELECT jsonb_build_object('s', s), num
+ FROM unnest('{"", "a", "ab", "abc", "abcd", "b", "A", "AB", "ABC", "ABc", "ABcD", "B"}'::text[]) WITH ORDINALITY AS a(s, num)
+)
+SELECT
+ s1.j, s2.j,
+ jsonb_path_query_first(s1.j, '$.s < $s', vars => s2.j) lt,
+ jsonb_path_query_first(s1.j, '$.s <= $s', vars => s2.j) le,
+ jsonb_path_query_first(s1.j, '$.s == $s', vars => s2.j) eq,
+ jsonb_path_query_first(s1.j, '$.s >= $s', vars => s2.j) ge,
+ jsonb_path_query_first(s1.j, '$.s > $s', vars => s2.j) gt
+FROM str s1, str s2
+ORDER BY s1.num, s2.num;
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonpath.out b/yql/essentials/tests/postgresql/original/cases/jsonpath.out
new file mode 100644
index 0000000000..6dab98d03a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonpath.out
@@ -0,0 +1,964 @@
+--jsonpath io
+select ''::jsonpath;
+ERROR: invalid input syntax for type jsonpath: ""
+LINE 1: select ''::jsonpath;
+ ^
+select '$'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select 'strict $'::jsonpath;
+ jsonpath
+----------
+ strict $
+(1 row)
+
+select 'lax $'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '$.a'::jsonpath;
+ jsonpath
+----------
+ $."a"
+(1 row)
+
+select '$.a.v'::jsonpath;
+ jsonpath
+-----------
+ $."a"."v"
+(1 row)
+
+select '$.a.*'::jsonpath;
+ jsonpath
+----------
+ $."a".*
+(1 row)
+
+select '$.*[*]'::jsonpath;
+ jsonpath
+----------
+ $.*[*]
+(1 row)
+
+select '$.a[*]'::jsonpath;
+ jsonpath
+----------
+ $."a"[*]
+(1 row)
+
+select '$.a[*][*]'::jsonpath;
+ jsonpath
+-------------
+ $."a"[*][*]
+(1 row)
+
+select '$[*]'::jsonpath;
+ jsonpath
+----------
+ $[*]
+(1 row)
+
+select '$[0]'::jsonpath;
+ jsonpath
+----------
+ $[0]
+(1 row)
+
+select '$[*][0]'::jsonpath;
+ jsonpath
+----------
+ $[*][0]
+(1 row)
+
+select '$[*].a'::jsonpath;
+ jsonpath
+----------
+ $[*]."a"
+(1 row)
+
+select '$[*][0].a.b'::jsonpath;
+ jsonpath
+-----------------
+ $[*][0]."a"."b"
+(1 row)
+
+select '$.a.**.b'::jsonpath;
+ jsonpath
+--------------
+ $."a".**."b"
+(1 row)
+
+select '$.a.**{2}.b'::jsonpath;
+ jsonpath
+-----------------
+ $."a".**{2}."b"
+(1 row)
+
+select '$.a.**{2 to 2}.b'::jsonpath;
+ jsonpath
+-----------------
+ $."a".**{2}."b"
+(1 row)
+
+select '$.a.**{2 to 5}.b'::jsonpath;
+ jsonpath
+----------------------
+ $."a".**{2 to 5}."b"
+(1 row)
+
+select '$.a.**{0 to 5}.b'::jsonpath;
+ jsonpath
+----------------------
+ $."a".**{0 to 5}."b"
+(1 row)
+
+select '$.a.**{5 to last}.b'::jsonpath;
+ jsonpath
+-------------------------
+ $."a".**{5 to last}."b"
+(1 row)
+
+select '$.a.**{last}.b'::jsonpath;
+ jsonpath
+--------------------
+ $."a".**{last}."b"
+(1 row)
+
+select '$.a.**{last to 5}.b'::jsonpath;
+ jsonpath
+-------------------------
+ $."a".**{last to 5}."b"
+(1 row)
+
+select '$+1'::jsonpath;
+ jsonpath
+----------
+ ($ + 1)
+(1 row)
+
+select '$-1'::jsonpath;
+ jsonpath
+----------
+ ($ - 1)
+(1 row)
+
+select '$--+1'::jsonpath;
+ jsonpath
+----------
+ ($ - -1)
+(1 row)
+
+select '$.a/+-1'::jsonpath;
+ jsonpath
+--------------
+ ($."a" / -1)
+(1 row)
+
+select '1 * 2 + 4 % -3 != false'::jsonpath;
+ jsonpath
+---------------------------
+ (1 * 2 + 4 % -3 != false)
+(1 row)
+
+select '"\b\f\r\n\t\v\"\''\\"'::jsonpath;
+ jsonpath
+-------------------------
+ "\b\f\r\n\t\u000b\"'\\"
+(1 row)
+
+select '"\x50\u0067\u{53}\u{051}\u{00004C}"'::jsonpath;
+ jsonpath
+----------
+ "PgSQL"
+(1 row)
+
+select '$.foo\x50\u0067\u{53}\u{051}\u{00004C}\t\"bar'::jsonpath;
+ jsonpath
+---------------------
+ $."fooPgSQL\t\"bar"
+(1 row)
+
+select '"\z"'::jsonpath; -- unrecognized escape is just the literal char
+ jsonpath
+----------
+ "z"
+(1 row)
+
+select '$.g ? ($.a == 1)'::jsonpath;
+ jsonpath
+--------------------
+ $."g"?($."a" == 1)
+(1 row)
+
+select '$.g ? (@ == 1)'::jsonpath;
+ jsonpath
+----------------
+ $."g"?(@ == 1)
+(1 row)
+
+select '$.g ? (@.a == 1)'::jsonpath;
+ jsonpath
+--------------------
+ $."g"?(@."a" == 1)
+(1 row)
+
+select '$.g ? (@.a == 1 || @.a == 4)'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(@."a" == 1 || @."a" == 4)
+(1 row)
+
+select '$.g ? (@.a == 1 && @.a == 4)'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(@."a" == 1 && @."a" == 4)
+(1 row)
+
+select '$.g ? (@.a == 1 || @.a == 4 && @.b == 7)'::jsonpath;
+ jsonpath
+------------------------------------------------
+ $."g"?(@."a" == 1 || @."a" == 4 && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.a == 1 || !(@.a == 4) && @.b == 7)'::jsonpath;
+ jsonpath
+---------------------------------------------------
+ $."g"?(@."a" == 1 || !(@."a" == 4) && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.a == 1 || !(@.x >= 123 || @.a == 4) && @.b == 7)'::jsonpath;
+ jsonpath
+-------------------------------------------------------------------
+ $."g"?(@."a" == 1 || !(@."x" >= 123 || @."a" == 4) && @."b" == 7)
+(1 row)
+
+select '$.g ? (@.x >= @[*]?(@.a > "abc"))'::jsonpath;
+ jsonpath
+---------------------------------------
+ $."g"?(@."x" >= @[*]?(@."a" > "abc"))
+(1 row)
+
+select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath;
+ jsonpath
+-------------------------------------------------
+ $."g"?((@."x" >= 123 || @."a" == 4) is unknown)
+(1 row)
+
+select '$.g ? (exists (@.x))'::jsonpath;
+ jsonpath
+------------------------
+ $."g"?(exists (@."x"))
+(1 row)
+
+select '$.g ? (exists (@.x ? (@ == 14)))'::jsonpath;
+ jsonpath
+----------------------------------
+ $."g"?(exists (@."x"?(@ == 14)))
+(1 row)
+
+select '$.g ? ((@.x >= 123 || @.a == 4) && exists (@.x ? (@ == 14)))'::jsonpath;
+ jsonpath
+------------------------------------------------------------------
+ $."g"?((@."x" >= 123 || @."a" == 4) && exists (@."x"?(@ == 14)))
+(1 row)
+
+select '$.g ? (+@.x >= +-(+@.a + 2))'::jsonpath;
+ jsonpath
+------------------------------------
+ $."g"?(+@."x" >= +(-(+@."a" + 2)))
+(1 row)
+
+select '$a'::jsonpath;
+ jsonpath
+----------
+ $"a"
+(1 row)
+
+select '$a.b'::jsonpath;
+ jsonpath
+----------
+ $"a"."b"
+(1 row)
+
+select '$a[*]'::jsonpath;
+ jsonpath
+----------
+ $"a"[*]
+(1 row)
+
+select '$.g ? (@.zip == $zip)'::jsonpath;
+ jsonpath
+---------------------------
+ $."g"?(@."zip" == $"zip")
+(1 row)
+
+select '$.a[1,2, 3 to 16]'::jsonpath;
+ jsonpath
+--------------------
+ $."a"[1,2,3 to 16]
+(1 row)
+
+select '$.a[$a + 1, ($b[*]) to -($[0] * 2)]'::jsonpath;
+ jsonpath
+----------------------------------------
+ $."a"[$"a" + 1,$"b"[*] to -($[0] * 2)]
+(1 row)
+
+select '$.a[$.a.size() - 3]'::jsonpath;
+ jsonpath
+-------------------------
+ $."a"[$."a".size() - 3]
+(1 row)
+
+select 'last'::jsonpath;
+ERROR: LAST is allowed only in array subscripts
+LINE 1: select 'last'::jsonpath;
+ ^
+select '"last"'::jsonpath;
+ jsonpath
+----------
+ "last"
+(1 row)
+
+select '$.last'::jsonpath;
+ jsonpath
+----------
+ $."last"
+(1 row)
+
+select '$ ? (last > 0)'::jsonpath;
+ERROR: LAST is allowed only in array subscripts
+LINE 1: select '$ ? (last > 0)'::jsonpath;
+ ^
+select '$[last]'::jsonpath;
+ jsonpath
+----------
+ $[last]
+(1 row)
+
+select '$[$[0] ? (last > 0)]'::jsonpath;
+ jsonpath
+--------------------
+ $[$[0]?(last > 0)]
+(1 row)
+
+select 'null.type()'::jsonpath;
+ jsonpath
+-------------
+ null.type()
+(1 row)
+
+select '1.type()'::jsonpath;
+ jsonpath
+----------
+ 1.type()
+(1 row)
+
+select '(1).type()'::jsonpath;
+ jsonpath
+----------
+ 1.type()
+(1 row)
+
+select '1.2.type()'::jsonpath;
+ jsonpath
+------------
+ 1.2.type()
+(1 row)
+
+select '"aaa".type()'::jsonpath;
+ jsonpath
+--------------
+ "aaa".type()
+(1 row)
+
+select 'true.type()'::jsonpath;
+ jsonpath
+-------------
+ true.type()
+(1 row)
+
+select '$.double().floor().ceiling().abs()'::jsonpath;
+ jsonpath
+------------------------------------
+ $.double().floor().ceiling().abs()
+(1 row)
+
+select '$.keyvalue().key'::jsonpath;
+ jsonpath
+--------------------
+ $.keyvalue()."key"
+(1 row)
+
+select '$.datetime()'::jsonpath;
+ jsonpath
+--------------
+ $.datetime()
+(1 row)
+
+select '$.datetime("datetime template")'::jsonpath;
+ jsonpath
+---------------------------------
+ $.datetime("datetime template")
+(1 row)
+
+select '$ ? (@ starts with "abc")'::jsonpath;
+ jsonpath
+-------------------------
+ $?(@ starts with "abc")
+(1 row)
+
+select '$ ? (@ starts with $var)'::jsonpath;
+ jsonpath
+--------------------------
+ $?(@ starts with $"var")
+(1 row)
+
+select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ERROR: invalid regular expression: parentheses () not balanced
+LINE 1: select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+ ^
+select '$ ? (@ like_regex "pattern")'::jsonpath;
+ jsonpath
+----------------------------
+ $?(@ like_regex "pattern")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "")'::jsonpath;
+ jsonpath
+----------------------------
+ $?(@ like_regex "pattern")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "i")'::jsonpath;
+ jsonpath
+-------------------------------------
+ $?(@ like_regex "pattern" flag "i")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "is")'::jsonpath;
+ jsonpath
+--------------------------------------
+ $?(@ like_regex "pattern" flag "is")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "isim")'::jsonpath;
+ jsonpath
+---------------------------------------
+ $?(@ like_regex "pattern" flag "ism")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ERROR: XQuery "x" flag (expanded regular expressions) is not implemented
+LINE 1: select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+ ^
+select '$ ? (@ like_regex "pattern" flag "q")'::jsonpath;
+ jsonpath
+-------------------------------------
+ $?(@ like_regex "pattern" flag "q")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "iq")'::jsonpath;
+ jsonpath
+--------------------------------------
+ $?(@ like_regex "pattern" flag "iq")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "smixq")'::jsonpath;
+ jsonpath
+-----------------------------------------
+ $?(@ like_regex "pattern" flag "ismxq")
+(1 row)
+
+select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+ ^
+DETAIL: unrecognized flag character "a" in LIKE_REGEX predicate
+select '$ < 1'::jsonpath;
+ jsonpath
+----------
+ ($ < 1)
+(1 row)
+
+select '($ < 1) || $.a.b <= $x'::jsonpath;
+ jsonpath
+------------------------------
+ ($ < 1 || $."a"."b" <= $"x")
+(1 row)
+
+select '@ + 1'::jsonpath;
+ERROR: @ is not allowed in root expressions
+LINE 1: select '@ + 1'::jsonpath;
+ ^
+select '($).a.b'::jsonpath;
+ jsonpath
+-----------
+ $."a"."b"
+(1 row)
+
+select '($.a.b).c.d'::jsonpath;
+ jsonpath
+-------------------
+ $."a"."b"."c"."d"
+(1 row)
+
+select '($.a.b + -$.x.y).c.d'::jsonpath;
+ jsonpath
+----------------------------------
+ ($."a"."b" + -$."x"."y")."c"."d"
+(1 row)
+
+select '(-+$.a.b).c.d'::jsonpath;
+ jsonpath
+-------------------------
+ (-(+$."a"."b"))."c"."d"
+(1 row)
+
+select '1 + ($.a.b + 2).c.d'::jsonpath;
+ jsonpath
+-------------------------------
+ (1 + ($."a"."b" + 2)."c"."d")
+(1 row)
+
+select '1 + ($.a.b > 2).c.d'::jsonpath;
+ jsonpath
+-------------------------------
+ (1 + ($."a"."b" > 2)."c"."d")
+(1 row)
+
+select '($)'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '(($))'::jsonpath;
+ jsonpath
+----------
+ $
+(1 row)
+
+select '((($ + 1)).a + ((2)).b ? ((((@ > 1)) || (exists(@.c)))))'::jsonpath;
+ jsonpath
+-------------------------------------------------
+ (($ + 1)."a" + 2."b"?(@ > 1 || exists (@."c")))
+(1 row)
+
+select '$ ? (@.a < 1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < .1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < .1)'::jsonpath;
+ ^
+select '$ ? (@.a < -.1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < -.1)'::jsonpath;
+ ^
+select '$ ? (@.a < +.1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < +.1)'::jsonpath;
+ ^
+select '$ ? (@.a < 0.1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < -0.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -0.1)
+(1 row)
+
+select '$ ? (@.a < +0.1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < 10.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 10.1)
+(1 row)
+
+select '$ ? (@.a < -10.1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -10.1)
+(1 row)
+
+select '$ ? (@.a < +10.1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 10.1)
+(1 row)
+
+select '$ ? (@.a < 1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < -1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < -10)
+(1 row)
+
+select '$ ? (@.a < +1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < .1e1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < .1e1)'::jsonpath;
+ ^
+select '$ ? (@.a < -.1e1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < -.1e1)'::jsonpath;
+ ^
+select '$ ? (@.a < +.1e1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < +.1e1)'::jsonpath;
+ ^
+select '$ ? (@.a < 0.1e1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -0.1e1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +0.1e1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < 10.1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < -10.1e1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -101)
+(1 row)
+
+select '$ ? (@.a < +10.1e1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < 1e-1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < -1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -0.1)
+(1 row)
+
+select '$ ? (@.a < +1e-1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 0.1)
+(1 row)
+
+select '$ ? (@.a < .1e-1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < .1e-1)'::jsonpath;
+ ^
+select '$ ? (@.a < -.1e-1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < -.1e-1)'::jsonpath;
+ ^
+select '$ ? (@.a < +.1e-1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < +.1e-1)'::jsonpath;
+ ^
+select '$ ? (@.a < 0.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 0.01)
+(1 row)
+
+select '$ ? (@.a < -0.1e-1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -0.01)
+(1 row)
+
+select '$ ? (@.a < +0.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 0.01)
+(1 row)
+
+select '$ ? (@.a < 10.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 1.01)
+(1 row)
+
+select '$ ? (@.a < -10.1e-1)'::jsonpath;
+ jsonpath
+-------------------
+ $?(@."a" < -1.01)
+(1 row)
+
+select '$ ? (@.a < +10.1e-1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < 1.01)
+(1 row)
+
+select '$ ? (@.a < 1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < -1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < -10)
+(1 row)
+
+select '$ ? (@.a < +1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < 10)
+(1 row)
+
+select '$ ? (@.a < .1e+1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < .1e+1)'::jsonpath;
+ ^
+select '$ ? (@.a < -.1e+1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < -.1e+1)'::jsonpath;
+ ^
+select '$ ? (@.a < +.1e+1)'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '$ ? (@.a < +.1e+1)'::jsonpath;
+ ^
+select '$ ? (@.a < 0.1e+1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < -0.1e+1)'::jsonpath;
+ jsonpath
+----------------
+ $?(@."a" < -1)
+(1 row)
+
+select '$ ? (@.a < +0.1e+1)'::jsonpath;
+ jsonpath
+---------------
+ $?(@."a" < 1)
+(1 row)
+
+select '$ ? (@.a < 10.1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '$ ? (@.a < -10.1e+1)'::jsonpath;
+ jsonpath
+------------------
+ $?(@."a" < -101)
+(1 row)
+
+select '$ ? (@.a < +10.1e+1)'::jsonpath;
+ jsonpath
+-----------------
+ $?(@."a" < 101)
+(1 row)
+
+select '0'::jsonpath;
+ jsonpath
+----------
+ 0
+(1 row)
+
+select '00'::jsonpath;
+ERROR: syntax error at end of jsonpath input
+LINE 1: select '00'::jsonpath;
+ ^
+select '0.0'::jsonpath;
+ jsonpath
+----------
+ 0.0
+(1 row)
+
+select '0.000'::jsonpath;
+ jsonpath
+----------
+ 0.000
+(1 row)
+
+select '0.000e1'::jsonpath;
+ jsonpath
+----------
+ 0.00
+(1 row)
+
+select '0.000e2'::jsonpath;
+ jsonpath
+----------
+ 0.0
+(1 row)
+
+select '0.000e3'::jsonpath;
+ jsonpath
+----------
+ 0
+(1 row)
+
+select '0.0010'::jsonpath;
+ jsonpath
+----------
+ 0.0010
+(1 row)
+
+select '0.0010e-1'::jsonpath;
+ jsonpath
+----------
+ 0.00010
+(1 row)
+
+select '0.0010e+1'::jsonpath;
+ jsonpath
+----------
+ 0.010
+(1 row)
+
+select '0.0010e+2'::jsonpath;
+ jsonpath
+----------
+ 0.10
+(1 row)
+
+select '1e'::jsonpath;
+ERROR: invalid floating point number at or near "1e" of jsonpath input
+LINE 1: select '1e'::jsonpath;
+ ^
+select '1.e'::jsonpath;
+ jsonpath
+----------
+ 1."e"
+(1 row)
+
+select '1.2e'::jsonpath;
+ERROR: invalid floating point number at or near "1.2e" of jsonpath input
+LINE 1: select '1.2e'::jsonpath;
+ ^
+select '1.2.e'::jsonpath;
+ jsonpath
+----------
+ 1.2."e"
+(1 row)
+
+select '(1.2).e'::jsonpath;
+ jsonpath
+----------
+ 1.2."e"
+(1 row)
+
+select '1e3'::jsonpath;
+ jsonpath
+----------
+ 1000
+(1 row)
+
+select '1.e3'::jsonpath;
+ jsonpath
+----------
+ 1."e3"
+(1 row)
+
+select '1.e3.e'::jsonpath;
+ jsonpath
+------------
+ 1."e3"."e"
+(1 row)
+
+select '1.e3.e4'::jsonpath;
+ jsonpath
+-------------
+ 1."e3"."e4"
+(1 row)
+
+select '1.2e3'::jsonpath;
+ jsonpath
+----------
+ 1200
+(1 row)
+
+select '1.2.e3'::jsonpath;
+ jsonpath
+----------
+ 1.2."e3"
+(1 row)
+
+select '(1.2).e3'::jsonpath;
+ jsonpath
+----------
+ 1.2."e3"
+(1 row)
+
+select '1..e'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '1..e'::jsonpath;
+ ^
+select '1..e3'::jsonpath;
+ERROR: syntax error at or near "." of jsonpath input
+LINE 1: select '1..e3'::jsonpath;
+ ^
+select '(1.).e'::jsonpath;
+ERROR: syntax error at or near ")" of jsonpath input
+LINE 1: select '(1.).e'::jsonpath;
+ ^
+select '(1.).e3'::jsonpath;
+ERROR: syntax error at or near ")" of jsonpath input
+LINE 1: select '(1.).e3'::jsonpath;
+ ^
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonpath.sql b/yql/essentials/tests/postgresql/original/cases/jsonpath.sql
new file mode 100644
index 0000000000..17ab775783
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonpath.sql
@@ -0,0 +1,181 @@
+--jsonpath io
+
+select ''::jsonpath;
+select '$'::jsonpath;
+select 'strict $'::jsonpath;
+select 'lax $'::jsonpath;
+select '$.a'::jsonpath;
+select '$.a.v'::jsonpath;
+select '$.a.*'::jsonpath;
+select '$.*[*]'::jsonpath;
+select '$.a[*]'::jsonpath;
+select '$.a[*][*]'::jsonpath;
+select '$[*]'::jsonpath;
+select '$[0]'::jsonpath;
+select '$[*][0]'::jsonpath;
+select '$[*].a'::jsonpath;
+select '$[*][0].a.b'::jsonpath;
+select '$.a.**.b'::jsonpath;
+select '$.a.**{2}.b'::jsonpath;
+select '$.a.**{2 to 2}.b'::jsonpath;
+select '$.a.**{2 to 5}.b'::jsonpath;
+select '$.a.**{0 to 5}.b'::jsonpath;
+select '$.a.**{5 to last}.b'::jsonpath;
+select '$.a.**{last}.b'::jsonpath;
+select '$.a.**{last to 5}.b'::jsonpath;
+select '$+1'::jsonpath;
+select '$-1'::jsonpath;
+select '$--+1'::jsonpath;
+select '$.a/+-1'::jsonpath;
+select '1 * 2 + 4 % -3 != false'::jsonpath;
+
+select '"\b\f\r\n\t\v\"\''\\"'::jsonpath;
+select '"\x50\u0067\u{53}\u{051}\u{00004C}"'::jsonpath;
+select '$.foo\x50\u0067\u{53}\u{051}\u{00004C}\t\"bar'::jsonpath;
+select '"\z"'::jsonpath; -- unrecognized escape is just the literal char
+
+select '$.g ? ($.a == 1)'::jsonpath;
+select '$.g ? (@ == 1)'::jsonpath;
+select '$.g ? (@.a == 1)'::jsonpath;
+select '$.g ? (@.a == 1 || @.a == 4)'::jsonpath;
+select '$.g ? (@.a == 1 && @.a == 4)'::jsonpath;
+select '$.g ? (@.a == 1 || @.a == 4 && @.b == 7)'::jsonpath;
+select '$.g ? (@.a == 1 || !(@.a == 4) && @.b == 7)'::jsonpath;
+select '$.g ? (@.a == 1 || !(@.x >= 123 || @.a == 4) && @.b == 7)'::jsonpath;
+select '$.g ? (@.x >= @[*]?(@.a > "abc"))'::jsonpath;
+select '$.g ? ((@.x >= 123 || @.a == 4) is unknown)'::jsonpath;
+select '$.g ? (exists (@.x))'::jsonpath;
+select '$.g ? (exists (@.x ? (@ == 14)))'::jsonpath;
+select '$.g ? ((@.x >= 123 || @.a == 4) && exists (@.x ? (@ == 14)))'::jsonpath;
+select '$.g ? (+@.x >= +-(+@.a + 2))'::jsonpath;
+
+select '$a'::jsonpath;
+select '$a.b'::jsonpath;
+select '$a[*]'::jsonpath;
+select '$.g ? (@.zip == $zip)'::jsonpath;
+select '$.a[1,2, 3 to 16]'::jsonpath;
+select '$.a[$a + 1, ($b[*]) to -($[0] * 2)]'::jsonpath;
+select '$.a[$.a.size() - 3]'::jsonpath;
+select 'last'::jsonpath;
+select '"last"'::jsonpath;
+select '$.last'::jsonpath;
+select '$ ? (last > 0)'::jsonpath;
+select '$[last]'::jsonpath;
+select '$[$[0] ? (last > 0)]'::jsonpath;
+
+select 'null.type()'::jsonpath;
+select '1.type()'::jsonpath;
+select '(1).type()'::jsonpath;
+select '1.2.type()'::jsonpath;
+select '"aaa".type()'::jsonpath;
+select 'true.type()'::jsonpath;
+select '$.double().floor().ceiling().abs()'::jsonpath;
+select '$.keyvalue().key'::jsonpath;
+select '$.datetime()'::jsonpath;
+select '$.datetime("datetime template")'::jsonpath;
+
+select '$ ? (@ starts with "abc")'::jsonpath;
+select '$ ? (@ starts with $var)'::jsonpath;
+
+select '$ ? (@ like_regex "(invalid pattern")'::jsonpath;
+select '$ ? (@ like_regex "pattern")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "i")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "is")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "isim")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "xsms")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "q")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "iq")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "smixq")'::jsonpath;
+select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
+
+select '$ < 1'::jsonpath;
+select '($ < 1) || $.a.b <= $x'::jsonpath;
+select '@ + 1'::jsonpath;
+
+select '($).a.b'::jsonpath;
+select '($.a.b).c.d'::jsonpath;
+select '($.a.b + -$.x.y).c.d'::jsonpath;
+select '(-+$.a.b).c.d'::jsonpath;
+select '1 + ($.a.b + 2).c.d'::jsonpath;
+select '1 + ($.a.b > 2).c.d'::jsonpath;
+select '($)'::jsonpath;
+select '(($))'::jsonpath;
+select '((($ + 1)).a + ((2)).b ? ((((@ > 1)) || (exists(@.c)))))'::jsonpath;
+
+select '$ ? (@.a < 1)'::jsonpath;
+select '$ ? (@.a < -1)'::jsonpath;
+select '$ ? (@.a < +1)'::jsonpath;
+select '$ ? (@.a < .1)'::jsonpath;
+select '$ ? (@.a < -.1)'::jsonpath;
+select '$ ? (@.a < +.1)'::jsonpath;
+select '$ ? (@.a < 0.1)'::jsonpath;
+select '$ ? (@.a < -0.1)'::jsonpath;
+select '$ ? (@.a < +0.1)'::jsonpath;
+select '$ ? (@.a < 10.1)'::jsonpath;
+select '$ ? (@.a < -10.1)'::jsonpath;
+select '$ ? (@.a < +10.1)'::jsonpath;
+select '$ ? (@.a < 1e1)'::jsonpath;
+select '$ ? (@.a < -1e1)'::jsonpath;
+select '$ ? (@.a < +1e1)'::jsonpath;
+select '$ ? (@.a < .1e1)'::jsonpath;
+select '$ ? (@.a < -.1e1)'::jsonpath;
+select '$ ? (@.a < +.1e1)'::jsonpath;
+select '$ ? (@.a < 0.1e1)'::jsonpath;
+select '$ ? (@.a < -0.1e1)'::jsonpath;
+select '$ ? (@.a < +0.1e1)'::jsonpath;
+select '$ ? (@.a < 10.1e1)'::jsonpath;
+select '$ ? (@.a < -10.1e1)'::jsonpath;
+select '$ ? (@.a < +10.1e1)'::jsonpath;
+select '$ ? (@.a < 1e-1)'::jsonpath;
+select '$ ? (@.a < -1e-1)'::jsonpath;
+select '$ ? (@.a < +1e-1)'::jsonpath;
+select '$ ? (@.a < .1e-1)'::jsonpath;
+select '$ ? (@.a < -.1e-1)'::jsonpath;
+select '$ ? (@.a < +.1e-1)'::jsonpath;
+select '$ ? (@.a < 0.1e-1)'::jsonpath;
+select '$ ? (@.a < -0.1e-1)'::jsonpath;
+select '$ ? (@.a < +0.1e-1)'::jsonpath;
+select '$ ? (@.a < 10.1e-1)'::jsonpath;
+select '$ ? (@.a < -10.1e-1)'::jsonpath;
+select '$ ? (@.a < +10.1e-1)'::jsonpath;
+select '$ ? (@.a < 1e+1)'::jsonpath;
+select '$ ? (@.a < -1e+1)'::jsonpath;
+select '$ ? (@.a < +1e+1)'::jsonpath;
+select '$ ? (@.a < .1e+1)'::jsonpath;
+select '$ ? (@.a < -.1e+1)'::jsonpath;
+select '$ ? (@.a < +.1e+1)'::jsonpath;
+select '$ ? (@.a < 0.1e+1)'::jsonpath;
+select '$ ? (@.a < -0.1e+1)'::jsonpath;
+select '$ ? (@.a < +0.1e+1)'::jsonpath;
+select '$ ? (@.a < 10.1e+1)'::jsonpath;
+select '$ ? (@.a < -10.1e+1)'::jsonpath;
+select '$ ? (@.a < +10.1e+1)'::jsonpath;
+
+select '0'::jsonpath;
+select '00'::jsonpath;
+select '0.0'::jsonpath;
+select '0.000'::jsonpath;
+select '0.000e1'::jsonpath;
+select '0.000e2'::jsonpath;
+select '0.000e3'::jsonpath;
+select '0.0010'::jsonpath;
+select '0.0010e-1'::jsonpath;
+select '0.0010e+1'::jsonpath;
+select '0.0010e+2'::jsonpath;
+select '1e'::jsonpath;
+select '1.e'::jsonpath;
+select '1.2e'::jsonpath;
+select '1.2.e'::jsonpath;
+select '(1.2).e'::jsonpath;
+select '1e3'::jsonpath;
+select '1.e3'::jsonpath;
+select '1.e3.e'::jsonpath;
+select '1.e3.e4'::jsonpath;
+select '1.2e3'::jsonpath;
+select '1.2.e3'::jsonpath;
+select '(1.2).e3'::jsonpath;
+select '1..e'::jsonpath;
+select '1..e3'::jsonpath;
+select '(1.).e'::jsonpath;
+select '(1.).e3'::jsonpath;
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.out b/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.out
new file mode 100644
index 0000000000..7cbfb6abcf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.out
@@ -0,0 +1,180 @@
+--
+-- encoding-sensitive tests for jsonpath
+--
+-- We provide expected-results files for UTF8 (jsonpath_encoding.out)
+-- and for SQL_ASCII (jsonpath_encoding_1.out). Skip otherwise.
+SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+ AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+---------------------
+ UTF8
+(1 row)
+
+-- checks for double-quoted values
+-- basic unicode input
+SELECT '"\u"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+LINE 1: SELECT '"\u"'::jsonpath;
+ ^
+SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+LINE 1: SELECT '"\u00"'::jsonpath;
+ ^
+SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+LINE 1: SELECT '"\u000g"'::jsonpath;
+ ^
+SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '"\u0000"'::jsonpath;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+SELECT '"\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+ jsonpath
+----------
+ "ê¯"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select '"\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+-----------------
+ "😄ðŸ¶"
+(1 row)
+
+select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ud83d\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ude04\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ud83dX"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '"\ude04X"'::jsonpath; -- orphan low surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '"\ude04X"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+--handling of simple unicode escapes
+select '"the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+------------------------
+ "the Copyright © sign"
+(1 row)
+
+select '"dollar \u0024 character"'::jsonpath as correct_everywhere;
+ correct_everywhere
+----------------------
+ "dollar $ character"
+(1 row)
+
+select '"dollar \\u0024 character"'::jsonpath as not_an_escape;
+ not_an_escape
+----------------------------
+ "dollar \\u0024 character"
+(1 row)
+
+select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ERROR: unsupported Unicode escape sequence
+LINE 1: select '"null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+select '"null \\u0000 escape"'::jsonpath as not_an_escape;
+ not_an_escape
+-----------------------
+ "null \\u0000 escape"
+(1 row)
+
+-- checks for quoted key names
+-- basic unicode input
+SELECT '$."\u"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u" of jsonpath input
+LINE 1: SELECT '$."\u"'::jsonpath;
+ ^
+SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+ERROR: invalid unicode sequence at or near "\u00" of jsonpath input
+LINE 1: SELECT '$."\u00"'::jsonpath;
+ ^
+SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+ERROR: invalid unicode sequence at or near "\u000" of jsonpath input
+LINE 1: SELECT '$."\u000g"'::jsonpath;
+ ^
+SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+ERROR: unsupported Unicode escape sequence
+LINE 1: SELECT '$."\u0000"'::jsonpath;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+SELECT '$."\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+ jsonpath
+----------
+ $."ê¯"
+(1 row)
+
+-- handling of unicode surrogate pairs
+select '$."\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+-----------------
+ $."😄ðŸ¶"
+(1 row)
+
+select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ud83d\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode high surrogate must not follow a high surrogate.
+select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ude04\ud83d"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ud83dX"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+ERROR: invalid input syntax for type jsonpath
+LINE 1: select '$."\ude04X"'::jsonpath;
+ ^
+DETAIL: Unicode low surrogate must follow a high surrogate.
+--handling of simple unicode escapes
+select '$."the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+ correct_in_utf8
+--------------------------
+ $."the Copyright © sign"
+(1 row)
+
+select '$."dollar \u0024 character"'::jsonpath as correct_everywhere;
+ correct_everywhere
+------------------------
+ $."dollar $ character"
+(1 row)
+
+select '$."dollar \\u0024 character"'::jsonpath as not_an_escape;
+ not_an_escape
+------------------------------
+ $."dollar \\u0024 character"
+(1 row)
+
+select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ERROR: unsupported Unicode escape sequence
+LINE 1: select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+ ^
+DETAIL: \u0000 cannot be converted to text.
+select '$."null \\u0000 escape"'::jsonpath as not_an_escape;
+ not_an_escape
+-------------------------
+ $."null \\u0000 escape"
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.sql b/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.sql
new file mode 100644
index 0000000000..55d9e30b95
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/jsonpath_encoding.sql
@@ -0,0 +1,59 @@
+--
+-- encoding-sensitive tests for jsonpath
+--
+
+-- We provide expected-results files for UTF8 (jsonpath_encoding.out)
+-- and for SQL_ASCII (jsonpath_encoding_1.out). Skip otherwise.
+SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+ AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+
+SELECT getdatabaseencoding(); -- just to label the results files
+
+-- checks for double-quoted values
+
+-- basic unicode input
+SELECT '"\u"'::jsonpath; -- ERROR, incomplete escape
+SELECT '"\u00"'::jsonpath; -- ERROR, incomplete escape
+SELECT '"\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+SELECT '"\u0000"'::jsonpath; -- OK, legal escape
+SELECT '"\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+
+-- handling of unicode surrogate pairs
+select '"\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+select '"\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+select '"\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+select '"\ud83dX"'::jsonpath; -- orphan high surrogate
+select '"\ude04X"'::jsonpath; -- orphan low surrogate
+
+--handling of simple unicode escapes
+select '"the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+select '"dollar \u0024 character"'::jsonpath as correct_everywhere;
+select '"dollar \\u0024 character"'::jsonpath as not_an_escape;
+select '"null \u0000 escape"'::jsonpath as not_unescaped;
+select '"null \\u0000 escape"'::jsonpath as not_an_escape;
+
+-- checks for quoted key names
+
+-- basic unicode input
+SELECT '$."\u"'::jsonpath; -- ERROR, incomplete escape
+SELECT '$."\u00"'::jsonpath; -- ERROR, incomplete escape
+SELECT '$."\u000g"'::jsonpath; -- ERROR, g is not a hex digit
+SELECT '$."\u0000"'::jsonpath; -- OK, legal escape
+SELECT '$."\uaBcD"'::jsonpath; -- OK, uppercase and lower case both OK
+
+-- handling of unicode surrogate pairs
+select '$."\ud83d\ude04\ud83d\udc36"'::jsonpath as correct_in_utf8;
+select '$."\ud83d\ud83d"'::jsonpath; -- 2 high surrogates in a row
+select '$."\ude04\ud83d"'::jsonpath; -- surrogates in wrong order
+select '$."\ud83dX"'::jsonpath; -- orphan high surrogate
+select '$."\ude04X"'::jsonpath; -- orphan low surrogate
+
+--handling of simple unicode escapes
+select '$."the Copyright \u00a9 sign"'::jsonpath as correct_in_utf8;
+select '$."dollar \u0024 character"'::jsonpath as correct_everywhere;
+select '$."dollar \\u0024 character"'::jsonpath as not_an_escape;
+select '$."null \u0000 escape"'::jsonpath as not_unescaped;
+select '$."null \\u0000 escape"'::jsonpath as not_an_escape;
diff --git a/yql/essentials/tests/postgresql/original/cases/limit.out b/yql/essentials/tests/postgresql/original/cases/limit.out
new file mode 100644
index 0000000000..8a98bbea8e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/limit.out
@@ -0,0 +1,694 @@
+--
+-- LIMIT
+-- Check the LIMIT/OFFSET feature of SELECT
+--
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ ORDER BY unique1 LIMIT 2;
+ two | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 51 | 76 | ZBAAAA
+ | 52 | 985 | ACAAAA
+(2 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60
+ ORDER BY unique1 LIMIT 5;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 61 | 560 | JCAAAA
+ | 62 | 633 | KCAAAA
+ | 63 | 296 | LCAAAA
+ | 64 | 479 | MCAAAA
+ | 65 | 64 | NCAAAA
+(5 rows)
+
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60 AND unique1 < 63
+ ORDER BY unique1 LIMIT 5;
+ two | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 61 | 560 | JCAAAA
+ | 62 | 633 | KCAAAA
+(2 rows)
+
+SELECT ''::text AS three, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 100
+ ORDER BY unique1 LIMIT 3 OFFSET 20;
+ three | unique1 | unique2 | stringu1
+-------+---------+---------+----------
+ | 121 | 700 | REAAAA
+ | 122 | 519 | SEAAAA
+ | 123 | 777 | TEAAAA
+(3 rows)
+
+SELECT ''::text AS zero, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
+ zero | unique1 | unique2 | stringu1
+------+---------+---------+----------
+(0 rows)
+
+SELECT ''::text AS eleven, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
+ eleven | unique1 | unique2 | stringu1
+--------+---------+---------+----------
+ | 10 | 520 | KAAAAA
+ | 9 | 49 | JAAAAA
+ | 8 | 653 | IAAAAA
+ | 7 | 647 | HAAAAA
+ | 6 | 978 | GAAAAA
+ | 5 | 541 | FAAAAA
+ | 4 | 833 | EAAAAA
+ | 3 | 431 | DAAAAA
+ | 2 | 326 | CAAAAA
+ | 1 | 214 | BAAAAA
+ | 0 | 998 | AAAAAA
+(11 rows)
+
+SELECT ''::text AS ten, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990;
+ ten | unique1 | unique2 | stringu1
+-----+---------+---------+----------
+ | 990 | 369 | CMAAAA
+ | 991 | 426 | DMAAAA
+ | 992 | 363 | EMAAAA
+ | 993 | 661 | FMAAAA
+ | 994 | 695 | GMAAAA
+ | 995 | 144 | HMAAAA
+ | 996 | 258 | IMAAAA
+ | 997 | 21 | JMAAAA
+ | 998 | 549 | KMAAAA
+ | 999 | 152 | LMAAAA
+(10 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990 LIMIT 5;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 990 | 369 | CMAAAA
+ | 991 | 426 | DMAAAA
+ | 992 | 363 | EMAAAA
+ | 993 | 661 | FMAAAA
+ | 994 | 695 | GMAAAA
+(5 rows)
+
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
+ five | unique1 | unique2 | stringu1
+------+---------+---------+----------
+ | 900 | 913 | QIAAAA
+ | 901 | 931 | RIAAAA
+ | 902 | 702 | SIAAAA
+ | 903 | 641 | TIAAAA
+ | 904 | 793 | UIAAAA
+(5 rows)
+
+-- Test null limit and offset. The planner would discard a simple null
+-- constant, so to ensure executor is exercised, do this:
+select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- Test assorted cases involving backwards fetch from a LIMIT plan node
+begin;
+declare c1 cursor for select * from int8_tbl limit 10;
+fetch all in c1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+fetch 1 in c1;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | -4567890123456789
+(1 row)
+
+fetch backward all in c1;
+ q1 | q2
+------------------+------------------
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | 123
+ 123 | 4567890123456789
+ 123 | 456
+(4 rows)
+
+fetch backward 1 in c1;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch all in c1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+declare c2 cursor for select * from int8_tbl limit 3;
+fetch all in c2;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+(3 rows)
+
+fetch 1 in c2;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c2;
+ q1 | q2
+------------------+-----
+ 4567890123456789 | 123
+(1 row)
+
+fetch backward all in c2;
+ q1 | q2
+-----+------------------
+ 123 | 4567890123456789
+ 123 | 456
+(2 rows)
+
+fetch backward 1 in c2;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch all in c2;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+(3 rows)
+
+declare c3 cursor for select * from int8_tbl offset 3;
+fetch all in c3;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+fetch 1 in c3;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c3;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | -4567890123456789
+(1 row)
+
+fetch backward all in c3;
+ q1 | q2
+------------------+------------------
+ 4567890123456789 | 4567890123456789
+(1 row)
+
+fetch backward 1 in c3;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch all in c3;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+declare c4 cursor for select * from int8_tbl offset 10;
+fetch all in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch 1 in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward all in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch all in c4;
+ q1 | q2
+----+----
+(0 rows)
+
+declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
+fetch all in c5;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+fetch 1 in c5;
+ q1 | q2
+----+----
+(0 rows)
+
+fetch backward 1 in c5;
+ q1 | q2
+-----+------------------
+ 123 | 4567890123456789
+(1 row)
+
+fetch backward 1 in c5;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+fetch all in c5;
+ q1 | q2
+-----+------------------
+ 123 | 4567890123456789
+(1 row)
+
+fetch backward all in c5;
+ q1 | q2
+-----+------------------
+ 123 | 4567890123456789
+ 123 | 456
+(2 rows)
+
+fetch all in c5;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+fetch backward all in c5;
+ q1 | q2
+-----+------------------
+ 123 | 4567890123456789
+ 123 | 456
+(2 rows)
+
+rollback;
+-- Stress test for variable LIMIT in conjunction with bounded-heap sorting
+SELECT
+ (SELECT n
+ FROM (VALUES (1)) AS x,
+ (SELECT n FROM generate_series(1,10) AS n
+ ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
+ FROM generate_series(1,10) AS s;
+ z
+----
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+(10 rows)
+
+--
+-- Test behavior of volatile and set-returning functions in conjunction
+-- with ORDER BY and LIMIT.
+--
+create temp sequence testseq;
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+ QUERY PLAN
+----------------------------------------------------------------
+ Limit
+ Output: unique1, unique2, (nextval('testseq'::regclass))
+ -> Index Scan using tenk1_unique2 on public.tenk1
+ Output: unique1, unique2, nextval('testseq'::regclass)
+(4 rows)
+
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+ unique1 | unique2 | nextval
+---------+---------+---------
+ 8800 | 0 | 1
+ 1891 | 1 | 2
+ 3420 | 2 | 3
+ 9850 | 3 | 4
+ 7164 | 4 | 5
+ 8009 | 5 | 6
+ 5057 | 6 | 7
+ 6701 | 7 | 8
+ 4321 | 8 | 9
+ 3043 | 9 | 10
+(10 rows)
+
+select currval('testseq');
+ currval
+---------
+ 10
+(1 row)
+
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Limit
+ Output: unique1, unique2, (nextval('testseq'::regclass)), tenthous
+ -> Result
+ Output: unique1, unique2, nextval('testseq'::regclass), tenthous
+ -> Sort
+ Output: unique1, unique2, tenthous
+ Sort Key: tenk1.tenthous
+ -> Seq Scan on public.tenk1
+ Output: unique1, unique2, tenthous
+(9 rows)
+
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+ unique1 | unique2 | nextval
+---------+---------+---------
+ 0 | 9998 | 11
+ 1 | 2838 | 12
+ 2 | 2716 | 13
+ 3 | 5679 | 14
+ 4 | 1621 | 15
+ 5 | 5557 | 16
+ 6 | 2855 | 17
+ 7 | 8518 | 18
+ 8 | 5435 | 19
+ 9 | 4463 | 20
+(10 rows)
+
+select currval('testseq');
+ currval
+---------
+ 20
+(1 row)
+
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: unique1, unique2, (generate_series(1, 10))
+ -> ProjectSet
+ Output: unique1, unique2, generate_series(1, 10)
+ -> Index Scan using tenk1_unique2 on public.tenk1
+ Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4
+(6 rows)
+
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+ unique1 | unique2 | generate_series
+---------+---------+-----------------
+ 8800 | 0 | 1
+ 8800 | 0 | 2
+ 8800 | 0 | 3
+ 8800 | 0 | 4
+ 8800 | 0 | 5
+ 8800 | 0 | 6
+ 8800 | 0 | 7
+(7 rows)
+
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+ QUERY PLAN
+--------------------------------------------------------------------
+ Limit
+ Output: unique1, unique2, (generate_series(1, 10)), tenthous
+ -> ProjectSet
+ Output: unique1, unique2, generate_series(1, 10), tenthous
+ -> Sort
+ Output: unique1, unique2, tenthous
+ Sort Key: tenk1.tenthous
+ -> Seq Scan on public.tenk1
+ Output: unique1, unique2, tenthous
+(9 rows)
+
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+ unique1 | unique2 | generate_series
+---------+---------+-----------------
+ 0 | 9998 | 1
+ 0 | 9998 | 2
+ 0 | 9998 | 3
+ 0 | 9998 | 4
+ 0 | 9998 | 5
+ 0 | 9998 | 6
+ 0 | 9998 | 7
+(7 rows)
+
+-- use of random() is to keep planner from folding the expressions together
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------
+ ProjectSet
+ Output: generate_series(0, 2), generate_series(((random() * '0.1'::double precision))::integer, 2)
+ -> Result
+(3 rows)
+
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+ s1 | s2
+----+----
+ 0 | 0
+ 1 | 1
+ 2 | 2
+(3 rows)
+
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------
+ Sort
+ Output: (generate_series(0, 2)), (generate_series(((random() * '0.1'::double precision))::integer, 2))
+ Sort Key: (generate_series(((random() * '0.1'::double precision))::integer, 2)) DESC
+ -> ProjectSet
+ Output: generate_series(0, 2), generate_series(((random() * '0.1'::double precision))::integer, 2)
+ -> Result
+(6 rows)
+
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+ s1 | s2
+----+----
+ 2 | 2
+ 1 | 1
+ 0 | 0
+(3 rows)
+
+-- test for failure to set all aggregates' aggtranstype
+explain (verbose, costs off)
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------------------
+ Limit
+ Output: (sum(tenthous)), (((sum(tenthous))::double precision + (random() * '0'::double precision))), thousand
+ -> GroupAggregate
+ Output: sum(tenthous), ((sum(tenthous))::double precision + (random() * '0'::double precision)), thousand
+ Group Key: tenk1.thousand
+ -> Index Only Scan using tenk1_thous_tenthous on public.tenk1
+ Output: thousand, tenthous
+(7 rows)
+
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+ s1 | s2
+-------+-------
+ 45000 | 45000
+ 45010 | 45010
+ 45020 | 45020
+(3 rows)
+
+--
+-- FETCH FIRST
+-- Check the WITH TIES clause
+--
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW WITH TIES;
+ thousand
+----------
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+(10 rows)
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST ROWS WITH TIES;
+ thousand
+----------
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+(10 rows)
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
+ thousand
+----------
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+(10 rows)
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW ONLY;
+ thousand
+----------
+ 0
+ 0
+(2 rows)
+
+-- SKIP LOCKED and WITH TIES are incompatible
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
+ERROR: SKIP LOCKED and WITH TIES options cannot be used together
+-- should fail
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ FETCH FIRST 2 ROW WITH TIES;
+ERROR: WITH TIES cannot be specified without ORDER BY clause
+-- test ruleutils
+CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
+\d+ limit_thousand_v_1
+ View "public.limit_thousand_v_1"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+----------+---------+-----------+----------+---------+---------+-------------
+ thousand | integer | | | | plain |
+View definition:
+ SELECT onek.thousand
+ FROM onek
+ WHERE onek.thousand < 995
+ ORDER BY onek.thousand
+ OFFSET 10
+ FETCH FIRST 5 ROWS WITH TIES;
+
+CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand OFFSET 10 FETCH FIRST 5 ROWS ONLY;
+\d+ limit_thousand_v_2
+ View "public.limit_thousand_v_2"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+----------+---------+-----------+----------+---------+---------+-------------
+ thousand | integer | | | | plain |
+View definition:
+ SELECT onek.thousand
+ FROM onek
+ WHERE onek.thousand < 995
+ ORDER BY onek.thousand
+ OFFSET 10
+ LIMIT 5;
+
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS WITH TIES; -- fails
+ERROR: row count cannot be null in FETCH FIRST ... WITH TIES clause
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
+\d+ limit_thousand_v_3
+ View "public.limit_thousand_v_3"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+----------+---------+-----------+----------+---------+---------+-------------
+ thousand | integer | | | | plain |
+View definition:
+ SELECT onek.thousand
+ FROM onek
+ WHERE onek.thousand < 995
+ ORDER BY onek.thousand
+ FETCH FIRST (NULL::integer + 1) ROWS WITH TIES;
+
+CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS ONLY;
+\d+ limit_thousand_v_4
+ View "public.limit_thousand_v_4"
+ Column | Type | Collation | Nullable | Default | Storage | Description
+----------+---------+-----------+----------+---------+---------+-------------
+ thousand | integer | | | | plain |
+View definition:
+ SELECT onek.thousand
+ FROM onek
+ WHERE onek.thousand < 995
+ ORDER BY onek.thousand
+ LIMIT ALL;
+
+-- leave these views
diff --git a/yql/essentials/tests/postgresql/original/cases/limit.sql b/yql/essentials/tests/postgresql/original/cases/limit.sql
new file mode 100644
index 0000000000..6f0cda9870
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/limit.sql
@@ -0,0 +1,201 @@
+--
+-- LIMIT
+-- Check the LIMIT/OFFSET feature of SELECT
+--
+
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ ORDER BY unique1 LIMIT 2;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60
+ ORDER BY unique1 LIMIT 5;
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 60 AND unique1 < 63
+ ORDER BY unique1 LIMIT 5;
+SELECT ''::text AS three, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 100
+ ORDER BY unique1 LIMIT 3 OFFSET 20;
+SELECT ''::text AS zero, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
+SELECT ''::text AS eleven, unique1, unique2, stringu1
+ FROM onek WHERE unique1 < 50
+ ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
+SELECT ''::text AS ten, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 OFFSET 990 LIMIT 5;
+SELECT ''::text AS five, unique1, unique2, stringu1
+ FROM onek
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
+
+-- Test null limit and offset. The planner would discard a simple null
+-- constant, so to ensure executor is exercised, do this:
+select * from int8_tbl limit (case when random() < 0.5 then null::bigint end);
+select * from int8_tbl offset (case when random() < 0.5 then null::bigint end);
+
+-- Test assorted cases involving backwards fetch from a LIMIT plan node
+begin;
+
+declare c1 cursor for select * from int8_tbl limit 10;
+fetch all in c1;
+fetch 1 in c1;
+fetch backward 1 in c1;
+fetch backward all in c1;
+fetch backward 1 in c1;
+fetch all in c1;
+
+declare c2 cursor for select * from int8_tbl limit 3;
+fetch all in c2;
+fetch 1 in c2;
+fetch backward 1 in c2;
+fetch backward all in c2;
+fetch backward 1 in c2;
+fetch all in c2;
+
+declare c3 cursor for select * from int8_tbl offset 3;
+fetch all in c3;
+fetch 1 in c3;
+fetch backward 1 in c3;
+fetch backward all in c3;
+fetch backward 1 in c3;
+fetch all in c3;
+
+declare c4 cursor for select * from int8_tbl offset 10;
+fetch all in c4;
+fetch 1 in c4;
+fetch backward 1 in c4;
+fetch backward all in c4;
+fetch backward 1 in c4;
+fetch all in c4;
+
+declare c5 cursor for select * from int8_tbl order by q1 fetch first 2 rows with ties;
+fetch all in c5;
+fetch 1 in c5;
+fetch backward 1 in c5;
+fetch backward 1 in c5;
+fetch all in c5;
+fetch backward all in c5;
+fetch all in c5;
+fetch backward all in c5;
+
+rollback;
+
+-- Stress test for variable LIMIT in conjunction with bounded-heap sorting
+
+SELECT
+ (SELECT n
+ FROM (VALUES (1)) AS x,
+ (SELECT n FROM generate_series(1,10) AS n
+ ORDER BY n LIMIT 1 OFFSET s-1) AS y) AS z
+ FROM generate_series(1,10) AS s;
+
+--
+-- Test behavior of volatile and set-returning functions in conjunction
+-- with ORDER BY and LIMIT.
+--
+
+create temp sequence testseq;
+
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by unique2 limit 10;
+
+select currval('testseq');
+
+explain (verbose, costs off)
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+
+select unique1, unique2, nextval('testseq')
+ from tenk1 order by tenthous limit 10;
+
+select currval('testseq');
+
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by unique2 limit 7;
+
+explain (verbose, costs off)
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+
+select unique1, unique2, generate_series(1,10)
+ from tenk1 order by tenthous limit 7;
+
+-- use of random() is to keep planner from folding the expressions together
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2;
+
+explain (verbose, costs off)
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+
+select generate_series(0,2) as s1, generate_series((random()*.1)::int,2) as s2
+order by s2 desc;
+
+-- test for failure to set all aggregates' aggtranstype
+explain (verbose, costs off)
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+
+select sum(tenthous) as s1, sum(tenthous) + random()*0 as s2
+ from tenk1 group by thousand order by thousand limit 3;
+
+--
+-- FETCH FIRST
+-- Check the WITH TIES clause
+--
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW WITH TIES;
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST ROWS WITH TIES;
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES;
+
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 2 ROW ONLY;
+
+-- SKIP LOCKED and WITH TIES are incompatible
+SELECT thousand
+ FROM onek WHERE thousand < 5
+ ORDER BY thousand FETCH FIRST 1 ROW WITH TIES FOR UPDATE SKIP LOCKED;
+
+-- should fail
+SELECT ''::text AS two, unique1, unique2, stringu1
+ FROM onek WHERE unique1 > 50
+ FETCH FIRST 2 ROW WITH TIES;
+
+-- test ruleutils
+CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
+\d+ limit_thousand_v_1
+CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand OFFSET 10 FETCH FIRST 5 ROWS ONLY;
+\d+ limit_thousand_v_2
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS WITH TIES; -- fails
+CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
+\d+ limit_thousand_v_3
+CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
+ ORDER BY thousand FETCH FIRST NULL ROWS ONLY;
+\d+ limit_thousand_v_4
+-- leave these views
diff --git a/yql/essentials/tests/postgresql/original/cases/name.out b/yql/essentials/tests/postgresql/original/cases/name.out
new file mode 100644
index 0000000000..d58df2ba41
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/name.out
@@ -0,0 +1,197 @@
+--
+-- NAME
+-- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
+--
+-- fixed-length by reference
+SELECT name 'name string' = name 'name string' AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT name 'name string' = name 'name string ' AS "False";
+ False
+-------
+ f
+(1 row)
+
+--
+--
+--
+CREATE TABLE NAME_TBL(f1 name);
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
+INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
+INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
+INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
+INSERT INTO NAME_TBL(f1) VALUES ('');
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+SELECT * FROM NAME_TBL;
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(7 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+(5 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(2 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+----
+
+(1 row)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(3 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+(4 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(6 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ asdfghjkl;
+ 343f%2a
+ d34aaasdf
+
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(7 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
+ f1
+----
+(0 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
+ f1
+-----------------------------------------------------------------
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+ 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
+ 343f%2a
+ d34aaasdf
+ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
+(5 rows)
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
+ f1
+------------
+ asdfghjkl;
+ d34aaasdf
+(2 rows)
+
+DROP TABLE NAME_TBL;
+DO $$
+DECLARE r text[];
+BEGIN
+ r := parse_ident('Schemax.Tabley');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+ r := parse_ident('"SchemaX"."TableY"');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+END;
+$$;
+NOTICE: schemax.tabley
+NOTICE: "SchemaX"."TableY"
+SELECT parse_ident('foo.boo');
+ parse_ident
+-------------
+ {foo,boo}
+(1 row)
+
+SELECT parse_ident('foo.boo[]'); -- should fail
+ERROR: string is not a valid identifier: "foo.boo[]"
+SELECT parse_ident('foo.boo[]', strict => false); -- ok
+ parse_ident
+-------------
+ {foo,boo}
+(1 row)
+
+-- should fail
+SELECT parse_ident(' ');
+ERROR: string is not a valid identifier: " "
+SELECT parse_ident(' .aaa');
+ERROR: string is not a valid identifier: " .aaa"
+DETAIL: No valid identifier before ".".
+SELECT parse_ident(' aaa . ');
+ERROR: string is not a valid identifier: " aaa . "
+DETAIL: No valid identifier after ".".
+SELECT parse_ident('aaa.a%b');
+ERROR: string is not a valid identifier: "aaa.a%b"
+SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+ERROR: string is not a valid identifier: "X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+SELECT length(a[1]), length(a[2]) from parse_ident('"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy') as a ;
+ length | length
+--------+--------
+ 414 | 289
+(1 row)
+
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+ parse_ident
+-----------------------------------------------------------------------------------------------------------
+ {first," second "," third "," xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
+(1 row)
+
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+ parse_ident
+------------------------------------------------------------------------------------------------------
+ {first," second "," third "," xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
+(1 row)
+
+SELECT parse_ident(E'"c".X XXXX\002XXXXXX');
+ERROR: string is not a valid identifier: ""c".X XXXXXXXXXX"
+SELECT parse_ident('1020');
+ERROR: string is not a valid identifier: "1020"
+SELECT parse_ident('10.20');
+ERROR: string is not a valid identifier: "10.20"
+SELECT parse_ident('.');
+ERROR: string is not a valid identifier: "."
+DETAIL: No valid identifier before ".".
+SELECT parse_ident('.1020');
+ERROR: string is not a valid identifier: ".1020"
+DETAIL: No valid identifier before ".".
+SELECT parse_ident('xxx.1020');
+ERROR: string is not a valid identifier: "xxx.1020"
+DETAIL: No valid identifier after ".".
diff --git a/yql/essentials/tests/postgresql/original/cases/name.sql b/yql/essentials/tests/postgresql/original/cases/name.sql
new file mode 100644
index 0000000000..29a5d97e5b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/name.sql
@@ -0,0 +1,87 @@
+--
+-- NAME
+-- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
+--
+
+-- fixed-length by reference
+SELECT name 'name string' = name 'name string' AS "True";
+
+SELECT name 'name string' = name 'name string ' AS "False";
+
+--
+--
+--
+
+CREATE TABLE NAME_TBL(f1 name);
+
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
+
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
+
+INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
+
+INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
+
+INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
+
+INSERT INTO NAME_TBL(f1) VALUES ('');
+
+INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+
+
+SELECT * FROM NAME_TBL;
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
+
+SELECT c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
+
+DROP TABLE NAME_TBL;
+
+DO $$
+DECLARE r text[];
+BEGIN
+ r := parse_ident('Schemax.Tabley');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+ r := parse_ident('"SchemaX"."TableY"');
+ RAISE NOTICE '%', format('%I.%I', r[1], r[2]);
+END;
+$$;
+
+SELECT parse_ident('foo.boo');
+SELECT parse_ident('foo.boo[]'); -- should fail
+SELECT parse_ident('foo.boo[]', strict => false); -- ok
+
+-- should fail
+SELECT parse_ident(' ');
+SELECT parse_ident(' .aaa');
+SELECT parse_ident(' aaa . ');
+SELECT parse_ident('aaa.a%b');
+SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
+
+SELECT length(a[1]), length(a[2]) from parse_ident('"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy') as a ;
+
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"');
+SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) || '"')::name[];
+
+SELECT parse_ident(E'"c".X XXXX\002XXXXXX');
+SELECT parse_ident('1020');
+SELECT parse_ident('10.20');
+SELECT parse_ident('.');
+SELECT parse_ident('.1020');
+SELECT parse_ident('xxx.1020');
diff --git a/yql/essentials/tests/postgresql/original/cases/numeric.out b/yql/essentials/tests/postgresql/original/cases/numeric.out
new file mode 100644
index 0000000000..bea33181be
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/numeric.out
@@ -0,0 +1,3226 @@
+--
+-- NUMERIC
+--
+CREATE TABLE num_data (id int4, val numeric(210,10));
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+BEGIN TRANSACTION;
+INSERT INTO num_exp_add VALUES (0,0,'0');
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+INSERT INTO num_exp_add VALUES (0,1,'0');
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+INSERT INTO num_exp_div VALUES (0,2,'0');
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+INSERT INTO num_exp_div VALUES (0,3,'0');
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+INSERT INTO num_exp_div VALUES (0,4,'0');
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+INSERT INTO num_exp_div VALUES (0,5,'0');
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+INSERT INTO num_exp_div VALUES (0,6,'0');
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+INSERT INTO num_exp_div VALUES (0,7,'0');
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+INSERT INTO num_exp_div VALUES (0,8,'0');
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+INSERT INTO num_exp_div VALUES (0,9,'0');
+INSERT INTO num_exp_add VALUES (1,0,'0');
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+INSERT INTO num_exp_add VALUES (1,1,'0');
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+INSERT INTO num_exp_div VALUES (1,2,'0');
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+INSERT INTO num_exp_div VALUES (1,3,'0');
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+INSERT INTO num_exp_div VALUES (1,4,'0');
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+INSERT INTO num_exp_div VALUES (1,5,'0');
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+INSERT INTO num_exp_div VALUES (1,6,'0');
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+INSERT INTO num_exp_div VALUES (1,7,'0');
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+INSERT INTO num_exp_div VALUES (1,8,'0');
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+INSERT INTO num_exp_div VALUES (1,9,'0');
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_data VALUES (0, '0');
+INSERT INTO num_data VALUES (1, '0');
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+INSERT INTO num_data VALUES (3, '4.31');
+INSERT INTO num_data VALUES (4, '7799461.4119');
+INSERT INTO num_data VALUES (5, '16397.038491');
+INSERT INTO num_data VALUES (6, '93901.57763026');
+INSERT INTO num_data VALUES (7, '-83028485');
+INSERT INTO num_data VALUES (8, '74881');
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+COMMIT TRANSACTION;
+-- ******************************
+-- * Create indices for faster checks
+-- ******************************
+CREATE UNIQUE INDEX num_exp_add_idx ON num_exp_add (id1, id2);
+CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
+CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
+CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
+CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
+CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
+CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
+CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
+VACUUM ANALYZE num_exp_add;
+VACUUM ANALYZE num_exp_sub;
+VACUUM ANALYZE num_exp_div;
+VACUUM ANALYZE num_exp_mul;
+VACUUM ANALYZE num_exp_sqrt;
+VACUUM ANALYZE num_exp_ln;
+VACUUM ANALYZE num_exp_log10;
+VACUUM ANALYZE num_exp_power_10_ln;
+-- ******************************
+-- * Now check the behaviour of the NUMERIC type
+-- ******************************
+-- ******************************
+-- * Addition check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 10);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Subtraction check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 40);
+ id1 | id2 | result | round
+-----+-----+--------+-------
+(0 rows)
+
+-- ******************************
+-- * Multiply check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 30);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Division check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 80);
+ id1 | id2 | result | expected
+-----+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Square root check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+ FROM num_data;
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_sqrt t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+ id1 | result | expected
+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Natural logarithm check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+ id1 | result | expected
+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Logarithm base 10 check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LOG(numeric '10', ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_log10 t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+ id1 | result | expected
+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * POWER(10, LN(value)) check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_power_10_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+ id1 | result | expected
+-----+--------+----------
+(0 rows)
+
+-- ******************************
+-- * Check behavior with Inf and NaN inputs. It's easiest to handle these
+-- * separately from the num_data framework used above, because some input
+-- * combinations will throw errors.
+-- ******************************
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 + x2 AS sum,
+ x1 - x2 AS diff,
+ x1 * x2 AS prod
+FROM v AS v1(x1), v AS v2(x2);
+ x1 | x2 | sum | diff | prod
+-----------+-----------+-----------+-----------+-----------
+ 0 | 0 | 0 | 0 | 0
+ 0 | 1 | 1 | -1 | 0
+ 0 | -1 | -1 | 1 | 0
+ 0 | 4.2 | 4.2 | -4.2 | 0.0
+ 0 | Infinity | Infinity | -Infinity | NaN
+ 0 | -Infinity | -Infinity | Infinity | NaN
+ 0 | NaN | NaN | NaN | NaN
+ 1 | 0 | 1 | 1 | 0
+ 1 | 1 | 2 | 0 | 1
+ 1 | -1 | 0 | 2 | -1
+ 1 | 4.2 | 5.2 | -3.2 | 4.2
+ 1 | Infinity | Infinity | -Infinity | Infinity
+ 1 | -Infinity | -Infinity | Infinity | -Infinity
+ 1 | NaN | NaN | NaN | NaN
+ -1 | 0 | -1 | -1 | 0
+ -1 | 1 | 0 | -2 | -1
+ -1 | -1 | -2 | 0 | 1
+ -1 | 4.2 | 3.2 | -5.2 | -4.2
+ -1 | Infinity | Infinity | -Infinity | -Infinity
+ -1 | -Infinity | -Infinity | Infinity | Infinity
+ -1 | NaN | NaN | NaN | NaN
+ 4.2 | 0 | 4.2 | 4.2 | 0.0
+ 4.2 | 1 | 5.2 | 3.2 | 4.2
+ 4.2 | -1 | 3.2 | 5.2 | -4.2
+ 4.2 | 4.2 | 8.4 | 0.0 | 17.64
+ 4.2 | Infinity | Infinity | -Infinity | Infinity
+ 4.2 | -Infinity | -Infinity | Infinity | -Infinity
+ 4.2 | NaN | NaN | NaN | NaN
+ Infinity | 0 | Infinity | Infinity | NaN
+ Infinity | 1 | Infinity | Infinity | Infinity
+ Infinity | -1 | Infinity | Infinity | -Infinity
+ Infinity | 4.2 | Infinity | Infinity | Infinity
+ Infinity | Infinity | Infinity | NaN | Infinity
+ Infinity | -Infinity | NaN | Infinity | -Infinity
+ Infinity | NaN | NaN | NaN | NaN
+ -Infinity | 0 | -Infinity | -Infinity | NaN
+ -Infinity | 1 | -Infinity | -Infinity | -Infinity
+ -Infinity | -1 | -Infinity | -Infinity | Infinity
+ -Infinity | 4.2 | -Infinity | -Infinity | -Infinity
+ -Infinity | Infinity | NaN | -Infinity | -Infinity
+ -Infinity | -Infinity | -Infinity | NaN | Infinity
+ -Infinity | NaN | NaN | NaN | NaN
+ NaN | 0 | NaN | NaN | NaN
+ NaN | 1 | NaN | NaN | NaN
+ NaN | -1 | NaN | NaN | NaN
+ NaN | 4.2 | NaN | NaN | NaN
+ NaN | Infinity | NaN | NaN | NaN
+ NaN | -Infinity | NaN | NaN | NaN
+ NaN | NaN | NaN | NaN | NaN
+(49 rows)
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 / x2 AS quot,
+ x1 % x2 AS mod,
+ div(x1, x2) AS div
+FROM v AS v1(x1), v AS v2(x2) WHERE x2 != 0;
+ x1 | x2 | quot | mod | div
+-----------+-----------+-------------------------+------+-----------
+ 0 | 1 | 0.00000000000000000000 | 0 | 0
+ 1 | 1 | 1.00000000000000000000 | 0 | 1
+ -1 | 1 | -1.00000000000000000000 | 0 | -1
+ 4.2 | 1 | 4.2000000000000000 | 0.2 | 4
+ Infinity | 1 | Infinity | NaN | Infinity
+ -Infinity | 1 | -Infinity | NaN | -Infinity
+ NaN | 1 | NaN | NaN | NaN
+ 0 | -1 | 0.00000000000000000000 | 0 | 0
+ 1 | -1 | -1.00000000000000000000 | 0 | -1
+ -1 | -1 | 1.00000000000000000000 | 0 | 1
+ 4.2 | -1 | -4.2000000000000000 | 0.2 | -4
+ Infinity | -1 | -Infinity | NaN | -Infinity
+ -Infinity | -1 | Infinity | NaN | Infinity
+ NaN | -1 | NaN | NaN | NaN
+ 0 | 4.2 | 0.00000000000000000000 | 0.0 | 0
+ 1 | 4.2 | 0.23809523809523809524 | 1.0 | 0
+ -1 | 4.2 | -0.23809523809523809524 | -1.0 | 0
+ 4.2 | 4.2 | 1.00000000000000000000 | 0.0 | 1
+ Infinity | 4.2 | Infinity | NaN | Infinity
+ -Infinity | 4.2 | -Infinity | NaN | -Infinity
+ NaN | 4.2 | NaN | NaN | NaN
+ 0 | Infinity | 0 | 0 | 0
+ 1 | Infinity | 0 | 1 | 0
+ -1 | Infinity | 0 | -1 | 0
+ 4.2 | Infinity | 0 | 4.2 | 0
+ Infinity | Infinity | NaN | NaN | NaN
+ -Infinity | Infinity | NaN | NaN | NaN
+ NaN | Infinity | NaN | NaN | NaN
+ 0 | -Infinity | 0 | 0 | 0
+ 1 | -Infinity | 0 | 1 | 0
+ -1 | -Infinity | 0 | -1 | 0
+ 4.2 | -Infinity | 0 | 4.2 | 0
+ Infinity | -Infinity | NaN | NaN | NaN
+ -Infinity | -Infinity | NaN | NaN | NaN
+ NaN | -Infinity | NaN | NaN | NaN
+ 0 | NaN | NaN | NaN | NaN
+ 1 | NaN | NaN | NaN | NaN
+ -1 | NaN | NaN | NaN | NaN
+ 4.2 | NaN | NaN | NaN | NaN
+ Infinity | NaN | NaN | NaN | NaN
+ -Infinity | NaN | NaN | NaN | NaN
+ NaN | NaN | NaN | NaN | NaN
+(42 rows)
+
+SELECT 'inf'::numeric / '0';
+ERROR: division by zero
+SELECT '-inf'::numeric / '0';
+ERROR: division by zero
+SELECT 'nan'::numeric / '0';
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '0'::numeric / '0';
+ERROR: division by zero
+SELECT 'inf'::numeric % '0';
+ERROR: division by zero
+SELECT '-inf'::numeric % '0';
+ERROR: division by zero
+SELECT 'nan'::numeric % '0';
+ ?column?
+----------
+ NaN
+(1 row)
+
+SELECT '0'::numeric % '0';
+ERROR: division by zero
+SELECT div('inf'::numeric, '0');
+ERROR: division by zero
+SELECT div('-inf'::numeric, '0');
+ERROR: division by zero
+SELECT div('nan'::numeric, '0');
+ div
+-----
+ NaN
+(1 row)
+
+SELECT div('0'::numeric, '0');
+ERROR: division by zero
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, -x as minusx, abs(x), floor(x), ceil(x), sign(x), numeric_inc(x) as inc
+FROM v;
+ x | minusx | abs | floor | ceil | sign | inc
+-----------+-----------+----------+-----------+-----------+------+-----------
+ 0 | 0 | 0 | 0 | 0 | 0 | 1
+ 1 | -1 | 1 | 1 | 1 | 1 | 2
+ -1 | 1 | 1 | -1 | -1 | -1 | 0
+ 4.2 | -4.2 | 4.2 | 4 | 5 | 1 | 5.2
+ -7.777 | 7.777 | 7.777 | -8 | -7 | -1 | -6.777
+ Infinity | -Infinity | Infinity | Infinity | Infinity | 1 | Infinity
+ -Infinity | Infinity | Infinity | -Infinity | -Infinity | -1 | -Infinity
+ NaN | NaN | NaN | NaN | NaN | NaN | NaN
+(8 rows)
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, round(x), round(x,1) as round1, trunc(x), trunc(x,1) as trunc1
+FROM v;
+ x | round | round1 | trunc | trunc1
+-----------+-----------+-----------+-----------+-----------
+ 0 | 0 | 0.0 | 0 | 0.0
+ 1 | 1 | 1.0 | 1 | 1.0
+ -1 | -1 | -1.0 | -1 | -1.0
+ 4.2 | 4 | 4.2 | 4 | 4.2
+ -7.777 | -8 | -7.8 | -7 | -7.7
+ Infinity | Infinity | Infinity | Infinity | Infinity
+ -Infinity | -Infinity | -Infinity | -Infinity | -Infinity
+ NaN | NaN | NaN | NaN | NaN
+(8 rows)
+
+-- the large values fall into the numeric abbreviation code's maximal classes
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
+ ('inf'),('-inf'),('nan'),
+ ('inf'),('-inf'),('nan'))
+SELECT substring(x::text, 1, 32)
+FROM v ORDER BY x;
+ substring
+----------------------------------
+ -Infinity
+ -Infinity
+ -1000000000000000000000000000000
+ -7.777
+ -1
+ 0
+ 1
+ 4.2
+ 10000000000000000000000000000000
+ Infinity
+ Infinity
+ NaN
+ NaN
+(13 rows)
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('4.2'),('inf'),('nan'))
+SELECT x, sqrt(x)
+FROM v;
+ x | sqrt
+----------+-------------------
+ 0 | 0.000000000000000
+ 1 | 1.000000000000000
+ 4.2 | 2.049390153191920
+ Infinity | Infinity
+ NaN | NaN
+(5 rows)
+
+SELECT sqrt('-1'::numeric);
+ERROR: cannot take square root of a negative number
+SELECT sqrt('-inf'::numeric);
+ERROR: cannot take square root of a negative number
+WITH v(x) AS
+ (VALUES('1'::numeric),('4.2'),('inf'),('nan'))
+SELECT x,
+ log(x),
+ log10(x),
+ ln(x)
+FROM v;
+ x | log | log10 | ln
+----------+--------------------+--------------------+--------------------
+ 1 | 0.0000000000000000 | 0.0000000000000000 | 0.0000000000000000
+ 4.2 | 0.6232492903979005 | 0.6232492903979005 | 1.4350845252893226
+ Infinity | Infinity | Infinity | Infinity
+ NaN | NaN | NaN | NaN
+(4 rows)
+
+SELECT ln('0'::numeric);
+ERROR: cannot take logarithm of zero
+SELECT ln('-1'::numeric);
+ERROR: cannot take logarithm of a negative number
+SELECT ln('-inf'::numeric);
+ERROR: cannot take logarithm of a negative number
+WITH v(x) AS
+ (VALUES('2'::numeric),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ log(x1, x2)
+FROM v AS v1(x1), v AS v2(x2);
+ x1 | x2 | log
+----------+----------+--------------------
+ 2 | 2 | 1.0000000000000000
+ 2 | 4.2 | 2.0703893278913979
+ 2 | Infinity | Infinity
+ 2 | NaN | NaN
+ 4.2 | 2 | 0.4830009440873890
+ 4.2 | 4.2 | 1.0000000000000000
+ 4.2 | Infinity | Infinity
+ 4.2 | NaN | NaN
+ Infinity | 2 | 0
+ Infinity | 4.2 | 0
+ Infinity | Infinity | NaN
+ Infinity | NaN | NaN
+ NaN | 2 | NaN
+ NaN | 4.2 | NaN
+ NaN | Infinity | NaN
+ NaN | NaN | NaN
+(16 rows)
+
+SELECT log('0'::numeric, '10');
+ERROR: cannot take logarithm of zero
+SELECT log('10'::numeric, '0');
+ERROR: cannot take logarithm of zero
+SELECT log('-inf'::numeric, '10');
+ERROR: cannot take logarithm of a negative number
+SELECT log('10'::numeric, '-inf');
+ERROR: cannot take logarithm of a negative number
+SELECT log('inf'::numeric, '0');
+ERROR: cannot take logarithm of zero
+SELECT log('inf'::numeric, '-inf');
+ERROR: cannot take logarithm of a negative number
+SELECT log('-inf'::numeric, 'inf');
+ERROR: cannot take logarithm of a negative number
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('2'),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ power(x1, x2)
+FROM v AS v1(x1), v AS v2(x2) WHERE x1 != 0 OR x2 >= 0;
+ x1 | x2 | power
+----------+----------+---------------------
+ 0 | 0 | 1.0000000000000000
+ 0 | 1 | 0.0000000000000000
+ 0 | 2 | 0.0000000000000000
+ 0 | 4.2 | 0.0000000000000000
+ 0 | Infinity | 0
+ 0 | NaN | NaN
+ 1 | 0 | 1.0000000000000000
+ 1 | 1 | 1.0000000000000000
+ 1 | 2 | 1.0000000000000000
+ 1 | 4.2 | 1.0000000000000000
+ 1 | Infinity | 1
+ 1 | NaN | 1
+ 2 | 0 | 1.0000000000000000
+ 2 | 1 | 2.0000000000000000
+ 2 | 2 | 4.0000000000000000
+ 2 | 4.2 | 18.379173679952560
+ 2 | Infinity | Infinity
+ 2 | NaN | NaN
+ 4.2 | 0 | 1.0000000000000000
+ 4.2 | 1 | 4.2000000000000000
+ 4.2 | 2 | 17.6400000000000000
+ 4.2 | 4.2 | 414.61691860129675
+ 4.2 | Infinity | Infinity
+ 4.2 | NaN | NaN
+ Infinity | 0 | 1
+ Infinity | 1 | Infinity
+ Infinity | 2 | Infinity
+ Infinity | 4.2 | Infinity
+ Infinity | Infinity | Infinity
+ Infinity | NaN | NaN
+ NaN | 0 | 1
+ NaN | 1 | NaN
+ NaN | 2 | NaN
+ NaN | 4.2 | NaN
+ NaN | Infinity | NaN
+ NaN | NaN | NaN
+(36 rows)
+
+SELECT power('0'::numeric, '-1');
+ERROR: zero raised to a negative power is undefined
+SELECT power('0'::numeric, '-inf');
+ERROR: zero raised to a negative power is undefined
+SELECT power('-1'::numeric, 'inf');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power('-2'::numeric, '3');
+ power
+---------------------
+ -8.0000000000000000
+(1 row)
+
+SELECT power('-2'::numeric, '3.3');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-2'::numeric, '-1');
+ power
+---------------------
+ -0.5000000000000000
+(1 row)
+
+SELECT power('-2'::numeric, '-1.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-2'::numeric, 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power('-2'::numeric, '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power('inf'::numeric, '-2');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power('inf'::numeric, '-inf');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power('-inf'::numeric, '2');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '3');
+ power
+-----------
+ -Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '4.5');
+ERROR: a negative number raised to a non-integer power yields a complex result
+SELECT power('-inf'::numeric, '-2');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power('-inf'::numeric, '-3');
+ power
+-------
+ 0
+(1 row)
+
+SELECT power('-inf'::numeric, '0');
+ power
+-------
+ 1
+(1 row)
+
+SELECT power('-inf'::numeric, 'inf');
+ power
+----------
+ Infinity
+(1 row)
+
+SELECT power('-inf'::numeric, '-inf');
+ power
+-------
+ 0
+(1 row)
+
+-- ******************************
+-- * miscellaneous checks for things that have been broken in the past...
+-- ******************************
+-- numeric AVG used to fail on some platforms
+SELECT AVG(val) FROM num_data;
+ avg
+------------------------
+ -13430913.592242320700
+(1 row)
+
+SELECT MAX(val) FROM num_data;
+ max
+--------------------
+ 7799461.4119000000
+(1 row)
+
+SELECT MIN(val) FROM num_data;
+ min
+----------------------
+ -83028485.0000000000
+(1 row)
+
+SELECT STDDEV(val) FROM num_data;
+ stddev
+-------------------------------
+ 27791203.28758835329805617386
+(1 row)
+
+SELECT VARIANCE(val) FROM num_data;
+ variance
+--------------------------------------
+ 772350980172061.69659105821915863601
+(1 row)
+
+-- Check for appropriate rounding and overflow
+CREATE TABLE fract_only (id int, val numeric(4,4));
+INSERT INTO fract_only VALUES (1, '0.0');
+INSERT INTO fract_only VALUES (2, '0.1');
+INSERT INTO fract_only VALUES (3, '1.0'); -- should fail
+ERROR: numeric field overflow
+DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1.
+INSERT INTO fract_only VALUES (4, '-0.9999');
+INSERT INTO fract_only VALUES (5, '0.99994');
+INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail
+ERROR: numeric field overflow
+DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1.
+INSERT INTO fract_only VALUES (7, '0.00001');
+INSERT INTO fract_only VALUES (8, '0.00017');
+INSERT INTO fract_only VALUES (9, 'NaN');
+INSERT INTO fract_only VALUES (10, 'Inf'); -- should fail
+ERROR: numeric field overflow
+DETAIL: A field with precision 4, scale 4 cannot hold an infinite value.
+INSERT INTO fract_only VALUES (11, '-Inf'); -- should fail
+ERROR: numeric field overflow
+DETAIL: A field with precision 4, scale 4 cannot hold an infinite value.
+SELECT * FROM fract_only;
+ id | val
+----+---------
+ 1 | 0.0000
+ 2 | 0.1000
+ 4 | -0.9999
+ 5 | 0.9999
+ 7 | 0.0000
+ 8 | 0.0002
+ 9 | NaN
+(7 rows)
+
+DROP TABLE fract_only;
+-- Check conversion to integers
+SELECT (-9223372036854775808.5)::int8; -- should fail
+ERROR: bigint out of range
+SELECT (-9223372036854775808.4)::int8; -- ok
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+SELECT 9223372036854775807.4::int8; -- ok
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+SELECT 9223372036854775807.5::int8; -- should fail
+ERROR: bigint out of range
+SELECT (-2147483648.5)::int4; -- should fail
+ERROR: integer out of range
+SELECT (-2147483648.4)::int4; -- ok
+ int4
+-------------
+ -2147483648
+(1 row)
+
+SELECT 2147483647.4::int4; -- ok
+ int4
+------------
+ 2147483647
+(1 row)
+
+SELECT 2147483647.5::int4; -- should fail
+ERROR: integer out of range
+SELECT (-32768.5)::int2; -- should fail
+ERROR: smallint out of range
+SELECT (-32768.4)::int2; -- ok
+ int2
+--------
+ -32768
+(1 row)
+
+SELECT 32767.4::int2; -- ok
+ int2
+-------
+ 32767
+(1 row)
+
+SELECT 32767.5::int2; -- should fail
+ERROR: smallint out of range
+-- Check inf/nan conversion behavior
+SELECT 'NaN'::float8::numeric;
+ numeric
+---------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::float8::numeric;
+ numeric
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::float8::numeric;
+ numeric
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::numeric::float8;
+ float8
+--------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::numeric::float8;
+ float8
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::numeric::float8;
+ float8
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::float4::numeric;
+ numeric
+---------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::float4::numeric;
+ numeric
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::float4::numeric;
+ numeric
+-----------
+ -Infinity
+(1 row)
+
+SELECT 'NaN'::numeric::float4;
+ float4
+--------
+ NaN
+(1 row)
+
+SELECT 'Infinity'::numeric::float4;
+ float4
+----------
+ Infinity
+(1 row)
+
+SELECT '-Infinity'::numeric::float4;
+ float4
+-----------
+ -Infinity
+(1 row)
+
+SELECT '42'::int2::numeric;
+ numeric
+---------
+ 42
+(1 row)
+
+SELECT 'NaN'::numeric::int2;
+ERROR: cannot convert NaN to smallint
+SELECT 'Infinity'::numeric::int2;
+ERROR: cannot convert infinity to smallint
+SELECT '-Infinity'::numeric::int2;
+ERROR: cannot convert infinity to smallint
+SELECT 'NaN'::numeric::int4;
+ERROR: cannot convert NaN to integer
+SELECT 'Infinity'::numeric::int4;
+ERROR: cannot convert infinity to integer
+SELECT '-Infinity'::numeric::int4;
+ERROR: cannot convert infinity to integer
+SELECT 'NaN'::numeric::int8;
+ERROR: cannot convert NaN to bigint
+SELECT 'Infinity'::numeric::int8;
+ERROR: cannot convert infinity to bigint
+SELECT '-Infinity'::numeric::int8;
+ERROR: cannot convert infinity to bigint
+-- Simple check that ceil(), floor(), and round() work correctly
+CREATE TABLE ceil_floor_round (a numeric);
+INSERT INTO ceil_floor_round VALUES ('-5.5');
+INSERT INTO ceil_floor_round VALUES ('-5.499999');
+INSERT INTO ceil_floor_round VALUES ('9.5');
+INSERT INTO ceil_floor_round VALUES ('9.4999999');
+INSERT INTO ceil_floor_round VALUES ('0.0');
+INSERT INTO ceil_floor_round VALUES ('0.0000001');
+INSERT INTO ceil_floor_round VALUES ('-0.000001');
+SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round;
+ a | ceil | ceiling | floor | round
+-----------+------+---------+-------+-------
+ -5.5 | -5 | -5 | -6 | -6
+ -5.499999 | -5 | -5 | -6 | -5
+ 9.5 | 10 | 10 | 9 | 10
+ 9.4999999 | 10 | 10 | 9 | 9
+ 0.0 | 0 | 0 | 0 | 0
+ 0.0000001 | 1 | 1 | 0 | 0
+ -0.000001 | 0 | 0 | -1 | 0
+(7 rows)
+
+DROP TABLE ceil_floor_round;
+-- Check rounding, it should round ties away from zero.
+SELECT i as pow,
+ round((-2.5 * 10 ^ i)::numeric, -i),
+ round((-1.5 * 10 ^ i)::numeric, -i),
+ round((-0.5 * 10 ^ i)::numeric, -i),
+ round((0.5 * 10 ^ i)::numeric, -i),
+ round((1.5 * 10 ^ i)::numeric, -i),
+ round((2.5 * 10 ^ i)::numeric, -i)
+FROM generate_series(-5,5) AS t(i);
+ pow | round | round | round | round | round | round
+-----+----------+----------+----------+---------+---------+---------
+ -5 | -0.00003 | -0.00002 | -0.00001 | 0.00001 | 0.00002 | 0.00003
+ -4 | -0.0003 | -0.0002 | -0.0001 | 0.0001 | 0.0002 | 0.0003
+ -3 | -0.003 | -0.002 | -0.001 | 0.001 | 0.002 | 0.003
+ -2 | -0.03 | -0.02 | -0.01 | 0.01 | 0.02 | 0.03
+ -1 | -0.3 | -0.2 | -0.1 | 0.1 | 0.2 | 0.3
+ 0 | -3 | -2 | -1 | 1 | 2 | 3
+ 1 | -30 | -20 | -10 | 10 | 20 | 30
+ 2 | -300 | -200 | -100 | 100 | 200 | 300
+ 3 | -3000 | -2000 | -1000 | 1000 | 2000 | 3000
+ 4 | -30000 | -20000 | -10000 | 10000 | 20000 | 30000
+ 5 | -300000 | -200000 | -100000 | 100000 | 200000 | 300000
+(11 rows)
+
+-- Testing for width_bucket(). For convenience, we test both the
+-- numeric and float8 versions of the function in this file.
+-- errors
+SELECT width_bucket(5.0, 3.0, 4.0, 0);
+ERROR: count must be greater than zero
+SELECT width_bucket(5.0, 3.0, 4.0, -5);
+ERROR: count must be greater than zero
+SELECT width_bucket(3.5, 3.0, 3.0, 888);
+ERROR: lower bound cannot equal upper bound
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+ERROR: count must be greater than zero
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+ERROR: count must be greater than zero
+SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+ERROR: lower bound cannot equal upper bound
+SELECT width_bucket('NaN', 3.0, 4.0, 888);
+ERROR: operand, lower bound, and upper bound cannot be NaN
+SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+ERROR: operand, lower bound, and upper bound cannot be NaN
+SELECT width_bucket(2.0, 3.0, '-inf', 888);
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+ERROR: lower and upper bounds must be finite
+-- normal operation
+CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
+COPY width_bucket_test (operand_num) FROM stdin;
+UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
+SELECT
+ operand_num,
+ width_bucket(operand_num, 0, 10, 5) AS wb_1,
+ width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
+ width_bucket(operand_num, 10, 0, 5) AS wb_2,
+ width_bucket(operand_f8, 10, 0, 5) AS wb_2f,
+ width_bucket(operand_num, 2, 8, 4) AS wb_3,
+ width_bucket(operand_f8, 2, 8, 4) AS wb_3f,
+ width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4,
+ width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f,
+ width_bucket(operand_num, -25, 25, 10) AS wb_5,
+ width_bucket(operand_f8, -25, 25, 10) AS wb_5f
+ FROM width_bucket_test;
+ operand_num | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f
+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
+ -5.2 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 4 | 4
+ -0.0000000001 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 5 | 5
+ 0.000000000001 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 1 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 1.99999999999999 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 2 | 2 | 2 | 5 | 5 | 1 | 1 | 0 | 0 | 6 | 6
+ 2.00000000000001 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
+ 3 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
+ 4 | 3 | 3 | 4 | 4 | 2 | 2 | 0 | 0 | 6 | 6
+ 4.5 | 3 | 3 | 3 | 3 | 2 | 2 | 0 | 0 | 6 | 6
+ 5 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 7 | 7
+ 5.5 | 3 | 3 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
+ 6 | 4 | 4 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
+ 7 | 4 | 4 | 2 | 2 | 4 | 4 | 21 | 21 | 7 | 7
+ 8 | 5 | 5 | 2 | 2 | 5 | 5 | 21 | 21 | 7 | 7
+ 9 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
+ 9.99999999999999 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
+ 10 | 6 | 6 | 1 | 1 | 5 | 5 | 21 | 21 | 8 | 8
+ 10.0000000000001 | 6 | 6 | 0 | 0 | 5 | 5 | 21 | 21 | 8 | 8
+(19 rows)
+
+-- Check positive and negative infinity: we require
+-- finite bucket bounds, but allow an infinite operand
+SELECT width_bucket(0.0::numeric, 'Infinity'::numeric, 5, 10); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket('Infinity'::numeric, 1, 10, 10),
+ width_bucket('-Infinity'::numeric, 1, 10, 10);
+ width_bucket | width_bucket
+--------------+--------------
+ 11 | 0
+(1 row)
+
+SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+ERROR: lower and upper bounds must be finite
+SELECT width_bucket('Infinity'::float8, 1, 10, 10),
+ width_bucket('-Infinity'::float8, 1, 10, 10);
+ width_bucket | width_bucket
+--------------+--------------
+ 11 | 0
+(1 row)
+
+DROP TABLE width_bucket_test;
+-- Simple test for roundoff error when results should be exact
+SELECT x, width_bucket(x::float8, 10, 100, 9) as flt,
+ width_bucket(x::numeric, 10, 100, 9) as num
+FROM generate_series(0, 110, 10) x;
+ x | flt | num
+-----+-----+-----
+ 0 | 0 | 0
+ 10 | 1 | 1
+ 20 | 2 | 2
+ 30 | 3 | 3
+ 40 | 4 | 4
+ 50 | 5 | 5
+ 60 | 6 | 6
+ 70 | 7 | 7
+ 80 | 8 | 8
+ 90 | 9 | 9
+ 100 | 10 | 10
+ 110 | 10 | 10
+(12 rows)
+
+SELECT x, width_bucket(x::float8, 100, 10, 9) as flt,
+ width_bucket(x::numeric, 100, 10, 9) as num
+FROM generate_series(0, 110, 10) x;
+ x | flt | num
+-----+-----+-----
+ 0 | 10 | 10
+ 10 | 10 | 10
+ 20 | 9 | 9
+ 30 | 8 | 8
+ 40 | 7 | 7
+ 50 | 6 | 6
+ 60 | 5 | 5
+ 70 | 4 | 4
+ 80 | 3 | 3
+ 90 | 2 | 2
+ 100 | 1 | 1
+ 110 | 0 | 0
+(12 rows)
+
+--
+-- TO_CHAR()
+--
+SELECT to_char(val, '9G999G999G999G999G999')
+ FROM num_data;
+ to_char
+------------------------
+ 0
+ 0
+ -34,338,492
+ 4
+ 7,799,461
+ 16,397
+ 93,902
+ -83,028,485
+ 74,881
+ -24,926,804
+(10 rows)
+
+SELECT to_char(val, '9G999G999G999G999G999D999G999G999G999G999')
+ FROM num_data;
+ to_char
+--------------------------------------------
+ .000,000,000,000,000
+ .000,000,000,000,000
+ -34,338,492.215,397,047,000,000
+ 4.310,000,000,000,000
+ 7,799,461.411,900,000,000,000
+ 16,397.038,491,000,000,000
+ 93,901.577,630,260,000,000
+ -83,028,485.000,000,000,000,000
+ 74,881.000,000,000,000,000
+ -24,926,804.045,047,420,000,000
+(10 rows)
+
+SELECT to_char(val, '9999999999999999.999999999999999PR')
+ FROM num_data;
+ to_char
+------------------------------------
+ .000000000000000
+ .000000000000000
+ <34338492.215397047000000>
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ <83028485.000000000000000>
+ 74881.000000000000000
+ <24926804.045047420000000>
+(10 rows)
+
+SELECT to_char(val, '9999999999999999.999999999999999S')
+ FROM num_data;
+ to_char
+-----------------------------------
+ .000000000000000+
+ .000000000000000+
+ 34338492.215397047000000-
+ 4.310000000000000+
+ 7799461.411900000000000+
+ 16397.038491000000000+
+ 93901.577630260000000+
+ 83028485.000000000000000-
+ 74881.000000000000000+
+ 24926804.045047420000000-
+(10 rows)
+
+SELECT to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ .000000000000000
+ .000000000000000
+ - 34338492.215397047000000
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ - 83028485.000000000000000
+ 74881.000000000000000
+ - 24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FMS9999999999999999.999999999999999') FROM num_data;
+ to_char
+---------------------
+ +0.
+ +0.
+ -34338492.215397047
+ +4.31
+ +7799461.4119
+ +16397.038491
+ +93901.57763026
+ -83028485.
+ +74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
+ to_char
+----------------------
+ 0.
+ 0.
+ <34338492.215397047>
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ <83028485.>
+ 74881.
+ <24926804.04504742>
+(10 rows)
+
+SELECT to_char(val, 'SG9999999999999999.999999999999999th') FROM num_data;
+ to_char
+-----------------------------------
+ + .000000000000000
+ + .000000000000000
+ - 34338492.215397047000000
+ + 4.310000000000000
+ + 7799461.411900000000000
+ + 16397.038491000000000
+ + 93901.577630260000000
+ - 83028485.000000000000000
+ + 74881.000000000000000
+ - 24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, '0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ 0000000000000000.000000000000000
+ 0000000000000000.000000000000000
+ -0000000034338492.215397047000000
+ 0000000000000004.310000000000000
+ 0000000007799461.411900000000000
+ 0000000000016397.038491000000000
+ 0000000000093901.577630260000000
+ -0000000083028485.000000000000000
+ 0000000000074881.000000000000000
+ -0000000024926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'S0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------------
+ +0000000000000000.000000000000000
+ +0000000000000000.000000000000000
+ -0000000034338492.215397047000000
+ +0000000000000004.310000000000000
+ +0000000007799461.411900000000000
+ +0000000000016397.038491000000000
+ +0000000000093901.577630260000000
+ -0000000083028485.000000000000000
+ +0000000000074881.000000000000000
+ -0000000024926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FM0999999999999999.999999999999999') FROM num_data;
+ to_char
+-----------------------------
+ 0000000000000000.
+ 0000000000000000.
+ -0000000034338492.215397047
+ 0000000000000004.31
+ 0000000007799461.4119
+ 0000000000016397.038491
+ 0000000000093901.57763026
+ -0000000083028485.
+ 0000000000074881.
+ -0000000024926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.099999999999999') FROM num_data;
+ to_char
+---------------------
+ .0
+ .0
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.0
+ 74881.0
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
+ to_char
+---------------------
+ 0000.000
+ 0000.000
+ -34338492.215397047
+ 0004.310
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.000
+ 74881.000
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;
+ to_char
+-----------------------------
+ 0000000000000000.00000
+ 0000000000000000.00000
+ -0000000034338492.215397047
+ 0000000000000004.31000
+ 0000000007799461.41190
+ 0000000000016397.038491
+ 0000000000093901.57763026
+ -0000000083028485.00000
+ 0000000000074881.00000
+ -0000000024926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
+ to_char
+---------------------
+ 0000000.0
+ 0000000.0
+ -34338492.215397047
+ 0000004.31
+ 7799461.4119
+ 0016397.038491
+ 0093901.57763026
+ -83028485.0
+ 0074881.0
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
+ to_char
+------------------------------------
+ .000000000000000
+ .000000000000000
+ -34338492.215397047000000
+ 4.310000000000000
+ 7799461.411900000000000
+ 16397.038491000000000
+ 93901.577630260000000
+ -83028485.000000000000000
+ 74881.000000000000000
+ -24926804.045047420000000
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
+ to_char
+---------------------
+ 0.
+ 0.
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.
+ 74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+ to_char
+-----------------------------------------------------------------------
+ +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
+ +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +1 6 3 9 7 . 0 3 8 4 9 1 0 0 0 0 0 0 0 0 0 0 0
+ +9 3 9 0 1 . 5 7 7 6 3 0 2 6 0 0 0 0 0 0 0 0 0
+ -8 3 0 2 8 4 8 5 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ +7 4 8 8 1 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2 0 0 0 0 0 0 0 0 0
+(10 rows)
+
+SELECT to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+ to_char
+-------------------------------------------------------
+ +0 .
+ +0 .
+ -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7
+ +4 . 3 1
+ +7 7 9 9 4 6 1 . 4 1 1 9
+ +1 6 3 9 7 . 0 3 8 4 9 1
+ +9 3 9 0 1 . 5 7 7 6 3 0 2 6
+ -8 3 0 2 8 4 8 5 .
+ +7 4 8 8 1 .
+ -2 4 9 2 6 8 0 4 . 0 4 5 0 4 7 4 2
+(10 rows)
+
+SELECT to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
+ to_char
+-----------------------------------------------------------
+ text 9999 "text between quote marks" 0
+ text 9999 "text between quote marks" 0
+ text -3 9999 433 "text between quote marks" 8492
+ text 9999 "text between quote marks" 4
+ text 9999 779 "text between quote marks" 9461
+ text 9999 1 "text between quote marks" 6397
+ text 9999 9 "text between quote marks" 3902
+ text -8 9999 302 "text between quote marks" 8485
+ text 9999 7 "text between quote marks" 4881
+ text -2 9999 492 "text between quote marks" 6804
+(10 rows)
+
+SELECT to_char(val, '999999SG9999999999') FROM num_data;
+ to_char
+-------------------
+ + 0
+ + 0
+ - 34338492
+ + 4
+ + 7799461
+ + 16397
+ + 93902
+ - 83028485
+ + 74881
+ - 24926804
+(10 rows)
+
+SELECT to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
+ to_char
+---------------------
+ 0.
+ 0.
+ -34338492.215397047
+ 4.31
+ 7799461.4119
+ 16397.038491
+ 93901.57763026
+ -83028485.
+ 74881.
+ -24926804.04504742
+(10 rows)
+
+SELECT to_char(val, '9.999EEEE') FROM num_data;
+ to_char
+------------
+ 0.000e+00
+ 0.000e+00
+ -3.434e+07
+ 4.310e+00
+ 7.799e+06
+ 1.640e+04
+ 9.390e+04
+ -8.303e+07
+ 7.488e+04
+ -2.493e+07
+(10 rows)
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, '9.999EEEE') as numeric,
+ to_char(val::float8, '9.999EEEE') as float8,
+ to_char(val::float4, '9.999EEEE') as float4
+FROM v;
+ val | numeric | float8 | float4
+------------+------------+------------+------------
+ 0 | 0.000e+00 | 0.000e+00 | 0.000e+00
+ -4.2 | -4.200e+00 | -4.200e+00 | -4.200e+00
+ 4200000000 | 4.200e+09 | 4.200e+09 | 4.200e+09
+ 0.000012 | 1.200e-05 | 1.200e-05 | 1.200e-05
+ Infinity | #.####### | #.####### | #.#######
+ -Infinity | #.####### | #.####### | #.#######
+ NaN | #.####### | #.####### | #.#######
+(7 rows)
+
+WITH v(exp) AS
+ (VALUES(-16379),(-16378),(-1234),(-789),(-45),(-5),(-4),(-3),(-2),(-1),(0),
+ (1),(2),(3),(4),(5),(38),(275),(2345),(45678),(131070),(131071))
+SELECT exp,
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+FROM v;
+ exp | numeric
+--------+----------------
+ -16379 | 1.235e-16379
+ -16378 | 1.235e-16378
+ -1234 | 1.235e-1234
+ -789 | 1.235e-789
+ -45 | 1.235e-45
+ -5 | 1.235e-05
+ -4 | 1.235e-04
+ -3 | 1.235e-03
+ -2 | 1.235e-02
+ -1 | 1.235e-01
+ 0 | 1.235e+00
+ 1 | 1.235e+01
+ 2 | 1.235e+02
+ 3 | 1.235e+03
+ 4 | 1.235e+04
+ 5 | 1.235e+05
+ 38 | 1.235e+38
+ 275 | 1.235e+275
+ 2345 | 1.235e+2345
+ 45678 | 1.235e+45678
+ 131070 | 1.235e+131070
+ 131071 | 1.235e+131071
+(22 rows)
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI9999999999.99') as numeric,
+ to_char(val::float8, 'MI9999999999.99') as float8,
+ to_char(val::float4, 'MI9999999999.99') as float4
+FROM v;
+ val | numeric | float8 | float4
+------------+----------------+----------------+----------------
+ 0 | .00 | .00 | .00
+ -4.2 | - 4.20 | - 4.20 | - 4.20
+ 4200000000 | 4200000000.00 | 4200000000.00 | 4200000000
+ 0.000012 | .00 | .00 | .00
+ Infinity | Infinity | Infinity | Infinity
+ -Infinity | - Infinity | - Infinity | - Infinity
+ NaN | NaN | NaN | NaN
+(7 rows)
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI99.99') as numeric,
+ to_char(val::float8, 'MI99.99') as float8,
+ to_char(val::float4, 'MI99.99') as float4
+FROM v;
+ val | numeric | float8 | float4
+------------+---------+--------+--------
+ 0 | .00 | .00 | .00
+ -4.2 | - 4.20 | - 4.20 | - 4.20
+ 4200000000 | ##.## | ##.## | ##.
+ 0.000012 | .00 | .00 | .00
+ Infinity | ##.## | ##.## | ##.
+ -Infinity | -##.## | -##.## | -##.
+ NaN | ##.## | ##.## | ##.##
+(7 rows)
+
+SELECT to_char('100'::numeric, 'FM999.9');
+ to_char
+---------
+ 100.
+(1 row)
+
+SELECT to_char('100'::numeric, 'FM999.');
+ to_char
+---------
+ 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'FM999');
+ to_char
+---------
+ 100
+(1 row)
+
+-- Check parsing of literal text in a format string
+SELECT to_char('100'::numeric, 'foo999');
+ to_char
+---------
+ foo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\oo999');
+ to_char
+----------
+ f\oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\\oo999');
+ to_char
+-----------
+ f\\oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\"oo999');
+ to_char
+----------
+ f"oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f\\"oo999');
+ to_char
+-----------
+ f\"oo 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool"999');
+ to_char
+----------
+ fool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"\ool"999');
+ to_char
+----------
+ fool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"\\ool"999');
+ to_char
+-----------
+ f\ool 100
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool\"999');
+ to_char
+----------
+ fool"999
+(1 row)
+
+SELECT to_char('100'::numeric, 'f"ool\\"999');
+ to_char
+-----------
+ fool\ 100
+(1 row)
+
+-- TO_NUMBER()
+--
+SET lc_numeric = 'C';
+SELECT to_number('-34,338,492', '99G999G999');
+ to_number
+-----------
+ -34338492
+(1 row)
+
+SELECT to_number('-34,338,492.654,878', '99G999G999D999G999');
+ to_number
+------------------
+ -34338492.654878
+(1 row)
+
+SELECT to_number('<564646.654564>', '999999.999999PR');
+ to_number
+----------------
+ -564646.654564
+(1 row)
+
+SELECT to_number('0.00001-', '9.999999S');
+ to_number
+-----------
+ -0.00001
+(1 row)
+
+SELECT to_number('5.01-', 'FM9.999999S');
+ to_number
+-----------
+ -5.01
+(1 row)
+
+SELECT to_number('5.01-', 'FM9.999999MI');
+ to_number
+-----------
+ -5.01
+(1 row)
+
+SELECT to_number('5 4 4 4 4 8 . 7 8', '9 9 9 9 9 9 . 9 9');
+ to_number
+-----------
+ 544448.78
+(1 row)
+
+SELECT to_number('.01', 'FM9.99');
+ to_number
+-----------
+ 0.01
+(1 row)
+
+SELECT to_number('.0', '99999999.99999999');
+ to_number
+-----------
+ 0.0
+(1 row)
+
+SELECT to_number('0', '99.99');
+ to_number
+-----------
+ 0
+(1 row)
+
+SELECT to_number('.-01', 'S99.99');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number('.01-', '99.99S');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number(' . 0 1-', ' 9 9 . 9 9 S');
+ to_number
+-----------
+ -0.01
+(1 row)
+
+SELECT to_number('34,50','999,99');
+ to_number
+-----------
+ 3450
+(1 row)
+
+SELECT to_number('123,000','999G');
+ to_number
+-----------
+ 123
+(1 row)
+
+SELECT to_number('123456','999G999');
+ to_number
+-----------
+ 123456
+(1 row)
+
+SELECT to_number('$1234.56','L9,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('$1234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('$1,234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('1234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('1,234.56','L99,999.99');
+ to_number
+-----------
+ 1234.56
+(1 row)
+
+SELECT to_number('42nd', '99th');
+ to_number
+-----------
+ 42
+(1 row)
+
+RESET lc_numeric;
+--
+-- Input syntax
+--
+CREATE TABLE num_input_test (n1 numeric);
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+INSERT INTO num_input_test(n1) VALUES (' nan');
+INSERT INTO num_input_test(n1) VALUES (' inf ');
+INSERT INTO num_input_test(n1) VALUES (' +inf ');
+INSERT INTO num_input_test(n1) VALUES (' -inf ');
+INSERT INTO num_input_test(n1) VALUES (' Infinity ');
+INSERT INTO num_input_test(n1) VALUES (' +inFinity ');
+INSERT INTO num_input_test(n1) VALUES (' -INFINITY ');
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+ERROR: invalid input syntax for type numeric: " "
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' ');
+ ^
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ERROR: invalid input syntax for type numeric: " 1234 %"
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+ERROR: invalid input syntax for type numeric: "xyz"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('xyz');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ERROR: invalid input syntax for type numeric: "- 1234"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type numeric: "5 . 0"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ERROR: invalid input syntax for type numeric: "5. 0 "
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('');
+ERROR: invalid input syntax for type numeric: ""
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('');
+ ^
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ERROR: invalid input syntax for type numeric: " N aN "
+LINE 1: INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ ^
+INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ERROR: invalid input syntax for type numeric: "+ infinity"
+LINE 1: INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+ ^
+SELECT * FROM num_input_test;
+ n1
+-----------
+ 123
+ 3245874
+ -93853
+ 555.50
+ -555.50
+ NaN
+ NaN
+ Infinity
+ Infinity
+ -Infinity
+ Infinity
+ Infinity
+ -Infinity
+(13 rows)
+
+--
+-- Test some corner cases for multiplication
+--
+select 4790999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+ ?column?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 47909999999999999999999999999999999999999999999999999999999999999999999999999999999999985209000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+(1 row)
+
+select 4789999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+ ?column?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 47899999999999999999999999999999999999999999999999999999999999999999999999999999999999985210000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+(1 row)
+
+select 4770999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+ ?column?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 47709999999999999999999999999999999999999999999999999999999999999999999999999999999999985229000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+(1 row)
+
+select 4769999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+ ?column?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 47699999999999999999999999999999999999999999999999999999999999999999999999999999999999985230000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+(1 row)
+
+select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383));
+ trim_scale
+------------
+ 0.01
+(1 row)
+
+--
+-- Test some corner cases for division
+--
+select 999999999999999999999::numeric/1000000000000000000000;
+ ?column?
+------------------------
+ 1.00000000000000000000
+(1 row)
+
+select div(999999999999999999999::numeric,1000000000000000000000);
+ div
+-----
+ 0
+(1 row)
+
+select mod(999999999999999999999::numeric,1000000000000000000000);
+ mod
+-----------------------
+ 999999999999999999999
+(1 row)
+
+select div(-9999999999999999999999::numeric,1000000000000000000000);
+ div
+-----
+ -9
+(1 row)
+
+select mod(-9999999999999999999999::numeric,1000000000000000000000);
+ mod
+------------------------
+ -999999999999999999999
+(1 row)
+
+select div(-9999999999999999999999::numeric,1000000000000000000000)*1000000000000000000000 + mod(-9999999999999999999999::numeric,1000000000000000000000);
+ ?column?
+-------------------------
+ -9999999999999999999999
+(1 row)
+
+select mod (70.0,70) ;
+ mod
+-----
+ 0.0
+(1 row)
+
+select div (70.0,70) ;
+ div
+-----
+ 1
+(1 row)
+
+select 70.0 / 70 ;
+ ?column?
+------------------------
+ 1.00000000000000000000
+(1 row)
+
+select 12345678901234567890 % 123;
+ ?column?
+----------
+ 78
+(1 row)
+
+select 12345678901234567890 / 123;
+ ?column?
+--------------------
+ 100371373180768845
+(1 row)
+
+select div(12345678901234567890, 123);
+ div
+--------------------
+ 100371373180768844
+(1 row)
+
+select div(12345678901234567890, 123) * 123 + 12345678901234567890 % 123;
+ ?column?
+----------------------
+ 12345678901234567890
+(1 row)
+
+--
+-- Test some corner cases for square root
+--
+select sqrt(1.000000000000003::numeric);
+ sqrt
+-------------------
+ 1.000000000000001
+(1 row)
+
+select sqrt(1.000000000000004::numeric);
+ sqrt
+-------------------
+ 1.000000000000002
+(1 row)
+
+select sqrt(96627521408608.56340355805::numeric);
+ sqrt
+---------------------
+ 9829929.87811248648
+(1 row)
+
+select sqrt(96627521408608.56340355806::numeric);
+ sqrt
+---------------------
+ 9829929.87811248649
+(1 row)
+
+select sqrt(515549506212297735.073688290367::numeric);
+ sqrt
+------------------------
+ 718017761.766585921184
+(1 row)
+
+select sqrt(515549506212297735.073688290368::numeric);
+ sqrt
+------------------------
+ 718017761.766585921185
+(1 row)
+
+select sqrt(8015491789940783531003294973900306::numeric);
+ sqrt
+-------------------
+ 89529278953540017
+(1 row)
+
+select sqrt(8015491789940783531003294973900307::numeric);
+ sqrt
+-------------------
+ 89529278953540018
+(1 row)
+
+--
+-- Test code path for raising to integer powers
+--
+select 10.0 ^ -2147483648 as rounds_to_zero;
+ rounds_to_zero
+--------------------
+ 0.0000000000000000
+(1 row)
+
+select 10.0 ^ -2147483647 as rounds_to_zero;
+ rounds_to_zero
+--------------------
+ 0.0000000000000000
+(1 row)
+
+select 10.0 ^ 2147483647 as overflows;
+ERROR: value overflows numeric format
+select 117743296169.0 ^ 1000000000 as overflows;
+ERROR: value overflows numeric format
+-- cases that used to return inaccurate results
+select 3.789 ^ 21;
+ ?column?
+--------------------------------
+ 1409343026052.8716016316022141
+(1 row)
+
+select 3.789 ^ 35;
+ ?column?
+----------------------------------------
+ 177158169650516670809.3820586142670135
+(1 row)
+
+select 1.2 ^ 345;
+ ?column?
+-----------------------------------------------
+ 2077446682327378559843444695.5827049735727869
+(1 row)
+
+select 0.12 ^ (-20);
+ ?column?
+--------------------------------------
+ 2608405330458882702.5529619561355838
+(1 row)
+
+select 1.000000000123 ^ (-2147483648);
+ ?column?
+--------------------
+ 0.7678656556403084
+(1 row)
+
+select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
+ rounds_to_zero
+----------------
+ 0
+(1 row)
+
+select round(((1 - 1.500012345678e-1000) ^ 1.45e1003) * 1e1000);
+ round
+----------------------------------------------------------
+ 25218976308958387188077465658068501556514992509509282366
+(1 row)
+
+-- cases that used to error out
+select 0.12 ^ (-25);
+ ?column?
+-------------------------------------------
+ 104825960103961013959336.4983657883169110
+(1 row)
+
+select 0.5678 ^ (-85);
+ ?column?
+----------------------------------------
+ 782333637740774446257.7719390061997396
+(1 row)
+
+select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
+ underflows
+------------
+ 0
+(1 row)
+
+-- negative base to integer powers
+select (-1.0) ^ 2147483646;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 2147483647;
+ ?column?
+---------------------
+ -1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 2147483648;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 1000000000000000;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-1.0) ^ 1000000000000001;
+ ?column?
+---------------------
+ -1.0000000000000000
+(1 row)
+
+--
+-- Tests for raising to non-integer powers
+--
+-- special cases
+select 0.0 ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select (-12.34) ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select 12.34 ^ 0.0;
+ ?column?
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select 0.0 ^ 12.34;
+ ?column?
+--------------------
+ 0.0000000000000000
+(1 row)
+
+-- NaNs
+select 'NaN'::numeric ^ 'NaN'::numeric;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 'NaN'::numeric ^ 0;
+ ?column?
+----------
+ 1
+(1 row)
+
+select 'NaN'::numeric ^ 1;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 0 ^ 'NaN'::numeric;
+ ?column?
+----------
+ NaN
+(1 row)
+
+select 1 ^ 'NaN'::numeric;
+ ?column?
+----------
+ 1
+(1 row)
+
+-- invalid inputs
+select 0.0 ^ (-12.34);
+ERROR: zero raised to a negative power is undefined
+select (-12.34) ^ 1.2;
+ERROR: a negative number raised to a non-integer power yields a complex result
+-- cases that used to generate inaccurate results
+select 32.1 ^ 9.8;
+ ?column?
+--------------------
+ 580429286790711.10
+(1 row)
+
+select 32.1 ^ (-9.8);
+ ?column?
+----------------------------------
+ 0.000000000000001722862754788209
+(1 row)
+
+select 12.3 ^ 45.6;
+ ?column?
+------------------------------------------------------
+ 50081010321492803393171165777624533697036806969694.9
+(1 row)
+
+select 12.3 ^ (-45.6);
+ ?column?
+---------------------------------------------------------------------
+ 0.00000000000000000000000000000000000000000000000001996764828785491
+(1 row)
+
+-- big test
+select 1.234 ^ 5678;
+ ?column?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 307239295662090741644584872593956173493568238595074141254349565406661439636598896798876823220904084953233015553994854875890890858118656468658643918169805277399402542281777901029346337707622181574346585989613344285010764501017625366742865066948856161360224801370482171458030533346309750557140549621313515752078638620714732831815297168231790779296290266207315344008883935010274044001522606235576584215999260117523114297033944018699691024106823438431754073086813382242140602291215149759520833200152654884259619588924545324.5973362312547382
+(1 row)
+
+--
+-- Tests for EXP()
+--
+-- special cases
+select exp(0.0);
+ exp
+--------------------
+ 1.0000000000000000
+(1 row)
+
+select exp(1.0);
+ exp
+--------------------
+ 2.7182818284590452
+(1 row)
+
+select exp(1.0::numeric(71,70));
+ exp
+--------------------------------------------------------------------------
+ 2.7182818284590452353602874713526624977572470936999595749669676277240766
+(1 row)
+
+select exp('nan'::numeric);
+ exp
+-----
+ NaN
+(1 row)
+
+select exp('inf'::numeric);
+ exp
+----------
+ Infinity
+(1 row)
+
+select exp('-inf'::numeric);
+ exp
+-----
+ 0
+(1 row)
+
+select coalesce(nullif(exp(-5000::numeric), 0), 0) as rounds_to_zero;
+ rounds_to_zero
+----------------
+ 0
+(1 row)
+
+select coalesce(nullif(exp(-10000::numeric), 0), 0) as underflows;
+ underflows
+------------
+ 0
+(1 row)
+
+-- cases that used to generate inaccurate results
+select exp(32.999);
+ exp
+---------------------
+ 214429043492155.053
+(1 row)
+
+select exp(-32.999);
+ exp
+----------------------------------
+ 0.000000000000004663547361468248
+(1 row)
+
+select exp(123.456);
+ exp
+------------------------------------------------------------
+ 413294435277809344957685441227343146614594393746575438.725
+(1 row)
+
+select exp(-123.456);
+ exp
+-------------------------------------------------------------------------
+ 0.000000000000000000000000000000000000000000000000000002419582541264601
+(1 row)
+
+-- big test
+select exp(1234.5678);
+ exp
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 146549072930959479983482138503979804217622199675223653966270157446954995433819741094410764947112047906012815540251009949604426069672532417736057033099274204598385314594846509975629046864798765888104789074984927709616261452461385220475510438783429612447831614003668421849727379202555580791042606170523016207262965336641214601082882495255771621327088265411334088968112458492660609809762865582162764292604697957813514621259353683899630997077707406305730694385703091201347848855199354307506425820147289848677003277208302716466011827836279231.9667
+(1 row)
+
+--
+-- Tests for generate_series
+--
+select * from generate_series(0.0::numeric, 4.0::numeric);
+ generate_series
+-----------------
+ 0.0
+ 1.0
+ 2.0
+ 3.0
+ 4.0
+(5 rows)
+
+select * from generate_series(0.1::numeric, 4.0::numeric, 1.3::numeric);
+ generate_series
+-----------------
+ 0.1
+ 1.4
+ 2.7
+ 4.0
+(4 rows)
+
+select * from generate_series(4.0::numeric, -1.5::numeric, -2.2::numeric);
+ generate_series
+-----------------
+ 4.0
+ 1.8
+ -0.4
+(3 rows)
+
+-- Trigger errors
+select * from generate_series(-100::numeric, 100::numeric, 0::numeric);
+ERROR: step size cannot equal zero
+select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+ERROR: step size cannot be NaN
+select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+ERROR: start value cannot be NaN
+select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+ERROR: stop value cannot be NaN
+select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+ERROR: start value cannot be infinity
+select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+ERROR: stop value cannot be infinity
+select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+ERROR: step size cannot be infinity
+-- Checks maximum, output is truncated
+select (i / (10::numeric ^ 131071))::numeric(1,0)
+ from generate_series(6 * (10::numeric ^ 131071),
+ 9 * (10::numeric ^ 131071),
+ 10::numeric ^ 131071) as a(i);
+ numeric
+---------
+ 6
+ 7
+ 8
+ 9
+(4 rows)
+
+-- Check usage with variables
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(i,3) j;
+ i | j
+---+---
+ 1 | 1
+ 1 | 2
+ 1 | 3
+ 2 | 2
+ 2 | 3
+ 3 | 3
+(6 rows)
+
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,i) j;
+ i | j
+---+---
+ 1 | 1
+ 2 | 1
+ 2 | 2
+ 3 | 1
+ 3 | 2
+ 3 | 3
+(6 rows)
+
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,5,i) j;
+ i | j
+---+---
+ 1 | 1
+ 1 | 2
+ 1 | 3
+ 1 | 4
+ 1 | 5
+ 2 | 1
+ 2 | 3
+ 2 | 5
+ 3 | 1
+ 3 | 4
+(10 rows)
+
+--
+-- Tests for LN()
+--
+-- Invalid inputs
+select ln(-12.34);
+ERROR: cannot take logarithm of a negative number
+select ln(0.0);
+ERROR: cannot take logarithm of zero
+-- Some random tests
+select ln(1.2345678e-28);
+ ln
+-----------------------------------------
+ -64.26166165451762991204894255882820859
+(1 row)
+
+select ln(0.0456789);
+ ln
+---------------------
+ -3.0861187944847439
+(1 row)
+
+select ln(0.349873948359354029493948309745709580730482050975);
+ ln
+-----------------------------------------------------
+ -1.050182336912082775693991697979750253056317885460
+(1 row)
+
+select ln(0.99949452);
+ ln
+-------------------------
+ -0.00050560779808326467
+(1 row)
+
+select ln(1.00049687395);
+ ln
+------------------------
+ 0.00049675054901370394
+(1 row)
+
+select ln(1234.567890123456789);
+ ln
+--------------------
+ 7.1184763012977896
+(1 row)
+
+select ln(5.80397490724e5);
+ ln
+--------------------
+ 13.271468476626518
+(1 row)
+
+select ln(9.342536355e34);
+ ln
+--------------------
+ 80.522470935524187
+(1 row)
+
+--
+-- Tests for LOG() (base 10)
+--
+-- invalid inputs
+select log(-12.34);
+ERROR: cannot take logarithm of a negative number
+CONTEXT: SQL function "log" statement 1
+select log(0.0);
+ERROR: cannot take logarithm of zero
+CONTEXT: SQL function "log" statement 1
+-- some random tests
+select log(1.234567e-89);
+ log
+-----------------------------------------------------------------------------------------------------
+ -88.90848533591373725637496492944925187293052336306443143312825869985819779294142441287021741054275
+(1 row)
+
+select log(3.4634998359873254962349856073435545);
+ log
+--------------------------------------
+ 0.5395151714070134409152404011959981
+(1 row)
+
+select log(9.999999999999999999);
+ log
+----------------------
+ 1.000000000000000000
+(1 row)
+
+select log(10.00000000000000000);
+ log
+---------------------
+ 1.00000000000000000
+(1 row)
+
+select log(10.00000000000000001);
+ log
+---------------------
+ 1.00000000000000000
+(1 row)
+
+select log(590489.45235237);
+ log
+-------------------
+ 5.771212144411727
+(1 row)
+
+--
+-- Tests for LOG() (arbitrary base)
+--
+-- invalid inputs
+select log(-12.34, 56.78);
+ERROR: cannot take logarithm of a negative number
+select log(-12.34, -56.78);
+ERROR: cannot take logarithm of a negative number
+select log(12.34, -56.78);
+ERROR: cannot take logarithm of a negative number
+select log(0.0, 12.34);
+ERROR: cannot take logarithm of zero
+select log(12.34, 0.0);
+ERROR: cannot take logarithm of zero
+select log(1.0, 12.34);
+ERROR: division by zero
+-- some random tests
+select log(1.23e-89, 6.4689e45);
+ log
+------------------------------------------------------------------------------------------------
+ -0.5152489207781856983977054971756484879653568168479201885425588841094788842469115325262329756
+(1 row)
+
+select log(0.99923, 4.58934e34);
+ log
+---------------------
+ -103611.55579544132
+(1 row)
+
+select log(1.000016, 8.452010e18);
+ log
+--------------------
+ 2723830.2877097365
+(1 row)
+
+select log(3.1954752e47, 9.4792021e-73);
+ log
+-------------------------------------------------------------------------------------
+ -1.51613372350688302142917386143459361608600157692779164475351842333265418126982165
+(1 row)
+
+--
+-- Tests for scale()
+--
+select scale(numeric 'NaN');
+ scale
+-------
+
+(1 row)
+
+select scale(numeric 'inf');
+ scale
+-------
+
+(1 row)
+
+select scale(NULL::numeric);
+ scale
+-------
+
+(1 row)
+
+select scale(1.12);
+ scale
+-------
+ 2
+(1 row)
+
+select scale(0);
+ scale
+-------
+ 0
+(1 row)
+
+select scale(0.00);
+ scale
+-------
+ 2
+(1 row)
+
+select scale(1.12345);
+ scale
+-------
+ 5
+(1 row)
+
+select scale(110123.12475871856128);
+ scale
+-------
+ 14
+(1 row)
+
+select scale(-1123.12471856128);
+ scale
+-------
+ 11
+(1 row)
+
+select scale(-13.000000000000000);
+ scale
+-------
+ 15
+(1 row)
+
+--
+-- Tests for min_scale()
+--
+select min_scale(numeric 'NaN') is NULL; -- should be true
+ ?column?
+----------
+ t
+(1 row)
+
+select min_scale(numeric 'inf') is NULL; -- should be true
+ ?column?
+----------
+ t
+(1 row)
+
+select min_scale(0); -- no digits
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(0.00); -- no digits again
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(1.0); -- no scale
+ min_scale
+-----------
+ 0
+(1 row)
+
+select min_scale(1.1); -- scale 1
+ min_scale
+-----------
+ 1
+(1 row)
+
+select min_scale(1.12); -- scale 2
+ min_scale
+-----------
+ 2
+(1 row)
+
+select min_scale(1.123); -- scale 3
+ min_scale
+-----------
+ 3
+(1 row)
+
+select min_scale(1.1234); -- scale 4, filled digit
+ min_scale
+-----------
+ 4
+(1 row)
+
+select min_scale(1.12345); -- scale 5, 2 NDIGITS
+ min_scale
+-----------
+ 5
+(1 row)
+
+select min_scale(1.1000); -- 1 pos in NDIGITS
+ min_scale
+-----------
+ 1
+(1 row)
+
+select min_scale(1e100); -- very big number
+ min_scale
+-----------
+ 0
+(1 row)
+
+--
+-- Tests for trim_scale()
+--
+select trim_scale(numeric 'NaN');
+ trim_scale
+------------
+ NaN
+(1 row)
+
+select trim_scale(numeric 'inf');
+ trim_scale
+------------
+ Infinity
+(1 row)
+
+select trim_scale(1.120);
+ trim_scale
+------------
+ 1.12
+(1 row)
+
+select trim_scale(0);
+ trim_scale
+------------
+ 0
+(1 row)
+
+select trim_scale(0.00);
+ trim_scale
+------------
+ 0
+(1 row)
+
+select trim_scale(1.1234500);
+ trim_scale
+------------
+ 1.12345
+(1 row)
+
+select trim_scale(110123.12475871856128000);
+ trim_scale
+-----------------------
+ 110123.12475871856128
+(1 row)
+
+select trim_scale(-1123.124718561280000000);
+ trim_scale
+-------------------
+ -1123.12471856128
+(1 row)
+
+select trim_scale(-13.00000000000000000000);
+ trim_scale
+------------
+ -13
+(1 row)
+
+select trim_scale(1e100);
+ trim_scale
+-------------------------------------------------------------------------------------------------------
+ 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+(1 row)
+
+--
+-- Tests for SUM()
+--
+-- cases that need carry propagation
+SELECT SUM(9999::numeric) FROM generate_series(1, 100000);
+ sum
+-----------
+ 999900000
+(1 row)
+
+SELECT SUM((-9999)::numeric) FROM generate_series(1, 100000);
+ sum
+------------
+ -999900000
+(1 row)
+
+--
+-- Tests for GCD()
+--
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(-b, a), gcd(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 46375::numeric),
+ (433125::numeric, 46375::numeric),
+ (43312.5::numeric, 4637.5::numeric),
+ (4331.250::numeric, 463.75000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+ a | b | gcd | gcd | gcd | gcd
+----------+-----------+---------+---------+---------+---------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | NaN | NaN | NaN | NaN | NaN
+ 0 | 46375 | 46375 | 46375 | 46375 | 46375
+ 433125 | 46375 | 875 | 875 | 875 | 875
+ 43312.5 | 4637.5 | 87.5 | 87.5 | 87.5 | 87.5
+ 4331.250 | 463.75000 | 8.75000 | 8.75000 | 8.75000 | 8.75000
+ Infinity | 0 | NaN | NaN | NaN | NaN
+ Infinity | 42 | NaN | NaN | NaN | NaN
+ Infinity | Infinity | NaN | NaN | NaN | NaN
+(9 rows)
+
+--
+-- Tests for LCM()
+--
+SELECT a,b, lcm(a, b), lcm(a, -b), lcm(-b, a), lcm(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 13272::numeric),
+ (13272::numeric, 13272::numeric),
+ (423282::numeric, 13272::numeric),
+ (42328.2::numeric, 1327.2::numeric),
+ (4232.820::numeric, 132.72000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+ a | b | lcm | lcm | lcm | lcm
+----------+-----------+--------------+--------------+--------------+--------------
+ 0 | 0 | 0 | 0 | 0 | 0
+ 0 | NaN | NaN | NaN | NaN | NaN
+ 0 | 13272 | 0 | 0 | 0 | 0
+ 13272 | 13272 | 13272 | 13272 | 13272 | 13272
+ 423282 | 13272 | 11851896 | 11851896 | 11851896 | 11851896
+ 42328.2 | 1327.2 | 1185189.6 | 1185189.6 | 1185189.6 | 1185189.6
+ 4232.820 | 132.72000 | 118518.96000 | 118518.96000 | 118518.96000 | 118518.96000
+ Infinity | 0 | NaN | NaN | NaN | NaN
+ Infinity | 42 | NaN | NaN | NaN | NaN
+ Infinity | Infinity | NaN | NaN | NaN | NaN
+(10 rows)
+
+SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+ERROR: value overflows numeric format
+--
+-- Tests for factorial
+--
+SELECT factorial(4);
+ factorial
+-----------
+ 24
+(1 row)
+
+SELECT factorial(15);
+ factorial
+---------------
+ 1307674368000
+(1 row)
+
+SELECT factorial(100000);
+ERROR: value overflows numeric format
+SELECT factorial(0);
+ factorial
+-----------
+ 1
+(1 row)
+
+SELECT factorial(-4);
+ERROR: factorial of a negative number is undefined
+--
+-- Tests for pg_lsn()
+--
+SELECT pg_lsn(23783416::numeric);
+ pg_lsn
+-----------
+ 0/16AE7F8
+(1 row)
+
+SELECT pg_lsn(0::numeric);
+ pg_lsn
+--------
+ 0/0
+(1 row)
+
+SELECT pg_lsn(18446744073709551615::numeric);
+ pg_lsn
+-------------------
+ FFFFFFFF/FFFFFFFF
+(1 row)
+
+SELECT pg_lsn(-1::numeric);
+ERROR: pg_lsn out of range
+SELECT pg_lsn(18446744073709551616::numeric);
+ERROR: pg_lsn out of range
+SELECT pg_lsn('NaN'::numeric);
+ERROR: cannot convert NaN to pg_lsn
diff --git a/yql/essentials/tests/postgresql/original/cases/numeric.sql b/yql/essentials/tests/postgresql/original/cases/numeric.sql
new file mode 100644
index 0000000000..9233c666d4
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/numeric.sql
@@ -0,0 +1,1365 @@
+--
+-- NUMERIC
+--
+
+CREATE TABLE num_data (id int4, val numeric(210,10));
+CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric(210,10));
+CREATE TABLE num_exp_sqrt (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_ln (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_log10 (id int4, expected numeric(210,10));
+CREATE TABLE num_exp_power_10_ln (id int4, expected numeric(210,10));
+
+CREATE TABLE num_result (id1 int4, id2 int4, result numeric(210,10));
+
+
+-- ******************************
+-- * The following EXPECTED results are computed by bc(1)
+-- * with a scale of 200
+-- ******************************
+
+BEGIN TRANSACTION;
+INSERT INTO num_exp_add VALUES (0,0,'0');
+INSERT INTO num_exp_sub VALUES (0,0,'0');
+INSERT INTO num_exp_mul VALUES (0,0,'0');
+INSERT INTO num_exp_div VALUES (0,0,'NaN');
+INSERT INTO num_exp_add VALUES (0,1,'0');
+INSERT INTO num_exp_sub VALUES (0,1,'0');
+INSERT INTO num_exp_mul VALUES (0,1,'0');
+INSERT INTO num_exp_div VALUES (0,1,'NaN');
+INSERT INTO num_exp_add VALUES (0,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (0,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (0,2,'0');
+INSERT INTO num_exp_div VALUES (0,2,'0');
+INSERT INTO num_exp_add VALUES (0,3,'4.31');
+INSERT INTO num_exp_sub VALUES (0,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (0,3,'0');
+INSERT INTO num_exp_div VALUES (0,3,'0');
+INSERT INTO num_exp_add VALUES (0,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (0,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (0,4,'0');
+INSERT INTO num_exp_div VALUES (0,4,'0');
+INSERT INTO num_exp_add VALUES (0,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (0,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (0,5,'0');
+INSERT INTO num_exp_div VALUES (0,5,'0');
+INSERT INTO num_exp_add VALUES (0,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (0,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (0,6,'0');
+INSERT INTO num_exp_div VALUES (0,6,'0');
+INSERT INTO num_exp_add VALUES (0,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (0,7,'83028485');
+INSERT INTO num_exp_mul VALUES (0,7,'0');
+INSERT INTO num_exp_div VALUES (0,7,'0');
+INSERT INTO num_exp_add VALUES (0,8,'74881');
+INSERT INTO num_exp_sub VALUES (0,8,'-74881');
+INSERT INTO num_exp_mul VALUES (0,8,'0');
+INSERT INTO num_exp_div VALUES (0,8,'0');
+INSERT INTO num_exp_add VALUES (0,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (0,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (0,9,'0');
+INSERT INTO num_exp_div VALUES (0,9,'0');
+INSERT INTO num_exp_add VALUES (1,0,'0');
+INSERT INTO num_exp_sub VALUES (1,0,'0');
+INSERT INTO num_exp_mul VALUES (1,0,'0');
+INSERT INTO num_exp_div VALUES (1,0,'NaN');
+INSERT INTO num_exp_add VALUES (1,1,'0');
+INSERT INTO num_exp_sub VALUES (1,1,'0');
+INSERT INTO num_exp_mul VALUES (1,1,'0');
+INSERT INTO num_exp_div VALUES (1,1,'NaN');
+INSERT INTO num_exp_add VALUES (1,2,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (1,2,'34338492.215397047');
+INSERT INTO num_exp_mul VALUES (1,2,'0');
+INSERT INTO num_exp_div VALUES (1,2,'0');
+INSERT INTO num_exp_add VALUES (1,3,'4.31');
+INSERT INTO num_exp_sub VALUES (1,3,'-4.31');
+INSERT INTO num_exp_mul VALUES (1,3,'0');
+INSERT INTO num_exp_div VALUES (1,3,'0');
+INSERT INTO num_exp_add VALUES (1,4,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (1,4,'-7799461.4119');
+INSERT INTO num_exp_mul VALUES (1,4,'0');
+INSERT INTO num_exp_div VALUES (1,4,'0');
+INSERT INTO num_exp_add VALUES (1,5,'16397.038491');
+INSERT INTO num_exp_sub VALUES (1,5,'-16397.038491');
+INSERT INTO num_exp_mul VALUES (1,5,'0');
+INSERT INTO num_exp_div VALUES (1,5,'0');
+INSERT INTO num_exp_add VALUES (1,6,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (1,6,'-93901.57763026');
+INSERT INTO num_exp_mul VALUES (1,6,'0');
+INSERT INTO num_exp_div VALUES (1,6,'0');
+INSERT INTO num_exp_add VALUES (1,7,'-83028485');
+INSERT INTO num_exp_sub VALUES (1,7,'83028485');
+INSERT INTO num_exp_mul VALUES (1,7,'0');
+INSERT INTO num_exp_div VALUES (1,7,'0');
+INSERT INTO num_exp_add VALUES (1,8,'74881');
+INSERT INTO num_exp_sub VALUES (1,8,'-74881');
+INSERT INTO num_exp_mul VALUES (1,8,'0');
+INSERT INTO num_exp_div VALUES (1,8,'0');
+INSERT INTO num_exp_add VALUES (1,9,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (1,9,'24926804.045047420');
+INSERT INTO num_exp_mul VALUES (1,9,'0');
+INSERT INTO num_exp_div VALUES (1,9,'0');
+INSERT INTO num_exp_add VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,0,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,0,'0');
+INSERT INTO num_exp_div VALUES (2,0,'NaN');
+INSERT INTO num_exp_add VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_sub VALUES (2,1,'-34338492.215397047');
+INSERT INTO num_exp_mul VALUES (2,1,'0');
+INSERT INTO num_exp_div VALUES (2,1,'NaN');
+INSERT INTO num_exp_add VALUES (2,2,'-68676984.430794094');
+INSERT INTO num_exp_sub VALUES (2,2,'0');
+INSERT INTO num_exp_mul VALUES (2,2,'1179132047626883.596862135856320209');
+INSERT INTO num_exp_div VALUES (2,2,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (2,3,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (2,3,'-34338496.525397047');
+INSERT INTO num_exp_mul VALUES (2,3,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (2,3,'-7967167.56737750510440835266');
+INSERT INTO num_exp_add VALUES (2,4,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (2,4,'-42137953.627297047');
+INSERT INTO num_exp_mul VALUES (2,4,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (2,4,'-4.40267480046830116685');
+INSERT INTO num_exp_add VALUES (2,5,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (2,5,'-34354889.253888047');
+INSERT INTO num_exp_mul VALUES (2,5,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (2,5,'-2094.18866914563535496429');
+INSERT INTO num_exp_add VALUES (2,6,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (2,6,'-34432393.793027307');
+INSERT INTO num_exp_mul VALUES (2,6,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (2,6,'-365.68599891479766440940');
+INSERT INTO num_exp_add VALUES (2,7,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (2,7,'48689992.784602953');
+INSERT INTO num_exp_mul VALUES (2,7,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (2,7,'.41357483778485235518');
+INSERT INTO num_exp_add VALUES (2,8,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (2,8,'-34413373.215397047');
+INSERT INTO num_exp_mul VALUES (2,8,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (2,8,'-458.57416721727870888476');
+INSERT INTO num_exp_add VALUES (2,9,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (2,9,'-9411688.170349627');
+INSERT INTO num_exp_mul VALUES (2,9,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (2,9,'1.37757299946438931811');
+INSERT INTO num_exp_add VALUES (3,0,'4.31');
+INSERT INTO num_exp_sub VALUES (3,0,'4.31');
+INSERT INTO num_exp_mul VALUES (3,0,'0');
+INSERT INTO num_exp_div VALUES (3,0,'NaN');
+INSERT INTO num_exp_add VALUES (3,1,'4.31');
+INSERT INTO num_exp_sub VALUES (3,1,'4.31');
+INSERT INTO num_exp_mul VALUES (3,1,'0');
+INSERT INTO num_exp_div VALUES (3,1,'NaN');
+INSERT INTO num_exp_add VALUES (3,2,'-34338487.905397047');
+INSERT INTO num_exp_sub VALUES (3,2,'34338496.525397047');
+INSERT INTO num_exp_mul VALUES (3,2,'-147998901.44836127257');
+INSERT INTO num_exp_div VALUES (3,2,'-.00000012551512084352');
+INSERT INTO num_exp_add VALUES (3,3,'8.62');
+INSERT INTO num_exp_sub VALUES (3,3,'0');
+INSERT INTO num_exp_mul VALUES (3,3,'18.5761');
+INSERT INTO num_exp_div VALUES (3,3,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (3,4,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (3,4,'-7799457.1019');
+INSERT INTO num_exp_mul VALUES (3,4,'33615678.685289');
+INSERT INTO num_exp_div VALUES (3,4,'.00000055260225961552');
+INSERT INTO num_exp_add VALUES (3,5,'16401.348491');
+INSERT INTO num_exp_sub VALUES (3,5,'-16392.728491');
+INSERT INTO num_exp_mul VALUES (3,5,'70671.23589621');
+INSERT INTO num_exp_div VALUES (3,5,'.00026285234387695504');
+INSERT INTO num_exp_add VALUES (3,6,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (3,6,'-93897.26763026');
+INSERT INTO num_exp_mul VALUES (3,6,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (3,6,'.00004589912234457595');
+INSERT INTO num_exp_add VALUES (3,7,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (3,7,'83028489.31');
+INSERT INTO num_exp_mul VALUES (3,7,'-357852770.35');
+INSERT INTO num_exp_div VALUES (3,7,'-.00000005190989574240');
+INSERT INTO num_exp_add VALUES (3,8,'74885.31');
+INSERT INTO num_exp_sub VALUES (3,8,'-74876.69');
+INSERT INTO num_exp_mul VALUES (3,8,'322737.11');
+INSERT INTO num_exp_div VALUES (3,8,'.00005755799201399553');
+INSERT INTO num_exp_add VALUES (3,9,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (3,9,'24926808.355047420');
+INSERT INTO num_exp_mul VALUES (3,9,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (3,9,'-.00000017290624149854');
+INSERT INTO num_exp_add VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,0,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,0,'0');
+INSERT INTO num_exp_div VALUES (4,0,'NaN');
+INSERT INTO num_exp_add VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_sub VALUES (4,1,'7799461.4119');
+INSERT INTO num_exp_mul VALUES (4,1,'0');
+INSERT INTO num_exp_div VALUES (4,1,'NaN');
+INSERT INTO num_exp_add VALUES (4,2,'-26539030.803497047');
+INSERT INTO num_exp_sub VALUES (4,2,'42137953.627297047');
+INSERT INTO num_exp_mul VALUES (4,2,'-267821744976817.8111137106593');
+INSERT INTO num_exp_div VALUES (4,2,'-.22713465002993920385');
+INSERT INTO num_exp_add VALUES (4,3,'7799465.7219');
+INSERT INTO num_exp_sub VALUES (4,3,'7799457.1019');
+INSERT INTO num_exp_mul VALUES (4,3,'33615678.685289');
+INSERT INTO num_exp_div VALUES (4,3,'1809619.81714617169373549883');
+INSERT INTO num_exp_add VALUES (4,4,'15598922.8238');
+INSERT INTO num_exp_sub VALUES (4,4,'0');
+INSERT INTO num_exp_mul VALUES (4,4,'60831598315717.14146161');
+INSERT INTO num_exp_div VALUES (4,4,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (4,5,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (4,5,'7783064.373409');
+INSERT INTO num_exp_mul VALUES (4,5,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (4,5,'475.66281046305802686061');
+INSERT INTO num_exp_add VALUES (4,6,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (4,6,'7705559.83426974');
+INSERT INTO num_exp_mul VALUES (4,6,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (4,6,'83.05996138436129499606');
+INSERT INTO num_exp_add VALUES (4,7,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (4,7,'90827946.4119');
+INSERT INTO num_exp_mul VALUES (4,7,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (4,7,'-.09393717604145131637');
+INSERT INTO num_exp_add VALUES (4,8,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (4,8,'7724580.4119');
+INSERT INTO num_exp_mul VALUES (4,8,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (4,8,'104.15808298366741897143');
+INSERT INTO num_exp_add VALUES (4,9,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (4,9,'32726265.456947420');
+INSERT INTO num_exp_mul VALUES (4,9,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (4,9,'-.31289456112403769409');
+INSERT INTO num_exp_add VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,0,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,0,'0');
+INSERT INTO num_exp_div VALUES (5,0,'NaN');
+INSERT INTO num_exp_add VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_sub VALUES (5,1,'16397.038491');
+INSERT INTO num_exp_mul VALUES (5,1,'0');
+INSERT INTO num_exp_div VALUES (5,1,'NaN');
+INSERT INTO num_exp_add VALUES (5,2,'-34322095.176906047');
+INSERT INTO num_exp_sub VALUES (5,2,'34354889.253888047');
+INSERT INTO num_exp_mul VALUES (5,2,'-563049578578.769242506736077');
+INSERT INTO num_exp_div VALUES (5,2,'-.00047751189505192446');
+INSERT INTO num_exp_add VALUES (5,3,'16401.348491');
+INSERT INTO num_exp_sub VALUES (5,3,'16392.728491');
+INSERT INTO num_exp_mul VALUES (5,3,'70671.23589621');
+INSERT INTO num_exp_div VALUES (5,3,'3804.41728329466357308584');
+INSERT INTO num_exp_add VALUES (5,4,'7815858.450391');
+INSERT INTO num_exp_sub VALUES (5,4,'-7783064.373409');
+INSERT INTO num_exp_mul VALUES (5,4,'127888068979.9935054429');
+INSERT INTO num_exp_div VALUES (5,4,'.00210232958726897192');
+INSERT INTO num_exp_add VALUES (5,5,'32794.076982');
+INSERT INTO num_exp_sub VALUES (5,5,'0');
+INSERT INTO num_exp_mul VALUES (5,5,'268862871.275335557081');
+INSERT INTO num_exp_div VALUES (5,5,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (5,6,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (5,6,'-77504.53913926');
+INSERT INTO num_exp_mul VALUES (5,6,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (5,6,'.17461941433576102689');
+INSERT INTO num_exp_add VALUES (5,7,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (5,7,'83044882.038491');
+INSERT INTO num_exp_mul VALUES (5,7,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (5,7,'-.00019748690453643710');
+INSERT INTO num_exp_add VALUES (5,8,'91278.038491');
+INSERT INTO num_exp_sub VALUES (5,8,'-58483.961509');
+INSERT INTO num_exp_mul VALUES (5,8,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (5,8,'.21897461960978085228');
+INSERT INTO num_exp_add VALUES (5,9,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (5,9,'24943201.083538420');
+INSERT INTO num_exp_mul VALUES (5,9,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (5,9,'-.00065780749354660427');
+INSERT INTO num_exp_add VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,0,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,0,'0');
+INSERT INTO num_exp_div VALUES (6,0,'NaN');
+INSERT INTO num_exp_add VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_sub VALUES (6,1,'93901.57763026');
+INSERT INTO num_exp_mul VALUES (6,1,'0');
+INSERT INTO num_exp_div VALUES (6,1,'NaN');
+INSERT INTO num_exp_add VALUES (6,2,'-34244590.637766787');
+INSERT INTO num_exp_sub VALUES (6,2,'34432393.793027307');
+INSERT INTO num_exp_mul VALUES (6,2,'-3224438592470.18449811926184222');
+INSERT INTO num_exp_div VALUES (6,2,'-.00273458651128995823');
+INSERT INTO num_exp_add VALUES (6,3,'93905.88763026');
+INSERT INTO num_exp_sub VALUES (6,3,'93897.26763026');
+INSERT INTO num_exp_mul VALUES (6,3,'404715.7995864206');
+INSERT INTO num_exp_div VALUES (6,3,'21786.90896293735498839907');
+INSERT INTO num_exp_add VALUES (6,4,'7893362.98953026');
+INSERT INTO num_exp_sub VALUES (6,4,'-7705559.83426974');
+INSERT INTO num_exp_mul VALUES (6,4,'732381731243.745115764094');
+INSERT INTO num_exp_div VALUES (6,4,'.01203949512295682469');
+INSERT INTO num_exp_add VALUES (6,5,'110298.61612126');
+INSERT INTO num_exp_sub VALUES (6,5,'77504.53913926');
+INSERT INTO num_exp_mul VALUES (6,5,'1539707782.76899778633766');
+INSERT INTO num_exp_div VALUES (6,5,'5.72674008674192359679');
+INSERT INTO num_exp_add VALUES (6,6,'187803.15526052');
+INSERT INTO num_exp_sub VALUES (6,6,'0');
+INSERT INTO num_exp_mul VALUES (6,6,'8817506281.4517452372676676');
+INSERT INTO num_exp_div VALUES (6,6,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (6,7,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (6,7,'83122386.57763026');
+INSERT INTO num_exp_mul VALUES (6,7,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (6,7,'-.00113095617281538980');
+INSERT INTO num_exp_add VALUES (6,8,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (6,8,'19020.57763026');
+INSERT INTO num_exp_mul VALUES (6,8,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (6,8,'1.25401073209839612184');
+INSERT INTO num_exp_add VALUES (6,9,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (6,9,'25020705.622677680');
+INSERT INTO num_exp_mul VALUES (6,9,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (6,9,'-.00376709254265256789');
+INSERT INTO num_exp_add VALUES (7,0,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,0,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,0,'0');
+INSERT INTO num_exp_div VALUES (7,0,'NaN');
+INSERT INTO num_exp_add VALUES (7,1,'-83028485');
+INSERT INTO num_exp_sub VALUES (7,1,'-83028485');
+INSERT INTO num_exp_mul VALUES (7,1,'0');
+INSERT INTO num_exp_div VALUES (7,1,'NaN');
+INSERT INTO num_exp_add VALUES (7,2,'-117366977.215397047');
+INSERT INTO num_exp_sub VALUES (7,2,'-48689992.784602953');
+INSERT INTO num_exp_mul VALUES (7,2,'2851072985828710.485883795');
+INSERT INTO num_exp_div VALUES (7,2,'2.41794207151503385700');
+INSERT INTO num_exp_add VALUES (7,3,'-83028480.69');
+INSERT INTO num_exp_sub VALUES (7,3,'-83028489.31');
+INSERT INTO num_exp_mul VALUES (7,3,'-357852770.35');
+INSERT INTO num_exp_div VALUES (7,3,'-19264149.65197215777262180974');
+INSERT INTO num_exp_add VALUES (7,4,'-75229023.5881');
+INSERT INTO num_exp_sub VALUES (7,4,'-90827946.4119');
+INSERT INTO num_exp_mul VALUES (7,4,'-647577464846017.9715');
+INSERT INTO num_exp_div VALUES (7,4,'-10.64541262725136247686');
+INSERT INTO num_exp_add VALUES (7,5,'-83012087.961509');
+INSERT INTO num_exp_sub VALUES (7,5,'-83044882.038491');
+INSERT INTO num_exp_mul VALUES (7,5,'-1361421264394.416135');
+INSERT INTO num_exp_div VALUES (7,5,'-5063.62688881730941836574');
+INSERT INTO num_exp_add VALUES (7,6,'-82934583.42236974');
+INSERT INTO num_exp_sub VALUES (7,6,'-83122386.57763026');
+INSERT INTO num_exp_mul VALUES (7,6,'-7796505729750.37795610');
+INSERT INTO num_exp_div VALUES (7,6,'-884.20756174009028770294');
+INSERT INTO num_exp_add VALUES (7,7,'-166056970');
+INSERT INTO num_exp_sub VALUES (7,7,'0');
+INSERT INTO num_exp_mul VALUES (7,7,'6893729321395225');
+INSERT INTO num_exp_div VALUES (7,7,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (7,8,'-82953604');
+INSERT INTO num_exp_sub VALUES (7,8,'-83103366');
+INSERT INTO num_exp_mul VALUES (7,8,'-6217255985285');
+INSERT INTO num_exp_div VALUES (7,8,'-1108.80577182462841041118');
+INSERT INTO num_exp_add VALUES (7,9,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (7,9,'-58101680.954952580');
+INSERT INTO num_exp_mul VALUES (7,9,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (7,9,'3.33089171198810413382');
+INSERT INTO num_exp_add VALUES (8,0,'74881');
+INSERT INTO num_exp_sub VALUES (8,0,'74881');
+INSERT INTO num_exp_mul VALUES (8,0,'0');
+INSERT INTO num_exp_div VALUES (8,0,'NaN');
+INSERT INTO num_exp_add VALUES (8,1,'74881');
+INSERT INTO num_exp_sub VALUES (8,1,'74881');
+INSERT INTO num_exp_mul VALUES (8,1,'0');
+INSERT INTO num_exp_div VALUES (8,1,'NaN');
+INSERT INTO num_exp_add VALUES (8,2,'-34263611.215397047');
+INSERT INTO num_exp_sub VALUES (8,2,'34413373.215397047');
+INSERT INTO num_exp_mul VALUES (8,2,'-2571300635581.146276407');
+INSERT INTO num_exp_div VALUES (8,2,'-.00218067233500788615');
+INSERT INTO num_exp_add VALUES (8,3,'74885.31');
+INSERT INTO num_exp_sub VALUES (8,3,'74876.69');
+INSERT INTO num_exp_mul VALUES (8,3,'322737.11');
+INSERT INTO num_exp_div VALUES (8,3,'17373.78190255220417633410');
+INSERT INTO num_exp_add VALUES (8,4,'7874342.4119');
+INSERT INTO num_exp_sub VALUES (8,4,'-7724580.4119');
+INSERT INTO num_exp_mul VALUES (8,4,'584031469984.4839');
+INSERT INTO num_exp_div VALUES (8,4,'.00960079113741758956');
+INSERT INTO num_exp_add VALUES (8,5,'91278.038491');
+INSERT INTO num_exp_sub VALUES (8,5,'58483.961509');
+INSERT INTO num_exp_mul VALUES (8,5,'1227826639.244571');
+INSERT INTO num_exp_div VALUES (8,5,'4.56673929509287019456');
+INSERT INTO num_exp_add VALUES (8,6,'168782.57763026');
+INSERT INTO num_exp_sub VALUES (8,6,'-19020.57763026');
+INSERT INTO num_exp_mul VALUES (8,6,'7031444034.53149906');
+INSERT INTO num_exp_div VALUES (8,6,'.79744134113322314424');
+INSERT INTO num_exp_add VALUES (8,7,'-82953604');
+INSERT INTO num_exp_sub VALUES (8,7,'83103366');
+INSERT INTO num_exp_mul VALUES (8,7,'-6217255985285');
+INSERT INTO num_exp_div VALUES (8,7,'-.00090187120721280172');
+INSERT INTO num_exp_add VALUES (8,8,'149762');
+INSERT INTO num_exp_sub VALUES (8,8,'0');
+INSERT INTO num_exp_mul VALUES (8,8,'5607164161');
+INSERT INTO num_exp_div VALUES (8,8,'1.00000000000000000000');
+INSERT INTO num_exp_add VALUES (8,9,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (8,9,'25001685.045047420');
+INSERT INTO num_exp_mul VALUES (8,9,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (8,9,'-.00300403532938582735');
+INSERT INTO num_exp_add VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,0,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,0,'0');
+INSERT INTO num_exp_div VALUES (9,0,'NaN');
+INSERT INTO num_exp_add VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_sub VALUES (9,1,'-24926804.045047420');
+INSERT INTO num_exp_mul VALUES (9,1,'0');
+INSERT INTO num_exp_div VALUES (9,1,'NaN');
+INSERT INTO num_exp_add VALUES (9,2,'-59265296.260444467');
+INSERT INTO num_exp_sub VALUES (9,2,'9411688.170349627');
+INSERT INTO num_exp_mul VALUES (9,2,'855948866655588.453741509242968740');
+INSERT INTO num_exp_div VALUES (9,2,'.72591434384152961526');
+INSERT INTO num_exp_add VALUES (9,3,'-24926799.735047420');
+INSERT INTO num_exp_sub VALUES (9,3,'-24926808.355047420');
+INSERT INTO num_exp_mul VALUES (9,3,'-107434525.43415438020');
+INSERT INTO num_exp_div VALUES (9,3,'-5783481.21694835730858468677');
+INSERT INTO num_exp_add VALUES (9,4,'-17127342.633147420');
+INSERT INTO num_exp_sub VALUES (9,4,'-32726265.456947420');
+INSERT INTO num_exp_mul VALUES (9,4,'-194415646271340.1815956522980');
+INSERT INTO num_exp_div VALUES (9,4,'-3.19596478892958416484');
+INSERT INTO num_exp_add VALUES (9,5,'-24910407.006556420');
+INSERT INTO num_exp_sub VALUES (9,5,'-24943201.083538420');
+INSERT INTO num_exp_mul VALUES (9,5,'-408725765384.257043660243220');
+INSERT INTO num_exp_div VALUES (9,5,'-1520.20159364322004505807');
+INSERT INTO num_exp_add VALUES (9,6,'-24832902.467417160');
+INSERT INTO num_exp_sub VALUES (9,6,'-25020705.622677680');
+INSERT INTO num_exp_mul VALUES (9,6,'-2340666225110.29929521292692920');
+INSERT INTO num_exp_div VALUES (9,6,'-265.45671195426965751280');
+INSERT INTO num_exp_add VALUES (9,7,'-107955289.045047420');
+INSERT INTO num_exp_sub VALUES (9,7,'58101680.954952580');
+INSERT INTO num_exp_mul VALUES (9,7,'2069634775752159.035758700');
+INSERT INTO num_exp_div VALUES (9,7,'.30021990699995814689');
+INSERT INTO num_exp_add VALUES (9,8,'-24851923.045047420');
+INSERT INTO num_exp_sub VALUES (9,8,'-25001685.045047420');
+INSERT INTO num_exp_mul VALUES (9,8,'-1866544013697.195857020');
+INSERT INTO num_exp_div VALUES (9,8,'-332.88556569820675471748');
+INSERT INTO num_exp_add VALUES (9,9,'-49853608.090094840');
+INSERT INTO num_exp_sub VALUES (9,9,'0');
+INSERT INTO num_exp_mul VALUES (9,9,'621345559900192.420120630048656400');
+INSERT INTO num_exp_div VALUES (9,9,'1.00000000000000000000');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_sqrt VALUES (0,'0');
+INSERT INTO num_exp_sqrt VALUES (1,'0');
+INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505');
+INSERT INTO num_exp_sqrt VALUES (3,'2.07605394920266944396');
+INSERT INTO num_exp_sqrt VALUES (4,'2792.75158435189147418923');
+INSERT INTO num_exp_sqrt VALUES (5,'128.05092147657509145473');
+INSERT INTO num_exp_sqrt VALUES (6,'306.43364311096782703406');
+INSERT INTO num_exp_sqrt VALUES (7,'9111.99676251039939975230');
+INSERT INTO num_exp_sqrt VALUES (8,'273.64392922189960397542');
+INSERT INTO num_exp_sqrt VALUES (9,'4992.67503899937593364766');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_ln VALUES (0,'NaN');
+INSERT INTO num_exp_ln VALUES (1,'NaN');
+INSERT INTO num_exp_ln VALUES (2,'17.35177750493897715514');
+INSERT INTO num_exp_ln VALUES (3,'1.46093790411565641971');
+INSERT INTO num_exp_ln VALUES (4,'15.86956523951936572464');
+INSERT INTO num_exp_ln VALUES (5,'9.70485601768871834038');
+INSERT INTO num_exp_ln VALUES (6,'11.45000246622944403127');
+INSERT INTO num_exp_ln VALUES (7,'18.23469429965478772991');
+INSERT INTO num_exp_ln VALUES (8,'11.22365546576315513668');
+INSERT INTO num_exp_ln VALUES (9,'17.03145425013166006962');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_log10 VALUES (0,'NaN');
+INSERT INTO num_exp_log10 VALUES (1,'NaN');
+INSERT INTO num_exp_log10 VALUES (2,'7.53578122160797276459');
+INSERT INTO num_exp_log10 VALUES (3,'.63447727016073160075');
+INSERT INTO num_exp_log10 VALUES (4,'6.89206461372691743345');
+INSERT INTO num_exp_log10 VALUES (5,'4.21476541614777768626');
+INSERT INTO num_exp_log10 VALUES (6,'4.97267288886207207671');
+INSERT INTO num_exp_log10 VALUES (7,'7.91922711353275546914');
+INSERT INTO num_exp_log10 VALUES (8,'4.87437163556421004138');
+INSERT INTO num_exp_log10 VALUES (9,'7.39666659961986567059');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
+INSERT INTO num_exp_power_10_ln VALUES (2,'224790267919917955.13261618583642653184');
+INSERT INTO num_exp_power_10_ln VALUES (3,'28.90266599445155957393');
+INSERT INTO num_exp_power_10_ln VALUES (4,'7405685069594999.07733999469386277636');
+INSERT INTO num_exp_power_10_ln VALUES (5,'5068226527.32127265408584640098');
+INSERT INTO num_exp_power_10_ln VALUES (6,'281839893606.99372343357047819067');
+INSERT INTO num_exp_power_10_ln VALUES (7,'1716699575118597095.42330819910640247627');
+INSERT INTO num_exp_power_10_ln VALUES (8,'167361463828.07491320069016125952');
+INSERT INTO num_exp_power_10_ln VALUES (9,'107511333880052007.04141124673540337457');
+COMMIT TRANSACTION;
+BEGIN TRANSACTION;
+INSERT INTO num_data VALUES (0, '0');
+INSERT INTO num_data VALUES (1, '0');
+INSERT INTO num_data VALUES (2, '-34338492.215397047');
+INSERT INTO num_data VALUES (3, '4.31');
+INSERT INTO num_data VALUES (4, '7799461.4119');
+INSERT INTO num_data VALUES (5, '16397.038491');
+INSERT INTO num_data VALUES (6, '93901.57763026');
+INSERT INTO num_data VALUES (7, '-83028485');
+INSERT INTO num_data VALUES (8, '74881');
+INSERT INTO num_data VALUES (9, '-24926804.045047420');
+COMMIT TRANSACTION;
+
+-- ******************************
+-- * Create indices for faster checks
+-- ******************************
+
+CREATE UNIQUE INDEX num_exp_add_idx ON num_exp_add (id1, id2);
+CREATE UNIQUE INDEX num_exp_sub_idx ON num_exp_sub (id1, id2);
+CREATE UNIQUE INDEX num_exp_div_idx ON num_exp_div (id1, id2);
+CREATE UNIQUE INDEX num_exp_mul_idx ON num_exp_mul (id1, id2);
+CREATE UNIQUE INDEX num_exp_sqrt_idx ON num_exp_sqrt (id);
+CREATE UNIQUE INDEX num_exp_ln_idx ON num_exp_ln (id);
+CREATE UNIQUE INDEX num_exp_log10_idx ON num_exp_log10 (id);
+CREATE UNIQUE INDEX num_exp_power_10_ln_idx ON num_exp_power_10_ln (id);
+
+VACUUM ANALYZE num_exp_add;
+VACUUM ANALYZE num_exp_sub;
+VACUUM ANALYZE num_exp_div;
+VACUUM ANALYZE num_exp_mul;
+VACUUM ANALYZE num_exp_sqrt;
+VACUUM ANALYZE num_exp_ln;
+VACUUM ANALYZE num_exp_log10;
+VACUUM ANALYZE num_exp_power_10_ln;
+
+-- ******************************
+-- * Now check the behaviour of the NUMERIC type
+-- ******************************
+
+-- ******************************
+-- * Addition check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+ FROM num_result t1, num_exp_add t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 10);
+
+-- ******************************
+-- * Subtraction check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+ FROM num_result t1, num_exp_sub t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 40);
+
+-- ******************************
+-- * Multiply check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val * t2.val
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+ FROM num_data t1, num_data t2;
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+ FROM num_result t1, num_exp_mul t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 30);
+
+-- ******************************
+-- * Division check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != t2.expected;
+
+DELETE FROM num_result;
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+ FROM num_data t1, num_data t2
+ WHERE t2.val != '0.0';
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+ FROM num_result t1, num_exp_div t2
+ WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+ AND t1.result != round(t2.expected, 80);
+
+-- ******************************
+-- * Square root check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+ FROM num_data;
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_sqrt t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+
+-- ******************************
+-- * Natural logarithm check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+
+-- ******************************
+-- * Logarithm base 10 check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, LOG(numeric '10', ABS(val))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_log10 t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+
+-- ******************************
+-- * POWER(10, LN(value)) check
+-- ******************************
+DELETE FROM num_result;
+INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
+ FROM num_data
+ WHERE val != '0.0';
+SELECT t1.id1, t1.result, t2.expected
+ FROM num_result t1, num_exp_power_10_ln t2
+ WHERE t1.id1 = t2.id
+ AND t1.result != t2.expected;
+
+-- ******************************
+-- * Check behavior with Inf and NaN inputs. It's easiest to handle these
+-- * separately from the num_data framework used above, because some input
+-- * combinations will throw errors.
+-- ******************************
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 + x2 AS sum,
+ x1 - x2 AS diff,
+ x1 * x2 AS prod
+FROM v AS v1(x1), v AS v2(x2);
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('inf'),('-inf'),('nan'))
+SELECT x1, x2,
+ x1 / x2 AS quot,
+ x1 % x2 AS mod,
+ div(x1, x2) AS div
+FROM v AS v1(x1), v AS v2(x2) WHERE x2 != 0;
+
+SELECT 'inf'::numeric / '0';
+SELECT '-inf'::numeric / '0';
+SELECT 'nan'::numeric / '0';
+SELECT '0'::numeric / '0';
+SELECT 'inf'::numeric % '0';
+SELECT '-inf'::numeric % '0';
+SELECT 'nan'::numeric % '0';
+SELECT '0'::numeric % '0';
+SELECT div('inf'::numeric, '0');
+SELECT div('-inf'::numeric, '0');
+SELECT div('nan'::numeric, '0');
+SELECT div('0'::numeric, '0');
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, -x as minusx, abs(x), floor(x), ceil(x), sign(x), numeric_inc(x) as inc
+FROM v;
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('inf'),('-inf'),('nan'))
+SELECT x, round(x), round(x,1) as round1, trunc(x), trunc(x,1) as trunc1
+FROM v;
+
+-- the large values fall into the numeric abbreviation code's maximal classes
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
+ ('inf'),('-inf'),('nan'),
+ ('inf'),('-inf'),('nan'))
+SELECT substring(x::text, 1, 32)
+FROM v ORDER BY x;
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('4.2'),('inf'),('nan'))
+SELECT x, sqrt(x)
+FROM v;
+
+SELECT sqrt('-1'::numeric);
+SELECT sqrt('-inf'::numeric);
+
+WITH v(x) AS
+ (VALUES('1'::numeric),('4.2'),('inf'),('nan'))
+SELECT x,
+ log(x),
+ log10(x),
+ ln(x)
+FROM v;
+
+SELECT ln('0'::numeric);
+SELECT ln('-1'::numeric);
+SELECT ln('-inf'::numeric);
+
+WITH v(x) AS
+ (VALUES('2'::numeric),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ log(x1, x2)
+FROM v AS v1(x1), v AS v2(x2);
+
+SELECT log('0'::numeric, '10');
+SELECT log('10'::numeric, '0');
+SELECT log('-inf'::numeric, '10');
+SELECT log('10'::numeric, '-inf');
+SELECT log('inf'::numeric, '0');
+SELECT log('inf'::numeric, '-inf');
+SELECT log('-inf'::numeric, 'inf');
+
+WITH v(x) AS
+ (VALUES('0'::numeric),('1'),('2'),('4.2'),('inf'),('nan'))
+SELECT x1, x2,
+ power(x1, x2)
+FROM v AS v1(x1), v AS v2(x2) WHERE x1 != 0 OR x2 >= 0;
+
+SELECT power('0'::numeric, '-1');
+SELECT power('0'::numeric, '-inf');
+SELECT power('-1'::numeric, 'inf');
+SELECT power('-2'::numeric, '3');
+SELECT power('-2'::numeric, '3.3');
+SELECT power('-2'::numeric, '-1');
+SELECT power('-2'::numeric, '-1.5');
+SELECT power('-2'::numeric, 'inf');
+SELECT power('-2'::numeric, '-inf');
+SELECT power('inf'::numeric, '-2');
+SELECT power('inf'::numeric, '-inf');
+SELECT power('-inf'::numeric, '2');
+SELECT power('-inf'::numeric, '3');
+SELECT power('-inf'::numeric, '4.5');
+SELECT power('-inf'::numeric, '-2');
+SELECT power('-inf'::numeric, '-3');
+SELECT power('-inf'::numeric, '0');
+SELECT power('-inf'::numeric, 'inf');
+SELECT power('-inf'::numeric, '-inf');
+
+-- ******************************
+-- * miscellaneous checks for things that have been broken in the past...
+-- ******************************
+-- numeric AVG used to fail on some platforms
+SELECT AVG(val) FROM num_data;
+SELECT MAX(val) FROM num_data;
+SELECT MIN(val) FROM num_data;
+SELECT STDDEV(val) FROM num_data;
+SELECT VARIANCE(val) FROM num_data;
+
+-- Check for appropriate rounding and overflow
+CREATE TABLE fract_only (id int, val numeric(4,4));
+INSERT INTO fract_only VALUES (1, '0.0');
+INSERT INTO fract_only VALUES (2, '0.1');
+INSERT INTO fract_only VALUES (3, '1.0'); -- should fail
+INSERT INTO fract_only VALUES (4, '-0.9999');
+INSERT INTO fract_only VALUES (5, '0.99994');
+INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail
+INSERT INTO fract_only VALUES (7, '0.00001');
+INSERT INTO fract_only VALUES (8, '0.00017');
+INSERT INTO fract_only VALUES (9, 'NaN');
+INSERT INTO fract_only VALUES (10, 'Inf'); -- should fail
+INSERT INTO fract_only VALUES (11, '-Inf'); -- should fail
+SELECT * FROM fract_only;
+DROP TABLE fract_only;
+
+-- Check conversion to integers
+SELECT (-9223372036854775808.5)::int8; -- should fail
+SELECT (-9223372036854775808.4)::int8; -- ok
+SELECT 9223372036854775807.4::int8; -- ok
+SELECT 9223372036854775807.5::int8; -- should fail
+SELECT (-2147483648.5)::int4; -- should fail
+SELECT (-2147483648.4)::int4; -- ok
+SELECT 2147483647.4::int4; -- ok
+SELECT 2147483647.5::int4; -- should fail
+SELECT (-32768.5)::int2; -- should fail
+SELECT (-32768.4)::int2; -- ok
+SELECT 32767.4::int2; -- ok
+SELECT 32767.5::int2; -- should fail
+
+-- Check inf/nan conversion behavior
+SELECT 'NaN'::float8::numeric;
+SELECT 'Infinity'::float8::numeric;
+SELECT '-Infinity'::float8::numeric;
+SELECT 'NaN'::numeric::float8;
+SELECT 'Infinity'::numeric::float8;
+SELECT '-Infinity'::numeric::float8;
+SELECT 'NaN'::float4::numeric;
+SELECT 'Infinity'::float4::numeric;
+SELECT '-Infinity'::float4::numeric;
+SELECT 'NaN'::numeric::float4;
+SELECT 'Infinity'::numeric::float4;
+SELECT '-Infinity'::numeric::float4;
+SELECT '42'::int2::numeric;
+SELECT 'NaN'::numeric::int2;
+SELECT 'Infinity'::numeric::int2;
+SELECT '-Infinity'::numeric::int2;
+SELECT 'NaN'::numeric::int4;
+SELECT 'Infinity'::numeric::int4;
+SELECT '-Infinity'::numeric::int4;
+SELECT 'NaN'::numeric::int8;
+SELECT 'Infinity'::numeric::int8;
+SELECT '-Infinity'::numeric::int8;
+
+-- Simple check that ceil(), floor(), and round() work correctly
+CREATE TABLE ceil_floor_round (a numeric);
+INSERT INTO ceil_floor_round VALUES ('-5.5');
+INSERT INTO ceil_floor_round VALUES ('-5.499999');
+INSERT INTO ceil_floor_round VALUES ('9.5');
+INSERT INTO ceil_floor_round VALUES ('9.4999999');
+INSERT INTO ceil_floor_round VALUES ('0.0');
+INSERT INTO ceil_floor_round VALUES ('0.0000001');
+INSERT INTO ceil_floor_round VALUES ('-0.000001');
+SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round;
+DROP TABLE ceil_floor_round;
+
+-- Check rounding, it should round ties away from zero.
+SELECT i as pow,
+ round((-2.5 * 10 ^ i)::numeric, -i),
+ round((-1.5 * 10 ^ i)::numeric, -i),
+ round((-0.5 * 10 ^ i)::numeric, -i),
+ round((0.5 * 10 ^ i)::numeric, -i),
+ round((1.5 * 10 ^ i)::numeric, -i),
+ round((2.5 * 10 ^ i)::numeric, -i)
+FROM generate_series(-5,5) AS t(i);
+
+-- Testing for width_bucket(). For convenience, we test both the
+-- numeric and float8 versions of the function in this file.
+
+-- errors
+SELECT width_bucket(5.0, 3.0, 4.0, 0);
+SELECT width_bucket(5.0, 3.0, 4.0, -5);
+SELECT width_bucket(3.5, 3.0, 3.0, 888);
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0);
+SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5);
+SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
+SELECT width_bucket('NaN', 3.0, 4.0, 888);
+SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888);
+SELECT width_bucket(2.0, 3.0, '-inf', 888);
+SELECT width_bucket(0::float8, '-inf', 4.0::float8, 888);
+
+-- normal operation
+CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
+
+COPY width_bucket_test (operand_num) FROM stdin;
+-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
+\.
+
+UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
+
+SELECT
+ operand_num,
+ width_bucket(operand_num, 0, 10, 5) AS wb_1,
+ width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
+ width_bucket(operand_num, 10, 0, 5) AS wb_2,
+ width_bucket(operand_f8, 10, 0, 5) AS wb_2f,
+ width_bucket(operand_num, 2, 8, 4) AS wb_3,
+ width_bucket(operand_f8, 2, 8, 4) AS wb_3f,
+ width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4,
+ width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f,
+ width_bucket(operand_num, -25, 25, 10) AS wb_5,
+ width_bucket(operand_f8, -25, 25, 10) AS wb_5f
+ FROM width_bucket_test;
+
+-- Check positive and negative infinity: we require
+-- finite bucket bounds, but allow an infinite operand
+SELECT width_bucket(0.0::numeric, 'Infinity'::numeric, 5, 10); -- error
+SELECT width_bucket(0.0::numeric, 5, '-Infinity'::numeric, 20); -- error
+SELECT width_bucket('Infinity'::numeric, 1, 10, 10),
+ width_bucket('-Infinity'::numeric, 1, 10, 10);
+SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error
+SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error
+SELECT width_bucket('Infinity'::float8, 1, 10, 10),
+ width_bucket('-Infinity'::float8, 1, 10, 10);
+
+DROP TABLE width_bucket_test;
+
+-- Simple test for roundoff error when results should be exact
+SELECT x, width_bucket(x::float8, 10, 100, 9) as flt,
+ width_bucket(x::numeric, 10, 100, 9) as num
+FROM generate_series(0, 110, 10) x;
+SELECT x, width_bucket(x::float8, 100, 10, 9) as flt,
+ width_bucket(x::numeric, 100, 10, 9) as num
+FROM generate_series(0, 110, 10) x;
+
+--
+-- TO_CHAR()
+--
+SELECT to_char(val, '9G999G999G999G999G999')
+ FROM num_data;
+
+SELECT to_char(val, '9G999G999G999G999G999D999G999G999G999G999')
+ FROM num_data;
+
+SELECT to_char(val, '9999999999999999.999999999999999PR')
+ FROM num_data;
+
+SELECT to_char(val, '9999999999999999.999999999999999S')
+ FROM num_data;
+
+SELECT to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FMS9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
+SELECT to_char(val, 'SG9999999999999999.999999999999999th') FROM num_data;
+SELECT to_char(val, '0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'S0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM0999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999990999.990999999999999') FROM num_data;
+SELECT to_char(val, 'FM0999999999999999.999909999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999990999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'L9999999999999999.099999999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.99999999999999') FROM num_data;
+SELECT to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+SELECT to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
+SELECT to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data;
+SELECT to_char(val, '999999SG9999999999') FROM num_data;
+SELECT to_char(val, 'FM9999999999999999.999999999999999') FROM num_data;
+SELECT to_char(val, '9.999EEEE') FROM num_data;
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, '9.999EEEE') as numeric,
+ to_char(val::float8, '9.999EEEE') as float8,
+ to_char(val::float4, '9.999EEEE') as float4
+FROM v;
+
+WITH v(exp) AS
+ (VALUES(-16379),(-16378),(-1234),(-789),(-45),(-5),(-4),(-3),(-2),(-1),(0),
+ (1),(2),(3),(4),(5),(38),(275),(2345),(45678),(131070),(131071))
+SELECT exp,
+ to_char(('1.2345e'||exp)::numeric, '9.999EEEE') as numeric
+FROM v;
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI9999999999.99') as numeric,
+ to_char(val::float8, 'MI9999999999.99') as float8,
+ to_char(val::float4, 'MI9999999999.99') as float4
+FROM v;
+
+WITH v(val) AS
+ (VALUES('0'::numeric),('-4.2'),('4.2e9'),('1.2e-5'),('inf'),('-inf'),('nan'))
+SELECT val,
+ to_char(val, 'MI99.99') as numeric,
+ to_char(val::float8, 'MI99.99') as float8,
+ to_char(val::float4, 'MI99.99') as float4
+FROM v;
+
+SELECT to_char('100'::numeric, 'FM999.9');
+SELECT to_char('100'::numeric, 'FM999.');
+SELECT to_char('100'::numeric, 'FM999');
+
+-- Check parsing of literal text in a format string
+SELECT to_char('100'::numeric, 'foo999');
+SELECT to_char('100'::numeric, 'f\oo999');
+SELECT to_char('100'::numeric, 'f\\oo999');
+SELECT to_char('100'::numeric, 'f\"oo999');
+SELECT to_char('100'::numeric, 'f\\"oo999');
+SELECT to_char('100'::numeric, 'f"ool"999');
+SELECT to_char('100'::numeric, 'f"\ool"999');
+SELECT to_char('100'::numeric, 'f"\\ool"999');
+SELECT to_char('100'::numeric, 'f"ool\"999');
+SELECT to_char('100'::numeric, 'f"ool\\"999');
+
+-- TO_NUMBER()
+--
+SET lc_numeric = 'C';
+SELECT to_number('-34,338,492', '99G999G999');
+SELECT to_number('-34,338,492.654,878', '99G999G999D999G999');
+SELECT to_number('<564646.654564>', '999999.999999PR');
+SELECT to_number('0.00001-', '9.999999S');
+SELECT to_number('5.01-', 'FM9.999999S');
+SELECT to_number('5.01-', 'FM9.999999MI');
+SELECT to_number('5 4 4 4 4 8 . 7 8', '9 9 9 9 9 9 . 9 9');
+SELECT to_number('.01', 'FM9.99');
+SELECT to_number('.0', '99999999.99999999');
+SELECT to_number('0', '99.99');
+SELECT to_number('.-01', 'S99.99');
+SELECT to_number('.01-', '99.99S');
+SELECT to_number(' . 0 1-', ' 9 9 . 9 9 S');
+SELECT to_number('34,50','999,99');
+SELECT to_number('123,000','999G');
+SELECT to_number('123456','999G999');
+SELECT to_number('$1234.56','L9,999.99');
+SELECT to_number('$1234.56','L99,999.99');
+SELECT to_number('$1,234.56','L99,999.99');
+SELECT to_number('1234.56','L99,999.99');
+SELECT to_number('1,234.56','L99,999.99');
+SELECT to_number('42nd', '99th');
+RESET lc_numeric;
+
+--
+-- Input syntax
+--
+
+CREATE TABLE num_input_test (n1 numeric);
+
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+INSERT INTO num_input_test(n1) VALUES (' nan');
+INSERT INTO num_input_test(n1) VALUES (' inf ');
+INSERT INTO num_input_test(n1) VALUES (' +inf ');
+INSERT INTO num_input_test(n1) VALUES (' -inf ');
+INSERT INTO num_input_test(n1) VALUES (' Infinity ');
+INSERT INTO num_input_test(n1) VALUES (' +inFinity ');
+INSERT INTO num_input_test(n1) VALUES (' -INFINITY ');
+
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+INSERT INTO num_input_test(n1) VALUES ('');
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+INSERT INTO num_input_test(n1) VALUES ('+ infinity');
+
+SELECT * FROM num_input_test;
+
+--
+-- Test some corner cases for multiplication
+--
+
+select 4790999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+
+select 4789999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+
+select 4770999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+
+select 4769999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+
+select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383));
+
+--
+-- Test some corner cases for division
+--
+
+select 999999999999999999999::numeric/1000000000000000000000;
+select div(999999999999999999999::numeric,1000000000000000000000);
+select mod(999999999999999999999::numeric,1000000000000000000000);
+select div(-9999999999999999999999::numeric,1000000000000000000000);
+select mod(-9999999999999999999999::numeric,1000000000000000000000);
+select div(-9999999999999999999999::numeric,1000000000000000000000)*1000000000000000000000 + mod(-9999999999999999999999::numeric,1000000000000000000000);
+select mod (70.0,70) ;
+select div (70.0,70) ;
+select 70.0 / 70 ;
+select 12345678901234567890 % 123;
+select 12345678901234567890 / 123;
+select div(12345678901234567890, 123);
+select div(12345678901234567890, 123) * 123 + 12345678901234567890 % 123;
+
+--
+-- Test some corner cases for square root
+--
+
+select sqrt(1.000000000000003::numeric);
+select sqrt(1.000000000000004::numeric);
+select sqrt(96627521408608.56340355805::numeric);
+select sqrt(96627521408608.56340355806::numeric);
+select sqrt(515549506212297735.073688290367::numeric);
+select sqrt(515549506212297735.073688290368::numeric);
+select sqrt(8015491789940783531003294973900306::numeric);
+select sqrt(8015491789940783531003294973900307::numeric);
+
+--
+-- Test code path for raising to integer powers
+--
+
+select 10.0 ^ -2147483648 as rounds_to_zero;
+select 10.0 ^ -2147483647 as rounds_to_zero;
+select 10.0 ^ 2147483647 as overflows;
+select 117743296169.0 ^ 1000000000 as overflows;
+
+-- cases that used to return inaccurate results
+select 3.789 ^ 21;
+select 3.789 ^ 35;
+select 1.2 ^ 345;
+select 0.12 ^ (-20);
+select 1.000000000123 ^ (-2147483648);
+select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
+select round(((1 - 1.500012345678e-1000) ^ 1.45e1003) * 1e1000);
+
+-- cases that used to error out
+select 0.12 ^ (-25);
+select 0.5678 ^ (-85);
+select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
+
+-- negative base to integer powers
+select (-1.0) ^ 2147483646;
+select (-1.0) ^ 2147483647;
+select (-1.0) ^ 2147483648;
+select (-1.0) ^ 1000000000000000;
+select (-1.0) ^ 1000000000000001;
+
+--
+-- Tests for raising to non-integer powers
+--
+
+-- special cases
+select 0.0 ^ 0.0;
+select (-12.34) ^ 0.0;
+select 12.34 ^ 0.0;
+select 0.0 ^ 12.34;
+
+-- NaNs
+select 'NaN'::numeric ^ 'NaN'::numeric;
+select 'NaN'::numeric ^ 0;
+select 'NaN'::numeric ^ 1;
+select 0 ^ 'NaN'::numeric;
+select 1 ^ 'NaN'::numeric;
+
+-- invalid inputs
+select 0.0 ^ (-12.34);
+select (-12.34) ^ 1.2;
+
+-- cases that used to generate inaccurate results
+select 32.1 ^ 9.8;
+select 32.1 ^ (-9.8);
+select 12.3 ^ 45.6;
+select 12.3 ^ (-45.6);
+
+-- big test
+select 1.234 ^ 5678;
+
+--
+-- Tests for EXP()
+--
+
+-- special cases
+select exp(0.0);
+select exp(1.0);
+select exp(1.0::numeric(71,70));
+select exp('nan'::numeric);
+select exp('inf'::numeric);
+select exp('-inf'::numeric);
+select coalesce(nullif(exp(-5000::numeric), 0), 0) as rounds_to_zero;
+select coalesce(nullif(exp(-10000::numeric), 0), 0) as underflows;
+
+-- cases that used to generate inaccurate results
+select exp(32.999);
+select exp(-32.999);
+select exp(123.456);
+select exp(-123.456);
+
+-- big test
+select exp(1234.5678);
+
+--
+-- Tests for generate_series
+--
+select * from generate_series(0.0::numeric, 4.0::numeric);
+select * from generate_series(0.1::numeric, 4.0::numeric, 1.3::numeric);
+select * from generate_series(4.0::numeric, -1.5::numeric, -2.2::numeric);
+-- Trigger errors
+select * from generate_series(-100::numeric, 100::numeric, 0::numeric);
+select * from generate_series(-100::numeric, 100::numeric, 'nan'::numeric);
+select * from generate_series('nan'::numeric, 100::numeric, 10::numeric);
+select * from generate_series(0::numeric, 'nan'::numeric, 10::numeric);
+select * from generate_series('inf'::numeric, 'inf'::numeric, 10::numeric);
+select * from generate_series(0::numeric, 'inf'::numeric, 10::numeric);
+select * from generate_series(0::numeric, '42'::numeric, '-inf'::numeric);
+-- Checks maximum, output is truncated
+select (i / (10::numeric ^ 131071))::numeric(1,0)
+ from generate_series(6 * (10::numeric ^ 131071),
+ 9 * (10::numeric ^ 131071),
+ 10::numeric ^ 131071) as a(i);
+-- Check usage with variables
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(i,3) j;
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,i) j;
+select * from generate_series(1::numeric, 3::numeric) i, generate_series(1,5,i) j;
+
+--
+-- Tests for LN()
+--
+
+-- Invalid inputs
+select ln(-12.34);
+select ln(0.0);
+
+-- Some random tests
+select ln(1.2345678e-28);
+select ln(0.0456789);
+select ln(0.349873948359354029493948309745709580730482050975);
+select ln(0.99949452);
+select ln(1.00049687395);
+select ln(1234.567890123456789);
+select ln(5.80397490724e5);
+select ln(9.342536355e34);
+
+--
+-- Tests for LOG() (base 10)
+--
+
+-- invalid inputs
+select log(-12.34);
+select log(0.0);
+
+-- some random tests
+select log(1.234567e-89);
+select log(3.4634998359873254962349856073435545);
+select log(9.999999999999999999);
+select log(10.00000000000000000);
+select log(10.00000000000000001);
+select log(590489.45235237);
+
+--
+-- Tests for LOG() (arbitrary base)
+--
+
+-- invalid inputs
+select log(-12.34, 56.78);
+select log(-12.34, -56.78);
+select log(12.34, -56.78);
+select log(0.0, 12.34);
+select log(12.34, 0.0);
+select log(1.0, 12.34);
+
+-- some random tests
+select log(1.23e-89, 6.4689e45);
+select log(0.99923, 4.58934e34);
+select log(1.000016, 8.452010e18);
+select log(3.1954752e47, 9.4792021e-73);
+
+--
+-- Tests for scale()
+--
+
+select scale(numeric 'NaN');
+select scale(numeric 'inf');
+select scale(NULL::numeric);
+select scale(1.12);
+select scale(0);
+select scale(0.00);
+select scale(1.12345);
+select scale(110123.12475871856128);
+select scale(-1123.12471856128);
+select scale(-13.000000000000000);
+
+--
+-- Tests for min_scale()
+--
+
+select min_scale(numeric 'NaN') is NULL; -- should be true
+select min_scale(numeric 'inf') is NULL; -- should be true
+select min_scale(0); -- no digits
+select min_scale(0.00); -- no digits again
+select min_scale(1.0); -- no scale
+select min_scale(1.1); -- scale 1
+select min_scale(1.12); -- scale 2
+select min_scale(1.123); -- scale 3
+select min_scale(1.1234); -- scale 4, filled digit
+select min_scale(1.12345); -- scale 5, 2 NDIGITS
+select min_scale(1.1000); -- 1 pos in NDIGITS
+select min_scale(1e100); -- very big number
+
+--
+-- Tests for trim_scale()
+--
+
+select trim_scale(numeric 'NaN');
+select trim_scale(numeric 'inf');
+select trim_scale(1.120);
+select trim_scale(0);
+select trim_scale(0.00);
+select trim_scale(1.1234500);
+select trim_scale(110123.12475871856128000);
+select trim_scale(-1123.124718561280000000);
+select trim_scale(-13.00000000000000000000);
+select trim_scale(1e100);
+
+--
+-- Tests for SUM()
+--
+
+-- cases that need carry propagation
+SELECT SUM(9999::numeric) FROM generate_series(1, 100000);
+SELECT SUM((-9999)::numeric) FROM generate_series(1, 100000);
+
+--
+-- Tests for GCD()
+--
+SELECT a, b, gcd(a, b), gcd(a, -b), gcd(-b, a), gcd(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 46375::numeric),
+ (433125::numeric, 46375::numeric),
+ (43312.5::numeric, 4637.5::numeric),
+ (4331.250::numeric, 463.75000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+
+--
+-- Tests for LCM()
+--
+SELECT a,b, lcm(a, b), lcm(a, -b), lcm(-b, a), lcm(-b, -a)
+FROM (VALUES (0::numeric, 0::numeric),
+ (0::numeric, numeric 'NaN'),
+ (0::numeric, 13272::numeric),
+ (13272::numeric, 13272::numeric),
+ (423282::numeric, 13272::numeric),
+ (42328.2::numeric, 1327.2::numeric),
+ (4232.820::numeric, 132.72000::numeric),
+ ('inf', '0'),
+ ('inf', '42'),
+ ('inf', 'inf')
+ ) AS v(a, b);
+
+SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overflow
+
+--
+-- Tests for factorial
+--
+SELECT factorial(4);
+SELECT factorial(15);
+SELECT factorial(100000);
+SELECT factorial(0);
+SELECT factorial(-4);
+
+--
+-- Tests for pg_lsn()
+--
+SELECT pg_lsn(23783416::numeric);
+SELECT pg_lsn(0::numeric);
+SELECT pg_lsn(18446744073709551615::numeric);
+SELECT pg_lsn(-1::numeric);
+SELECT pg_lsn(18446744073709551616::numeric);
+SELECT pg_lsn('NaN'::numeric);
diff --git a/yql/essentials/tests/postgresql/original/cases/numerology.out b/yql/essentials/tests/postgresql/original/cases/numerology.out
new file mode 100644
index 0000000000..44d6c435de
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/numerology.out
@@ -0,0 +1,136 @@
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT4_TBL;
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT2_TBL;
+SELECT f1 FROM TEMP_FLOAT
+ ORDER BY f1;
+ f1
+-------------
+ -2147483647
+ -123456
+ -32767
+ -1234
+ 0
+ 0
+ 1234
+ 32767
+ 123456
+ 2147483647
+(10 rows)
+
+-- int4
+CREATE TABLE TEMP_INT4 (f1 INT4);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM FLOAT8_TBL
+ WHERE (f1 > -2147483647) AND (f1 < 2147483647);
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM INT2_TBL;
+SELECT f1 FROM TEMP_INT4
+ ORDER BY f1;
+ f1
+--------
+ -32767
+ -1234
+ -1004
+ -35
+ 0
+ 0
+ 0
+ 1234
+ 32767
+(9 rows)
+
+-- int2
+CREATE TABLE TEMP_INT2 (f1 INT2);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM FLOAT8_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM INT4_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+SELECT f1 FROM TEMP_INT2
+ ORDER BY f1;
+ f1
+-------
+ -1004
+ -35
+ 0
+ 0
+ 0
+(5 rows)
+
+--
+-- Group-by combinations
+--
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+INSERT INTO TEMP_GROUP
+ SELECT 1, (- i.f1), (- f.f1)
+ FROM INT4_TBL i, FLOAT8_TBL f;
+INSERT INTO TEMP_GROUP
+ SELECT 2, i.f1, f.f1
+ FROM INT4_TBL i, FLOAT8_TBL f;
+SELECT DISTINCT f1 AS two FROM TEMP_GROUP ORDER BY 1;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, max_float, min_float;
+ two | max_float | min_float
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | -0
+ 2 | 0 | -1.2345678901234e+200
+(2 rows)
+
+-- GROUP BY a result column name is not legal per SQL92, but we accept it
+-- anyway (if the name is not the name of any column exposed by FROM).
+SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float
+ FROM TEMP_GROUP
+ GROUP BY two
+ ORDER BY two, max_float, min_float;
+ two | max_float | min_float
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | -0
+ 2 | 0 | -1.2345678901234e+200
+(2 rows)
+
+SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+ two | max_plus_1 | min_minus_1
+-----+----------------------+-----------------------
+ 1 | 1.2345678901234e+200 | -1
+ 2 | 1 | -1.2345678901234e+200
+(2 rows)
+
+SELECT f1 AS two,
+ max(f2) + min(f2) AS max_plus_min,
+ min(f3) - 1 AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+ two | max_plus_min | min_minus_1
+-----+--------------+-----------------------
+ 1 | 0 | -1
+ 2 | 0 | -1.2345678901234e+200
+(2 rows)
+
+DROP TABLE TEMP_INT2;
+DROP TABLE TEMP_INT4;
+DROP TABLE TEMP_FLOAT;
+DROP TABLE TEMP_GROUP;
diff --git a/yql/essentials/tests/postgresql/original/cases/numerology.sql b/yql/essentials/tests/postgresql/original/cases/numerology.sql
new file mode 100644
index 0000000000..fddb58f8fd
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/numerology.sql
@@ -0,0 +1,98 @@
+--
+-- NUMEROLOGY
+-- Test various combinations of numeric types and functions.
+--
+
+--
+-- Test implicit type conversions
+-- This fails for Postgres v6.1 (and earlier?)
+-- so let's try explicit conversions for now - tgl 97/05/07
+--
+
+CREATE TABLE TEMP_FLOAT (f1 FLOAT8);
+
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT4_TBL;
+
+INSERT INTO TEMP_FLOAT (f1)
+ SELECT float8(f1) FROM INT2_TBL;
+
+SELECT f1 FROM TEMP_FLOAT
+ ORDER BY f1;
+
+-- int4
+
+CREATE TABLE TEMP_INT4 (f1 INT4);
+
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM FLOAT8_TBL
+ WHERE (f1 > -2147483647) AND (f1 < 2147483647);
+
+INSERT INTO TEMP_INT4 (f1)
+ SELECT int4(f1) FROM INT2_TBL;
+
+SELECT f1 FROM TEMP_INT4
+ ORDER BY f1;
+
+-- int2
+
+CREATE TABLE TEMP_INT2 (f1 INT2);
+
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM FLOAT8_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+
+INSERT INTO TEMP_INT2 (f1)
+ SELECT int2(f1) FROM INT4_TBL
+ WHERE (f1 >= -32767) AND (f1 <= 32767);
+
+SELECT f1 FROM TEMP_INT2
+ ORDER BY f1;
+
+--
+-- Group-by combinations
+--
+
+CREATE TABLE TEMP_GROUP (f1 INT4, f2 INT4, f3 FLOAT8);
+
+INSERT INTO TEMP_GROUP
+ SELECT 1, (- i.f1), (- f.f1)
+ FROM INT4_TBL i, FLOAT8_TBL f;
+
+INSERT INTO TEMP_GROUP
+ SELECT 2, i.f1, f.f1
+ FROM INT4_TBL i, FLOAT8_TBL f;
+
+SELECT DISTINCT f1 AS two FROM TEMP_GROUP ORDER BY 1;
+
+SELECT f1 AS two, max(f3) AS max_float, min(f3) as min_float
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, max_float, min_float;
+
+-- GROUP BY a result column name is not legal per SQL92, but we accept it
+-- anyway (if the name is not the name of any column exposed by FROM).
+SELECT f1 AS two, max(f3) AS max_float, min(f3) AS min_float
+ FROM TEMP_GROUP
+ GROUP BY two
+ ORDER BY two, max_float, min_float;
+
+SELECT f1 AS two, (max(f3) + 1) AS max_plus_1, (min(f3) - 1) AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+
+SELECT f1 AS two,
+ max(f2) + min(f2) AS max_plus_min,
+ min(f3) - 1 AS min_minus_1
+ FROM TEMP_GROUP
+ GROUP BY f1
+ ORDER BY two, min_minus_1;
+
+DROP TABLE TEMP_INT2;
+
+DROP TABLE TEMP_INT4;
+
+DROP TABLE TEMP_FLOAT;
+
+DROP TABLE TEMP_GROUP;
diff --git a/yql/essentials/tests/postgresql/original/cases/oid.out b/yql/essentials/tests/postgresql/original/cases/oid.out
new file mode 100644
index 0000000000..8909373453
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/oid.out
@@ -0,0 +1,122 @@
+--
+-- OID
+--
+CREATE TABLE OID_TBL(f1 oid);
+INSERT INTO OID_TBL(f1) VALUES ('1234');
+INSERT INTO OID_TBL(f1) VALUES ('1235');
+INSERT INTO OID_TBL(f1) VALUES ('987');
+INSERT INTO OID_TBL(f1) VALUES ('-1040');
+INSERT INTO OID_TBL(f1) VALUES ('99999999');
+INSERT INTO OID_TBL(f1) VALUES ('5 ');
+INSERT INTO OID_TBL(f1) VALUES (' 10 ');
+-- leading/trailing hard tab is also allowed
+INSERT INTO OID_TBL(f1) VALUES (' 15 ');
+-- bad inputs
+INSERT INTO OID_TBL(f1) VALUES ('');
+ERROR: invalid input syntax for type oid: ""
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' ');
+ERROR: invalid input syntax for type oid: " "
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' ');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ERROR: invalid input syntax for type oid: "asdfasd"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ERROR: invalid input syntax for type oid: "99asdfasd"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ERROR: invalid input syntax for type oid: "5 d"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('5 d');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ERROR: invalid input syntax for type oid: " 5d"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' 5d');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ERROR: invalid input syntax for type oid: "5 5"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('5 5');
+ ^
+INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ERROR: invalid input syntax for type oid: " - 500"
+LINE 1: INSERT INTO OID_TBL(f1) VALUES (' - 500');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ERROR: value "32958209582039852935" is out of range for type oid
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+ ^
+INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ERROR: value "-23582358720398502385" is out of range for type oid
+LINE 1: INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+ ^
+SELECT * FROM OID_TBL;
+ f1
+------------
+ 1234
+ 1235
+ 987
+ 4294966256
+ 99999999
+ 5
+ 10
+ 15
+(8 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 = 1234;
+ f1
+------
+ 1234
+(1 row)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+ f1
+------------
+ 1235
+ 987
+ 4294966256
+ 99999999
+ 5
+ 10
+ 15
+(7 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+ f1
+------
+ 1234
+ 987
+ 5
+ 10
+ 15
+(5 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 < '1234';
+ f1
+-----
+ 987
+ 5
+ 10
+ 15
+(4 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+ f1
+------------
+ 1234
+ 1235
+ 4294966256
+ 99999999
+(4 rows)
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 > '1234';
+ f1
+------------
+ 1235
+ 4294966256
+ 99999999
+(3 rows)
+
+DROP TABLE OID_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/oid.sql b/yql/essentials/tests/postgresql/original/cases/oid.sql
new file mode 100644
index 0000000000..25b4b68a6a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/oid.sql
@@ -0,0 +1,43 @@
+--
+-- OID
+--
+
+CREATE TABLE OID_TBL(f1 oid);
+
+INSERT INTO OID_TBL(f1) VALUES ('1234');
+INSERT INTO OID_TBL(f1) VALUES ('1235');
+INSERT INTO OID_TBL(f1) VALUES ('987');
+INSERT INTO OID_TBL(f1) VALUES ('-1040');
+INSERT INTO OID_TBL(f1) VALUES ('99999999');
+INSERT INTO OID_TBL(f1) VALUES ('5 ');
+INSERT INTO OID_TBL(f1) VALUES (' 10 ');
+-- leading/trailing hard tab is also allowed
+INSERT INTO OID_TBL(f1) VALUES (' 15 ');
+
+-- bad inputs
+INSERT INTO OID_TBL(f1) VALUES ('');
+INSERT INTO OID_TBL(f1) VALUES (' ');
+INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+INSERT INTO OID_TBL(f1) VALUES ('5 d');
+INSERT INTO OID_TBL(f1) VALUES (' 5d');
+INSERT INTO OID_TBL(f1) VALUES ('5 5');
+INSERT INTO OID_TBL(f1) VALUES (' - 500');
+INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+
+SELECT * FROM OID_TBL;
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 = 1234;
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 < '1234';
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+
+SELECT o.* FROM OID_TBL o WHERE o.f1 > '1234';
+
+DROP TABLE OID_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/select.out b/yql/essentials/tests/postgresql/original/cases/select.out
new file mode 100644
index 0000000000..6dcd4fa8f3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select.out
@@ -0,0 +1,973 @@
+--
+-- SELECT
+--
+-- btree index
+-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT * FROM onek
+ WHERE onek.unique1 < 10
+ ORDER BY onek.unique1;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 0 | 998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | AAAAAA | KMBAAA | OOOOxx
+ 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx
+ 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx
+ 3 | 431 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 7 | DAAAAA | PQAAAA | VVVVxx
+ 4 | 833 | 0 | 0 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 9 | EAAAAA | BGBAAA | HHHHxx
+ 5 | 541 | 1 | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 10 | 11 | FAAAAA | VUAAAA | HHHHxx
+ 6 | 978 | 0 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 12 | 13 | GAAAAA | QLBAAA | OOOOxx
+ 7 | 647 | 1 | 3 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 14 | 15 | HAAAAA | XYAAAA | VVVVxx
+ 8 | 653 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 16 | 17 | IAAAAA | DZAAAA | HHHHxx
+ 9 | 49 | 1 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 18 | 19 | JAAAAA | XBAAAA | HHHHxx
+(10 rows)
+
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >;
+ unique1 | stringu1
+---------+----------
+ 19 | TAAAAA
+ 18 | SAAAAA
+ 17 | RAAAAA
+ 16 | QAAAAA
+ 15 | PAAAAA
+ 14 | OAAAAA
+ 13 | NAAAAA
+ 12 | MAAAAA
+ 11 | LAAAAA
+ 10 | KAAAAA
+ 9 | JAAAAA
+ 8 | IAAAAA
+ 7 | HAAAAA
+ 6 | GAAAAA
+ 5 | FAAAAA
+ 4 | EAAAAA
+ 3 | DAAAAA
+ 2 | CAAAAA
+ 1 | BAAAAA
+ 0 | AAAAAA
+(20 rows)
+
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY stringu1 using <;
+ unique1 | stringu1
+---------+----------
+ 988 | AMAAAA
+ 989 | BMAAAA
+ 990 | CMAAAA
+ 991 | DMAAAA
+ 992 | EMAAAA
+ 993 | FMAAAA
+ 994 | GMAAAA
+ 995 | HMAAAA
+ 996 | IMAAAA
+ 997 | JMAAAA
+ 998 | KMAAAA
+ 999 | LMAAAA
+ 981 | TLAAAA
+ 982 | ULAAAA
+ 983 | VLAAAA
+ 984 | WLAAAA
+ 985 | XLAAAA
+ 986 | YLAAAA
+ 987 | ZLAAAA
+(19 rows)
+
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1d -2 +0nr -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using <, unique1 using >;
+ unique1 | string4
+---------+---------
+ 999 | AAAAxx
+ 995 | AAAAxx
+ 983 | AAAAxx
+ 982 | AAAAxx
+ 981 | AAAAxx
+ 998 | HHHHxx
+ 997 | HHHHxx
+ 993 | HHHHxx
+ 990 | HHHHxx
+ 986 | HHHHxx
+ 996 | OOOOxx
+ 991 | OOOOxx
+ 988 | OOOOxx
+ 987 | OOOOxx
+ 985 | OOOOxx
+ 994 | VVVVxx
+ 992 | VVVVxx
+ 989 | VVVVxx
+ 984 | VVVVxx
+(19 rows)
+
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1dr -2 +0n -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using >, unique1 using <;
+ unique1 | string4
+---------+---------
+ 984 | VVVVxx
+ 989 | VVVVxx
+ 992 | VVVVxx
+ 994 | VVVVxx
+ 985 | OOOOxx
+ 987 | OOOOxx
+ 988 | OOOOxx
+ 991 | OOOOxx
+ 996 | OOOOxx
+ 986 | HHHHxx
+ 990 | HHHHxx
+ 993 | HHHHxx
+ 997 | HHHHxx
+ 998 | HHHHxx
+ 981 | AAAAxx
+ 982 | AAAAxx
+ 983 | AAAAxx
+ 995 | AAAAxx
+ 999 | AAAAxx
+(19 rows)
+
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0nr -1 +1d -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >, string4 using <;
+ unique1 | string4
+---------+---------
+ 19 | OOOOxx
+ 18 | VVVVxx
+ 17 | HHHHxx
+ 16 | OOOOxx
+ 15 | VVVVxx
+ 14 | AAAAxx
+ 13 | OOOOxx
+ 12 | AAAAxx
+ 11 | OOOOxx
+ 10 | AAAAxx
+ 9 | HHHHxx
+ 8 | HHHHxx
+ 7 | VVVVxx
+ 6 | OOOOxx
+ 5 | HHHHxx
+ 4 | HHHHxx
+ 3 | VVVVxx
+ 2 | OOOOxx
+ 1 | OOOOxx
+ 0 | OOOOxx
+(20 rows)
+
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0n -1 +1dr -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using <, string4 using >;
+ unique1 | string4
+---------+---------
+ 0 | OOOOxx
+ 1 | OOOOxx
+ 2 | OOOOxx
+ 3 | VVVVxx
+ 4 | HHHHxx
+ 5 | HHHHxx
+ 6 | OOOOxx
+ 7 | VVVVxx
+ 8 | HHHHxx
+ 9 | HHHHxx
+ 10 | AAAAxx
+ 11 | OOOOxx
+ 12 | AAAAxx
+ 13 | OOOOxx
+ 14 | AAAAxx
+ 15 | VVVVxx
+ 16 | OOOOxx
+ 17 | HHHHxx
+ 18 | VVVVxx
+ 19 | OOOOxx
+(20 rows)
+
+--
+-- test partial btree indexes
+--
+-- As of 7.2, planner probably won't pick an indexscan without stats,
+-- so ANALYZE first. Also, we want to prevent it from picking a bitmapscan
+-- followed by sort, because that could hide index ordering problems.
+--
+ANALYZE onek2;
+SET enable_seqscan TO off;
+SET enable_bitmapscan TO off;
+SET enable_sort TO off;
+--
+-- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 0 | 998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | AAAAAA | KMBAAA | OOOOxx
+ 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx
+ 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx
+ 3 | 431 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 7 | DAAAAA | PQAAAA | VVVVxx
+ 4 | 833 | 0 | 0 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 9 | EAAAAA | BGBAAA | HHHHxx
+ 5 | 541 | 1 | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 10 | 11 | FAAAAA | VUAAAA | HHHHxx
+ 6 | 978 | 0 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 12 | 13 | GAAAAA | QLBAAA | OOOOxx
+ 7 | 647 | 1 | 3 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 14 | 15 | HAAAAA | XYAAAA | VVVVxx
+ 8 | 653 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 16 | 17 | IAAAAA | DZAAAA | HHHHxx
+ 9 | 49 | 1 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 18 | 19 | JAAAAA | XBAAAA | HHHHxx
+(10 rows)
+
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 < 20
+ ORDER BY unique1 using >;
+ unique1 | stringu1
+---------+----------
+ 19 | TAAAAA
+ 18 | SAAAAA
+ 17 | RAAAAA
+ 16 | QAAAAA
+ 15 | PAAAAA
+ 14 | OAAAAA
+ 13 | NAAAAA
+ 12 | MAAAAA
+ 11 | LAAAAA
+ 10 | KAAAAA
+ 9 | JAAAAA
+ 8 | IAAAAA
+ 7 | HAAAAA
+ 6 | GAAAAA
+ 5 | FAAAAA
+ 4 | EAAAAA
+ 3 | DAAAAA
+ 2 | CAAAAA
+ 1 | BAAAAA
+ 0 | AAAAAA
+(20 rows)
+
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 > 980;
+ unique1 | stringu1
+---------+----------
+ 981 | TLAAAA
+ 982 | ULAAAA
+ 983 | VLAAAA
+ 984 | WLAAAA
+ 985 | XLAAAA
+ 986 | YLAAAA
+ 987 | ZLAAAA
+ 988 | AMAAAA
+ 989 | BMAAAA
+ 990 | CMAAAA
+ 991 | DMAAAA
+ 992 | EMAAAA
+ 993 | FMAAAA
+ 994 | GMAAAA
+ 995 | HMAAAA
+ 996 | IMAAAA
+ 997 | JMAAAA
+ 998 | KMAAAA
+ 999 | LMAAAA
+(19 rows)
+
+RESET enable_seqscan;
+RESET enable_bitmapscan;
+RESET enable_sort;
+SELECT two, stringu1, ten, string4
+ INTO TABLE tmp
+ FROM onek;
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=2){print $4,$5;}else{print;}}' - stud_emp.data
+--
+-- SELECT name, age FROM person*; ??? check if different
+SELECT p.name, p.age FROM person* p;
+ name | age
+---------+-----
+ mike | 40
+ joe | 20
+ sally | 34
+ sandra | 19
+ alex | 30
+ sue | 50
+ denise | 24
+ sarah | 88
+ teresa | 38
+ nan | 28
+ leah | 68
+ wendy | 78
+ melissa | 28
+ joan | 18
+ mary | 8
+ jane | 58
+ liza | 38
+ jean | 28
+ jenifer | 38
+ juanita | 58
+ susan | 78
+ zena | 98
+ martie | 88
+ chris | 78
+ pat | 18
+ zola | 58
+ louise | 98
+ edna | 18
+ bertha | 88
+ sumi | 38
+ koko | 88
+ gina | 18
+ rean | 48
+ sharon | 78
+ paula | 68
+ julie | 68
+ belinda | 38
+ karen | 48
+ carina | 58
+ diane | 18
+ esther | 98
+ trudy | 88
+ fanny | 8
+ carmen | 78
+ lita | 25
+ pamela | 48
+ sandy | 38
+ trisha | 88
+ uma | 78
+ velma | 68
+ sharon | 25
+ sam | 30
+ bill | 20
+ fred | 28
+ larry | 60
+ jeff | 23
+ cim | 30
+ linda | 19
+(58 rows)
+
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $4,$5;}else{print;}}' - stud_emp.data |
+-- sort +1nr -2
+--
+SELECT p.name, p.age FROM person* p ORDER BY age using >, name;
+ name | age
+---------+-----
+ esther | 98
+ louise | 98
+ zena | 98
+ bertha | 88
+ koko | 88
+ martie | 88
+ sarah | 88
+ trisha | 88
+ trudy | 88
+ carmen | 78
+ chris | 78
+ sharon | 78
+ susan | 78
+ uma | 78
+ wendy | 78
+ julie | 68
+ leah | 68
+ paula | 68
+ velma | 68
+ larry | 60
+ carina | 58
+ jane | 58
+ juanita | 58
+ zola | 58
+ sue | 50
+ karen | 48
+ pamela | 48
+ rean | 48
+ mike | 40
+ belinda | 38
+ jenifer | 38
+ liza | 38
+ sandy | 38
+ sumi | 38
+ teresa | 38
+ sally | 34
+ alex | 30
+ cim | 30
+ sam | 30
+ fred | 28
+ jean | 28
+ melissa | 28
+ nan | 28
+ lita | 25
+ sharon | 25
+ denise | 24
+ jeff | 23
+ bill | 20
+ joe | 20
+ linda | 19
+ sandra | 19
+ diane | 18
+ edna | 18
+ gina | 18
+ joan | 18
+ pat | 18
+ fanny | 8
+ mary | 8
+(58 rows)
+
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1 offset 0) as foo;
+ foo
+-----
+ (1)
+(1 row)
+
+select foo from (select null offset 0) as foo;
+ foo
+-----
+ ()
+(1 row)
+
+select foo from (select 'xyzzy',1,null offset 0) as foo;
+ foo
+------------
+ (xyzzy,1,)
+(1 row)
+
+--
+-- Test VALUES lists
+--
+select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
+ WHERE onek.unique1 = v.i and onek.stringu1 = v.j;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | i | j
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+-----+--------
+ 147 | 0 | 1 | 3 | 7 | 7 | 7 | 47 | 147 | 147 | 147 | 14 | 15 | RFAAAA | AAAAAA | AAAAxx | 147 | RFAAAA
+ 931 | 1 | 1 | 3 | 1 | 11 | 1 | 31 | 131 | 431 | 931 | 2 | 3 | VJAAAA | BAAAAA | HHHHxx | 931 | VJAAAA
+(2 rows)
+
+-- a more complex case
+-- looks like we're coding lisp :-)
+select * from onek,
+ (values ((select i from
+ (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i)
+ order by i asc limit 1))) bar (i)
+ where onek.unique1 = bar.i;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | i
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+---
+ 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx | 2
+(1 row)
+
+-- try VALUES in a subquery
+select * from onek
+ where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99))
+ order by unique1;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx
+ 20 | 306 | 0 | 0 | 0 | 0 | 0 | 20 | 20 | 20 | 20 | 0 | 1 | UAAAAA | ULAAAA | OOOOxx
+ 99 | 101 | 1 | 3 | 9 | 19 | 9 | 99 | 99 | 99 | 99 | 18 | 19 | VDAAAA | XDAAAA | HHHHxx
+(3 rows)
+
+-- VALUES is also legal as a standalone query or a set-operation member
+VALUES (1,2), (3,4+4), (7,77.7);
+ column1 | column2
+---------+---------
+ 1 | 2
+ 3 | 8
+ 7 | 77.7
+(3 rows)
+
+VALUES (1,2), (3,4+4), (7,77.7)
+UNION ALL
+SELECT 2+2, 57
+UNION ALL
+TABLE int8_tbl;
+ column1 | column2
+------------------+-------------------
+ 1 | 2
+ 3 | 8
+ 7 | 77.7
+ 4 | 57
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(9 rows)
+
+-- corner case: VALUES with no columns
+CREATE TEMP TABLE nocols();
+INSERT INTO nocols DEFAULT VALUES;
+SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v;
+--
+(1 row)
+
+--
+-- Test ORDER BY options
+--
+CREATE TEMP TABLE foo (f1 int);
+INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1);
+SELECT * FROM foo ORDER BY f1;
+ f1
+----
+ 1
+ 3
+ 7
+ 10
+ 42
+
+
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 ASC; -- same thing
+ f1
+----
+ 1
+ 3
+ 7
+ 10
+ 42
+
+
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC;
+ f1
+----
+
+
+ 42
+ 10
+ 7
+ 3
+ 1
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+ f1
+----
+ 42
+ 10
+ 7
+ 3
+ 1
+
+
+(7 rows)
+
+-- check if indexscans do the right things
+CREATE INDEX fooi ON foo (f1);
+SET enable_sort = false;
+SELECT * FROM foo ORDER BY f1;
+ f1
+----
+ 1
+ 3
+ 7
+ 10
+ 42
+
+
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC;
+ f1
+----
+
+
+ 42
+ 10
+ 7
+ 3
+ 1
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+ f1
+----
+ 42
+ 10
+ 7
+ 3
+ 1
+
+
+(7 rows)
+
+DROP INDEX fooi;
+CREATE INDEX fooi ON foo (f1 DESC);
+SELECT * FROM foo ORDER BY f1;
+ f1
+----
+ 1
+ 3
+ 7
+ 10
+ 42
+
+
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC;
+ f1
+----
+
+
+ 42
+ 10
+ 7
+ 3
+ 1
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+ f1
+----
+ 42
+ 10
+ 7
+ 3
+ 1
+
+
+(7 rows)
+
+DROP INDEX fooi;
+CREATE INDEX fooi ON foo (f1 DESC NULLS LAST);
+SELECT * FROM foo ORDER BY f1;
+ f1
+----
+ 1
+ 3
+ 7
+ 10
+ 42
+
+
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+ f1
+----
+
+
+ 1
+ 3
+ 7
+ 10
+ 42
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC;
+ f1
+----
+
+
+ 42
+ 10
+ 7
+ 3
+ 1
+(7 rows)
+
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+ f1
+----
+ 42
+ 10
+ 7
+ 3
+ 1
+
+
+(7 rows)
+
+--
+-- Test planning of some cases with partial indexes
+--
+-- partial index is usable
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ QUERY PLAN
+-----------------------------------------
+ Index Scan using onek2_u2_prtl on onek2
+ Index Cond: (unique2 = 11)
+ Filter: (stringu1 = 'ATAAAA'::name)
+(3 rows)
+
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx
+(1 row)
+
+-- actually run the query with an analyze to use the partial index
+explain (costs off, analyze on, timing off, summary off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ QUERY PLAN
+-----------------------------------------------------------------
+ Index Scan using onek2_u2_prtl on onek2 (actual rows=1 loops=1)
+ Index Cond: (unique2 = 11)
+ Filter: (stringu1 = 'ATAAAA'::name)
+(3 rows)
+
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ QUERY PLAN
+-----------------------------------------
+ Index Scan using onek2_u2_prtl on onek2
+ Index Cond: (unique2 = 11)
+ Filter: (stringu1 = 'ATAAAA'::name)
+(3 rows)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+ unique2
+---------
+ 11
+(1 row)
+
+-- partial index predicate implies clause, so no need for retest
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+ QUERY PLAN
+-----------------------------------------
+ Index Scan using onek2_u2_prtl on onek2
+ Index Cond: (unique2 = 11)
+(2 rows)
+
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
+---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
+ 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx
+(1 row)
+
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ QUERY PLAN
+----------------------------------------------
+ Index Only Scan using onek2_u2_prtl on onek2
+ Index Cond: (unique2 = 11)
+(2 rows)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique2
+---------
+ 11
+(1 row)
+
+-- but if it's an update target, must retest anyway
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+ QUERY PLAN
+-----------------------------------------------
+ LockRows
+ -> Index Scan using onek2_u2_prtl on onek2
+ Index Cond: (unique2 = 11)
+ Filter: (stringu1 < 'B'::name)
+(4 rows)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+ unique2
+---------
+ 11
+(1 row)
+
+-- partial index is not applicable
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+ QUERY PLAN
+-------------------------------------------------------
+ Seq Scan on onek2
+ Filter: ((stringu1 < 'C'::name) AND (unique2 = 11))
+(2 rows)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+ unique2
+---------
+ 11
+(1 row)
+
+-- partial index implies clause, but bitmap scan must recheck predicate anyway
+SET enable_indexscan TO off;
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ QUERY PLAN
+-------------------------------------------------------------
+ Bitmap Heap Scan on onek2
+ Recheck Cond: ((unique2 = 11) AND (stringu1 < 'B'::name))
+ -> Bitmap Index Scan on onek2_u2_prtl
+ Index Cond: (unique2 = 11)
+(4 rows)
+
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+ unique2
+---------
+ 11
+(1 row)
+
+RESET enable_indexscan;
+-- check multi-index cases too
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+ QUERY PLAN
+--------------------------------------------------------------------------------
+ Bitmap Heap Scan on onek2
+ Recheck Cond: (((unique2 = 11) AND (stringu1 < 'B'::name)) OR (unique1 = 0))
+ Filter: (stringu1 < 'B'::name)
+ -> BitmapOr
+ -> Bitmap Index Scan on onek2_u2_prtl
+ Index Cond: (unique2 = 11)
+ -> Bitmap Index Scan on onek2_u1_prtl
+ Index Cond: (unique1 = 0)
+(8 rows)
+
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+ unique1 | unique2
+---------+---------
+ 494 | 11
+ 0 | 998
+(2 rows)
+
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+ QUERY PLAN
+--------------------------------------------------------------------------------
+ Bitmap Heap Scan on onek2
+ Recheck Cond: (((unique2 = 11) AND (stringu1 < 'B'::name)) OR (unique1 = 0))
+ -> BitmapOr
+ -> Bitmap Index Scan on onek2_u2_prtl
+ Index Cond: (unique2 = 11)
+ -> Bitmap Index Scan on onek2_u1_prtl
+ Index Cond: (unique1 = 0)
+(7 rows)
+
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+ unique1 | unique2
+---------+---------
+ 494 | 11
+ 0 | 998
+(2 rows)
+
+--
+-- Test some corner cases that have been known to confuse the planner
+--
+-- ORDER BY on a constant doesn't really need any sorting
+SELECT 1 AS x ORDER BY x;
+ x
+---
+ 1
+(1 row)
+
+-- But ORDER BY on a set-valued expression does
+create function sillysrf(int) returns setof int as
+ 'values (1),(10),(2),($1)' language sql immutable;
+select sillysrf(42);
+ sillysrf
+----------
+ 1
+ 10
+ 2
+ 42
+(4 rows)
+
+select sillysrf(-1) order by 1;
+ sillysrf
+----------
+ -1
+ 1
+ 2
+ 10
+(4 rows)
+
+drop function sillysrf(int);
+-- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict
+-- (see bug #5084)
+select * from (values (2),(null),(1)) v(k) where k = k order by k;
+ k
+---
+ 1
+ 2
+(2 rows)
+
+select * from (values (2),(null),(1)) v(k) where k = k;
+ k
+---
+ 2
+ 1
+(2 rows)
+
+-- Test partitioned tables with no partitions, which should be handled the
+-- same as the non-inheritance case when expanding its RTE.
+create table list_parted_tbl (a int,b int) partition by list (a);
+create table list_parted_tbl1 partition of list_parted_tbl
+ for values in (1) partition by list(b);
+explain (costs off) select * from list_parted_tbl;
+ QUERY PLAN
+--------------------------
+ Result
+ One-Time Filter: false
+(2 rows)
+
+drop table list_parted_tbl;
diff --git a/yql/essentials/tests/postgresql/original/cases/select.sql b/yql/essentials/tests/postgresql/original/cases/select.sql
new file mode 100644
index 0000000000..d6f42aa0d4
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select.sql
@@ -0,0 +1,269 @@
+--
+-- SELECT
+--
+
+-- btree index
+-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT * FROM onek
+ WHERE onek.unique1 < 10
+ ORDER BY onek.unique1;
+
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >;
+
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek.unique1, onek.stringu1 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY stringu1 using <;
+
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1d -2 +0nr -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using <, unique1 using >;
+
+--
+-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data |
+-- sort +1dr -2 +0n -1
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 > 980
+ ORDER BY string4 using >, unique1 using <;
+
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0nr -1 +1d -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using >, string4 using <;
+
+--
+-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data |
+-- sort +0n -1 +1dr -2
+--
+SELECT onek.unique1, onek.string4 FROM onek
+ WHERE onek.unique1 < 20
+ ORDER BY unique1 using <, string4 using >;
+
+--
+-- test partial btree indexes
+--
+-- As of 7.2, planner probably won't pick an indexscan without stats,
+-- so ANALYZE first. Also, we want to prevent it from picking a bitmapscan
+-- followed by sort, because that could hide index ordering problems.
+--
+ANALYZE onek2;
+
+SET enable_seqscan TO off;
+SET enable_bitmapscan TO off;
+SET enable_sort TO off;
+
+--
+-- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1
+--
+SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10;
+
+--
+-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 < 20
+ ORDER BY unique1 using >;
+
+--
+-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2
+--
+SELECT onek2.unique1, onek2.stringu1 FROM onek2
+ WHERE onek2.unique1 > 980;
+
+RESET enable_seqscan;
+RESET enable_bitmapscan;
+RESET enable_sort;
+
+
+SELECT two, stringu1, ten, string4
+ INTO TABLE tmp
+ FROM onek;
+
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=2){print $4,$5;}else{print;}}' - stud_emp.data
+--
+-- SELECT name, age FROM person*; ??? check if different
+SELECT p.name, p.age FROM person* p;
+
+--
+-- awk '{print $1,$2;}' person.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $4,$5;}else{print;}}' - stud_emp.data |
+-- sort +1nr -2
+--
+SELECT p.name, p.age FROM person* p ORDER BY age using >, name;
+
+--
+-- Test some cases involving whole-row Var referencing a subquery
+--
+select foo from (select 1 offset 0) as foo;
+select foo from (select null offset 0) as foo;
+select foo from (select 'xyzzy',1,null offset 0) as foo;
+
+--
+-- Test VALUES lists
+--
+select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
+ WHERE onek.unique1 = v.i and onek.stringu1 = v.j;
+
+-- a more complex case
+-- looks like we're coding lisp :-)
+select * from onek,
+ (values ((select i from
+ (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i)
+ order by i asc limit 1))) bar (i)
+ where onek.unique1 = bar.i;
+
+-- try VALUES in a subquery
+select * from onek
+ where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99))
+ order by unique1;
+
+-- VALUES is also legal as a standalone query or a set-operation member
+VALUES (1,2), (3,4+4), (7,77.7);
+
+VALUES (1,2), (3,4+4), (7,77.7)
+UNION ALL
+SELECT 2+2, 57
+UNION ALL
+TABLE int8_tbl;
+
+-- corner case: VALUES with no columns
+CREATE TEMP TABLE nocols();
+INSERT INTO nocols DEFAULT VALUES;
+SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v;
+
+--
+-- Test ORDER BY options
+--
+
+CREATE TEMP TABLE foo (f1 int);
+
+INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1);
+
+SELECT * FROM foo ORDER BY f1;
+SELECT * FROM foo ORDER BY f1 ASC; -- same thing
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+SELECT * FROM foo ORDER BY f1 DESC;
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+
+-- check if indexscans do the right things
+CREATE INDEX fooi ON foo (f1);
+SET enable_sort = false;
+
+SELECT * FROM foo ORDER BY f1;
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+SELECT * FROM foo ORDER BY f1 DESC;
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+
+DROP INDEX fooi;
+CREATE INDEX fooi ON foo (f1 DESC);
+
+SELECT * FROM foo ORDER BY f1;
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+SELECT * FROM foo ORDER BY f1 DESC;
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+
+DROP INDEX fooi;
+CREATE INDEX fooi ON foo (f1 DESC NULLS LAST);
+
+SELECT * FROM foo ORDER BY f1;
+SELECT * FROM foo ORDER BY f1 NULLS FIRST;
+SELECT * FROM foo ORDER BY f1 DESC;
+SELECT * FROM foo ORDER BY f1 DESC NULLS LAST;
+
+--
+-- Test planning of some cases with partial indexes
+--
+
+-- partial index is usable
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+-- actually run the query with an analyze to use the partial index
+explain (costs off, analyze on, timing off, summary off)
+select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
+-- partial index predicate implies clause, so no need for retest
+explain (costs off)
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+select * from onek2 where unique2 = 11 and stringu1 < 'B';
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+-- but if it's an update target, must retest anyway
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update;
+-- partial index is not applicable
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'C';
+-- partial index implies clause, but bitmap scan must recheck predicate anyway
+SET enable_indexscan TO off;
+explain (costs off)
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
+RESET enable_indexscan;
+-- check multi-index cases too
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+select unique1, unique2 from onek2
+ where (unique2 = 11 or unique1 = 0) and stringu1 < 'B';
+explain (costs off)
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+select unique1, unique2 from onek2
+ where (unique2 = 11 and stringu1 < 'B') or unique1 = 0;
+
+--
+-- Test some corner cases that have been known to confuse the planner
+--
+
+-- ORDER BY on a constant doesn't really need any sorting
+SELECT 1 AS x ORDER BY x;
+
+-- But ORDER BY on a set-valued expression does
+create function sillysrf(int) returns setof int as
+ 'values (1),(10),(2),($1)' language sql immutable;
+
+select sillysrf(42);
+select sillysrf(-1) order by 1;
+
+drop function sillysrf(int);
+
+-- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict
+-- (see bug #5084)
+select * from (values (2),(null),(1)) v(k) where k = k order by k;
+select * from (values (2),(null),(1)) v(k) where k = k;
+
+-- Test partitioned tables with no partitions, which should be handled the
+-- same as the non-inheritance case when expanding its RTE.
+create table list_parted_tbl (a int,b int) partition by list (a);
+create table list_parted_tbl1 partition of list_parted_tbl
+ for values in (1) partition by list(b);
+explain (costs off) select * from list_parted_tbl;
+drop table list_parted_tbl;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_distinct.out b/yql/essentials/tests/postgresql/original/cases/select_distinct.out
new file mode 100644
index 0000000000..11c6f50fbf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_distinct.out
@@ -0,0 +1,308 @@
+--
+-- SELECT_DISTINCT
+--
+--
+-- awk '{print $3;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT two FROM tmp ORDER BY 1;
+ two
+-----
+ 0
+ 1
+(2 rows)
+
+--
+-- awk '{print $5;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT ten FROM tmp ORDER BY 1;
+ ten
+-----
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+--
+-- awk '{print $16;}' onek.data | sort -d | uniq
+--
+SELECT DISTINCT string4 FROM tmp ORDER BY 1;
+ string4
+---------
+ AAAAxx
+ HHHHxx
+ OOOOxx
+ VVVVxx
+(4 rows)
+
+--
+-- awk '{print $3,$16,$5;}' onek.data | sort -d | uniq |
+-- sort +0n -1 +1d -2 +2n -3
+--
+SELECT DISTINCT two, string4, ten
+ FROM tmp
+ ORDER BY two using <, string4 using <, ten using <;
+ two | string4 | ten
+-----+---------+-----
+ 0 | AAAAxx | 0
+ 0 | AAAAxx | 2
+ 0 | AAAAxx | 4
+ 0 | AAAAxx | 6
+ 0 | AAAAxx | 8
+ 0 | HHHHxx | 0
+ 0 | HHHHxx | 2
+ 0 | HHHHxx | 4
+ 0 | HHHHxx | 6
+ 0 | HHHHxx | 8
+ 0 | OOOOxx | 0
+ 0 | OOOOxx | 2
+ 0 | OOOOxx | 4
+ 0 | OOOOxx | 6
+ 0 | OOOOxx | 8
+ 0 | VVVVxx | 0
+ 0 | VVVVxx | 2
+ 0 | VVVVxx | 4
+ 0 | VVVVxx | 6
+ 0 | VVVVxx | 8
+ 1 | AAAAxx | 1
+ 1 | AAAAxx | 3
+ 1 | AAAAxx | 5
+ 1 | AAAAxx | 7
+ 1 | AAAAxx | 9
+ 1 | HHHHxx | 1
+ 1 | HHHHxx | 3
+ 1 | HHHHxx | 5
+ 1 | HHHHxx | 7
+ 1 | HHHHxx | 9
+ 1 | OOOOxx | 1
+ 1 | OOOOxx | 3
+ 1 | OOOOxx | 5
+ 1 | OOOOxx | 7
+ 1 | OOOOxx | 9
+ 1 | VVVVxx | 1
+ 1 | VVVVxx | 3
+ 1 | VVVVxx | 5
+ 1 | VVVVxx | 7
+ 1 | VVVVxx | 9
+(40 rows)
+
+--
+-- awk '{print $2;}' person.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $5;}else{print;}}' - stud_emp.data |
+-- sort -n -r | uniq
+--
+SELECT DISTINCT p.age FROM person* p ORDER BY age using >;
+ age
+-----
+ 98
+ 88
+ 78
+ 68
+ 60
+ 58
+ 50
+ 48
+ 40
+ 38
+ 34
+ 30
+ 28
+ 25
+ 24
+ 23
+ 20
+ 19
+ 18
+ 8
+(20 rows)
+
+--
+-- Check mentioning same column more than once
+--
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) ss;
+ QUERY PLAN
+--------------------------------------------------------
+ Aggregate
+ Output: count(*)
+ -> HashAggregate
+ Output: tenk1.two, tenk1.four, tenk1.two
+ Group Key: tenk1.two, tenk1.four, tenk1.two
+ -> Seq Scan on public.tenk1
+ Output: tenk1.two, tenk1.four, tenk1.two
+(7 rows)
+
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) ss;
+ count
+-------
+ 4
+(1 row)
+
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+SET work_mem='64kB';
+-- Produce results with sorting.
+SET enable_hashagg=FALSE;
+SET jit_above_cost=0;
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+ QUERY PLAN
+------------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: ((g % 1000))
+ -> Function Scan on generate_series g
+(4 rows)
+
+CREATE TABLE distinct_group_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+SET jit_above_cost TO DEFAULT;
+CREATE TABLE distinct_group_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+SET enable_hashagg=TRUE;
+-- Produce results with hash aggregation.
+SET enable_sort=FALSE;
+SET jit_above_cost=0;
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+ QUERY PLAN
+------------------------------------------
+ HashAggregate
+ Group Key: (g % 1000)
+ -> Function Scan on generate_series g
+(3 rows)
+
+CREATE TABLE distinct_hash_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+SET jit_above_cost TO DEFAULT;
+CREATE TABLE distinct_hash_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+SET enable_sort=TRUE;
+SET work_mem TO DEFAULT;
+-- Compare results
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+ ?column?
+----------
+(0 rows)
+
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+ ?column?
+----------
+(0 rows)
+
+DROP TABLE distinct_hash_1;
+DROP TABLE distinct_hash_2;
+DROP TABLE distinct_group_1;
+DROP TABLE distinct_group_2;
+--
+-- Also, some tests of IS DISTINCT FROM, which doesn't quite deserve its
+-- very own regression file.
+--
+CREATE TEMP TABLE disttable (f1 integer);
+INSERT INTO DISTTABLE VALUES(1);
+INSERT INTO DISTTABLE VALUES(2);
+INSERT INTO DISTTABLE VALUES(3);
+INSERT INTO DISTTABLE VALUES(NULL);
+-- basic cases
+SELECT f1, f1 IS DISTINCT FROM 2 as "not 2" FROM disttable;
+ f1 | not 2
+----+-------
+ 1 | t
+ 2 | f
+ 3 | t
+ | t
+(4 rows)
+
+SELECT f1, f1 IS DISTINCT FROM NULL as "not null" FROM disttable;
+ f1 | not null
+----+----------
+ 1 | t
+ 2 | t
+ 3 | t
+ | f
+(4 rows)
+
+SELECT f1, f1 IS DISTINCT FROM f1 as "false" FROM disttable;
+ f1 | false
+----+-------
+ 1 | f
+ 2 | f
+ 3 | f
+ | f
+(4 rows)
+
+SELECT f1, f1 IS DISTINCT FROM f1+1 as "not null" FROM disttable;
+ f1 | not null
+----+----------
+ 1 | t
+ 2 | t
+ 3 | t
+ | f
+(4 rows)
+
+-- check that optimizer constant-folds it properly
+SELECT 1 IS DISTINCT FROM 2 as "yes";
+ yes
+-----
+ t
+(1 row)
+
+SELECT 2 IS DISTINCT FROM 2 as "no";
+ no
+----
+ f
+(1 row)
+
+SELECT 2 IS DISTINCT FROM null as "yes";
+ yes
+-----
+ t
+(1 row)
+
+SELECT null IS DISTINCT FROM null as "no";
+ no
+----
+ f
+(1 row)
+
+-- negated form
+SELECT 1 IS NOT DISTINCT FROM 2 as "no";
+ no
+----
+ f
+(1 row)
+
+SELECT 2 IS NOT DISTINCT FROM 2 as "yes";
+ yes
+-----
+ t
+(1 row)
+
+SELECT 2 IS NOT DISTINCT FROM null as "no";
+ no
+----
+ f
+(1 row)
+
+SELECT null IS NOT DISTINCT FROM null as "yes";
+ yes
+-----
+ t
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/select_distinct.sql b/yql/essentials/tests/postgresql/original/cases/select_distinct.sql
new file mode 100644
index 0000000000..33102744eb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_distinct.sql
@@ -0,0 +1,137 @@
+--
+-- SELECT_DISTINCT
+--
+
+--
+-- awk '{print $3;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT two FROM tmp ORDER BY 1;
+
+--
+-- awk '{print $5;}' onek.data | sort -n | uniq
+--
+SELECT DISTINCT ten FROM tmp ORDER BY 1;
+
+--
+-- awk '{print $16;}' onek.data | sort -d | uniq
+--
+SELECT DISTINCT string4 FROM tmp ORDER BY 1;
+
+--
+-- awk '{print $3,$16,$5;}' onek.data | sort -d | uniq |
+-- sort +0n -1 +1d -2 +2n -3
+--
+SELECT DISTINCT two, string4, ten
+ FROM tmp
+ ORDER BY two using <, string4 using <, ten using <;
+
+--
+-- awk '{print $2;}' person.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - emp.data |
+-- awk '{if(NF!=1){print $2;}else{print;}}' - student.data |
+-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $5;}else{print;}}' - stud_emp.data |
+-- sort -n -r | uniq
+--
+SELECT DISTINCT p.age FROM person* p ORDER BY age using >;
+
+--
+-- Check mentioning same column more than once
+--
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) ss;
+
+SELECT count(*) FROM
+ (SELECT DISTINCT two, four, two FROM tenk1) ss;
+
+--
+-- Compare results between plans using sorting and plans using hash
+-- aggregation. Force spilling in both cases by setting work_mem low.
+--
+
+SET work_mem='64kB';
+
+-- Produce results with sorting.
+
+SET enable_hashagg=FALSE;
+
+SET jit_above_cost=0;
+
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+
+CREATE TABLE distinct_group_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+
+SET jit_above_cost TO DEFAULT;
+
+CREATE TABLE distinct_group_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+
+SET enable_hashagg=TRUE;
+
+-- Produce results with hash aggregation.
+
+SET enable_sort=FALSE;
+
+SET jit_above_cost=0;
+
+EXPLAIN (costs off)
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+
+CREATE TABLE distinct_hash_1 AS
+SELECT DISTINCT g%1000 FROM generate_series(0,9999) g;
+
+SET jit_above_cost TO DEFAULT;
+
+CREATE TABLE distinct_hash_2 AS
+SELECT DISTINCT (g%1000)::text FROM generate_series(0,9999) g;
+
+SET enable_sort=TRUE;
+
+SET work_mem TO DEFAULT;
+
+-- Compare results
+
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+
+(SELECT * FROM distinct_hash_1 EXCEPT SELECT * FROM distinct_group_1)
+ UNION ALL
+(SELECT * FROM distinct_group_1 EXCEPT SELECT * FROM distinct_hash_1);
+
+DROP TABLE distinct_hash_1;
+DROP TABLE distinct_hash_2;
+DROP TABLE distinct_group_1;
+DROP TABLE distinct_group_2;
+
+--
+-- Also, some tests of IS DISTINCT FROM, which doesn't quite deserve its
+-- very own regression file.
+--
+
+CREATE TEMP TABLE disttable (f1 integer);
+INSERT INTO DISTTABLE VALUES(1);
+INSERT INTO DISTTABLE VALUES(2);
+INSERT INTO DISTTABLE VALUES(3);
+INSERT INTO DISTTABLE VALUES(NULL);
+
+-- basic cases
+SELECT f1, f1 IS DISTINCT FROM 2 as "not 2" FROM disttable;
+SELECT f1, f1 IS DISTINCT FROM NULL as "not null" FROM disttable;
+SELECT f1, f1 IS DISTINCT FROM f1 as "false" FROM disttable;
+SELECT f1, f1 IS DISTINCT FROM f1+1 as "not null" FROM disttable;
+
+-- check that optimizer constant-folds it properly
+SELECT 1 IS DISTINCT FROM 2 as "yes";
+SELECT 2 IS DISTINCT FROM 2 as "no";
+SELECT 2 IS DISTINCT FROM null as "yes";
+SELECT null IS DISTINCT FROM null as "no";
+
+-- negated form
+SELECT 1 IS NOT DISTINCT FROM 2 as "no";
+SELECT 2 IS NOT DISTINCT FROM 2 as "yes";
+SELECT 2 IS NOT DISTINCT FROM null as "no";
+SELECT null IS NOT DISTINCT FROM null as "yes";
diff --git a/yql/essentials/tests/postgresql/original/cases/select_distinct_on.out b/yql/essentials/tests/postgresql/original/cases/select_distinct_on.out
new file mode 100644
index 0000000000..b787b307f6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_distinct_on.out
@@ -0,0 +1,75 @@
+--
+-- SELECT_DISTINCT_ON
+--
+SELECT DISTINCT ON (string4) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using >, ten using <;
+ string4 | two | ten
+---------+-----+-----
+ AAAAxx | 1 | 1
+ HHHHxx | 1 | 1
+ OOOOxx | 1 | 1
+ VVVVxx | 1 | 1
+(4 rows)
+
+-- this will fail due to conflict of ordering requirements
+SELECT DISTINCT ON (string4, ten) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using <, ten using <;
+ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions
+LINE 1: SELECT DISTINCT ON (string4, ten) string4, two, ten
+ ^
+SELECT DISTINCT ON (string4, ten) string4, ten, two
+ FROM tmp
+ ORDER BY string4 using <, ten using >, two using <;
+ string4 | ten | two
+---------+-----+-----
+ AAAAxx | 9 | 1
+ AAAAxx | 8 | 0
+ AAAAxx | 7 | 1
+ AAAAxx | 6 | 0
+ AAAAxx | 5 | 1
+ AAAAxx | 4 | 0
+ AAAAxx | 3 | 1
+ AAAAxx | 2 | 0
+ AAAAxx | 1 | 1
+ AAAAxx | 0 | 0
+ HHHHxx | 9 | 1
+ HHHHxx | 8 | 0
+ HHHHxx | 7 | 1
+ HHHHxx | 6 | 0
+ HHHHxx | 5 | 1
+ HHHHxx | 4 | 0
+ HHHHxx | 3 | 1
+ HHHHxx | 2 | 0
+ HHHHxx | 1 | 1
+ HHHHxx | 0 | 0
+ OOOOxx | 9 | 1
+ OOOOxx | 8 | 0
+ OOOOxx | 7 | 1
+ OOOOxx | 6 | 0
+ OOOOxx | 5 | 1
+ OOOOxx | 4 | 0
+ OOOOxx | 3 | 1
+ OOOOxx | 2 | 0
+ OOOOxx | 1 | 1
+ OOOOxx | 0 | 0
+ VVVVxx | 9 | 1
+ VVVVxx | 8 | 0
+ VVVVxx | 7 | 1
+ VVVVxx | 6 | 0
+ VVVVxx | 5 | 1
+ VVVVxx | 4 | 0
+ VVVVxx | 3 | 1
+ VVVVxx | 2 | 0
+ VVVVxx | 1 | 1
+ VVVVxx | 0 | 0
+(40 rows)
+
+-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
+select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
+ r | f1
+---+-------------
+ 0 | -2147483647
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/select_distinct_on.sql b/yql/essentials/tests/postgresql/original/cases/select_distinct_on.sql
new file mode 100644
index 0000000000..d18733d274
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_distinct_on.sql
@@ -0,0 +1,19 @@
+--
+-- SELECT_DISTINCT_ON
+--
+
+SELECT DISTINCT ON (string4) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using >, ten using <;
+
+-- this will fail due to conflict of ordering requirements
+SELECT DISTINCT ON (string4, ten) string4, two, ten
+ FROM tmp
+ ORDER BY string4 using <, two using <, ten using <;
+
+SELECT DISTINCT ON (string4, ten) string4, ten, two
+ FROM tmp
+ ORDER BY string4 using <, ten using >, two using <;
+
+-- bug #5049: early 8.4.x chokes on volatile DISTINCT ON clauses
+select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_having.out b/yql/essentials/tests/postgresql/original/cases/select_having.out
new file mode 100644
index 0000000000..3950c0b404
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_having.out
@@ -0,0 +1,93 @@
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+ b | c
+---+----------
+ 1 | XXXX
+ 3 | bbbb
+(2 rows)
+
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+ b | c
+---+----------
+ 3 | BBBB
+ 3 | bbbb
+(2 rows)
+
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+ lower | count
+-------+-------
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(3 rows)
+
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+ c | max
+----------+-----
+ XXXX | 0
+ bbbb | 5
+(2 rows)
+
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+ min | max
+-----+-----
+(0 rows)
+
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+ min | max
+-----+-----
+ 0 | 9
+(1 row)
+
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+SELECT 1 AS one FROM test_having HAVING a > 1;
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+ one
+-----
+(0 rows)
+
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_having.sql b/yql/essentials/tests/postgresql/original/cases/select_having.sql
new file mode 100644
index 0000000000..bc0cdc0630
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_having.sql
@@ -0,0 +1,50 @@
+--
+-- SELECT_HAVING
+--
+
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+SELECT 1 AS one FROM test_having HAVING a > 1;
+
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_having_1.out b/yql/essentials/tests/postgresql/original/cases/select_having_1.out
new file mode 100644
index 0000000000..5c58da154c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_having_1.out
@@ -0,0 +1,93 @@
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+ b | c
+---+----------
+ 1 | XXXX
+ 3 | bbbb
+(2 rows)
+
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+ b | c
+---+----------
+ 3 | BBBB
+ 3 | bbbb
+(2 rows)
+
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+ lower | count
+-------+-------
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(3 rows)
+
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+ c | max
+----------+-----
+ bbbb | 5
+ XXXX | 0
+(2 rows)
+
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+ min | max
+-----+-----
+(0 rows)
+
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+ min | max
+-----+-----
+ 0 | 9
+(1 row)
+
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+SELECT 1 AS one FROM test_having HAVING a > 1;
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+ one
+-----
+(0 rows)
+
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_having_2.out b/yql/essentials/tests/postgresql/original/cases/select_having_2.out
new file mode 100644
index 0000000000..7087fb1c0c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_having_2.out
@@ -0,0 +1,93 @@
+--
+-- SELECT_HAVING
+--
+-- load test data
+CREATE TABLE test_having (a int, b int, c char(8), d char);
+INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
+INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
+INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING count(*) = 1 ORDER BY b, c;
+ b | c
+---+----------
+ 1 | XXXX
+ 3 | bbbb
+(2 rows)
+
+-- HAVING is effectively equivalent to WHERE in this case
+SELECT b, c FROM test_having
+ GROUP BY b, c HAVING b = 3 ORDER BY b, c;
+ b | c
+---+----------
+ 3 | bbbb
+ 3 | BBBB
+(2 rows)
+
+SELECT lower(c), count(c) FROM test_having
+ GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY lower(c);
+ lower | count
+-------+-------
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(3 rows)
+
+SELECT c, max(a) FROM test_having
+ GROUP BY c HAVING count(*) > 2 OR min(a) = max(a)
+ ORDER BY c;
+ c | max
+----------+-----
+ bbbb | 5
+ XXXX | 0
+(2 rows)
+
+-- test degenerate cases involving HAVING without GROUP BY
+-- Per SQL spec, these should generate 0 or 1 row, even without aggregates
+SELECT min(a), max(a) FROM test_having HAVING min(a) = max(a);
+ min | max
+-----+-----
+(0 rows)
+
+SELECT min(a), max(a) FROM test_having HAVING min(a) < max(a);
+ min | max
+-----+-----
+ 0 | 9
+(1 row)
+
+-- errors: ungrouped column references
+SELECT a FROM test_having HAVING min(a) < max(a);
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT a FROM test_having HAVING min(a) < max(a);
+ ^
+SELECT 1 AS one FROM test_having HAVING a > 1;
+ERROR: column "test_having.a" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: SELECT 1 AS one FROM test_having HAVING a > 1;
+ ^
+-- the really degenerate case: need not scan table at all
+SELECT 1 AS one FROM test_having HAVING 1 > 2;
+ one
+-----
+(0 rows)
+
+SELECT 1 AS one FROM test_having HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+-- and just to prove that we aren't scanning the table:
+SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2;
+ one
+-----
+ 1
+(1 row)
+
+DROP TABLE test_having;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_implicit.out b/yql/essentials/tests/postgresql/original/cases/select_implicit.out
new file mode 100644
index 0000000000..27c07de92c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_implicit.out
@@ -0,0 +1,338 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ CCCC | 2
+ XXXX | 1
+ bbbb | 1
+ cccc | 2
+(6 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ count
+-------
+ 2
+ 2
+ 2
+ 1
+ 1
+ 2
+(6 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+ c
+----------
+ XXXX
+ ABAB
+ ABAB
+ BBBB
+ BBBB
+ bbbb
+ cccc
+ cccc
+ CCCC
+ CCCC
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+ count
+-------
+ 4
+ 3
+ 2
+ 1
+(4 rows)
+
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+ count
+-------
+ 10
+(1 row)
+
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ CCCC | 2
+ XXXX | 1
+ bbbb | 1
+ cccc | 2
+(6 rows)
+
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ERROR: GROUP BY position 3 is not in select list
+LINE 1: SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b ORDER BY b;
+ ^
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+ a | a
+---+---
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+ 5 | 5
+ 6 | 6
+ 7 | 7
+ 8 | 8
+ 9 | 9
+(10 rows)
+
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 0 | 0
+ 1 | 1
+ 1 | 1
+ 2 | 2
+ 2 | 2
+ 3 | 3
+ 3 | 3
+ 4 | 4
+ 4 | 4
+(10 rows)
+
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(5 rows)
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+SELECT * FROM test_missing_target2;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+ ?column? | count
+----------+-------
+ 0 | 5
+ 1 | 5
+(2 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+ count
+-------
+ 2
+ 3
+ 4
+ 1
+(4 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+ lower | count
+-------+-------
+ abab | 2
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+ a
+---
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+ count
+-------
+ 7
+ 3
+(2 rows)
+
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b/2 ORDER BY b/2;
+ ^
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+ ?column? | count
+----------+-------
+ 0 | 1
+ 1 | 5
+ 2 | 4
+(3 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+ERROR: column reference "b" is ambiguous
+LINE 1: SELECT count(b) FROM test_missing_target x, test_missing_tar...
+ ^
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+SELECT * FROM test_missing_target3;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- Cleanup
+DROP TABLE test_missing_target;
+DROP TABLE test_missing_target2;
+DROP TABLE test_missing_target3;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_implicit.sql b/yql/essentials/tests/postgresql/original/cases/select_implicit.sql
new file mode 100644
index 0000000000..de3aef8d81
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_implicit.sql
@@ -0,0 +1,156 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+
+
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+SELECT * FROM test_missing_target2;
+
+
+-- Functions and expressions
+
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+SELECT * FROM test_missing_target3;
+
+-- Cleanup
+DROP TABLE test_missing_target;
+DROP TABLE test_missing_target2;
+DROP TABLE test_missing_target3;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_implicit_1.out b/yql/essentials/tests/postgresql/original/cases/select_implicit_1.out
new file mode 100644
index 0000000000..d67521e8f8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_implicit_1.out
@@ -0,0 +1,338 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ bbbb | 1
+ CCCC | 2
+ cccc | 2
+ XXXX | 1
+(6 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ count
+-------
+ 2
+ 2
+ 1
+ 2
+ 2
+ 1
+(6 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+ c
+----------
+ XXXX
+ ABAB
+ ABAB
+ BBBB
+ BBBB
+ bbbb
+ cccc
+ cccc
+ CCCC
+ CCCC
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+ count
+-------
+ 4
+ 3
+ 2
+ 1
+(4 rows)
+
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+ count
+-------
+ 10
+(1 row)
+
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+ c | count
+----------+-------
+ ABAB | 2
+ BBBB | 2
+ bbbb | 1
+ CCCC | 2
+ cccc | 2
+ XXXX | 1
+(6 rows)
+
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ERROR: GROUP BY position 3 is not in select list
+LINE 1: SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b ORDER BY b;
+ ^
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+ a | a
+---+---
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+ 5 | 5
+ 6 | 6
+ 7 | 7
+ 8 | 8
+ 9 | 9
+(10 rows)
+
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 0 | 0
+ 1 | 1
+ 1 | 1
+ 2 | 2
+ 2 | 2
+ 3 | 3
+ 3 | 3
+ 4 | 4
+ 4 | 4
+(10 rows)
+
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(5 rows)
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+SELECT * FROM test_missing_target2;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+ ?column? | count
+----------+-------
+ 0 | 5
+ 1 | 5
+(2 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+ count
+-------
+ 2
+ 3
+ 4
+ 1
+(4 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+ lower | count
+-------+-------
+ abab | 2
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+ a
+---
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+ count
+-------
+ 7
+ 3
+(2 rows)
+
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b/2 ORDER BY b/2;
+ ^
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+ ?column? | count
+----------+-------
+ 0 | 1
+ 1 | 5
+ 2 | 4
+(3 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+ERROR: column reference "b" is ambiguous
+LINE 1: SELECT count(b) FROM test_missing_target x, test_missing_tar...
+ ^
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+SELECT * FROM test_missing_target3;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- Cleanup
+DROP TABLE test_missing_target;
+DROP TABLE test_missing_target2;
+DROP TABLE test_missing_target3;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_implicit_2.out b/yql/essentials/tests/postgresql/original/cases/select_implicit_2.out
new file mode 100644
index 0000000000..7a353d0862
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_implicit_2.out
@@ -0,0 +1,338 @@
+--
+-- SELECT_IMPLICIT
+-- Test cases for queries with ordering terms missing from the target list.
+-- This used to be called "junkfilter.sql".
+-- The parser uses the term "resjunk" to handle these cases.
+-- - thomas 1998-07-09
+--
+-- load test data
+CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
+INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
+INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b');
+INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c');
+INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
+INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
+INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
+INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
+INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
+INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
+INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
+-- w/ existing GROUP BY target
+SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ c | count
+----------+-------
+ ABAB | 2
+ bbbb | 1
+ BBBB | 2
+ cccc | 2
+ CCCC | 2
+ XXXX | 1
+(6 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c;
+ count
+-------
+ 2
+ 1
+ 2
+ 2
+ 2
+ 1
+(6 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT test_missing_target.b, count(*)
+ FROM test_missing_target GROUP BY b ORDER BY b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT c FROM test_missing_target ORDER BY a;
+ c
+----------
+ XXXX
+ ABAB
+ ABAB
+ BBBB
+ BBBB
+ bbbb
+ cccc
+ cccc
+ CCCC
+ CCCC
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
+ count
+-------
+ 4
+ 3
+ 2
+ 1
+(4 rows)
+
+-- group using reference number
+SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
+ count
+-------
+ 10
+(1 row)
+
+-- order using reference number
+SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1;
+ c | count
+----------+-------
+ ABAB | 2
+ bbbb | 1
+ BBBB | 2
+ cccc | 2
+ CCCC | 2
+ XXXX | 1
+(6 rows)
+
+-- group using reference number out of range
+-- failure expected
+SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ERROR: GROUP BY position 3 is not in select list
+LINE 1: SELECT c, count(*) FROM test_missing_target GROUP BY 3;
+ ^
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b ORDER BY b;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b ORDER BY b;
+ ^
+-- order w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a, a FROM test_missing_target
+ ORDER BY a;
+ a | a
+---+---
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+ 5 | 5
+ 6 | 6
+ 7 | 7
+ 8 | 8
+ 9 | 9
+(10 rows)
+
+-- order expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 0 | 0
+ 1 | 1
+ 1 | 1
+ 2 | 2
+ 2 | 2
+ 3 | 3
+ 3 | 3
+ 4 | 4
+ 4 | 4
+(10 rows)
+
+-- group expression w/ target under ambiguous condition
+-- failure NOT expected
+SELECT a/2, a/2 FROM test_missing_target
+ GROUP BY a/2 ORDER BY a/2;
+ ?column? | ?column?
+----------+----------
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(5 rows)
+
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ b | count
+---+-------
+ 1 | 1
+ 2 | 2
+ 3 | 3
+ 4 | 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+SELECT count(*) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target2 AS
+SELECT count(*)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b ORDER BY x.b;
+SELECT * FROM test_missing_target2;
+ count
+-------
+ 1
+ 2
+ 3
+ 4
+(4 rows)
+
+-- Functions and expressions
+-- w/ existing GROUP BY target
+SELECT a%2, count(b) FROM test_missing_target
+GROUP BY test_missing_target.a%2
+ORDER BY test_missing_target.a%2;
+ ?column? | count
+----------+-------
+ 0 | 5
+ 1 | 5
+(2 rows)
+
+-- w/o existing GROUP BY target using a relation name in GROUP BY clause
+SELECT count(c) FROM test_missing_target
+GROUP BY lower(test_missing_target.c)
+ORDER BY lower(test_missing_target.c);
+ count
+-------
+ 2
+ 3
+ 4
+ 1
+(4 rows)
+
+-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
+-- failure expected
+SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ERROR: column "test_missing_target.b" must appear in the GROUP BY clause or be used in an aggregate function
+LINE 1: ...ECT count(a) FROM test_missing_target GROUP BY a ORDER BY b;
+ ^
+-- w/o existing GROUP BY target and w/o existing same ORDER BY target
+SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- w/ existing GROUP BY target using a relation name in target
+SELECT lower(test_missing_target.c), count(c)
+ FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
+ lower | count
+-------+-------
+ abab | 2
+ bbbb | 3
+ cccc | 4
+ xxxx | 1
+(4 rows)
+
+-- w/o existing GROUP BY target
+SELECT a FROM test_missing_target ORDER BY upper(d);
+ a
+---
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+-- w/o existing ORDER BY target
+SELECT count(b) FROM test_missing_target
+ GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc;
+ count
+-------
+ 7
+ 3
+(2 rows)
+
+-- group w/o existing GROUP BY and ORDER BY target under ambiguous condition
+-- failure expected
+SELECT count(x.a) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY b/2 ORDER BY b/2;
+ERROR: column reference "b" is ambiguous
+LINE 3: GROUP BY b/2 ORDER BY b/2;
+ ^
+-- group w/ existing GROUP BY target under ambiguous condition
+SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+ ?column? | count
+----------+-------
+ 0 | 1
+ 1 | 5
+ 2 | 4
+(3 rows)
+
+-- group w/o existing GROUP BY target under ambiguous condition
+-- failure expected due to ambiguous b in count(b)
+SELECT count(b) FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2;
+ERROR: column reference "b" is ambiguous
+LINE 1: SELECT count(b) FROM test_missing_target x, test_missing_tar...
+ ^
+-- group w/o existing GROUP BY target under ambiguous condition
+-- into a table
+CREATE TABLE test_missing_target3 AS
+SELECT count(x.b)
+FROM test_missing_target x, test_missing_target y
+ WHERE x.a = y.a
+ GROUP BY x.b/2 ORDER BY x.b/2;
+SELECT * FROM test_missing_target3;
+ count
+-------
+ 1
+ 5
+ 4
+(3 rows)
+
+-- Cleanup
+DROP TABLE test_missing_target;
+DROP TABLE test_missing_target2;
+DROP TABLE test_missing_target3;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_into.out b/yql/essentials/tests/postgresql/original/cases/select_into.out
new file mode 100644
index 0000000000..43b8209d22
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_into.out
@@ -0,0 +1,222 @@
+--
+-- SELECT_INTO
+--
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek
+ WHERE onek.unique1 < 2;
+DROP TABLE sitmp1;
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek2
+ WHERE onek2.unique1 < 2;
+DROP TABLE sitmp1;
+--
+-- SELECT INTO and INSERT permission, if owner is not allowed to insert.
+--
+CREATE SCHEMA selinto_schema;
+CREATE USER regress_selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ REVOKE INSERT ON TABLES FROM regress_selinto_user;
+GRANT ALL ON SCHEMA selinto_schema TO public;
+SET SESSION AUTHORIZATION regress_selinto_user;
+-- WITH DATA, passes.
+CREATE TABLE selinto_schema.tbl_withdata1 (a)
+ AS SELECT generate_series(1,3) WITH DATA;
+INSERT INTO selinto_schema.tbl_withdata1 VALUES (4);
+ERROR: permission denied for table tbl_withdata1
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata2 (a) AS
+ SELECT generate_series(1,3) WITH DATA;
+ QUERY PLAN
+--------------------------------------
+ ProjectSet (actual rows=3 loops=1)
+ -> Result (actual rows=1 loops=1)
+(2 rows)
+
+-- WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata1 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata2 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+ QUERY PLAN
+-------------------------------
+ ProjectSet (never executed)
+ -> Result (never executed)
+(2 rows)
+
+-- EXECUTE and WITH DATA, passes.
+PREPARE data_sel AS SELECT generate_series(1,3);
+CREATE TABLE selinto_schema.tbl_withdata3 (a) AS
+ EXECUTE data_sel WITH DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata4 (a) AS
+ EXECUTE data_sel WITH DATA;
+ QUERY PLAN
+--------------------------------------
+ ProjectSet (actual rows=3 loops=1)
+ -> Result (actual rows=1 loops=1)
+(2 rows)
+
+-- EXECUTE and WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata3 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata4 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+ QUERY PLAN
+-------------------------------
+ ProjectSet (never executed)
+ -> Result (never executed)
+(2 rows)
+
+RESET SESSION AUTHORIZATION;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ GRANT INSERT ON TABLES TO regress_selinto_user;
+SET SESSION AUTHORIZATION regress_selinto_user;
+RESET SESSION AUTHORIZATION;
+DEALLOCATE data_sel;
+DROP SCHEMA selinto_schema CASCADE;
+NOTICE: drop cascades to 8 other objects
+DETAIL: drop cascades to table selinto_schema.tbl_withdata1
+drop cascades to table selinto_schema.tbl_withdata2
+drop cascades to table selinto_schema.tbl_nodata1
+drop cascades to table selinto_schema.tbl_nodata2
+drop cascades to table selinto_schema.tbl_withdata3
+drop cascades to table selinto_schema.tbl_withdata4
+drop cascades to table selinto_schema.tbl_nodata3
+drop cascades to table selinto_schema.tbl_nodata4
+DROP USER regress_selinto_user;
+-- Tests for WITH NO DATA and column name consistency
+CREATE TABLE ctas_base (i int, j int);
+INSERT INTO ctas_base VALUES (1, 2);
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base; -- Error
+ERROR: too many column names were specified
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base WITH NO DATA; -- Error
+ERROR: too many column names were specified
+CREATE TABLE ctas_nodata (ii, jj) AS SELECT i, j FROM ctas_base; -- OK
+CREATE TABLE ctas_nodata_2 (ii, jj) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+CREATE TABLE ctas_nodata_3 (ii) AS SELECT i, j FROM ctas_base; -- OK
+CREATE TABLE ctas_nodata_4 (ii) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+SELECT * FROM ctas_nodata;
+ ii | jj
+----+----
+ 1 | 2
+(1 row)
+
+SELECT * FROM ctas_nodata_2;
+ ii | jj
+----+----
+(0 rows)
+
+SELECT * FROM ctas_nodata_3;
+ ii | j
+----+---
+ 1 | 2
+(1 row)
+
+SELECT * FROM ctas_nodata_4;
+ ii | j
+----+---
+(0 rows)
+
+DROP TABLE ctas_base;
+DROP TABLE ctas_nodata;
+DROP TABLE ctas_nodata_2;
+DROP TABLE ctas_nodata_3;
+DROP TABLE ctas_nodata_4;
+--
+-- CREATE TABLE AS/SELECT INTO as last command in a SQL function
+-- have been known to cause problems
+--
+CREATE FUNCTION make_table() RETURNS VOID
+AS $$
+ CREATE TABLE created_table AS SELECT * FROM int8_tbl;
+$$ LANGUAGE SQL;
+SELECT make_table();
+ make_table
+------------
+
+(1 row)
+
+SELECT * FROM created_table;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- Try EXPLAIN ANALYZE SELECT INTO and EXPLAIN ANALYZE CREATE TABLE AS
+-- WITH NO DATA, but hide the outputs since they won't be stable.
+DO $$
+BEGIN
+ EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
+ EXECUTE 'EXPLAIN ANALYZE CREATE TABLE easi2 AS SELECT * FROM int8_tbl WITH NO DATA';
+END$$;
+DROP TABLE created_table;
+DROP TABLE easi, easi2;
+--
+-- Disallowed uses of SELECT ... INTO. All should fail
+--
+DECLARE foo CURSOR FOR SELECT 1 INTO b;
+ERROR: SELECT ... INTO is not allowed here
+LINE 1: DECLARE foo CURSOR FOR SELECT 1 INTO b;
+ ^
+COPY (SELECT 1 INTO frak UNION SELECT 2) TO 'blob';
+ERROR: COPY (SELECT INTO) is not supported
+SELECT * FROM (SELECT 1 INTO f) bar;
+ERROR: SELECT ... INTO is not allowed here
+LINE 1: SELECT * FROM (SELECT 1 INTO f) bar;
+ ^
+CREATE VIEW foo AS SELECT 1 INTO b;
+ERROR: views must not contain SELECT INTO
+INSERT INTO b SELECT 1 INTO f;
+ERROR: SELECT ... INTO is not allowed here
+LINE 1: INSERT INTO b SELECT 1 INTO f;
+ ^
+-- Test CREATE TABLE AS ... IF NOT EXISTS
+CREATE TABLE ctas_ine_tbl AS SELECT 1;
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+ERROR: relation "ctas_ine_tbl" already exists
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+NOTICE: relation "ctas_ine_tbl" already exists, skipping
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+ERROR: relation "ctas_ine_tbl" already exists
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+NOTICE: relation "ctas_ine_tbl" already exists, skipping
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+ERROR: relation "ctas_ine_tbl" already exists
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+NOTICE: relation "ctas_ine_tbl" already exists, skipping
+ QUERY PLAN
+------------
+(0 rows)
+
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+ERROR: relation "ctas_ine_tbl" already exists
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+NOTICE: relation "ctas_ine_tbl" already exists, skipping
+ QUERY PLAN
+------------
+(0 rows)
+
+PREPARE ctas_ine_query AS SELECT 1 / 0;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS EXECUTE ctas_ine_query; -- error
+ERROR: relation "ctas_ine_tbl" already exists
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS EXECUTE ctas_ine_query; -- ok
+NOTICE: relation "ctas_ine_tbl" already exists, skipping
+ QUERY PLAN
+------------
+(0 rows)
+
+DROP TABLE ctas_ine_tbl;
diff --git a/yql/essentials/tests/postgresql/original/cases/select_into.sql b/yql/essentials/tests/postgresql/original/cases/select_into.sql
new file mode 100644
index 0000000000..7e903c339a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/select_into.sql
@@ -0,0 +1,138 @@
+--
+-- SELECT_INTO
+--
+
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek
+ WHERE onek.unique1 < 2;
+
+DROP TABLE sitmp1;
+
+SELECT *
+ INTO TABLE sitmp1
+ FROM onek2
+ WHERE onek2.unique1 < 2;
+
+DROP TABLE sitmp1;
+
+--
+-- SELECT INTO and INSERT permission, if owner is not allowed to insert.
+--
+CREATE SCHEMA selinto_schema;
+CREATE USER regress_selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ REVOKE INSERT ON TABLES FROM regress_selinto_user;
+GRANT ALL ON SCHEMA selinto_schema TO public;
+
+SET SESSION AUTHORIZATION regress_selinto_user;
+-- WITH DATA, passes.
+CREATE TABLE selinto_schema.tbl_withdata1 (a)
+ AS SELECT generate_series(1,3) WITH DATA;
+INSERT INTO selinto_schema.tbl_withdata1 VALUES (4);
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata2 (a) AS
+ SELECT generate_series(1,3) WITH DATA;
+-- WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata1 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata2 (a) AS
+ SELECT generate_series(1,3) WITH NO DATA;
+-- EXECUTE and WITH DATA, passes.
+PREPARE data_sel AS SELECT generate_series(1,3);
+CREATE TABLE selinto_schema.tbl_withdata3 (a) AS
+ EXECUTE data_sel WITH DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_withdata4 (a) AS
+ EXECUTE data_sel WITH DATA;
+-- EXECUTE and WITH NO DATA, passes.
+CREATE TABLE selinto_schema.tbl_nodata3 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE selinto_schema.tbl_nodata4 (a) AS
+ EXECUTE data_sel WITH NO DATA;
+RESET SESSION AUTHORIZATION;
+
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ GRANT INSERT ON TABLES TO regress_selinto_user;
+
+SET SESSION AUTHORIZATION regress_selinto_user;
+RESET SESSION AUTHORIZATION;
+
+DEALLOCATE data_sel;
+DROP SCHEMA selinto_schema CASCADE;
+DROP USER regress_selinto_user;
+
+-- Tests for WITH NO DATA and column name consistency
+CREATE TABLE ctas_base (i int, j int);
+INSERT INTO ctas_base VALUES (1, 2);
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base; -- Error
+CREATE TABLE ctas_nodata (ii, jj, kk) AS SELECT i, j FROM ctas_base WITH NO DATA; -- Error
+CREATE TABLE ctas_nodata (ii, jj) AS SELECT i, j FROM ctas_base; -- OK
+CREATE TABLE ctas_nodata_2 (ii, jj) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+CREATE TABLE ctas_nodata_3 (ii) AS SELECT i, j FROM ctas_base; -- OK
+CREATE TABLE ctas_nodata_4 (ii) AS SELECT i, j FROM ctas_base WITH NO DATA; -- OK
+SELECT * FROM ctas_nodata;
+SELECT * FROM ctas_nodata_2;
+SELECT * FROM ctas_nodata_3;
+SELECT * FROM ctas_nodata_4;
+DROP TABLE ctas_base;
+DROP TABLE ctas_nodata;
+DROP TABLE ctas_nodata_2;
+DROP TABLE ctas_nodata_3;
+DROP TABLE ctas_nodata_4;
+
+--
+-- CREATE TABLE AS/SELECT INTO as last command in a SQL function
+-- have been known to cause problems
+--
+CREATE FUNCTION make_table() RETURNS VOID
+AS $$
+ CREATE TABLE created_table AS SELECT * FROM int8_tbl;
+$$ LANGUAGE SQL;
+
+SELECT make_table();
+
+SELECT * FROM created_table;
+
+-- Try EXPLAIN ANALYZE SELECT INTO and EXPLAIN ANALYZE CREATE TABLE AS
+-- WITH NO DATA, but hide the outputs since they won't be stable.
+DO $$
+BEGIN
+ EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
+ EXECUTE 'EXPLAIN ANALYZE CREATE TABLE easi2 AS SELECT * FROM int8_tbl WITH NO DATA';
+END$$;
+
+DROP TABLE created_table;
+DROP TABLE easi, easi2;
+
+--
+-- Disallowed uses of SELECT ... INTO. All should fail
+--
+DECLARE foo CURSOR FOR SELECT 1 INTO b;
+COPY (SELECT 1 INTO frak UNION SELECT 2) TO 'blob';
+SELECT * FROM (SELECT 1 INTO f) bar;
+CREATE VIEW foo AS SELECT 1 INTO b;
+INSERT INTO b SELECT 1 INTO f;
+
+-- Test CREATE TABLE AS ... IF NOT EXISTS
+CREATE TABLE ctas_ine_tbl AS SELECT 1;
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0; -- error
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0; -- ok
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- error
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS SELECT 1 / 0 WITH NO DATA; -- ok
+PREPARE ctas_ine_query AS SELECT 1 / 0;
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE ctas_ine_tbl AS EXECUTE ctas_ine_query; -- error
+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+ CREATE TABLE IF NOT EXISTS ctas_ine_tbl AS EXECUTE ctas_ine_query; -- ok
+DROP TABLE ctas_ine_tbl;
diff --git a/yql/essentials/tests/postgresql/original/cases/strings.out b/yql/essentials/tests/postgresql/original/cases/strings.out
new file mode 100644
index 0000000000..91aa819804
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/strings.out
@@ -0,0 +1,2272 @@
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+-- SQL string continuation syntax
+-- E021-03 character string literals
+SELECT 'first line'
+' - next line'
+ ' - third line'
+ AS "Three lines to one";
+ Three lines to one
+-------------------------------------
+ first line - next line - third line
+(1 row)
+
+-- illegal string continuation syntax
+SELECT 'first line'
+' - next line' /* this comment is not allowed here */
+' - third line'
+ AS "Illegal comment within continuation";
+ERROR: syntax error at or near "' - third line'"
+LINE 3: ' - third line'
+ ^
+-- Unicode escapes
+SET standard_conforming_strings TO on;
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+ data
+------
+ data
+(1 row)
+
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+ dat\+000061
+-------------
+ dat\+000061
+(1 row)
+
+SELECT U&'a\\b' AS "a\b";
+ a\b
+-----
+ a\b
+(1 row)
+
+SELECT U&' \' UESCAPE '!' AS "tricky";
+ tricky
+--------
+ \
+(1 row)
+
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+ \
+--------
+ tricky
+(1 row)
+
+SELECT U&'wrong: \061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT U&'wrong: \061';
+ ^
+HINT: Unicode escapes must be \XXXX or \+XXXXXX.
+SELECT U&'wrong: \+0061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT U&'wrong: \+0061';
+ ^
+HINT: Unicode escapes must be \XXXX or \+XXXXXX.
+SELECT U&'wrong: +0061' UESCAPE +;
+ERROR: UESCAPE must be followed by a simple string literal at or near "+"
+LINE 1: SELECT U&'wrong: +0061' UESCAPE +;
+ ^
+SELECT U&'wrong: +0061' UESCAPE '+';
+ERROR: invalid Unicode escape character at or near "'+'"
+LINE 1: SELECT U&'wrong: +0061' UESCAPE '+';
+ ^
+SELECT U&'wrong: \db99';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99';
+ ^
+SELECT U&'wrong: \db99xy';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99xy';
+ ^
+SELECT U&'wrong: \db99\\';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99\\';
+ ^
+SELECT U&'wrong: \db99\0061';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \db99\0061';
+ ^
+SELECT U&'wrong: \+00db99\+000061';
+ERROR: invalid Unicode surrogate pair
+LINE 1: SELECT U&'wrong: \+00db99\+000061';
+ ^
+SELECT U&'wrong: \+2FFFFF';
+ERROR: invalid Unicode escape value
+LINE 1: SELECT U&'wrong: \+2FFFFF';
+ ^
+-- while we're here, check the same cases in E-style literals
+SELECT E'd\u0061t\U00000061' AS "data";
+ data
+------
+ data
+(1 row)
+
+SELECT E'a\\b' AS "a\b";
+ a\b
+-----
+ a\b
+(1 row)
+
+SELECT E'wrong: \u061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT E'wrong: \u061';
+ ^
+HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.
+SELECT E'wrong: \U0061';
+ERROR: invalid Unicode escape
+LINE 1: SELECT E'wrong: \U0061';
+ ^
+HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.
+SELECT E'wrong: \udb99';
+ERROR: invalid Unicode surrogate pair at or near "'"
+LINE 1: SELECT E'wrong: \udb99';
+ ^
+SELECT E'wrong: \udb99xy';
+ERROR: invalid Unicode surrogate pair at or near "x"
+LINE 1: SELECT E'wrong: \udb99xy';
+ ^
+SELECT E'wrong: \udb99\\';
+ERROR: invalid Unicode surrogate pair at or near "\"
+LINE 1: SELECT E'wrong: \udb99\\';
+ ^
+SELECT E'wrong: \udb99\u0061';
+ERROR: invalid Unicode surrogate pair at or near "\u0061"
+LINE 1: SELECT E'wrong: \udb99\u0061';
+ ^
+SELECT E'wrong: \U0000db99\U00000061';
+ERROR: invalid Unicode surrogate pair at or near "\U00000061"
+LINE 1: SELECT E'wrong: \U0000db99\U00000061';
+ ^
+SELECT E'wrong: \U002FFFFF';
+ERROR: invalid Unicode escape value at or near "\U002FFFFF"
+LINE 1: SELECT E'wrong: \U002FFFFF';
+ ^
+SET standard_conforming_strings TO off;
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061...
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+SELECT U&' \' UESCAPE '!' AS "tricky";
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&' \' UESCAPE '!' AS "tricky";
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+ \
+--------
+ tricky
+(1 row)
+
+SELECT U&'wrong: \061';
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&'wrong: \061';
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+SELECT U&'wrong: \+0061';
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&'wrong: \+0061';
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+SELECT U&'wrong: +0061' UESCAPE '+';
+ERROR: unsafe use of string constant with Unicode escapes
+LINE 1: SELECT U&'wrong: +0061' UESCAPE '+';
+ ^
+DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
+RESET standard_conforming_strings;
+-- bytea
+SET bytea_output TO hex;
+SELECT E'\\xDeAdBeEf'::bytea;
+ bytea
+------------
+ \xdeadbeef
+(1 row)
+
+SELECT E'\\x De Ad Be Ef '::bytea;
+ bytea
+------------
+ \xdeadbeef
+(1 row)
+
+SELECT E'\\xDeAdBeE'::bytea;
+ERROR: invalid hexadecimal data: odd number of digits
+LINE 1: SELECT E'\\xDeAdBeE'::bytea;
+ ^
+SELECT E'\\xDeAdBeEx'::bytea;
+ERROR: invalid hexadecimal digit: "x"
+LINE 1: SELECT E'\\xDeAdBeEx'::bytea;
+ ^
+SELECT E'\\xDe00BeEf'::bytea;
+ bytea
+------------
+ \xde00beef
+(1 row)
+
+SELECT E'DeAdBeEf'::bytea;
+ bytea
+--------------------
+ \x4465416442654566
+(1 row)
+
+SELECT E'De\\000dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465006442654566
+(1 row)
+
+SELECT E'De\123dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465536442654566
+(1 row)
+
+SELECT E'De\\123dBeEf'::bytea;
+ bytea
+--------------------
+ \x4465536442654566
+(1 row)
+
+SELECT E'De\\678dBeEf'::bytea;
+ERROR: invalid input syntax for type bytea
+LINE 1: SELECT E'De\\678dBeEf'::bytea;
+ ^
+SET bytea_output TO escape;
+SELECT E'\\xDeAdBeEf'::bytea;
+ bytea
+------------------
+ \336\255\276\357
+(1 row)
+
+SELECT E'\\x De Ad Be Ef '::bytea;
+ bytea
+------------------
+ \336\255\276\357
+(1 row)
+
+SELECT E'\\xDe00BeEf'::bytea;
+ bytea
+------------------
+ \336\000\276\357
+(1 row)
+
+SELECT E'DeAdBeEf'::bytea;
+ bytea
+----------
+ DeAdBeEf
+(1 row)
+
+SELECT E'De\\000dBeEf'::bytea;
+ bytea
+-------------
+ De\000dBeEf
+(1 row)
+
+SELECT E'De\\123dBeEf'::bytea;
+ bytea
+----------
+ DeSdBeEf
+(1 row)
+
+--
+-- test conversions between various string types
+-- E021-10 implicit casting among the character data types
+--
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+ text(char)
+------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+ text(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+ text(name)
+------------
+ namefield
+(1 row)
+
+-- since this is an explicit cast, it should truncate w/o error:
+SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
+ char(text)
+------------
+ doh!
+ hi de ho n
+(2 rows)
+
+-- note: implicit-cast case is tested in char.sql
+SELECT CAST(f1 AS char(20)) AS "char(text)" FROM TEXT_TBL;
+ char(text)
+----------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL;
+ char(varchar)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
+ char(name)
+------------
+ namefield
+(1 row)
+
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+ varchar(text)
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+ varchar(char)
+---------------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+ varchar(name)
+---------------
+ namefield
+(1 row)
+
+--
+-- test SQL string functions
+-- E### and T### are feature reference numbers from SQL99
+--
+-- E021-09 trim function
+SELECT TRIM(BOTH FROM ' bunch o blanks ') = 'bunch o blanks' AS "bunch o blanks";
+ bunch o blanks
+----------------
+ t
+(1 row)
+
+SELECT TRIM(LEADING FROM ' bunch o blanks ') = 'bunch o blanks ' AS "bunch o blanks ";
+ bunch o blanks
+------------------
+ t
+(1 row)
+
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') = ' bunch o blanks' AS " bunch o blanks";
+ bunch o blanks
+------------------
+ t
+(1 row)
+
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') = 'some Xs' AS "some Xs";
+ some Xs
+---------
+ t
+(1 row)
+
+-- E021-06 substring expression
+SELECT SUBSTRING('1234567890' FROM 3) = '34567890' AS "34567890";
+ 34567890
+----------
+ t
+(1 row)
+
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
+ 456
+-----
+ t
+(1 row)
+
+-- test overflow cases
+SELECT SUBSTRING('string' FROM 2 FOR 2147483646) AS "tring";
+ tring
+-------
+ tring
+(1 row)
+
+SELECT SUBSTRING('string' FROM -10 FOR 2147483646) AS "string";
+ string
+--------
+ string
+(1 row)
+
+SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+-- T581 regular expression substring (with SQL's bizarre regexp syntax)
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"(b_d)#"%' ESCAPE '#') AS "bcd";
+ bcd
+-----
+ bcd
+(1 row)
+
+-- obsolete SQL99 syntax
+SELECT SUBSTRING('abcdefg' FROM 'a#"(b_d)#"%' FOR '#') AS "bcd";
+ bcd
+-----
+ bcd
+(1 row)
+
+-- No match should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '#"(b_d)#"%' ESCAPE '#') IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+-- Null inputs should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '%' ESCAPE NULL) IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT SUBSTRING(NULL SIMILAR '%' ESCAPE '#') IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR NULL ESCAPE '#') IS NULL AS "True";
+ True
+------
+ t
+(1 row)
+
+-- The first and last parts should act non-greedy
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"g' ESCAPE '#') AS "bcdef";
+ bcdef
+-------
+ bcdef
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*' ESCAPE '#') AS "abcdefg";
+ abcdefg
+---------
+ abcdefg
+(1 row)
+
+-- Vertical bar in any part affects only that part
+SELECT SUBSTRING('abcdefg' SIMILAR 'a|b#"%#"g' ESCAPE '#') AS "bcdef";
+ bcdef
+-------
+ bcdef
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"x|g' ESCAPE '#') AS "bcdef";
+ bcdef
+-------
+ bcdef
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%|ab#"g' ESCAPE '#') AS "bcdef";
+ bcdef
+-------
+ bcdef
+(1 row)
+
+-- Can't have more than two part separators
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*#"x' ESCAPE '#') AS "error";
+ERROR: SQL regular expression may not contain more than two escape-double-quote separators
+CONTEXT: SQL function "substring" statement 1
+-- Postgres extension: with 0 or 1 separator, assume parts 1 and 3 are empty
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%g' ESCAPE '#') AS "bcdefg";
+ bcdefg
+--------
+ bcdefg
+(1 row)
+
+SELECT SUBSTRING('abcdefg' SIMILAR 'a%g' ESCAPE '#') AS "abcdefg";
+ abcdefg
+---------
+ abcdefg
+(1 row)
+
+-- substring() with just two arguments is not allowed by SQL spec;
+-- we accept it, but we interpret the pattern as a POSIX regexp not SQL
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+ cde
+-----
+ cde
+(1 row)
+
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
+ cde
+-----
+ cde
+(1 row)
+
+-- Check behavior of SIMILAR TO, which uses largely the same regexp variant
+SELECT 'abcdefg' SIMILAR TO '_bcd%' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT 'abcdefg' SIMILAR TO 'bcd%' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '#' AS false;
+ false
+-------
+ f
+(1 row)
+
+SELECT 'abcd%' SIMILAR TO '_bcd#%' ESCAPE '#' AS true;
+ true
+------
+ t
+(1 row)
+
+-- Postgres uses '\' as the default escape character, which is not per spec
+SELECT 'abcdefg' SIMILAR TO '_bcd\%' AS false;
+ false
+-------
+ f
+(1 row)
+
+-- and an empty string to mean "no escape", which is also not per spec
+SELECT 'abcd\efg' SIMILAR TO '_bcd\%' ESCAPE '' AS true;
+ true
+------
+ t
+(1 row)
+
+-- these behaviors are per spec, though:
+SELECT 'abcdefg' SIMILAR TO '_bcd%' ESCAPE NULL AS null;
+ null
+------
+
+(1 row)
+
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '##' AS error;
+ERROR: invalid escape string
+HINT: Escape string must be empty or one character.
+-- Test back reference in regexp_replace
+SELECT regexp_replace('1112223333', E'(\\d{3})(\\d{3})(\\d{4})', E'(\\1) \\2-\\3');
+ regexp_replace
+----------------
+ (111) 222-3333
+(1 row)
+
+SELECT regexp_replace('AAA BBB CCC ', E'\\s+', ' ', 'g');
+ regexp_replace
+----------------
+ AAA BBB CCC
+(1 row)
+
+SELECT regexp_replace('AAA', '^|$', 'Z', 'g');
+ regexp_replace
+----------------
+ ZAAAZ
+(1 row)
+
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'gi');
+ regexp_replace
+----------------
+ Z Z
+(1 row)
+
+-- invalid regexp option
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'z');
+ERROR: invalid regular expression option: "z"
+-- set so we can tell NULL from empty string
+\pset null '\\N'
+-- return all matches from regexp
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
+ regexp_matches
+----------------
+ {bar,beque}
+(1 row)
+
+-- test case insensitive
+SELECT regexp_matches('foObARbEqUEbAz', $re$(bar)(beque)$re$, 'i');
+ regexp_matches
+----------------
+ {bAR,bEqUE}
+(1 row)
+
+-- global option - more than one match
+SELECT regexp_matches('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g');
+ regexp_matches
+----------------
+ {bar,beque}
+ {bazil,barf}
+(2 rows)
+
+-- empty capture group (matched empty string)
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.*)(beque)$re$);
+ regexp_matches
+----------------
+ {bar,"",beque}
+(1 row)
+
+-- no match
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)(beque)$re$);
+ regexp_matches
+----------------
+(0 rows)
+
+-- optional capture group did not match, null entry in array
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)?(beque)$re$);
+ regexp_matches
+------------------
+ {bar,NULL,beque}
+(1 row)
+
+-- no capture groups
+SELECT regexp_matches('foobarbequebaz', $re$barbeque$re$);
+ regexp_matches
+----------------
+ {barbeque}
+(1 row)
+
+-- start/end-of-line matches are of zero length
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '^', 'mg');
+ regexp_matches
+----------------
+ {""}
+ {""}
+ {""}
+ {""}
+(4 rows)
+
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '$', 'mg');
+ regexp_matches
+----------------
+ {""}
+ {""}
+ {""}
+ {""}
+(4 rows)
+
+SELECT regexp_matches('1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '^.?', 'mg');
+ regexp_matches
+----------------
+ {1}
+ {2}
+ {3}
+ {4}
+ {""}
+(5 rows)
+
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '.?$', 'mg');
+ regexp_matches
+----------------
+ {""}
+ {1}
+ {""}
+ {2}
+ {""}
+ {3}
+ {""}
+ {4}
+ {""}
+ {""}
+(10 rows)
+
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4', '.?$', 'mg');
+ regexp_matches
+----------------
+ {""}
+ {1}
+ {""}
+ {2}
+ {""}
+ {3}
+ {""}
+ {4}
+ {""}
+(9 rows)
+
+-- give me errors
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$, 'gz');
+ERROR: invalid regular expression option: "z"
+SELECT regexp_matches('foobarbequebaz', $re$(barbeque$re$);
+ERROR: invalid regular expression: parentheses () not balanced
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque){2,1}$re$);
+ERROR: invalid regular expression: invalid repetition count(s)
+-- split string on regexp
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s+$re$) AS foo;
+ foo | length
+-------+--------
+ the | 3
+ quick | 5
+ brown | 5
+ fox | 3
+ jumps | 5
+ over | 4
+ the | 3
+ lazy | 4
+ dog | 3
+(9 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s+$re$);
+ regexp_split_to_array
+-----------------------------------------------
+ {the,quick,brown,fox,jumps,over,the,lazy,dog}
+(1 row)
+
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s*$re$) AS foo;
+ foo | length
+-----+--------
+ t | 1
+ h | 1
+ e | 1
+ q | 1
+ u | 1
+ i | 1
+ c | 1
+ k | 1
+ b | 1
+ r | 1
+ o | 1
+ w | 1
+ n | 1
+ f | 1
+ o | 1
+ x | 1
+ j | 1
+ u | 1
+ m | 1
+ p | 1
+ s | 1
+ o | 1
+ v | 1
+ e | 1
+ r | 1
+ t | 1
+ h | 1
+ e | 1
+ l | 1
+ a | 1
+ z | 1
+ y | 1
+ d | 1
+ o | 1
+ g | 1
+(35 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s*$re$);
+ regexp_split_to_array
+-------------------------------------------------------------------------
+ {t,h,e,q,u,i,c,k,b,r,o,w,n,f,o,x,j,u,m,p,s,o,v,e,r,t,h,e,l,a,z,y,d,o,g}
+(1 row)
+
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '') AS foo;
+ foo | length
+-----+--------
+ t | 1
+ h | 1
+ e | 1
+ | 1
+ q | 1
+ u | 1
+ i | 1
+ c | 1
+ k | 1
+ | 1
+ b | 1
+ r | 1
+ o | 1
+ w | 1
+ n | 1
+ | 1
+ f | 1
+ o | 1
+ x | 1
+ | 1
+ j | 1
+ u | 1
+ m | 1
+ p | 1
+ s | 1
+ | 1
+ o | 1
+ v | 1
+ e | 1
+ r | 1
+ | 1
+ t | 1
+ h | 1
+ e | 1
+ | 1
+ l | 1
+ a | 1
+ z | 1
+ y | 1
+ | 1
+ d | 1
+ o | 1
+ g | 1
+(43 rows)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '');
+ regexp_split_to_array
+---------------------------------------------------------------------------------------------------------
+ {t,h,e," ",q,u,i,c,k," ",b,r,o,w,n," ",f,o,x," ",j,u,m,p,s," ",o,v,e,r," ",t,h,e," ",l,a,z,y," ",d,o,g}
+(1 row)
+
+-- case insensitive
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i') AS foo;
+ foo | length
+---------------------------+--------
+ th | 2
+ QUick bROWn FOx jUMPs ov | 25
+ r Th | 4
+ lazy dOG | 9
+(4 rows)
+
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i');
+ regexp_split_to_array
+-----------------------------------------------------
+ {th," QUick bROWn FOx jUMPs ov","r Th"," lazy dOG"}
+(1 row)
+
+-- no match of pattern
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', 'nomatch') AS foo;
+ foo | length
+---------------------------------------------+--------
+ the quick brown fox jumps over the lazy dog | 43
+(1 row)
+
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', 'nomatch');
+ regexp_split_to_array
+-------------------------------------------------
+ {"the quick brown fox jumps over the lazy dog"}
+(1 row)
+
+-- some corner cases
+SELECT regexp_split_to_array('123456','1');
+ regexp_split_to_array
+-----------------------
+ {"",23456}
+(1 row)
+
+SELECT regexp_split_to_array('123456','6');
+ regexp_split_to_array
+-----------------------
+ {12345,""}
+(1 row)
+
+SELECT regexp_split_to_array('123456','.');
+ regexp_split_to_array
+------------------------
+ {"","","","","","",""}
+(1 row)
+
+SELECT regexp_split_to_array('123456','');
+ regexp_split_to_array
+-----------------------
+ {1,2,3,4,5,6}
+(1 row)
+
+SELECT regexp_split_to_array('123456','(?:)');
+ regexp_split_to_array
+-----------------------
+ {1,2,3,4,5,6}
+(1 row)
+
+SELECT regexp_split_to_array('1','');
+ regexp_split_to_array
+-----------------------
+ {1}
+(1 row)
+
+-- errors
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'zippy') AS foo;
+ERROR: invalid regular expression option: "z"
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+ERROR: invalid regular expression option: "z"
+-- global option meaningless for regexp_split
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g') AS foo;
+ERROR: regexp_split_to_table() does not support the "global" option
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+ERROR: regexp_split_to_array() does not support the "global" option
+-- change NULL-display back
+\pset null ''
+-- E021-11 position expression
+SELECT POSITION('4' IN '1234567890') = '4' AS "4";
+ 4
+---
+ t
+(1 row)
+
+SELECT POSITION('5' IN '1234567890') = '5' AS "5";
+ 5
+---
+ t
+(1 row)
+
+-- T312 character overlay function
+SELECT OVERLAY('abcdef' PLACING '45' FROM 4) AS "abc45f";
+ abc45f
+--------
+ abc45f
+(1 row)
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5) AS "yabadaba";
+ yabadaba
+----------
+ yabadaba
+(1 row)
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5 FOR 0) AS "yabadabadoo";
+ yabadabadoo
+-------------
+ yabadabadoo
+(1 row)
+
+SELECT OVERLAY('babosa' PLACING 'ubb' FROM 2 FOR 4) AS "bubba";
+ bubba
+-------
+ bubba
+(1 row)
+
+--
+-- test LIKE
+-- Be sure to form every test as a LIKE/NOT LIKE pair.
+--
+-- simplest examples
+-- E061-04 like predicate
+SELECT 'hawkeye' LIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' LIKE 'H%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'H%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' LIKE 'indio%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'indio%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' LIKE 'h%eye' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE '_ndio' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE '_ndio' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'in__o' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE 'in__o' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'in_o' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' NOT LIKE 'in_o' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'abc'::name LIKE '_b_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'abc'::name NOT LIKE '_b_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'abc'::bytea LIKE '_b_'::bytea AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+ false
+-------
+ f
+(1 row)
+
+-- unused escape character
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT LIKE 'h%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE 'ind_o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE 'ind_o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+-- escape character
+-- E061-05 like predicate with escape clause
+SELECT 'h%' LIKE 'h#%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'h%' NOT LIKE 'h#%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'h%wkeye' NOT LIKE 'h#%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'h%wkeye' LIKE 'h#%%' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'h%wkeye' NOT LIKE 'h#%%' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'h%awkeye' LIKE 'h#%a%k%e' ESCAPE '#' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'h%awkeye' NOT LIKE 'h#%a%k%e' ESCAPE '#' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'indio' LIKE '_ndio' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'indio' NOT LIKE '_ndio' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'i_dio' LIKE 'i$_d_o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'i_dio' NOT LIKE 'i$_d_o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'i_dio' LIKE 'i$_nd_o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'i_dio' NOT LIKE 'i$_nd_o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'i_dio' LIKE 'i$_d%o' ESCAPE '$' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'i_dio' NOT LIKE 'i$_d%o' ESCAPE '$' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+ false
+-------
+ f
+(1 row)
+
+-- escape character same as pattern character
+SELECT 'maca' LIKE 'm%aca' ESCAPE '%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'maca' NOT LIKE 'm%aca' ESCAPE '%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'ma%a' LIKE 'm%a%%a' ESCAPE '%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'ma%a' NOT LIKE 'm%a%%a' ESCAPE '%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'bear' LIKE 'b_ear' ESCAPE '_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'bear' NOT LIKE 'b_ear' ESCAPE '_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'be_r' LIKE 'b_e__r' ESCAPE '_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'be_r' NOT LIKE 'b_e__r' ESCAPE '_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'be_r' LIKE '__e__r' ESCAPE '_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'be_r' NOT LIKE '__e__r' ESCAPE '_' AS "true";
+ true
+------
+ t
+(1 row)
+
+--
+-- test ILIKE (case-insensitive LIKE)
+-- Be sure to form every test as an ILIKE/NOT ILIKE pair.
+--
+SELECT 'hawkeye' ILIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' ILIKE 'H%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'H%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'hawkeye' ILIKE 'H%Eye' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'hawkeye' NOT ILIKE 'H%Eye' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'Hawkeye' ILIKE 'h%' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
+ false
+-------
+ f
+(1 row)
+
+SELECT 'ABC'::name ILIKE '_b_' AS "true";
+ true
+------
+ t
+(1 row)
+
+SELECT 'ABC'::name NOT ILIKE '_b_' AS "false";
+ false
+-------
+ f
+(1 row)
+
+--
+-- test %/_ combination cases, cf bugs #4821 and #5478
+--
+SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f;
+ t | t | f
+---+---+---
+ t | t | f
+(1 row)
+
+SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
+ t | t | f
+---+---+---
+ t | t | f
+(1 row)
+
+SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
+ t | t | f
+---+---+---
+ t | t | f
+(1 row)
+
+SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
+ t | t | f
+---+---+---
+ t | t | f
+(1 row)
+
+SELECT 'jack' LIKE '%____%' AS t;
+ t
+---
+ t
+(1 row)
+
+--
+-- basic tests of LIKE with indexes
+--
+CREATE TABLE texttest (a text PRIMARY KEY, b int);
+SELECT * FROM texttest WHERE a LIKE '%1%';
+ a | b
+---+---
+(0 rows)
+
+CREATE TABLE byteatest (a bytea PRIMARY KEY, b int);
+SELECT * FROM byteatest WHERE a LIKE '%1%';
+ a | b
+---+---
+(0 rows)
+
+DROP TABLE texttest, byteatest;
+--
+-- test implicit type conversion
+--
+-- E021-07 character concatenation
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+ Concat unknown types
+----------------------
+ unknown and unknown
+(1 row)
+
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+ Concat text to unknown type
+-----------------------------
+ text and unknown
+(1 row)
+
+SELECT char(20) 'characters' || ' and text' AS "Concat char to unknown type";
+ Concat char to unknown type
+-----------------------------
+ characters and text
+(1 row)
+
+SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
+ Concat text to char
+---------------------
+ text and characters
+(1 row)
+
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+ Concat text to varchar
+------------------------
+ text and varchar
+(1 row)
+
+--
+-- test substr with toasted text values
+--
+CREATE TABLE toasttest(f1 text);
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+ substr
+--------
+ 123
+ 123
+ 123
+ 123
+(4 rows)
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+ERROR: negative substring length not allowed
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+TRUNCATE TABLE toasttest;
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+-- expect >0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+ is_empty
+----------
+ f
+(1 row)
+
+TRUNCATE TABLE toasttest;
+ALTER TABLE toasttest set (toast_tuple_target = 4080);
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+-- expect 0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+ is_empty
+----------
+ t
+(1 row)
+
+DROP TABLE toasttest;
+--
+-- test substr with toasted bytea values
+--
+CREATE TABLE toasttest(f1 bytea);
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+ substr
+--------
+ 123
+ 123
+ 123
+ 123
+(4 rows)
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+ERROR: negative substring length not allowed
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+ substr
+--------
+ 567890
+ 567890
+ 567890
+ 567890
+(4 rows)
+
+DROP TABLE toasttest;
+-- test internally compressing datums
+-- this tests compressing a datum to a very small size which exercises a
+-- corner case in packed-varlena handling: even though small, the compressed
+-- datum must be given a 4-byte header because there are no bits to indicate
+-- compression in a 1-byte header
+CREATE TABLE toasttest (c char(4096));
+INSERT INTO toasttest VALUES('x');
+SELECT length(c), c::text FROM toasttest;
+ length | c
+--------+---
+ 1 | x
+(1 row)
+
+SELECT c FROM toasttest;
+ c
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ x
+(1 row)
+
+DROP TABLE toasttest;
+--
+-- test length
+--
+SELECT length('abcdef') AS "length_6";
+ length_6
+----------
+ 6
+(1 row)
+
+--
+-- test strpos
+--
+SELECT strpos('abcdef', 'cd') AS "pos_3";
+ pos_3
+-------
+ 3
+(1 row)
+
+SELECT strpos('abcdef', 'xy') AS "pos_0";
+ pos_0
+-------
+ 0
+(1 row)
+
+SELECT strpos('abcdef', '') AS "pos_1";
+ pos_1
+-------
+ 1
+(1 row)
+
+SELECT strpos('', 'xy') AS "pos_0";
+ pos_0
+-------
+ 0
+(1 row)
+
+SELECT strpos('', '') AS "pos_1";
+ pos_1
+-------
+ 1
+(1 row)
+
+--
+-- test replace
+--
+SELECT replace('abcdef', 'de', '45') AS "abc45f";
+ abc45f
+--------
+ abc45f
+(1 row)
+
+SELECT replace('yabadabadoo', 'ba', '123') AS "ya123da123doo";
+ ya123da123doo
+---------------
+ ya123da123doo
+(1 row)
+
+SELECT replace('yabadoo', 'bad', '') AS "yaoo";
+ yaoo
+------
+ yaoo
+(1 row)
+
+--
+-- test split_part
+--
+select split_part('','@',1) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('','@',-1) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','',1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','',2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','',-1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','',-2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','@',0) AS "an error";
+ERROR: field position must not be zero
+select split_part('joeuser@mydatabase','@@',1) AS "joeuser@mydatabase";
+ joeuser@mydatabase
+--------------------
+ joeuser@mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@@',2) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('joeuser@mydatabase','@',1) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',2) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@',3) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-1) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-2) AS "joeuser";
+ joeuser
+---------
+ joeuser
+(1 row)
+
+select split_part('joeuser@mydatabase','@',-3) AS "empty string";
+ empty string
+--------------
+
+(1 row)
+
+select split_part('@joeuser@mydatabase@','@',-2) AS "mydatabase";
+ mydatabase
+------------
+ mydatabase
+(1 row)
+
+--
+-- test to_hex
+--
+select to_hex(256*256*256 - 1) AS "ffffff";
+ ffffff
+--------
+ ffffff
+(1 row)
+
+select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
+ ffffffff
+----------
+ ffffffff
+(1 row)
+
+--
+-- MD5 test suite - from IETF RFC 1321
+-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
+--
+select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5(''::bytea) = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('a'::bytea) = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abc'::bytea) = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('message digest'::bytea) = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('abcdefghijklmnopqrstuvwxyz'::bytea) = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'::bytea) = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890'::bytea) = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+ TRUE
+------
+ t
+(1 row)
+
+--
+-- SHA-2
+--
+SET bytea_output TO hex;
+SELECT sha224('');
+ sha224
+------------------------------------------------------------
+ \xd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
+(1 row)
+
+SELECT sha224('The quick brown fox jumps over the lazy dog.');
+ sha224
+------------------------------------------------------------
+ \x619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c
+(1 row)
+
+SELECT sha256('');
+ sha256
+--------------------------------------------------------------------
+ \xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+(1 row)
+
+SELECT sha256('The quick brown fox jumps over the lazy dog.');
+ sha256
+--------------------------------------------------------------------
+ \xef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c
+(1 row)
+
+SELECT sha384('');
+ sha384
+----------------------------------------------------------------------------------------------------
+ \x38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
+(1 row)
+
+SELECT sha384('The quick brown fox jumps over the lazy dog.');
+ sha384
+----------------------------------------------------------------------------------------------------
+ \xed892481d8272ca6df370bf706e4d7bc1b5739fa2177aae6c50e946678718fc67a7af2819a021c2fc34e91bdb63409d7
+(1 row)
+
+SELECT sha512('');
+ sha512
+------------------------------------------------------------------------------------------------------------------------------------
+ \xcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
+(1 row)
+
+SELECT sha512('The quick brown fox jumps over the lazy dog.');
+ sha512
+------------------------------------------------------------------------------------------------------------------------------------
+ \x91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed
+(1 row)
+
+--
+-- encode/decode
+--
+SELECT encode('\x1234567890abcdef00', 'hex');
+ encode
+--------------------
+ 1234567890abcdef00
+(1 row)
+
+SELECT decode('1234567890abcdef00', 'hex');
+ decode
+----------------------
+ \x1234567890abcdef00
+(1 row)
+
+SELECT encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea, 'base64');
+ encode
+------------------------------------------------------------------------------
+ EjRWeJCrze8AARI0VniQq83vAAESNFZ4kKvN7wABEjRWeJCrze8AARI0VniQq83vAAESNFZ4kKvN+
+ 7wABEjRWeJCrze8AAQ==
+(1 row)
+
+SELECT decode(encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea,
+ 'base64'), 'base64');
+ decode
+------------------------------------------------------------------------------------------------------------------------------------------------
+ \x1234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef00011234567890abcdef0001
+(1 row)
+
+SELECT encode('\x1234567890abcdef00', 'escape');
+ encode
+-----------------------------
+ \x124Vx\220\253\315\357\000
+(1 row)
+
+SELECT decode(encode('\x1234567890abcdef00', 'escape'), 'escape');
+ decode
+----------------------
+ \x1234567890abcdef00
+(1 row)
+
+--
+-- get_bit/set_bit etc
+--
+SELECT get_bit('\x1234567890abcdef00'::bytea, 43);
+ get_bit
+---------
+ 1
+(1 row)
+
+SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+ERROR: index 99 out of valid range, 0..71
+SELECT set_bit('\x1234567890abcdef00'::bytea, 43, 0);
+ set_bit
+----------------------
+ \x1234567890a3cdef00
+(1 row)
+
+SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+ERROR: index 99 out of valid range, 0..71
+SELECT get_byte('\x1234567890abcdef00'::bytea, 3);
+ get_byte
+----------
+ 120
+(1 row)
+
+SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+ERROR: index 99 out of valid range, 0..8
+SELECT set_byte('\x1234567890abcdef00'::bytea, 7, 11);
+ set_byte
+----------------------
+ \x1234567890abcd0b00
+(1 row)
+
+SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+ERROR: index 99 out of valid range, 0..8
+--
+-- test behavior of escape_string_warning and standard_conforming_strings options
+--
+set escape_string_warning = off;
+set standard_conforming_strings = off;
+show escape_string_warning;
+ escape_string_warning
+-----------------------
+ off
+(1 row)
+
+show standard_conforming_strings;
+ standard_conforming_strings
+-----------------------------
+ off
+(1 row)
+
+set escape_string_warning = on;
+set standard_conforming_strings = on;
+show escape_string_warning;
+ escape_string_warning
+-----------------------
+ on
+(1 row)
+
+show standard_conforming_strings;
+ standard_conforming_strings
+-----------------------------
+ on
+(1 row)
+
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+set standard_conforming_strings = off;
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3,...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3,...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3,...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: ...bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' ...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: ...'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd'...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+WARNING: nonstandard use of \\ in a string literal
+LINE 1: ...'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as ...
+ ^
+HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+set escape_string_warning = off;
+set standard_conforming_strings = on;
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+set standard_conforming_strings = off;
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+ f1 | f2 | f3 | f4 | f5 | f6
+-------+--------+---------+-------+--------+----
+ a\bcd | a\b'cd | a\b''cd | abcd\ | ab\'cd | \\
+(1 row)
+
+reset standard_conforming_strings;
+--
+-- Additional string functions
+--
+SET bytea_output TO escape;
+SELECT initcap('hi THOMAS');
+ initcap
+-----------
+ Hi Thomas
+(1 row)
+
+SELECT lpad('hi', 5, 'xy');
+ lpad
+-------
+ xyxhi
+(1 row)
+
+SELECT lpad('hi', 5);
+ lpad
+-------
+ hi
+(1 row)
+
+SELECT lpad('hi', -5, 'xy');
+ lpad
+------
+
+(1 row)
+
+SELECT lpad('hello', 2);
+ lpad
+------
+ he
+(1 row)
+
+SELECT lpad('hi', 5, '');
+ lpad
+------
+ hi
+(1 row)
+
+SELECT rpad('hi', 5, 'xy');
+ rpad
+-------
+ hixyx
+(1 row)
+
+SELECT rpad('hi', 5);
+ rpad
+-------
+ hi
+(1 row)
+
+SELECT rpad('hi', -5, 'xy');
+ rpad
+------
+
+(1 row)
+
+SELECT rpad('hello', 2);
+ rpad
+------
+ he
+(1 row)
+
+SELECT rpad('hi', 5, '');
+ rpad
+------
+ hi
+(1 row)
+
+SELECT ltrim('zzzytrim', 'xyz');
+ ltrim
+-------
+ trim
+(1 row)
+
+SELECT translate('', '14', 'ax');
+ translate
+-----------
+
+(1 row)
+
+SELECT translate('12345', '14', 'ax');
+ translate
+-----------
+ a23x5
+(1 row)
+
+SELECT ascii('x');
+ ascii
+-------
+ 120
+(1 row)
+
+SELECT ascii('');
+ ascii
+-------
+ 0
+(1 row)
+
+SELECT chr(65);
+ chr
+-----
+ A
+(1 row)
+
+SELECT chr(0);
+ERROR: null character not permitted
+SELECT repeat('Pg', 4);
+ repeat
+----------
+ PgPgPgPg
+(1 row)
+
+SELECT repeat('Pg', -4);
+ repeat
+--------
+
+(1 row)
+
+SELECT SUBSTRING('1234567890'::bytea FROM 3) "34567890";
+ 34567890
+----------
+ 34567890
+(1 row)
+
+SELECT SUBSTRING('1234567890'::bytea FROM 4 FOR 3) AS "456";
+ 456
+-----
+ 456
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM 2 FOR 2147483646) AS "tring";
+ tring
+-------
+ tring
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM -10 FOR 2147483646) AS "string";
+ string
+--------
+ string
+(1 row)
+
+SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+ERROR: negative substring length not allowed
+SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ btrim
+-------
+ Tom
+(1 row)
+
+SELECT trim(leading E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ ltrim
+---------
+ Tom\000
+(1 row)
+
+SELECT trim(trailing E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+ rtrim
+---------
+ \000Tom
+(1 row)
+
+SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea);
+ btrim
+-------
+ trim
+(1 row)
+
+SELECT btrim(''::bytea, E'\\000'::bytea);
+ btrim
+-------
+
+(1 row)
+
+SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea);
+ btrim
+--------------
+ \000trim\000
+(1 row)
+
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'Th\\001omas'::bytea from 2),'escape');
+ encode
+-------------
+ TTh\x01omas
+(1 row)
+
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 8),'escape');
+ encode
+--------------------
+ Th\000omas\x02\x03
+(1 row)
+
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 5 for 3),'escape');
+ encode
+-----------------
+ Th\000o\x02\x03
+(1 row)
+
+SELECT bit_count('\x1234567890'::bytea);
+ bit_count
+-----------
+ 15
+(1 row)
+
+SELECT unistr('\0064at\+0000610');
+ unistr
+--------
+ data0
+(1 row)
+
+SELECT unistr('d\u0061t\U000000610');
+ unistr
+--------
+ data0
+(1 row)
+
+SELECT unistr('a\\b');
+ unistr
+--------
+ a\b
+(1 row)
+
+-- errors:
+SELECT unistr('wrong: \db99');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \db99\0061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \+00db99\+000061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \+2FFFFF');
+ERROR: invalid Unicode code point: 2FFFFF
+SELECT unistr('wrong: \udb99\u0061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \U0000db99\U00000061');
+ERROR: invalid Unicode surrogate pair
+SELECT unistr('wrong: \U002FFFFF');
+ERROR: invalid Unicode code point: 2FFFFF
+SELECT unistr('wrong: \xyz');
+ERROR: invalid Unicode escape
+HINT: Unicode escapes must be \XXXX, \+XXXXXX, \uXXXX, or \UXXXXXXXX.
diff --git a/yql/essentials/tests/postgresql/original/cases/strings.sql b/yql/essentials/tests/postgresql/original/cases/strings.sql
new file mode 100644
index 0000000000..2c502534c2
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/strings.sql
@@ -0,0 +1,761 @@
+--
+-- STRINGS
+-- Test various data entry syntaxes.
+--
+
+-- SQL string continuation syntax
+-- E021-03 character string literals
+SELECT 'first line'
+' - next line'
+ ' - third line'
+ AS "Three lines to one";
+
+-- illegal string continuation syntax
+SELECT 'first line'
+' - next line' /* this comment is not allowed here */
+' - third line'
+ AS "Illegal comment within continuation";
+
+-- Unicode escapes
+SET standard_conforming_strings TO on;
+
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+SELECT U&'a\\b' AS "a\b";
+
+SELECT U&' \' UESCAPE '!' AS "tricky";
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+
+SELECT U&'wrong: \061';
+SELECT U&'wrong: \+0061';
+SELECT U&'wrong: +0061' UESCAPE +;
+SELECT U&'wrong: +0061' UESCAPE '+';
+
+SELECT U&'wrong: \db99';
+SELECT U&'wrong: \db99xy';
+SELECT U&'wrong: \db99\\';
+SELECT U&'wrong: \db99\0061';
+SELECT U&'wrong: \+00db99\+000061';
+SELECT U&'wrong: \+2FFFFF';
+
+-- while we're here, check the same cases in E-style literals
+SELECT E'd\u0061t\U00000061' AS "data";
+SELECT E'a\\b' AS "a\b";
+SELECT E'wrong: \u061';
+SELECT E'wrong: \U0061';
+SELECT E'wrong: \udb99';
+SELECT E'wrong: \udb99xy';
+SELECT E'wrong: \udb99\\';
+SELECT E'wrong: \udb99\u0061';
+SELECT E'wrong: \U0000db99\U00000061';
+SELECT E'wrong: \U002FFFFF';
+
+SET standard_conforming_strings TO off;
+
+SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
+SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
+
+SELECT U&' \' UESCAPE '!' AS "tricky";
+SELECT 'tricky' AS U&"\" UESCAPE '!';
+
+SELECT U&'wrong: \061';
+SELECT U&'wrong: \+0061';
+SELECT U&'wrong: +0061' UESCAPE '+';
+
+RESET standard_conforming_strings;
+
+-- bytea
+SET bytea_output TO hex;
+SELECT E'\\xDeAdBeEf'::bytea;
+SELECT E'\\x De Ad Be Ef '::bytea;
+SELECT E'\\xDeAdBeE'::bytea;
+SELECT E'\\xDeAdBeEx'::bytea;
+SELECT E'\\xDe00BeEf'::bytea;
+SELECT E'DeAdBeEf'::bytea;
+SELECT E'De\\000dBeEf'::bytea;
+SELECT E'De\123dBeEf'::bytea;
+SELECT E'De\\123dBeEf'::bytea;
+SELECT E'De\\678dBeEf'::bytea;
+
+SET bytea_output TO escape;
+SELECT E'\\xDeAdBeEf'::bytea;
+SELECT E'\\x De Ad Be Ef '::bytea;
+SELECT E'\\xDe00BeEf'::bytea;
+SELECT E'DeAdBeEf'::bytea;
+SELECT E'De\\000dBeEf'::bytea;
+SELECT E'De\\123dBeEf'::bytea;
+
+--
+-- test conversions between various string types
+-- E021-10 implicit casting among the character data types
+--
+
+SELECT CAST(f1 AS text) AS "text(char)" FROM CHAR_TBL;
+
+SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL;
+
+SELECT CAST(name 'namefield' AS text) AS "text(name)";
+
+-- since this is an explicit cast, it should truncate w/o error:
+SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
+-- note: implicit-cast case is tested in char.sql
+
+SELECT CAST(f1 AS char(20)) AS "char(text)" FROM TEXT_TBL;
+
+SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL;
+
+SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
+
+SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
+
+SELECT CAST(f1 AS varchar) AS "varchar(char)" FROM CHAR_TBL;
+
+SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
+
+--
+-- test SQL string functions
+-- E### and T### are feature reference numbers from SQL99
+--
+
+-- E021-09 trim function
+SELECT TRIM(BOTH FROM ' bunch o blanks ') = 'bunch o blanks' AS "bunch o blanks";
+
+SELECT TRIM(LEADING FROM ' bunch o blanks ') = 'bunch o blanks ' AS "bunch o blanks ";
+
+SELECT TRIM(TRAILING FROM ' bunch o blanks ') = ' bunch o blanks' AS " bunch o blanks";
+
+SELECT TRIM(BOTH 'x' FROM 'xxxxxsome Xsxxxxx') = 'some Xs' AS "some Xs";
+
+-- E021-06 substring expression
+SELECT SUBSTRING('1234567890' FROM 3) = '34567890' AS "34567890";
+
+SELECT SUBSTRING('1234567890' FROM 4 FOR 3) = '456' AS "456";
+
+-- test overflow cases
+SELECT SUBSTRING('string' FROM 2 FOR 2147483646) AS "tring";
+SELECT SUBSTRING('string' FROM -10 FOR 2147483646) AS "string";
+SELECT SUBSTRING('string' FROM -10 FOR -2147483646) AS "error";
+
+-- T581 regular expression substring (with SQL's bizarre regexp syntax)
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"(b_d)#"%' ESCAPE '#') AS "bcd";
+-- obsolete SQL99 syntax
+SELECT SUBSTRING('abcdefg' FROM 'a#"(b_d)#"%' FOR '#') AS "bcd";
+
+-- No match should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '#"(b_d)#"%' ESCAPE '#') IS NULL AS "True";
+
+-- Null inputs should return NULL
+SELECT SUBSTRING('abcdefg' SIMILAR '%' ESCAPE NULL) IS NULL AS "True";
+SELECT SUBSTRING(NULL SIMILAR '%' ESCAPE '#') IS NULL AS "True";
+SELECT SUBSTRING('abcdefg' SIMILAR NULL ESCAPE '#') IS NULL AS "True";
+
+-- The first and last parts should act non-greedy
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"g' ESCAPE '#') AS "bcdef";
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*' ESCAPE '#') AS "abcdefg";
+
+-- Vertical bar in any part affects only that part
+SELECT SUBSTRING('abcdefg' SIMILAR 'a|b#"%#"g' ESCAPE '#') AS "bcdef";
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%#"x|g' ESCAPE '#') AS "bcdef";
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%|ab#"g' ESCAPE '#') AS "bcdef";
+
+-- Can't have more than two part separators
+SELECT SUBSTRING('abcdefg' SIMILAR 'a*#"%#"g*#"x' ESCAPE '#') AS "error";
+
+-- Postgres extension: with 0 or 1 separator, assume parts 1 and 3 are empty
+SELECT SUBSTRING('abcdefg' SIMILAR 'a#"%g' ESCAPE '#') AS "bcdefg";
+SELECT SUBSTRING('abcdefg' SIMILAR 'a%g' ESCAPE '#') AS "abcdefg";
+
+-- substring() with just two arguments is not allowed by SQL spec;
+-- we accept it, but we interpret the pattern as a POSIX regexp not SQL
+SELECT SUBSTRING('abcdefg' FROM 'c.e') AS "cde";
+
+-- With a parenthesized subexpression, return only what matches the subexpr
+SELECT SUBSTRING('abcdefg' FROM 'b(.*)f') AS "cde";
+
+-- Check behavior of SIMILAR TO, which uses largely the same regexp variant
+SELECT 'abcdefg' SIMILAR TO '_bcd%' AS true;
+SELECT 'abcdefg' SIMILAR TO 'bcd%' AS false;
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '#' AS false;
+SELECT 'abcd%' SIMILAR TO '_bcd#%' ESCAPE '#' AS true;
+-- Postgres uses '\' as the default escape character, which is not per spec
+SELECT 'abcdefg' SIMILAR TO '_bcd\%' AS false;
+-- and an empty string to mean "no escape", which is also not per spec
+SELECT 'abcd\efg' SIMILAR TO '_bcd\%' ESCAPE '' AS true;
+-- these behaviors are per spec, though:
+SELECT 'abcdefg' SIMILAR TO '_bcd%' ESCAPE NULL AS null;
+SELECT 'abcdefg' SIMILAR TO '_bcd#%' ESCAPE '##' AS error;
+
+-- Test back reference in regexp_replace
+SELECT regexp_replace('1112223333', E'(\\d{3})(\\d{3})(\\d{4})', E'(\\1) \\2-\\3');
+SELECT regexp_replace('AAA BBB CCC ', E'\\s+', ' ', 'g');
+SELECT regexp_replace('AAA', '^|$', 'Z', 'g');
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'gi');
+-- invalid regexp option
+SELECT regexp_replace('AAA aaa', 'A+', 'Z', 'z');
+
+-- set so we can tell NULL from empty string
+\pset null '\\N'
+
+-- return all matches from regexp
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
+
+-- test case insensitive
+SELECT regexp_matches('foObARbEqUEbAz', $re$(bar)(beque)$re$, 'i');
+
+-- global option - more than one match
+SELECT regexp_matches('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g');
+
+-- empty capture group (matched empty string)
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.*)(beque)$re$);
+-- no match
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)(beque)$re$);
+-- optional capture group did not match, null entry in array
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(.+)?(beque)$re$);
+
+-- no capture groups
+SELECT regexp_matches('foobarbequebaz', $re$barbeque$re$);
+
+-- start/end-of-line matches are of zero length
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '^', 'mg');
+SELECT regexp_matches('foo' || chr(10) || 'bar' || chr(10) || 'bequq' || chr(10) || 'baz', '$', 'mg');
+SELECT regexp_matches('1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '^.?', 'mg');
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4' || chr(10), '.?$', 'mg');
+SELECT regexp_matches(chr(10) || '1' || chr(10) || '2' || chr(10) || '3' || chr(10) || '4', '.?$', 'mg');
+
+-- give me errors
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$, 'gz');
+SELECT regexp_matches('foobarbequebaz', $re$(barbeque$re$);
+SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque){2,1}$re$);
+
+-- split string on regexp
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s+$re$) AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s+$re$);
+
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', $re$\s*$re$) AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', $re$\s*$re$);
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '') AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '');
+-- case insensitive
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'i');
+-- no match of pattern
+SELECT foo, length(foo) FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', 'nomatch') AS foo;
+SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', 'nomatch');
+-- some corner cases
+SELECT regexp_split_to_array('123456','1');
+SELECT regexp_split_to_array('123456','6');
+SELECT regexp_split_to_array('123456','.');
+SELECT regexp_split_to_array('123456','');
+SELECT regexp_split_to_array('123456','(?:)');
+SELECT regexp_split_to_array('1','');
+-- errors
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'zippy') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'iz');
+-- global option meaningless for regexp_split
+SELECT foo, length(foo) FROM regexp_split_to_table('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g') AS foo;
+SELECT regexp_split_to_array('thE QUick bROWn FOx jUMPs ovEr The lazy dOG', 'e', 'g');
+
+-- change NULL-display back
+\pset null ''
+
+-- E021-11 position expression
+SELECT POSITION('4' IN '1234567890') = '4' AS "4";
+
+SELECT POSITION('5' IN '1234567890') = '5' AS "5";
+
+-- T312 character overlay function
+SELECT OVERLAY('abcdef' PLACING '45' FROM 4) AS "abc45f";
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5) AS "yabadaba";
+
+SELECT OVERLAY('yabadoo' PLACING 'daba' FROM 5 FOR 0) AS "yabadabadoo";
+
+SELECT OVERLAY('babosa' PLACING 'ubb' FROM 2 FOR 4) AS "bubba";
+
+--
+-- test LIKE
+-- Be sure to form every test as a LIKE/NOT LIKE pair.
+--
+
+-- simplest examples
+-- E061-04 like predicate
+SELECT 'hawkeye' LIKE 'h%' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%' AS "false";
+
+SELECT 'hawkeye' LIKE 'H%' AS "false";
+SELECT 'hawkeye' NOT LIKE 'H%' AS "true";
+
+SELECT 'hawkeye' LIKE 'indio%' AS "false";
+SELECT 'hawkeye' NOT LIKE 'indio%' AS "true";
+
+SELECT 'hawkeye' LIKE 'h%eye' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%eye' AS "false";
+
+SELECT 'indio' LIKE '_ndio' AS "true";
+SELECT 'indio' NOT LIKE '_ndio' AS "false";
+
+SELECT 'indio' LIKE 'in__o' AS "true";
+SELECT 'indio' NOT LIKE 'in__o' AS "false";
+
+SELECT 'indio' LIKE 'in_o' AS "false";
+SELECT 'indio' NOT LIKE 'in_o' AS "true";
+
+SELECT 'abc'::name LIKE '_b_' AS "true";
+SELECT 'abc'::name NOT LIKE '_b_' AS "false";
+
+SELECT 'abc'::bytea LIKE '_b_'::bytea AS "true";
+SELECT 'abc'::bytea NOT LIKE '_b_'::bytea AS "false";
+
+-- unused escape character
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS "true";
+SELECT 'hawkeye' NOT LIKE 'h%' ESCAPE '#' AS "false";
+
+SELECT 'indio' LIKE 'ind_o' ESCAPE '$' AS "true";
+SELECT 'indio' NOT LIKE 'ind_o' ESCAPE '$' AS "false";
+
+-- escape character
+-- E061-05 like predicate with escape clause
+SELECT 'h%' LIKE 'h#%' ESCAPE '#' AS "true";
+SELECT 'h%' NOT LIKE 'h#%' ESCAPE '#' AS "false";
+
+SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false";
+SELECT 'h%wkeye' NOT LIKE 'h#%' ESCAPE '#' AS "true";
+
+SELECT 'h%wkeye' LIKE 'h#%%' ESCAPE '#' AS "true";
+SELECT 'h%wkeye' NOT LIKE 'h#%%' ESCAPE '#' AS "false";
+
+SELECT 'h%awkeye' LIKE 'h#%a%k%e' ESCAPE '#' AS "true";
+SELECT 'h%awkeye' NOT LIKE 'h#%a%k%e' ESCAPE '#' AS "false";
+
+SELECT 'indio' LIKE '_ndio' ESCAPE '$' AS "true";
+SELECT 'indio' NOT LIKE '_ndio' ESCAPE '$' AS "false";
+
+SELECT 'i_dio' LIKE 'i$_d_o' ESCAPE '$' AS "true";
+SELECT 'i_dio' NOT LIKE 'i$_d_o' ESCAPE '$' AS "false";
+
+SELECT 'i_dio' LIKE 'i$_nd_o' ESCAPE '$' AS "false";
+SELECT 'i_dio' NOT LIKE 'i$_nd_o' ESCAPE '$' AS "true";
+
+SELECT 'i_dio' LIKE 'i$_d%o' ESCAPE '$' AS "true";
+SELECT 'i_dio' NOT LIKE 'i$_d%o' ESCAPE '$' AS "false";
+
+SELECT 'a_c'::bytea LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "true";
+SELECT 'a_c'::bytea NOT LIKE 'a$__'::bytea ESCAPE '$'::bytea AS "false";
+
+-- escape character same as pattern character
+SELECT 'maca' LIKE 'm%aca' ESCAPE '%' AS "true";
+SELECT 'maca' NOT LIKE 'm%aca' ESCAPE '%' AS "false";
+
+SELECT 'ma%a' LIKE 'm%a%%a' ESCAPE '%' AS "true";
+SELECT 'ma%a' NOT LIKE 'm%a%%a' ESCAPE '%' AS "false";
+
+SELECT 'bear' LIKE 'b_ear' ESCAPE '_' AS "true";
+SELECT 'bear' NOT LIKE 'b_ear' ESCAPE '_' AS "false";
+
+SELECT 'be_r' LIKE 'b_e__r' ESCAPE '_' AS "true";
+SELECT 'be_r' NOT LIKE 'b_e__r' ESCAPE '_' AS "false";
+
+SELECT 'be_r' LIKE '__e__r' ESCAPE '_' AS "false";
+SELECT 'be_r' NOT LIKE '__e__r' ESCAPE '_' AS "true";
+
+
+--
+-- test ILIKE (case-insensitive LIKE)
+-- Be sure to form every test as an ILIKE/NOT ILIKE pair.
+--
+
+SELECT 'hawkeye' ILIKE 'h%' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'h%' AS "false";
+
+SELECT 'hawkeye' ILIKE 'H%' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'H%' AS "false";
+
+SELECT 'hawkeye' ILIKE 'H%Eye' AS "true";
+SELECT 'hawkeye' NOT ILIKE 'H%Eye' AS "false";
+
+SELECT 'Hawkeye' ILIKE 'h%' AS "true";
+SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
+
+SELECT 'ABC'::name ILIKE '_b_' AS "true";
+SELECT 'ABC'::name NOT ILIKE '_b_' AS "false";
+
+--
+-- test %/_ combination cases, cf bugs #4821 and #5478
+--
+
+SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f;
+SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
+
+SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
+SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
+
+SELECT 'jack' LIKE '%____%' AS t;
+
+
+--
+-- basic tests of LIKE with indexes
+--
+
+CREATE TABLE texttest (a text PRIMARY KEY, b int);
+SELECT * FROM texttest WHERE a LIKE '%1%';
+
+CREATE TABLE byteatest (a bytea PRIMARY KEY, b int);
+SELECT * FROM byteatest WHERE a LIKE '%1%';
+
+DROP TABLE texttest, byteatest;
+
+
+--
+-- test implicit type conversion
+--
+
+-- E021-07 character concatenation
+SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
+
+SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
+
+SELECT char(20) 'characters' || ' and text' AS "Concat char to unknown type";
+
+SELECT text 'text' || char(20) ' and characters' AS "Concat text to char";
+
+SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
+
+--
+-- test substr with toasted text values
+--
+CREATE TABLE toasttest(f1 text);
+
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+insert into toasttest values(repeat('1234567890',10000));
+insert into toasttest values(repeat('1234567890',10000));
+
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+
+TRUNCATE TABLE toasttest;
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+-- expect >0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+
+TRUNCATE TABLE toasttest;
+ALTER TABLE toasttest set (toast_tuple_target = 4080);
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+INSERT INTO toasttest values (repeat('1234567890',300));
+-- expect 0 blocks
+SELECT pg_relation_size(reltoastrelid) = 0 AS is_empty
+ FROM pg_class where relname = 'toasttest';
+
+DROP TABLE toasttest;
+
+--
+-- test substr with toasted bytea values
+--
+CREATE TABLE toasttest(f1 bytea);
+
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+
+--
+-- Ensure that some values are uncompressed, to test the faster substring
+-- operation used in that case
+--
+alter table toasttest alter column f1 set storage external;
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
+
+-- If the starting position is zero or less, then return from the start of the string
+-- adjusting the length to be consistent with the "negative start" per SQL.
+SELECT substr(f1, -1, 5) from toasttest;
+
+-- If the length is less than zero, an ERROR is thrown.
+SELECT substr(f1, 5, -1) from toasttest;
+
+-- If no third argument (length) is provided, the length to the end of the
+-- string is assumed.
+SELECT substr(f1, 99995) from toasttest;
+
+-- If start plus length is > string length, the result is truncated to
+-- string length
+SELECT substr(f1, 99995, 10) from toasttest;
+
+DROP TABLE toasttest;
+
+-- test internally compressing datums
+
+-- this tests compressing a datum to a very small size which exercises a
+-- corner case in packed-varlena handling: even though small, the compressed
+-- datum must be given a 4-byte header because there are no bits to indicate
+-- compression in a 1-byte header
+
+CREATE TABLE toasttest (c char(4096));
+INSERT INTO toasttest VALUES('x');
+SELECT length(c), c::text FROM toasttest;
+SELECT c FROM toasttest;
+DROP TABLE toasttest;
+
+--
+-- test length
+--
+
+SELECT length('abcdef') AS "length_6";
+
+--
+-- test strpos
+--
+
+SELECT strpos('abcdef', 'cd') AS "pos_3";
+
+SELECT strpos('abcdef', 'xy') AS "pos_0";
+
+SELECT strpos('abcdef', '') AS "pos_1";
+
+SELECT strpos('', 'xy') AS "pos_0";
+
+SELECT strpos('', '') AS "pos_1";
+
+--
+-- test replace
+--
+SELECT replace('abcdef', 'de', '45') AS "abc45f";
+
+SELECT replace('yabadabadoo', 'ba', '123') AS "ya123da123doo";
+
+SELECT replace('yabadoo', 'bad', '') AS "yaoo";
+
+--
+-- test split_part
+--
+select split_part('','@',1) AS "empty string";
+
+select split_part('','@',-1) AS "empty string";
+
+select split_part('joeuser@mydatabase','',1) AS "joeuser@mydatabase";
+
+select split_part('joeuser@mydatabase','',2) AS "empty string";
+
+select split_part('joeuser@mydatabase','',-1) AS "joeuser@mydatabase";
+
+select split_part('joeuser@mydatabase','',-2) AS "empty string";
+
+select split_part('joeuser@mydatabase','@',0) AS "an error";
+
+select split_part('joeuser@mydatabase','@@',1) AS "joeuser@mydatabase";
+
+select split_part('joeuser@mydatabase','@@',2) AS "empty string";
+
+select split_part('joeuser@mydatabase','@',1) AS "joeuser";
+
+select split_part('joeuser@mydatabase','@',2) AS "mydatabase";
+
+select split_part('joeuser@mydatabase','@',3) AS "empty string";
+
+select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
+
+select split_part('joeuser@mydatabase','@',-1) AS "mydatabase";
+
+select split_part('joeuser@mydatabase','@',-2) AS "joeuser";
+
+select split_part('joeuser@mydatabase','@',-3) AS "empty string";
+
+select split_part('@joeuser@mydatabase@','@',-2) AS "mydatabase";
+
+--
+-- test to_hex
+--
+select to_hex(256*256*256 - 1) AS "ffffff";
+
+select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
+
+--
+-- MD5 test suite - from IETF RFC 1321
+-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
+--
+select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+
+select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+
+select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+
+select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+
+select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+
+select md5(''::bytea) = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
+
+select md5('a'::bytea) = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
+
+select md5('abc'::bytea) = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
+
+select md5('message digest'::bytea) = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
+
+select md5('abcdefghijklmnopqrstuvwxyz'::bytea) = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
+
+select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'::bytea) = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
+
+select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890'::bytea) = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
+
+--
+-- SHA-2
+--
+SET bytea_output TO hex;
+
+SELECT sha224('');
+SELECT sha224('The quick brown fox jumps over the lazy dog.');
+
+SELECT sha256('');
+SELECT sha256('The quick brown fox jumps over the lazy dog.');
+
+SELECT sha384('');
+SELECT sha384('The quick brown fox jumps over the lazy dog.');
+
+SELECT sha512('');
+SELECT sha512('The quick brown fox jumps over the lazy dog.');
+
+--
+-- encode/decode
+--
+SELECT encode('\x1234567890abcdef00', 'hex');
+SELECT decode('1234567890abcdef00', 'hex');
+SELECT encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea, 'base64');
+SELECT decode(encode(('\x' || repeat('1234567890abcdef0001', 7))::bytea,
+ 'base64'), 'base64');
+SELECT encode('\x1234567890abcdef00', 'escape');
+SELECT decode(encode('\x1234567890abcdef00', 'escape'), 'escape');
+
+--
+-- get_bit/set_bit etc
+--
+SELECT get_bit('\x1234567890abcdef00'::bytea, 43);
+SELECT get_bit('\x1234567890abcdef00'::bytea, 99); -- error
+SELECT set_bit('\x1234567890abcdef00'::bytea, 43, 0);
+SELECT set_bit('\x1234567890abcdef00'::bytea, 99, 0); -- error
+SELECT get_byte('\x1234567890abcdef00'::bytea, 3);
+SELECT get_byte('\x1234567890abcdef00'::bytea, 99); -- error
+SELECT set_byte('\x1234567890abcdef00'::bytea, 7, 11);
+SELECT set_byte('\x1234567890abcdef00'::bytea, 99, 11); -- error
+
+--
+-- test behavior of escape_string_warning and standard_conforming_strings options
+--
+set escape_string_warning = off;
+set standard_conforming_strings = off;
+
+show escape_string_warning;
+show standard_conforming_strings;
+
+set escape_string_warning = on;
+set standard_conforming_strings = on;
+
+show escape_string_warning;
+show standard_conforming_strings;
+
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+
+set standard_conforming_strings = off;
+
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+
+set escape_string_warning = off;
+set standard_conforming_strings = on;
+
+select 'a\bcd' as f1, 'a\b''cd' as f2, 'a\b''''cd' as f3, 'abcd\' as f4, 'ab\''cd' as f5, '\\' as f6;
+
+set standard_conforming_strings = off;
+
+select 'a\\bcd' as f1, 'a\\b\'cd' as f2, 'a\\b\'''cd' as f3, 'abcd\\' as f4, 'ab\\\'cd' as f5, '\\\\' as f6;
+
+reset standard_conforming_strings;
+
+
+--
+-- Additional string functions
+--
+SET bytea_output TO escape;
+
+SELECT initcap('hi THOMAS');
+
+SELECT lpad('hi', 5, 'xy');
+SELECT lpad('hi', 5);
+SELECT lpad('hi', -5, 'xy');
+SELECT lpad('hello', 2);
+SELECT lpad('hi', 5, '');
+
+SELECT rpad('hi', 5, 'xy');
+SELECT rpad('hi', 5);
+SELECT rpad('hi', -5, 'xy');
+SELECT rpad('hello', 2);
+SELECT rpad('hi', 5, '');
+
+SELECT ltrim('zzzytrim', 'xyz');
+
+SELECT translate('', '14', 'ax');
+SELECT translate('12345', '14', 'ax');
+
+SELECT ascii('x');
+SELECT ascii('');
+
+SELECT chr(65);
+SELECT chr(0);
+
+SELECT repeat('Pg', 4);
+SELECT repeat('Pg', -4);
+
+SELECT SUBSTRING('1234567890'::bytea FROM 3) "34567890";
+SELECT SUBSTRING('1234567890'::bytea FROM 4 FOR 3) AS "456";
+SELECT SUBSTRING('string'::bytea FROM 2 FOR 2147483646) AS "tring";
+SELECT SUBSTRING('string'::bytea FROM -10 FOR 2147483646) AS "string";
+SELECT SUBSTRING('string'::bytea FROM -10 FOR -2147483646) AS "error";
+
+SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT trim(leading E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT trim(trailing E'\\000'::bytea from E'\\000Tom\\000'::bytea);
+SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea);
+SELECT btrim(''::bytea, E'\\000'::bytea);
+SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea);
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'Th\\001omas'::bytea from 2),'escape');
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 8),'escape');
+SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 5 for 3),'escape');
+
+SELECT bit_count('\x1234567890'::bytea);
+
+SELECT unistr('\0064at\+0000610');
+SELECT unistr('d\u0061t\U000000610');
+SELECT unistr('a\\b');
+-- errors:
+SELECT unistr('wrong: \db99');
+SELECT unistr('wrong: \db99\0061');
+SELECT unistr('wrong: \+00db99\+000061');
+SELECT unistr('wrong: \+2FFFFF');
+SELECT unistr('wrong: \udb99\u0061');
+SELECT unistr('wrong: \U0000db99\U00000061');
+SELECT unistr('wrong: \U002FFFFF');
+SELECT unistr('wrong: \xyz');
diff --git a/yql/essentials/tests/postgresql/original/cases/subselect.out b/yql/essentials/tests/postgresql/original/cases/subselect.out
new file mode 100644
index 0000000000..45c75eecc5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/subselect.out
@@ -0,0 +1,1859 @@
+--
+-- SUBSELECT
+--
+SELECT 1 AS one WHERE 1 IN (SELECT 1);
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1 AS zero WHERE 1 NOT IN (SELECT 1);
+ zero
+------
+(0 rows)
+
+SELECT 1 AS zero WHERE 1 IN (SELECT 2);
+ zero
+------
+(0 rows)
+
+-- Check grammar's handling of extra parens in assorted contexts
+SELECT * FROM (SELECT 1 AS x) ss;
+ x
+---
+ 1
+(1 row)
+
+SELECT * FROM ((SELECT 1 AS x)) ss;
+ x
+---
+ 1
+(1 row)
+
+(SELECT 2) UNION SELECT 2;
+ ?column?
+----------
+ 2
+(1 row)
+
+((SELECT 2)) UNION SELECT 2;
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT ((SELECT 2) UNION SELECT 2);
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT (((SELECT 2)) UNION SELECT 2);
+ ?column?
+----------
+ 2
+(1 row)
+
+SELECT (SELECT ARRAY[1,2,3])[1];
+ array
+-------
+ 1
+(1 row)
+
+SELECT ((SELECT ARRAY[1,2,3]))[2];
+ array
+-------
+ 2
+(1 row)
+
+SELECT (((SELECT ARRAY[1,2,3])))[3];
+ array
+-------
+ 3
+(1 row)
+
+-- Set up some simple test tables
+CREATE TABLE SUBSELECT_TBL (
+ f1 integer,
+ f2 integer,
+ f3 float
+);
+INSERT INTO SUBSELECT_TBL VALUES (1, 2, 3);
+INSERT INTO SUBSELECT_TBL VALUES (2, 3, 4);
+INSERT INTO SUBSELECT_TBL VALUES (3, 4, 5);
+INSERT INTO SUBSELECT_TBL VALUES (1, 1, 1);
+INSERT INTO SUBSELECT_TBL VALUES (2, 2, 2);
+INSERT INTO SUBSELECT_TBL VALUES (3, 3, 3);
+INSERT INTO SUBSELECT_TBL VALUES (6, 7, 8);
+INSERT INTO SUBSELECT_TBL VALUES (8, 9, NULL);
+SELECT * FROM SUBSELECT_TBL;
+ f1 | f2 | f3
+----+----+----
+ 1 | 2 | 3
+ 2 | 3 | 4
+ 3 | 4 | 5
+ 1 | 1 | 1
+ 2 | 2 | 2
+ 3 | 3 | 3
+ 6 | 7 | 8
+ 8 | 9 |
+(8 rows)
+
+-- Uncorrelated subselects
+SELECT f1 AS "Constant Select" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT 1);
+ Constant Select
+-----------------
+ 1
+ 1
+(2 rows)
+
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL);
+ Uncorrelated Field
+--------------------
+ 1
+ 2
+ 3
+ 1
+ 2
+ 3
+(6 rows)
+
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE
+ f2 IN (SELECT f1 FROM SUBSELECT_TBL));
+ Uncorrelated Field
+--------------------
+ 1
+ 2
+ 3
+ 1
+ 2
+ 3
+(6 rows)
+
+SELECT f1, f2
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) NOT IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+ f1 | f2
+----+----
+ 1 | 2
+ 6 | 7
+ 8 | 9
+(3 rows)
+
+-- Correlated subselects
+SELECT f1 AS "Correlated Field", f2 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE f1 = upper.f1);
+ Correlated Field | Second Field
+------------------+--------------
+ 1 | 2
+ 2 | 3
+ 3 | 4
+ 1 | 1
+ 2 | 2
+ 3 | 3
+(6 rows)
+
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN
+ (SELECT f2 FROM SUBSELECT_TBL WHERE CAST(upper.f2 AS float) = f3);
+ Correlated Field | Second Field
+------------------+--------------
+ 2 | 4
+ 3 | 5
+ 1 | 1
+ 2 | 2
+ 3 | 3
+(5 rows)
+
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ WHERE f2 = CAST(f3 AS integer));
+ Correlated Field | Second Field
+------------------+--------------
+ 1 | 3
+ 2 | 4
+ 3 | 5
+ 6 | 8
+(4 rows)
+
+SELECT f1 AS "Correlated Field"
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+ Correlated Field
+------------------
+ 2
+ 3
+ 1
+ 2
+ 3
+(5 rows)
+
+--
+-- Use some existing tables in the regression test
+--
+SELECT ss.f1 AS "Correlated Field", ss.f3 AS "Second Field"
+ FROM SUBSELECT_TBL ss
+ WHERE f1 NOT IN (SELECT f1+1 FROM INT4_TBL
+ WHERE f1 != ss.f1 AND f1 < 2147483647);
+ Correlated Field | Second Field
+------------------+--------------
+ 2 | 4
+ 3 | 5
+ 2 | 2
+ 3 | 3
+ 6 | 8
+ 8 |
+(6 rows)
+
+select q1, float8(count(*)) / (select count(*) from int8_tbl)
+from int8_tbl group by q1 order by q1;
+ q1 | ?column?
+------------------+----------
+ 123 | 0.4
+ 4567890123456789 | 0.6
+(2 rows)
+
+-- Unspecified-type literals in output columns should resolve as text
+SELECT *, pg_typeof(f1) FROM
+ (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
+ f1 | pg_typeof
+-----+-----------
+ foo | text
+ foo | text
+ foo | text
+(3 rows)
+
+-- ... unless there's context to suggest differently
+explain (verbose, costs off) select '42' union all select '43';
+ QUERY PLAN
+----------------------------
+ Append
+ -> Result
+ Output: '42'::text
+ -> Result
+ Output: '43'::text
+(5 rows)
+
+explain (verbose, costs off) select '42' union all select 43;
+ QUERY PLAN
+--------------------
+ Append
+ -> Result
+ Output: 42
+ -> Result
+ Output: 43
+(5 rows)
+
+-- check materialization of an initplan reference (bug #14524)
+explain (verbose, costs off)
+select 1 = all (select (select 1));
+ QUERY PLAN
+-----------------------------------
+ Result
+ Output: (SubPlan 2)
+ SubPlan 2
+ -> Materialize
+ Output: ($0)
+ InitPlan 1 (returns $0)
+ -> Result
+ Output: 1
+ -> Result
+ Output: $0
+(10 rows)
+
+select 1 = all (select (select 1));
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Check EXISTS simplification with LIMIT
+--
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit null);
+ QUERY PLAN
+------------------------------------
+ Hash Semi Join
+ Hash Cond: (o.f1 = i.f1)
+ -> Seq Scan on int4_tbl o
+ -> Hash
+ -> Seq Scan on int4_tbl i
+(5 rows)
+
+explain (costs off)
+select * from int4_tbl o where not exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 1);
+ QUERY PLAN
+------------------------------------
+ Hash Anti Join
+ Hash Cond: (o.f1 = i.f1)
+ -> Seq Scan on int4_tbl o
+ -> Hash
+ -> Seq Scan on int4_tbl i
+(5 rows)
+
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 0);
+ QUERY PLAN
+--------------------------------------
+ Seq Scan on int4_tbl o
+ Filter: (SubPlan 1)
+ SubPlan 1
+ -> Limit
+ -> Seq Scan on int4_tbl i
+ Filter: (f1 = o.f1)
+(6 rows)
+
+--
+-- Test cases to catch unpleasant interactions between IN-join processing
+-- and subquery pullup.
+--
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+ count
+-------
+ 100
+(1 row)
+
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+ count
+-------
+ 10
+(1 row)
+
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+ count
+-------
+ 100
+(1 row)
+
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+ count
+-------
+ 10
+(1 row)
+
+--
+-- Test cases to check for overenthusiastic optimization of
+-- "IN (SELECT DISTINCT ...)" and related cases. Per example from
+-- Luca Pireddu and Michael Fuhr.
+--
+CREATE TEMP TABLE foo (id integer);
+CREATE TEMP TABLE bar (id1 integer, id2 integer);
+INSERT INTO foo VALUES (1);
+INSERT INTO bar VALUES (1, 1);
+INSERT INTO bar VALUES (2, 2);
+INSERT INTO bar VALUES (3, 1);
+-- These cases require an extra level of distinct-ing above subquery s
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1,id2 FROM bar GROUP BY id1,id2) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1, id2 FROM bar UNION
+ SELECT id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+-- These cases do not
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT ON (id2) id1, id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar GROUP BY id2) AS s);
+ id
+----
+ 1
+(1 row)
+
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar UNION
+ SELECT id2 FROM bar) AS s);
+ id
+----
+ 1
+(1 row)
+
+--
+-- Test case to catch problems with multiply nested sub-SELECTs not getting
+-- recalculated properly. Per bug report from Didier Moens.
+--
+CREATE TABLE orderstest (
+ approver_ref integer,
+ po_ref integer,
+ ordercanceled boolean
+);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 5, false);
+INSERT INTO orderstest VALUES (66, 6, false);
+INSERT INTO orderstest VALUES (66, 7, false);
+INSERT INTO orderstest VALUES (66, 1, true);
+INSERT INTO orderstest VALUES (66, 8, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (77, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+CREATE VIEW orders_view AS
+SELECT *,
+(SELECT CASE
+ WHEN ord.approver_ref=1 THEN '---' ELSE 'Approved'
+ END) AS "Approved",
+(SELECT CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (SELECT CASE
+ WHEN ord.po_ref=1
+ THEN
+ (SELECT CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status",
+(CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (CASE
+ WHEN ord.po_ref=1
+ THEN
+ (CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status_OK"
+FROM orderstest ord;
+SELECT * FROM orders_view;
+ approver_ref | po_ref | ordercanceled | Approved | Status | Status_OK
+--------------+--------+---------------+----------+----------+-----------
+ 1 | 1 | f | --- | --- | ---
+ 66 | 5 | f | Approved | PO | PO
+ 66 | 6 | f | Approved | PO | PO
+ 66 | 7 | f | Approved | PO | PO
+ 66 | 1 | t | Approved | Canceled | Canceled
+ 66 | 8 | f | Approved | PO | PO
+ 66 | 1 | f | Approved | Approved | Approved
+ 77 | 1 | f | Approved | Approved | Approved
+ 1 | 1 | f | --- | --- | ---
+ 66 | 1 | f | Approved | Approved | Approved
+ 1 | 1 | f | --- | --- | ---
+(11 rows)
+
+DROP TABLE orderstest cascade;
+NOTICE: drop cascades to view orders_view
+--
+-- Test cases to catch situations where rule rewriter fails to propagate
+-- hasSubLinks flag correctly. Per example from Kyle Bateman.
+--
+create temp table parts (
+ partnum text,
+ cost float8
+);
+create temp table shipped (
+ ttype char(2),
+ ordnum int4,
+ partnum text,
+ value float8
+);
+create temp view shipped_view as
+ select * from shipped where ttype = 'wt';
+create rule shipped_view_insert as on insert to shipped_view do instead
+ insert into shipped values('wt', new.ordnum, new.partnum, new.value);
+insert into parts (partnum, cost) values (1, 1234.56);
+insert into shipped_view (ordnum, partnum, value)
+ values (0, 1, (select cost from parts where partnum = '1'));
+select * from shipped_view;
+ ttype | ordnum | partnum | value
+-------+--------+---------+---------
+ wt | 0 | 1 | 1234.56
+(1 row)
+
+create rule shipped_view_update as on update to shipped_view do instead
+ update shipped set partnum = new.partnum, value = new.value
+ where ttype = new.ttype and ordnum = new.ordnum;
+update shipped_view set value = 11
+ from int4_tbl a join int4_tbl b
+ on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
+ where ordnum = a.f1;
+select * from shipped_view;
+ ttype | ordnum | partnum | value
+-------+--------+---------+-------
+ wt | 0 | 1 | 11
+(1 row)
+
+select f1, ss1 as relabel from
+ (select *, (select sum(f1) from int4_tbl b where f1 >= a.f1) as ss1
+ from int4_tbl a) ss;
+ f1 | relabel
+-------------+------------
+ 0 | 2147607103
+ 123456 | 2147607103
+ -123456 | 2147483647
+ 2147483647 | 2147483647
+ -2147483647 | 0
+(5 rows)
+
+--
+-- Test cases involving PARAM_EXEC parameters and min/max index optimizations.
+-- Per bug report from David Sanchez i Gregori.
+--
+select * from (
+ select max(unique1) from tenk1 as a
+ where exists (select 1 from tenk1 as b where b.thousand = a.unique2)
+) ss;
+ max
+------
+ 9997
+(1 row)
+
+select * from (
+ select min(unique1) from tenk1 as a
+ where not exists (select 1 from tenk1 as b where b.unique2 = 10000)
+) ss;
+ min
+-----
+ 0
+(1 row)
+
+--
+-- Test that an IN implemented using a UniquePath does unique-ification
+-- with the right semantics, as per bug #4113. (Unfortunately we have
+-- no simple way to ensure that this test case actually chooses that type
+-- of plan, but it does in releases 7.4-8.3. Note that an ordering difference
+-- here might mean that some other plan type is being used, rendering the test
+-- pointless.)
+--
+create temp table numeric_table (num_col numeric);
+insert into numeric_table values (1), (1.000000000000000000001), (2), (3);
+create temp table float_table (float_col float8);
+insert into float_table values (1), (2), (3);
+select * from float_table
+ where float_col in (select num_col from numeric_table);
+ float_col
+-----------
+ 1
+ 2
+ 3
+(3 rows)
+
+select * from numeric_table
+ where num_col in (select float_col from float_table);
+ num_col
+-------------------------
+ 1
+ 1.000000000000000000001
+ 2
+ 3
+(4 rows)
+
+--
+-- Test case for bug #4290: bogus calculation of subplan param sets
+--
+create temp table ta (id int primary key, val int);
+insert into ta values(1,1);
+insert into ta values(2,2);
+create temp table tb (id int primary key, aval int);
+insert into tb values(1,1);
+insert into tb values(2,1);
+insert into tb values(3,2);
+insert into tb values(4,2);
+create temp table tc (id int primary key, aid int);
+insert into tc values(1,1);
+insert into tc values(2,2);
+select
+ ( select min(tb.id) from tb
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+from tc;
+ min_tb_id
+-----------
+ 1
+ 3
+(2 rows)
+
+--
+-- Test case for 8.3 "failed to locate grouping columns" bug
+--
+create temp table t1 (f1 numeric(14,0), f2 varchar(30));
+select * from
+ (select distinct f1, f2, (select f2 from t1 x where x.f1 = up.f1) as fs
+ from t1 up) ss
+group by f1,f2,fs;
+ f1 | f2 | fs
+----+----+----
+(0 rows)
+
+--
+-- Test case for bug #5514 (mishandling of whole-row Vars in subselects)
+--
+create temp table table_a(id integer);
+insert into table_a values (42);
+create temp view view_a as select * from table_a;
+select view_a from view_a;
+ view_a
+--------
+ (42)
+(1 row)
+
+select (select view_a) from view_a;
+ view_a
+--------
+ (42)
+(1 row)
+
+select (select (select view_a)) from view_a;
+ view_a
+--------
+ (42)
+(1 row)
+
+select (select (a.*)::text) from view_a a;
+ a
+------
+ (42)
+(1 row)
+
+--
+-- Check that whole-row Vars reading the result of a subselect don't include
+-- any junk columns therein
+--
+select q from (select max(f1) from int4_tbl group by f1 order by f1) q;
+ q
+---------------
+ (-2147483647)
+ (-123456)
+ (0)
+ (123456)
+ (2147483647)
+(5 rows)
+
+with q as (select max(f1) from int4_tbl group by f1 order by f1)
+ select q from q;
+ q
+---------------
+ (-2147483647)
+ (-123456)
+ (0)
+ (123456)
+ (2147483647)
+(5 rows)
+
+--
+-- Test case for sublinks pulled up into joinaliasvars lists in an
+-- inherited update/delete query
+--
+begin; -- this shouldn't delete anything, but be safe
+delete from road
+where exists (
+ select 1
+ from
+ int4_tbl cross join
+ ( select f1, array(select q1 from int8_tbl) as arr
+ from text_tbl ) ss
+ where road.name = ss.f1 );
+rollback;
+--
+-- Test case for sublinks pushed down into subselects via join alias expansion
+--
+select
+ (select sq1) as qq1
+from
+ (select exists(select 1 from int4_tbl where f1 = q2) as sq1, 42 as dummy
+ from int8_tbl) sq0
+ join
+ int4_tbl i4 on dummy = i4.f1;
+ qq1
+-----
+(0 rows)
+
+--
+-- Test case for subselect within UPDATE of INSERT...ON CONFLICT DO UPDATE
+--
+create temp table upsert(key int4 primary key, val text);
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'not seen';
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'seen with subselect ' || (select f1 from int4_tbl where f1 != 0 limit 1)::text;
+select * from upsert;
+ key | val
+-----+----------------------------
+ 1 | seen with subselect 123456
+(1 row)
+
+with aa as (select 'int4_tbl' u from int4_tbl limit 1)
+insert into upsert values (1, 'x'), (999, 'y')
+on conflict (key) do update set val = (select u from aa)
+returning *;
+ key | val
+-----+----------
+ 1 | int4_tbl
+ 999 | y
+(2 rows)
+
+--
+-- Test case for cross-type partial matching in hashed subplan (bug #7597)
+--
+create temp table outer_7597 (f1 int4, f2 int4);
+insert into outer_7597 values (0, 0);
+insert into outer_7597 values (1, 0);
+insert into outer_7597 values (0, null);
+insert into outer_7597 values (1, null);
+create temp table inner_7597(c1 int8, c2 int8);
+insert into inner_7597 values(0, null);
+select * from outer_7597 where (f1, f2) not in (select * from inner_7597);
+ f1 | f2
+----+----
+ 1 | 0
+ 1 |
+(2 rows)
+
+--
+-- Similar test case using text that verifies that collation
+-- information is passed through by execTuplesEqual() in nodeSubplan.c
+-- (otherwise it would error in texteq())
+--
+create temp table outer_text (f1 text, f2 text);
+insert into outer_text values ('a', 'a');
+insert into outer_text values ('b', 'a');
+insert into outer_text values ('a', null);
+insert into outer_text values ('b', null);
+create temp table inner_text (c1 text, c2 text);
+insert into inner_text values ('a', null);
+insert into inner_text values ('123', '456');
+select * from outer_text where (f1, f2) not in (select * from inner_text);
+ f1 | f2
+----+----
+ b | a
+ b |
+(2 rows)
+
+--
+-- Another test case for cross-type hashed subplans: comparison of
+-- inner-side values must be done with appropriate operator
+--
+explain (verbose, costs off)
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+ QUERY PLAN
+-------------------------------------
+ Result
+ Output: (hashed SubPlan 1)
+ SubPlan 1
+ -> Append
+ -> Result
+ Output: 'bar'::name
+ -> Result
+ Output: 'bar'::name
+(8 rows)
+
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+ ?column?
+----------
+ f
+(1 row)
+
+--
+-- Test that we don't try to hash nested records (bug #17363)
+-- (Hashing could be supported, but for now we don't)
+--
+explain (verbose, costs off)
+select row(row(row(1))) = any (select row(row(1)));
+ QUERY PLAN
+-------------------------------------------
+ Result
+ Output: (SubPlan 1)
+ SubPlan 1
+ -> Materialize
+ Output: '("(1)")'::record
+ -> Result
+ Output: '("(1)")'::record
+(7 rows)
+
+select row(row(row(1))) = any (select row(row(1)));
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Test case for premature memory release during hashing of subplan output
+--
+select '1'::text in (select '1'::name union all select '1'::name);
+ ?column?
+----------
+ t
+(1 row)
+
+--
+-- Test that we don't try to use a hashed subplan if the simplified
+-- testexpr isn't of the right shape
+--
+-- this fails by default, of course
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ERROR: operator does not exist: bigint = text
+LINE 1: select * from int8_tbl where q1 in (select c1 from inner_tex...
+ ^
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+begin;
+-- make an operator to allow it to succeed
+create function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2';
+create operator = (procedure=bogus_int8_text_eq, leftarg=int8, rightarg=text);
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ QUERY PLAN
+--------------------------------
+ Seq Scan on int8_tbl
+ Filter: (hashed SubPlan 1)
+ SubPlan 1
+ -> Seq Scan on inner_text
+(4 rows)
+
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+-- inlining of this function results in unusual number of hash clauses,
+-- which we can still cope with
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2 and $1::text = $2';
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ QUERY PLAN
+--------------------------------
+ Seq Scan on int8_tbl
+ Filter: (hashed SubPlan 1)
+ SubPlan 1
+ -> Seq Scan on inner_text
+(4 rows)
+
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+-- inlining of this function causes LHS and RHS to be switched,
+-- which we can't cope with, so hashing should be abandoned
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $2 = $1::text';
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ QUERY PLAN
+--------------------------------------
+ Seq Scan on int8_tbl
+ Filter: (SubPlan 1)
+ SubPlan 1
+ -> Materialize
+ -> Seq Scan on inner_text
+(5 rows)
+
+select * from int8_tbl where q1 in (select c1 from inner_text);
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+rollback; -- to get rid of the bogus operator
+--
+-- Test resolution of hashed vs non-hashed implementation of EXISTS subplan
+--
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+ QUERY PLAN
+--------------------------------------------------------------
+ Aggregate
+ -> Seq Scan on tenk1 t
+ Filter: ((hashed SubPlan 2) OR (ten < 0))
+ SubPlan 2
+ -> Index Only Scan using tenk1_unique1 on tenk1 k
+(5 rows)
+
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+ count
+-------
+ 10000
+(1 row)
+
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+ QUERY PLAN
+--------------------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on tenk1 t
+ Recheck Cond: (thousand = 1)
+ Filter: ((SubPlan 1) OR (ten < 0))
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = 1)
+ SubPlan 1
+ -> Index Only Scan using tenk1_unique1 on tenk1 k
+ Index Cond: (unique1 = t.unique2)
+(9 rows)
+
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+ count
+-------
+ 10
+(1 row)
+
+-- It's possible for the same EXISTS to get resolved both ways
+create temp table exists_tbl (c1 int, c2 int, c3 int) partition by list (c1);
+create temp table exists_tbl_null partition of exists_tbl for values in (null);
+create temp table exists_tbl_def partition of exists_tbl default;
+insert into exists_tbl select x, x/2, x+1 from generate_series(0,10) x;
+analyze exists_tbl;
+explain (costs off)
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+ QUERY PLAN
+------------------------------------------------------
+ Append
+ -> Seq Scan on exists_tbl_null t1_1
+ Filter: ((SubPlan 1) OR (c3 < 0))
+ SubPlan 1
+ -> Append
+ -> Seq Scan on exists_tbl_null t2_1
+ Filter: (t1_1.c1 = c2)
+ -> Seq Scan on exists_tbl_def t2_2
+ Filter: (t1_1.c1 = c2)
+ -> Seq Scan on exists_tbl_def t1_2
+ Filter: ((hashed SubPlan 2) OR (c3 < 0))
+ SubPlan 2
+ -> Append
+ -> Seq Scan on exists_tbl_null t2_4
+ -> Seq Scan on exists_tbl_def t2_5
+(15 rows)
+
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+ c1 | c2 | c3
+----+----+----
+ 0 | 0 | 1
+ 1 | 0 | 2
+ 2 | 1 | 3
+ 3 | 1 | 4
+ 4 | 2 | 5
+ 5 | 2 | 6
+(6 rows)
+
+--
+-- Test case for planner bug with nested EXISTS handling
+--
+select a.thousand from tenk1 a, tenk1 b
+where a.thousand = b.thousand
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ and not exists ( select 1 from tenk1 d
+ where a.thousand = d.thousand ) );
+ thousand
+----------
+(0 rows)
+
+--
+-- Check that nested sub-selects are not pulled up if they contain volatiles
+--
+explain (verbose, costs off)
+ select x, x from
+ (select (select now()) as x from (values(1),(2)) v(y)) ss;
+ QUERY PLAN
+---------------------------
+ Values Scan on "*VALUES*"
+ Output: $0, $1
+ InitPlan 1 (returns $0)
+ -> Result
+ Output: now()
+ InitPlan 2 (returns $1)
+ -> Result
+ Output: now()
+(8 rows)
+
+explain (verbose, costs off)
+ select x, x from
+ (select (select random()) as x from (values(1),(2)) v(y)) ss;
+ QUERY PLAN
+----------------------------------
+ Subquery Scan on ss
+ Output: ss.x, ss.x
+ -> Values Scan on "*VALUES*"
+ Output: $0
+ InitPlan 1 (returns $0)
+ -> Result
+ Output: random()
+(7 rows)
+
+explain (verbose, costs off)
+ select x, x from
+ (select (select now() where y=y) as x from (values(1),(2)) v(y)) ss;
+ QUERY PLAN
+----------------------------------------------------------------------
+ Values Scan on "*VALUES*"
+ Output: (SubPlan 1), (SubPlan 2)
+ SubPlan 1
+ -> Result
+ Output: now()
+ One-Time Filter: ("*VALUES*".column1 = "*VALUES*".column1)
+ SubPlan 2
+ -> Result
+ Output: now()
+ One-Time Filter: ("*VALUES*".column1 = "*VALUES*".column1)
+(10 rows)
+
+explain (verbose, costs off)
+ select x, x from
+ (select (select random() where y=y) as x from (values(1),(2)) v(y)) ss;
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Subquery Scan on ss
+ Output: ss.x, ss.x
+ -> Values Scan on "*VALUES*"
+ Output: (SubPlan 1)
+ SubPlan 1
+ -> Result
+ Output: random()
+ One-Time Filter: ("*VALUES*".column1 = "*VALUES*".column1)
+(8 rows)
+
+--
+-- Test rescan of a hashed subplan (the use of random() is to prevent the
+-- sub-select from being pulled up, which would result in not hashing)
+--
+explain (verbose, costs off)
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Aggregate
+ Output: sum((((hashed SubPlan 1)))::integer)
+ -> Nested Loop
+ Output: ((hashed SubPlan 1))
+ -> Seq Scan on public.onek o
+ Output: o.unique1, o.unique2, o.two, o.four, o.ten, o.twenty, o.hundred, o.thousand, o.twothousand, o.fivethous, o.tenthous, o.odd, o.even, o.stringu1, o.stringu2, o.string4
+ Filter: (o.ten = 0)
+ -> Index Scan using onek_unique1 on public.onek i
+ Output: (hashed SubPlan 1), random()
+ Index Cond: (i.unique1 = o.unique1)
+ SubPlan 1
+ -> Seq Scan on public.int4_tbl
+ Output: int4_tbl.f1
+ Filter: (int4_tbl.f1 <= $0)
+(14 rows)
+
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+ sum
+-----
+ 100
+(1 row)
+
+--
+-- Test rescan of a SetOp node
+--
+explain (costs off)
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+ QUERY PLAN
+------------------------------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Seq Scan on onek o
+ Filter: (ten = 1)
+ -> Subquery Scan on ss
+ -> HashSetOp Except
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Index Scan using onek_unique1 on onek i1
+ Index Cond: (unique1 = o.unique1)
+ -> Subquery Scan on "*SELECT* 2"
+ -> Index Scan using onek_unique1 on onek i2
+ Index Cond: (unique1 = o.unique2)
+(13 rows)
+
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+ count
+-------
+ 100
+(1 row)
+
+--
+-- Test rescan of a RecursiveUnion node
+--
+explain (costs off)
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+ QUERY PLAN
+---------------------------------------------------------
+ Aggregate
+ -> Nested Loop
+ -> Seq Scan on onek o
+ Filter: (ten = 1)
+ -> Memoize
+ Cache Key: o.four
+ Cache Mode: binary
+ -> CTE Scan on x
+ CTE x
+ -> Recursive Union
+ -> Result
+ -> WorkTable Scan on x x_1
+ Filter: (a < 10)
+(13 rows)
+
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+ sum | sum
+------+------
+ 1700 | 5350
+(1 row)
+
+--
+-- Check we don't misoptimize a NOT IN where the subquery returns no rows.
+--
+create temp table notinouter (a int);
+create temp table notininner (b int not null);
+insert into notinouter values (null), (1);
+select * from notinouter where a not in (select b from notininner);
+ a
+---
+
+ 1
+(2 rows)
+
+--
+-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
+--
+create temp table nocolumns();
+select exists(select * from nocolumns);
+ exists
+--------
+ f
+(1 row)
+
+--
+-- Check behavior with a SubPlan in VALUES (bug #14924)
+--
+select val.x
+ from generate_series(1,10) as s(i),
+ lateral (
+ values ((select s.i + 1)), (s.i + 101)
+ ) as val(x)
+where s.i < 10 and (select val.x) < 110;
+ x
+-----
+ 2
+ 102
+ 3
+ 103
+ 4
+ 104
+ 5
+ 105
+ 6
+ 106
+ 7
+ 107
+ 8
+ 108
+ 9
+ 109
+ 10
+(17 rows)
+
+-- another variant of that (bug #16213)
+explain (verbose, costs off)
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+ QUERY PLAN
+----------------------------------------
+ Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1
+ SubPlan 1
+ -> Values Scan on "*VALUES*_1"
+ Output: "*VALUES*_1".column1
+(5 rows)
+
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+ column1
+---------
+ t
+ f
+(2 rows)
+
+--
+-- Check sane behavior with nested IN SubLinks
+--
+explain (verbose, costs off)
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop Semi Join
+ Output: int4_tbl.f1
+ Join Filter: (CASE WHEN (hashed SubPlan 1) THEN int4_tbl.f1 ELSE NULL::integer END = b.ten)
+ -> Seq Scan on public.int4_tbl
+ Output: int4_tbl.f1
+ -> Seq Scan on public.tenk1 b
+ Output: b.unique1, b.unique2, b.two, b.four, b.ten, b.twenty, b.hundred, b.thousand, b.twothousand, b.fivethous, b.tenthous, b.odd, b.even, b.stringu1, b.stringu2, b.string4
+ SubPlan 1
+ -> Index Only Scan using tenk1_unique1 on public.tenk1 a
+ Output: a.unique1
+(10 rows)
+
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+ f1
+----
+ 0
+(1 row)
+
+--
+-- Check for incorrect optimization when IN subquery contains a SRF
+--
+explain (verbose, costs off)
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+ QUERY PLAN
+-------------------------------------------------------------------
+ Nested Loop Semi Join
+ Output: o.f1
+ Join Filter: (o.f1 = "ANY_subquery".f1)
+ -> Seq Scan on public.int4_tbl o
+ Output: o.f1
+ -> Materialize
+ Output: "ANY_subquery".f1, "ANY_subquery".g
+ -> Subquery Scan on "ANY_subquery"
+ Output: "ANY_subquery".f1, "ANY_subquery".g
+ Filter: ("ANY_subquery".f1 = "ANY_subquery".g)
+ -> Result
+ Output: i.f1, ((generate_series(1, 50)) / 10)
+ -> ProjectSet
+ Output: generate_series(1, 50), i.f1
+ -> HashAggregate
+ Output: i.f1
+ Group Key: i.f1
+ -> Seq Scan on public.int4_tbl i
+ Output: i.f1
+(19 rows)
+
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+ f1
+----
+ 0
+(1 row)
+
+--
+-- check for over-optimization of whole-row Var referencing an Append plan
+--
+select (select q from
+ (select 1,2,3 where f1 > 0
+ union all
+ select 4,5,6.0 where f1 <= 0
+ ) q )
+from int4_tbl;
+ q
+-----------
+ (4,5,6.0)
+ (1,2,3)
+ (4,5,6.0)
+ (1,2,3)
+ (4,5,6.0)
+(5 rows)
+
+--
+-- Check for sane handling of a lateral reference in a subquery's quals
+-- (most of the complication here is to prevent the test case from being
+-- flattened too much)
+--
+explain (verbose, costs off)
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+ QUERY PLAN
+--------------------------------------------
+ Nested Loop
+ Output: i4.f1, ((i4.f1 > 1)), (1)
+ -> Seq Scan on public.int4_tbl i4
+ Output: i4.f1
+ Filter: (i4.f1 >= 0)
+ -> Append
+ -> Subquery Scan on t1
+ Output: (i4.f1 > 1), 1
+ Filter: (i4.f1 > 1)
+ -> Sort
+ Output: (random())
+ Sort Key: (random())
+ -> Result
+ Output: random()
+ -> Result
+ Output: true, 2
+(16 rows)
+
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+ f1 | b | id
+------------+---+----
+ 0 | t | 2
+ 123456 | t | 1
+ 123456 | t | 2
+ 2147483647 | t | 1
+ 2147483647 | t | 2
+(5 rows)
+
+--
+-- Check that volatile quals aren't pushed down past a DISTINCT:
+-- nextval() should not be called more than the nominal number of times
+--
+create temp sequence ts1;
+select * from
+ (select distinct ten from tenk1) ss
+ where ten < 10 + nextval('ts1')
+ order by 1;
+ ten
+-----
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+(10 rows)
+
+select nextval('ts1');
+ nextval
+---------
+ 11
+(1 row)
+
+--
+-- Check that volatile quals aren't pushed down past a set-returning function;
+-- while a nonvolatile qual can be, if it doesn't reference the SRF.
+--
+create function tattle(x int, y int) returns bool
+volatile language plpgsql as $$
+begin
+ raise notice 'x = %, y = %', x, y;
+ return x > y;
+end$$;
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+ QUERY PLAN
+----------------------------------------------------------
+ Subquery Scan on ss
+ Output: ss.x, ss.u
+ Filter: tattle(ss.x, 8)
+ -> ProjectSet
+ Output: 9, unnest('{1,2,3,11,12,13}'::integer[])
+ -> Result
+(6 rows)
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+NOTICE: x = 9, y = 8
+NOTICE: x = 9, y = 8
+NOTICE: x = 9, y = 8
+NOTICE: x = 9, y = 8
+NOTICE: x = 9, y = 8
+NOTICE: x = 9, y = 8
+ x | u
+---+----
+ 9 | 1
+ 9 | 2
+ 9 | 3
+ 9 | 11
+ 9 | 12
+ 9 | 13
+(6 rows)
+
+-- if we pretend it's stable, we get different results:
+alter function tattle(x int, y int) stable;
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+ QUERY PLAN
+----------------------------------------------------
+ ProjectSet
+ Output: 9, unnest('{1,2,3,11,12,13}'::integer[])
+ -> Result
+ One-Time Filter: tattle(9, 8)
+(4 rows)
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+NOTICE: x = 9, y = 8
+ x | u
+---+----
+ 9 | 1
+ 9 | 2
+ 9 | 3
+ 9 | 11
+ 9 | 12
+ 9 | 13
+(6 rows)
+
+-- although even a stable qual should not be pushed down if it references SRF
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+ QUERY PLAN
+----------------------------------------------------------
+ Subquery Scan on ss
+ Output: ss.x, ss.u
+ Filter: tattle(ss.x, ss.u)
+ -> ProjectSet
+ Output: 9, unnest('{1,2,3,11,12,13}'::integer[])
+ -> Result
+(6 rows)
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+NOTICE: x = 9, y = 1
+NOTICE: x = 9, y = 2
+NOTICE: x = 9, y = 3
+NOTICE: x = 9, y = 11
+NOTICE: x = 9, y = 12
+NOTICE: x = 9, y = 13
+ x | u
+---+---
+ 9 | 1
+ 9 | 2
+ 9 | 3
+(3 rows)
+
+drop function tattle(x int, y int);
+--
+-- Test that LIMIT can be pushed to SORT through a subquery that just projects
+-- columns. We check for that having happened by looking to see if EXPLAIN
+-- ANALYZE shows that a top-N sort was used. We must suppress or filter away
+-- all the non-invariant parts of the EXPLAIN ANALYZE output.
+--
+create table sq_limit (pk int primary key, c1 int, c2 int);
+insert into sq_limit values
+ (1, 1, 1),
+ (2, 2, 2),
+ (3, 3, 3),
+ (4, 4, 4),
+ (5, 1, 1),
+ (6, 2, 2),
+ (7, 3, 3),
+ (8, 4, 4);
+create function explain_sq_limit() returns setof text language plpgsql as
+$$
+declare ln text;
+begin
+ for ln in
+ explain (analyze, summary off, timing off, costs off)
+ select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3
+ loop
+ ln := regexp_replace(ln, 'Memory: \S*', 'Memory: xxx');
+ return next ln;
+ end loop;
+end;
+$$;
+select * from explain_sq_limit();
+ explain_sq_limit
+----------------------------------------------------------------
+ Limit (actual rows=3 loops=1)
+ -> Subquery Scan on x (actual rows=3 loops=1)
+ -> Sort (actual rows=3 loops=1)
+ Sort Key: sq_limit.c1, sq_limit.pk
+ Sort Method: top-N heapsort Memory: xxx
+ -> Seq Scan on sq_limit (actual rows=8 loops=1)
+(6 rows)
+
+select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3;
+ pk | c2
+----+----
+ 1 | 1
+ 5 | 1
+ 2 | 2
+(3 rows)
+
+drop function explain_sq_limit();
+drop table sq_limit;
+--
+-- Ensure that backward scan direction isn't propagated into
+-- expression subqueries (bug #15336)
+--
+begin;
+declare c1 scroll cursor for
+ select * from generate_series(1,4) i
+ where i <> all (values (2),(3));
+move forward all in c1;
+fetch backward all in c1;
+ i
+---
+ 4
+ 1
+(2 rows)
+
+commit;
+--
+-- Tests for CTE inlining behavior
+--
+-- Basic subquery that can be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+ QUERY PLAN
+----------------------------------
+ Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1
+ Filter: (subselect_tbl.f1 = 1)
+(3 rows)
+
+-- Explicitly request materialization
+explain (verbose, costs off)
+with x as materialized (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+ QUERY PLAN
+------------------------------------------
+ CTE Scan on x
+ Output: x.f1
+ Filter: (x.f1 = 1)
+ CTE x
+ -> Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1
+(6 rows)
+
+-- Stable functions are safe to inline
+explain (verbose, costs off)
+with x as (select * from (select f1, now() from subselect_tbl) ss)
+select * from x where f1 = 1;
+ QUERY PLAN
+-----------------------------------
+ Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, now()
+ Filter: (subselect_tbl.f1 = 1)
+(3 rows)
+
+-- Volatile functions prevent inlining
+explain (verbose, costs off)
+with x as (select * from (select f1, random() from subselect_tbl) ss)
+select * from x where f1 = 1;
+ QUERY PLAN
+----------------------------------------------
+ CTE Scan on x
+ Output: x.f1, x.random
+ Filter: (x.f1 = 1)
+ CTE x
+ -> Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, random()
+(6 rows)
+
+-- SELECT FOR UPDATE cannot be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl for update) ss)
+select * from x where f1 = 1;
+ QUERY PLAN
+--------------------------------------------------------------------
+ CTE Scan on x
+ Output: x.f1
+ Filter: (x.f1 = 1)
+ CTE x
+ -> Subquery Scan on ss
+ Output: ss.f1
+ -> LockRows
+ Output: subselect_tbl.f1, subselect_tbl.ctid
+ -> Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, subselect_tbl.ctid
+(10 rows)
+
+-- Multiply-referenced CTEs are inlined only when requested
+explain (verbose, costs off)
+with x as (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+ QUERY PLAN
+-------------------------------------------
+ Merge Join
+ Output: x.f1, x.n, x2.f1, x2.n
+ Merge Cond: (x.n = x2.n)
+ CTE x
+ -> Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, now()
+ -> Sort
+ Output: x.f1, x.n
+ Sort Key: x.n
+ -> CTE Scan on x
+ Output: x.f1, x.n
+ -> Sort
+ Output: x2.f1, x2.n
+ Sort Key: x2.n
+ -> CTE Scan on x x2
+ Output: x2.f1, x2.n
+(16 rows)
+
+explain (verbose, costs off)
+with x as not materialized (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Result
+ Output: subselect_tbl.f1, now(), subselect_tbl_1.f1, now()
+ One-Time Filter: (now() = now())
+ -> Nested Loop
+ Output: subselect_tbl.f1, subselect_tbl_1.f1
+ -> Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, subselect_tbl.f2, subselect_tbl.f3
+ -> Materialize
+ Output: subselect_tbl_1.f1
+ -> Seq Scan on public.subselect_tbl subselect_tbl_1
+ Output: subselect_tbl_1.f1
+(11 rows)
+
+-- Multiply-referenced CTEs can't be inlined if they contain outer self-refs
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+ QUERY PLAN
+----------------------------------------------------------
+ CTE Scan on x
+ Output: x.a
+ CTE x
+ -> Recursive Union
+ -> Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1
+ -> Nested Loop
+ Output: (z.a || z1.a)
+ Join Filter: (length((z.a || z1.a)) < 5)
+ CTE z
+ -> WorkTable Scan on x x_1
+ Output: x_1.a
+ -> CTE Scan on z
+ Output: z.a
+ -> CTE Scan on z z1
+ Output: z1.a
+(16 rows)
+
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+ a
+------
+ a
+ b
+ aa
+ ab
+ ba
+ bb
+ aaaa
+ aaab
+ aaba
+ aabb
+ abaa
+ abab
+ abba
+ abbb
+ baaa
+ baab
+ baba
+ babb
+ bbaa
+ bbab
+ bbba
+ bbbb
+(22 rows)
+
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+ QUERY PLAN
+--------------------------------------------------------
+ CTE Scan on x
+ Output: x.a
+ CTE x
+ -> Recursive Union
+ -> Values Scan on "*VALUES*"
+ Output: "*VALUES*".column1
+ -> WorkTable Scan on x x_1
+ Output: (x_1.a || x_1.a)
+ Filter: (length((x_1.a || x_1.a)) < 5)
+(9 rows)
+
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+ a
+------
+ a
+ b
+ aa
+ bb
+ aaaa
+ bbbb
+(6 rows)
+
+-- Check handling of outer references
+explain (verbose, costs off)
+with x as (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+ QUERY PLAN
+-----------------------------
+ Seq Scan on public.int4_tbl
+ Output: int4_tbl.f1
+(2 rows)
+
+explain (verbose, costs off)
+with x as materialized (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+ QUERY PLAN
+-------------------------------------
+ CTE Scan on x
+ Output: x.f1
+ CTE x
+ -> Seq Scan on public.int4_tbl
+ Output: int4_tbl.f1
+(5 rows)
+
+-- Ensure that we inline the currect CTE when there are
+-- multiple CTEs with the same name
+explain (verbose, costs off)
+with x as (select 1 as y)
+select * from (with x as (select 2 as y) select * from x) ss;
+ QUERY PLAN
+-------------
+ Result
+ Output: 2
+(2 rows)
+
+-- Row marks are not pushed into CTEs
+explain (verbose, costs off)
+with x as (select * from subselect_tbl)
+select * from x for update;
+ QUERY PLAN
+----------------------------------------------------------------
+ Seq Scan on public.subselect_tbl
+ Output: subselect_tbl.f1, subselect_tbl.f2, subselect_tbl.f3
+(2 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/subselect.sql b/yql/essentials/tests/postgresql/original/cases/subselect.sql
new file mode 100644
index 0000000000..94ba91f5bb
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/subselect.sql
@@ -0,0 +1,939 @@
+--
+-- SUBSELECT
+--
+
+SELECT 1 AS one WHERE 1 IN (SELECT 1);
+
+SELECT 1 AS zero WHERE 1 NOT IN (SELECT 1);
+
+SELECT 1 AS zero WHERE 1 IN (SELECT 2);
+
+-- Check grammar's handling of extra parens in assorted contexts
+
+SELECT * FROM (SELECT 1 AS x) ss;
+SELECT * FROM ((SELECT 1 AS x)) ss;
+
+(SELECT 2) UNION SELECT 2;
+((SELECT 2)) UNION SELECT 2;
+
+SELECT ((SELECT 2) UNION SELECT 2);
+SELECT (((SELECT 2)) UNION SELECT 2);
+
+SELECT (SELECT ARRAY[1,2,3])[1];
+SELECT ((SELECT ARRAY[1,2,3]))[2];
+SELECT (((SELECT ARRAY[1,2,3])))[3];
+
+-- Set up some simple test tables
+
+CREATE TABLE SUBSELECT_TBL (
+ f1 integer,
+ f2 integer,
+ f3 float
+);
+
+INSERT INTO SUBSELECT_TBL VALUES (1, 2, 3);
+INSERT INTO SUBSELECT_TBL VALUES (2, 3, 4);
+INSERT INTO SUBSELECT_TBL VALUES (3, 4, 5);
+INSERT INTO SUBSELECT_TBL VALUES (1, 1, 1);
+INSERT INTO SUBSELECT_TBL VALUES (2, 2, 2);
+INSERT INTO SUBSELECT_TBL VALUES (3, 3, 3);
+INSERT INTO SUBSELECT_TBL VALUES (6, 7, 8);
+INSERT INTO SUBSELECT_TBL VALUES (8, 9, NULL);
+
+SELECT * FROM SUBSELECT_TBL;
+
+-- Uncorrelated subselects
+
+SELECT f1 AS "Constant Select" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT 1);
+
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL);
+
+SELECT f1 AS "Uncorrelated Field" FROM SUBSELECT_TBL
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE
+ f2 IN (SELECT f1 FROM SUBSELECT_TBL));
+
+SELECT f1, f2
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) NOT IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+
+-- Correlated subselects
+
+SELECT f1 AS "Correlated Field", f2 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN (SELECT f2 FROM SUBSELECT_TBL WHERE f1 = upper.f1);
+
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f1 IN
+ (SELECT f2 FROM SUBSELECT_TBL WHERE CAST(upper.f2 AS float) = f3);
+
+SELECT f1 AS "Correlated Field", f3 AS "Second Field"
+ FROM SUBSELECT_TBL upper
+ WHERE f3 IN (SELECT upper.f1 + f2 FROM SUBSELECT_TBL
+ WHERE f2 = CAST(f3 AS integer));
+
+SELECT f1 AS "Correlated Field"
+ FROM SUBSELECT_TBL
+ WHERE (f1, f2) IN (SELECT f2, CAST(f3 AS int4) FROM SUBSELECT_TBL
+ WHERE f3 IS NOT NULL);
+
+--
+-- Use some existing tables in the regression test
+--
+
+SELECT ss.f1 AS "Correlated Field", ss.f3 AS "Second Field"
+ FROM SUBSELECT_TBL ss
+ WHERE f1 NOT IN (SELECT f1+1 FROM INT4_TBL
+ WHERE f1 != ss.f1 AND f1 < 2147483647);
+
+select q1, float8(count(*)) / (select count(*) from int8_tbl)
+from int8_tbl group by q1 order by q1;
+
+-- Unspecified-type literals in output columns should resolve as text
+
+SELECT *, pg_typeof(f1) FROM
+ (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
+
+-- ... unless there's context to suggest differently
+
+explain (verbose, costs off) select '42' union all select '43';
+explain (verbose, costs off) select '42' union all select 43;
+
+-- check materialization of an initplan reference (bug #14524)
+explain (verbose, costs off)
+select 1 = all (select (select 1));
+select 1 = all (select (select 1));
+
+--
+-- Check EXISTS simplification with LIMIT
+--
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit null);
+explain (costs off)
+select * from int4_tbl o where not exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 1);
+explain (costs off)
+select * from int4_tbl o where exists
+ (select 1 from int4_tbl i where i.f1=o.f1 limit 0);
+
+--
+-- Test cases to catch unpleasant interactions between IN-join processing
+-- and subquery pullup.
+--
+
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select hundred from tenk1 b)) ss;
+select count(*) from
+ (select 1 from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+select count(distinct ss.ten) from
+ (select ten from tenk1 a
+ where unique1 IN (select distinct hundred from tenk1 b)) ss;
+
+--
+-- Test cases to check for overenthusiastic optimization of
+-- "IN (SELECT DISTINCT ...)" and related cases. Per example from
+-- Luca Pireddu and Michael Fuhr.
+--
+
+CREATE TEMP TABLE foo (id integer);
+CREATE TEMP TABLE bar (id1 integer, id2 integer);
+
+INSERT INTO foo VALUES (1);
+
+INSERT INTO bar VALUES (1, 1);
+INSERT INTO bar VALUES (2, 2);
+INSERT INTO bar VALUES (3, 1);
+
+-- These cases require an extra level of distinct-ing above subquery s
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT id1, id2 FROM bar) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1,id2 FROM bar GROUP BY id1,id2) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id1, id2 FROM bar UNION
+ SELECT id1, id2 FROM bar) AS s);
+
+-- These cases do not
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT DISTINCT ON (id2) id1, id2 FROM bar) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar GROUP BY id2) AS s);
+SELECT * FROM foo WHERE id IN
+ (SELECT id2 FROM (SELECT id2 FROM bar UNION
+ SELECT id2 FROM bar) AS s);
+
+--
+-- Test case to catch problems with multiply nested sub-SELECTs not getting
+-- recalculated properly. Per bug report from Didier Moens.
+--
+
+CREATE TABLE orderstest (
+ approver_ref integer,
+ po_ref integer,
+ ordercanceled boolean
+);
+
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 5, false);
+INSERT INTO orderstest VALUES (66, 6, false);
+INSERT INTO orderstest VALUES (66, 7, false);
+INSERT INTO orderstest VALUES (66, 1, true);
+INSERT INTO orderstest VALUES (66, 8, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (77, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+INSERT INTO orderstest VALUES (66, 1, false);
+INSERT INTO orderstest VALUES (1, 1, false);
+
+CREATE VIEW orders_view AS
+SELECT *,
+(SELECT CASE
+ WHEN ord.approver_ref=1 THEN '---' ELSE 'Approved'
+ END) AS "Approved",
+(SELECT CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (SELECT CASE
+ WHEN ord.po_ref=1
+ THEN
+ (SELECT CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status",
+(CASE
+ WHEN ord.ordercanceled
+ THEN 'Canceled'
+ ELSE
+ (CASE
+ WHEN ord.po_ref=1
+ THEN
+ (CASE
+ WHEN ord.approver_ref=1
+ THEN '---'
+ ELSE 'Approved'
+ END)
+ ELSE 'PO'
+ END)
+END) AS "Status_OK"
+FROM orderstest ord;
+
+SELECT * FROM orders_view;
+
+DROP TABLE orderstest cascade;
+
+--
+-- Test cases to catch situations where rule rewriter fails to propagate
+-- hasSubLinks flag correctly. Per example from Kyle Bateman.
+--
+
+create temp table parts (
+ partnum text,
+ cost float8
+);
+
+create temp table shipped (
+ ttype char(2),
+ ordnum int4,
+ partnum text,
+ value float8
+);
+
+create temp view shipped_view as
+ select * from shipped where ttype = 'wt';
+
+create rule shipped_view_insert as on insert to shipped_view do instead
+ insert into shipped values('wt', new.ordnum, new.partnum, new.value);
+
+insert into parts (partnum, cost) values (1, 1234.56);
+
+insert into shipped_view (ordnum, partnum, value)
+ values (0, 1, (select cost from parts where partnum = '1'));
+
+select * from shipped_view;
+
+create rule shipped_view_update as on update to shipped_view do instead
+ update shipped set partnum = new.partnum, value = new.value
+ where ttype = new.ttype and ordnum = new.ordnum;
+
+update shipped_view set value = 11
+ from int4_tbl a join int4_tbl b
+ on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
+ where ordnum = a.f1;
+
+select * from shipped_view;
+
+select f1, ss1 as relabel from
+ (select *, (select sum(f1) from int4_tbl b where f1 >= a.f1) as ss1
+ from int4_tbl a) ss;
+
+--
+-- Test cases involving PARAM_EXEC parameters and min/max index optimizations.
+-- Per bug report from David Sanchez i Gregori.
+--
+
+select * from (
+ select max(unique1) from tenk1 as a
+ where exists (select 1 from tenk1 as b where b.thousand = a.unique2)
+) ss;
+
+select * from (
+ select min(unique1) from tenk1 as a
+ where not exists (select 1 from tenk1 as b where b.unique2 = 10000)
+) ss;
+
+--
+-- Test that an IN implemented using a UniquePath does unique-ification
+-- with the right semantics, as per bug #4113. (Unfortunately we have
+-- no simple way to ensure that this test case actually chooses that type
+-- of plan, but it does in releases 7.4-8.3. Note that an ordering difference
+-- here might mean that some other plan type is being used, rendering the test
+-- pointless.)
+--
+
+create temp table numeric_table (num_col numeric);
+insert into numeric_table values (1), (1.000000000000000000001), (2), (3);
+
+create temp table float_table (float_col float8);
+insert into float_table values (1), (2), (3);
+
+select * from float_table
+ where float_col in (select num_col from numeric_table);
+
+select * from numeric_table
+ where num_col in (select float_col from float_table);
+
+--
+-- Test case for bug #4290: bogus calculation of subplan param sets
+--
+
+create temp table ta (id int primary key, val int);
+
+insert into ta values(1,1);
+insert into ta values(2,2);
+
+create temp table tb (id int primary key, aval int);
+
+insert into tb values(1,1);
+insert into tb values(2,1);
+insert into tb values(3,2);
+insert into tb values(4,2);
+
+create temp table tc (id int primary key, aid int);
+
+insert into tc values(1,1);
+insert into tc values(2,2);
+
+select
+ ( select min(tb.id) from tb
+ where tb.aval = (select ta.val from ta where ta.id = tc.aid) ) as min_tb_id
+from tc;
+
+--
+-- Test case for 8.3 "failed to locate grouping columns" bug
+--
+
+create temp table t1 (f1 numeric(14,0), f2 varchar(30));
+
+select * from
+ (select distinct f1, f2, (select f2 from t1 x where x.f1 = up.f1) as fs
+ from t1 up) ss
+group by f1,f2,fs;
+
+--
+-- Test case for bug #5514 (mishandling of whole-row Vars in subselects)
+--
+
+create temp table table_a(id integer);
+insert into table_a values (42);
+
+create temp view view_a as select * from table_a;
+
+select view_a from view_a;
+select (select view_a) from view_a;
+select (select (select view_a)) from view_a;
+select (select (a.*)::text) from view_a a;
+
+--
+-- Check that whole-row Vars reading the result of a subselect don't include
+-- any junk columns therein
+--
+
+select q from (select max(f1) from int4_tbl group by f1 order by f1) q;
+with q as (select max(f1) from int4_tbl group by f1 order by f1)
+ select q from q;
+
+--
+-- Test case for sublinks pulled up into joinaliasvars lists in an
+-- inherited update/delete query
+--
+
+begin; -- this shouldn't delete anything, but be safe
+
+delete from road
+where exists (
+ select 1
+ from
+ int4_tbl cross join
+ ( select f1, array(select q1 from int8_tbl) as arr
+ from text_tbl ) ss
+ where road.name = ss.f1 );
+
+rollback;
+
+--
+-- Test case for sublinks pushed down into subselects via join alias expansion
+--
+
+select
+ (select sq1) as qq1
+from
+ (select exists(select 1 from int4_tbl where f1 = q2) as sq1, 42 as dummy
+ from int8_tbl) sq0
+ join
+ int4_tbl i4 on dummy = i4.f1;
+
+--
+-- Test case for subselect within UPDATE of INSERT...ON CONFLICT DO UPDATE
+--
+create temp table upsert(key int4 primary key, val text);
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'not seen';
+insert into upsert values(1, 'val') on conflict (key) do update set val = 'seen with subselect ' || (select f1 from int4_tbl where f1 != 0 limit 1)::text;
+
+select * from upsert;
+
+with aa as (select 'int4_tbl' u from int4_tbl limit 1)
+insert into upsert values (1, 'x'), (999, 'y')
+on conflict (key) do update set val = (select u from aa)
+returning *;
+
+--
+-- Test case for cross-type partial matching in hashed subplan (bug #7597)
+--
+
+create temp table outer_7597 (f1 int4, f2 int4);
+insert into outer_7597 values (0, 0);
+insert into outer_7597 values (1, 0);
+insert into outer_7597 values (0, null);
+insert into outer_7597 values (1, null);
+
+create temp table inner_7597(c1 int8, c2 int8);
+insert into inner_7597 values(0, null);
+
+select * from outer_7597 where (f1, f2) not in (select * from inner_7597);
+
+--
+-- Similar test case using text that verifies that collation
+-- information is passed through by execTuplesEqual() in nodeSubplan.c
+-- (otherwise it would error in texteq())
+--
+
+create temp table outer_text (f1 text, f2 text);
+insert into outer_text values ('a', 'a');
+insert into outer_text values ('b', 'a');
+insert into outer_text values ('a', null);
+insert into outer_text values ('b', null);
+
+create temp table inner_text (c1 text, c2 text);
+insert into inner_text values ('a', null);
+insert into inner_text values ('123', '456');
+
+select * from outer_text where (f1, f2) not in (select * from inner_text);
+
+--
+-- Another test case for cross-type hashed subplans: comparison of
+-- inner-side values must be done with appropriate operator
+--
+
+explain (verbose, costs off)
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+
+select 'foo'::text in (select 'bar'::name union all select 'bar'::name);
+
+--
+-- Test that we don't try to hash nested records (bug #17363)
+-- (Hashing could be supported, but for now we don't)
+--
+
+explain (verbose, costs off)
+select row(row(row(1))) = any (select row(row(1)));
+
+select row(row(row(1))) = any (select row(row(1)));
+
+--
+-- Test case for premature memory release during hashing of subplan output
+--
+
+select '1'::text in (select '1'::name union all select '1'::name);
+
+--
+-- Test that we don't try to use a hashed subplan if the simplified
+-- testexpr isn't of the right shape
+--
+
+-- this fails by default, of course
+select * from int8_tbl where q1 in (select c1 from inner_text);
+
+begin;
+
+-- make an operator to allow it to succeed
+create function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2';
+
+create operator = (procedure=bogus_int8_text_eq, leftarg=int8, rightarg=text);
+
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+select * from int8_tbl where q1 in (select c1 from inner_text);
+
+-- inlining of this function results in unusual number of hash clauses,
+-- which we can still cope with
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $1::text = $2 and $1::text = $2';
+
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+select * from int8_tbl where q1 in (select c1 from inner_text);
+
+-- inlining of this function causes LHS and RHS to be switched,
+-- which we can't cope with, so hashing should be abandoned
+create or replace function bogus_int8_text_eq(int8, text) returns boolean
+language sql as 'select $2 = $1::text';
+
+explain (costs off)
+select * from int8_tbl where q1 in (select c1 from inner_text);
+select * from int8_tbl where q1 in (select c1 from inner_text);
+
+rollback; -- to get rid of the bogus operator
+
+--
+-- Test resolution of hashed vs non-hashed implementation of EXISTS subplan
+--
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);
+
+explain (costs off)
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+select count(*) from tenk1 t
+where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0)
+ and thousand = 1;
+
+-- It's possible for the same EXISTS to get resolved both ways
+create temp table exists_tbl (c1 int, c2 int, c3 int) partition by list (c1);
+create temp table exists_tbl_null partition of exists_tbl for values in (null);
+create temp table exists_tbl_def partition of exists_tbl default;
+insert into exists_tbl select x, x/2, x+1 from generate_series(0,10) x;
+analyze exists_tbl;
+explain (costs off)
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+select * from exists_tbl t1
+ where (exists(select 1 from exists_tbl t2 where t1.c1 = t2.c2) or c3 < 0);
+
+--
+-- Test case for planner bug with nested EXISTS handling
+--
+select a.thousand from tenk1 a, tenk1 b
+where a.thousand = b.thousand
+ and exists ( select 1 from tenk1 c where b.hundred = c.hundred
+ and not exists ( select 1 from tenk1 d
+ where a.thousand = d.thousand ) );
+
+--
+-- Check that nested sub-selects are not pulled up if they contain volatiles
+--
+explain (verbose, costs off)
+ select x, x from
+ (select (select now()) as x from (values(1),(2)) v(y)) ss;
+explain (verbose, costs off)
+ select x, x from
+ (select (select random()) as x from (values(1),(2)) v(y)) ss;
+explain (verbose, costs off)
+ select x, x from
+ (select (select now() where y=y) as x from (values(1),(2)) v(y)) ss;
+explain (verbose, costs off)
+ select x, x from
+ (select (select random() where y=y) as x from (values(1),(2)) v(y)) ss;
+
+--
+-- Test rescan of a hashed subplan (the use of random() is to prevent the
+-- sub-select from being pulled up, which would result in not hashing)
+--
+explain (verbose, costs off)
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+
+select sum(ss.tst::int) from
+ onek o cross join lateral (
+ select i.ten in (select f1 from int4_tbl where f1 <= o.hundred) as tst,
+ random() as r
+ from onek i where i.unique1 = o.unique1 ) ss
+where o.ten = 0;
+
+--
+-- Test rescan of a SetOp node
+--
+explain (costs off)
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+
+select count(*) from
+ onek o cross join lateral (
+ select * from onek i1 where i1.unique1 = o.unique1
+ except
+ select * from onek i2 where i2.unique1 = o.unique2
+ ) ss
+where o.ten = 1;
+
+--
+-- Test rescan of a RecursiveUnion node
+--
+explain (costs off)
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+
+select sum(o.four), sum(ss.a) from
+ onek o cross join lateral (
+ with recursive x(a) as
+ (select o.four as a
+ union
+ select a + 1 from x
+ where a < 10)
+ select * from x
+ ) ss
+where o.ten = 1;
+
+--
+-- Check we don't misoptimize a NOT IN where the subquery returns no rows.
+--
+create temp table notinouter (a int);
+create temp table notininner (b int not null);
+insert into notinouter values (null), (1);
+
+select * from notinouter where a not in (select b from notininner);
+
+--
+-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
+--
+create temp table nocolumns();
+select exists(select * from nocolumns);
+
+--
+-- Check behavior with a SubPlan in VALUES (bug #14924)
+--
+select val.x
+ from generate_series(1,10) as s(i),
+ lateral (
+ values ((select s.i + 1)), (s.i + 101)
+ ) as val(x)
+where s.i < 10 and (select val.x) < 110;
+
+-- another variant of that (bug #16213)
+explain (verbose, costs off)
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+
+select * from
+(values
+ (3 not in (select * from (values (1), (2)) ss1)),
+ (false)
+) ss;
+
+--
+-- Check sane behavior with nested IN SubLinks
+--
+explain (verbose, costs off)
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+select * from int4_tbl where
+ (case when f1 in (select unique1 from tenk1 a) then f1 else null end) in
+ (select ten from tenk1 b);
+
+--
+-- Check for incorrect optimization when IN subquery contains a SRF
+--
+explain (verbose, costs off)
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+select * from int4_tbl o where (f1, f1) in
+ (select f1, generate_series(1,50) / 10 g from int4_tbl i group by f1);
+
+--
+-- check for over-optimization of whole-row Var referencing an Append plan
+--
+select (select q from
+ (select 1,2,3 where f1 > 0
+ union all
+ select 4,5,6.0 where f1 <= 0
+ ) q )
+from int4_tbl;
+
+--
+-- Check for sane handling of a lateral reference in a subquery's quals
+-- (most of the complication here is to prevent the test case from being
+-- flattened too much)
+--
+explain (verbose, costs off)
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+
+select * from
+ int4_tbl i4,
+ lateral (
+ select i4.f1 > 1 as b, 1 as id
+ from (select random() order by 1) as t1
+ union all
+ select true as b, 2 as id
+ ) as t2
+where b and f1 >= 0;
+
+--
+-- Check that volatile quals aren't pushed down past a DISTINCT:
+-- nextval() should not be called more than the nominal number of times
+--
+create temp sequence ts1;
+
+select * from
+ (select distinct ten from tenk1) ss
+ where ten < 10 + nextval('ts1')
+ order by 1;
+
+select nextval('ts1');
+
+--
+-- Check that volatile quals aren't pushed down past a set-returning function;
+-- while a nonvolatile qual can be, if it doesn't reference the SRF.
+--
+create function tattle(x int, y int) returns bool
+volatile language plpgsql as $$
+begin
+ raise notice 'x = %, y = %', x, y;
+ return x > y;
+end$$;
+
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+
+-- if we pretend it's stable, we get different results:
+alter function tattle(x int, y int) stable;
+
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, 8);
+
+-- although even a stable qual should not be pushed down if it references SRF
+explain (verbose, costs off)
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+
+select * from
+ (select 9 as x, unnest(array[1,2,3,11,12,13]) as u) ss
+ where tattle(x, u);
+
+drop function tattle(x int, y int);
+
+--
+-- Test that LIMIT can be pushed to SORT through a subquery that just projects
+-- columns. We check for that having happened by looking to see if EXPLAIN
+-- ANALYZE shows that a top-N sort was used. We must suppress or filter away
+-- all the non-invariant parts of the EXPLAIN ANALYZE output.
+--
+create table sq_limit (pk int primary key, c1 int, c2 int);
+insert into sq_limit values
+ (1, 1, 1),
+ (2, 2, 2),
+ (3, 3, 3),
+ (4, 4, 4),
+ (5, 1, 1),
+ (6, 2, 2),
+ (7, 3, 3),
+ (8, 4, 4);
+
+create function explain_sq_limit() returns setof text language plpgsql as
+$$
+declare ln text;
+begin
+ for ln in
+ explain (analyze, summary off, timing off, costs off)
+ select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3
+ loop
+ ln := regexp_replace(ln, 'Memory: \S*', 'Memory: xxx');
+ return next ln;
+ end loop;
+end;
+$$;
+
+select * from explain_sq_limit();
+
+select * from (select pk,c2 from sq_limit order by c1,pk) as x limit 3;
+
+drop function explain_sq_limit();
+
+drop table sq_limit;
+
+--
+-- Ensure that backward scan direction isn't propagated into
+-- expression subqueries (bug #15336)
+--
+
+begin;
+
+declare c1 scroll cursor for
+ select * from generate_series(1,4) i
+ where i <> all (values (2),(3));
+
+move forward all in c1;
+fetch backward all in c1;
+
+commit;
+
+--
+-- Tests for CTE inlining behavior
+--
+
+-- Basic subquery that can be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+
+-- Explicitly request materialization
+explain (verbose, costs off)
+with x as materialized (select * from (select f1 from subselect_tbl) ss)
+select * from x where f1 = 1;
+
+-- Stable functions are safe to inline
+explain (verbose, costs off)
+with x as (select * from (select f1, now() from subselect_tbl) ss)
+select * from x where f1 = 1;
+
+-- Volatile functions prevent inlining
+explain (verbose, costs off)
+with x as (select * from (select f1, random() from subselect_tbl) ss)
+select * from x where f1 = 1;
+
+-- SELECT FOR UPDATE cannot be inlined
+explain (verbose, costs off)
+with x as (select * from (select f1 from subselect_tbl for update) ss)
+select * from x where f1 = 1;
+
+-- Multiply-referenced CTEs are inlined only when requested
+explain (verbose, costs off)
+with x as (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+
+explain (verbose, costs off)
+with x as not materialized (select * from (select f1, now() as n from subselect_tbl) ss)
+select * from x, x x2 where x.n = x2.n;
+
+-- Multiply-referenced CTEs can't be inlined if they contain outer self-refs
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z1.a as a from z cross join z as z1
+ where length(z.a || z1.a) < 5))
+select * from x;
+
+explain (verbose, costs off)
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+
+with recursive x(a) as
+ ((values ('a'), ('b'))
+ union all
+ (with z as not materialized (select * from x)
+ select z.a || z.a as a from z
+ where length(z.a || z.a) < 5))
+select * from x;
+
+-- Check handling of outer references
+explain (verbose, costs off)
+with x as (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+
+explain (verbose, costs off)
+with x as materialized (select * from int4_tbl)
+select * from (with y as (select * from x) select * from y) ss;
+
+-- Ensure that we inline the currect CTE when there are
+-- multiple CTEs with the same name
+explain (verbose, costs off)
+with x as (select 1 as y)
+select * from (with x as (select 2 as y) select * from x) ss;
+
+-- Row marks are not pushed into CTEs
+explain (verbose, costs off)
+with x as (select * from subselect_tbl)
+select * from x for update;
diff --git a/yql/essentials/tests/postgresql/original/cases/text.out b/yql/essentials/tests/postgresql/original/cases/text.out
new file mode 100644
index 0000000000..b625b09f32
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/text.out
@@ -0,0 +1,440 @@
+--
+-- TEXT
+--
+SELECT text 'this is a text string' = text 'this is a text string' AS true;
+ true
+------
+ t
+(1 row)
+
+SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+ false
+-------
+ f
+(1 row)
+
+CREATE TABLE TEXT_TBL (f1 text);
+INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+SELECT * FROM TEXT_TBL;
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
+-- As of 8.3 we have removed most implicit casts to text, so that for example
+-- this no longer works:
+select length(42);
+ERROR: function length(integer) does not exist
+LINE 1: select length(42);
+ ^
+HINT: No function matches the given name and argument types. You might need to add explicit type casts.
+-- But as a special exception for usability's sake, we still allow implicit
+-- casting to text in concatenations, so long as the other input is text or
+-- an unknown literal. So these work:
+select 'four: '::text || 2+2;
+ ?column?
+----------
+ four: 4
+(1 row)
+
+select 'four: ' || 2+2;
+ ?column?
+----------
+ four: 4
+(1 row)
+
+-- but not this:
+select 3 || 4.0;
+ERROR: operator does not exist: integer || numeric
+LINE 1: select 3 || 4.0;
+ ^
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+/*
+ * various string functions
+ */
+select concat('one');
+ concat
+--------
+ one
+(1 row)
+
+select concat(1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+ concat
+----------------------
+ 123hellotf03-09-2010
+(1 row)
+
+select concat_ws('#','one');
+ concat_ws
+-----------
+ one
+(1 row)
+
+select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+ concat_ws
+----------------------------
+ 1#2#3#hello#t#f#03-09-2010
+(1 row)
+
+select concat_ws(',',10,20,null,30);
+ concat_ws
+-----------
+ 10,20,30
+(1 row)
+
+select concat_ws('',10,20,null,30);
+ concat_ws
+-----------
+ 102030
+(1 row)
+
+select concat_ws(NULL,10,20,null,30) is null;
+ ?column?
+----------
+ t
+(1 row)
+
+select reverse('abcde');
+ reverse
+---------
+ edcba
+(1 row)
+
+select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
+ i | left | right
+----+------+-------
+ -5 | |
+ -4 | |
+ -3 | a | j
+ -2 | ah | oj
+ -1 | aho | hoj
+ 0 | |
+ 1 | a | j
+ 2 | ah | oj
+ 3 | aho | hoj
+ 4 | ahoj | ahoj
+ 5 | ahoj | ahoj
+(11 rows)
+
+select quote_literal('');
+ quote_literal
+---------------
+ ''
+(1 row)
+
+select quote_literal('abc''');
+ quote_literal
+---------------
+ 'abc'''
+(1 row)
+
+select quote_literal(e'\\');
+ quote_literal
+---------------
+ E'\\'
+(1 row)
+
+-- check variadic labeled argument
+select concat(variadic array[1,2,3]);
+ concat
+--------
+ 123
+(1 row)
+
+select concat_ws(',', variadic array[1,2,3]);
+ concat_ws
+-----------
+ 1,2,3
+(1 row)
+
+select concat_ws(',', variadic NULL::int[]);
+ concat_ws
+-----------
+
+(1 row)
+
+select concat(variadic NULL::int[]) is NULL;
+ ?column?
+----------
+ t
+(1 row)
+
+select concat(variadic '{}'::int[]) = '';
+ ?column?
+----------
+ t
+(1 row)
+
+--should fail
+select concat_ws(',', variadic 10);
+ERROR: VARIADIC argument must be an array
+LINE 1: select concat_ws(',', variadic 10);
+ ^
+/*
+ * format
+ */
+select format(NULL);
+ format
+--------
+
+(1 row)
+
+select format('Hello');
+ format
+--------
+ Hello
+(1 row)
+
+select format('Hello %s', 'World');
+ format
+-------------
+ Hello World
+(1 row)
+
+select format('Hello %%');
+ format
+---------
+ Hello %
+(1 row)
+
+select format('Hello %%%%');
+ format
+----------
+ Hello %%
+(1 row)
+
+-- should fail
+select format('Hello %s %s', 'World');
+ERROR: too few arguments for format()
+select format('Hello %s');
+ERROR: too few arguments for format()
+select format('Hello %x', 20);
+ERROR: unrecognized format() type specifier "x"
+HINT: For a single "%" use "%%".
+-- check literal and sql identifiers
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, 'Hello');
+ format
+----------------------------------------
+ INSERT INTO mytab VALUES('10','Hello')
+(1 row)
+
+select format('%s%s%s','Hello', NULL,'World');
+ format
+------------
+ HelloWorld
+(1 row)
+
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, NULL);
+ format
+-------------------------------------
+ INSERT INTO mytab VALUES('10',NULL)
+(1 row)
+
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello');
+ format
+----------------------------------------
+ INSERT INTO mytab VALUES(NULL,'Hello')
+(1 row)
+
+-- should fail, sql identifier cannot be NULL
+select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello');
+ERROR: null values cannot be formatted as an SQL identifier
+-- check positional placeholders
+select format('%1$s %3$s', 1, 2, 3);
+ format
+--------
+ 1 3
+(1 row)
+
+select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ format
+--------
+ 1 12
+(1 row)
+
+-- should fail
+select format('%1$s %4$s', 1, 2, 3);
+ERROR: too few arguments for format()
+select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+ERROR: too few arguments for format()
+select format('%0$s', 'Hello');
+ERROR: format specifies argument 0, but arguments are numbered from 1
+select format('%*0$s', 'Hello');
+ERROR: format specifies argument 0, but arguments are numbered from 1
+select format('%1$', 1);
+ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+select format('%1$1', 1);
+ERROR: unterminated format() type specifier
+HINT: For a single "%" use "%%".
+-- check mix of positional and ordered placeholders
+select format('Hello %s %1$s %s', 'World', 'Hello again');
+ format
+-------------------------------
+ Hello World World Hello again
+(1 row)
+
+select format('Hello %s %s, %2$s %2$s', 'World', 'Hello again');
+ format
+--------------------------------------------------
+ Hello World Hello again, Hello again Hello again
+(1 row)
+
+-- check variadic labeled arguments
+select format('%s, %s', variadic array['Hello','World']);
+ format
+--------------
+ Hello, World
+(1 row)
+
+select format('%s, %s', variadic array[1, 2]);
+ format
+--------
+ 1, 2
+(1 row)
+
+select format('%s, %s', variadic array[true, false]);
+ format
+--------
+ t, f
+(1 row)
+
+select format('%s, %s', variadic array[true, false]::text[]);
+ format
+-------------
+ true, false
+(1 row)
+
+-- check variadic with positional placeholders
+select format('%2$s, %1$s', variadic array['first', 'second']);
+ format
+---------------
+ second, first
+(1 row)
+
+select format('%2$s, %1$s', variadic array[1, 2]);
+ format
+--------
+ 2, 1
+(1 row)
+
+-- variadic argument can be array type NULL, but should not be referenced
+select format('Hello', variadic NULL::int[]);
+ format
+--------
+ Hello
+(1 row)
+
+-- variadic argument allows simulating more than FUNC_MAX_ARGS parameters
+select format(string_agg('%s',','), variadic array_agg(i))
+from generate_series(1,200) g(i);
+ format
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200
+(1 row)
+
+-- check field widths and left, right alignment
+select format('>>%10s<<', 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%10s<<', NULL);
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%10s<<', '');
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%-10s<<', '');
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%-10s<<', 'Hello');
+ format
+----------------
+ >>Hello <<
+(1 row)
+
+select format('>>%-10s<<', NULL);
+ format
+----------------
+ >> <<
+(1 row)
+
+select format('>>%1$10s<<', 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%1$-10I<<', 'Hello');
+ format
+----------------
+ >>"Hello" <<
+(1 row)
+
+select format('>>%2$*1$L<<', 10, 'Hello');
+ format
+----------------
+ >> 'Hello'<<
+(1 row)
+
+select format('>>%2$*1$L<<', 10, NULL);
+ format
+----------------
+ >> NULL<<
+(1 row)
+
+select format('>>%2$*1$L<<', -10, NULL);
+ format
+----------------
+ >>NULL <<
+(1 row)
+
+select format('>>%*s<<', 10, 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%*1$s<<', 10, 'Hello');
+ format
+----------------
+ >> Hello<<
+(1 row)
+
+select format('>>%-s<<', 'Hello');
+ format
+-----------
+ >>Hello<<
+(1 row)
+
+select format('>>%10L<<', NULL);
+ format
+----------------
+ >> NULL<<
+(1 row)
+
+select format('>>%2$*1$L<<', NULL, 'Hello');
+ format
+-------------
+ >>'Hello'<<
+(1 row)
+
+select format('>>%2$*1$L<<', 0, 'Hello');
+ format
+-------------
+ >>'Hello'<<
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/text.sql b/yql/essentials/tests/postgresql/original/cases/text.sql
new file mode 100644
index 0000000000..56eee69abc
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/text.sql
@@ -0,0 +1,118 @@
+--
+-- TEXT
+--
+
+SELECT text 'this is a text string' = text 'this is a text string' AS true;
+
+SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+
+CREATE TABLE TEXT_TBL (f1 text);
+
+INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+
+SELECT * FROM TEXT_TBL;
+
+-- As of 8.3 we have removed most implicit casts to text, so that for example
+-- this no longer works:
+
+select length(42);
+
+-- But as a special exception for usability's sake, we still allow implicit
+-- casting to text in concatenations, so long as the other input is text or
+-- an unknown literal. So these work:
+
+select 'four: '::text || 2+2;
+select 'four: ' || 2+2;
+
+-- but not this:
+
+select 3 || 4.0;
+
+/*
+ * various string functions
+ */
+select concat('one');
+select concat(1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+select concat_ws('#','one');
+select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
+select concat_ws(',',10,20,null,30);
+select concat_ws('',10,20,null,30);
+select concat_ws(NULL,10,20,null,30) is null;
+select reverse('abcde');
+select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
+select quote_literal('');
+select quote_literal('abc''');
+select quote_literal(e'\\');
+-- check variadic labeled argument
+select concat(variadic array[1,2,3]);
+select concat_ws(',', variadic array[1,2,3]);
+select concat_ws(',', variadic NULL::int[]);
+select concat(variadic NULL::int[]) is NULL;
+select concat(variadic '{}'::int[]) = '';
+--should fail
+select concat_ws(',', variadic 10);
+
+/*
+ * format
+ */
+select format(NULL);
+select format('Hello');
+select format('Hello %s', 'World');
+select format('Hello %%');
+select format('Hello %%%%');
+-- should fail
+select format('Hello %s %s', 'World');
+select format('Hello %s');
+select format('Hello %x', 20);
+-- check literal and sql identifiers
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, 'Hello');
+select format('%s%s%s','Hello', NULL,'World');
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', 10, NULL);
+select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello');
+-- should fail, sql identifier cannot be NULL
+select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello');
+-- check positional placeholders
+select format('%1$s %3$s', 1, 2, 3);
+select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+-- should fail
+select format('%1$s %4$s', 1, 2, 3);
+select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+select format('%0$s', 'Hello');
+select format('%*0$s', 'Hello');
+select format('%1$', 1);
+select format('%1$1', 1);
+-- check mix of positional and ordered placeholders
+select format('Hello %s %1$s %s', 'World', 'Hello again');
+select format('Hello %s %s, %2$s %2$s', 'World', 'Hello again');
+-- check variadic labeled arguments
+select format('%s, %s', variadic array['Hello','World']);
+select format('%s, %s', variadic array[1, 2]);
+select format('%s, %s', variadic array[true, false]);
+select format('%s, %s', variadic array[true, false]::text[]);
+-- check variadic with positional placeholders
+select format('%2$s, %1$s', variadic array['first', 'second']);
+select format('%2$s, %1$s', variadic array[1, 2]);
+-- variadic argument can be array type NULL, but should not be referenced
+select format('Hello', variadic NULL::int[]);
+-- variadic argument allows simulating more than FUNC_MAX_ARGS parameters
+select format(string_agg('%s',','), variadic array_agg(i))
+from generate_series(1,200) g(i);
+-- check field widths and left, right alignment
+select format('>>%10s<<', 'Hello');
+select format('>>%10s<<', NULL);
+select format('>>%10s<<', '');
+select format('>>%-10s<<', '');
+select format('>>%-10s<<', 'Hello');
+select format('>>%-10s<<', NULL);
+select format('>>%1$10s<<', 'Hello');
+select format('>>%1$-10I<<', 'Hello');
+select format('>>%2$*1$L<<', 10, 'Hello');
+select format('>>%2$*1$L<<', 10, NULL);
+select format('>>%2$*1$L<<', -10, NULL);
+select format('>>%*s<<', 10, 'Hello');
+select format('>>%*1$s<<', 10, 'Hello');
+select format('>>%-s<<', 'Hello');
+select format('>>%10L<<', NULL);
+select format('>>%2$*1$L<<', NULL, 'Hello');
+select format('>>%2$*1$L<<', 0, 'Hello');
diff --git a/yql/essentials/tests/postgresql/original/cases/time.out b/yql/essentials/tests/postgresql/original/cases/time.out
new file mode 100644
index 0000000000..39b409feca
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/time.out
@@ -0,0 +1,200 @@
+--
+-- TIME
+--
+CREATE TABLE TIME_TBL (f1 time(2));
+INSERT INTO TIME_TBL VALUES ('00:00');
+INSERT INTO TIME_TBL VALUES ('01:00');
+-- as of 7.4, timezone spec should be accepted and ignored
+INSERT INTO TIME_TBL VALUES ('02:03 PST');
+INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+INSERT INTO TIME_TBL VALUES ('12:00');
+INSERT INTO TIME_TBL VALUES ('12:01');
+INSERT INTO TIME_TBL VALUES ('23:59');
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
+ERROR: invalid input syntax for type time: "15:36:39 America/New_York"
+LINE 1: INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
+ ^
+SELECT f1 AS "Time" FROM TIME_TBL;
+ Time
+-------------
+ 00:00:00
+ 01:00:00
+ 02:03:00
+ 11:59:00
+ 12:00:00
+ 12:01:00
+ 23:59:00
+ 23:59:59.99
+ 15:36:39
+ 15:36:39
+(10 rows)
+
+SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
+ Three
+----------
+ 00:00:00
+ 01:00:00
+ 02:03:00
+(3 rows)
+
+SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
+ Five
+-------------
+ 11:59:00
+ 12:00:00
+ 12:01:00
+ 23:59:00
+ 23:59:59.99
+ 15:36:39
+ 15:36:39
+(7 rows)
+
+SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
+ None
+------
+(0 rows)
+
+SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
+ Eight
+-------------
+ 00:00:00
+ 01:00:00
+ 02:03:00
+ 11:59:00
+ 12:00:00
+ 12:01:00
+ 23:59:00
+ 23:59:59.99
+ 15:36:39
+ 15:36:39
+(10 rows)
+
+-- Check edge cases
+SELECT '23:59:59.999999'::time;
+ time
+-----------------
+ 23:59:59.999999
+(1 row)
+
+SELECT '23:59:59.9999999'::time; -- rounds up
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '23:59:60'::time; -- rounds up
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '24:00:00'::time; -- allowed
+ time
+----------
+ 24:00:00
+(1 row)
+
+SELECT '24:00:00.01'::time; -- not allowed
+ERROR: date/time field value out of range: "24:00:00.01"
+LINE 1: SELECT '24:00:00.01'::time;
+ ^
+SELECT '23:59:60.01'::time; -- not allowed
+ERROR: date/time field value out of range: "23:59:60.01"
+LINE 1: SELECT '23:59:60.01'::time;
+ ^
+SELECT '24:01:00'::time; -- not allowed
+ERROR: date/time field value out of range: "24:01:00"
+LINE 1: SELECT '24:01:00'::time;
+ ^
+SELECT '25:00:00'::time; -- not allowed
+ERROR: date/time field value out of range: "25:00:00"
+LINE 1: SELECT '25:00:00'::time;
+ ^
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
+ERROR: operator is not unique: time without time zone + time without time zone
+LINE 1: SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
+ ^
+HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+----------
+ 25575401
+(1 row)
+
+SELECT EXTRACT(MILLISECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+-----------
+ 25575.401
+(1 row)
+
+SELECT EXTRACT(SECOND FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+-----------
+ 25.575401
+(1 row)
+
+SELECT EXTRACT(MINUTE FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+---------
+ 30
+(1 row)
+
+SELECT EXTRACT(HOUR FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+---------
+ 13
+(1 row)
+
+SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "day" not recognized
+SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+ERROR: "time" units "timezone" not recognized
+SELECT EXTRACT(EPOCH FROM TIME '2020-05-26 13:30:25.575401');
+ extract
+--------------
+ 48625.575401
+(1 row)
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25575401
+(1 row)
+
+SELECT date_part('millisecond', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25575.401
+(1 row)
+
+SELECT date_part('second', TIME '2020-05-26 13:30:25.575401');
+ date_part
+-----------
+ 25.575401
+(1 row)
+
+SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401');
+ date_part
+--------------
+ 48625.575401
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/time.sql b/yql/essentials/tests/postgresql/original/cases/time.sql
new file mode 100644
index 0000000000..3637f28798
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/time.sql
@@ -0,0 +1,72 @@
+--
+-- TIME
+--
+
+CREATE TABLE TIME_TBL (f1 time(2));
+
+INSERT INTO TIME_TBL VALUES ('00:00');
+INSERT INTO TIME_TBL VALUES ('01:00');
+-- as of 7.4, timezone spec should be accepted and ignored
+INSERT INTO TIME_TBL VALUES ('02:03 PST');
+INSERT INTO TIME_TBL VALUES ('11:59 EDT');
+INSERT INTO TIME_TBL VALUES ('12:00');
+INSERT INTO TIME_TBL VALUES ('12:01');
+INSERT INTO TIME_TBL VALUES ('23:59');
+INSERT INTO TIME_TBL VALUES ('11:59:59.99 PM');
+
+INSERT INTO TIME_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIME_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIME_TBL VALUES ('15:36:39 America/New_York');
+
+
+SELECT f1 AS "Time" FROM TIME_TBL;
+
+SELECT f1 AS "Three" FROM TIME_TBL WHERE f1 < '05:06:07';
+
+SELECT f1 AS "Five" FROM TIME_TBL WHERE f1 > '05:06:07';
+
+SELECT f1 AS "None" FROM TIME_TBL WHERE f1 < '00:00';
+
+SELECT f1 AS "Eight" FROM TIME_TBL WHERE f1 >= '00:00';
+
+-- Check edge cases
+SELECT '23:59:59.999999'::time;
+SELECT '23:59:59.9999999'::time; -- rounds up
+SELECT '23:59:60'::time; -- rounds up
+SELECT '24:00:00'::time; -- allowed
+SELECT '24:00:00.01'::time; -- not allowed
+SELECT '23:59:60.01'::time; -- not allowed
+SELECT '24:01:00'::time; -- not allowed
+SELECT '25:00:00'::time; -- not allowed
+
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+
+SELECT f1 + time '00:01' AS "Illegal" FROM TIME_TBL;
+
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(MILLISECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(SECOND FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(MINUTE FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(HOUR FROM TIME '2020-05-26 13:30:25.575401');
+SELECT EXTRACT(DAY FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(FORTNIGHT FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(TIMEZONE FROM TIME '2020-05-26 13:30:25.575401'); -- error
+SELECT EXTRACT(EPOCH FROM TIME '2020-05-26 13:30:25.575401');
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('millisecond', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('second', TIME '2020-05-26 13:30:25.575401');
+SELECT date_part('epoch', TIME '2020-05-26 13:30:25.575401');
diff --git a/yql/essentials/tests/postgresql/original/cases/timestamp.out b/yql/essentials/tests/postgresql/original/cases/timestamp.out
new file mode 100644
index 0000000000..79f8180955
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timestamp.out
@@ -0,0 +1,2081 @@
+--
+-- TIMESTAMP
+--
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('today');
+INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
+-- time zone should be ignored by this data type
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow EST');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow zulu');
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'today';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS Three FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'tomorrow';
+ three
+-------
+ 3
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'yesterday';
+ one
+-----
+ 1
+(1 row)
+
+COMMIT;
+DELETE FROM TIMESTAMP_TBL;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
+ two
+-----
+ 2
+(1 row)
+
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMP_TBL;
+ three | two
+-------+-----
+ 3 | 2
+(1 row)
+
+COMMIT;
+TRUNCATE TIMESTAMP_TBL;
+-- Special values
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+-- ISO 8601 format
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+-- this fails (even though TZ is a no-op, we still look it up)
+INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ERROR: time zone "america/does_not_exist" not recognized
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/D...
+ ^
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 18:32:01 PDT');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+ ^
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC')...
+ ^
+SELECT d1 FROM TIMESTAMP_TBL;
+ d1
+-----------------------------
+ -infinity
+ infinity
+ Thu Jan 01 00:00:00 1970
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:02 1997
+ Mon Feb 10 17:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997
+ Thu Jan 02 00:00:00 1997
+ Thu Jan 02 03:04:05 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 17:32:01 1997
+ Sat Sep 22 18:19:20 2001
+ Wed Mar 15 08:14:01 2000
+ Wed Mar 15 13:14:02 2000
+ Wed Mar 15 12:14:03 2000
+ Wed Mar 15 03:14:04 2000
+ Wed Mar 15 02:14:05 2000
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:00 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 18:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Feb 11 17:32:01 1997
+ Wed Feb 12 17:32:01 1997
+ Thu Feb 13 17:32:01 1997
+ Fri Feb 14 17:32:01 1997
+ Sat Feb 15 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Tue Feb 16 17:32:01 0097 BC
+ Sat Feb 16 17:32:01 0097
+ Thu Feb 16 17:32:01 0597
+ Tue Feb 16 17:32:01 1097
+ Sat Feb 16 17:32:01 1697
+ Thu Feb 16 17:32:01 1797
+ Tue Feb 16 17:32:01 1897
+ Sun Feb 16 17:32:01 1997
+ Sat Feb 16 17:32:01 2097
+ Wed Feb 28 17:32:01 1996
+ Thu Feb 29 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Wed Jan 01 17:32:01 1997
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+(65 rows)
+
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00 BC'::timestamp;
+ timestamp
+-----------------------------
+ Mon Nov 24 00:00:00 4714 BC
+(1 row)
+
+SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+ERROR: timestamp out of range: "4714-11-23 23:59:59 BC"
+LINE 1: SELECT '4714-11-23 23:59:59 BC'::timestamp;
+ ^
+SELECT '294276-12-31 23:59:59'::timestamp;
+ timestamp
+----------------------------
+ Sun Dec 31 23:59:59 294276
+(1 row)
+
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00"
+LINE 1: SELECT '294277-01-01 00:00:00'::timestamp;
+ ^
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 > timestamp without time zone '1997-01-02';
+ d1
+----------------------------
+ infinity
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:02 1997
+ Mon Feb 10 17:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997
+ Thu Jan 02 03:04:05 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 17:32:01 1997
+ Sat Sep 22 18:19:20 2001
+ Wed Mar 15 08:14:01 2000
+ Wed Mar 15 13:14:02 2000
+ Wed Mar 15 12:14:03 2000
+ Wed Mar 15 03:14:04 2000
+ Wed Mar 15 02:14:05 2000
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:00 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 18:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Feb 11 17:32:01 1997
+ Wed Feb 12 17:32:01 1997
+ Thu Feb 13 17:32:01 1997
+ Fri Feb 14 17:32:01 1997
+ Sat Feb 15 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Sat Feb 16 17:32:01 2097
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+(49 rows)
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 < timestamp without time zone '1997-01-02';
+ d1
+-----------------------------
+ -infinity
+ Thu Jan 01 00:00:00 1970
+ Tue Feb 16 17:32:01 0097 BC
+ Sat Feb 16 17:32:01 0097
+ Thu Feb 16 17:32:01 0597
+ Tue Feb 16 17:32:01 1097
+ Sat Feb 16 17:32:01 1697
+ Thu Feb 16 17:32:01 1797
+ Tue Feb 16 17:32:01 1897
+ Wed Feb 28 17:32:01 1996
+ Thu Feb 29 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Wed Jan 01 17:32:01 1997
+(15 rows)
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 = timestamp without time zone '1997-01-02';
+ d1
+--------------------------
+ Thu Jan 02 00:00:00 1997
+(1 row)
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 != timestamp without time zone '1997-01-02';
+ d1
+-----------------------------
+ -infinity
+ infinity
+ Thu Jan 01 00:00:00 1970
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:02 1997
+ Mon Feb 10 17:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997
+ Thu Jan 02 03:04:05 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 17:32:01 1997
+ Sat Sep 22 18:19:20 2001
+ Wed Mar 15 08:14:01 2000
+ Wed Mar 15 13:14:02 2000
+ Wed Mar 15 12:14:03 2000
+ Wed Mar 15 03:14:04 2000
+ Wed Mar 15 02:14:05 2000
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:00 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 18:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Feb 11 17:32:01 1997
+ Wed Feb 12 17:32:01 1997
+ Thu Feb 13 17:32:01 1997
+ Fri Feb 14 17:32:01 1997
+ Sat Feb 15 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Tue Feb 16 17:32:01 0097 BC
+ Sat Feb 16 17:32:01 0097
+ Thu Feb 16 17:32:01 0597
+ Tue Feb 16 17:32:01 1097
+ Sat Feb 16 17:32:01 1697
+ Thu Feb 16 17:32:01 1797
+ Tue Feb 16 17:32:01 1897
+ Sun Feb 16 17:32:01 1997
+ Sat Feb 16 17:32:01 2097
+ Wed Feb 28 17:32:01 1996
+ Thu Feb 29 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Wed Jan 01 17:32:01 1997
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+(64 rows)
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 <= timestamp without time zone '1997-01-02';
+ d1
+-----------------------------
+ -infinity
+ Thu Jan 01 00:00:00 1970
+ Thu Jan 02 00:00:00 1997
+ Tue Feb 16 17:32:01 0097 BC
+ Sat Feb 16 17:32:01 0097
+ Thu Feb 16 17:32:01 0597
+ Tue Feb 16 17:32:01 1097
+ Sat Feb 16 17:32:01 1697
+ Thu Feb 16 17:32:01 1797
+ Tue Feb 16 17:32:01 1897
+ Wed Feb 28 17:32:01 1996
+ Thu Feb 29 17:32:01 1996
+ Fri Mar 01 17:32:01 1996
+ Mon Dec 30 17:32:01 1996
+ Tue Dec 31 17:32:01 1996
+ Wed Jan 01 17:32:01 1997
+(16 rows)
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 >= timestamp without time zone '1997-01-02';
+ d1
+----------------------------
+ infinity
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:02 1997
+ Mon Feb 10 17:32:01.4 1997
+ Mon Feb 10 17:32:01.5 1997
+ Mon Feb 10 17:32:01.6 1997
+ Thu Jan 02 00:00:00 1997
+ Thu Jan 02 03:04:05 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 17:32:01 1997
+ Sat Sep 22 18:19:20 2001
+ Wed Mar 15 08:14:01 2000
+ Wed Mar 15 13:14:02 2000
+ Wed Mar 15 12:14:03 2000
+ Wed Mar 15 03:14:04 2000
+ Wed Mar 15 02:14:05 2000
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:00 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Jun 10 18:32:01 1997
+ Mon Feb 10 17:32:01 1997
+ Tue Feb 11 17:32:01 1997
+ Wed Feb 12 17:32:01 1997
+ Thu Feb 13 17:32:01 1997
+ Fri Feb 14 17:32:01 1997
+ Sat Feb 15 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Sun Feb 16 17:32:01 1997
+ Sat Feb 16 17:32:01 2097
+ Fri Feb 28 17:32:01 1997
+ Sat Mar 01 17:32:01 1997
+ Tue Dec 30 17:32:01 1997
+ Wed Dec 31 17:32:01 1997
+ Fri Dec 31 17:32:01 1999
+ Sat Jan 01 17:32:01 2000
+ Sun Dec 31 17:32:01 2000
+ Mon Jan 01 17:32:01 2001
+(50 rows)
+
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+ diff
+----------------------------------------
+ @ 9863 days ago
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 2 secs
+ @ 39 days 17 hours 32 mins 1.4 secs
+ @ 39 days 17 hours 32 mins 1.5 secs
+ @ 39 days 17 hours 32 mins 1.6 secs
+ @ 0
+ @ 3 hours 4 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 17 hours 32 mins 1 sec
+ @ 1724 days 18 hours 19 mins 20 secs
+ @ 1168 days 8 hours 14 mins 1 sec
+ @ 1168 days 13 hours 14 mins 2 secs
+ @ 1168 days 12 hours 14 mins 3 secs
+ @ 1168 days 3 hours 14 mins 4 secs
+ @ 1168 days 2 hours 14 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 18 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 40 days 17 hours 32 mins 1 sec
+ @ 41 days 17 hours 32 mins 1 sec
+ @ 42 days 17 hours 32 mins 1 sec
+ @ 43 days 17 hours 32 mins 1 sec
+ @ 44 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 308 days 6 hours 27 mins 59 secs ago
+ @ 307 days 6 hours 27 mins 59 secs ago
+ @ 306 days 6 hours 27 mins 59 secs ago
+ @ 2 days 6 hours 27 mins 59 secs ago
+ @ 1 day 6 hours 27 mins 59 secs ago
+ @ 6 hours 27 mins 59 secs ago
+ @ 57 days 17 hours 32 mins 1 sec
+ @ 58 days 17 hours 32 mins 1 sec
+ @ 362 days 17 hours 32 mins 1 sec
+ @ 363 days 17 hours 32 mins 1 sec
+ @ 1093 days 17 hours 32 mins 1 sec
+ @ 1094 days 17 hours 32 mins 1 sec
+ @ 1459 days 17 hours 32 mins 1 sec
+ @ 1460 days 17 hours 32 mins 1 sec
+(55 rows)
+
+SELECT date_trunc( 'week', timestamp '2004-02-29 15:44:17.71393' ) AS week_trunc;
+ week_trunc
+--------------------------
+ Mon Feb 23 00:00:00 2004
+(1 row)
+
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+-- case 1: AD dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2001-01-01') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 2: BC dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2000-01-01 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 3: AD dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2020-03-02') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- case 4: BC dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '0055-06-17 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ week | 7 d | t
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(7 rows)
+
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamp '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamp '2001-01-01')) origin (origin);
+ interval | ts | origin | date_bin
+-------------------+--------------------------------+--------------------------+--------------------------------
+ 15 days | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Thu Feb 06 00:00:00 2020
+ 2 hours | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 14:00:00 2020
+ 1 hour 30 minutes | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 15:00:00 2020
+ 15 minutes | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 15:30:00 2020
+ 10 seconds | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 15:44:10 2020
+ 100 milliseconds | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 15:44:17.7 2020
+ 250 microseconds | Tue Feb 11 15:44:17.71393 2020 | Mon Jan 01 00:00:00 2001 | Tue Feb 11 15:44:17.71375 2020
+(7 rows)
+
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamp '2020-02-01 01:01:01', timestamp '2020-02-01 00:02:30');
+ date_bin
+--------------------------
+ Sat Feb 01 00:57:30 2020
+(1 row)
+
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ERROR: timestamps cannot be binned into intervals containing months or years
+SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+ERROR: timestamps cannot be binned into intervals containing months or years
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+ERROR: stride must be greater than zero
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+ERROR: stride must be greater than zero
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN timestamp without time zone '1902-01-01'
+ AND timestamp without time zone '2038-01-01';
+ diff
+----------------------------------------
+ @ 9863 days ago
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 2 secs
+ @ 39 days 17 hours 32 mins 1.4 secs
+ @ 39 days 17 hours 32 mins 1.5 secs
+ @ 39 days 17 hours 32 mins 1.6 secs
+ @ 0
+ @ 3 hours 4 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 17 hours 32 mins 1 sec
+ @ 1724 days 18 hours 19 mins 20 secs
+ @ 1168 days 8 hours 14 mins 1 sec
+ @ 1168 days 13 hours 14 mins 2 secs
+ @ 1168 days 12 hours 14 mins 3 secs
+ @ 1168 days 3 hours 14 mins 4 secs
+ @ 1168 days 2 hours 14 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 18 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 40 days 17 hours 32 mins 1 sec
+ @ 41 days 17 hours 32 mins 1 sec
+ @ 42 days 17 hours 32 mins 1 sec
+ @ 43 days 17 hours 32 mins 1 sec
+ @ 44 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 308 days 6 hours 27 mins 59 secs ago
+ @ 307 days 6 hours 27 mins 59 secs ago
+ @ 306 days 6 hours 27 mins 59 secs ago
+ @ 2 days 6 hours 27 mins 59 secs ago
+ @ 1 day 6 hours 27 mins 59 secs ago
+ @ 6 hours 27 mins 59 secs ago
+ @ 57 days 17 hours 32 mins 1 sec
+ @ 58 days 17 hours 32 mins 1 sec
+ @ 362 days 17 hours 32 mins 1 sec
+ @ 363 days 17 hours 32 mins 1 sec
+ @ 1093 days 17 hours 32 mins 1 sec
+ @ 1094 days 17 hours 32 mins 1 sec
+ @ 1459 days 17 hours 32 mins 1 sec
+ @ 1460 days 17 hours 32 mins 1 sec
+(55 rows)
+
+-- DATE_PART (timestamp_part)
+SELECT d1 as "timestamp",
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMP_TBL;
+ timestamp | year | month | day | hour | minute | second
+-----------------------------+-----------+-------+-----+------+--------+--------
+ -infinity | -Infinity | | | | |
+ infinity | Infinity | | | | |
+ Thu Jan 01 00:00:00 1970 | 1970 | 1 | 1 | 0 | 0 | 0
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:02 1997 | 1997 | 2 | 10 | 17 | 32 | 2
+ Mon Feb 10 17:32:01.4 1997 | 1997 | 2 | 10 | 17 | 32 | 1.4
+ Mon Feb 10 17:32:01.5 1997 | 1997 | 2 | 10 | 17 | 32 | 1.5
+ Mon Feb 10 17:32:01.6 1997 | 1997 | 2 | 10 | 17 | 32 | 1.6
+ Thu Jan 02 00:00:00 1997 | 1997 | 1 | 2 | 0 | 0 | 0
+ Thu Jan 02 03:04:05 1997 | 1997 | 1 | 2 | 3 | 4 | 5
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Tue Jun 10 17:32:01 1997 | 1997 | 6 | 10 | 17 | 32 | 1
+ Sat Sep 22 18:19:20 2001 | 2001 | 9 | 22 | 18 | 19 | 20
+ Wed Mar 15 08:14:01 2000 | 2000 | 3 | 15 | 8 | 14 | 1
+ Wed Mar 15 13:14:02 2000 | 2000 | 3 | 15 | 13 | 14 | 2
+ Wed Mar 15 12:14:03 2000 | 2000 | 3 | 15 | 12 | 14 | 3
+ Wed Mar 15 03:14:04 2000 | 2000 | 3 | 15 | 3 | 14 | 4
+ Wed Mar 15 02:14:05 2000 | 2000 | 3 | 15 | 2 | 14 | 5
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:00 1997 | 1997 | 2 | 10 | 17 | 32 | 0
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Tue Jun 10 18:32:01 1997 | 1997 | 6 | 10 | 18 | 32 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
+ Tue Feb 11 17:32:01 1997 | 1997 | 2 | 11 | 17 | 32 | 1
+ Wed Feb 12 17:32:01 1997 | 1997 | 2 | 12 | 17 | 32 | 1
+ Thu Feb 13 17:32:01 1997 | 1997 | 2 | 13 | 17 | 32 | 1
+ Fri Feb 14 17:32:01 1997 | 1997 | 2 | 14 | 17 | 32 | 1
+ Sat Feb 15 17:32:01 1997 | 1997 | 2 | 15 | 17 | 32 | 1
+ Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 0097 BC | -97 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 0097 | 97 | 2 | 16 | 17 | 32 | 1
+ Thu Feb 16 17:32:01 0597 | 597 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 1097 | 1097 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 1697 | 1697 | 2 | 16 | 17 | 32 | 1
+ Thu Feb 16 17:32:01 1797 | 1797 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 1897 | 1897 | 2 | 16 | 17 | 32 | 1
+ Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 2097 | 2097 | 2 | 16 | 17 | 32 | 1
+ Wed Feb 28 17:32:01 1996 | 1996 | 2 | 28 | 17 | 32 | 1
+ Thu Feb 29 17:32:01 1996 | 1996 | 2 | 29 | 17 | 32 | 1
+ Fri Mar 01 17:32:01 1996 | 1996 | 3 | 1 | 17 | 32 | 1
+ Mon Dec 30 17:32:01 1996 | 1996 | 12 | 30 | 17 | 32 | 1
+ Tue Dec 31 17:32:01 1996 | 1996 | 12 | 31 | 17 | 32 | 1
+ Wed Jan 01 17:32:01 1997 | 1997 | 1 | 1 | 17 | 32 | 1
+ Fri Feb 28 17:32:01 1997 | 1997 | 2 | 28 | 17 | 32 | 1
+ Sat Mar 01 17:32:01 1997 | 1997 | 3 | 1 | 17 | 32 | 1
+ Tue Dec 30 17:32:01 1997 | 1997 | 12 | 30 | 17 | 32 | 1
+ Wed Dec 31 17:32:01 1997 | 1997 | 12 | 31 | 17 | 32 | 1
+ Fri Dec 31 17:32:01 1999 | 1999 | 12 | 31 | 17 | 32 | 1
+ Sat Jan 01 17:32:01 2000 | 2000 | 1 | 1 | 17 | 32 | 1
+ Sun Dec 31 17:32:01 2000 | 2000 | 12 | 31 | 17 | 32 | 1
+ Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1 | 17 | 32 | 1
+(65 rows)
+
+SELECT d1 as "timestamp",
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMP_TBL;
+ timestamp | quarter | msec | usec
+-----------------------------+---------+-------+----------
+ -infinity | | |
+ infinity | | |
+ Thu Jan 01 00:00:00 1970 | 1 | 0 | 0
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:02 1997 | 1 | 2000 | 2000000
+ Mon Feb 10 17:32:01.4 1997 | 1 | 1400 | 1400000
+ Mon Feb 10 17:32:01.5 1997 | 1 | 1500 | 1500000
+ Mon Feb 10 17:32:01.6 1997 | 1 | 1600 | 1600000
+ Thu Jan 02 00:00:00 1997 | 1 | 0 | 0
+ Thu Jan 02 03:04:05 1997 | 1 | 5000 | 5000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Tue Jun 10 17:32:01 1997 | 2 | 1000 | 1000000
+ Sat Sep 22 18:19:20 2001 | 3 | 20000 | 20000000
+ Wed Mar 15 08:14:01 2000 | 1 | 1000 | 1000000
+ Wed Mar 15 13:14:02 2000 | 1 | 2000 | 2000000
+ Wed Mar 15 12:14:03 2000 | 1 | 3000 | 3000000
+ Wed Mar 15 03:14:04 2000 | 1 | 4000 | 4000000
+ Wed Mar 15 02:14:05 2000 | 1 | 5000 | 5000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:00 1997 | 1 | 0 | 0
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Tue Jun 10 18:32:01 1997 | 2 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
+ Tue Feb 11 17:32:01 1997 | 1 | 1000 | 1000000
+ Wed Feb 12 17:32:01 1997 | 1 | 1000 | 1000000
+ Thu Feb 13 17:32:01 1997 | 1 | 1000 | 1000000
+ Fri Feb 14 17:32:01 1997 | 1 | 1000 | 1000000
+ Sat Feb 15 17:32:01 1997 | 1 | 1000 | 1000000
+ Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 0097 BC | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 0097 | 1 | 1000 | 1000000
+ Thu Feb 16 17:32:01 0597 | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 1097 | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 1697 | 1 | 1000 | 1000000
+ Thu Feb 16 17:32:01 1797 | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 1897 | 1 | 1000 | 1000000
+ Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 2097 | 1 | 1000 | 1000000
+ Wed Feb 28 17:32:01 1996 | 1 | 1000 | 1000000
+ Thu Feb 29 17:32:01 1996 | 1 | 1000 | 1000000
+ Fri Mar 01 17:32:01 1996 | 1 | 1000 | 1000000
+ Mon Dec 30 17:32:01 1996 | 4 | 1000 | 1000000
+ Tue Dec 31 17:32:01 1996 | 4 | 1000 | 1000000
+ Wed Jan 01 17:32:01 1997 | 1 | 1000 | 1000000
+ Fri Feb 28 17:32:01 1997 | 1 | 1000 | 1000000
+ Sat Mar 01 17:32:01 1997 | 1 | 1000 | 1000000
+ Tue Dec 30 17:32:01 1997 | 4 | 1000 | 1000000
+ Wed Dec 31 17:32:01 1997 | 4 | 1000 | 1000000
+ Fri Dec 31 17:32:01 1999 | 4 | 1000 | 1000000
+ Sat Jan 01 17:32:01 2000 | 1 | 1000 | 1000000
+ Sun Dec 31 17:32:01 2000 | 4 | 1000 | 1000000
+ Mon Jan 01 17:32:01 2001 | 1 | 1000 | 1000000
+(65 rows)
+
+SELECT d1 as "timestamp",
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMP_TBL;
+ timestamp | isoyear | week | isodow | dow | doy
+-----------------------------+-----------+------+--------+-----+-----
+ -infinity | -Infinity | | | |
+ infinity | Infinity | | | |
+ Thu Jan 01 00:00:00 1970 | 1970 | 1 | 4 | 4 | 1
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:02 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.4 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.5 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.6 1997 | 1997 | 7 | 1 | 1 | 41
+ Thu Jan 02 00:00:00 1997 | 1997 | 1 | 4 | 4 | 2
+ Thu Jan 02 03:04:05 1997 | 1997 | 1 | 4 | 4 | 2
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Tue Jun 10 17:32:01 1997 | 1997 | 24 | 2 | 2 | 161
+ Sat Sep 22 18:19:20 2001 | 2001 | 38 | 6 | 6 | 265
+ Wed Mar 15 08:14:01 2000 | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 13:14:02 2000 | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 12:14:03 2000 | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 03:14:04 2000 | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 02:14:05 2000 | 2000 | 11 | 3 | 3 | 75
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:00 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Tue Jun 10 18:32:01 1997 | 1997 | 24 | 2 | 2 | 161
+ Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
+ Tue Feb 11 17:32:01 1997 | 1997 | 7 | 2 | 2 | 42
+ Wed Feb 12 17:32:01 1997 | 1997 | 7 | 3 | 3 | 43
+ Thu Feb 13 17:32:01 1997 | 1997 | 7 | 4 | 4 | 44
+ Fri Feb 14 17:32:01 1997 | 1997 | 7 | 5 | 5 | 45
+ Sat Feb 15 17:32:01 1997 | 1997 | 7 | 6 | 6 | 46
+ Sun Feb 16 17:32:01 1997 | 1997 | 7 | 7 | 0 | 47
+ Tue Feb 16 17:32:01 0097 BC | -97 | 7 | 2 | 2 | 47
+ Sat Feb 16 17:32:01 0097 | 97 | 7 | 6 | 6 | 47
+ Thu Feb 16 17:32:01 0597 | 597 | 7 | 4 | 4 | 47
+ Tue Feb 16 17:32:01 1097 | 1097 | 7 | 2 | 2 | 47
+ Sat Feb 16 17:32:01 1697 | 1697 | 7 | 6 | 6 | 47
+ Thu Feb 16 17:32:01 1797 | 1797 | 7 | 4 | 4 | 47
+ Tue Feb 16 17:32:01 1897 | 1897 | 7 | 2 | 2 | 47
+ Sun Feb 16 17:32:01 1997 | 1997 | 7 | 7 | 0 | 47
+ Sat Feb 16 17:32:01 2097 | 2097 | 7 | 6 | 6 | 47
+ Wed Feb 28 17:32:01 1996 | 1996 | 9 | 3 | 3 | 59
+ Thu Feb 29 17:32:01 1996 | 1996 | 9 | 4 | 4 | 60
+ Fri Mar 01 17:32:01 1996 | 1996 | 9 | 5 | 5 | 61
+ Mon Dec 30 17:32:01 1996 | 1997 | 1 | 1 | 1 | 365
+ Tue Dec 31 17:32:01 1996 | 1997 | 1 | 2 | 2 | 366
+ Wed Jan 01 17:32:01 1997 | 1997 | 1 | 3 | 3 | 1
+ Fri Feb 28 17:32:01 1997 | 1997 | 9 | 5 | 5 | 59
+ Sat Mar 01 17:32:01 1997 | 1997 | 9 | 6 | 6 | 60
+ Tue Dec 30 17:32:01 1997 | 1998 | 1 | 2 | 2 | 364
+ Wed Dec 31 17:32:01 1997 | 1998 | 1 | 3 | 3 | 365
+ Fri Dec 31 17:32:01 1999 | 1999 | 52 | 5 | 5 | 365
+ Sat Jan 01 17:32:01 2000 | 1999 | 52 | 6 | 6 | 1
+ Sun Dec 31 17:32:01 2000 | 2000 | 52 | 7 | 0 | 366
+ Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1 | 1 | 1
+(65 rows)
+
+SELECT d1 as "timestamp",
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMP_TBL;
+ timestamp | decade | century | millennium | julian | epoch
+-----------------------------+-----------+-----------+------------+-----------+--------------
+ -infinity | -Infinity | -Infinity | -Infinity | -Infinity | -Infinity
+ infinity | Infinity | Infinity | Infinity | Infinity | Infinity
+ Thu Jan 01 00:00:00 1970 | 197 | 20 | 2 | 2440588 | 0
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:02 1997 | 199 | 20 | 2 | 2450491 | 855595922
+ Mon Feb 10 17:32:01.4 1997 | 199 | 20 | 2 | 2450491 | 855595921.4
+ Mon Feb 10 17:32:01.5 1997 | 199 | 20 | 2 | 2450491 | 855595921.5
+ Mon Feb 10 17:32:01.6 1997 | 199 | 20 | 2 | 2450491 | 855595921.6
+ Thu Jan 02 00:00:00 1997 | 199 | 20 | 2 | 2450451 | 852163200
+ Thu Jan 02 03:04:05 1997 | 199 | 20 | 2 | 2450451 | 852174245
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Tue Jun 10 17:32:01 1997 | 199 | 20 | 2 | 2450611 | 865963921
+ Sat Sep 22 18:19:20 2001 | 200 | 21 | 3 | 2452176 | 1001182760
+ Wed Mar 15 08:14:01 2000 | 200 | 20 | 2 | 2451619 | 953108041
+ Wed Mar 15 13:14:02 2000 | 200 | 20 | 2 | 2451620 | 953126042
+ Wed Mar 15 12:14:03 2000 | 200 | 20 | 2 | 2451620 | 953122443
+ Wed Mar 15 03:14:04 2000 | 200 | 20 | 2 | 2451619 | 953090044
+ Wed Mar 15 02:14:05 2000 | 200 | 20 | 2 | 2451619 | 953086445
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:00 1997 | 199 | 20 | 2 | 2450491 | 855595920
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Tue Jun 10 18:32:01 1997 | 199 | 20 | 2 | 2450611 | 865967521
+ Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491 | 855595921
+ Tue Feb 11 17:32:01 1997 | 199 | 20 | 2 | 2450492 | 855682321
+ Wed Feb 12 17:32:01 1997 | 199 | 20 | 2 | 2450493 | 855768721
+ Thu Feb 13 17:32:01 1997 | 199 | 20 | 2 | 2450494 | 855855121
+ Fri Feb 14 17:32:01 1997 | 199 | 20 | 2 | 2450495 | 855941521
+ Sat Feb 15 17:32:01 1997 | 199 | 20 | 2 | 2450496 | 856027921
+ Sun Feb 16 17:32:01 1997 | 199 | 20 | 2 | 2450497 | 856114321
+ Tue Feb 16 17:32:01 0097 BC | -10 | -1 | -1 | 1686043 | -65192711279
+ Sat Feb 16 17:32:01 0097 | 9 | 1 | 1 | 1756537 | -59102029679
+ Thu Feb 16 17:32:01 0597 | 59 | 6 | 1 | 1939158 | -43323575279
+ Tue Feb 16 17:32:01 1097 | 109 | 11 | 2 | 2121779 | -27545120879
+ Sat Feb 16 17:32:01 1697 | 169 | 17 | 2 | 2340925 | -8610906479
+ Thu Feb 16 17:32:01 1797 | 179 | 18 | 2 | 2377449 | -5455232879
+ Tue Feb 16 17:32:01 1897 | 189 | 19 | 2 | 2413973 | -2299559279
+ Sun Feb 16 17:32:01 1997 | 199 | 20 | 2 | 2450497 | 856114321
+ Sat Feb 16 17:32:01 2097 | 209 | 21 | 3 | 2487022 | 4011874321
+ Wed Feb 28 17:32:01 1996 | 199 | 20 | 2 | 2450143 | 825528721
+ Thu Feb 29 17:32:01 1996 | 199 | 20 | 2 | 2450144 | 825615121
+ Fri Mar 01 17:32:01 1996 | 199 | 20 | 2 | 2450145 | 825701521
+ Mon Dec 30 17:32:01 1996 | 199 | 20 | 2 | 2450449 | 851967121
+ Tue Dec 31 17:32:01 1996 | 199 | 20 | 2 | 2450450 | 852053521
+ Wed Jan 01 17:32:01 1997 | 199 | 20 | 2 | 2450451 | 852139921
+ Fri Feb 28 17:32:01 1997 | 199 | 20 | 2 | 2450509 | 857151121
+ Sat Mar 01 17:32:01 1997 | 199 | 20 | 2 | 2450510 | 857237521
+ Tue Dec 30 17:32:01 1997 | 199 | 20 | 2 | 2450814 | 883503121
+ Wed Dec 31 17:32:01 1997 | 199 | 20 | 2 | 2450815 | 883589521
+ Fri Dec 31 17:32:01 1999 | 199 | 20 | 2 | 2451545 | 946661521
+ Sat Jan 01 17:32:01 2000 | 200 | 20 | 2 | 2451546 | 946747921
+ Sun Dec 31 17:32:01 2000 | 200 | 20 | 2 | 2451911 | 978283921
+ Mon Jan 01 17:32:01 2001 | 200 | 21 | 3 | 2451912 | 978370321
+(65 rows)
+
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMP_TBL;
+ timestamp | microseconds | milliseconds | seconds | julian | epoch
+-----------------------------+--------------+--------------+-----------+-----------+---------------------
+ -infinity | | | | -Infinity | -Infinity
+ infinity | | | | Infinity | Infinity
+ Thu Jan 01 00:00:00 1970 | 0 | 0.000 | 0.000000 | 2440588 | 0.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:02 1997 | 2000000 | 2000.000 | 2.000000 | 2450491 | 855595922.000000
+ Mon Feb 10 17:32:01.4 1997 | 1400000 | 1400.000 | 1.400000 | 2450491 | 855595921.400000
+ Mon Feb 10 17:32:01.5 1997 | 1500000 | 1500.000 | 1.500000 | 2450491 | 855595921.500000
+ Mon Feb 10 17:32:01.6 1997 | 1600000 | 1600.000 | 1.600000 | 2450491 | 855595921.600000
+ Thu Jan 02 00:00:00 1997 | 0 | 0.000 | 0.000000 | 2450451 | 852163200.000000
+ Thu Jan 02 03:04:05 1997 | 5000000 | 5000.000 | 5.000000 | 2450451 | 852174245.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Tue Jun 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450611 | 865963921.000000
+ Sat Sep 22 18:19:20 2001 | 20000000 | 20000.000 | 20.000000 | 2452176 | 1001182760.000000
+ Wed Mar 15 08:14:01 2000 | 1000000 | 1000.000 | 1.000000 | 2451619 | 953108041.000000
+ Wed Mar 15 13:14:02 2000 | 2000000 | 2000.000 | 2.000000 | 2451620 | 953126042.000000
+ Wed Mar 15 12:14:03 2000 | 3000000 | 3000.000 | 3.000000 | 2451620 | 953122443.000000
+ Wed Mar 15 03:14:04 2000 | 4000000 | 4000.000 | 4.000000 | 2451619 | 953090044.000000
+ Wed Mar 15 02:14:05 2000 | 5000000 | 5000.000 | 5.000000 | 2451619 | 953086445.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:00 1997 | 0 | 0.000 | 0.000000 | 2450491 | 855595920.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Tue Jun 10 18:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450611 | 865967521.000000
+ Mon Feb 10 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450491 | 855595921.000000
+ Tue Feb 11 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450492 | 855682321.000000
+ Wed Feb 12 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450493 | 855768721.000000
+ Thu Feb 13 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450494 | 855855121.000000
+ Fri Feb 14 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450495 | 855941521.000000
+ Sat Feb 15 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450496 | 856027921.000000
+ Sun Feb 16 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450497 | 856114321.000000
+ Tue Feb 16 17:32:01 0097 BC | 1000000 | 1000.000 | 1.000000 | 1686043 | -65192711279.000000
+ Sat Feb 16 17:32:01 0097 | 1000000 | 1000.000 | 1.000000 | 1756537 | -59102029679.000000
+ Thu Feb 16 17:32:01 0597 | 1000000 | 1000.000 | 1.000000 | 1939158 | -43323575279.000000
+ Tue Feb 16 17:32:01 1097 | 1000000 | 1000.000 | 1.000000 | 2121779 | -27545120879.000000
+ Sat Feb 16 17:32:01 1697 | 1000000 | 1000.000 | 1.000000 | 2340925 | -8610906479.000000
+ Thu Feb 16 17:32:01 1797 | 1000000 | 1000.000 | 1.000000 | 2377449 | -5455232879.000000
+ Tue Feb 16 17:32:01 1897 | 1000000 | 1000.000 | 1.000000 | 2413973 | -2299559279.000000
+ Sun Feb 16 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450497 | 856114321.000000
+ Sat Feb 16 17:32:01 2097 | 1000000 | 1000.000 | 1.000000 | 2487022 | 4011874321.000000
+ Wed Feb 28 17:32:01 1996 | 1000000 | 1000.000 | 1.000000 | 2450143 | 825528721.000000
+ Thu Feb 29 17:32:01 1996 | 1000000 | 1000.000 | 1.000000 | 2450144 | 825615121.000000
+ Fri Mar 01 17:32:01 1996 | 1000000 | 1000.000 | 1.000000 | 2450145 | 825701521.000000
+ Mon Dec 30 17:32:01 1996 | 1000000 | 1000.000 | 1.000000 | 2450449 | 851967121.000000
+ Tue Dec 31 17:32:01 1996 | 1000000 | 1000.000 | 1.000000 | 2450450 | 852053521.000000
+ Wed Jan 01 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450451 | 852139921.000000
+ Fri Feb 28 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450509 | 857151121.000000
+ Sat Mar 01 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450510 | 857237521.000000
+ Tue Dec 30 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450814 | 883503121.000000
+ Wed Dec 31 17:32:01 1997 | 1000000 | 1000.000 | 1.000000 | 2450815 | 883589521.000000
+ Fri Dec 31 17:32:01 1999 | 1000000 | 1000.000 | 1.000000 | 2451545 | 946661521.000000
+ Sat Jan 01 17:32:01 2000 | 1000000 | 1000.000 | 1.000000 | 2451546 | 946747921.000000
+ Sun Dec 31 17:32:01 2000 | 1000000 | 1000.000 | 1.000000 | 2451911 | 978283921.000000
+ Mon Jan 01 17:32:01 2001 | 1000000 | 1000.000 | 1.000000 | 2451912 | 978370321.000000
+(65 rows)
+
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
+ date_part
+---------------
+ 9224097091200
+(1 row)
+
+SELECT extract(epoch from '294270-01-01 00:00:00'::timestamp);
+ extract
+----------------------
+ 9224097091200.000000
+(1 row)
+
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00'::timestamp);
+ extract
+--------------------
+ 95617584000.000000
+(1 row)
+
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMP_TBL;
+ to_char
+------------------------------------------------------------------------------------------
+
+
+ THURSDAY Thursday thursday THU Thu thu JANUARY January january I JAN Jan jan
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu JANUARY January january I JAN Jan jan
+ THURSDAY Thursday thursday THU Thu thu JANUARY January january I JAN Jan jan
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue JUNE June june VI JUN Jun jun
+ SATURDAY Saturday saturday SAT Sat sat SEPTEMBER September september IX SEP Sep sep
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue JUNE June june VI JUN Jun jun
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ WEDNESDAY Wednesday wednesday WED Wed wed FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ FRIDAY Friday friday FRI Fri fri FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ SUNDAY Sunday sunday SUN Sun sun FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SUNDAY Sunday sunday SUN Sun sun FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ WEDNESDAY Wednesday wednesday WED Wed wed FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ FRIDAY Friday friday FRI Fri fri MARCH March march III MAR Mar mar
+ MONDAY Monday monday MON Mon mon DECEMBER December december XII DEC Dec dec
+ TUESDAY Tuesday tuesday TUE Tue tue DECEMBER December december XII DEC Dec dec
+ WEDNESDAY Wednesday wednesday WED Wed wed JANUARY January january I JAN Jan jan
+ FRIDAY Friday friday FRI Fri fri FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat MARCH March march III MAR Mar mar
+ TUESDAY Tuesday tuesday TUE Tue tue DECEMBER December december XII DEC Dec dec
+ WEDNESDAY Wednesday wednesday WED Wed wed DECEMBER December december XII DEC Dec dec
+ FRIDAY Friday friday FRI Fri fri DECEMBER December december XII DEC Dec dec
+ SATURDAY Saturday saturday SAT Sat sat JANUARY January january I JAN Jan jan
+ SUNDAY Sunday sunday SUN Sun sun DECEMBER December december XII DEC Dec dec
+ MONDAY Monday monday MON Mon mon JANUARY January january I JAN Jan jan
+(65 rows)
+
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMP_TBL;
+ to_char
+--------------------------------------------------------------
+
+
+ THURSDAY Thursday thursday JANUARY January january I
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ THURSDAY Thursday thursday JANUARY January january I
+ THURSDAY Thursday thursday JANUARY January january I
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ TUESDAY Tuesday tuesday JUNE June june VI
+ SATURDAY Saturday saturday SEPTEMBER September september IX
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ TUESDAY Tuesday tuesday JUNE June june VI
+ MONDAY Monday monday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ WEDNESDAY Wednesday wednesday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ FRIDAY Friday friday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ SUNDAY Sunday sunday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SUNDAY Sunday sunday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ WEDNESDAY Wednesday wednesday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ FRIDAY Friday friday MARCH March march III
+ MONDAY Monday monday DECEMBER December december XII
+ TUESDAY Tuesday tuesday DECEMBER December december XII
+ WEDNESDAY Wednesday wednesday JANUARY January january I
+ FRIDAY Friday friday FEBRUARY February february II
+ SATURDAY Saturday saturday MARCH March march III
+ TUESDAY Tuesday tuesday DECEMBER December december XII
+ WEDNESDAY Wednesday wednesday DECEMBER December december XII
+ FRIDAY Friday friday DECEMBER December december XII
+ SATURDAY Saturday saturday JANUARY January january I
+ SUNDAY Sunday sunday DECEMBER December december XII
+ MONDAY Monday monday JANUARY January january I
+(65 rows)
+
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMP_TBL;
+ to_char
+--------------------------------------------------
+
+
+ 1,970 1970 970 70 0 20 1 01 01 001 01 5 2440588
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 01 01 002 02 5 2450451
+ 1,997 1997 997 97 7 20 1 01 01 002 02 5 2450451
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
+ 2,001 2001 001 01 1 21 3 09 38 265 22 7 2452175
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 042 11 3 2450491
+ 1,997 1997 997 97 7 20 1 02 07 043 12 4 2450492
+ 1,997 1997 997 97 7 20 1 02 07 044 13 5 2450493
+ 1,997 1997 997 97 7 20 1 02 07 045 14 6 2450494
+ 1,997 1997 997 97 7 20 1 02 07 046 15 7 2450495
+ 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
+ 0,097 0097 097 97 7 -01 1 02 07 047 16 3 1686042
+ 0,097 0097 097 97 7 01 1 02 07 047 16 7 1756536
+ 0,597 0597 597 97 7 06 1 02 07 047 16 5 1939157
+ 1,097 1097 097 97 7 11 1 02 07 047 16 3 2121778
+ 1,697 1697 697 97 7 17 1 02 07 047 16 7 2340924
+ 1,797 1797 797 97 7 18 1 02 07 047 16 5 2377448
+ 1,897 1897 897 97 7 19 1 02 07 047 16 3 2413972
+ 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
+ 2,097 2097 097 97 7 21 1 02 07 047 16 7 2487021
+ 1,996 1996 996 96 6 20 1 02 09 059 28 4 2450142
+ 1,996 1996 996 96 6 20 1 02 09 060 29 5 2450143
+ 1,996 1996 996 96 6 20 1 03 09 061 01 6 2450144
+ 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
+ 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
+ 1,997 1997 997 97 7 20 1 01 01 001 01 4 2450450
+ 1,997 1997 997 97 7 20 1 02 09 059 28 6 2450508
+ 1,997 1997 997 97 7 20 1 03 09 060 01 7 2450509
+ 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
+ 1,997 1997 997 97 7 20 4 12 53 365 31 4 2450814
+ 1,999 1999 999 99 9 20 4 12 53 365 31 6 2451544
+ 2,000 2000 000 00 0 20 1 01 01 001 01 7 2451545
+ 2,000 2000 000 00 0 20 4 12 53 366 31 1 2451910
+ 2,001 2001 001 01 1 21 1 01 01 001 01 2 2451911
+(65 rows)
+
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMP_TBL;
+ to_char
+-------------------------------------------------
+
+
+ 1,970 1970 970 70 0 20 1 1 1 1 1 5 2440588
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 1 1 2 2 5 2450451
+ 1,997 1997 997 97 7 20 1 1 1 2 2 5 2450451
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
+ 2,001 2001 1 1 1 21 3 9 38 265 22 7 2452175
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 42 11 3 2450491
+ 1,997 1997 997 97 7 20 1 2 7 43 12 4 2450492
+ 1,997 1997 997 97 7 20 1 2 7 44 13 5 2450493
+ 1,997 1997 997 97 7 20 1 2 7 45 14 6 2450494
+ 1,997 1997 997 97 7 20 1 2 7 46 15 7 2450495
+ 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
+ 0,097 97 97 97 7 -1 1 2 7 47 16 3 1686042
+ 0,097 97 97 97 7 1 1 2 7 47 16 7 1756536
+ 0,597 597 597 97 7 6 1 2 7 47 16 5 1939157
+ 1,097 1097 97 97 7 11 1 2 7 47 16 3 2121778
+ 1,697 1697 697 97 7 17 1 2 7 47 16 7 2340924
+ 1,797 1797 797 97 7 18 1 2 7 47 16 5 2377448
+ 1,897 1897 897 97 7 19 1 2 7 47 16 3 2413972
+ 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
+ 2,097 2097 97 97 7 21 1 2 7 47 16 7 2487021
+ 1,996 1996 996 96 6 20 1 2 9 59 28 4 2450142
+ 1,996 1996 996 96 6 20 1 2 9 60 29 5 2450143
+ 1,996 1996 996 96 6 20 1 3 9 61 1 6 2450144
+ 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
+ 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
+ 1,997 1997 997 97 7 20 1 1 1 1 1 4 2450450
+ 1,997 1997 997 97 7 20 1 2 9 59 28 6 2450508
+ 1,997 1997 997 97 7 20 1 3 9 60 1 7 2450509
+ 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
+ 1,997 1997 997 97 7 20 4 12 53 365 31 4 2450814
+ 1,999 1999 999 99 9 20 4 12 53 365 31 6 2451544
+ 2,000 2000 0 0 0 20 1 1 1 1 1 7 2451545
+ 2,000 2000 0 0 0 20 4 12 53 366 31 1 2451910
+ 2,001 2001 1 1 1 21 1 1 1 1 1 2 2451911
+(65 rows)
+
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMP_TBL;
+ to_char
+----------------------
+
+
+ 12 12 00 00 00 0
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 02 63122
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 12 12 00 00 00 0
+ 03 03 03 04 05 11045
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 06 06 18 19 20 65960
+ 08 08 08 14 01 29641
+ 01 01 13 14 02 47642
+ 12 12 12 14 03 44043
+ 03 03 03 14 04 11644
+ 02 02 02 14 05 8045
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 00 63120
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 06 06 18 32 01 66721
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+(65 rows)
+
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMP_TBL;
+ to_char
+-------------------------------------------------
+
+
+ HH:MI:SS is 12:00:00 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:02 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 12:00:00 "text between quote marks"
+ HH:MI:SS is 03:04:05 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 06:19:20 "text between quote marks"
+ HH:MI:SS is 08:14:01 "text between quote marks"
+ HH:MI:SS is 01:14:02 "text between quote marks"
+ HH:MI:SS is 12:14:03 "text between quote marks"
+ HH:MI:SS is 03:14:04 "text between quote marks"
+ HH:MI:SS is 02:14:05 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:00 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 06:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+(65 rows)
+
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMP_TBL;
+ to_char
+------------------------
+
+
+ 00--text--00--text--00
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--02
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 00--text--00--text--00
+ 03--text--04--text--05
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 18--text--19--text--20
+ 08--text--14--text--01
+ 13--text--14--text--02
+ 12--text--14--text--03
+ 03--text--14--text--04
+ 02--text--14--text--05
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--00
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 18--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+(65 rows)
+
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMP_TBL;
+ to_char
+-------------------------
+
+
+ 1970TH 1970th 2440588th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450451st
+ 1997TH 1997th 2450451st
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450610th
+ 2001ST 2001st 2452175th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450610th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450491st
+ 1997TH 1997th 2450492nd
+ 1997TH 1997th 2450493rd
+ 1997TH 1997th 2450494th
+ 1997TH 1997th 2450495th
+ 1997TH 1997th 2450496th
+ 0097TH 0097th 1686042nd
+ 0097TH 0097th 1756536th
+ 0597TH 0597th 1939157th
+ 1097TH 1097th 2121778th
+ 1697TH 1697th 2340924th
+ 1797TH 1797th 2377448th
+ 1897TH 1897th 2413972nd
+ 1997TH 1997th 2450496th
+ 2097TH 2097th 2487021st
+ 1996TH 1996th 2450142nd
+ 1996TH 1996th 2450143rd
+ 1996TH 1996th 2450144th
+ 1996TH 1996th 2450448th
+ 1996TH 1996th 2450449th
+ 1997TH 1997th 2450450th
+ 1997TH 1997th 2450508th
+ 1997TH 1997th 2450509th
+ 1997TH 1997th 2450813th
+ 1997TH 1997th 2450814th
+ 1999TH 1999th 2451544th
+ 2000TH 2000th 2451545th
+ 2000TH 2000th 2451910th
+ 2001ST 2001st 2451911th
+(65 rows)
+
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMP_TBL;
+ to_char
+---------------------------------------------------------------------
+
+
+ 1970 A.D. 1970 a.d. 1970 ad 12:00:00 A.M. 12:00:00 a.m. 12:00:00 am
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:02 P.M. 05:32:02 p.m. 05:32:02 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 12:00:00 A.M. 12:00:00 a.m. 12:00:00 am
+ 1997 A.D. 1997 a.d. 1997 ad 03:04:05 A.M. 03:04:05 a.m. 03:04:05 am
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2001 A.D. 2001 a.d. 2001 ad 06:19:20 P.M. 06:19:20 p.m. 06:19:20 pm
+ 2000 A.D. 2000 a.d. 2000 ad 08:14:01 A.M. 08:14:01 a.m. 08:14:01 am
+ 2000 A.D. 2000 a.d. 2000 ad 01:14:02 P.M. 01:14:02 p.m. 01:14:02 pm
+ 2000 A.D. 2000 a.d. 2000 ad 12:14:03 P.M. 12:14:03 p.m. 12:14:03 pm
+ 2000 A.D. 2000 a.d. 2000 ad 03:14:04 A.M. 03:14:04 a.m. 03:14:04 am
+ 2000 A.D. 2000 a.d. 2000 ad 02:14:05 A.M. 02:14:05 a.m. 02:14:05 am
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:00 P.M. 05:32:00 p.m. 05:32:00 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 06:32:01 P.M. 06:32:01 p.m. 06:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0097 B.C. 0097 b.c. 0097 bc 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0097 A.D. 0097 a.d. 0097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0597 A.D. 0597 a.d. 0597 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1097 A.D. 1097 a.d. 1097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1697 A.D. 1697 a.d. 1697 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1797 A.D. 1797 a.d. 1797 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1897 A.D. 1897 a.d. 1897 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2097 A.D. 2097 a.d. 2097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1999 A.D. 1999 a.d. 1999 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2001 A.D. 2001 a.d. 2001 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+(65 rows)
+
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMP_TBL;
+ to_char
+------------------------
+
+
+ 1970 970 70 0 01 004 4
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 01 004 4
+ 1997 997 97 7 01 004 4
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 24 163 2
+ 2001 001 01 1 38 265 6
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 24 163 2
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 044 2
+ 1997 997 97 7 07 045 3
+ 1997 997 97 7 07 046 4
+ 1997 997 97 7 07 047 5
+ 1997 997 97 7 07 048 6
+ 1997 997 97 7 07 049 7
+ 0097 097 97 7 07 044 2
+ 0097 097 97 7 07 048 6
+ 0597 597 97 7 07 046 4
+ 1097 097 97 7 07 044 2
+ 1697 697 97 7 07 048 6
+ 1797 797 97 7 07 046 4
+ 1897 897 97 7 07 044 2
+ 1997 997 97 7 07 049 7
+ 2097 097 97 7 07 048 6
+ 1996 996 96 6 09 059 3
+ 1996 996 96 6 09 060 4
+ 1996 996 96 6 09 061 5
+ 1997 997 97 7 01 001 1
+ 1997 997 97 7 01 002 2
+ 1997 997 97 7 01 003 3
+ 1997 997 97 7 09 061 5
+ 1997 997 97 7 09 062 6
+ 1998 998 98 8 01 002 2
+ 1998 998 98 8 01 003 3
+ 1999 999 99 9 52 362 5
+ 1999 999 99 9 52 363 6
+ 2000 000 00 0 52 364 7
+ 2001 001 01 1 01 001 1
+(65 rows)
+
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMP_TBL;
+ to_char
+------------------------
+
+
+ 1970 970 70 0 1 4 4
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 1 4 4
+ 1997 997 97 7 1 4 4
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 24 163 2
+ 2001 1 1 1 38 265 6
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 24 163 2
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 44 2
+ 1997 997 97 7 7 45 3
+ 1997 997 97 7 7 46 4
+ 1997 997 97 7 7 47 5
+ 1997 997 97 7 7 48 6
+ 1997 997 97 7 7 49 7
+ 97 97 97 7 7 44 2
+ 97 97 97 7 7 48 6
+ 597 597 97 7 7 46 4
+ 1097 97 97 7 7 44 2
+ 1697 697 97 7 7 48 6
+ 1797 797 97 7 7 46 4
+ 1897 897 97 7 7 44 2
+ 1997 997 97 7 7 49 7
+ 2097 97 97 7 7 48 6
+ 1996 996 96 6 9 59 3
+ 1996 996 96 6 9 60 4
+ 1996 996 96 6 9 61 5
+ 1997 997 97 7 1 1 1
+ 1997 997 97 7 1 2 2
+ 1997 997 97 7 1 3 3
+ 1997 997 97 7 9 61 5
+ 1997 997 97 7 9 62 6
+ 1998 998 98 8 1 2 2
+ 1998 998 98 8 1 3 3
+ 1999 999 99 9 52 362 5
+ 1999 999 99 9 52 363 6
+ 2000 0 0 0 52 364 7
+ 2001 1 1 1 1 1 1
+(65 rows)
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamp),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+ to_char
+--------------------------------------------------------------------
+ 0 00 000 0000 00000 000000 0 00 000 0000 00000 000000 000 000000
+ 7 78 780 7800 78000 780000 7 78 780 7800 78000 780000 780 780000
+ 7 78 789 7890 78901 789010 7 78 789 7890 78901 789010 789 789010
+ 7 78 789 7890 78901 789012 7 78 789 7890 78901 789012 789 789012
+(4 rows)
+
+-- Roman months, with upper and lower case.
+SELECT i,
+ to_char(i * interval '1mon', 'rm'),
+ to_char(i * interval '1mon', 'RM')
+ FROM generate_series(-13, 13) i;
+ i | to_char | to_char
+-----+---------+---------
+ -13 | xii | XII
+ -12 | i | I
+ -11 | ii | II
+ -10 | iii | III
+ -9 | iv | IV
+ -8 | v | V
+ -7 | vi | VI
+ -6 | vii | VII
+ -5 | viii | VIII
+ -4 | ix | IX
+ -3 | x | X
+ -2 | xi | XI
+ -1 | xii | XII
+ 0 | |
+ 1 | i | I
+ 2 | ii | II
+ 3 | iii | III
+ 4 | iv | IV
+ 5 | v | V
+ 6 | vi | VI
+ 7 | vii | VII
+ 8 | viii | VIII
+ 9 | ix | IX
+ 10 | x | X
+ 11 | xi | XI
+ 12 | xii | XII
+ 13 | i | I
+(27 rows)
+
+-- timestamp numeric fields constructor
+SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887);
+ make_timestamp
+------------------------------
+ Sun Dec 28 06:30:45.887 2014
+(1 row)
+
+SELECT make_timestamp(-44, 3, 15, 12, 30, 15);
+ make_timestamp
+-----------------------------
+ Fri Mar 15 12:30:15 0044 BC
+(1 row)
+
+-- should fail
+select make_timestamp(0, 7, 15, 12, 30, 15);
+ERROR: date field value out of range: 0-07-15
+-- generate_series for timestamp
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '1 hour'::interval);
+ generate_series
+--------------------------
+ Wed Jan 01 00:00:00 2020
+ Wed Jan 01 01:00:00 2020
+ Wed Jan 01 02:00:00 2020
+ Wed Jan 01 03:00:00 2020
+ Wed Jan 01 04:00:00 2020
+ Wed Jan 01 05:00:00 2020
+ Wed Jan 01 06:00:00 2020
+ Wed Jan 01 07:00:00 2020
+ Wed Jan 01 08:00:00 2020
+ Wed Jan 01 09:00:00 2020
+ Wed Jan 01 10:00:00 2020
+ Wed Jan 01 11:00:00 2020
+ Wed Jan 01 12:00:00 2020
+ Wed Jan 01 13:00:00 2020
+ Wed Jan 01 14:00:00 2020
+ Wed Jan 01 15:00:00 2020
+ Wed Jan 01 16:00:00 2020
+ Wed Jan 01 17:00:00 2020
+ Wed Jan 01 18:00:00 2020
+ Wed Jan 01 19:00:00 2020
+ Wed Jan 01 20:00:00 2020
+ Wed Jan 01 21:00:00 2020
+ Wed Jan 01 22:00:00 2020
+ Wed Jan 01 23:00:00 2020
+ Thu Jan 02 00:00:00 2020
+ Thu Jan 02 01:00:00 2020
+ Thu Jan 02 02:00:00 2020
+ Thu Jan 02 03:00:00 2020
+(28 rows)
+
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamp,
+ 'infinity'::timestamp,
+ '1 month'::interval) limit 10;
+ generate_series
+--------------------------
+ Sat Jan 01 00:00:00 2022
+ Tue Feb 01 00:00:00 2022
+ Tue Mar 01 00:00:00 2022
+ Fri Apr 01 00:00:00 2022
+ Sun May 01 00:00:00 2022
+ Wed Jun 01 00:00:00 2022
+ Fri Jul 01 00:00:00 2022
+ Mon Aug 01 00:00:00 2022
+ Thu Sep 01 00:00:00 2022
+ Sat Oct 01 00:00:00 2022
+(10 rows)
+
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '0 hour'::interval);
+ERROR: step size cannot equal zero
diff --git a/yql/essentials/tests/postgresql/original/cases/timestamp.sql b/yql/essentials/tests/postgresql/original/cases/timestamp.sql
new file mode 100644
index 0000000000..ebc969f36c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timestamp.sql
@@ -0,0 +1,386 @@
+--
+-- TIMESTAMP
+--
+
+CREATE TABLE TIMESTAMP_TBL (d1 timestamp(2) without time zone);
+
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+
+BEGIN;
+
+INSERT INTO TIMESTAMP_TBL VALUES ('today');
+INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
+-- time zone should be ignored by this data type
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow EST');
+INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow zulu');
+
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'today';
+SELECT count(*) AS Three FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'tomorrow';
+SELECT count(*) AS One FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'yesterday';
+
+COMMIT;
+
+DELETE FROM TIMESTAMP_TBL;
+
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+
+BEGIN;
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+INSERT INTO TIMESTAMP_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMP_TBL;
+COMMIT;
+
+TRUNCATE TIMESTAMP_TBL;
+
+-- Special values
+INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
+
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+
+-- ISO 8601 format
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMP_TBL VALUES ('2001-09-22T18:19:20');
+
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMP_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMP_TBL VALUES ('1997.041 17:32:01 UTC');
+INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 America/New_York');
+-- this fails (even though TZ is a no-op, we still look it up)
+INSERT INTO TIMESTAMP_TBL VALUES ('19970710 173201 America/Does_not_exist');
+
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMP_TBL VALUES ('1997-06-10 18:32:01 PDT');
+
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 2097');
+
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 29 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMP_TBL VALUES ('Jan 01 17:32:01 2001');
+
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 -0097');
+INSERT INTO TIMESTAMP_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+
+SELECT d1 FROM TIMESTAMP_TBL;
+
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00 BC'::timestamp;
+SELECT '4714-11-23 23:59:59 BC'::timestamp; -- out of range
+SELECT '294276-12-31 23:59:59'::timestamp;
+SELECT '294277-01-01 00:00:00'::timestamp; -- out of range
+
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 > timestamp without time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 < timestamp without time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 = timestamp without time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 != timestamp without time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 <= timestamp without time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMP_TBL
+ WHERE d1 >= timestamp without time zone '1997-01-02';
+
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+
+SELECT date_trunc( 'week', timestamp '2004-02-29 15:44:17.71393' ) AS week_trunc;
+
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+
+-- case 1: AD dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2001-01-01') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+
+-- case 2: BC dates, origin < input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2000-01-01 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+
+-- case 3: AD dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '2020-03-02') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '2020-02-29 15:44:17.71393')) ts (ts);
+
+-- case 4: BC dates, origin > input
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts) = date_bin(interval::interval, ts, timestamp '0055-06-17 BC') AS equal
+FROM (
+ VALUES
+ ('week', '7 d'),
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamp '0055-6-10 15:44:17.71393 BC')) ts (ts);
+
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamp '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamp '2001-01-01')) origin (origin);
+
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamp '2020-02-01 01:01:01', timestamp '2020-02-01 00:02:30');
+
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+SELECT date_bin('5 years'::interval, timestamp '2020-02-01 01:01:01', timestamp '2001-01-01');
+
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp '1970-01-01 01:00:00' , timestamp '1970-01-01 00:00:00');
+
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp without time zone '1997-01-02' AS diff
+ FROM TIMESTAMP_TBL
+ WHERE d1 BETWEEN timestamp without time zone '1902-01-01'
+ AND timestamp without time zone '2038-01-01';
+
+-- DATE_PART (timestamp_part)
+SELECT d1 as "timestamp",
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMP_TBL;
+
+SELECT d1 as "timestamp",
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMP_TBL;
+
+SELECT d1 as "timestamp",
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMP_TBL;
+
+SELECT d1 as "timestamp",
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMP_TBL;
+
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMP_TBL;
+
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00'::timestamp);
+SELECT extract(epoch from '294270-01-01 00:00:00'::timestamp);
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00'::timestamp);
+
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMP_TBL;
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamp),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+
+-- Roman months, with upper and lower case.
+SELECT i,
+ to_char(i * interval '1mon', 'rm'),
+ to_char(i * interval '1mon', 'RM')
+ FROM generate_series(-13, 13) i;
+
+-- timestamp numeric fields constructor
+SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887);
+SELECT make_timestamp(-44, 3, 15, 12, 30, 15);
+-- should fail
+select make_timestamp(0, 7, 15, 12, 30, 15);
+
+-- generate_series for timestamp
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '1 hour'::interval);
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamp,
+ 'infinity'::timestamp,
+ '1 month'::interval) limit 10;
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamp,
+ '2020-01-02 03:00'::timestamp,
+ '0 hour'::interval);
diff --git a/yql/essentials/tests/postgresql/original/cases/timestamptz.out b/yql/essentials/tests/postgresql/original/cases/timestamptz.out
new file mode 100644
index 0000000000..a0df947e27
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timestamptz.out
@@ -0,0 +1,2991 @@
+--
+-- TIMESTAMPTZ
+--
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow EST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow zulu');
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'today';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'yesterday';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow EST';
+ one
+-----
+ 1
+(1 row)
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow zulu';
+ one
+-----
+ 1
+(1 row)
+
+COMMIT;
+DELETE FROM TIMESTAMPTZ_TBL;
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+ pg_sleep
+----------
+
+(1 row)
+
+SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
+ two
+-----
+ 2
+(1 row)
+
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMPTZ_TBL;
+ three | two
+-------+-----
+ 3 | 2
+(1 row)
+
+COMMIT;
+TRUNCATE TIMESTAMPTZ_TBL;
+-- Special values
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+-- timestamps at different timezones
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 America/New_York');
+SELECT '19970210 173201' AT TIME ZONE 'America/New_York';
+ timezone
+--------------------------
+ Mon Feb 10 20:32:01 1997
+(1 row)
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+SELECT '19970710 173201' AT TIME ZONE 'America/New_York';
+ timezone
+--------------------------
+ Thu Jul 10 20:32:01 1997
+(1 row)
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+ERROR: time zone "america/does_not_exist" not recognized
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America...
+ ^
+SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+ERROR: time zone "America/Does_not_exist" not recognized
+-- Daylight saving time for timestamps beyond 32-bit time_t range.
+SELECT '20500710 173201 Europe/Helsinki'::timestamptz; -- DST
+ timestamptz
+------------------------------
+ Sun Jul 10 07:32:01 2050 PDT
+(1 row)
+
+SELECT '20500110 173201 Europe/Helsinki'::timestamptz; -- non-DST
+ timestamptz
+------------------------------
+ Mon Jan 10 07:32:01 2050 PST
+(1 row)
+
+SELECT '205000-07-10 17:32:01 Europe/Helsinki'::timestamptz; -- DST
+ timestamptz
+--------------------------------
+ Thu Jul 10 07:32:01 205000 PDT
+(1 row)
+
+SELECT '205000-01-10 17:32:01 Europe/Helsinki'::timestamptz; -- non-DST
+ timestamptz
+--------------------------------
+ Fri Jan 10 07:32:01 205000 PST
+(1 row)
+
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 18:32:01 PDT');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ERROR: date/time field value out of range: "Feb 29 17:32:01 1997"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+ ^
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
+ERROR: time zone displacement out of range: "Feb 16 17:32:01 -0097"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097')...
+ ^
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+ERROR: timestamp out of range: "Feb 16 17:32:01 5097 BC"
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC...
+ ^
+-- Alternative field order that we've historically supported (sort of)
+-- with regular and POSIXy timezone specs
+SELECT 'Wed Jul 11 10:51:14 America/New_York 2001'::timestamptz;
+ timestamptz
+------------------------------
+ Wed Jul 11 07:51:14 2001 PDT
+(1 row)
+
+SELECT 'Wed Jul 11 10:51:14 GMT-4 2001'::timestamptz;
+ timestamptz
+------------------------------
+ Tue Jul 10 23:51:14 2001 PDT
+(1 row)
+
+SELECT 'Wed Jul 11 10:51:14 GMT+4 2001'::timestamptz;
+ timestamptz
+------------------------------
+ Wed Jul 11 07:51:14 2001 PDT
+(1 row)
+
+SELECT 'Wed Jul 11 10:51:14 PST-03:00 2001'::timestamptz;
+ timestamptz
+------------------------------
+ Wed Jul 11 00:51:14 2001 PDT
+(1 row)
+
+SELECT 'Wed Jul 11 10:51:14 PST+03:00 2001'::timestamptz;
+ timestamptz
+------------------------------
+ Wed Jul 11 06:51:14 2001 PDT
+(1 row)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL;
+ d1
+---------------------------------
+ -infinity
+ infinity
+ Wed Dec 31 16:00:00 1969 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:02 1997 PST
+ Mon Feb 10 17:32:01.4 1997 PST
+ Mon Feb 10 17:32:01.5 1997 PST
+ Mon Feb 10 17:32:01.6 1997 PST
+ Thu Jan 02 00:00:00 1997 PST
+ Thu Jan 02 03:04:05 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Jun 10 17:32:01 1997 PDT
+ Sat Sep 22 18:19:20 2001 PDT
+ Wed Mar 15 08:14:01 2000 PST
+ Wed Mar 15 04:14:02 2000 PST
+ Wed Mar 15 02:14:03 2000 PST
+ Wed Mar 15 03:14:04 2000 PST
+ Wed Mar 15 01:14:05 2000 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:00 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 14:32:01 1997 PST
+ Thu Jul 10 14:32:01 1997 PDT
+ Tue Jun 10 18:32:01 1997 PDT
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Feb 11 17:32:01 1997 PST
+ Wed Feb 12 17:32:01 1997 PST
+ Thu Feb 13 17:32:01 1997 PST
+ Fri Feb 14 17:32:01 1997 PST
+ Sat Feb 15 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Tue Feb 16 17:32:01 0097 PST BC
+ Sat Feb 16 17:32:01 0097 PST
+ Thu Feb 16 17:32:01 0597 PST
+ Tue Feb 16 17:32:01 1097 PST
+ Sat Feb 16 17:32:01 1697 PST
+ Thu Feb 16 17:32:01 1797 PST
+ Tue Feb 16 17:32:01 1897 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sat Feb 16 17:32:01 2097 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Wed Jan 01 17:32:01 1997 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Sat Mar 01 17:32:01 1997 PST
+ Tue Dec 30 17:32:01 1997 PST
+ Wed Dec 31 17:32:01 1997 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+(66 rows)
+
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00+00 BC'::timestamptz;
+ timestamptz
+---------------------------------
+ Sun Nov 23 16:00:00 4714 PST BC
+(1 row)
+
+SELECT '4714-11-23 16:00:00-08 BC'::timestamptz;
+ timestamptz
+---------------------------------
+ Sun Nov 23 16:00:00 4714 PST BC
+(1 row)
+
+SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
+ timestamptz
+---------------------------------
+ Sun Nov 23 16:00:00 4714 PST BC
+(1 row)
+
+SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+ERROR: timestamp out of range: "4714-11-23 23:59:59+00 BC"
+LINE 1: SELECT '4714-11-23 23:59:59+00 BC'::timestamptz;
+ ^
+SELECT '294276-12-31 23:59:59+00'::timestamptz;
+ timestamptz
+--------------------------------
+ Sun Dec 31 15:59:59 294276 PST
+(1 row)
+
+SELECT '294276-12-31 15:59:59-08'::timestamptz;
+ timestamptz
+--------------------------------
+ Sun Dec 31 15:59:59 294276 PST
+(1 row)
+
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-01-01 00:00:00+00"
+LINE 1: SELECT '294277-01-01 00:00:00+00'::timestamptz;
+ ^
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+ERROR: timestamp out of range: "294277-12-31 16:00:00-08"
+LINE 1: SELECT '294277-12-31 16:00:00-08'::timestamptz;
+ ^
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 > timestamp with time zone '1997-01-02';
+ d1
+--------------------------------
+ infinity
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:02 1997 PST
+ Mon Feb 10 17:32:01.4 1997 PST
+ Mon Feb 10 17:32:01.5 1997 PST
+ Mon Feb 10 17:32:01.6 1997 PST
+ Thu Jan 02 03:04:05 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Jun 10 17:32:01 1997 PDT
+ Sat Sep 22 18:19:20 2001 PDT
+ Wed Mar 15 08:14:01 2000 PST
+ Wed Mar 15 04:14:02 2000 PST
+ Wed Mar 15 02:14:03 2000 PST
+ Wed Mar 15 03:14:04 2000 PST
+ Wed Mar 15 01:14:05 2000 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:00 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 14:32:01 1997 PST
+ Thu Jul 10 14:32:01 1997 PDT
+ Tue Jun 10 18:32:01 1997 PDT
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Feb 11 17:32:01 1997 PST
+ Wed Feb 12 17:32:01 1997 PST
+ Thu Feb 13 17:32:01 1997 PST
+ Fri Feb 14 17:32:01 1997 PST
+ Sat Feb 15 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sat Feb 16 17:32:01 2097 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Sat Mar 01 17:32:01 1997 PST
+ Tue Dec 30 17:32:01 1997 PST
+ Wed Dec 31 17:32:01 1997 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+(50 rows)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 < timestamp with time zone '1997-01-02';
+ d1
+---------------------------------
+ -infinity
+ Wed Dec 31 16:00:00 1969 PST
+ Tue Feb 16 17:32:01 0097 PST BC
+ Sat Feb 16 17:32:01 0097 PST
+ Thu Feb 16 17:32:01 0597 PST
+ Tue Feb 16 17:32:01 1097 PST
+ Sat Feb 16 17:32:01 1697 PST
+ Thu Feb 16 17:32:01 1797 PST
+ Tue Feb 16 17:32:01 1897 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Wed Jan 01 17:32:01 1997 PST
+(15 rows)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 = timestamp with time zone '1997-01-02';
+ d1
+------------------------------
+ Thu Jan 02 00:00:00 1997 PST
+(1 row)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 != timestamp with time zone '1997-01-02';
+ d1
+---------------------------------
+ -infinity
+ infinity
+ Wed Dec 31 16:00:00 1969 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:02 1997 PST
+ Mon Feb 10 17:32:01.4 1997 PST
+ Mon Feb 10 17:32:01.5 1997 PST
+ Mon Feb 10 17:32:01.6 1997 PST
+ Thu Jan 02 03:04:05 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Jun 10 17:32:01 1997 PDT
+ Sat Sep 22 18:19:20 2001 PDT
+ Wed Mar 15 08:14:01 2000 PST
+ Wed Mar 15 04:14:02 2000 PST
+ Wed Mar 15 02:14:03 2000 PST
+ Wed Mar 15 03:14:04 2000 PST
+ Wed Mar 15 01:14:05 2000 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:00 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 14:32:01 1997 PST
+ Thu Jul 10 14:32:01 1997 PDT
+ Tue Jun 10 18:32:01 1997 PDT
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Feb 11 17:32:01 1997 PST
+ Wed Feb 12 17:32:01 1997 PST
+ Thu Feb 13 17:32:01 1997 PST
+ Fri Feb 14 17:32:01 1997 PST
+ Sat Feb 15 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Tue Feb 16 17:32:01 0097 PST BC
+ Sat Feb 16 17:32:01 0097 PST
+ Thu Feb 16 17:32:01 0597 PST
+ Tue Feb 16 17:32:01 1097 PST
+ Sat Feb 16 17:32:01 1697 PST
+ Thu Feb 16 17:32:01 1797 PST
+ Tue Feb 16 17:32:01 1897 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sat Feb 16 17:32:01 2097 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Wed Jan 01 17:32:01 1997 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Sat Mar 01 17:32:01 1997 PST
+ Tue Dec 30 17:32:01 1997 PST
+ Wed Dec 31 17:32:01 1997 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+(65 rows)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 <= timestamp with time zone '1997-01-02';
+ d1
+---------------------------------
+ -infinity
+ Wed Dec 31 16:00:00 1969 PST
+ Thu Jan 02 00:00:00 1997 PST
+ Tue Feb 16 17:32:01 0097 PST BC
+ Sat Feb 16 17:32:01 0097 PST
+ Thu Feb 16 17:32:01 0597 PST
+ Tue Feb 16 17:32:01 1097 PST
+ Sat Feb 16 17:32:01 1697 PST
+ Thu Feb 16 17:32:01 1797 PST
+ Tue Feb 16 17:32:01 1897 PST
+ Wed Feb 28 17:32:01 1996 PST
+ Thu Feb 29 17:32:01 1996 PST
+ Fri Mar 01 17:32:01 1996 PST
+ Mon Dec 30 17:32:01 1996 PST
+ Tue Dec 31 17:32:01 1996 PST
+ Wed Jan 01 17:32:01 1997 PST
+(16 rows)
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 >= timestamp with time zone '1997-01-02';
+ d1
+--------------------------------
+ infinity
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:02 1997 PST
+ Mon Feb 10 17:32:01.4 1997 PST
+ Mon Feb 10 17:32:01.5 1997 PST
+ Mon Feb 10 17:32:01.6 1997 PST
+ Thu Jan 02 00:00:00 1997 PST
+ Thu Jan 02 03:04:05 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Jun 10 17:32:01 1997 PDT
+ Sat Sep 22 18:19:20 2001 PDT
+ Wed Mar 15 08:14:01 2000 PST
+ Wed Mar 15 04:14:02 2000 PST
+ Wed Mar 15 02:14:03 2000 PST
+ Wed Mar 15 03:14:04 2000 PST
+ Wed Mar 15 01:14:05 2000 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:00 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 17:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 09:32:01 1997 PST
+ Mon Feb 10 14:32:01 1997 PST
+ Thu Jul 10 14:32:01 1997 PDT
+ Tue Jun 10 18:32:01 1997 PDT
+ Mon Feb 10 17:32:01 1997 PST
+ Tue Feb 11 17:32:01 1997 PST
+ Wed Feb 12 17:32:01 1997 PST
+ Thu Feb 13 17:32:01 1997 PST
+ Fri Feb 14 17:32:01 1997 PST
+ Sat Feb 15 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sun Feb 16 17:32:01 1997 PST
+ Sat Feb 16 17:32:01 2097 PST
+ Fri Feb 28 17:32:01 1997 PST
+ Sat Mar 01 17:32:01 1997 PST
+ Tue Dec 30 17:32:01 1997 PST
+ Wed Dec 31 17:32:01 1997 PST
+ Fri Dec 31 17:32:01 1999 PST
+ Sat Jan 01 17:32:01 2000 PST
+ Sun Dec 31 17:32:01 2000 PST
+ Mon Jan 01 17:32:01 2001 PST
+(51 rows)
+
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+ diff
+----------------------------------------
+ @ 9863 days 8 hours ago
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 2 secs
+ @ 39 days 17 hours 32 mins 1.4 secs
+ @ 39 days 17 hours 32 mins 1.5 secs
+ @ 39 days 17 hours 32 mins 1.6 secs
+ @ 0
+ @ 3 hours 4 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 16 hours 32 mins 1 sec
+ @ 1724 days 17 hours 19 mins 20 secs
+ @ 1168 days 8 hours 14 mins 1 sec
+ @ 1168 days 4 hours 14 mins 2 secs
+ @ 1168 days 2 hours 14 mins 3 secs
+ @ 1168 days 3 hours 14 mins 4 secs
+ @ 1168 days 1 hour 14 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 14 hours 32 mins 1 sec
+ @ 189 days 13 hours 32 mins 1 sec
+ @ 159 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 40 days 17 hours 32 mins 1 sec
+ @ 41 days 17 hours 32 mins 1 sec
+ @ 42 days 17 hours 32 mins 1 sec
+ @ 43 days 17 hours 32 mins 1 sec
+ @ 44 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 308 days 6 hours 27 mins 59 secs ago
+ @ 307 days 6 hours 27 mins 59 secs ago
+ @ 306 days 6 hours 27 mins 59 secs ago
+ @ 2 days 6 hours 27 mins 59 secs ago
+ @ 1 day 6 hours 27 mins 59 secs ago
+ @ 6 hours 27 mins 59 secs ago
+ @ 57 days 17 hours 32 mins 1 sec
+ @ 58 days 17 hours 32 mins 1 sec
+ @ 362 days 17 hours 32 mins 1 sec
+ @ 363 days 17 hours 32 mins 1 sec
+ @ 1093 days 17 hours 32 mins 1 sec
+ @ 1094 days 17 hours 32 mins 1 sec
+ @ 1459 days 17 hours 32 mins 1 sec
+ @ 1460 days 17 hours 32 mins 1 sec
+(56 rows)
+
+SELECT date_trunc( 'week', timestamp with time zone '2004-02-29 15:44:17.71393' ) AS week_trunc;
+ week_trunc
+------------------------------
+ Mon Feb 23 00:00:00 2004 PST
+(1 row)
+
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'Australia/Sydney') as sydney_trunc; -- zone name
+ sydney_trunc
+------------------------------
+ Fri Feb 16 05:00:00 2001 PST
+(1 row)
+
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'GMT') as gmt_trunc; -- fixed-offset abbreviation
+ gmt_trunc
+------------------------------
+ Thu Feb 15 16:00:00 2001 PST
+(1 row)
+
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'VET') as vet_trunc; -- variable-offset abbreviation
+ vet_trunc
+------------------------------
+ Thu Feb 15 20:00:00 2001 PST
+(1 row)
+
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts, 'Australia/Sydney') = date_bin(interval::interval, ts, timestamp with time zone '2001-01-01+11') AS equal
+FROM (
+ VALUES
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamptz '2020-02-29 15:44:17.71393+00')) ts (ts);
+ str | interval | equal
+-------------+----------+-------
+ day | 1 d | t
+ hour | 1 h | t
+ minute | 1 m | t
+ second | 1 s | t
+ millisecond | 1 ms | t
+ microsecond | 1 us | t
+(6 rows)
+
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamptz '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamptz '2001-01-01')) origin (origin);
+ interval | ts | origin | date_bin
+-------------------+------------------------------------+------------------------------+------------------------------------
+ 15 days | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Thu Feb 06 00:00:00 2020 PST
+ 2 hours | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 14:00:00 2020 PST
+ 1 hour 30 minutes | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 15:00:00 2020 PST
+ 15 minutes | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 15:30:00 2020 PST
+ 10 seconds | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 15:44:10 2020 PST
+ 100 milliseconds | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 15:44:17.7 2020 PST
+ 250 microseconds | Tue Feb 11 15:44:17.71393 2020 PST | Mon Jan 01 00:00:00 2001 PST | Tue Feb 11 15:44:17.71375 2020 PST
+(7 rows)
+
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamptz '2020-02-01 01:01:01+00', timestamptz '2020-02-01 00:02:30+00');
+ date_bin
+------------------------------
+ Fri Jan 31 16:57:30 2020 PST
+(1 row)
+
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ERROR: timestamps cannot be binned into intervals containing months or years
+SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+ERROR: timestamps cannot be binned into intervals containing months or years
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+ERROR: stride must be greater than zero
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+ERROR: stride must be greater than zero
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL
+ WHERE d1 BETWEEN timestamp with time zone '1902-01-01' AND timestamp with time zone '2038-01-01';
+ diff
+----------------------------------------
+ @ 9863 days 8 hours ago
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 2 secs
+ @ 39 days 17 hours 32 mins 1.4 secs
+ @ 39 days 17 hours 32 mins 1.5 secs
+ @ 39 days 17 hours 32 mins 1.6 secs
+ @ 0
+ @ 3 hours 4 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 159 days 16 hours 32 mins 1 sec
+ @ 1724 days 17 hours 19 mins 20 secs
+ @ 1168 days 8 hours 14 mins 1 sec
+ @ 1168 days 4 hours 14 mins 2 secs
+ @ 1168 days 2 hours 14 mins 3 secs
+ @ 1168 days 3 hours 14 mins 4 secs
+ @ 1168 days 1 hour 14 mins 5 secs
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 9 hours 32 mins 1 sec
+ @ 39 days 14 hours 32 mins 1 sec
+ @ 189 days 13 hours 32 mins 1 sec
+ @ 159 days 17 hours 32 mins 1 sec
+ @ 39 days 17 hours 32 mins 1 sec
+ @ 40 days 17 hours 32 mins 1 sec
+ @ 41 days 17 hours 32 mins 1 sec
+ @ 42 days 17 hours 32 mins 1 sec
+ @ 43 days 17 hours 32 mins 1 sec
+ @ 44 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 45 days 17 hours 32 mins 1 sec
+ @ 308 days 6 hours 27 mins 59 secs ago
+ @ 307 days 6 hours 27 mins 59 secs ago
+ @ 306 days 6 hours 27 mins 59 secs ago
+ @ 2 days 6 hours 27 mins 59 secs ago
+ @ 1 day 6 hours 27 mins 59 secs ago
+ @ 6 hours 27 mins 59 secs ago
+ @ 57 days 17 hours 32 mins 1 sec
+ @ 58 days 17 hours 32 mins 1 sec
+ @ 362 days 17 hours 32 mins 1 sec
+ @ 363 days 17 hours 32 mins 1 sec
+ @ 1093 days 17 hours 32 mins 1 sec
+ @ 1094 days 17 hours 32 mins 1 sec
+ @ 1459 days 17 hours 32 mins 1 sec
+ @ 1460 days 17 hours 32 mins 1 sec
+(56 rows)
+
+-- DATE_PART (timestamptz_part)
+SELECT d1 as timestamptz,
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMPTZ_TBL;
+ timestamptz | year | month | day | hour | minute | second
+---------------------------------+-----------+-------+-----+------+--------+--------
+ -infinity | -Infinity | | | | |
+ infinity | Infinity | | | | |
+ Wed Dec 31 16:00:00 1969 PST | 1969 | 12 | 31 | 16 | 0 | 0
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:02 1997 PST | 1997 | 2 | 10 | 17 | 32 | 2
+ Mon Feb 10 17:32:01.4 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.4
+ Mon Feb 10 17:32:01.5 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.5
+ Mon Feb 10 17:32:01.6 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.6
+ Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 2 | 0 | 0 | 0
+ Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 2 | 3 | 4 | 5
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Tue Jun 10 17:32:01 1997 PDT | 1997 | 6 | 10 | 17 | 32 | 1
+ Sat Sep 22 18:19:20 2001 PDT | 2001 | 9 | 22 | 18 | 19 | 20
+ Wed Mar 15 08:14:01 2000 PST | 2000 | 3 | 15 | 8 | 14 | 1
+ Wed Mar 15 04:14:02 2000 PST | 2000 | 3 | 15 | 4 | 14 | 2
+ Wed Mar 15 02:14:03 2000 PST | 2000 | 3 | 15 | 2 | 14 | 3
+ Wed Mar 15 03:14:04 2000 PST | 2000 | 3 | 15 | 3 | 14 | 4
+ Wed Mar 15 01:14:05 2000 PST | 2000 | 3 | 15 | 1 | 14 | 5
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 0
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
+ Mon Feb 10 14:32:01 1997 PST | 1997 | 2 | 10 | 14 | 32 | 1
+ Thu Jul 10 14:32:01 1997 PDT | 1997 | 7 | 10 | 14 | 32 | 1
+ Tue Jun 10 18:32:01 1997 PDT | 1997 | 6 | 10 | 18 | 32 | 1
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
+ Tue Feb 11 17:32:01 1997 PST | 1997 | 2 | 11 | 17 | 32 | 1
+ Wed Feb 12 17:32:01 1997 PST | 1997 | 2 | 12 | 17 | 32 | 1
+ Thu Feb 13 17:32:01 1997 PST | 1997 | 2 | 13 | 17 | 32 | 1
+ Fri Feb 14 17:32:01 1997 PST | 1997 | 2 | 14 | 17 | 32 | 1
+ Sat Feb 15 17:32:01 1997 PST | 1997 | 2 | 15 | 17 | 32 | 1
+ Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 0097 PST BC | -97 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 0097 PST | 97 | 2 | 16 | 17 | 32 | 1
+ Thu Feb 16 17:32:01 0597 PST | 597 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 1097 PST | 1097 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 1697 PST | 1697 | 2 | 16 | 17 | 32 | 1
+ Thu Feb 16 17:32:01 1797 PST | 1797 | 2 | 16 | 17 | 32 | 1
+ Tue Feb 16 17:32:01 1897 PST | 1897 | 2 | 16 | 17 | 32 | 1
+ Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
+ Sat Feb 16 17:32:01 2097 PST | 2097 | 2 | 16 | 17 | 32 | 1
+ Wed Feb 28 17:32:01 1996 PST | 1996 | 2 | 28 | 17 | 32 | 1
+ Thu Feb 29 17:32:01 1996 PST | 1996 | 2 | 29 | 17 | 32 | 1
+ Fri Mar 01 17:32:01 1996 PST | 1996 | 3 | 1 | 17 | 32 | 1
+ Mon Dec 30 17:32:01 1996 PST | 1996 | 12 | 30 | 17 | 32 | 1
+ Tue Dec 31 17:32:01 1996 PST | 1996 | 12 | 31 | 17 | 32 | 1
+ Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 1 | 17 | 32 | 1
+ Fri Feb 28 17:32:01 1997 PST | 1997 | 2 | 28 | 17 | 32 | 1
+ Sat Mar 01 17:32:01 1997 PST | 1997 | 3 | 1 | 17 | 32 | 1
+ Tue Dec 30 17:32:01 1997 PST | 1997 | 12 | 30 | 17 | 32 | 1
+ Wed Dec 31 17:32:01 1997 PST | 1997 | 12 | 31 | 17 | 32 | 1
+ Fri Dec 31 17:32:01 1999 PST | 1999 | 12 | 31 | 17 | 32 | 1
+ Sat Jan 01 17:32:01 2000 PST | 2000 | 1 | 1 | 17 | 32 | 1
+ Sun Dec 31 17:32:01 2000 PST | 2000 | 12 | 31 | 17 | 32 | 1
+ Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 17 | 32 | 1
+(66 rows)
+
+SELECT d1 as timestamptz,
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMPTZ_TBL;
+ timestamptz | quarter | msec | usec
+---------------------------------+---------+-------+----------
+ -infinity | | |
+ infinity | | |
+ Wed Dec 31 16:00:00 1969 PST | 4 | 0 | 0
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:02 1997 PST | 1 | 2000 | 2000000
+ Mon Feb 10 17:32:01.4 1997 PST | 1 | 1400 | 1400000
+ Mon Feb 10 17:32:01.5 1997 PST | 1 | 1500 | 1500000
+ Mon Feb 10 17:32:01.6 1997 PST | 1 | 1600 | 1600000
+ Thu Jan 02 00:00:00 1997 PST | 1 | 0 | 0
+ Thu Jan 02 03:04:05 1997 PST | 1 | 5000 | 5000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Tue Jun 10 17:32:01 1997 PDT | 2 | 1000 | 1000000
+ Sat Sep 22 18:19:20 2001 PDT | 3 | 20000 | 20000000
+ Wed Mar 15 08:14:01 2000 PST | 1 | 1000 | 1000000
+ Wed Mar 15 04:14:02 2000 PST | 1 | 2000 | 2000000
+ Wed Mar 15 02:14:03 2000 PST | 1 | 3000 | 3000000
+ Wed Mar 15 03:14:04 2000 PST | 1 | 4000 | 4000000
+ Wed Mar 15 01:14:05 2000 PST | 1 | 5000 | 5000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:00 1997 PST | 1 | 0 | 0
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
+ Mon Feb 10 14:32:01 1997 PST | 1 | 1000 | 1000000
+ Thu Jul 10 14:32:01 1997 PDT | 3 | 1000 | 1000000
+ Tue Jun 10 18:32:01 1997 PDT | 2 | 1000 | 1000000
+ Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Tue Feb 11 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Wed Feb 12 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Thu Feb 13 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Fri Feb 14 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Sat Feb 15 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 0097 PST BC | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 0097 PST | 1 | 1000 | 1000000
+ Thu Feb 16 17:32:01 0597 PST | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 1097 PST | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 1697 PST | 1 | 1000 | 1000000
+ Thu Feb 16 17:32:01 1797 PST | 1 | 1000 | 1000000
+ Tue Feb 16 17:32:01 1897 PST | 1 | 1000 | 1000000
+ Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Sat Feb 16 17:32:01 2097 PST | 1 | 1000 | 1000000
+ Wed Feb 28 17:32:01 1996 PST | 1 | 1000 | 1000000
+ Thu Feb 29 17:32:01 1996 PST | 1 | 1000 | 1000000
+ Fri Mar 01 17:32:01 1996 PST | 1 | 1000 | 1000000
+ Mon Dec 30 17:32:01 1996 PST | 4 | 1000 | 1000000
+ Tue Dec 31 17:32:01 1996 PST | 4 | 1000 | 1000000
+ Wed Jan 01 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Fri Feb 28 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Sat Mar 01 17:32:01 1997 PST | 1 | 1000 | 1000000
+ Tue Dec 30 17:32:01 1997 PST | 4 | 1000 | 1000000
+ Wed Dec 31 17:32:01 1997 PST | 4 | 1000 | 1000000
+ Fri Dec 31 17:32:01 1999 PST | 4 | 1000 | 1000000
+ Sat Jan 01 17:32:01 2000 PST | 1 | 1000 | 1000000
+ Sun Dec 31 17:32:01 2000 PST | 4 | 1000 | 1000000
+ Mon Jan 01 17:32:01 2001 PST | 1 | 1000 | 1000000
+(66 rows)
+
+SELECT d1 as timestamptz,
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMPTZ_TBL;
+ timestamptz | isoyear | week | isodow | dow | doy
+---------------------------------+-----------+------+--------+-----+-----
+ -infinity | -Infinity | | | |
+ infinity | Infinity | | | |
+ Wed Dec 31 16:00:00 1969 PST | 1970 | 1 | 3 | 3 | 365
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:02 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.4 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.5 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01.6 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 4 | 4 | 2
+ Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 4 | 4 | 2
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Tue Jun 10 17:32:01 1997 PDT | 1997 | 24 | 2 | 2 | 161
+ Sat Sep 22 18:19:20 2001 PDT | 2001 | 38 | 6 | 6 | 265
+ Wed Mar 15 08:14:01 2000 PST | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 04:14:02 2000 PST | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 02:14:03 2000 PST | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 03:14:04 2000 PST | 2000 | 11 | 3 | 3 | 75
+ Wed Mar 15 01:14:05 2000 PST | 2000 | 11 | 3 | 3 | 75
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:00 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Mon Feb 10 14:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Thu Jul 10 14:32:01 1997 PDT | 1997 | 28 | 4 | 4 | 191
+ Tue Jun 10 18:32:01 1997 PDT | 1997 | 24 | 2 | 2 | 161
+ Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
+ Tue Feb 11 17:32:01 1997 PST | 1997 | 7 | 2 | 2 | 42
+ Wed Feb 12 17:32:01 1997 PST | 1997 | 7 | 3 | 3 | 43
+ Thu Feb 13 17:32:01 1997 PST | 1997 | 7 | 4 | 4 | 44
+ Fri Feb 14 17:32:01 1997 PST | 1997 | 7 | 5 | 5 | 45
+ Sat Feb 15 17:32:01 1997 PST | 1997 | 7 | 6 | 6 | 46
+ Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 7 | 0 | 47
+ Tue Feb 16 17:32:01 0097 PST BC | -97 | 7 | 2 | 2 | 47
+ Sat Feb 16 17:32:01 0097 PST | 97 | 7 | 6 | 6 | 47
+ Thu Feb 16 17:32:01 0597 PST | 597 | 7 | 4 | 4 | 47
+ Tue Feb 16 17:32:01 1097 PST | 1097 | 7 | 2 | 2 | 47
+ Sat Feb 16 17:32:01 1697 PST | 1697 | 7 | 6 | 6 | 47
+ Thu Feb 16 17:32:01 1797 PST | 1797 | 7 | 4 | 4 | 47
+ Tue Feb 16 17:32:01 1897 PST | 1897 | 7 | 2 | 2 | 47
+ Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 7 | 0 | 47
+ Sat Feb 16 17:32:01 2097 PST | 2097 | 7 | 6 | 6 | 47
+ Wed Feb 28 17:32:01 1996 PST | 1996 | 9 | 3 | 3 | 59
+ Thu Feb 29 17:32:01 1996 PST | 1996 | 9 | 4 | 4 | 60
+ Fri Mar 01 17:32:01 1996 PST | 1996 | 9 | 5 | 5 | 61
+ Mon Dec 30 17:32:01 1996 PST | 1997 | 1 | 1 | 1 | 365
+ Tue Dec 31 17:32:01 1996 PST | 1997 | 1 | 2 | 2 | 366
+ Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 3 | 3 | 1
+ Fri Feb 28 17:32:01 1997 PST | 1997 | 9 | 5 | 5 | 59
+ Sat Mar 01 17:32:01 1997 PST | 1997 | 9 | 6 | 6 | 60
+ Tue Dec 30 17:32:01 1997 PST | 1998 | 1 | 2 | 2 | 364
+ Wed Dec 31 17:32:01 1997 PST | 1998 | 1 | 3 | 3 | 365
+ Fri Dec 31 17:32:01 1999 PST | 1999 | 52 | 5 | 5 | 365
+ Sat Jan 01 17:32:01 2000 PST | 1999 | 52 | 6 | 6 | 1
+ Sun Dec 31 17:32:01 2000 PST | 2000 | 52 | 7 | 0 | 366
+ Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 1 | 1
+(66 rows)
+
+SELECT d1 as timestamptz,
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+ timestamptz | decade | century | millennium | julian | epoch
+---------------------------------+-----------+-----------+------------+-----------+--------------
+ -infinity | -Infinity | -Infinity | -Infinity | -Infinity | -Infinity
+ infinity | Infinity | Infinity | Infinity | Infinity | Infinity
+ Wed Dec 31 16:00:00 1969 PST | 196 | 20 | 2 | 2440588 | 0
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:02 1997 PST | 199 | 20 | 2 | 2450491 | 855624722
+ Mon Feb 10 17:32:01.4 1997 PST | 199 | 20 | 2 | 2450491 | 855624721.4
+ Mon Feb 10 17:32:01.5 1997 PST | 199 | 20 | 2 | 2450491 | 855624721.5
+ Mon Feb 10 17:32:01.6 1997 PST | 199 | 20 | 2 | 2450491 | 855624721.6
+ Thu Jan 02 00:00:00 1997 PST | 199 | 20 | 2 | 2450451 | 852192000
+ Thu Jan 02 03:04:05 1997 PST | 199 | 20 | 2 | 2450451 | 852203045
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Tue Jun 10 17:32:01 1997 PDT | 199 | 20 | 2 | 2450611 | 865989121
+ Sat Sep 22 18:19:20 2001 PDT | 200 | 21 | 3 | 2452176 | 1001207960
+ Wed Mar 15 08:14:01 2000 PST | 200 | 20 | 2 | 2451619 | 953136841
+ Wed Mar 15 04:14:02 2000 PST | 200 | 20 | 2 | 2451619 | 953122442
+ Wed Mar 15 02:14:03 2000 PST | 200 | 20 | 2 | 2451619 | 953115243
+ Wed Mar 15 03:14:04 2000 PST | 200 | 20 | 2 | 2451619 | 953118844
+ Wed Mar 15 01:14:05 2000 PST | 200 | 20 | 2 | 2451619 | 953111645
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:00 1997 PST | 199 | 20 | 2 | 2450491 | 855624720
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490 | 855595921
+ Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490 | 855595921
+ Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490 | 855595921
+ Mon Feb 10 14:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855613921
+ Thu Jul 10 14:32:01 1997 PDT | 199 | 20 | 2 | 2450641 | 868570321
+ Tue Jun 10 18:32:01 1997 PDT | 199 | 20 | 2 | 2450611 | 865992721
+ Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491 | 855624721
+ Tue Feb 11 17:32:01 1997 PST | 199 | 20 | 2 | 2450492 | 855711121
+ Wed Feb 12 17:32:01 1997 PST | 199 | 20 | 2 | 2450493 | 855797521
+ Thu Feb 13 17:32:01 1997 PST | 199 | 20 | 2 | 2450494 | 855883921
+ Fri Feb 14 17:32:01 1997 PST | 199 | 20 | 2 | 2450495 | 855970321
+ Sat Feb 15 17:32:01 1997 PST | 199 | 20 | 2 | 2450496 | 856056721
+ Sun Feb 16 17:32:01 1997 PST | 199 | 20 | 2 | 2450497 | 856143121
+ Tue Feb 16 17:32:01 0097 PST BC | -10 | -1 | -1 | 1686043 | -65192682479
+ Sat Feb 16 17:32:01 0097 PST | 9 | 1 | 1 | 1756537 | -59102000879
+ Thu Feb 16 17:32:01 0597 PST | 59 | 6 | 1 | 1939158 | -43323546479
+ Tue Feb 16 17:32:01 1097 PST | 109 | 11 | 2 | 2121779 | -27545092079
+ Sat Feb 16 17:32:01 1697 PST | 169 | 17 | 2 | 2340925 | -8610877679
+ Thu Feb 16 17:32:01 1797 PST | 179 | 18 | 2 | 2377449 | -5455204079
+ Tue Feb 16 17:32:01 1897 PST | 189 | 19 | 2 | 2413973 | -2299530479
+ Sun Feb 16 17:32:01 1997 PST | 199 | 20 | 2 | 2450497 | 856143121
+ Sat Feb 16 17:32:01 2097 PST | 209 | 21 | 3 | 2487022 | 4011903121
+ Wed Feb 28 17:32:01 1996 PST | 199 | 20 | 2 | 2450143 | 825557521
+ Thu Feb 29 17:32:01 1996 PST | 199 | 20 | 2 | 2450144 | 825643921
+ Fri Mar 01 17:32:01 1996 PST | 199 | 20 | 2 | 2450145 | 825730321
+ Mon Dec 30 17:32:01 1996 PST | 199 | 20 | 2 | 2450449 | 851995921
+ Tue Dec 31 17:32:01 1996 PST | 199 | 20 | 2 | 2450450 | 852082321
+ Wed Jan 01 17:32:01 1997 PST | 199 | 20 | 2 | 2450451 | 852168721
+ Fri Feb 28 17:32:01 1997 PST | 199 | 20 | 2 | 2450509 | 857179921
+ Sat Mar 01 17:32:01 1997 PST | 199 | 20 | 2 | 2450510 | 857266321
+ Tue Dec 30 17:32:01 1997 PST | 199 | 20 | 2 | 2450814 | 883531921
+ Wed Dec 31 17:32:01 1997 PST | 199 | 20 | 2 | 2450815 | 883618321
+ Fri Dec 31 17:32:01 1999 PST | 199 | 20 | 2 | 2451545 | 946690321
+ Sat Jan 01 17:32:01 2000 PST | 200 | 20 | 2 | 2451546 | 946776721
+ Sun Dec 31 17:32:01 2000 PST | 200 | 20 | 2 | 2451911 | 978312721
+ Mon Jan 01 17:32:01 2001 PST | 200 | 21 | 3 | 2451912 | 978399121
+(66 rows)
+
+SELECT d1 as timestamptz,
+ date_part( 'timezone', d1) AS timezone,
+ date_part( 'timezone_hour', d1) AS timezone_hour,
+ date_part( 'timezone_minute', d1) AS timezone_minute
+ FROM TIMESTAMPTZ_TBL;
+ timestamptz | timezone | timezone_hour | timezone_minute
+---------------------------------+----------+---------------+-----------------
+ -infinity | | |
+ infinity | | |
+ Wed Dec 31 16:00:00 1969 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:02 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01.4 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01.5 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01.6 1997 PST | -28800 | -8 | 0
+ Thu Jan 02 00:00:00 1997 PST | -28800 | -8 | 0
+ Thu Jan 02 03:04:05 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Tue Jun 10 17:32:01 1997 PDT | -25200 | -7 | 0
+ Sat Sep 22 18:19:20 2001 PDT | -25200 | -7 | 0
+ Wed Mar 15 08:14:01 2000 PST | -28800 | -8 | 0
+ Wed Mar 15 04:14:02 2000 PST | -28800 | -8 | 0
+ Wed Mar 15 02:14:03 2000 PST | -28800 | -8 | 0
+ Wed Mar 15 03:14:04 2000 PST | -28800 | -8 | 0
+ Wed Mar 15 01:14:05 2000 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:00 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
+ Mon Feb 10 14:32:01 1997 PST | -28800 | -8 | 0
+ Thu Jul 10 14:32:01 1997 PDT | -25200 | -7 | 0
+ Tue Jun 10 18:32:01 1997 PDT | -25200 | -7 | 0
+ Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
+ Tue Feb 11 17:32:01 1997 PST | -28800 | -8 | 0
+ Wed Feb 12 17:32:01 1997 PST | -28800 | -8 | 0
+ Thu Feb 13 17:32:01 1997 PST | -28800 | -8 | 0
+ Fri Feb 14 17:32:01 1997 PST | -28800 | -8 | 0
+ Sat Feb 15 17:32:01 1997 PST | -28800 | -8 | 0
+ Sun Feb 16 17:32:01 1997 PST | -28800 | -8 | 0
+ Tue Feb 16 17:32:01 0097 PST BC | -28800 | -8 | 0
+ Sat Feb 16 17:32:01 0097 PST | -28800 | -8 | 0
+ Thu Feb 16 17:32:01 0597 PST | -28800 | -8 | 0
+ Tue Feb 16 17:32:01 1097 PST | -28800 | -8 | 0
+ Sat Feb 16 17:32:01 1697 PST | -28800 | -8 | 0
+ Thu Feb 16 17:32:01 1797 PST | -28800 | -8 | 0
+ Tue Feb 16 17:32:01 1897 PST | -28800 | -8 | 0
+ Sun Feb 16 17:32:01 1997 PST | -28800 | -8 | 0
+ Sat Feb 16 17:32:01 2097 PST | -28800 | -8 | 0
+ Wed Feb 28 17:32:01 1996 PST | -28800 | -8 | 0
+ Thu Feb 29 17:32:01 1996 PST | -28800 | -8 | 0
+ Fri Mar 01 17:32:01 1996 PST | -28800 | -8 | 0
+ Mon Dec 30 17:32:01 1996 PST | -28800 | -8 | 0
+ Tue Dec 31 17:32:01 1996 PST | -28800 | -8 | 0
+ Wed Jan 01 17:32:01 1997 PST | -28800 | -8 | 0
+ Fri Feb 28 17:32:01 1997 PST | -28800 | -8 | 0
+ Sat Mar 01 17:32:01 1997 PST | -28800 | -8 | 0
+ Tue Dec 30 17:32:01 1997 PST | -28800 | -8 | 0
+ Wed Dec 31 17:32:01 1997 PST | -28800 | -8 | 0
+ Fri Dec 31 17:32:01 1999 PST | -28800 | -8 | 0
+ Sat Jan 01 17:32:01 2000 PST | -28800 | -8 | 0
+ Sun Dec 31 17:32:01 2000 PST | -28800 | -8 | 0
+ Mon Jan 01 17:32:01 2001 PST | -28800 | -8 | 0
+(66 rows)
+
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+ timestamp | microseconds | milliseconds | seconds | julian | epoch
+---------------------------------+--------------+--------------+-----------+-----------+---------------------
+ -infinity | | | | -Infinity | -Infinity
+ infinity | | | | Infinity | Infinity
+ Wed Dec 31 16:00:00 1969 PST | 0 | 0.000 | 0.000000 | 2440588 | 0.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:02 1997 PST | 2000000 | 2000.000 | 2.000000 | 2450491 | 855624722.000000
+ Mon Feb 10 17:32:01.4 1997 PST | 1400000 | 1400.000 | 1.400000 | 2450491 | 855624721.400000
+ Mon Feb 10 17:32:01.5 1997 PST | 1500000 | 1500.000 | 1.500000 | 2450491 | 855624721.500000
+ Mon Feb 10 17:32:01.6 1997 PST | 1600000 | 1600.000 | 1.600000 | 2450491 | 855624721.600000
+ Thu Jan 02 00:00:00 1997 PST | 0 | 0.000 | 0.000000 | 2450451 | 852192000.000000
+ Thu Jan 02 03:04:05 1997 PST | 5000000 | 5000.000 | 5.000000 | 2450451 | 852203045.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Tue Jun 10 17:32:01 1997 PDT | 1000000 | 1000.000 | 1.000000 | 2450611 | 865989121.000000
+ Sat Sep 22 18:19:20 2001 PDT | 20000000 | 20000.000 | 20.000000 | 2452176 | 1001207960.000000
+ Wed Mar 15 08:14:01 2000 PST | 1000000 | 1000.000 | 1.000000 | 2451619 | 953136841.000000
+ Wed Mar 15 04:14:02 2000 PST | 2000000 | 2000.000 | 2.000000 | 2451619 | 953122442.000000
+ Wed Mar 15 02:14:03 2000 PST | 3000000 | 3000.000 | 3.000000 | 2451619 | 953115243.000000
+ Wed Mar 15 03:14:04 2000 PST | 4000000 | 4000.000 | 4.000000 | 2451619 | 953118844.000000
+ Wed Mar 15 01:14:05 2000 PST | 5000000 | 5000.000 | 5.000000 | 2451619 | 953111645.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:00 1997 PST | 0 | 0.000 | 0.000000 | 2450491 | 855624720.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Mon Feb 10 09:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450490 | 855595921.000000
+ Mon Feb 10 09:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450490 | 855595921.000000
+ Mon Feb 10 09:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450490 | 855595921.000000
+ Mon Feb 10 14:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855613921.000000
+ Thu Jul 10 14:32:01 1997 PDT | 1000000 | 1000.000 | 1.000000 | 2450641 | 868570321.000000
+ Tue Jun 10 18:32:01 1997 PDT | 1000000 | 1000.000 | 1.000000 | 2450611 | 865992721.000000
+ Mon Feb 10 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450491 | 855624721.000000
+ Tue Feb 11 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450492 | 855711121.000000
+ Wed Feb 12 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450493 | 855797521.000000
+ Thu Feb 13 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450494 | 855883921.000000
+ Fri Feb 14 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450495 | 855970321.000000
+ Sat Feb 15 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450496 | 856056721.000000
+ Sun Feb 16 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450497 | 856143121.000000
+ Tue Feb 16 17:32:01 0097 PST BC | 1000000 | 1000.000 | 1.000000 | 1686043 | -65192682479.000000
+ Sat Feb 16 17:32:01 0097 PST | 1000000 | 1000.000 | 1.000000 | 1756537 | -59102000879.000000
+ Thu Feb 16 17:32:01 0597 PST | 1000000 | 1000.000 | 1.000000 | 1939158 | -43323546479.000000
+ Tue Feb 16 17:32:01 1097 PST | 1000000 | 1000.000 | 1.000000 | 2121779 | -27545092079.000000
+ Sat Feb 16 17:32:01 1697 PST | 1000000 | 1000.000 | 1.000000 | 2340925 | -8610877679.000000
+ Thu Feb 16 17:32:01 1797 PST | 1000000 | 1000.000 | 1.000000 | 2377449 | -5455204079.000000
+ Tue Feb 16 17:32:01 1897 PST | 1000000 | 1000.000 | 1.000000 | 2413973 | -2299530479.000000
+ Sun Feb 16 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450497 | 856143121.000000
+ Sat Feb 16 17:32:01 2097 PST | 1000000 | 1000.000 | 1.000000 | 2487022 | 4011903121.000000
+ Wed Feb 28 17:32:01 1996 PST | 1000000 | 1000.000 | 1.000000 | 2450143 | 825557521.000000
+ Thu Feb 29 17:32:01 1996 PST | 1000000 | 1000.000 | 1.000000 | 2450144 | 825643921.000000
+ Fri Mar 01 17:32:01 1996 PST | 1000000 | 1000.000 | 1.000000 | 2450145 | 825730321.000000
+ Mon Dec 30 17:32:01 1996 PST | 1000000 | 1000.000 | 1.000000 | 2450449 | 851995921.000000
+ Tue Dec 31 17:32:01 1996 PST | 1000000 | 1000.000 | 1.000000 | 2450450 | 852082321.000000
+ Wed Jan 01 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450451 | 852168721.000000
+ Fri Feb 28 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450509 | 857179921.000000
+ Sat Mar 01 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450510 | 857266321.000000
+ Tue Dec 30 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450814 | 883531921.000000
+ Wed Dec 31 17:32:01 1997 PST | 1000000 | 1000.000 | 1.000000 | 2450815 | 883618321.000000
+ Fri Dec 31 17:32:01 1999 PST | 1000000 | 1000.000 | 1.000000 | 2451545 | 946690321.000000
+ Sat Jan 01 17:32:01 2000 PST | 1000000 | 1000.000 | 1.000000 | 2451546 | 946776721.000000
+ Sun Dec 31 17:32:01 2000 PST | 1000000 | 1000.000 | 1.000000 | 2451911 | 978312721.000000
+ Mon Jan 01 17:32:01 2001 PST | 1000000 | 1000.000 | 1.000000 | 2451912 | 978399121.000000
+(66 rows)
+
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
+ date_part
+---------------
+ 9224097091200
+(1 row)
+
+SELECT extract(epoch from '294270-01-01 00:00:00+00'::timestamptz);
+ extract
+----------------------
+ 9224097091200.000000
+(1 row)
+
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00+00'::timestamptz);
+ extract
+--------------------
+ 95617584000.000000
+(1 row)
+
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+------------------------------------------------------------------------------------------
+
+
+ WEDNESDAY Wednesday wednesday WED Wed wed DECEMBER December december XII DEC Dec dec
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu JANUARY January january I JAN Jan jan
+ THURSDAY Thursday thursday THU Thu thu JANUARY January january I JAN Jan jan
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue JUNE June june VI JUN Jun jun
+ SATURDAY Saturday saturday SAT Sat sat SEPTEMBER September september IX SEP Sep sep
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ WEDNESDAY Wednesday wednesday WED Wed wed MARCH March march III MAR Mar mar
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu JULY July july VII JUL Jul jul
+ TUESDAY Tuesday tuesday TUE Tue tue JUNE June june VI JUN Jun jun
+ MONDAY Monday monday MON Mon mon FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ WEDNESDAY Wednesday wednesday WED Wed wed FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ FRIDAY Friday friday FRI Fri fri FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ SUNDAY Sunday sunday SUN Sun sun FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ TUESDAY Tuesday tuesday TUE Tue tue FEBRUARY February february II FEB Feb feb
+ SUNDAY Sunday sunday SUN Sun sun FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat FEBRUARY February february II FEB Feb feb
+ WEDNESDAY Wednesday wednesday WED Wed wed FEBRUARY February february II FEB Feb feb
+ THURSDAY Thursday thursday THU Thu thu FEBRUARY February february II FEB Feb feb
+ FRIDAY Friday friday FRI Fri fri MARCH March march III MAR Mar mar
+ MONDAY Monday monday MON Mon mon DECEMBER December december XII DEC Dec dec
+ TUESDAY Tuesday tuesday TUE Tue tue DECEMBER December december XII DEC Dec dec
+ WEDNESDAY Wednesday wednesday WED Wed wed JANUARY January january I JAN Jan jan
+ FRIDAY Friday friday FRI Fri fri FEBRUARY February february II FEB Feb feb
+ SATURDAY Saturday saturday SAT Sat sat MARCH March march III MAR Mar mar
+ TUESDAY Tuesday tuesday TUE Tue tue DECEMBER December december XII DEC Dec dec
+ WEDNESDAY Wednesday wednesday WED Wed wed DECEMBER December december XII DEC Dec dec
+ FRIDAY Friday friday FRI Fri fri DECEMBER December december XII DEC Dec dec
+ SATURDAY Saturday saturday SAT Sat sat JANUARY January january I JAN Jan jan
+ SUNDAY Sunday sunday SUN Sun sun DECEMBER December december XII DEC Dec dec
+ MONDAY Monday monday MON Mon mon JANUARY January january I JAN Jan jan
+(66 rows)
+
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+--------------------------------------------------------------
+
+
+ WEDNESDAY Wednesday wednesday DECEMBER December december XII
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ THURSDAY Thursday thursday JANUARY January january I
+ THURSDAY Thursday thursday JANUARY January january I
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ TUESDAY Tuesday tuesday JUNE June june VI
+ SATURDAY Saturday saturday SEPTEMBER September september IX
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ WEDNESDAY Wednesday wednesday MARCH March march III
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ MONDAY Monday monday FEBRUARY February february II
+ THURSDAY Thursday thursday JULY July july VII
+ TUESDAY Tuesday tuesday JUNE June june VI
+ MONDAY Monday monday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ WEDNESDAY Wednesday wednesday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ FRIDAY Friday friday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ SUNDAY Sunday sunday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ TUESDAY Tuesday tuesday FEBRUARY February february II
+ SUNDAY Sunday sunday FEBRUARY February february II
+ SATURDAY Saturday saturday FEBRUARY February february II
+ WEDNESDAY Wednesday wednesday FEBRUARY February february II
+ THURSDAY Thursday thursday FEBRUARY February february II
+ FRIDAY Friday friday MARCH March march III
+ MONDAY Monday monday DECEMBER December december XII
+ TUESDAY Tuesday tuesday DECEMBER December december XII
+ WEDNESDAY Wednesday wednesday JANUARY January january I
+ FRIDAY Friday friday FEBRUARY February february II
+ SATURDAY Saturday saturday MARCH March march III
+ TUESDAY Tuesday tuesday DECEMBER December december XII
+ WEDNESDAY Wednesday wednesday DECEMBER December december XII
+ FRIDAY Friday friday DECEMBER December december XII
+ SATURDAY Saturday saturday JANUARY January january I
+ SUNDAY Sunday sunday DECEMBER December december XII
+ MONDAY Monday monday JANUARY January january I
+(66 rows)
+
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+--------------------------------------------------
+
+
+ 1,969 1969 969 69 9 20 4 12 53 365 31 4 2440587
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 01 01 002 02 5 2450451
+ 1,997 1997 997 97 7 20 1 01 01 002 02 5 2450451
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
+ 2,001 2001 001 01 1 21 3 09 38 265 22 7 2452175
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 2,000 2000 000 00 0 20 1 03 11 075 15 4 2451619
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 3 07 28 191 10 5 2450640
+ 1,997 1997 997 97 7 20 2 06 23 161 10 3 2450610
+ 1,997 1997 997 97 7 20 1 02 06 041 10 2 2450490
+ 1,997 1997 997 97 7 20 1 02 06 042 11 3 2450491
+ 1,997 1997 997 97 7 20 1 02 07 043 12 4 2450492
+ 1,997 1997 997 97 7 20 1 02 07 044 13 5 2450493
+ 1,997 1997 997 97 7 20 1 02 07 045 14 6 2450494
+ 1,997 1997 997 97 7 20 1 02 07 046 15 7 2450495
+ 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
+ 0,097 0097 097 97 7 -01 1 02 07 047 16 3 1686042
+ 0,097 0097 097 97 7 01 1 02 07 047 16 7 1756536
+ 0,597 0597 597 97 7 06 1 02 07 047 16 5 1939157
+ 1,097 1097 097 97 7 11 1 02 07 047 16 3 2121778
+ 1,697 1697 697 97 7 17 1 02 07 047 16 7 2340924
+ 1,797 1797 797 97 7 18 1 02 07 047 16 5 2377448
+ 1,897 1897 897 97 7 19 1 02 07 047 16 3 2413972
+ 1,997 1997 997 97 7 20 1 02 07 047 16 1 2450496
+ 2,097 2097 097 97 7 21 1 02 07 047 16 7 2487021
+ 1,996 1996 996 96 6 20 1 02 09 059 28 4 2450142
+ 1,996 1996 996 96 6 20 1 02 09 060 29 5 2450143
+ 1,996 1996 996 96 6 20 1 03 09 061 01 6 2450144
+ 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
+ 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
+ 1,997 1997 997 97 7 20 1 01 01 001 01 4 2450450
+ 1,997 1997 997 97 7 20 1 02 09 059 28 6 2450508
+ 1,997 1997 997 97 7 20 1 03 09 060 01 7 2450509
+ 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
+ 1,997 1997 997 97 7 20 4 12 53 365 31 4 2450814
+ 1,999 1999 999 99 9 20 4 12 53 365 31 6 2451544
+ 2,000 2000 000 00 0 20 1 01 01 001 01 7 2451545
+ 2,000 2000 000 00 0 20 4 12 53 366 31 1 2451910
+ 2,001 2001 001 01 1 21 1 01 01 001 01 2 2451911
+(66 rows)
+
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+-------------------------------------------------
+
+
+ 1,969 1969 969 69 9 20 4 12 53 365 31 4 2440587
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 1 1 2 2 5 2450451
+ 1,997 1997 997 97 7 20 1 1 1 2 2 5 2450451
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
+ 2,001 2001 1 1 1 21 3 9 38 265 22 7 2452175
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 2,000 2000 0 0 0 20 1 3 11 75 15 4 2451619
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 3 7 28 191 10 5 2450640
+ 1,997 1997 997 97 7 20 2 6 23 161 10 3 2450610
+ 1,997 1997 997 97 7 20 1 2 6 41 10 2 2450490
+ 1,997 1997 997 97 7 20 1 2 6 42 11 3 2450491
+ 1,997 1997 997 97 7 20 1 2 7 43 12 4 2450492
+ 1,997 1997 997 97 7 20 1 2 7 44 13 5 2450493
+ 1,997 1997 997 97 7 20 1 2 7 45 14 6 2450494
+ 1,997 1997 997 97 7 20 1 2 7 46 15 7 2450495
+ 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
+ 0,097 97 97 97 7 -1 1 2 7 47 16 3 1686042
+ 0,097 97 97 97 7 1 1 2 7 47 16 7 1756536
+ 0,597 597 597 97 7 6 1 2 7 47 16 5 1939157
+ 1,097 1097 97 97 7 11 1 2 7 47 16 3 2121778
+ 1,697 1697 697 97 7 17 1 2 7 47 16 7 2340924
+ 1,797 1797 797 97 7 18 1 2 7 47 16 5 2377448
+ 1,897 1897 897 97 7 19 1 2 7 47 16 3 2413972
+ 1,997 1997 997 97 7 20 1 2 7 47 16 1 2450496
+ 2,097 2097 97 97 7 21 1 2 7 47 16 7 2487021
+ 1,996 1996 996 96 6 20 1 2 9 59 28 4 2450142
+ 1,996 1996 996 96 6 20 1 2 9 60 29 5 2450143
+ 1,996 1996 996 96 6 20 1 3 9 61 1 6 2450144
+ 1,996 1996 996 96 6 20 4 12 53 365 30 2 2450448
+ 1,996 1996 996 96 6 20 4 12 53 366 31 3 2450449
+ 1,997 1997 997 97 7 20 1 1 1 1 1 4 2450450
+ 1,997 1997 997 97 7 20 1 2 9 59 28 6 2450508
+ 1,997 1997 997 97 7 20 1 3 9 60 1 7 2450509
+ 1,997 1997 997 97 7 20 4 12 52 364 30 3 2450813
+ 1,997 1997 997 97 7 20 4 12 53 365 31 4 2450814
+ 1,999 1999 999 99 9 20 4 12 53 365 31 6 2451544
+ 2,000 2000 0 0 0 20 1 1 1 1 1 7 2451545
+ 2,000 2000 0 0 0 20 4 12 53 366 31 1 2451910
+ 2,001 2001 1 1 1 21 1 1 1 1 1 2 2451911
+(66 rows)
+
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+----------------------
+
+
+ 04 04 16 00 00 57600
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 02 63122
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 12 12 00 00 00 0
+ 03 03 03 04 05 11045
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 06 06 18 19 20 65960
+ 08 08 08 14 01 29641
+ 04 04 04 14 02 15242
+ 02 02 02 14 03 8043
+ 03 03 03 14 04 11644
+ 01 01 01 14 05 4445
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 00 63120
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 09 09 09 32 01 34321
+ 09 09 09 32 01 34321
+ 09 09 09 32 01 34321
+ 02 02 14 32 01 52321
+ 02 02 14 32 01 52321
+ 06 06 18 32 01 66721
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+ 05 05 17 32 01 63121
+(66 rows)
+
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+-------------------------------------------------
+
+
+ HH:MI:SS is 04:00:00 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:02 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 12:00:00 "text between quote marks"
+ HH:MI:SS is 03:04:05 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 06:19:20 "text between quote marks"
+ HH:MI:SS is 08:14:01 "text between quote marks"
+ HH:MI:SS is 04:14:02 "text between quote marks"
+ HH:MI:SS is 02:14:03 "text between quote marks"
+ HH:MI:SS is 03:14:04 "text between quote marks"
+ HH:MI:SS is 01:14:05 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:00 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 09:32:01 "text between quote marks"
+ HH:MI:SS is 09:32:01 "text between quote marks"
+ HH:MI:SS is 09:32:01 "text between quote marks"
+ HH:MI:SS is 02:32:01 "text between quote marks"
+ HH:MI:SS is 02:32:01 "text between quote marks"
+ HH:MI:SS is 06:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+ HH:MI:SS is 05:32:01 "text between quote marks"
+(66 rows)
+
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+------------------------
+
+
+ 16--text--00--text--00
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--02
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 00--text--00--text--00
+ 03--text--04--text--05
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 18--text--19--text--20
+ 08--text--14--text--01
+ 04--text--14--text--02
+ 02--text--14--text--03
+ 03--text--14--text--04
+ 01--text--14--text--05
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--00
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 09--text--32--text--01
+ 09--text--32--text--01
+ 09--text--32--text--01
+ 14--text--32--text--01
+ 14--text--32--text--01
+ 18--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+ 17--text--32--text--01
+(66 rows)
+
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+-------------------------
+
+
+ 1969TH 1969th 2440587th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450451st
+ 1997TH 1997th 2450451st
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450610th
+ 2001ST 2001st 2452175th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 2000TH 2000th 2451619th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450640th
+ 1997TH 1997th 2450610th
+ 1997TH 1997th 2450490th
+ 1997TH 1997th 2450491st
+ 1997TH 1997th 2450492nd
+ 1997TH 1997th 2450493rd
+ 1997TH 1997th 2450494th
+ 1997TH 1997th 2450495th
+ 1997TH 1997th 2450496th
+ 0097TH 0097th 1686042nd
+ 0097TH 0097th 1756536th
+ 0597TH 0597th 1939157th
+ 1097TH 1097th 2121778th
+ 1697TH 1697th 2340924th
+ 1797TH 1797th 2377448th
+ 1897TH 1897th 2413972nd
+ 1997TH 1997th 2450496th
+ 2097TH 2097th 2487021st
+ 1996TH 1996th 2450142nd
+ 1996TH 1996th 2450143rd
+ 1996TH 1996th 2450144th
+ 1996TH 1996th 2450448th
+ 1996TH 1996th 2450449th
+ 1997TH 1997th 2450450th
+ 1997TH 1997th 2450508th
+ 1997TH 1997th 2450509th
+ 1997TH 1997th 2450813th
+ 1997TH 1997th 2450814th
+ 1999TH 1999th 2451544th
+ 2000TH 2000th 2451545th
+ 2000TH 2000th 2451910th
+ 2001ST 2001st 2451911th
+(66 rows)
+
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+---------------------------------------------------------------------
+
+
+ 1969 A.D. 1969 a.d. 1969 ad 04:00:00 P.M. 04:00:00 p.m. 04:00:00 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:02 P.M. 05:32:02 p.m. 05:32:02 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 12:00:00 A.M. 12:00:00 a.m. 12:00:00 am
+ 1997 A.D. 1997 a.d. 1997 ad 03:04:05 A.M. 03:04:05 a.m. 03:04:05 am
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2001 A.D. 2001 a.d. 2001 ad 06:19:20 P.M. 06:19:20 p.m. 06:19:20 pm
+ 2000 A.D. 2000 a.d. 2000 ad 08:14:01 A.M. 08:14:01 a.m. 08:14:01 am
+ 2000 A.D. 2000 a.d. 2000 ad 04:14:02 A.M. 04:14:02 a.m. 04:14:02 am
+ 2000 A.D. 2000 a.d. 2000 ad 02:14:03 A.M. 02:14:03 a.m. 02:14:03 am
+ 2000 A.D. 2000 a.d. 2000 ad 03:14:04 A.M. 03:14:04 a.m. 03:14:04 am
+ 2000 A.D. 2000 a.d. 2000 ad 01:14:05 A.M. 01:14:05 a.m. 01:14:05 am
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:00 P.M. 05:32:00 p.m. 05:32:00 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
+ 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
+ 1997 A.D. 1997 a.d. 1997 ad 09:32:01 A.M. 09:32:01 a.m. 09:32:01 am
+ 1997 A.D. 1997 a.d. 1997 ad 02:32:01 P.M. 02:32:01 p.m. 02:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 02:32:01 P.M. 02:32:01 p.m. 02:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 06:32:01 P.M. 06:32:01 p.m. 06:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0097 B.C. 0097 b.c. 0097 bc 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0097 A.D. 0097 a.d. 0097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 0597 A.D. 0597 a.d. 0597 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1097 A.D. 1097 a.d. 1097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1697 A.D. 1697 a.d. 1697 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1797 A.D. 1797 a.d. 1797 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1897 A.D. 1897 a.d. 1897 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2097 A.D. 2097 a.d. 2097 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1996 A.D. 1996 a.d. 1996 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1997 A.D. 1997 a.d. 1997 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 1999 A.D. 1999 a.d. 1999 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2000 A.D. 2000 a.d. 2000 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+ 2001 A.D. 2001 a.d. 2001 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm
+(66 rows)
+
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+------------------------
+
+
+ 1970 970 70 0 01 003 3
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 01 004 4
+ 1997 997 97 7 01 004 4
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 24 163 2
+ 2001 001 01 1 38 265 6
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 2000 000 00 0 11 073 3
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 28 193 4
+ 1997 997 97 7 24 163 2
+ 1997 997 97 7 07 043 1
+ 1997 997 97 7 07 044 2
+ 1997 997 97 7 07 045 3
+ 1997 997 97 7 07 046 4
+ 1997 997 97 7 07 047 5
+ 1997 997 97 7 07 048 6
+ 1997 997 97 7 07 049 7
+ 0097 097 97 7 07 044 2
+ 0097 097 97 7 07 048 6
+ 0597 597 97 7 07 046 4
+ 1097 097 97 7 07 044 2
+ 1697 697 97 7 07 048 6
+ 1797 797 97 7 07 046 4
+ 1897 897 97 7 07 044 2
+ 1997 997 97 7 07 049 7
+ 2097 097 97 7 07 048 6
+ 1996 996 96 6 09 059 3
+ 1996 996 96 6 09 060 4
+ 1996 996 96 6 09 061 5
+ 1997 997 97 7 01 001 1
+ 1997 997 97 7 01 002 2
+ 1997 997 97 7 01 003 3
+ 1997 997 97 7 09 061 5
+ 1997 997 97 7 09 062 6
+ 1998 998 98 8 01 002 2
+ 1998 998 98 8 01 003 3
+ 1999 999 99 9 52 362 5
+ 1999 999 99 9 52 363 6
+ 2000 000 00 0 52 364 7
+ 2001 001 01 1 01 001 1
+(66 rows)
+
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMPTZ_TBL;
+ to_char
+------------------------
+
+
+ 1970 970 70 0 1 3 3
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 1 4 4
+ 1997 997 97 7 1 4 4
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 24 163 2
+ 2001 1 1 1 38 265 6
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 2000 0 0 0 11 73 3
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 28 193 4
+ 1997 997 97 7 24 163 2
+ 1997 997 97 7 7 43 1
+ 1997 997 97 7 7 44 2
+ 1997 997 97 7 7 45 3
+ 1997 997 97 7 7 46 4
+ 1997 997 97 7 7 47 5
+ 1997 997 97 7 7 48 6
+ 1997 997 97 7 7 49 7
+ 97 97 97 7 7 44 2
+ 97 97 97 7 7 48 6
+ 597 597 97 7 7 46 4
+ 1097 97 97 7 7 44 2
+ 1697 697 97 7 7 48 6
+ 1797 797 97 7 7 46 4
+ 1897 897 97 7 7 44 2
+ 1997 997 97 7 7 49 7
+ 2097 97 97 7 7 48 6
+ 1996 996 96 6 9 59 3
+ 1996 996 96 6 9 60 4
+ 1996 996 96 6 9 61 5
+ 1997 997 97 7 1 1 1
+ 1997 997 97 7 1 2 2
+ 1997 997 97 7 1 3 3
+ 1997 997 97 7 9 61 5
+ 1997 997 97 7 9 62 6
+ 1998 998 98 8 1 2 2
+ 1998 998 98 8 1 3 3
+ 1999 999 99 9 52 362 5
+ 1999 999 99 9 52 363 6
+ 2000 0 0 0 52 364 7
+ 2001 1 1 1 1 1 1
+(66 rows)
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamptz),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+ to_char
+--------------------------------------------------------------------
+ 0 00 000 0000 00000 000000 0 00 000 0000 00000 000000 000 000000
+ 7 78 780 7800 78000 780000 7 78 780 7800 78000 780000 780 780000
+ 7 78 789 7890 78901 789010 7 78 789 7890 78901 789010 789 789010
+ 7 78 789 7890 78901 789012 7 78 789 7890 78901 789012 789 789012
+(4 rows)
+
+-- Check OF, TZH, TZM with various zone offsets, particularly fractional hours
+SET timezone = '00:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+-----+---------
+ +00 | +00:00
+(1 row)
+
+SET timezone = '+02:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+-----+---------
+ -02 | -02:00
+(1 row)
+
+SET timezone = '-13:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+-----+---------
+ +13 | +13:00
+(1 row)
+
+SET timezone = '-00:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ +00:30 | +00:30
+(1 row)
+
+SET timezone = '00:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ -00:30 | -00:30
+(1 row)
+
+SET timezone = '-04:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ +04:30 | +04:30
+(1 row)
+
+SET timezone = '04:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ -04:30 | -04:30
+(1 row)
+
+SET timezone = '-04:15';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ +04:15 | +04:15
+(1 row)
+
+SET timezone = '04:15';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+ OF | TZH:TZM
+--------+---------
+ -04:15 | -04:15
+(1 row)
+
+RESET timezone;
+CREATE TABLE TIMESTAMPTZ_TST (a int , b timestamptz);
+-- Test year field value with len > 4
+INSERT INTO TIMESTAMPTZ_TST VALUES(1, 'Sat Mar 12 23:58:48 1000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(2, 'Sat Mar 12 23:58:48 10000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, 'Sat Mar 12 23:58:48 100000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, '10000 Mar 12 23:58:48 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '100000312 23:58:48 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '1000000312 23:58:48 IST');
+--Verify data
+SELECT * FROM TIMESTAMPTZ_TST ORDER BY a;
+ a | b
+---+--------------------------------
+ 1 | Wed Mar 12 13:58:48 1000 PST
+ 2 | Sun Mar 12 14:58:48 10000 PDT
+ 3 | Sun Mar 12 14:58:48 100000 PDT
+ 3 | Sun Mar 12 14:58:48 10000 PDT
+ 4 | Sun Mar 12 14:58:48 10000 PDT
+ 4 | Sun Mar 12 14:58:48 100000 PDT
+(6 rows)
+
+--Cleanup
+DROP TABLE TIMESTAMPTZ_TST;
+-- test timestamptz constructors
+set TimeZone to 'America/New_York';
+-- numeric timezone
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
+ make_timestamptz
+---------------------------------
+ Sun Jul 15 08:15:55.33 1973 EDT
+(1 row)
+
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
+ make_timestamptz
+---------------------------------
+ Sun Jul 15 02:15:55.33 1973 EDT
+(1 row)
+
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
+ make_timestamptz
+---------------------------------
+ Sun Jul 15 06:15:55.33 1973 EDT
+(1 row)
+
+WITH tzs (tz) AS (VALUES
+ ('+1'), ('+1:'), ('+1:0'), ('+100'), ('+1:00'), ('+01:00'),
+ ('+10'), ('+1000'), ('+10:'), ('+10:0'), ('+10:00'), ('+10:00:'),
+ ('+10:00:1'), ('+10:00:01'),
+ ('+10:00:10'))
+ SELECT make_timestamptz(2010, 2, 27, 3, 45, 00, tz), tz FROM tzs;
+ make_timestamptz | tz
+------------------------------+-----------
+ Fri Feb 26 21:45:00 2010 EST | +1
+ Fri Feb 26 21:45:00 2010 EST | +1:
+ Fri Feb 26 21:45:00 2010 EST | +1:0
+ Fri Feb 26 21:45:00 2010 EST | +100
+ Fri Feb 26 21:45:00 2010 EST | +1:00
+ Fri Feb 26 21:45:00 2010 EST | +01:00
+ Fri Feb 26 12:45:00 2010 EST | +10
+ Fri Feb 26 12:45:00 2010 EST | +1000
+ Fri Feb 26 12:45:00 2010 EST | +10:
+ Fri Feb 26 12:45:00 2010 EST | +10:0
+ Fri Feb 26 12:45:00 2010 EST | +10:00
+ Fri Feb 26 12:45:00 2010 EST | +10:00:
+ Fri Feb 26 12:44:59 2010 EST | +10:00:1
+ Fri Feb 26 12:44:59 2010 EST | +10:00:01
+ Fri Feb 26 12:44:50 2010 EST | +10:00:10
+(15 rows)
+
+-- these should fail
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
+ERROR: invalid input syntax for type numeric time zone: "2"
+HINT: Numeric time zones must have "-" or "+" as first character.
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+ERROR: numeric time zone "+16" out of range
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+ERROR: numeric time zone "-16" out of range
+-- should be true
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
+ ?column?
+----------
+ t
+(1 row)
+
+-- full timezone names
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
+ timezone
+--------------------------
+ Tue Dec 09 23:00:00 2014
+(1 row)
+
+SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
+ timezone
+--------------------------
+ Wed Dec 09 15:56:00 1846
+(1 row)
+
+SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
+ timezone
+--------------------------
+ Fri Dec 09 23:50:39 1881
+(1 row)
+
+SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+ERROR: time zone "Nehwon/Lankhmar" not recognized
+-- abbreviations
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EST');
+ make_timestamptz
+------------------------------
+ Wed Dec 10 10:10:10 2008 EST
+(1 row)
+
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+ make_timestamptz
+------------------------------
+ Wed Dec 10 09:10:10 2008 EST
+(1 row)
+
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, 'PST8PDT');
+ make_timestamptz
+------------------------------
+ Wed Dec 10 13:10:10 2014 EST
+(1 row)
+
+RESET TimeZone;
+-- generate_series for timestamptz
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '1 hour'::interval);
+ generate_series
+------------------------------
+ Wed Jan 01 00:00:00 2020 PST
+ Wed Jan 01 01:00:00 2020 PST
+ Wed Jan 01 02:00:00 2020 PST
+ Wed Jan 01 03:00:00 2020 PST
+ Wed Jan 01 04:00:00 2020 PST
+ Wed Jan 01 05:00:00 2020 PST
+ Wed Jan 01 06:00:00 2020 PST
+ Wed Jan 01 07:00:00 2020 PST
+ Wed Jan 01 08:00:00 2020 PST
+ Wed Jan 01 09:00:00 2020 PST
+ Wed Jan 01 10:00:00 2020 PST
+ Wed Jan 01 11:00:00 2020 PST
+ Wed Jan 01 12:00:00 2020 PST
+ Wed Jan 01 13:00:00 2020 PST
+ Wed Jan 01 14:00:00 2020 PST
+ Wed Jan 01 15:00:00 2020 PST
+ Wed Jan 01 16:00:00 2020 PST
+ Wed Jan 01 17:00:00 2020 PST
+ Wed Jan 01 18:00:00 2020 PST
+ Wed Jan 01 19:00:00 2020 PST
+ Wed Jan 01 20:00:00 2020 PST
+ Wed Jan 01 21:00:00 2020 PST
+ Wed Jan 01 22:00:00 2020 PST
+ Wed Jan 01 23:00:00 2020 PST
+ Thu Jan 02 00:00:00 2020 PST
+ Thu Jan 02 01:00:00 2020 PST
+ Thu Jan 02 02:00:00 2020 PST
+ Thu Jan 02 03:00:00 2020 PST
+(28 rows)
+
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamptz,
+ 'infinity'::timestamptz,
+ '1 month'::interval) limit 10;
+ generate_series
+------------------------------
+ Sat Jan 01 00:00:00 2022 PST
+ Tue Feb 01 00:00:00 2022 PST
+ Tue Mar 01 00:00:00 2022 PST
+ Fri Apr 01 00:00:00 2022 PDT
+ Sun May 01 00:00:00 2022 PDT
+ Wed Jun 01 00:00:00 2022 PDT
+ Fri Jul 01 00:00:00 2022 PDT
+ Mon Aug 01 00:00:00 2022 PDT
+ Thu Sep 01 00:00:00 2022 PDT
+ Sat Oct 01 00:00:00 2022 PDT
+(10 rows)
+
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '0 hour'::interval);
+ERROR: step size cannot equal zero
+--
+-- Test behavior with a dynamic (time-varying) timezone abbreviation.
+-- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
+--
+SET TimeZone to 'UTC';
+SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 21:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:59:59 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:01 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:59:59 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:01 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 04:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 00:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 00:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 21:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:59:59 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:01 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:59:59 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 00:00:00 2011 UTC
+(1 row)
+
+SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 20:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 20:59:59 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 22:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 22:00:01 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 23:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 20:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 20:59:59 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 22:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 22:00:01 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
+ timestamptz
+------------------------------
+ Sat Oct 25 23:00:00 2014 UTC
+(1 row)
+
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 21:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 23:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sun Mar 27 00:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 21:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 22:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 22:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 22:59:59 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:00 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Mar 26 23:00:01 2011 UTC
+(1 row)
+
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sun Mar 27 00:00:00 2011 UTC
+(1 row)
+
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Oct 25 20:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Oct 25 20:59:59 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Oct 25 22:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Oct 25 22:00:01 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+ timezone
+------------------------------
+ Sat Oct 25 23:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Oct 25 20:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Oct 25 20:59:59 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Oct 25 22:00:00 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Oct 25 22:00:01 2014 UTC
+(1 row)
+
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
+ timezone
+------------------------------
+ Sat Oct 25 23:00:00 2014 UTC
+(1 row)
+
+SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+ make_timestamptz
+------------------------------
+ Sat Oct 25 20:00:00 2014 UTC
+(1 row)
+
+SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
+ make_timestamptz
+------------------------------
+ Sat Oct 25 22:00:00 2014 UTC
+(1 row)
+
+SELECT to_timestamp( 0); -- 1970-01-01 00:00:00+00
+ to_timestamp
+------------------------------
+ Thu Jan 01 00:00:00 1970 UTC
+(1 row)
+
+SELECT to_timestamp( 946684800); -- 2000-01-01 00:00:00+00
+ to_timestamp
+------------------------------
+ Sat Jan 01 00:00:00 2000 UTC
+(1 row)
+
+SELECT to_timestamp(1262349296.7890123); -- 2010-01-01 12:34:56.789012+00
+ to_timestamp
+-------------------------------------
+ Fri Jan 01 12:34:56.789012 2010 UTC
+(1 row)
+
+-- edge cases
+SELECT to_timestamp(-210866803200); -- 4714-11-24 00:00:00+00 BC
+ to_timestamp
+---------------------------------
+ Mon Nov 24 00:00:00 4714 UTC BC
+(1 row)
+
+-- upper limit varies between integer and float timestamps, so hard to test
+-- nonfinite values
+SELECT to_timestamp(' Infinity'::float);
+ to_timestamp
+--------------
+ infinity
+(1 row)
+
+SELECT to_timestamp('-Infinity'::float);
+ to_timestamp
+--------------
+ -infinity
+(1 row)
+
+SELECT to_timestamp('NaN'::float);
+ERROR: timestamp cannot be NaN
+SET TimeZone to 'Europe/Moscow';
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 00:00:00 2011 MSK
+(1 row)
+
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 01:00:00 2011 MSK
+(1 row)
+
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 01:59:59 2011 MSK
+(1 row)
+
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 03:00:00 2011 MSK
+(1 row)
+
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 03:00:01 2011 MSK
+(1 row)
+
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 03:59:59 2011 MSK
+(1 row)
+
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Mar 27 04:00:00 2011 MSK
+(1 row)
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Oct 26 01:00:00 2014 MSK
+(1 row)
+
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Oct 26 01:59:59 2014 MSK
+(1 row)
+
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Oct 26 01:00:00 2014 MSK
+(1 row)
+
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Oct 26 01:00:01 2014 MSK
+(1 row)
+
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
+ timestamptz
+------------------------------
+ Sun Oct 26 02:00:00 2014 MSK
+(1 row)
+
+RESET TimeZone;
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 00:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 01:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 01:59:59 2011
+(1 row)
+
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 03:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 03:00:01 2011
+(1 row)
+
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 03:59:59 2011
+(1 row)
+
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Mar 27 04:00:00 2011
+(1 row)
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:00 2014
+(1 row)
+
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Oct 26 01:59:59 2014
+(1 row)
+
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:00 2014
+(1 row)
+
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:01 2014
+(1 row)
+
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+ timezone
+--------------------------
+ Sun Oct 26 02:00:00 2014
+(1 row)
+
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 00:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 01:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 01:59:59 2011
+(1 row)
+
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 03:00:00 2011
+(1 row)
+
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 03:00:01 2011
+(1 row)
+
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 03:59:59 2011
+(1 row)
+
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Mar 27 04:00:00 2011
+(1 row)
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:00 2014
+(1 row)
+
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Oct 26 01:59:59 2014
+(1 row)
+
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:00 2014
+(1 row)
+
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Oct 26 01:00:01 2014
+(1 row)
+
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+ timezone
+--------------------------
+ Sun Oct 26 02:00:00 2014
+(1 row)
+
+--
+-- Test that AT TIME ZONE isn't misoptimized when using an index (bug #14504)
+--
+create temp table tmptz (f1 timestamptz primary key);
+insert into tmptz values ('2017-01-18 00:00+00');
+explain (costs off)
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------
+ Seq Scan on tmptz
+ Filter: ((f1 AT TIME ZONE 'utc'::text) = 'Wed Jan 18 00:00:00 2017'::timestamp without time zone)
+(2 rows)
+
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+ f1
+------------------------------
+ Tue Jan 17 16:00:00 2017 PST
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/timestamptz.sql b/yql/essentials/tests/postgresql/original/cases/timestamptz.sql
new file mode 100644
index 0000000000..bce70fb21f
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timestamptz.sql
@@ -0,0 +1,567 @@
+--
+-- TIMESTAMPTZ
+--
+
+CREATE TABLE TIMESTAMPTZ_TBL (d1 timestamp(2) with time zone);
+
+-- Test shorthand input values
+-- We can't just "select" the results since they aren't constants; test for
+-- equality instead. We can do that by running the test inside a transaction
+-- block, within which the value of 'now' shouldn't change, and so these
+-- related values shouldn't either.
+
+BEGIN;
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow EST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow zulu');
+
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'today';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'yesterday';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow EST';
+SELECT count(*) AS One FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'tomorrow zulu';
+
+COMMIT;
+
+DELETE FROM TIMESTAMPTZ_TBL;
+
+-- Verify that 'now' *does* change over a reasonable interval such as 100 msec,
+-- and that it doesn't change over the same interval within a transaction block
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+
+BEGIN;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
+SELECT pg_sleep(0.1);
+SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
+SELECT count(d1) AS three, count(DISTINCT d1) AS two FROM TIMESTAMPTZ_TBL;
+COMMIT;
+
+TRUNCATE TIMESTAMPTZ_TBL;
+
+-- Special values
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('-infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
+
+-- Postgres v6.0 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
+
+-- Variations on Postgres v6.1 standard output format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.4 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.5 1997 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.6 1997 PST');
+
+-- ISO 8601 format
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-01-02 03:04:05');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-08');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 -08:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 17:32:01 -07:00');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2001-09-22T18:19:20');
+
+-- POSIX format (note that the timezone abbrev is just decoration here)
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 08:14:01 GMT+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 13:14:02 GMT-1');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 12:14:03 GMT-2');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 03:14:04 PST+8');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('2000-03-15 02:14:05 MST+7:00');
+
+-- Variations for acceptable input formats
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997 -0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 5:32PM 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997/02/10 17:32:01-0800');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-02-10 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('02-10-1997 17:32:01 PST');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 PST');
+set datestyle to ymd;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97FEB10 5:32:01PM UTC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('97/02/10 17:32:01 UTC');
+reset datestyle;
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997.041 17:32:01 UTC');
+
+-- timestamps at different timezones
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970210 173201 America/New_York');
+SELECT '19970210 173201' AT TIME ZONE 'America/New_York';
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/New_York');
+SELECT '19970710 173201' AT TIME ZONE 'America/New_York';
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('19970710 173201 America/Does_not_exist');
+SELECT '19970710 173201' AT TIME ZONE 'America/Does_not_exist';
+
+-- Daylight saving time for timestamps beyond 32-bit time_t range.
+SELECT '20500710 173201 Europe/Helsinki'::timestamptz; -- DST
+SELECT '20500110 173201 Europe/Helsinki'::timestamptz; -- non-DST
+
+SELECT '205000-07-10 17:32:01 Europe/Helsinki'::timestamptz; -- DST
+SELECT '205000-01-10 17:32:01 Europe/Helsinki'::timestamptz; -- non-DST
+
+-- Check date conversion and date arithmetic
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('1997-06-10 18:32:01 PDT');
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 10 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 11 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 12 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 13 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 14 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 15 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097 BC');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 0597');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1697');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1797');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1897');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 2097');
+
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1996');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 28 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 29 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mar 01 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 30 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1997');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 1999');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Dec 31 17:32:01 2000');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Jan 01 17:32:01 2001');
+
+-- Currently unsupported syntax and ranges
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 -0097');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('Feb 16 17:32:01 5097 BC');
+
+-- Alternative field order that we've historically supported (sort of)
+-- with regular and POSIXy timezone specs
+SELECT 'Wed Jul 11 10:51:14 America/New_York 2001'::timestamptz;
+SELECT 'Wed Jul 11 10:51:14 GMT-4 2001'::timestamptz;
+SELECT 'Wed Jul 11 10:51:14 GMT+4 2001'::timestamptz;
+SELECT 'Wed Jul 11 10:51:14 PST-03:00 2001'::timestamptz;
+SELECT 'Wed Jul 11 10:51:14 PST+03:00 2001'::timestamptz;
+
+SELECT d1 FROM TIMESTAMPTZ_TBL;
+
+-- Check behavior at the boundaries of the timestamp range
+SELECT '4714-11-24 00:00:00+00 BC'::timestamptz;
+SELECT '4714-11-23 16:00:00-08 BC'::timestamptz;
+SELECT 'Sun Nov 23 16:00:00 4714 PST BC'::timestamptz;
+SELECT '4714-11-23 23:59:59+00 BC'::timestamptz; -- out of range
+SELECT '294276-12-31 23:59:59+00'::timestamptz;
+SELECT '294276-12-31 15:59:59-08'::timestamptz;
+SELECT '294277-01-01 00:00:00+00'::timestamptz; -- out of range
+SELECT '294277-12-31 16:00:00-08'::timestamptz; -- out of range
+
+-- Demonstrate functions and operators
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 > timestamp with time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 < timestamp with time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 = timestamp with time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 != timestamp with time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 <= timestamp with time zone '1997-01-02';
+
+SELECT d1 FROM TIMESTAMPTZ_TBL
+ WHERE d1 >= timestamp with time zone '1997-01-02';
+
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
+
+SELECT date_trunc( 'week', timestamp with time zone '2004-02-29 15:44:17.71393' ) AS week_trunc;
+
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'Australia/Sydney') as sydney_trunc; -- zone name
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'GMT') as gmt_trunc; -- fixed-offset abbreviation
+SELECT date_trunc('day', timestamp with time zone '2001-02-16 20:38:40+00', 'VET') as vet_trunc; -- variable-offset abbreviation
+
+-- verify date_bin behaves the same as date_trunc for relevant intervals
+SELECT
+ str,
+ interval,
+ date_trunc(str, ts, 'Australia/Sydney') = date_bin(interval::interval, ts, timestamp with time zone '2001-01-01+11') AS equal
+FROM (
+ VALUES
+ ('day', '1 d'),
+ ('hour', '1 h'),
+ ('minute', '1 m'),
+ ('second', '1 s'),
+ ('millisecond', '1 ms'),
+ ('microsecond', '1 us')
+) intervals (str, interval),
+(VALUES (timestamptz '2020-02-29 15:44:17.71393+00')) ts (ts);
+
+-- bin timestamps into arbitrary intervals
+SELECT
+ interval,
+ ts,
+ origin,
+ date_bin(interval::interval, ts, origin)
+FROM (
+ VALUES
+ ('15 days'),
+ ('2 hours'),
+ ('1 hour 30 minutes'),
+ ('15 minutes'),
+ ('10 seconds'),
+ ('100 milliseconds'),
+ ('250 microseconds')
+) intervals (interval),
+(VALUES (timestamptz '2020-02-11 15:44:17.71393')) ts (ts),
+(VALUES (timestamptz '2001-01-01')) origin (origin);
+
+-- shift bins using the origin parameter:
+SELECT date_bin('5 min'::interval, timestamptz '2020-02-01 01:01:01+00', timestamptz '2020-02-01 00:02:30+00');
+
+-- disallow intervals with months or years
+SELECT date_bin('5 months'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+SELECT date_bin('5 years'::interval, timestamp with time zone '2020-02-01 01:01:01+00', timestamp with time zone '2001-01-01+00');
+
+-- disallow zero intervals
+SELECT date_bin('0 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+
+-- disallow negative intervals
+SELECT date_bin('-2 days'::interval, timestamp with time zone '1970-01-01 01:00:00+00' , timestamp with time zone '1970-01-01 00:00:00+00');
+
+-- Test casting within a BETWEEN qualifier
+SELECT d1 - timestamp with time zone '1997-01-02' AS diff
+ FROM TIMESTAMPTZ_TBL
+ WHERE d1 BETWEEN timestamp with time zone '1902-01-01' AND timestamp with time zone '2038-01-01';
+
+-- DATE_PART (timestamptz_part)
+SELECT d1 as timestamptz,
+ date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
+ date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
+ date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT d1 as timestamptz,
+ date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
+ date_part( 'usec', d1) AS usec
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT d1 as timestamptz,
+ date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
+ date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
+ date_part( 'doy', d1) AS doy
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT d1 as timestamptz,
+ date_part( 'decade', d1) AS decade,
+ date_part( 'century', d1) AS century,
+ date_part( 'millennium', d1) AS millennium,
+ round(date_part( 'julian', d1)) AS julian,
+ date_part( 'epoch', d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT d1 as timestamptz,
+ date_part( 'timezone', d1) AS timezone,
+ date_part( 'timezone_hour', d1) AS timezone_hour,
+ date_part( 'timezone_minute', d1) AS timezone_minute
+ FROM TIMESTAMPTZ_TBL;
+
+-- extract implementation is mostly the same as date_part, so only
+-- test a few cases for additional coverage.
+SELECT d1 as "timestamp",
+ extract(microseconds from d1) AS microseconds,
+ extract(milliseconds from d1) AS milliseconds,
+ extract(seconds from d1) AS seconds,
+ round(extract(julian from d1)) AS julian,
+ extract(epoch from d1) AS epoch
+ FROM TIMESTAMPTZ_TBL;
+
+-- value near upper bound uses special case in code
+SELECT date_part('epoch', '294270-01-01 00:00:00+00'::timestamptz);
+SELECT extract(epoch from '294270-01-01 00:00:00+00'::timestamptz);
+-- another internal overflow test case
+SELECT extract(epoch from '5000-01-01 00:00:00+00'::timestamptz);
+
+-- TO_CHAR()
+SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'FMDAY FMDay FMday FMMONTH FMMonth FMmonth FMRM')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'Y,YYY YYYY YYY YY Y CC Q MM WW DDD DD D J')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'FMY,YYY FMYYYY FMYYY FMYY FMY FMCC FMQ FMMM FMWW FMDDD FMDD FMD FMJ')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'HH HH12 HH24 MI SS SSSS')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, E'"HH:MI:SS is" HH:MI:SS "\\"text between quote marks\\""')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'HH24--text--MI--text--SS')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'YYYYTH YYYYth Jth')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. HH:MI:SS p.m. HH:MI:SS pm')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'IYYY IYY IY I IW IDDD ID')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d1, 'FMIYYY FMIYY FMIY FMI FMIW FMIDDD FMID')
+ FROM TIMESTAMPTZ_TBL;
+
+SELECT to_char(d, 'FF1 FF2 FF3 FF4 FF5 FF6 ff1 ff2 ff3 ff4 ff5 ff6 MS US')
+ FROM (VALUES
+ ('2018-11-02 12:34:56'::timestamptz),
+ ('2018-11-02 12:34:56.78'),
+ ('2018-11-02 12:34:56.78901'),
+ ('2018-11-02 12:34:56.78901234')
+ ) d(d);
+
+-- Check OF, TZH, TZM with various zone offsets, particularly fractional hours
+SET timezone = '00:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '+02:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '-13:00';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '-00:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '00:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '-04:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '04:30';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '-04:15';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+SET timezone = '04:15';
+SELECT to_char(now(), 'OF') as "OF", to_char(now(), 'TZH:TZM') as "TZH:TZM";
+RESET timezone;
+
+CREATE TABLE TIMESTAMPTZ_TST (a int , b timestamptz);
+
+-- Test year field value with len > 4
+INSERT INTO TIMESTAMPTZ_TST VALUES(1, 'Sat Mar 12 23:58:48 1000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(2, 'Sat Mar 12 23:58:48 10000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, 'Sat Mar 12 23:58:48 100000 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(3, '10000 Mar 12 23:58:48 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '100000312 23:58:48 IST');
+INSERT INTO TIMESTAMPTZ_TST VALUES(4, '1000000312 23:58:48 IST');
+--Verify data
+SELECT * FROM TIMESTAMPTZ_TST ORDER BY a;
+--Cleanup
+DROP TABLE TIMESTAMPTZ_TST;
+
+-- test timestamptz constructors
+set TimeZone to 'America/New_York';
+
+-- numeric timezone
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
+WITH tzs (tz) AS (VALUES
+ ('+1'), ('+1:'), ('+1:0'), ('+100'), ('+1:00'), ('+01:00'),
+ ('+10'), ('+1000'), ('+10:'), ('+10:0'), ('+10:00'), ('+10:00:'),
+ ('+10:00:1'), ('+10:00:01'),
+ ('+10:00:10'))
+ SELECT make_timestamptz(2010, 2, 27, 3, 45, 00, tz), tz FROM tzs;
+
+-- these should fail
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '2');
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '+16');
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
+
+-- should be true
+SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
+
+-- full timezone names
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
+SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
+SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
+SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
+SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
+
+-- abbreviations
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EST');
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, 'PST8PDT');
+
+RESET TimeZone;
+
+-- generate_series for timestamptz
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '1 hour'::interval);
+-- the LIMIT should allow this to terminate in a reasonable amount of time
+-- (but that unfortunately doesn't work yet for SELECT * FROM ...)
+select generate_series('2022-01-01 00:00'::timestamptz,
+ 'infinity'::timestamptz,
+ '1 month'::interval) limit 10;
+-- errors
+select * from generate_series('2020-01-01 00:00'::timestamptz,
+ '2020-01-02 03:00'::timestamptz,
+ '0 hour'::interval);
+
+--
+-- Test behavior with a dynamic (time-varying) timezone abbreviation.
+-- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
+--
+
+SET TimeZone to 'UTC';
+
+SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 01:00:00 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 01:59:59 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 02:00:00 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 02:00:01 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 02:59:59 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 03:00:00 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 03:00:01 Europe/Moscow'::timestamptz;
+SELECT '2011-03-27 04:00:00 Europe/Moscow'::timestamptz;
+
+SELECT '2011-03-27 00:00:00 MSK'::timestamptz;
+SELECT '2011-03-27 01:00:00 MSK'::timestamptz;
+SELECT '2011-03-27 01:59:59 MSK'::timestamptz;
+SELECT '2011-03-27 02:00:00 MSK'::timestamptz;
+SELECT '2011-03-27 02:00:01 MSK'::timestamptz;
+SELECT '2011-03-27 02:59:59 MSK'::timestamptz;
+SELECT '2011-03-27 03:00:00 MSK'::timestamptz;
+SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
+SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
+
+SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+
+SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
+
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+
+SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 01:59:59'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 02:00:01'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 02:59:59'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 03:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
+SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
+
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
+
+SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
+
+SELECT to_timestamp( 0); -- 1970-01-01 00:00:00+00
+SELECT to_timestamp( 946684800); -- 2000-01-01 00:00:00+00
+SELECT to_timestamp(1262349296.7890123); -- 2010-01-01 12:34:56.789012+00
+-- edge cases
+SELECT to_timestamp(-210866803200); -- 4714-11-24 00:00:00+00 BC
+-- upper limit varies between integer and float timestamps, so hard to test
+-- nonfinite values
+SELECT to_timestamp(' Infinity'::float);
+SELECT to_timestamp('-Infinity'::float);
+SELECT to_timestamp('NaN'::float);
+
+
+SET TimeZone to 'Europe/Moscow';
+
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz;
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz;
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz;
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz;
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz;
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
+
+RESET TimeZone;
+
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+
+SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-26 22:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-26 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-26 23:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+
+--
+-- Test that AT TIME ZONE isn't misoptimized when using an index (bug #14504)
+--
+create temp table tmptz (f1 timestamptz primary key);
+insert into tmptz values ('2017-01-18 00:00+00');
+explain (costs off)
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
+select * from tmptz where f1 at time zone 'utc' = '2017-01-18 00:00';
diff --git a/yql/essentials/tests/postgresql/original/cases/timetz.out b/yql/essentials/tests/postgresql/original/cases/timetz.out
new file mode 100644
index 0000000000..f4960c0166
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timetz.out
@@ -0,0 +1,233 @@
+--
+-- TIMETZ
+--
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 America/New_York');
+ERROR: invalid input syntax for type time with time zone: "15:36:39 America/New_York"
+LINE 1: INSERT INTO TIMETZ_TBL VALUES ('15:36:39 America/New_York');
+ ^
+-- this should fail (timezone not specified without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+ERROR: invalid input syntax for type time with time zone: "15:36:39 m2"
+LINE 1: INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+ ^
+-- this should fail (dynamic timezone abbreviation without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+ERROR: invalid input syntax for type time with time zone: "15:36:39 MSK m2"
+LINE 1: INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+ ^
+SELECT f1 AS "Time TZ" FROM TIMETZ_TBL;
+ Time TZ
+----------------
+ 00:01:00-07
+ 01:00:00-07
+ 02:03:00-07
+ 07:07:00-08
+ 08:08:00-04
+ 11:59:00-07
+ 12:00:00-07
+ 12:01:00-07
+ 23:59:00-07
+ 23:59:59.99-07
+ 15:36:39-05
+ 15:36:39-04
+(12 rows)
+
+SELECT f1 AS "Three" FROM TIMETZ_TBL WHERE f1 < '05:06:07-07';
+ Three
+-------------
+ 00:01:00-07
+ 01:00:00-07
+ 02:03:00-07
+(3 rows)
+
+SELECT f1 AS "Seven" FROM TIMETZ_TBL WHERE f1 > '05:06:07-07';
+ Seven
+----------------
+ 07:07:00-08
+ 08:08:00-04
+ 11:59:00-07
+ 12:00:00-07
+ 12:01:00-07
+ 23:59:00-07
+ 23:59:59.99-07
+ 15:36:39-05
+ 15:36:39-04
+(9 rows)
+
+SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
+ None
+------
+(0 rows)
+
+SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
+ Ten
+----------------
+ 00:01:00-07
+ 01:00:00-07
+ 02:03:00-07
+ 07:07:00-08
+ 08:08:00-04
+ 11:59:00-07
+ 12:00:00-07
+ 12:01:00-07
+ 23:59:00-07
+ 23:59:59.99-07
+ 15:36:39-05
+ 15:36:39-04
+(12 rows)
+
+-- Check edge cases
+SELECT '23:59:59.999999 PDT'::timetz;
+ timetz
+--------------------
+ 23:59:59.999999-07
+(1 row)
+
+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
+ timetz
+-------------
+ 24:00:00-07
+(1 row)
+
+SELECT '23:59:60 PDT'::timetz; -- rounds up
+ timetz
+-------------
+ 24:00:00-07
+(1 row)
+
+SELECT '24:00:00 PDT'::timetz; -- allowed
+ timetz
+-------------
+ 24:00:00-07
+(1 row)
+
+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
+ERROR: date/time field value out of range: "24:00:00.01 PDT"
+LINE 1: SELECT '24:00:00.01 PDT'::timetz;
+ ^
+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
+ERROR: date/time field value out of range: "23:59:60.01 PDT"
+LINE 1: SELECT '23:59:60.01 PDT'::timetz;
+ ^
+SELECT '24:01:00 PDT'::timetz; -- not allowed
+ERROR: date/time field value out of range: "24:01:00 PDT"
+LINE 1: SELECT '24:01:00 PDT'::timetz;
+ ^
+SELECT '25:00:00 PDT'::timetz; -- not allowed
+ERROR: date/time field value out of range: "25:00:00 PDT"
+LINE 1: SELECT '25:00:00 PDT'::timetz;
+ ^
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
+ERROR: operator does not exist: time with time zone + time with time zone
+LINE 1: SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TI...
+ ^
+HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+----------
+ 25575401
+(1 row)
+
+SELECT EXTRACT(MILLISECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+-----------
+ 25575.401
+(1 row)
+
+SELECT EXTRACT(SECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+-----------
+ 25.575401
+(1 row)
+
+SELECT EXTRACT(MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+---------
+ 30
+(1 row)
+
+SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+---------
+ 13
+(1 row)
+
+SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ERROR: "time with time zone" units "day" not recognized
+SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+ERROR: "time with time zone" units "fortnight" not recognized
+SELECT EXTRACT(TIMEZONE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -16200
+(1 row)
+
+SELECT EXTRACT(TIMEZONE_HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -4
+(1 row)
+
+SELECT EXTRACT(TIMEZONE_MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+ extract
+---------
+ -30
+(1 row)
+
+SELECT EXTRACT(EPOCH FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ extract
+--------------
+ 63025.575401
+(1 row)
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25575401
+(1 row)
+
+SELECT date_part('millisecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25575.401
+(1 row)
+
+SELECT date_part('second', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+-----------
+ 25.575401
+(1 row)
+
+SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+ date_part
+--------------
+ 63025.575401
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/timetz.sql b/yql/essentials/tests/postgresql/original/cases/timetz.sql
new file mode 100644
index 0000000000..7b70f4656c
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/timetz.sql
@@ -0,0 +1,79 @@
+--
+-- TIMETZ
+--
+
+CREATE TABLE TIMETZ_TBL (f1 time(2) with time zone);
+
+INSERT INTO TIMETZ_TBL VALUES ('00:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('01:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('02:03 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('07:07 PST');
+INSERT INTO TIMETZ_TBL VALUES ('08:08 EDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:00 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('12:01 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('23:59 PDT');
+INSERT INTO TIMETZ_TBL VALUES ('11:59:59.99 PM PDT');
+
+INSERT INTO TIMETZ_TBL VALUES ('2003-03-07 15:36:39 America/New_York');
+INSERT INTO TIMETZ_TBL VALUES ('2003-07-07 15:36:39 America/New_York');
+-- this should fail (the timezone offset is not known)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 America/New_York');
+-- this should fail (timezone not specified without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 m2');
+-- this should fail (dynamic timezone abbreviation without a date)
+INSERT INTO TIMETZ_TBL VALUES ('15:36:39 MSK m2');
+
+
+SELECT f1 AS "Time TZ" FROM TIMETZ_TBL;
+
+SELECT f1 AS "Three" FROM TIMETZ_TBL WHERE f1 < '05:06:07-07';
+
+SELECT f1 AS "Seven" FROM TIMETZ_TBL WHERE f1 > '05:06:07-07';
+
+SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
+
+SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
+
+-- Check edge cases
+SELECT '23:59:59.999999 PDT'::timetz;
+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
+SELECT '23:59:60 PDT'::timetz; -- rounds up
+SELECT '24:00:00 PDT'::timetz; -- allowed
+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
+SELECT '24:01:00 PDT'::timetz; -- not allowed
+SELECT '25:00:00 PDT'::timetz; -- not allowed
+
+--
+-- TIME simple math
+--
+-- We now make a distinction between time and intervals,
+-- and adding two times together makes no sense at all.
+-- Leave in one query to show that it is rejected,
+-- and do the rest of the testing in horology.sql
+-- where we do mixed-type arithmetic. - thomas 2000-12-02
+
+SELECT f1 + time with time zone '00:01' AS "Illegal" FROM TIMETZ_TBL;
+
+--
+-- test EXTRACT
+--
+SELECT EXTRACT(MICROSECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(MILLISECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(SECOND FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT EXTRACT(DAY FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+SELECT EXTRACT(FORTNIGHT FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04'); -- error
+SELECT EXTRACT(TIMEZONE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(TIMEZONE_HOUR FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(TIMEZONE_MINUTE FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04:30');
+SELECT EXTRACT(EPOCH FROM TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+
+-- date_part implementation is mostly the same as extract, so only
+-- test a few cases for additional coverage.
+SELECT date_part('microsecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('millisecond', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('second', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
+SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
diff --git a/yql/essentials/tests/postgresql/original/cases/truncate.out b/yql/essentials/tests/postgresql/original/cases/truncate.out
new file mode 100644
index 0000000000..1e88e867bf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/truncate.out
@@ -0,0 +1,594 @@
+-- Test basic TRUNCATE functionality.
+CREATE TABLE truncate_a (col1 integer primary key);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO truncate_a VALUES (2);
+SELECT * FROM truncate_a;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+-- Roll truncate back
+BEGIN;
+TRUNCATE truncate_a;
+ROLLBACK;
+SELECT * FROM truncate_a;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+-- Commit the truncate this time
+BEGIN;
+TRUNCATE truncate_a;
+COMMIT;
+SELECT * FROM truncate_a;
+ col1
+------
+(0 rows)
+
+-- Test foreign-key checks
+CREATE TABLE trunc_b (a int REFERENCES truncate_a);
+CREATE TABLE trunc_c (a serial PRIMARY KEY);
+CREATE TABLE trunc_d (a int REFERENCES trunc_c);
+CREATE TABLE trunc_e (a int REFERENCES truncate_a, b int REFERENCES trunc_c);
+TRUNCATE TABLE truncate_a; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_b" references "truncate_a".
+HINT: Truncate table "trunc_b" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE truncate_a,trunc_b; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_e" references "truncate_a".
+HINT: Truncate table "trunc_e" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE truncate_a,trunc_b,trunc_e; -- ok
+TRUNCATE TABLE truncate_a,trunc_e; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_b" references "truncate_a".
+HINT: Truncate table "trunc_b" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_d" references "trunc_c".
+HINT: Truncate table "trunc_d" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,trunc_d; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_e" references "trunc_c".
+HINT: Truncate table "trunc_e" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e; -- ok
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_b" references "truncate_a".
+HINT: Truncate table "trunc_b" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a,trunc_b; -- ok
+TRUNCATE TABLE truncate_a RESTRICT; -- fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_b" references "truncate_a".
+HINT: Truncate table "trunc_b" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE truncate_a CASCADE; -- ok
+NOTICE: truncate cascades to table "trunc_b"
+NOTICE: truncate cascades to table "trunc_e"
+-- circular references
+ALTER TABLE truncate_a ADD FOREIGN KEY (col1) REFERENCES trunc_c;
+-- Add some data to verify that truncating actually works ...
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO trunc_b VALUES (1);
+INSERT INTO trunc_d VALUES (1);
+INSERT INTO trunc_e VALUES (1,1);
+TRUNCATE TABLE trunc_c;
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "truncate_a" references "trunc_c".
+HINT: Truncate table "truncate_a" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,truncate_a;
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_d" references "trunc_c".
+HINT: Truncate table "trunc_d" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d;
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_e" references "trunc_c".
+HINT: Truncate table "trunc_e" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "trunc_b" references "truncate_a".
+HINT: Truncate table "trunc_b" at the same time, or use TRUNCATE ... CASCADE.
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
+-- Verify that truncating did actually work
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+ col1
+------
+(0 rows)
+
+SELECT * FROM trunc_e;
+ a | b
+---+---
+(0 rows)
+
+-- Add data again to test TRUNCATE ... CASCADE
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO trunc_b VALUES (1);
+INSERT INTO trunc_d VALUES (1);
+INSERT INTO trunc_e VALUES (1,1);
+TRUNCATE TABLE trunc_c CASCADE; -- ok
+NOTICE: truncate cascades to table "truncate_a"
+NOTICE: truncate cascades to table "trunc_d"
+NOTICE: truncate cascades to table "trunc_e"
+NOTICE: truncate cascades to table "trunc_b"
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+ col1
+------
+(0 rows)
+
+SELECT * FROM trunc_e;
+ a | b
+---+---
+(0 rows)
+
+DROP TABLE truncate_a,trunc_c,trunc_b,trunc_d,trunc_e CASCADE;
+-- Test TRUNCATE with inheritance
+CREATE TABLE trunc_f (col1 integer primary key);
+INSERT INTO trunc_f VALUES (1);
+INSERT INTO trunc_f VALUES (2);
+CREATE TABLE trunc_fa (col2a text) INHERITS (trunc_f);
+INSERT INTO trunc_fa VALUES (3, 'three');
+CREATE TABLE trunc_fb (col2b int) INHERITS (trunc_f);
+INSERT INTO trunc_fb VALUES (4, 444);
+CREATE TABLE trunc_faa (col3 text) INHERITS (trunc_fa);
+INSERT INTO trunc_faa VALUES (5, 'five', 'FIVE');
+BEGIN;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+ 3
+ 4
+ 5
+(5 rows)
+
+TRUNCATE trunc_f;
+SELECT * FROM trunc_f;
+ col1
+------
+(0 rows)
+
+ROLLBACK;
+BEGIN;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+ 3
+ 4
+ 5
+(5 rows)
+
+TRUNCATE ONLY trunc_f;
+SELECT * FROM trunc_f;
+ col1
+------
+ 3
+ 4
+ 5
+(3 rows)
+
+ROLLBACK;
+BEGIN;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+ 3
+ 4
+ 5
+(5 rows)
+
+SELECT * FROM trunc_fa;
+ col1 | col2a
+------+-------
+ 3 | three
+ 5 | five
+(2 rows)
+
+SELECT * FROM trunc_faa;
+ col1 | col2a | col3
+------+-------+------
+ 5 | five | FIVE
+(1 row)
+
+TRUNCATE ONLY trunc_fb, ONLY trunc_fa;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+ 5
+(3 rows)
+
+SELECT * FROM trunc_fa;
+ col1 | col2a
+------+-------
+ 5 | five
+(1 row)
+
+SELECT * FROM trunc_faa;
+ col1 | col2a | col3
+------+-------+------
+ 5 | five | FIVE
+(1 row)
+
+ROLLBACK;
+BEGIN;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+ 3
+ 4
+ 5
+(5 rows)
+
+SELECT * FROM trunc_fa;
+ col1 | col2a
+------+-------
+ 3 | three
+ 5 | five
+(2 rows)
+
+SELECT * FROM trunc_faa;
+ col1 | col2a | col3
+------+-------+------
+ 5 | five | FIVE
+(1 row)
+
+TRUNCATE ONLY trunc_fb, trunc_fa;
+SELECT * FROM trunc_f;
+ col1
+------
+ 1
+ 2
+(2 rows)
+
+SELECT * FROM trunc_fa;
+ col1 | col2a
+------+-------
+(0 rows)
+
+SELECT * FROM trunc_faa;
+ col1 | col2a | col3
+------+-------+------
+(0 rows)
+
+ROLLBACK;
+DROP TABLE trunc_f CASCADE;
+NOTICE: drop cascades to 3 other objects
+DETAIL: drop cascades to table trunc_fa
+drop cascades to table trunc_faa
+drop cascades to table trunc_fb
+-- Test ON TRUNCATE triggers
+CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text);
+CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text,
+ tgargv text, tgtable name, rowcount bigint);
+CREATE FUNCTION trunctrigger() RETURNS trigger as $$
+declare c bigint;
+begin
+ execute 'select count(*) from ' || quote_ident(tg_table_name) into c;
+ insert into trunc_trigger_log values
+ (TG_OP, TG_LEVEL, TG_WHEN, TG_ARGV[0], tg_table_name, c);
+ return null;
+end;
+$$ LANGUAGE plpgsql;
+-- basic before trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+CREATE TRIGGER t
+BEFORE TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('before trigger truncate');
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+ Row count in test table
+-------------------------
+ 2
+(1 row)
+
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+------+---------+--------+--------+---------+----------
+(0 rows)
+
+TRUNCATE trunc_trigger_test;
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+ Row count in test table
+-------------------------
+ 0
+(1 row)
+
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+----------+-----------+--------+-------------------------+--------------------+----------
+ TRUNCATE | STATEMENT | BEFORE | before trigger truncate | trunc_trigger_test | 2
+(1 row)
+
+DROP TRIGGER t ON trunc_trigger_test;
+truncate trunc_trigger_log;
+-- same test with an after trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+CREATE TRIGGER tt
+AFTER TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('after trigger truncate');
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+ Row count in test table
+-------------------------
+ 2
+(1 row)
+
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+------+---------+--------+--------+---------+----------
+(0 rows)
+
+TRUNCATE trunc_trigger_test;
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+ Row count in test table
+-------------------------
+ 0
+(1 row)
+
+SELECT * FROM trunc_trigger_log;
+ tgop | tglevel | tgwhen | tgargv | tgtable | rowcount
+----------+-----------+--------+------------------------+--------------------+----------
+ TRUNCATE | STATEMENT | AFTER | after trigger truncate | trunc_trigger_test | 0
+(1 row)
+
+DROP TABLE trunc_trigger_test;
+DROP TABLE trunc_trigger_log;
+DROP FUNCTION trunctrigger();
+-- test TRUNCATE ... RESTART IDENTITY
+CREATE SEQUENCE truncate_a_id1 START WITH 33;
+CREATE TABLE truncate_a (id serial,
+ id1 integer default nextval('truncate_a_id1'));
+ALTER SEQUENCE truncate_a_id1 OWNED BY truncate_a.id1;
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ id | id1
+----+-----
+ 1 | 33
+ 2 | 34
+(2 rows)
+
+TRUNCATE truncate_a;
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ id | id1
+----+-----
+ 3 | 35
+ 4 | 36
+(2 rows)
+
+TRUNCATE truncate_a RESTART IDENTITY;
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ id | id1
+----+-----
+ 1 | 33
+ 2 | 34
+(2 rows)
+
+CREATE TABLE truncate_b (id int GENERATED ALWAYS AS IDENTITY (START WITH 44));
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+ id
+----
+ 44
+ 45
+(2 rows)
+
+TRUNCATE truncate_b;
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+ id
+----
+ 46
+ 47
+(2 rows)
+
+TRUNCATE truncate_b RESTART IDENTITY;
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+ id
+----
+ 44
+ 45
+(2 rows)
+
+-- check rollback of a RESTART IDENTITY operation
+BEGIN;
+TRUNCATE truncate_a RESTART IDENTITY;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ id | id1
+----+-----
+ 1 | 33
+(1 row)
+
+ROLLBACK;
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ id | id1
+----+-----
+ 1 | 33
+ 2 | 34
+ 3 | 35
+ 4 | 36
+(4 rows)
+
+DROP TABLE truncate_a;
+SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+ERROR: relation "truncate_a_id1" does not exist
+LINE 1: SELECT nextval('truncate_a_id1');
+ ^
+-- partitioned table
+CREATE TABLE truncparted (a int, b char) PARTITION BY LIST (a);
+-- error, can't truncate a partitioned table
+TRUNCATE ONLY truncparted;
+ERROR: cannot truncate only a partitioned table
+HINT: Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
+CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1);
+INSERT INTO truncparted VALUES (1, 'a');
+-- error, must truncate partitions
+TRUNCATE ONLY truncparted;
+ERROR: cannot truncate only a partitioned table
+HINT: Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
+TRUNCATE truncparted;
+DROP TABLE truncparted;
+-- foreign key on partitioned table: partition key is referencing column.
+-- Make sure truncate did execute on all tables
+CREATE FUNCTION tp_ins_data() RETURNS void LANGUAGE plpgsql AS $$
+ BEGIN
+ INSERT INTO truncprim VALUES (1), (100), (150);
+ INSERT INTO truncpart VALUES (1), (100), (150);
+ END
+$$;
+CREATE FUNCTION tp_chk_data(OUT pktb regclass, OUT pkval int, OUT fktb regclass, OUT fkval int)
+ RETURNS SETOF record LANGUAGE plpgsql AS $$
+ BEGIN
+ RETURN QUERY SELECT
+ pk.tableoid::regclass, pk.a, fk.tableoid::regclass, fk.a
+ FROM truncprim pk FULL JOIN truncpart fk USING (a)
+ ORDER BY 2, 4;
+ END
+$$;
+CREATE TABLE truncprim (a int PRIMARY KEY);
+CREATE TABLE truncpart (a int REFERENCES truncprim)
+ PARTITION BY RANGE (a);
+CREATE TABLE truncpart_1 PARTITION OF truncpart FOR VALUES FROM (0) TO (100);
+CREATE TABLE truncpart_2 PARTITION OF truncpart FOR VALUES FROM (100) TO (200)
+ PARTITION BY RANGE (a);
+CREATE TABLE truncpart_2_1 PARTITION OF truncpart_2 FOR VALUES FROM (100) TO (150);
+CREATE TABLE truncpart_2_d PARTITION OF truncpart_2 DEFAULT;
+TRUNCATE TABLE truncprim; -- should fail
+ERROR: cannot truncate a table referenced in a foreign key constraint
+DETAIL: Table "truncpart" references "truncprim".
+HINT: Truncate table "truncpart" at the same time, or use TRUNCATE ... CASCADE.
+select tp_ins_data();
+ tp_ins_data
+-------------
+
+(1 row)
+
+-- should truncate everything
+TRUNCATE TABLE truncprim, truncpart;
+select * from tp_chk_data();
+ pktb | pkval | fktb | fkval
+------+-------+------+-------
+(0 rows)
+
+select tp_ins_data();
+ tp_ins_data
+-------------
+
+(1 row)
+
+-- should truncate everything
+TRUNCATE TABLE truncprim CASCADE;
+NOTICE: truncate cascades to table "truncpart"
+NOTICE: truncate cascades to table "truncpart_1"
+NOTICE: truncate cascades to table "truncpart_2"
+NOTICE: truncate cascades to table "truncpart_2_1"
+NOTICE: truncate cascades to table "truncpart_2_d"
+SELECT * FROM tp_chk_data();
+ pktb | pkval | fktb | fkval
+------+-------+------+-------
+(0 rows)
+
+SELECT tp_ins_data();
+ tp_ins_data
+-------------
+
+(1 row)
+
+-- should truncate all partitions
+TRUNCATE TABLE truncpart;
+SELECT * FROM tp_chk_data();
+ pktb | pkval | fktb | fkval
+-----------+-------+------+-------
+ truncprim | 1 | |
+ truncprim | 100 | |
+ truncprim | 150 | |
+(3 rows)
+
+DROP TABLE truncprim, truncpart;
+DROP FUNCTION tp_ins_data(), tp_chk_data();
+-- test cascade when referencing a partitioned table
+CREATE TABLE trunc_a (a INT PRIMARY KEY) PARTITION BY RANGE (a);
+CREATE TABLE trunc_a1 PARTITION OF trunc_a FOR VALUES FROM (0) TO (10);
+CREATE TABLE trunc_a2 PARTITION OF trunc_a FOR VALUES FROM (10) TO (20)
+ PARTITION BY RANGE (a);
+CREATE TABLE trunc_a21 PARTITION OF trunc_a2 FOR VALUES FROM (10) TO (12);
+CREATE TABLE trunc_a22 PARTITION OF trunc_a2 FOR VALUES FROM (12) TO (16);
+CREATE TABLE trunc_a2d PARTITION OF trunc_a2 DEFAULT;
+CREATE TABLE trunc_a3 PARTITION OF trunc_a FOR VALUES FROM (20) TO (30);
+INSERT INTO trunc_a VALUES (0), (5), (10), (15), (20), (25);
+-- truncate a partition cascading to a table
+CREATE TABLE ref_b (
+ b INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+);
+INSERT INTO ref_b VALUES (10, 0), (50, 5), (100, 10), (150, 15);
+TRUNCATE TABLE trunc_a1 CASCADE;
+NOTICE: truncate cascades to table "ref_b"
+SELECT a FROM ref_b;
+ a
+---
+(0 rows)
+
+DROP TABLE ref_b;
+-- truncate a partition cascading to a partitioned table
+CREATE TABLE ref_c (
+ c INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+) PARTITION BY RANGE (c);
+CREATE TABLE ref_c1 PARTITION OF ref_c FOR VALUES FROM (100) TO (200);
+CREATE TABLE ref_c2 PARTITION OF ref_c FOR VALUES FROM (200) TO (300);
+INSERT INTO ref_c VALUES (100, 10), (150, 15), (200, 20), (250, 25);
+TRUNCATE TABLE trunc_a21 CASCADE;
+NOTICE: truncate cascades to table "ref_c"
+NOTICE: truncate cascades to table "ref_c1"
+NOTICE: truncate cascades to table "ref_c2"
+SELECT a as "from table ref_c" FROM ref_c;
+ from table ref_c
+------------------
+(0 rows)
+
+SELECT a as "from table trunc_a" FROM trunc_a ORDER BY a;
+ from table trunc_a
+--------------------
+ 15
+ 20
+ 25
+(3 rows)
+
+DROP TABLE trunc_a, ref_c;
diff --git a/yql/essentials/tests/postgresql/original/cases/truncate.sql b/yql/essentials/tests/postgresql/original/cases/truncate.sql
new file mode 100644
index 0000000000..54f26e3077
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/truncate.sql
@@ -0,0 +1,329 @@
+-- Test basic TRUNCATE functionality.
+CREATE TABLE truncate_a (col1 integer primary key);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO truncate_a VALUES (2);
+SELECT * FROM truncate_a;
+-- Roll truncate back
+BEGIN;
+TRUNCATE truncate_a;
+ROLLBACK;
+SELECT * FROM truncate_a;
+-- Commit the truncate this time
+BEGIN;
+TRUNCATE truncate_a;
+COMMIT;
+SELECT * FROM truncate_a;
+
+-- Test foreign-key checks
+CREATE TABLE trunc_b (a int REFERENCES truncate_a);
+CREATE TABLE trunc_c (a serial PRIMARY KEY);
+CREATE TABLE trunc_d (a int REFERENCES trunc_c);
+CREATE TABLE trunc_e (a int REFERENCES truncate_a, b int REFERENCES trunc_c);
+
+TRUNCATE TABLE truncate_a; -- fail
+TRUNCATE TABLE truncate_a,trunc_b; -- fail
+TRUNCATE TABLE truncate_a,trunc_b,trunc_e; -- ok
+TRUNCATE TABLE truncate_a,trunc_e; -- fail
+TRUNCATE TABLE trunc_c; -- fail
+TRUNCATE TABLE trunc_c,trunc_d; -- fail
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e; -- ok
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a; -- fail
+TRUNCATE TABLE trunc_c,trunc_d,trunc_e,truncate_a,trunc_b; -- ok
+
+TRUNCATE TABLE truncate_a RESTRICT; -- fail
+TRUNCATE TABLE truncate_a CASCADE; -- ok
+
+-- circular references
+ALTER TABLE truncate_a ADD FOREIGN KEY (col1) REFERENCES trunc_c;
+
+-- Add some data to verify that truncating actually works ...
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO trunc_b VALUES (1);
+INSERT INTO trunc_d VALUES (1);
+INSERT INTO trunc_e VALUES (1,1);
+TRUNCATE TABLE trunc_c;
+TRUNCATE TABLE trunc_c,truncate_a;
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d;
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
+TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
+
+-- Verify that truncating did actually work
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+SELECT * FROM trunc_e;
+
+-- Add data again to test TRUNCATE ... CASCADE
+INSERT INTO trunc_c VALUES (1);
+INSERT INTO truncate_a VALUES (1);
+INSERT INTO trunc_b VALUES (1);
+INSERT INTO trunc_d VALUES (1);
+INSERT INTO trunc_e VALUES (1,1);
+
+TRUNCATE TABLE trunc_c CASCADE; -- ok
+
+SELECT * FROM truncate_a
+ UNION ALL
+ SELECT * FROM trunc_c
+ UNION ALL
+ SELECT * FROM trunc_b
+ UNION ALL
+ SELECT * FROM trunc_d;
+SELECT * FROM trunc_e;
+
+DROP TABLE truncate_a,trunc_c,trunc_b,trunc_d,trunc_e CASCADE;
+
+-- Test TRUNCATE with inheritance
+
+CREATE TABLE trunc_f (col1 integer primary key);
+INSERT INTO trunc_f VALUES (1);
+INSERT INTO trunc_f VALUES (2);
+
+CREATE TABLE trunc_fa (col2a text) INHERITS (trunc_f);
+INSERT INTO trunc_fa VALUES (3, 'three');
+
+CREATE TABLE trunc_fb (col2b int) INHERITS (trunc_f);
+INSERT INTO trunc_fb VALUES (4, 444);
+
+CREATE TABLE trunc_faa (col3 text) INHERITS (trunc_fa);
+INSERT INTO trunc_faa VALUES (5, 'five', 'FIVE');
+
+BEGIN;
+SELECT * FROM trunc_f;
+TRUNCATE trunc_f;
+SELECT * FROM trunc_f;
+ROLLBACK;
+
+BEGIN;
+SELECT * FROM trunc_f;
+TRUNCATE ONLY trunc_f;
+SELECT * FROM trunc_f;
+ROLLBACK;
+
+BEGIN;
+SELECT * FROM trunc_f;
+SELECT * FROM trunc_fa;
+SELECT * FROM trunc_faa;
+TRUNCATE ONLY trunc_fb, ONLY trunc_fa;
+SELECT * FROM trunc_f;
+SELECT * FROM trunc_fa;
+SELECT * FROM trunc_faa;
+ROLLBACK;
+
+BEGIN;
+SELECT * FROM trunc_f;
+SELECT * FROM trunc_fa;
+SELECT * FROM trunc_faa;
+TRUNCATE ONLY trunc_fb, trunc_fa;
+SELECT * FROM trunc_f;
+SELECT * FROM trunc_fa;
+SELECT * FROM trunc_faa;
+ROLLBACK;
+
+DROP TABLE trunc_f CASCADE;
+
+-- Test ON TRUNCATE triggers
+
+CREATE TABLE trunc_trigger_test (f1 int, f2 text, f3 text);
+CREATE TABLE trunc_trigger_log (tgop text, tglevel text, tgwhen text,
+ tgargv text, tgtable name, rowcount bigint);
+
+CREATE FUNCTION trunctrigger() RETURNS trigger as $$
+declare c bigint;
+begin
+ execute 'select count(*) from ' || quote_ident(tg_table_name) into c;
+ insert into trunc_trigger_log values
+ (TG_OP, TG_LEVEL, TG_WHEN, TG_ARGV[0], tg_table_name, c);
+ return null;
+end;
+$$ LANGUAGE plpgsql;
+
+-- basic before trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+
+CREATE TRIGGER t
+BEFORE TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('before trigger truncate');
+
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+SELECT * FROM trunc_trigger_log;
+TRUNCATE trunc_trigger_test;
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+SELECT * FROM trunc_trigger_log;
+
+DROP TRIGGER t ON trunc_trigger_test;
+
+truncate trunc_trigger_log;
+
+-- same test with an after trigger
+INSERT INTO trunc_trigger_test VALUES(1, 'foo', 'bar'), (2, 'baz', 'quux');
+
+CREATE TRIGGER tt
+AFTER TRUNCATE ON trunc_trigger_test
+FOR EACH STATEMENT
+EXECUTE PROCEDURE trunctrigger('after trigger truncate');
+
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+SELECT * FROM trunc_trigger_log;
+TRUNCATE trunc_trigger_test;
+SELECT count(*) as "Row count in test table" FROM trunc_trigger_test;
+SELECT * FROM trunc_trigger_log;
+
+DROP TABLE trunc_trigger_test;
+DROP TABLE trunc_trigger_log;
+
+DROP FUNCTION trunctrigger();
+
+-- test TRUNCATE ... RESTART IDENTITY
+CREATE SEQUENCE truncate_a_id1 START WITH 33;
+CREATE TABLE truncate_a (id serial,
+ id1 integer default nextval('truncate_a_id1'));
+ALTER SEQUENCE truncate_a_id1 OWNED BY truncate_a.id1;
+
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+
+TRUNCATE truncate_a;
+
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+
+TRUNCATE truncate_a RESTART IDENTITY;
+
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+
+CREATE TABLE truncate_b (id int GENERATED ALWAYS AS IDENTITY (START WITH 44));
+
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+
+TRUNCATE truncate_b;
+
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+
+TRUNCATE truncate_b RESTART IDENTITY;
+
+INSERT INTO truncate_b DEFAULT VALUES;
+INSERT INTO truncate_b DEFAULT VALUES;
+SELECT * FROM truncate_b;
+
+-- check rollback of a RESTART IDENTITY operation
+BEGIN;
+TRUNCATE truncate_a RESTART IDENTITY;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+ROLLBACK;
+INSERT INTO truncate_a DEFAULT VALUES;
+INSERT INTO truncate_a DEFAULT VALUES;
+SELECT * FROM truncate_a;
+
+DROP TABLE truncate_a;
+
+SELECT nextval('truncate_a_id1'); -- fail, seq should have been dropped
+
+-- partitioned table
+CREATE TABLE truncparted (a int, b char) PARTITION BY LIST (a);
+-- error, can't truncate a partitioned table
+TRUNCATE ONLY truncparted;
+CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1);
+INSERT INTO truncparted VALUES (1, 'a');
+-- error, must truncate partitions
+TRUNCATE ONLY truncparted;
+TRUNCATE truncparted;
+DROP TABLE truncparted;
+
+-- foreign key on partitioned table: partition key is referencing column.
+-- Make sure truncate did execute on all tables
+CREATE FUNCTION tp_ins_data() RETURNS void LANGUAGE plpgsql AS $$
+ BEGIN
+ INSERT INTO truncprim VALUES (1), (100), (150);
+ INSERT INTO truncpart VALUES (1), (100), (150);
+ END
+$$;
+CREATE FUNCTION tp_chk_data(OUT pktb regclass, OUT pkval int, OUT fktb regclass, OUT fkval int)
+ RETURNS SETOF record LANGUAGE plpgsql AS $$
+ BEGIN
+ RETURN QUERY SELECT
+ pk.tableoid::regclass, pk.a, fk.tableoid::regclass, fk.a
+ FROM truncprim pk FULL JOIN truncpart fk USING (a)
+ ORDER BY 2, 4;
+ END
+$$;
+CREATE TABLE truncprim (a int PRIMARY KEY);
+CREATE TABLE truncpart (a int REFERENCES truncprim)
+ PARTITION BY RANGE (a);
+CREATE TABLE truncpart_1 PARTITION OF truncpart FOR VALUES FROM (0) TO (100);
+CREATE TABLE truncpart_2 PARTITION OF truncpart FOR VALUES FROM (100) TO (200)
+ PARTITION BY RANGE (a);
+CREATE TABLE truncpart_2_1 PARTITION OF truncpart_2 FOR VALUES FROM (100) TO (150);
+CREATE TABLE truncpart_2_d PARTITION OF truncpart_2 DEFAULT;
+
+TRUNCATE TABLE truncprim; -- should fail
+
+select tp_ins_data();
+-- should truncate everything
+TRUNCATE TABLE truncprim, truncpart;
+select * from tp_chk_data();
+
+select tp_ins_data();
+-- should truncate everything
+TRUNCATE TABLE truncprim CASCADE;
+SELECT * FROM tp_chk_data();
+
+SELECT tp_ins_data();
+-- should truncate all partitions
+TRUNCATE TABLE truncpart;
+SELECT * FROM tp_chk_data();
+DROP TABLE truncprim, truncpart;
+DROP FUNCTION tp_ins_data(), tp_chk_data();
+
+-- test cascade when referencing a partitioned table
+CREATE TABLE trunc_a (a INT PRIMARY KEY) PARTITION BY RANGE (a);
+CREATE TABLE trunc_a1 PARTITION OF trunc_a FOR VALUES FROM (0) TO (10);
+CREATE TABLE trunc_a2 PARTITION OF trunc_a FOR VALUES FROM (10) TO (20)
+ PARTITION BY RANGE (a);
+CREATE TABLE trunc_a21 PARTITION OF trunc_a2 FOR VALUES FROM (10) TO (12);
+CREATE TABLE trunc_a22 PARTITION OF trunc_a2 FOR VALUES FROM (12) TO (16);
+CREATE TABLE trunc_a2d PARTITION OF trunc_a2 DEFAULT;
+CREATE TABLE trunc_a3 PARTITION OF trunc_a FOR VALUES FROM (20) TO (30);
+INSERT INTO trunc_a VALUES (0), (5), (10), (15), (20), (25);
+
+-- truncate a partition cascading to a table
+CREATE TABLE ref_b (
+ b INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+);
+INSERT INTO ref_b VALUES (10, 0), (50, 5), (100, 10), (150, 15);
+
+TRUNCATE TABLE trunc_a1 CASCADE;
+SELECT a FROM ref_b;
+
+DROP TABLE ref_b;
+
+-- truncate a partition cascading to a partitioned table
+CREATE TABLE ref_c (
+ c INT PRIMARY KEY,
+ a INT REFERENCES trunc_a(a) ON DELETE CASCADE
+) PARTITION BY RANGE (c);
+CREATE TABLE ref_c1 PARTITION OF ref_c FOR VALUES FROM (100) TO (200);
+CREATE TABLE ref_c2 PARTITION OF ref_c FOR VALUES FROM (200) TO (300);
+INSERT INTO ref_c VALUES (100, 10), (150, 15), (200, 20), (250, 25);
+
+TRUNCATE TABLE trunc_a21 CASCADE;
+SELECT a as "from table ref_c" FROM ref_c;
+SELECT a as "from table trunc_a" FROM trunc_a ORDER BY a;
+
+DROP TABLE trunc_a, ref_c;
diff --git a/yql/essentials/tests/postgresql/original/cases/unicode.out b/yql/essentials/tests/postgresql/original/cases/unicode.out
new file mode 100644
index 0000000000..f2713a2326
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/unicode.out
@@ -0,0 +1,89 @@
+SELECT getdatabaseencoding() <> 'UTF8' AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+ sanity_check
+--------------
+ t
+(1 row)
+
+SELECT normalize('');
+ normalize
+-----------
+
+(1 row)
+
+SELECT normalize(U&'\0061\0308\24D1c') = U&'\00E4\24D1c' COLLATE "C" AS test_default;
+ test_default
+--------------
+ t
+(1 row)
+
+SELECT normalize(U&'\0061\0308\24D1c', NFC) = U&'\00E4\24D1c' COLLATE "C" AS test_nfc;
+ test_nfc
+----------
+ t
+(1 row)
+
+SELECT normalize(U&'\00E4bc', NFC) = U&'\00E4bc' COLLATE "C" AS test_nfc_idem;
+ test_nfc_idem
+---------------
+ t
+(1 row)
+
+SELECT normalize(U&'\00E4\24D1c', NFD) = U&'\0061\0308\24D1c' COLLATE "C" AS test_nfd;
+ test_nfd
+----------
+ t
+(1 row)
+
+SELECT normalize(U&'\0061\0308\24D1c', NFKC) = U&'\00E4bc' COLLATE "C" AS test_nfkc;
+ test_nfkc
+-----------
+ t
+(1 row)
+
+SELECT normalize(U&'\00E4\24D1c', NFKD) = U&'\0061\0308bc' COLLATE "C" AS test_nfkd;
+ test_nfkd
+-----------
+ t
+(1 row)
+
+SELECT "normalize"('abc', 'def'); -- run-time error
+ERROR: invalid normalization form: def
+SELECT U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+ test_default
+--------------
+ t
+(1 row)
+
+SELECT U&'\00E4\24D1c' IS NFC NORMALIZED AS test_nfc;
+ test_nfc
+----------
+ t
+(1 row)
+
+SELECT num, val,
+ val IS NFC NORMALIZED AS NFC,
+ val IS NFD NORMALIZED AS NFD,
+ val IS NFKC NORMALIZED AS NFKC,
+ val IS NFKD NORMALIZED AS NFKD
+FROM
+ (VALUES (1, U&'\00E4bc'),
+ (2, U&'\0061\0308bc'),
+ (3, U&'\00E4\24D1c'),
+ (4, U&'\0061\0308\24D1c'),
+ (5, '')) vals (num, val)
+ORDER BY num;
+ num | val | nfc | nfd | nfkc | nfkd
+-----+-----+-----+-----+------+------
+ 1 | äbc | t | f | t | f
+ 2 | äbc | f | t | f | t
+ 3 | äⓑc | t | f | f | f
+ 4 | äⓑc | f | t | f | f
+ 5 | | t | t | t | t
+(5 rows)
+
+SELECT is_normalized('abc', 'def'); -- run-time error
+ERROR: invalid normalization form: def
diff --git a/yql/essentials/tests/postgresql/original/cases/unicode.sql b/yql/essentials/tests/postgresql/original/cases/unicode.sql
new file mode 100644
index 0000000000..63cd523f85
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/unicode.sql
@@ -0,0 +1,34 @@
+SELECT getdatabaseencoding() <> 'UTF8' AS skip_test \gset
+\if :skip_test
+\quit
+\endif
+
+SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+
+SELECT normalize('');
+SELECT normalize(U&'\0061\0308\24D1c') = U&'\00E4\24D1c' COLLATE "C" AS test_default;
+SELECT normalize(U&'\0061\0308\24D1c', NFC) = U&'\00E4\24D1c' COLLATE "C" AS test_nfc;
+SELECT normalize(U&'\00E4bc', NFC) = U&'\00E4bc' COLLATE "C" AS test_nfc_idem;
+SELECT normalize(U&'\00E4\24D1c', NFD) = U&'\0061\0308\24D1c' COLLATE "C" AS test_nfd;
+SELECT normalize(U&'\0061\0308\24D1c', NFKC) = U&'\00E4bc' COLLATE "C" AS test_nfkc;
+SELECT normalize(U&'\00E4\24D1c', NFKD) = U&'\0061\0308bc' COLLATE "C" AS test_nfkd;
+
+SELECT "normalize"('abc', 'def'); -- run-time error
+
+SELECT U&'\00E4\24D1c' IS NORMALIZED AS test_default;
+SELECT U&'\00E4\24D1c' IS NFC NORMALIZED AS test_nfc;
+
+SELECT num, val,
+ val IS NFC NORMALIZED AS NFC,
+ val IS NFD NORMALIZED AS NFD,
+ val IS NFKC NORMALIZED AS NFKC,
+ val IS NFKD NORMALIZED AS NFKD
+FROM
+ (VALUES (1, U&'\00E4bc'),
+ (2, U&'\0061\0308bc'),
+ (3, U&'\00E4\24D1c'),
+ (4, U&'\0061\0308\24D1c'),
+ (5, '')) vals (num, val)
+ORDER BY num;
+
+SELECT is_normalized('abc', 'def'); -- run-time error
diff --git a/yql/essentials/tests/postgresql/original/cases/union.out b/yql/essentials/tests/postgresql/original/cases/union.out
new file mode 100644
index 0000000000..dece7310cf
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/union.out
@@ -0,0 +1,1434 @@
+--
+-- UNION (also INTERSECT, EXCEPT)
+--
+-- Simple UNION constructs
+SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1 AS two UNION ALL SELECT 2;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS two UNION ALL SELECT 1;
+ two
+-----
+ 1
+ 1
+(2 rows)
+
+SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+ three
+-------
+ 1
+ 2
+ 3
+(3 rows)
+
+SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1
+ 2
+(2 rows)
+
+SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+ three
+-------
+ 1
+ 2
+ 2
+(3 rows)
+
+SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2.2
+(2 rows)
+
+-- Mixed types
+SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
+ two
+-----
+ 1
+ 2.2
+(2 rows)
+
+SELECT 1 AS one UNION SELECT 1.0::float8 ORDER BY 1;
+ one
+-----
+ 1
+(1 row)
+
+SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1.0::float8 AS two UNION ALL SELECT 1 ORDER BY 1;
+ two
+-----
+ 1
+ 1
+(2 rows)
+
+SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+ three
+-------
+ 1.1
+ 2
+ 3
+(3 rows)
+
+SELECT 1.1::float8 AS two UNION SELECT 2 UNION SELECT 2.0::float8 ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+ three
+-------
+ 1.1
+ 2
+ 2
+(3 rows)
+
+SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
+ two
+-----
+ 1.1
+ 2
+(2 rows)
+
+--
+-- Try testing from tables...
+--
+SELECT f1 AS five FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM FLOAT8_TBL
+ORDER BY 1;
+ five
+-----------------------
+ -1.2345678901234e+200
+ -1004.3
+ -34.84
+ -1.2345678901234e-200
+ 0
+(5 rows)
+
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM FLOAT8_TBL;
+ ten
+-----------------------
+ 0
+ -34.84
+ -1004.3
+ -1.2345678901234e+200
+ -1.2345678901234e-200
+ 0
+ -34.84
+ -1004.3
+ -1.2345678901234e+200
+ -1.2345678901234e-200
+(10 rows)
+
+SELECT f1 AS nine FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM INT4_TBL
+ORDER BY 1;
+ nine
+-----------------------
+ -1.2345678901234e+200
+ -2147483647
+ -123456
+ -1004.3
+ -34.84
+ -1.2345678901234e-200
+ 0
+ 123456
+ 2147483647
+(9 rows)
+
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM INT4_TBL;
+ ten
+-----------------------
+ 0
+ -34.84
+ -1004.3
+ -1.2345678901234e+200
+ -1.2345678901234e-200
+ 0
+ 123456
+ -123456
+ 2147483647
+ -2147483647
+(10 rows)
+
+SELECT f1 AS five FROM FLOAT8_TBL
+ WHERE f1 BETWEEN -1e6 AND 1e6
+UNION
+SELECT f1 FROM INT4_TBL
+ WHERE f1 BETWEEN 0 AND 1000000
+ORDER BY 1;
+ five
+-----------------------
+ -1004.3
+ -34.84
+ -1.2345678901234e-200
+ 0
+ 123456
+(5 rows)
+
+SELECT CAST(f1 AS char(4)) AS three FROM VARCHAR_TBL
+UNION
+SELECT f1 FROM CHAR_TBL
+ORDER BY 1;
+ three
+-------
+ a
+ ab
+ abcd
+(3 rows)
+
+SELECT f1 AS three FROM VARCHAR_TBL
+UNION
+SELECT CAST(f1 AS varchar) FROM CHAR_TBL
+ORDER BY 1;
+ three
+-------
+ a
+ ab
+ abcd
+(3 rows)
+
+SELECT f1 AS eight FROM VARCHAR_TBL
+UNION ALL
+SELECT f1 FROM CHAR_TBL;
+ eight
+-------
+ a
+ ab
+ abcd
+ abcd
+ a
+ ab
+ abcd
+ abcd
+(8 rows)
+
+SELECT f1 AS five FROM TEXT_TBL
+UNION
+SELECT f1 FROM VARCHAR_TBL
+UNION
+SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
+ORDER BY 1;
+ five
+-------------------
+ a
+ ab
+ abcd
+ doh!
+ hi de ho neighbor
+(5 rows)
+
+--
+-- INTERSECT and EXCEPT
+--
+SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+------------------
+ 123
+ 4567890123456789
+ 4567890123456789
+(3 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
+ q2
+-------------------
+ -4567890123456789
+ 456
+ 4567890123456789
+(3 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY 1;
+ q1
+----
+(0 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+ 4567890123456789
+(3 rows)
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl FOR NO KEY UPDATE;
+ERROR: FOR NO KEY UPDATE is not allowed with UNION/INTERSECT/EXCEPT
+-- nested cases
+(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 4 | 5 | 6
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 4 | 5 | 6
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 1 | 2 | 3
+(1 row)
+
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
+ ?column? | ?column? | ?column?
+----------+----------+----------
+ 1 | 2 | 3
+(1 row)
+
+-- exercise both hashed and sorted implementations of UNION/INTERSECT/EXCEPT
+set enable_hashagg to on;
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ QUERY PLAN
+----------------------------------------------------------------
+ Aggregate
+ -> HashAggregate
+ Group Key: tenk1.unique1
+ -> Append
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Seq Scan on tenk1 tenk1_1
+(6 rows)
+
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ count
+-------
+ 10000
+(1 row)
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ QUERY PLAN
+------------------------------------------------------------------------------------
+ Aggregate
+ -> Subquery Scan on ss
+ -> HashSetOp Intersect
+ -> Append
+ -> Subquery Scan on "*SELECT* 2"
+ -> Seq Scan on tenk1
+ -> Subquery Scan on "*SELECT* 1"
+ -> Index Only Scan using tenk1_unique1 on tenk1 tenk1_1
+(8 rows)
+
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ count
+-------
+ 5000
+(1 row)
+
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ QUERY PLAN
+------------------------------------------------------------------------
+ HashSetOp Except
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Subquery Scan on "*SELECT* 2"
+ -> Index Only Scan using tenk1_unique2 on tenk1 tenk1_1
+ Filter: (unique2 <> 10)
+(7 rows)
+
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ unique1
+---------
+ 10
+(1 row)
+
+set enable_hashagg to off;
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ QUERY PLAN
+----------------------------------------------------------------------
+ Aggregate
+ -> Unique
+ -> Sort
+ Sort Key: tenk1.unique1
+ -> Append
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Seq Scan on tenk1 tenk1_1
+(7 rows)
+
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+ count
+-------
+ 10000
+(1 row)
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ QUERY PLAN
+------------------------------------------------------------------------------------------
+ Aggregate
+ -> Subquery Scan on ss
+ -> SetOp Intersect
+ -> Sort
+ Sort Key: "*SELECT* 2".fivethous
+ -> Append
+ -> Subquery Scan on "*SELECT* 2"
+ -> Seq Scan on tenk1
+ -> Subquery Scan on "*SELECT* 1"
+ -> Index Only Scan using tenk1_unique1 on tenk1 tenk1_1
+(10 rows)
+
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+ count
+-------
+ 5000
+(1 row)
+
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ QUERY PLAN
+------------------------------------------------------------------------------
+ SetOp Except
+ -> Sort
+ Sort Key: "*SELECT* 1".unique1
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ -> Subquery Scan on "*SELECT* 2"
+ -> Index Only Scan using tenk1_unique2 on tenk1 tenk1_1
+ Filter: (unique2 <> 10)
+(9 rows)
+
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+ unique1
+---------
+ 10
+(1 row)
+
+reset enable_hashagg;
+-- non-hashable type
+set enable_hashagg to on;
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+set enable_hashagg to off;
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+reset enable_hashagg;
+-- arrays
+set enable_hashagg to on;
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------
+ HashAggregate
+ Group Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(5 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,4}
+ {1,2}
+ {1,3}
+(3 rows)
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ HashSetOp Intersect
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,2}
+(1 row)
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ HashSetOp Except
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,3}
+(1 row)
+
+-- non-hashable type
+explain (costs off)
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+ x
+-----------
+ {$100.00}
+ {$200.00}
+ {$300.00}
+(3 rows)
+
+set enable_hashagg to off;
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,2}
+ {1,3}
+ {1,4}
+(3 rows)
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Intersect
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,2}
+(1 row)
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Except
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+ x
+-------
+ {1,3}
+(1 row)
+
+reset enable_hashagg;
+-- records
+set enable_hashagg to on;
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,2)
+ (1,3)
+ (1,4)
+(3 rows)
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Intersect
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,2)
+(1 row)
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Except
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,3)
+(1 row)
+
+-- non-hashable type
+-- With an anonymous row type, the typcache does not report that the
+-- type is hashable. (Otherwise, this would fail at execution time.)
+explain (costs off)
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+ x
+-----------
+ ($100.00)
+ ($200.00)
+ ($300.00)
+(3 rows)
+
+-- With a defined row type, the typcache can inspect the type's fields
+-- for hashability.
+create type ct1 as (f1 money);
+explain (costs off)
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+ x
+-----------
+ ($100.00)
+ ($200.00)
+ ($300.00)
+(3 rows)
+
+drop type ct1;
+set enable_hashagg to off;
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------
+ Unique
+ -> Sort
+ Sort Key: "*VALUES*".column1
+ -> Append
+ -> Values Scan on "*VALUES*"
+ -> Values Scan on "*VALUES*_1"
+(6 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,2)
+ (1,3)
+ (1,4)
+(3 rows)
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Intersect
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,2)
+(1 row)
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ QUERY PLAN
+-----------------------------------------------------
+ SetOp Except
+ -> Sort
+ Sort Key: "*SELECT* 1".x
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Values Scan on "*VALUES*"
+ -> Subquery Scan on "*SELECT* 2"
+ -> Values Scan on "*VALUES*_1"
+(8 rows)
+
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+ x
+-------
+ (1,3)
+(1 row)
+
+reset enable_hashagg;
+--
+-- Mixed types
+--
+SELECT f1 FROM float8_tbl INTERSECT SELECT f1 FROM int4_tbl ORDER BY 1;
+ f1
+----
+ 0
+(1 row)
+
+SELECT f1 FROM float8_tbl EXCEPT SELECT f1 FROM int4_tbl ORDER BY 1;
+ f1
+-----------------------
+ -1.2345678901234e+200
+ -1004.3
+ -34.84
+ -1.2345678901234e-200
+(4 rows)
+
+--
+-- Operator precedence and (((((extra))))) parentheses
+--
+SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+ q1
+-------------------
+ -4567890123456789
+ 123
+ 123
+ 456
+ 4567890123456789
+ 4567890123456789
+ 4567890123456789
+(7 rows)
+
+SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
+ q1
+-------------------
+ 123
+ 4567890123456789
+ 456
+ 4567890123456789
+ 123
+ 4567890123456789
+ -4567890123456789
+(7 rows)
+
+SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q1
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
+ q1
+-------------------
+ 123
+ 123
+ 4567890123456789
+ 4567890123456789
+ 4567890123456789
+ -4567890123456789
+ 456
+(7 rows)
+
+(((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+ q1
+-------------------
+ -4567890123456789
+ 456
+(2 rows)
+
+--
+-- Subqueries with ORDER BY & LIMIT clauses
+--
+-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
+SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
+ORDER BY q2,q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | -4567890123456789
+ 123 | 456
+(2 rows)
+
+-- This should fail, because q2 isn't a name of an EXCEPT output column
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
+ERROR: column "q2" does not exist
+LINE 1: ... int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1...
+ ^
+HINT: There is a column named "q2" in table "*SELECT* 2", but it cannot be referenced from this part of the query.
+-- But this should work:
+SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1))) ORDER BY 1;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+--
+-- New syntaxes (7.1) permit new tests
+--
+(((((select * from int8_tbl)))));
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+--
+-- Check behavior with empty select list (allowed since 9.4)
+--
+select union select;
+--
+(1 row)
+
+select intersect select;
+--
+(1 row)
+
+select except select;
+--
+(0 rows)
+
+-- check hashed implementation
+set enable_hashagg = true;
+set enable_sort = false;
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+ QUERY PLAN
+----------------------------------------------------------------
+ HashAggregate
+ -> Append
+ -> Function Scan on generate_series
+ -> Function Scan on generate_series generate_series_1
+(4 rows)
+
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+ QUERY PLAN
+----------------------------------------------------------------------
+ HashSetOp Intersect
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Function Scan on generate_series
+ -> Subquery Scan on "*SELECT* 2"
+ -> Function Scan on generate_series generate_series_1
+(6 rows)
+
+select from generate_series(1,5) union select from generate_series(1,3);
+--
+(1 row)
+
+select from generate_series(1,5) union all select from generate_series(1,3);
+--
+(8 rows)
+
+select from generate_series(1,5) intersect select from generate_series(1,3);
+--
+(1 row)
+
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+--
+(3 rows)
+
+select from generate_series(1,5) except select from generate_series(1,3);
+--
+(0 rows)
+
+select from generate_series(1,5) except all select from generate_series(1,3);
+--
+(2 rows)
+
+-- check sorted implementation
+set enable_hashagg = false;
+set enable_sort = true;
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+ QUERY PLAN
+----------------------------------------------------------------
+ Unique
+ -> Append
+ -> Function Scan on generate_series
+ -> Function Scan on generate_series generate_series_1
+(4 rows)
+
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+ QUERY PLAN
+----------------------------------------------------------------------
+ SetOp Intersect
+ -> Append
+ -> Subquery Scan on "*SELECT* 1"
+ -> Function Scan on generate_series
+ -> Subquery Scan on "*SELECT* 2"
+ -> Function Scan on generate_series generate_series_1
+(6 rows)
+
+select from generate_series(1,5) union select from generate_series(1,3);
+--
+(1 row)
+
+select from generate_series(1,5) union all select from generate_series(1,3);
+--
+(8 rows)
+
+select from generate_series(1,5) intersect select from generate_series(1,3);
+--
+(1 row)
+
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+--
+(3 rows)
+
+select from generate_series(1,5) except select from generate_series(1,3);
+--
+(0 rows)
+
+select from generate_series(1,5) except all select from generate_series(1,3);
+--
+(2 rows)
+
+reset enable_hashagg;
+reset enable_sort;
+--
+-- Check handling of a case with unknown constants. We don't guarantee
+-- an undecorated constant will work in all cases, but historically this
+-- usage has worked, so test we don't break it.
+--
+SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
+UNION
+SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
+ORDER BY 1;
+ f1
+------
+ a
+ ab
+ abcd
+ test
+(4 rows)
+
+-- This should fail, but it should produce an error cursor
+SELECT '3.4'::numeric UNION SELECT 'foo';
+ERROR: invalid input syntax for type numeric: "foo"
+LINE 1: SELECT '3.4'::numeric UNION SELECT 'foo';
+ ^
+--
+-- Test that expression-index constraints can be pushed down through
+-- UNION or UNION ALL
+--
+CREATE TEMP TABLE t1 (a text, b text);
+CREATE INDEX t1_ab_idx on t1 ((a || b));
+CREATE TEMP TABLE t2 (ab text primary key);
+INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
+INSERT INTO t2 VALUES ('ab'), ('xy');
+set enable_seqscan = off;
+set enable_indexscan = on;
+set enable_bitmapscan = off;
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+ QUERY PLAN
+---------------------------------------------
+ Append
+ -> Index Scan using t1_ab_idx on t1
+ Index Cond: ((a || b) = 'ab'::text)
+ -> Index Only Scan using t2_pkey on t2
+ Index Cond: (ab = 'ab'::text)
+(5 rows)
+
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+ QUERY PLAN
+---------------------------------------------------
+ HashAggregate
+ Group Key: ((t1.a || t1.b))
+ -> Append
+ -> Index Scan using t1_ab_idx on t1
+ Index Cond: ((a || b) = 'ab'::text)
+ -> Index Only Scan using t2_pkey on t2
+ Index Cond: (ab = 'ab'::text)
+(7 rows)
+
+--
+-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
+-- children.
+--
+CREATE TEMP TABLE t1c (b text, a text);
+ALTER TABLE t1c INHERIT t1;
+CREATE TEMP TABLE t2c (primary key (ab)) INHERITS (t2);
+INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
+INSERT INTO t2c VALUES ('vw'), ('cd'), ('mn'), ('ef');
+CREATE INDEX t1c_ab_idx on t1c ((a || b));
+set enable_seqscan = on;
+set enable_indexonlyscan = off;
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+ QUERY PLAN
+-----------------------------------------------------
+ Limit
+ -> Merge Append
+ Sort Key: ((t1.a || t1.b))
+ -> Index Scan using t1_ab_idx on t1
+ -> Index Scan using t1c_ab_idx on t1c t1_1
+ -> Index Scan using t2_pkey on t2
+ -> Index Scan using t2c_pkey on t2c t2_1
+(7 rows)
+
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+ ab
+----
+ ab
+ ab
+ cd
+ dc
+ ef
+ fe
+ mn
+ nm
+(8 rows)
+
+reset enable_seqscan;
+reset enable_indexscan;
+reset enable_bitmapscan;
+-- This simpler variant of the above test has been observed to fail differently
+create table events (event_id int primary key);
+create table other_events (event_id int primary key);
+create table events_child () inherits (events);
+explain (costs off)
+select event_id
+ from (select event_id from events
+ union all
+ select event_id from other_events) ss
+ order by event_id;
+ QUERY PLAN
+----------------------------------------------------------
+ Merge Append
+ Sort Key: events.event_id
+ -> Index Scan using events_pkey on events
+ -> Sort
+ Sort Key: events_1.event_id
+ -> Seq Scan on events_child events_1
+ -> Index Scan using other_events_pkey on other_events
+(7 rows)
+
+drop table events_child, events, other_events;
+reset enable_indexonlyscan;
+-- Test constraint exclusion of UNION ALL subqueries
+explain (costs off)
+ SELECT * FROM
+ (SELECT 1 AS t, * FROM tenk1 a
+ UNION ALL
+ SELECT 2 AS t, * FROM tenk1 b) c
+ WHERE t = 2;
+ QUERY PLAN
+---------------------
+ Seq Scan on tenk1 b
+(1 row)
+
+-- Test that we push quals into UNION sub-selects only when it's safe
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+ QUERY PLAN
+--------------------------------------------------
+ Sort
+ Sort Key: (2)
+ -> Unique
+ -> Sort
+ Sort Key: (1), (2)
+ -> Append
+ -> Result
+ -> Result
+ One-Time Filter: false
+(9 rows)
+
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+ t | x
+---+---
+ 1 | 2
+(1 row)
+
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+ QUERY PLAN
+--------------------------------------------------------
+ Sort
+ Sort Key: ss.x
+ -> Subquery Scan on ss
+ Filter: (ss.x < 4)
+ -> HashAggregate
+ Group Key: (1), (generate_series(1, 10))
+ -> Append
+ -> ProjectSet
+ -> Result
+ -> Result
+(10 rows)
+
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+ t | x
+---+---
+ 1 | 1
+ 1 | 2
+ 1 | 3
+(3 rows)
+
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+ QUERY PLAN
+------------------------------------------------------------------------------------
+ Sort
+ Sort Key: ss.x
+ -> Subquery Scan on ss
+ Filter: (ss.x > 3)
+ -> Unique
+ -> Sort
+ Sort Key: (1), (((random() * '3'::double precision))::integer)
+ -> Append
+ -> Result
+ -> Result
+(10 rows)
+
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+ t | x
+---+---
+ 2 | 4
+(1 row)
+
+-- Test cases where the native ordering of a sub-select has more pathkeys
+-- than the outer query cares about
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+ QUERY PLAN
+----------------------------------------------------------
+ Unique
+ -> Merge Append
+ Sort Key: "*SELECT* 1".q1
+ -> Subquery Scan on "*SELECT* 1"
+ -> Unique
+ -> Sort
+ Sort Key: i81.q1, i81.q2
+ -> Seq Scan on int8_tbl i81
+ Filter: (q2 IS NOT NULL)
+ -> Subquery Scan on "*SELECT* 2"
+ -> Unique
+ -> Sort
+ Sort Key: i82.q1, i82.q2
+ -> Seq Scan on int8_tbl i82
+ Filter: (q2 IS NOT NULL)
+(15 rows)
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+ q1
+------------------
+ 123
+ 4567890123456789
+(2 rows)
+
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+ QUERY PLAN
+--------------------------------------------------------
+ Unique
+ -> Merge Append
+ Sort Key: "*SELECT* 1".q1
+ -> Subquery Scan on "*SELECT* 1"
+ -> Unique
+ -> Sort
+ Sort Key: i81.q1, i81.q2
+ -> Seq Scan on int8_tbl i81
+ Filter: ((- q1) = q2)
+ -> Subquery Scan on "*SELECT* 2"
+ -> Unique
+ -> Sort
+ Sort Key: i82.q1, i82.q2
+ -> Seq Scan on int8_tbl i82
+ Filter: ((- q1) = q2)
+(15 rows)
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+ q1
+------------------
+ 4567890123456789
+(1 row)
+
+-- Test proper handling of parameterized appendrel paths when the
+-- potential join qual is expensive
+create function expensivefunc(int) returns int
+language plpgsql immutable strict cost 10000
+as $$begin return $1; end$$;
+create temp table t3 as select generate_series(-1000,1000) as x;
+create index t3i on t3 (expensivefunc(x));
+analyze t3;
+explain (costs off)
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+ QUERY PLAN
+------------------------------------------------------------
+ Nested Loop
+ -> Seq Scan on int4_tbl
+ -> Append
+ -> Index Scan using t3i on t3 a
+ Index Cond: (expensivefunc(x) = int4_tbl.f1)
+ -> Index Scan using t3i on t3 b
+ Index Cond: (expensivefunc(x) = int4_tbl.f1)
+(7 rows)
+
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+ x | f1
+---+----
+ 0 | 0
+ 0 | 0
+(2 rows)
+
+drop table t3;
+drop function expensivefunc(int);
+-- Test handling of appendrel quals that const-simplify into an AND
+explain (costs off)
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
+ QUERY PLAN
+---------------------------------------------
+ Append
+ -> Seq Scan on int8_tbl a
+ -> Seq Scan on int8_tbl b
+ Filter: ((q1 >= q2) AND (q1 <= q2))
+(4 rows)
+
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
+ q1 | q2 | x
+------------------+-------------------+---
+ 123 | 456 | 0
+ 123 | 4567890123456789 | 0
+ 4567890123456789 | 123 | 0
+ 4567890123456789 | 4567890123456789 | 0
+ 4567890123456789 | -4567890123456789 | 0
+ 4567890123456789 | 4567890123456789 | 1
+(6 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/union.sql b/yql/essentials/tests/postgresql/original/cases/union.sql
new file mode 100644
index 0000000000..ca8c9b4d12
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/union.sql
@@ -0,0 +1,542 @@
+--
+-- UNION (also INTERSECT, EXCEPT)
+--
+
+-- Simple UNION constructs
+
+SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
+
+SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
+
+SELECT 1 AS two UNION ALL SELECT 2;
+
+SELECT 1 AS two UNION ALL SELECT 1;
+
+SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+
+SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
+
+SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+
+SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
+
+-- Mixed types
+
+SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
+
+SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
+
+SELECT 1 AS one UNION SELECT 1.0::float8 ORDER BY 1;
+
+SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
+
+SELECT 1.0::float8 AS two UNION ALL SELECT 1 ORDER BY 1;
+
+SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
+
+SELECT 1.1::float8 AS two UNION SELECT 2 UNION SELECT 2.0::float8 ORDER BY 1;
+
+SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
+
+SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
+
+--
+-- Try testing from tables...
+--
+
+SELECT f1 AS five FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM FLOAT8_TBL
+ORDER BY 1;
+
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM FLOAT8_TBL;
+
+SELECT f1 AS nine FROM FLOAT8_TBL
+UNION
+SELECT f1 FROM INT4_TBL
+ORDER BY 1;
+
+SELECT f1 AS ten FROM FLOAT8_TBL
+UNION ALL
+SELECT f1 FROM INT4_TBL;
+
+SELECT f1 AS five FROM FLOAT8_TBL
+ WHERE f1 BETWEEN -1e6 AND 1e6
+UNION
+SELECT f1 FROM INT4_TBL
+ WHERE f1 BETWEEN 0 AND 1000000
+ORDER BY 1;
+
+SELECT CAST(f1 AS char(4)) AS three FROM VARCHAR_TBL
+UNION
+SELECT f1 FROM CHAR_TBL
+ORDER BY 1;
+
+SELECT f1 AS three FROM VARCHAR_TBL
+UNION
+SELECT CAST(f1 AS varchar) FROM CHAR_TBL
+ORDER BY 1;
+
+SELECT f1 AS eight FROM VARCHAR_TBL
+UNION ALL
+SELECT f1 FROM CHAR_TBL;
+
+SELECT f1 AS five FROM TEXT_TBL
+UNION
+SELECT f1 FROM VARCHAR_TBL
+UNION
+SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
+ORDER BY 1;
+
+--
+-- INTERSECT and EXCEPT
+--
+
+SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl FOR NO KEY UPDATE;
+
+-- nested cases
+(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
+(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
+
+-- exercise both hashed and sorted implementations of UNION/INTERSECT/EXCEPT
+
+set enable_hashagg to on;
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+
+set enable_hashagg to off;
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 union select fivethous from tenk1 ) ss;
+
+explain (costs off)
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+select count(*) from
+ ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
+
+explain (costs off)
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
+
+reset enable_hashagg;
+
+-- non-hashable type
+set enable_hashagg to on;
+
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+
+set enable_hashagg to off;
+
+explain (costs off)
+select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
+
+reset enable_hashagg;
+
+-- arrays
+set enable_hashagg to on;
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+
+-- non-hashable type
+explain (costs off)
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
+
+set enable_hashagg to off;
+
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) union select x from (values (array[1, 2]), (array[1, 4])) _(x);
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) intersect select x from (values (array[1, 2]), (array[1, 4])) _(x);
+explain (costs off)
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (values (array[1, 2]), (array[1, 4])) _(x);
+
+reset enable_hashagg;
+
+-- records
+set enable_hashagg to on;
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+
+-- non-hashable type
+
+-- With an anonymous row type, the typcache does not report that the
+-- type is hashable. (Otherwise, this would fail at execution time.)
+explain (costs off)
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
+
+-- With a defined row type, the typcache can inspect the type's fields
+-- for hashability.
+create type ct1 as (f1 money);
+explain (costs off)
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
+drop type ct1;
+
+set enable_hashagg to off;
+
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) union select x from (values (row(1, 2)), (row(1, 4))) _(x);
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) intersect select x from (values (row(1, 2)), (row(1, 4))) _(x);
+explain (costs off)
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (values (row(1, 2)), (row(1, 4))) _(x);
+
+reset enable_hashagg;
+
+--
+-- Mixed types
+--
+
+SELECT f1 FROM float8_tbl INTERSECT SELECT f1 FROM int4_tbl ORDER BY 1;
+
+SELECT f1 FROM float8_tbl EXCEPT SELECT f1 FROM int4_tbl ORDER BY 1;
+
+--
+-- Operator precedence and (((((extra))))) parentheses
+--
+
+SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
+
+(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
+
+SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+
+SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
+
+(((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
+
+--
+-- Subqueries with ORDER BY & LIMIT clauses
+--
+
+-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
+SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
+ORDER BY q2,q1;
+
+-- This should fail, because q2 isn't a name of an EXCEPT output column
+SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
+
+-- But this should work:
+SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1))) ORDER BY 1;
+
+--
+-- New syntaxes (7.1) permit new tests
+--
+
+(((((select * from int8_tbl)))));
+
+--
+-- Check behavior with empty select list (allowed since 9.4)
+--
+
+select union select;
+select intersect select;
+select except select;
+
+-- check hashed implementation
+set enable_hashagg = true;
+set enable_sort = false;
+
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+
+select from generate_series(1,5) union select from generate_series(1,3);
+select from generate_series(1,5) union all select from generate_series(1,3);
+select from generate_series(1,5) intersect select from generate_series(1,3);
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+select from generate_series(1,5) except select from generate_series(1,3);
+select from generate_series(1,5) except all select from generate_series(1,3);
+
+-- check sorted implementation
+set enable_hashagg = false;
+set enable_sort = true;
+
+explain (costs off)
+select from generate_series(1,5) union select from generate_series(1,3);
+explain (costs off)
+select from generate_series(1,5) intersect select from generate_series(1,3);
+
+select from generate_series(1,5) union select from generate_series(1,3);
+select from generate_series(1,5) union all select from generate_series(1,3);
+select from generate_series(1,5) intersect select from generate_series(1,3);
+select from generate_series(1,5) intersect all select from generate_series(1,3);
+select from generate_series(1,5) except select from generate_series(1,3);
+select from generate_series(1,5) except all select from generate_series(1,3);
+
+reset enable_hashagg;
+reset enable_sort;
+
+--
+-- Check handling of a case with unknown constants. We don't guarantee
+-- an undecorated constant will work in all cases, but historically this
+-- usage has worked, so test we don't break it.
+--
+
+SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
+UNION
+SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
+ORDER BY 1;
+
+-- This should fail, but it should produce an error cursor
+SELECT '3.4'::numeric UNION SELECT 'foo';
+
+--
+-- Test that expression-index constraints can be pushed down through
+-- UNION or UNION ALL
+--
+
+CREATE TEMP TABLE t1 (a text, b text);
+CREATE INDEX t1_ab_idx on t1 ((a || b));
+CREATE TEMP TABLE t2 (ab text primary key);
+INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
+INSERT INTO t2 VALUES ('ab'), ('xy');
+
+set enable_seqscan = off;
+set enable_indexscan = on;
+set enable_bitmapscan = off;
+
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION
+ SELECT * FROM t2) t
+ WHERE ab = 'ab';
+
+--
+-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
+-- children.
+--
+
+CREATE TEMP TABLE t1c (b text, a text);
+ALTER TABLE t1c INHERIT t1;
+CREATE TEMP TABLE t2c (primary key (ab)) INHERITS (t2);
+INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
+INSERT INTO t2c VALUES ('vw'), ('cd'), ('mn'), ('ef');
+CREATE INDEX t1c_ab_idx on t1c ((a || b));
+
+set enable_seqscan = on;
+set enable_indexonlyscan = off;
+
+explain (costs off)
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+
+ SELECT * FROM
+ (SELECT a || b AS ab FROM t1
+ UNION ALL
+ SELECT ab FROM t2) t
+ ORDER BY 1 LIMIT 8;
+
+reset enable_seqscan;
+reset enable_indexscan;
+reset enable_bitmapscan;
+
+-- This simpler variant of the above test has been observed to fail differently
+
+create table events (event_id int primary key);
+create table other_events (event_id int primary key);
+create table events_child () inherits (events);
+
+explain (costs off)
+select event_id
+ from (select event_id from events
+ union all
+ select event_id from other_events) ss
+ order by event_id;
+
+drop table events_child, events, other_events;
+
+reset enable_indexonlyscan;
+
+-- Test constraint exclusion of UNION ALL subqueries
+explain (costs off)
+ SELECT * FROM
+ (SELECT 1 AS t, * FROM tenk1 a
+ UNION ALL
+ SELECT 2 AS t, * FROM tenk1 b) c
+ WHERE t = 2;
+
+-- Test that we push quals into UNION sub-selects only when it's safe
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+
+SELECT * FROM
+ (SELECT 1 AS t, 2 AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+
+SELECT * FROM
+ (SELECT 1 AS t, generate_series(1,10) AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x < 4
+ORDER BY x;
+
+explain (costs off)
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+
+SELECT * FROM
+ (SELECT 1 AS t, (random()*3)::int AS x
+ UNION
+ SELECT 2 AS t, 4 AS x) ss
+WHERE x > 3
+ORDER BY x;
+
+-- Test cases where the native ordering of a sub-select has more pathkeys
+-- than the outer query cares about
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where q2 = q2;
+
+explain (costs off)
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+
+select distinct q1 from
+ (select distinct * from int8_tbl i81
+ union all
+ select distinct * from int8_tbl i82) ss
+where -q1 = q2;
+
+-- Test proper handling of parameterized appendrel paths when the
+-- potential join qual is expensive
+create function expensivefunc(int) returns int
+language plpgsql immutable strict cost 10000
+as $$begin return $1; end$$;
+
+create temp table t3 as select generate_series(-1000,1000) as x;
+create index t3i on t3 (expensivefunc(x));
+analyze t3;
+
+explain (costs off)
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+select * from
+ (select * from t3 a union all select * from t3 b) ss
+ join int4_tbl on f1 = expensivefunc(x);
+
+drop table t3;
+drop function expensivefunc(int);
+
+-- Test handling of appendrel quals that const-simplify into an AND
+explain (costs off)
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
+select * from
+ (select *, 0 as x from int8_tbl a
+ union all
+ select *, 1 as x from int8_tbl b) ss
+where (x = 0) or (q1 >= q2 and q1 <= q2);
diff --git a/yql/essentials/tests/postgresql/original/cases/update.out b/yql/essentials/tests/postgresql/original/cases/update.out
new file mode 100644
index 0000000000..c809f88f54
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/update.out
@@ -0,0 +1,1028 @@
+--
+-- UPDATE syntax tests
+--
+CREATE TABLE update_test (
+ a INT DEFAULT 10,
+ b INT,
+ c TEXT
+);
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+);
+INSERT INTO update_test VALUES (5, 10, 'foo');
+INSERT INTO update_test(b, a) VALUES (15, 10);
+SELECT * FROM update_test;
+ a | b | c
+----+----+-----
+ 5 | 10 | foo
+ 10 | 15 |
+(2 rows)
+
+UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+SELECT * FROM update_test;
+ a | b | c
+----+---+-----
+ 10 | | foo
+ 10 | |
+(2 rows)
+
+-- aliases for the UPDATE target table
+UPDATE update_test AS t SET b = 10 WHERE t.a = 10;
+SELECT * FROM update_test;
+ a | b | c
+----+----+-----
+ 10 | 10 | foo
+ 10 | 10 |
+(2 rows)
+
+UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+SELECT * FROM update_test;
+ a | b | c
+----+----+-----
+ 10 | 20 | foo
+ 10 | 20 |
+(2 rows)
+
+--
+-- Test VALUES in FROM
+--
+UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+SELECT * FROM update_test;
+ a | b | c
+-----+----+-----
+ 100 | 20 | foo
+ 100 | 20 |
+(2 rows)
+
+-- fail, wrong data type:
+UPDATE update_test SET a = v.* FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+ERROR: column "a" is of type integer but expression is of type record
+LINE 1: UPDATE update_test SET a = v.* FROM (VALUES(100, 20)) AS v(i...
+ ^
+HINT: You will need to rewrite or cast the expression.
+--
+-- Test multiple-set-clause syntax
+--
+INSERT INTO update_test SELECT a,b+1,c FROM update_test;
+SELECT * FROM update_test;
+ a | b | c
+-----+----+-----
+ 100 | 20 | foo
+ 100 | 20 |
+ 100 | 21 | foo
+ 100 | 21 |
+(4 rows)
+
+UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo';
+SELECT * FROM update_test;
+ a | b | c
+-----+----+-------
+ 100 | 20 |
+ 100 | 21 |
+ 10 | 31 | bugle
+ 10 | 32 | bugle
+(4 rows)
+
+UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10;
+SELECT * FROM update_test;
+ a | b | c
+-----+----+-----
+ 100 | 20 |
+ 100 | 21 |
+ 11 | 41 | car
+ 11 | 42 | car
+(4 rows)
+
+-- fail, multi assignment to same column:
+UPDATE update_test SET (c,b) = ('car', a+b), b = a + 1 WHERE a = 10;
+ERROR: multiple assignments to same column "b"
+-- uncorrelated sub-select:
+UPDATE update_test
+ SET (b,a) = (select a,b from update_test where b = 41 and c = 'car')
+ WHERE a = 100 AND b = 20;
+SELECT * FROM update_test;
+ a | b | c
+-----+----+-----
+ 100 | 21 |
+ 11 | 41 | car
+ 11 | 42 | car
+ 41 | 11 |
+(4 rows)
+
+-- correlated sub-select:
+UPDATE update_test o
+ SET (b,a) = (select a+1,b from update_test i
+ where i.a=o.a and i.b=o.b and i.c is not distinct from o.c);
+SELECT * FROM update_test;
+ a | b | c
+----+-----+-----
+ 21 | 101 |
+ 41 | 12 | car
+ 42 | 12 | car
+ 11 | 42 |
+(4 rows)
+
+-- fail, multiple rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test);
+ERROR: more than one row returned by a subquery used as an expression
+-- set to null if no rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000)
+ WHERE a = 11;
+SELECT * FROM update_test;
+ a | b | c
+----+-----+-----
+ 21 | 101 |
+ 41 | 12 | car
+ 42 | 12 | car
+ | |
+(4 rows)
+
+-- *-expansion should work in this context:
+UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j)
+ WHERE update_test.a = v.i;
+-- you might expect this to work, but syntactically it's not a RowExpr:
+UPDATE update_test SET (a,b) = (v.*) FROM (VALUES(21, 101)) AS v(i, j)
+ WHERE update_test.a = v.i;
+ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression
+LINE 1: UPDATE update_test SET (a,b) = (v.*) FROM (VALUES(21, 101)) ...
+ ^
+-- if an alias for the target table is specified, don't allow references
+-- to the original table name
+UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10;
+ERROR: invalid reference to FROM-clause entry for table "update_test"
+LINE 1: UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a...
+ ^
+HINT: Perhaps you meant to reference the table alias "t".
+-- Make sure that we can update to a TOASTed value.
+UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car';
+SELECT a, b, char_length(c) FROM update_test;
+ a | b | char_length
+----+-----+-------------
+ | |
+ 21 | 100 |
+ 41 | 12 | 10000
+ 42 | 12 | 10000
+(4 rows)
+
+-- Check multi-assignment with a Result node to handle a one-time filter.
+EXPLAIN (VERBOSE, COSTS OFF)
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+ QUERY PLAN
+-------------------------------------------------------------
+ Update on public.update_test t
+ -> Result
+ Output: $1, $2, (SubPlan 1 (returns $1,$2)), t.ctid
+ One-Time Filter: (CURRENT_USER = SESSION_USER)
+ -> Seq Scan on public.update_test t
+ Output: t.a, t.ctid
+ SubPlan 1 (returns $1,$2)
+ -> Seq Scan on public.update_test s
+ Output: s.b, s.a
+ Filter: (s.a = t.a)
+(10 rows)
+
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+SELECT a, b, char_length(c) FROM update_test;
+ a | b | char_length
+-----+----+-------------
+ | |
+ 100 | 21 |
+ 12 | 41 | 10000
+ 12 | 42 | 10000
+(4 rows)
+
+-- Test ON CONFLICT DO UPDATE
+INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo');
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+ a | b
+---+-----
+ 1 | Foo
+(1 row)
+
+-- correlated sub-select:
+INSERT INTO upsert_test VALUES (1, 'Baz'), (3, 'Zaz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Correlated', a from upsert_test i WHERE i.a = upsert_test.a)
+ RETURNING *;
+ a | b
+---+-----------------
+ 1 | Foo, Correlated
+ 3 | Zoo, Correlated
+(2 rows)
+
+-- correlated sub-select (EXCLUDED.* alias):
+INSERT INTO upsert_test VALUES (1, 'Bat'), (3, 'Zot') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING *;
+ a | b
+---+---------------------------
+ 1 | Foo, Correlated, Excluded
+ 3 | Zoo, Correlated, Excluded
+(2 rows)
+
+-- ON CONFLICT using system attributes in RETURNING, testing both the
+-- inserting and updating paths. See bug report at:
+-- https://www.postgresql.org/message-id/73436355-6432-49B1-92ED-1FE4F7E7E100%40finefun.com.au
+INSERT INTO upsert_test VALUES (2, 'Beeble') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = 0 AS xmax_correct;
+ tableoid | xmin_correct | xmax_correct
+-------------+--------------+--------------
+ upsert_test | t | t
+(1 row)
+
+-- currently xmax is set after a conflict - that's probably not good,
+-- but it seems worthwhile to have to be explicit if that changes.
+INSERT INTO upsert_test VALUES (2, 'Brox') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = pg_current_xact_id()::xid AS xmax_correct;
+ tableoid | xmin_correct | xmax_correct
+-------------+--------------+--------------
+ upsert_test | t | t
+(1 row)
+
+DROP TABLE update_test;
+DROP TABLE upsert_test;
+-- Test ON CONFLICT DO UPDATE with partitioned table and non-identical children
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+) PARTITION BY LIST (a);
+CREATE TABLE upsert_test_1 PARTITION OF upsert_test FOR VALUES IN (1);
+CREATE TABLE upsert_test_2 (b TEXT, a INT PRIMARY KEY);
+ALTER TABLE upsert_test ATTACH PARTITION upsert_test_2 FOR VALUES IN (2);
+INSERT INTO upsert_test VALUES(1, 'Boo'), (2, 'Zoo');
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+ a | b
+---+-----
+ 1 | Foo
+(1 row)
+
+-- correlated sub-select:
+WITH aaa AS (SELECT 1 AS ctea, ' Foo' AS cteb) INSERT INTO upsert_test
+ VALUES (1, 'Bar'), (2, 'Baz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT upsert_test.b||cteb, upsert_test.a FROM aaa) RETURNING *;
+ a | b
+---+---------
+ 1 | Foo Foo
+ 2 | Zoo Foo
+(2 rows)
+
+DROP TABLE upsert_test;
+---------------------------
+-- UPDATE with row movement
+---------------------------
+-- When a partitioned table receives an UPDATE to the partitioned key and the
+-- new values no longer meet the partition's bound, the row must be moved to
+-- the correct partition for the new partition key (if one exists). We must
+-- also ensure that updatable views on partitioned tables properly enforce any
+-- WITH CHECK OPTION that is defined. The situation with triggers in this case
+-- also requires thorough testing as partition key updates causing row
+-- movement convert UPDATEs into DELETE+INSERT.
+CREATE TABLE range_parted (
+ a text,
+ b bigint,
+ c numeric,
+ d int,
+ e varchar
+) PARTITION BY RANGE (a, b);
+-- Create partitions intentionally in descending bound order, so as to test
+-- that update-row-movement works with the leaf partitions not in bound order.
+CREATE TABLE part_b_20_b_30 (e varchar, c numeric, a text, b bigint, d int);
+ALTER TABLE range_parted ATTACH PARTITION part_b_20_b_30 FOR VALUES FROM ('b', 20) TO ('b', 30);
+CREATE TABLE part_b_10_b_20 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY RANGE (c);
+CREATE TABLE part_b_1_b_10 PARTITION OF range_parted FOR VALUES FROM ('b', 1) TO ('b', 10);
+ALTER TABLE range_parted ATTACH PARTITION part_b_10_b_20 FOR VALUES FROM ('b', 10) TO ('b', 20);
+CREATE TABLE part_a_10_a_20 PARTITION OF range_parted FOR VALUES FROM ('a', 10) TO ('a', 20);
+CREATE TABLE part_a_1_a_10 PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('a', 10);
+-- Check that partition-key UPDATE works sanely on a partitioned table that
+-- does not have any child partitions.
+UPDATE part_b_10_b_20 set b = b - 6;
+-- Create some more partitions following the above pattern of descending bound
+-- order, but let's make the situation a bit more complex by having the
+-- attribute numbers of the columns vary from their parent partition.
+CREATE TABLE part_c_100_200 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY range (abs(d));
+ALTER TABLE part_c_100_200 DROP COLUMN e, DROP COLUMN c, DROP COLUMN a;
+ALTER TABLE part_c_100_200 ADD COLUMN c numeric, ADD COLUMN e varchar, ADD COLUMN a text;
+ALTER TABLE part_c_100_200 DROP COLUMN b;
+ALTER TABLE part_c_100_200 ADD COLUMN b bigint;
+CREATE TABLE part_d_1_15 PARTITION OF part_c_100_200 FOR VALUES FROM (1) TO (15);
+CREATE TABLE part_d_15_20 PARTITION OF part_c_100_200 FOR VALUES FROM (15) TO (20);
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_100_200 FOR VALUES FROM (100) TO (200);
+CREATE TABLE part_c_1_100 (e varchar, d int, c numeric, b bigint, a text);
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_1_100 FOR VALUES FROM (1) TO (100);
+\set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)'
+\set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6'
+:init_range_parted;
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 12 | 96 | 1 |
+ part_c_1_100 | b | 13 | 97 | 2 |
+ part_d_15_20 | b | 15 | 105 | 16 |
+ part_d_15_20 | b | 17 | 105 | 19 |
+(6 rows)
+
+-- The order of subplans should be in bound order
+EXPLAIN (costs off) UPDATE range_parted set c = c - 50 WHERE c > 97;
+ QUERY PLAN
+-------------------------------------------------------
+ Update on range_parted
+ Update on part_a_1_a_10 range_parted_1
+ Update on part_a_10_a_20 range_parted_2
+ Update on part_b_1_b_10 range_parted_3
+ Update on part_c_1_100 range_parted_4
+ Update on part_d_1_15 range_parted_5
+ Update on part_d_15_20 range_parted_6
+ Update on part_b_20_b_30 range_parted_7
+ -> Append
+ -> Seq Scan on part_a_1_a_10 range_parted_1
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_a_10_a_20 range_parted_2
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_b_1_b_10 range_parted_3
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_c_1_100 range_parted_4
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_d_1_15 range_parted_5
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_d_15_20 range_parted_6
+ Filter: (c > '97'::numeric)
+ -> Seq Scan on part_b_20_b_30 range_parted_7
+ Filter: (c > '97'::numeric)
+(23 rows)
+
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_c_100_200 set c = c - 20, d = c WHERE c = 105;
+ERROR: new row for relation "part_c_100_200" violates partition constraint
+DETAIL: Failing row contains (105, 85, null, b, 15).
+-- fail, no partition key update, so no attempt to move tuple,
+-- but "a = 'a'" violates partition constraint enforced by root partition)
+UPDATE part_b_10_b_20 set a = 'a';
+ERROR: new row for relation "part_b_10_b_20" violates partition constraint
+DETAIL: Failing row contains (null, 96, a, 12, 1).
+-- ok, partition key update, no constraint violation
+UPDATE range_parted set d = d - 10 WHERE d > 10;
+-- ok, no partition key update, no constraint violation
+UPDATE range_parted set e = d;
+-- No row found
+UPDATE part_c_1_100 set c = c + 20 WHERE c = 98;
+-- ok, row movement
+UPDATE part_b_10_b_20 set c = c + 20 returning c, b, a;
+ c | b | a
+-----+----+---
+ 116 | 12 | b
+ 117 | 13 | b
+ 125 | 15 | b
+ 125 | 17 | b
+(4 rows)
+
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+---+---
+ part_a_10_a_20 | a | 10 | 200 | 1 | 1
+ part_a_1_a_10 | a | 1 | 1 | 1 | 1
+ part_d_1_15 | b | 12 | 116 | 1 | 1
+ part_d_1_15 | b | 13 | 117 | 2 | 2
+ part_d_1_15 | b | 15 | 125 | 6 | 6
+ part_d_1_15 | b | 17 | 125 | 9 | 9
+(6 rows)
+
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_b_10_b_20 set b = b - 6 WHERE c > 116 returning *;
+ERROR: new row for relation "part_b_10_b_20" violates partition constraint
+DETAIL: Failing row contains (2, 117, b, 7, 2).
+-- ok, row movement, with subset of rows moved into different partition.
+UPDATE range_parted set b = b - 6 WHERE c > 116 returning a, b + c;
+ a | ?column?
+---+----------
+ a | 204
+ b | 124
+ b | 134
+ b | 136
+(4 rows)
+
+:show_data;
+ partname | a | b | c | d | e
+---------------+---+----+-----+---+---
+ part_a_1_a_10 | a | 1 | 1 | 1 | 1
+ part_a_1_a_10 | a | 4 | 200 | 1 | 1
+ part_b_1_b_10 | b | 7 | 117 | 2 | 2
+ part_b_1_b_10 | b | 9 | 125 | 6 | 6
+ part_d_1_15 | b | 11 | 125 | 9 | 9
+ part_d_1_15 | b | 12 | 116 | 1 | 1
+(6 rows)
+
+-- Common table needed for multiple test scenarios.
+CREATE TABLE mintab(c1 int);
+INSERT into mintab VALUES (120);
+-- update partition key using updatable view.
+CREATE VIEW upview AS SELECT * FROM range_parted WHERE (select c > c1 FROM mintab) WITH CHECK OPTION;
+-- ok
+UPDATE upview set c = 199 WHERE b = 4;
+-- fail, check option violation
+UPDATE upview set c = 120 WHERE b = 4;
+ERROR: new row violates check option for view "upview"
+DETAIL: Failing row contains (a, 4, 120, 1, 1).
+-- fail, row movement with check option violation
+UPDATE upview set a = 'b', b = 15, c = 120 WHERE b = 4;
+ERROR: new row violates check option for view "upview"
+DETAIL: Failing row contains (b, 15, 120, 1, 1).
+-- ok, row movement, check option passes
+UPDATE upview set a = 'b', b = 15 WHERE b = 4;
+:show_data;
+ partname | a | b | c | d | e
+---------------+---+----+-----+---+---
+ part_a_1_a_10 | a | 1 | 1 | 1 | 1
+ part_b_1_b_10 | b | 7 | 117 | 2 | 2
+ part_b_1_b_10 | b | 9 | 125 | 6 | 6
+ part_d_1_15 | b | 11 | 125 | 9 | 9
+ part_d_1_15 | b | 12 | 116 | 1 | 1
+ part_d_1_15 | b | 15 | 199 | 1 | 1
+(6 rows)
+
+-- cleanup
+DROP VIEW upview;
+-- RETURNING having whole-row vars.
+:init_range_parted;
+UPDATE range_parted set c = 95 WHERE a = 'b' and b > 10 and c > 100 returning (range_parted), *;
+ range_parted | a | b | c | d | e
+---------------+---+----+----+----+---
+ (b,15,95,16,) | b | 15 | 95 | 16 |
+ (b,17,95,19,) | b | 17 | 95 | 19 |
+(2 rows)
+
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 12 | 96 | 1 |
+ part_c_1_100 | b | 13 | 97 | 2 |
+ part_c_1_100 | b | 15 | 95 | 16 |
+ part_c_1_100 | b | 17 | 95 | 19 |
+(6 rows)
+
+-- Transition tables with update row movement
+:init_range_parted;
+CREATE FUNCTION trans_updatetrigfunc() RETURNS trigger LANGUAGE plpgsql AS
+$$
+ begin
+ raise notice 'trigger = %, old table = %, new table = %',
+ TG_NAME,
+ (select string_agg(old_table::text, ', ' ORDER BY a) FROM old_table),
+ (select string_agg(new_table::text, ', ' ORDER BY a) FROM new_table);
+ return null;
+ end;
+$$;
+CREATE TRIGGER trans_updatetrig
+ AFTER UPDATE ON range_parted REFERENCING OLD TABLE AS old_table NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end ) WHERE a = 'b' and b > 10 and c >= 96;
+NOTICE: trigger = trans_updatetrig, old table = (b,12,96,1,), (b,13,97,2,), (b,15,105,16,), (b,17,105,19,), new table = (b,12,110,1,), (b,13,98,2,), (b,15,106,16,), (b,17,106,19,)
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 13 | 98 | 2 |
+ part_d_15_20 | b | 15 | 106 | 16 |
+ part_d_15_20 | b | 17 | 106 | 19 |
+ part_d_1_15 | b | 12 | 110 | 1 |
+(6 rows)
+
+:init_range_parted;
+-- Enabling OLD TABLE capture for both DELETE as well as UPDATE stmt triggers
+-- should not cause DELETEd rows to be captured twice. Similar thing for
+-- INSERT triggers and inserted rows.
+CREATE TRIGGER trans_deletetrig
+ AFTER DELETE ON range_parted REFERENCING OLD TABLE AS old_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+CREATE TRIGGER trans_inserttrig
+ AFTER INSERT ON range_parted REFERENCING NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+NOTICE: trigger = trans_updatetrig, old table = (b,12,96,1,), (b,13,97,2,), (b,15,105,16,), (b,17,105,19,), new table = (b,12,146,1,), (b,13,147,2,), (b,15,155,16,), (b,17,155,19,)
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_d_15_20 | b | 15 | 155 | 16 |
+ part_d_15_20 | b | 17 | 155 | 19 |
+ part_d_1_15 | b | 12 | 146 | 1 |
+ part_d_1_15 | b | 13 | 147 | 2 |
+(6 rows)
+
+DROP TRIGGER trans_deletetrig ON range_parted;
+DROP TRIGGER trans_inserttrig ON range_parted;
+-- Don't drop trans_updatetrig yet. It is required below.
+-- Test with transition tuple conversion happening for rows moved into the
+-- new partition. This requires a trigger that references transition table
+-- (we already have trans_updatetrig). For inserted rows, the conversion
+-- is not usually needed, because the original tuple is already compatible with
+-- the desired transition tuple format. But conversion happens when there is a
+-- BR trigger because the trigger can change the inserted row. So install a
+-- BR triggers on those child partitions where the rows will be moved.
+CREATE FUNCTION func_parted_mod_b() RETURNS trigger AS $$
+BEGIN
+ NEW.b = NEW.b + 1;
+ return NEW;
+END $$ language plpgsql;
+CREATE TRIGGER trig_c1_100 BEFORE UPDATE OR INSERT ON part_c_1_100
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+CREATE TRIGGER trig_d1_15 BEFORE UPDATE OR INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+CREATE TRIGGER trig_d15_20 BEFORE UPDATE OR INSERT ON part_d_15_20
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+:init_range_parted;
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end) WHERE a = 'b' and b > 10 and c >= 96;
+NOTICE: trigger = trans_updatetrig, old table = (b,13,96,1,), (b,14,97,2,), (b,16,105,16,), (b,18,105,19,), new table = (b,15,110,1,), (b,15,98,2,), (b,17,106,16,), (b,19,106,19,)
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 15 | 98 | 2 |
+ part_d_15_20 | b | 17 | 106 | 16 |
+ part_d_15_20 | b | 19 | 106 | 19 |
+ part_d_1_15 | b | 15 | 110 | 1 |
+(6 rows)
+
+:init_range_parted;
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+NOTICE: trigger = trans_updatetrig, old table = (b,13,96,1,), (b,14,97,2,), (b,16,105,16,), (b,18,105,19,), new table = (b,15,146,1,), (b,16,147,2,), (b,17,155,16,), (b,19,155,19,)
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_d_15_20 | b | 17 | 155 | 16 |
+ part_d_15_20 | b | 19 | 155 | 19 |
+ part_d_1_15 | b | 15 | 146 | 1 |
+ part_d_1_15 | b | 16 | 147 | 2 |
+(6 rows)
+
+-- Case where per-partition tuple conversion map array is allocated, but the
+-- map is not required for the particular tuple that is routed, thanks to
+-- matching table attributes of the partition and the target table.
+:init_range_parted;
+UPDATE range_parted set b = 15 WHERE b = 1;
+NOTICE: trigger = trans_updatetrig, old table = (a,1,1,1,), new table = (a,15,1,1,)
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_10_a_20 | a | 15 | 1 | 1 |
+ part_c_1_100 | b | 13 | 96 | 1 |
+ part_c_1_100 | b | 14 | 97 | 2 |
+ part_d_15_20 | b | 16 | 105 | 16 |
+ part_d_15_20 | b | 18 | 105 | 19 |
+(6 rows)
+
+DROP TRIGGER trans_updatetrig ON range_parted;
+DROP TRIGGER trig_c1_100 ON part_c_1_100;
+DROP TRIGGER trig_d1_15 ON part_d_1_15;
+DROP TRIGGER trig_d15_20 ON part_d_15_20;
+DROP FUNCTION func_parted_mod_b();
+-- RLS policies with update-row-movement
+-----------------------------------------
+ALTER TABLE range_parted ENABLE ROW LEVEL SECURITY;
+CREATE USER regress_range_parted_user;
+GRANT ALL ON range_parted, mintab TO regress_range_parted_user;
+CREATE POLICY seeall ON range_parted AS PERMISSIVE FOR SELECT USING (true);
+CREATE POLICY policy_range_parted ON range_parted for UPDATE USING (true) WITH CHECK (c % 2 = 0);
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- This should fail with RLS violation error while moving row from
+-- part_a_10_a_20 to part_d_1_15, because we are setting 'c' to an odd number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+ERROR: new row violates row-level security policy for table "range_parted"
+RESET SESSION AUTHORIZATION;
+-- Create a trigger on part_d_1_15
+CREATE FUNCTION func_d_1_15() RETURNS trigger AS $$
+BEGIN
+ NEW.c = NEW.c + 1; -- Make even numbers odd, or vice versa
+ return NEW;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER trig_d_1_15 BEFORE INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_d_1_15();
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- Here, RLS checks should succeed while moving row from part_a_10_a_20 to
+-- part_d_1_15. Even though the UPDATE is setting 'c' to an odd number, the
+-- trigger at the destination partition again makes it an even number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- This should fail with RLS violation error. Even though the UPDATE is setting
+-- 'c' to an even number, the trigger at the destination partition again makes
+-- it an odd number.
+UPDATE range_parted set a = 'b', c = 150 WHERE a = 'a' and c = 200;
+ERROR: new row violates row-level security policy for table "range_parted"
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+DROP TRIGGER trig_d_1_15 ON part_d_1_15;
+DROP FUNCTION func_d_1_15();
+-- Policy expression contains SubPlan
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+CREATE POLICY policy_range_parted_subplan on range_parted
+ AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK ((SELECT range_parted.c <= c1 FROM mintab));
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- fail, mintab has row with c1 = 120
+UPDATE range_parted set a = 'b', c = 122 WHERE a = 'a' and c = 200;
+ERROR: new row violates row-level security policy "policy_range_parted_subplan" for table "range_parted"
+-- ok
+UPDATE range_parted set a = 'b', c = 120 WHERE a = 'a' and c = 200;
+-- RLS policy expression contains whole row.
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+CREATE POLICY policy_range_parted_wholerow on range_parted AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK (range_parted = row('b', 10, 112, 1, NULL)::range_parted);
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- ok, should pass the RLS check
+UPDATE range_parted set a = 'b', c = 112 WHERE a = 'a' and c = 200;
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- fail, the whole row RLS check should fail
+UPDATE range_parted set a = 'b', c = 116 WHERE a = 'a' and c = 200;
+ERROR: new row violates row-level security policy "policy_range_parted_wholerow" for table "range_parted"
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+DROP POLICY policy_range_parted ON range_parted;
+DROP POLICY policy_range_parted_subplan ON range_parted;
+DROP POLICY policy_range_parted_wholerow ON range_parted;
+REVOKE ALL ON range_parted, mintab FROM regress_range_parted_user;
+DROP USER regress_range_parted_user;
+DROP TABLE mintab;
+-- statement triggers with update row movement
+---------------------------------------------------
+:init_range_parted;
+CREATE FUNCTION trigfunc() returns trigger language plpgsql as
+$$
+ begin
+ raise notice 'trigger = % fired on table % during %',
+ TG_NAME, TG_TABLE_NAME, TG_OP;
+ return null;
+ end;
+$$;
+-- Triggers on root partition
+CREATE TRIGGER parent_delete_trig
+ AFTER DELETE ON range_parted for each statement execute procedure trigfunc();
+CREATE TRIGGER parent_update_trig
+ AFTER UPDATE ON range_parted for each statement execute procedure trigfunc();
+CREATE TRIGGER parent_insert_trig
+ AFTER INSERT ON range_parted for each statement execute procedure trigfunc();
+-- Triggers on leaf partition part_c_1_100
+CREATE TRIGGER c1_delete_trig
+ AFTER DELETE ON part_c_1_100 for each statement execute procedure trigfunc();
+CREATE TRIGGER c1_update_trig
+ AFTER UPDATE ON part_c_1_100 for each statement execute procedure trigfunc();
+CREATE TRIGGER c1_insert_trig
+ AFTER INSERT ON part_c_1_100 for each statement execute procedure trigfunc();
+-- Triggers on leaf partition part_d_1_15
+CREATE TRIGGER d1_delete_trig
+ AFTER DELETE ON part_d_1_15 for each statement execute procedure trigfunc();
+CREATE TRIGGER d1_update_trig
+ AFTER UPDATE ON part_d_1_15 for each statement execute procedure trigfunc();
+CREATE TRIGGER d1_insert_trig
+ AFTER INSERT ON part_d_1_15 for each statement execute procedure trigfunc();
+-- Triggers on leaf partition part_d_15_20
+CREATE TRIGGER d15_delete_trig
+ AFTER DELETE ON part_d_15_20 for each statement execute procedure trigfunc();
+CREATE TRIGGER d15_update_trig
+ AFTER UPDATE ON part_d_15_20 for each statement execute procedure trigfunc();
+CREATE TRIGGER d15_insert_trig
+ AFTER INSERT ON part_d_15_20 for each statement execute procedure trigfunc();
+-- Move all rows from part_c_100_200 to part_c_1_100. None of the delete or
+-- insert statement triggers should be fired.
+UPDATE range_parted set c = c - 50 WHERE c > 97;
+NOTICE: trigger = parent_update_trig fired on table range_parted during UPDATE
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 150 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 12 | 96 | 1 |
+ part_c_1_100 | b | 13 | 97 | 2 |
+ part_c_1_100 | b | 15 | 55 | 16 |
+ part_c_1_100 | b | 17 | 55 | 19 |
+(6 rows)
+
+DROP TRIGGER parent_delete_trig ON range_parted;
+DROP TRIGGER parent_update_trig ON range_parted;
+DROP TRIGGER parent_insert_trig ON range_parted;
+DROP TRIGGER c1_delete_trig ON part_c_1_100;
+DROP TRIGGER c1_update_trig ON part_c_1_100;
+DROP TRIGGER c1_insert_trig ON part_c_1_100;
+DROP TRIGGER d1_delete_trig ON part_d_1_15;
+DROP TRIGGER d1_update_trig ON part_d_1_15;
+DROP TRIGGER d1_insert_trig ON part_d_1_15;
+DROP TRIGGER d15_delete_trig ON part_d_15_20;
+DROP TRIGGER d15_update_trig ON part_d_15_20;
+DROP TRIGGER d15_insert_trig ON part_d_15_20;
+-- Creating default partition for range
+:init_range_parted;
+create table part_def partition of range_parted default;
+\d+ part_def
+ Table "public.part_def"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+-------------------+-----------+----------+---------+----------+--------------+-------------
+ a | text | | | | extended | |
+ b | bigint | | | | plain | |
+ c | numeric | | | | main | |
+ d | integer | | | | plain | |
+ e | character varying | | | | extended | |
+Partition of: range_parted DEFAULT
+Partition constraint: (NOT ((a IS NOT NULL) AND (b IS NOT NULL) AND (((a = 'a'::text) AND (b >= '1'::bigint) AND (b < '10'::bigint)) OR ((a = 'a'::text) AND (b >= '10'::bigint) AND (b < '20'::bigint)) OR ((a = 'b'::text) AND (b >= '1'::bigint) AND (b < '10'::bigint)) OR ((a = 'b'::text) AND (b >= '10'::bigint) AND (b < '20'::bigint)) OR ((a = 'b'::text) AND (b >= '20'::bigint) AND (b < '30'::bigint)))))
+
+insert into range_parted values ('c', 9);
+-- ok
+update part_def set a = 'd' where a = 'c';
+-- fail
+update part_def set a = 'a' where a = 'd';
+ERROR: new row for relation "part_def" violates partition constraint
+DETAIL: Failing row contains (a, 9, null, null, null).
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 12 | 96 | 1 |
+ part_c_1_100 | b | 13 | 97 | 2 |
+ part_d_15_20 | b | 15 | 105 | 16 |
+ part_d_15_20 | b | 17 | 105 | 19 |
+ part_def | d | 9 | | |
+(7 rows)
+
+-- Update row movement from non-default to default partition.
+-- fail, default partition is not under part_a_10_a_20;
+UPDATE part_a_10_a_20 set a = 'ad' WHERE a = 'a';
+ERROR: new row for relation "part_a_10_a_20" violates partition constraint
+DETAIL: Failing row contains (ad, 10, 200, 1, null).
+-- ok
+UPDATE range_parted set a = 'ad' WHERE a = 'a';
+UPDATE range_parted set a = 'bd' WHERE a = 'b';
+:show_data;
+ partname | a | b | c | d | e
+----------+----+----+-----+----+---
+ part_def | ad | 1 | 1 | 1 |
+ part_def | ad | 10 | 200 | 1 |
+ part_def | bd | 12 | 96 | 1 |
+ part_def | bd | 13 | 97 | 2 |
+ part_def | bd | 15 | 105 | 16 |
+ part_def | bd | 17 | 105 | 19 |
+ part_def | d | 9 | | |
+(7 rows)
+
+-- Update row movement from default to non-default partitions.
+-- ok
+UPDATE range_parted set a = 'a' WHERE a = 'ad';
+UPDATE range_parted set a = 'b' WHERE a = 'bd';
+:show_data;
+ partname | a | b | c | d | e
+----------------+---+----+-----+----+---
+ part_a_10_a_20 | a | 10 | 200 | 1 |
+ part_a_1_a_10 | a | 1 | 1 | 1 |
+ part_c_1_100 | b | 12 | 96 | 1 |
+ part_c_1_100 | b | 13 | 97 | 2 |
+ part_d_15_20 | b | 15 | 105 | 16 |
+ part_d_15_20 | b | 17 | 105 | 19 |
+ part_def | d | 9 | | |
+(7 rows)
+
+-- Cleanup: range_parted no longer needed.
+DROP TABLE range_parted;
+CREATE TABLE list_parted (
+ a text,
+ b int
+) PARTITION BY list (a);
+CREATE TABLE list_part1 PARTITION OF list_parted for VALUES in ('a', 'b');
+CREATE TABLE list_default PARTITION OF list_parted default;
+INSERT into list_part1 VALUES ('a', 1);
+INSERT into list_default VALUES ('d', 10);
+-- fail
+UPDATE list_default set a = 'a' WHERE a = 'd';
+ERROR: new row for relation "list_default" violates partition constraint
+DETAIL: Failing row contains (a, 10).
+-- ok
+UPDATE list_default set a = 'x' WHERE a = 'd';
+DROP TABLE list_parted;
+-- Test retrieval of system columns with non-consistent partition row types.
+-- This is only partially supported, as seen in the results.
+create table utrtest (a int, b text) partition by list (a);
+create table utr1 (a int check (a in (1)), q text, b text);
+create table utr2 (a int check (a in (2)), b text);
+alter table utr1 drop column q;
+alter table utrtest attach partition utr1 for values in (1);
+alter table utrtest attach partition utr2 for values in (2);
+insert into utrtest values (1, 'foo')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+ a | b | tableoid | xmin_ok
+---+-----+----------+---------
+ 1 | foo | utr1 | t
+(1 row)
+
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+ERROR: cannot retrieve a system column in this context
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass;
+ a | b | tableoid
+---+-----+----------
+ 2 | bar | utr2
+(1 row)
+
+update utrtest set b = b || b from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+ a | b | x | tableoid | xmin_ok
+---+--------+---+----------+---------
+ 1 | foofoo | 1 | utr1 | t
+ 2 | barbar | 2 | utr2 | t
+(2 rows)
+
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+ERROR: cannot retrieve a system column in this context
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass;
+ a | b | x | tableoid
+---+--------+---+----------
+ 2 | foofoo | 1 | utr2
+ 1 | barbar | 2 | utr1
+(2 rows)
+
+delete from utrtest
+ returning *, tableoid::regclass, xmax = pg_current_xact_id()::xid as xmax_ok;
+ a | b | tableoid | xmax_ok
+---+--------+----------+---------
+ 1 | barbar | utr1 | t
+ 2 | foofoo | utr2 | t
+(2 rows)
+
+drop table utrtest;
+--------------
+-- Some more update-partition-key test scenarios below. This time use list
+-- partitions.
+--------------
+-- Setup for list partitions
+CREATE TABLE list_parted (a numeric, b int, c int8) PARTITION BY list (a);
+CREATE TABLE sub_parted PARTITION OF list_parted for VALUES in (1) PARTITION BY list (b);
+CREATE TABLE sub_part1(b int, c int8, a numeric);
+ALTER TABLE sub_parted ATTACH PARTITION sub_part1 for VALUES in (1);
+CREATE TABLE sub_part2(b int, c int8, a numeric);
+ALTER TABLE sub_parted ATTACH PARTITION sub_part2 for VALUES in (2);
+CREATE TABLE list_part1(a numeric, b int, c int8);
+ALTER TABLE list_parted ATTACH PARTITION list_part1 for VALUES in (2,3);
+INSERT into list_parted VALUES (2,5,50);
+INSERT into list_parted VALUES (3,6,60);
+INSERT into sub_parted VALUES (1,1,60);
+INSERT into sub_parted VALUES (1,2,10);
+-- Test partition constraint violation when intermediate ancestor is used and
+-- constraint is inherited from upper root.
+UPDATE sub_parted set a = 2 WHERE c = 10;
+ERROR: new row for relation "sub_parted" violates partition constraint
+DETAIL: Failing row contains (2, 2, 10).
+-- Test update-partition-key, where the unpruned partitions do not have their
+-- partition keys updated.
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+ tableoid | a | b | c
+------------+---+---+----
+ list_part1 | 2 | 5 | 50
+(1 row)
+
+UPDATE list_parted set b = c + a WHERE a = 2;
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 52 | 50
+(1 row)
+
+-- Test the case where BR UPDATE triggers change the partition key.
+CREATE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ NEW.b = 2; -- This is changing partition key column.
+ return NEW;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER parted_mod_b before update on sub_part1
+ for each row execute procedure func_parted_mod_b();
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 52 | 50
+ list_part1 | 3 | 6 | 60
+ sub_part1 | 1 | 1 | 60
+ sub_part2 | 1 | 2 | 10
+(4 rows)
+
+-- This should do the tuple routing even though there is no explicit
+-- partition-key update, because there is a trigger on sub_part1.
+UPDATE list_parted set c = 70 WHERE b = 1;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 52 | 50
+ list_part1 | 3 | 6 | 60
+ sub_part2 | 1 | 2 | 10
+ sub_part2 | 1 | 2 | 70
+(4 rows)
+
+DROP TRIGGER parted_mod_b ON sub_part1;
+-- If BR DELETE trigger prevented DELETE from happening, we should also skip
+-- the INSERT if that delete is part of UPDATE=>DELETE+INSERT.
+CREATE OR REPLACE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ raise notice 'Trigger: Got OLD row %, but returning NULL', OLD;
+ return NULL;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER trig_skip_delete before delete on sub_part2
+ for each row execute procedure func_parted_mod_b();
+UPDATE list_parted set b = 1 WHERE c = 70;
+NOTICE: Trigger: Got OLD row (2,70,1), but returning NULL
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 52 | 50
+ list_part1 | 3 | 6 | 60
+ sub_part2 | 1 | 2 | 10
+ sub_part2 | 1 | 2 | 70
+(4 rows)
+
+-- Drop the trigger. Now the row should be moved.
+DROP TRIGGER trig_skip_delete ON sub_part2;
+UPDATE list_parted set b = 1 WHERE c = 70;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 52 | 50
+ list_part1 | 3 | 6 | 60
+ sub_part1 | 1 | 1 | 70
+ sub_part2 | 1 | 2 | 10
+(4 rows)
+
+DROP FUNCTION func_parted_mod_b();
+-- UPDATE partition-key with FROM clause. If join produces multiple output
+-- rows for the same row to be modified, we should tuple-route the row only
+-- once. There should not be any rows inserted.
+CREATE TABLE non_parted (id int);
+INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3);
+UPDATE list_parted t1 set a = 2 FROM non_parted t2 WHERE t1.a = t2.id and a = 1;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+ tableoid | a | b | c
+------------+---+----+----
+ list_part1 | 2 | 1 | 70
+ list_part1 | 2 | 2 | 10
+ list_part1 | 2 | 52 | 50
+ list_part1 | 3 | 6 | 60
+(4 rows)
+
+DROP TABLE non_parted;
+-- Cleanup: list_parted no longer needed.
+DROP TABLE list_parted;
+-- create custom operator class and hash function, for the same reason
+-- explained in alter_table.sql
+create or replace function dummy_hashint4(a int4, seed int8) returns int8 as
+$$ begin return (a + seed); end; $$ language 'plpgsql' immutable;
+create operator class custom_opclass for type int4 using hash as
+operator 1 = , function 2 dummy_hashint4(int4, int8);
+create table hash_parted (
+ a int,
+ b int
+) partition by hash (a custom_opclass, b custom_opclass);
+create table hpart1 partition of hash_parted for values with (modulus 2, remainder 1);
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+create table hpart3 partition of hash_parted for values with (modulus 8, remainder 0);
+create table hpart4 partition of hash_parted for values with (modulus 8, remainder 4);
+insert into hpart1 values (1, 1);
+insert into hpart2 values (2, 5);
+insert into hpart4 values (3, 4);
+-- fail
+update hpart1 set a = 3, b=4 where a = 1;
+ERROR: new row for relation "hpart1" violates partition constraint
+DETAIL: Failing row contains (3, 4).
+-- ok, row movement
+update hash_parted set b = b - 1 where b = 1;
+-- ok
+update hash_parted set b = b + 8 where b = 1;
+-- cleanup
+drop table hash_parted;
+drop operator class custom_opclass using hash;
+drop function dummy_hashint4(a int4, seed int8);
diff --git a/yql/essentials/tests/postgresql/original/cases/update.sql b/yql/essentials/tests/postgresql/original/cases/update.sql
new file mode 100644
index 0000000000..7a7bee77b9
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/update.sql
@@ -0,0 +1,669 @@
+--
+-- UPDATE syntax tests
+--
+
+CREATE TABLE update_test (
+ a INT DEFAULT 10,
+ b INT,
+ c TEXT
+);
+
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+);
+
+INSERT INTO update_test VALUES (5, 10, 'foo');
+INSERT INTO update_test(b, a) VALUES (15, 10);
+
+SELECT * FROM update_test;
+
+UPDATE update_test SET a = DEFAULT, b = DEFAULT;
+
+SELECT * FROM update_test;
+
+-- aliases for the UPDATE target table
+UPDATE update_test AS t SET b = 10 WHERE t.a = 10;
+
+SELECT * FROM update_test;
+
+UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+
+SELECT * FROM update_test;
+
+--
+-- Test VALUES in FROM
+--
+
+UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+
+SELECT * FROM update_test;
+
+-- fail, wrong data type:
+UPDATE update_test SET a = v.* FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+
+--
+-- Test multiple-set-clause syntax
+--
+
+INSERT INTO update_test SELECT a,b+1,c FROM update_test;
+SELECT * FROM update_test;
+
+UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo';
+SELECT * FROM update_test;
+UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10;
+SELECT * FROM update_test;
+-- fail, multi assignment to same column:
+UPDATE update_test SET (c,b) = ('car', a+b), b = a + 1 WHERE a = 10;
+
+-- uncorrelated sub-select:
+UPDATE update_test
+ SET (b,a) = (select a,b from update_test where b = 41 and c = 'car')
+ WHERE a = 100 AND b = 20;
+SELECT * FROM update_test;
+-- correlated sub-select:
+UPDATE update_test o
+ SET (b,a) = (select a+1,b from update_test i
+ where i.a=o.a and i.b=o.b and i.c is not distinct from o.c);
+SELECT * FROM update_test;
+-- fail, multiple rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test);
+-- set to null if no rows supplied:
+UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000)
+ WHERE a = 11;
+SELECT * FROM update_test;
+-- *-expansion should work in this context:
+UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j)
+ WHERE update_test.a = v.i;
+-- you might expect this to work, but syntactically it's not a RowExpr:
+UPDATE update_test SET (a,b) = (v.*) FROM (VALUES(21, 101)) AS v(i, j)
+ WHERE update_test.a = v.i;
+
+-- if an alias for the target table is specified, don't allow references
+-- to the original table name
+UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10;
+
+-- Make sure that we can update to a TOASTed value.
+UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car';
+SELECT a, b, char_length(c) FROM update_test;
+
+-- Check multi-assignment with a Result node to handle a one-time filter.
+EXPLAIN (VERBOSE, COSTS OFF)
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+UPDATE update_test t
+ SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a)
+ WHERE CURRENT_USER = SESSION_USER;
+SELECT a, b, char_length(c) FROM update_test;
+
+-- Test ON CONFLICT DO UPDATE
+
+INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo');
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+-- correlated sub-select:
+INSERT INTO upsert_test VALUES (1, 'Baz'), (3, 'Zaz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Correlated', a from upsert_test i WHERE i.a = upsert_test.a)
+ RETURNING *;
+-- correlated sub-select (EXCLUDED.* alias):
+INSERT INTO upsert_test VALUES (1, 'Bat'), (3, 'Zot') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING *;
+
+-- ON CONFLICT using system attributes in RETURNING, testing both the
+-- inserting and updating paths. See bug report at:
+-- https://www.postgresql.org/message-id/73436355-6432-49B1-92ED-1FE4F7E7E100%40finefun.com.au
+INSERT INTO upsert_test VALUES (2, 'Beeble') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = 0 AS xmax_correct;
+-- currently xmax is set after a conflict - that's probably not good,
+-- but it seems worthwhile to have to be explicit if that changes.
+INSERT INTO upsert_test VALUES (2, 'Brox') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b || ', Excluded', a from upsert_test i WHERE i.a = excluded.a)
+ RETURNING tableoid::regclass, xmin = pg_current_xact_id()::xid AS xmin_correct, xmax = pg_current_xact_id()::xid AS xmax_correct;
+
+DROP TABLE update_test;
+DROP TABLE upsert_test;
+
+-- Test ON CONFLICT DO UPDATE with partitioned table and non-identical children
+
+CREATE TABLE upsert_test (
+ a INT PRIMARY KEY,
+ b TEXT
+) PARTITION BY LIST (a);
+
+CREATE TABLE upsert_test_1 PARTITION OF upsert_test FOR VALUES IN (1);
+CREATE TABLE upsert_test_2 (b TEXT, a INT PRIMARY KEY);
+ALTER TABLE upsert_test ATTACH PARTITION upsert_test_2 FOR VALUES IN (2);
+
+INSERT INTO upsert_test VALUES(1, 'Boo'), (2, 'Zoo');
+-- uncorrelated sub-select:
+WITH aaa AS (SELECT 1 AS a, 'Foo' AS b) INSERT INTO upsert_test
+ VALUES (1, 'Bar') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT b, a FROM aaa) RETURNING *;
+-- correlated sub-select:
+WITH aaa AS (SELECT 1 AS ctea, ' Foo' AS cteb) INSERT INTO upsert_test
+ VALUES (1, 'Bar'), (2, 'Baz') ON CONFLICT(a)
+ DO UPDATE SET (b, a) = (SELECT upsert_test.b||cteb, upsert_test.a FROM aaa) RETURNING *;
+
+DROP TABLE upsert_test;
+
+
+---------------------------
+-- UPDATE with row movement
+---------------------------
+
+-- When a partitioned table receives an UPDATE to the partitioned key and the
+-- new values no longer meet the partition's bound, the row must be moved to
+-- the correct partition for the new partition key (if one exists). We must
+-- also ensure that updatable views on partitioned tables properly enforce any
+-- WITH CHECK OPTION that is defined. The situation with triggers in this case
+-- also requires thorough testing as partition key updates causing row
+-- movement convert UPDATEs into DELETE+INSERT.
+
+CREATE TABLE range_parted (
+ a text,
+ b bigint,
+ c numeric,
+ d int,
+ e varchar
+) PARTITION BY RANGE (a, b);
+
+-- Create partitions intentionally in descending bound order, so as to test
+-- that update-row-movement works with the leaf partitions not in bound order.
+CREATE TABLE part_b_20_b_30 (e varchar, c numeric, a text, b bigint, d int);
+ALTER TABLE range_parted ATTACH PARTITION part_b_20_b_30 FOR VALUES FROM ('b', 20) TO ('b', 30);
+CREATE TABLE part_b_10_b_20 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY RANGE (c);
+CREATE TABLE part_b_1_b_10 PARTITION OF range_parted FOR VALUES FROM ('b', 1) TO ('b', 10);
+ALTER TABLE range_parted ATTACH PARTITION part_b_10_b_20 FOR VALUES FROM ('b', 10) TO ('b', 20);
+CREATE TABLE part_a_10_a_20 PARTITION OF range_parted FOR VALUES FROM ('a', 10) TO ('a', 20);
+CREATE TABLE part_a_1_a_10 PARTITION OF range_parted FOR VALUES FROM ('a', 1) TO ('a', 10);
+
+-- Check that partition-key UPDATE works sanely on a partitioned table that
+-- does not have any child partitions.
+UPDATE part_b_10_b_20 set b = b - 6;
+
+-- Create some more partitions following the above pattern of descending bound
+-- order, but let's make the situation a bit more complex by having the
+-- attribute numbers of the columns vary from their parent partition.
+CREATE TABLE part_c_100_200 (e varchar, c numeric, a text, b bigint, d int) PARTITION BY range (abs(d));
+ALTER TABLE part_c_100_200 DROP COLUMN e, DROP COLUMN c, DROP COLUMN a;
+ALTER TABLE part_c_100_200 ADD COLUMN c numeric, ADD COLUMN e varchar, ADD COLUMN a text;
+ALTER TABLE part_c_100_200 DROP COLUMN b;
+ALTER TABLE part_c_100_200 ADD COLUMN b bigint;
+CREATE TABLE part_d_1_15 PARTITION OF part_c_100_200 FOR VALUES FROM (1) TO (15);
+CREATE TABLE part_d_15_20 PARTITION OF part_c_100_200 FOR VALUES FROM (15) TO (20);
+
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_100_200 FOR VALUES FROM (100) TO (200);
+
+CREATE TABLE part_c_1_100 (e varchar, d int, c numeric, b bigint, a text);
+ALTER TABLE part_b_10_b_20 ATTACH PARTITION part_c_1_100 FOR VALUES FROM (1) TO (100);
+
+\set init_range_parted 'truncate range_parted; insert into range_parted VALUES (''a'', 1, 1, 1), (''a'', 10, 200, 1), (''b'', 12, 96, 1), (''b'', 13, 97, 2), (''b'', 15, 105, 16), (''b'', 17, 105, 19)'
+\set show_data 'select tableoid::regclass::text COLLATE "C" partname, * from range_parted ORDER BY 1, 2, 3, 4, 5, 6'
+:init_range_parted;
+:show_data;
+
+-- The order of subplans should be in bound order
+EXPLAIN (costs off) UPDATE range_parted set c = c - 50 WHERE c > 97;
+
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_c_100_200 set c = c - 20, d = c WHERE c = 105;
+-- fail, no partition key update, so no attempt to move tuple,
+-- but "a = 'a'" violates partition constraint enforced by root partition)
+UPDATE part_b_10_b_20 set a = 'a';
+-- ok, partition key update, no constraint violation
+UPDATE range_parted set d = d - 10 WHERE d > 10;
+-- ok, no partition key update, no constraint violation
+UPDATE range_parted set e = d;
+-- No row found
+UPDATE part_c_1_100 set c = c + 20 WHERE c = 98;
+-- ok, row movement
+UPDATE part_b_10_b_20 set c = c + 20 returning c, b, a;
+:show_data;
+
+-- fail, row movement happens only within the partition subtree.
+UPDATE part_b_10_b_20 set b = b - 6 WHERE c > 116 returning *;
+-- ok, row movement, with subset of rows moved into different partition.
+UPDATE range_parted set b = b - 6 WHERE c > 116 returning a, b + c;
+
+:show_data;
+
+-- Common table needed for multiple test scenarios.
+CREATE TABLE mintab(c1 int);
+INSERT into mintab VALUES (120);
+
+-- update partition key using updatable view.
+CREATE VIEW upview AS SELECT * FROM range_parted WHERE (select c > c1 FROM mintab) WITH CHECK OPTION;
+-- ok
+UPDATE upview set c = 199 WHERE b = 4;
+-- fail, check option violation
+UPDATE upview set c = 120 WHERE b = 4;
+-- fail, row movement with check option violation
+UPDATE upview set a = 'b', b = 15, c = 120 WHERE b = 4;
+-- ok, row movement, check option passes
+UPDATE upview set a = 'b', b = 15 WHERE b = 4;
+
+:show_data;
+
+-- cleanup
+DROP VIEW upview;
+
+-- RETURNING having whole-row vars.
+:init_range_parted;
+UPDATE range_parted set c = 95 WHERE a = 'b' and b > 10 and c > 100 returning (range_parted), *;
+:show_data;
+
+
+-- Transition tables with update row movement
+:init_range_parted;
+
+CREATE FUNCTION trans_updatetrigfunc() RETURNS trigger LANGUAGE plpgsql AS
+$$
+ begin
+ raise notice 'trigger = %, old table = %, new table = %',
+ TG_NAME,
+ (select string_agg(old_table::text, ', ' ORDER BY a) FROM old_table),
+ (select string_agg(new_table::text, ', ' ORDER BY a) FROM new_table);
+ return null;
+ end;
+$$;
+
+CREATE TRIGGER trans_updatetrig
+ AFTER UPDATE ON range_parted REFERENCING OLD TABLE AS old_table NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end ) WHERE a = 'b' and b > 10 and c >= 96;
+:show_data;
+:init_range_parted;
+
+-- Enabling OLD TABLE capture for both DELETE as well as UPDATE stmt triggers
+-- should not cause DELETEd rows to be captured twice. Similar thing for
+-- INSERT triggers and inserted rows.
+CREATE TRIGGER trans_deletetrig
+ AFTER DELETE ON range_parted REFERENCING OLD TABLE AS old_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+CREATE TRIGGER trans_inserttrig
+ AFTER INSERT ON range_parted REFERENCING NEW TABLE AS new_table
+ FOR EACH STATEMENT EXECUTE PROCEDURE trans_updatetrigfunc();
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+:show_data;
+DROP TRIGGER trans_deletetrig ON range_parted;
+DROP TRIGGER trans_inserttrig ON range_parted;
+-- Don't drop trans_updatetrig yet. It is required below.
+
+-- Test with transition tuple conversion happening for rows moved into the
+-- new partition. This requires a trigger that references transition table
+-- (we already have trans_updatetrig). For inserted rows, the conversion
+-- is not usually needed, because the original tuple is already compatible with
+-- the desired transition tuple format. But conversion happens when there is a
+-- BR trigger because the trigger can change the inserted row. So install a
+-- BR triggers on those child partitions where the rows will be moved.
+CREATE FUNCTION func_parted_mod_b() RETURNS trigger AS $$
+BEGIN
+ NEW.b = NEW.b + 1;
+ return NEW;
+END $$ language plpgsql;
+CREATE TRIGGER trig_c1_100 BEFORE UPDATE OR INSERT ON part_c_1_100
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+CREATE TRIGGER trig_d1_15 BEFORE UPDATE OR INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+CREATE TRIGGER trig_d15_20 BEFORE UPDATE OR INSERT ON part_d_15_20
+ FOR EACH ROW EXECUTE PROCEDURE func_parted_mod_b();
+:init_range_parted;
+UPDATE range_parted set c = (case when c = 96 then 110 else c + 1 end) WHERE a = 'b' and b > 10 and c >= 96;
+:show_data;
+:init_range_parted;
+UPDATE range_parted set c = c + 50 WHERE a = 'b' and b > 10 and c >= 96;
+:show_data;
+
+-- Case where per-partition tuple conversion map array is allocated, but the
+-- map is not required for the particular tuple that is routed, thanks to
+-- matching table attributes of the partition and the target table.
+:init_range_parted;
+UPDATE range_parted set b = 15 WHERE b = 1;
+:show_data;
+
+DROP TRIGGER trans_updatetrig ON range_parted;
+DROP TRIGGER trig_c1_100 ON part_c_1_100;
+DROP TRIGGER trig_d1_15 ON part_d_1_15;
+DROP TRIGGER trig_d15_20 ON part_d_15_20;
+DROP FUNCTION func_parted_mod_b();
+
+-- RLS policies with update-row-movement
+-----------------------------------------
+
+ALTER TABLE range_parted ENABLE ROW LEVEL SECURITY;
+CREATE USER regress_range_parted_user;
+GRANT ALL ON range_parted, mintab TO regress_range_parted_user;
+CREATE POLICY seeall ON range_parted AS PERMISSIVE FOR SELECT USING (true);
+CREATE POLICY policy_range_parted ON range_parted for UPDATE USING (true) WITH CHECK (c % 2 = 0);
+
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- This should fail with RLS violation error while moving row from
+-- part_a_10_a_20 to part_d_1_15, because we are setting 'c' to an odd number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+
+RESET SESSION AUTHORIZATION;
+-- Create a trigger on part_d_1_15
+CREATE FUNCTION func_d_1_15() RETURNS trigger AS $$
+BEGIN
+ NEW.c = NEW.c + 1; -- Make even numbers odd, or vice versa
+ return NEW;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER trig_d_1_15 BEFORE INSERT ON part_d_1_15
+ FOR EACH ROW EXECUTE PROCEDURE func_d_1_15();
+
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+
+-- Here, RLS checks should succeed while moving row from part_a_10_a_20 to
+-- part_d_1_15. Even though the UPDATE is setting 'c' to an odd number, the
+-- trigger at the destination partition again makes it an even number.
+UPDATE range_parted set a = 'b', c = 151 WHERE a = 'a' and c = 200;
+
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- This should fail with RLS violation error. Even though the UPDATE is setting
+-- 'c' to an even number, the trigger at the destination partition again makes
+-- it an odd number.
+UPDATE range_parted set a = 'b', c = 150 WHERE a = 'a' and c = 200;
+
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+DROP TRIGGER trig_d_1_15 ON part_d_1_15;
+DROP FUNCTION func_d_1_15();
+
+-- Policy expression contains SubPlan
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+CREATE POLICY policy_range_parted_subplan on range_parted
+ AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK ((SELECT range_parted.c <= c1 FROM mintab));
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- fail, mintab has row with c1 = 120
+UPDATE range_parted set a = 'b', c = 122 WHERE a = 'a' and c = 200;
+-- ok
+UPDATE range_parted set a = 'b', c = 120 WHERE a = 'a' and c = 200;
+
+-- RLS policy expression contains whole row.
+
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+CREATE POLICY policy_range_parted_wholerow on range_parted AS RESTRICTIVE for UPDATE USING (true)
+ WITH CHECK (range_parted = row('b', 10, 112, 1, NULL)::range_parted);
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- ok, should pass the RLS check
+UPDATE range_parted set a = 'b', c = 112 WHERE a = 'a' and c = 200;
+RESET SESSION AUTHORIZATION;
+:init_range_parted;
+SET SESSION AUTHORIZATION regress_range_parted_user;
+-- fail, the whole row RLS check should fail
+UPDATE range_parted set a = 'b', c = 116 WHERE a = 'a' and c = 200;
+
+-- Cleanup
+RESET SESSION AUTHORIZATION;
+DROP POLICY policy_range_parted ON range_parted;
+DROP POLICY policy_range_parted_subplan ON range_parted;
+DROP POLICY policy_range_parted_wholerow ON range_parted;
+REVOKE ALL ON range_parted, mintab FROM regress_range_parted_user;
+DROP USER regress_range_parted_user;
+DROP TABLE mintab;
+
+
+-- statement triggers with update row movement
+---------------------------------------------------
+
+:init_range_parted;
+
+CREATE FUNCTION trigfunc() returns trigger language plpgsql as
+$$
+ begin
+ raise notice 'trigger = % fired on table % during %',
+ TG_NAME, TG_TABLE_NAME, TG_OP;
+ return null;
+ end;
+$$;
+-- Triggers on root partition
+CREATE TRIGGER parent_delete_trig
+ AFTER DELETE ON range_parted for each statement execute procedure trigfunc();
+CREATE TRIGGER parent_update_trig
+ AFTER UPDATE ON range_parted for each statement execute procedure trigfunc();
+CREATE TRIGGER parent_insert_trig
+ AFTER INSERT ON range_parted for each statement execute procedure trigfunc();
+
+-- Triggers on leaf partition part_c_1_100
+CREATE TRIGGER c1_delete_trig
+ AFTER DELETE ON part_c_1_100 for each statement execute procedure trigfunc();
+CREATE TRIGGER c1_update_trig
+ AFTER UPDATE ON part_c_1_100 for each statement execute procedure trigfunc();
+CREATE TRIGGER c1_insert_trig
+ AFTER INSERT ON part_c_1_100 for each statement execute procedure trigfunc();
+
+-- Triggers on leaf partition part_d_1_15
+CREATE TRIGGER d1_delete_trig
+ AFTER DELETE ON part_d_1_15 for each statement execute procedure trigfunc();
+CREATE TRIGGER d1_update_trig
+ AFTER UPDATE ON part_d_1_15 for each statement execute procedure trigfunc();
+CREATE TRIGGER d1_insert_trig
+ AFTER INSERT ON part_d_1_15 for each statement execute procedure trigfunc();
+-- Triggers on leaf partition part_d_15_20
+CREATE TRIGGER d15_delete_trig
+ AFTER DELETE ON part_d_15_20 for each statement execute procedure trigfunc();
+CREATE TRIGGER d15_update_trig
+ AFTER UPDATE ON part_d_15_20 for each statement execute procedure trigfunc();
+CREATE TRIGGER d15_insert_trig
+ AFTER INSERT ON part_d_15_20 for each statement execute procedure trigfunc();
+
+-- Move all rows from part_c_100_200 to part_c_1_100. None of the delete or
+-- insert statement triggers should be fired.
+UPDATE range_parted set c = c - 50 WHERE c > 97;
+:show_data;
+
+DROP TRIGGER parent_delete_trig ON range_parted;
+DROP TRIGGER parent_update_trig ON range_parted;
+DROP TRIGGER parent_insert_trig ON range_parted;
+DROP TRIGGER c1_delete_trig ON part_c_1_100;
+DROP TRIGGER c1_update_trig ON part_c_1_100;
+DROP TRIGGER c1_insert_trig ON part_c_1_100;
+DROP TRIGGER d1_delete_trig ON part_d_1_15;
+DROP TRIGGER d1_update_trig ON part_d_1_15;
+DROP TRIGGER d1_insert_trig ON part_d_1_15;
+DROP TRIGGER d15_delete_trig ON part_d_15_20;
+DROP TRIGGER d15_update_trig ON part_d_15_20;
+DROP TRIGGER d15_insert_trig ON part_d_15_20;
+
+
+-- Creating default partition for range
+:init_range_parted;
+create table part_def partition of range_parted default;
+\d+ part_def
+insert into range_parted values ('c', 9);
+-- ok
+update part_def set a = 'd' where a = 'c';
+-- fail
+update part_def set a = 'a' where a = 'd';
+
+:show_data;
+
+-- Update row movement from non-default to default partition.
+-- fail, default partition is not under part_a_10_a_20;
+UPDATE part_a_10_a_20 set a = 'ad' WHERE a = 'a';
+-- ok
+UPDATE range_parted set a = 'ad' WHERE a = 'a';
+UPDATE range_parted set a = 'bd' WHERE a = 'b';
+:show_data;
+-- Update row movement from default to non-default partitions.
+-- ok
+UPDATE range_parted set a = 'a' WHERE a = 'ad';
+UPDATE range_parted set a = 'b' WHERE a = 'bd';
+:show_data;
+
+-- Cleanup: range_parted no longer needed.
+DROP TABLE range_parted;
+
+CREATE TABLE list_parted (
+ a text,
+ b int
+) PARTITION BY list (a);
+CREATE TABLE list_part1 PARTITION OF list_parted for VALUES in ('a', 'b');
+CREATE TABLE list_default PARTITION OF list_parted default;
+INSERT into list_part1 VALUES ('a', 1);
+INSERT into list_default VALUES ('d', 10);
+
+-- fail
+UPDATE list_default set a = 'a' WHERE a = 'd';
+-- ok
+UPDATE list_default set a = 'x' WHERE a = 'd';
+
+DROP TABLE list_parted;
+
+-- Test retrieval of system columns with non-consistent partition row types.
+-- This is only partially supported, as seen in the results.
+
+create table utrtest (a int, b text) partition by list (a);
+create table utr1 (a int check (a in (1)), q text, b text);
+create table utr2 (a int check (a in (2)), b text);
+alter table utr1 drop column q;
+alter table utrtest attach partition utr1 for values in (1);
+alter table utrtest attach partition utr2 for values in (2);
+
+insert into utrtest values (1, 'foo')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+insert into utrtest values (2, 'bar')
+ returning *, tableoid::regclass;
+
+update utrtest set b = b || b from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok;
+
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass, xmin = pg_current_xact_id()::xid as xmin_ok; -- fails
+
+update utrtest set a = 3 - a from (values (1), (2)) s(x) where a = s.x
+ returning *, tableoid::regclass;
+
+delete from utrtest
+ returning *, tableoid::regclass, xmax = pg_current_xact_id()::xid as xmax_ok;
+
+drop table utrtest;
+
+
+--------------
+-- Some more update-partition-key test scenarios below. This time use list
+-- partitions.
+--------------
+
+-- Setup for list partitions
+CREATE TABLE list_parted (a numeric, b int, c int8) PARTITION BY list (a);
+CREATE TABLE sub_parted PARTITION OF list_parted for VALUES in (1) PARTITION BY list (b);
+
+CREATE TABLE sub_part1(b int, c int8, a numeric);
+ALTER TABLE sub_parted ATTACH PARTITION sub_part1 for VALUES in (1);
+CREATE TABLE sub_part2(b int, c int8, a numeric);
+ALTER TABLE sub_parted ATTACH PARTITION sub_part2 for VALUES in (2);
+
+CREATE TABLE list_part1(a numeric, b int, c int8);
+ALTER TABLE list_parted ATTACH PARTITION list_part1 for VALUES in (2,3);
+
+INSERT into list_parted VALUES (2,5,50);
+INSERT into list_parted VALUES (3,6,60);
+INSERT into sub_parted VALUES (1,1,60);
+INSERT into sub_parted VALUES (1,2,10);
+
+-- Test partition constraint violation when intermediate ancestor is used and
+-- constraint is inherited from upper root.
+UPDATE sub_parted set a = 2 WHERE c = 10;
+
+-- Test update-partition-key, where the unpruned partitions do not have their
+-- partition keys updated.
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+UPDATE list_parted set b = c + a WHERE a = 2;
+SELECT tableoid::regclass::text, * FROM list_parted WHERE a = 2 ORDER BY 1;
+
+
+-- Test the case where BR UPDATE triggers change the partition key.
+CREATE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ NEW.b = 2; -- This is changing partition key column.
+ return NEW;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER parted_mod_b before update on sub_part1
+ for each row execute procedure func_parted_mod_b();
+
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+
+-- This should do the tuple routing even though there is no explicit
+-- partition-key update, because there is a trigger on sub_part1.
+UPDATE list_parted set c = 70 WHERE b = 1;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+
+DROP TRIGGER parted_mod_b ON sub_part1;
+
+-- If BR DELETE trigger prevented DELETE from happening, we should also skip
+-- the INSERT if that delete is part of UPDATE=>DELETE+INSERT.
+CREATE OR REPLACE FUNCTION func_parted_mod_b() returns trigger as $$
+BEGIN
+ raise notice 'Trigger: Got OLD row %, but returning NULL', OLD;
+ return NULL;
+END $$ LANGUAGE plpgsql;
+CREATE TRIGGER trig_skip_delete before delete on sub_part2
+ for each row execute procedure func_parted_mod_b();
+UPDATE list_parted set b = 1 WHERE c = 70;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+-- Drop the trigger. Now the row should be moved.
+DROP TRIGGER trig_skip_delete ON sub_part2;
+UPDATE list_parted set b = 1 WHERE c = 70;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+DROP FUNCTION func_parted_mod_b();
+
+-- UPDATE partition-key with FROM clause. If join produces multiple output
+-- rows for the same row to be modified, we should tuple-route the row only
+-- once. There should not be any rows inserted.
+CREATE TABLE non_parted (id int);
+INSERT into non_parted VALUES (1), (1), (1), (2), (2), (2), (3), (3), (3);
+UPDATE list_parted t1 set a = 2 FROM non_parted t2 WHERE t1.a = t2.id and a = 1;
+SELECT tableoid::regclass::text, * FROM list_parted ORDER BY 1, 2, 3, 4;
+DROP TABLE non_parted;
+
+-- Cleanup: list_parted no longer needed.
+DROP TABLE list_parted;
+
+-- create custom operator class and hash function, for the same reason
+-- explained in alter_table.sql
+create or replace function dummy_hashint4(a int4, seed int8) returns int8 as
+$$ begin return (a + seed); end; $$ language 'plpgsql' immutable;
+create operator class custom_opclass for type int4 using hash as
+operator 1 = , function 2 dummy_hashint4(int4, int8);
+
+create table hash_parted (
+ a int,
+ b int
+) partition by hash (a custom_opclass, b custom_opclass);
+create table hpart1 partition of hash_parted for values with (modulus 2, remainder 1);
+create table hpart2 partition of hash_parted for values with (modulus 4, remainder 2);
+create table hpart3 partition of hash_parted for values with (modulus 8, remainder 0);
+create table hpart4 partition of hash_parted for values with (modulus 8, remainder 4);
+insert into hpart1 values (1, 1);
+insert into hpart2 values (2, 5);
+insert into hpart4 values (3, 4);
+
+-- fail
+update hpart1 set a = 3, b=4 where a = 1;
+-- ok, row movement
+update hash_parted set b = b - 1 where b = 1;
+-- ok
+update hash_parted set b = b + 8 where b = 1;
+
+-- cleanup
+drop table hash_parted;
+drop operator class custom_opclass using hash;
+drop function dummy_hashint4(a int4, seed int8);
diff --git a/yql/essentials/tests/postgresql/original/cases/uuid.out b/yql/essentials/tests/postgresql/original/cases/uuid.out
new file mode 100644
index 0000000000..090103df48
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/uuid.out
@@ -0,0 +1,159 @@
+-- regression test for the uuid datatype
+-- creating test tables
+CREATE TABLE guid1
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+CREATE TABLE guid2
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+-- inserting invalid data tests
+-- too long
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F');
+ERROR: invalid input syntax for type uuid: "11111111-1111-1111-1111-111111111111F"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-111...
+ ^
+-- too short
+INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}');
+ERROR: invalid input syntax for type uuid: "{11111111-1111-1111-1111-11111111111}"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-11...
+ ^
+-- valid data but invalid format
+INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111');
+ERROR: invalid input syntax for type uuid: "111-11111-1111-1111-1111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-11...
+ ^
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+ERROR: invalid input syntax for type uuid: "{22222222-2222-2222-2222-222222222222 "
+LINE 1: INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-22...
+ ^
+-- invalid data
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111');
+ERROR: invalid input syntax for type uuid: "11111111-1111-1111-G111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G11...
+ ^
+INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+ERROR: invalid input syntax for type uuid: "11+11111-1111-1111-1111-111111111111"
+LINE 1: INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-111...
+ ^
+--inserting three input formats
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+-- retrieving the inserted data
+SELECT guid_field FROM guid1;
+ guid_field
+--------------------------------------
+ 11111111-1111-1111-1111-111111111111
+ 22222222-2222-2222-2222-222222222222
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+(3 rows)
+
+-- ordering test
+SELECT guid_field FROM guid1 ORDER BY guid_field ASC;
+ guid_field
+--------------------------------------
+ 11111111-1111-1111-1111-111111111111
+ 22222222-2222-2222-2222-222222222222
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+(3 rows)
+
+SELECT guid_field FROM guid1 ORDER BY guid_field DESC;
+ guid_field
+--------------------------------------
+ 3f3e3c3b-3a30-3938-3736-353433a2313e
+ 22222222-2222-2222-2222-222222222222
+ 11111111-1111-1111-1111-111111111111
+(3 rows)
+
+-- = operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e';
+ count
+-------
+ 1
+(1 row)
+
+-- <> operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111';
+ count
+-------
+ 2
+(1 row)
+
+-- < operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 1
+(1 row)
+
+-- <= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 2
+(1 row)
+
+-- > operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 1
+(1 row)
+
+-- >= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222';
+ count
+-------
+ 2
+(1 row)
+
+-- btree and hash index creation test
+CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
+CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
+-- unique index test
+CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
+-- should fail
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+ERROR: duplicate key value violates unique constraint "guid1_unique_btree"
+DETAIL: Key (guid_field)=(11111111-1111-1111-1111-111111111111) already exists.
+-- check to see whether the new indexes are actually there
+SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
+ count
+-------
+ 3
+(1 row)
+
+-- populating the test tables with additional records
+INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444');
+INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+-- join test
+SELECT COUNT(*) FROM guid1 g1 INNER JOIN guid2 g2 ON g1.guid_field = g2.guid_field;
+ count
+-------
+ 3
+(1 row)
+
+SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL;
+ count
+-------
+ 1
+(1 row)
+
+-- generation test
+TRUNCATE guid1;
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+SELECT count(DISTINCT guid_field) FROM guid1;
+ count
+-------
+ 2
+(1 row)
+
+-- clean up
+DROP TABLE guid1, guid2 CASCADE;
diff --git a/yql/essentials/tests/postgresql/original/cases/uuid.sql b/yql/essentials/tests/postgresql/original/cases/uuid.sql
new file mode 100644
index 0000000000..3bd3b357c7
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/uuid.sql
@@ -0,0 +1,85 @@
+-- regression test for the uuid datatype
+-- creating test tables
+CREATE TABLE guid1
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+CREATE TABLE guid2
+(
+ guid_field UUID,
+ text_field TEXT DEFAULT(now())
+);
+
+-- inserting invalid data tests
+-- too long
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F');
+-- too short
+INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}');
+-- valid data but invalid format
+INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 ');
+-- invalid data
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111');
+
+--inserting three input formats
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+
+-- retrieving the inserted data
+SELECT guid_field FROM guid1;
+
+-- ordering test
+SELECT guid_field FROM guid1 ORDER BY guid_field ASC;
+SELECT guid_field FROM guid1 ORDER BY guid_field DESC;
+
+-- = operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e';
+
+-- <> operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111';
+
+-- < operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222';
+
+-- <= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222';
+
+-- > operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222';
+
+-- >= operator test
+SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222';
+
+-- btree and hash index creation test
+CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
+CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
+
+-- unique index test
+CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
+-- should fail
+INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+
+-- check to see whether the new indexes are actually there
+SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
+
+-- populating the test tables with additional records
+INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444');
+INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
+INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}');
+INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e');
+
+-- join test
+SELECT COUNT(*) FROM guid1 g1 INNER JOIN guid2 g2 ON g1.guid_field = g2.guid_field;
+SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL;
+
+-- generation test
+TRUNCATE guid1;
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+INSERT INTO guid1 (guid_field) VALUES (gen_random_uuid());
+SELECT count(DISTINCT guid_field) FROM guid1;
+
+-- clean up
+DROP TABLE guid1, guid2 CASCADE;
diff --git a/yql/essentials/tests/postgresql/original/cases/varchar.out b/yql/essentials/tests/postgresql/original/cases/varchar.out
new file mode 100644
index 0000000000..da23ae810b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/varchar.out
@@ -0,0 +1,111 @@
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character varying(1)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+(5 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+(6 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ c
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ c
+(2 rows)
+
+DROP TABLE VARCHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character varying(4)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/varchar.sql b/yql/essentials/tests/postgresql/original/cases/varchar.sql
new file mode 100644
index 0000000000..35e24b84d3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/varchar.sql
@@ -0,0 +1,66 @@
+--
+-- VARCHAR
+--
+
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+
+
+SELECT * FROM VARCHAR_TBL;
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+
+DROP TABLE VARCHAR_TBL;
+
+--
+-- Now test longer arrays of char
+--
+
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+
+SELECT * FROM VARCHAR_TBL;
diff --git a/yql/essentials/tests/postgresql/original/cases/varchar_1.out b/yql/essentials/tests/postgresql/original/cases/varchar_1.out
new file mode 100644
index 0000000000..958f9c07e0
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/varchar_1.out
@@ -0,0 +1,111 @@
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character varying(1)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+ 1
+ 2
+ 3
+
+(4 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+ 1
+ 2
+ 3
+
+(5 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ A
+ c
+(2 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ A
+ c
+(3 rows)
+
+DROP TABLE VARCHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character varying(4)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/varchar_2.out b/yql/essentials/tests/postgresql/original/cases/varchar_2.out
new file mode 100644
index 0000000000..b1d412ca00
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/varchar_2.out
@@ -0,0 +1,111 @@
+--
+-- VARCHAR
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(1));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('A');
+-- any of the following three input formats are acceptable
+INSERT INTO VARCHAR_TBL (f1) VALUES ('1');
+INSERT INTO VARCHAR_TBL (f1) VALUES (2);
+INSERT INTO VARCHAR_TBL (f1) VALUES ('3');
+-- zero-length char
+INSERT INTO VARCHAR_TBL (f1) VALUES ('');
+-- try varchar's of greater than 1 length
+INSERT INTO VARCHAR_TBL (f1) VALUES ('cd');
+ERROR: value too long for type character varying(1)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('c ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+
+ c
+(7 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <> 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+
+ c
+(6 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 = 'a';
+ f1
+----
+ a
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 < 'a';
+ f1
+----
+
+(1 row)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 <= 'a';
+ f1
+----
+ a
+
+(2 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 > 'a';
+ f1
+----
+ A
+ 1
+ 2
+ 3
+ c
+(5 rows)
+
+SELECT c.*
+ FROM VARCHAR_TBL c
+ WHERE c.f1 >= 'a';
+ f1
+----
+ a
+ A
+ 1
+ 2
+ 3
+ c
+(6 rows)
+
+DROP TABLE VARCHAR_TBL;
+--
+-- Now test longer arrays of char
+--
+CREATE TABLE VARCHAR_TBL(f1 varchar(4));
+INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcde');
+ERROR: value too long for type character varying(4)
+INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd ');
+SELECT * FROM VARCHAR_TBL;
+ f1
+------
+ a
+ ab
+ abcd
+ abcd
+(4 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/window.out b/yql/essentials/tests/postgresql/original/cases/window.out
new file mode 100644
index 0000000000..19e2ac518a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/window.out
@@ -0,0 +1,4065 @@
+--
+-- WINDOW FUNCTIONS
+--
+CREATE TEMPORARY TABLE empsalary (
+ depname varchar,
+ empno bigint,
+ salary int,
+ enroll_date date
+);
+INSERT INTO empsalary VALUES
+('develop', 10, 5200, '2007-08-01'),
+('sales', 1, 5000, '2006-10-01'),
+('personnel', 5, 3500, '2007-12-10'),
+('sales', 4, 4800, '2007-08-08'),
+('personnel', 2, 3900, '2006-12-23'),
+('develop', 7, 4200, '2008-01-01'),
+('develop', 9, 4500, '2008-01-01'),
+('sales', 3, 4800, '2007-08-01'),
+('develop', 8, 6000, '2006-10-01'),
+('develop', 11, 5200, '2007-08-15');
+SELECT depname, empno, salary, sum(salary) OVER (PARTITION BY depname) FROM empsalary ORDER BY depname, salary;
+ depname | empno | salary | sum
+-----------+-------+--------+-------
+ develop | 7 | 4200 | 25100
+ develop | 9 | 4500 | 25100
+ develop | 11 | 5200 | 25100
+ develop | 10 | 5200 | 25100
+ develop | 8 | 6000 | 25100
+ personnel | 5 | 3500 | 7400
+ personnel | 2 | 3900 | 7400
+ sales | 3 | 4800 | 14600
+ sales | 4 | 4800 | 14600
+ sales | 1 | 5000 | 14600
+(10 rows)
+
+SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary) FROM empsalary;
+ depname | empno | salary | rank
+-----------+-------+--------+------
+ develop | 7 | 4200 | 1
+ develop | 9 | 4500 | 2
+ develop | 11 | 5200 | 3
+ develop | 10 | 5200 | 3
+ develop | 8 | 6000 | 5
+ personnel | 5 | 3500 | 1
+ personnel | 2 | 3900 | 2
+ sales | 3 | 4800 | 1
+ sales | 4 | 4800 | 1
+ sales | 1 | 5000 | 3
+(10 rows)
+
+-- with GROUP BY
+SELECT four, ten, SUM(SUM(four)) OVER (PARTITION BY four), AVG(ten) FROM tenk1
+GROUP BY four, ten ORDER BY four, ten;
+ four | ten | sum | avg
+------+-----+------+------------------------
+ 0 | 0 | 0 | 0.00000000000000000000
+ 0 | 2 | 0 | 2.0000000000000000
+ 0 | 4 | 0 | 4.0000000000000000
+ 0 | 6 | 0 | 6.0000000000000000
+ 0 | 8 | 0 | 8.0000000000000000
+ 1 | 1 | 2500 | 1.00000000000000000000
+ 1 | 3 | 2500 | 3.0000000000000000
+ 1 | 5 | 2500 | 5.0000000000000000
+ 1 | 7 | 2500 | 7.0000000000000000
+ 1 | 9 | 2500 | 9.0000000000000000
+ 2 | 0 | 5000 | 0.00000000000000000000
+ 2 | 2 | 5000 | 2.0000000000000000
+ 2 | 4 | 5000 | 4.0000000000000000
+ 2 | 6 | 5000 | 6.0000000000000000
+ 2 | 8 | 5000 | 8.0000000000000000
+ 3 | 1 | 7500 | 1.00000000000000000000
+ 3 | 3 | 7500 | 3.0000000000000000
+ 3 | 5 | 7500 | 5.0000000000000000
+ 3 | 7 | 7500 | 7.0000000000000000
+ 3 | 9 | 7500 | 9.0000000000000000
+(20 rows)
+
+SELECT depname, empno, salary, sum(salary) OVER w FROM empsalary WINDOW w AS (PARTITION BY depname);
+ depname | empno | salary | sum
+-----------+-------+--------+-------
+ develop | 11 | 5200 | 25100
+ develop | 7 | 4200 | 25100
+ develop | 9 | 4500 | 25100
+ develop | 8 | 6000 | 25100
+ develop | 10 | 5200 | 25100
+ personnel | 5 | 3500 | 7400
+ personnel | 2 | 3900 | 7400
+ sales | 3 | 4800 | 14600
+ sales | 1 | 5000 | 14600
+ sales | 4 | 4800 | 14600
+(10 rows)
+
+SELECT depname, empno, salary, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary) ORDER BY rank() OVER w;
+ depname | empno | salary | rank
+-----------+-------+--------+------
+ develop | 7 | 4200 | 1
+ personnel | 5 | 3500 | 1
+ sales | 3 | 4800 | 1
+ sales | 4 | 4800 | 1
+ personnel | 2 | 3900 | 2
+ develop | 9 | 4500 | 2
+ sales | 1 | 5000 | 3
+ develop | 11 | 5200 | 3
+ develop | 10 | 5200 | 3
+ develop | 8 | 6000 | 5
+(10 rows)
+
+-- empty window specification
+SELECT COUNT(*) OVER () FROM tenk1 WHERE unique2 < 10;
+ count
+-------
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+(10 rows)
+
+SELECT COUNT(*) OVER w FROM tenk1 WHERE unique2 < 10 WINDOW w AS ();
+ count
+-------
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+ 10
+(10 rows)
+
+-- no window operation
+SELECT four FROM tenk1 WHERE FALSE WINDOW w AS (PARTITION BY ten);
+ four
+------
+(0 rows)
+
+-- cumulative aggregate
+SELECT sum(four) OVER (PARTITION BY ten ORDER BY unique2) AS sum_1, ten, four FROM tenk1 WHERE unique2 < 10;
+ sum_1 | ten | four
+-------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 2 | 0 | 2
+ 3 | 1 | 3
+ 4 | 1 | 1
+ 5 | 1 | 1
+ 3 | 3 | 3
+ 0 | 4 | 0
+ 1 | 7 | 1
+ 1 | 9 | 1
+(10 rows)
+
+SELECT row_number() OVER (ORDER BY unique2) FROM tenk1 WHERE unique2 < 10;
+ row_number
+------------
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+(10 rows)
+
+SELECT rank() OVER (PARTITION BY four ORDER BY ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10;
+ rank_1 | ten | four
+--------+-----+------
+ 1 | 0 | 0
+ 1 | 0 | 0
+ 3 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 3 | 7 | 1
+ 4 | 9 | 1
+ 1 | 0 | 2
+ 1 | 1 | 3
+ 2 | 3 | 3
+(10 rows)
+
+SELECT dense_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ dense_rank | ten | four
+------------+-----+------
+ 1 | 0 | 0
+ 1 | 0 | 0
+ 2 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 2 | 7 | 1
+ 3 | 9 | 1
+ 1 | 0 | 2
+ 1 | 1 | 3
+ 2 | 3 | 3
+(10 rows)
+
+SELECT percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ percent_rank | ten | four
+--------------------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 1 | 4 | 0
+ 0 | 1 | 1
+ 0 | 1 | 1
+ 0.6666666666666666 | 7 | 1
+ 1 | 9 | 1
+ 0 | 0 | 2
+ 0 | 1 | 3
+ 1 | 3 | 3
+(10 rows)
+
+SELECT cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ cume_dist | ten | four
+--------------------+-----+------
+ 0.6666666666666666 | 0 | 0
+ 0.6666666666666666 | 0 | 0
+ 1 | 4 | 0
+ 0.5 | 1 | 1
+ 0.5 | 1 | 1
+ 0.75 | 7 | 1
+ 1 | 9 | 1
+ 1 | 0 | 2
+ 0.5 | 1 | 3
+ 1 | 3 | 3
+(10 rows)
+
+SELECT ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 10;
+ ntile | ten | four
+-------+-----+------
+ 1 | 0 | 0
+ 1 | 0 | 0
+ 1 | 0 | 2
+ 1 | 1 | 1
+ 2 | 1 | 1
+ 2 | 1 | 3
+ 2 | 3 | 3
+ 3 | 4 | 0
+ 3 | 7 | 1
+ 3 | 9 | 1
+(10 rows)
+
+SELECT ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 2;
+ ntile | ten | four
+-------+-----+------
+ | 0 | 0
+ | 0 | 0
+(2 rows)
+
+SELECT lag(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lag | ten | four
+-----+-----+------
+ | 0 | 0
+ 0 | 0 | 0
+ 0 | 4 | 0
+ | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 7 | 9 | 1
+ | 0 | 2
+ | 1 | 3
+ 1 | 3 | 3
+(10 rows)
+
+SELECT lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lag | ten | four
+-----+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 4 | 4 | 0
+ | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 7 | 9 | 1
+ | 0 | 2
+ | 1 | 3
+ | 3 | 3
+(10 rows)
+
+SELECT lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lag | ten | four
+-----+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 4 | 4 | 0
+ 0 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 7 | 9 | 1
+ 0 | 0 | 2
+ 0 | 1 | 3
+ 0 | 3 | 3
+(10 rows)
+
+SELECT lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ lag | ten | four
+-----+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 4 | 4 | 0
+ 0.7 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 7 | 9 | 1
+ 0.7 | 0 | 2
+ 0.7 | 1 | 3
+ 0.7 | 3 | 3
+(10 rows)
+
+SELECT lead(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lead | ten | four
+------+-----+------
+ 0 | 0 | 0
+ 4 | 0 | 0
+ | 4 | 0
+ 1 | 1 | 1
+ 7 | 1 | 1
+ 9 | 7 | 1
+ | 9 | 1
+ | 0 | 2
+ 3 | 1 | 3
+ | 3 | 3
+(10 rows)
+
+SELECT lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lead | ten | four
+------+-----+------
+ 0 | 0 | 0
+ 8 | 0 | 0
+ | 4 | 0
+ 2 | 1 | 1
+ 14 | 1 | 1
+ 18 | 7 | 1
+ | 9 | 1
+ | 0 | 2
+ 6 | 1 | 3
+ | 3 | 3
+(10 rows)
+
+SELECT lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ lead | ten | four
+------+-----+------
+ 0 | 0 | 0
+ 8 | 0 | 0
+ -1 | 4 | 0
+ 2 | 1 | 1
+ 14 | 1 | 1
+ 18 | 7 | 1
+ -1 | 9 | 1
+ -1 | 0 | 2
+ 6 | 1 | 3
+ -1 | 3 | 3
+(10 rows)
+
+SELECT lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+ lead | ten | four
+------+-----+------
+ 0 | 0 | 0
+ 8 | 0 | 0
+ -1.4 | 4 | 0
+ 2 | 1 | 1
+ 14 | 1 | 1
+ 18 | 7 | 1
+ -1.4 | 9 | 1
+ -1.4 | 0 | 2
+ 6 | 1 | 3
+ -1.4 | 3 | 3
+(10 rows)
+
+SELECT first_value(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ first_value | ten | four
+-------------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 0 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 1 | 9 | 1
+ 0 | 0 | 2
+ 1 | 1 | 3
+ 1 | 3 | 3
+(10 rows)
+
+-- last_value returns the last row of the frame, which is CURRENT ROW in ORDER BY window.
+SELECT last_value(four) OVER (ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+ last_value | ten | four
+------------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 2
+ 0 | 0 | 0
+ 1 | 1 | 1
+ 1 | 1 | 3
+ 1 | 1 | 1
+ 3 | 3 | 3
+ 0 | 4 | 0
+ 1 | 7 | 1
+ 1 | 9 | 1
+(10 rows)
+
+SELECT last_value(ten) OVER (PARTITION BY four), ten, four FROM
+ (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s
+ ORDER BY four, ten;
+ last_value | ten | four
+------------+-----+------
+ 4 | 0 | 0
+ 4 | 0 | 0
+ 4 | 4 | 0
+ 9 | 1 | 1
+ 9 | 1 | 1
+ 9 | 7 | 1
+ 9 | 9 | 1
+ 0 | 0 | 2
+ 3 | 1 | 3
+ 3 | 3 | 3
+(10 rows)
+
+SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s;
+ nth_value | ten | four
+-----------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 0 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 1 | 9 | 1
+ | 0 | 2
+ | 1 | 3
+ | 3 | 3
+(10 rows)
+
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER (PARTITION BY two ORDER BY ten) AS wsum
+FROM tenk1 GROUP BY ten, two;
+ ten | two | gsum | wsum
+-----+-----+-------+--------
+ 0 | 0 | 45000 | 45000
+ 2 | 0 | 47000 | 92000
+ 4 | 0 | 49000 | 141000
+ 6 | 0 | 51000 | 192000
+ 8 | 0 | 53000 | 245000
+ 1 | 1 | 46000 | 46000
+ 3 | 1 | 48000 | 94000
+ 5 | 1 | 50000 | 144000
+ 7 | 1 | 52000 | 196000
+ 9 | 1 | 54000 | 250000
+(10 rows)
+
+SELECT count(*) OVER (PARTITION BY four), four FROM (SELECT * FROM tenk1 WHERE two = 1)s WHERE unique2 < 10;
+ count | four
+-------+------
+ 4 | 1
+ 4 | 1
+ 4 | 1
+ 4 | 1
+ 2 | 3
+ 2 | 3
+(6 rows)
+
+SELECT (count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY four ORDER BY ten))::varchar AS cntsum
+ FROM tenk1 WHERE unique2 < 10;
+ cntsum
+--------
+ 22
+ 22
+ 87
+ 24
+ 24
+ 82
+ 92
+ 51
+ 92
+ 136
+(10 rows)
+
+-- opexpr with different windows evaluation.
+SELECT * FROM(
+ SELECT count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS total,
+ count(*) OVER (PARTITION BY four ORDER BY ten) AS fourcount,
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS twosum
+ FROM tenk1
+)sub
+WHERE total <> fourcount + twosum;
+ total | fourcount | twosum
+-------+-----------+--------
+(0 rows)
+
+SELECT avg(four) OVER (PARTITION BY four ORDER BY thousand / 100) FROM tenk1 WHERE unique2 < 10;
+ avg
+------------------------
+ 0.00000000000000000000
+ 0.00000000000000000000
+ 0.00000000000000000000
+ 1.00000000000000000000
+ 1.00000000000000000000
+ 1.00000000000000000000
+ 1.00000000000000000000
+ 2.0000000000000000
+ 3.0000000000000000
+ 3.0000000000000000
+(10 rows)
+
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER win AS wsum
+FROM tenk1 GROUP BY ten, two WINDOW win AS (PARTITION BY two ORDER BY ten);
+ ten | two | gsum | wsum
+-----+-----+-------+--------
+ 0 | 0 | 45000 | 45000
+ 2 | 0 | 47000 | 92000
+ 4 | 0 | 49000 | 141000
+ 6 | 0 | 51000 | 192000
+ 8 | 0 | 53000 | 245000
+ 1 | 1 | 46000 | 46000
+ 3 | 1 | 48000 | 94000
+ 5 | 1 | 50000 | 144000
+ 7 | 1 | 52000 | 196000
+ 9 | 1 | 54000 | 250000
+(10 rows)
+
+-- more than one window with GROUP BY
+SELECT sum(salary),
+ row_number() OVER (ORDER BY depname),
+ sum(sum(salary)) OVER (ORDER BY depname DESC)
+FROM empsalary GROUP BY depname;
+ sum | row_number | sum
+-------+------------+-------
+ 25100 | 1 | 47100
+ 7400 | 2 | 22000
+ 14600 | 3 | 14600
+(3 rows)
+
+-- identical windows with different names
+SELECT sum(salary) OVER w1, count(*) OVER w2
+FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary);
+ sum | count
+-------+-------
+ 3500 | 1
+ 7400 | 2
+ 11600 | 3
+ 16100 | 4
+ 25700 | 6
+ 25700 | 6
+ 30700 | 7
+ 41100 | 9
+ 41100 | 9
+ 47100 | 10
+(10 rows)
+
+-- subplan
+SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten)
+FROM tenk1 s WHERE unique2 < 10;
+ lead
+------
+ 0
+ 0
+ 4
+ 1
+ 7
+ 9
+
+ 0
+ 3
+
+(10 rows)
+
+-- empty table
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s;
+ count
+-------
+(0 rows)
+
+-- mixture of agg/wfunc in the same window
+SELECT sum(salary) OVER w, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);
+ sum | rank
+-------+------
+ 6000 | 1
+ 16400 | 2
+ 16400 | 2
+ 20900 | 4
+ 25100 | 5
+ 3900 | 1
+ 7400 | 2
+ 5000 | 1
+ 14600 | 2
+ 14600 | 2
+(10 rows)
+
+-- strict aggs
+SELECT empno, depname, salary, bonus, depadj, MIN(bonus) OVER (ORDER BY empno), MAX(depadj) OVER () FROM(
+ SELECT *,
+ CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
+ CASE WHEN
+ AVG(salary) OVER (PARTITION BY depname) < salary
+ THEN 200 END AS depadj FROM empsalary
+)s;
+ empno | depname | salary | bonus | depadj | min | max
+-------+-----------+--------+-------+--------+------+-----
+ 1 | sales | 5000 | 1000 | 200 | 1000 | 200
+ 2 | personnel | 3900 | 1000 | 200 | 1000 | 200
+ 3 | sales | 4800 | 500 | | 500 | 200
+ 4 | sales | 4800 | 500 | | 500 | 200
+ 5 | personnel | 3500 | 500 | | 500 | 200
+ 7 | develop | 4200 | | | 500 | 200
+ 8 | develop | 6000 | 1000 | 200 | 500 | 200
+ 9 | develop | 4500 | | | 500 | 200
+ 10 | develop | 5200 | 500 | 200 | 500 | 200
+ 11 | develop | 5200 | 500 | 200 | 500 | 200
+(10 rows)
+
+-- window function over ungrouped agg over empty row set (bug before 9.1)
+SELECT SUM(COUNT(f1)) OVER () FROM int4_tbl WHERE f1=42;
+ sum
+-----
+ 0
+(1 row)
+
+-- window function with ORDER BY an expression involving aggregates (9.1 bug)
+select ten,
+ sum(unique1) + sum(unique2) as res,
+ rank() over (order by sum(unique1) + sum(unique2)) as rank
+from tenk1
+group by ten order by ten;
+ ten | res | rank
+-----+----------+------
+ 0 | 9976146 | 4
+ 1 | 10114187 | 9
+ 2 | 10059554 | 8
+ 3 | 9878541 | 1
+ 4 | 9881005 | 2
+ 5 | 9981670 | 5
+ 6 | 9947099 | 3
+ 7 | 10120309 | 10
+ 8 | 9991305 | 6
+ 9 | 10040184 | 7
+(10 rows)
+
+-- window and aggregate with GROUP BY expression (9.2 bug)
+explain (costs off)
+select first_value(max(x)) over (), y
+ from (select unique1 as x, ten+four as y from tenk1) ss
+ group by y;
+ QUERY PLAN
+---------------------------------------------
+ WindowAgg
+ -> HashAggregate
+ Group Key: (tenk1.ten + tenk1.four)
+ -> Seq Scan on tenk1
+(4 rows)
+
+-- test non-default frame specifications
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten),
+ last_value(ten) over (partition by four order by ten)
+FROM (select distinct ten, four from tenk1) ss;
+ four | ten | sum | last_value
+------+-----+-----+------------
+ 0 | 0 | 0 | 0
+ 0 | 2 | 2 | 2
+ 0 | 4 | 6 | 4
+ 0 | 6 | 12 | 6
+ 0 | 8 | 20 | 8
+ 1 | 1 | 1 | 1
+ 1 | 3 | 4 | 3
+ 1 | 5 | 9 | 5
+ 1 | 7 | 16 | 7
+ 1 | 9 | 25 | 9
+ 2 | 0 | 0 | 0
+ 2 | 2 | 2 | 2
+ 2 | 4 | 6 | 4
+ 2 | 6 | 12 | 6
+ 2 | 8 | 20 | 8
+ 3 | 1 | 1 | 1
+ 3 | 3 | 4 | 3
+ 3 | 5 | 9 | 5
+ 3 | 7 | 16 | 7
+ 3 | 9 | 25 | 9
+(20 rows)
+
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and current row),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+ four | ten | sum | last_value
+------+-----+-----+------------
+ 0 | 0 | 0 | 0
+ 0 | 2 | 2 | 2
+ 0 | 4 | 6 | 4
+ 0 | 6 | 12 | 6
+ 0 | 8 | 20 | 8
+ 1 | 1 | 1 | 1
+ 1 | 3 | 4 | 3
+ 1 | 5 | 9 | 5
+ 1 | 7 | 16 | 7
+ 1 | 9 | 25 | 9
+ 2 | 0 | 0 | 0
+ 2 | 2 | 2 | 2
+ 2 | 4 | 6 | 4
+ 2 | 6 | 12 | 6
+ 2 | 8 | 20 | 8
+ 3 | 1 | 1 | 1
+ 3 | 3 | 4 | 3
+ 3 | 5 | 9 | 5
+ 3 | 7 | 16 | 7
+ 3 | 9 | 25 | 9
+(20 rows)
+
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and unbounded following),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and unbounded following)
+FROM (select distinct ten, four from tenk1) ss;
+ four | ten | sum | last_value
+------+-----+-----+------------
+ 0 | 0 | 20 | 8
+ 0 | 2 | 20 | 8
+ 0 | 4 | 20 | 8
+ 0 | 6 | 20 | 8
+ 0 | 8 | 20 | 8
+ 1 | 1 | 25 | 9
+ 1 | 3 | 25 | 9
+ 1 | 5 | 25 | 9
+ 1 | 7 | 25 | 9
+ 1 | 9 | 25 | 9
+ 2 | 0 | 20 | 8
+ 2 | 2 | 20 | 8
+ 2 | 4 | 20 | 8
+ 2 | 6 | 20 | 8
+ 2 | 8 | 20 | 8
+ 3 | 1 | 25 | 9
+ 3 | 3 | 25 | 9
+ 3 | 5 | 25 | 9
+ 3 | 7 | 25 | 9
+ 3 | 9 | 25 | 9
+(20 rows)
+
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+ four | two | sum | last_value
+------+-----+-----+------------
+ 0 | 0 | 0 | 0
+ 0 | 0 | 0 | 0
+ 0 | 1 | 2 | 1
+ 0 | 1 | 2 | 1
+ 0 | 2 | 4 | 2
+ 1 | 0 | 0 | 0
+ 1 | 0 | 0 | 0
+ 1 | 1 | 2 | 1
+ 1 | 1 | 2 | 1
+ 1 | 2 | 4 | 2
+ 2 | 0 | 0 | 0
+ 2 | 0 | 0 | 0
+ 2 | 1 | 2 | 1
+ 2 | 1 | 2 | 1
+ 2 | 2 | 4 | 2
+ 3 | 0 | 0 | 0
+ 3 | 0 | 0 | 0
+ 3 | 1 | 2 | 1
+ 3 | 1 | 2 | 1
+ 3 | 2 | 4 | 2
+(20 rows)
+
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+ four | two | sum | last_value
+------+-----+-----+------------
+ 0 | 0 | 0 | 0
+ 0 | 0 | 0 | 0
+ 0 | 1 | 1 | 1
+ 0 | 1 | 2 | 1
+ 0 | 2 | 4 | 2
+ 1 | 0 | 0 | 0
+ 1 | 0 | 0 | 0
+ 1 | 1 | 1 | 1
+ 1 | 1 | 2 | 1
+ 1 | 2 | 4 | 2
+ 2 | 0 | 0 | 0
+ 2 | 0 | 0 | 0
+ 2 | 1 | 1 | 1
+ 2 | 1 | 2 | 1
+ 2 | 2 | 4 | 2
+ 3 | 0 | 0 | 0
+ 3 | 0 | 0 | 0
+ 3 | 1 | 1 | 1
+ 3 | 1 | 2 | 1
+ 3 | 2 | 4 | 2
+(20 rows)
+
+SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 0 | 0
+ 45 | 8 | 0
+ 45 | 4 | 0
+ 33 | 5 | 1
+ 33 | 9 | 1
+ 33 | 1 | 1
+ 18 | 6 | 2
+ 18 | 2 | 2
+ 10 | 3 | 3
+ 10 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (rows between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 4 | 0
+ 41 | 2 | 2
+ 39 | 1 | 1
+ 38 | 6 | 2
+ 32 | 9 | 1
+ 23 | 8 | 0
+ 15 | 5 | 1
+ 10 | 3 | 3
+ 7 | 7 | 3
+ 0 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 7 | 4 | 0
+ 13 | 2 | 2
+ 22 | 1 | 1
+ 26 | 6 | 2
+ 29 | 9 | 1
+ 31 | 8 | 0
+ 32 | 5 | 1
+ 23 | 3 | 3
+ 15 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 7 | 4 | 0
+ 13 | 2 | 2
+ 22 | 1 | 1
+ 26 | 6 | 2
+ 29 | 9 | 1
+ 31 | 8 | 0
+ 32 | 5 | 1
+ 23 | 3 | 3
+ 15 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 3 | 4 | 0
+ 11 | 2 | 2
+ 21 | 1 | 1
+ 20 | 6 | 2
+ 20 | 9 | 1
+ 23 | 8 | 0
+ 27 | 5 | 1
+ 20 | 3 | 3
+ 8 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 4 | 0
+ | 2 | 2
+ | 1 | 1
+ | 6 | 2
+ | 9 | 1
+ | 8 | 0
+ | 5 | 1
+ | 3 | 3
+ | 7 | 3
+ | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 4 | 4 | 0
+ 2 | 2 | 2
+ 1 | 1 | 1
+ 6 | 6 | 2
+ 9 | 9 | 1
+ 8 | 8 | 0
+ 5 | 5 | 1
+ 3 | 3 | 3
+ 7 | 7 | 3
+ 0 | 0 | 0
+(10 rows)
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ first_value | unique1 | four
+-------------+---------+------
+ 8 | 0 | 0
+ 4 | 8 | 0
+ 5 | 4 | 0
+ 9 | 5 | 1
+ 1 | 9 | 1
+ 6 | 1 | 1
+ 2 | 6 | 2
+ 3 | 2 | 2
+ 7 | 3 | 3
+ | 7 | 3
+(10 rows)
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ first_value | unique1 | four
+-------------+---------+------
+ | 0 | 0
+ 5 | 8 | 0
+ 5 | 4 | 0
+ | 5 | 1
+ 6 | 9 | 1
+ 6 | 1 | 1
+ 3 | 6 | 2
+ 3 | 2 | 2
+ | 3 | 3
+ | 7 | 3
+(10 rows)
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ first_value | unique1 | four
+-------------+---------+------
+ 0 | 0 | 0
+ 8 | 8 | 0
+ 4 | 4 | 0
+ 5 | 5 | 1
+ 9 | 9 | 1
+ 1 | 1 | 1
+ 6 | 6 | 2
+ 2 | 2 | 2
+ 3 | 3 | 3
+ 7 | 7 | 3
+(10 rows)
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ last_value | unique1 | four
+------------+---------+------
+ 4 | 0 | 0
+ 5 | 8 | 0
+ 9 | 4 | 0
+ 1 | 5 | 1
+ 6 | 9 | 1
+ 2 | 1 | 1
+ 3 | 6 | 2
+ 7 | 2 | 2
+ 7 | 3 | 3
+ | 7 | 3
+(10 rows)
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ last_value | unique1 | four
+------------+---------+------
+ | 0 | 0
+ 5 | 8 | 0
+ 9 | 4 | 0
+ | 5 | 1
+ 6 | 9 | 1
+ 2 | 1 | 1
+ 3 | 6 | 2
+ 7 | 2 | 2
+ | 3 | 3
+ | 7 | 3
+(10 rows)
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ last_value | unique1 | four
+------------+---------+------
+ 0 | 0 | 0
+ 5 | 8 | 0
+ 9 | 4 | 0
+ 5 | 5 | 1
+ 6 | 9 | 1
+ 2 | 1 | 1
+ 3 | 6 | 2
+ 7 | 2 | 2
+ 3 | 3 | 3
+ 7 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (rows between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 4 | 0
+ 4 | 2 | 2
+ 6 | 1 | 1
+ 3 | 6 | 2
+ 7 | 9 | 1
+ 15 | 8 | 0
+ 17 | 5 | 1
+ 13 | 3 | 3
+ 8 | 7 | 3
+ 10 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between 1 following and 3 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 9 | 4 | 0
+ 16 | 2 | 2
+ 23 | 1 | 1
+ 22 | 6 | 2
+ 16 | 9 | 1
+ 15 | 8 | 0
+ 10 | 5 | 1
+ 7 | 3 | 3
+ 0 | 7 | 3
+ | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (rows between unbounded preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 6 | 4 | 0
+ 7 | 2 | 2
+ 13 | 1 | 1
+ 22 | 6 | 2
+ 30 | 9 | 1
+ 35 | 8 | 0
+ 38 | 5 | 1
+ 45 | 3 | 3
+ 45 | 7 | 3
+ 45 | 0 | 0
+(10 rows)
+
+SELECT sum(unique1) over (w range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+ sum | unique1 | four
+-----+---------+------
+ 45 | 0 | 0
+ 45 | 8 | 0
+ 45 | 4 | 0
+ 33 | 5 | 1
+ 33 | 9 | 1
+ 33 | 1 | 1
+ 18 | 6 | 2
+ 18 | 2 | 2
+ 10 | 3 | 3
+ 10 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+ sum | unique1 | four
+-----+---------+------
+ 12 | 0 | 0
+ 4 | 8 | 0
+ 8 | 4 | 0
+ 22 | 5 | 1
+ 18 | 9 | 1
+ 26 | 1 | 1
+ 29 | 6 | 2
+ 33 | 2 | 2
+ 42 | 3 | 3
+ 38 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 35 | 3 | 3
+ 35 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+ sum | unique1 | four
+-----+---------+------
+ 0 | 0 | 0
+ 8 | 8 | 0
+ 4 | 4 | 0
+ 17 | 5 | 1
+ 21 | 9 | 1
+ 13 | 1 | 1
+ 33 | 6 | 2
+ 29 | 2 | 2
+ 38 | 3 | 3
+ 42 | 7 | 3
+(10 rows)
+
+SELECT first_value(unique1) over w,
+ nth_value(unique1, 2) over w AS nth_2,
+ last_value(unique1) over w, unique1, four
+FROM tenk1 WHERE unique1 < 10
+WINDOW w AS (order by four range between current row and unbounded following);
+ first_value | nth_2 | last_value | unique1 | four
+-------------+-------+------------+---------+------
+ 0 | 8 | 7 | 0 | 0
+ 0 | 8 | 7 | 8 | 0
+ 0 | 8 | 7 | 4 | 0
+ 5 | 9 | 7 | 5 | 1
+ 5 | 9 | 7 | 9 | 1
+ 5 | 9 | 7 | 1 | 1
+ 6 | 2 | 7 | 6 | 2
+ 6 | 2 | 7 | 2 | 2
+ 3 | 7 | 7 | 3 | 3
+ 3 | 7 | 7 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over
+ (order by unique1
+ rows (SELECT unique1 FROM tenk1 ORDER BY unique1 LIMIT 1) + 1 PRECEDING),
+ unique1
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1
+-----+---------
+ 0 | 0
+ 1 | 1
+ 3 | 2
+ 5 | 3
+ 7 | 4
+ 9 | 5
+ 11 | 6
+ 13 | 7
+ 15 | 8
+ 17 | 9
+(10 rows)
+
+CREATE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following) as sum_rows
+ FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 12
+ 5 | 15
+ 6 | 18
+ 7 | 21
+ 8 | 24
+ 9 | 27
+ 10 | 19
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+---------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude current row) as sum_rows FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 2
+ 2 | 4
+ 3 | 6
+ 4 | 8
+ 5 | 10
+ 6 | 12
+ 7 | 14
+ 8 | 16
+ 9 | 18
+ 10 | 9
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+-----------------------------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude group) as sum_rows FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 2
+ 2 | 4
+ 3 | 6
+ 4 | 8
+ 5 | 10
+ 6 | 12
+ 7 | 14
+ 8 | 16
+ 9 | 18
+ 10 | 9
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+-----------------------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE GROUP) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude ties) as sum_rows FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 12
+ 5 | 15
+ 6 | 18
+ 7 | 21
+ 8 | 24
+ 9 | 27
+ 10 | 19
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+----------------------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING EXCLUDE TIES) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude no others) as sum_rows FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 12
+ 5 | 15
+ 6 | 18
+ 7 | 21
+ 8 | 24
+ 9 | 27
+ 10 | 19
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+---------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i groups between 1 preceding and 1 following) as sum_rows FROM generate_series(1, 10) i;
+SELECT * FROM v_window;
+ i | sum_rows
+----+----------
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 12
+ 5 | 15
+ 6 | 18
+ 7 | 21
+ 8 | 24
+ 9 | 27
+ 10 | 19
+(10 rows)
+
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+-----------------------------------------------------------------------------------------
+ SELECT i.i, +
+ sum(i.i) OVER (ORDER BY i.i GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS sum_rows+
+ FROM generate_series(1, 10) i(i);
+(1 row)
+
+DROP VIEW v_window;
+CREATE TEMP VIEW v_window AS
+ SELECT i, min(i) over (order by i range between '1 day' preceding and '10 days' following) as min_i
+ FROM generate_series(now(), now()+'100 days'::interval, '1 hour') i;
+SELECT pg_get_viewdef('v_window');
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------------------------------
+ SELECT i.i, +
+ min(i.i) OVER (ORDER BY i.i RANGE BETWEEN '@ 1 day'::interval PRECEDING AND '@ 10 days'::interval FOLLOWING) AS min_i+
+ FROM generate_series(now(), (now() + '@ 100 days'::interval), '@ 1 hour'::interval) i(i);
+(1 row)
+
+-- RANGE offset PRECEDING/FOLLOWING tests
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 3 | 3
+ | 7 | 3
+ 10 | 6 | 2
+ 10 | 2 | 2
+ 18 | 9 | 1
+ 18 | 5 | 1
+ 18 | 1 | 1
+ 23 | 0 | 0
+ 23 | 8 | 0
+ 23 | 4 | 0
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 33 | 0 | 0
+ 41 | 8 | 0
+ 37 | 4 | 0
+ 35 | 5 | 1
+ 39 | 9 | 1
+ 31 | 1 | 1
+ 43 | 6 | 2
+ 39 | 2 | 2
+ 26 | 3 | 3
+ 30 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 33 | 0 | 0
+ 33 | 8 | 0
+ 33 | 4 | 0
+ 30 | 5 | 1
+ 30 | 9 | 1
+ 30 | 1 | 1
+ 37 | 6 | 2
+ 37 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 4 | 0 | 0
+ 12 | 4 | 0
+ 12 | 8 | 0
+ 6 | 1 | 1
+ 15 | 5 | 1
+ 14 | 9 | 1
+ 8 | 2 | 2
+ 8 | 6 | 2
+ 10 | 3 | 3
+ 10 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ exclude current row),unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 4 | 0 | 0
+ 8 | 4 | 0
+ 4 | 8 | 0
+ 5 | 1 | 1
+ 10 | 5 | 1
+ 5 | 9 | 1
+ 6 | 2 | 2
+ 2 | 6 | 2
+ 7 | 3 | 3
+ 3 | 7 | 3
+(10 rows)
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-------+--------+-------------
+ 34900 | 5000 | 10-01-2006
+ 34900 | 6000 | 10-01-2006
+ 38400 | 3900 | 12-23-2006
+ 47100 | 4800 | 08-01-2007
+ 47100 | 5200 | 08-01-2007
+ 47100 | 4800 | 08-08-2007
+ 47100 | 5200 | 08-15-2007
+ 36100 | 3500 | 12-10-2007
+ 32200 | 4500 | 01-01-2008
+ 32200 | 4200 | 01-01-2008
+(10 rows)
+
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-------+--------+-------------
+ 32200 | 4200 | 01-01-2008
+ 32200 | 4500 | 01-01-2008
+ 36100 | 3500 | 12-10-2007
+ 47100 | 5200 | 08-15-2007
+ 47100 | 4800 | 08-08-2007
+ 47100 | 4800 | 08-01-2007
+ 47100 | 5200 | 08-01-2007
+ 38400 | 3900 | 12-23-2006
+ 34900 | 5000 | 10-01-2006
+ 34900 | 6000 | 10-01-2006
+(10 rows)
+
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-----+--------+-------------
+ | 4200 | 01-01-2008
+ | 4500 | 01-01-2008
+ | 3500 | 12-10-2007
+ | 5200 | 08-15-2007
+ | 4800 | 08-08-2007
+ | 4800 | 08-01-2007
+ | 5200 | 08-01-2007
+ | 3900 | 12-23-2006
+ | 5000 | 10-01-2006
+ | 6000 | 10-01-2006
+(10 rows)
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude current row), salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-------+--------+-------------
+ 29900 | 5000 | 10-01-2006
+ 28900 | 6000 | 10-01-2006
+ 34500 | 3900 | 12-23-2006
+ 42300 | 4800 | 08-01-2007
+ 41900 | 5200 | 08-01-2007
+ 42300 | 4800 | 08-08-2007
+ 41900 | 5200 | 08-15-2007
+ 32600 | 3500 | 12-10-2007
+ 27700 | 4500 | 01-01-2008
+ 28000 | 4200 | 01-01-2008
+(10 rows)
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude group), salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-------+--------+-------------
+ 23900 | 5000 | 10-01-2006
+ 23900 | 6000 | 10-01-2006
+ 34500 | 3900 | 12-23-2006
+ 37100 | 4800 | 08-01-2007
+ 37100 | 5200 | 08-01-2007
+ 42300 | 4800 | 08-08-2007
+ 41900 | 5200 | 08-15-2007
+ 32600 | 3500 | 12-10-2007
+ 23500 | 4500 | 01-01-2008
+ 23500 | 4200 | 01-01-2008
+(10 rows)
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ sum | salary | enroll_date
+-------+--------+-------------
+ 28900 | 5000 | 10-01-2006
+ 29900 | 6000 | 10-01-2006
+ 38400 | 3900 | 12-23-2006
+ 41900 | 4800 | 08-01-2007
+ 42300 | 5200 | 08-01-2007
+ 47100 | 4800 | 08-08-2007
+ 47100 | 5200 | 08-15-2007
+ 36100 | 3500 | 12-10-2007
+ 28000 | 4500 | 01-01-2008
+ 27700 | 4200 | 01-01-2008
+(10 rows)
+
+select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lead(salary) over(order by salary range between 1000 preceding and 1000 following),
+ nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+ first_value | lead | nth_value | salary
+-------------+------+-----------+--------
+ 3500 | 3900 | 3500 | 3500
+ 3500 | 4200 | 3500 | 3900
+ 3500 | 4500 | 3500 | 4200
+ 3500 | 4800 | 3500 | 4500
+ 3900 | 4800 | 3900 | 4800
+ 3900 | 5000 | 3900 | 4800
+ 4200 | 5200 | 4200 | 5000
+ 4200 | 5200 | 4200 | 5200
+ 4200 | 6000 | 4200 | 5200
+ 5000 | | 5000 | 6000
+(10 rows)
+
+select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lag(salary) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+ last_value | lag | salary
+------------+------+--------
+ 4500 | | 3500
+ 4800 | 3500 | 3900
+ 5200 | 3900 | 4200
+ 5200 | 4200 | 4500
+ 5200 | 4500 | 4800
+ 5200 | 4800 | 4800
+ 6000 | 4800 | 5000
+ 6000 | 5000 | 5200
+ 6000 | 5200 | 5200
+ 6000 | 5200 | 6000
+(10 rows)
+
+select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude current row),
+ lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties),
+ nth_value(salary, 1) over(order by salary range between 1000 following and 3000 following
+ exclude ties),
+ salary from empsalary;
+ first_value | lead | nth_value | salary
+-------------+------+-----------+--------
+ 4500 | 3900 | 4500 | 3500
+ 5000 | 4200 | 5000 | 3900
+ 5200 | 4500 | 5200 | 4200
+ 6000 | 4800 | 6000 | 4500
+ 6000 | 4800 | 6000 | 4800
+ 6000 | 5000 | 6000 | 4800
+ 6000 | 5200 | 6000 | 5000
+ | 5200 | | 5200
+ | 6000 | | 5200
+ | | | 6000
+(10 rows)
+
+select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude group),
+ lag(salary) over(order by salary range between 1000 following and 3000 following exclude group),
+ salary from empsalary;
+ last_value | lag | salary
+------------+------+--------
+ 6000 | | 3500
+ 6000 | 3500 | 3900
+ 6000 | 3900 | 4200
+ 6000 | 4200 | 4500
+ 6000 | 4500 | 4800
+ 6000 | 4800 | 4800
+ 6000 | 4800 | 5000
+ | 5000 | 5200
+ | 5200 | 5200
+ | 5200 | 6000
+(10 rows)
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+ first_value | last_value | salary | enroll_date
+-------------+------------+--------+-------------
+ 5000 | 5200 | 5000 | 10-01-2006
+ 6000 | 5200 | 6000 | 10-01-2006
+ 5000 | 3500 | 3900 | 12-23-2006
+ 5000 | 4200 | 4800 | 08-01-2007
+ 5000 | 4200 | 5200 | 08-01-2007
+ 5000 | 4200 | 4800 | 08-08-2007
+ 5000 | 4200 | 5200 | 08-15-2007
+ 5000 | 4200 | 3500 | 12-10-2007
+ 5000 | 4200 | 4500 | 01-01-2008
+ 5000 | 4200 | 4200 | 01-01-2008
+(10 rows)
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ salary, enroll_date from empsalary;
+ first_value | last_value | salary | enroll_date
+-------------+------------+--------+-------------
+ 5000 | 5200 | 5000 | 10-01-2006
+ 6000 | 5200 | 6000 | 10-01-2006
+ 5000 | 3500 | 3900 | 12-23-2006
+ 5000 | 4200 | 4800 | 08-01-2007
+ 5000 | 4200 | 5200 | 08-01-2007
+ 5000 | 4200 | 4800 | 08-08-2007
+ 5000 | 4200 | 5200 | 08-15-2007
+ 5000 | 4200 | 3500 | 12-10-2007
+ 5000 | 4500 | 4500 | 01-01-2008
+ 5000 | 4200 | 4200 | 01-01-2008
+(10 rows)
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ salary, enroll_date from empsalary;
+ first_value | last_value | salary | enroll_date
+-------------+------------+--------+-------------
+ 3900 | 5200 | 5000 | 10-01-2006
+ 3900 | 5200 | 6000 | 10-01-2006
+ 5000 | 3500 | 3900 | 12-23-2006
+ 5000 | 4200 | 4800 | 08-01-2007
+ 5000 | 4200 | 5200 | 08-01-2007
+ 5000 | 4200 | 4800 | 08-08-2007
+ 5000 | 4200 | 5200 | 08-15-2007
+ 5000 | 4200 | 3500 | 12-10-2007
+ 5000 | 3500 | 4500 | 01-01-2008
+ 5000 | 3500 | 4200 | 01-01-2008
+(10 rows)
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ salary, enroll_date from empsalary;
+ first_value | last_value | salary | enroll_date
+-------------+------------+--------+-------------
+ 6000 | 5200 | 5000 | 10-01-2006
+ 5000 | 5200 | 6000 | 10-01-2006
+ 5000 | 3500 | 3900 | 12-23-2006
+ 5000 | 4200 | 4800 | 08-01-2007
+ 5000 | 4200 | 5200 | 08-01-2007
+ 5000 | 4200 | 4800 | 08-08-2007
+ 5000 | 4200 | 5200 | 08-15-2007
+ 5000 | 4200 | 3500 | 12-10-2007
+ 5000 | 4200 | 4500 | 01-01-2008
+ 5000 | 4500 | 4200 | 01-01-2008
+(10 rows)
+
+-- RANGE offset PRECEDING/FOLLOWING with null values
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls first range between 2 preceding and 2 following);
+ x | y | first_value | last_value
+---+----+-------------+------------
+ | 42 | 42 | 43
+ | 43 | 42 | 43
+ 1 | 1 | 1 | 3
+ 2 | 2 | 1 | 4
+ 3 | 3 | 1 | 5
+ 4 | 4 | 2 | 5
+ 5 | 5 | 3 | 5
+(7 rows)
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls last range between 2 preceding and 2 following);
+ x | y | first_value | last_value
+---+----+-------------+------------
+ 1 | 1 | 1 | 3
+ 2 | 2 | 1 | 4
+ 3 | 3 | 1 | 5
+ 4 | 4 | 2 | 5
+ 5 | 5 | 3 | 5
+ | 42 | 42 | 43
+ | 43 | 42 | 43
+(7 rows)
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls first range between 2 preceding and 2 following);
+ x | y | first_value | last_value
+---+----+-------------+------------
+ | 43 | 43 | 42
+ | 42 | 43 | 42
+ 5 | 5 | 5 | 3
+ 4 | 4 | 5 | 2
+ 3 | 3 | 5 | 1
+ 2 | 2 | 4 | 1
+ 1 | 1 | 3 | 1
+(7 rows)
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls last range between 2 preceding and 2 following);
+ x | y | first_value | last_value
+---+----+-------------+------------
+ 5 | 5 | 5 | 3
+ 4 | 4 | 5 | 2
+ 3 | 3 | 5 | 1
+ 2 | 2 | 4 | 1
+ 1 | 1 | 3 | 1
+ | 42 | 42 | 43
+ | 43 | 42 | 43
+(7 rows)
+
+-- Check overflow behavior for various integer sizes
+select x, last_value(x) over (order by x::smallint range between current row and 2147450884 following)
+from generate_series(32764, 32766) x;
+ x | last_value
+-------+------------
+ 32764 | 32766
+ 32765 | 32766
+ 32766 | 32766
+(3 rows)
+
+select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+from generate_series(-32766, -32764) x;
+ x | last_value
+--------+------------
+ -32764 | -32766
+ -32765 | -32766
+ -32766 | -32766
+(3 rows)
+
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(2147483644, 2147483646) x;
+ x | last_value
+------------+------------
+ 2147483644 | 2147483646
+ 2147483645 | 2147483646
+ 2147483646 | 2147483646
+(3 rows)
+
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-2147483646, -2147483644) x;
+ x | last_value
+-------------+-------------
+ -2147483644 | -2147483646
+ -2147483645 | -2147483646
+ -2147483646 | -2147483646
+(3 rows)
+
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(9223372036854775804, 9223372036854775806) x;
+ x | last_value
+---------------------+---------------------
+ 9223372036854775804 | 9223372036854775806
+ 9223372036854775805 | 9223372036854775806
+ 9223372036854775806 | 9223372036854775806
+(3 rows)
+
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-9223372036854775806, -9223372036854775804) x;
+ x | last_value
+----------------------+----------------------
+ -9223372036854775804 | -9223372036854775806
+ -9223372036854775805 | -9223372036854775806
+ -9223372036854775806 | -9223372036854775806
+(3 rows)
+
+-- Test in_range for other numeric datatypes
+create temp table numerics(
+ id int,
+ f_float4 float4,
+ f_float8 float8,
+ f_numeric numeric
+);
+insert into numerics values
+(0, '-infinity', '-infinity', '-infinity'),
+(1, -3, -3, -3),
+(2, -1, -1, -1),
+(3, 0, 0, 0),
+(4, 1.1, 1.1, 1.1),
+(5, 1.12, 1.12, 1.12),
+(6, 2, 2, 2),
+(7, 100, 100, 100),
+(8, 'infinity', 'infinity', 'infinity'),
+(9, 'NaN', 'NaN', 'NaN');
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1 following);
+ id | f_float4 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 3
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1.1::float4 following);
+ id | f_float4 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 4
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' following);
+ id | f_float4 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 0 | 8
+ 2 | -1 | 0 | 8
+ 3 | 0 | 0 | 8
+ 4 | 1.1 | 0 | 8
+ 5 | 1.12 | 0 | 8
+ 6 | 2 | 0 | 8
+ 7 | 100 | 0 | 8
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' preceding);
+ id | f_float4 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 0 | 0
+ 2 | -1 | 0 | 0
+ 3 | 0 | 0 | 0
+ 4 | 1.1 | 0 | 0
+ 5 | 1.12 | 0 | 0
+ 6 | 2 | 0 | 0
+ 7 | 100 | 0 | 0
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' following and 'inf' following);
+ id | f_float4 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 8 | 8
+ 2 | -1 | 8 | 8
+ 3 | 0 | 8 | 8
+ 4 | 1.1 | 8 | 8
+ 5 | 1.12 | 8 | 8
+ 6 | 2 | 8 | 8
+ 7 | 100 | 8 | 8
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ERROR: invalid preceding or following size in window function
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1 following);
+ id | f_float8 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 3
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1.1::float8 following);
+ id | f_float8 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 4
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' following);
+ id | f_float8 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 0 | 8
+ 2 | -1 | 0 | 8
+ 3 | 0 | 0 | 8
+ 4 | 1.1 | 0 | 8
+ 5 | 1.12 | 0 | 8
+ 6 | 2 | 0 | 8
+ 7 | 100 | 0 | 8
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' preceding);
+ id | f_float8 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 0 | 0
+ 2 | -1 | 0 | 0
+ 3 | 0 | 0 | 0
+ 4 | 1.1 | 0 | 0
+ 5 | 1.12 | 0 | 0
+ 6 | 2 | 0 | 0
+ 7 | 100 | 0 | 0
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' following and 'inf' following);
+ id | f_float8 | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 8 | 8
+ 2 | -1 | 8 | 8
+ 3 | 0 | 8 | 8
+ 4 | 1.1 | 8 | 8
+ 5 | 1.12 | 8 | 8
+ 6 | 2 | 8 | 8
+ 7 | 100 | 8 | 8
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ERROR: invalid preceding or following size in window function
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1 following);
+ id | f_numeric | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 3
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::numeric following);
+ id | f_numeric | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 1 | 1
+ 2 | -1 | 2 | 3
+ 3 | 0 | 2 | 4
+ 4 | 1.1 | 4 | 6
+ 5 | 1.12 | 4 | 6
+ 6 | 2 | 4 | 6
+ 7 | 100 | 7 | 7
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::float8 following); -- currently unsupported
+ERROR: RANGE with offset PRECEDING/FOLLOWING is not supported for column type numeric and offset type double precision
+LINE 4: 1 preceding and 1.1::float8 following);
+ ^
+HINT: Cast the offset value to an appropriate type.
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' following);
+ id | f_numeric | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 0 | 8
+ 2 | -1 | 0 | 8
+ 3 | 0 | 0 | 8
+ 4 | 1.1 | 0 | 8
+ 5 | 1.12 | 0 | 8
+ 6 | 2 | 0 | 8
+ 7 | 100 | 0 | 8
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' preceding);
+ id | f_numeric | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 0
+ 1 | -3 | 0 | 0
+ 2 | -1 | 0 | 0
+ 3 | 0 | 0 | 0
+ 4 | 1.1 | 0 | 0
+ 5 | 1.12 | 0 | 0
+ 6 | 2 | 0 | 0
+ 7 | 100 | 0 | 0
+ 8 | Infinity | 0 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' following and 'inf' following);
+ id | f_numeric | first_value | last_value
+----+-----------+-------------+------------
+ 0 | -Infinity | 0 | 8
+ 1 | -3 | 8 | 8
+ 2 | -1 | 8 | 8
+ 3 | 0 | 8 | 8
+ 4 | 1.1 | 8 | 8
+ 5 | 1.12 | 8 | 8
+ 6 | 2 | 8 | 8
+ 7 | 100 | 8 | 8
+ 8 | Infinity | 8 | 8
+ 9 | NaN | 9 | 9
+(10 rows)
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+ERROR: invalid preceding or following size in window function
+-- Test in_range for other datetime datatypes
+create temp table datetimes(
+ id int,
+ f_time time,
+ f_timetz timetz,
+ f_interval interval,
+ f_timestamptz timestamptz,
+ f_timestamp timestamp
+);
+insert into datetimes values
+(1, '11:00', '11:00 BST', '1 year', '2000-10-19 10:23:54+01', '2000-10-19 10:23:54'),
+(2, '12:00', '12:00 BST', '2 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(3, '13:00', '13:00 BST', '3 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(4, '14:00', '14:00 BST', '4 years', '2002-10-19 10:23:54+01', '2002-10-19 10:23:54'),
+(5, '15:00', '15:00 BST', '5 years', '2003-10-19 10:23:54+01', '2003-10-19 10:23:54'),
+(6, '15:00', '15:00 BST', '5 years', '2004-10-19 10:23:54+01', '2004-10-19 10:23:54'),
+(7, '17:00', '17:00 BST', '7 years', '2005-10-19 10:23:54+01', '2005-10-19 10:23:54'),
+(8, '18:00', '18:00 BST', '8 years', '2006-10-19 10:23:54+01', '2006-10-19 10:23:54'),
+(9, '19:00', '19:00 BST', '9 years', '2007-10-19 10:23:54+01', '2007-10-19 10:23:54'),
+(10, '20:00', '20:00 BST', '10 years', '2008-10-19 10:23:54+01', '2008-10-19 10:23:54');
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+ id | f_time | first_value | last_value
+----+----------+-------------+------------
+ 1 | 11:00:00 | 1 | 3
+ 2 | 12:00:00 | 1 | 4
+ 3 | 13:00:00 | 2 | 6
+ 4 | 14:00:00 | 3 | 6
+ 5 | 15:00:00 | 4 | 7
+ 6 | 15:00:00 | 4 | 7
+ 7 | 17:00:00 | 7 | 9
+ 8 | 18:00:00 | 7 | 10
+ 9 | 19:00:00 | 8 | 10
+ 10 | 20:00:00 | 9 | 10
+(10 rows)
+
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time desc range between
+ '70 min' preceding and '2 hours' following);
+ id | f_time | first_value | last_value
+----+----------+-------------+------------
+ 10 | 20:00:00 | 10 | 8
+ 9 | 19:00:00 | 10 | 7
+ 8 | 18:00:00 | 9 | 7
+ 7 | 17:00:00 | 8 | 5
+ 6 | 15:00:00 | 6 | 3
+ 5 | 15:00:00 | 6 | 3
+ 4 | 14:00:00 | 6 | 2
+ 3 | 13:00:00 | 4 | 1
+ 2 | 12:00:00 | 3 | 1
+ 1 | 11:00:00 | 2 | 1
+(10 rows)
+
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+ id | f_timetz | first_value | last_value
+----+-------------+-------------+------------
+ 1 | 11:00:00+01 | 1 | 3
+ 2 | 12:00:00+01 | 1 | 4
+ 3 | 13:00:00+01 | 2 | 6
+ 4 | 14:00:00+01 | 3 | 6
+ 5 | 15:00:00+01 | 4 | 7
+ 6 | 15:00:00+01 | 4 | 7
+ 7 | 17:00:00+01 | 7 | 9
+ 8 | 18:00:00+01 | 7 | 10
+ 9 | 19:00:00+01 | 8 | 10
+ 10 | 20:00:00+01 | 9 | 10
+(10 rows)
+
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz desc range between
+ '70 min' preceding and '2 hours' following);
+ id | f_timetz | first_value | last_value
+----+-------------+-------------+------------
+ 10 | 20:00:00+01 | 10 | 8
+ 9 | 19:00:00+01 | 10 | 7
+ 8 | 18:00:00+01 | 9 | 7
+ 7 | 17:00:00+01 | 8 | 5
+ 6 | 15:00:00+01 | 6 | 3
+ 5 | 15:00:00+01 | 6 | 3
+ 4 | 14:00:00+01 | 6 | 2
+ 3 | 13:00:00+01 | 4 | 1
+ 2 | 12:00:00+01 | 3 | 1
+ 1 | 11:00:00+01 | 2 | 1
+(10 rows)
+
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval range between
+ '1 year'::interval preceding and '1 year'::interval following);
+ id | f_interval | first_value | last_value
+----+------------+-------------+------------
+ 1 | @ 1 year | 1 | 2
+ 2 | @ 2 years | 1 | 3
+ 3 | @ 3 years | 2 | 4
+ 4 | @ 4 years | 3 | 6
+ 5 | @ 5 years | 4 | 6
+ 6 | @ 5 years | 4 | 6
+ 7 | @ 7 years | 7 | 8
+ 8 | @ 8 years | 7 | 9
+ 9 | @ 9 years | 8 | 10
+ 10 | @ 10 years | 9 | 10
+(10 rows)
+
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval desc range between
+ '1 year' preceding and '1 year' following);
+ id | f_interval | first_value | last_value
+----+------------+-------------+------------
+ 10 | @ 10 years | 10 | 9
+ 9 | @ 9 years | 10 | 8
+ 8 | @ 8 years | 9 | 7
+ 7 | @ 7 years | 8 | 7
+ 6 | @ 5 years | 6 | 4
+ 5 | @ 5 years | 6 | 4
+ 4 | @ 4 years | 6 | 3
+ 3 | @ 3 years | 4 | 2
+ 2 | @ 2 years | 3 | 1
+ 1 | @ 1 year | 2 | 1
+(10 rows)
+
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz range between
+ '1 year'::interval preceding and '1 year'::interval following);
+ id | f_timestamptz | first_value | last_value
+----+------------------------------+-------------+------------
+ 1 | Thu Oct 19 02:23:54 2000 PDT | 1 | 3
+ 2 | Fri Oct 19 02:23:54 2001 PDT | 1 | 4
+ 3 | Fri Oct 19 02:23:54 2001 PDT | 1 | 4
+ 4 | Sat Oct 19 02:23:54 2002 PDT | 2 | 5
+ 5 | Sun Oct 19 02:23:54 2003 PDT | 4 | 6
+ 6 | Tue Oct 19 02:23:54 2004 PDT | 5 | 7
+ 7 | Wed Oct 19 02:23:54 2005 PDT | 6 | 8
+ 8 | Thu Oct 19 02:23:54 2006 PDT | 7 | 9
+ 9 | Fri Oct 19 02:23:54 2007 PDT | 8 | 10
+ 10 | Sun Oct 19 02:23:54 2008 PDT | 9 | 10
+(10 rows)
+
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz desc range between
+ '1 year' preceding and '1 year' following);
+ id | f_timestamptz | first_value | last_value
+----+------------------------------+-------------+------------
+ 10 | Sun Oct 19 02:23:54 2008 PDT | 10 | 9
+ 9 | Fri Oct 19 02:23:54 2007 PDT | 10 | 8
+ 8 | Thu Oct 19 02:23:54 2006 PDT | 9 | 7
+ 7 | Wed Oct 19 02:23:54 2005 PDT | 8 | 6
+ 6 | Tue Oct 19 02:23:54 2004 PDT | 7 | 5
+ 5 | Sun Oct 19 02:23:54 2003 PDT | 6 | 4
+ 4 | Sat Oct 19 02:23:54 2002 PDT | 5 | 2
+ 3 | Fri Oct 19 02:23:54 2001 PDT | 4 | 1
+ 2 | Fri Oct 19 02:23:54 2001 PDT | 4 | 1
+ 1 | Thu Oct 19 02:23:54 2000 PDT | 3 | 1
+(10 rows)
+
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp range between
+ '1 year'::interval preceding and '1 year'::interval following);
+ id | f_timestamp | first_value | last_value
+----+--------------------------+-------------+------------
+ 1 | Thu Oct 19 10:23:54 2000 | 1 | 3
+ 2 | Fri Oct 19 10:23:54 2001 | 1 | 4
+ 3 | Fri Oct 19 10:23:54 2001 | 1 | 4
+ 4 | Sat Oct 19 10:23:54 2002 | 2 | 5
+ 5 | Sun Oct 19 10:23:54 2003 | 4 | 6
+ 6 | Tue Oct 19 10:23:54 2004 | 5 | 7
+ 7 | Wed Oct 19 10:23:54 2005 | 6 | 8
+ 8 | Thu Oct 19 10:23:54 2006 | 7 | 9
+ 9 | Fri Oct 19 10:23:54 2007 | 8 | 10
+ 10 | Sun Oct 19 10:23:54 2008 | 9 | 10
+(10 rows)
+
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp desc range between
+ '1 year' preceding and '1 year' following);
+ id | f_timestamp | first_value | last_value
+----+--------------------------+-------------+------------
+ 10 | Sun Oct 19 10:23:54 2008 | 10 | 9
+ 9 | Fri Oct 19 10:23:54 2007 | 10 | 8
+ 8 | Thu Oct 19 10:23:54 2006 | 9 | 7
+ 7 | Wed Oct 19 10:23:54 2005 | 8 | 6
+ 6 | Tue Oct 19 10:23:54 2004 | 7 | 5
+ 5 | Sun Oct 19 10:23:54 2003 | 6 | 4
+ 4 | Sat Oct 19 10:23:54 2002 | 5 | 2
+ 3 | Fri Oct 19 10:23:54 2001 | 4 | 1
+ 2 | Fri Oct 19 10:23:54 2001 | 4 | 1
+ 1 | Thu Oct 19 10:23:54 2000 | 3 | 1
+(10 rows)
+
+-- RANGE offset PRECEDING/FOLLOWING error cases
+select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column
+LINE 1: select sum(salary) over (order by enroll_date, salary range ...
+ ^
+select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column
+LINE 1: select sum(salary) over (range between '1 year'::interval pr...
+ ^
+select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: RANGE with offset PRECEDING/FOLLOWING is not supported for column type text
+LINE 1: ... sum(salary) over (order by depname range between '1 year'::...
+ ^
+select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: RANGE with offset PRECEDING/FOLLOWING is not supported for column type date and offset type integer
+LINE 1: ...ll_date) over (order by enroll_date range between 1 precedin...
+ ^
+HINT: Cast the offset value to an appropriate type.
+select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: invalid preceding or following size in window function
+select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: invalid preceding or following size in window function
+select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: RANGE with offset PRECEDING/FOLLOWING is not supported for column type integer and offset type interval
+LINE 1: ...(enroll_date) over (order by salary range between '1 year'::...
+ ^
+HINT: Cast the offset value to an appropriate type.
+select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+ERROR: invalid preceding or following size in window function
+-- GROUPS tests
+SELECT sum(unique1) over (order by four groups between unbounded preceding and current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 12 | 0 | 0
+ 12 | 8 | 0
+ 12 | 4 | 0
+ 27 | 5 | 1
+ 27 | 9 | 1
+ 27 | 1 | 1
+ 35 | 6 | 2
+ 35 | 2 | 2
+ 45 | 3 | 3
+ 45 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 0 | 0
+ 45 | 8 | 0
+ 45 | 4 | 0
+ 45 | 5 | 1
+ 45 | 9 | 1
+ 45 | 1 | 1
+ 45 | 6 | 2
+ 45 | 2 | 2
+ 45 | 3 | 3
+ 45 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 0 | 0
+ 45 | 8 | 0
+ 45 | 4 | 0
+ 33 | 5 | 1
+ 33 | 9 | 1
+ 33 | 1 | 1
+ 18 | 6 | 2
+ 18 | 2 | 2
+ 10 | 3 | 3
+ 10 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 45 | 0 | 0
+ 45 | 8 | 0
+ 45 | 4 | 0
+ 45 | 5 | 1
+ 45 | 9 | 1
+ 45 | 1 | 1
+ 33 | 6 | 2
+ 33 | 2 | 2
+ 18 | 3 | 3
+ 18 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 33 | 0 | 0
+ 33 | 8 | 0
+ 33 | 4 | 0
+ 18 | 5 | 1
+ 18 | 9 | 1
+ 18 | 1 | 1
+ 10 | 6 | 2
+ 10 | 2 | 2
+ | 3 | 3
+ | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 35 | 0 | 0
+ 35 | 8 | 0
+ 35 | 4 | 0
+ 45 | 5 | 1
+ 45 | 9 | 1
+ 45 | 1 | 1
+ 45 | 6 | 2
+ 45 | 2 | 2
+ 45 | 3 | 3
+ 45 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ | 0 | 0
+ | 8 | 0
+ | 4 | 0
+ 12 | 5 | 1
+ 12 | 9 | 1
+ 12 | 1 | 1
+ 27 | 6 | 2
+ 27 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 27 | 0 | 0
+ 27 | 8 | 0
+ 27 | 4 | 0
+ 35 | 5 | 1
+ 35 | 9 | 1
+ 35 | 1 | 1
+ 45 | 6 | 2
+ 45 | 2 | 2
+ 33 | 3 | 3
+ 33 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 12 | 0 | 0
+ 12 | 8 | 0
+ 12 | 4 | 0
+ 15 | 5 | 1
+ 15 | 9 | 1
+ 15 | 1 | 1
+ 8 | 6 | 2
+ 8 | 2 | 2
+ 10 | 3 | 3
+ 10 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude current row), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 27 | 0 | 0
+ 19 | 8 | 0
+ 23 | 4 | 0
+ 30 | 5 | 1
+ 26 | 9 | 1
+ 34 | 1 | 1
+ 39 | 6 | 2
+ 43 | 2 | 2
+ 30 | 3 | 3
+ 26 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude group), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 15 | 0 | 0
+ 15 | 8 | 0
+ 15 | 4 | 0
+ 20 | 5 | 1
+ 20 | 9 | 1
+ 20 | 1 | 1
+ 37 | 6 | 2
+ 37 | 2 | 2
+ 23 | 3 | 3
+ 23 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude ties), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four
+-----+---------+------
+ 15 | 0 | 0
+ 23 | 8 | 0
+ 19 | 4 | 0
+ 25 | 5 | 1
+ 29 | 9 | 1
+ 21 | 1 | 1
+ 43 | 6 | 2
+ 39 | 2 | 2
+ 26 | 3 | 3
+ 30 | 7 | 3
+(10 rows)
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following),unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four | ten
+-----+---------+------+-----
+ 0 | 0 | 0 | 0
+ 1 | 1 | 1 | 1
+ 2 | 2 | 2 | 2
+ 3 | 3 | 3 | 3
+ 4 | 4 | 0 | 4
+ 5 | 5 | 1 | 5
+ 6 | 6 | 2 | 6
+ 7 | 7 | 3 | 7
+ 8 | 8 | 0 | 8
+ 9 | 9 | 1 | 9
+(10 rows)
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude current row), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four | ten
+-----+---------+------+-----
+ | 0 | 0 | 0
+ | 1 | 1 | 1
+ | 2 | 2 | 2
+ | 3 | 3 | 3
+ | 4 | 0 | 4
+ | 5 | 1 | 5
+ | 6 | 2 | 6
+ | 7 | 3 | 7
+ | 8 | 0 | 8
+ | 9 | 1 | 9
+(10 rows)
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude group), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four | ten
+-----+---------+------+-----
+ | 0 | 0 | 0
+ | 1 | 1 | 1
+ | 2 | 2 | 2
+ | 3 | 3 | 3
+ | 4 | 0 | 4
+ | 5 | 1 | 5
+ | 6 | 2 | 6
+ | 7 | 3 | 7
+ | 8 | 0 | 8
+ | 9 | 1 | 9
+(10 rows)
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude ties), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+ sum | unique1 | four | ten
+-----+---------+------+-----
+ 0 | 0 | 0 | 0
+ 1 | 1 | 1 | 1
+ 2 | 2 | 2 | 2
+ 3 | 3 | 3 | 3
+ 4 | 4 | 0 | 4
+ 5 | 5 | 1 | 5
+ 6 | 6 | 2 | 6
+ 7 | 7 | 3 | 7
+ 8 | 8 | 0 | 8
+ 9 | 9 | 1 | 9
+(10 rows)
+
+select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lead(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+ first_value | lead | nth_value | salary | enroll_date
+-------------+------+-----------+--------+-------------
+ 5000 | 6000 | 5000 | 5000 | 10-01-2006
+ 5000 | 3900 | 5000 | 6000 | 10-01-2006
+ 5000 | 4800 | 5000 | 3900 | 12-23-2006
+ 3900 | 5200 | 3900 | 4800 | 08-01-2007
+ 3900 | 4800 | 3900 | 5200 | 08-01-2007
+ 4800 | 5200 | 4800 | 4800 | 08-08-2007
+ 4800 | 3500 | 4800 | 5200 | 08-15-2007
+ 5200 | 4500 | 5200 | 3500 | 12-10-2007
+ 3500 | 4200 | 3500 | 4500 | 01-01-2008
+ 3500 | | 3500 | 4200 | 01-01-2008
+(10 rows)
+
+select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lag(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+ last_value | lag | salary | enroll_date
+------------+------+--------+-------------
+ 3900 | | 5000 | 10-01-2006
+ 3900 | 5000 | 6000 | 10-01-2006
+ 5200 | 6000 | 3900 | 12-23-2006
+ 4800 | 3900 | 4800 | 08-01-2007
+ 4800 | 4800 | 5200 | 08-01-2007
+ 5200 | 5200 | 4800 | 08-08-2007
+ 3500 | 4800 | 5200 | 08-15-2007
+ 4200 | 5200 | 3500 | 12-10-2007
+ 4200 | 3500 | 4500 | 01-01-2008
+ 4200 | 4500 | 4200 | 01-01-2008
+(10 rows)
+
+select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude current row),
+ lead(salary) over(order by enroll_date groups between 1 following and 3 following exclude ties),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 following and 3 following
+ exclude ties),
+ salary, enroll_date from empsalary;
+ first_value | lead | nth_value | salary | enroll_date
+-------------+------+-----------+--------+-------------
+ 3900 | 6000 | 3900 | 5000 | 10-01-2006
+ 3900 | 3900 | 3900 | 6000 | 10-01-2006
+ 4800 | 4800 | 4800 | 3900 | 12-23-2006
+ 4800 | 5200 | 4800 | 4800 | 08-01-2007
+ 4800 | 4800 | 4800 | 5200 | 08-01-2007
+ 5200 | 5200 | 5200 | 4800 | 08-08-2007
+ 3500 | 3500 | 3500 | 5200 | 08-15-2007
+ 4500 | 4500 | 4500 | 3500 | 12-10-2007
+ | 4200 | | 4500 | 01-01-2008
+ | | | 4200 | 01-01-2008
+(10 rows)
+
+select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude group),
+ lag(salary) over(order by enroll_date groups between 1 following and 3 following exclude group),
+ salary, enroll_date from empsalary;
+ last_value | lag | salary | enroll_date
+------------+------+--------+-------------
+ 4800 | | 5000 | 10-01-2006
+ 4800 | 5000 | 6000 | 10-01-2006
+ 5200 | 6000 | 3900 | 12-23-2006
+ 3500 | 3900 | 4800 | 08-01-2007
+ 3500 | 4800 | 5200 | 08-01-2007
+ 4200 | 5200 | 4800 | 08-08-2007
+ 4200 | 4800 | 5200 | 08-15-2007
+ 4200 | 5200 | 3500 | 12-10-2007
+ | 3500 | 4500 | 01-01-2008
+ | 4500 | 4200 | 01-01-2008
+(10 rows)
+
+-- Show differences in offset interpretation between ROWS, RANGE, and GROUPS
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 4
+ 3 | 9
+ 5 | 15
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 68
+(18 rows)
+
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 1
+ 3 | 3
+ 5 | 5
+ 7 | 7
+ 9 | 9
+ 11 | 11
+ 13 | 13
+ 15 | 15
+ 17 | 17
+ 19 | 19
+ 21 | 21
+ 23 | 23
+ 25 | 25
+ 27 | 27
+ 29 | 29
+ 31 | 31
+ 33 | 33
+ 35 | 35
+(18 rows)
+
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 4
+ 3 | 9
+ 5 | 15
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 68
+(18 rows)
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 2
+ 1 | 3
+ 1 | 7
+ 5 | 13
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 105
+ 37 | 111
+ 39 | 117
+ 41 | 123
+ 43 | 129
+ 45 | 135
+ 47 | 141
+ 49 | 96
+(26 rows)
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 3
+ 1 | 3
+ 1 | 3
+ 5 | 5
+ 7 | 7
+ 9 | 9
+ 11 | 11
+ 13 | 13
+ 15 | 15
+ 17 | 17
+ 19 | 19
+ 21 | 21
+ 23 | 23
+ 25 | 25
+ 27 | 27
+ 29 | 29
+ 31 | 31
+ 33 | 33
+ 35 | 35
+ 37 | 37
+ 39 | 39
+ 41 | 41
+ 43 | 43
+ 45 | 45
+ 47 | 47
+ 49 | 49
+(26 rows)
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+ x | sum
+----+-----
+ 1 | 8
+ 1 | 8
+ 1 | 8
+ 5 | 15
+ 7 | 21
+ 9 | 27
+ 11 | 33
+ 13 | 39
+ 15 | 45
+ 17 | 51
+ 19 | 57
+ 21 | 63
+ 23 | 69
+ 25 | 75
+ 27 | 81
+ 29 | 87
+ 31 | 93
+ 33 | 99
+ 35 | 105
+ 37 | 111
+ 39 | 117
+ 41 | 123
+ 43 | 129
+ 45 | 135
+ 47 | 141
+ 49 | 96
+(26 rows)
+
+-- with UNION
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk2)s LIMIT 0;
+ count
+-------
+(0 rows)
+
+-- check some degenerate cases
+create temp table t1 (f1 int, f2 int8);
+insert into t1 values (1,1),(1,2),(2,2);
+select f1, sum(f1) over (partition by f1
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+ERROR: RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column
+LINE 1: select f1, sum(f1) over (partition by f1
+ ^
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+ QUERY PLAN
+---------------------------------
+ WindowAgg
+ -> Sort
+ Sort Key: f1
+ -> Seq Scan on t1
+ Filter: (f1 = f2)
+(5 rows)
+
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 | 1
+ 2 | 2
+(2 rows)
+
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ range between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 |
+ 2 |
+(2 rows)
+
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ range between 1 following and 2 following)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 |
+ 2 |
+(2 rows)
+
+select f1, sum(f1) over (partition by f1
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+ERROR: GROUPS mode requires an ORDER BY clause
+LINE 1: select f1, sum(f1) over (partition by f1
+ ^
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+ QUERY PLAN
+---------------------------------
+ WindowAgg
+ -> Sort
+ Sort Key: f1
+ -> Seq Scan on t1
+ Filter: (f1 = f2)
+(5 rows)
+
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 | 1
+ 2 | 2
+(2 rows)
+
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ groups between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 |
+ 2 |
+(2 rows)
+
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ groups between 1 following and 2 following)
+from t1 where f1 = f2;
+ f1 | sum
+----+-----
+ 1 |
+ 2 |
+(2 rows)
+
+-- ordering by a non-integer constant is allowed
+SELECT rank() OVER (ORDER BY length('abc'));
+ rank
+------
+ 1
+(1 row)
+
+-- can't order by another window function
+SELECT rank() OVER (ORDER BY rank() OVER (ORDER BY random()));
+ERROR: window functions are not allowed in window definitions
+LINE 1: SELECT rank() OVER (ORDER BY rank() OVER (ORDER BY random())...
+ ^
+-- some other errors
+SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY salary) < 10;
+ERROR: window functions are not allowed in WHERE
+LINE 1: SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY sa...
+ ^
+SELECT * FROM empsalary INNER JOIN tenk1 ON row_number() OVER (ORDER BY salary) < 10;
+ERROR: window functions are not allowed in JOIN conditions
+LINE 1: SELECT * FROM empsalary INNER JOIN tenk1 ON row_number() OVE...
+ ^
+SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GROUP BY 1;
+ERROR: window functions are not allowed in GROUP BY
+LINE 1: SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GRO...
+ ^
+SELECT * FROM rank() OVER (ORDER BY random());
+ERROR: syntax error at or near "ORDER"
+LINE 1: SELECT * FROM rank() OVER (ORDER BY random());
+ ^
+DELETE FROM empsalary WHERE (rank() OVER (ORDER BY random())) > 10;
+ERROR: window functions are not allowed in WHERE
+LINE 1: DELETE FROM empsalary WHERE (rank() OVER (ORDER BY random())...
+ ^
+DELETE FROM empsalary RETURNING rank() OVER (ORDER BY random());
+ERROR: window functions are not allowed in RETURNING
+LINE 1: DELETE FROM empsalary RETURNING rank() OVER (ORDER BY random...
+ ^
+SELECT count(*) OVER w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY unique1);
+ERROR: window "w" is already defined
+LINE 1: ...w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY ...
+ ^
+SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+ERROR: syntax error at or near "ORDER"
+LINE 1: SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM te...
+ ^
+SELECT count() OVER () FROM tenk1;
+ERROR: count(*) must be used to call a parameterless aggregate function
+LINE 1: SELECT count() OVER () FROM tenk1;
+ ^
+SELECT generate_series(1, 100) OVER () FROM empsalary;
+ERROR: OVER specified, but generate_series is not a window function nor an aggregate function
+LINE 1: SELECT generate_series(1, 100) OVER () FROM empsalary;
+ ^
+SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ERROR: argument of ntile must be greater than zero
+SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+ERROR: argument of nth_value must be greater than zero
+-- filter
+SELECT sum(salary), row_number() OVER (ORDER BY depname), sum(
+ sum(salary) FILTER (WHERE enroll_date > '2007-01-01')
+) FILTER (WHERE depname <> 'sales') OVER (ORDER BY depname DESC) AS "filtered_sum",
+ depname
+FROM empsalary GROUP BY depname;
+ sum | row_number | filtered_sum | depname
+-------+------------+--------------+-----------
+ 25100 | 1 | 22600 | develop
+ 7400 | 2 | 3500 | personnel
+ 14600 | 3 | | sales
+(3 rows)
+
+-- Test pushdown of quals into a subquery containing window functions
+-- pushdown is safe because all PARTITION BY clauses include depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname) depsalary,
+ min(salary) OVER (PARTITION BY depname || 'A', depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+ QUERY PLAN
+--------------------------------------------------------------------------
+ Subquery Scan on emp
+ -> WindowAgg
+ -> WindowAgg
+ -> Sort
+ Sort Key: (((empsalary.depname)::text || 'A'::text))
+ -> Seq Scan on empsalary
+ Filter: ((depname)::text = 'sales'::text)
+(7 rows)
+
+-- pushdown is unsafe because there's a PARTITION BY clause without depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY enroll_date) enroll_salary,
+ min(salary) OVER (PARTITION BY depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+ QUERY PLAN
+-------------------------------------------------------
+ Subquery Scan on emp
+ Filter: ((emp.depname)::text = 'sales'::text)
+ -> WindowAgg
+ -> Sort
+ Sort Key: empsalary.enroll_date
+ -> WindowAgg
+ -> Sort
+ Sort Key: empsalary.depname
+ -> Seq Scan on empsalary
+(9 rows)
+
+-- Test Sort node collapsing
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname order by empno) depsalary,
+ min(salary) OVER (PARTITION BY depname, empno order by enroll_date) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+ QUERY PLAN
+----------------------------------------------------------------------
+ Subquery Scan on emp
+ -> WindowAgg
+ -> WindowAgg
+ -> Sort
+ Sort Key: empsalary.empno, empsalary.enroll_date
+ -> Seq Scan on empsalary
+ Filter: ((depname)::text = 'sales'::text)
+(7 rows)
+
+-- Test Sort node reordering
+EXPLAIN (COSTS OFF)
+SELECT
+ lead(1) OVER (PARTITION BY depname ORDER BY salary, enroll_date),
+ lag(1) OVER (PARTITION BY depname ORDER BY salary,enroll_date,empno)
+FROM empsalary;
+ QUERY PLAN
+-------------------------------------------------------------
+ WindowAgg
+ -> WindowAgg
+ -> Sort
+ Sort Key: depname, salary, enroll_date, empno
+ -> Seq Scan on empsalary
+(5 rows)
+
+-- Test incremental sorting
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+ QUERY PLAN
+-----------------------------------------------------------------------------------
+ Subquery Scan on emp
+ Filter: ((emp.first_emp = 1) OR (emp.last_emp = 1))
+ -> WindowAgg
+ -> Incremental Sort
+ Sort Key: empsalary.depname, empsalary.enroll_date
+ Presorted Key: empsalary.depname
+ -> WindowAgg
+ -> Sort
+ Sort Key: empsalary.depname, empsalary.enroll_date DESC
+ -> Seq Scan on empsalary
+(10 rows)
+
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+ depname | empno | salary | enroll_date | first_emp | last_emp
+-----------+-------+--------+-------------+-----------+----------
+ develop | 8 | 6000 | 10-01-2006 | 1 | 5
+ develop | 7 | 4200 | 01-01-2008 | 5 | 1
+ personnel | 2 | 3900 | 12-23-2006 | 1 | 2
+ personnel | 5 | 3500 | 12-10-2007 | 2 | 1
+ sales | 1 | 5000 | 10-01-2006 | 1 | 3
+ sales | 4 | 4800 | 08-08-2007 | 3 | 1
+(6 rows)
+
+-- cleanup
+DROP TABLE empsalary;
+-- test user-defined window function with named args and default args
+CREATE FUNCTION nth_value_def(val anyelement, n integer = 1) RETURNS anyelement
+ LANGUAGE internal WINDOW IMMUTABLE STRICT AS 'window_nth_value';
+SELECT nth_value_def(n := 2, val := ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+ nth_value_def | ten | four
+---------------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 0 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 1 | 9 | 1
+ | 0 | 2
+ 3 | 1 | 3
+ 3 | 3 | 3
+(10 rows)
+
+SELECT nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+ nth_value_def | ten | four
+---------------+-----+------
+ 0 | 0 | 0
+ 0 | 0 | 0
+ 0 | 4 | 0
+ 1 | 1 | 1
+ 1 | 1 | 1
+ 1 | 7 | 1
+ 1 | 9 | 1
+ 0 | 0 | 2
+ 1 | 1 | 3
+ 1 | 3 | 3
+(10 rows)
+
+--
+-- Test the basic moving-aggregate machinery
+--
+-- create aggregates that record the series of transform calls (these are
+-- intentionally not true inverses)
+CREATE FUNCTION logging_sfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '*' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+CREATE FUNCTION logging_msfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '+' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+CREATE FUNCTION logging_minvfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+CREATE AGGREGATE logging_agg_nonstrict (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict
+);
+CREATE AGGREGATE logging_agg_nonstrict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+CREATE FUNCTION logging_sfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '*' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+CREATE FUNCTION logging_msfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '+' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+CREATE FUNCTION logging_minvfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+CREATE AGGREGATE logging_agg_strict (text)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict
+);
+CREATE AGGREGATE logging_agg_strict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+-- test strict and non-strict cases
+SELECT
+ p::text || ',' || i::text || ':' || COALESCE(v::text, 'NULL') AS row,
+ logging_agg_nonstrict(v) over wnd as nstrict,
+ logging_agg_nonstrict_initcond(v) over wnd as nstrict_init,
+ logging_agg_strict(v::text) over wnd as strict,
+ logging_agg_strict_initcond(v) over wnd as strict_init
+FROM (VALUES
+ (1, 1, NULL),
+ (1, 2, 'a'),
+ (1, 3, 'b'),
+ (1, 4, NULL),
+ (1, 5, NULL),
+ (1, 6, 'c'),
+ (2, 1, NULL),
+ (2, 2, 'x'),
+ (3, 1, 'z')
+) AS t(p, i, v)
+WINDOW wnd AS (PARTITION BY P ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+ row | nstrict | nstrict_init | strict | strict_init
+----------+-----------------------------------------------+-------------------------------------------------+-----------+----------------
+ 1,1:NULL | +NULL | MI+NULL | | MI
+ 1,2:a | +NULL+'a' | MI+NULL+'a' | a | MI+'a'
+ 1,3:b | +NULL+'a'-NULL+'b' | MI+NULL+'a'-NULL+'b' | a+'b' | MI+'a'+'b'
+ 1,4:NULL | +NULL+'a'-NULL+'b'-'a'+NULL | MI+NULL+'a'-NULL+'b'-'a'+NULL | a+'b'-'a' | MI+'a'+'b'-'a'
+ 1,5:NULL | +NULL+'a'-NULL+'b'-'a'+NULL-'b'+NULL | MI+NULL+'a'-NULL+'b'-'a'+NULL-'b'+NULL | | MI
+ 1,6:c | +NULL+'a'-NULL+'b'-'a'+NULL-'b'+NULL-NULL+'c' | MI+NULL+'a'-NULL+'b'-'a'+NULL-'b'+NULL-NULL+'c' | c | MI+'c'
+ 2,1:NULL | +NULL | MI+NULL | | MI
+ 2,2:x | +NULL+'x' | MI+NULL+'x' | x | MI+'x'
+ 3,1:z | +'z' | MI+'z' | z | MI+'z'
+(9 rows)
+
+-- and again, but with filter
+SELECT
+ p::text || ',' || i::text || ':' ||
+ CASE WHEN f THEN COALESCE(v::text, 'NULL') ELSE '-' END as row,
+ logging_agg_nonstrict(v) filter(where f) over wnd as nstrict_filt,
+ logging_agg_nonstrict_initcond(v) filter(where f) over wnd as nstrict_init_filt,
+ logging_agg_strict(v::text) filter(where f) over wnd as strict_filt,
+ logging_agg_strict_initcond(v) filter(where f) over wnd as strict_init_filt
+FROM (VALUES
+ (1, 1, true, NULL),
+ (1, 2, false, 'a'),
+ (1, 3, true, 'b'),
+ (1, 4, false, NULL),
+ (1, 5, false, NULL),
+ (1, 6, false, 'c'),
+ (2, 1, false, NULL),
+ (2, 2, true, 'x'),
+ (3, 1, true, 'z')
+) AS t(p, i, f, v)
+WINDOW wnd AS (PARTITION BY p ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+ row | nstrict_filt | nstrict_init_filt | strict_filt | strict_init_filt
+----------+--------------+-------------------+-------------+------------------
+ 1,1:NULL | +NULL | MI+NULL | | MI
+ 1,2:- | +NULL | MI+NULL | | MI
+ 1,3:b | +'b' | MI+'b' | b | MI+'b'
+ 1,4:- | +'b' | MI+'b' | b | MI+'b'
+ 1,5:- | | MI | | MI
+ 1,6:- | | MI | | MI
+ 2,1:- | | MI | | MI
+ 2,2:x | +'x' | MI+'x' | x | MI+'x'
+ 3,1:z | +'z' | MI+'z' | z | MI+'z'
+(9 rows)
+
+-- test that volatile arguments disable moving-aggregate mode
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text)
+ over wnd as inverse,
+ logging_agg_strict(v::text || CASE WHEN random() < 0 then '?' ELSE '' END)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+ row | inverse | noinverse
+-----+---------------+-----------
+ 1:a | a | a
+ 2:b | a+'b' | a*'b'
+ 3:c | a+'b'-'a'+'c' | b*'c'
+(3 rows)
+
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text) filter(where true)
+ over wnd as inverse,
+ logging_agg_strict(v::text) filter(where random() >= 0)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+ row | inverse | noinverse
+-----+---------------+-----------
+ 1:a | a | a
+ 2:b | a+'b' | a*'b'
+ 3:c | a+'b'-'a'+'c' | b*'c'
+(3 rows)
+
+-- test that non-overlapping windows don't use inverse transitions
+SELECT
+ logging_agg_strict(v::text) OVER wnd
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ORDER BY i;
+ logging_agg_strict
+--------------------
+ a
+ b
+ c
+(3 rows)
+
+-- test that returning NULL from the inverse transition functions
+-- restarts the aggregation from scratch. The second aggregate is supposed
+-- to test cases where only some aggregates restart, the third one checks
+-- that one aggregate restarting doesn't cause others to restart.
+CREATE FUNCTION sum_int_randrestart_minvfunc(int4, int4) RETURNS int4 AS
+$$ SELECT CASE WHEN random() < 0.2 THEN NULL ELSE $1 - $2 END $$
+LANGUAGE SQL STRICT;
+CREATE AGGREGATE sum_int_randomrestart (int4)
+(
+ stype = int4,
+ sfunc = int4pl,
+ mstype = int4,
+ msfunc = int4pl,
+ minvfunc = sum_int_randrestart_minvfunc
+);
+WITH
+vs AS (
+ SELECT i, (random() * 100)::int4 AS v
+ FROM generate_series(1, 100) AS i
+),
+sum_following AS (
+ SELECT i, SUM(v) OVER
+ (ORDER BY i DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS s
+ FROM vs
+)
+SELECT DISTINCT
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+FROM vs
+JOIN sum_following ON sum_following.i = vs.i
+WINDOW fwd AS (
+ ORDER BY vs.i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
+);
+ eq1 | eq2 | eq3
+-----+-----+-----
+ t | t | t
+(1 row)
+
+--
+-- Test various built-in aggregates that have moving-aggregate support
+--
+-- test inverse transition functions handle NULLs properly
+SELECT i,AVG(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 1.5000000000000000
+ 2 | 2.0000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.5),(2,2.5),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+--------------------
+ 1 | 2.0000000000000000
+ 2 | 2.5000000000000000
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,AVG(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+ i | avg
+---+------------
+ 1 | @ 1.5 secs
+ 2 | @ 2 secs
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::money) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1.10'),(2,'2.20'),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-------
+ 1 | $3.30
+ 2 | $2.20
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+----------
+ 1 | @ 3 secs
+ 2 | @ 2 secs
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.1),(2,2.2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3.3
+ 2 | 2.2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT SUM(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.01),(2,2),(3,3)) v(i,n);
+ sum
+------
+ 6.01
+ 5
+ 3
+(3 rows)
+
+SELECT i,COUNT(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | count
+---+-------
+ 1 | 2
+ 2 | 1
+ 3 | 0
+ 4 | 0
+(4 rows)
+
+SELECT i,COUNT(*) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | count
+---+-------
+ 1 | 4
+ 2 | 3
+ 3 | 2
+ 4 | 1
+(4 rows)
+
+SELECT VAR_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_pop
+-----------------------
+ 21704.000000000000
+ 13868.750000000000
+ 11266.666666666667
+ 4225.0000000000000000
+ 0
+(5 rows)
+
+SELECT VAR_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_pop
+-----------------------
+ 21704.000000000000
+ 13868.750000000000
+ 11266.666666666667
+ 4225.0000000000000000
+ 0
+(5 rows)
+
+SELECT VAR_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_pop
+-----------------------
+ 21704.000000000000
+ 13868.750000000000
+ 11266.666666666667
+ 4225.0000000000000000
+ 0
+(5 rows)
+
+SELECT VAR_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_pop
+-----------------------
+ 21704.000000000000
+ 13868.750000000000
+ 11266.666666666667
+ 4225.0000000000000000
+ 0
+(5 rows)
+
+SELECT VAR_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VAR_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ var_samp
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT VARIANCE(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ variance
+-----------------------
+ 27130.000000000000
+ 18491.666666666667
+ 16900.000000000000
+ 8450.0000000000000000
+
+(5 rows)
+
+SELECT STDDEV_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_pop
+---------------------
+ 147.322774885623
+ 147.322774885623
+ 117.765657133139
+ 106.144555520604
+ 65.0000000000000000
+ 0
+(6 rows)
+
+SELECT STDDEV_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_pop
+---------------------
+ 147.322774885623
+ 147.322774885623
+ 117.765657133139
+ 106.144555520604
+ 65.0000000000000000
+ 0
+(6 rows)
+
+SELECT STDDEV_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_pop
+---------------------
+ 147.322774885623
+ 147.322774885623
+ 117.765657133139
+ 106.144555520604
+ 65.0000000000000000
+ 0
+(6 rows)
+
+SELECT STDDEV_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_pop
+---------------------
+ 147.322774885623
+ 147.322774885623
+ 117.765657133139
+ 106.144555520604
+ 65.0000000000000000
+ 0
+(6 rows)
+
+SELECT STDDEV_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+ stddev_samp
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+SELECT STDDEV(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+ stddev
+---------------------
+ 164.711869639076
+ 164.711869639076
+ 135.984067694222
+ 130.000000000000
+ 91.9238815542511782
+
+(6 rows)
+
+-- test that inverse transition functions work with various frame options
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 1
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 2
+ 3 |
+ 4 |
+(4 rows)
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,3),(4,4)) t(i,v);
+ i | sum
+---+-----
+ 1 | 3
+ 2 | 6
+ 3 | 9
+ 4 | 7
+(4 rows)
+
+-- ensure aggregate over numeric properly recovers from NaN values
+SELECT a, b,
+ SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM (VALUES(1,1::numeric),(2,2),(3,'NaN'),(4,3),(5,4)) t(a,b);
+ a | b | sum
+---+-----+-----
+ 1 | 1 | 1
+ 2 | 2 | 3
+ 3 | NaN | NaN
+ 4 | 3 | NaN
+ 5 | 4 | 7
+(5 rows)
+
+-- It might be tempting for someone to add an inverse trans function for
+-- float and double precision. This should not be done as it can give incorrect
+-- results. This test should fail if anyone ever does this without thinking too
+-- hard about it.
+SELECT to_char(SUM(n::float8) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING),'999999999999999999999D9')
+ FROM (VALUES(1,1e20),(2,1)) n(i,n);
+ to_char
+--------------------------
+ 100000000000000000000
+ 1.0
+(2 rows)
+
+SELECT i, b, bool_and(b) OVER w, bool_or(b) OVER w
+ FROM (VALUES (1,true), (2,true), (3,false), (4,false), (5,true)) v(i,b)
+ WINDOW w AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING);
+ i | b | bool_and | bool_or
+---+---+----------+---------
+ 1 | t | t | t
+ 2 | t | f | t
+ 3 | f | f | f
+ 4 | f | f | t
+ 5 | t | t | t
+(5 rows)
+
+-- Tests for problems with failure to walk or mutate expressions
+-- within window frame clauses.
+-- test walker (fails with collation error if expressions are not walked)
+SELECT array_agg(i) OVER w
+ FROM generate_series(1,5) i
+WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+ array_agg
+-----------
+ {1}
+ {1,2}
+ {2,3}
+ {3,4}
+ {4,5}
+(5 rows)
+
+-- test mutator (fails when inlined if expressions are not mutated)
+CREATE FUNCTION pg_temp.f(group_size BIGINT) RETURNS SETOF integer[]
+AS $$
+ SELECT array_agg(s) OVER w
+ FROM generate_series(1,5) s
+ WINDOW w AS (ORDER BY s ROWS BETWEEN CURRENT ROW AND GROUP_SIZE FOLLOWING)
+$$ LANGUAGE SQL STABLE;
+EXPLAIN (costs off) SELECT * FROM pg_temp.f(2);
+ QUERY PLAN
+------------------------------------------------------
+ Subquery Scan on f
+ -> WindowAgg
+ -> Sort
+ Sort Key: s.s
+ -> Function Scan on generate_series s
+(5 rows)
+
+SELECT * FROM pg_temp.f(2);
+ f
+---------
+ {1,2,3}
+ {2,3,4}
+ {3,4,5}
+ {4,5}
+ {5}
+(5 rows)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/window.sql b/yql/essentials/tests/postgresql/original/cases/window.sql
new file mode 100644
index 0000000000..eae5fa6017
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/window.sql
@@ -0,0 +1,1330 @@
+--
+-- WINDOW FUNCTIONS
+--
+
+CREATE TEMPORARY TABLE empsalary (
+ depname varchar,
+ empno bigint,
+ salary int,
+ enroll_date date
+);
+
+INSERT INTO empsalary VALUES
+('develop', 10, 5200, '2007-08-01'),
+('sales', 1, 5000, '2006-10-01'),
+('personnel', 5, 3500, '2007-12-10'),
+('sales', 4, 4800, '2007-08-08'),
+('personnel', 2, 3900, '2006-12-23'),
+('develop', 7, 4200, '2008-01-01'),
+('develop', 9, 4500, '2008-01-01'),
+('sales', 3, 4800, '2007-08-01'),
+('develop', 8, 6000, '2006-10-01'),
+('develop', 11, 5200, '2007-08-15');
+
+SELECT depname, empno, salary, sum(salary) OVER (PARTITION BY depname) FROM empsalary ORDER BY depname, salary;
+
+SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary) FROM empsalary;
+
+-- with GROUP BY
+SELECT four, ten, SUM(SUM(four)) OVER (PARTITION BY four), AVG(ten) FROM tenk1
+GROUP BY four, ten ORDER BY four, ten;
+
+SELECT depname, empno, salary, sum(salary) OVER w FROM empsalary WINDOW w AS (PARTITION BY depname);
+
+SELECT depname, empno, salary, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary) ORDER BY rank() OVER w;
+
+-- empty window specification
+SELECT COUNT(*) OVER () FROM tenk1 WHERE unique2 < 10;
+
+SELECT COUNT(*) OVER w FROM tenk1 WHERE unique2 < 10 WINDOW w AS ();
+
+-- no window operation
+SELECT four FROM tenk1 WHERE FALSE WINDOW w AS (PARTITION BY ten);
+
+-- cumulative aggregate
+SELECT sum(four) OVER (PARTITION BY ten ORDER BY unique2) AS sum_1, ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT row_number() OVER (ORDER BY unique2) FROM tenk1 WHERE unique2 < 10;
+
+SELECT rank() OVER (PARTITION BY four ORDER BY ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT dense_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT percent_rank() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT cume_dist() OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT ntile(3) OVER (ORDER BY ten, four), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT ntile(NULL) OVER (ORDER BY ten, four), ten, four FROM tenk1 LIMIT 2;
+
+SELECT lag(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT lag(ten, four) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT lag(ten, four, 0) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+SELECT lag(ten, four, 0.7) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+
+SELECT lead(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT lead(ten * 2, 1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT lead(ten * 2, 1, -1) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+SELECT lead(ten * 2, 1, -1.4) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten;
+
+SELECT first_value(ten) OVER (PARTITION BY four ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+-- last_value returns the last row of the frame, which is CURRENT ROW in ORDER BY window.
+SELECT last_value(four) OVER (ORDER BY ten), ten, four FROM tenk1 WHERE unique2 < 10;
+
+SELECT last_value(ten) OVER (PARTITION BY four), ten, four FROM
+ (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s
+ ORDER BY four, ten;
+
+SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s;
+
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER (PARTITION BY two ORDER BY ten) AS wsum
+FROM tenk1 GROUP BY ten, two;
+
+SELECT count(*) OVER (PARTITION BY four), four FROM (SELECT * FROM tenk1 WHERE two = 1)s WHERE unique2 < 10;
+
+SELECT (count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY four ORDER BY ten))::varchar AS cntsum
+ FROM tenk1 WHERE unique2 < 10;
+
+-- opexpr with different windows evaluation.
+SELECT * FROM(
+ SELECT count(*) OVER (PARTITION BY four ORDER BY ten) +
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS total,
+ count(*) OVER (PARTITION BY four ORDER BY ten) AS fourcount,
+ sum(hundred) OVER (PARTITION BY two ORDER BY ten) AS twosum
+ FROM tenk1
+)sub
+WHERE total <> fourcount + twosum;
+
+SELECT avg(four) OVER (PARTITION BY four ORDER BY thousand / 100) FROM tenk1 WHERE unique2 < 10;
+
+SELECT ten, two, sum(hundred) AS gsum, sum(sum(hundred)) OVER win AS wsum
+FROM tenk1 GROUP BY ten, two WINDOW win AS (PARTITION BY two ORDER BY ten);
+
+-- more than one window with GROUP BY
+SELECT sum(salary),
+ row_number() OVER (ORDER BY depname),
+ sum(sum(salary)) OVER (ORDER BY depname DESC)
+FROM empsalary GROUP BY depname;
+
+-- identical windows with different names
+SELECT sum(salary) OVER w1, count(*) OVER w2
+FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary);
+
+-- subplan
+SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten)
+FROM tenk1 s WHERE unique2 < 10;
+
+-- empty table
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s;
+
+-- mixture of agg/wfunc in the same window
+SELECT sum(salary) OVER w, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);
+
+-- strict aggs
+SELECT empno, depname, salary, bonus, depadj, MIN(bonus) OVER (ORDER BY empno), MAX(depadj) OVER () FROM(
+ SELECT *,
+ CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
+ CASE WHEN
+ AVG(salary) OVER (PARTITION BY depname) < salary
+ THEN 200 END AS depadj FROM empsalary
+)s;
+
+-- window function over ungrouped agg over empty row set (bug before 9.1)
+SELECT SUM(COUNT(f1)) OVER () FROM int4_tbl WHERE f1=42;
+
+-- window function with ORDER BY an expression involving aggregates (9.1 bug)
+select ten,
+ sum(unique1) + sum(unique2) as res,
+ rank() over (order by sum(unique1) + sum(unique2)) as rank
+from tenk1
+group by ten order by ten;
+
+-- window and aggregate with GROUP BY expression (9.2 bug)
+explain (costs off)
+select first_value(max(x)) over (), y
+ from (select unique1 as x, ten+four as y from tenk1) ss
+ group by y;
+
+-- test non-default frame specifications
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten),
+ last_value(ten) over (partition by four order by ten)
+FROM (select distinct ten, four from tenk1) ss;
+
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and current row),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+
+SELECT four, ten,
+ sum(ten) over (partition by four order by ten range between unbounded preceding and unbounded following),
+ last_value(ten) over (partition by four order by ten range between unbounded preceding and unbounded following)
+FROM (select distinct ten, four from tenk1) ss;
+
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 range between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+
+SELECT four, ten/4 as two,
+ sum(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row),
+ last_value(ten/4) over (partition by four order by ten/4 rows between unbounded preceding and current row)
+FROM (select distinct ten, four from tenk1) ss;
+
+SELECT sum(unique1) over (order by four range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT first_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT last_value(unique1) over (ORDER BY four rows between current row and 2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between 1 following and 3 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (rows between unbounded preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (w range between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+
+SELECT sum(unique1) over (w range between unbounded preceding and current row exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four);
+
+SELECT first_value(unique1) over w,
+ nth_value(unique1, 2) over w AS nth_2,
+ last_value(unique1) over w, unique1, four
+FROM tenk1 WHERE unique1 < 10
+WINDOW w AS (order by four range between current row and unbounded following);
+
+SELECT sum(unique1) over
+ (order by unique1
+ rows (SELECT unique1 FROM tenk1 ORDER BY unique1 LIMIT 1) + 1 PRECEDING),
+ unique1
+FROM tenk1 WHERE unique1 < 10;
+
+CREATE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following) as sum_rows
+ FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude current row) as sum_rows FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude group) as sum_rows FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude ties) as sum_rows FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i rows between 1 preceding and 1 following
+ exclude no others) as sum_rows FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+CREATE OR REPLACE TEMP VIEW v_window AS
+ SELECT i, sum(i) over (order by i groups between 1 preceding and 1 following) as sum_rows FROM generate_series(1, 10) i;
+
+SELECT * FROM v_window;
+
+SELECT pg_get_viewdef('v_window');
+
+DROP VIEW v_window;
+
+CREATE TEMP VIEW v_window AS
+ SELECT i, min(i) over (order by i range between '1 day' preceding and '10 days' following) as min_i
+ FROM generate_series(now(), now()+'100 days'::interval, '1 hour') i;
+
+SELECT pg_get_viewdef('v_window');
+
+-- RANGE offset PRECEDING/FOLLOWING tests
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four desc range between 2::int8 preceding and 1::int2 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude no others),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 1::int2 preceding exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude ties),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four range between 2::int8 preceding and 6::int2 following exclude group),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by four order by unique1 range between 5::int8 preceding and 6::int2 following
+ exclude current row),unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+
+select sum(salary) over (order by enroll_date desc range between '1 year'::interval following and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude current row), salary, enroll_date from empsalary;
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude group), salary, enroll_date from empsalary;
+
+select sum(salary) over (order by enroll_date range between '1 year'::interval preceding and '1 year'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+select first_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lead(salary) over(order by salary range between 1000 preceding and 1000 following),
+ nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+
+select last_value(salary) over(order by salary range between 1000 preceding and 1000 following),
+ lag(salary) over(order by salary range between 1000 preceding and 1000 following),
+ salary from empsalary;
+
+select first_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude current row),
+ lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties),
+ nth_value(salary, 1) over(order by salary range between 1000 following and 3000 following
+ exclude ties),
+ salary from empsalary;
+
+select last_value(salary) over(order by salary range between 1000 following and 3000 following
+ exclude group),
+ lag(salary) over(order by salary range between 1000 following and 3000 following exclude group),
+ salary from empsalary;
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following),
+ salary, enroll_date from empsalary;
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude ties),
+ salary, enroll_date from empsalary;
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude group),
+ salary, enroll_date from empsalary;
+
+select first_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ last_value(salary) over(order by enroll_date range between unbounded preceding and '1 year'::interval following
+ exclude current row),
+ salary, enroll_date from empsalary;
+
+-- RANGE offset PRECEDING/FOLLOWING with null values
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls first range between 2 preceding and 2 following);
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x asc nulls last range between 2 preceding and 2 following);
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls first range between 2 preceding and 2 following);
+
+select x, y,
+ first_value(y) over w,
+ last_value(y) over w
+from
+ (select x, x as y from generate_series(1,5) as x
+ union all select null, 42
+ union all select null, 43) ss
+window w as
+ (order by x desc nulls last range between 2 preceding and 2 following);
+
+-- Check overflow behavior for various integer sizes
+
+select x, last_value(x) over (order by x::smallint range between current row and 2147450884 following)
+from generate_series(32764, 32766) x;
+
+select x, last_value(x) over (order by x::smallint desc range between current row and 2147450885 following)
+from generate_series(-32766, -32764) x;
+
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(2147483644, 2147483646) x;
+
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-2147483646, -2147483644) x;
+
+select x, last_value(x) over (order by x range between current row and 4 following)
+from generate_series(9223372036854775804, 9223372036854775806) x;
+
+select x, last_value(x) over (order by x desc range between current row and 5 following)
+from generate_series(-9223372036854775806, -9223372036854775804) x;
+
+-- Test in_range for other numeric datatypes
+
+create temp table numerics(
+ id int,
+ f_float4 float4,
+ f_float8 float8,
+ f_numeric numeric
+);
+
+insert into numerics values
+(0, '-infinity', '-infinity', '-infinity'),
+(1, -3, -3, -3),
+(2, -1, -1, -1),
+(3, 0, 0, 0),
+(4, 1.1, 1.1, 1.1),
+(5, 1.12, 1.12, 1.12),
+(6, 2, 2, 2),
+(7, 100, 100, 100),
+(8, 'infinity', 'infinity', 'infinity'),
+(9, 'NaN', 'NaN', 'NaN');
+
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1 following);
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1 preceding and 1.1::float4 following);
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' following);
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' preceding and 'inf' preceding);
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 'inf' following and 'inf' following);
+select id, f_float4, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float4 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1 following);
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1 preceding and 1.1::float8 following);
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' following);
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' preceding and 'inf' preceding);
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 'inf' following and 'inf' following);
+select id, f_float8, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_float8 range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1 following);
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::numeric following);
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1 preceding and 1.1::float8 following); -- currently unsupported
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' following);
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' preceding and 'inf' preceding);
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 'inf' following and 'inf' following);
+select id, f_numeric, first_value(id) over w, last_value(id) over w
+from numerics
+window w as (order by f_numeric range between
+ 1.1 preceding and 'NaN' following); -- error, NaN disallowed
+
+-- Test in_range for other datetime datatypes
+
+create temp table datetimes(
+ id int,
+ f_time time,
+ f_timetz timetz,
+ f_interval interval,
+ f_timestamptz timestamptz,
+ f_timestamp timestamp
+);
+
+insert into datetimes values
+(1, '11:00', '11:00 BST', '1 year', '2000-10-19 10:23:54+01', '2000-10-19 10:23:54'),
+(2, '12:00', '12:00 BST', '2 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(3, '13:00', '13:00 BST', '3 years', '2001-10-19 10:23:54+01', '2001-10-19 10:23:54'),
+(4, '14:00', '14:00 BST', '4 years', '2002-10-19 10:23:54+01', '2002-10-19 10:23:54'),
+(5, '15:00', '15:00 BST', '5 years', '2003-10-19 10:23:54+01', '2003-10-19 10:23:54'),
+(6, '15:00', '15:00 BST', '5 years', '2004-10-19 10:23:54+01', '2004-10-19 10:23:54'),
+(7, '17:00', '17:00 BST', '7 years', '2005-10-19 10:23:54+01', '2005-10-19 10:23:54'),
+(8, '18:00', '18:00 BST', '8 years', '2006-10-19 10:23:54+01', '2006-10-19 10:23:54'),
+(9, '19:00', '19:00 BST', '9 years', '2007-10-19 10:23:54+01', '2007-10-19 10:23:54'),
+(10, '20:00', '20:00 BST', '10 years', '2008-10-19 10:23:54+01', '2008-10-19 10:23:54');
+
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+
+select id, f_time, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_time desc range between
+ '70 min' preceding and '2 hours' following);
+
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz range between
+ '70 min'::interval preceding and '2 hours'::interval following);
+
+select id, f_timetz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timetz desc range between
+ '70 min' preceding and '2 hours' following);
+
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval range between
+ '1 year'::interval preceding and '1 year'::interval following);
+
+select id, f_interval, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_interval desc range between
+ '1 year' preceding and '1 year' following);
+
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz range between
+ '1 year'::interval preceding and '1 year'::interval following);
+
+select id, f_timestamptz, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamptz desc range between
+ '1 year' preceding and '1 year' following);
+
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp range between
+ '1 year'::interval preceding and '1 year'::interval following);
+
+select id, f_timestamp, first_value(id) over w, last_value(id) over w
+from datetimes
+window w as (order by f_timestamp desc range between
+ '1 year' preceding and '1 year' following);
+
+-- RANGE offset PRECEDING/FOLLOWING error cases
+select sum(salary) over (order by enroll_date, salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+select sum(salary) over (range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+select sum(salary) over (order by depname range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+select max(enroll_date) over (order by enroll_date range between 1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+
+select max(enroll_date) over (order by salary range between -1 preceding and 2 following
+ exclude ties), salary, enroll_date from empsalary;
+
+select max(enroll_date) over (order by salary range between 1 preceding and -2 following
+ exclude ties), salary, enroll_date from empsalary;
+
+select max(enroll_date) over (order by salary range between '1 year'::interval preceding and '2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+select max(enroll_date) over (order by enroll_date range between '1 year'::interval preceding and '-2 years'::interval following
+ exclude ties), salary, enroll_date from empsalary;
+
+-- GROUPS tests
+
+SELECT sum(unique1) over (order by four groups between unbounded preceding and current row),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between unbounded preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between current row and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 1 preceding and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 1 following and unbounded following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between unbounded preceding and 2 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 preceding),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 0 preceding and 0 following),
+ unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude current row), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude group), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (order by four groups between 2 preceding and 1 following
+ exclude ties), unique1, four
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following),unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude current row), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude group), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+
+SELECT sum(unique1) over (partition by ten
+ order by four groups between 0 preceding and 0 following exclude ties), unique1, four, ten
+FROM tenk1 WHERE unique1 < 10;
+
+select first_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lead(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+
+select last_value(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ lag(salary) over(order by enroll_date groups between 1 preceding and 1 following),
+ salary, enroll_date from empsalary;
+
+select first_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude current row),
+ lead(salary) over(order by enroll_date groups between 1 following and 3 following exclude ties),
+ nth_value(salary, 1) over(order by enroll_date groups between 1 following and 3 following
+ exclude ties),
+ salary, enroll_date from empsalary;
+
+select last_value(salary) over(order by enroll_date groups between 1 following and 3 following
+ exclude group),
+ lag(salary) over(order by enroll_date groups between 1 following and 3 following exclude group),
+ salary, enroll_date from empsalary;
+
+-- Show differences in offset interpretation between ROWS, RANGE, and GROUPS
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+
+WITH cte (x) AS (
+ SELECT * FROM generate_series(1, 35, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x rows between 1 preceding and 1 following);
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x range between 1 preceding and 1 following);
+
+WITH cte (x) AS (
+ select 1 union all select 1 union all select 1 union all
+ SELECT * FROM generate_series(5, 49, 2)
+)
+SELECT x, (sum(x) over w)
+FROM cte
+WINDOW w AS (ORDER BY x groups between 1 preceding and 1 following);
+
+-- with UNION
+SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 UNION ALL SELECT * FROM tenk2)s LIMIT 0;
+
+-- check some degenerate cases
+create temp table t1 (f1 int, f2 int8);
+insert into t1 values (1,1),(1,2),(2,2);
+
+select f1, sum(f1) over (partition by f1
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1 order by f2
+ range between 1 preceding and 1 following)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ range between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ range between 1 following and 2 following)
+from t1 where f1 = f2;
+
+select f1, sum(f1) over (partition by f1
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2; -- error, must have order by
+explain (costs off)
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1 order by f2
+ groups between 1 preceding and 1 following)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1, f1 order by f2
+ groups between 2 preceding and 1 preceding)
+from t1 where f1 = f2;
+select f1, sum(f1) over (partition by f1, f2 order by f2
+ groups between 1 following and 2 following)
+from t1 where f1 = f2;
+
+-- ordering by a non-integer constant is allowed
+SELECT rank() OVER (ORDER BY length('abc'));
+
+-- can't order by another window function
+SELECT rank() OVER (ORDER BY rank() OVER (ORDER BY random()));
+
+-- some other errors
+SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY salary) < 10;
+
+SELECT * FROM empsalary INNER JOIN tenk1 ON row_number() OVER (ORDER BY salary) < 10;
+
+SELECT rank() OVER (ORDER BY 1), count(*) FROM empsalary GROUP BY 1;
+
+SELECT * FROM rank() OVER (ORDER BY random());
+
+DELETE FROM empsalary WHERE (rank() OVER (ORDER BY random())) > 10;
+
+DELETE FROM empsalary RETURNING rank() OVER (ORDER BY random());
+
+SELECT count(*) OVER w FROM tenk1 WINDOW w AS (ORDER BY unique1), w AS (ORDER BY unique1);
+
+SELECT rank() OVER (PARTITION BY four, ORDER BY ten) FROM tenk1;
+
+SELECT count() OVER () FROM tenk1;
+
+SELECT generate_series(1, 100) OVER () FROM empsalary;
+
+SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1;
+
+SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1;
+
+-- filter
+
+SELECT sum(salary), row_number() OVER (ORDER BY depname), sum(
+ sum(salary) FILTER (WHERE enroll_date > '2007-01-01')
+) FILTER (WHERE depname <> 'sales') OVER (ORDER BY depname DESC) AS "filtered_sum",
+ depname
+FROM empsalary GROUP BY depname;
+
+-- Test pushdown of quals into a subquery containing window functions
+
+-- pushdown is safe because all PARTITION BY clauses include depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname) depsalary,
+ min(salary) OVER (PARTITION BY depname || 'A', depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+
+-- pushdown is unsafe because there's a PARTITION BY clause without depname:
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY enroll_date) enroll_salary,
+ min(salary) OVER (PARTITION BY depname) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+
+-- Test Sort node collapsing
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ sum(salary) OVER (PARTITION BY depname order by empno) depsalary,
+ min(salary) OVER (PARTITION BY depname, empno order by enroll_date) depminsalary
+ FROM empsalary) emp
+WHERE depname = 'sales';
+
+-- Test Sort node reordering
+EXPLAIN (COSTS OFF)
+SELECT
+ lead(1) OVER (PARTITION BY depname ORDER BY salary, enroll_date),
+ lag(1) OVER (PARTITION BY depname ORDER BY salary,enroll_date,empno)
+FROM empsalary;
+
+-- Test incremental sorting
+EXPLAIN (COSTS OFF)
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+
+SELECT * FROM
+ (SELECT depname,
+ empno,
+ salary,
+ enroll_date,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date) AS first_emp,
+ row_number() OVER (PARTITION BY depname ORDER BY enroll_date DESC) AS last_emp
+ FROM empsalary) emp
+WHERE first_emp = 1 OR last_emp = 1;
+
+-- cleanup
+DROP TABLE empsalary;
+
+-- test user-defined window function with named args and default args
+CREATE FUNCTION nth_value_def(val anyelement, n integer = 1) RETURNS anyelement
+ LANGUAGE internal WINDOW IMMUTABLE STRICT AS 'window_nth_value';
+
+SELECT nth_value_def(n := 2, val := ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+
+SELECT nth_value_def(ten) OVER (PARTITION BY four), ten, four
+ FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten) s;
+
+--
+-- Test the basic moving-aggregate machinery
+--
+
+-- create aggregates that record the series of transform calls (these are
+-- intentionally not true inverses)
+
+CREATE FUNCTION logging_sfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '*' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+
+CREATE FUNCTION logging_msfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT COALESCE($1, '') || '+' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+
+CREATE FUNCTION logging_minvfunc_nonstrict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL IMMUTABLE;
+
+CREATE AGGREGATE logging_agg_nonstrict (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict
+);
+
+CREATE AGGREGATE logging_agg_nonstrict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_nonstrict,
+ mstype = text,
+ msfunc = logging_msfunc_nonstrict,
+ minvfunc = logging_minvfunc_nonstrict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+
+CREATE FUNCTION logging_sfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '*' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+
+CREATE FUNCTION logging_msfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '+' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+
+CREATE FUNCTION logging_minvfunc_strict(text, anyelement) RETURNS text AS
+$$ SELECT $1 || '-' || quote_nullable($2) $$
+LANGUAGE SQL STRICT IMMUTABLE;
+
+CREATE AGGREGATE logging_agg_strict (text)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict
+);
+
+CREATE AGGREGATE logging_agg_strict_initcond (anyelement)
+(
+ stype = text,
+ sfunc = logging_sfunc_strict,
+ mstype = text,
+ msfunc = logging_msfunc_strict,
+ minvfunc = logging_minvfunc_strict,
+ initcond = 'I',
+ minitcond = 'MI'
+);
+
+-- test strict and non-strict cases
+SELECT
+ p::text || ',' || i::text || ':' || COALESCE(v::text, 'NULL') AS row,
+ logging_agg_nonstrict(v) over wnd as nstrict,
+ logging_agg_nonstrict_initcond(v) over wnd as nstrict_init,
+ logging_agg_strict(v::text) over wnd as strict,
+ logging_agg_strict_initcond(v) over wnd as strict_init
+FROM (VALUES
+ (1, 1, NULL),
+ (1, 2, 'a'),
+ (1, 3, 'b'),
+ (1, 4, NULL),
+ (1, 5, NULL),
+ (1, 6, 'c'),
+ (2, 1, NULL),
+ (2, 2, 'x'),
+ (3, 1, 'z')
+) AS t(p, i, v)
+WINDOW wnd AS (PARTITION BY P ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+
+-- and again, but with filter
+SELECT
+ p::text || ',' || i::text || ':' ||
+ CASE WHEN f THEN COALESCE(v::text, 'NULL') ELSE '-' END as row,
+ logging_agg_nonstrict(v) filter(where f) over wnd as nstrict_filt,
+ logging_agg_nonstrict_initcond(v) filter(where f) over wnd as nstrict_init_filt,
+ logging_agg_strict(v::text) filter(where f) over wnd as strict_filt,
+ logging_agg_strict_initcond(v) filter(where f) over wnd as strict_init_filt
+FROM (VALUES
+ (1, 1, true, NULL),
+ (1, 2, false, 'a'),
+ (1, 3, true, 'b'),
+ (1, 4, false, NULL),
+ (1, 5, false, NULL),
+ (1, 6, false, 'c'),
+ (2, 1, false, NULL),
+ (2, 2, true, 'x'),
+ (3, 1, true, 'z')
+) AS t(p, i, f, v)
+WINDOW wnd AS (PARTITION BY p ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY p, i;
+
+-- test that volatile arguments disable moving-aggregate mode
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text)
+ over wnd as inverse,
+ logging_agg_strict(v::text || CASE WHEN random() < 0 then '?' ELSE '' END)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+
+SELECT
+ i::text || ':' || COALESCE(v::text, 'NULL') as row,
+ logging_agg_strict(v::text) filter(where true)
+ over wnd as inverse,
+ logging_agg_strict(v::text) filter(where random() >= 0)
+ over wnd as noinverse
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY i;
+
+-- test that non-overlapping windows don't use inverse transitions
+SELECT
+ logging_agg_strict(v::text) OVER wnd
+FROM (VALUES
+ (1, 'a'),
+ (2, 'b'),
+ (3, 'c')
+) AS t(i, v)
+WINDOW wnd AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ORDER BY i;
+
+-- test that returning NULL from the inverse transition functions
+-- restarts the aggregation from scratch. The second aggregate is supposed
+-- to test cases where only some aggregates restart, the third one checks
+-- that one aggregate restarting doesn't cause others to restart.
+
+CREATE FUNCTION sum_int_randrestart_minvfunc(int4, int4) RETURNS int4 AS
+$$ SELECT CASE WHEN random() < 0.2 THEN NULL ELSE $1 - $2 END $$
+LANGUAGE SQL STRICT;
+
+CREATE AGGREGATE sum_int_randomrestart (int4)
+(
+ stype = int4,
+ sfunc = int4pl,
+ mstype = int4,
+ msfunc = int4pl,
+ minvfunc = sum_int_randrestart_minvfunc
+);
+
+WITH
+vs AS (
+ SELECT i, (random() * 100)::int4 AS v
+ FROM generate_series(1, 100) AS i
+),
+sum_following AS (
+ SELECT i, SUM(v) OVER
+ (ORDER BY i DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS s
+ FROM vs
+)
+SELECT DISTINCT
+ sum_following.s = sum_int_randomrestart(v) OVER fwd AS eq1,
+ -sum_following.s = sum_int_randomrestart(-v) OVER fwd AS eq2,
+ 100*3+(vs.i-1)*3 = length(logging_agg_nonstrict(''::text) OVER fwd) AS eq3
+FROM vs
+JOIN sum_following ON sum_following.i = vs.i
+WINDOW fwd AS (
+ ORDER BY vs.i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
+);
+
+--
+-- Test various built-in aggregates that have moving-aggregate support
+--
+
+-- test inverse transition functions handle NULLs properly
+SELECT i,AVG(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,AVG(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,AVG(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,AVG(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.5),(2,2.5),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,AVG(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::money) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1.10'),(2,'2.20'),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::interval) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.1),(2,2.2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT SUM(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1.01),(2,2),(3,3)) v(i,n);
+
+SELECT i,COUNT(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,COUNT(*) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT VAR_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VAR_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VARIANCE(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VARIANCE(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VARIANCE(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT VARIANCE(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT STDDEV_POP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_POP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_POP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_POP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_SAMP(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_SAMP(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_SAMP(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV_SAMP(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n);
+
+SELECT STDDEV(n::bigint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT STDDEV(n::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT STDDEV(n::smallint) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+SELECT STDDEV(n::numeric) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
+ FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n);
+
+-- test that inverse transition functions work with various frame options
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+
+SELECT i,SUM(v::int) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+ FROM (VALUES(1,1),(2,2),(3,3),(4,4)) t(i,v);
+
+-- ensure aggregate over numeric properly recovers from NaN values
+SELECT a, b,
+ SUM(b) OVER(ORDER BY A ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM (VALUES(1,1::numeric),(2,2),(3,'NaN'),(4,3),(5,4)) t(a,b);
+
+-- It might be tempting for someone to add an inverse trans function for
+-- float and double precision. This should not be done as it can give incorrect
+-- results. This test should fail if anyone ever does this without thinking too
+-- hard about it.
+SELECT to_char(SUM(n::float8) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING),'999999999999999999999D9')
+ FROM (VALUES(1,1e20),(2,1)) n(i,n);
+
+SELECT i, b, bool_and(b) OVER w, bool_or(b) OVER w
+ FROM (VALUES (1,true), (2,true), (3,false), (4,false), (5,true)) v(i,b)
+ WINDOW w AS (ORDER BY i ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING);
+
+-- Tests for problems with failure to walk or mutate expressions
+-- within window frame clauses.
+
+-- test walker (fails with collation error if expressions are not walked)
+SELECT array_agg(i) OVER w
+ FROM generate_series(1,5) i
+WINDOW w AS (ORDER BY i ROWS BETWEEN (('foo' < 'foobar')::integer) PRECEDING AND CURRENT ROW);
+
+-- test mutator (fails when inlined if expressions are not mutated)
+CREATE FUNCTION pg_temp.f(group_size BIGINT) RETURNS SETOF integer[]
+AS $$
+ SELECT array_agg(s) OVER w
+ FROM generate_series(1,5) s
+ WINDOW w AS (ORDER BY s ROWS BETWEEN CURRENT ROW AND GROUP_SIZE FOLLOWING)
+$$ LANGUAGE SQL STABLE;
+
+EXPLAIN (costs off) SELECT * FROM pg_temp.f(2);
+SELECT * FROM pg_temp.f(2);
diff --git a/yql/essentials/tests/postgresql/original/cases/xml.out b/yql/essentials/tests/postgresql/original/cases/xml.out
new file mode 100644
index 0000000000..55ac49be26
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/xml.out
@@ -0,0 +1,1570 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+INSERT INTO xmltest VALUES (3, '<wrong');
+ERROR: invalid XML content
+LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
+<wrong
+ ^
+SELECT * FROM xmltest;
+ id | data
+----+--------------------
+ 1 | <value>one</value>
+ 2 | <value>two</value>
+(2 rows)
+
+SELECT xmlcomment('test');
+ xmlcomment
+-------------
+ <!--test-->
+(1 row)
+
+SELECT xmlcomment('-test');
+ xmlcomment
+--------------
+ <!---test-->
+(1 row)
+
+SELECT xmlcomment('test-');
+ERROR: invalid XML comment
+SELECT xmlcomment('--test');
+ERROR: invalid XML comment
+SELECT xmlcomment('te st');
+ xmlcomment
+--------------
+ <!--te st-->
+(1 row)
+
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+ xmlconcat
+----------------------------------------
+ <!--hello--><qux>foo</qux><!--world-->
+(1 row)
+
+SELECT xmlconcat('hello', 'you');
+ xmlconcat
+-----------
+ helloyou
+(1 row)
+
+SELECT xmlconcat(1, 2);
+ERROR: argument of XMLCONCAT must be type xml, not type integer
+LINE 1: SELECT xmlconcat(1, 2);
+ ^
+SELECT xmlconcat('bad', '<syntax');
+ERROR: invalid XML content
+LINE 1: SELECT xmlconcat('bad', '<syntax');
+ ^
+DETAIL: line 1: Couldn't find end of Start Tag syntax line 1
+<syntax
+ ^
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ xmlconcat
+-----------------------------------
+ <?xml version="1.1"?><foo/><bar/>
+(1 row)
+
+SELECT xmlconcat(NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlconcat(NULL, NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+ xmlelement
+------------------------------------------------
+ <element one="1" two="deuce">content</element>
+(1 row)
+
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+ERROR: unnamed XML attribute value must be a column reference
+LINE 2: xmlattributes ('unnamed and wrong'));
+ ^
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ xmlelement
+-------------------------------------------
+ <element><nested>stuff</nested></element>
+(1 row)
+
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ xmlelement
+----------------------------------------------------------------------
+ <employee><name>sharon</name><age>25</age><pay>1000</pay></employee>
+ <employee><name>sam</name><age>30</age><pay>2000</pay></employee>
+ <employee><name>bill</name><age>20</age><pay>1000</pay></employee>
+ <employee><name>jeff</name><age>23</age><pay>600</pay></employee>
+ <employee><name>cim</name><age>30</age><pay>400</pay></employee>
+ <employee><name>linda</name><age>19</age><pay>100</pay></employee>
+(6 rows)
+
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ERROR: XML attribute name "a" appears more than once
+LINE 1: ...ment(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ ^
+SELECT xmlelement(name num, 37);
+ xmlelement
+---------------
+ <num>37</num>
+(1 row)
+
+SELECT xmlelement(name foo, text 'bar');
+ xmlelement
+----------------
+ <foo>bar</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xml 'bar');
+ xmlelement
+----------------
+ <foo>bar</foo>
+(1 row)
+
+SELECT xmlelement(name foo, text 'b<a/>r');
+ xmlelement
+-------------------------
+ <foo>b&lt;a/&gt;r</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xml 'b<a/>r');
+ xmlelement
+-------------------
+ <foo>b<a/>r</foo>
+(1 row)
+
+SELECT xmlelement(name foo, array[1, 2, 3]);
+ xmlelement
+-------------------------------------------------------------------------
+ <foo><element>1</element><element>2</element><element>3</element></foo>
+(1 row)
+
+SET xmlbinary TO base64;
+SELECT xmlelement(name foo, bytea 'bar');
+ xmlelement
+-----------------
+ <foo>YmFy</foo>
+(1 row)
+
+SET xmlbinary TO hex;
+SELECT xmlelement(name foo, bytea 'bar');
+ xmlelement
+-------------------
+ <foo>626172</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+ xmlelement
+-------------------
+ <foo bar="true"/>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ xmlelement
+----------------------------------
+ <foo bar="2009-04-09T00:24:37"/>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ERROR: timestamp out of range
+DETAIL: XML does not support infinite timestamp values.
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ xmlelement
+------------------------------------------------------------
+ <foo funny="&lt;&gt;&amp;&quot;'" funnier="b&lt;a/&gt;r"/>
+(1 row)
+
+SELECT xmlparse(content '');
+ xmlparse
+----------
+
+(1 row)
+
+SELECT xmlparse(content ' ');
+ xmlparse
+----------
+
+(1 row)
+
+SELECT xmlparse(content 'abc');
+ xmlparse
+----------
+ abc
+(1 row)
+
+SELECT xmlparse(content '<abc>x</abc>');
+ xmlparse
+--------------
+ <abc>x</abc>
+(1 row)
+
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ERROR: invalid XML content
+DETAIL: line 1: xmlParseEntityRef: no name
+<invalidentity>&</invalidentity>
+ ^
+line 1: chunk is not well balanced
+<invalidentity>&</invalidentity>
+ ^
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ERROR: invalid XML content
+DETAIL: line 1: Entity 'idontexist' not defined
+<undefinedentity>&idontexist;</undefinedentity>
+ ^
+line 1: chunk is not well balanced
+<undefinedentity>&idontexist;</undefinedentity>
+ ^
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ xmlparse
+---------------------------
+ <invalidns xmlns='&lt;'/>
+(1 row)
+
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ xmlparse
+--------------------------------
+ <relativens xmlns='relative'/>
+(1 row)
+
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ERROR: invalid XML content
+DETAIL: line 1: Entity 'idontexist' not defined
+<twoerrors>&idontexist;</unbalanced>
+ ^
+line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
+<twoerrors>&idontexist;</unbalanced>
+ ^
+line 1: chunk is not well balanced
+<twoerrors>&idontexist;</unbalanced>
+ ^
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+ xmlparse
+---------------------
+ <nosuchprefix:tag/>
+(1 row)
+
+SELECT xmlparse(document ' ');
+ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+
+ ^
+SELECT xmlparse(document 'abc');
+ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+abc
+^
+SELECT xmlparse(document '<abc>x</abc>');
+ xmlparse
+--------------
+ <abc>x</abc>
+(1 row)
+
+SELECT xmlparse(document '<invalidentity>&</abc>');
+ERROR: invalid XML document
+DETAIL: line 1: xmlParseEntityRef: no name
+<invalidentity>&</abc>
+ ^
+line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
+<invalidentity>&</abc>
+ ^
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ERROR: invalid XML document
+DETAIL: line 1: Entity 'idontexist' not defined
+<undefinedentity>&idontexist;</abc>
+ ^
+line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
+<undefinedentity>&idontexist;</abc>
+ ^
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ xmlparse
+---------------------------
+ <invalidns xmlns='&lt;'/>
+(1 row)
+
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ xmlparse
+--------------------------------
+ <relativens xmlns='relative'/>
+(1 row)
+
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ERROR: invalid XML document
+DETAIL: line 1: Entity 'idontexist' not defined
+<twoerrors>&idontexist;</unbalanced>
+ ^
+line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
+<twoerrors>&idontexist;</unbalanced>
+ ^
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+ xmlparse
+---------------------
+ <nosuchprefix:tag/>
+(1 row)
+
+SELECT xmlpi(name foo);
+ xmlpi
+---------
+ <?foo?>
+(1 row)
+
+SELECT xmlpi(name xml);
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff);
+ xmlpi
+--------------
+ <?xmlstuff?>
+(1 row)
+
+SELECT xmlpi(name foo, 'bar');
+ xmlpi
+-------------
+ <?foo bar?>
+(1 row)
+
+SELECT xmlpi(name foo, 'in?>valid');
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction cannot contain "?>".
+SELECT xmlpi(name foo, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name xml, null);
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ xmlpi
+-------------------------------------------------------
+ <?xml-stylesheet href="mystyle.css" type="text/css"?>
+(1 row)
+
+SELECT xmlpi(name foo, ' bar');
+ xmlpi
+-------------
+ <?foo bar?>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ xmlroot
+---------
+ <foo/>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version '2.0');
+ xmlroot
+-----------------------------
+ <?xml version="2.0"?><foo/>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ xmlroot
+---------------------------------------------
+ <?xml version="1.1" standalone="no"?><foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ xmlroot
+---------------------------------------------
+ <?xml version="1.0" standalone="no"?><foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ xmlroot
+---------
+ <foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+ xmlroot
+------------------------------------------------------------------------------------------
+ <?xml version="1.0" standalone="yes"?><gazonk name="val" num="2"><qux>foo</qux></gazonk>
+(1 row)
+
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ xmlserialize
+--------------------
+ <value>one</value>
+ <value>two</value>
+(2 rows)
+
+SELECT xmlserialize(content 'good' as char(10));
+ xmlserialize
+--------------
+ good
+(1 row)
+
+SELECT xmlserialize(document 'bad' as text);
+ERROR: not an XML document
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT xml 'abc' IS NOT DOCUMENT;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '<>' IS NOT DOCUMENT;
+ERROR: invalid XML content
+LINE 1: SELECT '<>' IS NOT DOCUMENT;
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<>
+ ^
+SELECT xmlagg(data) FROM xmltest;
+ xmlagg
+--------------------------------------
+ <value>one</value><value>two</value>
+(1 row)
+
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+ xmlagg
+--------
+
+(1 row)
+
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ xmlelement
+--------------------------------------------------------------------------------------------------------------------------------
+ <employees><name>sharon</name><name>sam</name><name>bill</name><name>jeff</name><name>cim</name><name>linda</name></employees>
+(1 row)
+
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+ xmlpi
+-------------------------------------------------
+ <?_x003A_::_x005F_xml_abc135._x0025_-_x0026__?>
+(1 row)
+
+SELECT xmlpi(name "123");
+ xmlpi
+---------------
+ <?_x0031_23?>
+(1 row)
+
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+SET XML OPTION DOCUMENT;
+EXECUTE foo ('<bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+EXECUTE foo ('bad');
+ERROR: invalid XML document
+LINE 1: EXECUTE foo ('bad');
+ ^
+DETAIL: line 1: Start tag expected, '<' not found
+bad
+^
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: invalid XML document
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: line 1: Extra content at the end of the document
+<!DOCTYPE a><a/><b/>
+ ^
+SET XML OPTION CONTENT;
+EXECUTE foo ('<bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+EXECUTE foo ('good');
+ xmlconcat
+------------
+ <foo/>good
+(1 row)
+
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+ xml
+--------------------------------------------------------------------
+ <!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+ xml
+------------------------------
+ <!-- hi--> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<!DOCTYPE a><a/>';
+ xml
+------------------
+ <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<!-- hi--> oops <!DOCTYPE a><a/>
+ ^
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<!-- hi--> <oops/> <!DOCTYPE a><a/>
+ ^
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: line 1: Extra content at the end of the document
+<!DOCTYPE a><a/><b/>
+ ^
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+ table_name | view_definition
+------------+-------------------------------------------------------------------------------------------------------------------
+ xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment;
+ xmlview2 | SELECT XMLCONCAT('hello'::xml, 'you'::xml) AS "xmlconcat";
+ xmlview3 | SELECT XMLELEMENT(NAME element, XMLATTRIBUTES(1 AS ":one:", 'deuce' AS two), 'content&') AS "xmlelement";
+ xmlview4 | SELECT XMLELEMENT(NAME employee, XMLFOREST(emp.name AS name, emp.age AS age, emp.salary AS pay)) AS "xmlelement"+
+ | FROM emp;
+ xmlview5 | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
+ xmlview6 | SELECT XMLPI(NAME foo, 'bar'::text) AS "xmlpi";
+ xmlview7 | SELECT XMLROOT('<foo/>'::xml, VERSION NO VALUE, STANDALONE YES) AS "xmlroot";
+ xmlview8 | SELECT (XMLSERIALIZE(CONTENT 'good'::xml AS character(10)))::character(10) AS "xmlserialize";
+ xmlview9 | SELECT XMLSERIALIZE(CONTENT 'good'::xml AS text) AS "xmlserialize";
+(9 rows)
+
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+ xpath
+----------------------
+ {<value>one</value>}
+ {<value>two</value>}
+(2 rows)
+
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ?column?
+----------
+ t
+ t
+(2 rows)
+
+SELECT xpath('', '<!-- error -->');
+ERROR: empty XPath expression
+CONTEXT: SQL function "xpath" statement 1
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ xpath
+----------------
+ {"number one"}
+(1 row)
+
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+-------
+ {1,2}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" id=\"1\">number one</local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" xmlns=\"http://127.0.0.2\" id=\"1\"><internal>number one</internal><internal2/></local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ xpath
+-------------------------
+ {<b>two</b>,<b>etc</b>}
+(1 row)
+
+SELECT xpath('//text()', '<root>&lt;</root>');
+ xpath
+--------
+ {&lt;}
+(1 row)
+
+SELECT xpath('//@value', '<root value="&lt;"/>');
+ xpath
+--------
+ {&lt;}
+(1 row)
+
+SELECT xpath('''<<invalid>>''', '<root/>');
+ xpath
+---------------------------
+ {&lt;&lt;invalid&gt;&gt;}
+(1 row)
+
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ xpath
+-------
+ {3}
+(1 row)
+
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ xpath
+---------
+ {false}
+(1 row)
+
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ xpath
+--------
+ {true}
+(1 row)
+
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ xpath
+--------
+ {root}
+(1 row)
+
+SELECT xpath('/nosuchtag', '<root/>');
+ xpath
+-------
+ {}
+(1 row)
+
+SELECT xpath('root', '<root/>');
+ xpath
+-----------
+ {<root/>}
+(1 row)
+
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ xmlexists
+-----------
+ f
+(1 row)
+
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ xmlexists
+-----------
+ t
+(1 row)
+
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+ xmlexists
+-----------
+ t
+(1 row)
+
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ xpath_exists
+--------------
+ f
+(1 row)
+
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ xpath_exists
+--------------
+ t
+(1 row)
+
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ xpath_exists
+--------------
+ t
+(1 row)
+
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+ count
+-------
+ 1
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ count
+-------
+ 1
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 1
+(1 row)
+
+CREATE TABLE query ( expr TEXT );
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+ count
+-------
+ 2
+(1 row)
+
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+ xml_is_well_formed_document
+-----------------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed_document('abc');
+ xml_is_well_formed_document
+-----------------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+ xml_is_well_formed_content
+----------------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed_content('abc');
+ xml_is_well_formed_content
+----------------------------
+ t
+(1 row)
+
+SET xmloption TO DOCUMENT;
+SELECT xml_is_well_formed('abc');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<abc/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<foo>bar</foo>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<foo>bar</foo');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SET xmloption TO CONTENT;
+SELECT xml_is_well_formed('abc');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ERROR: could not parse XML document
+\set VERBOSITY default
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+ERROR: could not parse XML document
+DETAIL: line 1: Namespace prefix nosuchprefix on tag is not defined
+<nosuchprefix:tag/>
+ ^
+CONTEXT: SQL function "xpath" statement 1
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+WARNING: line 1: xmlns: URI relative is not absolute
+<relativens xmlns='relative'/>
+ ^
+ xpath
+--------------------------------------
+ {"<relativens xmlns=\"relative\"/>"}
+(1 row)
+
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+ xmlparse
+-----------------------------------------------------------------
+ <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>
+(1 row)
+
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ xmlparse
+-----------------------------------------------------------------------
+ <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>
+(1 row)
+
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+ xmlparse
+------------------------------------------------------------------------------------------------------------------------------------------------------
+ <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>
+(1 row)
+
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+SELECT * FROM xmltableview1;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+\sv xmltableview1
+CREATE OR REPLACE VIEW public.xmltableview1 AS
+ SELECT "xmltable".id,
+ "xmltable"._id,
+ "xmltable".country_name,
+ "xmltable".country_id,
+ "xmltable".region_id,
+ "xmltable".size,
+ "xmltable".unit,
+ "xmltable".premier_name
+ FROM ( SELECT xmldata.data
+ FROM xmldata) x,
+ LATERAL XMLTABLE(('/ROWS/ROW'::text) PASSING (x.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop
+ -> Seq Scan on xmldata
+ -> Table Function Scan on "xmltable"
+(3 rows)
+
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+ERROR: XMLTABLE function has 1 columns available but 2 columns specified
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+ a
+----
+ 10
+(1 row)
+
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+SELECT * FROM xmltableview2;
+ a
+----
+ 10
+(1 row)
+
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+ERROR: DEFAULT namespace is not supported
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+ a
+--------------------------------------
+ http://www.w3.org/XML/1998/namespace
+(1 row)
+
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+EXECUTE pp;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+ India | 3
+ Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+ 1 | India | 3
+ 2 | Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+ 4 | India | 3
+ 5 | Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ id
+----
+ 4
+ 5
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ id
+----
+ 1
+ 2
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+------------------------------------------------------------------
+ 4 | India | 3 | <ROW id="4"> +
+ | | | <COUNTRY_ID>IN</COUNTRY_ID> +
+ | | | <COUNTRY_NAME>India</COUNTRY_NAME> +
+ | | | <REGION_ID>3</REGION_ID> +
+ | | | </ROW>
+ 5 | Japan | 3 | <ROW id="5"> +
+ | | | <COUNTRY_ID>JP</COUNTRY_ID> +
+ | | | <COUNTRY_NAME>Japan</COUNTRY_NAME> +
+ | | | <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>+
+ | | | </ROW>
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+-----------------------------------------------------------------------------------------------------------------------------
+ 4 | India | 3 | <COUNTRY_ID>IN</COUNTRY_ID><COUNTRY_NAME>India</COUNTRY_NAME><REGION_ID>3</REGION_ID>
+ 5 | Japan | 3 | <COUNTRY_ID>JP</COUNTRY_ID><COUNTRY_NAME>Japan</COUNTRY_NAME><REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+(2 rows)
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ element
+----------------------
+ a1aa2a bbbbxxxcccc
+(1 row)
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ERROR: more than one value returned by column XPath expression
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+ c
+-------------------------
+ <hello> &"<>!<a>foo</a>
+ 2
+(2 rows)
+
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+ ent
+-----
+ '
+ "
+ &
+ <
+ >
+(5 rows)
+
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ ent
+------------------
+ <ent>'</ent>
+ <ent>"</ent>
+ <ent>&amp;</ent>
+ <ent>&lt;</ent>
+ <ent>&gt;</ent>
+(5 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+ Japan | 3
+(1 row)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ Table Function Call: XMLTABLE(('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]'::text) PASSING (xmldata.data) COLUMNS "COUNTRY_NAME" text, "REGION_ID" integer)
+ Filter: ("xmltable"."COUNTRY_NAME" = 'Japan'::text)
+(8 rows)
+
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+----------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+ 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
+ 11 | 2 | Germany | DE | 2 | | | not specified
+ 12 | 3 | France | FR | 2 | | | not specified
+ 20 | 1 | Egypt | EG | 1 | | | not specified
+ 21 | 2 | Sudan | SD | 1 | | | not specified
+(11 rows)
+
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+----------------+------------+-----------+------+------+---------------
+ 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
+ 11 | 2 | Germany | DE | 2 | | | not specified
+ 12 | 3 | France | FR | 2 | | | not specified
+(3 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+ Filter: ("xmltable".region_id = 2)
+(8 rows)
+
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ERROR: null is not allowed in column "size"
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ proname | proowner | procost | pronargs | proargnames | proargtypes
+---------+----------+---------+----------+-------------+-------------
+(0 rows)
+
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ proname | proowner | procost | pronargs | proargnames | proargtypes
+---------+----------+---------+----------+-------------+-------------
+(0 rows)
+
+CREATE TABLE xmltest2(x xml, _path text);
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ a
+---
+ 1
+ 2
+ 3
+ 2
+(4 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ a
+---
+ 1
+ 2
+ 3
+ 2
+(4 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ a
+----
+ 11
+ 12
+ 13
+ 14
+(4 rows)
+
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ a | b | c | d | e
+----------+---+----+---+---
+ <a>a</a> | a | hi | t | 1
+(1 row)
+
+\x
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+-[ RECORD 1 ]-----------------------------------------------------------
+x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post
+y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>+
+ |
+
+\x
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ a | b
+--------+--------------
+ <foo/> | &lt;foo/&gt;
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/original/cases/xml.sql b/yql/essentials/tests/postgresql/original/cases/xml.sql
new file mode 100644
index 0000000000..e3f90db4d5
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/xml.sql
@@ -0,0 +1,619 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+INSERT INTO xmltest VALUES (3, '<wrong');
+
+SELECT * FROM xmltest;
+
+
+SELECT xmlcomment('test');
+SELECT xmlcomment('-test');
+SELECT xmlcomment('test-');
+SELECT xmlcomment('--test');
+SELECT xmlcomment('te st');
+
+
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+
+SELECT xmlconcat('hello', 'you');
+SELECT xmlconcat(1, 2);
+SELECT xmlconcat('bad', '<syntax');
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+SELECT xmlconcat(NULL);
+SELECT xmlconcat(NULL, NULL);
+
+
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+
+SELECT xmlelement(name num, 37);
+SELECT xmlelement(name foo, text 'bar');
+SELECT xmlelement(name foo, xml 'bar');
+SELECT xmlelement(name foo, text 'b<a/>r');
+SELECT xmlelement(name foo, xml 'b<a/>r');
+SELECT xmlelement(name foo, array[1, 2, 3]);
+SET xmlbinary TO base64;
+SELECT xmlelement(name foo, bytea 'bar');
+SET xmlbinary TO hex;
+SELECT xmlelement(name foo, bytea 'bar');
+
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+
+
+SELECT xmlparse(content '');
+SELECT xmlparse(content ' ');
+SELECT xmlparse(content 'abc');
+SELECT xmlparse(content '<abc>x</abc>');
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+
+SELECT xmlparse(document ' ');
+SELECT xmlparse(document 'abc');
+SELECT xmlparse(document '<abc>x</abc>');
+SELECT xmlparse(document '<invalidentity>&</abc>');
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+
+
+SELECT xmlpi(name foo);
+SELECT xmlpi(name xml);
+SELECT xmlpi(name xmlstuff);
+SELECT xmlpi(name foo, 'bar');
+SELECT xmlpi(name foo, 'in?>valid');
+SELECT xmlpi(name foo, null);
+SELECT xmlpi(name xml, null);
+SELECT xmlpi(name xmlstuff, null);
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+SELECT xmlpi(name foo, ' bar');
+
+
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+SELECT xmlroot(xml '<foo/>', version '2.0');
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+
+
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+
+
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+SELECT xmlserialize(content 'good' as char(10));
+SELECT xmlserialize(document 'bad' as text);
+
+
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+SELECT xml 'abc' IS NOT DOCUMENT;
+SELECT '<>' IS NOT DOCUMENT;
+
+
+SELECT xmlagg(data) FROM xmltest;
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+
+
+-- Check mapping SQL identifier to XML name
+
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+SELECT xmlpi(name "123");
+
+
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+
+SET XML OPTION DOCUMENT;
+EXECUTE foo ('<bar/>');
+EXECUTE foo ('bad');
+SELECT xml '<!DOCTYPE a><a/><b/>';
+
+SET XML OPTION CONTENT;
+EXECUTE foo ('<bar/>');
+EXECUTE foo ('good');
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+SELECT xml '<!DOCTYPE a><a/>';
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+SELECT xml '<!DOCTYPE a><a/><b/>';
+
+
+-- Test backwards parsing
+
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+
+-- Text XPath expressions evaluation
+
+SELECT xpath('/value', data) FROM xmltest;
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+SELECT xpath('', '<!-- error -->');
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+SELECT xpath('//text()', '<root>&lt;</root>');
+SELECT xpath('//@value', '<root value="&lt;"/>');
+SELECT xpath('''<<invalid>>''', '<root/>');
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+SELECT xpath('/nosuchtag', '<root/>');
+SELECT xpath('root', '<root/>');
+
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+
+CREATE TABLE query ( expr TEXT );
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+
+-- Test xml_is_well_formed and variants
+
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+SELECT xml_is_well_formed_document('abc');
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+SELECT xml_is_well_formed_content('abc');
+
+SET xmloption TO DOCUMENT;
+SELECT xml_is_well_formed('abc');
+SELECT xml_is_well_formed('<>');
+SELECT xml_is_well_formed('<abc/>');
+SELECT xml_is_well_formed('<foo>bar</foo>');
+SELECT xml_is_well_formed('<foo>bar</foo');
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+
+SET xmloption TO CONTENT;
+SELECT xml_is_well_formed('abc');
+
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+\set VERBOSITY default
+
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+SELECT * FROM xmltableview1;
+
+\sv xmltableview1
+
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+
+SELECT * FROM xmltableview2;
+
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+EXECUTE pp;
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+
+CREATE TABLE xmltest2(x xml, _path text);
+
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+\x
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+\x
+
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
diff --git a/yql/essentials/tests/postgresql/original/cases/xml_1.out b/yql/essentials/tests/postgresql/original/cases/xml_1.out
new file mode 100644
index 0000000000..897ed382f1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/xml_1.out
@@ -0,0 +1,1417 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (1, '<value>one</value>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (2, '<value>two</value>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (3, '<wrong');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT * FROM xmltest;
+ id | data
+----+------
+(0 rows)
+
+SELECT xmlcomment('test');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlcomment('-test');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlcomment('test-');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlcomment('--test');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlcomment('te st');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat('hello', 'you');
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('hello', 'you');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat(1, 2);
+ERROR: argument of XMLCONCAT must be type xml, not type integer
+LINE 1: SELECT xmlconcat(1, 2);
+ ^
+SELECT xmlconcat('bad', '<syntax');
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('bad', '<syntax');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standa...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlconcat(NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlconcat(NULL, NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name num, 37);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, text 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xml 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, text 'b<a/>r');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xml 'b<a/>r');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, array[1, 2, 3]);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET xmlbinary TO base64;
+SELECT xmlelement(name foo, bytea 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET xmlbinary TO hex;
+SELECT xmlelement(name foo, bytea 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content ' ');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content 'abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<abc>x</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document ' ');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document 'abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<abc>x</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<invalidentity>&</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name foo);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xml);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xmlstuff);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name foo, 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name foo, 'in?>valid');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name foo, null);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xml, null);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xmlstuff, null);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name foo, ' bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone no...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot(xml '<foo/>', version '2.0');
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version '2.0');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone ye...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ xmlserialize
+--------------
+(0 rows)
+
+SELECT xmlserialize(content 'good' as char(10));
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(content 'good' as char(10));
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlserialize(document 'bad' as text);
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(document 'bad' as text);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml 'abc' IS NOT DOCUMENT;
+ERROR: unsupported XML feature
+LINE 1: SELECT xml 'abc' IS NOT DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT '<>' IS NOT DOCUMENT;
+ERROR: unsupported XML feature
+LINE 1: SELECT '<>' IS NOT DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlagg(data) FROM xmltest;
+ xmlagg
+--------
+
+(1 row)
+
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+ xmlagg
+--------
+
+(1 row)
+
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name "123");
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ERROR: unsupported XML feature
+LINE 1: PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET XML OPTION DOCUMENT;
+EXECUTE foo ('<bar/>');
+ERROR: prepared statement "foo" does not exist
+EXECUTE foo ('bad');
+ERROR: prepared statement "foo" does not exist
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET XML OPTION CONTENT;
+EXECUTE foo ('<bar/>');
+ERROR: prepared statement "foo" does not exist
+EXECUTE foo ('good');
+ERROR: prepared statement "foo" does not exist
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<!DOCTYPE a><a/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!DOCTYPE a><a/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ERROR: unsupported XML feature
+LINE 1: CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ERROR: unsupported XML feature
+LINE 1: CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+ERROR: unsupported XML feature
+LINE 1: ...EATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+ERROR: unsupported XML feature
+LINE 1: ...EATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+ table_name | view_definition
+------------+--------------------------------------------------------------------------------
+ xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment;
+ xmlview5 | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
+(2 rows)
+
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+ xpath
+-------
+(0 rows)
+
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ?column?
+----------
+(0 rows)
+
+SELECT xpath('', '<!-- error -->');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('', '<!-- error -->');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//text()', '<local:data xmlns:local="http://12...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="ht...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>'...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//text()', '<root>&lt;</root>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//text()', '<root>&lt;</root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('//@value', '<root value="&lt;"/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//@value', '<root value="&lt;"/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('''<<invalid>>''', '<root/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('/nosuchtag', '<root/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/nosuchtag', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath('root', '<root/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('root', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ERROR: unsupported XML feature
+LINE 1: ...sts('//town[text() = ''Toronto'']' PASSING BY REF '<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ERROR: unsupported XML feature
+LINE 1: ...sts('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+ERROR: unsupported XML feature
+LINE 1: ...LECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ERROR: unsupported XML feature
+LINE 1: ...ELECT xpath_exists('//town[text() = ''Toronto'']','<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ERROR: unsupported XML feature
+LINE 1: ...ELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</n...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</n...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http:...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http:...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 0
+(1 row)
+
+CREATE TABLE query ( expr TEXT );
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+ count
+-------
+ 0
+(1 row)
+
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed_document('abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed_content('abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET xmloption TO DOCUMENT;
+SELECT xml_is_well_formed('abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<abc/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<foo>bar</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<foo>bar</foo');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SET xmloption TO CONTENT;
+SELECT xml_is_well_formed('abc');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ERROR: unsupported XML feature at character 20
+\set VERBOSITY default
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+SELECT * FROM xmltableview1;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+\sv xmltableview1
+CREATE OR REPLACE VIEW public.xmltableview1 AS
+ SELECT "xmltable".id,
+ "xmltable"._id,
+ "xmltable".country_name,
+ "xmltable".country_id,
+ "xmltable".region_id,
+ "xmltable".size,
+ "xmltable".unit,
+ "xmltable".premier_name
+ FROM ( SELECT xmldata.data
+ FROM xmldata) x,
+ LATERAL XMLTABLE(('/ROWS/ROW'::text) PASSING (x.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop
+ -> Seq Scan on xmldata
+ -> Table Function Scan on "xmltable"
+(3 rows)
+
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+ERROR: XMLTABLE function has 1 columns available but 2 columns specified
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT * FROM xmltableview2;
+ERROR: relation "xmltableview2" does not exist
+LINE 1: SELECT * FROM xmltableview2;
+ ^
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+ERROR: unsupported XML feature
+LINE 2: PASSING '<foo/>'
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+EXECUTE pp;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ id
+----
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ id
+----
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+---------
+(0 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+---------
+(0 rows)
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+ERROR: unsupported XML feature
+LINE 1: select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hel...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</en...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</en...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+(0 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ Table Function Call: XMLTABLE(('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]'::text) PASSING (xmldata.data) COLUMNS "COUNTRY_NAME" text, "REGION_ID" integer)
+ Filter: ("xmltable"."COUNTRY_NAME" = 'Japan'::text)
+(8 rows)
+
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+ Filter: ("xmltable".region_id = 2)
+(8 rows)
+
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+CREATE TABLE xmltest2(x xml, _path text);
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ a
+---
+(0 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ a
+---
+(0 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ a
+---
+(0 rows)
+
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+\x
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
+\x
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
diff --git a/yql/essentials/tests/postgresql/original/cases/xml_2.out b/yql/essentials/tests/postgresql/original/cases/xml_2.out
new file mode 100644
index 0000000000..493c6186e1
--- /dev/null
+++ b/yql/essentials/tests/postgresql/original/cases/xml_2.out
@@ -0,0 +1,1550 @@
+CREATE TABLE xmltest (
+ id int,
+ data xml
+);
+INSERT INTO xmltest VALUES (1, '<value>one</value>');
+INSERT INTO xmltest VALUES (2, '<value>two</value>');
+INSERT INTO xmltest VALUES (3, '<wrong');
+ERROR: invalid XML content
+LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
+ ^
+DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
+SELECT * FROM xmltest;
+ id | data
+----+--------------------
+ 1 | <value>one</value>
+ 2 | <value>two</value>
+(2 rows)
+
+SELECT xmlcomment('test');
+ xmlcomment
+-------------
+ <!--test-->
+(1 row)
+
+SELECT xmlcomment('-test');
+ xmlcomment
+--------------
+ <!---test-->
+(1 row)
+
+SELECT xmlcomment('test-');
+ERROR: invalid XML comment
+SELECT xmlcomment('--test');
+ERROR: invalid XML comment
+SELECT xmlcomment('te st');
+ xmlcomment
+--------------
+ <!--te st-->
+(1 row)
+
+SELECT xmlconcat(xmlcomment('hello'),
+ xmlelement(NAME qux, 'foo'),
+ xmlcomment('world'));
+ xmlconcat
+----------------------------------------
+ <!--hello--><qux>foo</qux><!--world-->
+(1 row)
+
+SELECT xmlconcat('hello', 'you');
+ xmlconcat
+-----------
+ helloyou
+(1 row)
+
+SELECT xmlconcat(1, 2);
+ERROR: argument of XMLCONCAT must be type xml, not type integer
+LINE 1: SELECT xmlconcat(1, 2);
+ ^
+SELECT xmlconcat('bad', '<syntax');
+ERROR: invalid XML content
+LINE 1: SELECT xmlconcat('bad', '<syntax');
+ ^
+DETAIL: line 1: Couldn't find end of Start Tag syntax line 1
+SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
+ xmlconcat
+-----------------------------------
+ <?xml version="1.1"?><foo/><bar/>
+(1 row)
+
+SELECT xmlconcat(NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlconcat(NULL, NULL);
+ xmlconcat
+-----------
+
+(1 row)
+
+SELECT xmlelement(name element,
+ xmlattributes (1 as one, 'deuce' as two),
+ 'content');
+ xmlelement
+------------------------------------------------
+ <element one="1" two="deuce">content</element>
+(1 row)
+
+SELECT xmlelement(name element,
+ xmlattributes ('unnamed and wrong'));
+ERROR: unnamed XML attribute value must be a column reference
+LINE 2: xmlattributes ('unnamed and wrong'));
+ ^
+SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
+ xmlelement
+-------------------------------------------
+ <element><nested>stuff</nested></element>
+(1 row)
+
+SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ xmlelement
+----------------------------------------------------------------------
+ <employee><name>sharon</name><age>25</age><pay>1000</pay></employee>
+ <employee><name>sam</name><age>30</age><pay>2000</pay></employee>
+ <employee><name>bill</name><age>20</age><pay>1000</pay></employee>
+ <employee><name>jeff</name><age>23</age><pay>600</pay></employee>
+ <employee><name>cim</name><age>30</age><pay>400</pay></employee>
+ <employee><name>linda</name><age>19</age><pay>100</pay></employee>
+(6 rows)
+
+SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ERROR: XML attribute name "a" appears more than once
+LINE 1: ...ment(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
+ ^
+SELECT xmlelement(name num, 37);
+ xmlelement
+---------------
+ <num>37</num>
+(1 row)
+
+SELECT xmlelement(name foo, text 'bar');
+ xmlelement
+----------------
+ <foo>bar</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xml 'bar');
+ xmlelement
+----------------
+ <foo>bar</foo>
+(1 row)
+
+SELECT xmlelement(name foo, text 'b<a/>r');
+ xmlelement
+-------------------------
+ <foo>b&lt;a/&gt;r</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xml 'b<a/>r');
+ xmlelement
+-------------------
+ <foo>b<a/>r</foo>
+(1 row)
+
+SELECT xmlelement(name foo, array[1, 2, 3]);
+ xmlelement
+-------------------------------------------------------------------------
+ <foo><element>1</element><element>2</element><element>3</element></foo>
+(1 row)
+
+SET xmlbinary TO base64;
+SELECT xmlelement(name foo, bytea 'bar');
+ xmlelement
+-----------------
+ <foo>YmFy</foo>
+(1 row)
+
+SET xmlbinary TO hex;
+SELECT xmlelement(name foo, bytea 'bar');
+ xmlelement
+-------------------
+ <foo>626172</foo>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes(true as bar));
+ xmlelement
+-------------------
+ <foo bar="true"/>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
+ xmlelement
+----------------------------------
+ <foo bar="2009-04-09T00:24:37"/>
+(1 row)
+
+SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
+ERROR: timestamp out of range
+DETAIL: XML does not support infinite timestamp values.
+SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
+ xmlelement
+------------------------------------------------------------
+ <foo funny="&lt;&gt;&amp;&quot;'" funnier="b&lt;a/&gt;r"/>
+(1 row)
+
+SELECT xmlparse(content '');
+ xmlparse
+----------
+
+(1 row)
+
+SELECT xmlparse(content ' ');
+ xmlparse
+----------
+
+(1 row)
+
+SELECT xmlparse(content 'abc');
+ xmlparse
+----------
+ abc
+(1 row)
+
+SELECT xmlparse(content '<abc>x</abc>');
+ xmlparse
+--------------
+ <abc>x</abc>
+(1 row)
+
+SELECT xmlparse(content '<invalidentity>&</invalidentity>');
+ERROR: invalid XML content
+DETAIL: line 1: xmlParseEntityRef: no name
+<invalidentity>&</invalidentity>
+ ^
+line 1: chunk is not well balanced
+SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
+ERROR: invalid XML content
+DETAIL: line 1: Entity 'idontexist' not defined
+<undefinedentity>&idontexist;</undefinedentity>
+ ^
+line 1: chunk is not well balanced
+SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
+ xmlparse
+---------------------------
+ <invalidns xmlns='&lt;'/>
+(1 row)
+
+SELECT xmlparse(content '<relativens xmlns=''relative''/>');
+ xmlparse
+--------------------------------
+ <relativens xmlns='relative'/>
+(1 row)
+
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+ERROR: invalid XML content
+DETAIL: line 1: Entity 'idontexist' not defined
+<twoerrors>&idontexist;</unbalanced>
+ ^
+line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
+line 1: chunk is not well balanced
+SELECT xmlparse(content '<nosuchprefix:tag/>');
+ xmlparse
+---------------------
+ <nosuchprefix:tag/>
+(1 row)
+
+SELECT xmlparse(document ' ');
+ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+SELECT xmlparse(document 'abc');
+ERROR: invalid XML document
+DETAIL: line 1: Start tag expected, '<' not found
+abc
+^
+SELECT xmlparse(document '<abc>x</abc>');
+ xmlparse
+--------------
+ <abc>x</abc>
+(1 row)
+
+SELECT xmlparse(document '<invalidentity>&</abc>');
+ERROR: invalid XML document
+DETAIL: line 1: xmlParseEntityRef: no name
+<invalidentity>&</abc>
+ ^
+line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+ERROR: invalid XML document
+DETAIL: line 1: Entity 'idontexist' not defined
+<undefinedentity>&idontexist;</abc>
+ ^
+line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
+SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
+ xmlparse
+---------------------------
+ <invalidns xmlns='&lt;'/>
+(1 row)
+
+SELECT xmlparse(document '<relativens xmlns=''relative''/>');
+ xmlparse
+--------------------------------
+ <relativens xmlns='relative'/>
+(1 row)
+
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+ERROR: invalid XML document
+DETAIL: line 1: Entity 'idontexist' not defined
+<twoerrors>&idontexist;</unbalanced>
+ ^
+line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
+SELECT xmlparse(document '<nosuchprefix:tag/>');
+ xmlparse
+---------------------
+ <nosuchprefix:tag/>
+(1 row)
+
+SELECT xmlpi(name foo);
+ xmlpi
+---------
+ <?foo?>
+(1 row)
+
+SELECT xmlpi(name xml);
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff);
+ xmlpi
+--------------
+ <?xmlstuff?>
+(1 row)
+
+SELECT xmlpi(name foo, 'bar');
+ xmlpi
+-------------
+ <?foo bar?>
+(1 row)
+
+SELECT xmlpi(name foo, 'in?>valid');
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction cannot contain "?>".
+SELECT xmlpi(name foo, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name xml, null);
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ xmlpi
+-------------------------------------------------------
+ <?xml-stylesheet href="mystyle.css" type="text/css"?>
+(1 row)
+
+SELECT xmlpi(name foo, ' bar');
+ xmlpi
+-------------
+ <?foo bar?>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
+ xmlroot
+---------
+ <foo/>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version '2.0');
+ xmlroot
+-----------------------------
+ <?xml version="2.0"?><foo/>
+(1 row)
+
+SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
+ xmlroot
+---------------------------------------------
+ <?xml version="1.1" standalone="no"?><foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
+ xmlroot
+---------------------------------------------
+ <?xml version="1.0" standalone="no"?><foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
+ xmlroot
+---------
+ <foo/>
+(1 row)
+
+SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
+ xmlroot
+----------------------------------------------
+ <?xml version="1.0" standalone="yes"?><foo/>
+(1 row)
+
+SELECT xmlroot (
+ xmlelement (
+ name gazonk,
+ xmlattributes (
+ 'val' AS name,
+ 1 + 1 AS num
+ ),
+ xmlelement (
+ NAME qux,
+ 'foo'
+ )
+ ),
+ version '1.0',
+ standalone yes
+);
+ xmlroot
+------------------------------------------------------------------------------------------
+ <?xml version="1.0" standalone="yes"?><gazonk name="val" num="2"><qux>foo</qux></gazonk>
+(1 row)
+
+SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
+ xmlserialize
+--------------------
+ <value>one</value>
+ <value>two</value>
+(2 rows)
+
+SELECT xmlserialize(content 'good' as char(10));
+ xmlserialize
+--------------
+ good
+(1 row)
+
+SELECT xmlserialize(document 'bad' as text);
+ERROR: not an XML document
+SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT xml 'abc' IS NOT DOCUMENT;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT '<>' IS NOT DOCUMENT;
+ERROR: invalid XML content
+LINE 1: SELECT '<>' IS NOT DOCUMENT;
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<>
+ ^
+SELECT xmlagg(data) FROM xmltest;
+ xmlagg
+--------------------------------------
+ <value>one</value><value>two</value>
+(1 row)
+
+SELECT xmlagg(data) FROM xmltest WHERE id > 10;
+ xmlagg
+--------
+
+(1 row)
+
+SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
+ xmlelement
+--------------------------------------------------------------------------------------------------------------------------------
+ <employees><name>sharon</name><name>sam</name><name>bill</name><name>jeff</name><name>cim</name><name>linda</name></employees>
+(1 row)
+
+-- Check mapping SQL identifier to XML name
+SELECT xmlpi(name ":::_xml_abc135.%-&_");
+ xmlpi
+-------------------------------------------------
+ <?_x003A_::_x005F_xml_abc135._x0025_-_x0026__?>
+(1 row)
+
+SELECT xmlpi(name "123");
+ xmlpi
+---------------
+ <?_x0031_23?>
+(1 row)
+
+PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+SET XML OPTION DOCUMENT;
+EXECUTE foo ('<bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+EXECUTE foo ('bad');
+ERROR: invalid XML document
+LINE 1: EXECUTE foo ('bad');
+ ^
+DETAIL: line 1: Start tag expected, '<' not found
+bad
+^
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: invalid XML document
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: line 1: Extra content at the end of the document
+<!DOCTYPE a><a/><b/>
+ ^
+SET XML OPTION CONTENT;
+EXECUTE foo ('<bar/>');
+ xmlconcat
+--------------
+ <foo/><bar/>
+(1 row)
+
+EXECUTE foo ('good');
+ xmlconcat
+------------
+ <foo/>good
+(1 row)
+
+SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
+ xml
+--------------------------------------------------------------------
+ <!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
+ xml
+------------------------------
+ <!-- hi--> <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<!DOCTYPE a><a/>';
+ xml
+------------------
+ <!DOCTYPE a><a/>
+(1 row)
+
+SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<!-- hi--> oops <!DOCTYPE a><a/>
+ ^
+SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
+ ^
+DETAIL: line 1: StartTag: invalid element name
+<!-- hi--> <oops/> <!DOCTYPE a><a/>
+ ^
+SELECT xml '<!DOCTYPE a><a/><b/>';
+ERROR: invalid XML content
+LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
+ ^
+DETAIL: line 1: Extra content at the end of the document
+<!DOCTYPE a><a/><b/>
+ ^
+-- Test backwards parsing
+CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
+CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
+CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+SELECT table_name, view_definition FROM information_schema.views
+ WHERE table_name LIKE 'xmlview%' ORDER BY 1;
+ table_name | view_definition
+------------+-------------------------------------------------------------------------------------------------------------------
+ xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment;
+ xmlview2 | SELECT XMLCONCAT('hello'::xml, 'you'::xml) AS "xmlconcat";
+ xmlview3 | SELECT XMLELEMENT(NAME element, XMLATTRIBUTES(1 AS ":one:", 'deuce' AS two), 'content&') AS "xmlelement";
+ xmlview4 | SELECT XMLELEMENT(NAME employee, XMLFOREST(emp.name AS name, emp.age AS age, emp.salary AS pay)) AS "xmlelement"+
+ | FROM emp;
+ xmlview5 | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
+ xmlview6 | SELECT XMLPI(NAME foo, 'bar'::text) AS "xmlpi";
+ xmlview7 | SELECT XMLROOT('<foo/>'::xml, VERSION NO VALUE, STANDALONE YES) AS "xmlroot";
+ xmlview8 | SELECT (XMLSERIALIZE(CONTENT 'good'::xml AS character(10)))::character(10) AS "xmlserialize";
+ xmlview9 | SELECT XMLSERIALIZE(CONTENT 'good'::xml AS text) AS "xmlserialize";
+(9 rows)
+
+-- Text XPath expressions evaluation
+SELECT xpath('/value', data) FROM xmltest;
+ xpath
+----------------------
+ {<value>one</value>}
+ {<value>two</value>}
+(2 rows)
+
+SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
+ ?column?
+----------
+ t
+ t
+(2 rows)
+
+SELECT xpath('', '<!-- error -->');
+ERROR: empty XPath expression
+CONTEXT: SQL function "xpath" statement 1
+SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ xpath
+----------------
+ {"number one"}
+(1 row)
+
+SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+-------
+ {1,2}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" id=\"1\">number one</local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
+SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
+ xpath
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {"<local:piece xmlns:local=\"http://127.0.0.1\" xmlns=\"http://127.0.0.2\" id=\"1\"><internal>number one</internal><internal2/></local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
+(1 row)
+
+SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
+ xpath
+-------------------------
+ {<b>two</b>,<b>etc</b>}
+(1 row)
+
+SELECT xpath('//text()', '<root>&lt;</root>');
+ xpath
+--------
+ {&lt;}
+(1 row)
+
+SELECT xpath('//@value', '<root value="&lt;"/>');
+ xpath
+--------
+ {&lt;}
+(1 row)
+
+SELECT xpath('''<<invalid>>''', '<root/>');
+ xpath
+---------------------------
+ {&lt;&lt;invalid&gt;&gt;}
+(1 row)
+
+SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ xpath
+-------
+ {3}
+(1 row)
+
+SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ xpath
+---------
+ {false}
+(1 row)
+
+SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ xpath
+--------
+ {true}
+(1 row)
+
+SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ xpath
+--------
+ {root}
+(1 row)
+
+SELECT xpath('/nosuchtag', '<root/>');
+ xpath
+-------
+ {}
+(1 row)
+
+SELECT xpath('root', '<root/>');
+ xpath
+-----------
+ {<root/>}
+(1 row)
+
+-- Round-trip non-ASCII data through xpath().
+DO $$
+DECLARE
+ xml_declaration text := '<?xml version="1.0" encoding="ISO-8859-1"?>';
+ degree_symbol text;
+ res xml[];
+BEGIN
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
+ -- may not work on non-ASCII data. The untranslatable_character and
+ -- undefined_function traps below, currently dead code, will become relevant
+ -- if we remove this limitation.
+ IF current_setting('server_encoding') <> 'UTF8' THEN
+ RAISE LOG 'skip: encoding % unsupported for xpath',
+ current_setting('server_encoding');
+ RETURN;
+ END IF;
+
+ degree_symbol := convert_from('\xc2b0', 'UTF8');
+ res := xpath('text()', (xml_declaration ||
+ '<x>' || degree_symbol || '</x>')::xml);
+ IF degree_symbol <> res[1]::text THEN
+ RAISE 'expected % (%), got % (%)',
+ degree_symbol, convert_to(degree_symbol, 'UTF8'),
+ res[1], convert_to(res[1]::text, 'UTF8');
+ END IF;
+EXCEPTION
+ -- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
+ WHEN untranslatable_character
+ -- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
+ OR undefined_function
+ -- unsupported XML feature
+ OR feature_not_supported THEN
+ RAISE LOG 'skip: %', SQLERRM;
+END
+$$;
+-- Test xmlexists and xpath_exists
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ xmlexists
+-----------
+ f
+(1 row)
+
+SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
+ xmlexists
+-----------
+ t
+(1 row)
+
+SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
+ xmlexists
+-----------
+ t
+(1 row)
+
+SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ xpath_exists
+--------------
+ f
+(1 row)
+
+SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
+ xpath_exists
+--------------
+ t
+(1 row)
+
+SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ xpath_exists
+--------------
+ t
+(1 row)
+
+INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
+ count
+-------
+ 1
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
+ count
+-------
+ 1
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 0
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 2
+(1 row)
+
+SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
+ count
+-------
+ 1
+(1 row)
+
+CREATE TABLE query ( expr TEXT );
+INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
+SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
+ count
+-------
+ 2
+(1 row)
+
+-- Test xml_is_well_formed and variants
+SELECT xml_is_well_formed_document('<foo>bar</foo>');
+ xml_is_well_formed_document
+-----------------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed_document('abc');
+ xml_is_well_formed_document
+-----------------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed_content('<foo>bar</foo>');
+ xml_is_well_formed_content
+----------------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed_content('abc');
+ xml_is_well_formed_content
+----------------------------
+ t
+(1 row)
+
+SET xmloption TO DOCUMENT;
+SELECT xml_is_well_formed('abc');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<abc/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<foo>bar</foo>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<foo>bar</foo');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<foo><bar>baz</foo>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<invalidentity>&</abc>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
+ xml_is_well_formed
+--------------------
+ f
+(1 row)
+
+SET xmloption TO CONTENT;
+SELECT xml_is_well_formed('abc');
+ xml_is_well_formed
+--------------------
+ t
+(1 row)
+
+-- Since xpath() deals with namespaces, it's a bit stricter about
+-- what's well-formed and what's not. If we don't obey these rules
+-- (i.e. ignore namespace-related errors from libxml), xpath()
+-- fails in subtle ways. The following would for example produce
+-- the xml value
+-- <invalidns xmlns='<'/>
+-- which is invalid because '<' may not appear un-escaped in
+-- attribute values.
+-- Since different libxml versions emit slightly different
+-- error messages, we suppress the DETAIL in this test.
+\set VERBOSITY terse
+SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
+ERROR: could not parse XML document
+\set VERBOSITY default
+-- Again, the XML isn't well-formed for namespace purposes
+SELECT xpath('/*', '<nosuchprefix:tag/>');
+ERROR: could not parse XML document
+DETAIL: line 1: Namespace prefix nosuchprefix on tag is not defined
+<nosuchprefix:tag/>
+ ^
+CONTEXT: SQL function "xpath" statement 1
+-- XPath deprecates relative namespaces, but they're not supposed to
+-- throw an error, only a warning.
+SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+WARNING: line 1: xmlns: URI relative is not absolute
+<relativens xmlns='relative'/>
+ ^
+ xpath
+--------------------------------------
+ {"<relativens xmlns=\"relative\"/>"}
+(1 row)
+
+-- External entity references should not leak filesystem information.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
+ xmlparse
+-----------------------------------------------------------------
+ <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>
+(1 row)
+
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
+ xmlparse
+-----------------------------------------------------------------------
+ <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>
+(1 row)
+
+-- This might or might not load the requested DTD, but it mustn't throw error.
+SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
+ xmlparse
+------------------------------------------------------------------------------------------------------------------------------------------------------
+ <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>
+(1 row)
+
+-- XMLPATH tests
+CREATE TABLE xmldata(data xml);
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="1">
+ <COUNTRY_ID>AU</COUNTRY_ID>
+ <COUNTRY_NAME>Australia</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="2">
+ <COUNTRY_ID>CN</COUNTRY_ID>
+ <COUNTRY_NAME>China</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="3">
+ <COUNTRY_ID>HK</COUNTRY_ID>
+ <COUNTRY_NAME>HongKong</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="4">
+ <COUNTRY_ID>IN</COUNTRY_ID>
+ <COUNTRY_NAME>India</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID>
+</ROW>
+<ROW id="5">
+ <COUNTRY_ID>JP</COUNTRY_ID>
+ <COUNTRY_NAME>Japan</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+</ROW>
+<ROW id="6">
+ <COUNTRY_ID>SG</COUNTRY_ID>
+ <COUNTRY_NAME>Singapore</COUNTRY_NAME>
+ <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
+</ROW>
+</ROWS>');
+-- XMLTABLE with columns
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+CREATE VIEW xmltableview1 AS SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME/text()' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+SELECT * FROM xmltableview1;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+\sv xmltableview1
+CREATE OR REPLACE VIEW public.xmltableview1 AS
+ SELECT "xmltable".id,
+ "xmltable"._id,
+ "xmltable".country_name,
+ "xmltable".country_id,
+ "xmltable".region_id,
+ "xmltable".size,
+ "xmltable".unit,
+ "xmltable".premier_name
+ FROM ( SELECT xmldata.data
+ FROM xmldata) x,
+ LATERAL XMLTABLE(('/ROWS/ROW'::text) PASSING (x.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
+ QUERY PLAN
+-----------------------------------------
+ Nested Loop
+ -> Seq Scan on xmldata
+ -> Table Function Scan on "xmltable"
+(3 rows)
+
+EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME/text()'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- errors
+SELECT * FROM XMLTABLE (ROW () PASSING null COLUMNS v1 timestamp) AS f (v1, v2);
+ERROR: XMLTABLE function has 1 columns available but 2 columns specified
+-- XMLNAMESPACES tests
+SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+ a
+----
+ 10
+(1 row)
+
+CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
+ '/zz:rows/zz:row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'zz:a');
+SELECT * FROM xmltableview2;
+ a
+----
+ 10
+(1 row)
+
+SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
+ '/rows/row'
+ PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
+ COLUMNS a int PATH 'a');
+ERROR: DEFAULT namespace is not supported
+SELECT * FROM XMLTABLE('.'
+ PASSING '<foo/>'
+ COLUMNS a text PATH 'foo/namespace::node()');
+ a
+--------------------------------------
+ http://www.w3.org/XML/1998/namespace
+(1 row)
+
+-- used in prepare statements
+PREPARE pp AS
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+EXECUTE pp;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+(6 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+ India | 3
+ Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+ 1 | India | 3
+ 2 | Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
+ id | COUNTRY_NAME | REGION_ID
+----+--------------+-----------
+ 4 | India | 3
+ 5 | Japan | 3
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
+ id
+----
+ 4
+ 5
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
+ id
+----
+ 1
+ 2
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+------------------------------------------------------------------
+ 4 | India | 3 | <ROW id="4"> +
+ | | | <COUNTRY_ID>IN</COUNTRY_ID> +
+ | | | <COUNTRY_NAME>India</COUNTRY_NAME> +
+ | | | <REGION_ID>3</REGION_ID> +
+ | | | </ROW>
+ 5 | Japan | 3 | <ROW id="5"> +
+ | | | <COUNTRY_ID>JP</COUNTRY_ID> +
+ | | | <COUNTRY_NAME>Japan</COUNTRY_NAME> +
+ | | | <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>+
+ | | | </ROW>
+(2 rows)
+
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+-----------------------------------------------------------------------------------------------------------------------------
+ 4 | India | 3 | <COUNTRY_ID>IN</COUNTRY_ID><COUNTRY_NAME>India</COUNTRY_NAME><REGION_ID>3</REGION_ID>
+ 5 | Japan | 3 | <COUNTRY_ID>JP</COUNTRY_ID><COUNTRY_NAME>Japan</COUNTRY_NAME><REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
+(2 rows)
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
+ element
+----------------------
+ a1aa2a bbbbxxxcccc
+(1 row)
+
+SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
+ERROR: more than one value returned by column XPath expression
+-- CDATA test
+select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
+ c
+-------------------------
+ <hello> &"<>!<a>foo</a>
+ 2
+(2 rows)
+
+-- XML builtin entities
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent text);
+ ent
+-----
+ '
+ "
+ &
+ <
+ >
+(5 rows)
+
+SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>&apos;</ent></a><a><ent>&quot;</ent></a><a><ent>&amp;</ent></a><a><ent>&lt;</ent></a><a><ent>&gt;</ent></a></x>' COLUMNS ent xml);
+ ent
+------------------
+ <ent>'</ent>
+ <ent>"</ent>
+ <ent>&amp;</ent>
+ <ent>&lt;</ent>
+ <ent>&gt;</ent>
+(5 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+(7 rows)
+
+-- test qual
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ COUNTRY_NAME | REGION_ID
+--------------+-----------
+ Japan | 3
+(1 row)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
+ Table Function Call: XMLTABLE(('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]'::text) PASSING (xmldata.data) COLUMNS "COUNTRY_NAME" text, "REGION_ID" integer)
+ Filter: ("xmltable"."COUNTRY_NAME" = 'Japan'::text)
+(8 rows)
+
+-- should to work with more data
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="10">
+ <COUNTRY_ID>CZ</COUNTRY_ID>
+ <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
+</ROW>
+<ROW id="11">
+ <COUNTRY_ID>DE</COUNTRY_ID>
+ <COUNTRY_NAME>Germany</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+<ROW id="12">
+ <COUNTRY_ID>FR</COUNTRY_ID>
+ <COUNTRY_NAME>France</COUNTRY_NAME>
+ <REGION_ID>2</REGION_ID>
+</ROW>
+</ROWS>');
+INSERT INTO xmldata VALUES('<ROWS>
+<ROW id="20">
+ <COUNTRY_ID>EG</COUNTRY_ID>
+ <COUNTRY_NAME>Egypt</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+<ROW id="21">
+ <COUNTRY_ID>SD</COUNTRY_ID>
+ <COUNTRY_NAME>Sudan</COUNTRY_NAME>
+ <REGION_ID>1</REGION_ID>
+</ROW>
+</ROWS>');
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+----------------+------------+-----------+------+------+---------------
+ 1 | 1 | Australia | AU | 3 | | | not specified
+ 2 | 2 | China | CN | 3 | | | not specified
+ 3 | 3 | HongKong | HK | 3 | | | not specified
+ 4 | 4 | India | IN | 3 | | | not specified
+ 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
+ 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
+ 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
+ 11 | 2 | Germany | DE | 2 | | | not specified
+ 12 | 3 | France | FR | 2 | | | not specified
+ 20 | 1 | Egypt | EG | 1 | | | not specified
+ 21 | 2 | Sudan | SD | 1 | | | not specified
+(11 rows)
+
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+----------------+------------+-----------+------+------+---------------
+ 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
+ 11 | 2 | Germany | DE | 2 | | | not specified
+ 12 | 3 | France | FR | 2 | | | not specified
+(3 rows)
+
+EXPLAIN (VERBOSE, COSTS OFF)
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE',
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
+ WHERE region_id = 2;
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Nested Loop
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ -> Seq Scan on public.xmldata
+ Output: xmldata.data
+ -> Table Function Scan on "xmltable"
+ Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
+ Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
+ Filter: ("xmltable".region_id = 2)
+(8 rows)
+
+-- should fail, NULL value
+SELECT xmltable.*
+ FROM (SELECT data FROM xmldata) x,
+ LATERAL XMLTABLE('/ROWS/ROW'
+ PASSING data
+ COLUMNS id int PATH '@id',
+ _id FOR ORDINALITY,
+ country_name text PATH 'COUNTRY_NAME' NOT NULL,
+ country_id text PATH 'COUNTRY_ID',
+ region_id int PATH 'REGION_ID',
+ size float PATH 'SIZE' NOT NULL,
+ unit text PATH 'SIZE/@unit',
+ premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
+ERROR: null is not allowed in column "size"
+-- if all is ok, then result is empty
+-- one line xml test
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc WHERE proname = 'f_leak'),
+ y AS (SELECT xmlelement(name proc,
+ xmlforest(proname, proowner,
+ procost, pronargs,
+ proargnames, proargtypes)) as proc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/proc' PASSING proc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ proname | proowner | procost | pronargs | proargnames | proargtypes
+---------+----------+---------+----------+-------------+-------------
+(0 rows)
+
+-- multi line xml test, result should be empty too
+WITH
+ x AS (SELECT proname, proowner, procost::numeric, pronargs,
+ array_to_string(proargnames,',') as proargnames,
+ case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
+ FROM pg_proc),
+ y AS (SELECT xmlelement(name data,
+ xmlagg(xmlelement(name proc,
+ xmlforest(proname, proowner, procost,
+ pronargs, proargnames, proargtypes)))) as doc
+ FROM x),
+ z AS (SELECT xmltable.*
+ FROM y,
+ LATERAL xmltable('/data/proc' PASSING doc
+ COLUMNS proname name,
+ proowner oid,
+ procost float,
+ pronargs int,
+ proargnames text,
+ proargtypes text))
+ SELECT * FROM z
+ EXCEPT SELECT * FROM x;
+ proname | proowner | procost | pronargs | proargnames | proargtypes
+---------+----------+---------+----------+-------------+-------------
+(0 rows)
+
+CREATE TABLE xmltest2(x xml, _path text);
+INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
+ a
+---
+ 1
+ 2
+ 3
+ 2
+(4 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
+ a
+---
+ 1
+ 2
+ 3
+ 2
+(4 rows)
+
+SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
+ a
+----
+ 11
+ 12
+ 13
+ 14
+(4 rows)
+
+-- XPath result can be boolean or number too
+SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
+ a | b | c | d | e
+----------+---+----+---+---
+ <a>a</a> | a | hi | t | 1
+(1 row)
+
+\x
+SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
+-[ RECORD 1 ]-----------------------------------------------------------
+x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post
+y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>+
+ |
+
+\x
+SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
+ a | b
+--------+--------------
+ <foo/> | &lt;foo/&gt;
+(1 row)
+
diff --git a/yql/essentials/tests/postgresql/patches/alter_table.out.patch b/yql/essentials/tests/postgresql/patches/alter_table.out.patch
new file mode 100644
index 0000000000..5b5418ce4e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/alter_table.out.patch
@@ -0,0 +1,112 @@
+--- alter_table.out (40977c8f0a0a339864b620914542e2d90392919b)
++++ alter_table.out (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -2671,7 +2671,8 @@ create table alterlock (f1 int primary key, f2 text);
+ insert into alterlock values (1, 'foo');
+ create table alterlock2 (f3 int primary key, f1 int);
+ insert into alterlock2 values (1, 1);
+-begin; alter table alterlock alter column f2 set statistics 150;
++begin;
++alter table alterlock alter column f2 set statistics 150;
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2679,7 +2680,8 @@ select * from my_locks order by 1;
+ (1 row)
+
+ rollback;
+-begin; alter table alterlock cluster on alterlock_pkey;
++begin;
++alter table alterlock cluster on alterlock_pkey;
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ ----------------+--------------------------
+@@ -2688,7 +2690,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock set without cluster;
++begin;
++alter table alterlock set without cluster;
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2696,7 +2699,8 @@ select * from my_locks order by 1;
+ (1 row)
+
+ commit;
+-begin; alter table alterlock set (fillfactor = 100);
++begin;
++alter table alterlock set (fillfactor = 100);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2705,7 +2709,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock reset (fillfactor);
++begin;
++alter table alterlock reset (fillfactor);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2714,7 +2719,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock set (toast.autovacuum_enabled = off);
++begin;
++alter table alterlock set (toast.autovacuum_enabled = off);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2723,7 +2729,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock set (autovacuum_enabled = off);
++begin;
++alter table alterlock set (autovacuum_enabled = off);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2732,7 +2739,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock alter column f2 set (n_distinct = 1);
++begin;
++alter table alterlock alter column f2 set (n_distinct = 1);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2741,7 +2749,8 @@ select * from my_locks order by 1;
+
+ rollback;
+ -- test that mixing options with different lock levels works as expected
+-begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
++begin;
++alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+--------------------------
+@@ -2750,7 +2759,8 @@ select * from my_locks order by 1;
+ (2 rows)
+
+ commit;
+-begin; alter table alterlock alter column f2 set storage extended;
++begin;
++alter table alterlock alter column f2 set storage extended;
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+---------------------
+@@ -2758,7 +2768,8 @@ select * from my_locks order by 1;
+ (1 row)
+
+ rollback;
+-begin; alter table alterlock alter column f2 set default 'x';
++begin;
++alter table alterlock alter column f2 set default 'x';
+ select * from my_locks order by 1;
+ relname | max_lockmode
+ -----------+---------------------
diff --git a/yql/essentials/tests/postgresql/patches/alter_table.sql.patch b/yql/essentials/tests/postgresql/patches/alter_table.sql.patch
new file mode 100644
index 0000000000..28e98d0a77
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/alter_table.sql.patch
@@ -0,0 +1,73 @@
+--- alter_table.sql (40977c8f0a0a339864b620914542e2d90392919b)
++++ alter_table.sql (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -1730,48 +1730,59 @@ insert into alterlock values (1, 'foo');
+ create table alterlock2 (f3 int primary key, f1 int);
+ insert into alterlock2 values (1, 1);
+
+-begin; alter table alterlock alter column f2 set statistics 150;
++begin;
++alter table alterlock alter column f2 set statistics 150;
+ select * from my_locks order by 1;
+ rollback;
+
+-begin; alter table alterlock cluster on alterlock_pkey;
++begin;
++alter table alterlock cluster on alterlock_pkey;
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock set without cluster;
++begin;
++alter table alterlock set without cluster;
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock set (fillfactor = 100);
++begin;
++alter table alterlock set (fillfactor = 100);
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock reset (fillfactor);
++begin;
++alter table alterlock reset (fillfactor);
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock set (toast.autovacuum_enabled = off);
++begin;
++alter table alterlock set (toast.autovacuum_enabled = off);
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock set (autovacuum_enabled = off);
++begin;
++alter table alterlock set (autovacuum_enabled = off);
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock alter column f2 set (n_distinct = 1);
++begin;
++alter table alterlock alter column f2 set (n_distinct = 1);
+ select * from my_locks order by 1;
+ rollback;
+
+ -- test that mixing options with different lock levels works as expected
+-begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
++begin;
++alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
+ select * from my_locks order by 1;
+ commit;
+
+-begin; alter table alterlock alter column f2 set storage extended;
++begin;
++alter table alterlock alter column f2 set storage extended;
+ select * from my_locks order by 1;
+ rollback;
+
+-begin; alter table alterlock alter column f2 set default 'x';
++begin;
++alter table alterlock alter column f2 set default 'x';
+ select * from my_locks order by 1;
+ rollback;
+
diff --git a/yql/essentials/tests/postgresql/patches/create_table.out.patch b/yql/essentials/tests/postgresql/patches/create_table.out.patch
new file mode 100644
index 0000000000..7bffbf189e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/create_table.out.patch
@@ -0,0 +1,96 @@
+--- create_table.out 2023-07-24 18:02:30.058334000 +0300
++++ create_table.out 2023-07-27 11:27:15.779766000 +0300
+@@ -218,43 +218,7 @@
+ -- invalid: non-lowercase quoted reloptions identifiers
+ CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
+ ERROR: unrecognized parameter "Fillfactor"
+-CREATE UNLOGGED TABLE unlogged1 (a int primary key); -- OK
+-CREATE TEMPORARY TABLE unlogged2 (a int primary key); -- OK
+-SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+- relname | relkind | relpersistence
+-----------------+---------+----------------
+- unlogged1 | r | u
+- unlogged1_pkey | i | u
+- unlogged2 | r | t
+- unlogged2_pkey | i | t
+-(4 rows)
+-
+-REINDEX INDEX unlogged1_pkey;
+-REINDEX INDEX unlogged2_pkey;
+-SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+- relname | relkind | relpersistence
+-----------------+---------+----------------
+- unlogged1 | r | u
+- unlogged1_pkey | i | u
+- unlogged2 | r | t
+- unlogged2_pkey | i | t
+-(4 rows)
+-
+-DROP TABLE unlogged2;
+-INSERT INTO unlogged1 VALUES (42);
+-CREATE UNLOGGED TABLE public.unlogged2 (a int primary key); -- also OK
+-CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key); -- not OK
+-ERROR: only temporary relations may be created in temporary schemas
+-LINE 1: CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key);
+- ^
+-CREATE TABLE pg_temp.implicitly_temp (a int primary key); -- OK
+ CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+-CREATE TEMP TABLE pg_temp.doubly_temp (a int primary key); -- also OK
+-CREATE TEMP TABLE public.temp_to_perm (a int primary key); -- not OK
+-ERROR: cannot create temporary relation in non-temporary schema
+-LINE 1: CREATE TEMP TABLE public.temp_to_perm (a int primary key);
+- ^
+-DROP TABLE unlogged1, public.unlogged2;
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ ERROR: relation "as_select1" already exists
+@@ -295,8 +259,10 @@
+ CREATE TABLE withoid() WITH (oids = true);
+ ERROR: tables declared WITH OIDS are not supported
+ -- but explicitly not adding oids is still supported
+-CREATE TEMP TABLE withoutoid() WITHOUT OIDS; DROP TABLE withoutoid;
+-CREATE TEMP TABLE withoutoid() WITH (oids = false); DROP TABLE withoutoid;
++CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
++DROP TABLE withoutoid;
++CREATE TEMP TABLE withoutoid() WITH (oids = false);
++DROP TABLE withoutoid;
+ -- check restriction with default expressions
+ -- invalid use of column reference in default expressions
+ CREATE TABLE default_expr_column (id int DEFAULT (id));
+@@ -334,14 +300,18 @@
+ -- Verify that subtransaction rollback restores rd_createSubid.
+ BEGIN;
+ CREATE TABLE remember_create_subid (c int);
+-SAVEPOINT q; DROP TABLE remember_create_subid; ROLLBACK TO q;
++SAVEPOINT q;
++DROP TABLE remember_create_subid;
++ROLLBACK TO q;
+ COMMIT;
+ DROP TABLE remember_create_subid;
+ -- Verify that subtransaction rollback restores rd_firstRelfilenodeSubid.
+ CREATE TABLE remember_node_subid (c int);
+ BEGIN;
+ ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+-SAVEPOINT q; DROP TABLE remember_node_subid; ROLLBACK TO q;
++SAVEPOINT q;
++DROP TABLE remember_node_subid;
++ROLLBACK TO q;
+ COMMIT;
+ DROP TABLE remember_node_subid;
+ --
+@@ -945,15 +915,6 @@
+ CONSTRAINT check_a CHECK (length(a) > 0)
+ ) PARTITION BY LIST (a);
+ CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+--- only inherited attributes (never local ones)
+-SELECT attname, attislocal, attinhcount FROM pg_attribute
+- WHERE attrelid = 'part_a'::regclass and attnum > 0
+- ORDER BY attnum;
+- attname | attislocal | attinhcount
+----------+------------+-------------
+- a | f | 1
+- b | f | 1
+-(2 rows)
+
+ -- able to specify column default, column constraint, and table constraint
+ -- first check the "column specified more than once" error
diff --git a/yql/essentials/tests/postgresql/patches/create_table.sql.patch b/yql/essentials/tests/postgresql/patches/create_table.sql.patch
new file mode 100644
index 0000000000..e496d21e76
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/create_table.sql.patch
@@ -0,0 +1,71 @@
+--- create_table.sql 2023-07-24 18:02:30.058334000 +0300
++++ create_table.sql 2023-07-27 11:26:22.063095000 +0300
+@@ -256,21 +256,7 @@
+ -- invalid: non-lowercase quoted reloptions identifiers
+ CREATE TABLE tas_case WITH ("Fillfactor" = 10) AS SELECT 1 a;
+
+-CREATE UNLOGGED TABLE unlogged1 (a int primary key); -- OK
+-CREATE TEMPORARY TABLE unlogged2 (a int primary key); -- OK
+-SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+-REINDEX INDEX unlogged1_pkey;
+-REINDEX INDEX unlogged2_pkey;
+-SELECT relname, relkind, relpersistence FROM pg_class WHERE relname ~ '^unlogged\d' ORDER BY relname;
+-DROP TABLE unlogged2;
+-INSERT INTO unlogged1 VALUES (42);
+-CREATE UNLOGGED TABLE public.unlogged2 (a int primary key); -- also OK
+-CREATE UNLOGGED TABLE pg_temp.unlogged3 (a int primary key); -- not OK
+-CREATE TABLE pg_temp.implicitly_temp (a int primary key); -- OK
+ CREATE TEMP TABLE explicitly_temp (a int primary key); -- also OK
+-CREATE TEMP TABLE pg_temp.doubly_temp (a int primary key); -- also OK
+-CREATE TEMP TABLE public.temp_to_perm (a int primary key); -- not OK
+-DROP TABLE unlogged1, public.unlogged2;
+
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+ CREATE TABLE as_select1 AS SELECT * FROM pg_class WHERE relkind = 'r';
+@@ -301,8 +287,10 @@
+ CREATE TABLE withoid() WITH (oids = true);
+
+ -- but explicitly not adding oids is still supported
+-CREATE TEMP TABLE withoutoid() WITHOUT OIDS; DROP TABLE withoutoid;
+-CREATE TEMP TABLE withoutoid() WITH (oids = false); DROP TABLE withoutoid;
++CREATE TEMP TABLE withoutoid() WITHOUT OIDS;
++DROP TABLE withoutoid;
++CREATE TEMP TABLE withoutoid() WITH (oids = false);
++DROP TABLE withoutoid;
+
+ -- check restriction with default expressions
+ -- invalid use of column reference in default expressions
+@@ -321,7 +309,9 @@
+ -- Verify that subtransaction rollback restores rd_createSubid.
+ BEGIN;
+ CREATE TABLE remember_create_subid (c int);
+-SAVEPOINT q; DROP TABLE remember_create_subid; ROLLBACK TO q;
++SAVEPOINT q;
++DROP TABLE remember_create_subid;
++ROLLBACK TO q;
+ COMMIT;
+ DROP TABLE remember_create_subid;
+
+@@ -329,7 +319,9 @@
+ CREATE TABLE remember_node_subid (c int);
+ BEGIN;
+ ALTER TABLE remember_node_subid ALTER c TYPE bigint;
+-SAVEPOINT q; DROP TABLE remember_node_subid; ROLLBACK TO q;
++SAVEPOINT q;
++DROP TABLE remember_node_subid;
++ROLLBACK TO q;
+ COMMIT;
+ DROP TABLE remember_node_subid;
+
+@@ -753,11 +745,6 @@
+
+ CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
+
+--- only inherited attributes (never local ones)
+-SELECT attname, attislocal, attinhcount FROM pg_attribute
+- WHERE attrelid = 'part_a'::regclass and attnum > 0
+- ORDER BY attnum;
+-
+ -- able to specify column default, column constraint, and table constraint
+
+ -- first check the "column specified more than once" error
diff --git a/yql/essentials/tests/postgresql/patches/json.out.patch b/yql/essentials/tests/postgresql/patches/json.out.patch
new file mode 100644
index 0000000000..8dcd51878d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/json.out.patch
@@ -0,0 +1,18 @@
+--- json.out
++++ json.out
+@@ -202,15 +202,6 @@ LINE 1: SELECT '{"abc":1,3}'::json;
+ ^
+ DETAIL: Expected string, but found "3".
+ CONTEXT: JSON data, line 1: {"abc":1,3...
+--- Recursion.
+-SET max_stack_depth = '100kB';
+-SELECT repeat('[', 10000)::json;
+-ERROR: stack depth limit exceeded
+-HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+-SELECT repeat('{"a":', 10000)::json;
+-ERROR: stack depth limit exceeded
+-HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+-RESET max_stack_depth;
+ -- Miscellaneous stuff.
+ SELECT 'true'::json; -- OK
+ json
diff --git a/yql/essentials/tests/postgresql/patches/json.sql.patch b/yql/essentials/tests/postgresql/patches/json.sql.patch
new file mode 100644
index 0000000000..fa455f1506
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/json.sql.patch
@@ -0,0 +1,15 @@
+--- json.sql
++++ json.sql
+@@ -41,12 +41,6 @@ SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK
+ SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot
+ SELECT '{"abc":1,3}'::json; -- ERROR, no value
+
+--- Recursion.
+-SET max_stack_depth = '100kB';
+-SELECT repeat('[', 10000)::json;
+-SELECT repeat('{"a":', 10000)::json;
+-RESET max_stack_depth;
+-
+ -- Miscellaneous stuff.
+ SELECT 'true'::json; -- OK
+ SELECT 'false'::json; -- OK
diff --git a/yql/essentials/tests/postgresql/patches/json_encoding.out.patch b/yql/essentials/tests/postgresql/patches/json_encoding.out.patch
new file mode 100644
index 0000000000..fb758ac64a
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/json_encoding.out.patch
@@ -0,0 +1,16 @@
+--- json_encoding.out (645054971474b440c91194f741c40b6d7be0b93d)
++++ json_encoding.out (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -1,13 +1,6 @@
+ --
+ -- encoding-sensitive tests for json and jsonb
+ --
+--- We provide expected-results files for UTF8 (json_encoding.out)
+--- and for SQL_ASCII (json_encoding_1.out). Skip otherwise.
+-SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+- AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+ SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+ ---------------------
diff --git a/yql/essentials/tests/postgresql/patches/json_encoding.sql.patch b/yql/essentials/tests/postgresql/patches/json_encoding.sql.patch
new file mode 100644
index 0000000000..e248455baa
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/json_encoding.sql.patch
@@ -0,0 +1,17 @@
+--- json_encoding.sql (645054971474b440c91194f741c40b6d7be0b93d)
++++ json_encoding.sql (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -2,14 +2,6 @@
+ -- encoding-sensitive tests for json and jsonb
+ --
+
+--- We provide expected-results files for UTF8 (json_encoding.out)
+--- and for SQL_ASCII (json_encoding_1.out). Skip otherwise.
+-SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+- AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+-
+ SELECT getdatabaseencoding(); -- just to label the results files
+
+ -- first json
diff --git a/yql/essentials/tests/postgresql/patches/jsonb.out.patch b/yql/essentials/tests/postgresql/patches/jsonb.out.patch
new file mode 100644
index 0000000000..e14bc869b6
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/jsonb.out.patch
@@ -0,0 +1,18 @@
+--- jsonb.out
++++ jsonb.out
+@@ -202,15 +202,6 @@ LINE 1: SELECT '{"abc":1,3}'::jsonb;
+ ^
+ DETAIL: Expected string, but found "3".
+ CONTEXT: JSON data, line 1: {"abc":1,3...
+--- Recursion.
+-SET max_stack_depth = '100kB';
+-SELECT repeat('[', 10000)::jsonb;
+-ERROR: stack depth limit exceeded
+-HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+-SELECT repeat('{"a":', 10000)::jsonb;
+-ERROR: stack depth limit exceeded
+-HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
+-RESET max_stack_depth;
+ -- Miscellaneous stuff.
+ SELECT 'true'::jsonb; -- OK
+ jsonb
diff --git a/yql/essentials/tests/postgresql/patches/jsonb.sql.patch b/yql/essentials/tests/postgresql/patches/jsonb.sql.patch
new file mode 100644
index 0000000000..99853df8ec
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/jsonb.sql.patch
@@ -0,0 +1,15 @@
+--- jsonb.sql
++++ jsonb.sql
+@@ -41,12 +41,6 @@ SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK
+ SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot
+ SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
+
+--- Recursion.
+-SET max_stack_depth = '100kB';
+-SELECT repeat('[', 10000)::jsonb;
+-SELECT repeat('{"a":', 10000)::jsonb;
+-RESET max_stack_depth;
+-
+ -- Miscellaneous stuff.
+ SELECT 'true'::jsonb; -- OK
+ SELECT 'false'::jsonb; -- OK
diff --git a/yql/essentials/tests/postgresql/patches/jsonpath_encoding.out.patch b/yql/essentials/tests/postgresql/patches/jsonpath_encoding.out.patch
new file mode 100644
index 0000000000..b2479a9c1b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/jsonpath_encoding.out.patch
@@ -0,0 +1,16 @@
+--- jsonpath_encoding.out (645054971474b440c91194f741c40b6d7be0b93d)
++++ jsonpath_encoding.out (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -1,13 +1,6 @@
+ --
+ -- encoding-sensitive tests for jsonpath
+ --
+--- We provide expected-results files for UTF8 (jsonpath_encoding.out)
+--- and for SQL_ASCII (jsonpath_encoding_1.out). Skip otherwise.
+-SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+- AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+ SELECT getdatabaseencoding(); -- just to label the results files
+ getdatabaseencoding
+ ---------------------
diff --git a/yql/essentials/tests/postgresql/patches/jsonpath_encoding.sql.patch b/yql/essentials/tests/postgresql/patches/jsonpath_encoding.sql.patch
new file mode 100644
index 0000000000..2de56bcba3
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/jsonpath_encoding.sql.patch
@@ -0,0 +1,17 @@
+--- jsonpath_encoding.sql (645054971474b440c91194f741c40b6d7be0b93d)
++++ jsonpath_encoding.sql (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -2,14 +2,6 @@
+ -- encoding-sensitive tests for jsonpath
+ --
+
+--- We provide expected-results files for UTF8 (jsonpath_encoding.out)
+--- and for SQL_ASCII (jsonpath_encoding_1.out). Skip otherwise.
+-SELECT getdatabaseencoding() NOT IN ('UTF8', 'SQL_ASCII')
+- AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+-
+ SELECT getdatabaseencoding(); -- just to label the results files
+
+ -- checks for double-quoted values
diff --git a/yql/essentials/tests/postgresql/patches/unicode.out.patch b/yql/essentials/tests/postgresql/patches/unicode.out.patch
new file mode 100644
index 0000000000..8d79a5701e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/unicode.out.patch
@@ -0,0 +1,10 @@
+--- unicode.out (645054971474b440c91194f741c40b6d7be0b93d)
++++ unicode.out (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -1,7 +1,3 @@
+-SELECT getdatabaseencoding() <> 'UTF8' AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+ SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+ sanity_check
+ --------------
diff --git a/yql/essentials/tests/postgresql/patches/unicode.sql.patch b/yql/essentials/tests/postgresql/patches/unicode.sql.patch
new file mode 100644
index 0000000000..c89a1e5e67
--- /dev/null
+++ b/yql/essentials/tests/postgresql/patches/unicode.sql.patch
@@ -0,0 +1,11 @@
+--- unicode.sql (645054971474b440c91194f741c40b6d7be0b93d)
++++ unicode.sql (8a1083b9b852a7dbb540208bd92787ee92f311f7)
+@@ -1,8 +1,3 @@
+-SELECT getdatabaseencoding() <> 'UTF8' AS skip_test \gset
+-\if :skip_test
+-\quit
+-\endif
+-
+ SELECT U&'\0061\0308bc' <> U&'\00E4bc' COLLATE "C" AS sanity_check;
+
+ SELECT normalize('');
diff --git a/yql/essentials/tests/postgresql/pg_tests.csv b/yql/essentials/tests/postgresql/pg_tests.csv
new file mode 100644
index 0000000000..d3c417ab61
--- /dev/null
+++ b/yql/essentials/tests/postgresql/pg_tests.csv
@@ -0,0 +1,57 @@
+testcase,statements,successful,ratio
+aggregates,416,129,31.01
+alter_table,1679,164,9.77
+arrays,410,148,36.1
+bit,115,90,78.26
+boolean,93,87,93.55
+case,63,37,58.73
+char,25,16,64.0
+comments,7,7,100.0
+create_misc,76,9,11.84
+create_table,368,48,13.04
+date,264,207,78.41
+dbsize,24,20,83.33
+delete,10,5,50.0
+expressions,63,18,28.57
+float4,96,82,85.42
+float8,168,144,85.71
+functional_deps,40,7,17.5
+horology,306,101,33.01
+insert,357,15,4.2
+int2,49,47,95.92
+int4,70,68,97.14
+int8,142,127,89.44
+interval,168,118,70.24
+join,591,205,34.69
+json,450,167,37.11
+json_encoding,42,42,100.0
+jsonb,1013,529,52.22
+jsonb_jsonpath,427,93,21.78
+jsonpath,169,152,89.94
+jsonpath_encoding,31,31,100.0
+limit,84,18,21.43
+name,40,22,55.0
+numeric,915,813,88.85
+numerology,24,16,66.67
+oid,27,27,100.0
+select,88,27,30.68
+select_distinct,46,4,8.7
+select_distinct_on,4,1,25.0
+select_having,23,19,82.61
+select_implicit,44,28,63.64
+select_into,67,3,4.48
+strings,390,300,76.92
+subselect,234,107,45.73
+text,76,56,73.68
+time,39,29,74.36
+timestamp,145,88,60.69
+timestamptz,315,114,36.19
+timetz,45,19,42.22
+truncate,193,41,21.24
+unicode,13,4,30.77
+union,186,62,33.33
+update,288,23,7.99
+uuid,36,29,80.56
+varchar,24,15,62.5
+window,298,61,20.47
+xml,234,18,7.69
diff --git a/yql/essentials/tests/postgresql/status.md b/yql/essentials/tests/postgresql/status.md
new file mode 100644
index 0000000000..0eb522d26b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/status.md
@@ -0,0 +1,61 @@
+==Ð¡Ñ‚Ð°Ñ‚ÑƒÑ Ð¿Ñ€Ð¾Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑионных теÑтов PG в YQL
+
+#|
+||â„– п/п | Ð˜Ð¼Ñ Ñ‚ÐµÑта|ЧиÑло операторов| Из них выполнÑетÑÑ| % Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ | ПоÑледнее обновление | ОÑновные проблемы ||
+|| 1 | boolean | 93 | 87 (+8) | 93.55 | 20.03.2024 | YQL-17569 ||
+|| 2 | char | 25 | 16 | 64.0 | 19.01.2024 | YQL-17571 ||
+|| 3 | name | 40 | 22 | 55.0 | 29.09.2023 | YQL-17598 ||
+|| 4 | varchar | 24 | 15 | 62.5 | 19.01.2024 | YQL-17603 ||
+|| 5 | text | 76 | 56 (+40) | 73.68 | 14.03.2024 | YQL-17605 ||
+|| 6 | int2 | 49 | 47 | 95.92 | 29.09.2023 | YQL-17612 ||
+|| 7 | int4 | 70 | 68 | 97.14 | 18.02.2024 | YQL-17663 ||
+|| 8 | int8 | 142 | 127 | 89.44 | 22.02.2024 | YQL-17614 ||
+|| 9 | oid | 27 | 27 | 100.0 | 22.01.2024 | YQL-17623 ||
+|| 10 | float4 | 96 | 82 | 85.42 | 26.01.2024 | YQL-17586 ||
+|| 11 | float8 | 168 | 144 (+4) | 85.71 | 17.04.2024 | YQL-17628 ||
+|| 12 | bit | 115 | 90 | 78.26 | 18.02.2024 | YQL-17634 ||
+|| 13 | numeric | 915 | 813 | 88.85 | 18.02.2024 | YQL-17629 ||
+|| 14 | uuid | 36 | 29 | 80.56 | 07.03.2024 | YQL-17636 ||
+|| 15 | strings | 390 | 300 (+4) | 76.92 | 14.03.2024 | YQL-17587 ||
+|| 16 | numerology | 24 | 16 | 66.67 | 22.02.2024 | YQL-17926 ||
+|| 17 | date | 264 | 207 | 78.41 | 07.03.2024 | YQL-17733 ||
+|| 18 | time | 39 | 29 | 74.36 | 30.01.2024 | YQL-17738 ||
+|| 19 | timetz | 45 | 19 | 42.22 | 30.01.2024 | YQL-17739 ||
+|| 20 | timestamp | 145 | 88 | 60.69 | 07.03.2024 | YQL-17692 ||
+|| 21 | timestamptz | 315 | 114 (+15) | 36.19 | 17.04.2024 | YQL-17693 ||
+|| 22 | interval | 168 | 118 | 70.24 | 07.03.2024 | YQL-17786 ||
+|| 23 | horology | 306 | 101 (+7) | 33.01 | 17.04.2024 | YQL-17856 ||
+|| 24 | comments | 7 | 7 | 100.0 | 25.05.2023 | ||
+|| 25 | expressions | 63 | 18 | 28.57 | 07.03.2024 | YQL-17784 ||
+|| 26 | unicode | 13 | 4 | 30.77 | 10.08.2023 | ||
+|| 27 | create_table | 368 | 48 | 13.04 | 22.02.2024 | YQL-17664 ||
+|| 28 | insert | 357 | 15 | 4.2 | 12.12.2023 | YQL-17785 ||
+|| 29 | create_misc | 76 | 9 | 11.84 | 07.03.2024 | YQL-17855 ||
+|| 30 | select | 88 | 27 | 30.68 | 07.03.2024 | YQL-17858 ||
+|| 31 | select_into | 67 | 3 | 4.48 | 27.07.2023 | YQL-17787 ||
+|| 32 | select_distinct | 46 | 4 (+3) | 8.7 | 14.03.2024 | YQL-17857 ||
+|| 33 | select_distinct_on | 4 | 1 | 25.0 | 07.03.2024 | YQL-17925 ||
+|| 34 | select_implicit | 44 | 28 | 63.64 | 30.01.2024 | YQL-17737 ||
+|| 35 | select_having | 23 | 19 | 82.61 | 30.01.2024 | YQL-17736 ||
+|| 36 | subselect | 234 | 107 | 45.73 | 07.03.2024 | YQL-17589 ||
+|| 37 | union | 186 | 62 | 33.33 | 07.03.2024 | YQL-17590 ||
+|| 38 | case | 63 | 37 (+2) | 58.73 | 17.04.2024 | YQL-17732 ||
+|| 39 | join | 591 | 205 | 34.69 | 25.03.2024 | YQL-17687 ||
+|| 40 | aggregates | 416 | 129 (+25) | 31.01 | 14.03.2024 | YQL-17627 ||
+|| 41 | arrays | 410 | 148 (+103) | 36.1 | 17.04.2024 | YQL-17707 ||
+|| 42 | update | 288 | 23 | 7.99 | 30.01.2024 | YQL-17685 ||
+|| 43 | delete | 10 | 5 | 50.0 | 27.01.2024 | YQL-17585 ||
+|| 44 | dbsize | 24 | 20 | 83.33 | 18.02.2024 | ||
+|| 45 | window | 298 | 61 | 20.47 | 07.03.2024 | YQL-17592 ||
+|| 46 | functional_deps | 40 | 7 | 17.5 | 19.01.2024 | ||
+|| 47 | json | 450 | 167 (+2) | 37.11 | 17.04.2024 | YQL-17734 ||
+|| 48 | jsonb | 1013 | 529 (+2) | 52.22 | 17.04.2024 | YQL-17735 ||
+|| 49 | json_encoding | 42 | 42 | 100.0 | 29.05.2023 | ||
+|| 50 | jsonpath | 169 | 152 | 89.94 | 29.05.2023 | чиÑла Ñ Ñ‚Ð¾Ñ‡ÐºÐ¾Ð¹ без целой чаÑти, литерал '00' ||
+|| 51 | jsonpath_encoding | 31 | 31 | 100.0 | 29.05.2023 | ||
+|| 52 | jsonb_jsonpath | 427 | 93 (+5) | 21.78 | 17.04.2024 | ||
+|| 53 | limit | 84 | 18 | 21.43 | 07.03.2024 | YQL-17783 ||
+|| 54 | truncate | 193 | 41 | 21.24 | 18.02.2024 | YQL-17740 ||
+|| 55 | alter_table | 1679 | 164 | 9.77 | 30.05.2024 | YQL-17688 ||
+|| 56 | xml | 234 | 18 | 7.69 | 18.02.2024 | YQL-17681 ||
+|#
diff --git a/yql/essentials/tests/postgresql/status.old b/yql/essentials/tests/postgresql/status.old
new file mode 100644
index 0000000000..5d03bac09e
--- /dev/null
+++ b/yql/essentials/tests/postgresql/status.old
@@ -0,0 +1,61 @@
+==Ð¡Ñ‚Ð°Ñ‚ÑƒÑ Ð¿Ñ€Ð¾Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑионных теÑтов PG в YQL
+
+#|
+||â„– п/п | Ð˜Ð¼Ñ Ñ‚ÐµÑта|ЧиÑло операторов| Из них выполнÑетÑÑ| % Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ | ПоÑледнее обновление | ОÑновные проблемы ||
+|| 1 | boolean | 93 | 87 (+8) | 93.55 | 20.03.2024 | YQL-17569 ||
+|| 2 | char | 25 | 16 | 64.0 | 19.01.2024 | YQL-17571 ||
+|| 3 | name | 40 | 22 | 55.0 | 29.09.2023 | YQL-17598 ||
+|| 4 | varchar | 24 | 15 | 62.5 | 19.01.2024 | YQL-17603 ||
+|| 5 | text | 76 | 56 (+40) | 73.68 | 14.03.2024 | YQL-17605 ||
+|| 6 | int2 | 49 | 47 | 95.92 | 29.09.2023 | YQL-17612 ||
+|| 7 | int4 | 70 | 68 | 97.14 | 18.02.2024 | YQL-17663 ||
+|| 8 | int8 | 142 | 127 | 89.44 | 22.02.2024 | YQL-17614 ||
+|| 9 | oid | 27 | 27 | 100.0 | 22.01.2024 | YQL-17623 ||
+|| 10 | float4 | 96 | 82 | 85.42 | 26.01.2024 | YQL-17586 ||
+|| 11 | float8 | 168 | 144 (+4) | 85.71 | 17.04.2024 | YQL-17628 ||
+|| 12 | bit | 115 | 90 | 78.26 | 18.02.2024 | YQL-17634 ||
+|| 13 | numeric | 915 | 813 | 88.85 | 18.02.2024 | YQL-17629 ||
+|| 14 | uuid | 36 | 29 | 80.56 | 07.03.2024 | YQL-17636 ||
+|| 15 | strings | 390 | 300 (+4) | 76.92 | 14.03.2024 | YQL-17587 ||
+|| 16 | numerology | 24 | 16 | 66.67 | 22.02.2024 | YQL-17926 ||
+|| 17 | date | 264 | 207 | 78.41 | 07.03.2024 | YQL-17733 ||
+|| 18 | time | 39 | 29 | 74.36 | 30.01.2024 | YQL-17738 ||
+|| 19 | timetz | 45 | 19 | 42.22 | 30.01.2024 | YQL-17739 ||
+|| 20 | timestamp | 145 | 88 | 60.69 | 07.03.2024 | YQL-17692 ||
+|| 21 | timestamptz | 315 | 114 (+15) | 36.19 | 17.04.2024 | YQL-17693 ||
+|| 22 | interval | 168 | 118 | 70.24 | 07.03.2024 | YQL-17786 ||
+|| 23 | horology | 306 | 101 (+7) | 33.01 | 17.04.2024 | YQL-17856 ||
+|| 24 | comments | 7 | 7 | 100.0 | 25.05.2023 | ||
+|| 25 | expressions | 63 | 18 | 28.57 | 07.03.2024 | YQL-17784 ||
+|| 26 | unicode | 13 | 4 | 30.77 | 10.08.2023 | ||
+|| 27 | create_table | 368 | 48 | 13.04 | 22.02.2024 | YQL-17664 ||
+|| 28 | insert | 357 | 15 | 4.2 | 12.12.2023 | YQL-17785 ||
+|| 29 | create_misc | 76 | 9 | 11.84 | 07.03.2024 | YQL-17855 ||
+|| 30 | select | 88 | 27 | 30.68 | 07.03.2024 | YQL-17858 ||
+|| 31 | select_into | 67 | 3 | 4.48 | 27.07.2023 | YQL-17787 ||
+|| 32 | select_distinct | 46 | 4 (+3) | 8.7 | 14.03.2024 | YQL-17857 ||
+|| 33 | select_distinct_on | 4 | 1 | 25.0 | 07.03.2024 | YQL-17925 ||
+|| 34 | select_implicit | 44 | 28 | 63.64 | 30.01.2024 | YQL-17737 ||
+|| 35 | select_having | 23 | 19 | 82.61 | 30.01.2024 | YQL-17736 ||
+|| 36 | subselect | 234 | 107 | 45.73 | 07.03.2024 | YQL-17589 ||
+|| 37 | union | 186 | 62 | 33.33 | 07.03.2024 | YQL-17590 ||
+|| 38 | case | 63 | 37 (+2) | 58.73 | 17.04.2024 | YQL-17732 ||
+|| 39 | join | 591 | 205 | 34.69 | 25.03.2024 | YQL-17687 ||
+|| 40 | aggregates | 416 | 129 (+25) | 31.01 | 14.03.2024 | YQL-17627 ||
+|| 41 | arrays | 410 | 148 (+103) | 36.1 | 17.04.2024 | YQL-17707 ||
+|| 42 | update | 288 | 23 | 7.99 | 30.01.2024 | YQL-17685 ||
+|| 43 | delete | 10 | 5 | 50.0 | 27.01.2024 | YQL-17585 ||
+|| 44 | dbsize | 24 | 20 | 83.33 | 18.02.2024 | ||
+|| 45 | window | 298 | 61 | 20.47 | 07.03.2024 | YQL-17592 ||
+|| 46 | functional_deps | 40 | 7 | 17.5 | 19.01.2024 | ||
+|| 47 | json | 450 | 167 (+2) | 37.11 | 17.04.2024 | YQL-17734 ||
+|| 48 | jsonb | 1013 | 529 (+2) | 52.22 | 17.04.2024 | YQL-17735 ||
+|| 49 | json_encoding | 42 | 42 | 100.0 | 29.05.2023 | ||
+|| 50 | jsonpath | 169 | 152 | 89.94 | 29.05.2023 | чиÑла Ñ Ñ‚Ð¾Ñ‡ÐºÐ¾Ð¹ без целой чаÑти, литерал '00' ||
+|| 51 | jsonpath_encoding | 31 | 31 | 100.0 | 29.05.2023 | ||
+|| 52 | jsonb_jsonpath | 427 | 93 (+5) | 21.78 | 17.04.2024 | ||
+|| 53 | limit | 84 | 18 | 21.43 | 07.03.2024 | YQL-17783 ||
+|| 54 | truncate | 193 | 41 | 21.24 | 18.02.2024 | YQL-17740 ||
+|| 55 | alter_table | 1679 | 233 | 13.88 | 18.02.2024 | YQL-17688 ||
+|| 56 | xml | 234 | 18 | 7.69 | 18.02.2024 | YQL-17681 ||
+|#
diff --git a/yql/essentials/tests/postgresql/test.sh b/yql/essentials/tests/postgresql/test.sh
new file mode 100755
index 0000000000..27fe140d78
--- /dev/null
+++ b/yql/essentials/tests/postgresql/test.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+ya make -tt $@
diff --git a/yql/essentials/tests/postgresql/test_postgres.py b/yql/essentials/tests/postgresql/test_postgres.py
new file mode 100644
index 0000000000..c33586094d
--- /dev/null
+++ b/yql/essentials/tests/postgresql/test_postgres.py
@@ -0,0 +1,20 @@
+import yatest.common
+from common import find_sql_tests, run_sql_test
+
+DATA_PATH = yatest.common.test_source_path('cases')
+INIT_SCRIPTS_CFG = yatest.common.test_source_path('testinits.cfg')
+INIT_SCRIPTS_DIR = yatest.common.test_source_path('initscripts')
+PGRUN = yatest.common.binary_path('yql/essentials/tools/pgrun/pgrun')
+UDFS = [
+ yatest.common.binary_path('yql/essentials/udfs/common/set/libset_udf.so'),
+ yatest.common.binary_path('yql/essentials/udfs/common/re2/libre2_udf.so'),
+]
+
+
+def pytest_generate_tests(metafunc):
+ ids, tests = zip(*find_sql_tests(DATA_PATH))
+ metafunc.parametrize(['sql', 'out'], tests, ids=ids)
+
+
+def test(sql, out, tmp_path):
+ run_sql_test(sql, out, tmp_path, PGRUN, UDFS, INIT_SCRIPTS_CFG, INIT_SCRIPTS_DIR)
diff --git a/yql/essentials/tests/postgresql/test_postgres_original.py b/yql/essentials/tests/postgresql/test_postgres_original.py
new file mode 100644
index 0000000000..d698975ba8
--- /dev/null
+++ b/yql/essentials/tests/postgresql/test_postgres_original.py
@@ -0,0 +1,20 @@
+import yatest.common
+from common import find_sql_tests, run_sql_test
+
+DATA_PATH = yatest.common.test_source_path('original/cases')
+INIT_SCRIPTS_CFG = yatest.common.test_source_path('testinits.cfg')
+INIT_SCRIPTS_DIR = yatest.common.test_source_path('initscripts')
+PGRUN = yatest.common.binary_path('yql/essentials/tools/pgrun/pgrun')
+UDFS = [
+ yatest.common.binary_path('yql/essentials/udfs/common/set/libset_udf.so'),
+ yatest.common.binary_path('yql/essentials/udfs/common/re2/libre2_udf.so'),
+]
+
+
+def pytest_generate_tests(metafunc):
+ ids, tests = zip(*find_sql_tests(DATA_PATH))
+ metafunc.parametrize(['sql', 'out'], tests, ids=ids)
+
+
+def test(sql, out, tmp_path):
+ run_sql_test(sql, out, tmp_path, PGRUN, UDFS, INIT_SCRIPTS_CFG, INIT_SCRIPTS_DIR)
diff --git a/yql/essentials/tests/postgresql/testinits.cfg b/yql/essentials/tests/postgresql/testinits.cfg
new file mode 100644
index 0000000000..3b047ecf80
--- /dev/null
+++ b/yql/essentials/tests/postgresql/testinits.cfg
@@ -0,0 +1,20 @@
+strings: char_tbl varchar_tbl text_tbl
+numerology: int2_tbl int4_tbl float8_tbl
+horology: time_tbl timetz_tbl timestamp_tbl timestamptz_tbl interval_tbl
+expressions: date_tbl
+create_misc: hobbies_r_0 equipment_r_0 onek_0 tenk1 tenk2_0 person_0 city_0 slow_emp4000_0 fast_emp4000_0 road_0 ihighway_0 shighway_0 a_star_0 b_star_0 c_star_0 d_star_0 e_star_0 f_star_0
+select: int8_tbl onek person emp student stud_emp onek2
+select_into: int8_tbl onek onek2
+select_distinct: tenk1 person emp student stud_emp tmp
+select_distinct_on: int4_tbl tmp
+subselect: text_tbl int4_tbl int8_tbl onek tenk1 road
+union: char_tbl varchar_tbl text_tbl int4_tbl int8_tbl float8_tbl tenk1
+join: text_tbl int2_tbl int4_tbl int8_tbl float8_tbl onek tenk1 tenk2
+aggregates: varchar_tbl int4_tbl int8_tbl onek tenk1 student aggtest
+arrays: int8_tbl tenk1 array_op_test
+window: int4_tbl tenk1 tenk2
+jsonb: testjsonb
+limit: int8_tbl onek tenk1
+alter_table: onek tenk1 stud_emp
+xml: emp
+
diff --git a/yql/essentials/tests/postgresql/update-status.sh b/yql/essentials/tests/postgresql/update-status.sh
new file mode 100755
index 0000000000..992808604b
--- /dev/null
+++ b/yql/essentials/tests/postgresql/update-status.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+../../tools/pg-make-test/update-test-status/update-test-status pg_tests.csv status.md
diff --git a/yql/essentials/tests/postgresql/ya.make b/yql/essentials/tests/postgresql/ya.make
new file mode 100644
index 0000000000..696bce0247
--- /dev/null
+++ b/yql/essentials/tests/postgresql/ya.make
@@ -0,0 +1,49 @@
+IF (NOT OPENSOURCE)
+
+PY3TEST()
+
+IF(ORIGINAL)
+
+TEST_SRCS(
+# test_postgres_original.py
+)
+
+DATA(
+ arcadia/yql/essentials/tests/postgresql/original/cases
+)
+
+ELSE()
+
+TEST_SRCS(
+# test_postgres.py
+)
+
+DATA(
+ arcadia/yql/essentials/tests/postgresql/cases
+)
+
+ENDIF()
+
+DATA(
+ arcadia/yql/essentials/tests/postgresql/patches
+)
+
+SIZE(MEDIUM)
+TIMEOUT(600)
+
+FORK_TESTS()
+FORK_SUBTESTS()
+SPLIT_FACTOR(10)
+
+DEPENDS(
+ yql/essentials/tests/postgresql/common
+ yql/essentials/tools/pgrun
+ yql/essentials/tools/pg-make-test
+ yql/essentials/udfs/common/set
+ yql/essentials/udfs/common/re2
+)
+
+END()
+
+ENDIF()
+
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggrAdd.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrAdd.yql
new file mode 100644
index 0000000000..ae95d15a68
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrAdd.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let x (Int32 '34))
+(let y (Int32 '56))
+(let jx (Just x))
+(let jy (Just y))
+(let n (Nothing (TypeOf jx)))
+
+(let world (Write! world res_sink (Key) (AggrAdd x y) '('('type))))
+(let world (Write! world res_sink (Key) (AggrAdd jx jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrAdd jx n) '('('type))))
+(let world (Write! world res_sink (Key) (AggrAdd n jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrAdd n n) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggrCount.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrCount.yql
new file mode 100644
index 0000000000..f0a27ab8d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrCount.yql
@@ -0,0 +1,33 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let x (Int32 '34))
+(let jx (Just x))
+(let n (Nothing (TypeOf jx)))
+
+(let world (Write! world res_sink (Key) (AggrCountInit x) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountInit jx) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountInit n) '('('type))))
+
+(let world (Write! world res_sink (Key) (AggrCountUpdate x (Uint64 '10)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountUpdate jx (Uint64 '10)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountUpdate n (Uint64 '10)) '('('type))))
+
+(let cx (Callable (ParseType '"()->Int32") (lambda '() x)))
+(let cjx (Callable (ParseType '"()->Int32?") (lambda '() jx)))
+(let cn (Callable (ParseType '"()->Int32?") (lambda '() n)))
+
+(let world (Write! world res_sink (Key) (AggrCountInit (Apply cx)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountInit (Apply cjx)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountInit (Apply cn)) '('('type))))
+
+(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cx) (Uint64 '10)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cjx) (Uint64 '10)) '('('type))))
+(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cn) (Uint64 '10)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggrMinMax.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrMinMax.yql
new file mode 100644
index 0000000000..ab948dc649
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggrMinMax.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let x (Int32 '34))
+(let y (Int32 '56))
+(let jx (Just x))
+(let jy (Just y))
+(let n (Nothing (TypeOf jx)))
+
+(let world (Write! world res_sink (Key) (AggrMin x y) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMin jx jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMin jx n) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMin n jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMin n n) '('('type))))
+
+(let world (Write! world res_sink (Key) (AggrMax x y) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMax jx jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMax jx n) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMax n jy) '('('type))))
+(let world (Write! world res_sink (Key) (AggrMax n n) '('('type))))
+
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFields.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFields.yql
new file mode 100644
index 0000000000..e9565555ef
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFields.yql
@@ -0,0 +1,44 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (block '(
+ (let Count0_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count0_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count0_save (lambda '(state) state))
+ (let Count0_load (lambda '(item) item))
+ (let Count0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count0_finish (lambda '(state) state))
+ (return (Aggregate core '('"key" '"subkey") '('('Count0 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value") Count0_create Count0_update Count0_save Count0_load Count0_merge Count0_finish (Uint64 '0)) '"value"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"column2" (Member row 'Count0)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row '"key") (Member row '"subkey")))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"subkey" '"column2")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFieldsUsingTuple.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFieldsUsingTuple.yql
new file mode 100644
index 0000000000..502366d6d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroubByTwoFieldsUsingTuple.yql
@@ -0,0 +1,52 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let table1 (FlatMap table1 (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" '((Member row '"key") (Member row '"key"))))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"value" (Member row 'value)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let output (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (block '(
+ (let Count0_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count0_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count0_save (lambda '(state) state))
+ (let Count0_load (lambda '(item) item))
+ (let Count0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count0_finish (lambda '(state) state))
+ (return (Aggregate core '('"key" '"subkey") '('('Count0 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value") Count0_create Count0_update Count0_save Count0_load Count0_merge Count0_finish (Uint64 '0)) '"value"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"column2" (Member row 'Count0)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select '((Bool 'true) (Bool 'true) (Bool 'true)) (lambda '(row) '((Nth (Member row '"key") '0) (Nth (Member row '"key") '1) (Member row '"subkey")))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"subkey" '"column2")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroupByOneField.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroupByOneField.yql
new file mode 100644
index 0000000000..b309a99b1c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateGroupByOneField.yql
@@ -0,0 +1,50 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table2)
+ (let core (block '(
+ (let Sum0_create (lambda '(row) ("Coalesce" (Cast (Member row '"subkey") 'Uint64) (Int64 '"0"))))
+ (let Sum0_update (lambda '(row state) (OptionalReduce state ("Coalesce" (Cast (Member row '"subkey") 'Uint64) (Int64 '"0")) (lambda '(a b) (+ a b)))))
+ (let Sum0_save (lambda '(state) state))
+ (let Sum0_load (lambda '(item) item))
+ (let Sum0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Sum0_finish (lambda '(state) state))
+ (let Count1_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count1_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count1_save (lambda '(state) state))
+ (let Count1_load (lambda '(item) item))
+ (let Count1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count1_finish (lambda '(state) state))
+ (return (Aggregate core '('"key") '('('Sum0 (AggregationTraits (ListItemType (TypeOf core)) Sum0_create Sum0_update Sum0_save Sum0_load Sum0_merge Sum0_finish (Null))) '('Count1 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value") Count1_create Count1_update Count1_save Count1_load Count1_merge Count1_finish (Uint64 '0)) '"value"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"column1" (Member row 'Sum0)))
+ (let res (AddMember res '"column2" (Member row 'Count1)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"column1" '"column2")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateOptState.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateOptState.yql
new file mode 100644
index 0000000000..bb96925785
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateOptState.yql
@@ -0,0 +1,38 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"value" '"key" '"subkey") '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table2)
+ (let core (block '(
+ (let Sum1_create (lambda '(row) (FromString (Member row '"subkey") '"Int64")))
+ (let Sum1_update (lambda '(row state) (OptionalReduce state (FromString (Member row '"subkey") '"Int64") (lambda '(a b) (+ a b)))))
+ (let Sum1_save (lambda '(state) state))
+ (let Sum1_load (lambda '(item) item))
+ (let Sum1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Sum1_finish (lambda '(state) state))
+ (return (Aggregate core '('"value") '('('"Sum1" (AggregationTraits (ListItemType (TypeOf core)) Sum1_create Sum1_update Sum1_save Sum1_load Sum1_merge Sum1_finish (Null))))))
+)
+))
+ (return core)
+)
+))
+ (return select)
+)
+))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let sortedOutput (Sort output (Bool 'false) (lambda '(x) (Member x 'value) )))
+ (let world (Write! world result_sink (Key) sortedOutput '('('type) '('autoref))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
+))
+ (return world)
+)
+))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateRead.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateRead.yql
new file mode 100644
index 0000000000..70d8879fc0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateRead.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let init (lambda '(x) (StrictFromString (Member x 'value) 'Uint32)))
+(let update_min (lambda '(x y) (Min (StrictFromString (Member x 'value) 'Uint32) y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_min (lambda '(x y) (Min x y)))
+(let finish (lambda '(x) x))
+(let min (AggregationTraits (ListItemType (TypeOf table1)) init update_min save load merge_min finish (Null)))
+(let resAll (Aggregate table1 '() '('('minvalue min))))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate table1 '('key) '('('minvalue min))))
+(let sortedOutput (Sort resKey (Bool 'false) (lambda '(x) (Member x 'key) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinct.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinct.yql
new file mode 100644
index 0000000000..94034d32af
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinct.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let init (lambda '(x) (StrictFromString (Member x 'value) 'Uint32)))
+(let init_distinct (lambda '(x) (StrictFromString x 'Uint32)))
+(let update_sum_distinct (lambda '(x y) (+ (StrictFromString x 'Uint32) y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_sum (lambda '(x y) (+ x y)))
+(let finish (lambda '(x) x))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf table1)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate table1 '() '('('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate table1 '('key) '('('distsum sum 'value))))
+(let sortedOutput (Sort resKey (Bool 'false) (lambda '(x) (Member x 'key) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctUsingTuple.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctUsingTuple.yql
new file mode 100644
index 0000000000..d4f0adca76
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctUsingTuple.yql
@@ -0,0 +1,36 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (FlatMap table1 (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" '((Member row '"key") (Member row '"key"))))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"value" (Member row 'value)))
+ (let res (AsList res))
+ (return res)
+)))))
+
+(let init (lambda '(x) (StrictFromString (Member x 'value) 'Uint32)))
+(let init_distinct (lambda '(x) (StrictFromString x 'Uint32)))
+(let update_sum_distinct (lambda '(x y) (+ (StrictFromString x 'Uint32) y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_sum (lambda '(x y) (+ x y)))
+(let finish (lambda '(x) x))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf table1)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate table1 '() '('('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate table1 '('key) '('('distsum sum 'value))))
+(let sortedOutput (Sort resKey '((Bool 'false) (Bool 'false)) (lambda '(x) (Member x 'key) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let resKey (Aggregate table1 '('key 'subkey) '('('distsum sum 'value))))
+(let sortedOutput (Sort resKey '((Bool 'false) (Bool 'false) (Bool 'false)) (lambda '(x) '((Nth (Member x 'key) '0) (Nth (Member x 'key) '1) (Member x 'subkey)) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctWithParents.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctWithParents.yql
new file mode 100644
index 0000000000..27c4faf647
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadDistinctWithParents.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let init (lambda '(x parent) '(parent (StrictFromString (Member x 'value) 'Uint32))))
+(let init_distinct (lambda '(x parent) '(parent (StrictFromString x 'Uint32))))
+(let update_sum_distinct (lambda '(x y parent) '(parent (+ (StrictFromString x 'Uint32) (Nth y '1)))))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_sum (lambda '(x y) '((Nth x '0) (AggrAdd (Nth x '1) (Nth y '1)))))
+(let finish (lambda '(x) (Nth x '1)))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf table1)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate table1 '() '('('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate table1 '('key) '('('distsum sum 'value))))
+(let sortedOutput (Sort resKey (Bool 'false) (lambda '(x) (Member x 'key) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadWithParents.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadWithParents.yql
new file mode 100644
index 0000000000..b0b2f6a084
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateReadWithParents.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let init (lambda '(x parent) '(parent (StrictFromString (Member x 'value) 'Uint32))))
+(let update_min (lambda '(x y parent) '(parent (AggrMin (StrictFromString (Member x 'value) 'Uint32) (Nth y '1)))))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_min (lambda '(x y) (AggrMin x y)))
+(let finish (lambda '(x) (Nth x '1)))
+(let min (AggregationTraits (ListItemType (TypeOf table1)) init update_min save load merge_min finish (Null)))
+(let resAll (Aggregate table1 '() '('('minvalue min))))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate table1 '('key) '('('minvalue min))))
+(let sortedOutput (Sort resKey (Bool 'false) (lambda '(x) (Member x 'key) )))
+(let world (Write! world res_sink (Key) sortedOutput '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateSameDistinct.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateSameDistinct.yql
new file mode 100644
index 0000000000..9f4fb01757
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateSameDistinct.yql
@@ -0,0 +1,107 @@
+(
+(let $1 world)
+(let $2 (DataSource '"yt" '"plato"))
+(let $3 (String '"Input"))
+(let $4 '('table $3))
+(let $5 (Key $4))
+(let $6 '('"key"))
+(let $7 '())
+(let $8 (Read! $1 $2 $5 $6 $7))
+(let $9 (Left! $8))
+(let $10 (DataSink 'result))
+(let $11 (Key))
+(let $12 (Right! $8))
+(let $13 '())
+(let $14 (TypeOf $12))
+(let $15 (ListItemType $14))
+(let $16 (StructMemberType $15 '"key"))
+(let $17 (lambda '($49) (block '(
+ (let $51 (Exists $49))
+ (let $52 (Convert $51 'Uint64))
+ (return $52)
+))))
+(let $18 (lambda '($53 $54) (block '(
+ (let $56 (Exists $53))
+ (let $57 (Convert $56 'Uint64))
+ (let $58 (lambda '($60 $61) (block '(
+ (let $63 (+ $60 $61))
+ (return $63)
+ ))))
+ (let $59 (OptionalReduce $54 $57 $58))
+ (return $59)
+))))
+(let $19 (lambda '($64) (block '(
+ (return $64)
+))))
+(let $20 (lambda '($66) (block '(
+ (return $66)
+))))
+(let $21 (lambda '($68 $69) (block '(
+ (let $71 (lambda '($73 $74) (block '(
+ (let $76 (+ $73 $74))
+ (return $76)
+ ))))
+ (let $72 (OptionalReduce $68 $69 $71))
+ (return $72)
+))))
+(let $22 (lambda '($77) (block '(
+ (return $77)
+))))
+(let $23 (AggregationTraits $16 $17 $18 $19 $20 $21 $22 (Null)))
+(let $24 '('Count0 $23 '"key"))
+(let $25 (TypeOf $12))
+(let $26 (ListItemType $25))
+(let $27 (StructMemberType $26 '"key"))
+(let $28 (lambda '($79) (block '(
+ (return $79)
+))))
+(let $29 (lambda '($81 $82) (block '(
+ (let $84 (lambda '($86 $87) (block '(
+ (let $89 (Min $86 $87))
+ (return $89)
+ ))))
+ (let $85 (OptionalReduce $82 $81 $84))
+ (return $85)
+))))
+(let $30 (lambda '($90) (block '(
+ (return $90)
+))))
+(let $31 (lambda '($92) (block '(
+ (return $92)
+))))
+(let $32 (lambda '($94 $95) (block '(
+ (let $97 (lambda '($99 $100) (block '(
+ (let $102 (Min $99 $100))
+ (return $102)
+ ))))
+ (let $98 (OptionalReduce $94 $95 $97))
+ (return $98)
+))))
+(let $33 (lambda '($103) (block '(
+ (return $103)
+))))
+(let $34 (AggregationTraits $27 $28 $29 $30 $31 $32 $33 (Null)))
+(let $35 '('Min1 $34 '"key"))
+(let $36 '($24 $35))
+(let $37 (Aggregate $12 $13 $36))
+(let $38 (lambda '($105) (block '(
+ (let $107 (Struct))
+ (let $108 (Member $105 'Count0))
+ (let $109 (AddMember $107 '"column0" $108))
+ (let $110 (Member $105 'Min1))
+ (let $111 (AddMember $109 '"column1" $110))
+ (let $112 (AsList $111))
+ (return $112)
+))))
+(let $39 (FlatMap $37 $38))
+(let $40 '('type))
+(let $41 '('autoref))
+(let $42 '('"column0" '"column1"))
+(let $43 '('columns $42))
+(let $44 '($40 $41 $43))
+(let $45 (Write! $9 $10 $11 $39 $44))
+(let $46 (Commit! $45 $10))
+(let $47 (DataSink '"yt" '"plato"))
+(let $48 (Commit! $46 $47))
+(return $48)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutGroup.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutGroup.yql
new file mode 100644
index 0000000000..472d0234d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutGroup.yql
@@ -0,0 +1,55 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table3 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table3)
+ (let core (block '(
+ (let Sum0_create (lambda '(row) ("Coalesce" (Cast (Member row '"key") 'Uint64) (Int64 '"0"))))
+ (let Sum0_update (lambda '(row state) (OptionalReduce state ("Coalesce" (Cast (Member row '"key") 'Uint64) (Int64 '"0")) (lambda '(a b) (+ a b)))))
+ (let Sum0_save (lambda '(state) state))
+ (let Sum0_load (lambda '(item) item))
+ (let Sum0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Sum0_finish (lambda '(state) state))
+ (let Count1_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count1_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count1_save (lambda '(state) state))
+ (let Count1_load (lambda '(item) item))
+ (let Count1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count1_finish (lambda '(state) state))
+ (let Count2_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count2_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count2_save (lambda '(state) state))
+ (let Count2_load (lambda '(item) item))
+ (let Count2_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count2_finish (lambda '(state) state))
+ (return (Aggregate core '() '('('Sum0 (AggregationTraits (ListItemType (TypeOf core)) Sum0_create Sum0_update Sum0_save Sum0_load Sum0_merge Sum0_finish (Null))) '('Count1 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"subkey") Count1_create Count1_update Count1_save Count1_load Count1_merge Count1_finish (Uint64 '0)) '"subkey") '('Count2 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value") Count2_create Count2_update Count2_save Count2_load Count2_merge Count2_finish (Uint64 '0)) '"value"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" (Member row 'Sum0)))
+ (let res (AddMember res '"column1" (Member row 'Count1)))
+ (let res (AddMember res '"column2" (Member row 'Count2)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0" '"column1" '"column2")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutTraits.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutTraits.yql
new file mode 100644
index 0000000000..59dd4cabc3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateWithoutTraits.yql
@@ -0,0 +1,37 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core input)
+ (let core (block '(
+ (return (Aggregate core '('key 'value) '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row 'key)))
+ (let res (AddMember res '"value" (Member row 'value)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let core (Sort core '((Bool 'true) (Bool 'true)) (lambda '(x) '((Member x 'key) (Member x 'value)) )))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Bug1.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug1.yql
new file mode 100644
index 0000000000..0a2a83b345
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug1.yql
@@ -0,0 +1,69 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"value1" (MatchType (Member row '"value") 'Optional (lambda '(item) (Coalesce (Map item (lambda '(val) (IfType val (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Just (Convert item '"Int64")))))) (Nothing (OptionalType (DataType '"Int64"))))) (lambda '(item) (IfType item (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Convert item '"Int64")))))))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return core)
+)
+))
+ (return select)
+)
+))
+ (let core (block '(
+ (let Max1_create (lambda '(row) (Member row '"value1")))
+ (let Max1_update (lambda '(row state) (OptionalReduce state (Member row '"value1") (lambda '(a b) (Max a b)))))
+ (let Max1_save (lambda '(state) state))
+ (let Max1_load (lambda '(item) item))
+ (let Max1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (Max a b)))))
+ (let Max1_finish (lambda '(state) state))
+ (let Count2_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count2_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count2_save (lambda '(state) state))
+ (let Count2_load (lambda '(item) item))
+ (let Count2_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count2_finish (lambda '(state) state))
+ (return (Aggregate core '('"key") '('('Max1 (AggregationTraits (ListItemType (TypeOf core)) Max1_create Max1_update Max1_save Max1_load Max1_merge Max1_finish (Null))) '('Count2 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value1") Count2_create Count2_update Count2_save Count2_load Count2_merge Count2_finish (Uint64 '0)) '"value1"))))
+)
+))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" (Member row 'Max1)))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"column2" (Member row 'Count2)))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return core)
+)
+))
+ (return select)
+)
+))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let sortedOutput (Sort output (Bool 'false) (lambda '(x) (Member x 'key) )))
+ (let world (Write! world result_sink (Key) sortedOutput '('('type) '('autoref) '('columns '('"column0" '"key" '"column2")))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
+))
+ (return world)
+)
+))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Bug2.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug2.yql
new file mode 100644
index 0000000000..1558d5a3a9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug2.yql
@@ -0,0 +1,53 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table2)
+ (let core (block '(
+ (let Max0_create (lambda '(row) (Member row '"value")))
+ (let Max0_update (lambda '(row state) (OptionalReduce state (Member row '"value") (lambda '(a b) (Max a b)))))
+ (let Max0_save (lambda '(state) state))
+ (let Max0_load (lambda '(item) item))
+ (let Max0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (Max a b)))))
+ (let Max0_finish (lambda '(state) state))
+ (let Count1_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count1_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count1_save (lambda '(state) state))
+ (let Count1_load (lambda '(item) item))
+ (let Count1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count1_finish (lambda '(state) state))
+ (return (Aggregate core '('"key") '('('Max0 (AggregationTraits (ListItemType (TypeOf core)) Max0_create Max0_update Max0_save Max0_load Max0_merge Max0_finish (Null))) '('Count1 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"value") Count1_create Count1_update Count1_save Count1_load Count1_merge Count1_finish (Uint64 '0)) '"value"))))
+)
+))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" (Member row 'Max0)))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"column2" (Member row 'Count1)))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return core)
+)
+))
+ (return select)
+)
+))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let sortedOutput (Sort output (Bool 'false) (lambda '(x) (Member x 'key) )))
+ (let world (Write! world result_sink (Key) sortedOutput '('('type) '('autoref) '('columns '('"column0" '"key" '"column2")))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
+))
+ (return world)
+)
+))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.cfg
new file mode 100644
index 0000000000..2c8f4d3baa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.cfg
@@ -0,0 +1,3 @@
+in Input input3.txt
+res result.txt
+udf datetime2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.yql
new file mode 100644
index 0000000000..61e56c5a0f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Bug3.yql
@@ -0,0 +1,40 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (Configure! world (DataSource '"config") 'SQL '0))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (Aggregate core '() '('('Avg0 (Apply (bind aggregate_module '"avg_traits_factory") (TypeOf core) (lambda '(row) (PersistableRepr (Apply (lambda '("$UniqID") (block '(
+ (let $string_uniqid (Coalesce (SafeCast "$UniqID" (DataType 'String)) (String '"")))
+ (let $time (Substring "$string_uniqid" ("-" (Size "$string_uniqid") (SafeCast (Int32 '"10") (DataType 'Uint32))) (Int32 '"10")))
+ (return ("-" (SafeCast (SqlCall '"DateTime2.ToSeconds" '((PositionalArgs (SafeCast (String '"2017-06-29") (DataType 'Date))))) (DataType 'Int64)) (SafeCast (SqlCall '"DateTime2.FromSeconds" '((PositionalArgs (SafeCast "$time" (DataType 'Uint32))))) (DataType 'Int64))))
+ ))) (Member row '"key"))))))) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"avg_timediff" (Cast (/ (Member row 'Avg0) (Uint64 '1000000000000)) 'Int32))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"avg_timediff")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.cfg
new file mode 100644
index 0000000000..c8889a670f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.yql
new file mode 100644
index 0000000000..312c757886
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/EmptyOptional.yql
@@ -0,0 +1,58 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"value" (Cast (Member row '"value") 'Double)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (let Sum1_create (lambda '(row) (Member row '"value")))
+ (let Sum1_update (lambda '(row state) (OptionalReduce state (Member row '"value") (lambda '(a b) (+ a b)))))
+ (let Sum1_save (lambda '(state) state))
+ (let Sum1_load (lambda '(item) item))
+ (let Sum1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Sum1_finish (lambda '(state) state))
+ (return (Aggregate core '('"key") '('('Sum1 (AggregationTraits (ListItemType (TypeOf core)) Sum1_create Sum1_update Sum1_save Sum1_load Sum1_merge Sum1_finish (Null))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (String '"")))
+ (let res (AddMember res '"value" (Member row 'Sum1)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"subkey" '"value")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregate.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregate.yql
new file mode 100644
index 0000000000..b25953f460
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregate.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init (lambda '(x) (Member x 'value)))
+(let init_distinct (lambda '(x) x))
+(let update_min (lambda '(x y) (Min (Member x 'value) y)))
+(let update_sum_distinct (lambda '(x y) (+ x y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_min (lambda '(x y) (Min x y)))
+(let merge_sum (lambda '(x y) (+ x y)))
+(let finish (lambda '(x) x))
+(let finish_min2 (lambda '(x) '(x (* (Uint32 '2) x))))
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+# non-distinct processes row
+(let min (AggregationTraits (ListItemType (TypeOf list)) init update_min save load merge_min finish_min2 (Null)))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf list)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate list '() '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate list '('key) '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateUsingTuple.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateUsingTuple.yql
new file mode 100644
index 0000000000..d3c8358342
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateUsingTuple.yql
@@ -0,0 +1,40 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init (lambda '(x) (Member x 'value)))
+(let init_distinct (lambda '(x) x))
+(let update_min (lambda '(x y) (Min (Member x 'value) y)))
+(let update_sum_distinct (lambda '(x y) (+ x y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_min (lambda '(x y) (Min x y)))
+(let merge_sum (lambda '(x y) (+ x y)))
+(let finish (lambda '(x) x))
+(let finish_min2 (lambda '(x) '(x (* (Uint32 '2) x))))
+(let list (AsList
+(AsStruct '('key '((Uint32 '1) (Uint32 '1))) '('subkey (String '.)) '('value (Uint32 '2)))
+(AsStruct '('key '((Uint32 '2) (Uint32 '2))) '('subkey (String '.)) '('value (Uint32 '3)))
+(AsStruct '('key '((Uint32 '1) (Uint32 '1))) '('subkey (String '.)) '('value (Uint32 '4)))
+(AsStruct '('key '((Uint32 '3) (Uint32 '3))) '('subkey (String '.)) '('value (Uint32 '10)))
+(AsStruct '('key '((Uint32 '2) (Uint32 '2))) '('subkey (String '.)) '('value (Uint32 '5)))
+(AsStruct '('key '((Uint32 '2) (Uint32 '2))) '('subkey (String '.)) '('value (Uint32 '5)))
+))
+# non-distinct processes row
+(let min (AggregationTraits (ListItemType (TypeOf list)) init update_min save load merge_min finish_min2 (Null)))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf list)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate list '() '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate list '('key) '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let keyExtractor (lambda '(x) '((Nth (Member x 'key) '0) (Nth (Member x 'key) '1))))
+(let resSort (ListSort resKey '((Bool 'true) (Bool 'false)) keyExtractor))
+(let world (Write! world res_sink (Key) resSort '('('type))))
+(let world (Commit! world res_sink))
+(let resKey (Aggregate list '('key 'subkey) '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateWithParents.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateWithParents.yql
new file mode 100644
index 0000000000..4357fcf5c7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateWithParents.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init (lambda '(x parent) '(parent (Member x 'value))))
+(let init_distinct (lambda '(x parent) '(parent x)))
+(let update_min (lambda '(x y parent) '(parent (Min (Member x 'value) (Nth y '1)))))
+(let update_sum_distinct (lambda '(x y parent) '(parent (Add x (Nth y '1)))))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge_min (lambda '(x y) (AggrMin x y)))
+(let merge_sum (lambda '(x y) '((Nth x '0) (AggrAdd (Nth y '1) (Nth x '1)))))
+(let finish (lambda '(x) (Nth x '1)))
+(let finish_min2 (lambda '(x) '((Nth x '1) (* (Uint32 '2) (Nth x '1)))))
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+# non-distinct processes row
+(let min (AggregationTraits (ListItemType (TypeOf list)) init update_min save load merge_min finish_min2 (Null)))
+# distinct process one column and requires data/data? type
+(let sum (AggregationTraits (StructMemberType (ListItemType (TypeOf list)) 'value) init_distinct update_sum_distinct save load merge_sum finish (Null)))
+(let resAll (Aggregate list '() '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let resKey (Aggregate list '('key) '('('('minvalue 'minvalue2) min) '('distsum sum 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZero.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZero.yql
new file mode 100644
index 0000000000..73069b7061
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZero.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init_min (lambda '(x) (Member x 'value)))
+(let init_count (lambda '(x) (Uint64 '1)))
+(let update_min (lambda '(x y) (Min (Member x 'value) y)))
+(let update_count (lambda '(x y) (+ y (Uint64 '1))))
+(let id (lambda '(x) x))
+(let merge_min (lambda '(x y) (Min x y)))
+(let merge_count (lambda '(x y) (+ x y)))
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+))
+(let list (Take list (Uint64 '0)))
+(let min (AggregationTraits (ListItemType (TypeOf list)) init_min update_min id id merge_min id (Null)))
+(let count (AggregationTraits (ListItemType (TypeOf list)) init_count update_count id id merge_count id (Uint64 '0)))
+(let resAll (Aggregate list '() '('('minvalue min) '('count count))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZeroOpt.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZeroOpt.yql
new file mode 100644
index 0000000000..857859cc2c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/InMemAggregateZeroOpt.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init_min (lambda '(x) (Member x 'value)))
+(let init_count (lambda '(x) (Uint64 '1)))
+(let update_min (lambda '(x y) (Min (Member x 'value) y)))
+(let update_count (lambda '(x y) (+ y (Uint64 '1))))
+(let id (lambda '(x) x))
+(let merge_min (lambda '(x y) (Min x y)))
+(let merge_count (lambda '(x y) (+ x y)))
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+))
+(let list (Take list (Uint64 '0)))
+(let min (AggregationTraits (ListItemType (TypeOf list)) init_min update_min id id merge_min id (Null)))
+(let count (AggregationTraits (ListItemType (TypeOf list)) init_count update_count id id merge_count id (Uint64 '0)))
+(let resAll (Aggregate list '() '('('minvalue min) '('count count))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) resAll '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.cfg
new file mode 100644
index 0000000000..e341fb79d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.cfg
@@ -0,0 +1,7 @@
+in Input many_columns.txt
+out Output output.txt
+out Output1 output1.txt
+out Output2 output2.txt
+res result.txt
+mount ..\mounts.txt
+udf datetime2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.yql
new file mode 100644
index 0000000000..f18d8573a4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_4.yql
@@ -0,0 +1,168 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (Configure! world (DataSource '"config") 'SQL '0))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"assignment_gs_count" '"assignment_assignment_id" '"assignment_last_status_change_time" '"requester_id" '"project_id" '"assignment_gs_weight") '()))
+ (let world (Left! x))
+ (let table5 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core table5)
+ (let core (Filter core (lambda '(row) (Coalesce (">" (Member row '"assignment_gs_count") (Int64 '"0")) (Bool 'false)))))
+ (let core (block '(
+ (return (Aggregate core '('"assignment_assignment_id") '('('Some0 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_last_status_change_time")))) '('Some1 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"requester_id")))) '('Some2 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"project_id")))) '('Some3 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_gs_count")))) '('Some4 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"assignment_id" (Member row '"assignment_assignment_id")))
+ (let res (AddMember res '"date" (SafeCast ("Apply" ("Udf" '"DateTime2.FromSeconds") (Cast (Member row 'Some0) 'Uint32)) (DataType 'Date))))
+ (let res (AddMember res '"requester_id" (Member row 'Some1)))
+ (let res (AddMember res '"project_id" (Member row 'Some2)))
+ (let res (AddMember res '"gs_count" (Member row 'Some3)))
+ (let res (AddMember res '"gs_weight" (Cast (Member row 'Some4) 'Double)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '()))
+ (let world (Left! x))
+ (let table7 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table7)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"project_id" '"requester_id") '('('Sum8 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum9 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"project_id" (Member row '"project_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum8)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum9)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output1"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '()))
+ (let world (Left! x))
+ (let table7 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table7)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"project_id" '"requester_id") '('('Sum8 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum9 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"project_id" (Member row '"project_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum8)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum9)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"requester_id") '('('Sum11 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum12 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum11)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum12)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output2"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.cfg
new file mode 100644
index 0000000000..f01a3e0180
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.cfg
@@ -0,0 +1,8 @@
+in Input many_columns.txt
+out Output output.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+res result.txt
+mount ..\mounts.txt
+udf datetime2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.yql
new file mode 100644
index 0000000000..18d89027da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Level_5.yql
@@ -0,0 +1,254 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (Configure! world (DataSource '"config") 'SQL '0))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"assignment_gs_count" '"assignment_assignment_id" '"assignment_last_status_change_time" '"requester_id" '"project_id" '"assignment_gs_weight") '()))
+ (let world (Left! x))
+ (let table5 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core table5)
+ (let core (Filter core (lambda '(row) (Coalesce (">" (Member row '"assignment_gs_count") (Int64 '"0")) (Bool 'false)))))
+ (let core (block '(
+ (return (Aggregate core '('"assignment_assignment_id") '('('Some0 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_last_status_change_time")))) '('Some1 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"requester_id")))) '('Some2 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"project_id")))) '('Some3 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_gs_count")))) '('Some4 (Apply (bind aggregate_module '"some_traits_factory") (TypeOf core) (lambda '(row) (Member row '"assignment_gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"assignment_id" (Member row '"assignment_assignment_id")))
+ (let res (AddMember res '"date" (SafeCast ("Apply" ("Udf" '"DateTime2.FromSeconds") (Cast (Member row 'Some0) 'Uint32)) (DataType 'Date))))
+ (let res (AddMember res '"requester_id" (Member row 'Some1)))
+ (let res (AddMember res '"project_id" (Member row 'Some2)))
+ (let res (AddMember res '"gs_count" (Member row 'Some3)))
+ (let res (AddMember res '"gs_weight" (Cast (Member row 'Some4) 'Double)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '()))
+ (let world (Left! x))
+ (let table7 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table7)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"project_id" '"requester_id") '('('Sum8 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum9 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"project_id" (Member row '"project_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum8)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum9)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output1"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '()))
+ (let world (Left! x))
+ (let table7 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table7)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"project_id" '"requester_id") '('('Sum8 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum9 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"project_id" (Member row '"project_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum8)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum9)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"requester_id") '('('Sum11 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum12 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum11)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum12)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output2"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '()))
+ (let world (Left! x))
+ (let table7 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table7)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"project_id" '"requester_id") '('('Sum8 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum9 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"project_id" (Member row '"project_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum8)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum9)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date" '"requester_id") '('('Sum11 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum12 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"requester_id" (Member row '"requester_id")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum11)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum12)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"date") '('('Sum14 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_count")))) '('Sum15 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"gs_weight")))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"date" (Member row '"date")))
+ (let res (AddMember res '"gs_count" (Member row 'Sum14)))
+ (let res (AddMember res '"gs_weight" (Member row 'Sum15)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output3"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.cfg
new file mode 100644
index 0000000000..ed61022bf8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+mount ..\mounts.txt
+udf stat_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.sql b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.sql
new file mode 100644
index 0000000000..aaa89e48d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.sql
@@ -0,0 +1,17 @@
+USE plato;
+
+SELECT
+ key as key,
+ "a" || min(subkey || "q") as x1,
+ "b" || min(subkey || "q") as x2,
+ "c" || max(value) as x3,
+ "d" || max(value) as x4,
+ "1" || min(distinct subkey) as y1,
+ "2" || min(distinct subkey) as y2,
+ "3" || max(distinct value) as y3,
+ "4" || max(distinct value) as y4,
+ percentile(x, 0.5),
+ percentile(x, 0.9)
+FROM (SELECT key, subkey, value, Length(key) as x from Input)
+GROUP BY key
+ORDER BY key; \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.yql
new file mode 100644
index 0000000000..64ee248ed9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/SameTrait.yql
@@ -0,0 +1,73 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (Member row '"subkey")))
+ (let res (AddMember res '"value" (Member row '"value")))
+ (let res (AddMember res '"x" ("Size" (Member row '"key"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (let percentile_x_create (lambda '(row) (MatchType (Member row '"x") 'Optional (lambda '(optValue) (FlatMap optValue (lambda '(value) (Just (Apply (Udf 'Stat.TDigest_Create) value))))) (lambda '(value) (Apply (Udf 'Stat.TDigest_Create) value)))))
+ (let percentile_x_update (lambda '(row state) (MatchType (Member row '"x") 'Optional (lambda '(optValue) (IfPresent state (lambda '(state) (IfPresent optValue (lambda '(value) (Just (Apply (Udf 'Stat.TDigest_AddValue) state value))) (Just state))) (FlatMap optValue (lambda '(value) (Just (Apply (Udf 'Stat.TDigest_Create) value)))))) (lambda '(value) (Apply (Udf 'Stat.TDigest_AddValue) state value)))))
+ (let percentile_x_save (lambda '(state) (MatchType state 'Optional (lambda '(optState) (Map optState (lambda '(currState) (Apply (Udf 'Stat.TDigest_Serialize) currState)))) (lambda '(currState) (Apply (Udf 'Stat.TDigest_Serialize) currState)))))
+ (let percentile_x_load (lambda '(item) (MatchType item 'Optional (lambda '(optData) (FlatMap optData (lambda '(data) (Just (Apply (Udf 'Stat.TDigest_Deserialize) data))))) (lambda '(data) (Apply (Udf 'Stat.TDigest_Deserialize) data)))))
+ (let percentile_x_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (Apply (Udf 'Stat.TDigest_Merge) a b)))))
+ (let percentile_x_finish (lambda '(state) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'Percentile9 (Apply (lambda '(state) (MatchType state 'Optional (lambda '(optData) (Map optData (lambda '(data) (Apply (Udf 'Stat.TDigest_GetPercentile) data (Double '0.5))))) (lambda '(data) (Apply (Udf 'Stat.TDigest_GetPercentile) data (Double '0.5))))) state)))
+ (let res (AddMember res 'Percentile10 (Apply (lambda '(state) (MatchType state 'Optional (lambda '(optData) (Map optData (lambda '(data) (Apply (Udf 'Stat.TDigest_GetPercentile) data (Double '0.9))))) (lambda '(data) (Apply (Udf 'Stat.TDigest_GetPercentile) data (Double '0.9))))) state)))
+ (return res)
+ ))))
+ (return (Aggregate core '('"key") '('('Min1 (Apply (bind aggregate_module '"min_traits_factory") (TypeOf core) (lambda '(row) ("Concat" (Member row '"subkey") (String '"q"))))) '('Min2 (Apply (bind aggregate_module '"min_traits_factory") (TypeOf core) (lambda '(row) ("Concat" (Member row '"subkey") (String '"q"))))) '('Max3 (Apply (bind aggregate_module '"max_traits_factory") (TypeOf core) (lambda '(row) (Member row '"value")))) '('Max4 (Apply (bind aggregate_module '"max_traits_factory") (TypeOf core) (lambda '(row) (Member row '"value")))) '('Min5 (Apply (bind aggregate_module '"min_traits_factory") (ListType (StructMemberType (ListItemType (TypeOf core)) '"subkey")) (lambda '(row) row)) '"subkey") '('Min6 (Apply (bind aggregate_module '"min_traits_factory") (ListType (StructMemberType (ListItemType (TypeOf core)) '"subkey")) (lambda '(row) row)) '"subkey") '('Max7 (Apply (bind aggregate_module '"max_traits_factory") (ListType (StructMemberType (ListItemType (TypeOf core)) '"value")) (lambda '(row) row)) '"value") '('Max8 (Apply (bind aggregate_module '"max_traits_factory") (ListType (StructMemberType (ListItemType (TypeOf core)) '"value")) (lambda '(row) row)) '"value") '('percentile_x (AggregationTraits (ListItemType (TypeOf core)) percentile_x_create percentile_x_update percentile_x_save percentile_x_load percentile_x_merge percentile_x_finish (Null))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"x1" ("Concat" (String '"a") (Member row 'Min1))))
+ (let res (AddMember res '"x2" ("Concat" (String '"b") (Member row 'Min2))))
+ (let res (AddMember res '"x3" ("Concat" (String '"c") (Member row 'Max3))))
+ (let res (AddMember res '"x4" ("Concat" (String '"d") (Member row 'Max4))))
+ (let res (AddMember res '"y1" ("Concat" (String '"1") (Member row 'Min5))))
+ (let res (AddMember res '"y2" ("Concat" (String '"2") (Member row 'Min6))))
+ (let res (AddMember res '"y3" ("Concat" (String '"3") (Member row 'Max7))))
+ (let res (AddMember res '"y4" ("Concat" (String '"4") (Member row 'Max8))))
+ (let res (AddMember res '"column9" (Member (Member row '"percentile_x") 'Percentile9)))
+ (let res (AddMember res '"column10" (Member (Member row '"percentile_x") 'Percentile10)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"x1" '"x2" '"x3" '"x4" '"y1" '"y2" '"y3" '"y4" '"column9" '"column10")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/Traits.yql b/yql/essentials/tests/s-expressions/suites/Aggregation/Traits.yql
new file mode 100644
index 0000000000..7a8c8845dc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/Traits.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let init (lambda '(x) x))
+(let update (lambda '(x y) (+ x y)))
+(let save (lambda '(x) x))
+(let load (lambda '(x) x))
+(let merge (lambda '(x y) (+ x y)))
+(let finish (lambda '(x) x))
+(let sum (AggregationTraits (DataType 'Uint32) init update save load merge finish (Null)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf sum)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/default.cfg b/yql/essentials/tests/s-expressions/suites/Aggregation/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt b/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt
new file mode 100644
index 0000000000..fc70ee2541
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt
@@ -0,0 +1,7 @@
+{"key"="075";"subkey"="1";"value"="2"};
+{"key"="075";"subkey"="2";"value"="5"};
+{"key"="075";"subkey"="3";"value"="5"};
+{"key"="800";"subkey"="4";"value"="4"};
+{"key"="020";"subkey"="5";"value"="10"};
+{"key"="150";"subkey"="6";"value"="2"};
+{"key"="150";"subkey"="7";"value"="3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt b/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt
new file mode 100644
index 0000000000..d1fa0973d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="aaa"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="ccc"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt b/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt
new file mode 100644
index 0000000000..6872d1e389
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt
@@ -0,0 +1,2 @@
+{"key"=1016143471372484394u};
+{"key"=1033900131482000140u};
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt.attr
new file mode 100644
index 0000000000..bdbbaad78d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/input3.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ]
+ ];
+ "SortDirections"=[1;];
+ "SortedBy"=["key";];
+ "SortedByTypes"=[["DataType";"Uint64";];];
+ "SortMembers"=["key";];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt b/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt
new file mode 100644
index 0000000000..c76c262542
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt
@@ -0,0 +1,10 @@
+{"assignment_assignment_id"=243u;"assignment_gs_count"=98u;"assignment_gs_weight"=89989u;"assignment_last_status_change_time"=43u;"project_id"=67u;"requester_id"=65u};
+{"assignment_assignment_id"=43u;"assignment_gs_count"=9u;"assignment_gs_weight"=8u;"assignment_last_status_change_time"=4563u;"project_id"=6897u;"requester_id"=765u};
+{"assignment_assignment_id"=25u;"assignment_gs_count"=678u;"assignment_gs_weight"=0u;"assignment_last_status_change_time"=45u;"project_id"=62u;"requester_id"=63u};
+{"assignment_assignment_id"=2563u;"assignment_gs_count"=98u;"assignment_gs_weight"=89989u;"assignment_last_status_change_time"=43u;"project_id"=67u;"requester_id"=65u};
+{"assignment_assignment_id"=233453u;"assignment_gs_count"=98u;"assignment_gs_weight"=89989u;"assignment_last_status_change_time"=43u;"project_id"=67u;"requester_id"=65u};
+{"assignment_assignment_id"=2456u;"assignment_gs_count"=978u;"assignment_gs_weight"=89u;"assignment_last_status_change_time"=403u;"project_id"=67u;"requester_id"=67u};
+{"assignment_assignment_id"=27643u;"assignment_gs_count"=9768u;"assignment_gs_weight"=86789u;"assignment_last_status_change_time"=49u;"project_id"=67u;"requester_id"=67u};
+{"assignment_assignment_id"=248u;"assignment_gs_count"=9768u;"assignment_gs_weight"=89989u;"assignment_last_status_change_time"=409u;"project_id"=67u;"requester_id"=625u};
+{"assignment_assignment_id"=248u;"assignment_gs_count"=9768u;"assignment_gs_weight"=89969u;"assignment_last_status_change_time"=4u;"project_id"=6347u;"requester_id"=65u};
+{"assignment_assignment_id"=24893u;"assignment_gs_count"=98u;"assignment_gs_weight"=8963989u;"assignment_last_status_change_time"=40u;"project_id"=6767u;"requester_id"=655u};
diff --git a/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt.attr b/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt.attr
new file mode 100644
index 0000000000..54d58bb57d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Aggregation/many_columns.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["assignment_assignment_id";["DataType";"Uint64"]];["assignment_last_status_change_time";["DataType";"Uint64"]];["requester_id";["DataType";"Uint64"]];["project_id";["DataType";"Uint64"]];["assignment_gs_count";["DataType";"Uint64"]];["assignment_gs_weight";["DataType";"Uint64"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/AndOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/AndOverOptional.yql
new file mode 100644
index 0000000000..4b878ab6d0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/AndOverOptional.yql
@@ -0,0 +1,60 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let writer (lambda '(x) (MatchType x 'Optional
+(lambda '(x) (Coalesce (Map x (lambda '(y) (ToString y))) (String 'NULL)))
+(lambda '(x) (ToString x)))))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t (Bool 'true))
+ (let jt (Just t))
+ (let f (Bool 'false))
+ (let jf (Just f))
+ (let n (Nothing (OptionalType (DataType 'Bool))))
+ (let newValue value)
+
+ (let newValue (Concat newValue (String '" => AND true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And t t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And t jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And t f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And t jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And t n)))))
+ (let newValue (Concat newValue (String '" => AND false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And f t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And f jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And f f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And f jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And f n)))))
+ (let newValue (Concat newValue (String '" => AND just true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jt t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jt jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jt f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jt jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jt n)))))
+ (let newValue (Concat newValue (String '" => AND just false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jf t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jf jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jf f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jf jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And jf n)))))
+ (let newValue (Concat newValue (String '" => AND nothing : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And n t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And n jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And n f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And n jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (And n n)))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Arithmetic.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Arithmetic.yql
new file mode 100644
index 0000000000..ac50a50ada
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Arithmetic.yql
@@ -0,0 +1,30 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '2))
+ (let y (Uint32 '0))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (+ (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (- (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (* (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ (Size value) x) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ (Size value) y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% (Size value) x) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% (Size value) y) (Uint32 '999))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticOverEmptyOptionals.yql b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticOverEmptyOptionals.yql
new file mode 100644
index 0000000000..fa25eff9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticOverEmptyOptionals.yql
@@ -0,0 +1,80 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '7))
+ (let y (Uint32 '2))
+ (let z (Uint32 '0))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let n (Nothing (OptionalType (DataType 'Uint32))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (String '" + ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (+ x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (+ n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" - ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (- x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (- n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" * ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (* x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (* n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" / ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ x y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ x z) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (/ n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" % ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% x y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% x z) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (% n n) (Uint32 '999))))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.yql b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.yql
new file mode 100644
index 0000000000..2df7e940fe
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ArithmeticUnary.yql
@@ -0,0 +1,53 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let u (Uint32 '2))
+ (let u64 (Uint64 '333))
+ (let u8 (Uint8 '7))
+ (let s (Int32 '-2))
+ (let d (Double '3.1415))
+ (let ju (Just u))
+ (let js (Just s))
+ (let jd (Just d))
+ (let newValue (Member item 'value))
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (CountBits u)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (CountBits u64)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (CountBits u8)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Inc u)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Dec u)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Plus u)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Minus u)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Inc ju) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Dec ju) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Plus ju) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Minus ju) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Inc s)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Dec s)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Plus s)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Minus s)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Inc js) (Int32 '-999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Dec js) (Int32 '-999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Plus js) (Int32 '-999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Minus js) (Int32 '-999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Abs s)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Abs d)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Plus d)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Minus d)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Plus jd) (Double '0))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Minus jd) (Double '0))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) table1map '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.yql b/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.yql
new file mode 100644
index 0000000000..76a39cde33
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/AsTagged.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (AsTagged (Member item 'value) 'myTag))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(let x (Read! world mr_source (Key '('table (String 'Output))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table2 '('('type))))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/BitLogical.yql b/yql/essentials/tests/s-expressions/suites/Builtins/BitLogical.yql
new file mode 100644
index 0000000000..801f98c809
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/BitLogical.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '2))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitNot (Size value))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitAnd (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitOr (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitXor (Size value) x)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/BitLogicalOverEmptyOptionals.yql b/yql/essentials/tests/s-expressions/suites/Builtins/BitLogicalOverEmptyOptionals.yql
new file mode 100644
index 0000000000..bad75321c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/BitLogicalOverEmptyOptionals.yql
@@ -0,0 +1,62 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '7))
+ (let y (Uint32 '2))
+ (let z (Uint32 '0))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let n (Nothing (OptionalType (DataType 'Uint32))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (String '" BitNot ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitNot x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitNot jx) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitNot n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" BitAnd ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitAnd x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitAnd n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" BitOr ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitOr x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitOr n n) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" BitXor ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (BitXor x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor x jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor jx jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor jx n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor n jy) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor x n) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (BitXor n n) (Uint32 '999))))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/BitShifts.yql b/yql/essentials/tests/s-expressions/suites/Builtins/BitShifts.yql
new file mode 100644
index 0000000000..d38c5df0c2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/BitShifts.yql
@@ -0,0 +1,31 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint8 '1))
+ (let y (Uint8 '10))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftLeft (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotLeft (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftRight (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotRight (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftLeft (Size value) y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotLeft (Size value) y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftRight (Size value) y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotRight (Size value) y)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/BitShiftsOverEmptyOptionals.yql b/yql/essentials/tests/s-expressions/suites/Builtins/BitShiftsOverEmptyOptionals.yql
new file mode 100644
index 0000000000..d2dd9c92b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/BitShiftsOverEmptyOptionals.yql
@@ -0,0 +1,42 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '7))
+ (let y (Uint8 '2))
+ (let jx (Just x))
+ (let n (Nothing (OptionalType (DataType 'Uint32))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (String '" ShiftLeft ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftLeft x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (ShiftLeft jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (ShiftLeft n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" RotLeft ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotLeft x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (RotLeft jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (RotLeft n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" ShiftRight ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (ShiftRight x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (ShiftRight jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (ShiftRight n y) (Uint32 '999))))))
+ (let newValue (Concat newValue (String '" RotRight ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (RotRight x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (RotRight jx y) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (RotRight n y) (Uint32 '999))))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Cast.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Cast.yql
new file mode 100644
index 0000000000..edf5b44792
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Cast.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (SafeCast value (DataType 'Int32)) (Int32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (SafeCast (String '42) (DataType 'Int32)) (Int32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (SafeCast value (DataType 'String))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (SafeCast (Int32 '123) (DataType 'String))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (SafeCast (Int32 '123) (DataType 'Double))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/CastStruct.yql b/yql/essentials/tests/s-expressions/suites/Builtins/CastStruct.yql
new file mode 100644
index 0000000000..ff4a01823d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/CastStruct.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let type (StructType '('key (DataType 'String))))
+ (let list (List (ListType type)))
+ (let castedValue (CastStruct item type))
+ (let list (Append list castedValue))
+ (let newValue (Member castedValue 'key))
+ (let newValue (Concat newValue (ToString (Length list))))
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Coalesce.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Coalesce.yql
new file mode 100644
index 0000000000..b03717e014
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Coalesce.yql
@@ -0,0 +1,45 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '1))
+ (let y (Uint32 '2))
+ (let z (Uint32 '3))
+ (let n (Nothing (OptionalType (TypeOf x))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ # single arg
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce (Just x)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists (Coalesce n))))))
+ # two arg
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Just x) y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce (Just x) (Just y)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce n y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce n (Just y)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists (Coalesce n n))))))
+ # more args
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce x y z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Just x) (Just y) z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce (Just x) (Just y) (Just z)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce n (Just y) z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce n (Just y) (Just z)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce n n z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (Coalesce n n (Just z)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists (Coalesce n n n))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/CombineByKey.yql b/yql/essentials/tests/s-expressions/suites/Builtins/CombineByKey.yql
new file mode 100644
index 0000000000..5fa1b5c037
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/CombineByKey.yql
@@ -0,0 +1,30 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'abc) newValue))
+ (let newValue (Append newValue (String 'q)))
+ (let preMap (lambda '(item) (Just item)))
+ (let keyExtractor (lambda '(item) item))
+ (let init (lambda '(key item) item))
+ (let update (lambda '(key item state) (Concat state item)))
+ (let finish (lambda '(key state) (AsList '(key state))))
+ (let combined (CombineByKey newValue preMap keyExtractor init update finish))
+ (let ret (Map combined (lambda '(item2) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat (Nth item2 '0) (String '" => ")) (ToString (Nth item2 '1)))))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Compare.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Compare.yql
new file mode 100644
index 0000000000..bd5b02bfc8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Compare.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let b (String 'q))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (< value b)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (<= value b)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (> value b)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (>= value b)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (== value b)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (!= value b)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/CompareWithEmptyOptionals.yql b/yql/essentials/tests/s-expressions/suites/Builtins/CompareWithEmptyOptionals.yql
new file mode 100644
index 0000000000..4e7c2ed97f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/CompareWithEmptyOptionals.yql
@@ -0,0 +1,69 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '700))
+ (let y (Uint32 '20))
+ (let z (Uint32 '0))
+ (let jx (FromString (Member item 'key) 'Uint32))
+ (let jy (FromString (Member item 'subkey) 'Uint32))
+ (let n (Nothing (OptionalType (DataType 'Uint32))))
+ (let test (lambda '(item) (If (Exists item) (ToString (Coalesce item (Bool 'false))) (String 'NULL))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (String '" < ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (< x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< jx y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< x jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< jx jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< jx n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< n jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< x n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< n y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (< n n)))))
+ (let newValue (Concat newValue (String '" > ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (> x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> jx y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> x jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> jx jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> jx n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> n jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> x n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> n y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (> n n)))))
+ (let newValue (Concat newValue (String '" == ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (== x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== jx y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== x jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== jx jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== jx n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== n jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== x n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== n y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (== n n)))))
+ (let newValue (Concat newValue (String '" != ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (!= x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= jx y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= x jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= jx jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= jx n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= n jy)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= x n)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= n y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply test (!= n n)))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Concat.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Concat.yql
new file mode 100644
index 0000000000..d423bbd1a2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Concat.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Concat value (String 'zzz)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Condense.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Condense.yql
new file mode 100644
index 0000000000..d601958e3e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Condense.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let state (Uint32 '0))
+ (let state (Condense (Iterator newValue) state (lambda '(item state) (Bool 'False)) (lambda '(item state) (+ state (Size item)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat value (String '" ==> "))
+ (ToString (Coalesce (ToOptional (Collect state)) (Uint32 '0))))))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Condense1.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Condense1.yql
new file mode 100644
index 0000000000..1899624162
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Condense1.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let state (Condense1 (Iterator newValue) (lambda '(item) (Size item)) (lambda '(item state) (Bool 'False)) (lambda '(item state) (+ state (Size item)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat value (String '" ==> "))
+ (ToString (Coalesce (ToOptional (Collect state)) (Uint32 '0))))))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Contains.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Contains.yql
new file mode 100644
index 0000000000..1dbafaba7d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Contains.yql
@@ -0,0 +1,27 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t1 (DataType 'Uint32))
+ (let t2 (DataType 'String))
+ (let d1 (DictType t1 t2))
+ (let d2 (Dict d1 '((Uint32 '4) (String 'aaa)) '((Uint32 '5) (String 'bbb))) )
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Contains d2 (Uint32 '4))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Contains d2 (Uint32 '6))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Convert.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Convert.yql
new file mode 100644
index 0000000000..74e0bf07e5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Convert.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Int32 '1))
+ (let y (Uint32 '20))
+ (let z (Double '300))
+ (let newValue (ToString (+ (Convert x (DataType 'Uint32)) y)))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString (+ (Coalesce (ToIntegral z (DataType 'Int32)) (Int32 '999)) x))))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString (+ (Convert y (DataType 'Double)) z))))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString (Coalesce (ToIntegral z (DataType 'Uint8)) (Uint8 '99)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/DicItems.yql b/yql/essentials/tests/s-expressions/suites/Builtins/DicItems.yql
new file mode 100644
index 0000000000..95277fbb51
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/DicItems.yql
@@ -0,0 +1,48 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t1 (DataType 'Uint32))
+ (let t2 (DataType 'String))
+ (let d1 (DictType t1 t2))
+ (let d2 (Dict d1 '((Uint32 '4) (String 'aaa)) '((Uint32 '4) (String 'zzz)) '((Uint32 '5) (String 'bbb))) )
+ (let list1 (Sort (DictItems d2) (Bool 'true) (lambda '(x) (Nth x '0))))
+ (let list2 (Sort (DictKeys d2) (Bool 'true) (lambda '(x) x)))
+ (let list3 (Sort (DictPayloads d2) (Bool 'true) (lambda '(x) x)))
+ (let value1 (Fold list1 (String '"") (lambda '(item state) (block '(
+ (let newValue state)
+ (let newValue (Concat newValue (String '" Items => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Nth item '0)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Nth item '1)))))
+ (return newValue)
+ )))))
+
+ (let value2 (Fold list2 (String '"") (lambda '(item state) (block '(
+ (let newValue state)
+ (let newValue (Concat newValue (String '" Keys => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString item))))
+ (return newValue)
+ )))))
+
+ (let value3 (Fold list3 (String '"") (lambda '(item state) (block '(
+ (let newValue state)
+ (let newValue (Concat newValue (String '" Payloads => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString item))))
+ (return newValue)
+ )))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value (Concat (Concat (Concat value value1) value2) value3)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembers.yql b/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembers.yql
new file mode 100644
index 0000000000..d7d096c666
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembers.yql
@@ -0,0 +1,45 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let value (AsStruct '('akey1 (Int8 '1)) '('bkey2 (String 'str)) '('c (Int32 '2))))
+(let prefixes '('a 'b))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct '('akey1 (Int8 '1)) '('bkey2 (String 'str)) '('c (Int32 '2))))
+(let prefixes '('b 'a '""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct '('akey1 (Int8 '1)) '('bkey2 (String 'str)) '('c (Int32 '2))))
+(let prefixes '('b 'a 'ak '""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct '('akey1 (Int8 '1)) '('bkey2 (String 'str)) '('c (Int32 '2))))
+(let prefixes '('""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct '('akey1 (Int8 '1)) '('bkey2 (String 'str)) '('c (Int32 '2))))
+(let prefixes '())
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct))
+(let prefixes '('""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (AsStruct))
+(let prefixes '())
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembersOpt.yql b/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembersOpt.yql
new file mode 100644
index 0000000000..aabfde5009
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/DivePrefixMembersOpt.yql
@@ -0,0 +1,20 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let value (Just (AsStruct '('akey1 (Just (Int8 '1))) '('bkey2 (String 'str)) '('c (Nothing (OptionalType (DataType 'Int32)))))))
+(let prefixes '('b 'a 'ak '""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let value (Nothing (OptionalType (StructType '('akey1 (OptionalType (DataType 'Int8))) '('bkey2 (DataType 'String)) '('c (OptionalType (DataType 'Int32)))))))
+(let prefixes '('b 'a 'ak '""))
+(let result (DivePrefixMembers value prefixes))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Enumerate.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Enumerate.yql
new file mode 100644
index 0000000000..245bccb5a7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Enumerate.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let numList (Enumerate newValue))
+ (let ret (Map numList (lambda '(item2) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat (ToString (Nth item2 '0)) (String '" => ")) (Nth item2 '1))))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Exists.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Exists.yql
new file mode 100644
index 0000000000..a45adbeeeb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Exists.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList (Exists (FromString (String 'zzz) 'Int32))))
+ (let newValue (Append newValue (Exists (FromString (String '3456) 'Int32))))
+ (let newValue (Append newValue (Exists (String 'zzz))))
+ (let ret (Map newValue (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString item)))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Extract.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Extract.yql
new file mode 100644
index 0000000000..97637f6e25
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Extract.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let list1 (AsList item))
+ (let list2 (Just '(value (Uint32 '22))))
+ (let structExtract (Extract list1 'key))
+ (let tupleExtract (Extract list2 '0))
+ (let ret (Map (Extend structExtract (ToList tupleExtract)) (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/FilterAndSize.yql b/yql/essentials/tests/s-expressions/suites/Builtins/FilterAndSize.yql
new file mode 100644
index 0000000000..db9c86ab6d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/FilterAndSize.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let list (AsList value))
+ (let list (Append list (String 'x)))
+ (let filtered (Filter list (lambda '(x) (== (Size x) (Uint32 '1)))))
+ (let ret (Map filtered (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembers.yql b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembers.yql
new file mode 100644
index 0000000000..7bb2ee9823
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembers.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let myStruct (AsStruct '('a (String 'z))))
+ (let flatten (FlattenMembers '('"first_" item) '('"second_" myStruct)))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Member flatten 'first_key))))
+ (let newValue (Concat newValue (Concat (String '" ") (Member flatten 'second_a))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional.yql
new file mode 100644
index 0000000000..4a2d27f7ce
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let myStruct (AsStruct '('a (String 'z))))
+ (let flatten (FlattenMembers '('"first_" item) '('"second_" (Just myStruct))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Member flatten 'first_key))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Member flatten 'second_a) (String '"")))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional2.yql b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional2.yql
new file mode 100644
index 0000000000..42b30ea242
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/FlattenMembersOptional2.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let value (AsStruct '('a (Int8 '1)) '('b (Just (String 'str))) '('c '((Int32 '2) (Int64 '3)))))
+(let flattenMembersResult (FlattenMembers '('"" (Just value))))
+(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))
+
+(let value (Nothing (TypeOf (Just value))))
+(let flattenMembersResult (FlattenMembers '('"x" value)))
+(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))
+
+(let value (AsStruct))
+(let flattenMembersResult (FlattenMembers '('"x" value)))
+(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))
+
+(let value (Just (AsStruct)))
+(let flattenMembersResult (FlattenMembers '('"" value)))
+(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))
+
+(let value (Nothing (TypeOf value)))
+(let flattenMembersResult (FlattenMembers '('"x" value)))
+(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Floats.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Floats.yql
new file mode 100644
index 0000000000..08f9f64797
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Floats.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let x (Double '1.2))
+ (let y (Double '3))
+ (let newValue (String '" => "))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (+ x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (- x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (* x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (/ x y)))))
+
+ (let x (Float '0.1))
+ (let y (Float '-2.2))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (+ x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (- x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (* x y)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (/ x y)))))
+
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (FromString (String '1.23) 'Float) (Float '0.0))))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Fold.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Fold.yql
new file mode 100644
index 0000000000..34544fa51e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Fold.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let state (Uint32 '0))
+ (let state (Fold newValue state (lambda '(item state) (+ state (Size item)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat value (String '" ==> ")) (ToString state))))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Fold1.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Fold1.yql
new file mode 100644
index 0000000000..d360f24111
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Fold1.yql
@@ -0,0 +1,30 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let state (Fold1 newValue
+ (lambda '(item) '((Size item) (Uint64 '1)))
+ (lambda '(item state) '((+ (Nth state '0) (Size item)) (+ (Nth state '1) (Uint64 '1))))))
+ (return (FlatMap state (lambda '(state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let x (ToString (Nth state '0)))
+ (let y (ToString (Nth state '1)))
+ (let s (AddMember s 'value
+ (Concat (Concat value (String '" ==> ")) (Concat (Concat x (String '" ")) y))))
+ (return (AsList s))
+ )))))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Fold2Lambda.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Fold2Lambda.yql
new file mode 100644
index 0000000000..9d15c7ceb8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Fold2Lambda.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let myLambda (lambda '(item state) (+ state item)))
+ (let state (Uint32 '0))
+ (let state (Fold (Map newValue (lambda '(x) (Size x))) state myLambda))
+ (let ilist (AsList (Int32 '4)))
+ (let ilist (Append ilist (Int32 '6)))
+ (let state2 (Int32 '0))
+ (let state2 (Fold ilist state2 myLambda))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat value (String '" ==> ")) (Concat (ToString state) (ToString state2)))))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/FromString.yql b/yql/essentials/tests/s-expressions/suites/Builtins/FromString.yql
new file mode 100644
index 0000000000..ba534b346d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/FromString.yql
@@ -0,0 +1,31 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList (Coalesce (FromString (String 'zzz) 'Int32) (Int32 '999))))
+ (let newValue (Append newValue (Coalesce (FromString (String '3456) 'Int32) (Int32 '999))))
+ (let newValue (Append newValue (Coalesce (FromString (String 'x"2345") 'Int32) (Int32 '999))))
+ (let newValue (Append newValue (Coalesce (FromString (String 'x"31") 'Int32) (Int32 '999))))
+ (let newValue (Append newValue (If (Coalesce (FromString (String 'true) 'Bool) (Bool 'false))
+ (Int32 '100) (Int32 '0))))
+ (let ret (Map newValue (lambda '(item) (block '(
+ (let s (Struct))
+ (let k (ToString (Coalesce (FromString (String '"1u,34") 'Yson) (Yson '"999"))))
+ (let k (Concat k (ToString (Coalesce (FromString (String '"NaN") 'Double) (Double '"999")))))
+ (let s (AddMember s 'key k))
+ (let sk (ToString (Coalesce (FromString (String '"[1u;34]") 'Yson) (Yson '"999"))))
+ (let sk (Concat sk (ToString (Coalesce (FromString (String '"-inf") 'Float) (Float '"999")))))
+ (let s (AddMember s 'subkey sk))
+ (let s (AddMember s 'value (ToString item)))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/GroupByKey.yql b/yql/essentials/tests/s-expressions/suites/Builtins/GroupByKey.yql
new file mode 100644
index 0000000000..931c95d7b6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/GroupByKey.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'q) newValue))
+ (let newValue (Append newValue (String 'ddd)))
+ (let ret (GroupByKey newValue (lambda '(x) x) (lambda '(key list) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (return (AsList s)))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/HasItems.yql b/yql/essentials/tests/s-expressions/suites/Builtins/HasItems.yql
new file mode 100644
index 0000000000..2500618f6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/HasItems.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Member item 'value))
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (HasItems (AsList (String 'zzz)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (HasItems (List (ListType (DataType 'Int32))))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (HasItems (AsDict '((Int32 '234) (String 'zzz))))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (HasItems (Dict (DictType (DataType 'Int32) (DataType 'String))))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/If.yql b/yql/essentials/tests/s-expressions/suites/Builtins/If.yql
new file mode 100644
index 0000000000..f0cd523350
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/If.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (If (< (Member item 'key) (String '100)) value (String 'UUU)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value res))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/IfType.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/IfType.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/IfType.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/IfType.yql b/yql/essentials/tests/s-expressions/suites/Builtins/IfType.yql
new file mode 100644
index 0000000000..9503f0ed59
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/IfType.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (let res (IfType key (DataType 'String) (lambda '(item) (Concat item item)) (lambda '(item) item)))
+ (let s (Struct))
+ (let s (AddMember s 'key (ToString res)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value (Member item 'value)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) table1map '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/IntTypes.yql b/yql/essentials/tests/s-expressions/suites/Builtins/IntTypes.yql
new file mode 100644
index 0000000000..56b74c715c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/IntTypes.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Concat (String '"") (ToString (Uint8 '1))))
+ (let newValue (Concat newValue (ToString (Int32 '2))))
+ (let newValue (Concat newValue (ToString (Uint32 '3))))
+ (let newValue (Concat newValue (ToString (Int64 '4))))
+ (let newValue (Concat newValue (ToString (Uint64 '5))))
+ (let newValue (Concat newValue (ToString (Bool 'true))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Just.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Just.yql
new file mode 100644
index 0000000000..eac651c347
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Just.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList (Not (Exists (Just (Uint32 '111))))))
+ (let newValue (Append newValue (== (Coalesce (Just (String 'z)) (String 'y)) (String 'z))))
+ (let ret (Map newValue (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString item)))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideMap.yql b/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideMap.yql
new file mode 100644
index 0000000000..f308062a08
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideMap.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Concat value (ToString (Length table1))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideReduce.yql b/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideReduce.yql
new file mode 100644
index 0000000000..a28b93a7a7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/LengthInsideReduce.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (Concat (ToString (Length table1)) (ToString (HasItems table1)))))
+ (let s (AddMember s 'value (Concat (ToString (Length list)) (ToString (HasItems list)))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Bool 'true) (lambda '(item) (Member item 'subkey)) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ListAppendPrependExtend.yql b/yql/essentials/tests/s-expressions/suites/Builtins/ListAppendPrependExtend.yql
new file mode 100644
index 0000000000..c58fcc163d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ListAppendPrependExtend.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'prepended) newValue))
+ (let newValue (Append newValue (String 'appended)))
+ (let x (AsList (String '"extended twice")))
+ (let newValue (Extend newValue (Extend x x)))
+ (let ret (Map newValue (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Logical.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Logical.yql
new file mode 100644
index 0000000000..100c3df83b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Logical.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Bool 'true))
+ (let y (Bool 'false))
+ (let z (== value (String 'q)))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (And x z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Or x z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Xor x z)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Not z)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Lookup.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Lookup.yql
new file mode 100644
index 0000000000..2eb0e2ff1f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Lookup.yql
@@ -0,0 +1,27 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t1 (DataType 'Uint32))
+ (let t2 (DataType 'String))
+ (let d1 (DictType t1 t2))
+ (let d2 (Dict d1 '((Uint32 '4) (String 'aaa)) '((Uint32 '5) (String 'bbb))) )
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Lookup d2 (Uint32 '4)) (String '?)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Lookup d2 (Uint32 '6)) (String '?)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.yql b/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.yql
new file mode 100644
index 0000000000..5eb3cb79d7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/MatchType.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let key (FromString (Member item 'key) 'Uint64))
+ (let res (MatchType key 'Optional (lambda '(item) (Coalesce item (Uint64 '0))) (lambda '(item) item)))
+ (let s (Struct))
+ (let s (AddMember s 'key (ToString res)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value (Member item 'value)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) table1map '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/MinMax.yql b/yql/essentials/tests/s-expressions/suites/Builtins/MinMax.yql
new file mode 100644
index 0000000000..71a972e7e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/MinMax.yql
@@ -0,0 +1,33 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let x (Member item 'value))
+ (let y (String 'q))
+ (let z (String 'zzzz))
+ (let newValue x)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x))))
+ (let newValue (Concat newValue (Concat (String '" ") (Max x))))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x y))))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x x))))
+ (let newValue (Concat newValue (Concat (String '" ") (Max x y))))
+ (let newValue (Concat newValue (Concat (String '" ") (Max y y))))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x y z))))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x x z))))
+ (let newValue (Concat newValue (Concat (String '" ") (Max x y z))))
+ (let newValue (Concat newValue (Concat (String '" ") (Max z z z))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/MinMaxOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/MinMaxOverOptional.yql
new file mode 100644
index 0000000000..87b210c725
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/MinMaxOverOptional.yql
@@ -0,0 +1,45 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let x (Member item 'value))
+ (let y (String 'q))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let n (Nothing (OptionalType (DataType 'String))))
+ (let newValue x)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (String '" Min ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Min x y))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min jx y) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min x jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min jx jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min jx n) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min n jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min n y) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min x n) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Min n n) (String '999)))))
+ (let newValue (Concat newValue (String '" Max ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Max x y))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max jx y) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max x jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max jx jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max jx n) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max n jy) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max n y) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max x n) (String '999)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Max n n) (String '999)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Nanvl.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Nanvl.yql
new file mode 100644
index 0000000000..899ddf853d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Nanvl.yql
@@ -0,0 +1,81 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue value)
+ (let x (Float '2))
+ (let y (Float '0))
+ (let nan (/ y y))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let jnan (Just nan))
+ (let n (Nothing (TypeOf jx)))
+ (let v (Null))
+ (let newValue (Concat newValue (String '" Float => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n y) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n jy) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n n) (Float '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x v) (Float '999))))))
+ (let x (Double '2))
+ (let y (Double '0))
+ (let nan (/ y y))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let jnan (Just nan))
+ (let n (Nothing (TypeOf jx)))
+ (let newValue (Concat newValue (String '" Double => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n y) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n jy) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl y n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl nan n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jx n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jy n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl jnan n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl n n) (Double '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Nanvl x v) (Double '999))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/NotOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/NotOverOptional.yql
new file mode 100644
index 0000000000..6a4f6f8e19
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/NotOverOptional.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let writer (lambda '(x) (MatchType x 'Optional
+(lambda '(x) (Coalesce (Map x (lambda '(y) (ToString y))) (String 'NULL)))
+(lambda '(x) (ToString x)))))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t (Bool 'true))
+ (let jt (Just t))
+ (let f (Bool 'false))
+ (let jf (Just f))
+ (let n (Nothing (OptionalType (DataType 'Bool))))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => NOT : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Not t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Not jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Not f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Not jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Not n)))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Now.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/Now.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Now.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Now.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Now.yql
new file mode 100644
index 0000000000..f187eeef74
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Now.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (ToString (Now (DependsOn (Member item 'value)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (ToString (Now))))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Nth.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Nth.yql
new file mode 100644
index 0000000000..0e3fc4acf6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Nth.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let x '((String 'zzz) (Member item 'value)))
+ (let newValue (Nth x '1))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/OptionalIf.yql b/yql/essentials/tests/s-expressions/suites/Builtins/OptionalIf.yql
new file mode 100644
index 0000000000..08758ca2b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/OptionalIf.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Coalesce (OptionalIf (== (Size value) (Uint32 '1)) value) (String '--)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/OptionalReduce.yql b/yql/essentials/tests/s-expressions/suites/Builtins/OptionalReduce.yql
new file mode 100644
index 0000000000..f53f027cbe
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/OptionalReduce.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '2))
+ (let y (Uint32 '3))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let n (Nothing (OptionalType (DataType 'Uint32))))
+ (let handler (lambda '(x y) (+ x y)))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (OptionalReduce x y handler)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (OptionalReduce jx jy handler) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (OptionalReduce jx n handler) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (OptionalReduce n jy handler) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (OptionalReduce n n handler) (Uint32 '999))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/OrOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/OrOverOptional.yql
new file mode 100644
index 0000000000..8a1440b4a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/OrOverOptional.yql
@@ -0,0 +1,60 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let writer (lambda '(x) (MatchType x 'Optional
+(lambda '(x) (Coalesce (Map x (lambda '(y) (ToString y))) (String 'NULL)))
+(lambda '(x) (ToString x)))))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t (Bool 'true))
+ (let jt (Just t))
+ (let f (Bool 'false))
+ (let jf (Just f))
+ (let n (Nothing (OptionalType (DataType 'Bool))))
+ (let newValue value)
+
+ (let newValue (Concat newValue (String '" => OR true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or t t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or t jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or t f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or t jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or t n)))))
+ (let newValue (Concat newValue (String '" => OR false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or f t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or f jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or f f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or f jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or f n)))))
+ (let newValue (Concat newValue (String '" => OR just true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jt t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jt jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jt f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jt jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jt n)))))
+ (let newValue (Concat newValue (String '" => OR just false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jf t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jf jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jf f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jf jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or jf n)))))
+ (let newValue (Concat newValue (String '" => OR nothing : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or n t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or n jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or n f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or n jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Or n n)))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Random.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/Random.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Random.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Random.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Random.yql
new file mode 100644
index 0000000000..2e6b0f7236
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Random.yql
@@ -0,0 +1,23 @@
+# canonize yson here
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (Member item 'value))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString
+ (Coalesce (ToIntegral (* (Uint64 '1000) (Random (DependsOn item))) (DataType 'Uint64)) (Uint64 '0)))))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString (RandomNumber (DependsOn item)))))
+ (let newValue (Concat (Concat newValue (String '" ")) (ToString (RandomUuid (DependsOn item)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (ToString (RandomNumber))))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Reverse.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Reverse.yql
new file mode 100644
index 0000000000..d9d5058791
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Reverse.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Append newValue (String 'appended)))
+ (let ret (OrderedMap (Reverse newValue) (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Skip.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Skip.yql
new file mode 100644
index 0000000000..3691a0bc21
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Skip.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let ret (Map (Skip newValue (Uint64 '1)) (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/SkipAfterTake.yql b/yql/essentials/tests/s-expressions/suites/Builtins/SkipAfterTake.yql
new file mode 100644
index 0000000000..75ce137d75
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/SkipAfterTake.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table2 (Take table1 (Uint64 '2)))
+(let table3 (Skip table2 (Uint64 '1)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Sort.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Sort.yql
new file mode 100644
index 0000000000..7333ac3a14
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Sort.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let sorted (Sort newValue (Bool 'False) (lambda '(x) x)))
+ (let sorted (Append sorted (String '----)))
+ (let ret (Map sorted (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.cfg
new file mode 100644
index 0000000000..9979f3f240
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.cfg
@@ -0,0 +1,2 @@
+in Input numeric_keys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.yql b/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.yql
new file mode 100644
index 0000000000..8d61d0d81b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/SortByOptionalNumbers.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let result (Sort table1 (Bool 'true) (lambda '(item) (FromString (Member item 'key) 'Uint64))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/SortBySubkeyInsideReduce.yql b/yql/essentials/tests/s-expressions/suites/Builtins/SortBySubkeyInsideReduce.yql
new file mode 100644
index 0000000000..db65afbd99
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/SortBySubkeyInsideReduce.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Bool 'true) (lambda '(item) (Member item 'subkey)) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Substring.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Substring.yql
new file mode 100644
index 0000000000..7a43121bdc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Substring.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (Substring value (Uint32 '0) (Uint32 '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Take.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Take.yql
new file mode 100644
index 0000000000..16e5ff7c87
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Take.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let ret (Map (Take newValue (Uint64 '2)) (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value item))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/TakeAfterSkip.yql b/yql/essentials/tests/s-expressions/suites/Builtins/TakeAfterSkip.yql
new file mode 100644
index 0000000000..8fb8659c08
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/TakeAfterSkip.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table2 (Skip table1 (Uint64 '1)))
+(let table3 (Take table2 (Uint64 '2)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ToIndexDict.yql b/yql/essentials/tests/s-expressions/suites/Builtins/ToIndexDict.yql
new file mode 100644
index 0000000000..866fd55415
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ToIndexDict.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let list (AsList (Uint32 '7) (Uint32 '16)))
+ (let dict (ToIndexDict list))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length dict)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Contains dict (Uint64 '1))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Contains dict (Uint64 '10))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Lookup dict (Uint64 '1)) (Uint32 '999))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Coalesce (Lookup dict (Uint64 '10)) (Uint32 '999))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/TryMember.yql b/yql/essentials/tests/s-expressions/suites/Builtins/TryMember.yql
new file mode 100644
index 0000000000..2c8d57527e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/TryMember.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (let res (TryMember item 'key (String 'aaa)))
+ (let res (Concat res (TryMember item 'newValue (String 'bbb))))
+ (let s (Struct))
+ (let s (AddMember s 'key res))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value (Member item 'value)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) table1map '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/TwoSkip.yql b/yql/essentials/tests/s-expressions/suites/Builtins/TwoSkip.yql
new file mode 100644
index 0000000000..453205bc66
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/TwoSkip.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table2 (Skip table1 (Uint64 '1)))
+(let table3 (Skip table2 (Uint64 '2)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/TwoTake.yql b/yql/essentials/tests/s-expressions/suites/Builtins/TwoTake.yql
new file mode 100644
index 0000000000..abd4639a4c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/TwoTake.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table2 (Take table1 (Uint64 '1)))
+(let table3 (Take table2 (Uint64 '2)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/TypeConstructors.yql b/yql/essentials/tests/s-expressions/suites/Builtins/TypeConstructors.yql
new file mode 100644
index 0000000000..50527bf4fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/TypeConstructors.yql
@@ -0,0 +1,49 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (RemoveSystemMembers (Right! x)))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '2))
+ (let y (String '!))
+ (let newValue value)
+ (let t1 (DataType 'Uint32))
+ (let o1 (OptionalType t1))
+ (let u1 (TupleType t1 o1))
+ (let str (DataType 'String))
+ (let s1 (StructType '('key str) '('subkey str) '('value str)))
+ (let s2 (Struct s1 '('subkey (String 'a)) '('key y) '('value y)))
+ (let s3 (AsStruct '('subkey (String 'a)) '('key y) '('value y)))
+ (let d1 (DictType t1 u1))
+ (let d2 (Dict d1))
+ (let d3 (Dict d1 '(x '(x (Just x)))))
+ (let d4 (AsDict '((String 'aaa) (Uint32 '17)) '((String 'aaa) (Uint32 '18)) '((String 'bbb) (Uint32 '5))))
+ (let z1 (Nothing (OptionalType (VoidType))))
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (+ (Size value) x)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length (List (ListType t1) x x))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length (List (ListType o1)))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length (List (ListType u1) '(x (Just x))))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists (Nothing o1))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length (AsList x x))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length (List (ListType s1) item))))))
+ (let newValue (Concat newValue (Concat (String '" ") (Member s2 'key))))
+ (let newValue (Concat newValue (Concat (String '" ") (Member s3 'subkey))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length d2)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length d3)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Length d4)))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists (Optional o1 x))))))
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Exists z1)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/UnionAll.yql b/yql/essentials/tests/s-expressions/suites/Builtins/UnionAll.yql
new file mode 100644
index 0000000000..e332263266
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/UnionAll.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let list1 (Map table1 (lambda '(row) (block '(
+ (let res (AsStruct '('foo (FromString (Member row 'key) 'Int32)) '('bar (FromString (Member row 'subkey) 'Int32))))
+ (return res)
+)
+))))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let list2 (Map table2 (lambda '(row) (block '(
+ (let res (AsStruct '('foo (FromString (Member row 'key) 'Double)) '('jar (Member row 'value))))
+ (return res)
+)
+))))
+(let result (UnionAll list1 list2))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf result)) '()))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Unwrap.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Unwrap.yql
new file mode 100644
index 0000000000..2180970236
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Unwrap.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Uint32 '2))
+ (let newValue value)
+ (let newValue (Concat newValue (Concat (String '" ") (ToString (Unwrap (/ (Size value) x))))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/XorOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Builtins/XorOverOptional.yql
new file mode 100644
index 0000000000..3d605c38b6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/XorOverOptional.yql
@@ -0,0 +1,60 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let writer (lambda '(x) (MatchType x 'Optional
+(lambda '(x) (Coalesce (Map x (lambda '(y) (ToString y))) (String 'NULL)))
+(lambda '(x) (ToString x)))))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let t (Bool 'true))
+ (let jt (Just t))
+ (let f (Bool 'false))
+ (let jf (Just f))
+ (let n (Nothing (OptionalType (DataType 'Bool))))
+ (let newValue value)
+
+ (let newValue (Concat newValue (String '" => XOR true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor t t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor t jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor t f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor t jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor t n)))))
+ (let newValue (Concat newValue (String '" => XOR false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor f t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor f jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor f f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor f jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor f n)))))
+ (let newValue (Concat newValue (String '" => XOR just true : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jt t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jt jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jt f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jt jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jt n)))))
+ (let newValue (Concat newValue (String '" => XOR just false : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jf t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jf jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jf f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jf jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor jf n)))))
+ (let newValue (Concat newValue (String '" => XOR nothing : ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor n t)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor n jt)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor n f)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor n jf)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Apply writer (Xor n n)))))
+
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/Zip.yql b/yql/essentials/tests/s-expressions/suites/Builtins/Zip.yql
new file mode 100644
index 0000000000..0455714f00
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/Zip.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let smallList (AsList (Int32 '2)))
+ (let zippedList (Zip newValue smallList))
+ (let ret (Map zippedList (lambda '(item2) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Concat (Nth item2 '0) (String '" => ")) (ToString (Nth item2 '1)))))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/ZipAll.yql b/yql/essentials/tests/s-expressions/suites/Builtins/ZipAll.yql
new file mode 100644
index 0000000000..554544466a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/ZipAll.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (FlatMap table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let newValue (AsList value))
+ (let newValue (Prepend (String 'p) newValue))
+ (let newValue (Append newValue (String 'a)))
+ (let smallList (AsList (Int32 '2)))
+ (let zippedList (ZipAll newValue smallList))
+ (let ret (Map zippedList (lambda '(item2) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let x (Coalesce (Nth item2 '0) (String '_)))
+ (let y (Coalesce (Map (Nth item2 '1) (lambda '(x) (ToString x))) (String '_)))
+ (let s (AddMember s 'value (Concat (Concat x (String '" => ")) y)))
+ (return s))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/default.cfg b/yql/essentials/tests/s-expressions/suites/Builtins/default.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/input.txt b/yql/essentials/tests/s-expressions/suites/Builtins/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Builtins/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt b/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt
new file mode 100644
index 0000000000..cebd64e139
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="2";"subkey"="20";"value"="BAR"};
+{"key"="3";"subkey"="30";"value"="BAR"};
+{"key"="WAT";"subkey"="WAT";"value"="FOO"};
diff --git a/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt.attr b/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Builtins/numeric_keys.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToEnormousList.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToEnormousList.yql
new file mode 100644
index 0000000000..95a0ec2555
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToEnormousList.yql
@@ -0,0 +1,9 @@
+(
+(let w (DataSink 'result))
+(let out '('('type) '('autoref) '('columns '('column0))))
+(let res (Write! world w (Key) (Unordered (EnsurePersistable (OrderedFlatMap (AsList (Uint32 '0)) (lambda '(stub) (block '(
+ (let $5 (AlterTo (ListFromRange (Minus (Int64 '1)) (Int64 '1000000000000)) (ListType (DataType 'Uint64)) (lambda '(x) x) (AsList (Uint64 '0))))
+ (return (AsList (AsStruct '('"column0" $5))))
+)))))) out))
+(return (CommitAll! (Commit! res w)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataFloatTypes.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataFloatTypes.yql
new file mode 100644
index 0000000000..157a109a64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataFloatTypes.yql
@@ -0,0 +1,39 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Float -> Double (always success)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"1.0") (DataType 'Double) (Double '"0.0")))
+
+# Double -> Float (success)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Double '"2.0") (DataType 'Float) (Float '"123456.0")))
+
+# Double -> Float (fail)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Double '"3.0000001") (DataType 'Float) (Float '"123456.0")))
+
+# Float -> Integer (success)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"3.0") (DataType 'Uint32) (Uint32 '123456)))
+
+# Float -> Integer (success)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"-3.0") (DataType 'Int32) (Int32 '123456)))
+
+# Float -> Integer (fail)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"3.3") (DataType 'Uint32) (Uint32 '123456)))
+
+# Float -> Integer (fail)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"1e10") (DataType 'Uint32) (Uint32 '123456)))
+
+# Float -> Integer (fail)
+(let world (Apply (bind alterto_module 'doAlterTo) world (Float '"-3.0") (DataType 'Uint32) (Uint32 '123456)))
+
+# Float -> Integer (fail)
+(let inf (/ (Float '"1.0") (Int8 '0)))
+(let world (Apply (bind alterto_module 'doAlterTo) world inf (DataType 'Int64) (Int64 '123456789)))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataIntegralTypes.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataIntegralTypes.yql
new file mode 100644
index 0000000000..746f8f987d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataIntegralTypes.yql
@@ -0,0 +1,37 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Int32->Int16
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int32 '10) (DataType 'Int16) (Int16 '100)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int32 '32768) (DataType 'Int16) (Int16 '101)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int32 '"-32769") (DataType 'Int16) (Int16 '102)))
+
+# Int64->Uint16
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int64 '11) (DataType 'Uint16) (Uint16 '110)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int64 '65536) (DataType 'Uint16) (Uint16 '111)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int64 '"-1") (DataType 'Uint16) (Uint16 '112)))
+
+# Uint32->Int8
+(let world (Apply (bind alterto_module 'doAlterTo) world (Uint32 '12) (DataType 'Int8) (Int8 '120)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Uint32 '128) (DataType 'Int8) (Int8 '121)))
+
+# Uint64->Uint32
+(let world (Apply (bind alterto_module 'doAlterTo) world (Uint64 '13) (DataType 'Uint32) (Uint32 '130)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Uint64 '4294967296) (DataType 'Uint32) (Uint32 '131)))
+
+# Int64->Uint64
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int64 '14) (DataType 'Uint64) (Uint64 '140)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int64 '"-1") (DataType 'Uint64) (Uint64 '141)))
+
+# Int32->Uint32
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int32 '15) (DataType 'Uint32) (Uint32 '150)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Int32 '"-1") (DataType 'Uint32) (Uint32 '151)))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataTypes.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataTypes.yql
new file mode 100644
index 0000000000..fd605370d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDataTypes.yql
@@ -0,0 +1,35 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# String->Utf8
+(let world (Apply (bind alterto_module 'doAlterTo) world (String 'OK) (DataType 'Utf8) (Utf8 'FAIL)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (String '"\xff\xfe") (DataType 'Utf8) (Utf8 'OK)))
+
+# TzDatetime->TzDate
+# 2019-01-09T00:00:00,Europe/Moscow
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzDatetime '"1546981200,Europe/Moscow") (DataType 'TzDate) (TzDate '"1,GMT")))
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzDatetime '"1546981201,Europe/Moscow") (DataType 'TzDate) (TzDate '"2,GMT")))
+
+# TzTimestamp->Date
+# 2019-01-09T00:00:00,GMT
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzTimestamp '"1546992000000000,GMT") (DataType 'Date) (Date '3)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzTimestamp '"1546992000000001,GMT") (DataType 'Date) (Date '4)))
+# 2019-01-09T00:00:00,Europe/Moscow
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzTimestamp '"1546981200000000,Europe/Moscow") (DataType 'Date) (Date '5)))
+# 2019-01-09T03:00:00,Europe/Moscow
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzTimestamp '"1546992000000000,Europe/Moscow") (DataType 'Date) (Date '6)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (TzTimestamp '"1546992000000001,Europe/Moscow") (DataType 'Date) (Date '7)))
+
+# Datetime->Date
+# 2019-01-09T00:00:00Z
+(let world (Apply (bind alterto_module 'doAlterTo) world (Datetime '"1546992000") (DataType 'Date) (Date '8)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Datetime '"1546992001") (DataType 'Date) (Date '9)))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDict.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDict.yql
new file mode 100644
index 0000000000..95377162e7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverDict.yql
@@ -0,0 +1,21 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Dict<Int32, String> -> Dict<Int32, Utf8>
+(let targetType (DictType (DataType 'Int32) (DataType 'Utf8)))
+(let emptyTarget (Dict targetType))
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String 'two)) '((Int32 '3) (String 'three))))
+(let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
+
+# Dict<Int32, String> -> Dict<Int32, Utf8> (fail)
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String '"\xff\xfe")) '((Int32 '3) (String 'three))))
+(let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverList.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverList.yql
new file mode 100644
index 0000000000..6330d3262a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverList.yql
@@ -0,0 +1,29 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# List<Int32> -> List<Uint16> (success)
+(let targetType (ListType (DataType 'Uint16)))
+(let emptyTarget (List targetType))
+(let src (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
+
+# List<Int32> -> List<Uint16> (fail)
+(let targetType (ListType (DataType 'Uint16)))
+(let emptyTarget (List targetType))
+(let src (AsList (Int32 '1) (Int32 '"-2") (Int32 '3)))
+(let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
+
+# List<Int32?> -> List<Uint16> (fail)
+(let targetType (ListType (DataType 'Uint16)))
+(let emptyTarget (List targetType))
+(let src (AsList (Just (Int32 '1)) (Null) (Just (Int32 '3))))
+(let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverNull.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverNull.yql
new file mode 100644
index 0000000000..6039cd0719
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverNull.yql
@@ -0,0 +1,36 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Null -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Null) targetType (Just (Uint16 '12345))))
+
+# Just(Null) -> Null
+(let alterToResult (AlterTo (Just (Null)) (NullType) (lambda '(x) (String 'OK)) (String 'FAIL)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+# Nothing(Null?) -> Null
+(let alterToResult (AlterTo (Nothing (OptionalType (NullType))) (NullType) (lambda '(x) (String 'OK)) (String 'FAIL)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+# Nothing(Uint16?) -> Null
+(let alterToResult (AlterTo (Nothing (OptionalType (DataType 'Uint16))) (NullType) (lambda '(x) (String 'OK)) (String 'FAIL)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+# Null -> Null?
+(let alterToResult (AlterTo (Null) (OptionalType (NullType)) (lambda '(x) (String 'OK)) (String 'FAIL)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverOptional.yql
new file mode 100644
index 0000000000..9141b62154
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverOptional.yql
@@ -0,0 +1,52 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Int32? -> Uint16
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1)) (DataType 'Uint16) (Uint16 '12345)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1000000)) (DataType 'Uint16) (Uint16 '12345)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Nothing (OptionalType (DataType 'Int32))) (DataType 'Uint16) (Uint16 '12345)))
+
+# Int32? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1)) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1000000)) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Nothing (OptionalType (DataType 'Int32))) targetType (Just (Uint16 '12345))))
+
+# Int32? -> Uint16???
+(let targetType (OptionalType (OptionalType (OptionalType (DataType 'Uint16)))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1)) targetType (Just (Just (Just (Uint16 '12345))))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Int32 '1000000)) targetType (Just (Just (Just (Uint16 '12345))))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Nothing (OptionalType (DataType 'Int32))) targetType (Just (Just (Just (Uint16 '12345))))))
+
+# Int32??? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Just (Just (Int32 '1)))) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Just (Just (Int32 '1000000)))) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType (Just (Uint16 '12345))))
+(let world (Apply (bind alterto_module 'doAlterTo) world (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType (Just (Uint16 '12345))))
+
+# Int32? -> Null
+(let targetType (NullType))
+(let alterToResult (AlterTo (Just (Int32 '1)) targetType (lambda '(x) (String '"converted")) (String '"not converted")))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+(let alterToResult (AlterTo (Nothing (OptionalType (DataType 'Int32))) targetType (lambda '(x) (String '"converted")) (String '"not converted")))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+# Int64? -> Null?
+(let targetType (NullType))
+(let alterToResult (AlterTo (Just (Int64 '1)) targetType (lambda '(x) (String '"converted")) (String '"not converted")))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+(let alterToResult (AlterTo (Nothing (OptionalType (DataType 'Int64))) targetType (lambda '(x) (String '"converted")) (String '"not converted")))
+(let world (Write! world res_sink (Key) alterToResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverStruct.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverStruct.yql
new file mode 100644
index 0000000000..6654166a27
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverStruct.yql
@@ -0,0 +1,22 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let targetType (StructType '('"a" (DataType 'Uint8)) '('"b" (DataType 'Utf8))))
+(let failValue (AsStruct '('a (Uint8 '0)) '('b (Utf8 '"not converted"))))
+
+# Struct<Int32, String> -> Struct<Uint8, Utf8>
+(let value (AsStruct '('a (Int32 '1)) '('b (String 'one))))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+# Struct<Int32, String> -> Struct<Uint8, Utf8> (fail)
+(let value (AsStruct '('a (Int32 '"-1")) '('b (String 'one))))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverTuple.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverTuple.yql
new file mode 100644
index 0000000000..3ad49c4744
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverTuple.yql
@@ -0,0 +1,22 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let targetType (TupleType (DataType 'Uint8) (DataType 'Utf8)))
+(let failValue '((Uint8 '0) (Utf8 '"not converted")))
+
+# (Int32, String) -> (Uint8, Utf8)
+(let value '((Int32 '1) (String 'one)))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+# (Int32, String) -> (Uint8, Utf8) (fail)
+(let value '((Int32 '1) (String '"garbage\xff")))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverVariant.yql b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverVariant.yql
new file mode 100644
index 0000000000..020cf59904
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverVariant.yql
@@ -0,0 +1,38 @@
+(
+
+(library "alterto.yql")
+(import alterto_module '"alterto.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+### Tuple
+
+(let srcType (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let targetType (VariantType (TupleType (DataType 'Uint8) (DataType 'Utf8))))
+(let failValue (Variant (Utf8 '"not converted") '1 targetType))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>>
+(let value (Variant (String 'one) '1 srcType))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>> (fail)
+(let value (Variant (String '"garbage\xff") '1 srcType))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+### Struct
+(let srcType (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let targetType (VariantType (StructType '('a (DataType 'Uint8)) '('b (DataType 'Utf8)))))
+(let failValue (Variant (Uint8 '123) 'a targetType))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>>
+(let value (Variant (Int32 '1) 'a srcType))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>> (fail)
+(let value (Variant (Int32 '"-1") 'a srcType))
+(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/DoAlterTo.yql.txt b/yql/essentials/tests/s-expressions/suites/Casts/DoAlterTo.yql.txt
new file mode 100644
index 0000000000..2278581ec9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/DoAlterTo.yql.txt
@@ -0,0 +1,14 @@
+(
+
+(let doAlterTo (lambda '(world src targetType failValue) ( block '(
+ (let res_sink (DataSink 'result))
+ (let identity (lambda '(x) x))
+ (let alterToResult (AlterTo src targetType identity failValue))
+ (let world (Write! world res_sink (Key) alterToResult '('('type))))
+ (let world (Commit! world res_sink))
+ (return world)
+))))
+
+(export doAlterTo)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/HasNullFalse.yql b/yql/essentials/tests/s-expressions/suites/Casts/HasNullFalse.yql
new file mode 100644
index 0000000000..8f253ab7a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/HasNullFalse.yql
@@ -0,0 +1,57 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+
+# Data
+(let value (String 'test))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Int32 '1))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (TzDatetime '"1546981200,Europe/Moscow"))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let valye (/ (Float '1) (Float '0)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Optional
+(let value (Just (Int32 '1)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Tuple
+(let value '((Int32 '1) (String 'test) (Float '1)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value '())
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Struct
+(let value (AsStruct '('a (Int32 '1)) '('b (String 'one))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Struct))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Variant
+(let valueType (VariantType (TupleType (DataType 'Int32) (NullType))))
+(let value (Variant (Int32 '123) '0 valueType))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let valueType (VariantType (StructType '('a (DataType 'Int32)) '('b (OptionalType (DataType 'String))))))
+(let value (Variant (Int32 '1) 'a valueType))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# List
+(let value (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (List (ListType (NullType))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/HasNullTrue.yql b/yql/essentials/tests/s-expressions/suites/Casts/HasNullTrue.yql
new file mode 100644
index 0000000000..a26295ffad
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/HasNullTrue.yql
@@ -0,0 +1,54 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+
+# Optional
+(let value (Nothing (OptionalType (DataType 'Int32))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Just (Nothing (OptionalType (DataType 'Int32)))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Null
+(let value (Null))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Just (Null)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Nothing (OptionalType (NullType))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (Just (Nothing (OptionalType (NullType)))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Tuple
+(let value '((Int32 '1) (String 'test) (Nothing (OptionalType (DataType 'Int32)))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Struct
+(let value (AsStruct '('a (Int32 '1)) '('b (Just (Nothing (OptionalType (DataType 'Int32)))))))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# Variant
+(let valueType (VariantType (TupleType (DataType 'Int32) (NullType))))
+(let value (Variant (Null) '1 valueType))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let valueType (VariantType (StructType '('a (DataType 'Int32)) '('b (OptionalType (DataType 'String))))))
+(let value (Variant (Nothing (OptionalType (DataType 'String))) 'b valueType))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+# List
+(let value (AsList (Null) (Int32 '1) (Int32 '2)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let value (AsList (Int32 '1) (Int32 '2) (Null)))
+(let world (Write! world res_sink (Key) (HasNull value) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverDict.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverDict.yql
new file mode 100644
index 0000000000..6dc4b237c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverDict.yql
@@ -0,0 +1,23 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Dict<Int32, String> -> Dict<Uint8, Utf8> (full)
+(let targetType (DictType (DataType 'Uint8) (DataType 'Utf8)))
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String 'two)) '((Int32 '3) (String 'three))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Dict<Int32, String> -> Dict<Int64, Utf8> (less)
+(let targetType (DictType (DataType 'Int64) (DataType 'Utf8)))
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String '"\xff\xfe")) '((Int32 '3) (String 'three))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverList.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverList.yql
new file mode 100644
index 0000000000..8f00b970d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverList.yql
@@ -0,0 +1,30 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# List<Int32> -> List<Uint16> (full)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# List<Int32> -> List<Uint16> (less)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Int32 '1) (Int32 '-2) (Int32 '3)))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# List<Int32?> -> List<Uint16> (less)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Just (Int32 '1)) (Null) (Just (Int32 '3))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverNull.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverNull.yql
new file mode 100644
index 0000000000..6044a39e4e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverNull.yql
@@ -0,0 +1,38 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Null -> Uint16
+(let cast (SafeCast (Null) (DataType 'Uint16)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Null -> Uint16?
+(let cast (SafeCast (Null) (OptionalType (DataType 'Uint16))))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Just(Null) -> Null
+(let cast (SafeCast (Just (Null)) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Nothing(Null?) -> Null
+(let cast (SafeCast (Nothing (OptionalType (NullType))) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Uint16 -> Null
+(let cast (SafeCast (Uint16 '0) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Nothing(Uint16?) -> Null
+(let cast (SafeCast (Nothing (OptionalType (DataType 'Uint16))) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Null -> Null?
+(let cast (SafeCast (Null) (OptionalType (NullType))))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverOptional.yql
new file mode 100644
index 0000000000..c10d1243e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverOptional.yql
@@ -0,0 +1,76 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Int32? -> Uint16
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (SafeCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (SafeCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32? -> Uint16???
+(let targetType (OptionalType (OptionalType (OptionalType (DataType 'Uint16)))))
+(let cast (SafeCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16??
+(let targetType (OptionalType (OptionalType (DataType 'Uint16))))
+(let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16????
+(let targetType (OptionalType (OptionalType (OptionalType (OptionalType (DataType 'Uint16))))))
+(let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.cfg b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.cfg
new file mode 100644
index 0000000000..ec2b802773
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.cfg
@@ -0,0 +1,2 @@
+res result.txt
+udf yson2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.yql
new file mode 100644
index 0000000000..11fd9ebc30
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverResource.yql
@@ -0,0 +1,22 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+
+(let yson1 (Apply (Udf '"Yson2.Parse") (String '"#") (Just (NamedApply (Udf 'Yson2.Options) '() (AsStruct '('"AutoConvert" (Just (Bool '"false"))) '('"Strict" (Just (Bool '"false"))))))))
+(let yson2 (Apply (Udf '"Yson2.Parse") (String '"[]") (Just (NamedApply (Udf 'Yson2.Options) '() (AsStruct '('"AutoConvert" (Just (Bool '"false"))) '('"Strict" (Just (Bool '"false"))))))))
+
+
+(let targetType (ListType (ResourceType 'Yson2.Node)))
+(let src (AsList (Just yson1) (Just yson2)))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) (Map cast (lambda '(item) (Apply (Udf '"Yson2.Serialize") item))) '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStream.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStream.yql
new file mode 100644
index 0000000000..1ac4fd613e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStream.yql
@@ -0,0 +1,30 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Stream<Int32> -> Stream<Uint16> (full)
+(let targetType (StreamType (DataType 'Uint16)))
+(let src (Iterator (AsList (Int32 '1) (Int32 '2) (Int32 '3))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) (Collect cast) '('('type))))
+
+# Stream<Int32> -> Stream<Uint16> (less)
+(let targetType (StreamType (DataType 'Uint16)))
+(let src (Iterator (AsList (Int32 '1) (Int32 '-2) (Int32 '3))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) (Collect cast) '('('type))))
+
+# Stream<Int32?> -> Stream<Uint16> (less)
+(let targetType (StreamType (DataType 'Uint16)))
+(let src (Iterator (AsList (Just (Int32 '1)) (Null) (Just (Int32 '3)))))
+(let cast (SafeCast src targetType))
+(let world (Write! world res_sink (Key) (Collect cast) '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStruct.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStruct.yql
new file mode 100644
index 0000000000..94bc8b7842
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverStruct.yql
@@ -0,0 +1,23 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Struct<Int32, String, Utf8> -> Struct<Uint8?, Utf8?>
+(let targetType (StructType '('a (OptionalType (DataType 'Uint8))) '('b (OptionalType (DataType 'Utf8)))))
+(let value (AsStruct '('a (Int32 '1)) '('b (String 'one)) '('c (Utf8 'two))))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Struct<Int32, String> -> Struct<Int8, Utf8, Float?>?
+(let targetType (StructType '('a (DataType 'Int8)) '('b (DataType 'Utf8)) '('c (OptionalType (DataType 'Float)))))
+(let value (AsStruct '('a (Int32 '-1)) '('b (String 'one))))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverTuple.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverTuple.yql
new file mode 100644
index 0000000000..33421380cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverTuple.yql
@@ -0,0 +1,39 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let targetType (TupleType (DataType 'Uint8) (DataType 'Utf8)))
+
+# (Int32, String) -> (Uint8, Utf8) [good]
+(let value '((Int32 '1) (String 'one)))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32, String) -> (Uint8, Utf8)? [null]
+(let value '((Int32 '1) (String '"garbage\xff")))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [good]
+(let targetType (TupleType (OptionalType (OptionalType (DataType 'Uint8))) (OptionalType (DataType 'Utf8))))
+(let value '((Just (Int32 '1)) (Just (Nothing (OptionalType (DataType 'String))))))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [null]
+(let value '((Just (Int32 '1)) (Nothing (OptionalType (OptionalType (DataType 'String))))))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [null]
+(let value '((Just (Int32 '-1)) (Just (Nothing (OptionalType (DataType 'String))))))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverVariant.yql b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverVariant.yql
new file mode 100644
index 0000000000..ea34cbd481
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/SafeCastOverVariant.yql
@@ -0,0 +1,39 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+### Tuple
+(let srcType (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let targetType (VariantType (TupleType (DataType 'Uint8) (DataType 'Utf8))))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>>? (good)
+(let value (Variant (String 'one) '1 srcType))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>>? (null)
+(let value (Variant (String '"garbage\xff") '1 srcType))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+### Struct
+(let srcType (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let targetType (VariantType (StructType '('a (DataType 'Uint8)) '('b (DataType 'Utf8)))))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>>? (good)
+(let value (Variant (Int32 '1) 'a srcType))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>>? (null)
+(let value (Variant (Int32 '"-1") 'a srcType))
+(let cast (SafeCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverDict.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverDict.yql
new file mode 100644
index 0000000000..ee7aa8e401
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverDict.yql
@@ -0,0 +1,23 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Dict<Int32, String> -> Dict<Uint8, Utf8> (good)
+(let targetType (DictType (DataType 'Uint8) (DataType 'Utf8)))
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String 'two)) '((Int32 '3) (String 'three))))
+(let cast (StrictCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Dict<Int32, String> -> Dict<Int64, Utf8> (fail)
+(let targetType (DictType (DataType 'Int64) (DataType 'Utf8)))
+(let src (AsDict '((Int32 '1) (String 'one)) '((Int32 '2) (String '"\xff\xfe")) '((Int32 '3) (String 'three))))
+(let cast (StrictCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverList.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverList.yql
new file mode 100644
index 0000000000..146ed0dbe9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverList.yql
@@ -0,0 +1,30 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# List<Int32> -> List<Uint16> (good)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let cast (StrictCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# List<Int32> -> List<Uint16> (fail)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Int32 '1) (Int32 '-2) (Int32 '3)))
+(let cast (StrictCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# List<Int32?> -> List<Uint16> (fail)
+(let targetType (ListType (DataType 'Uint16)))
+(let src (AsList (Just (Int32 '1)) (Null) (Just (Int32 '3))))
+(let cast (StrictCast src targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverNull.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverNull.yql
new file mode 100644
index 0000000000..d7c66842b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverNull.yql
@@ -0,0 +1,30 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Null -> Uint16?
+(let cast (StrictCast (Null) (OptionalType (DataType 'Uint16))))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Just(Null) -> Null? [good]
+(let cast (StrictCast (Just (Null)) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Nothing(Null?) -> Null? [fail]
+(let cast (StrictCast (Nothing (OptionalType (NullType))) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Nothing(Uint16?) -> Null
+(let cast (StrictCast (Nothing (OptionalType (DataType 'Uint16))) (NullType)))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Null -> Null?
+(let cast (StrictCast (Null) (OptionalType (NullType))))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverOptional.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverOptional.yql
new file mode 100644
index 0000000000..28cf793e44
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverOptional.yql
@@ -0,0 +1,76 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Int32? -> Uint16
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (StrictCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (StrictCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32? -> Uint16???
+(let targetType (OptionalType (OptionalType (OptionalType (DataType 'Uint16)))))
+(let cast (StrictCast (Just (Int32 '1)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Int32 '1000000)) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (DataType 'Int32))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16?
+(let targetType (OptionalType (DataType 'Uint16)))
+(let cast (StrictCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16??
+(let targetType (OptionalType (OptionalType (DataType 'Uint16))))
+(let cast (StrictCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Int32??? -> Uint16????
+(let targetType (OptionalType (OptionalType (OptionalType (OptionalType (DataType 'Uint16))))))
+(let cast (StrictCast (Just (Just (Just (Int32 '1)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Just (Int32 '1000000)))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+(let cast (StrictCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverStruct.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverStruct.yql
new file mode 100644
index 0000000000..afa021dd11
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverStruct.yql
@@ -0,0 +1,23 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Struct<Int32, String, Utf8?> -> Struct<Uint8?, Utf8?> (good)
+(let targetType (StructType '('a (OptionalType (DataType 'Uint8))) '('b (OptionalType (DataType 'Utf8)))))
+(let value (AsStruct '('a (Int32 '1)) '('b (String 'one)) '('c (Nothing (OptionalType (DataType 'Utf8))))))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Struct<Int32, String, String?> -> Struct<Int8, Utf8, Float?>? (fail)
+(let targetType (StructType '('a (DataType 'Int8)) '('b (DataType 'Utf8)) '('c (OptionalType (DataType 'Float)))))
+(let value (AsStruct '('a (Int32 '-1)) '('b (String 'one)) '('d (Just (String 'one)))))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverTuple.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverTuple.yql
new file mode 100644
index 0000000000..4f2319f1ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverTuple.yql
@@ -0,0 +1,39 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let targetType (TupleType (DataType 'Uint8) (DataType 'Utf8)))
+
+# (Int32, String) -> (Uint8, Utf8) [good]
+(let value '((Int32 '1) (String 'one)))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32, String) -> (Uint8, Utf8)? [null]
+(let value '((Int32 '1) (String '"garbage\xff")))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [good]
+(let targetType (TupleType (OptionalType (OptionalType (DataType 'Uint8))) (OptionalType (DataType 'Utf8))))
+(let value '((Just (Int32 '1)) (Just (Nothing (OptionalType (DataType 'String))))))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [fail]
+(let value '((Just (Int32 '1)) (Nothing (OptionalType (OptionalType (DataType 'String))))))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# (Int32?, String???) -> (Uint8??, Utf8?)? [fail]
+(let value '((Just (Int32 '-1)) (Just (Nothing (OptionalType (DataType 'String))))))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverVariant.yql b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverVariant.yql
new file mode 100644
index 0000000000..b533e16780
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/StrictCastOverVariant.yql
@@ -0,0 +1,39 @@
+(
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+### Tuple
+(let srcType (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let targetType (VariantType (TupleType (DataType 'Uint8) (DataType 'Utf8))))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>>? (good)
+(let value (Variant (String 'one) '1 srcType))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Variant<Tuple<Int32, String>> -> Variant<Tuple<Uint8, Utf8>>? (null)
+(let value (Variant (String '"garbage\xff") '1 srcType))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+### Struct
+(let srcType (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let targetType (VariantType (StructType '('a (DataType 'Uint8)) '('b (DataType 'Utf8)))))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>>? (good)
+(let value (Variant (Int32 '1) 'a srcType))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+# Variant<Struct<Int32, String>> -> Variant<Struct<Uint8, Utf8>>? (null)
+(let value (Variant (Int32 '"-1") 'a srcType))
+(let cast (StrictCast value targetType))
+(let world (Write! world res_sink (Key) cast '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals.yql b/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals.yql
new file mode 100644
index 0000000000..1bc57c71bf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals.yql
@@ -0,0 +1,55 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+### Tuple
+
+# (Int8?, String?, (Int32, Int64)?) (success)
+(let value '((Just (Int8 '1)) (Just (String 'str)) (Just '((Int32 '2) (Int64 '3)))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# (Int8?, String, (Int32, Int64)?) (success)
+(let value '((Just (Int8 '1)) (String 'str) (Just '((Int32 '2) (Int64 '3)))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# (Int8?, Nothing(String?), (Int32, Int64)?) (fail)
+(let value '((Just (Int8 '1)) (Nothing (OptionalType (DataType 'String))) (Just '((Int32 '2) (Int64 '3)))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# () (success)
+(let value '())
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+
+### Struct
+
+# Struct<Int8?, String?, (Int32, Int64)?> (success)
+(let value (AsStruct '('a (Just (Int8 '1))) '('b (Just (String 'str))) '('c (Just '((Int32 '2) (Int64 '3))))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# Struct<Int8?, String, (Int32, Int64)?> (success)
+(let value (AsStruct '('a (Just (Int8 '1))) '('b (String 'str)) '('c (Just '((Int32 '2) (Int64 '3))))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# Struct<Int8?, Nothing(String?), (Int32, Int64)?> (fail)
+(let value (AsStruct '('a (Just (Int8 '1))) '('b (Nothing (OptionalType (DataType 'String)))) '('c (Just '((Int32 '2) (Int64 '3))))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+# Struct<> (success)
+(let value (Struct))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals2.yql b/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals2.yql
new file mode 100644
index 0000000000..0649383205
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/TryRemoveAllOptionals2.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+### Tuple
+
+# (Int8?, String, (Int32, Int64)?, Just(Nothing(String?)) (success)
+(let value '((Just (Int8 '1)) (String 'str) (Just '((Int32 '2) (Int64 '3))) (Just (Nothing (OptionalType (DataType 'String))))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+### Struct
+
+# Struct<Int8?, String, (Int32, Int64)?> (success)
+(let value (AsStruct '('a (Just (Int8 '1))) '('b (String 'str)) '('c (Just '((Int32 '2) (Int64 '3)))) '('d (Just (Nothing (OptionalType (DataType 'String)))))))
+(let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
+(let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Casts/default.cfg b/yql/essentials/tests/s-expressions/suites/Casts/default.cfg
new file mode 100644
index 0000000000..baa119f7c7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Casts/default.cfg
@@ -0,0 +1,2 @@
+res result.txt
+file alterto.yql DoAlterTo.yql.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Config/DataSinks.yql b/yql/essentials/tests/s-expressions/suites/Config/DataSinks.yql
new file mode 100644
index 0000000000..b1a80a5660
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/DataSinks.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let x (Read! world config (Key '('data_sinks)) '() '()))
+(let world (Left! x))
+(let data (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Config/DataSources.yql b/yql/essentials/tests/s-expressions/suites/Config/DataSources.yql
new file mode 100644
index 0000000000..0621a7e016
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/DataSources.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let x (Read! world config (Key '('data_sources)) '() '()))
+(let world (Left! x))
+(let data (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Config/PureCommit.cfg b/yql/essentials/tests/s-expressions/suites/Config/PureCommit.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/PureCommit.cfg
diff --git a/yql/essentials/tests/s-expressions/suites/Config/PureCommit.yql b/yql/essentials/tests/s-expressions/suites/Config/PureCommit.yql
new file mode 100644
index 0000000000..8578faff3c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/PureCommit.yql
@@ -0,0 +1,5 @@
+(
+#comment
+(let world (Commit! world (DataSink 'yt 'plato)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.cfg b/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.yql b/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.yql
new file mode 100644
index 0000000000..606e06e0e4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/YtNativeRes.yql
@@ -0,0 +1,6 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Config/default.cfg b/yql/essentials/tests/s-expressions/suites/Config/default.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Config/default.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/Copy.yql b/yql/essentials/tests/s-expressions/suites/Dynamic/Copy.yql
new file mode 100644
index 0000000000..9b7882d255
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/Copy.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input1"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/Limit.yql b/yql/essentials/tests/s-expressions/suites/Dynamic/Limit.yql
new file mode 100644
index 0000000000..c7190c8f88
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/Limit.yql
@@ -0,0 +1,15 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input1"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let input (Take input (Int32 '"3")))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Unordered input) '('('type))))
+(let world (Commit! world res_sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/TablePull.yql b/yql/essentials/tests/s-expressions/suites/Dynamic/TablePull.yql
new file mode 100644
index 0000000000..4ba424cb1e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/TablePull.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('table (String 'Input1)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/TableScheme.yql b/yql/essentials/tests/s-expressions/suites/Dynamic/TableScheme.yql
new file mode 100644
index 0000000000..b10df583ba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/TableScheme.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input1)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/default.cfg b/yql/essentials/tests/s-expressions/suites/Dynamic/default.cfg
new file mode 100644
index 0000000000..64df516e6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/default.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt b/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt
new file mode 100644
index 0000000000..c2f900fd7c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="075";"subkey"="4";"value"="abc"};
+{"key"="075";"subkey"="5";"value"="abc"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="800";"subkey"="7";"value"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt.attr
new file mode 100644
index 0000000000..9e3c33c4cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Dynamic/input1.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.yql
new file mode 100644
index 0000000000..00d991912a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendAfterOverride.yql
@@ -0,0 +1,18 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.cfg
new file mode 100644
index 0000000000..48cd4555f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output non_empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.yql
new file mode 100644
index 0000000000..65db044c0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySorted.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.yql
new file mode 100644
index 0000000000..b51c4e8418
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedAfterCommit.yql
@@ -0,0 +1,21 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.cfg
new file mode 100644
index 0000000000..48cd4555f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output non_empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.yql
new file mode 100644
index 0000000000..46099b0328
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDesc.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'false) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.yql
new file mode 100644
index 0000000000..587bc78b08
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedDescAfterCommit.yql
@@ -0,0 +1,21 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'false) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.yql
new file mode 100644
index 0000000000..e9a055f5d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendBySortedInSameCommit.yql
@@ -0,0 +1,19 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.cfg
new file mode 100644
index 0000000000..bffc8451cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.yql
new file mode 100644
index 0000000000..6b7ac4b175
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSorted.yql
@@ -0,0 +1,12 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.yql
new file mode 100644
index 0000000000..4aa7916884
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedAfterCommit.yql
@@ -0,0 +1,21 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.cfg
new file mode 100644
index 0000000000..bffc8451cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.yql
new file mode 100644
index 0000000000..65db044c0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySorted.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.yql
new file mode 100644
index 0000000000..37fb7a1e86
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedBySortedAfterCommit.yql
@@ -0,0 +1,22 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.yql
new file mode 100644
index 0000000000..1b314c3f2e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/AppendToSortedInSameCommit.yql
@@ -0,0 +1,19 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/Bug2318.yql b/yql/essentials/tests/s-expressions/suites/Epochs/Bug2318.yql
new file mode 100644
index 0000000000..5734271142
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/Bug2318.yql
@@ -0,0 +1,26 @@
+#USE plato;
+#INSERT INTO Output WITH TRUNCATE SELECT key FROM Input;
+#COMMIT;
+#INSERT INTO Output WITH TRUNCATE SELECT key FROM CONCAT(Input, Output);
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let read (Read! world source (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
+(let world (Left! read))
+(let input (Right! read))
+(let output (FlatMap input (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key")))))))
+(let world (Write! world sink (Key '('table (String '"Output"))) output '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let read (Read! world source (MrTableConcat (Key '('table (String '"Input"))) (Key '('table (String '"Output")))) '('"key") '()))
+(let world (Left! read))
+(let input (Right! read))
+(let output (FlatMap input (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key")))))))
+(let world (Write! world sink (Key '('table (String '"Output"))) output '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.yql
new file mode 100644
index 0000000000..110b23d6ed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/CopySorted.yql
@@ -0,0 +1,31 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String 'Output))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (> key (String '"020")) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.yql b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.yql
new file mode 100644
index 0000000000..c834415dd1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppend.yql
@@ -0,0 +1,18 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.yql
new file mode 100644
index 0000000000..5803f92df9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/DoubleAppendBySorted.yql
@@ -0,0 +1,20 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/DropTable.yql b/yql/essentials/tests/s-expressions/suites/Epochs/DropTable.yql
new file mode 100644
index 0000000000..ab423f96a3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/DropTable.yql
@@ -0,0 +1,45 @@
+#USE plato;
+#INSERT INTO Output SELECT CAST(key as Int32) as item1, value as item2 FROM Input;
+#COMMIT;
+#DROP TABLE Output;
+#COMMIT;
+#INSERT INTO Output SELECT CAST(key as Int32) as item3, value as item4 FROM Input;
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let conv1 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"item1" (Cast (Member item '"key") 'Int32)))
+ (let res (AddMember res '"item2" (Member item '"value")))
+ (return (AsList res))
+))))
+
+(let conv2 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"item3" (Cast (Member item '"key") 'Int32)))
+ (let res (AddMember res '"item4" (Member item '"value")))
+ (return (AsList res))
+))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv1))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let world (Write! world sink (Key '('table (String 'Output))) (Void) '('('mode 'drop))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv2))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.yql b/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.yql
new file mode 100644
index 0000000000..513c160992
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDoubleOverride.yql
@@ -0,0 +1,18 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.yql b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.yql
new file mode 100644
index 0000000000..27a8f34398
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.yql
@@ -0,0 +1,26 @@
+#USE plato;
+#DROP TABLE Output;
+#INSERT INTO Output SELECT key FROM Input;
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let conv (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member item '"key")))
+ (return (AsList res))
+))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) (Void) '('('mode 'drop))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.yql b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.yql
new file mode 100644
index 0000000000..914cff8c91
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify2.yql
@@ -0,0 +1,27 @@
+#USE plato;
+#INSERT INTO Output SELECT key FROM Input;
+#DROP TABLE Output;
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let conv (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member item '"key")))
+ (return (AsList res))
+))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) (Void) '('('mode 'drop))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.yql b/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.yql
new file mode 100644
index 0000000000..f2047207e7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/FailMixedAppendOverride.yql
@@ -0,0 +1,18 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'append))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.cfg
new file mode 100644
index 0000000000..48cd4555f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output non_empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.yql
new file mode 100644
index 0000000000..f27a896172
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySorted.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.yql
new file mode 100644
index 0000000000..c08723a840
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideBySortedAfterCommit.yql
@@ -0,0 +1,21 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.cfg
new file mode 100644
index 0000000000..bffc8451cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.yql
new file mode 100644
index 0000000000..383a70fad1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSorted.yql
@@ -0,0 +1,12 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.yql
new file mode 100644
index 0000000000..a29f76402f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedAfterCommit.yql
@@ -0,0 +1,21 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world sink (Key '('table (String 'Output))) input '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.cfg
new file mode 100644
index 0000000000..bffc8451cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.yql
new file mode 100644
index 0000000000..b43deb2cd9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDesc.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'false) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.yql
new file mode 100644
index 0000000000..71c6b7ef4f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedBySortedDescAfterCommit.yql
@@ -0,0 +1,22 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'false) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.cfg
new file mode 100644
index 0000000000..50b4461ad2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output sorted_desc.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.yql
new file mode 100644
index 0000000000..f27a896172
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySorted.yql
@@ -0,0 +1,13 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.yql
new file mode 100644
index 0000000000..643a22242b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideSortedDescBySortedAfterCommit.yql
@@ -0,0 +1,22 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'false) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideType.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideType.yql
new file mode 100644
index 0000000000..f9b513d556
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideType.yql
@@ -0,0 +1,52 @@
+#USE plato;
+#INSERT INTO Output SELECT CAST(key as Int32) as item1, value as item2 FROM Input;
+#COMMIT;
+#INSERT INTO Output SELECT CAST(key as Int32) as item1, value as item2 FROM Input;
+#COMMIT;
+#INSERT INTO Output WITH TRUNCATE SELECT CAST(key as Int32) as item3, value as item4 FROM Input;
+
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let conv1 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"item1" (Cast (Member item '"key") 'Int32)))
+ (let res (AddMember res '"item2" (Member item '"value")))
+ (return (AsList res))
+))))
+
+(let conv2 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"item3" (Cast (Member item '"key") 'Int32)))
+ (let res (AddMember res '"item4" (Member item '"value")))
+ (return (AsList res))
+))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv1))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv1))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv2))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'renew))))
+
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/OverrideWithSort.yql b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideWithSort.yql
new file mode 100644
index 0000000000..946c9f2d68
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/OverrideWithSort.yql
@@ -0,0 +1,65 @@
+#USE plato;
+#INSERT INTO Output SELECT COALESCE(CAST(key as Uint64), 0) as age1, value as name1 FROM Input ORDER by age1;
+#COMMIT;
+#INSERT INTO Output WITH TRUNCATE SELECT age1 as age2, name1 as name2 FROM Output WHERE age1 < 100 ORDER BY name2;
+#COMMIT;
+#SELECT * FROM Output where name2 < "zzz";
+
+
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let conv1 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"age1" (Coalesce (Cast (Member item '"key") 'Uint64) (Uint64 '0))))
+ (let res (AddMember res '"name1" (Member item '"value")))
+ (return (AsList res))
+))))
+(let out (FlatMap input conv1))
+(let out (Sort out (Bool 'true) (lambda '(item) (Member item '"age1"))))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let filter (lambda '(item) (block '(
+ (let age (Member item '"age1"))
+ (let res (Coalesce (< age (Uint64 '100)) (Bool 'false)))
+ (return res)
+)
+)))
+(let out (Filter input filter))
+(let conv2 (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"age2" (Member item '"age1")))
+ (let res (AddMember res '"name2" (Member item '"name1")))
+ (return (AsList res))
+))))
+(let out (FlatMap out conv2))
+(let out (Sort out (Bool 'true) (lambda '(item) (Member item '"name2"))))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let filter (lambda '(item) (block '(
+ (let name (Member item '"name2"))
+ (let res (Coalesce (< name (String '"zzz")) (Bool 'false)))
+ (return res)
+)
+)))
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/PredictSort.yql b/yql/essentials/tests/s-expressions/suites/Epochs/PredictSort.yql
new file mode 100644
index 0000000000..b3f57179c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/PredictSort.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (< key (String '"100")) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.cfg
new file mode 100644
index 0000000000..d611f0155e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+out Output2 output2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.yql b/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.yql
new file mode 100644
index 0000000000..f2266e36a6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/ReadFromGrandCommit.yql
@@ -0,0 +1,46 @@
+#USE plato;
+#INSERT INTO Output WITH TRUNCATE SELECT key as a, "value:" || value as b FROM Input;
+#COMMIT;
+#INSERT INTO Output2 WITH TRUNCATE SELECT 1 as x;
+#COMMIT;
+#SELECT * FROM Output;
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let conv (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"a" (Member item '"key")))
+ (let res (AddMember res '"b" (Concat (String '"value:") (Member item '"value"))))
+ (return (AsList res))
+))))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let out (FlatMap input conv))
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let fill (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"x" (Int64 '"1")))
+ (return (AsList res))
+))))
+
+(let out2 (FlatMap (AsList (Void)) fill))
+(let world (Write! world sink (Key '('table (String 'Output2))) out2 '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let world (Write! world result (Key) input '('('type) '('autoref))))
+(let world (Commit! world result))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.yql b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.yql
new file mode 100644
index 0000000000..ecb64cf46c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmaBeforeTableScheme.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource 'yt '$all) 'Attr 'externaltx '"0-0-0-0"))
+(let x (Read! world mr_source
+ (Key '('tablescheme (String '"Input")))
+ (Void) '(
+ '('do_not_fail_on_invalid_schema)
+ '('infer_scheme)
+ )
+))
+(let scheme (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '()))
+(return (Commit! world res_sink))
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmas.yql b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmas.yql
new file mode 100644
index 0000000000..f3c7e35b7d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/ReorderPragmas.yql
@@ -0,0 +1,63 @@
+#USE plato;
+#PRAGMA yt.InferSchema = "1";
+#PRAGMA yt.MaxRowWeight = "128m";
+#INSERT INTO Output
+#select * from Input
+#WHERE key != "0";
+#commit;
+#PRAGMA yt.InferSchema = "3";
+#select * from Input;
+#PRAGMA yt.MaxRowWeight = "128m";
+#PRAGMA yt.InferSchema = "1";
+#select * from Input
+#WHERE key != "0";
+
+(
+(let source (DataSource 'yt 'plato))
+(let source_any (DataSource 'yt '"$all"))
+(let sink (DataSink 'yt 'plato))
+(let result (DataSink 'result))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (!= key (String '"0")) (Bool 'false)))
+ (return res)
+))))
+
+(let out (Filter input filter))
+
+(let world (Write! world sink (Key '('table (String '"Output"))) out '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"3"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let world (Write! world result (Key) input '('('type) '('autoref))))
+(let world (Commit! world result))
+
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type) '('autoref))))
+
+(let world (Commit! world result))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/UseAndOverrideType.yql b/yql/essentials/tests/s-expressions/suites/Epochs/UseAndOverrideType.yql
new file mode 100644
index 0000000000..7980440ada
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/UseAndOverrideType.yql
@@ -0,0 +1,44 @@
+#USE plato;
+#INSERT INTO Output SELECT CAST(key as Int32) as item1, value as item2 FROM Input;
+#COMMIT;
+#INSERT INTO Output WITH TRUNCATE SELECT COALESCE(CAST(item1 as String), "") as key, "." as subkey, item2 as value FROM Output;
+
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let conv (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"item1" (Cast (Member item '"key") 'Int32)))
+ (let res (AddMember res '"item2" (Member item '"value")))
+ (return (AsList res))
+))))
+(let out (FlatMap input conv))
+
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String 'Output))) (Void) '()))
+(let world (Left! r))
+(let out (Right! r))
+
+(let conv (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Coalesce (Cast (Member item '"item1") 'String) (String '""))))
+ (let res (AddMember res '"subkey" (String '".")))
+ (let res (AddMember res '"value" (Member item '"item2")))
+ (return (AsList res))
+
+))))
+(let out (FlatMap out conv))
+
+(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'renew))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/default.cfg b/yql/essentials/tests/s-expressions/suites/Epochs/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/input.txt b/yql/essentials/tests/s-expressions/suites/Epochs/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Epochs/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt b/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt.attr b/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/non_empty.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt b/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt
new file mode 100644
index 0000000000..dd47b9a25e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt.attr b/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt.attr
new file mode 100644
index 0000000000..16aab8884b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/sorted.txt.attr
@@ -0,0 +1,9 @@
+{
+ "_yql_row_spec"={
+ "SortMembers"=["key"];
+ "SortedBy"=["key"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"String"]];
+ "Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt b/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt
new file mode 100644
index 0000000000..ac8e34386d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt
@@ -0,0 +1,4 @@
+{"_yql_column_0"="\xE0\xC7\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="800";"subkey"="2";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="150";"subkey"="4";"value"="qzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt.attr b/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt.attr
new file mode 100644
index 0000000000..903b4c7d93
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Epochs/sorted_desc.txt.attr
@@ -0,0 +1,46 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.cfg
new file mode 100644
index 0000000000..0db7c8a4b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.cfg
@@ -0,0 +1,4 @@
+res result.txt
+in Input1 Bug15491_Input1.txt
+in Input2 Bug15491_Input2.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.yql
new file mode 100644
index 0000000000..89a1e02765
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey1 (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Member item 'key))
+ '('subkey2 (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"key") (Member row '"subkey1"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt
new file mode 100644
index 0000000000..1dc1bcc60b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="021";"subkey"="3";"value"="q"};
+{"key"="151";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt
new file mode 100644
index 0000000000..1dc1bcc60b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="021";"subkey"="3";"value"="q"};
+{"key"="151";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt.attr
new file mode 100644
index 0000000000..e45f964f78
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug15491_Input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "Utf8"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "Utf8"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "Utf8"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.cfg
new file mode 100644
index 0000000000..c828977eed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.cfg
@@ -0,0 +1,4 @@
+res result.txt
+in Input1 Bug1716_Input1.txt
+in Input2 Bug1716_Input2.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.yql
new file mode 100644
index 0000000000..7f37ba29ab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716.yql
@@ -0,0 +1,305 @@
+(
+(let data.source (DataSource 'yt 'plato))
+(let data.sink (DataSink 'yt 'plato))
+
+(let first (String 'Input1))
+(let second (String 'Input2))
+(let output (String 'Output))
+
+(let first.read
+ (Read! world data.source
+ (Key '('table first))
+ (Void)
+ '('('infer_scheme))
+ )
+)
+
+(let world (Left! first.read))
+(let first.read (Right! first.read))
+
+(let second.read
+ (Read! world data.source
+ (Key '('table second))
+ (Void)
+ '('('infer_scheme))
+ )
+)
+
+(let world (Left! second.read))
+(let second.read (Right! second.read))
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('Inner
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('Left
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('Right
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('Full
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('LeftOnly
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('LeftSemi
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('RightOnly
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('RightSemi
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let data
+ (EquiJoin
+ '((RemoveSystemMembers first.read) 'left) '((RemoveSystemMembers second.read) 'right)
+ '('Exclusion
+ 'left
+ 'right
+ # '('left 'id 'left 'id.nonzero 'left 'name 'left 'name.nonzero)
+ '('left 'id 'left 'name)
+ # '('right 'id 'right 'id.nonzero 'right 'name 'right 'name.nonzero)
+ '('right 'id 'right 'name)
+ '('('left 'small) '('right 'small)))
+ '('('flatten))
+ )
+)
+
+(let data
+ (Sort data
+ '((Bool 'true) (Bool 'true))
+ (lambda '(row) '((Member row 'id) (Member row 'name)))
+ )
+)
+
+(let world
+ (Write! world (DataSink 'result)
+ (Key)
+ data
+ '('('type))
+ )
+)
+
+(let world (Commit! world (DataSink 'result)))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt
new file mode 100644
index 0000000000..7138a62f40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt
@@ -0,0 +1,6 @@
+{"field1"="1_1";"field2"="2_1_1";"id"="1";"name"="name_1_1"};
+{"field1"="1_1";"field2"="2_1_2";"id"="1";"name"="name_1_1"};
+{"field1"="1_2";"field2"="2_1_1";"id"="1";"name"="name_1_2"};
+{"field1"="1_2";"field2"="2_1_2";"id"="1";"name"="name_1_2"};
+{"field1"="1_2";"id"="2";"name"="name_2_1"};
+{"field1"="1_3";"id"="3";"name"="name_3_1"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt.attr
new file mode 100644
index 0000000000..54366c43a1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input1.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type" = [ "StructType"; [["field1";["OptionalType";["DataType";"String"]]];["field2";["OptionalType";["DataType";"String"]]];["id";["OptionalType";["DataType";"String"]]];["name";["OptionalType";["DataType";"String"]]]]];"UniqueKeys" = %false}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt
new file mode 100644
index 0000000000..67606ea5fc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt
@@ -0,0 +1,3 @@
+{"field3"="3_1";"id"="1";"name"="name_1_1"};
+{"field3"="3_2";"id"="2";"name"="name_2_1"};
+{"field3"="3_3";"id"="2";"name"="name_2_2"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt.attr
new file mode 100644
index 0000000000..268c3c5a6d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1716_Input2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type" = [ "StructType"; [["field3";["OptionalType";["DataType";"String"]]];["id";["OptionalType";["DataType";"String"]]];["name";["OptionalType";["DataType";"String"]]]]];"UniqueKeys" = %false}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.sql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.sql
new file mode 100644
index 0000000000..b14b63a04a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.sql
@@ -0,0 +1,38 @@
+USE plato;
+
+$hash = (select key as devid, key as mmetric_devid from Input);
+$rutaxi = (select key as DeviceID from Input);
+$device = (select key as devid, key as yuid from Input);
+$cripta = (select key as yuid, value as phones from Input);
+
+$x =
+ (
+ select
+ hash.devid as devid
+ from $rutaxi as rutaxi
+ right semi join $hash as hash
+ on rutaxi.DeviceID = hash.mmetric_devid
+ );
+
+$y =
+ (
+ select
+ device.yuid as yuid
+ from $x as x
+ right semi join $device as device
+ using(devid)
+ );
+
+
+$z =
+ (
+ select
+ cripta.phones as phones
+ from $y as y
+ right semi join $cripta as cripta on
+ y.yuid = cripta.yuid || ""
+ );
+
+select
+ x.phones AS phone
+from $z AS x;
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.yql
new file mode 100644
index 0000000000..2247aa8e0b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug1924.yql
@@ -0,0 +1,117 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"InputSelf")))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (Map (EquiJoin '((block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"DeviceID" (Member row '"key"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"rutaxi") '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"devid" (Member row '"key")) '('"mmetric_devid" (Member row '"key"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"hash") '('RightSemi '"rutaxi" '"hash" '('"rutaxi" '"DeviceID") '('"hash" '"mmetric_devid") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"devid" (Member row '"hash.devid"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"x") '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"devid" (Member row '"key")) '('"yuid" (Member row '"key"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"device") '('RightSemi '"x" '"device" '('"x" '"devid") '('"device" '"devid") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"yuid" (Member row '"device.yuid"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"y") '((Map (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"yuid" (Member row '"key")) '('"phones" (Member row '"value"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) (lambda '(row) (block '(
+ (let row (AddMember row '"_equijoin_column_0" ("Concat" (Member row '"yuid") (String '""))))
+ (return row)
+ )))) '"cripta") '('RightSemi '"y" '"cripta" '('"y" '"yuid") '('"cripta" '"_equijoin_column_0") '()) '()) (lambda '(row) (block '(
+ (let row (ForceRemoveMember row '"cripta._equijoin_column_0"))
+ (return row)
+ )))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"phones" (Member row '"cripta.phones"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"phone" (Member row '"phones"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"phone"))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"phone")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.sql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.sql
new file mode 100644
index 0000000000..b12f694803
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.sql
@@ -0,0 +1,5 @@
+use plato;
+pragma yt.MapJoinLimit="1m";
+$a = (select cast(key as Uint64) as key,subkey from Input1);
+$b = (select cast(key as Uint32) as key,subkey from Input1);
+select * from $a as a join $b as b on a.key = b.key;
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.yql
new file mode 100644
index 0000000000..09a8847b4a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/Bug2566.yql
@@ -0,0 +1,56 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1")))) '('"key" '"subkey") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Cast (Member row '"key") 'Uint64)) '('"subkey" (Member row '"subkey"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"a") '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Cast (Member row '"key") 'Uint32)) '('"subkey" (Member row '"subkey"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/DoAllJoinsExceptCross.yql.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/DoAllJoinsExceptCross.yql.txt
new file mode 100644
index 0000000000..9ef17f1842
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/DoAllJoinsExceptCross.yql.txt
@@ -0,0 +1,48 @@
+(
+
+(let doAllJoinsExceptCross (lambda '(world t1 t2) ( block '(
+
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String t1))) (Void) '()))
+ (let world (Left! x))
+ (let list1 (Right! x))
+
+ (let x (Read! world mr_source (Key '('table (String t2))) (Void) '()))
+ (let world (Left! x))
+ (let list2 (Right! x))
+
+ (let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key) '('b 'key) '()) '()))
+ (let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key) '('b 'key) '()) '()))
+
+ (let sortDir2 '((Bool 'true) (Bool 'true)))
+ (let sortDir1 '((Bool 'true)))
+ (let keySelectorAB (lambda '(row) '((Member row '"a.key") (Member row '"b.key"))))
+ (let keySelectorA (lambda '(row) '((Member row '"a.key"))))
+ (let keySelectorB (lambda '(row) '((Member row '"b.key"))))
+
+ (let res_sink (DataSink 'result))
+ (let world (Write! world res_sink (Key) (Sort joinInner sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeft sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRight sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinFull sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir1 keySelectorA) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir1 keySelectorB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinExclusion sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir1 keySelectorA) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir1 keySelectorB) '('('type))))
+
+ (let world (Commit! world res_sink))
+ (return world)
+
+))))
+
+(export doAllJoinsExceptCross)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiConvertToCommonTypeAlias.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiConvertToCommonTypeAlias.yql
new file mode 100644
index 0000000000..655f2a8207
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiConvertToCommonTypeAlias.yql
@@ -0,0 +1,25 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('a.key1 (Int32 '-1)) '('k.value1 (Int32 '1)) '('k.s (String '"k1")))
+))
+
+(let list2 (AsList
+ (AsStruct '('b.key2 (Uint32 '4294967295)) '('l.value2 (Uint32 '1)) '('l.s (String '"l1")))
+))
+
+(let list3 (AsList
+ (AsStruct '('c.key3 (Int32 '1)) '('m.value3 (Uint16 '1)) '('m.s (String '"m1")))
+))
+
+(let joinInnerInner (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('l 'value2) '('c 'key3) '()) '()))
+
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) joinInnerInner '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiCrossSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiCrossSelfStr.yql
new file mode 100644
index 0000000000..944bb5f6de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiCrossSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Cross '"a" '"b" '() '() '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiExclusionSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiExclusionSelfStr.yql
new file mode 100644
index 0000000000..0b94fa907f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiExclusionSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3OptStr.yql
new file mode 100644
index 0000000000..dc7718c806
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Cross '"a" '"b" '() '() '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3Str.yql
new file mode 100644
index 0000000000..894e36e1b9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullCross3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Cross '"a" '"b" '() '() '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3OptStr.yql
new file mode 100644
index 0000000000..b115bd6907
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3Str.yql
new file mode 100644
index 0000000000..0683a16ba8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullExclusion3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3OptStr.yql
new file mode 100644
index 0000000000..db3690c50a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3Str.yql
new file mode 100644
index 0000000000..2339478283
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullFull3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3OptStr.yql
new file mode 100644
index 0000000000..786062ec45
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3Str.yql
new file mode 100644
index 0000000000..4f4a0eda4d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullInner3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3OptStr.yql
new file mode 100644
index 0000000000..293639aa22
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3Str.yql
new file mode 100644
index 0000000000..5d7c766dc5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeft3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3OptStr.yql
new file mode 100644
index 0000000000..0ed5172d92
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3Str.yql
new file mode 100644
index 0000000000..bb8bb2e523
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftOnly3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3OptStr.yql
new file mode 100644
index 0000000000..c5382a89c2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3Str.yql
new file mode 100644
index 0000000000..0afd1f691e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullLeftSemi3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3OptStr.yql
new file mode 100644
index 0000000000..89ca16a047
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3Str.yql
new file mode 100644
index 0000000000..b5016c4e11
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRight3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3OptStr.yql
new file mode 100644
index 0000000000..d6e1605074
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3Str.yql
new file mode 100644
index 0000000000..97a13fa2b9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3OptStr.yql
new file mode 100644
index 0000000000..a64f8a6705
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3OptStr.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3Str.yql
new file mode 100644
index 0000000000..951e1d462b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightSemi3Str.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Full
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfStr.yql
new file mode 100644
index 0000000000..1d50eb5959
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnNoOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnNoOpt1Opt2Str.yql
new file mode 100644
index 0000000000..af309a36eb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnNoOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1NoOpt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1NoOpt2Str.yql
new file mode 100644
index 0000000000..536807ec3d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1NoOpt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1Opt2Str.yql
new file mode 100644
index 0000000000..cae4788bf3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOptPartial1OptPartial2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOptPartial1OptPartial2Str.yql
new file mode 100644
index 0000000000..08748168f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnOptPartial1OptPartial2Str.yql
@@ -0,0 +1,29 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt1a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Member row 'subkey))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let tableOpt1b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let join (EquiJoin '(tableOpt1a 'a) '(tableOpt1b 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnStr.yql
new file mode 100644
index 0000000000..8f7d2e40d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullSelfTwoColumnStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3OptStr.yql
new file mode 100644
index 0000000000..9f014d1580
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Cross '"a" '"b" '() '() '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3Str.yql
new file mode 100644
index 0000000000..b9c69bf087
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerCross3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Cross '"a" '"b" '() '() '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerDiffIntTypes.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerDiffIntTypes.yql
new file mode 100644
index 0000000000..6d7b8198a6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerDiffIntTypes.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableKVInt64 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Int64) (Int64 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt64 'a) '(tableKVInt 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3OptStr.yql
new file mode 100644
index 0000000000..7f144be37f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3OptStr.yql
@@ -0,0 +1,38 @@
+# ignore runonopt plan diff
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3Str.yql
new file mode 100644
index 0000000000..769cfb1657
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerExclusion3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3OptStr.yql
new file mode 100644
index 0000000000..5b0febe8af
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3Str.yql
new file mode 100644
index 0000000000..b2436aff7f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerFull3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3OptStr.yql
new file mode 100644
index 0000000000..0c12e21175
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3Str.yql
new file mode 100644
index 0000000000..598c2ef4ec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3StrRename.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3StrRename.yql
new file mode 100644
index 0000000000..a3258f553c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerInner3StrRename.yql
@@ -0,0 +1,24 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '())
+ '('('rename '"a.key" 'col1) '('rename '"b.subkey" '"") '('rename '"c.value" 'ccc))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3OptStr.yql
new file mode 100644
index 0000000000..be7f6267c8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3Str.yql
new file mode 100644
index 0000000000..03aa454da5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeft3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3OptStr.yql
new file mode 100644
index 0000000000..5ec5cd9a3f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3OptStr.yql
@@ -0,0 +1,38 @@
+# ignore runonopt plan diff
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3Str.yql
new file mode 100644
index 0000000000..a081fd1505
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftOnly3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3OptStr.yql
new file mode 100644
index 0000000000..eebaf0acbd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3Str.yql
new file mode 100644
index 0000000000..4b40b0c009
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerLeftSemi3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypes.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypes.yql
new file mode 100644
index 0000000000..8a259534c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypes.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableKVInt64 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Int64))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt64 'a) '(tableKVInt 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypesTwoColumn.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypesTwoColumn.yql
new file mode 100644
index 0000000000..9abc122fd9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerOptDiffIntTypesTwoColumn.yql
@@ -0,0 +1,25 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableKVInt64 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Int64))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt64 'a) '(tableKVInt 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3OptStr.yql
new file mode 100644
index 0000000000..b4b825991e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3Str.yql
new file mode 100644
index 0000000000..4e11a1b8c0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRight3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3OptStr.yql
new file mode 100644
index 0000000000..2bf637ce0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3OptStr.yql
@@ -0,0 +1,38 @@
+# ignore runonopt plan diff
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3Str.yql
new file mode 100644
index 0000000000..f1f3eec7ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightOnly3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3OptStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3OptStr.yql
new file mode 100644
index 0000000000..6e5d4d95d0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3OptStr.yql
@@ -0,0 +1,37 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3Str.yql
new file mode 100644
index 0000000000..808c44795b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerRightSemi3Str.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"b" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntSameDiff.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntSameDiff.yql
new file mode 100644
index 0000000000..de061d0050
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntSameDiff.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '666)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '777)))
+ ))
+)))))
+(let tableKVInt1 (Take tableKVInt (Uint64 '6)))
+(let tableKVInt2 (Take tableKVInt (Uint64 '6)))
+(let join (EquiJoin '(tableKVInt1 'a) '(tableKVInt2 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntTakeDiff.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntTakeDiff.yql
new file mode 100644
index 0000000000..479d476017
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfIntTakeDiff.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '666)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '777)))
+ ))
+)))))
+(let tableKVInt1 (Take tableKVInt (Uint64 '6)))
+(let tableKVInt2 (Take tableKVInt (Uint64 '7)))
+(let join (EquiJoin '(tableKVInt1 'a) '(tableKVInt2 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStr.yql
new file mode 100644
index 0000000000..9de2396e4d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStr.yql
@@ -0,0 +1,12 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStrRename.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStrRename.yql
new file mode 100644
index 0000000000..932539b39a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfStrRename.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '())
+ '('('rename '"a.key" 'col1) '('rename '"b.subkey" '""))))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.subkey") (Member row '"a.value"))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnNoOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnNoOpt1Opt2Str.yql
new file mode 100644
index 0000000000..d02d26aafb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnNoOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1NoOpt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1NoOpt2Str.yql
new file mode 100644
index 0000000000..168fab831b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1NoOpt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2Str.yql
new file mode 100644
index 0000000000..110a3b617b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne1.yql
new file mode 100644
index 0000000000..5a9f9ca659
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne1.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let tableOpt3a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('a.key (Just (Member row 'key)))
+ '('a.subkey (Just (Member row 'subkey)))
+ '('a.value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3a '('a)) '(tableOpt3 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne12.yql
new file mode 100644
index 0000000000..0d5b7d1601
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne12.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('a.key (Just (Member row 'key)))
+ '('a.subkey (Just (Member row 'subkey)))
+ '('a.value (Just (Member row 'value)))
+ ))
+)))))
+(let tableOpt3b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('b.key (Just (Member row 'key)))
+ '('b.subkey (Just (Member row 'subkey)))
+ '('b.value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3a '('a)) '(tableOpt3b '('b)) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne2.yql
new file mode 100644
index 0000000000..5d15a2bab8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasOne2.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let tableOpt3b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('b.key (Just (Member row 'key)))
+ '('b.subkey (Just (Member row 'subkey)))
+ '('b.value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3b '('b)) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasTwo.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasTwo.yql
new file mode 100644
index 0000000000..4c2225f7c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOpt1Opt2StrAliasTwo.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('a.key (Just (Member row 'key)))
+ '('a.subkey (Just (Member row 'subkey)))
+ '('c.value (Just (Member row 'value)))
+ ))
+)))))
+(let tableOpt3b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('d.key (Just (Member row 'key)))
+ '('b.subkey (Just (Member row 'subkey)))
+ '('b.value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3a '('a 'c)) '(tableOpt3b '('b 'd)) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOptPartial1OptPartial2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOptPartial1OptPartial2Str.yql
new file mode 100644
index 0000000000..c6d7543ed3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnOptPartial1OptPartial2Str.yql
@@ -0,0 +1,29 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt1a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Member row 'subkey))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let tableOpt1b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let join (EquiJoin '(tableOpt1a 'a) '(tableOpt1b 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnStr.yql
new file mode 100644
index 0000000000..7444baa207
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiInnerSelfTwoColumnStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.cfg
new file mode 100644
index 0000000000..27d3c78b8e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.cfg
@@ -0,0 +1,4 @@
+res result.txt
+file joins.yql DoAllJoinsExceptCross.yql.txt
+in InputInt8 InputInt8.txt
+in InputUint32 InputUint32.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.yql
new file mode 100644
index 0000000000..c07a92aa2a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U32.yql
@@ -0,0 +1,9 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint32))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.cfg
new file mode 100644
index 0000000000..a4a0bb2fd7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.cfg
@@ -0,0 +1,6 @@
+res result.txt
+file joins.yql DoAllJoinsExceptCross.yql.txt
+in InputInt8 InputInt8.txt
+in InputInt8Opt InputInt8Opt.txt
+in InputUint8 InputUint8.txt
+in InputUint8Opt InputUint8Opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.yql
new file mode 100644
index 0000000000..8fdfeda61a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertCommonI8U8.yql
@@ -0,0 +1,12 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint8))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8Opt 'InputUint8))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint8Opt))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8Opt 'InputUint8Opt))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.cfg
new file mode 100644
index 0000000000..27d3c78b8e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.cfg
@@ -0,0 +1,4 @@
+res result.txt
+file joins.yql DoAllJoinsExceptCross.yql.txt
+in InputInt8 InputInt8.txt
+in InputUint32 InputUint32.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.yql
new file mode 100644
index 0000000000..f24772569c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U32.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint32))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.cfg
new file mode 100644
index 0000000000..a4a0bb2fd7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.cfg
@@ -0,0 +1,6 @@
+res result.txt
+file joins.yql DoAllJoinsExceptCross.yql.txt
+in InputInt8 InputInt8.txt
+in InputInt8Opt InputInt8Opt.txt
+in InputUint8 InputUint8.txt
+in InputUint8Opt InputUint8Opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.yql
new file mode 100644
index 0000000000..54c482a624
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiJoinConvertMapI8U8.yql
@@ -0,0 +1,14 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint8))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8Opt 'InputUint8))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8 'InputUint8Opt))
+(let world (Apply (bind join_module 'doAllJoinsExceptCross) world 'InputInt8Opt 'InputUint8Opt))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftOnlySelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftOnlySelfStr.yql
new file mode 100644
index 0000000000..a7593fde40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftOnlySelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfStr.yql
new file mode 100644
index 0000000000..d589fcda91
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnNoOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnNoOpt1Opt2Str.yql
new file mode 100644
index 0000000000..78921fa69b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnNoOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1NoOpt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1NoOpt2Str.yql
new file mode 100644
index 0000000000..09a21c9a81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1NoOpt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1Opt2Str.yql
new file mode 100644
index 0000000000..8f36e81eb5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOptPartial1OptPartial2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOptPartial1OptPartial2Str.yql
new file mode 100644
index 0000000000..25e1eb9240
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnOptPartial1OptPartial2Str.yql
@@ -0,0 +1,29 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt1a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Member row 'subkey))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let tableOpt1b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let join (EquiJoin '(tableOpt1a 'a) '(tableOpt1b 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnStr.yql
new file mode 100644
index 0000000000..c644c56a26
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSelfTwoColumnStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSemiSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSemiSelfStr.yql
new file mode 100644
index 0000000000..e9aaf3442f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiLeftSemiSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfInt.yql
new file mode 100644
index 0000000000..5409c45d54
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableOptKVInt 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfStr.yql
new file mode 100644
index 0000000000..64ba1df974
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12FullSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfInt.yql
new file mode 100644
index 0000000000..ed5b9c6896
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableOptKVInt 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfStr.yql
new file mode 100644
index 0000000000..9ed83ad59e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12InnerSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfInt.yql
new file mode 100644
index 0000000000..4896831f5a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableOptKVInt 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfStr.yql
new file mode 100644
index 0000000000..c7d3ee062d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12LeftSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfInt.yql
new file mode 100644
index 0000000000..69e10681b2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableOptKVInt 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfStr.yql
new file mode 100644
index 0000000000..64ba1df974
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey12RightSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfInt.yql
new file mode 100644
index 0000000000..e664996232
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableKVInt 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfStr.yql
new file mode 100644
index 0000000000..24de4a45d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1FullSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfInt.yql
new file mode 100644
index 0000000000..c2340bb816
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableKVInt 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfStr.yql
new file mode 100644
index 0000000000..9fe63d8ec2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1InnerSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfInt.yql
new file mode 100644
index 0000000000..4cfb26b64e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableKVInt 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfStr.yql
new file mode 100644
index 0000000000..5fa76d8942
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1LeftSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfInt.yql
new file mode 100644
index 0000000000..fed99eefc5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableOptKVInt 'a) '(tableKVInt 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfStr.yql
new file mode 100644
index 0000000000..24de4a45d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey1RightSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfInt.yql
new file mode 100644
index 0000000000..02b042ac3a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt 'a) '(tableOptKVInt 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfStr.yql
new file mode 100644
index 0000000000..ba2798678f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2FullSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfInt.yql
new file mode 100644
index 0000000000..435fdc1a9c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt 'a) '(tableOptKVInt 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfStr.yql
new file mode 100644
index 0000000000..d61db9da69
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2InnerSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfInt.yql
new file mode 100644
index 0000000000..924287c0f9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt 'a) '(tableOptKVInt 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfStr.yql
new file mode 100644
index 0000000000..3d1c3605fc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2LeftSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfInt.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfInt.yql
new file mode 100644
index 0000000000..a2a085a722
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfInt.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOptKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (FromString (Member row 'key) 'Uint32))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (FromString (Member row 'value) 'Uint32))
+ ))
+)))))
+(let tableKVInt (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Coalesce (FromString (Member row 'key) 'Uint32) (Uint32 '888)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Coalesce (FromString (Member row 'value) 'Uint32) (Uint32 '999)))
+ ))
+)))))
+(let join (EquiJoin '(tableKVInt 'a) '(tableOptKVInt 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfStr.yql
new file mode 100644
index 0000000000..ba2798678f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiOptKey2RightSelfStr.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightOnlySelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightOnlySelfStr.yql
new file mode 100644
index 0000000000..b528c14467
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightOnlySelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfStr.yql
new file mode 100644
index 0000000000..76b372e52f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnNoOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnNoOpt1Opt2Str.yql
new file mode 100644
index 0000000000..155db305bc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnNoOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(table 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1NoOpt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1NoOpt2Str.yql
new file mode 100644
index 0000000000..dc0928a52c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1NoOpt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1Opt2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1Opt2Str.yql
new file mode 100644
index 0000000000..0d550e7db3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOpt1Opt2Str.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt3 (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))
+ ))
+)))))
+(let join (EquiJoin '(tableOpt3 'a) '(tableOpt3 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOptPartial1OptPartial2Str.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOptPartial1OptPartial2Str.yql
new file mode 100644
index 0000000000..9d539854bd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnOptPartial1OptPartial2Str.yql
@@ -0,0 +1,29 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableOpt1a (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Member row 'subkey))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let tableOpt1b (Map table (lambda '(row) (block '(
+ (return (AsStruct
+ '('key (Member row 'key))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Member row 'value))
+ ))
+)))))
+
+(let join (EquiJoin '(tableOpt1a 'a) '(tableOpt1b 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnStr.yql
new file mode 100644
index 0000000000..5a6ff8cd0f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSelfTwoColumnStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSemiSelfStr.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSemiSelfStr.yql
new file mode 100644
index 0000000000..71c2d26461
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiRightSemiSelfStr.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/ExtractRenameFromFlatMapOverJoin.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/ExtractRenameFromFlatMapOverJoin.yql
new file mode 100644
index 0000000000..33f059a964
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/ExtractRenameFromFlatMapOverJoin.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int32 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int32 '8)) '('value2 (String 'V)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let list (Map joinInner (lambda '(x) (block '(
+ (return (AsStruct
+ '('"a.key1" (Member x '"a.key1"))
+ '('"q" (Member x '"a.value1"))
+ '('"f.value2" (Member x '"b.value2"))
+ ))
+)))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list '('('type))))
+
+(let joinInner2 (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '())
+ '('('rename '"a.key1" 'z) '('rename '"b.key2" '""))))
+(let list2 (Map joinInner2 (lambda '(x) (block '(
+ (return (AsStruct
+ '('"yy" (Member x '"z"))
+ '('"q" (Member x '"b.value2"))
+ ))
+)))))
+
+(let world (Write! world res_sink (Key) list2 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner.yql
new file mode 100644
index 0000000000..dee596e70a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey1 (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey2 (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"key") (Member row '"subkey1"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner3.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner3.yql
new file mode 100644
index 0000000000..ded633225d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInner3.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey1 (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey2 (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey3 (Just (Member item 'subkey)))
+ '('value3 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key" ) '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInnerTwoColumns.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInnerTwoColumns.yql
new file mode 100644
index 0000000000..4cbe3482ed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenInnerTwoColumns.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"key") (Member row '"subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.cfg
new file mode 100644
index 0000000000..8402f5cd5f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.cfg
@@ -0,0 +1,3 @@
+res result.txt
+in Input4 input4.txt
+in Input5 input5.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.yql
new file mode 100644
index 0000000000..9533ee9fb8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeft.yql
@@ -0,0 +1,26 @@
+(
+ (let data.source (DataSource 'yt 'plato))
+ (let data.sink (DataSink 'yt 'plato))
+ (let input_left (Read! world data.source (Key '('table (String 'Input4))) (Void) '()))
+ (let world (Left! input_left))
+ (let input_left (Right! input_left))
+
+ (let input_right (Read! world data.source (Key '('table (String 'Input5))) (Void) '()))
+ (let world (Left! input_right))
+ (let input_right (Right! input_right))
+
+ (let output (EquiJoin '((RemoveSystemMembers input_left) 'left) '((RemoveSystemMembers input_right) 'right)
+ '('Left 'left 'right '('left 'id) '('right 'id) '()) '('('flatten))
+ ))
+
+ (let output (Map output (lambda '(item) (block '(
+ (let item (AddMember item 'val (String '"")))
+ (return item)
+ )))))
+
+ (let res_sink (DataSink 'result))
+ (let world (Write! world res_sink (Key) output '('('type))))
+ (let world (Commit! world res_sink))
+
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi.yql
new file mode 100644
index 0000000000..2b3166643e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey1 (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey2 (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"key") (Member row '"subkey1"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi3.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi3.yql
new file mode 100644
index 0000000000..4572699337
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/FlattenLeftSemi3.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey1 (Just (Member item 'subkey)))
+ '('value1 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey2 (Just (Member item 'subkey)))
+ '('value2 (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+(let table3 (Map table3 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey3 (Just (Member item 'subkey)))
+ '('value3 (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key" ) '())
+ '('('flatten))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoin.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoin.yql
new file mode 100644
index 0000000000..d0c8c821b6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoin.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (String '1)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '(
+ '('left 'small)
+ ))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoinFat.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoinFat.yql
new file mode 100644
index 0000000000..94718f84d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftSmallInnerJoinFat.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (String '1)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (String '800)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '(
+ '('left 'small)
+ ))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftUniqueRightMap.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftUniqueRightMap.yql
new file mode 100644
index 0000000000..d77b848dc7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintLeftUniqueRightMap.yql
@@ -0,0 +1,29 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '('('left 'unique)))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoin.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoin.yql
new file mode 100644
index 0000000000..6e842ae76b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoin.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (String '1)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '(
+ '('right 'small)
+ ))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoinFat.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoinFat.yql
new file mode 100644
index 0000000000..c9e4a7e0f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightSmallInnerJoinFat.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (String '800)))
+ '('subkey (Just (String '1)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '(
+ '('right 'small)
+ ))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueInnerMap.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueInnerMap.yql
new file mode 100644
index 0000000000..16a90e3314
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueInnerMap.yql
@@ -0,0 +1,29 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '('('right 'unique)))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftMap.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftMap.yql
new file mode 100644
index 0000000000..a3e4e456ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftMap.yql
@@ -0,0 +1,29 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '('('right 'unique)))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftSemiShardedMap.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftSemiShardedMap.yql
new file mode 100644
index 0000000000..c726a4c417
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/HintRightUniqueLeftSemiShardedMap.yql
@@ -0,0 +1,30 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"150"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinshardcount" '"2"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Map table1 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let table2 (Map table2 (lambda '(item) (AsStruct
+ '('key (Just (Member item 'key)))
+ '('subkey (Just (Member item 'subkey)))
+ '('value (Just (Member item 'value)))))))
+
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '('('right 'unique)))
+ '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.cfg
new file mode 100644
index 0000000000..3673712415
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.cfg
@@ -0,0 +1,3 @@
+res result.txt
+in Input InputSelf.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.yql
new file mode 100644
index 0000000000..707b389f4b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InOutSettings.yql
@@ -0,0 +1,26 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let tableLeft (Right! x))
+
+(let sorted (Sort tableLeft (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world mr_sink))
+
+(let x (Read! world mr_source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! x))
+(let tableRight (Right! x))
+
+(let tableLeft (Take tableLeft (Uint64 '3)))
+(let tableRight (Filter tableRight (lambda '(item) (Coalesce (< (Member item '"key") (String '"100")) (Bool 'false)))))
+
+(let join (EquiJoin '(tableLeft 'a) '(tableRight 'b) '('Inner '"a" '"b" '('"a" '"value") '('"b" '"value" ) '()) '()))
+(let join (Sort join (Bool 'true) (lambda '(item) (Member item '"a.key"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Take join (Uint64 '2)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt
new file mode 100644
index 0000000000..c059f46f5b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt
@@ -0,0 +1,5 @@
+{"key"=-1;"value"="Int8_a"};
+{"key"=127;"value"="Int8_b"};
+{"key"=0;"value"="Int8_c"};
+{"key"=1;"value"="Int8_d"};
+{"key"=2;"value"="Int8_e"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt.attr
new file mode 100644
index 0000000000..d89274ff75
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int8"]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt
new file mode 100644
index 0000000000..53ffddbb48
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt
@@ -0,0 +1,5 @@
+{"key"=-1;"value"="Int8Opt_a"};
+{"key"=127;"value"="Int8Opt_b"};
+{"key"=0;"value"="Int8Opt_c"};
+{"key"=1;"value"="Int8Opt_d"};
+{"key"=2;"value"="Int8Opt_e"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt.attr
new file mode 100644
index 0000000000..cbb7ba3fd9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputInt8Opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Int8"]]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt
new file mode 100644
index 0000000000..8ed0317c19
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="075"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="023"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt
new file mode 100644
index 0000000000..cf8cf7a1e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"="1";"value"="7"};
+{"key"="x911";"subkey"="2";"value"="6"};
+{"key"="x023";"subkey"="3";"value"="3"};
+{"key"="x527";"subkey"="4";"value"="x023"};
+{"key"="x037";"subkey"="5";"value"="075"};
+{"key"="x761";"subkey"="6";"value"="2"};
+{"key"="x200";"subkey"="7";"value"="075"};
+{"key"="150";"subkey"="8";"value"="2"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputSelf2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt
new file mode 100644
index 0000000000..5508f63735
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt
@@ -0,0 +1,5 @@
+{"key"=255u;"value"="Uint32_a"};
+{"key"=383u;"value"="Uint32_b"};
+{"key"=0u;"value"="Uint32_c"};
+{"key"=1u;"value"="Uint32_d"};
+{"key"=2u;"value"="Uint32_e"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt.attr
new file mode 100644
index 0000000000..5ba9847c97
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint32.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt
new file mode 100644
index 0000000000..96864d084c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt
@@ -0,0 +1,5 @@
+{"key"=255u;"value"="Uint8_a"};
+{"key"=127u;"value"="Uint8_b"};
+{"key"=0u;"value"="Uint8_c"};
+{"key"=1u;"value"="Uint8_d"};
+{"key"=2u;"value"="Uint8_e"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt.attr
new file mode 100644
index 0000000000..8d7e3bcc24
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint8"]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt
new file mode 100644
index 0000000000..3468f1080f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt
@@ -0,0 +1,5 @@
+{"key"=255u;"value"="Uint8Opt_a"};
+{"key"=127u;"value"="Uint8Opt_b"};
+{"key"=0u;"value"="Uint8Opt_c"};
+{"key"=1u;"value"="Uint8Opt_d"};
+{"key"=2u;"value"="Uint8Opt_e"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt.attr
new file mode 100644
index 0000000000..e3b512108c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/InputUint8Opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Uint8"]]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem.yql
new file mode 100644
index 0000000000..59f07eb137
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem.yql
@@ -0,0 +1,42 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Uint64 '2)) '('value2 (String 'U)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'W)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3.yql
new file mode 100644
index 0000000000..6245dd77bd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3.yql
@@ -0,0 +1,79 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int32 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int32 '8)) '('value2 (String 'V)))
+))
+
+(let list3 (AsList
+ (AsStruct '('key3 (Int32 '1)) '('value3 (String 'G)))
+ (AsStruct '('key3 (Int32 '4)) '('value3 (String 'H)))
+ (AsStruct '('key3 (Int32 '2)) '('value3 (String 'I)))
+ (AsStruct '('key3 (Int32 '3)) '('value3 (String 'J)))
+ (AsStruct '('key3 (Int32 '3)) '('value3 (String 'K)))
+))
+
+(let joinInnerInner (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeft (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Left 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerRight (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Right 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerFull (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Full 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinInnerRightOnly (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerExclusion (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinInnerRightSemi (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerCross (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Cross 'a 'b '() '() '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+
+(let joinFullInner (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeft (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Left 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullRight (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Right 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullFull (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Full 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinFullRightOnly (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullExclusion (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinFullRightSemi (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullCross (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Full '('Cross 'a 'b '() '() '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+
+(let joinCrossCross (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Cross '('Cross 'a 'b '() '() '()) 'c '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInnerInner '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeft '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRight '('('type))))
+(let world (Write! world res_sink (Key) joinInnerFull '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinInnerExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinInnerCross '('('type))))
+
+(let world (Write! world res_sink (Key) joinFullInner '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeft '('('type))))
+(let world (Write! world res_sink (Key) joinFullRight '('('type))))
+(let world (Write! world res_sink (Key) joinFullFull '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinFullRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinFullExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinFullRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinFullCross '('('type))))
+
+(let world (Write! world res_sink (Key) joinCrossCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Alias12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Alias12.yql
new file mode 100644
index 0000000000..0063b7b7ef
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Alias12.yql
@@ -0,0 +1,71 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('a.key1 (Int32 '1)) '('k.value1 (String 'A)))
+ (AsStruct '('a.key1 (Int32 '7)) '('k.value1 (String 'B)))
+ (AsStruct '('a.key1 (Int32 '4)) '('k.value1 (String 'C)))
+ (AsStruct '('a.key1 (Int32 '4)) '('k.value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('b.key2 (Int32 '9)) '('l.value2 (String 'Z)))
+ (AsStruct '('b.key2 (Int32 '4)) '('l.value2 (String 'Y)))
+ (AsStruct '('b.key2 (Int32 '3)) '('l.value2 (String 'X)))
+ (AsStruct '('b.key2 (Int32 '4)) '('l.value2 (String 'W)))
+ (AsStruct '('b.key2 (Int32 '8)) '('l.value2 (String 'V)))
+))
+
+(let list3 (AsList
+ (AsStruct '('c.key3 (Int32 '1)) '('m.value3 (String 'G)))
+ (AsStruct '('c.key3 (Int32 '4)) '('m.value3 (String 'H)))
+ (AsStruct '('c.key3 (Int32 '2)) '('m.value3 (String 'I)))
+ (AsStruct '('c.key3 (Int32 '3)) '('m.value3 (String 'J)))
+ (AsStruct '('c.key3 (Int32 '3)) '('m.value3 (String 'K)))
+))
+
+(let joinInnerInner (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeft (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Left 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerRight (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Right 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerFull (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Full 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeftOnly (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinInnerRightOnly (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerExclusion (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinInnerLeftSemi (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinInnerRightSemi (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Inner '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+
+(let joinFullInner (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeft (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('Left 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullRight (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('Right 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullFull (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('Full 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeftOnly (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinFullRightOnly (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullExclusion (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+(let joinFullLeftSemi (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('a 'key1) '('c 'key3) '()) '()))
+(let joinFullRightSemi (EquiJoin '(list1 '('a 'k)) '(list2 '('b 'l)) '(list3 '('c 'm)) '('Full '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInnerInner '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeft '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRight '('('type))))
+(let world (Write! world res_sink (Key) joinInnerFull '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinInnerExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinInnerLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinInnerRightSemi '('('type))))
+
+(let world (Write! world res_sink (Key) joinFullInner '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeft '('('type))))
+(let world (Write! world res_sink (Key) joinFullRight '('('type))))
+(let world (Write! world res_sink (Key) joinFullFull '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinFullRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinFullExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinFullLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinFullRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Rename.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Rename.yql
new file mode 100644
index 0000000000..7807ba6e08
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMem3Rename.yql
@@ -0,0 +1,36 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int32 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int32 '8)) '('value2 (String 'V)))
+))
+
+(let list3 (AsList
+ (AsStruct '('key3 (Int32 '1)) '('value3 (String 'G)))
+ (AsStruct '('key3 (Int32 '4)) '('value3 (String 'H)))
+ (AsStruct '('key3 (Int32 '2)) '('value3 (String 'I)))
+ (AsStruct '('key3 (Int32 '3)) '('value3 (String 'J)))
+ (AsStruct '('key3 (Int32 '3)) '('value3 (String 'K)))
+))
+
+(let joinInnerInner (EquiJoin '(list1 'a) '(list2 'b) '(list3 'c) '('Inner '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 'c '('b 'key2) '('c 'key3) '())
+'('('rename '"a.key1" 'col1) '('rename '"b.value2" '"") '('rename '"c.key3" 'ccc))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInnerInner '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne1.yql
new file mode 100644
index 0000000000..549fa2d302
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne1.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('a.key1 (Just (Int32 '1))) '('a.value1 (Just (String 'A))))
+ (AsStruct '('a.key1 (Just (Int32 '7))) '('a.value1 (Just (String 'B))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('a.value1 (Just (String 'C))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('a.value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Just (Int32 '9))) '('value2 (Just (String 'Z))))
+ (AsStruct '('key2 (Just (Int32 '4))) '('value2 (Just (String 'Y))))
+ (AsStruct '('key2 (Just (Int32 '3))) '('value2 (Just (String 'X))))
+ (AsStruct '('key2 (Just (Int32 '4))) '('value2 (Just (String 'W))))
+ (AsStruct '('key2 (Just (Int32 '8))) '('value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 '('a)) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 '('a)) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 '('a)) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 '('a)) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 '('a)) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 '('a)) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 '('a)) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 '('a)) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 '('a)) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne12.yql
new file mode 100644
index 0000000000..50ee09cda0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne12.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('a.key1 (Just (Int32 '1))) '('a.value1 (Just (String 'A))))
+ (AsStruct '('a.key1 (Just (Int32 '7))) '('a.value1 (Just (String 'B))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('a.value1 (Just (String 'C))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('a.value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('b.key2 (Just (Int32 '9))) '('b.value2 (Just (String 'Z))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('b.value2 (Just (String 'Y))))
+ (AsStruct '('b.key2 (Just (Int32 '3))) '('b.value2 (Just (String 'X))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('b.value2 (Just (String 'W))))
+ (AsStruct '('b.key2 (Just (Int32 '8))) '('b.value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 '('a)) '(list2 '('b)) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 '('a)) '(list2 '('b)) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 '('a)) '(list2 '('b)) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 '('a)) '(list2 '('b)) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 '('a)) '(list2 '('b)) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 '('a)) '(list2 '('b)) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 '('a)) '(list2 '('b)) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 '('a)) '(list2 '('b)) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 '('a)) '(list2 '('b)) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne2.yql
new file mode 100644
index 0000000000..374fafce96
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasOne2.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))))
+ (AsStruct '('key1 (Just (Int32 '7))) '('value1 (Just (String 'B))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'C))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('b.key2 (Just (Int32 '9))) '('b.value2 (Just (String 'Z))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('b.value2 (Just (String 'Y))))
+ (AsStruct '('b.key2 (Just (Int32 '3))) '('b.value2 (Just (String 'X))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('b.value2 (Just (String 'W))))
+ (AsStruct '('b.key2 (Just (Int32 '8))) '('b.value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 '('b)) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 '('b)) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 '('b)) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 '('b)) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 '('b)) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 '('b)) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 '('b)) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 '('b)) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 '('b)) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasTwo12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasTwo12.yql
new file mode 100644
index 0000000000..e9c47c9c76
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemAliasTwo12.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('a.key1 (Just (Int32 '1))) '('c.value1 (Just (String 'A))))
+ (AsStruct '('a.key1 (Just (Int32 '7))) '('c.value1 (Just (String 'B))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('c.value1 (Just (String 'C))))
+ (AsStruct '('a.key1 (Just (Int32 '4))) '('c.value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('b.key2 (Just (Int32 '9))) '('d.value2 (Just (String 'Z))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('d.value2 (Just (String 'Y))))
+ (AsStruct '('b.key2 (Just (Int32 '3))) '('d.value2 (Just (String 'X))))
+ (AsStruct '('b.key2 (Just (Int32 '4))) '('d.value2 (Just (String 'W))))
+ (AsStruct '('b.key2 (Just (Int32 '8))) '('d.value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 '('a 'c)) '(list2 '('b 'd)) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemDiffIntTypes.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemDiffIntTypes.yql
new file mode 100644
index 0000000000..ef2ce92878
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemDiffIntTypes.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Uint64 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Uint64 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Uint64 '8)) '('value2 (String 'V)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1.yql
new file mode 100644
index 0000000000..7e0a5a7fc2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1.yql
@@ -0,0 +1,45 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'C))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'D))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'E))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'F))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'G))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Uint64 '2)) '('value2 (String 'U)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Uint64 '4)) '('value2 (String 'W)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1Opt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1Opt2.yql
new file mode 100644
index 0000000000..759d3983ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt1Opt2.yql
@@ -0,0 +1,48 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'C))))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (Just (String 'D))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'E))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'F))))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (Just (String 'G))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Just (Uint64 '2))) '('value2 (Just (String 'U))))
+ (AsStruct '('key2 (Just (Uint64 '4))) '('value2 (Just (String 'Y))))
+ (AsStruct '('key2 (Just (Uint64 '4))) '('value2 (Just (String 'W))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'P))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'Q))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'R))))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt2.yql
new file mode 100644
index 0000000000..861a63112f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemOpt2.yql
@@ -0,0 +1,45 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Just (Uint64 '2))) '('value2 (Just (String 'U))))
+ (AsStruct '('key2 (Just (Uint64 '4))) '('value2 (Just (String 'Y))))
+ (AsStruct '('key2 (Just (Uint64 '4))) '('value2 (Just (String 'W))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'P))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'Q))))
+ (AsStruct '('key2 (Nothing (OptionalType (DataType 'Uint64)))) '('value2 (Just (String 'R))))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemRename.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemRename.yql
new file mode 100644
index 0000000000..14636284d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemRename.yql
@@ -0,0 +1,28 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
+ (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int32 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int32 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int32 '8)) '('value2 (String 'V)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '())
+ '('('rename '"a.key1" 'q) '('rename '"b.value2" '""))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumns.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumns.yql
new file mode 100644
index 0000000000..0b21ecc24d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumns.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1a (Int32 '1)) '('key1b (Uint32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1a (Int32 '7)) '('key1b (Uint32 '1)) '('value1 (String 'B)))
+ (AsStruct '('key1a (Int32 '4)) '('key1b (Uint32 '2)) '('value1 (String 'C)))
+ (AsStruct '('key1a (Int32 '4)) '('key1b (Uint32 '2)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2a (Int32 '9)) '('key2b (Uint32 '3)) '('value2 (String 'Z)))
+ (AsStruct '('key2a (Int32 '4)) '('key2b (Uint32 '2)) '('value2 (String 'Y)))
+ (AsStruct '('key2a (Int32 '3)) '('key2b (Uint32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2a (Int32 '4)) '('key2b (Uint32 '2)) '('value2 (String 'W)))
+ (AsStruct '('key2a (Int32 '8)) '('key2b (Uint32 '1)) '('value2 (String 'V)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1.yql
new file mode 100644
index 0000000000..66060097b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1.yql
@@ -0,0 +1,41 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1a (Just (Int32 '1))) '('key1b (Just (Uint32 '1))) '('value1 (Just (String 'A))))
+ (AsStruct '('key1a (Just (Int32 '7))) '('key1b (Just (Uint32 '1))) '('value1 (Just (String 'B))))
+ (AsStruct '('key1a (Just (Int32 '4))) '('key1b (Just (Uint32 '2))) '('value1 (Just (String 'C))))
+ (AsStruct '('key1a (Just (Int32 '4))) '('key1b (Just (Uint32 '2))) '('value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2a (Int32 '9)) '('key2b (Uint32 '3)) '('value2 (String 'Z)))
+ (AsStruct '('key2a (Int32 '4)) '('key2b (Uint32 '2)) '('value2 (String 'Y)))
+ (AsStruct '('key2a (Int32 '3)) '('key2b (Uint32 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2a (Int32 '4)) '('key2b (Uint32 '2)) '('value2 (String 'W)))
+ (AsStruct '('key2a (Int32 '8)) '('key2b (Uint32 '1)) '('value2 (String 'V)))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1Opt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1Opt2.yql
new file mode 100644
index 0000000000..15834403dd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt1Opt2.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1a (Just (Int32 '1))) '('key1b (Just (Uint32 '1))) '('value1 (Just (String 'A))))
+ (AsStruct '('key1a (Just (Int32 '7))) '('key1b (Just (Uint32 '1))) '('value1 (Just (String 'B))))
+ (AsStruct '('key1a (Just (Int32 '4))) '('key1b (Just (Uint32 '2))) '('value1 (Just (String 'C))))
+ (AsStruct '('key1a (Just (Int32 '4))) '('key1b (Just (Uint32 '2))) '('value1 (Just (String 'D))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2a (Just (Int32 '9))) '('key2b (Just (Uint32 '3))) '('value2 (Just (String 'Z))))
+ (AsStruct '('key2a (Just (Int32 '4))) '('key2b (Just (Uint32 '2))) '('value2 (Just (String 'Y))))
+ (AsStruct '('key2a (Just (Int32 '3))) '('key2b (Just (Uint32 '3))) '('value2 (Just (String 'X))))
+ (AsStruct '('key2a (Just (Int32 '4))) '('key2b (Just (Uint32 '2))) '('value2 (Just (String 'W))))
+ (AsStruct '('key2a (Just (Int32 '8))) '('key2b (Just (Uint32 '1))) '('value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt2.yql
new file mode 100644
index 0000000000..0ddee9815b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemTwoColumnsOpt2.yql
@@ -0,0 +1,43 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ (AsStruct '('key1a (Int32 '1)) '('key1b (Uint32 '1)) '('value1 (String 'A)))
+ (AsStruct '('key1a (Int32 '7)) '('key1b (Uint32 '1)) '('value1 (String 'B)))
+ (AsStruct '('key1a (Int32 '4)) '('key1b (Uint32 '2)) '('value1 (String 'C)))
+ (AsStruct '('key1a (Int32 '4)) '('key1b (Uint32 '2)) '('value1 (String 'D)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2a (Just (Int32 '9))) '('key2b (Just (Uint32 '3))) '('value2 (Just (String 'Z))))
+ (AsStruct '('key2a (Just (Int32 '4))) '('key2b (Just (Uint32 '2))) '('value2 (Just (String 'Y))))
+ (AsStruct '('key2a (Just (Int32 '3))) '('key2b (Just (Uint32 '3))) '('value2 (Just (String 'X))))
+ (AsStruct '('key2a (Just (Int32 '4))) '('key2b (Just (Uint32 '2))) '('value2 (Just (String 'W))))
+ (AsStruct '('key2a (Just (Int32 '8))) '('key2b (Just (Uint32 '1))) '('value2 (Just (String 'V))))
+))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1a 'a 'key1b) '('b 'key2a 'b 'key2b) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinFull '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinExclusion '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.cfg
new file mode 100644
index 0000000000..137266b187
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.cfg
@@ -0,0 +1,2 @@
+res result.txt
+in Input SelfJoinLimit1.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt
new file mode 100644
index 0000000000..717bdfe825
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt
@@ -0,0 +1,3 @@
+{"key"="1";"subkey"="1";"value"="3"};
+{"key"="2";"subkey"="2";"value"="1"};
+{"key"="3";"subkey"="3";"value"="2"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.yql
new file mode 100644
index 0000000000..f142bfd3d6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinLimit1.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let table (Take table (Uint64 '2)))
+(let join (EquiJoin '(table 'a) '(table 'b)
+'('Inner '"a" '"b" '('"a" '"key") '('"b" '"value") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinMergeFields.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinMergeFields.yql
new file mode 100644
index 0000000000..e5a08be9c9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SelfJoinMergeFields.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+'('Inner '"a" '"b" '('"a" '"key") '('"b" '"value") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/SqlInToJoin.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/SqlInToJoin.yql
new file mode 100644
index 0000000000..46ad794a8b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/SqlInToJoin.yql
@@ -0,0 +1,59 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+
+
+(let list1 (AsList
+ (AsStruct '('k (String '800)))
+ (AsStruct '('k (String '020)))
+))
+
+(let list2 (AsList
+ (AsStruct '('k (String '020)))
+ (AsStruct '('k (String '800)))
+))
+
+(let list3 (AsList
+ (AsStruct '('k (String '021)))
+ (AsStruct '('k (String '800)))
+))
+
+
+(let filtered1 (FlatMap table1 (lambda '(item)
+ (OptionalIf (SqlIn list1 (Member item 'key) '('('tableSource)))
+ (AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey))))
+)))
+
+(let filtered2 (FlatMap table2 (lambda '(item) (block '(
+ (let sqlInPred (SqlIn list2 (Member item 'key) '('('tableSource))))
+ (return (OptionalIf (And sqlInPred (NotEqual (Member item 'value) (String 'ddd)))
+ (AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey)))))
+ ))
+)))
+
+(let filtered3 (FlatMap table3 (lambda '(item) (block '(
+ (let sqlInPred (SqlIn list3 (Member item 'key) '('('tableSource))))
+ (return (OptionalIf (And (NotEqual (Member item 'value) (String 'q)) sqlInPred)
+ (AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey)))))
+ ))
+)))
+
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort filtered1 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
+(let world (Write! world res_sink (Key) (Sort filtered2 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
+(let world (Write! world res_sink (Key) (Sort filtered3 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiCrossSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiCrossSelf.yql
new file mode 100644
index 0000000000..6d784c12f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiCrossSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Cross '"a" '"b" '() '() '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiExclusionSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiExclusionSelf.yql
new file mode 100644
index 0000000000..b3e903ce7b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiExclusionSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullSelf.yql
new file mode 100644
index 0000000000..cf1497bcef
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullTwoFieldsSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullTwoFieldsSelf.yql
new file mode 100644
index 0000000000..a682416eff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiFullTwoFieldsSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1EatOptSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1EatOptSelf.yql
new file mode 100644
index 0000000000..28be4deee9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1EatOptSelf.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '(table 'c) '('Inner
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '())
+ '"c" '('"a" '"value") '('"c" '"subkey" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1Self.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1Self.yql
new file mode 100644
index 0000000000..005fca072a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1Self.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '(table 'c) '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '())
+ '"c" '('"a" '"value") '('"c" '"subkey" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1bSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1bSelf.yql
new file mode 100644
index 0000000000..676843a418
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested1bSelf.yql
@@ -0,0 +1,13 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '(table 'c) '('Right
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '())
+ '"c" '('"b" '"value") '('"c" '"subkey" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested2Self.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested2Self.yql
new file mode 100644
index 0000000000..ecfc4263ec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerNested2Self.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '(table 'c) '(table 'd) '('Inner
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '())
+ '"c" '('"b" '"key") '('"c" '"value" ) '())
+ '"d" '('"a" '"value") '('"d" '"subkey" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerSelf.yql
new file mode 100644
index 0000000000..633de6fcae
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerTwoFieldsSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerTwoFieldsSelf.yql
new file mode 100644
index 0000000000..793ee81306
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiInnerTwoFieldsSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftOnlySelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftOnlySelf.yql
new file mode 100644
index 0000000000..867c048f8b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftOnlySelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSelf.yql
new file mode 100644
index 0000000000..1fc31dc350
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSemiSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSemiSelf.yql
new file mode 100644
index 0000000000..15fa410fc6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftSemiSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftTwoFieldsSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftTwoFieldsSelf.yql
new file mode 100644
index 0000000000..b305596d20
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiLeftTwoFieldsSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptFullSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptFullSelf.yql
new file mode 100644
index 0000000000..2bb5d8dfc5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptFullSelf.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let table (Map table (lambda '(row) (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))))))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Full '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptInnerSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptInnerSelf.yql
new file mode 100644
index 0000000000..d37d7f696b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptInnerSelf.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let table (Map table (lambda '(row) (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))))))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptLeftSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptLeftSelf.yql
new file mode 100644
index 0000000000..74edcb9ae2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptLeftSelf.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let table (Map table (lambda '(row) (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))))))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Left '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptRightSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptRightSelf.yql
new file mode 100644
index 0000000000..47f1a8923a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiOptRightSelf.yql
@@ -0,0 +1,15 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let table (Map table (lambda '(row) (AsStruct
+ '('key (Just (Member row 'key)))
+ '('subkey (Just (Member row 'subkey)))
+ '('value (Just (Member row 'value)))))))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightOnlySelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightOnlySelf.yql
new file mode 100644
index 0000000000..0a0a502ca6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightOnlySelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSelf.yql
new file mode 100644
index 0000000000..9fe527324c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSemiSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSemiSelf.yql
new file mode 100644
index 0000000000..4e69796c1f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightSemiSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightTwoFieldsSelf.yql b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightTwoFieldsSelf.yql
new file mode 100644
index 0000000000..d5145b4dec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/TypeEquiRightTwoFieldsSelf.yql
@@ -0,0 +1,11 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputSelf))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"value" '"b" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf join)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoin/default.cfg
new file mode 100644
index 0000000000..41fe7506e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/default.cfg
@@ -0,0 +1,6 @@
+res result.txt
+in InputSelf InputSelf.txt
+in InputSelf2 InputSelf2.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt
new file mode 100644
index 0000000000..f53757c309
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="1";"value"="ddd"};
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="150";"subkey"="1";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt
new file mode 100644
index 0000000000..07af3b4647
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="2";"value"="q"};
+{"key"="150";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt
new file mode 100644
index 0000000000..1dc1bcc60b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="021";"subkey"="3";"value"="q"};
+{"key"="151";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input3.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt
new file mode 100644
index 0000000000..8852c0825e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt
@@ -0,0 +1,2 @@
+{"payload_left"="aaa";"id"=1;};
+{"payload_left"="bbb";"id"=2;};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt.attr
new file mode 100644
index 0000000000..4cd0c640ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input4.txt.attr
@@ -0,0 +1,35 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "id";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "payload_left";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]};
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "payload_left";
+ "type" = "string"
+ };
+ {
+ "name" = "id";
+ "type" = "int64"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt b/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt
new file mode 100644
index 0000000000..398caa9279
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt
@@ -0,0 +1,2 @@
+{"payload_right"="ccc";"id"=1;};
+{"payload_right"="ddd";"id"=3;};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt.attr
new file mode 100644
index 0000000000..cfc68e11aa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoin/input5.txt.attr
@@ -0,0 +1,35 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "id";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "payload_right";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]};
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "payload_right";
+ "type" = "string"
+ };
+ {
+ "name" = "id";
+ "type" = "int64"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql
new file mode 100644
index 0000000000..283fccceff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql
@@ -0,0 +1,9 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql
new file mode 100644
index 0000000000..af7dbd189d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql
@@ -0,0 +1,9 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql
new file mode 100644
index 0000000000..e8016a1260
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql
@@ -0,0 +1,9 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt
new file mode 100644
index 0000000000..ebf3709fbe
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt
@@ -0,0 +1,54 @@
+(
+
+(let doAllJoinsExceptCrossEx (lambda '(world list1 list2 link) ( block '(
+
+ (let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key) '('b 'key) link) '()))
+ (let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key) '('b 'key) link) '()))
+
+ (let sortDir2 '((Bool 'true) (Bool 'true)))
+ (let sortDir1 '((Bool 'true)))
+ (let keySelectorAB (lambda '(row) '((Member row '"a.key") (Member row '"b.key"))))
+ (let keySelectorA (lambda '(row) '((Member row '"a.key"))))
+ (let keySelectorB (lambda '(row) '((Member row '"b.key"))))
+
+ (let res_sink (DataSink 'result))
+ (let world (Write! world res_sink (Key) (Sort joinInner sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeft sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRight sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinFull sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir1 keySelectorA) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir1 keySelectorB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinExclusion sortDir2 keySelectorAB) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir1 keySelectorA) '('('type))))
+ (let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir1 keySelectorB) '('('type))))
+
+ (let world (Commit! world res_sink))
+ (return world)
+
+))))
+
+(let doAllJoinsExceptCrossLink (lambda '(world t1 t2 link) ( block '(
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String t1))) (Void) '()))
+ (let world (Left! x))
+ (let list1 (Right! x))
+
+ (let x (Read! world mr_source (Key '('table (String t2))) (Void) '()))
+ (let world (Left! x))
+ (let list2 (Right! x))
+
+ (return (Apply doAllJoinsExceptCrossEx world list1 list2 link))
+))))
+
+
+(export doAllJoinsExceptCrossLink)
+(export doAllJoinsExceptCrossEx)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql
new file mode 100644
index 0000000000..0db96ff654
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql
@@ -0,0 +1,31 @@
+(
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Same as InputKV1
+(let list1 (AsList
+ (AsStruct '('key (String '1)) '('v1 (String 'v11)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+))
+
+# Same as InputKV2
+(let list2 (AsList
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes)))
+))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql
new file mode 100644
index 0000000000..42b1a60840
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql
@@ -0,0 +1,31 @@
+(
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Same as InputKV1
+(let list1 (AsList
+ (AsStruct '('key (String '1)) '('v1 (String 'v11)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+))
+
+# Same as InputKV2
+(let list2 (AsList
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes)))
+))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('left 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql
new file mode 100644
index 0000000000..53b2d9eaae
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql
@@ -0,0 +1,31 @@
+(
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# Same as InputKV1
+(let list1 (AsList
+ (AsStruct '('key (String '1)) '('v1 (String 'v11)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '2)) '('v1 (String 'v12)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+ (AsStruct '('key (String '3)) '('v1 (String 'v13)))
+))
+
+# Same as InputKV2
+(let list2 (AsList
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes)))
+ (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes)))
+))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('left 'any) '('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt
new file mode 100644
index 0000000000..895634d4f4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt
@@ -0,0 +1,6 @@
+{"key"="1";"v1"="v11"};
+{"key"="2";"v1"="v12"};
+{"key"="2";"v1"="v12"};
+{"key"="2";"v1"="v12"};
+{"key"="3";"v1"="v13"};
+{"key"="3";"v1"="v13"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr
new file mode 100644
index 0000000000..25b39416e2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["v1";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key";];
+ "SortedByTypes"=[["DataType";"String";];];
+ "SortMembers"=["key";];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt
new file mode 100644
index 0000000000..b2ee98b41a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt
@@ -0,0 +1,6 @@
+{"key"="2";"v2"="v22_extra_bytes"};
+{"key"="2";"v2"="v22_extra_bytes"};
+{"key"="3";"v2"="v23_extra_bytes"};
+{"key"="3";"v2"="v23_extra_bytes"};
+{"key"="3";"v2"="v23_extra_bytes"};
+{"key"="4";"v2"="v24_extra_bytes"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr
new file mode 100644
index 0000000000..ca25d0f371
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["v2";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key";];
+ "SortedByTypes"=[["DataType";"String";];];
+ "SortMembers"=["key";];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql
new file mode 100644
index 0000000000..cca73e9d75
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql
new file mode 100644
index 0000000000..e9547bfd31
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql
new file mode 100644
index 0000000000..e5bc5906b3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql
new file mode 100644
index 0000000000..ad84352890
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql
new file mode 100644
index 0000000000..037e8aafc0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql
new file mode 100644
index 0000000000..f1ce069c3e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql
new file mode 100644
index 0000000000..5845432182
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql
new file mode 100644
index 0000000000..5f12b8e34e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql
new file mode 100644
index 0000000000..eaad119c21
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql
@@ -0,0 +1,11 @@
+(
+
+(library "joins.yql")
+(import join_module '"joins.yql")
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+
+(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any))))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg
new file mode 100644
index 0000000000..c73c7f566e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg
@@ -0,0 +1,4 @@
+res result.txt
+file joins.yql DoAllJoinsExceptCross.yql.txt
+in Input1 InputKV1.txt
+in Input2 InputKV2.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommon.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommon.yql
new file mode 100644
index 0000000000..fd0cd3266b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommon.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonKey2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonKey2.yql
new file mode 100644
index 0000000000..04d4ac8e78
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonKey2.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1.yql
new file mode 100644
index 0000000000..c2925077b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12.yql
new file mode 100644
index 0000000000..4f530fd62f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12Key2.yql
new file mode 100644
index 0000000000..430c926921
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt12Key2.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1Key2.yql
new file mode 100644
index 0000000000..da741bd831
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt1Key2.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2.yql
new file mode 100644
index 0000000000..10ceca2c98
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2Key2.yql
new file mode 100644
index 0000000000..0cd36f7c36
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/JoinCommonOpt2Key2.yql
@@ -0,0 +1,42 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key2"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key2") (Member row '"b.subkey2"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinCross sortDir4 keySelectorAB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/default.cfg
new file mode 100644
index 0000000000..3986c38117
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1Opt input1opt.txt
+in Input2Opt input2opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt
new file mode 100644
index 0000000000..6cacacff58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt
@@ -0,0 +1,3 @@
+{"key1"=1;subkey1=".";"value1"="A"};
+{"key1"=4;subkey1=".";"value1"="C"};
+{"key1"=4;subkey1=".";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt.attr
new file mode 100644
index 0000000000..8714765eb4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt
new file mode 100644
index 0000000000..f03418b1bf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt
@@ -0,0 +1,6 @@
+{"key1"=1;subkey1=".";"value1"="A"};
+{"key1"=4;subkey1=".";"value1"="C"};
+{"key1"=4;subkey1=".";"value1"="D"};
+{"key1"=#;subkey1=".";"value1"="E"};
+{"key1"=#;subkey1=".";"value1"="F"};
+{"key1"=#;subkey1=".";"value1"="G"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt.attr
new file mode 100644
index 0000000000..de343fa9cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input1opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt
new file mode 100644
index 0000000000..7e4ea597de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt
@@ -0,0 +1,3 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt.attr
new file mode 100644
index 0000000000..824353dafc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value2";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt
new file mode 100644
index 0000000000..17ff7232b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt
@@ -0,0 +1,6 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
+{"key2"=#;subkey2=".";"value2"="P"};
+{"key2"=#;subkey2=".";"value2"="Q"};
+{"key2"=#;subkey2=".";"value2"="R"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt.attr
new file mode 100644
index 0000000000..990e5b6aee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinCommon/input2opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMap.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMap.yql
new file mode 100644
index 0000000000..8739797e8f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMap.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapKey2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapKey2.yql
new file mode 100644
index 0000000000..eef99f2886
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapKey2.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1.yql
new file mode 100644
index 0000000000..e50b5b2bf5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12.yql
new file mode 100644
index 0000000000..64367c4c33
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12Key2.yql
new file mode 100644
index 0000000000..51af3fa6f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt12Key2.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1Key2.yql
new file mode 100644
index 0000000000..3a089710e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt1Key2.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2.yql
new file mode 100644
index 0000000000..678ed1b9ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2Key2.yql
new file mode 100644
index 0000000000..2e36542a53
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/JoinMapOpt2Key2.yql
@@ -0,0 +1,33 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '('('type))))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+(let world (Write! world res_sink (Key) joinRight '('('type))))
+(let world (Write! world res_sink (Key) joinLeftOnly '('('type))))
+(let world (Write! world res_sink (Key) joinRightOnly '('('type))))
+(let world (Write! world res_sink (Key) joinLeftSemi '('('type))))
+(let world (Write! world res_sink (Key) joinRightSemi '('('type))))
+(let world (Write! world res_sink (Key) joinCross '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.cfg
new file mode 100644
index 0000000000..45bd8b2b81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.cfg
@@ -0,0 +1,3 @@
+res result.txt
+in Input1 bug3054_1.txt
+in Input2 bug3054_2.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.yql
new file mode 100644
index 0000000000..58a877a388
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'key2) '('b 'key1 'b 'key2) '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinLeft '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt
new file mode 100644
index 0000000000..6e6cc8a496
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt
@@ -0,0 +1,4 @@
+{"key1"="2017-08-10";"key2"=1};
+{"key1"="2017-08-10";"key2"=2};
+{"key1"="2017-08-11";"key2"=1};
+{"key1"="2017-08-11";"key2"=#};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt.attr
new file mode 100644
index 0000000000..42dbb6a49b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_1.txt.attr
@@ -0,0 +1,29 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt
new file mode 100644
index 0000000000..b7262abbb7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt
@@ -0,0 +1,4 @@
+{"key1"="2017-08-10";"key2"=1};
+{"key1"="2017-08-10";"key2"=2};
+{"key1"="2017-08-11";"key2"=1};
+{"key1"="2017-08-11";"key2"=2};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt.attr
new file mode 100644
index 0000000000..42dbb6a49b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/bug3054_2.txt.attr
@@ -0,0 +1,29 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/default.cfg
new file mode 100644
index 0000000000..3986c38117
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1Opt input1opt.txt
+in Input2Opt input2opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt
new file mode 100644
index 0000000000..4b39db5bf3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt
@@ -0,0 +1,3 @@
+{"key1"=1;subkey1="..";"value1"="A"};
+{"key1"=4;subkey1="..";"value1"="C"};
+{"key1"=4;subkey1="..";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt.attr
new file mode 100644
index 0000000000..8714765eb4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt
new file mode 100644
index 0000000000..98331c5ee4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt
@@ -0,0 +1,6 @@
+{"key1"=1;subkey1="...";"value1"="A"};
+{"key1"=4;subkey1="...";"value1"="C"};
+{"key1"=4;subkey1="...";"value1"="D"};
+{"key1"=#;subkey1="...";"value1"="E"};
+{"key1"=#;subkey1="...";"value1"="F"};
+{"key1"=#;subkey1="...";"value1"="G"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt.attr
new file mode 100644
index 0000000000..de343fa9cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input1opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt
new file mode 100644
index 0000000000..7e4ea597de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt
@@ -0,0 +1,3 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt.attr
new file mode 100644
index 0000000000..824353dafc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value2";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt
new file mode 100644
index 0000000000..17ff7232b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt
@@ -0,0 +1,6 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
+{"key2"=#;subkey2=".";"value2"="P"};
+{"key2"=#;subkey2=".";"value2"="Q"};
+{"key2"=#;subkey2=".";"value2"="R"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt.attr
new file mode 100644
index 0000000000..990e5b6aee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMap/input2opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.cfg
new file mode 100644
index 0000000000..06f0f4538a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.cfg
@@ -0,0 +1,3 @@
+in Input1 bug2333_l.txt
+in Input2 bug2333_r.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.yql
new file mode 100644
index 0000000000..f6b50489a6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Bug2333.yql
@@ -0,0 +1,39 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"2"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergeunsortedfactor" '"0.8"))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input2")))) '('"key") '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table1 '"L") '(table2 '"R") '('Left '"L" '"R" '('"L" '"key") '('"R" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (AsList (AsStruct '('"L.key" (Member row '"L.key")) '('"R.key" (Member row '"R.key")) '('"IsJoined" ("!=" ("Not" ("Exists" (SqlColumn row '"key" '"R"))) (Bool '"true"))))))))
+ (let core (Aggregate core '('"IsJoined") '('('Count0 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (SqlColumn row '"key" '"L")))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"IsJoined" (Member row '"IsJoined")) '('"column1" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"IsJoined" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Cross2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Cross2_12.yql
new file mode 100644
index 0000000000..9b331b9f82
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Cross2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Cross '"a" '"b" '() '() '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_12.yql
new file mode 100644
index 0000000000..3518a4c5d4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_1o2o.yql
new file mode 100644
index 0000000000..90b210133a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Exclusion '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_12.yql
new file mode 100644
index 0000000000..65f4e896c0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Exclusion '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_1o2o.yql
new file mode 100644
index 0000000000..a6f66f231e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Exclusion2key2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Exclusion '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12.yql
new file mode 100644
index 0000000000..ebb11c9560
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12u.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12u.yql
new file mode 100644
index 0000000000..9047dae5cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_12u.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2u))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1o2o.yql
new file mode 100644
index 0000000000..4f3b39aead
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2.yql
new file mode 100644
index 0000000000..cce29bdeba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1u))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2u.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2u.yql
new file mode 100644
index 0000000000..b2025d9f13
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2_1u2u.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1u))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2u))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_12.yql
new file mode 100644
index 0000000000..e73d11378c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_1o2o.yql
new file mode 100644
index 0000000000..02fe6bd9b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Full2key12_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Full '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12.yql
new file mode 100644
index 0000000000..6a0eca2a30
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12o.yql
new file mode 100644
index 0000000000..4aa5328146
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_12o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2.yql
new file mode 100644
index 0000000000..e114fdd320
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2o.yql
new file mode 100644
index 0000000000..dfef6fe6c8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12.yql
new file mode 100644
index 0000000000..28175bd604
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12o.yql
new file mode 100644
index 0000000000..981d1a26d3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_12o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2.yql
new file mode 100644
index 0000000000..f217a74ac3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2o.yql
new file mode 100644
index 0000000000..c397a2f86c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Inner2key2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_123.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_123.yql
new file mode 100644
index 0000000000..5f4c36f6e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_123.yql
@@ -0,0 +1,24 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinallowcolumnrenames" 'true))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value3) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_1o2o3o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_1o2o3o.yql
new file mode 100644
index 0000000000..959778c020
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3_1o2o3o.yql
@@ -0,0 +1,24 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinallowcolumnrenames" 'true))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3opt))) '('key 'subkey 'value3) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '"c" '('"a" '"key") '('"c" '"key") '()) '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_123.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_123.yql
new file mode 100644
index 0000000000..af7186040d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_123.yql
@@ -0,0 +1,22 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinallowcolumnrenames" 'true))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value3) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '"c" '('"a" '"key" '"a" '"subkey") '('"c" '"key" '"c" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_1o2o3o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_1o2o3o.yql
new file mode 100644
index 0000000000..f1e98e1303
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/InnerInner3key2_1o2o3o.yql
@@ -0,0 +1,22 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinallowcolumnrenames" 'true))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3opt))) '('key 'subkey 'value3) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
+ '('Inner
+ '('Inner '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '"c" '('"a" '"key" '"a" '"subkey") '('"c" '"key" '"c" '"subkey") '()) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.cfg
new file mode 100644
index 0000000000..f73a18f37a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+in Input2 infer_scheme.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.yql
new file mode 100644
index 0000000000..46c35ef2a9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithNonStrict.yql
@@ -0,0 +1,19 @@
+(
+
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergeunsortedfactor" '"3.0"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key) '('('infer_scheme))))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.cfg
new file mode 100644
index 0000000000..68f6b6b97b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.cfg
@@ -0,0 +1,3 @@
+in Input1 bug2333_l.txt
+in Input2 sorted_desc.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.yql
new file mode 100644
index 0000000000..0cd1abd0e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/JoinWithSortedDesc.yql
@@ -0,0 +1,39 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"2"))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergeunsortedfactor" '"2"))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input2")))) '('"key") '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table1 '"L") '(table2 '"R") '('Left '"L" '"R" '('"L" '"key") '('"R" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (AsList (AsStruct '('"L.key" (Member row '"L.key")) '('"R.key" (Member row '"R.key")) '('"IsJoined" ("!=" ("Not" ("Exists" (SqlColumn row '"key" '"R"))) (Bool '"true"))))))))
+ (let core (Aggregate core '('"IsJoined") '('('Count0 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (SqlColumn row '"key" '"L")))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"IsJoined" (Member row '"IsJoined")) '('"column1" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"IsJoined" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_12.yql
new file mode 100644
index 0000000000..203d420f05
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_1o2o.yql
new file mode 100644
index 0000000000..1cc15375b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Left '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey") (Member row '"b.value2"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_12.yql
new file mode 100644
index 0000000000..f376fd59f5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_1o2o.yql
new file mode 100644
index 0000000000..ecbcf52649
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Left2key2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Left '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_12.yql
new file mode 100644
index 0000000000..7ad7499a36
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_1o2o.yql
new file mode 100644
index 0000000000..eee4c48726
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_12.yql
new file mode 100644
index 0000000000..7983fd5c84
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftOnly '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_1o2o.yql
new file mode 100644
index 0000000000..72d92bae07
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftOnly2key2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftOnly '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_12.yql
new file mode 100644
index 0000000000..b9b78b1e30
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_1o2o.yql
new file mode 100644
index 0000000000..cbfc95831d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_12.yql
new file mode 100644
index 0000000000..fb3e649ac7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_1o2o.yql
new file mode 100644
index 0000000000..c97954aec4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/LeftSemi2key2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('LeftSemi '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_12.yql
new file mode 100644
index 0000000000..c0cfeddbac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_1o2o.yql
new file mode 100644
index 0000000000..0d9096f170
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Right '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_12.yql
new file mode 100644
index 0000000000..d6e27227a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_1o2o.yql
new file mode 100644
index 0000000000..26a9da603e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/Right2key2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('Right '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"a.key") (Member row '"a.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_12.yql
new file mode 100644
index 0000000000..ac557b7c39
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_1o2o.yql
new file mode 100644
index 0000000000..818530c644
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_12.yql
new file mode 100644
index 0000000000..57525fe5cd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightOnly '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_1o2o.yql
new file mode 100644
index 0000000000..d94a379a98
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightOnly2key2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightOnly '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_12.yql
new file mode 100644
index 0000000000..2d97e5de4f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_12.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_1o2o.yql
new file mode 100644
index 0000000000..78812b0504
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2_1o2o.yql
@@ -0,0 +1,17 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightSemi '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
+ '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_12.yql
new file mode 100644
index 0000000000..614f56af07
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_12.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightSemi '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_1o2o.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_1o2o.yql
new file mode 100644
index 0000000000..36754914d3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/RightSemi2key2_1o2o.yql
@@ -0,0 +1,19 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1opt))) '('key 'subkey 'value1) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2opt))) '('key 'subkey 'value2) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let join (EquiJoin '(table1 'a) '(table2 'b)
+ '('RightSemi '"a" '"b" '('"a" '"key" '"a" '"subkey") '('"b" '"key" '"b" '"subkey") '())
+ '()))
+(let res_sink (DataSink 'result))
+(let sortDir '((Bool 'true) (Bool 'true)))
+(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey"))))
+(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt
new file mode 100644
index 0000000000..629585c06e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt
@@ -0,0 +1,11 @@
+{"key"="020";"subkey"=1;"value1"="q"};
+{"key"="022";"subkey"=1;"value1"="q"};
+{"key"="030";"subkey"=1;"value1"="q"};
+{"key"="040";"subkey"=1;"value1"="abc"};
+{"key"="050";"subkey"=1;"value1"="abc"};
+{"key"="060";"subkey"=1;"value1"="abc"};
+{"key"="075";"subkey"=1;"value1"="abc"};
+{"key"="075";"subkey"=1;"value1"="qzz"};
+{"key"="100";"subkey"=1;"value1"="ddd"};
+{"key"="500";"subkey"=1;"value1"="ddd"};
+{"key"="800";"subkey"=1;"value1"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt.attr
new file mode 100644
index 0000000000..636afb35de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_l.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key"];"SortedBy"=["key"];"SortDirections"=[1];"SortedByTypes"=[["DataType";"String"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value1";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt
new file mode 100644
index 0000000000..a2389716e5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt
@@ -0,0 +1,5 @@
+{"key"="320";"subkey"=1;"value1"="q"};
+{"key"="065";"subkey"=1;"value1"="abc"};
+{"key"="075";"subkey"=1;"value1"="qzz"};
+{"key"="850";"subkey"=1;"value1"="ddd"};
+{"key"="800";"subkey"=1;"value1"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt.attr
new file mode 100644
index 0000000000..905390e41e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/bug2333_r.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value1";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/default.cfg
new file mode 100644
index 0000000000..17f55ef14f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/default.cfg
@@ -0,0 +1,9 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1u input1u.txt
+in Input2u input2u.txt
+in Input3 input3.txt
+in Input1opt input1opt.txt
+in Input2opt input2opt.txt
+in Input3opt input3opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt
new file mode 100644
index 0000000000..79c1bc3e75
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt
@@ -0,0 +1,4 @@
+{"key"="020"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt.attr
new file mode 100644
index 0000000000..3c0f7e55c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/infer_scheme.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema" = %true
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt
new file mode 100644
index 0000000000..ad71c8be16
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"=1;"value1"="q"};
+{"key"="075";"subkey"=1;"value1"="abc"};
+{"key"="075";"subkey"=1;"value1"="qzz"};
+{"key"="800";"subkey"=1;"value1"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt.attr
new file mode 100644
index 0000000000..22819a0f3b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"String"];["DataType";"Int32"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value1";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt
new file mode 100644
index 0000000000..ad71c8be16
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"=1;"value1"="q"};
+{"key"="075";"subkey"=1;"value1"="abc"};
+{"key"="075";"subkey"=1;"value1"="qzz"};
+{"key"="800";"subkey"=1;"value1"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt.attr
new file mode 100644
index 0000000000..bd2fbd34c0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1opt.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"String"]];["OptionalType";["DataType";"Int32"]]];"Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"Int32"]]];["value1";["OptionalType";["DataType";"String"]]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt
new file mode 100644
index 0000000000..630726fbc7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt
@@ -0,0 +1,3 @@
+{"key"="020";"subkey"=1;"value1"="q"};
+{"key"="075";"subkey"=1;"value1"="abc"};
+{"key"="800";"subkey"=1;"value1"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt.attr
new file mode 100644
index 0000000000..d666ee078f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input1u.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"UniqueKeys"=%true;"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"String"];["DataType";"Int32"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value1";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt
new file mode 100644
index 0000000000..ea8b550fc1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"=1;"value2"=3.};
+{"key"="075";"subkey"=2;"value2"=4.5};
+{"key"="150";"subkey"=1;"value2"=5.5};
+{"key"="800";"subkey"=1;"value2"=1.};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt.attr
new file mode 100644
index 0000000000..2f3f372953
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"String"];["DataType";"Int32"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value2";["DataType";"Double"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt
new file mode 100644
index 0000000000..ea8b550fc1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"=1;"value2"=3.};
+{"key"="075";"subkey"=2;"value2"=4.5};
+{"key"="150";"subkey"=1;"value2"=5.5};
+{"key"="800";"subkey"=1;"value2"=1.};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt.attr
new file mode 100644
index 0000000000..4a4ea783a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2opt.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"String"]];["OptionalType";["DataType";"Int32"]]];"Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"Int32"]]];["value2";["OptionalType";["DataType";"Double"]]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt
new file mode 100644
index 0000000000..3e93a3a132
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"=1;"value2"=3.};
+{"key"="150";"subkey"=1;"value2"=5.5};
+{"key"="800";"subkey"=1;"value2"=1.};
+{"key"="801";"subkey"=1;"value2"=1.1};
+{"key"="802";"subkey"=1;"value2"=1.2};
+{"key"="803";"subkey"=1;"value2"=1.3};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt.attr
new file mode 100644
index 0000000000..8ffdb455dd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input2u.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"UniqueKeys"=%true;"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"String"];["DataType";"Int32"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value2";["DataType";"Double"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt
new file mode 100644
index 0000000000..71e5aa381b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt
@@ -0,0 +1,4 @@
+{"key"="021";"subkey"=3;"value3"=-67};
+{"key"="075";"subkey"=3;"value3"=23};
+{"key"="151";"subkey"=3;"value3"=666};
+{"key"="800";"subkey"=1;"value3"=567};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt.attr
new file mode 100644
index 0000000000..531b5fb378
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"String"];["DataType";"Int32"]];"Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"Int32"]];["value3";["DataType";"Int64"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt
new file mode 100644
index 0000000000..71e5aa381b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt
@@ -0,0 +1,4 @@
+{"key"="021";"subkey"=3;"value3"=-67};
+{"key"="075";"subkey"=3;"value3"=23};
+{"key"="151";"subkey"=3;"value3"=666};
+{"key"="800";"subkey"=1;"value3"=567};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt.attr
new file mode 100644
index 0000000000..37e5810187
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/input3opt.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"String"]];["OptionalType";["DataType";"Int32"]]];"Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"Int32"]]];["value3";["OptionalType";["DataType";"Int64"]]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt
new file mode 100644
index 0000000000..ac8e34386d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt
@@ -0,0 +1,4 @@
+{"_yql_column_0"="\xE0\xC7\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="800";"subkey"="2";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="150";"subkey"="4";"value"="qzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt.attr
new file mode 100644
index 0000000000..903b4c7d93
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinMerge/sorted_desc.txt.attr
@@ -0,0 +1,46 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrdered.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrdered.yql
new file mode 100644
index 0000000000..d16765b530
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrdered.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedKey2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedKey2.yql
new file mode 100644
index 0000000000..86ddc7edea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedKey2.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1.yql
new file mode 100644
index 0000000000..dc6553ace8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12.yql
new file mode 100644
index 0000000000..52ec551031
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12Key2.yql
new file mode 100644
index 0000000000..c283681f65
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt12Key2.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1Key2.yql
new file mode 100644
index 0000000000..c0fd196bb3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt1Key2.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2.yql
new file mode 100644
index 0000000000..cc2f36e4b9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2Key2.yql
new file mode 100644
index 0000000000..06a7f9e790
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/JoinOrderedOpt2Key2.yql
@@ -0,0 +1,41 @@
+(
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key1 'b 'subkey1) '()) '()))
+
+(let sortDir4 '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
+(let sortDir2 '((Bool 'true) (Bool 'true)))
+(let keySelectorAB (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1") (Member row '"a.value1") (Member row '"b.key1"))))
+(let keySelectorA (lambda '(row) '((Member row '"a.key1") (Member row '"a.subkey1"))))
+(let keySelectorB (lambda '(row) '((Member row '"b.key1") (Member row '"b.subkey1"))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Sort joinInner sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeft sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRight sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinFull sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir2 keySelectorB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinExclusion sortDir4 keySelectorAB) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir2 keySelectorA) '('('type))))
+(let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir2 keySelectorB) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/default.cfg
new file mode 100644
index 0000000000..3986c38117
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1Opt input1opt.txt
+in Input2Opt input2opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt
new file mode 100644
index 0000000000..6cacacff58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt
@@ -0,0 +1,3 @@
+{"key1"=1;subkey1=".";"value1"="A"};
+{"key1"=4;subkey1=".";"value1"="C"};
+{"key1"=4;subkey1=".";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt.attr
new file mode 100644
index 0000000000..886075ce6b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers"=["key1";"subkey1"];"SortedBy"=["key1";"subkey1"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"Int32"];["DataType";"String"]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt
new file mode 100644
index 0000000000..bfe21c14dd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt
@@ -0,0 +1,6 @@
+{"key1"=#;subkey1="..";"value1"="E"};
+{"key1"=#;subkey1="..";"value1"="F"};
+{"key1"=#;subkey1="..";"value1"="G"};
+{"key1"=1;subkey1="..";"value1"="A"};
+{"key1"=4;subkey1="..";"value1"="C"};
+{"key1"=4;subkey1="..";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt.attr
new file mode 100644
index 0000000000..21ebb68dc9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input1opt.txt.attr
@@ -0,0 +1,40 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers"=["key1";"subkey1"];"SortedBy"=["key1";"subkey1"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"Int32"]];["OptionalType";["DataType";"String"]]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt
new file mode 100644
index 0000000000..7536742f64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt
@@ -0,0 +1,3 @@
+{"key1"=2;subkey1=".";"value2"="U"};
+{"key1"=4;subkey1=".";"value2"="Y"};
+{"key1"=4;subkey1=".";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt.attr
new file mode 100644
index 0000000000..094fd53483
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers"=["key1";"subkey1"];"SortedBy"=["key1";"subkey1"];"SortDirections"=[1;1];"SortedByTypes"=[["DataType";"Int32"];["DataType";"String"]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value2";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt
new file mode 100644
index 0000000000..a620f354f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt
@@ -0,0 +1,6 @@
+{"key1"=#;subkey1="..";"value2"="P"};
+{"key1"=#;subkey1="..";"value2"="Q"};
+{"key1"=#;subkey1="..";"value2"="R"};
+{"key1"=2;subkey1="..";"value2"="U"};
+{"key1"=4;subkey1="..";"value2"="Y"};
+{"key1"=4;subkey1="..";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt.attr
new file mode 100644
index 0000000000..97710dd6cd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinOrdered/input2opt.txt.attr
@@ -0,0 +1,40 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers"=["key1";"subkey1"];"SortedBy"=["key1";"subkey1"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"Int32"]];["OptionalType";["DataType";"String"]]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinType.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinType.yql
new file mode 100644
index 0000000000..16d3de6d28
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinType.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeKey2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeKey2.yql
new file mode 100644
index 0000000000..7fc7ecf8ab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeKey2.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1.yql
new file mode 100644
index 0000000000..a20d8aec9b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12.yql
new file mode 100644
index 0000000000..d566b92b1c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12Key2.yql
new file mode 100644
index 0000000000..b2027e278b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt12Key2.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1Key2.yql
new file mode 100644
index 0000000000..5ab66d2fc5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt1Key2.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1Opt))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2.yql
new file mode 100644
index 0000000000..96f210378d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1) '('b 'key2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2Key2.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2Key2.yql
new file mode 100644
index 0000000000..e5f7c57d6d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/JoinTypeOpt2Key2.yql
@@ -0,0 +1,36 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2Opt))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key1 'a 'subkey1) '('b 'key2 'b 'subkey2) '()) '()))
+(let joinCross (EquiJoin '(list1 'a) '(list2 'b) '('Cross 'a 'b '() '() '()) '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Concat (String '"Inner: ") (FormatType (TypeOf joinInner))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Left: ") (FormatType (TypeOf joinLeft))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Right: ") (FormatType (TypeOf joinRight))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Full: ") (FormatType (TypeOf joinFull))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftOnly: ") (FormatType (TypeOf joinLeftOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightOnly: ") (FormatType (TypeOf joinRightOnly))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Exclusion: ") (FormatType (TypeOf joinExclusion))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"LeftSemi: ") (FormatType (TypeOf joinLeftSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"RightSemi: ") (FormatType (TypeOf joinRightSemi))) '()))
+(let world (Write! world res_sink (Key) (Concat (String '"Cross: ") (FormatType (TypeOf joinCross))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinType/default.cfg
new file mode 100644
index 0000000000..3986c38117
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1Opt input1opt.txt
+in Input2Opt input2opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt
new file mode 100644
index 0000000000..6cacacff58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt
@@ -0,0 +1,3 @@
+{"key1"=1;subkey1=".";"value1"="A"};
+{"key1"=4;subkey1=".";"value1"="C"};
+{"key1"=4;subkey1=".";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt.attr
new file mode 100644
index 0000000000..8714765eb4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt
new file mode 100644
index 0000000000..f03418b1bf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt
@@ -0,0 +1,6 @@
+{"key1"=1;subkey1=".";"value1"="A"};
+{"key1"=4;subkey1=".";"value1"="C"};
+{"key1"=4;subkey1=".";"value1"="D"};
+{"key1"=#;subkey1=".";"value1"="E"};
+{"key1"=#;subkey1=".";"value1"="F"};
+{"key1"=#;subkey1=".";"value1"="G"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt.attr
new file mode 100644
index 0000000000..de343fa9cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input1opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt
new file mode 100644
index 0000000000..7e4ea597de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt
@@ -0,0 +1,3 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt.attr
new file mode 100644
index 0000000000..824353dafc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value2";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt
new file mode 100644
index 0000000000..17ff7232b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt
@@ -0,0 +1,6 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
+{"key2"=#;subkey2=".";"value2"="P"};
+{"key2"=#;subkey2=".";"value2"="Q"};
+{"key2"=#;subkey2=".";"value2"="R"};
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt.attr
new file mode 100644
index 0000000000..990e5b6aee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/EquiJoinType/input2opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/File/ConfigureFileFromUrl.yql b/yql/essentials/tests/s-expressions/suites/File/ConfigureFileFromUrl.yql
new file mode 100644
index 0000000000..b6d23e3c3e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/ConfigureFileFromUrl.yql
@@ -0,0 +1,11 @@
+# canonize yson here
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let world (Configure! world config 'AddFileByUrl 'Tony 'https://yadi.sk/a/pk0iwMkNuNYgM/57b9c14c6fcc2a565515fab9))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Files '/home) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.cfg b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.cfg
new file mode 100644
index 0000000000..03037b8d6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.cfg
@@ -0,0 +1,3 @@
+res result.txt
+file OneFile one_file.txt
+file AnotherFile one_file.txt
diff --git a/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.yql b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.yql
new file mode 100644
index 0000000000..6e65cc1e65
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToOneFile.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let results (AsDict
+ '((String 'OneFile) (FileContent 'OneFile))
+ '((String 'AnotherFile) (FileContent 'AnotherFile))
+))
+(let world (Write! world res_sink (Key) results '('('type))))
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.cfg b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.cfg
new file mode 100644
index 0000000000..a566dd4aa0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.cfg
@@ -0,0 +1,3 @@
+res result.txt
+file OneFile one_file.txt
+file AnotherFile another_file.txt
diff --git a/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.yql b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.yql
new file mode 100644
index 0000000000..6e65cc1e65
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/DifferentAliasesToSameFiles.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let results (AsDict
+ '((String 'OneFile) (FileContent 'OneFile))
+ '((String 'AnotherFile) (FileContent 'AnotherFile))
+))
+(let world (Write! world res_sink (Key) results '('('type))))
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/FileContent.yql b/yql/essentials/tests/s-expressions/suites/File/FileContent.yql
new file mode 100644
index 0000000000..3e34cb8a58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FileContent.yql
@@ -0,0 +1,10 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FileContent 'MyFile) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/FilePath.yql b/yql/essentials/tests/s-expressions/suites/File/FilePath.yql
new file mode 100644
index 0000000000..1b036e6da4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FilePath.yql
@@ -0,0 +1,11 @@
+# do not check yson here
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FilePath 'MyFile) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/FilePathFromRoot.yql b/yql/essentials/tests/s-expressions/suites/File/FilePathFromRoot.yql
new file mode 100644
index 0000000000..fa4d5835ce
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FilePathFromRoot.yql
@@ -0,0 +1,11 @@
+# do not check yson here
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FilePath '/home/MyFile) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.cfg b/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.cfg
new file mode 100644
index 0000000000..5c9bcce3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.cfg
@@ -0,0 +1,3 @@
+file MyFile file1.txt
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.yql b/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.yql
new file mode 100644
index 0000000000..203ac40254
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FillWithFileContent.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let data (AsList
+(AsStruct '('key (String 'key1)) '('subkey (String '"")) '('value (FileContent 'MyFile)))
+))
+
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/FolderPath.yql b/yql/essentials/tests/s-expressions/suites/File/FolderPath.yql
new file mode 100644
index 0000000000..e676a8a14d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/FolderPath.yql
@@ -0,0 +1,11 @@
+# canonize yson here
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FolderPath '"/lib") '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/HomeFiles.yql b/yql/essentials/tests/s-expressions/suites/File/HomeFiles.yql
new file mode 100644
index 0000000000..78799b4126
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/HomeFiles.yql
@@ -0,0 +1,11 @@
+# canonize yson here
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Files '/home) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.cfg b/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.cfg
new file mode 100644
index 0000000000..5c9bcce3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.cfg
@@ -0,0 +1,3 @@
+file MyFile file1.txt
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.yql b/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.yql
new file mode 100644
index 0000000000..d481de6809
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFileContent.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (FileContent 'MyFile))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.cfg b/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.cfg
new file mode 100644
index 0000000000..b99236a7de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.cfg
@@ -0,0 +1,4 @@
+file MyFile file1.txt
+in Input input.txt
+out Output output.txt
+udf re2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.yql b/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.yql
new file mode 100644
index 0000000000..fcd006e0aa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFilePath.yql
@@ -0,0 +1,22 @@
+# canonize yson here
+(
+#comment
+(let udf (Udf '"Re2.Replace" '((String '"(^|.*/)([^/]+)$") (Null))))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (FilePath 'MyFile))
+ (let newValue (Apply udf newValue (String '"./\\2")))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.cfg b/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.cfg
new file mode 100644
index 0000000000..f1a778e02d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+mount ../mounts.txt
+udf re2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.yql b/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.yql
new file mode 100644
index 0000000000..a9bd5a3ada
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/MapWithFolderPath.yql
@@ -0,0 +1,22 @@
+# canonize yson here
+(
+#comment
+(let udf (Udf '"Re2.Replace" '((String '"(^|.*/)([^/]+/?)$") (Null))))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let newValue (FolderPath '"/lib"))
+ (let newValue (Apply udf newValue (String '"./\\2")))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/RootFiles.yql b/yql/essentials/tests/s-expressions/suites/File/RootFiles.yql
new file mode 100644
index 0000000000..cf275fb841
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/RootFiles.yql
@@ -0,0 +1,11 @@
+# canonize yson here
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Files '/) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/File/another_file.txt b/yql/essentials/tests/s-expressions/suites/File/another_file.txt
new file mode 100644
index 0000000000..b07dc8bb88
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/another_file.txt
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit...
diff --git a/yql/essentials/tests/s-expressions/suites/File/default.cfg b/yql/essentials/tests/s-expressions/suites/File/default.cfg
new file mode 100644
index 0000000000..c870e59de5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/default.cfg
@@ -0,0 +1,4 @@
+file MyFile file1.txt
+res result.txt
+mount ../mounts.txt
+udf string_udf
diff --git a/yql/essentials/tests/s-expressions/suites/File/file1.txt b/yql/essentials/tests/s-expressions/suites/File/file1.txt
new file mode 100644
index 0000000000..882c86d1f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/file1.txt
@@ -0,0 +1,2 @@
+some data 1
+some data 2
diff --git a/yql/essentials/tests/s-expressions/suites/File/input.txt b/yql/essentials/tests/s-expressions/suites/File/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/File/input.txt.attr b/yql/essentials/tests/s-expressions/suites/File/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/File/one_file.txt b/yql/essentials/tests/s-expressions/suites/File/one_file.txt
new file mode 100644
index 0000000000..b07dc8bb88
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/File/one_file.txt
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit...
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/AggregateWithFilter.yql b/yql/essentials/tests/s-expressions/suites/Filter/AggregateWithFilter.yql
new file mode 100644
index 0000000000..0f811313c6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/AggregateWithFilter.yql
@@ -0,0 +1,51 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) '('"key" '"subkey") '()))
+(let world (Left! r))
+(let input (Right! r))
+(let filter (lambda '(rec) (block '(
+ (return (Coalesce (> (Member rec '"key") (String '"100")) (Bool 'false)))
+))))
+(let res (Filter input filter))
+(let l1 (lambda '(rec) (block '(
+ (return (Convert (Exists (Member rec '"subkey")) 'Uint64))
+))))
+(let l2 (lambda '(rec state) (block '(
+ (let l (lambda '(r1 r2) (block '(
+ (return (+ r1 r2))
+ ))))
+ (let state (OptionalReduce state (Convert (Exists (Member rec '"subkey")) 'Uint64) l))
+ (return state)
+))))
+(let identity (lambda '(s) (block '(
+ (return s)
+))))
+(let l5 (lambda '(rec state) (block '(
+ (let l (lambda '(r1 r2) (block '(
+ (return (+ r1 r2))
+ ))))
+ (return (OptionalReduce rec state l))
+))))
+(let res (Aggregate res '('"key") '('('Count0 (AggregationTraits (ListItemType (TypeOf res)) l1 l2 identity identity l5 identity (Null))))))
+(let l (lambda '(state) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member state '"key")))
+ (let res (AddMember res '"subkey" (Cast (Member state 'Count0) 'String)))
+ (let res (AddMember res '"value" (String '"")))
+ (return (AsList res))
+))))
+(let res (FlatMap res l))
+(let world (Write! world sink (Key '('table (String '"Output"))) res '()))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/CloseRange.yql b/yql/essentials/tests/s-expressions/suites/Filter/CloseRange.yql
new file mode 100644
index 0000000000..8f8a2ebb28
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/CloseRange.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (>= key (String '"020")) (<= key (String '"700"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/CloseRangeOnSortedInput.yql b/yql/essentials/tests/s-expressions/suites/Filter/CloseRangeOnSortedInput.yql
new file mode 100644
index 0000000000..67767e39c0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/CloseRangeOnSortedInput.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (>= key (String '"020")) (<= key (String '"700"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/EmptyRange.yql b/yql/essentials/tests/s-expressions/suites/Filter/EmptyRange.yql
new file mode 100644
index 0000000000..5e3c989afa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/EmptyRange.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (>= key (String '"100")) (< key (String '"090"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/EmptyRangeOnSortedInput.yql b/yql/essentials/tests/s-expressions/suites/Filter/EmptyRangeOnSortedInput.yql
new file mode 100644
index 0000000000..4dca20b467
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/EmptyRangeOnSortedInput.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (>= key (String '"100")) (< key (String '"090"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/Equal.yql b/yql/essentials/tests/s-expressions/suites/Filter/Equal.yql
new file mode 100644
index 0000000000..77d9b0ea8a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/Equal.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (== key (String '"020")) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/EqualOnSortedInput.yql b/yql/essentials/tests/s-expressions/suites/Filter/EqualOnSortedInput.yql
new file mode 100644
index 0000000000..f69dde24bf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/EqualOnSortedInput.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (== key (String '"020")) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.yql
new file mode 100644
index 0000000000..25e70ab080
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Double.yql
@@ -0,0 +1,40 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-0.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-0.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '255))))))
+(let world (Apply test world (lambda '(key) (> key (Double '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Double '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Double '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.yql
new file mode 100644
index 0000000000..7e51737f4f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Float.yql
@@ -0,0 +1,40 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '0)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-0.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-0.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '0.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0.5)) (<= key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0)) (<= key (Float '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0)) (<= key (Float '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '0)) (< key (Float '255))))))
+(let world (Apply test world (lambda '(key) (> key (Float '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Float '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Float '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Float '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Float '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.yql
new file mode 100644
index 0000000000..9b61dfc633
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int32.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (<= key (Int32 '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '0)) (<= key (Int32 '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int32 '0)) (< key (Int32 '255))))))
+(let world (Apply test world (lambda '(key) (> key (Int32 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Int32 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Int32 '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int32 '0)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.yql
new file mode 100644
index 0000000000..bd121653b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Int64.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '0)) (<= key (Int64 '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '0)) (< key (Int64 '255))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Int64 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Int64 '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.yql
new file mode 100644
index 0000000000..91c443c6a8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint32.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '255))))))
+(let world (Apply test world (lambda '(key) (> key (Uint32 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint32 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint32 '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Uint32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint32 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.cfg
new file mode 100644
index 0000000000..f03903c558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_ui8.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.yql
new file mode 100644
index 0000000000..dcd71898d4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvByte-Uint64.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '255))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '255))))))
+(let world (Apply test world (lambda '(key) (> key (Uint64 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint64 '255)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint64 '1000)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.yql
new file mode 100644
index 0000000000..f3e31ddd82
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Byte.yql
@@ -0,0 +1,27 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Uint8 '0)) (<= key (Uint8 '10))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.yql
new file mode 100644
index 0000000000..01b53116ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Float.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-9.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-9.5)) (<= key (Float '9.5))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.yql
new file mode 100644
index 0000000000..9c6f02ce77
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int32.yql
@@ -0,0 +1,27 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (< key (Int32 '20))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.yql
new file mode 100644
index 0000000000..c2e5812eaf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Int64.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '20))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-9223372036854775808)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '3147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '-3147483647)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.yql
new file mode 100644
index 0000000000..ddf42e56cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint32.yql
@@ -0,0 +1,28 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '1000))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '1000))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.cfg
new file mode 100644
index 0000000000..6eef6ec30d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_dbl.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.yql
new file mode 100644
index 0000000000..f34acbcdba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvDouble-Uint64.yql
@@ -0,0 +1,29 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (< key (Uint64 '20))))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.cfg
new file mode 100644
index 0000000000..1ecb755e34
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_flt.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.yql
new file mode 100644
index 0000000000..ea85b0f4f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Double.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-9.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-9.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-3147483647)) (<= key (Double '3147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Double '3147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Double '-3147483647)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.cfg
new file mode 100644
index 0000000000..1ecb755e34
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_flt.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.yql
new file mode 100644
index 0000000000..9c6f02ce77
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int32.yql
@@ -0,0 +1,27 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (< key (Int32 '20))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.cfg
new file mode 100644
index 0000000000..1ecb755e34
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_flt.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.yql
new file mode 100644
index 0000000000..c2e5812eaf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Int64.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '20))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-9223372036854775808)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '3147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '-3147483647)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.cfg
new file mode 100644
index 0000000000..1ecb755e34
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_flt.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.yql
new file mode 100644
index 0000000000..ddf42e56cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint32.yql
@@ -0,0 +1,28 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '1000))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '1000))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.cfg
new file mode 100644
index 0000000000..1ecb755e34
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_flt.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.yql
new file mode 100644
index 0000000000..f34acbcdba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvFloat-Uint64.yql
@@ -0,0 +1,29 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (< key (Uint64 '20))))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.cfg
new file mode 100644
index 0000000000..cc557dfb6e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_i32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.yql
new file mode 100644
index 0000000000..7fd743bdee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Double.yql
@@ -0,0 +1,40 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-9.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-9.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-2147483648)) (<= key (Double '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-2147483648)) (< key (Double '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-3147483648)) (< key (Double '3147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10223372036854775808)) (< key (Double '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (> key (Double '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Double '-2147483648)))))
+(let world (Apply test world (lambda '(key) (<= key (Double '-2147483648)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.cfg
new file mode 100644
index 0000000000..cc557dfb6e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_i32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.yql
new file mode 100644
index 0000000000..520276f126
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Float.yql
@@ -0,0 +1,38 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-9.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-9.5)) (<= key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-2147483648)) (<= key (Float '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-2147483648)) (< key (Float '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-3147483648)) (< key (Float '3147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Float '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Float '-2147483648)))))
+(let world (Apply test world (lambda '(key) (<= key (Float '-2147483648)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.cfg
new file mode 100644
index 0000000000..cc557dfb6e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_i32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.yql
new file mode 100644
index 0000000000..b921b10b20
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Int64.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-2147483648)) (<= key (Int64 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-2147483648)) (< key (Int64 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-9223372036854775808)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Int64 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '-2147483648)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '-2147483648)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.cfg
new file mode 100644
index 0000000000..cc557dfb6e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_i32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.yql
new file mode 100644
index 0000000000..6dc9e5769c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint32.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Uint32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Uint32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint32 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.cfg
new file mode 100644
index 0000000000..cc557dfb6e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_i32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.yql
new file mode 100644
index 0000000000..df99564b89
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt32-Uint64.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (< key (Uint64 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Uint64 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint64 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.yql
new file mode 100644
index 0000000000..cbfb7cad03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Double.yql
@@ -0,0 +1,39 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-10.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-9.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-9.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-9223372036854775808)) (<= key (Double '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-9223372036854775808)) (< key (Double '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-10223372036854775808)) (< key (Double '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (> key (Double '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Double '-9223372036854775808)))))
+(let world (Apply test world (lambda '(key) (<= key (Double '-9223372036854775808)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.yql
new file mode 100644
index 0000000000..b94c11aecc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Float.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-10.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-10.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-9.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-9.5)) (<= key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (> key (Float '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Float '-2147483648)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.yql
new file mode 100644
index 0000000000..e3a5b10cbb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Int32.yql
@@ -0,0 +1,33 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (< key (Int32 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-2147483648)) (<= key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int32 '-2147483648)) (< key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '-2147483648)))))
+(let world (Apply test world (lambda '(key) (<= key (Int32 '-2147483648)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.yql
new file mode 100644
index 0000000000..6dc9e5769c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint32.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Uint32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Uint32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint32 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.yql
new file mode 100644
index 0000000000..eb43b46130
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvInt64-Uint64.yql
@@ -0,0 +1,36 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (< key (Uint64 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Uint64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '18446744073709551615)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.cfg
new file mode 100644
index 0000000000..d339183514
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_ui32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.yql
new file mode 100644
index 0000000000..d74c89079d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Double.yql
@@ -0,0 +1,39 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-0.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-0.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-1000000000000)) (< key (Double '1000000000000))))))
+(let world (Apply test world (lambda '(key) (> key (Double '4294967295)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '4294967295)))))
+(let world (Apply test world (lambda '(key) (< key (Double '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Double '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.cfg
new file mode 100644
index 0000000000..d339183514
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_ui32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.yql
new file mode 100644
index 0000000000..119a06c083
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Float.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '0)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-0.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-0.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '0.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0.5)) (<= key (Float '9.5))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.cfg
new file mode 100644
index 0000000000..d339183514
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_ui32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.yql
new file mode 100644
index 0000000000..0ef31b3b21
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int32.yql
@@ -0,0 +1,33 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (< key (Int32 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '0)) (<= key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int32 '0)) (< key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int32 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.cfg
new file mode 100644
index 0000000000..d339183514
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_ui32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.yql
new file mode 100644
index 0000000000..029097b6fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Int64.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '0)) (<= key (Int64 '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '0)) (< key (Int64 '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-9223372036854775808)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '4294967295)))))
+(let world (Apply test world (lambda '(key) (>= key (Int64 '4294967295)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.cfg
new file mode 100644
index 0000000000..d339183514
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.cfg
@@ -0,0 +1,2 @@
+in Input input_ui32.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.yql
new file mode 100644
index 0000000000..5350dcda71
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint32-Uint64.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '1000))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Uint64 '0)) (<= key (Uint64 '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint64 '0)) (< key (Uint64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Uint64 '1000000000000)))))
+(let world (Apply test world (lambda '(key) (> key (Uint64 '4294967295)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint64 '4294967295)))))
+(let world (Apply test world (lambda '(key) (< key (Uint64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint64 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.cfg
new file mode 100644
index 0000000000..fa976ebe64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.cfg
@@ -0,0 +1,2 @@
+in Input input_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.yql
new file mode 100644
index 0000000000..d7caabfc19
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Double.yql
@@ -0,0 +1,39 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '-0.5)) (< key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '-0.5)) (<= key (Double '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0.5)) (< key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0.5)) (<= key (Double '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Double '0)) (<= key (Double '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (And (> key (Double '0)) (< key (Double '18446744073709551615))))))
+(let world (Apply test world (lambda '(key) (> key (Double '18446744073709551615)))))
+(let world (Apply test world (lambda '(key) (>= key (Double '18446744073709551615)))))
+(let world (Apply test world (lambda '(key) (< key (Double '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Double '0)))))
+(let world (Apply test world (lambda '(key) (< key (Double '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.cfg
new file mode 100644
index 0000000000..fa976ebe64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.cfg
@@ -0,0 +1,2 @@
+in Input input_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.yql
new file mode 100644
index 0000000000..119a06c083
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Float.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (> key (Float '0)) (< key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0)) (<= key (Float '10))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '-0.5)) (< key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '-0.5)) (<= key (Float '10.5))))))
+(let world (Apply test world (lambda '(key) (And (> key (Float '0.5)) (< key (Float '9.5))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Float '0.5)) (<= key (Float '9.5))))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.cfg
new file mode 100644
index 0000000000..fa976ebe64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.cfg
@@ -0,0 +1,2 @@
+in Input input_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.yql
new file mode 100644
index 0000000000..638bf6954a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int32.yql
@@ -0,0 +1,34 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '-10)) (< key (Int32 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int32 '0)) (<= key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int32 '0)) (< key (Int32 '2147483647))))))
+(let world (Apply test world (lambda '(key) (> key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (>= key (Int32 '2147483647)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int32 '0)))))
+(let world (Apply test world (lambda '(key) (< key (Int32 '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.cfg
new file mode 100644
index 0000000000..fa976ebe64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.cfg
@@ -0,0 +1,2 @@
+in Input input_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.yql
new file mode 100644
index 0000000000..7e29e229f3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Int64.yql
@@ -0,0 +1,35 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '-10)) (< key (Int64 '20))))))
+(let world (Apply test world (lambda '(key) (And (>= key (Int64 '0)) (<= key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '0)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (And (> key (Int64 '-9223372036854775808)) (< key (Int64 '9223372036854775807))))))
+(let world (Apply test world (lambda '(key) (> key (Int64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (>= key (Int64 '9223372036854775807)))))
+(let world (Apply test world (lambda '(key) (< key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Int64 '-10)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.cfg b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.cfg
new file mode 100644
index 0000000000..fa976ebe64
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.cfg
@@ -0,0 +1,2 @@
+in Input input_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.yql b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.yql
new file mode 100644
index 0000000000..9cf0b972e2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/ImplicitConvUint64-Uint32.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let res (Coalesce (Apply cmp value) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(key) (And (>= key (Uint32 '0)) (<= key (Uint32 '4294967295))))))
+(let world (Apply test world (lambda '(key) (And (> key (Uint32 '0)) (< key (Uint32 '4294967295))))))
+(let world (Apply test world (lambda '(key) (> key (Uint32 '4294967295)))))
+(let world (Apply test world (lambda '(key) (>= key (Uint32 '4294967295)))))
+(let world (Apply test world (lambda '(key) (< key (Uint32 '0)))))
+(let world (Apply test world (lambda '(key) (<= key (Uint32 '0)))))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.cfg b/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.yql b/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.yql
new file mode 100644
index 0000000000..887bad3350
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/LMapCombineWithFilter.yql
@@ -0,0 +1,53 @@
+(
+# read data from Input table
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+(let sorted (Sort table (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world mr_sink))
+
+(let x (Read! world mr_source (Key '('table (String 'Output))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+# prepare python udf
+(let streamType (StreamType (ListItemType (TypeOf table))))
+(let udfType (CallableType '() '(streamType) '(streamType)))
+(let udfScript (String '@@
+def MyFunc(list):
+ return list
+@@))
+(let udf (ScriptUdf 'Python 'MyFunc udfType udfScript))
+
+# filter keys less than '100'
+(let table (Filter table (lambda '(item)
+ (Coalesce (> (Member item 'key) (String '100)) (Bool 'false))
+)))
+# Produce LMap
+(let table (LMap table (lambda '($stream) (Apply udf $stream))))
+
+(let Count_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+(let Count_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+(let Count_save (lambda '(state) state))
+(let Count_load (lambda '(item) item))
+(let Count_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+(let Count_finish (lambda '(state) state))
+(let table (Aggregate table '('"key") '('('Count0 (AggregationTraits (DataType 'String)
+ Count_create Count_update Count_save Count_load Count_merge Count_finish (Uint64 '0)) '"value"))))
+(let table (Sort table '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row '"key") (Member row '"Count0")))))
+
+# write table
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table '('('mode 'renew))))
+(let world (Write! world res_sink (Key) table '()))
+
+# finish
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.cfg b/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.yql b/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.yql
new file mode 100644
index 0000000000..68bb0ad6da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/LMapWithFilter.yql
@@ -0,0 +1,43 @@
+(
+# read data from Input table
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+(let sorted (Sort table (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) sorted '('('mode 'renew))))
+(let world (Commit! world mr_sink))
+
+(let x (Read! world mr_source (Key '('table (String 'Output))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+# prepare python udf
+(let streamType (StreamType (ListItemType (TypeOf table))))
+(let udfType (CallableType '() '(streamType) '(streamType)))
+(let udfScript (String '@@
+def MyFunc(list):
+ return list
+@@))
+(let udf (ScriptUdf 'Python 'MyFunc udfType udfScript '('('cpu '"5.0") '('extraMem '"12345"))))
+
+# filter keys less than '100'
+(let table (Filter table (lambda '(item)
+ (Coalesce (> (Member item 'key) (String '100)) (Bool 'false))
+)))
+# Produce LMap
+(let table (LMap table (lambda '($stream) (Apply udf $stream))))
+
+# write table
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table '('('mode 'renew))))
+(let world (Write! world res_sink (Key) table '()))
+
+# finish
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.cfg b/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.yql b/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.yql
new file mode 100644
index 0000000000..8d737e225f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/MixedTypeRange.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"value"))
+ (let res (Coalesce (And (> key (Int32 '0)) (< key (Int64 '700))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.cfg b/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.yql b/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.yql
new file mode 100644
index 0000000000..702b00544b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/NullBoundary.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"value"))
+ (let res (Coalesce (< key (Nothing (OptionalType (DataType 'Int64)))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/OpenRange.yql b/yql/essentials/tests/s-expressions/suites/Filter/OpenRange.yql
new file mode 100644
index 0000000000..dcc95c7353
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/OpenRange.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (> key (String '"020")) (< key (String '"700"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/OpenRangeOnSortedInput.yql b/yql/essentials/tests/s-expressions/suites/Filter/OpenRangeOnSortedInput.yql
new file mode 100644
index 0000000000..83df5958d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/OpenRangeOnSortedInput.yql
@@ -0,0 +1,30 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let res (Coalesce (And (> key (String '"020")) (< key (String '"700"))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.cfg b/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.cfg
new file mode 100644
index 0000000000..33b4e93ec7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.cfg
@@ -0,0 +1,2 @@
+in Input input_i64.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.yql b/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.yql
new file mode 100644
index 0000000000..7f4a8281fb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/OptionalBoundary.yql
@@ -0,0 +1,23 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"value"))
+ (let res (Coalesce (< key (Just (Int64 '700))) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.cfg b/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.cfg
new file mode 100644
index 0000000000..eb5df7a613
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.cfg
@@ -0,0 +1,2 @@
+in Input partkey.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.yql b/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.yql
new file mode 100644
index 0000000000..0d5342fa93
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/PartialKey.yql
@@ -0,0 +1,29 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let test (lambda '(world cmp) (block '(
+ (let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let subkey (Member item '"subkey"))
+ (let res (Coalesce (Apply cmp '(key subkey)) (Bool 'false)))
+ (return res)
+ ))))
+
+ (let out (Filter input filter))
+ (let world (Write! world result (Key) out '()))
+ (return world)
+))))
+
+(let world (Apply test world (lambda '(item) (And (> (Nth item '0) (String '"020")) (<= (Nth item '0) (String '"150"))) )))
+(let world (Apply test world (lambda '(item) (And (== (Nth item '0) (String '"075")) (And (> (Nth item '1) (String '"2")) (<= (Nth item '1) (String '"5")))) )))
+
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersection.yql b/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersection.yql
new file mode 100644
index 0000000000..35aec35fb1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersection.yql
@@ -0,0 +1,25 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let a1 (And (> key (String '"100")) (< key (String '"400"))))
+ (let a2 (And (> key (String '"020")) (< key (String '"200"))))
+ (let res (Coalesce (And a1 a2) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersectionOnSortedInput.yql b/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersectionOnSortedInput.yql
new file mode 100644
index 0000000000..59803168e1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/RangeIntersectionOnSortedInput.yql
@@ -0,0 +1,32 @@
+(
+(let source (DataSource '"yt" '"plato"))
+(let sink (DataSink '"yt" '"plato"))
+(let result (DataSink 'result))
+
+(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+(let sorted (Sort input (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String 'Output))) sorted '('('mode 'append))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (Key '('table (String '"Output"))) (Void) '()))
+(let world (Left! r))
+(let input (Right! r))
+
+(let filter (lambda '(item) (block '(
+ (let key (Member item '"key"))
+ (let a1 (And (> key (String '"100")) (< key (String '"400"))))
+ (let a2 (And (> key (String '"020")) (< key (String '"200"))))
+ (let res (Coalesce (And a1 a2) (Bool 'false)))
+ (return res)
+)
+)))
+
+(let out (Filter input filter))
+
+(let world (Write! world result (Key) out '('('type))))
+(let world (Commit! world sink))
+(let world (Commit! world result))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/default.cfg b/yql/essentials/tests/s-expressions/suites/Filter/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input.txt b/yql/essentials/tests/s-expressions/suites/Filter/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt
new file mode 100644
index 0000000000..9e8c8c997b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt
@@ -0,0 +1,5 @@
+{"value"=-1000.};
+{"value"=-10.};
+{"value"=0.};
+{"value"=10.};
+{"value"=1000.};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt.attr
new file mode 100644
index 0000000000..8aaee30aa6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_dbl.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"Double"]]
+ ]];
+ "SortMembers"=["value"];
+ "SortedBy"=["value"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"Double"]]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt
new file mode 100644
index 0000000000..9e8c8c997b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt
@@ -0,0 +1,5 @@
+{"value"=-1000.};
+{"value"=-10.};
+{"value"=0.};
+{"value"=10.};
+{"value"=1000.};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt.attr
new file mode 100644
index 0000000000..69560d7e0b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_flt.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"Float"]]
+ ]];
+ "SortMembers"=["value"];
+ "SortedBy"=["value"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"Float"]]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt
new file mode 100644
index 0000000000..f71e6df2d4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt
@@ -0,0 +1,5 @@
+{"value"=-2147483648};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=2147483647};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt.attr
new file mode 100644
index 0000000000..7fcf7442be
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_i32.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt
new file mode 100644
index 0000000000..355772bb75
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt
@@ -0,0 +1,5 @@
+{"value"=-9223372036854775808};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=9223372036854775807};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt.attr
new file mode 100644
index 0000000000..30006e3aad
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_i64.txt.attr
@@ -0,0 +1,10 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int64"
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt
new file mode 100644
index 0000000000..32d26ed58e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=4294967295u};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt.attr
new file mode 100644
index 0000000000..edb661f4ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui32.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint32";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt
new file mode 100644
index 0000000000..c4e744a58c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=18446744073709551615u};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt.attr
new file mode 100644
index 0000000000..5028e033d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui64.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint64";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt b/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt
new file mode 100644
index 0000000000..d61b1d35da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=255u};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt.attr
new file mode 100644
index 0000000000..6d04b983e9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/input_ui8.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint8";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt b/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt
new file mode 100644
index 0000000000..c2f900fd7c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="075";"subkey"="4";"value"="abc"};
+{"key"="075";"subkey"="5";"value"="abc"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="800";"subkey"="7";"value"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt.attr b/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt.attr
new file mode 100644
index 0000000000..ba33fb7074
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Filter/partkey.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/GraceJoinCore_Flow.yql b/yql/essentials/tests/s-expressions/suites/GraceJoin/GraceJoinCore_Flow.yql
new file mode 100644
index 0000000000..da309347a4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/GraceJoinCore_Flow.yql
@@ -0,0 +1,23 @@
+(
+(let world (Configure! world (DataSource '"config") '"LLVM" '"OFF"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let list2 (Right! x))
+
+(let joinInner (GraceJoinCore
+(ExpandMap (ToFlow list1) (lambda '(m)(Member m 'key1)))
+(ExpandMap (ToFlow list2) (lambda '(m)(Member m 'key2)))
+'Inner '('0) '('0) '('0 '0) '('0 '1) '('key1) '('key2) '()))
+
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) (Collect (NarrowMap joinInner (lambda '(a b) (AsStruct '('a a) '('b b))))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/SelfJoinCore_Flow.yql b/yql/essentials/tests/s-expressions/suites/GraceJoin/SelfJoinCore_Flow.yql
new file mode 100644
index 0000000000..e184b34935
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/SelfJoinCore_Flow.yql
@@ -0,0 +1,18 @@
+(
+(let world (Configure! world (DataSource '"config") '"LLVM" '"OFF"))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let list1 (Right! x))
+
+(let joinInner (GraceSelfJoinCore
+(ExpandMap (ToFlow list1) (lambda '(m)(Member m 'key1)))
+'Inner '('0) '('0) '('0 '0) '('0 '1) '('key1) '('key1) '()))
+
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) (Collect (NarrowMap joinInner (lambda '(a b) (AsStruct '('a a) '('b b))))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/default.cfg b/yql/essentials/tests/s-expressions/suites/GraceJoin/default.cfg
new file mode 100644
index 0000000000..3986c38117
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input1Opt input1opt.txt
+in Input2Opt input2opt.txt
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt
new file mode 100644
index 0000000000..4393708fba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt
@@ -0,0 +1,3 @@
+{"key1"=1u;subkey1="..";"value1"="A"};
+{"key1"=4u;subkey1="..";"value1"="C"};
+{"key1"=4u;subkey1="..";"value1"="D"};
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt.attr
new file mode 100644
index 0000000000..3f78440b17
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt
new file mode 100644
index 0000000000..98331c5ee4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt
@@ -0,0 +1,6 @@
+{"key1"=1;subkey1="...";"value1"="A"};
+{"key1"=4;subkey1="...";"value1"="C"};
+{"key1"=4;subkey1="...";"value1"="D"};
+{"key1"=#;subkey1="...";"value1"="E"};
+{"key1"=#;subkey1="...";"value1"="F"};
+{"key1"=#;subkey1="...";"value1"="G"};
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt.attr b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt.attr
new file mode 100644
index 0000000000..de343fa9cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input1opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value1";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt
new file mode 100644
index 0000000000..7e4ea597de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt
@@ -0,0 +1,3 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt.attr
new file mode 100644
index 0000000000..824353dafc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value2";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt
new file mode 100644
index 0000000000..17ff7232b7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt
@@ -0,0 +1,6 @@
+{"key2"=2u;subkey2=".";"value2"="U"};
+{"key2"=4u;subkey2=".";"value2"="Y"};
+{"key2"=4u;subkey2=".";"value2"="W"};
+{"key2"=#;subkey2=".";"value2"="P"};
+{"key2"=#;subkey2=".";"value2"="Q"};
+{"key2"=#;subkey2=".";"value2"="R"};
diff --git a/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt.attr b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt.attr
new file mode 100644
index 0000000000..990e5b6aee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/GraceJoin/input2opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ]
+ ];
+ [
+ "subkey2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value2";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql
new file mode 100644
index 0000000000..dfc37d30de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql
@@ -0,0 +1,33 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let res (List (ListType (DataType 'Uint64))))
+(let res (Append res (+ (Int32 '5) (Uint64 '5))))
+(let res (Append res (+ (Int32 '-5) (Uint64 '5))))
+(let res (Append res (+ (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Uint64))))
+(let res (Append res (- (Int32 '5) (Uint64 '5))))
+(let res (Append res (- (Int32 '-5) (Uint64 '5))))
+(let res (Append res (- (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Uint64))))
+(let res (Append res (* (Int32 '5) (Uint64 '5))))
+(let res (Append res (* (Int32 '-5) (Uint64 '5))))
+(let res (Append res (* (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (OptionalType (DataType 'Uint64)))))
+(let res (Append res (/ (Int32 '5) (Uint64 '5))))
+(let res (Append res (/ (Int32 '-5) (Uint64 '5))))
+(let res (Append res (/ (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (OptionalType (DataType 'Uint64)))))
+(let res (Append res (% (Int32 '5) (Uint64 '5))))
+(let res (Append res (% (Int32 '-5) (Uint64 '5))))
+(let res (Append res (% (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql
new file mode 100644
index 0000000000..9e4f52e93d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql
@@ -0,0 +1,28 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Int32, Uint16??? -> Int32???
+(let data (AsList (Int32 '1) (Just (Just (Just (Uint16 '2))))))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+# Int32?, Uint16??? -> Int32???
+(let data (AsList (Just (Int32 '1)) (Just (Just (Just (Uint16 '2))))))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+# Int64?, Null -> Int64?
+(let data (AsList (Just (Int64 '1)) (Null)))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+# Int64?, Nothing(Null?) -> Int64??
+(let data (AsList (Just (Int64 '1)) (Nothing (OptionalType (NullType)))))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+# Int64?, Nothing(Null?)? -> Int64???
+(let data (AsList (Just (Int64 '1)) (Just (Nothing (OptionalType (NullType))))))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql
new file mode 100644
index 0000000000..a326656deb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql
@@ -0,0 +1,35 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Int32 '1)))
+(let data (Append data (Uint8 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint32 '1)))
+(let data (Append data (Uint8 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint64 '1)))
+(let data (Append data (Uint8 '2)))
+(let data (Append data (Uint32 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int64 '1)))
+(let data (Append data (Uint8 '2)))
+(let data (Append data (Int32 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Float '1)))
+(let data (Append data (Uint8 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint32 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Double '1)))
+(let data (Append data (Uint8 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int64 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Float '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql
new file mode 100644
index 0000000000..d3a2fa7c5a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql
@@ -0,0 +1,38 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint8 '1)))
+(let data (Append data (Uint32 'x"02000000")))
+(let data (Append data (Int32 'x"02000000")))
+(let data (Append data (Uint64 'x"0200000000000000")))
+(let data (Append data (Int64 'x"0200000000000000")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int32 '1)))
+(let data (Append data (Uint32 'x"02000000")))
+(let data (Append data (Int32 'x"02000000")))
+(let data (Append data (Uint64 'x"0200000000000000")))
+(let data (Append data (Int64 'x"0200000000000000")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint32 '1)))
+(let data (Append data (Uint32 'x"02000000")))
+(let data (Append data (Int32 'x"02000000")))
+(let data (Append data (Uint64 'x"0200000000000000")))
+(let data (Append data (Int64 'x"0200000000000000")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int64 '1)))
+(let data (Append data (Uint32 'x"02000000")))
+(let data (Append data (Int32 'x"02000000")))
+(let data (Append data (Uint64 'x"0200000000000000")))
+(let data (Append data (Int64 'x"0200000000000000")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint64 '1)))
+(let data (Append data (Uint32 'x"02000000")))
+(let data (Append data (Int32 'x"02000000")))
+(let data (Append data (Uint64 'x"0200000000000000")))
+(let data (Append data (Int64 'x"0200000000000000")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql
new file mode 100644
index 0000000000..478ba0b492
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql
@@ -0,0 +1,38 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint8 '1)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int32 '1)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint32 '1)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int64 '1)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint64 '1)))
+(let data (Append data (Uint32 '2)))
+(let data (Append data (Int32 '2)))
+(let data (Append data (Uint64 '2)))
+(let data (Append data (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql
new file mode 100644
index 0000000000..1008cf6499
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Uint64 '1))
+(let data (If (Bool 'true) data (Double '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql
new file mode 100644
index 0000000000..afe7c04735
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql
@@ -0,0 +1,42 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint8 '1)))
+(let data (Append data (Minus (Int32 '-2))))
+(let data (Append data (Minus (Uint32 'x"FCFFFFFF"))))
+(let data (Append data (Minus (Int64 '-2))))
+(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF"))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int32 '1)))
+(let data (Append data (Minus (Int32 '-2))))
+(let data (Append data (Minus (Int32 '2))))
+(let data (Append data (Minus (Uint32 'x"FCFFFFFF"))))
+(let data (Append data (Minus (Int64 '-2))))
+(let data (Append data (Minus (Int64 '2))))
+(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF"))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint32 '1)))
+(let data (Append data (Minus (Int32 '-2))))
+(let data (Append data (Minus (Uint32 'x"FCFFFFFF"))))
+(let data (Append data (Minus (Int64 '-2))))
+(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF"))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int64 '1)))
+(let data (Append data (Minus (Int32 '-2))))
+(let data (Append data (Minus (Int32 '2))))
+(let data (Append data (Minus (Uint32 'x"FCFFFFFF"))))
+(let data (Append data (Minus (Int64 '-2))))
+(let data (Append data (Minus (Int64 '2))))
+(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF"))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint64 '1)))
+(let data (Append data (Minus (Int32 '-2))))
+(let data (Append data (Minus (Uint32 'x"FCFFFFFF"))))
+(let data (Append data (Minus (Int64 '-2))))
+(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF"))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql
new file mode 100644
index 0000000000..27ac41dba1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql
@@ -0,0 +1,38 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint8 '1)))
+(let data (Append data (Plus (Uint32 '2))))
+(let data (Append data (Plus (Int32 '2))))
+(let data (Append data (Plus (Uint64 '2))))
+(let data (Append data (Plus (Int64 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int32 '1)))
+(let data (Append data (Plus (Uint32 '2))))
+(let data (Append data (Plus (Int32 '2))))
+(let data (Append data (Plus (Uint64 '2))))
+(let data (Append data (Plus (Int64 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint32 '1)))
+(let data (Append data (Plus (Uint32 '2))))
+(let data (Append data (Plus (Int32 '2))))
+(let data (Append data (Plus (Uint64 '2))))
+(let data (Append data (Plus (Int64 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Int64 '1)))
+(let data (Append data (Plus (Uint32 '2))))
+(let data (Append data (Plus (Int32 '2))))
+(let data (Append data (Plus (Uint64 '2))))
+(let data (Append data (Plus (Int64 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (AsList (Uint64 '1)))
+(let data (Append data (Plus (Uint32 '2))))
+(let data (Append data (Plus (Int32 '2))))
+(let data (Append data (Plus (Uint64 '2))))
+(let data (Append data (Plus (Int64 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql
new file mode 100644
index 0000000000..9977eefc30
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Uint32))) (Uint64 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Uint64))) (Int64 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Int64))) (+ (Uint32 '1) (Uint32 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Uint32))) (Just (Uint32 '4))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql
new file mode 100644
index 0000000000..4ea96cadab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql
@@ -0,0 +1,10 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Coalesce (AsStruct '('"a" (Int32 '1))) (AsStruct)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql
new file mode 100644
index 0000000000..ce67a47d55
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Just (Just (String 'a)))))
+(let data (Append data (String 'b)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql
new file mode 100644
index 0000000000..88c2e397a7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Just (Just (String 'a))))
+(let data (If (Bool 'true) data (String 'b)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql
new file mode 100644
index 0000000000..3f2fa9519d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql
@@ -0,0 +1,42 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (== (Int32 '5) (Uint64 '5))))
+(let res (Append res (== (Int32 '-5) (Uint64 '5))))
+(let res (Append res (== (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (!= (Int32 '5) (Uint64 '5))))
+(let res (Append res (!= (Int32 '-5) (Uint64 '5))))
+(let res (Append res (!= (Uint64 '5) (Int32 '-5))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (< (Int32 '5) (Uint64 '5))))
+(let res (Append res (< (Int32 '-1) (Uint64 '5))))
+(let res (Append res (< (Int32 '1) (Uint64 '5))))
+(let res (Append res (< (Uint64 '1) (Int32 '-2))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (<= (Int32 '5) (Uint64 '5))))
+(let res (Append res (<= (Int32 '-1) (Uint64 '5))))
+(let res (Append res (<= (Int32 '1) (Uint64 '5))))
+(let res (Append res (<= (Uint64 '1) (Int32 '-2))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (> (Int32 '5) (Uint64 '5))))
+(let res (Append res (> (Int32 '-1) (Uint64 '5))))
+(let res (Append res (> (Int32 '1) (Uint64 '5))))
+(let res (Append res (> (Uint64 '1) (Int32 '-2))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let res (List (ListType (DataType 'Bool))))
+(let res (Append res (>= (Int32 '5) (Uint64 '5))))
+(let res (Append res (>= (Int32 '-1) (Uint64 '5))))
+(let res (Append res (>= (Int32 '1) (Uint64 '5))))
+(let res (Append res (>= (Uint64 '1) (Int32 '-2))))
+(let world (Write! world res_sink (Key) res '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql
new file mode 100644
index 0000000000..20547b0aaa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql
@@ -0,0 +1,10 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Enumerate (AsList (String 'a) (String 'b)) (Int64 '2) (Uint32 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql
new file mode 100644
index 0000000000..4da2353218
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# result is true for all tests below
+
+# To float
+(let value (Uint64 '18446744073709551615))
+(let commonType (DataType 'Float))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# To double
+(let value (Int64 '"-9223372036854775808"))
+(let commonType (DataType 'Double))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# To string
+(let value (Utf8 '"проверка"))
+(let commonType (DataType 'String))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql
new file mode 100644
index 0000000000..bab448cfa0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql
@@ -0,0 +1,70 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# Both signed (true)
+(let value (Int32 '0))
+(let commonType (DataType 'Int64))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Both unsigned (true)
+(let value (Uint8 '0))
+(let commonType (DataType 'Uint16))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# uint32(0) -> int32 (true)
+(let value (Uint32 '0))
+(let commonType (DataType 'Int32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# uint32(2^31-1) -> int32 (true)
+(let value (Uint32 '2147483647))
+(let commonType (DataType 'Int32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# uint32(2^31) -> int32 (false)
+(let value (Uint32 '2147483648))
+(let commonType (DataType 'Int32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# uint32(2^32-1) -> int32 (false)
+(let value (Uint32 '4294967295))
+(let commonType (DataType 'Int32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# int16(0) -> uint32 (true)
+(let value (Int16 '0))
+(let commonType (DataType 'Uint32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# int16(32767) -> uint32 (true)
+(let value (Int16 '32767))
+(let commonType (DataType 'Uint32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# int16(-1) -> uint32 (false)
+(let value (Int16 '"-1"))
+(let commonType (DataType 'Uint32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# int16(-32768) -> uint32 (false)
+(let value (Int16 '"-32768"))
+(let commonType (DataType 'Uint32))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql
new file mode 100644
index 0000000000..17dbdd3de4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql
@@ -0,0 +1,23 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# Dict<Uint32, Int16>> -> Dict<Uint32, Uint64> (false)
+(let value (AsDict '((Uint32 '0) (Int16 '"-1"))))
+(let commonType (DictType (DataType 'Uint32) (DataType 'Uint64)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Dict<Uint32, Uint16>> -> Dict<Uint32, Uint64> (true)
+(let value (AsDict '((Uint32 '0) (Uint16 '0))))
+(let commonType (DictType (DataType 'Uint32) (DataType 'Uint64)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql
new file mode 100644
index 0000000000..9622fabe4b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# List<Uint16> -> List<Int16> (false)
+(let value (AsList (Uint16 '32767)))
+(let value (Append value (Uint16 '32768)))
+(let commonType (ListType (DataType 'Int16)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# List<Uint16> -> List<UInt32> (true)
+(let value (AsList (Uint16 '32767)))
+(let value (Append value (Uint16 '32768)))
+(let commonType (ListType (DataType 'Uint32)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql
new file mode 100644
index 0000000000..468cab9df7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# result is true for all tests below
+
+# Int32 -> Uint64?? (false)
+(let value (Int32 '"-1"))
+(let commonType (OptionalType (OptionalType (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Just(Int32) -> Uint64?? (false)
+(let value (Just (Int32 '"-1")))
+(let commonType (OptionalType (OptionalType (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Nothing(Int32)? -> Uint64?? (true)
+(let value (Just (Nothing (OptionalType (DataType 'Int32)))))
+(let commonType (OptionalType (OptionalType (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql
new file mode 100644
index 0000000000..ae8830e61f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# Struct<Int16, Int16>> -> Struct<Uint32, Uint64> (false)
+(let value (AsStruct '('"a" (Int16 '0)) '('"b" (Int16 '"-1"))))
+(let commonType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Struct<Uint16, Uint16>> -> Struct<Uint32, Uint64> (true)
+(let value (AsStruct '('"a" (Uint16 '0)) '('"b" (Uint16 '0))))
+(let commonType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql
new file mode 100644
index 0000000000..3461a8d239
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# (Int16, Int16, Int16, Int16, Int16) -> (Uint32, Uint32, Uint64, Uint32, Uint64) (false)
+(let value '((Int16 '0) (Int16 '"-1") (Int16 '0) (Int16 '0) (Int16 '0)))
+(let commonType (TupleType (DataType 'Uint32) (DataType 'Uint32) (DataType 'Uint64) (DataType 'Uint32) (DataType 'Uint64)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# (Uint16, Uint16, Uint16, Uint16, Uint16) -> (Uint32, Uint32, Uint64, Uint32, Uint64) (true)
+(let value '((Uint16 '0) (Uint16 '0) (Uint16 '0) (Uint16 '0) (Uint16 '0)))
+(let commonType (TupleType (DataType 'Uint32) (DataType 'Uint32) (DataType 'Uint64) (DataType 'Uint32) (DataType 'Uint64)))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql
new file mode 100644
index 0000000000..a6de909851
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# Variant<Struct<Int16, Int16>>> -> Variant<Struct<Uint32, Uint64>> (false)
+(let variantType (VariantType (StructType '('"a" (DataType 'Int16)) '('"b" (DataType 'Int16)))))
+(let value (Variant (Int16 '"-1") '"a" variantType))
+(let commonType (VariantType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64)))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Variant<Struct<Uint16, Uint16>>> -> Variant<Struct<Uint32, Uint64>> (true)
+(let variantType (VariantType (StructType '('"a" (DataType 'Uint16)) '('"b" (DataType 'Uint16)))))
+(let value (Variant (Uint16 '0) '"a" variantType))
+(let commonType (VariantType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64)))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql
new file mode 100644
index 0000000000..28dd639e69
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+# Variant<Tuple<Int16, Int32>>> -> Variant<Tuple<Uint32, Uint64>> (false)
+(let variantType (VariantType (TupleType (DataType 'Int16) (DataType 'Int32))))
+(let value (Variant (Int32 '"-1") '1 variantType))
+(let commonType (VariantType (TupleType (DataType 'Uint32) (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+# Variant<Tuple<Uint16, Uint32>>> -> Variant<Tuple<Uint32, Uint64>> (true)
+(let variantType (VariantType (TupleType (DataType 'Uint16) (DataType 'Uint32))))
+(let value (Variant (Uint32 '0) '1 variantType))
+(let commonType (VariantType (TupleType (DataType 'Uint32) (DataType 'Uint64))))
+(let imlicitEqualsResult (Exists (StrictCast value commonType)))
+(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql
new file mode 100644
index 0000000000..f7393666cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsDict '((Uint32 '12) (Uint32 '34)))))
+(let data (Append data (AsDict '((Uint32 '56) (Int64 '78)))))
+(let dt (DictType (DataType 'Uint32) (DataType 'Int64)))
+(let data (Append data (Dict dt '((Uint32 '90) (Int64 '12)))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql
new file mode 100644
index 0000000000..b2259327f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsList (Int64 '12))))
+(let data (Append data (AsList (Int32 '-5))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql
new file mode 100644
index 0000000000..bd0adcd454
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsList (Uint32 '12))))
+(let data (Append data (AsList (Int64 '34))))
+(let lt (ListType (DataType 'Int64)))
+(let data (Append data (List lt (Int64 '56))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql
new file mode 100644
index 0000000000..ddf3ad70b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Just (Int64 '12))))
+(let data (Append data (Just (Int32 '-5))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql
new file mode 100644
index 0000000000..52b4d2872a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Just (Uint32 '12))))
+(let data (Append data (Just (Int64 '34))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql
new file mode 100644
index 0000000000..4bf5f79adb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsStruct '('key (Just (Int64 '12))))))
+(let data (Append data (AsStruct '('key (Int64 '34)))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql
new file mode 100644
index 0000000000..69051e7c19
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsStruct '('x (Uint32 '12)))))
+(let data (Append data (AsStruct '('x (Int64 '34)))))
+(let st (StructType '('x (DataType 'Int64))))
+(let data (Append data (Struct st '('x (Int64 '56)))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql
new file mode 100644
index 0000000000..a06b03fe9d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList '((Just (Int64 '12)))))
+(let data (Append data '((Int64 '34))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql
new file mode 100644
index 0000000000..28da7c8617
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList '((Uint32 '12))))
+(let data (Append data '((Int64 '34))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql
new file mode 100644
index 0000000000..2acee2f12b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql
@@ -0,0 +1,54 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Variant over tuple
+
+(let vt (ParseType '"Variant<Int64, Struct<A:Int64, B:Double>>"))
+(let vt2 (ParseType '"Variant<Int32, Struct<A:Int32, B:Double>>"))
+
+(let testcase1 (AsList (Variant (Int64 '10) '0 vt)))
+
+(let argBody (lambda '() (Variant (Int32 '11) '0 vt2)))
+(let argType (CallableType '() '(vt2)))
+(let argCallable (Callable argType argBody))
+(let arg (Apply argCallable))
+(let testcase1 (Append testcase1 arg))
+
+(let argBody (lambda '() (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) '1 vt2)))
+(let argType (CallableType '() '(vt2)))
+(let argCallable (Callable argType argBody))
+(let arg (Apply argCallable))
+(let testcase1 (Append testcase1 arg))
+
+# Variant over struct
+
+(let vts (ParseType '"Variant<A:Int64, B:Struct<A:Int64, B:Double>>"))
+(let vts2 (ParseType '"Variant<A:Int32, B:Struct<A:Int32, B:Double>>"))
+(let vts3 (ParseType '"Variant<A:Int32>"))
+
+(let testcase2 (AsList (Variant (Int64 '10) 'A vts)))
+
+(let argBody (lambda '() (Variant (Int32 '11) 'A vts2)))
+(let argType (CallableType '() '(vts2)))
+(let argCallable (Callable argType argBody))
+(let arg (Apply argCallable))
+(let testcase2 (Append testcase2 arg))
+
+(let argBody (lambda '() (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) 'B vts2)))
+(let argType (CallableType '() '(vts2)))
+(let argCallable (Callable argType argBody))
+(let arg (Apply argCallable))
+(let testcase2 (Append testcase2 arg))
+
+(let argBody (lambda '() (Variant (Int32 '11) 'A vts3)))
+(let argType (CallableType '() '(vts3)))
+(let argCallable (Callable argType argBody))
+(let arg (Apply argCallable))
+(let testcase2 (Append testcase2 arg))
+
+(let world (Write! world res_sink (Key) '(testcase1 testcase2) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql
new file mode 100644
index 0000000000..bbc1bfa584
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql
@@ -0,0 +1,29 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+# Variant over struct
+
+(let vt (ParseType '"Variant<Int64, Struct<A:Int64, B:Double>>"))
+(let vt2 (ParseType '"Variant<Int32, Struct<A:Int32, B:Double>>"))
+
+(let testcase1 (AsList (Variant (Int64 '10) '0 vt)))
+(let testcase1 (Append testcase1 (Variant (Int32 '11) '0 vt2)))
+(let testcase1 (Append testcase1 (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) '1 vt2)))
+
+# Variant over tuple
+
+(let vts (ParseType '"Variant<A:Int64, B:Struct<A:Int64, B:Double>>"))
+(let vts2 (ParseType '"Variant<A:Int32, B:Struct<A:Int32, B:Double>>"))
+(let vts3 (ParseType '"Variant<A:Int32>"))
+
+(let testcase2 (AsList (Variant (Int64 '10) 'A vts)))
+(let testcase2 (Append testcase2 (Variant (Int32 '11) 'A vts2)))
+(let testcase2 (Append testcase2 (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) 'B vts2)))
+(let testcase2 (Append testcase2 (Variant (Int32 '11) 'A vts3)))
+
+(let world (Write! world res_sink (Key) '(testcase1 testcase2) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql
new file mode 100644
index 0000000000..8c5bc62595
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (AsStruct '('key (Just (Int64 '12))))))
+(let data (Append data (AsStruct '('key (Int64 '34)) '('value (String 'foo)))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql
new file mode 100644
index 0000000000..cf59f2bb0c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let ct (ParseType '"(Uint32?,Uint32)->Uint32"))
+(let callable (Callable ct (lambda '(x y) (Coalesce x y))))
+(let world (Write! world res_sink (Key) (Apply callable (Null) (Uint32 '2)) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql
new file mode 100644
index 0000000000..718fabeac3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql
@@ -0,0 +1,25 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (ShiftLeft (Int32 '"1") (Int64 '"10")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Int64 '"1") (Int64 '"10")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Int32 '"1") (Int64 '"40")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Int64 '"1") (Int64 '"40")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(let data (ShiftLeft (Just (Int32 '"1")) (Int64 '"10")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Just (Int64 '"1")) (Int64 '"10")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Just (Int32 '"1")) (Int64 '"40")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (ShiftLeft (Just (Int64 '"1")) (Int64 '"40")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql
new file mode 100644
index 0000000000..e906d237e5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql
@@ -0,0 +1,10 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Skip (AsList (String 'a) (String 'b)) (Int64 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql
new file mode 100644
index 0000000000..2de7c5efe9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql
@@ -0,0 +1,10 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Substring (String 'abcde) (Int64 '2) (Uint64 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql
new file mode 100644
index 0000000000..b91a23e1de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql
@@ -0,0 +1,10 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Take (AsList (String 'a) (String 'b)) (Int64 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql
new file mode 100644
index 0000000000..a2d9759568
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)) '('D (DataType 'Int32)))))
+(let test (Variant (Int32 '0) 'B testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql
new file mode 100644
index 0000000000..ac57358f03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('X (DataType 'Int32)))))
+(let test (Variant (Int32 '0) 'B testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql
new file mode 100644
index 0000000000..a4e5f7dd40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let test (Variant (Int32 '0) 'X testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql
new file mode 100644
index 0000000000..a7bfc3ca2a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Float)) '('C (DataType 'Int32)))))
+(let test (Variant (Float '0) 'B testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql
new file mode 100644
index 0000000000..cc6a372e44
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Float)))))
+(let test (Variant (Int32 '0) 'B testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql
new file mode 100644
index 0000000000..d6e73eab29
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let test (Variant (Int32 '0) '1 testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql
new file mode 100644
index 0000000000..e0419e94da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let test (Variant (Int32 '0) '1 testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql
new file mode 100644
index 0000000000..615950d586
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Float) (DataType 'Int32))))
+(let test (Variant (Float '0) '1 testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql
new file mode 100644
index 0000000000..b9d7408383
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Float))))
+(let test (Variant (Int32 '0) '1 testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql
new file mode 100644
index 0000000000..d58f23fe27
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let test (Variant (Int32 '0) '1 testType))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql
new file mode 100644
index 0000000000..80492a709e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)) '('D (DataType 'Int32)))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) 'B testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql
new file mode 100644
index 0000000000..b71b50dff7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('X (DataType 'Int32)))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) 'B testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql
new file mode 100644
index 0000000000..bd91e105e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) 'X testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql
new file mode 100644
index 0000000000..f40ab1d5d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Float)) '('C (DataType 'Int32)))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Float '0) 'B testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql
new file mode 100644
index 0000000000..aa0ab07e67
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Float)))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) 'B testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql
new file mode 100644
index 0000000000..5c9d947981
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) '1 testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql
new file mode 100644
index 0000000000..2ececbce27
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) '1 testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql
new file mode 100644
index 0000000000..21c992bea5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Float) (DataType 'Int32))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Float '0) '1 testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql
new file mode 100644
index 0000000000..be762d2421
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let orig (Variant (Int32 '0) '1 origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Float))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) '1 testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql
new file mode 100644
index 0000000000..01a658c16e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
+(let orig (Variant (Int32 '0) 'B origType))
+
+(let testcase (AsList orig))
+
+(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32))))
+(let testCallableType (CallableType '() '(testType)))
+(let testBody (lambda '() (Variant (Int32 '0) '1 testType)))
+(let testCallable (Callable testCallableType testBody))
+(let test (Apply testCallable))
+
+(let testcase (Append testcase test))
+
+(let world (Write! world res_sink (Key) testcase '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/AccessDictOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/AccessDictOpt.yql
new file mode 100644
index 0000000000..e41c01a7b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/AccessDictOpt.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t (ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
+ (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One)
+))
+
+(let jt (Just t))
+(let n (Nothing (TypeOf jt)))
+
+(let world (Write! world res_sink (Key) (Contains jt (String 'dkey1)) '('('type))))
+(let world (Write! world res_sink (Key) (Contains jt (String 'dkeyx)) '('('type))))
+(let world (Write! world res_sink (Key) (Contains n (String 'dkey1)) '('('type))))
+(let world (Write! world res_sink (Key) (Contains n (String 'dkeyx)) '('('type))))
+
+(let world (Write! world res_sink (Key) (Lookup jt (String 'dkey1)) '('('type))))
+(let world (Write! world res_sink (Key) (Lookup jt (String 'dkeyx)) '('('type))))
+(let world (Write! world res_sink (Key) (Lookup n (String 'dkey1)) '('('type))))
+(let world (Write! world res_sink (Key) (Lookup n (String 'dkeyx)) '('('type))))
+
+(let world (Write! world res_sink (Key) (DictItems jt) '('('type))))
+(let world (Write! world res_sink (Key) (DictItems n) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/AggrMinMaxTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/AggrMinMaxTuple.yql
new file mode 100644
index 0000000000..c84047a295
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/AggrMinMaxTuple.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let write (lambda '(world x y) (block '(
+ (let world (Write! world res_sink (Key) (String '==============) '()))
+ (let world (Write! world res_sink (Key) (AggrMin x y) '('('type))))
+ (let world (Write! world res_sink (Key) (AggrMax x y) '('('type))))
+ (return world)
+))))
+
+(let world (Apply write world '() '()))
+(let world (Apply write world (Just '()) (Just '())))
+
+(let world (Apply write world '((Int64 '1)) '((Int64 '1))))
+(let world (Apply write world '((Int64 '1)) '((Int64 '2))))
+(let world (Apply write world '((Uint64 '3)) '((Uint64 '2))))
+
+(let world (Apply write world '((Just (Int32 '1))) '((Just (Int32 '2)))))
+(let world (Apply write world (Just '((Just (Int32 '1)))) (Just '((Just (Int32 '3))))))
+
+(let world (Apply write world '((Int8 '1) (String 'a)) '((Int8 '1) (String 'a))))
+(let world (Apply write world '((Int8 '1) (String 'a)) '((Int8 '1) (String 'b))))
+(let world (Apply write world '((Int8 '1) (String 'b)) '((Int8 '1) (String 'a))))
+(let world (Apply write world '((Int8 '1) (String 'a)) '((Int8 '2) (String 'a))))
+(let world (Apply write world '((Int8 '2) (String 'a)) '((Int8 '1) (String 'b))))
+(let world (Apply write world '((Int8 '2) (String 'b)) '((Int8 '1) (String 'a))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/BitCore.yql b/yql/essentials/tests/s-expressions/suites/InMem/BitCore.yql
new file mode 100644
index 0000000000..9cf4e53963
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/BitCore.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import core_module '"/lib/yql/core.yql")
+(let res_sink (DataSink 'result))
+(let test (lambda '(world data) (block '(
+ (let world (Write! world res_sink (Key) data '('('type))))
+ (return world)
+))))
+
+(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '0))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '10))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '11))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '23))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (String '"\x05\x04")) (Uint64 '0))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Utf8 '"\x05\x04")) (Uint64 '0))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint8 '5) (Uint8 '0))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint32 '5) (Uint8 '2))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint64 '5) (Uint8 '1))))
+(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Uint8 '5)) (Uint8 '0))))
+(let world (Apply test world (Apply (bind core_module 'SetBit) (Uint32 '5) (Uint8 '1))))
+(let world (Apply test world (Apply (bind core_module 'SetBit) (Just (Uint32 '5)) (Uint8 '1))))
+(let world (Apply test world (Apply (bind core_module 'ClearBit) (Uint32 '5) (Uint8 '0))))
+(let world (Apply test world (Apply (bind core_module 'ClearBit) (Just (Uint32 '5)) (Uint8 '0))))
+(let world (Apply test world (Apply (bind core_module 'FlipBit) (Uint32 '5) (Uint8 '0))))
+(let world (Apply test world (Apply (bind core_module 'FlipBit) (Just (Uint32 '5)) (Uint8 '0))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ByteAt.yql b/yql/essentials/tests/s-expressions/suites/InMem/ByteAt.yql
new file mode 100644
index 0000000000..6be3f9bffc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ByteAt.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (ByteAt (String 'ab) (Uint32 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (ByteAt (String 'ab) (Uint32 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (ByteAt (Just (String 'ab)) (Uint32 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (ByteAt (Just (String 'ab)) (Uint32 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (ByteAt (Nothing (OptionalType (DataType 'String))) (Uint32 '1)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Collect.yql b/yql/essentials/tests/s-expressions/suites/InMem/Collect.yql
new file mode 100644
index 0000000000..e62000f1ee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Collect.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (String 'aaa) (String 'bbb) (String 'ccc)))
+(let world (Write! world res_sink (Key) (Collect (Iterator list)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Collect (LazyList (LazyList (Collect list))))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/CompareNulls.yql b/yql/essentials/tests/s-expressions/suites/InMem/CompareNulls.yql
new file mode 100644
index 0000000000..1e399b48cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/CompareNulls.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let write (lambda '(world x y) (block '(
+ (let world (Write! world res_sink (Key) (String '==============) '()))
+ (let world (Write! world res_sink (Key) (== x y) '('('type))))
+ (return world)
+))))
+
+(let world (Apply write world (Null) (Null)))
+(let world (Apply write world (Null) (Nothing (OptionalType (DataType 'String)))))
+(let world (Apply write world (Int32 '0) (Null)))
+(let world (Apply write world '((Null)) '((Null))))
+(let world (Apply write world '((Int32 '1) (Null)) '((Int32 '1) (Null))))
+(let world (Apply write world '((Int32 '1) (Nothing (OptionalType (DataType 'String)))) '((Int32 '1) (Nothing (OptionalType (DataType 'String))))))
+
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct.yql b/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct.yql
new file mode 100644
index 0000000000..112fc7f534
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct.yql
@@ -0,0 +1,39 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let write (lambda '(world x y) (block '(
+ (let world (Write! world res_sink (Key) (String '==============) '()))
+ (let world (Write! world res_sink (Key) (== x y) '('('type))))
+ (let world (Write! world res_sink (Key) (!= x y) '('('type))))
+ (return world)
+))))
+
+(let world (Apply write world (AsStruct) (AsStruct)))
+(let world (Apply write world (Just (AsStruct)) (AsStruct)))
+(let world (Apply write world (AsStruct) (Just (AsStruct))))
+(let world (Apply write world (Just (AsStruct)) (Just (AsStruct))))
+
+(let world (Apply write world (AsStruct '('x (Int32 '1))) (AsStruct '('x (Uint64 '1)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1))) (AsStruct '('x (Uint64 '2)))))
+(let world (Apply write world (AsStruct '('x (Int32 '3))) (AsStruct '('x (Uint64 '2)))))
+
+(let world (Apply write world (Just (AsStruct '('x (Int32 '1)))) (AsStruct '('x (Uint64 '1)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1))) (Just (AsStruct '('x (Uint64 '1))))))
+(let world (Apply write world (AsStruct '('x (Just (Int32 '1)))) (AsStruct '('x (Uint64 '1)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1))) (AsStruct '('x (Just (Uint64 '1))))))
+(let world (Apply write world (Just (AsStruct '('x (Just (Int32 '1))))) (AsStruct '('x (Uint64 '1)))))
+(let world (Apply write world (Just (AsStruct '('x (Just (Int32 '1))))) (AsStruct '('x (Just (Uint64 '1))))))
+(let world (Apply write world (Just (AsStruct '('x (Just (Int32 '1))))) (Just (AsStruct '('x (Just (Uint64 '1)))))))
+
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (String 'a))) (AsStruct '('x (Uint64 '1)) '('y (String 'a)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (String 'a))) (AsStruct '('x (Uint64 '1)) '('y (String 'b)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (String 'b))) (AsStruct '('x (Uint64 '1)) '('y (String 'a)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (String 'a))) (AsStruct '('x (Uint64 '2)) '('y (String 'a)))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct2.yql b/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct2.yql
new file mode 100644
index 0000000000..5d9ca77381
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/CompareStruct2.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let write (lambda '(world x y) (block '(
+ (let world (Write! world res_sink (Key) (String '==============) '()))
+ (let world (Write! world res_sink (Key) (== x y) '('('type))))
+ (let world (Write! world res_sink (Key) (!= x y) '('('type))))
+ (return world)
+))))
+
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (String 'a))) (AsStruct '('y (String 'a)) '('z (Int64 '1)))))
+(let world (Apply write world (AsStruct '('x (Int32 '1)) '('y (Just (String 'a)))) (AsStruct '('y (String 'a)) '('z (Int64 '1)))))
+(let world (Apply write world (AsStruct) (AsStruct '('y (String 'a)) '('z (Int64 '1)))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/CompareTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/CompareTuple.yql
new file mode 100644
index 0000000000..b51f864573
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/CompareTuple.yql
@@ -0,0 +1,45 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let write (lambda '(world x y) (block '(
+ (let world (Write! world res_sink (Key) (String '==============) '()))
+ (let world (Write! world res_sink (Key) (== x y) '('('type))))
+ (let world (Write! world res_sink (Key) (!= x y) '('('type))))
+ (let world (Write! world res_sink (Key) (< x y) '('('type))))
+ (let world (Write! world res_sink (Key) (<= x y) '('('type))))
+ (let world (Write! world res_sink (Key) (> x y) '('('type))))
+ (let world (Write! world res_sink (Key) (>= x y) '('('type))))
+ (return world)
+))))
+
+(let world (Apply write world '() '()))
+(let world (Apply write world (Just '()) '()))
+(let world (Apply write world '() (Just '())))
+(let world (Apply write world (Just '()) (Just '())))
+
+(let world (Apply write world '((Int32 '1)) '((Uint64 '1))))
+(let world (Apply write world '((Int32 '1)) '((Uint64 '2))))
+(let world (Apply write world '((Int32 '3)) '((Uint64 '2))))
+
+(let world (Apply write world (Just '((Int32 '1))) '((Uint64 '1))))
+(let world (Apply write world '((Int32 '1)) (Just '((Uint64 '1)))))
+(let world (Apply write world '((Just (Int32 '1))) '((Uint64 '1))))
+(let world (Apply write world '((Int32 '1)) '((Just (Uint64 '1)))))
+(let world (Apply write world (Just '((Just (Int32 '1)))) '((Uint64 '1))))
+(let world (Apply write world (Just '((Just (Int32 '1)))) '((Just (Uint64 '1)))))
+(let world (Apply write world (Just '((Just (Int32 '1)))) (Just '((Just (Uint64 '1))))))
+
+(let world (Apply write world '((Int32 '1) (String 'a)) '((Uint64 '1) (String 'a))))
+(let world (Apply write world '((Int32 '1) (String 'a)) '((Uint64 '1) (String 'b))))
+(let world (Apply write world '((Int32 '1) (String 'b)) '((Uint64 '1) (String 'a))))
+(let world (Apply write world '((Int32 '1) (String 'a)) '((Uint64 '2) (String 'a))))
+(let world (Apply write world '((Int32 '2) (String 'a)) '((Uint64 '1) (String 'b))))
+(let world (Apply write world '((Int32 '2) (String 'b)) '((Uint64 '1) (String 'a))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.sql b/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.sql
new file mode 100644
index 0000000000..d916034abc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.sql
@@ -0,0 +1,36 @@
+$es = YQL::Nothing(YQL::OptionalType(YQL::DataType(AsAtom("String"))));
+$eu = YQL::Nothing(YQL::OptionalType(YQL::DataType(AsAtom("Utf8"))));
+$u1 = YQL::Unwrap(cast("a" as utf8));
+$u2 = YQL::Unwrap(cast("b" as utf8));
+----------
+select YQL::Concat("a", "b");
+select YQL::Concat(YQL::Just("a"), "b");
+select YQL::Concat("a", YQL::Just("b"));
+select YQL::Concat(YQL::Just("a"), "b");
+select YQL::Concat($es, "b");
+select YQL::Concat("a", $es);
+select YQL::Concat($es, $es);
+----------
+select YQL::Concat("a", $u2);
+select YQL::Concat(YQL::Just("a"), $u2);
+select YQL::Concat("a", YQL::Just($u2));
+select YQL::Concat(YQL::Just("a"), $u2);
+select YQL::Concat($es, $u2);
+select YQL::Concat("a", $eu);
+select YQL::Concat($es, $eu);
+----------
+select YQL::Concat($u1, "b");
+select YQL::Concat(YQL::Just($u1), "b");
+select YQL::Concat($u1, YQL::Just("b"));
+select YQL::Concat(YQL::Just($u1), "b");
+select YQL::Concat($eu, "b");
+select YQL::Concat($u1, $es);
+select YQL::Concat($eu, $es);
+----------
+select YQL::Concat($u1, $u2);
+select YQL::Concat(YQL::Just($u1), $u2);
+select YQL::Concat($u1, YQL::Just($u2));
+select YQL::Concat(YQL::Just($u1), $u2);
+select YQL::Concat($eu, $u2);
+select YQL::Concat($u1, $eu);
+select YQL::Concat($eu, $eu);
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.yql
new file mode 100644
index 0000000000..a20d1188dc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ConcatOpt.yql
@@ -0,0 +1,572 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" (String '"a")) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") ("Just" (String '"b"))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" (String '"a")) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"String"))) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") ("Nothing" ("OptionalType" ("DataType" '"String")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"String"))) ("Nothing" ("OptionalType" ("DataType" '"String")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" (String '"a")) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") ("Just" ("Unwrap" (Cast (String '"b") 'Utf8)))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" (String '"a")) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"String"))) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" (String '"a") ("Nothing" ("OptionalType" ("DataType" '"Utf8")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"String"))) ("Nothing" ("OptionalType" ("DataType" '"Utf8")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" ("Unwrap" (Cast (String '"a") 'Utf8))) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) ("Just" (String '"b"))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" ("Unwrap" (Cast (String '"a") 'Utf8))) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"Utf8"))) (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) ("Nothing" ("OptionalType" ("DataType" '"String")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"Utf8"))) ("Nothing" ("OptionalType" ("DataType" '"String")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" ("Unwrap" (Cast (String '"a") 'Utf8))) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) ("Just" ("Unwrap" (Cast (String '"b") 'Utf8)))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Just" ("Unwrap" (Cast (String '"a") 'Utf8))) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"Utf8"))) ("Unwrap" (Cast (String '"b") 'Utf8))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Unwrap" (Cast (String '"a") 'Utf8)) ("Nothing" ("OptionalType" ("DataType" '"Utf8")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Concat" ("Nothing" ("OptionalType" ("DataType" '"Utf8"))) ("Nothing" ("OptionalType" ("DataType" '"Utf8")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/CountBits.yql b/yql/essentials/tests/s-expressions/suites/InMem/CountBits.yql
new file mode 100644
index 0000000000..5f688a5075
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/CountBits.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (CountBits (Int8 '-1)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Uint8 '7)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Int16 '-1)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Uint16 '16)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Int32 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Uint32 '0)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Int64 '-7)) '('('type))))
+(let world (Write! world res_sink (Key) (CountBits (Uint64 '7)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Default.yql b/yql/essentials/tests/s-expressions/suites/InMem/Default.yql
new file mode 100644
index 0000000000..a7f8667067
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Default.yql
@@ -0,0 +1,38 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let test (lambda '(world type) (block '(
+ (let world (Write! world res_sink (Key) (Default (DataType type)) '('('type))))
+ (let world (Write! world res_sink (Key) (Default (OptionalType (DataType type))) '('('type))))
+ (return world)
+))))
+
+(let world (Apply test world 'Bool))
+(let world (Apply test world 'Int8))
+(let world (Apply test world 'Uint8))
+(let world (Apply test world 'Int16))
+(let world (Apply test world 'Uint16))
+(let world (Apply test world 'Int32))
+(let world (Apply test world 'Uint32))
+(let world (Apply test world 'Int64))
+(let world (Apply test world 'Uint64))
+(let world (Apply test world 'Float))
+(let world (Apply test world 'Double))
+(let world (Apply test world 'String))
+(let world (Apply test world 'Utf8))
+# yson & json don't have a default value
+(let world (Apply test world 'Date))
+(let world (Apply test world 'Datetime))
+(let world (Apply test world 'Timestamp))
+(let world (Apply test world 'Interval))
+(let world (Apply test world 'TzDate))
+(let world (Apply test world 'TzDatetime))
+(let world (Apply test world 'TzTimestamp))
+(let world (Apply test world 'Uuid))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Demux.yql b/yql/essentials/tests/s-expressions/suites/InMem/Demux.yql
new file mode 100644
index 0000000000..6fd4b3f3cd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Demux.yql
@@ -0,0 +1,44 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let varTuple (VariantType (TupleType (DataType 'String) (DataType 'Bool) (DataType 'Uint32))))
+
+(let varList (AsList
+ (Variant (String 'a1) '0 varTuple)
+ (Variant (Uint32 '3) '2 varTuple)
+ (Variant (String 'a2) '0 varTuple)
+ (Variant (Bool 'false) '1 varTuple)
+ (Variant (Uint32 '1) '2 varTuple)
+ (Variant (String 'a3) '0 varTuple)
+ (Variant (Uint32 '2) '2 varTuple)
+ (Variant (Bool 'true) '1 varTuple)
+ (Variant (Uint32 '4) '2 varTuple)
+))
+
+(let data (Demux varList))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let varStruct (VariantType (StructType '('s (DataType 'String)) '('b (DataType 'Bool)) '('u (DataType 'Uint32)))))
+
+(let varList (AsList
+ (Variant (String 'a1) 's varStruct)
+ (Variant (Uint32 '3) 'u varStruct)
+ (Variant (String 'a2) 's varStruct)
+ (Variant (Bool 'false) 'b varStruct)
+ (Variant (Uint32 '1) 'u varStruct)
+ (Variant (String 'a3) 's varStruct)
+ (Variant (Uint32 '2) 'u varStruct)
+ (Variant (Bool 'true) 'b varStruct)
+ (Variant (Uint32 '4) 'u varStruct)
+))
+
+(let data (Demux varList))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/DictOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/DictOpt.yql
new file mode 100644
index 0000000000..b12be636c8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/DictOpt.yql
@@ -0,0 +1,33 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t1 (OptionalType (DataType 'Uint32)))
+(let t2 (DataType 'String))
+(let d1 (DictType t1 t2))
+(let d2 (Dict d1
+ '((Just (Uint32 '4)) (String 'aaa))
+ '((Just (Uint32 '4)) (String 'zzz))
+ '((Nothing (OptionalType (DataType 'Uint32))) (String 'bbb)))
+)
+
+(let world (Write! world res_sink (Key) d2 '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint32 '5))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint32 '5)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Nothing (OptionalType (DataType 'Uint32))))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (OptionalType (DataType 'Uint32))))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint32 '5))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint32 '5)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Nothing (OptionalType (DataType 'Uint32))))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (OptionalType (DataType 'Uint32))))) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/DictOptTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/DictOptTuple.yql
new file mode 100644
index 0000000000..4c9e5b46d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/DictOptTuple.yql
@@ -0,0 +1,30 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t1 (TupleType (OptionalType (DataType 'Uint32)) (DataType 'String)))
+(let t2 (DataType 'String))
+(let d1 (DictType t1 t2))
+(let d2 (Dict d1
+ '('((Just (Uint32 '4)) (String 'ggg)) (String 'aaa))
+ '('((Just (Uint32 '4)) (String 'hhh)) (String 'bbb))
+ '('((Just (Uint32 '4)) (String 'ggg)) (String 'ccc))
+ '('((Nothing (OptionalType (DataType 'Uint32))) (String 'rrr)) (String 'ddd))
+))
+
+(let world (Write! world res_sink (Key) (Contains d2 '((Just (Uint32 '4)) (String 'ggg))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 '((Just (Uint32 '5)) (String 'ggg))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 '((Just (Uint32 '4)) (String 'sss))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 '((Nothing (OptionalType (DataType 'Uint32))) (String 'rrr))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 '((Nothing (OptionalType (DataType 'Uint32))) (String 'qqq))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 '((Just (Uint32 '4)) (String 'ggg))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 '((Just (Uint32 '5)) (String 'ggg))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 '((Just (Uint32 '4)) (String 'sss))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 '((Nothing (OptionalType (DataType 'Uint32))) (String 'rrr))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 '((Nothing (OptionalType (DataType 'Uint32))) (String 'qqq))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeContains.yql b/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeContains.yql
new file mode 100644
index 0000000000..25e92e7eff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeContains.yql
@@ -0,0 +1,81 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t1 (DataType 'Uint32))
+(let t2 (DataType 'String))
+(let dt (DictType t1 t2))
+(let d (Dict dt '((Uint32 '4) (String 'aaa)) '((Uint32 '5) (String 'bbb))) )
+(let jd (Just d))
+(let n (Nothing (TypeOf jd)))
+
+(let nu (Nothing (OptionalType (DataType 'Uint32))))
+(let t3 (OptionalType (DataType 'Uint32)))
+(let t4 (OptionalType (DataType 'String)))
+(let dt2 (DictType t3 t4))
+(let d2 (Dict dt2
+'((Just (Uint32 '4)) (Just (String 'aaa)))
+'((Just (Uint32 '5)) (Just (String 'bbb)))
+'(nu (Just (String 'ccc)))
+))
+(let jd2 (Just d2))
+(let n2 (Nothing (TypeOf jd2)))
+
+(let world (Write! world res_sink (Key) (Contains d (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Contains d (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Contains jd (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains jd (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains jd (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains jd (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Contains jd (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Contains n (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains n (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains n (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains n (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Contains n (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Contains d nu) '()))
+(let world (Write! world res_sink (Key) (Contains d (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d (Just (Uint8 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d (Just (Int64 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d (Just (Int64 '-4))) '()))
+(let world (Write! world res_sink (Key) (Contains d (Just (Uint64 '4))) '()))
+
+(let world (Write! world res_sink (Key) (Contains d2 (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Int32 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint8 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Int32 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Int64 '4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Int64 '-4))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint64 '4))) '()))
+
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Uint8)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Int32)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Int64)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Uint64)))) '()))
+
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint8 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Int32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Int64 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Int64 '-4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint64 '4)))) '()))
+(let world (Write! world res_sink (Key) (Contains d2 (Just (Nothing (OptionalType (DataType 'Int64))))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeLookup.yql b/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeLookup.yql
new file mode 100644
index 0000000000..d7c81831cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/DiffKeyTypeLookup.yql
@@ -0,0 +1,81 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t1 (DataType 'Uint32))
+(let t2 (DataType 'String))
+(let dt (DictType t1 t2))
+(let d (Dict dt '((Uint32 '4) (String 'aaa)) '((Uint32 '5) (String 'bbb))) )
+(let jd (Just d))
+(let n (Nothing (TypeOf jd)))
+
+(let nu (Nothing (OptionalType (DataType 'Uint32))))
+(let t3 (OptionalType (DataType 'Uint32)))
+(let t4 (OptionalType (DataType 'String)))
+(let dt2 (DictType t3 t4))
+(let d2 (Dict dt2
+'((Just (Uint32 '4)) (Just (String 'aaa)))
+'((Just (Uint32 '5)) (Just (String 'bbb)))
+'(nu (Just (String 'ccc)))
+))
+(let jd2 (Just d2))
+(let n2 (Nothing (TypeOf jd2)))
+
+(let world (Write! world res_sink (Key) (Lookup d (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Lookup jd (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup jd (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup jd (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup jd (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Lookup jd (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Lookup n (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup n (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup n (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup n (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Lookup n (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Lookup d nu) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Just (Uint8 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Just (Int64 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Just (Int64 '-4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d (Just (Uint64 '4))) '()))
+
+(let world (Write! world res_sink (Key) (Lookup d2 (Uint8 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Int32 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Uint32 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Int64 '4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Int64 '-4)) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Uint64 '4)) '()))
+
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint8 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Int32 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint32 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Int64 '4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Int64 '-4))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint64 '4))) '()))
+
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Uint8)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Int32)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Int64)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Uint64)))) '()))
+
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint8 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Int32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint32 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Int64 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Int64 '-4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint64 '4)))) '()))
+(let world (Write! world res_sink (Key) (Lookup d2 (Just (Nothing (OptionalType (DataType 'Int64))))) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ExtractMembers.yql b/yql/essentials/tests/s-expressions/suites/InMem/ExtractMembers.yql
new file mode 100644
index 0000000000..ed1ea53868
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ExtractMembers.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let world (Write! world res_sink (Key) (ExtractMembers list1 '('a)) '('('type))))
+(let world (Write! world res_sink (Key) (ExtractMembers (Collect (Iterator list1)) '()) '('('type))))
+(let world (Write! world res_sink (Key) (ExtractMembers (Just str1) '('a 'c)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FilterNullMembers.yql b/yql/essentials/tests/s-expressions/suites/InMem/FilterNullMembers.yql
new file mode 100644
index 0000000000..6d14f0d268
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FilterNullMembers.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+ (AsStruct '('key (Just (Uint32 '1))) '('value (String 'a)))
+ (AsStruct '('key (Nothing (OptionalType (DataType 'Uint32)))) '('value (String 'a)))
+))
+
+(let world (Write! world res_sink (Key) (FilterNullMembers list '('key)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FilterWithLimit.yql b/yql/essentials/tests/s-expressions/suites/InMem/FilterWithLimit.yql
new file mode 100644
index 0000000000..ee25f707f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FilterWithLimit.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (Int32 '1) (Int32 '2) (Int32 '3) (Int32 '4) (Int32 '5) (Int32 '6) (Int32 '7) (Int32 '8) (Int32 '9)))
+(let world (Write! world res_sink (Key) (OrderedFilter list
+ (lambda '(x) (AggrLess x (Int32 '6))) (Int32 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (Filter (LazyList list)
+ (lambda '(x) (AggrGreater x (Int32 '4))) (Uint64 '3)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Filter (ToFlow list)
+ (lambda '(x) (AggrGreaterOrEqual x (Int32 '3))) (Int16 '4))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FlatMapFiltersSortedList.yql b/yql/essentials/tests/s-expressions/suites/InMem/FlatMapFiltersSortedList.yql
new file mode 100644
index 0000000000..306f073803
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FlatMapFiltersSortedList.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+(AsStruct '('a (Int32 '7)) '('b (String 'two)))
+(AsStruct '('a (Int32 '1)) '('b (String 'one)))
+(AsStruct '('a (Int32 '3)) '('b (String 'two)))
+(AsStruct '('a (Int32 '5)) '('b (String 'one)))
+(AsStruct '('a (Int32 '5)) '('b (String 'two)))
+))
+
+(let keyExtractor (lambda '(x) '((Member x 'a)(Member x 'b))))
+(let data (ListSort list '((Bool 'true) (Bool 'false)) keyExtractor))
+(let mapped (ListFlatMap data (lambda '(x) (ListIf (Greater (Member x 'a) (Uint64 '2)) x) )))
+
+(let world (Write! world res_sink (Key) mapped '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FloatsIncDec.yql b/yql/essentials/tests/s-expressions/suites/InMem/FloatsIncDec.yql
new file mode 100644
index 0000000000..02b70ad22b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FloatsIncDec.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Inc (Double '3.3)) '('('type))))
+(let world (Write! world res_sink (Key) (Inc (Float '-7.5)) '('('type))))
+(let world (Write! world res_sink (Key) (Dec (Double '-0.3)) '('('type))))
+(let world (Write! world res_sink (Key) (Dec (Float '4.75)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FloatsMod.yql b/yql/essentials/tests/s-expressions/suites/InMem/FloatsMod.yql
new file mode 100644
index 0000000000..efa89ba44c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FloatsMod.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Mod (Double '3.3) (Double '1.7)) '('('type))))
+(let world (Write! world res_sink (Key) (Mod (Float '-7.5) (Double '0.7)) '('('type))))
+(let world (Write! world res_sink (Key) (Mod (Double '-0.3) (Float '-3.8)) '('('type))))
+(let world (Write! world res_sink (Key) (Mod (Float '4.75) (Float '-2.5)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Fold.yql b/yql/essentials/tests/s-expressions/suites/InMem/Fold.yql
new file mode 100644
index 0000000000..9f4ce156f3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Fold.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let doFold (lambda '(list) (Fold list (List (TypeOf list)) (lambda '(item state) (Append state item)))))
+(let world (Write! world res_sink (Key) (Apply doFold (AsList (String '"1") (String '"2") (String '"3") (String '"4"))) '('('type))))
+(let world (Write! world res_sink (Key) (Apply doFold (AsList '((String '"1") (String '"a")) '((String '"2") (String '"b")))) '('('type))))
+(let world (Write! world res_sink (Key) (Apply doFold (AsList (AsStruct '('"x" (String '"1"))) (AsStruct '('"x" (String '"2"))))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Fold1Map.yql b/yql/essentials/tests/s-expressions/suites/InMem/Fold1Map.yql
new file mode 100644
index 0000000000..751de45375
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Fold1Map.yql
@@ -0,0 +1,42 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'r))
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '3) (String 'b))
+'((Uint32 '5) (String 'i))
+'((Uint32 '8) (String 't))))
+
+(let init (lambda '(item) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey key)
+ (let sval val)
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (Fold1Map list init update))
+
+(let world (Write! world res_sink (Key) result '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverPreservedStream.yql b/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverPreservedStream.yql
new file mode 100644
index 0000000000..1a3aad97c9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverPreservedStream.yql
@@ -0,0 +1,63 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+ '((Uint32 '1) (String 'r))
+ '((Uint32 '1) (String 'a))
+ '((Uint32 '2) (String 'b))
+ '((Uint32 '3) (String 'b))
+ '((Uint32 '5) (String 'i))
+ '((Uint32 '8) (String 't))
+))
+(let base_stream (Iterator list))
+
+(let queue (QueueCreate (ListItemType (TypeOf list)) (Uint64 '5) (Uint64 '0)))
+#(let queue (QueueCreate (TupleType (DataType 'Uint32) (DataType 'String)) (Uint64 '5) (Uint64 '0)))
+(let stream (PreserveStream base_stream queue (Uint64 '2)))
+
+(let init (lambda '(item) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let next (QueuePeek queue (Uint64 '1) (DependsOn item)))
+ (let over (QueuePeek queue (Uint64 '2) (DependsOn item)))
+ (let nkey (Nth next '0))
+ (let nval (Nth next '1))
+ (let okey (Nth over '0))
+ (let oval (Nth over '1))
+ (let skey key)
+ (let sval val)
+ (let validate (== (+ key (Coalesce nkey (Uint32 '0))) (Coalesce okey (Uint32 '0))))
+ (let words (Concat (Concat val (Coalesce nval (String '""))) (Coalesce oval (String '""))))
+ (let new_item '(key val skey sval validate words))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let next (QueuePeek queue (Uint64 '1) (DependsOn item)))
+ (let over (QueuePeek queue (Uint64 '2) (DependsOn item)))
+ (let nkey (Nth next '0))
+ (let nval (Nth next '1))
+ (let okey (Nth over '0))
+ (let oval (Nth over '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let validate (== (+ key (Coalesce nkey (Uint32 '0))) (Coalesce okey (Uint32 '0))))
+ (let words (Concat (Concat val (Coalesce nval (String '""))) (Coalesce oval (String '""))))
+ (let new_item '(key val skey sval validate words))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (Fold1Map stream init update))
+
+(let world (Write! world res_sink (Key) (Collect result) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverUnboundedPreservedStream.yql b/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverUnboundedPreservedStream.yql
new file mode 100644
index 0000000000..c555c6df02
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Fold1MapOverUnboundedPreservedStream.yql
@@ -0,0 +1,63 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+ '((Uint32 '1) (String 'r))
+ '((Uint32 '1) (String 'a))
+ '((Uint32 '2) (String 'b))
+ '((Uint32 '3) (String 'b))
+ '((Uint32 '5) (String 'i))
+ '((Uint32 '8) (String 't))
+))
+(let base_stream (Iterator list))
+
+(let queue (QueueCreate (ListItemType (TypeOf list)) (Void) (Uint64 '0)))
+#(let queue (QueueCreate (TupleType (DataType 'Uint32) (DataType 'String)) (Uint64 '5) (Uint64 '0)))
+(let stream (PreserveStream base_stream queue (Uint64 '1000000)))
+
+(let init (lambda '(item) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let next (QueuePeek queue (Uint64 '1) (DependsOn item)))
+ (let over (QueuePeek queue (Uint64 '2) (DependsOn item)))
+ (let nkey (Nth next '0))
+ (let nval (Nth next '1))
+ (let okey (Nth over '0))
+ (let oval (Nth over '1))
+ (let skey key)
+ (let sval val)
+ (let validate (== (+ key (Coalesce nkey (Uint32 '0))) (Coalesce okey (Uint32 '0))))
+ (let words (Concat (Concat val (Coalesce nval (String '""))) (Coalesce oval (String '""))))
+ (let new_item '(key val skey sval validate words))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let next (QueuePeek queue (Uint64 '1) (DependsOn item)))
+ (let over (QueuePeek queue (Uint64 '2) (DependsOn item)))
+ (let nkey (Nth next '0))
+ (let nval (Nth next '1))
+ (let okey (Nth over '0))
+ (let oval (Nth over '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let validate (== (+ key (Coalesce nkey (Uint32 '0))) (Coalesce okey (Uint32 '0))))
+ (let words (Concat (Concat val (Coalesce nval (String '""))) (Coalesce oval (String '""))))
+ (let new_item '(key val skey sval validate words))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (Fold1Map stream init update))
+
+(let world (Write! world res_sink (Key) (Collect result) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/FoldMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/FoldMap.yql
new file mode 100644
index 0000000000..fde736a37c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/FoldMap.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'b))
+'((Uint32 '2) (String 'o))
+'((Uint32 '1) (String 'm))
+'((Uint32 '3) (String 'b))))
+
+(let init_state '((Uint32 '0) (String '"")))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (FoldMap list init_state update))
+
+(let world (Write! world res_sink (Key) result '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ForwardList.yql b/yql/essentials/tests/s-expressions/suites/InMem/ForwardList.yql
new file mode 100644
index 0000000000..dfec8da682
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ForwardList.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (String 'aaa) (String 'bbb) (String 'ccc)))
+(let world (Write! world res_sink (Key) (ForwardList (Iterator list (DependsOn (Uint32 '0)))) '()))
+(let world (Write! world res_sink (Key) (Length (ForwardList (Iterator list (DependsOn (Uint32 '1))))) '()))
+(let world (Write! world res_sink (Key) (Skip (ForwardList (Iterator list (DependsOn (Uint32 '2)))) (Uint64 '2)) '()))
+(let world (Write! world res_sink (Key) (Take (ForwardList (Iterator list (DependsOn (Uint32 '3)))) (Uint64 '2)) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/GroupOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/GroupOpt.yql
new file mode 100644
index 0000000000..30fcbac0b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/GroupOpt.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Just (Uint32 '2)) (Just (String 'D)))
+'((Nothing (OptionalType (DataType 'Uint32))) (Just (String 'E)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+'((Just (Uint32 '3)) (Nothing (OptionalType (DataType 'String))))
+'((Just (Uint32 '2)) (Just (String 'B)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let handler (lambda '(key list) (Just '(key list))))
+(let data (GroupByKey list keyExtractor handler))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/GroupOptTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/GroupOptTuple.yql
new file mode 100644
index 0000000000..c21c6b07d3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/GroupOptTuple.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Just (Uint32 '2)) (Just (String 'D)))
+'((Nothing (OptionalType (DataType 'Uint32))) (Just (String 'E)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+'((Just (Uint32 '3)) (Nothing (OptionalType (DataType 'String))))
+'((Just (Uint32 '2)) (Just (String 'B)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+))
+
+(let keyExtractor (lambda '(x) x))
+(let handler (lambda '(key list) (Just '(key list))))
+(let data (GroupByKey list keyExtractor handler))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Guess.cfg b/yql/essentials/tests/s-expressions/suites/InMem/Guess.cfg
new file mode 100644
index 0000000000..e41deb15c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Guess.cfg
@@ -0,0 +1,2 @@
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Guess.yql b/yql/essentials/tests/s-expressions/suites/InMem/Guess.yql
new file mode 100644
index 0000000000..256b5de592
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Guess.yql
@@ -0,0 +1,54 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let v1 (Variant (Int32 '34) '0 vt))
+(let v2 (Variant (String 'qwe) '1 vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (Guess v1 '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess v2 '1) '('('type))))
+(let world (Write! world res_sink (Key) (Guess jv1 '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess jv2 '1) '('('type))))
+(let world (Write! world res_sink (Key) (Guess n '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess n '1) '('('type))))
+
+(let world (Write! world res_sink (Key) (Guess (Apply id v1) '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id v2) '1) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id jv1) '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id jv2) '1) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id n) '0) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id n) '1) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+(let v2 (Variant (String 'qwe) 'b vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (Guess v1 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess v2 'b) '('('type))))
+(let world (Write! world res_sink (Key) (Guess jv1 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess jv2 'b) '('('type))))
+(let world (Write! world res_sink (Key) (Guess n 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess n 'b) '('('type))))
+
+(let world (Write! world res_sink (Key) (Guess (Apply id v1) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id v2) 'b) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id jv1) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id jv2) 'b) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id n) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (Guess (Apply id n) 'b) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Hopping.yql b/yql/essentials/tests/s-expressions/suites/InMem/Hopping.yql
new file mode 100644
index 0000000000..0ae29c3594
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Hopping.yql
@@ -0,0 +1,51 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let timeExtractor (lambda '(item) (Just (Member item 'time))))
+
+(let init (lambda '(item)
+ (AsStruct
+ '('sum (Member item 'sum))
+ '('max (Member item 'max))
+)))
+(let update (lambda '(item state)
+ (AsStruct
+ '('sum (AggrAdd (Member item 'sum) (Member state 'sum)))
+ '('max (AggrMax (Member item 'max) (Member state 'max)))
+)))
+(let merge (lambda '(state1 state2)
+ (AsStruct
+ '('sum (AggrAdd (Member state1 'sum) (Member state2 'sum)))
+ '('max (AggrMax (Member state1 'max) (Member state2 'max)))
+)))
+(let save (lambda '(state) state))
+(let load (lambda '(state) state))
+(let finish (lambda '(state time) (AddMember state '_yql_time time)))
+
+(let stream (Iterator (AsList
+(AsStruct '('time (Timestamp '1)) '('sum (Uint32 '2)) '('max (String 'f)))
+(AsStruct '('time (Timestamp '2)) '('sum (Uint32 '3)) '('max (String 'a)))
+(AsStruct '('time (Timestamp '15)) '('sum (Uint32 '4)) '('max (String 'e)))
+(AsStruct '('time (Timestamp '23)) '('sum (Uint32 '6)) '('max (String 'h)))
+(AsStruct '('time (Timestamp '24)) '('sum (Uint32 '5)) '('max (String 'd)))
+(AsStruct '('time (Timestamp '25)) '('sum (Uint32 '7)) '('max (String 's)))
+(AsStruct '('time (Timestamp '40)) '('sum (Uint32 '2)) '('max (String 'j)))
+(AsStruct '('time (Timestamp '47)) '('sum (Uint32 '1)) '('max (String 't)))
+(AsStruct '('time (Timestamp '51)) '('sum (Uint32 '6)) '('max (String 'b)))
+(AsStruct '('time (Timestamp '59)) '('sum (Uint32 '2)) '('max (String 'c)))
+(AsStruct '('time (Timestamp '85)) '('sum (Uint32 '8)) '('max (String 'g)))
+(AsStruct '('time (Timestamp '55)) '('sum (Uint32 '1000)) '('max (String 'z)))
+(AsStruct '('time (Timestamp '200)) '('sum (Uint32 '0)) '('max (String 'a)))
+)))
+
+# row with time 55 should be excluded from aggregation due to delay
+
+(let itemType (StructType '('time (DataType 'Timestamp)) '('sum (DataType 'Uint32)) '('max (DataType 'String))))
+(let res (HoppingCore stream timeExtractor (Interval '10) (Interval '30) (Interval '20) init update save load merge finish))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect res) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/IndexDictOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/IndexDictOpt.yql
new file mode 100644
index 0000000000..b551ccbad0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/IndexDictOpt.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t (AsList
+ (String 'a)
+ (String 'b)
+))
+
+(let jt (Just t))
+(let n (Nothing (TypeOf jt)))
+
+(let world (Write! world res_sink (Key) (ToIndexDict jt) '('('type))))
+(let world (Write! world res_sink (Key) (ToIndexDict n) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Iterator.yql b/yql/essentials/tests/s-expressions/suites/InMem/Iterator.yql
new file mode 100644
index 0000000000..0cba17d6ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Iterator.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (String 'aaa) (String 'bbb) (String 'ccc)))
+(let world (Write! world res_sink (Key) (Collect (Iterator list (DependsOn (Uint32 '0)))) '()))
+(let world (Write! world res_sink (Key) (Collect (Iterator (Just list))) '()))
+(let world (Write! world res_sink (Key) (Collect (Iterator (Nothing (OptionalType (TypeOf list))))) '()))
+(let world (Write! world res_sink (Key) (Collect (EmptyIterator (StreamType (DataType 'Double)))) '()))
+(let world (Write! world res_sink (Key) (Collect (ToStream (Just (Uint32 '123)) (DependsOn (Uint32 '1)))) '()))
+(let world (Write! world res_sink (Key) (Collect (ToStream (Nothing (OptionalType (DataType 'Double))))) '()))
+(let world (Write! world res_sink (Key) (Collect (ToStream (EmptyIterator (StreamType (DataType 'String))))) '()))
+(let world (Write! world res_sink (Key) (Collect (ToStream list (DependsOn (Uint32 '2)))) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/LMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/LMap.yql
new file mode 100644
index 0000000000..12ad41b0a7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/LMap.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let handler (lambda '(stream) (block '(
+ (return (Map stream (lambda '(x) (Nth x '1))))
+))))
+
+(let data (LMap list handler))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ListExtendMany.yql b/yql/essentials/tests/s-expressions/suites/InMem/ListExtendMany.yql
new file mode 100644
index 0000000000..6c3403e7d4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ListExtendMany.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let test (lambda '(world data) (block '(
+ (let world (Write! world res_sink (Key) data '('('type))))
+ (return world)
+))))
+
+(let world (Apply test world (Extend (AsList (String 'a)))))
+(let world (Apply test world (Extend (AsList (String 'a)) (AsList (String 'b)))))
+(let world (Apply test world (Extend (AsList (String 'a)) (AsList (String 'b)) (AsList (String 'c)))))
+(let world (Apply test world (Extend
+ (Extend (Take (AsList (String 'a)) (Uint64 '1)) (AsList (String 'b)))
+ (Extend (Take (AsList (String 'c)) (Uint64 '1)) (AsList (String 'd)))
+ )))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ListFromRangeForDates.yql b/yql/essentials/tests/s-expressions/suites/InMem/ListFromRangeForDates.yql
new file mode 100644
index 0000000000..7bf690187b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ListFromRangeForDates.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let intervalOneSec (Interval '"1000000"))
+
+(let FirstList (ListFromRange (SafeCast (CurrentUtcDate) (DataType 'Datetime)) (Unwrap (- (CurrentUtcDatetime) (Interval '"63995000000"))) intervalOneSec))
+(let SecondList (ListFromRange (CurrentUtcDate) (Unwrap (+ (CurrentUtcDate) (Interval '"432000000000"))) (Interval '"86400000000")))
+(let ThirdList (ListFromRange (CurrentUtcDatetime) (Unwrap (+ (CurrentUtcDatetime) (Interval '"5000000"))) intervalOneSec))
+(let FourthList (ListFromRange (CurrentUtcTimestamp) (Unwrap (+ (CurrentUtcTimestamp) (Interval '"5"))) (Interval '"1")))
+(let Columns '('"column0" '"column1" '"column2" '"column3"))
+(let Col '('('type) '('autoref) '('columns Columns)))
+(let world (Write! world res_sink (Key) (AsList (AsStruct '('"column0" FirstList) '('"column1" SecondList) '('"column2" ThirdList) '('"column3" FourthList))) Col))
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/MemberOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/MemberOpt.yql
new file mode 100644
index 0000000000..fafe8bee40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/MemberOpt.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let s (AsStruct
+ '('a (String 'aaa))
+ '('b (Just (Uint32 '4)))
+ '('c (Nothing (OptionalType (DataType 'Uint32)))))
+)
+
+(let js (Just s))
+(let n (Nothing (TypeOf js)))
+
+(let world (Write! world res_sink (Key) (Member s 'a) '()))
+(let world (Write! world res_sink (Key) (Member js 'a) '()))
+(let world (Write! world res_sink (Key) (Member js 'b) '()))
+(let world (Write! world res_sink (Key) (Member js 'c) '()))
+(let world (Write! world res_sink (Key) (Member n 'a) '()))
+(let world (Write! world res_sink (Key) (Member n 'c) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Merge.yql b/yql/essentials/tests/s-expressions/suites/InMem/Merge.yql
new file mode 100644
index 0000000000..3e91e821c6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Merge.yql
@@ -0,0 +1,47 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList
+ (AsStruct '('a (Uint32 '4)) '('b (String 'c)))
+ (AsStruct '('a (Uint32 '1)) '('b (String 'd)))
+ (AsStruct '('a (Uint32 '3)) '('b (String 'b)))
+))
+(let list2 (AsList
+ (AsStruct '('a (Uint32 '2)) '('b (String 'a)))
+ (AsStruct '('a (Uint32 '5)) '('b (String 'y)))
+ (AsStruct '('a (Uint32 '1)) '('b (String 'z)))
+))
+(let world (Write! world res_sink (Key)
+ (Merge
+ list1
+ list2
+ )
+'('('type))))
+
+(let world (Write! world res_sink (Key)
+ (Merge
+ (Sort list1 (Bool 'True) (lambda '(item) (Member item 'a)))
+ (Sort list2 (Bool 'True) (lambda '(item) (Member item 'a)))
+ )
+'('('type))))
+
+(let world (Write! world res_sink (Key)
+ (Merge
+ (Sort list1 (Bool 'False) (lambda '(item) (Member item 'a)))
+ (Sort list2 (Bool 'False) (lambda '(item) (Member item 'a)))
+ )
+'('('type))))
+
+(let world (Write! world res_sink (Key)
+ (Merge
+ (Sort list1 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
+ (Sort list2 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
+ )
+'('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/MultiMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/MultiMap.yql
new file mode 100644
index 0000000000..7a39c20b0a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/MultiMap.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let world (Write! world res_sink (Key) (OrderedMultiMap list
+ (lambda '(x) x (+ x (Int32 '10)) x)) '('('type))))
+(let world (Write! world res_sink (Key) (MultiMap (LazyList list)
+ (lambda '(x) x (- (Int32 '7) x) (* x x))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (MultiMap (ToFlow list)
+ (lambda '(x) x (+ x (Int32 '-3)) (Int32 '0)))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Mux.yql b/yql/essentials/tests/s-expressions/suites/InMem/Mux.yql
new file mode 100644
index 0000000000..2a226541f3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Mux.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let res_sink (DataSink 'result))
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList (String 'a1) (String 'a2) (String 'a3)))
+(let list2 (AsList (Bool 'true) (Bool 'false)))
+(let list3 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3) (Uint32 '4)))
+
+(let data (Mux '(list1 list2 list3)))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let data (Mux (AsStruct '('a list1) '('b list2) '('c list3))))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let world (Commit! world res_sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/NthOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/NthOpt.yql
new file mode 100644
index 0000000000..428da2f45f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/NthOpt.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t '(
+ (String 'aaa)
+ (Just (Uint32 '4))
+ (Nothing (OptionalType (DataType 'Uint32)))
+))
+
+(let jt (Just t))
+(let n (Nothing (TypeOf jt)))
+
+(let world (Write! world res_sink (Key) (Nth t '0) '()))
+(let world (Write! world res_sink (Key) (Nth jt '0) '()))
+(let world (Write! world res_sink (Key) (Nth jt '1) '()))
+(let world (Write! world res_sink (Key) (Nth jt '2) '()))
+(let world (Write! world res_sink (Key) (Nth n '0) '()))
+(let world (Write! world res_sink (Key) (Nth n '2) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKey.yql b/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKey.yql
new file mode 100644
index 0000000000..af112ea360
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKey.yql
@@ -0,0 +1,27 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let handler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let stream (Nth pair '1))
+ (let state (Concat (String '"key:") (ToString key)))
+ (let state (Condense stream state (lambda '(row state) (Bool 'False)) (lambda '(row state) (Concat (Concat state (String '" ")) (Nth row '1)))))
+ (return (Collect state))
+ )))))
+))))
+(let data (PartitionByKey list keyExtractor (Void) (Void) handler))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKeySorted.yql b/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKeySorted.yql
new file mode 100644
index 0000000000..a5c99fd3ee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/PartitionByKeySorted.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let subkeyExtractor (lambda '(x) (Nth x '1)))
+(let handler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let stream (Nth pair '1))
+ (let state (Concat (String '"key:") (ToString key)))
+ (let state (Condense stream state (lambda '(row state) (Bool 'False)) (lambda '(row state) (Concat (Concat state (String '" ")) (Nth row '1)))))
+ (return (Collect state))
+ )))))
+))))
+(let data (PartitionByKey list keyExtractor (Bool 'false) subkeyExtractor handler))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeys.yql b/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeys.yql
new file mode 100644
index 0000000000..81326641f1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeys.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let handler (lambda '(x) (Condense1 x
+ (lambda '(row) '((Nth row '0) (Concat (String '"values:") (ToString (Nth row '1)))))
+ (lambda '(row state) (AggrNotEquals (Nth row '0) (Nth state '0)))
+ (lambda '(row state) '((Nth state '0) (Concat (Concat (Nth state '1) (String '" ")) (Nth row '1))))
+)))
+(let data (PartitionsByKeys (Iterator list) keyExtractor (Void) (Void) handler))
+(let data (Collect data))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeysSorted.yql b/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeysSorted.yql
new file mode 100644
index 0000000000..73f3a3f970
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/PartitionsByKeysSorted.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let subkeyExtractor (lambda '(x) (Nth x '1)))
+(let handler (lambda '(x) (Condense1 x
+ (lambda '(row) '((Nth row '0) (Concat (String '"values:") (ToString (Nth row '1)))))
+ (lambda '(row state) (AggrNotEquals (Nth row '0) (Nth state '0)))
+ (lambda '(row state) '((Nth state '0) (Concat (Concat (Nth state '1) (String '" ")) (Nth row '1))))
+)))
+(let data (PartitionsByKeys (Iterator list) keyExtractor (Bool 'false) subkeyExtractor handler))
+(let data (Collect data))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Queue.yql b/yql/essentials/tests/s-expressions/suites/InMem/Queue.yql
new file mode 100644
index 0000000000..2589942a60
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Queue.yql
@@ -0,0 +1,25 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let queue (QueueCreate (DataType 'Uint32) (Uint64 '4) (Uint64 '2)))
+
+(let queue (QueuePush queue (Int32 '1)))
+(let queue (QueuePush queue (Int32 '2)))
+
+(let result '((QueuePeek queue (Uint64 '0)) (QueuePeek queue (Uint64 '1)) (QueuePeek queue (Uint64 '2)) (QueuePeek queue (Uint64 '3))))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let queue (QueuePop queue))
+(let queue (QueuePop queue))
+(let queue (QueuePush queue (Int32 '3)))
+
+(let result '((QueuePeek queue (Uint64 '0)) (QueuePeek queue (Uint64 '1)) (QueuePeek queue (Uint64 '2)) (QueuePeek queue (Uint64 '3))))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/QueueCheckDependent.yql b/yql/essentials/tests/s-expressions/suites/InMem/QueueCheckDependent.yql
new file mode 100644
index 0000000000..5bf3868fcc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/QueueCheckDependent.yql
@@ -0,0 +1,33 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let qrs1 (QueueCreate (DataType 'String) (Uint64 '6) (Uint64 '0) (DependsOn (Uint64 '0))))
+(let qrs2 (QueueCreate (DataType 'String) (Uint64 '6) (Uint64 '0) (DependsOn (Uint64 '1))))
+(let qrs2 (QueuePush qrs2 (String '"It")))
+(let qrs1 (QueuePush qrs1 (String '"Look!")))
+(let qrs2 (QueuePush qrs2 (String '"is")))
+(let qrs1 (QueuePush qrs1 (String '"It")))
+(let qrs2 (QueuePush qrs2 (String '"a")))
+(let qrs1 (QueuePush qrs1 (String '"funny")))
+(let qrs2 (QueuePop qrs2))
+(let qrs2 (QueuePush qrs2 (String '"good")))
+(let qrs1 (QueuePop qrs1))
+(let qrs2 (QueuePush qrs2 (String '"day")))
+(let qrs2 (QueuePop qrs2))
+(let qrs2 (QueuePush qrs2 (String '"to")))
+(let qrs1 (QueuePush qrs1 (String '"bunny")))
+(let qrs2 (QueuePush qrs2 (String '"die")))
+(let qrs1 (QueuePop qrs1))
+
+(let resultString1 '((QueuePeek qrs1 (Minus (Uint64 '1))) (QueuePeek qrs1 (Uint64 '0)) (QueuePeek qrs1 (Uint64 '1)) (QueuePeek qrs1 (Uint64 '2))))
+(let resultString2 '((QueuePeek qrs2 (Minus (Uint64 '1))) (QueuePeek qrs2 (Uint64 '0)) (QueuePeek qrs2 (Uint64 '1)) (QueuePeek qrs2 (Uint64 '2))))
+
+(let result '(resultString1 resultString2))
+
+(let world (Write! world res_sink (Key) result '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/QueueMixedTypes.yql b/yql/essentials/tests/s-expressions/suites/InMem/QueueMixedTypes.yql
new file mode 100644
index 0000000000..55e36075f5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/QueueMixedTypes.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let qrs (QueueCreate (DataType 'String) (Uint64 '5) (Uint64 '0)))
+(let qri (QueueCreate (DataType 'Int32) (Uint64 '5) (Uint64 '0)))
+(let qri (QueuePush qri (Int32 '-5)))
+(let qrs (QueuePush qrs (String '"It")))
+(let qri (QueuePush qri (Int32 '5)))
+(let qrs (QueuePush qrs (String '"is")))
+(let qri (QueuePush qri (Int64 '-33)))
+(let qrs (QueuePush qrs (String '"funny")))
+(let qri (QueuePop qri))
+(let qrs (QueuePop qrs))
+(let qri (QueuePush qri (Int32 '42)))
+(let qri (QueuePop qri))
+(let qrs (QueuePush qrs (String '"bunny")))
+(let qrs (QueuePop qrs))
+
+(let resultInt '((QueuePeek qri (Minus (Uint64 '1))) (QueuePeek qri (Uint64 '0)) (QueuePeek qri (Uint64 '1)) (QueuePeek qri (Uint64 '2))))
+(let resultString '((QueuePeek qrs (Minus (Uint64 '1))) (QueuePeek qrs (Uint64 '0)) (QueuePeek qrs (Uint64 '1)) (QueuePeek qrs (Uint64 '2))))
+
+(let result '(resultInt resultString))
+
+(let world (Write! world res_sink (Key) result '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/QueueRangeWithPreservedStream.yql b/yql/essentials/tests/s-expressions/suites/InMem/QueueRangeWithPreservedStream.yql
new file mode 100644
index 0000000000..3a0c673d27
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/QueueRangeWithPreservedStream.yql
@@ -0,0 +1,32 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let list (AsList
+ (Uint32 '1)
+ (Uint32 '1)
+ (Uint32 '2)
+ (Uint32 '3)
+ (Uint32 '5)
+ (Uint32 '8)
+))
+
+(let base_stream (Iterator list))
+
+(let queue (QueueCreate (ListItemType (TypeOf list)) (Void) (Uint64 '0)))
+
+(let stream (PreserveStream base_stream queue (Uint64 '100500)))
+
+(let update (lambda '(item state) (block '(
+ (let cumulative_sum (+ item state))
+ (let queue_content (Collect (QueueRange queue (Uint64 '0) (Uint64 '100500) (DependsOn item))))
+ (return '('(item cumulative_sum queue_content) cumulative_sum))
+))))
+
+(let result (FoldMap stream (Uint32 '0) update))
+
+(let world (Write! world res_sink (Key) (Collect result) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/QueueSimpleStrings.yql b/yql/essentials/tests/s-expressions/suites/InMem/QueueSimpleStrings.yql
new file mode 100644
index 0000000000..e7c8c1d029
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/QueueSimpleStrings.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let qr (QueueCreate (OptionalType (DataType 'String)) (Uint64 '5) (Uint64 '0)))
+(let qr (QueuePush qr (String '"It")))
+(let qr (QueuePush qr (Just (String '"is"))))
+(let qr (QueuePush qr (String '"funny")))
+(let qr (QueuePop qr))
+(let qr (QueuePush qr (Just (String '"bunny"))))
+(let qr (QueuePop qr))
+(let result '((QueuePeek qr (Minus (Uint64 '1))) (QueuePeek qr (Uint64 '0)) (QueuePeek qr (Uint64 '1)) (QueuePeek qr (Uint64 '2))))
+
+(let world (Write! world res_sink (Key) result '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ReplaceMember.yql b/yql/essentials/tests/s-expressions/suites/InMem/ReplaceMember.yql
new file mode 100644
index 0000000000..bb7203c502
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ReplaceMember.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let s (AsStruct '('a (String 'ccc)) '('b (Double '3.5))))
+(let world (Write! world res_sink (Key) (ReplaceMember s 'a (Int32 '7)) '('('type))))
+(let world (Write! world res_sink (Key) (ReplaceMember s 'b (String 'aaa)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Seq.yql b/yql/essentials/tests/s-expressions/suites/InMem/Seq.yql
new file mode 100644
index 0000000000..ea9eec4131
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Seq.yql
@@ -0,0 +1,31 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let v1 (String 'test1))
+(let q1 (QueueCreate (TypeOf v1) (Uint64 '1) (Uint64 '1) (DependsOn v1)))
+(let new_q1 (QueuePush (QueuePop q1) v1))
+(let q1_item (QueuePeek q1 (Uint64 '0) (DependsOn v1)))
+(let new_q1_item (QueuePeek new_q1 (Uint64 '0) (DependsOn v1)))
+
+# will be (test1, test1)
+(let result '(new_q1_item q1_item))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+
+(let v2 (String 'test2))
+(let q2 (QueueCreate (TypeOf v2) (Uint64 '1) (Uint64 '1) (DependsOn v2)))
+(let new_q2 (QueuePush (QueuePop q2) v2))
+(let q2_item (QueuePeek q2 (Uint64 '0) (DependsOn v2)))
+(let new_q2_item (QueuePeek new_q2 (Uint64 '0) (DependsOn v2)))
+
+# enforce q2_item to be calculated first
+(let result '((Seq q2_item new_q2_item) q2_item))
+(let world (Write! world res_sink (Key) result '('('type))))
+
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/SkipNullMembers.yql b/yql/essentials/tests/s-expressions/suites/InMem/SkipNullMembers.yql
new file mode 100644
index 0000000000..8da7e768fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/SkipNullMembers.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+ (AsStruct '('key (Just (Uint32 '1))) '('value (String 'a)))
+ (AsStruct '('key (Nothing (OptionalType (DataType 'Uint32)))) '('value (String 'a)))
+))
+
+(let world (Write! world res_sink (Key) (SkipNullMembers list '('key)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/SortOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/SortOpt.yql
new file mode 100644
index 0000000000..3ef2f4081b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/SortOpt.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Just (Uint32 '2)) (Just (String 'D)))
+'((Nothing (OptionalType (DataType 'Uint32))) (Just (String 'E)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+'((Just (Uint32 '3)) (Nothing (OptionalType (DataType 'String))))
+'((Just (Uint32 '2)) (Just (String 'B)))
+))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let data (Sort list (Bool 'true) keyExtractor))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/SortOptTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/SortOptTuple.yql
new file mode 100644
index 0000000000..ddfb0a7e16
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/SortOptTuple.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Just (Uint32 '2)) (Just (String 'D)))
+'((Nothing (OptionalType (DataType 'Uint32))) (Just (String 'E)))
+'((Just (Uint32 '3)) (Just (String 'A)))
+'((Just (Uint32 '3)) (Nothing (OptionalType (DataType 'String))))
+'((Just (Uint32 '2)) (Just (String 'B)))
+))
+
+(let keyExtractor (lambda '(x) x))
+(let data (Sort list '((Bool 'false) (Bool 'false)) keyExtractor))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/SqlAccess.yql b/yql/essentials/tests/s-expressions/suites/InMem/SqlAccess.yql
new file mode 100644
index 0000000000..9ad041b115
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/SqlAccess.yql
@@ -0,0 +1,74 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t '((Int32 '34) (String 'qwe)))
+(let l (AsList (Int32 '34) (Int32 '56)))
+(let s (AsStruct '('a (String 'ccc)) '('b (Double '3.5))))
+(let d (AsDict
+ '((Just (Uint32 '4)) (String 'aaa))
+ '((Nothing (OptionalType (DataType 'Uint32))) (String 'bbb)))
+)
+
+(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let v1 (Variant (Int32 '34) '0 vt1))
+
+(let vt2 (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let v2 (Variant (Int32 '34) 'a vt2))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple t '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple t '1) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple v1 '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple v1 '1) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Just t) '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Just t) '1) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Just v1) '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Just v1) '1) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Nothing (OptionalType (TypeOf t))) '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Nothing (OptionalType (TypeOf t))) '1) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Nothing (OptionalType (TypeOf v1))) '0) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'tuple (Nothing (OptionalType (TypeOf v1))) '1) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'struct s 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct s 'b) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct v2 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct v2 'b) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Just s) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Just s) 'b) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Just v2) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Just v2) 'b) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Nothing (OptionalType (TypeOf s))) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Nothing (OptionalType (TypeOf s))) 'b) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Nothing (OptionalType (TypeOf v2))) 'a) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'struct (Nothing (OptionalType (TypeOf v2))) 'b) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'dict l (Uint64 '0)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict l (Uint64 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict l (Uint64 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict d (Uint32 '4)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict d (Uint32 '5)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict d (Nothing (OptionalType (DataType 'Uint32)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just l) (Uint64 '0)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just l) (Uint64 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just l) (Uint64 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just d) (Uint32 '4)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just d) (Uint32 '5)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Just d) (Nothing (OptionalType (DataType 'Uint32)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf l))) (Uint64 '0)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf l))) (Uint64 '1)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf l))) (Uint64 '2)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf d))) (Uint32 '4)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf d))) (Uint32 '5)) '('('type))))
+(let world (Write! world res_sink (Key) (SqlAccess 'dict (Nothing (OptionalType (TypeOf d))) (Nothing (OptionalType (DataType 'Uint32)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StaticMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/StaticMap.yql
new file mode 100644
index 0000000000..c4c247d675
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StaticMap.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let default (lambda '(x) (block '(
+ (return (Coalesce x (Default (OptionalItemType (TypeOf x)))))
+))))
+
+(let tuple '((Just (Uint32 '1)) (Just (String 'X))))
+(let struct (AsStruct '('a (Nothing (OptionalType (DataType 'Uint32)))) '('b (Just (String 'Y)))))
+
+(let world (Write! world res_sink (Key) (StaticMap tuple default) '('('type))))
+(let world (Write! world res_sink (Key) (StaticMap struct default) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamDiscard.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamDiscard.yql
new file mode 100644
index 0000000000..adf904774d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamDiscard.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let world (Write! world res_sink (Key) (Collect (Discard (Iterator list1))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamExtend.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamExtend.yql
new file mode 100644
index 0000000000..0e04475199
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamExtend.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let list2 (AsList (Uint32 '4) (Uint32 '5) (Uint32 '6)))
+(let list3 (AsList (Uint32 '7) (Uint32 '8) (Uint32 '9)))
+(let world (Write! world res_sink (Key) (Collect (Extend (Iterator list1) (Iterator list2) (Iterator list3))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamFilter.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamFilter.yql
new file mode 100644
index 0000000000..ce40b9f8a9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamFilter.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let world (Write! world res_sink (Key) (Collect (Filter (Iterator list)
+ (lambda '(x) (!= (Uint32 '0) (BitAnd x (Uint32 '1)))))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamFlatMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamFlatMap.yql
new file mode 100644
index 0000000000..9a23a4d591
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamFlatMap.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
+(let world (Write! world res_sink (Key) (Collect (FlatMap (Iterator list (DependsOn (String 'A)))
+ (lambda '(x) (AsList x x)))) '('('type))))
+(let add (lambda '(y) (+ y (Int32 '10))))
+(let world (Write! world res_sink (Key) (Collect (FlatMap (Iterator list (DependsOn (String 'B)))
+ (lambda '(x) (Map (/ (Int32 '5) (- (Int32 '2) x)) add)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (FlatMap (Iterator list (DependsOn (String 'C)))
+ (lambda '(x) (Iterator (AsList x x))))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (FlatMap list
+ (lambda '(x) (Iterator (AsList x x))))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (FlatMap (/ (Int32 '3) (Int32 '1))
+ (lambda '(x) (Iterator (AsList x x))))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamFold1Map.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamFold1Map.yql
new file mode 100644
index 0000000000..5acfe5d46d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamFold1Map.yql
@@ -0,0 +1,42 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'r))
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '3) (String 'b))
+'((Uint32 '5) (String 'i))
+'((Uint32 '8) (String 't))))
+
+(let init (lambda '(item) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey key)
+ (let sval val)
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (Fold1Map (Iterator list) init update))
+
+(let world (Write! world res_sink (Key) (Collect result) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamFoldMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamFoldMap.yql
new file mode 100644
index 0000000000..78557d82b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamFoldMap.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'b))
+'((Uint32 '2) (String 'o))
+'((Uint32 '1) (String 'm))
+'((Uint32 '3) (String 'b))))
+
+(let init_state '((Uint32 '0) (String '"")))
+
+(let update (lambda '(item state) (block '(
+ (let key (Nth item '0))
+ (let val (Nth item '1))
+ (let skey (Nth state '0))
+ (let sval (Nth state '1))
+ (let skey (+ skey key))
+ (let sval (Concat sval val))
+ (let new_item '(key val skey sval))
+ (let new_state '(skey sval))
+ (return '(new_item new_state)
+)))))
+
+(let result (FoldMap (Iterator list) init_state update))
+
+(let world (Write! world res_sink (Key) (Collect result) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamInCombineByKey.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamInCombineByKey.yql
new file mode 100644
index 0000000000..e58ebc251e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamInCombineByKey.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList '((Uint32 '1) (String 'a)) '((Uint32 '1) (String 'b)) '((Uint32 '2) (String 'c))))
+(let premap (lambda '(x) (Iterator (AsList x))))
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let handlerInit (lambda '(key item) (Nth item '1)))
+(let handlerUpdate (lambda '(key item state) (Concat (Nth item '1) state)))
+(let handlerFinish (lambda '(key state) (Iterator (AsList '(key state)))))
+(let world (Write! world res_sink (Key) (CombineByKey list premap keyExtractor handlerInit handlerUpdate handlerFinish) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamInGroupByKey.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamInGroupByKey.yql
new file mode 100644
index 0000000000..5eae4467ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamInGroupByKey.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList '((Uint32 '1) (String 'a)) '((Uint32 '1) (String 'b)) '((Uint32 '2) (String 'c))))
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let handler (lambda '(key list) (Iterator (AsList key key))))
+(let world (Write! world res_sink (Key) (GroupByKey list keyExtractor handler) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamMap.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamMap.yql
new file mode 100644
index 0000000000..cb48729c8f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamMap.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let world (Write! world res_sink (Key) (Collect (Map (Iterator list)
+ (lambda '(x) (+ (Uint32 '10) x)))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamSkip.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamSkip.yql
new file mode 100644
index 0000000000..3d553a2b36
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamSkip.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let list2 (AsList (Uint32 '4) (Uint32 '5) (Uint32 '6)))
+(let world (Write! world res_sink (Key) (Collect (Skip (Iterator list1) (Uint64 '2))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Skip (Iterator list2) (Uint64 '0))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StreamTake.yql b/yql/essentials/tests/s-expressions/suites/InMem/StreamTake.yql
new file mode 100644
index 0000000000..0870b1aac3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StreamTake.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let list2 (AsList (Uint32 '4) (Uint32 '5) (Uint32 '6)))
+(let world (Write! world res_sink (Key) (Collect (Take (Iterator list1) (Uint64 '2))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Take (Iterator list2) (Uint64 '0))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StringContains.yql b/yql/essentials/tests/s-expressions/suites/InMem/StringContains.yql
new file mode 100644
index 0000000000..9d5e42e3cf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StringContains.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) (StringContains (Utf8 '12345) (String '"")) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Just (String '12345)) (String '346)) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (String '12345) (Just (String '012345))) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Just (String '567)) (Just (Utf8 '67))) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Utf8 'abcad) (String 'bc)) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Utf8 'xyz) (Utf8 'xyz)) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Utf8 'one) (Null)) '('('type))))
+(let world (Write! world res_sink (Key) (StringContains (Null) (Utf8 'two)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/StringWith.yql b/yql/essentials/tests/s-expressions/suites/InMem/StringWith.yql
new file mode 100644
index 0000000000..c6b3b3de2d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/StringWith.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) (StartsWith (Utf8 '12345) (String '"")) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Just (String '12345)) (String '124)) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (String '12345) (Just (String '123456))) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Just (String '567)) (Just (Utf8 '56))) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Utf8 'abcad) (String 'ab)) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Utf8 'xyz) (Utf8 'xyz)) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Utf8 'one) (Null)) '('('type))))
+(let world (Write! world res_sink (Key) (StartsWith (Null) (Utf8 'two)) '('('type))))
+
+(let world (Write! world res_sink (Key) (EndsWith (Utf8 '12345) (String '"")) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Just (String '12345)) (String '346)) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (String '12345) (Just (String '012345))) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Just (String '567)) (Just (Utf8 '67))) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Utf8 'abcad) (String 'ad)) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Utf8 'xyz) (Utf8 'xyz)) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Utf8 'one) (Null)) '('('type))))
+(let world (Write! world res_sink (Key) (EndsWith (Null) (Utf8 'two)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Switch.yql b/yql/essentials/tests/s-expressions/suites/InMem/Switch.yql
new file mode 100644
index 0000000000..9c17ddd66e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Switch.yql
@@ -0,0 +1,34 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (String 'aaa) (String 'bbb) (String 'ccc)))
+(let id (lambda '(x) x))
+# id
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'A))) '1 '('0) id)) '('('type))))
+# clone
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'B))) '1 '('0) id '('0) id)) '('('type))))
+# separate
+(let tupleType (TupleType (DataType 'String) (DataType 'String)))
+(let vt (VariantType tupleType))
+(let vlist (AsList (Variant (String 'aaa) '0 vt) (Variant (String 'bbb) '1 vt) (Variant (String 'ccc) '0 vt)))
+(let handlerSplit1 (lambda '(x) (Map x (lambda '(s) (Concat (String '"#0: ") s)))))
+(let handlerSplit2 (lambda '(x) (Map x (lambda '(s) (Concat (String '"#1: ") s)))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'D))) '1 '('1) handlerSplit2 '('0) handlerSplit1)) '('('type))))
+# reunion
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'E))) '1 '('0 '1) id)) '('('type))))
+# reunion and parts
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'F))) '1 '('0 '1) id '('1) handlerSplit2 '('0) handlerSplit1)) '('('type))))
+# multiple outputs
+(let twice (lambda '(x) (FlatMap x (lambda '(s) (AsList
+ (Variant (Concat (String '"#0: ") s) '0 vt)
+ (Variant (Concat (String '"#1: ") s) '1 vt)
+ )))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'G))) '1 '('0) twice)) '('('type))))
+# split and multiple outputs
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'H))) '1 '('0) twice '('0) twice)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/TimezoneIdName.yql b/yql/essentials/tests/s-expressions/suites/InMem/TimezoneIdName.yql
new file mode 100644
index 0000000000..4ad7ec02d1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/TimezoneIdName.yql
@@ -0,0 +1,10 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (TimezoneName (TimezoneId (String '"Europe/Moscow"))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToBytes.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToBytes.yql
new file mode 100644
index 0000000000..aa9ed74d8f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToBytes.yql
@@ -0,0 +1,82 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let test (lambda '(world data dataType) (block '(
+ (let world (Write! world res_sink (Key) (ToBytes data) '('('type))))
+ (let world (Write! world res_sink (Key) (FromBytes (ToBytes data) dataType) '('('type))))
+ (return world)
+))))
+
+(let testEmpty (lambda '(world dataType) (block '(
+ (let n (ToBytes (Nothing (OptionalType (DataType dataType)))))
+ (let world (Write! world res_sink (Key) n '('('type))))
+ (let world (Write! world res_sink (Key) (FromBytes n dataType) '('('type))))
+ (return world)
+))))
+
+(let testFail (lambda '(world bytes dataType) (block '(
+ (let world (Write! world res_sink (Key) (Exists (FromBytes bytes dataType)) '('('type))))
+ (return world)
+))))
+
+(let world (Apply test world (Uint8 '7) 'Uint8))
+(let world (Apply test world (Bool 'True) 'Bool))
+(let world (Apply test world (Bool 'False) 'Bool))
+(let world (Apply test world (Int32 'x"abcdef12") 'Int32))
+(let world (Apply test world (Int64 'x"71717171abcdef12") 'Int64))
+(let world (Apply test world (Uint32 'x"abcdef12") 'Uint32))
+(let world (Apply test world (Uint64 'x"ddddddddabcdef12") 'Uint64))
+(let world (Apply test world (Float '2) 'Float))
+(let world (Apply test world (Double '2) 'Double))
+(let world (Apply test world (String '"abc") 'String))
+(let world (Apply test world (Utf8 '"ÑндекÑ") 'Utf8))
+(let world (Apply test world (Yson '"[1;2]") 'Yson))
+(let world (Apply test world (Json '@@{"id":1}@@) 'Json))
+
+(let world (Apply test world (Just (Uint8 '7)) 'Uint8))
+(let world (Apply test world (Just (Bool 'True)) 'Bool))
+(let world (Apply test world (Just (Bool 'False)) 'Bool))
+(let world (Apply test world (Just (Int32 'x"abcdef12")) 'Int32))
+(let world (Apply test world (Just (Int64 'x"71717171abcdef12")) 'Int64))
+(let world (Apply test world (Just (Uint32 'x"abcdef12")) 'Uint32))
+(let world (Apply test world (Just (Uint64 'x"ddddddddabcdef12")) 'Uint64))
+(let world (Apply test world (Just (Float '2)) 'Float))
+(let world (Apply test world (Just (Double '2)) 'Double))
+(let world (Apply test world (Just (String '"abc")) 'String))
+(let world (Apply test world (Just (Utf8 '"ÑндекÑ")) 'Utf8))
+(let world (Apply test world (Just (Yson '"[1;2]")) 'Yson))
+(let world (Apply test world (Just (Json '@@{"id":1}@@)) 'Json))
+
+(let world (Apply testEmpty world 'Uint8))
+(let world (Apply testEmpty world 'Bool))
+(let world (Apply testEmpty world 'Int32))
+(let world (Apply testEmpty world 'Int64))
+(let world (Apply testEmpty world 'Uint32))
+(let world (Apply testEmpty world 'Uint64))
+(let world (Apply testEmpty world 'Float))
+(let world (Apply testEmpty world 'Double))
+(let world (Apply testEmpty world 'String))
+(let world (Apply testEmpty world 'Utf8))
+(let world (Apply testEmpty world 'Yson))
+(let world (Apply testEmpty world 'Json))
+
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint8))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Bool))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Int32))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Int64))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint32))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint64))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Float))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Double))
+(let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'String))
+(let world (Apply testFail world (String 'x"ffff") 'Utf8))
+(let world (Apply testFail world (String '"][") 'Yson))
+(let world (Apply testFail world (String '"}{") 'Json))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToDict.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToDict.yql
new file mode 100644
index 0000000000..c66f952fa6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToDict.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let macro (lambda '(world name flags) (block '(
+
+(let dict (ToDict list (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) flags))
+
+(let world (Write! world res_sink (Key) (String name) '()))
+(let world (Write! world res_sink (Key) dict '('('type))))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '1)) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '2)) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '3)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '1)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '2)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '3)) '()))
+
+(return world)
+))))
+
+(let world (Apply macro world 'Sorted/One '('Sorted 'One)))
+(let world (Apply macro world 'Sorted/Many '('Sorted 'Many)))
+(let world (Apply macro world 'Hashed/One '('Hashed 'One)))
+(let world (Apply macro world 'Hashed/Many '('Hashed 'Many)))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToDictOpt.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOpt.yql
new file mode 100644
index 0000000000..0a2fab711e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOpt.yql
@@ -0,0 +1,39 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Just (Uint32 '1)) (String 'a))
+'((Just (Uint32 '2)) (String 'b))
+'((Just (Uint32 '1)) (String 'c))
+'((Nothing (OptionalType (DataType 'Uint32))) (String 'd))
+))
+
+(let macro (lambda '(world name flags) (block '(
+
+(let dict (ToDict list (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) flags))
+
+(let world (Write! world res_sink (Key) (String name) '()))
+(let world (Write! world res_sink (Key) dict '('('type))))
+(let world (Write! world res_sink (Key) (Contains dict (Just (Uint32 '1))) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Just (Uint32 '2))) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Just (Uint32 '3))) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Nothing (OptionalType (DataType 'Uint32)))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Just (Uint32 '1))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Just (Uint32 '2))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Just (Uint32 '3))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Nothing (OptionalType (DataType 'Uint32)))) '()))
+
+(return world)
+))))
+
+(let world (Apply macro world 'Sorted/One '('Sorted 'One)))
+(let world (Apply macro world 'Sorted/Many '('Sorted 'Many)))
+(let world (Apply macro world 'Hashed/One '('Hashed 'One)))
+(let world (Apply macro world 'Hashed/Many '('Hashed 'Many)))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToDictOptTuple.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOptTuple.yql
new file mode 100644
index 0000000000..a76f483330
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOptTuple.yql
@@ -0,0 +1,41 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'('((Just (Uint32 '1)) (String 'a)) (String 'eee))
+'('((Just (Uint32 '2)) (String 'b)) (String 'fff))
+'('((Just (Uint32 '1)) (String 'a)) (String 'ggg))
+'('((Nothing (OptionalType (DataType 'Uint32))) (String 'd)) (String 'hhh))
+))
+
+(let macro (lambda '(world name flags) (block '(
+
+(let dict (ToDict list (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) flags))
+
+(let world (Write! world res_sink (Key) (String name) '()))
+(let world (Write! world res_sink (Key) dict '('('type))))
+(let world (Write! world res_sink (Key) (Contains dict '((Just (Uint32 '1)) (String 'a))) '()))
+(let world (Write! world res_sink (Key) (Contains dict '((Just (Uint32 '2)) (String 'b))) '()))
+(let world (Write! world res_sink (Key) (Contains dict '((Just (Uint32 '1)) (String 'c))) '()))
+(let world (Write! world res_sink (Key) (Contains dict '((Just (Uint32 '2)) (String 'a))) '()))
+(let world (Write! world res_sink (Key) (Contains dict '((Nothing (OptionalType (DataType 'Uint32))) (String 'd))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict '((Just (Uint32 '1)) (String 'a))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict '((Just (Uint32 '2)) (String 'b))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict '((Just (Uint32 '1)) (String 'c))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict '((Just (Uint32 '2)) (String 'a))) '()))
+(let world (Write! world res_sink (Key) (Lookup dict '((Nothing (OptionalType (DataType 'Uint32))) (String 'd))) '()))
+
+(return world)
+))))
+
+(let world (Apply macro world 'Sorted/One '('Sorted 'One)))
+(let world (Apply macro world 'Sorted/Many '('Sorted 'Many)))
+(let world (Apply macro world 'Hashed/One '('Hashed 'One)))
+(let world (Apply macro world 'Hashed/Many '('Hashed 'Many)))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToDictOverOptList.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOverOptList.yql
new file mode 100644
index 0000000000..bbb90c5408
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToDictOverOptList.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+'((Uint32 '1) (String 'a))
+'((Uint32 '2) (String 'b))
+'((Uint32 '1) (String 'c))))
+
+(let macro (lambda '(world name flags) (block '(
+
+(let dict (ToDict (Just list) (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) flags))
+
+(let world (Write! world res_sink (Key) (String name) '()))
+(let world (Write! world res_sink (Key) dict '('('type))))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '1)) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '2)) '()))
+(let world (Write! world res_sink (Key) (Contains dict (Uint32 '3)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '1)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '2)) '()))
+(let world (Write! world res_sink (Key) (Lookup dict (Uint32 '3)) '()))
+
+(return world)
+))))
+
+(let world (Apply macro world 'Sorted/One '('Sorted 'One)))
+(let world (Apply macro world 'Sorted/Many '('Sorted 'Many)))
+(let world (Apply macro world 'Hashed/One '('Hashed 'One)))
+(let world (Apply macro world 'Hashed/Many '('Hashed 'Many)))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/ToOptional.yql b/yql/essentials/tests/s-expressions/suites/InMem/ToOptional.yql
new file mode 100644
index 0000000000..b9e3d077ae
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/ToOptional.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let test (lambda '(world data) (block '(
+ (let world (Write! world res_sink (Key) (ToOptional data) '('('type))))
+ (return world)
+))))
+
+(let listType (ListType (DataType 'String)))
+(let callableType (CallableType '() '(listType)))
+
+(let callable1 (Callable callableType (lambda '() (List listType))))
+(let callable2 (Callable callableType (lambda '() (List listType (String 'A)))))
+(let callable3 (Callable callableType (lambda '() (List listType (String 'A) (String 'B)))))
+
+(let world (Apply test world (List listType)))
+(let world (Apply test world (List listType (String 'a))))
+(let world (Apply test world (List listType (String 'a) (String 'b))))
+
+(let world (Apply test world (Apply callable1)))
+(let world (Apply test world (Apply callable2)))
+(let world (Apply test world (Apply callable3)))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Top.yql b/yql/essentials/tests/s-expressions/suites/InMem/Top.yql
new file mode 100644
index 0000000000..0e8ab78955
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Top.yql
@@ -0,0 +1,27 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList
+ (AsStruct '('a (Uint32 '4)) '('b (String 'c)))
+ (AsStruct '('a (Uint32 '1)) '('b (String 'd)))
+ (AsStruct '('a (Uint32 '3)) '('b (String 'b)))
+ (AsStruct '('a (Uint32 '2)) '('b (String 'a)))
+ (AsStruct '('a (Uint32 '5)) '('b (String 'y)))
+ (AsStruct '('a (Uint32 '1)) '('b (String 'z)))
+))
+(let world (Write! world res_sink (Key) (Top list (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'b))) '('('type))))
+(let world (Write! world res_sink (Key) (Top list (Uint64 '3) (Bool 'False) (lambda '(item) (Member item 'b))) '('('type))))
+(let world (Write! world res_sink (Key) (Top list (Uint64 '3) '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Top (Iterator list (DependsOn (String 'a))) (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'b)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (TopSort list (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'b))) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort list (Uint64 '3) (Bool 'False) (lambda '(item) (Member item 'b))) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort list (Uint64 '3) '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (TopSort (Iterator list (DependsOn (String 'b))) (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'b)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/VariantItem.yql b/yql/essentials/tests/s-expressions/suites/InMem/VariantItem.yql
new file mode 100644
index 0000000000..5b2d4c3930
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/VariantItem.yql
@@ -0,0 +1,50 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32) (DataType 'Int32))))
+(let v1 (Variant (Int32 '34) '0 vt))
+(let v2 (Variant (Int32 '42) '1 vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (VariantItem v1) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem v2) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem jv1) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem jv2) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem n) '('('type))))
+
+(let world (Write! world res_sink (Key) (VariantItem (Apply id v1)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id v2)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id jv1)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id jv2)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id n)) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'Int32)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+(let v2 (Variant (Int32 '42) 'b vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (VariantItem v1) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem v2) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem jv1) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem jv2) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem n) '('('type))))
+
+(let world (Write! world res_sink (Key) (VariantItem (Apply id v1)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id v2)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id jv1)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id jv2)) '('('type))))
+(let world (Write! world res_sink (Key) (VariantItem (Apply id n)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Visit.cfg b/yql/essentials/tests/s-expressions/suites/InMem/Visit.cfg
new file mode 100644
index 0000000000..e41deb15c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Visit.cfg
@@ -0,0 +1,2 @@
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Visit.yql b/yql/essentials/tests/s-expressions/suites/InMem/Visit.yql
new file mode 100644
index 0000000000..0616a5100c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Visit.yql
@@ -0,0 +1,59 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+#comment
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let v1 (Variant (Int32 '34) '0 vt))
+(let v2 (Variant (String 'qwe) '1 vt))
+
+(let handler1 (lambda '(x) (Concat (String '"handler1:") (ToString (+ (Uint32 '100) x)))))
+(let handler2 (lambda '(x) (Concat (String '"handler2:") x)))
+
+(let world (Write! world res_sink (Key) (Visit v1 '0 handler1 '1 handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '0 handler1 '1 handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 '0 handler1 (String 'q1)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 '1 handler2 (String 'q2)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '0 handler1 (String 'q3)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '1 handler2 (String 'q4)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 (String 'q5)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 (String 'q6)) '('('type))))
+
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) '0 handler1 '1 handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) '1 handler2 '0 handler1) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) '0 handler1 (String 'q1)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) '1 handler2 (String 'q2)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) '0 handler1 (String 'q3)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) '1 handler2 (String 'q4)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) (String 'q5)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) (String 'q6)) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+(let v2 (Variant (String 'qwe) 'b vt))
+
+(let world (Write! world res_sink (Key) (Visit v1 'a handler1 'b handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'b handler2 'a handler1) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 'a handler1 (String 'r1)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 'b handler2 (String 'r2)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'a handler1 (String 'r3)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'b handler2 (String 'r4)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 (String 'r5)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 (String 'r6)) '('('type))))
+
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) 'a handler1 'b handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) 'a handler1 'b handler2) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) 'a handler1 (String 'r1)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) 'b handler2 (String 'r2)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) 'a handler1 (String 'r3)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) 'b handler2 (String 'r4)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v1) (String 'r5)) '('('type))))
+(let world (Write! world res_sink (Key) (Visit (Apply id v2) (String 'r6)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Way.cfg b/yql/essentials/tests/s-expressions/suites/InMem/Way.cfg
new file mode 100644
index 0000000000..e41deb15c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Way.cfg
@@ -0,0 +1,2 @@
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/Way.yql b/yql/essentials/tests/s-expressions/suites/InMem/Way.yql
new file mode 100644
index 0000000000..a1e2043ec3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/Way.yql
@@ -0,0 +1,50 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let v1 (Variant (Int32 '34) '0 vt))
+(let v2 (Variant (String 'qwe) '1 vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (Way v1) '('('type))))
+(let world (Write! world res_sink (Key) (Way v2) '('('type))))
+(let world (Write! world res_sink (Key) (Way jv1) '('('type))))
+(let world (Write! world res_sink (Key) (Way jv2) '('('type))))
+(let world (Write! world res_sink (Key) (Way n) '('('type))))
+
+(let world (Write! world res_sink (Key) (Way (Apply id v1)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id v2)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id jv1)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id jv2)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id n)) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+(let v2 (Variant (String 'qwe) 'b vt))
+(let jv1 (Just v1))
+(let jv2 (Just v2))
+(let n (Nothing (TypeOf jv1)))
+
+(let world (Write! world res_sink (Key) (Way v1) '('('type))))
+(let world (Write! world res_sink (Key) (Way v2) '('('type))))
+(let world (Write! world res_sink (Key) (Way jv1) '('('type))))
+(let world (Write! world res_sink (Key) (Way jv2) '('('type))))
+(let world (Write! world res_sink (Key) (Way n) '('('type))))
+
+(let world (Write! world res_sink (Key) (Way (Apply id v1)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id v2)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id jv1)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id jv2)) '('('type))))
+(let world (Write! world res_sink (Key) (Way (Apply id n)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/InMem/default.cfg b/yql/essentials/tests/s-expressions/suites/InMem/default.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/InMem/default.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore.yql
new file mode 100644
index 0000000000..8bf51c75d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore.yql
@@ -0,0 +1,53 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (Iterator list (DependsOn (String 'Inner))) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeft (CommonJoinCore (Iterator list (DependsOn (String 'Left))) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRight (CommonJoinCore (Iterator list (DependsOn (String 'Right))) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinFull (CommonJoinCore (Iterator list (DependsOn (String 'Full))) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (Iterator list (DependsOn (String 'LeftOnly))) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (Iterator list (DependsOn (String 'LeftSemi))) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (Iterator list (DependsOn (String 'RightOnly))) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (Iterator list (DependsOn (String 'RightSemi))) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinExclusion (CommonJoinCore (Iterator list (DependsOn (String 'Exclusion))) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinCross (CommonJoinCore (Iterator list (DependsOn (String 'Cross))) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft.yql
new file mode 100644
index 0000000000..3d7aacb4dc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft.yql
@@ -0,0 +1,54 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (Iterator list (DependsOn (String 'Inner))) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeft (CommonJoinCore (Iterator list (DependsOn (String 'Left))) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRight (CommonJoinCore (Iterator list (DependsOn (String 'Right))) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinFull (CommonJoinCore (Iterator list (DependsOn (String 'Full))) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (Iterator list (DependsOn (String 'LeftOnly))) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (Iterator list (DependsOn (String 'LeftSemi))) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (Iterator list (DependsOn (String 'RightOnly))) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (Iterator list (DependsOn (String 'RightSemi))) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinExclusion (CommonJoinCore (Iterator list (DependsOn (String 'Exclusion))) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinCross (CommonJoinCore (Iterator list (DependsOn (String 'Cross))) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft_Flow.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft_Flow.yql
new file mode 100644
index 0000000000..5d4048a4ab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedLeft_Flow.yql
@@ -0,0 +1,54 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (ToFlow list) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeft (CommonJoinCore (ToFlow list) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRight (CommonJoinCore (ToFlow list) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinFull (CommonJoinCore (ToFlow list) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (ToFlow list) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (ToFlow list) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (ToFlow list) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (ToFlow list) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinExclusion (CommonJoinCore (ToFlow list) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+(let joinCross (CommonJoinCore (ToFlow list) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'left)) '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight.yql
new file mode 100644
index 0000000000..64425dd37b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight.yql
@@ -0,0 +1,54 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (Iterator list (DependsOn (String 'Inner))) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeft (CommonJoinCore (Iterator list (DependsOn (String 'Left))) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRight (CommonJoinCore (Iterator list (DependsOn (String 'Right))) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinFull (CommonJoinCore (Iterator list (DependsOn (String 'Full))) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (Iterator list (DependsOn (String 'LeftOnly))) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (Iterator list (DependsOn (String 'LeftSemi))) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (Iterator list (DependsOn (String 'RightOnly))) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (Iterator list (DependsOn (String 'RightSemi))) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinExclusion (CommonJoinCore (Iterator list (DependsOn (String 'Exclusion))) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinCross (CommonJoinCore (Iterator list (DependsOn (String 'Cross))) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight_Flow.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight_Flow.yql
new file mode 100644
index 0000000000..a3d9b47ecf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCoreSortedRight_Flow.yql
@@ -0,0 +1,54 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (ToFlow list) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeft (CommonJoinCore (ToFlow list) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRight (CommonJoinCore (ToFlow list) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinFull (CommonJoinCore (ToFlow list) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (ToFlow list) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (ToFlow list) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (ToFlow list) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (ToFlow list) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinExclusion (CommonJoinCore (ToFlow list) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+(let joinCross (CommonJoinCore (ToFlow list) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '('('sorted 'right)) '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_Flow.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_Flow.yql
new file mode 100644
index 0000000000..10b5abc6e7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_Flow.yql
@@ -0,0 +1,53 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let list12 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'A))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'X))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (Just (String 'B))) '('key2 emptyInt32) '('value2 emptyString) '('_yql_table_index (Uint32 '0)) '('_yql_join_column_0 (Just (Int32 '1))))
+ (AsStruct '('key1 emptyInt32) '('value1 emptyString) '('key2 (Just (Int32 '1))) '('value2 (Just (String 'Y))) '('_yql_table_index (Uint32 '1)) '('_yql_join_column_0 (Just (Int32 '1))))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (ToFlow list) 'Inner '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeft (CommonJoinCore (ToFlow list) 'Left '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRight (CommonJoinCore (ToFlow list) 'Right '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinFull (CommonJoinCore (ToFlow list) 'Full '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeftOnly (CommonJoinCore (ToFlow list) 'LeftOnly '('key1 'value1) '() '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinLeftSemi (CommonJoinCore (ToFlow list) 'LeftSemi '('key1 'value1) '() '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRightOnly (CommonJoinCore (ToFlow list) 'RightOnly '() '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinRightSemi (CommonJoinCore (ToFlow list) 'RightSemi '() '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinExclusion (CommonJoinCore (ToFlow list) 'Exclusion '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+(let joinCross (CommonJoinCore (ToFlow list) 'Cross '('key1 'value1) '('key2 'value2) '() '('_yql_join_column_0) '() '_yql_table_index))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_FlowOfTuples.yql b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_FlowOfTuples.yql
new file mode 100644
index 0000000000..bb15c6f634
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/CommonJoinCore_FlowOfTuples.yql
@@ -0,0 +1,54 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let emptyInt32 (Nothing (OptionalType (DataType 'Int32))))
+(let emptyString (Nothing (OptionalType (DataType 'String))))
+(let list1 (AsList
+ '((Just (Int32 '1)) (Just (String 'A)) emptyInt32 emptyString (Uint32 '0) (Just (Int32 '1)))
+ '((Just (Int32 '1)) (Just (String 'B)) emptyInt32 emptyString (Uint32 '0) (Just (Int32 '1)))
+))
+
+(let list2 (AsList
+ '(emptyInt32 emptyString (Just (Int32 '1)) (Just (String 'X)) (Uint32 '1) (Just (Int32 '1)))
+ '(emptyInt32 emptyString (Just (Int32 '1)) (Just (String 'Y)) (Uint32 '1) (Just (Int32 '1)))
+))
+
+(let list12 (AsList
+ '((Just (Int32 '1)) (Just (String 'A)) emptyInt32 emptyString (Uint32 '0) (Just (Int32 '1)))
+ '(emptyInt32 emptyString (Just (Int32 '1)) (Just (String 'X)) (Uint32 '1) (Just (Int32 '1)))
+ '((Just (Int32 '1)) (Just (String 'B)) emptyInt32 emptyString (Uint32 '0) (Just (Int32 '1)))
+ '(emptyInt32 emptyString (Just (Int32 '1)) (Just (String 'Y)) (Uint32 '1) (Just (Int32 '1)))
+))
+
+(let writeRes (lambda '(world list) (block '(
+(let joinInner (CommonJoinCore (ToFlow list) 'Inner '('0 '1) '('2 '3) '() '('5) '() '4))
+(let joinLeft (CommonJoinCore (ToFlow list) 'Left '('0 '1) '('2 '3) '() '('5) '() '4))
+(let joinRight (CommonJoinCore (ToFlow list) 'Right '('0 '1) '('2 '3) '() '('5) '() '4))
+(let joinFull (CommonJoinCore (ToFlow list) 'Full '('0 '1) '('2 '3) '() '('5) '() '4))
+(let joinLeftOnly (CommonJoinCore (ToFlow list) 'LeftOnly '('0 '1) '() '() '('5) '() '4))
+(let joinLeftSemi (CommonJoinCore (ToFlow list) 'LeftSemi '('0 '1) '() '() '('5) '() '4))
+(let joinRightOnly (CommonJoinCore (ToFlow list) 'RightOnly '() '('2 '3) '() '('5) '() '4))
+(let joinRightSemi (CommonJoinCore (ToFlow list) 'RightSemi '() '('2 '3) '() '('5) '() '4))
+(let joinExclusion (CommonJoinCore (ToFlow list) 'Exclusion '('0 '1) '('2 '3) '() '('5) '() '4))
+(let joinCross (CommonJoinCore (ToFlow list) 'Cross '('0 '1) '('2 '3) '() '('5) '() '4))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRight) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinFull) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinRightSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinExclusion) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinCross) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+))))
+
+(let world (Apply writeRes world list1))
+(let world (Apply writeRes world list2))
+(let world (Apply writeRes world list12))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Join/EmptyLeftJoin.yql b/yql/essentials/tests/s-expressions/suites/Join/EmptyLeftJoin.yql
new file mode 100644
index 0000000000..78c4cbd20f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/EmptyLeftJoin.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (String '1))) '('value1 (Just (String 'A))))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (String '1)) '('value2 (Nothing (OptionalType (DataType 'String)))))
+))
+
+(let keyExtractor (lambda '(x) (Member x 'key2)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeft (MapJoinCore (Iterator list1 (DependsOn (String 'Left))) dictMany 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt b/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt
new file mode 100644
index 0000000000..8ed0317c19
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="075"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="023"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt.attr b/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/InputSelf.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Join/JoinInMem.yql b/yql/essentials/tests/s-expressions/suites/Join/JoinInMem.yql
new file mode 100644
index 0000000000..aecec9aba2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/JoinInMem.yql
@@ -0,0 +1,34 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList
+ '((Int32 '1) (String 'A))
+ '((Int32 '7) (String 'B))
+ '((Int32 '4) (String 'C))
+ '((Int32 '4) (String 'D))
+))
+
+(let list2 (AsList
+ '((Int32 '9) (String 'Z))
+ '((Int32 '4) (String 'Y))
+ '((Int32 '3) (String 'X))
+ '((Int32 '4) (String 'W))
+ '((Int32 '8) (String 'V))
+))
+
+(let keyExtractor (lambda '(item) (Nth item '0)))
+(let joinInner (Join list1 list2 keyExtractor keyExtractor 'Inner))
+(let joinLeft (Join list1 list2 keyExtractor keyExtractor 'Left))
+(let joinRight (Join list1 list2 keyExtractor keyExtractor 'Right))
+(let joinFull (Join list1 list2 keyExtractor keyExtractor 'Full))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) joinInner '()))
+(let world (Write! world res_sink (Key) joinLeft '()))
+(let world (Write! world res_sink (Key) joinRight '()))
+(let world (Write! world res_sink (Key) joinFull '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/JoinTypes.yql b/yql/essentials/tests/s-expressions/suites/Join/JoinTypes.yql
new file mode 100644
index 0000000000..dff7b4a5f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/JoinTypes.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input1)))
+ '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table2 (Map table1 (lambda '(item) (block '(
+ (return (AsStruct
+ '('value (Member item 'key))
+ '('subkey (Member item 'subkey))
+ '('key (Member item 'value)))))
+))))
+
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let joinInner (Join table1 table2 keyExtractor keyExtractor 'Inner))
+(let joinLeft (Join table1 table2 keyExtractor keyExtractor 'Left))
+(let joinRight (Join table1 table2 keyExtractor keyExtractor 'Right))
+(let joinFull (Join table1 table2 keyExtractor keyExtractor 'Full))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf joinInner)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf joinLeft)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf joinRight)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf joinFull)) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore.yql b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore.yql
new file mode 100644
index 0000000000..3111328024
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore.yql
@@ -0,0 +1,41 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (String 'A)))
+ (AsStruct '('key1 (Just (Int32 '7))) '('value1 (String 'B)))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (String 'C)))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (String 'D)))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (String 'E)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int64 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int64 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int64 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int64 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int64 '8)) '('value2 (String 'V)))
+))
+
+(let keyExtractor (lambda '(x) (Member x 'key2)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeftSemi (MapJoinCore (Iterator list1 (DependsOn (String 'LeftSemi))) dictOne 'LeftSemi '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '() '() '()))
+(let joinLeftOnly (MapJoinCore (Iterator list1 (DependsOn (String 'LeftOnly))) dictOne 'LeftOnly '('key1) '('key2) '('key1 'a.key1 'key1 'another_key 'key1 'yet_another_key) '() '() '()))
+(let joinInnerUnique (MapJoinCore (Iterator list1 (DependsOn (String 'InnerU))) dictOne 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('value2 'b.value2) '() '()))
+(let joinLeftUnique (MapJoinCore (Iterator list1 (DependsOn (String 'LeftU))) dictOne 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+(let joinInner (MapJoinCore (Iterator list1 (DependsOn (String 'Inner))) dictMany 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('key2 'b.key2) '() '()))
+(let joinLeft (MapJoinCore (Iterator list1 (DependsOn (String 'Left))) dictMany 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInnerUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings.yql b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings.yql
new file mode 100644
index 0000000000..663bde4955
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings.yql
@@ -0,0 +1,41 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP1))) '('value1 (String 'A)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP7))) '('value1 (String 'B)))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'String)))) '('value1 (String 'C)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP4))) '('value1 (String 'D)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP4))) '('value1 (String 'E)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP8)) '('value2 (String 'V)))
+))
+
+(let keyExtractor (lambda '(x) (Member x 'key2)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeftSemi (MapJoinCore (Iterator list1 (DependsOn (String 'LeftSemi))) dictOne 'LeftSemi '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '() '() '()))
+(let joinLeftOnly (MapJoinCore (Iterator list1 (DependsOn (String 'LeftOnly))) dictOne 'LeftOnly '('key1) '('key2) '('key1 'a.key1 'key1 'another_key 'key1 'yet_another_key) '() '() '()))
+(let joinInnerUnique (MapJoinCore (Iterator list1 (DependsOn (String 'InnerU))) dictOne 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('value2 'b.value2) '() '()))
+(let joinLeftUnique (MapJoinCore (Iterator list1 (DependsOn (String 'LeftU))) dictOne 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+(let joinInner (MapJoinCore (Iterator list1 (DependsOn (String 'Inner))) dictMany 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('key2 'b.key2) '() '()))
+(let joinLeft (MapJoinCore (Iterator list1 (DependsOn (String 'Left))) dictMany 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInnerUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings_Flow.yql b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings_Flow.yql
new file mode 100644
index 0000000000..9c1ef15dfe
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCoreOnStrings_Flow.yql
@@ -0,0 +1,41 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP1))) '('value1 (String 'A)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP7))) '('value1 (String 'B)))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'String)))) '('value1 (String 'C)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP4))) '('value1 (String 'D)))
+ (AsStruct '('key1 (Just (String '0123456789QWRTYUIOP4))) '('value1 (String 'E)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (String '0123456789QWRTYUIOP8)) '('value2 (String 'V)))
+))
+
+(let keyExtractor (lambda '(x) (Member x 'key2)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeftSemi (MapJoinCore (ToFlow list1) dictOne 'LeftSemi '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '() '() '()))
+(let joinLeftOnly (MapJoinCore (ToFlow list1) dictOne 'LeftOnly '('key1) '('key2) '('key1 'a.key1 'key1 'another_key 'key1 'yet_another_key) '() '() '()))
+(let joinInnerUnique (MapJoinCore (ToFlow list1) dictOne 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('value2 'b.value2) '() '()))
+(let joinLeftUnique (MapJoinCore (ToFlow list1) dictOne 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+(let joinInner (MapJoinCore (ToFlow list1) dictMany 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('key2 'b.key2) '() '()))
+(let joinLeft (MapJoinCore (ToFlow list1) dictMany 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInnerUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_Flow.yql b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_Flow.yql
new file mode 100644
index 0000000000..61b150f5f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_Flow.yql
@@ -0,0 +1,41 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ (AsStruct '('key1 (Just (Int32 '1))) '('value1 (String 'A)))
+ (AsStruct '('key1 (Just (Int32 '7))) '('value1 (String 'B)))
+ (AsStruct '('key1 (Nothing (OptionalType (DataType 'Int32)))) '('value1 (String 'C)))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (String 'D)))
+ (AsStruct '('key1 (Just (Int32 '4))) '('value1 (String 'E)))
+))
+
+(let list2 (AsList
+ (AsStruct '('key2 (Int64 '9)) '('value2 (String 'Z)))
+ (AsStruct '('key2 (Int64 '4)) '('value2 (String 'Y)))
+ (AsStruct '('key2 (Int64 '3)) '('value2 (String 'X)))
+ (AsStruct '('key2 (Int64 '4)) '('value2 (String 'W)))
+ (AsStruct '('key2 (Int64 '8)) '('value2 (String 'V)))
+))
+
+(let keyExtractor (lambda '(x) (Member x 'key2)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeftSemi (MapJoinCore (ToFlow list1) dictOne 'LeftSemi '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '() '() '()))
+(let joinLeftOnly (MapJoinCore (ToFlow list1) dictOne 'LeftOnly '('key1) '('key2) '('key1 'a.key1 'key1 'another_key 'key1 'yet_another_key) '() '() '()))
+(let joinInnerUnique (MapJoinCore (ToFlow list1) dictOne 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('value2 'b.value2) '() '()))
+(let joinLeftUnique (MapJoinCore (ToFlow list1) dictOne 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+(let joinInner (MapJoinCore (ToFlow list1) dictMany 'Inner '('key1) '('key2) '('key1 'a.key1 'value1 'a.value1) '('key2 'b.key2) '() '()))
+(let joinLeft (MapJoinCore (ToFlow list1) dictMany 'Left '('key1) '('key2) '('key1 'a.key1) '('key2 'b.key2 'value2 'b.value2) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInnerUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_FlowOfTuples.yql b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_FlowOfTuples.yql
new file mode 100644
index 0000000000..dbd0d1712d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/MapJoinCore_FlowOfTuples.yql
@@ -0,0 +1,41 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let list1 (AsList
+ '((Just (Int32 '1)) (String 'A))
+ '((Just (Int32 '7)) (String 'B))
+ '((Nothing (OptionalType (DataType 'Int32))) (String 'C))
+ '((Just (Int32 '4)) (String 'D))
+ '((Just (Int32 '4)) (String 'E))
+))
+
+(let list2 (AsList
+ '((Int64 '9) (String 'Z))
+ '((Int64 '4) (String 'Y))
+ '((Int64 '3) (String 'X))
+ '((Int64 '4) (String 'W))
+ '((Int64 '8) (String 'V))
+))
+
+(let keyExtractor (lambda '(x) (Nth x '0)))
+(let payloadExtractor (lambda '(x) x))
+
+(let dictOne (ToDict list2 keyExtractor payloadExtractor '('Hashed 'One 'Compact)))
+(let dictMany (ToDict list2 keyExtractor payloadExtractor '('Hashed 'Many 'Compact)))
+(let joinLeftSemi (MapJoinCore (ToFlow list1) dictOne 'LeftSemi '('0) '('0) '('0 '0 '1 '1) '() '() '()))
+(let joinLeftOnly (MapJoinCore (ToFlow list1) dictOne 'LeftOnly '('0) '('0) '('0 '0 '0 '1 '0 '2) '() '() '()))
+(let joinInnerUnique (MapJoinCore (ToFlow list1) dictOne 'Inner '('0) '('0) '('0 '2 '1 '1) '('1 '0) '() '()))
+(let joinLeftUnique (MapJoinCore (ToFlow list1) dictOne 'Left '('0) '('0) '('0 '0) '('0 '1 '1 '2) '() '()))
+(let joinInner (MapJoinCore (ToFlow list1) dictMany 'Inner '('0) '('0) '('0 '0 '1 '1) '('0 '2) '() '()))
+(let joinLeft (MapJoinCore (ToFlow list1) dictMany 'Left '('0) '('0) '('0 '2) '('0 '1 '1 '0) '() '()))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Collect joinLeftSemi) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftOnly) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInnerUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeftUnique) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinInner) '('('type))))
+(let world (Write! world res_sink (Key) (Collect joinLeft) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Join/default.cfg b/yql/essentials/tests/s-expressions/suites/Join/default.cfg
new file mode 100644
index 0000000000..db91b7fd18
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/default.cfg
@@ -0,0 +1,5 @@
+res result.txt
+in InputSelf InputSelf.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input1.txt b/yql/essentials/tests/s-expressions/suites/Join/input1.txt
new file mode 100644
index 0000000000..f53757c309
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="1";"value"="ddd"};
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="150";"subkey"="1";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/Join/input1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input2.txt b/yql/essentials/tests/s-expressions/suites/Join/input2.txt
new file mode 100644
index 0000000000..07af3b4647
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="2";"value"="q"};
+{"key"="150";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/Join/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input3.txt b/yql/essentials/tests/s-expressions/suites/Join/input3.txt
new file mode 100644
index 0000000000..1dc1bcc60b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="021";"subkey"="3";"value"="q"};
+{"key"="151";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Join/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/Join/input3.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Join/input3.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg.yql
new file mode 100644
index 0000000000..3a918b3c81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '7)))
+))
+(let avg_traits (Apply (bind agg_module 'avg_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('avg_value avg_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If.yql
new file mode 100755
index 0000000000..3b90e99391
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If.yql
@@ -0,0 +1,22 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Uint32 '17)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('pred (Bool '0)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Uint32 '9)))
+))
+(let avg_traits (Apply (bind agg_module 'avg_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'pred))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('avg_value avg_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If_Opt.yql
new file mode 100755
index 0000000000..830f163e5f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_If_Opt.yql
@@ -0,0 +1,22 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('pred (Bool '0)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Just (Uint32 '9))))
+))
+(let avg_traits (Apply (bind agg_module 'avg_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'pred))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('avg_value avg_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_Opt.yql
new file mode 100644
index 0000000000..1862c9703d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Avg_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '9))))
+))
+(let avg_traits (Apply (bind agg_module 'avg_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('avg_value avg_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_And.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_And.yql
new file mode 100644
index 0000000000..75cbff2731
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_And.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let and_traits (Apply (bind agg_module 'bit_and_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('and_value and_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Or.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Or.yql
new file mode 100644
index 0000000000..37cd22a4ed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Or.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let or_traits (Apply (bind agg_module 'bit_or_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('or_value or_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Xor.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Xor.yql
new file mode 100644
index 0000000000..b4cb8e8f5a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_Xor.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let xor_traits (Apply (bind agg_module 'bit_xor_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('xor_value xor_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_And_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_And_Opt.yql
new file mode 100644
index 0000000000..3f57941811
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_And_Opt.yql
@@ -0,0 +1,28 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '5)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+))
+(let and_traits (Apply (bind agg_module 'and_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('and_value and_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Or_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Or_Opt.yql
new file mode 100644
index 0000000000..32ab9bdf8e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Or_Opt.yql
@@ -0,0 +1,28 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '5)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+))
+(let or_traits (Apply (bind agg_module 'or_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('or_value or_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Xor_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Xor_Opt.yql
new file mode 100644
index 0000000000..7463add10f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bool_Xor_Opt.yql
@@ -0,0 +1,28 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '4)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '5)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '5)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+))
+(let xor_traits (Apply (bind agg_module 'xor_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('xor_value xor_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Compare_By_Opts.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Compare_By_Opts.yql
new file mode 100644
index 0000000000..f00b6365aa
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Compare_By_Opts.yql
@@ -0,0 +1,24 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Just (Uint32 '7))) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Just (Uint32 '2))) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Just (Uint32 '1))) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Just (Uint32 '3))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Nothing (OptionalType (DataType 'Uint32)))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Just (Uint32 '2))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Just (Uint32 '6))) '('value (Just (Uint32 '6))))
+(AsStruct '('key (Just (Uint32 '5))) '('value (Just (Uint32 '9))))
+))
+(let min (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Void)))
+(let max (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Void)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('min min) '('max max))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count.yql
new file mode 100644
index 0000000000..70c1586820
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let count_traits (Apply (bind agg_module 'count_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All.yql
new file mode 100644
index 0000000000..4e21b049d6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let count_traits (Apply (bind agg_module 'count_all_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All_Opt.yql
new file mode 100644
index 0000000000..2bbd4d8aee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_All_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let count_traits (Apply (bind agg_module 'count_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If.yql
new file mode 100644
index 0000000000..05fc3411ee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Bool '0)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '1)))
+(AsStruct '('key (Uint32 '1)) '('value (Bool '0)))
+(AsStruct '('key (Uint32 '3)) '('value (Bool '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '0)))
+))
+(let count_traits (Apply (bind agg_module 'count_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If_Opt.yql
new file mode 100644
index 0000000000..562b296e54
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_If_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+))
+(let count_traits (Apply (bind agg_module 'count_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_Opt.yql
new file mode 100644
index 0000000000..1c622b7dc4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Count_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let count_traits (Apply (bind agg_module 'count_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count.yql
new file mode 100644
index 0000000000..4164df0baf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let count_traits (Apply (bind agg_module 'count_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All.yql
new file mode 100644
index 0000000000..f0aa559269
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let count_traits (Apply (bind agg_module 'count_all_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All_Opt.yql
new file mode 100644
index 0000000000..35b9f5ff52
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_All_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let count_traits (Apply (bind agg_module 'count_all_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If.yql
new file mode 100644
index 0000000000..2f803d033c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Bool '0)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '1)))
+(AsStruct '('key (Uint32 '1)) '('value (Bool '0)))
+(AsStruct '('key (Uint32 '3)) '('value (Bool '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '0)))
+(AsStruct '('key (Uint32 '2)) '('value (Bool '1)))
+))
+(let count_traits (Apply (bind agg_module 'count_if_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If_Opt.yql
new file mode 100644
index 0000000000..23fc8348fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_If_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Bool '0))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Bool)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Bool '1))))
+))
+(let count_traits (Apply (bind agg_module 'count_if_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_Opt.yql
new file mode 100644
index 0000000000..b8d6f537a6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Count_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let count_traits (Apply (bind agg_module 'count_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('count_value count_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max.yql
new file mode 100644
index 0000000000..5ecf5b1435
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let max_traits (Apply (bind agg_module 'max_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('max_value max_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max_Opt.yql
new file mode 100644
index 0000000000..9eeab95381
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Max_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let max_traits (Apply (bind agg_module 'max_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('max_value max_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min.yql
new file mode 100644
index 0000000000..b31163c9ed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let min_traits (Apply (bind agg_module 'min_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('min_value min_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min_Opt.yql
new file mode 100644
index 0000000000..2f6803c9ce
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Min_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let min_traits (Apply (bind agg_module 'min_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('min_value min_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some.yql
new file mode 100644
index 0000000000..f765ed07b9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '0)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '1)))
+))
+(let some_traits (Apply (bind agg_module 'some_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('some_value some_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some_Opt.yql
new file mode 100644
index 0000000000..7194f87bdc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Some_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '1))))
+))
+(let some_traits (Apply (bind agg_module 'some_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('some_value some_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum.yql
new file mode 100644
index 0000000000..6aaa8a231a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let sum_traits (Apply (bind agg_module 'sum_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum_Opt.yql
new file mode 100644
index 0000000000..4c19ad9f29
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Distinct_Sum_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let sum_traits (Apply (bind agg_module 'sum_traits_factory) (ListType (StructMemberType (ListItemType (TypeOf list)) 'value)) (lambda '(v) v)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits 'value))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List.yql
new file mode 100644
index 0000000000..61ed0f2179
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '7)))
+))
+(let list_traits (Apply (bind agg_module 'list_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (Uint64 '0)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('list_value list_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Compare_By_Opts.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Compare_By_Opts.yql
new file mode 100644
index 0000000000..6fc7177662
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Compare_By_Opts.yql
@@ -0,0 +1,29 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Just (Uint32 '7))) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Just (Uint32 '7))) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Just (Uint32 '2))) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Just (Uint32 '1))) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Just (Uint32 '0))) '('value (Just (Uint32 '9))))
+(AsStruct '('key (Just (Uint32 '1))) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Just (Uint32 '1))) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Just (Uint32 '3))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Nothing (OptionalType (DataType 'Uint32)))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Just (Uint32 '2))) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Just (Uint32 '6))) '('value (Just (Uint32 '6))))
+(AsStruct '('key (Just (Uint32 '5))) '('value (Just (Uint32 '9))))
+(AsStruct '('key (Nothing (OptionalType (DataType 'Uint32)))) '('value (Just (Uint32 '9))))
+))
+(let min (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Uint64 '3)))
+(let max (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Uint64 '3)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('min min) '('max max))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Limit.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Limit.yql
new file mode 100644
index 0000000000..ab1302c752
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Limit.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '7)))
+))
+(let list_traits (Apply (bind agg_module 'list_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (Uint64 '1)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('list_value list_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By.yql
new file mode 100644
index 0000000000..0572dfb448
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By.yql
@@ -0,0 +1,23 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '7)))
+))
+(let traits (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'key)) (lambda '(row) (Member row 'value)) (Uint64 '3)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By_Opt.yql
new file mode 100644
index 0000000000..d2ec207c91
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Max_By_Opt.yql
@@ -0,0 +1,22 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '9))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Uint32 '9))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let traits (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Uint64 '3)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By.yql
new file mode 100644
index 0000000000..e29fb2715c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By.yql
@@ -0,0 +1,23 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '8)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '8)))
+))
+(let traits (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'key)) (lambda '(row) (Member row 'value)) (Uint64 '7)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By_Opt.yql
new file mode 100644
index 0000000000..96e85e97c4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Min_By_Opt.yql
@@ -0,0 +1,23 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '7)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '9)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let traits (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Uint64 '3)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Opt.yql
new file mode 100644
index 0000000000..a22f743db3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_List_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '9))))
+))
+(let list_traits (Apply (bind agg_module 'list_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (Uint64 '0)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('list_value list_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max.yql
new file mode 100644
index 0000000000..8bf97f958c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let max_traits (Apply (bind agg_module 'max_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('max_value max_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By.yql
new file mode 100644
index 0000000000..e28d35900c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let traits (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'key)) (lambda '(row) (Member row 'value)) (Void)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By_Opt.yql
new file mode 100644
index 0000000000..95168e3143
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_By_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '0)) '('value (Just (Uint32 '9))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let traits (Apply (bind agg_module 'max_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Void)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_Opt.yql
new file mode 100644
index 0000000000..6e41241625
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Max_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let max_traits (Apply (bind agg_module 'max_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('max_value max_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min.yql
new file mode 100644
index 0000000000..35ecccd09e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let min_traits (Apply (bind agg_module 'min_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('min_value min_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By.yql
new file mode 100644
index 0000000000..3ad67c8e7f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '0)) '('value (Uint32 '7)))
+))
+(let traits (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'key)) (lambda '(row) (Member row 'value)) (Void)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By_Opt.yql
new file mode 100644
index 0000000000..7e48591609
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_By_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '7)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let traits (Apply (bind agg_module 'min_by_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'key)) (Void)))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '() '('('result traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_Opt.yql
new file mode 100644
index 0000000000..648369b4d3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Min_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '2))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+))
+(let min_traits (Apply (bind agg_module 'min_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('min_value min_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some.yql
new file mode 100644
index 0000000000..629a3cea33
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '8)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let some_traits (Apply (bind agg_module 'some_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('some_value some_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some_Opt.yql
new file mode 100644
index 0000000000..34ec224a58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Some_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '7))))
+))
+(let some_traits (Apply (bind agg_module 'some_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('some_value some_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum.yql
new file mode 100644
index 0000000000..2a943f1234
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('value (Uint32 '10)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
+))
+(let sum_traits (Apply (bind agg_module 'sum_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If.yql
new file mode 100755
index 0000000000..c229026827
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If.yql
@@ -0,0 +1,22 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Uint32 '5)))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Uint32 '17)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Uint32 '2)))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Uint32 '4)))
+(AsStruct '('key (Uint32 '3)) '('pred (Bool '0)) '('value (Uint32 '1)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Uint32 '3)))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Uint32 '9)))
+))
+(let sum_traits (Apply (bind agg_module 'sum_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'pred))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If_Opt.yql
new file mode 100755
index 0000000000..51e667e8d3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_If_Opt.yql
@@ -0,0 +1,22 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('pred (Bool '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('pred (Bool '0)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '0)) '('value (Just (Uint32 '3))))
+(AsStruct '('key (Uint32 '2)) '('pred (Bool '1)) '('value (Just (Uint32 '9))))
+))
+(let sum_traits (Apply (bind agg_module 'sum_if_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (lambda '(row) (Member row 'pred))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_Opt.yql b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_Opt.yql
new file mode 100644
index 0000000000..a50b4f93a9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Agg_Sum_Opt.yql
@@ -0,0 +1,21 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Uint32 '1)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '1)) '('value (Just (Uint32 '4))))
+(AsStruct '('key (Uint32 '3)) '('value (Nothing (OptionalType (DataType 'Uint32)))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+(AsStruct '('key (Uint32 '2)) '('value (Just (Uint32 '5))))
+))
+(let sum_traits (Apply (bind agg_module 'sum_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
+(let res_sink (DataSink 'result))
+(let resKey (Aggregate list '('key) '('('sum_value sum_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Decode.sql b/yql/essentials/tests/s-expressions/suites/Lib/Decode.sql
new file mode 100644
index 0000000000..d56651c52b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Decode.sql
@@ -0,0 +1,4 @@
+SELECT Core::Decode("key1",AsList("key1","value1","key2","value2"),"default");
+SELECT Core::Decode("key2",AsList("key1","value1","key2","value2"),"default");
+SELECT Core::Decode("keyZ",AsList("key1","value1","key2","value2"),"default");
+
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Decode.yql b/yql/essentials/tests/s-expressions/suites/Lib/Decode.yql
new file mode 100644
index 0000000000..25d3e102c6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Decode.yql
@@ -0,0 +1,72 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" ("bind" core_module '"Decode") (String '"key1") ("AsList" (String '"key1") (String '"value1") (String '"key2") (String '"value2")) (String '"default")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" ("bind" core_module '"Decode") (String '"key2") ("AsList" (String '"key1") (String '"value1") (String '"key2") (String '"value2")) (String '"default")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" ("bind" core_module '"Decode") (String '"keyZ") ("AsList" (String '"key1") (String '"value1") (String '"key2") (String '"value2")) (String '"default")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/Sqr.yql b/yql/essentials/tests/s-expressions/suites/Lib/Sqr.yql
new file mode 100644
index 0000000000..431c462e10
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/Sqr.yql
@@ -0,0 +1,12 @@
+# program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import sqr_module '"/lib/yql/sqr.yql")
+(let mySqr (bind sqr_module 'sqr))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Apply mySqr (Uint32 '4)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Lib/default.cfg b/yql/essentials/tests/s-expressions/suites/Lib/default.cfg
new file mode 100644
index 0000000000..e41deb15c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Lib/default.cfg
@@ -0,0 +1,2 @@
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldProject.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldProject.yql
new file mode 100644
index 0000000000..55b38fb1b9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldProject.yql
@@ -0,0 +1,59 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input1"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input2"))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (UnionAll (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"A" (String '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )) (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"A" (Int64 '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ ))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"column1" ("Concat" (Member row '"key") (String '"AAA"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldRead.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldRead.yql
new file mode 100644
index 0000000000..67becd3ffb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/BadUnionButUnusedFieldRead.yql
@@ -0,0 +1,58 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input1"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input2"))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (UnionAll (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"A" (String '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )) (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"A" (Int64 '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ ))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.cfg
new file mode 100644
index 0000000000..e5e19ca2fb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.cfg
@@ -0,0 +1,16 @@
+in Input1 input1.txt
+in Input2 input1.txt
+in Input3 input1.txt
+in Input4 input1.txt
+in Input5 input1.txt
+in Input6 input1.txt
+in Input7 input1.txt
+in Input8 input1.txt
+in Input9 input1.txt
+in Input10 input1.txt
+in Input11 input1.txt
+in Input12 input1.txt
+in Input13 input1.txt
+in Input14 input1.txt
+in Input15 input1.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.yql
new file mode 100644
index 0000000000..89b7fd5a76
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/CompactPlan.yql
@@ -0,0 +1,58 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input4))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table4 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input5))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table5 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input6))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table6 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input7))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table7 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input8))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table8 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input9))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table9 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input10))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table10 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input11))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table11 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input12))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table12 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input13))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table13 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input14))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table14 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input15))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table15 (Right! x))
+(let lens (AsList
+ (Length table1) (Length table2) (Length table3) (Length table4) (Length table5)
+ (Length table6) (Length table7) (Length table8) (Length table9) (Length table10)
+ (Length table11) (Length table12) (Length table13) (Length table14) (Length table15)))
+(let result (Fold lens (Uint64 '0) (lambda '(x y) (+ x y))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/ConcatSortedAndNonSorted.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ConcatSortedAndNonSorted.yql
new file mode 100644
index 0000000000..a16749b54f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ConcatSortedAndNonSorted.yql
@@ -0,0 +1,12 @@
+(
+(let source (DataSource 'yt 'plato))
+(let x (Read! world source (Key '('table (String 'Input1))) '('key 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let sorted (Sort table (Bool 'true) (lambda '(item) (Member item 'value))))
+(let result (Extend table sorted))
+(let sink (DataSink 'yt 'plato))
+(let world (Write! world sink (Key '('table (String 'Output))) result '()))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupAndSort.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupAndSort.yql
new file mode 100644
index 0000000000..08089395f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupAndSort.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let offset (Uint64 '5))
+(let result (Extend table1 table1))
+(let result (Sort result (Bool 'true) (lambda '(row) (block '(
+ (let res (Member row 'key))
+ (return res)
+)
+))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupByExtend.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupByExtend.yql
new file mode 100644
index 0000000000..0089378d22
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/DupByExtend.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let offset (Uint64 '5))
+(let result (Extend table1 table1))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/ExtendBetweenSorts.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ExtendBetweenSorts.yql
new file mode 100644
index 0000000000..110b0a004a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ExtendBetweenSorts.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let result1 (Sort table1 (Bool 'true) (lambda '(row) (block '(
+ (let res (Member row 'value))
+ (return res)
+)
+))))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let offset (Uint64 '5))
+(let result2 (Extend result1 table2))
+(let result2 (Sort result2 '((Bool 'true) (Bool 'true)) (lambda '(row) (block '(
+ (let res '((Member row 'key) (Member row 'subkey)))
+ (return res)
+)
+))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result2 '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result2 '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterAfterExtend.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterAfterExtend.yql
new file mode 100644
index 0000000000..1c7045232c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterAfterExtend.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let tresh (String '100))
+(let result (Filter (Extend table1 table2) (lambda '(item) (< (Member item 'key) tresh))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterBeforeExtend.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterBeforeExtend.yql
new file mode 100644
index 0000000000..2f2f487eca
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/FilterBeforeExtend.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let tresh (String '100))
+(let result (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let result (Extend result table2))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.cfg
new file mode 100644
index 0000000000..656c5e8480
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.cfg
@@ -0,0 +1,5 @@
+in Input1 non_ksv_input1.txt
+in Input2 non_ksv_input2.txt
+out Output output.txt
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.yql
new file mode 100644
index 0000000000..1afa2e265e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcat.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (MrTableConcat (Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) (Void) '()))
+(let world (Left! x))
+(let core (Right! x))
+(let core (Aggregate core '('"age") '('('cnt (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) core '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.cfg
new file mode 100644
index 0000000000..31a57e15ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.cfg
@@ -0,0 +1,9 @@
+in Input1 non_ksv_input1.txt
+in Input2 non_ksv_input3.txt
+in Input3 non_ksv_input1.txt
+in Input4 non_ksv_input3.txt
+in Input5 non_ksv_input1.txt
+in Input6 non_ksv_input3.txt
+out Output output.txt
+res result.txt
+mount ..\mounts.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.yql
new file mode 100644
index 0000000000..2215cc2428
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/GroupAfterWeakConcatOther.yql
@@ -0,0 +1,57 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat
+ (Key '('table (String '"Input1")))
+ (Key '('table (String '"Input2")))
+ (Key '('table (String '"Input3")))
+ (Key '('table (String '"Input4")))
+ (Key '('table (String '"Input5")))
+ (Key '('table (String '"Input6")))
+ ) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"age" (Coalesce
+ (TryMember row '"age" (Nothing (OptionalType (DataType 'Int64))))
+ (FromYsonSimpleType (SqlAccess 'dict (TryMember row '"_other" (Just (Dict (DictType (DataType '"String") (DataType '"String"))))) (String '"age")) 'Int64)
+ ))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (Aggregate core '('"age") '('('Count1 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" (Member row 'Count1)) '('"age" (Member row '"age"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let output (Sort output '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'column0) (Member item 'age)))))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0" '"age")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableRange.yql
new file mode 100644
index 0000000000..40cb4dc92c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableRange.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (Key '('table (MrTableRange '"" filter))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let length (Length tables))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) (Just (AsStruct '('value length))) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) length '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableStrictRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableStrictRange.yql
new file mode 100644
index 0000000000..b52191ad74
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTableStrictRange.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (Key '('table (MrTableRangeStrict '"" filter))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let length (Length tables))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) (Just (AsStruct '('value length))) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) length '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTwoTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTwoTables.yql
new file mode 100644
index 0000000000..6855885d32
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfTwoTables.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source '((Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let length (Length tables))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) (Just (AsStruct '('value length))) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) length '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfWeakConcatTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfWeakConcatTables.yql
new file mode 100644
index 0000000000..b103b4e66e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/LengthOfWeakConcatTables.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (MrTableConcat (Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let length (Length tables))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) (Just (AsStruct '('value length))) '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) length '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/ManyTableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ManyTableRange.yql
new file mode 100644
index 0000000000..f5612e30a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/ManyTableRange.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter1 (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input1")))))
+(let filter3 (lambda '(name) (And (>= name (String '"Input3")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source '(
+ (Key '('table (MrTableRange '"" filter1)))
+ (Key '('table (MrTableRange '"" filter3))))
+ (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapThreeTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapThreeTables.yql
new file mode 100644
index 0000000000..506868f4a8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapThreeTables.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let tresh (Int32 '100))
+(let result (FlatMap (Extend table1 (Extend table2 table3)) (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapTwoTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapTwoTables.yql
new file mode 100644
index 0000000000..aca48ae0c8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/MapTwoTables.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let tresh (Int32 '100))
+(let result (FlatMap (Extend table1 table2) (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/Skip.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/Skip.yql
new file mode 100644
index 0000000000..1995fa124f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/Skip.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let offset (Uint64 '5))
+(let result (Skip (Extend table1 table2) offset))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/SkipTakeThenMapTreeTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SkipTakeThenMapTreeTables.yql
new file mode 100644
index 0000000000..a4b1c5f1c6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SkipTakeThenMapTreeTables.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table3 (Right! x))
+(let e (Extend table1 (Extend table2 table3)))
+(let e (Skip e (Uint64 '5)))
+(let e (Take e (Uint64 '6)))
+(let table1map (Map e (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '"")))
+ (let s (AddMember s 'value value))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/SortTwoTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SortTwoTables.yql
new file mode 100644
index 0000000000..799d9cb488
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SortTwoTables.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let offset (Uint64 '5))
+(let result (Extend table1 table2))
+(let result (Sort result '((Bool 'true) (Bool 'true)) (lambda '(row) (block '(
+ (let res '((Member row 'key) (Member row 'subkey)))
+ (return res)
+)
+))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/SplitTableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SplitTableRange.yql
new file mode 100644
index 0000000000..8793b592e7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/SplitTableRange.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"maxinputtables" '"2"))
+(let x (Read! world mr_source (Key '('table (MrTableRange '"" (lambda '($i) (And (>= $i (String '"Input1")) (<= $i (String '"Input~")))) '""))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRange.yql
new file mode 100644
index 0000000000..5e16c9166d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRange.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (Key '('table (MrTableRange '"" filter))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRangeStrict.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRangeStrict.yql
new file mode 100644
index 0000000000..80647dd661
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/TableRangeStrict.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (Key '('table (MrTableRangeStrict '"" filter))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverStrictTableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverStrictTableRange.yql
new file mode 100644
index 0000000000..3cca68b2ab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverStrictTableRange.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter1 (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input1")))))
+(let filter3 (lambda '(name) (And (>= name (String '"Input3")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (MrTableConcat
+ (Key '('table (MrTableRangeStrict '"" filter1)))
+ (Key '('table (MrTableRangeStrict '"" filter3))))
+ (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverTableRange.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverTableRange.yql
new file mode 100644
index 0000000000..b43c3f66d4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatOverTableRange.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let filter1 (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input1")))))
+(let filter3 (lambda '(name) (And (>= name (String '"Input3")) (<= name (String '"Input3")))))
+(let x (Read! world mr_source (MrTableConcat
+ (Key '('table (MrTableRange '"" filter1)))
+ (Key '('table (MrTableRange '"" filter3))))
+ (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.cfg
new file mode 100644
index 0000000000..a87e460b09
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.cfg
@@ -0,0 +1,4 @@
+in Input1 non_ksv_input1.txt
+in Input2 non_ksv_input2.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.yql
new file mode 100644
index 0000000000..a9ac514a99
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTables.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (MrTableConcat (Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) (Void) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'name) (Member row 'name2)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '('('type))))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.cfg
new file mode 100644
index 0000000000..d7ef0e0048
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.cfg
@@ -0,0 +1,4 @@
+in Input1 non_ksv_input1_bad.txt
+in Input2 non_ksv_input2_bad.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.yql b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.yql
new file mode 100644
index 0000000000..da7c64aa5d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/WeakConcatTablesBadUnusedColumn.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (MrTableConcat (Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) '('name 'name2) '()))
+(let world (Left! x))
+(let tables (Right! x))
+(let tables (Sort tables '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'name) (Member row 'name2)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tables '()))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) tables '('('type))))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/default.cfg b/yql/essentials/tests/s-expressions/suites/ManyInputTables/default.cfg
new file mode 100644
index 0000000000..5cdd7ddbf6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/default.cfg
@@ -0,0 +1,5 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt
new file mode 100644
index 0000000000..f53757c309
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="1";"value"="ddd"};
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="150";"subkey"="1";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input1.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt
new file mode 100644
index 0000000000..07af3b4647
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="2";"value"="q"};
+{"key"="150";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt
new file mode 100644
index 0000000000..7a155c91b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/input3.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt
new file mode 100644
index 0000000000..dd7dace4b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt
@@ -0,0 +1,6 @@
+{"age"=30;"name"="bob"};
+{"age"=16;"name"="alice"};
+{"age"=55;"name"="jone"};
+{"age"=45;"name"="silver"};
+{"age"=45;"name"="smith"};
+{"age"=90;"name"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt.attr
new file mode 100644
index 0000000000..984ced0f70
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"Int64"]];["name";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt
new file mode 100644
index 0000000000..dd7dace4b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt
@@ -0,0 +1,6 @@
+{"age"=30;"name"="bob"};
+{"age"=16;"name"="alice"};
+{"age"=55;"name"="jone"};
+{"age"=45;"name"="silver"};
+{"age"=45;"name"="smith"};
+{"age"=90;"name"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt.attr
new file mode 100644
index 0000000000..1ceba168e8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input1_bad.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"Int32"]];["name";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt
new file mode 100644
index 0000000000..72d5cb8767
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt
@@ -0,0 +1,6 @@
+{"age"=30u;"name2"="bob"};
+{"age"=16u;"name2"="alice"};
+{"age"=55u;"name2"="jone"};
+{"age"=45u;"name2"="silver"};
+{"age"=45u;"name2"="smith"};
+{"age"=90u;"name2"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt.attr
new file mode 100644
index 0000000000..f6fe260020
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"Uint32"]];["name2";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt
new file mode 100644
index 0000000000..72d5cb8767
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt
@@ -0,0 +1,6 @@
+{"age"=30u;"name2"="bob"};
+{"age"=16u;"name2"="alice"};
+{"age"=55u;"name2"="jone"};
+{"age"=45u;"name2"="silver"};
+{"age"=45u;"name2"="smith"};
+{"age"=90u;"name2"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt.attr
new file mode 100644
index 0000000000..e74a1cdc27
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input2_bad.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["OptionalType";["DataType";"Uint32"]]];["name2";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt
new file mode 100644
index 0000000000..dfe71abfe7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt
@@ -0,0 +1,6 @@
+{"age"=30;"name2"="bob"};
+{"age"=16;"name2"="alice"};
+{"age"=55;"name2"="jone"};
+{"age"=45;"name2"="silver"};
+{"age"=45;"name2"="smith"};
+{"age"=90;"name2"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt.attr
new file mode 100644
index 0000000000..1c447d3475
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyInputTables/non_ksv_input3.txt.attr
@@ -0,0 +1,10 @@
+{
+ "schema" = <
+ "strict" = %false;
+ "unique_keys" = %false
+ >
+ [{
+ "name" = "missing";
+ "type" = "string"
+ }];
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.cfg b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.cfg
new file mode 100644
index 0000000000..ac8f608e62
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.cfg
@@ -0,0 +1,6 @@
+in hits Bug1465_hits.txt
+out out1 out1.txt
+out out2 out2.txt
+res result.txt
+udf url_udf
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.sql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.sql
new file mode 100644
index 0000000000..f8488fb2e1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.sql
@@ -0,0 +1,181 @@
+USE hahn;
+
+$minus_date = Python::minus_date(
+ @@(String?,String?)->Int64@@,
+ @@
+from datetime import datetime, timedelta
+def minus_date(date1, date2):
+ return (datetime.strptime(date1, "%Y-%m-%d") - datetime.strptime(date2, "%Y-%m-%d")).days
+ @@
+);
+
+$normalize_list = Python::normalize_list(
+ @@(List<Tuple<Int64,Int64?>>)->List<Tuple<Int64,Int64>>@@,
+ @@
+def normalize_list(values):
+ return sorted((x, y) for x, y in values if y)
+ @@
+);
+
+$urls = (
+FROM hits
+SELECT url AS Url, "2016-10-25" AS Date
+GROUP BY url
+);
+
+$flatten_factors = (
+FROM $urls AS target
+INNER JOIN hits AS history
+ON target.Url == history.url
+SELECT
+ target.Url AS Url,
+ target.Date AS Date,
+ history.*
+);
+
+INSERT INTO [Out1] WITH TRUNCATE FROM $flatten_factors SELECT *;
+COMMIT;
+
+$pool = (
+FROM [Out1]
+SELECT
+ Url,
+ Date,
+ Url::GetHost(Url) AS Host
+/* $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_all_total]))) AS metrika_all_total
+/* $normalize_list(LIST(($minus_date(Date, [history.date]), [history.yabro_mobile_unique]))) AS yabro_mobile_unique,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_counter_count]))) AS metrika_counter_count,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_yabro_desktop_total]))) AS metrika_yabro_desktop_total,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_yabro_desktop_unique]))) AS metrika_yabro_desktop_unique,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_all_unique]))) AS metrika_all_unique,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_yabro_mobile_unique]))) AS metrika_yabro_mobile_unique,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.yabro_desktop_total]))) AS yabro_desktop_total,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.yabro_desktop_unique]))) AS yabro_desktop_unique,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.yabro_mobile_total]))) AS yabro_mobile_total,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.metrika_yabro_mobile_total]))) AS metrika_yabro_mobile_total,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.cs_clicks]))) AS cs_clicks,
+ $normalize_list(LIST(($minus_date(Date, [history.date]), [history.cs_shows]))) AS cs_shows*/
+GROUP BY Url, Date
+);
+
+$hosts = (
+FROM $pool
+SELECT Host, "2016-10-25" AS Date
+GROUP BY Host
+);
+
+$host_features = (
+FROM $hosts AS hosts
+LEFT JOIN hits AS all_hits
+ON hosts.Host == Url::GetHost(all_hits.url)
+SELECT
+ hosts.Host AS Host,
+ hosts.Date AS Date,
+/* SUM(all_hits.metrika_all_total) AS metrika_all_total_sum7,
+/* MAX(all_hits.metrika_all_total) AS metrika_all_total_max7,
+-- STDDEV(all_hits.metrika_all_total) AS metrika_all_total_stddev7,
+ MEDIAN(all_hits.metrika_all_total) AS metrika_all_total_median7,
+ PERCENTILE(all_hits.metrika_all_total, 0.25) AS metrika_all_total_25perc7,
+ PERCENTILE(all_hits.metrika_all_total, 0.75) AS metrika_all_total_75perc7,
+ COUNT_IF(all_hits.metrika_all_total > 0) AS metrika_all_total_nonzero7,
+ SUM(all_hits.yabro_mobile_unique) AS yabro_mobile_unique_sum7,
+ MAX(all_hits.yabro_mobile_unique) AS yabro_mobile_unique_max7,
+-- STDDEV(all_hits.yabro_mobile_unique) AS yabro_mobile_unique_stddev7,
+ MEDIAN(all_hits.yabro_mobile_unique) AS yabro_mobile_unique_median7,
+ PERCENTILE(all_hits.yabro_mobile_unique, 0.25) AS yabro_mobile_unique_25perc7,
+ PERCENTILE(all_hits.yabro_mobile_unique, 0.75) AS yabro_mobile_unique_75perc7,
+ COUNT_IF(all_hits.yabro_mobile_unique > 0) AS yabro_mobile_unique_nonzero7,
+ SUM(all_hits.metrika_counter_count) AS metrika_counter_count_sum7,
+ MAX(all_hits.metrika_counter_count) AS metrika_counter_count_max7,
+-- STDDEV(all_hits.metrika_counter_count) AS metrika_counter_count_stddev7,
+ MEDIAN(all_hits.metrika_counter_count) AS metrika_counter_count_median7,
+ PERCENTILE(all_hits.metrika_counter_count, 0.25) AS metrika_counter_count_25perc7,
+ PERCENTILE(all_hits.metrika_counter_count, 0.75) AS metrika_counter_count_75perc7,
+ COUNT_IF(all_hits.metrika_counter_count > 0) AS metrika_counter_count_nonzero7,
+ SUM(all_hits.metrika_yabro_desktop_total) AS metrika_yabro_desktop_total_sum7,
+ MAX(all_hits.metrika_yabro_desktop_total) AS metrika_yabro_desktop_total_max7,
+-- STDDEV(all_hits.metrika_yabro_desktop_total) AS metrika_yabro_desktop_total_stddev7,
+ MEDIAN(all_hits.metrika_yabro_desktop_total) AS metrika_yabro_desktop_total_median7,
+ PERCENTILE(all_hits.metrika_yabro_desktop_total, 0.25) AS metrika_yabro_desktop_total_25perc7,
+ PERCENTILE(all_hits.metrika_yabro_desktop_total, 0.75) AS metrika_yabro_desktop_total_75perc7,
+ COUNT_IF(all_hits.metrika_yabro_desktop_total > 0) AS metrika_yabro_desktop_total_nonzero7,
+ SUM(all_hits.metrika_yabro_desktop_unique) AS metrika_yabro_desktop_unique_sum7,
+ MAX(all_hits.metrika_yabro_desktop_unique) AS metrika_yabro_desktop_unique_max7,
+-- STDDEV(all_hits.metrika_yabro_desktop_unique) AS metrika_yabro_desktop_unique_stddev7,
+ MEDIAN(all_hits.metrika_yabro_desktop_unique) AS metrika_yabro_desktop_unique_median7,
+ PERCENTILE(all_hits.metrika_yabro_desktop_unique, 0.25) AS metrika_yabro_desktop_unique_25perc7,
+ PERCENTILE(all_hits.metrika_yabro_desktop_unique, 0.75) AS metrika_yabro_desktop_unique_75perc7,
+ COUNT_IF(all_hits.metrika_yabro_desktop_unique > 0) AS metrika_yabro_desktop_unique_nonzero7,
+ SUM(all_hits.metrika_all_unique) AS metrika_all_unique_sum7,
+ MAX(all_hits.metrika_all_unique) AS metrika_all_unique_max7,
+-- STDDEV(all_hits.metrika_all_unique) AS metrika_all_unique_stddev7,
+ MEDIAN(all_hits.metrika_all_unique) AS metrika_all_unique_median7,
+ PERCENTILE(all_hits.metrika_all_unique, 0.25) AS metrika_all_unique_25perc7,
+ PERCENTILE(all_hits.metrika_all_unique, 0.75) AS metrika_all_unique_75perc7,
+ COUNT_IF(all_hits.metrika_all_unique > 0) AS metrika_all_unique_nonzero7,
+ SUM(all_hits.metrika_yabro_mobile_unique) AS metrika_yabro_mobile_unique_sum7,
+ MAX(all_hits.metrika_yabro_mobile_unique) AS metrika_yabro_mobile_unique_max7,
+-- STDDEV(all_hits.metrika_yabro_mobile_unique) AS metrika_yabro_mobile_unique_stddev7,
+ MEDIAN(all_hits.metrika_yabro_mobile_unique) AS metrika_yabro_mobile_unique_median7,
+ PERCENTILE(all_hits.metrika_yabro_mobile_unique, 0.25) AS metrika_yabro_mobile_unique_25perc7,
+ PERCENTILE(all_hits.metrika_yabro_mobile_unique, 0.75) AS metrika_yabro_mobile_unique_75perc7,
+ COUNT_IF(all_hits.metrika_yabro_mobile_unique > 0) AS metrika_yabro_mobile_unique_nonzero7,
+ SUM(all_hits.yabro_desktop_total) AS yabro_desktop_total_sum7,
+ MAX(all_hits.yabro_desktop_total) AS yabro_desktop_total_max7,
+-- STDDEV(all_hits.yabro_desktop_total) AS yabro_desktop_total_stddev7,
+ MEDIAN(all_hits.yabro_desktop_total) AS yabro_desktop_total_median7,
+ PERCENTILE(all_hits.yabro_desktop_total, 0.25) AS yabro_desktop_total_25perc7,
+ PERCENTILE(all_hits.yabro_desktop_total, 0.75) AS yabro_desktop_total_75perc7,
+ COUNT_IF(all_hits.yabro_desktop_total > 0) AS yabro_desktop_total_nonzero7,
+ SUM(all_hits.yabro_desktop_unique) AS yabro_desktop_unique_sum7,
+ MAX(all_hits.yabro_desktop_unique) AS yabro_desktop_unique_max7,
+-- STDDEV(all_hits.yabro_desktop_unique) AS yabro_desktop_unique_stddev7,
+ MEDIAN(all_hits.yabro_desktop_unique) AS yabro_desktop_unique_median7,
+ PERCENTILE(all_hits.yabro_desktop_unique, 0.25) AS yabro_desktop_unique_25perc7,
+ PERCENTILE(all_hits.yabro_desktop_unique, 0.75) AS yabro_desktop_unique_75perc7,
+ COUNT_IF(all_hits.yabro_desktop_unique > 0) AS yabro_desktop_unique_nonzero7,
+ SUM(all_hits.yabro_mobile_total) AS yabro_mobile_total_sum7,
+ MAX(all_hits.yabro_mobile_total) AS yabro_mobile_total_max7,
+-- STDDEV(all_hits.yabro_mobile_total) AS yabro_mobile_total_stddev7,
+ MEDIAN(all_hits.yabro_mobile_total) AS yabro_mobile_total_median7,
+ PERCENTILE(all_hits.yabro_mobile_total, 0.25) AS yabro_mobile_total_25perc7,
+ PERCENTILE(all_hits.yabro_mobile_total, 0.75) AS yabro_mobile_total_75perc7,
+ COUNT_IF(all_hits.yabro_mobile_total > 0) AS yabro_mobile_total_nonzero7,
+ SUM(all_hits.metrika_yabro_mobile_total) AS metrika_yabro_mobile_total_sum7,
+ MAX(all_hits.metrika_yabro_mobile_total) AS metrika_yabro_mobile_total_max7,
+-- STDDEV(all_hits.metrika_yabro_mobile_total) AS metrika_yabro_mobile_total_stddev7,
+ MEDIAN(all_hits.metrika_yabro_mobile_total) AS metrika_yabro_mobile_total_median7,
+ PERCENTILE(all_hits.metrika_yabro_mobile_total, 0.25) AS metrika_yabro_mobile_total_25perc7,
+ PERCENTILE(all_hits.metrika_yabro_mobile_total, 0.75) AS metrika_yabro_mobile_total_75perc7,
+ COUNT_IF(all_hits.metrika_yabro_mobile_total > 0) AS metrika_yabro_mobile_total_nonzero7,*/
+ COUNT(*) AS url_day_count,
+ COUNT(DISTINCT(all_hits.url)) AS url_count
+GROUP BY hosts.Host, hosts.Date
+);
+
+INSERT INTO [Out2] WITH TRUNCATE
+FROM $pool AS pool
+LEFT JOIN $host_features AS host
+ON Url::GetHost(pool.Url) == host.Host AND pool.Date == host.Date
+SELECT *;
+/* pool.Date AS Date,
+ pool.yabro_mobile_unique AS yabro_mobile_unique,
+ pool.Url AS Url,
+ pool.cs_clicks AS cs_clicks,
+ pool.cs_shows AS cs_shows,
+ pool.metrika_all_total AS metrika_all_total,
+ pool.metrika_all_unique AS metrika_all_unique,
+ pool.Host AS Host,
+ pool.metrika_yabro_desktop_total AS metrika_yabro_desktop_total,
+ pool.metrika_yabro_desktop_unique AS metrika_yabro_desktop_unique,
+ pool.metrika_yabro_mobile_total AS metrika_yabro_mobile_total,
+ pool.metrika_yabro_mobile_unique AS metrika_yabro_mobile_unique,
+ pool.yabro_desktop_total AS yabro_desktop_total,
+ pool.yabro_desktop_unique AS yabro_desktop_unique,
+ pool.yabro_mobile_total AS yabro_mobile_total,
+ pool.metrika_counter_count AS metrika_counter_count,
+ host.*;*/
+
+COMMIT;
+DROP TABLE [Out1];
+
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.yql
new file mode 100644
index 0000000000..eaa0d95edb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465.yql
@@ -0,0 +1,192 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"hits"))) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (block '(
+ (return (Aggregate core '('"url") '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"Url" (Member row '"url")))
+ (let res (AddMember res '"Date" (String '"2016-10-25")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"target") '(table0 '"history") '('Inner '"target" '"history" '('"target" '"Url") '('"history" '"url") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (SelectMembers row '('"history.")))
+ (let res (AddMember res '"Url" (Member row '"target.Url")))
+ (let res (AddMember res '"Date" (Member row '"target.Date")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"out1"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let hahn_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world hahn_sink))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"out1"))) '('"Url" '"Date") '()))
+ (let world (Left! x))
+ (let table3 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"hits"))) '('"url") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (Map (EquiJoin '((Map (block '(
+ (let select (block '(
+ (let core table3)
+ (let core (block '(
+ (return (Aggregate core '('"Date" '"Url") '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"Url" (Member row '"Url")))
+ (let res (AddMember res '"Date" (Member row '"Date")))
+ (let res (AddMember res '"Host" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) (lambda '(row) (block '(
+ (let row (AddMember row '"_equijoin_column_0" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
+ (return row)
+ )))) '"pool") '((block '(
+ (let select (block '(
+ (let core (Map (EquiJoin '((block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table3)
+ (let core (block '(
+ (return (Aggregate core '('"Date" '"Url") '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"Url" (Member row '"Url")))
+ (let res (AddMember res '"Date" (Member row '"Date")))
+ (let res (AddMember res '"Host" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (return (Aggregate core '('"Host") '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"Host" (Member row '"Host")))
+ (let res (AddMember res '"Date" (String '"2016-10-25")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"hosts") '((Map table0 (lambda '(row) (block '(
+ (let row (AddMember row '"_equijoin_column_0" ("Apply" ("Udf" '"Url.GetHost") (Member row '"url"))))
+ (return row)
+ )))) '"all_hits") '('Left '"hosts" '"all_hits" '('"hosts" '"Host") '('"all_hits" '"_equijoin_column_0") '()) '()) (lambda '(row) (block '(
+ (let row (ForceRemoveMember row '"all_hits._equijoin_column_0"))
+ (return row)
+ )))))
+ (let core (block '(
+ (let Count4_create (lambda '(row) (Uint64 '1)))
+ (let Count4_update (lambda '(row state) (OptionalReduce state (Uint64 '1) (lambda '(a b) (+ a b)))))
+ (let Count4_save (lambda '(state) state))
+ (let Count4_load (lambda '(item) item))
+ (let Count4_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count4_finish (lambda '(state) state))
+ (let Count5_create (lambda '(row) (Convert (Exists row) 'Uint64)))
+ (let Count5_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
+ (let Count5_save (lambda '(state) state))
+ (let Count5_load (lambda '(item) item))
+ (let Count5_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count5_finish (lambda '(state) state))
+ (return (Aggregate core '('"hosts.Date" '"hosts.Host") '('('Count4 (AggregationTraits (ListItemType (TypeOf core)) Count4_create Count4_update Count4_save Count4_load Count4_merge Count4_finish (Uint64 '0))) '('Count5 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"all_hits.url") Count5_create Count5_update Count5_save Count5_load Count5_merge Count5_finish (Uint64 '0)) '"all_hits.url"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"Host" (Member row '"hosts.Host")))
+ (let res (AddMember res '"Date" (Member row '"hosts.Date")))
+ (let res (AddMember res '"url_day_count" (Member row 'Count4)))
+ (let res (AddMember res '"url_count" (Member row 'Count5)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"host") '('Left '"pool" '"host" '('"pool" '"_equijoin_column_0" '"pool" '"Date") '('"host" '"Host" '"host" '"Date") '()) '()) (lambda '(row) (block '(
+ (let row (ForceRemoveMember row '"pool._equijoin_column_0"))
+ (return row)
+ )))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"out2"))) values '('('mode 'renew))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let hahn_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world hahn_sink))
+ (return world)
+)))
+(let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"out1"))) (Void) '('('mode 'drop))))
+ (return world)
+)))
+(let world (block '(
+ (let hahn_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world hahn_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt
new file mode 100644
index 0000000000..d122076744
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt
@@ -0,0 +1 @@
+{"history.date"="20016-01-01";"url"="http://ya.ru"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt.attr
new file mode 100644
index 0000000000..56aac6ba29
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1465_hits.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["url";["OptionalType";["DataType";"String"]]];["history.date";["OptionalType";["DataType";"String"]]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.sql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.sql
new file mode 100644
index 0000000000..c5ed4796d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT sum(count) from (
+select count(*) as count from Input WHERE key < "100"
+);
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.yql
new file mode 100644
index 0000000000..a8908a0100
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/Bug1941.yql
@@ -0,0 +1,47 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (Filter core (lambda '(row) (Coalesce ("<" (Member row '"key") (String '"100")) (Bool 'false)))))
+ (let core (Just (AsStruct '('Count0 (Length core)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"count" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (Aggregate core '() '('('Sum2 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"count")))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" (Member row 'Sum2))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenGroup.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenGroup.yql
new file mode 100644
index 0000000000..5a39b90887
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenGroup.yql
@@ -0,0 +1,39 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+
+ (let preMap (lambda '(item) (Just item)))
+ (let keyExtractor (lambda '(item) (Member item 'key)))
+ (let init (lambda '(key item) (Member item 'value)))
+ (let update (lambda '(key item state) (Concat state (Member item 'value))))
+ (let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value state))
+ (return (Just s))
+ ))))
+ (let combine (CombineByKey table0 preMap keyExtractor init update finish))
+
+ (let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let value (Fold1 list
+ (lambda '(item) (Member item 'value))
+ (lambda '(item state) (Concat state (Member item 'value)))
+ ))
+ (let s (AddMember s 'value (Coalesce value (String '""))))
+ (let ret (AsList s))
+ (return ret)
+ ))))))
+ (let reducedTable (PartitionByKey combine keyExtractor (Void) (Void) listHandler))
+ (let mr_sink (DataSink 'yt (quote plato)))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenSort.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenSort.yql
new file mode 100644
index 0000000000..c9f35934d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/CombineThenSort.yql
@@ -0,0 +1,30 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+
+ (let map (FlatMap table0 (lambda '(row) (block '(
+ (let key (MatchType (Member row '"key") 'Optional (lambda '(item) (Coalesce (Map item (lambda '(val) (IfType val (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Just (Convert item '"Int64")))))) (Nothing (OptionalType (DataType '"Int64"))))) (lambda '(item) (IfType item (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Convert item '"Int64"))))))
+ (let res (Struct))
+ (let res (AddMember res '"Avg1" '(key (Convert (Exists key) 'Uint64))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let combine (CombineByKey map (lambda '(row) (Just row)) (lambda '(row) (Uint64 '0)) (lambda '(key row) row) (lambda '(key row state) state) (lambda '(key state) (Just state))))
+ (let result (FlatMap combine (lambda '(row) (block '(
+ (let p0 (Nth (Member row 'Avg1) '0))
+ (let p1 (Nth (Member row 'Avg1) '1))
+ (let res (Struct))
+ (let res (AddMember res '"keyAvg" (
+ FlatMap p0 (lambda '(value) (Just (Coalesce (Div (Convert value 'Double) (Convert p1 'Double)) (Double '0))))
+ )))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let sortAfterCombine (Sort result (Bool 'false) (lambda '(x) (Member x 'keyAvg) )))
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) sortAfterCombine '('('type) '('autoref))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapCombineMap.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapCombineMap.yql
new file mode 100644
index 0000000000..fd5d2eb0e7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapCombineMap.yql
@@ -0,0 +1,29 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"subkey" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+
+ (let map (FlatMap table0 (lambda '(row) (block '(
+ (let key (MatchType (Member row '"key") 'Optional (lambda '(item) (Coalesce (Map item (lambda '(val) (IfType val (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Just (Convert item '"Int64")))))) (Nothing (OptionalType (DataType '"Int64"))))) (lambda '(item) (IfType item (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Convert item '"Int64"))))))
+ (let res (Struct))
+ (let res (AddMember res '"Avg1" '(key (Convert (Exists key) 'Uint64))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let combine (CombineByKey map (lambda '(row) (Just row)) (lambda '(row) (Uint64 '0)) (lambda '(key row) row) (lambda '(key row state) state) (lambda '(key state) (Just state))))
+ (let result (FlatMap combine (lambda '(row) (block '(
+ (let p0 (Nth (Member row 'Avg1) '0))
+ (let p1 (Nth (Member row 'Avg1) '1))
+ (let res (Struct))
+ (let res (AddMember res '"keyAvg" (
+ FlatMap p0 (lambda '(value) (Just (Coalesce (Div (Convert value 'Double) (Convert p1 'Double)) (Double '0))))
+ )))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) result '('('type) '('autoref))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenExtend.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenExtend.yql
new file mode 100644
index 0000000000..d8c639d055
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenExtend.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '1)))
+ (let s (AddMember s 'value (String 'v)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) (Extend table1map table1map) '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenGroup.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenGroup.yql
new file mode 100644
index 0000000000..6248b7416e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenGroup.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (let s (ListIf (< item2 tresh) item))
+ (return s)
+ )))))
+ (return ret)
+)))))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1low keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenSort.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenSort.yql
new file mode 100644
index 0000000000..fd736cacf2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapThenSort.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (let s (ListIf (< item2 tresh) item))
+ (return s)
+ )))))
+ (return ret)
+)))))
+(let table1sorted (Sort table1low (Bool 'true) (lambda '(item) (Member item 'key))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1sorted '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapWithReadTable.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapWithReadTable.yql
new file mode 100644
index 0000000000..c276a9e835
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/MapWithReadTable.yql
@@ -0,0 +1,53 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("Concat" (Member row '"key") ("Coalesce" (Member (MatchType (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (block '(
+ (let Min0_create (lambda '(row) (Member row '"key")))
+ (let Min0_update (lambda '(row state) (OptionalReduce state (Member row '"key") (lambda '(a b) (Min a b)))))
+ (let Min0_save (lambda '(state) state))
+ (let Min0_load (lambda '(item) item))
+ (let Min0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (Min a b)))))
+ (let Min0_finish (lambda '(state) state))
+ (return (Aggregate core '() '('('Min0 (AggregationTraits (ListItemType (TypeOf core)) Min0_create Min0_update Min0_save Min0_load Min0_merge Min0_finish (Null))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row 'Min0)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) 'Dict (lambda '(dict) (Lookup dict (Int64 '"0"))) (lambda '(list) (Lookup (ToIndexDict list) (Int64 '"0")))) '"key") (String '"")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenMap.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenMap.yql
new file mode 100644
index 0000000000..df91ac7aab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenMap.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let filterAfterReduce (Filter reducedTable (lambda '(x) (block '(
+ (return (> (Member x 'value) (String '1)))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) filterAfterReduce '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenSort.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenSort.yql
new file mode 100644
index 0000000000..420d463be3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/ReduceThenSort.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (ToString (Length list)) key)))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let sortAfterReduce (Sort reducedTable (Bool 'false) (lambda '(x) (Member x 'value) )))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) sortAfterReduce '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/TakeThenMap.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/TakeThenMap.yql
new file mode 100644
index 0000000000..f1dfaf4ca4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/TakeThenMap.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap (Take table1 (Uint64 '3)) (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (let s (ListIf (< item2 tresh) item))
+ (return s)
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_1.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_1.yql
new file mode 100644
index 0000000000..5e6aec09e8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_1.yql
@@ -0,0 +1,85 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (String '"")))
+ (let res (AddMember res '"value" ("Concat" (String '"value:") (Member row '"value"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Take select (Int32 '"2")))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (String '"")))
+ (let res (AddMember res '"value" ("Concat" (String '"value:") (Member row '"value"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_2.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_2.yql
new file mode 100644
index 0000000000..6c2634f9ad
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/YQL-1733_2.yql
@@ -0,0 +1,86 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (String '"")))
+ (let res (AddMember res '"value" ("Concat" (String '"value:") (Member row '"value"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Take select (Int32 '"2")))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"subkey" (String '"")))
+ (let res (AddMember res '"value" ("Concat" (String '"value:") (Member row '"value"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Take select (Int32 '"3")))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/default.cfg b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt
new file mode 100644
index 0000000000..d77d384ae6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt
@@ -0,0 +1,5 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="075";"subkey"="2";"value"="qqqw"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="020";"subkey"="4";"value"="q"};
+{"key"="150";"subkey"="5";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrOperations/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/default.cfg b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/default.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt.attr b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.cfg b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.cfg
new file mode 100644
index 0000000000..5baea08e78
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+out Output2 output2.txt
diff --git a/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.yql b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.yql
new file mode 100644
index 0000000000..8ebe956e7c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/ManyYamrTransactions/program1.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(let x (Read! world mr_source (Key '('table (String 'Output))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) table2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiIn.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiIn.yql
new file mode 100644
index 0000000000..261a85c931
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiIn.yql
@@ -0,0 +1,42 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let data2 (Right! x))
+
+(let data (Mux '(data1 data2)))
+
+(let data (LMap data (lambda '(stream) (block '(
+ (return (FlatMap stream (lambda '(item) (block '(
+ (let res (Visit item
+ '0 (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '0)))
+ (let s (AddMember s 'value (Member item 'value)))
+ (return s)
+ )))
+ '1 (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '1)))
+ (let s (AddMember s 'value (Member item 'value)))
+ (return s)
+ )))
+ ))
+ (return (Just res))
+ )))))
+)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiOut.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiOut.yql
new file mode 100644
index 0000000000..aeefafd75f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/LMapWithMultiOut.yql
@@ -0,0 +1,43 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let data (LMap data (lambda '(stream) (block '(
+ (return (FlatMap stream (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return (Just res))
+ )))))
+)))))
+
+(let dataTuple (Demux data))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) (Nth dataTuple '0) '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) (Nth dataTuple '1) '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/MapOverDemux.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/MapOverDemux.yql
new file mode 100644
index 0000000000..4697cb40ba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/MapOverDemux.yql
@@ -0,0 +1,45 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux data))
+
+(let data1 (Nth dataTuple '0))
+(let data2 (Nth dataTuple '1))
+
+(let data1 (Filter data1 (lambda '(item) (Less (Member item 'key) (String '200)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data1 '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) data2 '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMap.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMap.yql
new file mode 100644
index 0000000000..bbceddd5da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMap.yql
@@ -0,0 +1,35 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let data1 (Filter data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false)))
+ (return res)
+)))))
+
+(let data2 (Filter data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '1)) (Bool 'false)))
+ (return res)
+)))))
+
+(let data (Mux '(data1 data2)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let res (Visit item
+ '0 (lambda '(x) x)
+ '1 (lambda '(x) x)
+ ))
+ (return res)
+)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMixed.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMixed.yql
new file mode 100644
index 0000000000..77f51cfd2b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverMixed.yql
@@ -0,0 +1,35 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let data1 (Filter data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false)))
+ (return res)
+)))))
+
+(let data2 (AsList
+ (AsStruct '('key (String 'k1)) '('subkey (String 's1)) '('value (String 'v1)))
+ (AsStruct '('key (String 'k2)) '('subkey (String 's2)) '('value (String 'v2)))
+ (AsStruct '('key (String 'k3)) '('subkey (String 's3)) '('value (String 'v3)))
+))
+
+(let data (Mux '(data1 data2)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let res (Visit item
+ '0 (lambda '(x) x)
+ '1 (lambda '(x) x)
+ ))
+ (return res)
+)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverRead.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverRead.yql
new file mode 100644
index 0000000000..08c7c997bc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/MuxOverRead.yql
@@ -0,0 +1,27 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data1 (Right! x))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let data2 (Right! x))
+
+(let data (Mux '(data1 data2)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let res (Visit item
+ '0 (lambda '(x) x)
+ '1 (lambda '(x) x)
+ ))
+ (return res)
+)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/OrderedPartitionByKeyWithMultiOut.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/OrderedPartitionByKeyWithMultiOut.yql
new file mode 100644
index 0000000000..56ef61571a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/OrderedPartitionByKeyWithMultiOut.yql
@@ -0,0 +1,56 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(group) (block '(
+ (let key (Nth group '0))
+ (let stream (Nth group '1))
+
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length (ForwardList stream)))))
+
+ (let intValue (FromString key 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant s '0 varTuple)
+ (Variant s '1 varTuple)
+ )
+ )
+ (return res)
+ )))))
+))))
+(let data (PartitionByKey data keySelector (Void) (Void) listHandler))
+
+(let dataTuple (Demux data))
+
+(let data1 (Nth dataTuple '0))
+(let data2 (Nth dataTuple '1))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data1 '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) data2 '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/PartitionByKeyWithMultiOut.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/PartitionByKeyWithMultiOut.yql
new file mode 100644
index 0000000000..bcb27c7be3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/PartitionByKeyWithMultiOut.yql
@@ -0,0 +1,56 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input2))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(group) (block '(
+ (let key (Nth group '0))
+ (let stream (Nth group '1))
+
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length (ForwardList stream)))))
+
+ (let intValue (FromString key 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant s '0 varTuple)
+ (Variant s '1 varTuple)
+ )
+ )
+ (return res)
+ )))))
+))))
+(let data (PartitionByKey data keySelector (Void) (Void) listHandler))
+
+(let dataTuple (Demux data))
+
+(let data1 (Nth dataTuple '0))
+(let data2 (Nth dataTuple '1))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) data1 '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) data2 '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts1.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts1.yql
new file mode 100644
index 0000000000..30fefdd2f4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts1.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux data))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) (Nth dataTuple '1) '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts2.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts2.yql
new file mode 100644
index 0000000000..5d0c493a3d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts2.yql
@@ -0,0 +1,39 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let structType (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+))
+
+(let varTuple (VariantType (TupleType structType structType structType)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let mod (Coalesce (% intValue (Int32 '3)) (Int32 '0)))
+ (let res
+ (If (Equal mod (Int32 '0))
+ (Variant item '0 varTuple)
+ (If (Equal mod (Int32 '1))
+ (Variant item '1 varTuple)
+ (Variant item '2 varTuple)
+ )
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux data))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) (Nth dataTuple '0) '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) (Nth dataTuple '2) '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts3.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts3.yql
new file mode 100644
index 0000000000..683fca64b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/SuppressOuts3.yql
@@ -0,0 +1,43 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let structType (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+))
+
+(let varTuple (VariantType (TupleType structType structType structType)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '3)) (Int32 '0)) (Bool 'false))
+ (Variant item '2 varTuple)
+ res
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux data))
+
+(let res (UnionAll (Nth dataTuple '0) (Nth dataTuple '1)))
+
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) res '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/WriteOverDemux.yql b/yql/essentials/tests/s-expressions/suites/MultiIO/WriteOverDemux.yql
new file mode 100644
index 0000000000..ddf986949c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/WriteOverDemux.yql
@@ -0,0 +1,40 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input1))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let data (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux data))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output1))) (Nth dataTuple '0) '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) (Nth dataTuple '1) '('('mode 'renew))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/default.cfg b/yql/essentials/tests/s-expressions/suites/MultiIO/default.cfg
new file mode 100644
index 0000000000..d01d69e755
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/default.cfg
@@ -0,0 +1,5 @@
+in Input1 input1.txt
+in Input2 input2.txt
+out Output1 output1.txt
+out Output2 output2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt b/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/input1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt b/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt
new file mode 100644
index 0000000000..07af3b4647
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="2";"value"="q"};
+{"key"="150";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/MultiIO/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.cfg
new file mode 100644
index 0000000000..27b6ab6bec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.cfg
@@ -0,0 +1,3 @@
+in Input1 inputUnion1.txt
+in Input2 inputUnion2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.yql
new file mode 100644
index 0000000000..f3d4e5db52
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AggregateAfterUnion.yql
@@ -0,0 +1,26 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input1"))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input2"))) (Void) '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let u (UnionAll table1 table2))
+ (let output (Aggregate u '() '('('Min0 (Apply (bind aggregate_module '"min_traits_factory") (TypeOf u) (lambda '(row) (Member row '"age")))))))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.yql
new file mode 100644
index 0000000000..0886d5c7a9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidDuplicationOfJoinsBeforeAggr.yql
@@ -0,0 +1,111 @@
+#USE plato;
+#
+#$sample = (SELECT a.key as key, a.value as value FROM Input as a Join Input as b ON a.key = b.key);
+#
+#select key, count(*) from $sample group by key;
+#select value, count(*) from $sample group by value;
+
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table0 '"a") '(table0 '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"a.key")))
+ (let res (AddMember res '"value" (Member row '"a.value")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (let Count2_create (lambda '(row) (Uint64 '1)))
+ (let Count2_update (lambda '(row state) (OptionalReduce state (Uint64 '1) (lambda '(a b) (+ a b)))))
+ (let Count2_save (lambda '(state) state))
+ (let Count2_load (lambda '(item) item))
+ (let Count2_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count2_finish (lambda '(state) state))
+ (return (Aggregate core '('"key") '('('Count2 (AggregationTraits (ListItemType (TypeOf core)) Count2_create Count2_update Count2_save Count2_load Count2_merge Count2_finish (Uint64 '0))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AddMember res '"column1" (Member row 'Count2)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let core (Sort core (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key" '"value") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table0 '"a") '(table0 '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"a.key")))
+ (let res (AddMember res '"value" (Member row '"a.value")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (let Count4_create (lambda '(row) (Uint64 '1)))
+ (let Count4_update (lambda '(row state) (OptionalReduce state (Uint64 '1) (lambda '(a b) (+ a b)))))
+ (let Count4_save (lambda '(state) state))
+ (let Count4_load (lambda '(item) item))
+ (let Count4_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count4_finish (lambda '(state) state))
+ (return (Aggregate core '('"value") '('('Count4 (AggregationTraits (ListItemType (TypeOf core)) Count4_create Count4_update Count4_save Count4_load Count4_merge Count4_finish (Uint64 '0))))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"value" (Member row '"value")))
+ (let res (AddMember res '"column1" (Member row 'Count4)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (let core (Sort core (Bool 'true) (lambda '(row) (Member row '"value"))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"value" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.yql
new file mode 100644
index 0000000000..9918cc7770
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/AvoidFuseOfSameJoins.yql
@@ -0,0 +1,87 @@
+#USE plato;
+#
+#$sample = (SELECT a.key as key, a.value as value FROM Input as a Join Input as b ON a.key = b.key);
+#
+#select * from $sample as x left join Input as y using (key);
+#select * from $sample as x right join Input as y using (value);
+
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core (EquiJoin '(table0 '"a") '(table0 '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"a.key")))
+ (let res (AddMember res '"value" (Member row '"a.value")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"x") '(table0 '"y") '('Left '"x" '"y" '('"x" '"key") '('"y" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select '((Bool 'true) (Bool 'true) (Bool 'true)) (lambda '(row) '((Member row '"x.key") (Member row '"x.value") (Member row '"y.key")))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core (EquiJoin '(table0 '"a") '(table0 '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"a.key")))
+ (let res (AddMember res '"value" (Member row '"a.value")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"x") '(table0 '"y") '('Right '"x" '"y" '('"x" '"value") '('"y" '"value") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select '((Bool 'true) (Bool 'true) (Bool 'true)) (lambda '(row) '((Member row '"x.key") (Member row '"x.value") (Member row '"y.key")))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/BinaryDataLiterals.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/BinaryDataLiterals.yql
new file mode 100644
index 0000000000..fe707cfe07
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/BinaryDataLiterals.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let data (Bool 'x"00"))
+(let world (Write! world res_sink (Key) data '()))
+
+(let data (Int16 'x"FEFF"))
+(let world (Write! world res_sink (Key) data '()))
+
+(let data (Double 'x"722078DC7BF042D3"))
+(let world (Write! world res_sink (Key) data '()))
+
+(let data (Date 'x"0100"))
+(let world (Write! world res_sink (Key) data '()))
+
+(let data (TzTimestamp 'x"0000F9BCF768AC000001"))
+(let world (Write! world res_sink (Key) data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.cfg
new file mode 100644
index 0000000000..de97bde764
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.cfg
@@ -0,0 +1,4 @@
+in Input input4.txt
+out Output output.txt
+res result.txt
+
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.yql
new file mode 100644
index 0000000000..7c3615fa7f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ChopperUseOnlyKeyInHandler.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let keySwitch (lambda '(key item) (IsKeySwitch key item (lambda '(k) k) keySelector)))
+(let listHandler (lambda '(key stream) (ToStream (Just (AsStruct '('KEY key))))))
+(let reducedTable (Chopper (ToStream table1) keySelector keySwitch listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CloneStructure.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CloneStructure.yql
new file mode 100644
index 0000000000..e2e95e299b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CloneStructure.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table2 (Map table1 (lambda '(x) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'value (Member x 'value)))
+ (let s (AddMember s 'subkey (Member x 'subkey)))
+ (let s (AddMember s 'key (Member x 'key)))
+ (return s)
+)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverJust.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverJust.yql
new file mode 100644
index 0000000000..5d034dfec2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverJust.yql
@@ -0,0 +1,12 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Coalesce (Just (Int32 '1)) (Int32 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Just (Int32 '1)) (Just (Int32 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverNothing.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverNothing.yql
new file mode 100644
index 0000000000..efbc67ef1b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceOverNothing.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Int32))) (Int32 '2)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Int32))) (Just (Int32 '2))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Coalesce (Nothing (OptionalType (DataType 'Int32))) (Just (Int32 '2)) (Int32 '3)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverAnd.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverAnd.yql
new file mode 100644
index 0000000000..1d290a7ef7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverAnd.yql
@@ -0,0 +1,12 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let optBool1 (== (Int32 '0) (/ (Int32 '1) (Int32 '2))))
+(let optBool2 (== (Int32 '0) (/ (Int32 '4) (Int32 '5))))
+(let data (Coalesce (And optBool1 optBool2) (Bool 'false)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverNot.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverNot.yql
new file mode 100644
index 0000000000..1d48368834
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverNot.yql
@@ -0,0 +1,11 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let optBool (SafeCast (/ (Int32 '1) (Int32 '0)) (OptionalType (DataType 'Bool))))
+(let data (Coalesce (Not optBool) (Bool 'false)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverOr.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverOr.yql
new file mode 100644
index 0000000000..9e382837fc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CoalesceWithBoolOverOr.yql
@@ -0,0 +1,12 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let optBool1 (== (Int32 '0) (/ (Int32 '3) (Int32 '2))))
+(let optBool2 (== (Int32 '0) (/ (Int32 '4) (Int32 '5))))
+(let data (Coalesce (Or optBool1 optBool2) (Bool 'false)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemStruct.yql
new file mode 100644
index 0000000000..ef949a7afb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemStruct.yql
@@ -0,0 +1,25 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Condense1 list
+ (lambda '(item)
+ (AddMember
+ (Struct)
+ 'z
+ item))
+ (lambda '(item state) (Bool 'false))
+ (lambda '(item state)
+ (AddMember
+ (Struct)
+ 'z
+ (Concat (Member state 'z) item)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemTuple.yql
new file mode 100644
index 0000000000..1044367186
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Condense1OneItemTuple.yql
@@ -0,0 +1,20 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Condense1 list
+ (lambda '(item)
+ '(item))
+ (lambda '(item state) (Bool 'false))
+ (lambda '(item state) (block '(
+ (let x (Concat (Nth state '0) item))
+ (return '(x)))))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemStruct.yql
new file mode 100644
index 0000000000..1d24deecd5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemStruct.yql
@@ -0,0 +1,20 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Condense list (AddMember (Struct) 'z (String '""))
+ (lambda '(item state) (Bool 'false))
+ (lambda '(item state)
+ (AddMember
+ (Struct)
+ 'z
+ (Concat (Member state 'z) item)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemTuple.yql
new file mode 100644
index 0000000000..d638ca1fef
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CondenseOneItemTuple.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let s (String '""))
+(let data (Condense list '(s)
+ (lambda '(item state) (Bool 'false))
+ (lambda '(item state) (block '(
+ (let state (Concat (Nth state '0) item))
+ (return '(state)))))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense.yql
new file mode 100644
index 0000000000..ca92c5573e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let map (Map list1 (lambda '(x) (Uint32 '2))))
+(let data (Condense map (Uint32 '1) (lambda '(item state) (Bool 'false)) (lambda '(item state) (* item state))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense1.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense1.yql
new file mode 100644
index 0000000000..5d213f0f5a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenCondense1.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let map (Map list1 (lambda '(x) (Uint32 '2))))
+(let data (Condense1 map (lambda '(item) item) (lambda '(item state) (Bool 'false)) (lambda '(item state) (* item state))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold.yql
new file mode 100644
index 0000000000..06d8d1ee2e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let map (Map list1 (lambda '(x) (Uint32 '1))))
+(let data (Fold map (Uint32 '0) (lambda '(item state) (+ item state))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold1.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold1.yql
new file mode 100644
index 0000000000..dbb25f37ee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ConstMapThenFold1.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let map (Map list1 (lambda '(x) (Uint32 '1))))
+(let data (Fold1 map (lambda '(item) item) (lambda '(item state) (+ item state))))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ConsumeOrMoveForwardList.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ConsumeOrMoveForwardList.yql
new file mode 100644
index 0000000000..37b6fe207e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ConsumeOrMoveForwardList.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (ForwardList (Iterator list (DependsOn (Int32 '0)))) '('('type))))
+(let world (Write! world res_sink (Key) (ForwardList (Apply id (Iterator list (DependsOn (Int32 '1))))) '('('type))))
+(let world (Write! world res_sink (Key) (Fold (ForwardList (Apply id (Iterator list (DependsOn (Int32 '2))))) (String '"")
+ (lambda '(item state) (Concat item state))) '('('type))))
+(let world (Write! world res_sink (Key) (Fold1 (ForwardList (Apply id (Iterator list (DependsOn (Int32 '3)))))
+ (lambda '(item) item)
+ (lambda '(item state) (Concat item state))) '('('type))))
+(let world (Write! world res_sink (Key) (FlatMap (ForwardList (Apply id (Iterator list (DependsOn (Int32 '4)))))
+ (lambda '(item) (AsList item item))) '('('type))))
+(let world (Write! world res_sink (Key) (FoldMap (ForwardList (Apply id (Iterator list (DependsOn (Int32 '5))))) (String '"")
+ (lambda '(item state) '((Concat item state) (Concat item state)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (Fold1Map (ForwardList (Apply id (Iterator list (DependsOn (Int32 '6)))))
+ (lambda '(item) '(item item))
+ (lambda '(item state) '((Concat item state) (Concat item state)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.cfg
new file mode 100644
index 0000000000..96364ca2c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.cfg
@@ -0,0 +1,3 @@
+in Input inputDistinctKey.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.yql
new file mode 100644
index 0000000000..6d0405e562
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinct.yql
@@ -0,0 +1,41 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (block '(
+ (let Count0_create (lambda '(row) (AggrCountInit row)))
+ (let Count0_update (lambda '(row state) (AggrCountUpdate row state)))
+ (let Count0_save (lambda '(state) state))
+ (let Count0_load (lambda '(item) item))
+ (let Count0_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count0_finish (lambda '(state) state))
+ (return (Aggregate core '() '('('Count0 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"key") Count0_create Count0_update Count0_save Count0_load Count0_merge Count0_finish (Uint64 '0)) '"key"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" (Member row 'Count0)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.cfg
new file mode 100644
index 0000000000..96364ca2c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.cfg
@@ -0,0 +1,3 @@
+in Input inputDistinctKey.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.yql
new file mode 100644
index 0000000000..ebd34f15ed
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/CountDistinctOpt.yql
@@ -0,0 +1,53 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Cast (Member row '"key") 'Int32)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (block '(
+ (let Count1_create (lambda '(row) (AggrCountInit row)))
+ (let Count1_update (lambda '(row state) (AggrCountUpdate row state)))
+ (let Count1_save (lambda '(state) state))
+ (let Count1_load (lambda '(item) item))
+ (let Count1_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
+ (let Count1_finish (lambda '(state) state))
+ (return (Aggregate core '() '('('Count1 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"key") Count1_create Count1_update Count1_save Count1_load Count1_merge Count1_finish (Uint64 '0)) '"key"))))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" (Member row 'Count1)))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.cfg
new file mode 100644
index 0000000000..b8c8b850ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.yql
new file mode 100644
index 0000000000..d1a2b6f1e2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupAndWithCommonPartsUnderOr.yql
@@ -0,0 +1,16 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Write! world $1 (Key) (Unordered (EnsurePersistable (OrderedFlatMap (OrderedFilter (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())) (lambda '($3) (Coalesce
+ (Or
+ (Or
+ (And (== (Member $3 '"key") (String '"911")) (== (Member $3 '"value") (String '"kkk")))
+ (And (And (== (String '"911") (Member $3 '"key")) (== (String '"xyz") (Member $3 '"value"))) (== (Member $3 '"subkey") (String '"3")))
+ )
+ (Or
+ (And (== (String '"911") (Member $3 '"key")) (== (String '"xyz") (Member $3 '"value")))
+ (And (== (String '"911") (Member $3 '"key")) (== (String '"aaa") (Member $3 '"value")))
+ )
+ )
+(Bool 'false)))) (lambda '($4) (AsList $4))))) '('('type) '('autoref))))
+(return (CommitAll! (Commit! $2 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.cfg
new file mode 100644
index 0000000000..b8c8b850ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.yql
new file mode 100644
index 0000000000..0271673f55
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DedupOrWithCommonPartsUnderAnd.yql
@@ -0,0 +1,16 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Write! world $1 (Key) (Unordered (EnsurePersistable (OrderedFlatMap (OrderedFilter (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())) (lambda '($3) (Coalesce
+ (And
+ (And
+ (Or (== (Member $3 '"key") (String '"075")) (== (Member $3 '"subkey") (String '"4")))
+ (Or (== (String '"075") (Member $3 '"key")) (== (String '"xyz") (Member $3 '"value")))
+ )
+ (Or
+ (Or (== (String '"075") (Member $3 '"key")) (== (Member $3 '"value") (String '"xyz")))
+ (== (Member $3 '"key") (String '"200"))
+ )
+ )
+(Bool 'false)))) (lambda '($4) (AsList $4))))) '('('type) '('autoref))))
+(return (CommitAll! (Commit! $2 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DemuxOverExtend.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/DemuxOverExtend.yql
new file mode 100644
index 0000000000..b8eba4c967
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DemuxOverExtend.yql
@@ -0,0 +1,57 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let data (Right! x))
+
+(let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+)))
+
+(let varData1 (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+)))))
+
+(let varData2 (Map data (lambda '(item) (block '(
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let intValue (+ intValue (Int32 '1)))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+)))))
+
+(let dataTuple (Demux (Extend varData1 varData2)))
+
+(let data1 (Nth dataTuple '0))
+(let data2 (Nth dataTuple '1))
+
+(let data1 (Filter data1 (lambda '(item) (Less (Member item 'key) (String '200)))))
+
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data1 '('('mode 'renew))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data2 '('('mode 'append))))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/DoubleSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/DoubleSort.yql
new file mode 100644
index 0000000000..cd9fa2787f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/DoubleSort.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'c) (String 'e) (String 'a)))
+(let data (Sort data (Bool 'true) (lambda '(x) x)))
+(let data (Sort data (Bool 'true) (lambda '(x) x)))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivInsideNestedLambdaOuterDiffLevel.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivInsideNestedLambdaOuterDiffLevel.yql
new file mode 100644
index 0000000000..d78e05c61f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivInsideNestedLambdaOuterDiffLevel.yql
@@ -0,0 +1,35 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+#comment
+(let res_sink (DataSink 'result))
+(let outLambda1 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let outLambda2 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let anotherLambda (lambda '(sep) (block '(
+ (let seps (AsList (Concat (String 'z) sep) (Concat (String 'y) sep)))
+ (let res1 (FlatMap seps outLambda1))
+ (let res2 (FlatMap seps outLambda2))
+ (return (Extend res1 res2))
+))))
+
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data1 (IfPresent sep outLambda1 (AsList (String 'none))))
+(let data2 (IfPresent sep anotherLambda (AsList (String 'none))))
+(let world (Write! world res_sink (Key) '(data1 data2) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivLambda.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivLambda.yql
new file mode 100644
index 0000000000..792976bc37
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivLambda.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'a) (String 'a)))
+(let data1 (Map data (lambda '(x) (Concat x (Concat (String '_) (String '_))))))
+(let data2 (Map data (lambda '(y) (Concat y (Concat (String '_) (String '_))))))
+(let data (Extend data1 data2))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOneLevel.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOneLevel.yql
new file mode 100644
index 0000000000..2c5734f703
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOneLevel.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let outLambda (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let data2 (Map data (lambda '(y) (Concat y sep))))
+ (let res (Extend data1 data2))
+ (return res)
+))))
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data (IfPresent sep outLambda (AsList (String 'none))))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterDiffLevel.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterDiffLevel.yql
new file mode 100644
index 0000000000..caa3cca763
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterDiffLevel.yql
@@ -0,0 +1,34 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let outLambda1 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let outLambda2 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let anotherLambda (lambda '(sep) (block '(
+ (let seps (AsList (Concat (String 'z) sep) (Concat (String 'y) sep)))
+ (let res (FlatMap seps outLambda2))
+ (return res)
+))))
+
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data1 (IfPresent sep outLambda1 (AsList (String 'none))))
+(let data2 (IfPresent sep anotherLambda (AsList (String 'none))))
+(let world (Write! world res_sink (Key) '(data1 data2) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterSameLevel.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterSameLevel.yql
new file mode 100644
index 0000000000..810324b0dd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNestedLambdaOuterSameLevel.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let outLambda1 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let outLambda2 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data1 (IfPresent sep outLambda1 (AsList (String 'none))))
+(let data2 (IfPresent sep outLambda2 (AsList (String 'none))))
+(let world (Write! world res_sink (Key) '(data1 data2) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodeInNestedLambda.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodeInNestedLambda.yql
new file mode 100644
index 0000000000..5da1b36ee1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodeInNestedLambda.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let outLambda (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat (Concat x sep) (ToString (Int32 '1))))))
+ (return data1)
+))))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data (IfPresent sep outLambda (AsList (String 'none))))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodesInLambdas.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodesInLambdas.yql
new file mode 100644
index 0000000000..3f76dd440f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/EquivNodesInLambdas.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'a) (String 'a)))
+(let data1 (Map data (lambda '(x) (Concat x (Concat (String 'l1) (String 'l2))))))
+(let data2 (Map data (lambda '(y) (Concat y (Concat (String 'l2) (String 'l1))))))
+(let data (Extend data1 data2))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExpandAddRemoveMember.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExpandAddRemoveMember.yql
new file mode 100644
index 0000000000..69ede42271
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExpandAddRemoveMember.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let func (lambda '() (AsStruct '('a (String '1)) '('b (Int32 '2)))))
+(let type (CallableType '() '((StructType '('a (DataType 'String)) '('b (DataType 'Int32))))))
+(let call (Callable type func))
+(let data (Apply call))
+(let data1 (AddMember data 'd (Bool 'True)))
+(let data2 (ForceRemoveMember data 'a))
+(let data2 (ForceRemoveMember data2 'x))
+(let world (Write! world res_sink (Key) '(data1 data2) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapExchange.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapExchange.yql
new file mode 100644
index 0000000000..0ff086d5c7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapExchange.yql
@@ -0,0 +1,29 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let table2 (Skip table1 (Uint32 '1)))
+ (let duplicate (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AsList row row))
+ (return res)
+ ))))
+ (let ttable1 (FlatMap table1 duplicate))
+ (let ttable2 (FlatMap table2 duplicate))
+ (let extend (Extend ttable1 ttable2))
+ (let output (Filter extend (lambda '(row) (< (Member row '"key") (String '500)))))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapOptimizeTablePath.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapOptimizeTablePath.yql
new file mode 100644
index 0000000000..ac8743eeca
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendAndFlatmapOptimizeTablePath.yql
@@ -0,0 +1,16 @@
+(
+(let mr_sync (DataSink 'result))
+(let mr_source (DataSource '"yt" '"plato"))
+(let lambda (lambda '(item) (block '(
+ (return (AsList (AsStruct '('"path" (TablePath (DependsOn item))))))
+))))
+(let res (Extend
+ (FlatMap (Right! (Read! world mr_source (Key '('table (String '"Input"))) '() '())) lambda)
+ (FlatMap (Right! (Read! world mr_source (Key '('table (String '"Input"))) '() '())) lambda)
+ (FlatMap (Extend
+ (Right! (Read! world mr_source (Key '('table (String '"Input"))) '() '()))) (lambda '(item) (block '(
+ (return (AsList (AsStruct '('"path" (String '"Special")))))
+))))))
+(let world (ResWrite! world mr_sync (Key) res '('('type) '('autoref) '('columns '('"path")))))
+(return (Commit! (Commit! world mr_sync) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendTableWithLiteral.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendTableWithLiteral.yql
new file mode 100644
index 0000000000..296bdafd03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendTableWithLiteral.yql
@@ -0,0 +1,80 @@
+#use plato;
+#
+#SELECT * FROM Input
+#UNION ALL
+#SELECT 2 AS y;
+#
+#SELECT 1 AS x
+#UNION ALL
+#SELECT * FROM Input;
+
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (UnionAll (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )) (block '(
+ (let core (AsList (Void)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"y" (Int64 '"2")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ ))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (UnionAll (block '(
+ (let core (AsList (Void)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"x" (Int64 '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )) (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ ))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.cfg
new file mode 100644
index 0000000000..80d5638bff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.cfg
@@ -0,0 +1,3 @@
+in Input SomeKeys.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.sql
new file mode 100644
index 0000000000..371846c584
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+-- Should not generate single MrFill for all content
+INSERT INTO Output
+SELECT * from(
+ select key, sum(cast(subkey as Uint32)) as value
+ from Input group by key
+
+ union all
+
+ select "" as key, sum(cast(subkey as Uint32)) as value
+ from Input-- group by key
+);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.yql
new file mode 100644
index 0000000000..2e266ddca2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.yql
@@ -0,0 +1,56 @@
+(
+# Should not generate single MrFill for all content
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
+ (let world (Left! x))
+ (let table2 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core (UnionAll (block '(
+ (let select (block '(
+ (let core table2)
+ (let core (Aggregate core '('"key") '('('Sum0 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Cast (Member row '"subkey") 'Uint32)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Member row '"key")) '('"value" (Member row 'Sum0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) (block '(
+ (let select (block '(
+ (let core table2)
+ (let core (Aggregate core '() '('('Sum1 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Cast (Member row '"subkey") 'Uint32)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (String '"")) '('"value" (Member row 'Sum1))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ ))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return world)
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.cfg
new file mode 100644
index 0000000000..807ada95e2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 input2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.yql
new file mode 100644
index 0000000000..a61e2d4d2f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithTablePath.yql
@@ -0,0 +1,48 @@
+#USE plato;
+#select table, count(*) from
+# (select TablePath() as table from CONCAT([Input],[Input])) group by table;
+
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1"))) (Key '('table (String '"Input2")))) '() '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"table" (TablePath (DependsOn row)))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (Aggregate core '('"table") '('('Count1 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"table" (Member row '"table")) '('"column1" (Member row 'Count1))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"table" '"column1")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.cfg
new file mode 100644
index 0000000000..807ada95e2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 input2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.yql
new file mode 100644
index 0000000000..d775d38829
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOnMultiInput.yql
@@ -0,0 +1,22 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x1 (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
+(let x2 (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x1))
+(let table1 (RemoveSystemMembers (Right! x1)))
+(let table2 (RemoveSystemMembers (Right! x2)))
+
+(let joinType '('LeftOnly '"t" '"d" '('"t" '"key") '('"d" '"key") '()))
+(let $67 '('"rename" '"t.key" '"key"))
+(let $68 '('"rename" '"t.subkey" '"subkey"))
+(let $69 '('"rename" '"t.value" '"value"))
+(let rename '($67 $68 $69))
+
+(let join (EquiJoin '(table1 '"t") '((FlatMap (Extend (ExtractMembers table1 '('"key")) (ExtractMembers table2 '('"key"))) (lambda '($159) (Just (AsStruct '('"key" (Member $159 '"key")))))) '"d") joinType rename))
+(let out (Extend table1 table2 join))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) out '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.yql
new file mode 100644
index 0000000000..08083fbc54
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverEquiJoin.yql
@@ -0,0 +1,12 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let join (EquiJoin '(table 'a) '(table 'b) '('Inner '"a" '"b" '('"a" '"key") '('"b" '"value" ) '()) '()))
+(let join (ExtractMembers join '('a.key 'b.value)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) join '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverRead.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverRead.yql
new file mode 100644
index 0000000000..e5bccc409e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractMembersOverRead.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (ExtractMembers table1 '('key 'value)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractPredicateFromFlatmapOverListIf.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractPredicateFromFlatmapOverListIf.yql
new file mode 100644
index 0000000000..0a63ce0c2c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ExtractPredicateFromFlatmapOverListIf.yql
@@ -0,0 +1,37 @@
+(
+# read data from Input table
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b))))
+(let str3 (AsStruct '('a (Uint32 '3)) '('b (String 'c))))
+(let list1 (AsList str1 str2))
+(let list2 (AsList str2 str1))
+(let list3 (AsList str1 str3))
+
+(let cond (>= (RandomNumber) (Uint64 '0)))
+
+(let res (FlatMap (OptionalIf cond str1) (lambda '(r) (OptionalIf (>= (Member r 'b) (String 'a)) r))))
+(let world (Write! world res_sink (Key) res '()))
+
+(let res (FlatMap (OptionalIf cond str1) (lambda '(r) (AsList r r))))
+(let world (Write! world res_sink (Key) res '()))
+
+(let res (FlatMap (OptionalIf cond str1) (lambda '(r) (ToStream (Just r) (DependsOn r)))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (ListIf cond str1) (lambda '(r) (OptionalIf (>= (Member r 'b) (String 'a)) r))))
+(let world (Write! world res_sink (Key) res '()))
+
+(let res (FlatMap (ListIf cond str1) (lambda '(r) (AsList r r))))
+(let world (Write! world res_sink (Key) res '()))
+
+(let res (FlatMap (ListIf cond str1) (lambda '(r) (ToStream (Just r) (DependsOn r)))))
+(let world (Write! world res_sink (Key) res '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.cfg
new file mode 100644
index 0000000000..fa5e600b39
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.cfg
@@ -0,0 +1,2 @@
+in Input typed_table.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.yql
new file mode 100644
index 0000000000..4a52d5d457
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FalattenByColumns.yql
@@ -0,0 +1,38 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")) '('view (String '"opt_struct")))) '('"b") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (FlattenByColumns row '('b 'bb)))
+ (return res)
+ )))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"bb" (Member row '"bb")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"bb")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterCombineByKey.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterCombineByKey.yql
new file mode 100644
index 0000000000..abfdcb837a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterCombineByKey.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'a) (String 'a) (String 'b)))
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) item))
+(let init (lambda '(key item) item))
+(let update (lambda '(key item state) (Concat state item)))
+(let finish (lambda '(key state) (AsList '(key state))))
+(let combined (CombineByKey data preMap keyExtractor init update finish))
+(let map (Map combined (lambda '(x) (Nth x '1))))
+(let result (Sort map (Bool 'true) (lambda '(x) x)))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterFilterNullMembers.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterFilterNullMembers.yql
new file mode 100644
index 0000000000..62ab06b3ec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapAfterFilterNullMembers.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList
+ (AsStruct '('data (Just (String 'a))))
+ (AsStruct '('data (Nothing (OptionalType (DataType 'String)))))
+ (AsStruct '('data (Just (String 'b))))
+))
+(let filtered (FilterNullMembers data '('data)))
+(let map (Map filtered (lambda '(x) '(x x))))
+(let result (Sort map (Bool 'true) (lambda '(x) (Member (Nth x '0) 'data))))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapBeforeCombineByKey.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapBeforeCombineByKey.yql
new file mode 100644
index 0000000000..aa7b1d874a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapBeforeCombineByKey.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'a) (String 'a) (String 'b) (String 'c)))
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) item))
+(let init (lambda '(key item) item))
+(let update (lambda '(key item state) (Concat state item)))
+(let finish (lambda '(key state) (AsList '(key state))))
+(let map (Filter data (lambda '(x) (< x (String 'c)))))
+(let combined (CombineByKey map preMap keyExtractor init update finish))
+(let result (Sort combined (Bool 'true) (lambda '(x) (Nth x '0))))
+(let world (Write! world res_sink (Key) result '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapToExtractMembers.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapToExtractMembers.yql
new file mode 100644
index 0000000000..b0dfbcde05
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapToExtractMembers.yql
@@ -0,0 +1,30 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+
+(let res1 (FlatMap list1 (lambda '(item) (block '(
+ (let ret (Just (AsStruct '('a (Member item 'a)) '('c (Member item 'c)))))
+ (return ret)
+)))))
+
+(let res2 (FlatMap list1 (lambda '(item) (block '(
+ (let ret (Just (AsStruct '('b (Member item 'b)) '('k (Member item 'c)))))
+ (return ret)
+)))))
+
+(let res3 (FlatMap list1 (lambda '(item) (block '(
+ (let ret (Just (AsStruct)))
+ (return ret)
+)))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) res1 '('('type))))
+(let world (Write! world res_sink (Key) res2 '('('type))))
+(let world (Write! world res_sink (Key) res3 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapWithVariantItemAfterSwitch.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapWithVariantItemAfterSwitch.yql
new file mode 100644
index 0000000000..855ec4454f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FlatMapWithVariantItemAfterSwitch.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let structType (StructType '('key (DataType 'String)) '('value (DataType 'String))))
+(let tupleType (TupleType structType structType structType))
+(let vt (VariantType tupleType))
+(let vlist (AsList
+ (Variant (AsStruct '('key (String 'aaa)) '('value (String '0))) '0 vt)
+ (Variant (AsStruct '('key (String 'bbb)) '('value (String '1))) '1 vt)
+ (Variant (AsStruct '('key (String 'ccc)) '('value (String '2))) '2 vt)
+))
+
+(let takeHandler (lambda '(x) (Take x (Uint64 '42))))
+
+(let world (Write! world res_sink (Key) (Collect (Map (Switch (ToFlow vlist) '1 '('0) takeHandler '('1 '2) takeHandler) (lambda '(s) (VariantItem s)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Map (Switch (ToFlow vlist) '1 '('1) takeHandler '('2) takeHandler) (lambda '(s) (VariantItem s)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Map (Switch (ToFlow vlist) '1 '('0 '1) takeHandler '('1 '2) takeHandler) (lambda '(s) (VariantItem s)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (OrderedMap (Switch (ToFlow vlist) '1 '('0 '1 '2) takeHandler) (lambda '(s) (VariantItem s)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMax.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMax.yql
new file mode 100644
index 0000000000..a32571a772
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMax.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list
+ (lambda '(item) (String 'z))
+ (lambda '(item state) (Max state (String 'y)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMin.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMin.yql
new file mode 100644
index 0000000000..f173ae96ab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1ConstMin.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list
+ (lambda '(item) (String 'z))
+ (lambda '(item state) (Min state (String 'y)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyStruct.yql
new file mode 100644
index 0000000000..a9b8d1e1ee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyStruct.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list (lambda '(item) (Struct)) (lambda '(item state) state)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyTuple.yql
new file mode 100644
index 0000000000..e6be656d48
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1EmptyTuple.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list (lambda '(item) '()) (lambda '(item state) state)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1IncrementAsLength.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1IncrementAsLength.yql
new file mode 100644
index 0000000000..47cda00536
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1IncrementAsLength.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list
+ (lambda '(item) (Uint32 '1))
+ (lambda '(item state) (+ state (Uint32 '1)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemStruct.yql
new file mode 100644
index 0000000000..5077ac27e4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemStruct.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list
+ (lambda '(item)
+ (AddMember
+ (Struct)
+ 'z
+ item))
+ (lambda '(item state)
+ (AddMember
+ (Struct)
+ 'z
+ (Concat (Member state 'z) item)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemTuple.yql
new file mode 100644
index 0000000000..0f6615de39
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OneItemTuple.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold1 list
+ (lambda '(item)
+ '(item))
+ (lambda '(item state) (block '(
+ (let x (Concat (Nth state '0) item))
+ (return '(x)))))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OverOptional.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OverOptional.yql
new file mode 100644
index 0000000000..c4ac775064
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Fold1OverOptional.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (Just (String 'a)))
+(let data (Fold1 list
+(lambda '(item) (Concat item (String 'b)))
+(lambda '(item state) (Concat item state))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMax.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMax.yql
new file mode 100644
index 0000000000..cc2d3f5d62
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMax.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list
+ (String 'z)
+ (lambda '(item state) (Max state (String 'y)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMin.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMin.yql
new file mode 100644
index 0000000000..d7f3bc98b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldConstMin.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list
+ (String 'z)
+ (lambda '(item state) (Min state (String 'y)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyStruct.yql
new file mode 100644
index 0000000000..c170ea2fc0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyStruct.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list (Struct) (lambda '(item state) state)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyTuple.yql
new file mode 100644
index 0000000000..73ac847631
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldEmptyTuple.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list '() (lambda '(item state) state)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldIncrementAsLength.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldIncrementAsLength.yql
new file mode 100644
index 0000000000..758cd43bf4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldIncrementAsLength.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list (Uint32 '0) (lambda '(item state) (+ state (Uint32 '1)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemStruct.yql
new file mode 100644
index 0000000000..12014ead02
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemStruct.yql
@@ -0,0 +1,19 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let data (Fold list (AddMember (Struct) 'z (String '""))
+ (lambda '(item state)
+ (AddMember
+ (Struct)
+ 'z
+ (Concat (Member state 'z) item)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemTuple.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemTuple.yql
new file mode 100644
index 0000000000..ccada97695
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FoldOneItemTuple.yql
@@ -0,0 +1,18 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let s (String '""))
+(let data (Fold list '(s)
+ (lambda '(item state) (block '(
+ (let state (Concat (Nth state '0) item))
+ (return '(state)))))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseExtractMembers.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseExtractMembers.yql
new file mode 100644
index 0000000000..8d267ce890
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseExtractMembers.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let world (Write! world res_sink (Key) (ExtractMembers (ExtractMembers list1 '('a 'c)) '('a)) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithExtractMembers.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithExtractMembers.yql
new file mode 100644
index 0000000000..57c81db622
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithExtractMembers.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let world (Write! world res_sink (Key) (Map (ExtractMembers list1 '('a 'c)) (lambda '(row) '((+ (Member row 'a) (Uint32 '10)) (Member row 'c)))) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithStreamLambda.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithStreamLambda.yql
new file mode 100644
index 0000000000..c4585070bf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapWithStreamLambda.yql
@@ -0,0 +1,15 @@
+(
+(let res_sink (DataSink 'result))
+
+(let singleList (AsList (Int32 '1)))
+(let optional (/ (Int32 '1) (Int32 '0)))
+(let streamLambda (lambda '(x) (Iterator (AsList (Int32 '1) (Int32 '2)))))
+
+(let map1 (Unordered (FlatMap singleList streamLambda)))
+(let map2 (Unordered (FlatMap (ToList optional) streamLambda)))
+
+(let world (Write! world res_sink (Key) map1 '('('type))))
+(let world (Write! world res_sink (Key) map2 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapsWithDependsOn.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapsWithDependsOn.yql
new file mode 100644
index 0000000000..0553caa8fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatMapsWithDependsOn.yql
@@ -0,0 +1,35 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let res_sink (DataSink 'result))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+(let inner1 (FlatMap table (lambda '(row) (OptionalIf (> (Member row 'key) (String '100)) (AsStruct '('key1 (Member row 'key)))))))
+
+(let inner2 (FlatMap table (lambda '(row) (Just (AsStruct '('key1 (Member row 'key)))))))
+
+(let outer (lambda '(input) (FlatMap input (lambda '(row)
+ (Just
+ (AsStruct
+ '('key (Member row 'key1))
+ '('value (ToOptional (Collect (Condense
+ (Iterator list (DependsOn row))
+ (String '"")
+ (lambda '(item state) (Bool 'False))
+ (lambda '(item state) (Concat state item))
+ ))))
+ )
+ )
+))))
+
+
+(let world (Write! world res_sink (Key) (Apply outer inner1) '('('type))))
+(let world (Write! world res_sink (Key) (Apply outer inner2) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithInnerVisit.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithInnerVisit.yql
new file mode 100644
index 0000000000..9a0a42e1f3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithInnerVisit.yql
@@ -0,0 +1,59 @@
+(
+#comment
+(let config (DataSource 'config))
+(let res_sink (DataSink 'result))
+
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let vt (VariantType (TupleType (DataType 'String) (DataType 'String) (DataType 'String))))
+(let v0 (Variant (String 'aaa) '0 vt))
+(let v1 (Variant (String 'bbb) '1 vt))
+(let v2 (Variant (String 'ccc) '2 vt))
+(let list (AsList v0 v1 v2))
+
+
+(let inner (lambda '(list)
+ (FlatMap list (lambda '(item)
+ (Visit item
+ '0 (lambda '(x) (OptionalIf (== x (String 'aaa)) (Variant (Concat (String '0-) x) '0 vt)))
+ '1 (lambda '(x) (Just (Variant (Concat (String '1-) x) '1 vt)))
+ (Just (Variant (String '2-) '2 vt))
+ )
+ ))
+))
+
+(let res (FlatMap (Apply inner (Iterator list (DependsOn (String 'a)))) (lambda '(item)
+ (Just (VariantItem item))
+)))
+(let world (Write! world res_sink (Key) (Collect res) '('('type))))
+
+(let res (FlatMap (Apply inner (Iterator list (DependsOn (String 'b)))) (lambda '(item)
+ (Just (Visit item
+ '0 (lambda '(x) (Variant x '0 vt))
+ '1 (lambda '(x) (Variant x '1 vt))
+ '2 (lambda '(x) (Variant x '1 vt))
+ ))
+)))
+(let world (Write! world res_sink (Key) (Collect res) '('('type))))
+
+(let res (FlatMap
+ (FlatMap list (lambda '(item)
+ (Visit item
+ '0 (lambda '(x) (ListIf (== x (String 'aaa)) (Variant (Concat (String '0-) x) '0 vt)))
+ '1 (lambda '(x) (AsList (Variant (Concat (String '1-) x) '1 vt) (Variant (Concat (String '2-) x) '2 vt)))
+ (AsList (Variant (String '2-) '2 vt))
+ )
+ ))
+ (lambda '(item)
+ (Just (Visit item
+ '0 (lambda '(x) (Variant x '0 vt))
+ '1 (lambda '(x) (Variant x '1 vt))
+ '2 (lambda '(x) (Variant x '1 vt))
+ ))
+ )
+))
+(let world (Write! world res_sink (Key) (Collect res) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithOptionalIf.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithOptionalIf.yql
new file mode 100644
index 0000000000..3a7375371f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseFlatmapsWithOptionalIf.yql
@@ -0,0 +1,32 @@
+(
+# read data from Input table
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b))))
+(let list (AsList str1 str2))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '1))) (lambda '(r) (OptionalIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (ToStream (Just r)))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '2))) (lambda '(r) (OptionalIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (AsList r r))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '3))) (lambda '(r) (OptionalIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (OptionalIf (> (Member r 'b) (String 'a)) r))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '4))) (lambda '(r) (ListIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (ToStream (Just r)))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '5))) (lambda '(r) (ListIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (AsList r r))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let res (FlatMap (FlatMap (Iterator list (DependsOn (String '6))) (lambda '(r) (ListIf (> (Member r 'a) (Uint32 '0)) r))) (lambda '(r) (OptionalIf (> (Member r 'b) (String 'a)) r))))
+(let world (Write! world res_sink (Key) (ForwardList res) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.sql
new file mode 100644
index 0000000000..0f5cd0b0c6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.sql
@@ -0,0 +1,31 @@
+USE plato;
+
+$a = (SELECT
+ skey,count(*) as cnt
+FROM Input
+GROUP BY Length(key) as skey);
+
+$udfScript = @@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@;
+
+$udf = Python::f(@@
+(Stream<Struct<skey:Uint32,cnt:Uint64>>,Int32)
+->
+Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
+@@, $udfScript);
+
+$udf2 = Python::f(@@
+(Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>,Int32)
+->
+Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
+@@, $udfScript);
+
+
+$b = (PROCESS $a USING $udf($ROWS,1));
+
+PROCESS $b USING $udf2($ROWS,2);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.yql
new file mode 100644
index 0000000000..cc5b60392b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterLReduce.yql
@@ -0,0 +1,82 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let inputRowsList (block '(
+ (let select (block '(
+ (let inputRowsList (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (AsList (AsStruct '('"key" (Member row '"key")) '('"skey" ("Size" (Member row '"key"))))))))
+ (let core (Aggregate core '('"skey") '('('Count0 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"skey" (Member row '"skey")) '('"cnt" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (LMap inputRowsList (lambda '(x) (block '(
+ (let inputType (CallableArgumentType (TypeOf (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@))) '0))
+ (let inputRowsList (MatchType inputType 'List (lambda '(y) (ForwardList x)) (lambda '(y) "x")))
+ (return (Apply (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@)) inputRowsList (Int32 '"1")))
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (LMap inputRowsList (lambda '(x) (block '(
+ (let inputType (CallableArgumentType (TypeOf (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@))) '0))
+ (let inputRowsList (MatchType inputType 'List (lambda '(y) (ForwardList x)) (lambda '(y) "x")))
+ (return (Apply (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@)) inputRowsList (Int32 '"2")))
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.sql
new file mode 100644
index 0000000000..f0bd1ff3ba
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.sql
@@ -0,0 +1,23 @@
+USE plato;
+
+$a = (SELECT
+ skey,count(*) as cnt
+FROM Input
+GROUP BY Length(key) as skey);
+
+$udfScript = @@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@;
+
+$udf = Python::f(@@
+(Stream<Struct<skey:Uint32,cnt:Uint64>>,Int32)
+->
+Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
+@@, $udfScript);
+
+
+PROCESS $a USING $udf($ROWS,1);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.yql
new file mode 100644
index 0000000000..1f806dc3a3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseLMapAfterReduce.yql
@@ -0,0 +1,59 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let inputRowsList (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (AsList (AsStruct '('"key" (Member row '"key")) '('"skey" ("Size" (Member row '"key"))))))))
+ (let core (Aggregate core '('"skey") '('('Count0 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"skey" (Member row '"skey")) '('"cnt" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (LMap inputRowsList (lambda '(x) (block '(
+ (let inputType (CallableArgumentType (TypeOf (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@))) '0))
+ (let inputRowsList (MatchType inputType 'List (lambda '(y) (ForwardList x)) (lambda '(y) "x")))
+ (return (Apply (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+@@)) inputRowsList (Int32 '"1")))
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.sql
new file mode 100644
index 0000000000..c87931cafd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.sql
@@ -0,0 +1,32 @@
+USE plato;
+
+$a = (SELECT
+ skey,count(*) as cnt
+FROM Input
+GROUP BY Length(key) as skey);
+
+$udfScript = @@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+
+def f2(a,b,c):
+ return {"a":a,"b":b,"c":c}
+@@;
+
+$udf = Python::f(@@
+(Stream<Struct<skey:Uint32,cnt:Uint64>>,Int32)
+->
+Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
+@@, $udfScript);
+
+$udf2 = Python::f2(@@
+(skey:Uint32,cnt:Uint64,pass:Int32)->Struct<a:Uint32,b:Uint64,c:Int32>
+@@, $udfScript);
+
+
+$b = (PROCESS $a USING $udf($ROWS,1));
+
+PROCESS $b USING $udf2(skey,cnt,pass);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.yql
new file mode 100644
index 0000000000..ea138e481a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMapAfterLReduce.yql
@@ -0,0 +1,85 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let inputRowsList (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (FlatMap core (lambda '(row) (AsList (AsStruct '('"key" (Member row '"key")) '('"skey" ("Size" (Member row '"key"))))))))
+ (let core (Aggregate core '('"skey") '('('Count0 (Apply (bind aggregate_module '"count_traits_factory") (TypeOf core) (lambda '(row) (Void)))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"skey" (Member row '"skey")) '('"cnt" (Member row 'Count0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (LMap inputRowsList (lambda '(x) (block '(
+ (let inputType (CallableArgumentType (TypeOf (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+
+def f2(a,b,c):
+ return {"a":a,"b":b,"c":c}
+@@))) '0))
+ (let inputRowsList (MatchType inputType 'List (lambda '(y) (ForwardList x)) (lambda '(y) "x")))
+ (return (Apply (ScriptUdf 'Python '"f" (CallableType '() '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"pass" (DataType 'Int32)) '('"skey" (DataType 'Uint32))))) '((StreamType (StructType '('"cnt" (DataType 'Uint64)) '('"skey" (DataType 'Uint32))))) '((DataType 'Int32))) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+
+def f2(a,b,c):
+ return {"a":a,"b":b,"c":c}
+@@)) inputRowsList (Int32 '"1")))
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Apply (ScriptUdf 'Python '"f2" (CallableType '() '((StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64)) '('"c" (DataType 'Int32)))) '((DataType 'Uint32) 'skey) '((DataType 'Uint64) 'cnt) '((DataType 'Int32) 'pass)) (String '@@
+def f(input,x):
+ for i in list(input):
+ d = i.__dict__
+ d["pass"] = x
+ yield d
+
+def f2(a,b,c):
+ return {"a":a,"b":b,"c":c}
+@@)) (Member row '"skey") (Member row '"cnt") (Member row '"pass")))
+ (let res (MatchType res 'Optional (lambda '(opt) (ToList opt)) (lambda '(val) (MatchType val 'List (lambda '(list) list) (lambda '(item) (AsList item))))))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMultipliersFlatmaps.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMultipliersFlatmaps.yql
new file mode 100644
index 0000000000..6241a465a7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/FuseMultipliersFlatmaps.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList
+ (AsStruct '('data (String 'a)))
+ (AsStruct '('data (String 'b)))
+ (AsStruct '('data (String 'c)))
+))
+
+(let one (OrderedFlatMap data (lambda '(x) (AsList x (AsStruct '('data (String 'z)))))))
+(let two (OrderedFlatMap one (lambda '(x) (AsList (AsStruct '('data (String 'y))) x x))))
+(let three (OrderedFlatMap two (lambda '(x) (AsList x (AsStruct '('data (String 'x))) x))))
+(let world (Write! world res_sink (Key) three '()))
+(let world (Commit! world res_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUnused.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUnused.yql
new file mode 100644
index 0000000000..877db04e8b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUnused.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let keyExtractor (lambda '(x) (String '"@")))
+(let handler (lambda '(key list) (AsList (Uint32 '42))))
+(let data (GroupByKey list keyExtractor handler))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUsed.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUsed.yql
new file mode 100644
index 0000000000..40045830d0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/GroupBySingleKeyListUsed.yql
@@ -0,0 +1,16 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list (AsList (String 'a) (String 'b) (String 'c)))
+(let keyExtractor (lambda '(x) (String '"@")))
+(let handler (lambda '(key list) (AsList '(key (Length list)))))
+(let data (GroupByKey list keyExtractor handler))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/HasItemsAfterEnumerate.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/HasItemsAfterEnumerate.yql
new file mode 100644
index 0000000000..eb78e634af
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/HasItemsAfterEnumerate.yql
@@ -0,0 +1,12 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let data (HasItems (Enumerate (AsList (String 'a) (String 'b) (String 'c)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/IfOverNotPredicate.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/IfOverNotPredicate.yql
new file mode 100644
index 0000000000..798f4b5825
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/IfOverNotPredicate.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (If (Not (ListHas (AsList (Uint32 '1)) (Uint32 '1))) (String 'a) (String 'b)))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/InjectExtractMembersOverSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/InjectExtractMembersOverSort.yql
new file mode 100644
index 0000000000..2346c6fbe8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/InjectExtractMembersOverSort.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Sort list1 (Bool 'true) (lambda '(row) (Member row 'a))))
+(let list1 (ExtractMembers list1 '('b)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/InnerLambda.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/InnerLambda.yql
new file mode 100644
index 0000000000..cefbe8d819
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/InnerLambda.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'a) (String 'b)))
+(let list2 (AsList (String 'c) (String 'd)))
+(let data (FlatMap list1 (lambda '(x) (block '(
+ (let myList (Map list2 (lambda '(y) (block '(
+ (return (Concat x y)))))))
+ (return myList)
+)))))
+
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt
new file mode 100644
index 0000000000..95a39214c5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt
@@ -0,0 +1,8 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt.attr
new file mode 100644
index 0000000000..b10bf7c075
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/InputUniq.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_yql_row_spec"={
+ "UniqueKeys"=%true;
+ "SortMembers"=["key"];
+ "SortedBy"=["key"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"String"]];
+ "Type"=["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.cfg
new file mode 100644
index 0000000000..9d65859cb9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.cfg
@@ -0,0 +1,3 @@
+out Output output.txt
+res result.txt
+udf python3_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.yql
new file mode 100644
index 0000000000..5395d3e9f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LMapWithEmptyInput.yql
@@ -0,0 +1,23 @@
+(
+(let structType (StructType '('"key" (DataType 'String)) '('"subkey" (DataType 'String)) '('"value" (DataType 'String))))
+#comment
+(let udfType (CallableType '() '((StreamType structType)) '((StreamType structType))))
+(let script '@@
+def f(input):
+ for i in input:
+ yield {
+ 'key': i.key,
+ 'subkey': i.subkey,
+ 'value': i.value
+ }
+@@)
+(let udf (ScriptUdf 'Python3 '"f" udfType (String script)))
+
+(let res (LMap (List (ListType structType)) (lambda '(stream) (block '(
+ (return (Apply udf stream))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) res '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterAsList.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterAsList.yql
new file mode 100644
index 0000000000..1e36b20260
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterAsList.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let data (Length (AsList (String 'a) (String 'b))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterEnumerate.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterEnumerate.yql
new file mode 100644
index 0000000000..3926c6303f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterEnumerate.yql
@@ -0,0 +1,12 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let data (Length (Enumerate (AsList (String 'a) (String 'b) (String 'c)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterList.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterList.yql
new file mode 100644
index 0000000000..89e18df910
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterList.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let data (Length (List (ListType (DataType 'String)) (String 'a) (String 'b))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterMap.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterMap.yql
new file mode 100644
index 0000000000..90563d41a3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthAfterMap.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Map table1 (lambda '(x) '(x (String 'qwe)))))
+(let table1len (Length table1))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1len '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.cfg
new file mode 100644
index 0000000000..bf54cfd5be
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.cfg
@@ -0,0 +1,2 @@
+in Input input_tbl_content.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.yql
new file mode 100644
index 0000000000..1a1056aa00
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContent.yql
@@ -0,0 +1,16 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let r (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline))))
+ (let input (Right! r))
+ (let out (FlatMap input (lambda '(item) (block '(
+ (let len (Length input))
+ (let key (Member item 'key))
+ (let key (Coalesce (Cast key 'Uint64) (Uint64 '0)))
+ (return (ListIf (> key len) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.cfg
new file mode 100644
index 0000000000..bf54cfd5be
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.cfg
@@ -0,0 +1,2 @@
+in Input input_tbl_content.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.yql
new file mode 100644
index 0000000000..ce4c782796
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/LengthOverMrTableContentInsideMap.yql
@@ -0,0 +1,20 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let r (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline))))
+
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let len (Length (Right! r)))
+ (let key (Member item 'key))
+ (let key (Coalesce (Cast key 'Uint64) (Uint64 '0)))
+ (return (ListIf (> key len) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MapNextWithUnusedNext.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MapNextWithUnusedNext.yql
new file mode 100644
index 0000000000..06f26563b3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MapNextWithUnusedNext.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let lst (AsList (Int32 '0) (Int32 '1) (Int32 '2) (Int32 '3)))
+(let lst (Iterator lst))
+(let lst (MapNext lst (lambda '(current next) (+ current (Int32 '1)))))
+(let lst (ForwardList lst))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) lst '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.cfg
new file mode 100644
index 0000000000..a3547c5df6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.yql
new file mode 100644
index 0000000000..800f3c5a9e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MapThenSortWithLimit.yql
@@ -0,0 +1,37 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"value" '"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (Filter core (lambda '(row) (Coalesce ("<" (Member row '"value") (String '"f")) (Bool 'false)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"key" (Member row '"key")))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return core)
+)
+))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"key"))))
+ (let select (Take select (Uint64 '"2")))
+ (return select)
+)
+))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"key")))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+)
+))
+ (return world)
+)
+))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverFlattenMembers.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverFlattenMembers.yql
new file mode 100644
index 0000000000..6d4866a169
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverFlattenMembers.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let myStruct1 (AsStruct '('a (String 'z))))
+(let myStruct2 (AsStruct '('b (String 'y))))
+(let flatten (FlattenMembers '('"first_" myStruct1) '('"second_" myStruct2)))
+(let world (Write! world res_sink (Key) flatten '('('type))))
+(let world (Write! world res_sink (Key) (Member flatten 'first_a) '('('type))))
+(let add (AddMember flatten 'c (String 'x)))
+(let world (Write! world res_sink (Key) add '('('type))))
+(let world (Write! world res_sink (Key) (Member add 'second_b) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverJustOrNothingWithNulls.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverJustOrNothingWithNulls.yql
new file mode 100644
index 0000000000..af913733b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MemberOverJustOrNothingWithNulls.yql
@@ -0,0 +1,13 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let myStruct (AsStruct '('a (String 'z)) '('b (Null))))
+(let typeOfMyStruct (TypeOf myStruct))
+
+(let world (Write! world res_sink (Key) (Member (Just myStruct) 'b) '('('type))))
+(let world (Write! world res_sink (Key) (Member (Nothing (OptionalType typeOfMyStruct)) 'b) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverConstSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverConstSort.yql
new file mode 100644
index 0000000000..94385fb383
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverConstSort.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Sort list1 (Bool 'true) (lambda '(row) (String 'const_key))))
+(let list1 (ExtractMembers list1 '('c)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverExtend.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverExtend.yql
new file mode 100644
index 0000000000..48bd5bd276
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverExtend.yql
@@ -0,0 +1,17 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import id_module '"/lib/yql/id.yql")
+(let id (bind id_module 'id))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (Apply id (AsList str1 str2)))
+(let list1 (Extend list1 list1))
+(let list1 (ExtractMembers list1 '('a)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverMapNext.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverMapNext.yql
new file mode 100644
index 0000000000..72a41ec35c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverMapNext.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Iterator table1))
+(let table1 (MapNext table1 (lambda '(current next) (AsStruct
+ '('ks '((Member current 'key) (Member next 'subkey)))
+ '('sv '((Member current 'subkey) (Member next 'value)))
+ ))))
+
+(let table1 (ForwardList table1))
+
+(let table1 (OrderedMap table1 (lambda '(row) (AsStruct
+ '('sv (Member row 'sv))
+ ))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSkip.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSkip.yql
new file mode 100644
index 0000000000..5345f0b143
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSkip.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Skip list1 (Uint64 '1)))
+(let list1 (ExtractMembers list1 '('a)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort.yql
new file mode 100644
index 0000000000..46aec084d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Sort list1 (Bool 'true) (lambda '(row) (Member row 'a))))
+(let list1 (ExtractMembers list1 '('a)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort1.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort1.yql
new file mode 100644
index 0000000000..a7c9bb7e78
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort1.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Sort list1 (Bool 'true) (lambda '(row) (Member row 'b))))
+(let list1 (ExtractMembers list1 '('b)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort2.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort2.yql
new file mode 100644
index 0000000000..d3988b8ebb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverSort2.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Sort list1 (Bool 'true) (lambda '(row) (Member row 'b))))
+(let list1 (ExtractMembers list1 '('b 'c)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverTake.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverTake.yql
new file mode 100644
index 0000000000..713a57a0fd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MoveExtractMembersOverTake.yql
@@ -0,0 +1,14 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let str1 (AsStruct '('a (Uint32 '1)) '('b (String 'a)) '('c (Bool 'true))))
+(let str2 (AsStruct '('a (Uint32 '2)) '('b (String 'b)) '('c (Bool 'false))))
+(let list1 (AsList str1 str2))
+(let list1 (Take list1 (Uint64 '1)))
+(let list1 (ExtractMembers list1 '('a)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) list1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.cfg
new file mode 100644
index 0000000000..64df516e6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.sql
new file mode 100644
index 0000000000..3e7b24508a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.sql
@@ -0,0 +1,13 @@
+$aggregated = (
+ SELECT Group, Name, SUM(Amount) AS TotalAmount
+ FROM plato.Input1
+ GROUP BY Group, Name
+);
+
+SELECT t.Comment, a.TotalAmount
+FROM plato.Input1 AS t
+INNER JOIN $aggregated AS a
+ON t.Group == a.Group AND t.Name == a.Name
+ORDER BY t.Comment, a.TotalAmount;
+
+SELECT TotalAmount FROM $aggregated ORDER BY TotalAmount;
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.yql
new file mode 100644
index 0000000000..c744fafa76
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/MultiExtractMembersOverReadTable.yql
@@ -0,0 +1,83 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1")))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table1 '"t") '((block '(
+ (let select (block '(
+ (let core table1)
+ (let core (Aggregate core '('"Group" '"Name") '('('Sum0 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"Amount")))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"Group" (Member row '"Group")) '('"Name" (Member row '"Name")) '('"TotalAmount" (Member row 'Sum0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"a") '('Inner '"t" '"a" '('"t" '"Group" '"t" '"Name") '('"a" '"Group" '"a" '"Name") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"t.Comment" (SqlColumn row '"Comment" '"t")) '('"a.TotalAmount" (SqlColumn row '"TotalAmount" '"a"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row '"t.Comment") (Member row '"a.TotalAmount")))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"t.Comment" '"a.TotalAmount")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input1")))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (block '(
+ (let select (block '(
+ (let core table1)
+ (let core (Aggregate core '('"Group" '"Name") '('('Sum0 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Member row '"Amount")))))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"Group" (Member row '"Group")) '('"Name" (Member row '"Name")) '('"TotalAmount" (Member row 'Sum0))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"TotalAmount" (Member row '"TotalAmount"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (let select (Sort select (Bool 'true) (lambda '(row) (Member row '"TotalAmount"))))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"TotalAmount")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/NonEquivNestedLambdaOuterSameLevel.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/NonEquivNestedLambdaOuterSameLevel.yql
new file mode 100644
index 0000000000..61f9307f1a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/NonEquivNestedLambdaOuterSameLevel.yql
@@ -0,0 +1,28 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let outLambda1 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'b)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let outLambda2 (lambda '(sep) (block '(
+ (let data (AsList (String 'a) (String 'c)))
+ (let data1 (Map data (lambda '(x) (Concat x sep))))
+ (let res data1)
+ (return res)
+))))
+
+(let predicate (== (Int32 '1) (Int32 '2)))
+(let sep (If predicate (Just (String '_)) (Just (String '+))))
+(let data1 (IfPresent sep outLambda1 (AsList (String 'none))))
+(let data2 (IfPresent sep outLambda2 (AsList (String 'none))))
+(let world (Write! world res_sink (Key) '(data1 data2) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.cfg
new file mode 100644
index 0000000000..bc0dfe8e18
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.cfg
@@ -0,0 +1,4 @@
+in Input SomeKeys.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.yql
new file mode 100644
index 0000000000..a245de4f18
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionByWithInnerSort.yql
@@ -0,0 +1,72 @@
+(
+ # prepare python udf
+ (let str (DataType 'String))
+ (let tupleType (TupleType str str))
+ (let udfType (CallableType '() '(tupleType) '(str) '(str)))
+ (let udfScript (String '@@
+def MyTuple(one, two):
+ return (one, two)
+
+@@))
+ (let udf (ScriptUdf 'Python 'MyTuple udfType udfScript))
+
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let singleKeySelector (lambda '(x) (Member x 'key)))
+ (let multiKeySelector (lambda '(x) '((Member x 'key) (Member x 'subkey))))
+ (let tupleKeySelector (lambda '(x) (Apply udf (Member x 'key) (Member x 'subkey))))
+ (let calcKeySelector (lambda '(x) (Concat (Member x 'key) (Member x 'subkey))))
+
+ (let singleDirAsc (Bool 'true))
+ (let singleDirDesc (Bool 'false))
+ (let multiDirAsc '((Bool 'true) (Bool 'true)))
+ (let multiDirDesc '((Bool 'false) (Bool 'false)))
+
+ (let singleSortKeySelector (lambda '(item) (Member item 'subkey)))
+ (let multiSortKeySelector (lambda '(item) '((Member item 'subkey) (Member item 'value))))
+ (let tupleSortKeySelector (lambda '(item) (Apply udf (Member item 'subkey) (Member item 'value))))
+ (let calcSortKeySelector (lambda '(item) (Concat (Member item 'subkey) (Member item 'value))))
+
+ (let res_sink (DataSink 'result))
+
+ (let macro (lambda '(world keySelector sortDir sortKeySelector) (block '(
+ (let res (PartitionByKey table1 keySelector sortDir sortKeySelector (lambda '(stream) (FlatMap stream (lambda '(pair) (Nth pair '1))))))
+ (let res (Sort res '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+ (let world (Write! world res_sink (Key) res '()))
+ (return world)
+ ))))
+
+ (let world (Apply macro world singleKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world singleKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world singleKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world multiKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world multiKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world multiKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world tupleKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world calcKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world calcKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world calcKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Commit! world res_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.cfg
new file mode 100644
index 0000000000..bc0dfe8e18
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.cfg
@@ -0,0 +1,4 @@
+in Input SomeKeys.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.yql
new file mode 100644
index 0000000000..dda6bd8d62
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PartitionsByWithInnerSort.yql
@@ -0,0 +1,72 @@
+(
+ # prepare python udf
+ (let str (DataType 'String))
+ (let tupleType (TupleType str str))
+ (let udfType (CallableType '() '(tupleType) '(str) '(str)))
+ (let udfScript (String '@@
+def MyTuple(one, two):
+ return (one, two)
+
+@@))
+ (let udf (ScriptUdf 'Python3 'MyTuple udfType udfScript))
+
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let singleKeySelector (lambda '(x) (Member x 'key)))
+ (let multiKeySelector (lambda '(x) '((Member x 'key) (Member x 'subkey))))
+ (let tupleKeySelector (lambda '(x) (Apply udf (Member x 'key) (Member x 'subkey))))
+ (let calcKeySelector (lambda '(x) (Concat (Member x 'key) (Member x 'subkey))))
+
+ (let singleDirAsc (Bool 'true))
+ (let singleDirDesc (Bool 'false))
+ (let multiDirAsc '((Bool 'true) (Bool 'true)))
+ (let multiDirDesc '((Bool 'false) (Bool 'false)))
+
+ (let singleSortKeySelector (lambda '(item) (Member item 'subkey)))
+ (let multiSortKeySelector (lambda '(item) '((Member item 'subkey) (Member item 'value))))
+ (let tupleSortKeySelector (lambda '(item) (Apply udf (Member item 'subkey) (Member item 'value))))
+ (let calcSortKeySelector (lambda '(item) (Concat (Member item 'subkey) (Member item 'value))))
+
+ (let res_sink (DataSink 'result))
+
+ (let macro (lambda '(world keySelector sortDir sortKeySelector) (block '(
+ (let res (PartitionsByKeys table1 keySelector sortDir sortKeySelector (lambda '(stream) stream)))
+ (let res (Sort res '((Bool 'true) (Bool 'true)) (lambda '(item) '((Member item 'key) (Member item 'subkey)))))
+ (let world (Write! world res_sink (Key) res '()))
+ (return world)
+ ))))
+
+ (let world (Apply macro world singleKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world singleKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world singleKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world singleKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world multiKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world multiKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world multiKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world multiKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world tupleKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world tupleKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world tupleKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Apply macro world calcKeySelector singleDirAsc singleSortKeySelector))
+ (let world (Apply macro world calcKeySelector singleDirDesc singleSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirAsc multiSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirDesc multiSortKeySelector))
+ (let world (Apply macro world calcKeySelector multiDirAsc tupleSortKeySelector))
+ (let world (Apply macro world calcKeySelector singleDirAsc calcSortKeySelector))
+
+ (let world (Commit! world res_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilter.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilter.yql
new file mode 100644
index 0000000000..262c788d71
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilter.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+#(let table1 (AsList (AsStruct '('key (String '100)))))
+(let table2 (Filter table1 (lambda '(x) (< (Member x 'key) (String '800)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '('('take '2))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilterRef.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilterRef.yql
new file mode 100644
index 0000000000..a96ce7edcf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PullLimitAfterFilterRef.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+#(let table1 (AsList (AsStruct '('key (String '100)))))
+(let table2 (Filter table1 (lambda '(x) (< (Member x 'key) (String '800)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '('('take '2) '('autoref))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/PushDownToFlow.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/PushDownToFlow.yql
new file mode 100644
index 0000000000..cf614d25ca
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/PushDownToFlow.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'x) (String 'c) (String 'e) (String 'a) (String 'z) (String 'y) (String 'f)))
+(let data (Reverse data))
+(let data (Skip data (Uint64 '2)))
+(let data (Take data (Uint64 '3)))
+(let data (OrderedMap data (lambda '(x) '(x x))))
+(let data (ToFlow data))
+(let data (Collect data))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/ReverseAfterSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/ReverseAfterSort.yql
new file mode 100644
index 0000000000..f4ca885270
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/ReverseAfterSort.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'c) (String 'e) (String 'a)))
+(let data (Sort data (Bool 'true) (lambda '(x) x)))
+(let data (Reverse data))
+(let world (Write! world res_sink (Key) data '()))
+(let data (AsList '((Uint32 '1) (String 'c)) '((Uint32 '1) (String 's)) '((Uint32 '2) (String 'a))))
+(let data (Sort data '((Bool 'true) (Bool 'false)) (lambda '(x) x)))
+(let data (Reverse data))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelectMembersOverOptStruct.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SelectMembersOverOptStruct.yql
new file mode 100644
index 0000000000..b9e3b2373c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelectMembersOverOptStruct.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Map ("/" (Int32 '42) (Int32 '1)) (lambda '(item) (AsStruct
+ '('magic (Just item))
+ '('black_magic ("/" (Int32 '100) item))
+ ))))
+
+(let table1 (SelectMembers table1 '('m)))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.cfg
new file mode 100644
index 0000000000..e6d9edcc5d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.cfg
@@ -0,0 +1,2 @@
+in Input InputUniq.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.sql
new file mode 100644
index 0000000000..127c25a4d5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+$a = (SELECT key,subkey || "a" as subkey from Input where value < "r");
+$b = (SELECT key,subkey || "b" as subkey from Input where value > "c");
+select a.key as k1,a.subkey,b.subkey from $a as a join $b as b using (key);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.yql
new file mode 100644
index 0000000000..3770df6de5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersect.yql
@@ -0,0 +1,57 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"value" '"key" '"subkey") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (Filter core (lambda '(row) (Coalesce ("<" (Member row '"value") (String '"r")) (Bool 'false)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Member row '"key")) '('"subkey" ("Concat" (Member row '"subkey") (String '"a")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"a") '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (Filter core (lambda '(row) (Coalesce (">" (Member row '"value") (String '"c")) (Bool 'false)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Member row '"key")) '('"subkey" ("Concat" (Member row '"subkey") (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"k1" (SqlColumn row '"key" '"a")) '('"a.subkey" (SqlColumn row '"subkey" '"a")) '('"b.subkey" (SqlColumn row '"subkey" '"b"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"k1" '"a.subkey" '"b.subkey")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.cfg
new file mode 100644
index 0000000000..e6d9edcc5d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.cfg
@@ -0,0 +1,2 @@
+in Input InputUniq.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.sql b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.sql
new file mode 100644
index 0000000000..944f3c386f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+$a = (SELECT key,subkey || "a" as subkey from Input where value < "r");
+$b = (SELECT key,subkey || "b" as subkey from Input);
+select a.key as k1,a.subkey,b.subkey from Input as a join $b as b using (key);
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.yql
new file mode 100644
index 0000000000..45e75bf7d7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SelfJoinIntersectTab1.yql
@@ -0,0 +1,44 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) '('"key" '"subkey") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core (EquiJoin '(table0 '"a") '((block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"key" (Member row '"key")) '('"subkey" ("Concat" (Member row '"subkey") (String '"b")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )) '"b") '('Inner '"a" '"b" '('"a" '"key") '('"b" '"key") '()) '()))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"k1" (SqlColumn row '"key" '"a")) '('"a.subkey" (SqlColumn row '"subkey" '"a")) '('"b.subkey" (SqlColumn row '"subkey" '"b"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"k1" '"a.subkey" '"b.subkey")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipAfterMap.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipAfterMap.yql
new file mode 100644
index 0000000000..fbc9dc1ba4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipAfterMap.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Map table1 (lambda '(x) (AddMember x 'foo (String 'qwe)))))
+(let table1 (Skip table1 (Uint64 '2)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipOverExtend.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipOverExtend.yql
new file mode 100644
index 0000000000..3ec439ddde
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipOverExtend.yql
@@ -0,0 +1,18 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let list2 (AsList (String 'd) (String 'e) (String 'f)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ (Skip (Extend list1 list2) (Uint64 '1)) '()))
+
+(let world (Write! world res_sink
+ (Key)
+ (Skip (Extend list1 list2) (Uint64 '5)) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.cfg
new file mode 100644
index 0000000000..bf54cfd5be
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.cfg
@@ -0,0 +1,2 @@
+in Input input_tbl_content.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.yql
new file mode 100644
index 0000000000..d51db8e508
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContent.yql
@@ -0,0 +1,17 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let r (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline))))
+ (let table1 (Right! r))
+ (let table1 (Skip table1 (Uint64 '5)))
+ (let table1 (Take table1 (Uint64 '3)))
+ (let tresh (String '300))
+ (let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (Member item 'key))
+ (return (ListIf (< intValueOpt tresh) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.cfg
new file mode 100644
index 0000000000..bf54cfd5be
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.cfg
@@ -0,0 +1,2 @@
+in Input input_tbl_content.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.yql
new file mode 100644
index 0000000000..5bfc63445e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipTakeOverMrTableContentInsideMap.yql
@@ -0,0 +1,27 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let r (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline))))
+ (let mrtc (Right! r))
+ (let mrtc (Skip mrtc (Uint64 '5)))
+ (let mrtc (Take mrtc (Uint64 '3)))
+ (let mrtc (FlatMap mrtc (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (ListIf (> key (String '100)) item))
+ )))))
+ (let filter (ToDict mrtc (lambda '(x) (Member x 'key)) (lambda '(x) (Member x 'value)) '('Hashed 'One)))
+
+ (let tresh (String '500))
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (ListIf (And (< key tresh) (Contains filter key)) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SkipWhileOverLiterals.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipWhileOverLiterals.yql
new file mode 100644
index 0000000000..e661d70dde
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SkipWhileOverLiterals.yql
@@ -0,0 +1,44 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let listVal (AsList (Int32 '0)))
+(let listVal (Append listVal (Int32 '1)))
+
+(let emptyList (List (ListType (DataType 'Int32))))
+(let emptyStream (EmptyIterator (StreamType (DataType 'Int32))))
+(let emptyOptional (Nothing (OptionalType (DataType 'Int32))))
+
+(let notOptLambda (lambda '(x) (< x (Int32 '1))))
+
+# Skip while true: []
+(let res (SkipWhile listVal (lambda '(x) (Bool 'true))))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Skip while false: [0, 1]
+(let res (SkipWhile listVal (lambda '(x) (Bool 'false))))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Skip from empty list: []
+(let res (SkipWhile emptyList notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Skip from empty stream: []
+(let res (SkipWhile emptyStream notOptLambda))
+(let res (Collect res))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Skip from empty optional: []
+(let res (SkipWhile emptyOptional notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# General case: [1]
+(let res (SkipWhile listVal notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt
new file mode 100644
index 0000000000..6d0b5b4d40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt
@@ -0,0 +1,7 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="075";"subkey"="2";"value"="abc2"};
+{"key"="075";"subkey"="3";"value"="abc3"};
+{"key"="800";"subkey"="4";"value"="ddd"};
+{"key"="020";"subkey"="5";"value"="q"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="150";"subkey"="7";"value"="zz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SomeKeys.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SortAfterReverse.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SortAfterReverse.yql
new file mode 100644
index 0000000000..21570ead7b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SortAfterReverse.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'c) (String 'e) (String 'a)))
+(let data (Reverse data))
+(let data (Sort data (Bool 'true) (lambda '(x) x)))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SortOfSortedDesc.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SortOfSortedDesc.yql
new file mode 100644
index 0000000000..3fbb12f446
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SortOfSortedDesc.yql
@@ -0,0 +1,24 @@
+(
+(let source (DataSource 'yt 'plato))
+(let sink (DataSink 'yt 'plato))
+(let result (DataSink 'result))
+
+(let r (Read! world source (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let out (Sort (FlatMap input (lambda '(item) (AsList item))) (Bool 'false) (lambda '(item) (Member item '"key"))))
+(let world (Write! world sink (Key '('table (String '"Output"))) out '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(let r (Read! world source (MrTableConcat (Key '('table (String '"Output")))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let out (Sort (FlatMap input (lambda '(item) (AsList item))) (Bool 'true) (lambda '(item) (Member item '"key"))))
+(let world (Write! world result (Key) out '('('type) '('autoref))))
+(let world (Commit! world result))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SubsetOfFields.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SubsetOfFields.yql
new file mode 100644
index 0000000000..f4d4e775d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SubsetOfFields.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let item (RemoveMember item 'value))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '"s1")))
+ (let s (AddMember s 'value (String '"v1")))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '('('inline))))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let item (RemoveMember item 'value))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '"s2")))
+ (let s (AddMember s 'value (String '"v2")))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/SwitchToVisit.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/SwitchToVisit.yql
new file mode 100644
index 0000000000..b703492435
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/SwitchToVisit.yql
@@ -0,0 +1,73 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let list (AsList
+ (AsStruct '('key (String 'aaa)) '('value (String '0)))
+ (AsStruct '('key (String 'bbb)) '('value (String '1)))
+ (AsStruct '('key (String 'ccc)) '('value (String '2)))
+))
+
+(let structType (StructType '('key (DataType 'String)) '('value (DataType 'String))))
+(let tupleType (TupleType structType structType structType))
+(let vt (VariantType tupleType))
+(let vlist (AsList
+ (Variant (AsStruct '('key (String 'aaa)) '('value (String '0))) '0 vt)
+ (Variant (AsStruct '('key (String 'bbb)) '('value (String '1))) '1 vt)
+ (Variant (AsStruct '('key (String 'ccc)) '('value (String '2))) '2 vt)
+))
+
+(let trivialLambda (lambda '(x) x))
+(let justHandler1 (lambda '(x) (FlatMap x (lambda '(s) (Just (AsStruct '('key (Concat (String '"#0: ") (Member s 'key))) '('value (Member s 'value))))))))
+(let justHandler2 (lambda '(x) (FlatMap x (lambda '(s) (Just (AsStruct '('key (Concat (String '"#1: ") (Member s 'key))) '('value (Member s 'value))))))))
+(let justHandler3 (lambda '(x) (FlatMap x (lambda '(s) (Just (AsStruct '('key (Concat (String '"#3: ") (Member s 'key))) '('value (Member s 'value))))))))
+(let extractMembersHandler (lambda '(x) (FlatMap (ExtractMembers x '('key)) (lambda '(s) (Just (AsStruct '('key (Concat (String '"#3: ") (Member s 'key)))))))))
+(let listHandler (lambda '(x) (FlatMap x (lambda '(s) (AsList s s)))))
+(let streamHandler (lambda '(x) (FlatMap x (lambda '(s) (Iterator (AsList s s) (DependsOn s) (DependsOn (String '0)))))))
+(let justVarHandler1 (lambda '(x) (FlatMap x (lambda '(s) (Just (Variant s '1 vt))))))
+(let justVarHandler2 (lambda '(x) (FlatMap x (lambda '(s) (Just (Variant s '2 vt))))))
+
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A1))) '1 '('1) trivialLambda)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A2))) '1 '('0) justHandler1)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A3))) '1 '('0) listHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A4))) '1 '('0) streamHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A5))) '1 '('0) justVarHandler1)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'A6))) '1 '('0) extractMembersHandler)) '('('type))))
+
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B1))) '1 '('0) justHandler1 '('1) justHandler2)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B2))) '1 '('0) justHandler1 '('1) justHandler2 '('2) justHandler3)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B3))) '1 '('0) justHandler1 '('1) trivialLambda)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B4))) '1 '('0) justHandler1 '('1) extractMembersHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B5))) '1 '('0) justHandler1 '('1) justHandler2 '('1) justHandler3 '('2) justHandler3)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B6))) '1 '('0) justHandler1 '('1) justHandler2 '('1) justHandler3)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B7))) '1 '('0) justHandler1 '('0) justHandler2)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B8))) '1 '('0) justHandler1 '('1) justHandler2 '('1) streamHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B9))) '1 '('0) justHandler1 '('1) extractMembersHandler '('1) streamHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B10))) '1 '('0) justHandler1 '('1) listHandler '('1) streamHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B11))) '1 '('0) justHandler1 '('1) listHandler '('1) trivialLambda)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'B12))) '1 '('0) justHandler1 '('1) trivialLambda '('1) trivialLambda)) '('('type))))
+
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'C1))) '1 '('0) justHandler1 '('1) listHandler '('2) trivialLambda)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'C2))) '1 '('0) streamHandler '('1) listHandler '('2) trivialLambda)) '('('type))))
+
+# Shouldn't be optimized
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'D1))) '1 '('0) justVarHandler1 '('1) justVarHandler2)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator vlist (DependsOn (String 'D2))) '1 '('0) justHandler1 '('1) justVarHandler2)) '('('type))))
+
+# Replicating Switch
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E1))) '1 '('0) trivialLambda)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E2))) '1 '('0) justVarHandler1)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E3))) '1 '('0) trivialLambda '('0) justHandler1 '('0) justHandler2)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E4))) '1 '('0) justHandler1 '('0) extractMembersHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E5))) '1 '('0) trivialLambda '('0) justHandler1 '('0) listHandler)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'E6))) '1 '('0) streamHandler '('0) listHandler)) '('('type))))
+
+# Shouldn't be optimized
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'F1))) '1 '('0) justVarHandler1 '('0) justVarHandler2)) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Switch (Iterator list (DependsOn (String 'F2))) '1 '('0) justHandler1 '('0) justVarHandler2)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeAfterMap.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeAfterMap.yql
new file mode 100644
index 0000000000..41df996fee
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeAfterMap.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Map table1 (lambda '(x) (AddMember x 'foo (String 'qwe)))))
+(let table1 (Take table1 (Uint64 '2)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.cfg
new file mode 100644
index 0000000000..80d5638bff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.cfg
@@ -0,0 +1,3 @@
+in Input SomeKeys.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.yql
new file mode 100644
index 0000000000..b263c72063
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterCombine.yql
@@ -0,0 +1,30 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let init (lambda '(key item) (FromString (Member item 'subkey) 'Uint32)))
+(let update (lambda '(key item state) (+ state (FromString (Member item 'subkey) 'Uint32))))
+(let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Coalesce (Map state (lambda '(x) (ToString x))) (String '""))))
+ (return (Just s))
+))))
+
+(let table2 (CombineByKey table1 preMap keyExtractor init update finish))
+(let table2 (Take table2 (Uint64 '2)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterFilter.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterFilter.yql
new file mode 100644
index 0000000000..e161a11ee5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterFilter.yql
@@ -0,0 +1,23 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Filter table1 (lambda '(x) (< (Member x 'key) (String '800)))))
+(let table2x (Skip (Take table1 (Uint64 '2)) (Uint64 '1)))
+(let table2y (Take table1 (Uint64 '3)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2x '()))
+
+(let world (Write! world res_sink
+ (Key)
+ table2y '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.cfg
new file mode 100644
index 0000000000..80d5638bff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.cfg
@@ -0,0 +1,3 @@
+in Input SomeKeys.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.yql
new file mode 100644
index 0000000000..d0fa6fb1dd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterGroup.yql
@@ -0,0 +1,34 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let handler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let f (Fold list (Uint64 '0) (lambda '(item state) (block '(
+ (let value (Coalesce (FromString (Member item 'subkey) 'Uint64) (Uint64 '0)))
+ (return (+ value state))
+ )))))
+ (let s (AddMember s 'value (ToString f)))
+ (return (Just s))
+))))))
+
+(let table2 (PartitionByKey table1 keyExtractor (Void) (Void) handler))
+(let table2 (Take table2 (Uint64 '4)))
+(let table2 (Sort table2 (Bool 'true) (lambda '(item) (Member item 'value))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterSort.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterSort.yql
new file mode 100644
index 0000000000..107a53b598
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeLimitAfterSort.yql
@@ -0,0 +1,19 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let table2 (Sort table1 (Bool 'true) keyExtractor))
+(let table2 (Take table2 (Uint64 '2)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table2 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverExtend.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverExtend.yql
new file mode 100644
index 0000000000..e7b12fc1c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverExtend.yql
@@ -0,0 +1,18 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let list1 (AsList (String 'a) (String 'b) (String 'c)))
+(let list2 (AsList (String 'd) (String 'e) (String 'f)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ (Take (Extend list1 list2) (Uint64 '1)) '()))
+
+(let world (Write! world res_sink
+ (Key)
+ (Take (Extend list1 list2) (Uint64 '5)) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverTop.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverTop.yql
new file mode 100644
index 0000000000..ad245012d0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeOverTop.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (String 'x) (String 'c) (String 'e) (String 'a) (String 'z) (String 'y) (String 'f)))
+(let data (Top data (Uint64 '4) (Bool 'true) (lambda '(x) x)))
+(let data (Take data (Uint64 '2)))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/TakeWhileOverLiterals.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeWhileOverLiterals.yql
new file mode 100644
index 0000000000..bc2bdb9037
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/TakeWhileOverLiterals.yql
@@ -0,0 +1,44 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+
+(let listVal (AsList (Int32 '0)))
+(let listVal (Append listVal (Int32 '1)))
+
+(let emptyList (List (ListType (DataType 'Int32))))
+(let emptyStream (EmptyIterator (StreamType (DataType 'Int32))))
+(let emptyOptional (Nothing (OptionalType (DataType 'Int32))))
+
+(let notOptLambda (lambda '(x) (< x (Int32 '1))))
+
+# Take while true: [0, 1]
+(let res (TakeWhile listVal (lambda '(x) (Bool 'true))))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Take while false: []
+(let res (TakeWhile listVal (lambda '(x) (Bool 'false))))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Take from empty list: []
+(let res (TakeWhile emptyList notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Take from empty stream: []
+(let res (TakeWhile emptyStream notOptLambda))
+(let res (Collect res))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# Take from empty optional: []
+(let res (TakeWhile emptyOptional notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+# General case: [0]
+(let res (TakeWhile listVal notOptLambda))
+(let world (Write! world res_sink (Key) res '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Top.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Top.yql
new file mode 100644
index 0000000000..e0a2bab036
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Top.yql
@@ -0,0 +1,42 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+
+(let list (AsList
+ (AsStruct '('a (Uint32 '4)) '('b (String 'c)))
+ (AsStruct '('a (Uint32 '1)) '('b (String 'd)))
+ (AsStruct '('a (Uint32 '3)) '('b (String 'b)))
+))
+
+# Top->Take
+(let world (Write! world res_sink (Key) (Top table (Uint64 '3) '() (lambda '(item) '())) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort table (Uint64 '3) '() (lambda '(item) '())) '('('type))))
+
+# tuple with single item
+(let world (Write! world res_sink (Key) (Top table (Uint64 '3) '((Bool 'True)) (lambda '(item) '((Member item 'key)))) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort table (Uint64 '3) '((Bool 'True)) (lambda '(item) '((Member item 'key)))) '('('type))))
+
+# zero count
+(let world (Write! world res_sink (Key) (Top table (Uint64 '0) (Bool 'True) (lambda '(item) (Member item 'key))) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort table (Uint64 '0) (Bool 'True) (lambda '(item) (Member item 'key))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (Top (Iterator table (DependsOn (String 'a))) (Uint64 '0) (Bool 'True) (lambda '(item) (Member item 'key)))) '('('type))))
+(let world (Write! world res_sink (Key) (Collect (TopSort (Iterator table (DependsOn (String 'b))) (Uint64 '0) (Bool 'True) (lambda '(item) (Member item 'key)))) '('('type))))
+
+# list <= N
+(let world (Write! world res_sink (Key) (Top list (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'a))) '('('type))))
+(let world (Write! world res_sink (Key) (TopSort list (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'a))) '('('type))))
+
+# ExtractMembers
+(let world (Write! world res_sink (Key) (ExtractMembers (Top table (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'key))) '('key 'value)) '('('type))))
+(let world (Write! world res_sink (Key) (ExtractMembers (TopSort table (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'key))) '('key 'value)) '('('type))))
+(let world (Write! world res_sink (Key) (ExtractMembers (Top table (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'key))) '('value)) '('('type))))
+(let world (Write! world res_sink (Key) (ExtractMembers (TopSort table (Uint64 '3) (Bool 'True) (lambda '(item) (Member item 'key))) '('value)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedDesc.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedDesc.yql
new file mode 100644
index 0000000000..b1de8fceb1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedDesc.yql
@@ -0,0 +1,20 @@
+(
+(let source (DataSource 'yt 'plato))
+(let sink (DataSink 'yt 'plato))
+
+(let r (Read! world source (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let mapLambda (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key"))))))
+(let keyExtractLambda (lambda '(item) (Member item '"key")))
+
+(let out1 (Sort (FlatMap input mapLambda) (Bool 'false) keyExtractLambda))
+(let out2 (Sort (FlatMap input mapLambda) (Bool 'false) keyExtractLambda))
+(let union (UnionAll (Take out1 (Int32 '"3")) (Take out2 (Int32 '"2"))))
+
+(let world (Write! world sink (Key '('table (String '"Output"))) union '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedMix.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedMix.yql
new file mode 100644
index 0000000000..cbe8c2bb5e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/UnionOfSortedMix.yql
@@ -0,0 +1,20 @@
+(
+(let source (DataSource 'yt 'plato))
+(let sink (DataSink 'yt 'plato))
+
+(let r (Read! world source (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
+(let input (Right! r))
+(let world (Left! r))
+
+(let mapLambda (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key"))))))
+(let keyExtractLambda (lambda '(item) (Member item '"key")))
+
+(let out1 (Sort (FlatMap input mapLambda) (Bool 'false) keyExtractLambda))
+(let out2 (Sort (FlatMap input mapLambda) (Bool 'true) keyExtractLambda))
+(let union (UnionAll (Take out1 (Int32 '"3")) (Take out2 (Int32 '"2"))))
+
+(let world (Write! world sink (Key '('table (String '"Output"))) union '('('mode 'renew))))
+(let world (Commit! world sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/UnusedColumnsAfterTake.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/UnusedColumnsAfterTake.yql
new file mode 100644
index 0000000000..65f43e76db
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/UnusedColumnsAfterTake.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let table1 (Take table1 (Uint64 '2)))
+(let table1 (Map table1 (lambda '(x) (AsStruct '('key (Member x 'key))))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1 '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/UseEmptyDict.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/UseEmptyDict.yql
new file mode 100644
index 0000000000..6f5b78d34e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/UseEmptyDict.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let ed (Dict (DictType (DataType 'Int32) (DataType 'String))))
+(let data (Lookup ed (Int32 '0)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (Contains ed (Int32 '0)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (DictItems ed))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (DictKeys ed))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let data (DictPayloads ed))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/VariantItemOverVisit.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/VariantItemOverVisit.yql
new file mode 100644
index 0000000000..76b605c271
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/VariantItemOverVisit.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+
+(let vt (VariantType (TupleType (DataType 'String) (DataType 'String) (DataType 'String))))
+(let v0 (Variant (String 'aaa) '0 vt))
+(let v1 (Variant (String 'bbb) '1 vt))
+(let v2 (Variant (String 'ccc) '2 vt))
+(let list (AsList v0 v1 v2))
+
+(let handler (lambda '(x) (Concat (String '0-) x)))
+
+(let remap (lambda '(x) (Visit x '0 (lambda '(x) (Variant x '1 vt)) '1 (lambda '(x) (Variant x '2 vt)) '2 (lambda '(x) (Variant x '0 vt)))))
+(let def (lambda '(x) (Visit x '0 (lambda '(x) (Variant (Apply handler x) '0 vt)) v1)))
+
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (VariantItem (Apply remap x)))) '('('type))))
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (VariantItem (Apply def x)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/Visit1.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/Visit1.yql
new file mode 100644
index 0000000000..8c8c4f7726
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/Visit1.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32))))
+(let v1 (Variant (Int32 '34) '0 vt))
+
+(let handler (lambda '(x) (+ (Int32 '100) x)))
+
+(let world (Write! world res_sink (Key) (Visit v1 '0 handler) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 '0 handler (Int32 '999)) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+
+(let world (Write! world res_sink (Key) (Visit v1 'a handler) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 'a handler (Int32 '999)) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAllEqualLambdas.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAllEqualLambdas.yql
new file mode 100644
index 0000000000..5f7b186e37
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAllEqualLambdas.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'String) (DataType 'String) (DataType 'String))))
+(let v0 (Variant (String 'aaa) '0 vt))
+(let v1 (Variant (String 'bbb) '1 vt))
+(let v2 (Variant (String 'ccc) '2 vt))
+(let list (AsList v0 v1 v2))
+
+(let handler0 (lambda '(x) (Concat (String '0-) x)))
+(let handler1 (lambda '(x) (Concat (String '0-) x)))
+(let handler2 (lambda '(x) (Concat (String '0-) x)))
+
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (Visit x '0 handler0 '1 handler1 '2 handler2))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAsGuess.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAsGuess.yql
new file mode 100644
index 0000000000..271b065f4a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitAsGuess.yql
@@ -0,0 +1,40 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let vt (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let v1 (Variant (Int32 '34) '0 vt))
+(let v2 (Variant (String 'qwe) '1 vt))
+
+(let handler (lambda '(x) (Just x)))
+(let listHandler (lambda '(x) (AsList x)))
+
+(let world (Write! world res_sink (Key) (Visit v1 '0 handler (Nothing (OptionalType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 '1 handler (Nothing (OptionalType (DataType 'String)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '0 handler (Nothing (OptionalType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '1 handler (Nothing (OptionalType (DataType 'String)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (Visit v1 '0 listHandler (List (ListType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 '1 listHandler (List (ListType (DataType 'String)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '0 listHandler (List (ListType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 '1 listHandler (List (ListType (DataType 'String)))) '('('type))))
+
+(let vt (VariantType (StructType '('a (DataType 'Int32)) '('b (DataType 'String)))))
+(let v1 (Variant (Int32 '34) 'a vt))
+(let v2 (Variant (String 'qwe) 'b vt))
+
+(let world (Write! world res_sink (Key) (Visit v1 'a handler (Nothing (OptionalType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 'b handler (Nothing (OptionalType (DataType 'String)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'a handler (Nothing (OptionalType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'b handler (Nothing (OptionalType (DataType 'String)))) '('('type))))
+
+(let world (Write! world res_sink (Key) (Visit v1 'a listHandler (List (ListType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v1 'b listHandler (List (ListType (DataType 'String)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'a listHandler (List (ListType (DataType 'Int32)))) '('('type))))
+(let world (Write! world res_sink (Key) (Visit v2 'b listHandler (List (ListType (DataType 'String)))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/VisitOverVisit.yql b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitOverVisit.yql
new file mode 100644
index 0000000000..8a0197dd5e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/VisitOverVisit.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let vt3 (VariantType (TupleType (DataType 'String) (DataType 'String) (DataType 'String))))
+(let vt2 (VariantType (TupleType (DataType 'String) (DataType 'String))))
+(let v0 (Variant (String 'aaa) '0 vt3))
+(let v1 (Variant (String 'bbb) '1 vt3))
+(let v2 (Variant (String 'ccc) '2 vt3))
+(let list (AsList v0 v1 v2))
+
+(let handler0 (lambda '(x) (Concat (String '0-) x)))
+(let handler1 (lambda '(x) (Concat (String '1-) x)))
+(let handler2 (lambda '(x) (Concat (String '2-) x)))
+
+(let remap (lambda '(x) (Visit x '0 (lambda '(x) (Variant x '1 vt3)) '1 (lambda '(x) (Variant x '2 vt3)) '2 (lambda '(x) (Variant x '0 vt3)))))
+(let def (lambda '(x) (Visit x '0 (lambda '(x) (Variant (Apply handler0 x) '0 vt3)) v1)))
+(let reduce (lambda '(x) (Visit x '0 (lambda '(x) (Variant x '0 vt2)) '1 (lambda '(x) (Variant x '0 vt2)) '2 (lambda '(x) (Variant x '1 vt2)))))
+
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (Visit (Apply remap x) '0 handler0 '1 handler1 '2 handler2))) '('('type))))
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (Visit (Apply def x) '0 handler0 '1 handler1 (String 'def)))) '('('type))))
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (Visit (Apply def x) '0 handler0 (String 'def)))) '('('type))))
+(let world (Write! world res_sink (Key) (Map list (lambda '(x) (Visit (Apply reduce x) '0 handler0 '1 handler1))) '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/default.cfg b/yql/essentials/tests/s-expressions/suites/Optimizers/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt
new file mode 100644
index 0000000000..bd567557a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt
@@ -0,0 +1,19 @@
+{"Amount"=100;"Comment"="Test1";"Group"=1u;"Name"="Name1"};
+{"Amount"=101;"Comment"="Test1";"Group"=1u;"Name"="Name2"};
+{"Amount"=102;"Comment"="Test1";"Group"=1u;"Name"="Name3"};
+{"Amount"=103;"Comment"="Test1";"Group"=2u;"Name"="Name1"};
+{"Amount"=104;"Comment"="Test1";"Group"=3u;"Name"="Name3"};
+{"Amount"=105;"Comment"="Test1";"Group"=4u;"Name"="Name1"};
+{"Amount"=106;"Comment"="Test1";"Group"=4u;"Name"="Name4"};
+{"Amount"=107;"Comment"="Test1";"Group"=5u;"Name"="Name5"};
+{"Amount"=108;"Comment"="Test1";"Group"=6u;"Name"="Name1"};
+{"Amount"=109;"Comment"="Test1";"Group"=6u;"Name"="Name2"};
+{"Amount"=100;"Comment"="Test3";"Group"=10u;"Name"="Name1"};
+{"Amount"=101;"Comment"="Test3";"Group"=10u;"Name"="Name2"};
+{"Amount"=102;"Comment"="Test3";"Group"=10u;"Name"="Name3"};
+{"Amount"=103;"Comment"="Test3";"Group"=10u;"Name"="Name4"};
+{"Amount"=104;"Comment"="Test3";"Group"=10u;"Name"="Name5"};
+{"Amount"=105;"Comment"="Test3";"Group"=10u;"Name"="Name6"};
+{"Amount"=100;"Comment"="Test2";"Group"=100001u;"Name"="Name1"};
+{"Amount"=102;"Comment"="Test2";"Group"=100002u;"Name"="Name2"};
+{"Amount"=103;"Comment"="Test2";"Group"=100003u;"Name"="Name1"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt.attr
new file mode 100644
index 0000000000..ffb9a19cab
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input1.txt.attr
@@ -0,0 +1,42 @@
+{
+ "_yql_row_spec" = {
+ "UniqueKeys"=%true;
+ "SortMembers"=["Group"; "Name"];
+ "SortedBy"=["Group"; "Name"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"Uint64"]; ["DataType";"String"]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "Group";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "Name";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "Amount";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "Comment";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt
new file mode 100644
index 0000000000..d1fa0973d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="aaa"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="ccc"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt
new file mode 100644
index 0000000000..045bc6bd14
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt
@@ -0,0 +1,200 @@
+{"key"="180";"subkey"="7";"value"="Value #44"};
+{"key"="178";"subkey"="17";"value"="Value #7"};
+{"key"="6";"subkey"="4";"value"="Value #1"};
+{"key"="53";"subkey"="19";"value"="Value #41"};
+{"key"="112";"subkey"="15";"value"="Value #14"};
+{"key"="121";"subkey"="11";"value"="Value #58"};
+{"key"="69";"subkey"="5";"value"="Value #49"};
+{"key"="142";"subkey"="3";"value"="Value #5"};
+{"key"="73";"subkey"="8";"value"="Value #33"};
+{"key"="52";"subkey"="14";"value"="Value #45"};
+{"key"="18";"subkey"="6";"value"="Value #40"};
+{"key"="141";"subkey"="16";"value"="Value #35"};
+{"key"="63";"subkey"="18";"value"="Value #12"};
+{"key"="5";"subkey"="13";"value"="Value #28"};
+{"key"="128";"subkey"="2";"value"="Value #56"};
+{"key"="48";"subkey"="12";"value"="Value #13"};
+{"key"="93";"subkey"="9";"value"="Value #20"};
+{"key"="49";"subkey"="0";"value"="Value #30"};
+{"key"="95";"subkey"="1";"value"="Value #34"};
+{"key"="159";"subkey"="10";"value"="Value #52"};
+{"key"="55";"subkey"="7";"value"="Value #15"};
+{"key"="7";"subkey"="17";"value"="Value #24"};
+{"key"="35";"subkey"="4";"value"="Value #51"};
+{"key"="82";"subkey"="19";"value"="Value #0"};
+{"key"="170";"subkey"="15";"value"="Value #26"};
+{"key"="150";"subkey"="11";"value"="Value #27"};
+{"key"="26";"subkey"="5";"value"="Value #54"};
+{"key"="58";"subkey"="3";"value"="Value #37"};
+{"key"="16";"subkey"="8";"value"="Value #46"};
+{"key"="166";"subkey"="14";"value"="Value #4"};
+{"key"="86";"subkey"="6";"value"="Value #16"};
+{"key"="101";"subkey"="16";"value"="Value #32"};
+{"key"="160";"subkey"="18";"value"="Value #39"};
+{"key"="199";"subkey"="13";"value"="Value #25"};
+{"key"="138";"subkey"="2";"value"="Value #6"};
+{"key"="96";"subkey"="12";"value"="Value #57"};
+{"key"="33";"subkey"="9";"value"="Value #21"};
+{"key"="9";"subkey"="0";"value"="Value #42"};
+{"key"="21";"subkey"="1";"value"="Value #55"};
+{"key"="176";"subkey"="10";"value"="Value #23"};
+{"key"="0";"subkey"="7";"value"="Value #18"};
+{"key"="66";"subkey"="17";"value"="Value #3"};
+{"key"="198";"subkey"="4";"value"="Value #22"};
+{"key"="186";"subkey"="19";"value"="Value #17"};
+{"key"="83";"subkey"="15";"value"="Value #2"};
+{"key"="179";"subkey"="11";"value"="Value #19"};
+{"key"="64";"subkey"="5";"value"="Value #38"};
+{"key"="56";"subkey"="3";"value"="Value #50"};
+{"key"="155";"subkey"="8";"value"="Value #43"};
+{"key"="143";"subkey"="14";"value"="Value #9"};
+{"key"="188";"subkey"="6";"value"="Value #8"};
+{"key"="172";"subkey"="16";"value"="Value #53"};
+{"key"="103";"subkey"="18";"value"="Value #11"};
+{"key"="44";"subkey"="13";"value"="Value #36"};
+{"key"="173";"subkey"="2";"value"="Value #10"};
+{"key"="133";"subkey"="12";"value"="Value #48"};
+{"key"="168";"subkey"="9";"value"="Value #29"};
+{"key"="157";"subkey"="0";"value"="Value #31"};
+{"key"="152";"subkey"="1";"value"="Value #47"};
+{"key"="74";"subkey"="10";"value"="Value #59"};
+{"key"="154";"subkey"="7";"value"="Value #44"};
+{"key"="40";"subkey"="17";"value"="Value #7"};
+{"key"="89";"subkey"="4";"value"="Value #1"};
+{"key"="41";"subkey"="19";"value"="Value #41"};
+{"key"="24";"subkey"="15";"value"="Value #14"};
+{"key"="182";"subkey"="11";"value"="Value #58"};
+{"key"="80";"subkey"="5";"value"="Value #49"};
+{"key"="196";"subkey"="3";"value"="Value #5"};
+{"key"="43";"subkey"="8";"value"="Value #33"};
+{"key"="156";"subkey"="14";"value"="Value #45"};
+{"key"="34";"subkey"="6";"value"="Value #40"};
+{"key"="88";"subkey"="16";"value"="Value #35"};
+{"key"="22";"subkey"="18";"value"="Value #12"};
+{"key"="27";"subkey"="13";"value"="Value #28"};
+{"key"="84";"subkey"="2";"value"="Value #56"};
+{"key"="12";"subkey"="12";"value"="Value #13"};
+{"key"="98";"subkey"="9";"value"="Value #20"};
+{"key"="140";"subkey"="0";"value"="Value #30"};
+{"key"="31";"subkey"="1";"value"="Value #34"};
+{"key"="105";"subkey"="10";"value"="Value #52"};
+{"key"="149";"subkey"="7";"value"="Value #15"};
+{"key"="153";"subkey"="17";"value"="Value #24"};
+{"key"="177";"subkey"="4";"value"="Value #51"};
+{"key"="14";"subkey"="19";"value"="Value #0"};
+{"key"="190";"subkey"="15";"value"="Value #26"};
+{"key"="118";"subkey"="11";"value"="Value #27"};
+{"key"="174";"subkey"="5";"value"="Value #54"};
+{"key"="104";"subkey"="3";"value"="Value #37"};
+{"key"="47";"subkey"="8";"value"="Value #46"};
+{"key"="46";"subkey"="14";"value"="Value #4"};
+{"key"="124";"subkey"="6";"value"="Value #16"};
+{"key"="70";"subkey"="16";"value"="Value #32"};
+{"key"="110";"subkey"="18";"value"="Value #39"};
+{"key"="91";"subkey"="13";"value"="Value #25"};
+{"key"="192";"subkey"="2";"value"="Value #6"};
+{"key"="183";"subkey"="12";"value"="Value #57"};
+{"key"="100";"subkey"="9";"value"="Value #21"};
+{"key"="38";"subkey"="0";"value"="Value #42"};
+{"key"="71";"subkey"="1";"value"="Value #55"};
+{"key"="29";"subkey"="10";"value"="Value #23"};
+{"key"="51";"subkey"="7";"value"="Value #18"};
+{"key"="32";"subkey"="17";"value"="Value #3"};
+{"key"="130";"subkey"="4";"value"="Value #22"};
+{"key"="77";"subkey"="19";"value"="Value #17"};
+{"key"="4";"subkey"="15";"value"="Value #2"};
+{"key"="97";"subkey"="11";"value"="Value #19"};
+{"key"="67";"subkey"="5";"value"="Value #38"};
+{"key"="158";"subkey"="3";"value"="Value #50"};
+{"key"="25";"subkey"="8";"value"="Value #43"};
+{"key"="119";"subkey"="14";"value"="Value #9"};
+{"key"="2";"subkey"="6";"value"="Value #8"};
+{"key"="167";"subkey"="16";"value"="Value #53"};
+{"key"="193";"subkey"="18";"value"="Value #11"};
+{"key"="11";"subkey"="13";"value"="Value #36"};
+{"key"="129";"subkey"="2";"value"="Value #10"};
+{"key"="187";"subkey"="12";"value"="Value #48"};
+{"key"="20";"subkey"="9";"value"="Value #29"};
+{"key"="134";"subkey"="0";"value"="Value #31"};
+{"key"="115";"subkey"="1";"value"="Value #47"};
+{"key"="94";"subkey"="10";"value"="Value #59"};
+{"key"="30";"subkey"="7";"value"="Value #44"};
+{"key"="175";"subkey"="17";"value"="Value #7"};
+{"key"="62";"subkey"="4";"value"="Value #1"};
+{"key"="147";"subkey"="19";"value"="Value #41"};
+{"key"="87";"subkey"="15";"value"="Value #14"};
+{"key"="99";"subkey"="11";"value"="Value #58"};
+{"key"="114";"subkey"="5";"value"="Value #49"};
+{"key"="117";"subkey"="3";"value"="Value #5"};
+{"key"="10";"subkey"="8";"value"="Value #33"};
+{"key"="162";"subkey"="14";"value"="Value #45"};
+{"key"="171";"subkey"="6";"value"="Value #40"};
+{"key"="108";"subkey"="16";"value"="Value #35"};
+{"key"="60";"subkey"="18";"value"="Value #12"};
+{"key"="144";"subkey"="13";"value"="Value #28"};
+{"key"="113";"subkey"="2";"value"="Value #56"};
+{"key"="102";"subkey"="12";"value"="Value #13"};
+{"key"="194";"subkey"="9";"value"="Value #20"};
+{"key"="76";"subkey"="0";"value"="Value #30"};
+{"key"="189";"subkey"="1";"value"="Value #34"};
+{"key"="164";"subkey"="10";"value"="Value #52"};
+{"key"="23";"subkey"="7";"value"="Value #15"};
+{"key"="65";"subkey"="17";"value"="Value #24"};
+{"key"="54";"subkey"="4";"value"="Value #51"};
+{"key"="148";"subkey"="19";"value"="Value #0"};
+{"key"="123";"subkey"="15";"value"="Value #26"};
+{"key"="185";"subkey"="11";"value"="Value #27"};
+{"key"="28";"subkey"="5";"value"="Value #54"};
+{"key"="13";"subkey"="3";"value"="Value #37"};
+{"key"="136";"subkey"="8";"value"="Value #46"};
+{"key"="57";"subkey"="14";"value"="Value #4"};
+{"key"="184";"subkey"="6";"value"="Value #16"};
+{"key"="36";"subkey"="16";"value"="Value #32"};
+{"key"="132";"subkey"="18";"value"="Value #39"};
+{"key"="120";"subkey"="13";"value"="Value #25"};
+{"key"="50";"subkey"="2";"value"="Value #6"};
+{"key"="195";"subkey"="12";"value"="Value #57"};
+{"key"="135";"subkey"="9";"value"="Value #21"};
+{"key"="92";"subkey"="0";"value"="Value #42"};
+{"key"="151";"subkey"="1";"value"="Value #55"};
+{"key"="125";"subkey"="10";"value"="Value #23"};
+{"key"="146";"subkey"="7";"value"="Value #18"};
+{"key"="45";"subkey"="17";"value"="Value #3"};
+{"key"="90";"subkey"="4";"value"="Value #22"};
+{"key"="126";"subkey"="19";"value"="Value #17"};
+{"key"="145";"subkey"="15";"value"="Value #2"};
+{"key"="19";"subkey"="11";"value"="Value #19"};
+{"key"="127";"subkey"="5";"value"="Value #38"};
+{"key"="79";"subkey"="3";"value"="Value #50"};
+{"key"="131";"subkey"="8";"value"="Value #43"};
+{"key"="111";"subkey"="14";"value"="Value #9"};
+{"key"="75";"subkey"="6";"value"="Value #8"};
+{"key"="191";"subkey"="16";"value"="Value #53"};
+{"key"="3";"subkey"="18";"value"="Value #11"};
+{"key"="165";"subkey"="13";"value"="Value #36"};
+{"key"="85";"subkey"="2";"value"="Value #10"};
+{"key"="1";"subkey"="12";"value"="Value #48"};
+{"key"="161";"subkey"="9";"value"="Value #29"};
+{"key"="37";"subkey"="0";"value"="Value #31"};
+{"key"="107";"subkey"="1";"value"="Value #47"};
+{"key"="122";"subkey"="10";"value"="Value #59"};
+{"key"="139";"subkey"="7";"value"="Value #44"};
+{"key"="15";"subkey"="17";"value"="Value #7"};
+{"key"="106";"subkey"="4";"value"="Value #1"};
+{"key"="59";"subkey"="19";"value"="Value #41"};
+{"key"="61";"subkey"="15";"value"="Value #14"};
+{"key"="17";"subkey"="11";"value"="Value #58"};
+{"key"="68";"subkey"="5";"value"="Value #49"};
+{"key"="163";"subkey"="3";"value"="Value #5"};
+{"key"="197";"subkey"="8";"value"="Value #33"};
+{"key"="81";"subkey"="14";"value"="Value #45"};
+{"key"="169";"subkey"="6";"value"="Value #40"};
+{"key"="8";"subkey"="16";"value"="Value #35"};
+{"key"="109";"subkey"="18";"value"="Value #12"};
+{"key"="78";"subkey"="13";"value"="Value #28"};
+{"key"="181";"subkey"="2";"value"="Value #56"};
+{"key"="116";"subkey"="12";"value"="Value #13"};
+{"key"="137";"subkey"="9";"value"="Value #20"};
+{"key"="39";"subkey"="0";"value"="Value #30"};
+{"key"="72";"subkey"="1";"value"="Value #34"};
+{"key"="42";"subkey"="10";"value"="Value #52"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input3.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt
new file mode 100644
index 0000000000..0827c839a2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt
@@ -0,0 +1,13 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="911";"subkey"="2";"value"="hjk"};
+{"key"="911";"subkey"="3";"value"="def"};
+{"key"="911";"subkey"="4";"value"="xyz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt.attr
new file mode 100644
index 0000000000..6ee50d08cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input4.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt
new file mode 100644
index 0000000000..6b1dac36b1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt
@@ -0,0 +1,8 @@
+{"key"="1";"subkey"=".";"value"="abc"};
+{"key"="1";"subkey"=".";"value"="kkk"};
+{"key"="2";"subkey"=".";"value"="aaa"};
+{"key"="2";"subkey"=".";"value"="bbb"};
+{"key"="2";"subkey"=".";"value"="ddd"};
+{"key"="bad";"subkey"=".";"value"="ccc"};
+{"key"="1";"subkey"=".";"value"="qqq"};
+{"key"="1";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputDistinctKey.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt
new file mode 100644
index 0000000000..93251b80a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt
@@ -0,0 +1,6 @@
+{"age"="30";"name1"="bob"};
+{"age"="16";"name1"="alice"};
+{"age"="55";"name1"="jone"};
+{"age"="45";"name1"="silver"};
+{"age"="45";"name1"="smith"};
+{"age"="90";"name1"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt.attr
new file mode 100644
index 0000000000..bdbbea169d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion1.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"String"]];["name1";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt
new file mode 100644
index 0000000000..1d9b6e8b42
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt
@@ -0,0 +1,6 @@
+{"age"="30";"name2"="bob"};
+{"age"="16";"name2"="alice"};
+{"age"="55";"name2"="jone"};
+{"age"="45";"name2"="silver"};
+{"age"="45";"name2"="smith"};
+{"age"="90";"name2"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt.attr
new file mode 100644
index 0000000000..6d032642cf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/inputUnion2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"String"]];["name2";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt
new file mode 100644
index 0000000000..d1fa0973d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="aaa"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="ccc"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/input_tbl_content.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt b/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt
new file mode 100644
index 0000000000..cc1df00106
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt.attr b/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt.attr
new file mode 100644
index 0000000000..9061763bd6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Optimizers/typed_table.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_opt_struct"="SELECT AsList(1,2,3) as b FROM self;";
+ "_yql_syntax_version_opt_struct"=1;
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql b/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql
new file mode 100644
index 0000000000..f0514c97b1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1low '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Apply.yql b/yql/essentials/tests/s-expressions/suites/Result/Apply.yql
new file mode 100644
index 0000000000..ee940f6d93
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Apply.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let f1 (lambda '(x y) (block '(
+ (return (+ x y))
+))))
+
+(let f2 (lambda '(x) (block '(
+ (return (Apply f1 x (Uint64 '2)))
+))))
+
+(let writer (lambda '(world data) (block '(
+ (let world (Write! world res_sink (Key) data '()))
+ (let world (Commit! world res_sink))
+ (return world)
+))))
+
+(let data1 (Apply f2 (Uint64 '3)))
+(let data2 (Apply f2 (Uint64 '4)))
+(let world (Apply writer world data1))
+(let world (Apply writer world data2))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql
new file mode 100644
index 0000000000..d54b9c6ce3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1low '('('take '1) '('autoref))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql
new file mode 100644
index 0000000000..6c7ca6eabd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1low '('('autoref))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql
new file mode 100644
index 0000000000..f4c7304639
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source '((Key '('table (String 'Input))) (Key '('table (String 'Input)))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('take '1) '('autoref))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Empty.yql b/yql/essentials/tests/s-expressions/suites/Result/Empty.yql
new file mode 100644
index 0000000000..3a0cc2e5e5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Empty.yql
@@ -0,0 +1,3 @@
+(
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql
new file mode 100644
index 0000000000..29dc7a9481
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+(let data (Skip table1low (- (Max (Uint64 '1) (Length table1low)) (Uint64 '1))))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql
new file mode 100644
index 0000000000..c6c4df1772
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Length table1) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql
new file mode 100644
index 0000000000..34a926b1dc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Length table1low) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql b/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql
new file mode 100644
index 0000000000..215ec6bf79
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint32 '3) (Uint32 '5) (Uint32 '7) (Uint32 '10)))
+(let world (Write! world res_sink (Key) data '('('take '2))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql b/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql
new file mode 100644
index 0000000000..1a7772c21f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Skip table1 (Uint64 '1)))
+(let table1 (Take table1 (Uint64 '2)))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql b/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql
new file mode 100644
index 0000000000..13c3e97d5b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t (ParseType '"(List<Int32?>,Struct<'b':Dict<Int32,Double>,'a':Int32>)->Tuple<String,Uint64>"))
+(let world (Write! world res_sink (Key) (FormatType t) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql b/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql
new file mode 100644
index 0000000000..ff6b2d9159
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql
@@ -0,0 +1,57 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String)))))
+
+(let res_sink (DataSink 'result))
+(let data '(
+(Uint32 '1)
+(Int32 '-2)
+(Uint64 '3)
+(Int64 '-4)
+(Double '-5)
+(Float '-6)
+(Bool 'true)
+(Yson '@@[1u;"3"]@@)
+(Json '@@{"id":1}@@)
+(Date '11)
+(Datetime '12)
+(Timestamp '13)
+(Interval '-13)
+(Uint8 '14)
+(Int8 '-15)
+(Uint16 '16)
+(Int16 '-17)
+(TzDate '"18,Europe/Moscow")
+(TzDate '"19,America/Los_Angeles")
+(TzDatetime '"20,Etc/GMT-1")
+(TzDatetime '"4291747199,Europe/Moscow")
+(TzDatetime '"4291747198,America/Los_Angeles")
+(TzTimestamp '"21,Etc/GMT+1")
+(Cast (Datetime '"1262347200") 'String)
+(TzDatetime '"1262347200,Europe/Moscow")
+(Cast (Datetime '"1277985600") 'String)
+(TzDatetime '"1277985600,Europe/Moscow")
+(Uuid '"0123456789abcdef")
+(AsStruct '('k (String 'key)) '('v (Uint64 '456)))
+(AsList (Uint32 '2))
+(Just (Uint32 '3))
+(Nothing (OptionalType (DataType 'String)))
+(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
+ (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One)
+)
+(Void)
+(Variant (Int32 '7) '0 vt1)
+(Variant (String 'qwe) 'y vt2)
+))
+(let save (Pickle data))
+(let data2 (Unpickle (TypeOf data) save))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Write! world res_sink (Key) save '('('type))))
+(let world (Write! world res_sink (Key) data2 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql b/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql
new file mode 100644
index 0000000000..110fdcc060
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('columns '('value 'subkey)) '('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql b/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql
new file mode 100644
index 0000000000..01484b19ae
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql
@@ -0,0 +1,12 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let res_sink (DataSink 'result))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world res_sink (Key) table '('('type) '('ref) '('columns '('value 'key)))))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg
new file mode 100644
index 0000000000..8a0f058a3b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg
@@ -0,0 +1,2 @@
+in Input dict.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql b/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql
new file mode 100644
index 0000000000..c3b00f1716
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg
new file mode 100644
index 0000000000..d1391bb33f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg
@@ -0,0 +1,2 @@
+in Input struct.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql
new file mode 100644
index 0000000000..b4e64a1d6d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (FlatMap table1 (lambda '(x) (AsList x x))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql b/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql
new file mode 100644
index 0000000000..a71800ecf9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql
@@ -0,0 +1,11 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('key) '()))
+(let world (Left! x))
+(let data (Right! x))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql b/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql
new file mode 100644
index 0000000000..8684754149
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql
@@ -0,0 +1,30 @@
+# do not check tmp here (YQL-130, YQL-131)
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let yt.plato.Input (Right! x))
+(let select1_input3 yt.plato.Input)
+(let output5 (block '(
+ (let select1_output select1_input3)
+ (let select1_output (Map select1_output (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'x (Int64 '1)))
+ (return res)
+)
+))))
+ (let select1_output (Sort select1_output (Bool 'false) (lambda '(row) (block '(
+ (let res (Member row 'x))
+ (return res)
+)
+))))
+ (let select1_output (Take select1_output (Uint64 '2)))
+ (return select1_output)
+)
+))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) output5 '('('type) '('autoref))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql b/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql
new file mode 100644
index 0000000000..353d36313c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql
@@ -0,0 +1,12 @@
+(
+(let result_sink (DataSink 'result))
+(let plato_sink (DataSink 'yt 'plato))
+
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let data (Take (Right! x) (Uint64 '3)))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '3))))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql b/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql
new file mode 100644
index 0000000000..4b7f4fc30c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql
@@ -0,0 +1,11 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let data (Take (Right! x) (Uint64 '3)))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg
new file mode 100644
index 0000000000..068d78205f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg
@@ -0,0 +1,2 @@
+in Input def_values.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql
new file mode 100644
index 0000000000..69f204a707
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql
@@ -0,0 +1,11 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('infer_scheme))))
+(let world (Left! x))
+(let data (Take (Right! x) (Uint64 '3)))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql
new file mode 100644
index 0000000000..6c4b1851e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql
@@ -0,0 +1,11 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('direct_read))))
+(let world (Left! x))
+(let data (Take (Right! x) (Uint64 '3)))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg
new file mode 100644
index 0000000000..94fcaf1f6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg
@@ -0,0 +1,2 @@
+in Input infer_scheme.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql
new file mode 100644
index 0000000000..69f204a707
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql
@@ -0,0 +1,11 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('infer_scheme))))
+(let world (Left! x))
+(let data (Take (Right! x) (Uint64 '3)))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg
new file mode 100644
index 0000000000..e25ff9f9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg
@@ -0,0 +1,2 @@
+in Input yson.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql b/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql
new file mode 100644
index 0000000000..c3b00f1716
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Pure.yql b/yql/essentials/tests/s-expressions/suites/Result/Pure.yql
new file mode 100644
index 0000000000..9ad249ecf2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Pure.yql
@@ -0,0 +1,52 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String)))))
+(let res_sink (DataSink 'result))
+(let data '(
+(Uint32 '1)
+(Int32 '-2)
+(Uint64 '3)
+(Int64 '-4)
+(Double '-5)
+(Float '-6)
+(Bool 'true)
+(Yson '@@[1u;"3"]@@)
+(Json '@@{"id":1}@@)
+(Date '11)
+(Datetime '12)
+(Timestamp '13)
+(Interval '-13)
+(Uint8 '14)
+(Int8 '-15)
+(Uint16 '16)
+(Int16 '-17)
+(TzDate '"18,Europe/Moscow")
+(TzDate '"19,America/Los_Angeles")
+(TzDatetime '"20,Etc/GMT-1")
+(TzDatetime '"4291747199,Europe/Moscow")
+(TzDatetime '"4291747198,America/Los_Angeles")
+(TzTimestamp '"21,Etc/GMT+1")
+(Cast (Datetime '"1262347200") 'String)
+(TzDatetime '"1262347200,Europe/Moscow")
+(Cast (Datetime '"1277985600") 'String)
+(TzDatetime '"1277985600,Europe/Moscow")
+(Uuid '"0123456789abcdef")
+(AsStruct '('k (String 'key)) '('v (Uint64 '456)))
+(AsList (Uint32 '2))
+(Just (Uint32 '3))
+(Nothing (OptionalType (DataType 'String)))
+(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
+ (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One)
+)
+(Void)
+(Variant (Int32 '7) '0 vt1)
+(Variant (String 'qwe) 'y vt2)
+))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql b/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql
new file mode 100644
index 0000000000..9fdf74cfdf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data '(
+(Uint32 '1)
+(AsStruct '('k (String 'key)) '('v (Uint64 '456)))
+(AsList (Uint32 '2))
+(Just (Uint32 '3))
+(Nothing (OptionalType (DataType 'String)))
+(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
+ (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One)
+)
+(Void)
+))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql b/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql
new file mode 100644
index 0000000000..77573dbc12
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Resource.yql b/yql/essentials/tests/s-expressions/suites/Result/Resource.yql
new file mode 100644
index 0000000000..97aa87cca3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Resource.yql
@@ -0,0 +1,17 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let gen (NewMTRand (Uint64 '42)))
+(let p (NextMTRand gen))
+(let gen (Nth p '1))
+(let v1 (Nth p '0))
+(let p (NextMTRand gen))
+(let gen (Nth p '1))
+(let v2 (Nth p '0))
+(let world (Write! world res_sink (Key) '(v1 v2) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql b/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql
new file mode 100644
index 0000000000..cf2253c9bc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let row1 (AsStruct '('key (String 'key1)) '('subkey (String '.)) '('value (String 'value1))))
+(let row2 (AsStruct '('key (String 'key2)) '('subkey (String '.)) '('value (String 'value2))))
+(let table1 (AsList row1 row2))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('columns '('value 'subkey 'key)) '('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql b/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql
new file mode 100644
index 0000000000..5be6c09045
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let row1 (AsStruct '('key1 (String 'key1)) '('key2 (String '.)) '('aaa (String 'value1))))
+(let row2 (AsStruct '('key1 (String 'key2)) '('key2 (String '.)) '('aaa (String 'value2))))
+(let table1 (AsList row1 row2))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('columns '('('prefix 'key) 'aaa)) '('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql b/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql
new file mode 100644
index 0000000000..4780768ff4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql
@@ -0,0 +1,15 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (Int32 '1) '()))
+(let world (Write! world res_sink (Key) (Int32 '2) '()))
+(let world (Write! world res_sink (Key) (Int32 '3) '()))
+(let world (Commit! world res_sink))
+(let world (Write! world res_sink (Key) (Int32 '4) '()))
+(let world (Write! world res_sink (Key) (Int32 '5) '()))
+(let world (Write! world res_sink (Key) (Int32 '6) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql b/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql
new file mode 100644
index 0000000000..d91538e365
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql b/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql
new file mode 100644
index 0000000000..b8fd35ae40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('ref))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql b/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql
new file mode 100644
index 0000000000..2924cf4e00
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+(let data (Skip table1 (- (Max (Uint64 '1) (Length table1low)) (Uint64 '1))))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg
new file mode 100644
index 0000000000..94fcaf1f6f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg
@@ -0,0 +1,2 @@
+in Input infer_scheme.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql
new file mode 100644
index 0000000000..e4180b783f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '('('infer_scheme))
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql b/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql
new file mode 100644
index 0000000000..729098839b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '(
+ '('do_not_fail_on_invalid_schema)
+ )
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql
new file mode 100644
index 0000000000..66bf82a11d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String)))))
+(let res_sink (DataSink 'result))
+(let data '(
+(Uint32 '1)
+(AsStruct '('k (String 'key)) '('v (Uint64 '456)))
+(AsList (Uint32 '2))
+(Just (Uint32 '3))
+(Nothing (OptionalType (DataType 'String)))
+(AsDict '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
+(Variant (Int32 '7) '0 vt1)
+(Variant (String 'qwe) 'y vt2)
+))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf data)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf (TypeOf data))) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql
new file mode 100644
index 0000000000..c5def78d58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql
@@ -0,0 +1,29 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let x (Uint32 '1))
+(let y (String 'asd))
+(let o (Just x))
+(let l (AsList x))
+(let d (AsDict '(x y)))
+(let t '(x y))
+(let s (AsStruct '('a x) '('b y)))
+(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
+(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String)))))
+(let world (Write! world res_sink (Key) (FormatType (OptionalItemType (TypeOf o))) '()))
+(let world (Write! world res_sink (Key) (FormatType (ListItemType (TypeOf l))) '()))
+(let world (Write! world res_sink (Key) (FormatType (DictKeyType (TypeOf d))) '()))
+(let world (Write! world res_sink (Key) (FormatType (DictPayloadType (TypeOf d))) '()))
+(let world (Write! world res_sink (Key) (FormatType (TupleElementType (TypeOf t) '0)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TupleElementType (TypeOf t) '1)) '()))
+(let world (Write! world res_sink (Key) (FormatType (StructMemberType (TypeOf s) 'a)) '()))
+(let world (Write! world res_sink (Key) (FormatType (StructMemberType (TypeOf s) 'b)) '()))
+(let world (Write! world res_sink (Key) (FormatType (VariantUnderlyingType vt1)) '()))
+(let world (Write! world res_sink (Key) (FormatType (VariantUnderlyingType vt2)) '()))
+(let world (Write! world res_sink (Key) (FormatType (StreamItemType (StreamType (DataType 'String)))) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql
new file mode 100644
index 0000000000..5b80134b73
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let s1 (AsStruct '('a (Uint32 '1)) '('b (String 'qwe))))
+(let s2 (AsStruct '('c (Uint32 '1)) '('d (Just (String 'asd)))))
+(let world (Write! world res_sink (Key) (FormatType (AddMemberType (TypeOf s1) 'q (DataType 'Double))) '()))
+(let world (Write! world res_sink (Key) (FormatType (RemoveMemberType (TypeOf s1) 'a)) '()))
+(let world (Write! world res_sink (Key) (FormatType (ForceRemoveMemberType (TypeOf s1) 'q)) '()))
+(let world (Write! world res_sink (Key) (FormatType (FlattenMembersType '('"p." (TypeOf s1)) '('"q." (TypeOf s2)))) '()))
+(let world (Write! world res_sink (Key) (FormatType (FlattenMembersType '('"p." (TypeOf s1)) '('"q." (OptionalType (TypeOf s2))))) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql b/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql
new file mode 100644
index 0000000000..a634dbecb2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let res_sink (DataSink 'result))
+
+(let world (Write! world res_sink (Key) (String '1) '()))
+(let world (If! world (Bool 'false) (Write! world res_sink (Key) table1low '()) world))
+(let world (Commit! world res_sink))
+
+(let world (Write! world res_sink (Key) (String '2) '()))
+(let world (If! world (Bool 'true) (Write! world res_sink (Key) table1low '()) world))
+(let world (Commit! world res_sink))
+
+(let world (Write! world res_sink (Key) (String '3) '()))
+(let world (If! world (<= (Length table1low) (Uint64 '1))
+ (Write! world res_sink (Key) table1low '())
+ (Write! world res_sink (Key) table1 '())))
+(let world (Commit! world res_sink))
+
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/Yson.yql b/yql/essentials/tests/s-expressions/suites/Result/Yson.yql
new file mode 100644
index 0000000000..f978241cfc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/Yson.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let data (Yson '@@
+{
+"a"=1;
+"$b"=#;
+"c"=2u;
+"d"=4.1;
+"e"=%true;
+"f"=[1;<x=1>"english text"];
+"g"=<u=2>{x=<v="\xff\xff binary">[];y="руÑÑкий текÑÑ‚"};
+}
+@@))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Result/def_values.txt b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt
new file mode 100644
index 0000000000..5a5fca5c32
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt
@@ -0,0 +1,2 @@
+{"key"="1";value="3"};
+{"key"="2";value="4";"subkey"="123"};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr
new file mode 100644
index 0000000000..de393c2dc7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ "DefaultValues"={"key"="\"\"";"subkey"="\"\"";"value"="\"\"";};
+ };
+ "schema"=<"strict" = %true> [
+ {"type"="string"; "name"="key"};
+ {"type"="string"; "name"="subkey"};
+ {"type"="string"; "name"="value"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Result/default.cfg b/yql/essentials/tests/s-expressions/suites/Result/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Result/dict.txt b/yql/essentials/tests/s-expressions/suites/Result/dict.txt
new file mode 100644
index 0000000000..c189e76627
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/dict.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"={"b"=11;"a"=1;}};
+{"key"="800";"subkey"="2";"value"={"a"=2;}};
+{"key"="020";"subkey"="3";"value"={}};
+{"key"="150";"subkey"="4";"value"={"b"=13;"a"=4;}};
+{"key"="075";"subkey"="5";"value"={"b"=14;"a"=5;}};
+{"key"="100";"subkey"="6";"value"={"c"=15;"a"=6;}};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr
new file mode 100644
index 0000000000..6dd8d28db1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr
@@ -0,0 +1,27 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ ["DictType"; ["DataType";"String"]; ["DataType";"Int32"];]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt
new file mode 100644
index 0000000000..eff01d5cf2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd";"extra"=1u};
+{"key"="020";"subkey"="3";"value"="q";"extra"=1u};
+{"key"="150";"subkey"="4";"value"="qzz";"extra"=1u};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr
new file mode 100644
index 0000000000..bbd3d58b0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr
@@ -0,0 +1,7 @@
+{
+ "infer_schema" = %true;
+ "schema_mode" = "strong";
+ "schema" = <strict=%false>[
+ {"type"="string"; "name"="key"};
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Result/input.txt b/yql/essentials/tests/s-expressions/suites/Result/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Result/struct.txt b/yql/essentials/tests/s-expressions/suites/Result/struct.txt
new file mode 100644
index 0000000000..c92d2d7733
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/struct.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"={"b"=11u;"a"=1;}};
+{"key"="800";"subkey"="2";"value"={"a"=2;}};
+{"key"="020";"subkey"="3";"value"={"a"=7}};
+{"key"="150";"subkey"="4";"value"={"b"=13u;"a"=4;}};
+{"key"="075";"subkey"="5";"value"={"b"=14u;"a"=5;}};
+{"key"="100";"subkey"="6";"value"={"a"=6;"c"="foo"}};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr
new file mode 100644
index 0000000000..1b386b578c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr
@@ -0,0 +1,27 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ ["StructType"; [["a";["DataType";"Int32"]]; ["b";["OptionalType";["DataType";"Uint32"];]]]]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Result/yson.txt b/yql/essentials/tests/s-expressions/suites/Result/yson.txt
new file mode 100644
index 0000000000..925448ce22
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/yson.txt
@@ -0,0 +1,7 @@
+{"key"="075";"subkey"="1";"value"={"a"=1;}};
+{"key"="075";"subkey"="1";"value"={"$b"=#;}};
+{"key"="075";"subkey"="1";"value"={"c"=2u;}};
+{"key"="075";"subkey"="1";"value"={"d"=4.1;}};
+{"key"="075";"subkey"="1";"value"={"e"=%true;}};
+{"key"="075";"subkey"="1";"value"={"f"=[1;<x=1>"english text"]}};
+{"key"="100";"subkey"="6";"value"={"g"=<u=2>{x=<v="\xff\xff binary">[];y="руÑÑкий текÑÑ‚"}}};
diff --git a/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr
new file mode 100644
index 0000000000..0c28bda505
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "Yson"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/Bug635.yql b/yql/essentials/tests/s-expressions/suites/Scheme/Bug635.yql
new file mode 100644
index 0000000000..d2aee30dd8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/Bug635.yql
@@ -0,0 +1,46 @@
+(
+(let world (block '(
+ (let values (block '(
+ (let values (Struct))
+ (let values (AddMember values '"key" ("Just" (Cast ("Minus" (Int64 '"1")) 'Int32))))
+ (let values (AddMember values '"x" (String '"2")))
+ (return (AsList values))
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return (Commit! world sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Output"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (block '(
+ (return (Aggregate core '('"key") '()))
+ )))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("ToString" ("Coalesce" (Member row '"key") (Int64 '"34")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.cfg
new file mode 100644
index 0000000000..ed153c6223
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.cfg
@@ -0,0 +1 @@
+out Output empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.yql
new file mode 100644
index 0000000000..6c9fb4ca13
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/DropEmpty.yql
@@ -0,0 +1,4 @@
+(
+ (let world (Write! world (DataSink '"yt" '"plato") (Key '('table (String '"Output"))) (Void) '('('mode 'drop))))
+ (return (Commit! world (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.cfg
new file mode 100644
index 0000000000..2047856002
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input empty_row.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.yql b/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.yql
new file mode 100644
index 0000000000..2080bede74
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailInferEmptyRow.yql
@@ -0,0 +1,6 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '('('infer_scheme))))
+ (let result (DataSink 'result))
+ (let world (Write! (Left! x) result (Key) (FlatMap (Right! x) (lambda '(item) (AsList item))) '('('type) '('autoref))))
+ (return (Commit! (Commit! world result) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.cfg
new file mode 100644
index 0000000000..3091572fb8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.yql
new file mode 100644
index 0000000000..921334c2cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadEmpty.yql
@@ -0,0 +1,6 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let result (DataSink 'result))
+ (let world (Write! (Left! x) result (Key) (FlatMap (Right! x) (lambda '(item) (AsList item))) '('('type) '('autoref))))
+ (return (Commit! (Commit! world result) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.cfg
new file mode 100644
index 0000000000..1e9928289c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input no_scheme.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.yql b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.yql
new file mode 100644
index 0000000000..921334c2cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FailReadWithoutScheme.yql
@@ -0,0 +1,6 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let result (DataSink 'result))
+ (let world (Write! (Left! x) result (Key) (FlatMap (Right! x) (lambda '(item) (AsList item))) '('('type) '('autoref))))
+ (return (Commit! (Commit! world result) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FieldNames.yql b/yql/essentials/tests/s-expressions/suites/Scheme/FieldNames.yql
new file mode 100644
index 0000000000..ab951ab11b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FieldNames.yql
@@ -0,0 +1,32 @@
+(
+# read data from Input table
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+ (Key '('table (String 'Input)))
+ '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+
+# filter keys less than 100
+(let tresh (Int32 '100))
+(let table1low (Map table1 (lambda '(item) (block '(
+ (let val (Struct))
+ (let val (AddMember val 'foo (Member item 'key)))
+ (let val (AddMember val 'bar (Member item 'value)))
+ (let ret (Struct))
+ (let ret (AddMember ret 'key (Member item 'value)))
+ (let ret (AddMember ret 'subkey (String '"")))
+ (let ret (AddMember ret 'value val))
+ (return ret)
+)))))
+
+# write table1low to result sink
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink
+ (Key)
+ table1low '()))
+
+# finish
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/FieldNamesAndTypes.yql b/yql/essentials/tests/s-expressions/suites/Scheme/FieldNamesAndTypes.yql
new file mode 100644
index 0000000000..9db3af4c99
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/FieldNamesAndTypes.yql
@@ -0,0 +1,20 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (FlatMap input (lambda '(item) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'foo (Member item 'key)))
+ (let res (AddMember res 'bar (Member item 'subkey)))
+ (return (AsList res))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.cfg
new file mode 100644
index 0000000000..b156037a24
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.cfg
@@ -0,0 +1 @@
+in Input ForceInferPragma.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt
new file mode 100644
index 0000000000..4f5501a315
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt
@@ -0,0 +1,2 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"=1};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt.attr
new file mode 100644
index 0000000000..376c9c6bf6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.txt.attr
@@ -0,0 +1,34 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value1";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ };
+ "schema"=<"strict" = %false> [
+ {"type"="string"; "name"="key"};
+ {"type"="string"; "name"="subkey"};
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.yql b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.yql
new file mode 100644
index 0000000000..33f40d279a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferPragma.yql
@@ -0,0 +1,7 @@
+(
+ (let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"forceinferschema" '"2"))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let result (DataSink 'result))
+ (let world (Write! (Left! x) result (Key) (Right! x) '('('type) '('autoref))))
+ (return (Commit! (Commit! world result) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.cfg
new file mode 100644
index 0000000000..02f8cd81f4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.cfg
@@ -0,0 +1,2 @@
+in Input ForceInferSchemaSort.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt
new file mode 100644
index 0000000000..1e61934b94
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; "c"="c1"};
+{"a"="a"; "b"="b"; "c"="c2"};
+{"a"="a"; "b"="b"; "c"="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt.attr
new file mode 100644
index 0000000000..35c55ae0f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.txt.attr
@@ -0,0 +1,8 @@
+{
+ "schema"=<"strict" = %true; "unique_keys" = %true>
+ [
+ {"type"="string"; "name"="a"; "sort_order"="ascending"};
+ {"type"="string"; "name"="b"; "sort_order"="ascending"};
+ {"type"="string"; "name"="c"; "sort_order"="ascending"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.yql b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.yql
new file mode 100644
index 0000000000..3ef24c07f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSort.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"forceinferschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.cfg
new file mode 100644
index 0000000000..a02e32d085
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.cfg
@@ -0,0 +1,2 @@
+in Input ForceInferSchemaSortNullPrefix.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt
new file mode 100644
index 0000000000..01081ba8ce
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt
@@ -0,0 +1,3 @@
+{"a"=#; "b"=#; "c"="c1"};
+{"a"="a"; "b"="b"; "c"="c2"};
+{"a"="a"; "b"="b"; "c"="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt.attr
new file mode 100644
index 0000000000..35c55ae0f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.txt.attr
@@ -0,0 +1,8 @@
+{
+ "schema"=<"strict" = %true; "unique_keys" = %true>
+ [
+ {"type"="string"; "name"="a"; "sort_order"="ascending"};
+ {"type"="string"; "name"="b"; "sort_order"="ascending"};
+ {"type"="string"; "name"="c"; "sort_order"="ascending"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.yql b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.yql
new file mode 100644
index 0000000000..3ef24c07f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullPrefix.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"forceinferschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.cfg
new file mode 100644
index 0000000000..a956100087
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.cfg
@@ -0,0 +1,2 @@
+in Input ForceInferSchemaSortNullSuffix.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt
new file mode 100644
index 0000000000..449b660552
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; "c"=#};
+{"a"="a"; "b"="b"; "c"="c2"};
+{"a"="a"; "b"="b"; "c"="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt.attr
new file mode 100644
index 0000000000..35c55ae0f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.txt.attr
@@ -0,0 +1,8 @@
+{
+ "schema"=<"strict" = %true; "unique_keys" = %true>
+ [
+ {"type"="string"; "name"="a"; "sort_order"="ascending"};
+ {"type"="string"; "name"="b"; "sort_order"="ascending"};
+ {"type"="string"; "name"="c"; "sort_order"="ascending"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.yql b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.yql
new file mode 100644
index 0000000000..3ef24c07f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/ForceInferSchemaSortNullSuffix.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"forceinferschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.cfg
new file mode 100644
index 0000000000..f11401b640
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.cfg
@@ -0,0 +1,2 @@
+in Input IgnoreWeakSchemaOnWeak.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.yql b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.yql
new file mode 100644
index 0000000000..aaf61a9163
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaForceInfer.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"ignoreweakschema" '""))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"forceinferschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.cfg
new file mode 100644
index 0000000000..f11401b640
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.cfg
@@ -0,0 +1,2 @@
+in Input IgnoreWeakSchemaOnWeak.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.yql b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.yql
new file mode 100644
index 0000000000..85f3775676
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaInfer.yql
@@ -0,0 +1,18 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"ignoreweakschema" '""))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"inferschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.cfg
new file mode 100644
index 0000000000..1b9a911d74
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.cfg
@@ -0,0 +1,2 @@
+in Input IgnoreWeakSchemaOnStrong.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt
new file mode 100644
index 0000000000..1e61934b94
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; "c"="c1"};
+{"a"="a"; "b"="b"; "c"="c2"};
+{"a"="a"; "b"="b"; "c"="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt.attr
new file mode 100644
index 0000000000..c78fe74feb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.txt.attr
@@ -0,0 +1,9 @@
+{
+ "schema"=<"strict" = %false; "unique_keys" = %false>
+ [
+ {"type"="any"; "name"="a"; "sort_order"="ascending"};
+ {"type"="any"; "name"="b"; "sort_order"="ascending"};
+ {"type"="any"; "name"="c"; "sort_order"="ascending"}
+ ];
+ "schema_mode"="strong"
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.yql b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.yql
new file mode 100644
index 0000000000..40addc79c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnStrong.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"ignoreweakschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.cfg
new file mode 100644
index 0000000000..0c64f31555
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.cfg
@@ -0,0 +1,2 @@
+in Input IgnoreWeakSchemaOnWeak.txt
+xfail
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt
new file mode 100644
index 0000000000..1e61934b94
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; "c"="c1"};
+{"a"="a"; "b"="b"; "c"="c2"};
+{"a"="a"; "b"="b"; "c"="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt.attr
new file mode 100644
index 0000000000..1574638558
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.txt.attr
@@ -0,0 +1,9 @@
+{
+ "schema"=<"strict" = %false; "unique_keys" = %false>
+ [
+ {"type"="any"; "name"="a"; "sort_order"="ascending"};
+ {"type"="any"; "name"="b"; "sort_order"="ascending"};
+ {"type"="any"; "name"="c"; "sort_order"="ascending"}
+ ];
+ "schema_mode"="weak"
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.yql b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.yql
new file mode 100644
index 0000000000..40addc79c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/IgnoreWeakSchemaOnWeak.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"ignoreweakschema" '""))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.cfg
new file mode 100644
index 0000000000..cfe28950fc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.cfg
@@ -0,0 +1 @@
+in Input InferPragma.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt
new file mode 100644
index 0000000000..4f5501a315
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt
@@ -0,0 +1,2 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"=1};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt.attr
new file mode 100644
index 0000000000..3c0f7e55c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema" = %true
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.yql b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.yql
new file mode 100644
index 0000000000..cd6fe7c84c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/InferPragma.yql
@@ -0,0 +1,7 @@
+(
+ (let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"inferschema" '"2"))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let result (DataSink 'result))
+ (let world (Write! (Left! x) result (Key) (Right! x) '('('type) '('autoref))))
+ (return (Commit! (Commit! world result) (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.cfg
new file mode 100644
index 0000000000..5f5d93efe2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.cfg
@@ -0,0 +1,3 @@
+in Input dict.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.yql b/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.yql
new file mode 100644
index 0000000000..c04cb6b397
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/MapDict.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1low (Map table1 (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let keys (DictKeys (Member item 'value)))
+ (let keys (Sort keys (Bool 'True) (lambda '(x) x)))
+ (let s (AddMember s 'value keys))
+ (return s)
+)))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1low '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.cfg
new file mode 100644
index 0000000000..42f62f4dfb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.cfg
@@ -0,0 +1,3 @@
+in Input non_ksv_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.yql b/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.yql
new file mode 100644
index 0000000000..cc664b337a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/NonKsvSortByKeyDesc.yql
@@ -0,0 +1,19 @@
+(
+(let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"age" '"name") '()))
+(let data (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s '"age" (Cast (Member item '"age") 'Uint64)))
+ (let s (AddMember s '"name" (Member item '"name")))
+ (return (AsList s))
+))))
+(let data (FlatMap (Right! x) data))
+(let key (lambda '(item) (block '(
+ (let age (Member item '"age"))
+ (let name (Member item '"name"))
+ (return '(age name))
+))))
+(let res (Sort data '((Bool 'false) (Bool 'false)) key))
+(let mr_sink (DataSink '"yt" '"plato"))
+(let res (Write! (Left! x) mr_sink (Key '('table (String '"Output"))) res '('('mode 'append))))
+(return (Commit! res mr_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.cfg
new file mode 100644
index 0000000000..bad9ad9043
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.yql
new file mode 100644
index 0000000000..ad8e17ad01
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/OverrideEmpty.yql
@@ -0,0 +1,5 @@
+(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) (Void) '()))
+ (let world (Write! (Left! x) (DataSink '"yt" '"plato") (Key '('table (String '"Output"))) (FlatMap (Right! x) (lambda '(item) (AsList item))) '('('mode 'renew))))
+ (return (Commit! world (DataSink '"yt" '"plato")))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.cfg
new file mode 100644
index 0000000000..4f895b9823
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.cfg
@@ -0,0 +1,2 @@
+in Input group_by_tuple_input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.yql b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.yql
new file mode 100644
index 0000000000..5b0236af0c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByTuple.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let keySelector (lambda '(x) '((Member x 'value) (Member x 'subkey))))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Nth key '0)))
+ (let s (AddMember s 'subkey (Nth key '1)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let result (PartitionByKey table keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.yql b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.yql
new file mode 100644
index 0000000000..b6bb863891
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValue.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'value)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValueAndMap.yql b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValueAndMap.yql
new file mode 100644
index 0000000000..bc7222e7e1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionByValueAndMap.yql
@@ -0,0 +1,41 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let yt.plato.Input (Right! x))
+(let select@0:0_input yt.plato.Input)
+(let output (block '(
+ (let select@0:0_output (Map select@0:0_input (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'foo (Member row 'value)))
+ (let res (AddMember res 'bar (Member row 'key)))
+ (return res)
+)
+))))
+ (let select@0:0_output (PartitionByKey select@0:0_output (lambda '(row) (block '(
+ (let res (Member row 'foo))
+ (return res)
+)
+)) (Void) (Void) (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let group (Collect (Nth pair '1)))
+ (let res (FlatMap group (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'subkey (ToString (Length group))))
+ (let res (AddMember res 'value (Member row 'bar)))
+ (let res (AddMember res 'key (Member row 'foo)))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return res)
+)))))
+))
+ (return select@0:0_output)
+)
+))
+(let output (Sort output (Bool 'true) (lambda '(x) (Concat (Member x 'subkey) (Member x 'value)))))
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) output '()))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.cfg
new file mode 100644
index 0000000000..4f895b9823
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.cfg
@@ -0,0 +1,2 @@
+in Input group_by_tuple_input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.yql b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.yql
new file mode 100644
index 0000000000..acd5dca2d2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByTuple.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let keySelector (lambda '(x) '((Member x 'value) (Member x 'subkey))))
+(let result (PartitionsByKeys table keySelector (Void) (Void) (lambda '(x) x)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.yql b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.yql
new file mode 100644
index 0000000000..227eeaa709
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/PartitionsByValue.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'value)))
+(let reducedTable (PartitionsByKeys table1 keySelector (Void) (Void) (lambda '(x) x)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.cfg
new file mode 100644
index 0000000000..effc27a938
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input1 empty.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.yql
new file mode 100644
index 0000000000..954ed3d61f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/RangeFailEmpty.yql
@@ -0,0 +1,33 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input2")))))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (MrTableRangeStrict '"" filter))) (Void) '('('infer_scheme))))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.cfg
new file mode 100644
index 0000000000..f3b77c80df
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.cfg
@@ -0,0 +1,3 @@
+in Input sort_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.yql
new file mode 100644
index 0000000000..6c106597e1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortAndTake.yql
@@ -0,0 +1,17 @@
+# do not check tmp here (YQL-130, YQL-131)
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let yt.plato.Input (Right! x))
+(let input yt.plato.Input)
+(let output (Sort input (Bool 'true) (lambda '(row) (block '(
+ (let res (Member row 'value))
+ (return res)
+)
+))))
+(let output (Take output (Uint64 '5)))
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) output '()))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.cfg
new file mode 100644
index 0000000000..f3b77c80df
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.cfg
@@ -0,0 +1,3 @@
+in Input sort_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.yql
new file mode 100644
index 0000000000..01624bc527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByDouble.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input (Bool 'true) (lambda '(item) (block '(
+ (return (/ (FromString (Member item 'key) 'Double) (FromString (Member item 'subkey) 'Double)))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.cfg
new file mode 100644
index 0000000000..c9fc780575
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.cfg
@@ -0,0 +1,3 @@
+in Input desc_sort_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.yql
new file mode 100644
index 0000000000..6b98c46713
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByKeyDesc.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input (Bool 'false) (lambda '(item) (block '(
+ (return (Member item 'key))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.cfg
new file mode 100644
index 0000000000..f3b77c80df
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.cfg
@@ -0,0 +1,3 @@
+in Input sort_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.yql
new file mode 100644
index 0000000000..3d74c7388a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortByValue.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input (Bool 'true) (lambda '(item) (block '(
+ (return (Member item 'value))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.cfg
new file mode 100644
index 0000000000..d1e6db2a43
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.cfg
@@ -0,0 +1,3 @@
+in Input doubles_input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.yql
new file mode 100644
index 0000000000..6508146c9e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortDoubles.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input (Bool 'true) (lambda '(item) (block '(
+ (return (Coalesce (FromString (Member item 'key) 'Double) (Double '0)))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortInts.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortInts.yql
new file mode 100644
index 0000000000..a2266c98de
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortInts.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input (Bool 'true) (lambda '(item) (block '(
+ (return (Coalesce (FromString (Member item 'subkey) 'Uint64) (Uint64 '0)))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortTuples.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuples.yql
new file mode 100644
index 0000000000..0275b2d11d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuples.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input '((Bool 'true) (Bool 'true)) (lambda '(item) (block '(
+ (return '((Member item 'value) (Member item 'subkey)))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.yql b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.yql
new file mode 100644
index 0000000000..05e9777d03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/SortTuplesAndWrite.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let input (Right! x))
+ (let output (Sort input '((Bool 'true) (Bool 'true)) (lambda '(item) (block '(
+ (return '((Member item 'value) (Member item 'subkey)))
+ )))))
+ (return output)
+)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.cfg
new file mode 100644
index 0000000000..590d6de49e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.cfg
@@ -0,0 +1,2 @@
+in Input unique_keys.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.yql b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.yql
new file mode 100644
index 0000000000..c65fa8f8ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeys.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.cfg
new file mode 100644
index 0000000000..5318593448
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.cfg
@@ -0,0 +1,2 @@
+in Input unique_keys_strip.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.yql b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.yql
new file mode 100644
index 0000000000..c65fa8f8ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/UniqueKeysStrip.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+
+(let x (Read! world mr_source
+ (Key '('tablescheme (String 'Input)))
+ (Void) '()
+))
+
+(let world (Left! x))
+(let scheme (Right! x))
+
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.cfg
new file mode 100644
index 0000000000..e39613226c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.cfg
@@ -0,0 +1,3 @@
+in Input1 empty.txt
+in Input2 empty.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.yql
new file mode 100644
index 0000000000..b27b58aa03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeOnlyEmpty.yql
@@ -0,0 +1,33 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input2")))))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (MrTableRange '"" filter))) (Void) '('('infer_scheme))))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.cfg
new file mode 100644
index 0000000000..abafdbeb96
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.cfg
@@ -0,0 +1,3 @@
+in Input1 empty.txt
+in Input2 input.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.yql b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.yql
new file mode 100644
index 0000000000..b27b58aa03
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WeakRangeSkipEmpty.yql
@@ -0,0 +1,33 @@
+(
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(let world (block '(
+ (let filter (lambda '(name) (And (>= name (String '"Input1")) (<= name (String '"Input2")))))
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (MrTableRange '"" filter))) (Void) '('('infer_scheme))))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsList row))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WriteNumbers.yql b/yql/essentials/tests/s-expressions/suites/Scheme/WriteNumbers.yql
new file mode 100644
index 0000000000..d9bfcea077
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WriteNumbers.yql
@@ -0,0 +1,15 @@
+(
+(let output5 (block '(
+ (let row (Struct))
+ (let row (AddMember row 'x (Int64 '1)))
+ (let row (AddMember row 'y (Int64 '2)))
+ (let row (AddMember row 'z (Int64 '3)))
+ (let insert1_output (AsList row))
+ (return insert1_output)
+)
+))
+(let sink (DataSink 'yt 'plato))
+(let world (Write! world sink (Key '('table (String 'Output))) output5 '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.cfg
new file mode 100644
index 0000000000..d611f0155e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+out Output2 output2.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.yql b/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.yql
new file mode 100644
index 0000000000..7af6edc4ca
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/WriteStructThenCopyOneField.yql
@@ -0,0 +1,27 @@
+(
+(let output1 (block '(
+ (let row (Struct))
+ (let row (AddMember row 'x (String 'abc)))
+ (let row (AddMember row 'y (Int32 '2)))
+ (let row (AddMember row 'z (Int64 '3)))
+ (let insert1_output (AsList row))
+ (return insert1_output)
+)
+))
+(let sink (DataSink 'yt 'plato))
+(let world (Write! world sink (Key '('table (String 'Output))) output1 '('('mode 'append))))
+(let world (Commit! world sink))
+(let source (DataSource 'yt 'plato))
+(let x (Read! world source (Key '('table (String 'Output))) '('y) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let world (Write! world sink (Key '('table (String 'Output2))) table1 '('('mode 'append))))
+(let world (Commit! world sink))
+(let x (Read! world source (Key '('table (String 'Output2))) (Void) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table2 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/default.cfg b/yql/essentials/tests/s-expressions/suites/Scheme/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt
new file mode 100644
index 0000000000..48706ed4c9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt
@@ -0,0 +1,6 @@
+{"key"="abc";"subkey"="1";"value"="075"};
+{"key"="ddd";"subkey"="2";"value"="800"};
+{"key"="q";"subkey"="3";"value"="020"};
+{"key"="qzz";"subkey"="4";"value"="150"};
+{"key"="qw";"subkey"="5";"value"="075"};
+{"key"="dddx";"subkey"="6";"value"="100"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/desc_sort_input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt b/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt
new file mode 100644
index 0000000000..c189e76627
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"={"b"=11;"a"=1;}};
+{"key"="800";"subkey"="2";"value"={"a"=2;}};
+{"key"="020";"subkey"="3";"value"={}};
+{"key"="150";"subkey"="4";"value"={"b"=13;"a"=4;}};
+{"key"="075";"subkey"="5";"value"={"b"=14;"a"=5;}};
+{"key"="100";"subkey"="6";"value"={"c"=15;"a"=6;}};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt.attr
new file mode 100644
index 0000000000..6dd8d28db1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/dict.txt.attr
@@ -0,0 +1,27 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ ["DictType"; ["DataType";"String"]; ["DataType";"Int32"];]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt
new file mode 100644
index 0000000000..54b881cf72
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="6";"value"="a"};
+{"key"="1.1";"subkey"="7";"value"="b"};
+{"key"="0.1";"subkey"="5";"value"="c"};
+{"key"="-1";"subkey"="2";"value"="d"};
+{"key"="-1.1";"subkey"="1";"value"="e"};
+{"key"="-0.1";"subkey"="3";"value"="f"};
+{"key"="0";"subkey"="4";"value"="z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/doubles_input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt b/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/empty.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt b/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt
new file mode 100644
index 0000000000..d268b7d3ae
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt
@@ -0,0 +1 @@
+{};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt.attr
new file mode 100644
index 0000000000..3c0f7e55c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/empty_row.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema" = %true
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt
new file mode 100644
index 0000000000..613ebe7f0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="075";"subkey"="3";"value"="q"};
+{"key"="100";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/group_by_tuple_input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/input.txt
new file mode 100644
index 0000000000..7d4ce31a5d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/input.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="075";"subkey"="5";"value"="q"};
+{"key"="100";"subkey"="6";"value"="ddd"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt b/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt.attr
new file mode 100644
index 0000000000..3c0f7e55c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/no_scheme.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema" = %true
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt
new file mode 100644
index 0000000000..acb15b8973
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt
@@ -0,0 +1,6 @@
+{"age"="30";"name"="bob"};
+{"age"="16";"name"="alice"};
+{"age"="55";"name"="jone"};
+{"age"="45";"name"="silver"};
+{"age"="45";"name"="smith"};
+{"age"="90";"name"="stive"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt.attr
new file mode 100644
index 0000000000..db02940d83
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/non_ksv_input.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["age";["DataType";"String"]];["name";["DataType";"String"]]]]}
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt b/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt
new file mode 100644
index 0000000000..fe02ecfe9e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="075";"subkey"="5";"value"="qw"};
+{"key"="100";"subkey"="6";"value"="dddx"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/sort_input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt
new file mode 100644
index 0000000000..6e7e05cd2e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; c="c1"};
+{"a"="a"; "b"="b"; c="c2"};
+{"a"="a"; "b"="b"; c="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt.attr
new file mode 100644
index 0000000000..8d0816e3f5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys.txt.attr
@@ -0,0 +1,14 @@
+{
+ "_read_schema"=<"strict"=%false>
+ [
+ {"type"="string"; "name"="a"};
+ {"type"="string"; "name"="b"};
+ {"type"="string"; "name"="c"}
+ ];
+ "schema"=<"strict" = %true; "unique_keys" = %true>
+ [
+ {"type"="string"; "name"="a"; "sort_order"="ascending"};
+ {"type"="string"; "name"="b"; "sort_order"="ascending"};
+ {"type"="string"; "name"="c"; "sort_order"="ascending"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt
new file mode 100644
index 0000000000..6e7e05cd2e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt
@@ -0,0 +1,3 @@
+{"a"="a"; "b"="b"; c="c1"};
+{"a"="a"; "b"="b"; c="c2"};
+{"a"="a"; "b"="b"; c="c3"};
diff --git a/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt.attr b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt.attr
new file mode 100644
index 0000000000..b709a3f991
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Scheme/unique_keys_strip.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_read_schema"=<"strict"=%false>
+ [
+ {"type"="string"; "name"="a"};
+ {"type"="string"; "name"="b"}
+ ];
+ "schema"=<"strict" = %true; "unique_keys" = %true>
+ [
+ {"type"="string"; "name"="a"; "sort_order"="ascending"};
+ {"type"="string"; "name"="b"; "sort_order"="ascending"};
+ {"type"="string"; "name"="c"; "sort_order"="ascending"}
+ ]
+}
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.yql
new file mode 100644
index 0000000000..2e63d28e6a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKey.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let init (lambda '(key item) (FromString (Member item 'subkey) 'Uint32)))
+(let update (lambda '(key item state) (+ state (FromString (Member item 'subkey) 'Uint32))))
+(let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Coalesce (Map state (lambda '(x) (ToString x))) (String '""))))
+ (return (Just s))
+))))
+(let table2 (CombineByKey table1 preMap keyExtractor init update finish))
+(let mr_sink (DataSink 'yt 'plato))
+(let result (Sort table2 (Bool 'true) (lambda '(x) (Member x 'key))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.yql
new file mode 100644
index 0000000000..4957a8671d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/CombineByKeyStream.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let preMap (lambda '(item) (Iterator (AsList item))))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let init (lambda '(key item) (FromString (Member item 'subkey) 'Uint32)))
+(let update (lambda '(key item state) (+ state (FromString (Member item 'subkey) 'Uint32))))
+(let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Coalesce (Map state (lambda '(x) (ToString x))) (String '""))))
+ (return (Iterator (AsList s)))
+))))
+(let table2 (CombineByKey table1 preMap keyExtractor init update finish))
+(let mr_sink (DataSink 'yt 'plato))
+(let result (Sort table2 (Bool 'true) (lambda '(x) (Member x 'key))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Drop.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Drop.yql
new file mode 100644
index 0000000000..72c7873e91
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Drop.yql
@@ -0,0 +1,19 @@
+(
+(let mr_sink (DataSink 'yt 'plato))
+(let data (AsList (AsStruct '('key (String 'abc)))))
+
+(let world (Write! world mr_sink
+ (Key '('table (String 'Output)))
+ data '('('mode 'renew))
+))
+
+(let world (Commit! world mr_sink))
+
+(let world (Write! world mr_sink
+ (Key '('table (String 'Output)))
+ (Void) '('('mode 'drop))
+))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.cfg
new file mode 100644
index 0000000000..e98936751d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.cfg
@@ -0,0 +1,2 @@
+in InputEmpty input_empty.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.yql
new file mode 100644
index 0000000000..fbe31a1f8f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EmptyCopy.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'InputEmpty))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.yql
new file mode 100644
index 0000000000..c28ef4d035
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/EnumerateInsideReduce.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let list (Skip (Take (Enumerate list) (Uint64 '2)) (Uint64 '1)))
+ (let r (FlatMap list (lambda '(x) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (ToString (Nth x '0)) (ToString (Member (Nth x '1) 'value)))))
+ (return (AsList s))
+ )))))
+ (return r)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void)listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Fill.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Fill.yql
new file mode 100644
index 0000000000..e48c1f7a2f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Fill.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let data (AsList
+(AsStruct '('key (String 'key1)) '('subkey (String '"")) '('value (String 'value1)))
+(AsStruct '('key (String 'key2)) '('subkey (String '"")) '('value (String 'value2)))
+))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FillWithCount.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FillWithCount.yql
new file mode 100644
index 0000000000..20f0cd1ac2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FillWithCount.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let data (AsList
+(AsStruct '('key (String 'key1)) '('subkey (String '"")) '('value (String 'value1)))
+(AsStruct '('key (String 'key2)) '('subkey (String '"")) '('value (ToString (Length table1))))
+))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.yql
new file mode 100644
index 0000000000..a5be6f207c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/FilterThenCombineByKey.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Filter table1 (lambda '(x) (< (Member x 'key) (String '500)))))
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let init (lambda '(key item) (FromString (Member item 'subkey) 'Uint32)))
+(let update (lambda '(key item state) (+ state (FromString (Member item 'subkey) 'Uint32))))
+(let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Coalesce (Map state (lambda '(x) (ToString x))) (String '""))))
+ (return (Just s))
+))))
+(let table2 (CombineByKey table1 preMap keyExtractor init update finish))
+(let result (Sort table2 (Bool 'true) (lambda '(x) (Member x 'key))))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/IteratorInMap.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/IteratorInMap.yql
new file mode 100644
index 0000000000..fcc89eb21c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/IteratorInMap.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let handler (lambda '(row) (block '(
+ (let value (Member row 'value))
+ (return (ReplaceMember row 'value (Collect (Iterator (AsList value value)))))
+ ))))
+(let data (Map table1 handler))
+(let data (Sort data (Bool 'true) (lambda '(row) (Member row 'key))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '('('mode 'append))))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LMapOverTable.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LMapOverTable.yql
new file mode 100644
index 0000000000..f86f4c0c21
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LMapOverTable.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 '100))
+(let table1low (LMap table1 (lambda '(stream) (block '(
+ (return (FlatMap stream (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret))))))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTableInsideMap.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTableInsideMap.yql
new file mode 100644
index 0000000000..ccbd5bbbb4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTableInsideMap.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let table3 (Map table1 (lambda '(item) (block '(
+ (let s (AsStruct
+ '('key (Member item 'key))
+ '('subkey (ToString (Length table2)))
+ '('value (Member item 'value))
+ ))
+
+ (return s)
+)))))
+
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTempTableInsideMap.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTempTableInsideMap.yql
new file mode 100644
index 0000000000..d2e6fd6aec
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/LengthOfTempTableInsideMap.yql
@@ -0,0 +1,30 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+
+(let table2 (Map table1 (lambda '(item) (block '(
+ (let s (AsStruct
+ '('key (Member item 'key))
+ '('subkey (ToString (Length table1low)))
+ '('value (Member item 'value))
+ ))
+
+ (return s)
+)))))
+
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.cfg
new file mode 100644
index 0000000000..8e3bf0495d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.cfg
@@ -0,0 +1,2 @@
+in Input input_other.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.yql
new file mode 100644
index 0000000000..e8caad830b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOther.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('_other) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String 'abc))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let value (Lookup (Member item '_other) (String 'value)) )
+ (let ret (FlatMap value (lambda '(item2) (block '(
+ (return (ListIf (== item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.cfg
new file mode 100644
index 0000000000..846f89d5a3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.cfg
@@ -0,0 +1,3 @@
+in Input1 input_other.txt
+in Input2 input_other_strict.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.yql
new file mode 100644
index 0000000000..772527f2f6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherMixed.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source '((Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) '('_other) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String 'abc))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let value (Lookup (Member item '_other) (String 'value)) )
+ (let ret (FlatMap value (lambda '(item2) (block '(
+ (return (ListIf (== item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.cfg
new file mode 100644
index 0000000000..23b0cd29bd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.cfg
@@ -0,0 +1,2 @@
+in Input input_other_strict.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.yql
new file mode 100644
index 0000000000..e8caad830b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapOtherStrict.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('_other) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String 'abc))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let value (Lookup (Member item '_other) (String 'value)) )
+ (let ret (FlatMap value (lambda '(item2) (block '(
+ (return (ListIf (== item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapStream.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapStream.yql
new file mode 100644
index 0000000000..e9fe1806e8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MapStream.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 '100))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (Collect (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (Iterator (ListIf (< item2 tresh) item)))
+ ))))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MissingColumn.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MissingColumn.yql
new file mode 100644
index 0000000000..73e0d903b4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/MissingColumn.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey2 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.yql
new file mode 100644
index 0000000000..cb740182a1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/OrderedLMapOverTable.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 '100))
+(let table1low (OrderedLMap table1 (lambda '(stream) (block '(
+ (return (OrderedFlatMap stream (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret))))))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.cfg
new file mode 100644
index 0000000000..d87afdedc4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.cfg
@@ -0,0 +1,2 @@
+in Input program26.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.yql
new file mode 100644
index 0000000000..2645b699e4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKey.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(group) (block '(
+ (let key (Nth group '0))
+ (let stream (Nth group '1))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length (ForwardList stream)))))
+ (return s)
+ )))))
+))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.cfg
new file mode 100644
index 0000000000..d87afdedc4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.cfg
@@ -0,0 +1,2 @@
+in Input program26.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.yql
new file mode 100644
index 0000000000..88c71a6f9d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeySorted.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let sortKeySelector (lambda '(x) (Member x 'value)))
+(let listHandler (lambda '(groups) (block '(
+ (return (Map groups (lambda '(group) (block '(
+ (let key (Nth group '0))
+ (let stream (Nth group '1))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Collect (Condense stream (String '"") (lambda '(item state) (Bool 'False)) (lambda '(item state) (Concat (Concat state (String '" ")) (Member item 'value)))))))
+ (return s)
+ )))))
+))))
+(let reducedTable (PartitionByKey table1 keySelector (Bool 'false) sortKeySelector listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.yql
new file mode 100644
index 0000000000..938bb3e859
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/PartitionByKeyStream.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let handler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (return (Iterator (AsList s)))
+))))))
+(let table2 (PartitionByKey table1 keyExtractor (Void) (Void) handler))
+(let mr_sink (DataSink 'yt 'plato))
+(let result (Sort table2 (Bool 'true) (lambda '(x) (Member x 'key))))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) result '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Skip.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Skip.yql
new file mode 100644
index 0000000000..f7d625e18f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Skip.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let offset (Uint64 '1))
+(let table2 (Skip table1 offset))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SkipTakeThenMap.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SkipTakeThenMap.yql
new file mode 100644
index 0000000000..5af618e78f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SkipTakeThenMap.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1 (Skip table1 (Uint64 '1)))
+(let table1 (Take table1 (Uint64 '2)))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '"")))
+ (let s (AddMember s 'value value))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt
new file mode 100644
index 0000000000..6d0b5b4d40
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt
@@ -0,0 +1,7 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="075";"subkey"="2";"value"="abc2"};
+{"key"="075";"subkey"="3";"value"="abc3"};
+{"key"="800";"subkey"="4";"value"="ddd"};
+{"key"="020";"subkey"="5";"value"="q"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="150";"subkey"="7";"value"="zz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/SomeKeys.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/TableInsertCastList.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/TableInsertCastList.yql
new file mode 100644
index 0000000000..ce2f6fa8eb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/TableInsertCastList.yql
@@ -0,0 +1,53 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (Filter core (lambda '(row) (Coalesce ("<" (Member row '"key") (String '"100")) (Bool 'false)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"value" (MatchType (Member row '"key") 'Optional (lambda '(item) (Coalesce (Map item (lambda '(val) (IfType val (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Just (Convert item '"Int64")))))) (Nothing (OptionalType (DataType '"Int64"))))) (lambda '(item) (IfType item (DataType 'String) (lambda '(item) (FromString item '"Int64")) (lambda '(item) (Convert item '"Int64")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return (Commit! world sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let values (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (Filter core (lambda '(row) (Coalesce (">=" (Member row '"key") (String '"100")) (Bool 'false)))))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"value" (Int64 '"1")))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let sink (DataSink '"yt" '"plato"))
+ (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
+ (return (Commit! world sink))
+ )))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Take.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Take.yql
new file mode 100644
index 0000000000..6a8c55c92d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/Take.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let limit (Uint64 '2))
+(let table2 (Take table1 limit))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.cfg
new file mode 100644
index 0000000000..7e61f75847
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.cfg
@@ -0,0 +1,2 @@
+in Input SomeKeys.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.yql
new file mode 100644
index 0000000000..80371ba528
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/ZipInsideReduce.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (Collect (Nth pair '1)))
+ (let list (Zip list (Skip list (Uint64 '1))))
+ (let r (FlatMap list (lambda '(x) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Concat (Member (Nth x '0) 'value) (ToString (Member (Nth x '1) 'value)))))
+ (return (AsList s))
+ )))))
+ (return r)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/default.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/default.cfg
new file mode 100644
index 0000000000..d481615947
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+in Input2 input.txt
+out Output2 output2.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt
new file mode 100644
index 0000000000..3803cb8d65
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt
@@ -0,0 +1,3 @@
+{"key"="a";"subkey"="1";"value"="b"};
+{"key"="c";"subkey"="2";"value"="d"};
+{"key"="e";"subkey"="3";"value"="f"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input2.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_empty.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt.attr
new file mode 100644
index 0000000000..8cc87a0668
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other.txt.attr
@@ -0,0 +1,10 @@
+{
+ "schema" = <
+ "strict" = %false;
+ "unique_keys" = %false
+ >
+ [{
+ "name" = "key";
+ "type" = "string"
+ }];
+}
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt
new file mode 100644
index 0000000000..b043b210b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt
@@ -0,0 +1,4 @@
+{"key"="075";"_other"=[["subkey";"1"];["value";"abc"]]};
+{"key"="800";"_other"=[["subkey";"2"];["value";"ddd"]]};
+{"key"="020";"_other"=[["subkey";"3"];["value";"q"]]};
+{"key"="150";"_other"=[["subkey";"4"];["value";"qzz"]]};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt.attr
new file mode 100644
index 0000000000..e7d68f4eea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/input_other_strict.txt.attr
@@ -0,0 +1,28 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "_other";
+ [
+ "DictType";
+ [
+ "DataType";
+ "String"
+ ];
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "key";
+ [
+ "DataType";
+ "Yson"
+ ]
+ ]
+ ]
+ ]};
+}
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program1.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program1.yql
new file mode 100644
index 0000000000..47e3d28b9e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program1.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 'x"64000000"))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let ret (FlatMap intValueOpt (lambda '(item2) (block '(
+ (return (ListIf (< item2 tresh) item))
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program10.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program10.yql
new file mode 100644
index 0000000000..8abd57a84b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program10.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1low2 (Filter table1low (lambda '(item2) (> (Member item2 'value) (String 'd)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program11.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program11.yql
new file mode 100644
index 0000000000..746ca7e40b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program11.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (ToString (+ (Int32 '100) (Int32 '200))))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program12.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program12.yql
new file mode 100644
index 0000000000..56a3ae6931
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program12.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1low (Filter table1 (lambda '(item) (block '(
+ (let tresh (String '100))
+ (let predicate (< (Member item 'key) tresh))
+ (return predicate)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program13.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program13.yql
new file mode 100644
index 0000000000..1b3276e796
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program13.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let data (block '(
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+ (let tresh (String '100))
+ (let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+ (return table1low)
+)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) data '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program14.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program14.yql
new file mode 100644
index 0000000000..218e366ef9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program14.yql
@@ -0,0 +1,14 @@
+(
+(let sink (DataSink 'yt 'plato))
+(let source (DataSource 'yt 'plato))
+(let table (Right! (Read! world source (Key '('table (String 'Input))) '('key 'subkey 'value) '())))
+(let filter (lambda '(item) (block '(
+ (let res (And (> (Member item 'value) (String 'd)) (< (Member item 'key) (String '100))))
+ (return res)
+)
+)))
+(let table (Filter table filter))
+(let world (Write! world sink (Key '('table (String 'Output))) table '('('mode 'append))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program15.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program15.yql
new file mode 100644
index 0000000000..de5a1d5a47
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program15.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1low2 (Filter table1low (lambda '(item) (> (Member item 'key) (String '050)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program16.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program16.yql
new file mode 100644
index 0000000000..0347e8bef3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program16.yql
@@ -0,0 +1,20 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1new (Map table1low (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Concat (String '*) (Member item 'key))))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (String '.)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1new '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program17.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program17.yql
new file mode 100644
index 0000000000..de6ff0054b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program17.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (FlatMap table1 (lambda '(item) (ListIf (< (Member item 'key) tresh) item))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program18.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program18.yql
new file mode 100644
index 0000000000..60ab38e5e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program18.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1new (Map table1low (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Concat (String '*) (Member item 'key))))
+ (return s)
+)))))
+(let table1new2 (Map table1new (lambda '(item) (block '(
+ (let s (AddMember item 'subkey (String '.)))
+ (let s (AddMember s 'value (String '.)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1new2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program19.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program19.yql
new file mode 100644
index 0000000000..0bd4afc826
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program19.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1new (Map table1low (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Concat (String '*) (Member item 'key))))
+ (return s)
+)))))
+(let table1new2 (FlatMap table1new (lambda '(item) (block '(
+ (let s (AddMember item 'value (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AsList s))
+ (let s (Extend s s))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1new2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.cfg
new file mode 100644
index 0000000000..3ad8212f69
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+out Output output1.txt
+out Output2 output2.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.yql
new file mode 100644
index 0000000000..697af6afa2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program2.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table2 (Right! x))
+(let world (Write! world mr_sink (Key '('table (String 'Output2))) table2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program20.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program20.yql
new file mode 100644
index 0000000000..237d4babc1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program20.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1new (Map table1low (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Concat (String '*) (Member item 'key))))
+ (return s)
+)))))
+(let table1new2 (FlatMap table1new (lambda '(item) (block '(
+ (let s (AddMember item 'value (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s1 (AsList s))
+ (let s (Append s1 s))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1new2 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program21.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program21.yql
new file mode 100644
index 0000000000..8492d10a4d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program21.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (String '100))
+(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh))))
+(let table1new (Map table1low (lambda '(item) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key (Concat (String '*) (Member item 'key))))
+ (return s)
+)))))
+(let table1new2 (FlatMap table1new (lambda '(item) (block '(
+ (let s (AddMember item 'value (String '.)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s1 (AsList s))
+ (let s (Append s1 s))
+ (return s)
+)))))
+(let table1new3 (Filter table1new2 (lambda '(item) (> (Member item 'key) (String '*030)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1new3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program22.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program22.yql
new file mode 100644
index 0000000000..76674f13da
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program22.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1sorted (Sort table1 (Bool 'true) (lambda '(item) (Member item 'key))))
+#(let table1sorted (Sort table1 (Tuple (Bool 'true) (Bool 'false)) (lambda '(item) (Tuple (Member item 'key) (Member item 'value)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1sorted '()))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program23.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program23.yql
new file mode 100644
index 0000000000..378711e378
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program23.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let tresh (Int32 '100))
+(let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let optPlus50 (Map intValueOpt (lambda '(item2) (+ (Int32 '50) item2))))
+ (let ret (FlatMap optPlus50 (lambda '(item2) (block '(
+ (let s (ListIf (< item2 tresh) item))
+ (return s)
+ )))))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program24.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program24.yql
new file mode 100644
index 0000000000..1c3c39d3ea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program24.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1even (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (FromString (Member item 'key) 'Int32))
+ (let equalsZero (lambda '(x) (== x (Int32 '0))))
+ (let isEven (lambda '(x) (Coalesce (Map (% x (Int32 '2)) equalsZero) (Bool 'false))))
+ (let filteredValue (Filter intValueOpt isEven))
+ (let ret (ListIf (Exists filteredValue) item))
+ (return ret)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1even '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.cfg
new file mode 100644
index 0000000000..d87afdedc4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.cfg
@@ -0,0 +1,2 @@
+in Input program26.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt
new file mode 100644
index 0000000000..55183cdd00
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt
@@ -0,0 +1,4 @@
+{"key"="0";"subkey"="1";"value"="abc"};
+{"key"="8";"subkey"="2";"value"="ddd"};
+{"key"="0";"subkey"="3";"value"="q"};
+{"key"="1";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.yql
new file mode 100644
index 0000000000..11dcbbbe57
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program26.yql
@@ -0,0 +1,23 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (let ret (Just s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.cfg
new file mode 100644
index 0000000000..f23f5c9676
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.cfg
@@ -0,0 +1,2 @@
+in Input program27.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt
new file mode 100644
index 0000000000..55183cdd00
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt
@@ -0,0 +1,4 @@
+{"key"="0";"subkey"="1";"value"="abc"};
+{"key"="8";"subkey"="2";"value"="ddd"};
+{"key"="0";"subkey"="3";"value"="q"};
+{"key"="1";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.yql
new file mode 100644
index 0000000000..2663ed1bb0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program27.yql
@@ -0,0 +1,24 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let revLen (Length (Reverse list)))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString revLen)))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.cfg
new file mode 100644
index 0000000000..6f69ec10ac
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.cfg
@@ -0,0 +1,2 @@
+in Input program28.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt
new file mode 100644
index 0000000000..c59dba9c7b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="1";"value"="abc"};
+{"key"="1";"subkey"="2";"value"="qzz"};
+{"key"="2";"subkey"="3";"value"="uuu"};
+{"key"="0";"subkey"="4";"value"="aa"};
+{"key"="0";"subkey"="5";"value"="asd"};
+{"key"="0";"subkey"="6";"value"="asd"};
+{"key"="0";"subkey"="7";"value"="ss"};
+{"key"="0";"subkey"="8";"value"="ss"};
+{"key"="2";"subkey"="9";"value"="qqq"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.yql
new file mode 100644
index 0000000000..8ad311cd3c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program28.yql
@@ -0,0 +1,26 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let list1 (Take list (Uint64 '5)))
+ (let list2 (Skip list (Uint64 '1)))
+ (let x (Concat (Concat (ToString (Length list1)) (String '"_")) (ToString (Length list2))))
+ (let s (AddMember s 'value (ToString x)))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.cfg b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.cfg
new file mode 100644
index 0000000000..3123d957f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.cfg
@@ -0,0 +1,2 @@
+in Input program29.input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt
new file mode 100644
index 0000000000..684f20f67a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt
@@ -0,0 +1,5 @@
+{"key"="0";"subkey"="1";"value"="15"};
+{"key"="8";"subkey"="2";"value"="23"};
+{"key"="0";"subkey"="3";"value"="3"};
+{"key"="1";"subkey"="4";"value"="10"};
+{"key"="2";"subkey"="5";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt.attr b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.yql
new file mode 100644
index 0000000000..40a2407e1f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program29.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let ilist (FlatMap list (lambda '(item) (FromString (Member item 'value) 'Int32))))
+ (let sum (Fold ilist (Int32 '0) (lambda '(item state) (+ item state))))
+ (let s (AddMember s 'value (ToString sum)))
+ (let ret (AsList s))
+ (return ret)
+))))))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program8.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program8.yql
new file mode 100644
index 0000000000..894e1a15a1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program8.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program9.yql b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program9.yql
new file mode 100644
index 0000000000..894e1a15a1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/SingleYamrOperation/program9.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/FilterTable.yql b/yql/essentials/tests/s-expressions/suites/TableContent/FilterTable.yql
new file mode 100644
index 0000000000..47e6d9a517
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/FilterTable.yql
@@ -0,0 +1,15 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let table1 (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline)))))
+ (let tresh (String '300))
+ (let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (Member item 'key))
+ (return (ListIf (< intValueOpt tresh) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.cfg b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.yql b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.yql
new file mode 100644
index 0000000000..3d7eadd8df
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithComplexSkip.yql
@@ -0,0 +1,17 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let strip (Udf 'String.Strip))
+ (let skip (Unwrap (Cast (Apply strip (String '" 4")) 'Uint64)))
+ (let table1 (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline) '('skip skip) '('take (Uint64 '3))))))
+ (let tresh (String '300))
+ (let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (Member item 'key))
+ (return (ListIf (< intValueOpt tresh) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithFields.yql b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithFields.yql
new file mode 100644
index 0000000000..e5293e0a57
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithFields.yql
@@ -0,0 +1,15 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let table1 (Right! (Read! world mr_source (Key '('table (String 'Input))) '('key 'value) '('('inline)))))
+ (let tresh (String '300))
+ (let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (Member item 'key))
+ (return (ListIf (< intValueOpt tresh) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithTake.yql b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithTake.yql
new file mode 100644
index 0000000000..e0d516738d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/FilterWithTake.yql
@@ -0,0 +1,15 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let table1 (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline) '('take (Uint64 '3))))))
+ (let tresh (String '300))
+ (let table1low (FlatMap table1 (lambda '(item) (block '(
+ (let intValueOpt (Member item 'key))
+ (return (ListIf (< intValueOpt tresh) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) table1low '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
+
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/InsideCombine.yql b/yql/essentials/tests/s-expressions/suites/TableContent/InsideCombine.yql
new file mode 100644
index 0000000000..529cd9be35
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/InsideCombine.yql
@@ -0,0 +1,32 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let mrtc (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline)))))
+ (let filter (FlatMap mrtc (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (ListIf (< value (String 'qqq)) item))
+ )))))
+ (let filter (ToDict mrtc (lambda '(x) (Member x 'value)) (lambda '(x) (Member x 'subkey)) '('Hashed 'One 'Compact)))
+
+ (let preMap (lambda '(item) (Just item)))
+ (let keyExtractor (lambda '(item) (Member item 'key)))
+ (let init (lambda '(key item) (Contains filter (Member item 'value))))
+ (let update (lambda '(key item state) (And state (Contains filter (Member item 'value)))))
+ (let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString state)))
+ (return (Just s))
+ ))))
+ (let out (CombineByKey table1 preMap keyExtractor init update finish))
+
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/InsideMap.yql b/yql/essentials/tests/s-expressions/suites/TableContent/InsideMap.yql
new file mode 100644
index 0000000000..1c9999ee3a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/InsideMap.yql
@@ -0,0 +1,24 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let mrtc (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline)))))
+ (let mrtc (FlatMap mrtc (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (ListIf (> key (String '100)) item))
+ )))))
+ (let filter (ToDict mrtc (lambda '(x) (Member x 'key)) (lambda '(x) (Member x 'value)) '('Hashed 'One 'Compact)))
+
+ (let tresh (String '500))
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (ListIf (And (< key tresh) (Contains filter key)) item))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/InsideReduce.yql b/yql/essentials/tests/s-expressions/suites/TableContent/InsideReduce.yql
new file mode 100644
index 0000000000..71d61c2a0c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/InsideReduce.yql
@@ -0,0 +1,31 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let mrtc (Right! (Read! world mr_source (Key '('table (String 'Input))) (Void) '('('inline)))))
+ (let mrtc (FlatMap mrtc (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (ListIf (< value (String 'qqq)) item))
+ )))))
+ (let filter (ToDict mrtc (lambda '(x) (Member x 'value)) (lambda '(x) (Member x 'subkey)) '('Hashed 'One 'Compact)))
+
+ (let keySelector (lambda '(x) (Member x 'key)))
+ (let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let r (FlatMap list (lambda '(item) (block '(
+ (return (ListIf (Contains filter (Member item 'value)) item))
+ )))))
+ (return (FlatListIf (< key (String '500)) r))
+ ))))))
+ (let out (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+ (let out (Sort out (Bool 'true) (lambda '(x) (Member x 'key))))
+
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.cfg b/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.cfg
new file mode 100644
index 0000000000..d14bf78557
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input1 input_other.txt
+in Input2 input_other_strict.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.yql b/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.yql
new file mode 100644
index 0000000000..adde05c66d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/MixedOther.yql
@@ -0,0 +1,21 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let r (Right! (Read! world mr_source '((Key '('table (String 'Input1))) (Key '('table (String 'Input2)))) '('_other) '('('inline)))))
+
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (Map r (lambda '(x) (block '(
+ (let value (Lookup (Member x '_other) (String 'value)))
+ (return (AsStruct '('key key) '('value value)))
+ )))))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.cfg b/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.cfg
new file mode 100644
index 0000000000..2372a67784
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+in Input1 input_other.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.yql b/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.yql
new file mode 100644
index 0000000000..5ef7216f81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/NonStrict.yql
@@ -0,0 +1,21 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let r (Right! (Read! world mr_source (Key '('table (String 'Input1))) '('_other) '('('inline)))))
+
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (Map r (lambda '(x) (block '(
+ (let value (Lookup (Member x '_other) (String 'value)))
+ (return (AsStruct '('key key) '('value value)))
+ )))))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.cfg b/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.cfg
new file mode 100644
index 0000000000..938bc7ecfc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+in Input1 input_other_strict.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.yql b/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.yql
new file mode 100644
index 0000000000..5ef7216f81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/StrictOther.yql
@@ -0,0 +1,21 @@
+(
+ #comment
+ (let mr_source (DataSource 'yt 'plato))
+ (let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+ (let world (Left! x))
+ (let table1 (Right! x))
+
+ (let r (Right! (Read! world mr_source (Key '('table (String 'Input1))) '('_other) '('('inline)))))
+
+ (let out (FlatMap table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (return (Map r (lambda '(x) (block '(
+ (let value (Lookup (Member x '_other) (String 'value)))
+ (return (AsStruct '('key key) '('value value)))
+ )))))
+ )))))
+ (let mr_sink (DataSink 'yt 'plato))
+ (let world (Write! world mr_sink (Key '('table (String 'Output))) out '('('mode 'append))))
+ (let world (Commit! world mr_sink))
+ (return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/default.cfg b/yql/essentials/tests/s-expressions/suites/TableContent/default.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input.txt b/yql/essentials/tests/s-expressions/suites/TableContent/input.txt
new file mode 100644
index 0000000000..d1fa0973d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input.txt
@@ -0,0 +1,8 @@
+{"key"="075";"subkey"=".";"value"="abc"};
+{"key"="911";"subkey"=".";"value"="kkk"};
+{"key"="023";"subkey"=".";"value"="aaa"};
+{"key"="527";"subkey"=".";"value"="bbb"};
+{"key"="037";"subkey"=".";"value"="ddd"};
+{"key"="761";"subkey"=".";"value"="ccc"};
+{"key"="200";"subkey"=".";"value"="qqq"};
+{"key"="150";"subkey"=".";"value"="zzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input.txt.attr b/yql/essentials/tests/s-expressions/suites/TableContent/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt b/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt.attr b/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt.attr
new file mode 100644
index 0000000000..371a0d6ec2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input_other.txt.attr
@@ -0,0 +1,10 @@
+{
+ "schema" = <
+ "strict" = %false;
+ "unique_keys" = %false
+ >
+ [{
+ "name" = "key";
+ "type" = "string"
+ }];
+}
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt b/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt
new file mode 100644
index 0000000000..b043b210b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt
@@ -0,0 +1,4 @@
+{"key"="075";"_other"=[["subkey";"1"];["value";"abc"]]};
+{"key"="800";"_other"=[["subkey";"2"];["value";"ddd"]]};
+{"key"="020";"_other"=[["subkey";"3"];["value";"q"]]};
+{"key"="150";"_other"=[["subkey";"4"];["value";"qzz"]]};
diff --git a/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt.attr b/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt.attr
new file mode 100644
index 0000000000..e7d68f4eea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TableContent/input_other_strict.txt.attr
@@ -0,0 +1,28 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "_other";
+ [
+ "DictType";
+ [
+ "DataType";
+ "String"
+ ];
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "key";
+ [
+ "DataType";
+ "Yson"
+ ]
+ ]
+ ]
+ ]};
+}
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql
new file mode 100644
index 0000000000..b555f9f06c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '5)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql
new file mode 100644
index 0000000000..e72c6ab87e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-8)
+ (Interval '10)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql
new file mode 100644
index 0000000000..6e247b28bd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '20)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql
new file mode 100644
index 0000000000..3844a8e284
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-9)
+ (Interval '10)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt
new file mode 100644
index 0000000000..995734fc7d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt
@@ -0,0 +1,20 @@
+{"ts"=1000u; "col1"="a"};
+{"ts"=1009u; "col1"="aaa"};
+{"ts"=1001u; "col1"="a"};
+{"ts"=1003u; "col1"="aaa"};
+{"ts"=1002u; "col1"="aa"};
+{"ts"=1005u; "col1"="aa"};
+{"ts"=1004u; "col1"="a"};
+{"ts"=1006u; "col1"="aaa"};
+{"ts"=1015u; "col1"="aa"};
+{"ts"=1007u; "col1"="a"};
+{"ts"=1008u; "col1"="aa"};
+{"ts"=1010u; "col1"="aa"};
+{"ts"=1011u; "col1"="aaa"};
+{"ts"=1012u; "col1"="aa"};
+{"ts"=1013u; "col1"="aaa"};
+{"ts"=1014u; "col1"="a"};
+{"ts"=1016u; "col1"="aaa"};
+{"ts"=1017u; "col1"="aaa"};
+{"ts"=1018u; "col1"="a"};
+{"ts"=1019u; "col1"="aaa"};
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr
new file mode 100644
index 0000000000..63d77d6812
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ts";["DataType";"Timestamp"]];
+ ["col1";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt
new file mode 100644
index 0000000000..1363c953b6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt
@@ -0,0 +1,15 @@
+{"ts"=1000u; "col1"="a1"};
+{"ts"=1000u; "col1"="a2"};
+{"ts"=1000u; "col1"="a3"};
+{"ts"=1000u; "col1"="a4"};
+{"ts"=1000u; "col1"="a5"};
+{"ts"=1001u; "col1"="b1"};
+{"ts"=1001u; "col1"="b2"};
+{"ts"=1001u; "col1"="b3"};
+{"ts"=1001u; "col1"="b4"};
+{"ts"=1001u; "col1"="b5"};
+{"ts"=1002u; "col1"="c1"};
+{"ts"=1002u; "col1"="c2"};
+{"ts"=1002u; "col1"="c3"};
+{"ts"=1002u; "col1"="c4"};
+{"ts"=1002u; "col1"="c5"}; \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr
new file mode 100644
index 0000000000..63d77d6812
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ts";["DataType";"Timestamp"]];
+ ["col1";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg
new file mode 100644
index 0000000000..144fceddb1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg
@@ -0,0 +1 @@
+in Input input_ordering.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql
new file mode 100644
index 0000000000..840af03240
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '100)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql
new file mode 100644
index 0000000000..1eec5d6236
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '3)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.cfg b/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.cfg
new file mode 100644
index 0000000000..9bed8d5096
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.yql b/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.yql
new file mode 100644
index 0000000000..77573dbc12
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AllFieldsAfterRemap.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMap.yql b/yql/essentials/tests/s-expressions/suites/Udf/AutoMap.yql
new file mode 100644
index 0000000000..cd809a5881
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMap.yql
@@ -0,0 +1,56 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("Apply" ("Udf" '"SimpleUdf.Increment") (Cast (Member row '"key") 'Uint32) (Int64 '"1"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("Apply" ("Udf" '"SimpleUdf.IncrementOpt") (Cast (Member row '"key") 'Uint32) (Int64 '"2"))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.cfg b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.sql b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.sql
new file mode 100644
index 0000000000..74baf57176
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.sql
@@ -0,0 +1,18 @@
+USE plato;
+
+$script = @@
+def f(x,y,z):
+ return x + y + z
+@@;
+
+$udf1=Python::f("(Int32{Flags:AutoMap},Int32{Flags:AutoMap},Int32{Flags:AutoMap})->Int32",$script);
+select $udf1(1,2,3);
+select $udf1(YQL::Just(1),2,3);
+select $udf1(YQL::Just(1),YQL::Just(2),3);
+select $udf1(YQL::Just(1),YQL::Just(2),YQL::Just(3));
+
+$udf2=Python::f("(Int32{Flags:AutoMap},Int32{Flags:AutoMap},Int32{Flags:AutoMap})->Int32?",$script);
+select $udf2(4,5,6);
+select $udf2(YQL::Just(4),5,6);
+select $udf2(YQL::Just(4),YQL::Just(5),6);
+select $udf2(YQL::Just(4),YQL::Just(5),YQL::Just(6));
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.yql b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.yql
new file mode 100644
index 0000000000..e179419a5c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapMany.yql
@@ -0,0 +1,206 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let scriptudf0 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf1 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf2 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf3 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf4 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf5 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf6 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf7 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf0) (Int32 '"1") (Int32 '"2") (Int32 '"3")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf1) ("Just" (Int32 '"1")) (Int32 '"2") (Int32 '"3")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf2) ("Just" (Int32 '"1")) ("Just" (Int32 '"2")) (Int32 '"3")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf3) ("Just" (Int32 '"1")) ("Just" (Int32 '"2")) ("Just" (Int32 '"3"))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf4) (Int32 '"4") (Int32 '"5") (Int32 '"6")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf5) ("Just" (Int32 '"4")) (Int32 '"5") (Int32 '"6")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf6) ("Just" (Int32 '"4")) ("Just" (Int32 '"5")) (Int32 '"6")))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("Apply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1) '((DataType 'Int32) '"" '1)) scriptudf7) ("Just" (Int32 '"4")) ("Just" (Int32 '"5")) ("Just" (Int32 '"6"))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.cfg b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.sql b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.sql
new file mode 100644
index 0000000000..fff1174f57
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.sql
@@ -0,0 +1,22 @@
+USE plato;
+
+$script = @@
+def f(x,y,z):
+ return x + y + z
+@@;
+
+$udf1=Python::f("(x:Int32{Flags:AutoMap},y:Int32{Flags:AutoMap},z:Int32{Flags:AutoMap})->Int32",$script);
+select $udf1(1 as x,2 as y,3 as z);
+select $udf1(YQL::Just(1) as x,2 as y,3 as z);
+select $udf1(YQL::Just(1) as x,YQL::Just(2) as y,3 as z);
+select $udf1(YQL::Just(1) as x,YQL::Just(2) as y,YQL::Just(3) as z);
+select $udf1(YQL::Just(1),YQL::Just(2) as y,YQL::Just(3) as z);
+select $udf1(YQL::Just(1),YQL::Just(2),YQL::Just(3) as z);
+
+$udf2=Python::f("(x:Int32{Flags:AutoMap},y:Int32{Flags:AutoMap},z:Int32{Flags:AutoMap})->Int32?",$script);
+select $udf2(4 as x,5 as y,6 as z);
+select $udf2(YQL::Just(4) as x,5 as y,6 as z);
+select $udf2(YQL::Just(4) as x,YQL::Just(5) as y,6 as z);
+select $udf2(YQL::Just(4) as x,YQL::Just(5) as y,YQL::Just(6) as z);
+select $udf2(YQL::Just(4),YQL::Just(5) as y,YQL::Just(6) as z);
+select $udf2(YQL::Just(4),YQL::Just(5),YQL::Just(6) as z);
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.yql b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.yql
new file mode 100644
index 0000000000..2225ad9b7e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/AutoMapManyNamed.yql
@@ -0,0 +1,302 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let scriptudf0 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf1 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf10 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf11 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf2 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf3 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf4 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf5 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf6 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf7 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf8 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(let scriptudf9 (String '@@
+def f(x,y,z):
+ return x + y + z
+@@))
+(import aggregate_module '"/lib/yql/aggregate.yql")
+(import window_module '"/lib/yql/window.yql")
+(import core_module '"/lib/yql/core.yql")
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf0) '() (AsStruct '('x (Int32 '"1")) '('y (Int32 '"2")) '('z (Int32 '"3")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf1) '() (AsStruct '('x ("Just" (Int32 '"1"))) '('y (Int32 '"2")) '('z (Int32 '"3")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf2) '() (AsStruct '('x ("Just" (Int32 '"1"))) '('y ("Just" (Int32 '"2"))) '('z (Int32 '"3")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf3) '() (AsStruct '('x ("Just" (Int32 '"1"))) '('y ("Just" (Int32 '"2"))) '('z ("Just" (Int32 '"3"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf4) '(("Just" (Int32 '"1"))) (AsStruct '('y ("Just" (Int32 '"2"))) '('z ("Just" (Int32 '"3"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((DataType 'Int32)) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf5) '(("Just" (Int32 '"1")) ("Just" (Int32 '"2"))) (AsStruct '('z ("Just" (Int32 '"3"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf6) '() (AsStruct '('x (Int32 '"4")) '('y (Int32 '"5")) '('z (Int32 '"6")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf7) '() (AsStruct '('x ("Just" (Int32 '"4"))) '('y (Int32 '"5")) '('z (Int32 '"6")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf8) '() (AsStruct '('x ("Just" (Int32 '"4"))) '('y ("Just" (Int32 '"5"))) '('z (Int32 '"6")))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf9) '() (AsStruct '('x ("Just" (Int32 '"4"))) '('y ("Just" (Int32 '"5"))) '('z ("Just" (Int32 '"6"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf10) '(("Just" (Int32 '"4"))) (AsStruct '('y ("Just" (Int32 '"5"))) '('z ("Just" (Int32 '"6"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let output (block '(
+ (let select (block '(
+ (let core (AsList (Uint32 '0)))
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (AsStruct '('"column0" ("NamedApply" (ScriptUdf 'Python '"f" (CallableType '() '((OptionalType (DataType 'Int32))) '((DataType 'Int32) 'x '1) '((DataType 'Int32) 'y '1) '((DataType 'Int32) 'z '1)) scriptudf11) '(("Just" (Int32 '"4")) ("Just" (Int32 '"5"))) (AsStruct '('z ("Just" (Int32 '"6"))))))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CachedUdfType.yql b/yql/essentials/tests/s-expressions/suites/Udf/CachedUdfType.yql
new file mode 100644
index 0000000000..178b280ad6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CachedUdfType.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let cachedType (CallableType '() '((DataType 'String)) '((OptionalType (DataType 'String)))))
+(let udf (Udf 'SimpleUdf.Echo (Void) (Void) '"" cachedType))
+(let x (String 'aaa))
+(let data (Apply udf x))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.cfg b/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.cfg
new file mode 100644
index 0000000000..49968d37d7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.cfg
@@ -0,0 +1,2 @@
+udf callables_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.yql b/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.yql
new file mode 100644
index 0000000000..5d5a0989e0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CallOtherCallable.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let fromString (Udf 'Callables.FromString))
+(let mul (Udf 'Callables.Mul))
+(let list (AsList (String '1) (String '2) (String '3) (String '4) (String '5)))
+(let data (Apply mul list fromString))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.cfg b/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.cfg
new file mode 100644
index 0000000000..57571ef968
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.yql b/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.yql
new file mode 100644
index 0000000000..aebf755663
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CallableAsLambda.yql
@@ -0,0 +1,12 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let udf (Udf 'SimpleUdf.Echo))
+(let data (Map (AsList (String 'a) (String 'b)) udf))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CallableType.yql b/yql/essentials/tests/s-expressions/suites/Udf/CallableType.yql
new file mode 100644
index 0000000000..817a744385
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CallableType.yql
@@ -0,0 +1,18 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let t1 (DataType 'Uint32))
+(let o1 (OptionalType t1))
+(let str (DataType 'String))
+(let s1 (StructType '('key str) '('subkey str) '('value str)))
+(let c1 (CallableType '() '(t1) '(o1) '(s1)))
+(let world (Write! world res_sink (Key) (FormatType c1) '()))
+(let world (Write! world res_sink (Key) (FormatType (CallableResultType c1)) '()))
+(let world (Write! world res_sink (Key) (FormatType (CallableArgumentType c1 '0)) '()))
+(let world (Write! world res_sink (Key) (FormatType (CallableArgumentType c1 '1)) '()))
+(let world (Commit! world res_sink))
+(return world)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.cfg b/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.cfg
new file mode 100644
index 0000000000..f493bfe9eb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+file custom_python.so yql/udfs/examples/custom_python/libcustom_python_udf.so
+os linux
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.yql b/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.yql
new file mode 100644
index 0000000000..a683757f68
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/CustomPython.yql
@@ -0,0 +1,24 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let world (Configure! world (DataSource 'config) 'ImportUdfs 'custom_python.so))
+
+(let json (DataType 'Json))
+(let udfType (CallableType '() '(json) '(json)))
+(let udfScript (String '"from custom_python.foo import bar"))
+(let udf (ScriptUdf 'CustomPython 'bar udfType udfScript))
+
+# call udf
+(let x (Json '@@{"abc":1}@@))
+(let result (Apply udf x))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.cfg b/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.cfg
new file mode 100644
index 0000000000..240cfb2bf5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.cfg
@@ -0,0 +1,3 @@
+file myfile yql/essentials/udfs/test/test_import/libtest_import_udf.so
+res result.txt
+os linux
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.yql b/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.yql
new file mode 100644
index 0000000000..e9da004a74
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ImportUdfs.yql
@@ -0,0 +1,23 @@
+# not supported on windows
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# (1) import udfs from 'myfile'
+(let config (DataSource 'config))
+(let world (Configure! world config 'ImportUdfs 'myfile))
+# (2) execute 'TestImportUdf.Concat'
+(let name (String 'Jamel))
+(let hello (Udf 'TestImportUdf.Concat))
+(let foo_data (Apply hello (String '"Hello, ") name))
+
+# (3) execute 'TestImportUdf.Repeat'
+(let bar_data (Apply (Udf 'TestImportUdf.Repeat) (String 'x) (Uint64 '3)))
+
+# (4) output results
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) foo_data '('('type))))
+(let world (Write! world res_sink (Key) bar_data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.cfg b/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.cfg
new file mode 100644
index 0000000000..3d92a5a733
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.cfg
@@ -0,0 +1,2 @@
+udf type_inspection_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.yql b/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.yql
new file mode 100644
index 0000000000..082da79b04
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/LambdaAsCallable.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list (AsList (String 'A) (String 'B) (String 'C) (String 'D) (String 'E)))
+(let state (String '""))
+(let fold (Udf 'TypeInspection.Fold (Void)
+ (TupleType
+ (TupleType
+ (TypeOf list)
+ (TypeOf state)
+ (CallableType '() '((DataType 'String)) '((DataType 'String)) '((DataType 'String)))
+ )
+ (StructType)
+ (TupleType)
+ )
+))
+(let func (lambda '(item state) (Concat state item)))
+(let data (Apply fold list state func))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/NamedApply.yql b/yql/essentials/tests/s-expressions/suites/Udf/NamedApply.yql
new file mode 100644
index 0000000000..adfa44066a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/NamedApply.yql
@@ -0,0 +1,66 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let f1 (lambda '(x y) (block '(
+ (return (+ x (Coalesce y (Uint32 '100))))
+))))
+
+(let f1dep (lambda '(x dep) (block '(
+ (return (+ x x))
+))))
+
+(let tuple (lambda '() '((Uint32 '1) (Uint32 '2))))
+(let tuple_ctype (CallableType '() '((TupleType (DataType 'Uint32) (DataType 'Uint32)))))
+(let tuple_call (Callable tuple_ctype tuple))
+
+(let ctype (CallableType '() '((DataType 'Uint32)) '((DataType 'Uint32) 'Arg1) '((DataType 'Uint32) 'Arg2)))
+(let call (Callable ctype f1))
+
+(let optTuple1 (lambda '() '((Uint32 '1) (Just (Uint32 '2)))))
+(let optTuple2 (lambda '() '((Uint32 '1) (Nothing (OptionalType (DataType 'Uint32))))))
+(let optCtype (CallableType '('1)
+ '((DataType 'Uint32))
+ '((DataType 'Uint32) 'Arg1)
+ '((OptionalType (DataType 'Uint32)) 'Arg2)))
+(let optCall (Callable optCtype f1))
+
+(let s1 (AsStruct '('Arg2 (Uint32 '2)) '('Arg1 (Uint32 '1))))
+(let strType (CallableType '() '((TypeOf s1))))
+(let strCall (Callable strType (lambda '() s1)))
+
+# lambdas
+(let world (Write! world res_sink (Key) (NamedApply f1 '((Uint32 '1) (Uint32 '2)) (AsStruct)) '()))
+(let world (Write! world res_sink (Key) (NamedApply f1dep '((Uint32 '1)) (AsStruct) (DependsOn (Uint32 '2))) '()))
+
+# callables
+(let world (Write! world res_sink (Key) (NamedApply call '((Uint32 '1) (Uint32 '2)) (AsStruct)) '()))
+(let world (Write! world res_sink (Key) (NamedApply call (Apply tuple_call) (AsStruct)) '()))
+
+# opt. positional
+(let world (Write! world res_sink (Key) (NamedApply optCall '((Uint32 '1) (Uint32 '2)) (AsStruct)) '()))
+(let world (Write! world res_sink (Key) (NamedApply optCall (Apply optTuple1) (AsStruct)) '()))
+(let world (Write! world res_sink (Key) (NamedApply optCall (Apply optTuple2) (AsStruct)) '()))
+(let world (Write! world res_sink (Key) (NamedApply optCall '((Uint32 '1)) (AsStruct)) '()))
+
+# named
+(let world (Write! world res_sink (Key) (NamedApply call '((Uint32 '1)) (AsStruct
+'('Arg2 (Uint32 '2))
+)) '()))
+
+(let world (Write! world res_sink (Key) (NamedApply call '() (AsStruct
+'('Arg2 (Uint32 '2)) '('Arg1 (Uint32 '1))
+)) '()))
+
+(let world (Write! world res_sink (Key) (NamedApply call '() (Apply strCall)) '()))
+
+#opt. named
+(let world (Write! world res_sink (Key) (NamedApply optCall '() (AsStruct
+'('Arg1 (Uint32 '1))
+)) '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/NamedArgUdf.yql b/yql/essentials/tests/s-expressions/suites/Udf/NamedArgUdf.yql
new file mode 100644
index 0000000000..b32401ac2c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/NamedArgUdf.yql
@@ -0,0 +1,44 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let udf (Udf 'SimpleUdf.NamedArgs ))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf udf)) '('('type))))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1))
+ (AsStruct))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1) (Uint32 '2))
+ (AsStruct))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1))
+ (AsStruct '('C (Uint32 '3))))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1))
+ (AsStruct '('C (Uint32 '3)) '('D (Uint32 '4))))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1))
+ (AsStruct '('D (Uint32 '4))))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1) (Uint32 '2))
+ (AsStruct '('D (Uint32 '4))))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1) (Uint32 '2) (Uint32 '3))
+ (AsStruct))
+'()))
+(let world (Write! world res_sink (Key) (NamedApply udf
+ '((Uint32 '1) (Uint32 '2) (Uint32 '3) (Uint32 '4))
+ (AsStruct))
+'()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapName.yql b/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapName.yql
new file mode 100644
index 0000000000..719a56a72d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapName.yql
@@ -0,0 +1,60 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("NamedApply" ("Udf" '"SimpleUdf.Increment") '() (AsStruct
+ '('Arg1 (Cast (Member row '"key") 'Uint32)) '('Arg2 (Uint32 '"1"))
+ ))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("NamedApply" ("Udf" '"SimpleUdf.IncrementOpt") '() (AsStruct
+ '('Arg1 (Cast (Member row '"key") 'Uint32)) '('Arg2 (Uint32 '"2"))
+ ))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapPos.yql b/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapPos.yql
new file mode 100644
index 0000000000..37c8674711
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/NamedAutoMapPos.yql
@@ -0,0 +1,56 @@
+(
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("NamedApply" ("Udf" '"SimpleUdf.Increment") '((Cast (Member row '"key") 'Uint32) (Uint32 '"1")) (AsStruct))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"Input"))) '('"key") '()))
+ (let world (Left! x))
+ (let table0 (Right! x))
+ (let output (block '(
+ (let select (block '(
+ (let core table0)
+ (let core (FlatMap core (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res '"column0" ("NamedApply" ("Udf" '"SimpleUdf.IncrementOpt") '((Cast (Member row '"key") 'Uint32) (Uint32 '"2")) (AsStruct))))
+ (let res (AsList res))
+ (return res)
+ )))))
+ (return core)
+ )))
+ (return select)
+ )))
+ (let world (block '(
+ (let result_sink (DataSink 'result))
+ (let world (Write! world result_sink (Key) output '('('type) '('autoref) '('columns '('"column0")))))
+ (return (Commit! world result_sink))
+ )))
+ (return world)
+)))
+(let world (block '(
+ (let plato_sink (DataSink '"yt" '"plato"))
+ (let world (Commit! world plato_sink))
+ (return world)
+)))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.cfg b/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.cfg
new file mode 100644
index 0000000000..956cb08312
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+udf stat_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.yql b/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.yql
new file mode 100644
index 0000000000..affd7f4d55
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/OptionalReduceWithResource.yql
@@ -0,0 +1,45 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let udfTDigest_Create (Udf 'Stat.TDigest_Create))
+(let udfTDigest_AddValue (Udf 'Stat.TDigest_AddValue))
+(let udfTDigest_GetPercentile (Udf 'Stat.TDigest_GetPercentile))
+(let udfTDigest_Serialize (Udf 'Stat.TDigest_Serialize))
+(let udfTDigest_Deserialize (Udf 'Stat.TDigest_Deserialize))
+(let udfTDigest_Merge (Udf 'Stat.TDigest_Merge))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (let x (Apply udfTDigest_Create (Double '1.0)))
+ (let y (Apply udfTDigest_Create (Double '2.0)))
+ (let jx (Just x))
+ (let jy (Just y))
+ (let n (Nothing (OptionalType (TypeOf x))))
+ (let handler (lambda '(x y) (Apply udfTDigest_Merge x y)))
+ (let newValue value)
+ (let newValue (Concat newValue (String '" => ")))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Map
+ (OptionalReduce jx jy handler) (lambda '(r)
+ (ToString (Apply udfTDigest_GetPercentile r (Double '0.75))
+ ))) (String '?)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Map
+ (OptionalReduce jx n handler) (lambda '(r)
+ (ToString (Apply udfTDigest_GetPercentile r (Double '0.75))
+ ))) (String '?)))))
+ (let newValue (Concat newValue (Concat (String '" ") (Coalesce (Map
+ (OptionalReduce n n handler) (lambda '(r)
+ (ToString (Apply udfTDigest_GetPercentile r (Double '0.75))
+ ))) (String '?)))))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (Member item 'subkey)))
+ (let s (AddMember s 'value newValue))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.cfg b/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.cfg
new file mode 100644
index 0000000000..57571ef968
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.yql b/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.yql
new file mode 100644
index 0000000000..8703e76e49
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/OptionalRunConfig.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let x (String 'bbb))
+(let udf (Udf 'SimpleUdf.EchoWithRunPrefix (String 'aaa) (Void) '""))
+(let data (Apply udf x))
+(let world (Write! world res_sink (Key) data '()))
+(let udf (Udf 'SimpleUdf.EchoWithRunPrefix))
+(let data (Apply udf x))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.cfg
new file mode 100644
index 0000000000..57571ef968
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.yql b/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.yql
new file mode 100644
index 0000000000..ce81c3df0d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PartialCall.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let udf (Udf 'SimpleUdf.EchoWithPrefix))
+(let x (String 'aaa))
+(let y (String 'bbb))
+(let data (Apply udf x))
+(let world (Write! world res_sink (Key) data '()))
+(let data (Apply udf x y))
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.cfg
new file mode 100644
index 0000000000..9bed8d5096
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.yql b/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.yql
new file mode 100644
index 0000000000..4e5766f779
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PartialFieldsAfterRemap.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.cfg b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.cfg
new file mode 100644
index 0000000000..4de5e2339f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.cfg
@@ -0,0 +1,4 @@
+in Input Percentiles.txt
+out Output output.txt
+udf stat_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt
new file mode 100644
index 0000000000..b500ea3b02
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt
@@ -0,0 +1,16 @@
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="10"};
+{"key"="b";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="3"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.yql b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.yql
new file mode 100644
index 0000000000..0a15c6095a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Percentiles.yql
@@ -0,0 +1,45 @@
+(
+#comment
+(let udfTDigest_Create (Udf 'Stat.TDigest_Create))
+(let udfTDigest_AddValue (Udf 'Stat.TDigest_AddValue))
+(let udfTDigest_GetPercentile (Udf 'Stat.TDigest_GetPercentile))
+(let udfTDigest_Serialize (Udf 'Stat.TDigest_Serialize))
+(let udfTDigest_Deserialize (Udf 'Stat.TDigest_Deserialize))
+(let udfTDigest_Merge (Udf 'Stat.TDigest_Merge))
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let preMap (lambda '(item) (Just item)))
+(let keyExtractor (lambda '(item) (Member item 'key)))
+(let init (lambda '(key item) (Apply udfTDigest_Create (Unwrap (FromString (Member item 'value) 'Double)))))
+(let update (lambda '(key item state) (Apply udfTDigest_AddValue state (Unwrap (FromString (Member item 'value) 'Double)))))
+(let finish (lambda '(key state) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (Apply udfTDigest_Serialize state)))
+ (return (Just s))
+))))
+(let table2 (CombineByKey table1 preMap keyExtractor init update finish))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (ForwardList (Nth pair '1)))
+ (let init (lambda '(item) (Apply udfTDigest_Deserialize (Member item 'value))))
+ (let update (lambda '(item state) (Apply udfTDigest_Merge (Apply udfTDigest_Deserialize (Member item 'value)) state)))
+ (let state (Unwrap (Fold1 list init update)))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let g1 (ToString (Apply udfTDigest_GetPercentile state (Double '0.75))))
+ (let g2 (ToString (Apply udfTDigest_GetPercentile state (Double '0.999))))
+ (let s (AddMember s 'value (Concat (Concat g1 (String '" ")) g2)))
+ (let ret (Just s))
+ (return ret)
+))))))
+(let table3 (PartitionByKey table2 keyExtractor (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table3 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.cfg
new file mode 100644
index 0000000000..8bd0a53757
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf pire_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.yql b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.yql
new file mode 100644
index 0000000000..54c06596ad
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchInMap.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let udf (Udf 'Pire.Match (String '\d+)))
+(let table1map (Filter table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (Apply udf value))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.cfg
new file mode 100644
index 0000000000..d01e7622a0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf pire_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.yql b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.yql
new file mode 100644
index 0000000000..90391c2264
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PireMatchRes.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let udf (Udf 'Pire.Match (String '.?\d.?)))
+(let world (Write! world res_sink (Key) (Apply udf (String 'abc)) '()))
+(let world (Write! world res_sink (Key) (Apply udf (String 'x6y)) '()))
+(let world (Write! world res_sink (Key) (FormatType (TypeOf udf)) '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.cfg b/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.cfg
new file mode 100644
index 0000000000..8fa549ddb5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.cfg
@@ -0,0 +1,3 @@
+in Input input_proto.txt
+udf protobuf_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.yql b/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.yql
new file mode 100644
index 0000000000..c3b00f1716
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoField.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.cfg b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.cfg
new file mode 100644
index 0000000000..8dd001f619
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.cfg
@@ -0,0 +1,3 @@
+in Input input_proto_opt.txt
+udf protobuf_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.yql b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.yql
new file mode 100644
index 0000000000..c3b00f1716
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldOpt.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.cfg b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.cfg
new file mode 100644
index 0000000000..8fa549ddb5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.cfg
@@ -0,0 +1,3 @@
+in Input input_proto.txt
+udf protobuf_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.yql b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.yql
new file mode 100644
index 0000000000..89ab89671f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ProtoFieldScheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.yql
new file mode 100644
index 0000000000..62dc07db05
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonAvg.yql
@@ -0,0 +1,57 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let ui32 (DataType 'Uint32))
+(let dbl (DataType 'Double))
+(let rt (ResourceType 'Python2))
+
+(let udfScript (String '@@
+class AvgCalc:
+ def __init__(self):
+ self.__count = 0
+ self.__sum = 0
+
+ def add(self, value):
+ self.__sum = self.__sum + value
+ self.__count = self.__count + 1
+
+ def result(self):
+ return self.__sum / float(self.__count)
+
+def avg_create():
+ return AvgCalc()
+
+def avg_add(avg, value):
+ avg.add(value)
+ return avg
+
+def avg_result(avg):
+ return avg.result()
+
+@@))
+
+(let avgCreate (ScriptUdf 'Python 'avg_create (CallableType '() '(rt)) udfScript))
+(let avgAdd (ScriptUdf 'Python 'avg_add (CallableType '() '(rt) '(rt) '(ui32)) udfScript))
+(let avgResult (ScriptUdf 'Python 'avg_result (CallableType '() '(dbl) '(rt)) udfScript))
+
+# data
+(let x (Uint32 '10))
+(let y (Uint32 '30))
+(let z (Uint32 '5))
+
+# call udfs
+(let avg (Apply avgCreate))
+(let avg (Apply avgAdd avg x))
+(let avg (Apply avgAdd avg y))
+(let avg (Apply avgAdd avg z))
+(let result (Apply avgResult avg))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.cfg
new file mode 100644
index 0000000000..0bffbd4f08
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.yql
new file mode 100644
index 0000000000..36a70677e4
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsArg.yql
@@ -0,0 +1,31 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# common types
+(let ui64 (DataType 'Uint64))
+(let str (DataType 'String))
+
+# callable func
+(let funcType (CallableType '() '(str) '(str) '(ui64)))
+(let func (Udf 'SimpleUdf.Repeat))
+
+# python udf
+(let udfType (CallableType '() '(str) '(funcType) '(ui64)))
+(let udfScript (String '@@
+def new_string(func, x):
+ return func('x', x) + ':' + func('y', x)
+@@))
+(let udf (ScriptUdf 'Python 'new_string udfType udfScript))
+
+# call udf
+(let x (Uint64 '3))
+(let result (Apply udf func x))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.yql
new file mode 100644
index 0000000000..7a7a6a995a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonCallableAsResult.yql
@@ -0,0 +1,39 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let ui64 (DataType 'Uint64))
+(let str (DataType 'String))
+(let funcType (CallableType '() '(ui64) '(ui64)))
+
+(let udfType (CallableType '() '(funcType) '(ui64)))
+(let udfScript (String '@@
+def create_counter(start):
+ def counter(step):
+ v = counter.x
+ counter.x += step
+ return v
+
+ counter.x = start
+ return counter
+@@))
+
+(let udf (ScriptUdf 'Python 'create_counter udfType udfScript))
+
+# call udf
+(let counter (Apply udf (Uint64 '1)))
+(let result (AsList
+ (Apply counter (Uint64 '1))
+ (Apply counter (Uint64 '2))
+ (Apply counter (Uint64 '3))
+ (Apply counter (Uint64 '4))
+))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world res_sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.yql
new file mode 100644
index 0000000000..d225a14c1b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGenerator.yql
@@ -0,0 +1,26 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let i64 (DataType 'Int64))
+(let udfType (CallableType '() '((ListType i64))))
+(let udfScript (String '@@
+def g0():
+ def gen():
+ for x in xrange(1, 4):
+ yield long(x + 42)
+ return gen
+@@))
+(let udf (ScriptUdf 'Python 'g0 udfType udfScript))
+
+# call udf
+(let result (Apply udf))
+
+# output result with type
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.yql
new file mode 100644
index 0000000000..86a1c9a0bb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorExprWithClosure.yql
@@ -0,0 +1,25 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let i64 (DataType 'Int64))
+(let udfType (CallableType '() '((ListType i64)) '((ListType i64))))
+(let udfScript (String '@@
+def g(input):
+ def gen():
+ return (long(x + 42) for x in input)
+ return gen
+@@))
+(let udf (ScriptUdf 'Python 'g udfType udfScript))
+
+# call udf
+(let result (Apply udf (AsList (Int64 '1) (Int64 '2) (Int64 '3))))
+
+# output result with type
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.yql
new file mode 100644
index 0000000000..87799cbf69
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonGeneratorWithClosure.yql
@@ -0,0 +1,26 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let i64 (DataType 'Int64))
+(let udfType (CallableType '() '((ListType i64)) '((ListType i64))))
+(let udfScript (String '@@
+def h(input):
+ def gen():
+ for x in input:
+ yield long(x + 42)
+ return gen
+@@))
+(let udf (ScriptUdf 'Python 'h udfType udfScript))
+
+# call udf
+(let result (Apply udf (AsList (Int64 '1) (Int64 '2) (Int64 '3))))
+
+# output result with type
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) result '( '('type) )))
+
+# finish
+(return (Commit! world sink))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.yql
new file mode 100644
index 0000000000..f45e2d9157
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonPartialCall.yql
@@ -0,0 +1,22 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let ui32 (DataType 'Uint32))
+(let udfType (CallableType '('1) '(ui32) '(ui32) '((OptionalType ui32))))
+(let udfScript (String '"def Add(x, y): return x + (y if y is not None else 1)"))
+(let udf (ScriptUdf 'Python 'Add udfType udfScript))
+
+# call udf
+(let x (Uint32 '20))
+(let result (Apply udf x))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.yql
new file mode 100644
index 0000000000..38a484a4c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonStruct.yql
@@ -0,0 +1,33 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let ui32 (DataType 'Uint32))
+(let str (DataType 'String))
+(let personType (StructType '('name str) '('age ui32)))
+(let udfType (CallableType '() '(personType) '(str) '(ui32)))
+(let udfScript (String '@@
+
+class Person:
+ def __init__(self, name, age):
+ self.name = name
+ self.age = age
+
+def NewPerson(name, age):
+ return Person(name, age)
+
+@@))
+(let udf (ScriptUdf 'Python 'NewPerson udfType udfScript))
+
+# call udf
+(let result (Apply udf (String 'Jamel) (Uint32 '99)))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '()))
+
+# finish
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.cfg b/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.cfg
new file mode 100644
index 0000000000..0bbf3ad9f0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.yql b/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.yql
new file mode 100644
index 0000000000..b240dc0f58
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/PythonSum.yql
@@ -0,0 +1,23 @@
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+# prepare python udf
+(let ui32 (DataType 'Uint32))
+(let udfType (CallableType '() '(ui32) '(ui32) '(ui32)))
+(let udfScript (String '"def Sum(x, y): return x + y"))
+(let udf (ScriptUdf 'Python 'Sum udfType udfScript))
+
+# call udf
+(let x (Uint32 '10))
+(let y (Uint32 '32))
+(let result (Apply udf x y))
+
+# output result with type
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) result '( '('type) )))
+
+# finish
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.cfg
new file mode 100644
index 0000000000..ce0f9208d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.yql
new file mode 100644
index 0000000000..894e1a15a1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapCopy.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.cfg
new file mode 100644
index 0000000000..cb892c3e09
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.cfg
@@ -0,0 +1,4 @@
+in Input input2.txt
+out Output output.txt
+udf dummylog
+udf pire_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.yql
new file mode 100644
index 0000000000..c3752b674e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let udf (Udf 'Pire.Match (String '@@.*\d.*@@)))
+(let table1map (Filter table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (Apply udf value))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.cfg
new file mode 100644
index 0000000000..b6d398353a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.cfg
@@ -0,0 +1,5 @@
+in Input input2.txt
+in Input2 input3.txt
+out Output output.txt
+udf dummylog
+udf pire_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.yql
new file mode 100644
index 0000000000..58c57253c1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapFilter2.yql
@@ -0,0 +1,22 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+'(
+(Key '('table (String 'Input)))
+(Key '('table (String 'Input2)))
+)
+
+'('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let udf (Udf 'Pire.Match (String '@@.*\d.*@@)))
+(let table1map (Filter table1 (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (Apply udf value))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.cfg
new file mode 100644
index 0000000000..cf41c46471
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.cfg
@@ -0,0 +1,6 @@
+in Input1 input_many1.txt
+in Input2 input_many2.txt
+in Input3 input_many3.txt
+in Input4 input_many4.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.yql
new file mode 100644
index 0000000000..fad593cd98
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdf.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+(Key '('table (MrTableRange '"" (lambda '($i) (And (>= $i (String '"Input1")) (<= $i (String '"Input~")))) '"")))
+'('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableLimit (Take table (Uint64 '9)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tableLimit '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.cfg
new file mode 100644
index 0000000000..227f4e34f7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.cfg
@@ -0,0 +1,7 @@
+in Input1 input_many1.txt
+in Input2 input_many1.txt
+in Input3 input_many2.txt
+in Input4 input_many2.txt
+out Output output.txt
+udf dummylog
+udf pire_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.yql
new file mode 100644
index 0000000000..d86392d08a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeDiffUdfPartial.yql
@@ -0,0 +1,19 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+(Key '('table (MrTableRange '"" (lambda '($i) (And (>= $i (String '"Input1")) (<= $i (String '"Input~")))) '"")))
+'('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let udf (Udf 'Pire.Match (String '@@.*\d.*@@)))
+(let table (Filter table (lambda '(item) (block '(
+ (let value (Member item 'value))
+ (return (Apply udf value))
+)))))
+(let tableLimit (Take table (Uint64 '9)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tableLimit '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.cfg
new file mode 100644
index 0000000000..076884ed54
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.cfg
@@ -0,0 +1,6 @@
+in Input1 input_many1.txt
+in Input2 input_many1.txt
+in Input3 input_many1.txt
+in Input4 input_many1.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.yql
new file mode 100644
index 0000000000..fad593cd98
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapRangeSameUdf.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source
+(Key '('table (MrTableRange '"" (lambda '($i) (And (>= $i (String '"Input1")) (<= $i (String '"Input~")))) '"")))
+'('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let tableLimit (Take table (Uint64 '9)))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) tableLimit '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.cfg
new file mode 100644
index 0000000000..ce0f9208d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.yql
new file mode 100644
index 0000000000..df1bf89415
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapReduce.yql
@@ -0,0 +1,25 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let listHandler (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let list (Collect (Nth pair '1)))
+ (let r (FlatMap list (lambda '(x) (block '(
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value (ToString (Length list))))
+ (return (AsList s))
+ )))))
+ (return r)
+))))))
+(let keySelector (lambda '(x) (Member x 'key)))
+(let reducedTable (PartitionByKey table1 keySelector (Void) (Void) listHandler))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) reducedTable '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.cfg
new file mode 100644
index 0000000000..ce0f9208d8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.yql
new file mode 100644
index 0000000000..01df591aa8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapSort.yql
@@ -0,0 +1,14 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let output (Sort table1 (Bool 'true) (lambda '(item) (block '(
+ (return (Member item 'key))
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) output '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.cfg
new file mode 100644
index 0000000000..43da70bb81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.cfg
@@ -0,0 +1,4 @@
+in Input input2.txt
+out Output output.txt
+udf dummylog
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.yql
new file mode 100644
index 0000000000..09a346ac6d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWeakRange.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (MrTableRange '"" (lambda '($i) (And (>= $i (String '"Input")) (<= $i (String '"Input~")))) '""))) '('key) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.cfg
new file mode 100644
index 0000000000..5f1288aa57
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+out Output output.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.yql
new file mode 100644
index 0000000000..ffc63f7bb5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigCopy.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1 '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.cfg b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.cfg
new file mode 100644
index 0000000000..9bed8d5096
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.yql b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.yql
new file mode 100644
index 0000000000..b39a63ed36
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/RecordRemapWithConfigResult.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.cfg b/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.cfg
new file mode 100644
index 0000000000..c60ed039b2
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.cfg
@@ -0,0 +1,2 @@
+in Input input5.txt
+udf structs_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.yql b/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.yql
new file mode 100644
index 0000000000..2f14a89709
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/ResultWithRemapConfig.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let table (Right! x))
+(let sink (DataSink 'result))
+(let world (Write! world sink (Key) table '('('type))))
+(let world (Commit! world sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Sleep.cfg b/yql/essentials/tests/s-expressions/suites/Udf/Sleep.cfg
new file mode 100644
index 0000000000..7cb3e39eea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Sleep.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/Sleep.yql b/yql/essentials/tests/s-expressions/suites/Udf/Sleep.yql
new file mode 100644
index 0000000000..86d036c80f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/Sleep.yql
@@ -0,0 +1,35 @@
+(
+(let sleep (Udf 'SimpleUdf.Sleep))
+(let 01sec (Uint64 '100000))
+(let 05sec (Uint64 '500000))
+(let 03sec (Uint64 '300000))
+
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let data1 (Apply sleep (+ 05sec 01sec)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '1)))
+ (let s (AddMember s 'value (ToString data1)))
+ (return s)
+)))))
+(let table2map (Map table1 (lambda '(item) (block '(
+ (let data1 (Apply sleep (+ 03sec 03sec)))
+ (let s (Struct))
+ (let s (AddMember s 'key (Member item 'key)))
+ (let s (AddMember s 'subkey (String '2)))
+ (let s (AddMember s 'value (ToString data1)))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt 'plato))
+(let res_sink (DataSink 'result))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '()))
+(let world (Write! world res_sink (Key) table2map '()))
+(let world (Commit! world mr_sink))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.cfg b/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.yql b/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.yql
new file mode 100644
index 0000000000..6085f8d620
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/StringJoinFromList.yql
@@ -0,0 +1,21 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '()))
+(let world (Left! x))
+(let table1 (Right! x))
+(let udf (Udf 'String.JoinFromList))
+(let table1map (Map table1 (lambda '(item) (block '(
+ (let key (Member item 'key))
+ (let value (Apply udf (AsList (Member item 'key) (Member item 'subkey) (Member item 'value)) (String '"_")))
+ (let s (Struct))
+ (let s (AddMember s 'key key))
+ (let s (AddMember s 'subkey (String '.)))
+ (let s (AddMember s 'value value))
+ (return s)
+)))))
+(let mr_sink (DataSink 'yt (quote plato)))
+(let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.cfg b/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.cfg
new file mode 100644
index 0000000000..9bed8d5096
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.yql b/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.yql
new file mode 100644
index 0000000000..dd7da1dfb0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TableSchemeWithRemap.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input))) (Void) '()))
+(let world (Left! x))
+(let scheme (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) scheme '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.cfg b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.cfg
new file mode 100644
index 0000000000..38a048bf8d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.cfg
@@ -0,0 +1,4 @@
+in Input TopFreq.txt
+out Output output.txt
+udf topfreq_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt
new file mode 100644
index 0000000000..b500ea3b02
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt
@@ -0,0 +1,16 @@
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="10"};
+{"key"="b";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="3"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="a";"subkey"=".";"value"="2"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
+{"key"="b";"subkey"=".";"value"="1"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.yql b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.yql
new file mode 100644
index 0000000000..ff322d1a1e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TopFreq.yql
@@ -0,0 +1,47 @@
+#program
+(
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(import agg_module '"/lib/yql/aggregate.yql")
+(let list (AsList
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '1))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '4))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '1)) '('value (Just (Int32 '1))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '2))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '2))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '2))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '2)) '('value (Just (Int32 '1))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '1))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '2))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '3))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '4))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '5))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '6))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '7))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '8))))
+(AsStruct '('key (Int32 '3)) '('value (Just (Int32 '9))))
+))
+(let res_sink (DataSink 'result))
+(let topfreq_traits (Apply (bind agg_module 'topfreq_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value)) (Uint32 '2) (Uint32 '2)))
+(let resKey (Aggregate list '('key) '('('topfreq_value topfreq_traits))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+
+(let topfreq_traits2 (Apply (bind agg_module 'topfreq_traits_factory) (TypeOf list) (lambda '(row) (Unwrap (ToString (Member row 'value)))) (Uint32 '2) (Uint32 '2)))
+(let resKey (Aggregate list '('key) '('('topfreq_value topfreq_traits2))))
+(let world (Write! world res_sink (Key) resKey '('('type))))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.cfg b/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.cfg
new file mode 100644
index 0000000000..3d92a5a733
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.cfg
@@ -0,0 +1,2 @@
+udf type_inspection_udf
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.yql b/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.yql
new file mode 100644
index 0000000000..eecfa7e41d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/TypeInspection.yql
@@ -0,0 +1,32 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+
+(let res_sink (DataSink 'result))
+(let list1 (AsList (String 'A) (String 'B) (String 'C) (String 'D) (String 'E)))
+(let list2 (AsList (Uint32 '1) (Uint32 '2) (Uint32 '3)))
+(let zip (Udf 'TypeInspection.Zip (Void)
+ (TupleType
+ (TypeOf '(list1 list2))
+ (StructType)
+ (TupleType)
+ )
+))
+(let data (Apply zip list1 list2))
+(let world (Write! world res_sink (Key) data '('('type))))
+
+(let stream1 (Iterator list1))
+(let stream2 (Iterator list2))
+(let interleave (Udf 'TypeInspection.Interleave (Void)
+ (TupleType
+ (TypeOf '(stream1 stream2))
+ (StructType)
+ (TupleType)
+ )
+))
+(let data (Apply interleave stream1 stream2))
+(let world (Write! world res_sink (Key) (Collect data) '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/block_4_columns.csv b/yql/essentials/tests/s-expressions/suites/Udf/block_4_columns.csv
new file mode 100644
index 0000000000..15956fb4fe
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/block_4_columns.csv
@@ -0,0 +1,7 @@
+a,b,c,d
+1,2,3,4
+one,two,three,four
+A,B,C,D
+
+E,F,G,dgf
+G,H,I,J
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/default.cfg b/yql/essentials/tests/s-expressions/suites/Udf/default.cfg
new file mode 100644
index 0000000000..7cb3e39eea
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/file_3_columns.csv b/yql/essentials/tests/s-expressions/suites/Udf/file_3_columns.csv
new file mode 100644
index 0000000000..e4324930c7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/file_3_columns.csv
@@ -0,0 +1,8 @@
+key,subkey,value
+String,String,String
+k1,sk1,v1
+k2,sk2,v2
+
+
+this line will be ignored
+
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input.txt b/yql/essentials/tests/s-expressions/suites/Udf/input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input2.txt b/yql/essentials/tests/s-expressions/suites/Udf/input2.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input2.txt.attr
new file mode 100644
index 0000000000..c6f7f36696
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input2.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input3.txt b/yql/essentials/tests/s-expressions/suites/Udf/input3.txt
new file mode 100644
index 0000000000..090fe1cefd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input3.txt
@@ -0,0 +1,4 @@
+{"key"="834";"subkey"="5";"value"="aa"};
+{"key"="987";"subkey"="6";"value"="798"};
+{"key"="124";"subkey"="7";"value"="001"};
+{"key"="623";"subkey"="8";"value"="002"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input3.txt.attr
new file mode 100644
index 0000000000..c6f7f36696
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input3.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input4.txt b/yql/essentials/tests/s-expressions/suites/Udf/input4.txt
new file mode 100644
index 0000000000..090fe1cefd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input4.txt
@@ -0,0 +1,4 @@
+{"key"="834";"subkey"="5";"value"="aa"};
+{"key"="987";"subkey"="6";"value"="798"};
+{"key"="124";"subkey"="7";"value"="001"};
+{"key"="623";"subkey"="8";"value"="002"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input4.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input4.txt.attr
new file mode 100644
index 0000000000..5c5444bff8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input4.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord2";
+ "_yql_read_udf_type_config"="AAA";
+ "_yql_read_udf_run_config"="BBB";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input5.txt b/yql/essentials/tests/s-expressions/suites/Udf/input5.txt
new file mode 100644
index 0000000000..de514b7e8b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input5.txt
@@ -0,0 +1,2 @@
+{"key"="Vasya";"subkey"="Pupkin";"value"="33"};
+{"key"="Naum";"subkey"="Prikhoder";"value"="66"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input5.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input5.txt.attr
new file mode 100644
index 0000000000..6c072165b5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input5.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="Person.New";
+ "_yql_read_udf_type_config"="RemapKSV";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt
new file mode 100644
index 0000000000..2fa12a4a52
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt
@@ -0,0 +1,5 @@
+{"key"="075";"subkey"="1_1";"value"="a7c"};
+{"key"="800";"subkey"="2_1";"value"="ddd"};
+{"key"="020";"subkey"="3_1";"value"="q"};
+{"key"="150";"subkey"="4_1";"value"="q8z"};
+{"key"="200";"subkey"="5_1";"value"="a7a"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt.attr
new file mode 100644
index 0000000000..5f9afadd11
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many1.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_read_udf_type_config"="1";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt
new file mode 100644
index 0000000000..2b1bab42f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt
@@ -0,0 +1,5 @@
+{"key"="075";"subkey"="1_2";"value"="a7c"};
+{"key"="800";"subkey"="2_2";"value"="ddd"};
+{"key"="020";"subkey"="3_2";"value"="q"};
+{"key"="150";"subkey"="4_2";"value"="q8z"};
+{"key"="200";"subkey"="5_2";"value"="a7a"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt.attr
new file mode 100644
index 0000000000..4e7e0e6b62
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many2.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_read_udf_type_config"="2";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt
new file mode 100644
index 0000000000..2ce03b8925
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1_3";"value"="a7c"};
+{"key"="800";"subkey"="2_3";"value"="ddd"};
+{"key"="020";"subkey"="3_3";"value"="q"};
+{"key"="150";"subkey"="4_3";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt.attr
new file mode 100644
index 0000000000..f09165629a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many3.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_read_udf_type_config"="3";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt
new file mode 100644
index 0000000000..c9f1e005d9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1_4";"value"="a7c"};
+{"key"="800";"subkey"="2_4";"value"="ddd"};
+{"key"="020";"subkey"="3_4";"value"="q"};
+{"key"="150";"subkey"="4_4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt.attr
new file mode 100644
index 0000000000..f491d07f59
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_many4.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="DummyLog.ReadRecord";
+ "_yql_read_udf_type_config"="4";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt
new file mode 100644
index 0000000000..d2eaef7f29
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt
@@ -0,0 +1 @@
+{"key"="1";"subkey"="\n\x10\x08\7\x12\x0C\n\ntext value";"value"="\n\x10\x08\7\x12\x0C\n\ntext value"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt.attr
new file mode 100644
index 0000000000..f11824f2b8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_proto.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_proto_field_value"="{\"name\":\"TA\",\"meta\":\"H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==\",\"lists\":{\"optional\":true}}";
+ "_yql_proto_field_subkey"="{\"name\":\"TA\",\"meta\":\"H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==\",\"lists\":{\"optional\":true}}";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt b/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt
new file mode 100644
index 0000000000..d2eaef7f29
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt
@@ -0,0 +1 @@
+{"key"="1";"subkey"="\n\x10\x08\7\x12\x0C\n\ntext value";"value"="\n\x10\x08\7\x12\x0C\n\ntext value"};
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt.attr b/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt.attr
new file mode 100644
index 0000000000..ad3ff15521
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/input_proto_opt.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"String"]]];["value";["OptionalType";["DataType";"String"]]]]]};
+ "_yql_proto_field_value"="{\"name\":\"TA\",\"meta\":\"H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==\",\"lists\":{\"optional\":true}}";
+ "_yql_proto_field_subkey"="{\"name\":\"TA\",\"meta\":\"H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==\",\"lists\":{\"optional\":true}}";
+}
diff --git a/yql/essentials/tests/s-expressions/suites/Udf/struct_4_fields.csv b/yql/essentials/tests/s-expressions/suites/Udf/struct_4_fields.csv
new file mode 100644
index 0000000000..fab478d14a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/Udf/struct_4_fields.csv
@@ -0,0 +1,5 @@
+F1I,F2OI,F3N,F4ON
+Int32,Uint32?,Float,Double?
+1,,1.5,3.1415926
+5,1,2.5,
+-12,100,44,105 \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg
new file mode 100644
index 0000000000..2ac9312f92
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input6.txt
+in InputView input_view.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql
new file mode 100644
index 0000000000..5a2597e5cc
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql
@@ -0,0 +1,32 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+(let res_sink (DataSink 'result))
+(let source_any (DataSource 'yt '"$all"))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let x1 (Read! world mr_source (Key
+ '('table (String 'InputView))
+) (Void) '()))
+
+(let world (Left! x1))
+(let data (Right! x1))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+
+(let x2 (Read! world mr_source (Key
+ '('table (String 'InputView))
+) (Void) '()))
+
+(let world (Left! x2))
+(let data (Right! x2))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg b/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg
new file mode 100644
index 0000000000..db6c9d1b8c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg
@@ -0,0 +1,4 @@
+in Input input3.txt
+out Output output.txt
+res result.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql b/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql
new file mode 100644
index 0000000000..3fa0a24d9b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql
@@ -0,0 +1,50 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('dict) '()))
+(let world (Left! x))
+(let Input (Right! x))
+(let select1_input11 Input)
+(let output12 (block '(
+ (let select1_output select1_input11)
+ (let select1_output (Filter select1_output (lambda '(row) (block '(
+ (let res (Coalesce (!= (Not (Exists (Lookup (Member row 'dict) (String '"c")))) (Bool 'true)) (Bool 'false)))
+ (return res)
+)
+))))
+ (let select1_output (PartitionByKey select1_output (lambda '(row) (block '(
+ (let res (String '""))
+ (return res)
+)
+)) (Void) (Void) (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let group (ForwardList (Nth pair '1)))
+ (let aggr (Fold1 group (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'Count7 (Convert (Exists (Unwrap (Lookup (Member row 'dict) (String '"a")))) 'Uint64)))
+ (return res)
+)
+)) (lambda '(row state) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'Count7 (OptionalReduce (Member state 'Count7) (Convert (Exists (Unwrap (Lookup (Member row 'dict) (String '"a")))) 'Uint64) (lambda '(a b) (+ a b)))))
+ (return res)
+)
+))))
+ (let res (FlatMap aggr (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'a_count (Member row 'Count7)))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return res)
+)))))
+))
+ (return select1_output)
+)
+))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) output12 '('('type) '('autoref) '('columns '('a_count)))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg
new file mode 100644
index 0000000000..db6c9d1b8c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg
@@ -0,0 +1,4 @@
+in Input input3.txt
+out Output output.txt
+res result.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql
new file mode 100644
index 0000000000..f186cb7101
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql
@@ -0,0 +1,53 @@
+(
+(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('dict 'key) '()))
+(let world (Left! x))
+(let Input (Right! x))
+(let select1_input12 Input)
+(let output13 (block '(
+ (let select1_output select1_input12)
+ (let select1_output (Filter select1_output (lambda '(row) (block '(
+ (let res (Coalesce (!= (Not (Exists (Lookup (Member row 'dict) (String '"b")))) (Bool 'true)) (Bool 'false)))
+ (return res)
+)
+))))
+ (let select1_output (PartitionByKey select1_output (lambda '(row) (block '(
+ (let res (Member row 'key))
+ (return res)
+)
+)) (Void) (Void) (lambda '(stream) (FlatMap stream (lambda '(pair) (block '(
+ (let key (Nth pair '0))
+ (let group (ForwardList (Nth pair '1)))
+ (let aggr (Fold1 group (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'key (Member row 'key)))
+ (let res (AddMember res 'Count7 (Convert (Exists (Lookup (Member row 'dict) (String '"a"))) 'Uint64)))
+ (return res)
+)
+)) (lambda '(row state) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'key (Member row 'key)))
+ (let res (AddMember res 'Count7 (OptionalReduce (Member state 'Count7) (Convert (Exists (Lookup (Member row 'dict) (String '"a"))) 'Uint64) (lambda '(a b) (+ a b)))))
+ (return res)
+)
+))))
+ (let res (FlatMap aggr (lambda '(row) (block '(
+ (let res (Struct))
+ (let res (AddMember res 'key (Member row 'key)))
+ (let res (AddMember res 'a (Member row 'Count7)))
+ (let res (AsList res))
+ (return res)
+)
+))))
+ (return res)
+)))
+))))
+ (return select1_output)
+)
+))
+(let result_sink (DataSink 'result))
+(let world (Write! world result_sink (Key) output13 '('('type) '('autoref) '('columns '('key 'a)))))
+(let plato_sink (DataSink 'yt 'plato))
+(let world (Commit! world plato_sink))
+(let world (Commit! world result_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg
new file mode 100644
index 0000000000..44b1761859
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg
@@ -0,0 +1,4 @@
+in Input input2.txt
+out Output output.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql
new file mode 100644
index 0000000000..3574c04daf
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key1))) '('column0) '() ) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg
new file mode 100644
index 0000000000..44b1761859
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg
@@ -0,0 +1,4 @@
+in Input input2.txt
+out Output output.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql
new file mode 100644
index 0000000000..7e579328e6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key2))) '('column0) '() ) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg
new file mode 100644
index 0000000000..44b1761859
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg
@@ -0,0 +1,4 @@
+in Input input2.txt
+out Output output.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql
new file mode 100644
index 0000000000..5d429021c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'key1))) (Void) '()) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1Data.yql b/yql/essentials/tests/s-expressions/suites/View/Key1Data.yql
new file mode 100644
index 0000000000..85a3398e41
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1Data.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let source_any (DataSource 'yt '"$all"))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key1))) '('column0) '() ) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql b/yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql
new file mode 100644
index 0000000000..5d429021c3
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'key1))) (Void) '()) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql b/yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql
new file mode 100644
index 0000000000..0a9e55e5a5
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input))) (Void) '()) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/NoReadData.yql b/yql/essentials/tests/s-expressions/suites/View/NoReadData.yql
new file mode 100644
index 0000000000..7e27b9b42a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/NoReadData.yql
@@ -0,0 +1,16 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let source_any (DataSource 'yt '"$all"))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'noread))) '('value) '() ) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql b/yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql
new file mode 100644
index 0000000000..b231e96834
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'noread))) (Void) '()) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/RawView.cfg b/yql/essentials/tests/s-expressions/suites/View/RawView.cfg
new file mode 100644
index 0000000000..61289d7a17
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/RawView.cfg
@@ -0,0 +1,4 @@
+in Input1 input2.txt
+in Input2 input5.txt
+res result.txt
+udf dummylog
diff --git a/yql/essentials/tests/s-expressions/suites/View/RawView.yql b/yql/essentials/tests/s-expressions/suites/View/RawView.yql
new file mode 100644
index 0000000000..d23c50d85c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/RawView.yql
@@ -0,0 +1,40 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let res_sink (DataSink 'result))
+(let source_any (DataSource 'yt '"$all"))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'Input1))
+ '('view (String 'raw))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'Input1))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'Input2))
+ '('view (String 'raw))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg
new file mode 100644
index 0000000000..2ac9312f92
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input6.txt
+in InputView input_view.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql
new file mode 100644
index 0000000000..8588e4df39
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql
@@ -0,0 +1,21 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+(let res_sink (DataSink 'result))
+(let source_any (DataSource 'yt '"$all"))
+
+(let world (Configure! world source_any '"Attr" '"inferschema" '"1"))
+(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m"))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'InputView))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg
new file mode 100644
index 0000000000..2ac9312f92
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input6.txt
+in InputView input_view.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql
new file mode 100644
index 0000000000..c90fdf788a
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql
@@ -0,0 +1,17 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let mr_sink (DataSink 'yt 'plato))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key
+ '('tablescheme (String 'InputView))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql
new file mode 100644
index 0000000000..f5eb0c356b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'trivial))) '('value) '() ) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let mr_sink (DataSink 'yt 'plato))
+(let world (Write! world mr_sink (Key '('table (String 'Output)) ) table1 '() ))
+(let world (Commit! world mr_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql b/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql
new file mode 100644
index 0000000000..8062a7feb8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql
@@ -0,0 +1,11 @@
+(
+#comment
+(let mr_source (DataSource 'yt 'plato))
+(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'trivial))) (Void) '()) )
+(let world (Left! x))
+(let table1 (Right! x))
+(let res_sink (DataSink 'result))
+(let world (Write! world res_sink (Key) table1 '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg
new file mode 100644
index 0000000000..d3e8c7c671
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+udf simple_udf
diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql
new file mode 100644
index 0000000000..4d2b6066ad
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'Input))
+ '('view (String 'key1))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg
new file mode 100644
index 0000000000..b2849b4f98
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg
@@ -0,0 +1,3 @@
+in Input input6.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql
new file mode 100644
index 0000000000..e5dc7a8838
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql
@@ -0,0 +1,16 @@
+(
+(let mr_source (DataSource 'yt 'plato))
+(let res_sink (DataSink 'result))
+
+(let x (Read! world mr_source (Key
+ '('table (String 'Input))
+ '('view (String 'my))
+) (Void) '()))
+
+(let world (Left! x))
+(let data (Right! x))
+
+(let world (Write! world res_sink (Key) data '()))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/View/default.cfg b/yql/essentials/tests/s-expressions/suites/View/default.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/s-expressions/suites/View/input.txt b/yql/essentials/tests/s-expressions/suites/View/input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input.txt.attr
new file mode 100644
index 0000000000..06c67fd2cb
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_view_trivial"="SELECT key, subkey, value FROM self";
+ "_yql_view_key1"="SELECT key || \"key\" FROM self";
+ "_yql_view_noread"="SELECT 1 as key, 2 as value";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/View/input2.txt b/yql/essentials/tests/s-expressions/suites/View/input2.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr
new file mode 100644
index 0000000000..4e7dfb3804
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr
@@ -0,0 +1,37 @@
+{
+ "_yql_view_trivial"="SELECT key, subkey, value FROM self";
+ "_yql_view_key1"="SELECT key || \"key\" FROM self";
+ "_yql_view_key2"="SELECT key || \"key\" FROM self_raw";
+ "_yql_view_noread"="SELECT 1 as key, 2 as value";
+ "_yql_read_udf"="DummyLog.ReadRecord2";
+ "_yql_read_udf_type_config"="AAA";
+ "_yql_read_udf_run_config"="BBB";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/View/input3.txt b/yql/essentials/tests/s-expressions/suites/View/input3.txt
new file mode 100644
index 0000000000..ad6793f93c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a=B@@b=a@@c=a"};
+{"key"="800";"subkey"="2";"value"="b=1@@c=2@@d=3"};
+{"key"="020";"subkey"="3";"value"="a=i@@c=j"};
+{"key"="150";"subkey"="4";"value"="a=A"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr
new file mode 100644
index 0000000000..14544c6d7b
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="Dsv.ReadRecord";
+ "_yql_read_udf_run_config"="@@";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/View/input4.txt b/yql/essentials/tests/s-expressions/suites/View/input4.txt
new file mode 100644
index 0000000000..d15f960f63
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input4.txt
@@ -0,0 +1,10 @@
+{"key"="0";"subkey"="-";"value"="zero"};
+{"key"="1";"subkey"="-";"value"="one"};
+{"key"="2";"subkey"="-";"value"="two"};
+{"key"="3";"subkey"="-";"value"="three"};
+{"key"="4";"subkey"="-";"value"="four"};
+{"key"="5";"subkey"="-";"value"="five"};
+{"key"="6";"subkey"="-";"value"="six"};
+{"key"="7";"subkey"="-";"value"="seven"};
+{"key"="8";"subkey"="-";"value"="eight"};
+{"key"="9";"subkey"="-";"value"="nine"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr
new file mode 100644
index 0000000000..e6e4b7d750
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_key1"="SELECT SimpleUdf::Concat(SimpleUdf::Concat(key, \" - \"), value) FROM self";
+ "_yql_view_key2"="SELECT key || \"key\" FROM self_raw";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/View/input5.txt b/yql/essentials/tests/s-expressions/suites/View/input5.txt
new file mode 100644
index 0000000000..24f23d3d81
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input5.txt
@@ -0,0 +1 @@
+{"key"="foo";"subkey"=".";"value"="bar"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input5.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input5.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input5.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/View/input6.txt b/yql/essentials/tests/s-expressions/suites/View/input6.txt
new file mode 100644
index 0000000000..d15f960f63
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input6.txt
@@ -0,0 +1,10 @@
+{"key"="0";"subkey"="-";"value"="zero"};
+{"key"="1";"subkey"="-";"value"="one"};
+{"key"="2";"subkey"="-";"value"="two"};
+{"key"="3";"subkey"="-";"value"="three"};
+{"key"="4";"subkey"="-";"value"="four"};
+{"key"="5";"subkey"="-";"value"="five"};
+{"key"="6";"subkey"="-";"value"="six"};
+{"key"="7";"subkey"="-";"value"="seven"};
+{"key"="8";"subkey"="-";"value"="eight"};
+{"key"="9";"subkey"="-";"value"="nine"};
diff --git a/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr
new file mode 100644
index 0000000000..501fdca6db
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_my"="$udfScript=\"def f(row):\n\treturn {'myvalue':b'm' + row.value}\n\";$udf=Python::f(Callable<(Struct<key:String,subkey:String,value:String>)->Struct<myvalue:String>>, $udfScript);PROCESS self USING $udf(TableRow());";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/s-expressions/suites/View/input_view.txt b/yql/essentials/tests/s-expressions/suites/View/input_view.txt
new file mode 100644
index 0000000000..d664c9eec9
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input_view.txt
@@ -0,0 +1,10 @@
+$f = ($x)->{return $x+1};
+
+select key,min(num) as num from (
+select key,$f(0) as `num` from Input1
+union all
+select key,$f(1) as `num` from Input2
+)
+group by key
+order by key
+
diff --git a/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr
new file mode 100644
index 0000000000..41ea51e276
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_yql_type"="view";
+ "type"="document";
+}
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.cfg b/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.cfg
new file mode 100644
index 0000000000..907c9ea175
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.cfg
@@ -0,0 +1,3 @@
+res result.txt
+file myfile yql/essentials/udfs/test/test_import/libtest_import_udf.so
+os linux
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.yql
new file mode 100644
index 0000000000..92abfcd35c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureImportUdf.yql
@@ -0,0 +1,12 @@
+# not supported on windows
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'ImportUdfs 'myfile))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (Apply (Udf 'TestImportUdf.Concat) (String 'abc) (String '"")))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureList.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureList.yql
new file mode 100644
index 0000000000..224d23514f
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureList.yql
@@ -0,0 +1,10 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint32 '1)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureLongList.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureLongList.yql
new file mode 100644
index 0000000000..94a8922948
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureLongList.yql
@@ -0,0 +1,15 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (AsList (Uint32 '1)))
+(let data (Extend data data data data data))
+(let data (Extend data data data data data))
+(let data (Extend data data data data data))
+(let data (Extend data data data data data))
+(let data (Extend data data))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureNonList.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureNonList.yql
new file mode 100644
index 0000000000..eb00aa902e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureNonList.yql
@@ -0,0 +1,10 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (Uint32 '1))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureStructList.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureStructList.yql
new file mode 100644
index 0000000000..0c6513f8c7
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureStructList.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (AsList
+ (AsStruct '('b (Uint32 '1)) '('a (String 'a)) '('c (String 'DDD)))
+ (AsStruct '('b (Uint32 '2)) '('a (String 'b)) '('c (String 'EEE)))
+))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureStructListWithFields.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureStructListWithFields.yql
new file mode 100644
index 0000000000..623ed4b8b0
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureStructListWithFields.yql
@@ -0,0 +1,13 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (AsList
+ (AsStruct '('b (Uint32 '1)) '('a (String 'a)) '('c (String 'DDD)))
+ (AsStruct '('b (Uint32 '2)) '('a (String 'b)) '('c (String 'EEE)))
+))
+(let world (Write! world res_sink (Key) data '('('type) '('columns '('c 'a 'b)))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.cfg b/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.cfg
new file mode 100644
index 0000000000..8da645df35
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.cfg
@@ -0,0 +1,3 @@
+res result.txt
+udf simple_udf
+
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.yql b/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.yql
new file mode 100644
index 0000000000..0f09553c83
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/PureUdf.yql
@@ -0,0 +1,10 @@
+(
+#comment
+(let config (DataSource 'config))
+(let world (Configure! world config 'PureDataSource 'yt))
+(let res_sink (DataSink 'result))
+(let data (Apply (Udf 'SimpleUdf.Echo) (String 'abc)))
+(let world (Write! world res_sink (Key) data '('('type))))
+(let world (Commit! world res_sink))
+(return world)
+)
diff --git a/yql/essentials/tests/s-expressions/suites/YtNative/default.cfg b/yql/essentials/tests/s-expressions/suites/YtNative/default.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/YtNative/default.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/sql/sql2yql/canondata/result.json b/yql/essentials/tests/sql/sql2yql/canondata/result.json
new file mode 100644
index 0000000000..ef8ca7ee6c
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/canondata/result.json
@@ -0,0 +1,36962 @@
+{
+ "test_sql2yql.test[action-action_eval_cluster_and_table]": [
+ {
+ "checksum": "e50e5e3c29832cb8e71135afa0f904cc",
+ "size": 1415,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-action_eval_cluster_and_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_eval_cluster_table]": [
+ {
+ "checksum": "7719b45af40c3a4dca80cbdebe31ce36",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-action_eval_cluster_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_eval_cluster_table_for]": [
+ {
+ "checksum": "285801684e62983b2e73c42baadae366",
+ "size": 1754,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-action_eval_cluster_table_for_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_eval_cluster_use]": [
+ {
+ "checksum": "a88edb9b716efe2fc4bceedacaedf0f5",
+ "size": 1416,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-action_eval_cluster_use_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_eval_cluster_use_compact_named_exprs]": [
+ {
+ "checksum": "35a3048bab0205c637649c7aae6a5268",
+ "size": 2836,
+ "uri": "https://{canondata_backend}/937458/377e39eb6941e00a686233afcdf53a4d2fa21bc2/resource.tar.gz#test_sql2yql.test_action-action_eval_cluster_use_compact_named_exprs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_nested_query]": [
+ {
+ "checksum": "be11fad7523cd4cac5b1e0c82b7a02e4",
+ "size": 1927,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-action_nested_query_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_opt_args]": [
+ {
+ "checksum": "bfe8d454cfdaebf1ba6bd5bd15bd0ded",
+ "size": 2167,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-action_opt_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-action_udf_args]": [
+ {
+ "checksum": "68155538125dd6e446b38f4e82235ef3",
+ "size": 1205,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-action_udf_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-closure_action]": [
+ {
+ "checksum": "2c799836d1e20f39bcfb8eed7e3b2b48",
+ "size": 2845,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-closure_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-combine_subqueries_with_table_param]": [
+ {
+ "checksum": "9d73e7ab6ed2a3ae51c39b9ad2c03953",
+ "size": 2531,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_action-combine_subqueries_with_table_param_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-define_simple_action]": [
+ {
+ "checksum": "a882791835d53e4dd5178a673f50faff",
+ "size": 2759,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-define_simple_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-dep_world_action_quote]": [
+ {
+ "checksum": "4453d1effa01c4d0986faf0d8caac8ac",
+ "size": 2780,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-dep_world_action_quote_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-dep_world_quote_code]": [
+ {
+ "checksum": "e04239ef0184f4c981a8ba6a522d97a6",
+ "size": 6868,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-dep_world_quote_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-discard]": [
+ {
+ "checksum": "3139fe2e69aea0091b46fa3ab699a41c",
+ "size": 8298,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-discard_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-empty_do]": [
+ {
+ "checksum": "f0d4f7fed38b9a80f5ba3649cbc5761d",
+ "size": 410,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-empty_do_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_anon_table]": [
+ {
+ "checksum": "da515a0f6a5961645d690d89b69c1ea6",
+ "size": 2104,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_anon_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_asatom]": [
+ {
+ "checksum": "85b3602a3e53a7aa3c15f66d487068c0",
+ "size": 1118,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_asatom_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_astagged]": [
+ {
+ "checksum": "3eaba53d5843f35cfbe40d003d2584c0",
+ "size": 1134,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_astagged_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_atom_wrong_type_expr]": [
+ {
+ "checksum": "b4b21da25a4134e889b70fedca46a59e",
+ "size": 1162,
+ "uri": "https://{canondata_backend}/1923547/2c6b73e812b6d7bc36fe15c35684a8f836c610fe/resource.tar.gz#test_sql2yql.test_action-eval_atom_wrong_type_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_atom_wrong_type_param]": [
+ {
+ "checksum": "ffe23957a7bfdb262b4cad9a50c876cb",
+ "size": 1195,
+ "uri": "https://{canondata_backend}/1923547/2c6b73e812b6d7bc36fe15c35684a8f836c610fe/resource.tar.gz#test_sql2yql.test_action-eval_atom_wrong_type_param_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_capture]": [
+ {
+ "checksum": "d3fa86b48aff09d6bf644ad95e6494aa",
+ "size": 1347,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_capture_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_code]": [
+ {
+ "checksum": "4bfb0a8c2a5abaa88a9ffaebb2650bca",
+ "size": 3493,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_code_nested]": [
+ {
+ "checksum": "d7d0561da0d6b5c3b6cdfe5ff1e307f4",
+ "size": 3641,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_code_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_column]": [
+ {
+ "checksum": "10e66e962832cc28472e28e043b6771d",
+ "size": 13041,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_drop]": [
+ {
+ "checksum": "734f283cb5e04c147b59e0ed1a8bf606",
+ "size": 1333,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-eval_drop_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_each_input_table]": [
+ {
+ "checksum": "4667f4a319d4ae5f60f8f752c69ced78",
+ "size": 3087,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_each_input_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_ensuretype]": [
+ {
+ "checksum": "7077ceb001d27bff8254070360d7eae5",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_ensuretype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_extract]": [
+ {
+ "checksum": "ed5395cf598bbae899fea1870633880e",
+ "size": 1274,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_extract_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_filter]": [
+ {
+ "checksum": "4384c882e8696a7486044ad034e46f9f",
+ "size": 1568,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_folder]": [
+ {
+ "checksum": "1828de57b36eb525a93ef35258de8065",
+ "size": 1100,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_folder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_folder_via_file]": [
+ {
+ "checksum": "0fb3472a48b7f2822460205a6184fe5e",
+ "size": 3176,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_folder_via_file_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_folder_via_file_in_job]": [
+ {
+ "checksum": "174b80d7ac819df2635367e4a9cf517f",
+ "size": 3366,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_folder_via_file_in_job_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_for]": [
+ {
+ "checksum": "cc6fa5a44dd964d6da0b9e9890787bf1",
+ "size": 6672,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_for_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_for_over_subquery]": [
+ {
+ "checksum": "d6a044767f10eb14a4953a83a87f58a1",
+ "size": 2164,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_for_over_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_if]": [
+ {
+ "checksum": "e571b20b130bcb6a0ecab035b6d1bd35",
+ "size": 4464,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_if_guard]": [
+ {
+ "checksum": "bb36d4785c506551adcda3f5c454dbc0",
+ "size": 1810,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_if_guard_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_input_output_table]": [
+ {
+ "checksum": "2a146fa8c1095e9d60d1ce3e660b3bd5",
+ "size": 1810,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-eval_input_output_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_input_output_table_subquery]": [
+ {
+ "checksum": "b8c5e0df2a92ec1829ea0e3970bf76a9",
+ "size": 3262,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-eval_input_output_table_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_like]": [
+ {
+ "checksum": "9b8ece2bd43f133bfb73472da9046cdc",
+ "size": 1707,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_like_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_on_modif_table_fail]": [
+ {
+ "checksum": "924aefaea25b76ce9e1b977b62c2c7e5",
+ "size": 3439,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_on_modif_table_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_percentile]": [
+ {
+ "checksum": "a9efbefc3f360d32d7be1d04fe8e9ad8",
+ "size": 2285,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_percentile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_pragma]": [
+ {
+ "checksum": "8732e5bc3c31840d01420c4e5c0ee68f",
+ "size": 449,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-eval_pragma_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_python3_ann]": [
+ {
+ "checksum": "99b67de19863bcc652e76a543a7eed77",
+ "size": 1312,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_python3_ann_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_python3_signature]": [
+ {
+ "checksum": "254b2c21cef633129776102f9f2a63fe",
+ "size": 1305,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_python3_signature_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_python_signature]": [
+ {
+ "checksum": "254b2c21cef633129776102f9f2a63fe",
+ "size": 1305,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_python_signature_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_range]": [
+ {
+ "checksum": "ad2e9de23317aee0b3e73d490bcb99bc",
+ "size": 1799,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_regexp]": [
+ {
+ "checksum": "ecb23a7e6f3b35d26d8a389d87153c6c",
+ "size": 1667,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_regexp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_resourcetype]": [
+ {
+ "checksum": "4fa1076803290dd043b45776b62c1b1c",
+ "size": 1138,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_resourcetype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_result_label]": [
+ {
+ "checksum": "847fb097bf5ef1173f737506c09372a6",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_result_label_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_sample]": [
+ {
+ "checksum": "94c303b64a1ac246646620bf52bd2d59",
+ "size": 1579,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_skip_take]": [
+ {
+ "checksum": "687fbc0322ecbd1bb7facea929dc4383",
+ "size": 1474,
+ "uri": "https://{canondata_backend}/1936947/78621e1f2aa41bad0dd5bd191f52fa193b062e7c/resource.tar.gz#test_sql2yql.test_action-eval_skip_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_table_with_view]": [
+ {
+ "checksum": "205947b4c48a2563592170cbf5483cd3",
+ "size": 1235,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_table_with_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_taggedtype]": [
+ {
+ "checksum": "321797b027f974ddae8deeb48781b70f",
+ "size": 1156,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_taggedtype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_type]": [
+ {
+ "checksum": "e6ef9d2d0a852a4f850ddb387f5bf7b0",
+ "size": 1067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_typeof_output_table]": [
+ {
+ "checksum": "94c5cd255eab26de473082744b27e6c3",
+ "size": 4413,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_typeof_output_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_unresolved_type_arg]": [
+ {
+ "checksum": "768f12507eb2dff7ca0119964d399db8",
+ "size": 1811,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_unresolved_type_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_values_output_table_subquery]": [
+ {
+ "checksum": "8236cdf04fb89d284eb847f71f191e3e",
+ "size": 1473,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-eval_values_output_table_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-eval_variant]": [
+ {
+ "checksum": "e4b54a40b466c510a2e43c1fe976d5ec",
+ "size": 1218,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-eval_variant_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-evaluate_match_type]": [
+ {
+ "checksum": "651d5e052e8417f950782d37c33119f5",
+ "size": 2032,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-evaluate_match_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-evaluate_pure]": [
+ {
+ "checksum": "c39ed2cd19b6cc47e8e7639d7d9d7f81",
+ "size": 7362,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-evaluate_pure_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-evaluate_queries]": [
+ {
+ "checksum": "8308fd97ede40a6938348e5014fa5a75",
+ "size": 1941,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-evaluate_queries_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-export_action]": [
+ {
+ "checksum": "fe005c0b27cc14708e8f27e4ecd24d03",
+ "size": 360,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-export_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-inline_action]": [
+ {
+ "checksum": "928aaa85637625e18fef89b35501f0f3",
+ "size": 3865,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-inline_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-insert_after_eval]": [
+ {
+ "checksum": "f6b234c4a887468a30c0d24800eb9cca",
+ "size": 2967,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-insert_after_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-insert_after_eval_xlock]": [
+ {
+ "checksum": "f6f1bffc7877467ec6b619532948ceba",
+ "size": 2989,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-insert_after_eval_xlock_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-insert_each_from_folder]": [
+ {
+ "checksum": "7c5460adea49ac910a8da3e167784434",
+ "size": 3446,
+ "uri": "https://{canondata_backend}/1920236/49d24809be769996fac3586d53f86d8c72bdeb78/resource.tar.gz#test_sql2yql.test_action-insert_each_from_folder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-lambda_arg_count]": [
+ {
+ "checksum": "157f3a47008f14c3f74afee6329343d3",
+ "size": 3480,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-lambda_arg_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-large_evaluate_for_fail]": [
+ {
+ "checksum": "a5c627d450042ad88d3a4201f512dbb1",
+ "size": 458,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-large_evaluate_for_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-mixed_eval_typeof_world1]": [
+ {
+ "checksum": "e685d404e8aa4f6cc4a51c8cf25a3a17",
+ "size": 3918,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-mixed_eval_typeof_world1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-nested_action]": [
+ {
+ "checksum": "6c61b14667cb3dade1fdbabda5624467",
+ "size": 2198,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-nested_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-nested_eval]": [
+ {
+ "checksum": "4d011a063ff8e80aee97048655f36324",
+ "size": 1871,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-nested_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-nested_rewrite_io]": [
+ {
+ "checksum": "ab5d19654b8b2cb3c238746040526e7e",
+ "size": 4053,
+ "uri": "https://{canondata_backend}/1900335/b0ec428a7b3c7f1c5c0e807f1d26fb9cecaf33b0/resource.tar.gz#test_sql2yql.test_action-nested_rewrite_io_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-nested_subquery]": [
+ {
+ "checksum": "574c815da0ba8a2fb290512b8abb3dce",
+ "size": 1709,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-nested_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-parallel_for]": [
+ {
+ "checksum": "6da2249c0e8b78f10186ae57269b4c5b",
+ "size": 2136,
+ "uri": "https://{canondata_backend}/1923547/207d83cd3f826313c233788d02e4d50151bcbf75/resource.tar.gz#test_sql2yql.test_action-parallel_for_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-pass_action_as_param]": [
+ {
+ "checksum": "dfed60badf56b73cb7a389936ddac70d",
+ "size": 1398,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-pass_action_as_param_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-pass_subquery_as_param]": [
+ {
+ "checksum": "7699c858f5ccd0a01b40396f5dca1304",
+ "size": 3161,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-pass_subquery_as_param_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-pending_arg_fail]": [
+ {
+ "checksum": "6962a979e7b70bd86276c19cc0bd1585",
+ "size": 1177,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-pending_arg_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-process_from_subquery_with_orderby]": [
+ {
+ "checksum": "d0caebfc95011c979d066cc3247c5755",
+ "size": 1508,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-process_from_subquery_with_orderby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_apply_quoted_code]": [
+ {
+ "checksum": "3f3aff837a5de1987692974e60e34599",
+ "size": 3508,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_apply_quoted_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_for_select]": [
+ {
+ "checksum": "70f8bcef15923823dbe43f5ec66c854d",
+ "size": 10895,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_for_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_format_free_args_code]": [
+ {
+ "checksum": "85f04c7458d2fdbe3bd04185b1e1b972",
+ "size": 1210,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_format_free_args_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_format_type]": [
+ {
+ "checksum": "857262a9818a2c43592b6b7437b43921",
+ "size": 1028,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_format_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_if_select]": [
+ {
+ "checksum": "54a4f40dcf1fcd919aff8e828da4854f",
+ "size": 7566,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_if_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_make_code]": [
+ {
+ "checksum": "cb8678bc5d7971d05f868badd04cbf29",
+ "size": 1800,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_make_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_parse_type]": [
+ {
+ "checksum": "b5f325295d0479ef28a3a2acd828106c",
+ "size": 1052,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_parse_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_quote_code]": [
+ {
+ "checksum": "6118acdac8a7bd4e2982184c96b09a62",
+ "size": 2171,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_quote_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_repr_code]": [
+ {
+ "checksum": "c99478c489792096faf2459e1112ed9f",
+ "size": 1195,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_repr_code_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_serialize_type]": [
+ {
+ "checksum": "ed6713e28eb093bcf680b11f53300823",
+ "size": 1037,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_serialize_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_type_kind]": [
+ {
+ "checksum": "800cc7dd6090e622c54f847b1408edd0",
+ "size": 1789,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_type_kind_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-runtime_type_splitmake]": [
+ {
+ "checksum": "cc928926bdc4b56ad00c69952de5fb4b",
+ "size": 9297,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_action-runtime_type_splitmake_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-select_from_subquery_with_orderby]": [
+ {
+ "checksum": "f322ab348559128611152746853d191d",
+ "size": 3869,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-select_from_subquery_with_orderby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery]": [
+ {
+ "checksum": "6e780de239fbefdd86b34db80c4d85e2",
+ "size": 6831,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_action-subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_accessnode]": [
+ {
+ "checksum": "0722e2a656501e6c1caebbe2d9f84804",
+ "size": 1999,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_action-subquery_accessnode_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_assumeorderby]": [
+ {
+ "checksum": "7337267d6cfde1050f20cbf323c083b9",
+ "size": 1491,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_assumeorderby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_extend_over_extend_for]": [
+ {
+ "checksum": "22945804b00472fc10fd0bcdf11fefa8",
+ "size": 2089,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_extend_over_extend_for_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_merge1]": [
+ {
+ "checksum": "b69efcde25358cef187576c81c5d778c",
+ "size": 6963,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_action-subquery_merge1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_merge2]": [
+ {
+ "checksum": "a9bee587f1071ece039913fb27de5dff",
+ "size": 4587,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_merge2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_merge_evaluate]": [
+ {
+ "checksum": "be01002ae16b2dadded6b6207371f0de",
+ "size": 2531,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_merge_evaluate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_merge_nested_subquery]": [
+ {
+ "checksum": "c0666d12d8cb4c76dd0463f8c523886c",
+ "size": 2441,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_merge_nested_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_merge_nested_world]": [
+ {
+ "checksum": "54c3a4cecc1ea4b1bf1fc7ed4b67d9a9",
+ "size": 3613,
+ "uri": "https://{canondata_backend}/1920236/49d24809be769996fac3586d53f86d8c72bdeb78/resource.tar.gz#test_sql2yql.test_action-subquery_merge_nested_world_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_opt_args]": [
+ {
+ "checksum": "c04566da790ceb5afbdaaedfa4d93372",
+ "size": 2435,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_action-subquery_opt_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_orderby0]": [
+ {
+ "checksum": "0004974fa838ff2efa3d184719e99e09",
+ "size": 2864,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_orderby0_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_orderby1]": [
+ {
+ "checksum": "f49b5112e3599f0b5a8be77c2865c876",
+ "size": 1486,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_orderby1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-subquery_orderby2]": [
+ {
+ "checksum": "fbcf7931a5cab6df4b3e066086aa4fe0",
+ "size": 1589,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_action-subquery_orderby2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[action-table_content_before_from_folder]": [
+ {
+ "checksum": "74563a298fcb8f48e9090ad7d5d29add",
+ "size": 3831,
+ "uri": "https://{canondata_backend}/1920236/49d24809be769996fac3586d53f86d8c72bdeb78/resource.tar.gz#test_sql2yql.test_action-table_content_before_from_folder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_const_interval]": [
+ {
+ "checksum": "fa618cfa03c8b8c56cd84533428a13df",
+ "size": 2019,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_const_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_decimal]": [
+ {
+ "checksum": "7e45ebf73eff1af9ca5648673db03a86",
+ "size": 1367,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_interval]": [
+ {
+ "checksum": "fb900fb48b918f0ed400ae954a24d7d5",
+ "size": 1363,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_numeric]": [
+ {
+ "checksum": "9c4663114aa70e7f08985f2c39753299",
+ "size": 1322,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_numeric_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_numeric_opt]": [
+ {
+ "checksum": "69676d286f17276ced4cb1716c64b7d7",
+ "size": 1316,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_numeric_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-avg_state_type]": [
+ {
+ "checksum": "9c7bb0863f745056060fe177ee548ed0",
+ "size": 3558,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-avg_state_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-count]": [
+ {
+ "checksum": "653fb938771c2a762165a9ab6c96142e",
+ "size": 1588,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-max]": [
+ {
+ "checksum": "4c55c1fda65c0b3fe10445200be25763",
+ "size": 1322,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-min]": [
+ {
+ "checksum": "a2f1ec95a19125273842fb28d01cc881",
+ "size": 1322,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_column_subset]": [
+ {
+ "checksum": "4261d98c64b7aad15c89371d969923cc",
+ "size": 1967,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_column_subset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_len_count]": [
+ {
+ "checksum": "d9f250345283c134061e47db8263f710",
+ "size": 1315,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_len_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_len_count_all]": [
+ {
+ "checksum": "a0133f4a83595f68f045bfe3424e5965",
+ "size": 1313,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_len_count_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_len_count_distinct]": [
+ {
+ "checksum": "c6c81fb5fb7a26f8a18a33a4590f303f",
+ "size": 1365,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_len_count_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_len_count_null]": [
+ {
+ "checksum": "7455f2172ada082a4e5e5d071a3844f2",
+ "size": 1341,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_len_count_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_sum_divide_by_zero]": [
+ {
+ "checksum": "4eb5fca2b887b44887e4dcd045c713ed",
+ "size": 1335,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_sum_divide_by_zero_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-opt_sum_null]": [
+ {
+ "checksum": "639d096eabe75200d0e1ab0f7502b3ad",
+ "size": 1303,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-opt_sum_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-pg_int4]": [
+ {
+ "checksum": "46f62314290049e280ba8628dc79fec5",
+ "size": 2569,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-pg_int4_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-pg_int8]": [
+ {
+ "checksum": "820f1c80363b306ee07c79c5665030f9",
+ "size": 2569,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-pg_int8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-pg_text]": [
+ {
+ "checksum": "5c47705fc45eb6a30b4d8c1777336fc4",
+ "size": 2345,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-pg_text_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-some_notnull]": [
+ {
+ "checksum": "31a325f15a20efb660ff871958602e60",
+ "size": 1257,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-some_notnull_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-some_null]": [
+ {
+ "checksum": "6b0da8919b3531af48beed6c7c94d5e0",
+ "size": 1251,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-some_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_decimal]": [
+ {
+ "checksum": "6dce3ef92860540204647dc087242e30",
+ "size": 1460,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_decimal_null]": [
+ {
+ "checksum": "bb8a801f830f4c806383e812908525c9",
+ "size": 1408,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_decimal_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_double]": [
+ {
+ "checksum": "d0308198ac61f472d1266314210f15f8",
+ "size": 1324,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_double_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_interval]": [
+ {
+ "checksum": "8d3b6646bec72deee6b95d0c21f55880",
+ "size": 1380,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_signed]": [
+ {
+ "checksum": "7af2248f64a7c274ffe5df942dcc5869",
+ "size": 1316,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_signed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_type]": [
+ {
+ "checksum": "5f729d43e9ffb69314a18a2fb8c4ca6b",
+ "size": 2032,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_agg_apply-sum_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_type_empty]": [
+ {
+ "checksum": "7ff781ab6390e43b3ba705470d22cef9",
+ "size": 2118,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_agg_apply-sum_type_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_type_group_by]": [
+ {
+ "checksum": "910261350098d88b906b5fa9f0560c10",
+ "size": 2184,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_agg_apply-sum_type_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-sum_unsigned]": [
+ {
+ "checksum": "b9039aa9d9f805f99b3b09031efde6f8",
+ "size": 1318,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-sum_unsigned_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_apply-table]": [
+ {
+ "checksum": "b4a557c821dc60a1cfeeab43930911ff",
+ "size": 1415,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_apply-table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-avg]": [
+ {
+ "checksum": "858ecd31f380abc0ffbc6510ee9fa24e",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-avg_null]": [
+ {
+ "checksum": "bf971dd896a8401ce5ed0e9c75aa2274",
+ "size": 13055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-avg_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-avg_opt]": [
+ {
+ "checksum": "90ed1f5e341a215ceb3e0b6783ec3e52",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-avg_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count]": [
+ {
+ "checksum": "c3ef6597e1dad8332df19e9bd78f2dc5",
+ "size": 13103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count_all]": [
+ {
+ "checksum": "0e7247a4261ade0b1228c652bbf18532",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count_all_null]": [
+ {
+ "checksum": "853adc3a1f8f554b3f8c3ae661de3725",
+ "size": 13069,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_all_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count_all_opt]": [
+ {
+ "checksum": "af0e6ca23e11e1db1ae8fdcc0bd625c6",
+ "size": 13095,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_all_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count_null]": [
+ {
+ "checksum": "692b597fc540f556249bb9db8ad66c7e",
+ "size": 13091,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-count_opt]": [
+ {
+ "checksum": "b520d7a976d7085171d149e78e08f9cc",
+ "size": 13117,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-count_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-max]": [
+ {
+ "checksum": "9a485849c4e238373ad245a57eaa5cc0",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-max_null]": [
+ {
+ "checksum": "dc656baa5f775dc0cfb874c2e932074e",
+ "size": 13055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-max_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-max_opt]": [
+ {
+ "checksum": "e1dbd523033e3d8384a99b66febfe793",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-max_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min]": [
+ {
+ "checksum": "42ba0acd61c669fc1bd4eb12514adeac",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min_by]": [
+ {
+ "checksum": "176b6a6bb375b013de02a5ecc198ef6f",
+ "size": 13294,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min_by_null]": [
+ {
+ "checksum": "69e990e5e4526d2b6b7e1d19e8e142df",
+ "size": 13282,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_by_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min_by_opt]": [
+ {
+ "checksum": "a55fdf8b5f412a91dd59251a4117f7a9",
+ "size": 13308,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_by_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min_null]": [
+ {
+ "checksum": "bd093ad3f70236c6275708a6b80c028e",
+ "size": 13055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-min_opt]": [
+ {
+ "checksum": "dd28914ad7662964d3f03b693e56a56d",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-min_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-percentile]": [
+ {
+ "checksum": "48a2b2c8ebb37016025932333db7160c",
+ "size": 13319,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-percentile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-percentile_null]": [
+ {
+ "checksum": "f044fa144ecf5f321c90c3c3c0890776",
+ "size": 13307,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-percentile_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-percentile_opt]": [
+ {
+ "checksum": "c356c1a972135819b6aa58d8dd922857",
+ "size": 13333,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-percentile_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-sum]": [
+ {
+ "checksum": "fdd5c4aff24e062562585a86668f9128",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-sum_null]": [
+ {
+ "checksum": "7b191fb4b1c2b29309e2b3f33a06ac61",
+ "size": 13055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-sum_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases-sum_opt]": [
+ {
+ "checksum": "8fbc4df83009dd1a17a4ea37f2d98ea5",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases-sum_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-avg]": [
+ {
+ "checksum": "858ecd31f380abc0ffbc6510ee9fa24e",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-avg_decimal]": [
+ {
+ "checksum": "6995e83bda818a897fdd0eae9d07dcc0",
+ "size": 13095,
+ "uri": "https://{canondata_backend}/1942415/d77582873ccf3369a6a530c6d99bb20a670b52e8/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-avg_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count]": [
+ {
+ "checksum": "c3ef6597e1dad8332df19e9bd78f2dc5",
+ "size": 13103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count_all]": [
+ {
+ "checksum": "0e7247a4261ade0b1228c652bbf18532",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count_all_null]": [
+ {
+ "checksum": "853adc3a1f8f554b3f8c3ae661de3725",
+ "size": 13069,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_all_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count_all_opt]": [
+ {
+ "checksum": "af0e6ca23e11e1db1ae8fdcc0bd625c6",
+ "size": 13095,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_all_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count_null]": [
+ {
+ "checksum": "692b597fc540f556249bb9db8ad66c7e",
+ "size": 13091,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-count_opt]": [
+ {
+ "checksum": "b520d7a976d7085171d149e78e08f9cc",
+ "size": 13117,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-count_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-max]": [
+ {
+ "checksum": "9a485849c4e238373ad245a57eaa5cc0",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-min]": [
+ {
+ "checksum": "42ba0acd61c669fc1bd4eb12514adeac",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-some_notnull]": [
+ {
+ "checksum": "2f7952a58655d878073770264e78f303",
+ "size": 13085,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-some_notnull_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-some_null]": [
+ {
+ "checksum": "754e16b9d4b8cb73c6136755ba687c4d",
+ "size": 13073,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-some_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-sum]": [
+ {
+ "checksum": "fdd5c4aff24e062562585a86668f9128",
+ "size": 13067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-sum_null]": [
+ {
+ "checksum": "7b191fb4b1c2b29309e2b3f33a06ac61",
+ "size": 13055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-sum_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[agg_phases_agg_apply-sum_opt]": [
+ {
+ "checksum": "8fbc4df83009dd1a17a4ea37f2d98ea5",
+ "size": 13081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_agg_phases_agg_apply-sum_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-avg]": [
+ {
+ "checksum": "d07eee6e77cc794727dda8ea1da39ab1",
+ "size": 4639,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-avg_distinct_expr]": [
+ {
+ "checksum": "3d3759dbee308e41831f2c145cee0fb6",
+ "size": 2664,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-avg_distinct_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-avg_if]": [
+ {
+ "checksum": "546aae1b807857494b2e30531b536e91",
+ "size": 3710,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-avg_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-bitand]": [
+ {
+ "checksum": "a594a416ed9522cb3338044822679820",
+ "size": 4657,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-bitand_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-bitor]": [
+ {
+ "checksum": "775c2c027a4e1646c8691d8464504d3f",
+ "size": 4654,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-bitor_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-bitxor]": [
+ {
+ "checksum": "4092c7f28e86e608c05a3080440b817e",
+ "size": 4657,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-bitxor_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-booland]": [
+ {
+ "checksum": "97b4c5b6747623995d6fd8bbbb47b325",
+ "size": 4654,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-booland_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-boolor]": [
+ {
+ "checksum": "213b60e73247eb008c6e25e85b096669",
+ "size": 4651,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-boolor_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-bottom]": [
+ {
+ "checksum": "293e858bd69c4e3165eda283934a6c1e",
+ "size": 5263,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-bottom_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-bottom_by]": [
+ {
+ "checksum": "8e4e690680041de799af4865dc4f3a88",
+ "size": 4568,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-bottom_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-container]": [
+ {
+ "checksum": "86ce314eb8b0b0885c6560e7d6f5527b",
+ "size": 16630,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-container_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-container_empty]": [
+ {
+ "checksum": "f5ea1fd420e52bf056894597d78a10df",
+ "size": 7683,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-container_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-corellation]": [
+ {
+ "checksum": "8e71bff68d270d93ebca162c82084be7",
+ "size": 3530,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-corellation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-count]": [
+ {
+ "checksum": "6030d0c709e9e3ef76a805efe554a488",
+ "size": 4645,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-count_if]": [
+ {
+ "checksum": "c49620415a7fa87c9795664c741e9844",
+ "size": 4669,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-count_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-def_value_full_table]": [
+ {
+ "checksum": "f88c95f4903c32187fc381bda1336b46",
+ "size": 7322,
+ "uri": "https://{canondata_backend}/1942173/5547b75707e10619dbd7727d7d0f2404ab9b13ca/resource.tar.gz#test_sql2yql.test_aggr_factory-def_value_full_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-def_value_with_keys]": [
+ {
+ "checksum": "ade829860b226398a4d468e42ad95d17",
+ "size": 7477,
+ "uri": "https://{canondata_backend}/1942173/5547b75707e10619dbd7727d7d0f2404ab9b13ca/resource.tar.gz#test_sql2yql.test_aggr_factory-def_value_with_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-every]": [
+ {
+ "checksum": "97b4c5b6747623995d6fd8bbbb47b325",
+ "size": 4654,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-every_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-flatten]": [
+ {
+ "checksum": "9c37d0c0dd131b62d811072c2acec670",
+ "size": 6196,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-flatten_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-histogram]": [
+ {
+ "checksum": "990f8a35ba13989f374f3f1a39b6cb34",
+ "size": 5048,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-histogram_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-hll]": [
+ {
+ "checksum": "3af44ffb806052f3089c47a156dde64a",
+ "size": 5916,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-hll_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-linear_histogram]": [
+ {
+ "checksum": "d12aa8d072194d90950cfb5aeea84994",
+ "size": 4816,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-linear_histogram_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-list]": [
+ {
+ "checksum": "8a9d983b3df24a0fcb11ace066bf528a",
+ "size": 6328,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-log_histogram]": [
+ {
+ "checksum": "93e55416533a31f25af5bb5796650f85",
+ "size": 4833,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-log_histogram_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-logariphmic_histogram]": [
+ {
+ "checksum": "93e55416533a31f25af5bb5796650f85",
+ "size": 4833,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-logariphmic_histogram_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-max]": [
+ {
+ "checksum": "d33fc3dd86fcdac07d2418a03bd9e58b",
+ "size": 4639,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-max_by]": [
+ {
+ "checksum": "e87589b2c8d253d7fde7782930c13e3f",
+ "size": 5448,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-max_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-median]": [
+ {
+ "checksum": "84204167df53a5aa4941b637918105bf",
+ "size": 5925,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-median_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-min]": [
+ {
+ "checksum": "0919651d3a0ca05b25b99f6caee73182",
+ "size": 4639,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-min_by]": [
+ {
+ "checksum": "0329b59f3d3c15dd25d6a14be1218f63",
+ "size": 5448,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-min_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-mode]": [
+ {
+ "checksum": "1f31f9f9249522d602e5f4eef014dc62",
+ "size": 6875,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-mode_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi]": [
+ {
+ "checksum": "da2ed281183a8106722f86cbd2f2aa65",
+ "size": 6266,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_list]": [
+ {
+ "checksum": "9e3364b28fb02fcb04f725429211a4dc",
+ "size": 5140,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_list_distinct_expr]": [
+ {
+ "checksum": "cdd997cbef22f4b1160f161d0adbb5bb",
+ "size": 6461,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_list_distinct_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_list_nulls]": [
+ {
+ "checksum": "43ca6e4d9d1c014f1b917a87dd60c1ac",
+ "size": 5158,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_list_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_minmaxby]": [
+ {
+ "checksum": "925b3fce4cab427d5314cd30f248f540",
+ "size": 3827,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_minmaxby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_struct_nulls]": [
+ {
+ "checksum": "36279b7570a3c407df9300328afeeccf",
+ "size": 5316,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_struct_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_tuple]": [
+ {
+ "checksum": "7506bd0447bb663df7a328bcfc03eec8",
+ "size": 5155,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-multi_tuple_nulls]": [
+ {
+ "checksum": "50a2acc33a879b08939abaa4f867003c",
+ "size": 5004,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-multi_tuple_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-some]": [
+ {
+ "checksum": "24f4628a38ced15408114abae1f1e1af",
+ "size": 4642,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-some_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-stddev]": [
+ {
+ "checksum": "c1ab6221c942ec5d3af5764bea819aa9",
+ "size": 4666,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-stddev_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-sum_if]": [
+ {
+ "checksum": "770ae0b9459a77a40e655d848b8f7c58",
+ "size": 3710,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-sum_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-top]": [
+ {
+ "checksum": "7379441a28ef20f2e7c50a1a77ae32aa",
+ "size": 5254,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-top_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-top_by]": [
+ {
+ "checksum": "b8d2487a696cce8718120f94005ae290",
+ "size": 4562,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggr_factory-top_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-transform_input]": [
+ {
+ "checksum": "a5c4974dc6e7f9a3a60b2c112169802f",
+ "size": 3388,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-transform_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-transform_output]": [
+ {
+ "checksum": "a9071c30b1361bb977749e7981a66d36",
+ "size": 3388,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-transform_output_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-udaf]": [
+ {
+ "checksum": "9226a10f74a1e86d761b3c95c0fc9bd7",
+ "size": 9935,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-udaf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-udaf_distinct_expr]": [
+ {
+ "checksum": "0ec684dcd0dd090e1a41bfae6489a929",
+ "size": 3622,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-udaf_distinct_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-udaf_in_udaf]": [
+ {
+ "checksum": "e4584f918269cb28aed231695618e154",
+ "size": 8524,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-udaf_in_udaf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggr_factory-variance]": [
+ {
+ "checksum": "2cd863bce78d02e391327a91a217323e",
+ "size": 4666,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggr_factory-variance_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-GroupByOneField]": [
+ {
+ "checksum": "9261eab5e2aeb266b4d2921ded3848db",
+ "size": 1658,
+ "uri": "https://{canondata_backend}/1937492/9cec6e279456c1f4378a56f7cefe61dbc632f859/resource.tar.gz#test_sql2yql.test_aggregate-GroupByOneField_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-GroupByTwoFields]": [
+ {
+ "checksum": "c44888366a738c5e65584111b89b2ea0",
+ "size": 1674,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-GroupByTwoFields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-agg_filter_pushdown]": [
+ {
+ "checksum": "56cbbc0e96025e274444dacc5a006b91",
+ "size": 2661,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_aggregate-agg_filter_pushdown_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-agg_full_table_list]": [
+ {
+ "checksum": "d58065e835d9d76a0bb001308b8463d6",
+ "size": 3202,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-agg_full_table_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-agg_phases_table1]": [
+ {
+ "checksum": "3416bb0f86d4ca54b8d8ebe28886e0e3",
+ "size": 1606,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-agg_phases_table1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-agg_phases_table2]": [
+ {
+ "checksum": "7ee18f39d45170fcd2113e0729da20ab",
+ "size": 1651,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-agg_phases_table2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-agg_phases_table3]": [
+ {
+ "checksum": "44f9fb356ad28bcd24fbb7d6de4e78af",
+ "size": 1928,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-agg_phases_table3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_by_column_lookup_in_const_dict]": [
+ {
+ "checksum": "b2d1bd12f38c00295e6b8c9544bda528",
+ "size": 1573,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_by_column_lookup_in_const_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_by_one_column]": [
+ {
+ "checksum": "32b361d1f91ab8978c33355d55b04f15",
+ "size": 1651,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_by_one_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_expr]": [
+ {
+ "checksum": "e4b4b307ca4424a3f25c7b7c1938d8b9",
+ "size": 2621,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_expr_with_groupby_expr]": [
+ {
+ "checksum": "d169d213ca1ba988c418894628a03855",
+ "size": 2867,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_expr_with_groupby_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_expr_with_udf]": [
+ {
+ "checksum": "46d05b6bb0858b024610a601d6e818a0",
+ "size": 1697,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_expr_with_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_in_access_node_exprs]": [
+ {
+ "checksum": "358824482928a2c64ae90a9c9357e427",
+ "size": 2390,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_in_access_node_exprs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_list]": [
+ {
+ "checksum": "b56ed068c3465ba7d230888c9dab833b",
+ "size": 9317,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_distinct_struct_access]": [
+ {
+ "checksum": "a1cd87e7e1cec0d752871e5f4523599b",
+ "size": 2435,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_distinct_struct_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_inmem_distinct_list]": [
+ {
+ "checksum": "e9ae7689e846783ad6d51c20b5bead17",
+ "size": 10412,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_inmem_distinct_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_inmem_list_in_key]": [
+ {
+ "checksum": "33f21f3eb939317772c5f48e248a5ab3",
+ "size": 8136,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_inmem_list_in_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_key_column]": [
+ {
+ "checksum": "0d99f8a55b1b09cbf0c43089252845fb",
+ "size": 1367,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_key_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_list_in_key]": [
+ {
+ "checksum": "e78251fe06a355238f49d727eac019dd",
+ "size": 17358,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_list_in_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_subquery_yql_15869]": [
+ {
+ "checksum": "f16b7bb0877d5d8cf7a9721ab4c0e462",
+ "size": 2008,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_subquery_yql_15869_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_udf_nested]": [
+ {
+ "checksum": "73f15d46f760afa5b0d9f1405792cc4a",
+ "size": 1352,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_udf_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_with_const_yson_options]": [
+ {
+ "checksum": "acc9edab749f8c99c992f6f61186fc1b",
+ "size": 1758,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_with_const_yson_options_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_with_deep_aggregated_column]": [
+ {
+ "checksum": "2415d9c69ebee5ea0454e5168b1b2733",
+ "size": 2684,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_with_deep_aggregated_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_with_default_yson_options]": [
+ {
+ "checksum": "acc9edab749f8c99c992f6f61186fc1b",
+ "size": 1758,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_with_default_yson_options_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_with_lambda]": [
+ {
+ "checksum": "c1e2baa1b236589afd58fe45d64b1890",
+ "size": 1526,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_with_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregate_with_lambda_inside_avg]": [
+ {
+ "checksum": "57e6460c0f3d3b423a1f630aa2316539",
+ "size": 1404,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregate_with_lambda_inside_avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregation_and_order]": [
+ {
+ "checksum": "8fcda9ba3f7d1517648a3ba7c152d917",
+ "size": 1765,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-aggregation_and_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregation_by_udf]": [
+ {
+ "checksum": "5628ca50f248aae1ac23890cf525489a",
+ "size": 1391,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregation_by_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggregation_with_named_node]": [
+ {
+ "checksum": "a7e95dce3919d157f3f5b42f01b15bf6",
+ "size": 2517,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggregation_with_named_node_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggrs_no_grouping]": [
+ {
+ "checksum": "dd6b15d81798291229915dab5fc8a318",
+ "size": 13487,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggrs_no_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggrs_no_grouping_via_map]": [
+ {
+ "checksum": "4b6a4caa779839478a663c3bbed00c05",
+ "size": 13590,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggrs_no_grouping_via_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-aggrs_no_grouping_via_map_compact]": [
+ {
+ "checksum": "6dcd60ab136191b4d55eda1fe6f58f03",
+ "size": 13711,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-aggrs_no_grouping_via_map_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-avg_and_sum]": [
+ {
+ "checksum": "2d305b4a91641d5623a82e13ae481971",
+ "size": 1898,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-avg_and_sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-avg_and_sum_by_value]": [
+ {
+ "checksum": "bafa4b7b8d3e005615d829d35284b3b0",
+ "size": 1888,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-avg_and_sum_by_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-avg_and_sum_float]": [
+ {
+ "checksum": "5f72274d43c04e03847e50ccd91a36ab",
+ "size": 1814,
+ "uri": "https://{canondata_backend}/1880306/76810cd2cc48b4fc3a7d7b35a5dd8a6fc2195ff9/resource.tar.gz#test_sql2yql.test_aggregate-avg_and_sum_float_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-avg_interval]": [
+ {
+ "checksum": "c6b051a54d1280cc8b0488d30fd6c9ae",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-avg_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-avg_with_having]": [
+ {
+ "checksum": "a6205189821798fc94e90f09e19cb621",
+ "size": 1658,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-avg_with_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-compare_by]": [
+ {
+ "checksum": "a9eacab25486aef4e5000b928097e2f7",
+ "size": 3677,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-compare_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-compare_by_nulls]": [
+ {
+ "checksum": "975d1ea3991c4a56fcb3f72ca2b37b7d",
+ "size": 12137,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-compare_by_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-compare_by_tuple]": [
+ {
+ "checksum": "83632e016b8aeafa15a3c64f125dc3cf",
+ "size": 2866,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-compare_by_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-compare_tuple]": [
+ {
+ "checksum": "527b935775d2cadeaca75b9cbc44b5b6",
+ "size": 2762,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-compare_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-count_distinct_with_filter]": [
+ {
+ "checksum": "091edba07f552250b105acdece101b34",
+ "size": 1467,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-count_distinct_with_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-dedup_state_keys]": [
+ {
+ "checksum": "29161ea441084eb996fc26227e79513f",
+ "size": 1768,
+ "uri": "https://{canondata_backend}/1942415/e6af6d354a98ef890e03fc9f0ff5926afc11a26b/resource.tar.gz#test_sql2yql.test_aggregate-dedup_state_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-disable_blocks_with_spilling]": [
+ {
+ "checksum": "e1c9df055ae7de78e0d0364ec949dec4",
+ "size": 1398,
+ "uri": "https://{canondata_backend}/1936947/cdbc6e86b3a08f513dc20af9f537f10f6b930f5d/resource.tar.gz#test_sql2yql.test_aggregate-disable_blocks_with_spilling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-ensure_count]": [
+ {
+ "checksum": "680e664bf810c0f13951de38d3cf94f7",
+ "size": 1469,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-ensure_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_column]": [
+ {
+ "checksum": "0dd4eead3b2f9996a9c3e6c2ad406849",
+ "size": 1617,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_column_alias_reuse]": [
+ {
+ "checksum": "e7632b140a3c8d51ec08e90968a53975",
+ "size": 1669,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_column_alias_reuse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_column_alias_reuse_for_join]": [
+ {
+ "checksum": "dc89e94afb3b3a0622063d5641ed89af",
+ "size": 1966,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_column_alias_reuse_for_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_cube_duo]": [
+ {
+ "checksum": "c2265f63fafd40cfe309428f4d24eb8a",
+ "size": 3934,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_cube_duo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_cube_expr_trio]": [
+ {
+ "checksum": "cf73fad6b7cc2d2e953babd876092514",
+ "size": 6098,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_cube_expr_trio_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_cube_grouping]": [
+ {
+ "checksum": "fd6030267c89581874d8f6ffa54d08ca",
+ "size": 12993,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_cube_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_cube_grouping_and_expr]": [
+ {
+ "checksum": "9f59965c2cab3636a76cfa59e02eeda6",
+ "size": 6400,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_cube_grouping_and_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_cube_join_count]": [
+ {
+ "checksum": "ceb107f83d846a911f80ffee7d4c694b",
+ "size": 5747,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_cube_join_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr]": [
+ {
+ "checksum": "41be44c389d311b1ab2a0aacd6418c71",
+ "size": 1568,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_alias_on_subexp]": [
+ {
+ "checksum": "51793394bde343c348cb71926319869a",
+ "size": 2443,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_alias_on_subexp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_and_having]": [
+ {
+ "checksum": "bd11ed36b40629702a127b043a35dd7e",
+ "size": 1884,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_and_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_columns_reuse]": [
+ {
+ "checksum": "082f48509c6087456da327e98af2acae",
+ "size": 1738,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_columns_reuse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_dict]": [
+ {
+ "checksum": "c9fb55033c8afa9405a5e0a9da5e4b5f",
+ "size": 3394,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_lookup]": [
+ {
+ "checksum": "be9d97d10bcd1317465149a5f1fc1040",
+ "size": 1539,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_lookup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_mul_col]": [
+ {
+ "checksum": "40b9c6f82e2ae91890ad5efb738a9e72",
+ "size": 1942,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_mul_col_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_only_join]": [
+ {
+ "checksum": "39c8ce19124830125b09013c5f217ab9",
+ "size": 3252,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_only_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_order_by_expr]": [
+ {
+ "checksum": "9c183b2bc43ed455d23f3bf28c499c46",
+ "size": 1675,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_order_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_semi_join]": [
+ {
+ "checksum": "4e796da040a8c4bc8f98b67162a943a0",
+ "size": 3638,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_semi_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_with_join]": [
+ {
+ "checksum": "d7b0c4390a9132ca48712ceb029ad6ef",
+ "size": 2046,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_with_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_expr_with_where]": [
+ {
+ "checksum": "a56310bc7c21ac3d4a2c1e439704a8e8",
+ "size": 1810,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_aggregate-group_by_expr_with_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_full_path]": [
+ {
+ "checksum": "416d8574dd6a2f4a471dbdc65adbb18b",
+ "size": 1255,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_full_path_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_alt_duo]": [
+ {
+ "checksum": "9e72aed9d009468d7242c33576171533",
+ "size": 1866,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_alt_duo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_and_having]": [
+ {
+ "checksum": "038ae98da70dd46dae6b5ea08d109637",
+ "size": 3643,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_and_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_duo]": [
+ {
+ "checksum": "d3caf53ff5128d6c5193defe6c399dd7",
+ "size": 2748,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_duo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_few_empty]": [
+ {
+ "checksum": "a1cbc94d7b7e2685ff42319b4c1ac8b3",
+ "size": 5662,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_few_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_flatten]": [
+ {
+ "checksum": "0d26b3b9c8c04615c321bb6184648c73",
+ "size": 3589,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_flatten_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_flatten_columns]": [
+ {
+ "checksum": "39b108f1604cf2e3c12cff706e706f7b",
+ "size": 3821,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_flatten_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_flatten_expr]": [
+ {
+ "checksum": "26f39583961b8ca8987377261d123734",
+ "size": 3789,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_flatten_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_grouping]": [
+ {
+ "checksum": "8c114a8b89b41b0367184f67afa63a3a",
+ "size": 3909,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_join_aliases]": [
+ {
+ "checksum": "dfa53a44fe2cde1f0c494a0d76001b95",
+ "size": 4167,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_join_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_simp]": [
+ {
+ "checksum": "90627124ec7b1ce2f4d335bf10277665",
+ "size": 3798,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_simp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_subselect]": [
+ {
+ "checksum": "3d9c8a9a7000d6488fc53a7adadea0a5",
+ "size": 4246,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_subselect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_subselect_asterisk]": [
+ {
+ "checksum": "80fa9a5a9a9813f2e6e3bd69a95d2e6c",
+ "size": 3927,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_subselect_asterisk_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_gs_with_rollup]": [
+ {
+ "checksum": "1c53f89d6d78cdf03e5410d20acbb9a2",
+ "size": 5779,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_gs_with_rollup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop]": [
+ {
+ "checksum": "98e6d9d327ca25b12ceec5ca7eab27b6",
+ "size": 2005,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_compact]": [
+ {
+ "checksum": "801bbf511bc61e3aec6f82845399d22c",
+ "size": 2017,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_distinct]": [
+ {
+ "checksum": "c1ad2242cd7dce68adbb5f1cc2dd4823",
+ "size": 2052,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_distinct_compact]": [
+ {
+ "checksum": "822823ec5b080f2ca7087d3783d3d01f",
+ "size": 2064,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_distinct_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_expr_key]": [
+ {
+ "checksum": "ba0709c0d90b63ad36dc6063840826de",
+ "size": 2205,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_expr_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_list_key]": [
+ {
+ "checksum": "e154201e4ac90a125792ebdb2dab8572",
+ "size": 2197,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_only]": [
+ {
+ "checksum": "90aee7f93ba3e164708102f0abc46107",
+ "size": 1841,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_only_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_only_distinct]": [
+ {
+ "checksum": "051434fdaa29c0ef7b9fcf1adb15cfa8",
+ "size": 1888,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_only_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_only_start]": [
+ {
+ "checksum": "ccbc9f3beb8251db52ed231a6c9c7f67",
+ "size": 1570,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_only_start_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_star]": [
+ {
+ "checksum": "e777f280db84a47b4cdfe9176e6d9d1f",
+ "size": 1551,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_static]": [
+ {
+ "checksum": "a7a563dc87672b141c8209b38c0d446c",
+ "size": 3368,
+ "uri": "https://{canondata_backend}/1925821/aca60c4aca6b335189396eb0d636b37dbc38e5d9/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_static_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_hop_static_list_key]": [
+ {
+ "checksum": "4b8a74647da998a54e0ccffae0f365d6",
+ "size": 3547,
+ "uri": "https://{canondata_backend}/1937492/6205ff455a623f62222bc8ee2c2ee5c2e7ee4174/resource.tar.gz#test_sql2yql.test_aggregate-group_by_hop_static_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_mul_gb_ru]": [
+ {
+ "checksum": "002e7ddce42c228debb7382e9f8ea1d3",
+ "size": 6529,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_mul_gb_ru_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_mul_gs_expr_and_column]": [
+ {
+ "checksum": "6f96c351f68396431f6b9e58aa1c481f",
+ "size": 4745,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_mul_gs_expr_and_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_mul_gs_gs]": [
+ {
+ "checksum": "7fafac06b08a60c13f82458ff96b9e9e",
+ "size": 7867,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_mul_gs_gs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_mul_gs_ru]": [
+ {
+ "checksum": "5edb7d7b6eb3113512f19de373eb07b0",
+ "size": 5868,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_mul_gs_ru_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_mul_ru_ru]": [
+ {
+ "checksum": "9cd5ca991e42afea9a9fbb46f24959de",
+ "size": 15066,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_mul_ru_ru_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_aggr_expr]": [
+ {
+ "checksum": "8c59b2b9b96b8a982e2b244df21fa4f5",
+ "size": 5842,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_aggr_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_column_ref]": [
+ {
+ "checksum": "678b037c26ab53e2b51848a8aee0be29",
+ "size": 4447,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_column_ref_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_column_ref_same_names]": [
+ {
+ "checksum": "ba3b6412801abd67470f754d2fc5d187",
+ "size": 4507,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_column_ref_same_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_column_reuse]": [
+ {
+ "checksum": "a4f25712e1c59bd16df013d07ea51f7c",
+ "size": 5359,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_column_reuse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_duo]": [
+ {
+ "checksum": "035132d754ff0bae2c75d19195a6c5e2",
+ "size": 3342,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_duo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_duo_opt]": [
+ {
+ "checksum": "cd683753493f74abae56337e9a815e4b",
+ "size": 3771,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_duo_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_grouping]": [
+ {
+ "checksum": "59dfc41b69284d506a16df30e8ed7563",
+ "size": 6883,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_grouping_hum]": [
+ {
+ "checksum": "00a492807658102553f3b98142b215be",
+ "size": 7560,
+ "uri": "https://{canondata_backend}/1936947/a21ecf863255ddca1b96365dab953533651483f7/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_grouping_hum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_grouping_hum_bind]": [
+ {
+ "checksum": "a8efd089a88c161112b6ceea39f41b1b",
+ "size": 6552,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_grouping_hum_bind_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_key_check]": [
+ {
+ "checksum": "18ea9293e4d73f2e0b5e246c308a8879",
+ "size": 4648,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_key_check_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_rename]": [
+ {
+ "checksum": "e6248b4e28891772a91e2410b8bcc8ab",
+ "size": 3312,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_rename_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_udf]": [
+ {
+ "checksum": "929ee3cabc1c0dca771363bf4588db9a",
+ "size": 4633,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_rollup_with_filter]": [
+ {
+ "checksum": "e3035b788b010bd61bcb46a15a755de8",
+ "size": 3473,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_rollup_with_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join]": [
+ {
+ "checksum": "ea7dc3c9f3aee866de20838424686178",
+ "size": 2985,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_agg]": [
+ {
+ "checksum": "082b9fdce35d506e2cc9ab73e69afc48",
+ "size": 4308,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_grouping]": [
+ {
+ "checksum": "3a0b2a005b9f895baf3d97cb3423e330",
+ "size": 5822,
+ "uri": "https://{canondata_backend}/1903280/ab0a81bc2e9a5c845965f3189b0aa541c326bedf/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_qualified]": [
+ {
+ "checksum": "ccc9d86886fdb63b573d24ea94422d8f",
+ "size": 4684,
+ "uri": "https://{canondata_backend}/1903280/ab0a81bc2e9a5c845965f3189b0aa541c326bedf/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_qualified_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_simple]": [
+ {
+ "checksum": "f712ec9f2da421bab705ff26bee929ba",
+ "size": 4201,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_simple_fs_multiusage]": [
+ {
+ "checksum": "65b5bf65b392ec291ae914a2bc34f1b7",
+ "size": 4304,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_simple_fs_multiusage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_join_star]": [
+ {
+ "checksum": "8a8405fdcda77d4f65df8bdaa0bd8070",
+ "size": 2771,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_join_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_partition_by_grouping]": [
+ {
+ "checksum": "006a167731e643e993f975e4904366fd",
+ "size": 5896,
+ "uri": "https://{canondata_backend}/1781765/275eb46642921957e733909d887afbe95f1f2061/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_partition_by_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_with_select_distinct]": [
+ {
+ "checksum": "66b8b1eea14cf9658a7e60294b73ffef",
+ "size": 2697,
+ "uri": "https://{canondata_backend}/1925842/455f0a4e786bf55f7710ef3d0b8e42af1becc974/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_with_select_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_ru_with_window_func]": [
+ {
+ "checksum": "bbb3d5c16fcb800ee7c6a9203a3cd4f0",
+ "size": 3008,
+ "uri": "https://{canondata_backend}/1916746/28040436e8adf35f54411fd2392bcd0557fc0b73/resource.tar.gz#test_sql2yql.test_aggregate-group_by_ru_with_window_func_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session]": [
+ {
+ "checksum": "67b3e34d907f2b3cb1c07c8121e5cecd",
+ "size": 2813,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_aliases]": [
+ {
+ "checksum": "f4039b20d6c92117af2a1b4f5f0f5104",
+ "size": 3080,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_compact]": [
+ {
+ "checksum": "820abb4426a808bb727ab5d0b14751cb",
+ "size": 2825,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_distinct]": [
+ {
+ "checksum": "bde7e0d17c7c0c7c7095df6103788025",
+ "size": 3177,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_distinct_compact]": [
+ {
+ "checksum": "6e14af1502799b11a4dccac2fad58f49",
+ "size": 3189,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_distinct_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_extended]": [
+ {
+ "checksum": "fc0127819e614b7d10f08ca15177eb12",
+ "size": 3523,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_extended_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_extended_subset]": [
+ {
+ "checksum": "701e8d88ae3e1ed4c01599d30d7e1143",
+ "size": 3513,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_extended_subset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_extended_tuple]": [
+ {
+ "checksum": "a5a9f92c1a2ff4dab11aeaccd1d65062",
+ "size": 4241,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_extended_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_only]": [
+ {
+ "checksum": "0c22dd1ef887ea533c6e0621c0937ffa",
+ "size": 1879,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_only_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_only_distinct]": [
+ {
+ "checksum": "377b368f80b93e79b9a3d9f5214d549c",
+ "size": 1922,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_only_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_session_star]": [
+ {
+ "checksum": "ebbf27c38a8d2bcb802a7a0e41ce5367",
+ "size": 3439,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-group_by_session_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_tablerow_column]": [
+ {
+ "checksum": "04a09943d161ce8be262953d83b10fd3",
+ "size": 1433,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-group_by_tablerow_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_tz_date]": [
+ {
+ "checksum": "4f6429472542fbd1831c191e37d8fcf4",
+ "size": 1527,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_tz_date_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_with_udf_by_aggregate]": [
+ {
+ "checksum": "90dbbd9cb690e296aca9e5120692ff57",
+ "size": 2332,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-group_by_with_udf_by_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_by_with_where]": [
+ {
+ "checksum": "a4d8c49f68b41fca4c2fb8d4643e6f8e",
+ "size": 1784,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_aggregate-group_by_with_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_compact_sorted]": [
+ {
+ "checksum": "97c71faaf499fd07e43d7fbc3c1de74d",
+ "size": 2027,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-group_compact_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_compact_sorted_distinct]": [
+ {
+ "checksum": "3705d341302c65755512e152b1523de9",
+ "size": 2500,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-group_compact_sorted_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_compact_sorted_distinct_complex]": [
+ {
+ "checksum": "6629fe5df98fab7409b010cbf8b38039",
+ "size": 2733,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_aggregate-group_compact_sorted_distinct_complex_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-group_compact_sorted_with_diff_order]": [
+ {
+ "checksum": "23675b92ee3de249957479c121e2e5f4",
+ "size": 12400,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-group_compact_sorted_with_diff_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-having_cast]": [
+ {
+ "checksum": "60a49aa0dc009c04387296dcef5392e4",
+ "size": 1481,
+ "uri": "https://{canondata_backend}/1925821/63988f8b58a67ce9868f61562ec8de6f6339e324/resource.tar.gz#test_sql2yql.test_aggregate-having_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-having_distinct_expr]": [
+ {
+ "checksum": "df55391d9c1a6d1ffba1d34ea1a57f40",
+ "size": 1656,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-having_distinct_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-histogram_cdf]": [
+ {
+ "checksum": "e5e2b38f46a9957ea164ce06512dd350",
+ "size": 1817,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-histogram_cdf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-library_error_in_aggregation_fail]": [
+ {
+ "checksum": "1f53d7b4dcae149901d82ef5f87ed0ec",
+ "size": 6966,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-library_error_in_aggregation_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-list_after_group]": [
+ {
+ "checksum": "b9eb9c79447e44901846d93835521b13",
+ "size": 1960,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-list_after_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-list_nullable]": [
+ {
+ "checksum": "cc6f6ce6e18e7a4c4234e43873539c9e",
+ "size": 1367,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-list_nullable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-list_with_fold_map]": [
+ {
+ "checksum": "f731307844e5443739bee23d71fdce6f",
+ "size": 2389,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-list_with_fold_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-listbuiltin_constness]": [
+ {
+ "checksum": "52ac6d856421c39c7d54c20abe892881",
+ "size": 1247,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggregate-listbuiltin_constness_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-native_desc_group_compact_by]": [
+ {
+ "checksum": "60297487829aca2c1baea87721604968",
+ "size": 6191,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_aggregate-native_desc_group_compact_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-null_type]": [
+ {
+ "checksum": "33f4556d059ae6520e3e360b3a780337",
+ "size": 7212,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-null_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-parsetype_constness]": [
+ {
+ "checksum": "8143d0121ae81a06296b26f4b0640db3",
+ "size": 1330,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_aggregate-parsetype_constness_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentile_and_avg_grouped]": [
+ {
+ "checksum": "6972d7f5c2c4af1af8c4c28ed42c6aa6",
+ "size": 2434,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_aggregate-percentile_and_avg_grouped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentile_and_variance]": [
+ {
+ "checksum": "a170c234632094b70483f073781c930d",
+ "size": 2227,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-percentile_and_variance_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentile_interval]": [
+ {
+ "checksum": "a8095f04d1a346b02c949833efa12ed4",
+ "size": 7720,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-percentile_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentiles_containers]": [
+ {
+ "checksum": "1c7863a99ea8f792c42801b79d5be2fa",
+ "size": 5387,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-percentiles_containers_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentiles_grouped]": [
+ {
+ "checksum": "84f8e6ac21c327f0e2d149c3c2d34063",
+ "size": 2568,
+ "uri": "https://{canondata_backend}/1784826/6e24b46ab3ce91844f7fd0a7e573c44927321db7/resource.tar.gz#test_sql2yql.test_aggregate-percentiles_grouped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentiles_grouped_expr]": [
+ {
+ "checksum": "b7ce012d502e87f8773eb9d084511c5b",
+ "size": 2941,
+ "uri": "https://{canondata_backend}/1937367/36b9b53e2ef8c06dfaa0dea31b7847ae28a37caa/resource.tar.gz#test_sql2yql.test_aggregate-percentiles_grouped_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-percentiles_ungrouped]": [
+ {
+ "checksum": "1b66657e7c4bfb68a30d66a6d28ee024",
+ "size": 2007,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_aggregate-percentiles_ungrouped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-rollup_with_dict]": [
+ {
+ "checksum": "577a11a012302300a14bfe3be2f372ec",
+ "size": 3203,
+ "uri": "https://{canondata_backend}/1942278/beab6e829114ea03a5df7881bc0d363cdf567406/resource.tar.gz#test_sql2yql.test_aggregate-rollup_with_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-subquery_aggregation]": [
+ {
+ "checksum": "d5a40ddd4148b8a3d92f5c1249c520c5",
+ "size": 2913,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_aggregate-subquery_aggregation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-table_funcs_group_by]": [
+ {
+ "checksum": "3c72f83edc351e7f467f94d577b763d4",
+ "size": 1779,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_aggregate-table_funcs_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-table_row_aggregation]": [
+ {
+ "checksum": "44f9a8447b4d827cc993641fb4d42027",
+ "size": 2076,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_aggregate-table_row_aggregation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[aggregate-yql-18511]": [
+ {
+ "checksum": "cca030f77b003f0ee9f627e04304fad1",
+ "size": 21501,
+ "uri": "https://{canondata_backend}/1689644/9f0cb0061bf69b8a694d5c2f0375cda28d1cca57/resource.tar.gz#test_sql2yql.test_aggregate-yql-18511_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-basic_columns]": [
+ {
+ "checksum": "fadc1b514b58a7b9461bc04ed451c197",
+ "size": 1196,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_ansi_idents-basic_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-escaped_udf_name]": [
+ {
+ "checksum": "c33b1444fb03ff901f856b3a9a606142",
+ "size": 1323,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_ansi_idents-escaped_udf_name_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-escaping]": [
+ {
+ "checksum": "cf46e89983d8c1335cc5966ef5526fdf",
+ "size": 1270,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ansi_idents-escaping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-inplace_yql]": [
+ {
+ "checksum": "928dbb1e2bf5b917b07d8ff8207e13ed",
+ "size": 1136,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ansi_idents-inplace_yql_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-join_using]": [
+ {
+ "checksum": "b1e5dd2ea97c296117fbeb8bf476541f",
+ "size": 1576,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ansi_idents-join_using_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-order_by]": [
+ {
+ "checksum": "dd890c59a92857cd9cde122b74c05162",
+ "size": 1235,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_ansi_idents-order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-string_escaping]": [
+ {
+ "checksum": "d92d55f9ebcc05775a44a3fb7788c5c9",
+ "size": 1471,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ansi_idents-string_escaping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ansi_idents-struct_access]": [
+ {
+ "checksum": "952c35bdc2517f4a23064e96da7fc768",
+ "size": 1119,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ansi_idents-struct_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-arithmetic]": [
+ {
+ "checksum": "dd71cf80379fd120f899f51a8d4185e0",
+ "size": 55200,
+ "uri": "https://{canondata_backend}/1784117/72de9d096244671bdc282e3e67e222f7d47084f5/resource.tar.gz#test_sql2yql.test_bigdate-arithmetic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-bitcast_date32]": [
+ {
+ "checksum": "02fb9395c914d889fc3a1d2ead1239fb",
+ "size": 3482,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-bitcast_date32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-bitcast_datetime64]": [
+ {
+ "checksum": "81493fe6eb67073cbe6349f02324bd94",
+ "size": 2428,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-bitcast_datetime64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-bitcast_interval64]": [
+ {
+ "checksum": "19fd3d73c17d04b6a13231f23d02c175",
+ "size": 2428,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-bitcast_interval64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-bitcast_timestamp64]": [
+ {
+ "checksum": "11a8371001593709a74d9e45d4d594d9",
+ "size": 2436,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-bitcast_timestamp64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-common_type]": [
+ {
+ "checksum": "8a97f33a7587893afc48c941e6986b0b",
+ "size": 13879,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-common_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-compare_big_big]": [
+ {
+ "checksum": "e9945e8fb4b14564d5ad968130167b92",
+ "size": 9055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-compare_big_big_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-compare_big_small]": [
+ {
+ "checksum": "9a197eb648baa93c9d254b75343f03b2",
+ "size": 21632,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-compare_big_small_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-compare_small_big]": [
+ {
+ "checksum": "94ac9c331fe8f3ab773cecdaf0722f19",
+ "size": 21632,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-compare_small_big_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-const_date32]": [
+ {
+ "checksum": "afafa414d5c4ddb6bd4d57fbb29faa92",
+ "size": 11333,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-const_date32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-const_datetime64]": [
+ {
+ "checksum": "9779674f02f61c910be45b8fcce9a4b5",
+ "size": 14766,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-const_datetime64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-const_interval64]": [
+ {
+ "checksum": "ef9ffdb0666124a5d9934d3ed0fb9f8a",
+ "size": 27390,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-const_interval64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-const_timestamp64]": [
+ {
+ "checksum": "cc5c8b52ded13596fded17a4b8dfc4ca",
+ "size": 22788,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-const_timestamp64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-explicit_cast]": [
+ {
+ "checksum": "e48eb770e3f95146c8e6c9f0f1a3c731",
+ "size": 22917,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-explicit_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-implicit_cast_callable]": [
+ {
+ "checksum": "85b90c1d9433e047074a97050e5a95fd",
+ "size": 14792,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-implicit_cast_callable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-input_date32]": [
+ {
+ "checksum": "848c5faa23097136eb5a4f6b59dd8d81",
+ "size": 17911,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-input_date32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-input_datetime64]": [
+ {
+ "checksum": "f46e865f689b996cd10b4fcd8724111f",
+ "size": 25604,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-input_datetime64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-input_interval64]": [
+ {
+ "checksum": "aafee2960499777bb0603837156d2300",
+ "size": 37350,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-input_interval64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-input_timestamp64]": [
+ {
+ "checksum": "10448894b4222e22ab28ee9ad768b28e",
+ "size": 51310,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-input_timestamp64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-int_cast]": [
+ {
+ "checksum": "ad1eec5f8085df20b8edff19b0c24dd2",
+ "size": 22193,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-int_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-int_literals]": [
+ {
+ "checksum": "3a737fe8f57a0af2bf5aefaf1113b7df",
+ "size": 4812,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-int_literals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-misc]": [
+ {
+ "checksum": "0e7968fec2e862b2ca4f1d86f9a10214",
+ "size": 6867,
+ "uri": "https://{canondata_backend}/1600758/5294eabd3489369805058d70413ce160bae2974a/resource.tar.gz#test_sql2yql.test_bigdate-misc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-output_date32]": [
+ {
+ "checksum": "45313908c7014231418f13dd1c0634ac",
+ "size": 4459,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-output_date32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-output_datetime64]": [
+ {
+ "checksum": "62faf36e3aa8ee099c66f9f7b9a14a67",
+ "size": 3763,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-output_datetime64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-output_interval64]": [
+ {
+ "checksum": "0defc7c183a850fccace553600cd89d7",
+ "size": 3354,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-output_interval64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-output_timestamp64]": [
+ {
+ "checksum": "9c80bc00eccd8a223ccceeb197dc0746",
+ "size": 3776,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-output_timestamp64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-presort]": [
+ {
+ "checksum": "df7cc615afa4db1659ba17ff01bd99a3",
+ "size": 3864,
+ "uri": "https://{canondata_backend}/1942415/d17da694c5b566c267a123b241f489130b3f5d3c/resource.tar.gz#test_sql2yql.test_bigdate-presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-round]": [
+ {
+ "checksum": "2af83c0ecf1bea79db47fd9e1b0ff149",
+ "size": 47690,
+ "uri": "https://{canondata_backend}/1936947/6d1acd1012019743042aea215336533774b0085a/resource.tar.gz#test_sql2yql.test_bigdate-round_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_arithmetic]": [
+ {
+ "checksum": "43a6e029f896c58d7391bccbaeb72222",
+ "size": 8254,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bigdate-table_arithmetic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_arithmetic_mul_div]": [
+ {
+ "checksum": "2f67d8ecc74d9d0276a37a641f538219",
+ "size": 18356,
+ "uri": "https://{canondata_backend}/1781765/f46b05df4bb17dd1ec082c870bb4ecd16af4e932/resource.tar.gz#test_sql2yql.test_bigdate-table_arithmetic_mul_div_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_arithmetic_narrow]": [
+ {
+ "checksum": "e83558aaceb6951b3327156e6ec63755",
+ "size": 13075,
+ "uri": "https://{canondata_backend}/1937367/de2d5168ea56c6d148f8a9afb9e8dde6299cc86e/resource.tar.gz#test_sql2yql.test_bigdate-table_arithmetic_narrow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_arithmetic_sub]": [
+ {
+ "checksum": "0c0b6213b453c44f939147b6e6f88038",
+ "size": 4233,
+ "uri": "https://{canondata_backend}/1937367/de2d5168ea56c6d148f8a9afb9e8dde6299cc86e/resource.tar.gz#test_sql2yql.test_bigdate-table_arithmetic_sub_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_common_type]": [
+ {
+ "checksum": "abd4bd7485d5fab50034fd5b8a2c7793",
+ "size": 6785,
+ "uri": "https://{canondata_backend}/1781765/757a6ed1be1045d26422d71be3695145ab42cb49/resource.tar.gz#test_sql2yql.test_bigdate-table_common_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_explicit_cast]": [
+ {
+ "checksum": "e01e7c5bb8087403b22932b6cc0cffa1",
+ "size": 13684,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql2yql.test_bigdate-table_explicit_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_int_cast]": [
+ {
+ "checksum": "d989e7225b42eb3835b477a93106442c",
+ "size": 18824,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql2yql.test_bigdate-table_int_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_io]": [
+ {
+ "checksum": "ac0480e09853faf5c914482800a6521e",
+ "size": 4910,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql2yql.test_bigdate-table_io_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_yt_key_filter]": [
+ {
+ "checksum": "e6c57e6249e0cb2c82f0761eb74b1cb5",
+ "size": 13118,
+ "uri": "https://{canondata_backend}/1777230/9c6f872e0894439818988e4f0a8fe340184faee7/resource.tar.gz#test_sql2yql.test_bigdate-table_yt_key_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-table_yt_native]": [
+ {
+ "checksum": "b598f98ab939e713ca8b0bce6347b09b",
+ "size": 2417,
+ "uri": "https://{canondata_backend}/212715/99c394fc142b628d22e13d9433512bcac243f701/resource.tar.gz#test_sql2yql.test_bigdate-table_yt_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tz_bytes]": [
+ {
+ "checksum": "f052c58ac04a5c4bb2b46ccdf38dc672",
+ "size": 5312,
+ "uri": "https://{canondata_backend}/1937367/fb7bc472ea97cce2f795f26ab64cf43ffb7e6852/resource.tar.gz#test_sql2yql.test_bigdate-tz_bytes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tz_table_fill]": [
+ {
+ "checksum": "ae7e8ab4b24539855a66a897c2ce337a",
+ "size": 1532,
+ "uri": "https://{canondata_backend}/1942525/a2cade528f847eb07daea7e9adb5e13c62cde3d8/resource.tar.gz#test_sql2yql.test_bigdate-tz_table_fill_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tz_table_pull]": [
+ {
+ "checksum": "95094fb22f7873c976a5af8fcb0ce93c",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1847551/b9e12f01e97071b357913a106f1c0e7f12e755ca/resource.tar.gz#test_sql2yql.test_bigdate-tz_table_pull_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tz_table_rw]": [
+ {
+ "checksum": "c5bf257211a2ea04311c9ff8653c00d9",
+ "size": 1547,
+ "uri": "https://{canondata_backend}/1942525/a2cade528f847eb07daea7e9adb5e13c62cde3d8/resource.tar.gz#test_sql2yql.test_bigdate-tz_table_rw_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tz_table_yt_key_filter]": [
+ {
+ "checksum": "12bfaa7cd939131482be3c11f7054d77",
+ "size": 10754,
+ "uri": "https://{canondata_backend}/1777230/9c6f872e0894439818988e4f0a8fe340184faee7/resource.tar.gz#test_sql2yql.test_bigdate-tz_table_yt_key_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tzcasts]": [
+ {
+ "checksum": "c0fc2df0d2211e742c487671708c9d3e",
+ "size": 3515,
+ "uri": "https://{canondata_backend}/1784826/652180d91e8319c62c5aacfb1321af23430ade4b/resource.tar.gz#test_sql2yql.test_bigdate-tzcasts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tznumliterals]": [
+ {
+ "checksum": "0ba6e6b77a0900605359caac56160511",
+ "size": 10076,
+ "uri": "https://{canondata_backend}/1773845/723ba74c1f8fe2198e8eda94ad781fdefd785099/resource.tar.gz#test_sql2yql.test_bigdate-tznumliterals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bigdate-tzstrliterals]": [
+ {
+ "checksum": "50f91fa622c3e868d46fffbecbf63e59",
+ "size": 9992,
+ "uri": "https://{canondata_backend}/1773845/723ba74c1f8fe2198e8eda94ad781fdefd785099/resource.tar.gz#test_sql2yql.test_bigdate-tzstrliterals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-anon_table_binding]": [
+ {
+ "checksum": "cf1e9ee529d4fcca3781cc85b3e555d8",
+ "size": 1856,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-anon_table_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-bind_cast]": [
+ {
+ "checksum": "60f14e62cbb5f7598ef23f0b1fec8ab9",
+ "size": 1017,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-bind_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-bind_select]": [
+ {
+ "checksum": "b45d0e502898e2e619b51c159562ea96",
+ "size": 1533,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-bind_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-compact_named_exprs]": [
+ {
+ "checksum": "a773b156672b11373a9608855255ca6a",
+ "size": 1785,
+ "uri": "https://{canondata_backend}/1809005/b7945fe82426e7557a5cb23e4f8d7e62a7121d64/resource.tar.gz#test_sql2yql.test_binding-compact_named_exprs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-compact_named_subq_actions]": [
+ {
+ "checksum": "72bf14d69ead2d74561549172e4fa693",
+ "size": 6267,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_binding-compact_named_subq_actions_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-compact_named_with_subq_contexts]": [
+ {
+ "checksum": "3a3110b72747676fc712610ea376bc63",
+ "size": 5774,
+ "uri": "https://{canondata_backend}/1942415/4d74b807c83c1e482d93f5dffd276eccf97421f9/resource.tar.gz#test_sql2yql.test_binding-compact_named_with_subq_contexts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-drop_binding]": [
+ {
+ "checksum": "75cf90a7c8914e5b41f1df89ab444492",
+ "size": 409,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_binding-drop_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-insert_binding]": [
+ {
+ "checksum": "5a60dcb2694f86bd242f8270635ca4f4",
+ "size": 1257,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_binding-insert_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-named_callable]": [
+ {
+ "checksum": "b65aaf70c66a54051bd54ce7cb6fae4d",
+ "size": 1094,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-named_callable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-named_expr_input]": [
+ {
+ "checksum": "b45d0e502898e2e619b51c159562ea96",
+ "size": 1533,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-named_expr_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-named_node_corr_names]": [
+ {
+ "checksum": "2305087fb31ffab6229c2b0c40689b3b",
+ "size": 2566,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-named_node_corr_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_concat_binding]": [
+ {
+ "checksum": "deced763977276663a6dee6c8255e137",
+ "size": 2432,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_concat_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_concat_strict_binding]": [
+ {
+ "checksum": "16c41cbf6f00feee623c9d7156790c23",
+ "size": 2406,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_concat_strict_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_filter_binding]": [
+ {
+ "checksum": "28db0395be7c19afdb8042473d41d68c",
+ "size": 4968,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_filter_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_filter_strict_binding]": [
+ {
+ "checksum": "a02d62004784ed35ae10426e6233c5b9",
+ "size": 4992,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_filter_strict_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_from_binding]": [
+ {
+ "checksum": "2407aef4c435e1e71daf33f654bcd063",
+ "size": 1299,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_from_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_from_binding_inferscheme]": [
+ {
+ "checksum": "0bc11fc73b0835002805000d14054260",
+ "size": 1384,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_from_binding_inferscheme_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_range_binding]": [
+ {
+ "checksum": "094cd332df180206b18beab326db4574",
+ "size": 7216,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_range_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_range_strict_binding]": [
+ {
+ "checksum": "f39865d2168d407ab07dbe3e914a04dc",
+ "size": 7252,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_range_strict_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_regexp_binding]": [
+ {
+ "checksum": "bffbef0f1c639485f5b00f9f3d6bbf7b",
+ "size": 2536,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_regexp_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-table_regexp_strict_binding]": [
+ {
+ "checksum": "a40500adec3350f774ac137bd975cb7e",
+ "size": 2548,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-table_regexp_strict_binding_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-tie]": [
+ {
+ "checksum": "efdb5d916324fe19ce040be7c0f6845d",
+ "size": 1495,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-tie_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-tie_bad_count_fail]": [
+ {
+ "checksum": "83bb57727063e53f4cafe80be1b83ca1",
+ "size": 1276,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-tie_bad_count_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[binding-tie_scalar_context]": [
+ {
+ "checksum": "c5f06c08152af69566d3049aa8161654",
+ "size": 3224,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_binding-tie_scalar_context_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bitcast_implicit-add_bitcast]": [
+ {
+ "checksum": "71fb7713af39936b58e50c14df35270a",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bitcast_implicit-add_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bitcast_implicit-div_bitcast]": [
+ {
+ "checksum": "9fd065ca4c85037c987fc73086785a02",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bitcast_implicit-div_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bitcast_implicit-mod_bitcast]": [
+ {
+ "checksum": "c7e3ebec91cdcce41b0b54f67f56ef00",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bitcast_implicit-mod_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bitcast_implicit-mul_bitcast]": [
+ {
+ "checksum": "fbf9fbbeeaf266cf5a31916052b5e85d",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bitcast_implicit-mul_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[bitcast_implicit-sub_bitcast]": [
+ {
+ "checksum": "5414e759d066ef0539a7c2e46f44db44",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_bitcast_implicit-sub_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_decimal]": [
+ {
+ "checksum": "e6d39b84d45f6541ce253f4307e2c6bf",
+ "size": 1668,
+ "uri": "https://{canondata_backend}/1900335/8af685f983ecf5996df52bc7dc7bb3d611a1566f/resource.tar.gz#test_sql2yql.test_blocks-add_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_int16]": [
+ {
+ "checksum": "42b47f64d1624134c6f630719ce556e5",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_int16_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_int32]": [
+ {
+ "checksum": "62cf3cdd5d03618608aebf97cfac889c",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_int32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_int64]": [
+ {
+ "checksum": "144413229d511198331f51084c1e72b5",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_int64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_int8]": [
+ {
+ "checksum": "af9c5cc70d8e5dc0ccafb6211be6a501",
+ "size": 1539,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_int8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint16]": [
+ {
+ "checksum": "78d14fdf0b843661a87e29b30cee787e",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint16_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint32]": [
+ {
+ "checksum": "cc6ef987ddd736a5949a0cfbef9fdf8c",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint64]": [
+ {
+ "checksum": "8c1c60a9aa11b34779773206355cd6d9",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint64_opt2]": [
+ {
+ "checksum": "8c1c60a9aa11b34779773206355cd6d9",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint64_opt2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint64_opt]": [
+ {
+ "checksum": "8c1c60a9aa11b34779773206355cd6d9",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint64_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-add_uint8]": [
+ {
+ "checksum": "68aa630f5479a7f6a6ad0ea750919647",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-add_uint8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-bitcast_block]": [
+ {
+ "checksum": "dc4ae5a4e4e84be4f76e84a86e2f6935",
+ "size": 1152,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-bitcast_block_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-bitcast_scalar]": [
+ {
+ "checksum": "a9b680a8ec1858d4e928552b9a199350",
+ "size": 1151,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-bitcast_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-block_input]": [
+ {
+ "checksum": "ac2963b4f4a01250eb66434749163c94",
+ "size": 1707,
+ "uri": "https://{canondata_backend}/1817427/4978ac42ab916ab33f9caeb75154df4b4d7e3dee/resource.tar.gz#test_sql2yql.test_blocks-block_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-block_input_sys_columns]": [
+ {
+ "checksum": "2f2abdffad20313a9c0dcd5eb1124e94",
+ "size": 5695,
+ "uri": "https://{canondata_backend}/1599023/85abe49b40cf536aae38f22fd9096a110453232d/resource.tar.gz#test_sql2yql.test_blocks-block_input_sys_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-block_input_various_types]": [
+ {
+ "checksum": "000d1e06a52c9e63fae366c4d00b485d",
+ "size": 1332,
+ "uri": "https://{canondata_backend}/1817427/4978ac42ab916ab33f9caeb75154df4b4d7e3dee/resource.tar.gz#test_sql2yql.test_blocks-block_input_various_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-boolean_ops]": [
+ {
+ "checksum": "2a340b5aa300533288a120f1969949b1",
+ "size": 4044,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-boolean_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-coalesce_bools]": [
+ {
+ "checksum": "bd69e53b9453022f28d462636c1eb218",
+ "size": 2942,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-coalesce_bools_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-coalesce_complex]": [
+ {
+ "checksum": "330e6a811d9436634b03bd8d83970b80",
+ "size": 5732,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-coalesce_complex_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-coalesce_ints]": [
+ {
+ "checksum": "a2cb81a74709167a712005376de3715e",
+ "size": 2805,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-coalesce_ints_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_avg]": [
+ {
+ "checksum": "9bedbc5414d18d210c2895c5ab1e00cd",
+ "size": 3736,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_avg_filter]": [
+ {
+ "checksum": "0725de546392bb1f1f000ec5073552a1",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_avg_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_avg_filter_opt]": [
+ {
+ "checksum": "0725de546392bb1f1f000ec5073552a1",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_avg_filter_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_count]": [
+ {
+ "checksum": "f28b729b7029d095f9d01eb0255df6bd",
+ "size": 2504,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_count_filter]": [
+ {
+ "checksum": "6b82c63cc3b1df5d8bc9acddac40424a",
+ "size": 1696,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_count_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_count_filter_opt]": [
+ {
+ "checksum": "6b82c63cc3b1df5d8bc9acddac40424a",
+ "size": 1696,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_count_filter_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_decimal]": [
+ {
+ "checksum": "87016e6b1e2a0e93870086ee9bb5f973",
+ "size": 3955,
+ "uri": "https://{canondata_backend}/1689644/bebe9ff4f61a19b42469a2d8a15dc9603a6ce7d5/resource.tar.gz#test_sql2yql.test_blocks-combine_all_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_decimal_max]": [
+ {
+ "checksum": "cb2fec771db04767583a924da4d767b9",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1942100/df0cf5f44e4a847c8c10b5a97f5a8900aa2ae5b4/resource.tar.gz#test_sql2yql.test_blocks-combine_all_decimal_max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_max]": [
+ {
+ "checksum": "8f4360e9c24a9329a3d64ca8e2047807",
+ "size": 5623,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_max_filter]": [
+ {
+ "checksum": "bb5e178b0e9380f1c4b11661651c0a24",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_max_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_max_filter_opt]": [
+ {
+ "checksum": "bb5e178b0e9380f1c4b11661651c0a24",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_max_filter_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_min]": [
+ {
+ "checksum": "6370a62d1e3754d37795e8cb46b028b4",
+ "size": 5623,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_min_filter]": [
+ {
+ "checksum": "9672ee4c537399f6e098e478ebd93628",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_min_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_min_filter_opt]": [
+ {
+ "checksum": "9672ee4c537399f6e098e478ebd93628",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_min_filter_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_minmax_double]": [
+ {
+ "checksum": "6e5704e83116bf8f63616c6b2acdf35b",
+ "size": 1577,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_minmax_double_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_minmax_nested]": [
+ {
+ "checksum": "454405311d40fbc21f925e89288d1e80",
+ "size": 1575,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_minmax_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_pg]": [
+ {
+ "checksum": "a30172ea63ed29935084acd7d6d0a89a",
+ "size": 4341,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_pg_filter]": [
+ {
+ "checksum": "4a79eb14533a0085ccbc6afb64b7584b",
+ "size": 3272,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_pg_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_some]": [
+ {
+ "checksum": "526a565507913bc0c859884f85f663c1",
+ "size": 5668,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_some_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_some_filter]": [
+ {
+ "checksum": "30033b0520d3356cfac43f507574db51",
+ "size": 1427,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_some_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_sum]": [
+ {
+ "checksum": "aec40ad7be74d6cf059c394298e1f969",
+ "size": 3445,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_sum_filter]": [
+ {
+ "checksum": "e0d9f34efcb778f8dc6eb682e1fe1668",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_sum_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_all_sum_filter_opt]": [
+ {
+ "checksum": "9672ee4c537399f6e098e478ebd93628",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_all_sum_filter_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_avg]": [
+ {
+ "checksum": "4c56d39fea0238726a05e04692a8dbf3",
+ "size": 2393,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_count]": [
+ {
+ "checksum": "0549b0f009a4980723281a4f185da5de",
+ "size": 2683,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_count_filter]": [
+ {
+ "checksum": "56807b5df292ce10560f69f9aa74dc15",
+ "size": 1630,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_count_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_max]": [
+ {
+ "checksum": "67005cf2a9f2802dbc1cea0f7e178a59",
+ "size": 2393,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_min]": [
+ {
+ "checksum": "31193bda812cc909203989fbc5c758b4",
+ "size": 2393,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_minmax_double]": [
+ {
+ "checksum": "2a72371c37baa44925b0ec818cc16884",
+ "size": 1786,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_minmax_double_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_minmax_nested]": [
+ {
+ "checksum": "c6580850bed7e4614dd8f0b08fc37e05",
+ "size": 1784,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_minmax_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_pg]": [
+ {
+ "checksum": "390a8f24517d6cef1e453388e4655fee",
+ "size": 4493,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_set]": [
+ {
+ "checksum": "1ceb45505e84a65e50c55772e1fdb8cf",
+ "size": 1243,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_set_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_some]": [
+ {
+ "checksum": "1be9b2b145367b8be1893573edac6e44",
+ "size": 2405,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_some_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_sum]": [
+ {
+ "checksum": "3c6e3c03f7691853dc03043eb5477b12",
+ "size": 2393,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-combine_hashed_sum_many_keys]": [
+ {
+ "checksum": "42ca435e47fad4923be829769738e5d4",
+ "size": 10298,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-combine_hashed_sum_many_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-compare]": [
+ {
+ "checksum": "0d8f2a39ab47f1f13d7db3cff3a788ea",
+ "size": 4571,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-compare_dates_floats_bools]": [
+ {
+ "checksum": "476af408d803ff65458a534a4c80c33b",
+ "size": 7388,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-compare_dates_floats_bools_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-complex_scalars]": [
+ {
+ "checksum": "d30d7c3484fd803d8c7444d6f1b92310",
+ "size": 2280,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-complex_scalars_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_add_interval]": [
+ {
+ "checksum": "fe7e4b33ad9c55fc7d6e12eb76b4e7f8",
+ "size": 6245,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql2yql.test_blocks-date_add_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_add_interval_scalar]": [
+ {
+ "checksum": "51f5e4d371a50dcb75cc0998010111a5",
+ "size": 11680,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql2yql.test_blocks-date_add_interval_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_equals]": [
+ {
+ "checksum": "9b103c0192213071c3c83145d2a16878",
+ "size": 32558,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_equals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_equals_scalar]": [
+ {
+ "checksum": "f78aab9c5b213ccc8730e672198aa9e5",
+ "size": 63060,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_equals_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_greater]": [
+ {
+ "checksum": "ac3dd755d595c71c562ab2390bd281ad",
+ "size": 32410,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_greater_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_greater_or_equal]": [
+ {
+ "checksum": "2e7ce1b922d47fbd2bd353744bc61bb0",
+ "size": 32558,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_greater_or_equal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_greater_or_equal_scalar]": [
+ {
+ "checksum": "abfce112b7351acdcba600f59eb64d2b",
+ "size": 63060,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_greater_or_equal_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_greater_scalar]": [
+ {
+ "checksum": "0d313b96951558cf92975f4258fdb8b7",
+ "size": 62764,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_greater_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_group_by]": [
+ {
+ "checksum": "cfe4d61ba7dd41c5bf9db3fbff80f8d1",
+ "size": 2487,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_less]": [
+ {
+ "checksum": "56fadb9047c20c96bf80a1024abdf433",
+ "size": 32410,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_less_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_less_or_equal]": [
+ {
+ "checksum": "9fe77d7a489c828f5e8193402718465f",
+ "size": 32558,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_less_or_equal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_less_or_equal_scalar]": [
+ {
+ "checksum": "b0d3fb36ac5cae4d9acb1406df8054bf",
+ "size": 63060,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_less_or_equal_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_less_scalar]": [
+ {
+ "checksum": "4c0bdf10435a937a1dd581dbb7a20758",
+ "size": 62764,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_less_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_not_equals]": [
+ {
+ "checksum": "9d7b12873964f2461c685cb492913459",
+ "size": 32558,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_not_equals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_not_equals_scalar]": [
+ {
+ "checksum": "6eeaeef3af043006310baf5a782e43bb",
+ "size": 63060,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_not_equals_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_sub]": [
+ {
+ "checksum": "f1c2a5fae328334f7c62aa0f402a322e",
+ "size": 32610,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql2yql.test_blocks-date_sub_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_sub_interval]": [
+ {
+ "checksum": "0992d88a2aa1f15bc8d295a82eebccd7",
+ "size": 6245,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql2yql.test_blocks-date_sub_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_sub_interval_scalar]": [
+ {
+ "checksum": "32e0dad48b567cb9f896e7ab5be01d30",
+ "size": 11680,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql2yql.test_blocks-date_sub_interval_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_sub_scalar]": [
+ {
+ "checksum": "51362cd74665dc836ba73b756477ada3",
+ "size": 63228,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql2yql.test_blocks-date_sub_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-date_top_sort]": [
+ {
+ "checksum": "d968a2aed57eb686c4e18e1c71e81398",
+ "size": 2733,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql2yql.test_blocks-date_top_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_avg]": [
+ {
+ "checksum": "196ced0d7dead2abf0aa5fa8dc6b10cf",
+ "size": 2231,
+ "uri": "https://{canondata_backend}/1775319/1580c5e8e4c110f53c15179e596f8942460372c9/resource.tar.gz#test_sql2yql.test_blocks-decimal_avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_comparison]": [
+ {
+ "checksum": "8ca5e73502f650d4d05eb9770ffbf4a0",
+ "size": 4678,
+ "uri": "https://{canondata_backend}/1923547/4867af26e59d2b50038b167d59c2026bb3dd66b3/resource.tar.gz#test_sql2yql.test_blocks-decimal_comparison_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_multiplicative_ops]": [
+ {
+ "checksum": "7b49c4eda3126bbe539b10c7e0fc33da",
+ "size": 5818,
+ "uri": "https://{canondata_backend}/1871102/1470a32d3748cb0cfff107460df835fb687c5954/resource.tar.gz#test_sql2yql.test_blocks-decimal_multiplicative_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_op_decimal]": [
+ {
+ "checksum": "7b42147f7c8462d1ffa32e88ba91d961",
+ "size": 1396,
+ "uri": "https://{canondata_backend}/1916746/24ebd7e8cc87e236525be92f05f3986e32fcda57/resource.tar.gz#test_sql2yql.test_blocks-decimal_op_decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_op_decimal_scalar]": [
+ {
+ "checksum": "44d45b10c811d450a26347ab391a5b27",
+ "size": 3688,
+ "uri": "https://{canondata_backend}/1916746/24ebd7e8cc87e236525be92f05f3986e32fcda57/resource.tar.gz#test_sql2yql.test_blocks-decimal_op_decimal_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-decimal_unary]": [
+ {
+ "checksum": "0b6acc0b2de96c09957216267b9b2c12",
+ "size": 1323,
+ "uri": "https://{canondata_backend}/1775319/787a3a5920e3b54b1be55e16dd1267b5dff04052/resource.tar.gz#test_sql2yql.test_blocks-decimal_unary_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_mixed_all]": [
+ {
+ "checksum": "079fb36cbdcf679cc0b27308369a2109",
+ "size": 2032,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_mixed_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_mixed_keys]": [
+ {
+ "checksum": "d203f66cb050d986d88add6dad18b2b8",
+ "size": 3264,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_mixed_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_opt_state_all]": [
+ {
+ "checksum": "ea2a144d10bb753edcb1ef4d9bf75933",
+ "size": 3257,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_opt_state_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_opt_state_keys]": [
+ {
+ "checksum": "68bc86dd3aeb85da875c2c5c0dca5d8c",
+ "size": 3466,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_opt_state_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_pure_all]": [
+ {
+ "checksum": "ca0bb167c04484614c5b91cdf367146c",
+ "size": 1766,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_pure_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-distinct_pure_keys]": [
+ {
+ "checksum": "17619b09afe1357884d1dba2a6ead95e",
+ "size": 2998,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-distinct_pure_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-div_uint64]": [
+ {
+ "checksum": "845059124116aa4a784c9b1ebce1a38c",
+ "size": 1546,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-div_uint64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-div_uint64_opt2]": [
+ {
+ "checksum": "845059124116aa4a784c9b1ebce1a38c",
+ "size": 1546,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-div_uint64_opt2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-exists]": [
+ {
+ "checksum": "e4e2e7676cc3cac9aabdde8e4016eaf9",
+ "size": 1731,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-exists_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-filter_by_column_with_drop]": [
+ {
+ "checksum": "c925aac442383de6fb1b31db7e862b88",
+ "size": 1259,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-filter_by_column_with_drop_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-filter_direct_col]": [
+ {
+ "checksum": "3b22f0e2cb165d4802fa72b830d3750d",
+ "size": 1275,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-filter_direct_col_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-filter_expr]": [
+ {
+ "checksum": "9b42dad2a90b8598920f5f40c65aaeeb",
+ "size": 1424,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-filter_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-filter_partial_expr]": [
+ {
+ "checksum": "1915820fb755d7ed3cf30b18fb74416b",
+ "size": 1493,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-filter_partial_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-finalize_hashed_keys]": [
+ {
+ "checksum": "238bc45157d89c6e7eeebfdadfc45c54",
+ "size": 2983,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-finalize_hashed_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-group_by_complex_key]": [
+ {
+ "checksum": "35fb24efba7e65a32245816dfc62a224",
+ "size": 2693,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-group_by_complex_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-if]": [
+ {
+ "checksum": "20339d987cf47d557222bba5f9b2aca8",
+ "size": 3428,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_add_date]": [
+ {
+ "checksum": "b8cba27e3c31c9cd56c5dd5de3b32e94",
+ "size": 6245,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql2yql.test_blocks-interval_add_date_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_add_date_scalar]": [
+ {
+ "checksum": "0b0a44e2fde11a4abf6eb1db46a61333",
+ "size": 11680,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql2yql.test_blocks-interval_add_date_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_add_interval]": [
+ {
+ "checksum": "7391534161b071eefe0342e5612becb9",
+ "size": 2053,
+ "uri": "https://{canondata_backend}/1599023/f54b29c5a8b4a7f18761235bdf0749f302b7270c/resource.tar.gz#test_sql2yql.test_blocks-interval_add_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_add_interval_scalar]": [
+ {
+ "checksum": "41987160a910055c5e23148d72bc5c30",
+ "size": 3302,
+ "uri": "https://{canondata_backend}/1599023/f54b29c5a8b4a7f18761235bdf0749f302b7270c/resource.tar.gz#test_sql2yql.test_blocks-interval_add_interval_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_div]": [
+ {
+ "checksum": "9cea54a2c3abda386d491ce6c59ffa1a",
+ "size": 4573,
+ "uri": "https://{canondata_backend}/1903885/2cd3d738babe2170bad9a741a60d5621859e66ca/resource.tar.gz#test_sql2yql.test_blocks-interval_div_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_div_scalar]": [
+ {
+ "checksum": "eb8675837df84a043597c4ebac6149b2",
+ "size": 7934,
+ "uri": "https://{canondata_backend}/1903885/2cd3d738babe2170bad9a741a60d5621859e66ca/resource.tar.gz#test_sql2yql.test_blocks-interval_div_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_mul]": [
+ {
+ "checksum": "6e85f08550fb85122aeb8c9066ba7bd3",
+ "size": 8912,
+ "uri": "https://{canondata_backend}/1925821/70f265137d33c6e478e9e61e055b469332dd9b70/resource.tar.gz#test_sql2yql.test_blocks-interval_mul_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_mul_scalar]": [
+ {
+ "checksum": "a141415f9a6d440d533c4e3e00958b8f",
+ "size": 15634,
+ "uri": "https://{canondata_backend}/1925821/70f265137d33c6e478e9e61e055b469332dd9b70/resource.tar.gz#test_sql2yql.test_blocks-interval_mul_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_sub_interval]": [
+ {
+ "checksum": "185f01cbd91044b77e37561933d61112",
+ "size": 2053,
+ "uri": "https://{canondata_backend}/1775319/aad0c11816cec8971c5571f0c536af10c4645fe1/resource.tar.gz#test_sql2yql.test_blocks-interval_sub_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-interval_sub_interval_scalar]": [
+ {
+ "checksum": "5eca4701c548bbcb699ea3df6ba8fbe3",
+ "size": 3302,
+ "uri": "https://{canondata_backend}/1775319/aad0c11816cec8971c5571f0c536af10c4645fe1/resource.tar.gz#test_sql2yql.test_blocks-interval_sub_interval_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-json_document_type]": [
+ {
+ "checksum": "2779f5c0f9b7f6b33443de995a099073",
+ "size": 1507,
+ "uri": "https://{canondata_backend}/1937492/94e2daa8efa14ce33e27554fc2ddf0ebb7981acd/resource.tar.gz#test_sql2yql.test_blocks-json_document_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-lazy_nonstrict_basic]": [
+ {
+ "checksum": "5caa66e617dc7319578383a1c5c2bbd8",
+ "size": 4167,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-lazy_nonstrict_basic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-lazy_nonstrict_nested]": [
+ {
+ "checksum": "4eacbc51aa06ed044465f91b667377f9",
+ "size": 1641,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-lazy_nonstrict_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-lazy_nonstrict_with_scalar_ctx]": [
+ {
+ "checksum": "8f1282fb57e0b386c508755e21b4743a",
+ "size": 4266,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-lazy_nonstrict_with_scalar_ctx_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-member]": [
+ {
+ "checksum": "30c4dbf8707e413ac3b5a856842256b6",
+ "size": 1714,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-minmax_strings]": [
+ {
+ "checksum": "a8488b28daf1b559ca89c9b34aea64c0",
+ "size": 3619,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-minmax_strings_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-minmax_strings_filter]": [
+ {
+ "checksum": "00680cfa2c5f20c130ec11e6d2a950cc",
+ "size": 2598,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-minmax_strings_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-minmax_tuple]": [
+ {
+ "checksum": "d1d2d37a4b8fcb76017dc7de44f0ea47",
+ "size": 3278,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-minmax_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-mod_uint64]": [
+ {
+ "checksum": "8ac0a1372d5d3affbd55058c8ac0d5bc",
+ "size": 1545,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-mod_uint64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-mod_uint64_opt2]": [
+ {
+ "checksum": "8ac0a1372d5d3affbd55058c8ac0d5bc",
+ "size": 1545,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-mod_uint64_opt2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-mul_uint64_opt2]": [
+ {
+ "checksum": "27609bce6f31a2000060f63482dde9e6",
+ "size": 1546,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-mul_uint64_opt2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-nested_optionals]": [
+ {
+ "checksum": "f7f509e8310d46f8e03cb8646239bcb6",
+ "size": 1309,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-nested_optionals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-not]": [
+ {
+ "checksum": "2a980764e32e5f1ac8b7c2de4bec1554",
+ "size": 1435,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-not_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-not_opt]": [
+ {
+ "checksum": "2a980764e32e5f1ac8b7c2de4bec1554",
+ "size": 1435,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-not_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-partial_blocks1]": [
+ {
+ "checksum": "291cca7dcaf107dd1832b761ac991b31",
+ "size": 1782,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-partial_blocks1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg]": [
+ {
+ "checksum": "2e462b1b60c37eca2d12c146d86cdc1b",
+ "size": 1695,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_call]": [
+ {
+ "checksum": "89a71964f308ca664d8737248b059b13",
+ "size": 2124,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_call_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_from_dates]": [
+ {
+ "checksum": "412d638df5206da435561389e001c7e6",
+ "size": 1302,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_from_dates_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_sort]": [
+ {
+ "checksum": "0a312c05be5c91545de12d451a697d00",
+ "size": 1278,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_to_dates]": [
+ {
+ "checksum": "ed2725dd82efb526614a00b7b593b31a",
+ "size": 1966,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_to_dates_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_to_interval]": [
+ {
+ "checksum": "7cd68fd41b7bd3af24d0cdde374c387a",
+ "size": 1298,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_to_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_to_numbers]": [
+ {
+ "checksum": "1db2c1cc28dd71a949a607483a0564a9",
+ "size": 2654,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_to_numbers_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_to_strings]": [
+ {
+ "checksum": "9bdd078307a8343e31b6c6cfb6c176c9",
+ "size": 3350,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_to_strings_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_tofrom]": [
+ {
+ "checksum": "5952e8a8696cd6cdb835004ab100670f",
+ "size": 2139,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_tofrom_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-pg_top_sort]": [
+ {
+ "checksum": "26fb463b1e52d0320ec89e2add000b3f",
+ "size": 1364,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-pg_top_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sort_one_asc]": [
+ {
+ "checksum": "88376dd9284456d255769876ed964ba6",
+ "size": 1505,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sort_one_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sort_one_desc]": [
+ {
+ "checksum": "7cbb9c06e5605fb259c256185364b355",
+ "size": 1506,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sort_one_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sort_two_asc]": [
+ {
+ "checksum": "134bd4e5c125e09fcf671a22e201eb60",
+ "size": 1703,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sort_two_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sort_two_desc]": [
+ {
+ "checksum": "9905fe4b4c8416b06f82f6c27b494e0a",
+ "size": 1705,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sort_two_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sort_two_mix]": [
+ {
+ "checksum": "49744a04318f42927455423bdea4f23d",
+ "size": 1704,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sort_two_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-string_as_agg_key]": [
+ {
+ "checksum": "c0f4a622df49012cf4edd126bdab6889",
+ "size": 2429,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-string_as_agg_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-string_filter]": [
+ {
+ "checksum": "174e34201015a17fe5fcfe5e149775bd",
+ "size": 1799,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-string_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-string_len_and_cmp]": [
+ {
+ "checksum": "c6df631111037c4f6566865904a135a8",
+ "size": 6827,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-string_len_and_cmp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-string_pass]": [
+ {
+ "checksum": "6eaa73bceb9f8c93ae03b442cc8d07d3",
+ "size": 1677,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-string_pass_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-string_with]": [
+ {
+ "checksum": "e2a3d435159fa3d9e2ffd0b73a3f43f6",
+ "size": 3662,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-string_with_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-struct_type]": [
+ {
+ "checksum": "2779f5c0f9b7f6b33443de995a099073",
+ "size": 1507,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-struct_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-sub_uint64_opt2]": [
+ {
+ "checksum": "d9731854d47969dfd5893912e99fdfce",
+ "size": 1546,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-sub_uint64_opt2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-top_sort_one_asc]": [
+ {
+ "checksum": "e88478bfa1e925deb76f53032d5f806c",
+ "size": 1591,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-top_sort_one_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-top_sort_one_desc]": [
+ {
+ "checksum": "e3cf73cc1b6c7cd9f3ec631d11556b01",
+ "size": 1592,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-top_sort_one_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-top_sort_two_asc]": [
+ {
+ "checksum": "95368239911365ee32efeb4554d9eb14",
+ "size": 1789,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-top_sort_two_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-top_sort_two_desc]": [
+ {
+ "checksum": "53097ea0f0a02c50c885ebbc2cba66ee",
+ "size": 1791,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-top_sort_two_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-top_sort_two_mix]": [
+ {
+ "checksum": "ae8dfb685c42167bdd1562369e8b3419",
+ "size": 1790,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-top_sort_two_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-tuple_nth]": [
+ {
+ "checksum": "7c238f50905e6d9f680739f1b469a447",
+ "size": 5485,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-tuple_nth_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-tuple_type]": [
+ {
+ "checksum": "e8d09ab0dd7319d8d4fb166502cfdd41",
+ "size": 1480,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql2yql.test_blocks-tuple_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[blocks-type_and_callable_stats]": [
+ {
+ "checksum": "9efa02df55deb6b8dbdca1b440e96fc1",
+ "size": 2601,
+ "uri": "https://{canondata_backend}/1937424/7dd37eb1e9f9f10e476a8c866a4f6d9d8a2ae8d2/resource.tar.gz#test_sql2yql.test_blocks-type_and_callable_stats_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_many_val]": [
+ {
+ "checksum": "bda507979f30604c929d345df0b011e0",
+ "size": 16340,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_many_val_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_multi_val]": [
+ {
+ "checksum": "4241cf30e05516ec6078c39ab6d08400",
+ "size": 1652,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_multi_val_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_opt_cond]": [
+ {
+ "checksum": "e7f9a12d3619f0373726e0e7bc0efdec",
+ "size": 2133,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_opt_cond_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_opt_then]": [
+ {
+ "checksum": "5b7dda4d6b2311c98ceb54de565f29bc",
+ "size": 2092,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_opt_then_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_size_eq_cast]": [
+ {
+ "checksum": "8c5c1764125f8a66076043f647e7f53d",
+ "size": 1544,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_size_eq_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_then_else]": [
+ {
+ "checksum": "0605e4a7fe5c808f4a2168254fa22e0f",
+ "size": 1231,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_then_else_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_val_then_else]": [
+ {
+ "checksum": "bf216fbb2a066b5bb6a19263d6b5fc05",
+ "size": 1230,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_val_then_else_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_val_when_then]": [
+ {
+ "checksum": "d5f40323f5a4561b38226777a46f5f79",
+ "size": 1518,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_val_when_then_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[case-case_when_then]": [
+ {
+ "checksum": "9b2e5e456a53dcb2fc979dc89ac91f84",
+ "size": 1518,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_case-case_when_then_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[coalesce-coalesce]": [
+ {
+ "checksum": "492c281461c6563b422a45086a98edf2",
+ "size": 1183,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_coalesce-coalesce_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[coalesce-coalesce_few_opt]": [
+ {
+ "checksum": "773a5a9e1e8c13900600ae2831572202",
+ "size": 5584,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_coalesce-coalesce_few_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[coalesce-coalesce_few_real]": [
+ {
+ "checksum": "144c79f1c0abab4fea6a442318034a06",
+ "size": 3258,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_coalesce-coalesce_few_real_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[coalesce-coalesce_sugar]": [
+ {
+ "checksum": "e88b7f33df60524bb0620d2ba1d7b502",
+ "size": 2153,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_coalesce-coalesce_sugar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[coalesce-coalesce_symmetry]": [
+ {
+ "checksum": "65e6e43c25df70d11bcabfeed142e2b3",
+ "size": 6986,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_coalesce-coalesce_symmetry_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-groups]": [
+ {
+ "checksum": "051e09cbcea08e734ae5e6968ad1e1ee",
+ "size": 3388,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql2yql.test_column_group-groups_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint]": [
+ {
+ "checksum": "068191cd9e65ca3493e4b20d1e1b257a",
+ "size": 10131,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_anon]": [
+ {
+ "checksum": "dbb0cca1127bb0c111eaf0a628b2b9a1",
+ "size": 4108,
+ "uri": "https://{canondata_backend}/1942525/2065de9dd4b18a7276f6c5d85e09a5754c9a2fd8/resource.tar.gz#test_sql2yql.test_column_group-hint_anon_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_anon_groups]": [
+ {
+ "checksum": "1f44e91a47e42b8d5876da52098a98ce",
+ "size": 4144,
+ "uri": "https://{canondata_backend}/1942525/2065de9dd4b18a7276f6c5d85e09a5754c9a2fd8/resource.tar.gz#test_sql2yql.test_column_group-hint_anon_groups_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_append_fail]": [
+ {
+ "checksum": "18aacc13c7921e65e61411ea0a31136e",
+ "size": 1145,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_append_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_diff_grp_fail]": [
+ {
+ "checksum": "d30f33b8207c393bd5f8d84ad0420a73",
+ "size": 2056,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_diff_grp_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_dup_col_fail]": [
+ {
+ "checksum": "c3629eea0c6a839c4661bf20373c8af5",
+ "size": 1147,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_dup_col_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_dup_def_fail]": [
+ {
+ "checksum": "a5275d4bf41fcc376b8a4de0e27c2fc5",
+ "size": 1144,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_dup_def_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_empty_grp_fail]": [
+ {
+ "checksum": "92a75ba74a2538b97f3273e6cbe889d3",
+ "size": 1142,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_empty_grp_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_non_lst_yson_fail]": [
+ {
+ "checksum": "d6e6d7804e4fd35fa38579cd4c699696",
+ "size": 1139,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_non_lst_yson_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_non_map_yson_fail]": [
+ {
+ "checksum": "45a609e51d7e443650b9f7b6329b954e",
+ "size": 1134,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_non_map_yson_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_non_str_yson_fail]": [
+ {
+ "checksum": "34d00ad4412401697c98419094ca32c8",
+ "size": 1139,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_non_str_yson_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_non_yson_fail]": [
+ {
+ "checksum": "de172a3447674ab0c46dbdd0156c6dbf",
+ "size": 1130,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_non_yson_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_short_grp_fail]": [
+ {
+ "checksum": "58d1796f5ed9a097433700ae2f3df67b",
+ "size": 1143,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_short_grp_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-hint_unk_col_fail]": [
+ {
+ "checksum": "c8c81517c3416dc933f2bee578e3b0b9",
+ "size": 1147,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql2yql.test_column_group-hint_unk_col_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-insert_diff_groups1_fail]": [
+ {
+ "checksum": "e459868feddecebca5c257aa53366627",
+ "size": 3547,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql2yql.test_column_group-insert_diff_groups1_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-insert_diff_groups2_fail]": [
+ {
+ "checksum": "4e2ed6f8374058c2c6c2734314af8f35",
+ "size": 3583,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql2yql.test_column_group-insert_diff_groups2_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-insert_diff_groups3_fail]": [
+ {
+ "checksum": "9cd09aa57b21917301b4baaccd07518e",
+ "size": 1348,
+ "uri": "https://{canondata_backend}/1942415/9610360ced2221ce66696bd9f6afd9579e452c44/resource.tar.gz#test_sql2yql.test_column_group-insert_diff_groups3_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-length]": [
+ {
+ "checksum": "3bca7ac5997a4e00558b1bda7abf5e06",
+ "size": 4317,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql2yql.test_column_group-length_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-many_inserts]": [
+ {
+ "checksum": "c135d985e67cd616c6dfdcbc8046732a",
+ "size": 8009,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql2yql.test_column_group-many_inserts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-min_group]": [
+ {
+ "checksum": "f6bba7f288bad8466acf4544f48e1cbc",
+ "size": 3296,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql2yql.test_column_group-min_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_group-publish]": [
+ {
+ "checksum": "b39ef3be50556501e9f7b5860ab0e11f",
+ "size": 4124,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql2yql.test_column_group-publish_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-align_publish]": [
+ {
+ "checksum": "c630ed47be47cc9f311aa04d21f62408",
+ "size": 1876,
+ "uri": "https://{canondata_backend}/1817427/102b01ee5763a4422c020eba0b2b5127fdad2dfe/resource.tar.gz#test_sql2yql.test_column_order-align_publish_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-align_publish_native]": [
+ {
+ "checksum": "8ac18275c0c1f629b9e953507d80ae4f",
+ "size": 1966,
+ "uri": "https://{canondata_backend}/1809005/447ecb6230f1c442efac26237e68bced03fee361/resource.tar.gz#test_sql2yql.test_column_order-align_publish_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert]": [
+ {
+ "checksum": "77c929e72b17d07ae9d0c0509bceb605",
+ "size": 7906,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_column_order-insert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert_reorder_without_columnorder]": [
+ {
+ "checksum": "d3105827a0ca8e095bcecc797540f34e",
+ "size": 1553,
+ "uri": "https://{canondata_backend}/1923547/0aba22156762a55d9c7578c76fffd5395d319f8b/resource.tar.gz#test_sql2yql.test_column_order-insert_reorder_without_columnorder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert_tmp]": [
+ {
+ "checksum": "f7020067b63cf9ba560ad9e409933221",
+ "size": 5577,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_column_order-insert_tmp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert_with_desc_sort_and_native_types]": [
+ {
+ "checksum": "38527249c2ae394d09239bbadcc5e4c2",
+ "size": 1721,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_column_order-insert_with_desc_sort_and_native_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert_with_new_cols]": [
+ {
+ "checksum": "83c9eeb356ae4356d1c5e1b110f1413c",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1130705/e504e89858ad657690fd0ce8630e1cb7e389fafd/resource.tar.gz#test_sql2yql.test_column_order-insert_with_new_cols_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-insert_with_reorder_cols]": [
+ {
+ "checksum": "cc9e5e25567f7893aea16fcfb872da26",
+ "size": 2454,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_column_order-insert_with_reorder_cols_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-join]": [
+ {
+ "checksum": "bc062e01bcc462fd14c4432338a4b808",
+ "size": 5937,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-join_nosimple]": [
+ {
+ "checksum": "8e1abbc42f17bbb92306728e3b98e282",
+ "size": 5449,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-join_nosimple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-ordered_plus_native]": [
+ {
+ "checksum": "82d191ffee3bade6df0bc68de3513413",
+ "size": 1728,
+ "uri": "https://{canondata_backend}/1130705/e504e89858ad657690fd0ce8630e1cb7e389fafd/resource.tar.gz#test_sql2yql.test_column_order-ordered_plus_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_action]": [
+ {
+ "checksum": "cff3e92ded01e8a03009d91b105ed135",
+ "size": 1525,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_action_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_distinct_star]": [
+ {
+ "checksum": "cc053e5229d822d14a303bea2051bf1f",
+ "size": 1386,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_column_order-select_distinct_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_groupby_with_star]": [
+ {
+ "checksum": "be4d09622f569589d604743922c445ab",
+ "size": 3736,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_groupby_with_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_limit_offset]": [
+ {
+ "checksum": "87bea01ed18bb4373ce52ddaa1c14894",
+ "size": 3422,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_limit_offset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_limit_offset_reorder]": [
+ {
+ "checksum": "102c616dc1e1d219d578af013ab50c66",
+ "size": 2239,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_column_order-select_limit_offset_reorder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_orderby]": [
+ {
+ "checksum": "f400931ee8b2d40c371c3b774a44d54c",
+ "size": 1246,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_column_order-select_orderby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_plain]": [
+ {
+ "checksum": "cdaf6d7e6cbf16d5c66898ee765f43a8",
+ "size": 7636,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_plain_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_plain_nosimple]": [
+ {
+ "checksum": "125614341cebd87f1d11b5f6a6506f22",
+ "size": 7694,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_plain_nosimple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_sample]": [
+ {
+ "checksum": "71bc7aedcb147685fcdcc3822de5305a",
+ "size": 1609,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_subquery]": [
+ {
+ "checksum": "85afc1b9edbd369e5f31526fa36e4a10",
+ "size": 2061,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_where]": [
+ {
+ "checksum": "1e57e18db161d45721290149065f2b1c",
+ "size": 1318,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-select_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-select_win_func]": [
+ {
+ "checksum": "429a7ce1044d8580ba0000cbbe0b6401",
+ "size": 2386,
+ "uri": "https://{canondata_backend}/1871182/d68d7c1dfb9b3896ed786f594388e0e6074cf0d9/resource.tar.gz#test_sql2yql.test_column_order-select_win_func_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-union_all]": [
+ {
+ "checksum": "9165b3372e36068138bc0624fddffbc1",
+ "size": 4315,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-union_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-union_all_positional]": [
+ {
+ "checksum": "24d1db6597324472c7982f2a926798c8",
+ "size": 2211,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-union_all_positional_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-union_all_positional_columns_count_fail]": [
+ {
+ "checksum": "e2645dccb47e9356ff46b511b2b66b8e",
+ "size": 1894,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-union_all_positional_columns_count_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-union_all_positional_unordered_fail]": [
+ {
+ "checksum": "5f21c0b81dbd1c64b8d3893fca9775ac",
+ "size": 1895,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-union_all_positional_unordered_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-values]": [
+ {
+ "checksum": "c133f15b9758e67aa49709570fcc36e4",
+ "size": 3710,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_column_order-values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[column_order-winfunc]": [
+ {
+ "checksum": "703736edd3ab3582b2d9cd6f87a3198e",
+ "size": 2385,
+ "uri": "https://{canondata_backend}/1925821/888384beeeadd4367aa76fe2fb0b442421c4b701/resource.tar.gz#test_sql2yql.test_column_order-winfunc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-adjacent_to_point]": [
+ {
+ "checksum": "27de11b6546b3f850ac0b38ca9158f8e",
+ "size": 10486,
+ "uri": "https://{canondata_backend}/1937424/acb7e929f70bc9e87429d28549525849d1aa6255/resource.tar.gz#test_sql2yql.test_compute_range-adjacent_to_point_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-decimal]": [
+ {
+ "checksum": "7b38fdbd8556b4d1f136cc4fb8b3c17f",
+ "size": 1347,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-huge_in]": [
+ {
+ "checksum": "83704cc6dfaa75696b2bb0d23acf41f4",
+ "size": 1429,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-huge_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-in2]": [
+ {
+ "checksum": "ccee8c0b359cd0d9b2f0beaeef321b95",
+ "size": 3811,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-in2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-in3]": [
+ {
+ "checksum": "b8aec5c840ce0795c726d808480bc21e",
+ "size": 4939,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-in3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-in]": [
+ {
+ "checksum": "d81c144733498c0eada5a17b1d20a24d",
+ "size": 8269,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-in_literal_nulls]": [
+ {
+ "checksum": "d6fd595dce50e5ba648ecef86c0ae5a3",
+ "size": 1456,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-in_literal_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-merge_adjacent]": [
+ {
+ "checksum": "443cde48b9db526e2dfbaed5c781cc38",
+ "size": 5740,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-merge_adjacent_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-multiply_limit]": [
+ {
+ "checksum": "dd185a4c2df6644a53a1a86d6def655e",
+ "size": 3755,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-multiply_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-multiply_limit_for_single_key]": [
+ {
+ "checksum": "88e2ac64831ef579b2d78ac712f3c866",
+ "size": 1480,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-multiply_limit_for_single_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-multiply_limit_with_dups]": [
+ {
+ "checksum": "67cde096290f154b719746730b5d80d0",
+ "size": 1775,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-multiply_limit_with_dups_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-multiply_limit_with_nulls]": [
+ {
+ "checksum": "9cf6d41923526dbc68545ad607461887",
+ "size": 1413,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-multiply_limit_with_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-norange]": [
+ {
+ "checksum": "71b43dd28b7bb836b2e592479eb10bbe",
+ "size": 3034,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-norange_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-pg_compare]": [
+ {
+ "checksum": "95c5bc6e7064c045fb7f7b36d4ee607b",
+ "size": 4514,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-pg_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-pg_equal]": [
+ {
+ "checksum": "23249ba6ad513ff4ee250c0260e87bff",
+ "size": 2467,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-pg_equal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-pg_exists]": [
+ {
+ "checksum": "aa96fbd9c3ccfb2406c7bb66f35dda32",
+ "size": 2354,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-pg_exists_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-pg_sqlin]": [
+ {
+ "checksum": "468708fc552f74dacb5d788778d07c45",
+ "size": 2602,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-pg_sqlin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-pg_startswith]": [
+ {
+ "checksum": "4bf2c3e4f782d7958950aecbd8ad7b86",
+ "size": 4506,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-pg_startswith_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-preserve_rest_predicates_order]": [
+ {
+ "checksum": "f1ce2c4a234cadfca3cd0d757a692c05",
+ "size": 2353,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-preserve_rest_predicates_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-repeated_keyranges_in_and]": [
+ {
+ "checksum": "e5e7caa7ff4d942f11b34d54d762bfb0",
+ "size": 1954,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-repeated_keyranges_in_and_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-startswith]": [
+ {
+ "checksum": "0ee59663e644351637444bda247de9e2",
+ "size": 11360,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-startswith_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-tuples_compare]": [
+ {
+ "checksum": "239eb01d4ee3ec52a09fab13fa47fa56",
+ "size": 9794,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-tuples_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-tztypes]": [
+ {
+ "checksum": "9be58ec421be69e4dbc29b6f93a89b68",
+ "size": 6242,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-tztypes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-yql-12941]": [
+ {
+ "checksum": "71434e1fd933100873eb8b2292393b88",
+ "size": 2418,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-yql-12941_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[compute_range-yql-13489]": [
+ {
+ "checksum": "169ed63774ce4502509f5ab1e238e826",
+ "size": 2818,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_compute_range-yql-13489_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-boolean_count]": [
+ {
+ "checksum": "bbfad3d526fe8d49fd33ea27dfcb0976",
+ "size": 3484,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-boolean_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count]": [
+ {
+ "checksum": "36c29e25537fc946f71b2e93aa411467",
+ "size": 8074,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_count-count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_all]": [
+ {
+ "checksum": "91a52fa4b51dd03562af7a64d2f5dbb2",
+ "size": 1299,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_all_grouped]": [
+ {
+ "checksum": "8f32d4abf2b3b82a8e9a48cf1e830ed6",
+ "size": 1508,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_count-count_all_grouped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_all_view_concat]": [
+ {
+ "checksum": "841e87be7168577eb3e94c7118250981",
+ "size": 1372,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_all_view_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_by_nulls]": [
+ {
+ "checksum": "d0275725678e33d93986e70e2f3dc318",
+ "size": 1351,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_by_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_const_no_grouping]": [
+ {
+ "checksum": "40f2410c38f93da196e0fe25b7a7dc7e",
+ "size": 1301,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_const_no_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_distinct_from_view_concat]": [
+ {
+ "checksum": "064958c932eff1a77375530c0c4e4ace",
+ "size": 1420,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_distinct_from_view_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_no_grouping]": [
+ {
+ "checksum": "ea65895de4966882cc50ef5715715d2f",
+ "size": 1310,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_count-count_no_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_nullable]": [
+ {
+ "checksum": "4dd7a0e3db108b8c31a5ab730ad9d9f4",
+ "size": 1558,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_count-count_nullable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[count-count_nullable_sub]": [
+ {
+ "checksum": "85a625aa70187f44c86d99479d04d982",
+ "size": 2601,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_count-count_nullable_sub_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-closure_in_l1_and_l2]": [
+ {
+ "checksum": "129568a9d8de79a96078dd5a8a795ade",
+ "size": 1823,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-closure_in_l1_and_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-closure_in_l2_and_l1]": [
+ {
+ "checksum": "2451bf6941c3ac6def06f509cc4dd488",
+ "size": 1823,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-closure_in_l2_and_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-closure_l2]": [
+ {
+ "checksum": "75134aec8cd2cb1a64af74617c9284dd",
+ "size": 1237,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-closure_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-complete_l2]": [
+ {
+ "checksum": "94f0e9f768bd8d98b1c7d7d33182bb48",
+ "size": 1269,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-complete_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-const_body_diff_lambda]": [
+ {
+ "checksum": "6d39192ad42a905e31a67f0dc69afe7a",
+ "size": 1295,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-const_body_diff_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-const_body_same_lambda]": [
+ {
+ "checksum": "e55a01a626470872d41fc568ab875d01",
+ "size": 1289,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-const_body_same_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-expr]": [
+ {
+ "checksum": "b235ad9b63f8e29398be5ae5395fc41d",
+ "size": 1071,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-expr_in_l0_and_l1]": [
+ {
+ "checksum": "a72a09cf16048e79b93109acc1d87b68",
+ "size": 1221,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-expr_in_l0_and_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-expr_in_l1]": [
+ {
+ "checksum": "75b77bafc25a0b3ff5c39fac054a889e",
+ "size": 1184,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-expr_in_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-expr_in_l1_and_l0]": [
+ {
+ "checksum": "15f3a3e367e2c7e0e1742df4973f63f2",
+ "size": 1221,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-expr_in_l1_and_l0_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-l2_dup_l1]": [
+ {
+ "checksum": "93973958dcb6e9ab51476919e0bda87f",
+ "size": 1684,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-l2_dup_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-l2_dup_l1_many]": [
+ {
+ "checksum": "a6d3795effa641e1642e9c4ba5a1bc4e",
+ "size": 1820,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-l2_dup_l1_many_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-lambda_in_l0_and_l1]": [
+ {
+ "checksum": "41141dc050bc8a41c861b769bb1e182e",
+ "size": 1532,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-lambda_in_l0_and_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-lambda_in_l1_and_l0]": [
+ {
+ "checksum": "9c1245912e8cf40b0095c324299de658",
+ "size": 1532,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-lambda_in_l1_and_l0_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-nested_closure_in_l1_and_l2]": [
+ {
+ "checksum": "c37c5dbdff8ae76ab35bb12600de8ded",
+ "size": 2563,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-nested_closure_in_l1_and_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-nested_closure_in_l1_and_l2_unordered]": [
+ {
+ "checksum": "69ba0d565b2c7138de504d657e0af9cc",
+ "size": 2401,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-nested_closure_in_l1_and_l2_unordered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-nested_closure_in_l2_and_l1]": [
+ {
+ "checksum": "828a1ee15b260064748a26c1953af879",
+ "size": 2563,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-nested_closure_in_l2_and_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-nested_closure_in_l2_and_l1_unordered]": [
+ {
+ "checksum": "4cbe56c7b4da3aa787c0d8d774bc7fc1",
+ "size": 2391,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-nested_closure_in_l2_and_l1_unordered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_closure_l2]": [
+ {
+ "checksum": "3f0e7aa968c981f235f2ff6b92a10d04",
+ "size": 1394,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_closure_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_complete_l2]": [
+ {
+ "checksum": "e032f932ebdcaab79dd4ecec8e4904fc",
+ "size": 1544,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_complete_l2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_complete_l2_expr]": [
+ {
+ "checksum": "ec18c6a74dc0e813ac03633bda74722a",
+ "size": 1542,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_complete_l2_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_free_closure_size2]": [
+ {
+ "checksum": "043595edfb0807a1677bc9ed67088775",
+ "size": 1491,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_free_closure_size2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_free_closure_size2_arg_both_level]": [
+ {
+ "checksum": "769357f182021bbfbbfecc6fae08ff34",
+ "size": 1527,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_free_closure_size2_arg_both_level_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_free_closure_size2_arg_both_level_expr]": [
+ {
+ "checksum": "007eeef81d2eaf6086f7dc235ed69366",
+ "size": 1527,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_free_closure_size2_arg_both_level_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_free_closure_size2_expr]": [
+ {
+ "checksum": "e53b1e29d8c88c155b4179af16cb748c",
+ "size": 1491,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_free_closure_size2_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_l1]": [
+ {
+ "checksum": "2357cb3e037c8433c315fb58c6637665",
+ "size": 1286,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_l1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-same_l1_expr]": [
+ {
+ "checksum": "72cba1d5f852697e1fa8641af3d3f21b",
+ "size": 1284,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-same_l1_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[csee-yql-7237]": [
+ {
+ "checksum": "c424229c8c737dedeb9ffc1ceba3a473",
+ "size": 7220,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_csee-yql-7237_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-all_timezones]": [
+ {
+ "checksum": "aa9b33e10ef430c1b1528c31a1156b8f",
+ "size": 1332,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-all_timezones_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-current_date]": [
+ {
+ "checksum": "2600bff57af21e5c1f7548ea11dcb42a",
+ "size": 1393,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-current_date_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_arithmetic]": [
+ {
+ "checksum": "4561ee148a72d7211dcc0492eccf8437",
+ "size": 15199,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_arithmetic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_bitcast]": [
+ {
+ "checksum": "f6292cd406a4e251eed4401fe6fc0d16",
+ "size": 25498,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_cast]": [
+ {
+ "checksum": "202c948e36e4c7190c274f0537043b11",
+ "size": 66991,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_convert]": [
+ {
+ "checksum": "932aefbf365538532bee35e7e334c669",
+ "size": 15847,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_convert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_diff_compare]": [
+ {
+ "checksum": "745cd474ac9c28afadb483cc7af0ef31",
+ "size": 14634,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_diff_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_diff_sub]": [
+ {
+ "checksum": "d87af56a91023c9cfef25bf78562ad1f",
+ "size": 5072,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_diff_sub_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_in]": [
+ {
+ "checksum": "2da67515f993307145059a621f5c3184",
+ "size": 29098,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_out]": [
+ {
+ "checksum": "379f93a18e0656afcffb89c9e45537a9",
+ "size": 11067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_scale]": [
+ {
+ "checksum": "eb5931bf57d82553c5e9662b0f2dbd58",
+ "size": 5194,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_scale_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_types]": [
+ {
+ "checksum": "fa08b17059f9728e63030fda8e3ea3d8",
+ "size": 2826,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_addremove]": [
+ {
+ "checksum": "0dc07d1a23992683bbb80c29f20d575d",
+ "size": 1746,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_addremove_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_arithmetic]": [
+ {
+ "checksum": "d36c7062f9751beff41cc2d6c294b75f",
+ "size": 15660,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_arithmetic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_bitcast]": [
+ {
+ "checksum": "b9ff18b3bf40bb8f15dc434fb8594f84",
+ "size": 19320,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_bitcast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_bounds]": [
+ {
+ "checksum": "4b6957a729c8b962e821ad8b2fb3184d",
+ "size": 3006,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_bounds_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_bounds_scale]": [
+ {
+ "checksum": "02b2b5206444f7630ddced214e8a68ff",
+ "size": 6022,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_bounds_scale_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_bytes]": [
+ {
+ "checksum": "a806cc36e562982c42e99f0f69d37dd0",
+ "size": 5284,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_bytes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_cast]": [
+ {
+ "checksum": "5aa92b6a624cb7991699b841f6be2b89",
+ "size": 32995,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_compare_diff_zones]": [
+ {
+ "checksum": "3c0c9da5cc5050989d4e2c7b5779ea5f",
+ "size": 15095,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_compare_diff_zones_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_compare_gmt]": [
+ {
+ "checksum": "c31d131853ee71c7da94aa338c77ed31",
+ "size": 32058,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_compare_gmt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_compare_same_zones]": [
+ {
+ "checksum": "55921f0fd7da8b8f8e3cdc3169314953",
+ "size": 30887,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_compare_same_zones_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_expand_gmt]": [
+ {
+ "checksum": "fe5c2d6fd0094523b1cf082977931d14",
+ "size": 1434,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_expand_gmt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_impossible_cast]": [
+ {
+ "checksum": "8be51dc09328cb08cfdd7a4c57bbc38a",
+ "size": 1112,
+ "uri": "https://{canondata_backend}/1130705/d31a79698ba36e25d38301feb8a2518de6ef9df2/resource.tar.gz#test_sql2yql.test_datetime-date_tz_impossible_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_io]": [
+ {
+ "checksum": "966687eb81749dbdb3849943e6aa5ec9",
+ "size": 1572,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_io_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_scale]": [
+ {
+ "checksum": "5a700ec9a54a90654c2f59567971240b",
+ "size": 10094,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_scale_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_table_sort_asc]": [
+ {
+ "checksum": "b59cbe8eaecf0d5773352e892a84194d",
+ "size": 2132,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_table_sort_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[datetime-date_tz_table_sort_desc]": [
+ {
+ "checksum": "00dc754b5284e042086ea3b3ba55df20",
+ "size": 2133,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_datetime-date_tz_table_sort_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_and_join]": [
+ {
+ "checksum": "e2ed44b03bd3571ab4006888ba304788",
+ "size": 2011,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_and_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_by_tuple]": [
+ {
+ "checksum": "07888869573986c21276ecd028f258c4",
+ "size": 2061,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_distinct-distinct_by_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_columns]": [
+ {
+ "checksum": "ed24dec444f818716df3a3f1f83c74cb",
+ "size": 1611,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_columns_after_group]": [
+ {
+ "checksum": "c773ca077ccf3deccaeffee50b08dea5",
+ "size": 2443,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_distinct-distinct_columns_after_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_count_and_avg]": [
+ {
+ "checksum": "086b02484054f2fbb5e2865117636388",
+ "size": 2475,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_distinct-distinct_count_and_avg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_count_and_full_count]": [
+ {
+ "checksum": "c20cea9316d34fe2af86424045a238e1",
+ "size": 1822,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_distinct-distinct_count_and_full_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_count_no_gouping]": [
+ {
+ "checksum": "b8f3c46c3d813285c214e6f503fc0545",
+ "size": 1601,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_distinct-distinct_count_no_gouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_count_only]": [
+ {
+ "checksum": "a293ab8cec73c5f63e3c54b117fd0bc6",
+ "size": 1352,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_distinct-distinct_count_only_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_groupby]": [
+ {
+ "checksum": "669488c154c5114518599c7ed564763b",
+ "size": 1749,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_groupby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_having_no_agg]": [
+ {
+ "checksum": "8063a0d8edbc44a4490871194b462035",
+ "size": 1382,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_distinct-distinct_having_no_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_join]": [
+ {
+ "checksum": "35f8794126296dd25f11855a30b2c495",
+ "size": 2899,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_distinct-distinct_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_list_after_group]": [
+ {
+ "checksum": "fd496c693350795a44a03ec5dce52c19",
+ "size": 1686,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_list_after_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_one_count]": [
+ {
+ "checksum": "f427bd7bd57618dbfda7cf6dcddfd8b1",
+ "size": 1562,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_distinct-distinct_one_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_star1]": [
+ {
+ "checksum": "f7883e6d44d7d934d7d7f6fe24a00140",
+ "size": 1314,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_star1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_star]": [
+ {
+ "checksum": "be3b83984747d6e5644e95e18b4ea3f5",
+ "size": 3735,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_star_inmem]": [
+ {
+ "checksum": "99d6024ee91e8a8ba6ae679439d80159",
+ "size": 2668,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_distinct-distinct_star_inmem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_union_all]": [
+ {
+ "checksum": "e79a981e596be8d380c090813e88eccc",
+ "size": 2726,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_union_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[distinct-distinct_window]": [
+ {
+ "checksum": "a0a13285b158c01f3bcca31312f0608b",
+ "size": 1735,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_distinct-distinct_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-blacklisted_pragmas1]": [
+ {
+ "checksum": "847cd698c39fa849d11fa7362c7c304d",
+ "size": 1519,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_dq-blacklisted_pragmas1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-blacklisted_pragmas]": [
+ {
+ "checksum": "b4c8c43a098590ac90ffd096fbc08b67",
+ "size": 1521,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_dq-blacklisted_pragmas_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-dq_replicate_ok]": [
+ {
+ "checksum": "fc2cbcd7a279ff109087d27612a5fb98",
+ "size": 1752,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-dq_replicate_ok_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-join_cbo_native_3_tables]": [
+ {
+ "checksum": "1382caad39126326c2ea1ce9ae3c2b06",
+ "size": 2718,
+ "uri": "https://{canondata_backend}/1600758/aa77b6a270d89941f1132228005ec243fcdbcd75/resource.tar.gz#test_sql2yql.test_dq-join_cbo_native_3_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-mem_limit]": [
+ {
+ "checksum": "a2b0a832ec98d18596567f559a1b778d",
+ "size": 1361,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-mem_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-pool_trees_whitelist]": [
+ {
+ "checksum": "5137c665c4b6c390b2ec84c27fefb128",
+ "size": 1529,
+ "uri": "https://{canondata_backend}/1871002/c65ff3a6f73717dfa83b26a43711be000bed4540/resource.tar.gz#test_sql2yql.test_dq-pool_trees_whitelist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_asyncfile]": [
+ {
+ "checksum": "76e8e8cad7be50a5f7da2368995991a7",
+ "size": 2430,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-precompute_asyncfile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_parallel]": [
+ {
+ "checksum": "7d408f160c27bc1bcb185588d6a43280",
+ "size": 3210,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_dq-precompute_parallel_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_parallel_indep]": [
+ {
+ "checksum": "decf219a1091da410ee315ad657f3fd4",
+ "size": 3402,
+ "uri": "https://{canondata_backend}/1903885/e05277820455e95dc3443a43a34b1956971f88cf/resource.tar.gz#test_sql2yql.test_dq-precompute_parallel_indep_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_parallel_mix]": [
+ {
+ "checksum": "c557f52fe0852d86a73c69134c80e332",
+ "size": 4230,
+ "uri": "https://{canondata_backend}/1937027/08c3c9c6866171c02a77702fcc07f26f028f4001/resource.tar.gz#test_sql2yql.test_dq-precompute_parallel_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_result]": [
+ {
+ "checksum": "043145e8db2d44a158f122c3a724e034",
+ "size": 2202,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-precompute_result_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-precompute_tree]": [
+ {
+ "checksum": "46566f0cdb4a2477043c545b8c30b0aa",
+ "size": 4340,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-precompute_tree_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-read_cost]": [
+ {
+ "checksum": "4f10f57054396c5a559c71d6ccabe9b2",
+ "size": 2584,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-read_cost_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-read_cost_native]": [
+ {
+ "checksum": "ce59770deed584f6aadeb3a1300c7685",
+ "size": 2588,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-read_cost_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-truncate_local]": [
+ {
+ "checksum": "084796c4ef7addaaf9d7a2dcfe9bc298",
+ "size": 1194,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-truncate_local_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-wrong_script]": [
+ {
+ "checksum": "447f152b50e5bf2e449eee11723e41bc",
+ "size": 1255,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-wrong_script_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-wrong_script_segf]": [
+ {
+ "checksum": "c7f9c7b7799a9bdadedb37ccb77681a9",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-wrong_script_segf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[dq-wrong_script_timeout]": [
+ {
+ "checksum": "aaa85a47a6a73c6d2a4c5639ce92e8c1",
+ "size": 1289,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_dq-wrong_script_timeout_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[epochs-read_modified]": [
+ {
+ "checksum": "bc9dd1925fcfbd263ab9ff3d729af9a2",
+ "size": 6008,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_epochs-read_modified_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[epochs-reset_sortness_on_append]": [
+ {
+ "checksum": "bf8f8caeea95917735349ac0badcf629",
+ "size": 2911,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_epochs-reset_sortness_on_append_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[epochs-use_and_drop_anonymous]": [
+ {
+ "checksum": "4afb7472fef6358a32433ef7790e6dd1",
+ "size": 4732,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_epochs-use_and_drop_anonymous_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[epochs-use_sorted_by_complex_type]": [
+ {
+ "checksum": "81b446e2e28403bc101c8890bc72c9b4",
+ "size": 2649,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_epochs-use_sorted_by_complex_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_dict_dict_key]": [
+ {
+ "checksum": "4d065f5e56c8b63be0d3411d410e04c4",
+ "size": 7149,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_dict_dict_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_dict_implicit_cast]": [
+ {
+ "checksum": "c5ab3c0ce3d597b74f429eb796c6a842",
+ "size": 1302,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_dict_implicit_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_dict_list_key]": [
+ {
+ "checksum": "ee728b6f722b9f81ca9bc2a517453c5c",
+ "size": 4607,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_dict_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_dict_tuple_key]": [
+ {
+ "checksum": "c0d292bcee6cc7a26c59abeca7df713d",
+ "size": 11258,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_dict_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_set]": [
+ {
+ "checksum": "b1997ffee89e7d70ff381cb2268bc849",
+ "size": 1446,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_set_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_struct_syntax]": [
+ {
+ "checksum": "336e20af058cc63f6a978910f8237584",
+ "size": 1078,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_struct_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_table]": [
+ {
+ "checksum": "0bf324f10bc30b8e1f5478a034e3d97c",
+ "size": 3361,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-as_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_table_bad_columns_fail]": [
+ {
+ "checksum": "9ac5c63ddeb8f92972228168b69fc7b1",
+ "size": 1446,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-as_table_bad_columns_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_table_bad_row_type_fail]": [
+ {
+ "checksum": "2810cae7bca8511c3a14913e20362f1f",
+ "size": 1188,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-as_table_bad_row_type_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_table_emptylist2]": [
+ {
+ "checksum": "4a1cdadc438068b2058724e622fa235c",
+ "size": 3932,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_table_emptylist2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_table_emptylist]": [
+ {
+ "checksum": "1d3cc457f3d45a247a5bef82365e485a",
+ "size": 11367,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-as_table_emptylist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_tuple_syntax]": [
+ {
+ "checksum": "bd15a7e67dc76e5365495ac2804a9f9c",
+ "size": 1050,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_tuple_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_variant_enum]": [
+ {
+ "checksum": "a7e57aabe8866326afe5416a81edbba9",
+ "size": 1173,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_variant_enum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-as_variant_enum_compare]": [
+ {
+ "checksum": "a13ec3a6e3699af05b53bc9e37157d2b",
+ "size": 1582,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-as_variant_enum_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-backtick_escape]": [
+ {
+ "checksum": "a1545261c288651764e3cd8522caf3f0",
+ "size": 1534,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-backtick_escape_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-between]": [
+ {
+ "checksum": "1288b704160f1a5707ed0e74d4db04ab",
+ "size": 9982,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-between_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-callable]": [
+ {
+ "checksum": "8b20e5233de85a6f058137c59e2a51f5",
+ "size": 1959,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-callable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_dynumber]": [
+ {
+ "checksum": "ea52b184944c01a638df630dd022eb3a",
+ "size": 2557,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_dynumber_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_from_utf8]": [
+ {
+ "checksum": "aeb4bf95f0b901641aa2366ad7217564",
+ "size": 1970,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_from_utf8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_longint]": [
+ {
+ "checksum": "c400508584c8e0b34fabf51691acd652",
+ "size": 1649,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_longint_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_reverse_list]": [
+ {
+ "checksum": "6ccf14fd7be8da4517eb36704ca16f58",
+ "size": 1163,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_reverse_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_string_implicit]": [
+ {
+ "checksum": "dca38466cdb90579fb7b7b8b5a8d225b",
+ "size": 9798,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_string_implicit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_struct]": [
+ {
+ "checksum": "5ee2144d92ae31654276aee7373a05a9",
+ "size": 2439,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_type_bind]": [
+ {
+ "checksum": "98d89ab067086837de7e2ca29dd4835a",
+ "size": 1050,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_type_bind_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_utf8]": [
+ {
+ "checksum": "ed93ef064a82a4c58b5be944e98b672f",
+ "size": 1033,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_utf8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-cast_variant]": [
+ {
+ "checksum": "2b71ea0a9eed5a0099a2d05f1a253f0f",
+ "size": 2026,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-cast_variant_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-checked_ops]": [
+ {
+ "checksum": "53b7498eb6d137baa108335b8e8cf9ab",
+ "size": 6555,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-checked_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-checked_ops_agg]": [
+ {
+ "checksum": "796c839f0a453dce6415278d77ae1763",
+ "size": 2637,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-checked_ops_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-common_type_for_resource_and_data]": [
+ {
+ "checksum": "5db5a96f4f8b6a41bd10ab730aed38f7",
+ "size": 3829,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-common_type_for_resource_and_data_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-constraints_of]": [
+ {
+ "checksum": "fed99f82c289f055972fd878e78a5900",
+ "size": 2519,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-constraints_of_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-container_comp]": [
+ {
+ "checksum": "a668abab9c3c71862f04841d56a7c0ee",
+ "size": 7523,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-container_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-convert_to_lambda_optional_args]": [
+ {
+ "checksum": "8b58007c340fe34ffa65b0358aa40db4",
+ "size": 2161,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-convert_to_lambda_optional_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-current_tz]": [
+ {
+ "checksum": "f3d13ae8de0497fd6e7fee8fb2c0aee1",
+ "size": 1885,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-current_tz_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-decimal_bytes]": [
+ {
+ "checksum": "d0b817202e1eb17df324eeb9e7272ad9",
+ "size": 4090,
+ "uri": "https://{canondata_backend}/1937367/fb7bc472ea97cce2f795f26ab64cf43ffb7e6852/resource.tar.gz#test_sql2yql.test_expr-decimal_bytes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-dict_builtins]": [
+ {
+ "checksum": "83e947b5afa171ce301cd8fbc1659bd8",
+ "size": 3038,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-dict_builtins_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-dict_builtins_null_lookup]": [
+ {
+ "checksum": "5c12f6d9791d01bc74ac075c7de22692",
+ "size": 4404,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-dict_builtins_null_lookup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-dict_common_type]": [
+ {
+ "checksum": "5f8f097e8b0b59abc2cc0062a4878178",
+ "size": 2316,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-dict_common_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-dict_comp]": [
+ {
+ "checksum": "48351e2b41d1cd3ae00221abd0e64623",
+ "size": 3036,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-dict_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-distinct_from]": [
+ {
+ "checksum": "9297975eafb537cdffe4da8553231d05",
+ "size": 1902,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-distinct_from_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-distinct_from_containers]": [
+ {
+ "checksum": "128ad8cf3d4613d8f470cf2ec09d309c",
+ "size": 2866,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-distinct_from_containers_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-distinct_from_opt]": [
+ {
+ "checksum": "8682c905a27935ff2915ce5f4d52bd46",
+ "size": 2584,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-distinct_from_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-double_join_with_list_from_range]": [
+ {
+ "checksum": "70763c32b5875e58b9c0a6d238c16373",
+ "size": 4834,
+ "uri": "https://{canondata_backend}/1917492/ed9b36703626aa4fada4356e138983724eb8aebf/resource.tar.gz#test_sql2yql.test_expr-double_join_with_list_from_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_dict_ops]": [
+ {
+ "checksum": "cb265838e4b246f3e29576c15fd85263",
+ "size": 3596,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_dict_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_iterator2]": [
+ {
+ "checksum": "a46e0a7c4eb660eb9d71883022222ea7",
+ "size": 2629,
+ "uri": "https://{canondata_backend}/1942173/415cbf5df3dc61306361ecaeb378f8996d5f72e6/resource.tar.gz#test_sql2yql.test_expr-empty_iterator2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_iterator]": [
+ {
+ "checksum": "202d43e11724dcb8a1b4adebf2fda439",
+ "size": 2535,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_iterator_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_list_ops1]": [
+ {
+ "checksum": "d26238858cb1609576b934132ddce002",
+ "size": 11479,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_list_ops1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_list_ops2]": [
+ {
+ "checksum": "2014090ec5947d078006d4992ac111b9",
+ "size": 10352,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_list_ops2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_list_ops3]": [
+ {
+ "checksum": "fbfd724293a3f8e5aab9469692111e1f",
+ "size": 8148,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_list_ops3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-empty_struct_tuple_types]": [
+ {
+ "checksum": "17b9b937853adeff9e44792650cdba80",
+ "size": 1508,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-empty_struct_tuple_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-ensure_ok]": [
+ {
+ "checksum": "10a7af87b024b179e0ee032b3abf4286",
+ "size": 1038,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-ensure_ok_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-ensure_runtime_fail]": [
+ {
+ "checksum": "ac75a9c6e648e33889ad1a48890312b7",
+ "size": 1056,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-ensure_runtime_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-ensure_type_fail]": [
+ {
+ "checksum": "d2b990e74aadc5b0555cd7d4cce8370f",
+ "size": 1037,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-ensure_type_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-evaluate_parse_inf_nan]": [
+ {
+ "checksum": "44eabf21451b973eafd57432dc1181d1",
+ "size": 1578,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-evaluate_parse_inf_nan_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-exapnd_with_singular_types]": [
+ {
+ "checksum": "2cf02d9ea7d51e8728c9452b5b6a8ecd",
+ "size": 1929,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-exapnd_with_singular_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_add_literal_nulls]": [
+ {
+ "checksum": "918381b903be52653afebc099251038c",
+ "size": 1182,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_add_literal_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_cast]": [
+ {
+ "checksum": "c40afe8039f1b8687e29da11b6620627",
+ "size": 1027,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_named_yql_lambda]": [
+ {
+ "checksum": "765f42467cbf4c4853c20bb2b3b1161c",
+ "size": 1032,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_named_yql_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_named_yql_lambda_multiline_atoms]": [
+ {
+ "checksum": "9e8bf20a23f45d139b64827e5fa7ee24",
+ "size": 1058,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_named_yql_lambda_multiline_atoms_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_named_yql_lambda_quotes]": [
+ {
+ "checksum": "64cfc1e85bf9fabe41f00a46ec8a62f9",
+ "size": 1267,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_named_yql_lambda_quotes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_null]": [
+ {
+ "checksum": "0dbc38f3b87695e12be7c15d60396a12",
+ "size": 987,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_op_in_paren]": [
+ {
+ "checksum": "86eafd5b481d380898c8ea491cfb83d9",
+ "size": 1019,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_op_in_paren_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_trivial_named]": [
+ {
+ "checksum": "d098ffece30ab7044a43f22fc5f0a28d",
+ "size": 998,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_trivial_named_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_yql_data]": [
+ {
+ "checksum": "5463371b3a2c6310a5a8d6313ce98ee9",
+ "size": 1155,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_yql_data_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_yql_from_string]": [
+ {
+ "checksum": "070d57b6fcd7f0891abd549e35013afa",
+ "size": 1020,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_yql_from_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-expr_yql_function]": [
+ {
+ "checksum": "17d9cfe65df922c59667c9e960c71310",
+ "size": 1030,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-expr_yql_function_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-extra_opt_try_member]": [
+ {
+ "checksum": "977f5dc695b09feadad3998456aeff21",
+ "size": 2825,
+ "uri": "https://{canondata_backend}/1773845/debb3aa4dcc88e474e8ae2ff70a6e75e8cfdd59f/resource.tar.gz#test_sql2yql.test_expr-extra_opt_try_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-fallback_filternullelements]": [
+ {
+ "checksum": "bff7d62244f472c4c10edcf9353c5b07",
+ "size": 1802,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-fallback_filternullelements_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-fallback_filternullmembers]": [
+ {
+ "checksum": "6f5988fdc818a746c5e2cff0992b8a89",
+ "size": 1878,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-fallback_filternullmembers_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-flatmap_by_map_lazy_list]": [
+ {
+ "checksum": "b597959365e3cf103c90ee68fe161411",
+ "size": 2236,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-flatmap_by_map_lazy_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-formattypediff]": [
+ {
+ "checksum": "d3c229cc5dd41b3fa2f6f25d210cba64",
+ "size": 2810,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-formattypediff_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-implicit_bitcast_fail]": [
+ {
+ "checksum": "834af2d0a3b9ea8c437b3116bd0ab91b",
+ "size": 1172,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-implicit_bitcast_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-implicit_cast_literals_under_if]": [
+ {
+ "checksum": "5a96c43396ff558da741dd68ec292fa3",
+ "size": 1750,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-implicit_cast_literals_under_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-implicit_cast_literals_under_listfromrange]": [
+ {
+ "checksum": "5b34c0f250ba6c6ddb3b67f267406abc",
+ "size": 1600,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-implicit_cast_literals_under_listfromrange_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-inline_call]": [
+ {
+ "checksum": "ca604d7c819f9b850e62ffe8b7a46d91",
+ "size": 6557,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-inline_call_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-int_literals]": [
+ {
+ "checksum": "f4a48e629eae6e4b6c297520009f23df",
+ "size": 1833,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-int_literals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-int_literals_negative]": [
+ {
+ "checksum": "92660fb3c14e22be1e001663527b0b0d",
+ "size": 7088,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-int_literals_negative_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-int_literals_negative_typed]": [
+ {
+ "checksum": "53e2c8a3dd39fcf0ebf2d90f1884c4f3",
+ "size": 9399,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-int_literals_negative_typed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-is_null]": [
+ {
+ "checksum": "5efb8cb2ef122f2d86c0d0e556ce87c0",
+ "size": 1634,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-is_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-iterable]": [
+ {
+ "checksum": "72ec0d9d54d295d878b9bfd84ba8ee93",
+ "size": 5886,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-iterable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-lambda_as_optional_callable]": [
+ {
+ "checksum": "3e7d1a9b69dd2e55ca36433bc4af4d32",
+ "size": 2040,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-lambda_as_optional_callable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-lds_empty_cast]": [
+ {
+ "checksum": "d903773c7d2d8e46d2aefc5c3b5d1a20",
+ "size": 3190,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-lds_empty_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-lds_empty_compare]": [
+ {
+ "checksum": "9a1135fbf05dcc6e1160d96cbbad45d5",
+ "size": 10010,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-lds_empty_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-lds_literal]": [
+ {
+ "checksum": "ee0b250db113f995262f1e8c4bcc1e5e",
+ "size": 2211,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-lds_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-lds_types]": [
+ {
+ "checksum": "47557331489d1cd5973e4012c6aa6516",
+ "size": 2578,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-lds_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-len]": [
+ {
+ "checksum": "0f6630cb89757c89d8678fcd5a67d864",
+ "size": 1908,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-len_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-length_of_optional_set_intesection]": [
+ {
+ "checksum": "cbc2df1c966101c19d36b1dcbbe90e86",
+ "size": 1231,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-length_of_optional_set_intesection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_builtins]": [
+ {
+ "checksum": "cd0e765cb93612a1da8fe3084644ef9a",
+ "size": 14530,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_builtins_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_builtins_opt]": [
+ {
+ "checksum": "93f9bbc21c5dac5901ecc2663cb9e648",
+ "size": 3186,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_builtins_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_comp]": [
+ {
+ "checksum": "678a01f9ed65130630c7a19ce4a0d7f6",
+ "size": 10192,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_concat]": [
+ {
+ "checksum": "26a0730b6723e7d38cb4230d10330e2d",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_extend]": [
+ {
+ "checksum": "b4b33e8db7bb668e46e193e275a97318",
+ "size": 2936,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_extend_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_flat_map_deprecated_opt]": [
+ {
+ "checksum": "c4c29d44500784410065a82151bb0f79",
+ "size": 1136,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_flat_map_deprecated_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_flatten]": [
+ {
+ "checksum": "871d3d0db79e015712d50376fe7c5dba",
+ "size": 4989,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_flatten_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_from_range]": [
+ {
+ "checksum": "ab930e3eb82c25a892e1de93b3de87c4",
+ "size": 2417,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_from_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_from_range_opt]": [
+ {
+ "checksum": "95892572241c790db53cf34ed4479b98",
+ "size": 6187,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_from_range_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_from_range_overflow]": [
+ {
+ "checksum": "2c7b2c842cd31037ed7a7ca0c26e9fc2",
+ "size": 1715,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_from_range_overflow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_indexof]": [
+ {
+ "checksum": "195e1053a31d4c3c7fc8c04f4446ae1a",
+ "size": 2524,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_indexof_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_not_null]": [
+ {
+ "checksum": "6d34606c37f6451e41bbff378b3bd018",
+ "size": 2786,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_not_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_replicate]": [
+ {
+ "checksum": "092a3ac468915d4a30bdbfa42a68ba7e",
+ "size": 1581,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_replicate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_replicate_fail]": [
+ {
+ "checksum": "2baa52ec3b698a5ea3dc12778c162fa7",
+ "size": 1019,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_replicate_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_takeskipwhile]": [
+ {
+ "checksum": "827d6c45ccb33ccc641531600fa839ce",
+ "size": 2898,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_takeskipwhile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_takeskipwhileinclusive]": [
+ {
+ "checksum": "42b17229d4d13acbd645411fcd69b59f",
+ "size": 2952,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_takeskipwhileinclusive_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_to_from_tuple]": [
+ {
+ "checksum": "3dd3095766fc4103fca9c422412e87a3",
+ "size": 3053,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_to_from_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_top_sort]": [
+ {
+ "checksum": "b2acc119076239ea4f4ada66e164330b",
+ "size": 15716,
+ "uri": "https://{canondata_backend}/995452/0828572c263b2cebd15b1dcd234d39fd5315b924/resource.tar.gz#test_sql2yql.test_expr-list_top_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-list_uniq]": [
+ {
+ "checksum": "d15d661e6b25dd80b507f95fb057c207",
+ "size": 2980,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-list_uniq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-literal_list_element]": [
+ {
+ "checksum": "8896a6ecf834dd1227d859c0378e0fcd",
+ "size": 1075,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-literal_list_element_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-literal_strings]": [
+ {
+ "checksum": "541431391ee9d6dc00f0ff35b098b84e",
+ "size": 2109,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-literal_strings_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-literal_strings_suffix]": [
+ {
+ "checksum": "4b6dfda644a3f352e52517b9d6602d44",
+ "size": 1316,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-literal_strings_suffix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-literal_struct_member]": [
+ {
+ "checksum": "d48a065a5a51ca6896fcd2aa0e1e301f",
+ "size": 1089,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-literal_struct_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-literal_true]": [
+ {
+ "checksum": "7ee58ab5522e3b48ff326980973ceea1",
+ "size": 995,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-literal_true_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-longint_builtins]": [
+ {
+ "checksum": "4ec19528fad4905c4015e4100a356a3e",
+ "size": 3663,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-longint_builtins_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-many_opt_comp]": [
+ {
+ "checksum": "e06f6468f7ecd7e19e729a58eeca80b1",
+ "size": 8664,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-many_opt_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-minmax_for_complex_types]": [
+ {
+ "checksum": "aaf854dd05cb093b512c206f579cae35",
+ "size": 3840,
+ "uri": "https://{canondata_backend}/1942671/92396c368500f27bb9a26ee02762281c902efb4e/resource.tar.gz#test_sql2yql.test_expr-minmax_for_complex_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_group_by_column_fail]": [
+ {
+ "checksum": "392fb0610bd8fc598098ae660979a3e0",
+ "size": 1537,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-non_persistable_group_by_column_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_group_by_having_some_fail]": [
+ {
+ "checksum": "969569f9849512eb018cc0f2218a3d91",
+ "size": 1549,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-non_persistable_group_by_having_some_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_group_by_some_fail]": [
+ {
+ "checksum": "c87075eda8f677587561a0bf3e9efeda",
+ "size": 1404,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-non_persistable_group_by_some_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_inner_select_fail]": [
+ {
+ "checksum": "f969eeda5df71a54446b825d54e816a5",
+ "size": 1673,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-non_persistable_inner_select_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_insert_into_fail]": [
+ {
+ "checksum": "fad1f2253fb1474d05f87aaf71581ab8",
+ "size": 689,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_expr-non_persistable_insert_into_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-non_persistable_order_by_fail]": [
+ {
+ "checksum": "20872d65cfb098b08959876452ac2b8d",
+ "size": 1417,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_expr-non_persistable_order_by_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-opt_list_map]": [
+ {
+ "checksum": "431a53d72b19edda2357ed81d5f7db32",
+ "size": 14432,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-opt_list_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-opt_try_member]": [
+ {
+ "checksum": "e334fba8830b85f72ae0896b9e0201b4",
+ "size": 4479,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-opt_try_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-partial_columns_in_mem_aggr]": [
+ {
+ "checksum": "37206d2214207d8094265ff0907410e3",
+ "size": 2245,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-partial_columns_in_mem_aggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-pg_try_member]": [
+ {
+ "checksum": "fefe0284ba87e66037460220848d2d8e",
+ "size": 3602,
+ "uri": "https://{canondata_backend}/1773845/debb3aa4dcc88e474e8ae2ff70a6e75e8cfdd59f/resource.tar.gz#test_sql2yql.test_expr-pg_try_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-pickle]": [
+ {
+ "checksum": "de9e41e47a51da5a8f2772c0e71cf52f",
+ "size": 6661,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-pickle_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-replace_member]": [
+ {
+ "checksum": "c04bc27e6501ec7ed04b5e7a33e80f53",
+ "size": 2427,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-replace_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-sets]": [
+ {
+ "checksum": "d239d43d3715c3557e4f4c25a5328e78",
+ "size": 18321,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-sets_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-static_fold]": [
+ {
+ "checksum": "098a36595b1ab85004123ea8d89a48cc",
+ "size": 4520,
+ "uri": "https://{canondata_backend}/1924537/1e3ca38458825f3a90f980c646934da7af7d2e26/resource.tar.gz#test_sql2yql.test_expr-static_fold_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-static_zip]": [
+ {
+ "checksum": "11b6f9c8ec99515fce83b9aeceef0f4b",
+ "size": 2576,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-static_zip_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_builtins]": [
+ {
+ "checksum": "bf1539673c03fcce8d9fe6b218b55149",
+ "size": 2904,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_builtins_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_gather_spread]": [
+ {
+ "checksum": "4110f89e3bfe81d745258377c94052bc",
+ "size": 6629,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_gather_spread_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_literal]": [
+ {
+ "checksum": "6631b52ef7be83aa0287dc702483ecd2",
+ "size": 1545,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_literal_bind]": [
+ {
+ "checksum": "379a6d959c0e5ba2272e9d212371d61d",
+ "size": 1043,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_literal_bind_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_literal_members]": [
+ {
+ "checksum": "f475f7d08154c580828b45887cab373a",
+ "size": 1385,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_literal_members_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_merge]": [
+ {
+ "checksum": "e3781bd00212a17b07691294caa0c1b0",
+ "size": 3095,
+ "uri": "https://{canondata_backend}/1916746/116cafe28e270e7917dbeab5e0d1b5f2357e5c16/resource.tar.gz#test_sql2yql.test_expr-struct_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-struct_slice]": [
+ {
+ "checksum": "4d0f79865e785d3f3b0e9e0110bb1f86",
+ "size": 2040,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-struct_slice_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-tagged_runtime]": [
+ {
+ "checksum": "f2315a0487cf3e32237dee85788eb298",
+ "size": 2974,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-tagged_runtime_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_dict_from_nothing]": [
+ {
+ "checksum": "7a899ceb11890c3510f64670490775ea",
+ "size": 1070,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_dict_from_nothing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_dict_dict_key]": [
+ {
+ "checksum": "a04cf915c55575e347cab2faee4a382f",
+ "size": 26976,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_dict_dict_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_dict_list_key]": [
+ {
+ "checksum": "56350f81a2f58e7f7e51bb13976b6452",
+ "size": 23502,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_dict_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_dict_tuple_key]": [
+ {
+ "checksum": "d2a45d27174d6082f7f750166e6618b8",
+ "size": 57854,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_dict_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_dict_varstruct_key]": [
+ {
+ "checksum": "1b12c03fbb0418eafceda0205ccd2568",
+ "size": 29794,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_dict_varstruct_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_dict_vartuple_key]": [
+ {
+ "checksum": "dc076aa81fa40bbfaf1955db8964927f",
+ "size": 28094,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_dict_vartuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_set_dict_key]": [
+ {
+ "checksum": "75ec09a29c1b759aed44bc87fd815fa9",
+ "size": 13873,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_set_dict_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_set_list_key]": [
+ {
+ "checksum": "b708b3ad623033def4ff2f9fe89b5fe4",
+ "size": 11483,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_set_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_set_tuple_key]": [
+ {
+ "checksum": "39591507d50634c60ad23c87c0a703d2",
+ "size": 29583,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_set_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_set_varstruct_key]": [
+ {
+ "checksum": "3d4cfbeef5eaf1b8f14faa065010affa",
+ "size": 15157,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_set_varstruct_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_hashed_set_vartuple_key]": [
+ {
+ "checksum": "b562fc6ca8422c4388110d67f4ac7689",
+ "size": 14307,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_hashed_set_vartuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_dict_list_key]": [
+ {
+ "checksum": "57f5bf1458cb18e951c4f270df16d483",
+ "size": 10651,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_dict_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_dict_tuple_key]": [
+ {
+ "checksum": "2ed37f299cb087bc3c57a211cb7c73fd",
+ "size": 26847,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_dict_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_dict_vartuple_key]": [
+ {
+ "checksum": "169243272cceab72acf11c8a5b6ca04f",
+ "size": 11745,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_dict_vartuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_set_list_key]": [
+ {
+ "checksum": "d566d03f08c016d4d12e451789a5b9c3",
+ "size": 5426,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_set_list_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_set_tuple_key]": [
+ {
+ "checksum": "147bb2d90d39a14aff0bd2f61a7d82de",
+ "size": 13018,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_set_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-to_sorted_set_vartuple_key]": [
+ {
+ "checksum": "7676ce53856e9c323a15b83b3c97442d",
+ "size": 5860,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-to_sorted_set_vartuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-try_member]": [
+ {
+ "checksum": "11bd9037e4c2efde4307441e96c6d3a2",
+ "size": 9904,
+ "uri": "https://{canondata_backend}/1946324/d9bbf763189fff6203bd54ad96c51e1ebd23dffc/resource.tar.gz#test_sql2yql.test_expr-try_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-type_as_key]": [
+ {
+ "checksum": "33f4e933fbd02cb6bcb6d0c1fec847f5",
+ "size": 1455,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-type_as_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-tzdate_result]": [
+ {
+ "checksum": "a08597ad4ca67d5e6f140b9f28b6edcf",
+ "size": 4446,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-tzdate_result_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-udaf_with_list_zip]": [
+ {
+ "checksum": "47d64d67fa3efed128b6cf1d52128b59",
+ "size": 3353,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-udaf_with_list_zip_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-unicode_literals]": [
+ {
+ "checksum": "b0cb2ae9c703460b2e2eaac9823ef75b",
+ "size": 1940,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-unicode_literals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-untag]": [
+ {
+ "checksum": "24cbcd336944de2cd8c2b1e3bd5548ff",
+ "size": 1591,
+ "uri": "https://{canondata_backend}/1946324/b3f3c389233f62d5a3b5562f5926358e497b4f41/resource.tar.gz#test_sql2yql.test_expr-untag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-unwrap_runtime_fail]": [
+ {
+ "checksum": "fb44507553b0f822d660b9eb5d4f2b09",
+ "size": 1016,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-unwrap_runtime_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-uuid]": [
+ {
+ "checksum": "117b9854503c40e19bccd2dd620bb218",
+ "size": 8942,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-uuid_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-uuid_order]": [
+ {
+ "checksum": "42fed32f5fdca2d651a274da28fb1ac7",
+ "size": 12690,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_expr-uuid_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-variant_list_sort]": [
+ {
+ "checksum": "39b9095be25d8153ac515e9e72e1f620",
+ "size": 1589,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-variant_list_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-variant_struct_comp]": [
+ {
+ "checksum": "0b2a7bd63b80ef1ce214007aaa17ec47",
+ "size": 21576,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-variant_struct_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-variant_tuple_comp]": [
+ {
+ "checksum": "88bf1a9d5bca808030bd95ffc1b804b7",
+ "size": 18680,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-variant_tuple_comp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-with_optional_args]": [
+ {
+ "checksum": "c3680ca837976fb10b5252eae8c47a1b",
+ "size": 3460,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-with_optional_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-xor]": [
+ {
+ "checksum": "3548d40fbc0d95442cffdef548b1e8b4",
+ "size": 2466,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-xor_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-yql-10180]": [
+ {
+ "checksum": "38fda81c9e5fd439eb1284aeec8ba654",
+ "size": 6751,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_expr-yql-10180_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[expr-yql-15485]": [
+ {
+ "checksum": "3f7e94a1bc650ee4cb384c686b14cce9",
+ "size": 8630,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_expr-yql-15485_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-file_constness]": [
+ {
+ "checksum": "b9328327d432127f0ea34d104182a4b5",
+ "size": 1690,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_file-file_constness_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-file_list_bools]": [
+ {
+ "checksum": "338724115e2ef1ab4fbdac7bcc9c6880",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-file_list_bools_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-file_list_simple]": [
+ {
+ "checksum": "6a2962bb4a1245a408599477e0b59b63",
+ "size": 1358,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-file_list_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-file_skip_take]": [
+ {
+ "checksum": "ee6b644cae6b0e6ea2240d38c0be1ac4",
+ "size": 1172,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-file_skip_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-parse_file_bad_type_fail]": [
+ {
+ "checksum": "d1e9f3f09a3ba5342ea4939b0e095e63",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-parse_file_bad_type_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-parse_file_in_select_as_int]": [
+ {
+ "checksum": "20b58834ce190b83cd8ce3725f7921b7",
+ "size": 1628,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-parse_file_in_select_as_int_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-parse_file_in_select_as_str]": [
+ {
+ "checksum": "ab92665ed8f5312050cf3318852270f6",
+ "size": 1576,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-parse_file_in_select_as_str_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-parse_file_in_select_as_uint64]": [
+ {
+ "checksum": "52667042c550fb2a2c10cc8dbfd680f3",
+ "size": 1605,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-parse_file_in_select_as_uint64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-second_pass_parse_file_fail]": [
+ {
+ "checksum": "681df7487acf69107aad8dfb16e649fe",
+ "size": 1449,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-second_pass_parse_file_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-where_key_in_file_content]": [
+ {
+ "checksum": "5e9c8bc2648ebc3a1899f06f83cfa56f",
+ "size": 1376,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-where_key_in_file_content_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-where_key_in_file_content_typed]": [
+ {
+ "checksum": "e4e036b6cb5f98cd389cb35c59991077",
+ "size": 1406,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-where_key_in_file_content_typed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[file-where_key_in_get_file_content]": [
+ {
+ "checksum": "6a2962bb4a1245a408599477e0b59b63",
+ "size": 1358,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_file-where_key_in_get_file_content_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_and_where]": [
+ {
+ "checksum": "08ba9937d3bc6eb579e0584c64dfd2ef",
+ "size": 2730,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_and_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_by_aster_opt]": [
+ {
+ "checksum": "4847c78aabb7b0ccf7bb71e824ba3b43",
+ "size": 1937,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_by_aster_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_by_group_by_alias_collision]": [
+ {
+ "checksum": "d203c2b79d73ffaddfeb23dd020e28de",
+ "size": 2025,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_by_group_by_alias_collision_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_by_opt_dict]": [
+ {
+ "checksum": "26e08b2bdab26597155101399486fa68",
+ "size": 3034,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_by_opt_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_by_typed_table]": [
+ {
+ "checksum": "379a1b8eae0e76e31b2836061fa70ef9",
+ "size": 1292,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_by_typed_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_columns]": [
+ {
+ "checksum": "28eabf4d5c2f578d6c0e736532f10273",
+ "size": 2032,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_columns_by_aggregate]": [
+ {
+ "checksum": "08cbb641639687fcb1a69db73db521a7",
+ "size": 3055,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_columns_by_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_columns_non_struct]": [
+ {
+ "checksum": "948ff32cc5500be482a4c50158785954",
+ "size": 2172,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_columns_non_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_columns_with_opt_struct]": [
+ {
+ "checksum": "b7228c5daa788ba7aca566a51818b238",
+ "size": 1742,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_columns_with_opt_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_corr_name_column]": [
+ {
+ "checksum": "831c225d6549a0aa1ae4d9ddf27108a7",
+ "size": 7807,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_corr_name_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_dict]": [
+ {
+ "checksum": "481bdad487d4c41751d5f6ee7785825a",
+ "size": 4172,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_dict_by_opt]": [
+ {
+ "checksum": "8df961f75098cde6a03ee624fa75b87a",
+ "size": 2965,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_dict_by_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_expr]": [
+ {
+ "checksum": "6e73571aa0369d5fe84f41b48e7ca1ff",
+ "size": 2649,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_expr_groupby]": [
+ {
+ "checksum": "421435ac21c71f58eb17d1767ea6b68b",
+ "size": 2705,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_expr_groupby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_expr_join]": [
+ {
+ "checksum": "e12ae54f32cae86bf3d52476c50b2b06",
+ "size": 2515,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_expr_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_expr_struct]": [
+ {
+ "checksum": "6d2407e56b5f8d827fa7a48acf8c20b8",
+ "size": 7446,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_expr_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_expr_where]": [
+ {
+ "checksum": "c4360cca12959392877c82068180147b",
+ "size": 2768,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_expr_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_few_fields]": [
+ {
+ "checksum": "548006e6b903f9fac2b9f3b24ff4a0a9",
+ "size": 3150,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_few_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_list]": [
+ {
+ "checksum": "d319e9d2836e245c02ddb1db1963813d",
+ "size": 2612,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_list_on_flatten_by]": [
+ {
+ "checksum": "e66c299f0f3a65fadd943b8066cb71c7",
+ "size": 3428,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_list_on_flatten_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_member_is_struct]": [
+ {
+ "checksum": "9c0954b32ca1f0156f7802875e114254",
+ "size": 2922,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_member_is_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_mode]": [
+ {
+ "checksum": "1ff2d223c6e1273545ce481d6b7629f0",
+ "size": 10589,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_mode_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_one_field]": [
+ {
+ "checksum": "36faa8bc608cd5723bd48c29e2a7d22e",
+ "size": 2424,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_one_field_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_one_field_another]": [
+ {
+ "checksum": "2f647c9909120865b28d39f342fa8836",
+ "size": 2548,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_one_field_another_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_two_fields]": [
+ {
+ "checksum": "2d4b21f366117069439b1a00eef272c1",
+ "size": 3108,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_two_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_with_group_by]": [
+ {
+ "checksum": "f20483c2daf777c9048143145465478a",
+ "size": 3658,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_with_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_with_group_by_expr]": [
+ {
+ "checksum": "a2d26f00c28795494d39668a5f30a8cb",
+ "size": 3746,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_with_group_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_with_join]": [
+ {
+ "checksum": "4f07e16b19bc94f5b9d33487d4447eb1",
+ "size": 3538,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_with_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_with_resource]": [
+ {
+ "checksum": "c064bbac1e752e6bb6ba039113590ac3",
+ "size": 2815,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_with_resource_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-flatten_with_subquery]": [
+ {
+ "checksum": "84a976c9e073892308fd026fbff508ac",
+ "size": 3804,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_flatten_by-flatten_with_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flatten_by-struct_without_correlation]": [
+ {
+ "checksum": "ee1fbcd5a8b7ea84e4692034c047c3c9",
+ "size": 2776,
+ "uri": "https://{canondata_backend}/1936273/d1ec294b803f798a75479b94edfd85a02ab1eb54/resource.tar.gz#test_sql2yql.test_flatten_by-struct_without_correlation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-basic]": [
+ {
+ "checksum": "77a2b5b72a9ec667fd8ed44e8bb2d032",
+ "size": 2208,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-basic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-evaluate_expr]": [
+ {
+ "checksum": "a99f0931ef3c6645e33b3c9bb2dfd23b",
+ "size": 2033,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-evaluate_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-flatten_by]": [
+ {
+ "checksum": "91bda426cafcc80829f49e6035c55872",
+ "size": 1651,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-flatten_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-functions]": [
+ {
+ "checksum": "57b9d0a22b35a9f4c527c038eaba6019",
+ "size": 6175,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-functions_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-group_by2]": [
+ {
+ "checksum": "02e6071c050374b9b44ddb56119fd360",
+ "size": 2504,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-group_by2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-group_by]": [
+ {
+ "checksum": "6d2e436a30556250e4267b69d8d83940",
+ "size": 2942,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_flexible_types-group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-inside_evaluate]": [
+ {
+ "checksum": "b237fbeaefa0a91eb87b1e611c69562f",
+ "size": 1480,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-inside_evaluate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-struct_literals_vs_columns]": [
+ {
+ "checksum": "779fc4e7813a8a63536ad1a9f584a570",
+ "size": 2363,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-struct_literals_vs_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-text_and_bytes]": [
+ {
+ "checksum": "15b52aa13cdeadbbe15b5dec84d98502",
+ "size": 2478,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-text_and_bytes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-unused_types]": [
+ {
+ "checksum": "f6ffd93103f59dbe972cab32b2f5d2e0",
+ "size": 2016,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_flexible_types-unused_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[flexible_types-with_typeof]": [
+ {
+ "checksum": "a6406efbf4f1c054586e1b0f013cd616",
+ "size": 3843,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_flexible_types-with_typeof_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-double_input]": [
+ {
+ "checksum": "af1b7ca7f729e760816efd90b6091c5b",
+ "size": 4181,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-double_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-empty_out_hor_join]": [
+ {
+ "checksum": "6188cd6a9047207033a52ea8c185436d",
+ "size": 3454,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-empty_out_hor_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-filters]": [
+ {
+ "checksum": "217c4f4f0d32d9caad501bc9b2f53fc6",
+ "size": 2892,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-filters_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-fuse_multi_outs1]": [
+ {
+ "checksum": "f81834a31ce3bccf54700787657f07d0",
+ "size": 4730,
+ "uri": "https://{canondata_backend}/1924537/9527ff33d5072bcdebfebc83cc73739cf7354777/resource.tar.gz#test_sql2yql.test_hor_join-fuse_multi_outs1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-fuse_multi_outs2]": [
+ {
+ "checksum": "ad43280d036e717d74696a01d1de595e",
+ "size": 3917,
+ "uri": "https://{canondata_backend}/1924537/9527ff33d5072bcdebfebc83cc73739cf7354777/resource.tar.gz#test_sql2yql.test_hor_join-fuse_multi_outs2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-fuse_multi_usage]": [
+ {
+ "checksum": "d8756e7d1d07d9bdef9e38a7cd5dc098",
+ "size": 4155,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_hor_join-fuse_multi_usage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-group_ranges]": [
+ {
+ "checksum": "5222d983a98727bcabb151e6d4110661",
+ "size": 3538,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-group_ranges_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-group_sampling]": [
+ {
+ "checksum": "bc70aec7039488f50f575a8eeb9c62ac",
+ "size": 5727,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-group_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-group_yamr]": [
+ {
+ "checksum": "004bfbfd2a18ab572a1dabf17dd40674",
+ "size": 4806,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-group_yamr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-less_outs]": [
+ {
+ "checksum": "16c3a85ac35694e24dae8dccea821a20",
+ "size": 5148,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-less_outs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-max_in_tables]": [
+ {
+ "checksum": "0e38257bc0994b20b1af6ce7288e583d",
+ "size": 5039,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-max_in_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-max_outtables]": [
+ {
+ "checksum": "02af783bc1b9e87d8e2b856fca9db537",
+ "size": 5630,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-max_outtables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-merge_multiouts_all]": [
+ {
+ "checksum": "733be6f194aabb5f938d9894e693637e",
+ "size": 7908,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_hor_join-merge_multiouts_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-merge_multiouts_part]": [
+ {
+ "checksum": "1dfcb570e65636906c0a80a825c42fc6",
+ "size": 6854,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_hor_join-merge_multiouts_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-merge_multiouts_reuse]": [
+ {
+ "checksum": "6f9f37810f201b7a7a72c90c2262f0b5",
+ "size": 7908,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_hor_join-merge_multiouts_reuse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_hor_join]": [
+ {
+ "checksum": "55771ff21f3dcb6725bba08cfa9271ca",
+ "size": 4650,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_hor_join-out_hor_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_max_outtables]": [
+ {
+ "checksum": "267f5d4424caa2602551a204d2a9ba09",
+ "size": 5160,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-out_max_outtables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_mem_limit]": [
+ {
+ "checksum": "0d507574478b3193d3486fa01560bb6d",
+ "size": 4855,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_hor_join-out_mem_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_range]": [
+ {
+ "checksum": "0994bf9eba7ade1a7f54acccc4461e79",
+ "size": 4458,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_hor_join-out_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_sampling]": [
+ {
+ "checksum": "6002f77cdfce5b74fbe4f38f2cd136dc",
+ "size": 6052,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-out_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-out_table_record]": [
+ {
+ "checksum": "8b4649bdaccdd075ca6debf180740780",
+ "size": 3144,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-out_table_record_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-row_num_per_sect]": [
+ {
+ "checksum": "bf148a66722384a8ab7f8e675a7d69c2",
+ "size": 3612,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-row_num_per_sect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-runtime_dep]": [
+ {
+ "checksum": "2d1f993e1c6b26debb3f9f12ce3a2112",
+ "size": 3776,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-runtime_dep_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-skip_sampling]": [
+ {
+ "checksum": "688fe6f2801b70c2840c11773b86c74d",
+ "size": 4348,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-skip_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-skip_yamr]": [
+ {
+ "checksum": "96cf0f9dc56700351fe21c76b38d01e2",
+ "size": 3928,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-skip_yamr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-sorted_out]": [
+ {
+ "checksum": "880b159b95f5ef328db02c8c1526802a",
+ "size": 5053,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-sorted_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-sorted_out_mix]": [
+ {
+ "checksum": "6382e74ae7d0eba74a49e76af1fe4e6a",
+ "size": 4698,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_hor_join-sorted_out_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-table_record]": [
+ {
+ "checksum": "1ae87e14d55e9bd61375b37f39ba9684",
+ "size": 3021,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-table_record_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-yield_off]": [
+ {
+ "checksum": "c48b8e343f515d919f6a22299868c4bc",
+ "size": 2931,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_hor_join-yield_off_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-yield_on]": [
+ {
+ "checksum": "ede36401df3d22c37adefd62fb45f4b9",
+ "size": 2906,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_hor_join-yield_on_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-yql-12610_old_table_props]": [
+ {
+ "checksum": "08b8907c92adb98c3aea1150413f0546",
+ "size": 3110,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_hor_join-yql-12610_old_table_props_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[hor_join-yql-6477_table_path]": [
+ {
+ "checksum": "ab893ae2eaa9953a1a33d2f1a1b1c78a",
+ "size": 2102,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_hor_join-yql-6477_table_path_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-basic_in]": [
+ {
+ "checksum": "d65b144596eb506f4cc5f1f191a89832",
+ "size": 3463,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-basic_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-huge_in]": [
+ {
+ "checksum": "84b260a8c57edeb49ec27a67eb4f683a",
+ "size": 66602,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-huge_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi]": [
+ {
+ "checksum": "20e4d5c4273c52c544177bc1fd3d7612",
+ "size": 4069,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_dict1]": [
+ {
+ "checksum": "bc05eaacaf77a487975fe303a25658ae",
+ "size": 1772,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_dict1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_dict]": [
+ {
+ "checksum": "45d3b1eaa52a7d307bdb96e87e93197e",
+ "size": 4396,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_empty]": [
+ {
+ "checksum": "bf6d90f0774e22925be7cf24ab76dfe2",
+ "size": 2552,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_join]": [
+ {
+ "checksum": "c885b914204090524cc58dcf5f69323f",
+ "size": 19208,
+ "uri": "https://{canondata_backend}/1871102/df87192553c8f75bd76f68330c4903ce8323f9ec/resource.tar.gz#test_sql2yql.test_in-in_ansi_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_list1]": [
+ {
+ "checksum": "10ca694ca0fc5eb05cdae02e5cce6fd3",
+ "size": 1804,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_list1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_list]": [
+ {
+ "checksum": "ee9987484e6fd7f7278ca43fefd2e902",
+ "size": 4024,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_set]": [
+ {
+ "checksum": "89585a294fa1b6d4083f8d0de4e32fb7",
+ "size": 4025,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_set_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_ansi_variant]": [
+ {
+ "checksum": "f24b4a8e6d3bc36528013109ef142b2d",
+ "size": 2504,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_ansi_variant_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_compact_distinct]": [
+ {
+ "checksum": "f65546e116b983c74b553fe578de1a52",
+ "size": 2106,
+ "uri": "https://{canondata_backend}/1942173/8bc68e6d83ec103e0c4584bb7fe29a4a3eea2ef0/resource.tar.gz#test_sql2yql.test_in-in_compact_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_enum_single0]": [
+ {
+ "checksum": "1948cbb85677b7a0b3cd2b6828a9a364",
+ "size": 1268,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_enum_single0_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_enum_single1]": [
+ {
+ "checksum": "a5c1895f49f71c2076d88d3a527e1051",
+ "size": 1303,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_enum_single1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_exists_immediate_nested_subq]": [
+ {
+ "checksum": "3acdaf48dea055ee78c14d60b7af4fb8",
+ "size": 7068,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_exists_immediate_nested_subq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_immediate_subquery]": [
+ {
+ "checksum": "42a59ddd434a1181039da20edb18b6a3",
+ "size": 4010,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_in-in_immediate_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_noansi]": [
+ {
+ "checksum": "157df23370d77f59203563a23e3af99e",
+ "size": 3973,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_noansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_noansi_empty]": [
+ {
+ "checksum": "7da58423784631aff7b0116ce082509d",
+ "size": 2480,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_noansi_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_noansi_join]": [
+ {
+ "checksum": "636a6929680e677dc430b0216be69574",
+ "size": 19082,
+ "uri": "https://{canondata_backend}/1871102/df87192553c8f75bd76f68330c4903ce8323f9ec/resource.tar.gz#test_sql2yql.test_in-in_noansi_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_noansi_list_dict]": [
+ {
+ "checksum": "1a830642f7be16e4c35d1e6fd7b56883",
+ "size": 2674,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_noansi_list_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_nonliteral_tuple]": [
+ {
+ "checksum": "ba45ee716aa807a16f1f773edbee5851",
+ "size": 1145,
+ "uri": "https://{canondata_backend}/1937424/677402a69ee72f43067364c12feb7d084f4e8974/resource.tar.gz#test_sql2yql.test_in-in_nonliteral_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_nonliteral_tuple_ansi]": [
+ {
+ "checksum": "b02af9e81d355110c65a1245811d28b2",
+ "size": 1153,
+ "uri": "https://{canondata_backend}/1937424/677402a69ee72f43067364c12feb7d084f4e8974/resource.tar.gz#test_sql2yql.test_in-in_nonliteral_tuple_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_scalar_vector_subquery]": [
+ {
+ "checksum": "42ee2811cea6b9225e68b4ac96bbf777",
+ "size": 16343,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_scalar_vector_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_sorted]": [
+ {
+ "checksum": "56a1f563729c33451454b0f2d1c6c91b",
+ "size": 2094,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_sorted_by_tuple]": [
+ {
+ "checksum": "e91a697f0875e301353b69a0e34220bf",
+ "size": 3117,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_sorted_by_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_tablesource_on_raw_list]": [
+ {
+ "checksum": "7460a1ed8db9b785ae1e32d93c36e86b",
+ "size": 1932,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_tablesource_on_raw_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_tablesource_to_equijoin]": [
+ {
+ "checksum": "2396b935a431f67b27a16ca3b8afa4ca",
+ "size": 7295,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_tablesource_to_equijoin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_tuple_check0_fail]": [
+ {
+ "checksum": "0df1ee0c00e1e857c533dc65d1033f91",
+ "size": 1141,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_tuple_check0_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_tuple_check1_fail]": [
+ {
+ "checksum": "90ec641d6fda54572570706cae9bfcff",
+ "size": 1110,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_tuple_check1_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_tuple_table]": [
+ {
+ "checksum": "99cae6b29831c2e07c1866de5b8c8c97",
+ "size": 1174,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_tuple_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_types_cast]": [
+ {
+ "checksum": "9c4333d08ae0241f3d77963ee2724c9a",
+ "size": 1319,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_types_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_types_cast_all]": [
+ {
+ "checksum": "9223dcbc3a81051066e5bd99444f0465",
+ "size": 1351,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_types_cast_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_cast]": [
+ {
+ "checksum": "f5a37337aa6769b24b0997cee47d3010",
+ "size": 2211,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_list_dict]": [
+ {
+ "checksum": "d53e40714677dde769cf2102719c0819",
+ "size": 1749,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_list_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_literal_list_of_structs]": [
+ {
+ "checksum": "265538d0e5ce509e29901ba32047ded7",
+ "size": 1118,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_literal_list_of_structs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_literal_list_of_structs_ansi]": [
+ {
+ "checksum": "ac4a50aab86f23d467a5d4319bc9bbe1",
+ "size": 1112,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_literal_list_of_structs_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_nulls_and_optionals]": [
+ {
+ "checksum": "f412e4814e6444a653044b17b4d8efd4",
+ "size": 5595,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_nulls_and_optionals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_nulls_and_optionals_extra]": [
+ {
+ "checksum": "848a2526e8c9ca3255164d51a58535a4",
+ "size": 2583,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_nulls_and_optionals_extra_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_nulls_and_optionals_extra_ansi]": [
+ {
+ "checksum": "f8a7d6f0539cbc6f66d109f0989d31d0",
+ "size": 2647,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_nulls_and_optionals_extra_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_opt_tuple]": [
+ {
+ "checksum": "d31ab7ab2c7f7a7ebb744282f7eec81b",
+ "size": 1426,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_opt_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_table_of_tuples]": [
+ {
+ "checksum": "9fdd04bda10e5963c92c6bdeafb30f9c",
+ "size": 3004,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_table_of_tuples_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_tuple]": [
+ {
+ "checksum": "34c0d876e63d90574dba92d19185ddb7",
+ "size": 1508,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-in_with_tuple_simple]": [
+ {
+ "checksum": "a10bfe6640f7852c51b73fcf36be304f",
+ "size": 1067,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_tuple_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-large_in_YQL-19183]": [
+ {
+ "checksum": "1cd9f4cf26e7c5d827049443279a962a",
+ "size": 1235,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql2yql.test_in-large_in_YQL-19183_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-small_in_YQL-19183]": [
+ {
+ "checksum": "6e299275dd6fa3e68a43e108e0c6faad",
+ "size": 1074,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql2yql.test_in-small_in_YQL-19183_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-yql-10038]": [
+ {
+ "checksum": "42fe9dcb55e5dd5e0bc4ad7904bb270c",
+ "size": 3577,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-yql-10038_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-yql-14677]": [
+ {
+ "checksum": "4d0fc41637b1d32fe17be3d8e5f72e16",
+ "size": 2118,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-yql-14677_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-after_group_by]": [
+ {
+ "checksum": "d902f0380bcaabed7aa4dfdea9fdd0b6",
+ "size": 1692,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-after_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-anonymous_tables]": [
+ {
+ "checksum": "f14ba8b0ffda118de2c7cf925f9d23f9",
+ "size": 4553,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-anonymous_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-append]": [
+ {
+ "checksum": "6e02426ad7ddd42f68264f2e7361061e",
+ "size": 1106,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-append_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-append_after_replace]": [
+ {
+ "checksum": "5be69473ed53788956ec2325d856c171",
+ "size": 2941,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-append_after_replace_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-append_missing_null]": [
+ {
+ "checksum": "4f6905db16ba9445e427518aa02aaebc",
+ "size": 2740,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-append_missing_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-append_sorted]": [
+ {
+ "checksum": "10865e639dee26d8703b2bae2b2c0bec",
+ "size": 7942,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-append_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-double_append_to_anonymous]": [
+ {
+ "checksum": "3365759278a1fc82f47bf9b247cbf40b",
+ "size": 2891,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-double_append_to_anonymous_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-drop_sortness]": [
+ {
+ "checksum": "04cdb78f48ad1e6740caa03edb3898c3",
+ "size": 1074,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-drop_sortness_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-fail_read_view_after_modify]": [
+ {
+ "checksum": "dfe6da01f192242c0a536a4425c4cbc3",
+ "size": 2096,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-fail_read_view_after_modify_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-from_two_sorted_by_calc]": [
+ {
+ "checksum": "bb6db46b049a51d766515c1508f4c685",
+ "size": 4174,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-from_two_sorted_by_calc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-insert_from_other]": [
+ {
+ "checksum": "d5fb36d29981a2435a244e8909120bd1",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-insert_from_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-insert_null]": [
+ {
+ "checksum": "54e2cd203094736c8fcfb116349f3244",
+ "size": 930,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-insert_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-insert_relabeled]": [
+ {
+ "checksum": "38ce4e2c66a6212ac6c1d8b964270c2d",
+ "size": 1582,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-insert_relabeled_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-keepmeta]": [
+ {
+ "checksum": "8b829b6434835296e73408e955355ca4",
+ "size": 1120,
+ "uri": "https://{canondata_backend}/212715/297d47f4f676b8e994e99293fc91643b6d66984d/resource.tar.gz#test_sql2yql.test_insert-keepmeta_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-literals_to_string]": [
+ {
+ "checksum": "2166c3898858efe4aacfd2961efe5045",
+ "size": 641,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-literals_to_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-merge_publish]": [
+ {
+ "checksum": "d775ca3d81ee2853efeadf9ecf51f9c8",
+ "size": 7140,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-merge_publish_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-multiappend_sorted]": [
+ {
+ "checksum": "22a97dea7493fc2b8b1539655d75a815",
+ "size": 13890,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-multiappend_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-override]": [
+ {
+ "checksum": "d5fb36d29981a2435a244e8909120bd1",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-override_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-part_sortness]": [
+ {
+ "checksum": "e68353148f13a7416a6002e25708d5bc",
+ "size": 1214,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-part_sortness_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-replace_inferred]": [
+ {
+ "checksum": "cacc650b5ed0a5c0dbee56f6f6cb09f8",
+ "size": 1301,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-replace_inferred_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-replace_inferred_op]": [
+ {
+ "checksum": "1a6265f6c8a61269870d572c77f63945",
+ "size": 1296,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-replace_inferred_op_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-replace_ordered_by_key]": [
+ {
+ "checksum": "128782769fe5c318f1585cae38e05d04",
+ "size": 1613,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-replace_ordered_by_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-replace_ordered_by_key_desc]": [
+ {
+ "checksum": "a888585fc144445c72f6eefa03a9e031",
+ "size": 1614,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-replace_ordered_by_key_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_after_insert_relabeled]": [
+ {
+ "checksum": "47ccab7b88bdbaeae28c872383694c83",
+ "size": 3036,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-select_after_insert_relabeled_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_after_replace]": [
+ {
+ "checksum": "cdd4f43369ce9e5ab54c98b73a407d43",
+ "size": 2811,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-select_after_replace_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_after_replace_unwrap]": [
+ {
+ "checksum": "8760919c6cbcee37e0d934f067ece888",
+ "size": 2918,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-select_after_replace_unwrap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_operate_with_columns]": [
+ {
+ "checksum": "e1495b9c585a6568be3867bf23ddaea4",
+ "size": 1616,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_insert-select_operate_with_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_relabel]": [
+ {
+ "checksum": "6316d3707c51d31fa119210c4b7e4b34",
+ "size": 1541,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-select_relabel_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_subquery]": [
+ {
+ "checksum": "e83e249647d06d14dac1a96ef004e154",
+ "size": 1911,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-select_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-select_with_sort_limit]": [
+ {
+ "checksum": "73b72dddded41e296d93e095e06d17d4",
+ "size": 1256,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-select_with_sort_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-trivial_literals]": [
+ {
+ "checksum": "4a2c347d8c5bf1e2d408624361afc8f7",
+ "size": 621,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-trivial_literals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-trivial_literals_multirow]": [
+ {
+ "checksum": "4739d560475b8fdd41e3e4dadc22c9e4",
+ "size": 797,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-trivial_literals_multirow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-trivial_select]": [
+ {
+ "checksum": "fef11a16771df53d40fda6fafddaa4b1",
+ "size": 1550,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-trivial_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-two_input_tables]": [
+ {
+ "checksum": "a77d1c3f57fcc9675c73bd14bd76c9b0",
+ "size": 2867,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-two_input_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-udf_empty]": [
+ {
+ "checksum": "deb6419bdaeae93d6dd73fadb34a3ab1",
+ "size": 806,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-udf_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-unique_distinct_hints]": [
+ {
+ "checksum": "612cefd5a5f6d7b10a69e5b7c690c61a",
+ "size": 8697,
+ "uri": "https://{canondata_backend}/1946324/0baf96cbe0e264fceeba707a8c23c220f2a8ab83/resource.tar.gz#test_sql2yql.test_insert-unique_distinct_hints_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-use_anon_table_before_commit_fail]": [
+ {
+ "checksum": "ada894f798fdb1f818c11c1ed47c1d49",
+ "size": 1945,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-use_anon_table_before_commit_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-use_anon_table_without_fill_fail]": [
+ {
+ "checksum": "aad9182462be8e78ae215fd4991c6a14",
+ "size": 1091,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_insert-use_anon_table_without_fill_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-values_subquery]": [
+ {
+ "checksum": "9af163610db767ed418388e4710434dc",
+ "size": 1498,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_insert-values_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-yql-13083]": [
+ {
+ "checksum": "0e940c91d9d1efa6f87144020f00bd31",
+ "size": 4770,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-yql-13083_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert-yql-14538]": [
+ {
+ "checksum": "72719b9f27885c7a8a71fe187e681cb9",
+ "size": 2672,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_insert-yql-14538_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-break_sort_fail]": [
+ {
+ "checksum": "ac0323cbab712f88e762a83220601a8b",
+ "size": 1127,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-break_sort_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-break_unique_fail]": [
+ {
+ "checksum": "e4c9994a9678cd1511baca6f9d115e53",
+ "size": 1330,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-break_unique_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-from_empty]": [
+ {
+ "checksum": "f6858e006f03ee8c92b4d8e85214ce38",
+ "size": 1255,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-from_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-keep_meta]": [
+ {
+ "checksum": "9ce9b218519482968239dea52a349c1e",
+ "size": 1265,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-keep_meta_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-keep_unique]": [
+ {
+ "checksum": "17a907666e4fa376bb81e1f83dd4e3ec",
+ "size": 1716,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-keep_unique_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-non_existing_fail]": [
+ {
+ "checksum": "7af621602361ead97cc8ae0890fdbf3a",
+ "size": 1022,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-non_existing_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-not_all_fail]": [
+ {
+ "checksum": "6bcd2e64387ba05705e7c0f1364763e2",
+ "size": 2248,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-not_all_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-overlaping_fail]": [
+ {
+ "checksum": "196939bf1159c1ccb17b9eb31e8d5fa5",
+ "size": 1250,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-overlaping_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-several1]": [
+ {
+ "checksum": "3f0d65f60bbed90c558396826eeb49c6",
+ "size": 2425,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-several1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-several2]": [
+ {
+ "checksum": "e12148d6ba87c1a4e794a03c0b5fd1f8",
+ "size": 2268,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-several2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-to_empty]": [
+ {
+ "checksum": "ad49f836aa72266cb0c3d68d7802f2bd",
+ "size": 1255,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-to_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-truncate_and_append]": [
+ {
+ "checksum": "38cf7d77a924daef6181b235e8b30c44",
+ "size": 2247,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-truncate_and_append_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[insert_monotonic-truncate_fail]": [
+ {
+ "checksum": "fd8b49b167565407555267e398279fc2",
+ "size": 1249,
+ "uri": "https://{canondata_backend}/1937424/7de0e5d5dc9721c4b618f99f516799e0aaaa7b1e/resource.tar.gz#test_sql2yql.test_insert_monotonic-truncate_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-aggr_diff_order]": [
+ {
+ "checksum": "2a9f8dfa527f2a0b28a34250ed702365",
+ "size": 3957,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-aggr_diff_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-alias_where_group]": [
+ {
+ "checksum": "437e069b42f5be8056ae1e687afa564f",
+ "size": 2048,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-alias_where_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-anyjoin_common_dup]": [
+ {
+ "checksum": "ef68815e2c28729f9f2f3440d14e97ca",
+ "size": 5433,
+ "uri": "https://{canondata_backend}/1784117/7b40c8bc89d621b5f023787bed20d97e19f45312/resource.tar.gz#test_sql2yql.test_join-anyjoin_common_dup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-anyjoin_common_nodata_keys]": [
+ {
+ "checksum": "e409e0d36fe592446eab893d7f5b72ce",
+ "size": 6934,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-anyjoin_common_nodata_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-anyjoin_common_nodup]": [
+ {
+ "checksum": "ef68815e2c28729f9f2f3440d14e97ca",
+ "size": 5433,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-anyjoin_common_nodup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-anyjoin_merge_nodup]": [
+ {
+ "checksum": "9eb9f08d5b5c3cb053e6a9b78ff1ba47",
+ "size": 5529,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-anyjoin_merge_nodup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_dis_in]": [
+ {
+ "checksum": "a2220a9990e1407c7dace561755ac139",
+ "size": 3794,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-bush_dis_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_dis_in_in]": [
+ {
+ "checksum": "ddcaef8907480aa7cf5f63a38e80d80f",
+ "size": 2321,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-bush_dis_in_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_dis_in_in_in]": [
+ {
+ "checksum": "1fb4ca33baebcf84933652408f51dacb",
+ "size": 2788,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-bush_dis_in_in_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_in]": [
+ {
+ "checksum": "820d25cbb37491c009ffd843f9fdfb94",
+ "size": 3626,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-bush_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_in_in]": [
+ {
+ "checksum": "c5fc750682fec2f1b0d3456e9843e19b",
+ "size": 2241,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-bush_in_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-bush_in_in_in]": [
+ {
+ "checksum": "abd1bd30965302760186a8ae82f5b815",
+ "size": 2529,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-bush_in_in_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-cbo_4tables]": [
+ {
+ "checksum": "1259880de97a6753985e841e2e0fca8e",
+ "size": 3360,
+ "uri": "https://{canondata_backend}/1937367/865cf26569bab3fead160e174e7798fb2cbf37bf/resource.tar.gz#test_sql2yql.test_join-cbo_4tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-cbo_4tables_only_sorted_merge]": [
+ {
+ "checksum": "3d6c4b81801d581fd7df5db4ed71e607",
+ "size": 3452,
+ "uri": "https://{canondata_backend}/1937367/865cf26569bab3fead160e174e7798fb2cbf37bf/resource.tar.gz#test_sql2yql.test_join-cbo_4tables_only_sorted_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-commonjoin_unused_keys]": [
+ {
+ "checksum": "9c07ade76c1e3f31cd5c478dcb4e4300",
+ "size": 1662,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-commonjoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-compact_join]": [
+ {
+ "checksum": "d0db423922298a4d9b1078bf34a87872",
+ "size": 2976,
+ "uri": "https://{canondata_backend}/1936842/930bd723eace8a4b1e0bee570e57292f99293f11/resource.tar.gz#test_sql2yql.test_join-compact_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-convert_check_key_mem2]": [
+ {
+ "checksum": "8274e24ae6aeca074ea8e055f98eebbb",
+ "size": 1814,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-convert_check_key_mem2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-convert_check_key_mem]": [
+ {
+ "checksum": "2bb677baa975580457cffaa716a1cf59",
+ "size": 7018,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-convert_check_key_mem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-convert_key]": [
+ {
+ "checksum": "61ab6081df91533e81682b45fe38e28e",
+ "size": 3669,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-convert_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-count_bans]": [
+ {
+ "checksum": "aa148597bf43e64a4d04782c63ffddaf",
+ "size": 5265,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_join-count_bans_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-cross_join_with_lazy_list]": [
+ {
+ "checksum": "d7bafc1351a4b13942b311a0107148c3",
+ "size": 2530,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-cross_join_with_lazy_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-do_not_suppres_equijoin_input_sorts]": [
+ {
+ "checksum": "f0414b010a5b710a7b4e40eb58c281a6",
+ "size": 1677,
+ "uri": "https://{canondata_backend}/1942415/648a56e0787ca3112c139c169f33c33294672c1c/resource.tar.gz#test_sql2yql.test_join-do_not_suppres_equijoin_input_sorts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-emptyjoin_unused_keys]": [
+ {
+ "checksum": "a10f3ec3492bdb510c3dbdf0892a77d4",
+ "size": 2748,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-emptyjoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-equi_join_by_expr]": [
+ {
+ "checksum": "6aa7d34bfe998ae0fe30161c93b0b04c",
+ "size": 2006,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-equi_join_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-equi_join_three_asterisk]": [
+ {
+ "checksum": "0ab31bd25c3bbd14a502f344980942f1",
+ "size": 2020,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-equi_join_three_asterisk_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-equi_join_three_asterisk_eval]": [
+ {
+ "checksum": "cac1de144f59cf0fcbe0adabe2eb60ec",
+ "size": 2361,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-equi_join_three_asterisk_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-equi_join_three_simple]": [
+ {
+ "checksum": "8eeaf78ecc9b34e0f419878bc0c55bf3",
+ "size": 1618,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-equi_join_three_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-equi_join_two_mult_keys]": [
+ {
+ "checksum": "985f4512a5f58d839ad46a93e2051527",
+ "size": 1421,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-equi_join_two_mult_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-filter_joined]": [
+ {
+ "checksum": "5d8b9da1868f84f8907e054db56ffe0a",
+ "size": 1580,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-filter_joined_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-flatten_columns1]": [
+ {
+ "checksum": "d02d266bb09e9fbc4f1dcb7bf6b271cd",
+ "size": 2501,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_join-flatten_columns1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-flatten_columns2]": [
+ {
+ "checksum": "a0eec7b654d4e9fa5ceb99f847c36edf",
+ "size": 3505,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_join-flatten_columns2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-force_merge_join]": [
+ {
+ "checksum": "216e28d75c262e3b82cfc1e791447035",
+ "size": 3039,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-force_merge_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-from_in_front_join]": [
+ {
+ "checksum": "289482bc77beaa59bc33ec86e0f2cc82",
+ "size": 1808,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-from_in_front_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-full_equal_not_null]": [
+ {
+ "checksum": "be8e8e47f100e6547e61a729f2faa38b",
+ "size": 2889,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-full_equal_not_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-full_equal_null]": [
+ {
+ "checksum": "bdf002c2f10bd0a1b276cf0c4b36e2e8",
+ "size": 2887,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-full_equal_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-full_join]": [
+ {
+ "checksum": "fd8ee28745d772314f616f9d9d8bfe1b",
+ "size": 2105,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-full_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-full_trivial]": [
+ {
+ "checksum": "b88e458c8c131626851a75c748df845c",
+ "size": 1991,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-full_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-full_trivial_udf_call]": [
+ {
+ "checksum": "b98adb7b54e9e23501a67af30bd98e77",
+ "size": 2118,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-full_trivial_udf_call_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-grace_join1]": [
+ {
+ "checksum": "f4b25e38fea28e0ab9a5af8bbe593905",
+ "size": 1807,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-grace_join1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-grace_join2]": [
+ {
+ "checksum": "dec15765d9200297261bb22775ec5338",
+ "size": 1782,
+ "uri": "https://{canondata_backend}/1871182/e726c72e47d3c077e5ba351b53dba460544020da/resource.tar.gz#test_sql2yql.test_join-grace_join2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-group_compact_by]": [
+ {
+ "checksum": "567c4ddde19bc24dbae0fec1213fedb7",
+ "size": 3927,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-group_compact_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inmem_by_uncomparable_structs]": [
+ {
+ "checksum": "8fcbc90571cb94cda4999577d08a613b",
+ "size": 14185,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-inmem_by_uncomparable_structs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inmem_by_uncomparable_tuples]": [
+ {
+ "checksum": "a77e22fe041aaad5198a189340883360",
+ "size": 12547,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-inmem_by_uncomparable_tuples_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inmem_with_null_key]": [
+ {
+ "checksum": "ee00f9e844f422215f5168a0e9984fc0",
+ "size": 2485,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inmem_with_null_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inmem_with_set_key]": [
+ {
+ "checksum": "356483957a90979c5f12afd429ce6dd0",
+ "size": 4505,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-inmem_with_set_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inmem_with_set_key_any]": [
+ {
+ "checksum": "74d8117ccac1ce8348846cda0fdf54f6",
+ "size": 4561,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-inmem_with_set_key_any_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_all]": [
+ {
+ "checksum": "3bc919dcd33db69be52c00362c3ca445",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inner_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_all_right]": [
+ {
+ "checksum": "df9820ad7ef49b66df3aad751b4307b7",
+ "size": 1417,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inner_all_right_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_grouped]": [
+ {
+ "checksum": "cf4f5a2d8946a2f18c6a5e51601e5d2e",
+ "size": 1852,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_join-inner_grouped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_grouped_by_expr]": [
+ {
+ "checksum": "0e91419d829004c6a4069d9d1ba417c1",
+ "size": 1969,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_join-inner_grouped_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_on_key_only]": [
+ {
+ "checksum": "289482bc77beaa59bc33ec86e0f2cc82",
+ "size": 1808,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inner_on_key_only_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_trivial]": [
+ {
+ "checksum": "289482bc77beaa59bc33ec86e0f2cc82",
+ "size": 1808,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inner_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_trivial_from_concat]": [
+ {
+ "checksum": "a3a26ffab8bef6946c949123e747d6c2",
+ "size": 1768,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-inner_trivial_from_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_with_order]": [
+ {
+ "checksum": "a4ae4ea6e868bc1b72e9817151159714",
+ "size": 1848,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-inner_with_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-inner_with_select]": [
+ {
+ "checksum": "22090e59950ee30a220a609cd3dc7589",
+ "size": 2484,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-inner_with_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_and_distinct_key]": [
+ {
+ "checksum": "76ca04b797a63d1f7048625e9a03d8d7",
+ "size": 2552,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-join_and_distinct_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_cbo_3_tables]": [
+ {
+ "checksum": "ade505b64c963c1a666fadfa8b67ae84",
+ "size": 2714,
+ "uri": "https://{canondata_backend}/1781765/dbe51ae4718e452cc12eafc7b8ca560fa9869fde/resource.tar.gz#test_sql2yql.test_join-join_cbo_3_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_comp_common_table]": [
+ {
+ "checksum": "0c6169a2dbf9b9490476a334b12893ce",
+ "size": 11137,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-join_comp_common_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_comp_inmem]": [
+ {
+ "checksum": "42d93bbb3df871e13d55cd3112f0e424",
+ "size": 10100,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-join_comp_inmem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_comp_map_table]": [
+ {
+ "checksum": "d6de5082fe8a591866a779a70609d42c",
+ "size": 8375,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-join_comp_map_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_key_cmp_udf]": [
+ {
+ "checksum": "5d1c5a97ebc3f3805dda35bb6930e4b3",
+ "size": 1924,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-join_key_cmp_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_left_cbo]": [
+ {
+ "checksum": "4bfc0f9649300fa6c4d2daab376e06de",
+ "size": 1793,
+ "uri": "https://{canondata_backend}/212715/9a8a02a2422f3392977e52a3a03ce9a5b32e849e/resource.tar.gz#test_sql2yql.test_join-join_left_cbo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_no_correlation_in_order_by]": [
+ {
+ "checksum": "dc3093c5fe8c857da181192160c3d97c",
+ "size": 2535,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-join_no_correlation_in_order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_right_cbo]": [
+ {
+ "checksum": "d69c6e50ec981ad24ac25c121958aee7",
+ "size": 1794,
+ "uri": "https://{canondata_backend}/212715/9a8a02a2422f3392977e52a3a03ce9a5b32e849e/resource.tar.gz#test_sql2yql.test_join-join_right_cbo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_semi_correlation_in_order_by]": [
+ {
+ "checksum": "d3bd93064f519233a5e9035fb006b514",
+ "size": 2540,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-join_semi_correlation_in_order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_table_conflict_fail]": [
+ {
+ "checksum": "a69e585c088947225d76ba67d9979627",
+ "size": 2601,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-join_table_conflict_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_with_duplicate_keys_on_sorted]": [
+ {
+ "checksum": "efe22bf047b2f9b9874e4aaf7def87dc",
+ "size": 1767,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-join_with_duplicate_keys_on_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_without_column]": [
+ {
+ "checksum": "b83242080fac105a1bd56b8bb364f4d3",
+ "size": 2908,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-join_without_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_without_correlation_and_dict_access]": [
+ {
+ "checksum": "1e6db073f9f6e22e971627840feae674",
+ "size": 4204,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_join-join_without_correlation_and_dict_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_without_correlation_and_struct_access]": [
+ {
+ "checksum": "ae9914e55e62557ec9539b952b024209",
+ "size": 3278,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-join_without_correlation_and_struct_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-join_without_correlation_names]": [
+ {
+ "checksum": "7aba7a4f99a49f46476236b1e82472eb",
+ "size": 2980,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-join_without_correlation_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-late_mergejoin_on_empty]": [
+ {
+ "checksum": "eced72f1eb0fa388af5509d90e4920af",
+ "size": 3608,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-late_mergejoin_on_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_all]": [
+ {
+ "checksum": "204234876da61f08739c6338d0216e6a",
+ "size": 1404,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-left_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_cast_to_string]": [
+ {
+ "checksum": "f098898910077a6450726edaca93d6a8",
+ "size": 1862,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-left_cast_to_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_null_column]": [
+ {
+ "checksum": "c4c01790686a2003fafaf1175b81edbf",
+ "size": 1611,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-left_join_null_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_right_pushdown_nested_left]": [
+ {
+ "checksum": "469debe145964a01898be300d70ed85e",
+ "size": 2858,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql2yql.test_join-left_join_right_pushdown_nested_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_right_pushdown_nested_right]": [
+ {
+ "checksum": "8cd6ad5bcca532b8e70b63e0d27d993d",
+ "size": 2834,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql2yql.test_join-left_join_right_pushdown_nested_right_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_right_pushdown_no_opt]": [
+ {
+ "checksum": "94826bac701dae8632d31948ca6cf76f",
+ "size": 2586,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql2yql.test_join-left_join_right_pushdown_no_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_right_pushdown_null]": [
+ {
+ "checksum": "8da95818d3fe5667e6021b84de184e1b",
+ "size": 2580,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql2yql.test_join-left_join_right_pushdown_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_right_pushdown_simple]": [
+ {
+ "checksum": "71f0484c045f69fe61bfccfa88538f46",
+ "size": 1628,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql2yql.test_join-left_join_right_pushdown_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_join_with_self_aggr]": [
+ {
+ "checksum": "e0818e4300c6a61a98e5ff03bccf705a",
+ "size": 4401,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_join-left_join_with_self_aggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_null_literal]": [
+ {
+ "checksum": "42bdd1c141f286ec37447a13830096a8",
+ "size": 1425,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-left_null_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_only_semi_and_other]": [
+ {
+ "checksum": "a6534c06f970f4558812040ebba2fb2d",
+ "size": 3441,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-left_only_semi_and_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_only_with_other]": [
+ {
+ "checksum": "4613bf6983de2e51ec1648652a831b6b",
+ "size": 3287,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-left_only_with_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_semi_with_other]": [
+ {
+ "checksum": "71cf947217ccf35ab1059fbacf1c679b",
+ "size": 3345,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-left_semi_with_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-left_trivial]": [
+ {
+ "checksum": "1e0f4691d3c359bddce8e658b2e015a2",
+ "size": 1870,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-left_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_bug7646_csee]": [
+ {
+ "checksum": "4ea61f39ad900d5b3ac439f89c105fe1",
+ "size": 4719,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_bug7646_csee_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_bug7646_subst]": [
+ {
+ "checksum": "dbc7bf22f96df024adf2b8d9ff4944f0",
+ "size": 4608,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_bug7646_subst_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_bug8533]": [
+ {
+ "checksum": "5ad57f3e5fa6c29b45784bff3de44de6",
+ "size": 1599,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_bug8533_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_inner]": [
+ {
+ "checksum": "1575e2b33838a426960718ded059645f",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_inner_1o2o]": [
+ {
+ "checksum": "1575e2b33838a426960718ded059645f",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_inner_1o2o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_inner_1o]": [
+ {
+ "checksum": "1575e2b33838a426960718ded059645f",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_inner_1o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_inner_2o]": [
+ {
+ "checksum": "1575e2b33838a426960718ded059645f",
+ "size": 1607,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_inner_2o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_inner_empty_subq]": [
+ {
+ "checksum": "584a41220a4881c979e228d08abddd36",
+ "size": 2227,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_inner_empty_subq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_not_selected]": [
+ {
+ "checksum": "0cdba4cf2f1a6abaf1fa18dbe9144358",
+ "size": 1584,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-lookupjoin_not_selected_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi]": [
+ {
+ "checksum": "9f451e1110c89f2ebc91f8ec3e116d09",
+ "size": 1645,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi_1o2o]": [
+ {
+ "checksum": "9f451e1110c89f2ebc91f8ec3e116d09",
+ "size": 1645,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_1o2o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi_1o]": [
+ {
+ "checksum": "9f451e1110c89f2ebc91f8ec3e116d09",
+ "size": 1645,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_1o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi_2o]": [
+ {
+ "checksum": "9f451e1110c89f2ebc91f8ec3e116d09",
+ "size": 1645,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_2o_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi_empty]": [
+ {
+ "checksum": "9f451e1110c89f2ebc91f8ec3e116d09",
+ "size": 1645,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_semi_subq]": [
+ {
+ "checksum": "69757d8d41190440583cbcd570100069",
+ "size": 2278,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-lookupjoin_semi_subq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_take_skip]": [
+ {
+ "checksum": "0d9a5940582e119c4bf0d2c99b796fb5",
+ "size": 4430,
+ "uri": "https://{canondata_backend}/1936997/a4fb1650ba6f8c54af3ca9cd217fe3accf7ae1bc/resource.tar.gz#test_sql2yql.test_join-lookupjoin_take_skip_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_unused_keys]": [
+ {
+ "checksum": "90e5e5d306d0f031da197bdbdba1a06c",
+ "size": 1848,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-lookupjoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-lookupjoin_with_cache]": [
+ {
+ "checksum": "2a0ad394924f871724d864cea99e0bad",
+ "size": 2991,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-lookupjoin_with_cache_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_dup_key]": [
+ {
+ "checksum": "98efb9c4a17ddf5c07f7dc835e22df49",
+ "size": 1516,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_dup_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_early_rewrite]": [
+ {
+ "checksum": "4d9bb499795360618e6b0a77bd93b559",
+ "size": 2268,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-mapjoin_early_rewrite_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_early_rewrite_sequence]": [
+ {
+ "checksum": "0aaa0029df2374a0e6f2cc6fed941baa",
+ "size": 2658,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-mapjoin_early_rewrite_sequence_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_early_rewrite_star]": [
+ {
+ "checksum": "49a90c30fdbd2ebaf77dccc4525756e5",
+ "size": 2364,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-mapjoin_early_rewrite_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_left_null_column]": [
+ {
+ "checksum": "c89d66b775b4f791c338d3c7447cda84",
+ "size": 1699,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_left_null_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_complex_type_non_optional_left_only_single]": [
+ {
+ "checksum": "82b43a2aec72ba8aadd955b4f323c699",
+ "size": 2498,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_complex_type_non_optional_left_only_single_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_complex_type_optional_left_only_single]": [
+ {
+ "checksum": "e4598373b99e87103b1c0e21a49eb1bd",
+ "size": 2401,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_complex_type_optional_left_only_single_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_complex_type_optional_left_semi_many]": [
+ {
+ "checksum": "51ad59f5bd9e509aac5c6da9d06a909f",
+ "size": 3072,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_complex_type_optional_left_semi_many_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_complex_type_optional_left_semi_single]": [
+ {
+ "checksum": "82633006d8e59122ee798f231648bdb5",
+ "size": 2401,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_complex_type_optional_left_semi_single_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_tablerecord]": [
+ {
+ "checksum": "32dcdccef59e780e6591f5e2f2f9420b",
+ "size": 2989,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_tablerecord_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_on_very_complex_type]": [
+ {
+ "checksum": "0784be1edeaa4750af97d31ba8be9cd0",
+ "size": 2664,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mapjoin_on_very_complex_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_opt_vs_2xopt]": [
+ {
+ "checksum": "ed9c6b26f3cdfedb8cfb1cf7eee42480",
+ "size": 3536,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_opt_vs_2xopt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_partial_uniq_keys]": [
+ {
+ "checksum": "f7a1e14a1ebed9eaf2595bbd93859e8b",
+ "size": 3160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_partial_uniq_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_sharded]": [
+ {
+ "checksum": "ae048bbfd721aca7205c0ad11833c878",
+ "size": 1621,
+ "uri": "https://{canondata_backend}/1937492/a69a7a5184e0b69e632fef2497379a5939343b15/resource.tar.gz#test_sql2yql.test_join-mapjoin_sharded_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_unused_keys]": [
+ {
+ "checksum": "ee6bd6e89763b5d2def73af5cbe2fca2",
+ "size": 1871,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-mapjoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_with_anonymous]": [
+ {
+ "checksum": "c7a781f89d3ae79a0e5b0dd0bbc2d89d",
+ "size": 2507,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_with_anonymous_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_with_empty_read]": [
+ {
+ "checksum": "00e4aee0192f523875e81fb7d4ea768b",
+ "size": 5403,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mapjoin_with_empty_read_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mapjoin_with_empty_struct]": [
+ {
+ "checksum": "2da245b3c72a68a3d9b4f5cdd7c8b8b7",
+ "size": 2065,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-mapjoin_with_empty_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_any_no_join_reduce]": [
+ {
+ "checksum": "3a696c5ea903af43b883a83719923f4a",
+ "size": 2894,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mergejoin_any_no_join_reduce_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_big_primary]": [
+ {
+ "checksum": "2e8a3fc71832ba15fd9f8a2fca8e9986",
+ "size": 1821,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_big_primary_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_big_primary_unique]": [
+ {
+ "checksum": "014c21c50208cd8e0756de0b9b86da59",
+ "size": 1722,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mergejoin_big_primary_unique_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_choose_primary]": [
+ {
+ "checksum": "64bb3cb806859351c15211722a7de778",
+ "size": 1716,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_choose_primary_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_choose_primary_with_retry]": [
+ {
+ "checksum": "13a8663a5f9b9c95a04c1918d5673f0a",
+ "size": 1816,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_choose_primary_with_retry_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_align1]": [
+ {
+ "checksum": "84bad0739a42330e18b116c03d27cf31",
+ "size": 6601,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_align1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_align2]": [
+ {
+ "checksum": "44f13f21de8dbc717f787fda5501b3f1",
+ "size": 4274,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_align2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_align3]": [
+ {
+ "checksum": "d19b740bca82660791e1110e2f8340a5",
+ "size": 3354,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_align3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_no_sorted]": [
+ {
+ "checksum": "08203249c2c1ecde9f684e345b2d5632",
+ "size": 1637,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_no_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_one_sorted]": [
+ {
+ "checksum": "0de5673c4d6fb82ebadc03ac26c1afac",
+ "size": 1739,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_one_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_force_per_link]": [
+ {
+ "checksum": "3949e1b0238222a22451cf72ecc5d853",
+ "size": 2568,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_force_per_link_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_left_null_column]": [
+ {
+ "checksum": "5da4f194dc060db5c2adb817a902bf94",
+ "size": 1905,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_join-mergejoin_left_null_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_narrows_output_sort]": [
+ {
+ "checksum": "77338ab4437733640966a1a9a1d0870e",
+ "size": 2071,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_narrows_output_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_saves_output_sort]": [
+ {
+ "checksum": "9f7b74c6ed6634edec85468ab4952109",
+ "size": 14481,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_saves_output_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_saves_output_sort_cross]": [
+ {
+ "checksum": "0e267b41c8a532219b461cf3f0ae4700",
+ "size": 2586,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_saves_output_sort_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_saves_output_sort_nested]": [
+ {
+ "checksum": "3ea2ef45dfabc180e2a75d194525fbb6",
+ "size": 2837,
+ "uri": "https://{canondata_backend}/1936947/7dabc5ea0642eb49e4a3155ef894e1670ac842fb/resource.tar.gz#test_sql2yql.test_join-mergejoin_saves_output_sort_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_saves_output_sort_unmatched]": [
+ {
+ "checksum": "0efba072937fd539eb7198ed2a648de3",
+ "size": 2070,
+ "uri": "https://{canondata_backend}/1936947/7dabc5ea0642eb49e4a3155ef894e1670ac842fb/resource.tar.gz#test_sql2yql.test_join-mergejoin_saves_output_sort_unmatched_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_semi_composite_to_inner]": [
+ {
+ "checksum": "dc1915046d815a8ad4b55dba0ea353ca",
+ "size": 3034,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-mergejoin_semi_composite_to_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_semi_to_inner]": [
+ {
+ "checksum": "a3ddbe87848267d0252dee013ab04768",
+ "size": 1834,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_semi_to_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_small_primary]": [
+ {
+ "checksum": "7e4d450c0c133f6d651a6fde1fde4a5f",
+ "size": 1820,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_small_primary_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_sorts_output_for_sort_inner]": [
+ {
+ "checksum": "ee11ec097c252e2c75467725fa6ecb98",
+ "size": 6133,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_sorts_output_for_sort_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_sorts_output_for_sort_left]": [
+ {
+ "checksum": "4f7eeac1fba50f40d627a19b6226af1f",
+ "size": 6110,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_sorts_output_for_sort_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_sorts_output_for_sort_nomatch]": [
+ {
+ "checksum": "3d583b88ffdd3ae00c74dd9e02dcd9b5",
+ "size": 1856,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_sorts_output_for_sort_nomatch_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_sorts_output_for_sort_right]": [
+ {
+ "checksum": "31c6be0b2cd7be07a353ab5e46285496",
+ "size": 6337,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_sorts_output_for_sort_right_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_unused_keys]": [
+ {
+ "checksum": "73fbb58dbef0c846666d862ba94fff22",
+ "size": 1758,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-mergejoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_different_key_names]": [
+ {
+ "checksum": "b528166bd1029ecf19a1eaa6c1aab637",
+ "size": 5819,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_different_key_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_different_key_names_nested]": [
+ {
+ "checksum": "cd767e2a47d1bbc9dd5963164d4d5f5f",
+ "size": 2407,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_different_key_names_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_different_key_names_nonsorted]": [
+ {
+ "checksum": "71ae48419e8128b27c8e001fca455afd",
+ "size": 2784,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_different_key_names_nonsorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_different_key_names_norename]": [
+ {
+ "checksum": "03d27ea52934ce09962c1b398baf47b6",
+ "size": 5820,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_different_key_names_norename_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_reverse_key_order]": [
+ {
+ "checksum": "cb2e39942e49ef6b5fb6475211bdecda",
+ "size": 1710,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_reverse_key_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-mergejoin_with_table_range]": [
+ {
+ "checksum": "b7e916b9582bb627595470ee15d8a7f4",
+ "size": 1792,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-mergejoin_with_table_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-nested_semi_join]": [
+ {
+ "checksum": "4c7de825150b4526c53f4838046cd8e2",
+ "size": 2969,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-nested_semi_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-no_empty_join_for_dyn]": [
+ {
+ "checksum": "3e70b316b6e006d3773af69a224046f4",
+ "size": 1401,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-no_empty_join_for_dyn_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-nopushdown_filter_over_inner]": [
+ {
+ "checksum": "29eafe2a9539c94d0620728d4ad38d7d",
+ "size": 1625,
+ "uri": "https://{canondata_backend}/1809005/3ee9082e72a32fad63796f61cc848db257f9b05e/resource.tar.gz#test_sql2yql.test_join-nopushdown_filter_over_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-nopushdown_filter_with_depends_on]": [
+ {
+ "checksum": "b9f18fa338d807366729a2756ba859bd",
+ "size": 2264,
+ "uri": "https://{canondata_backend}/937458/39a58e64c44776886132495db2931deb1bb85f87/resource.tar.gz#test_sql2yql.test_join-nopushdown_filter_with_depends_on_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-opt_on_opt_side]": [
+ {
+ "checksum": "e51b11865d6ce435b11cf8de946e0369",
+ "size": 2278,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-opt_on_opt_side_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-opt_on_opt_side_with_group]": [
+ {
+ "checksum": "4056791124d317def670b1affcfcc0a0",
+ "size": 2633,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_join-opt_on_opt_side_with_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-order_of_qualified]": [
+ {
+ "checksum": "169261dba7adf7d6517650be5e664600",
+ "size": 1725,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-order_of_qualified_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_cross]": [
+ {
+ "checksum": "7b6a299d48b5e4eff00068bf893723f8",
+ "size": 3003,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_inner]": [
+ {
+ "checksum": "94649a8212ae45e417166131261cb4ea",
+ "size": 2816,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_inner_both_sides]": [
+ {
+ "checksum": "7464ed2c2a581e0556180a8f02bc5596",
+ "size": 3749,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_inner_both_sides_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_inner_filter]": [
+ {
+ "checksum": "852b333a60857902412c9404763f03b9",
+ "size": 2817,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_inner_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_left_cross]": [
+ {
+ "checksum": "c42d932f09bfd82982aefffd2b43665f",
+ "size": 4318,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_left_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_multiparents]": [
+ {
+ "checksum": "108b686b39b05ac70f1e071829b5e69c",
+ "size": 4561,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_multiparents_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_multiparents_no_premap]": [
+ {
+ "checksum": "954da1bf522e3eb073e8c463cb257f02",
+ "size": 4068,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_multiparents_no_premap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_right_tablecontent]": [
+ {
+ "checksum": "2f90991741ae4f2763bac7686f96587e",
+ "size": 4224,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_right_tablecontent_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_common_semi]": [
+ {
+ "checksum": "f66a395e63b3381bf18cd9d39243bf66",
+ "size": 3118,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_common_semi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_context_dep]": [
+ {
+ "checksum": "867e613cb70d73e39f2c9b2bd0321bc4",
+ "size": 3070,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_context_dep_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_map_cross]": [
+ {
+ "checksum": "8a052cf3355109399f84b9c7cccc949e",
+ "size": 3326,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_map_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_map_inner]": [
+ {
+ "checksum": "7b37d0b14a17bab576a4bb6c6b23fb18",
+ "size": 3236,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_map_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_map_semi]": [
+ {
+ "checksum": "8a2272b2b7b4575221930348b4c7d973",
+ "size": 2987,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_map_semi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_merge_extrasort1]": [
+ {
+ "checksum": "4f95abb66c9f02639e66bbb631b4f4d9",
+ "size": 3002,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_merge_extrasort1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_merge_extrasort2]": [
+ {
+ "checksum": "25e97b393cbdd7a69880d25f0c301fd9",
+ "size": 3618,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_merge_extrasort2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_merge_inner]": [
+ {
+ "checksum": "2624c1d2b2e3cf6723605fde4539e397",
+ "size": 3244,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_merge_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_merge_with_remap]": [
+ {
+ "checksum": "b401fcdb8f774740a791f8313f57f544",
+ "size": 4035,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_merge_with_remap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_no_premap]": [
+ {
+ "checksum": "18924308d697e84757f97c59c2848caf",
+ "size": 9699,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_no_premap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-premap_nonseq_flatmap]": [
+ {
+ "checksum": "e4e31a44eb95e34af5b9aca9f2ce6fb2",
+ "size": 2648,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-premap_nonseq_flatmap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_context_dep]": [
+ {
+ "checksum": "37258bdcc20766d5a5937ac2c605178e",
+ "size": 2982,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_context_dep_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_cross]": [
+ {
+ "checksum": "6c558284b38dcbdce9bcdd2186d6b83f",
+ "size": 2963,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_exclusion]": [
+ {
+ "checksum": "b0356d86f650a3f396a51300d56a81b4",
+ "size": 3729,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_exclusion_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_inner]": [
+ {
+ "checksum": "d55d55103be942ab018f6da9e37a7195",
+ "size": 3725,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_left]": [
+ {
+ "checksum": "ccdd92ef68987c209352d65733f5f3d6",
+ "size": 3724,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_left_semi]": [
+ {
+ "checksum": "5842337a91f762a90326f9dfe1f25630",
+ "size": 3238,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_left_semi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_null_column]": [
+ {
+ "checksum": "498b0f0b86ffbd39219fcee320eaf621",
+ "size": 2867,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_null_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_random]": [
+ {
+ "checksum": "040fd012d19366b46aeb9dbf964ceb20",
+ "size": 3043,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_random_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_renaming]": [
+ {
+ "checksum": "7c71b933e732e030df5fc51486a46e3e",
+ "size": 4167,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_renaming_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pullup_rownumber]": [
+ {
+ "checksum": "e6cbb0d312d1a27e5f2a4091c240f690",
+ "size": 3134,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-pullup_rownumber_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pushdown_filter_over_inner_with_assume_strict]": [
+ {
+ "checksum": "3e9e9605f415f2597f7fd2502fd4cae8",
+ "size": 1640,
+ "uri": "https://{canondata_backend}/1809005/3ee9082e72a32fad63796f61cc848db257f9b05e/resource.tar.gz#test_sql2yql.test_join-pushdown_filter_over_inner_with_assume_strict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pushdown_filter_over_inner_with_strict_udf]": [
+ {
+ "checksum": "f46cd2f8af823e43fa0291c2aef67212",
+ "size": 1643,
+ "uri": "https://{canondata_backend}/1775059/87582fba3a918813eef87a5915ee3133a72473f1/resource.tar.gz#test_sql2yql.test_join-pushdown_filter_over_inner_with_strict_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-pushdown_filter_over_left]": [
+ {
+ "checksum": "5cef6935277c1cf3116cbdd407ae26ad",
+ "size": 1624,
+ "uri": "https://{canondata_backend}/1809005/3ee9082e72a32fad63796f61cc848db257f9b05e/resource.tar.gz#test_sql2yql.test_join-pushdown_filter_over_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-right_trivial]": [
+ {
+ "checksum": "4192763826a82f888339915646930889",
+ "size": 1992,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-right_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-selfjoin_on_sorted]": [
+ {
+ "checksum": "5b44b48ba0a0c136030ff464b68dd4be",
+ "size": 1399,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-selfjoin_on_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-selfjoin_on_sorted_with_filter]": [
+ {
+ "checksum": "cca25c414689630cffb628aa214888e9",
+ "size": 1969,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-selfjoin_on_sorted_with_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-selfjoin_on_sorted_with_rename]": [
+ {
+ "checksum": "d7ea4a9cef5a8a812fcda6752e2d16d6",
+ "size": 1719,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-selfjoin_on_sorted_with_rename_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-simple_columns_partial]": [
+ {
+ "checksum": "99b60cf5dd1ba1be026658fc08fb3f53",
+ "size": 5776,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-simple_columns_partial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-split_to_list_as_key]": [
+ {
+ "checksum": "b1dba7b8923a56e6a7ae13b3290ed4f0",
+ "size": 2012,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-split_to_list_as_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join]": [
+ {
+ "checksum": "f46d26e89a194edf3f13494d40f246c3",
+ "size": 5139,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-star_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_inners]": [
+ {
+ "checksum": "9de4fc8caa6e5f5afd8b7a57f7137aff",
+ "size": 1933,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-star_join_inners_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_inners_premap]": [
+ {
+ "checksum": "f71fcad6156d2a24196fffb503d825a4",
+ "size": 3931,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-star_join_inners_premap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_inners_vk_sorted]": [
+ {
+ "checksum": "9de4fc8caa6e5f5afd8b7a57f7137aff",
+ "size": 1933,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-star_join_inners_vk_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_mirror]": [
+ {
+ "checksum": "5d18a6e1e4551663ac185c44a2e674a1",
+ "size": 5137,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-star_join_mirror_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_multi]": [
+ {
+ "checksum": "3ab472cdffa89e97a8a858160dc39819",
+ "size": 9467,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-star_join_multi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_semionly]": [
+ {
+ "checksum": "eabea7ab055782aec7baea456947202d",
+ "size": 1853,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-star_join_semionly_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_semionly_premap]": [
+ {
+ "checksum": "55d58b2f2d1e630047c478939434548f",
+ "size": 4807,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-star_join_semionly_premap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-star_join_with_diff_complex_key]": [
+ {
+ "checksum": "e8fecc31757cfd2ae127a34d9c4ae8ba",
+ "size": 2667,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-star_join_with_diff_complex_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-starjoin_unused_keys]": [
+ {
+ "checksum": "6593df80ce4533f26391797332da3821",
+ "size": 2068,
+ "uri": "https://{canondata_backend}/1937367/a51084eb8cdcfd382d6fa2985e7d2f3d05ca79ae/resource.tar.gz#test_sql2yql.test_join-starjoin_unused_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-strict_keys]": [
+ {
+ "checksum": "4818dbe4304bb09c0e515785a7e35121",
+ "size": 3689,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-strict_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-three_equalities]": [
+ {
+ "checksum": "c508ba193a061400af5533f8d258b5ca",
+ "size": 2122,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_join-three_equalities_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-three_equalities_paren]": [
+ {
+ "checksum": "b990085452bdb9f28660b4122aebe16e",
+ "size": 1459,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-three_equalities_paren_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-trivial_view]": [
+ {
+ "checksum": "42601eb847650ac982e41ff694f39853",
+ "size": 1638,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_join-trivial_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-two_aggrs]": [
+ {
+ "checksum": "0de67efe9db10b19e1bdc159179be958",
+ "size": 5155,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-two_aggrs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-10654_pullup_with_sys_columns]": [
+ {
+ "checksum": "9df8eeae83a3e56ecd1d239d17a79948",
+ "size": 3248,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-yql-10654_pullup_with_sys_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-12022]": [
+ {
+ "checksum": "9729e2bd6f91540bd28caef7eca7666d",
+ "size": 2397,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-12022_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-14829_left]": [
+ {
+ "checksum": "383b8bd8bd21730dc6985688ea1a138b",
+ "size": 4831,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-14829_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-14829_leftonly]": [
+ {
+ "checksum": "f4b4b6a0f185949fa7b6c7cd8e19f0f4",
+ "size": 4783,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-14829_leftonly_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-14847]": [
+ {
+ "checksum": "38c860e9a992cbf7444c78711f771efd",
+ "size": 3146,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-14847_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-16011]": [
+ {
+ "checksum": "7d09ed172ea1aae0403c9674c8cffbe5",
+ "size": 6334,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-16011_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-19081]": [
+ {
+ "checksum": "a413e3ffd94ef733fa06dd92dc938d38",
+ "size": 2396,
+ "uri": "https://{canondata_backend}/1946324/ea334656ca4ab8298f13987977529870591f2010/resource.tar.gz#test_sql2yql.test_join-yql-19081_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-4275]": [
+ {
+ "checksum": "7a7907d95d2d89a9ace4cb51778168a9",
+ "size": 2026,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-4275_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-6199]": [
+ {
+ "checksum": "d76d82265f9001f2530fbce20f059e6b",
+ "size": 4288,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-6199_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-6297]": [
+ {
+ "checksum": "2417db7edac1934476fbec8da241ad96",
+ "size": 3124,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-6297_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-8125]": [
+ {
+ "checksum": "e9ebf1ed89b4b2d9f4978c4af57a35f6",
+ "size": 5251,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql-8125_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-8131]": [
+ {
+ "checksum": "d021d18e4585fa55652024766c19e58b",
+ "size": 3711,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-yql-8131_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql-8980]": [
+ {
+ "checksum": "9cae8245fb1c4ab69594a6622056dd93",
+ "size": 3498,
+ "uri": "https://{canondata_backend}/1937027/b5576dd03b65095c35e7cb4954821e4f66817b94/resource.tar.gz#test_sql2yql.test_join-yql-8980_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[join-yql_465]": [
+ {
+ "checksum": "106feff350d52688bebff002dbc828b4",
+ "size": 2024,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_join-yql_465_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-combination/nested]": [
+ {
+ "checksum": "4d2cd5b048617d1cd79909ca2be27e3d",
+ "size": 3722,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-combination_nested_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-combination/unwrapped]": [
+ {
+ "checksum": "ae7c9e25a10dc0de022279f1c6d92ca1",
+ "size": 1675,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-combination_unwrapped_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/common_syntax]": [
+ {
+ "checksum": "ce2533ca497b406fd81c6b8eefdf622b",
+ "size": 2232,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_common_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/example]": [
+ {
+ "checksum": "10a65ae1b9519cfd6590b11e6cda516f",
+ "size": 10762,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_example_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/on_error]": [
+ {
+ "checksum": "67cbd85043dcd7772796f2e70aef443b",
+ "size": 1896,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_on_error_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/on_error_exception]": [
+ {
+ "checksum": "9bb233a1941bee5f00b9247dd74a4c5c",
+ "size": 1075,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_on_error_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/passing]": [
+ {
+ "checksum": "c00e43c81ba870b3f99c28a2512f0569",
+ "size": 6203,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_passing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_exists/passing_exception]": [
+ {
+ "checksum": "d38b487e124d8d44784e9e1fd6e7b1a9",
+ "size": 1154,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_exists_passing_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/common_syntax]": [
+ {
+ "checksum": "c1fcc5d26a9f4335ef3a996f848aa967",
+ "size": 2226,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_common_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/example]": [
+ {
+ "checksum": "92906b74db5211712a99b348a566167e",
+ "size": 11125,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_example_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/on_empty]": [
+ {
+ "checksum": "05336aa457121592365cefbf883ab432",
+ "size": 1863,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_on_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/on_empty_exception]": [
+ {
+ "checksum": "d63afd278c5eff2a0234eae7e77f936a",
+ "size": 1092,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_on_empty_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/on_error]": [
+ {
+ "checksum": "f7f2966f0792484fd103b49afaeefb80",
+ "size": 1875,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_on_error_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/on_error_exception]": [
+ {
+ "checksum": "2b2ac2505739a04e2fb2896f1a39e4fa",
+ "size": 1095,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_on_error_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/passing]": [
+ {
+ "checksum": "bdceada9b49ae440353e07cc6d6318b9",
+ "size": 6127,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_passing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/passing_exception]": [
+ {
+ "checksum": "c3e360a4ff8941ec39e542071eb4caa3",
+ "size": 1148,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_passing_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_query/wrapper]": [
+ {
+ "checksum": "c981292355daf386dae44de92a448756",
+ "size": 17717,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_query_wrapper_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/common_syntax]": [
+ {
+ "checksum": "737758c0d781f6305930933246e4a046",
+ "size": 2286,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_common_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/example]": [
+ {
+ "checksum": "7ae23a0d398aa41e779dbfd4b757c691",
+ "size": 8645,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_example_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_empty]": [
+ {
+ "checksum": "925325d41af95a43c113f30d7367723b",
+ "size": 4707,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_empty_cast_default_exception]": [
+ {
+ "checksum": "0910c826579c86590a84bd4a44dc0c11",
+ "size": 1132,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_empty_cast_default_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_empty_exception]": [
+ {
+ "checksum": "fb8e85fab34bc525337d40a0464d4e0f",
+ "size": 1106,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_empty_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_error]": [
+ {
+ "checksum": "683525acdfaaa827056ccd9089591346",
+ "size": 5127,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_error_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_error_cast_default_exception]": [
+ {
+ "checksum": "a0109c8f529f0fca76940eaed9e67829",
+ "size": 1144,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_error_cast_default_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_error_cast_udf_exception]": [
+ {
+ "checksum": "cb05748c1235feae0f84816d4268919e",
+ "size": 1151,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_error_cast_udf_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_error_cast_value_exception]": [
+ {
+ "checksum": "bc7a6f474862d11be99dde7b9869ffbb",
+ "size": 1147,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_error_cast_value_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/on_error_jsonpath_exception]": [
+ {
+ "checksum": "241c37253ea2e8e7a72e579346c8948f",
+ "size": 1109,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_on_error_jsonpath_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/passing]": [
+ {
+ "checksum": "6227033c03a05c4ed54e2f2bce31064a",
+ "size": 6441,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_passing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/passing_exception]": [
+ {
+ "checksum": "db26670f8e54a97652703d6a3d2dc40d",
+ "size": 1172,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_passing_exception_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-json_value/returning]": [
+ {
+ "checksum": "ee9bd74f42f8d1eef5519302519af372",
+ "size": 15004,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-json_value_returning_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsondocument/insert]": [
+ {
+ "checksum": "6e02426ad7ddd42f68264f2e7361061e",
+ "size": 1106,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_json-jsondocument_insert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsondocument/json_exists]": [
+ {
+ "checksum": "8fc6166f3c0e31424d30ed0ce159ef0c",
+ "size": 1857,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-jsondocument_json_exists_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsondocument/json_query]": [
+ {
+ "checksum": "3a32f59639719c9ac637d271161da78f",
+ "size": 1841,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-jsondocument_json_query_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsondocument/json_value]": [
+ {
+ "checksum": "a699e6c35816cf8fb8734545e05a8a37",
+ "size": 1929,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-jsondocument_json_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsondocument/select]": [
+ {
+ "checksum": "a33d423c828bb450ed438a6c26440be9",
+ "size": 1267,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-jsondocument_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[json-jsonpath/unicode]": [
+ {
+ "checksum": "46b12a6d2e84170f718e21f74b5879e4",
+ "size": 2362,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_json-jsonpath_unicode_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-between_with_key_filter]": [
+ {
+ "checksum": "7305bb772f4d6238241b56ff0187c437",
+ "size": 2291,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-between_with_key_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-calc_dependent]": [
+ {
+ "checksum": "e15b8535531f65614f4f341248ff7406",
+ "size": 1381,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-calc_dependent_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-calc_dependent_with_tmp]": [
+ {
+ "checksum": "23041d2bb10d1935005c59807cd03cff",
+ "size": 3129,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-calc_dependent_with_tmp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-complex]": [
+ {
+ "checksum": "90d3a98816972a88719c94b0ecfc553a",
+ "size": 1611,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-complex_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-contains]": [
+ {
+ "checksum": "e6eda47e44e26d16c20b11581f011cf6",
+ "size": 1350,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-contains_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-contains_optional]": [
+ {
+ "checksum": "447c57b86c2806df561b6c2f1503d536",
+ "size": 1334,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-contains_optional_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-contains_tuples]": [
+ {
+ "checksum": "ceb2c3bc7110ee25db601bae37503a50",
+ "size": 5149,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_key_filter-contains_tuples_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-contains_tuples_no_keyfilter]": [
+ {
+ "checksum": "5985ae7801b81107f41bde77f35fa775",
+ "size": 4028,
+ "uri": "https://{canondata_backend}/1942100/4b68f1335b6f5777a4e88f7adac4f85fe445c2d9/resource.tar.gz#test_sql2yql.test_key_filter-contains_tuples_no_keyfilter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-convert]": [
+ {
+ "checksum": "efba52c2a79b852ffd0a5ae7befaf2f3",
+ "size": 1326,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-convert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-datetime]": [
+ {
+ "checksum": "36ece2f8d81b521a903c282b5eef9f80",
+ "size": 38470,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-datetime_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-decimal]": [
+ {
+ "checksum": "3d4ef07539b91023ae6a748b8969d706",
+ "size": 11001,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-decimal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-dependent_value]": [
+ {
+ "checksum": "ae7d4ceb1c4b84f9bb7e69be63f894dc",
+ "size": 1253,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-dependent_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-dict_contains]": [
+ {
+ "checksum": "9e78afce988a21e637bc8e57bc91a9cb",
+ "size": 1384,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-dict_contains_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-dict_contains_optional]": [
+ {
+ "checksum": "3ea8273d4c7267deeea20239df3f8cb6",
+ "size": 1368,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-dict_contains_optional_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-empty_range]": [
+ {
+ "checksum": "a4480a6c9cfc942e9ad8ef4da5e695b5",
+ "size": 13020,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-empty_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-empty_range_over_dynamic]": [
+ {
+ "checksum": "4f1194e3a74ce6ebf3390e825b6ad31a",
+ "size": 1293,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-empty_range_over_dynamic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-extend_over_map_with_same_schema]": [
+ {
+ "checksum": "5266f994180dd29f8491592671e3102f",
+ "size": 5307,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-extend_over_map_with_same_schema_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-is_null]": [
+ {
+ "checksum": "8527e509a50ade594f2149d737ba3344",
+ "size": 1238,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-is_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-is_null_multi_key]": [
+ {
+ "checksum": "cb150edd324c8313f344d3b84830a1a9",
+ "size": 1282,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-is_null_multi_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-is_null_or_data]": [
+ {
+ "checksum": "2d7782c20ca590b36d8bc0ecbdb1952f",
+ "size": 1286,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-is_null_or_data_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-is_null_with_condition]": [
+ {
+ "checksum": "781db128e2388aee122d96265abe4b04",
+ "size": 1338,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-is_null_with_condition_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-key_double_opt_suffix]": [
+ {
+ "checksum": "a37693a33249e3e71f0dca0b90fa1e58",
+ "size": 4260,
+ "uri": "https://{canondata_backend}/1916746/17fe8719a985017b6f021f4d7e436be1be861474/resource.tar.gz#test_sql2yql.test_key_filter-key_double_opt_suffix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-lambda_with_null_filter]": [
+ {
+ "checksum": "5af5b86eb0daa7a21836079f9208f80e",
+ "size": 2168,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-lambda_with_null_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-mixed_opt_bounds]": [
+ {
+ "checksum": "f249b88bc13130f3f3257f346bb8a943",
+ "size": 2931,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-mixed_opt_bounds_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-mixed_sort]": [
+ {
+ "checksum": "242ff5df53b95457ad03a34cbc66a477",
+ "size": 2621,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-mixed_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-multiusage]": [
+ {
+ "checksum": "059a620c957c0bb560b1f587d4a8b94c",
+ "size": 3811,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-multiusage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-nile_pred]": [
+ {
+ "checksum": "42d32e4047ae616d6997e7547dc687de",
+ "size": 1433,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-nile_pred_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-no_bypass_merge]": [
+ {
+ "checksum": "8f1e1bfb745fc93ab99799dd4bee37d2",
+ "size": 3234,
+ "uri": "https://{canondata_backend}/937458/29a3c1b9b216969a2d55da5642f70db3cb889590/resource.tar.gz#test_sql2yql.test_key_filter-no_bypass_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-part_key_over_dynamic]": [
+ {
+ "checksum": "ed0c681c0b57fd43338fa44f79dfcda3",
+ "size": 1764,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-part_key_over_dynamic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-pushdown_keyextract_passthrough]": [
+ {
+ "checksum": "839c2b92a0783dd2b46e180ea6b2e52d",
+ "size": 2423,
+ "uri": "https://{canondata_backend}/1931696/5fe4928f06d2e88e8209e0ef43d522899098153b/resource.tar.gz#test_sql2yql.test_key_filter-pushdown_keyextract_passthrough_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-pushdown_keyextract_type_adjust]": [
+ {
+ "checksum": "cbfacd15bfc13511a3b4a65564769843",
+ "size": 2434,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-pushdown_keyextract_type_adjust_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-range_union]": [
+ {
+ "checksum": "e41809c5c364e4a0fd23a974f66341e2",
+ "size": 27189,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-range_union_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-range_union_lower_excluded]": [
+ {
+ "checksum": "2e23c10b78c1086a91a36d8675a197df",
+ "size": 1557,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-range_union_lower_excluded_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-ranges]": [
+ {
+ "checksum": "58103e7ae3edeced63d37223f5267e10",
+ "size": 3586,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-ranges_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-split_input_with_key_filter1]": [
+ {
+ "checksum": "55c2436f2ea524e61f217f1b2925cf54",
+ "size": 1773,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-split_input_with_key_filter1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-split_input_with_key_filter2]": [
+ {
+ "checksum": "8ffe8fe319e491c2d13f5243a399f4e5",
+ "size": 1739,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-split_input_with_key_filter2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-string_with]": [
+ {
+ "checksum": "052f2713c89af5e9a48b3562fd5688e9",
+ "size": 1301,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-string_with_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-string_with_ff]": [
+ {
+ "checksum": "0e17bb9124896093e243cf7b09c44304",
+ "size": 2954,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-string_with_ff_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-string_with_legacy]": [
+ {
+ "checksum": "e208f545080720f7cf313acdd88ffda7",
+ "size": 4706,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-string_with_legacy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-tzdate]": [
+ {
+ "checksum": "d3c88543a4b05c1a1fc8120361bcea7b",
+ "size": 10270,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-tzdate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-utf8_with_legacy]": [
+ {
+ "checksum": "68d860ab98d0f8189ff5ff13220f4400",
+ "size": 6858,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-utf8_with_legacy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-uuid]": [
+ {
+ "checksum": "687383e4066f2b8af2c7f487de82e49b",
+ "size": 13527,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-uuid_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-yql-14157]": [
+ {
+ "checksum": "0156156934873f0ce81100ed8e48024b",
+ "size": 2750,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-yql-14157_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-yql-8117-table_key_filter]": [
+ {
+ "checksum": "7ede9ed1b02865fd069f3925d48f64c8",
+ "size": 2909,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-yql-8117-table_key_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-yql-8663-dedup_ranges]": [
+ {
+ "checksum": "e141794c9761e2bf39bbba626f7554e8",
+ "size": 1346,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-yql-8663-dedup_ranges_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[key_filter-yql_5895_or]": [
+ {
+ "checksum": "232fa310f1ccd42ff03f1beccf111fee",
+ "size": 1339,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_key_filter-yql_5895_or_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_brief]": [
+ {
+ "checksum": "dbe6b79db5f2b2da66e4e52860ac290e",
+ "size": 1103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_brief_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_no_arg]": [
+ {
+ "checksum": "48c380a690656c54889ff5c78cca22a8",
+ "size": 1322,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_no_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_opt_args]": [
+ {
+ "checksum": "baae95c831eccce84675eeb47408de3f",
+ "size": 1447,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_opt_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_simple]": [
+ {
+ "checksum": "6c15a559be581595bb86e85cb2608a6d",
+ "size": 1752,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_udf]": [
+ {
+ "checksum": "91ef90a391f494208e0f908654b379f1",
+ "size": 1772,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_use_labmda_as_arg]": [
+ {
+ "checksum": "e3e970d824792cfdc65a4279a334532a",
+ "size": 1931,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_use_labmda_as_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_with_tie]": [
+ {
+ "checksum": "8135493266a4678adfb570cc18647ed0",
+ "size": 1379,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_with_tie_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-lambda_with_tie_bad_count_fail]": [
+ {
+ "checksum": "4794d8e1ffef08cbe4ea6bd1707961f1",
+ "size": 1384,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-lambda_with_tie_bad_count_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-list_aggregate]": [
+ {
+ "checksum": "8c9f13fa78e8c9e979107526e7644a65",
+ "size": 2870,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-list_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lambda-list_aggregate_flatmap]": [
+ {
+ "checksum": "cd2d02ab0adea3c88f428908829f4f64",
+ "size": 2874,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_lambda-list_aggregate_flatmap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-forward_import]": [
+ {
+ "checksum": "6f46de668d5de55650c31aa8884b3f49",
+ "size": 3335,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-forward_import_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-library]": [
+ {
+ "checksum": "3d2d4f073cc2057d929db3b6ff0e9d2e",
+ "size": 1102,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-library_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-library_alias]": [
+ {
+ "checksum": "f492dd55f78de445ca73faedaa96f7b5",
+ "size": 1093,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-library_alias_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-library_udf]": [
+ {
+ "checksum": "93053e290b284e48fdda61f3d431f675",
+ "size": 1053,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-library_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-library_via_http]": [
+ {
+ "checksum": "3d2d4f073cc2057d929db3b6ff0e9d2e",
+ "size": 1102,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-library_via_http_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-package]": [
+ {
+ "checksum": "106486465eec39d06f2253ff07547c25",
+ "size": 1181,
+ "uri": "https://{canondata_backend}/937458/19757d70a088a9bcfe4bcf554f8c96bace436bfa/resource.tar.gz#test_sql2yql.test_library-package_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[library-package_override]": [
+ {
+ "checksum": "f83236f42664c51f0cb754b0455eec15",
+ "size": 1188,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_library-package_override_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-ilike_clause]": [
+ {
+ "checksum": "39d6b72f38920f37c7b739c284b556e3",
+ "size": 1913,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-ilike_clause_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_clause]": [
+ {
+ "checksum": "7c41f42a644e9183d9c1ea7f18355a4d",
+ "size": 1966,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-like_clause_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_clause_escape]": [
+ {
+ "checksum": "f447eea0634d273bcb7009cbca82bdb4",
+ "size": 1899,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-like_clause_escape_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_clause_no_pattern]": [
+ {
+ "checksum": "504b66a6fe61f0c1599dd27f54e54de6",
+ "size": 1545,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_like-like_clause_no_pattern_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_escape]": [
+ {
+ "checksum": "737b940c4c8d099500e9940ea795ee88",
+ "size": 1283,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-like_escape_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_multiline]": [
+ {
+ "checksum": "a21323ec08dd275e042fc66a0b045c8e",
+ "size": 1510,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-like_multiline_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-like_rewrite]": [
+ {
+ "checksum": "2ef00de5e1f772a2db1d771a11961392",
+ "size": 2890,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-like_rewrite_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[like-regexp_clause]": [
+ {
+ "checksum": "e6e243ee43d1ce73db9a4c45a3304a97",
+ "size": 1572,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_like-regexp_clause_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-dynamic_limit]": [
+ {
+ "checksum": "82d4b9b83ebc025fc25c0ada70df7742",
+ "size": 2194,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_limit-dynamic_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-dynamic_sort_limit]": [
+ {
+ "checksum": "1f8624cc8eda8b1ad44fd27e8dc730aa",
+ "size": 1783,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_limit-dynamic_sort_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-empty_input_after_limit]": [
+ {
+ "checksum": "9f0dd955a88205c95598ef58837aaa12",
+ "size": 2740,
+ "uri": "https://{canondata_backend}/1936842/44c9f1772563d0c73f8f2aca7d86c74293d4ab0c/resource.tar.gz#test_sql2yql.test_limit-empty_input_after_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-empty_read_after_limit]": [
+ {
+ "checksum": "84d3b398118f7e35fa85b3220580588e",
+ "size": 1322,
+ "uri": "https://{canondata_backend}/1946324/7b8d8a1a2061e5d23a4d3e2efca0cf0e1a95afb8/resource.tar.gz#test_sql2yql.test_limit-empty_read_after_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-empty_sort_after_limit]": [
+ {
+ "checksum": "d0522dfccc401a4861c46b35db601e91",
+ "size": 1306,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-empty_sort_after_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-empty_sort_calc_after_limit]": [
+ {
+ "checksum": "590abf646ec628f37f4c336d5811b826",
+ "size": 1338,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-empty_sort_calc_after_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-empty_sort_desc_after_limit]": [
+ {
+ "checksum": "5bed9907894bd8b202d0546a930cd371",
+ "size": 1307,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-empty_sort_desc_after_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-insert_with_limit]": [
+ {
+ "checksum": "60793fda529a62a23a0963553e5eca99",
+ "size": 1191,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-insert_with_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-limit]": [
+ {
+ "checksum": "b57b50d0694c3805352bb97366179f1f",
+ "size": 1213,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_limit-limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-limit_offset]": [
+ {
+ "checksum": "f85311840797f4345c202fc4613a1d6f",
+ "size": 2167,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-limit_offset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-limit_over_sort_desc_in_subquery]": [
+ {
+ "checksum": "6291f85938e9d3a32a04a55b05ab6ec8",
+ "size": 2393,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_limit-limit_over_sort_desc_in_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-limit_skip_take]": [
+ {
+ "checksum": "5ec54b66fa62f26e3547974afeb3c247",
+ "size": 2167,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-limit_skip_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-many_top_sorts]": [
+ {
+ "checksum": "6cc74ae99b329550281569eb43262cbd",
+ "size": 2859,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-many_top_sorts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-sort_calc_limit]": [
+ {
+ "checksum": "b501cedab6c9006da4c22851d8824493",
+ "size": 1287,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_limit-sort_calc_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-yql-7900_empty_sorted_without_keys]": [
+ {
+ "checksum": "9178443752009b31379c674ac78832ea",
+ "size": 3792,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_limit-yql-7900_empty_sorted_without_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-yql-8046_empty_sorted_desc]": [
+ {
+ "checksum": "8f3a500dbbd09a431156ea43badd1885",
+ "size": 6039,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_limit-yql-8046_empty_sorted_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-yql-8611_calc_peephole]": [
+ {
+ "checksum": "620b7bcab7831a76ba37d766eec55afa",
+ "size": 3282,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_limit-yql-8611_calc_peephole_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-yql-9617_empty_lambda]": [
+ {
+ "checksum": "248ea22983ffa2b48cbe6c37c42624be",
+ "size": 1713,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_limit-yql-9617_empty_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[limit-zero_limit]": [
+ {
+ "checksum": "435e8f96931be653c474c8c21d634f92",
+ "size": 2186,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_limit-zero_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-error_type]": [
+ {
+ "checksum": "09dc81028852fd592ae2ae96787107ab",
+ "size": 1628,
+ "uri": "https://{canondata_backend}/1784826/8212a6594777651314d94a2e2f95179c0016604c/resource.tar.gz#test_sql2yql.test_lineage-error_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-flatten_by]": [
+ {
+ "checksum": "a761432fec83da9adc9a7828296bda6f",
+ "size": 4072,
+ "uri": "https://{canondata_backend}/1937367/b35833bd1950efa4b6fa264900a396b8f3f198a8/resource.tar.gz#test_sql2yql.test_lineage-flatten_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-flatten_list_nested_lambda]": [
+ {
+ "checksum": "1405a87aecd4676d7955fff219819b5f",
+ "size": 2316,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_lineage-flatten_list_nested_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-flatten_where]": [
+ {
+ "checksum": "12199251e908592b34ef75ce9b50014e",
+ "size": 2040,
+ "uri": "https://{canondata_backend}/995452/686fce56a91b74643cca782a2a73c0370221c2af/resource.tar.gz#test_sql2yql.test_lineage-flatten_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-group_by_asstruct_key]": [
+ {
+ "checksum": "6fc73dcd0b3de4c4faff9b573bd85932",
+ "size": 2375,
+ "uri": "https://{canondata_backend}/1871002/ba7501739621731b8f5b85f57d8e4868dadf87e3/resource.tar.gz#test_sql2yql.test_lineage-group_by_asstruct_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-grouping_sets]": [
+ {
+ "checksum": "bc9f636e423a6c856a4ff05a6b5c3a82",
+ "size": 3196,
+ "uri": "https://{canondata_backend}/1781765/5483cde59b65341125b67709093030a3d2bd1b0e/resource.tar.gz#test_sql2yql.test_lineage-grouping_sets_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-if_struct]": [
+ {
+ "checksum": "aafa05e38853f6b86488a387b26f7ec0",
+ "size": 3076,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_lineage-if_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-isolated]": [
+ {
+ "checksum": "48ff675c98f99d7cec2a5791777aafb3",
+ "size": 1796,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_lineage-isolated_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-join_as_struct]": [
+ {
+ "checksum": "9fda95e8ba4e26de0dc24caa99de6d16",
+ "size": 3631,
+ "uri": "https://{canondata_backend}/1871002/ba7501739621731b8f5b85f57d8e4868dadf87e3/resource.tar.gz#test_sql2yql.test_lineage-join_as_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-list_literal1]": [
+ {
+ "checksum": "2dce3b5c0aa3fb678f81e227b3bcbfa9",
+ "size": 1874,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql2yql.test_lineage-list_literal1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-list_literal2]": [
+ {
+ "checksum": "62318ecb33e99cd6168c45a2d04864c6",
+ "size": 2496,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql2yql.test_lineage-list_literal2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-list_literal3]": [
+ {
+ "checksum": "bd79794aadce543665ca4d77a831c386",
+ "size": 3809,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql2yql.test_lineage-list_literal3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-list_literal4]": [
+ {
+ "checksum": "aaaddcb5e5dace7c3365d0103b3ad71b",
+ "size": 3927,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql2yql.test_lineage-list_literal4_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-member_over_if_struct]": [
+ {
+ "checksum": "2f0f3448db1f9062df67f6a582e29edd",
+ "size": 2872,
+ "uri": "https://{canondata_backend}/1689644/39ce6d9afd6582130ac864f33dffbf252ff73f8a/resource.tar.gz#test_sql2yql.test_lineage-member_over_if_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-nested_lambda_fields]": [
+ {
+ "checksum": "7a7b3ae28983391789cb04631ff9478f",
+ "size": 1545,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_lineage-nested_lambda_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-process]": [
+ {
+ "checksum": "b987b74694fd6165b0c3eaa827d9ec06",
+ "size": 952,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql2yql.test_lineage-process_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-reduce]": [
+ {
+ "checksum": "7e1a4df092f231a8b7706e9bf212db8b",
+ "size": 1183,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql2yql.test_lineage-reduce_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-reduce_all]": [
+ {
+ "checksum": "54cac061bd2ed55e0cf4779cdfc5b8dd",
+ "size": 1130,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql2yql.test_lineage-reduce_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-reduce_all_row]": [
+ {
+ "checksum": "34fdbe53548fab3e06a8b6d33732baef",
+ "size": 1321,
+ "uri": "https://{canondata_backend}/1937001/17904a5011471d554231c1fa2d5f2867653f21a9/resource.tar.gz#test_sql2yql.test_lineage-reduce_all_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-scalar_context]": [
+ {
+ "checksum": "d30139e2ac069a234955b9b89fe80997",
+ "size": 2143,
+ "uri": "https://{canondata_backend}/1942525/a993aa64342179485e7d0b4fa6f4591ea53fb919/resource.tar.gz#test_sql2yql.test_lineage-scalar_context_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_all]": [
+ {
+ "checksum": "6e02426ad7ddd42f68264f2e7361061e",
+ "size": 1106,
+ "uri": "https://{canondata_backend}/1937424/d3b90cb17bd9e68b96672b865a31cbad3b868815/resource.tar.gz#test_sql2yql.test_lineage-select_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_all_filter]": [
+ {
+ "checksum": "520843e404e76d68e98077a80607a52d",
+ "size": 1224,
+ "uri": "https://{canondata_backend}/1899731/7932575ef7f6e4ceebf990070caf39ab17b7ebd5/resource.tar.gz#test_sql2yql.test_lineage-select_all_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_field]": [
+ {
+ "checksum": "7ec7868681113c95afbf004637904123",
+ "size": 1071,
+ "uri": "https://{canondata_backend}/1899731/7932575ef7f6e4ceebf990070caf39ab17b7ebd5/resource.tar.gz#test_sql2yql.test_lineage-select_field_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_field_filter]": [
+ {
+ "checksum": "be90f29234f78091f7e335272ce297af",
+ "size": 1189,
+ "uri": "https://{canondata_backend}/1773845/6fcd4734fcf098a76bf02d72f018f3d5d34a53b1/resource.tar.gz#test_sql2yql.test_lineage-select_field_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_field_limit_offset]": [
+ {
+ "checksum": "81fbb1b92c3cfb9f9aafcb2d7c431d09",
+ "size": 1264,
+ "uri": "https://{canondata_backend}/1937429/d061253f04b807f5ecfbdddb21691c3208be8169/resource.tar.gz#test_sql2yql.test_lineage-select_field_limit_offset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_field_order_by]": [
+ {
+ "checksum": "c22db9406eba7999012afe43198150b8",
+ "size": 1279,
+ "uri": "https://{canondata_backend}/1784826/a8ee39c5c298d6fd96fcedd7d7c1ea3532239f9f/resource.tar.gz#test_sql2yql.test_lineage-select_field_order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_field_rename]": [
+ {
+ "checksum": "570af6ac28f1a4b67ed9a1aa756593a2",
+ "size": 1072,
+ "uri": "https://{canondata_backend}/1899731/7932575ef7f6e4ceebf990070caf39ab17b7ebd5/resource.tar.gz#test_sql2yql.test_lineage-select_field_rename_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_group_by_all]": [
+ {
+ "checksum": "0377da5c4d1914e6c3a70d2e1965919b",
+ "size": 1519,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-select_group_by_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_group_by_key]": [
+ {
+ "checksum": "d6ee57ce35143f459d165a45214d9307",
+ "size": 1735,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-select_group_by_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_join]": [
+ {
+ "checksum": "7265b139265855fabd4298eee3491fd8",
+ "size": 1565,
+ "uri": "https://{canondata_backend}/1942525/998aa45f8e34ed3ff3d2a16737240d4f48919890/resource.tar.gz#test_sql2yql.test_lineage-select_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_mix_fields]": [
+ {
+ "checksum": "5609ee233710618ee8d3a9a08ce9d9df",
+ "size": 1115,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-select_mix_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_nested_table_row]": [
+ {
+ "checksum": "e15d8ff18ab950489e12ed1d57d5794c",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-select_nested_table_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_table_row]": [
+ {
+ "checksum": "7deb4bda7dbcdd42aee3d4363a7e7be2",
+ "size": 1090,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-select_table_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-select_union_all]": [
+ {
+ "checksum": "bb01fb56e5cb5de7e496d044c764edce",
+ "size": 1639,
+ "uri": "https://{canondata_backend}/212715/859a607b4d0ee919127f610faaa0ca8d06b355ec/resource.tar.gz#test_sql2yql.test_lineage-select_union_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-some_tablerow]": [
+ {
+ "checksum": "5caac5ebd19fc0b7ab3dcd3e8fbfae6e",
+ "size": 1918,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-some_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-topsort]": [
+ {
+ "checksum": "bde990c0abcf6b66865ae96c8cd0a99f",
+ "size": 2031,
+ "uri": "https://{canondata_backend}/1937429/d9e26546ec60615ac3a6bdb8250a95b71cccc205/resource.tar.gz#test_sql2yql.test_lineage-topsort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-union_all_tablerow]": [
+ {
+ "checksum": "5cb779df9c36033dfd0ae226d4e77b88",
+ "size": 2337,
+ "uri": "https://{canondata_backend}/1871002/ba7501739621731b8f5b85f57d8e4868dadf87e3/resource.tar.gz#test_sql2yql.test_lineage-union_all_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-unordered_subquery]": [
+ {
+ "checksum": "45c9a42e3a9c045cd3921818fcfc7eff",
+ "size": 1873,
+ "uri": "https://{canondata_backend}/1031349/ad03ca89b32a9e8069f809ad27ebec411c32feeb/resource.tar.gz#test_sql2yql.test_lineage-unordered_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_asstruct]": [
+ {
+ "checksum": "0cbaeacbd5584fbce369e8ee1090b917",
+ "size": 1968,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-window_asstruct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_many]": [
+ {
+ "checksum": "68ad37dab27b4889c4415d0c1b81b991",
+ "size": 2817,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-window_many_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_member_struct]": [
+ {
+ "checksum": "9ce238a15f3b36fa216275a0e1e85cfa",
+ "size": 2609,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-window_member_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_one]": [
+ {
+ "checksum": "be931b8d3325ddb16789f158561c2a0e",
+ "size": 1380,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-window_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_session]": [
+ {
+ "checksum": "ec57a5cd4619ef59e1af8b8909076f3c",
+ "size": 2090,
+ "uri": "https://{canondata_backend}/1936842/82663648d73f44b9da053524ac248b5cb2bb12be/resource.tar.gz#test_sql2yql.test_lineage-window_session_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-window_tablerow]": [
+ {
+ "checksum": "d0d9fad1dd588f989ff501a8c36e703b",
+ "size": 1916,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_lineage-window_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[lineage-with_inline]": [
+ {
+ "checksum": "71bf3f462c989b22e206ce3136db6ca2",
+ "size": 1391,
+ "uri": "https://{canondata_backend}/1599023/66d0b07d601bb15f0e0b65bb7b4d493f89c1c283/resource.tar.gz#test_sql2yql.test_lineage-with_inline_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-after_match_skip_past_last_row]": [
+ {
+ "checksum": "bb84286a97914c6cfd2e47288a49335e",
+ "size": 3122,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql2yql.test_match_recognize-after_match_skip_past_last_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-alerts-streaming]": [
+ {
+ "checksum": "608ebe5a00413e80b8e74157944f0b65",
+ "size": 8897,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_match_recognize-alerts-streaming_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-alerts]": [
+ {
+ "checksum": "cdb46b31b6421829da9d236dcd55bbdd",
+ "size": 8899,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_match_recognize-alerts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-alerts_without_order]": [
+ {
+ "checksum": "4a7d1c9ca704a076217e529b5489ad87",
+ "size": 8780,
+ "uri": "https://{canondata_backend}/1937001/f1ec239726ab3e2cf00695f3d10461ff9ef6c3b0/resource.tar.gz#test_sql2yql.test_match_recognize-alerts_without_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-permute]": [
+ {
+ "checksum": "05c45a70d86bca34be996277afae8bf9",
+ "size": 8370,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_match_recognize-permute_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-simple_paritioning-streaming]": [
+ {
+ "checksum": "46f8074bb1a64ddd158f99407652c0ac",
+ "size": 5028,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_match_recognize-simple_paritioning-streaming_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-simple_paritioning]": [
+ {
+ "checksum": "05cf7b3874d2a89f56fc9a06ff9bf853",
+ "size": 4997,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_match_recognize-simple_paritioning_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-test_type-streaming]": [
+ {
+ "checksum": "dcb70a47c4422d81c6548150dab5b76d",
+ "size": 10244,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_match_recognize-test_type-streaming_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-test_type]": [
+ {
+ "checksum": "0a5812e84f194b487eae4084027bd170",
+ "size": 10249,
+ "uri": "https://{canondata_backend}/1936842/c0fac16b134e7c8f865a197ac63738ced4fac271/resource.tar.gz#test_sql2yql.test_match_recognize-test_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[match_recognize-test_type_predicate]": [
+ {
+ "checksum": "0a61853b05181028e48e1cb2863198cf",
+ "size": 3268,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_match_recognize-test_type_predicate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-aggregate_over_aggregate]": [
+ {
+ "checksum": "49787ac560305967be09b76a89e156fc",
+ "size": 1377,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-aggregate_over_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-and_absorption]": [
+ {
+ "checksum": "773f469a34ff201d73b86a8250ee9c94",
+ "size": 2282,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql2yql.test_optimizers-and_absorption_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-coalesce_propagate]": [
+ {
+ "checksum": "cfe96bb25f42b04dd922e6ba78a5526c",
+ "size": 1705,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-coalesce_propagate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-combinebykey_fields_subset]": [
+ {
+ "checksum": "05d4669d45abff5c6da360046d0ed761",
+ "size": 1518,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-combinebykey_fields_subset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-combinebykey_fields_subset_range]": [
+ {
+ "checksum": "b8d27e1d4e437d35b55cf96caeb9de3d",
+ "size": 1554,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-combinebykey_fields_subset_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-constant_fold_minmax]": [
+ {
+ "checksum": "c2f0f43ef965aaa47b5d013161f23dc7",
+ "size": 4073,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-constant_fold_minmax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-direct_row_after_merge]": [
+ {
+ "checksum": "af54522627090b795c2a4f95db7883da",
+ "size": 1412,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-direct_row_after_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-field_subset_for_multiusage]": [
+ {
+ "checksum": "b1dd377da2a65e1cc4d10bfce6e17699",
+ "size": 3374,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-field_subset_for_multiusage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-flatmap_with_non_struct_out]": [
+ {
+ "checksum": "88bc195de78e39a7631e8950b4ecb4b1",
+ "size": 1630,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-flatmap_with_non_struct_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-group_visit_lambdas]": [
+ {
+ "checksum": "d70fda85dfe6e017ea2172c1a49aaa3d",
+ "size": 1951,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-group_visit_lambdas_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-instant_contains_lookup]": [
+ {
+ "checksum": "0d1ed3f41826800f8cefb16c0d13e8b3",
+ "size": 1580,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-instant_contains_lookup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-length_over_merge]": [
+ {
+ "checksum": "ff0f4600c690e77a7f6d5c8199a8110f",
+ "size": 4398,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-length_over_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-length_over_merge_fs_multiusage]": [
+ {
+ "checksum": "79b35d50845e3116c5b7e74e19ba5060",
+ "size": 4501,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-length_over_merge_fs_multiusage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-multi_to_empty_constraint]": [
+ {
+ "checksum": "ea654a6eb79412cd074d9775736647e5",
+ "size": 3790,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-multi_to_empty_constraint_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-nonselected_direct_row]": [
+ {
+ "checksum": "8b7d9739519f6b4588d3d8ea73b5127c",
+ "size": 2571,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-nonselected_direct_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-or_absorption]": [
+ {
+ "checksum": "702997764c6e5545d61df72df846250c",
+ "size": 2242,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql2yql.test_optimizers-or_absorption_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-or_distributive]": [
+ {
+ "checksum": "dd47f3bb3f6cd97d786bde20eef1d532",
+ "size": 2626,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql2yql.test_optimizers-or_distributive_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-passthrough_sortness_over_map]": [
+ {
+ "checksum": "01316f21e18f25d4f39dd1b0b507025a",
+ "size": 5422,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-passthrough_sortness_over_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-pushdown_nonsep_over_aggregate]": [
+ {
+ "checksum": "9754c147d630a173aa594d1cc3495c1f",
+ "size": 2418,
+ "uri": "https://{canondata_backend}/1899731/407203c9a441603d4ce4780c1c3daab84de46096/resource.tar.gz#test_sql2yql.test_optimizers-pushdown_nonsep_over_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sort_by_nonstrict_const]": [
+ {
+ "checksum": "169c512d23e47b59ae22f678661c4ac2",
+ "size": 1263,
+ "uri": "https://{canondata_backend}/1775059/2a9bd55a1c15f5a3a2740dd1a07c9cbfaaf0a087/resource.tar.gz#test_sql2yql.test_optimizers-sort_by_nonstrict_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sort_constraint_in_left]": [
+ {
+ "checksum": "70120ad2d74bc7c06b10327f3a30e894",
+ "size": 3697,
+ "uri": "https://{canondata_backend}/1937492/9cec6e279456c1f4378a56f7cefe61dbc632f859/resource.tar.gz#test_sql2yql.test_optimizers-sort_constraint_in_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sort_over_sorted_prefix_keys]": [
+ {
+ "checksum": "8d9ee0e90c96786c57dc9c23ad032774",
+ "size": 2195,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-sort_over_sorted_prefix_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sort_over_sorted_same_keys]": [
+ {
+ "checksum": "03a230b1e3a540548b48c7bf0374f506",
+ "size": 2255,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-sort_over_sorted_same_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sorted_scalar_content]": [
+ {
+ "checksum": "38f6ba851adc2114918dcb007e0147ae",
+ "size": 3439,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_optimizers-sorted_scalar_content_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-sorted_sql_in]": [
+ {
+ "checksum": "9cea3151823488dd5b75703cf222f715",
+ "size": 4015,
+ "uri": "https://{canondata_backend}/1871102/df87192553c8f75bd76f68330c4903ce8323f9ec/resource.tar.gz#test_sql2yql.test_optimizers-sorted_sql_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-test_fuse_map_predicate_limit]": [
+ {
+ "checksum": "1c031b9b2e15e8f9eb873001d1ed0a09",
+ "size": 2484,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_optimizers-test_fuse_map_predicate_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-test_fuse_map_take]": [
+ {
+ "checksum": "dd83771529243488c90e503d7b69b9c6",
+ "size": 3006,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_optimizers-test_fuse_map_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-test_lmap_opts]": [
+ {
+ "checksum": "d5b6c6796d3269c4828fe90929b110cd",
+ "size": 4943,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-test_lmap_opts_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-test_no_aggregate_split]": [
+ {
+ "checksum": "9d645f1fce5bd78ac69322dfb47c3099",
+ "size": 3638,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_optimizers-test_no_aggregate_split_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-total_order]": [
+ {
+ "checksum": "719cae7cb1103ed9044df61b061d3dff",
+ "size": 17172,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-total_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-unused_columns_group]": [
+ {
+ "checksum": "23f2f151abde1b6bc069afcdaa98fb99",
+ "size": 3914,
+ "uri": "https://{canondata_backend}/1784826/6e24b46ab3ce91844f7fd0a7e573c44927321db7/resource.tar.gz#test_sql2yql.test_optimizers-unused_columns_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-unused_columns_group_one_of_multi]": [
+ {
+ "checksum": "8b37f1ead70749e174e89330b0791404",
+ "size": 3869,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-unused_columns_group_one_of_multi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-unused_columns_window]": [
+ {
+ "checksum": "5211c1fab71a118a37064347f6d2ef40",
+ "size": 1847,
+ "uri": "https://{canondata_backend}/1925821/7d114381a67ceb19c5fcabccf1f32be3cd9aec39/resource.tar.gz#test_sql2yql.test_optimizers-unused_columns_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-unused_columns_window_no_payloads]": [
+ {
+ "checksum": "054970e5a965e3e7014fce91b3d23c5b",
+ "size": 1994,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-unused_columns_window_no_payloads_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-wide_if_present_over_double_just]": [
+ {
+ "checksum": "ba9bd5a2acf680bb24b98e6c63f5abe0",
+ "size": 1088,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-wide_if_present_over_double_just_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-10042_disable_flow_fuse_depends_on]": [
+ {
+ "checksum": "a621275550b97cd84e74be837108ef86",
+ "size": 2048,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-yql-10042_disable_flow_fuse_depends_on_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-10042_disable_fuse_depends_on]": [
+ {
+ "checksum": "ea9a6b797ed06ddfab26bfee3e523069",
+ "size": 1279,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_optimizers-yql-10042_disable_fuse_depends_on_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-10070_extract_members_over_calcoverwindow]": [
+ {
+ "checksum": "d79971a069c30523cdc610cb939c4136",
+ "size": 3145,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-10070_extract_members_over_calcoverwindow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-10074_dont_inline_lists_depends_on]": [
+ {
+ "checksum": "0f71c90df76940d7959d6bc98d1b93b1",
+ "size": 2952,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-10074_dont_inline_lists_depends_on_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-10737_lost_passthrough]": [
+ {
+ "checksum": "e3c22809f2360ce673cb9a38ef50bb39",
+ "size": 2441,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-10737_lost_passthrough_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-11171_unordered_over_sorted_fill]": [
+ {
+ "checksum": "05aabfb18cb4269fbae07f762602878a",
+ "size": 2920,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-11171_unordered_over_sorted_fill_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-12620_stage_multiuse]": [
+ {
+ "checksum": "6496e0edcc45356db2a99233d5dff2d0",
+ "size": 3811,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-12620_stage_multiuse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-14279_keyextract_with_world_dep]": [
+ {
+ "checksum": "6bc1d5deedb2ff318994db2451bfab1f",
+ "size": 3115,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_optimizers-yql-14279_keyextract_with_world_dep_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-14581_fuseflatmaps_with_external_lambda]": [
+ {
+ "checksum": "c6207a110de506d04489b14edcd4ab0a",
+ "size": 1941,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-14581_fuseflatmaps_with_external_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-15210_sqlin]": [
+ {
+ "checksum": "8354b39839f2d7a7a92c643e862e979f",
+ "size": 3744,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-15210_sqlin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-16134]": [
+ {
+ "checksum": "6618a508fb32a520aa156b4798ded35e",
+ "size": 1233,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-16134_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-17413-topsort]": [
+ {
+ "checksum": "67c8ef113d7a75b9d94141e35afad605",
+ "size": 3608,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-17413-topsort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-17715_concat_sort_desc]": [
+ {
+ "checksum": "5f6235d7fe0cec7904445ce791d3d3f3",
+ "size": 9286,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_optimizers-yql-17715_concat_sort_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-18300-flatmap-over-extend]": [
+ {
+ "checksum": "f4abb54afef08f519d77c160cea254ef",
+ "size": 3313,
+ "uri": "https://{canondata_backend}/1936997/1a3eb8ef93462f24881c98db5e367242501cd72e/resource.tar.gz#test_sql2yql.test_optimizers-yql-18300-flatmap-over-extend_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-18408_filter_multiusage_pushdown]": [
+ {
+ "checksum": "3ef7cea4233d82b6b0d890995d58437d",
+ "size": 13041,
+ "uri": "https://{canondata_backend}/1936273/49c67b7d7a39200caa18261ed9d1bc5db8f0665a/resource.tar.gz#test_sql2yql.test_optimizers-yql-18408_filter_multiusage_pushdown_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-18733_no_filter_multiusage_pushdown]": [
+ {
+ "checksum": "b2f87a348272c18d0ae93bf3f421b79c",
+ "size": 2300,
+ "uri": "https://{canondata_backend}/1942671/a0a38df298ba29d07b694136c15631b91a455b2b/resource.tar.gz#test_sql2yql.test_optimizers-yql-18733_no_filter_multiusage_pushdown_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-2171_aggregate_desc_sort_and_extract]": [
+ {
+ "checksum": "e46724f353c724da2d05f34ac86ebc12",
+ "size": 3983,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_optimizers-yql-2171_aggregate_desc_sort_and_extract_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-2582_limit_for_join_input]": [
+ {
+ "checksum": "0f32980f36c81a98a23af38a4cfeb87b",
+ "size": 3409,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-2582_limit_for_join_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-2582_limit_for_join_input_other]": [
+ {
+ "checksum": "cbf939555273c51f802156bd20b7ede8",
+ "size": 3663,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-2582_limit_for_join_input_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-3455_filter_sorted]": [
+ {
+ "checksum": "80cbcf45cea04b579c049591a055e8b8",
+ "size": 3830,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-3455_filter_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-4240-aggregate_whole_struct]": [
+ {
+ "checksum": "8d68c803a56e5cb9460099155297b913",
+ "size": 3797,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_optimizers-yql-4240-aggregate_whole_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-5833-table_content]": [
+ {
+ "checksum": "af0425e46bc3c6d95e608975ee169ff3",
+ "size": 2547,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-5833-table_content_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-5978_fill_multi_usage]": [
+ {
+ "checksum": "43b7e457c93d05d67e0a11856f3eea45",
+ "size": 4442,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-5978_fill_multi_usage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-6008_limit_after_map]": [
+ {
+ "checksum": "bf2e7036a6f4c54807e6ef2ed93be036",
+ "size": 2329,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-yql-6008_limit_after_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-6038_direct_row]": [
+ {
+ "checksum": "dc942c374ce5ee9a4e7026c6ed5e563a",
+ "size": 5722,
+ "uri": "https://{canondata_backend}/1937492/9cec6e279456c1f4378a56f7cefe61dbc632f859/resource.tar.gz#test_sql2yql.test_optimizers-yql-6038_direct_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-6133_skip_deps]": [
+ {
+ "checksum": "e1f130c466b66c9574b7adef177c1f4c",
+ "size": 2917,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_optimizers-yql-6133_skip_deps_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-7324_duplicate_arg]": [
+ {
+ "checksum": "da2a150c066cbfaf2c1fb78890aa2faf",
+ "size": 2788,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-7324_duplicate_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-7532_wrong_field_subset_for_calcoverwindow]": [
+ {
+ "checksum": "6db76df890288366ae781407cbb77ea6",
+ "size": 3008,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-7532_wrong_field_subset_for_calcoverwindow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-7767_key_filter_with_view]": [
+ {
+ "checksum": "ca8b6925b1d877eaba3f30832b7d8ba2",
+ "size": 1635,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_optimizers-yql-7767_key_filter_with_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-8041-fuse_with_desc_map]": [
+ {
+ "checksum": "ef951c7bc176a7705858c06e3e0afa31",
+ "size": 2395,
+ "uri": "https://{canondata_backend}/1936842/9da17f420e478992cf6c97d9a8ec2f53cf0578f3/resource.tar.gz#test_sql2yql.test_optimizers-yql-8041-fuse_with_desc_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-8223_direct_row_and_skipnullmembers]": [
+ {
+ "checksum": "c8c8e1a48a02f817308482cb84afb70c",
+ "size": 4450,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-8223_direct_row_and_skipnullmembers_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-8953_logical_fuse_with_table_props]": [
+ {
+ "checksum": "1ee9487ccdcc131f376682db3af25a16",
+ "size": 3618,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-8953_logical_fuse_with_table_props_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql-9297_publish_ytcopy]": [
+ {
+ "checksum": "8a254f23012bf3421f8b6f4c18c34794",
+ "size": 3219,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql-9297_publish_ytcopy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql_5830_fuse_outer_with_extra_deps]": [
+ {
+ "checksum": "f07044e82b9883a073238ac60480e4e8",
+ "size": 3510,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_optimizers-yql_5830_fuse_outer_with_extra_deps_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yql_6179_merge_chunks_of_outputs]": [
+ {
+ "checksum": "05ed58069252774e345a3c056cca3831",
+ "size": 3473,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yql_6179_merge_chunks_of_outputs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yson_dup_serialize]": [
+ {
+ "checksum": "c880ca60e909a0a06684cb3254491b9a",
+ "size": 3430,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yson_dup_serialize_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[optimizers-yt_shuffle_by_keys]": [
+ {
+ "checksum": "63da169cd82731e8f1f4261f391eeb08",
+ "size": 3519,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_optimizers-yt_shuffle_by_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-SortByOneFieldDesc]": [
+ {
+ "checksum": "b863bd77b713c0796ab85cee5b054aaa",
+ "size": 1154,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-SortByOneFieldDesc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-SortByOneField]": [
+ {
+ "checksum": "6995924835fa9df534bf99b4b98591bf",
+ "size": 1153,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-SortByOneField_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-SortByTwoFieldsDesc]": [
+ {
+ "checksum": "a1e152bba02bd4efcbbba742bb54535a",
+ "size": 1351,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-SortByTwoFieldsDesc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-SortByTwoFields]": [
+ {
+ "checksum": "469085d711636738497db72f98007a6b",
+ "size": 1349,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-SortByTwoFields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-assume_cut_prefix]": [
+ {
+ "checksum": "31748e09453f22c36b4ee5e62d41ba5e",
+ "size": 1178,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-assume_cut_prefix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-assume_over_input]": [
+ {
+ "checksum": "acf150c9f858b24c201fc65a01cc6021",
+ "size": 1291,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-assume_over_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-assume_over_input_desc]": [
+ {
+ "checksum": "9bff1e460472b8a730d9c8c4077b608b",
+ "size": 1259,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-assume_over_input_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-assume_with_filter]": [
+ {
+ "checksum": "8230275d2f6284f2575d2b151eadf584",
+ "size": 1636,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-assume_with_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-assume_with_transform_desc]": [
+ {
+ "checksum": "61993f6e7f11b7b5d76da53c775b85cd",
+ "size": 1495,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-assume_with_transform_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-changed_sort_with_limit]": [
+ {
+ "checksum": "45bffc739c335ddfd982c1c8b2e6004d",
+ "size": 1648,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-changed_sort_with_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-extract_members_over_sort_desc]": [
+ {
+ "checksum": "c5df887c815f1ca10827cc93a94bf6de",
+ "size": 2810,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-extract_members_over_sort_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-limit]": [
+ {
+ "checksum": "0b4da0b4a06c4e6bb481b220802a2294",
+ "size": 1259,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal]": [
+ {
+ "checksum": "de6fd7bcd9369f10544fc6a85690d69d",
+ "size": 1639,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_complex]": [
+ {
+ "checksum": "4f54ad7cba5c381abd04918aaf2e13d9",
+ "size": 1323,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-literal_complex_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_desc]": [
+ {
+ "checksum": "b955cb9a068f8caa58431cfe26f79585",
+ "size": 1640,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-literal_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_empty_list_sort]": [
+ {
+ "checksum": "2323ce58fdb212d964d15ae040fef925",
+ "size": 1156,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-literal_empty_list_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_single_item_sort]": [
+ {
+ "checksum": "666132c2c3bc3326476746f57d28dfb1",
+ "size": 1119,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-literal_single_item_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_take_zero_sort]": [
+ {
+ "checksum": "1381df5de137191c033fa8d2ae2fc259",
+ "size": 1483,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-literal_take_zero_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_with_assume]": [
+ {
+ "checksum": "b27fbb96b3ac761e8145844db6725a61",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-literal_with_assume_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-literal_with_assume_desc]": [
+ {
+ "checksum": "9e3034cea3c326a1bc9d0027c4b573ae",
+ "size": 1661,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-literal_with_assume_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-native_desc_assume_with_transform]": [
+ {
+ "checksum": "890c127932d6604940f70a6c66e85840",
+ "size": 1586,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-native_desc_assume_with_transform_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-native_desc_publish]": [
+ {
+ "checksum": "351ab9a0f8581d58a94a666c3e73041c",
+ "size": 2199,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-native_desc_publish_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-native_desc_sort]": [
+ {
+ "checksum": "d078159fa7ac8ec7f642648f2555788e",
+ "size": 1262,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-native_desc_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-native_desc_sort_calc]": [
+ {
+ "checksum": "02b230ea014c0c1291d1fb736f3d8319",
+ "size": 1352,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-native_desc_sort_calc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-native_desc_sort_with_limit]": [
+ {
+ "checksum": "517650b04d6c873dde28acdca1fbcd03",
+ "size": 1408,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-native_desc_sort_with_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_dot_column]": [
+ {
+ "checksum": "70f9a51ee654650e1f2a10c4257c38c1",
+ "size": 1419,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_dot_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_dynum]": [
+ {
+ "checksum": "727534bff1f2b440d1ef7304173a4743",
+ "size": 1206,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_dynum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_dynum_desc]": [
+ {
+ "checksum": "6ab92a2a0591391b7762b9957881c7c4",
+ "size": 1207,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_dynum_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_expr]": [
+ {
+ "checksum": "77bedb1bbd07510d5c4980ae88fc4334",
+ "size": 1356,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_order_by-order_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_expr_mul_cols]": [
+ {
+ "checksum": "df4e6383945f4469cdc0747caffaa8b4",
+ "size": 1633,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_order_by-order_by_expr_mul_cols_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_expr_over_sorted_table]": [
+ {
+ "checksum": "0f08f6676fde17ba09a26957d8d743b3",
+ "size": 1537,
+ "uri": "https://{canondata_backend}/1942100/c4bce5e5892336c582b82452a749ad078406235f/resource.tar.gz#test_sql2yql.test_order_by-order_by_expr_over_sorted_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_expr_simple]": [
+ {
+ "checksum": "33e3892cb3e6f8883af3d7ba8657b245",
+ "size": 1319,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_order_by-order_by_expr_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_expr_with_deps]": [
+ {
+ "checksum": "2294a5829cf4e2736615ccff50f94fb5",
+ "size": 2315,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-order_by_expr_with_deps_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_list_of_strings]": [
+ {
+ "checksum": "3a795556bb2be116342eaf7a72bf32d3",
+ "size": 1402,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_list_of_strings_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column]": [
+ {
+ "checksum": "5279857b1fc3341d168708325cb3f123",
+ "size": 10491,
+ "uri": "https://{canondata_backend}/1937429/114961b26476797b95763679349a6ea2e9f8cea8/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column_as_table]": [
+ {
+ "checksum": "482a0162b6499b47cd62b6d5d19d14fc",
+ "size": 4529,
+ "uri": "https://{canondata_backend}/1937001/6c1efa96a2ae4050b12a9381285624ab71389741/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_as_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column_ignored]": [
+ {
+ "checksum": "f844bc6856fa7358172cb5bf2442f9e6",
+ "size": 6492,
+ "uri": "https://{canondata_backend}/1871182/b560fdc93cb96ca9e574901b22abd265bdefb213/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_ignored_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column_join2]": [
+ {
+ "checksum": "98039874784e044ceb5ba77e2e8158b8",
+ "size": 3496,
+ "uri": "https://{canondata_backend}/1814674/b5f58d06faf616e33e81d1596c8a849f37284058/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_join2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column_join]": [
+ {
+ "checksum": "74c9e8c341785c084195974f3649ccc6",
+ "size": 20470,
+ "uri": "https://{canondata_backend}/1903280/1a220e4d3fac05e34ef889600ae82e2c121901d0/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_missing_project_column_join_types]": [
+ {
+ "checksum": "9ea8f0a0e4052e5ab683483361fd7533",
+ "size": 20772,
+ "uri": "https://{canondata_backend}/1781765/c04cbb08c79f2b2bfd260dde1ea706c5a9450568/resource.tar.gz#test_sql2yql.test_order_by-order_by_missing_project_column_join_types_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_mul_columns]": [
+ {
+ "checksum": "3e69e4405b6dff02d1127352fe46de57",
+ "size": 1532,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_mul_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_num_key_and_subkey]": [
+ {
+ "checksum": "7f2428980671bd403c4e9598552b526c",
+ "size": 1559,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_num_key_and_subkey_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_num_key_and_subkey_desc]": [
+ {
+ "checksum": "5bfc1e48d47887cb7b013a6ea839009b",
+ "size": 1584,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_num_key_and_subkey_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tablepath_column]": [
+ {
+ "checksum": "810edd8965ce6b6bf4d32c18050e9979",
+ "size": 1239,
+ "uri": "https://{canondata_backend}/1600758/7bfd1ef457afc0ff28f5975f5deac4cbe6c60f7f/resource.tar.gz#test_sql2yql.test_order_by-order_by_tablepath_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tablerecord_column]": [
+ {
+ "checksum": "55f5a6c623c716379a564b899532848a",
+ "size": 1184,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_tablerecord_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tablerow_column]": [
+ {
+ "checksum": "9503724a3160cf67b070761ef24ae1f1",
+ "size": 1225,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_tablerow_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tuple]": [
+ {
+ "checksum": "c0664f4bde19aaad56df78b5ea2c0719",
+ "size": 1821,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tuple_and_member]": [
+ {
+ "checksum": "becfa1d1706a83d25e32b45d4a328398",
+ "size": 1878,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_tuple_and_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_tuple_expr]": [
+ {
+ "checksum": "b52cd2f6dfcb81314beaa2e51c4d31f4",
+ "size": 1252,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_tuple_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_udf]": [
+ {
+ "checksum": "6851077b4dd6491b5d49f73631e0edff",
+ "size": 1262,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_udf_duo]": [
+ {
+ "checksum": "146d984a7cd3ca8b04e3842ae332415d",
+ "size": 1404,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_udf_duo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_by_value_desc]": [
+ {
+ "checksum": "5fa4e303c1220ae4f31f81cffd358a5f",
+ "size": 1473,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_by_value_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-order_with_null]": [
+ {
+ "checksum": "4703f8d3df9f3c87e5f54912ebc5ab83",
+ "size": 3270,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-order_with_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-ordered_fill]": [
+ {
+ "checksum": "592a5175e506dd5fe15fdaf0168be576",
+ "size": 2723,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-ordered_fill_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-presort_mem]": [
+ {
+ "checksum": "7814c23c438c7f963d3336d91035fc7c",
+ "size": 7216,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-presort_mem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-presort_order_by_table]": [
+ {
+ "checksum": "c3630e6a1172a91e5be580a569aff066",
+ "size": 2628,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-presort_order_by_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-single_item_tuple]": [
+ {
+ "checksum": "f938801a012eb57dfd25f23d196e0f14",
+ "size": 1034,
+ "uri": "https://{canondata_backend}/1817427/5e8ae58c26cdec13ac543386e61978379a144473/resource.tar.gz#test_sql2yql.test_order_by-single_item_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-singular]": [
+ {
+ "checksum": "e6e920081153b864c322e7914bf31b37",
+ "size": 2449,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-singular_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-sort]": [
+ {
+ "checksum": "a8d4cb2b9a28c17e58cd3c9c7cc4d805",
+ "size": 1325,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-sort_decimals]": [
+ {
+ "checksum": "3a885ad1e93dbce52d28a2158face881",
+ "size": 4154,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-sort_decimals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-sort_simple]": [
+ {
+ "checksum": "afa16d31c32291ea94bbe6c66a0382d5",
+ "size": 4829,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-sort_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-sort_with_take]": [
+ {
+ "checksum": "1554bdf1d2e0837cb40b06da0da57e9e",
+ "size": 1767,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-sort_with_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-sort_with_take_limit]": [
+ {
+ "checksum": "75c189eb8fec7f733b9b301bd7d3ed16",
+ "size": 1853,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_order_by-sort_with_take_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-tuple01]": [
+ {
+ "checksum": "2d20e45de88f1f85abcbb3281afbca7e",
+ "size": 4703,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-tuple01_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-union_all]": [
+ {
+ "checksum": "171bb0bde62a69346d4a0d1a74b4bccb",
+ "size": 2444,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_order_by-union_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[order_by-warn_offset_wo_sort]": [
+ {
+ "checksum": "5bc35e9d1c3324cd9822ad1b71e6e282",
+ "size": 1254,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_order_by-warn_offset_wo_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-complex_yson]": [
+ {
+ "checksum": "3faad1f8fad5593a3b5a021c2448c8f1",
+ "size": 1082,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-complex_yson_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-dict]": [
+ {
+ "checksum": "1c707d967d36b8baaefba732375f4172",
+ "size": 2262,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-list]": [
+ {
+ "checksum": "4407a3abd07577f588f5821170fa7045",
+ "size": 1890,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-missing_param_fail]": [
+ {
+ "checksum": "0e7fddfc648bb4ec08c7bb41d85bc8d1",
+ "size": 1069,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-missing_param_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-no_optional_param]": [
+ {
+ "checksum": "face0a9335e487c90252b57c03525946",
+ "size": 1085,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-no_optional_param_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-no_params_fail]": [
+ {
+ "checksum": "933a53e8d7be6ab18ad5259402df3416",
+ "size": 1044,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-no_params_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-param_in_in_predicate]": [
+ {
+ "checksum": "f6dc0df75f2a0b0fc00201d40a9e6a16",
+ "size": 1262,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-param_in_in_predicate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-param_in_json_api]": [
+ {
+ "checksum": "4384d81714c20135f6650b02224acdd6",
+ "size": 2508,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-param_in_json_api_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-param_type_mismatch_fail]": [
+ {
+ "checksum": "808af1f6fd6764798bae85f5c6b61dda",
+ "size": 1045,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-param_type_mismatch_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-primitives]": [
+ {
+ "checksum": "e2f3872469d7ec730942238994cd0484",
+ "size": 6042,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-primitives_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-struct]": [
+ {
+ "checksum": "ded0d0cd68429c2e85411d4b0f2268f8",
+ "size": 1264,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-tuple]": [
+ {
+ "checksum": "8570863a63e6b0040fca4ebbeb4efa3f",
+ "size": 1762,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[params-variant]": [
+ {
+ "checksum": "67d75c27cac56444724b10a9e7769860",
+ "size": 1832,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_params-variant_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggr_compare]": [
+ {
+ "checksum": "54e49ec5124e9b170c31262135ecc1ed",
+ "size": 3790,
+ "uri": "https://{canondata_backend}/212715/13599fb3badde5c5b2ea604f6dac9a314715e4c2/resource.tar.gz#test_sql2yql.test_pg-aggr_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_combine]": [
+ {
+ "checksum": "ae30aa0e2ac8f3bc8e030592a62e787c",
+ "size": 821,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_combine_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_combine_all]": [
+ {
+ "checksum": "dbe732e86c94fa19de2ebe4397d244e6",
+ "size": 685,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_combine_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_ctx]": [
+ {
+ "checksum": "2ba0024dccefda5365bee0cc1cd5f680",
+ "size": 739,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_ctx_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_distinct]": [
+ {
+ "checksum": "fd18013da61ec1efefeb93c9a0e712a1",
+ "size": 1590,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_emit_agg_apply]": [
+ {
+ "checksum": "b16e45a03260d40acaeac179bb633e4f",
+ "size": 749,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_emit_agg_apply_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_factory]": [
+ {
+ "checksum": "a4c5bf80700a6964f93e7a58f518c28b",
+ "size": 8397,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-aggregate_factory_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_minus_zero]": [
+ {
+ "checksum": "ea069a128462e113dd138369ec1c7143",
+ "size": 986,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_minus_zero_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-aggregate_scalar_minus_zero]": [
+ {
+ "checksum": "e31495bdab260e23b7f952911176f500",
+ "size": 997,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-aggregate_scalar_minus_zero_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-all_data]": [
+ {
+ "checksum": "e2e983a696817fe3cbebcbbf79264fd1",
+ "size": 623,
+ "uri": "https://{canondata_backend}/1923547/71449caaa5e8f922123c2ecb09c80f8f3f5583e8/resource.tar.gz#test_sql2yql.test_pg-all_data_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-avg_float_clone_init_value]": [
+ {
+ "checksum": "3e4ae01664c5195d9a1254f4f2c02787",
+ "size": 850,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-avg_float_clone_init_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-bit_const]": [
+ {
+ "checksum": "d6402b457e54d96da3b4b1011e22d35e",
+ "size": 1254,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-bit_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-cast_int_to_bit]": [
+ {
+ "checksum": "81030d72a549a4f2688a79d47a569d95",
+ "size": 759,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-cast_int_to_bit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-cbo_pragma1]": [
+ {
+ "checksum": "81632879a35e4d1aa37e9da8a9c6b37a",
+ "size": 529,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-cbo_pragma1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-cbo_pragma2]": [
+ {
+ "checksum": "dd7ecceab4ced8bde0160c555f2ec0c1",
+ "size": 533,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-cbo_pragma2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-coalesce]": [
+ {
+ "checksum": "ba75751caccb36b118d138f505855f19",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-coalesce_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-compare]": [
+ {
+ "checksum": "e6b42df136a2e614f66c8fa329078a7d",
+ "size": 5148,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-current_database]": [
+ {
+ "checksum": "785e80466caf2d5452f2a06a125d80ac",
+ "size": 467,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-current_database_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-dates_from_pg]": [
+ {
+ "checksum": "e4a3759f914547d346c4d7f7a05d3b7b",
+ "size": 2033,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-dates_from_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-dates_to_pg]": [
+ {
+ "checksum": "67a16578aaf843c47d41a1f1c281258f",
+ "size": 2920,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-dates_to_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-def_column_name_func]": [
+ {
+ "checksum": "32df73cb69210c82723ae5212d51c7d3",
+ "size": 478,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-def_column_name_func_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-distinct_all_projection]": [
+ {
+ "checksum": "25285e8aa1d68e0838f0bd0b3a0348dc",
+ "size": 772,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-distinct_all_projection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-distinct_on_multi_projection]": [
+ {
+ "checksum": "bd0d27f4408aad130027ee213f4058a1",
+ "size": 1321,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-distinct_on_multi_projection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-distinct_on_single_projection_no_order]": [
+ {
+ "checksum": "c0a5fbbff7332a2fe57a588249a39b9b",
+ "size": 976,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-distinct_on_single_projection_no_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-distinct_on_single_projection_order]": [
+ {
+ "checksum": "193547e3859095dd0645eedf4d8189b1",
+ "size": 1095,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-distinct_on_single_projection_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-distinct_on_single_projection_order_expr]": [
+ {
+ "checksum": "edda22e1c03c3f8edc7f88d6151f5829",
+ "size": 1175,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-distinct_on_single_projection_order_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-doubles_search_path]": [
+ {
+ "checksum": "59032564ff9bc4462cca882f0d7c488c",
+ "size": 640,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-doubles_search_path_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-drop_table]": [
+ {
+ "checksum": "a17122997a6bf872af77c286174322eb",
+ "size": 1072,
+ "uri": "https://{canondata_backend}/1773845/51dddb62bab338531c7d40a97ff817188ae84088/resource.tar.gz#test_sql2yql.test_pg-drop_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-equals_where_over_cross2]": [
+ {
+ "checksum": "81d4b9610e8fffc23cb92ae80d476daf",
+ "size": 1346,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-equals_where_over_cross2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-equals_where_over_cross]": [
+ {
+ "checksum": "1680a3298447c5d4d8e70c2b8fd203c4",
+ "size": 1142,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-equals_where_over_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-expr_op_array]": [
+ {
+ "checksum": "d0f2a32ccc32b04b0bc9d28c6c29417b",
+ "size": 2419,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-expr_op_array_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-in_mixed]": [
+ {
+ "checksum": "d2acc2a5be09fe863bd2b409b12298ec",
+ "size": 3799,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-in_mixed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-in_sorted]": [
+ {
+ "checksum": "8c8e6c4265eb6f4f0d37eafa1c5c18b9",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-in_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-insert]": [
+ {
+ "checksum": "70c34324ad23c7495f7315d026f79f5f",
+ "size": 596,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-insert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-interval_to_pg]": [
+ {
+ "checksum": "361c6662454e4712d0ad3fd28184ffe0",
+ "size": 2076,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-interval_to_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-is_predicate]": [
+ {
+ "checksum": "9926b42b1933ea712b9e9b248d133c4b",
+ "size": 1175,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-is_predicate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_brackets1]": [
+ {
+ "checksum": "f028de78d6e1d7e6ddfc57756e2baf98",
+ "size": 1678,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_brackets1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_brackets2]": [
+ {
+ "checksum": "2ae62b36840d83dbde9566a49dbe6081",
+ "size": 5634,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_brackets2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_groups]": [
+ {
+ "checksum": "ca3d3ddd10fa1cc93d298af0af79fa9a",
+ "size": 1106,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_groups_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_tree_order]": [
+ {
+ "checksum": "ccdf19008cb38637422026d0ea06e9b8",
+ "size": 1232,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_tree_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using1]": [
+ {
+ "checksum": "5d5548f1fd6eea7f4ef14d445157c25f",
+ "size": 1218,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using2]": [
+ {
+ "checksum": "9967b1f30aa0bed97672f3af405442c6",
+ "size": 1254,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using3]": [
+ {
+ "checksum": "687d806f68b12493367a2d058b493e0a",
+ "size": 1636,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using4]": [
+ {
+ "checksum": "94371906321bbd7c19ae289f0c60e982",
+ "size": 1636,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using4_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using5]": [
+ {
+ "checksum": "95fbc57e80fe89b2e692d2e53f1cc1dd",
+ "size": 914,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using5_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using6]": [
+ {
+ "checksum": "4e5b826a872e30f347603cec23c21ee5",
+ "size": 892,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using6_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using7]": [
+ {
+ "checksum": "02266149e792093f32f3f1c4eeadbbd0",
+ "size": 1268,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using7_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using8]": [
+ {
+ "checksum": "b500c038af0551a249a6d7880c382d83",
+ "size": 1172,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using9]": [
+ {
+ "checksum": "3be9bbb04daa61a411a9e65333e3cb72",
+ "size": 1330,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using9_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_case_insensetive1]": [
+ {
+ "checksum": "2df8fd3db6de6113a948ed6ede111414",
+ "size": 829,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_case_insensetive1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_case_insensetive2]": [
+ {
+ "checksum": "7af1852012909cec007f0875b571b1c4",
+ "size": 909,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_case_insensetive2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_multiple1]": [
+ {
+ "checksum": "dfb4a4a9dc048707ffa08d55848a4eaf",
+ "size": 1310,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_multiple1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_multiple2]": [
+ {
+ "checksum": "7c89d2c75ff2cd041fd2cde07d75e2de",
+ "size": 1068,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_multiple2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_multiple3]": [
+ {
+ "checksum": "88e2f0c0d4c52aebba7547b7ed6f03df",
+ "size": 1567,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_multiple3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_table_used_order1]": [
+ {
+ "checksum": "bf1b4297f2105c46013a2ddf75f88d1b",
+ "size": 1235,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_table_used_order1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_table_used_order2]": [
+ {
+ "checksum": "6c5257256f68de61afa7b27ac2be3f67",
+ "size": 1381,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_table_used_order2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_table_used_order]": [
+ {
+ "checksum": "79b9e44768691b23c7d3a8e679da94d8",
+ "size": 1365,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_table_used_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_tables1]": [
+ {
+ "checksum": "d649a8bc0ce506512d8eeeaa24ca5493",
+ "size": 885,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_tables1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_tables2]": [
+ {
+ "checksum": "d0a1914e33f3e8f05f3ee65b8b82e2d8",
+ "size": 885,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_tables2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_tables3]": [
+ {
+ "checksum": "f6264e86f800d42f29cbfa99eb802fd0",
+ "size": 889,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_tables3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-join_using_tables4]": [
+ {
+ "checksum": "a00f1f06d99a367ddbd677a83a0d5e60",
+ "size": 887,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-join_using_tables4_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-lang_sql]": [
+ {
+ "checksum": "74fd67be67b0abb2f68be7237122beea",
+ "size": 506,
+ "uri": "https://{canondata_backend}/1600758/9199c5afb4cd82c5d21dab53840f5f107d2a4aee/resource.tar.gz#test_sql2yql.test_pg-lang_sql_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-long_ident]": [
+ {
+ "checksum": "18ec38e24eda96dbdf6d78e3898c520f",
+ "size": 516,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-long_ident_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-multi_usage_cross_join]": [
+ {
+ "checksum": "97f9dddaf144451340a89b05cf0a674a",
+ "size": 1878,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-multi_usage_cross_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-name]": [
+ {
+ "checksum": "e436be08fed8e1a37251249ea051fce7",
+ "size": 794,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-name_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-nothing]": [
+ {
+ "checksum": "a2ab521904ef4f458972643b957b7815",
+ "size": 808,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-nothing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-nullif]": [
+ {
+ "checksum": "b5c71975a05df55f0605a36339d5988c",
+ "size": 971,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-nullif_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-nulls]": [
+ {
+ "checksum": "dc93c046187455eddd3eaa7bde74e5cf",
+ "size": 5740,
+ "uri": "https://{canondata_backend}/1889210/b146620fd4d09c1c222f1b1341d4d70863b98fe6/resource.tar.gz#test_sql2yql.test_pg-nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-nulls_native]": [
+ {
+ "checksum": "2a270852bd9dda4f0cf7d41c40d96d80",
+ "size": 5830,
+ "uri": "https://{canondata_backend}/1889210/b146620fd4d09c1c222f1b1341d4d70863b98fe6/resource.tar.gz#test_sql2yql.test_pg-nulls_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-numbers_to_pg]": [
+ {
+ "checksum": "cab84d866e037bed91a0a711ef8b4a4c",
+ "size": 4237,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-numbers_to_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-numeric_to_pg]": [
+ {
+ "checksum": "6d3b5b5dfae70cf7c10d4a12bd3953ab",
+ "size": 1718,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-numeric_to_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_extra_for_keys]": [
+ {
+ "checksum": "58b47ac474220c8fa54cb78a9f01665a",
+ "size": 967,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_extra_for_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_input_columns_aggr]": [
+ {
+ "checksum": "857de65f74c7e7e36a62481efe338b14",
+ "size": 930,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_input_columns_aggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_input_columns_full]": [
+ {
+ "checksum": "5ea3fcb5b532fc1ecadd39b229d5868a",
+ "size": 871,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_input_columns_full_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_input_columns_keys]": [
+ {
+ "checksum": "6bb97c63717bbea7996882f64377db01",
+ "size": 928,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_input_columns_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_input_columns_prj_and_aggr]": [
+ {
+ "checksum": "a1cd03617859d2f2335e3a00dd7d661d",
+ "size": 1021,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_input_columns_prj_and_aggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_input_columns_prj_and_keys_and_aggr]": [
+ {
+ "checksum": "e1e346b21c93a07c15ee876d15addcfe",
+ "size": 1081,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_input_columns_prj_and_keys_and_aggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_agg_no_extra_for_aggs]": [
+ {
+ "checksum": "31b2a0068af14e998b7a2d2f3e948a94",
+ "size": 728,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_agg_no_extra_for_aggs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_distinct_same_expr]": [
+ {
+ "checksum": "98506a1175d8a628970d682b2ae57afa",
+ "size": 999,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_distinct_same_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_distinct_same_expr_agg]": [
+ {
+ "checksum": "da5c6ee312f1c650e1810ef23b0d7de4",
+ "size": 1575,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_distinct_same_expr_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_distinct_same_expr_agg_sublink]": [
+ {
+ "checksum": "8354e44615d0a83fdb3d3d73dc65c03d",
+ "size": 1624,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_distinct_same_expr_agg_sublink_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_input_columns]": [
+ {
+ "checksum": "16fab271f9a9719f4cee739e5c6c8141",
+ "size": 849,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_input_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_input_columns_qual]": [
+ {
+ "checksum": "1a0db07d9b17bcdf6e4a6cbfaed046e7",
+ "size": 854,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_input_columns_qual_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_shadow_input_columns]": [
+ {
+ "checksum": "47f4317f4739f5336647a2eac4d94b82",
+ "size": 861,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_shadow_input_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-order_by_shadow_input_columns_qual]": [
+ {
+ "checksum": "acea5349897f1b286e1446e797478c45",
+ "size": 866,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-order_by_shadow_input_columns_qual_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-palloc_big_string]": [
+ {
+ "checksum": "ad8370439cfd8aee061fcc68b2b6da72",
+ "size": 65946,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-palloc_big_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-parametrized]": [
+ {
+ "checksum": "d8475810f5f9da6cfe0a34571b8d6c1b",
+ "size": 547,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-parametrized_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_array_cast]": [
+ {
+ "checksum": "d44c2559c5725bead56fb747b8729c75",
+ "size": 1558,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_array_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_array_compare]": [
+ {
+ "checksum": "8f7108180e9221d19ef5b187a1b4e945",
+ "size": 759,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_array_compare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_array_literal]": [
+ {
+ "checksum": "6076285e27f556287da548be2ac95956",
+ "size": 2036,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_array_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_column_case]": [
+ {
+ "checksum": "39991d5da2bdee468450db70e8ab39a5",
+ "size": 1224,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_column_case_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_corr_count]": [
+ {
+ "checksum": "f5a5812680aff8a5f17562483dd6f7ce",
+ "size": 1223,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_corr_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_corr_limit]": [
+ {
+ "checksum": "22d3e6d7989af46f9b506b6411775d16",
+ "size": 1314,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_corr_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_corr_offset]": [
+ {
+ "checksum": "b6df5de3cbfabe6fbaf6566476ecd035",
+ "size": 1315,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_corr_offset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_corr_sort_limit2]": [
+ {
+ "checksum": "4fe39352c201ec387e37a6efa24f25d1",
+ "size": 1725,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_corr_sort_limit2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_corr_sort_limit]": [
+ {
+ "checksum": "ac61f75c794b9399e0b809ad79441f8a",
+ "size": 1386,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_corr_sort_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_in_dict_key_with_stable_pickle]": [
+ {
+ "checksum": "1602ea06e06c5eaa03d74c1d25dbc59e",
+ "size": 3399,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_in_dict_key_with_stable_pickle_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_in_expr]": [
+ {
+ "checksum": "70d5dc47e50b73f1247e62c2504254c0",
+ "size": 1137,
+ "uri": "https://{canondata_backend}/1936997/05f697701504a606baee74febc584f27b8d9cfa1/resource.tar.gz#test_sql2yql.test_pg-pg_in_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_interval_literal]": [
+ {
+ "checksum": "72fcc1e760f195f932d9de4f2238d619",
+ "size": 870,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_interval_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_iterate]": [
+ {
+ "checksum": "776ef60a2ba5385372197ec39e44eb82",
+ "size": 4118,
+ "uri": "https://{canondata_backend}/1689644/58b94ee78c0b4d3f96a346070a311370cd242424/resource.tar.gz#test_sql2yql.test_pg-pg_iterate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_like]": [
+ {
+ "checksum": "52889bc431855f304d894ca92ab7cd61",
+ "size": 3290,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_like_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_like_cast]": [
+ {
+ "checksum": "b49aa5a260a093e90b1a18e581b14622",
+ "size": 840,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_like_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_like_opt]": [
+ {
+ "checksum": "77d278115dc2f044609232e001ebee19",
+ "size": 879,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_like_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_type_from_oid]": [
+ {
+ "checksum": "b67f61f5a4889720ab8ba3a5aeaad6a8",
+ "size": 1182,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_type_from_oid_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_aggregate1]": [
+ {
+ "checksum": "2dd868888f220277b25e6032c2fca9f5",
+ "size": 11472,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_types_aggregate1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_array_literal]": [
+ {
+ "checksum": "7c57bf8b30e2f4f417519fe3b32a450a",
+ "size": 1057,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_types_array_literal_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_cast_with_length]": [
+ {
+ "checksum": "a2ff5b5cd3e3bc8606160d126441f4f1",
+ "size": 1834,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-pg_types_cast_with_length_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_dict]": [
+ {
+ "checksum": "79c0813a8ff175aa559e73bfea0d9cd5",
+ "size": 6476,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_types_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_literal_mods]": [
+ {
+ "checksum": "0e7a1ff995729ae65bf673a7ab182c1a",
+ "size": 3798,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_types_literal_mods_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_literal_with_length]": [
+ {
+ "checksum": "ecf9cc52e110cae2745d265615b24083",
+ "size": 1484,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-pg_types_literal_with_length_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_orderby]": [
+ {
+ "checksum": "6fa7575bcfaa240f72c0e938000bd6b7",
+ "size": 5035,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_types_orderby_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_window1]": [
+ {
+ "checksum": "6db5793ef1087d64842cc34e75b75dca",
+ "size": 895,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_types_window1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_types_window2]": [
+ {
+ "checksum": "fd24f21bfdfe19760d94ed3c03e46c04",
+ "size": 1085,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_types_window2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pg_view]": [
+ {
+ "checksum": "46c1e1171a2ba78e8d2fdc14be835fc4",
+ "size": 1260,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-pg_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pgns_agg]": [
+ {
+ "checksum": "d8084a6545a07f42528921be288eb18a",
+ "size": 1622,
+ "uri": "https://{canondata_backend}/1942278/f9767af57fb40678ebac7071b53e03ed182ae745/resource.tar.gz#test_sql2yql.test_pg-pgns_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-pgns_proc]": [
+ {
+ "checksum": "8c7e5172b26cd5d3be6d582c0f8d9ab0",
+ "size": 1014,
+ "uri": "https://{canondata_backend}/1942278/f9767af57fb40678ebac7071b53e03ed182ae745/resource.tar.gz#test_sql2yql.test_pg-pgns_proc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-point]": [
+ {
+ "checksum": "eb9eb97cbb091b3417869b7e742edaa5",
+ "size": 808,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-point_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-range_function_multi]": [
+ {
+ "checksum": "ffdeec3bbd7a265d707be63fd25be371",
+ "size": 1498,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-range_function_multi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-range_function_multi_record]": [
+ {
+ "checksum": "188d02750a5b94c6450a268954c8fe46",
+ "size": 1500,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-range_function_multi_record_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-range_function_scalar]": [
+ {
+ "checksum": "38086bdef288bdadbb80bfa52da708b5",
+ "size": 1402,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-range_function_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-record_from_table_row]": [
+ {
+ "checksum": "86752eb93d9f568ce4cffec71c19d3ff",
+ "size": 754,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-record_from_table_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-reflection]": [
+ {
+ "checksum": "39b503f678eac93d99a4b0139ed1241e",
+ "size": 1209,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-reflection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-regoids]": [
+ {
+ "checksum": "cfee748ff3069e2026aa878742187dd1",
+ "size": 4216,
+ "uri": "https://{canondata_backend}/1600758/02851b6238039a3162d6f222d34d79a59e24c249/resource.tar.gz#test_sql2yql.test_pg-regoids_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg]": [
+ {
+ "checksum": "41e072bb19014620fde3d72b6c54bf1b",
+ "size": 1045,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_expr_having]": [
+ {
+ "checksum": "14ba8d2075a04cce94f1af6ea7e053bc",
+ "size": 921,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_expr_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_expr_key_under_agg]": [
+ {
+ "checksum": "89968a210abe9a3d9b6bac93cb98a120",
+ "size": 784,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_expr_key_under_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_expr_order]": [
+ {
+ "checksum": "7e7a0400ddd155d1b66b5fe52cda01bd",
+ "size": 879,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_expr_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_expr_projection]": [
+ {
+ "checksum": "f0b27678f89ca48144bd8d56d215cf65",
+ "size": 812,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_expr_projection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_group]": [
+ {
+ "checksum": "c556ba55cb3895d29d107a22592a6774",
+ "size": 1179,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_group_key_only]": [
+ {
+ "checksum": "e6515bf7c667dd944fab5f4d96c2474e",
+ "size": 855,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_group_key_only_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_gs_cube]": [
+ {
+ "checksum": "10e6bf2092d867193aab7cd83a20395f",
+ "size": 1135,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_gs_cube_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_gs_grouping]": [
+ {
+ "checksum": "d39545a435d3514532eaf746fb04a952",
+ "size": 1388,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_gs_grouping_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_gs_rollup]": [
+ {
+ "checksum": "8227c7ba50a89bbb1ac0f4e69e656ba9",
+ "size": 1137,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_gs_rollup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_gs_sets]": [
+ {
+ "checksum": "e481b48cdb97684765814db65244fbf1",
+ "size": 1142,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_gs_sets_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_one_row]": [
+ {
+ "checksum": "8b32416a7d7ca77a4b9a644ef8912098",
+ "size": 2026,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_agg_one_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_qstar]": [
+ {
+ "checksum": "f9cbc07fe9b1f8d8895c823976850a4c",
+ "size": 954,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_agg_star]": [
+ {
+ "checksum": "89141b40b4af576a264eebfa3da07363",
+ "size": 866,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_agg_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_alias_partial]": [
+ {
+ "checksum": "a7d4a9cfc416175cc39dec88ab906144",
+ "size": 941,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_alias_partial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_and_or_group]": [
+ {
+ "checksum": "71d5c1a8dde7fa1e1c615fd76cd9ded7",
+ "size": 1447,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_and_or_group_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_between]": [
+ {
+ "checksum": "784c470599c777c2c43c99fb131edb9a",
+ "size": 2885,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_between_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_case]": [
+ {
+ "checksum": "3c232331259bbf95e3120e4ea650a83a",
+ "size": 8687,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_case_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_cast_same_arg]": [
+ {
+ "checksum": "ac492f9a6873979ade061e094e4c96b8",
+ "size": 557,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_cast_same_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_columnref1]": [
+ {
+ "checksum": "8dbaa47109b7c8b43cee58bec544c7f9",
+ "size": 850,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_columnref1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_columnref2]": [
+ {
+ "checksum": "86cc7d712d6a14aab9f1a5af7a308ddd",
+ "size": 1155,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_columnref2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_except]": [
+ {
+ "checksum": "b83083b02a7155b5114a2de544b7793e",
+ "size": 617,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_common_type_except_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_exceptall]": [
+ {
+ "checksum": "886ee129a8cdad0203695a72d5b4fcf2",
+ "size": 729,
+ "uri": "https://{canondata_backend}/1781765/838f2ea2c0326d84b118c1ad739c96cc6935c327/resource.tar.gz#test_sql2yql.test_pg-select_common_type_exceptall_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_if]": [
+ {
+ "checksum": "19344504b0b051a32e50702097f9e55a",
+ "size": 617,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_common_type_if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_intersect]": [
+ {
+ "checksum": "745dcfc69c280dc933269451c43ae0ed",
+ "size": 1325,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_common_type_intersect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_intersectall]": [
+ {
+ "checksum": "eb48b7c242d8e2c1610da2f19e42cf8c",
+ "size": 667,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_common_type_intersectall_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_union]": [
+ {
+ "checksum": "5d108e689ec0ce2515c52e1cea15e336",
+ "size": 818,
+ "uri": "https://{canondata_backend}/1781765/838f2ea2c0326d84b118c1ad739c96cc6935c327/resource.tar.gz#test_sql2yql.test_pg-select_common_type_union_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_common_type_unionall]": [
+ {
+ "checksum": "ac10a524acd43e93d5c0b21829190a20",
+ "size": 3056,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_common_type_unionall_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_except]": [
+ {
+ "checksum": "3c704881e8296644b35ab0b91ad4e5dc",
+ "size": 2844,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_except_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_except_all]": [
+ {
+ "checksum": "5aaab0875382dd512b1032192c7aec67",
+ "size": 2918,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_except_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_from_columns]": [
+ {
+ "checksum": "25b6111b3c77fbdffa751a33ece45797",
+ "size": 644,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_from_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_from_columns_qstar]": [
+ {
+ "checksum": "55a5b2a4f0c4bfa7ef23026ba795bb91",
+ "size": 647,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_from_columns_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_from_columns_scalar]": [
+ {
+ "checksum": "cc7af31ac84fe8ce428e2471e67cd45a",
+ "size": 649,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_from_columns_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_from_columns_star]": [
+ {
+ "checksum": "cbd8e9024964a6d040476b46ed0f86c2",
+ "size": 633,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_from_columns_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_having]": [
+ {
+ "checksum": "3badaf68cb420e08e55319f98a58a26d",
+ "size": 1056,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_having_no_from]": [
+ {
+ "checksum": "cdad4065ec0aced6d2785bcf7d0188a7",
+ "size": 992,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_having_no_from_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_having_same_agg]": [
+ {
+ "checksum": "eaf52a1fed5ad677ed7a056dcbcfa9fe",
+ "size": 1060,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_having_same_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_intersect]": [
+ {
+ "checksum": "6c02980a2536963580cc57c329fbc292",
+ "size": 1931,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_intersect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_intersect_all]": [
+ {
+ "checksum": "6703ddb9906f9c2af2b933d252fde980",
+ "size": 1939,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_intersect_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_is_null]": [
+ {
+ "checksum": "602d07d3030c96fc3eeaabdca22e9e21",
+ "size": 763,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_is_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_cross]": [
+ {
+ "checksum": "4aaa7229376a7e3e4bc066f5ab513162",
+ "size": 1579,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_cross_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_cross_and_inner]": [
+ {
+ "checksum": "00573b6b484c78cbb34a569b0a9594f8",
+ "size": 4208,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_cross_and_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full3]": [
+ {
+ "checksum": "08599691db02e59dba57bbad4ccf939f",
+ "size": 2214,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full]": [
+ {
+ "checksum": "7a216900832b42a0bab4a465eded570e",
+ "size": 1676,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full_const]": [
+ {
+ "checksum": "5358b8b2e9507546172869a026c2f517",
+ "size": 9958,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full_equi]": [
+ {
+ "checksum": "e58948912c24c8aadbc8cd9c836391e4",
+ "size": 2112,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_equi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full_equi_and_const]": [
+ {
+ "checksum": "035ddc44782c201df92709c0bd41fc33",
+ "size": 2276,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_equi_and_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full_equi_and_one]": [
+ {
+ "checksum": "031c4a52d090e37f11c9606bbae9413d",
+ "size": 2188,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_equi_and_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_full_one]": [
+ {
+ "checksum": "8bf8d7df9cdf8fdd2911aefd9fe890f6",
+ "size": 3986,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_full_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner3]": [
+ {
+ "checksum": "7f505e2bd1dd1cff671f42a9c16f9f5c",
+ "size": 4318,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner]": [
+ {
+ "checksum": "fd2ca8393f8446cfe75cad4bc3042ab3",
+ "size": 1678,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner_const]": [
+ {
+ "checksum": "faeae6a53b8c005704843516b4de50e6",
+ "size": 9966,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner_equi]": [
+ {
+ "checksum": "b7c3a288d542512a7c8bd8beb0287254",
+ "size": 2114,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_equi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner_equi_and_const]": [
+ {
+ "checksum": "836221d8049799837f2e67e78d389fd9",
+ "size": 2278,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_equi_and_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner_equi_and_one]": [
+ {
+ "checksum": "ae7b1074cd0513ae63290661edbeb307",
+ "size": 2190,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_equi_and_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_inner_one]": [
+ {
+ "checksum": "8ee97746e08e3e9b9d2f57aefc841ca2",
+ "size": 3990,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_inner_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left3]": [
+ {
+ "checksum": "f06017efdb8930d044aa710f83e5e618",
+ "size": 2214,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left]": [
+ {
+ "checksum": "e82df98f2419d7b1313056c23f397e72",
+ "size": 1676,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left_const]": [
+ {
+ "checksum": "fff84d6492c8b4772a83573dbcff90e6",
+ "size": 9958,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left_equi]": [
+ {
+ "checksum": "1f31cdd898bf819012bd21186b862721",
+ "size": 2112,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_equi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left_equi_and_const]": [
+ {
+ "checksum": "ddbd13d434e62c728d53c14c9ea08dd0",
+ "size": 2276,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_equi_and_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left_equi_and_one]": [
+ {
+ "checksum": "faef9577a749b6ebdab5aadc5bf4752e",
+ "size": 2188,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_equi_and_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_left_one]": [
+ {
+ "checksum": "22cfde3ab04933bd9c48febe586a33e0",
+ "size": 3986,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_left_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_qstar]": [
+ {
+ "checksum": "edbb377fd0694f3f26f089bb778953b7",
+ "size": 3279,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right3]": [
+ {
+ "checksum": "4c21e4ee49ed84fc7200ba5db0bd2081",
+ "size": 2218,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right]": [
+ {
+ "checksum": "cc9e96fa30c881e8ad35a6c20f1426ed",
+ "size": 1678,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right_const]": [
+ {
+ "checksum": "c2bed4f4232a768639208cdb40209f94",
+ "size": 9966,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right_equi]": [
+ {
+ "checksum": "9c00a34e969152b659822167738c6095",
+ "size": 2114,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_equi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right_equi_and_const]": [
+ {
+ "checksum": "abd7d55ebcdb3bde3414fbf67c1e56c9",
+ "size": 2278,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_equi_and_const_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right_equi_and_one]": [
+ {
+ "checksum": "721d4a1234e9f1e0172bf88bf7de0241",
+ "size": 2190,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_equi_and_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_join_right_one]": [
+ {
+ "checksum": "a3437fcd4127f82afe2075faaf5576a1",
+ "size": 3990,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_join_right_one_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_limit]": [
+ {
+ "checksum": "286baf49fc0544235a0385f876170f62",
+ "size": 700,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_literals]": [
+ {
+ "checksum": "38fa10230910912a01679ad5e9070436",
+ "size": 515,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_literals_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_plusminus]": [
+ {
+ "checksum": "b014eef3daa475ddc2137560514d888d",
+ "size": 533,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_plusminus_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_plusminus_unary]": [
+ {
+ "checksum": "ac8a4952f43db2d220ede0c36ca496ca",
+ "size": 734,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_plusminus_unary_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_distinct_on_expr]": [
+ {
+ "checksum": "0ce0597e2cb1baf96e1134a153fd76c8",
+ "size": 839,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_distinct_on_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_distinct_on_qstar]": [
+ {
+ "checksum": "a62a96392ae6359ceb4fe516800b1d18",
+ "size": 796,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_distinct_on_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_distinct_on_star]": [
+ {
+ "checksum": "11de7c771060192fa0f638d68e715878",
+ "size": 782,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_distinct_on_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_group_by_col]": [
+ {
+ "checksum": "a5f52f2e2d0eb774f5e3458aecab570d",
+ "size": 790,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_group_by_col_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_group_by_expr]": [
+ {
+ "checksum": "d79f658674ae929146afe25a6f51c8e0",
+ "size": 836,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_group_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_group_by_qcol]": [
+ {
+ "checksum": "2ad99d25557378703890952043f4735b",
+ "size": 795,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_group_by_qcol_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_group_by_qstar]": [
+ {
+ "checksum": "daab5a7013f71631b839c7fd05670559",
+ "size": 793,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_group_by_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_group_by_star]": [
+ {
+ "checksum": "d36ff4103657478f5577ad6aad867fb4",
+ "size": 779,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_group_by_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_order_by_expr]": [
+ {
+ "checksum": "b6137eafedec79ff252730bdb9af9d6c",
+ "size": 829,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_order_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_order_by_qstar]": [
+ {
+ "checksum": "502113ac2d57ecd7fc44088193fce850",
+ "size": 786,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_order_by_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_order_by_star]": [
+ {
+ "checksum": "b97256b09962703eab21789ed86b09bc",
+ "size": 772,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_order_by_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_proj_ref_order_by_union_all_expr]": [
+ {
+ "checksum": "9bc9c7ad55fd7494810c028c618c6d95",
+ "size": 1311,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_proj_ref_order_by_union_all_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_qstarref1]": [
+ {
+ "checksum": "e60dbaba8de367f63baa00c40a027f9c",
+ "size": 772,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_qstarref1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_qstarref2]": [
+ {
+ "checksum": "1a7b4c52957365ab73f277006cbd6071",
+ "size": 860,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_qstarref2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_sort_project_expr]": [
+ {
+ "checksum": "ff17ec8c86b7b1a53e47feef100a114a",
+ "size": 743,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_sort_project_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_sort_project_new]": [
+ {
+ "checksum": "ba441809a2a393d0236bd12d05bf31b8",
+ "size": 731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_sort_project_new_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_sort_project_same]": [
+ {
+ "checksum": "835a554a2bee483667ab6fbfdc93aed2",
+ "size": 731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_sort_project_same_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_sort_project_same_asc]": [
+ {
+ "checksum": "835a554a2bee483667ab6fbfdc93aed2",
+ "size": 731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_sort_project_same_asc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_sort_project_same_desc]": [
+ {
+ "checksum": "9822c5bfcff0f04d69f0864ba6d0db91",
+ "size": 732,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_sort_project_same_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_starref1]": [
+ {
+ "checksum": "e2e983a696817fe3cbebcbbf79264fd1",
+ "size": 623,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_starref1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_starref2]": [
+ {
+ "checksum": "9da57f8f553a17cc2d2d3c7d16ae1d51",
+ "size": 793,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_starref2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery2]": [
+ {
+ "checksum": "b53b268ae438cfad5f502cf06ae77718",
+ "size": 1155,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery2_qstar]": [
+ {
+ "checksum": "f9ac524e0a6beea042e498d5e513b455",
+ "size": 1231,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery2_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery]": [
+ {
+ "checksum": "a474744196904638a63db214d833d83e",
+ "size": 886,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery_scalar2]": [
+ {
+ "checksum": "4d7575bae8b049e031b80502a00c1c02",
+ "size": 801,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery_scalar2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery_scalar2_qstar]": [
+ {
+ "checksum": "ada6fb7384348eaaaca66be7cd0dab96",
+ "size": 877,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery_scalar2_qstar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_subquery_scalar]": [
+ {
+ "checksum": "befe952e9f794fb50ee5ce17a48a2231",
+ "size": 696,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_subquery_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_substring]": [
+ {
+ "checksum": "6331097f8a27f564a913b3bda8975c83",
+ "size": 577,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_substring_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_table1]": [
+ {
+ "checksum": "caab9051a799a7612d31b9cc7400dd14",
+ "size": 649,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_table1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_table2]": [
+ {
+ "checksum": "e7d3135539be3b6e5ca7d608b9e3fa87",
+ "size": 819,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_table2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_union]": [
+ {
+ "checksum": "97774203d31bb46d93d3a2fe643ee7a4",
+ "size": 1923,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_union_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_unionall_scalar]": [
+ {
+ "checksum": "e9deefb03cc148a177bc1d9c6fc50e8e",
+ "size": 1549,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_unionall_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_unionall_self]": [
+ {
+ "checksum": "b90b3a57190a14f1256af6a83e46789f",
+ "size": 1266,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_unionall_self_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_where]": [
+ {
+ "checksum": "a9b43fb93d3124765baec9d1d7f75f75",
+ "size": 814,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_where_scalar]": [
+ {
+ "checksum": "974bd36947e34cb4788deee669878220",
+ "size": 668,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-select_where_scalar_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_column_order_by]": [
+ {
+ "checksum": "7fe75bc02d15b843701522253b6338f5",
+ "size": 898,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_column_order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_column_partition_by]": [
+ {
+ "checksum": "ffb1131b1a30fb7ed9c26da89a19ab9f",
+ "size": 887,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_column_partition_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_count]": [
+ {
+ "checksum": "f50add6afe4f7ed6a1f3cdde92792661",
+ "size": 2111,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_count_all]": [
+ {
+ "checksum": "319dfc3fe5343284654b1c06f5bb4606",
+ "size": 2009,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_count_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_cume_dist]": [
+ {
+ "checksum": "8dc40ca9a5f1350c623f3939adc8c36c",
+ "size": 946,
+ "uri": "https://{canondata_backend}/1889210/3b80794dcf61416ec7f21fc15203e31fda3473f3/resource.tar.gz#test_sql2yql.test_pg-select_win_cume_dist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_expr_agg]": [
+ {
+ "checksum": "96c31e8993d0b08a37cddf4886db96a9",
+ "size": 1183,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_expr_agg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_expr_agg_order]": [
+ {
+ "checksum": "122965887814efc44dab77fa0122445c",
+ "size": 1332,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_expr_agg_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_expr_lead]": [
+ {
+ "checksum": "94282e8c42b1cc9d7548b6bddcf4522a",
+ "size": 1181,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_expr_lead_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_expr_order]": [
+ {
+ "checksum": "0fd99b6b6d0bbeb5aa6d3882ba831fe5",
+ "size": 1227,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_expr_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_expr_partition]": [
+ {
+ "checksum": "e7e3ff542eaa1c82797e74c9dd141abf",
+ "size": 1216,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_expr_partition_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_first_last_value]": [
+ {
+ "checksum": "01e99a85b1743db338c82cdbf1f1704b",
+ "size": 1100,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_first_last_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_frame]": [
+ {
+ "checksum": "bb36e9c6803674860d8f2740f8f7e9fa",
+ "size": 4256,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_frame_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_lead_lag]": [
+ {
+ "checksum": "0cce9625af93b3ca1bf9bd826a41449b",
+ "size": 924,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_lead_lag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_max]": [
+ {
+ "checksum": "a399c54c8da3284794deb625f7848bdf",
+ "size": 2039,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_max_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_max_null]": [
+ {
+ "checksum": "67ba5c16f0a99996a7d403cd06b38d8b",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_max_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_min]": [
+ {
+ "checksum": "d0242b604e27313eec16a7f237f27507",
+ "size": 2039,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_min_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_min_null]": [
+ {
+ "checksum": "39b6b767c085aa97021e3bbb8ebb3beb",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_min_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_nth_value]": [
+ {
+ "checksum": "a8bf895bace1d89545c7ff4eddeb6d55",
+ "size": 1581,
+ "uri": "https://{canondata_backend}/1871182/567779c73d6cc9df23501e596c52b2adf09b5b7b/resource.tar.gz#test_sql2yql.test_pg-select_win_nth_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_ntile]": [
+ {
+ "checksum": "b1c2a7b02c6efcc3b6f68d64a35a0803",
+ "size": 1363,
+ "uri": "https://{canondata_backend}/1889210/9eae9dde3e4ccce7ed58c152526ff01da2d33ccb/resource.tar.gz#test_sql2yql.test_pg-select_win_ntile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_partition_sort]": [
+ {
+ "checksum": "bd5985cc249fcf7c6c8a2ac90c4aa62a",
+ "size": 1376,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_partition_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_percent_rank]": [
+ {
+ "checksum": "bbf8c3e7692ec2ca27ae31754e123281",
+ "size": 1349,
+ "uri": "https://{canondata_backend}/1889210/9eae9dde3e4ccce7ed58c152526ff01da2d33ccb/resource.tar.gz#test_sql2yql.test_pg-select_win_percent_rank_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_rank]": [
+ {
+ "checksum": "fd877435b4337db2d1deab20c05f4e89",
+ "size": 931,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_rank_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_rank_order]": [
+ {
+ "checksum": "41c548e652dfb476b31bdd25ac199ba7",
+ "size": 990,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_rank_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_row_number]": [
+ {
+ "checksum": "7aa540fc0e601bb9aeea65d21da35ad6",
+ "size": 909,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_row_number_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_sum]": [
+ {
+ "checksum": "9d72b3df59c34568c17aa4cfc274750f",
+ "size": 2039,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_sum_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_win_sum_null]": [
+ {
+ "checksum": "99bfceb8b6093e518bf4c9a418f4ddb1",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_win_sum_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-select_yql_type]": [
+ {
+ "checksum": "9fd3d7b0e2972d093ea3d615a10ede42",
+ "size": 2020,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-select_yql_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-set_of_as_records]": [
+ {
+ "checksum": "8efb46d3767edbd0bf174190d5a63eef",
+ "size": 1065,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-set_of_as_records_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-set_of_as_structs]": [
+ {
+ "checksum": "55f9b16bd19e3d73523e8c243c99f2bb",
+ "size": 1081,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-set_of_as_structs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-set_over_unhashable]": [
+ {
+ "checksum": "e2d70c80e587f9b371ed0d925e3590ba",
+ "size": 1190,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-set_over_unhashable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-simple_ops]": [
+ {
+ "checksum": "f1e0134524df39ceabac99edac24d968",
+ "size": 6324,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-simple_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-single_input_filter_over_join]": [
+ {
+ "checksum": "6db42997b2be12c330c6da5c7ad953d1",
+ "size": 1078,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-single_input_filter_over_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sort_nulls_priority]": [
+ {
+ "checksum": "078401c0b96d5a2a71a130ef36830f29",
+ "size": 1433,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sort_nulls_priority_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sort_nulls_priority_window]": [
+ {
+ "checksum": "f5b86e7a069fda7a962aadc135e4c9cb",
+ "size": 1902,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sort_nulls_priority_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-str_lookup_pg]": [
+ {
+ "checksum": "33a70168633e2ede8b45aef6a144ec05",
+ "size": 6443,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-str_lookup_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-strings_to_pg]": [
+ {
+ "checksum": "6ea0663a9176ab962438ae38e773da6f",
+ "size": 3020,
+ "uri": "https://{canondata_backend}/1784826/cb0ddc73010fb403f8a8b15f4bc115172acddcfa/resource.tar.gz#test_sql2yql.test_pg-strings_to_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-struct_tuple_cast]": [
+ {
+ "checksum": "ecc9991a5650f456e39aca3a4e57e455",
+ "size": 1998,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-struct_tuple_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_columns_in_test_expr_columns]": [
+ {
+ "checksum": "0904a43f7c51494944ca904caa168cc5",
+ "size": 2966,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_columns_in_test_expr_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_columns_in_test_expr_columns_corr]": [
+ {
+ "checksum": "6da19b5b21e51af155d4b150a83a5bb3",
+ "size": 2921,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_columns_in_test_expr_columns_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_having_all]": [
+ {
+ "checksum": "8657b9dd7167fc20c8eb6c2d7088dd35",
+ "size": 2731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_having_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_having_any]": [
+ {
+ "checksum": "2e9372571752132501218fa4cc1b768c",
+ "size": 2731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_having_any_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_having_exists]": [
+ {
+ "checksum": "2e26e8fe101aaf5a9ab58621b08b4cf9",
+ "size": 1876,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_having_exists_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_having_expr]": [
+ {
+ "checksum": "0ae3eafb9553cb5e572801e1d784fe01",
+ "size": 952,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_having_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_having_in]": [
+ {
+ "checksum": "81220711cf3041cb35db32beaa839e72",
+ "size": 2731,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_having_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_order_all_corr]": [
+ {
+ "checksum": "ac654f2a330235b7f75835c6bbbbe177",
+ "size": 1197,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_order_all_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_order_any_corr]": [
+ {
+ "checksum": "e4620a7ac4eb7b9475cb2ac9019c03d2",
+ "size": 1197,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_order_any_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_order_exists_corr]": [
+ {
+ "checksum": "8cef85f3796adfc7802ce6e238238503",
+ "size": 1414,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_order_exists_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_order_expr_corr]": [
+ {
+ "checksum": "613bac8136d0a03a29d7bad6538e07d9",
+ "size": 1033,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_order_expr_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_order_in_corr]": [
+ {
+ "checksum": "b1ac5b40e62b2f32bad7ad52fb53943d",
+ "size": 1204,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_order_in_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_all_corr]": [
+ {
+ "checksum": "a136b52f461f6599066b0458b5f3e9a0",
+ "size": 1080,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_all_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_any_corr]": [
+ {
+ "checksum": "158d776b539f3ee320cfdd410b714f45",
+ "size": 1080,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_any_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_array]": [
+ {
+ "checksum": "e48e22f9519737dc62e5593e3a67eeb8",
+ "size": 1640,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_array_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_array_corr]": [
+ {
+ "checksum": "a8fc61c0757d67faf847e3d9c0771577",
+ "size": 2562,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_array_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_exists_corr]": [
+ {
+ "checksum": "1e1e91b898987ad4eb045e26a9855fa0",
+ "size": 1026,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_exists_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_expr_corr]": [
+ {
+ "checksum": "5a29b14d4bd657da99184d69538b14d0",
+ "size": 1844,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_expr_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_in_corr]": [
+ {
+ "checksum": "158d776b539f3ee320cfdd410b714f45",
+ "size": 1080,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_in_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_projection_uncorrelated]": [
+ {
+ "checksum": "ac8e5f664ea6fbe3516532b76a027387",
+ "size": 698,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-sublink_projection_uncorrelated_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_all]": [
+ {
+ "checksum": "6382c9639035c214617d7fcbf7725326",
+ "size": 2593,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_all_corr]": [
+ {
+ "checksum": "99308e85e46df725157e4dd5731cb09a",
+ "size": 3131,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_all_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_any]": [
+ {
+ "checksum": "4ec3335686c79d94c64ebaaed5ad56b7",
+ "size": 2593,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_any_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_any_corr]": [
+ {
+ "checksum": "23d566e75a0e438f19f9ca6ed4b1d025",
+ "size": 2127,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_any_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_exists]": [
+ {
+ "checksum": "14ccd65ed2a5e781e318dd9ee956165a",
+ "size": 1822,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_exists_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_exists_corr]": [
+ {
+ "checksum": "d4bc0dbf06c3cdd6d81908a6f538d840",
+ "size": 2019,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_exists_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_expr]": [
+ {
+ "checksum": "3adb17cf06198f959655141f6a6496ea",
+ "size": 906,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_expr_corr]": [
+ {
+ "checksum": "9e9231e7e3994f2ef1ebb12827d2c43c",
+ "size": 2095,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_expr_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_in]": [
+ {
+ "checksum": "80d0933e359c0b107ee5bdb1e1cee37e",
+ "size": 2593,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-sublink_where_in_corr]": [
+ {
+ "checksum": "23d566e75a0e438f19f9ca6ed4b1d025",
+ "size": 2127,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-sublink_where_in_corr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-table_func]": [
+ {
+ "checksum": "52fc030d0a5ec71d08efd26d9f101c65",
+ "size": 8198,
+ "uri": "https://{canondata_backend}/1784826/4a52e4f284dee1aa5ddb5ef05566fbf6d624ec38/resource.tar.gz#test_sql2yql.test_pg-table_func_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q01]": [
+ {
+ "checksum": "d7a119a877ea0e8b9211601d372e99b9",
+ "size": 3666,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q01_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q02]": [
+ {
+ "checksum": "65b8748b9e74d7ed1812f08fe748f68c",
+ "size": 11246,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q02_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q03]": [
+ {
+ "checksum": "06202274991c963d5efd6b813adcae2a",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q03_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q04]": [
+ {
+ "checksum": "1f7f4407a74029ef52a7a8a5606cfe9f",
+ "size": 42858,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q04_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q05]": [
+ {
+ "checksum": "3023cb1d253fc60d9fb8296083980897",
+ "size": 14182,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q05_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q06]": [
+ {
+ "checksum": "87574a837ab33daf1b02e39f739ca6be",
+ "size": 3472,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q06_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q07]": [
+ {
+ "checksum": "11932c8f5efac3a38fe9b8f4ddab59cd",
+ "size": 2779,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q07_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q08]": [
+ {
+ "checksum": "9430acfc16a3d71cd0acabff1dc50380",
+ "size": 18755,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q08_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q09]": [
+ {
+ "checksum": "c50ac64350f1fc40ebfabbed50511e9f",
+ "size": 9823,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q09_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q10]": [
+ {
+ "checksum": "8979894a1add7ddb8f414875b3a95fae",
+ "size": 6696,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q10_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q11]": [
+ {
+ "checksum": "9f693f17a47cfb4421c111781efc0c7f",
+ "size": 19257,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q11_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q12]": [
+ {
+ "checksum": "47439c4591b8c1aa46a91a402caaaa4f",
+ "size": 3197,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q12_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q13]": [
+ {
+ "checksum": "b28ecc2bad3f1578c1534b4408672a52",
+ "size": 5446,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q13_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q14]": [
+ {
+ "checksum": "9427d8be59e0954d4196a09e0a69bf7b",
+ "size": 47532,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q14_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q15]": [
+ {
+ "checksum": "57961ddef7078e4cbf3f31cb70e37b2d",
+ "size": 2599,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q15_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q16]": [
+ {
+ "checksum": "0dfec3975a648eeb584aa30f1fd1749a",
+ "size": 3791,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q16_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q17]": [
+ {
+ "checksum": "2b954a21712e40504d5e1e9da4bb219a",
+ "size": 5353,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q17_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q18]": [
+ {
+ "checksum": "1d881d3b0b6845f7eea46606f4fc3dae",
+ "size": 5358,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q18_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q19]": [
+ {
+ "checksum": "869851a8d27eb743c4f1d33d4d693d68",
+ "size": 3381,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q19_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q20]": [
+ {
+ "checksum": "843be4c8438a0f67ed60ff9cfe7ba89c",
+ "size": 3205,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q20_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q21]": [
+ {
+ "checksum": "5e173e493725a6be0fcaf26b1bb97cd3",
+ "size": 3843,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q21_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q22]": [
+ {
+ "checksum": "2950960cba2ef85714ed4841890305bc",
+ "size": 2219,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q22_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q23]": [
+ {
+ "checksum": "fb0ec34be0156444dd9f4d279beaef1e",
+ "size": 26622,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q23_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q24]": [
+ {
+ "checksum": "94ee4d895ef962158f9081e490ea71b0",
+ "size": 15369,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q24_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q25]": [
+ {
+ "checksum": "5b586061699461d240dae3aad38e23c4",
+ "size": 4383,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q25_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q26]": [
+ {
+ "checksum": "af6895980f049c8471991c60e0a97780",
+ "size": 2788,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q26_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q27]": [
+ {
+ "checksum": "2c808b0d860a7066d1b412c38262a4d1",
+ "size": 3117,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q27_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q28]": [
+ {
+ "checksum": "8f36eaed56343d2887ed1a52140272a6",
+ "size": 8808,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q28_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q29]": [
+ {
+ "checksum": "9af2138a35d53aa1dbe3aa10966afd7c",
+ "size": 4464,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q29_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q30]": [
+ {
+ "checksum": "b68718424c8fce52b0e4a7d6501b2227",
+ "size": 6016,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q30_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q31]": [
+ {
+ "checksum": "05f0d8847795b5df68b047a4b82a0e1d",
+ "size": 10436,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q31_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q32]": [
+ {
+ "checksum": "9193f99a9ae9a92a4509c706dc4f8989",
+ "size": 3007,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q33]": [
+ {
+ "checksum": "c6a242b1488520984ff296577d0a3264",
+ "size": 7979,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q33_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q34]": [
+ {
+ "checksum": "4763a6285e0bf1797a6611efcf7efbcd",
+ "size": 4969,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q34_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q35]": [
+ {
+ "checksum": "e69606d84dcafbdeca6fed8c9d2aecce",
+ "size": 6373,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q35_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q36]": [
+ {
+ "checksum": "b260fd6d097bfd1cbe5548635cc7e979",
+ "size": 3314,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q36_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q37]": [
+ {
+ "checksum": "f3d1a26c87e6ac8fa539267dbc0ed3af",
+ "size": 2758,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q37_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q38]": [
+ {
+ "checksum": "0bcdff5388533f44fd16027046278d18",
+ "size": 4398,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q38_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q39]": [
+ {
+ "checksum": "601a6df23cf9b9e49a637275de7cfca7",
+ "size": 16117,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q39_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q40]": [
+ {
+ "checksum": "2c3327934b7f0f6fd30f694bed94cf74",
+ "size": 3798,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q40_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q41]": [
+ {
+ "checksum": "abb765aabf1c519fb2a15a8e12a81766",
+ "size": 6198,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q41_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q42]": [
+ {
+ "checksum": "0c9eec20ef670a0fd8487d90aaed9300",
+ "size": 2319,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q42_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q43]": [
+ {
+ "checksum": "f5996d62e020ca6f85190c415c87a10a",
+ "size": 4219,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q43_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q44]": [
+ {
+ "checksum": "692cca76bcede741d892201b5feb189f",
+ "size": 5836,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q44_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q45]": [
+ {
+ "checksum": "4a848f75a9bf0913989c0ea6d086c1fb",
+ "size": 3604,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q45_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q46]": [
+ {
+ "checksum": "61355a62f7ce15128b063237da083354",
+ "size": 5004,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q46_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q47]": [
+ {
+ "checksum": "093fd5fd9599b60d0e7ed22a6b83a335",
+ "size": 12325,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q47_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q48]": [
+ {
+ "checksum": "b53d6e5a46bc8b95741afae77e3e8f5a",
+ "size": 4462,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q48_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q49]": [
+ {
+ "checksum": "85a669262d54cd2c118df665b9571bbd",
+ "size": 14142,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q49_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q50]": [
+ {
+ "checksum": "524733f5bd0f239e21389e69dc57738f",
+ "size": 5906,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q50_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q51]": [
+ {
+ "checksum": "445c6d0d9ad6de0f458362afb92215d9",
+ "size": 5582,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q51_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q52]": [
+ {
+ "checksum": "a1011cb8208902bc53314a66d87bb33e",
+ "size": 2185,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q52_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q53]": [
+ {
+ "checksum": "60e5a48dae8c304657599ea1edb49a55",
+ "size": 4897,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q53_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q54]": [
+ {
+ "checksum": "f2285ff0140b47e451b089599927956d",
+ "size": 6665,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q54_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q55]": [
+ {
+ "checksum": "64148d85efebc3565cc60df5b8e48d3a",
+ "size": 1892,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q55_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q56]": [
+ {
+ "checksum": "b03dc8a5b112fbc839ac31fcc102ca56",
+ "size": 8182,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q56_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q57]": [
+ {
+ "checksum": "0f8ee570ef1c666fbb047a6aeabc6ff1",
+ "size": 11204,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q57_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q58]": [
+ {
+ "checksum": "14609022753f553495eedae070d851e6",
+ "size": 10497,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q58_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q59]": [
+ {
+ "checksum": "622c96882df66f0cceb7bbaeb130d890",
+ "size": 10597,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q59_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q60]": [
+ {
+ "checksum": "5870d6de0e00846c4e3b689443a1db1e",
+ "size": 7972,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q60_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q61]": [
+ {
+ "checksum": "000fbeb39adaf9a9f5d79dd0813c1aeb",
+ "size": 6094,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q61_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q62]": [
+ {
+ "checksum": "a72c04c0c00707f4fcc6d49d143077fc",
+ "size": 4493,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q62_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q63]": [
+ {
+ "checksum": "b6d8ee6ff6a94fe19049b71a1c2a8c96",
+ "size": 4882,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q63_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q64]": [
+ {
+ "checksum": "f389c02f8552002af014ff60af946227",
+ "size": 19518,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q64_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q65]": [
+ {
+ "checksum": "75d99e4fccc508bf3ce96f41741fad8a",
+ "size": 4493,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q65_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q66]": [
+ {
+ "checksum": "b8f944ef3d9cc08222b0fbd6b453ed93",
+ "size": 27669,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q66_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q67]": [
+ {
+ "checksum": "501b05156c6a3f9e847247ac5f691c90",
+ "size": 4647,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q67_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q68]": [
+ {
+ "checksum": "c465bdfdbb7d7af577f59bfebc79ccbc",
+ "size": 4917,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q68_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q69]": [
+ {
+ "checksum": "fafb014d8c3ba76d8d3c3e356a4c2dca",
+ "size": 5688,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q69_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q70]": [
+ {
+ "checksum": "24df397cefaf427ca3636cf798d2de93",
+ "size": 4508,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q70_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q71]": [
+ {
+ "checksum": "e8547c65b839d97dc88f989dcefdc069",
+ "size": 5100,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q71_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q72]": [
+ {
+ "checksum": "a853247fad9c313b5eabb655d16780b3",
+ "size": 5413,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q72_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q73]": [
+ {
+ "checksum": "d378c8acac7ba7a6afbfd2db2b350e7e",
+ "size": 4363,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q73_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q74]": [
+ {
+ "checksum": "ec452c646f4d5d565759f92c8398d17a",
+ "size": 14663,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q74_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q75]": [
+ {
+ "checksum": "bdfc17993255ad01c159be7b1304f872",
+ "size": 15744,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q75_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q76]": [
+ {
+ "checksum": "f3ecb6fb5de5d39474251a54bf0e567f",
+ "size": 5678,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q76_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q77]": [
+ {
+ "checksum": "dc707e290313f1dab77e737df9d0c0c5",
+ "size": 12112,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q77_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q78]": [
+ {
+ "checksum": "23c840ca1d6e2a4e7b0275d6d14eaf9c",
+ "size": 9071,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q78_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q79]": [
+ {
+ "checksum": "47d901015140f5ef58f02d15a2ad79ea",
+ "size": 4176,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q79_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q80]": [
+ {
+ "checksum": "67eeccf744d61ba1101a9740dd8148b7",
+ "size": 11431,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q80_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q81]": [
+ {
+ "checksum": "53e5de837a9e01f121dacf244deb097c",
+ "size": 6440,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q81_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q82]": [
+ {
+ "checksum": "d96af2e683ae2385cb27c66db669d846",
+ "size": 2754,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q82_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q83]": [
+ {
+ "checksum": "272df370704c2fcda38bdf5177b6b6de",
+ "size": 9667,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q83_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q84]": [
+ {
+ "checksum": "458256b4036d06a25c02d0515cb3c829",
+ "size": 2736,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q84_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q85]": [
+ {
+ "checksum": "82e54eca99f12d84ce15aec48482da77",
+ "size": 6594,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q85_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q86]": [
+ {
+ "checksum": "d05a25ba1b5dc6d637324a18a9dc3dab",
+ "size": 2690,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q86_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q87]": [
+ {
+ "checksum": "0ac584e144cd6932b7ed5575fa5966a9",
+ "size": 4353,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q87_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q88]": [
+ {
+ "checksum": "b5d98653908c5ee33790168d584eb1df",
+ "size": 18573,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q88_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q89]": [
+ {
+ "checksum": "3881d367e1c8d742e5e07b3799af8108",
+ "size": 4268,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q89_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q90]": [
+ {
+ "checksum": "8e612257474c6635eeaeba9ba8a47705",
+ "size": 4197,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q90_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q91]": [
+ {
+ "checksum": "bb7de416b484414906663982aa352d3b",
+ "size": 3751,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q91_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q92]": [
+ {
+ "checksum": "9e781e5f5b7347924d0e53b19329d48b",
+ "size": 3086,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q92_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q93]": [
+ {
+ "checksum": "1e5b538013d3612dc9bc39c8e8489be0",
+ "size": 2561,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q93_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q94]": [
+ {
+ "checksum": "eaa6d74e2da24d841e89d5fe0580f3f4",
+ "size": 3566,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q94_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q95]": [
+ {
+ "checksum": "a4be2d52141700749e66f41689065be9",
+ "size": 5046,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q95_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q96]": [
+ {
+ "checksum": "0969d264f6ef0634999b63f170f9e841",
+ "size": 1970,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q96_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q97]": [
+ {
+ "checksum": "6ff909e01c303e654f1e542ec7531271",
+ "size": 3613,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q97_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q98]": [
+ {
+ "checksum": "823459066fe354705cc4027ab95d7402",
+ "size": 3161,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpcds-q98_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpcds-q99]": [
+ {
+ "checksum": "ebe57d8df6d4be58431b994ebbaaca23",
+ "size": 4512,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpcds-q99_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q01]": [
+ {
+ "checksum": "baeb6a48591608b2ad9ebc8986274359",
+ "size": 2402,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q01_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q02]": [
+ {
+ "checksum": "ce5dcb881526fb14c63f683a886e0a3e",
+ "size": 4128,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q02_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q03]": [
+ {
+ "checksum": "ff71208f851ce7eae5094ec9624fbeb3",
+ "size": 2247,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q03_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q04]": [
+ {
+ "checksum": "bf3fddc448c90fae03eac0b0bb038d6f",
+ "size": 1884,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q04_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q05]": [
+ {
+ "checksum": "38730d4d73b75e02334df7f37a27ac6e",
+ "size": 2804,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q05_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q06]": [
+ {
+ "checksum": "1f3d0a4e50163bb22b697fbab10577b1",
+ "size": 1505,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q06_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q07]": [
+ {
+ "checksum": "03e04c0e14e7e2b3bcbce6fffaf41b1d",
+ "size": 3719,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q07_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q08]": [
+ {
+ "checksum": "4289e8cea1a3263e814838bf3daaf57a",
+ "size": 3848,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q08_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q09]": [
+ {
+ "checksum": "4317d46f164e0e60aa57080a0602ca7b",
+ "size": 3093,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q09_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q10]": [
+ {
+ "checksum": "c66fc18d630b5aed20ea6887aa656b8f",
+ "size": 3049,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q10_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q11]": [
+ {
+ "checksum": "0387daaacba135692f65cd5283a2313b",
+ "size": 2934,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q11_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q12]": [
+ {
+ "checksum": "f71bde3934ab5bda76d1e3c185ca2d4e",
+ "size": 2427,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpch-q12_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q13]": [
+ {
+ "checksum": "b34c4af5ca8efe11b23e224d56c7436d",
+ "size": 1702,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q13_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q14]": [
+ {
+ "checksum": "4cf67bacf1947114139ca4d9b9283f92",
+ "size": 1941,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q14_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q15]": [
+ {
+ "checksum": "b2ce831fbc91f5bc7087ed1fce66caf3",
+ "size": 3542,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q15_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q16]": [
+ {
+ "checksum": "866d559cb412ec32de9f9e4b7a08df9f",
+ "size": 2683,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpch-q16_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q17]": [
+ {
+ "checksum": "5ff6dde7bf15a8d372a71ad50cf033aa",
+ "size": 1857,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q17_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q18]": [
+ {
+ "checksum": "be9dbbf7d1c27b827eda6279ba984587",
+ "size": 2770,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q18_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q19]": [
+ {
+ "checksum": "11ba49d7bfc32e5cb30fc7cd6307849b",
+ "size": 3777,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpch-q19_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q20]": [
+ {
+ "checksum": "4c53313bedf3a52285eaf865e7a6e809",
+ "size": 3379,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q20_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q21]": [
+ {
+ "checksum": "5842ce42ba5a9c052ccec05b6fb07160",
+ "size": 3291,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-tpch-q21_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-tpch-q22]": [
+ {
+ "checksum": "08660123627ef59b92c18eb8af47fc0a",
+ "size": 3194,
+ "uri": "https://{canondata_backend}/1784826/9a1fde0f43ad8d72807b2a43799a344e89e4ba7a/resource.tar.gz#test_sql2yql.test_pg-tpch-q22_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-type_aliases]": [
+ {
+ "checksum": "747ed554aee4591466652c0bec0dadea",
+ "size": 2462,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-type_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-unknown]": [
+ {
+ "checksum": "d51a757d1ed15633ab30db3c2dfc7590",
+ "size": 619,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-unknown_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-uuid_from_pg]": [
+ {
+ "checksum": "722bb621a46f5bc226580ec0273bf40d",
+ "size": 1054,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pg-uuid_from_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-values]": [
+ {
+ "checksum": "227a7e42522f69fd3b3c244fa432418b",
+ "size": 851,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-variadic]": [
+ {
+ "checksum": "45c4f4c105a95f237a22c01684a3911b",
+ "size": 744,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-variadic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-variadic_array_arg]": [
+ {
+ "checksum": "d349e780a8332dbeeb6879a53c812f9a",
+ "size": 622,
+ "uri": "https://{canondata_backend}/1925821/85af800a282697ba458d7b0567031a1eadd214a4/resource.tar.gz#test_sql2yql.test_pg-variadic_array_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-wide_sort]": [
+ {
+ "checksum": "0a312c05be5c91545de12d451a697d00",
+ "size": 1278,
+ "uri": "https://{canondata_backend}/1781765/f96da1449bda0685c21951c4af352cc5b8062a5a/resource.tar.gz#test_sql2yql.test_pg-wide_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-wide_top_sort]": [
+ {
+ "checksum": "26fb463b1e52d0320ec89e2add000b3f",
+ "size": 1364,
+ "uri": "https://{canondata_backend}/1781765/f96da1449bda0685c21951c4af352cc5b8062a5a/resource.tar.gz#test_sql2yql.test_pg-wide_top_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-with]": [
+ {
+ "checksum": "af4f515b82bbdecea34152e55fe0903c",
+ "size": 1969,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg-with_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-with_rec_all]": [
+ {
+ "checksum": "addf1a410b42acd61b71f3784728818e",
+ "size": 995,
+ "uri": "https://{canondata_backend}/1599023/ae580af440c3b51d06c4906e6fa7aa2dbc944d02/resource.tar.gz#test_sql2yql.test_pg-with_rec_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-with_rec_all_empty]": [
+ {
+ "checksum": "07f9a884a3bb922701000ed1add0fae4",
+ "size": 1214,
+ "uri": "https://{canondata_backend}/1599023/ae580af440c3b51d06c4906e6fa7aa2dbc944d02/resource.tar.gz#test_sql2yql.test_pg-with_rec_all_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-with_rec_distinct]": [
+ {
+ "checksum": "16d80e790c4040338b5b8e1ace2fcb48",
+ "size": 861,
+ "uri": "https://{canondata_backend}/1599023/ae580af440c3b51d06c4906e6fa7aa2dbc944d02/resource.tar.gz#test_sql2yql.test_pg-with_rec_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg-with_rec_trivial]": [
+ {
+ "checksum": "ebb8d7f783a2448f30ddce6065cf13b5",
+ "size": 649,
+ "uri": "https://{canondata_backend}/1599023/ae580af440c3b51d06c4906e6fa7aa2dbc944d02/resource.tar.gz#test_sql2yql.test_pg-with_rec_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-columns]": [
+ {
+ "checksum": "ee4f3c95112bc2df6d8c0cace0f9d1c2",
+ "size": 1383,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-lambda]": [
+ {
+ "checksum": "c898c544d1741e30fbaad05c6f3f844b",
+ "size": 1217,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_aggregate]": [
+ {
+ "checksum": "d6b859b9efd19277cdb56734cd04b7f6",
+ "size": 1176,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_am_pg_syntax]": [
+ {
+ "checksum": "f6fe04545fbda38af3c9ae19cfe912d8",
+ "size": 703,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_am_pg_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_auth_members]": [
+ {
+ "checksum": "faeef577934666140ac8bf2a0c46c310",
+ "size": 890,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_auth_members_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_class]": [
+ {
+ "checksum": "f252be17f6db025cd298f8982c834201",
+ "size": 2005,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_class_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_database]": [
+ {
+ "checksum": "277583c5b369c99209d290134ee3c60f",
+ "size": 1334,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_database_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_description_pg_syntax]": [
+ {
+ "checksum": "989fc7b3fe958c0be1393f9300208edb",
+ "size": 1223,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_description_pg_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_get_userbyid]": [
+ {
+ "checksum": "dbab9a960c5b16ef99084976114f7175",
+ "size": 819,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_get_userbyid_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_inherits]": [
+ {
+ "checksum": "8e16673bfb1886fb3c9d1247ba243a43",
+ "size": 740,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_inherits_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_language]": [
+ {
+ "checksum": "90df9c9fcb74f0da6e9f3f20e1ef486d",
+ "size": 859,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_language_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_locks]": [
+ {
+ "checksum": "ee901b49f0c3271225e40a647d081862",
+ "size": 669,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_locks_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_namespace_pg_syntax]": [
+ {
+ "checksum": "97aebc15a895c94088af6cf2c6448857",
+ "size": 861,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_namespace_pg_syntax_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_operator]": [
+ {
+ "checksum": "79d37f5deecb7f8d763f64a3c9e0810d",
+ "size": 2308,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_operator_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_proc]": [
+ {
+ "checksum": "1e4b64d1a6720b73897a8cbdd0db3c66",
+ "size": 1906,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_proc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_roles]": [
+ {
+ "checksum": "32f2e9145b4f67d8f70b168ad51a1e73",
+ "size": 1576,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_roles_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_set_config]": [
+ {
+ "checksum": "9bc3f0b5ceb6fb4771602189db47428c",
+ "size": 1940,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_set_config_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_set_config_commit]": [
+ {
+ "checksum": "0c5ebd5d9de58fc971be383ef516c1c4",
+ "size": 1904,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_set_config_commit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_shdescription]": [
+ {
+ "checksum": "de62d251bfd8ce354bd08422ab0dae6a",
+ "size": 886,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_shdescription_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_stat_activity]": [
+ {
+ "checksum": "0e87e5fcd4b083f133395f25b83a3719",
+ "size": 1674,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_stat_activity_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_stat_database]": [
+ {
+ "checksum": "af67981ff551190226914905b83cd278",
+ "size": 1361,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_stat_database_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_stat_gssapi]": [
+ {
+ "checksum": "90c053b1b681239270280c0a99e7ef3b",
+ "size": 1266,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_stat_gssapi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_tables]": [
+ {
+ "checksum": "19474eee18099952bc85c46692655866",
+ "size": 1011,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_tablespace]": [
+ {
+ "checksum": "fbe7eb5a5dbf8ecf4e1a40197992b86b",
+ "size": 790,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_tablespace_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_timezone_abbrevs]": [
+ {
+ "checksum": "1067ecf9d7dafe1ed334ea211bf33931",
+ "size": 746,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_timezone_abbrevs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_timezone_names]": [
+ {
+ "checksum": "2c0afa6af1a045283256311b9eba3d3c",
+ "size": 738,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_timezone_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_trigger]": [
+ {
+ "checksum": "8ed918d42e9964263319e471c7db09f9",
+ "size": 736,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_trigger_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_type_syntax_pg]": [
+ {
+ "checksum": "8c407b697c4ff50be4128a29e3b88c97",
+ "size": 1029,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_type_syntax_pg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-pg_type_syntax_yql]": [
+ {
+ "checksum": "fafd5f6fabbb97b2f56a3dac01a91b61",
+ "size": 1344,
+ "uri": "https://{canondata_backend}/1942173/cb2fdcf9620011c608e9c76afbfe1a17bdd9d6f4/resource.tar.gz#test_sql2yql.test_pg_catalog-pg_type_syntax_yql_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-system_columns]": [
+ {
+ "checksum": "943c82f435e86d3cba1286d8e3748877",
+ "size": 1158,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-system_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-table_constraints]": [
+ {
+ "checksum": "a55b7f1cb28453b697293bdb7e469e75",
+ "size": 1010,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-table_constraints_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-tables]": [
+ {
+ "checksum": "48424cfe7048d0bb63dc44e524489cd1",
+ "size": 1019,
+ "uri": "https://{canondata_backend}/1881367/79a71c1478c556da1931a7565c12bdd14cc63567/resource.tar.gz#test_sql2yql.test_pg_catalog-tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_catalog-user]": [
+ {
+ "checksum": "a7b59168ee545aec600996c65be07ab4",
+ "size": 1626,
+ "uri": "https://{canondata_backend}/1773845/dbc47337ac2531600b4ba49bf1235a6f07ff1422/resource.tar.gz#test_sql2yql.test_pg_catalog-user_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_order_by_from_join]": [
+ {
+ "checksum": "78796c83a9d21fea80d5c503af554873",
+ "size": 1156,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_order_by_from_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_order_by_from_table]": [
+ {
+ "checksum": "eb0d13a8e63fbb43c300b1c79d02d069",
+ "size": 768,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_order_by_from_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_order_by_item_expression_from_projection]": [
+ {
+ "checksum": "2eacb5806ddb7805f05dc3cd4d9849d2",
+ "size": 876,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_order_by_item_expression_from_projection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_order_by_with_duplicates]": [
+ {
+ "checksum": "0d482fdd355fc570f31fae414fb3365a",
+ "size": 836,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_order_by_with_duplicates_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_order_by_wo_duplicated_in_projection]": [
+ {
+ "checksum": "c723ea3971b931be787f3808000e5aaa",
+ "size": 833,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_order_by_wo_duplicated_in_projection_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-ambigous_ref]": [
+ {
+ "checksum": "5bb1eafb72a533864774829ee8346ac9",
+ "size": 712,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-ambigous_ref_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-order_by_duplicated_proj_on_column_ref]": [
+ {
+ "checksum": "e0bd0cd714e708b53afbfb0770cf3e30",
+ "size": 836,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-order_by_duplicated_proj_on_column_ref_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-order_by_with_duplicates]": [
+ {
+ "checksum": "e0bd0cd714e708b53afbfb0770cf3e30",
+ "size": 836,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-order_by_with_duplicates_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-order_by_with_same_projection_lambda]": [
+ {
+ "checksum": "673d7f6a2957d8219aa8053e046ac5c5",
+ "size": 876,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-order_by_with_same_projection_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-qualified_star_from_using]": [
+ {
+ "checksum": "264defe2a7420f8598d81361ec299e28",
+ "size": 898,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-qualified_star_from_using_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-qualified_star_proj]": [
+ {
+ "checksum": "2c114fdee15bad984bbee0272b4a11b4",
+ "size": 1013,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-qualified_star_proj_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-qualified_star_proj_three_times]": [
+ {
+ "checksum": "9ce9532bab4349106b133b499a0ab5b3",
+ "size": 1085,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-qualified_star_proj_three_times_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-qualified_star_proj_two_times]": [
+ {
+ "checksum": "96798d767a55f25bc3142fe12482e030",
+ "size": 772,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-qualified_star_proj_two_times_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-simple_duplicate]": [
+ {
+ "checksum": "989666e1a3216149e8258dda211b5200",
+ "size": 520,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-simple_duplicate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-star_from_crossjoin]": [
+ {
+ "checksum": "7648a8936d8303d6ca154df86a867270",
+ "size": 947,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-star_from_crossjoin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pg_duplicated-star_proj]": [
+ {
+ "checksum": "de6763b6b24aaf53e1cdac5753f040ad",
+ "size": 696,
+ "uri": "https://{canondata_backend}/1937367/7407ea69c2dae8eb4ed44bf1d35081bcae435b2a/resource.tar.gz#test_sql2yql.test_pg_duplicated-star_proj_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-classic_division]": [
+ {
+ "checksum": "e5336d8701405a97dc8c154b7f868c33",
+ "size": 4361,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pragma-classic_division_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-config_exec]": [
+ {
+ "checksum": "8e5c4bf60f741af1c6f5e4c4af4969f8",
+ "size": 2292,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_pragma-config_exec_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-file]": [
+ {
+ "checksum": "65eff5078521005c663e4e0b21f410ab",
+ "size": 327,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_pragma-file_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-release_temp_data_chain_pull]": [
+ {
+ "checksum": "7778a03c6561a12f20222fc0fe8f6348",
+ "size": 8335,
+ "uri": "https://{canondata_backend}/1597364/b816fe5c265fd9eefd91457b546156a181ac331f/resource.tar.gz#test_sql2yql.test_pragma-release_temp_data_chain_pull_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-release_temp_data_chain_pull_fail]": [
+ {
+ "checksum": "15548ce5f880d1e7cbe40c8fd3d13ed1",
+ "size": 8332,
+ "uri": "https://{canondata_backend}/1597364/b816fe5c265fd9eefd91457b546156a181ac331f/resource.tar.gz#test_sql2yql.test_pragma-release_temp_data_chain_pull_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-release_temp_data_chain_pull_single_thread]": [
+ {
+ "checksum": "83f244080d87bb1ae46998b296fd44d8",
+ "size": 8335,
+ "uri": "https://{canondata_backend}/1597364/b816fe5c265fd9eefd91457b546156a181ac331f/resource.tar.gz#test_sql2yql.test_pragma-release_temp_data_chain_pull_single_thread_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-release_temp_data_chain_pull_single_thread_fail]": [
+ {
+ "checksum": "eab3954c00ebeffeb48c4bb06a8937d5",
+ "size": 8335,
+ "uri": "https://{canondata_backend}/1597364/b816fe5c265fd9eefd91457b546156a181ac331f/resource.tar.gz#test_sql2yql.test_pragma-release_temp_data_chain_pull_single_thread_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-yson_auto_convert]": [
+ {
+ "checksum": "19f687e1b58b98bc6a2d99acb9b87cbd",
+ "size": 1248,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pragma-yson_auto_convert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[pragma-yson_strict_fail]": [
+ {
+ "checksum": "d8961b7ec48504965b3e614623ecc3ea",
+ "size": 1169,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_pragma-yson_strict_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-discard_process_with_lambda]": [
+ {
+ "checksum": "f2fefae1d2373e49fcca2607329a0e8b",
+ "size": 978,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-discard_process_with_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-discard_reduce_lambda]": [
+ {
+ "checksum": "3018a4021877e20dffa3f960e4361ea2",
+ "size": 1370,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-discard_reduce_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-fuse_reduces_with_presort]": [
+ {
+ "checksum": "e379da7ed6a051092b9b7125ec129f09",
+ "size": 11861,
+ "uri": "https://{canondata_backend}/1923547/a000f225caa0fe7476a3e0c0740662cd5bbe1d5e/resource.tar.gz#test_sql2yql.test_produce-fuse_reduces_with_presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-native_desc_reduce_with_presort]": [
+ {
+ "checksum": "78eedc889a54e4499e62fb3752015a4a",
+ "size": 7752,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-native_desc_reduce_with_presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_and_filter]": [
+ {
+ "checksum": "cebe34c2d38b6543cf4830d01c989ae0",
+ "size": 1294,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_and_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_lambda_opt_args]": [
+ {
+ "checksum": "4b75cc3c37fedf0e63bdd5e43ea06d68",
+ "size": 3814,
+ "uri": "https://{canondata_backend}/1936273/ff4f0a6d173adeb50438b8fd581dd8a952c141bd/resource.tar.gz#test_sql2yql.test_produce-process_lambda_opt_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_multi_in]": [
+ {
+ "checksum": "781a42dd763a6735bc4078a7a36e144f",
+ "size": 6448,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_multi_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_multi_in_single_out]": [
+ {
+ "checksum": "b29789d941b4c85e0435570dd2b20f3a",
+ "size": 2202,
+ "uri": "https://{canondata_backend}/1942278/d928f4fc5f02eb7aecd1c70727a1a03e5fac4db3/resource.tar.gz#test_sql2yql.test_produce-process_multi_in_single_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_multi_in_trivial_lambda]": [
+ {
+ "checksum": "87b29475e56a51fef59f1ca46b0b5233",
+ "size": 2037,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_multi_in_trivial_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_multi_out]": [
+ {
+ "checksum": "7f3af92d062c2462ff246dcc0a4adfd8",
+ "size": 3492,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_multi_out_bad_count_fail]": [
+ {
+ "checksum": "7694edfadffe8ce7830aca27c0c20c73",
+ "size": 4255,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_multi_out_bad_count_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_pure_with_sort]": [
+ {
+ "checksum": "d5a15cfe7d8ff41c531dd06547b78251",
+ "size": 4487,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_produce-process_pure_with_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_row_and_columns]": [
+ {
+ "checksum": "60ff9768453251c32825c49782c05467",
+ "size": 2277,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_row_and_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_rows_and_filter]": [
+ {
+ "checksum": "3014bf3d9d3a76492f9ade9215ade42d",
+ "size": 2247,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_rows_and_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_rows_sorted_desc_multi_out]": [
+ {
+ "checksum": "e2b2eeba8f2af1ca49a6040cad3f9436",
+ "size": 5817,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_rows_sorted_desc_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_rows_sorted_multi_out]": [
+ {
+ "checksum": "c4ea929094bf644a87eb852ecd3ab134",
+ "size": 5814,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_rows_sorted_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_sorted_desc_multi_out]": [
+ {
+ "checksum": "c19b3dbe190c92d8e1493a9fb4c7e345",
+ "size": 5808,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_sorted_desc_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_sorted_multi_out]": [
+ {
+ "checksum": "cf3ddf89c61087570b3b42c536baf224",
+ "size": 5805,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_sorted_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_streaming]": [
+ {
+ "checksum": "6c1ae79a4511ea13f74aa07303dbdf44",
+ "size": 3537,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_streaming_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_streaming_count]": [
+ {
+ "checksum": "5518ee8b174b3f501a2af51afb1b251c",
+ "size": 3352,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_streaming_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_streaming_inline_bash]": [
+ {
+ "checksum": "c48a1304dd1a092e74981172f4ff9636",
+ "size": 1946,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_streaming_inline_bash_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_trivial_as_struct]": [
+ {
+ "checksum": "c51899020fb3b85cddfc11ad91b84170",
+ "size": 1170,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_trivial_as_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_assume]": [
+ {
+ "checksum": "7fa6c6c7b2cf1a6e233449f078223c56",
+ "size": 1128,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-process_with_assume_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_lambda]": [
+ {
+ "checksum": "9d8c5e3ecddf08ffa8d35ce388b6f6e9",
+ "size": 966,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_lambda_outstream]": [
+ {
+ "checksum": "521db80f4cd328a9ae5706c015a1e839",
+ "size": 3586,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_lambda_outstream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_python]": [
+ {
+ "checksum": "92202f2cac2415b9d976e9652a2c1dd8",
+ "size": 1211,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_python_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_python_as_struct]": [
+ {
+ "checksum": "1e9afd191168b2e77d024960c600c030",
+ "size": 1236,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_python_as_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_python_stream]": [
+ {
+ "checksum": "94c931fe180752fb90bce352ac64954e",
+ "size": 1462,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_python_stream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_udf]": [
+ {
+ "checksum": "9f3a2c932795fed2e58fe579965b955e",
+ "size": 1310,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_udf_rows]": [
+ {
+ "checksum": "22678426c759a9c12f18d104953ad3c4",
+ "size": 1902,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_udf_rows_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_udf_validate]": [
+ {
+ "checksum": "25e70b5afc577504062b85f4c9273893",
+ "size": 1972,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_udf_validate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-process_with_udf_validate_ignore_broken]": [
+ {
+ "checksum": "ee135de11f4c4301097e7b29be98ddc9",
+ "size": 1952,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-process_with_udf_validate_ignore_broken_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all]": [
+ {
+ "checksum": "40e23b1a4a066f1fceccd1a1ff9b0eb5",
+ "size": 1660,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all_expr]": [
+ {
+ "checksum": "bb9c99393e7b92770c33978ff40e69f8",
+ "size": 1613,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all_list]": [
+ {
+ "checksum": "f171f1b89d63e604cfe24df7877d0848",
+ "size": 1674,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all_list_stream]": [
+ {
+ "checksum": "33389459def72374008fef3b0b3f7fdf",
+ "size": 1896,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_list_stream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all_multi_in]": [
+ {
+ "checksum": "5d1a6362b000374ea050479bf6575a0c",
+ "size": 2126,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_multi_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_all_opt]": [
+ {
+ "checksum": "0a8b7474105e777586813bc5ad2cb622",
+ "size": 1675,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_all_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_by_struct]": [
+ {
+ "checksum": "b17fa5fb8c89bc4324c5427957dacd4a",
+ "size": 2244,
+ "uri": "https://{canondata_backend}/1781765/05968d1f61a10a7a02cfa6c6242226411f6c9b90/resource.tar.gz#test_sql2yql.test_produce-reduce_by_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_lambda]": [
+ {
+ "checksum": "906fe293081c9373b7d3b455f257dd6d",
+ "size": 1993,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_lambda_list_mem]": [
+ {
+ "checksum": "eaf986f4341006045d512db1fcc88fef",
+ "size": 2497,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_produce-reduce_lambda_list_mem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_lambda_list_table]": [
+ {
+ "checksum": "7ada0366b3088e51dc84859aad723331",
+ "size": 2634,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_produce-reduce_lambda_list_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_lambda_presort_twin]": [
+ {
+ "checksum": "e8ee19bc4c970514ec13eaee06c51604",
+ "size": 2209,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_lambda_presort_twin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_lambda_presort_twin_list]": [
+ {
+ "checksum": "70e08b5baf477e08446f3efe9d79e8d2",
+ "size": 2225,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_produce-reduce_lambda_presort_twin_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in]": [
+ {
+ "checksum": "89502ae061f87fb094f6cfb47c2e8209",
+ "size": 2739,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_difftype]": [
+ {
+ "checksum": "74dbd617d98075951494bbcba58d91a5",
+ "size": 2751,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_difftype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_difftype_assume]": [
+ {
+ "checksum": "f9f385dd8126952e74be2e740ac9facb",
+ "size": 6005,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_difftype_assume_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_difftype_assume_keytuple]": [
+ {
+ "checksum": "793328b686d3c0e66002163d828eeeaa",
+ "size": 6665,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_difftype_assume_keytuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_keytuple]": [
+ {
+ "checksum": "24afe71cf1b6c48bb6364efd1e9734f6",
+ "size": 2800,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_keytuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_keytuple_difftype]": [
+ {
+ "checksum": "3ec8fef592c7cfd720e13b56d5804816",
+ "size": 2812,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_keytuple_difftype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_presort]": [
+ {
+ "checksum": "2a3df7b35e924b1043bc293271455a27",
+ "size": 2919,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_ref]": [
+ {
+ "checksum": "4734e154c77f00605ca65120a2f25656",
+ "size": 4326,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_ref_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_sampling]": [
+ {
+ "checksum": "20676d5550acd93b1239bc405fc77d83",
+ "size": 3597,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_in_stage_and_flatmap]": [
+ {
+ "checksum": "6be2df429a0ea06c9282183226a99a21",
+ "size": 2880,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_in_stage_and_flatmap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_multi_out]": [
+ {
+ "checksum": "5a8bc95f879f7b1a9b8a90a42a3ab9e7",
+ "size": 3151,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_multi_out_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_subfields]": [
+ {
+ "checksum": "b8de23830267f7c2626e3c4038dec8a2",
+ "size": 1584,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_subfields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_typeinfo]": [
+ {
+ "checksum": "655c81cb4a7a9f84d9cb6824375d8742",
+ "size": 7270,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_typeinfo_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_assume]": [
+ {
+ "checksum": "1bad33f544c8bf95ff7bdf6b41f9c09d",
+ "size": 1411,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_assume_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_assume_in_subquery]": [
+ {
+ "checksum": "1312f126c69f9c3ec3a158a83ce8a9bf",
+ "size": 2733,
+ "uri": "https://{canondata_backend}/1600758/7bfd1ef457afc0ff28f5975f5deac4cbe6c60f7f/resource.tar.gz#test_sql2yql.test_produce-reduce_with_assume_in_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_flat_lambda]": [
+ {
+ "checksum": "afe395f03450e3713edc2255b8462523",
+ "size": 1794,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_flat_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_flat_python_stream]": [
+ {
+ "checksum": "37dd7dc1db0fadbec8cfc1465958b9c4",
+ "size": 2488,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_flat_python_stream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_presort_diff_order]": [
+ {
+ "checksum": "6bb71b50321efbdaf2769ffe56dc05cf",
+ "size": 12411,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_presort_diff_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python]": [
+ {
+ "checksum": "5711e115e84ebcf9230424d7dde4f096",
+ "size": 2073,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_few_keys]": [
+ {
+ "checksum": "da05c419762dda12ac4c0408bfaf28a2",
+ "size": 3142,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_few_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_few_keys_stream]": [
+ {
+ "checksum": "2f0be0869bbeac5d43f005f348ebaecd",
+ "size": 3131,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_few_keys_stream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_filter_and_having]": [
+ {
+ "checksum": "ba786bbf51d33370beab1579ba298790",
+ "size": 1698,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_filter_and_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_having]": [
+ {
+ "checksum": "21101262f17e6bcd60369bbc819d844e",
+ "size": 1549,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_presort]": [
+ {
+ "checksum": "f85aa345f661df30ce6010400bfa76e7",
+ "size": 2194,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_presort_stream]": [
+ {
+ "checksum": "ea2713efde189f77ad5247f202098397",
+ "size": 2181,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_presort_stream_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_row]": [
+ {
+ "checksum": "cc37fda03256729649044142c65456bd",
+ "size": 2185,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-reduce_with_python_row_repack]": [
+ {
+ "checksum": "fa5a17558a2861f08ec84c3a241d1419",
+ "size": 2380,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_produce-reduce_with_python_row_repack_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[produce-yql-10297]": [
+ {
+ "checksum": "1a13a5f3ed02ecf1ad9f644760f5a33c",
+ "size": 3937,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_produce-yql-10297_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_default]": [
+ {
+ "checksum": "bdd46d28a781d292bbbd099fe564cff4",
+ "size": 2355,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_default_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_expr]": [
+ {
+ "checksum": "d71d4cef2a21acbc7f9d65a425ae8123",
+ "size": 3313,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_expr_subquery]": [
+ {
+ "checksum": "73c9a558d96888080f9fa8ce4c375b23",
+ "size": 2597,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_sampling-bind_expr_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_expr_udf]": [
+ {
+ "checksum": "de801db2cf674d91f69a4bd88464d366",
+ "size": 1699,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_sampling-bind_expr_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_join_left]": [
+ {
+ "checksum": "e7a5f4aade4183cf17c3ba47539092cf",
+ "size": 3415,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_join_left_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_join_right]": [
+ {
+ "checksum": "d48af4278ff50af5e7a4280428552f47",
+ "size": 3249,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_join_right_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_multiple_sample]": [
+ {
+ "checksum": "34cfa3d4e7d3c9352713029695d8264d",
+ "size": 4622,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_multiple_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_small_rate]": [
+ {
+ "checksum": "49adc33d897d8754f7414ce15665983e",
+ "size": 2357,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-bind_small_rate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-bind_topsort]": [
+ {
+ "checksum": "96340f0ef07cb33b17b30036617d9573",
+ "size": 2660,
+ "uri": "https://{canondata_backend}/1871182/d8e2ef96aa8f2c68e5369ead40ba50ab33dadf24/resource.tar.gz#test_sql2yql.test_sampling-bind_topsort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-direct_read]": [
+ {
+ "checksum": "dc7b0d2a4b2f1fe79d467b15fb14b577",
+ "size": 1552,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-direct_read_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-insert]": [
+ {
+ "checksum": "910c47d95c98031de2cbb01697f0051c",
+ "size": 2435,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-insert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-join_left_sample]": [
+ {
+ "checksum": "1faedee543bb2ac9afa098b9de522acf",
+ "size": 1828,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-join_left_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-join_right_sample]": [
+ {
+ "checksum": "51edd1b271285ed07864b8fe41a27d83",
+ "size": 1828,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-join_right_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-map]": [
+ {
+ "checksum": "890d456b0aa84496a67e3faba1cc29e2",
+ "size": 1657,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-mapjoin_left_sample]": [
+ {
+ "checksum": "422214c3ba08790f196424adb233953c",
+ "size": 1916,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-mapjoin_left_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-mapjoin_right_sample]": [
+ {
+ "checksum": "a7d5031eb5326226be9b479c87d0eefd",
+ "size": 1916,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-mapjoin_right_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-orderedjoin_left_sample]": [
+ {
+ "checksum": "fe095f2fe8e16f0e677c9b61be2ef214",
+ "size": 1923,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-orderedjoin_left_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-orderedjoin_right_sample]": [
+ {
+ "checksum": "b262262a9eea0525ae94babbd41ab750",
+ "size": 1923,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-orderedjoin_right_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-read]": [
+ {
+ "checksum": "506d473366a4290a966970300020b128",
+ "size": 1535,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-read_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-reduce]": [
+ {
+ "checksum": "38642df155ccd70e9cf68057c8dd8809",
+ "size": 2403,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_sampling-reduce_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-reduce_with_presort]": [
+ {
+ "checksum": "4eeeb83e3f94f8fdd0d1991b6d5b9834",
+ "size": 2524,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_sampling-reduce_with_presort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-sample]": [
+ {
+ "checksum": "ac096b242dbcd625d63b7f0021fc5f7c",
+ "size": 2306,
+ "uri": "https://{canondata_backend}/1777230/e0379b273ca9ca9bd5c14b7b88db1c72326acceb/resource.tar.gz#test_sql2yql.test_sampling-sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-sort]": [
+ {
+ "checksum": "92f5eb70dbf34ed367159f17ed1a8fb2",
+ "size": 1585,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_sampling-sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_default]": [
+ {
+ "checksum": "61ec9422e92ee78595e53b66e57513d4",
+ "size": 2236,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_default_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_expr]": [
+ {
+ "checksum": "54b07fe1ebf182f677c64166ee459e0e",
+ "size": 3194,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_filter]": [
+ {
+ "checksum": "ee6a5e8ebdbe6e02e80902e6150cca5e",
+ "size": 2444,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_limit]": [
+ {
+ "checksum": "7c6e457f8e17d76c74db67420cfa97b3",
+ "size": 2322,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_mapjoin]": [
+ {
+ "checksum": "eb6a741e8c439d108e671a55c88735ee",
+ "size": 2599,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_mapjoin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_multiple_sample]": [
+ {
+ "checksum": "19dc281ff3d4e8496d416991fd409a6f",
+ "size": 2645,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-subquery_multiple_sample_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-subquery_sort]": [
+ {
+ "checksum": "a1760545b34529cd9ded6e9e1af16029",
+ "size": 2390,
+ "uri": "https://{canondata_backend}/1871182/d8e2ef96aa8f2c68e5369ead40ba50ab33dadf24/resource.tar.gz#test_sql2yql.test_sampling-subquery_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-system_sampling]": [
+ {
+ "checksum": "54aabd4c29bb21b0e11b8f3d724a805a",
+ "size": 2685,
+ "uri": "https://{canondata_backend}/1775319/aea965d51c26d8dea65ed5884b04b18325ac81d2/resource.tar.gz#test_sql2yql.test_sampling-system_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-table_content]": [
+ {
+ "checksum": "24480c5626e37c6c7d0babb250dc12f3",
+ "size": 2419,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-table_content_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-take_with_sampling]": [
+ {
+ "checksum": "0be41fac036d698e2bf2580cc1ca408d",
+ "size": 1622,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-take_with_sampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-topsort]": [
+ {
+ "checksum": "33c182f75d4682dc824bd0ab09b4d961",
+ "size": 1672,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_sampling-topsort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-yql-14664_deps]": [
+ {
+ "checksum": "0d00f67122d528902b752617e888feaa",
+ "size": 3150,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_sampling-yql-14664_deps_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[sampling-zero_percentage]": [
+ {
+ "checksum": "34fd436d7fc06f73168ded618ba8807e",
+ "size": 1585,
+ "uri": "https://{canondata_backend}/1031349/5470a46610b1de515e70118cc759253e9c47ea83/resource.tar.gz#test_sql2yql.test_sampling-zero_percentage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-append_to_desc]": [
+ {
+ "checksum": "d809f72aca663e3098c7c277fae6dda9",
+ "size": 1232,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-append_to_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-append_to_desc_with_remap]": [
+ {
+ "checksum": "5db1bc7cd331b659055f39c35d804591",
+ "size": 1353,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-append_to_desc_with_remap_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-concat]": [
+ {
+ "checksum": "585bee53e4cbea5f38bf2874aeba538b",
+ "size": 1152,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-copy]": [
+ {
+ "checksum": "c23c1142ecba8673f5ee6d3e0ecb3f0e",
+ "size": 1194,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-copy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-def_values]": [
+ {
+ "checksum": "d82f69591a458ce840d8c7cabd41bf6a",
+ "size": 1420,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-def_values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-def_values_job]": [
+ {
+ "checksum": "7659a9f9f7253b10904076ebbb6004bf",
+ "size": 1543,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-def_values_job_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-diffrerent_schemas]": [
+ {
+ "checksum": "a0a341c0161f0718d4a38d65d547cc07",
+ "size": 2193,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-diffrerent_schemas_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-fake_column]": [
+ {
+ "checksum": "96b192eab08612ea89aa19b0fbfee532",
+ "size": 2473,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-fake_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-insert]": [
+ {
+ "checksum": "688e8b7627b0669bebc8333ead0af82e",
+ "size": 2190,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-insert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-insert_sorted]": [
+ {
+ "checksum": "9da408cc848c9f496fc58ba51b73bc93",
+ "size": 2287,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-insert_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-limit_directread]": [
+ {
+ "checksum": "9990096fb8e5421ba8b77c7b7206696f",
+ "size": 1226,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-limit_directread_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-limit_simple]": [
+ {
+ "checksum": "28a84ad774112890882d736deec06a7f",
+ "size": 1191,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-limit_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-other]": [
+ {
+ "checksum": "d31c7721c2808f86aaa8dd142dc87582",
+ "size": 1360,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-other_job]": [
+ {
+ "checksum": "e369d9f460116d5e24cc2e0250e0fbc9",
+ "size": 1483,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-other_job_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-patchtype]": [
+ {
+ "checksum": "3d8e8a828c0da1698d701e1d13df86f3",
+ "size": 8655,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-patchtype_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-read_schema_change_other]": [
+ {
+ "checksum": "0199392a89bec311afe2c637c565eadb",
+ "size": 1183,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-read_schema_change_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-read_schema_other]": [
+ {
+ "checksum": "4e239d092edb86b95b6d86822bae6389",
+ "size": 1270,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-read_schema_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-remap_desc]": [
+ {
+ "checksum": "a306edbc61a7fab568a7d073ea24f2ac",
+ "size": 1324,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-remap_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-row_spec_with_default_values]": [
+ {
+ "checksum": "5369f5cde6e2c7b481324f7d4182670b",
+ "size": 1124,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-row_spec_with_default_values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all]": [
+ {
+ "checksum": "5369f5cde6e2c7b481324f7d4182670b",
+ "size": 1124,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_forceinferschema]": [
+ {
+ "checksum": "e390513292d2f9b3cf2517fb77e8d0eb",
+ "size": 2982,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_forceinferschema_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema2]": [
+ {
+ "checksum": "34223d0661e19bbccd19856cfbc9fa2e",
+ "size": 2060,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema]": [
+ {
+ "checksum": "b919cb953f38b8470f1006e074fbc47a",
+ "size": 1141,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema_limit]": [
+ {
+ "checksum": "9e5e96c499039179906a3a640feadb2a",
+ "size": 1227,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema_op]": [
+ {
+ "checksum": "8a49786278c8705d51aae509f0766fa1",
+ "size": 1246,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema_op_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema_op_custom_tmp]": [
+ {
+ "checksum": "16ba53140f13645c9edf3c6af83d35d6",
+ "size": 1335,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema_op_custom_tmp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_all_inferschema_range]": [
+ {
+ "checksum": "7f05c875c6cfd26502bc5deb626c3fbf",
+ "size": 1340,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_all_inferschema_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_field]": [
+ {
+ "checksum": "2c124c444180940ce83af38756dc02e4",
+ "size": 1105,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_field_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_fields_inferschema]": [
+ {
+ "checksum": "1d6334fe8807e938b0a526cd7b0bb651",
+ "size": 1404,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_fields_inferschema_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_operate_with_columns_simple]": [
+ {
+ "checksum": "fb9cf10a2b64ef942365e3b586ad84f7",
+ "size": 1186,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_operate_with_columns_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_reordered]": [
+ {
+ "checksum": "99d7acd3ff1868fdfcef30e8116a3d8a",
+ "size": 1810,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_reordered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_simple]": [
+ {
+ "checksum": "2b9fcdbea90054d06eb2bdaec28252a7",
+ "size": 1822,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_with_map]": [
+ {
+ "checksum": "85d53c7e07a4f977c9841525036cda56",
+ "size": 1245,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_with_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-select_yamr_fields]": [
+ {
+ "checksum": "fe21188b5dbea3ccda1cd30a86722931",
+ "size": 1267,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-select_yamr_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-skip_complex_type2]": [
+ {
+ "checksum": "eb056833c373dbc284b6921f0c9532b6",
+ "size": 1635,
+ "uri": "https://{canondata_backend}/1871002/78856f0d28778934b45632044b31b7a707b3231f/resource.tar.gz#test_sql2yql.test_schema-skip_complex_type2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-skip_complex_type]": [
+ {
+ "checksum": "eb056833c373dbc284b6921f0c9532b6",
+ "size": 1635,
+ "uri": "https://{canondata_backend}/1871002/78856f0d28778934b45632044b31b7a707b3231f/resource.tar.gz#test_sql2yql.test_schema-skip_complex_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_append]": [
+ {
+ "checksum": "819506f6c0ff3dd4a0ed9c927f7f71bd",
+ "size": 1194,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-user_schema_append_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_bind]": [
+ {
+ "checksum": "e5977417baa014cfd97925ce4b637376",
+ "size": 1240,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_bind_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_directread]": [
+ {
+ "checksum": "9ca47bf296f02666c8e08bea4fe4106f",
+ "size": 1842,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_directread_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_empty_table_ranges]": [
+ {
+ "checksum": "2daedb1e9e31303aab59008fcc3c7dc2",
+ "size": 4550,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_empty_table_ranges_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_existing_column]": [
+ {
+ "checksum": "2c13359033b7b231c461800986e35001",
+ "size": 1182,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_existing_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_missing_column]": [
+ {
+ "checksum": "ae334be86cdea698db968506c710023b",
+ "size": 1200,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_missing_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_mix1]": [
+ {
+ "checksum": "5c61a11510c8ca82192a7db25b49fcf4",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_mix1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_mix2]": [
+ {
+ "checksum": "46990e0698b5302863b7c5b0764d6f4c",
+ "size": 2103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_mix2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_mix3]": [
+ {
+ "checksum": "895c89e50f356a74fa381c833bcb2381",
+ "size": 2135,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_mix3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_no_infer]": [
+ {
+ "checksum": "fc252bc5528cdc4f8bd34189b56cc0fe",
+ "size": 1267,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_no_infer_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_override]": [
+ {
+ "checksum": "a7ed722f9d79318ccdea38811c43038e",
+ "size": 1193,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-user_schema_override_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_patch_columns]": [
+ {
+ "checksum": "79f3c5c1304dc9ce2d193241a8de5de2",
+ "size": 1712,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-user_schema_patch_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-user_schema_with_sort]": [
+ {
+ "checksum": "b928f60e7bb66b421d6f63c591217fae",
+ "size": 3342,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_schema-user_schema_with_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[schema-yamred_dsv_select_from_dict]": [
+ {
+ "checksum": "18aaceeee7c1b2ebd177db1c485f15d9",
+ "size": 2095,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_schema-yamred_dsv_select_from_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-anon_clash]": [
+ {
+ "checksum": "a4127bd6244616875e2ec93d65908af3",
+ "size": 2736,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-anon_clash_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-append_to_value]": [
+ {
+ "checksum": "da1c9829c17b55ecf7bc4dfba327a2dc",
+ "size": 1453,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-append_to_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-append_to_value_1000]": [
+ {
+ "checksum": "da1c9829c17b55ecf7bc4dfba327a2dc",
+ "size": 1453,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-append_to_value_1000_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-autoextract_source_value]": [
+ {
+ "checksum": "da86f22abb312619871f29bfa925e224",
+ "size": 2114,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-autoextract_source_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-autogen_columns_conflict]": [
+ {
+ "checksum": "947d7e4d925d97e83788651e9e69b517",
+ "size": 8103,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-autogen_columns_conflict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-backtick_with_escapes]": [
+ {
+ "checksum": "7c71735fa377f27a6a39dc074444c1a2",
+ "size": 1438,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-backtick_with_escapes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-bin_ops_long_concat]": [
+ {
+ "checksum": "63331c3a509b1a02f6271a67a88c0263",
+ "size": 2359,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-bin_ops_long_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-bit_ops]": [
+ {
+ "checksum": "e0f04bad3480fc11b0e338f08c09e8f3",
+ "size": 2484,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-bit_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-boolean_where]": [
+ {
+ "checksum": "f3b7144c4e8df4adf2375f707a01741a",
+ "size": 2195,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-boolean_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-braces]": [
+ {
+ "checksum": "80752b528967fbc16887f179d0c59401",
+ "size": 1439,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-braces_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-calculated_values]": [
+ {
+ "checksum": "5511e61bba81487b2235a3049990fd82",
+ "size": 1689,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_select-calculated_values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-cast_double_to_uint32]": [
+ {
+ "checksum": "1621791f279d0dcaf511c84c3c156bdc",
+ "size": 1476,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-cast_double_to_uint32_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-column_labels]": [
+ {
+ "checksum": "9532523010495c14917c9407a9d7c32e",
+ "size": 1307,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-column_labels_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-complex_filter_with_order]": [
+ {
+ "checksum": "ac08af6ca2f437fd72c444ee18615968",
+ "size": 1675,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-complex_filter_with_order_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-const_subrequest_and_select_by_all]": [
+ {
+ "checksum": "a988d5c274f423951506b608e2f62504",
+ "size": 2928,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-const_subrequest_and_select_by_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-core_func_test_bit]": [
+ {
+ "checksum": "0e1185b8b7a6dc12a5c98f2ee25b1aea",
+ "size": 1226,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-core_func_test_bit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-corr_name_in_select]": [
+ {
+ "checksum": "9885242b75d41132e6e9d445db2717f1",
+ "size": 1651,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-corr_name_in_select_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-corr_name_in_select_seq]": [
+ {
+ "checksum": "9e6dd516aeca2e45ecdf89d3a8a1d5b4",
+ "size": 2155,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-corr_name_in_select_seq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-create_structures]": [
+ {
+ "checksum": "cfb41b8e030e2cd5ee223a9a8f56ddc1",
+ "size": 1368,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-create_structures_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-create_tuples]": [
+ {
+ "checksum": "ec21146d583f86c249b1931dafa3e489",
+ "size": 1319,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-create_tuples_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-data_instance]": [
+ {
+ "checksum": "dc3d7e59549adf4c1749ec11bd746166",
+ "size": 34207,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-data_instance_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-deep_udf_call]": [
+ {
+ "checksum": "775dc26b62aa0acbe1d0a7cf2d945182",
+ "size": 2073,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-deep_udf_call_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dict_lookup]": [
+ {
+ "checksum": "a22232c511cf70d6acdbc5b50f51f39c",
+ "size": 2665,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-dict_lookup_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dict_lookup_by_key]": [
+ {
+ "checksum": "0ce837c2b5608600a0379dc588bb2f02",
+ "size": 1558,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-dict_lookup_by_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dict_lookup_by_key_with_def]": [
+ {
+ "checksum": "de92c9c314d885e8cf22b738e1a6c807",
+ "size": 1589,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-dict_lookup_by_key_with_def_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dict_lookup_column_names]": [
+ {
+ "checksum": "939433613518caad3aaabfbcdb59c918",
+ "size": 2347,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-dict_lookup_column_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dict_with_few_keys]": [
+ {
+ "checksum": "0f1ca2c9bbbe065b256d476f56547b47",
+ "size": 2342,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_select-dict_with_few_keys_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-digits]": [
+ {
+ "checksum": "0fd3a9a2518832a24bf4d46669262291",
+ "size": 11922,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-digits_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-discard]": [
+ {
+ "checksum": "33a91d25f083af1386b13c56867ade2e",
+ "size": 9412,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-discard_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dot_in_alias]": [
+ {
+ "checksum": "885cd6ed4fadfbf290a54821b877efd2",
+ "size": 1538,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-dot_in_alias_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-dot_name_subrequest]": [
+ {
+ "checksum": "5fa3ce40da3076aeec531b0f4195bdeb",
+ "size": 2097,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-dot_name_subrequest_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-double_at_ids]": [
+ {
+ "checksum": "9335391a5b1bd4c2417553ada85da408",
+ "size": 1473,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-double_at_ids_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-exists_false]": [
+ {
+ "checksum": "f686f2534586cde1d2152e04ddb038ed",
+ "size": 1962,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-exists_false_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-exists_true]": [
+ {
+ "checksum": "49ffdbce5791b1762de3eda2152f6863",
+ "size": 1672,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-exists_true_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-extend_and_take]": [
+ {
+ "checksum": "3ee549cd7078eff175383123f3c54250",
+ "size": 1229,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-extend_and_take_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-from_in_front]": [
+ {
+ "checksum": "2e845f083ada6039b83a870ab84037e2",
+ "size": 1320,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-from_in_front_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-from_in_front_sub]": [
+ {
+ "checksum": "aa34843054f0df7af8cea2ebdaa313af",
+ "size": 2585,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_select-from_in_front_sub_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-hits_count]": [
+ {
+ "checksum": "a6ac1c6d047c2fba2b8bdd4887eb93b1",
+ "size": 3625,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_select-hits_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-host_count]": [
+ {
+ "checksum": "632b6ebb3a23ede5c293330d8bd7e1e5",
+ "size": 3724,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_select-host_count_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-id_xor]": [
+ {
+ "checksum": "1359a082faad29f557828377832d36c0",
+ "size": 1017,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-id_xor_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-if]": [
+ {
+ "checksum": "70cb413c4127055bea29851b20df35db",
+ "size": 1403,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-if_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-literal_bool]": [
+ {
+ "checksum": "4a7f80310ac83c7c2c213869432d71a0",
+ "size": 1443,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-literal_bool_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-literal_negative]": [
+ {
+ "checksum": "57c909cc83ee74c46011095e5546b87b",
+ "size": 1442,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-literal_negative_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-logical_ops]": [
+ {
+ "checksum": "152d438825cdc0303a42747de7be7c4a",
+ "size": 1672,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-logical_ops_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-match_clause]": [
+ {
+ "checksum": "ed85d126138cf10dbca77b0c9f65ca95",
+ "size": 1572,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-match_clause_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-missing_with_nonpersist]": [
+ {
+ "checksum": "cf8d4debb674fbff7943a19f5e8038d6",
+ "size": 2312,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-missing_with_nonpersist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-multi_source_issue]": [
+ {
+ "checksum": "ceb1d674a0a6121b9a09170abea75718",
+ "size": 5138,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-multi_source_issue_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-null_check]": [
+ {
+ "checksum": "2f960d05926f370e58c912c303744393",
+ "size": 1857,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-null_check_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-one_labeled_column]": [
+ {
+ "checksum": "a61bb12e629ec05903cbb2619e8218b4",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-one_labeled_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-one_unlabeled_column]": [
+ {
+ "checksum": "c55204f6b54c409aa25314d35e1cf014",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-one_unlabeled_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-opt_list_access]": [
+ {
+ "checksum": "c1682566d7c89078daa02cfd5776e9be",
+ "size": 2615,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_select-opt_list_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-optional_as_warn]": [
+ {
+ "checksum": "003ef58484fe9d2f3b88d840e2231d11",
+ "size": 2450,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-optional_as_warn_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-optional_in_job]": [
+ {
+ "checksum": "89fe643152f3177bb117382f87d6fac2",
+ "size": 5821,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-optional_in_job_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-optional_pull]": [
+ {
+ "checksum": "2cdfc4cae4f4b5f40145250e474830b9",
+ "size": 5392,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-optional_pull_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-qualified_all_and_group_by]": [
+ {
+ "checksum": "cdcd2fb43084d246ad4bbfef33e32440",
+ "size": 2534,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_select-qualified_all_and_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-quoted_ids]": [
+ {
+ "checksum": "da1051bf54dacf7787287e222068f017",
+ "size": 1553,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-quoted_ids_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-quoted_ids_with_escapes]": [
+ {
+ "checksum": "2cd66cc3de26d46fa42ba53b00666681",
+ "size": 1276,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-quoted_ids_with_escapes_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-refselect]": [
+ {
+ "checksum": "8e1433640fe403a1ed0abf26948dbccf",
+ "size": 1425,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-refselect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-result_label]": [
+ {
+ "checksum": "fbd047b679fa00895007ff1f395ec713",
+ "size": 1010,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-result_label_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-result_rows_limit]": [
+ {
+ "checksum": "5448e1fd413cccbda36204e64d619bb9",
+ "size": 2158,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-result_rows_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-result_size_limit]": [
+ {
+ "checksum": "c8fad0d241ad721c651d88bc0d7fb6a8",
+ "size": 2205,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-result_size_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-result_size_limit_with_fill]": [
+ {
+ "checksum": "bcf045d839ec886174772c3693eaa9ad",
+ "size": 3775,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-result_size_limit_with_fill_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-reuse_named_node]": [
+ {
+ "checksum": "57c62ea35c17960eaccf7aa150b00917",
+ "size": 2222,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-reuse_named_node_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-sampleselect]": [
+ {
+ "checksum": "2b55c4db8315de96c59626dd4e0305af",
+ "size": 1441,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-sampleselect_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-scalar_subquery]": [
+ {
+ "checksum": "f4cf68ecacbd1bc93cd4c3d357be9a93",
+ "size": 2083,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-scalar_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-scalar_subquery_with_star]": [
+ {
+ "checksum": "49fb7e1627e05ef047d2a43f017bc4a8",
+ "size": 2511,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-scalar_subquery_with_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all]": [
+ {
+ "checksum": "5369f5cde6e2c7b481324f7d4182670b",
+ "size": 1124,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-select_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all_filtered]": [
+ {
+ "checksum": "14af1aea7175314d56667f2e750f6b35",
+ "size": 1248,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-select_all_filtered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all_from_concat]": [
+ {
+ "checksum": "558fe9640a1f5a3c9e869b1b72be3d19",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-select_all_from_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all_from_concat_anon]": [
+ {
+ "checksum": "566c83792d845e4370e3926266ad59a4",
+ "size": 1950,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-select_all_from_concat_anon_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all_group_by_column]": [
+ {
+ "checksum": "9c8d79e2cc28631b1a4e621789ee5749",
+ "size": 1265,
+ "uri": "https://{canondata_backend}/1889210/24e7d804e411f33095b2e477f1cb70653aeb4fbb/resource.tar.gz#test_sql2yql.test_select-select_all_group_by_column_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_all_ordered]": [
+ {
+ "checksum": "f0a57f3e763d3ce2240da226f4342068",
+ "size": 1176,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-select_all_ordered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-select_concrete_detailed_columns]": [
+ {
+ "checksum": "fe21188b5dbea3ccda1cd30a86722931",
+ "size": 1267,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-select_concrete_detailed_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-shift_columns]": [
+ {
+ "checksum": "ab79f7fe9bea68c0176e264a310c332e",
+ "size": 1420,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-shift_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-simple_struct_field_access]": [
+ {
+ "checksum": "fe8bb0206b83ecd99433827afa833b5a",
+ "size": 1492,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-simple_struct_field_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-struct_access_without_table_name]": [
+ {
+ "checksum": "a4d18d189428202fd51fbbceb04a31ac",
+ "size": 2787,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_select-struct_access_without_table_name_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-struct_members]": [
+ {
+ "checksum": "574a6633087829c6fed5efbd0ef2709d",
+ "size": 2147,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-struct_members_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-substring]": [
+ {
+ "checksum": "7c3dd6d2256a313ce820353cb12779a8",
+ "size": 1334,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-substring_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-substring_v1]": [
+ {
+ "checksum": "7c3dd6d2256a313ce820353cb12779a8",
+ "size": 1334,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-substring_v1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-sum_to_string]": [
+ {
+ "checksum": "361397f47b815248290db47aec71e209",
+ "size": 1467,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-sum_to_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-swap_columns]": [
+ {
+ "checksum": "7a44ff3582156d8064d4e03e7facd15b",
+ "size": 1420,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-swap_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-table_content_from_double_opt]": [
+ {
+ "checksum": "ac20920d8b0e11f70b1847b8d0366b4b",
+ "size": 2868,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-table_content_from_double_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-table_content_from_sort_desc]": [
+ {
+ "checksum": "c07a65dc82760886c5cd34da43e251c7",
+ "size": 2919,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-table_content_from_sort_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-table_content_with_tmp_folder]": [
+ {
+ "checksum": "dbbd8079e083d881eddbb7c22e90fdbb",
+ "size": 2326,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-table_content_with_tmp_folder_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-table_funcs_spec]": [
+ {
+ "checksum": "aab75ab553631230b93b820f805bf764",
+ "size": 1971,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-table_funcs_spec_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-tablename_with_table_row]": [
+ {
+ "checksum": "f4a7978b0e72e8de17d6255d4a6bef60",
+ "size": 1615,
+ "uri": "https://{canondata_backend}/1937424/0db6c351c76d2a197c426ee33bb3e27b39b98c82/resource.tar.gz#test_sql2yql.test_select-tablename_with_table_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-tablepathprefix]": [
+ {
+ "checksum": "d914bd4153ddb4078ad96c5ea839a80b",
+ "size": 2222,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-tablepathprefix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-to_dict]": [
+ {
+ "checksum": "58f06a57a5d7b4edeb241c22c911c268",
+ "size": 3813,
+ "uri": "https://{canondata_backend}/1773845/7044766f587832198e61f4b6ca854eef70640e20/resource.tar.gz#test_sql2yql.test_select-to_dict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-trivial_between]": [
+ {
+ "checksum": "0af4aaf1fe682eeb79ded78f8ba45691",
+ "size": 2241,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-trivial_between_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-trivial_group_by]": [
+ {
+ "checksum": "8fcda9ba3f7d1517648a3ba7c152d917",
+ "size": 1765,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_select-trivial_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-trivial_having]": [
+ {
+ "checksum": "75916dec2940627feb7ffe06fe9d8837",
+ "size": 1803,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-trivial_having_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-trivial_order_by]": [
+ {
+ "checksum": "94322d35a19328479b67cef7f6c23a13",
+ "size": 1470,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-trivial_order_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-trivial_where]": [
+ {
+ "checksum": "19f6e5b44d2093197ec0f9f888fe6d1a",
+ "size": 1549,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-trivial_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-two_select_without_semi]": [
+ {
+ "checksum": "62c079d85bac5a4da5f7024d8546c0ba",
+ "size": 1752,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-two_select_without_semi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-two_selects_with_diff_fields]": [
+ {
+ "checksum": "e21e19bfe1e14d5b690776ebd07a2aac",
+ "size": 2297,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-two_selects_with_diff_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-type_assert]": [
+ {
+ "checksum": "b933d41419390da6a477c3f7d32475c7",
+ "size": 5504,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-type_assert_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-unary_op_interval]": [
+ {
+ "checksum": "626bbe82c4fe82d251dc86cae43f26b6",
+ "size": 4965,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-unary_op_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-uncorrelated_subqueries]": [
+ {
+ "checksum": "d06864be2c76d8908e262b1904920fdd",
+ "size": 2120,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-uncorrelated_subqueries_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-unlabeled]": [
+ {
+ "checksum": "d82f69591a458ce840d8c7cabd41bf6a",
+ "size": 1420,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-unlabeled_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-unlabeled_1000]": [
+ {
+ "checksum": "675e42cafb3c8fa9a151b12472347d40",
+ "size": 1583,
+ "uri": "https://{canondata_backend}/1942415/a054ba77d58b57e49908ceed5fa1b41dac7c87d8/resource.tar.gz#test_sql2yql.test_select-unlabeled_1000_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-use_cluster]": [
+ {
+ "checksum": "c55204f6b54c409aa25314d35e1cf014",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-use_cluster_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-values]": [
+ {
+ "checksum": "666ab9f87b3c88a8ce0f0f6b0e7bc329",
+ "size": 4501,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-values_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-where_cast]": [
+ {
+ "checksum": "62d3541777ccd963b5e2b26863e1f15d",
+ "size": 1266,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-where_cast_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-where_in]": [
+ {
+ "checksum": "385669ec7f2dafe888d05918751076f2",
+ "size": 1438,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-where_in_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-where_not_null]": [
+ {
+ "checksum": "6ed6b3b15c347c312124f219dffe03c4",
+ "size": 1242,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-where_not_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[select-where_with_lambda]": [
+ {
+ "checksum": "e10759377334cbdcff25390d42996702",
+ "size": 1310,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_select-where_with_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-action_shared_subquery_expr_after_commit]": [
+ {
+ "checksum": "8d46a0d01061a3bc2ce149d260b14607",
+ "size": 4521,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-action_shared_subquery_expr_after_commit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-shared_named_expr]": [
+ {
+ "checksum": "fd1b8da8c3d12ae945d1f986fbca5c46",
+ "size": 2159,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-shared_named_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-shared_subquery_expr]": [
+ {
+ "checksum": "1340c87492a4769dbbc7b88ab9f55cde",
+ "size": 2756,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-shared_subquery_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-shared_subquery_expr_after_commit]": [
+ {
+ "checksum": "58a92b204197672e17aa99af1c55ac3b",
+ "size": 3808,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-shared_subquery_expr_after_commit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-simple1]": [
+ {
+ "checksum": "a9a9898788b13b6faeca17e1e1409944",
+ "size": 1266,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-simple1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-simple2]": [
+ {
+ "checksum": "86177a8023ea01e2cabf162095c4f37a",
+ "size": 2121,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-simple2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[seq_mode-subquery_shared_subquery]": [
+ {
+ "checksum": "db3b15f3a9ead0fc6bae20740dc74e21",
+ "size": 2630,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql2yql.test_seq_mode-subquery_shared_subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-no_simple_columns_tablerow]": [
+ {
+ "checksum": "aedf06ccf694ead9d57f42dae4ca4f2a",
+ "size": 6634,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-no_simple_columns_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_base]": [
+ {
+ "checksum": "741572bca7fd46aa5123f84a6f8314ac",
+ "size": 1265,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_base_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_base_fail]": [
+ {
+ "checksum": "0a942e4cc9662acec38f57764b1436f5",
+ "size": 2188,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_base_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_all]": [
+ {
+ "checksum": "2220a7ad0c97e5755ed5e0f301b3c5e6",
+ "size": 2990,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_all_1]": [
+ {
+ "checksum": "0e77388e75f64eae6748b262a3f3e55a",
+ "size": 2736,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_all_1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_all_2]": [
+ {
+ "checksum": "0e77388e75f64eae6748b262a3f3e55a",
+ "size": 2736,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_all_2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_bug8923]": [
+ {
+ "checksum": "9e9fdcf2b54c7907197e93455af1297c",
+ "size": 3642,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_bug8923_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_qualified_all_disable]": [
+ {
+ "checksum": "1cf5d20775a259901e6c9b875dcb42e5",
+ "size": 2530,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_qualified_all_disable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_qualified_all_enable]": [
+ {
+ "checksum": "8bd0497f73ff65b182bfcd63dbda265d",
+ "size": 2677,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_qualified_all_enable_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_without_1]": [
+ {
+ "checksum": "e198370c9339903b72af6088a707f7e6",
+ "size": 8119,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_without_1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_without_2]": [
+ {
+ "checksum": "78ccb1c37f301b4ac16ff8f342faac61",
+ "size": 8331,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_without_2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_without_left_semi_1]": [
+ {
+ "checksum": "e83ab31a1488fc94069c85b53607910a",
+ "size": 3084,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_without_left_semi_1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_coalesce_without_left_semi_2]": [
+ {
+ "checksum": "83fcb7a39f46dddececc96e6b2ff1f90",
+ "size": 3227,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_coalesce_without_left_semi_2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_fail]": [
+ {
+ "checksum": "cec82d74ddba0209872f6d57e7fd4e14",
+ "size": 3076,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_qualified]": [
+ {
+ "checksum": "e34cf64f543f26947836e72145a9560e",
+ "size": 3068,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_qualified_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_subreq_all_key_without]": [
+ {
+ "checksum": "163cce82d0acf6d9ebad2034d5b16998",
+ "size": 3046,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_subreq_all_key_without_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_subreq_same_key]": [
+ {
+ "checksum": "4012035d1f165b9ca66407505c5a00f5",
+ "size": 2726,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_subreq_same_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_subreq_same_key_by_all]": [
+ {
+ "checksum": "a4ea718e779a7914b79ac69ce5363d06",
+ "size": 2874,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_subreq_same_key_by_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_subreq_same_key_without]": [
+ {
+ "checksum": "dc0729dc5a5762f7d592227a5e8f4892",
+ "size": 3144,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_subreq_same_key_without_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_without_resolve_dublicates]": [
+ {
+ "checksum": "56ddcf1d2e3f7bcf511931d53ad428a0",
+ "size": 3420,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_without_resolve_dublicates_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_join_without_resolve_dublicates_mult]": [
+ {
+ "checksum": "a627e884413130c48490427f183d912d",
+ "size": 3676,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_join_without_resolve_dublicates_mult_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_qualified_all_and_group_by]": [
+ {
+ "checksum": "6b81f4b7cf546121bbfd4a8bfe750ec9",
+ "size": 2463,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_qualified_all_and_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_subreq]": [
+ {
+ "checksum": "e386fdab621cad0ca9e2ce1bfdccf864",
+ "size": 2036,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_subreq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_subreq_all]": [
+ {
+ "checksum": "a8b23c3312a886f173a3f3cda407428a",
+ "size": 2185,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_subreq_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_tablerow]": [
+ {
+ "checksum": "d075f6da7f699142303e628645ffb483",
+ "size": 7213,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[simple_columns-simple_columns_union_all_qualified_star]": [
+ {
+ "checksum": "0acabf460f478dad1eeec9248927c1fb",
+ "size": 3045,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_simple_columns-simple_columns_union_all_qualified_star_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-BadDownsamplingAggregation]": [
+ {
+ "checksum": "71d8572d4941dcc0a5191b0c863d1a82",
+ "size": 1236,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-BadDownsamplingAggregation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-BadDownsamplingDisabled]": [
+ {
+ "checksum": "2c4d08c8963b8ec3c040ac15874aa59c",
+ "size": 1233,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-BadDownsamplingDisabled_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-BadDownsamplingFill]": [
+ {
+ "checksum": "1bd1ce7e13ada0dcd77f817e7be5e527",
+ "size": 1229,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-BadDownsamplingFill_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-BadDownsamplingInterval]": [
+ {
+ "checksum": "074f93dbca47fd8642865801992c5155",
+ "size": 1237,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-BadDownsamplingInterval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-Basic]": [
+ {
+ "checksum": "b16dcad0d233d0edf6a77e0545ad8929",
+ "size": 1198,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-Basic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-BrokenJsonResponse]": [
+ {
+ "checksum": "3989d4c834dd77b2601f4c031d062837",
+ "size": 1199,
+ "uri": "https://{canondata_backend}/1599023/688233977db70f339a250f6f25033e36d5b327fb/resource.tar.gz#test_sql2yql.test_solomon-BrokenJsonResponse_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-DownsamplingValidSettings]": [
+ {
+ "checksum": "1e75df3c5096dd36a54c18e633a607a1",
+ "size": 1272,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-DownsamplingValidSettings_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-Downsampling]": [
+ {
+ "checksum": "75f43c8acaf9d8f7c0dac7184f1b0fb3",
+ "size": 1346,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-Downsampling_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-InvalidProject]": [
+ {
+ "checksum": "a245f9de278996da0a0fb71395f5bdf0",
+ "size": 1195,
+ "uri": "https://{canondata_backend}/1599023/688233977db70f339a250f6f25033e36d5b327fb/resource.tar.gz#test_sql2yql.test_solomon-InvalidProject_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-LabelColumns]": [
+ {
+ "checksum": "9cbee7499e54e16143791b73d4891146",
+ "size": 1289,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-LabelColumns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-Subquery]": [
+ {
+ "checksum": "93c45f401cb4eaaf94f9731a8cf3d519",
+ "size": 2206,
+ "uri": "https://{canondata_backend}/1925842/4cd572fb4c53ca13dd4b61884e96490799969da0/resource.tar.gz#test_sql2yql.test_solomon-Subquery_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[solomon-UnknownSetting]": [
+ {
+ "checksum": "0ab48f8f6e277b880a88bc040a10a0a6",
+ "size": 1215,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql2yql.test_solomon-UnknownSetting_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[stream_lookup_join-lookup_join]": [
+ {
+ "checksum": "cafb9f686b3f2fca7a4160d3f4d9f2ef",
+ "size": 2287,
+ "uri": "https://{canondata_backend}/1781765/65ca10289c1bb04a630a832c0a648fc9d7bbfdfd/resource.tar.gz#test_sql2yql.test_stream_lookup_join-lookup_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[stream_lookup_join-lookup_join_narrow]": [
+ {
+ "checksum": "f375a7f174b86bffd959a947ab5e4216",
+ "size": 2288,
+ "uri": "https://{canondata_backend}/1781765/65ca10289c1bb04a630a832c0a648fc9d7bbfdfd/resource.tar.gz#test_sql2yql.test_stream_lookup_join-lookup_join_narrow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-concat_empty_sorted_with_key_diff]": [
+ {
+ "checksum": "272e752fffe3c39698d3c4e80546d402",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-concat_empty_sorted_with_key_diff_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-concat_sorted_max_sorted_tables]": [
+ {
+ "checksum": "50045933b77105f728fda8b5defb48eb",
+ "size": 1573,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_table_range-concat_sorted_max_sorted_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-concat_sorted_max_tables]": [
+ {
+ "checksum": "8f64be51eecd36b624ef2f39b23fa3a0",
+ "size": 1509,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_table_range-concat_sorted_max_tables_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-concat_sorted_with_key_diff]": [
+ {
+ "checksum": "a01c6c586b0907263fa1aca251108004",
+ "size": 1270,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_table_range-concat_sorted_with_key_diff_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-concat_with_view]": [
+ {
+ "checksum": "da66136ab323eef81a10a3f142ffee41",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-concat_with_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-each_with_non_existing]": [
+ {
+ "checksum": "b4627eeca4f69a1d3c232b6058a2d5ef",
+ "size": 1328,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-each_with_non_existing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-limit_with_table_path_over_sorted_range]": [
+ {
+ "checksum": "8815c9ec98bf9cc65dbe9ed8fd61462d",
+ "size": 1710,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-limit_with_table_path_over_sorted_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-merge_non_strict]": [
+ {
+ "checksum": "3e0294dd1b5dd8abd311f181f4914a5c",
+ "size": 2592,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_table_range-merge_non_strict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_over_desc]": [
+ {
+ "checksum": "f177495846e8bb409cdc33d638b30384",
+ "size": 1546,
+ "uri": "https://{canondata_backend}/1937429/5822551fab6aa1fdd3a2a8f46252b4164f4be75d/resource.tar.gz#test_sql2yql.test_table_range-range_over_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_over_filter]": [
+ {
+ "checksum": "f57e43f6b05e90aac2cd553392c853c2",
+ "size": 2675,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_over_filter_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_over_filter_udf]": [
+ {
+ "checksum": "87c2a4f73515a2ab3a18a322ca301b06",
+ "size": 1681,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_over_filter_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_over_like]": [
+ {
+ "checksum": "ad9b9c68dde27def37ba8ee145491e3b",
+ "size": 1409,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_over_like_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_over_regexp]": [
+ {
+ "checksum": "97b0be585bc8064cc9979fd1fe7ccc19",
+ "size": 1371,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_over_regexp_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_slash]": [
+ {
+ "checksum": "aeb7edb1773d3d51f09996f7aa4d31ef",
+ "size": 2204,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_slash_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_tables_with_view]": [
+ {
+ "checksum": "df56c6a40dfc6262a441c5c008e618a5",
+ "size": 1355,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_tables_with_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-range_with_view]": [
+ {
+ "checksum": "346d330a0b80bce944880293f8aa93a6",
+ "size": 1217,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-range_with_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-table_funcs_expr]": [
+ {
+ "checksum": "622efc06ac8c77034ebdc27ea81b1570",
+ "size": 15784,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-table_funcs_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[table_range-tablepath_with_non_existing]": [
+ {
+ "checksum": "8005f127fd82424cf7b482bca1d3de89",
+ "size": 1768,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_table_range-tablepath_with_non_existing_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q10]": [
+ {
+ "checksum": "e76748ea9ea962e72ee45cececfc2519",
+ "size": 9685,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q10_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q11]": [
+ {
+ "checksum": "34a51fa76d695870f61d3b30c40c4a60",
+ "size": 6267,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q11_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q12]": [
+ {
+ "checksum": "58128e9c76915f7b60714b3c6843c875",
+ "size": 4239,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q12_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q13]": [
+ {
+ "checksum": "6ee9bbff446367cc4c3fb4007a83602a",
+ "size": 3815,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q13_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q14]": [
+ {
+ "checksum": "410aa83c8fbb96f9a5269df0b6a052a9",
+ "size": 2366,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_tpch-q14_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q15]": [
+ {
+ "checksum": "1c1c6676ce58506a6b4d99b151c45229",
+ "size": 6138,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q15_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q16]": [
+ {
+ "checksum": "0d43a338d16413b8682ff20cf02fb0de",
+ "size": 4528,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q16_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q17]": [
+ {
+ "checksum": "678bcb8d878d54bd067824b5ddd11366",
+ "size": 4139,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_tpch-q17_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q18]": [
+ {
+ "checksum": "c20462b5f711a09889046ca8a9b4af24",
+ "size": 5503,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q18_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q19]": [
+ {
+ "checksum": "d162feb945073bded190986ca205c6f5",
+ "size": 4197,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_tpch-q19_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q1]": [
+ {
+ "checksum": "518665bdca691f04daa97ae6ea2eaa00",
+ "size": 4212,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q20]": [
+ {
+ "checksum": "08a27adb59aebdbe293d48012b8d4f83",
+ "size": 7606,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q20_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q21]": [
+ {
+ "checksum": "8aa28d1f37b9b237223bbb22c3656b8e",
+ "size": 10449,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q21_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q22]": [
+ {
+ "checksum": "537d0b62f0daf8829c21d073b14d10ac",
+ "size": 6615,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q22_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q2]": [
+ {
+ "checksum": "370fd51115c34cc2f0a29495c08abc70",
+ "size": 12169,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q3]": [
+ {
+ "checksum": "00ec55b57ba36669b8bcf38079d6d7c7",
+ "size": 5732,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q4]": [
+ {
+ "checksum": "d2ed660615c36dc1a64887388d70f1d5",
+ "size": 3409,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q4_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q5]": [
+ {
+ "checksum": "fd35b290f96d85611adf02351dfbb903",
+ "size": 11204,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q5_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q6]": [
+ {
+ "checksum": "2acd9e3088bac182b665285a546d7f9d",
+ "size": 1867,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_tpch-q6_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q7]": [
+ {
+ "checksum": "0af2c9c7a98ad24985b865e84df05dae",
+ "size": 10602,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q7_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q8]": [
+ {
+ "checksum": "ed2f310d9523b71976b9ea01a3591b98",
+ "size": 11211,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q8_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[tpch-q9]": [
+ {
+ "checksum": "0eb72137f7003bb643eb9f7d7f8a83e0",
+ "size": 11730,
+ "uri": "https://{canondata_backend}/1937001/12039bb8c154b2740e4390623554b41a20f1852b/resource.tar.gz#test_sql2yql.test_tpch-q9_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_literal-create_table]": [
+ {
+ "checksum": "234f3fa3e94e372211db7c2faffbbe5f",
+ "size": 6649,
+ "uri": "https://{canondata_backend}/937458/7b837cadbe63d41679c064a8decd8c8267d712e8/resource.tar.gz#test_sql2yql.test_type_literal-create_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_literal-declare]": [
+ {
+ "checksum": "784737667ff95529bb84465be668fd93",
+ "size": 4141,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_type_literal-declare_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_literal-evaluate]": [
+ {
+ "checksum": "1be6347b2f7f5c1036e8620a27896993",
+ "size": 1331,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_literal-evaluate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-append_diff_flags]": [
+ {
+ "checksum": "4ec6ee366ca5af3a40a450eaaa9a43d2",
+ "size": 1498,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_type_v3-append_diff_flags_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-append_diff_layout1]": [
+ {
+ "checksum": "c9ab592bd607d3f1d97fd9b6c0a8c157",
+ "size": 3954,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_type_v3-append_diff_layout1_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-append_diff_layout2]": [
+ {
+ "checksum": "4f6b78a6dc823ad27a880b0c2bd92c02",
+ "size": 4636,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_type_v3-append_diff_layout2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-append_struct]": [
+ {
+ "checksum": "87b494697782d1d75b819267ef7bee83",
+ "size": 4272,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-append_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-decimal_yt]": [
+ {
+ "checksum": "94ff45ef2f0b8c772000e66f8398d3ff",
+ "size": 2859,
+ "uri": "https://{canondata_backend}/1937150/9172d3bfa238458c3c5d39a9044d73fbb74cec2d/resource.tar.gz#test_sql2yql.test_type_v3-decimal_yt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-decimal_yt_llvm]": [
+ {
+ "checksum": "bacc20793aafcff4e19b8b8a9cadb117",
+ "size": 6361,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-decimal_yt_llvm_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-decimal_yt_nollvm]": [
+ {
+ "checksum": "31e8232a9708c40e4e519f244d362b29",
+ "size": 6364,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-decimal_yt_nollvm_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-float]": [
+ {
+ "checksum": "0f6283807b5bebba51fe375c17a6e404",
+ "size": 3112,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-float_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-ignore_v3_hint]": [
+ {
+ "checksum": "02a8cbcb92284cdff751e5ccb325a17d",
+ "size": 1461,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-ignore_v3_hint_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-ignore_v3_pragma]": [
+ {
+ "checksum": "989cd0b07f5f898f4b987781e63665c9",
+ "size": 1529,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-ignore_v3_pragma_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-insert_struct_v3_with_native]": [
+ {
+ "checksum": "8f6fd9f93962bd305f9289a83e823854",
+ "size": 4038,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_type_v3-insert_struct_v3_with_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-insert_struct_v3_wo_native]": [
+ {
+ "checksum": "bd9d42c211f0c5c04649b2ebf4bb6f34",
+ "size": 4110,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_type_v3-insert_struct_v3_wo_native_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-json]": [
+ {
+ "checksum": "3eec85e8443bae5c6a1895f02d96b3da",
+ "size": 3155,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-json_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-mergejoin_with_sort]": [
+ {
+ "checksum": "1b26dab240a9b4b210a69828e1ebaefc",
+ "size": 1950,
+ "uri": "https://{canondata_backend}/1936273/650721992a207bbef0ba5940571239843ac7787f/resource.tar.gz#test_sql2yql.test_type_v3-mergejoin_with_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-mixed_with_columns]": [
+ {
+ "checksum": "df43115eaa6b93151c906224e5b1ed0f",
+ "size": 1711,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-mixed_with_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-non_strict]": [
+ {
+ "checksum": "0dfc4c17c0957c7770784b19d1357156",
+ "size": 1562,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_type_v3-non_strict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-replace_diff_layout]": [
+ {
+ "checksum": "260a0ffeef0760fab7261c719c5f6dd7",
+ "size": 3932,
+ "uri": "https://{canondata_backend}/1871182/78dc92fb0f0a949ef8d6e955f47dd0843494dee6/resource.tar.gz#test_sql2yql.test_type_v3-replace_diff_layout_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-singulars]": [
+ {
+ "checksum": "c66b51025efd94980f6d5ccee1013b17",
+ "size": 2174,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_type_v3-singulars_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-split]": [
+ {
+ "checksum": "027fa5a2aa22041b46bb0d3674aa1a6e",
+ "size": 1266,
+ "uri": "https://{canondata_backend}/1924537/2230c67c41f63264344c4a48b90240713920cf74/resource.tar.gz#test_sql2yql.test_type_v3-split_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-type_subset]": [
+ {
+ "checksum": "ecb62a2e38651b94e6212b651b59b164",
+ "size": 1519,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_type_v3-type_subset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[type_v3-uuid]": [
+ {
+ "checksum": "8e0d4cb4d37e1f75aaf2c3062e778089",
+ "size": 4895,
+ "uri": "https://{canondata_backend}/1925821/b8008446b33ca345e686cde20ac11f69555d8599/resource.tar.gz#test_sql2yql.test_type_v3-uuid_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-automap_null]": [
+ {
+ "checksum": "4ff981ba396926defeeb6d78dc64839e",
+ "size": 2737,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-automap_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-complex_return_type]": [
+ {
+ "checksum": "c02a4f2dce4fea948f6b5aed04a1620c",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-complex_return_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-generic_udf]": [
+ {
+ "checksum": "cc810f3e1d487fa8d84042f830bdc343",
+ "size": 1145,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-generic_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-named_args]": [
+ {
+ "checksum": "8e1140b6482e61df92a909a8782dcdf1",
+ "size": 3455,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-named_args_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-named_args_for_script]": [
+ {
+ "checksum": "6f82fa5dd316f487a706c4802aa0f243",
+ "size": 2568,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-named_args_for_script_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-named_args_for_script_with_posargs2]": [
+ {
+ "checksum": "75d4b2d52c1110720b476425ddb61528",
+ "size": 2567,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-named_args_for_script_with_posargs2_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-named_args_for_script_with_posargs]": [
+ {
+ "checksum": "1f630e07c06d8e5435a900751ba8f1a3",
+ "size": 2586,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-named_args_for_script_with_posargs_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-named_args_for_script_with_posargs_reuse_args_fail]": [
+ {
+ "checksum": "4469c2a1f87dbf7ab2c2a80358eff114",
+ "size": 2561,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-python_script]": [
+ {
+ "checksum": "78b5d2911a18dede3eecf7c1ab43ac26",
+ "size": 1423,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-python_script_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-python_script_from_file]": [
+ {
+ "checksum": "17e5508e0ec2d63548ecc5be5b75b2d1",
+ "size": 1348,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-python_script_from_file_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-python_struct]": [
+ {
+ "checksum": "769753004b839ce1ac47798ec76c5e8a",
+ "size": 2229,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-python_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-regexp_udf]": [
+ {
+ "checksum": "f9815d9ac466d7f2d1e9b15161c3313d",
+ "size": 1269,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-regexp_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-same_udf_modules]": [
+ {
+ "checksum": "52957d2d2831adfb08fbcbaa83be38d9",
+ "size": 2297,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-same_udf_modules_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-sqlproject_grounds]": [
+ {
+ "checksum": "52f805f63d8e551d1f2a89431e7b006d",
+ "size": 1437,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-sqlproject_grounds_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-trivial_udf]": [
+ {
+ "checksum": "c7c5e5030a14ba980ca851d9cca77304",
+ "size": 1043,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-trivial_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-two_regexps]": [
+ {
+ "checksum": "0b05343df432ddda72a310ed2cb9baf3",
+ "size": 1358,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-two_regexps_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udaf]": [
+ {
+ "checksum": "8fedd6fdd8e7796ceb3ee578eb8dcd9c",
+ "size": 6328,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udaf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udaf_default]": [
+ {
+ "checksum": "f27ef12b10a0b809ca19f5b4c0d01851",
+ "size": 4294,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udaf_default_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udaf_distinct]": [
+ {
+ "checksum": "66b39945b97483c4a1a86741471179e1",
+ "size": 6849,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udaf_distinct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udaf_lambda]": [
+ {
+ "checksum": "47cbbbecfe108ba20532e19bf77bbdc9",
+ "size": 2263,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udaf_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udaf_short]": [
+ {
+ "checksum": "537d26f981855e27d2db739694a3891f",
+ "size": 3160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udaf_short_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udf]": [
+ {
+ "checksum": "010198bf1a03aebcab63fe0f28b95cd3",
+ "size": 1487,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udf_call_with_group_and_limit]": [
+ {
+ "checksum": "e9aa097e66f11f6d834284a8fc8912ee",
+ "size": 1631,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_udf-udf_call_with_group_and_limit_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udf_empty]": [
+ {
+ "checksum": "913995349e56a9103bfb06a8a2afbc47",
+ "size": 1691,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udf_empty_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-udf_result_member]": [
+ {
+ "checksum": "6979f7b57791d76db22bea179f57f99a",
+ "size": 1406,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-udf_result_member_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[udf-wrong_args_fail]": [
+ {
+ "checksum": "83e2d622e34b735e926834d6304ccf06",
+ "size": 3564,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_udf-wrong_args_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_column_extention]": [
+ {
+ "checksum": "5d6bee9ef7d7a571920cb3d9c17535ae",
+ "size": 2948,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union-union_column_extention_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_mix]": [
+ {
+ "checksum": "2c92b8d489237eb6fff812f076da51e6",
+ "size": 4096,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union-union_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_multiin]": [
+ {
+ "checksum": "104799b230c982f699a0822cd06c8dd7",
+ "size": 2458,
+ "uri": "https://{canondata_backend}/1903280/f0c0265b216a7ef70b599283ea3aca04b5590097/resource.tar.gz#test_sql2yql.test_union-union_multiin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_positional]": [
+ {
+ "checksum": "7893aa69c457b2ba0742ab81364a90d9",
+ "size": 1755,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union-union_positional_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_positional_mix]": [
+ {
+ "checksum": "f514002a290fbcaaaf4b1ea3856a2c21",
+ "size": 2331,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union-union_positional_mix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union-union_trivial]": [
+ {
+ "checksum": "5c636823089fc3a2acf7328b447297be",
+ "size": 2344,
+ "uri": "https://{canondata_backend}/1903280/f0c0265b216a7ef70b599283ea3aca04b5590097/resource.tar.gz#test_sql2yql.test_union-union_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-infer_3]": [
+ {
+ "checksum": "8610a64771a7c17e69aecc18632b0af5",
+ "size": 2114,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-infer_3_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-inner_union_all_with_limits]": [
+ {
+ "checksum": "cac010171a180e0858bed17903f22271",
+ "size": 5152,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-inner_union_all_with_limits_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-mix_map_and_project]": [
+ {
+ "checksum": "3fc808a5c24970659c31822b82ef1d9c",
+ "size": 3481,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-mix_map_and_project_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-mix_map_and_read]": [
+ {
+ "checksum": "99b18f4863a67a290097bc675cef0689",
+ "size": 3648,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-mix_map_and_read_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-path_and_record]": [
+ {
+ "checksum": "ecbb86b06da080c9db60a73987a7691d",
+ "size": 3330,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-path_and_record_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_fields]": [
+ {
+ "checksum": "70b5cba53c0a5341de1892e7081847b2",
+ "size": 2653,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_incompatible]": [
+ {
+ "checksum": "5427e75981b53ec474d91c72faaaa187",
+ "size": 7157,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_incompatible_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_multiin]": [
+ {
+ "checksum": "f9970908e8b316f1ba5fc31b80aa8056",
+ "size": 2644,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_multiin_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_multiple]": [
+ {
+ "checksum": "f267981a2089ca1bdd230449ee36e0ab",
+ "size": 3916,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_multiple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_null]": [
+ {
+ "checksum": "39a1ba4cbdc4adedca85e1731f4daf95",
+ "size": 2246,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-union_all_null_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_subexpr]": [
+ {
+ "checksum": "a011f1906dab578308105faa010932f2",
+ "size": 3008,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_subexpr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_trivial]": [
+ {
+ "checksum": "b52c78658e267fd39e53d769986bcc50",
+ "size": 1729,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-union_all_trivial_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_with_discard_into_result_ansi]": [
+ {
+ "checksum": "f16a0ce96a3731d0b00a1e9eeb4019a3",
+ "size": 3253,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-union_all_with_discard_into_result_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_with_limits]": [
+ {
+ "checksum": "87a55c320157b28e2293d17540a35dbb",
+ "size": 2143,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-union_all_with_limits_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_with_parenthesis]": [
+ {
+ "checksum": "b52c78658e267fd39e53d769986bcc50",
+ "size": 1729,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_union_all-union_all_with_parenthesis_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[union_all-union_all_with_top_level_limits_ansi]": [
+ {
+ "checksum": "d45172932beb2e7d3e67d0f90c885846",
+ "size": 8367,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_union_all-union_all_with_top_level_limits_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[version-version]": [
+ {
+ "checksum": "9764eba20728ca762f63f2d74a26d55f",
+ "size": 1016,
+ "uri": "https://{canondata_backend}/1937001/d7b13cc6719a33439797b775af740565a6f82a84/resource.tar.gz#test_sql2yql.test_version-version_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-all_from_view]": [
+ {
+ "checksum": "4850acd4db664d46e5b2e30d700823e0",
+ "size": 1149,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-all_from_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_eval]": [
+ {
+ "checksum": "6ea89f43bef8fdec2a25b406c8ea42a5",
+ "size": 1509,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_inner]": [
+ {
+ "checksum": "cdfd724995b5ecc0f9fcdf713bd3c75a",
+ "size": 1510,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_inner_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_inner_library]": [
+ {
+ "checksum": "676122b3bea3ca6802f9b686a7d66c81",
+ "size": 1518,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_inner_library_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_inner_udf]": [
+ {
+ "checksum": "d67d778f803ae5a656d82678741aef8c",
+ "size": 2390,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_inner_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_outer]": [
+ {
+ "checksum": "e272d7cd9f0697e3271ff60d1e3d3054",
+ "size": 1510,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_outer_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-file_outer_library]": [
+ {
+ "checksum": "0060f8f03de8449ab8d16adff15e2cc8",
+ "size": 1540,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-file_outer_library_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-init_view_after_eval]": [
+ {
+ "checksum": "43965082305e502575a81481a6e47111",
+ "size": 2492,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-init_view_after_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-secure]": [
+ {
+ "checksum": "e8ed3117de9a85b3a66c4390342ba8c2",
+ "size": 1506,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-secure_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-secure_eval]": [
+ {
+ "checksum": "13cadfb13c28bd90a3de089193ff58af",
+ "size": 1511,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-secure_eval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-secure_eval_dyn]": [
+ {
+ "checksum": "64337835d82391ab0b72c118553df575",
+ "size": 1519,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-secure_eval_dyn_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-standalone_view_lambda]": [
+ {
+ "checksum": "5f9e90e3741bb8a38e342fe5dafb8d6b",
+ "size": 1488,
+ "uri": "https://{canondata_backend}/1936273/2771a82a0b871cea06640e9dcc02afc4b5a7a23c/resource.tar.gz#test_sql2yql.test_view-standalone_view_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-system_udf]": [
+ {
+ "checksum": "d096e67c7cc14aa287626d29c89385e4",
+ "size": 1510,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-system_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-trivial_view]": [
+ {
+ "checksum": "1e61e07fd4b571a0d1678a88aad67267",
+ "size": 1412,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-trivial_view_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-trivial_view_concat]": [
+ {
+ "checksum": "4cc6880d5d819642878354d21501f714",
+ "size": 1471,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-trivial_view_concat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-view_with_lambda]": [
+ {
+ "checksum": "b827df02d892dc46c772db001731af59",
+ "size": 1152,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-view_with_lambda_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-view_with_lambda_process]": [
+ {
+ "checksum": "10714ce9cf5632259252b7d0852c5ac6",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-view_with_lambda_process_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[view-view_with_library]": [
+ {
+ "checksum": "006b54da6933dea9a3cead073ba7c080",
+ "size": 1153,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_view-view_with_library_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-few_source_different_columns]": [
+ {
+ "checksum": "d2684268c1293d55d8ef6ab02e49d736",
+ "size": 1637,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-few_source_different_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-hor_join_with_mix_weak_access]": [
+ {
+ "checksum": "f1297b9d29cff4ab1572fe7af0db77ca",
+ "size": 2078,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-hor_join_with_mix_weak_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-optimize_weak_fields_combine]": [
+ {
+ "checksum": "7328b3b4f70bdd964b450dda97825e21",
+ "size": 1893,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_weak_field-optimize_weak_fields_combine_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-optimize_weak_fields_filter_combine]": [
+ {
+ "checksum": "ebaeaee2b3ff55da1684bc2808a429f8",
+ "size": 2172,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_weak_field-optimize_weak_fields_filter_combine_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-optimize_weak_fields_map]": [
+ {
+ "checksum": "d22e2699251133ebaaec6dba400b589d",
+ "size": 1528,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-optimize_weak_fields_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-optimize_weak_fields_map_combine]": [
+ {
+ "checksum": "6947cb8988215b4fcff3fb2c714f7ded",
+ "size": 2040,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_weak_field-optimize_weak_fields_map_combine_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field]": [
+ {
+ "checksum": "8de74cb65e381e493aa40140b4f3c86e",
+ "size": 4062,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_aggregation]": [
+ {
+ "checksum": "f9c750f23e7f50929ee7cdc83045b47d",
+ "size": 1821,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_aggregation_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_data]": [
+ {
+ "checksum": "efd48c5a75a3192ccbc3ddafa225d7f7",
+ "size": 1518,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_data_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_esc_string]": [
+ {
+ "checksum": "ecee6a7029ea439ebafa0f6ed96c19f2",
+ "size": 1350,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_esc_string_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_esc_yson]": [
+ {
+ "checksum": "854da643cb58356a5b5f4f912d9216a0",
+ "size": 1590,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_esc_yson_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_in_group_by]": [
+ {
+ "checksum": "5d6a99f4c9dca0687ccf19782f5ce669",
+ "size": 1627,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_in_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_infer_scheme]": [
+ {
+ "checksum": "282e8c26055e8eb0720325ac69f29770",
+ "size": 1517,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_infer_scheme_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_join]": [
+ {
+ "checksum": "3b095908ff376e5f25bba03287bbd5b6",
+ "size": 2208,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_join_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_join_condition]": [
+ {
+ "checksum": "37f7549c306c18a0322d0e9d56c8cf1d",
+ "size": 2755,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_join_condition_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_join_where]": [
+ {
+ "checksum": "575d6df1cb131437499f6e3599724bc2",
+ "size": 2957,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_join_where_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_long_fields]": [
+ {
+ "checksum": "a512230579fda53f3cd58567a70ee630",
+ "size": 1306,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_long_fields_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_long_name]": [
+ {
+ "checksum": "49ee8a60372d9e2a77457e340745e812",
+ "size": 1192,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_long_name_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_num_access]": [
+ {
+ "checksum": "5ea74db5b949f301a44b20e695c7c51c",
+ "size": 1524,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_num_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_opt]": [
+ {
+ "checksum": "ec253b72e203c37f84a4f12ccbf4f8ee",
+ "size": 1529,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_real_col]": [
+ {
+ "checksum": "3855847b2bb691b1902c2c5e1520be0b",
+ "size": 1671,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_real_col_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_rest]": [
+ {
+ "checksum": "c531c3decd817ca24a2e249b9d9af88c",
+ "size": 2222,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_rest_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_strict]": [
+ {
+ "checksum": "2faaef93a4a89ca489601994ff6fb54c",
+ "size": 2069,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_strict_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_to_yson]": [
+ {
+ "checksum": "dbbc0152ea3aa2707d470211aa54c9a0",
+ "size": 1155,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_to_yson_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_type]": [
+ {
+ "checksum": "5ac0aedc53313dab0607ccc86d51913a",
+ "size": 1497,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_field_wrong_types_fail]": [
+ {
+ "checksum": "9bfb1bac7d154459b2c71de3f582a3c7",
+ "size": 1154,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_field_wrong_types_fail_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-weak_member_string_copy]": [
+ {
+ "checksum": "fca901328bbc09d56d61a2a0db231d47",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_weak_field-weak_member_string_copy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[weak_field-yql-7888_mapfieldsubset]": [
+ {
+ "checksum": "cfcbcbc62acef9930c86d964ec1b9c62",
+ "size": 8828,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_weak_field-yql-7888_mapfieldsubset_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-all_columns_hide_window_special_ones]": [
+ {
+ "checksum": "59d7416c468da9d8289bd7a61ae474f7",
+ "size": 2199,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-all_columns_hide_window_special_ones_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/aggregations]": [
+ {
+ "checksum": "7a9acee0335890593344645845b8e2b8",
+ "size": 3377,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-current_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/aggregations_leadlag]": [
+ {
+ "checksum": "c3ad56c2af016633a529e5f5fe255685",
+ "size": 2925,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-current_aggregations_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/ansi_current]": [
+ {
+ "checksum": "7bcb8b6daafbae408dd5959604e1b2f3",
+ "size": 2125,
+ "uri": "https://{canondata_backend}/1871002/e545ae390e08839888f54fdbe17287e1fb1c3edc/resource.tar.gz#test_sql2yql.test_window-current_ansi_current_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/ansi_current_mixed]": [
+ {
+ "checksum": "effe27926385ecacc954a2664d47e9b7",
+ "size": 3383,
+ "uri": "https://{canondata_backend}/1900335/5f1a27d57cadc5c8ba1f5cd895bce88738ce8a6b/resource.tar.gz#test_sql2yql.test_window-current_ansi_current_mixed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/ansi_current_with_win]": [
+ {
+ "checksum": "e8bbd0d53b4e8a376a0cc972be47dee0",
+ "size": 2407,
+ "uri": "https://{canondata_backend}/212715/a7c52d2a110272f238f0f7fff9cff3a6adacaf12/resource.tar.gz#test_sql2yql.test_window-current_ansi_current_with_win_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/session]": [
+ {
+ "checksum": "a21d0cae7ee779eb1fefc42cd4213b91",
+ "size": 2740,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-current_session_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/session_aliases]": [
+ {
+ "checksum": "adae4e1a95a1b37f8f66c6df8695df01",
+ "size": 3714,
+ "uri": "https://{canondata_backend}/1942525/c4679680a3f04e525af18da47282958892246bf4/resource.tar.gz#test_sql2yql.test_window-current_session_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/session_extended]": [
+ {
+ "checksum": "c0e0a04f51192343b601925e3572dd32",
+ "size": 4071,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-current_session_extended_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-current/session_incompat_sort]": [
+ {
+ "checksum": "55f580ad44aa39e35afb6d491c0c2fc0",
+ "size": 2936,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-current_session_incompat_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-distinct_over_window]": [
+ {
+ "checksum": "bc78842280bc14d3bcc74bc9b3b2321f",
+ "size": 5069,
+ "uri": "https://{canondata_backend}/1925821/d2a52277312a321513a2f4867da76b04a66d1c3f/resource.tar.gz#test_sql2yql.test_window-distinct_over_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-distinct_over_window_full_frames]": [
+ {
+ "checksum": "44c79e17b1f6f3bfbaa2f4cc665258f9",
+ "size": 5480,
+ "uri": "https://{canondata_backend}/1925821/d2a52277312a321513a2f4867da76b04a66d1c3f/resource.tar.gz#test_sql2yql.test_window-distinct_over_window_full_frames_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-distinct_over_window_struct]": [
+ {
+ "checksum": "7d1655b7d3bf896c96f8a6ec73a76316",
+ "size": 7089,
+ "uri": "https://{canondata_backend}/1773845/054e342996ea4fe2bd6c1e4db9054559a60f02a4/resource.tar.gz#test_sql2yql.test_window-distinct_over_window_struct_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-empty/aggregations]": [
+ {
+ "checksum": "ffb8e3caaa4aa4b4bc431646909726c9",
+ "size": 3375,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-empty_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-empty/aggregations_leadlag]": [
+ {
+ "checksum": "f5f27ebee67b746ba9698ab07fd36af6",
+ "size": 3021,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-empty_aggregations_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/aggregations]": [
+ {
+ "checksum": "05757dc4ed185367e3ff3a4ea8b21c9c",
+ "size": 3905,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/aggregations_compact]": [
+ {
+ "checksum": "bc8f875bd796befb2af79e655e70d845",
+ "size": 3929,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_aggregations_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/aggregations_leadlag]": [
+ {
+ "checksum": "70b8be49814581b9a9640a70e3a6ff29",
+ "size": 3550,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_aggregations_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/aggregations_leadlag_compact]": [
+ {
+ "checksum": "06b49ac25c40dea8fcb908b910a56776",
+ "size": 3574,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_aggregations_leadlag_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/leadlag]": [
+ {
+ "checksum": "e4c164b8dbee0691d5befa6159633ef1",
+ "size": 4400,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/leadlag_compact]": [
+ {
+ "checksum": "4d74933707a78b369176f8046cd33fc9",
+ "size": 4424,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_leadlag_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/noncompact_with_nulls]": [
+ {
+ "checksum": "ae9bdb7bc804506df5320932402dd9a5",
+ "size": 4085,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_noncompact_with_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/noncompact_with_nulls_tuple_key]": [
+ {
+ "checksum": "447b38a157e87ae4d28c25297afef121",
+ "size": 4208,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_noncompact_with_nulls_tuple_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/noncompact_with_tablerow]": [
+ {
+ "checksum": "dba63f907ad213cf693a330b83776321",
+ "size": 1977,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_noncompact_with_tablerow_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/session]": [
+ {
+ "checksum": "1aef8403788618e8a4b8a3dfebf603cd",
+ "size": 3694,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_session_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/session_aliases]": [
+ {
+ "checksum": "ebcb6a87c035ce050e513ec9f5cea9c7",
+ "size": 3547,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_session_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/session_aliases_compact]": [
+ {
+ "checksum": "1f79af16bae239073a8f5df61dbf6ea1",
+ "size": 3571,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_session_aliases_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/session_compact]": [
+ {
+ "checksum": "f950e1568b5b1e3adac1062ebce1f6d4",
+ "size": 2748,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_session_compact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/session_incompat_sort]": [
+ {
+ "checksum": "2f727c068393ce6351fb06512953becc",
+ "size": 3695,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-full_session_incompat_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-full/syscolumns]": [
+ {
+ "checksum": "9d2fe08d1b2c2e154ef449358a4d37d9",
+ "size": 3678,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_window-full_syscolumns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/aggregations_after_current]": [
+ {
+ "checksum": "7453a17a2b73f3dbc8c85ee7cba05c12",
+ "size": 4023,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_aggregations_after_current_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/aggregations_before_current]": [
+ {
+ "checksum": "cc96518b6557501c53e8cbb71ce872c1",
+ "size": 4027,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_aggregations_before_current_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/aggregations_include_current]": [
+ {
+ "checksum": "63888a9610ae5e7e6fc055d236db3f6a",
+ "size": 4024,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_aggregations_include_current_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/aggregations_mixed]": [
+ {
+ "checksum": "33fc344dc419081e041c62d9cdd35c8f",
+ "size": 4025,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_aggregations_mixed_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/aggregations_mixed_leadlag]": [
+ {
+ "checksum": "c12a787c4a1b10db6e2b89de1488bc80",
+ "size": 3573,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_aggregations_mixed_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/session]": [
+ {
+ "checksum": "1842100a87abab260a1169e2ec95cd78",
+ "size": 2745,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_session_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-generic/session_aliases]": [
+ {
+ "checksum": "d3a2c4603c504d95df706b7b7735834a",
+ "size": 3671,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-generic_session_aliases_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-lagging/aggregations]": [
+ {
+ "checksum": "1984cb5370ba104e6884092673bc5134",
+ "size": 4017,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-lagging_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-lagging/aggregations_leadlag]": [
+ {
+ "checksum": "d435fa54ae80cd454c6ed1437bdb4261",
+ "size": 3565,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-lagging_aggregations_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-leading/aggregations]": [
+ {
+ "checksum": "e1242ae5ade33516dc5db20d9429965d",
+ "size": 4015,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-leading_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-leading/aggregations_leadlag]": [
+ {
+ "checksum": "72b80298051d8fbbbb1d6b0c3b81c389",
+ "size": 3563,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-leading_aggregations_leadlag_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-mixed/aggregations]": [
+ {
+ "checksum": "61d4817236c1546167198dfb90cb5c3f",
+ "size": 3611,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-mixed_aggregations_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-null_type]": [
+ {
+ "checksum": "eec2023cc7411235f5857a4c56cad899",
+ "size": 7078,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-null_type_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-presort_window_order_by_table]": [
+ {
+ "checksum": "290052d3b7ef9ed21497429aee33d60f",
+ "size": 2949,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-presort_window_order_by_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-presort_window_partition_by_mem]": [
+ {
+ "checksum": "dda804af1fa86e892d60ead2706dcf75",
+ "size": 2029,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-presort_window_partition_by_mem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-presort_window_partition_by_table]": [
+ {
+ "checksum": "5094fc28251450e23f69148b090fe395",
+ "size": 2219,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_window-presort_window_partition_by_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-rank/nulls]": [
+ {
+ "checksum": "d0a463206f2af6669788a9acf9608fa0",
+ "size": 1957,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_window-rank_nulls_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-rank/nulls_legacy]": [
+ {
+ "checksum": "073a8f9f101017135e14b06551cd33ac",
+ "size": 1941,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_window-rank_nulls_legacy_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-rank/opt]": [
+ {
+ "checksum": "21b5660caa3841c86f463f93fce4e451",
+ "size": 5134,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-rank_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-rank/plain]": [
+ {
+ "checksum": "eaa07d295849a38ed2c7d4e11c5f3706",
+ "size": 4829,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-rank_plain_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-rank/unordered]": [
+ {
+ "checksum": "1b8d36e649743cf7c45656a8966c6d31",
+ "size": 2832,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-rank_unordered_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-row_number_no_part_from_subq]": [
+ {
+ "checksum": "752ad9d46572296c471a69e67cab67aa",
+ "size": 2056,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-row_number_no_part_from_subq_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-row_number_no_part_multi_input]": [
+ {
+ "checksum": "83f99e378739786d6e8c034d9584fa87",
+ "size": 5798,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-row_number_no_part_multi_input_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-row_number_to_map]": [
+ {
+ "checksum": "dfc70ce0e444e23d301db87fd4ae7e70",
+ "size": 3230,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-row_number_to_map_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-row_number_to_map_multiple]": [
+ {
+ "checksum": "ad878be5bb16bdae6e31e9678fdb0bc5",
+ "size": 2513,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-row_number_to_map_multiple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-row_number_to_map_noncompact]": [
+ {
+ "checksum": "8ac63b5717f3748de76600f7910cd212",
+ "size": 1581,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-row_number_to_map_noncompact_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-udaf_no_merge]": [
+ {
+ "checksum": "4866c663febca80b9109bd8f628e3c2c",
+ "size": 2291,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-udaf_no_merge_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-udaf_window]": [
+ {
+ "checksum": "3b5ecbf9a35b5208635dc01be96c2947",
+ "size": 6449,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-udaf_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-udaf_with_def_value]": [
+ {
+ "checksum": "ceb69ec59ae2312fb4323ab3c5f17604",
+ "size": 15889,
+ "uri": "https://{canondata_backend}/1936997/c4b2710fbedc1001e1f494f1eaf6939b726b752c/resource.tar.gz#test_sql2yql.test_window-udaf_with_def_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_by_all_aggregate]": [
+ {
+ "checksum": "28f2eb4aa2067ca69292093224dd8f5e",
+ "size": 9926,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_by_all_aggregate_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_by_all_avg_interval]": [
+ {
+ "checksum": "cbdb3386b2087dddbee1afe05c4d304e",
+ "size": 3286,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_by_all_avg_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_by_all_percentile_interval]": [
+ {
+ "checksum": "05c99b91aebbfc7a493e2847fa9b69ae",
+ "size": 4820,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_by_all_percentile_interval_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_by_simple]": [
+ {
+ "checksum": "5614eb100110acb1fc4c313647263be1",
+ "size": 2013,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_by_simple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_expr_bounds]": [
+ {
+ "checksum": "a65754ae082e93a101ac4dd14a6b5d0f",
+ "size": 2001,
+ "uri": "https://{canondata_backend}/1942671/0e54a060131c0bb532b35f8c9a676dbe69bd7cf3/resource.tar.gz#test_sql2yql.test_window-win_expr_bounds_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_extract_members]": [
+ {
+ "checksum": "119456d3a3c34c0551d04f22f400d2db",
+ "size": 5498,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_extract_members_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_4func]": [
+ {
+ "checksum": "d14f3520fc1bf108a5f42c6afea4761b",
+ "size": 2594,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_4func_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_4func_no_part]": [
+ {
+ "checksum": "e22210f13fd26367072cac70e9f74e56",
+ "size": 2370,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_4func_no_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_4func_no_part_sorted]": [
+ {
+ "checksum": "18134d78567eaf8cb348064645d2006b",
+ "size": 2369,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_4func_no_part_sorted_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_4func_sort]": [
+ {
+ "checksum": "8a766bb9adf35bd7908f5be3a85f35df",
+ "size": 2556,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_4func_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_4func_sort_desc]": [
+ {
+ "checksum": "0192d259c6ccede1aeb1e8d0c23175f1",
+ "size": 2557,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_4func_sort_desc_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_hist]": [
+ {
+ "checksum": "1b0140c6a0d2e152aea7a2aed286e7ce",
+ "size": 2644,
+ "uri": "https://{canondata_backend}/1871002/c96e3417fb8f66b5eacd54fbef02ab1dc8224eef/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_hist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_stat]": [
+ {
+ "checksum": "42a77497911b435607d85a6e903e4129",
+ "size": 2529,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_stat_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_with_qualified_all]": [
+ {
+ "checksum": "a775bd2c7cf2688445272f14cfe627bb",
+ "size": 2979,
+ "uri": "https://{canondata_backend}/1937027/973c239492ba32946806ddc66cf0af4b38c06ae8/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_with_qualified_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_aggr_with_qualified_all_no_simple_columns]": [
+ {
+ "checksum": "8495a8a40e90cbdd990cf80aaf8101eb",
+ "size": 3095,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_window-win_func_aggr_with_qualified_all_no_simple_columns_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_auto_arg]": [
+ {
+ "checksum": "f24b752b70d868621a34d9d2b104023d",
+ "size": 2824,
+ "uri": "https://{canondata_backend}/937458/51977965943d9d1384301efde5ca7bcf0587d1f3/resource.tar.gz#test_sql2yql.test_window-win_func_auto_arg_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_auto_arg_selective_rank]": [
+ {
+ "checksum": "e96cbc355fd2553b470d7ed28a6a7130",
+ "size": 2882,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_auto_arg_selective_rank_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_auto_arg_two_sort]": [
+ {
+ "checksum": "0fbc25a9258642b3e07cd9516bb7a2b7",
+ "size": 2767,
+ "uri": "https://{canondata_backend}/1600758/deef50cb75de37e031f94336485e9272fdd5a9af/resource.tar.gz#test_sql2yql.test_window-win_func_auto_arg_two_sort_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_cume_dist]": [
+ {
+ "checksum": "0deb2e3218f3e63a34e1cdfd0401546c",
+ "size": 2337,
+ "uri": "https://{canondata_backend}/1889210/3b80794dcf61416ec7f21fc15203e31fda3473f3/resource.tar.gz#test_sql2yql.test_window-win_func_cume_dist_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_cume_dist_ansi]": [
+ {
+ "checksum": "126bf5ff29c5734f2c4e8c317fc73fd4",
+ "size": 1429,
+ "uri": "https://{canondata_backend}/1889210/3b80794dcf61416ec7f21fc15203e31fda3473f3/resource.tar.gz#test_sql2yql.test_window-win_func_cume_dist_ansi_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_first_last]": [
+ {
+ "checksum": "2876d5cba15d8dd9e4249d6a6ed1c562",
+ "size": 2959,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_first_last_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_first_last_over_nonopt]": [
+ {
+ "checksum": "631a4997892a0b1a030deb8fe7173d4b",
+ "size": 4074,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_window-win_func_first_last_over_nonopt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_first_last_rev]": [
+ {
+ "checksum": "74f940904057c5f7b6d235494ed0d4ef",
+ "size": 2958,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_first_last_rev_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_first_last_with_part]": [
+ {
+ "checksum": "03bf88aabf51d57b343c6c3c680eabab",
+ "size": 4379,
+ "uri": "https://{canondata_backend}/1937367/2ff1f203c4787432c1176f49937b54e54180c90f/resource.tar.gz#test_sql2yql.test_window-win_func_first_last_with_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_in_lib]": [
+ {
+ "checksum": "9dcc105eff821d6a6af93b2b3bffbf21",
+ "size": 1092,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_in_lib_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_into_udf]": [
+ {
+ "checksum": "2f7f3b03491cbf792ad1ec9f4b8eda9a",
+ "size": 1691,
+ "uri": "https://{canondata_backend}/1946324/c9685d310cc9bd7b882e0788db030309ff516c02/resource.tar.gz#test_sql2yql.test_window-win_func_into_udf_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_lead_lag_opt]": [
+ {
+ "checksum": "f2849e949f2fa4d3c25a81350e5f123a",
+ "size": 5627,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_lead_lag_opt_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_lead_lag_worm]": [
+ {
+ "checksum": "e2b4d1fa54e662063e229747f8567307",
+ "size": 4431,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_func_lead_lag_worm_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_lead_lag_worm_with_part]": [
+ {
+ "checksum": "691c72d40a69ba0db09ace460d2365f4",
+ "size": 4865,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_lead_lag_worm_with_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_lead_lag_worm_with_part_other]": [
+ {
+ "checksum": "12d5ae7b6f8ae09d51294b2d412a6766",
+ "size": 4854,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_lead_lag_worm_with_part_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_mutable_resource]": [
+ {
+ "checksum": "5e7b2e509d9aacb61b30046dffdc308e",
+ "size": 3038,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_mutable_resource_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_nth_value]": [
+ {
+ "checksum": "3a5e4b674976ea289495d9d1470f8d5e",
+ "size": 4014,
+ "uri": "https://{canondata_backend}/1937367/f9c5e2ce003fa874f20946cc39a5807e02d6b085/resource.tar.gz#test_sql2yql.test_window-win_func_nth_value_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_ntile]": [
+ {
+ "checksum": "7d9e8bb02850d9a7c833114f249cacad",
+ "size": 2337,
+ "uri": "https://{canondata_backend}/1924537/1e6c4bd0b6a388eb0c3be13c5222f8b798f7e45c/resource.tar.gz#test_sql2yql.test_window-win_func_ntile_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_on_cloned_source]": [
+ {
+ "checksum": "d64b85d66b7adaa9f59d01653861c470",
+ "size": 2587,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_on_cloned_source_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_order_by_udf_empty_rank]": [
+ {
+ "checksum": "f95e61e1b5bd7f17d393516d6dd83040",
+ "size": 2126,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_func_order_by_udf_empty_rank_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_over_group_by]": [
+ {
+ "checksum": "f2d212f141c20a3c6ddb8156ae04b55c",
+ "size": 3536,
+ "uri": "https://{canondata_backend}/1936997/d01e529b02a008637591c42bdd9c20f7eeda6588/resource.tar.gz#test_sql2yql.test_window-win_func_over_group_by_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_over_group_by_compl]": [
+ {
+ "checksum": "72b5179e0ce1736b28371b02c8fad6cf",
+ "size": 4781,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_window-win_func_over_group_by_compl_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_over_group_by_list_names]": [
+ {
+ "checksum": "a1dfb40a21c6daa7619558f5788b485b",
+ "size": 5452,
+ "uri": "https://{canondata_backend}/1942100/a880b9dd7347f1ff0cee0d2e5d7cf8ac9ebf5d2e/resource.tar.gz#test_sql2yql.test_window-win_func_over_group_by_list_names_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_over_group_by_list_names_order_prefix]": [
+ {
+ "checksum": "c21166526be650b3d8ff8cefe60ce08b",
+ "size": 5295,
+ "uri": "https://{canondata_backend}/1936997/00f46808be87e2ae2d4ac3ac45675b659c5ace45/resource.tar.gz#test_sql2yql.test_window-win_func_over_group_by_list_names_order_prefix_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_part_by_expr]": [
+ {
+ "checksum": "cf8ee349a728aae81ef5a246d0af4da2",
+ "size": 3114,
+ "uri": "https://{canondata_backend}/1937492/1c0e0692453d29c7678c079c240ac0f6151a6821/resource.tar.gz#test_sql2yql.test_window-win_func_part_by_expr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_part_by_expr_new]": [
+ {
+ "checksum": "f097fc545b37645b26e809c6bf9133d6",
+ "size": 2223,
+ "uri": "https://{canondata_backend}/1600758/d2be12e3cc8a37157a962bd9b58c2874635d2195/resource.tar.gz#test_sql2yql.test_window-win_func_part_by_expr_new_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_percent_rank]": [
+ {
+ "checksum": "cb092ec46c8034ee21ebdd8388bc6d21",
+ "size": 2658,
+ "uri": "https://{canondata_backend}/1924537/1e6c4bd0b6a388eb0c3be13c5222f8b798f7e45c/resource.tar.gz#test_sql2yql.test_window-win_func_percent_rank_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_rank_by_all]": [
+ {
+ "checksum": "bdd6fb5d15f54c67f6960402c1099d86",
+ "size": 2727,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_rank_by_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_rank_by_opt_all]": [
+ {
+ "checksum": "5b13990830672dc4fdd57c3ee45ff66f",
+ "size": 2703,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_rank_by_opt_all_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_rank_by_opt_part]": [
+ {
+ "checksum": "bd414b370293e00d6873af1b67bf977f",
+ "size": 3255,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_rank_by_opt_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_rank_by_part]": [
+ {
+ "checksum": "36a778b6523f9d0907357825bfeb1053",
+ "size": 3279,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_rank_by_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_rank_with_order_by_aggr_key]": [
+ {
+ "checksum": "75281cc34e011f9b4f87cba60c659cef",
+ "size": 1685,
+ "uri": "https://{canondata_backend}/1773845/cd3d52c296919794a6890ae7e223f6edbe2dd598/resource.tar.gz#test_sql2yql.test_window-win_func_rank_with_order_by_aggr_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_spec_with_part]": [
+ {
+ "checksum": "57d58757ad37ade004840950c81d534c",
+ "size": 3739,
+ "uri": "https://{canondata_backend}/1784826/7c8f5dac18511988e5aea89e0a58f14f7ec54c9b/resource.tar.gz#test_sql2yql.test_window-win_func_spec_with_part_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_special]": [
+ {
+ "checksum": "70ff0748de551094c54f3b8518912e32",
+ "size": 3235,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_func_special_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_with_struct_access]": [
+ {
+ "checksum": "4626d84d128bfed2e789f394b0ced858",
+ "size": 3141,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_with_struct_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_func_with_struct_access_full_access]": [
+ {
+ "checksum": "4626d84d128bfed2e789f394b0ced858",
+ "size": 3141,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_func_with_struct_access_full_access_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_fuse_window]": [
+ {
+ "checksum": "0b8999cb6b1efb6e3535263a45ff2191",
+ "size": 6237,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_fuse_window_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_group_peephole]": [
+ {
+ "checksum": "178d99992e32379ee1314d3d0c324a5f",
+ "size": 3491,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_group_peephole_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_inline_spec]": [
+ {
+ "checksum": "bb90ec92a1da1430faa2abd8f5190296",
+ "size": 2750,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_inline_spec_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_lead_in_mem]": [
+ {
+ "checksum": "5b5af2a9c1eaeb7a2e6816d2f89746a2",
+ "size": 2897,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_lead_in_mem_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_multiaggr]": [
+ {
+ "checksum": "35492eb9f2232478e06d7f3b4a64e724",
+ "size": 2327,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_multiaggr_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_multiaggr_library]": [
+ {
+ "checksum": "90bea776e5b2a7105f94013a03b90ce1",
+ "size": 1218,
+ "uri": "https://{canondata_backend}/1937367/ea4c381bd6a2153adf39555ac16997879b9a456d/resource.tar.gz#test_sql2yql.test_window-win_multiaggr_library_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_multiaggr_list]": [
+ {
+ "checksum": "d60cd1197056d41dca534c7f51646186",
+ "size": 2287,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_multiaggr_list_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_multiaggr_tuple]": [
+ {
+ "checksum": "0dedeafefd56f7580e017dd772ab97d7",
+ "size": 2261,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_multiaggr_tuple_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_over_few_partitions]": [
+ {
+ "checksum": "76d4ea4c26213389cdc7ce612dd2904c",
+ "size": 3754,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_over_few_partitions_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_over_few_partitions_other]": [
+ {
+ "checksum": "c8f52382cbd1b1ed708d1838ae7b947f",
+ "size": 4265,
+ "uri": "https://{canondata_backend}/1871182/6b10ad6d9884e5faf3a77187ffb9b38b59b46458/resource.tar.gz#test_sql2yql.test_window-win_over_few_partitions_other_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_over_joined]": [
+ {
+ "checksum": "f64ba0ad6ba17776e6e0d43b40c8cdfd",
+ "size": 2375,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_over_joined_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_peephole]": [
+ {
+ "checksum": "ebc3750b351bb755c3001f8db7b0e293",
+ "size": 3201,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_peephole_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_peephole_double_usage]": [
+ {
+ "checksum": "d66ae2650869b72e82c75e1f911336f7",
+ "size": 3138,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-win_peephole_double_usage_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_with_as_table]": [
+ {
+ "checksum": "421a70d6e9d9c726f88d2317a48bcc0e",
+ "size": 2181,
+ "uri": "https://{canondata_backend}/1937429/97e9191a53fa2a5b113b17c95cdaa504b276e384/resource.tar.gz#test_sql2yql.test_window-win_with_as_table_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-win_with_cur_row]": [
+ {
+ "checksum": "dd3257683e605205a9089b477db2d02c",
+ "size": 2757,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-win_with_cur_row_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-14179]": [
+ {
+ "checksum": "ae6d1d2bda8b984773a4397355460a8b",
+ "size": 1561,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_window-yql-14179_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-14277]": [
+ {
+ "checksum": "b888e54717f5827726b53f9a422d4062",
+ "size": 2964,
+ "uri": "https://{canondata_backend}/1924537/1ab444909086b08bd4fe21c5a43f5e183c647e0a/resource.tar.gz#test_sql2yql.test_window-yql-14277_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-14479]": [
+ {
+ "checksum": "d4aa9544e444de50ae38956790a0f571",
+ "size": 2071,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-yql-14479_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-14738]": [
+ {
+ "checksum": "c5e2e5e96f2a3b198d936a983723833c",
+ "size": 3150,
+ "uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_window-yql-14738_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-15636]": [
+ {
+ "checksum": "eb416b246b5638d68f3d4d48f29d0467",
+ "size": 4139,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_window-yql-15636_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[window-yql-18879]": [
+ {
+ "checksum": "acd0d2f0152d3728ef363717eb7ed654",
+ "size": 8530,
+ "uri": "https://{canondata_backend}/1942415/d0aa280e24836862b642f2bd8ee614bf63cf9088/resource.tar.gz#test_sql2yql.test_window-yql-18879_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-complex]": [
+ {
+ "checksum": "d11b6069940af0d1e033fbbf4997c040",
+ "size": 1177,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-complex_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-direct_read_from_dynamic]": [
+ {
+ "checksum": "403748fd24229939c530b8e24e2de7d5",
+ "size": 1149,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-direct_read_from_dynamic_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-empty_range]": [
+ {
+ "checksum": "1eac8826abb3c2024510bafc19e70356",
+ "size": 1137,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-empty_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-limit_with_key]": [
+ {
+ "checksum": "945849a10f3cbcb8146698fcbcccd544",
+ "size": 1219,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-limit_with_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-limit_with_range]": [
+ {
+ "checksum": "93a661399f4b9d7465b372ac640465f7",
+ "size": 1217,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-limit_with_range_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-multi_key]": [
+ {
+ "checksum": "32e605b8c4a6afb30aeece6e5c127442",
+ "size": 1165,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-multi_key_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[ypath-multi_range]": [
+ {
+ "checksum": "1a620e83d86a748df6ce32cad8c679df",
+ "size": 1137,
+ "uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_ypath-multi_range_/sql.yql"
+ }
+ ],
+ "test_sql_format.test[action-action_eval_cluster_and_table]": [
+ {
+ "checksum": "d49368d64f58b5775eeabc9078962201",
+ "size": 140,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_eval_cluster_and_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_eval_cluster_table]": [
+ {
+ "checksum": "cd94ed3a822b707a242af40b4bfab653",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_eval_cluster_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_eval_cluster_table_for]": [
+ {
+ "checksum": "ea3df42b19c159c7eae41f9786f2ac73",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_eval_cluster_table_for_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_eval_cluster_use]": [
+ {
+ "checksum": "1f297a4a4cc9857f32a7dafcb43f8ab1",
+ "size": 190,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_eval_cluster_use_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_eval_cluster_use_compact_named_exprs]": [
+ {
+ "checksum": "7196432be485664f5805d070e041f121",
+ "size": 417,
+ "uri": "https://{canondata_backend}/937458/377e39eb6941e00a686233afcdf53a4d2fa21bc2/resource.tar.gz#test_sql_format.test_action-action_eval_cluster_use_compact_named_exprs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_nested_query]": [
+ {
+ "checksum": "d4b969fa47e3959966e06f9dd80bcdfc",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_nested_query_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_opt_args]": [
+ {
+ "checksum": "1502919e15448a10fa3ec0ab2cb05730",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_opt_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-action_udf_args]": [
+ {
+ "checksum": "2a16e5a9e83237958389ecf1eb9040da",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-action_udf_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-closure_action]": [
+ {
+ "checksum": "e6c7f4994ba4957f283c1936bf46b1cd",
+ "size": 276,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-closure_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-combine_subqueries_with_table_param]": [
+ {
+ "checksum": "3d0836ff1febb5c738bd7d2ace55700c",
+ "size": 650,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-combine_subqueries_with_table_param_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-define_simple_action]": [
+ {
+ "checksum": "f590e28d75082329c0d9d16a10ee7d19",
+ "size": 198,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-define_simple_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-dep_world_action_quote]": [
+ {
+ "checksum": "68d370c28b7a17851d4babbb6f1b96f5",
+ "size": 455,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-dep_world_action_quote_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-dep_world_quote_code]": [
+ {
+ "checksum": "ef2811d1d96608def872cadfcb35b0ad",
+ "size": 849,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-dep_world_quote_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-discard]": [
+ {
+ "checksum": "7b26fd2d158fd0a74f5b9fb58ce6db45",
+ "size": 859,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-discard_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-empty_do]": [
+ {
+ "checksum": "c68e818ac46a645305c70e7bb1e86f81",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1936273/5f13705d05daed6dac198f26f850ed331e7332e4/resource.tar.gz#test_sql_format.test_action-empty_do_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_anon_table]": [
+ {
+ "checksum": "d1526883c7979e2a7dfe07f0cfa28036",
+ "size": 234,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_anon_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_asatom]": [
+ {
+ "checksum": "e59b3d94439d2f25d17a72a26aae9f2e",
+ "size": 124,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_asatom_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_astagged]": [
+ {
+ "checksum": "eb0f1c14a250cefa1296bf49bd0b1e15",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_astagged_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_atom_wrong_type_expr]": [
+ {
+ "checksum": "5561ce9a193250739d88cdcdf7a6c919",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1923547/2c6b73e812b6d7bc36fe15c35684a8f836c610fe/resource.tar.gz#test_sql_format.test_action-eval_atom_wrong_type_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_atom_wrong_type_param]": [
+ {
+ "checksum": "6bb9503b769369384ef6660c8f217a9a",
+ "size": 80,
+ "uri": "https://{canondata_backend}/1923547/2c6b73e812b6d7bc36fe15c35684a8f836c610fe/resource.tar.gz#test_sql_format.test_action-eval_atom_wrong_type_param_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_capture]": [
+ {
+ "checksum": "d829a517e01fba7a2f4a3ab0ca85d9c4",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_capture_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_code]": [
+ {
+ "checksum": "8c32a9afaeeaf90502b96aaa360ad7a7",
+ "size": 872,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_code_nested]": [
+ {
+ "checksum": "e59904089943e9cf998ed88eaf5b8661",
+ "size": 637,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_code_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_column]": [
+ {
+ "checksum": "4958c8c33acca54ba24495ab6d7dab0f",
+ "size": 1110,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_drop]": [
+ {
+ "checksum": "d1cd2afe4d73d8e15f43b4a07d506e5f",
+ "size": 137,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_drop_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_each_input_table]": [
+ {
+ "checksum": "5d42cf92a9fa4d3c96a7aa085c2a2054",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_each_input_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_ensuretype]": [
+ {
+ "checksum": "c5522fb8188d60ba070ca37a136fe759",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_ensuretype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_extract]": [
+ {
+ "checksum": "ef459dbaa18431c7d0a68bd389bb44b8",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_extract_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_filter]": [
+ {
+ "checksum": "26722137353c91ed631a381a27b1b922",
+ "size": 216,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_folder]": [
+ {
+ "checksum": "959052acd930b86d3a8444d347805e2d",
+ "size": 98,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_folder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_folder_via_file]": [
+ {
+ "checksum": "e3e177fc8ad5fa089b1bf4c8c55dbd4a",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_folder_via_file_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_folder_via_file_in_job]": [
+ {
+ "checksum": "4dcf76e3a0b6a7243541bd9cd4acfdf9",
+ "size": 430,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_folder_via_file_in_job_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_for]": [
+ {
+ "checksum": "c034f4a43387a77b483b7f9ff2b4087c",
+ "size": 663,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_for_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_for_over_subquery]": [
+ {
+ "checksum": "14c31a3946da63592d4961483cde3ed4",
+ "size": 231,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_for_over_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_if]": [
+ {
+ "checksum": "4fd50d061d3e00ff4ef83f953b45eddf",
+ "size": 383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_if_guard]": [
+ {
+ "checksum": "88ccb86b3b183c6f63d7b47fd81cf52d",
+ "size": 239,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_if_guard_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_input_output_table]": [
+ {
+ "checksum": "1f9dc06531a38f399c01e352b56e8cf8",
+ "size": 299,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_input_output_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_input_output_table_subquery]": [
+ {
+ "checksum": "560c7d0a38cd96ef4d2270587acc4523",
+ "size": 447,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_input_output_table_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_like]": [
+ {
+ "checksum": "9f3cc96c056b6eeb3185ebd32174a0fb",
+ "size": 231,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_like_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_on_modif_table_fail]": [
+ {
+ "checksum": "0fdfcbe571574f02b96178cf6e451f19",
+ "size": 301,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_on_modif_table_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_percentile]": [
+ {
+ "checksum": "69f374bd4e5cfda4718bcfa124e31cb1",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_percentile_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_pragma]": [
+ {
+ "checksum": "ebfd723f610c45d470bfab75e4c390c7",
+ "size": 127,
+ "uri": "https://{canondata_backend}/1942278/4bdbb6995b5f140140510f56da5b1ebadf324fcc/resource.tar.gz#test_sql_format.test_action-eval_pragma_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_python3_ann]": [
+ {
+ "checksum": "0069dd5241a5532c24f915c42413587a",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_python3_ann_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_python3_signature]": [
+ {
+ "checksum": "5e1cfb74c22e517ed0f8b72a82b97815",
+ "size": 335,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_python3_signature_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_python_signature]": [
+ {
+ "checksum": "61749169793159478e0d82b712fa8d83",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_python_signature_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_range]": [
+ {
+ "checksum": "0e9b94fc3542d574c9e255dce3aae304",
+ "size": 297,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_regexp]": [
+ {
+ "checksum": "a27539aef7a2100dd24c1fe36d5c7152",
+ "size": 224,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_regexp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_resourcetype]": [
+ {
+ "checksum": "51910edeff8aae5fce043a161a616111",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_resourcetype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_result_label]": [
+ {
+ "checksum": "cf5ec484e1c2bfaba840c4f2ccee9e1b",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_result_label_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_sample]": [
+ {
+ "checksum": "6839a315f9b6de6248b80df5ba757936",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_skip_take]": [
+ {
+ "checksum": "bd43e79a372417d4b3e551be25756bde",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_skip_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_table_with_view]": [
+ {
+ "checksum": "4f4f1180230005c1ac4881798fb0111f",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_table_with_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_taggedtype]": [
+ {
+ "checksum": "3cbe4250e09e2497ce19ad1d2b930840",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_taggedtype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_type]": [
+ {
+ "checksum": "d6c593a09adb994ab2edd1a5e3a3e18a",
+ "size": 115,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_typeof_output_table]": [
+ {
+ "checksum": "d0fa43ca2549cc11a0134b00f792a663",
+ "size": 424,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_typeof_output_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_unresolved_type_arg]": [
+ {
+ "checksum": "1afe477d0b98786639be0189392d38bc",
+ "size": 1000,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_unresolved_type_arg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_values_output_table_subquery]": [
+ {
+ "checksum": "3e4c1959da78656f56974f7b73f2103f",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_values_output_table_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-eval_variant]": [
+ {
+ "checksum": "2a1702257123fb5fe36b9bb5d6ee5164",
+ "size": 174,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-eval_variant_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-evaluate_match_type]": [
+ {
+ "checksum": "84a9db4926fa879ad9acccebc343de1a",
+ "size": 303,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-evaluate_match_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-evaluate_pure]": [
+ {
+ "checksum": "90b7d86c1665339e1881d36a167c9919",
+ "size": 677,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-evaluate_pure_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-evaluate_queries]": [
+ {
+ "checksum": "a720981b06d5248061aa25ede65da3f8",
+ "size": 710,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-evaluate_queries_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-export_action]": [
+ {
+ "checksum": "b0d6e11e93f6bda11f024231b72311d0",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1871102/17992aa919577eec0f31ef167084ab70f41ccc80/resource.tar.gz#test_sql_format.test_action-export_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-inline_action]": [
+ {
+ "checksum": "7da554999ea3520183678c730ae2fffb",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-inline_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-insert_after_eval]": [
+ {
+ "checksum": "5787fd14044dd89c7ef8da40304818b2",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-insert_after_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-insert_after_eval_xlock]": [
+ {
+ "checksum": "da162af00c50aaa592846c6d1951496d",
+ "size": 329,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-insert_after_eval_xlock_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-insert_each_from_folder]": [
+ {
+ "checksum": "c51ad51888f8e943d2edc55f296bf202",
+ "size": 389,
+ "uri": "https://{canondata_backend}/1925821/6c2f883a1c33f02b8bcef287229b2b73dd762cff/resource.tar.gz#test_sql_format.test_action-insert_each_from_folder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-lambda_arg_count]": [
+ {
+ "checksum": "82e21a2fe287dbdbba65f9a73fa26282",
+ "size": 542,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-lambda_arg_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-large_evaluate_for_fail]": [
+ {
+ "checksum": "9057bbd7e90a4e33c50b0074ffad0538",
+ "size": 156,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-large_evaluate_for_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-mixed_eval_typeof_world1]": [
+ {
+ "checksum": "44b5538a4dec5e0dbfc742f637a2c15d",
+ "size": 1432,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-mixed_eval_typeof_world1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-nested_action]": [
+ {
+ "checksum": "0d65d56d54f5a6c324e6cf0da6a9f070",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-nested_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-nested_eval]": [
+ {
+ "checksum": "cb3a266243215eb1943e5605e2e39e2f",
+ "size": 818,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-nested_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-nested_rewrite_io]": [
+ {
+ "checksum": "ba4dc198879c987fe48ea7512f038ce2",
+ "size": 1032,
+ "uri": "https://{canondata_backend}/1900335/b0ec428a7b3c7f1c5c0e807f1d26fb9cecaf33b0/resource.tar.gz#test_sql_format.test_action-nested_rewrite_io_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-nested_subquery]": [
+ {
+ "checksum": "b34cd3790c7bb482efad79d707aa2fd3",
+ "size": 260,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-nested_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-parallel_for]": [
+ {
+ "checksum": "d7f5684a1d58cdfdefa9c8706efe6b0d",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1777230/29e6546cefd22432f185891c6cd51b4feab1b172/resource.tar.gz#test_sql_format.test_action-parallel_for_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-pass_action_as_param]": [
+ {
+ "checksum": "5797594f3ae4d3dfa7c4da761569e91f",
+ "size": 218,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-pass_action_as_param_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-pass_subquery_as_param]": [
+ {
+ "checksum": "a6c27d2e899958fd80507d0226dfec0b",
+ "size": 272,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-pass_subquery_as_param_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-pending_arg_fail]": [
+ {
+ "checksum": "81f805b197da46c934804cec3602afaf",
+ "size": 104,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-pending_arg_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-process_from_subquery_with_orderby]": [
+ {
+ "checksum": "1a12bae1c04c018f14ef710e9457f0a9",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-process_from_subquery_with_orderby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_apply_quoted_code]": [
+ {
+ "checksum": "45f4ee535b9662f46b76c45f01b5c464",
+ "size": 841,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_apply_quoted_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_for_select]": [
+ {
+ "checksum": "559a212a1b90aa38824a16c505b14103",
+ "size": 920,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_for_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_format_free_args_code]": [
+ {
+ "checksum": "4438a41bdf0a312042ae3ec7a640667d",
+ "size": 200,
+ "uri": "https://{canondata_backend}/1923547/78fed4f7afc37de597283a2c719a0b187e07580a/resource.tar.gz#test_sql_format.test_action-runtime_format_free_args_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_format_type]": [
+ {
+ "checksum": "e3a6d1a6e7990a204718be9ab2207461",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_format_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_if_select]": [
+ {
+ "checksum": "79299468b0a4a658cba906ea63ce3abf",
+ "size": 600,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_if_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_make_code]": [
+ {
+ "checksum": "a3e9952c2b3496239451b6d36688bc28",
+ "size": 877,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_make_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_parse_type]": [
+ {
+ "checksum": "f4767197052a289b41cb974e39e74470",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_parse_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_quote_code]": [
+ {
+ "checksum": "11a5ef713e50a3a3f18b36adf6b7d735",
+ "size": 601,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_quote_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_repr_code]": [
+ {
+ "checksum": "cc669e820c138c45c68b27e2d09c112f",
+ "size": 258,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_repr_code_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_serialize_type]": [
+ {
+ "checksum": "ce00791c930f395013d53b5a77b616d5",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_serialize_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_type_kind]": [
+ {
+ "checksum": "042e2a29063bd6adcf6d4b51ff7ef41b",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_type_kind_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-runtime_type_splitmake]": [
+ {
+ "checksum": "72fd424922e1d0e3339703280e7c59d8",
+ "size": 3493,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-runtime_type_splitmake_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-select_from_subquery_with_orderby]": [
+ {
+ "checksum": "29477065d2c8d5f21f1aaecafc52db8f",
+ "size": 411,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-select_from_subquery_with_orderby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery]": [
+ {
+ "checksum": "10ccaf654e0d807beef454a49d81abee",
+ "size": 459,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_accessnode]": [
+ {
+ "checksum": "056824bcb0dadaab223f8150430b3973",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_accessnode_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_assumeorderby]": [
+ {
+ "checksum": "be7b952ba6627cf6a0120e02ab89bb42",
+ "size": 296,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_assumeorderby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_extend_over_extend_for]": [
+ {
+ "checksum": "0104d969b475fa473e337cc6292fe3cc",
+ "size": 243,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_extend_over_extend_for_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_merge1]": [
+ {
+ "checksum": "4b8144bc7b7462b1ad92666e75e0cf06",
+ "size": 450,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_merge1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_merge2]": [
+ {
+ "checksum": "88f6c20dadf0d9c0e5ef559ec4552eb5",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_merge2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_merge_evaluate]": [
+ {
+ "checksum": "02ee60ad51304ad9983003aebf210413",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_merge_evaluate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_merge_nested_subquery]": [
+ {
+ "checksum": "be90776665c4954802763ff112e859c9",
+ "size": 453,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_merge_nested_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_merge_nested_world]": [
+ {
+ "checksum": "8c0ad08eb1ba55aa5f7c977d6029a8c7",
+ "size": 325,
+ "uri": "https://{canondata_backend}/1925821/6c2f883a1c33f02b8bcef287229b2b73dd762cff/resource.tar.gz#test_sql_format.test_action-subquery_merge_nested_world_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_opt_args]": [
+ {
+ "checksum": "f73f3647d37aaf4f0e5e70380025e010",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_opt_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_orderby0]": [
+ {
+ "checksum": "bf156754980c0a690a76bcdfaa2f68d3",
+ "size": 391,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_orderby0_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_orderby1]": [
+ {
+ "checksum": "f0417285180eeb72e46101034d4c404b",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_orderby1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-subquery_orderby2]": [
+ {
+ "checksum": "e1994b327f27aa119e7fefe8141e94f5",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_action-subquery_orderby2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[action-table_content_before_from_folder]": [
+ {
+ "checksum": "45dce176f9281a8754c8da9514085c3f",
+ "size": 287,
+ "uri": "https://{canondata_backend}/1925821/6c2f883a1c33f02b8bcef287229b2b73dd762cff/resource.tar.gz#test_sql_format.test_action-table_content_before_from_folder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_const_interval]": [
+ {
+ "checksum": "d79b9622927a2c114bcd785379256e1b",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_const_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_decimal]": [
+ {
+ "checksum": "5484b6f6cf8050a7c88e1d23d37dbb3e",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_interval]": [
+ {
+ "checksum": "145dcfe6354420fa4b783f2c3437dc9d",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_numeric]": [
+ {
+ "checksum": "f7c69a8fdf5bee6ba4e79a9c95c31f8b",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_numeric_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_numeric_opt]": [
+ {
+ "checksum": "e006b37c643830a529ed42097d610461",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_numeric_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-avg_state_type]": [
+ {
+ "checksum": "2e8cc2f475731e2f99553a5d899fcca3",
+ "size": 450,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-avg_state_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-count]": [
+ {
+ "checksum": "109910345e5ebd9cbce3ba5f37c840af",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-max]": [
+ {
+ "checksum": "a9be2c52db0d19a20df8207e30993ebd",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-min]": [
+ {
+ "checksum": "f976033cf221c2ca9b60c0752535f806",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_column_subset]": [
+ {
+ "checksum": "34ba87d944105b476d313339e184d797",
+ "size": 192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_column_subset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_len_count]": [
+ {
+ "checksum": "45e827cf1cd012ccd793cbc6a91234e6",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_len_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_len_count_all]": [
+ {
+ "checksum": "964e5e749be5ddb5d55babaa72af6246",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_len_count_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_len_count_distinct]": [
+ {
+ "checksum": "8d106a23f7b5cda764225616642b9f03",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_len_count_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_len_count_null]": [
+ {
+ "checksum": "18fc94945fc5041697f22b4534e63aac",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_len_count_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_sum_divide_by_zero]": [
+ {
+ "checksum": "85c7924ac568e1706c0de46abc3e665e",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_sum_divide_by_zero_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-opt_sum_null]": [
+ {
+ "checksum": "da64cf67d7c18771645e31a70e17c2b8",
+ "size": 179,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-opt_sum_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-pg_int4]": [
+ {
+ "checksum": "a49e5067db61e6fd83a63e137cb4ba25",
+ "size": 270,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-pg_int4_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-pg_int8]": [
+ {
+ "checksum": "87741950fa41c486846a97fe63ba3e79",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-pg_int8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-pg_text]": [
+ {
+ "checksum": "b1d54f2f4bd4ad58ccaba155f403978c",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-pg_text_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-some_notnull]": [
+ {
+ "checksum": "82e7c7c45f91a03d336c53edd22067cc",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-some_notnull_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-some_null]": [
+ {
+ "checksum": "c83dab81a9204fe87c0d5b08fbc514c6",
+ "size": 153,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-some_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_decimal]": [
+ {
+ "checksum": "f8a747d1423574b4087b56000eabf6a7",
+ "size": 265,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_decimal_null]": [
+ {
+ "checksum": "bd22a1e623b8a340342fa6e1ab4a2cd0",
+ "size": 238,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_decimal_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_double]": [
+ {
+ "checksum": "32a21c98e61fc70bf6a57871591fb429",
+ "size": 184,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_double_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_interval]": [
+ {
+ "checksum": "25088958e3e51208fe644c0e9129956b",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_signed]": [
+ {
+ "checksum": "9bc1b425456dba513a912b5a489abd8d",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_signed_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_type]": [
+ {
+ "checksum": "0cb6b2dce780d243609b4530d89a4f7c",
+ "size": 208,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_type_empty]": [
+ {
+ "checksum": "f30f5f4562ddf273eb9151b425e5701e",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_type_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_type_group_by]": [
+ {
+ "checksum": "0801ea15e10725e5ea80158a8782f1b6",
+ "size": 246,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_type_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-sum_unsigned]": [
+ {
+ "checksum": "e70f46840a47154aa97c9ccb0670d297",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-sum_unsigned_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_apply-table]": [
+ {
+ "checksum": "61c95e7868354263500f9c26cb1d698d",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_apply-table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-avg]": [
+ {
+ "checksum": "c2eaf1242a88b8d6b3b8169aa4d8d92b",
+ "size": 1383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-avg_null]": [
+ {
+ "checksum": "d3b960be271cdaf966b5a9eefb66a001",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-avg_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-avg_opt]": [
+ {
+ "checksum": "02bf26a0e50ef416ec1bb37ef73541dd",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-avg_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count]": [
+ {
+ "checksum": "8fca0f62dc10a548472fa524ffbebf22",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count_all]": [
+ {
+ "checksum": "08b0f5181054c04236a5e2f0cf3fa623",
+ "size": 1387,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count_all_null]": [
+ {
+ "checksum": "5fc16e0d5b2a7b8a9643a335897facf7",
+ "size": 1393,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_all_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count_all_opt]": [
+ {
+ "checksum": "442654c09f4fd2146c91925047837f99",
+ "size": 1399,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_all_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count_null]": [
+ {
+ "checksum": "6810f8ad7314b0313e8b48a255d020e0",
+ "size": 1401,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-count_opt]": [
+ {
+ "checksum": "20234c74bba56736d121522854eee845",
+ "size": 1407,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-count_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-max]": [
+ {
+ "checksum": "f60c7541adfb9406c05f3b89a9b907e5",
+ "size": 1383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-max_null]": [
+ {
+ "checksum": "ceeffda5abb10a752d1ffe5d34f842bc",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-max_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-max_opt]": [
+ {
+ "checksum": "9ba4490fc7ffab187edfc4af6165f879",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-max_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min]": [
+ {
+ "checksum": "760ddf71604412af913c1ca93f787495",
+ "size": 1383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min_by]": [
+ {
+ "checksum": "2b427419f4d4821c47a90e4cbb4d807b",
+ "size": 1427,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min_by_null]": [
+ {
+ "checksum": "b56eb9167d57dae99a182148088763de",
+ "size": 1433,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_by_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min_by_opt]": [
+ {
+ "checksum": "4bdf4d94b35ff58b115b209bcd8f8397",
+ "size": 1439,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_by_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min_null]": [
+ {
+ "checksum": "13d91fb7ea9fc15cc0df633e9183bcf4",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-min_opt]": [
+ {
+ "checksum": "06d2db0cd2b6a2682bdc12af5f155078",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-min_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-percentile]": [
+ {
+ "checksum": "77979174436f66bfd107f3b33de1dde7",
+ "size": 1455,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-percentile_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-percentile_null]": [
+ {
+ "checksum": "e2bcc562e6c3fca5b6939d48613abaca",
+ "size": 1461,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-percentile_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-percentile_opt]": [
+ {
+ "checksum": "55b442fb06f9b8e96b4962daf2f36d09",
+ "size": 1467,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-percentile_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-sum]": [
+ {
+ "checksum": "9ff0ee9a9dc1fcfdf0f76eab2872f227",
+ "size": 1383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-sum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-sum_null]": [
+ {
+ "checksum": "ef60550da7de4a3241a45aff96c9d7da",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-sum_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases-sum_opt]": [
+ {
+ "checksum": "93a86acb2545d9de3e6306a75b433cd8",
+ "size": 1395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases-sum_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-avg]": [
+ {
+ "checksum": "e8c4e5c3565897eab0e217e890d5baaf",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-avg_decimal]": [
+ {
+ "checksum": "8d57ef61f93cb12395632a984257cda6",
+ "size": 1443,
+ "uri": "https://{canondata_backend}/1942415/d77582873ccf3369a6a530c6d99bb20a670b52e8/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-avg_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count]": [
+ {
+ "checksum": "674b92a7d1504376a5f847da9c78a38e",
+ "size": 1417,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count_all]": [
+ {
+ "checksum": "270719fe2a71dcc08f09a81334135500",
+ "size": 1409,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count_all_null]": [
+ {
+ "checksum": "d10de4710fc77738b93430ce5a17c33c",
+ "size": 1415,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_all_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count_all_opt]": [
+ {
+ "checksum": "e726163f8f18d80199c6d9c1cb8e49a7",
+ "size": 1421,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_all_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count_null]": [
+ {
+ "checksum": "eb324180ebb684d59394089731741b8c",
+ "size": 1423,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-count_opt]": [
+ {
+ "checksum": "332fc2940084982713f09db3fc027e27",
+ "size": 1429,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-count_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-max]": [
+ {
+ "checksum": "326a77212f4e79fba8fdf6295c3b69ef",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-min]": [
+ {
+ "checksum": "18c8e8adf4d878dfe3fbbb902f62da67",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-some_notnull]": [
+ {
+ "checksum": "23a042a50b6d9132871695d7603bfc9b",
+ "size": 1411,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-some_notnull_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-some_null]": [
+ {
+ "checksum": "33e03a094e63edfb244730cfb3cbc282",
+ "size": 1417,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-some_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-sum]": [
+ {
+ "checksum": "03e1685be91b5048af82d0a5aaf2ca7a",
+ "size": 1405,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-sum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-sum_null]": [
+ {
+ "checksum": "637c769ed0a06a9160d1047807f379cc",
+ "size": 1411,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-sum_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[agg_phases_agg_apply-sum_opt]": [
+ {
+ "checksum": "5d0a41c0ee30f541c9350b778c0c5d9c",
+ "size": 1417,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_agg_phases_agg_apply-sum_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-avg]": [
+ {
+ "checksum": "ce759f4eb81659358cb914e6d874154e",
+ "size": 564,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-avg_distinct_expr]": [
+ {
+ "checksum": "9cc0aabbb1889eed74441d00ce5f2dad",
+ "size": 316,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-avg_distinct_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-avg_if]": [
+ {
+ "checksum": "d4912542ed404f33b20a9e4230317d81",
+ "size": 559,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-avg_if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-bitand]": [
+ {
+ "checksum": "619dfbea587569e2a6e4ca03ea962b21",
+ "size": 569,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-bitand_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-bitor]": [
+ {
+ "checksum": "646a5b86aa9f82aa295012a605fbdca6",
+ "size": 568,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-bitor_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-bitxor]": [
+ {
+ "checksum": "5f82837896a31c7b6976e922cf1de0b7",
+ "size": 569,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-bitxor_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-booland]": [
+ {
+ "checksum": "1480d3fbffb3eec572356179ad2160f8",
+ "size": 575,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-booland_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-boolor]": [
+ {
+ "checksum": "8e67243d36fd37a0222ed86cfc5666ae",
+ "size": 574,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-boolor_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-bottom]": [
+ {
+ "checksum": "5426142d50de37f82c466630e41e820c",
+ "size": 728,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-bottom_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-bottom_by]": [
+ {
+ "checksum": "8225662c66f13511baa840c09e6b47b6",
+ "size": 738,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-bottom_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-container]": [
+ {
+ "checksum": "783f45cf131251c67355a4153fac2d5b",
+ "size": 2569,
+ "uri": "https://{canondata_backend}/1899731/8ff3d323098c4590b50ff0ff52f90195d35236f6/resource.tar.gz#test_sql_format.test_aggr_factory-container_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-container_empty]": [
+ {
+ "checksum": "d23ebc4d8435754c0e5d212e53cc6c00",
+ "size": 562,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-container_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-corellation]": [
+ {
+ "checksum": "496005587594d2bb8cf28330d9d3e222",
+ "size": 558,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-corellation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-count]": [
+ {
+ "checksum": "23e657b0a0566a60f0b59a2c9e20239f",
+ "size": 566,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-count_if]": [
+ {
+ "checksum": "bcbc90573d75b6467cd13d799948fe00",
+ "size": 575,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-count_if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-def_value_full_table]": [
+ {
+ "checksum": "7af8129a4f271ccba996be1e810dbed4",
+ "size": 1313,
+ "uri": "https://{canondata_backend}/1942173/5547b75707e10619dbd7727d7d0f2404ab9b13ca/resource.tar.gz#test_sql_format.test_aggr_factory-def_value_full_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-def_value_with_keys]": [
+ {
+ "checksum": "a298cf11b7a5a217671ae761ec9eb406",
+ "size": 1338,
+ "uri": "https://{canondata_backend}/1942173/5547b75707e10619dbd7727d7d0f2404ab9b13ca/resource.tar.gz#test_sql_format.test_aggr_factory-def_value_with_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-every]": [
+ {
+ "checksum": "2d8d1efd65dab9089bdb4041cfe47bdf",
+ "size": 573,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-every_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-flatten]": [
+ {
+ "checksum": "bf007f6d8ca2ed9231002d8868114341",
+ "size": 671,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-flatten_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-histogram]": [
+ {
+ "checksum": "04a9de97693c29b62e37843b7c5c3431",
+ "size": 890,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-histogram_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-hll]": [
+ {
+ "checksum": "fb50405f8426d0566776f778aa71a69c",
+ "size": 879,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-hll_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-linear_histogram]": [
+ {
+ "checksum": "eb2bfcea1210d7b283e40e73ab6106dd",
+ "size": 874,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-linear_histogram_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-list]": [
+ {
+ "checksum": "ef6f0312040d5a99ab290fd5b6c27401",
+ "size": 967,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-log_histogram]": [
+ {
+ "checksum": "cd7206df9795140483cc1bbb777d77de",
+ "size": 869,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-log_histogram_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-logariphmic_histogram]": [
+ {
+ "checksum": "727ba1259655eaf4a072780536bf7fc7",
+ "size": 885,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-logariphmic_histogram_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-max]": [
+ {
+ "checksum": "d58060c1dd7ea1ef58241d5bfaa8e0d9",
+ "size": 564,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-max_by]": [
+ {
+ "checksum": "bc62e286da46abce1b2878f7446963fb",
+ "size": 975,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-max_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-median]": [
+ {
+ "checksum": "2b33fc377b2298486b5e304d1b7efefe",
+ "size": 891,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-median_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-min]": [
+ {
+ "checksum": "5df270646c79d52c0a80831ec3868133",
+ "size": 564,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-min_by]": [
+ {
+ "checksum": "151cc08d8ea6002bdac7b9ac777eb390",
+ "size": 975,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-min_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-mode]": [
+ {
+ "checksum": "71d1d415fb5a5d68d5dd6591d4425654",
+ "size": 962,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-mode_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi]": [
+ {
+ "checksum": "12a4663a074832410e048c8ed3a3045d",
+ "size": 1039,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_list]": [
+ {
+ "checksum": "6764227e5778e4905507d3ecfeb53f91",
+ "size": 810,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_list_distinct_expr]": [
+ {
+ "checksum": "15112948cff8f9bfe8c5bd97883c4bba",
+ "size": 987,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_list_distinct_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_list_nulls]": [
+ {
+ "checksum": "1ade9ee30596d2c24241dc1128a6441d",
+ "size": 663,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_list_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_minmaxby]": [
+ {
+ "checksum": "6ff9cec3751d0d9e7d09a70dbdebe677",
+ "size": 407,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_minmaxby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_struct_nulls]": [
+ {
+ "checksum": "b1c36eb95cca667c489ab08d55869b5b",
+ "size": 710,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_struct_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_tuple]": [
+ {
+ "checksum": "67e233e357d52192bc9317db69410e84",
+ "size": 852,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-multi_tuple_nulls]": [
+ {
+ "checksum": "f260df126982c4a95775694c74fc4b7d",
+ "size": 656,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-multi_tuple_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-some]": [
+ {
+ "checksum": "0955176f1a7465e2d35087f19b082fc6",
+ "size": 565,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-some_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-stddev]": [
+ {
+ "checksum": "0a8a9676558cdaa11880709c89a35ee3",
+ "size": 567,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-stddev_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-sum_if]": [
+ {
+ "checksum": "372c2bdc75c3ca9e43fc6ae023433315",
+ "size": 559,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-sum_if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-top]": [
+ {
+ "checksum": "6bdc72a532e165b2f6c835881c6706f6",
+ "size": 725,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-top_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-top_by]": [
+ {
+ "checksum": "dbaf50fb9172b8e6ec640db526c70726",
+ "size": 735,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-top_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-transform_input]": [
+ {
+ "checksum": "4b3ad7e77a7f063cfd5ca5d5f3e97b41",
+ "size": 325,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-transform_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-transform_output]": [
+ {
+ "checksum": "112fbea1c9cb7d7e4a2111c980d41191",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-transform_output_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-udaf]": [
+ {
+ "checksum": "536fd78396795a922beddb8a99c716e1",
+ "size": 1329,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-udaf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-udaf_distinct_expr]": [
+ {
+ "checksum": "0b44d97c33fe30e9a78c7289420f6278",
+ "size": 745,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-udaf_distinct_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-udaf_in_udaf]": [
+ {
+ "checksum": "22e42b98a72d5b4ec1452ecb99095a4a",
+ "size": 1154,
+ "uri": "https://{canondata_backend}/1781765/227af57ccf2ba5ca6b7eaaffd64fc6924a1bf64a/resource.tar.gz#test_sql_format.test_aggr_factory-udaf_in_udaf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggr_factory-variance]": [
+ {
+ "checksum": "bebfdbc188cc49d8187bad09000c7453",
+ "size": 569,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggr_factory-variance_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-GroupByOneField]": [
+ {
+ "checksum": "2c63ab0668e4505ae87354cb94ad0c22",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-GroupByOneField_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-GroupByTwoFields]": [
+ {
+ "checksum": "05c9edebb83fd345cd29fa6cc7f00528",
+ "size": 141,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-GroupByTwoFields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-agg_filter_pushdown]": [
+ {
+ "checksum": "ef301ccf18be0cb2924b377311166204",
+ "size": 286,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-agg_filter_pushdown_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-agg_full_table_list]": [
+ {
+ "checksum": "4d01df5c11ca11f309213d7f80d7a1ea",
+ "size": 174,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-agg_full_table_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-agg_phases_table1]": [
+ {
+ "checksum": "feed15c50d3a8897e46cabb5cff92750",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-agg_phases_table1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-agg_phases_table2]": [
+ {
+ "checksum": "d8004628906715050ccddb495a273250",
+ "size": 196,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-agg_phases_table2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-agg_phases_table3]": [
+ {
+ "checksum": "8595a88e9bb623d3d5592a0bd12a6299",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-agg_phases_table3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_by_column_lookup_in_const_dict]": [
+ {
+ "checksum": "113796ba1153249c2cc0cc7b752b20b0",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_by_column_lookup_in_const_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_by_one_column]": [
+ {
+ "checksum": "88612a1dfa243a0eeaa43390f799a972",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_by_one_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_expr]": [
+ {
+ "checksum": "b50c4af2172581c7278e6a28ce6730a6",
+ "size": 284,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_expr_with_groupby_expr]": [
+ {
+ "checksum": "6d1b8a5aa6e22b510377a11238739a9f",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_expr_with_groupby_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_expr_with_udf]": [
+ {
+ "checksum": "fc67659904d665a5f51bec6405a69888",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_expr_with_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_in_access_node_exprs]": [
+ {
+ "checksum": "4ae2da1eb67641891107b4982563c78d",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_in_access_node_exprs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_list]": [
+ {
+ "checksum": "d4a4289735d1357c807b1abb5544c93d",
+ "size": 757,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_distinct_struct_access]": [
+ {
+ "checksum": "2f846322dd7e0820cab1fbc3e48f707b",
+ "size": 223,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_distinct_struct_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_inmem_distinct_list]": [
+ {
+ "checksum": "6dcf055d43e57b5cae36986671a698ed",
+ "size": 951,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_inmem_distinct_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_inmem_list_in_key]": [
+ {
+ "checksum": "c21c2f1a2450d016e180f311abe74620",
+ "size": 779,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_inmem_list_in_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_key_column]": [
+ {
+ "checksum": "2419da2e5f43047e17df5206fed4486c",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_key_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_list_in_key]": [
+ {
+ "checksum": "7c2b6fbd19fe2d7ffb27db4aa4daf9bd",
+ "size": 1366,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_list_in_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_subquery_yql_15869]": [
+ {
+ "checksum": "248182129410c6f09ffca3aa6aec1f39",
+ "size": 148,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_subquery_yql_15869_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_udf_nested]": [
+ {
+ "checksum": "ee32d58199f11f0853544653c94d2ebf",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_udf_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_with_const_yson_options]": [
+ {
+ "checksum": "8c794398d21a87022565f379a0347686",
+ "size": 173,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_with_const_yson_options_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_with_deep_aggregated_column]": [
+ {
+ "checksum": "d1e113d856fa33ebc66e07b4be0dc0e4",
+ "size": 459,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_aggregate-aggregate_with_deep_aggregated_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_with_default_yson_options]": [
+ {
+ "checksum": "7bb3278e3cefd67790e74eb514cb4f0b",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_with_default_yson_options_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_with_lambda]": [
+ {
+ "checksum": "5c67194d77f67554b0eb7ec99d47a5dd",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_with_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregate_with_lambda_inside_avg]": [
+ {
+ "checksum": "9d275c11ffc7393484bb8a28ce0620ee",
+ "size": 209,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregate_with_lambda_inside_avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregation_and_order]": [
+ {
+ "checksum": "80173984db51ecd572b582227de71eb1",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregation_and_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregation_by_udf]": [
+ {
+ "checksum": "3c175fa8f05029f2cf0bdf7547b17ea7",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregation_by_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggregation_with_named_node]": [
+ {
+ "checksum": "4c8688d028782e7631be3ac17d423254",
+ "size": 269,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggregation_with_named_node_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggrs_no_grouping]": [
+ {
+ "checksum": "c8707aa0c7dfb11d123200dd01beb076",
+ "size": 1473,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-aggrs_no_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggrs_no_grouping_via_map]": [
+ {
+ "checksum": "87bcd0d25dab9d63694caf1e3e940bbd",
+ "size": 1515,
+ "uri": "https://{canondata_backend}/1937367/1251b8b408ef167749e32c6a9872574193aac10c/resource.tar.gz#test_sql_format.test_aggregate-aggrs_no_grouping_via_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-aggrs_no_grouping_via_map_compact]": [
+ {
+ "checksum": "91723a562d00c7c5a22088dad5b2e4ee",
+ "size": 1539,
+ "uri": "https://{canondata_backend}/1937367/1251b8b408ef167749e32c6a9872574193aac10c/resource.tar.gz#test_sql_format.test_aggregate-aggrs_no_grouping_via_map_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-avg_and_sum]": [
+ {
+ "checksum": "067d46d5653bcb904d02b77caff9927a",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-avg_and_sum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-avg_and_sum_by_value]": [
+ {
+ "checksum": "803c3b34d29c0c596b0b182b2b5a832f",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-avg_and_sum_by_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-avg_and_sum_float]": [
+ {
+ "checksum": "a875e84c9d5908694576122f9367cf26",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-avg_and_sum_float_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-avg_interval]": [
+ {
+ "checksum": "e949527c3346364fefb925b6b01cb986",
+ "size": 110,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-avg_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-avg_with_having]": [
+ {
+ "checksum": "4610dd72e1e15f5d3bcbd383f37fea21",
+ "size": 155,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-avg_with_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-compare_by]": [
+ {
+ "checksum": "3124ab95b4dc4c4be9af89c3d9b1b51b",
+ "size": 425,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-compare_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-compare_by_nulls]": [
+ {
+ "checksum": "24f1dff606ecc03e37c89ada1aef6d0e",
+ "size": 820,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-compare_by_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-compare_by_tuple]": [
+ {
+ "checksum": "e1407bf7209d9e0fb7102cc2ea5846a1",
+ "size": 588,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_aggregate-compare_by_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-compare_tuple]": [
+ {
+ "checksum": "26c39d4241fd8d420c05d5b4ccdb0225",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_aggregate-compare_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-count_distinct_with_filter]": [
+ {
+ "checksum": "e4aebb1ebac0baa5485ee3a143b9cf4e",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-count_distinct_with_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-dedup_state_keys]": [
+ {
+ "checksum": "4b4a9b89e4b304ddd157387ad3f24ad3",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-dedup_state_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-disable_blocks_with_spilling]": [
+ {
+ "checksum": "ed1c0334420d2ec08b8ccc4020e4fb6b",
+ "size": 88,
+ "uri": "https://{canondata_backend}/1920236/3d99d8b2ede4d290229a75d3c17d5a932a859473/resource.tar.gz#test_sql_format.test_aggregate-disable_blocks_with_spilling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-ensure_count]": [
+ {
+ "checksum": "7a2ea2eeaf67cc395330f6718ce49635",
+ "size": 69,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-ensure_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_column]": [
+ {
+ "checksum": "ea8ea94c6a7df312330874489571b07a",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_column_alias_reuse]": [
+ {
+ "checksum": "ea23501cb7dd9e0d45049bdbb6657765",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_column_alias_reuse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_column_alias_reuse_for_join]": [
+ {
+ "checksum": "4e29b5419e8940a31e7e89453d36d2b0",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_column_alias_reuse_for_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_cube_duo]": [
+ {
+ "checksum": "3d4be73a377ce3e885b4cd357bcc2545",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_cube_duo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_cube_expr_trio]": [
+ {
+ "checksum": "4aa679c9db5a514d70bc8b5c2f441845",
+ "size": 298,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_cube_expr_trio_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_cube_grouping]": [
+ {
+ "checksum": "1192147e1810b2ed5f636f9801c4ea22",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_cube_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_cube_grouping_and_expr]": [
+ {
+ "checksum": "81e153d895953f75942f9696818c5686",
+ "size": 366,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_cube_grouping_and_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_cube_join_count]": [
+ {
+ "checksum": "9198f1b88e62c332c0dd30fe7bab5c40",
+ "size": 272,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_cube_join_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr]": [
+ {
+ "checksum": "21c1d668808fb7d7523013e48166e9db",
+ "size": 160,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_alias_on_subexp]": [
+ {
+ "checksum": "cd3346b7bee153a691ae4f82db047a1e",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_alias_on_subexp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_and_having]": [
+ {
+ "checksum": "f7d03054bc6f005572b0a41347addfbf",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_and_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_columns_reuse]": [
+ {
+ "checksum": "90500659229f1ca290c94b4cd2611f32",
+ "size": 201,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_columns_reuse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_dict]": [
+ {
+ "checksum": "f44ac075fad32808ab017478264cbf13",
+ "size": 410,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_lookup]": [
+ {
+ "checksum": "ee9f7843fa0fc45fe24be1858e7359c4",
+ "size": 128,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_lookup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_mul_col]": [
+ {
+ "checksum": "2e2bc09b5f4117d3b285367d6a80af3a",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_mul_col_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_only_join]": [
+ {
+ "checksum": "86c3a0464f4af1c08ebe9df32120c925",
+ "size": 362,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_only_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_order_by_expr]": [
+ {
+ "checksum": "314e31cd797b2d357464c3daa64e7b07",
+ "size": 203,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_order_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_semi_join]": [
+ {
+ "checksum": "d3aa94019af7393993344ffcfc590171",
+ "size": 403,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_semi_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_with_join]": [
+ {
+ "checksum": "8deb22b647a257c87120d25d23934862",
+ "size": 245,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_with_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_expr_with_where]": [
+ {
+ "checksum": "d4934dc311e83abad2439059da776b16",
+ "size": 167,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_expr_with_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_full_path]": [
+ {
+ "checksum": "c2c1287b79ea9a2672cc5f97f79b0ca2",
+ "size": 111,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_full_path_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_alt_duo]": [
+ {
+ "checksum": "e8606103a536b2d83448ee508339d262",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_alt_duo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_and_having]": [
+ {
+ "checksum": "31fd43d8cd0974fe070f1332e6ca2661",
+ "size": 307,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_and_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_duo]": [
+ {
+ "checksum": "07dc377c0d3189d5b7566a4ea70e0db3",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_duo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_few_empty]": [
+ {
+ "checksum": "7b521b7ffbf31d39567e05740ed4b43d",
+ "size": 287,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_few_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_flatten]": [
+ {
+ "checksum": "0ce3f563be6de69065b5a0f36b81f08f",
+ "size": 353,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_flatten_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_flatten_columns]": [
+ {
+ "checksum": "1a70c58171e107fa93d66ee4aaa11ef7",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_flatten_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_flatten_expr]": [
+ {
+ "checksum": "c77e64a736826fe412fd50d8de7b5097",
+ "size": 389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_flatten_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_grouping]": [
+ {
+ "checksum": "deaf0034ea299b8d66a51c2935b830fe",
+ "size": 319,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_join_aliases]": [
+ {
+ "checksum": "df4e73c5f5ca45b690a714b3aabe7e17",
+ "size": 306,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_join_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_simp]": [
+ {
+ "checksum": "3abe51b07875a6cecfe3af377e60e77c",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_simp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_subselect]": [
+ {
+ "checksum": "cab265a3e1e29482cd3c6e357fb46e1d",
+ "size": 422,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_subselect_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_subselect_asterisk]": [
+ {
+ "checksum": "d7cc49aa6e4f912cd1be0260d7c4e562",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_subselect_asterisk_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_gs_with_rollup]": [
+ {
+ "checksum": "8787750382f13bbc38df6e6a71793cac",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_gs_with_rollup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop]": [
+ {
+ "checksum": "d8d772cf4ff30951a6d740d77c4c3123",
+ "size": 303,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_compact]": [
+ {
+ "checksum": "441511a06dc889f4b550c20edc674af8",
+ "size": 311,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_distinct]": [
+ {
+ "checksum": "8d4351254f9161a37cacbd203ff00a59",
+ "size": 376,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_distinct_compact]": [
+ {
+ "checksum": "5270e93dc272f8e52ff16b4b1344f3bc",
+ "size": 384,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_distinct_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_expr_key]": [
+ {
+ "checksum": "d59fa5c3dac0db75c3a41f8967b1b9d3",
+ "size": 338,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_expr_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_list_key]": [
+ {
+ "checksum": "30a53808b1164b5ef1c7983b6c3aefc7",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_only]": [
+ {
+ "checksum": "291532524052cc344314bcaf776d7625",
+ "size": 283,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_only_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_only_distinct]": [
+ {
+ "checksum": "ca977b93ff20ac49b65f17928f9089ff",
+ "size": 356,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_only_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_only_start]": [
+ {
+ "checksum": "04fb3a4f364780a3011de8496b4132b6",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_only_start_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_star]": [
+ {
+ "checksum": "0132a85abf9d40c5a848a3c031206631",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_static]": [
+ {
+ "checksum": "a6f19201a2a81c7308fe9947b59276bf",
+ "size": 955,
+ "uri": "https://{canondata_backend}/1925821/aca60c4aca6b335189396eb0d636b37dbc38e5d9/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_static_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_hop_static_list_key]": [
+ {
+ "checksum": "3d3184e982097fa7fed63bdeef6c1fae",
+ "size": 976,
+ "uri": "https://{canondata_backend}/1937492/6205ff455a623f62222bc8ee2c2ee5c2e7ee4174/resource.tar.gz#test_sql_format.test_aggregate-group_by_hop_static_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_mul_gb_ru]": [
+ {
+ "checksum": "adae92846c7098e2ea3468096a13ffae",
+ "size": 303,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_mul_gb_ru_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_mul_gs_expr_and_column]": [
+ {
+ "checksum": "08f66dddc24a881cc18b1d2e7fb21555",
+ "size": 384,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_mul_gs_expr_and_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_mul_gs_gs]": [
+ {
+ "checksum": "8eb3d5ba2a0c173d1643e12667bbea69",
+ "size": 394,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_mul_gs_gs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_mul_gs_ru]": [
+ {
+ "checksum": "b43649c56a2a5a3ffc36078b25fc5233",
+ "size": 372,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_mul_gs_ru_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_mul_ru_ru]": [
+ {
+ "checksum": "bb22614b75fb2feb2b72a7e889fc30fe",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_mul_ru_ru_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_aggr_expr]": [
+ {
+ "checksum": "392782b4f25533760582d8262f61c29a",
+ "size": 460,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_aggr_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_column_ref]": [
+ {
+ "checksum": "66747be73d40b1f3dad557f15e5fc3c3",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_column_ref_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_column_ref_same_names]": [
+ {
+ "checksum": "65384bd3c027604f1fe6dffff0aadd35",
+ "size": 403,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_column_ref_same_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_column_reuse]": [
+ {
+ "checksum": "64e21c508f2abdb8a0fffef9b5630aee",
+ "size": 510,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_column_reuse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_duo]": [
+ {
+ "checksum": "c78fce34bb7ac87ac71128d3703fa275",
+ "size": 177,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_duo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_duo_opt]": [
+ {
+ "checksum": "cb699e71a3703b32082ca59b745d05d2",
+ "size": 184,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_duo_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_grouping]": [
+ {
+ "checksum": "bf8ef69b4c964c0e6f2e7fc6500f6924",
+ "size": 309,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_grouping_hum]": [
+ {
+ "checksum": "bf46e85dae52f3a34a6ead22f46127a6",
+ "size": 518,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_grouping_hum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_grouping_hum_bind]": [
+ {
+ "checksum": "67c76c469c69693313b069fc34ed58b6",
+ "size": 586,
+ "uri": "https://{canondata_backend}/1600758/9421f4cd02e97775f7466e3f3ee278c0e498b02c/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_grouping_hum_bind_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_key_check]": [
+ {
+ "checksum": "46543265e427d6982a2d0cb72d1e9565",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_key_check_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_rename]": [
+ {
+ "checksum": "68657c82b7b7ceec20b58d17ca530274",
+ "size": 183,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_rename_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_udf]": [
+ {
+ "checksum": "cb1908885fe126393bb5b3cef2902c0e",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_rollup_with_filter]": [
+ {
+ "checksum": "e2c4fd31cde0979e1ce125e6b918f9d5",
+ "size": 243,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_rollup_with_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join]": [
+ {
+ "checksum": "0952ed722c3323f412a137e12e1d1f2a",
+ "size": 229,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_agg]": [
+ {
+ "checksum": "dab000596d1162ea3f6930ec249b8437",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_agg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_grouping]": [
+ {
+ "checksum": "d672281f481d0202c45207901dd7b6b1",
+ "size": 351,
+ "uri": "https://{canondata_backend}/1903280/ab0a81bc2e9a5c845965f3189b0aa541c326bedf/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_qualified]": [
+ {
+ "checksum": "19d2225658a174037c0c87b8833482e7",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_qualified_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_simple]": [
+ {
+ "checksum": "e9a5f2bb39f7408903606afbafeedce3",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_simple_fs_multiusage]": [
+ {
+ "checksum": "0369dc43a2062b648a486f7efb2873d0",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1599023/c4917fc01ae646b5e708e20b50ea7ae2325f5bb7/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_simple_fs_multiusage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_join_star]": [
+ {
+ "checksum": "e4a4a97de8afd6e188163c71da45788d",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_join_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_partition_by_grouping]": [
+ {
+ "checksum": "8d25349881c2bfebab70dadc86107a43",
+ "size": 328,
+ "uri": "https://{canondata_backend}/1781765/275eb46642921957e733909d887afbe95f1f2061/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_partition_by_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_with_select_distinct]": [
+ {
+ "checksum": "6561aa13b2247a3ee4f4aa906e01496f",
+ "size": 99,
+ "uri": "https://{canondata_backend}/1925842/455f0a4e786bf55f7710ef3d0b8e42af1becc974/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_with_select_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_ru_with_window_func]": [
+ {
+ "checksum": "23cc7396d9f51c8694b1a02db2dcdf22",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1916746/28040436e8adf35f54411fd2392bcd0557fc0b73/resource.tar.gz#test_sql_format.test_aggregate-group_by_ru_with_window_func_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session]": [
+ {
+ "checksum": "3f981df975f2145a25c3353d2e72a3cd",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_aliases]": [
+ {
+ "checksum": "5ec0f2e4b20801ba5a7d5b542496cb15",
+ "size": 367,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_compact]": [
+ {
+ "checksum": "8ca871e66a7eab48c69a2c293ae505bd",
+ "size": 293,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_distinct]": [
+ {
+ "checksum": "2195c61741f3b8d96072fbab0f51fc88",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_distinct_compact]": [
+ {
+ "checksum": "81c163b12fc7f10360170907f37b3c4e",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_distinct_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_extended]": [
+ {
+ "checksum": "7d9c8c76138f380c6e42600118505bbd",
+ "size": 781,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_extended_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_extended_subset]": [
+ {
+ "checksum": "d476f6494994238780dd1020032d75dc",
+ "size": 773,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_extended_subset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_extended_tuple]": [
+ {
+ "checksum": "30ed794855d22e98588e1af1bb64d9d8",
+ "size": 1483,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_extended_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_only]": [
+ {
+ "checksum": "531ee77369e54e2a1616411e89c86bb7",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_only_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_only_distinct]": [
+ {
+ "checksum": "7aa7ebfc3375e5266d024d207719f26b",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_only_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_session_star]": [
+ {
+ "checksum": "afc6ddb9a3af9acef92b3c134df7084a",
+ "size": 306,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_session_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_tablerow_column]": [
+ {
+ "checksum": "d6967a73f9bcfb2db18b0ad262d950c1",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_tablerow_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_tz_date]": [
+ {
+ "checksum": "ad64e5990d6cf6ac818797756ae78ee1",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_tz_date_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_with_udf_by_aggregate]": [
+ {
+ "checksum": "f936571a43dd111e1691b82cac458049",
+ "size": 480,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_with_udf_by_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_by_with_where]": [
+ {
+ "checksum": "81ab8deb8a05f3b16fccf80eb3952d23",
+ "size": 157,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_by_with_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_compact_sorted]": [
+ {
+ "checksum": "0490099b2e7e4316623a6212d3106eca",
+ "size": 197,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_compact_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_compact_sorted_distinct]": [
+ {
+ "checksum": "5b61281ce483759146401417338b8d39",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_compact_sorted_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_compact_sorted_distinct_complex]": [
+ {
+ "checksum": "4451b6a1cf57fa831df92ca321599570",
+ "size": 400,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_compact_sorted_distinct_complex_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-group_compact_sorted_with_diff_order]": [
+ {
+ "checksum": "d74f6a886f1f5159fe2dfa7975359071",
+ "size": 1256,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-group_compact_sorted_with_diff_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-having_cast]": [
+ {
+ "checksum": "a1f21b5792b5a3ea4d433c816145004c",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-having_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-having_distinct_expr]": [
+ {
+ "checksum": "838003c1cd05d868a28e8e6c805dba3f",
+ "size": 124,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-having_distinct_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-histogram_cdf]": [
+ {
+ "checksum": "29893bdb4f335f41674bc2181ca0a8b9",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-histogram_cdf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-library_error_in_aggregation_fail]": [
+ {
+ "checksum": "77fe10b1e019b8f08c24afb99aa238f8",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-library_error_in_aggregation_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-list_after_group]": [
+ {
+ "checksum": "848414635a5ce27d534b12fa95e98950",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-list_after_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-list_nullable]": [
+ {
+ "checksum": "37ebb96184cfd2ac7238db9b6ee02839",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-list_nullable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-list_with_fold_map]": [
+ {
+ "checksum": "28e49eb060ca7c133928b8b762863038",
+ "size": 370,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-list_with_fold_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-listbuiltin_constness]": [
+ {
+ "checksum": "8488d7c485a46fd9041cf7397fbae140",
+ "size": 152,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-listbuiltin_constness_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-native_desc_group_compact_by]": [
+ {
+ "checksum": "4afcd6f072a2d004ab3964add9c5e595",
+ "size": 668,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-native_desc_group_compact_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-null_type]": [
+ {
+ "checksum": "326dc9b2081428cbd2694d23a41c3fbd",
+ "size": 493,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-null_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-parsetype_constness]": [
+ {
+ "checksum": "13f82e2dc395ba17e522afb899bf24c1",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-parsetype_constness_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentile_and_avg_grouped]": [
+ {
+ "checksum": "9dfde9bff1db7e26d59ee7818aa26cb9",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentile_and_avg_grouped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentile_and_variance]": [
+ {
+ "checksum": "31aff4efdf40f755673a314a4b67add1",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentile_and_variance_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentile_interval]": [
+ {
+ "checksum": "78ceaecff49e8282d58f6fd9b52a3b3c",
+ "size": 1254,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentile_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentiles_containers]": [
+ {
+ "checksum": "93307a17a4616867d3371769de7c33d4",
+ "size": 656,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentiles_containers_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentiles_grouped]": [
+ {
+ "checksum": "5d9bbcc4ad6c746e45cf80b6b1d6faee",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentiles_grouped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentiles_grouped_expr]": [
+ {
+ "checksum": "af36f224987043fa0f426fc935176466",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentiles_grouped_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-percentiles_ungrouped]": [
+ {
+ "checksum": "6abee6a823b55c8e96a5733ed5148687",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-percentiles_ungrouped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-rollup_with_dict]": [
+ {
+ "checksum": "0422592f1da5a21c9a0e9242ce68f854",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-rollup_with_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-subquery_aggregation]": [
+ {
+ "checksum": "6fc1fbab8b9f2ea81c7b2c5265093e0a",
+ "size": 280,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-subquery_aggregation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-table_funcs_group_by]": [
+ {
+ "checksum": "ddc5b6705000d6e406d2fbe0fc2abbe8",
+ "size": 223,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-table_funcs_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-table_row_aggregation]": [
+ {
+ "checksum": "6c6c2c67e691700950490251acfc6157",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_aggregate-table_row_aggregation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[aggregate-yql-18511]": [
+ {
+ "checksum": "df8e0cf815bdc93797f7c8a221c52a96",
+ "size": 2024,
+ "uri": "https://{canondata_backend}/1689644/9f0cb0061bf69b8a694d5c2f0375cda28d1cca57/resource.tar.gz#test_sql_format.test_aggregate-yql-18511_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-basic_columns]": [
+ {
+ "checksum": "3dd79117537033cdbba42231978e98a8",
+ "size": 116,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-basic_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-escaped_udf_name]": [
+ {
+ "checksum": "47284683473a724855369a378c57831d",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-escaped_udf_name_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-escaping]": [
+ {
+ "checksum": "b0db6cc8bad65a178365f6e3d28dd750",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-escaping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-inplace_yql]": [
+ {
+ "checksum": "48ab735ea513f632de410362f8a07d95",
+ "size": 188,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-inplace_yql_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-join_using]": [
+ {
+ "checksum": "dd9dc72eea94d60996fb39083e2f571a",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-join_using_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-order_by]": [
+ {
+ "checksum": "954b1dcaefdc9411496e8647c9616078",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-order_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-string_escaping]": [
+ {
+ "checksum": "f45babb20d1652c8bef941a8398b74a4",
+ "size": 90,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-string_escaping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ansi_idents-struct_access]": [
+ {
+ "checksum": "beb349eba1f1bc1e3c2e5306efe77b20",
+ "size": 110,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ansi_idents-struct_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-arithmetic]": [
+ {
+ "checksum": "9733896aaffd0f29c69369ba53a83908",
+ "size": 7322,
+ "uri": "https://{canondata_backend}/1784117/72de9d096244671bdc282e3e67e222f7d47084f5/resource.tar.gz#test_sql_format.test_bigdate-arithmetic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-bitcast_date32]": [
+ {
+ "checksum": "c547a5b3cc24431ced0dba81baba08aa",
+ "size": 479,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-bitcast_date32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-bitcast_datetime64]": [
+ {
+ "checksum": "e7a04b9fd859abcc4e582facc61ebb4b",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-bitcast_datetime64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-bitcast_interval64]": [
+ {
+ "checksum": "45083cc249b88a863d5c16a3cd4c8492",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-bitcast_interval64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-bitcast_timestamp64]": [
+ {
+ "checksum": "9df89849d64152d6dcde8351f5e8796e",
+ "size": 469,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-bitcast_timestamp64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-common_type]": [
+ {
+ "checksum": "dfc058566588db3acebd798ad7f5f98f",
+ "size": 1984,
+ "uri": "https://{canondata_backend}/1923547/91e165b49d67277893eb98e5994de6b4d5dc4257/resource.tar.gz#test_sql_format.test_bigdate-common_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-compare_big_big]": [
+ {
+ "checksum": "9e80ea7c508beef620e68325d7527844",
+ "size": 1765,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-compare_big_big_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-compare_big_small]": [
+ {
+ "checksum": "9facea94b561fbe5f2c164349173b6c4",
+ "size": 4723,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-compare_big_small_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-compare_small_big]": [
+ {
+ "checksum": "ca4fdc457e42baa058e6e1c9d3e20525",
+ "size": 4723,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-compare_small_big_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-const_date32]": [
+ {
+ "checksum": "11ec20d3f9102fee840afe764dc23ea8",
+ "size": 822,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-const_date32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-const_datetime64]": [
+ {
+ "checksum": "3847c829487a0b7de3f5dd6d790eab8e",
+ "size": 1575,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-const_datetime64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-const_interval64]": [
+ {
+ "checksum": "e7dd6ec98f9c40479c554be2e26b7463",
+ "size": 2319,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-const_interval64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-const_timestamp64]": [
+ {
+ "checksum": "9160e633d0b251877fc96e8e487eee1c",
+ "size": 2691,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-const_timestamp64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-explicit_cast]": [
+ {
+ "checksum": "9fd1b3c8864e9a9ea7e387aa9c71236e",
+ "size": 4380,
+ "uri": "https://{canondata_backend}/1936842/075ec75430743a09755e535bdd2c75ed3cf10343/resource.tar.gz#test_sql_format.test_bigdate-explicit_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-implicit_cast_callable]": [
+ {
+ "checksum": "3f10bed29e82ba76c8912a8a6d8a224b",
+ "size": 1781,
+ "uri": "https://{canondata_backend}/1923547/0144d161cc1758b7e326b364d1adccd205140788/resource.tar.gz#test_sql_format.test_bigdate-implicit_cast_callable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-input_date32]": [
+ {
+ "checksum": "94eeb6ef70d2a30441c1d00a96597707",
+ "size": 1476,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-input_date32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-input_datetime64]": [
+ {
+ "checksum": "6eb858c045692b6c5de96c997af38c89",
+ "size": 3001,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-input_datetime64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-input_interval64]": [
+ {
+ "checksum": "42dd8d921420905497dc9b67a3e3188d",
+ "size": 3563,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-input_interval64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-input_timestamp64]": [
+ {
+ "checksum": "1857e9f544ea232be061b29d4b7174a6",
+ "size": 6418,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-input_timestamp64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-int_cast]": [
+ {
+ "checksum": "b12512f9192f26467234ad7e23219255",
+ "size": 3588,
+ "uri": "https://{canondata_backend}/1937027/ebeaea00085194d0f7e4d569c50db9fdab47c949/resource.tar.gz#test_sql_format.test_bigdate-int_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-int_literals]": [
+ {
+ "checksum": "d628067a58fa95a38b4752a0352bea27",
+ "size": 645,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-int_literals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-misc]": [
+ {
+ "checksum": "bcd8e9ab1caba43693f396e6d3098b12",
+ "size": 1860,
+ "uri": "https://{canondata_backend}/1775059/1402e338756949f8455a705ba03ea337ad1a575b/resource.tar.gz#test_sql_format.test_bigdate-misc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-output_date32]": [
+ {
+ "checksum": "ed56d56864b71dd5b9309cb0ca8e9792",
+ "size": 516,
+ "uri": "https://{canondata_backend}/937458/c3af15142702eefc3615e5d898a940130b60e95e/resource.tar.gz#test_sql_format.test_bigdate-output_date32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-output_datetime64]": [
+ {
+ "checksum": "455b0cac4cd53e43c3da7398f2e2e36e",
+ "size": 644,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-output_datetime64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-output_interval64]": [
+ {
+ "checksum": "b74e1c8c16541dc46be8da5e7284def1",
+ "size": 587,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-output_interval64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-output_timestamp64]": [
+ {
+ "checksum": "2c47d1bb320718ffffc2590827a64455",
+ "size": 657,
+ "uri": "https://{canondata_backend}/1781765/e3e717589d1a1c8f87c486a5acec032eb8d89dd3/resource.tar.gz#test_sql_format.test_bigdate-output_timestamp64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-presort]": [
+ {
+ "checksum": "973eacd700c6571a6a073a0e0fd5346b",
+ "size": 1347,
+ "uri": "https://{canondata_backend}/1942415/d17da694c5b566c267a123b241f489130b3f5d3c/resource.tar.gz#test_sql_format.test_bigdate-presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-round]": [
+ {
+ "checksum": "2b7723a614fac84b0ec293a4746e5d7c",
+ "size": 8777,
+ "uri": "https://{canondata_backend}/1784117/577228bd233395c85026f82442e2268ec7994ec0/resource.tar.gz#test_sql_format.test_bigdate-round_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_arithmetic]": [
+ {
+ "checksum": "16b7f5deb79fc68cd4390c85e4f21ca2",
+ "size": 578,
+ "uri": "https://{canondata_backend}/1781765/f46b05df4bb17dd1ec082c870bb4ecd16af4e932/resource.tar.gz#test_sql_format.test_bigdate-table_arithmetic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_arithmetic_mul_div]": [
+ {
+ "checksum": "813089067c1c6aeadad5208304b9f7b6",
+ "size": 1486,
+ "uri": "https://{canondata_backend}/1781765/f46b05df4bb17dd1ec082c870bb4ecd16af4e932/resource.tar.gz#test_sql_format.test_bigdate-table_arithmetic_mul_div_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_arithmetic_narrow]": [
+ {
+ "checksum": "68b995e26b2d1c52f5479a8c96608fc9",
+ "size": 1140,
+ "uri": "https://{canondata_backend}/1937367/de2d5168ea56c6d148f8a9afb9e8dde6299cc86e/resource.tar.gz#test_sql_format.test_bigdate-table_arithmetic_narrow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_arithmetic_sub]": [
+ {
+ "checksum": "58751e508d951d8528f213dc716bafc0",
+ "size": 392,
+ "uri": "https://{canondata_backend}/1937367/de2d5168ea56c6d148f8a9afb9e8dde6299cc86e/resource.tar.gz#test_sql_format.test_bigdate-table_arithmetic_sub_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_common_type]": [
+ {
+ "checksum": "06a1a0fc7aa0e1e53028d5062e0213ce",
+ "size": 510,
+ "uri": "https://{canondata_backend}/1781765/757a6ed1be1045d26422d71be3695145ab42cb49/resource.tar.gz#test_sql_format.test_bigdate-table_common_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_explicit_cast]": [
+ {
+ "checksum": "af1013de02ae94acb4e4b95b50a7a6d6",
+ "size": 1305,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql_format.test_bigdate-table_explicit_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_int_cast]": [
+ {
+ "checksum": "450d0267941f952ec62352e0e77c4307",
+ "size": 2040,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql_format.test_bigdate-table_int_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_io]": [
+ {
+ "checksum": "395d15e0b34ca7610c172ec6c7f232f3",
+ "size": 384,
+ "uri": "https://{canondata_backend}/1942671/84bd3f7d80a7ec30a2f4851da64d8ae4cd651719/resource.tar.gz#test_sql_format.test_bigdate-table_io_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_yt_key_filter]": [
+ {
+ "checksum": "c89d6c3426dffeb6758ff5d4726f3f5d",
+ "size": 3958,
+ "uri": "https://{canondata_backend}/1777230/9c6f872e0894439818988e4f0a8fe340184faee7/resource.tar.gz#test_sql_format.test_bigdate-table_yt_key_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-table_yt_native]": [
+ {
+ "checksum": "5d3db5e1fe04a2235a432f6b61868082",
+ "size": 332,
+ "uri": "https://{canondata_backend}/212715/99c394fc142b628d22e13d9433512bcac243f701/resource.tar.gz#test_sql_format.test_bigdate-table_yt_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tz_bytes]": [
+ {
+ "checksum": "5a0b823c7b16d3e21ede3a08905bba4e",
+ "size": 586,
+ "uri": "https://{canondata_backend}/1937367/fb7bc472ea97cce2f795f26ab64cf43ffb7e6852/resource.tar.gz#test_sql_format.test_bigdate-tz_bytes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tz_table_fill]": [
+ {
+ "checksum": "20f212ef1638e856376e77cdf9fdddc2",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1942525/a2cade528f847eb07daea7e9adb5e13c62cde3d8/resource.tar.gz#test_sql_format.test_bigdate-tz_table_fill_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tz_table_pull]": [
+ {
+ "checksum": "3cb90b688f7f35e4f9a4732e6d7dbf07",
+ "size": 57,
+ "uri": "https://{canondata_backend}/1847551/b9e12f01e97071b357913a106f1c0e7f12e755ca/resource.tar.gz#test_sql_format.test_bigdate-tz_table_pull_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tz_table_rw]": [
+ {
+ "checksum": "e45d87792987a8d981dc47be81936b4f",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1942525/a2cade528f847eb07daea7e9adb5e13c62cde3d8/resource.tar.gz#test_sql_format.test_bigdate-tz_table_rw_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tz_table_yt_key_filter]": [
+ {
+ "checksum": "3f924eef1e7c33edcc1c39a0e875b4b6",
+ "size": 2138,
+ "uri": "https://{canondata_backend}/1777230/9c6f872e0894439818988e4f0a8fe340184faee7/resource.tar.gz#test_sql_format.test_bigdate-tz_table_yt_key_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tzcasts]": [
+ {
+ "checksum": "540d58933a755b9baf2e00174ebc910c",
+ "size": 859,
+ "uri": "https://{canondata_backend}/1784826/652180d91e8319c62c5aacfb1321af23430ade4b/resource.tar.gz#test_sql_format.test_bigdate-tzcasts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tznumliterals]": [
+ {
+ "checksum": "fbc4caece751eb8481ca44a7b645d202",
+ "size": 2545,
+ "uri": "https://{canondata_backend}/1773845/723ba74c1f8fe2198e8eda94ad781fdefd785099/resource.tar.gz#test_sql_format.test_bigdate-tznumliterals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bigdate-tzstrliterals]": [
+ {
+ "checksum": "56ec4f62918cd7efb0abb2e69cf27cd9",
+ "size": 2150,
+ "uri": "https://{canondata_backend}/1773845/723ba74c1f8fe2198e8eda94ad781fdefd785099/resource.tar.gz#test_sql_format.test_bigdate-tzstrliterals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-anon_table_binding]": [
+ {
+ "checksum": "ddc6239e904f85705975d1ad9c0f92fd",
+ "size": 137,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-anon_table_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-bind_cast]": [
+ {
+ "checksum": "01f347bd11e15f0def86584d7bd178fa",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-bind_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-bind_select]": [
+ {
+ "checksum": "ff5c3df6ad35bb633df7c587b5d186b4",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-bind_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-compact_named_exprs]": [
+ {
+ "checksum": "35ad55137c3afe0b7dfb083f9366aaec",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1809005/b7945fe82426e7557a5cb23e4f8d7e62a7121d64/resource.tar.gz#test_sql_format.test_binding-compact_named_exprs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-compact_named_subq_actions]": [
+ {
+ "checksum": "5253022e37bb40f5af0cea746efa0ca4",
+ "size": 702,
+ "uri": "https://{canondata_backend}/1946324/346199389197bc9c043ccc12a40510ba4660b1a6/resource.tar.gz#test_sql_format.test_binding-compact_named_subq_actions_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-compact_named_with_subq_contexts]": [
+ {
+ "checksum": "28a94c7e37e622e7ce393d756783cfec",
+ "size": 397,
+ "uri": "https://{canondata_backend}/1942415/4d74b807c83c1e482d93f5dffd276eccf97421f9/resource.tar.gz#test_sql_format.test_binding-compact_named_with_subq_contexts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-drop_binding]": [
+ {
+ "checksum": "ff20392867ffcb2a7939c84caf8a1ba7",
+ "size": 138,
+ "uri": "https://{canondata_backend}/1773845/cfb7112152c07c41cbcd771075fa53a0fd1ef1b4/resource.tar.gz#test_sql_format.test_binding-drop_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-insert_binding]": [
+ {
+ "checksum": "6db1cd72c75e156e3f14fd948d93973b",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-insert_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-named_callable]": [
+ {
+ "checksum": "f48fc6a59b6b595c4f704921287948a0",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-named_callable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-named_expr_input]": [
+ {
+ "checksum": "11462d46883df99985438103169af453",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-named_expr_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-named_node_corr_names]": [
+ {
+ "checksum": "fd7b8b58ef15af9c801fbd12d3047e97",
+ "size": 199,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-named_node_corr_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_concat_binding]": [
+ {
+ "checksum": "23fdd2faf4a5fedbc3be17840c2479e4",
+ "size": 174,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_concat_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_concat_strict_binding]": [
+ {
+ "checksum": "20da2b26e414c519ec5517d570d84beb",
+ "size": 188,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_concat_strict_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_filter_binding]": [
+ {
+ "checksum": "ecc57fa281ae4bb83ed176ef2b22e120",
+ "size": 571,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_filter_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_filter_strict_binding]": [
+ {
+ "checksum": "432cafc4f9114f8dc0775bfccaa2c859",
+ "size": 608,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_filter_strict_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_from_binding]": [
+ {
+ "checksum": "2822f9d9e3c60542db8ff25975a896b2",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_from_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_from_binding_inferscheme]": [
+ {
+ "checksum": "7fa63bc19847374424e004dd0700b284",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_from_binding_inferscheme_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_range_binding]": [
+ {
+ "checksum": "8029b6265dcdc258516d3e60356125f7",
+ "size": 766,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_range_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_range_strict_binding]": [
+ {
+ "checksum": "987996e9a4d6e73b7e5e7ece19b92da3",
+ "size": 815,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_range_strict_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_regexp_binding]": [
+ {
+ "checksum": "bf4929856989ee28e03337d44ebcba22",
+ "size": 286,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_regexp_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-table_regexp_strict_binding]": [
+ {
+ "checksum": "d8b991491e21673943444a1b1ea3e5d3",
+ "size": 300,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-table_regexp_strict_binding_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-tie]": [
+ {
+ "checksum": "0bb49fd160870d82c2299e0b338f1237",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-tie_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-tie_bad_count_fail]": [
+ {
+ "checksum": "125159a3e530d2401300986a429badb1",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-tie_bad_count_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[binding-tie_scalar_context]": [
+ {
+ "checksum": "7ff3f6e5f71ea2f8f806e254b48a3699",
+ "size": 354,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_binding-tie_scalar_context_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bitcast_implicit-add_bitcast]": [
+ {
+ "checksum": "04325cd09a7c468fd0e02f5003b52625",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_bitcast_implicit-add_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bitcast_implicit-div_bitcast]": [
+ {
+ "checksum": "ad88681da601dd84ed4f82d0e274b84e",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_bitcast_implicit-div_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bitcast_implicit-mod_bitcast]": [
+ {
+ "checksum": "bab0c6295dcbccce19288b16b171beb2",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_bitcast_implicit-mod_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bitcast_implicit-mul_bitcast]": [
+ {
+ "checksum": "43110930af369cc41b87c59566346bcf",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_bitcast_implicit-mul_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[bitcast_implicit-sub_bitcast]": [
+ {
+ "checksum": "6d34f207b7be4554c68df39fea1b1900",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_bitcast_implicit-sub_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_decimal]": [
+ {
+ "checksum": "caeaea13a55ab18aaae27f6bf2606e16",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1900335/8af685f983ecf5996df52bc7dc7bb3d611a1566f/resource.tar.gz#test_sql_format.test_blocks-add_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_int16]": [
+ {
+ "checksum": "5210bc3844abe9126e017234871b2a94",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_int16_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_int32]": [
+ {
+ "checksum": "9fda11f0c9ef9b11e9ac0ea76f75b2ea",
+ "size": 77,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_int32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_int64]": [
+ {
+ "checksum": "3f83a74b95664e20ba37afecf0ee45ab",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_int64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_int8]": [
+ {
+ "checksum": "303109806f43b023bf61274f17d46da7",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_int8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint16]": [
+ {
+ "checksum": "82ca35a283ae6c1de454940642266d52",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint16_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint32]": [
+ {
+ "checksum": "18bff922a122f61ff7c519e91cd75b29",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint64]": [
+ {
+ "checksum": "acdc80aaf21c895e6305d9f98b799f21",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint64_opt2]": [
+ {
+ "checksum": "acdc80aaf21c895e6305d9f98b799f21",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint64_opt2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint64_opt]": [
+ {
+ "checksum": "acdc80aaf21c895e6305d9f98b799f21",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint64_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-add_uint8]": [
+ {
+ "checksum": "3c449b2a6e83b3cad8bb8b4ec151b89a",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-add_uint8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-bitcast_block]": [
+ {
+ "checksum": "2d428557c2f3d0ebff7285006c4f26ce",
+ "size": 44,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-bitcast_block_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-bitcast_scalar]": [
+ {
+ "checksum": "c2d3b6bffff946e75c6e202674dd3623",
+ "size": 44,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-bitcast_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-block_input]": [
+ {
+ "checksum": "93b9d3952da87a0e3c4e9bfc8eac56e0",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1916746/5f2f0160368a9941e5c2a4f26544ec2ad584dc00/resource.tar.gz#test_sql_format.test_blocks-block_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-block_input_sys_columns]": [
+ {
+ "checksum": "0ad7ef4ec663eb32830c69d3b85e0c13",
+ "size": 597,
+ "uri": "https://{canondata_backend}/1599023/85abe49b40cf536aae38f22fd9096a110453232d/resource.tar.gz#test_sql_format.test_blocks-block_input_sys_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-block_input_various_types]": [
+ {
+ "checksum": "d63e026fe9510553a3a84e7b6a1c3215",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1916746/5f2f0160368a9941e5c2a4f26544ec2ad584dc00/resource.tar.gz#test_sql_format.test_blocks-block_input_various_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-boolean_ops]": [
+ {
+ "checksum": "4ead3cb1f2fd6377a62c95e1d2c91ac9",
+ "size": 488,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-boolean_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-coalesce_bools]": [
+ {
+ "checksum": "2f67677b576babbab2437a95dfd834c4",
+ "size": 245,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-coalesce_bools_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-coalesce_complex]": [
+ {
+ "checksum": "2bb2e0667daa24dae95ac9eae0c42ef6",
+ "size": 959,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-coalesce_complex_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-coalesce_ints]": [
+ {
+ "checksum": "565bef16edc6c0f148d5678bd59041d2",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-coalesce_ints_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_avg]": [
+ {
+ "checksum": "e42eff0d306325af3940461ac4e960a3",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_avg_filter]": [
+ {
+ "checksum": "4545fbd4f2d17f64636ce7cf82295d9b",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_avg_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_avg_filter_opt]": [
+ {
+ "checksum": "4545fbd4f2d17f64636ce7cf82295d9b",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_avg_filter_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_count]": [
+ {
+ "checksum": "0707f9d964116ff5f6f776ace8f2fa4d",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_count_filter]": [
+ {
+ "checksum": "93f14108b17582cfa722c3f8aa6ac8b2",
+ "size": 78,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_count_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_count_filter_opt]": [
+ {
+ "checksum": "93f14108b17582cfa722c3f8aa6ac8b2",
+ "size": 78,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_count_filter_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_decimal]": [
+ {
+ "checksum": "04545fcefe37c88291831c68b1af9016",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1689644/bebe9ff4f61a19b42469a2d8a15dc9603a6ce7d5/resource.tar.gz#test_sql_format.test_blocks-combine_all_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_decimal_max]": [
+ {
+ "checksum": "cc05542eb7dd01b70af82d41df5e21e9",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1942100/df0cf5f44e4a847c8c10b5a97f5a8900aa2ae5b4/resource.tar.gz#test_sql_format.test_blocks-combine_all_decimal_max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_max]": [
+ {
+ "checksum": "09feb94b391372d4fb0b275f6ae5efa4",
+ "size": 390,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_max_filter]": [
+ {
+ "checksum": "cd71843862c2b2821e5b92954abdd7d3",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_max_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_max_filter_opt]": [
+ {
+ "checksum": "cd71843862c2b2821e5b92954abdd7d3",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_max_filter_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_min]": [
+ {
+ "checksum": "9a0424c74fe79d2c6031714639f781b1",
+ "size": 390,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_min_filter]": [
+ {
+ "checksum": "12d5ab55cdcf9274022e2ef1cebdfecb",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_min_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_min_filter_opt]": [
+ {
+ "checksum": "12d5ab55cdcf9274022e2ef1cebdfecb",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_min_filter_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_minmax_double]": [
+ {
+ "checksum": "ee93325584e478b0b331180d9091ea9f",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_minmax_double_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_minmax_nested]": [
+ {
+ "checksum": "793569387568e191d917c08184367c9b",
+ "size": 63,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_minmax_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_pg]": [
+ {
+ "checksum": "ffb269ecaae00607b5b5842871ff017f",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_pg_filter]": [
+ {
+ "checksum": "c7ea89d08a607efeac951779a55b4b3d",
+ "size": 230,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_pg_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_some]": [
+ {
+ "checksum": "ec8b2b75c65ef0396cdc9101935338c1",
+ "size": 405,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_some_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_some_filter]": [
+ {
+ "checksum": "4fb93004ade02e407f1563067ba1a4bc",
+ "size": 63,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_some_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_sum]": [
+ {
+ "checksum": "65bacfc84483123819cd34045309deb6",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_sum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_sum_filter]": [
+ {
+ "checksum": "8e700b15373d9b30d6a8b255b9052857",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_sum_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_all_sum_filter_opt]": [
+ {
+ "checksum": "12d5ab55cdcf9274022e2ef1cebdfecb",
+ "size": 62,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_all_sum_filter_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_avg]": [
+ {
+ "checksum": "33bb4e8f2d1a4ffda57d6afd7fc5e1ae",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_count]": [
+ {
+ "checksum": "1c6d64cf120c828bf648241c8aeadd6a",
+ "size": 172,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_count_filter]": [
+ {
+ "checksum": "65875643a32b920a96f3c9b25cf2ef2c",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_count_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_max]": [
+ {
+ "checksum": "717a50dd98ffae5fd73c4e2ee6832f3c",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_max_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_min]": [
+ {
+ "checksum": "6ff6e81d6d8559e862bedc262483f64f",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_min_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_minmax_double]": [
+ {
+ "checksum": "eeb77812370f00c4936c71971328fcc9",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_minmax_double_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_minmax_nested]": [
+ {
+ "checksum": "202e595a73bc2a0fb866f2aeada31348",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_minmax_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_pg]": [
+ {
+ "checksum": "a6e8d359d19b18883fff1ca7387e3c2f",
+ "size": 366,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_set]": [
+ {
+ "checksum": "989d3f3aa051dc23f6b6cefe56fb8775",
+ "size": 73,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_set_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_some]": [
+ {
+ "checksum": "d5df0aa69d36aefbb9b4bdfb22e4a257",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_some_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_sum]": [
+ {
+ "checksum": "894f59935e62902286f412892f293c7d",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_sum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-combine_hashed_sum_many_keys]": [
+ {
+ "checksum": "cc23a2c1d47c558c182b6abce87685ec",
+ "size": 811,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-combine_hashed_sum_many_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-compare]": [
+ {
+ "checksum": "d6a8ad96cb7f79d8e55f3e28ef40fbb2",
+ "size": 357,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-compare_dates_floats_bools]": [
+ {
+ "checksum": "33c380b1c46a6cdc59058be8c920d2b1",
+ "size": 872,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-compare_dates_floats_bools_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-complex_scalars]": [
+ {
+ "checksum": "fb655b4815d78f133bc61b6837951d7d",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-complex_scalars_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_add_interval]": [
+ {
+ "checksum": "82ba1141d055c5202afa3aaea82b4daa",
+ "size": 486,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql_format.test_blocks-date_add_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_add_interval_scalar]": [
+ {
+ "checksum": "4761e18b6e42122a4141d282a8af3c27",
+ "size": 2014,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql_format.test_blocks-date_add_interval_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_equals]": [
+ {
+ "checksum": "8cfc4551417218a0fffe79edf64ee200",
+ "size": 3040,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_equals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_equals_scalar]": [
+ {
+ "checksum": "73dcaadc788a4a23e4a66c1c150e4c46",
+ "size": 15162,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_equals_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_greater]": [
+ {
+ "checksum": "db38e4caaa6dca1a477ba712c087a8fd",
+ "size": 2892,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_greater_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_greater_or_equal]": [
+ {
+ "checksum": "8b173c2c751e50b4f41d1666200ec1f4",
+ "size": 3040,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_greater_or_equal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_greater_or_equal_scalar]": [
+ {
+ "checksum": "9021d76c5bf35e397d511ecab80fb982",
+ "size": 15162,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_greater_or_equal_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_greater_scalar]": [
+ {
+ "checksum": "78fb638516d271f90c62e9ef90370340",
+ "size": 14866,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_greater_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_group_by]": [
+ {
+ "checksum": "35ce3ab0b85192fb8f19f7c526312e92",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_less]": [
+ {
+ "checksum": "c3fd386fa2139d2afc72e63bdc3eb082",
+ "size": 2892,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_less_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_less_or_equal]": [
+ {
+ "checksum": "c4e4960b5fa9e638ad7bd78e13d657e4",
+ "size": 3040,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_less_or_equal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_less_or_equal_scalar]": [
+ {
+ "checksum": "b4c83873e6c2c00109ac45c881d6a08d",
+ "size": 15162,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_less_or_equal_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_less_scalar]": [
+ {
+ "checksum": "181edb6282f7bb1ac578d774d752f043",
+ "size": 14866,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_less_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_not_equals]": [
+ {
+ "checksum": "90f266ec40a3184d4f434ef76f520941",
+ "size": 3040,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_not_equals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_not_equals_scalar]": [
+ {
+ "checksum": "3f9c527e5ed03f556defc33ae814c8de",
+ "size": 15162,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_not_equals_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_sub]": [
+ {
+ "checksum": "19d46c7e9efbde5a3b0fae1da8929884",
+ "size": 2825,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql_format.test_blocks-date_sub_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_sub_interval]": [
+ {
+ "checksum": "367f2774dfbc3755230e9e4b3f60e54d",
+ "size": 485,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql_format.test_blocks-date_sub_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_sub_interval_scalar]": [
+ {
+ "checksum": "aa10ac59472dcc01567eac217a89c60a",
+ "size": 2014,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql_format.test_blocks-date_sub_interval_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_sub_scalar]": [
+ {
+ "checksum": "3cb54c18bdd42485b475415aaaacc814",
+ "size": 14650,
+ "uri": "https://{canondata_backend}/1917492/87646e70c8da604f6060735f71bc3c8019f30219/resource.tar.gz#test_sql_format.test_blocks-date_sub_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-date_top_sort]": [
+ {
+ "checksum": "e1ea4474a00a88966064496c3b2235a4",
+ "size": 272,
+ "uri": "https://{canondata_backend}/1942100/4770669c24007543908dd55606255f269883b26e/resource.tar.gz#test_sql_format.test_blocks-date_top_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_avg]": [
+ {
+ "checksum": "d077a59363e93c9cf3548b776b93e316",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1775319/1580c5e8e4c110f53c15179e596f8942460372c9/resource.tar.gz#test_sql_format.test_blocks-decimal_avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_comparison]": [
+ {
+ "checksum": "95016b817141a7fbfd888700217463bc",
+ "size": 751,
+ "uri": "https://{canondata_backend}/1923547/4867af26e59d2b50038b167d59c2026bb3dd66b3/resource.tar.gz#test_sql_format.test_blocks-decimal_comparison_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_multiplicative_ops]": [
+ {
+ "checksum": "f4b2f2415f8d28cf8dc9928051ea1225",
+ "size": 928,
+ "uri": "https://{canondata_backend}/1871102/1470a32d3748cb0cfff107460df835fb687c5954/resource.tar.gz#test_sql_format.test_blocks-decimal_multiplicative_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_op_decimal]": [
+ {
+ "checksum": "078fae170f284e83ac9c9c64fc31c788",
+ "size": 103,
+ "uri": "https://{canondata_backend}/1916746/24ebd7e8cc87e236525be92f05f3986e32fcda57/resource.tar.gz#test_sql_format.test_blocks-decimal_op_decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_op_decimal_scalar]": [
+ {
+ "checksum": "0ec1c6e98cc89760607a2c8475de8304",
+ "size": 517,
+ "uri": "https://{canondata_backend}/1916746/24ebd7e8cc87e236525be92f05f3986e32fcda57/resource.tar.gz#test_sql_format.test_blocks-decimal_op_decimal_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-decimal_unary]": [
+ {
+ "checksum": "39c91354e139d6f6125a1291a75ba269",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1775319/787a3a5920e3b54b1be55e16dd1267b5dff04052/resource.tar.gz#test_sql_format.test_blocks-decimal_unary_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_mixed_all]": [
+ {
+ "checksum": "97c994cd539ad7338eccbf32126c0e46",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_mixed_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_mixed_keys]": [
+ {
+ "checksum": "051b29b99684e4dfbaa3a13d4bdcedfa",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_mixed_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_opt_state_all]": [
+ {
+ "checksum": "3a3003c486a60dbd5ebb68d0bb4b8927",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_opt_state_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_opt_state_keys]": [
+ {
+ "checksum": "7d17e52b53bbad52ffb35c14bd0f13d7",
+ "size": 263,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_opt_state_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_pure_all]": [
+ {
+ "checksum": "ade9235ebec80ffa4b94e55447332ccd",
+ "size": 128,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_pure_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-distinct_pure_keys]": [
+ {
+ "checksum": "f604d8d2636b0b94cf0f1631939b5e4d",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-distinct_pure_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-div_uint64]": [
+ {
+ "checksum": "57d0262bef00abc7a393cd497caf6127",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-div_uint64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-div_uint64_opt2]": [
+ {
+ "checksum": "57d0262bef00abc7a393cd497caf6127",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-div_uint64_opt2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-exists]": [
+ {
+ "checksum": "133a164bbcf35cfd0383f16ff5c1516d",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-exists_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-filter_by_column_with_drop]": [
+ {
+ "checksum": "933727dd023a7a37c22aa0ce64ba560c",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-filter_by_column_with_drop_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-filter_direct_col]": [
+ {
+ "checksum": "cef48664ca27efdafe923942186bc9f9",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-filter_direct_col_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-filter_expr]": [
+ {
+ "checksum": "83d54f6cbda66cde57a279f7e895218b",
+ "size": 78,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-filter_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-filter_partial_expr]": [
+ {
+ "checksum": "d63630fbb0e94ade9d595e80128ac23a",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-filter_partial_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-finalize_hashed_keys]": [
+ {
+ "checksum": "ee48459a32ccb2fc92828a388e31bb72",
+ "size": 226,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-finalize_hashed_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-group_by_complex_key]": [
+ {
+ "checksum": "a10813e7e696c9f2782e65a2ec5ca2e7",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-group_by_complex_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-if]": [
+ {
+ "checksum": "750cb4956f4dab4d5754b8ac731424a0",
+ "size": 513,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_add_date]": [
+ {
+ "checksum": "0ba4a0b15f005e679a83d7f0f9811fd7",
+ "size": 485,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql_format.test_blocks-interval_add_date_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_add_date_scalar]": [
+ {
+ "checksum": "5b7bf45f855add333e3c8261a2020209",
+ "size": 2015,
+ "uri": "https://{canondata_backend}/937458/9d0c95cc0be4a469b595498b4aaa7f9d488b6498/resource.tar.gz#test_sql_format.test_blocks-interval_add_date_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_add_interval]": [
+ {
+ "checksum": "e68cb8c03b7d641df2e298a0ead94f09",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1599023/f54b29c5a8b4a7f18761235bdf0749f302b7270c/resource.tar.gz#test_sql_format.test_blocks-interval_add_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_add_interval_scalar]": [
+ {
+ "checksum": "d0627d1e835eabee878075d4c857f1b8",
+ "size": 265,
+ "uri": "https://{canondata_backend}/1599023/f54b29c5a8b4a7f18761235bdf0749f302b7270c/resource.tar.gz#test_sql_format.test_blocks-interval_add_interval_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_div]": [
+ {
+ "checksum": "2713454ed531768a0872f4b8d9b1966e",
+ "size": 350,
+ "uri": "https://{canondata_backend}/1903885/2cd3d738babe2170bad9a741a60d5621859e66ca/resource.tar.gz#test_sql_format.test_blocks-interval_div_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_div_scalar]": [
+ {
+ "checksum": "1a68544fbd5377b92ba80efb1e9b213e",
+ "size": 850,
+ "uri": "https://{canondata_backend}/1903885/2cd3d738babe2170bad9a741a60d5621859e66ca/resource.tar.gz#test_sql_format.test_blocks-interval_div_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_mul]": [
+ {
+ "checksum": "ccd62623fb3eeef40b53e44850ffc5ac",
+ "size": 689,
+ "uri": "https://{canondata_backend}/1925821/70f265137d33c6e478e9e61e055b469332dd9b70/resource.tar.gz#test_sql_format.test_blocks-interval_mul_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_mul_scalar]": [
+ {
+ "checksum": "a5ee416166ed6a00ce8b218df649c19c",
+ "size": 1688,
+ "uri": "https://{canondata_backend}/1925821/70f265137d33c6e478e9e61e055b469332dd9b70/resource.tar.gz#test_sql_format.test_blocks-interval_mul_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_sub_interval]": [
+ {
+ "checksum": "ff1fff3fdaeeb1254c55e39523ebe33c",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1775319/aad0c11816cec8971c5571f0c536af10c4645fe1/resource.tar.gz#test_sql_format.test_blocks-interval_sub_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-interval_sub_interval_scalar]": [
+ {
+ "checksum": "5c2d2960a5a1da9476d2fe20fecd32fb",
+ "size": 265,
+ "uri": "https://{canondata_backend}/1775319/aad0c11816cec8971c5571f0c536af10c4645fe1/resource.tar.gz#test_sql_format.test_blocks-interval_sub_interval_scalar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-json_document_type]": [
+ {
+ "checksum": "46355e9a6e40e1d01251c75de1eec97d",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1937492/94e2daa8efa14ce33e27554fc2ddf0ebb7981acd/resource.tar.gz#test_sql_format.test_blocks-json_document_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-lazy_nonstrict_basic]": [
+ {
+ "checksum": "83ffd180a540053f957e0fb9f5585578",
+ "size": 615,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-lazy_nonstrict_basic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-lazy_nonstrict_nested]": [
+ {
+ "checksum": "ca66a42aede97b07826bd6ffbf02dd88",
+ "size": 203,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-lazy_nonstrict_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-lazy_nonstrict_with_scalar_ctx]": [
+ {
+ "checksum": "975173acd379d0fcf7a5302b94783e38",
+ "size": 431,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-lazy_nonstrict_with_scalar_ctx_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-member]": [
+ {
+ "checksum": "d3b3617cad0f15f37aec6420a1402bd0",
+ "size": 282,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-minmax_strings]": [
+ {
+ "checksum": "65d9b2a72fd1baa279126dca6c5abe13",
+ "size": 362,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-minmax_strings_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-minmax_strings_filter]": [
+ {
+ "checksum": "5a15b468672373fecf16e1401ac51228",
+ "size": 263,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-minmax_strings_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-minmax_tuple]": [
+ {
+ "checksum": "d22bd20b222fd2999ebb0fc1e2e759da",
+ "size": 306,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-minmax_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-mod_uint64]": [
+ {
+ "checksum": "0a03f4c5d577317618e2e2ed2e148026",
+ "size": 83,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-mod_uint64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-mod_uint64_opt2]": [
+ {
+ "checksum": "0a03f4c5d577317618e2e2ed2e148026",
+ "size": 83,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-mod_uint64_opt2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-mul_uint64_opt2]": [
+ {
+ "checksum": "a3d8c12ab99d93a8d6238c3a4d141cfc",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-mul_uint64_opt2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-nested_optionals]": [
+ {
+ "checksum": "4ba78b05c87d6dd256f84a3a8798337b",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-nested_optionals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-not]": [
+ {
+ "checksum": "7b49dc30ef3d18087ee81c8b0b27f83c",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-not_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-not_opt]": [
+ {
+ "checksum": "7b49dc30ef3d18087ee81c8b0b27f83c",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-not_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-partial_blocks1]": [
+ {
+ "checksum": "ea43ac0b3f43476f224d5aa05d0a2d25",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-partial_blocks1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg]": [
+ {
+ "checksum": "feabe8f08c2f073f0a1612f978bf0f77",
+ "size": 70,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_call]": [
+ {
+ "checksum": "28843c0fa81f9759b18f7288bbcd5e19",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_call_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_from_dates]": [
+ {
+ "checksum": "5fc463d756146b47cc8f24cb82eeb588",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_from_dates_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_sort]": [
+ {
+ "checksum": "b18e0cfb7cbf8a12ed120442d2af626a",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_to_dates]": [
+ {
+ "checksum": "6278640e14c6b53605ee57152f528896",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_to_dates_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_to_interval]": [
+ {
+ "checksum": "6d6327427adf9ba8beb08be806c2e786",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_to_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_to_numbers]": [
+ {
+ "checksum": "70d6df31c5bddaa816f493e80d09f7d1",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_to_numbers_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_to_strings]": [
+ {
+ "checksum": "fe29d8bbd4c05eddc44844f109c494ed",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_to_strings_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_tofrom]": [
+ {
+ "checksum": "7f9cfe52b83e176ce68b970535b1c3df",
+ "size": 127,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_tofrom_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-pg_top_sort]": [
+ {
+ "checksum": "a0c4b9cf83bfeb629d2122ad053e0f20",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-pg_top_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sort_one_asc]": [
+ {
+ "checksum": "34513c20ae23e3953f89290e55a9df61",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sort_one_asc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sort_one_desc]": [
+ {
+ "checksum": "37e0a58ac7808852c9657b463445d059",
+ "size": 134,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sort_one_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sort_two_asc]": [
+ {
+ "checksum": "fd629ab2622aeeebc90f60f31fe08479",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sort_two_asc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sort_two_desc]": [
+ {
+ "checksum": "99bab0c571814300bdca563f442297d5",
+ "size": 157,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sort_two_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sort_two_mix]": [
+ {
+ "checksum": "0f4c40134d62733bdecf8fe691d92937",
+ "size": 156,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sort_two_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-string_as_agg_key]": [
+ {
+ "checksum": "4d5b188e894fcf1e4ab5a05ca40c3dd0",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-string_as_agg_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-string_filter]": [
+ {
+ "checksum": "041d8d879ca36100784d9622ff1ea958",
+ "size": 118,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-string_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-string_len_and_cmp]": [
+ {
+ "checksum": "4fb8af0947a5d02119a6477eafdcfb08",
+ "size": 704,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-string_len_and_cmp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-string_pass]": [
+ {
+ "checksum": "8ac6939cd802874715c77cda06f9df39",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-string_pass_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-string_with]": [
+ {
+ "checksum": "ea5150ee381616eb926e0b61db5ad3aa",
+ "size": 486,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-string_with_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-struct_type]": [
+ {
+ "checksum": "46355e9a6e40e1d01251c75de1eec97d",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-struct_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-sub_uint64_opt2]": [
+ {
+ "checksum": "87ca90c10305d9c882987aeac729c7db",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-sub_uint64_opt2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-top_sort_one_asc]": [
+ {
+ "checksum": "c6cbbeaa823ae2a4856d14aace23faf7",
+ "size": 137,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-top_sort_one_asc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-top_sort_one_desc]": [
+ {
+ "checksum": "bb2abaf83437d148686b310ef71aab34",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-top_sort_one_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-top_sort_two_asc]": [
+ {
+ "checksum": "7026162a79ad04d9856dd96cf4791e3f",
+ "size": 155,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-top_sort_two_asc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-top_sort_two_desc]": [
+ {
+ "checksum": "ecaa4ca85763808207aadc840a7061c8",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-top_sort_two_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-top_sort_two_mix]": [
+ {
+ "checksum": "717088c75d9054ab345c18264da2ec03",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-top_sort_two_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-tuple_nth]": [
+ {
+ "checksum": "c05bd5d2ded5f9eb1f082f6210fb7b4b",
+ "size": 381,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-tuple_nth_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-tuple_type]": [
+ {
+ "checksum": "3a2c9de5967df6194173f04d3cede412",
+ "size": 69,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_blocks-tuple_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[blocks-type_and_callable_stats]": [
+ {
+ "checksum": "0c26e93da59abd323c566a60d42be7c6",
+ "size": 401,
+ "uri": "https://{canondata_backend}/1937424/7dd37eb1e9f9f10e476a8c866a4f6d9d8a2ae8d2/resource.tar.gz#test_sql_format.test_blocks-type_and_callable_stats_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_many_val]": [
+ {
+ "checksum": "b47f8a0a4b6bdb400396d301c9371805",
+ "size": 3770,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_many_val_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_multi_val]": [
+ {
+ "checksum": "f42d12c3a6096326762439b7ceaa081a",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_multi_val_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_opt_cond]": [
+ {
+ "checksum": "c924053b32348c3e851c9fd187f8dd17",
+ "size": 312,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_opt_cond_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_opt_then]": [
+ {
+ "checksum": "bd2a50ff535b828c7a5ae86f9d18c970",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_opt_then_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_size_eq_cast]": [
+ {
+ "checksum": "7b2d99f51a004e7e3e1263b638c429b1",
+ "size": 161,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_size_eq_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_then_else]": [
+ {
+ "checksum": "25309ed9fe4cff30227f2813c546c374",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_then_else_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_val_then_else]": [
+ {
+ "checksum": "ddcf1987c68d0654b416c942b3ffb043",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_val_then_else_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_val_when_then]": [
+ {
+ "checksum": "64acafce8b1f459896964e3238cbce8a",
+ "size": 140,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_val_when_then_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[case-case_when_then]": [
+ {
+ "checksum": "38dd2d487113f6f1b277ae0d06eb8f81",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_case-case_when_then_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[coalesce-coalesce]": [
+ {
+ "checksum": "5608a6ff9e57ee944aff4cbb84193a20",
+ "size": 63,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_coalesce-coalesce_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[coalesce-coalesce_few_opt]": [
+ {
+ "checksum": "92b9ad61b52b889a8450e222efa86477",
+ "size": 906,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_coalesce-coalesce_few_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[coalesce-coalesce_few_real]": [
+ {
+ "checksum": "f98732055dad17fb7c7a52bc24c3dbb4",
+ "size": 602,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_coalesce-coalesce_few_real_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[coalesce-coalesce_sugar]": [
+ {
+ "checksum": "abd1d77b2261f5a9f69575af540c6514",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_coalesce-coalesce_sugar_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[coalesce-coalesce_symmetry]": [
+ {
+ "checksum": "53d1de34959b3dfb9b6cfe1194b16bf2",
+ "size": 275,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_coalesce-coalesce_symmetry_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-groups]": [
+ {
+ "checksum": "24da8c512f9d696564f7b4f2c760c3dc",
+ "size": 160,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql_format.test_column_group-groups_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint]": [
+ {
+ "checksum": "450488532da6b5625887973fc27a6286",
+ "size": 1099,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_anon]": [
+ {
+ "checksum": "0a7f14733fa0206794e5c41780561323",
+ "size": 230,
+ "uri": "https://{canondata_backend}/1942525/2065de9dd4b18a7276f6c5d85e09a5754c9a2fd8/resource.tar.gz#test_sql_format.test_column_group-hint_anon_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_anon_groups]": [
+ {
+ "checksum": "554c312c9220887717b03eb9a4392cb3",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1942525/2065de9dd4b18a7276f6c5d85e09a5754c9a2fd8/resource.tar.gz#test_sql_format.test_column_group-hint_anon_groups_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_append_fail]": [
+ {
+ "checksum": "d8756aff7c76d47d50affb769ec2cd4c",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_append_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_diff_grp_fail]": [
+ {
+ "checksum": "f744b62377a234b3917a499ce855e287",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_diff_grp_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_dup_col_fail]": [
+ {
+ "checksum": "9369794c75b7ff64b291feba43b27a70",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_dup_col_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_dup_def_fail]": [
+ {
+ "checksum": "1a4e614d1a3fb52812858f2d0ac3a2c8",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_dup_def_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_empty_grp_fail]": [
+ {
+ "checksum": "a941488bc5b6cea4b2973d4b34f42265",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_empty_grp_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_non_lst_yson_fail]": [
+ {
+ "checksum": "76c3ad2040c49953fd0b04350957f428",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_non_lst_yson_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_non_map_yson_fail]": [
+ {
+ "checksum": "33199477b1b4f4f065f10edfce9d1dca",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_non_map_yson_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_non_str_yson_fail]": [
+ {
+ "checksum": "d960e27fbf3ca9ec95078dd4ce11c9cb",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_non_str_yson_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_non_yson_fail]": [
+ {
+ "checksum": "e31dfcc94cc41d84c70f07adc68a8e82",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_non_yson_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_short_grp_fail]": [
+ {
+ "checksum": "35b466f65b9494f1e9b06ea0439b4e00",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_short_grp_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-hint_unk_col_fail]": [
+ {
+ "checksum": "d9765e8b9d22f9213e45d46ac63a77d7",
+ "size": 120,
+ "uri": "https://{canondata_backend}/1937027/bbc35c51807ca32a384973d8a730422ad871c54c/resource.tar.gz#test_sql_format.test_column_group-hint_unk_col_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-insert_diff_groups1_fail]": [
+ {
+ "checksum": "f354a922ac63e9db47f95ce2f5b17187",
+ "size": 295,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql_format.test_column_group-insert_diff_groups1_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-insert_diff_groups2_fail]": [
+ {
+ "checksum": "995593fbae18a399f478e76bd83b364a",
+ "size": 303,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql_format.test_column_group-insert_diff_groups2_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-insert_diff_groups3_fail]": [
+ {
+ "checksum": "887f458985d36504bae92614369477d0",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1942415/9610360ced2221ce66696bd9f6afd9579e452c44/resource.tar.gz#test_sql_format.test_column_group-insert_diff_groups3_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-length]": [
+ {
+ "checksum": "cb4ec24b2d30f9c92951f9a66c928ccb",
+ "size": 190,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql_format.test_column_group-length_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-many_inserts]": [
+ {
+ "checksum": "8746bbe05d09032f66ca0d3aef4ed60b",
+ "size": 675,
+ "uri": "https://{canondata_backend}/1871002/424fbf9b3e2a5083fa1289e0777dbe9463d049d9/resource.tar.gz#test_sql_format.test_column_group-many_inserts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-min_group]": [
+ {
+ "checksum": "b3461fe4fcc74722ddebbf253269167d",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql_format.test_column_group-min_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_group-publish]": [
+ {
+ "checksum": "31289fa0c065757a9a9627837c0a9838",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1889210/67cf90fc754bd2827f5984f7117f49bafa86ef30/resource.tar.gz#test_sql_format.test_column_group-publish_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-align_publish]": [
+ {
+ "checksum": "00611506524c0b9d27887fdda8db0a99",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-align_publish_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-align_publish_native]": [
+ {
+ "checksum": "9999bfe34737a60e00700aad6c56ba94",
+ "size": 324,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-align_publish_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert]": [
+ {
+ "checksum": "d3d9912afa60d329bb37f97bce70dff2",
+ "size": 586,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-insert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert_reorder_without_columnorder]": [
+ {
+ "checksum": "e0526a3060fc6b9c9a2d0c295066f135",
+ "size": 223,
+ "uri": "https://{canondata_backend}/1923547/0aba22156762a55d9c7578c76fffd5395d319f8b/resource.tar.gz#test_sql_format.test_column_order-insert_reorder_without_columnorder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert_tmp]": [
+ {
+ "checksum": "ce56494a4e05ac5ccd812e10665c7541",
+ "size": 444,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-insert_tmp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert_with_desc_sort_and_native_types]": [
+ {
+ "checksum": "bb569d72617ca1eca0d816719abd2ead",
+ "size": 237,
+ "uri": "https://{canondata_backend}/1880306/893b2c78723f6b7c52ee7229c86eeec5f8966116/resource.tar.gz#test_sql_format.test_column_order-insert_with_desc_sort_and_native_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert_with_new_cols]": [
+ {
+ "checksum": "b0b1111a95bf5c0708047417bb032dec",
+ "size": 229,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-insert_with_new_cols_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-insert_with_reorder_cols]": [
+ {
+ "checksum": "18e0428a5770ed6a03eedef02d741a5f",
+ "size": 320,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-insert_with_reorder_cols_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-join]": [
+ {
+ "checksum": "badee8c5ab93ba3b1d8700dd6488cd92",
+ "size": 432,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-join_nosimple]": [
+ {
+ "checksum": "8c218764e1bc94ce9715a752855e639e",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-join_nosimple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-ordered_plus_native]": [
+ {
+ "checksum": "e5977447b1651ce0beacd72a741a85e5",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-ordered_plus_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_action]": [
+ {
+ "checksum": "3561f4d7d1a398930ec7d701af30f230",
+ "size": 215,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_action_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_distinct_star]": [
+ {
+ "checksum": "fbc4f16a3be7acecbc0fba94b7fe4de2",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_distinct_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_groupby_with_star]": [
+ {
+ "checksum": "cb3f8ae334596741e0b532a5be9aa986",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_groupby_with_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_limit_offset]": [
+ {
+ "checksum": "1ca5b3b9c1c757ec2675ddd13734c675",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_limit_offset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_limit_offset_reorder]": [
+ {
+ "checksum": "f5610d5790b4465d3287fe21d87c120a",
+ "size": 219,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_limit_offset_reorder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_orderby]": [
+ {
+ "checksum": "275ec9ef507fb97c301504029ad21104",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_orderby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_plain]": [
+ {
+ "checksum": "1b9283bf2f72105164a18555be9e1020",
+ "size": 571,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_plain_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_plain_nosimple]": [
+ {
+ "checksum": "5228a403a221791ac9cb6cde71d075d3",
+ "size": 472,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_plain_nosimple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_sample]": [
+ {
+ "checksum": "84db970e86aeae872eb75b5f1749cbc2",
+ "size": 139,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_subquery]": [
+ {
+ "checksum": "35f0428e112e07ba2410e70681f8d326",
+ "size": 247,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_where]": [
+ {
+ "checksum": "240450d32995bc0820d9ed82821877b1",
+ "size": 123,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-select_win_func]": [
+ {
+ "checksum": "3052388a6d5257451f916a4b67e2316c",
+ "size": 307,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-select_win_func_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-union_all]": [
+ {
+ "checksum": "2870d8f190f620fdf7503ea05b2d85b9",
+ "size": 292,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-union_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-union_all_positional]": [
+ {
+ "checksum": "6458a55698a9c9f606183f95cb154335",
+ "size": 239,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-union_all_positional_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-union_all_positional_columns_count_fail]": [
+ {
+ "checksum": "e24a6677a821ea10fa37dd0fb524a188",
+ "size": 156,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-union_all_positional_columns_count_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-union_all_positional_unordered_fail]": [
+ {
+ "checksum": "afcba43bbd7e3b2b3c8a833acf58e947",
+ "size": 177,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-union_all_positional_unordered_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-values]": [
+ {
+ "checksum": "32144de896ef4b849d030f1a9a85b74e",
+ "size": 397,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-values_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[column_order-winfunc]": [
+ {
+ "checksum": "69ec3b2e1ab03fcfaae98de9788b3e4a",
+ "size": 236,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_column_order-winfunc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-adjacent_to_point]": [
+ {
+ "checksum": "2ae1239a2b82e45153dd62878fbd761a",
+ "size": 3023,
+ "uri": "https://{canondata_backend}/1871102/eef0e51fbc21398f6dcbd482fbf91cad2371659b/resource.tar.gz#test_sql_format.test_compute_range-adjacent_to_point_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-decimal]": [
+ {
+ "checksum": "f06222db72e8d8052805f68177e42838",
+ "size": 292,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-huge_in]": [
+ {
+ "checksum": "e6164c3eae4bc1f9e4472237cab3c897",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-huge_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-in2]": [
+ {
+ "checksum": "fa8f9198ce83f7adcb37b28790c6a128",
+ "size": 798,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-in2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-in3]": [
+ {
+ "checksum": "ce487268d3ab9247657134d9e93db0d6",
+ "size": 2024,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-in3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-in]": [
+ {
+ "checksum": "be7a083ba417a20645bd4c2d6706dd05",
+ "size": 1522,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-in_literal_nulls]": [
+ {
+ "checksum": "41ad9e839e757f409033532f14c63b10",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-in_literal_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-merge_adjacent]": [
+ {
+ "checksum": "c87cf2e5b6a544da0830e0fe90da62b3",
+ "size": 1167,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-merge_adjacent_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-multiply_limit]": [
+ {
+ "checksum": "8bda61a245b0eac0461d2292e3ceb6d8",
+ "size": 921,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-multiply_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-multiply_limit_for_single_key]": [
+ {
+ "checksum": "fc8b8738b7b8130c5289be7a6a8d1729",
+ "size": 373,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-multiply_limit_for_single_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-multiply_limit_with_dups]": [
+ {
+ "checksum": "ea02bb38418f3647d1a62586393e1a3a",
+ "size": 699,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-multiply_limit_with_dups_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-multiply_limit_with_nulls]": [
+ {
+ "checksum": "1d0865c9e10329fd4497f3343a5c0e78",
+ "size": 320,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-multiply_limit_with_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-norange]": [
+ {
+ "checksum": "969bfaf2f8741ecfa342e9130afdb9b9",
+ "size": 564,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-norange_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-pg_compare]": [
+ {
+ "checksum": "604ae6bf612f179f920b2e9a9545801c",
+ "size": 851,
+ "uri": "https://{canondata_backend}/1773845/fe2146df711e0729e3c3cc1bc9b2c5b1fdfcfea1/resource.tar.gz#test_sql_format.test_compute_range-pg_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-pg_equal]": [
+ {
+ "checksum": "f608cdd2c7a05155104e4d33bfcfe75b",
+ "size": 523,
+ "uri": "https://{canondata_backend}/1773845/fe2146df711e0729e3c3cc1bc9b2c5b1fdfcfea1/resource.tar.gz#test_sql_format.test_compute_range-pg_equal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-pg_exists]": [
+ {
+ "checksum": "e486305de0b90e8629a22c41f0f9fe0a",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1773845/fe2146df711e0729e3c3cc1bc9b2c5b1fdfcfea1/resource.tar.gz#test_sql_format.test_compute_range-pg_exists_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-pg_sqlin]": [
+ {
+ "checksum": "ed692f0bc865788028bf9789760b7ce7",
+ "size": 578,
+ "uri": "https://{canondata_backend}/1773845/fe2146df711e0729e3c3cc1bc9b2c5b1fdfcfea1/resource.tar.gz#test_sql_format.test_compute_range-pg_sqlin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-pg_startswith]": [
+ {
+ "checksum": "b06b88f1965f643fea24cb7e5d8d0459",
+ "size": 955,
+ "uri": "https://{canondata_backend}/1031349/96841816c51116681477e138bb81b6493013c777/resource.tar.gz#test_sql_format.test_compute_range-pg_startswith_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-preserve_rest_predicates_order]": [
+ {
+ "checksum": "77cd36176a336f2a79ee10f5697b124f",
+ "size": 595,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_compute_range-preserve_rest_predicates_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-repeated_keyranges_in_and]": [
+ {
+ "checksum": "ee930056e23f610fd46efb0ac627f4fd",
+ "size": 473,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_compute_range-repeated_keyranges_in_and_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-startswith]": [
+ {
+ "checksum": "928ac2059cd45a1d0b616787d653fc05",
+ "size": 1984,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-startswith_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-tuples_compare]": [
+ {
+ "checksum": "9fa4f5c4fefd26c5aca9ed2d13972073",
+ "size": 1425,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-tuples_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-tztypes]": [
+ {
+ "checksum": "13df17dd0604fa0c4d18e9a9131b926f",
+ "size": 1192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-tztypes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-yql-12941]": [
+ {
+ "checksum": "c4d0d9b2d0512bfe1dfe0a8603c09bfe",
+ "size": 497,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-yql-12941_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[compute_range-yql-13489]": [
+ {
+ "checksum": "9fc1d919e8229067c6fcf8d661872c95",
+ "size": 484,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_compute_range-yql-13489_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-boolean_count]": [
+ {
+ "checksum": "949314d11cf0a030236328a03a07bf0e",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-boolean_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count]": [
+ {
+ "checksum": "a5037ff8c4e6bcb119f0197754f44d68",
+ "size": 517,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_all]": [
+ {
+ "checksum": "51f290345dc6d99338f3c76dbafc4192",
+ "size": 38,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_all_grouped]": [
+ {
+ "checksum": "be99401f539f0c8655d0cf84ae3bae72",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_all_grouped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_all_view_concat]": [
+ {
+ "checksum": "04dbe7a7ce5a0f1d4c69a4e96cf1d5cd",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_all_view_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_by_nulls]": [
+ {
+ "checksum": "e3868d409f54923f55b3bff114a314e1",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_by_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_const_no_grouping]": [
+ {
+ "checksum": "6090bda6dd21176de917d2604c236494",
+ "size": 38,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_const_no_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_distinct_from_view_concat]": [
+ {
+ "checksum": "5b25750de824d04d79703d8260660048",
+ "size": 134,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_distinct_from_view_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_no_grouping]": [
+ {
+ "checksum": "6851eb7814c2a4583ec396e5c822f0bf",
+ "size": 42,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_no_grouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_nullable]": [
+ {
+ "checksum": "f3d22a2f26e075813e1539440e23f383",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_count-count_nullable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[count-count_nullable_sub]": [
+ {
+ "checksum": "ffd1db27102728289218d704ea23e11e",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_count-count_nullable_sub_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-closure_in_l1_and_l2]": [
+ {
+ "checksum": "473c3610118876c2475bda536fefda40",
+ "size": 1013,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_csee-closure_in_l1_and_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-closure_in_l2_and_l1]": [
+ {
+ "checksum": "d6af72437a02a0992d3ea43ae775dd95",
+ "size": 1013,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_csee-closure_in_l2_and_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-closure_l2]": [
+ {
+ "checksum": "94fc43e04ea4698c16151ecf26304db0",
+ "size": 208,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-closure_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-complete_l2]": [
+ {
+ "checksum": "59977b06a9101f84bbaf36ae2f129baf",
+ "size": 269,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-complete_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-const_body_diff_lambda]": [
+ {
+ "checksum": "e478e0ff82f0d98c704833cc00773d74",
+ "size": 250,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-const_body_diff_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-const_body_same_lambda]": [
+ {
+ "checksum": "2f55304ffac134142de61f8f57ba6e32",
+ "size": 242,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-const_body_same_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-expr]": [
+ {
+ "checksum": "6273a8166e27ea0cc68723d26640005f",
+ "size": 30,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-expr_in_l0_and_l1]": [
+ {
+ "checksum": "d22de663a4cdaa181e54088c238361ee",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-expr_in_l0_and_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-expr_in_l1]": [
+ {
+ "checksum": "d59f05c054fce1f5b1726d4c5b80651f",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-expr_in_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-expr_in_l1_and_l0]": [
+ {
+ "checksum": "e6b497462612d0130cd0b3257cbdd6cc",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-expr_in_l1_and_l0_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-l2_dup_l1]": [
+ {
+ "checksum": "22174eecb786bbd83b7037002e229b79",
+ "size": 549,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-l2_dup_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-l2_dup_l1_many]": [
+ {
+ "checksum": "1106b2a674d349c293fdfb2afcc782b3",
+ "size": 787,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-l2_dup_l1_many_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-lambda_in_l0_and_l1]": [
+ {
+ "checksum": "d7c77f2966e54f144c69ffe04d33f87d",
+ "size": 514,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-lambda_in_l0_and_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-lambda_in_l1_and_l0]": [
+ {
+ "checksum": "619031d9ef147eece3009eb5d630b8e5",
+ "size": 514,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-lambda_in_l1_and_l0_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-nested_closure_in_l1_and_l2]": [
+ {
+ "checksum": "d3d47e0062e4d46d0c6e3351fd7f114d",
+ "size": 1891,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_csee-nested_closure_in_l1_and_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-nested_closure_in_l1_and_l2_unordered]": [
+ {
+ "checksum": "4d3eb880f027e7feb0a10d21cedaf8f0",
+ "size": 2505,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-nested_closure_in_l1_and_l2_unordered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-nested_closure_in_l2_and_l1]": [
+ {
+ "checksum": "bc6a39ffe89056254b624ed287452561",
+ "size": 1891,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_csee-nested_closure_in_l2_and_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-nested_closure_in_l2_and_l1_unordered]": [
+ {
+ "checksum": "3f3f818fee196e2bb7501e395ffcaf70",
+ "size": 2495,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-nested_closure_in_l2_and_l1_unordered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_closure_l2]": [
+ {
+ "checksum": "a3aa6d45e9a6fcd3763e6a2a14b3e2fd",
+ "size": 419,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_closure_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_complete_l2]": [
+ {
+ "checksum": "bf42cb8742ed554e54f1670e3cdd3af7",
+ "size": 515,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_complete_l2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_complete_l2_expr]": [
+ {
+ "checksum": "3643c71dd5ba27fc5b5dc26c397b755a",
+ "size": 513,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_complete_l2_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_free_closure_size2]": [
+ {
+ "checksum": "a4187dc765d0d9b8d85d88ace4fa66d2",
+ "size": 496,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_free_closure_size2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_free_closure_size2_arg_both_level]": [
+ {
+ "checksum": "9c4b3fbf71bf8c4ebfc438f43f493400",
+ "size": 506,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_free_closure_size2_arg_both_level_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_free_closure_size2_arg_both_level_expr]": [
+ {
+ "checksum": "7c7003f4a0eb8f2a45ba02ea3ecd1083",
+ "size": 506,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_free_closure_size2_arg_both_level_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_free_closure_size2_expr]": [
+ {
+ "checksum": "a315ad603866819a03aa6a57cb566f6a",
+ "size": 496,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_free_closure_size2_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_l1]": [
+ {
+ "checksum": "f23c7058b1e74d0e66ad4326b7dd24d1",
+ "size": 243,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_l1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-same_l1_expr]": [
+ {
+ "checksum": "3f1e6f55f5e2caaf2a5d62586f93a92e",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-same_l1_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[csee-yql-7237]": [
+ {
+ "checksum": "7f57897a02ca4e85a0219af373e7170d",
+ "size": 1860,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_csee-yql-7237_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-all_timezones]": [
+ {
+ "checksum": "572d7bc60e5729adf1fa615e56788a42",
+ "size": 324,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-all_timezones_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-current_date]": [
+ {
+ "checksum": "8d7d4f439e01357501ccdb688f3f8709",
+ "size": 192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-current_date_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_arithmetic]": [
+ {
+ "checksum": "70e67123588729f88a390133977a0e1f",
+ "size": 1304,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_arithmetic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_bitcast]": [
+ {
+ "checksum": "a375e2ab5d0b9f1b7a9e20a3bec4dfa6",
+ "size": 1862,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_cast]": [
+ {
+ "checksum": "442f949679b243f883f51ecf07a4e347",
+ "size": 3722,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_convert]": [
+ {
+ "checksum": "ad0b81dfd73547c30bf85051c9109084",
+ "size": 1435,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_convert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_diff_compare]": [
+ {
+ "checksum": "f2e849c7ff0e6693e5036dfc004bfc12",
+ "size": 1336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_diff_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_diff_sub]": [
+ {
+ "checksum": "73b6050dc4dd349b0ad871a9fe132481",
+ "size": 456,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_diff_sub_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_in]": [
+ {
+ "checksum": "b48f1b69e856e6ea8b39108b01d00410",
+ "size": 2790,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_out]": [
+ {
+ "checksum": "8d2d387c2de52619507a23cd4cb97d76",
+ "size": 946,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_scale]": [
+ {
+ "checksum": "b7840165f89dfe71939e531c493cff8b",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_scale_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_types]": [
+ {
+ "checksum": "b8032a24254dee01e9fa02a8f5337418",
+ "size": 311,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_addremove]": [
+ {
+ "checksum": "701556b5af7b79cd457503bda0f48f25",
+ "size": 348,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_addremove_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_arithmetic]": [
+ {
+ "checksum": "3b63f84a0f1b99cb1570d1dbbbeea133",
+ "size": 1964,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_arithmetic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_bitcast]": [
+ {
+ "checksum": "bfdb1c48c7ca2250043c1ff8c97d6d33",
+ "size": 1540,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_bitcast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_bounds]": [
+ {
+ "checksum": "4c03d789575aae3fbb6e16fcbfdb57d9",
+ "size": 682,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_bounds_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_bounds_scale]": [
+ {
+ "checksum": "62b418c0ed84ab6797cb647c39d4d70f",
+ "size": 1790,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_bounds_scale_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_bytes]": [
+ {
+ "checksum": "e2648480fad6e50b18361680783d5d16",
+ "size": 568,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_bytes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_cast]": [
+ {
+ "checksum": "817a2a7655ec3b4f68e8de07de9610c3",
+ "size": 1871,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_compare_diff_zones]": [
+ {
+ "checksum": "83e2725054fa6b083658b6c6848ba5c9",
+ "size": 2028,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_compare_diff_zones_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_compare_gmt]": [
+ {
+ "checksum": "89e448d50da9d664712bc66e5ff664e8",
+ "size": 3586,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_compare_gmt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_compare_same_zones]": [
+ {
+ "checksum": "9c49f55dcdaaf70c9e095c4132a2fe03",
+ "size": 3492,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_compare_same_zones_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_expand_gmt]": [
+ {
+ "checksum": "352efab2ff530d05d42d177be5b4fbdd",
+ "size": 195,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_expand_gmt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_impossible_cast]": [
+ {
+ "checksum": "8ee9927e0d887b1fea8e2b7c29499353",
+ "size": 158,
+ "uri": "https://{canondata_backend}/1130705/d31a79698ba36e25d38301feb8a2518de6ef9df2/resource.tar.gz#test_sql_format.test_datetime-date_tz_impossible_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_io]": [
+ {
+ "checksum": "1df0884b9b5eda8a831e6728224f322a",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_io_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_scale]": [
+ {
+ "checksum": "6edde4786dedb4dd62b0f3de6fe0f810",
+ "size": 998,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_scale_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_table_sort_asc]": [
+ {
+ "checksum": "41cd11cd6c3642e6a93417be49a8ceff",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_table_sort_asc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[datetime-date_tz_table_sort_desc]": [
+ {
+ "checksum": "ae7c2ca138669900cf3e6e24a740a236",
+ "size": 203,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_datetime-date_tz_table_sort_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_and_join]": [
+ {
+ "checksum": "44cf842749f48e0312b4227366ef5530",
+ "size": 179,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_and_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_by_tuple]": [
+ {
+ "checksum": "c33a6ea35ce9b2b7879010c31000404e",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_by_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_columns]": [
+ {
+ "checksum": "ae5b8d8515f153308e7eaa0a4d3ae9a8",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_columns_after_group]": [
+ {
+ "checksum": "865c393f2f7d07c94688d0fd72941c36",
+ "size": 250,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_columns_after_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_count_and_avg]": [
+ {
+ "checksum": "5db5401f771e20c477c5520ea3f949c6",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_count_and_avg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_count_and_full_count]": [
+ {
+ "checksum": "fedfe8b7eb8765bb8279aaff164fc44f",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_count_and_full_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_count_no_gouping]": [
+ {
+ "checksum": "fd5e58ee36e7e62f94821863ba02c6bc",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_count_no_gouping_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_count_only]": [
+ {
+ "checksum": "a6324f219e016e963f34e65452da9610",
+ "size": 50,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_count_only_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_groupby]": [
+ {
+ "checksum": "6c873f199942b831987287a4aefbe248",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_groupby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_having_no_agg]": [
+ {
+ "checksum": "e334dd1a2fb9e12d1fce756782f3576e",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_having_no_agg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_join]": [
+ {
+ "checksum": "fd6e134c4aecc934f05a77e7fdf322c7",
+ "size": 268,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_list_after_group]": [
+ {
+ "checksum": "115b9b6312f2d4ab70820457745ac4f6",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_list_after_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_one_count]": [
+ {
+ "checksum": "461a2eea61c03b2b1c163c41621eb0b0",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_one_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_star1]": [
+ {
+ "checksum": "479c3e35e31e3adbe2d268c2c98942a0",
+ "size": 92,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_star1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_star]": [
+ {
+ "checksum": "5ee34370df5d56256ba82042a2714693",
+ "size": 316,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_star_inmem]": [
+ {
+ "checksum": "04685de53192596ed453c29bec9818b6",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_star_inmem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_union_all]": [
+ {
+ "checksum": "1929933bf7ec8c452562a93b3b2f943c",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_union_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[distinct-distinct_window]": [
+ {
+ "checksum": "8288e2b9235ca5807b71a4926299a770",
+ "size": 294,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_distinct-distinct_window_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-blacklisted_pragmas1]": [
+ {
+ "checksum": "042fc5f09cc2cbff00b197aea50b9d45",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-blacklisted_pragmas1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-blacklisted_pragmas]": [
+ {
+ "checksum": "f8e78f3bbaa47c75841b7c4082dc05cb",
+ "size": 196,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-blacklisted_pragmas_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-dq_replicate_ok]": [
+ {
+ "checksum": "28454f2fd0b73808d38f8fcc77fa8280",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-dq_replicate_ok_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-join_cbo_native_3_tables]": [
+ {
+ "checksum": "57132a984e799d53da61370fa2d23e14",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-join_cbo_native_3_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-mem_limit]": [
+ {
+ "checksum": "e9222d208863a953f08a149b8bbe3955",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-mem_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-pool_trees_whitelist]": [
+ {
+ "checksum": "20eade00c283958b45d0b952730cff0f",
+ "size": 188,
+ "uri": "https://{canondata_backend}/1871002/c65ff3a6f73717dfa83b26a43711be000bed4540/resource.tar.gz#test_sql_format.test_dq-pool_trees_whitelist_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_asyncfile]": [
+ {
+ "checksum": "91c30aca2dc34875c088cf0ccbd57b3b",
+ "size": 152,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-precompute_asyncfile_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_parallel]": [
+ {
+ "checksum": "a74e8fa8c6146322ecb5b746c4899e0c",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-precompute_parallel_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_parallel_indep]": [
+ {
+ "checksum": "5ee71b61a11efee1059774aa4478b4fc",
+ "size": 215,
+ "uri": "https://{canondata_backend}/1903885/e05277820455e95dc3443a43a34b1956971f88cf/resource.tar.gz#test_sql_format.test_dq-precompute_parallel_indep_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_parallel_mix]": [
+ {
+ "checksum": "ef7b7571431f5c4e198b4df24fab006a",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1937027/08c3c9c6866171c02a77702fcc07f26f028f4001/resource.tar.gz#test_sql_format.test_dq-precompute_parallel_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_result]": [
+ {
+ "checksum": "e9aad7ef908ef2e5d99e7fd838fdc4e9",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-precompute_result_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-precompute_tree]": [
+ {
+ "checksum": "05810c08efab870b54944300bb7c2ac9",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-precompute_tree_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-read_cost]": [
+ {
+ "checksum": "2450f6e7a95a070bc9465b29749b63db",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-read_cost_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-read_cost_native]": [
+ {
+ "checksum": "f22c512028e6e01b180b2cbeea073683",
+ "size": 293,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-read_cost_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-truncate_local]": [
+ {
+ "checksum": "62cf531a7dae681122fbeb03cb17bf3e",
+ "size": 110,
+ "uri": "https://{canondata_backend}/1936842/c2ea4ab085b4ea719ab4be045360f9be51da27ec/resource.tar.gz#test_sql_format.test_dq-truncate_local_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-wrong_script]": [
+ {
+ "checksum": "8af5042ae8defade2fd7bff30f7f19e8",
+ "size": 192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-wrong_script_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-wrong_script_segf]": [
+ {
+ "checksum": "335c0fb9e2a19823d564700d2e346251",
+ "size": 330,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-wrong_script_segf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[dq-wrong_script_timeout]": [
+ {
+ "checksum": "ce7c174b501b3d7e05b2adf2b4e9444b",
+ "size": 184,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_dq-wrong_script_timeout_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[epochs-read_modified]": [
+ {
+ "checksum": "87cfd1fb5cc3a2c667634dff5fdd4bc7",
+ "size": 324,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_epochs-read_modified_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[epochs-reset_sortness_on_append]": [
+ {
+ "checksum": "c94b15c910d3cb343227d1df751a563b",
+ "size": 327,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_epochs-reset_sortness_on_append_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[epochs-use_and_drop_anonymous]": [
+ {
+ "checksum": "0b14d2fe67a616af736ff868dfaa81f6",
+ "size": 370,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_epochs-use_and_drop_anonymous_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[epochs-use_sorted_by_complex_type]": [
+ {
+ "checksum": "d1497e5eca3eee3d32c04bb9142d0ad8",
+ "size": 236,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_epochs-use_sorted_by_complex_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_dict_dict_key]": [
+ {
+ "checksum": "1bce7a4ea240952aae7a6352284e200c",
+ "size": 1000,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-as_dict_dict_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_dict_implicit_cast]": [
+ {
+ "checksum": "e0c64b498e2ae5871de3118dc2694bd8",
+ "size": 86,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_dict_implicit_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_dict_list_key]": [
+ {
+ "checksum": "02faa702bfe667791008ef187fc1f568",
+ "size": 362,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-as_dict_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_dict_tuple_key]": [
+ {
+ "checksum": "4461e884084eb500b5cca1e7e89a545f",
+ "size": 943,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-as_dict_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_set]": [
+ {
+ "checksum": "48c6cef7193d37b709a3ce6ceb6a4970",
+ "size": 157,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_set_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_struct_syntax]": [
+ {
+ "checksum": "61e301535d5c2131bfaa677427d2888f",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_struct_syntax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_table]": [
+ {
+ "checksum": "0ab58c7554cf4a32290d2fc7c0a4dfb7",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_table_bad_columns_fail]": [
+ {
+ "checksum": "4ca779a0e0656eda8ef5cd98d11cbb7f",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_table_bad_columns_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_table_bad_row_type_fail]": [
+ {
+ "checksum": "b42c4d2b043d0eeb8da960cde88b27a9",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_table_bad_row_type_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_table_emptylist2]": [
+ {
+ "checksum": "bbac989ded396d4b38696a48425279d8",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_table_emptylist2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_table_emptylist]": [
+ {
+ "checksum": "3d69b571031b6254cdd50a493c593850",
+ "size": 783,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_table_emptylist_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_tuple_syntax]": [
+ {
+ "checksum": "04f14f16f7a96054c353236da588f5e4",
+ "size": 73,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_tuple_syntax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_variant_enum]": [
+ {
+ "checksum": "6b03f9475753e16e685ccb5c5980b0fd",
+ "size": 99,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_variant_enum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-as_variant_enum_compare]": [
+ {
+ "checksum": "76c7a1ad16cdea1e80cc7468caa15681",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-as_variant_enum_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-backtick_escape]": [
+ {
+ "checksum": "6018af4ee7c04f526bb658b060e68fa4",
+ "size": 120,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-backtick_escape_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-between]": [
+ {
+ "checksum": "235df44ddffb81d65cf099a9b6f39ede",
+ "size": 1127,
+ "uri": "https://{canondata_backend}/1931696/18b8a06dae10699fe886d31fe0f2dbf29f41dc3d/resource.tar.gz#test_sql_format.test_expr-between_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-callable]": [
+ {
+ "checksum": "a7509ab7ee850bba787543f4494e8d3a",
+ "size": 282,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-callable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_dynumber]": [
+ {
+ "checksum": "92f7c3f16500a1d8af53abf5ad6046e4",
+ "size": 354,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_dynumber_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_from_utf8]": [
+ {
+ "checksum": "52ecdca01d7d463cfd2120fcd15bd6ee",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_from_utf8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_longint]": [
+ {
+ "checksum": "165404d595aa62f5a0aa81b67f15fd1f",
+ "size": 232,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_longint_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_reverse_list]": [
+ {
+ "checksum": "0f4f66a818ffa60b45cdd6b53a306637",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_reverse_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_string_implicit]": [
+ {
+ "checksum": "284daa81a79382e0f0730d2a8e9e5fed",
+ "size": 686,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_string_implicit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_struct]": [
+ {
+ "checksum": "4cd3ac3120c424163113ea64a836cee5",
+ "size": 396,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_type_bind]": [
+ {
+ "checksum": "3f3278f3a640e6ad1adeead9ffd2f5d5",
+ "size": 93,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_type_bind_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_utf8]": [
+ {
+ "checksum": "9a381f5e24f57d6bd4d44f48d8706dba",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_utf8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-cast_variant]": [
+ {
+ "checksum": "0589a19425e8d7447c3a8850ef95586f",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-cast_variant_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-checked_ops]": [
+ {
+ "checksum": "f4fa181f7ef1dab3c24efa355d72f676",
+ "size": 386,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-checked_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-checked_ops_agg]": [
+ {
+ "checksum": "f587f00227413939ef2de301f313cc7c",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-checked_ops_agg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-common_type_for_resource_and_data]": [
+ {
+ "checksum": "a2b8955126ffe74fe056688c0e8335cd",
+ "size": 216,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-common_type_for_resource_and_data_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-constraints_of]": [
+ {
+ "checksum": "d361b6bbe57f7545b313129dfa42c7fa",
+ "size": 311,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-constraints_of_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-container_comp]": [
+ {
+ "checksum": "acd0c1c1f9f47c7df340927359dafc3a",
+ "size": 475,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-container_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-convert_to_lambda_optional_args]": [
+ {
+ "checksum": "f7c18c0d5077b5ea8a13774b3a6410cb",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-convert_to_lambda_optional_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-current_tz]": [
+ {
+ "checksum": "a4e24f058b7ff08995c0503e325ff170",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-current_tz_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-decimal_bytes]": [
+ {
+ "checksum": "49f030bb0ef55d5dca5607221c315651",
+ "size": 620,
+ "uri": "https://{canondata_backend}/1937367/fb7bc472ea97cce2f795f26ab64cf43ffb7e6852/resource.tar.gz#test_sql_format.test_expr-decimal_bytes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-dict_builtins]": [
+ {
+ "checksum": "c264e939cee63ea64d1b371b3c3e90f1",
+ "size": 420,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-dict_builtins_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-dict_builtins_null_lookup]": [
+ {
+ "checksum": "b1c15d07ca08ba41caac26d8ae9ff3ff",
+ "size": 1208,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-dict_builtins_null_lookup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-dict_common_type]": [
+ {
+ "checksum": "a89dd006c8d0a5f2efcf45929facb07f",
+ "size": 355,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-dict_common_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-dict_comp]": [
+ {
+ "checksum": "e6f540871260bea2af2468b6d03a3dec",
+ "size": 818,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-dict_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-distinct_from]": [
+ {
+ "checksum": "3e57e18341e00bc05b134ab53508ee93",
+ "size": 255,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-distinct_from_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-distinct_from_containers]": [
+ {
+ "checksum": "a84fee2f03a76f74c2929153982803eb",
+ "size": 710,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-distinct_from_containers_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-distinct_from_opt]": [
+ {
+ "checksum": "dc3ea007414880d84f4a3c176d82d916",
+ "size": 447,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-distinct_from_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-double_join_with_list_from_range]": [
+ {
+ "checksum": "03630a22e62309cd2a7802e55cb64db4",
+ "size": 640,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-double_join_with_list_from_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_dict_ops]": [
+ {
+ "checksum": "5a3bfeff4eddefd7d55c44e8a10ba3a6",
+ "size": 424,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-empty_dict_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_iterator2]": [
+ {
+ "checksum": "d5bf178b9957aace162b117a8cae6a14",
+ "size": 478,
+ "uri": "https://{canondata_backend}/1942173/415cbf5df3dc61306361ecaeb378f8996d5f72e6/resource.tar.gz#test_sql_format.test_expr-empty_iterator2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_iterator]": [
+ {
+ "checksum": "8272af326f5d0fe473c9b828af95121c",
+ "size": 447,
+ "uri": "https://{canondata_backend}/1936273/ce551aaac929f37e3131cd782d25a651ead4bae2/resource.tar.gz#test_sql_format.test_expr-empty_iterator_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_list_ops1]": [
+ {
+ "checksum": "c6f83d2880c7a417e693048a312785b1",
+ "size": 1536,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-empty_list_ops1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_list_ops2]": [
+ {
+ "checksum": "8c2acac1b7b554210faa26e2ad7455ef",
+ "size": 1842,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-empty_list_ops2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_list_ops3]": [
+ {
+ "checksum": "e7094f11538c73cdf6d8ad5d2e3b5218",
+ "size": 1306,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-empty_list_ops3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-empty_struct_tuple_types]": [
+ {
+ "checksum": "005c7a67923fb84517c5bd256b437a4f",
+ "size": 218,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-empty_struct_tuple_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-ensure_ok]": [
+ {
+ "checksum": "999bc78124153400a3a88b241b589403",
+ "size": 40,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-ensure_ok_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-ensure_runtime_fail]": [
+ {
+ "checksum": "7c65ea048e465ffa8dd079d0da799fcd",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-ensure_runtime_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-ensure_type_fail]": [
+ {
+ "checksum": "107b79866e71f48a62864cde5ddd3083",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-ensure_type_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-evaluate_parse_inf_nan]": [
+ {
+ "checksum": "a67505a8f548c860f2245197d3360c56",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-evaluate_parse_inf_nan_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-exapnd_with_singular_types]": [
+ {
+ "checksum": "df5efa664a14ce8b8f66825f0f7befef",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-exapnd_with_singular_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_add_literal_nulls]": [
+ {
+ "checksum": "260468c6dde0efc4a4042313fb70b957",
+ "size": 38,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_add_literal_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_cast]": [
+ {
+ "checksum": "3daab7c55471ce2822adea0027b27f46",
+ "size": 33,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_named_yql_lambda]": [
+ {
+ "checksum": "edc1a2c8a661b798f2cd2848e3e7a74c",
+ "size": 69,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_named_yql_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_named_yql_lambda_multiline_atoms]": [
+ {
+ "checksum": "ec522b578b556706a995e9902dbf3716",
+ "size": 104,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_named_yql_lambda_multiline_atoms_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_named_yql_lambda_quotes]": [
+ {
+ "checksum": "1a78c45dabb2a95ed3b91746e1bf906b",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_named_yql_lambda_quotes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_null]": [
+ {
+ "checksum": "adfaebc667f5d2b9766b1b1fc85385e3",
+ "size": 40,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_op_in_paren]": [
+ {
+ "checksum": "6bd26da835448fb70edb146f24ad4c39",
+ "size": 20,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_op_in_paren_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_trivial_named]": [
+ {
+ "checksum": "65fbc568d14f8eb88efdf301bbc58215",
+ "size": 33,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_trivial_named_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_yql_data]": [
+ {
+ "checksum": "27327c1dc3dfb2fbb90fb486be043a4d",
+ "size": 68,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_yql_data_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_yql_from_string]": [
+ {
+ "checksum": "0958201786e6fb05de1040ff09379ee5",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_yql_from_string_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-expr_yql_function]": [
+ {
+ "checksum": "37061fbc2428f9cbbab2ef4f2760b2af",
+ "size": 33,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-expr_yql_function_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-extra_opt_try_member]": [
+ {
+ "checksum": "c95204b0d1a96b3ccee246954a1af364",
+ "size": 642,
+ "uri": "https://{canondata_backend}/1773845/debb3aa4dcc88e474e8ae2ff70a6e75e8cfdd59f/resource.tar.gz#test_sql_format.test_expr-extra_opt_try_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-fallback_filternullelements]": [
+ {
+ "checksum": "9e4d41d95e5f3bb892a8ec4f208fbaae",
+ "size": 321,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-fallback_filternullelements_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-fallback_filternullmembers]": [
+ {
+ "checksum": "902886552ba1be2610b39f1f35033525",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-fallback_filternullmembers_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-flatmap_by_map_lazy_list]": [
+ {
+ "checksum": "2831860f4253d0542342f94665e95596",
+ "size": 469,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-flatmap_by_map_lazy_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-formattypediff]": [
+ {
+ "checksum": "8fbe3763de3a903f6ebad9bb9bfdbc94",
+ "size": 797,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-formattypediff_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-implicit_bitcast_fail]": [
+ {
+ "checksum": "890495d1d95b7bfc9b1c96826d2cecd5",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-implicit_bitcast_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-implicit_cast_literals_under_if]": [
+ {
+ "checksum": "dd88052d96344f35c30c83b960ad90dd",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-implicit_cast_literals_under_if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-implicit_cast_literals_under_listfromrange]": [
+ {
+ "checksum": "a78522b6a495293898fbc7274312d3f0",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-implicit_cast_literals_under_listfromrange_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-inline_call]": [
+ {
+ "checksum": "ec6616fe99ac4c60aedec2be3f955c19",
+ "size": 565,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-inline_call_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-int_literals]": [
+ {
+ "checksum": "857249082b2b43a261d88b9dac72ff39",
+ "size": 225,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-int_literals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-int_literals_negative]": [
+ {
+ "checksum": "84be52ed063bdb82a408dc8b4f78a6dd",
+ "size": 356,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-int_literals_negative_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-int_literals_negative_typed]": [
+ {
+ "checksum": "6296b66770886d5425ba3e6d14392d0b",
+ "size": 419,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-int_literals_negative_typed_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-is_null]": [
+ {
+ "checksum": "03c28628fad868173c96e0b1ee798ad4",
+ "size": 109,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-is_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-iterable]": [
+ {
+ "checksum": "7792867357e094235b58fedf80e62380",
+ "size": 622,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-iterable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-lambda_as_optional_callable]": [
+ {
+ "checksum": "24205bbb1290080b9388d0744c0add68",
+ "size": 296,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-lambda_as_optional_callable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-lds_empty_cast]": [
+ {
+ "checksum": "5791f4de8a73518fe80d3ffa6638d1ab",
+ "size": 474,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-lds_empty_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-lds_empty_compare]": [
+ {
+ "checksum": "da6c85fa17869405c2ea6a4369119015",
+ "size": 1095,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-lds_empty_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-lds_literal]": [
+ {
+ "checksum": "0e90b02c6e6c048ce7283f7c4d7fce80",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-lds_literal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-lds_types]": [
+ {
+ "checksum": "6e9842364f76cd53095781bc0b62a08a",
+ "size": 400,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-lds_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-len]": [
+ {
+ "checksum": "96f50c93bc6d08f29622b1c36cd5d81b",
+ "size": 74,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-len_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-length_of_optional_set_intesection]": [
+ {
+ "checksum": "557b553600d550e61e2402d32cc20d03",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-length_of_optional_set_intesection_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_builtins]": [
+ {
+ "checksum": "edc3e4370d7e008887ede558f41d610f",
+ "size": 2830,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_builtins_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_builtins_opt]": [
+ {
+ "checksum": "b6e32bb415acdddea11fabefa9877c3d",
+ "size": 1052,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_builtins_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_comp]": [
+ {
+ "checksum": "205b02a1303ded0b540973caf6674523",
+ "size": 2332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_concat]": [
+ {
+ "checksum": "cb12e8f1ce999545a4b4b63b90eb4eaf",
+ "size": 319,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_extend]": [
+ {
+ "checksum": "f4f13cb132273ff53c916835534c5225",
+ "size": 455,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_extend_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_flat_map_deprecated_opt]": [
+ {
+ "checksum": "c587d4a577fc8c1f996660eab3ef4cca",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_flat_map_deprecated_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_flatten]": [
+ {
+ "checksum": "5e6a0ae13deb937ecd6fdfec524aa78c",
+ "size": 645,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_flatten_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_from_range]": [
+ {
+ "checksum": "f83bc09bed5106668b2b7b2d0c80cd27",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_from_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_from_range_opt]": [
+ {
+ "checksum": "bd415aa4ce66b5cdd395506774b806e3",
+ "size": 1110,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_from_range_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_from_range_overflow]": [
+ {
+ "checksum": "4850898b8ba477c4d19ac99eb0bd12a3",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_from_range_overflow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_indexof]": [
+ {
+ "checksum": "a57adb914ca0edb11239bfd6bb2abd5f",
+ "size": 288,
+ "uri": "https://{canondata_backend}/995452/d567f0e593fff30f6415ec4b4d2488a3e4c452ab/resource.tar.gz#test_sql_format.test_expr-list_indexof_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_not_null]": [
+ {
+ "checksum": "93d47a5831fee1d864931d381a395bf2",
+ "size": 353,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_not_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_replicate]": [
+ {
+ "checksum": "3e2cb3da744e628d9b58ff42cdb749f0",
+ "size": 151,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_replicate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_replicate_fail]": [
+ {
+ "checksum": "93cb71186b1b55e95e2077c505c5547e",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_replicate_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_takeskipwhile]": [
+ {
+ "checksum": "fe413941b62655034d49cd2674f2c947",
+ "size": 758,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_takeskipwhile_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_takeskipwhileinclusive]": [
+ {
+ "checksum": "29f4093c65dbd00053271f83782932c2",
+ "size": 812,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-list_takeskipwhileinclusive_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_to_from_tuple]": [
+ {
+ "checksum": "dcd1b44ef4cd7d71672d906c9bdd476a",
+ "size": 317,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_expr-list_to_from_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_top_sort]": [
+ {
+ "checksum": "a0af54a6ec4d671db9f8a91cc09877bf",
+ "size": 1594,
+ "uri": "https://{canondata_backend}/1689644/47813afec92f7bbc83af4667f9074aac865e7ffe/resource.tar.gz#test_sql_format.test_expr-list_top_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-list_uniq]": [
+ {
+ "checksum": "74f6f47d443fa97917b2d52760056649",
+ "size": 375,
+ "uri": "https://{canondata_backend}/1942415/e8321dbd67e4e735ba3677524d3260f401d7c3c6/resource.tar.gz#test_sql_format.test_expr-list_uniq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-literal_list_element]": [
+ {
+ "checksum": "bab7ca4c0b98b043069ce068403b921b",
+ "size": 118,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-literal_list_element_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-literal_strings]": [
+ {
+ "checksum": "434901db60098fed3952185e2cd9bbb7",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-literal_strings_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-literal_strings_suffix]": [
+ {
+ "checksum": "f46232d3b2a21dae6150f895b0c192ce",
+ "size": 96,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-literal_strings_suffix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-literal_struct_member]": [
+ {
+ "checksum": "4b525d14309f2aeb44aefa067440fef9",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-literal_struct_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-literal_true]": [
+ {
+ "checksum": "0186a160d4dbfd935ea3a0278ef16e3d",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-literal_true_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-longint_builtins]": [
+ {
+ "checksum": "d68ad170447d2d7c0c056609cbd2c049",
+ "size": 967,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-longint_builtins_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-many_opt_comp]": [
+ {
+ "checksum": "4aa1884fb595a774a2b13c8292a02c72",
+ "size": 2680,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-many_opt_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-minmax_for_complex_types]": [
+ {
+ "checksum": "8b0b147ac68f7815403586781d1066ce",
+ "size": 772,
+ "uri": "https://{canondata_backend}/1942671/92396c368500f27bb9a26ee02762281c902efb4e/resource.tar.gz#test_sql_format.test_expr-minmax_for_complex_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_group_by_column_fail]": [
+ {
+ "checksum": "fac6ed789b7f73290e6e7136f0770871",
+ "size": 127,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_group_by_column_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_group_by_having_some_fail]": [
+ {
+ "checksum": "6be35146fdd50bfee84fc693584a72bf",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_group_by_having_some_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_group_by_some_fail]": [
+ {
+ "checksum": "dcc7649a0d90035f29bc5f00bf7423a6",
+ "size": 109,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_group_by_some_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_inner_select_fail]": [
+ {
+ "checksum": "1f7af1f477337920e0196b9ee45176b0",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_inner_select_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_insert_into_fail]": [
+ {
+ "checksum": "81bc31b3e579717e14e690076bd4306e",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_insert_into_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-non_persistable_order_by_fail]": [
+ {
+ "checksum": "5f70a7ef4e1027b00809968814ef3ac7",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-non_persistable_order_by_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-opt_list_map]": [
+ {
+ "checksum": "5903c0d0d189fc87b4e39d1d4a1ec6a3",
+ "size": 1044,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-opt_list_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-opt_try_member]": [
+ {
+ "checksum": "2bc85239d86484568bc0fe91b24afca5",
+ "size": 880,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-opt_try_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-partial_columns_in_mem_aggr]": [
+ {
+ "checksum": "519912e73ce2f8cff91596bdc1b1ae61",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-partial_columns_in_mem_aggr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-pg_try_member]": [
+ {
+ "checksum": "4768dd4ff381e6782d87a9dba9a60b89",
+ "size": 663,
+ "uri": "https://{canondata_backend}/1773845/debb3aa4dcc88e474e8ae2ff70a6e75e8cfdd59f/resource.tar.gz#test_sql_format.test_expr-pg_try_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-pickle]": [
+ {
+ "checksum": "4e7e8906c936c612c7156553ae07db63",
+ "size": 576,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-pickle_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-replace_member]": [
+ {
+ "checksum": "caef9f2847f4c8ff73efa701fd05a9a0",
+ "size": 583,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-replace_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-sets]": [
+ {
+ "checksum": "573db2490f9bfe1b525d1f2d7c176b0f",
+ "size": 1948,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-sets_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-static_fold]": [
+ {
+ "checksum": "7ddcac1548442f3f7d4cbcb83e302a6e",
+ "size": 689,
+ "uri": "https://{canondata_backend}/1924537/1e3ca38458825f3a90f980c646934da7af7d2e26/resource.tar.gz#test_sql_format.test_expr-static_fold_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-static_zip]": [
+ {
+ "checksum": "6cf222c646aae8aac09bdc638af4c36b",
+ "size": 592,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-static_zip_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_builtins]": [
+ {
+ "checksum": "e47724e81049a6836f0650a8c22b7284",
+ "size": 522,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_builtins_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_gather_spread]": [
+ {
+ "checksum": "d13cb41655b6ef6fecd816fc3a9bb759",
+ "size": 994,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_gather_spread_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_literal]": [
+ {
+ "checksum": "a53b21b49d97169150ea6f4ad8e849bf",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_literal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_literal_bind]": [
+ {
+ "checksum": "4b901fb30d53b889eb975b8ce7b74779",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_literal_bind_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_literal_members]": [
+ {
+ "checksum": "3a1bf2b4089469bcc63943b086bd73ec",
+ "size": 186,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_literal_members_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_merge]": [
+ {
+ "checksum": "509cfc4518e9c467b2cd05a5e568c00b",
+ "size": 413,
+ "uri": "https://{canondata_backend}/1916746/116cafe28e270e7917dbeab5e0d1b5f2357e5c16/resource.tar.gz#test_sql_format.test_expr-struct_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-struct_slice]": [
+ {
+ "checksum": "8a9f027371f1722b5753e5b53cf62346",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-struct_slice_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-tagged_runtime]": [
+ {
+ "checksum": "903172946176127a2a7c8717b9542a04",
+ "size": 359,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-tagged_runtime_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_dict_from_nothing]": [
+ {
+ "checksum": "d366e53fbb070edc890f5d80f7f3bd0e",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_dict_from_nothing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_dict_dict_key]": [
+ {
+ "checksum": "0887fe4d950c58dd38be6a72e93b7e08",
+ "size": 3184,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_hashed_dict_dict_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_dict_list_key]": [
+ {
+ "checksum": "58b870b8da028d24c07803d9f9608ed4",
+ "size": 1352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_hashed_dict_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_dict_tuple_key]": [
+ {
+ "checksum": "cb7bc228aebe1adea7c92585c1a98083",
+ "size": 3515,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_hashed_dict_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_dict_varstruct_key]": [
+ {
+ "checksum": "76e54f2ee03b2fcaa0317958a11c143b",
+ "size": 1312,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_hashed_dict_varstruct_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_dict_vartuple_key]": [
+ {
+ "checksum": "b132d6090ded4c74be3383171bc50128",
+ "size": 1308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_hashed_dict_vartuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_set_dict_key]": [
+ {
+ "checksum": "43044cffadfa4373e90c4aff429111f7",
+ "size": 1490,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_hashed_set_dict_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_set_list_key]": [
+ {
+ "checksum": "23070495600e63b5e66021e1f098ee9e",
+ "size": 786,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-to_hashed_set_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_set_tuple_key]": [
+ {
+ "checksum": "4bd363045d43e8d785cd136fd448c54a",
+ "size": 2157,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_hashed_set_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_set_varstruct_key]": [
+ {
+ "checksum": "1e98bf98d3580532689bdf6757b6667a",
+ "size": 878,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_hashed_set_varstruct_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_hashed_set_vartuple_key]": [
+ {
+ "checksum": "15aca1a42dd65fb54b79dc2aac28759c",
+ "size": 874,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_hashed_set_vartuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_dict_list_key]": [
+ {
+ "checksum": "c43b36618141ec415e55e092d4932cec",
+ "size": 660,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_dict_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_dict_tuple_key]": [
+ {
+ "checksum": "84a54e9d762c0e3a3fe1e12bae07ee4e",
+ "size": 1873,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_dict_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_dict_vartuple_key]": [
+ {
+ "checksum": "7b9d637dee9fd86fa50c8fe10c3e247a",
+ "size": 704,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_dict_vartuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_set_list_key]": [
+ {
+ "checksum": "a60822a3ce1414af61142f0a033a7067",
+ "size": 422,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_set_list_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_set_tuple_key]": [
+ {
+ "checksum": "a526cdfb3edb1553d1c0bbee923ae1dd",
+ "size": 1119,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_set_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-to_sorted_set_vartuple_key]": [
+ {
+ "checksum": "3ce2add2330f6f55188b28916029ef5e",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1936842/9dd3254ebbd843324a90765405d3999550dc8d63/resource.tar.gz#test_sql_format.test_expr-to_sorted_set_vartuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-try_member]": [
+ {
+ "checksum": "3bedd6cf1a866afb6bb2f7acaafe5505",
+ "size": 1414,
+ "uri": "https://{canondata_backend}/995452/62dcdc716d63823bd4c68a1e5002cc6c38164d34/resource.tar.gz#test_sql_format.test_expr-try_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-type_as_key]": [
+ {
+ "checksum": "06e10aa05a1864c2016fe5fcc32671bd",
+ "size": 115,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-type_as_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-tzdate_result]": [
+ {
+ "checksum": "e842296714ceed400446fdd87f5a84d1",
+ "size": 545,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-tzdate_result_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-udaf_with_list_zip]": [
+ {
+ "checksum": "2fe133806afbd493374f03573b9cb891",
+ "size": 607,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-udaf_with_list_zip_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-unicode_literals]": [
+ {
+ "checksum": "e8e56821ff77c888713ff8852fb1518a",
+ "size": 318,
+ "uri": "https://{canondata_backend}/1777230/02994451d1c8953a8e9142350351d7282debc251/resource.tar.gz#test_sql_format.test_expr-unicode_literals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-untag]": [
+ {
+ "checksum": "2c240b83d85cdf9339a4cb7196d9d6ca",
+ "size": 172,
+ "uri": "https://{canondata_backend}/1946324/b3f3c389233f62d5a3b5562f5926358e497b4f41/resource.tar.gz#test_sql_format.test_expr-untag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-unwrap_runtime_fail]": [
+ {
+ "checksum": "4d708fcc6a3e0d2c145d5f695c1c2b9f",
+ "size": 59,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-unwrap_runtime_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-uuid]": [
+ {
+ "checksum": "cacf0bfb85ae53b7ae81cebb6ebb6798",
+ "size": 1011,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-uuid_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-uuid_order]": [
+ {
+ "checksum": "1d4a25583aa2db7412b196499b5f8998",
+ "size": 1747,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-uuid_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-variant_list_sort]": [
+ {
+ "checksum": "9681441ad824b8ef58842182661a0392",
+ "size": 226,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-variant_list_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-variant_struct_comp]": [
+ {
+ "checksum": "367d90412c541035e89f3225e992fcee",
+ "size": 2788,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-variant_struct_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-variant_tuple_comp]": [
+ {
+ "checksum": "7ded33f0db98b212eb9bf1e7102cf6c9",
+ "size": 3358,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-variant_tuple_comp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-with_optional_args]": [
+ {
+ "checksum": "865421d9ce67a678da31e93704405c1e",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-with_optional_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-xor]": [
+ {
+ "checksum": "cdfb88e6b1457d32f13f3edc7d8ea833",
+ "size": 488,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-xor_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-yql-10180]": [
+ {
+ "checksum": "6b116a66bb1ec5a2475bd390a91b5173",
+ "size": 717,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-yql-10180_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[expr-yql-15485]": [
+ {
+ "checksum": "f8bb4436f22881a71053c2cece98e181",
+ "size": 2884,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_expr-yql-15485_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-file_constness]": [
+ {
+ "checksum": "7d096ead56afd64d589bc50e1f452c2d",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-file_constness_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-file_list_bools]": [
+ {
+ "checksum": "2e77d566b391070e38ba1f0800f6d57d",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-file_list_bools_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-file_list_simple]": [
+ {
+ "checksum": "c35b36c27b18619d99227461812b7f72",
+ "size": 223,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-file_list_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-file_skip_take]": [
+ {
+ "checksum": "d9f1d414db84c77009afab96f53740ea",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-file_skip_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-parse_file_bad_type_fail]": [
+ {
+ "checksum": "8f9a9b8e0eb20d5773567b20e81073af",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-parse_file_bad_type_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-parse_file_in_select_as_int]": [
+ {
+ "checksum": "22c0715cd1771e4338064891a5662fe7",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-parse_file_in_select_as_int_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-parse_file_in_select_as_str]": [
+ {
+ "checksum": "f95721d3e111646cc8980102bc9fa75a",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-parse_file_in_select_as_str_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-parse_file_in_select_as_uint64]": [
+ {
+ "checksum": "de9166315a9efdca5e2fa53f7fb94915",
+ "size": 140,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-parse_file_in_select_as_uint64_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-second_pass_parse_file_fail]": [
+ {
+ "checksum": "27a9cea9d51503e96306b456f16be6a0",
+ "size": 296,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-second_pass_parse_file_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-where_key_in_file_content]": [
+ {
+ "checksum": "ebd04d1aadb8cb22cc180ed3c3d9f0dd",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-where_key_in_file_content_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-where_key_in_file_content_typed]": [
+ {
+ "checksum": "9555abadda100f244c19bdbade20b516",
+ "size": 116,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-where_key_in_file_content_typed_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[file-where_key_in_get_file_content]": [
+ {
+ "checksum": "c35b36c27b18619d99227461812b7f72",
+ "size": 223,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_file-where_key_in_get_file_content_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_and_where]": [
+ {
+ "checksum": "c2bff0c91d3803106a2b312b52decfa9",
+ "size": 309,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_and_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_by_aster_opt]": [
+ {
+ "checksum": "b6ebbfc5a25ff0e9b66c6a2df53d7bf6",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_by_aster_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_by_group_by_alias_collision]": [
+ {
+ "checksum": "b939931ec4a5eb253d7dc71f63f4c958",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_by_group_by_alias_collision_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_by_opt_dict]": [
+ {
+ "checksum": "06246cbfd61b7ff41c0aa7d582f9388a",
+ "size": 389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_by_opt_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_by_typed_table]": [
+ {
+ "checksum": "c2ab6a41afcd3446394d629eee963386",
+ "size": 128,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_by_typed_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_columns]": [
+ {
+ "checksum": "002f518bf813befc0d4156386743833e",
+ "size": 198,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_columns_by_aggregate]": [
+ {
+ "checksum": "38a027b1e83b73157300dd8c806152d0",
+ "size": 319,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_columns_by_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_columns_non_struct]": [
+ {
+ "checksum": "3811b3a102d1e19c814539801d8cae2b",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_columns_non_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_columns_with_opt_struct]": [
+ {
+ "checksum": "8d162bdb23f39635efaca229f1b54670",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_columns_with_opt_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_corr_name_column]": [
+ {
+ "checksum": "7b2e3939ebc418f40bf50f29bb270462",
+ "size": 784,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_corr_name_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_dict]": [
+ {
+ "checksum": "2b5d6bb168157dca2d20647fb8380807",
+ "size": 564,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_dict_by_opt]": [
+ {
+ "checksum": "e24376b45ab6d8e3ca2aca95c1f2f80f",
+ "size": 416,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_dict_by_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_expr]": [
+ {
+ "checksum": "831856f23a3e3f7f8a5086311ec4f49a",
+ "size": 301,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_expr_groupby]": [
+ {
+ "checksum": "0df6b2a53eb5579e4cc6f2cce17b27ee",
+ "size": 330,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_expr_groupby_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_expr_join]": [
+ {
+ "checksum": "0c9c8bbae78ce3c5b6b8baf783f82330",
+ "size": 282,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_expr_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_expr_struct]": [
+ {
+ "checksum": "7241b84926743588da17848f4a775062",
+ "size": 719,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_expr_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_expr_where]": [
+ {
+ "checksum": "889a4fcea3bea01539733a99bf89f77b",
+ "size": 317,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_expr_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_few_fields]": [
+ {
+ "checksum": "aa6a8b4ea69e53d71864f35323245a73",
+ "size": 473,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_few_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_list]": [
+ {
+ "checksum": "73d42a741819555d09550a40eea1f779",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_list_on_flatten_by]": [
+ {
+ "checksum": "90f76fab73f7121d2906eab89f100440",
+ "size": 497,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_list_on_flatten_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_member_is_struct]": [
+ {
+ "checksum": "2296245cdd345af178781e1e16997147",
+ "size": 363,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_member_is_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_mode]": [
+ {
+ "checksum": "72a1e753d5126021437c820ebf1d2ebc",
+ "size": 846,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_mode_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_one_field]": [
+ {
+ "checksum": "1c1bf73492bb5ed27195d90ea120973f",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_one_field_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_one_field_another]": [
+ {
+ "checksum": "0295f9c94b6ed3e2bd5492b4d0f85147",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_one_field_another_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_two_fields]": [
+ {
+ "checksum": "62a8ee61379630dc1ff1f33778e38835",
+ "size": 386,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_two_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_with_group_by]": [
+ {
+ "checksum": "ae35279a25c1812c233c102056826b0c",
+ "size": 474,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_with_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_with_group_by_expr]": [
+ {
+ "checksum": "76e7e6a06bfc7d9aeed44e0c3bac42fc",
+ "size": 474,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_with_group_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_with_join]": [
+ {
+ "checksum": "93d443f52c9ad92402d7a9e865a80585",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_with_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_with_resource]": [
+ {
+ "checksum": "bef0f0bf8e96e074e6abc938e46ec514",
+ "size": 512,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_with_resource_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-flatten_with_subquery]": [
+ {
+ "checksum": "05b189deb3b37021e0ad48e982847157",
+ "size": 309,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flatten_by-flatten_with_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flatten_by-struct_without_correlation]": [
+ {
+ "checksum": "10f8b8db24c02604dbdc9bcedb081bb4",
+ "size": 465,
+ "uri": "https://{canondata_backend}/1936273/d1ec294b803f798a75479b94edfd85a02ab1eb54/resource.tar.gz#test_sql_format.test_flatten_by-struct_without_correlation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-basic]": [
+ {
+ "checksum": "069cf1915c351922737f1b30eb7149e7",
+ "size": 328,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-basic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-evaluate_expr]": [
+ {
+ "checksum": "74757e00702cff8c10136f923425b556",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-evaluate_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-flatten_by]": [
+ {
+ "checksum": "f9cdb04a207c0d77621f18e10a30b0d3",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-flatten_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-functions]": [
+ {
+ "checksum": "01db4a9d8dedcc1bc6ad8c11a35d163e",
+ "size": 1227,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-functions_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-group_by2]": [
+ {
+ "checksum": "75cc63643a1cc93df51a54f49c11a7c8",
+ "size": 366,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-group_by2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-group_by]": [
+ {
+ "checksum": "8eb5aca8aa56f1c33995a33bc6eeac23",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-inside_evaluate]": [
+ {
+ "checksum": "75e922ce9ac0323e98be53327cf59f8c",
+ "size": 387,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-inside_evaluate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-struct_literals_vs_columns]": [
+ {
+ "checksum": "ece03d62d28c6929675c3c1e93f73e47",
+ "size": 252,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-struct_literals_vs_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-text_and_bytes]": [
+ {
+ "checksum": "61a1b7039168cdd805fdc6a6e7a1fa1a",
+ "size": 388,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-text_and_bytes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-unused_types]": [
+ {
+ "checksum": "9733ca416c098604ad8723aaabb57bab",
+ "size": 297,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-unused_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[flexible_types-with_typeof]": [
+ {
+ "checksum": "8bca87cb61f323922994e5de13daa220",
+ "size": 568,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_flexible_types-with_typeof_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-double_input]": [
+ {
+ "checksum": "f6d4d9812454118fa100d696ac709b40",
+ "size": 418,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-double_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-empty_out_hor_join]": [
+ {
+ "checksum": "f80ba317a5740ffd13beb97c3cfb068d",
+ "size": 260,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-empty_out_hor_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-filters]": [
+ {
+ "checksum": "38fd4320d9d113d223f4aadbce5f74c7",
+ "size": 250,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-filters_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-fuse_multi_outs1]": [
+ {
+ "checksum": "21cc8eb1f5711a2f456cd4901c3f891c",
+ "size": 1077,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-fuse_multi_outs1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-fuse_multi_outs2]": [
+ {
+ "checksum": "0bec0592fd9516719c279afd7dbd85c3",
+ "size": 1019,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-fuse_multi_outs2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-fuse_multi_usage]": [
+ {
+ "checksum": "95041ee17584e7d7f2e4139205c158af",
+ "size": 362,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-fuse_multi_usage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-group_ranges]": [
+ {
+ "checksum": "33759eb1b76db711bf239ad11b0ad26b",
+ "size": 356,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-group_ranges_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-group_sampling]": [
+ {
+ "checksum": "309b2af5387b50e85d8936da516268f5",
+ "size": 689,
+ "uri": "https://{canondata_backend}/1814674/bca02b1dd10b08c3688b45cbf8b3a4a1bd65d266/resource.tar.gz#test_sql_format.test_hor_join-group_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-group_yamr]": [
+ {
+ "checksum": "3f5b57c6f316822fce859e14d56fdb79",
+ "size": 474,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-group_yamr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-less_outs]": [
+ {
+ "checksum": "fdf593849844f492058bb496a07379c9",
+ "size": 552,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-less_outs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-max_in_tables]": [
+ {
+ "checksum": "c3a0444430d76b059a7307d6de5f5a16",
+ "size": 538,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-max_in_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-max_outtables]": [
+ {
+ "checksum": "2dcaaa33efa177285fe7abc2f66505b8",
+ "size": 620,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-max_outtables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-merge_multiouts_all]": [
+ {
+ "checksum": "00c317c441355810ebfed83d74c20177",
+ "size": 981,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-merge_multiouts_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-merge_multiouts_part]": [
+ {
+ "checksum": "ed37f83677ffeee41dea1f75ef9eae1c",
+ "size": 897,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-merge_multiouts_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-merge_multiouts_reuse]": [
+ {
+ "checksum": "ce2ef2f4b9e30c35e164cfb9e9a9e75d",
+ "size": 981,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-merge_multiouts_reuse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_hor_join]": [
+ {
+ "checksum": "918a11b42cf07c1ba823619f303090f3",
+ "size": 383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_hor_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_max_outtables]": [
+ {
+ "checksum": "04fed1fdedc010d1fe5f0e73065aa944",
+ "size": 602,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_max_outtables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_mem_limit]": [
+ {
+ "checksum": "c2b3e4bbd82b418774caa31267b26a20",
+ "size": 506,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_mem_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_range]": [
+ {
+ "checksum": "be25c04867d93453275a2165311c47de",
+ "size": 359,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_sampling]": [
+ {
+ "checksum": "d4e07d971c0f7a6b2d0ea822ac126144",
+ "size": 568,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-out_table_record]": [
+ {
+ "checksum": "c79ed5106f8f5748e42fdbdc81ac76bf",
+ "size": 412,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-out_table_record_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-row_num_per_sect]": [
+ {
+ "checksum": "b53d2fefe84e936a66a17c9ed7b0e373",
+ "size": 443,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-row_num_per_sect_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-runtime_dep]": [
+ {
+ "checksum": "c96ed4bb657cba089038b1bcbb3f4bbd",
+ "size": 338,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-runtime_dep_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-skip_sampling]": [
+ {
+ "checksum": "d12b9fd4671194ef6df759aeb0c86123",
+ "size": 520,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-skip_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-skip_yamr]": [
+ {
+ "checksum": "a1444698f879f780dd06ab7bebc2fce1",
+ "size": 381,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-skip_yamr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-sorted_out]": [
+ {
+ "checksum": "7f5359171665715e2a91752355961f85",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-sorted_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-sorted_out_mix]": [
+ {
+ "checksum": "cc4283d7e0f6479882acf46c73629907",
+ "size": 866,
+ "uri": "https://{canondata_backend}/937458/ee77031f79efe530ec1a9f6d0ade947cf33aa7ed/resource.tar.gz#test_sql_format.test_hor_join-sorted_out_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-table_record]": [
+ {
+ "checksum": "d39b629806c95a136e9edb2f61e13d85",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-table_record_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-yield_off]": [
+ {
+ "checksum": "77d1993614d44f4ea0f8a6c1eaf691d6",
+ "size": 525,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-yield_off_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-yield_on]": [
+ {
+ "checksum": "ac3823449c2087ae39023e67a942377b",
+ "size": 512,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-yield_on_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-yql-12610_old_table_props]": [
+ {
+ "checksum": "11139db2ac22c33ca8e46a2004f634fd",
+ "size": 410,
+ "uri": "https://{canondata_backend}/1936273/38e29812fe36ece2bf2547f0a4f7e8c5bc3ea5b3/resource.tar.gz#test_sql_format.test_hor_join-yql-12610_old_table_props_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[hor_join-yql-6477_table_path]": [
+ {
+ "checksum": "279fcc142e32ba48222b405d91446ac4",
+ "size": 371,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_hor_join-yql-6477_table_path_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-basic_in]": [
+ {
+ "checksum": "a126c3c9e9beecf782eab1d130f78c53",
+ "size": 486,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-basic_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-huge_in]": [
+ {
+ "checksum": "47200457418ffeb1a08349eeec581827",
+ "size": 52947,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-huge_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi]": [
+ {
+ "checksum": "3b62ad076e0b5a6e0248f5a94d342c22",
+ "size": 647,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_dict1]": [
+ {
+ "checksum": "d1684c065e4bc193e5798be73dc6a7ae",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_dict1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_dict]": [
+ {
+ "checksum": "88d565e11dcdbb71e12127320804bc10",
+ "size": 865,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_empty]": [
+ {
+ "checksum": "10a5ea5210586f227f0bc7d9a149dc32",
+ "size": 479,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_join]": [
+ {
+ "checksum": "680eb20ef06fdb483005b782a6e64b29",
+ "size": 2196,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_list1]": [
+ {
+ "checksum": "1a90ed23030acf8a355f967b89bca7af",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_list1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_list]": [
+ {
+ "checksum": "5541ef14e41a21853d875f53ab09def3",
+ "size": 686,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_set]": [
+ {
+ "checksum": "d3e15e649ec8a3a926d31c9644a42628",
+ "size": 675,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_set_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_ansi_variant]": [
+ {
+ "checksum": "258a0fd21403d03ce4b26e811a5b5fce",
+ "size": 620,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_ansi_variant_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_compact_distinct]": [
+ {
+ "checksum": "c08fd169183107d45648ae6be81d4cbf",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_compact_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_enum_single0]": [
+ {
+ "checksum": "ef08429b21eb451087a6911933ad769e",
+ "size": 52,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_enum_single0_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_enum_single1]": [
+ {
+ "checksum": "75d73ea42cb087f09c823c6c2757725d",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_enum_single1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_exists_immediate_nested_subq]": [
+ {
+ "checksum": "af4233bf70e1ddee579cb1dbd2054020",
+ "size": 531,
+ "uri": "https://{canondata_backend}/1814674/98d868fbe8a73451900590bc9bc738f8e9f56225/resource.tar.gz#test_sql_format.test_in-in_exists_immediate_nested_subq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_immediate_subquery]": [
+ {
+ "checksum": "98f5623667870f141a414775093427fc",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_immediate_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_noansi]": [
+ {
+ "checksum": "2fa5f5bf54071d4e67deb5570dae99ab",
+ "size": 641,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_noansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_noansi_empty]": [
+ {
+ "checksum": "d60f513b71e39df1bf01639c77e5a71e",
+ "size": 510,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_noansi_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_noansi_join]": [
+ {
+ "checksum": "46414054c0ebeae0ca76c4e4d5b1caf8",
+ "size": 2257,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_noansi_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_noansi_list_dict]": [
+ {
+ "checksum": "14f0a8806e0d3ff56b48eb3bcc5afcd5",
+ "size": 438,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_noansi_list_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_nonliteral_tuple]": [
+ {
+ "checksum": "931b2ea7e3274b7d33e16887b20f538e",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1937424/677402a69ee72f43067364c12feb7d084f4e8974/resource.tar.gz#test_sql_format.test_in-in_nonliteral_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_nonliteral_tuple_ansi]": [
+ {
+ "checksum": "974c0221f872a06d25af87b6b541b4c5",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1937424/677402a69ee72f43067364c12feb7d084f4e8974/resource.tar.gz#test_sql_format.test_in-in_nonliteral_tuple_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_scalar_vector_subquery]": [
+ {
+ "checksum": "eff6e7882ac6fddbfefb1c87da845181",
+ "size": 1050,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_scalar_vector_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_sorted]": [
+ {
+ "checksum": "fa79b6e16a95d3dc3823b7322378b196",
+ "size": 179,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_sorted_by_tuple]": [
+ {
+ "checksum": "79017c6d3af76042679a50902c4357a3",
+ "size": 299,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_sorted_by_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_tablesource_on_raw_list]": [
+ {
+ "checksum": "75835d2e0f243ed247f2b58595f9ee49",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_tablesource_on_raw_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_tablesource_to_equijoin]": [
+ {
+ "checksum": "b579014424a464997cf9126277b85d5a",
+ "size": 1145,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_in-in_tablesource_to_equijoin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_tuple_check0_fail]": [
+ {
+ "checksum": "e105585bea30c4f753859465f46401a0",
+ "size": 153,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_tuple_check0_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_tuple_check1_fail]": [
+ {
+ "checksum": "a11564df4ca7a97c800cf88826c678ad",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_tuple_check1_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_tuple_table]": [
+ {
+ "checksum": "dfd414a1b30369efd460f71973301165",
+ "size": 54,
+ "uri": "https://{canondata_backend}/1777230/1d0cbdf0f28fc097c47554fb42102e0b3696f6c3/resource.tar.gz#test_sql_format.test_in-in_tuple_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_types_cast]": [
+ {
+ "checksum": "8f3e130cc78d86fdc36ecd7c233b3470",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_types_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_types_cast_all]": [
+ {
+ "checksum": "6add4e363fb7319ef58b3e0aa4b60673",
+ "size": 148,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_types_cast_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_cast]": [
+ {
+ "checksum": "c143d5f0a01686fd2553701f1aac9d14",
+ "size": 298,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_list_dict]": [
+ {
+ "checksum": "ccf34a081119de14afce20b402d49e20",
+ "size": 219,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_list_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_literal_list_of_structs]": [
+ {
+ "checksum": "98c11f14a1022af73edc30fd02892848",
+ "size": 98,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_literal_list_of_structs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_literal_list_of_structs_ansi]": [
+ {
+ "checksum": "a04e6017126a052bef992634a599fa92",
+ "size": 148,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_literal_list_of_structs_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_nulls_and_optionals]": [
+ {
+ "checksum": "1547f1f39f531ba3755ea04e26e4fb37",
+ "size": 701,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_nulls_and_optionals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_nulls_and_optionals_extra]": [
+ {
+ "checksum": "634d513f13b0ffa22ea97ba318749b45",
+ "size": 461,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_nulls_and_optionals_extra_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_nulls_and_optionals_extra_ansi]": [
+ {
+ "checksum": "9d161a990876882d419dd13c948604a3",
+ "size": 481,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_nulls_and_optionals_extra_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_opt_tuple]": [
+ {
+ "checksum": "004cda8cba1a11f834049639b0a864d3",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_opt_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_table_of_tuples]": [
+ {
+ "checksum": "1f2a74f8e6caebc03a9b57396161fd88",
+ "size": 350,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_table_of_tuples_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_tuple]": [
+ {
+ "checksum": "ae457e8e8c2c1fbfa4d0477156e6394b",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-in_with_tuple_simple]": [
+ {
+ "checksum": "887b89ba75978b1d20a344131c07988c",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_tuple_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-large_in_YQL-19183]": [
+ {
+ "checksum": "43ec0a0e466a89676506fd531534cade",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql_format.test_in-large_in_YQL-19183_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-small_in_YQL-19183]": [
+ {
+ "checksum": "c3241d35bbf2a2f6307a447c2994557e",
+ "size": 58,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql_format.test_in-small_in_YQL-19183_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-yql-10038]": [
+ {
+ "checksum": "65c9b60b81a2689c61b3dff1ff571b97",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_in-yql-10038_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-yql-14677]": [
+ {
+ "checksum": "3324c5569be16e27400dff5a8ec362bb",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_in-yql-14677_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-after_group_by]": [
+ {
+ "checksum": "a34b346abfc5cb62a58dc12574695076",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-after_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-anonymous_tables]": [
+ {
+ "checksum": "038ee7fa6b4f1c76b65f367c628f4322",
+ "size": 245,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-anonymous_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-append]": [
+ {
+ "checksum": "d9d6d1abec083668c4c728025873ac47",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-append_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-append_after_replace]": [
+ {
+ "checksum": "da20b3ceed8252e72a81d4871152d22e",
+ "size": 481,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-append_after_replace_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-append_missing_null]": [
+ {
+ "checksum": "ead39c1c5d5f76e649f67bd8819090fa",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-append_missing_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-append_sorted]": [
+ {
+ "checksum": "d1853d5d720392d1d1b3f8f06d65d0c0",
+ "size": 675,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-append_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-double_append_to_anonymous]": [
+ {
+ "checksum": "9dc293eb09a0a2e763d81f3566a1a49d",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-double_append_to_anonymous_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-drop_sortness]": [
+ {
+ "checksum": "a4e211b848dedbde2e867431ee29f83d",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-drop_sortness_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-fail_read_view_after_modify]": [
+ {
+ "checksum": "264d5cdf54c84403519f5d43d8396572",
+ "size": 173,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-fail_read_view_after_modify_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-from_two_sorted_by_calc]": [
+ {
+ "checksum": "ad4ca1426c5ded7173a4fa3c1e0bc348",
+ "size": 299,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-from_two_sorted_by_calc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-insert_from_other]": [
+ {
+ "checksum": "c6c685d3d3ecd070e1b58df06131add5",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-insert_from_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-insert_null]": [
+ {
+ "checksum": "053254e4881bb24e14b1ddc7819c4c79",
+ "size": 53,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-insert_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-insert_relabeled]": [
+ {
+ "checksum": "c731da27c43843b67007a79410876015",
+ "size": 361,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-insert_relabeled_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-keepmeta]": [
+ {
+ "checksum": "8f38949f2e511120aff98055add5d1d2",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-keepmeta_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-literals_to_string]": [
+ {
+ "checksum": "01b4a4774a372f281dcfed0c9ca0115e",
+ "size": 313,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-literals_to_string_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-merge_publish]": [
+ {
+ "checksum": "d9bbb17cb9071fa5eac53095c4a3b8a9",
+ "size": 602,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-merge_publish_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-multiappend_sorted]": [
+ {
+ "checksum": "e870ff98d3450e92b9f7b1456e3f77bc",
+ "size": 1535,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-multiappend_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-override]": [
+ {
+ "checksum": "c6c685d3d3ecd070e1b58df06131add5",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-override_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-part_sortness]": [
+ {
+ "checksum": "a8c655bca002365b31e8d8d377c653b1",
+ "size": 110,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-part_sortness_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-replace_inferred]": [
+ {
+ "checksum": "6cbcbf72d3915ba2dcf0f840aa06a5c7",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-replace_inferred_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-replace_inferred_op]": [
+ {
+ "checksum": "962ec80bb923e1b5405bc7cef840dae8",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-replace_inferred_op_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-replace_ordered_by_key]": [
+ {
+ "checksum": "e4f09c1c9b4260fcadef370c9ba63c0f",
+ "size": 350,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-replace_ordered_by_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-replace_ordered_by_key_desc]": [
+ {
+ "checksum": "e05c5d171c7d4295644eb37f48070aa8",
+ "size": 355,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-replace_ordered_by_key_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_after_insert_relabeled]": [
+ {
+ "checksum": "f88ea1ce2e42f5199c2a337cd72552e0",
+ "size": 473,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_after_insert_relabeled_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_after_replace]": [
+ {
+ "checksum": "c5f0474dc9d8335e895b748405acce3d",
+ "size": 421,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_after_replace_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_after_replace_unwrap]": [
+ {
+ "checksum": "2a503de6fbf463398f2c5fff9613680d",
+ "size": 463,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_after_replace_unwrap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_operate_with_columns]": [
+ {
+ "checksum": "50859e6f1655d9c1c5f01e1e91ef5825",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_operate_with_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_relabel]": [
+ {
+ "checksum": "929c26eabffed54a222777e150993141",
+ "size": 340,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_relabel_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_subquery]": [
+ {
+ "checksum": "1a26035deb26a3b06af7b6aee9458efe",
+ "size": 167,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-select_with_sort_limit]": [
+ {
+ "checksum": "2bf715cc77ca9ae2f96ffa10b19b2dc1",
+ "size": 258,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-select_with_sort_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-trivial_literals]": [
+ {
+ "checksum": "aea2216e704fbe318ce66ca0a0587c47",
+ "size": 265,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-trivial_literals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-trivial_literals_multirow]": [
+ {
+ "checksum": "44230280aa21ecfb6185b33eba080b2f",
+ "size": 330,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-trivial_literals_multirow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-trivial_select]": [
+ {
+ "checksum": "31c93bc3f3fb797f5bc864769d8e3244",
+ "size": 293,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-trivial_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-two_input_tables]": [
+ {
+ "checksum": "3899f1d60b915e82cd24adb493b0e66a",
+ "size": 411,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-two_input_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-udf_empty]": [
+ {
+ "checksum": "1979e17478df8364fea989e181e5a108",
+ "size": 369,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-udf_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-unique_distinct_hints]": [
+ {
+ "checksum": "5f5639f05f0f316521f467781fb10a41",
+ "size": 909,
+ "uri": "https://{canondata_backend}/1946324/0baf96cbe0e264fceeba707a8c23c220f2a8ab83/resource.tar.gz#test_sql_format.test_insert-unique_distinct_hints_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-use_anon_table_before_commit_fail]": [
+ {
+ "checksum": "ef426f4b2f994739441cf52f5a299272",
+ "size": 98,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-use_anon_table_before_commit_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-use_anon_table_without_fill_fail]": [
+ {
+ "checksum": "5839f14b91a2594b096fd8fa3845c8bb",
+ "size": 57,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-use_anon_table_without_fill_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-values_subquery]": [
+ {
+ "checksum": "7a9284539b7555c0af2ed8626254099c",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-values_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-yql-13083]": [
+ {
+ "checksum": "9b8e2d163fbda40f87899809c86264b2",
+ "size": 440,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-yql-13083_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert-yql-14538]": [
+ {
+ "checksum": "9b0bbd9973d26a43fc3912a148ec4a66",
+ "size": 228,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert-yql-14538_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-break_sort_fail]": [
+ {
+ "checksum": "1aa0b06f550e578a11e5eb6c19f34d62",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-break_sort_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-break_unique_fail]": [
+ {
+ "checksum": "a43dbba09ccf97567cc3719be2a8e491",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-break_unique_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-from_empty]": [
+ {
+ "checksum": "499a36ea5d03760d776312b3b8b1a480",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-from_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-keep_meta]": [
+ {
+ "checksum": "bc83ed7b7e8d188079cc9e6901345d45",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-keep_meta_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-keep_unique]": [
+ {
+ "checksum": "a2758f0dbd551fe29c6421638ff5931e",
+ "size": 219,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-keep_unique_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-non_existing_fail]": [
+ {
+ "checksum": "c0ecc84adbbad89cdd70639ca02e4681",
+ "size": 93,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-non_existing_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-not_all_fail]": [
+ {
+ "checksum": "14537225c9d05e5510a072db20d756c9",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-not_all_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-overlaping_fail]": [
+ {
+ "checksum": "a7c22f5cd90b816dc62d1f40756fb1d1",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-overlaping_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-several1]": [
+ {
+ "checksum": "beef45288001cde3026fd08601aa2c7a",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-several1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-several2]": [
+ {
+ "checksum": "41744f59f962b0ca5f552fd23c509ee0",
+ "size": 209,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-several2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-to_empty]": [
+ {
+ "checksum": "d52fb9bc58b496f0def595013e22684d",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-to_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-truncate_and_append]": [
+ {
+ "checksum": "1c24f429b83e1d2159f669d3ebd86b80",
+ "size": 203,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-truncate_and_append_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[insert_monotonic-truncate_fail]": [
+ {
+ "checksum": "9439f178a0e4533c1cd340234ce78afe",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_insert_monotonic-truncate_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-aggr_diff_order]": [
+ {
+ "checksum": "1655f3a7e96c779146fc048709561cc9",
+ "size": 494,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-aggr_diff_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-alias_where_group]": [
+ {
+ "checksum": "22a7b41ca879d216456b2964efce6f5c",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-alias_where_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-anyjoin_common_dup]": [
+ {
+ "checksum": "bfb503adf441f580dab262121af76df0",
+ "size": 503,
+ "uri": "https://{canondata_backend}/1784117/7b40c8bc89d621b5f023787bed20d97e19f45312/resource.tar.gz#test_sql_format.test_join-anyjoin_common_dup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-anyjoin_common_nodata_keys]": [
+ {
+ "checksum": "412c8c47a702d2732915865e173cd7c1",
+ "size": 528,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-anyjoin_common_nodata_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-anyjoin_common_nodup]": [
+ {
+ "checksum": "bfb503adf441f580dab262121af76df0",
+ "size": 503,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-anyjoin_common_nodup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-anyjoin_merge_nodup]": [
+ {
+ "checksum": "56db9946624c097156db86f407c685a6",
+ "size": 518,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-anyjoin_merge_nodup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_dis_in]": [
+ {
+ "checksum": "dd32a605eeabea954d5e8162f03bd5f4",
+ "size": 488,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_dis_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_dis_in_in]": [
+ {
+ "checksum": "aa86512275362c192871be18cb6cc0ac",
+ "size": 296,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_dis_in_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_dis_in_in_in]": [
+ {
+ "checksum": "56f399d158dae303624607918ce170cc",
+ "size": 390,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_dis_in_in_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_in]": [
+ {
+ "checksum": "3588f9c8cd6b64de2e2b05a968ef15d7",
+ "size": 470,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_in_in]": [
+ {
+ "checksum": "8cf3fafc4bf30380be5f2ddc93ad2bed",
+ "size": 287,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_in_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-bush_in_in_in]": [
+ {
+ "checksum": "4337dd37969830e7640a5ef1757a8d9b",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-bush_in_in_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-cbo_4tables]": [
+ {
+ "checksum": "f98d46ae919b4666a761319656bed043",
+ "size": 498,
+ "uri": "https://{canondata_backend}/1937367/865cf26569bab3fead160e174e7798fb2cbf37bf/resource.tar.gz#test_sql_format.test_join-cbo_4tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-cbo_4tables_only_sorted_merge]": [
+ {
+ "checksum": "8aaeb2968b47675636ddd81f957e996f",
+ "size": 533,
+ "uri": "https://{canondata_backend}/1937367/865cf26569bab3fead160e174e7798fb2cbf37bf/resource.tar.gz#test_sql_format.test_join-cbo_4tables_only_sorted_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-commonjoin_unused_keys]": [
+ {
+ "checksum": "e82d7a02c02072d11469ca93362e5bbd",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-commonjoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-compact_join]": [
+ {
+ "checksum": "88f2bff796a94146ca3b95cb628e6612",
+ "size": 326,
+ "uri": "https://{canondata_backend}/1600758/3e738bc444a057173a62d3d1ec31422cdc29e486/resource.tar.gz#test_sql_format.test_join-compact_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-convert_check_key_mem2]": [
+ {
+ "checksum": "c27b2dd2ecb0a16f295bea4f5cb5a764",
+ "size": 432,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-convert_check_key_mem2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-convert_check_key_mem]": [
+ {
+ "checksum": "fadd5501a8267e8766e81da7f540f8bc",
+ "size": 1252,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-convert_check_key_mem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-convert_key]": [
+ {
+ "checksum": "e52069a677e9a7b895475fe789a77841",
+ "size": 585,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_join-convert_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-count_bans]": [
+ {
+ "checksum": "795867b40bbd1692311a66e9cb29f9ed",
+ "size": 886,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_join-count_bans_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-cross_join_with_lazy_list]": [
+ {
+ "checksum": "02b2c8d65c090ccd68d72a454400686b",
+ "size": 318,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-cross_join_with_lazy_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-do_not_suppres_equijoin_input_sorts]": [
+ {
+ "checksum": "d3e970630b591a773a59ed5ec3c33861",
+ "size": 183,
+ "uri": "https://{canondata_backend}/1942415/648a56e0787ca3112c139c169f33c33294672c1c/resource.tar.gz#test_sql_format.test_join-do_not_suppres_equijoin_input_sorts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-emptyjoin_unused_keys]": [
+ {
+ "checksum": "f814fee871da64061f66b76cf89bdd4e",
+ "size": 256,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-emptyjoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-equi_join_by_expr]": [
+ {
+ "checksum": "ac32a8b1ca9bb543be6f211ec2a4bef9",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-equi_join_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-equi_join_three_asterisk]": [
+ {
+ "checksum": "c047e8315431b12b441d9c25700bb917",
+ "size": 200,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-equi_join_three_asterisk_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-equi_join_three_asterisk_eval]": [
+ {
+ "checksum": "41c0944039791981cf0220f5e1adba60",
+ "size": 270,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-equi_join_three_asterisk_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-equi_join_three_simple]": [
+ {
+ "checksum": "92e2d7eca418dcbce11e33f88a10c25e",
+ "size": 148,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-equi_join_three_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-equi_join_two_mult_keys]": [
+ {
+ "checksum": "6dd3d991ae348ac116edd5f914cd53ae",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-equi_join_two_mult_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-filter_joined]": [
+ {
+ "checksum": "9b7061a9979ba57b892cb3ed24c9f2fc",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-filter_joined_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-flatten_columns1]": [
+ {
+ "checksum": "446136d37dbeae2088bc5857fce28fb1",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-flatten_columns1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-flatten_columns2]": [
+ {
+ "checksum": "02037fd89578e2efb6994a527a4d4882",
+ "size": 429,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-flatten_columns2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-force_merge_join]": [
+ {
+ "checksum": "643a93188b3456340f2d2e80d5280582",
+ "size": 335,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-force_merge_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-from_in_front_join]": [
+ {
+ "checksum": "8c32368eb99ec1da02b959860ab1dcd9",
+ "size": 167,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-from_in_front_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-full_equal_not_null]": [
+ {
+ "checksum": "d3c29f8d0f724fea86bfd538a0a6d974",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-full_equal_not_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-full_equal_null]": [
+ {
+ "checksum": "3c2e034f3b2689de2749bd84495aee52",
+ "size": 271,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-full_equal_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-full_join]": [
+ {
+ "checksum": "6f39208cf46992d108d93c30a1bfade0",
+ "size": 280,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-full_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-full_trivial]": [
+ {
+ "checksum": "2765dd9571352bb3b55c61f681047d73",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-full_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-full_trivial_udf_call]": [
+ {
+ "checksum": "e3daba6a4fc921c76cc294716d6d0b7e",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-full_trivial_udf_call_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-grace_join1]": [
+ {
+ "checksum": "bc02bb8af1d7da94583d591af7a82fec",
+ "size": 227,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-grace_join1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-grace_join2]": [
+ {
+ "checksum": "7656454a9434ff51ab800908ae346c42",
+ "size": 233,
+ "uri": "https://{canondata_backend}/1871182/e726c72e47d3c077e5ba351b53dba460544020da/resource.tar.gz#test_sql_format.test_join-grace_join2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-group_compact_by]": [
+ {
+ "checksum": "ff172345b6e6f799ca8e0d5fea53189d",
+ "size": 484,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-group_compact_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inmem_by_uncomparable_structs]": [
+ {
+ "checksum": "20402cfc5952e5ceaddfbabdbb83fb98",
+ "size": 1111,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inmem_by_uncomparable_structs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inmem_by_uncomparable_tuples]": [
+ {
+ "checksum": "3d6232ebaa6521cfc26ae85e4103c943",
+ "size": 1129,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inmem_by_uncomparable_tuples_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inmem_with_null_key]": [
+ {
+ "checksum": "6fe6f560dc34d05a477a9dcda51d401f",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inmem_with_null_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inmem_with_set_key]": [
+ {
+ "checksum": "9fc8b32523e8ce97343d515e11bd4633",
+ "size": 1035,
+ "uri": "https://{canondata_backend}/1599023/14a33c83ee9ed00bbb41531eba5a0e67835b3ba6/resource.tar.gz#test_sql_format.test_join-inmem_with_set_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inmem_with_set_key_any]": [
+ {
+ "checksum": "23792c7c0533b85348359838bfc719c1",
+ "size": 1051,
+ "uri": "https://{canondata_backend}/1599023/14a33c83ee9ed00bbb41531eba5a0e67835b3ba6/resource.tar.gz#test_sql_format.test_join-inmem_with_set_key_any_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_all]": [
+ {
+ "checksum": "cddfeb0cc96951d1e6d74db24c2b36fa",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_all_right]": [
+ {
+ "checksum": "736d9595dcdd29a4ecb63b658a382764",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_all_right_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_grouped]": [
+ {
+ "checksum": "30012ce4af962ff138f8437dbfcb8f74",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_grouped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_grouped_by_expr]": [
+ {
+ "checksum": "f8fbc613baecea3b8ccce1fe016090c6",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_grouped_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_on_key_only]": [
+ {
+ "checksum": "a85681920f494648c1a62f3bfda6af8a",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_on_key_only_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_trivial]": [
+ {
+ "checksum": "7d61a082a5ee06df7a3543f6959e2586",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_trivial_from_concat]": [
+ {
+ "checksum": "44ddc10ea2b9d0cd07eb4d0c1ee33181",
+ "size": 186,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_trivial_from_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_with_order]": [
+ {
+ "checksum": "5a146a727192658f0be1cfd4d4b1cbd3",
+ "size": 173,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_with_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-inner_with_select]": [
+ {
+ "checksum": "4eb38ada3832fc3f89eeead610f97fae",
+ "size": 279,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-inner_with_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_and_distinct_key]": [
+ {
+ "checksum": "cb0a3d8c67a501ee409463040ccd6b1f",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_and_distinct_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_cbo_3_tables]": [
+ {
+ "checksum": "45434ffe94d6a33e9e350bea74664c2b",
+ "size": 318,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_cbo_3_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_comp_common_table]": [
+ {
+ "checksum": "9edd9688502f3e040a161b4185ea6c74",
+ "size": 1184,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_comp_common_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_comp_inmem]": [
+ {
+ "checksum": "7ee71ca2cb06134cbcbf3965f56bfb9b",
+ "size": 949,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_comp_inmem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_comp_map_table]": [
+ {
+ "checksum": "49afaef3071af2cb5270845eaef8eeee",
+ "size": 828,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_comp_map_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_key_cmp_udf]": [
+ {
+ "checksum": "8fb1e3806060d047e9907040fcc89643",
+ "size": 234,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_key_cmp_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_left_cbo]": [
+ {
+ "checksum": "911dfe0645221f7dbb0ecf1e3086741a",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_left_cbo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_no_correlation_in_order_by]": [
+ {
+ "checksum": "21b3d1d59870b28b2c76dad3194ab8cc",
+ "size": 321,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_no_correlation_in_order_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_right_cbo]": [
+ {
+ "checksum": "c4b4bb528758b429a0689f8614bef49a",
+ "size": 186,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_right_cbo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_semi_correlation_in_order_by]": [
+ {
+ "checksum": "c2c67e9bcfbf1f36b18805b2c33cfb8b",
+ "size": 323,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_semi_correlation_in_order_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_table_conflict_fail]": [
+ {
+ "checksum": "f9c6c9c84d57a19de1b33ebb7534314f",
+ "size": 370,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_table_conflict_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_with_duplicate_keys_on_sorted]": [
+ {
+ "checksum": "720f10a45a4973b484c4e9fb80a9373c",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_with_duplicate_keys_on_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_without_column]": [
+ {
+ "checksum": "8fbefb1c214e5ddb9275f03d1d0cc87a",
+ "size": 371,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_without_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_without_correlation_and_dict_access]": [
+ {
+ "checksum": "e25fd1e47027bee6739cffef5a6f1d8e",
+ "size": 537,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_without_correlation_and_dict_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_without_correlation_and_struct_access]": [
+ {
+ "checksum": "99bdaf6e4d0e66b567b978daf812c8da",
+ "size": 400,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_without_correlation_and_struct_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-join_without_correlation_names]": [
+ {
+ "checksum": "691348870876f7524aaaadfdd8043301",
+ "size": 353,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-join_without_correlation_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-late_mergejoin_on_empty]": [
+ {
+ "checksum": "922579a7e0129f35e8c35c76ec62b2fe",
+ "size": 387,
+ "uri": "https://{canondata_backend}/1903280/52d88c0d802527cbf1026e5e4361d6039ddc719d/resource.tar.gz#test_sql_format.test_join-late_mergejoin_on_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_all]": [
+ {
+ "checksum": "4a1e64507b64ca6603552494104ca89f",
+ "size": 124,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_cast_to_string]": [
+ {
+ "checksum": "77e057fec260bbedf7ca948025e78d42",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_cast_to_string_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_null_column]": [
+ {
+ "checksum": "b0ee37f1a914791e6ef49a571ea619c0",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_join_null_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_right_pushdown_nested_left]": [
+ {
+ "checksum": "776b40301cb4655b410722d76bbdc773",
+ "size": 298,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql_format.test_join-left_join_right_pushdown_nested_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_right_pushdown_nested_right]": [
+ {
+ "checksum": "541e77738ddb1f1ce9fbe7775ebd4c8d",
+ "size": 279,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql_format.test_join-left_join_right_pushdown_nested_right_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_right_pushdown_no_opt]": [
+ {
+ "checksum": "04db1a41e025750e06f939339c021c47",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql_format.test_join-left_join_right_pushdown_no_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_right_pushdown_null]": [
+ {
+ "checksum": "13b54d7aeb77ba7eb6f043304269a5a5",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql_format.test_join-left_join_right_pushdown_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_right_pushdown_simple]": [
+ {
+ "checksum": "bc6735e207c21ee82676c81d631bdb7a",
+ "size": 190,
+ "uri": "https://{canondata_backend}/1942415/c55dba912834dcbf5fba9b2e00273cf3e18db77a/resource.tar.gz#test_sql_format.test_join-left_join_right_pushdown_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_join_with_self_aggr]": [
+ {
+ "checksum": "6aa9fc1693ffa2c7f71db01d85fd5d52",
+ "size": 865,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_join_with_self_aggr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_null_literal]": [
+ {
+ "checksum": "eee2f546112d5e9fc0a0f0472783f790",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_null_literal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_only_semi_and_other]": [
+ {
+ "checksum": "43140ecdece6e3c0c757db2387ac7256",
+ "size": 521,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_only_semi_and_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_only_with_other]": [
+ {
+ "checksum": "22afda7a4aedcf84e18c3edce26b8cce",
+ "size": 439,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_only_with_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_semi_with_other]": [
+ {
+ "checksum": "12034348a92a20c45e91645dd8f4009c",
+ "size": 470,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_semi_with_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-left_trivial]": [
+ {
+ "checksum": "07c238005fb4e97984eb78f85f5403ee",
+ "size": 167,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-left_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_bug7646_csee]": [
+ {
+ "checksum": "f03cb22a129e6cf7e76f884cba5cefa7",
+ "size": 905,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_bug7646_csee_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_bug7646_subst]": [
+ {
+ "checksum": "df554b59e71b9d38b4954f2497b0db6f",
+ "size": 861,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_bug7646_subst_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_bug8533]": [
+ {
+ "checksum": "7b045d5da62bb1f8f5d5f9f2b0e8f61c",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_bug8533_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_inner]": [
+ {
+ "checksum": "1c10b0cbac06b0286e862823c973a0a7",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_inner_1o2o]": [
+ {
+ "checksum": "1c10b0cbac06b0286e862823c973a0a7",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_inner_1o2o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_inner_1o]": [
+ {
+ "checksum": "1c10b0cbac06b0286e862823c973a0a7",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_inner_1o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_inner_2o]": [
+ {
+ "checksum": "1c10b0cbac06b0286e862823c973a0a7",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_inner_2o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_inner_empty_subq]": [
+ {
+ "checksum": "c571f8c65372036c7eef83430647c1cb",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_inner_empty_subq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_not_selected]": [
+ {
+ "checksum": "b55516a7cd22e28ad616a30a7b8eaa4c",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_not_selected_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi]": [
+ {
+ "checksum": "058b1885cf1a2142700f752050a25b11",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi_1o2o]": [
+ {
+ "checksum": "058b1885cf1a2142700f752050a25b11",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_1o2o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi_1o]": [
+ {
+ "checksum": "058b1885cf1a2142700f752050a25b11",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_1o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi_2o]": [
+ {
+ "checksum": "058b1885cf1a2142700f752050a25b11",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_2o_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi_empty]": [
+ {
+ "checksum": "058b1885cf1a2142700f752050a25b11",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_semi_subq]": [
+ {
+ "checksum": "b8fdb42479e272c0ceb0004cd438a613",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_semi_subq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_take_skip]": [
+ {
+ "checksum": "c3e028679c6e80d42b22c8abc5e3ca79",
+ "size": 512,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_take_skip_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_unused_keys]": [
+ {
+ "checksum": "db593f746f854ddc48434bd625f623f3",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-lookupjoin_with_cache]": [
+ {
+ "checksum": "d6cf968705cd2a3ba2f631dad760eefe",
+ "size": 451,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-lookupjoin_with_cache_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_dup_key]": [
+ {
+ "checksum": "fd5a9b737d17971e029ceef53388d7c5",
+ "size": 209,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_dup_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_early_rewrite]": [
+ {
+ "checksum": "dd63758493ba2a9b84baf7922b247076",
+ "size": 321,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_early_rewrite_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_early_rewrite_sequence]": [
+ {
+ "checksum": "b68a5480b4c7665a3f8489fa96a7fd4b",
+ "size": 388,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_early_rewrite_sequence_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_early_rewrite_star]": [
+ {
+ "checksum": "5add01af5d42d2c71a9f431e513b33d3",
+ "size": 360,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_early_rewrite_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_left_null_column]": [
+ {
+ "checksum": "508b4c546bf5d9874719de1eb0e2713d",
+ "size": 271,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_left_null_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_complex_type_non_optional_left_only_single]": [
+ {
+ "checksum": "685baf86a629930ecee0dc4f0d04a272",
+ "size": 494,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_on_complex_type_non_optional_left_only_single_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_complex_type_optional_left_only_single]": [
+ {
+ "checksum": "bdfbf29cd44c98452c694c40b698ca83",
+ "size": 427,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_on_complex_type_optional_left_only_single_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_complex_type_optional_left_semi_many]": [
+ {
+ "checksum": "1e219535c7573cb05e4cef5636d21097",
+ "size": 640,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_join-mapjoin_on_complex_type_optional_left_semi_many_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_complex_type_optional_left_semi_single]": [
+ {
+ "checksum": "d0be1bd627e42db3b0cc55156a8046f4",
+ "size": 427,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_on_complex_type_optional_left_semi_single_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_tablerecord]": [
+ {
+ "checksum": "db7a9b9caae04e862edb11a49b2938c9",
+ "size": 284,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_on_tablerecord_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_on_very_complex_type]": [
+ {
+ "checksum": "6970c38c78bb517b08357384a3fd9c96",
+ "size": 590,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_on_very_complex_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_opt_vs_2xopt]": [
+ {
+ "checksum": "b7216c3e8d151a4acc01485d96285027",
+ "size": 515,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_opt_vs_2xopt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_partial_uniq_keys]": [
+ {
+ "checksum": "9058e1e6c04ee4ca18f70fd13c275ee5",
+ "size": 450,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_partial_uniq_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_sharded]": [
+ {
+ "checksum": "dbebf62086824af6b8d0ed1ef42a12e8",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1937492/a69a7a5184e0b69e632fef2497379a5939343b15/resource.tar.gz#test_sql_format.test_join-mapjoin_sharded_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_unused_keys]": [
+ {
+ "checksum": "f8551c2e038c8e91a5ea8faa4ae16edd",
+ "size": 258,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_with_anonymous]": [
+ {
+ "checksum": "b7e9c40fc4169d27e8ba5590a6dd36d9",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_with_anonymous_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_with_empty_read]": [
+ {
+ "checksum": "e529d6c633be5ec3d095636d6820934d",
+ "size": 595,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_with_empty_read_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mapjoin_with_empty_struct]": [
+ {
+ "checksum": "53f2fb9b9fb00922e1e004b801343140",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mapjoin_with_empty_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_any_no_join_reduce]": [
+ {
+ "checksum": "5fa5163b28cc84b4d50a5cdae5ea8d8f",
+ "size": 258,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_any_no_join_reduce_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_big_primary]": [
+ {
+ "checksum": "706567c502f61beef470bae9474c310c",
+ "size": 303,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_big_primary_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_big_primary_unique]": [
+ {
+ "checksum": "8c0c0b896a62dda87b25bbda9a6c22e6",
+ "size": 319,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_big_primary_unique_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_choose_primary]": [
+ {
+ "checksum": "6a7f7a1ccda4d7d20d7295b0c3dab5cf",
+ "size": 255,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_choose_primary_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_choose_primary_with_retry]": [
+ {
+ "checksum": "5dea0192c8eda79a363c9750d6f69d2d",
+ "size": 331,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_choose_primary_with_retry_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_align1]": [
+ {
+ "checksum": "8a7b5b76d6ce824bd81c6c78aaf13b4f",
+ "size": 616,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_align1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_align2]": [
+ {
+ "checksum": "0b3b20da31fca69e1e23081a9fca007b",
+ "size": 402,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_align2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_align3]": [
+ {
+ "checksum": "73e232a2f99fcf6a75021531b4915b27",
+ "size": 329,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_align3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_no_sorted]": [
+ {
+ "checksum": "53564886fcfaa8c1691968d27c1a360d",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_no_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_one_sorted]": [
+ {
+ "checksum": "b97d6c190d3f46ab23fbe57eb9dd89dd",
+ "size": 227,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_one_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_force_per_link]": [
+ {
+ "checksum": "4cd876e1f826e0ba1429fe694eeadf31",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_force_per_link_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_left_null_column]": [
+ {
+ "checksum": "33278ee7b012afce54dec480f67c732f",
+ "size": 363,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_left_null_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_narrows_output_sort]": [
+ {
+ "checksum": "755ecaffb091bff03674b2a627700d89",
+ "size": 307,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_narrows_output_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_saves_output_sort]": [
+ {
+ "checksum": "a853d87a491d29ce29dec19e77964347",
+ "size": 1644,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_saves_output_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_saves_output_sort_cross]": [
+ {
+ "checksum": "a0a2fe79b6e21892f68307eb62905994",
+ "size": 397,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_saves_output_sort_cross_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_saves_output_sort_nested]": [
+ {
+ "checksum": "a3a8e3bf45de1c78b7f5898229a63eb7",
+ "size": 498,
+ "uri": "https://{canondata_backend}/1936947/7dabc5ea0642eb49e4a3155ef894e1670ac842fb/resource.tar.gz#test_sql_format.test_join-mergejoin_saves_output_sort_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_saves_output_sort_unmatched]": [
+ {
+ "checksum": "d95699a4e35a5f8c26f14fe749fb7f88",
+ "size": 376,
+ "uri": "https://{canondata_backend}/1936947/7dabc5ea0642eb49e4a3155ef894e1670ac842fb/resource.tar.gz#test_sql_format.test_join-mergejoin_saves_output_sort_unmatched_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_semi_composite_to_inner]": [
+ {
+ "checksum": "977a4835ae040769e611da6426a582d8",
+ "size": 440,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_semi_composite_to_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_semi_to_inner]": [
+ {
+ "checksum": "30b93e2e4c783cbe2e93198632e834ec",
+ "size": 271,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_semi_to_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_small_primary]": [
+ {
+ "checksum": "45c04b60f587239cb971f1420a8fc006",
+ "size": 302,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_small_primary_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_sorts_output_for_sort_inner]": [
+ {
+ "checksum": "28cc7fb2651310f192da0947beb536c1",
+ "size": 645,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_sorts_output_for_sort_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_sorts_output_for_sort_left]": [
+ {
+ "checksum": "9d7cc7c836c053625235998ddb48e023",
+ "size": 593,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_sorts_output_for_sort_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_sorts_output_for_sort_nomatch]": [
+ {
+ "checksum": "3c4c01e10d6ad0b138b6aa73debcb624",
+ "size": 282,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_sorts_output_for_sort_nomatch_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_sorts_output_for_sort_right]": [
+ {
+ "checksum": "b40b30c47f0e4296f66e684be894acb2",
+ "size": 646,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_sorts_output_for_sort_right_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_unused_keys]": [
+ {
+ "checksum": "78b9d8e9fa8a520e5a335cb499c207e0",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_different_key_names]": [
+ {
+ "checksum": "22daf3346ed40984273c288b533b8b93",
+ "size": 681,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_different_key_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_different_key_names_nested]": [
+ {
+ "checksum": "cfeaaa4a7cbce72ec80b4665428c3351",
+ "size": 391,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_different_key_names_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_different_key_names_nonsorted]": [
+ {
+ "checksum": "2d204d7fb8748ebc98db44ba17e82358",
+ "size": 449,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_different_key_names_nonsorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_different_key_names_norename]": [
+ {
+ "checksum": "2cc32adf2e31d51138fa9588a7d25555",
+ "size": 682,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_different_key_names_norename_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_reverse_key_order]": [
+ {
+ "checksum": "081096ceae05239ebf51690e7e3e1d6b",
+ "size": 239,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_reverse_key_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-mergejoin_with_table_range]": [
+ {
+ "checksum": "17195e4f8291c24e45cf4a0c48d56bf3",
+ "size": 269,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-mergejoin_with_table_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-nested_semi_join]": [
+ {
+ "checksum": "75e028397cd42a849b7a67cb66882f42",
+ "size": 385,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-nested_semi_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-no_empty_join_for_dyn]": [
+ {
+ "checksum": "c8468208894f7e6d1a388e30106732cc",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-no_empty_join_for_dyn_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-nopushdown_filter_over_inner]": [
+ {
+ "checksum": "1b3038656a20fe4fcb724a6f4c399b16",
+ "size": 226,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-nopushdown_filter_over_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-nopushdown_filter_with_depends_on]": [
+ {
+ "checksum": "956eea7d7ef4126950ed02a322c6c492",
+ "size": 272,
+ "uri": "https://{canondata_backend}/212715/1c52a4632d14126361f7585c218d202718c6fa0f/resource.tar.gz#test_sql_format.test_join-nopushdown_filter_with_depends_on_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-opt_on_opt_side]": [
+ {
+ "checksum": "141984f94b37e1c1faf90f7525bb510c",
+ "size": 229,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-opt_on_opt_side_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-opt_on_opt_side_with_group]": [
+ {
+ "checksum": "639472d7700a4b76b502cd38cb1c2e6d",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-opt_on_opt_side_with_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-order_of_qualified]": [
+ {
+ "checksum": "8f0d6bfcbeb450e6dac77f827004489b",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-order_of_qualified_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_cross]": [
+ {
+ "checksum": "f6d9084aa2caba323deaaff024facf72",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_cross_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_inner]": [
+ {
+ "checksum": "5f0c6f7630db26865433e0481f4412f9",
+ "size": 281,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_inner_both_sides]": [
+ {
+ "checksum": "b232bcd0f1504342d23d2226db36a1e8",
+ "size": 372,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_inner_both_sides_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_inner_filter]": [
+ {
+ "checksum": "c45d46aea8515507a23f49c7b05d739b",
+ "size": 305,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_inner_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_left_cross]": [
+ {
+ "checksum": "f2d361d77bd1fdc0c78b1deb7c96852b",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_left_cross_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_multiparents]": [
+ {
+ "checksum": "27d33c536eb79c9d1a80ad92fa6cb1ef",
+ "size": 459,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_multiparents_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_multiparents_no_premap]": [
+ {
+ "checksum": "61b15e9c3c095c54a058d922a9e5d02c",
+ "size": 413,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_multiparents_no_premap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_right_tablecontent]": [
+ {
+ "checksum": "cbca798f84bd9dae925896972c49741b",
+ "size": 412,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_right_tablecontent_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_common_semi]": [
+ {
+ "checksum": "5c55c5b55b5f74f625993abc7b802bba",
+ "size": 328,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_common_semi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_context_dep]": [
+ {
+ "checksum": "06ba9c033033dea9a887d10f77926b6b",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_context_dep_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_map_cross]": [
+ {
+ "checksum": "add3362110f80f31f94f18246ec5fa29",
+ "size": 359,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_map_cross_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_map_inner]": [
+ {
+ "checksum": "81c88dcec8ff7bc8b18d04c2b7410137",
+ "size": 337,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_map_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_map_semi]": [
+ {
+ "checksum": "a1c376605f63e1418a17017e505104b5",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_map_semi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_merge_extrasort1]": [
+ {
+ "checksum": "b852fd57a5099606214968d72a7076c4",
+ "size": 406,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_merge_extrasort1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_merge_extrasort2]": [
+ {
+ "checksum": "5e91728dd3ea1fb16439779a447790c5",
+ "size": 470,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_merge_extrasort2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_merge_inner]": [
+ {
+ "checksum": "ff6ef5f49625b8fa8abf4d9b35f1426c",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_merge_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_merge_with_remap]": [
+ {
+ "checksum": "ab276adf7f7ab99b5c185ec028c7ef06",
+ "size": 495,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_merge_with_remap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_no_premap]": [
+ {
+ "checksum": "08d227d7cc0452dcadd2226a1fff9101",
+ "size": 942,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_no_premap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-premap_nonseq_flatmap]": [
+ {
+ "checksum": "0e9af0f9efee217051e2412ea13de25a",
+ "size": 323,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-premap_nonseq_flatmap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_context_dep]": [
+ {
+ "checksum": "522d2e6d4cc1ccbcacdb0533f504a018",
+ "size": 290,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_context_dep_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_cross]": [
+ {
+ "checksum": "40ba641aa6900300e5b69912191e928e",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_cross_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_exclusion]": [
+ {
+ "checksum": "8f9a07090b5c6f29202c4ee9e3307d23",
+ "size": 387,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_exclusion_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_inner]": [
+ {
+ "checksum": "0464d33275707235710cda9684fcf2b5",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_left]": [
+ {
+ "checksum": "53738e01eaae4cff75099329687fe1e3",
+ "size": 382,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_left_semi]": [
+ {
+ "checksum": "27027673e15689673454bb05766dd1c7",
+ "size": 341,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_left_semi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_null_column]": [
+ {
+ "checksum": "48621cb412f9d5d4732dbca2ebf31209",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_null_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_random]": [
+ {
+ "checksum": "8526ce92bb5431681a90b4ac77a0baf5",
+ "size": 343,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_random_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_renaming]": [
+ {
+ "checksum": "605012beb37af1d91c16ce76d6a47596",
+ "size": 510,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_renaming_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pullup_rownumber]": [
+ {
+ "checksum": "8e15f6d20732517041c3f269c2d1c97b",
+ "size": 325,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pullup_rownumber_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pushdown_filter_over_inner_with_assume_strict]": [
+ {
+ "checksum": "580465ada48a3a207423eaae1815402f",
+ "size": 236,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pushdown_filter_over_inner_with_assume_strict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pushdown_filter_over_inner_with_strict_udf]": [
+ {
+ "checksum": "f951143fd3ac175200a706c1a1616ed6",
+ "size": 225,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pushdown_filter_over_inner_with_strict_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-pushdown_filter_over_left]": [
+ {
+ "checksum": "53d7af8577bdc9317f1251334c030563",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-pushdown_filter_over_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-right_trivial]": [
+ {
+ "checksum": "de9a3b7511ff726a8f69aaee57bff47a",
+ "size": 245,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-right_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-selfjoin_on_sorted]": [
+ {
+ "checksum": "31e36c72637d064df8b69297e3152522",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-selfjoin_on_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-selfjoin_on_sorted_with_filter]": [
+ {
+ "checksum": "dcbe0f0b09e7a99edc3a9c0d7058516f",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-selfjoin_on_sorted_with_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-selfjoin_on_sorted_with_rename]": [
+ {
+ "checksum": "021713ef8938fa47dff6121afe905a68",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-selfjoin_on_sorted_with_rename_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-simple_columns_partial]": [
+ {
+ "checksum": "245390c27f719c2b0a3c7d6759b5b0cd",
+ "size": 430,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-simple_columns_partial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-split_to_list_as_key]": [
+ {
+ "checksum": "d49d5962ff0379d78e64e86bb9b41bf2",
+ "size": 213,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-split_to_list_as_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join]": [
+ {
+ "checksum": "eeb0bdf47073677e4d012418d8ab9ba3",
+ "size": 675,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_inners]": [
+ {
+ "checksum": "faef1498a174fdbfc16473fc573ef05f",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_inners_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_inners_premap]": [
+ {
+ "checksum": "37074681cd294cfe30b2cf22fdd2a21e",
+ "size": 442,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_inners_premap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_inners_vk_sorted]": [
+ {
+ "checksum": "faef1498a174fdbfc16473fc573ef05f",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_inners_vk_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_mirror]": [
+ {
+ "checksum": "8184c2544b3c3162f922410afd340cdd",
+ "size": 672,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_mirror_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_multi]": [
+ {
+ "checksum": "909a4488709b9c4cc1992a78dfd303a5",
+ "size": 1441,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_multi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_semionly]": [
+ {
+ "checksum": "788ce4104eed937f1b444e92baaf788f",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_semionly_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_semionly_premap]": [
+ {
+ "checksum": "2e7be00df028f20c4cfeade0e66bf933",
+ "size": 500,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-star_join_semionly_premap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-star_join_with_diff_complex_key]": [
+ {
+ "checksum": "ee384acc568b8a19dc3d3e7b89731d8c",
+ "size": 278,
+ "uri": "https://{canondata_backend}/1903885/90dd2443b1beae6664379d01144635dafd045717/resource.tar.gz#test_sql_format.test_join-star_join_with_diff_complex_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-starjoin_unused_keys]": [
+ {
+ "checksum": "586a264b19110073dac92c9a6ece2d67",
+ "size": 284,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-starjoin_unused_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-strict_keys]": [
+ {
+ "checksum": "d23393460bdec348dce9f6a3e2b4d7b7",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-strict_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-three_equalities]": [
+ {
+ "checksum": "8bbb24fe6aaa308533d385c7a0ec27b2",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_join-three_equalities_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-three_equalities_paren]": [
+ {
+ "checksum": "849232d6de90cd592170709da73f7a4d",
+ "size": 177,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_join-three_equalities_paren_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-trivial_view]": [
+ {
+ "checksum": "5a67cde1632fac84a3297d52757aed2f",
+ "size": 209,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-trivial_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-two_aggrs]": [
+ {
+ "checksum": "7291d3aa49079746930306a3623f9c09",
+ "size": 593,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-two_aggrs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-10654_pullup_with_sys_columns]": [
+ {
+ "checksum": "32cf99cc61d0ccadd66cb6799ab03649",
+ "size": 418,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-10654_pullup_with_sys_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-12022]": [
+ {
+ "checksum": "77a84828ece76a3a856e68c6181dc036",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-12022_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-14829_left]": [
+ {
+ "checksum": "53d236604bf7a97d751444d9b37a747a",
+ "size": 458,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-14829_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-14829_leftonly]": [
+ {
+ "checksum": "45e0816a1ef474e0b0a640613bafdbcd",
+ "size": 460,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-14829_leftonly_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-14847]": [
+ {
+ "checksum": "00104933f1af4187eda2bde90c264c21",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-14847_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-16011]": [
+ {
+ "checksum": "0fa3c28824fa818ebacc29bfdf90d753",
+ "size": 673,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-16011_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-19081]": [
+ {
+ "checksum": "bb9f87ea7cebf0011816e7e80b447deb",
+ "size": 363,
+ "uri": "https://{canondata_backend}/1946324/ea334656ca4ab8298f13987977529870591f2010/resource.tar.gz#test_sql_format.test_join-yql-19081_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-4275]": [
+ {
+ "checksum": "702a517333cd9f61febcf59dd7f4c6db",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-4275_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-6199]": [
+ {
+ "checksum": "833d1aa1bc946fdee38da5e278acaec0",
+ "size": 484,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-6199_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-6297]": [
+ {
+ "checksum": "6ba846e72f914deb5560b4692cf351c5",
+ "size": 429,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-6297_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-8125]": [
+ {
+ "checksum": "6c4b403ea9cd76731f84f38ee27e245f",
+ "size": 382,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-8125_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-8131]": [
+ {
+ "checksum": "cf2483ae84b5d62a4ec614118d1afe64",
+ "size": 519,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-8131_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql-8980]": [
+ {
+ "checksum": "8ef7afc28b521ec349ddb12a01dfbf54",
+ "size": 370,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql-8980_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[join-yql_465]": [
+ {
+ "checksum": "1ba0b98d2d5ccf688cf536915ee2f91f",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_join-yql_465_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-combination/nested]": [
+ {
+ "checksum": "a7fdd0128fc559479b2d61fa8ddc3c79",
+ "size": 1015,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-combination_nested_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-combination/unwrapped]": [
+ {
+ "checksum": "e27a035ae3f54772043f7c9394c1fb9b",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-combination_unwrapped_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/common_syntax]": [
+ {
+ "checksum": "8e02a85cd7152e1115df02f3e5225ffa",
+ "size": 264,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_common_syntax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/example]": [
+ {
+ "checksum": "f00a50e3db1123ec4b088640fcc61e52",
+ "size": 1277,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_example_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/on_error]": [
+ {
+ "checksum": "aef31f450496f74486903dfdc31a6609",
+ "size": 399,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_on_error_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/on_error_exception]": [
+ {
+ "checksum": "1785927633e91e7ecba244a4c154458e",
+ "size": 211,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_on_error_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/passing]": [
+ {
+ "checksum": "d915c43140199a6d3a7f014798befc1c",
+ "size": 1906,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_passing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_exists/passing_exception]": [
+ {
+ "checksum": "c4f5f9a6626acec4d09b0c5f0e08efce",
+ "size": 233,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_exists_passing_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/common_syntax]": [
+ {
+ "checksum": "5c0fe288455a2174bd0676b10b4f55e8",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_common_syntax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/example]": [
+ {
+ "checksum": "331b6b3d78c2b504c947a9ea0214f778",
+ "size": 1794,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_example_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/on_empty]": [
+ {
+ "checksum": "b67266d45aa634b4abd2a738ef5ffe17",
+ "size": 388,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_on_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/on_empty_exception]": [
+ {
+ "checksum": "1b1877544d70281fed15c425de9bc294",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_on_empty_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/on_error]": [
+ {
+ "checksum": "0427b72a8dc2a2a61dc533eb89e46947",
+ "size": 405,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_on_error_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/on_error_exception]": [
+ {
+ "checksum": "7ba2ab7a1701bbb12b3605bac2c354fa",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_on_error_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/passing]": [
+ {
+ "checksum": "f33aefab37197098e6ca6fa574ec76f2",
+ "size": 2289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_passing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/passing_exception]": [
+ {
+ "checksum": "43a49d058c315abbc97ee8d255780305",
+ "size": 265,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_passing_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_query/wrapper]": [
+ {
+ "checksum": "c3c1b06b9c6102030494c674be1fbd82",
+ "size": 3147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_query_wrapper_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/common_syntax]": [
+ {
+ "checksum": "a3bbbb0b97188a005a0ef6eeac689581",
+ "size": 261,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_common_syntax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/example]": [
+ {
+ "checksum": "d42e6d71e6559f16632582175bcf1ac9",
+ "size": 2267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_example_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_empty]": [
+ {
+ "checksum": "741a96302ca55d829d4aa084cf20a1b8",
+ "size": 1014,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_empty_cast_default_exception]": [
+ {
+ "checksum": "5789af88bd717ac1a829c68e9919d4a0",
+ "size": 170,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_empty_cast_default_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_empty_exception]": [
+ {
+ "checksum": "7bb08b3eeb0f92fa8e027c510530dc19",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_empty_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_error]": [
+ {
+ "checksum": "87ae17386329baa738d519110de1755f",
+ "size": 1114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_error_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_error_cast_default_exception]": [
+ {
+ "checksum": "8acb2591a82314db771515aff58553d6",
+ "size": 366,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_error_cast_default_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_error_cast_udf_exception]": [
+ {
+ "checksum": "e04abe6da810f3c5e8e8574470d6895a",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_error_cast_udf_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_error_cast_value_exception]": [
+ {
+ "checksum": "a1553cd1e3aa02228a5e094052114d0a",
+ "size": 284,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_error_cast_value_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/on_error_jsonpath_exception]": [
+ {
+ "checksum": "fade7358ec46694f9751e395f552f400",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_on_error_jsonpath_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/passing]": [
+ {
+ "checksum": "42c0665ba41532504bb4b15f4ae2ce9d",
+ "size": 1897,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_passing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/passing_exception]": [
+ {
+ "checksum": "a450c4027bdf3d5ac214f3698f35ba3b",
+ "size": 232,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_passing_exception_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-json_value/returning]": [
+ {
+ "checksum": "d21fb4a41ff014cfe63bcffcb5040f37",
+ "size": 2740,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-json_value_returning_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsondocument/insert]": [
+ {
+ "checksum": "d9d6d1abec083668c4c728025873ac47",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsondocument_insert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsondocument/json_exists]": [
+ {
+ "checksum": "8e0586e62a6d94712d9b116813da1df3",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsondocument_json_exists_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsondocument/json_query]": [
+ {
+ "checksum": "ce4b026285175568a8621ee2fffdf8b0",
+ "size": 249,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsondocument_json_query_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsondocument/json_value]": [
+ {
+ "checksum": "d9f1b5aea28ce9a1edf34983efc13090",
+ "size": 249,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsondocument_json_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsondocument/select]": [
+ {
+ "checksum": "570d428c4a63c81250cd1a0a33452556",
+ "size": 68,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsondocument_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[json-jsonpath/unicode]": [
+ {
+ "checksum": "cf69eb8baccda01661a5f2634f7952ca",
+ "size": 407,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_json-jsonpath_unicode_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-between_with_key_filter]": [
+ {
+ "checksum": "8e1cbc58d34e43d2546a0fee42c03aa1",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-between_with_key_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-calc_dependent]": [
+ {
+ "checksum": "3e356ff705d446e7a825dddc35fcee68",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-calc_dependent_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-calc_dependent_with_tmp]": [
+ {
+ "checksum": "2d1d2042465678428a4142034bd7a3ed",
+ "size": 228,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-calc_dependent_with_tmp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-complex]": [
+ {
+ "checksum": "ddab498748c838315dc2a945119f385c",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-complex_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-contains]": [
+ {
+ "checksum": "17a25bbc61e72c61b36fdc17e7040ddc",
+ "size": 83,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-contains_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-contains_optional]": [
+ {
+ "checksum": "2962f5d7ae2f9df2d389571634d0328d",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-contains_optional_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-contains_tuples]": [
+ {
+ "checksum": "9bfda04d6d2511bda736d6be81966888",
+ "size": 651,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-contains_tuples_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-contains_tuples_no_keyfilter]": [
+ {
+ "checksum": "c3be8c928721a58838e047b5a6994f16",
+ "size": 623,
+ "uri": "https://{canondata_backend}/1942100/4b68f1335b6f5777a4e88f7adac4f85fe445c2d9/resource.tar.gz#test_sql_format.test_key_filter-contains_tuples_no_keyfilter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-convert]": [
+ {
+ "checksum": "c64eac12d90aaf679ee3f1c929dc0730",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_key_filter-convert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-datetime]": [
+ {
+ "checksum": "a6af9ce3ac598a74f5ce8d318bc744bd",
+ "size": 2923,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-datetime_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-decimal]": [
+ {
+ "checksum": "baba9389979cea82da46fad54a781d36",
+ "size": 1444,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-decimal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-dependent_value]": [
+ {
+ "checksum": "3324eedc161ceec8413c0d904dd987fd",
+ "size": 51,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-dependent_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-dict_contains]": [
+ {
+ "checksum": "f1e166e395220463348e729304e13e6d",
+ "size": 153,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-dict_contains_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-dict_contains_optional]": [
+ {
+ "checksum": "72e57d75591db74d565eb7e2d2ef9c03",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-dict_contains_optional_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-empty_range]": [
+ {
+ "checksum": "e99c624c18001c63c7ba3dcc9a822e35",
+ "size": 781,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-empty_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-empty_range_over_dynamic]": [
+ {
+ "checksum": "56e8a97f384ef60ff26f1cacf45f278d",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-empty_range_over_dynamic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-extend_over_map_with_same_schema]": [
+ {
+ "checksum": "6f2f9db40103427dfe3366ac0fcc481a",
+ "size": 535,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-extend_over_map_with_same_schema_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-is_null]": [
+ {
+ "checksum": "937a5cfc430c24b2136bbb339c6b0aa0",
+ "size": 49,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-is_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-is_null_multi_key]": [
+ {
+ "checksum": "3562a123c9a19b193b1c81e2bd2838ac",
+ "size": 68,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-is_null_multi_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-is_null_or_data]": [
+ {
+ "checksum": "a6da2e49502cae401cb35a1e3d09b183",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-is_null_or_data_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-is_null_with_condition]": [
+ {
+ "checksum": "e4c93b8e54ba2b68a91a4067d36691c3",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-is_null_with_condition_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-key_double_opt_suffix]": [
+ {
+ "checksum": "759108acc28c6746b6c850347a72e37c",
+ "size": 297,
+ "uri": "https://{canondata_backend}/1916746/17fe8719a985017b6f021f4d7e436be1be861474/resource.tar.gz#test_sql_format.test_key_filter-key_double_opt_suffix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-lambda_with_null_filter]": [
+ {
+ "checksum": "d7fbc66c7e905f3add5eadd4ed5b370c",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-lambda_with_null_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-mixed_opt_bounds]": [
+ {
+ "checksum": "53deb28a24ebbe4db65bcd6e07b2ba50",
+ "size": 382,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-mixed_opt_bounds_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-mixed_sort]": [
+ {
+ "checksum": "75a2c5e8184e346d52ddac0793009a63",
+ "size": 242,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-mixed_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-multiusage]": [
+ {
+ "checksum": "eb0ba8ed1b1b02aa50301a5c5057f6b5",
+ "size": 524,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_key_filter-multiusage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-nile_pred]": [
+ {
+ "checksum": "eef12ca1562b8991ac034cf7c76acd3a",
+ "size": 116,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-nile_pred_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-no_bypass_merge]": [
+ {
+ "checksum": "c11c4aac4740bc96f1f16fc34273b3b5",
+ "size": 338,
+ "uri": "https://{canondata_backend}/1946324/60ea49a653935bd647f75184f5571f43eaea2f1e/resource.tar.gz#test_sql_format.test_key_filter-no_bypass_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-part_key_over_dynamic]": [
+ {
+ "checksum": "d0780baa61449d404c28577d330972b1",
+ "size": 118,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-part_key_over_dynamic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-pushdown_keyextract_passthrough]": [
+ {
+ "checksum": "3a798c907690890caa80e6bd6d98dbb0",
+ "size": 294,
+ "uri": "https://{canondata_backend}/1931696/5fe4928f06d2e88e8209e0ef43d522899098153b/resource.tar.gz#test_sql_format.test_key_filter-pushdown_keyextract_passthrough_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-pushdown_keyextract_type_adjust]": [
+ {
+ "checksum": "886cde637fcd6231aa7376fa7dc11888",
+ "size": 318,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-pushdown_keyextract_type_adjust_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-range_union]": [
+ {
+ "checksum": "e0b544d3822592c4ef383b53f9f0ed2c",
+ "size": 3501,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-range_union_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-range_union_lower_excluded]": [
+ {
+ "checksum": "e01cfc3c8a4a384bd6e2b37ac0aff59e",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-range_union_lower_excluded_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-ranges]": [
+ {
+ "checksum": "8c02f9b7f53c8c4c957e6ed24c890780",
+ "size": 347,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-ranges_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-split_input_with_key_filter1]": [
+ {
+ "checksum": "820cf0ea6764c32ff8ad6ef00a9efdea",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-split_input_with_key_filter1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-split_input_with_key_filter2]": [
+ {
+ "checksum": "022960d3e4cdb6f0f318122c4dfc38ae",
+ "size": 174,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-split_input_with_key_filter2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-string_with]": [
+ {
+ "checksum": "039adf1df4f79d8135b7d2f8ec7f0311",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-string_with_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-string_with_ff]": [
+ {
+ "checksum": "095d6b3e40079ca5a4f11b81a8bede0d",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-string_with_ff_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-string_with_legacy]": [
+ {
+ "checksum": "f3afbb4ec62aabd8d907b1f39be88a5d",
+ "size": 520,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-string_with_legacy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-tzdate]": [
+ {
+ "checksum": "2bc04b912154ca6491ae549e358fa4c1",
+ "size": 1505,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-tzdate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-utf8_with_legacy]": [
+ {
+ "checksum": "01720034374bf4b0cb615ac489be9ffd",
+ "size": 740,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-utf8_with_legacy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-uuid]": [
+ {
+ "checksum": "62b5eaee9582d5f148110362acb74be8",
+ "size": 2426,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-uuid_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-yql-14157]": [
+ {
+ "checksum": "f221b0a5fe7c2e8f28dc3b91634055e7",
+ "size": 229,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-yql-14157_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-yql-8117-table_key_filter]": [
+ {
+ "checksum": "5712551250f2cb63870124aa96123689",
+ "size": 310,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-yql-8117-table_key_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-yql-8663-dedup_ranges]": [
+ {
+ "checksum": "39453a7dbaf5222e2cc9f8ff201b0587",
+ "size": 89,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_key_filter-yql-8663-dedup_ranges_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[key_filter-yql_5895_or]": [
+ {
+ "checksum": "4f83a4050cdb2fc85dba846567cfdab4",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-yql_5895_or_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_brief]": [
+ {
+ "checksum": "31a0d7f4e2d3aabd6c1f8ebe32d15500",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_brief_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_no_arg]": [
+ {
+ "checksum": "2e2f5f63213dd135dd71a41673ddd850",
+ "size": 179,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_no_arg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_opt_args]": [
+ {
+ "checksum": "5191f7d264b84d1f277a5a3b67ab4e39",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_opt_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_simple]": [
+ {
+ "checksum": "65cc579ccfc0c7cad2236472b0e60785",
+ "size": 337,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_udf]": [
+ {
+ "checksum": "2cc52c3a3c949a458579704bed1407ea",
+ "size": 383,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_use_labmda_as_arg]": [
+ {
+ "checksum": "f0356d0c7a99753d833447b191819cbc",
+ "size": 419,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_use_labmda_as_arg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_with_tie]": [
+ {
+ "checksum": "a758da5be04c09450d991b3fda2652f6",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_with_tie_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-lambda_with_tie_bad_count_fail]": [
+ {
+ "checksum": "7b9558bca37755d4576208ac9cf860a0",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-lambda_with_tie_bad_count_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-list_aggregate]": [
+ {
+ "checksum": "3ed7be23221bfa3ba9670ed9d800a21f",
+ "size": 426,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-list_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lambda-list_aggregate_flatmap]": [
+ {
+ "checksum": "d59cac82b56587c898c0d9e600185870",
+ "size": 430,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lambda-list_aggregate_flatmap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-forward_import]": [
+ {
+ "checksum": "90dcb9eb140bc504f59a316ffbf3c027",
+ "size": 316,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-forward_import_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-library]": [
+ {
+ "checksum": "b0369a6ee36c5274ff28bb684226aec3",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-library_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-library_alias]": [
+ {
+ "checksum": "c1e048e84d1e92cd5f97cafcaafdf44f",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-library_alias_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-library_udf]": [
+ {
+ "checksum": "fb630a56757545c81647d459c1b96d6a",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-library_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-library_via_http]": [
+ {
+ "checksum": "b0369a6ee36c5274ff28bb684226aec3",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-library_via_http_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-package]": [
+ {
+ "checksum": "185693fe8b84ef2d411808e043ea8b99",
+ "size": 189,
+ "uri": "https://{canondata_backend}/937458/19757d70a088a9bcfe4bcf554f8c96bace436bfa/resource.tar.gz#test_sql_format.test_library-package_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[library-package_override]": [
+ {
+ "checksum": "a892fe1124790190a3b617a22f8d71e3",
+ "size": 215,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_library-package_override_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-ilike_clause]": [
+ {
+ "checksum": "4ef38c358b6651de1779bde81c8b569a",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-ilike_clause_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_clause]": [
+ {
+ "checksum": "899c2e664267e2e28290dda5a9f1e039",
+ "size": 98,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-like_clause_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_clause_escape]": [
+ {
+ "checksum": "d2e246198f662ac465a62f23cbb740df",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_like-like_clause_escape_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_clause_no_pattern]": [
+ {
+ "checksum": "9a2f1441d17be23c188f2412f68f05b4",
+ "size": 178,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_like-like_clause_no_pattern_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_escape]": [
+ {
+ "checksum": "ec5831a542ccbee7a0c4fa6ee1361179",
+ "size": 57,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-like_escape_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_multiline]": [
+ {
+ "checksum": "bcec5e764035d2e447d9540fe3ed300e",
+ "size": 80,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-like_multiline_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-like_rewrite]": [
+ {
+ "checksum": "c38590375d9cee90194fa98194deb8cf",
+ "size": 228,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-like_rewrite_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[like-regexp_clause]": [
+ {
+ "checksum": "410b423c60d5261890cb6267c4825c83",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_like-regexp_clause_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-dynamic_limit]": [
+ {
+ "checksum": "a41e95a37c837ef470ae0453a171e098",
+ "size": 158,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-dynamic_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-dynamic_sort_limit]": [
+ {
+ "checksum": "0ece13fdb5f988432e9306d490d173be",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-dynamic_sort_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-empty_input_after_limit]": [
+ {
+ "checksum": "f74f2b814304891523b829e8f3196879",
+ "size": 237,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-empty_input_after_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-empty_read_after_limit]": [
+ {
+ "checksum": "730342964c0ee97e0596e5ade094a48a",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-empty_read_after_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-empty_sort_after_limit]": [
+ {
+ "checksum": "ab387ffac3794a6f2b62c0897c9d425d",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-empty_sort_after_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-empty_sort_calc_after_limit]": [
+ {
+ "checksum": "86eb52f866ee49bd1a6afa86826899f8",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-empty_sort_calc_after_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-empty_sort_desc_after_limit]": [
+ {
+ "checksum": "795ad8b88fa671f5cdcdf393fb4bfe39",
+ "size": 96,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-empty_sort_desc_after_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-insert_with_limit]": [
+ {
+ "checksum": "27f04c851d94564daf1219c8e3df397a",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-insert_with_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-limit]": [
+ {
+ "checksum": "c4b2611460df0375a8a5c73e0cb17f39",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-limit_offset]": [
+ {
+ "checksum": "c3e55799052b9a8d80a27e53b3f3068d",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-limit_offset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-limit_over_sort_desc_in_subquery]": [
+ {
+ "checksum": "da96f56d52ef2ae1529e6b9ae1c8c5e9",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1937492/d8a3744d713156e924bf9dfbdf2d8f66eec8bc4e/resource.tar.gz#test_sql_format.test_limit-limit_over_sort_desc_in_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-limit_skip_take]": [
+ {
+ "checksum": "380abf5d1ae58ab6e795caf4f61ea6ec",
+ "size": 153,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-limit_skip_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-many_top_sorts]": [
+ {
+ "checksum": "3806516a96a4150ed5db16a3266e8415",
+ "size": 263,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-many_top_sorts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-sort_calc_limit]": [
+ {
+ "checksum": "a1ac71e01e5bb0e7c37eec763520b7c8",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-sort_calc_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-yql-7900_empty_sorted_without_keys]": [
+ {
+ "checksum": "fed991ac35e4a4f372a242652eab1489",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-yql-7900_empty_sorted_without_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-yql-8046_empty_sorted_desc]": [
+ {
+ "checksum": "8ea1b92c2ebc0e702ebd49b0a7ee13f9",
+ "size": 655,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-yql-8046_empty_sorted_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-yql-8611_calc_peephole]": [
+ {
+ "checksum": "3b047eceb5e190a4a2d5544b7dad2647",
+ "size": 897,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-yql-8611_calc_peephole_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-yql-9617_empty_lambda]": [
+ {
+ "checksum": "fdb4acb15f35ac030998cd425cad249a",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-yql-9617_empty_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[limit-zero_limit]": [
+ {
+ "checksum": "e6b58a4896ea496df15cf597a4a409a3",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_limit-zero_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-error_type]": [
+ {
+ "checksum": "aa7268913aed17bf13095a2f03f475ee",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1784826/8212a6594777651314d94a2e2f95179c0016604c/resource.tar.gz#test_sql_format.test_lineage-error_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-flatten_by]": [
+ {
+ "checksum": "3f32f309ac009b3158e11e36cc0a92b7",
+ "size": 451,
+ "uri": "https://{canondata_backend}/1937367/b35833bd1950efa4b6fa264900a396b8f3f198a8/resource.tar.gz#test_sql_format.test_lineage-flatten_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-flatten_list_nested_lambda]": [
+ {
+ "checksum": "3fdec3c3ffc5993a6088aa56eac4fcea",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-flatten_list_nested_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-flatten_where]": [
+ {
+ "checksum": "30f3c1e1c497eb026b5f970b4490b705",
+ "size": 176,
+ "uri": "https://{canondata_backend}/995452/686fce56a91b74643cca782a2a73c0370221c2af/resource.tar.gz#test_sql_format.test_lineage-flatten_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-group_by_asstruct_key]": [
+ {
+ "checksum": "de9d484c7fe4b6ed05c8a61bea813834",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-group_by_asstruct_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-grouping_sets]": [
+ {
+ "checksum": "7e57dcc9ca531cfa66e69bd7f1460ad2",
+ "size": 296,
+ "uri": "https://{canondata_backend}/1781765/5483cde59b65341125b67709093030a3d2bd1b0e/resource.tar.gz#test_sql_format.test_lineage-grouping_sets_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-if_struct]": [
+ {
+ "checksum": "36232c04d90172af80321e69783af38f",
+ "size": 403,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-if_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-isolated]": [
+ {
+ "checksum": "d239bb9b177cc40755c6f66be76a5b98",
+ "size": 160,
+ "uri": "https://{canondata_backend}/1889210/c8b4fae053b51029d1889b70ffd7fe56013cabc7/resource.tar.gz#test_sql_format.test_lineage-isolated_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-join_as_struct]": [
+ {
+ "checksum": "a5223ab2032510ed8523fb48abf94904",
+ "size": 371,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-join_as_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-list_literal1]": [
+ {
+ "checksum": "db38cbbb16677866c81618988d50e832",
+ "size": 107,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql_format.test_lineage-list_literal1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-list_literal2]": [
+ {
+ "checksum": "4eab86432f7450a7359cd4a4b0c3cd6a",
+ "size": 152,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql_format.test_lineage-list_literal2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-list_literal3]": [
+ {
+ "checksum": "8312dba24efdf5c6b0a499e3c8476c0e",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql_format.test_lineage-list_literal3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-list_literal4]": [
+ {
+ "checksum": "e09d960109150512dbfd98718f93adb4",
+ "size": 255,
+ "uri": "https://{canondata_backend}/1937429/608518ad847270ef656d5979dfaa6d8093a7d057/resource.tar.gz#test_sql_format.test_lineage-list_literal4_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-member_over_if_struct]": [
+ {
+ "checksum": "f1e8032e0e8f6fbfdc51bc56af630a48",
+ "size": 333,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-member_over_if_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-nested_lambda_fields]": [
+ {
+ "checksum": "18ff9032fab9ba6187699e80a1885eb3",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1937001/367147bfd772fc8975087ce9c3bf4c808edc62a9/resource.tar.gz#test_sql_format.test_lineage-nested_lambda_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-process]": [
+ {
+ "checksum": "3a5ea2f2655558dd78522f30ebd40849",
+ "size": 87,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql_format.test_lineage-process_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-reduce]": [
+ {
+ "checksum": "a25edec830e443fa0328ae6bdca9b02a",
+ "size": 103,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql_format.test_lineage-reduce_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-reduce_all]": [
+ {
+ "checksum": "b940d0c558e682090bc405fcf5070c39",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1937027/014b1b1f2a6444dee0079b144376cfe027937f42/resource.tar.gz#test_sql_format.test_lineage-reduce_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-reduce_all_row]": [
+ {
+ "checksum": "48e3dbc46584bd30483da117bd6fbf0f",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1937001/17904a5011471d554231c1fa2d5f2867653f21a9/resource.tar.gz#test_sql_format.test_lineage-reduce_all_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-scalar_context]": [
+ {
+ "checksum": "676d826944ab5b018d11e541237afbf2",
+ "size": 169,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-scalar_context_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_all]": [
+ {
+ "checksum": "8806f67c0566260393d9258e5e854911",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_all_filter]": [
+ {
+ "checksum": "b36da1136be0cd9ffe884f94e96a0ad9",
+ "size": 71,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_all_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_field]": [
+ {
+ "checksum": "0c8642530817c62af484876bca630f4a",
+ "size": 58,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_field_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_field_filter]": [
+ {
+ "checksum": "916f42c3c89e88e0bb1e85cf98aa84c4",
+ "size": 73,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_field_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_field_limit_offset]": [
+ {
+ "checksum": "5a87cc3a434d4e8d0747d1fff2c6fa77",
+ "size": 92,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_field_limit_offset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_field_order_by]": [
+ {
+ "checksum": "18eb2def401b5b29a261a3dc7b8fcc1f",
+ "size": 86,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_field_order_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_field_rename]": [
+ {
+ "checksum": "5544f08306759142268497e6e1abab5d",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_field_rename_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_group_by_all]": [
+ {
+ "checksum": "36a01ce69069bfb37a49fe2e2d62f1bd",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_group_by_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_group_by_key]": [
+ {
+ "checksum": "80ecf08d96e6ea9a8e61cbbcaa19338c",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_group_by_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_join]": [
+ {
+ "checksum": "2d6ef67e626d30a76f049eb8d9dd4f0f",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_mix_fields]": [
+ {
+ "checksum": "f62dceacbec01b6e06d5ca2e1831d514",
+ "size": 67,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_mix_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_nested_table_row]": [
+ {
+ "checksum": "e568f631ce2f9407524a21f84ea3d34f",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_nested_table_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_table_row]": [
+ {
+ "checksum": "236fc5ba54f58f033d92c14e9d7ed1c8",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_table_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-select_union_all]": [
+ {
+ "checksum": "1122ad20281c8fab7b9c33dabde6158f",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-select_union_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-some_tablerow]": [
+ {
+ "checksum": "5f69750c7cdf7754e515ba95557bf91c",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-some_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-topsort]": [
+ {
+ "checksum": "513459567bea13ff52bf88a00e2d800b",
+ "size": 188,
+ "uri": "https://{canondata_backend}/1937429/d9e26546ec60615ac3a6bdb8250a95b71cccc205/resource.tar.gz#test_sql_format.test_lineage-topsort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-union_all_tablerow]": [
+ {
+ "checksum": "d84f10845f891333d67cfa1092a53d67",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-union_all_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-unordered_subquery]": [
+ {
+ "checksum": "81a2c3f74787550be08e979127ba8437",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1031349/ad03ca89b32a9e8069f809ad27ebec411c32feeb/resource.tar.gz#test_sql_format.test_lineage-unordered_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_asstruct]": [
+ {
+ "checksum": "a61408608c9578a59e84825d205557e8",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-window_asstruct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_many]": [
+ {
+ "checksum": "bb79dcdaad44f408c82d42f088effc6b",
+ "size": 304,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-window_many_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_member_struct]": [
+ {
+ "checksum": "d8265e74e72c3861ff7da75e13ad9663",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-window_member_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_one]": [
+ {
+ "checksum": "55c5b2fabeab2e240b357ce3034b27c2",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-window_one_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_session]": [
+ {
+ "checksum": "dc52b23c6c7dfece96711b772e07a0d5",
+ "size": 270,
+ "uri": "https://{canondata_backend}/1936842/82663648d73f44b9da053524ac248b5cb2bb12be/resource.tar.gz#test_sql_format.test_lineage-window_session_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-window_tablerow]": [
+ {
+ "checksum": "be4bb2321acebdf07345c4b987a31f31",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_lineage-window_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[lineage-with_inline]": [
+ {
+ "checksum": "d852f8ea8b1b9327dd56414245a3e780",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1599023/66d0b07d601bb15f0e0b65bb7b4d493f89c1c283/resource.tar.gz#test_sql_format.test_lineage-with_inline_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-after_match_skip_past_last_row]": [
+ {
+ "checksum": "100b9f9651315a432e18868c21b776d6",
+ "size": 412,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql_format.test_match_recognize-after_match_skip_past_last_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-alerts-streaming]": [
+ {
+ "checksum": "d3a3fd90c8a6a758f0067dd66566d37a",
+ "size": 2968,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql_format.test_match_recognize-alerts-streaming_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-alerts]": [
+ {
+ "checksum": "26acb44218b8f1112df875867fe530ef",
+ "size": 2970,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql_format.test_match_recognize-alerts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-alerts_without_order]": [
+ {
+ "checksum": "0e6e55207b31bb4597a16821c0b3ac34",
+ "size": 2935,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql_format.test_match_recognize-alerts_without_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-permute]": [
+ {
+ "checksum": "97960de85a125f078b142f62ebfe938e",
+ "size": 750,
+ "uri": "https://{canondata_backend}/1130705/ab8dea65d8ef4022fe05bde8ae56bb987e245f04/resource.tar.gz#test_sql_format.test_match_recognize-permute_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-simple_paritioning-streaming]": [
+ {
+ "checksum": "866c90e57774391e964eb962f8f52551",
+ "size": 1288,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_match_recognize-simple_paritioning-streaming_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-simple_paritioning]": [
+ {
+ "checksum": "63bbea2dc9e393f61ad91c23993ef949",
+ "size": 1271,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_match_recognize-simple_paritioning_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-test_type-streaming]": [
+ {
+ "checksum": "dff93233d548fced08a928337ba46a86",
+ "size": 1296,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_match_recognize-test_type-streaming_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-test_type]": [
+ {
+ "checksum": "36104b385f3b9986c22f409931b80564",
+ "size": 1302,
+ "uri": "https://{canondata_backend}/1936842/c0fac16b134e7c8f865a197ac63738ced4fac271/resource.tar.gz#test_sql_format.test_match_recognize-test_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[match_recognize-test_type_predicate]": [
+ {
+ "checksum": "9dc7192e7a809496ce854770180376c5",
+ "size": 416,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_match_recognize-test_type_predicate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-aggregate_over_aggregate]": [
+ {
+ "checksum": "fd7eb1df479e69937b8d86a9110a859c",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-aggregate_over_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-and_absorption]": [
+ {
+ "checksum": "4d2b25e403c3d6e5f78cf7f9a02d1508",
+ "size": 237,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql_format.test_optimizers-and_absorption_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-coalesce_propagate]": [
+ {
+ "checksum": "d498943af42c4c08e70e2b71d2e28ceb",
+ "size": 253,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-coalesce_propagate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-combinebykey_fields_subset]": [
+ {
+ "checksum": "5fd12969db76de99ab78c1b7172387de",
+ "size": 99,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-combinebykey_fields_subset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-combinebykey_fields_subset_range]": [
+ {
+ "checksum": "dc76d8f5f17691b1d73eb7162506fbfb",
+ "size": 139,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-combinebykey_fields_subset_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-constant_fold_minmax]": [
+ {
+ "checksum": "e92794fa7041816d8175732158a3a007",
+ "size": 815,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-constant_fold_minmax_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-direct_row_after_merge]": [
+ {
+ "checksum": "7a45841c9874752a87c364d35cf9d1df",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-direct_row_after_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-field_subset_for_multiusage]": [
+ {
+ "checksum": "b04a33cb1dc7b863d79455f220364e4f",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-field_subset_for_multiusage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-flatmap_with_non_struct_out]": [
+ {
+ "checksum": "97485e3f5c75620b76b8736e6e8b00f1",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-flatmap_with_non_struct_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-group_visit_lambdas]": [
+ {
+ "checksum": "95b97f5bb2559860f0f1417ea5c6cf9f",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-group_visit_lambdas_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-instant_contains_lookup]": [
+ {
+ "checksum": "50d6e3c0efbf8302807b5633d2971d56",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-instant_contains_lookup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-length_over_merge]": [
+ {
+ "checksum": "1a04523cfc331b966e02957cac5c5f37",
+ "size": 428,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-length_over_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-length_over_merge_fs_multiusage]": [
+ {
+ "checksum": "81f76674682498288b92904264c7a0cd",
+ "size": 498,
+ "uri": "https://{canondata_backend}/1599023/c4917fc01ae646b5e708e20b50ea7ae2325f5bb7/resource.tar.gz#test_sql_format.test_optimizers-length_over_merge_fs_multiusage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-multi_to_empty_constraint]": [
+ {
+ "checksum": "417fc8b1ee413a204123ed56af1aa32f",
+ "size": 312,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-multi_to_empty_constraint_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-nonselected_direct_row]": [
+ {
+ "checksum": "2cfae16ee48a596f5450fe3c4765c3d9",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-nonselected_direct_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-or_absorption]": [
+ {
+ "checksum": "2230cb464fdb9fdf390d00eb91281b3a",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql_format.test_optimizers-or_absorption_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-or_distributive]": [
+ {
+ "checksum": "a2a2c77147c7e2682b0b5607f0cdf01e",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1899731/e3362128604c06331b9098acc38b35e2d308968b/resource.tar.gz#test_sql_format.test_optimizers-or_distributive_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-passthrough_sortness_over_map]": [
+ {
+ "checksum": "8c47651124d136709d3d8388a35aea20",
+ "size": 418,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-passthrough_sortness_over_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-pushdown_nonsep_over_aggregate]": [
+ {
+ "checksum": "59dcdde5e1a360b7a06ab4eb12d91f2e",
+ "size": 326,
+ "uri": "https://{canondata_backend}/1899731/407203c9a441603d4ce4780c1c3daab84de46096/resource.tar.gz#test_sql_format.test_optimizers-pushdown_nonsep_over_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sort_by_nonstrict_const]": [
+ {
+ "checksum": "a8ef5fa0a5a869ab80571d8a9c27cb93",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1775059/2a9bd55a1c15f5a3a2740dd1a07c9cbfaaf0a087/resource.tar.gz#test_sql_format.test_optimizers-sort_by_nonstrict_const_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sort_constraint_in_left]": [
+ {
+ "checksum": "2c01a105397c0f8f6d3ff3c4846bd762",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-sort_constraint_in_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sort_over_sorted_prefix_keys]": [
+ {
+ "checksum": "96574f2d0d354ef2094b3f7a48fdb6f8",
+ "size": 199,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-sort_over_sorted_prefix_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sort_over_sorted_same_keys]": [
+ {
+ "checksum": "0119c94955b9e85c9ea29e03326247f8",
+ "size": 215,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-sort_over_sorted_same_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sorted_scalar_content]": [
+ {
+ "checksum": "99b4ca4e5322c1f04efb785efc8489a2",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_optimizers-sorted_scalar_content_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-sorted_sql_in]": [
+ {
+ "checksum": "c43f12ac8cae1021845d70bec31e3a08",
+ "size": 313,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_optimizers-sorted_sql_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-test_fuse_map_predicate_limit]": [
+ {
+ "checksum": "4f6e0b8b43d75fac3fcc88ff4604868f",
+ "size": 269,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-test_fuse_map_predicate_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-test_fuse_map_take]": [
+ {
+ "checksum": "1d0a0997a46c28c1e561853ade8648b3",
+ "size": 308,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-test_fuse_map_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-test_lmap_opts]": [
+ {
+ "checksum": "8f415c749321d8022361dd9fa7222fcf",
+ "size": 1081,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-test_lmap_opts_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-test_no_aggregate_split]": [
+ {
+ "checksum": "14ea2b7773a2c45295be00e71d375d4c",
+ "size": 433,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-test_no_aggregate_split_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-total_order]": [
+ {
+ "checksum": "bfae4b6ae4e2bbf1740bdd0ae3084875",
+ "size": 612,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-total_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-unused_columns_group]": [
+ {
+ "checksum": "c3e370bda310913b8e7832d177486bf3",
+ "size": 348,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-unused_columns_group_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-unused_columns_group_one_of_multi]": [
+ {
+ "checksum": "43ef7d17134e05917e976276e11f679d",
+ "size": 334,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-unused_columns_group_one_of_multi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-unused_columns_window]": [
+ {
+ "checksum": "eb8e28546463d96bd1ee364f60a607c8",
+ "size": 199,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-unused_columns_window_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-unused_columns_window_no_payloads]": [
+ {
+ "checksum": "648fa12e0da6e1860a2850e77218bffc",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-unused_columns_window_no_payloads_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-wide_if_present_over_double_just]": [
+ {
+ "checksum": "3ae787e91b056685da188b47e46e7235",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-wide_if_present_over_double_just_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-10042_disable_flow_fuse_depends_on]": [
+ {
+ "checksum": "6e2236a98a068d58cda86b424be70f8c",
+ "size": 227,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-10042_disable_flow_fuse_depends_on_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-10042_disable_fuse_depends_on]": [
+ {
+ "checksum": "6ff9aedd9b559dd216e7b4c3e4bd6af8",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-10042_disable_fuse_depends_on_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-10070_extract_members_over_calcoverwindow]": [
+ {
+ "checksum": "31042d4640d1a2a4f8afdb992b4ce3ec",
+ "size": 548,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-10070_extract_members_over_calcoverwindow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-10074_dont_inline_lists_depends_on]": [
+ {
+ "checksum": "015487917fe071d1f397cbbe8863919d",
+ "size": 238,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-10074_dont_inline_lists_depends_on_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-10737_lost_passthrough]": [
+ {
+ "checksum": "515a65c63abf54b4c8278a65e0dfd5ac",
+ "size": 346,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-10737_lost_passthrough_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-11171_unordered_over_sorted_fill]": [
+ {
+ "checksum": "3390c46f51360cfa314615a6ca58f8b1",
+ "size": 257,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-11171_unordered_over_sorted_fill_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-12620_stage_multiuse]": [
+ {
+ "checksum": "8aea87f2aa25e45c0a7dac7b4076a596",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-12620_stage_multiuse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-14279_keyextract_with_world_dep]": [
+ {
+ "checksum": "bb8860cf9e69ece4241a42ad2f07fc25",
+ "size": 261,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-14279_keyextract_with_world_dep_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-14581_fuseflatmaps_with_external_lambda]": [
+ {
+ "checksum": "f42063c5b1af4290682c3e629db4b073",
+ "size": 797,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-14581_fuseflatmaps_with_external_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-15210_sqlin]": [
+ {
+ "checksum": "7869780cb7e8591c32f8485b9bfb6e08",
+ "size": 291,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-15210_sqlin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-16134]": [
+ {
+ "checksum": "bfccb6e4465e296f5420ce4389e492b3",
+ "size": 97,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-16134_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-17413-topsort]": [
+ {
+ "checksum": "296d9b7a1d678fdd9174261ca64f7dca",
+ "size": 327,
+ "uri": "https://{canondata_backend}/1889210/525a727248199e4967ca2f854e5235352e3d5482/resource.tar.gz#test_sql_format.test_optimizers-yql-17413-topsort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-17715_concat_sort_desc]": [
+ {
+ "checksum": "c644b0dfcbb6e77f508129b548b94f16",
+ "size": 1181,
+ "uri": "https://{canondata_backend}/1942525/7ef0cd1bc632788b3cc025a801fdee39a608567b/resource.tar.gz#test_sql_format.test_optimizers-yql-17715_concat_sort_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-18300-flatmap-over-extend]": [
+ {
+ "checksum": "95de7e60fd1ce3ead18b18b8b9a6a659",
+ "size": 367,
+ "uri": "https://{canondata_backend}/1936997/1a3eb8ef93462f24881c98db5e367242501cd72e/resource.tar.gz#test_sql_format.test_optimizers-yql-18300-flatmap-over-extend_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-18408_filter_multiusage_pushdown]": [
+ {
+ "checksum": "3abed13d03b0bf6565b54d2982f6a070",
+ "size": 3526,
+ "uri": "https://{canondata_backend}/1936273/49c67b7d7a39200caa18261ed9d1bc5db8f0665a/resource.tar.gz#test_sql_format.test_optimizers-yql-18408_filter_multiusage_pushdown_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-18733_no_filter_multiusage_pushdown]": [
+ {
+ "checksum": "a776d7acfad71c3c81e59cbd969fd103",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1942671/a0a38df298ba29d07b694136c15631b91a455b2b/resource.tar.gz#test_sql_format.test_optimizers-yql-18733_no_filter_multiusage_pushdown_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-2171_aggregate_desc_sort_and_extract]": [
+ {
+ "checksum": "ea7ad8b12dbf78644e2a7ac94e10159b",
+ "size": 560,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-2171_aggregate_desc_sort_and_extract_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-2582_limit_for_join_input]": [
+ {
+ "checksum": "9ec019bcd5b5dcf48efcf8fa6bd5b024",
+ "size": 309,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-2582_limit_for_join_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-2582_limit_for_join_input_other]": [
+ {
+ "checksum": "e3d424d362c760d819b95cdf1a05e332",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-2582_limit_for_join_input_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-3455_filter_sorted]": [
+ {
+ "checksum": "7513951d467a78188105de62323f662c",
+ "size": 242,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-3455_filter_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-4240-aggregate_whole_struct]": [
+ {
+ "checksum": "ab3e1d1033aac3fa27f38d65d6e028b3",
+ "size": 477,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-4240-aggregate_whole_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-5833-table_content]": [
+ {
+ "checksum": "993cf2147f9d66f7d3ac5ac9175a4bdb",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-5833-table_content_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-5978_fill_multi_usage]": [
+ {
+ "checksum": "77a6012b3d31f5ad003729b17fb10fc8",
+ "size": 435,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-5978_fill_multi_usage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-6008_limit_after_map]": [
+ {
+ "checksum": "40286b3cb523887bc5f7eb2faa32ed55",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-6008_limit_after_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-6038_direct_row]": [
+ {
+ "checksum": "79c4ac9b787ee8dc2830b80892a977af",
+ "size": 680,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-6038_direct_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-6133_skip_deps]": [
+ {
+ "checksum": "2f9846f3e967856b440738933d6e4805",
+ "size": 380,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-6133_skip_deps_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-7324_duplicate_arg]": [
+ {
+ "checksum": "e382a2a3202a789e91b6e432074ddfce",
+ "size": 434,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-7324_duplicate_arg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-7532_wrong_field_subset_for_calcoverwindow]": [
+ {
+ "checksum": "cca6970f109f0719796b126b77b4a55c",
+ "size": 530,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-7532_wrong_field_subset_for_calcoverwindow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-7767_key_filter_with_view]": [
+ {
+ "checksum": "b4f3703f85dd525cb5d1e484c2e3f84c",
+ "size": 188,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-7767_key_filter_with_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-8041-fuse_with_desc_map]": [
+ {
+ "checksum": "a811c61c63a59d094e444e4b97ad9888",
+ "size": 257,
+ "uri": "https://{canondata_backend}/1936842/9da17f420e478992cf6c97d9a8ec2f53cf0578f3/resource.tar.gz#test_sql_format.test_optimizers-yql-8041-fuse_with_desc_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-8223_direct_row_and_skipnullmembers]": [
+ {
+ "checksum": "9a5226272c318621fdb950de3a9d365f",
+ "size": 587,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-8223_direct_row_and_skipnullmembers_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-8953_logical_fuse_with_table_props]": [
+ {
+ "checksum": "7c6368b74c26040aac9dc3f10f7d5e1c",
+ "size": 249,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-8953_logical_fuse_with_table_props_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql-9297_publish_ytcopy]": [
+ {
+ "checksum": "524079babe45e2134b9d7994366c5dd6",
+ "size": 281,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql-9297_publish_ytcopy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql_5830_fuse_outer_with_extra_deps]": [
+ {
+ "checksum": "4275eddf84a7a52193315a769b80aa5f",
+ "size": 315,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yql_5830_fuse_outer_with_extra_deps_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yql_6179_merge_chunks_of_outputs]": [
+ {
+ "checksum": "ba679e76eec245eba1110d581a98c07d",
+ "size": 470,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_optimizers-yql_6179_merge_chunks_of_outputs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yson_dup_serialize]": [
+ {
+ "checksum": "18c0d5b8e0d937d3a537fc5006f69be3",
+ "size": 333,
+ "uri": "https://{canondata_backend}/1936273/29d40372523e1255c2df44e13891a9856f7ffd81/resource.tar.gz#test_sql_format.test_optimizers-yson_dup_serialize_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[optimizers-yt_shuffle_by_keys]": [
+ {
+ "checksum": "7a29e0aae485e85c9311940ee356b680",
+ "size": 463,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_optimizers-yt_shuffle_by_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-SortByOneFieldDesc]": [
+ {
+ "checksum": "a499a9610eb931b8341b3d7d1fbde6fb",
+ "size": 51,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-SortByOneFieldDesc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-SortByOneField]": [
+ {
+ "checksum": "efa4b66c87d3512d32829fb9dd45726f",
+ "size": 46,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-SortByOneField_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-SortByTwoFieldsDesc]": [
+ {
+ "checksum": "2c53b8067a6535a021065fe6a1166994",
+ "size": 70,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-SortByTwoFieldsDesc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-SortByTwoFields]": [
+ {
+ "checksum": "efa14a6e74fa00fe3775b059959d92ee",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-SortByTwoFields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-assume_cut_prefix]": [
+ {
+ "checksum": "ae001032f6d5a64c422ae88ea33b2676",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-assume_cut_prefix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-assume_over_input]": [
+ {
+ "checksum": "168b0795530a2d9e202f54affa44c5b6",
+ "size": 170,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-assume_over_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-assume_over_input_desc]": [
+ {
+ "checksum": "e68351f70e08950b052657e280fcf180",
+ "size": 226,
+ "uri": "https://{canondata_backend}/1899731/0ca37b118ec11c394372b67045a20b184be56ed1/resource.tar.gz#test_sql_format.test_order_by-assume_over_input_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-assume_with_filter]": [
+ {
+ "checksum": "281bb36baa6a0e7ff68f583c682734b9",
+ "size": 215,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-assume_with_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-assume_with_transform_desc]": [
+ {
+ "checksum": "f21b72ea22fccbcc9fe52dfeba5af669",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1781765/fdb63efffb1d02483785971698b585f357ca6a8a/resource.tar.gz#test_sql_format.test_order_by-assume_with_transform_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-changed_sort_with_limit]": [
+ {
+ "checksum": "947cec25b088ee40c57b3066d1cb66bd",
+ "size": 149,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-changed_sort_with_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-extract_members_over_sort_desc]": [
+ {
+ "checksum": "4479a6a46485a1bb265deeb765dc1b31",
+ "size": 257,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-extract_members_over_sort_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-limit]": [
+ {
+ "checksum": "6b364bac0ceabc6a2f9484f3b218b4a8",
+ "size": 59,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal]": [
+ {
+ "checksum": "f248ee98c5c8eab810fe0164a6ac9ba1",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-literal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_complex]": [
+ {
+ "checksum": "99a2a023bd6a77a4de3a951d6cd24e08",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1942671/548765a0eb2a5a10835937229f8590d3d1dc667b/resource.tar.gz#test_sql_format.test_order_by-literal_complex_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_desc]": [
+ {
+ "checksum": "1deb8e41d3d1eb143a79d15ab8d44863",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1937429/132e707c4cd97b5813858f6f125f992c9570af07/resource.tar.gz#test_sql_format.test_order_by-literal_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_empty_list_sort]": [
+ {
+ "checksum": "02622582a897807448880031be8ac368",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-literal_empty_list_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_single_item_sort]": [
+ {
+ "checksum": "ef33a5ee5e5e2ba945cadc5faa3c0658",
+ "size": 200,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-literal_single_item_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_take_zero_sort]": [
+ {
+ "checksum": "4c1458cbf4690641cffb317d0ec06d12",
+ "size": 358,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-literal_take_zero_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_with_assume]": [
+ {
+ "checksum": "8ea7e273731251d1fcde48cf925e84a6",
+ "size": 357,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-literal_with_assume_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-literal_with_assume_desc]": [
+ {
+ "checksum": "4db2ecafdab905eb8d937eb785034d67",
+ "size": 256,
+ "uri": "https://{canondata_backend}/1937027/ecf9c51fefd096b186783e2b5d86a71e7d7111f7/resource.tar.gz#test_sql_format.test_order_by-literal_with_assume_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-native_desc_assume_with_transform]": [
+ {
+ "checksum": "b12c6144052effde8230e63c4207c1d6",
+ "size": 236,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-native_desc_assume_with_transform_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-native_desc_publish]": [
+ {
+ "checksum": "ef1eb7f074f3f1ab87deb180adb80031",
+ "size": 197,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-native_desc_publish_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-native_desc_sort]": [
+ {
+ "checksum": "8e94a5272eba929d3a19349695d17ee4",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-native_desc_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-native_desc_sort_calc]": [
+ {
+ "checksum": "a17be2f3dd640827ec39037a8e7b19da",
+ "size": 154,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-native_desc_sort_calc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-native_desc_sort_with_limit]": [
+ {
+ "checksum": "586ab73eb20e2d6ead8e192dd5222a59",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-native_desc_sort_with_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_dot_column]": [
+ {
+ "checksum": "37edf42416add62f66718b5712741a66",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_dot_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_dynum]": [
+ {
+ "checksum": "089b7b257f6a6b268c86130f7cf7a765",
+ "size": 111,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_dynum_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_dynum_desc]": [
+ {
+ "checksum": "05679213c02060ce51c150a786018a87",
+ "size": 116,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_dynum_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_expr]": [
+ {
+ "checksum": "856e5a69ae770fbe920bd4823c7fffaa",
+ "size": 131,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_expr_mul_cols]": [
+ {
+ "checksum": "238344cd800f34898b2b99e298323ba9",
+ "size": 193,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_expr_mul_cols_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_expr_over_sorted_table]": [
+ {
+ "checksum": "50dd0e2d0f0448a87479d7eb0dca9cdf",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1942100/c4bce5e5892336c582b82452a749ad078406235f/resource.tar.gz#test_sql_format.test_order_by-order_by_expr_over_sorted_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_expr_simple]": [
+ {
+ "checksum": "3cafc10dbc95d9b77355d32baaedbe81",
+ "size": 127,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_expr_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_expr_with_deps]": [
+ {
+ "checksum": "0a709423e38e12e8ecfc912dff3a47c8",
+ "size": 199,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_expr_with_deps_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_list_of_strings]": [
+ {
+ "checksum": "b641d7f0099fce12908454219de0522f",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_list_of_strings_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column]": [
+ {
+ "checksum": "4cc3522c6b6eb8309231e398a855394f",
+ "size": 506,
+ "uri": "https://{canondata_backend}/1937429/114961b26476797b95763679349a6ea2e9f8cea8/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column_as_table]": [
+ {
+ "checksum": "3871b5da70e1df6c78a572ec4b842b75",
+ "size": 408,
+ "uri": "https://{canondata_backend}/1937001/6c1efa96a2ae4050b12a9381285624ab71389741/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_as_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column_ignored]": [
+ {
+ "checksum": "f3d38e1afa4667e4a86dbe72c0a9de94",
+ "size": 779,
+ "uri": "https://{canondata_backend}/1871182/b560fdc93cb96ca9e574901b22abd265bdefb213/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_ignored_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column_join2]": [
+ {
+ "checksum": "2c530f4a349a9abe39d58c9251c325bb",
+ "size": 615,
+ "uri": "https://{canondata_backend}/1814674/b5f58d06faf616e33e81d1596c8a849f37284058/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_join2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column_join]": [
+ {
+ "checksum": "0ece4190b44e63e1633ee74eb8e135db",
+ "size": 2047,
+ "uri": "https://{canondata_backend}/1903280/1a220e4d3fac05e34ef889600ae82e2c121901d0/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_missing_project_column_join_types]": [
+ {
+ "checksum": "a56231421da19446c15656d1b5f6b9fc",
+ "size": 2115,
+ "uri": "https://{canondata_backend}/1781765/c04cbb08c79f2b2bfd260dde1ea706c5a9450568/resource.tar.gz#test_sql_format.test_order_by-order_by_missing_project_column_join_types_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_mul_columns]": [
+ {
+ "checksum": "ecd62b80c49799026e8275d8c3daeaef",
+ "size": 87,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_mul_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_num_key_and_subkey]": [
+ {
+ "checksum": "42c1abfa32dcad43ddc0a90850bfb730",
+ "size": 128,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_num_key_and_subkey_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_num_key_and_subkey_desc]": [
+ {
+ "checksum": "917bd03b24798a84ba845815ff712ba1",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_num_key_and_subkey_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tablepath_column]": [
+ {
+ "checksum": "d01a45c18934dbb7950b8b18c3cf0852",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1600758/7bfd1ef457afc0ff28f5975f5deac4cbe6c60f7f/resource.tar.gz#test_sql_format.test_order_by-order_by_tablepath_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tablerecord_column]": [
+ {
+ "checksum": "17a64ca3f0feec41fafb4212b45e3d47",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_tablerecord_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tablerow_column]": [
+ {
+ "checksum": "90e7feac71ae3b82304692773a30aea6",
+ "size": 90,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_tablerow_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tuple]": [
+ {
+ "checksum": "744f22281791695b6c00f5591bc18149",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tuple_and_member]": [
+ {
+ "checksum": "28be83dd84ad70cec3346878b9e82ec0",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_tuple_and_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_tuple_expr]": [
+ {
+ "checksum": "1a3ea2358c9257a8a074194da7fa1375",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_tuple_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_udf]": [
+ {
+ "checksum": "9316241f662113f3166acf66a4492ea5",
+ "size": 104,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_udf_duo]": [
+ {
+ "checksum": "f24606bf683d416a9bc7ed608816ecce",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_udf_duo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_by_value_desc]": [
+ {
+ "checksum": "3831c401e632dc1109eb90e7fd25927c",
+ "size": 80,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_by_value_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-order_with_null]": [
+ {
+ "checksum": "45d9a5460bf851431dd845a830e5534f",
+ "size": 274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-order_with_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-ordered_fill]": [
+ {
+ "checksum": "1f86763fcccbcdbe1023481f8f82fe9d",
+ "size": 233,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-ordered_fill_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-presort_mem]": [
+ {
+ "checksum": "95d066d3807e8bb64dfd5903e08c15ce",
+ "size": 1997,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-presort_mem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-presort_order_by_table]": [
+ {
+ "checksum": "c36a2d3d5a840ffbbc1ae11c0a525629",
+ "size": 252,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-presort_order_by_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-single_item_tuple]": [
+ {
+ "checksum": "cfceaa9e1b45f0dbeec036ff28df0056",
+ "size": 68,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-single_item_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-singular]": [
+ {
+ "checksum": "9cd7195075d864c02c19fc725b3efb1d",
+ "size": 242,
+ "uri": "https://{canondata_backend}/1942671/8c16074b04676424a30b22e78557025fc0000a8e/resource.tar.gz#test_sql_format.test_order_by-singular_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-sort]": [
+ {
+ "checksum": "136d52b0d974b706d84692b7814ef9b2",
+ "size": 67,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-sort_decimals]": [
+ {
+ "checksum": "daab6f76a65d1917e60806f0688010f8",
+ "size": 295,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-sort_decimals_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-sort_simple]": [
+ {
+ "checksum": "29779cdec3cdf4da8732390b5ab1046e",
+ "size": 234,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-sort_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-sort_with_take]": [
+ {
+ "checksum": "f1c12e01ffe6a5b863a23f7aa53047f6",
+ "size": 160,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-sort_with_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-sort_with_take_limit]": [
+ {
+ "checksum": "5cec203d0add71613981fc1f8e6c8fe0",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-sort_with_take_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-tuple01]": [
+ {
+ "checksum": "72caa083f226f340b7568e2abc724fd5",
+ "size": 685,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-tuple01_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-union_all]": [
+ {
+ "checksum": "bff793b86ded0a95685b162e6bfe70d8",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-union_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[order_by-warn_offset_wo_sort]": [
+ {
+ "checksum": "1388491353cd1da42dd1e25a288f6cce",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_order_by-warn_offset_wo_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-complex_yson]": [
+ {
+ "checksum": "b4f3f9391696300f57746799a36b2a0f",
+ "size": 88,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-complex_yson_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-dict]": [
+ {
+ "checksum": "23c5e723843c6100702941d3a7a7e9ad",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-list]": [
+ {
+ "checksum": "6b800f15fe8e662befe28b251296da3b",
+ "size": 124,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-missing_param_fail]": [
+ {
+ "checksum": "36a92ca597d877445791dd9c322bfcc3",
+ "size": 59,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-missing_param_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-no_optional_param]": [
+ {
+ "checksum": "7be179a21d4dff33e7f94aa321d20972",
+ "size": 80,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-no_optional_param_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-no_params_fail]": [
+ {
+ "checksum": "50909d9e66f2d5bef3d23676f5d4fad3",
+ "size": 39,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-no_params_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-param_in_in_predicate]": [
+ {
+ "checksum": "f8a083ab1c4c1d2bec6e5ef106fe388e",
+ "size": 92,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-param_in_in_predicate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-param_in_json_api]": [
+ {
+ "checksum": "8d2a15e5e0e1b30bdfe795bcb08a60e4",
+ "size": 775,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-param_in_json_api_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-param_type_mismatch_fail]": [
+ {
+ "checksum": "5796d57a1a05017abbd2f61b17e96157",
+ "size": 42,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-param_type_mismatch_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-primitives]": [
+ {
+ "checksum": "81c5c7663680bdea6de683f0179a995b",
+ "size": 1128,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-primitives_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-struct]": [
+ {
+ "checksum": "18c5348030567edacc1dc0350aa92a4a",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-tuple]": [
+ {
+ "checksum": "6ebb5a6dc1efda3501cd81c8fb9d282c",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[params-variant]": [
+ {
+ "checksum": "0dd5bc208c5669bd3673c22189e1676b",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_params-variant_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-aggr_compare]": [
+ {
+ "checksum": "3f37e50b2fae52d921e298eeaa3a7e89",
+ "size": 1060,
+ "uri": "https://{canondata_backend}/212715/13599fb3badde5c5b2ea604f6dac9a314715e4c2/resource.tar.gz#test_sql_format.test_pg-aggr_compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-aggregate_factory]": [
+ {
+ "checksum": "b6cc288822e6124f63065ae263e21214",
+ "size": 1052,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-aggregate_factory_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-bit_const]": [
+ {
+ "checksum": "ec38a9a52367973cc16b17d05277ad2a",
+ "size": 74,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-bit_const_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-compare]": [
+ {
+ "checksum": "353d7ecf96f7faf7001813e769f6cfaa",
+ "size": 661,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-compare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-dates_from_pg]": [
+ {
+ "checksum": "ea30425026f5982933d292c13b7b3584",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1937429/d034c1084845b9c741ee5ac1d845006bff04bd59/resource.tar.gz#test_sql_format.test_pg-dates_from_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-dates_to_pg]": [
+ {
+ "checksum": "a0a2bb0293ddc1f762924852d3651244",
+ "size": 532,
+ "uri": "https://{canondata_backend}/1925842/993f03733a95d23632abd85d6850807a0e17b52b/resource.tar.gz#test_sql_format.test_pg-dates_to_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-in_sorted]": [
+ {
+ "checksum": "7e5bdc810b9ccc96b06d13b8febae04e",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-in_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-interval_to_pg]": [
+ {
+ "checksum": "5d29c0196b2255a7c85b2f7ca152c077",
+ "size": 271,
+ "uri": "https://{canondata_backend}/1925842/993f03733a95d23632abd85d6850807a0e17b52b/resource.tar.gz#test_sql_format.test_pg-interval_to_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-nulls]": [
+ {
+ "checksum": "4b8d181109c88cf02154ccb9771b356f",
+ "size": 576,
+ "uri": "https://{canondata_backend}/1889210/b146620fd4d09c1c222f1b1341d4d70863b98fe6/resource.tar.gz#test_sql_format.test_pg-nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-nulls_native]": [
+ {
+ "checksum": "0e202da52c6ad4b67bc30b6a9c6a00fe",
+ "size": 604,
+ "uri": "https://{canondata_backend}/1889210/b146620fd4d09c1c222f1b1341d4d70863b98fe6/resource.tar.gz#test_sql_format.test_pg-nulls_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-numbers_to_pg]": [
+ {
+ "checksum": "1cf61d59e7e627b3451a3e67cff6b9f1",
+ "size": 437,
+ "uri": "https://{canondata_backend}/1900335/ff80d8557940adda4b5c22a224a0d0bc8e975889/resource.tar.gz#test_sql_format.test_pg-numbers_to_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-numeric_to_pg]": [
+ {
+ "checksum": "5a745f5a514580aeb085aab95c567862",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1847551/ca138a141bfa621116f6d751dcc66c2d966547d9/resource.tar.gz#test_sql_format.test_pg-numeric_to_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_in_dict_key_with_stable_pickle]": [
+ {
+ "checksum": "f758865b5d78a28d3f519575ea234704",
+ "size": 481,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-pg_in_dict_key_with_stable_pickle_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_iterate]": [
+ {
+ "checksum": "1da98df588d09df6f6e91c46a5d06701",
+ "size": 715,
+ "uri": "https://{canondata_backend}/1689644/58b94ee78c0b4d3f96a346070a311370cd242424/resource.tar.gz#test_sql_format.test_pg-pg_iterate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_type_from_oid]": [
+ {
+ "checksum": "ee7e7b037b636ac3ffedbb1f281c4995",
+ "size": 67,
+ "uri": "https://{canondata_backend}/1784826/f4f973986aeb73b12fe554950350ca10b9e811ee/resource.tar.gz#test_sql_format.test_pg-pg_type_from_oid_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_types_array_literal]": [
+ {
+ "checksum": "191d723501f618711d6d4c9ad8b883bf",
+ "size": 34,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-pg_types_array_literal_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_types_dict]": [
+ {
+ "checksum": "dd6236e6e709935d3a6357384b393a3f",
+ "size": 807,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-pg_types_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_types_literal_mods]": [
+ {
+ "checksum": "a5940ec16f6a348a52b1b203887fb0aa",
+ "size": 502,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-pg_types_literal_mods_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pg_types_literal_with_length]": [
+ {
+ "checksum": "0bd22138d1dcffb0855573ed5242eca3",
+ "size": 116,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-pg_types_literal_with_length_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pgns_agg]": [
+ {
+ "checksum": "76c561d4b5ced5a600630822124835a2",
+ "size": 57,
+ "uri": "https://{canondata_backend}/1942278/f9767af57fb40678ebac7071b53e03ed182ae745/resource.tar.gz#test_sql_format.test_pg-pgns_agg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-pgns_proc]": [
+ {
+ "checksum": "24413a1cdf3177e0adea1760335ec372",
+ "size": 32,
+ "uri": "https://{canondata_backend}/1942278/f9767af57fb40678ebac7071b53e03ed182ae745/resource.tar.gz#test_sql_format.test_pg-pgns_proc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-reflection]": [
+ {
+ "checksum": "65481055414382285e38644c195cc090",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1600758/38ec20d74ed9180e02356571b57a1985ca94a6c2/resource.tar.gz#test_sql_format.test_pg-reflection_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-set_of_as_records]": [
+ {
+ "checksum": "00d9cffca323e351247f12f351f55505",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-set_of_as_records_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-set_of_as_structs]": [
+ {
+ "checksum": "f58b58bae3aa547d1a13accec9e8cbbd",
+ "size": 88,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-set_of_as_structs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-set_over_unhashable]": [
+ {
+ "checksum": "e87a1e78bda3f7461a5a7f196205e9d0",
+ "size": 90,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-set_over_unhashable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-simple_ops]": [
+ {
+ "checksum": "e77e9ce697ed0727102abe0bd227e173",
+ "size": 880,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-simple_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-str_lookup_pg]": [
+ {
+ "checksum": "f1954f2bb0c2bf59abe9752284f424cc",
+ "size": 637,
+ "uri": "https://{canondata_backend}/1775059/5625478e977a363be64a17bebddbd8ed18706eac/resource.tar.gz#test_sql_format.test_pg-str_lookup_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-strings_to_pg]": [
+ {
+ "checksum": "313842eeb501da8d81903f95bf196047",
+ "size": 542,
+ "uri": "https://{canondata_backend}/1784826/cb0ddc73010fb403f8a8b15f4bc115172acddcfa/resource.tar.gz#test_sql_format.test_pg-strings_to_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-struct_tuple_cast]": [
+ {
+ "checksum": "d77766b8458d94c8c4af56c3d439d2dd",
+ "size": 224,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-struct_tuple_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-type_aliases]": [
+ {
+ "checksum": "f67872526ba5edc6adce4a440cf155d4",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-type_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-uuid_from_pg]": [
+ {
+ "checksum": "f8d31a03901a03a19f48e445911df949",
+ "size": 67,
+ "uri": "https://{canondata_backend}/1942100/c6520311ae8f5746b9b72292416e7d07b90cdac9/resource.tar.gz#test_sql_format.test_pg-uuid_from_pg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-wide_sort]": [
+ {
+ "checksum": "b18e0cfb7cbf8a12ed120442d2af626a",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-wide_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg-wide_top_sort]": [
+ {
+ "checksum": "a0c4b9cf83bfeb629d2122ad053e0f20",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pg-wide_top_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pg_catalog-pg_type_syntax_yql]": [
+ {
+ "checksum": "ecd1f5665b549d2f3162dd96e29a9f78",
+ "size": 70,
+ "uri": "https://{canondata_backend}/1942173/cb2fdcf9620011c608e9c76afbfe1a17bdd9d6f4/resource.tar.gz#test_sql_format.test_pg_catalog-pg_type_syntax_yql_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-classic_division]": [
+ {
+ "checksum": "0825b2b2d5636bbeedb994e22bef78d3",
+ "size": 311,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-classic_division_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-config_exec]": [
+ {
+ "checksum": "7ce536710cc8cc975608646a69a1e95b",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-config_exec_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-file]": [
+ {
+ "checksum": "38e21865c0f353076c84cff5a6ce660b",
+ "size": 36,
+ "uri": "https://{canondata_backend}/1923547/b5731bd11f9340039edd6a4bc2e31b3449d0e96a/resource.tar.gz#test_sql_format.test_pragma-file_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-release_temp_data_chain_pull]": [
+ {
+ "checksum": "8af293b478705f33f9ec050bb411cc31",
+ "size": 1648,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-release_temp_data_chain_pull_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-release_temp_data_chain_pull_fail]": [
+ {
+ "checksum": "4fad4bae1626d0f4251c301a86b92c3d",
+ "size": 1692,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-release_temp_data_chain_pull_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-release_temp_data_chain_pull_single_thread]": [
+ {
+ "checksum": "94970a55cf0f37c538d9ca6a1367aa64",
+ "size": 1648,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-release_temp_data_chain_pull_single_thread_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-release_temp_data_chain_pull_single_thread_fail]": [
+ {
+ "checksum": "cf60f74a876987343a72a629b476c4d0",
+ "size": 1712,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-release_temp_data_chain_pull_single_thread_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-yson_auto_convert]": [
+ {
+ "checksum": "ae0e1389b0e7e84d5c12c2365065f008",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-yson_auto_convert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[pragma-yson_strict_fail]": [
+ {
+ "checksum": "f63dda31155ab395808c0265722b3a9b",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_pragma-yson_strict_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-discard_process_with_lambda]": [
+ {
+ "checksum": "c6b4910fb83835f6ea3b126458cb8657",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-discard_process_with_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-discard_reduce_lambda]": [
+ {
+ "checksum": "0dde63554657e02dccd32ffac47a0895",
+ "size": 321,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-discard_reduce_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-fuse_reduces_with_presort]": [
+ {
+ "checksum": "8f8335d2d11bff52392da6cc36645c55",
+ "size": 1636,
+ "uri": "https://{canondata_backend}/1923547/a000f225caa0fe7476a3e0c0740662cd5bbe1d5e/resource.tar.gz#test_sql_format.test_produce-fuse_reduces_with_presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-native_desc_reduce_with_presort]": [
+ {
+ "checksum": "6af6ad9ee36a41b35cec0e63c725eae8",
+ "size": 993,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-native_desc_reduce_with_presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_and_filter]": [
+ {
+ "checksum": "8a8bf1ecd3b5d33acb9c2d109ae6329d",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_and_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_lambda_opt_args]": [
+ {
+ "checksum": "52fc6dc9253a2fe48d8ad637e655203b",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1936273/ff4f0a6d173adeb50438b8fd581dd8a952c141bd/resource.tar.gz#test_sql_format.test_produce-process_lambda_opt_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_multi_in]": [
+ {
+ "checksum": "4a33f40cf13fca883c7f2662b5a83c1c",
+ "size": 710,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_multi_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_multi_in_single_out]": [
+ {
+ "checksum": "45fe9c8e15c007824d9fda1e651b13bb",
+ "size": 733,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_multi_in_single_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_multi_in_trivial_lambda]": [
+ {
+ "checksum": "b22f5c63dc5f5a5ec5010b793f78069a",
+ "size": 201,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_multi_in_trivial_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_multi_out]": [
+ {
+ "checksum": "d82da59858d827963d1f8ed2c9dda59c",
+ "size": 550,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_multi_out_bad_count_fail]": [
+ {
+ "checksum": "938ab21d8cbc4e23cd64be7fde9f0417",
+ "size": 577,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_multi_out_bad_count_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_pure_with_sort]": [
+ {
+ "checksum": "563cbd5bcf8245f9e1ee101481011b2f",
+ "size": 1007,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_pure_with_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_row_and_columns]": [
+ {
+ "checksum": "c5ac07d7be9903d4552c10b5f252b6e4",
+ "size": 512,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_row_and_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_rows_and_filter]": [
+ {
+ "checksum": "575d68d01182feb492e61105c83210bb",
+ "size": 570,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_rows_and_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_rows_sorted_desc_multi_out]": [
+ {
+ "checksum": "070ff7ad337b2b945bcaaa215ed4f385",
+ "size": 956,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_produce-process_rows_sorted_desc_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_rows_sorted_multi_out]": [
+ {
+ "checksum": "0519fab63ad237d1e88446279614188f",
+ "size": 941,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_produce-process_rows_sorted_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_sorted_desc_multi_out]": [
+ {
+ "checksum": "32fd8190e5c11b7d88cd8ea72a78337d",
+ "size": 792,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_produce-process_sorted_desc_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_sorted_multi_out]": [
+ {
+ "checksum": "57b5d48027e942c7d4642a8acf86bdf3",
+ "size": 777,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_produce-process_sorted_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_streaming]": [
+ {
+ "checksum": "cd73f59ac7edbb2b6d21c1d409b9bb73",
+ "size": 516,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_streaming_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_streaming_count]": [
+ {
+ "checksum": "1f10298c753e88b6ffa6c98ceec85de5",
+ "size": 362,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_streaming_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_streaming_inline_bash]": [
+ {
+ "checksum": "622f00af8c3aafe4a5416fad5800b93f",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_streaming_inline_bash_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_trivial_as_struct]": [
+ {
+ "checksum": "001bea3b6ec1024e1fff940408abf507",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_trivial_as_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_assume]": [
+ {
+ "checksum": "ff91334250875f05c7733975edb0afe5",
+ "size": 371,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_assume_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_lambda]": [
+ {
+ "checksum": "7e623df9f88fdf2ad15bf326fa2b04b6",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_lambda_outstream]": [
+ {
+ "checksum": "a203192caf56d2c952f4e72dc1bffcb6",
+ "size": 393,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_lambda_outstream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_python]": [
+ {
+ "checksum": "eda254628c05cf99591a56d531c9edbb",
+ "size": 238,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_python_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_python_as_struct]": [
+ {
+ "checksum": "c262c4b2aa6119a8966c7ab9ac7b4bb0",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_python_as_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_python_stream]": [
+ {
+ "checksum": "cba4c2baa0cd224a11b7bae437d8d9f2",
+ "size": 488,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_python_stream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_udf]": [
+ {
+ "checksum": "9aa5649a95dc609704a1b13a29947040",
+ "size": 112,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_udf_rows]": [
+ {
+ "checksum": "20268014a12f5521572dbb06d9a1e173",
+ "size": 330,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_udf_rows_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_udf_validate]": [
+ {
+ "checksum": "1c784990e1d56f8b41b434a9aeb6c3db",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_udf_validate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-process_with_udf_validate_ignore_broken]": [
+ {
+ "checksum": "546558bd6ca2d74e7d82700a92a0ea0d",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-process_with_udf_validate_ignore_broken_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all]": [
+ {
+ "checksum": "078442bccdc553576b83193758f99ab4",
+ "size": 526,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all_expr]": [
+ {
+ "checksum": "72475b490b22553aceb8a52a7aa50676",
+ "size": 487,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all_list]": [
+ {
+ "checksum": "987c7cc9def03133be41b995259d1510",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all_list_stream]": [
+ {
+ "checksum": "2d90b4d090907079a33c8de41e57a333",
+ "size": 738,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_list_stream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all_multi_in]": [
+ {
+ "checksum": "41cce6c1485f664b37520976ce44e31c",
+ "size": 577,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_multi_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_all_opt]": [
+ {
+ "checksum": "ac5f8aa85be149297d8c4279e442657b",
+ "size": 536,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_all_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_by_struct]": [
+ {
+ "checksum": "db0812ad7e702df2736b20734731a601",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1781765/05968d1f61a10a7a02cfa6c6242226411f6c9b90/resource.tar.gz#test_sql_format.test_produce-reduce_by_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_lambda]": [
+ {
+ "checksum": "17880b03bcb92b4a331344bb9047e835",
+ "size": 382,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_lambda_list_mem]": [
+ {
+ "checksum": "60e9950943fa926ce42a3e64267fdcdb",
+ "size": 459,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_lambda_list_mem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_lambda_list_table]": [
+ {
+ "checksum": "cee562180b82d1e3f9fc0eb81aecfb30",
+ "size": 468,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_lambda_list_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_lambda_presort_twin]": [
+ {
+ "checksum": "3498c7d8f2bf773ce1ea3b1fa3ea4d33",
+ "size": 502,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_lambda_presort_twin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_lambda_presort_twin_list]": [
+ {
+ "checksum": "d5c5222c3f9b6534b5d01fe68153d820",
+ "size": 510,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_lambda_presort_twin_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in]": [
+ {
+ "checksum": "2bfe7e3519bdc4817903046844c519bf",
+ "size": 576,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_difftype]": [
+ {
+ "checksum": "1d970967cf6eb48fb90e70f2b2ffc2b7",
+ "size": 590,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_difftype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_difftype_assume]": [
+ {
+ "checksum": "d827a789725a100f6cdfeef3b09d19cf",
+ "size": 1685,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_difftype_assume_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_difftype_assume_keytuple]": [
+ {
+ "checksum": "641a7e3f83106d45f2b7b79412ea116c",
+ "size": 1759,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_difftype_assume_keytuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_keytuple]": [
+ {
+ "checksum": "795e6f5ef049f97390f47f1d7fe4f68f",
+ "size": 600,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_keytuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_keytuple_difftype]": [
+ {
+ "checksum": "0f725596524c425895530d8f575d0031",
+ "size": 615,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_keytuple_difftype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_presort]": [
+ {
+ "checksum": "7e1dd0adf07b644b845512e175252915",
+ "size": 625,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_ref]": [
+ {
+ "checksum": "3dee5187b1a289eea716210546248ffb",
+ "size": 735,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_ref_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_sampling]": [
+ {
+ "checksum": "a7a4f0da48f88c96d80a0199bdd588ac",
+ "size": 682,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_in_stage_and_flatmap]": [
+ {
+ "checksum": "2368b9251a115e3fab01bce0dd9ef692",
+ "size": 766,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_in_stage_and_flatmap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_multi_out]": [
+ {
+ "checksum": "41e99f64c904fbfbc31928913e1e716c",
+ "size": 586,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_multi_out_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_subfields]": [
+ {
+ "checksum": "6f4833d27f0dae19b0f249b628f911d5",
+ "size": 440,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_subfields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_typeinfo]": [
+ {
+ "checksum": "6c9378026709b2cde5c24df417731205",
+ "size": 807,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_typeinfo_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_assume]": [
+ {
+ "checksum": "f66b71a12b26ca4bc97619a3b43cbd5e",
+ "size": 378,
+ "uri": "https://{canondata_backend}/1936273/d3ce9e6be300ac95ccb90e8a7420184de361fe19/resource.tar.gz#test_sql_format.test_produce-reduce_with_assume_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_assume_in_subquery]": [
+ {
+ "checksum": "d957bb2140549aa1b7dbb27075ccc5e8",
+ "size": 499,
+ "uri": "https://{canondata_backend}/1600758/7bfd1ef457afc0ff28f5975f5deac4cbe6c60f7f/resource.tar.gz#test_sql_format.test_produce-reduce_with_assume_in_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_flat_lambda]": [
+ {
+ "checksum": "b3facdb462157bb42baad03832b75f3c",
+ "size": 232,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_flat_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_flat_python_stream]": [
+ {
+ "checksum": "71ff10637706d674f049a581428db044",
+ "size": 711,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_flat_python_stream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_presort_diff_order]": [
+ {
+ "checksum": "31a2d2bcb15a4896b3c21f0392374c63",
+ "size": 1508,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_presort_diff_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python]": [
+ {
+ "checksum": "48097b374ce4af5e6e66033be82d4e8d",
+ "size": 411,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_few_keys]": [
+ {
+ "checksum": "42e245b4ba6973f2a8db73c31b872057",
+ "size": 634,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_few_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_few_keys_stream]": [
+ {
+ "checksum": "69117a2e3d1ab5e8070590a1ec886a02",
+ "size": 641,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_few_keys_stream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_filter_and_having]": [
+ {
+ "checksum": "77f1af81dc3e255dc323ecce84b0a71b",
+ "size": 386,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_filter_and_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_having]": [
+ {
+ "checksum": "3272f7afcb315ed1cccbb1da2c0296b6",
+ "size": 357,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_presort]": [
+ {
+ "checksum": "f35586124aab90d09ec94c3a801a8724",
+ "size": 464,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_presort_stream]": [
+ {
+ "checksum": "930277fe3c8211797506671dd886fcc4",
+ "size": 441,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_presort_stream_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_row]": [
+ {
+ "checksum": "b5461e9c302ada3b2916af6c3f4a40d1",
+ "size": 483,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-reduce_with_python_row_repack]": [
+ {
+ "checksum": "14f7b4af3a44954da2be802ae9178ead",
+ "size": 555,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_produce-reduce_with_python_row_repack_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[produce-yql-10297]": [
+ {
+ "checksum": "fbc886d16f5f3417ca8b990756e9de4d",
+ "size": 784,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_produce-yql-10297_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_default]": [
+ {
+ "checksum": "32d82a9556cb649e6e972b0fe4486263",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_default_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_expr]": [
+ {
+ "checksum": "9cd33c94b319e73e0987c87f97d83445",
+ "size": 298,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_expr_subquery]": [
+ {
+ "checksum": "ef599b1d2a2125720471dc64e05940a3",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_expr_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_expr_udf]": [
+ {
+ "checksum": "b535eb29f5d5de815b64a4c87842e4a5",
+ "size": 197,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_expr_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_join_left]": [
+ {
+ "checksum": "2db82bdbb41674531a685c8215899869",
+ "size": 443,
+ "uri": "https://{canondata_backend}/1936842/906a26b8d586b6b4a02d278ca3ed68dc58da7c86/resource.tar.gz#test_sql_format.test_sampling-bind_join_left_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_join_right]": [
+ {
+ "checksum": "fc5340796afaf059d7d8cb097623d00b",
+ "size": 426,
+ "uri": "https://{canondata_backend}/1871002/e6108a0d5a9917a782a637f93bfb0022636fc256/resource.tar.gz#test_sql_format.test_sampling-bind_join_right_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_multiple_sample]": [
+ {
+ "checksum": "bd0c449794138db4f2ea3f58128d6cdb",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_multiple_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_small_rate]": [
+ {
+ "checksum": "2e94113fd129aba86ddc7fc5d94d829d",
+ "size": 211,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_small_rate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-bind_topsort]": [
+ {
+ "checksum": "db1c6be912718d3549a2e7f3a364bbce",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-bind_topsort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-direct_read]": [
+ {
+ "checksum": "f9ba4f32c518a94a9ce944eed5fe5b85",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-direct_read_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-insert]": [
+ {
+ "checksum": "f2aad93c7f2644a4517d8900b8101293",
+ "size": 220,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-insert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-join_left_sample]": [
+ {
+ "checksum": "15ebf84683f48dfa9fd01672b2aca619",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1925842/340260c2ab7e0feea7516504e76deb946bf565bd/resource.tar.gz#test_sql_format.test_sampling-join_left_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-join_right_sample]": [
+ {
+ "checksum": "65cd5b9e37ec247bf7c83fec66175532",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-join_right_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-map]": [
+ {
+ "checksum": "015e823237f5bbdd35a8c012a2e881fb",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-mapjoin_left_sample]": [
+ {
+ "checksum": "b5d87eeadb55f276495c2b10c8fc2cdc",
+ "size": 263,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-mapjoin_left_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-mapjoin_right_sample]": [
+ {
+ "checksum": "eca1539875debf9eb7c5a86741cac350",
+ "size": 285,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-mapjoin_right_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-orderedjoin_left_sample]": [
+ {
+ "checksum": "e1ce458df725bf5b6cb5172905df2e5e",
+ "size": 314,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-orderedjoin_left_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-orderedjoin_right_sample]": [
+ {
+ "checksum": "7aa296ab0ed1bb54f14a0ebcf742b024",
+ "size": 314,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-orderedjoin_right_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-read]": [
+ {
+ "checksum": "7068b1321f2a61fdad15236b78aeabff",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-read_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-reduce]": [
+ {
+ "checksum": "bdf320f1aee7870a637f49b5df92c473",
+ "size": 473,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-reduce_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-reduce_with_presort]": [
+ {
+ "checksum": "fecf36f038948c19d51a692617e5f5c6",
+ "size": 507,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-reduce_with_presort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-sample]": [
+ {
+ "checksum": "3578acca6bac11be2d006571438fabde",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1777230/e0379b273ca9ca9bd5c14b7b88db1c72326acceb/resource.tar.gz#test_sql_format.test_sampling-sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-sort]": [
+ {
+ "checksum": "517d416d6aead392dd8b5d98afc8fbbb",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_default]": [
+ {
+ "checksum": "1eda475d123aa57c6d91e7cd4e60dcbb",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_default_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_expr]": [
+ {
+ "checksum": "f2945e597fbb6e3edab8bcf24f53a7c1",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_filter]": [
+ {
+ "checksum": "ab29b5b5c8f81e4a79c4ba62d11cd8e8",
+ "size": 247,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_limit]": [
+ {
+ "checksum": "941c82f2e5e29daa602e945a15a19670",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_mapjoin]": [
+ {
+ "checksum": "97de3c8b5a9a29ea19f92897b67eb7d7",
+ "size": 385,
+ "uri": "https://{canondata_backend}/1942100/2322f4af067a79b60de35f53c7aa494b5c3bd25b/resource.tar.gz#test_sql_format.test_sampling-subquery_mapjoin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_multiple_sample]": [
+ {
+ "checksum": "b4cf2a3441151a2fe19a88770bfddee7",
+ "size": 240,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_multiple_sample_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-subquery_sort]": [
+ {
+ "checksum": "972e8f8b3bf1c9a31f9b9570e0be5a0d",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-subquery_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-system_sampling]": [
+ {
+ "checksum": "e4a6c536a365c321776f7ee77172001c",
+ "size": 335,
+ "uri": "https://{canondata_backend}/1775319/aea965d51c26d8dea65ed5884b04b18325ac81d2/resource.tar.gz#test_sql_format.test_sampling-system_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-table_content]": [
+ {
+ "checksum": "5c409c1beef688a36d1da5a0904f73de",
+ "size": 219,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-table_content_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-take_with_sampling]": [
+ {
+ "checksum": "c0728c76352c6abc5e2ef67b18c69546",
+ "size": 173,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-take_with_sampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-topsort]": [
+ {
+ "checksum": "93794fd2a8a8850e238e90fe74719fb9",
+ "size": 190,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-topsort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-yql-14664_deps]": [
+ {
+ "checksum": "639bfad7ce4a640111aea0ef5e4f55a9",
+ "size": 283,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-yql-14664_deps_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[sampling-zero_percentage]": [
+ {
+ "checksum": "adf262463686c569545380a5911cd8c8",
+ "size": 104,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_sampling-zero_percentage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-append_to_desc]": [
+ {
+ "checksum": "573bca2bc48d1c34e9a01fd8755ba599",
+ "size": 118,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-append_to_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-append_to_desc_with_remap]": [
+ {
+ "checksum": "8d1b54bee177cfd6f0ec36c4b8bebf50",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-append_to_desc_with_remap_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-concat]": [
+ {
+ "checksum": "c3c379320f728893d612bde1c012b86c",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-copy]": [
+ {
+ "checksum": "e54649ce83072324822dff609155e5b3",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-copy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-def_values]": [
+ {
+ "checksum": "7a776756388c3f7c27919e7d61763692",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-def_values_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-def_values_job]": [
+ {
+ "checksum": "02e26244808420a69236f9f078bbcedc",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-def_values_job_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-diffrerent_schemas]": [
+ {
+ "checksum": "177730b0f9e35a87d49f6b15fdb3b8ae",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-diffrerent_schemas_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-fake_column]": [
+ {
+ "checksum": "b07b4c338eb85596728e7c0c5a67cdda",
+ "size": 162,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-fake_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-insert]": [
+ {
+ "checksum": "922f824c320ea060d10ffea67b870959",
+ "size": 140,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-insert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-insert_sorted]": [
+ {
+ "checksum": "baac139f168409a5e37f848e923f1317",
+ "size": 156,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-insert_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-limit_directread]": [
+ {
+ "checksum": "a284d3dc3e23ad3698f6b7c11e101232",
+ "size": 89,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-limit_directread_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-limit_simple]": [
+ {
+ "checksum": "c14ac39ad5166f5c38eca9d69bc413d8",
+ "size": 45,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-limit_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-other]": [
+ {
+ "checksum": "f4db53092bd46c310413c37239c1426f",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-other_job]": [
+ {
+ "checksum": "dba4ac4b11ce615cfb54dd392a63b16e",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-other_job_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-patchtype]": [
+ {
+ "checksum": "aea35d35051ba87db2add96db67dc729",
+ "size": 476,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-patchtype_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-read_schema_change_other]": [
+ {
+ "checksum": "19563cb8172e8f1ad4f1314790e2e1d1",
+ "size": 68,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-read_schema_change_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-read_schema_other]": [
+ {
+ "checksum": "51b2b84176de2fa5cf5049042567b596",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-read_schema_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-remap_desc]": [
+ {
+ "checksum": "bbcfb032e4fec73ece476f70dc16bac4",
+ "size": 109,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-remap_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-row_spec_with_default_values]": [
+ {
+ "checksum": "db465e1c2c49c09b9b3928e91a68a8b3",
+ "size": 31,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-row_spec_with_default_values_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all]": [
+ {
+ "checksum": "db465e1c2c49c09b9b3928e91a68a8b3",
+ "size": 31,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_forceinferschema]": [
+ {
+ "checksum": "140ea2f24eecc614c6a1d8131aff0e4f",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_forceinferschema_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema2]": [
+ {
+ "checksum": "527be95e750be895532a6849c3ff2a13",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema]": [
+ {
+ "checksum": "9d48972fe570874a1f5eba1b3ea8d5b7",
+ "size": 52,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema_limit]": [
+ {
+ "checksum": "b2a03a53eca1cd2ab07580e8899bc54f",
+ "size": 60,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema_op]": [
+ {
+ "checksum": "b96ec96059b84b8ee69b5e914f4a6d5d",
+ "size": 144,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema_op_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema_op_custom_tmp]": [
+ {
+ "checksum": "4dcf827d3061c7866dd26f56a57e62ef",
+ "size": 176,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema_op_custom_tmp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_all_inferschema_range]": [
+ {
+ "checksum": "b499170ade41db7081ae169ff0404ed5",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_all_inferschema_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_field]": [
+ {
+ "checksum": "d7b6c681fdf4d07b21ab12b1ae112f90",
+ "size": 31,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_field_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_fields_inferschema]": [
+ {
+ "checksum": "aa9d074d7c1ab6ca123ad98aab7b44b3",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_fields_inferschema_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_operate_with_columns_simple]": [
+ {
+ "checksum": "e4546c6e7343cf02390cfbbfd538b703",
+ "size": 39,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_operate_with_columns_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_reordered]": [
+ {
+ "checksum": "c5ab0939dd4e3fac4379b85bdd552ff2",
+ "size": 66,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_reordered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_simple]": [
+ {
+ "checksum": "b9f9635d2b2aa3672c71cd24e51b8756",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_with_map]": [
+ {
+ "checksum": "52c5375df853af36f826807ba5dfe4c8",
+ "size": 49,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_with_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-select_yamr_fields]": [
+ {
+ "checksum": "72f1423a89316f123543d28b4a79b169",
+ "size": 45,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-select_yamr_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-skip_complex_type2]": [
+ {
+ "checksum": "c9806bffb02b094b62c42d3ecf88132a",
+ "size": 213,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-skip_complex_type2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-skip_complex_type]": [
+ {
+ "checksum": "c9806bffb02b094b62c42d3ecf88132a",
+ "size": 213,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-skip_complex_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_append]": [
+ {
+ "checksum": "0cf9e17d2b8984b165498b532250f832",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_append_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_bind]": [
+ {
+ "checksum": "fc5acd860c31c209ee30de13481a5e7d",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_bind_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_directread]": [
+ {
+ "checksum": "0f5b3d787d58cfd4793a8ab0cef78f03",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_directread_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_empty_table_ranges]": [
+ {
+ "checksum": "ca0ac776abf12dd00efa40d088f09ceb",
+ "size": 368,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_empty_table_ranges_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_existing_column]": [
+ {
+ "checksum": "98ec39d375fbc2a192fae94a3f16eac0",
+ "size": 96,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_existing_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_missing_column]": [
+ {
+ "checksum": "fa5a0c0937036cf99c11fb8280b16e00",
+ "size": 100,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_missing_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_mix1]": [
+ {
+ "checksum": "96a1efad8ffca2a133e7b4c06ece0083",
+ "size": 137,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_mix1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_mix2]": [
+ {
+ "checksum": "3edd0e73acd54e846a0e429943b439c6",
+ "size": 137,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_mix2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_mix3]": [
+ {
+ "checksum": "53cef64d861786f338c121f8fae80f66",
+ "size": 153,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_mix3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_no_infer]": [
+ {
+ "checksum": "22bb580882e6f647dc2431ab193cacc9",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_no_infer_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_override]": [
+ {
+ "checksum": "76e7669be992272b06b01f71844448ef",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_override_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_patch_columns]": [
+ {
+ "checksum": "cd3e543271d2151fbcb1fc0b4705d68a",
+ "size": 192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_patch_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-user_schema_with_sort]": [
+ {
+ "checksum": "58e26b44c1fbc89a3740f63b5fd20b2c",
+ "size": 348,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-user_schema_with_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[schema-yamred_dsv_select_from_dict]": [
+ {
+ "checksum": "fd17c07ed814f3771af0320516c1d47c",
+ "size": 197,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_schema-yamred_dsv_select_from_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-anon_clash]": [
+ {
+ "checksum": "7a765b0d5b17822fa9d99f95b5f56a1a",
+ "size": 99,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-anon_clash_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-append_to_value]": [
+ {
+ "checksum": "c2984a7a6e2303b48d98e591010b3a08",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-append_to_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-append_to_value_1000]": [
+ {
+ "checksum": "72a50766cd452dd9cb6accffddf4b899",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-append_to_value_1000_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-autoextract_source_value]": [
+ {
+ "checksum": "1ee4f29991a42758532c35d43fa26d9e",
+ "size": 316,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-autoextract_source_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-autogen_columns_conflict]": [
+ {
+ "checksum": "9d9360ae8159b4a7edea8f4dfba45969",
+ "size": 531,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-autogen_columns_conflict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-backtick_with_escapes]": [
+ {
+ "checksum": "284ad0dca74d21375f5e61a79a5bc8ff",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-backtick_with_escapes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-bin_ops_long_concat]": [
+ {
+ "checksum": "d87f43e1d184ce615925e0b6ebd0b1a0",
+ "size": 597,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-bin_ops_long_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-bit_ops]": [
+ {
+ "checksum": "34d70f1db875660f1a8fb9923b0faffe",
+ "size": 345,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_select-bit_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-boolean_where]": [
+ {
+ "checksum": "3b7482e49d2a20113db1242ea59a6007",
+ "size": 83,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-boolean_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-braces]": [
+ {
+ "checksum": "44787ad3bc78d8647cdfb0f667c149e9",
+ "size": 76,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-braces_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-calculated_values]": [
+ {
+ "checksum": "3d12fbe061a1f7aad032f79d17286cfd",
+ "size": 210,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-calculated_values_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-cast_double_to_uint32]": [
+ {
+ "checksum": "9b6d592e97357aef80b739b48bef09a1",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-cast_double_to_uint32_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-column_labels]": [
+ {
+ "checksum": "ee4c5ad9ccafba301bcf40a05ee09d38",
+ "size": 54,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-column_labels_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-complex_filter_with_order]": [
+ {
+ "checksum": "17816e01491d9ae63a95a35ee8275e00",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-complex_filter_with_order_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-const_subrequest_and_select_by_all]": [
+ {
+ "checksum": "26340f2ec1a40d02b89ce25ea7cc7f08",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-const_subrequest_and_select_by_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-core_func_test_bit]": [
+ {
+ "checksum": "e1c9a83b31f6c57abf92d2d2ddee8a8b",
+ "size": 88,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-core_func_test_bit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-corr_name_in_select]": [
+ {
+ "checksum": "774494d86725927114ae945f42da4df4",
+ "size": 138,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-corr_name_in_select_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-corr_name_in_select_seq]": [
+ {
+ "checksum": "49b0466baa3328ad1836ffabf9b63a5a",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-corr_name_in_select_seq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-create_structures]": [
+ {
+ "checksum": "4b8bc961c4a69cc967281e8d4dceaa39",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-create_structures_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-create_tuples]": [
+ {
+ "checksum": "24d798b910e2bd2b2af9611c0eb09bb9",
+ "size": 80,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-create_tuples_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-data_instance]": [
+ {
+ "checksum": "628df28ae1a49ac9b844f471f1cf5ff5",
+ "size": 1613,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-data_instance_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-deep_udf_call]": [
+ {
+ "checksum": "cb5e19955c5e1e8d66934af2b517bd2f",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-deep_udf_call_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dict_lookup]": [
+ {
+ "checksum": "e47688966524500b19d3a2e4bc2e3c87",
+ "size": 382,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dict_lookup_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dict_lookup_by_key]": [
+ {
+ "checksum": "84d20edd1f8bb74d99dc6787eaab1778",
+ "size": 279,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dict_lookup_by_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dict_lookup_by_key_with_def]": [
+ {
+ "checksum": "39911b2c6e5db7d98fed7d17d9d4885f",
+ "size": 292,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dict_lookup_by_key_with_def_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dict_lookup_column_names]": [
+ {
+ "checksum": "c28a3ef2653b66e6c8bb26f44d4299a5",
+ "size": 294,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dict_lookup_column_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dict_with_few_keys]": [
+ {
+ "checksum": "8dd809271836ad447863c4671ccd3e5e",
+ "size": 423,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dict_with_few_keys_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-digits]": [
+ {
+ "checksum": "0fa6671902724d26313eca3b2c9d2222",
+ "size": 710,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-digits_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-discard]": [
+ {
+ "checksum": "ff9a8b4431c03b36587f6b0fe4730182",
+ "size": 565,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-discard_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dot_in_alias]": [
+ {
+ "checksum": "c133af7f1baf1eb3f836da17d8c08ced",
+ "size": 200,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dot_in_alias_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-dot_name_subrequest]": [
+ {
+ "checksum": "2b1510cebe21f4e8a3090ea52e03de31",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-dot_name_subrequest_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-double_at_ids]": [
+ {
+ "checksum": "060dae7b14d87b89096b246248829891",
+ "size": 77,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-double_at_ids_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-exists_false]": [
+ {
+ "checksum": "67ae3c24c28e6e6f73eecec56f0b4973",
+ "size": 125,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-exists_false_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-exists_true]": [
+ {
+ "checksum": "eca66e44b8c8e39fc7b2cc1e1951303d",
+ "size": 78,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-exists_true_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-extend_and_take]": [
+ {
+ "checksum": "104c53d04164756eadc99dd641256231",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-extend_and_take_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-from_in_front]": [
+ {
+ "checksum": "a035b58d502380211a449a83de97dde1",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-from_in_front_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-from_in_front_sub]": [
+ {
+ "checksum": "c8ea8c3ef7dfe17c3eec4c753197d1ea",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-from_in_front_sub_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-hits_count]": [
+ {
+ "checksum": "b96b7f593261f8731099e042fc06d417",
+ "size": 605,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_select-hits_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-host_count]": [
+ {
+ "checksum": "c8a94e1d5db2d2704860f091955542ce",
+ "size": 607,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_select-host_count_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-id_xor]": [
+ {
+ "checksum": "b24d8edd6792f5bbaa39ddf345671f8f",
+ "size": 57,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-id_xor_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-if]": [
+ {
+ "checksum": "83d41e0a94895fcd4fd94f10ef205a43",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-if_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-literal_bool]": [
+ {
+ "checksum": "2f85dc295ffc9c3c8b298f15d246d84c",
+ "size": 81,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-literal_bool_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-literal_negative]": [
+ {
+ "checksum": "22ace94efd25f74e466c7086ed1fa901",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-literal_negative_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-logical_ops]": [
+ {
+ "checksum": "962ac5152348cc69c39ae9bbc368b212",
+ "size": 213,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-logical_ops_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-match_clause]": [
+ {
+ "checksum": "578a160463d65a60b1d7708b9dccd504",
+ "size": 123,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-match_clause_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-missing_with_nonpersist]": [
+ {
+ "checksum": "1d8c24c23bc7e862e2f270164cb82e6f",
+ "size": 189,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-missing_with_nonpersist_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-multi_source_issue]": [
+ {
+ "checksum": "366f638d39fbe7f59f119b8e50ad74b6",
+ "size": 380,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-multi_source_issue_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-null_check]": [
+ {
+ "checksum": "f2cb0f0a43f5c5501229305d2496759d",
+ "size": 205,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-null_check_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-one_labeled_column]": [
+ {
+ "checksum": "ec182c857aec2d8c8ecbc228b0407b96",
+ "size": 40,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-one_labeled_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-one_unlabeled_column]": [
+ {
+ "checksum": "72c1a1c531e3216eb6925e18228d072c",
+ "size": 33,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-one_unlabeled_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-opt_list_access]": [
+ {
+ "checksum": "2507fc6890c888f5c708e8b63c29f698",
+ "size": 302,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-opt_list_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-optional_as_warn]": [
+ {
+ "checksum": "d794b5cdd5174d9c754c28a761ba0fe4",
+ "size": 250,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-optional_as_warn_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-optional_in_job]": [
+ {
+ "checksum": "b8b4e3b6132e31173a7d6369d6893855",
+ "size": 1621,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-optional_in_job_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-optional_pull]": [
+ {
+ "checksum": "7f5d9f731ee50238c3e4740bec5292b6",
+ "size": 1389,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-optional_pull_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-qualified_all_and_group_by]": [
+ {
+ "checksum": "38d3f367424b8a757b6f0a50f59ae074",
+ "size": 367,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-qualified_all_and_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-quoted_ids]": [
+ {
+ "checksum": "97a14fb0e5b80ad9203c9539348b785f",
+ "size": 90,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-quoted_ids_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-quoted_ids_with_escapes]": [
+ {
+ "checksum": "a8286dffb8d34c862221388b6e98e325",
+ "size": 73,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-quoted_ids_with_escapes_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-refselect]": [
+ {
+ "checksum": "bed0935f611aa7ed26edc032f95540c6",
+ "size": 114,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-refselect_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-result_label]": [
+ {
+ "checksum": "60b5ccf7e17faaeda93bd9f409b5c1f2",
+ "size": 53,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-result_label_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-result_rows_limit]": [
+ {
+ "checksum": "86a8670975d61b2d7c7ddd910b513ead",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-result_rows_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-result_size_limit]": [
+ {
+ "checksum": "de5593d84e56e56dded21a86d17cef4d",
+ "size": 213,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-result_size_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-result_size_limit_with_fill]": [
+ {
+ "checksum": "d5c8eb51cdc9fac152e78f1f7380e031",
+ "size": 251,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-result_size_limit_with_fill_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-reuse_named_node]": [
+ {
+ "checksum": "bc02d77b4b3db0e2c0f45148c23b75fc",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-reuse_named_node_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-sampleselect]": [
+ {
+ "checksum": "8554fd295d3d1f0221e222fa41600062",
+ "size": 123,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-sampleselect_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-scalar_subquery]": [
+ {
+ "checksum": "40458901cd181f403ef07c8a4b7a170e",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-scalar_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-scalar_subquery_with_star]": [
+ {
+ "checksum": "adfcccb7e35d4b423a61984a9d218e2d",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-scalar_subquery_with_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all]": [
+ {
+ "checksum": "db465e1c2c49c09b9b3928e91a68a8b3",
+ "size": 31,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all_filtered]": [
+ {
+ "checksum": "c5f7e7aa7153c16d53a0bb42c68175f7",
+ "size": 51,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_filtered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all_from_concat]": [
+ {
+ "checksum": "24da894970d06631a855c58db1e29e71",
+ "size": 71,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_from_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all_from_concat_anon]": [
+ {
+ "checksum": "f387cee4364eb591ef3aa5b2bc35fd58",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_from_concat_anon_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all_group_by_column]": [
+ {
+ "checksum": "a71d0215d09d3bb577a5e025410ab105",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_group_by_column_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_all_ordered]": [
+ {
+ "checksum": "3cacbda0711ffcc361ba39d701548a4a",
+ "size": 50,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_all_ordered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-select_concrete_detailed_columns]": [
+ {
+ "checksum": "e6456a1c6e69a99786a5389b5062edca",
+ "size": 58,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-select_concrete_detailed_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-shift_columns]": [
+ {
+ "checksum": "d2534c5d191247965c2f39bacf2a767b",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-shift_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-simple_struct_field_access]": [
+ {
+ "checksum": "12b64c1995fed755c7ffca4bfe97cd1a",
+ "size": 88,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-simple_struct_field_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-struct_access_without_table_name]": [
+ {
+ "checksum": "fa4b3a45c70f2d3b22d9ffacd4eac5cb",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-struct_access_without_table_name_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-struct_members]": [
+ {
+ "checksum": "640f70bcb1245012f74cf4e1f0ff5441",
+ "size": 261,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-struct_members_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-substring]": [
+ {
+ "checksum": "ec6179614d2b7524624adcd1afb61ae5",
+ "size": 136,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-substring_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-substring_v1]": [
+ {
+ "checksum": "a08c58f3b3d4a0668577e61ad56c9964",
+ "size": 197,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-substring_v1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-sum_to_string]": [
+ {
+ "checksum": "7d685fdd7142f718de4ec6360919c453",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-sum_to_string_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-swap_columns]": [
+ {
+ "checksum": "53beebbcdca9e9e2c1b002c147a04dd0",
+ "size": 75,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-swap_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-table_content_from_double_opt]": [
+ {
+ "checksum": "50dc7259d8ef8693f599160345b44969",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-table_content_from_double_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-table_content_from_sort_desc]": [
+ {
+ "checksum": "f2b3a413a33bbf2e8e9449052b6ff540",
+ "size": 238,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-table_content_from_sort_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-table_content_with_tmp_folder]": [
+ {
+ "checksum": "43312ec44990b33a058d429b3786daaf",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-table_content_with_tmp_folder_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-table_funcs_spec]": [
+ {
+ "checksum": "79f51fc50be71601257df9e24f47d7e8",
+ "size": 312,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-table_funcs_spec_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-tablename_with_table_row]": [
+ {
+ "checksum": "bb63a8c3a599606af2f8555685455912",
+ "size": 126,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-tablename_with_table_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-tablepathprefix]": [
+ {
+ "checksum": "e373892ac2bfed20e242898c4617dfbf",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-tablepathprefix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-to_dict]": [
+ {
+ "checksum": "9d8ff2209ebba1d433df10952ebd3f8f",
+ "size": 402,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-to_dict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-trivial_between]": [
+ {
+ "checksum": "7009020bb522f6cd8a534b3d059e747e",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-trivial_between_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-trivial_group_by]": [
+ {
+ "checksum": "48d32b37a86441f7e73bac37a4b5f907",
+ "size": 119,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-trivial_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-trivial_having]": [
+ {
+ "checksum": "d746dceac9871d83500a4a46ca4b14f1",
+ "size": 122,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-trivial_having_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-trivial_order_by]": [
+ {
+ "checksum": "d88f74f83ca7d93b861eefb2f44669c6",
+ "size": 73,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-trivial_order_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-trivial_where]": [
+ {
+ "checksum": "68fbb1c8ca9cf4707efc05a8825db043",
+ "size": 75,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-trivial_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-two_select_without_semi]": [
+ {
+ "checksum": "28143233eacb37cc878177cbc0e9ab55",
+ "size": 52,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-two_select_without_semi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-two_selects_with_diff_fields]": [
+ {
+ "checksum": "bf1450322621326db4248df2f2c0cff5",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-two_selects_with_diff_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-type_assert]": [
+ {
+ "checksum": "60fc830e3455a3d23a17bc2c536486fc",
+ "size": 508,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-type_assert_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-unary_op_interval]": [
+ {
+ "checksum": "84777eaa822ee2b05819d7369a1002a6",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-unary_op_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-uncorrelated_subqueries]": [
+ {
+ "checksum": "5a13cbd27f1516c61d3102ce88f6d797",
+ "size": 313,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-uncorrelated_subqueries_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-unlabeled]": [
+ {
+ "checksum": "309a2258613683c44819c9ae3c3196a6",
+ "size": 79,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-unlabeled_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-unlabeled_1000]": [
+ {
+ "checksum": "5639c213a0e1df2b5b529f1595dbeecd",
+ "size": 160,
+ "uri": "https://{canondata_backend}/1942415/a054ba77d58b57e49908ceed5fa1b41dac7c87d8/resource.tar.gz#test_sql_format.test_select-unlabeled_1000_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-use_cluster]": [
+ {
+ "checksum": "1f45aedc29390ab59c77dfb4f6069e9e",
+ "size": 39,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-use_cluster_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-values]": [
+ {
+ "checksum": "4259d21c7fec683d17da773dcff6201d",
+ "size": 410,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-values_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-where_cast]": [
+ {
+ "checksum": "9f2843a9f53fac3e044eeafb4c6ea936",
+ "size": 64,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-where_cast_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-where_in]": [
+ {
+ "checksum": "08c4bf8651c7529044442e28b8fda841",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_select-where_in_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-where_not_null]": [
+ {
+ "checksum": "f4380637b4568c58449ef4aa70af87f8",
+ "size": 51,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-where_not_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[select-where_with_lambda]": [
+ {
+ "checksum": "3f85a7d57e3ed884cae00323da02c1bd",
+ "size": 152,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_select-where_with_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-action_shared_subquery_expr_after_commit]": [
+ {
+ "checksum": "15a1016470bbc53be7db1d547289942b",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-action_shared_subquery_expr_after_commit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-shared_named_expr]": [
+ {
+ "checksum": "2b11f1cbb4f9bb058a8f14b2935df02d",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-shared_named_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-shared_subquery_expr]": [
+ {
+ "checksum": "384e919093198969e29b583561bf3d70",
+ "size": 90,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-shared_subquery_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-shared_subquery_expr_after_commit]": [
+ {
+ "checksum": "be8fbad25a25ff12749cb9ad82aae827",
+ "size": 155,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-shared_subquery_expr_after_commit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-simple1]": [
+ {
+ "checksum": "6d9735bc669cab1c321f1a4eceae1233",
+ "size": 31,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-simple1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-simple2]": [
+ {
+ "checksum": "e000f93ebc12dfcb3a3d7fb507cf1c1f",
+ "size": 46,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-simple2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[seq_mode-subquery_shared_subquery]": [
+ {
+ "checksum": "996f123bf7f32746307fd8b87171ecef",
+ "size": 158,
+ "uri": "https://{canondata_backend}/1937150/9fe5ba60fa831a86131988fc8e7a719c278ab64b/resource.tar.gz#test_sql_format.test_seq_mode-subquery_shared_subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-no_simple_columns_tablerow]": [
+ {
+ "checksum": "cf7a29e4730148a324a5073919a4dadd",
+ "size": 524,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-no_simple_columns_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_base]": [
+ {
+ "checksum": "b1d263df2ac34d2d367b1922e3859787",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_base_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_base_fail]": [
+ {
+ "checksum": "f2f636650ab4ac5b4ad8d317ea3b08ae",
+ "size": 297,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_base_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_all]": [
+ {
+ "checksum": "310157c68534c9f5bbe89cff3849e6dd",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_all_1]": [
+ {
+ "checksum": "121672be7a598a5b56bb1ca035e8f35b",
+ "size": 327,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_all_1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_all_2]": [
+ {
+ "checksum": "ac996b15e1dd60127fc46800df62d4a4",
+ "size": 320,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_all_2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_bug8923]": [
+ {
+ "checksum": "956cb91718961bdf189a9397e92e1fa7",
+ "size": 462,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_bug8923_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_qualified_all_disable]": [
+ {
+ "checksum": "d7d4c44ba8415e79677dcf4933ca0d5d",
+ "size": 331,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_qualified_all_disable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_qualified_all_enable]": [
+ {
+ "checksum": "d361610a6074ed06e875fdf77c7acc3d",
+ "size": 324,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_qualified_all_enable_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_without_1]": [
+ {
+ "checksum": "20d384b90d629b4873dd99aa0523bb42",
+ "size": 1020,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_without_1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_without_2]": [
+ {
+ "checksum": "634dc753433220d64060f9bf21438217",
+ "size": 1013,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_without_2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_without_left_semi_1]": [
+ {
+ "checksum": "5ef207cc37633319d570cf0c165110cc",
+ "size": 384,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_without_left_semi_1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_coalesce_without_left_semi_2]": [
+ {
+ "checksum": "0f42194bffd4ff00897c3b5e497ca013",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_coalesce_without_left_semi_2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_fail]": [
+ {
+ "checksum": "bbd30902c3f4730adc194f29536bec46",
+ "size": 402,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_qualified]": [
+ {
+ "checksum": "dd706c5619944a5fd99c4cc11c7035a7",
+ "size": 363,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_qualified_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_subreq_all_key_without]": [
+ {
+ "checksum": "a0c1f139bee7df56b2a9eb0690cb34f0",
+ "size": 379,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_subreq_all_key_without_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_subreq_same_key]": [
+ {
+ "checksum": "4e28f10f9bbbe7fba135e381af900667",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_subreq_same_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_subreq_same_key_by_all]": [
+ {
+ "checksum": "3ddbfc702ee89cfa7fd991d529ded9d5",
+ "size": 328,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_subreq_same_key_by_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_subreq_same_key_without]": [
+ {
+ "checksum": "105df6e6391e755641e64d2d96f4574f",
+ "size": 406,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_subreq_same_key_without_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_without_resolve_dublicates]": [
+ {
+ "checksum": "747399d2a68fed2b07a71f6354b299a0",
+ "size": 450,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_without_resolve_dublicates_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_join_without_resolve_dublicates_mult]": [
+ {
+ "checksum": "f9a90d66d95053a3dce69cc5b3f18b95",
+ "size": 558,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_join_without_resolve_dublicates_mult_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_qualified_all_and_group_by]": [
+ {
+ "checksum": "574905b8e782d9006989d690966cb620",
+ "size": 331,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_qualified_all_and_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_subreq]": [
+ {
+ "checksum": "25b41ad5a5f3547a9cfef4facd4b261b",
+ "size": 236,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_subreq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_subreq_all]": [
+ {
+ "checksum": "04373399aea37a7e98c901434aba2444",
+ "size": 256,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_subreq_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_tablerow]": [
+ {
+ "checksum": "4adbd18926fb06a102646ee099529848",
+ "size": 517,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[simple_columns-simple_columns_union_all_qualified_star]": [
+ {
+ "checksum": "0d2bc619cf983cdcac07387a9b20f5bf",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_simple_columns-simple_columns_union_all_qualified_star_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-BadDownsamplingAggregation]": [
+ {
+ "checksum": "dbbaa96830e404bf63965b22829c09e5",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-BadDownsamplingAggregation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-BadDownsamplingDisabled]": [
+ {
+ "checksum": "795bb32d9417f71478b7ec70c6e7e820",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-BadDownsamplingDisabled_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-BadDownsamplingFill]": [
+ {
+ "checksum": "f3f44c044ed971f2e5bfa8a83d3754bc",
+ "size": 161,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-BadDownsamplingFill_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-BadDownsamplingInterval]": [
+ {
+ "checksum": "08f7cf41c2404d74c4cc2c39208f270d",
+ "size": 170,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-BadDownsamplingInterval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-Basic]": [
+ {
+ "checksum": "999941931538e981e6868785f407699e",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-Basic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-BrokenJsonResponse]": [
+ {
+ "checksum": "2ea7d86f378d1d0acea749729505b8e9",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1599023/688233977db70f339a250f6f25033e36d5b327fb/resource.tar.gz#test_sql_format.test_solomon-BrokenJsonResponse_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-DownsamplingValidSettings]": [
+ {
+ "checksum": "1741d8968029a8b3c23885c5826009f3",
+ "size": 497,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-DownsamplingValidSettings_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-Downsampling]": [
+ {
+ "checksum": "6e216bc7dbf6e716c0f67bc36e199c65",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-Downsampling_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-InvalidProject]": [
+ {
+ "checksum": "d9dc0179f957667ff446aae66459f359",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1599023/688233977db70f339a250f6f25033e36d5b327fb/resource.tar.gz#test_sql_format.test_solomon-InvalidProject_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-LabelColumns]": [
+ {
+ "checksum": "5d2ff6d76dac9a34c9ca42f73fedbc40",
+ "size": 219,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-LabelColumns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-Subquery]": [
+ {
+ "checksum": "011dae5a5c7dff0acaff130860bb39c5",
+ "size": 354,
+ "uri": "https://{canondata_backend}/1925842/4cd572fb4c53ca13dd4b61884e96490799969da0/resource.tar.gz#test_sql_format.test_solomon-Subquery_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[solomon-UnknownSetting]": [
+ {
+ "checksum": "19d67960961badcaf4cb43956c2b4abd",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/2acf5b55cb208565b2cb35901ac765fc11dca857/resource.tar.gz#test_sql_format.test_solomon-UnknownSetting_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[stream_lookup_join-lookup_join]": [
+ {
+ "checksum": "847138b770815f5eaa57829f027f4772",
+ "size": 254,
+ "uri": "https://{canondata_backend}/1781765/65ca10289c1bb04a630a832c0a648fc9d7bbfdfd/resource.tar.gz#test_sql_format.test_stream_lookup_join-lookup_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[stream_lookup_join-lookup_join_narrow]": [
+ {
+ "checksum": "dd2c92173b64c978281b6b6906cb0415",
+ "size": 255,
+ "uri": "https://{canondata_backend}/1781765/65ca10289c1bb04a630a832c0a648fc9d7bbfdfd/resource.tar.gz#test_sql_format.test_stream_lookup_join-lookup_join_narrow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-concat_empty_sorted_with_key_diff]": [
+ {
+ "checksum": "62aab437d494bcb974dbc1b389da0ad5",
+ "size": 54,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-concat_empty_sorted_with_key_diff_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-concat_sorted_max_sorted_tables]": [
+ {
+ "checksum": "039b2e75037a1e959b20674d8454d062",
+ "size": 258,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-concat_sorted_max_sorted_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-concat_sorted_max_tables]": [
+ {
+ "checksum": "c36a69b7dda1202c862d2a5e5eade85f",
+ "size": 241,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-concat_sorted_max_tables_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-concat_sorted_with_key_diff]": [
+ {
+ "checksum": "d28cd0dda7fb67736e0d4bc63aecda7f",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-concat_sorted_with_key_diff_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-concat_with_view]": [
+ {
+ "checksum": "547949d75b7e669bc360c46f187063c9",
+ "size": 117,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-concat_with_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-each_with_non_existing]": [
+ {
+ "checksum": "a435a4ac251f647e6efd230bfc9a2384",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-each_with_non_existing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-limit_with_table_path_over_sorted_range]": [
+ {
+ "checksum": "4547d6df36ebeb9e27b0e14cd71b1eca",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-limit_with_table_path_over_sorted_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-merge_non_strict]": [
+ {
+ "checksum": "4b1c45f1b006f2bb5cd6bfcdd520edb7",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-merge_non_strict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_over_desc]": [
+ {
+ "checksum": "583757d0b9a28b5d0913e542271735be",
+ "size": 222,
+ "uri": "https://{canondata_backend}/1937429/5822551fab6aa1fdd3a2a8f46252b4164f4be75d/resource.tar.gz#test_sql_format.test_table_range-range_over_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_over_filter]": [
+ {
+ "checksum": "c86d9469dd8955d1751b4851e666c386",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_over_filter_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_over_filter_udf]": [
+ {
+ "checksum": "0559c23490724c41de8124d27c9d5080",
+ "size": 401,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_over_filter_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_over_like]": [
+ {
+ "checksum": "e65c5955542e3dab97f32e32e27204a5",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_over_like_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_over_regexp]": [
+ {
+ "checksum": "bb2a998b04f1cf7f1b6ee02270f21195",
+ "size": 175,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_over_regexp_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_slash]": [
+ {
+ "checksum": "d654515e7e05d947c0028e8675f78139",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_slash_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_tables_with_view]": [
+ {
+ "checksum": "21bfca2da8e1454d9bb09e289916bbe3",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_tables_with_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-range_with_view]": [
+ {
+ "checksum": "1a89631ecfd3a6587b1a5638fffe32aa",
+ "size": 120,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-range_with_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-table_funcs_expr]": [
+ {
+ "checksum": "c386181b1c720be80b620da790b3cd6b",
+ "size": 890,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-table_funcs_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[table_range-tablepath_with_non_existing]": [
+ {
+ "checksum": "73641f4132064d32369be7621fb429e4",
+ "size": 239,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_table_range-tablepath_with_non_existing_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q10]": [
+ {
+ "checksum": "9ec239d1d0eb419ac9f171c001b6d300",
+ "size": 1963,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q10_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q11]": [
+ {
+ "checksum": "67e03ac910d54aafd3fa6f46352e9377",
+ "size": 1218,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q11_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q12]": [
+ {
+ "checksum": "32b465f1d18ea39f5bb64fa065f99e8d",
+ "size": 1245,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q12_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q13]": [
+ {
+ "checksum": "053014ff4776da51a679554567bc3561",
+ "size": 664,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q13_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q14]": [
+ {
+ "checksum": "b70727f1ecb657c40c3d715e6cff0372",
+ "size": 626,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q14_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q15]": [
+ {
+ "checksum": "171263f4e196a02abbfd9e44f0149e5d",
+ "size": 1319,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q15_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q16]": [
+ {
+ "checksum": "0ea704ccb3786e1355335a8995f35119",
+ "size": 976,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q16_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q17]": [
+ {
+ "checksum": "5c38bcc1a9b055316fb93df4e2b2b389",
+ "size": 783,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q17_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q18]": [
+ {
+ "checksum": "03634e26dab94ecd2c89ace05cd27d6f",
+ "size": 1063,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q18_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q19]": [
+ {
+ "checksum": "a5ef042c23d8e7954abe2331567a492d",
+ "size": 1483,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q19_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q1]": [
+ {
+ "checksum": "c473e34a19dfd86c8f0e43e4df09aa06",
+ "size": 735,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q20]": [
+ {
+ "checksum": "70f826b78ae27d845af71c31e1d89349",
+ "size": 1563,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q20_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q21]": [
+ {
+ "checksum": "a225ee742fd7d3acd02b674bfbc640ec",
+ "size": 1778,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q21_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q22]": [
+ {
+ "checksum": "74988e6624157fa9a5855b2f141f49c7",
+ "size": 1256,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q22_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q2]": [
+ {
+ "checksum": "c3ac7d673eb6f462aac1936026f67782",
+ "size": 1707,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q3]": [
+ {
+ "checksum": "9f52f4072df573689ef66baafefddc4c",
+ "size": 1234,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q4]": [
+ {
+ "checksum": "0b0b79a2cb95ff0431dd1317ef491298",
+ "size": 790,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q4_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q5]": [
+ {
+ "checksum": "6d9d70d0bfce6e702ad69e6948310146",
+ "size": 2430,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q5_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q6]": [
+ {
+ "checksum": "3b2ea366dd542cc7e394aa4cc3b7c818",
+ "size": 459,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q6_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q7]": [
+ {
+ "checksum": "2264a2561b98b18a2787c53561650e31",
+ "size": 1916,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_tpch-q7_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q8]": [
+ {
+ "checksum": "8035e22f336f8e2946c2a94a4fa320c9",
+ "size": 2263,
+ "uri": "https://{canondata_backend}/1925842/ffeacd65677f75bcab2445d237890283afc5e8f6/resource.tar.gz#test_sql_format.test_tpch-q8_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[tpch-q9]": [
+ {
+ "checksum": "888ed58c1b7789e63a03d76a4975e1ed",
+ "size": 1820,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_tpch-q9_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_literal-create_table]": [
+ {
+ "checksum": "6fed5bb3f08d48b321354a521e1248f5",
+ "size": 1957,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_literal-create_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_literal-declare]": [
+ {
+ "checksum": "60e4caaad92655ebb67750f0e30b3002",
+ "size": 2507,
+ "uri": "https://{canondata_backend}/1847551/ded2b19a6ce564c8d4bb4e89d6beae86bd5e763e/resource.tar.gz#test_sql_format.test_type_literal-declare_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_literal-evaluate]": [
+ {
+ "checksum": "a4cccedfb46c4bbcc268e98bcb9149fd",
+ "size": 192,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_literal-evaluate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-append_diff_flags]": [
+ {
+ "checksum": "71ab940df1c0db94046dc293d3ea3686",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-append_diff_flags_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-append_diff_layout1]": [
+ {
+ "checksum": "3d486876cf92ab4cfc48b0803fbcae6e",
+ "size": 1130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-append_diff_layout1_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-append_diff_layout2]": [
+ {
+ "checksum": "25dff2b007d21e94cd212a38b296c7fe",
+ "size": 1156,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-append_diff_layout2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-append_struct]": [
+ {
+ "checksum": "352755ad768e141328b8223bec822186",
+ "size": 435,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-append_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-decimal_yt]": [
+ {
+ "checksum": "d39f6468f536c7c8157e11d98f37405a",
+ "size": 441,
+ "uri": "https://{canondata_backend}/1937150/9172d3bfa238458c3c5d39a9044d73fbb74cec2d/resource.tar.gz#test_sql_format.test_type_v3-decimal_yt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-decimal_yt_llvm]": [
+ {
+ "checksum": "73537e9c1e840d440cefc96cdcae9092",
+ "size": 819,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-decimal_yt_llvm_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-decimal_yt_nollvm]": [
+ {
+ "checksum": "869f39c203be0ec8dcd354efeba716bf",
+ "size": 822,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-decimal_yt_nollvm_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-float]": [
+ {
+ "checksum": "f37eab5cefd886b49bf583f69faab83d",
+ "size": 281,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-float_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-ignore_v3_hint]": [
+ {
+ "checksum": "1663400d4d0e7547df3a75f65f984c04",
+ "size": 151,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-ignore_v3_hint_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-ignore_v3_pragma]": [
+ {
+ "checksum": "a7e2cf9ad117140eba899f580b2e516a",
+ "size": 151,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-ignore_v3_pragma_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-insert_struct_v3_with_native]": [
+ {
+ "checksum": "32f1fcd4b6ffa71fcbd702984815c771",
+ "size": 392,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-insert_struct_v3_with_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-insert_struct_v3_wo_native]": [
+ {
+ "checksum": "563ca76a0326bc8b1f36c61ee03c3d50",
+ "size": 408,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-insert_struct_v3_wo_native_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-json]": [
+ {
+ "checksum": "22582d5bb4d5325a1a9bf54e44b591ed",
+ "size": 309,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-json_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-mergejoin_with_sort]": [
+ {
+ "checksum": "5355d32fdf371a750edb9d02c373f3bf",
+ "size": 268,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-mergejoin_with_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-mixed_with_columns]": [
+ {
+ "checksum": "fc71ede343995a56ab08066961c2b60d",
+ "size": 161,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-mixed_with_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-non_strict]": [
+ {
+ "checksum": "eaf8e5c13c4604cebad5deb8958a83d7",
+ "size": 295,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-non_strict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-replace_diff_layout]": [
+ {
+ "checksum": "a83fa48a12d2b7d8bb6d011f32cf776a",
+ "size": 1203,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-replace_diff_layout_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-singulars]": [
+ {
+ "checksum": "af845b99462f2f0e76e13b0445b59d70",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-singulars_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-split]": [
+ {
+ "checksum": "8a2f80544890b6f59336e3dddd63fd6f",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-split_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-type_subset]": [
+ {
+ "checksum": "481957b40b2faab07bb6b526a2ba6a15",
+ "size": 280,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_type_v3-type_subset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[type_v3-uuid]": [
+ {
+ "checksum": "3bf34c2cde3d4f9365a787888a60ac51",
+ "size": 590,
+ "uri": "https://{canondata_backend}/1925821/b8008446b33ca345e686cde20ac11f69555d8599/resource.tar.gz#test_sql_format.test_type_v3-uuid_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-automap_null]": [
+ {
+ "checksum": "46ccf8053e07c003f12860f5ae5681d0",
+ "size": 186,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-automap_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-complex_return_type]": [
+ {
+ "checksum": "783e67629ac3a5e6974b77c0541b34ea",
+ "size": 72,
+ "uri": "https://{canondata_backend}/1777230/c8f2b4b2c8d62bc943374881c0588518063cbe1d/resource.tar.gz#test_sql_format.test_udf-complex_return_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-generic_udf]": [
+ {
+ "checksum": "7f42dce827f667da91f82d98c2f293d0",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-generic_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-named_args]": [
+ {
+ "checksum": "086fc5db7e3b590e5152422b2b8fd03c",
+ "size": 633,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-named_args_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-named_args_for_script]": [
+ {
+ "checksum": "126f251df64086489441e9a27d841146",
+ "size": 623,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-named_args_for_script_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-named_args_for_script_with_posargs2]": [
+ {
+ "checksum": "0b82f9f1d643288aa37071a43e35762c",
+ "size": 620,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-named_args_for_script_with_posargs2_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-named_args_for_script_with_posargs]": [
+ {
+ "checksum": "ee93b9a7ab2615fb7c96cda97bc96bf5",
+ "size": 627,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-named_args_for_script_with_posargs_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-named_args_for_script_with_posargs_reuse_args_fail]": [
+ {
+ "checksum": "6035273ae147f396e3fd3ed3a86733e2",
+ "size": 657,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-python_script]": [
+ {
+ "checksum": "593c09ac25d9965f0afd98fe89ca19bb",
+ "size": 288,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-python_script_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-python_script_from_file]": [
+ {
+ "checksum": "c56d1c2a4fd28461821bebeeba76a665",
+ "size": 246,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-python_script_from_file_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-python_struct]": [
+ {
+ "checksum": "f202249d99f7c74e69ec895ec1b35ce4",
+ "size": 638,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-python_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-regexp_udf]": [
+ {
+ "checksum": "6665faf7cc35447dce23960d8ea73522",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-regexp_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-same_udf_modules]": [
+ {
+ "checksum": "d8034a96e2fea331054612817fcf0b52",
+ "size": 433,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-same_udf_modules_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-sqlproject_grounds]": [
+ {
+ "checksum": "0a8454b016358207a33861b857ef54e1",
+ "size": 185,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-sqlproject_grounds_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-trivial_udf]": [
+ {
+ "checksum": "7cf443322650aaa7cc0f9f18e946efac",
+ "size": 82,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-trivial_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-two_regexps]": [
+ {
+ "checksum": "eab32d55829b213c659e0c26d8635c14",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-two_regexps_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udaf]": [
+ {
+ "checksum": "13a95a448cf2f367fe7efeffbff4d5c7",
+ "size": 1357,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udaf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udaf_default]": [
+ {
+ "checksum": "ee5bad14e817e9d16da792e07529dc6b",
+ "size": 767,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udaf_default_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udaf_distinct]": [
+ {
+ "checksum": "6df1009ab940fe4363d709d9f0a85f98",
+ "size": 1418,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udaf_distinct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udaf_lambda]": [
+ {
+ "checksum": "e17122d2af6fff4670d755afe47623c9",
+ "size": 539,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udaf_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udaf_short]": [
+ {
+ "checksum": "bd104089e9092f56d11bf570c61fddd7",
+ "size": 573,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udaf_short_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udf]": [
+ {
+ "checksum": "6b5e098f4a75c50b3bbc51d6aa9fa3b1",
+ "size": 115,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udf_call_with_group_and_limit]": [
+ {
+ "checksum": "16c657333ddef1532f8213fa89e91318",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udf_call_with_group_and_limit_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udf_empty]": [
+ {
+ "checksum": "8e3c3cf1271914d9f1f44797a5587fd2",
+ "size": 164,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udf_empty_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-udf_result_member]": [
+ {
+ "checksum": "114a8c6946dd1f6b6d230d1a59057aff",
+ "size": 132,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-udf_result_member_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[udf-wrong_args_fail]": [
+ {
+ "checksum": "59adb4b6c343c9fdcc96a48bef8b9896",
+ "size": 270,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_udf-wrong_args_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_column_extention]": [
+ {
+ "checksum": "1b43748e99595ed6cb4d699f2b4de2b1",
+ "size": 145,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_column_extention_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_mix]": [
+ {
+ "checksum": "eecb2dbde2d9c76e21837b0215bb07ae",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_multiin]": [
+ {
+ "checksum": "d824466d6bdcf05db99486edc1662f98",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_multiin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_positional]": [
+ {
+ "checksum": "946fe324129e5ec1aeec7634244bc7cd",
+ "size": 95,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_positional_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_positional_mix]": [
+ {
+ "checksum": "3120fdcdfa091f8d9102ccec1d7c539e",
+ "size": 135,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_positional_mix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union-union_trivial]": [
+ {
+ "checksum": "59a73fbabeec91232b674a785567d268",
+ "size": 84,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union-union_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-infer_3]": [
+ {
+ "checksum": "ed3f3b87c57b78bfb2c1c8fba53fca68",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-infer_3_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-inner_union_all_with_limits]": [
+ {
+ "checksum": "1bebb2778a4ddd0d292dcd6f6ed30d22",
+ "size": 413,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-inner_union_all_with_limits_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-mix_map_and_project]": [
+ {
+ "checksum": "54307a3e469726b0e8c7cb585c1a5cd1",
+ "size": 336,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-mix_map_and_project_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-mix_map_and_read]": [
+ {
+ "checksum": "1c8966e4d68b9b6a1d9a8309976c9989",
+ "size": 295,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-mix_map_and_read_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-path_and_record]": [
+ {
+ "checksum": "88bef54cb2350893dcbea8105db419d4",
+ "size": 364,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-path_and_record_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_fields]": [
+ {
+ "checksum": "0dc189caccd5454842cd0a6783736788",
+ "size": 214,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_incompatible]": [
+ {
+ "checksum": "e3dcbbbac7b1ebac3b1a7df33801165d",
+ "size": 637,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_incompatible_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_multiin]": [
+ {
+ "checksum": "05d213aaff1af1977d1f52c33354aa4c",
+ "size": 194,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_multiin_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_multiple]": [
+ {
+ "checksum": "c40232c284d119d2eaec0eb5036c45af",
+ "size": 370,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_multiple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_null]": [
+ {
+ "checksum": "e7b89ed76b2ad72888432701f199bfab",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_null_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_subexpr]": [
+ {
+ "checksum": "8447d15881a3f697ec49b1ac2a0244ed",
+ "size": 275,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_subexpr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_trivial]": [
+ {
+ "checksum": "872483a53db30aa2e8fee7146ee184e5",
+ "size": 71,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_trivial_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_with_discard_into_result_ansi]": [
+ {
+ "checksum": "3306d164909d9468e13ce08ced46266d",
+ "size": 235,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_with_discard_into_result_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_with_limits]": [
+ {
+ "checksum": "b3d26feea1a1dbca24748b4aa0327b77",
+ "size": 171,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_with_limits_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_with_parenthesis]": [
+ {
+ "checksum": "10a9469a15edaa60517a894cad48e349",
+ "size": 103,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_with_parenthesis_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[union_all-union_all_with_top_level_limits_ansi]": [
+ {
+ "checksum": "35216ec4d3f9fa5744aa11a4bc88ef3e",
+ "size": 599,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_union_all-union_all_with_top_level_limits_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[version-version]": [
+ {
+ "checksum": "6bfcf0939056d9f769a00b5f189ee77c",
+ "size": 85,
+ "uri": "https://{canondata_backend}/1937001/d7b13cc6719a33439797b775af740565a6f82a84/resource.tar.gz#test_sql_format.test_version-version_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-all_from_view]": [
+ {
+ "checksum": "a56d4fea1d374daefc499b31c4054746",
+ "size": 93,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-all_from_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_eval]": [
+ {
+ "checksum": "b08987d32b59d8b78f26f7d5667fd49d",
+ "size": 149,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_inner]": [
+ {
+ "checksum": "2ce4c503c1c718b61e3706f1cfa00413",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_inner_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_inner_library]": [
+ {
+ "checksum": "0c8dfd0b8ba7d3d8a92ed167004bdf85",
+ "size": 158,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_inner_library_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_inner_udf]": [
+ {
+ "checksum": "a9a823c5a33654895eb7ba5a58f4ad41",
+ "size": 228,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_inner_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_outer]": [
+ {
+ "checksum": "09f94c43e09b2dfcac41fff318b2e8d4",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_outer_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-file_outer_library]": [
+ {
+ "checksum": "40556299449bcb2bd5c8736abd8fed6d",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-file_outer_library_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-init_view_after_eval]": [
+ {
+ "checksum": "7c6d4713a78f2efd88c9b9c7ca2b149b",
+ "size": 410,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-init_view_after_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-secure]": [
+ {
+ "checksum": "53bab683c743905bc2bd8bf3b568ec0c",
+ "size": 146,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-secure_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-secure_eval]": [
+ {
+ "checksum": "4a358403c2e2689e800317a3139f2ce7",
+ "size": 151,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-secure_eval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-secure_eval_dyn]": [
+ {
+ "checksum": "7536d1692bf749890632ebbb4cd8645a",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-secure_eval_dyn_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-standalone_view_lambda]": [
+ {
+ "checksum": "7659f8a15ddf118f2a9df16095e204be",
+ "size": 199,
+ "uri": "https://{canondata_backend}/1936273/2771a82a0b871cea06640e9dcc02afc4b5a7a23c/resource.tar.gz#test_sql_format.test_view-standalone_view_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-system_udf]": [
+ {
+ "checksum": "2e37e99b40bac0bf8e473ab8d759df26",
+ "size": 150,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-system_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-trivial_view]": [
+ {
+ "checksum": "a963726feb314d8ea93778d29ec4e0aa",
+ "size": 109,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-trivial_view_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-trivial_view_concat]": [
+ {
+ "checksum": "f4d6782ff48a70ccbb25b34324685f64",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-trivial_view_concat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-view_with_lambda]": [
+ {
+ "checksum": "73313f2b114ba9ddd50ec2fa429a1bb7",
+ "size": 53,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-view_with_lambda_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-view_with_lambda_process]": [
+ {
+ "checksum": "0878f7092769d9259907228971af33ba",
+ "size": 61,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-view_with_lambda_process_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[view-view_with_library]": [
+ {
+ "checksum": "24e73dba5eaf1e4c95aed233333e189c",
+ "size": 56,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_view-view_with_library_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-few_source_different_columns]": [
+ {
+ "checksum": "6b866add1f6e88026c300af030951218",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-few_source_different_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-hor_join_with_mix_weak_access]": [
+ {
+ "checksum": "1ea6757ce94974947168c8eb74e76e66",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-hor_join_with_mix_weak_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-optimize_weak_fields_combine]": [
+ {
+ "checksum": "9841c8cdc481abf6cda735a594e4bf96",
+ "size": 191,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-optimize_weak_fields_combine_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-optimize_weak_fields_filter_combine]": [
+ {
+ "checksum": "3850d663b72e721a3c7b48e49a62cf3a",
+ "size": 244,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-optimize_weak_fields_filter_combine_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-optimize_weak_fields_map]": [
+ {
+ "checksum": "cda003ac30d673bbfa03d7a4ee71f2c0",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-optimize_weak_fields_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-optimize_weak_fields_map_combine]": [
+ {
+ "checksum": "cd4e357544d18f9b66b44005447947a4",
+ "size": 207,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-optimize_weak_fields_map_combine_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field]": [
+ {
+ "checksum": "afbd5c646df3b45caf254735ffbdca79",
+ "size": 468,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_aggregation]": [
+ {
+ "checksum": "6a28ac8fa1d7f2d0a0dc636ed31f5c92",
+ "size": 242,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_aggregation_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_data]": [
+ {
+ "checksum": "64669c9311948f0c62873e46ff728b50",
+ "size": 168,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_data_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_esc_string]": [
+ {
+ "checksum": "3aea42d3ec4c9d79d584418b6631cc47",
+ "size": 159,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_esc_string_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_esc_yson]": [
+ {
+ "checksum": "53b5d99962f685a8734f7e023656d8cd",
+ "size": 275,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_esc_yson_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_in_group_by]": [
+ {
+ "checksum": "6fd460214cf30e72004ed05a1fa28a44",
+ "size": 147,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_in_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_infer_scheme]": [
+ {
+ "checksum": "74ef74d7b1a93fefe8755ffa73994ba9",
+ "size": 158,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_infer_scheme_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_join]": [
+ {
+ "checksum": "c734d47a40cea0f43493fc16fea5a194",
+ "size": 352,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_join_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_join_condition]": [
+ {
+ "checksum": "2f7f9efc60ccc3dca5f8075acff9ca9c",
+ "size": 426,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_join_condition_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_join_where]": [
+ {
+ "checksum": "fb57bc8df44941403a355dbf79ae342a",
+ "size": 509,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_join_where_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_long_fields]": [
+ {
+ "checksum": "47b6694ab8634da4f4a48d2aa477ab8f",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_long_fields_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_long_name]": [
+ {
+ "checksum": "74a46a9d59e5180735c051d349c4376e",
+ "size": 127,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_long_name_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_num_access]": [
+ {
+ "checksum": "1a6fc7371a4f49679e4b1b33128533bf",
+ "size": 198,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_num_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_opt]": [
+ {
+ "checksum": "15e6e95d8772564e569b732439497f0e",
+ "size": 179,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_real_col]": [
+ {
+ "checksum": "3f2b4862ee6126a91ebc6b3d1ae82c4e",
+ "size": 225,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_real_col_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_rest]": [
+ {
+ "checksum": "8b038aa992e0c1aa6d270a141742f058",
+ "size": 344,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_rest_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_strict]": [
+ {
+ "checksum": "d559e9f251fd95fd78e72df2226a99f2",
+ "size": 359,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_strict_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_to_yson]": [
+ {
+ "checksum": "79f773671489960b1ac0eeaaa7ea913a",
+ "size": 111,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_to_yson_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_type]": [
+ {
+ "checksum": "9751c4ca3a86280e458ffd4fdd89f9d2",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_field_wrong_types_fail]": [
+ {
+ "checksum": "bd6b0ab0a759e2c95de143eca3e4e399",
+ "size": 130,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_field_wrong_types_fail_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-weak_member_string_copy]": [
+ {
+ "checksum": "5a8599c35300b8d62e785f47272a09be",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_weak_field-weak_member_string_copy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[weak_field-yql-7888_mapfieldsubset]": [
+ {
+ "checksum": "2255267d80d4f06c833ce8c105dc0125",
+ "size": 842,
+ "uri": "https://{canondata_backend}/1937001/da4215d5087e56eec0224ec5e7754dafd0b2bdcf/resource.tar.gz#test_sql_format.test_weak_field-yql-7888_mapfieldsubset_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-all_columns_hide_window_special_ones]": [
+ {
+ "checksum": "bdafd4bfe40041f544832917333aa52d",
+ "size": 289,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-all_columns_hide_window_special_ones_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/aggregations]": [
+ {
+ "checksum": "36491ccb81d99da103919a026b821654",
+ "size": 513,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-current_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/aggregations_leadlag]": [
+ {
+ "checksum": "e945681d28781513ef54e2743979b9d9",
+ "size": 464,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-current_aggregations_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/ansi_current]": [
+ {
+ "checksum": "266f5b2ff3aa8a9d5632430698a8f9a7",
+ "size": 315,
+ "uri": "https://{canondata_backend}/1871002/e545ae390e08839888f54fdbe17287e1fb1c3edc/resource.tar.gz#test_sql_format.test_window-current_ansi_current_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/ansi_current_mixed]": [
+ {
+ "checksum": "6108aa345c3b3a8faa6af8f80f6bbd19",
+ "size": 729,
+ "uri": "https://{canondata_backend}/1900335/5f1a27d57cadc5c8ba1f5cd895bce88738ce8a6b/resource.tar.gz#test_sql_format.test_window-current_ansi_current_mixed_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/ansi_current_with_win]": [
+ {
+ "checksum": "a53aff56648a64d3f7d4edd84f3888ab",
+ "size": 375,
+ "uri": "https://{canondata_backend}/212715/a7c52d2a110272f238f0f7fff9cff3a6adacaf12/resource.tar.gz#test_sql_format.test_window-current_ansi_current_with_win_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/session]": [
+ {
+ "checksum": "6a27d3ba7bb82eaf97aeb1e7051ad039",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-current_session_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/session_aliases]": [
+ {
+ "checksum": "7f33f1b1242202f39850931a992cd9ba",
+ "size": 540,
+ "uri": "https://{canondata_backend}/1942525/c4679680a3f04e525af18da47282958892246bf4/resource.tar.gz#test_sql_format.test_window-current_session_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/session_extended]": [
+ {
+ "checksum": "f35172b4c7ec181d0cf49197fbb9993e",
+ "size": 959,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-current_session_extended_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-current/session_incompat_sort]": [
+ {
+ "checksum": "a2c62980f0b708e12334d021cda1d038",
+ "size": 391,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-current_session_incompat_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-distinct_over_window]": [
+ {
+ "checksum": "1fca096be5968ce19a23ea1ef373ff5d",
+ "size": 886,
+ "uri": "https://{canondata_backend}/1942173/c39ea6983bdb3ed2526e7b8cbb63e3cac2c06a0e/resource.tar.gz#test_sql_format.test_window-distinct_over_window_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-distinct_over_window_full_frames]": [
+ {
+ "checksum": "afea256476a691cc7d25a9e988ee707a",
+ "size": 846,
+ "uri": "https://{canondata_backend}/1942173/c39ea6983bdb3ed2526e7b8cbb63e3cac2c06a0e/resource.tar.gz#test_sql_format.test_window-distinct_over_window_full_frames_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-distinct_over_window_struct]": [
+ {
+ "checksum": "bebcc5afe7560c3719b8c8cbcb32667a",
+ "size": 1467,
+ "uri": "https://{canondata_backend}/1942173/c39ea6983bdb3ed2526e7b8cbb63e3cac2c06a0e/resource.tar.gz#test_sql_format.test_window-distinct_over_window_struct_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-empty/aggregations]": [
+ {
+ "checksum": "a4dfb90fba13038c8467ec87d4ff72eb",
+ "size": 613,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-empty_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-empty/aggregations_leadlag]": [
+ {
+ "checksum": "2400cc80fdb0825e39c0578c123e36c7",
+ "size": 604,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-empty_aggregations_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/aggregations]": [
+ {
+ "checksum": "43f528a2db54f5f9b0db544063dcf31f",
+ "size": 597,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/aggregations_compact]": [
+ {
+ "checksum": "0a804c9faa21ca4ff8666553b2748f6c",
+ "size": 654,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_aggregations_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/aggregations_leadlag]": [
+ {
+ "checksum": "30964fc5f3050f7333cef5999ed7d879",
+ "size": 653,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_aggregations_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/aggregations_leadlag_compact]": [
+ {
+ "checksum": "c2e649d3d9bc539941e93cd196405c3a",
+ "size": 705,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_aggregations_leadlag_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/leadlag]": [
+ {
+ "checksum": "76c1b12db1a6d7d2ccd8079bcb689e0a",
+ "size": 821,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/leadlag_compact]": [
+ {
+ "checksum": "2667a086ccc6613a3d46184b249fb55a",
+ "size": 889,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_leadlag_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/noncompact_with_nulls]": [
+ {
+ "checksum": "5921afa697e856dc1139ea2d111cc630",
+ "size": 606,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_noncompact_with_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/noncompact_with_nulls_tuple_key]": [
+ {
+ "checksum": "57c75ba5c597ea069db984172edcbec1",
+ "size": 604,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_noncompact_with_nulls_tuple_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/noncompact_with_tablerow]": [
+ {
+ "checksum": "95411d7ff5f14e0e29fe82380fb9d6cc",
+ "size": 350,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_noncompact_with_tablerow_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/session]": [
+ {
+ "checksum": "290721d762f224b681c7e8f772351176",
+ "size": 595,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_session_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/session_aliases]": [
+ {
+ "checksum": "83d2775c4e2cfa14129da5fd8ab3456b",
+ "size": 469,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_session_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/session_aliases_compact]": [
+ {
+ "checksum": "04a9ed659f263f152928052c7f5d324b",
+ "size": 485,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_session_aliases_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/session_compact]": [
+ {
+ "checksum": "9aa2b346aabb3512d8da73a78194a56c",
+ "size": 415,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_session_compact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/session_incompat_sort]": [
+ {
+ "checksum": "adf7d442f6bc3560807aa85110aec80c",
+ "size": 600,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_session_incompat_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-full/syscolumns]": [
+ {
+ "checksum": "491882a271c23760f9c8bbb2eda1e1bb",
+ "size": 455,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-full_syscolumns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/aggregations_after_current]": [
+ {
+ "checksum": "8dae15184af0ee8df7f493b66c3a9b11",
+ "size": 702,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_aggregations_after_current_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/aggregations_before_current]": [
+ {
+ "checksum": "309aaa547a12bec50389bc5785359c20",
+ "size": 702,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_aggregations_before_current_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/aggregations_include_current]": [
+ {
+ "checksum": "58e7425d0f7d6ef1e5b9f6db1f1b4193",
+ "size": 702,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_aggregations_include_current_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/aggregations_mixed]": [
+ {
+ "checksum": "05bd11fd3395736ef5fb3a47ed98a621",
+ "size": 702,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_aggregations_mixed_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/aggregations_mixed_leadlag]": [
+ {
+ "checksum": "232eaefb3b58cfc22cb0c9a95aca4cfc",
+ "size": 653,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_aggregations_mixed_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/session]": [
+ {
+ "checksum": "2e4c34122eafae4ef0dd9246c9759dfe",
+ "size": 391,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_session_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-generic/session_aliases]": [
+ {
+ "checksum": "b856d66a3e34fed9030493b39d3ad42a",
+ "size": 627,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-generic_session_aliases_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-lagging/aggregations]": [
+ {
+ "checksum": "d69bc214ea4154d9219f14a4bc3bde99",
+ "size": 718,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-lagging_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-lagging/aggregations_leadlag]": [
+ {
+ "checksum": "80cab838b0384e4e28aee1a026dac9cd",
+ "size": 669,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-lagging_aggregations_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-leading/aggregations]": [
+ {
+ "checksum": "53f270729d175e0a540b51fa0e1c7d62",
+ "size": 718,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-leading_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-leading/aggregations_leadlag]": [
+ {
+ "checksum": "9c577c700962e7a71b72b1caf846e9e9",
+ "size": 669,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-leading_aggregations_leadlag_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-mixed/aggregations]": [
+ {
+ "checksum": "f95c4da06b14e18f8e824eeb68fd256f",
+ "size": 666,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-mixed_aggregations_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-null_type]": [
+ {
+ "checksum": "5f55a2b325360a776bae655ddd1429a8",
+ "size": 700,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-null_type_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-presort_window_order_by_table]": [
+ {
+ "checksum": "a4ab3cda03b00118b92c29426a3eaeb2",
+ "size": 322,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-presort_window_order_by_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-presort_window_partition_by_mem]": [
+ {
+ "checksum": "284dd1278fe88b1461a0e10667d0c01b",
+ "size": 229,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-presort_window_partition_by_mem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-presort_window_partition_by_table]": [
+ {
+ "checksum": "82ab5786e3f8272956d2f1567e80e72a",
+ "size": 266,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-presort_window_partition_by_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-rank/nulls]": [
+ {
+ "checksum": "8a55187b2a93b88b25e8da81405e7aff",
+ "size": 402,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-rank_nulls_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-rank/nulls_legacy]": [
+ {
+ "checksum": "acac81b8e74b7eeef1046a8fc231486b",
+ "size": 409,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-rank_nulls_legacy_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-rank/opt]": [
+ {
+ "checksum": "0a6f6c2f602183e376892893ffe26eea",
+ "size": 850,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-rank_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-rank/plain]": [
+ {
+ "checksum": "b1816b98a31cbc25b6ab1bedc1695268",
+ "size": 794,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-rank_plain_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-rank/unordered]": [
+ {
+ "checksum": "a673ee2200940b32e3ac085c8d8da7de",
+ "size": 526,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-rank_unordered_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-row_number_no_part_from_subq]": [
+ {
+ "checksum": "40121e79aa1431c49f22820e69f083c0",
+ "size": 174,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-row_number_no_part_from_subq_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-row_number_no_part_multi_input]": [
+ {
+ "checksum": "77bf4f69be98f4e4cd420577fbae7d80",
+ "size": 519,
+ "uri": "https://{canondata_backend}/1899731/7468937c6613e47ddb62951e5fc1e6a991d81281/resource.tar.gz#test_sql_format.test_window-row_number_no_part_multi_input_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-row_number_to_map]": [
+ {
+ "checksum": "b9bf66438fe8f1ac879463d53425f051",
+ "size": 598,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-row_number_to_map_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-row_number_to_map_multiple]": [
+ {
+ "checksum": "7ae6ebc832ff4c05f4224184d45f59fe",
+ "size": 429,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-row_number_to_map_multiple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-row_number_to_map_noncompact]": [
+ {
+ "checksum": "a348a517b075c9c617f877eb722e9aba",
+ "size": 170,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-row_number_to_map_noncompact_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-udaf_no_merge]": [
+ {
+ "checksum": "a27605cf9bab815de59547dac85d86d7",
+ "size": 347,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-udaf_no_merge_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-udaf_window]": [
+ {
+ "checksum": "1620d8730ee3f392852b09414a87385b",
+ "size": 1423,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-udaf_window_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-udaf_with_def_value]": [
+ {
+ "checksum": "76ad6e9ef336c21a0b8f7dfda8e7c521",
+ "size": 1959,
+ "uri": "https://{canondata_backend}/1936997/c4b2710fbedc1001e1f494f1eaf6939b726b752c/resource.tar.gz#test_sql_format.test_window-udaf_with_def_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_by_all_aggregate]": [
+ {
+ "checksum": "3da1b94f2ae3c07cb1599be1151dbfd9",
+ "size": 1386,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_by_all_aggregate_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_by_all_avg_interval]": [
+ {
+ "checksum": "f6d9367d2b2ffb773c681a4cc3d72a55",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_by_all_avg_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_by_all_percentile_interval]": [
+ {
+ "checksum": "e576f1164ad40456dddbd1fe4f207c83",
+ "size": 908,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_by_all_percentile_interval_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_by_simple]": [
+ {
+ "checksum": "147116190e7d19b129ed1d5b923e77c5",
+ "size": 221,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_by_simple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_expr_bounds]": [
+ {
+ "checksum": "f2155099723a62c30c2bb05f67b3e83b",
+ "size": 314,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_expr_bounds_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_extract_members]": [
+ {
+ "checksum": "a32c27fcb5e3e3e384934f33bd8459c1",
+ "size": 728,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_extract_members_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_4func]": [
+ {
+ "checksum": "fe58b08c0f83357aad78eeb2516171de",
+ "size": 326,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_4func_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_4func_no_part]": [
+ {
+ "checksum": "444eb4b28ade1f5daa4fed4aa3372d40",
+ "size": 267,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_4func_no_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_4func_no_part_sorted]": [
+ {
+ "checksum": "085fc9bbffa1f377918cb4e5b7471ada",
+ "size": 262,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_4func_no_part_sorted_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_4func_sort]": [
+ {
+ "checksum": "835c38bf2866e4d6136247d8e9b6664c",
+ "size": 316,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_4func_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_4func_sort_desc]": [
+ {
+ "checksum": "bf29763317a5eb26a5cfd298c16fa6a0",
+ "size": 321,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_4func_sort_desc_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_hist]": [
+ {
+ "checksum": "f296601222ff3b54ac8c4faa34953442",
+ "size": 332,
+ "uri": "https://{canondata_backend}/1871002/c96e3417fb8f66b5eacd54fbef02ab1dc8224eef/resource.tar.gz#test_sql_format.test_window-win_func_aggr_hist_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_stat]": [
+ {
+ "checksum": "669e153fd73c3caf1251b5be012d1ac6",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_stat_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_with_qualified_all]": [
+ {
+ "checksum": "c762ec8c76112c7d672cbb80a2c72e22",
+ "size": 378,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_with_qualified_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_aggr_with_qualified_all_no_simple_columns]": [
+ {
+ "checksum": "1ab50c0667ee75c321b8ea808db68436",
+ "size": 393,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_aggr_with_qualified_all_no_simple_columns_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_auto_arg]": [
+ {
+ "checksum": "1ea732d52bd560c994293165939f1b79",
+ "size": 478,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_auto_arg_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_auto_arg_selective_rank]": [
+ {
+ "checksum": "cfd5a0f53e9551f739ef476b398dd1ca",
+ "size": 463,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_auto_arg_selective_rank_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_auto_arg_two_sort]": [
+ {
+ "checksum": "34bbafe32ca957d5746010676b9bccd1",
+ "size": 468,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_auto_arg_two_sort_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_cume_dist]": [
+ {
+ "checksum": "c2da6ca06ae843d6193bbcf4a8068225",
+ "size": 323,
+ "uri": "https://{canondata_backend}/1924537/1e6c4bd0b6a388eb0c3be13c5222f8b798f7e45c/resource.tar.gz#test_sql_format.test_window-win_func_cume_dist_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_cume_dist_ansi]": [
+ {
+ "checksum": "f668aefed6ec54eff0cf412291169a2c",
+ "size": 257,
+ "uri": "https://{canondata_backend}/1889210/3b80794dcf61416ec7f21fc15203e31fda3473f3/resource.tar.gz#test_sql_format.test_window-win_func_cume_dist_ansi_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_first_last]": [
+ {
+ "checksum": "1dba48dd53fd6e870b89b62edaf34540",
+ "size": 385,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_first_last_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_first_last_over_nonopt]": [
+ {
+ "checksum": "f5b2baf6b1e71d16a2eb9b707689ebfc",
+ "size": 556,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_first_last_over_nonopt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_first_last_rev]": [
+ {
+ "checksum": "280a7b5d22869641be5c6d73fa059576",
+ "size": 384,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_first_last_rev_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_first_last_with_part]": [
+ {
+ "checksum": "fe5cb9a4af002ebd66b80b4b3df4c1bc",
+ "size": 719,
+ "uri": "https://{canondata_backend}/1937367/2ff1f203c4787432c1176f49937b54e54180c90f/resource.tar.gz#test_sql_format.test_window-win_func_first_last_with_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_in_lib]": [
+ {
+ "checksum": "fc5eea6b8554ff6e9ca97106197de50f",
+ "size": 94,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_in_lib_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_into_udf]": [
+ {
+ "checksum": "e67ad403abd500267cf357b68a2494de",
+ "size": 237,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_into_udf_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_lead_lag_opt]": [
+ {
+ "checksum": "7421760ad0cfae34b4132b7896ef76a2",
+ "size": 570,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_lead_lag_opt_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_lead_lag_worm]": [
+ {
+ "checksum": "ceefafe11c4df4311f9aafe32ca3c41a",
+ "size": 603,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_lead_lag_worm_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_lead_lag_worm_with_part]": [
+ {
+ "checksum": "d00e9610473116510d53ba495f960387",
+ "size": 736,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_lead_lag_worm_with_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_lead_lag_worm_with_part_other]": [
+ {
+ "checksum": "11100f10d9d7c5299435bb41df2f1107",
+ "size": 725,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_lead_lag_worm_with_part_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_mutable_resource]": [
+ {
+ "checksum": "3137020d49857b4d8d1737627b8cc12b",
+ "size": 295,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_mutable_resource_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_nth_value]": [
+ {
+ "checksum": "02c4b839b33915cb2711a14a46e05956",
+ "size": 547,
+ "uri": "https://{canondata_backend}/1937367/f9c5e2ce003fa874f20946cc39a5807e02d6b085/resource.tar.gz#test_sql_format.test_window-win_func_nth_value_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_ntile]": [
+ {
+ "checksum": "05a41b22e12f50577f6663518f92fb2f",
+ "size": 320,
+ "uri": "https://{canondata_backend}/1924537/1e6c4bd0b6a388eb0c3be13c5222f8b798f7e45c/resource.tar.gz#test_sql_format.test_window-win_func_ntile_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_on_cloned_source]": [
+ {
+ "checksum": "53a5dd557cae808a17be6d127d4b5178",
+ "size": 248,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_on_cloned_source_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_order_by_udf_empty_rank]": [
+ {
+ "checksum": "4d9d71e43472550d40dfe3227598a8c4",
+ "size": 357,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_order_by_udf_empty_rank_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_over_group_by]": [
+ {
+ "checksum": "b535d342d20cdfb44e9f6c005d5748f8",
+ "size": 531,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_over_group_by_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_over_group_by_compl]": [
+ {
+ "checksum": "05ddf0d3b321b3d48bf8124b485b0e5a",
+ "size": 775,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_over_group_by_compl_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_over_group_by_list_names]": [
+ {
+ "checksum": "600ab422035618818f42b0c684fea0c7",
+ "size": 896,
+ "uri": "https://{canondata_backend}/1942100/a880b9dd7347f1ff0cee0d2e5d7cf8ac9ebf5d2e/resource.tar.gz#test_sql_format.test_window-win_func_over_group_by_list_names_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_over_group_by_list_names_order_prefix]": [
+ {
+ "checksum": "3951a8d04c0ff39103172d7c6da4ac26",
+ "size": 799,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_over_group_by_list_names_order_prefix_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_part_by_expr]": [
+ {
+ "checksum": "0fdbfc46d17f62a3de593409baac872c",
+ "size": 444,
+ "uri": "https://{canondata_backend}/1937492/1c0e0692453d29c7678c079c240ac0f6151a6821/resource.tar.gz#test_sql_format.test_window-win_func_part_by_expr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_part_by_expr_new]": [
+ {
+ "checksum": "4ed0e6a6836f1d8cf45ee05c4a6caa3d",
+ "size": 342,
+ "uri": "https://{canondata_backend}/1600758/d2be12e3cc8a37157a962bd9b58c2874635d2195/resource.tar.gz#test_sql_format.test_window-win_func_part_by_expr_new_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_percent_rank]": [
+ {
+ "checksum": "4f5c46173d8534a8dd74eaeb902e1a5c",
+ "size": 354,
+ "uri": "https://{canondata_backend}/1924537/1e6c4bd0b6a388eb0c3be13c5222f8b798f7e45c/resource.tar.gz#test_sql_format.test_window-win_func_percent_rank_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_rank_by_all]": [
+ {
+ "checksum": "7961a8077b82fc245dd4d80b4dec081a",
+ "size": 400,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_rank_by_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_rank_by_opt_all]": [
+ {
+ "checksum": "915473e20b7787761e7971b9a77f1861",
+ "size": 395,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_rank_by_opt_all_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_rank_by_opt_part]": [
+ {
+ "checksum": "b5629b0028d9add96f3bd1c7a9e7284d",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_rank_by_opt_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_rank_by_part]": [
+ {
+ "checksum": "4cb5794a9db04b8f6c091572fe84da5f",
+ "size": 556,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_rank_by_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_rank_with_order_by_aggr_key]": [
+ {
+ "checksum": "21164a46e11ebe2fd37b5d0e27103d4d",
+ "size": 149,
+ "uri": "https://{canondata_backend}/1773845/cd3d52c296919794a6890ae7e223f6edbe2dd598/resource.tar.gz#test_sql_format.test_window-win_func_rank_with_order_by_aggr_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_spec_with_part]": [
+ {
+ "checksum": "9a613d708f87222e3a7cd8a2c6c15089",
+ "size": 560,
+ "uri": "https://{canondata_backend}/1784826/7c8f5dac18511988e5aea89e0a58f14f7ec54c9b/resource.tar.gz#test_sql_format.test_window-win_func_spec_with_part_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_special]": [
+ {
+ "checksum": "c47f9e7010661b6ed20574d744ee8440",
+ "size": 424,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_special_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_with_struct_access]": [
+ {
+ "checksum": "26deea4556a49e1aa09e2170276c7470",
+ "size": 593,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_with_struct_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_func_with_struct_access_full_access]": [
+ {
+ "checksum": "e818a5051012a9685f3a2ff881c0134c",
+ "size": 600,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_func_with_struct_access_full_access_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_fuse_window]": [
+ {
+ "checksum": "a2c18b52405b78755b3d439b40df9015",
+ "size": 1274,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_fuse_window_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_group_peephole]": [
+ {
+ "checksum": "7f0abfb9d9f77e8c4dbdd13993bc9b41",
+ "size": 416,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_group_peephole_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_inline_spec]": [
+ {
+ "checksum": "43b8d92fd743428073469f2f9c61643a",
+ "size": 409,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_inline_spec_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_lead_in_mem]": [
+ {
+ "checksum": "42fa4f7dd59359485898de07301ef267",
+ "size": 373,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_lead_in_mem_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_multiaggr]": [
+ {
+ "checksum": "226bc774311b5903b3b4c690d2290155",
+ "size": 300,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_multiaggr_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_multiaggr_library]": [
+ {
+ "checksum": "c63a6f7264dcc41c7d86274afe26910e",
+ "size": 195,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_multiaggr_library_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_multiaggr_list]": [
+ {
+ "checksum": "1f358c80201c18921cd11cebda4f1c1d",
+ "size": 276,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_multiaggr_list_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_multiaggr_tuple]": [
+ {
+ "checksum": "840a151129e63364fcb103cdb1545903",
+ "size": 278,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_multiaggr_tuple_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_over_few_partitions]": [
+ {
+ "checksum": "2578e156ba8bf388e1b9c28f254dc21f",
+ "size": 551,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_over_few_partitions_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_over_few_partitions_other]": [
+ {
+ "checksum": "d88920b55e550979cd1a8c21d69272b6",
+ "size": 600,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_over_few_partitions_other_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_over_joined]": [
+ {
+ "checksum": "89a41e7d5ec1f3d53125958a63e32011",
+ "size": 217,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_over_joined_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_peephole]": [
+ {
+ "checksum": "f30b35c1d0097749f0bd9eda6cbe7986",
+ "size": 402,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_peephole_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_peephole_double_usage]": [
+ {
+ "checksum": "c7bdc19ab02dd019c588737e6df03bd3",
+ "size": 340,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_peephole_double_usage_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_with_as_table]": [
+ {
+ "checksum": "95b7d7460336468f6fb5c4fa972be57c",
+ "size": 273,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_with_as_table_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-win_with_cur_row]": [
+ {
+ "checksum": "5bfc1632b2a93350894b21ea1c0e2e0e",
+ "size": 368,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-win_with_cur_row_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-14179]": [
+ {
+ "checksum": "fcc42398ab90f03503716bd5f1892fba",
+ "size": 225,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-yql-14179_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-14277]": [
+ {
+ "checksum": "638e6bcd5d796aab03aa1a293265dda9",
+ "size": 594,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-yql-14277_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-14479]": [
+ {
+ "checksum": "853251d0e3503031ea217a35a2a22434",
+ "size": 299,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-yql-14479_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-14738]": [
+ {
+ "checksum": "fa1ddb8cbf1af9ebdd7b9ad553df31f7",
+ "size": 363,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-yql-14738_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-15636]": [
+ {
+ "checksum": "454369256d64b06efc16a296aa58cdf1",
+ "size": 720,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_window-yql-15636_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[window-yql-18879]": [
+ {
+ "checksum": "e82f980726591f4bed27ef8a7f1ac878",
+ "size": 1400,
+ "uri": "https://{canondata_backend}/1937027/7e0abe7a9623e4dd081b7634462dda3c0149635b/resource.tar.gz#test_sql_format.test_window-yql-18879_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-complex]": [
+ {
+ "checksum": "d8daa40cefd0f61a59c4bff1d2902d90",
+ "size": 121,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-complex_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-direct_read_from_dynamic]": [
+ {
+ "checksum": "29af29ec17337e07d663d6795f65a24e",
+ "size": 106,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-direct_read_from_dynamic_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-empty_range]": [
+ {
+ "checksum": "ab891d7a520c14aaceeb4cec933e07c3",
+ "size": 65,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-empty_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-limit_with_key]": [
+ {
+ "checksum": "1a6a780b467e3db0ac5387f47b1eff4d",
+ "size": 93,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-limit_with_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-limit_with_range]": [
+ {
+ "checksum": "850c51474d04657b6d411abb862dd076",
+ "size": 93,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-limit_with_range_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-multi_key]": [
+ {
+ "checksum": "5acf4a0e094da8393237d3a1ea4fb172",
+ "size": 109,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-multi_key_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[ypath-multi_range]": [
+ {
+ "checksum": "28847338b087747b311ace0a082b6f77",
+ "size": 91,
+ "uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_ypath-multi_range_/formatted.sql"
+ }
+ ],
+ "test_sql_negative.test[action-no_columns_in_do-default.txt]": [
+ {
+ "checksum": "0fad6da8e4c5a2ab2c1e5a231ea430d1",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_action-no_columns_in_do-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[action-parallel_for_commit-default.txt]": [
+ {
+ "checksum": "53afee8c11aa40b9f34e8d50d75adfd5",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1924537/81ea882379cbb6d33045aa517e56bcd05fa3ec6b/resource.tar.gz#test_sql_negative.test_action-parallel_for_commit-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[action-parallel_for_select-default.txt]": [
+ {
+ "checksum": "82522d29f3441633dfd821a58fd07b89",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1942415/2241aee432ab474d9b77948c0a7cbceef22aba8f/resource.tar.gz#test_sql_negative.test_action-parallel_for_select-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[action-parallel_for_values-default.txt]": [
+ {
+ "checksum": "f48404eb765933fed89361161cbc98d4",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1880306/be6453f88a12657a68a8a9ae9235933060c45e5a/resource.tar.gz#test_sql_negative.test_action-parallel_for_values-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[aggregate-fail_group_by_struct_member-default.txt]": [
+ {
+ "checksum": "18d827f5fa448873f5b2ad05b664be70",
+ "size": 245,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_aggregate-fail_group_by_struct_member-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[aggregate-having_without_aggregation-default.txt]": [
+ {
+ "checksum": "59ad103860c119f608fcecc67fdf1973",
+ "size": 212,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_aggregate-having_without_aggregation-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[aggregate-should_use_clone_for_bind_params-default.txt]": [
+ {
+ "checksum": "ac46ef88a4ec8cabedd78549d2be83e7",
+ "size": 165,
+ "uri": "https://{canondata_backend}/1689644/981b8cc449cb09222c7585d66080157e5f171923/resource.tar.gz#test_sql_negative.test_aggregate-should_use_clone_for_bind_params-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[aggregate-table_funcs_spec_aggregation-default.txt]": [
+ {
+ "checksum": "5e297eff28613127818d3ae9c1b0e2d7",
+ "size": 160,
+ "uri": "https://{canondata_backend}/937458/cf14cb248f614fa5267c8f5f5720d9dec1206442/resource.tar.gz#test_sql_negative.test_aggregate-table_funcs_spec_aggregation-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_concat_binding_bad1-default.txt]": [
+ {
+ "checksum": "8706c5758b34b985716de882d25dfb8c",
+ "size": 113,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_concat_binding_bad1-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_concat_binding_bad2-default.txt]": [
+ {
+ "checksum": "908cc01bc434c72a6a782e45b16d7446",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_concat_binding_bad2-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_concat_binding_bad3-default.txt]": [
+ {
+ "checksum": "df6880cbda24082f458182aa91e41cfe",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_concat_binding_bad3-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_from_binding_bad1-default.txt]": [
+ {
+ "checksum": "e31557669a8fa8e82edba8b9deaa7f25",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_from_binding_bad1-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_from_binding_bad2-default.txt]": [
+ {
+ "checksum": "cb768edc0bcf1c07af66fb046cc51f12",
+ "size": 102,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_from_binding_bad2-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_from_binding_bad3-default.txt]": [
+ {
+ "checksum": "799bc99d55c0040bcfa77f127c1bc27a",
+ "size": 104,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_from_binding_bad3-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[binding-table_from_binding_bad4-default.txt]": [
+ {
+ "checksum": "7e4d42a809d0497ed93c8fd32d89b17c",
+ "size": 101,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_binding-table_from_binding_bad4-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_struct_0-default.txt]": [
+ {
+ "checksum": "24fecad0dce7ae5b6c51087e032fc23e",
+ "size": 143,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_struct_0-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_struct_1-default.txt]": [
+ {
+ "checksum": "42da900e5def939960b1b06db188e745",
+ "size": 202,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_struct_1-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_struct_2-default.txt]": [
+ {
+ "checksum": "d58ae46faf75203195f4386e814a3108",
+ "size": 108,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_struct_2-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_struct_3-default.txt]": [
+ {
+ "checksum": "26a4e834ccc7157985c47c3d3ff1bb70",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_struct_3-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_table_args-default.txt]": [
+ {
+ "checksum": "8a95fb6c756523737f3e8cdaeb3465a3",
+ "size": 134,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_table_args-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_table_cluster-default.txt]": [
+ {
+ "checksum": "a456d6a0613c25028fbf379d7e9277f6",
+ "size": 142,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_table_cluster-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_table_hints-default.txt]": [
+ {
+ "checksum": "d69f3c1b7fb70dfd048aaf6b2369863d",
+ "size": 129,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_table_hints-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_table_subquery-default.txt]": [
+ {
+ "checksum": "818bfc6a4f92c01e65ada90087c0b68b",
+ "size": 133,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_table_subquery-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[expr-as_tuple_named-default.txt]": [
+ {
+ "checksum": "ad2969e32e499ba572033a540f9674cc",
+ "size": 206,
+ "uri": "https://{canondata_backend}/1942415/27d093fb4903da4b5af596ea6d8fed1bfad00643/resource.tar.gz#test_sql_negative.test_expr-as_tuple_named-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[flatten_by-struct_with_wrong_correlation-default.txt]": [
+ {
+ "checksum": "5362cc94a32ae614cc3808035e96d473",
+ "size": 388,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_flatten_by-struct_with_wrong_correlation-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[flatten_by-table_funcs_spec_flatten_by-default.txt]": [
+ {
+ "checksum": "5eaf895715111d3b42d31efd973c230a",
+ "size": 138,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_flatten_by-table_funcs_spec_flatten_by-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[in-in_with_subquery_where-default.txt]": [
+ {
+ "checksum": "5ed6af7841b5567157469d9f90280851",
+ "size": 163,
+ "uri": "https://{canondata_backend}/1599023/86cf19f55af14a77f8023fa12720c75ef33b7ec9/resource.tar.gz#test_sql_negative.test_in-in_with_subquery_where-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[join-join_and_distinct_key_without_correlation-default.txt]": [
+ {
+ "checksum": "6437a9515880c0a61c7dc62801d670c2",
+ "size": 313,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_join-join_and_distinct_key_without_correlation-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[join-join_with_dot_without_alias-]": [
+ {
+ "checksum": "f22a6090d479fbd08554da12f92ffeec",
+ "size": 186,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_join-join_with_dot_without_alias-_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[join-table_funcs_spec_join-default.txt]": [
+ {
+ "checksum": "1f149d818978ac928c324df9c637318d",
+ "size": 152,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_join-table_funcs_spec_join-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[join-wrong_order_by_col-default.txt]": [
+ {
+ "checksum": "39735b2aee60dfb988a00544fd34eb73",
+ "size": 317,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_join-wrong_order_by_col-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[lambda-lambda_duplicate_arg-default.txt]": [
+ {
+ "checksum": "acbe352ba15036e7e3a19a8f668c46c9",
+ "size": 141,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_lambda-lambda_duplicate_arg-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[lambda-lambda_no_aggrs-default.txt]": [
+ {
+ "checksum": "e37cc8092534d3543d53f191d64add5e",
+ "size": 105,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_lambda-lambda_no_aggrs-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[lambda-lambda_no_columns-default.txt]": [
+ {
+ "checksum": "5763cbd8f5d0547508c019b5f8b553e3",
+ "size": 120,
+ "uri": "https://{canondata_backend}/1931696/78c66720cff15b185b99266c3af3e05374467fbb/resource.tar.gz#test_sql_negative.test_lambda-lambda_no_columns-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[lambda-lambda_no_dollar_arg-default.txt]": [
+ {
+ "checksum": "3e0ef08f5da9f6c4c3c1f01f0a177b2f",
+ "size": 377,
+ "uri": "https://{canondata_backend}/1931696/78c66720cff15b185b99266c3af3e05374467fbb/resource.tar.gz#test_sql_negative.test_lambda-lambda_no_dollar_arg-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[lambda-lambda_no_dollar_assign-default.txt]": [
+ {
+ "checksum": "68fdd4a5658a392623fcdad598463f01",
+ "size": 267,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_lambda-lambda_no_dollar_assign-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[order_by-order_by_subquery-default.txt]": [
+ {
+ "checksum": "373a17f049d856da759cae5496b6c772",
+ "size": 673,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_order_by-order_by_subquery-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[pragma-classic_division-default.txt]": [
+ {
+ "checksum": "65a7b8293278415ffa823662ca911a21",
+ "size": 150,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_pragma-classic_division-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[pragma-messages-default.txt]": [
+ {
+ "checksum": "0842060cf09e8e67fc1e59c57fc509e4",
+ "size": 406,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_pragma-messages-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[pragma-messages_warning_action-default.txt]": [
+ {
+ "checksum": "79fe8f4886f3815d647a74c42086a42c",
+ "size": 319,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_pragma-messages_warning_action-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[select-autoextract_source_value_in_where-default.txt]": [
+ {
+ "checksum": "0a04f9617e0bd69931c6f09f4579ad25",
+ "size": 237,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_select-autoextract_source_value_in_where-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[select-normalize_name-default.txt]": [
+ {
+ "checksum": "670c9672ee56104d5324dfa1ff35e518",
+ "size": 137,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_select-normalize_name-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[select-qualified_all_and_group_by-default.txt]": [
+ {
+ "checksum": "6b0711cbe4442be17fbab7421a63bdb2",
+ "size": 210,
+ "uri": "https://{canondata_backend}/937458/cf14cb248f614fa5267c8f5f5720d9dec1206442/resource.tar.gz#test_sql_negative.test_select-qualified_all_and_group_by-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[select-table_funcs_spec_flatten_by.sql_gb_gs-default.txt]": [
+ {
+ "checksum": "5eaf895715111d3b42d31efd973c230a",
+ "size": 138,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_select-table_funcs_spec_flatten_by.sql_gb_gs-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[select-use_subrequest_as_table-default.txt]": [
+ {
+ "checksum": "b487c7081e29ca693370513c4786c0b5",
+ "size": 134,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_select-use_subrequest_as_table-default.txt_/err_file_v1.out"
+ }
+ ],
+ "test_sql_negative.test[udf-named_args_for_script_with_wrong_order-default.txt]": [
+ {
+ "checksum": "e366faf0a12a73e0040753ae74cf0a55",
+ "size": 180,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_udf-named_args_for_script_with_wrong_order-default.txt_/err_file_v1.out"
+ }
+ ],
+ "test_sql_negative.test[union_all-union_all_with_top_level_limits-default.txt]": [
+ {
+ "checksum": "cef00afbcdfa2a07b6b3724865dc1a22",
+ "size": 161,
+ "uri": "https://{canondata_backend}/1942173/79b1ce458deca8dbc4c2b729963a9f308a1a24ac/resource.tar.gz#test_sql_negative.test_union_all-union_all_with_top_level_limits-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[weak_field-weak_field_join_no_src-default.txt]": [
+ {
+ "checksum": "3a0d55db3a3f6e446904e78518f765d5",
+ "size": 397,
+ "uri": "https://{canondata_backend}/937458/21d1736fbc1200e4901ad02994f0d46594e212df/resource.tar.gz#test_sql_negative.test_weak_field-weak_field_join_no_src-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[weak_field-weak_field_list_type-default.txt]": [
+ {
+ "checksum": "183eb472762118685fd1692edc85a12d",
+ "size": 537,
+ "uri": "https://{canondata_backend}/1900335/2368a128e7310bddf15695f3e4b4ff47025ef811/resource.tar.gz#test_sql_negative.test_weak_field-weak_field_list_type-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[window-table_funcs_spec_win_func-default.txt]": [
+ {
+ "checksum": "67a45f8535677d93eb4dd6f6dec64d82",
+ "size": 167,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_window-table_funcs_spec_win_func-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[window-table_funcs_spec_with_win_func-default.txt]": [
+ {
+ "checksum": "750134cd9f0c817b2527b565756c5c83",
+ "size": 182,
+ "uri": "https://{canondata_backend}/1936997/f4bbe2471ffe783d223031755d813351406a3697/resource.tar.gz#test_sql_negative.test_window-table_funcs_spec_with_win_func-default.txt_/err_file_v0.out"
+ }
+ ],
+ "test_sql_negative.test[window-win_aggregate_check01-default.txt]": [
+ {
+ "checksum": "3c135e9eccd2b27458ce94c2993172ed",
+ "size": 187,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_window-win_aggregate_check01-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[window-win_aggregate_check02-default.txt]": [
+ {
+ "checksum": "dce797f1dc866c55bd39fcf23757fec9",
+ "size": 286,
+ "uri": "https://{canondata_backend}/1923547/d4a40b8dc00b9fd8e4cceadb8bcb11779bfdfafc/resource.tar.gz#test_sql_negative.test_window-win_aggregate_check02-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[window-win_func_over_group_by_with_having-default.txt]": [
+ {
+ "checksum": "63b6de2840d2738a5e2f9161b402d88f",
+ "size": 259,
+ "uri": "https://{canondata_backend}/1814674/6a8bf9820608e7ebd4417359d9a69ceb5de8b251/resource.tar.gz#test_sql_negative.test_window-win_func_over_group_by_with_having-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[window-win_func_over_group_by_with_where-default.txt]": [
+ {
+ "checksum": "3603a530d348aa85de9fc8037228e89e",
+ "size": 260,
+ "uri": "https://{canondata_backend}/1814674/6a8bf9820608e7ebd4417359d9a69ceb5de8b251/resource.tar.gz#test_sql_negative.test_window-win_func_over_group_by_with_where-default.txt_/err_file.out"
+ }
+ ],
+ "test_sql_negative.test[window-win_func_with_group_by-default.txt]": [
+ {
+ "checksum": "328676c084b002b87c703412e9f8cc2a",
+ "size": 147,
+ "uri": "https://{canondata_backend}/937458/cf14cb248f614fa5267c8f5f5720d9dec1206442/resource.tar.gz#test_sql_negative.test_window-win_func_with_group_by-default.txt_/err_file.out"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/sql2yql/test_sql2yql.py b/yql/essentials/tests/sql/sql2yql/test_sql2yql.py
new file mode 100644
index 0000000000..59669e66a3
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/test_sql2yql.py
@@ -0,0 +1,64 @@
+import os
+
+import yatest.common
+
+from test_utils import pytest_generate_tests_by_template, DATA_PATH, SQLRUN_PATH, SQL_FLAGS
+
+
+def pytest_generate_tests(metafunc):
+ return pytest_generate_tests_by_template('.sql', metafunc)
+
+
+def get_sql2yql_cmd(suite, case, case_file, out_dir, ansi_lexer, test_format, test_double_format):
+ cmd = [
+ SQLRUN_PATH,
+ case_file,
+ '--syntax-version=1',
+ '--test-antlr4',
+ ]
+
+ if ansi_lexer:
+ cmd.append('--ansi-lexer')
+ if test_format:
+ cmd.append('--test-format')
+ cmd.append('--format-output=%s' % os.path.join(out_dir, 'formatted.sql'))
+ if test_double_format:
+ cmd.append('--test-double-format')
+ else:
+ cmd.append('--yql')
+ cmd.append('--output=%s' % os.path.join(out_dir, 'sql.yql'))
+ if suite == 'kikimr':
+ cmd.append('--cluster=plato@kikimr')
+ if suite == 'rtmr':
+ cmd.append('--cluster=plato@rtmr')
+ if case.startswith('solomon'):
+ cmd.append('--cluster=local_solomon@solomon')
+
+ if suite == 'rtmr_ydb':
+ cmd.append('--cluster=plato@rtmr')
+ cmd.append('--cluster=local@kikimr')
+ if suite == 'streaming':
+ cmd.append('--cluster=pq@pq')
+ cmd.append('--cluster=solomon@solomon')
+ if suite == 'solomon':
+ cmd.append('--cluster=local_solomon@solomon')
+
+ if SQL_FLAGS:
+ cmd.append('--flags=%s' % ','.join(SQL_FLAGS))
+
+ return cmd
+
+
+def test(suite, case, tmpdir):
+ files = []
+ # case can contain slash because of nested suites
+ out_dir = tmpdir.mkdir(suite).mkdir(case.replace('/', '_')).dirname
+ case_file = os.path.join(DATA_PATH, suite, '%s.sql' % case)
+ with open(case_file, 'r') as f:
+ content = f.read()
+ ansi_lexer = 'ansi_lexer' in content
+ cmd = get_sql2yql_cmd(suite, case, case_file, out_dir, ansi_lexer, test_format=False, test_double_format=False)
+ yatest.common.process.execute(cmd, env={'YQL_DETERMINISTIC_MODE': '1'})
+ files.append(os.path.join(out_dir, 'sql.yql'))
+
+ return [yatest.common.canonical_file(file_name) for file_name in files]
diff --git a/yql/essentials/tests/sql/sql2yql/test_sql_format.py b/yql/essentials/tests/sql/sql2yql/test_sql_format.py
new file mode 100644
index 0000000000..39780d7af9
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/test_sql_format.py
@@ -0,0 +1,29 @@
+import os
+import yatest.common
+import pytest
+
+from test_sql2yql import get_sql2yql_cmd
+from test_utils import pytest_generate_tests_by_template, DATA_PATH
+
+
+def pytest_generate_tests(metafunc):
+ return pytest_generate_tests_by_template('.sql', metafunc)
+
+
+def test(suite, case, tmpdir):
+ files = []
+ # case can contain slash because of nested suites
+ out_dir = tmpdir.mkdir(suite).mkdir(case.replace('/', '_')).dirname
+ case_file = os.path.join(DATA_PATH, suite, '%s.sql' % case)
+ ansi_lexer = False
+ with open(case_file, 'r') as f:
+ content = f.read()
+ ansi_lexer = 'ansi_lexer' in content
+ test_double_format = 'skip double format' not in content
+ if 'syntax_pg' in content:
+ pytest.skip('syntax_pg')
+ cmd = get_sql2yql_cmd(suite, case, case_file, out_dir=out_dir, ansi_lexer=ansi_lexer, test_format=True, test_double_format=test_double_format)
+ yatest.common.process.execute(cmd, env={'YQL_DETERMINISTIC_MODE': '1'})
+ files.append(os.path.join(out_dir, 'formatted.sql'))
+
+ return [yatest.common.canonical_file(file_name) for file_name in files]
diff --git a/yql/essentials/tests/sql/sql2yql/test_sql_negative.py b/yql/essentials/tests/sql/sql2yql/test_sql_negative.py
new file mode 100644
index 0000000000..bf43ed43f1
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/test_sql_negative.py
@@ -0,0 +1,68 @@
+import os
+import pytest
+import yatest.common
+from yql_utils import get_supported_providers, get_param
+
+from test_utils import pytest_generate_tests_for_run, get_config, SQLRUN_PATH, DATA_PATH
+
+NEGATIVE_TEMPLATE = '.sqlx'
+
+
+def pytest_generate_tests(metafunc):
+ pytest_generate_tests_for_run(metafunc, NEGATIVE_TEMPLATE)
+
+
+def run_sql2yql(program_sql, out_dir, err_file_path):
+ def out_file(name):
+ return os.path.join(out_dir, name)
+
+ # translate sql to yql
+ program_yql = out_file('program.yql')
+
+ cmd_sql = [
+ SQLRUN_PATH,
+ '--yql',
+ '--output=' + program_yql,
+ '--syntax-version=1',
+ '/dev/stdin',
+ ]
+ with open(program_sql) as f:
+ sql_res = yatest.common.process.execute(cmd_sql, check_exit_code=False, stdin=f, env={'YQL_DETERMINISTIC_MODE': '1'})
+
+ if sql_res.exit_code:
+ sql_stderr = sql_res.std_err.strip()
+ assert sql_stderr
+ with open(err_file_path, 'wb') as err_file:
+ err_file.write(sql_stderr)
+
+ return sql_res
+
+
+def test(suite, case, cfg, tmpdir):
+ config = get_config(suite, case, cfg)
+
+ if 'yt' not in get_supported_providers(config):
+ pytest.skip('YT provider is not supported here')
+
+ if get_param('TARGET_PLATFORM'):
+ if "yson" in case:
+ pytest.skip('yson is not supported on non-default target platform')
+
+ program_sql = os.path.join(DATA_PATH, suite, case + NEGATIVE_TEMPLATE)
+ out_dir = tmpdir.mkdir(suite).mkdir(case).dirname
+ files = []
+
+ err_file_path = os.path.join(out_dir, 'err_file.out')
+ res = run_sql2yql(program_sql, out_dir, err_file_path)
+
+ with open(program_sql) as f:
+ program_sql_content = f.read()
+
+ assert res.exit_code != 0, 'execute finished without error, on file: %s, query:\n%s' % \
+ (program_sql, program_sql_content)
+ assert os.path.getsize(err_file_path) > 0, 'exit code is %d, but error is empty, on file: %s, query:\n%s' % \
+ (res.exit_code, program_sql, program_sql_content)
+
+ files.append(err_file_path)
+
+ return [yatest.common.canonical_file(file_name) for file_name in files]
diff --git a/yql/essentials/tests/sql/sql2yql/ya.make b/yql/essentials/tests/sql/sql2yql/ya.make
new file mode 100644
index 0000000000..f6f5df53a0
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/ya.make
@@ -0,0 +1,44 @@
+PY3TEST()
+ TEST_SRCS(
+ test_sql2yql.py
+ test_sql_negative.py
+ test_sql_format.py
+ )
+
+IF (SANITIZER_TYPE OR NOT OPENSOURCE)
+ REQUIREMENTS(ram:12)
+ENDIF()
+
+IF (SANITIZER_TYPE)
+ TIMEOUT(1800)
+ SIZE(LARGE)
+ TAG(ya:fat sb:ttl=2)
+ELSE()
+ TIMEOUT(600)
+ SIZE(MEDIUM)
+ TAG(sb:ttl=2)
+ENDIF()
+
+ FORK_TESTS()
+ FORK_SUBTESTS()
+ SPLIT_FACTOR(5)
+ DEPENDS(
+ yql/essentials/tools/sql2yql
+ yql/essentials/tools/sql_formatter
+ contrib/libs/protobuf/python
+ )
+ DATA(
+ arcadia/yql/essentials/tests/sql/suites
+ arcadia/yql/essentials/mount
+ arcadia/yql/essentials/cfg/tests
+ )
+ PEERDIR(
+ yql/essentials/tests/common/test_framework
+ library/python/testing/swag/lib
+ )
+
+
+NO_CHECK_IMPORTS()
+
+END()
+
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_and_table.sql b/yql/essentials/tests/sql/suites/action/action_eval_cluster_and_table.sql
new file mode 100644
index 0000000000..414f54ac9d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_and_table.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$cluster = "pla" || "to";
+$name = "In" || "put";
+
+SELECT
+ count(*)
+FROM yt:$cluster.$name;
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.cfg b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.sql b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.sql
new file mode 100644
index 0000000000..67e2af6063
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
+
+insert into yt:$foo.Output
+select *
+from yt:$foo.Input
+where key < "100"
+order by key;
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.cfg b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.sql b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.sql
new file mode 100644
index 0000000000..56554226fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_table_for.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $a($x) as
+ $foo = CAST(Unicode::ToLower($x) AS String);
+
+ insert into yt:$foo.Output
+ select *
+ from yt:$foo.Input
+ where key < "100"
+ order by key;
+
+end define;
+
+evaluate for $i in AsList("PLATO"u) do $a($i);
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.cfg b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.sql b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.sql
new file mode 100644
index 0000000000..7635ba2d17
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
+use yt:$foo;
+
+insert into Output
+select *
+from Input
+where key < "100"
+order by key;
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.cfg b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.cfg
new file mode 100644
index 0000000000..fccca71d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.sql b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.sql
new file mode 100644
index 0000000000..08994c5615
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_eval_cluster_use_compact_named_exprs.sql
@@ -0,0 +1,20 @@
+/* yt can not */
+pragma CompactNamedExprs;
+$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
+
+insert into yt:$foo.Output
+select *
+from yt:$foo.Input
+where key < "100"
+order by key;
+
+define action $bar() as
+ $x = CAST(Unicode::ToLower("PLaTO"u) AS String);
+ insert into yt:$x.Output
+ select *
+ from yt:$foo.Input
+ where key < "100"
+ order by key;
+end define;
+
+do $bar();
diff --git a/yql/essentials/tests/sql/suites/action/action_nested_query.sql b/yql/essentials/tests/sql/suites/action/action_nested_query.sql
new file mode 100644
index 0000000000..0d6e87d794
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_nested_query.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+define action $action() as
+ $sub = (select * from Input);
+ select * from $sub order by key;
+end define;
+
+do $action();
diff --git a/yql/essentials/tests/sql/suites/action/action_opt_args.sql b/yql/essentials/tests/sql/suites/action/action_opt_args.sql
new file mode 100644
index 0000000000..b577b12a5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_opt_args.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $action($a,$b?) as
+ select $a + ($b ?? 0);
+end define;
+
+do $action(1);
+do $action(2, 3);
diff --git a/yql/essentials/tests/sql/suites/action/action_udf_args.cfg b/yql/essentials/tests/sql/suites/action/action_udf_args.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_udf_args.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/action_udf_args.sql b/yql/essentials/tests/sql/suites/action/action_udf_args.sql
new file mode 100644
index 0000000000..16f7eefcaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/action_udf_args.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $f($x) as
+ select $x;
+end define;
+
+$x = CAST(Unicode::ToUpper("abc"u) AS String);
+do $f($x);
diff --git a/yql/essentials/tests/sql/suites/action/closure_action.sql b/yql/essentials/tests/sql/suites/action/closure_action.sql
new file mode 100644
index 0000000000..3008cf3a1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/closure_action.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $action($b,$c) as
+ $d = $b + $c;
+ select $b;
+ select $c;
+ select $d;
+end define;
+
+define action $closure_action($a) as
+ do $a(3,4);
+end define;
+
+do $closure_action($action);
diff --git a/yql/essentials/tests/sql/suites/action/combine_subqueries_with_table_param.sql b/yql/essentials/tests/sql/suites/action/combine_subqueries_with_table_param.sql
new file mode 100644
index 0000000000..542493b3af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/combine_subqueries_with_table_param.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$combineQueries = ($query, $list) -> {
+ RETURN EvaluateCode(LambdaCode(($world) -> {
+ $queries = ListMap($list, ($arg)->{
+ RETURN FuncCode("Apply", QuoteCode($query), $world, ReprCode($arg))
+ });
+
+ RETURN FuncCode("UnionAll", $queries);
+ }));
+};
+
+DEFINE SUBQUERY $calc($table) AS
+ SELECT *
+ FROM $table;
+END DEFINE;
+
+$fullQuery = $combineQueries($calc, AsList("Input", "Input"));
+
+SELECT count(*) FROM $fullQuery();
diff --git a/yql/essentials/tests/sql/suites/action/default.cfg b/yql/essentials/tests/sql/suites/action/default.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/define_simple_action.sql b/yql/essentials/tests/sql/suites/action/define_simple_action.sql
new file mode 100644
index 0000000000..60244b3b48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/define_simple_action.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $action($b,$c) as
+ $d = $b + $c;
+ select $b;
+ select $c;
+ select $d;
+end define;
+
+do $action(1,2);
diff --git a/yql/essentials/tests/sql/suites/action/dep_world_action_quote.sql b/yql/essentials/tests/sql/suites/action/dep_world_action_quote.sql
new file mode 100644
index 0000000000..6375e06aee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/dep_world_action_quote.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+DEFINE ACTION $aaa($z) as
+
+$table = $z.0;
+$k = (select min(key || $z.1) from $table);
+
+DEFINE ACTION $bbb($n) AS
+ SELECT $n || $k FROM $table;
+END DEFINE;
+
+$ccc = EvaluateCode(QuoteCode($bbb));
+DO $ccc("1");
+
+END DEFINE;
+
+EVALUATE FOR $z IN AsList(AsTuple("Input","foo"),AsTuple("Input","bar"))
+ DO $aaa($z);
diff --git a/yql/essentials/tests/sql/suites/action/dep_world_quote_code.sql b/yql/essentials/tests/sql/suites/action/dep_world_quote_code.sql
new file mode 100644
index 0000000000..6188630666
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/dep_world_quote_code.sql
@@ -0,0 +1,31 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$combineQueries = ($query, $list) -> {
+ RETURN EvaluateCode(LambdaCode(($world) -> {
+ $queries = ListMap($list, ($arg) -> {
+ RETURN FuncCode("Apply", QuoteCode($query), $world, ReprCode($arg))
+ });
+
+ RETURN FuncCode("Extend", $queries);
+ }));
+};
+
+DEFINE ACTION $aaa($z) as
+
+$k = (select count(*) from $z);
+
+DEFINE SUBQUERY $sub($n) AS
+ SELECT $n + $k FROM $z;
+END DEFINE;
+
+$fullQuery = $combineQueries($sub, ListFromRange(0, 10));
+SELECT * FROM $fullQuery();
+
+END DEFINE;
+
+EVALUATE FOR $z IN AsList("Input")
+ DO $aaa($z);
+
+DO $aaa("Input");
diff --git a/yql/essentials/tests/sql/suites/action/discard.sql b/yql/essentials/tests/sql/suites/action/discard.sql
new file mode 100644
index 0000000000..ccdac00de8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/discard.sql
@@ -0,0 +1,32 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $a() as
+$_x = select 1;
+discard
+select ensure(1, true);
+select 2;
+$_y = select 2;
+end define;
+
+process $a();
+
+
+define subquery $b() as
+$f1 = ($row)->(<|a:1,b:$row.value|>);
+$f2 = ($row)->(<|a:2,b:$row.value|>);
+discard
+process plato.Input using $f1(TableRow());
+process plato.Input using $f2(TableRow());
+end define;
+
+select * from $b() order by b limit 1;
+
+define subquery $c() as
+$f1 = ($key,$_)->(<|a:1,b:$key|>);
+$f2 = ($key,$_)->(<|a:2,b:$key|>);
+discard
+reduce plato.Input on key using $f1(TableRow());
+reduce plato.Input on key using $f2(TableRow());
+end define;
+
+select * from $c() order by b limit 1;
diff --git a/yql/essentials/tests/sql/suites/action/empty_do.sql b/yql/essentials/tests/sql/suites/action/empty_do.sql
new file mode 100644
index 0000000000..3b30a5803c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/empty_do.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+do empty_action();
+
+$action1 = empty_action;
+
+do $action1();
+
+$action2 = ($a,$_b)->{
+ return $a;
+};
+
+do $action2(12);
diff --git a/yql/essentials/tests/sql/suites/action/eval_anon_table.cfg b/yql/essentials/tests/sql/suites/action/eval_anon_table.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_anon_table.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_anon_table.sql b/yql/essentials/tests/sql/suites/action/eval_anon_table.sql
new file mode 100644
index 0000000000..449fbd3b83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_anon_table.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = CAST(Unicode::ToUpper("T"u) AS String) || "able";
+$b = CAST(Unicode::ToUpper("T"u) AS String) || "able";
+
+insert into @$a
+select 1 as x;
+
+commit;
+
+select * from @$b;
diff --git a/yql/essentials/tests/sql/suites/action/eval_asatom.sql b/yql/essentials/tests/sql/suites/action/eval_asatom.sql
new file mode 100644
index 0000000000..ca169899ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_asatom.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT Yql::String(AsAtom("a" || CAST(Unicode::ToUpper("b"u) AS String)));
diff --git a/yql/essentials/tests/sql/suites/action/eval_astagged.sql b/yql/essentials/tests/sql/suites/action/eval_astagged.sql
new file mode 100644
index 0000000000..89c4b9bcab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_astagged.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT AsTagged(0, CAST(Unicode::ToUpper("t"u) AS String) || "ag");
diff --git a/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.cfg b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.cfg
new file mode 100644
index 0000000000..bc27f4ed21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.cfg
@@ -0,0 +1,3 @@
+xfail
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.sql b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.sql
new file mode 100644
index 0000000000..9e8a2a8c6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.sql
@@ -0,0 +1,7 @@
+/* yt can not */
+use plato;
+
+$n = ["foo"];
+
+select * from $n;
+
diff --git a/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.cfg b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.cfg
new file mode 100644
index 0000000000..bc27f4ed21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.cfg
@@ -0,0 +1,3 @@
+xfail
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.sql b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.sql
new file mode 100644
index 0000000000..7de917ef03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.sql
@@ -0,0 +1,7 @@
+/* yt can not */
+use plato;
+
+declare $n as List<String>?;
+
+select * from $n;
+
diff --git a/yql/essentials/tests/sql/suites/action/eval_capture.cfg b/yql/essentials/tests/sql/suites/action/eval_capture.cfg
new file mode 100644
index 0000000000..c6a659f7de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_capture.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_capture.sql b/yql/essentials/tests/sql/suites/action/eval_capture.sql
new file mode 100644
index 0000000000..b60a8c4a2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_capture.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$capture = Re2::Capture(".*" || CAST(Unicode::ToLower("(\\D+)"u) AS String) || ".*");
+SELECT $capture(" 123 ");
diff --git a/yql/essentials/tests/sql/suites/action/eval_code.sql b/yql/essentials/tests/sql/suites/action/eval_code.sql
new file mode 100644
index 0000000000..10d0360aea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_code.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+select EvaluateCode(FuncCode("Int32",AtomCode("1")));
+
+$inc = EvaluateCode(LambdaCode(($x)->{return
+ FuncCode("+", $x, FuncCode("Int32", AtomCode("1")))}));
+select $inc(1);
+
+$addPrefixForMembers = ($strValue)->{
+ $code = EvaluateCode(LambdaCode(($str)->{
+ $members = StructTypeComponents(TypeHandle(TypeOf($strValue)));
+ $list = ListMap($members, ($x)->{
+ return ListCode(AtomCode("prefix" || $x.Name),FuncCode("Member", $str, AtomCode($x.Name)));
+ });
+
+ return FuncCode("AsStruct",$list);
+ }));
+ return $code($strValue);
+};
+
+select $addPrefixForMembers(AsStruct(1 as foo, "2" as bar));
+
diff --git a/yql/essentials/tests/sql/suites/action/eval_code_nested.sql b/yql/essentials/tests/sql/suites/action/eval_code_nested.sql
new file mode 100644
index 0000000000..e730cf7d71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_code_nested.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+select EvaluateCode(
+ ReprCode(1));
+
+select EvaluateCode(
+ FuncCode("EvaluateCode",
+ FuncCode("ReprCode", ReprCode(1))));
+
+select EvaluateCode(
+ FuncCode("EvaluateCode",
+ FuncCode("ReprCode",
+ FuncCode("EvaluateCode",
+ FuncCode("ReprCode", ReprCode(1))))));
+
+select EvaluateCode(
+ FuncCode("EvaluateExpr",
+ QuoteCode(1 + 2)));
diff --git a/yql/essentials/tests/sql/suites/action/eval_column.cfg b/yql/essentials/tests/sql/suites/action/eval_column.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_column.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_column.sql b/yql/essentials/tests/sql/suites/action/eval_column.sql
new file mode 100644
index 0000000000..98838fb5fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_column.sql
@@ -0,0 +1,34 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$x = CAST(Unicode::ToLower("foo"u) AS String);
+select AsStruct("1" as foo, 2 as bar).$x;
+
+$x = CAST(Unicode::ToLower("value"u) AS String);
+select key, t.$x from Input as t order by key;
+
+$x = CAST(Unicode::ToLower("value"u) AS String);
+select key, TableRow().$x from Input order by key;
+
+
+$x = CAST(Unicode::ToLower("value"u) AS String);
+select * from Input as t order by t.$x;
+
+$x = CAST(Unicode::ToLower("value"u) AS String);
+$y = CAST(Unicode::ToLower("key"u) AS String);
+
+select x,count(*) from Input as t group by t.$x as x
+having min(t.$y) != ""
+order by x;
+
+select a.$x as x,b.$y as y from Input as a join Input as b on (a.$x = b.$x)
+order by x;
+
+select a.$x as x,b.$y as y from Input as a join Input as b using ($x)
+order by x;
+
+select p, value, lag(value) over w as lag
+from Input
+window w as (partition by TableRow().$y as p order by TableRow().$x)
+order by p, value;
diff --git a/yql/essentials/tests/sql/suites/action/eval_drop.cfg b/yql/essentials/tests/sql/suites/action/eval_drop.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_drop.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_drop.sql b/yql/essentials/tests/sql/suites/action/eval_drop.sql
new file mode 100644
index 0000000000..c5275e2801
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_drop.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$path = (select min(Path) from folder(""));
+
+drop table $path; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/eval_each_input_table.sql b/yql/essentials/tests/sql/suites/action/eval_each_input_table.sql
new file mode 100644
index 0000000000..45514cb512
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_each_input_table.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$a = ListMap(ListFromRange(0,2), ($_x)->(CAST(Unicode::ToUpper("i"u) AS String) || "nput"));
+select count(*) FROM each($a view raw);
+
+$a = ListMap(ListFromRange(0,1), ($_x)->(CAST(Unicode::ToUpper("i"u) AS String) || "nput"));
+select count(*) FROM each_strict($a);
diff --git a/yql/essentials/tests/sql/suites/action/eval_ensuretype.sql b/yql/essentials/tests/sql/suites/action/eval_ensuretype.sql
new file mode 100644
index 0000000000..7a21c20868
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_ensuretype.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT EnsureType("a", String, CAST(Unicode::ToUpper("me"u) AS String) || "ssage");
diff --git a/yql/essentials/tests/sql/suites/action/eval_extract.sql b/yql/essentials/tests/sql/suites/action/eval_extract.sql
new file mode 100644
index 0000000000..fd9ab0db2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_extract.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$list = AsList(AsStruct(1 as One, "2" as Two), AsStruct(3 as One, "4" as Two));
+SELECT ListExtract($list, CAST(Unicode::ToUpper("o"u) AS String) || "ne");
diff --git a/yql/essentials/tests/sql/suites/action/eval_filter.cfg b/yql/essentials/tests/sql/suites/action/eval_filter.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_filter.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_filter.sql b/yql/essentials/tests/sql/suites/action/eval_filter.sql
new file mode 100644
index 0000000000..7fb11ebe59
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_filter.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$arg1 = "" || "";
+$arg2 = ($_item)->{return true};
+$arg3 = "" || "";
+$arg4 = "" || "raw";
+
+SELECT
+ count(*)
+FROM FILTER($arg1,$arg2,$arg3,$arg4);
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder.cfg b/yql/essentials/tests/sql/suites/action/eval_folder.cfg
new file mode 100644
index 0000000000..9d0a494107
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder.cfg
@@ -0,0 +1 @@
+in Input input_attrs.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder.sql b/yql/essentials/tests/sql/suites/action/eval_folder.sql
new file mode 100644
index 0000000000..fbe663bcac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT * FROM Folder(``,"foo;bar");
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder_via_file.cfg b/yql/essentials/tests/sql/suites/action/eval_folder_via_file.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder_via_file.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder_via_file.sql b/yql/essentials/tests/sql/suites/action/eval_folder_via_file.sql
new file mode 100644
index 0000000000..2121ea69c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder_via_file.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.FolderInlineItemsLimit="0";
+
+$list = (
+ select aggregate_list(Path) from (
+ select Path from folder("")
+ where Type = "table"
+ limit 30
+ )
+);
+
+select
+ count(*)
+from
+ each($list)
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.cfg b/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.sql b/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.sql
new file mode 100644
index 0000000000..10ed2ec09c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_folder_via_file_in_job.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.FolderInlineItemsLimit="0";
+
+$script = @@
+def f(s):
+ return True
+@@;
+
+$callable = Python3::f(Callable<(String)->Bool>,$script);
+
+$list = (
+ select aggregate_list(Path) from (
+ select Path from folder("")
+ where Type = "table" and $callable(Path)
+ limit 30
+ )
+);
+
+select
+ count(*)
+from
+ each($list)
diff --git a/yql/essentials/tests/sql/suites/action/eval_for.sql b/yql/essentials/tests/sql/suites/action/eval_for.sql
new file mode 100644
index 0000000000..71427f2fde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_for.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+define action $action1($x) as
+ select $x;
+end define;
+
+$f = ($i)->{
+ return CAST(Unicode::ToUpper(cast($i as Utf8)) AS String);
+};
+
+evaluate for $i in ListMap(ListFromRange(0,3),$f) do $action1($i);
+
+evaluate for $i in ListMap(ListFromRange(0,0),$f) do $action1($i) else do $action1(100);
+
+evaluate for $i in ListMap(ListFromRange(0,0),$f) do $action1($i);
+
+evaluate for $i in Yql::Map(1/1,($x)->{return AsList($x)}) do $action1($i);
+
+evaluate for $i in Yql::Map(1/0,($x)->{return AsList($x)}) do $action1($i);
diff --git a/yql/essentials/tests/sql/suites/action/eval_for_over_subquery.sql b/yql/essentials/tests/sql/suites/action/eval_for_over_subquery.sql
new file mode 100644
index 0000000000..198b80b9a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_for_over_subquery.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$list = (
+ select aggregate_list(key) from Input
+);
+
+define action $echo($x) as
+ select $x;
+end define;
+
+evaluate for $a in $list do $echo($a);
diff --git a/yql/essentials/tests/sql/suites/action/eval_if.sql b/yql/essentials/tests/sql/suites/action/eval_if.sql
new file mode 100644
index 0000000000..f64665fd69
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_if.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+define action $action1($x) as
+ select $x;
+end define;
+
+evaluate if CAST(Unicode::ToUpper("i"u) AS String) == "I"
+ do $action1(1)
+else
+ do $action1(2);
+
+evaluate if CAST(Unicode::ToUpper("i"u) AS String) != "I"
+ do $action1(3);
+
+evaluate if CAST(Unicode::ToUpper("i"u) AS String) == "I"
+ do $action1(4);
diff --git a/yql/essentials/tests/sql/suites/action/eval_if_guard.sql b/yql/essentials/tests/sql/suites/action/eval_if_guard.sql
new file mode 100644
index 0000000000..4a11e6933e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_if_guard.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$list = ListTake(AsList("Input"),0);
+define action $process() as
+ select count(*) FROM each($list);
+end define;
+
+evaluate if ListLength($list)>0 do $process();
diff --git a/yql/essentials/tests/sql/suites/action/eval_input_output_table.cfg b/yql/essentials/tests/sql/suites/action/eval_input_output_table.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_input_output_table.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_input_output_table.sql b/yql/essentials/tests/sql/suites/action/eval_input_output_table.sql
new file mode 100644
index 0000000000..e8bbd374f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_input_output_table.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = CAST(Unicode::ToUpper("o"u) AS String) || "utput";
+$b = CAST(Unicode::ToUpper("i"u) AS String) || "nput";
+INSERT INTO $a
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM $b
+WHERE key < "100"
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.cfg b/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.sql b/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.sql
new file mode 100644
index 0000000000..429b27f11c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_input_output_table_subquery.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = (SELECT CAST(Unicode::ToUpper("o"u) AS String) || "utpu");
+$b = (SELECT CAST(Unicode::ToUpper("i"u) AS String) || "npu");
+$a = $a || CAST(Unicode::ToLower("T"u) AS String);
+$b = $b || CAST(Unicode::ToLower("T"u) AS String);
+INSERT INTO $a
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM $b
+WHERE key < "100"
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/action/eval_like.cfg b/yql/essentials/tests/sql/suites/action/eval_like.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_like.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_like.sql b/yql/essentials/tests/sql/suites/action/eval_like.sql
new file mode 100644
index 0000000000..24132ebd39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_like.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$arg1 = "" || "";
+$arg2 = CAST(Unicode::ToUpper("i"u) AS String) || "npu_";
+$arg3 = "" || "";
+$arg4 = "" || "raw";
+
+SELECT
+ count(*)
+FROM LIKE($arg1,$arg2,$arg3,$arg4);
diff --git a/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.cfg b/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.sql b/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.sql
new file mode 100644
index 0000000000..67ec4878f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+insert into Output
+select "key" as field
+union all
+select "subkey" as field;
+
+commit;
+
+$whitelist = select aggregate_list(field)
+from Output;
+
+select ForceSpreadMembers([("key", key)],Unwrap($whitelist)) from Input;
diff --git a/yql/essentials/tests/sql/suites/action/eval_percentile.sql b/yql/essentials/tests/sql/suites/action/eval_percentile.sql
new file mode 100644
index 0000000000..64905c1872
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_percentile.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+$x = 1.0/length(CAST(Unicode::ToUpper("ab"u) AS String));
+select Percentile(key,$x) from (
+select 1 as key
+union all
+select 2 as key)
diff --git a/yql/essentials/tests/sql/suites/action/eval_pragma.cfg b/yql/essentials/tests/sql/suites/action/eval_pragma.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_pragma.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_pragma.sql b/yql/essentials/tests/sql/suites/action/eval_pragma.sql
new file mode 100644
index 0000000000..87f4fb3b4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_pragma.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$a = "1" || CAST(Unicode::ToUpper("m") AS String);
+pragma yt.DataSizePerJob=$a;
diff --git a/yql/essentials/tests/sql/suites/action/eval_python3_ann.cfg b/yql/essentials/tests/sql/suites/action/eval_python3_ann.cfg
new file mode 100644
index 0000000000..5fee00e994
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python3_ann.cfg
@@ -0,0 +1 @@
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_python3_ann.sql b/yql/essentials/tests/sql/suites/action/eval_python3_ann.sql
new file mode 100644
index 0000000000..952c11cbd6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python3_ann.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+$script = @@
+from yql.typing import *
+
+def f(x:Int32, y:Int32)->Int32:
+ """
+ a simple sum UDF
+ """
+ return x + y
+@@;
+
+--$f = Python3::f(EvaluateType(ParseTypeHandle(Core::PythonFuncSignature(AsAtom("Python3"), $script, "f"))), $script);
+$f = Python3::f($script);
+
+select $f(1, 2);
diff --git a/yql/essentials/tests/sql/suites/action/eval_python3_signature.cfg b/yql/essentials/tests/sql/suites/action/eval_python3_signature.cfg
new file mode 100644
index 0000000000..5fee00e994
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python3_signature.cfg
@@ -0,0 +1 @@
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_python3_signature.sql b/yql/essentials/tests/sql/suites/action/eval_python3_signature.sql
new file mode 100644
index 0000000000..1b3d12a6d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python3_signature.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+$script = @@
+def f(x, y):
+ """
+ (Int32, Int32)
+ ->Int32
+
+ a simple sum UDF
+ """
+ return x + y
+@@;
+
+--$f = Python3::f(EvaluateType(ParseTypeHandle(Core::PythonFuncSignature(AsAtom("Python3"), $script, "f"))), $script);
+$f = Python3::f($script);
+
+select $f(1, 2);
diff --git a/yql/essentials/tests/sql/suites/action/eval_python_signature.cfg b/yql/essentials/tests/sql/suites/action/eval_python_signature.cfg
new file mode 100644
index 0000000000..a7ca79e497
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python_signature.cfg
@@ -0,0 +1,2 @@
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/action/eval_python_signature.sql b/yql/essentials/tests/sql/suites/action/eval_python_signature.sql
new file mode 100644
index 0000000000..98ccfb12f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_python_signature.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+$script = @@
+def f(x, y):
+ """
+ (Int32, Int32)
+ ->Int32
+
+ a simple sum UDF
+ """
+ return x + y
+@@;
+
+--$f = Python::f(EvaluateType(ParseTypeHandle(Core::PythonFuncSignature(AsAtom("Python"), $script, "f"))), $script);
+$f = Python::f($script);
+
+select $f(1, 2);
diff --git a/yql/essentials/tests/sql/suites/action/eval_range.cfg b/yql/essentials/tests/sql/suites/action/eval_range.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_range.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_range.sql b/yql/essentials/tests/sql/suites/action/eval_range.sql
new file mode 100644
index 0000000000..9ab6494943
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_range.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$arg1 = "" || "";
+$arg2 = CAST(Unicode::ToUpper("i"u) AS String) || "nput";
+$arg3 = CAST(Unicode::ToUpper("i"u) AS String) || "nput";
+$arg4 = "" || "";
+$arg5 = "" || "raw";
+
+SELECT
+ count(*)
+FROM RANGE($arg1,$arg2,$arg3,$arg4,$arg5);
diff --git a/yql/essentials/tests/sql/suites/action/eval_regexp.cfg b/yql/essentials/tests/sql/suites/action/eval_regexp.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_regexp.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_regexp.sql b/yql/essentials/tests/sql/suites/action/eval_regexp.sql
new file mode 100644
index 0000000000..6e3fcf0ad6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_regexp.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+$arg1 = "" || "";
+$arg2 = (Unicode::ToUpper("i") ?? "") || "npu.";
+$arg3 = "" || "";
+$arg4 = "" || "raw";
+
+SELECT
+ count(*)
+FROM REGEXP($arg1,$arg2,$arg3,$arg4);
diff --git a/yql/essentials/tests/sql/suites/action/eval_resourcetype.sql b/yql/essentials/tests/sql/suites/action/eval_resourcetype.sql
new file mode 100644
index 0000000000..55bb20227f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_resourcetype.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT FormatType(ResourceType(CAST(Unicode::ToUpper("r"u) AS String) || "es"));
diff --git a/yql/essentials/tests/sql/suites/action/eval_result_label.cfg b/yql/essentials/tests/sql/suites/action/eval_result_label.cfg
new file mode 100644
index 0000000000..5c248bff3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_result_label.cfg
@@ -0,0 +1 @@
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_result_label.sql b/yql/essentials/tests/sql/suites/action/eval_result_label.sql
new file mode 100644
index 0000000000..1f9e67d195
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_result_label.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$x = CAST(Unicode::ToUpper("foo"u) AS String);
+select 1 into result $x;
diff --git a/yql/essentials/tests/sql/suites/action/eval_sample.cfg b/yql/essentials/tests/sql/suites/action/eval_sample.cfg
new file mode 100644
index 0000000000..a654f9117d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_sample.cfg
@@ -0,0 +1 @@
+in Input input1.txt
diff --git a/yql/essentials/tests/sql/suites/action/eval_sample.sql b/yql/essentials/tests/sql/suites/action/eval_sample.sql
new file mode 100644
index 0000000000..3b84c6e5c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_sample.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+$x = 1.0 / 3;
+SELECT *
+FROM plato.Input
+SAMPLE $x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/eval_skip_take.cfg b/yql/essentials/tests/sql/suites/action/eval_skip_take.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_skip_take.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_skip_take.sql b/yql/essentials/tests/sql/suites/action/eval_skip_take.sql
new file mode 100644
index 0000000000..06d56e5b25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_skip_take.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select * from Input
+order by key
+limit length(CAST(Unicode::ToUpper("a"u) AS String))
+offset length(CAST(Unicode::ToUpper("bc"u) AS String));
diff --git a/yql/essentials/tests/sql/suites/action/eval_table_with_view.sql b/yql/essentials/tests/sql/suites/action/eval_table_with_view.sql
new file mode 100644
index 0000000000..2c27b55d58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_table_with_view.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+$x = "Input";
+SELECT *
+FROM $x VIEW raw LIMIT 1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/eval_taggedtype.sql b/yql/essentials/tests/sql/suites/action/eval_taggedtype.sql
new file mode 100644
index 0000000000..f84bd85c8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_taggedtype.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT FormatType(TaggedType(DataType("Int32"), CAST(Unicode::ToUpper("r"u) AS String) || "es"));
diff --git a/yql/essentials/tests/sql/suites/action/eval_type.sql b/yql/essentials/tests/sql/suites/action/eval_type.sql
new file mode 100644
index 0000000000..397798867f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_type.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select FormatType(EvaluateType(ParseTypeHandle("Int32" || "?")));
diff --git a/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.cfg b/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.cfg
new file mode 100644
index 0000000000..1d0f17aef1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+xfail
diff --git a/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.sql b/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.sql
new file mode 100644
index 0000000000..88b43b3736
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_typeof_output_table.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+INSERT INTO Output
+SELECT
+ key || "foo" as key2
+FROM Input;
+
+COMMIT;
+
+$input = PROCESS Output;
+$c = EvaluateCode(ReprCode(FormatType(TypeOf($input))));
+select $c;
+
+INSERT INTO Output WITH TRUNCATE
+SELECT
+ key || "foo" as key3
+FROM Input;
+
+COMMIT;
+
+$input = PROCESS Output;
+$c = EvaluateCode(ReprCode(FormatType(TypeOf($input))));
+select $c;
diff --git a/yql/essentials/tests/sql/suites/action/eval_unresolved_type_arg.sql b/yql/essentials/tests/sql/suites/action/eval_unresolved_type_arg.sql
new file mode 100644
index 0000000000..1ebfe07d30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_unresolved_type_arg.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$myAddSuffix = ($row, $value) -> {
+ $type = TypeOf($row);
+ --$type=Struct<key:String,subkey:String,value:String>;
+ $lambda = EvaluateCode(LambdaCode(($r)->{
+ return FuncCode("AsStruct",
+ ListMap(StructTypeComponents(TypeHandle($type)),
+ ($i)->{ return ListCode(
+ AtomCode($i.Name),
+ FuncCode("Concat",
+ FuncCode("Member",$r,AtomCode($i.Name)),
+ ReprCode($value)
+ )) }));
+
+ }));
+
+ return $lambda($row);
+};
+
+SELECT
+ $myAddSuffix(TableRow(), "*")
+FROM Input;
diff --git a/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.cfg b/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.sql b/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.sql
new file mode 100644
index 0000000000..240f4d2263
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_values_output_table_subquery.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = (SELECT CAST(Unicode::ToUpper("o"u) AS String) || "utpu");
+$a = $a || CAST(Unicode::ToLower("T"u) AS String);
+INSERT INTO $a (key, subkey, value)
+VALUES (1, "foo", false);
diff --git a/yql/essentials/tests/sql/suites/action/eval_variant.sql b/yql/essentials/tests/sql/suites/action/eval_variant.sql
new file mode 100644
index 0000000000..e4555ffd6f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/eval_variant.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$vt = ParseType("Variant<One:Int32,Two:String>");
+SELECT Variant(12, CAST(Unicode::ToUpper("o"u) AS String) || "ne", $vt);
diff --git a/yql/essentials/tests/sql/suites/action/evaluate_match_type.sql b/yql/essentials/tests/sql/suites/action/evaluate_match_type.sql
new file mode 100644
index 0000000000..bca34d037a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/evaluate_match_type.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$keep_only_last = ($row) -> {
+ $members = ListFilter(StructMembers($row), ($x) -> (FIND($x, "key") IS NOT NULL));
+ return ChooseMembers($row, $members)
+};
+
+
+select * from
+(select $keep_only_last(TableRow()) from Input) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/evaluate_pure.cfg b/yql/essentials/tests/sql/suites/action/evaluate_pure.cfg
new file mode 100644
index 0000000000..72eff595f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/evaluate_pure.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf datetime_udf
diff --git a/yql/essentials/tests/sql/suites/action/evaluate_pure.sql b/yql/essentials/tests/sql/suites/action/evaluate_pure.sql
new file mode 100644
index 0000000000..b89afe26bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/evaluate_pure.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+select EvaluateExpr(YQL::RandomNumber()), YQL::RandomNumber();
+select key, EvaluateExpr(cast(CurrentUtcDate() as string)) as `date` from Input;
+select YQL::String(EvaluateAtom("foo" || "bar"));
+select EvaluateExpr(CurrentUtcTimestamp()), CurrentUtcTimestamp();
+$y = Yson("{a=7u;c=[<d=%true>1;#;\"привет\";-3.4]}");
+select Yson::Equals(EvaluateExpr($y), $y);
+select EvaluateExpr(TzDate("2000-01-01,Europe/Moscow"));
+select EvaluateExpr(TzDatetime("2000-01-01T01:02:03,Europe/Moscow"));
+select EvaluateExpr(TzTimestamp("2000-01-01T01:02:03.456789,Europe/Moscow"));
diff --git a/yql/essentials/tests/sql/suites/action/evaluate_queries.cfg b/yql/essentials/tests/sql/suites/action/evaluate_queries.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/evaluate_queries.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/evaluate_queries.sql b/yql/essentials/tests/sql/suites/action/evaluate_queries.sql
new file mode 100644
index 0000000000..8671f14def
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/evaluate_queries.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$s = (select count(*) from Input);
+select EvaluateExpr($s);
+/*
+$s = (select key from Input);
+select EvaluateExpr($s);
+
+$s = (select key || "foo" from Input);
+select EvaluateExpr($s);
+
+$s = (select aggregate_list(key) from Input);
+select EvaluateExpr($s);
+
+$s = (select v from (select key,min(value) as v from Input group by key order by key limit 1));
+select EvaluateExpr($s);
+
+$s = (select key from Input order by key limit 1);
+select EvaluateExpr($s);
+
+$s = (select lag(key) over w from Input window w as ());
+select EvaluateExpr($s);
+
+$s = (select a.key from Input as a join Input as b using(key));
+select EvaluateExpr($s);
+*/
diff --git a/yql/essentials/tests/sql/suites/action/export_action.cfg b/yql/essentials/tests/sql/suites/action/export_action.cfg
new file mode 100644
index 0000000000..d8349c7037
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/export_action.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+file lib1.sql lib1.sql.txt
diff --git a/yql/essentials/tests/sql/suites/action/export_action.sql b/yql/essentials/tests/sql/suites/action/export_action.sql
new file mode 100644
index 0000000000..59ecc86d5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/export_action.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+pragma library("lib1.sql");
+import lib1 symbols $action;
+do $action("Input");
diff --git a/yql/essentials/tests/sql/suites/action/inline_action.sql b/yql/essentials/tests/sql/suites/action/inline_action.sql
new file mode 100644
index 0000000000..44586e32e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/inline_action.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+do begin
+ select 1;
+end do;
+
+evaluate if true do begin
+ select 1;
+end do
+else do begin
+ select 2;
+end do;
+
+evaluate for $i in AsList(1,2,3) do begin
+ select $i;
+end do;
diff --git a/yql/essentials/tests/sql/suites/action/input.txt b/yql/essentials/tests/sql/suites/action/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/action/input1.txt b/yql/essentials/tests/sql/suites/action/input1.txt
new file mode 100644
index 0000000000..9e2c7c8718
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/input1.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="160";"subkey"="3";"value"="iii"};
+{"key"="170";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/action/input_attrs.txt b/yql/essentials/tests/sql/suites/action/input_attrs.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/input_attrs.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/action/input_attrs.txt.attr b/yql/essentials/tests/sql/suites/action/input_attrs.txt.attr
new file mode 100644
index 0000000000..d2659911d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/input_attrs.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ };
+ "foo" = 1;
+ "bar" = "text";
+}
diff --git a/yql/essentials/tests/sql/suites/action/insert_after_eval.cfg b/yql/essentials/tests/sql/suites/action/insert_after_eval.cfg
new file mode 100644
index 0000000000..b1f9d81471
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_after_eval.cfg
@@ -0,0 +1 @@
+out Output modify.txt
diff --git a/yql/essentials/tests/sql/suites/action/insert_after_eval.sql b/yql/essentials/tests/sql/suites/action/insert_after_eval.sql
new file mode 100644
index 0000000000..60ab74c109
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_after_eval.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+$s1 = (select count(*) from Output);
+$s2 = (select max(key) from Output);
+insert into Output with truncate
+select EvaluateExpr($s1) as a, EvaluateExpr($s2) as b;
diff --git a/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.cfg b/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.cfg
new file mode 100644
index 0000000000..b1f9d81471
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.cfg
@@ -0,0 +1 @@
+out Output modify.txt
diff --git a/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.sql b/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.sql
new file mode 100644
index 0000000000..c31b9e04eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_after_eval_xlock.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+$s1 = (select count(*) from Output with xlock);
+$s2 = (select max(key) from Output with xlock);
+insert into Output with truncate
+select EvaluateExpr($s1) as a, EvaluateExpr($s2) as b;
diff --git a/yql/essentials/tests/sql/suites/action/insert_each_from_folder.cfg b/yql/essentials/tests/sql/suites/action/insert_each_from_folder.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_each_from_folder.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/insert_each_from_folder.sql b/yql/essentials/tests/sql/suites/action/insert_each_from_folder.sql
new file mode 100644
index 0000000000..dc06200679
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/insert_each_from_folder.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+$list = (
+ select aggregate_list(Path) from (
+ select Path from folder("")
+ where Type = "table" and Path like "Input%"
+ order by Path desc
+ limit 30
+ )
+);
+
+insert into Output with truncate
+select
+ count(*)
+from
+ each($list)
diff --git a/yql/essentials/tests/sql/suites/action/lambda_arg_count.sql b/yql/essentials/tests/sql/suites/action/lambda_arg_count.sql
new file mode 100644
index 0000000000..37854ea7b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/lambda_arg_count.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ LambdaArgumentsCount(()->(1)),
+ LambdaArgumentsCount(($x)->($x+1)),
+ LambdaArgumentsCount(($x, $y)->($x+$y)),
+ LambdaArgumentsCount(($x?)->($x+1)),
+ LambdaArgumentsCount(($x, $y?)->($x+$y)),
+
+ LambdaOptionalArgumentsCount(()->(1)),
+ LambdaOptionalArgumentsCount(($x)->($x+1)),
+ LambdaOptionalArgumentsCount(($x, $y)->($x+$y)),
+ LambdaOptionalArgumentsCount(($x?)->($x+1)),
+ LambdaOptionalArgumentsCount(($x, $y?)->($x+$y));
diff --git a/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.cfg b/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.sql b/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.sql
new file mode 100644
index 0000000000..74a9ac9790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/large_evaluate_for_fail.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma config.flags("EvaluateForLimit", "3");
+
+evaluate for $_i in ListFromRange(0, 10) do empty_action();
diff --git a/yql/essentials/tests/sql/suites/action/lib1.sql.txt b/yql/essentials/tests/sql/suites/action/lib1.sql.txt
new file mode 100644
index 0000000000..78edb4e064
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/lib1.sql.txt
@@ -0,0 +1,7 @@
+use plato;
+
+define action $action($table) as
+ select key,count(*) as cnt from $table group by key order by key;
+end define;
+
+export $action;
diff --git a/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.cfg b/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.cfg
new file mode 100644
index 0000000000..dbda958ebd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.cfg
@@ -0,0 +1,6 @@
+xfail
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+
diff --git a/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.sql b/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.sql
new file mode 100644
index 0000000000..54de5b2950
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/mixed_eval_typeof_world1.sql
@@ -0,0 +1,45 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$force_remove_members = ($struct, $to_remove) -> {
+ $remover = EvaluateCode(LambdaCode(($st) -> {
+ $to_keep = ListFlatMap(StructTypeComponents(TypeHandle(TypeOf($struct))), ($x) -> {return IF($x.Name not in $to_remove, $x.Name)});
+ return FuncCode(
+ "AsStruct",
+ ListMap(
+ $to_keep,
+ ($x) -> {return ListCode(AtomCode($x), FuncCode("Member", $st, AtomCode($x)))}
+ )
+ )
+ }));
+ return $remover($struct)
+};
+
+define action $func($input, $output) as
+ $jname = $output;
+ insert into @$jname
+ with truncate
+ select
+ *
+ from $input as input;
+ commit;
+ insert into $output
+ with truncate
+ select
+ AGG_LIST(
+ $force_remove_members(
+ TableRow(),
+ ['']
+ )
+ )
+ from @$jname;
+ commit;
+end define;
+
+$exps = [('Input','Output1'),('Input','Output2'),('Input','Output3')];
+evaluate for $exp_name in $exps do begin
+ $input = $exp_name.0;
+ $output = $exp_name.1;
+ do $func($input, $output);
+end do;
diff --git a/yql/essentials/tests/sql/suites/action/modify.txt b/yql/essentials/tests/sql/suites/action/modify.txt
new file mode 100644
index 0000000000..15f63a38a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/modify.txt
@@ -0,0 +1,2 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/action/modify.txt.attr b/yql/essentials/tests/sql/suites/action/modify.txt.attr
new file mode 100644
index 0000000000..36b3c00c90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/modify.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["DataType";"String";];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/action/nested_action.sql b/yql/essentials/tests/sql/suites/action/nested_action.sql
new file mode 100644
index 0000000000..4beb520d5a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/nested_action.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $action($b,$c) as
+ define action $aaa() as
+ select $b;
+ end define;
+ define action $bbb() as
+ select $c;
+ end define;
+ do $aaa();
+ do $bbb();
+end define;
+
+do $action(1,2);
diff --git a/yql/essentials/tests/sql/suites/action/nested_eval.sql b/yql/essentials/tests/sql/suites/action/nested_eval.sql
new file mode 100644
index 0000000000..0960c6da74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/nested_eval.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+$make_struct = Callable(
+ Callable<(String) -> Struct<lel : Int32>>,
+ ($_string) -> { return AsStruct(5 as lel); }
+);
+
+$kekify_struct = ($struct) -> {
+ return EvaluateCode(FuncCode("AsStruct",
+ ListMap(
+ StructTypeComponents(TypeHandle(TypeOf($struct))),
+ ($_component) -> { return ListCode(AtomCode("kek"), ReprCode(42)); }
+ )
+ ));
+};
+
+$struct = AsStruct(
+ Callable(
+ Callable<(String)->Struct<kek : Int32>>,
+ ($string) -> { return $kekify_struct($make_struct($string)); }
+ ) as KekFromString,
+ TypeHandle(Int32) as IntHandle
+);
+
+select FormatType(EvaluateType($struct.IntHandle));
diff --git a/yql/essentials/tests/sql/suites/action/nested_rewrite_io.sql b/yql/essentials/tests/sql/suites/action/nested_rewrite_io.sql
new file mode 100644
index 0000000000..4150bc7e3f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/nested_rewrite_io.sql
@@ -0,0 +1,22 @@
+use plato;
+$input = select * from AS_TABLE([<|a:"foo",b:"123"|>]);
+
+$mapping = select {"a":"String", "b":"Int32"} from Input limit 1;
+
+$transformer = ($type)->{
+ $t = EvaluateType(ParseTypeHandle($type));
+ return ($value)->{ return cast($value as $t); };
+};
+
+$converter = ($row)->{
+ return EvaluateCode(LambdaCode(($rowCode)->{
+ return FuncCode("AsStruct", ListMap(StructMembers($row), ($name)->{
+ return ListCode(
+ AtomCode($name),
+ FuncCode("Apply", QuoteCode($transformer(Unwrap($mapping[$name]))), FuncCode("Member", $rowCode, AtomCode($name)))
+ );
+ }));
+ }))($row);
+};
+
+select * from (select $converter(TableRow()) from $input) flatten columns;
diff --git a/yql/essentials/tests/sql/suites/action/nested_subquery.cfg b/yql/essentials/tests/sql/suites/action/nested_subquery.cfg
new file mode 100644
index 0000000000..386ab9ac7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/nested_subquery.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/action/nested_subquery.sql b/yql/essentials/tests/sql/suites/action/nested_subquery.sql
new file mode 100644
index 0000000000..375dee1116
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/nested_subquery.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+define subquery $q($name) as
+ define subquery $nested() as
+ select $name;
+ end define;
+
+ process $nested();
+end define;
+
+process $q(CAST(Unicode::ToUpper("foo"u) AS String));
diff --git a/yql/essentials/tests/sql/suites/action/no_columns_in_do.sqlx b/yql/essentials/tests/sql/suites/action/no_columns_in_do.sqlx
new file mode 100644
index 0000000000..b51e642f16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/no_columns_in_do.sqlx
@@ -0,0 +1,8 @@
+/* postgres can not */
+$a = `aaa`;
+
+define action $action($s) as
+ select $s;
+end define;
+
+do $action($a);
diff --git a/yql/essentials/tests/sql/suites/action/parallel_for.sql b/yql/essentials/tests/sql/suites/action/parallel_for.sql
new file mode 100644
index 0000000000..d9bfcfcedb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/parallel_for.sql
@@ -0,0 +1,11 @@
+/* yt can not */
+use plato;
+
+evaluate parallel for $i in [1,2,1,2,1] do begin
+insert into Output
+select $i as a;
+end do;
+
+commit;
+insert into Output with truncate
+select a from Output order by a;
diff --git a/yql/essentials/tests/sql/suites/action/parallel_for_commit.sqlx b/yql/essentials/tests/sql/suites/action/parallel_for_commit.sqlx
new file mode 100644
index 0000000000..44ea0ff126
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/parallel_for_commit.sqlx
@@ -0,0 +1,4 @@
+evaluate parallel for $i in [1,2,3] do begin
+commit;
+end do;
+
diff --git a/yql/essentials/tests/sql/suites/action/parallel_for_select.sqlx b/yql/essentials/tests/sql/suites/action/parallel_for_select.sqlx
new file mode 100644
index 0000000000..4b190b2c56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/parallel_for_select.sqlx
@@ -0,0 +1,4 @@
+evaluate parallel for $i in [1,2,3] do begin
+select $i;
+end do;
+
diff --git a/yql/essentials/tests/sql/suites/action/parallel_for_values.sqlx b/yql/essentials/tests/sql/suites/action/parallel_for_values.sqlx
new file mode 100644
index 0000000000..80891830a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/parallel_for_values.sqlx
@@ -0,0 +1,4 @@
+evaluate parallel for $i in [1,2,3] do begin
+values ($i);
+end do;
+
diff --git a/yql/essentials/tests/sql/suites/action/pass_action_as_param.sql b/yql/essentials/tests/sql/suites/action/pass_action_as_param.sql
new file mode 100644
index 0000000000..e5ab80b264
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/pass_action_as_param.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+define action $dup($x) as
+ do $x();
+ do $x();
+end define;
+
+do $dup(empty_action);
+
+define action $sel_foo() as
+ select "foo";
+end define;
+
+do $dup($sel_foo);
diff --git a/yql/essentials/tests/sql/suites/action/pass_subquery_as_param.sql b/yql/essentials/tests/sql/suites/action/pass_subquery_as_param.sql
new file mode 100644
index 0000000000..23e1af9551
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/pass_subquery_as_param.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $dup($x) as
+ select * from $x(1)
+ union all
+ select * from $x(2);
+end define;
+
+define subquery $sub($n) as
+ select $n * 10;
+end define;
+
+select * from $dup($sub);
diff --git a/yql/essentials/tests/sql/suites/action/pending_arg_fail.cfg b/yql/essentials/tests/sql/suites/action/pending_arg_fail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/pending_arg_fail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/pending_arg_fail.sql b/yql/essentials/tests/sql/suites/action/pending_arg_fail.sql
new file mode 100644
index 0000000000..5c09ceb11c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/pending_arg_fail.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+select ListExtract(value,key) from Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/process_from_subquery_with_orderby.sql b/yql/essentials/tests/sql/suites/action/process_from_subquery_with_orderby.sql
new file mode 100644
index 0000000000..24ad5b76f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/process_from_subquery_with_orderby.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+define subquery $src() as
+ select * from plato.Input order by key;
+end define;
+process $src();
diff --git a/yql/essentials/tests/sql/suites/action/runtime_apply_quoted_code.sql b/yql/essentials/tests/sql/suites/action/runtime_apply_quoted_code.sql
new file mode 100644
index 0000000000..8a4a92b353
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_apply_quoted_code.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$func = ($x)->{
+ return $x == 1;
+};
+
+$structApply = ($strValue, $f)->{
+ $code = EvaluateCode(LambdaCode(($strCode)->{
+ $members = StructTypeComponents(TypeHandle(TypeOf($strValue)));
+
+ return Yql::Fold($members, ReprCode(false), ($item, $state)->{
+ $member = FuncCode("Member", $strCode, AtomCode($item.Name));
+ $apply = FuncCode("Apply", QuoteCode($f), $member);
+ return FuncCode("Or", $state, $apply);
+ });
+ }));
+ return $code($strValue);
+};
+
+select $structApply(AsStruct(1 as a,2 as b,3 as c), $func);
+select $structApply(AsStruct(4 as a,2 as b,3 as c), $func);
diff --git a/yql/essentials/tests/sql/suites/action/runtime_for_select.sql b/yql/essentials/tests/sql/suites/action/runtime_for_select.sql
new file mode 100644
index 0000000000..5e9ad5d10f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_for_select.sql
@@ -0,0 +1,44 @@
+/* syntax version 1 */
+/* postgres can not */
+for $i in Just(AsList(1,2,3)) do begin
+ select $i;
+end do
+else do begin
+ select 10;
+end do;
+
+for $i in Just(ListCreate(Int32)) do begin
+ select $i;
+end do
+else do begin
+ select 11;
+end do;
+
+for $i in null do begin
+ select $i;
+end do
+else do begin
+ select 12;
+end do;
+
+for $i in AsList(4) do begin
+ select $i;
+end do
+else do begin
+ select 13;
+end do;
+
+for $i in ListCreate(String) do begin
+ select $i;
+end do
+else do begin
+ select 14;
+end do;
+
+for $i in AsList(5) do begin
+ select $i;
+end do;
+
+for $i in ListCreate(Bool) do begin
+ select $i;
+end do
diff --git a/yql/essentials/tests/sql/suites/action/runtime_format_free_args_code.sql b/yql/essentials/tests/sql/suites/action/runtime_format_free_args_code.sql
new file mode 100644
index 0000000000..4d037fc4ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_format_free_args_code.sql
@@ -0,0 +1,6 @@
+$x = EvaluateCode(LambdaCode(($arg1, $arg2)->{
+ $f = FuncCode("Concat", $arg1, $arg2);
+ return ReprCode(FormatCode($f));
+}));
+
+select $x(1,2);
diff --git a/yql/essentials/tests/sql/suites/action/runtime_format_type.sql b/yql/essentials/tests/sql/suites/action/runtime_format_type.sql
new file mode 100644
index 0000000000..d08b6faf40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_format_type.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select FormatType(TypeHandle(TypeOf(1)));
diff --git a/yql/essentials/tests/sql/suites/action/runtime_if_select.sql b/yql/essentials/tests/sql/suites/action/runtime_if_select.sql
new file mode 100644
index 0000000000..c81f207ae9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_if_select.sql
@@ -0,0 +1,29 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+insert into @foo
+select count(*) as count from Input;
+commit;
+$n = (select count from @foo);
+$predicate = $n > 1;
+
+if $predicate do begin
+ select 1;
+end do;
+
+if not $predicate do begin
+ select 2;
+end do;
+
+if $predicate do begin
+ select 3;
+end do else do begin
+ select 4;
+end do;
+
+if not $predicate do begin
+ select 5;
+end do else do begin
+ select 6;
+end do;
diff --git a/yql/essentials/tests/sql/suites/action/runtime_make_code.sql b/yql/essentials/tests/sql/suites/action/runtime_make_code.sql
new file mode 100644
index 0000000000..c340ce6fda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_make_code.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+select FormatCode(
+ ListCode(
+ AtomCode("1"),
+ AsList(AtomCode("2"),AtomCode("3")),
+ FuncCode("Func",
+ AtomCode("4"),
+ AsList(AtomCode("5"),AtomCode("6"))),
+ LambdaCode(()->{ return AtomCode("7") }),
+ LambdaCode(($x)->{ return FuncCode("-",$x) }),
+ LambdaCode(($x,$y)->{ return FuncCode("*",$x,$y) }),
+ LambdaCode(2, ($args)->{ return FuncCode("+",Unwrap($args[0]),Unwrap($args[1])) }),
+ )
+);
diff --git a/yql/essentials/tests/sql/suites/action/runtime_parse_type.sql b/yql/essentials/tests/sql/suites/action/runtime_parse_type.sql
new file mode 100644
index 0000000000..a6396ecbbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_parse_type.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select FormatType(ParseTypeHandle("Int32" || "?"));
diff --git a/yql/essentials/tests/sql/suites/action/runtime_quote_code.sql b/yql/essentials/tests/sql/suites/action/runtime_quote_code.sql
new file mode 100644
index 0000000000..f13eea773d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_quote_code.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+select
+ FormatCode(QuoteCode(AsAtom("foo"))),
+ FormatCode(QuoteCode(AsTuple())),
+ FormatCode(QuoteCode(AsTuple(AsAtom("foo"),AsAtom("bar")))),
+ FormatCode(QuoteCode(1)),
+ FormatCode(QuoteCode(($x,$y)->{ return $x+$y })),
+ ListMap(ListFromRange(1,4), ($x)->{
+ return FormatCode(QuoteCode(
+ ($y)->{ return $x+$y }
+ ))
+ });
diff --git a/yql/essentials/tests/sql/suites/action/runtime_repr_code.sql b/yql/essentials/tests/sql/suites/action/runtime_repr_code.sql
new file mode 100644
index 0000000000..da17985da4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_repr_code.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+$fact = EvaluateCode(
+ Yql::Fold(
+ ListFromRange(1,11),
+ ReprCode(1),
+ ($item, $state)->{
+ return FuncCode("*", $state, ReprCode($item))
+ })
+);
+
+select $fact;
diff --git a/yql/essentials/tests/sql/suites/action/runtime_serialize_type.sql b/yql/essentials/tests/sql/suites/action/runtime_serialize_type.sql
new file mode 100644
index 0000000000..ffb1dd0450
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_serialize_type.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select Yql::SerializeTypeHandle(TypeHandle(TypeOf(1)));
diff --git a/yql/essentials/tests/sql/suites/action/runtime_type_kind.sql b/yql/essentials/tests/sql/suites/action/runtime_type_kind.sql
new file mode 100644
index 0000000000..c14ee1753b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_type_kind.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ TypeKind(TypeHandle(TypeOf(1))),
+ TypeKind(TypeHandle(TypeOf(AsList(1)))),
+ TypeKind(TypeHandle(TypeOf(NULL))),
+ TypeKind(TypeHandle(TypeOf(TypeOf(1)))),
+ TypeKind(TypeHandle(TypeOf(AsAtom("1"))));
diff --git a/yql/essentials/tests/sql/suites/action/runtime_type_splitmake.sql b/yql/essentials/tests/sql/suites/action/runtime_type_splitmake.sql
new file mode 100644
index 0000000000..40cd8abeb0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/runtime_type_splitmake.sql
@@ -0,0 +1,54 @@
+/* syntax version 1 */
+/* postgres can not */
+$formatTagged = ($x)->{return AsStruct(FormatType($x.Base) as Base, $x.Tag as Tag)};
+$formatArgument = ($x)->{return AsStruct(FormatType($x.Type) as Type, $x.Name as Name, $x.Flags as Flags)};
+$formatCallable = ($x)->{return AsStruct(
+ $x.OptionalArgumentsCount as OptionalArgumentsCount,
+ $x.Payload as Payload,
+ FormatType($x.Result) as Result,
+ ListMap($x.Arguments, $formatArgument) as Arguments
+)};
+
+select
+ DataTypeComponents(ParseTypeHandle("Int32")),
+ DataTypeComponents(ParseTypeHandle("Decimal(4,1)")),
+ FormatType(DataTypeHandle(AsList("Int32"))),
+ FormatType(DataTypeHandle(AsList("Decimal","4","1"))),
+ FormatType(OptionalItemType(ParseTypeHandle("Int32?"))),
+ FormatType(OptionalTypeHandle(ParseTypeHandle("Int32"))),
+ FormatType(ListItemType(ParseTypeHandle("List<Int32>"))),
+ FormatType(ListTypeHandle(ParseTypeHandle("Int32"))),
+ FormatType(StreamItemType(ParseTypeHandle("Stream<Int32>"))),
+ FormatType(StreamTypeHandle(ParseTypeHandle("Int32"))),
+ ListMap(
+ TupleTypeComponents(ParseTypeHandle("Tuple<Int32,String>")),
+ ($x)->{return FormatType($x)}),
+ FormatType(TupleTypeHandle(ListMap(
+ AsList("Int32","String"), ($x)->{return ParseTypeHandle($x)}))),
+ ListMap(
+ StructTypeComponents(ParseTypeHandle("Struct<foo:Int32,bar:String>")),
+ ($x)->{return AsTuple($x.Name, FormatType($x.Type))}),
+ FormatType(StructTypeHandle(ListMap(
+ AsList(AsTuple("foo", "Int32"),AsTuple("bar", "String")),
+ ($x)->{return AsStruct($x.0 as Name,ParseTypeHandle($x.1) as Type)}))),
+ StaticMap(DictTypeComponents(ParseTypeHandle("Dict<String,Int32>")),
+ ($x)->{return FormatType($x)}),
+ FormatType(DictTypeHandle(ParseTypeHandle("String"),ParseTypeHandle("Int32"))),
+ ResourceTypeTag(ParseTypeHandle("Resource<foo>")),
+ FormatType(ResourceTypeHandle("foo")),
+ $formatTagged(TaggedTypeComponents(ParseTypeHandle("Tagged<String,foo>"))),
+ FormatType(TaggedTypeHandle(ParseTypeHandle("String"),"foo")),
+ FormatType(VariantUnderlyingType(ParseTypeHandle("Variant<Int32,String>"))),
+ FormatType(VariantTypeHandle(ParseTypeHandle("Tuple<Int32,String>"))),
+ FormatType(VariantUnderlyingType(ParseTypeHandle("Variant<a:Int32,b:String>"))),
+ FormatType(VariantTypeHandle(ParseTypeHandle("Struct<a:Int32,b:String>"))),
+ FormatType(VoidTypeHandle()),
+ FormatType(NullTypeHandle()),
+ $formatCallable(CallableTypeComponents(ParseTypeHandle("(Int32,[bar:Double?{Flags:AutoMap}])->String{Payload:foo}"))),
+ FormatType(CallableTypeHandle(ParseTypeHandle("String"),AsList(
+ CallableArgument(ParseTypeHandle("Int32")),
+ CallableArgument(ParseTypeHandle("Double?"), "bar", AsList("AutoMap"))))),
+ FormatType(CallableTypeHandle(ParseTypeHandle("String"),AsList(
+ CallableArgument(ParseTypeHandle("Int32")),
+ CallableArgument(ParseTypeHandle("Double?"), "bar", AsList("AutoMap"))),
+ 1, "foo"));
diff --git a/yql/essentials/tests/sql/suites/action/select_from_subquery_with_orderby.sql b/yql/essentials/tests/sql/suites/action/select_from_subquery_with_orderby.sql
new file mode 100644
index 0000000000..fbc0f689d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/select_from_subquery_with_orderby.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+define subquery $src() as
+ select * from plato.Input order by subkey;
+end define;
+
+define subquery $src_non_yt() as
+ select * from as_table([<|key:1, subkey:1|>, <|key:2, subkey:2|>]) order by subkey;
+end define;
+
+select * from $src() order by key;
+select * from $src_non_yt() order by key;
diff --git a/yql/essentials/tests/sql/suites/action/subquery.sql b/yql/essentials/tests/sql/suites/action/subquery.sql
new file mode 100644
index 0000000000..60df127bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+define subquery $q($name, $a) as
+ $i = (select * from $name);
+ $b = "_foo";
+ select key || $a || $b as key from $i;
+end define;
+
+$z = (select key from $q("Input", "_bar"));
+
+select $z;
+
+select key from $q("Input", "_baz") order by key;
+
+define subquery $e() as
+ select "hello";
+end define;
+
+process $e();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_accessnode.sql b/yql/essentials/tests/sql/suites/action/subquery_accessnode.sql
new file mode 100644
index 0000000000..5cd354945e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_accessnode.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+
+define subquery $foo() as
+ select <|a: 1, b: 2|> as s;
+end define;
+
+select s.a as a, s.b as b from $foo();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_assumeorderby.sql b/yql/essentials/tests/sql/suites/action/subquery_assumeorderby.sql
new file mode 100644
index 0000000000..08c1779801
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_assumeorderby.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub() as
+ select * from (values (1),(2),(3)) as a(x);
+end define;
+
+$sub2 = SubqueryAssumeOrderBy($sub, [("x",true)]);
+
+process $sub2(); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/subquery_extend_over_extend_for.sql b/yql/essentials/tests/sql/suites/action/subquery_extend_over_extend_for.sql
new file mode 100644
index 0000000000..08951c5c36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_extend_over_extend_for.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+DEFINE SUBQUERY $sub($i) as
+ SELECT $i as x;
+END DEFINE;
+
+$s = SubqueryExtendFor([1,2,3],$sub);
+$s2 = SubqueryExtendFor([1,2,3],$sub);
+
+$s3 = SubqueryExtend($s, $s2);
+PROCESS $s3();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge1.sql b/yql/essentials/tests/sql/suites/action/subquery_merge1.sql
new file mode 100644
index 0000000000..ae6d563701
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge1.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub1() as
+ select 1 as x;
+end define;
+
+define subquery $sub2() as
+ select 2 as x;
+end define;
+
+define subquery $sub3() as
+ select 3 as y;
+end define;
+
+$s = SubqueryExtend($sub1,$sub2);
+process $s();
+
+$s = SubqueryUnionAll($sub1,$sub3);
+process $s();
+
+$s = SubqueryMerge($sub1,$sub2);
+process $s();
+
+$s = SubqueryUnionMerge($sub1,$sub3);
+process $s();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge2.sql b/yql/essentials/tests/sql/suites/action/subquery_merge2.sql
new file mode 100644
index 0000000000..f8d4918c83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge2.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub($i) as
+ select $i as x;
+end define;
+
+$s = SubqueryExtendFor([1,2,3],$sub);
+process $s();
+
+$s = SubqueryUnionAllFor([1,2,3],$sub);
+process $s();
+
+$s = SubqueryMergeFor([1,2,3],$sub);
+process $s();
+
+$s = SubqueryUnionMergeFor([1,2,3],$sub);
+process $s();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge_evaluate.sql b/yql/essentials/tests/sql/suites/action/subquery_merge_evaluate.sql
new file mode 100644
index 0000000000..25c3a000fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge_evaluate.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+define subquery $sub1($i,$j?) as
+ select $i - 1,$j;
+end define;
+
+define subquery $sub2($i,$j?) as
+ select $i + 1,$j;
+end define;
+
+$sub = EvaluateCode(If(1>2,QuoteCode($sub1),QuoteCode($sub2)));
+
+$s = SubqueryExtendFor([1,2,3],$sub);
+process $s();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.cfg b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.sql b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.sql
new file mode 100644
index 0000000000..47317a548e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_subquery.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+DEFINE SUBQUERY $get_tables_list($dir) AS
+ SELECT
+ Unwrap($dir || "/" || CAST(TableName(Path, "yt") AS String)) AS Path,
+ FROM FOLDER($dir)
+END DEFINE;
+
+DEFINE SUBQUERY $get_all_tables_list($dirs) AS
+ $get_src_tables = SubqueryExtendFor(UNWRAP(ListUniq($dirs)), $get_tables_list);
+ select * from $get_src_tables();
+END DEFINE;
+
+process $get_all_tables_list([""]);
diff --git a/yql/essentials/tests/sql/suites/action/subquery_merge_nested_world.sql b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_world.sql
new file mode 100644
index 0000000000..67f0683145
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_merge_nested_world.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+DEFINE SUBQUERY $s($_i) AS
+ $t = SELECT AGGREGATE_LIST(Path) FROM FOLDER('') WHERE Path LIKE "Input%";
+ SELECT
+ *
+ FROM EACH($t);
+END DEFINE;
+
+$extractor = SubqueryMergeFor([1], $s);
+
+SELECT *
+FROM $extractor();
diff --git a/yql/essentials/tests/sql/suites/action/subquery_opt_args.sql b/yql/essentials/tests/sql/suites/action/subquery_opt_args.sql
new file mode 100644
index 0000000000..b3c1c8a757
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_opt_args.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub($a,$b?) as
+ select $a + ($b ?? 0);
+end define;
+
+process $sub(1);
+process $sub(2, 3);
diff --git a/yql/essentials/tests/sql/suites/action/subquery_orderby0.sql b/yql/essentials/tests/sql/suites/action/subquery_orderby0.sql
new file mode 100644
index 0000000000..e281e537cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_orderby0.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub() as
+ select * from (values (1,'c'),(1,'a'),(3,'b')) as a(x,y);
+end define;
+
+$sub2 = SubqueryOrderBy($sub, []);
+
+process $sub2();
+
+$sub3 = SubqueryOrderBy($sub, ListCreate(Tuple<String,Bool>));
+
+process $sub3(); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/subquery_orderby1.sql b/yql/essentials/tests/sql/suites/action/subquery_orderby1.sql
new file mode 100644
index 0000000000..7070defdb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_orderby1.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub() as
+ select * from (values (1),(2),(3)) as a(x);
+end define;
+
+$sub2 = SubqueryOrderBy($sub, [("x",false)]);
+
+process $sub2(); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/subquery_orderby2.sql b/yql/essentials/tests/sql/suites/action/subquery_orderby2.sql
new file mode 100644
index 0000000000..7dbbe3ad0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/subquery_orderby2.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+define subquery $sub() as
+ select * from (values (1,'c'),(1,'a'),(3,'b')) as a(x,y);
+end define;
+
+$sub2 = SubqueryOrderBy($sub, [("x",false), ("y",true)]);
+
+process $sub2(); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.cfg b/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.sql b/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.sql
new file mode 100644
index 0000000000..bd6ee020d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/action/table_content_before_from_folder.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+pragma yt.EvaluationTableSizeLimit="1";
+select * from Input limit 1;
+$tables = (select aggregate_list(Path) as dates from folder("") where Path like "Input%");
+select count(*) from each($tables);
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.cfg b/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.cfg
new file mode 100644
index 0000000000..04d34fa0d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.sql
new file mode 100644
index 0000000000..ee9bd7870b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_const_interval.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$a = select CurrentUtcDate() as _date, Just(Interval("P1W")) as parsed_lag from plato.Input;
+SELECT AVG(parsed_lag) FROM $a;
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_decimal.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_decimal.sql
new file mode 100644
index 0000000000..96f49ebf5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_decimal.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ avg(key)
+FROM (values (Decimal("0.1",10,1)),(Decimal("0.2",10,1)),(Decimal("0.3",10,1))) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_interval.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_interval.sql
new file mode 100644
index 0000000000..d87106a991
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_interval.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ avg(key)
+FROM (values (Interval("P1D")),(Interval("P2D")),(Interval("P3D"))) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_numeric.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_numeric.sql
new file mode 100644
index 0000000000..8e5ae7410c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_numeric.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ avg(key)
+FROM (values (1),(2),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_numeric_opt.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_numeric_opt.sql
new file mode 100644
index 0000000000..7f1249d119
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_numeric_opt.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ avg(key)
+FROM (values (1),(null),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/avg_state_type.sql b/yql/essentials/tests/sql/suites/agg_apply/avg_state_type.sql
new file mode 100644
index 0000000000..67e7997756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/avg_state_type.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+select
+formattype(typeof(avg(null))),
+formattype(typeof(avg(1))),
+formattype(typeof(avg(decimal("10",10,1)))),
+formattype(typeof(avg(interval("P10D")))),
+formattype(typeof(avg(just(1)))),
+formattype(typeof(avg(just(decimal("10",10,1))))),
+formattype(typeof(avg(just(interval("P10D")))))
+from (select 1) group by () with combine \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/count.sql b/yql/essentials/tests/sql/suites/agg_apply/count.sql
new file mode 100644
index 0000000000..4d2917715e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/count.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ count(*),count(key)
+FROM (values (1),(null),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/default.cfg b/yql/essentials/tests/sql/suites/agg_apply/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/default.cfg
diff --git a/yql/essentials/tests/sql/suites/agg_apply/input.txt b/yql/essentials/tests/sql/suites/agg_apply/input.txt
new file mode 100644
index 0000000000..70dd8b1eff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/input.txt
@@ -0,0 +1,4 @@
+{"key"=1;"subkey"=10;"value"=5};
+{"key"=1;"subkey"=20;"value"=6};
+{"key"=1;"subkey"=30;"value"=7};
+{"key"=0;"subkey"=40;"value"=8};
diff --git a/yql/essentials/tests/sql/suites/agg_apply/input.txt.attr b/yql/essentials/tests/sql/suites/agg_apply/input.txt.attr
new file mode 100644
index 0000000000..84791918db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ]
+ ]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/agg_apply/max.sql b/yql/essentials/tests/sql/suites/agg_apply/max.sql
new file mode 100644
index 0000000000..70895a3780
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/max.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ max(key)
+FROM (values (1),(2),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/min.sql b/yql/essentials/tests/sql/suites/agg_apply/min.sql
new file mode 100644
index 0000000000..60b25ff5c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/min.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ min(key)
+FROM (values (1),(2),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_column_subset.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_column_subset.sql
new file mode 100644
index 0000000000..ff904cf8cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_column_subset.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$x = select * from as_table([<|x:1,y:2,z:3|>, <|x:4,y:5,z:6|>]);
+select count(x + y) from $x;
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_len_count.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count.sql
new file mode 100644
index 0000000000..5b7a03d163
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ count(1)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_all.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_all.sql
new file mode 100644
index 0000000000..1f4310546b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_all.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ count(*)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_distinct.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_distinct.sql
new file mode 100644
index 0000000000..4768f51d23
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_distinct.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ count(distinct key)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_null.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_null.sql
new file mode 100644
index 0000000000..5821db7652
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_len_count_null.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ count(1/0)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_sum_divide_by_zero.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_sum_divide_by_zero.sql
new file mode 100644
index 0000000000..15236cd2ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_sum_divide_by_zero.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(1/0)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/opt_sum_null.sql b/yql/essentials/tests/sql/suites/agg_apply/opt_sum_null.sql
new file mode 100644
index 0000000000..c2086f7f5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/opt_sum_null.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(null)
+FROM (values (1),(null),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/pg_int4.sql b/yql/essentials/tests/sql/suites/agg_apply/pg_int4.sql
new file mode 100644
index 0000000000..7f2e790363
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/pg_int4.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ Pg::count(),Pg::count(key),Pg::min(key),Pg::max(key),Pg::sum(key),Pg::avg(key)
+FROM (values (1),(2),(3)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/pg_int8.sql b/yql/essentials/tests/sql/suites/agg_apply/pg_int8.sql
new file mode 100644
index 0000000000..523f23fc7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/pg_int8.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ Pg::count(),Pg::count(key),Pg::min(key),Pg::max(key),Pg::sum(key),Pg::avg(key)
+FROM (values (1l),(2l),(3l)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/pg_text.sql b/yql/essentials/tests/sql/suites/agg_apply/pg_text.sql
new file mode 100644
index 0000000000..abbb4d2016
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/pg_text.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ Pg::count(),Pg::count(key),Pg::min(key),Pg::max(key),Pg::string_agg(key,"|"u)
+FROM (values ("a"u),("b"u),("c"u)) as a(key)
diff --git a/yql/essentials/tests/sql/suites/agg_apply/some_notnull.sql b/yql/essentials/tests/sql/suites/agg_apply/some_notnull.sql
new file mode 100644
index 0000000000..7e3cd4fb3c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/some_notnull.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ some(key)
+FROM (values (1)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/some_null.sql b/yql/essentials/tests/sql/suites/agg_apply/some_null.sql
new file mode 100644
index 0000000000..2bf12e30d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/some_null.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ some(key)
+FROM (values (null)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_decimal.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_decimal.sql
new file mode 100644
index 0000000000..5ba05328dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_decimal.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (CAST("1.51" AS Decimal(10, 3))), (CAST("2.22" AS Decimal(10, 3))), (CAST("3.49" AS Decimal(10, 3)))) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_decimal_null.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_decimal_null.sql
new file mode 100644
index 0000000000..75df4277f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_decimal_null.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (CAST("1.51" AS Decimal(10, 3))), (null), (CAST("3.49" AS Decimal(10, 3)))) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_double.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_double.sql
new file mode 100644
index 0000000000..698e215e5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_double.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (1.51),(null),(3.49)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_interval.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_interval.sql
new file mode 100644
index 0000000000..b08de4bb54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_interval.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (cast(1 as Interval)),(null),(cast(3 as Interval))) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_signed.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_signed.sql
new file mode 100644
index 0000000000..ab731a9042
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_signed.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (1),(null),(3)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_type.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_type.sql
new file mode 100644
index 0000000000..552b64390c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_type.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$p =
+SELECT
+ sum(value) as a
+FROM AS_TABLE([<|key: 1, value: 2|>])
+;
+
+$p = PROCESS $p;
+select FormatType(TypeOf($p)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_type_empty.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_type_empty.sql
new file mode 100644
index 0000000000..292ddcc098
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_type_empty.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$p =
+SELECT
+ sum(value) as a
+FROM AS_TABLE([<|key: 1, value: 2|>])
+LIMIT 0
+;
+
+$p = PROCESS $p;
+select FormatType(TypeOf($p)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_type_group_by.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_type_group_by.sql
new file mode 100644
index 0000000000..112ca28e29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_type_group_by.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$p =
+SELECT
+ key, sum(value) as a
+FROM AS_TABLE([<|key: 1, value: 2|>])
+GROUP BY
+ key
+;
+
+$p = PROCESS $p;
+select FormatType(TypeOf($p)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/sum_unsigned.sql b/yql/essentials/tests/sql/suites/agg_apply/sum_unsigned.sql
new file mode 100644
index 0000000000..1fb4103665
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/sum_unsigned.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+SELECT
+ sum(key)
+FROM (values (1u),(null),(3u)) as a(key) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/table.cfg b/yql/essentials/tests/sql/suites/agg_apply/table.cfg
new file mode 100644
index 0000000000..e68191f82c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/table.cfg
@@ -0,0 +1 @@
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_apply/table.sql b/yql/essentials/tests/sql/suites/agg_apply/table.sql
new file mode 100644
index 0000000000..e81956b605
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_apply/table.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+select count(if(key=1,cast(key as string))) from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/agg_phases/avg.sql b/yql/essentials/tests/sql/suites/agg_phases/avg.sql
new file mode 100644
index 0000000000..c4ee64fe05
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/avg.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,avg(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/avg_null.sql b/yql/essentials/tests/sql/suites/agg_phases/avg_null.sql
new file mode 100644
index 0000000000..5399da509a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/avg_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,avg(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/avg_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/avg_opt.sql
new file mode 100644
index 0000000000..4d65617197
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/avg_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,avg(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count.sql b/yql/essentials/tests/sql/suites/agg_phases/count.sql
new file mode 100644
index 0000000000..56ebee9864
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count_all.sql b/yql/essentials/tests/sql/suites/agg_phases/count_all.sql
new file mode 100644
index 0000000000..b84047ec4d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count_all.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count_all_null.sql b/yql/essentials/tests/sql/suites/agg_phases/count_all_null.sql
new file mode 100644
index 0000000000..d66d1d3690
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count_all_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count_all_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/count_all_opt.sql
new file mode 100644
index 0000000000..cd818df3fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count_all_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count_null.sql b/yql/essentials/tests/sql/suites/agg_phases/count_null.sql
new file mode 100644
index 0000000000..428e6b1e9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/count_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/count_opt.sql
new file mode 100644
index 0000000000..97df3a4e5a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/count_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/default.cfg b/yql/essentials/tests/sql/suites/agg_phases/default.cfg
new file mode 100644
index 0000000000..800d911a03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/default.cfg
@@ -0,0 +1,2 @@
+udf stat_udf
+udf set_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_phases/max.sql b/yql/essentials/tests/sql/suites/agg_phases/max.sql
new file mode 100644
index 0000000000..bc80374fa6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/max.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,max(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/max_null.sql b/yql/essentials/tests/sql/suites/agg_phases/max_null.sql
new file mode 100644
index 0000000000..381d745ab5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/max_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,max(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/max_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/max_opt.sql
new file mode 100644
index 0000000000..00976d77bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/max_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,max(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min.sql b/yql/essentials/tests/sql/suites/agg_phases/min.sql
new file mode 100644
index 0000000000..3b10505ebf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min_by.sql b/yql/essentials/tests/sql/suites/agg_phases/min_by.sql
new file mode 100644
index 0000000000..ad1fbc54c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min_by.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min_by(a,a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min_by_null.sql b/yql/essentials/tests/sql/suites/agg_phases/min_by_null.sql
new file mode 100644
index 0000000000..d6b2cac34b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min_by_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min_by(a,a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min_by_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/min_by_opt.sql
new file mode 100644
index 0000000000..6382a1bee9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min_by_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min_by(a,a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min_by(a,a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min_by(value,value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min_null.sql b/yql/essentials/tests/sql/suites/agg_phases/min_null.sql
new file mode 100644
index 0000000000..3e2185e44f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/min_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/min_opt.sql
new file mode 100644
index 0000000000..268c0d3347
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/min_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/percentile.sql b/yql/essentials/tests/sql/suites/agg_phases/percentile.sql
new file mode 100644
index 0000000000..2ef5c32855
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/percentile.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,percentile(a, 0.1) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/percentile_null.sql b/yql/essentials/tests/sql/suites/agg_phases/percentile_null.sql
new file mode 100644
index 0000000000..6a94334f4f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/percentile_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,percentile(a, 0.1) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/percentile_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/percentile_opt.sql
new file mode 100644
index 0000000000..fd7dd6e529
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/percentile_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,percentile(a, 0.1) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,percentile(a, 0.1) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,percentile(value, 0.1) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/sum.sql b/yql/essentials/tests/sql/suites/agg_phases/sum.sql
new file mode 100644
index 0000000000..5d9f78108c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/sum.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/sum_null.sql b/yql/essentials/tests/sql/suites/agg_phases/sum_null.sql
new file mode 100644
index 0000000000..d20e645c5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/sum_null.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases/sum_opt.sql b/yql/essentials/tests/sql/suites/agg_phases/sum_opt.sql
new file mode 100644
index 0000000000..2759e2c08c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases/sum_opt.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg.sql
new file mode 100644
index 0000000000..564ec476bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,avg(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg_decimal.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg_decimal.sql
new file mode 100644
index 0000000000..8f07f9c15b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/avg_decimal.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: decimal("2.1", 7, 2)|>,<|key: 1, value: decimal("3.5", 7, 2)|>]);
+
+$p =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,avg(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,avg(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,avg(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count.sql
new file mode 100644
index 0000000000..a75397a0ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all.sql
new file mode 100644
index 0000000000..878cd65074
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_null.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_null.sql
new file mode 100644
index 0000000000..3d42d0ab32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_null.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_opt.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_opt.sql
new file mode 100644
index 0000000000..fa43be06ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_all_opt.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(*) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_null.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_null.sql
new file mode 100644
index 0000000000..45ee799fb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_null.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_opt.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_opt.sql
new file mode 100644
index 0000000000..e1847bf2bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/count_opt.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,count(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,count(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,count(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/default.cfg b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/default.cfg
new file mode 100644
index 0000000000..800d911a03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/default.cfg
@@ -0,0 +1,2 @@
+udf stat_udf
+udf set_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/max.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/max.sql
new file mode 100644
index 0000000000..3e686cc67b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/max.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,max(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,max(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,max(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/min.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/min.sql
new file mode 100644
index 0000000000..8c585d542c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/min.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,min(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,min(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,min(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_notnull.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_notnull.sql
new file mode 100644
index 0000000000..dbd7272f46
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_notnull.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 2|>]);
+
+$p =
+SELECT
+ key,some(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,some(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,some(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_null.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_null.sql
new file mode 100644
index 0000000000..83366018f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/some_null.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,some(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,some(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,some(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,some(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum.sql
new file mode 100644
index 0000000000..8a485acc99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: 2|>,<|key: 1, value: 3|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_null.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_null.sql
new file mode 100644
index 0000000000..aeaf87c155
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_null.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: null|>,<|key: 1, value: null|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_opt.sql b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_opt.sql
new file mode 100644
index 0000000000..5771982842
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/agg_phases_agg_apply/sum_opt.sql
@@ -0,0 +1,81 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma EmitAggApply;
+
+$t = SELECT * FROM AS_TABLE([<|key: 1, value: just(2)|>,<|key: 1, value: just(3)|>]);
+
+$p =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with combine
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with combinestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+$p = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergestate
+ ;
+
+$p = PROCESS $p;
+--select FormatType(TypeOf($p));
+select * from $p;
+
+
+$p1 = SELECT
+ key,sum(a) as a
+FROM $p
+GROUP BY
+ key
+ with mergefinalize
+ ;
+
+$p1 = PROCESS $p1;
+--select FormatType(TypeOf($p1));
+select * from $p1;
+
+$p2 = SELECT
+ key,sum(a) as a
+FROM (select key, just(a) as a from $p)
+GROUP BY
+ key
+ with mergemanyfinalize
+ ;
+
+$p2 = PROCESS $p2;
+--select FormatType(TypeOf($p2));
+select * from $p2;
+
+$p3 =
+SELECT
+ key,sum(value) as a
+FROM $t
+GROUP BY
+ key
+ with finalize
+ ;
+
+$p3 = PROCESS $p3;
+--select FormatType(TypeOf($p));
+select * from $p3;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/avg.sql b/yql/essentials/tests/sql/suites/aggr_factory/avg.sql
new file mode 100644
index 0000000000..1352062811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/avg.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("avg");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/avg_distinct_expr.sql b/yql/essentials/tests/sql/suites/aggr_factory/avg_distinct_expr.sql
new file mode 100644
index 0000000000..984c21a13f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/avg_distinct_expr.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a), AsStruct(1 as a));
+$f = AGGREGATION_FACTORY("avg");
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+
+select AGGREGATE_BY(distinct cast(Unicode::ToLower(cast(a as Utf8) || "00"u) as Int), $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/avg_if.sql b/yql/essentials/tests/sql/suites/aggr_factory/avg_if.sql
new file mode 100644
index 0000000000..7fc60b5b1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/avg_if.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("avg_if");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return AsTuple($z.a,$z.a<2)}))));
+
+use plato;
+insert into @a select AsTuple(a,a<2) as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/bitand.sql b/yql/essentials/tests/sql/suites/aggr_factory/bitand.sql
new file mode 100644
index 0000000000..419b6bf336
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/bitand.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1u as a),AsStruct(2u as a));
+$f = AGGREGATION_FACTORY("bitand");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/bitor.sql b/yql/essentials/tests/sql/suites/aggr_factory/bitor.sql
new file mode 100644
index 0000000000..f9808d27c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/bitor.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1u as a),AsStruct(2u as a));
+$f = AGGREGATION_FACTORY("bitor");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/bitxor.sql b/yql/essentials/tests/sql/suites/aggr_factory/bitxor.sql
new file mode 100644
index 0000000000..fcb872944f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/bitxor.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1u as a),AsStruct(2u as a));
+$f = AGGREGATION_FACTORY("bitxor");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/booland.sql b/yql/essentials/tests/sql/suites/aggr_factory/booland.sql
new file mode 100644
index 0000000000..03b483ee5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/booland.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(true as a),AsStruct(false as a));
+$f = AGGREGATION_FACTORY("booland");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/boolor.sql b/yql/essentials/tests/sql/suites/aggr_factory/boolor.sql
new file mode 100644
index 0000000000..c54cac9205
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/boolor.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(true as a),AsStruct(false as a));
+$f = AGGREGATION_FACTORY("boolor");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/bottom.sql b/yql/essentials/tests/sql/suites/aggr_factory/bottom.sql
new file mode 100644
index 0000000000..f663c39d63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/bottom.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(7 as a),
+ AsStruct(4 as a),
+ AsStruct(5 as a),
+ AsStruct(1 as a),
+ AsStruct(2 as a),
+ AsStruct(9 as a),
+ AsStruct(1 as a),
+ AsStruct(9 as a)
+);
+
+$f = AGGREGATION_FACTORY("bottom", 3);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return $z.a }))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+
+select AGGREGATE_BY(a, $f) from @a;
+select AGGREGATE_BY(distinct a, $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/bottom_by.sql b/yql/essentials/tests/sql/suites/aggr_factory/bottom_by.sql
new file mode 100644
index 0000000000..f5ee53bd8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/bottom_by.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(1 as key, 101 as value),
+ AsStruct(6 as key, 34 as value),
+ AsStruct(4 as key, 22 as value),
+ AsStruct(2 as key, 256 as value),
+ AsStruct(7 as key, 111 as value)
+);
+
+$f = AGGREGATION_FACTORY("bottomby", 3);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+use plato;
+insert into @a select AsTuple(value, key) as vk from as_table($t);
+commit;
+
+select AGGREGATE_BY(vk, $f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/container.sql b/yql/essentials/tests/sql/suites/aggr_factory/container.sql
new file mode 100644
index 0000000000..303e3035f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/container.sql
@@ -0,0 +1,61 @@
+/* syntax version 1 */
+/* postgres can not */
+$factory = AGGREGATION_FACTORY("sum");
+
+select ListAggregate(ListCreate(Int32), $factory);
+select ListAggregate(AsList(1, 2, 3), $factory);
+select ListAggregate(Just(AsList(1, 2, 3)), $factory);
+select ListAggregate(Nothing(ParseType("List<Int32>?")), $factory);
+
+$factory = AGGREGATION_FACTORY("count");
+
+select ListAggregate(ListCreate(Int32), $factory);
+select ListAggregate(AsList(1, 2, 3), $factory);
+select ListAggregate(Just(AsList(1, 2, 3)), $factory);
+select ListAggregate(Nothing(ParseType("List<Int32>?")), $factory);
+
+$factory = AGGREGATION_FACTORY("sum");
+
+select ListSort(DictItems(DictAggregate(
+ DictCreate(ParseType("String"), ParseType("List<Int32>"))
+ , $factory)));
+
+select ListSort(DictItems(DictAggregate(
+ AsDict(
+ AsTuple("foo", AsList(1, 3)),
+ AsTuple("bar", AsList(2))
+ ), $factory)));
+
+
+select ListSort(DictItems(DictAggregate(
+ Just(AsDict(
+ AsTuple("foo", AsList(1, 3)),
+ AsTuple("bar", AsList(2))
+ )), $factory)));
+
+select ListSort(DictItems(DictAggregate(
+ Nothing(ParseType("Dict<String, List<Int32>>?"))
+ , $factory)));
+
+$factory = AGGREGATION_FACTORY("count");
+
+select ListSort(DictItems(DictAggregate(
+ DictCreate(ParseType("String"), ParseType("List<Int32>"))
+ , $factory)));
+
+select ListSort(DictItems(DictAggregate(
+ AsDict(
+ AsTuple("foo", AsList(1, 3)),
+ AsTuple("bar", AsList(2))
+ ), $factory)));
+
+
+select ListSort(DictItems(DictAggregate(
+ Just(AsDict(
+ AsTuple("foo", AsList(1, 3)),
+ AsTuple("bar", AsList(2))
+ )), $factory)));
+
+select ListSort(DictItems(DictAggregate(
+ Nothing(ParseType("Dict<String, List<Int32>>?"))
+ , $factory)));
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/container_empty.sql b/yql/essentials/tests/sql/suites/aggr_factory/container_empty.sql
new file mode 100644
index 0000000000..d76fe8317f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/container_empty.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+select ListAggregate([],AGGREGATION_FACTORY("sum"));
+select ListAggregate([1,2],AGGREGATION_FACTORY("sum"));
+select ListAggregate(Just([1,2]),AGGREGATION_FACTORY("sum"));
+select ListAggregate(null,AGGREGATION_FACTORY("sum"));
+select DictAggregate({},AGGREGATION_FACTORY("sum"));
+select DictAggregate({'a':[2,3]},AGGREGATION_FACTORY("sum"));
+select DictAggregate(Just({'a':[2,3]}),AGGREGATION_FACTORY("sum"));
+select DictAggregate(null,AGGREGATION_FACTORY("sum"));
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/corellation.sql b/yql/essentials/tests/sql/suites/aggr_factory/corellation.sql
new file mode 100644
index 0000000000..d42c5259ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/corellation.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("correlation");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return AsTuple($z.a,-$z.a)}))));
+
+use plato;
+insert into @a select AsTuple(a,-a) as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/count.sql b/yql/essentials/tests/sql/suites/aggr_factory/count.sql
new file mode 100644
index 0000000000..3e209eb11f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/count.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("count");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/count_if.sql b/yql/essentials/tests/sql/suites/aggr_factory/count_if.sql
new file mode 100644
index 0000000000..a3dbd155b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/count_if.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(true as a),AsStruct(false as a));
+$f = AGGREGATION_FACTORY("countif");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/def_value_full_table.sql b/yql/essentials/tests/sql/suites/aggr_factory/def_value_full_table.sql
new file mode 100644
index 0000000000..2d2af73022
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/def_value_full_table.sql
@@ -0,0 +1,63 @@
+$my_table =
+SELECT
+ 1 AS id
+ , 1 AS ts
+ , 4 AS value1
+ , 5 AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 10 AS ts
+ , 40 AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 2 AS id
+ , 1 AS ts
+ , NULL AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 1 AS id
+ , 2 AS ts
+ , 4 AS value1
+ , 5 AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 2 AS ts
+ , 40 AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 5 AS ts
+ , 2 AS value1
+ , 7 AS value2
+;
+
+-- ЭмулÑÑ†Ð¸Ñ Ð°Ð³Ñ€ÐµÐ³Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð¾Ð¹ функции COUNT
+$cnt_create = ($_item, $_parent) -> { return 1ul };
+$cnt_add = ($state, $_item, $_parent) -> { return 1ul + $state };
+$cnt_merge = ($state1, $state2) -> { return $state1 + $state2 };
+$cnt_get_result = ($state) -> { return $state };
+$cnt_serialize = ($state) -> { return $state };
+$cnt_deserialize = ($state) -> { return $state };
+$cnt_default = 0l;
+
+$cnt_udaf_factory = AggregationFactory(
+ "UDAF",
+ $cnt_create,
+ $cnt_add,
+ $cnt_merge,
+ $cnt_get_result,
+ $cnt_serialize,
+ $cnt_deserialize,
+ $cnt_default
+);
+
+
+SELECT
+ AGGREGATE_BY(value1, $cnt_udaf_factory) AS cnt1
+FROM $my_table
+;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/def_value_with_keys.sql b/yql/essentials/tests/sql/suites/aggr_factory/def_value_with_keys.sql
new file mode 100644
index 0000000000..848ce00cf0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/def_value_with_keys.sql
@@ -0,0 +1,66 @@
+$my_table =
+SELECT
+ 1 AS id
+ , 1 AS ts
+ , 4 AS value1
+ , 5 AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 10 AS ts
+ , 40 AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 2 AS id
+ , 1 AS ts
+ , NULL AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 1 AS id
+ , 2 AS ts
+ , 4 AS value1
+ , 5 AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 2 AS ts
+ , 40 AS value1
+ , NULL AS value2
+UNION ALL
+SELECT
+ 3 AS id
+ , 5 AS ts
+ , 2 AS value1
+ , 7 AS value2
+;
+
+-- ЭмулÑÑ†Ð¸Ñ Ð°Ð³Ñ€ÐµÐ³Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð¾Ð¹ функции COUNT
+$cnt_create = ($_item, $_parent) -> { return 1ul };
+$cnt_add = ($state, $_item, $_parent) -> { return 1ul + $state };
+$cnt_merge = ($state1, $state2) -> { return $state1 + $state2 };
+$cnt_get_result = ($state) -> { return $state };
+$cnt_serialize = ($state) -> { return $state };
+$cnt_deserialize = ($state) -> { return $state };
+$cnt_default = 0ul;
+
+$cnt_udaf_factory = AggregationFactory(
+ "UDAF",
+ $cnt_create,
+ $cnt_add,
+ $cnt_merge,
+ $cnt_get_result,
+ $cnt_serialize,
+ $cnt_deserialize,
+ $cnt_default
+);
+
+
+SELECT
+ id,
+ AGGREGATE_BY(value1, $cnt_udaf_factory) AS cnt1
+FROM $my_table
+GROUP BY
+ id
+;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/default.cfg b/yql/essentials/tests/sql/suites/aggr_factory/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/default.cfg
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/every.sql b/yql/essentials/tests/sql/suites/aggr_factory/every.sql
new file mode 100644
index 0000000000..d44ae81d3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/every.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(true as a),AsStruct(false as a));
+$f = AGGREGATION_FACTORY("every");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/flatten.cfg b/yql/essentials/tests/sql/suites/aggr_factory/flatten.cfg
new file mode 100644
index 0000000000..8c22472a41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/flatten.cfg
@@ -0,0 +1 @@
+udf set_udf
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/flatten.sql b/yql/essentials/tests/sql/suites/aggr_factory/flatten.sql
new file mode 100644
index 0000000000..e4b8be9bce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/flatten.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$f = AGGREGATION_FACTORY("sum");
+$g = AggregateFlatten($f);
+select
+ ListAggregate([1,2,3], $f),
+ ListAggregate(ListCreate(List<Int32>), $g),
+ ListAggregate([ListCreate(Int32)], $g),
+ ListAggregate([ListCreate(Int32),ListCreate(Int32)], $g),
+ ListAggregate([[1,2]], $g),
+ ListAggregate([[1,2],[3]], $g),
+ ListAggregate([ListCreate(Int32),[3]], $g),
+ ListAggregate([[1,2],ListCreate(Int32)], $g);
+
+$i = AGGREGATION_FACTORY("AGGREGATE_LIST_DISTINCT");
+$j = AggregateFlatten($i);
+select AggregateBy(x, $j) from (
+ select [1,2] as x
+ union all
+ select [2,3] as x
+);
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/histogram.sql b/yql/essentials/tests/sql/suites/aggr_factory/histogram.sql
new file mode 100644
index 0000000000..1a058a8f2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/histogram.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("histogram");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return AsTuple($z.a,1.0)}))));
+
+$f = AGGREGATION_FACTORY("histogram", 5);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return AsTuple($z.a,1.0)}))));
+
+use plato;
+insert into @a select AsTuple(a, 1.0) as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/hll.sql b/yql/essentials/tests/sql/suites/aggr_factory/hll.sql
new file mode 100644
index 0000000000..9a2c1f0716
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/hll.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("hll");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("hll", 4);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/input.txt b/yql/essentials/tests/sql/suites/aggr_factory/input.txt
new file mode 100644
index 0000000000..70dd8b1eff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/input.txt
@@ -0,0 +1,4 @@
+{"key"=1;"subkey"=10;"value"=5};
+{"key"=1;"subkey"=20;"value"=6};
+{"key"=1;"subkey"=30;"value"=7};
+{"key"=0;"subkey"=40;"value"=8};
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/input.txt.attr b/yql/essentials/tests/sql/suites/aggr_factory/input.txt.attr
new file mode 100644
index 0000000000..84791918db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ]
+ ]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/linear_histogram.sql b/yql/essentials/tests/sql/suites/aggr_factory/linear_histogram.sql
new file mode 100644
index 0000000000..68db6ad402
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/linear_histogram.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("linearhistogram");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("linearhistogram", 10, 0.0, 1000.0);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select a as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/list.cfg b/yql/essentials/tests/sql/suites/aggr_factory/list.cfg
new file mode 100644
index 0000000000..5c248bff3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/list.cfg
@@ -0,0 +1 @@
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/list.sql b/yql/essentials/tests/sql/suites/aggr_factory/list.sql
new file mode 100644
index 0000000000..bc43f37032
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/list.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("aggregate_list");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("aggregate_list", length(CAST(Unicode::ToUpper("xx"u) AS String)));
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select ListSort(AGGREGATE_BY(a,$f)) from @a;
+select ListSort(AGGREGATE_BY(distinct a,$f)) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/log_histogram.sql b/yql/essentials/tests/sql/suites/aggr_factory/log_histogram.sql
new file mode 100644
index 0000000000..1b5bd50199
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/log_histogram.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("loghistogram");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("loghistogram", 10, 0.01, 1000.0);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select a as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/logariphmic_histogram.sql b/yql/essentials/tests/sql/suites/aggr_factory/logariphmic_histogram.sql
new file mode 100644
index 0000000000..a11941be69
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/logariphmic_histogram.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("logarithmichistogram");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("logarithmichistogram", 10, 0.01, 1000.0);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select a as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/max.sql b/yql/essentials/tests/sql/suites/aggr_factory/max.sql
new file mode 100644
index 0000000000..a0e854663c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/max.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("max");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/max_by.sql b/yql/essentials/tests/sql/suites/aggr_factory/max_by.sql
new file mode 100644
index 0000000000..0e7cfaf37f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/max_by.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(1 as key, 200 as value),
+ AsStruct(2 as key, 100 as value)
+);
+
+$f = AGGREGATION_FACTORY("maxby");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+$f = AGGREGATION_FACTORY("maxby", 10);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+use plato;
+insert into @a select AsTuple(value, key) as vk from as_table($t);
+commit;
+select AGGREGATE_BY(vk, $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/median.sql b/yql/essentials/tests/sql/suites/aggr_factory/median.sql
new file mode 100644
index 0000000000..19921bbcbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/median.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("median");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("percentile", 0.9);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/min.sql b/yql/essentials/tests/sql/suites/aggr_factory/min.sql
new file mode 100644
index 0000000000..d101099550
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/min.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("min");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/min_by.sql b/yql/essentials/tests/sql/suites/aggr_factory/min_by.sql
new file mode 100644
index 0000000000..4b1d240aa0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/min_by.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(1 as key, 200 as value),
+ AsStruct(2 as key, 100 as value)
+);
+
+$f = AGGREGATION_FACTORY("minby");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+$f = AGGREGATION_FACTORY("minby", 10);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+use plato;
+insert into @a select AsTuple(value, key) as vk from as_table($t);
+commit;
+select AGGREGATE_BY(vk, $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/mode.sql b/yql/essentials/tests/sql/suites/aggr_factory/mode.sql
new file mode 100644
index 0000000000..496cd4e4d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/mode.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("mode");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$f = AGGREGATION_FACTORY("topfreq", 10, 20);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select ListSort(AGGREGATE_BY(distinct a,$f), ($x)->{ return $x.Value }) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi.cfg b/yql/essentials/tests/sql/suites/aggr_factory/multi.cfg
new file mode 100644
index 0000000000..fad550d3a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf top_udf
+udf set_udf
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi.sql
new file mode 100644
index 0000000000..e6b0638f14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$input = (select AsStruct(
+ key as key,
+ Just(subkey) as subkey,
+ Just(value) as value) as nums from Input);
+
+SELECT
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("count")) as count,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("min")) as min,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("max")) as max,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("sum")) as sum,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("avg")) as avg,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("stddev")) as stddev,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("percentile", 0.5)) as p50,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("aggregate_list")) as agg_list,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("aggregate_list_distinct")) as agg_list_distinct,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("mode")) as mode,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("top", 3)) as top,
+FROM $input;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_list.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_list.sql
new file mode 100644
index 0000000000..7a142eb664
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_list.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input =
+select AsList(
+ 1,
+ 2,
+ 3
+) as nums
+union all
+select AsList(
+ 4,
+ 5) as nums;
+
+SELECT
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("count")) as count,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("min")) as min,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("max")) as max,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("sum")) as sum,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("avg")) as avg,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("stddev")) as stddev,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("percentile", 0.5)) as p50,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("aggregate_list")) as agg_list
+FROM $input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_list_distinct_expr.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_list_distinct_expr.sql
new file mode 100644
index 0000000000..4795014fa6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_list_distinct_expr.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input =
+select AsList(
+ 1,
+ 2,
+ 3
+) as nums
+union all
+select AsList(
+ 4,
+ 5) as nums
+union all
+select AsList(
+ 1,
+ 2,
+ 3
+) as nums;
+
+SELECT
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("count")) as count,
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("min")) as min,
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("max")) as max,
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("sum")) as sum,
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("percentile", 0.5)) as p50,
+ MULTI_AGGREGATE_BY(distinct ListExtend(nums, AsList(1,5)), AGGREGATION_FACTORY("aggregate_list")) as agg_list
+FROM $input;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_list_nulls.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_list_nulls.sql
new file mode 100644
index 0000000000..103e92c047
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_list_nulls.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = AsList(
+ AsStruct(AsList(1.0, 2.0) as x),
+ AsStruct(AsList(3.0, 4.0) as x),
+ AsStruct(AsList(NULL, NULL) as x),
+ AsStruct(AsList(2.0, 3.0, 4.0) as x),
+);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ AS_TABLE($data);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ (SELECT * FROM AS_TABLE($data) LIMIT 0);
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_minmaxby.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_minmaxby.sql
new file mode 100644
index 0000000000..4d8628971b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_minmaxby.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("minby"))
+FROM (select TableRow() as nums from AS_TABLE([<|x:(1,6)|>,<|x:(3,4)|>,<|x:(5,2)|>]));
+
+
+SELECT
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("maxby", 2))
+FROM (select TableRow() as nums from AS_TABLE([<|x:(1,6)|>,<|x:(3,4)|>,<|x:(5,2)|>]));
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_struct_nulls.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_struct_nulls.sql
new file mode 100644
index 0000000000..11f7139d11
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_struct_nulls.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = AsList(
+ AsStruct(AsStruct(1.0 as a, 2 as b) as x),
+ AsStruct(AsStruct(3.0 as a, 4 as b) as x),
+ AsStruct(AsStruct(NULL as a, NULL as b) as x),
+ AsStruct(AsStruct(2.0 as a, 3 as b, 4.0 as c) as x),
+);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ AS_TABLE($data);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ (SELECT * FROM AS_TABLE($data) LIMIT 0);
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple.sql
new file mode 100644
index 0000000000..f12d7460a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input =
+select AsTuple(
+ 1,
+ Just(2),
+ Just(3)) as nums
+union all
+select AsTuple(4,
+ Just(5),
+ Just(6)) as nums;
+
+SELECT
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("count")) as count,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("min")) as min,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("max")) as max,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("sum")) as sum,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("avg")) as avg,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("stddev")) as stddev,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("percentile", 0.5)) as p50,
+ MULTI_AGGREGATE_BY(nums, AGGREGATION_FACTORY("aggregate_list")) as agg_list,
+FROM $input;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple_nulls.sql b/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple_nulls.sql
new file mode 100644
index 0000000000..6760707800
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/multi_tuple_nulls.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = AsList(
+ AsStruct(AsTuple(1.0, 2) as x),
+ AsStruct(AsTuple(3.0, 4) as x),
+ AsStruct(AsTuple(NULL, NULL) as x),
+ AsStruct(AsTuple(2.0, 3) as x),
+);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ AS_TABLE($data);
+
+SELECT
+ MULTI_AGGREGATE_BY(x, AggregationFactory("agg_list")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("avg")),
+ MULTI_AGGREGATE_BY(x, AggregationFactory("count")),
+FROM
+ (SELECT * FROM AS_TABLE($data) LIMIT 0);
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/some.sql b/yql/essentials/tests/sql/suites/aggr_factory/some.sql
new file mode 100644
index 0000000000..83f5a52a29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/some.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(1 as a));
+$f = AGGREGATION_FACTORY("some");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/stddev.sql b/yql/essentials/tests/sql/suites/aggr_factory/stddev.sql
new file mode 100644
index 0000000000..7e46f46e5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/stddev.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("stddev");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/sum_if.sql b/yql/essentials/tests/sql/suites/aggr_factory/sum_if.sql
new file mode 100644
index 0000000000..b48b38e153
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/sum_if.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("sum_if");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return AsTuple($z.a,$z.a>1)}))));
+
+use plato;
+insert into @a select AsTuple(a,a>1) as aa from as_table($t);
+commit;
+select AGGREGATE_BY(aa,$f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/top.sql b/yql/essentials/tests/sql/suites/aggr_factory/top.sql
new file mode 100644
index 0000000000..dd50c1351f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/top.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(7 as a),
+ AsStruct(4 as a),
+ AsStruct(5 as a),
+ AsStruct(1 as a),
+ AsStruct(2 as a),
+ AsStruct(9 as a),
+ AsStruct(1 as a),
+ AsStruct(9 as a));
+
+$f = AGGREGATION_FACTORY("top", 3);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return $z.a }))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+
+select AGGREGATE_BY(a, $f) from @a;
+select AGGREGATE_BY(distinct a, $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/top_by.sql b/yql/essentials/tests/sql/suites/aggr_factory/top_by.sql
new file mode 100644
index 0000000000..f63186dcda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/top_by.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(
+ AsStruct(1 as key, 101 as value),
+ AsStruct(6 as key, 34 as value),
+ AsStruct(4 as key, 22 as value),
+ AsStruct(2 as key, 256 as value),
+ AsStruct(7 as key, 111 as value)
+);
+
+$f = AGGREGATION_FACTORY("topby", 3);
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"),
+ $f(ListItemType(TypeOf($t)), ($z)->{ return AsTuple($z.value, $z.key) }))));
+
+use plato;
+insert into @a select AsTuple(value, key) as vk from as_table($t);
+commit;
+
+select AGGREGATE_BY(vk, $f) from @a;
+
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/transform_input.sql b/yql/essentials/tests/sql/suites/aggr_factory/transform_input.sql
new file mode 100644
index 0000000000..0a92f6d097
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/transform_input.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$f = AGGREGATION_FACTORY("sum");
+$g = AggregateTransformInput($f, ($x)->(cast($x as Int32)));
+$h = AggregateTransformInput($f, ($x)->($x * 2));
+select ListAggregate([1,2,3], $f);
+select ListAggregate(["1","2","3"], $g);
+select ListAggregate([1,2,3], $h); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/transform_output.sql b/yql/essentials/tests/sql/suites/aggr_factory/transform_output.sql
new file mode 100644
index 0000000000..4598192464
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/transform_output.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$f = AGGREGATION_FACTORY("sum");
+$g = AggregateTransformOutput($f, ($x)->(cast($x as String)));
+$h = AggregateTransformOutput($f, ($x)->($x * 2));
+select ListAggregate([1,2,3], $f);
+select ListAggregate([1,2,3], $g);
+select ListAggregate([1,2,3], $h); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/udaf.sql b/yql/essentials/tests/sql/suites/aggr_factory/udaf.sql
new file mode 100644
index 0000000000..d419f8767f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/udaf.sql
@@ -0,0 +1,26 @@
+/* syntax version 1 */
+/* postgres can not */
+-- count example
+$create = ($_item, $_parent) -> { return 1 };
+$add = ($state, $_item, $_parent) -> { return 1 + $state };
+$merge = ($state1, $state2) -> { return $state1 + $state2 };
+$get_result = ($state) -> { return $state };
+$serialize = ($state) -> { return $state };
+$deserialize = ($state) -> { return $state };
+$default = 0;
+
+$f = AGGREGATION_FACTORY("udaf", $create, $add, $merge, $get_result, $serialize, $deserialize, $default);
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+$t = AsList(AsStruct(1/0 as a),AsStruct(2/0 as a));
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/udaf_distinct_expr.sql b/yql/essentials/tests/sql/suites/aggr_factory/udaf_distinct_expr.sql
new file mode 100644
index 0000000000..15a4fe7c64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/udaf_distinct_expr.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+-- count example
+$create = ($_item, $_parent) -> { return 1 };
+$add = ($state, $_item, $_parent) -> { return 1 + $state };
+$merge = ($state1, $state2) -> { return $state1 + $state2 };
+$get_result = ($state) -> { return $state };
+$serialize = ($state) -> { return $state };
+$deserialize = ($state) -> { return $state };
+$default = 0;
+
+$f = AGGREGATION_FACTORY("udaf", $create, $add, $merge, $get_result, $serialize, $deserialize, $default);
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a), AsStruct(1 as a));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+
+select AGGREGATE_BY(distinct cast(Unicode::ToLower(cast(a as Utf8) || "00"u) as Int), $f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/udaf_in_udaf.sql b/yql/essentials/tests/sql/suites/aggr_factory/udaf_in_udaf.sql
new file mode 100644
index 0000000000..49194de507
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/udaf_in_udaf.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+
+$merge_dicts = ($dict1, $dict2) -> { return SetUnion($dict1, $dict2, ($_key, $a, $b) -> { RETURN Coalesce($a, 0) + Coalesce($b, 0) }) };
+
+$create_single_item_dict = ($item, $_parent) -> { return AsDict(AsTuple($item, 1)) };
+$count_values = AGGREGATION_FACTORY(
+ "UDAF",
+ $create_single_item_dict,
+ ($dict, $item, $parent) -> { return $merge_dicts($create_single_item_dict($item, $parent), $dict) },
+ $merge_dicts
+);
+
+$create_dict_from_list = ($list, $_parent) -> { return ListAggregate($list, $count_values) };
+$add_list_to_dict = ($dict, $list, $parent) -> { return $merge_dicts($create_dict_from_list($list, $parent), $dict) };
+$count_list_values = AGGREGATION_FACTORY(
+ "UDAF",
+ $create_dict_from_list,
+ $add_list_to_dict,
+ $merge_dicts
+);
+
+$test_data = AsList(AsList(1,2),AsList(3,2),AsList(3,3),AsList(1,3),AsList(3,1),AsList(2,2));
+SELECT
+ ListSort(DictItems(ListAggregate(AsList(1,2,3,2,3,3), $count_values))) AS count_values,
+ ListSort(DictItems(ListAggregate($test_data, $count_list_values))) AS count_list_values,
diff --git a/yql/essentials/tests/sql/suites/aggr_factory/variance.sql b/yql/essentials/tests/sql/suites/aggr_factory/variance.sql
new file mode 100644
index 0000000000..2573bd6e66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggr_factory/variance.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+$t = AsList(AsStruct(1 as a),AsStruct(2 as a));
+$f = AGGREGATION_FACTORY("variance");
+
+select Yql::Aggregate($t, AsTuple(), AsTuple(AsTuple(AsAtom("res"), $f(
+ ListItemType(TypeOf($t)), ($z)->{return $z.a}))));
+
+use plato;
+insert into @a select * from as_table($t);
+commit;
+select AGGREGATE_BY(a,$f) from @a;
+select AGGREGATE_BY(distinct a,$f) from @a;
diff --git a/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.cfg b/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.sql b/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.sql
new file mode 100644
index 0000000000..fcb528e1e9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/GroupByOneField.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select sum(c) as sumc, max(d) as maxd from plato.Input group by a order by sumc, maxd;
diff --git a/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.cfg b/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.sql b/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.sql
new file mode 100644
index 0000000000..94ea550019
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/GroupByTwoFields.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select sum(c) as sum_c, max(d) as max_d from plato.Input group by a, b order by sum_c, max_d;
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.cfg b/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.cfg
new file mode 100644
index 0000000000..73dfbac8bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.cfg
@@ -0,0 +1 @@
+in Input dedup_state_keys.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.sql b/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.sql
new file mode 100644
index 0000000000..a728c4895c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_filter_pushdown.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+USE plato;
+
+select * from (
+ select key, subkey, max(value) from Input group by key, subkey
+ having count(*) < 100 and subkey > "0"
+)
+where key > "1" and Likely(subkey < "4")
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_full_table_list.sql b/yql/essentials/tests/sql/suites/aggregate/agg_full_table_list.sql
new file mode 100644
index 0000000000..5f95cf878b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_full_table_list.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+select agglist(x) from (
+select 1 as x
+);
+
+
+select agglist(x) from (
+select 1 as x
+limit 0
+);
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_phases_table1.sql b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table1.sql
new file mode 100644
index 0000000000..9b657bd938
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table1.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+pragma EmitAggApply;
+
+pragma yt.UseAggPhases = "1";
+
+SELECT
+ key,
+ count(value)
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_phases_table2.sql b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table2.sql
new file mode 100644
index 0000000000..d434180941
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table2.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+pragma EmitAggApply;
+
+pragma yt.UseAggPhases = "1";
+
+SELECT
+ key,
+ count(distinct value)
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/aggregate/agg_phases_table3.sql b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table3.sql
new file mode 100644
index 0000000000..a39958bac3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/agg_phases_table3.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+pragma EmitAggApply;
+
+pragma yt.UseAggPhases = "1";
+
+SELECT
+ key,
+ count(value),
+ count(distinct value)
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_by_column_lookup_in_const_dict.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_by_column_lookup_in_const_dict.sql
new file mode 100644
index 0000000000..e38a70598d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_by_column_lookup_in_const_dict.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+USE plato;
+
+$dict = AsDict(("800", "foo"));
+
+SELECT
+ lookup_result
+FROM Input
+GROUP BY $dict[key] ?? "bar" AS lookup_result
+ORDER BY lookup_result;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_by_one_column.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_by_one_column.sql
new file mode 100644
index 0000000000..d2127859b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_by_one_column.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select key, "WAT" as subkey, Max(value) as value from plato.Input group by key order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr.sql
new file mode 100644
index 0000000000..46f2a248c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+
+select
+ sum(distinct cast(Unicode::ToLower(CAST(subkey AS Utf8)) as Int32)) + sum(distinct cast(Unicode::ToUpper(CAST(subkey AS Utf8)) as Uint64)) as sks,
+ ListSort(aggregate_list(distinct key || "_")) as kl
+from Input3;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_groupby_expr.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_groupby_expr.sql
new file mode 100644
index 0000000000..ffc79038d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_groupby_expr.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+
+select key,
+ sum(distinct cast(Unicode::ToLower(CAST(subkey AS Utf8)) as Int32)) + sum(distinct cast(Unicode::ToUpper(CAST(subkey AS Utf8)) as Uint64)) as sks,
+ aggregate_list(distinct key || "") as kl
+from Input3
+group by key || "foo" as key
+order by key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.cfg
new file mode 100644
index 0000000000..6a677c3b7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.cfg
@@ -0,0 +1,2 @@
+in Input2 input2.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.sql
new file mode 100644
index 0000000000..456f3a9ab8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_expr_with_udf.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select
+ Math::Round(count(distinct Math::Round(cast(key as Int32)))/100.0, -2)
+from Input2;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_in_access_node_exprs.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_in_access_node_exprs.sql
new file mode 100644
index 0000000000..0f0c3b68b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_in_access_node_exprs.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ key,
+ AGGREGATE_LIST(DISTINCT cast(subkey as Int32))[COUNT(DISTINCT cast(subkey as Uint64)) - 1] as foo
+FROM
+ AS_TABLE([<|key:1, subkey:"1"|>,
+ <|key:2, subkey:"2"|>,
+ <|key:1, subkey:"1"|>,
+ <|key:2, subkey:"2"|>])
+GROUP BY key
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_list.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_list.sql
new file mode 100644
index 0000000000..ee6f70e39d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_list.sql
@@ -0,0 +1,38 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+insert into @foo
+select AsList(1,2) as x
+union all
+select AsList(1,3) as x
+union all
+select AsList(1,2) as x;
+
+commit;
+
+select listlength(aggregate_list(distinct x)) as c
+from @foo;
+
+select count(distinct x) as c
+from @foo;
+
+insert into @bar
+select AsList(1,2) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,2) as x,AsList(5) as y
+union all
+select AsList(1,2) as x,AsList(5) as y;
+
+commit;
+
+select x,count(distinct y) as c
+from @bar
+group by x
+order by c;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_struct_access.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_struct_access.sql
new file mode 100644
index 0000000000..e9d312c63b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_struct_access.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$withStruct = select subkey, value, AsStruct(key as key) as s from Input3;
+
+select count(distinct s.key) as cnt from $withStruct;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_distinct_list.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_distinct_list.sql
new file mode 100644
index 0000000000..5ea0b2283e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_distinct_list.sql
@@ -0,0 +1,32 @@
+/* syntax version 1 */
+/* postgres can not */
+select listlength(aggregate_list(distinct x)) as c from (
+select AsList(1,2) as x
+union all
+select AsList(1,3) as x
+union all
+select AsList(1,2) as x
+);
+
+select count(distinct x) as c from (
+select AsList(1,2) as x
+union all
+select AsList(1,3) as x
+union all
+select AsList(1,2) as x
+);
+
+select x,count(distinct y) as c from (
+select AsList(1,2) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,2) as x,AsList(5) as y
+union all
+select AsList(1,2) as x,AsList(5) as y
+) group by x
+order by c;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_list_in_key.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_list_in_key.sql
new file mode 100644
index 0000000000..4158e0e80f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_inmem_list_in_key.sql
@@ -0,0 +1,26 @@
+/* syntax version 1 */
+/* postgres can not */
+select x,count(*) as c from (
+select AsList(1,2) as x
+union all
+select AsList(1,3) as x
+union all
+select AsList(1,2) as x
+)
+group by x
+order by c;
+
+select x,y,count(*) as c from (
+select AsList(1,2) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,3) as x,AsList(4) as y
+union all
+select AsList(1,2) as x,AsList(5) as y
+union all
+select AsList(1,2) as x,AsList(5) as y
+) group by x, y
+order by c;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_key_column.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_key_column.sql
new file mode 100644
index 0000000000..cd95e5be56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_key_column.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ Some(key) as some_key,
+FROM
+ plato.Input
+GROUP BY
+ key
+ORDER BY some_key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_list_in_key.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_list_in_key.sql
new file mode 100644
index 0000000000..9aa0bd88fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_list_in_key.sql
@@ -0,0 +1,62 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+insert into @foo
+select AsList(1,2) as x,1 as y
+union all
+select AsList(1,3) as x,2 as y
+union all
+select AsList(1,2) as x,3 as y;
+commit;
+
+select x,count(*) as c
+from @foo
+group by x
+order by c;
+
+insert into @bar
+select AsList(1,2) as x,AsList(4) as y, 1 as z
+union all
+select AsList(1,3) as x,AsList(4) as y, 2 as z
+union all
+select AsList(1,3) as x,AsList(4) as y, 3 as z
+union all
+select AsList(1,3) as x,AsList(4) as y, 4 as z
+union all
+select AsList(1,2) as x,AsList(5) as y, 5 as z
+union all
+select AsList(1,2) as x,AsList(5) as y, 6 as z;
+commit;
+
+select x,y,count(*) as c
+from @bar
+group by x, y
+order by c;
+
+select x,y,count(distinct z) as c
+from @bar
+group by x,y
+order by c;
+
+select x,y, min(z) as m, count(distinct z) as c
+from @bar
+group by x,y
+order by c;
+
+select x
+from @bar as t
+group by x
+order by t.x[1];
+
+select x,y
+from @bar as t
+group by x, y
+order by t.x[1],t.y[0];
+
+select distinct x
+from @bar as t
+order by t.x[1] desc;
+
+select distinct x,y
+from @bar as t
+order by t.x[1] desc,t.y[0] desc;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_subquery_yql_15869.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_subquery_yql_15869.sql
new file mode 100644
index 0000000000..f3fc92b09e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_subquery_yql_15869.sql
@@ -0,0 +1,7 @@
+use plato;
+
+$a = select CurrentUtcDate() as _date, Just(1.0) as parsed_lag from Input;
+
+SELECT
+ SUM(parsed_lag)
+FROM $a;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.cfg
new file mode 100644
index 0000000000..060e6c9057
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf string_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.sql
new file mode 100644
index 0000000000..a65c584f1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_udf_nested.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ String::HexText(String::HexText(value)) as value
+FROM plato.Input4
+GROUP BY value
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_const_yson_options.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_const_yson_options.sql
new file mode 100644
index 0000000000..c940ba32cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_const_yson_options.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT
+ key,
+ Yson::SerializeJson(Yson::From(AGGREGATE_LIST(value), Yson::Options(true AS Strict))) as value
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.sql
new file mode 100644
index 0000000000..c251ae8c4f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_deep_aggregated_column.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ region,
+ max(case when age % 10u between 1u and region % 10u then age else 0u end) as max_age_at_range_intersect
+from $data
+group by region
+order by region
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_default_yson_options.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_default_yson_options.sql
new file mode 100644
index 0000000000..ef6a64cf42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_default_yson_options.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT
+ key,
+ Yson::SerializeJson(Yson::From(AGGREGATE_LIST(value))) as value
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.sql
new file mode 100644
index 0000000000..4a10cda985
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$empty = ($list) -> {
+ RETURN ListCreate(TypeOf($list[0]));
+};
+
+SELECT
+ $empty(AGGREGATE_LIST(key))
+FROM Input
+GROUP BY value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.sql b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.sql
new file mode 100644
index 0000000000..7672cec89e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregate_with_lambda_inside_avg.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$cast_to_double = ($column) -> {
+ RETURN CAST($column as Double);
+};
+$column_name = 'key';
+SELECT AVG($cast_to_double($column_name))
+FROM Input;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregation_and_order.sql b/yql/essentials/tests/sql/suites/aggregate/aggregation_and_order.sql
new file mode 100644
index 0000000000..940c38c928
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregation_and_order.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select key, Min(subkey) as subkey, Max(value) as value from plato.Input group by key order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.cfg
new file mode 100644
index 0000000000..55c2f97264
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.sql b/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.sql
new file mode 100644
index 0000000000..105378efc1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregation_by_udf.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT sum(Math::Pow(cast(subkey as double), 2))
+FROM plato.Input4;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.cfg b/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.cfg
new file mode 100644
index 0000000000..a8a884001d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf stat_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.sql b/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.sql
new file mode 100644
index 0000000000..33757e759c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggregation_with_named_node.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (SELECT cast(key as Uint32) ?? 0 as key, value FROM plato.Input);
+
+$quant = 0.1;
+SELECT
+ $quant * 100 as quantile,
+ PERCENTILE(key, $quant) as key_q,
+ COUNT(*) as count
+FROM $data;
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.cfg b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.cfg
new file mode 100644
index 0000000000..272cf740b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.cfg
@@ -0,0 +1,3 @@
+in Input input_sorted.txt
+udf stat_udf
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.sql
new file mode 100644
index 0000000000..b03b5283be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping.sql
@@ -0,0 +1,43 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ count(key) as keyCount,
+ count(sub) as subCount,
+ count(val) as valCount,
+ countIf(sub % 2 == 0) as evenCount,
+ countIf(sub % 2 == 1) as oddCount,
+ every(sub % 2 == 0) as every,
+ boolOr(sub % 2 == 0) as boolOr,
+ avg(key) as keyAvg,
+ avg(sub) as subAvg,
+ min(key) as keyMin,
+ min(sub) as subMin,
+ min(val) as valMin,
+ max(key) as keyMax,
+ max(sub) as subMax,
+ max(val) as valMax,
+ some(key) as keySome,
+ some(sub) as subSome,
+ some(val) as valSome,
+ bitAnd(cast(key AS Uint64)) as keyBitAnd,
+ bitOr(cast(key AS Uint64)) as keyBitOr,
+ bitXor(cast(key AS Uint64)) as keyBitXor,
+ bitAnd(cast(sub AS Uint64)) as subBitAnd,
+ bitOr(cast(sub AS Uint64)) as subBitOr,
+ bitXor(cast(sub AS Uint64)) as subBitXor,
+ median(key) as keyMedian,
+ median(sub) as subMedian,
+ stdDev(key) as keyStdDev,
+ stdDev(sub) as subStdDev,
+ stdDev(empty) as emptyStdDev,
+ variance(key) as keyVariance,
+ variance(sub) as subVariance,
+ stdDevPop(key) as keyPopStdDev,
+ stdDevPop(sub) as subPopStdDev,
+ varPop(key) as keyPopVariance,
+ varPop(sub) as subPopVariance,
+ correlation(key, sub) AS corr,
+ covariance(key, sub) AS covar,
+ covarpop(key, sub) AS covarpop
+from
+ (select cast(key as int) as key, Unwrap(cast(subkey as int)) as sub, value as val, cast(value AS int) AS empty from plato.Input);
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map.sql b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map.sql
new file mode 100644
index 0000000000..cb1105b769
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map.sql
@@ -0,0 +1,44 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma yt.PartitionByConstantKeysViaMap;
+select
+ count(key) as keyCount,
+ count(sub) as subCount,
+ count(val) as valCount,
+ countIf(sub % 2 == 0) as evenCount,
+ countIf(sub % 2 == 1) as oddCount,
+ every(sub % 2 == 0) as every,
+ boolOr(sub % 2 == 0) as boolOr,
+ avg(key) as keyAvg,
+ avg(sub) as subAvg,
+ min(key) as keyMin,
+ min(sub) as subMin,
+ min(val) as valMin,
+ max(key) as keyMax,
+ max(sub) as subMax,
+ max(val) as valMax,
+ some(key) as keySome,
+ some(sub) as subSome,
+ some(val) as valSome,
+ bitAnd(cast(key AS Uint64)) as keyBitAnd,
+ bitOr(cast(key AS Uint64)) as keyBitOr,
+ bitXor(cast(key AS Uint64)) as keyBitXor,
+ bitAnd(cast(sub AS Uint64)) as subBitAnd,
+ bitOr(cast(sub AS Uint64)) as subBitOr,
+ bitXor(cast(sub AS Uint64)) as subBitXor,
+ median(key) as keyMedian,
+ median(sub) as subMedian,
+ stdDev(key) as keyStdDev,
+ stdDev(sub) as subStdDev,
+ stdDev(empty) as emptyStdDev,
+ variance(key) as keyVariance,
+ variance(sub) as subVariance,
+ stdDevPop(key) as keyPopStdDev,
+ stdDevPop(sub) as subPopStdDev,
+ varPop(key) as keyPopVariance,
+ varPop(sub) as subPopVariance,
+ correlation(key, sub) AS corr,
+ covariance(key, sub) AS covar,
+ covarpop(key, sub) AS covarpop
+from
+ (select cast(key as int) as key, Unwrap(cast(subkey as int)) as sub, value as val, cast(value AS int) AS empty from plato.Input);
diff --git a/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map_compact.sql b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map_compact.sql
new file mode 100644
index 0000000000..acb0e79e4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/aggrs_no_grouping_via_map_compact.sql
@@ -0,0 +1,45 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma yt.PartitionByConstantKeysViaMap;
+select
+ count(key) as keyCount,
+ count(sub) as subCount,
+ count(val) as valCount,
+ countIf(sub % 2 == 0) as evenCount,
+ countIf(sub % 2 == 1) as oddCount,
+ every(sub % 2 == 0) as every,
+ boolOr(sub % 2 == 0) as boolOr,
+ avg(key) as keyAvg,
+ avg(sub) as subAvg,
+ min(key) as keyMin,
+ min(sub) as subMin,
+ min(val) as valMin,
+ max(key) as keyMax,
+ max(sub) as subMax,
+ max(val) as valMax,
+ some(key) as keySome,
+ some(sub) as subSome,
+ some(val) as valSome,
+ bitAnd(cast(key AS Uint64)) as keyBitAnd,
+ bitOr(cast(key AS Uint64)) as keyBitOr,
+ bitXor(cast(key AS Uint64)) as keyBitXor,
+ bitAnd(cast(sub AS Uint64)) as subBitAnd,
+ bitOr(cast(sub AS Uint64)) as subBitOr,
+ bitXor(cast(sub AS Uint64)) as subBitXor,
+ median(key) as keyMedian,
+ median(sub) as subMedian,
+ stdDev(key) as keyStdDev,
+ stdDev(sub) as subStdDev,
+ stdDev(empty) as emptyStdDev,
+ variance(key) as keyVariance,
+ variance(sub) as subVariance,
+ stdDevPop(key) as keyPopStdDev,
+ stdDevPop(sub) as subPopStdDev,
+ varPop(key) as keyPopVariance,
+ varPop(sub) as subPopVariance,
+ correlation(key, sub) AS corr,
+ covariance(key, sub) AS covar,
+ covarpop(key, sub) AS covarpop
+from
+ (select cast(key as int) as key, Unwrap(cast(subkey as int)) as sub, value as val, cast(value AS int) AS empty from plato.Input)
+group compact by ();
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum.sql b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum.sql
new file mode 100644
index 0000000000..cdbf1dd58b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+select
+ avg(cast(key as int)) as key,
+ cast(sum(cast(subkey as int)) as varchar) as subkey,
+ min(value) as value
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.cfg b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.cfg
new file mode 100644
index 0000000000..8153a1f3e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.cfg
@@ -0,0 +1 @@
+in Input avg_and_sum_by_value.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.sql b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.sql
new file mode 100644
index 0000000000..c8a43bc533
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+select
+ avg(cast(key as int)) + 0.3 as key,
+ cast(sum(cast(subkey as int)) as varchar) as subkey,
+ value
+from plato.Input
+group by value
+order by value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.txt b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.txt
new file mode 100644
index 0000000000..cebd64e139
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_by_value.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="2";"subkey"="20";"value"="BAR"};
+{"key"="3";"subkey"="30";"value"="BAR"};
+{"key"="WAT";"subkey"="WAT";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.cfg b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.cfg
new file mode 100644
index 0000000000..812be3893b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.cfg
@@ -0,0 +1 @@
+in Input input4.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.sql b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.sql
new file mode 100644
index 0000000000..dc2a4d3157
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_and_sum_float.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+select
+ key,
+ avg(cast(subkey as Float)) as avg,
+ sum(cast(subkey as Float)) as sum,
+from plato.Input
+group by key
+order by key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_interval.sql b/yql/essentials/tests/sql/suites/aggregate/avg_interval.sql
new file mode 100644
index 0000000000..dadd2fdd61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_interval.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+discard select EnsureType(avg(cast(key As Interval)), Interval?) from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/aggregate/avg_with_having.sql b/yql/essentials/tests/sql/suites/aggregate/avg_with_having.sql
new file mode 100644
index 0000000000..f48f0dcfc1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/avg_with_having.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select value, avg(cast(key as int)) + 0.3 as key from plato.Input group by value having value > "foo" order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/columns.txt b/yql/essentials/tests/sql/suites/aggregate/columns.txt
new file mode 100644
index 0000000000..24785da79e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/columns.txt
@@ -0,0 +1,8 @@
+{"a"="x"; "b"=1u; "c"=133; "d"=-5 };
+{"a"="y"; "b"=1u; "c"=90; "d"=12 };
+{"a"="y"; "b"=0u; "c"=5; "d"=999};
+{"a"="y"; "b"=0u; "c"=111; "d"=42 };
+{"a"="y"; "b"=1u; "c"=-8; "d"=6 };
+{"a"="x"; "b"=1u; "c"=256; "d"=-77};
+{"a"="x"; "b"=1u; "c"=2; "d"=-47};
+{"a"="y"; "b"=1u; "c"=88; "d"=3 };
diff --git a/yql/essentials/tests/sql/suites/aggregate/columns.txt.attr b/yql/essentials/tests/sql/suites/aggregate/columns.txt.attr
new file mode 100644
index 0000000000..70da6cab1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/columns.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="string";"name"="a"};{"type"="uint64";"name"="b"};{"type"="int64";"name"="c"};{"type"="int64";"name"="d"}]
+}
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_by.cfg b/yql/essentials/tests/sql/suites/aggregate/compare_by.cfg
new file mode 100644
index 0000000000..612a5060aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_by.cfg
@@ -0,0 +1 @@
+in Input input_sorted.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_by.sql b/yql/essentials/tests/sql/suites/aggregate/compare_by.sql
new file mode 100644
index 0000000000..f5c13b5348
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_by.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ min_by(sub, key)as min,
+ max_by(value, sub) as max,
+ min_by(key, length(sub), 2) as min_list,
+ min_by(empty, length(sub), 2) as empty_result,
+ max_by(key, empty, 2) as empty_by
+from
+ (select cast(key as int) as key,
+ Unwrap(cast(subkey as int)) as sub, value as value,
+ cast(value AS int) AS empty from plato.Input); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_by_nulls.sql b/yql/essentials/tests/sql/suites/aggregate/compare_by_nulls.sql
new file mode 100644
index 0000000000..7f48154923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_by_nulls.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$src = select null as key, value from Input;
+$src_opt = select null as key, Just(value) as value from Input;
+$src_null = select null as key, null as value from Input;
+
+
+select min_by(value, key) from $src;
+select max_by(value, key) from $src_opt;
+select min_by(value, key) from $src_null;
+
+select max_by(value, key) from (select * from $src limit 0);
+select min_by(value, key) from (select * from $src_opt limit 0);
+select max_by(value, key) from (select * from $src_null limit 0);
+
+
+select min_by(value, key) from (select Nothing(String?) as key, value from Input);
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.cfg b/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.cfg
new file mode 100644
index 0000000000..d13818b046
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.cfg
@@ -0,0 +1 @@
+in Input input_compare.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.sql b/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.sql
new file mode 100644
index 0000000000..efe9622f19
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_by_tuple.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ key,
+ min_by(AsTuple(subkey, value), AsTuple(subkey, value)) as min,
+ max_by(AsTuple(subkey, value), AsTuple(subkey, value)) as max
+from (
+ select
+ key,
+ (case when length(subkey) != 0 then subkey else null end) as subkey,
+ (case when length(value) != 0 then value else null end) as value
+ from plato.Input
+) group by key
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_tuple.cfg b/yql/essentials/tests/sql/suites/aggregate/compare_tuple.cfg
new file mode 100644
index 0000000000..d13818b046
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_tuple.cfg
@@ -0,0 +1 @@
+in Input input_compare.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/compare_tuple.sql b/yql/essentials/tests/sql/suites/aggregate/compare_tuple.sql
new file mode 100644
index 0000000000..ca1b69e071
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compare_tuple.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ key,
+ min(AsTuple(subkey, value)) as min,
+ max(AsTuple(subkey, value)) as max
+from (
+ select
+ key,
+ (case when length(subkey) != 0 then subkey else null end) as subkey,
+ (case when length(value) != 0 then value else null end) as value
+ from plato.Input
+) group by key
+order by key
diff --git a/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.cfg b/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.cfg
new file mode 100644
index 0000000000..be223abe99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.cfg
@@ -0,0 +1,2 @@
+in Input5 input5.txt
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.sql b/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.sql
new file mode 100644
index 0000000000..c17ac1c3b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/count_distinct_with_filter.sql
@@ -0,0 +1,4 @@
+SELECT count (distinct value) AS Count
+FROM plato.Input5
+WHERE `key` = '150';
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.cfg b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.cfg
new file mode 100644
index 0000000000..0b877ec216
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.cfg
@@ -0,0 +1 @@
+in Input dedup_state_keys.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.sql b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.sql
new file mode 100644
index 0000000000..9adbc0dad1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.sql
@@ -0,0 +1,10 @@
+USE plato;
+SELECT
+ key,
+ value,
+ count(*) AS c
+FROM Input
+GROUP BY
+ key,
+ value
+ORDER BY c, key, value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt
new file mode 100644
index 0000000000..6f323708f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"=1u};
+{"key"="023";"subkey"="5";"value"=1u};
+{"key"="075";"subkey"="1";"value"=3u};
+{"key"="150";"subkey"="1";"value"=4u};
+{"key"="150";"subkey"="3";"value"=5u};
+{"key"="150";"subkey"="8";"value"=6u};
+{"key"="200";"subkey"="7";"value"=7u};
+{"key"="527";"subkey"="4";"value"=8u};
+{"key"="761";"subkey"="6";"value"=9u};
+{"key"="911";"subkey"="2";"value"=10u};
diff --git a/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt.attr b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt.attr
new file mode 100644
index 0000000000..fc8a038324
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/dedup_state_keys.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"Uint64"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/aggregate/default.cfg b/yql/essentials/tests/sql/suites/aggregate/default.cfg
new file mode 100644
index 0000000000..389a8e8f21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/descending.txt b/yql/essentials/tests/sql/suites/aggregate/descending.txt
new file mode 100644
index 0000000000..8e63b46e56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/descending.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="020";"subkey"="1";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/descending.txt.attr b/yql/essentials/tests/sql/suites/aggregate/descending.txt.attr
new file mode 100644
index 0000000000..7024a9fc9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/descending.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.cfg b/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.cfg
new file mode 100644
index 0000000000..bb375970b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+
+providers dq
+pragma dq.SpillingEngine="file";
+pragma dq.EnableSpillingNodes="Aggregation";
diff --git a/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.sql b/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.sql
new file mode 100644
index 0000000000..0d8671bf0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/disable_blocks_with_spilling.sql
@@ -0,0 +1,2 @@
+pragma BlockEngine='force';
+select count(key) from plato.Input group by key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/ensure_count.sql b/yql/essentials/tests/sql/suites/aggregate/ensure_count.sql
new file mode 100644
index 0000000000..373ce7aa8b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/ensure_count.sql
@@ -0,0 +1 @@
+select Ensure(COUNT(*), COUNT(*) > 3U, "WTF?") from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/aggregate/fail_group_by_struct_member.sqlx b/yql/essentials/tests/sql/suites/aggregate/fail_group_by_struct_member.sqlx
new file mode 100644
index 0000000000..0dc3a1ee82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/fail_group_by_struct_member.sqlx
@@ -0,0 +1,16 @@
+/* postgres can not */
+$input = (
+ SELECT AsStruct("a" AS value) AS s, "1" AS value
+ UNION ALL
+ SELECT AsStruct("b" AS value) AS s, "2" AS value
+ UNION ALL
+ SELECT AsStruct("c" AS value) AS s, "3" AS value
+ UNION ALL
+ SELECT AsStruct("b" AS value) AS s, "1" AS value
+ UNION ALL
+ SELECT AsStruct("b" AS value) AS s, "2" AS value
+ UNION ALL
+ SELECT AsStruct("a" AS value) AS s, "3" AS value
+);
+
+SELECT count(*) FROM $input GROUP BY s.value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_column.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_column.sql
new file mode 100644
index 0000000000..b6490dbe58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_column.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+-- order to have same on yt and yamr
+select count(1),z from plato.Input group by key as z order by z;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse.sql
new file mode 100644
index 0000000000..a5c8707341
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+--INSERT INTO Output
+SELECT
+ a.key as kk,
+-- key as kkk,
+ aggregate_list(subkey)
+FROM plato.Input4 as a
+GROUP BY a.key as kk
+ORDER BY kk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.sql
new file mode 100644
index 0000000000..e04f898efe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_column_alias_reuse_for_join.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+--INSERT INTO Output
+SELECT
+ a.key as kk,
+-- kk,
+ aggregate_list(b.subkey)
+FROM plato.Input as a
+JOIN plato.Input4 as b
+ON a.subkey == b.key
+GROUP BY a.key as kk
+ORDER BY kk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.sql
new file mode 100644
index 0000000000..6b5384cba8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_duo.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), key, subkey from plato.Input group by cube(key,subkey) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.sql
new file mode 100644
index 0000000000..771fa9a2dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_expr_trio.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma sampleselect;
+
+select sum(length(value)) as s, m0, m1, m2
+from plato.Input
+group by rollup(cast(key as uint32) as m0, cast(key as uint32) % 10u as m1, cast(key as uint32) % 100u as m2)
+order by s, m0, m1, m2;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.sql
new file mode 100644
index 0000000000..eed0fd11fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)) as s, m0, m1, m2, 2u * (2u * grouping(m0) + grouping(m1)) + grouping(m2) as ggg3
+from plato.Input
+group by cube(cast(key as uint32) as m0, cast(key as uint32) % 10u as m1, cast(key as uint32) % 100u as m2)
+order by s, m0, m1, m2;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping_and_expr.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping_and_expr.sql
new file mode 100644
index 0000000000..290d87b25b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_grouping_and_expr.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ key,
+ subkey,
+ value,
+ 2u * (2u * grouping(key) + grouping(subkey)) + grouping(value) as ggg3,
+FROM
+ (
+ SELECT
+ subkey,
+ value,
+ cast(key as Int32) as opt,
+ FROM
+ plato.Input
+ )
+GROUP BY
+ Unwrap(opt) AS key,
+ CUBE(subkey, value)
+ORDER BY key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.sql
new file mode 100644
index 0000000000..5f849d2be0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_cube_join_count.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma sampleselect;
+select kk, sk, grouping(kk, sk),count(1) FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key)
+GROUP BY CUBE(t1.key as kk, t1.subkey as sk) ORDER BY kk, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr.sql
new file mode 100644
index 0000000000..8a65d11bb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(cast(subkey as uint32)) as s from plato.Input group by cast(key as uint32) % 10 order by s;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.sql
new file mode 100644
index 0000000000..aa6a7a6c28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_alias_on_subexp.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ key, sk, aggregate_list(value) as values
+FROM
+ (SELECT * FROM Input)
+GROUP BY key, cast(subkey as uint32) % 2 as sk
+ORDER BY key, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.sql
new file mode 100644
index 0000000000..41407e9244
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_and_having.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(*) as count, mod_sk from plato.Input as a group by cast(subkey as uint32) % 10 as mod_sk, cast(key as uint32) % 10 as mod_k having mod_k == 7;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_columns_reuse.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_columns_reuse.sql
new file mode 100644
index 0000000000..5932fe83e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_columns_reuse.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ key, count(1) as count
+FROM Input
+GROUP BY cast(key as uint32) % 10 as key
+ORDER BY key, count;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.sql
new file mode 100644
index 0000000000..b7bc07e73c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_dict.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_dict = (select mod, Just(YQL::ToIndexDict(ListSort(aggregate_list(key)))) as dk, ListSort(aggregate_list(subkey)) as ls, ListSort(aggregate_list(value)) as lv from plato.Input group by cast(subkey as uint32) % 10 as mod);
+
+select * from $data_dict as t group by t.dk[0] as gk order by gk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.cfg
new file mode 100644
index 0000000000..4ce1b28a20
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.cfg
@@ -0,0 +1 @@
+in Input input_dict.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.sql
new file mode 100644
index 0000000000..e7171c7bea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_lookup.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(*) as s from plato.Input group by `dict`["a"] order by s;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.sql
new file mode 100644
index 0000000000..113245c1cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_mul_col.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(*) as count, mod_sk + mod_k as mod_sum
+from plato.Input as a
+group by cast(subkey as uint32) % 10 as mod_sk, cast(key as uint32) % 10 as mod_k
+order by count, mod_sum; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.sql
new file mode 100644
index 0000000000..6c3ac3a6cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_only_join.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select aggregate_list(a.k), aval from (select cast(subkey as uint32) as k, value as val from plato.Input) as a left only join (select cast(key as uint32) as k, cast(subkey as uint32) as s from plato.Input) as b using(k) group by a.val as aval;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.sql
new file mode 100644
index 0000000000..ddf5bf9a45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_order_by_expr.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(cast(key as uint32)) as keysum from plato.Input group by cast(key as uint32) / 100 + cast(subkey as uint32) % 10 order by keysum desc;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.sql
new file mode 100644
index 0000000000..b212c02136
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_semi_join.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+select ListSort(aggregate_list(b.uk)), ListSort(aggregate_list(b.uk)), bus
+from
+ (select cast(key as uint32) as uk from plato.Input) as a
+right semi join
+ (select cast(key as uint32) as uk, cast(subkey as uint32) as us from plato.Input) as b
+ using(uk) group by b.us as bus
+order by bus;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.sql
new file mode 100644
index 0000000000..f078552fb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_join.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+
+pragma sampleselect;
+select kk, ListSort(aggregate_list(t2.key)) FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 ON t1.key==t2.subkey GROUP BY t1.key as kk ORDER by kk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_where.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_where.sql
new file mode 100644
index 0000000000..255b003850
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_expr_with_where.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT ki, count(1) FROM plato.Input WHERE ki IN (75, 20) GROUP BY Cast(key as Uint32) as ki ORDER BY ki;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_full_path.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_full_path.sql
new file mode 100644
index 0000000000..a52f5d447b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_full_path.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+SELECT a.value FROM plato.Input as a GROUP BY a.value ORDER BY a.value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.sql
new file mode 100644
index 0000000000..766cb37e6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_alt_duo.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), key, subkey from plato.Input group by grouping sets (key), grouping sets (subkey) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_and_having.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_and_having.sql
new file mode 100644
index 0000000000..633656ab7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_and_having.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ Sum(Cast(subkey as Uint32)) as sumLen,
+ key,
+ value,
+ Grouping(key, value) as grouping
+FROM Input3
+GROUP BY GROUPING SETS ((key),(value))
+HAVING count(*) > 2
+ORDER BY key, value
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.sql
new file mode 100644
index 0000000000..5510785d8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_duo.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), key, subkey from plato.Input group by grouping sets ((key),(subkey)) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.sql
new file mode 100644
index 0000000000..494ebb8c4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_few_empty.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), key, subkey, value, grouping(key, subkey, value) from plato.Input group by grouping sets ((), value, rollup(key, subkey), ())
+order by key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten.sql
new file mode 100644
index 0000000000..0ee762b985
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input = select a.*, [1,2] as lst from Input as a;
+
+select key, subkey, some(lst) as lst_count
+from $input flatten list by lst
+where lst != 1
+group by grouping sets ((key), (key, subkey))
+order by key, subkey;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_columns.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_columns.sql
new file mode 100644
index 0000000000..e7c274191e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_columns.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input = select a.*, <|k1:1, k2:2|> as s from Input as a;
+
+select key, subkey, some(k1) as k1, some(k2) as k2
+from $input flatten columns
+group by grouping sets ((key), (key, subkey))
+order by key, subkey;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_expr.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_expr.sql
new file mode 100644
index 0000000000..8b1e77e544
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten_expr.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input = select a.*, [1,2] as lst from Input as a;
+
+select key, subkey, count(lst) as lst_count
+from $input flatten list by (ListExtend(lst, [3,4]) as lst)
+where lst != 2
+group by grouping sets ((key), (key, subkey))
+order by key, subkey;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.sql
new file mode 100644
index 0000000000..a6f003d445
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_grouping.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), key_first, val_first, grouping(key_first, val_first) as group
+from plato.Input group by grouping sets (cast(key as uint32) / 100u as key_first, Substring(value, 1, 1) as val_first)
+order by key_first, val_first;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_join_aliases.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_join_aliases.sql
new file mode 100644
index 0000000000..598ae44056
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_join_aliases.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT k1, k2, b.subkey as kk2, SOME(a.value) as val
+FROM plato.Input AS a JOIN plato.Input AS b USING(key)
+GROUP BY GROUPING SETS(
+ (a.key as k1, b.subkey as k2),
+ (k1),
+ (b.subkey)
+)
+ORDER BY k1, kk2;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.sql
new file mode 100644
index 0000000000..09c48d836b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_simp.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), key, subkey, grouping(key, subkey) from plato.Input group by grouping sets ((key, subkey), key, subkey) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect.sql
new file mode 100644
index 0000000000..8b28224ab5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$sub = (SELECT
+ Sum(Cast(subkey as Uint32)) as sumLen,
+ key,
+ value,
+ Grouping(key, value) as grouping
+FROM Input
+GROUP BY GROUPING SETS ((key),(value))
+);
+
+--INSERT INTO Output
+SELECT t.sumLen, t.key, t.value, t.grouping FROM $sub as t
+ORDER BY t.key, t.value \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect_asterisk.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect_asterisk.sql
new file mode 100644
index 0000000000..6966339274
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_subselect_asterisk.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$sub = (SELECT * FROM Input LIMIT 5);
+
+--INSERT INTO Output
+SELECT
+ Sum(Cast(subkey as Uint32)) as sumLen,
+ key,
+ value,
+ Grouping(key, value) as grouping
+FROM $sub
+GROUP BY GROUPING SETS ((key),(value))
+ORDER BY key, value
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.sql
new file mode 100644
index 0000000000..ebbdbf828c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_gs_with_rollup.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ key, subkey, count(1) as total_count, value, grouping(key, subkey, value) as group_mask
+from Input
+group by grouping sets (value, rollup(key, subkey))
+order by group_mask, value, key, subkey, total_count;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop.sql
new file mode 100644
index 0000000000..334bf2cb83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(payload) as payload
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.sql
new file mode 100644
index 0000000000..a85dfcf6b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_compact.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(payload) as payload
+FROM plato.Input
+GROUP COMPACT BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.sql
new file mode 100644
index 0000000000..d9aed1fac9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct.sql
@@ -0,0 +1,17 @@
+/* Test is broken for now */
+
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+/* dq can not */
+/* dqfile can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(DISTINCT payload) as payload
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.sql
new file mode 100644
index 0000000000..0b44ceabea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_distinct_compact.sql
@@ -0,0 +1,17 @@
+/* Test is broken for now */
+
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+/* dq can not */
+/* dqfile can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(DISTINCT payload) as payload
+FROM plato.Input
+GROUP COMPACT BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.sql
new file mode 100644
index 0000000000..cb3326e825
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_expr_key.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(payload) as payload
+FROM plato.Input
+GROUP COMPACT BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user, substring(user, 1, 1);
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.sql
new file mode 100644
index 0000000000..77369585c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_list_key.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ user,
+ HOP_START() as ts,
+ SUM(payload) as payload
+FROM plato.Input
+GROUP COMPACT BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user, AsList(user, "1");
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.sql
new file mode 100644
index 0000000000..302e8aa1a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ HOP_START() as ts,
+ SUM(payload) as payload
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S");
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.sql
new file mode 100644
index 0000000000..1ab7dc5b75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_distinct.sql
@@ -0,0 +1,16 @@
+/* Test is broken for now */
+
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+/* dq can not */
+/* dqfile can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ HOP_START() as ts,
+ SUM(DISTINCT payload) as payload
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S");
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.sql
new file mode 100644
index 0000000000..963df3855c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_only_start.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT
+ HOP_START()
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S");
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.sql
new file mode 100644
index 0000000000..75fbea9671
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_star.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+PRAGMA dq.AnalyticsHopping="true";
+
+SELECT *
+FROM plato.Input
+GROUP BY HOP(DateTime::FromSeconds(CAST(ts as Uint32)), "PT10S", "PT10S", "PT10S"), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static.sql
new file mode 100644
index 0000000000..fec507c827
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static.sql
@@ -0,0 +1,26 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+$input = SELECT * FROM AS_TABLE([
+ <|"time":"2024-01-01T00:00:01Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 3|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 3|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 3|>
+]);
+
+SELECT
+ user,
+ COUNT(*) as count,
+ HOP_START() as start,
+FROM $input
+GROUP BY HOP(CAST(time as Timestamp), 'PT1S', 'PT1S', 'PT1S'), user;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static_list_key.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static_list_key.sql
new file mode 100644
index 0000000000..3639207bb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_hop_static_list_key.sql
@@ -0,0 +1,26 @@
+/* syntax version 1 */
+/* postgres can not */
+/* ytfile can not */
+/* yt can not */
+
+$input = SELECT * FROM AS_TABLE([
+ <|"time":"2024-01-01T00:00:01Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 1|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 2|>,
+ <|"time":"2024-01-01T00:00:01Z", "user": 3|>,
+ <|"time":"2024-01-01T00:00:02Z", "user": 3|>,
+ <|"time":"2024-01-01T00:00:03Z", "user": 3|>
+]);
+
+SELECT
+ user,
+ COUNT(*) as count,
+ HOP_START() as start,
+FROM $input
+GROUP BY HOP(CAST(time as Timestamp), 'PT1S', 'PT1S', 'PT1S'), user, AsList(user, 0);
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.sql
new file mode 100644
index 0000000000..63492a2fa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gb_ru.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), vf, kf, kl, grouping(vf, kf, kl) as ggg3 from plato.Input group by Substring(value, 0, 1) as vf, cube(cast(key as uint32) % 10u as kl, cast(key as uint32) / 100u as kf)
+order by vf, kf, kl;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.sql
new file mode 100644
index 0000000000..df6dc769ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_expr_and_column.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ count(1) as count, kf, key, vf, vl, grouping(kf, key, vf, vl) as grouping
+from Input group by grouping sets(
+ (cast(key as uint32) / 100u as kf, key),
+ (Substring(value, 0, 1) as vf, Substring(value, 2, 1) as vl)
+)
+order by kf, key, vf, vl;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.sql
new file mode 100644
index 0000000000..0cefa50a9a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_gs.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), kf, kl, vf, vl, grouping(kf, kl, vf, vl) from plato.Input group by grouping sets(cast(key as uint32) / 100u as kf, cast(key as uint32) % 10u as kl), grouping sets(Substring(value, 0, 1) as vf, Substring(value, 2, 1) as vl)
+order by kf, kl, vf, vl;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.sql
new file mode 100644
index 0000000000..e325b93fff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_gs_ru.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), kf, kl, vf, vl, grouping(kf, kl, vf, vl) as gggg from plato.Input group by grouping sets((cast(key as uint32) / 100u as kf, cast(key as uint32) % 10u as kl)), rollup(Substring(value, 0, 1) as vf, Substring(value, 2, 1) as vl)
+order by kf, kl, vf, vl;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.sql
new file mode 100644
index 0000000000..569539f114
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_mul_ru_ru.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), kf, kl, vf, vl, grouping(kf, kl, vf, vl) from plato.Input group by rollup(cast(key as uint32) / 100u as kf, cast(key as uint32) % 10u as kl), rollup(Substring(value, 0, 1) as vf, Substring(value, 2, 1) as vl)
+order by kf, kl, vf, vl;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.sql
new file mode 100644
index 0000000000..59a59d1aef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_aggr_expr.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input = (select key, subkey, substring(value, 0, 1) == substring(value, 2, 1) as value_from_a from Input);
+
+--insert into Output
+select
+ key,
+ subkey,
+ count_if(value_from_a) as approved,
+ cast(count_if(value_from_a) as double) / count(*) as approved_share,
+ count(*) as total
+from $input
+group by rollup(key, subkey)
+order by key, subkey
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.sql
new file mode 100644
index 0000000000..ee10388e6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as int32) ?? 0 as kk, cast(subkey as int32) ?? 0 as sk, value from Input);
+
+--insert into Output
+select
+ kk, sk, count(*) as total_count
+from $input
+where sk in (23, 37, 75, 150, )
+group by rollup(kk, sk)
+order by kk, sk, total_count
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.sql
new file mode 100644
index 0000000000..f03bd9a437
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_ref_same_names.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as uint32) ?? 0 as key, cast(subkey as int32) ?? 0 as subkey, value from Input);
+
+--insert into Output
+select
+ key, subkey, count(*) as total_count
+from $input
+where subkey in (23, 37, 75,150)
+group by rollup(key, subkey)
+order by key, subkey, total_count
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.sql
new file mode 100644
index 0000000000..07a46979c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_column_reuse.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as uint32) ?? 0 as key, cast(subkey as int32) ?? 0 as subkey, value from Input);
+
+$request = (
+ select
+ key, subkey, count(*) as total_count
+ from $input
+ where subkey in (23, 37, 75,150)
+ group by rollup(key, subkey)
+);
+
+--insert into Output
+select key, subkey, total_count from $request
+order by key, subkey, total_count;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.sql
new file mode 100644
index 0000000000..93e586766e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)), key, subkey from plato.Input group by rollup(key,subkey) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.sql
new file mode 100644
index 0000000000..4a58b473f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_duo_opt.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1), k, subkey from plato.Input group by rollup(cast(key as uint32) as k, subkey) order by k, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.sql
new file mode 100644
index 0000000000..48bae25392
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+select sum(length(value)) as s, m0, m1, m2, grouping(m0, m1, m2) as ggg
+from plato.Input
+group by rollup(cast(key as uint32) as m0, cast(key as uint32) % 10u as m1, cast(key as uint32) % 100u as m2)
+order by s, m0, m1, m2;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.sql
new file mode 100644
index 0000000000..f92cad03fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+select count(1) as elements, key_first, val_first, case grouping(key_first, val_first)
+ when 1 then 'Total By First digit key'
+ when 2 then 'Total By First char value'
+ when 3 then 'Grand Total'
+ else 'Group'
+end as group
+from plato.Input group by cube(cast(key as uint32) / 100u as key_first, Substring(value, 1, 1) as val_first)
+order by elements, key_first, val_first;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.sql
new file mode 100644
index 0000000000..1432eaa2a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_grouping_hum_bind.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+$hum_gr_kv = ($grouping) -> {
+ return case $grouping
+ when 1 then 'Total By First digit key'
+ when 2 then 'Total By First char value'
+ when 3 then 'Grand Total'
+ else 'Group'
+ end;
+};
+
+select count(1) as elements, key_first, val_first, $hum_gr_kv(grouping(key_first, val_first)) as group
+from plato.Input group by cube(cast(key as uint32) / 100u as key_first, Substring(value, 1, 1) as val_first)
+order by elements, key_first, val_first;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.sql
new file mode 100644
index 0000000000..385b50c5d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_key_check.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ key, prefix,
+ COUNT(*) AS cnt,
+ grouping(key, prefix) as agrouping
+FROM Input
+GROUP BY ROLLUP (key as key, Substring(value, 1, 1) as prefix)
+ORDER BY key, prefix;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_rename.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_rename.sql
new file mode 100644
index 0000000000..c5098db052
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_rename.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+$s = (
+ select
+ 1 as x,
+ 2 as y
+);
+
+select
+ x as x2,
+ y
+from $s
+group by rollup(
+ x, y
+)
+order by x2, y;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.sql
new file mode 100644
index 0000000000..ee546d63e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_udf.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select key, subkey, Unicode::ToUpper(CAST(value AS Utf8)) as value, count(1) as cnt from Input GROUP BY ROLLUP(key,subkey, value) ORDER BY key,subkey,value,cnt;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.sql
new file mode 100644
index 0000000000..cb1e3c2def
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_rollup_with_filter.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ key, subkey, count(*) as total_count
+from plato.Input
+where key in ('023', '037')
+group by rollup(key, subkey)
+order by key, subkey
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.sql
new file mode 100644
index 0000000000..7ef6caf16a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+
+pragma sampleselect;
+select * FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key) GROUP BY ROLLUP(t1.key as kk, t1.subkey as sk) ORDER BY kk, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.sql
new file mode 100644
index 0000000000..7c65ec4383
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_agg.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+
+pragma sampleselect;
+select kk, sk, sum(cast(t2.subkey as Uint32)) FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key) GROUP BY ROLLUP(t1.key as kk, t1.subkey as sk) ORDER BY kk, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_grouping.sql
new file mode 100644
index 0000000000..c5e431a9ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_grouping.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+$t = select distinct key from Input;
+
+select
+ key, subkey,
+ max(value) as max_val,
+ grouping(a.key, a.subkey) as g_ks,
+ grouping(a.subkey, a.key) as g_sk,
+ grouping(a.key) as g_k,
+ grouping(a.subkey) as g_s,
+from Input as a
+join $t as b on a.key = b.key
+group by rollup(a.key, a.subkey);
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_qualified.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_qualified.sql
new file mode 100644
index 0000000000..b782e754f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_qualified.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ k,
+ b.subkey as sk,
+ MIN(a.value) as val,
+ GROUPING(k, b.subkey) as g,
+FROM plato.Input AS a JOIN plato.Input AS b USING(key)
+GROUP BY ROLLUP (a.key as k, b.subkey)
+ORDER BY g, k, sk
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.sql
new file mode 100644
index 0000000000..f232af79be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+
+pragma sampleselect;
+select kk, sk, max(t2.subkey) as ss FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key) GROUP BY ROLLUP(t1.key as kk, t1.subkey as sk) ORDER BY kk, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.sql
new file mode 100644
index 0000000000..1932c58252
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_simple_fs_multiusage.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+
+pragma sampleselect;
+pragma config.flags("OptimizerFlags", "FieldSubsetEnableMultiusage");
+select kk, sk, max(t2.subkey) as ss FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key) GROUP BY ROLLUP(t1.key as kk, t1.subkey as sk) ORDER BY kk, sk;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_star.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_star.sql
new file mode 100644
index 0000000000..230c974712
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_join_star.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+
+select * FROM plato.Input AS t1 INNER JOIN plato.Input AS t2 USING (key) GROUP BY ROLLUP(t1.key as kk, t1.subkey) ORDER BY kk, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_partition_by_grouping.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_partition_by_grouping.sql
new file mode 100644
index 0000000000..e9d35dde11
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_partition_by_grouping.sql
@@ -0,0 +1,13 @@
+use plato;
+
+select
+ key,
+ subkey,
+ min(value) as mv,
+ grouping(key) + grouping(subkey) as gsum,
+ rank() over (
+ partition by grouping(key) + grouping(subkey)
+ order by key, subkey, min(value)
+ ) as rk,
+from Input
+group by rollup(key, subkey);
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.sql
new file mode 100644
index 0000000000..30971d58aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_select_distinct.sql
@@ -0,0 +1,4 @@
+use plato;
+
+select distinct key from Input group by rollup(key, subkey) order by key;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.sql
new file mode 100644
index 0000000000..1a5bbafc85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_ru_with_window_func.sql
@@ -0,0 +1,3 @@
+use plato;
+
+select row_number() over (order by key) as rn, key from Input group by rollup(key, subkey) order by rn;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session.sql
new file mode 100644
index 0000000000..5faa7d4e14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ MIN(ts) ?? 100500 as session_start,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len
+FROM plato.Input
+GROUP BY SessionWindow(ts, 10), user
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.sql
new file mode 100644
index 0000000000..ef71f18e70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_aliases.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ session_start,
+ SessionStart() as session_start1,
+ SessionStart() ?? 100500 as session_start2,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len
+FROM plato.Input
+GROUP BY SessionWindow(ts, 10) as session_start, user
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.sql
new file mode 100644
index 0000000000..1cbffd58bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_compact.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ MIN(ts) ?? 100500 as session_start,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len
+FROM plato.Input
+GROUP COMPACT BY user, SessionWindow(ts, 10)
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.sql
new file mode 100644
index 0000000000..9a6e3c848b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ MIN(ts) ?? 100500 as session_start,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len,
+ COUNT(DISTINCT payload) as distinct_playloads
+FROM plato.Input
+GROUP BY SessionWindow(ts, 10), user
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.sql
new file mode 100644
index 0000000000..ba4607de17
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_distinct_compact.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ MIN(ts) ?? 100500 as session_start,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len,
+ COUNT(DISTINCT payload) as distinct_playloads
+FROM plato.Input
+GROUP COMPACT BY user, SessionWindow(ts, 10)
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.sql
new file mode 100644
index 0000000000..1b9af1d0d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$init = ($row) -> (AsStruct($row.ts ?? 0 as value, 1 as count));
+
+$calculate = ($_row, $state) -> ($state.value);
+-- split partition into two-element grooups, make session key to be cumulative sum of ts from partition start
+$update = ($row, $state) -> {
+ $state = AsStruct($state.count + 1 as count, $state.value as value);
+ $state = AsStruct($state.count as count, $state.value + ($row.ts ?? 0) as value);
+ return AsTuple(Unwrap($state.count % 2) == 1, $state);
+};
+
+SELECT
+ user,
+ SessionStart() as session_start,
+ ListSort(AGGREGATE_LIST(ts ?? 100500)) as session,
+ COUNT(1) as session_len
+FROM plato.Input
+GROUP BY SessionWindow(ts, $init, $update, $calculate), user
+ORDER BY user, session_start;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.sql
new file mode 100644
index 0000000000..55d34f5e27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_subset.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$init = ($row) -> (AsStruct($row.ts ?? 0 as value, 1 as count));
+
+$calculate = ($_row, $state) -> ($state.value);
+-- split partition into two-element grooups, make session key to be cumulative sum of ts from partition start
+$update = ($row, $state) -> {
+ $state = AsStruct($state.count + 1 as count, $state.value as value);
+ $state = AsStruct($state.count as count, $state.value + ($row.ts ?? 0) as value);
+ return AsTuple(Unwrap($state.count % 2) == 1, $state);
+};
+
+$src = SELECT t.*, (ts ?? 0, payload) as sort_col FROM plato.Input as t;
+
+SELECT
+ COUNT(1) as session_len,
+FROM $src
+GROUP BY user, SessionWindow(sort_col, $init, $update, $calculate)
+ORDER BY session_len;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_tuple.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_tuple.sql
new file mode 100644
index 0000000000..9400ba8534
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_extended_tuple.sql
@@ -0,0 +1,64 @@
+/* postgres can not */
+/* syntax version 1 */
+
+$timeout = 60 * 30;
+
+$init = ($row) -> (AsTuple($row.unixtime, $row.unixtime, $row.video_content_id));
+$update = ($row, $state) -> {
+ $is_end_session = (($row.unixtime - $state.1) >= $timeout) or ($row.video_content_id is not null and $row.video_content_id != ($state.2 ?? "-")) ?? false;
+ $new_state = AsTuple(
+ IF($is_end_session, $row.unixtime, $state.0),
+ $row.unixtime,
+ IF(
+ $is_end_session,
+ $row.video_content_id,
+ $state.2
+ )
+ );
+ return AsTuple($is_end_session, $new_state);
+};
+$calculate = ($row, $state) -> (
+ AsTuple($row.unixtime, $state.2)
+);
+
+$source = [
+ <|
+ vsid: "v",
+ unixtime: 1650624253,
+ video_content_id: null,
+ |>,
+ <|
+ vsid: "v",
+ unixtime: 1650624255,
+ video_content_id: "b",
+ |>,
+ <|
+ vsid: "v",
+ unixtime: 1650624256,
+ video_content_id: null,
+ |>,
+ <|
+ vsid: "v",
+ unixtime: 1650624257,
+ video_content_id: "b",
+ |>,
+ <|
+ vsid: "v",
+ unixtime: 1650634257,
+ video_content_id: "b",
+ |>,
+ <|
+ vsid: "v",
+ unixtime: 1650634258,
+ video_content_id: "c",
+ |>
+];
+
+
+SELECT
+ vsid,
+ session_start,
+ COUNT(*) AS session_size
+FROM as_table($source)
+GROUP BY vsid, SessionWindow(unixtime, $init, $update, $calculate) AS session_start
+order by vsid, session_start
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.sql
new file mode 100644
index 0000000000..f63a3f25b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ MIN(ts) ?? 100500 as session_start,
+FROM plato.Input
+GROUP BY SessionWindow(ts, 9)
+ORDER BY session_start
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.sql
new file mode 100644
index 0000000000..512b6f386f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_only_distinct.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ MIN(DISTINCT ts) ?? 100500 as session_start,
+FROM plato.Input
+GROUP BY SessionWindow(ts, 10)
+ORDER BY session_start
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.sql
new file mode 100644
index 0000000000..b8d2dcd7b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_session_star.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA OrderedColumns;
+
+SELECT *
+FROM plato.Input
+GROUP BY user, SessionWindow(ts, 10) as session_start
+ORDER BY user, session_start;
+
+SELECT *
+FROM plato.Input
+GROUP BY user, SessionWindow(ts, 10)
+ORDER BY user, group0;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.sql
new file mode 100644
index 0000000000..a3fc042006
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_tablerow_column.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+select *
+from Input
+group by TableRow().key as k
+order by k;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.cfg
new file mode 100644
index 0000000000..be223abe99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.cfg
@@ -0,0 +1,2 @@
+in Input5 input5.txt
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.sql
new file mode 100644
index 0000000000..603c7ea45e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_tz_date.sql
@@ -0,0 +1,3 @@
+SELECT SUM(CAST(subkey AS Uint8)) AS sum
+FROM plato.Input5
+GROUP BY CAST(CAST(key AS Uint16) AS TzDate);
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.cfg b/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.cfg
new file mode 100644
index 0000000000..efcd9cfaeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.cfg
@@ -0,0 +1,3 @@
+in Input input_expr.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.sql
new file mode 100644
index 0000000000..0ae44d64c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_with_udf_by_aggregate.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+$majority_vote = Python::majority_vote(
+ Callable<(List<String?>)->String>,
+ @@
+def majority_vote(values):
+ counters = {}
+ for value in values:
+ counters[value] = counters.get(value, 0) + 1
+ return sorted((count, value) for value, count in counters.items())[-1][1]
+ @@
+);
+
+select count(*), val, $majority_vote(aggregate_list(subkey)) from plato.Input group by cast(key as uint32) % 2 as val;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_by_with_where.sql b/yql/essentials/tests/sql/suites/aggregate/group_by_with_where.sql
new file mode 100644
index 0000000000..f6ec83308c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_by_with_where.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT ki, count(1) FROM plato.Input WHERE ki IN ('075', '150') GROUP BY key as ki ORDER BY ki;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.cfg b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.cfg
new file mode 100644
index 0000000000..5b8e8ea74d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.cfg
@@ -0,0 +1 @@
+in Input sorted.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.sql b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.sql
new file mode 100644
index 0000000000..496b6c1d76
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT
+ key, count(value) as cnt, min(value) as min, max(value) as max
+FROM Input
+GROUP COMPACT BY key
+ORDER BY key;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.cfg b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.cfg
new file mode 100644
index 0000000000..64197c4f2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+udf set_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.sql
new file mode 100644
index 0000000000..a29fcd4419
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT
+ key,count(distinct value) as cnt,
+ ListSort(aggregate_list(distinct value)) as lst,
+ min(value) as min, max(value) as max
+FROM Input
+GROUP COMPACT BY key
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.cfg b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.cfg
new file mode 100644
index 0000000000..64197c4f2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+udf set_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.sql b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.sql
new file mode 100644
index 0000000000..74d23fe2df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_distinct_complex.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT
+ key,count(distinct value) as cnt,
+ ListSort(ListMap(
+ aggregate_list(distinct value),($x)->{ return DictItems($x) })) as lst
+FROM (SELECT key, AsDict(AsTuple(1, value)) as value from Input)
+GROUP COMPACT BY key
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.cfg b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.sql b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.sql
new file mode 100644
index 0000000000..f131544139
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/group_compact_sorted_with_diff_order.sql
@@ -0,0 +1,38 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+insert into @ksv
+select * from Input order by key, subkey, value;
+
+insert into @vsk
+select * from Input order by value, subkey, key;
+
+insert into @vs
+select * from Input order by value, subkey;
+
+commit;
+
+select key, subkey, value from @ksv -- YtReduce
+group compact by key, subkey, value
+order by key, subkey, value;
+
+select key, subkey, value from @vsk -- YtReduce
+group /*+ compact() */ by key, subkey, value
+order by key, subkey, value;
+
+select key, subkey, some(value) as value from @ksv -- YtReduce
+group compact by key, subkey
+order by key, subkey, value;
+
+select key, subkey, some(value) as value from @vsk -- YtMapReduce
+group compact by key, subkey
+order by key, subkey, value;
+
+select key, subkey, value from concat(@ksv, @vsk) -- YtMapReduce
+group compact by key, subkey, value
+order by key, subkey, value;
+
+select some(key) as key, subkey, value from concat(@vs, @vsk) -- YtReduce
+group compact by subkey, value
+order by key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/having_cast.sql b/yql/essentials/tests/sql/suites/aggregate/having_cast.sql
new file mode 100644
index 0000000000..15965428c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/having_cast.sql
@@ -0,0 +1 @@
+select value from plato.Input group by value having avg(cast(key as int)) > 100 order by value;
diff --git a/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.cfg b/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.cfg
new file mode 100644
index 0000000000..e377e2a9ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.cfg
@@ -0,0 +1 @@
+in Input3 input3.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.sql b/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.sql
new file mode 100644
index 0000000000..66ec18d2c8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/having_distinct_expr.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+use plato;
+select key from Input3 group by key having count(distinct subkey || subkey) > 1;
diff --git a/yql/essentials/tests/sql/suites/aggregate/having_without_aggregation.sqlx b/yql/essentials/tests/sql/suites/aggregate/having_without_aggregation.sqlx
new file mode 100644
index 0000000000..cab0b5503b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/having_without_aggregation.sqlx
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT *
+FROM Input
+HAVING key < '100' -- using having mean aggregation GROUP BY (), should use aggregation functions
diff --git a/yql/essentials/tests/sql/suites/aggregate/histogram_cdf.sql b/yql/essentials/tests/sql/suites/aggregate/histogram_cdf.sql
new file mode 100644
index 0000000000..3708106e4b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/histogram_cdf.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT
+ histogram_cdf(CAST(key AS double)) AS key,
+ adaptive_ward_histogram_cdf(CAST(subkey AS double)) AS subkey
+FROM Input4;
diff --git a/yql/essentials/tests/sql/suites/aggregate/input.txt b/yql/essentials/tests/sql/suites/aggregate/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input2.txt b/yql/essentials/tests/sql/suites/aggregate/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input3.txt b/yql/essentials/tests/sql/suites/aggregate/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input4.txt b/yql/essentials/tests/sql/suites/aggregate/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input5.txt b/yql/essentials/tests/sql/suites/aggregate/input5.txt
new file mode 100644
index 0000000000..cca9e6118e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input5.txt
@@ -0,0 +1,8 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"=#};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/input5.txt.attr b/yql/essentials/tests/sql/suites/aggregate/input5.txt.attr
new file mode 100644
index 0000000000..f0b397616f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input5.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["OptionalType";["DataType";"String"]]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_coalesce.txt b/yql/essentials/tests/sql/suites/aggregate/input_coalesce.txt
new file mode 100644
index 0000000000..acc680146e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_coalesce.txt
@@ -0,0 +1,2 @@
+{"key"="1";"subkey"="2";"value"="3"};
+{"key"="4";"subkey"="5";"value"="x"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_compare.txt b/yql/essentials/tests/sql/suites/aggregate/input_compare.txt
new file mode 100644
index 0000000000..3307820228
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_compare.txt
@@ -0,0 +1,10 @@
+{"key"="1";"subkey"="";"value"=""};
+{"key"="1";"subkey"="";"value"="bbb"};
+{"key"="1";"subkey"="aaa";"value"=""};
+{"key"="1";"subkey"="aaa";"value"="bbb"};
+{"key"="2";"subkey"="";"value"="bbb"};
+{"key"="2";"subkey"="aaa";"value"=""};
+{"key"="2";"subkey"="aaa";"value"="bbb"};
+{"key"="3";"subkey"="aaa";"value"=""};
+{"key"="3";"subkey"="aaa";"value"="bbb"};
+{"key"="3";"subkey"="ccc";"value"=""};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_dict.txt b/yql/essentials/tests/sql/suites/aggregate/input_dict.txt
new file mode 100644
index 0000000000..702a8e3c5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_dict.txt
@@ -0,0 +1,3 @@
+{"key"="023";"subkey"="1";"dict"={"a"="1"}};
+{"key"="023";"subkey"="2";"dict"={"a"="2"}};
+{"key"="023";"subkey"="3";"dict"={"a"="1"}};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_dict.txt.attr b/yql/essentials/tests/sql/suites/aggregate/input_dict.txt.attr
new file mode 100644
index 0000000000..1dbf7040c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_dict.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["dict";["DictType";["DataType";"String"];["DataType";"String"]]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt b/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt
new file mode 100644
index 0000000000..ad6793f93c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a=B@@b=a@@c=a"};
+{"key"="800";"subkey"="2";"value"="b=1@@c=2@@d=3"};
+{"key"="020";"subkey"="3";"value"="a=i@@c=j"};
+{"key"="150";"subkey"="4";"value"="a=A"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt.attr b/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt.attr
new file mode 100644
index 0000000000..14544c6d7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_dsv.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="Dsv.ReadRecord";
+ "_yql_read_udf_run_config"="@@";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_expr.txt b/yql/essentials/tests/sql/suites/aggregate/input_expr.txt
new file mode 100644
index 0000000000..621e7eaead
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_expr.txt
@@ -0,0 +1,10 @@
+{"key"="192";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="15";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="15";"value"="aaa"};
+{"key"="527";"subkey"="1";"value"="bbb"};
+{"key"="037";"subkey"="15";"value"="ddd"};
+{"key"="761";"subkey"="1";"value"="ccc"};
+{"key"="200";"subkey"="5";"value"="qqq"};
+{"key"="150";"subkey"="5";"value"="zzz"};
+{"key"="042";"subkey"="15";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_intersect.txt b/yql/essentials/tests/sql/suites/aggregate/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_intersect_sorted.txt b/yql/essentials/tests/sql/suites/aggregate/input_intersect_sorted.txt
new file mode 100644
index 0000000000..617e73e92f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_intersect_sorted.txt
@@ -0,0 +1,14 @@
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="150";"subkey"="037";"value"="bfs"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_sorted.txt b/yql/essentials/tests/sql/suites/aggregate/input_sorted.txt
new file mode 100644
index 0000000000..004ddc583b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_sorted.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/input_tutorial_users.txt b/yql/essentials/tests/sql/suites/aggregate/input_tutorial_users.txt
new file mode 100644
index 0000000000..4a18a0dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/input_tutorial_users.txt
@@ -0,0 +1,12 @@
+{"key"="15";"subkey"="213";"value"="Anya"};
+{"key"="25";"subkey"="225";"value"="Petr"};
+{"key"="17";"subkey"="1";"value"="Masha"};
+{"key"="5";"subkey"="225";"value"="Alena"};
+{"key"="23";"subkey"="2";"value"="Irina"};
+{"key"="13";"subkey"="21";"value"="Inna"};
+{"key"="33";"subkey"="125";"value"="Ivan"};
+{"key"="45";"subkey"="225";"value"="Asya"};
+{"key"="27";"subkey"="125";"value"="German"};
+{"key"="41";"subkey"="225";"value"="Olya"};
+{"key"="35";"subkey"="2";"value"="Slava"};
+{"key"="56";"subkey"="2";"value"="Elena"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.cfg b/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.cfg
new file mode 100644
index 0000000000..f139073dff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+xfail
diff --git a/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.sql b/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.sql
new file mode 100644
index 0000000000..3d7640c756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/library_error_in_aggregation_fail.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+select * from (
+SELECT
+ a.key as x, sum(b.value)
+FROM Input as a
+JOIN Input as b
+USING (key)
+GROUP BY a.key
+) where x > "aaa"
+ORDER BY x;
+
+select 1;
+select 1;
+select 1;
+select 1;
+select 1;
+select 1;
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_after_group.sql b/yql/essentials/tests/sql/suites/aggregate/list_after_group.sql
new file mode 100644
index 0000000000..d3169432ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_after_group.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+select aggregate_list(key) as key_list, listsort(aggregate_list(key)) AS sorted_key_list, value as name from plato.Input4 group by value
+order by name; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_nullable.cfg b/yql/essentials/tests/sql/suites/aggregate/list_nullable.cfg
new file mode 100644
index 0000000000..5640285809
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_nullable.cfg
@@ -0,0 +1 @@
+in Input input_coalesce.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_nullable.sql b/yql/essentials/tests/sql/suites/aggregate/list_nullable.sql
new file mode 100644
index 0000000000..48a56c7485
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_nullable.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select aggregate_list(cast(value as int)) as val_list from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.cfg b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.cfg
new file mode 100644
index 0000000000..4d76f79a62
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.cfg
@@ -0,0 +1 @@
+in Input list_with_fold_map.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.sql b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.sql
new file mode 100644
index 0000000000..74df1240ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+USE plato;
+
+$data = (
+ SELECT
+ YQL::FoldMap(
+ counters,
+ names,
+ ($counter, $names) -> {
+ RETURN AsTuple(Unwrap($names[$counter]), $names);
+ }
+ ) AS profile,
+ id
+ FROM Input
+);
+
+SELECT
+ AGGREGATE_LIST(profile) AS profiles,
+ id
+FROM $data
+GROUP BY id;
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt
new file mode 100644
index 0000000000..b8e76e34c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt
@@ -0,0 +1,2 @@
+{"counters"=[0;1;];"names"=["a";"b";];"id"="tmp1";};
+{"counters"=[0;0;];"names"=["c";];"id"="tmp2";};
diff --git a/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt.attr b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt.attr
new file mode 100644
index 0000000000..edb026c6b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/list_with_fold_map.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["counters";["ListType";["DataType";"Int64"]]];
+ ["names";["ListType";["DataType";"String"]]];
+ ["id";["DataType";"String"]]
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/listbuiltin_constness.sql b/yql/essentials/tests/sql/suites/aggregate/listbuiltin_constness.sql
new file mode 100644
index 0000000000..a9e7a23c03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/listbuiltin_constness.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ ListMap([1,2,3], ($x) -> ($x)) AS x
+FROM AS_TABLE([<|key:1|>,<|key:2|>])
+GROUP BY key;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.cfg b/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.cfg
new file mode 100644
index 0000000000..2190809549
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.cfg
@@ -0,0 +1,2 @@
+in Input1 descending.txt
+in Input2 input5.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.sql b/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.sql
new file mode 100644
index 0000000000..71f8b03302
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/native_desc_group_compact_by.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+pragma yt.UseNativeDescSort;
+
+select key, subkey from Input1 -- YtReduce
+group compact by key, subkey
+order by key, subkey;
+
+select key, subkey from Input1 -- YtReduce
+group compact by subkey, key
+order by subkey, key;
+
+select key from Input1 -- YtReduce
+group compact by key
+order by key;
+
+select subkey from Input1 -- YtMapReduce
+group compact by subkey
+order by subkey;
+
+select key, subkey from concat(Input1, Input2) -- YtMapReduce, mix of ascending/descending
+group compact by key, subkey
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/aggregate/null_type.sql b/yql/essentials/tests/sql/suites/aggregate/null_type.sql
new file mode 100644
index 0000000000..03f1b81d01
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/null_type.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ min(x),
+ count(x),
+ count(*),
+ aggregate_list_distinct(x),
+ aggregate_list(x),
+ bool_and(x)
+from (
+ select null as x union all select Null as x
+);
+
+select
+ min(x),
+ count(x),
+ count(*),
+ aggregate_list_distinct(x),
+ aggregate_list(x),
+ bool_and(x)
+from (
+ select null as x, 1 as y union all select Null as x, 2 as y
+)
+group by y;
diff --git a/yql/essentials/tests/sql/suites/aggregate/parsetype_constness.sql b/yql/essentials/tests/sql/suites/aggregate/parsetype_constness.sql
new file mode 100644
index 0000000000..0d25fbf839
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/parsetype_constness.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT
+ Yson::ConvertTo("[1,2]"j, ParseType("List<Int32>")) as x
+FROM AS_TABLE([<|key:1|>, <|key:2|>])
+GROUP BY key;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.cfg b/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.cfg
new file mode 100644
index 0000000000..910dfcb7e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.cfg
@@ -0,0 +1,3 @@
+in Input percentiles_input.txt
+udf stat_udf
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.sql b/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.sql
new file mode 100644
index 0000000000..6dc89752ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentile_and_avg_grouped.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, median(val) as med, avg(val) as avg from (select key, cast(value as int) as val from plato.Input) group by key order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.cfg b/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.cfg
new file mode 100644
index 0000000000..9410b8e431
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.cfg
@@ -0,0 +1,3 @@
+in Input percentiles_input.txt
+udf stat_udf
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.sql b/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.sql
new file mode 100644
index 0000000000..c75cf50c6c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentile_and_variance.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select Math::Round(median(val), -3) as med, Math::Round(stddev(val), -3) as dev from (select cast(value as int) as val from plato.Input); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentile_interval.sql b/yql/essentials/tests/sql/suites/aggregate/percentile_interval.sql
new file mode 100644
index 0000000000..922579f7eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentile_interval.sql
@@ -0,0 +1,38 @@
+/* syntax version 1 */
+
+$zero = unwrap( cast(0 as Interval) );
+$one = unwrap( cast (1 as Interval ) );
+
+-- we want to check both optional<interval> and plain interval
+$prepared = select
+ cast (key As Interval) ?? $zero as interval_data
+ from plato.Input;
+
+$source = select
+ interval_data
+ , interval_data + $one as interval_data2
+ , just( interval_data ) as optional_interval_data
+ from $prepared;
+
+-- percentile factory can work with plain number and with tuple of numbers.
+-- to achive second call we must make several percentile invocations with
+-- same column name
+$data_plain = select
+ percentile(interval_data, 0.8) as result
+ from $source;
+
+-- optimization should unite this into one call to percentile with tuple as argument
+$data_tuple = select
+ percentile(interval_data2, 0.8) as result_1
+ , percentile(interval_data2, 0.6) as result_2
+ from $source;
+
+$data_optional = select
+ percentile(optional_interval_data, 0.4) as result
+ from $source;
+
+select EnsureType(result, Interval?) from $data_plain;
+select EnsureType(result_1, Interval?) from $data_tuple;
+select EnsureType(result_2, Interval?) from $data_tuple;
+select result from $data_optional;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.cfg b/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.cfg
new file mode 100644
index 0000000000..b0152e1177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.cfg
@@ -0,0 +1,2 @@
+in Input percentiles_input.txt
+udf stat_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.sql b/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.sql
new file mode 100644
index 0000000000..7bf4633e45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_containers.sql
@@ -0,0 +1,16 @@
+select
+ key,
+ median(val) as med,
+ percentile(val, AsTuple(0.2, 0.4, 0.6)) as ptuple,
+ percentile(val, AsStruct(0.2 as p20, 0.4 as p40, 0.6 as p60)) as pstruct,
+ percentile(val, AsList(0.2, 0.4, 0.6)) as plist,
+from (select key, cast(value as int) as val from plato.Input)
+group by key
+order by key;
+
+select
+ median(val) as med,
+ percentile(val, AsTuple(0.2, 0.4, 0.6)) as ptuple,
+ percentile(val, AsStruct(0.2 as p20, 0.4 as p40, 0.6 as p60)) as pstruct,
+ percentile(val, AsList(0.2, 0.4, 0.6)) as plist,
+from (select key, cast(value as int) as val from plato.Input)
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.cfg b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.cfg
new file mode 100644
index 0000000000..b0152e1177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.cfg
@@ -0,0 +1,2 @@
+in Input percentiles_input.txt
+udf stat_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.sql b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.sql
new file mode 100644
index 0000000000..f4297e06e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select median(val) as med, median(distinct val) as distinct_med, percentile(val, 0.8) as p80 from (select key, cast(value as int) as val from plato.Input) group by key order by med; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.cfg b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.cfg
new file mode 100644
index 0000000000..b0152e1177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.cfg
@@ -0,0 +1,2 @@
+in Input percentiles_input.txt
+udf stat_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.sql b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.sql
new file mode 100644
index 0000000000..1ad133feee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_grouped_expr.sql
@@ -0,0 +1,8 @@
+select
+ median(val + 1) as med,
+ median(distinct val + 1) as distinct_med,
+ percentile(val + 1, 0.8) as p80
+from (
+ select key, cast(value as int) as val from plato.Input
+)
+group by key order by med;
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_input.txt b/yql/essentials/tests/sql/suites/aggregate/percentiles_input.txt
new file mode 100644
index 0000000000..a2f0714b6f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_input.txt
@@ -0,0 +1,10 @@
+{"key"="foo";"subkey"="";"value"="1"};
+{"key"="foo";"subkey"="";"value"="1"};
+{"key"="foo";"subkey"="";"value"="1"};
+{"key"="foo";"subkey"="";"value"="1"};
+{"key"="foo";"subkey"="";"value"="1"};
+{"key"="bar";"subkey"="";"value"="1"};
+{"key"="bar";"subkey"="";"value"="2"};
+{"key"="bar";"subkey"="";"value"="3"};
+{"key"="bar";"subkey"="";"value"="4"};
+{"key"="bar";"subkey"="";"value"="5"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.cfg b/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.cfg
new file mode 100644
index 0000000000..52e9c9bc90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.cfg
@@ -0,0 +1,2 @@
+in Input percentiles_input.txt
+udf stat_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.sql b/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.sql
new file mode 100644
index 0000000000..045b66c239
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/percentiles_ungrouped.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select median(val) as med, percentile(val, 0.8) as p80 from (select cast(value as int) as val from plato.Input); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.cfg b/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.cfg
new file mode 100644
index 0000000000..11a8788b61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.cfg
@@ -0,0 +1,2 @@
+in Input input_dsv.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.sql b/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.sql
new file mode 100644
index 0000000000..d59e69d29b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/rollup_with_dict.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+--insert into Output
+select val, count(*) as cnt, grouping(val) as grouping
+from Input as t
+group by rollup(t.`dict`["c"] as val)
+order by val, cnt
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/session1.txt b/yql/essentials/tests/sql/suites/aggregate/session1.txt
new file mode 100644
index 0000000000..b3825796b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/session1.txt
@@ -0,0 +1,27 @@
+{"user"="u1"; "ts"=2; payload=6 };
+{"user"="u1"; "ts"=3; payload=8 };
+{"user"="u1"; "ts"=4; payload=10 };
+{"user"="u1"; "ts"=11; payload=12 };
+
+{"user"="u1"; "ts"=22; payload=14 };
+{"user"="u1"; "ts"=32; payload=16 };
+
+{"user"="u1"; "ts"=51; payload=18 };
+
+{"user"="u1"; "ts"=#; payload=2 };
+{"user"="u1"; "ts"=#; payload=4 };
+
+
+
+{"user"=#; "ts"=#; payload=1 };
+{"user"=#; "ts"=#; payload=1 };
+
+{"user"=#; "ts"=1; payload=5 };
+{"user"=#; "ts"=2; payload=5 };
+{"user"=#; "ts"=3; payload=5 };
+{"user"=#; "ts"=10; payload=11 };
+
+{"user"=#; "ts"=21; payload=13 };
+{"user"=#; "ts"=31; payload=15 };
+
+{"user"=#; "ts"=50; payload=17 };
diff --git a/yql/essentials/tests/sql/suites/aggregate/session1.txt.attr b/yql/essentials/tests/sql/suites/aggregate/session1.txt.attr
new file mode 100644
index 0000000000..0df1a044c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/session1.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["user";["OptionalType";["DataType";"String"]]];
+ ["ts";["OptionalType";["DataType";"Int32"]]];
+ ["payload";["DataType";"Int32"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/aggregate/should_use_clone_for_bind_params.sqlx b/yql/essentials/tests/sql/suites/aggregate/should_use_clone_for_bind_params.sqlx
new file mode 100644
index 0000000000..a5c275dcdc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/should_use_clone_for_bind_params.sqlx
@@ -0,0 +1,13 @@
+/* postgres can not */
+use plato;
+
+$puid = ($mission) -> {RETURN Yson::LookupUint64($mission, 'puid');};
+$mid = ($mission) -> {RETURN Yson::LookupString($mission, 'external_id');};
+$customer = ($mission) -> {RETURN Yson::LookupInt64($mission, 'customer');};
+
+SELECT count(distinct $puid) from Input;
+SELECT count(distinct $mid) from Input;
+SELECT count(distinct $customer) from Input;
+
+SELECT count(distinct $puid,$mid,$customer) from Input;
+
diff --git a/yql/essentials/tests/sql/suites/aggregate/sorted.txt b/yql/essentials/tests/sql/suites/aggregate/sorted.txt
new file mode 100644
index 0000000000..565ce828c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/sorted.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/aggregate/sorted.txt.attr b/yql/essentials/tests/sql/suites/aggregate/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.cfg b/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.sql b/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.sql
new file mode 100644
index 0000000000..b5ed8ae250
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/subquery_aggregation.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$total_count = (SELECT Count(*) from Input);
+
+SELECT
+ common,
+ count(*) as rec_count,
+ 100. * count(*) / $total_count as part_percent
+FROM Input
+GROUP BY subkey as common
+ORDER BY common
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/table_funcs_group_by.sql b/yql/essentials/tests/sql/suites/aggregate/table_funcs_group_by.sql
new file mode 100644
index 0000000000..85652ed433
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/table_funcs_group_by.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ groupTribit,
+ count(*) as count
+from Input
+GROUP BY TableRecordIndex() % 3 as groupTribit
+ORDER BY groupTribit, count
diff --git a/yql/essentials/tests/sql/suites/aggregate/table_funcs_spec_aggregation.sqlx b/yql/essentials/tests/sql/suites/aggregate/table_funcs_spec_aggregation.sqlx
new file mode 100644
index 0000000000..8b9040a95a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/table_funcs_spec_aggregation.sqlx
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ key,
+ max(TablePath()) as table_rec
+from Input
+group by key
+;
diff --git a/yql/essentials/tests/sql/suites/aggregate/table_row_aggregation.sql b/yql/essentials/tests/sql/suites/aggregate/table_row_aggregation.sql
new file mode 100644
index 0000000000..f35a0d881b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/table_row_aggregation.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$data = (
+ SELECT SOME(TableRow())
+ FROM Input4
+ GROUP BY key
+);
+
+SELECT *
+FROM $data
+FLATTEN COLUMNS
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/aggregate/yql-18511.cfg b/yql/essentials/tests/sql/suites/aggregate/yql-18511.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/yql-18511.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/aggregate/yql-18511.sql b/yql/essentials/tests/sql/suites/aggregate/yql-18511.sql
new file mode 100644
index 0000000000..e0d2d2b0d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/yql-18511.sql
@@ -0,0 +1,70 @@
+/* yt can not */
+
+$round_period = ($day, $period) -> {
+ RETURN
+ CASE
+ WHEN $period = 'd' THEN $day
+ WHEN $period = 'w' THEN DateTime::MakeDate(DateTime::StartOfWeek($day))
+ WHEN $period = 'm' THEN DateTime::MakeDate(DateTime::StartOfMonth($day))
+ ELSE $day
+ END
+};
+
+$data =
+SELECT
+ $round_period(day, 'd') AS day,
+ $round_period(day, 'w') AS week,
+ $round_period(day, 'm') AS month,
+ IF(user_card_cnt <= 10, user_card_cnt, 11) AS user_cards_segm,
+ is_proven_owner,
+ user_id,
+FROM (
+ SELECT
+ Date("2024-04-29") AS day,
+ "ALLO" AS mark,
+ "???" AS model,
+ 5 AS user_card_cnt,
+ 'ACTIVE' AS status,
+ 999 AS user_id,
+ 1 AS is_proven_owner,
+ UNION ALL
+ SELECT
+ Date("2024-04-29") AS day,
+ "ALLO" AS mark,
+ "!!!!!!" AS model,
+ 50 AS user_card_cnt,
+ 'ACTIVE' AS status,
+ 1111 AS user_id,
+ 0 AS is_proven_owner,
+);
+
+SELECT
+ day,
+ GROUPING(day) AS grouping_day,
+ week,
+ GROUPING(week) AS grouping_week,
+ month,
+ GROUPING(month) as grouping_month,
+ CASE
+ WHEN GROUPING(week) == 1 AND GROUPING(month) == 1 THEN 'd'
+ WHEN GROUPING(day) == 1 AND GROUPING(month) == 1 THEN 'w'
+ WHEN GROUPING(day) == 1 AND GROUPING(week) == 1 THEN 'm'
+ ELSE NULL
+ END AS period_type,
+ user_cards_segm,
+ if(GROUPING(user_cards_segm) = 1, -300, user_cards_segm) AS __user_cards_segm__,
+ GROUPING(user_cards_segm) as grouping_user_cards_segm,
+ COUNT(DISTINCT user_id) AS all_user_qty,
+FROM $data AS t
+GROUP BY
+ GROUPING SETS(
+ -- day grouping
+ (day),
+ (day, user_cards_segm),
+ -- -- week grouping
+ (week),
+ (week, user_cards_segm),
+ -- -- month grouping
+ (month),
+ (month, user_cards_segm)
+ )
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/basic_columns.sql b/yql/essentials/tests/sql/suites/ansi_idents/basic_columns.sql
new file mode 100644
index 0000000000..6bce49176a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/basic_columns.sql
@@ -0,0 +1,5 @@
+--!ansi_lexer
+/* syntax version 1 */
+use plato;
+
+select "key" || subkey as "akey" from Input order by akey;
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/default.cfg b/yql/essentials/tests/sql/suites/ansi_idents/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/escaped_udf_name.sql b/yql/essentials/tests/sql/suites/ansi_idents/escaped_udf_name.sql
new file mode 100644
index 0000000000..9316d67556
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/escaped_udf_name.sql
@@ -0,0 +1,6 @@
+--!ansi_lexer
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select `key` from Input where "String"::Contains("key", '7') order by key;
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/escaping.sql b/yql/essentials/tests/sql/suites/ansi_idents/escaping.sql
new file mode 100644
index 0000000000..bb73b46d5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/escaping.sql
@@ -0,0 +1,3 @@
+--!ansi_lexer
+/* syntax version 1 */
+select 1 as "\", 2 as "foo""bar", 3 as """baz";
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/inplace_yql.sql b/yql/essentials/tests/sql/suites/ansi_idents/inplace_yql.sql
new file mode 100644
index 0000000000..d851d9f6f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/inplace_yql.sql
@@ -0,0 +1,8 @@
+--!ansi_lexer
+/* syntax version 1 */
+/* postgres can not */
+pragma warning("disable", "4510");
+
+$foo = "YQL"::'(lambda ''(item) (Concat (String ''"foo\''") item))';
+
+select $foo('bar');
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/input.txt b/yql/essentials/tests/sql/suites/ansi_idents/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/input2.txt b/yql/essentials/tests/sql/suites/ansi_idents/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/input3.txt b/yql/essentials/tests/sql/suites/ansi_idents/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/input4.txt b/yql/essentials/tests/sql/suites/ansi_idents/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/join_using.sql b/yql/essentials/tests/sql/suites/ansi_idents/join_using.sql
new file mode 100644
index 0000000000..9f2c9c1869
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/join_using.sql
@@ -0,0 +1,5 @@
+--!ansi_lexer
+/* syntax version 1 */
+use plato;
+
+select count(*) from Input2 as a join Input3 as b using("key");;
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/order_by.sql b/yql/essentials/tests/sql/suites/ansi_idents/order_by.sql
new file mode 100644
index 0000000000..ca319759aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/order_by.sql
@@ -0,0 +1,5 @@
+--!ansi_lexer
+/* syntax version 1 */
+use plato;
+
+select "a".* from Input as "a" order by "key", `subkey`;
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/string_escaping.sql b/yql/essentials/tests/sql/suites/ansi_idents/string_escaping.sql
new file mode 100644
index 0000000000..cd234de71c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/string_escaping.sql
@@ -0,0 +1,3 @@
+--!ansi_lexer
+/* syntax version 1 */
+select '\', '', 'foo''bar', '''baz';
diff --git a/yql/essentials/tests/sql/suites/ansi_idents/struct_access.sql b/yql/essentials/tests/sql/suites/ansi_idents/struct_access.sql
new file mode 100644
index 0000000000..034a9dd2a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ansi_idents/struct_access.sql
@@ -0,0 +1,5 @@
+--!ansi_lexer
+/* syntax version 1 */
+/* postgres can not */
+$s = <|"a": 1, b: 2, `c`: 3|>;
+select $s."b";
diff --git a/yql/essentials/tests/sql/suites/bigdate/BigDates.txt b/yql/essentials/tests/sql/suites/bigdate/BigDates.txt
new file mode 100644
index 0000000000..dfdbaa09b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/BigDates.txt
@@ -0,0 +1,31 @@
+{"row"=-2147483649; "d32"=0; "dt64"=-2147483649; "ts64"=-2147483649; "i64"=-2147483649 };
+{"row"=-2147483648; "d32"=0; "dt64"=-2147483648; "ts64"=-2147483648; "i64"=-2147483648 };
+{"row"=-32769; "d32"=-32769; "dt64"=-32769; "ts64"=-32769; "i64"=-32769 };
+{"row"=-32768; "d32"=-32768; "dt64"=-32768; "ts64"=-32768; "i64"=-32768 };
+{"row"=-129; "d32"=-129; "dt64"=-129; "ts64"=-129; "i64"=-129 };
+{"row"=-128; "d32"=-128; "dt64"=-128; "ts64"=-128; "i64"=-128 };
+
+{"row"=-7; "d32"=-53375809; "dt64"=-4611669897600; "ts64"=-4611669897600000000; "i64"=-9223339708799999999 };
+{"row"=-6; "d32"=-719163; "dt64"=-62135596801; "ts64"=-62135596800000001; "i64"=-4291747200000000 };
+{"row"=-5; "d32"=-719162; "dt64"=-62135596800; "ts64"=-62135596800000000; "i64"=-4291747199999999 };
+{"row"=-4; "d32"=-366; "dt64"=-86401; "ts64"=-86400000001; "i64"=-86400000001 };
+{"row"=-3; "d32"=-365; "dt64"=-86400; "ts64"=-86400000000; "i64"=-86400000000 };
+{"row"=-2; "d32"=-364; "dt64"=-86399; "ts64"=-86399999999; "i64"=-86399999999 };
+
+{"row"=-1; "d32"=-1; "dt64"=-1; "ts64"=-1; "i64"=-1 };
+{"row"=0; "d32"=0; "dt64"=0; "ts64"=0; "i64"=0 };
+{"row"=1; "d32"=1; "dt64"=1; "ts64"=1; "i64"=1 };
+
+{"row"=2; "d32"=364; "dt64"=86399; "ts64"=86399999999; "i64"=86399999999 };
+{"row"=3; "d32"=365; "dt64"=86400; "ts64"=86400000000; "i64"=86400000000 };
+{"row"=4; "d32"=366; "dt64"=86401; "ts64"=86400000001; "i64"=86400000001 };
+{"row"=5; "d32"=49672; "dt64"=4291747199; "ts64"=4291747199999999; "i64"=4291747199999999 };
+{"row"=6; "d32"=49673; "dt64"=4291747200; "ts64"=4291747200000000; "i64"=4291747200000000 };
+{"row"=7; "d32"=53375807; "dt64"=4611669811199; "ts64"=4611669811199999999; "i64"=9223339708799999999 };
+
+{"row"=128; "d32"=128; "dt64"=128; "ts64"=128; "i64"=128 };
+{"row"=256; "d32"=256; "dt64"=256; "ts64"=256; "i64"=256 };
+{"row"=32768; "d32"=32768; "dt64"=32768; "ts64"=32768; "i64"=32768 };
+{"row"=65536; "d32"=65536; "dt64"=65536; "ts64"=65536; "i64"=65536 };
+{"row"=2147483648; "d32"=0; "dt64"=2147483648; "ts64"=2147483648; "i64"=2147483648 };
+{"row"=4294967296; "d32"=0; "dt64"=4294967296; "ts64"=4294967296; "i64"=4294967296 };
diff --git a/yql/essentials/tests/sql/suites/bigdate/BigDates.txt.attr b/yql/essentials/tests/sql/suites/bigdate/BigDates.txt.attr
new file mode 100644
index 0000000000..aa7e0bc89c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/BigDates.txt.attr
@@ -0,0 +1,17 @@
+{
+ "schema" = <"strict" = %true; "unique_keys" = %false> [
+ { "type" = "int64"; "required" = %true; "name" = "row" };
+ { "type" = "int32"; "required" = %true; "name" = "d32" };
+ { "type" = "int64"; "required" = %true; "name" = "dt64" };
+ { "type" = "int64"; "required" = %true; "name" = "ts64" };
+ { "type" = "int64"; "required" = %true; "name" = "i64" };
+ ];
+ "_yql_row_spec" = {
+ "TypePatch" = ["StructType";[
+ ["d32"; ["DataType"; "Date32"]];
+ ["dt64"; ["DataType"; "Datetime64"]];
+ ["ts64" ;["DataType"; "Timestamp64"]];
+ ["i64"; ["DataType"; "Interval64"]];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt b/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt
new file mode 100644
index 0000000000..66d70ca8ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt
@@ -0,0 +1,14 @@
+{"row"=0u; "d"=0u; "dt"=0u; "ts"=0u };
+{"row"=1u; "d"=1u; "dt"=1u; "ts"=1u };
+
+{"row"=2u; "d"=364u; "dt"=86399u; "ts"=86399999999u };
+{"row"=3u; "d"=365u; "dt"=86400u; "ts"=86400000000u };
+{"row"=4u; "d"=366u; "dt"=86401u; "ts"=86400000001u };
+{"row"=5u; "d"=49672u; "dt"=4291747199u; "ts"=4291747199999999u };
+
+{"row"=128u; "d"=128u; "dt"=128u; "ts"=128u };
+{"row"=256u; "d"=256u; "dt"=256u; "ts"=256u };
+{"row"=32768u; "d"=32768u; "dt"=32768u; "ts"=32768u };
+{"row"=65536u; "d"=0u; "dt"=65536u; "ts"=65536u };
+{"row"=2147483648u; "d"=0u; "dt"=2147483648u; "ts"=2147483648u };
+{"row"=4294967296u; "d"=0u; "dt"=0u; "ts"=4294967296u };
diff --git a/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt.attr b/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt.attr
new file mode 100644
index 0000000000..d5ea06fda8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/NarrowDates.txt.attr
@@ -0,0 +1,15 @@
+{
+ "schema" = <"strict" = %true; "unique_keys" = %false> [
+ { "type" = "uint64"; "required" = %true; "name" = "row" };
+ { "type" = "uint16"; "required" = %true; "name" = "d" };
+ { "type" = "uint32"; "required" = %true; "name" = "dt" };
+ { "type" = "uint64"; "required" = %true; "name" = "ts" };
+ ];
+ "_yql_row_spec" = {
+ "TypePatch" = ["StructType";[
+ ["d"; ["DataType"; "Date"]];
+ ["dt"; ["DataType"; "Datetime"]];
+ ["ts" ;["DataType"; "Timestamp"]];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt b/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt
new file mode 100644
index 0000000000..49c519f404
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt
@@ -0,0 +1,27 @@
+{"row"=-2147483649;"i"=-2147483649 };
+{"row"=-2147483648;"i"=-2147483648 };
+{"row"=-32769;"i"=-32769 };
+{"row"=-32768;"i"=-32768 };
+{"row"=-129;"i"=-129 };
+{"row"=-128;"i"=-128 };
+
+{"row"=-5;"i"=-4291747199999999 };
+{"row"=-4;"i"=-86400000001 };
+{"row"=-3;"i"=-86400000000 };
+{"row"=-2;"i"=-86399999999 };
+
+{"row"=-1;"i"=-1 };
+{"row"=0;"i"=0 };
+{"row"=1;"i"=1 };
+
+{"row"=2;"i"=86399999999 };
+{"row"=3;"i"=86400000000 };
+{"row"=4;"i"=86400000001 };
+{"row"=5;"i"=4291747199999999 };
+
+{"row"=128;"i"=128 };
+{"row"=256;"i"=256 };
+{"row"=32768;"i"=32768 };
+{"row"=65536;"i"=65536 };
+{"row"=2147483648;"i"=2147483648 };
+{"row"=4294967296;"i"=4294967296 };
diff --git a/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt.attr b/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt.attr
new file mode 100644
index 0000000000..bb8f05160e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/NarrowInterval.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true; "unique_keys" = %false> [
+ { "type" = "int64"; "required" = %true; "name" = "row" };
+ { "type" = "int64"; "required" = %true; "name" = "i" };
+ ];
+ "_yql_row_spec" = {
+ "TypePatch" = ["StructType";[
+ ["i"; ["DataType"; "Interval"]];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/bigdate/Signed.txt b/yql/essentials/tests/sql/suites/bigdate/Signed.txt
new file mode 100644
index 0000000000..3a6634c986
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/Signed.txt
@@ -0,0 +1,17 @@
+{ "row"=-8; "i8"=-16; "i16"=-256; "i32"=-65536; "i64"=-4294967296; };
+{ "row"=-7; "i8"=-128; "i16"=-32768; "i32"=-2147483648; "i64"=-9223372036854775808; };
+{ "row"=-6; "i8"=-128; "i16"=-32768; "i32"=-2147483648; "i64"=-9223339708799999999; };
+{ "row"=-5; "i8"=-128; "i16"=-32768; "i32"=-2147483648; "i64"=-4611669897600000001; };
+{ "row"=-4; "i8"=-128; "i16"=-32768; "i32"=-2147483648; "i64"=-4611669897600000000; };
+{ "row"=-3; "i8"=-128; "i16"=-32768; "i32"=-53375810; "i64"=-4611669897601; };
+{ "row"=-2; "i8"=-128; "i16"=-32768; "i32"=-53375809; "i64"=-4611669897600; };
+{ "row"=-1; "i8"=-1; "i16"=-1; "i32"=-1; "i64"=-1; };
+{ "row"=0; "i8"=0; "i16"=0; "i32"=0; "i64"=0; };
+{ "row"=1; "i8"=1; "i16"=1; "i32"=1; "i64"=1; };
+{ "row"=2; "i8"=127; "i16"=32767; "i32"=53375807; "i64"=4611669811199; };
+{ "row"=3; "i8"=127; "i16"=32767; "i32"=53375808; "i64"=4611669811200; };
+{ "row"=4; "i8"=127; "i16"=32767; "i32"=2147483647; "i64"=4611669811199999999; };
+{ "row"=5; "i8"=127; "i16"=32767; "i32"=2147483647; "i64"=4611669811200000000; };
+{ "row"=6; "i8"=127; "i16"=32767; "i32"=2147483647; "i64"=9223339708799999999; };
+{ "row"=7; "i8"=127; "i16"=32767; "i32"=2147483647; "i64"=9223372036854775807; };
+{ "row"=8; "i8"=16; "i16"=256; "i32"=65536; "i64"=4294967296; };
diff --git a/yql/essentials/tests/sql/suites/bigdate/Signed.txt.attr b/yql/essentials/tests/sql/suites/bigdate/Signed.txt.attr
new file mode 100644
index 0000000000..56781be680
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/Signed.txt.attr
@@ -0,0 +1,9 @@
+{
+ "schema" = <"strict" = %true; "unique_keys" = %false> [
+ {"type" = "int64"; "required" = %true; "name" = "row"};
+ {"type" = "int8"; "required" = %true; "name" = "i8"};
+ {"type" = "int16"; "required" = %true; "name" = "i16"};
+ {"type" = "int32"; "required" = %true; "name" = "i32"};
+ {"type" = "int64"; "required" = %true; "name" = "i64"};
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt b/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt
new file mode 100644
index 0000000000..57d9f27b10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt
@@ -0,0 +1,8 @@
+{ "row"=0u; "ui8"=0u; "ui16"=0u; "ui32"=0u; "ui64"=0u; };
+{ "row"=1u; "ui8"=1u; "ui16"=1u; "ui32"=1u; "ui64"=1u; };
+{ "row"=2u; "ui8"=255u; "ui16"=65535u; "ui32"=53375807u; "ui64"=4611669811199u; };
+{ "row"=3u; "ui8"=255u; "ui16"=65535u; "ui32"=53375808u; "ui64"=4611669811200u; };
+{ "row"=4u; "ui8"=255u; "ui16"=65535u; "ui32"=4294967295u; "ui64"=4611669811199999999u; };
+{ "row"=5u; "ui8"=255u; "ui16"=65535u; "ui32"=4294967295u; "ui64"=4611669811200000000u; };
+{ "row"=6u; "ui8"=255u; "ui16"=65535u; "ui32"=4294967295u; "ui64"=9223339708799999999u; };
+{ "row"=7u; "ui8"=255u; "ui16"=65535u; "ui32"=4294967295u; "ui64"=18446744073709551615u; };
diff --git a/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt.attr b/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt.attr
new file mode 100644
index 0000000000..9d72213c91
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/Unsigned.txt.attr
@@ -0,0 +1,9 @@
+{
+ "schema" = <"strict" = %true; "unique_keys" = %false> [
+ {"type" = "uint64"; "required" = %true; "name" = "row"};
+ {"type" = "uint8"; "required" = %true; "name" = "ui8"};
+ {"type" = "uint16"; "required" = %true; "name" = "ui16"};
+ {"type" = "uint32"; "required" = %true; "name" = "ui32"};
+ {"type" = "uint64"; "required" = %true; "name" = "ui64"};
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/bigdate/arithmetic.sql b/yql/essentials/tests/sql/suites/bigdate/arithmetic.sql
new file mode 100644
index 0000000000..5e72aa0c06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/arithmetic.sql
@@ -0,0 +1,103 @@
+$date32_min = unwrap(cast(-53375809 as date32));
+$date32_max = unwrap(cast(53375807 as date32));
+$datetime64_min = unwrap(cast(-4611669897600 as datetime64));
+$datetime64_max = unwrap(cast(4611669811199 as datetime64));
+$timestamp64_min = unwrap(cast(-4611669897600000000 as timestamp64));
+$timestamp64_max = unwrap(cast(4611669811199999999 as timestamp64));
+$interval64_min = unwrap(cast(-9223339708799999999 as interval64));
+$interval64_max = unwrap(cast(9223339708799999999 as interval64));
+$interval64_plus1 = unwrap(cast(1 as interval64));
+$interval64_minus1 = unwrap(cast(-1 as interval64));
+$interval64_zero = unwrap(cast(0 as interval64));
+
+$date_max_value = 49673l;
+$date_max = unwrap(cast($date_max_value - 1 as date));
+$datetime_max = unwrap(cast($date_max_value*86400 - 1 as datetime));
+$timestamp_max = unwrap(cast($date_max_value*86400*1000000 - 1 as timestamp));
+$interval_min = unwrap(cast(-$date_max_value*86400*1000000 + 1 as interval));
+$interval_max = unwrap(cast($date_max_value*86400*1000000 - 1 as interval));
+$interval_plus1 = unwrap(cast(1 as interval));
+$interval_minus1 = unwrap(cast(-1 as interval));
+
+$i64_max = 9223372036854775807l;
+$ui64_max = 18446744073709551615ul;
+
+select 1, $date32_min - $date32_max, $date32_max - $date32_min
+, $date32_min - $datetime64_max, $date32_max - $datetime64_min
+, $date32_min - $timestamp64_max, $date32_max - $timestamp64_min
+, 2, $date32_min - $date_max
+, $date32_min - $datetime_max
+, $date32_min - $timestamp_max
+, 3, $date32_min - $interval64_minus1, $date32_max - $interval64_minus1
+, $date32_min - $interval64_plus1, $date32_max - $interval64_plus1
+, $date32_min + $interval64_minus1, $date32_max + $interval64_minus1
+, $date32_min + $interval64_plus1, $date32_max + $interval64_plus1
+, 4, $date32_min - $interval_minus1, $date32_max - $interval_minus1
+, $date32_min - $interval_plus1, $date32_max - $interval_plus1
+, $date32_min + $interval_minus1, $date32_max + $interval_minus1
+, $date32_min + $interval_plus1, $date32_max + $interval_plus1;
+
+select 1, $datetime64_min - $date32_max, $datetime64_max - $date32_min
+, $datetime64_min - $datetime64_max, $datetime64_max - $datetime64_min
+, $datetime64_min - $timestamp64_max, $datetime64_max - $timestamp64_min
+, 2, $datetime64_min - $date_max
+, $datetime64_min - $datetime_max
+, $datetime64_min - $timestamp_max
+, 3, $datetime64_min - $interval64_minus1, $datetime64_max - $interval64_minus1
+, $datetime64_min - $interval64_plus1, $datetime64_max - $interval64_plus1
+, $datetime64_min + $interval64_minus1, $datetime64_max + $interval64_minus1
+, $datetime64_min + $interval64_plus1, $datetime64_max + $interval64_plus1
+, 4, $datetime64_min - $interval_minus1, $datetime64_max - $interval_minus1
+, $datetime64_min - $interval_plus1, $datetime64_max - $interval_plus1
+, $datetime64_min + $interval_minus1, $datetime64_max + $interval_minus1
+, $datetime64_min + $interval_plus1, $datetime64_max + $interval_plus1;
+
+select 1, $timestamp64_min - $date32_max, $timestamp64_max - $date32_min
+, $timestamp64_min - $datetime64_max, $timestamp64_max - $datetime64_min
+, $timestamp64_min - $timestamp64_max, $timestamp64_max - $timestamp64_min
+, 2, $timestamp64_min - $date_max
+, $timestamp64_min - $datetime_max
+, $timestamp64_min - $timestamp_max
+, 3, $timestamp64_min - $interval64_minus1, $timestamp64_max - $interval64_minus1
+, $timestamp64_min - $interval64_plus1, $timestamp64_max - $interval64_plus1
+, $timestamp64_min + $interval64_minus1, $timestamp64_max + $interval64_minus1
+, $timestamp64_min + $interval64_plus1, $timestamp64_max + $interval64_plus1
+, 4, $timestamp64_min - $interval_minus1, $timestamp64_max - $interval_minus1
+, $timestamp64_min - $interval_plus1, $timestamp64_max - $interval_plus1
+, $timestamp64_min + $interval_minus1, $timestamp64_max + $interval_minus1
+, $timestamp64_min + $interval_plus1, $timestamp64_max + $interval_plus1;
+
+select 1, $date_max - $date32_min, $date_max - $datetime64_min, $date_max - $timestamp64_min
+, $date_max - $date32_max, $date_max - $datetime64_max, $date_max - $timestamp64_max
+, $date_max - $interval64_minus1, $date_max + $interval64_minus1
+, $date_max - $interval64_plus1, $date_max + $interval64_plus1
+, 2, $datetime_max - $date32_min, $datetime_max - $datetime64_min, $datetime_max - $timestamp64_min
+, $datetime_max - $date32_max, $datetime_max - $datetime64_max, $datetime_max - $timestamp64_max
+, $datetime_max - $interval64_minus1, $datetime_max + $interval64_minus1
+, $datetime_max - $interval64_plus1, $datetime_max + $interval64_plus1
+, 3, $timestamp_max - $date32_min, $timestamp_max - $datetime64_min, $timestamp_max - $timestamp64_min
+, $timestamp_max - $date32_max, $timestamp_max - $datetime64_max, $timestamp_max - $timestamp64_max
+, $timestamp_max - $interval64_minus1, $timestamp_max + $interval64_minus1
+, $timestamp_max - $interval64_plus1, $timestamp_max + $interval64_plus1;
+
+select 1, $interval_min - $interval64_min, $interval_min + $interval64_min
+, $interval_min - $interval64_max, $interval_min + $interval64_max
+, $interval_max - $interval64_max, $interval_max + $interval64_max
+, $interval_max - $interval64_min, $interval_max + $interval64_min
+, 2, $interval64_max - $interval64_min, $interval64_min - $interval64_max
+, $interval64_max + $interval64_min, $interval64_max + $interval64_max
+, $interval64_min - $interval64_min, $interval64_max - $interval64_max;
+
+select 0, -$interval64_max, -$interval64_min, -$interval64_zero
+, 1, $interval64_max*0, 0*$interval64_max
+, 2, $interval64_max*1, 1*$interval64_max, $interval64_max*(-1), (-1)*$interval64_max
+, 3, $interval64_min*1, 1*$interval64_min, $interval64_min*(-1), (-1)*$interval64_min
+, 4, $interval64_plus1*cast($interval64_max as int64), $interval64_minus1*cast($interval64_min as int64)
+, 5, $interval64_max*$ui64_max, $i64_max*$interval64_max, $interval64_min*$ui64_max, $i64_max*$interval64_min
+, 6, $interval64_zero*$ui64_max, $ui64_max*$interval64_zero, $interval64_zero*$i64_max, $i64_max*$interval64_zero
+, 7, $interval64_max/0, $interval64_min/0, $interval64_max/1, $interval64_min/1, $interval64_max/(-1), $interval64_min/(-1)
+, 8, $interval64_zero/$ui64_max, $interval64_zero/$i64_max, $interval64_plus1/$ui64_max, $interval64_plus1/$i64_max, $interval64_minus1/$ui64_max, $interval64_minus1/$i64_max
+, 9, $interval64_max/cast($interval64_max as int64), $interval64_min/cast($interval64_min as int64)
+, 10, abs($interval64_max), abs($interval64_min), abs($interval64_zero)
+, 11, cast(4294967296l as interval64) * 4294967296l, 4294967296ul * cast(4294967296l as interval64)
+;
diff --git a/yql/essentials/tests/sql/suites/bigdate/bitcast_date32.sql b/yql/essentials/tests/sql/suites/bigdate/bitcast_date32.sql
new file mode 100644
index 0000000000..45870eac39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/bitcast_date32.sql
@@ -0,0 +1,10 @@
+pragma warning("disable","4510");
+
+select bitcast(Yql::Date32(AsAtom("1")) as Uint8)
+, 4, bitcast(Yql::Date32(AsAtom("1")) as Int8)
+, 5, bitcast(Yql::Date32(AsAtom("1")) as Uint16)
+, 6, bitcast(Yql::Date32(AsAtom("1")) as Int16)
+, 7, bitcast(Yql::Date32(AsAtom("1")) as Uint32)
+, 8, bitcast(Yql::Date32(AsAtom("1")) as Int32)
+, 9, bitcast(Yql::Date32(AsAtom("1")) as Uint64)
+, 10, bitcast(Yql::Date32(AsAtom("1")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/bigdate/bitcast_datetime64.sql b/yql/essentials/tests/sql/suites/bigdate/bitcast_datetime64.sql
new file mode 100644
index 0000000000..bc5aec2b90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/bitcast_datetime64.sql
@@ -0,0 +1,10 @@
+pragma warning("disable","4510");
+
+select bitcast(Yql::Datetime64(AsAtom("1")) as Uint8)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Int8)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Uint16)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Int16)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Uint32)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Int32)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Uint64)
+, bitcast(Yql::Datetime64(AsAtom("1")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/bigdate/bitcast_interval64.sql b/yql/essentials/tests/sql/suites/bigdate/bitcast_interval64.sql
new file mode 100644
index 0000000000..0762fd9192
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/bitcast_interval64.sql
@@ -0,0 +1,10 @@
+pragma warning("disable","4510");
+
+select bitcast(Yql::Interval64(AsAtom("1")) as Uint8)
+, bitcast(Yql::Interval64(AsAtom("1")) as Int8)
+, bitcast(Yql::Interval64(AsAtom("1")) as Uint16)
+, bitcast(Yql::Interval64(AsAtom("1")) as Int16)
+, bitcast(Yql::Interval64(AsAtom("1")) as Uint32)
+, bitcast(Yql::Interval64(AsAtom("1")) as Int32)
+, bitcast(Yql::Interval64(AsAtom("1")) as Uint64)
+, bitcast(Yql::Interval64(AsAtom("1")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/bigdate/bitcast_timestamp64.sql b/yql/essentials/tests/sql/suites/bigdate/bitcast_timestamp64.sql
new file mode 100644
index 0000000000..9261b04498
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/bitcast_timestamp64.sql
@@ -0,0 +1,10 @@
+pragma warning("disable","4510");
+
+select bitcast(Yql::Timestamp64(AsAtom("1")) as Uint8)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Int8)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Uint16)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Int16)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Uint32)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Int32)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Uint64)
+, bitcast(Yql::Timestamp64(AsAtom("1")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/bigdate/common_type.sql b/yql/essentials/tests/sql/suites/bigdate/common_type.sql
new file mode 100644
index 0000000000..0e4b6ff1b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/common_type.sql
@@ -0,0 +1,49 @@
+$date_val = unwrap(cast(1 as date));
+$date32_val = unwrap(cast(-1 as date32));
+
+$datetime_val = unwrap(cast(86400 as datetime));
+$datetime64_val = unwrap(cast(-86400 as datetime64));
+
+$timestamp_val = unwrap(cast(86400l*1000000 as timestamp));
+$timestamp64_val = unwrap(cast(-86400l*1000000 as timestamp64));
+
+$interval_val = unwrap(cast(1 as interval));
+$interval64_val = unwrap(cast(-1 as interval64));
+
+select 1, [$date_val, $datetime_val]
+, [$date_val, $timestamp_val]
+, [$date_val, $date32_val]
+, [$date_val, $datetime64_val]
+, [$date_val, $timestamp64_val]
+, 2, [$datetime_val, $date_val]
+, [$datetime_val, $timestamp_val]
+, [$datetime_val, $date32_val]
+, [$datetime_val, $datetime64_val]
+, [$datetime_val, $timestamp64_val]
+, 3, [$timestamp_val, $date_val]
+, [$timestamp_val, $datetime_val]
+, [$timestamp_val, $date32_val]
+, [$timestamp_val, $datetime64_val]
+, [$timestamp_val, $timestamp64_val]
+, 4, [$date32_val, $date_val]
+, [$date32_val, $datetime_val]
+, [$date32_val, $timestamp_val]
+, [$date32_val, $datetime64_val]
+, [$date32_val, $timestamp64_val]
+, 5, [$datetime64_val, $date_val]
+, [$datetime64_val, $datetime_val]
+, [$datetime64_val, $timestamp_val]
+, [$datetime64_val, $date32_val]
+, [$datetime64_val, $timestamp64_val]
+, 6, [$timestamp64_val, $date_val]
+, [$timestamp64_val, $datetime_val]
+, [$timestamp64_val, $timestamp_val]
+, [$timestamp64_val, $date32_val]
+, [$timestamp64_val, $datetime64_val]
+, 7, [$date_val, $datetime_val, $timestamp_val, $date32_val, $datetime64_val, $timestamp64_val];
+
+select [unwrap(cast(1 as interval)), unwrap(cast(-1 as interval64))];
+
+$datetime_values = [$date_val, $date32_val, $datetime_val, $datetime64_val, $timestamp_val, $timestamp64_val];
+$interval_values = [$interval_val, $interval64_val];
+select ListSort(DictKeys(ToSet($datetime_values))), ListSort(DictKeys(ToSet($interval_values)));
diff --git a/yql/essentials/tests/sql/suites/bigdate/compare_big_big.sql b/yql/essentials/tests/sql/suites/bigdate/compare_big_big.sql
new file mode 100644
index 0000000000..d160bcb31a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/compare_big_big.sql
@@ -0,0 +1,26 @@
+pragma warning("disable","4510");
+select
+ 3, Yql::Date32(AsAtom("0")) = Yql::Date32(AsAtom("1")),
+ 4, Yql::Datetime64(AsAtom("0")) = Yql::Datetime64(AsAtom("1")),
+ 5, Yql::Timestamp64(AsAtom("0")) = Yql::Timestamp64(AsAtom("1")),
+ 6, Yql::Interval64(AsAtom("0")) = Yql::Interval64(AsAtom("1")),
+ 7, Yql::Date32(AsAtom("0")) < Yql::Date32(AsAtom("1")),
+ 8, Yql::Datetime64(AsAtom("0")) < Yql::Datetime64(AsAtom("1")),
+ 9, Yql::Timestamp64(AsAtom("0")) < Yql::Timestamp64(AsAtom("1")),
+ 10, Yql::Interval64(AsAtom("0")) < Yql::Interval64(AsAtom("1")),
+ 11, Yql::Date32(AsAtom("0")) > Yql::Date32(AsAtom("1")),
+ 12, Yql::Datetime64(AsAtom("0")) > Yql::Datetime64(AsAtom("1")),
+ 13, Yql::Timestamp64(AsAtom("0")) > Yql::Timestamp64(AsAtom("1")),
+ 14, Yql::Interval64(AsAtom("0")) > Yql::Interval64(AsAtom("1")),
+ 15, Yql::Date32(AsAtom("0")) != Yql::Date32(AsAtom("1")),
+ 16, Yql::Datetime64(AsAtom("0")) != Yql::Datetime64(AsAtom("1")),
+ 17, Yql::Timestamp64(AsAtom("0")) != Yql::Timestamp64(AsAtom("1")),
+ 18, Yql::Interval64(AsAtom("0")) != Yql::Interval64(AsAtom("1")),
+ 19, Yql::Date32(AsAtom("0")) <= Yql::Date32(AsAtom("1")),
+ 20, Yql::Datetime64(AsAtom("0")) <= Yql::Datetime64(AsAtom("1")),
+ 21, Yql::Timestamp64(AsAtom("0")) <= Yql::Timestamp64(AsAtom("1")),
+ 22, Yql::Interval64(AsAtom("0")) <= Yql::Interval64(AsAtom("1")),
+ 23, Yql::Date32(AsAtom("0")) >= Yql::Date32(AsAtom("1")),
+ 24, Yql::Datetime64(AsAtom("0")) >= Yql::Datetime64(AsAtom("1")),
+ 25, Yql::Timestamp64(AsAtom("0")) >= Yql::Timestamp64(AsAtom("1")),
+ 26, Yql::Interval64(AsAtom("0")) >= Yql::Interval64(AsAtom("1")),
diff --git a/yql/essentials/tests/sql/suites/bigdate/compare_big_small.sql b/yql/essentials/tests/sql/suites/bigdate/compare_big_small.sql
new file mode 100644
index 0000000000..6f444bdec1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/compare_big_small.sql
@@ -0,0 +1,85 @@
+pragma warning("disable","4510");
+select
+ 3, Yql::Date32(AsAtom("1")) = Yql::Date(AsAtom("1")),
+ 4, Yql::Datetime64(AsAtom("86400")) = Yql::Date(AsAtom("1")),
+ 5, Yql::Timestamp64(AsAtom("86400000000")) = Yql::Date(AsAtom("1")),
+
+ 7, Yql::Date32(AsAtom("1")) = Yql::Datetime(AsAtom("86400")),
+ 8, Yql::Datetime64(AsAtom("86400")) = Yql::Datetime(AsAtom("86400")),
+ 9, Yql::Timestamp64(AsAtom("86400000000")) = Yql::Datetime(AsAtom("86400")),
+
+ 11, Yql::Date32(AsAtom("1")) = Yql::Timestamp(AsAtom("86400000000")),
+ 12, Yql::Datetime64(AsAtom("86400")) = Yql::Timestamp(AsAtom("86400000000")),
+ 13, Yql::Timestamp64(AsAtom("86400000000")) = Yql::Timestamp(AsAtom("86400000000")),
+
+ 15, Yql::Interval64(AsAtom("1")) = Yql::Interval(AsAtom("1")),
+
+ 17, Yql::Date32(AsAtom("1")) < Yql::Date(AsAtom("1")),
+ 18, Yql::Datetime64(AsAtom("86400")) < Yql::Date(AsAtom("1")),
+ 19, Yql::Timestamp64(AsAtom("86400000000")) < Yql::Date(AsAtom("1")),
+
+ 21, Yql::Date32(AsAtom("1")) < Yql::Datetime(AsAtom("86400")),
+ 22, Yql::Datetime64(AsAtom("86400")) < Yql::Datetime(AsAtom("86400")),
+ 23, Yql::Timestamp64(AsAtom("86400000000")) < Yql::Datetime(AsAtom("86400")),
+
+ 25, Yql::Date32(AsAtom("1")) < Yql::Timestamp(AsAtom("86400000000")),
+ 26, Yql::Datetime64(AsAtom("86400")) < Yql::Timestamp(AsAtom("86400000000")),
+ 27, Yql::Timestamp64(AsAtom("86400000000")) < Yql::Timestamp(AsAtom("86400000000")),
+
+ 29, Yql::Interval64(AsAtom("1")) < Yql::Interval(AsAtom("1")),
+
+ 31, Yql::Date32(AsAtom("1")) <= Yql::Date(AsAtom("1")),
+ 32, Yql::Datetime64(AsAtom("86400")) <= Yql::Date(AsAtom("1")),
+ 33, Yql::Timestamp64(AsAtom("86400000000")) <= Yql::Date(AsAtom("1")),
+
+ 35, Yql::Date32(AsAtom("1")) <= Yql::Datetime(AsAtom("86400")),
+ 36, Yql::Datetime64(AsAtom("86400")) <= Yql::Datetime(AsAtom("86400")),
+ 37, Yql::Timestamp64(AsAtom("86400000000")) <= Yql::Datetime(AsAtom("86400")),
+
+ 39, Yql::Date32(AsAtom("1")) <= Yql::Timestamp(AsAtom("86400000000")),
+ 40, Yql::Datetime64(AsAtom("86400")) <= Yql::Timestamp(AsAtom("86400000000")),
+ 41, Yql::Timestamp64(AsAtom("86400000000")) <= Yql::Timestamp(AsAtom("86400000000")),
+
+ 43, Yql::Interval64(AsAtom("1")) <= Yql::Interval(AsAtom("1")),
+
+ 45, Yql::Date32(AsAtom("1")) > Yql::Date(AsAtom("1")),
+ 46, Yql::Datetime64(AsAtom("86400")) > Yql::Date(AsAtom("1")),
+ 47, Yql::Timestamp64(AsAtom("86400000000")) > Yql::Date(AsAtom("1")),
+
+ 49, Yql::Date32(AsAtom("1")) > Yql::Datetime(AsAtom("86400")),
+ 50, Yql::Datetime64(AsAtom("86400")) > Yql::Datetime(AsAtom("86400")),
+ 51, Yql::Timestamp64(AsAtom("86400000000")) > Yql::Datetime(AsAtom("86400")),
+
+ 53, Yql::Date32(AsAtom("1")) > Yql::Timestamp(AsAtom("86400000000")),
+ 54, Yql::Datetime64(AsAtom("86400")) > Yql::Timestamp(AsAtom("86400000000")),
+ 55, Yql::Timestamp64(AsAtom("86400000000")) > Yql::Timestamp(AsAtom("86400000000")),
+
+ 57, Yql::Interval64(AsAtom("1")) > Yql::Interval(AsAtom("1")),
+
+ 59, Yql::Date32(AsAtom("1")) >= Yql::Date(AsAtom("1")),
+ 60, Yql::Datetime64(AsAtom("86400")) >= Yql::Date(AsAtom("1")),
+ 61, Yql::Timestamp64(AsAtom("86400000000")) >= Yql::Date(AsAtom("1")),
+
+ 63, Yql::Date32(AsAtom("1")) >= Yql::Datetime(AsAtom("86400")),
+ 64, Yql::Datetime64(AsAtom("86400")) >= Yql::Datetime(AsAtom("86400")),
+ 65, Yql::Timestamp64(AsAtom("86400000000")) >= Yql::Datetime(AsAtom("86400")),
+
+ 67, Yql::Date32(AsAtom("1")) >= Yql::Timestamp(AsAtom("86400000000")),
+ 68, Yql::Datetime64(AsAtom("86400")) >= Yql::Timestamp(AsAtom("86400000000")),
+ 69, Yql::Timestamp64(AsAtom("86400000000")) >= Yql::Timestamp(AsAtom("86400000000")),
+
+ 71, Yql::Interval64(AsAtom("1")) >= Yql::Interval(AsAtom("1")),
+
+ 73, Yql::Date32(AsAtom("1")) != Yql::Date(AsAtom("1")),
+ 74, Yql::Datetime64(AsAtom("86400")) != Yql::Date(AsAtom("1")),
+ 75, Yql::Timestamp64(AsAtom("86400000000")) != Yql::Date(AsAtom("1")),
+
+ 77, Yql::Date32(AsAtom("1")) != Yql::Datetime(AsAtom("86400")),
+ 78, Yql::Datetime64(AsAtom("86400")) != Yql::Datetime(AsAtom("86400")),
+ 79, Yql::Timestamp64(AsAtom("86400000000")) != Yql::Datetime(AsAtom("86400")),
+
+ 81, Yql::Date32(AsAtom("1")) != Yql::Timestamp(AsAtom("86400000000")),
+ 82, Yql::Datetime64(AsAtom("86400")) != Yql::Timestamp(AsAtom("86400000000")),
+ 83, Yql::Timestamp64(AsAtom("86400000000")) != Yql::Timestamp(AsAtom("86400000000")),
+
+ 85, Yql::Interval64(AsAtom("1")) != Yql::Interval(AsAtom("1"));
diff --git a/yql/essentials/tests/sql/suites/bigdate/compare_small_big.sql b/yql/essentials/tests/sql/suites/bigdate/compare_small_big.sql
new file mode 100644
index 0000000000..3e4834aba2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/compare_small_big.sql
@@ -0,0 +1,85 @@
+pragma warning("disable","4510");
+select
+ 3, Yql::Date(AsAtom("1")) = Yql::Date32(AsAtom("1")),
+ 4, Yql::Date(AsAtom("1")) = Yql::Datetime64(AsAtom("86400")),
+ 5, Yql::Date(AsAtom("1")) = Yql::Timestamp64(AsAtom("86400000000")),
+
+ 7, Yql::Datetime(AsAtom("86400")) = Yql::Date32(AsAtom("1")),
+ 8, Yql::Datetime(AsAtom("86400")) = Yql::Datetime64(AsAtom("86400")),
+ 9, Yql::Datetime(AsAtom("86400")) = Yql::Timestamp64(AsAtom("86400000000")),
+
+ 11, Yql::Timestamp(AsAtom("86400000000")) = Yql::Date32(AsAtom("1")),
+ 12, Yql::Timestamp(AsAtom("86400000000")) = Yql::Datetime64(AsAtom("86400")),
+ 13, Yql::Timestamp(AsAtom("86400000000")) = Yql::Timestamp64(AsAtom("86400000000")),
+
+ 15, Yql::Interval(AsAtom("1")) = Yql::Interval64(AsAtom("1")),
+
+ 17, Yql::Date(AsAtom("1")) < Yql::Date32(AsAtom("1")),
+ 18, Yql::Date(AsAtom("1")) < Yql::Datetime64(AsAtom("86400")),
+ 19, Yql::Date(AsAtom("1")) < Yql::Timestamp64(AsAtom("86400000000")),
+
+ 21, Yql::Datetime(AsAtom("86400")) < Yql::Date32(AsAtom("1")),
+ 22, Yql::Datetime(AsAtom("86400")) < Yql::Datetime64(AsAtom("86400")),
+ 23, Yql::Datetime(AsAtom("86400")) < Yql::Timestamp64(AsAtom("86400000000")),
+
+ 25, Yql::Timestamp(AsAtom("86400000000")) < Yql::Date32(AsAtom("1")),
+ 26, Yql::Timestamp(AsAtom("86400000000")) < Yql::Datetime64(AsAtom("86400")),
+ 27, Yql::Timestamp(AsAtom("86400000000")) < Yql::Timestamp64(AsAtom("86400000000")),
+
+ 29, Yql::Interval(AsAtom("1")) < Yql::Interval64(AsAtom("1")),
+
+ 31, Yql::Date(AsAtom("1")) <= Yql::Date32(AsAtom("1")),
+ 32, Yql::Date(AsAtom("1")) <= Yql::Datetime64(AsAtom("86400")),
+ 33, Yql::Date(AsAtom("1")) <= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 35, Yql::Datetime(AsAtom("86400")) <= Yql::Date32(AsAtom("1")),
+ 36, Yql::Datetime(AsAtom("86400")) <= Yql::Datetime64(AsAtom("86400")),
+ 37, Yql::Datetime(AsAtom("86400")) <= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 39, Yql::Timestamp(AsAtom("86400000000")) <= Yql::Date32(AsAtom("1")),
+ 40, Yql::Timestamp(AsAtom("86400000000")) <= Yql::Datetime64(AsAtom("86400")),
+ 41, Yql::Timestamp(AsAtom("86400000000")) <= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 43, Yql::Interval(AsAtom("1")) <= Yql::Interval64(AsAtom("1")),
+
+ 45, Yql::Date(AsAtom("1")) > Yql::Date32(AsAtom("1")),
+ 46, Yql::Date(AsAtom("1")) > Yql::Datetime64(AsAtom("86400")),
+ 47, Yql::Date(AsAtom("1")) > Yql::Timestamp64(AsAtom("86400000000")),
+
+ 49, Yql::Datetime(AsAtom("86400")) > Yql::Date32(AsAtom("1")),
+ 50, Yql::Datetime(AsAtom("86400")) > Yql::Datetime64(AsAtom("86400")),
+ 51, Yql::Datetime(AsAtom("86400")) > Yql::Timestamp64(AsAtom("86400000000")),
+
+ 53, Yql::Timestamp(AsAtom("86400000000")) > Yql::Date32(AsAtom("1")),
+ 54, Yql::Timestamp(AsAtom("86400000000")) > Yql::Datetime64(AsAtom("86400")),
+ 55, Yql::Timestamp(AsAtom("86400000000")) > Yql::Timestamp64(AsAtom("86400000000")),
+
+ 57, Yql::Interval(AsAtom("1")) > Yql::Interval64(AsAtom("1")),
+
+ 59, Yql::Date(AsAtom("1")) >= Yql::Date32(AsAtom("1")),
+ 60, Yql::Date(AsAtom("1")) >= Yql::Datetime64(AsAtom("86400")),
+ 61, Yql::Date(AsAtom("1")) >= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 63, Yql::Datetime(AsAtom("86400")) >= Yql::Date32(AsAtom("1")),
+ 64, Yql::Datetime(AsAtom("86400")) >= Yql::Datetime64(AsAtom("86400")),
+ 65, Yql::Datetime(AsAtom("86400")) >= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 67, Yql::Timestamp(AsAtom("86400000000")) >= Yql::Date32(AsAtom("1")),
+ 68, Yql::Timestamp(AsAtom("86400000000")) >= Yql::Datetime64(AsAtom("86400")),
+ 69, Yql::Timestamp(AsAtom("86400000000")) >= Yql::Timestamp64(AsAtom("86400000000")),
+
+ 71, Yql::Interval(AsAtom("1")) >= Yql::Interval64(AsAtom("1")),
+
+ 73, Yql::Date(AsAtom("1")) != Yql::Date32(AsAtom("1")),
+ 74, Yql::Date(AsAtom("1")) != Yql::Datetime64(AsAtom("86400")),
+ 75, Yql::Date(AsAtom("1")) != Yql::Timestamp64(AsAtom("86400000000")),
+
+ 77, Yql::Datetime(AsAtom("86400")) != Yql::Date32(AsAtom("1")),
+ 78, Yql::Datetime(AsAtom("86400")) != Yql::Datetime64(AsAtom("86400")),
+ 79, Yql::Datetime(AsAtom("86400")) != Yql::Timestamp64(AsAtom("86400000000")),
+
+ 81, Yql::Timestamp(AsAtom("86400000000")) != Yql::Date32(AsAtom("1")),
+ 82, Yql::Timestamp(AsAtom("86400000000")) != Yql::Datetime64(AsAtom("86400")),
+ 83, Yql::Timestamp(AsAtom("86400000000")) != Yql::Timestamp64(AsAtom("86400000000")),
+
+ 85, Yql::Interval(AsAtom("1")) != Yql::Interval64(AsAtom("1"));
diff --git a/yql/essentials/tests/sql/suites/bigdate/const_date32.sql b/yql/essentials/tests/sql/suites/bigdate/const_date32.sql
new file mode 100644
index 0000000000..8e31b97181
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/const_date32.sql
@@ -0,0 +1,10 @@
+select 1, date32("-144169-01-01"), cast(date32("-144169-01-01") as string);
+select 2, date32("-1-1-1"), cast(date32("-1-1-1") as string);
+select 3, date32("1-1-1"), cast(date32("1-1-1") as string);
+select 4, date32("1969-12-31"), cast(date32("1969-12-31") as string);
+select 5, date32("1970-01-01"), cast(date32("1970-01-01") as string);
+select 6, date32("2000-04-05"), cast(date32("2000-04-05") as string);
+select 7, date32("2100-03-01"), cast(date32("2100-03-01") as string);
+select 8, date32("2105-12-31"), cast(date32("2105-12-31") as string);
+select 9, date32("2106-01-01"), cast(date32("2106-01-01") as string);
+select 10, date32("148107-12-31"), cast(date32("148107-12-31") as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/const_datetime64.sql b/yql/essentials/tests/sql/suites/bigdate/const_datetime64.sql
new file mode 100644
index 0000000000..ee21673f5e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/const_datetime64.sql
@@ -0,0 +1,19 @@
+select datetime64("-144169-01-01T00:00:00-0:1"), cast(datetime64("-144169-01-01T00:00:00-0:1") as string);
+select datetime64("-144169-01-01T00:00:00Z"), cast(datetime64("-144169-01-01T00:00:00Z") as string);
+
+select datetime64("-1-1-1T00:00:00Z"), cast(datetime64("-1-1-1T00:00:00Z") as string);
+select datetime64("1-1-1T00:00:00Z"), cast(datetime64("1-1-1T00:00:00Z") as string);
+
+select datetime64("1969-12-31T23:59:59Z"), cast(datetime64("1969-12-31T23:59:59Z") as string);
+select datetime64("1969-12-31T23:59:59-0:1"), cast(datetime64("1969-12-31T23:59:59-0:1") as string);
+select datetime64("1970-01-01T00:00:00Z"), cast(datetime64("1970-01-01T00:00:00Z") as string);
+select datetime64("1970-1-1T0:0:1Z"), cast(datetime64("1970-1-1T0:0:1Z") as string);
+select datetime64("1970-01-01T00:00:00+0:1"), cast(datetime64("1970-01-01T00:00:00+0:1") as string);
+
+select datetime64("2000-04-05T00:00:00Z"), cast(datetime64("2000-04-05T00:00:00Z") as string);
+select datetime64("2100-03-01T00:00:00Z"), cast(datetime64("2100-03-01T00:00:00Z") as string);
+select datetime64("2105-12-31T00:00:00Z"), cast(datetime64("2105-12-31T00:00:00Z") as string);
+select datetime64("2106-01-01T00:00:00Z"), cast(datetime64("2106-01-01T00:00:00Z") as string);
+
+select datetime64("148107-12-31T23:59:59Z"), cast(datetime64("148107-12-31T23:59:59Z") as string);
+select datetime64("148107-12-31T23:59:59+0:1"), cast(datetime64("148107-12-31T23:59:59+0:1") as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/const_interval64.sql b/yql/essentials/tests/sql/suites/bigdate/const_interval64.sql
new file mode 100644
index 0000000000..517ee1317d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/const_interval64.sql
@@ -0,0 +1,35 @@
+select interval64("-P106751616DT23H59M59.999999S"), cast(interval64("-P106751616DT23H59M59.999999S") as string);
+select interval64("P106751616DT23H59M59.999999S"), cast(interval64("P106751616DT23H59M59.999999S") as string);
+select interval64("P106709244DT999999H999999M999999.999999S"), cast(interval64("P106709244DT999999H999999M999999.999999S") as string);
+select interval64("P000000000DT00H00M00.000000S"), cast(interval64("P000000000DT00H00M00.000000S") as string);
+
+select interval64("PT0S"), cast(interval64("PT0S") as string);
+select interval64("-PT0S"), cast(interval64("-PT0S") as string);
+select interval64("PT0.000001S"), cast(interval64("PT0.000001S") as string);
+select interval64("-PT0.000001S"), cast(interval64("-PT0.000001S") as string);
+
+select interval64("PT0S"), cast(interval64("PT0S") as string);
+select interval64("PT0M"), cast(interval64("PT0M") as string);
+select interval64("PT0H"), cast(interval64("PT0H") as string);
+select interval64("P0D"), cast(interval64("P0D") as string);
+select interval64("P0W"), cast(interval64("P0W") as string);
+
+select interval64("PT999999S"), cast(interval64("PT999999S") as string);
+select interval64("PT999999M"), cast(interval64("PT999999M") as string);
+select interval64("PT999999H"), cast(interval64("PT999999H") as string);
+
+select interval64("P106751616D"), cast(interval64("P106751616D") as string);
+select interval64("P15250230W"), cast(interval64("P15250230W") as string);
+
+select interval64("PT1S"), cast(interval64("PT1S") as string);
+select interval64("PT1M"), cast(interval64("PT1M") as string);
+select interval64("PT1H"), cast(interval64("PT1H") as string);
+select interval64("P1D"), cast(interval64("P1D") as string);
+select interval64("P1W"), cast(interval64("P1W") as string);
+
+select interval64("-PT1S"), cast(interval64("-PT1S") as string);
+select interval64("-PT1M"), cast(interval64("-PT1M") as string);
+select interval64("-PT1H"), cast(interval64("-PT1H") as string);
+select interval64("-P1D"), cast(interval64("-P1D") as string);
+select interval64("-P1W"), cast(interval64("-P1W") as string);
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/const_timestamp64.sql b/yql/essentials/tests/sql/suites/bigdate/const_timestamp64.sql
new file mode 100644
index 0000000000..919e19e196
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/const_timestamp64.sql
@@ -0,0 +1,39 @@
+--
+-- with microseconds
+--
+
+select timestamp64("-144169-01-01T00:00:00.000000-0:1"), cast(timestamp64("-144169-01-01T00:00:00.000000-0:1") as string);
+select timestamp64("-144169-01-01T00:00:00.000000Z"), cast(timestamp64("-144169-01-01T00:00:00.000000Z") as string);
+
+select timestamp64("1969-12-31T23:59:59.999999Z"), cast(timestamp64("1969-12-31T23:59:59.999999Z") as string);
+select timestamp64("1969-12-31T23:59:59.999999-0:1"), cast(timestamp64("1969-12-31T23:59:59.999999-0:1") as string);
+select timestamp64("1970-1-1T0:0:0.0Z"), cast(timestamp64("1970-1-1T0:0:0.0Z") as string);
+select timestamp64("1970-01-01T00:00:00.000001Z"), cast(timestamp64("1970-01-01T00:00:00.000001Z") as string);
+select timestamp64("1970-01-01T00:00:00.000001+0:1"), cast(timestamp64("1970-01-01T00:00:00.000001+0:1") as string);
+
+select timestamp64("148107-12-31T23:59:59.999999Z"), cast(timestamp64("148107-12-31T23:59:59.999999Z") as string);
+select timestamp64("148107-12-31T23:59:59.999999+0:1"), cast(timestamp64("148107-12-31T23:59:59.999999+0:1") as string);
+
+--
+-- without microseconds (like in datetime64)
+--
+
+select timestamp64("-144169-01-01T00:00:00-0:1"), cast(timestamp64("-144169-01-01T00:00:00-0:1") as string);
+select timestamp64("-144169-01-01T00:00:00Z"), cast(timestamp64("-144169-01-01T00:00:00Z") as string);
+
+select timestamp64("-1-1-1T00:00:00Z"), cast(timestamp64("-1-1-1T00:00:00Z") as string);
+select timestamp64("1-1-1T00:00:00Z"), cast(timestamp64("1-1-1T00:00:00Z") as string);
+
+select timestamp64("1969-12-31T00:00:00Z"), cast(timestamp64("1969-12-31T00:00:00Z") as string);
+select timestamp64("1969-12-31T23:59:59-0:1"), cast(timestamp64("1969-12-31T23:59:59-0:1") as string);
+select timestamp64("1970-01-01T00:00:00Z"), cast(timestamp64("1970-01-01T00:00:00Z") as string);
+select timestamp64("1970-01-01T00:00:00+0:1"), cast(timestamp64("1970-01-01T00:00:00+0:1") as string);
+
+select timestamp64("2000-04-05T00:00:00Z"), cast(timestamp64("2000-04-05T00:00:00Z") as string);
+select timestamp64("2100-03-01T00:00:00Z"), cast(timestamp64("2100-03-01T00:00:00Z") as string);
+select timestamp64("2105-12-31T00:00:00Z"), cast(timestamp64("2105-12-31T00:00:00Z") as string);
+select timestamp64("2106-01-01T00:00:00Z"), cast(timestamp64("2106-01-01T00:00:00Z") as string);
+
+select timestamp64("148107-12-31T23:59:59Z"), cast(timestamp64("148107-12-31T23:59:59Z") as string);
+select timestamp64("148107-12-31T23:59:59+0:1"), cast(timestamp64("148107-12-31T23:59:59+0:1") as string);
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/default.cfg b/yql/essentials/tests/sql/suites/bigdate/default.cfg
new file mode 100644
index 0000000000..fc68a75b1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/default.cfg
@@ -0,0 +1,5 @@
+in Signed Signed.txt
+in Unsigned Unsigned.txt
+in NarrowDates NarrowDates.txt
+in NarrowInterval NarrowInterval.txt
+in BigDates BigDates.txt
diff --git a/yql/essentials/tests/sql/suites/bigdate/explicit_cast.sql b/yql/essentials/tests/sql/suites/bigdate/explicit_cast.sql
new file mode 100644
index 0000000000..d57c9c20ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/explicit_cast.sql
@@ -0,0 +1,64 @@
+$date32_min = unwrap(cast(-53375809 as date32));
+$date32_max = unwrap(cast(53375807 as date32));
+
+$datetime64_min = unwrap(cast(-4611669897600 as datetime64));
+$datetime64_max = unwrap(cast(4611669811199 as datetime64));
+
+$timestamp64_min = unwrap(cast(-4611669897600000000 as timestamp64));
+$timestamp64_max = unwrap(cast(4611669811199999999 as timestamp64));
+
+$date32_minus1 = unwrap(cast(-1 as date32));
+$datetime64_minus1 = unwrap(cast(-1 as datetime64));
+$timestamp64_minus1 = unwrap(cast(-1 as timestamp64));
+
+-- scale up
+select 1, cast($date32_minus1 as datetime64), cast($date32_min as datetime64), cast($date32_max as datetime64)
+, 2, cast($date32_minus1 as timestamp64), cast($date32_min as timestamp64), cast($date32_max as timestamp64)
+, 3, cast($datetime64_minus1 as timestamp64), cast($datetime64_min as timestamp64), cast($datetime64_max as timestamp64);
+
+-- scale down
+select 1, cast($timestamp64_minus1 as datetime64), cast($timestamp64_min as datetime64), cast($timestamp64_max as datetime64)
+, 2, cast($timestamp64_minus1 as date32), cast($timestamp64_min as date32), cast($timestamp64_max as date32)
+, 3, cast($datetime64_minus1 as date32), cast($datetime64_min as date32), cast($datetime64_max as date32);
+
+$date_max_value = 49673l;
+$date_max = unwrap(cast($date_max_value - 1 as date));
+$datetime_max = unwrap(cast($date_max_value*86400 - 1 as datetime));
+$timestamp_max = unwrap(cast($date_max_value*86400*1000000 - 1 as timestamp));
+$interval_min = unwrap(cast(-$date_max_value*86400*1000000 + 1 as interval));
+$interval_max = unwrap(cast($date_max_value*86400*1000000 - 1 as interval));
+
+-- narrow to bigdate
+select 1, cast($date_max as date32), cast($date_max as datetime64), cast($date_max as timestamp64)
+, 2 , cast($datetime_max as date32), cast($datetime_max as datetime64), cast($datetime_max as timestamp64)
+, 3, cast($timestamp_max as date32), cast($timestamp_max as datetime64), cast($timestamp_max as timestamp64)
+, 4, cast($interval_min as interval64), cast($interval_max as interval64);
+
+$date32_val = unwrap(cast($date_max_value - 1 as date32));
+$datetime64_val = unwrap(cast($date_max_value*86400 - 1 as datetime64));
+$timestamp64_val = unwrap(cast($date_max_value*86400*1000000 - 1 as timestamp64));
+$interval64_val_min = unwrap(cast(-$date_max_value*86400*1000000 + 1 as interval64));
+$interval64_val_max = unwrap(cast($date_max_value*86400*1000000 - 1 as interval64));
+
+-- bigdate to narrow
+select 1, cast($date32_val as date), cast($date32_val as datetime), cast($date32_val as timestamp)
+, 2, cast($datetime64_val as date), cast($datetime64_val as datetime), cast($datetime64_val as timestamp)
+, 3, cast($timestamp64_val as date), cast($timestamp64_val as datetime), cast($timestamp64_val as timestamp)
+, 4, cast($interval64_val_min as interval), cast($interval64_val_max as interval);
+
+select 1, cast($date32_minus1 as date), cast($date32_minus1 as datetime), cast($date32_minus1 as timestamp)
+, 2, cast($datetime64_minus1 as date), cast($datetime64_minus1 as datetime), cast($datetime64_minus1 as timestamp)
+, 3, cast($timestamp64_minus1 as date), cast($timestamp64_minus1 as datetime), cast($timestamp64_minus1 as timestamp);
+
+-- bigdate to narrow out of range
+
+$date32_big_val = unwrap(cast($date_max_value as date32));
+$datetime64_big_val = unwrap(cast($date_max_value*86400 as datetime64));
+$timestamp64_big_val = unwrap(cast($date_max_value*86400*1000000 as timestamp64));
+$interval64_big_val_min = unwrap(cast(-$date_max_value*86400*1000000 as interval64));
+$interval64_big_val_max = unwrap(cast($date_max_value*86400*1000000 as interval64));
+
+select 1, cast($date32_big_val as date), cast($date32_big_val as datetime), cast($date32_big_val as timestamp)
+, 2, cast($datetime64_big_val as date), cast($datetime64_big_val as datetime), cast($datetime64_big_val as timestamp)
+, 3, cast($timestamp64_big_val as date), cast($timestamp64_big_val as datetime), cast($timestamp64_big_val as timestamp)
+, 4, cast($interval64_big_val_min as interval), cast($interval64_big_val_max as interval);
diff --git a/yql/essentials/tests/sql/suites/bigdate/implicit_cast_callable.sql b/yql/essentials/tests/sql/suites/bigdate/implicit_cast_callable.sql
new file mode 100644
index 0000000000..005e686135
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/implicit_cast_callable.sql
@@ -0,0 +1,43 @@
+/* postgres can not */
+use plato;
+
+$identity = ($x)-> { return $x };
+
+$idDate32 = Callable(Callable<(date32)->date32>, $identity);
+$idDatetime64 = Callable(Callable<(datetime64)->datetime64>, $identity);
+$idTimestamp64 = Callable(Callable<(timestamp64)->timestamp64>, $identity);
+$idInterval64 = Callable(Callable<(interval64)->interval64>, $identity);
+
+$valDate = unwrap(cast(1 as date));
+$valDate32 = unwrap(cast(-1 as date32));
+$valDatetime = unwrap(cast(86400 as datetime));
+$valDatetime64 = unwrap(cast(-86400 as datetime64));
+$valTimestamp = unwrap(cast(86400l*1000000 as timestamp));
+$valTimestamp64 = unwrap(cast(86400l*1000000 as timestamp64));
+$valInterval = unwrap(cast(1 as interval));
+$valInterval64 = unwrap(cast(-1 as interval64));
+
+select 1, $idDate32($valDate), $idDate32($valDate32)
+, 2, $idDatetime64($valDate), $idDatetime64($valDate32)
+, $idDatetime64($valDatetime), $idDatetime64($valDatetime64)
+, 3, $idTimestamp64($valDate), $idTimestamp64($valDate32)
+, $idTimestamp64($valDatetime), $idTimestamp64($valDatetime64)
+, $idTimestamp64($valTimestamp), $idTimestamp64($valTimestamp64)
+, 4, $idInterval64($valInterval), $idInterval64($valInterval64);
+
+select row
+, 1, $idTimestamp64(d32), $idDatetime64(d32), $idDate32(d32)
+, 2, $idTimestamp64(dt64), $idDatetime64(dt64)
+, 3, $idTimestamp64(ts64)
+, 4, $idInterval64(i64)
+from BigDates
+order by row;
+
+select row
+, 1, $idTimestamp64(d), $idDatetime64(d), $idDate32(d)
+, 2, $idTimestamp64(dt), $idDatetime64(dt)
+, 3, $idTimestamp64(ts)
+from NarrowDates
+order by row;
+
+select row, $idInterval64(i) from NarrowInterval order by row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/input_date32.sql b/yql/essentials/tests/sql/suites/bigdate/input_date32.sql
new file mode 100644
index 0000000000..44e7f22b24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/input_date32.sql
@@ -0,0 +1,15 @@
+select 1, cast("-144170-12-31" as date32), cast(cast("-144170-12-31" as date32) as string);
+select 2, cast("-144169-01-01" as date32), cast(cast("-144169-01-01" as date32) as string);
+select 3, cast("-1-1-1" as date32), cast(cast("-1-1-1" as date32) as string);
+select 4, cast("0-1-1" as date32), cast(cast("0-1-1" as date32) as string);
+select 5, cast("1-1-1" as date32), cast(cast("1-1-1" as date32) as string);
+select 6, cast("1-02-29" as date32), cast(cast("1-02-29" as date32) as string);
+select 7, cast("1969-12-31" as date32), cast(cast("1969-12-31" as date32) as string);
+select 8, cast("1970-01-01" as date32), cast(cast("1970-01-01" as date32) as string);
+select 9, cast("2000-04-05" as date32), cast(cast("2000-04-05" as date32) as string);
+select 10, cast("2100-02-29" as date32), cast(cast("2100-02-29" as date32) as string);
+select 11, cast("2100-03-01" as date32), cast(cast("2100-03-01" as date32) as string);
+select 12, cast("2105-12-31" as date32), cast(cast("2105-12-31" as date32) as string);
+select 13, cast("2106-01-01" as date32), cast(cast("2106-01-01" as date32) as string);
+select 14, cast("148107-12-31" as date32), cast(cast("148107-12-31" as date32) as string);
+select 15, cast("148108-01-01" as date32), cast(cast("148108-01-01" as date32) as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/input_datetime64.sql b/yql/essentials/tests/sql/suites/bigdate/input_datetime64.sql
new file mode 100644
index 0000000000..1d008ec167
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/input_datetime64.sql
@@ -0,0 +1,28 @@
+select cast("-144170-12-31T23:59:59Z" as timestamp64), cast(cast("-144170-12-31T23:59:59Z" as timestamp64) as string);
+select cast("-144170-12-31T23:59:59-0:1" as timestamp64), cast(cast("-144170-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00+0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00+0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00-0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00Z" as timestamp64), cast(cast("-144169-01-01T00:00:00Z" as timestamp64) as string);
+
+select cast("-1-1-1T00:00:00Z" as timestamp64), cast(cast("-1-1-1T00:00:00Z" as timestamp64) as string);
+select cast("0-1-1T00:00:00Z" as timestamp64), cast(cast("0-1-1T00:00:00Z" as timestamp64) as string);
+select cast("1-1-1T00:00:00Z" as timestamp64), cast(cast("1-1-1T00:00:00Z" as timestamp64) as string);
+select cast("1-02-29T00:00:00Z" as timestamp64), cast(cast("1-02-29T00:00:00Z" as timestamp64) as string);
+
+select cast("1969-12-31T00:00:00Z" as timestamp64), cast(cast("1969-12-31T00:00:00Z" as timestamp64) as string);
+select cast("1969-12-31T23:59:59-0:1" as timestamp64), cast(cast("1969-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("1970-01-01T00:00:00Z" as timestamp64), cast(cast("1970-01-01T00:00:00Z" as timestamp64) as string);
+select cast("1970-01-01T00:00:00+0:1" as timestamp64), cast(cast("1970-01-01T00:00:00+0:1" as timestamp64) as string);
+
+select cast("2000-04-05T00:00:00Z" as timestamp64), cast(cast("2000-04-05T00:00:00Z" as timestamp64) as string);
+select cast("2100-02-29T00:00:00Z" as timestamp64), cast(cast("2100-02-29T00:00:00Z" as timestamp64) as string);
+select cast("2100-03-01T00:00:00Z" as timestamp64), cast(cast("2100-03-01T00:00:00Z" as timestamp64) as string);
+select cast("2105-12-31T00:00:00Z" as timestamp64), cast(cast("2105-12-31T00:00:00Z" as timestamp64) as string);
+select cast("2106-01-01T00:00:00Z" as timestamp64), cast(cast("2106-01-01T00:00:00Z" as timestamp64) as string);
+
+select cast("148107-12-31T23:59:59Z" as timestamp64), cast(cast("148107-12-31T23:59:59Z" as timestamp64) as string);
+select cast("148107-12-31T23:59:59-0:1" as timestamp64), cast(cast("148107-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("148107-12-31T23:59:59+0:1" as timestamp64), cast(cast("148107-12-31T23:59:59+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00-0:1" as timestamp64), cast(cast("148108-01-01T00:00:00-0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00+0:1" as timestamp64), cast(cast("148108-01-01T00:00:00+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00Z" as timestamp64), cast(cast("148108-01-01T00:00:00Z" as timestamp64) as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/input_interval64.sql b/yql/essentials/tests/sql/suites/bigdate/input_interval64.sql
new file mode 100644
index 0000000000..47627b6003
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/input_interval64.sql
@@ -0,0 +1,45 @@
+select cast("-P106751616DT23H59M59.999999S" as interval64), cast(cast("-P106751616DT23H59M59.999999S" as interval64) as string);
+select cast("P106751616DT23H59M59.999999S" as interval64), cast(cast("P106751616DT23H59M59.999999S" as interval64) as string);
+
+select cast("-P106751616DT23H59M60S" as interval64), cast(cast("-P106751616DT23H59M60S" as interval64) as string);
+select cast("P106751616DT23H59M60S" as interval64), cast(cast("P106751616DT23H59M60S" as interval64) as string);
+
+select cast("P000000000DT00H00M00.000000S" as interval64), cast(cast("P000000000DT00H00M00.000000S" as interval64) as string);
+select cast("PT0S" as interval64), cast(cast("PT0S" as interval64) as string);
+select cast("-PT0S" as interval64), cast(cast("-PT0S" as interval64) as string);
+select cast("PT0.000001S" as interval64), cast(cast("PT0.000001S" as interval64) as string);
+select cast("-PT0.000001S" as interval64), cast(cast("-PT0.000001S" as interval64) as string);
+
+select cast("PT0S" as interval64), cast(cast("PT0S" as interval64) as string);
+select cast("PT0M" as interval64), cast(cast("PT0M" as interval64) as string);
+select cast("PT0H" as interval64), cast(cast("PT0H" as interval64) as string);
+select cast("P0D" as interval64), cast(cast("P0D" as interval64) as string);
+select cast("P0W" as interval64), cast(cast("P0W" as interval64) as string);
+
+select cast("PT999999S" as interval64), cast(cast("PT999999S" as interval64) as string);
+select cast("PT999999M" as interval64), cast(cast("PT999999M" as interval64) as string);
+select cast("PT999999H" as interval64), cast(cast("PT999999H" as interval64) as string);
+
+select cast("P106751616D" as interval64), cast(cast("P106751616D" as interval64) as string);
+select cast("P106751617D" as interval64), cast(cast("P106751617D" as interval64) as string);
+select cast("P15250230W" as interval64), cast(cast("P15250230W" as interval64) as string);
+select cast("P15250231W" as interval64), cast(cast("P15250231W" as interval64) as string);
+
+select cast("PT0000000S" as interval64), cast(cast("PT0000000S" as interval64) as string);
+select cast("PT0000000M" as interval64), cast(cast("PT0000000M" as interval64) as string);
+select cast("PT0000000H" as interval64), cast(cast("PT0000000H" as interval64) as string);
+select cast("P0000000000D" as interval64), cast(cast("P0000000000D" as interval64) as string);
+select cast("P0000000000W" as interval64), cast(cast("P0000000000W" as interval64) as string);
+
+select cast("PT1S" as interval64), cast(cast("PT1S" as interval64) as string);
+select cast("PT1M" as interval64), cast(cast("PT1M" as interval64) as string);
+select cast("PT1H" as interval64), cast(cast("PT1H" as interval64) as string);
+select cast("P1D" as interval64), cast(cast("P1D" as interval64) as string);
+select cast("P1W" as interval64), cast(cast("P1W" as interval64) as string);
+
+select cast("-PT1S" as interval64), cast(cast("-PT1S" as interval64) as string);
+select cast("-PT1M" as interval64), cast(cast("-PT1M" as interval64) as string);
+select cast("-PT1H" as interval64), cast(cast("-PT1H" as interval64) as string);
+select cast("-P1D" as interval64), cast(cast("-P1D" as interval64) as string);
+select cast("-P1W" as interval64), cast(cast("-P1W" as interval64) as string);
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/input_timestamp64.sql b/yql/essentials/tests/sql/suites/bigdate/input_timestamp64.sql
new file mode 100644
index 0000000000..f267080659
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/input_timestamp64.sql
@@ -0,0 +1,65 @@
+--
+-- with microseconds
+--
+
+select cast("-144170-12-31T23:59:59.999999Z" as timestamp64), cast(cast("-144170-12-31T23:59:59.999999Z" as timestamp64) as string);
+select cast("-144170-12-31T23:59:59.999999-0:1" as timestamp64), cast(cast("-144170-12-31T23:59:59.999999-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00.000001+0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00.000001+0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00.000001-0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00.000001-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00.000001Z" as timestamp64), cast(cast("-144169-01-01T00:00:00.000001Z" as timestamp64) as string);
+
+select cast("-1-1-1T00:00:00.000001Z" as timestamp64), cast(cast("-1-1-1T00:00:00.000001Z" as timestamp64) as string);
+select cast("0-1-1T00:00:00.000001Z" as timestamp64), cast(cast("0-1-1T00:00:00.000001Z" as timestamp64) as string);
+select cast("1-1-1T00:00:00.000001Z" as timestamp64), cast(cast("1-1-1T00:00:00.000001Z" as timestamp64) as string);
+select cast("1-02-29T00:00:00.000001Z" as timestamp64), cast(cast("1-02-29T00:00:00.000001Z" as timestamp64) as string);
+
+select cast("1969-12-31T00:00:00.000001Z" as timestamp64), cast(cast("1969-12-31T00:00:00.000001Z" as timestamp64) as string);
+select cast("1969-12-31T23:59:59.999999-0:1" as timestamp64), cast(cast("1969-12-31T23:59:59.999999-0:1" as timestamp64) as string);
+select cast("1970-01-01T00:00:00.000001Z" as timestamp64), cast(cast("1970-01-01T00:00:00.000001Z" as timestamp64) as string);
+select cast("1970-01-01T00:00:00.000001+0:1" as timestamp64), cast(cast("1970-01-01T00:00:00.000001+0:1" as timestamp64) as string);
+
+select cast("2000-04-05T00:00:00.000001Z" as timestamp64), cast(cast("2000-04-05T00:00:00.000001Z" as timestamp64) as string);
+select cast("2100-02-29T00:00:00.000001Z" as timestamp64), cast(cast("2100-02-29T00:00:00.000001Z" as timestamp64) as string);
+select cast("2100-03-01T00:00:00.000001Z" as timestamp64), cast(cast("2100-03-01T00:00:00.000001Z" as timestamp64) as string);
+select cast("2105-12-31T00:00:00.000001Z" as timestamp64), cast(cast("2105-12-31T00:00:00.000001Z" as timestamp64) as string);
+select cast("2106-01-01T00:00:00.000001Z" as timestamp64), cast(cast("2106-01-01T00:00:00.000001Z" as timestamp64) as string);
+
+select cast("148107-12-31T23:59:59.999999Z" as timestamp64), cast(cast("148107-12-31T23:59:59.999999Z" as timestamp64) as string);
+select cast("148107-12-31T23:59:59.999999-0:1" as timestamp64), cast(cast("148107-12-31T23:59:59.999999-0:1" as timestamp64) as string);
+select cast("148107-12-31T23:59:59.999999+0:1" as timestamp64), cast(cast("148107-12-31T23:59:59.999999+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00.000001-0:1" as timestamp64), cast(cast("148108-01-01T00:00:00.000001-0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00.000001+0:1" as timestamp64), cast(cast("148108-01-01T00:00:00.000001+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00.000001Z" as timestamp64), cast(cast("148108-01-01T00:00:00.000001Z" as timestamp64) as string);
+
+--
+-- without microseconds (like in timestamp64)
+--
+
+select cast("-144170-12-31T23:59:59Z" as timestamp64), cast(cast("-144170-12-31T23:59:59Z" as timestamp64) as string);
+select cast("-144170-12-31T23:59:59-0:1" as timestamp64), cast(cast("-144170-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00+0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00+0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00-0:1" as timestamp64), cast(cast("-144169-01-01T00:00:00-0:1" as timestamp64) as string);
+select cast("-144169-01-01T00:00:00Z" as timestamp64), cast(cast("-144169-01-01T00:00:00Z" as timestamp64) as string);
+
+select cast("-1-1-1T00:00:00Z" as timestamp64), cast(cast("-1-1-1T00:00:00Z" as timestamp64) as string);
+select cast("0-1-1T00:00:00Z" as timestamp64), cast(cast("0-1-1T00:00:00Z" as timestamp64) as string);
+select cast("1-1-1T00:00:00Z" as timestamp64), cast(cast("1-1-1T00:00:00Z" as timestamp64) as string);
+select cast("1-02-29T00:00:00Z" as timestamp64), cast(cast("1-02-29T00:00:00Z" as timestamp64) as string);
+
+select cast("1969-12-31T00:00:00Z" as timestamp64), cast(cast("1969-12-31T00:00:00Z" as timestamp64) as string);
+select cast("1969-12-31T23:59:59-0:1" as timestamp64), cast(cast("1969-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("1970-01-01T00:00:00Z" as timestamp64), cast(cast("1970-01-01T00:00:00Z" as timestamp64) as string);
+select cast("1970-01-01T00:00:00+0:1" as timestamp64), cast(cast("1970-01-01T00:00:00+0:1" as timestamp64) as string);
+
+select cast("2000-04-05T00:00:00Z" as timestamp64), cast(cast("2000-04-05T00:00:00Z" as timestamp64) as string);
+select cast("2100-02-29T00:00:00Z" as timestamp64), cast(cast("2100-02-29T00:00:00Z" as timestamp64) as string);
+select cast("2100-03-01T00:00:00Z" as timestamp64), cast(cast("2100-03-01T00:00:00Z" as timestamp64) as string);
+select cast("2105-12-31T00:00:00Z" as timestamp64), cast(cast("2105-12-31T00:00:00Z" as timestamp64) as string);
+select cast("2106-01-01T00:00:00Z" as timestamp64), cast(cast("2106-01-01T00:00:00Z" as timestamp64) as string);
+
+select cast("148107-12-31T23:59:59Z" as timestamp64), cast(cast("148107-12-31T23:59:59Z" as timestamp64) as string);
+select cast("148107-12-31T23:59:59-0:1" as timestamp64), cast(cast("148107-12-31T23:59:59-0:1" as timestamp64) as string);
+select cast("148107-12-31T23:59:59+0:1" as timestamp64), cast(cast("148107-12-31T23:59:59+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00-0:1" as timestamp64), cast(cast("148108-01-01T00:00:00-0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00+0:1" as timestamp64), cast(cast("148108-01-01T00:00:00+0:1" as timestamp64) as string);
+select cast("148108-01-01T00:00:00Z" as timestamp64), cast(cast("148108-01-01T00:00:00Z" as timestamp64) as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/int_cast.sql b/yql/essentials/tests/sql/suites/bigdate/int_cast.sql
new file mode 100644
index 0000000000..f2d796a961
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/int_cast.sql
@@ -0,0 +1,53 @@
+$date32_min = unwrap(cast(-53375809 as date32));
+$date32_max = unwrap(cast(53375807 as date32));
+
+$datetime64_min = unwrap(cast(-4611669897600 as datetime64));
+$datetime64_max = unwrap(cast(4611669811199 as datetime64));
+
+$timestamp64_min = unwrap(cast(-4611669897600000000 as timestamp64));
+$timestamp64_max = unwrap(cast(4611669811199999999 as timestamp64));
+
+$interval64_min = unwrap(cast(-9223339708799999999 as interval64));
+$interval64_max = unwrap(cast(9223339708799999999 as interval64));
+
+$date32_minus1 = unwrap(cast(-1 as date32));
+$datetime64_minus1 = unwrap(cast(-1 as datetime64));
+$timestamp64_minus1 = unwrap(cast(-1 as timestamp64));
+$interval64_minus1 = unwrap(cast(-1 as interval64));
+
+-- to signed
+select 1, $date32_minus1, cast($date32_minus1 as int8), cast($date32_minus1 as int16), cast($date32_minus1 as int32), cast($date32_minus1 as int64)
+, 2, $datetime64_minus1, cast($datetime64_minus1 as int8), cast($datetime64_minus1 as int16), cast($datetime64_minus1 as int32), cast($datetime64_minus1 as int64)
+, 3, $timestamp64_minus1, cast($timestamp64_minus1 as int8), cast($timestamp64_minus1 as int16), cast($timestamp64_minus1 as int32), cast($timestamp64_minus1 as int64)
+, 4, $interval64_minus1, cast($interval64_minus1 as int8), cast($interval64_minus1 as int16), cast($interval64_minus1 as int32), cast($interval64_minus1 as int64);
+
+-- to unsigned
+select 1, cast($date32_minus1 as uint32), cast($date32_minus1 as uint64)
+, 2, cast($datetime64_minus1 as uint32), cast($datetime64_minus1 as uint64)
+, 3, cast($timestamp64_minus1 as uint32), cast($timestamp64_minus1 as uint64)
+, 4, cast($interval64_minus1 as uint32), cast($interval64_minus1 as uint64);
+
+-- min/max values
+select 1, $date32_min, cast($date32_min as int32)
+, 2, $datetime64_min, cast($datetime64_min as int64)
+, 3, $timestamp64_min, cast($timestamp64_min as int64)
+, 4, $interval64_min, cast($interval64_min as int64)
+, 5, $date32_max, cast($date32_max as int32)
+, 6, $datetime64_max, cast($datetime64_max as int64)
+, 7, $timestamp64_max, cast($timestamp64_max as int64)
+, 8, $interval64_max, cast($interval64_max as int64);
+
+-- out of range
+select 1, cast(-53375810 as date32), cast(53375808 as date32)
+, 2, cast(-4611669897601 as datetime64), cast(4611669811200 as datetime64)
+, 3, cast(-4611669897600000001 as timestamp64), cast(4611669811200000000 as timestamp64)
+, 4, cast(-9223339708800000000 as interval64), cast(9223339708800000000 as interval64);
+
+-- insufficient int size
+select 1, cast(unwrap(cast(32768 as date32)) as int16), cast(unwrap(cast(65536 as date32)) as uint16)
+, 2, cast(unwrap(cast(32768 as datetime64)) as int16), cast(unwrap(cast(2147483648 as datetime64)) as int32)
+, 3, cast(unwrap(cast(65536 as datetime64)) as uint16), cast(unwrap(cast(4294967296 as datetime64)) as uint32)
+, 4, cast(unwrap(cast(32768 as timestamp64)) as int16), cast(unwrap(cast(2147483648 as timestamp64)) as int32)
+, 5, cast(unwrap(cast(65536 as timestamp64)) as uint16), cast(unwrap(cast(4294967296 as timestamp64)) as uint32)
+, 6, cast(unwrap(cast(32768 as interval64)) as int16), cast(unwrap(cast(2147483648 as interval64)) as int32)
+, 7, cast(unwrap(cast(65536 as interval64)) as uint16), cast(unwrap(cast(4294967296 as interval64)) as uint32);
diff --git a/yql/essentials/tests/sql/suites/bigdate/int_literals.sql b/yql/essentials/tests/sql/suites/bigdate/int_literals.sql
new file mode 100644
index 0000000000..9b3c2edfc3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/int_literals.sql
@@ -0,0 +1,14 @@
+pragma warning("disable","4510");
+select
+ 3, Yql::Date32(AsAtom("0")),
+ 4, Yql::Datetime64(AsAtom("0")),
+ 5, Yql::Timestamp64(AsAtom("0")),
+ 6, Yql::Interval64(AsAtom("0")),
+ 7, Yql::Date32(AsAtom("-53375809")),
+ 8, Yql::Date32(AsAtom("53375807")),
+ 9, Yql::Datetime64(AsAtom("-4611669897600")),
+ 10, Yql::Datetime64(AsAtom("4611669811199")),
+ 11, Yql::Timestamp64(AsAtom("-4611669897600000000")),
+ 12, Yql::Timestamp64(AsAtom("4611669811199999999")),
+ 13, Yql::Interval64(AsAtom("-9223339708799999999")),
+ 14, Yql::Interval64(AsAtom("9223339708799999999"));
diff --git a/yql/essentials/tests/sql/suites/bigdate/misc.sql b/yql/essentials/tests/sql/suites/bigdate/misc.sql
new file mode 100644
index 0000000000..510a8dc6d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/misc.sql
@@ -0,0 +1,27 @@
+pragma warning("disable","4510");
+
+$date32_min = unwrap(cast(-53375809 as date32));
+$date32_max = unwrap(cast(53375807 as date32));
+$datetime64_min = unwrap(cast(-4611669897600 as datetime64));
+$datetime64_max = unwrap(cast(4611669811199 as datetime64));
+$timestamp64_min = unwrap(cast(-4611669897600000000 as timestamp64));
+$timestamp64_max = unwrap(cast(4611669811199999999 as timestamp64));
+$interval64_min = unwrap(cast(-9223339708799999999 as interval64));
+$interval64_max = unwrap(cast(9223339708799999999 as interval64));
+
+select 1, ListFromRange(date32("1969-12-30"), date32("1970-1-5"))
+, 2, ListFromRange(date32("1970-1-3"), date32("1969-12-30"))
+, 3, ListFromRange(date32("1969-12-30"), date32("1970-1-5"), interval("P2D"))
+, 4, ListFromRange(date32("1969-12-30"), date32("1970-1-5"), interval64("P2D"))
+, 5, ListFromRange(date32("1970-1-5"), date32("1969-12-30"))
+, 6, ListFromRange(date32("1970-1-5"), date32("1969-12-30"), interval("P2D"))
+, 7, ListFromRange(date32("1970-1-5"), date32("1969-12-29"), interval("-P2D"))
+, 8, ListFromRange(datetime64("1969-12-31T23:59:57Z"), datetime64("1970-1-1T0:0:3Z"))
+, 9, ListFromRange(datetime64("1969-12-31T23:59:57Z"), datetime64("1970-1-1T0:0:3Z"), interval("PT2S"))
+, 10, ListFromRange(datetime64("1969-12-31T23:59:57Z"), datetime64("1970-1-1T0:0:3Z"), interval64("PT2S"))
+, 11, ListFromRange(timestamp64("1969-12-31T23:59:57Z"), timestamp64("1970-1-1T0:0:3Z"), interval("PT2.5S"))
+, 12, ListFromRange($date32_min, $date32_max, interval64("P53375808D"))
+, 13, ListFromRange($datetime64_min, $datetime64_max, interval64("P53375808D"))
+, 14, ListFromRange($timestamp64_min, $timestamp64_max, interval64("P53375808D"))
+, 15, ListFromRange($interval64_min, $interval64_max, interval64("P53375808D"))
+;
diff --git a/yql/essentials/tests/sql/suites/bigdate/output_date32.sql b/yql/essentials/tests/sql/suites/bigdate/output_date32.sql
new file mode 100644
index 0000000000..2de16e8bb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/output_date32.sql
@@ -0,0 +1,10 @@
+select cast(cast(-53375810 as date32) as string)
+, 2, cast(cast(-53375809 as date32) as string)
+, 3, cast(cast(-1 as date32) as string)
+, 4, cast(cast(0 as date32) as string)
+, 5, cast(cast(1 as date32) as string)
+, 6, cast(cast(18000u as date32) as string)
+, 7, cast(cast(49673u - 1u as date32) as string)
+, 8, cast(cast(49673u as date32) as string)
+, 9, cast(cast(53375807ul as date32) as string)
+, 10, cast(cast(53375808ul as date32) as string);
diff --git a/yql/essentials/tests/sql/suites/bigdate/output_datetime64.sql b/yql/essentials/tests/sql/suites/bigdate/output_datetime64.sql
new file mode 100644
index 0000000000..449906ad81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/output_datetime64.sql
@@ -0,0 +1,13 @@
+select cast(cast(-4611669897601 as datetime64) as string)
+, cast(cast(-4611669897600 as datetime64) as string)
+, cast(cast(-86401 as datetime64) as string)
+, cast(cast(-86400 as datetime64) as string)
+, cast(cast(-86399 as datetime64) as string)
+, cast(cast(-1 as datetime64) as string)
+, cast(cast(0 as datetime64) as string)
+, cast(cast(1 as datetime64) as string)
+, cast(cast(86399 as datetime64) as string)
+, cast(cast(86400 as datetime64) as string)
+, cast(cast(86401 as datetime64) as string)
+, cast(cast(4611669811199 as datetime64) as string)
+, cast(cast(4611669811200 as datetime64) as string) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/bigdate/output_interval64.sql b/yql/essentials/tests/sql/suites/bigdate/output_interval64.sql
new file mode 100644
index 0000000000..c64be2ef58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/output_interval64.sql
@@ -0,0 +1,11 @@
+select cast(cast(-9223339708800000000 as interval64) as string)
+, cast(cast(-9223339708799999999 as interval64) as string)
+, cast(cast(-1 as interval64) as string)
+, cast(cast(0 as interval64) as string)
+, cast(cast(1 as interval64) as string)
+, cast(cast(1000000 as interval64) as string)
+, cast(cast(60000000 as interval64) as string)
+, cast(cast(3600000000 as interval64) as string)
+, cast(cast(86400000000 as interval64) as string)
+, cast(cast(9223339708799999999 as interval64) as string)
+, cast(cast(9223339708800000000 as interval64) as string); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/bigdate/output_timestamp64.sql b/yql/essentials/tests/sql/suites/bigdate/output_timestamp64.sql
new file mode 100644
index 0000000000..d710e3976b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/output_timestamp64.sql
@@ -0,0 +1,13 @@
+select cast(cast(-4611669897601 as timestamp64) as string)
+, cast(cast(-4611669897600 as timestamp64) as string)
+, cast(cast(-86401 as timestamp64) as string)
+, cast(cast(-86400 as timestamp64) as string)
+, cast(cast(-86399 as timestamp64) as string)
+, cast(cast(-1 as timestamp64) as string)
+, cast(cast(0 as timestamp64) as string)
+, cast(cast(1 as timestamp64) as string)
+, cast(cast(86399 as timestamp64) as string)
+, cast(cast(86400 as timestamp64) as string)
+, cast(cast(86401 as timestamp64) as string)
+, cast(cast(4611669811199 as timestamp64) as string)
+, cast(cast(4611669811200 as timestamp64) as string) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/bigdate/presort.sql b/yql/essentials/tests/sql/suites/bigdate/presort.sql
new file mode 100644
index 0000000000..f0277dcf1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/presort.sql
@@ -0,0 +1,25 @@
+pragma warning("disable","4510");
+$wa1 = Date32("1900-01-01");
+$wd1 = Datetime64("1900-01-01T02:03:04Z");
+$wt1 = Timestamp64("1900-01-01T02:03:04.567891Z");
+
+$waz1 = TzDate32("1900-01-01,Europe/Moscow");
+$wdz1 = TzDatetime64("1900-01-01T02:03:04,Europe/Moscow");
+$wtz1 = TzTimestamp64("1900-01-01T02:03:04.567891,Europe/Moscow");
+
+$wa2 = Date32("1901-01-01");
+$wd2 = Datetime64("1901-01-01T02:03:04Z");
+$wt2 = Timestamp64("1901-01-01T02:03:04.567891Z");
+
+$waz2 = TzDate32("1901-01-01,Europe/Moscow");
+$wdz2 = TzDatetime64("1901-01-01T02:03:04,Europe/Moscow");
+$wtz2 = TzTimestamp64("1901-01-01T02:03:04.567891,Europe/Moscow");
+
+select
+cast(ListSortDesc([(Yql::Ascending($wa1),$wa1),(Yql::Ascending($wa2),$wa2)]) as List<Tuple<String,String>>),
+cast(ListSortDesc([(Yql::Ascending($wd1),$wd1),(Yql::Ascending($wd2),$wd2)]) as List<Tuple<String,String>>),
+cast(ListSortDesc([(Yql::Ascending($wt1),$wt1),(Yql::Ascending($wt2),$wt2)]) as List<Tuple<String,String>>),
+cast(ListSortDesc([(Yql::Ascending($waz1),$waz1),(Yql::Ascending($waz2),$waz2)]) as List<Tuple<String,String>>),
+cast(ListSortDesc([(Yql::Ascending($wdz1),$wdz1),(Yql::Ascending($wdz2),$wdz2)]) as List<Tuple<String,String>>),
+cast(ListSortDesc([(Yql::Ascending($wtz1),$wtz1),(Yql::Ascending($wtz2),$wtz2)]) as List<Tuple<String,String>>);
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/round.sql b/yql/essentials/tests/sql/suites/bigdate/round.sql
new file mode 100644
index 0000000000..9e2830cc8b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/round.sql
@@ -0,0 +1,136 @@
+pragma warning("disable","4510");
+
+$date_max_value = 49673l;
+$date_max = unwrap(cast($date_max_value - 1 as date));
+$datetime_max = unwrap(cast($date_max_value*86400 - 1 as datetime));
+$timestamp_max = unwrap(cast($date_max_value*86400*1000000 - 1 as timestamp));
+
+$date32_min = unwrap(cast(-53375809 as date32));
+$date32_max = unwrap(cast(53375807 as date32));
+$date32_plus1 = unwrap(cast(1 as date32));
+$datetime64_min = unwrap(cast(-4611669897600 as datetime64));
+$datetime64_max = unwrap(cast(4611669811199 as datetime64));
+$timestamp64_min = unwrap(cast(-4611669897600000000 as timestamp64));
+$timestamp64_max = unwrap(cast(4611669811199999999 as timestamp64));
+
+$timestamp64_max_narrow = unwrap(cast($timestamp_max as timestamp64));
+$datetime64_max_narrow = unwrap(cast($datetime_max as datetime64));
+
+$datetime64_zero = unwrap(cast(0 as datetime64));
+$timestamp64_zero = unwrap(cast(0 as timestamp64));
+$datetime64_minus1 = unwrap(cast(-1 as datetime64));
+$timestamp64_minus1 = unwrap(cast(-1 as timestamp64));
+$timestamp64_2xx31 = unwrap(cast(2147483648 as timestamp64));
+
+$datetime64_day_ml = unwrap(cast(-86401 as datetime64));
+$datetime64_day_m = unwrap(cast(-86400 as datetime64));
+$datetime64_day_mr = unwrap(cast(-86399 as datetime64));
+$datetime64_day_pl = unwrap(cast(86399 as datetime64));
+$datetime64_day_p = unwrap(cast(86400 as datetime64));
+$datetime64_day_pr = unwrap(cast(86401 as datetime64));
+
+$timestamp64_day_ml = unwrap(cast(-86400l*1000000 - 1 as timestamp64));
+$timestamp64_day_m = unwrap(cast(-86400l*1000000 as timestamp64));
+$timestamp64_day_mr = unwrap(cast(-86400l*1000000 + 1 as timestamp64));
+$timestamp64_day_pl = unwrap(cast(86400l*1000000 - 1 as timestamp64));
+$timestamp64_day_p = unwrap(cast(86400l*1000000 as timestamp64));
+$timestamp64_day_pr = unwrap(cast(86400l*1000000 + 1 as timestamp64));
+
+-- bigdate to bigdate
+select -4, Yql::RoundDown($datetime64_min, date32), Yql::RoundUp($datetime64_min, date32)
+, Yql::RoundDown($timestamp64_min, date32), Yql::RoundUp($timestamp64_min, date32)
+, Yql::RoundDown($timestamp64_min, datetime64), Yql::RoundUp($timestamp64_min, datetime64)
+
+, -3, Yql::RoundDown($datetime64_day_ml, date32), Yql::RoundUp($datetime64_day_ml, date32)
+, Yql::RoundDown($timestamp64_day_ml, date32), Yql::RoundUp($timestamp64_day_ml, date32)
+, Yql::RoundDown($timestamp64_day_ml, datetime64), Yql::RoundUp($timestamp64_day_ml, datetime64)
+
+, -2, Yql::RoundDown($datetime64_day_m, date32), Yql::RoundUp($datetime64_day_m, date32)
+, Yql::RoundDown($timestamp64_day_m, date32), Yql::RoundUp($timestamp64_day_m, date32)
+, Yql::RoundDown($timestamp64_day_m, datetime64), Yql::RoundUp($timestamp64_day_m, datetime64)
+
+, -1, Yql::RoundDown($datetime64_day_mr, date32), Yql::RoundUp($datetime64_day_mr, date32)
+, Yql::RoundDown($timestamp64_day_mr, date32), Yql::RoundUp($timestamp64_day_mr, date32)
+, Yql::RoundDown($timestamp64_day_mr, datetime64), Yql::RoundUp($timestamp64_day_mr, datetime64)
+
+, 0, Yql::RoundDown($datetime64_zero, date32), Yql::RoundUp($datetime64_zero, date32)
+, Yql::RoundDown($timestamp64_zero, date32), Yql::RoundUp($timestamp64_zero, date32)
+, Yql::RoundDown($timestamp64_zero, datetime64), Yql::RoundUp($timestamp64_zero, datetime64)
+
+, 1, Yql::RoundDown($datetime64_day_pl, date32), Yql::RoundUp($datetime64_day_pl, date32)
+, Yql::RoundDown($timestamp64_day_pl, date32), Yql::RoundUp($timestamp64_day_pl, date32)
+, Yql::RoundDown($timestamp64_day_pl, datetime64), Yql::RoundUp($timestamp64_day_pl, datetime64)
+
+, 2, Yql::RoundDown($datetime64_day_p, date32), Yql::RoundUp($datetime64_day_p, date32)
+, Yql::RoundDown($timestamp64_day_p, date32), Yql::RoundUp($timestamp64_day_p, date32)
+, Yql::RoundDown($timestamp64_day_p, datetime64), Yql::RoundUp($timestamp64_day_p, datetime64)
+
+, 3, Yql::RoundDown($datetime64_day_pr, date32), Yql::RoundUp($datetime64_day_pr, date32)
+, Yql::RoundDown($timestamp64_day_pr, date32), Yql::RoundUp($timestamp64_day_pr, date32)
+, Yql::RoundDown($timestamp64_day_pr, datetime64), Yql::RoundUp($timestamp64_day_pr, datetime64)
+
+, 4, Yql::RoundDown($datetime64_max, date32), Yql::RoundUp($datetime64_max, date32)
+, Yql::RoundDown($timestamp64_max, date32), Yql::RoundUp($timestamp64_max, date32)
+, Yql::RoundDown($timestamp64_max, datetime64), Yql::RoundUp($timestamp64_max, datetime64)
+;
+
+-- bigdate to narrowdate
+select -1, Yql::RoundDown($datetime64_minus1, date), Yql::RoundUp($datetime64_minus1, date)
+, Yql::RoundDown($timestamp64_minus1, date), Yql::RoundUp($timestamp64_minus1, date)
+, Yql::RoundDown($timestamp64_minus1, datetime), Yql::RoundUp($timestamp64_minus1, datetime)
+
+, 0, Yql::RoundDown($datetime64_zero, date), Yql::RoundUp($datetime64_zero, date)
+, Yql::RoundDown($timestamp64_zero, date), Yql::RoundUp($timestamp64_zero, date)
+, Yql::RoundDown($timestamp64_zero, datetime), Yql::RoundUp($timestamp64_zero, datetime)
+
+, 1, Yql::RoundDown($datetime64_day_pl, date), Yql::RoundUp($datetime64_day_pl, date)
+, Yql::RoundDown($timestamp64_day_pl, date), Yql::RoundUp($timestamp64_day_pl, date)
+, Yql::RoundDown($timestamp64_day_pl, datetime), Yql::RoundUp($timestamp64_day_pl, datetime)
+
+, 2, Yql::RoundDown($datetime64_day_p, date), Yql::RoundUp($datetime64_day_p, date)
+, Yql::RoundDown($timestamp64_day_p, date), Yql::RoundUp($timestamp64_day_p, date)
+, Yql::RoundDown($timestamp64_day_p, datetime), Yql::RoundUp($timestamp64_day_p, datetime)
+
+, 3, Yql::RoundDown($datetime64_day_pr, date), Yql::RoundUp($datetime64_day_pr, date)
+, Yql::RoundDown($timestamp64_day_pr, date), Yql::RoundUp($timestamp64_day_pr, date)
+, Yql::RoundDown($timestamp64_day_pr, datetime), Yql::RoundUp($timestamp64_day_pr, datetime)
+
+, 4, Yql::RoundDown($datetime64_max_narrow, date), Yql::RoundUp($datetime64_max_narrow, date)
+, Yql::RoundDown($timestamp64_max_narrow, date), Yql::RoundUp($timestamp64_max_narrow, date)
+, Yql::RoundDown($timestamp64_max_narrow, datetime), Yql::RoundUp($timestamp64_max_narrow, datetime)
+
+, 5, Yql::RoundDown($datetime64_max, date), Yql::RoundUp($datetime64_max, date)
+, Yql::RoundDown($timestamp64_max, date), Yql::RoundUp($timestamp64_max, date)
+, Yql::RoundDown($timestamp64_max, datetime), Yql::RoundUp($timestamp64_max, datetime)
+
+, 6, Yql::RoundDown($date32_plus1, date), Yql::RoundUp($date32_plus1, date)
+, Yql::RoundDown($date32_plus1, datetime), Yql::RoundUp($date32_plus1, datetime)
+, Yql::RoundDown($date32_plus1, timestamp), Yql::RoundUp($date32_plus1, timestamp)
+;
+
+-- from narrowdate
+select 0, Yql::RoundDown($datetime_max, date), Yql::RoundUp($datetime_max, date)
+, Yql::RoundDown($datetime_max, date32), Yql::RoundUp($datetime_max, date32)
+, 1, Yql::RoundDown($timestamp_max, date), Yql::RoundUp($timestamp_max, date)
+, Yql::RoundDown($timestamp_max, date32), Yql::RoundUp($timestamp_max, date32)
+, 2, Yql::RoundDown($timestamp_max, datetime), Yql::RoundUp($timestamp_max, datetime)
+, Yql::RoundDown($timestamp_max, datetime64), Yql::RoundUp($timestamp_max, datetime64)
+;
+
+select 0, Yql::RoundDown($timestamp64_2xx31, date32), Yql::RoundUp($timestamp64_2xx31, date32)
+, Yql::RoundDown($timestamp64_2xx31, datetime64), Yql::RoundUp($timestamp64_2xx31, datetime64)
+
+, 1, Yql::RoundDown($date_max, date), Yql::RoundUp($date_max, date32)
+, 2, Yql::RoundDown($date_max, datetime), Yql::RoundUp($date_max, datetime64)
+, 3, Yql::RoundDown($date_max, timestamp), Yql::RoundUp($date_max, timestamp64)
+, 4, Yql::RoundDown($datetime_max, datetime), Yql::RoundUp($datetime_max, datetime64)
+, 5, Yql::RoundDown($datetime_max, timestamp), Yql::RoundUp($datetime_max, timestamp64)
+, 6, Yql::RoundDown($timestamp_max, timestamp), Yql::RoundUp($timestamp_max, timestamp64)
+
+, 10, Yql::RoundDown($date32_min, date32), Yql::RoundUp($date32_max, date32)
+, 11, Yql::RoundDown($date32_min, datetime64), Yql::RoundUp($date32_max, datetime64)
+, 12, Yql::RoundDown($date32_min, timestamp64), Yql::RoundUp($date32_max, timestamp64)
+, 13, Yql::RoundDown($datetime64_min, datetime64), Yql::RoundUp($datetime64_max, datetime64)
+, 14, Yql::RoundDown($datetime64_min, timestamp64), Yql::RoundUp($datetime64_max, timestamp64)
+, 15, Yql::RoundDown($timestamp64_min, timestamp64), Yql::RoundUp($timestamp64_max, timestamp64)
+;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_arithmetic.sql b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic.sql
new file mode 100644
index 0000000000..9fb30acf44
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+use plato;
+
+select row, -i64, +i64, abs(i64)
+from BigDates
+order by row;
+
+select min(d32), min(dt64), min(ts64), min(i64)
+, max(d32), max(dt64), max(ts64), max(i64)
+from BigDates;
+
+select l.row, r.row
+, 1, l.d32 - r.i64, l.dt64 - r.i64, l.ts64 - r.i64, l.i64 - r.i64
+, 2, l.d32 + r.i64, l.dt64 + r.i64, l.ts64 + r.i64, l.i64 + r.i64
+from BigDates as l cross join BigDates as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_mul_div.sql b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_mul_div.sql
new file mode 100644
index 0000000000..1674243a00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_mul_div.sql
@@ -0,0 +1,35 @@
+/* postgres can not */
+use plato;
+
+select l.row, r.row
+, 1, l.i64*i8, l.i64*i16, l.i64*i32, l.i64*r.i64
+, 2, i8*l.i64, i16*l.i64, i32*l.i64, r.i64*l.i64
+, 3, l.i64/i8, l.i64/i16, l.i64/i32, l.i64/r.i64
+from BigDates as l cross join Signed as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
+select l.row, r.row
+, 1, i64*ui8, i64*ui16, i64*ui32, i64*ui64
+, 2, ui8*i64, ui16*i64, ui32*i64, ui64*i64
+, 3, i64/ui8, i64/ui16, i64/ui32, i64/ui64
+from BigDates as l cross join Unsigned as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
+select l.row, r.row
+, 1, l.i*i8, l.i*i16, l.i*i32, l.i*r.i64
+, 2, i8*l.i, i16*l.i, i32*l.i, r.i64*l.i
+, 3, l.i/i8, l.i/i16, l.i/i32, l.i/r.i64
+from NarrowInterval as l cross join Signed as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
+select l.row, r.row
+, 1, i*ui8, i*ui16, i*ui32, i*ui64
+, 2, ui8*i, ui16*i, ui32*i, ui64*i
+, 3, i/ui8, i/ui16, i/ui32, i/ui64
+from NarrowInterval as l cross join Unsigned as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_narrow.sql b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_narrow.sql
new file mode 100644
index 0000000000..7e86c038fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_narrow.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+use plato;
+
+select l.row, r.row
+, 1, l.d32 - r.d, l.d32 - r.dt, l.d32 - r.ts
+, 2, l.dt64 - r.d, l.dt64 - r.dt, l.dt64 - r.ts
+, 3, l.ts64 - r.d, l.ts64 - r.dt, l.ts64 - r.ts
+from BigDates as l cross join NarrowDates as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
+select l.row, r.row
+, 1, l.d - r.d32, l.d - r.dt64, l.d - r.ts64, l.d - r.i64, l.d + r.i64
+, 2, l.dt - r.d32, l.dt - r.dt64, l.dt - r.ts64, l.dt - r.i64, l.dt + r.i64
+, 3, l.ts - r.d32, l.ts - r.dt64, l.ts - r.ts64, l.ts - r.i64, l.ts + r.i64
+from NarrowDates as l cross join BigDates as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
+
+select l.row, r.row
+, 1, l.d32 - r.i, l.dt64 - r.i, l.ts64 - r.i, l.i64 - r.i
+, 2, l.d32 + r.i, l.dt64 + r.i, l.ts64 + r.i, l.i64 + r.i
+from BigDates as l cross join NarrowInterval as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_sub.sql b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_sub.sql
new file mode 100644
index 0000000000..18c040d8b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_arithmetic_sub.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+select l.row, r.row
+, 1, l.d32 - r.d32, l.d32 - r.dt64, l.d32 - r.ts64
+, 2, l.dt64 - r.d32, l.dt64 - r.dt64, l.dt64 - r.ts64
+, 3, l.ts64 - r.d32, l.ts64 - r.dt64, l.ts64 - r.ts64
+from BigDates as l cross join BigDates as r
+where abs(l.row) <= 7 and abs(r.row) <= 7
+order by l.row, r.row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_common_type.sql b/yql/essentials/tests/sql/suites/bigdate/table_common_type.sql
new file mode 100644
index 0000000000..f059db2f0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_common_type.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+use plato;
+
+select bd.row as row
+, 1, [d, dt]
+, [d, ts]
+, [d, d32]
+, [d, dt64]
+, [d, ts64]
+, 2, [dt, ts]
+, [dt, d32]
+, [dt, dt64]
+, [dt, ts64]
+, 3, [ts, d32]
+, [ts, dt64]
+, [ts, ts64]
+, 4, [d32, dt64]
+, [d32, ts64]
+, 5, [dt64, ts64]
+from BigDates as bd
+join NarrowDates using (row)
+order by row;
+
+select bd.row as row, [i, i64]
+from BigDates as bd
+join NarrowInterval using (row)
+order by row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_explicit_cast.sql b/yql/essentials/tests/sql/suites/bigdate/table_explicit_cast.sql
new file mode 100644
index 0000000000..263d90fbd2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_explicit_cast.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+use plato;
+
+select row, cast(i as interval64) from NarrowInterval order by row;
+
+select row
+, 1, cast(d as date), cast(d as datetime), cast(d as timestamp)
+, 2, cast(dt as date), cast(dt as datetime), cast(dt as timestamp)
+, 3, cast(ts as date), cast(ts as datetime), cast(ts as timestamp)
+from NarrowDates order by row;
+
+select row
+, 1, cast(d as date32), cast(d as datetime64), cast(d as timestamp64)
+, 2, cast(dt as date32), cast(dt as datetime64), cast(dt as timestamp64)
+, 3, cast(ts as date32), cast(ts as datetime64), cast(ts as timestamp64)
+from NarrowDates order by row;
+
+select row
+, 1, cast(d32 as date), cast(d32 as datetime), cast(d32 as timestamp)
+, 2, cast(dt64 as date), cast(dt64 as datetime), cast(dt64 as timestamp)
+, 3, cast(ts64 as date), cast(ts64 as datetime), cast(ts64 as timestamp)
+, 4, cast(i64 as interval)
+from BigDates order by row;
+
+select row
+, 1, cast(d32 as datetime64), cast(d32 as timestamp64)
+, 2, cast(dt64 as date32), cast(dt64 as timestamp64)
+, 3, cast(ts64 as date32), cast(ts64 as datetime64)
+from BigDates order by row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_int_cast.sql b/yql/essentials/tests/sql/suites/bigdate/table_int_cast.sql
new file mode 100644
index 0000000000..a6b772f62e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_int_cast.sql
@@ -0,0 +1,34 @@
+/* postgres can not */
+use plato;
+
+select row
+, 1, cast(i8 as date32), cast(i8 as datetime64), cast(i8 as timestamp64), cast(i8 as interval64)
+, 2, cast(i16 as date32), cast(i16 as datetime64), cast(i16 as timestamp64), cast(i16 as interval64)
+, 3, cast(i32 as date32), cast(i32 as datetime64), cast(i32 as timestamp64), cast(i32 as interval64)
+, 4, cast(i64 as date32), cast(i64 as datetime64), cast(i64 as timestamp64), cast(i64 as interval64)
+from Signed
+order by row;
+
+select row
+, 1, cast(d32 as int8), cast(d32 as int16), cast(d32 as int32), cast(d32 as int64)
+, 2, cast(dt64 as int8), cast(dt64 as int16), cast(dt64 as int32), cast(dt64 as int64)
+, 3, cast(ts64 as int8), cast(ts64 as int16), cast(ts64 as int32), cast(ts64 as int64)
+, 4, cast(i64 as int8), cast(i64 as int16), cast(i64 as int32), cast(i64 as int64)
+from BigDates
+order by row;
+
+select row
+, 1, cast(d32 as uint8), cast(d32 as uint16), cast(d32 as uint32), cast(d32 as uint64)
+, 2, cast(dt64 as uint8), cast(dt64 as uint16), cast(dt64 as uint32), cast(dt64 as uint64)
+, 3, cast(ts64 as uint8), cast(ts64 as uint16), cast(ts64 as uint32), cast(ts64 as uint64)
+, 4, cast(i64 as uint8), cast(i64 as uint16), cast(i64 as uint32), cast(i64 as uint64)
+from BigDates
+order by row;
+
+select row
+, 1, cast(ui8 as date32), cast(ui8 as datetime64), cast(ui8 as timestamp64), cast(ui8 as interval64)
+, 2, cast(ui16 as date32), cast(ui16 as datetime64), cast(ui16 as timestamp64), cast(ui16 as interval64)
+, 3, cast(ui32 as date32), cast(ui32 as datetime64), cast(ui32 as timestamp64), cast(ui32 as interval64)
+, 4, cast(ui64 as date32), cast(ui64 as datetime64), cast(ui64 as timestamp64), cast(ui64 as interval64)
+from Unsigned
+order by row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_io.sql b/yql/essentials/tests/sql/suites/bigdate/table_io.sql
new file mode 100644
index 0000000000..b3a3f2cd65
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_io.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+use plato;
+
+select * from BigDates order by row;
+
+insert into @Output with truncate
+select * from BigDates
+where row > -100
+order by row;
+
+commit;
+
+select * from @Output order by row;
+
+select row, cast(d32 as string), cast(dt64 as string), cast(ts64 as string), cast(i64 as string)
+from BigDates
+order by row;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-default.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-default.cfg
new file mode 100644
index 0000000000..9256d900c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-default.cfg
@@ -0,0 +1,6 @@
+out OutDate32 OutDate32.txt
+out OutDatetime64 OutDatetime64.txt
+out OutTimestamp64 OutTimestamp64.txt
+providers yt
+canonize_yt
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-on.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-on.cfg
new file mode 100644
index 0000000000..be9c9911e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-on.cfg
@@ -0,0 +1,7 @@
+out OutDate32 OutDate32.txt
+out OutDatetime64 OutDatetime64.txt
+out OutTimestamp64 OutTimestamp64.txt
+providers yt
+canonize_yt
+pragma yt.UseNativeYtTypes;
+pragma yt.NativeYtTypeCompatibility = "date;bigdate";
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-wo_compat.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-wo_compat.cfg
new file mode 100644
index 0000000000..0f936de55c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter-wo_compat.cfg
@@ -0,0 +1,8 @@
+out OutDate32 OutDate32.txt
+out OutDatetime64 OutDatetime64.txt
+out OutTimestamp64 OutTimestamp64.txt
+providers yt
+canonize_yt
+pragma yt.UseNativeYtTypes;
+pragma yt.NativeYtTypeCompatibility = "void";
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter.sql b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter.sql
new file mode 100644
index 0000000000..87a1364cb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_key_filter.sql
@@ -0,0 +1,110 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+pragma yt.UseNewPredicateExtraction;
+
+insert into OutDate32
+select * from as_table(AsList(
+ <|key:Date32('-144169-1-1')|>,
+ <|key:Date32('148107-12-31')|>))
+order by key;
+
+insert into OutDatetime64
+select * from as_table(AsList(
+ <|key:Datetime64('-144169-1-1T0:0:0Z')|>,
+ <|key:Datetime64('148107-12-31T23:59:59Z')|>))
+order by key;
+
+insert into OutTimestamp64
+select * from as_table(AsList(
+ <|key:Timestamp64('-144169-1-1T0:0:0Z')|>,
+ <|key:Timestamp64('148107-12-31T23:59:59.999999Z')|>))
+order by key;
+
+commit;
+
+select * from OutDate32
+where key > Date('1970-1-1')
+and key > Datetime('1970-1-1T0:0:0Z')
+and key > Timestamp('1970-1-1T0:0:0Z')
+and key > Date32('-144169-1-1')
+and key > Datetime64('-144169-1-1T0:0:0Z')
+and key > Timestamp64('-144169-1-1T0:0:0Z')
+and key >= Date('2105-12-31')
+and key >= Datetime('2105-12-31T23:59:59Z')
+and key >= Timestamp('2105-12-31T23:59:59Z')
+and key >= Date32('148107-12-31')
+and key >= Datetime64('148107-12-31T0:0:0Z')
+and key >= Timestamp64('148107-12-31T0:0:0Z')
+;
+select * from OutDate32
+where key < Date('2105-12-31')
+and key < Datetime('2105-12-31T23:59:59Z')
+and key < Timestamp('2105-12-31T23:59:59.999999Z')
+and key < Date32('148107-12-31')
+and key < Datetime64('148107-12-31T23:59:59Z')
+and key < Timestamp64('148107-12-31T23:59:59.999999Z')
+and key <= Date('1970-1-1')
+and key <= Datetime('1970-1-1T0:0:0Z')
+and key <= Timestamp('1970-1-1T0:0:0Z')
+and key <= Date32('-144169-1-1')
+and key <= Datetime64('-144169-1-1T0:0:0Z')
+and key <= Timestamp64('-144169-1-1T0:0:0Z')
+;
+select * from OutDatetime64
+where key > Date('1970-1-1')
+and key > Datetime('1970-1-1T0:0:0Z')
+and key > Timestamp('1970-1-1T0:0:0Z')
+and key > Date32('-144169-1-1')
+and key > Datetime64('-144169-1-1T0:0:0Z')
+and key > Timestamp64('-144169-1-1T0:0:0Z')
+and key >= Date('2105-12-31')
+and key >= Datetime('2105-12-31T23:59:59Z')
+and key >= Timestamp('2105-12-31T23:59:59Z')
+and key >= Date32('148107-12-31')
+and key >= Datetime64('148107-12-31T0:0:0Z')
+and key >= Timestamp64('148107-12-31T0:0:0Z')
+;
+select * from OutDatetime64
+where key < Date('2105-12-31')
+and key < Datetime('2105-12-31T23:59:59Z')
+and key < Timestamp('2105-12-31T23:59:59.999999Z')
+and key < Date32('148107-12-31')
+and key < Datetime64('148107-12-31T23:59:59Z')
+and key < Timestamp64('148107-12-31T23:59:59.999999Z')
+and key <= Date('1970-1-1')
+and key <= Datetime('1970-1-1T0:0:0Z')
+and key <= Timestamp('1970-1-1T0:0:0Z')
+and key <= Date32('-144169-1-1')
+and key <= Datetime64('-144169-1-1T0:0:0Z')
+and key <= Timestamp64('-144169-1-1T0:0:0Z')
+;
+select * from OutTimestamp64
+where key > Date('1970-1-1')
+and key > Datetime('1970-1-1T0:0:0Z')
+and key > Timestamp('1970-1-1T0:0:0Z')
+and key > Date32('-144169-1-1')
+and key > Datetime64('-144169-1-1T0:0:0Z')
+and key > Timestamp64('-144169-1-1T0:0:0Z')
+and key >= Date('2105-12-31')
+and key >= Datetime('2105-12-31T23:59:59Z')
+and key >= Timestamp('2105-12-31T23:59:59Z')
+and key >= Date32('148107-12-31')
+and key >= Datetime64('148107-12-31T0:0:0Z')
+and key >= Timestamp64('148107-12-31T0:0:0Z')
+;
+select * from OutTimestamp64
+where key < Date('2105-12-31')
+and key < Datetime('2105-12-31T23:59:59Z')
+and key < Timestamp('2105-12-31T23:59:59.999999Z')
+and key < Date32('148107-12-31')
+and key < Datetime64('148107-12-31T23:59:59Z')
+and key < Timestamp64('148107-12-31T23:59:59.999999Z')
+and key <= Date('1970-1-1')
+and key <= Datetime('1970-1-1T0:0:0Z')
+and key <= Timestamp('1970-1-1T0:0:0Z')
+and key <= Date32('-144169-1-1')
+and key <= Datetime64('-144169-1-1T0:0:0Z')
+and key <= Timestamp64('-144169-1-1T0:0:0Z')
+;
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_native-default.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-default.cfg
new file mode 100644
index 0000000000..cd64dfec4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-default.cfg
@@ -0,0 +1,3 @@
+out Output output.txt
+providers yt
+canonize_yt
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_native-on.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-on.cfg
new file mode 100644
index 0000000000..6486efd742
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-on.cfg
@@ -0,0 +1,5 @@
+out Output output.txt
+providers yt
+canonize_yt
+pragma yt.UseNativeYtTypes;
+pragma yt.NativeYtTypeCompatibility = "bigdate";
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_native-wo_compat.cfg b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-wo_compat.cfg
new file mode 100644
index 0000000000..c5e08d7e27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_native-wo_compat.cfg
@@ -0,0 +1,5 @@
+out Output output.txt
+providers yt
+canonize_yt
+pragma yt.UseNativeYtTypes;
+pragma yt.NativeYtTypeCompatibility = "date";
diff --git a/yql/essentials/tests/sql/suites/bigdate/table_yt_native.sql b/yql/essentials/tests/sql/suites/bigdate/table_yt_native.sql
new file mode 100644
index 0000000000..3d7d636051
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/table_yt_native.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into @tmpTable
+select date32('1969-12-31') as d32, datetime64('1969-12-31T0:0:0Z') as dt64, timestamp64('1969-12-31T0:0:0Z') as ts64, interval64('P65536D') as i64;
+
+commit;
+
+insert into Output
+select * from @tmpTable where d32 < date32('1970-1-1');
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz.txt b/yql/essentials/tests/sql/suites/bigdate/tz.txt
new file mode 100644
index 0000000000..8be05f77ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz.txt
@@ -0,0 +1 @@
+{"waz"="\x7f\xff\x9c\x20\x00\x01";"wdz"="\x7f\xff\xff\xff\x7c\x55\x7b\x1f\x00\x01";"wtz"="\x7f\xf8\x26\xef\x55\xf6\x70\x13\x00\x01"};
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz.txt.attr b/yql/essentials/tests/sql/suites/bigdate/tz.txt.attr
new file mode 100644
index 0000000000..0d613e597e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["waz";["DataType";"TzDate32"]];
+ ["wdz";["DataType";"TzDatetime64"]];
+ ["wtz";["DataType";"TzTimestamp64"]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_bytes.sql b/yql/essentials/tests/sql/suites/bigdate/tz_bytes.sql
new file mode 100644
index 0000000000..3a79dfdd2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_bytes.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+select ToBytes(TzDate32("1901-01-01,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzDate32("1901-01-01,Europe/Moscow")),TzDate32) as string);
+
+select ToBytes(TzDatetime64("1901-01-01T01:02:03,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzDatetime64("1901-01-01T01:02:03,Europe/Moscow")),TzDatetime64) as string);
+
+select ToBytes(TzTimestamp64("1901-01-01T01:02:03.456789,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzTimestamp64("1901-01-01T01:02:03.456789,Europe/Moscow")),TzTimestamp64) as string);
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.cfg b/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.cfg
new file mode 100644
index 0000000000..879bab94a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.cfg
@@ -0,0 +1,2 @@
+out Output output.txt
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.sql b/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.sql
new file mode 100644
index 0000000000..f97466cd0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_fill.sql
@@ -0,0 +1,12 @@
+use plato;
+
+$waz = TzDate32("1900-01-01,Europe/Moscow");
+$wdz = TzDatetime64("1900-01-01T02:03:04,Europe/Moscow");
+$wtz = TzTimestamp64("1900-01-01T02:03:04.567891,Europe/Moscow");
+
+insert into Output
+select
+ $waz as waz,
+ $wdz as wdz,
+ $wtz as wtz,
+ ($waz, $wdz, $waz) as tup;
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.cfg b/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.cfg
new file mode 100644
index 0000000000..9fc18af3ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.cfg
@@ -0,0 +1,2 @@
+in Input tz.txt
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.sql b/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.sql
new file mode 100644
index 0000000000..334892b938
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_pull.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ waz,wdz,wtz
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.cfg b/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.cfg
new file mode 100644
index 0000000000..9793ce0c22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.cfg
@@ -0,0 +1,2 @@
+in Input tz.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.sql b/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.sql
new file mode 100644
index 0000000000..ca11765fc8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_rw.sql
@@ -0,0 +1,6 @@
+use plato;
+
+insert into Output
+select (waz,wdz,wtz),waz,wdz,wtz from Input;
+
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.cfg b/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.cfg
new file mode 100644
index 0000000000..a51be0aec2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.cfg
@@ -0,0 +1,5 @@
+out OutTzDate32 OutTzDate32.txt
+out OutTzDatetime64 OutTzDatetime64.txt
+out OutTzTimestamp64 OutTzTimestamp64.txt
+providers yt
+canonize_yt
diff --git a/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.sql b/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.sql
new file mode 100644
index 0000000000..7f96c9b32b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tz_table_yt_key_filter.sql
@@ -0,0 +1,62 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+pragma yt.UseNewPredicateExtraction;
+
+insert into OutTzDate32
+select * from as_table(AsList(
+ <|key:TzDate32('-144169-1-1,UTC')|>,
+ <|key:TzDate32('148107-12-31,UTC')|>))
+order by key;
+
+insert into OutTzDatetime64
+select * from as_table(AsList(
+ <|key:TzDatetime64('-144169-1-1T0:0:0,UTC')|>,
+ <|key:TzDatetime64('148107-12-31T23:59:59,UTC')|>))
+order by key;
+
+insert into OutTzTimestamp64
+select * from as_table(AsList(
+ <|key:TzTimestamp64('-144169-1-1T0:0:0,UTC')|>,
+ <|key:TzTimestamp64('148107-12-31T23:59:59.999999,UTC')|>))
+order by key;
+
+commit;
+
+select * from OutTzDate32
+where key > TzDate32('-144169-1-1,UTC')
+and key > TzDatetime64('-144169-1-1T0:0:0,UTC')
+and key > TzTimestamp64('-144169-1-1T0:0:0,UTC')
+and key >= TzDate32('148107-12-31,UTC')
+and key >= TzDatetime64('148107-12-31T0:0:0,UTC')
+and key >= TzTimestamp64('148107-12-31T0:0:0,UTC')
+;
+select * from OutTzDate32
+where key < TzDate32('148107-12-31,UTC')
+and key < TzDatetime64('148107-12-31T23:59:59,UTC')
+and key < TzTimestamp64('148107-12-31T23:59:59.999999,UTC')
+and key <= TzDate32('-144169-1-1,UTC')
+and key <= TzDatetime64('-144169-1-1T0:0:0,UTC')
+and key <= TzTimestamp64('-144169-1-1T0:0:0,UTC')
+;
+select * from OutTzDatetime64
+where key > TzDatetime64('-144169-1-1T0:0:0,UTC')
+and key > TzTimestamp64('-144169-1-1T0:0:0,UTC')
+and key >= TzDatetime64('148107-12-31T0:0:0,UTC')
+and key >= TzTimestamp64('148107-12-31T0:0:0,UTC')
+;
+select * from OutTzDatetime64
+where key < TzDatetime64('148107-12-31T23:59:59,UTC')
+and key < TzTimestamp64('148107-12-31T23:59:59.999999,UTC')
+and key <= TzDatetime64('-144169-1-1T0:0:0,UTC')
+and key <= TzTimestamp64('-144169-1-1T0:0:0,UTC')
+;
+select * from OutTzTimestamp64
+where key > TzTimestamp64('-144169-1-1T0:0:0,UTC')
+and key >= TzTimestamp64('148107-12-31T0:0:0,UTC')
+;
+select * from OutTzTimestamp64
+where key < TzTimestamp64('148107-12-31T23:59:59.999999,UTC')
+and key <= TzTimestamp64('-144169-1-1T0:0:0,UTC')
+;
diff --git a/yql/essentials/tests/sql/suites/bigdate/tzcasts.sql b/yql/essentials/tests/sql/suites/bigdate/tzcasts.sql
new file mode 100644
index 0000000000..8a5516b435
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tzcasts.sql
@@ -0,0 +1,18 @@
+select
+ cast(TzDate32("1900-01-01,Europe/Moscow") as String),
+ cast("1900-01-01,Europe/Moscow" as TzDate32),
+ cast(TzDatetime64("1900-01-01T01:02:03,Europe/Moscow") as String),
+ cast("1900-01-01T01:02:03,Europe/Moscow" as TzDatetime64),
+ cast(TzTimestamp64("1900-01-01T01:02:03.456789,Europe/Moscow") as String),
+ cast("1900-01-01T01:02:03.456789,Europe/Moscow" as TzTimestamp64),
+
+ AddTimezone(Date32("1900-01-01"),"Europe/Moscow"),
+ AddTimezone(Datetime64("1900-01-01T01:02:03Z"),"Europe/Moscow"),
+ AddTimezone(Timestamp64("1900-01-01T01:02:03.456789Z"),"Europe/Moscow"),
+
+ cast(RemoveTimezone(TzDate32("1900-01-02,Europe/Moscow")) as String),
+ cast(RemoveTimezone(TzDatetime64("1900-01-01T03:32:20,Europe/Moscow")) as String),
+ cast(RemoveTimezone(TzTimestamp64("1900-01-01T03:32:20.456789,Europe/Moscow")) as String);
+
+
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tznumliterals.sql b/yql/essentials/tests/sql/suites/bigdate/tznumliterals.sql
new file mode 100644
index 0000000000..d62c3d6c61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tznumliterals.sql
@@ -0,0 +1,51 @@
+pragma warning("disable","4510");
+
+select
+cast(Yql::Date32(AsAtom('-53375809')) as string),
+Yql::TzDate32(AsAtom('-53375809,UTC')),
+Yql::TzDate32(AsAtom('-53375809,Europe/Moscow')),
+Yql::TzDate32(AsAtom('-53375809,America/Los_Angeles')),
+cast(Yql::Date32(AsAtom('53375807')) as string),
+Yql::TzDate32(AsAtom('53375807,UTC')),
+Yql::TzDate32(AsAtom('53375807,Europe/Moscow')),
+Yql::TzDate32(AsAtom('53375807,America/Los_Angeles')),
+cast(Yql::Date32(AsAtom('-719162')) as string),
+Yql::TzDate32(AsAtom('-719162,UTC')),
+Yql::TzDate32(AsAtom('-719162,Europe/Moscow')),
+cast(Yql::Date32(AsAtom('-719163')) as string),
+Yql::TzDate32(AsAtom('-719163,UTC')),
+Yql::TzDate32(AsAtom('-719163,Europe/Moscow'));
+
+select
+cast(Yql::Datetime64(AsAtom('-4611669897600')) as string),
+Yql::TzDatetime64(AsAtom('-4611669897600,UTC')),
+Yql::TzDatetime64(AsAtom('-4611669897600,Europe/Moscow')),
+Yql::TzDatetime64(AsAtom('-4611669897600,America/Los_Angeles')),
+cast(Yql::Datetime64(AsAtom('4611669811199')) as string),
+Yql::TzDatetime64(AsAtom('4611669811199,UTC')),
+Yql::TzDatetime64(AsAtom('4611669811199,Europe/Moscow')),
+Yql::TzDatetime64(AsAtom('4611669811199,America/Los_Angeles')),
+cast(Yql::Datetime64(AsAtom('-62135596800')) as string),
+Yql::TzDatetime64(AsAtom('-62135596800,UTC')),
+Yql::TzDatetime64(AsAtom('-62135596800,Europe/Moscow')),
+cast(Yql::Datetime64(AsAtom('-62135596801')) as string),
+Yql::TzDatetime64(AsAtom('-62135596801,UTC')),
+Yql::TzDatetime64(AsAtom('-62135596801,Europe/Moscow'));
+
+
+select
+cast(Yql::Timestamp64(AsAtom('-4611669897600000000')) as string),
+Yql::TzTimestamp64(AsAtom('-4611669897600000000,UTC')),
+Yql::TzTimestamp64(AsAtom('-4611669897600000000,Europe/Moscow')),
+Yql::TzTimestamp64(AsAtom('-4611669897600000000,America/Los_Angeles')),
+cast(Yql::Timestamp64(AsAtom('4611669811199999999')) as string),
+Yql::TzTimestamp64(AsAtom('4611669811199999999,UTC')),
+Yql::TzTimestamp64(AsAtom('4611669811199999999,Europe/Moscow')),
+Yql::TzTimestamp64(AsAtom('4611669811199999999,America/Los_Angeles')),
+cast(Yql::Timestamp64(AsAtom('-62135596800000000')) as string),
+Yql::TzTimestamp64(AsAtom('-62135596800000000,UTC')),
+Yql::TzTimestamp64(AsAtom('-62135596800000000,Europe/Moscow')),
+cast(Yql::Timestamp64(AsAtom('-62135596800000001')) as string),
+Yql::TzTimestamp64(AsAtom('-62135596800000001,UTC')),
+Yql::TzTimestamp64(AsAtom('-62135596800000001,Europe/Moscow'));
+
diff --git a/yql/essentials/tests/sql/suites/bigdate/tzstrliterals.sql b/yql/essentials/tests/sql/suites/bigdate/tzstrliterals.sql
new file mode 100644
index 0000000000..72b2433075
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bigdate/tzstrliterals.sql
@@ -0,0 +1,48 @@
+select
+ cast(Date32("-144169-01-01") as string),
+ TzDate32("-144169-01-01,UTC"),
+ TzDate32("-144169-01-02,Europe/Moscow"),
+ TzDate32("-144169-01-01,America/Los_Angeles"),
+ cast(Date32("148107-12-31") as string),
+ TzDate32("148107-12-31,UTC"),
+ TzDate32("148108-01-01,Europe/Moscow"),
+ TzDate32("148107-12-31,America/Los_Angeles"),
+ cast(Date32("1-01-01") as string),
+ TzDate32("1-01-01,UTC"),
+ TzDate32("1-01-02,Europe/Moscow"),
+ cast(Date32("-1-12-31") as string),
+ TzDate32("-1-12-31,UTC"),
+ TzDate32("1-01-01,Europe/Moscow");
+
+select
+ cast(Datetime64("-144169-01-01T00:00:00Z") as string),
+ TzDatetime64("-144169-01-01T00:00:00,UTC"),
+ TzDatetime64("-144169-01-01T02:30:17,Europe/Moscow"),
+ TzDatetime64("-144170-12-31T16:07:02,America/Los_Angeles"),
+ cast(Datetime64("148107-12-31T23:59:59Z") as string),
+ TzDatetime64("148107-12-31T23:59:59,UTC"),
+ TzDatetime64("148108-01-01T02:59:59,Europe/Moscow"),
+ TzDatetime64("148107-12-31T15:59:59,America/Los_Angeles"),
+ cast(Datetime64("1-01-01T00:00:00Z") as string),
+ TzDatetime64("1-01-01T00:00:00,UTC"),
+ TzDatetime64("1-01-01T02:30:17,Europe/Moscow"),
+ cast(Datetime64("-1-12-31T23:59:59Z") as string),
+ TzDatetime64("-1-12-31T23:59:59,UTC"),
+ TzDatetime64("1-01-01T02:30:16,Europe/Moscow");
+
+select
+ cast(Timestamp64("-144169-01-01T00:00:00Z") as string),
+ TzTimestamp64("-144169-01-01T00:00:00,UTC"),
+ TzTimestamp64("-144169-01-01T02:30:17,Europe/Moscow"),
+ TzTimestamp64("-144170-12-31T16:07:02,America/Los_Angeles"),
+ cast(Timestamp64("148107-12-31T23:59:59.999999Z") as string),
+ TzTimestamp64("148107-12-31T23:59:59.999999,UTC"),
+ TzTimestamp64("148108-01-01T02:59:59.999999,Europe/Moscow"),
+ TzTimestamp64("148107-12-31T15:59:59.999999,America/Los_Angeles"),
+ cast(Timestamp64("1-01-01T00:00:00Z") as string),
+ TzTimestamp64("1-01-01T00:00:00,UTC"),
+ TzTimestamp64("1-01-01T02:30:17,Europe/Moscow"),
+ cast(Timestamp64("-1-12-31T23:59:59.999999Z") as string),
+ TzTimestamp64("-1-12-31T23:59:59.999999,UTC"),
+ TzTimestamp64("1-01-01T02:30:16.999999,Europe/Moscow");
+
diff --git a/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql b/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql
new file mode 100644
index 0000000000..95f5f0796f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$c = "cccc";
+
+INSERT INTO @$c
+select 1 as x;
+commit;
+SELECT * FROM @$c;
diff --git a/yql/essentials/tests/sql/suites/binding/bind_cast.sql b/yql/essentials/tests/sql/suites/binding/bind_cast.sql
new file mode 100644
index 0000000000..2ccf1cdf6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/bind_cast.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$casted_null = cast(null as Double);
+select $casted_null
diff --git a/yql/essentials/tests/sql/suites/binding/bind_select.sql b/yql/essentials/tests/sql/suites/binding/bind_select.sql
new file mode 100644
index 0000000000..a7f24466c8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/bind_select.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$foo = (select 100500 as bar);
+select bar from $foo;
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql
new file mode 100644
index 0000000000..a6f77687df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql
@@ -0,0 +1,8 @@
+/* yt can not */
+pragma CompactNamedExprs;
+
+$foo = 1+2;
+$a, $b = AsTuple(1+3, 2+5);
+$l = ($x) -> ($x + $foo);
+
+select $foo, $a, $b, $l(123);
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql
new file mode 100644
index 0000000000..a823be2af3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql
@@ -0,0 +1,27 @@
+pragma CompactNamedExprs;
+
+$src = select 1;
+
+define subquery $sub1() as
+ select * from $src;
+end define;
+
+$foo = 1+2;
+
+define subquery $sub2($sub, $extra) as
+ select a.*, $extra as extra, $foo as another from $sub() as a
+end define;
+
+select * from $sub1();
+select * from $sub2($sub1, 1);
+select * from $sub2($sub1, "aaa");
+
+define action $hello_world($sub, $name, $suffix?) as
+ $name = $name ?? ($suffix ?? "world");
+ select "Hello, " || $name || "!" from $sub();
+end define;
+
+do empty_action();
+do $hello_world($sub1, null);
+do $hello_world($sub1, null, "John");
+do $hello_world($sub1, null, "Earth");
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql
new file mode 100644
index 0000000000..0da0d7dd97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql
@@ -0,0 +1,16 @@
+/* yt can not */
+pragma CompactNamedExprs;
+
+$a = (SELECT CAST(Unicode::ToUpper("o"u) AS String) || "utpu");
+$b = $a || CAST(Unicode::ToLower("T"u) AS String);
+select $b;
+select $a || CAST(Unicode::ToLower("T"u) AS String);
+select * from $a;
+select "Outpu" in $a;
+
+define subquery $sub() as
+ select * from $a;
+end define;
+
+select * from $sub();
+
diff --git a/yql/essentials/tests/sql/suites/binding/default.cfg b/yql/essentials/tests/sql/suites/binding/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/binding/drop_binding.cfg b/yql/essentials/tests/sql/suites/binding/drop_binding.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/drop_binding.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/binding/drop_binding.sql b/yql/essentials/tests/sql/suites/binding/drop_binding.sql
new file mode 100644
index 0000000000..48bafd14d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/drop_binding.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - can't drop non-existent table */
+
+USE plato;
+
+$a = "Output";
+DROP TABLE $a;
diff --git a/yql/essentials/tests/sql/suites/binding/input.txt b/yql/essentials/tests/sql/suites/binding/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/binding/input2.txt b/yql/essentials/tests/sql/suites/binding/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/binding/input3.txt b/yql/essentials/tests/sql/suites/binding/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/binding/input4.txt b/yql/essentials/tests/sql/suites/binding/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/binding/insert_binding.cfg b/yql/essentials/tests/sql/suites/binding/insert_binding.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/insert_binding.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/binding/insert_binding.sql b/yql/essentials/tests/sql/suites/binding/insert_binding.sql
new file mode 100644
index 0000000000..28f1de7135
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/insert_binding.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = "Output";
+INSERT INTO $a
+SELECT count(*) from Input;
diff --git a/yql/essentials/tests/sql/suites/binding/named_callable.sql b/yql/essentials/tests/sql/suites/binding/named_callable.sql
new file mode 100644
index 0000000000..0313023fee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_callable.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = ($item) -> { return $item + $item};
+select $foo(1);
diff --git a/yql/essentials/tests/sql/suites/binding/named_expr_input.sql b/yql/essentials/tests/sql/suites/binding/named_expr_input.sql
new file mode 100644
index 0000000000..f6b63b48a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_expr_input.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = (select 100500 as bar);
+select bar from $foo;
diff --git a/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql b/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql
new file mode 100644
index 0000000000..4b9c0ddbba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = (SELECT key, subkey FROM Input);
+SELECT a.subkey FROM $a AS a;
+SELECT b.subkey FROM $a AS b;
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql b/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql
new file mode 100644
index 0000000000..0cfc4b4e1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$a = "Input";
+SELECT count(*) FROM plato.concat($a,$a);
+
+USE plato;
+
+$a = "Input";
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx
new file mode 100644
index 0000000000..62f609a682
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = plato.Input;
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx
new file mode 100644
index 0000000000..90cc8bdb0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = a[0];
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx
new file mode 100644
index 0000000000..11b22f42a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = a.0;
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql
new file mode 100644
index 0000000000..ba55ba86ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$a = "Input";
+SELECT count(*) FROM plato.concat_strict($a,$a);
+
+USE plato;
+
+$a = "Input";
+SELECT count(*) FROM concat_strict($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql b/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql
new file mode 100644
index 0000000000..76aa156f96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql
@@ -0,0 +1,27 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.filter($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM plato.filter($a,$b,$c,$d);
+
+use plato;
+
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM filter($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM filter($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql
new file mode 100644
index 0000000000..0217520a0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.filter_strict($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM plato.filter_strict($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM filter_strict($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM filter_strict($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding.sql b/yql/essentials/tests/sql/suites/binding/table_from_binding.sql
new file mode 100644
index 0000000000..0ea49f5ee5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$x = "Input";
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx
new file mode 100644
index 0000000000..41d8d01426
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.0;
+SELECT count(*) FROM $x as a;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx
new file mode 100644
index 0000000000..334d1dcd5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a[0];
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx
new file mode 100644
index 0000000000..346c86cb92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.b[0];
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx
new file mode 100644
index 0000000000..cb7384a5ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.b;
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql b/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql
new file mode 100644
index 0000000000..1e2bd7c935
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* kikimr can not */
+pragma yt.InferSchema;
+
+/* postgres can not */
+use plato;
+$x = "Input";
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_range_binding.sql b/yql/essentials/tests/sql/suites/binding/table_range_binding.sql
new file mode 100644
index 0000000000..4669fb2077
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_range_binding.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
diff --git a/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql
new file mode 100644
index 0000000000..bbf62c6c2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range_strict not supported */
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg
new file mode 100644
index 0000000000..acaecd1e1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql
new file mode 100644
index 0000000000..2e3d721dc6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.regexp($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM regexp($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg
new file mode 100644
index 0000000000..acaecd1e1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql
new file mode 100644
index 0000000000..530b988012
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.regexp_strict($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM regexp_strict($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/tie.sql b/yql/essentials/tests/sql/suites/binding/tie.sql
new file mode 100644
index 0000000000..fe867ff709
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$a, $b, $c = AsTuple(1, 5u, "test");
+select $a, $b, $c;
diff --git a/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql
new file mode 100644
index 0000000000..de29966b64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$i, $j = AsTuple(1, 5u, "test");
+
+select $i, $j;
diff --git a/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql b/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql
new file mode 100644
index 0000000000..162de996b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$foo = ($x) -> {
+ return AsTuple($x, $x);
+};
+
+$ids = (
+ SELECT AGGREGATE_LIST(id)
+ FROM (
+ select "1" as id union all select "2" as id
+ )
+);
+
+
+$first_ids, $second_ids = $foo(unwrap($ids));
+select $first_ids as one, $second_ids as two;
+
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/add_bitcast.sql b/yql/essentials/tests/sql/suites/bitcast_implicit/add_bitcast.sql
new file mode 100644
index 0000000000..fcfe3cf266
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/add_bitcast.sql
@@ -0,0 +1,4 @@
+USE plato;
+select 1ul+1; -- warn
+select 1u+1; -- warn
+select 1l+1u; -- ok
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/default.cfg b/yql/essentials/tests/sql/suites/bitcast_implicit/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/default.cfg
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/div_bitcast.sql b/yql/essentials/tests/sql/suites/bitcast_implicit/div_bitcast.sql
new file mode 100644
index 0000000000..f17b9204c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/div_bitcast.sql
@@ -0,0 +1,4 @@
+USE plato;
+select 1ul/1; -- warn
+select 1u/1; -- warn
+select 1l/1u; -- ok
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/mod_bitcast.sql b/yql/essentials/tests/sql/suites/bitcast_implicit/mod_bitcast.sql
new file mode 100644
index 0000000000..f1bd6fc976
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/mod_bitcast.sql
@@ -0,0 +1,4 @@
+USE plato;
+select 1ul%1; -- warn
+select 1u%1; -- warn
+select 1l%1u; -- ok
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/mul_bitcast.sql b/yql/essentials/tests/sql/suites/bitcast_implicit/mul_bitcast.sql
new file mode 100644
index 0000000000..05f78f0957
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/mul_bitcast.sql
@@ -0,0 +1,4 @@
+USE plato;
+select 1ul*1; -- warn
+select 1u*1; -- warn
+select 1l*1u; -- ok
diff --git a/yql/essentials/tests/sql/suites/bitcast_implicit/sub_bitcast.sql b/yql/essentials/tests/sql/suites/bitcast_implicit/sub_bitcast.sql
new file mode 100644
index 0000000000..469d02dd60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/bitcast_implicit/sub_bitcast.sql
@@ -0,0 +1,4 @@
+USE plato;
+select 1ul-1; -- warn
+select 1u-1; -- warn
+select 1l-1u; -- ok
diff --git a/yql/essentials/tests/sql/suites/blocks/add_decimal.cfg b/yql/essentials/tests/sql/suites/blocks/add_decimal.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_decimal.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_decimal.sql b/yql/essentials/tests/sql/suites/blocks/add_decimal.sql
new file mode 100644
index 0000000000..648a3709d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_decimal.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ cs_ext_list_price+cs_sales_price,cast(1 as decimal(7,2))+cs_ext_list_price,cs_sales_price+cast(2ul as decimal(7,2))
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int16.cfg b/yql/essentials/tests/sql/suites/blocks/add_int16.cfg
new file mode 100644
index 0000000000..b122c34208
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int16.cfg
@@ -0,0 +1 @@
+in Input input_int16.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int16.sql b/yql/essentials/tests/sql/suites/blocks/add_int16.sql
new file mode 100644
index 0000000000..5a40f28c1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int16.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1s+key,subkey+2s
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int32.cfg b/yql/essentials/tests/sql/suites/blocks/add_int32.cfg
new file mode 100644
index 0000000000..f68558a818
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int32.cfg
@@ -0,0 +1 @@
+in Input input_int32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int32.sql b/yql/essentials/tests/sql/suites/blocks/add_int32.sql
new file mode 100644
index 0000000000..ae8903174a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int32.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1+key,subkey+2
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int64.cfg b/yql/essentials/tests/sql/suites/blocks/add_int64.cfg
new file mode 100644
index 0000000000..d2b033ce45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int64.cfg
@@ -0,0 +1 @@
+in Input input_int64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int64.sql b/yql/essentials/tests/sql/suites/blocks/add_int64.sql
new file mode 100644
index 0000000000..1c249577dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int64.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1l+key,subkey+2l
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int8.cfg b/yql/essentials/tests/sql/suites/blocks/add_int8.cfg
new file mode 100644
index 0000000000..82ad4d9d8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int8.cfg
@@ -0,0 +1 @@
+in Input input_int8.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_int8.sql b/yql/essentials/tests/sql/suites/blocks/add_int8.sql
new file mode 100644
index 0000000000..7dc1279e89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_int8.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1t+key,subkey+2t
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint16.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint16.cfg
new file mode 100644
index 0000000000..e8e031c1e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint16.cfg
@@ -0,0 +1 @@
+in Input input_uint16.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint16.sql b/yql/essentials/tests/sql/suites/blocks/add_uint16.sql
new file mode 100644
index 0000000000..9d81c2c052
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint16.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1us+key,subkey+2us
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint32.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint32.cfg
new file mode 100644
index 0000000000..54555c1cf2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint32.cfg
@@ -0,0 +1 @@
+in Input input_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint32.sql b/yql/essentials/tests/sql/suites/blocks/add_uint32.sql
new file mode 100644
index 0000000000..2c61de9c42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint32.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1u+key,subkey+2u
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint64.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64.sql b/yql/essentials/tests/sql/suites/blocks/add_uint64.sql
new file mode 100644
index 0000000000..7671b7667d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1ul+key,subkey+2ul
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.cfg
new file mode 100644
index 0000000000..317b76e3a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.sql b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.sql
new file mode 100644
index 0000000000..7671b7667d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1ul+key,subkey+2ul
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.cfg
new file mode 100644
index 0000000000..46fee85c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt2.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.sql b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.sql
new file mode 100644
index 0000000000..7671b7667d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint64_opt2.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1ul+key,subkey+2ul
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint8.cfg b/yql/essentials/tests/sql/suites/blocks/add_uint8.cfg
new file mode 100644
index 0000000000..cd9448c29c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint8.cfg
@@ -0,0 +1 @@
+in Input input_uint8.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/add_uint8.sql b/yql/essentials/tests/sql/suites/blocks/add_uint8.sql
new file mode 100644
index 0000000000..b757039a48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/add_uint8.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+subkey,1ut+key,subkey+2ut
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/bitcast_block.cfg b/yql/essentials/tests/sql/suites/blocks/bitcast_block.cfg
new file mode 100644
index 0000000000..e8dbb42122
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/bitcast_block.cfg
@@ -0,0 +1 @@
+in Input input_uint8_big.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/bitcast_block.sql b/yql/essentials/tests/sql/suites/blocks/bitcast_block.sql
new file mode 100644
index 0000000000..596b3d0f4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/bitcast_block.sql
@@ -0,0 +1,3 @@
+USE plato;
+
+select key+1l from Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.cfg
new file mode 100644
index 0000000000..e8dbb42122
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.cfg
@@ -0,0 +1 @@
+in Input input_uint8_big.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.sql b/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.sql
new file mode 100644
index 0000000000..478d1af333
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/bitcast_scalar.sql
@@ -0,0 +1,3 @@
+USE plato;
+
+select key+1t from Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input.cfg b/yql/essentials/tests/sql/suites/blocks/block_input.cfg
new file mode 100644
index 0000000000..426917836b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input.cfg
@@ -0,0 +1,2 @@
+in Input input_strings.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input.sql b/yql/essentials/tests/sql/suites/blocks/block_input.sql
new file mode 100644
index 0000000000..50749842db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+PRAGMA yt.JobBlockInput;
+
+SELECT
+ key,
+ subkey,
+ "value: " || value AS value,
+FROM Input
+WHERE key < "100"
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.cfg b/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.cfg
new file mode 100644
index 0000000000..5017087a09
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+in Input2 input2.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.sql b/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.sql
new file mode 100644
index 0000000000..2ab38cdf00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_sys_columns.sql
@@ -0,0 +1,18 @@
+USE plato;
+
+PRAGMA yt.JobBlockInput;
+
+$a = (
+ SELECT TableName() AS table_name, TableRecordIndex() AS record_index, Input1.* FROM Input1
+ UNION ALL
+ SELECT TableName() AS table_name, TableRecordIndex() AS record_index, Input2.* FROM Input2
+);
+
+$b = (
+ SELECT * FROM Input1 AS users
+ UNION ALL
+ SELECT * FROM Input2 AS users
+);
+
+SELECT * FROM $a ORDER BY table_name, record_index;
+SELECT ROW_NUMBER() OVER () AS row_num, b.* FROM $b AS b ORDER BY row_num;
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types-v3.cfg b/yql/essentials/tests/sql/suites/blocks/block_input_various_types-v3.cfg
new file mode 100644
index 0000000000..6c3e597275
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types-v3.cfg
@@ -0,0 +1,3 @@
+in Input block_input_various_types_v3.txt
+providers yt
+pragma yt.UseNativeYtTypes
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types.cfg b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.cfg
new file mode 100644
index 0000000000..0c5560da7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.cfg
@@ -0,0 +1,2 @@
+in Input block_input_various_types.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types.sql b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.sql
new file mode 100644
index 0000000000..dfd793d765
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+PRAGMA yt.JobBlockInput;
+
+SELECT * FROM Input WHERE `int64` > 10;
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt
new file mode 100644
index 0000000000..8b19f43faf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt
@@ -0,0 +1,15 @@
+{"bool"=%false;"optionalDouble"=#;"string"="\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";"tuple"=[47118;"\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=47118;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=47118;"body"="\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%true;"optionalDouble"=0.12625990897039296;"string"="\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";"tuple"=[50018;"\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";%true;[0.12625990897039296;];"\xF0\x9F\x8C\x9D";];"int64"=50018;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=50018;"body"="\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";"random"=0.12625990897039296;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";"tuple"=[50651;"\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=50651;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=50651;"body"="\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%true;"optionalDouble"=#;"string"="\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";"tuple"=[51926;"\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";%true;#;"\xF0\x9F\x8C\x9A";];"int64"=51926;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=51926;"body"="\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";"random"=#;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%true;"optionalDouble"=0.20228555333311726;"string"="\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";"tuple"=[59870;"\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";%true;[0.20228555333311726;];"\xF0\x9F\x8C\x9D";];"int64"=59870;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=59870;"body"="\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";"random"=0.20228555333311726;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.6180741372005905;"string"="\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";"tuple"=[72292;"\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";%false;[0.6180741372005905;];"\xF0\x9F\x8C\x9D";];"int64"=72292;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=72292;"body"="\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";"random"=0.6180741372005905;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="SADSAD";"tuple"=[72293;"SADSAD";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=72293;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=72293;"body"="SADSAD";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=0.8229333217326893;"string"="asDSD";"tuple"=[0;"asDSD";%false;[0.8229333217326893;];"\xF0\x9F\x8C\x9D";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=0;"body"="asDSD";"random"=0.8229333217326893;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.7745256384584717;"string"="sdgfsadf";"tuple"=[0;"sdgfsadf";%false;[0.7745256384584717;];"\xF0\x9F\x8C\x9D";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=0;"body"="sdgfsadf";"random"=0.7745256384584717;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="sadfasdf";"tuple"=[0;"sadfasdf";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=0;"body"="sadfasdf";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=0.9568386351056601;"string"="adfasdf";"tuple"=[0;"adfasdf";%false;[0.9568386351056601;];"\xF0\x9F\x8C\x9D";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=0;"body"="adfasdf";"random"=0.9568386351056601;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="hhjjk66";"tuple"=[47119;"hhjjk66";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=47119;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=47119;"body"="hhjjk66";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=0.010654992670553587;"string"="titjj";"tuple"=[47120;"titjj";%false;[0.010654992670553587;];"\xF0\x9F\x8C\x9D";];"int64"=47120;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=47120;"body"="titjj";"random"=0.010654992670553587;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.9605645888111658;"string"="123456555hh";"tuple"=[47672;"123456555hh";%false;[0.9605645888111658;];"\xF0\x9F\x8C\x9D";];"int64"=47672;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=47672;"body"="123456555hh";"random"=0.9605645888111658;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="6666r\xD0\26066";"tuple"=[48065;"6666r\xD0\26066";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=48065;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=48065;"body"="6666r\xD0\26066";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt.attr b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt.attr
new file mode 100644
index 0000000000..2b89fecf21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types.txt.attr
@@ -0,0 +1,182 @@
+{
+ "_yql_row_spec" = {
+ "NativeYtTypeFlags" = 0u;
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "bool";
+ [
+ "DataType";
+ "Bool";
+ ];
+ ];
+ [
+ "optionalDouble";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Double";
+ ];
+ ];
+ ];
+ [
+ "string";
+ [
+ "DataType";
+ "String";
+ ];
+ ];
+ [
+ "tuple";
+ [
+ "TupleType";
+ [
+ [
+ "DataType";
+ "Int64";
+ ];
+ [
+ "DataType";
+ "String";
+ ];
+ [
+ "DataType";
+ "Bool";
+ ];
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Double";
+ ];
+ ];
+ [
+ "DataType";
+ "Utf8";
+ ];
+ ];
+ ];
+ ];
+ [
+ "int64";
+ [
+ "DataType";
+ "Int64";
+ ];
+ ];
+ [
+ "utf8";
+ [
+ "DataType";
+ "Utf8";
+ ];
+ ];
+ [
+ "yson";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Yson";
+ ];
+ ];
+ ];
+ ];
+ ];
+ "TypePatch" = [
+ "StructType";
+ [
+ [
+ "tuple";
+ [
+ "TupleType";
+ [
+ [
+ "DataType";
+ "Int64";
+ ];
+ [
+ "DataType";
+ "String";
+ ];
+ [
+ "DataType";
+ "Bool";
+ ];
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Double";
+ ];
+ ];
+ [
+ "DataType";
+ "Utf8";
+ ];
+ ];
+ ];
+ ];
+ ];
+ ];
+ };
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "bool";
+ "required" = %true;
+ "type" = "boolean";
+ "type_v3" = "bool";
+ };
+ {
+ "name" = "optionalDouble";
+ "required" = %false;
+ "type" = "double";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "double";
+ };
+ };
+ {
+ "name" = "string";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "tuple";
+ "required" = %false;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "yson";
+ };
+ };
+ {
+ "name" = "int64";
+ "required" = %true;
+ "type" = "int64";
+ "type_v3" = "int64";
+ };
+ {
+ "name" = "utf8";
+ "required" = %true;
+ "type" = "utf8";
+ "type_v3" = "utf8";
+ };
+ {
+ "name" = "yson";
+ "required" = %false;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "yson";
+ };
+ };
+ ];
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt b/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt
new file mode 100644
index 0000000000..ac45e75445
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt
@@ -0,0 +1,15 @@
+{"bool"=%false;"optionalDouble"=#;"string"="\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";"tuple"=[47118;"\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=47118;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=47118;"body"="\xD0\x94\xD0\xBE\xD1\x81\xD1\x82\xD0\xB0\xD0\xBB\xD0\xB8 \xD1\x8D\xD1\x82\xD0\xB8 \xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD1\x8B? \xD0\xA7\xD0\xB8\xD1\x82\xD0\xB0\xD0\xB9\xD1\x82\xD0\xB5 \xD0\xBF\xD1\x80\xD0\xBE \xD0\xB7\xD1\x8E\xD0\xB3\xD0\xB7\xD0\xB8\xD0\xBA\xD0\xBE\xD0\xB2. \xD0\x9E\xD0\xBD\xD0\xB8 \xD1\x81\xD0\xBB\xD0\xB0\xD0\xB2\xD0\xBD\xD1\x8B\xD0\xB5.";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%true;"optionalDouble"=#;"string"="\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";"tuple"=[50018;"\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";%true;#;"\xF0\x9F\x8C\x9A";];"int64"=50018;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=50018;"body"="\xD0\xA1\xD0\xBF\xD1\x80\xD0\xB0\xD0\xB2\xD0\xBE\xD1\x87\xD0\xBD\xD0\xB8\xD0\xBA \xD1\x80\xD0\xB5\xD0\xB4\xD0\xBA\xD0\xB8\xD1\x85 \xD1\x80\xD1\x83\xD0\xB3\xD0\xB0\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8C\xD1\x81\xD1\x82\xD0\xB2. \xD0\x9B\xD0\xB5\xD0\xBA\xD1\x81\xD0\xB8\xD0\xBA\xD0\xB0 \xD0\xBD\xD0\xBE\xD1\x80\xD0\xBC\xD0\xB0\xD1\x82\xD0\xB8\xD0\xB2\xD0\xBD\xD0\xB0. \xD0\xA0\xD0\xB5\xD0\xBA\xD0\xBE\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xB4\xD0\xBE\xD0\xB2\xD0\xB0\xD0\xBD \xD0\xB4\xD0\xBB\xD1\x8F \xD1\x88\xD0\xBA\xD0\xBE\xD0\xBB.";"random"=#;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=0.7379342704977339;"string"="\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";"tuple"=[50651;"\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";%false;0.7379342704977339;"\xF0\x9F\x8C\x9D";];"int64"=50651;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=50651;"body"="\xD0\x9A\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xBD\xD0\xB5 \xD0\xBA\xD0\xB0\xD1\x80\xD0\xB0\xD1\x83\xD0\xBB\xD1\x8C, \xD0\xB0 \xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB5\xD0\xB6\xD0\xBA\xD0\xB8 \xD0\xB2\xD1\x81\xD0\xB5 \xD1\x80\xD0\xB0\xD0\xB2\xD0\xBD\xD0\xBE \xD1\x82\xD1\x8E-\xD1\x82\xD1\x8E.";"random"=0.7379342704977339;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%true;"optionalDouble"=0.9428779195684432;"string"="\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";"tuple"=[51926;"\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";%true;0.9428779195684432;"\xF0\x9F\x8C\x9D";];"int64"=51926;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=51926;"body"="\xD0\x94\xD0\xBE\xD0\xB1\xD0\xB0\xD0\xB2\xD0\xBA\xD0\xB0 \xD0\xBA \xD1\x83\xD0\xB6\xD0\xB8\xD0\xBD\xD1\x83 \xD0\xB2\xD1\x8B\xD0\xB4\xD0\xB0\xD0\xB5\xD1\x82\xD1\x81\xD1\x8F \xD0\xBD\xD0\xB0 \xD0\xB4\xD1\x80\xD1\x83\xD0\xB3\xD0\xBE\xD0\xB9 \xD0\xB4\xD0\xB5\xD0\xBD\xD1\x8C \xD0\xB2 \xD0\xBE\xD0\xB1\xD0\xB5\xD0\xB4 \xD0\xBF\xD0\xBE \xD0\xBF\xD0\xB8\xD1\x81\xD1\x8C\xD0\xBC\xD0\xB5\xD0\xBD\xD0\xBD\xD0\xBE\xD0\xBC\xD1\x83 \xD0\xB7\xD0\xB0\xD1\x8F\xD0\xB2\xD0\xBB\xD0\xB5\xD0\xBD\xD0\xB8\xD1\x8E.";"random"=0.9428779195684432;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%true;"optionalDouble"=0.017737390999761016;"string"="\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";"tuple"=[59870;"\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";%true;0.017737390999761016;"\xF0\x9F\x8C\x9D";];"int64"=59870;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=59870;"body"="\xD0\xAF\xD0\xBD\xD0\xB4\xD0\xB5\xD0\xBA\xD1\x81.\xD0\x94\xD0\xB8\xD1\x80\xD0\xB5\xD0\xBA\xD1\x82 - \xD1\x82\xD0\xB5\xD0\xBF\xD0\xB5\xD1\x80\xD1\x8C \xD0\xBE\xD0\xBF\xD0\xBB\xD0\xB0\xD1\x82\xD0\xB0 \xD1\x82\xD0\xBE\xD0\xBB\xD1\x8C\xD0\xBA\xD0\xBE \xD0\xBF\xD0\xBE \xD0\xBA\xD0\xBB\xD0\xB8\xD0\xBA\xD0\xB0\xD0\xBC! \xD0\x9E\xD1\x82 3 \xD1\x80\xD1\x83\xD0\xB1\xD0\xBB\xD0\xB5\xD0\xB9 \xD0\xB7\xD0\xB0 \xD0\xBF\xD0\xBE\xD1\x81\xD0\xB5\xD1\x82\xD0\xB8\xD1\x82\xD0\xB5\xD0\xBB\xD1\x8F!";"random"=0.017737390999761016;"statusPostModerate"=%true;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.2538185652918672;"string"="\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";"tuple"=[72292;"\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";%false;0.2538185652918672;"\xF0\x9F\x8C\x9D";];"int64"=72292;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=72292;"body"="\xD1\x84\xD1\x8B\xD0\xB2\xD0\x92\xD0\xAB\xD0\x90";"random"=0.2538185652918672;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.13715387334717577;"string"="SADSAD";"tuple"=[72293;"SADSAD";%false;0.13715387334717577;"\xF0\x9F\x8C\x9D";];"int64"=72293;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=72293;"body"="SADSAD";"random"=0.13715387334717577;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.779134027692687;"string"="asDSD";"tuple"=[0;"asDSD";%false;0.779134027692687;"\xF0\x9F\x8C\x9D";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=0;"body"="asDSD";"random"=0.779134027692687;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=0.9141141402596906;"string"="sdgfsadf";"tuple"=[0;"sdgfsadf";%false;0.9141141402596906;"\xF0\x9F\x8C\x9D";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=0;"body"="sdgfsadf";"random"=0.9141141402596906;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="sadfasdf";"tuple"=[0;"sadfasdf";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=0;"body"="sadfasdf";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=#;"string"="adfasdf";"tuple"=[0;"adfasdf";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=0;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=0;"body"="adfasdf";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=#;"string"="hhjjk66";"tuple"=[47119;"hhjjk66";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=47119;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=47119;"body"="hhjjk66";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=#;"string"="titjj";"tuple"=[47120;"titjj";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=47120;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=47120;"body"="titjj";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
+{"bool"=%false;"optionalDouble"=0.47223645647398416;"string"="123456555hh";"tuple"=[47672;"123456555hh";%false;0.47223645647398416;"\xF0\x9F\x8C\x9D";];"int64"=47672;"utf8"="\xF0\x9F\x8C\x9D";"yson"={"banner_id"=47672;"body"="123456555hh";"random"=0.47223645647398416;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9D";};};
+{"bool"=%false;"optionalDouble"=#;"string"="6666r\xD0\26066";"tuple"=[48065;"6666r\xD0\26066";%false;#;"\xF0\x9F\x8C\x9A";];"int64"=48065;"utf8"="\xF0\x9F\x8C\x9A";"yson"={"banner_id"=48065;"body"="6666r\xD0\26066";"random"=#;"statusPostModerate"=%false;"utf8"="\xF0\x9F\x8C\x9A";};};
diff --git a/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt.attr b/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt.attr
new file mode 100644
index 0000000000..4f3264e5e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/block_input_various_types_v3.txt.attr
@@ -0,0 +1,77 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "bool";
+ "required" = %true;
+ "type" = "boolean";
+ "type_v3" = "bool";
+ };
+ {
+ "name" = "optionalDouble";
+ "required" = %false;
+ "type" = "double";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "double";
+ };
+ };
+ {
+ "name" = "string";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "tuple";
+ "required" = %true;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "tuple";
+ "elements" = [
+ {
+ "type" = "int64";
+ };
+ {
+ "type" = "string";
+ };
+ {
+ "type" = "bool";
+ };
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "double";
+ };
+ };
+ {
+ "type" = "utf8";
+ };
+ ];
+ };
+ };
+ {
+ "name" = "int64";
+ "required" = %true;
+ "type" = "int64";
+ "type_v3" = "int64";
+ };
+ {
+ "name" = "utf8";
+ "required" = %true;
+ "type" = "utf8";
+ "type_v3" = "utf8";
+ };
+ {
+ "name" = "yson";
+ "required" = %false;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "yson";
+ };
+ };
+ ];
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/boolean_ops.cfg b/yql/essentials/tests/sql/suites/blocks/boolean_ops.cfg
new file mode 100644
index 0000000000..490bd1a7a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/boolean_ops.cfg
@@ -0,0 +1 @@
+in Input input_bools.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/boolean_ops.sql b/yql/essentials/tests/sql/suites/blocks/boolean_ops.sql
new file mode 100644
index 0000000000..e0a8c581aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/boolean_ops.sql
@@ -0,0 +1,27 @@
+USE plato;
+
+select
+ key,
+ b1 and b2 as abb,
+ b2 and ob1 as abo,
+ ob2 and b1 as aob,
+ ob1 and ob2 as aoo,
+
+ b1 or b2 as obb,
+ b2 or ob1 as obo,
+ ob2 or b1 as oob,
+ ob1 or ob2 as ooo,
+
+ b1 xor b2 as xbb,
+ b2 xor ob1 as xbo,
+ ob2 xor b1 as xob,
+ ob1 xor ob2 as xoo,
+
+ (1 > 2) and b1 and b2 and ob1 and ob2 as chain1,
+ (1 < 2) xor b1 xor b2 xor ob1 xor ob2 as chain2,
+ (1/0 < 1) or b1 or b2 or ob1 or ob2 as chain3,
+
+
+from Input
+
+order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_bools.cfg b/yql/essentials/tests/sql/suites/blocks/coalesce_bools.cfg
new file mode 100644
index 0000000000..490bd1a7a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_bools.cfg
@@ -0,0 +1 @@
+in Input input_bools.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_bools.sql b/yql/essentials/tests/sql/suites/blocks/coalesce_bools.sql
new file mode 100644
index 0000000000..2c3ffabb1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_bools.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+select
+ key,
+ ob1 ?? b1,
+ ob1 ?? false,
+ ob1 ?? (1/0 > 0),
+ (1/2 > 0) ?? ob1,
+ (1/2 == 0) ?? b1,
+ (key/0 >= 0) ?? true,
+ (key/0 >= 0) ?? b1,
+ (key/2 >= 0) ?? false,
+
+from Input
+
+order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_complex.sql b/yql/essentials/tests/sql/suites/blocks/coalesce_complex.sql
new file mode 100644
index 0000000000..576394292f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_complex.sql
@@ -0,0 +1,37 @@
+USE plato;
+
+$strings = [
+ <|key:Just(Just("foo")), subkey:Just("bar"), value:1|>,
+ <|key:Just(Nothing(String?)), subkey:Just("two"), value:2|>,
+ <|key:Nothing(String??), subkey:Just("three"), value:3|>,
+ <|key:Nothing(String??), subkey:Nothing(String?), value:4|>,
+];
+
+$tuples = [
+ <|key:Just(Just(AsTuple(1, 2))), subkey:Just(AsTuple(3, 4)), value:1|>,
+ <|key:Just(Nothing(Tuple<Int, Int>?)), subkey:Just(AsTuple(4, 5)), value:2|>,
+ <|key:Nothing(Tuple<Int, Int>??), subkey:Just(AsTuple(5, 6)), value:3|>,
+ <|key:Nothing(Tuple<Int, Int>??), subkey:Nothing(Tuple<Int, Int>?), value:4|>,
+];
+
+insert into @strings
+select * from as_table($strings);
+
+insert into @tuples
+select * from as_table($tuples);
+
+commit;
+
+select
+ value,
+ key ?? subkey,
+ subkey ?? "xxx",
+from @strings
+order by value;
+
+select
+ value,
+ key ?? subkey,
+ subkey ?? AsTuple(100, 500),
+from @tuples
+order by value;
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_ints.cfg b/yql/essentials/tests/sql/suites/blocks/coalesce_ints.cfg
new file mode 100644
index 0000000000..c1251bbbeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_ints.cfg
@@ -0,0 +1 @@
+in Input input_int32_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_ints.sql b/yql/essentials/tests/sql/suites/blocks/coalesce_ints.sql
new file mode 100644
index 0000000000..b726fbdd66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_ints.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+select
+ k1,
+ k2 ?? k1,
+ k2 ?? 0,
+ k2 ?? 1/0,
+ 1/2 ?? k2,
+ 1/2 ?? k1,
+ k1/0 ?? 1,
+ k1/0 ?? k1,
+ k1/2 ?? 0,
+from Input
+
+order by k1;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_avg.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_avg.sql
new file mode 100644
index 0000000000..51932b0be2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+SELECT
+ avg(key),
+ avg(cast(key as int8)),
+ avg(cast(key as uint16)),
+ avg(cast(key as int32)),
+ avg(1u/0u),
+ avg(2),
+ avg(if(key=10u,key)),
+ avg(if(key=100u,key)),
+ avg(key=10u)
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.sql
new file mode 100644
index 0000000000..11a70fb362
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ avg(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.cfg
new file mode 100644
index 0000000000..eee6dd16f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.sql
new file mode 100644
index 0000000000..11a70fb362
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_avg_filter_opt.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ avg(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_count.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_count.sql
new file mode 100644
index 0000000000..648f1f4f96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ count(*),
+ count(key + 1u/(4u-subkey)),
+ count(key),
+ count(1u),
+ count(1u/0u)
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.sql
new file mode 100644
index 0000000000..84d84410e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ count(*),
+ count(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.cfg
new file mode 100644
index 0000000000..eee6dd16f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.sql
new file mode 100644
index 0000000000..84d84410e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_count_filter_opt.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ count(*),
+ count(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.sql
new file mode 100644
index 0000000000..1085d83900
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal.sql
@@ -0,0 +1,15 @@
+use plato;
+
+SELECT
+ count(cs_ext_list_price),
+ sum(cs_ext_tax),
+ sum(cs_ext_list_price),
+ min(cs_sales_price),
+ max(cs_ext_list_price),
+ avg(cs_ext_tax),
+
+ sum(cast(cs_sales_price as float)),
+ min(cast(cs_ext_list_price as float)),
+ max(cast(cs_ext_tax as float)),
+ avg(cast(cs_sales_price as float))
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_decimal_max.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal_max.sql
new file mode 100644
index 0000000000..7119d3dc79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_decimal_max.sql
@@ -0,0 +1,9 @@
+use plato;
+
+SELECT
+ sum(x),
+ avg(x)
+FROM (values
+ (Decimal("99999999999999999999999999999999999",35,0)),
+ (Decimal("1",35,0))
+) as a(x)
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_max.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_max.sql
new file mode 100644
index 0000000000..a57479a251
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max.sql
@@ -0,0 +1,19 @@
+USE plato;
+
+SELECT
+ max(key),
+ max(cast(key as int8)),
+ max(cast(key as uint16)),
+ max(cast(key as int32)),
+ max(1u/0u),
+ max(2),
+ max(if(key=10u,key)),
+ max(if(key=100u,key)),
+ max(false),
+ max(key=10u),
+ max(key>=10u),
+ max(key=20u),
+ max(if(key=10u,true)),
+ max(if(key=100u,true)),
+ max(if(key>=10u,true)),
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.sql
new file mode 100644
index 0000000000..60f4dcc7a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ max(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.cfg
new file mode 100644
index 0000000000..eee6dd16f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.sql
new file mode 100644
index 0000000000..60f4dcc7a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_max_filter_opt.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ max(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_min.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_min.sql
new file mode 100644
index 0000000000..7c7ee6ce15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min.sql
@@ -0,0 +1,19 @@
+USE plato;
+
+SELECT
+ min(key),
+ min(cast(key as int8)),
+ min(cast(key as uint16)),
+ min(cast(key as int32)),
+ min(1u/0u),
+ min(2),
+ min(if(key=10u,key)),
+ min(if(key=100u,key)),
+ min(false),
+ min(key=10u),
+ min(key>=10u),
+ min(key=20u),
+ min(if(key=10u,true)),
+ min(if(key=100u,true)),
+ min(if(key>=10u,true)),
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.sql
new file mode 100644
index 0000000000..7ec8330637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ min(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.cfg
new file mode 100644
index 0000000000..eee6dd16f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.sql
new file mode 100644
index 0000000000..7ec8330637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_min_filter_opt.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ min(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.cfg
new file mode 100644
index 0000000000..3777ee5eac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.cfg
@@ -0,0 +1 @@
+in Input input_double.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.sql
new file mode 100644
index 0000000000..0587e68053
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_double.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+select
+ min(subkey),
+ max(subkey),
+from Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.cfg
new file mode 100644
index 0000000000..b892bc468d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.cfg
@@ -0,0 +1 @@
+in Input input_nested.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.sql
new file mode 100644
index 0000000000..81bab54a42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_minmax_nested.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+select
+ min(value),
+ max(value),
+from Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_pg.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_pg.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_pg.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_pg.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_pg.sql
new file mode 100644
index 0000000000..a9dc82d763
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_pg.sql
@@ -0,0 +1,17 @@
+use plato;
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+SELECT
+ Pg::count(),
+ Pg::count(a),
+ Pg::sum(c),
+ Pg::min(a),
+ Pg::max(a),
+ Pg::min(c),
+ Pg::max(c),
+ Pg::avg(c),
+ Pg::avg(PgCast(1p,pgint4)),
+ Pg::avg(PgCast(1p,pgint8)),
+ Pg::avg(PgCast(1p,pgfloat8)),
+ Pg::regr_count(1.0p,1.0p)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.sql
new file mode 100644
index 0000000000..e20350e0c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_pg_filter.sql
@@ -0,0 +1,14 @@
+use plato;
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+SELECT
+ Pg::count(),
+ Pg::count(a),
+ Pg::sum(c),
+ Pg::min(a),
+ Pg::max(a),
+ Pg::min(c),
+ Pg::max(c),
+ Pg::avg(c),
+FROM Input
+where d="aaa" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_some.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_some.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_some.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_some.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_some.sql
new file mode 100644
index 0000000000..5969668a66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_some.sql
@@ -0,0 +1,19 @@
+USE plato;
+
+SELECT
+ some(key),
+ some(cast(key as int8)),
+ some(cast(key as uint16)),
+ some(cast(key as int32)),
+ some(1u/0u),
+ some(2),
+ some(if(key=10u,key)),
+ some(if(key=100u,key)),
+ some(false),
+ some(key=10u),
+ some(key>=10u),
+ some(key=20u),
+ some(if(key=10u,true)),
+ some(if(key=100u,true)),
+ some(if(key>=10u,true)),
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.sql
new file mode 100644
index 0000000000..de639a661e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_some_filter.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ some(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_sum.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_sum.sql
new file mode 100644
index 0000000000..5e71baec72
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+SELECT
+ sum(key),
+ sum(cast(key as int8)),
+ sum(cast(key as uint16)),
+ sum(cast(key as int32)),
+ sum(1u/0u),
+ sum(2),
+ sum(if(key=10u,key)),
+ sum(if(key=100u,key))
+FROM Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.cfg
new file mode 100644
index 0000000000..9ffe747df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.sql
new file mode 100644
index 0000000000..e61f9c708a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ sum(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.cfg b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.cfg
new file mode 100644
index 0000000000..eee6dd16f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.cfg
@@ -0,0 +1 @@
+in Input input_uint64_filter_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.sql b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.sql
new file mode 100644
index 0000000000..7ec8330637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_all_sum_filter_opt.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ min(key)
+FROM Input
+WHERE subkey!=5 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.sql
new file mode 100644
index 0000000000..8954e98fee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_avg.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ key,
+ avg(1u/(4u-subkey)),
+ avg(subkey),
+ avg(1u),
+ avg(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.sql
new file mode 100644
index 0000000000..2350c5df47
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+SELECT
+ key,
+ count(*),
+ count(1u/(4u-subkey)),
+ count(subkey),
+ count(1u),
+ count(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.sql
new file mode 100644
index 0000000000..be51a39a1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_count_filter.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ key,
+ count(*),
+FROM Input
+WHERE subkey!=4
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.sql
new file mode 100644
index 0000000000..5719f8c8ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_max.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ key,
+ max(1u/(4u-subkey)),
+ max(subkey),
+ max(1u),
+ max(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.sql
new file mode 100644
index 0000000000..5bf681ef9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_min.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ key,
+ min(1u/(4u-subkey)),
+ min(subkey),
+ min(1u),
+ min(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.cfg
new file mode 100644
index 0000000000..3777ee5eac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.cfg
@@ -0,0 +1 @@
+in Input input_double.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.sql
new file mode 100644
index 0000000000..149e38e883
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_double.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+select
+ key,
+ min(subkey),
+ max(subkey),
+from Input
+group by key
+order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.cfg
new file mode 100644
index 0000000000..b892bc468d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.cfg
@@ -0,0 +1 @@
+in Input input_nested.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.sql
new file mode 100644
index 0000000000..8070935f87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_minmax_nested.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+select
+ key,
+ min(value),
+ max(value),
+from Input
+group by key
+order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.sql
new file mode 100644
index 0000000000..7c8c52aab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_pg.sql
@@ -0,0 +1,18 @@
+use plato;
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+SELECT
+ Pg::count(),
+ Pg::count(a),
+ Pg::sum(c),
+ Pg::min(a),
+ Pg::max(a),
+ Pg::min(c),
+ Pg::max(c),
+ Pg::avg(c),
+ Pg::avg(PgCast(1p,pgint4)),
+ Pg::avg(PgCast(1p,pgint8)),
+ Pg::avg(PgCast(1p,pgfloat8)),
+ Pg::regr_count(1.0p,1.0p)
+FROM Input
+group by len(d)
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.sql
new file mode 100644
index 0000000000..ffe4ee0c2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_set.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ key
+FROM Input
+GROUP by key
+ORDER by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.sql
new file mode 100644
index 0000000000..6fcca795a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_some.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ key,
+ some(1u/(4u-subkey)),
+ some(subkey),
+ some(1u),
+ some(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.sql
new file mode 100644
index 0000000000..9c2fc31ab4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ key,
+ sum(1u/(4u-subkey)),
+ sum(subkey),
+ sum(1u),
+ sum(1u/0u)
+FROM Input
+GROUP by key
+ORDER by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.cfg b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.sql b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.sql
new file mode 100644
index 0000000000..0c7e8688f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/combine_hashed_sum_many_keys.sql
@@ -0,0 +1,46 @@
+USE plato;
+
+SELECT
+ k1,
+ sum(subkey)
+FROM Input
+GROUP by key + 1u as k1
+ORDER by k1;
+
+SELECT
+ k1,
+ k2,
+ sum(subkey)
+FROM Input
+GROUP by key + 1u as k1, key + 2u as k2
+ORDER by k1, k2;
+
+SELECT
+ k1,
+ k2,
+ k3,
+ sum(subkey)
+FROM Input
+GROUP by key + 1u as k1, key + 2u as k2, key + 3u as k3
+ORDER by k1, k2, k3;
+
+SELECT
+ k1,
+ k2,
+ k3,
+ k4,
+ sum(subkey)
+FROM Input
+GROUP by key + 1u as k1, key + 2u as k2, key + 3u as k3, key + 4u as k4
+ORDER by k1, k2, k3, k4;
+
+SELECT
+ k1,
+ k2,
+ k3,
+ k4,
+ k5,
+ sum(subkey)
+FROM Input
+GROUP by key + 1u as k1, key + 2u as k2, key + 3u as k3, key + 4u as k4, key + 5u as k5
+ORDER by k1, k2, k3, k4, k5;
diff --git a/yql/essentials/tests/sql/suites/blocks/compare.cfg b/yql/essentials/tests/sql/suites/blocks/compare.cfg
new file mode 100644
index 0000000000..3d3fea34e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/compare.cfg
@@ -0,0 +1 @@
+in Input input_allnums.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/compare.sql b/yql/essentials/tests/sql/suites/blocks/compare.sql
new file mode 100644
index 0000000000..a0e0d5e5b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/compare.sql
@@ -0,0 +1,24 @@
+select
+ i8,
+ i16 == i32,
+ i32 != ui8,
+ ui16 < i64,
+ i8 <= ui8,
+ ui32 > i64,
+ ui64 >= i16,
+
+ i16 == i32opt,
+ i32opt != ui8,
+ ui16 < i64opt,
+ i8opt <= ui8opt,
+ ui32opt > i64,
+ ui64 >= i16,
+
+ i16 == 6u,
+ i32opt != 5,
+ 7 < i64opt,
+ 1/0 <= ui8opt,
+ 0 > i64,
+ ui64 >= 8u,
+from plato.Input
+order by i8;
diff --git a/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.cfg b/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.sql b/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.sql
new file mode 100644
index 0000000000..5b459bd969
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/compare_dates_floats_bools.sql
@@ -0,0 +1,59 @@
+use plato;
+
+insert into @tmp
+select
+ 1 as key,
+
+ 2.0f as fl1,
+ 3.0f as fl2,
+
+ 2.5 as db1,
+ 1.5 as db2,
+
+ true as b1,
+ false as b2,
+
+ Date('2023-01-08') as d1,
+ Date('2023-01-05') as d2,
+
+ Datetime('2023-01-08T00:00:00Z') as dt1,
+ Datetime('2023-01-05T00:00:00Z') as dt2,
+
+ Timestamp('2023-01-08T00:00:00.000000Z') as ts1,
+ Timestamp('2023-01-05T00:00:00.000000Z') as ts2,
+
+ Interval('PT1M') as i1,
+ Interval('PT1H') as i2,
+;
+commit;
+
+select
+ t.*,
+
+ fl1 > fl2,
+ fl1 > key,
+ fl2 > 2.0,
+ fl2 > db2,
+
+ db1 > db2,
+ db2 <= key,
+ db1 > fl2,
+ db2 > 1.0f,
+
+ b1 < b2,
+ b1 == true,
+ false >= b2,
+
+ d1 < d2,
+ d1 == dt1,
+ ts2 == d2,
+ d1 >= Date('2023-01-01'),
+ ts1 == d1,
+ ts2 >= dt2,
+ Timestamp('2023-01-05T00:00:00.000000Z') <= d2,
+
+
+ i1 < i2,
+ i2 > Interval('PT59M'),
+from @tmp as t;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/complex_scalars.cfg b/yql/essentials/tests/sql/suites/blocks/complex_scalars.cfg
new file mode 100644
index 0000000000..b65712414d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/complex_scalars.cfg
@@ -0,0 +1 @@
+in Input input_strings.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/complex_scalars.sql b/yql/essentials/tests/sql/suites/blocks/complex_scalars.sql
new file mode 100644
index 0000000000..225de346de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/complex_scalars.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+select
+ subkey || key as k,
+ Just(Just(1)) as nested_opt,
+ Just(1p) as opt_pg,
+ Just(Just(1p)) as nested_opt_pg,
+ 2p as pg,
+ AsTuple(1, 2, Just(Just(2))) as tuple,
+ Just(Just(Just(AsTuple(1, 2, Just(Just(2)))))) as double_tuple
+from Input
+order by k;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_add_interval.cfg b/yql/essentials/tests/sql/suites/blocks/date_add_interval.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_add_interval.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_add_interval.sql b/yql/essentials/tests/sql/suites/blocks/date_add_interval.sql
new file mode 100644
index 0000000000..3a920ad0e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_add_interval.sql
@@ -0,0 +1,31 @@
+USE plato;
+
+SELECT
+ a.na + b.ni,
+ a.na + b.wi,
+ a.naz + b.ni,
+ a.naz + b.wi,
+ a.nd + b.ni,
+ a.nd + b.wi,
+ a.ndz + b.ni,
+ a.ndz + b.wi,
+ a.nt + b.ni,
+ a.nt + b.wi,
+ a.ntz + b.ni,
+ a.ntz + b.wi,
+
+ a.wa + b.ni,
+ a.wa + b.wi,
+ a.waz + b.ni,
+ a.waz + b.wi,
+ a.wd + b.ni,
+ a.wd + b.wi,
+ a.wdz + b.ni,
+ a.wdz + b.wi,
+ a.wt + b.ni,
+ a.wt + b.wi,
+ a.wtz + b.ni,
+ a.wtz + b.wi,
+FROM Dates as a CROSS JOIN Dates as b
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.sql
new file mode 100644
index 0000000000..da977a614b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_add_interval_scalar.sql
@@ -0,0 +1,57 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") + ni,
+ Date("2000-01-01") + wi,
+ TzDate("2000-01-01,Europe/Moscow") + ni,
+ TzDate("2000-01-01,Europe/Moscow") + wi,
+ Datetime("2000-01-01T03:04:05Z") + ni,
+ Datetime("2000-01-01T03:04:05Z") + wi,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") + ni,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") + wi,
+ Timestamp("2000-01-01T03:04:05.678912Z") + ni,
+ Timestamp("2000-01-01T03:04:05.678912Z") + wi,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") + ni,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") + wi,
+ Date32("1900-01-01") + ni,
+ Date32("1900-01-01") + wi,
+ Datetime64("1900-01-01T03:04:05Z") + ni,
+ Datetime64("1900-01-01T03:04:05Z") + wi,
+ Timestamp64("1900-01-01T03:04:05.678912Z") + ni,
+ Timestamp64("1900-01-01T03:04:05.678912Z") + wi,
+ TzDate32("1900-01-01,Europe/Moscow") + ni,
+ TzDate32("1900-01-01,Europe/Moscow") + wi,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") + ni,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") + wi,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") + ni,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") + wi
+FROM Dates;
+
+SELECT
+ na + Interval("P1D"),
+ na + Interval64("P1D"),
+ naz + Interval("P1D"),
+ naz + Interval64("P1D"),
+ nd + Interval("P1D"),
+ nd + Interval64("P1D"),
+ ndz + Interval("P1D"),
+ ndz + Interval64("P1D"),
+ nt + Interval("P1D"),
+ nt + Interval64("P1D"),
+ ntz + Interval("P1D"),
+ ntz + Interval64("P1D"),
+ wa + Interval("P1D"),
+ wa + Interval64("P1D"),
+ wd + Interval("P1D"),
+ wd + Interval64("P1D"),
+ wt + Interval("P1D"),
+ wt + Interval64("P1D"),
+ waz + Interval("P1D"),
+ waz + Interval64("P1D"),
+ wdz + Interval("P1D"),
+ wdz + Interval64("P1D"),
+ wtz + Interval("P1D"),
+ wtz + Interval64("P1D")
+FROM Dates;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_equals.cfg b/yql/essentials/tests/sql/suites/blocks/date_equals.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_equals.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_equals.sql b/yql/essentials/tests/sql/suites/blocks/date_equals.sql
new file mode 100644
index 0000000000..397b0a20a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_equals.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na == b.na,
+ a.na == b.naz,
+ a.na == b.nd,
+ a.na == b.ndz,
+ a.na == b.nt,
+ a.na == b.ntz,
+ a.na == b.wa,
+ a.na == b.wd,
+ a.na == b.wt,
+ a.na == b.waz,
+ a.na == b.wdz,
+ a.na == b.wtz,
+
+ a.naz == b.na,
+ a.naz == b.naz,
+ a.naz == b.nd,
+ a.naz == b.ndz,
+ a.naz == b.nt,
+ a.naz == b.ntz,
+ a.naz == b.wa,
+ a.naz == b.wd,
+ a.naz == b.wt,
+ a.naz == b.waz,
+ a.naz == b.wdz,
+ a.naz == b.wtz,
+
+ a.nd == b.na,
+ a.nd == b.naz,
+ a.nd == b.nd,
+ a.nd == b.ndz,
+ a.nd == b.nt,
+ a.nd == b.ntz,
+ a.nd == b.wa,
+ a.nd == b.wd,
+ a.nd == b.wt,
+ a.nd == b.waz,
+ a.nd == b.wdz,
+ a.nd == b.wtz,
+
+ a.ndz == b.na,
+ a.ndz == b.naz,
+ a.ndz == b.nd,
+ a.ndz == b.ndz,
+ a.ndz == b.nt,
+ a.ndz == b.ntz,
+ a.ndz == b.wa,
+ a.ndz == b.wd,
+ a.ndz == b.wt,
+ a.ndz == b.waz,
+ a.ndz == b.wdz,
+ a.ndz == b.wtz,
+
+ a.nt == b.na,
+ a.nt == b.naz,
+ a.nt == b.nd,
+ a.nt == b.ndz,
+ a.nt == b.nt,
+ a.nt == b.ntz,
+ a.nt == b.wa,
+ a.nt == b.wd,
+ a.nt == b.wt,
+ a.nt == b.waz,
+ a.nt == b.wdz,
+ a.nt == b.wtz,
+
+ a.ntz == b.na,
+ a.ntz == b.naz,
+ a.ntz == b.nd,
+ a.ntz == b.ndz,
+ a.ntz == b.nt,
+ a.ntz == b.ntz,
+ a.ntz == b.wa,
+ a.ntz == b.wd,
+ a.ntz == b.wt,
+ a.ntz == b.waz,
+ a.ntz == b.wdz,
+ a.ntz == b.wtz,
+
+ a.ni == b.ni,
+ a.ni == b.wi,
+ a.wi == b.ni,
+ a.wi == b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa == b.na,
+ a.wa == b.naz,
+ a.wa == b.nd,
+ a.wa == b.ndz,
+ a.wa == b.nt,
+ a.wa == b.ntz,
+ a.wa == b.wa,
+ a.wa == b.wd,
+ a.wa == b.wt,
+ a.wa == b.waz,
+ a.wa == b.wdz,
+ a.wa == b.wtz,
+
+ a.wd == b.na,
+ a.wd == b.naz,
+ a.wd == b.nd,
+ a.wd == b.ndz,
+ a.wd == b.nt,
+ a.wd == b.ntz,
+ a.wd == b.wa,
+ a.wd == b.wd,
+ a.wd == b.wt,
+ a.wd == b.waz,
+ a.wd == b.wdz,
+ a.wd == b.wtz,
+
+ a.wt == b.na,
+ a.wt == b.naz,
+ a.wt == b.nd,
+ a.wt == b.ndz,
+ a.wt == b.nt,
+ a.wt == b.ntz,
+ a.wt == b.wa,
+ a.wt == b.wd,
+ a.wt == b.wt,
+ a.wt == b.waz,
+ a.wt == b.wdz,
+ a.wt == b.wtz,
+
+ a.waz == b.na,
+ a.waz == b.naz,
+ a.waz == b.nd,
+ a.waz == b.ndz,
+ a.waz == b.nt,
+ a.waz == b.ntz,
+ a.waz == b.wa,
+ a.waz == b.wd,
+ a.waz == b.wt,
+ a.waz == b.waz,
+ a.waz == b.wdz,
+ a.waz == b.wtz,
+
+ a.wdz == b.na,
+ a.wdz == b.naz,
+ a.wdz == b.nd,
+ a.wdz == b.ndz,
+ a.wdz == b.nt,
+ a.wdz == b.ntz,
+ a.wdz == b.wa,
+ a.wdz == b.wd,
+ a.wdz == b.wt,
+ a.wdz == b.waz,
+ a.wdz == b.wdz,
+ a.wdz == b.wtz,
+
+ a.wtz == b.na,
+ a.wtz == b.naz,
+ a.wtz == b.nd,
+ a.wtz == b.ndz,
+ a.wtz == b.nt,
+ a.wtz == b.ntz,
+ a.wtz == b.wa,
+ a.wtz == b.wd,
+ a.wtz == b.wt,
+ a.wtz == b.waz,
+ a.wtz == b.wdz,
+ a.wtz == b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.sql
new file mode 100644
index 0000000000..568f5cc7c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_equals_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") == na,
+ Date("2000-01-01") == naz,
+ Date("2000-01-01") == nd,
+ Date("2000-01-01") == ndz,
+ Date("2000-01-01") == nt,
+ Date("2000-01-01") == ntz,
+ Date("2000-01-01") == wa,
+ Date("2000-01-01") == wd,
+ Date("2000-01-01") == wt,
+ Date("2000-01-01") == waz,
+ Date("2000-01-01") == wdz,
+ Date("2000-01-01") == wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") == na,
+ TzDate("2000-01-01,Europe/Moscow") == naz,
+ TzDate("2000-01-01,Europe/Moscow") == nd,
+ TzDate("2000-01-01,Europe/Moscow") == ndz,
+ TzDate("2000-01-01,Europe/Moscow") == nt,
+ TzDate("2000-01-01,Europe/Moscow") == ntz,
+ TzDate("2000-01-01,Europe/Moscow") == wa,
+ TzDate("2000-01-01,Europe/Moscow") == wd,
+ TzDate("2000-01-01,Europe/Moscow") == wt,
+ TzDate("2000-01-01,Europe/Moscow") == waz,
+ TzDate("2000-01-01,Europe/Moscow") == wdz,
+ TzDate("2000-01-01,Europe/Moscow") == wtz,
+
+ Datetime("2000-01-01T03:04:05Z") == na,
+ Datetime("2000-01-01T03:04:05Z") == naz,
+ Datetime("2000-01-01T03:04:05Z") == nd,
+ Datetime("2000-01-01T03:04:05Z") == ndz,
+ Datetime("2000-01-01T03:04:05Z") == nt,
+ Datetime("2000-01-01T03:04:05Z") == ntz,
+ Datetime("2000-01-01T03:04:05Z") == wa,
+ Datetime("2000-01-01T03:04:05Z") == wd,
+ Datetime("2000-01-01T03:04:05Z") == wt,
+ Datetime("2000-01-01T03:04:05Z") == waz,
+ Datetime("2000-01-01T03:04:05Z") == wdz,
+ Datetime("2000-01-01T03:04:05Z") == wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") == wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") == na,
+ Timestamp("2000-01-01T03:04:05.678912Z") == naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") == nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") == ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") == nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") == ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") == wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") == wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") == wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") == waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") == wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") == wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") == wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") == na,
+ Date32("1900-01-01") == naz,
+ Date32("1900-01-01") == nd,
+ Date32("1900-01-01") == ndz,
+ Date32("1900-01-01") == nt,
+ Date32("1900-01-01") == ntz,
+ Date32("1900-01-01") == wa,
+ Date32("1900-01-01") == wd,
+ Date32("1900-01-01") == wt,
+ Date32("1900-01-01") == waz,
+ Date32("1900-01-01") == wdz,
+ Date32("1900-01-01") == wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") == na,
+ Datetime64("1900-01-01T03:04:05Z") == naz,
+ Datetime64("1900-01-01T03:04:05Z") == nd,
+ Datetime64("1900-01-01T03:04:05Z") == ndz,
+ Datetime64("1900-01-01T03:04:05Z") == nt,
+ Datetime64("1900-01-01T03:04:05Z") == ntz,
+ Datetime64("1900-01-01T03:04:05Z") == wa,
+ Datetime64("1900-01-01T03:04:05Z") == wd,
+ Datetime64("1900-01-01T03:04:05Z") == wt,
+ Datetime64("1900-01-01T03:04:05Z") == waz,
+ Datetime64("1900-01-01T03:04:05Z") == wdz,
+ Datetime64("1900-01-01T03:04:05Z") == wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") == na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") == wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") == na,
+ TzDate32("1900-01-01,Europe/Moscow") == naz,
+ TzDate32("1900-01-01,Europe/Moscow") == nd,
+ TzDate32("1900-01-01,Europe/Moscow") == ndz,
+ TzDate32("1900-01-01,Europe/Moscow") == nt,
+ TzDate32("1900-01-01,Europe/Moscow") == ntz,
+ TzDate32("1900-01-01,Europe/Moscow") == wa,
+ TzDate32("1900-01-01,Europe/Moscow") == wd,
+ TzDate32("1900-01-01,Europe/Moscow") == wt,
+ TzDate32("1900-01-01,Europe/Moscow") == waz,
+ TzDate32("1900-01-01,Europe/Moscow") == wdz,
+ TzDate32("1900-01-01,Europe/Moscow") == wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") == wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") == wtz,
+
+ Interval("P1D") == ni,
+ Interval("P1D") == wi,
+ Interval64("P1D") == ni,
+ Interval64("P1D") == wi,
+FROM Dates;
+
+SELECT
+ na == Date("2000-01-01"),
+ naz == Date("2000-01-01"),
+ nd == Date("2000-01-01"),
+ ndz == Date("2000-01-01"),
+ nt == Date("2000-01-01"),
+ ntz == Date("2000-01-01"),
+ wa == Date("2000-01-01"),
+ wd == Date("2000-01-01"),
+ wt == Date("2000-01-01"),
+ waz == Date("2000-01-01"),
+ wdz == Date("2000-01-01"),
+ wtz == Date("2000-01-01"),
+
+ na == TzDate("2000-01-01,Europe/Moscow"),
+ naz == TzDate("2000-01-01,Europe/Moscow"),
+ nd == TzDate("2000-01-01,Europe/Moscow"),
+ ndz == TzDate("2000-01-01,Europe/Moscow"),
+ nt == TzDate("2000-01-01,Europe/Moscow"),
+ ntz == TzDate("2000-01-01,Europe/Moscow"),
+ wa == TzDate("2000-01-01,Europe/Moscow"),
+ wd == TzDate("2000-01-01,Europe/Moscow"),
+ wt == TzDate("2000-01-01,Europe/Moscow"),
+ waz == TzDate("2000-01-01,Europe/Moscow"),
+ wdz == TzDate("2000-01-01,Europe/Moscow"),
+ wtz == TzDate("2000-01-01,Europe/Moscow"),
+
+ na == Datetime("2000-01-01T03:04:05Z"),
+ naz == Datetime("2000-01-01T03:04:05Z"),
+ nd == Datetime("2000-01-01T03:04:05Z"),
+ ndz == Datetime("2000-01-01T03:04:05Z"),
+ nt == Datetime("2000-01-01T03:04:05Z"),
+ ntz == Datetime("2000-01-01T03:04:05Z"),
+ wa == Datetime("2000-01-01T03:04:05Z"),
+ wd == Datetime("2000-01-01T03:04:05Z"),
+ wt == Datetime("2000-01-01T03:04:05Z"),
+ waz == Datetime("2000-01-01T03:04:05Z"),
+ wdz == Datetime("2000-01-01T03:04:05Z"),
+ wtz == Datetime("2000-01-01T03:04:05Z"),
+
+ na == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz == TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na == Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz == Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd == Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz == Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt == Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz == Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa == Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd == Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt == Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz == Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz == Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz == Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz == TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na == Date32("1900-01-01"),
+ naz == Date32("1900-01-01"),
+ nd == Date32("1900-01-01"),
+ ndz == Date32("1900-01-01"),
+ nt == Date32("1900-01-01"),
+ ntz == Date32("1900-01-01"),
+ wa == Date32("1900-01-01"),
+ wd == Date32("1900-01-01"),
+ wt == Date32("1900-01-01"),
+ waz == Date32("1900-01-01"),
+ wdz == Date32("1900-01-01"),
+ wtz == Date32("1900-01-01"),
+
+ na == Datetime64("1900-01-01T03:04:05Z"),
+ naz == Datetime64("1900-01-01T03:04:05Z"),
+ nd == Datetime64("1900-01-01T03:04:05Z"),
+ ndz == Datetime64("1900-01-01T03:04:05Z"),
+ nt == Datetime64("1900-01-01T03:04:05Z"),
+ ntz == Datetime64("1900-01-01T03:04:05Z"),
+ wa == Datetime64("1900-01-01T03:04:05Z"),
+ wd == Datetime64("1900-01-01T03:04:05Z"),
+ wt == Datetime64("1900-01-01T03:04:05Z"),
+ waz == Datetime64("1900-01-01T03:04:05Z"),
+ wdz == Datetime64("1900-01-01T03:04:05Z"),
+ wtz == Datetime64("1900-01-01T03:04:05Z"),
+
+ na == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz == Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na == TzDate32("1900-01-01,Europe/Moscow"),
+ naz == TzDate32("1900-01-01,Europe/Moscow"),
+ nd == TzDate32("1900-01-01,Europe/Moscow"),
+ ndz == TzDate32("1900-01-01,Europe/Moscow"),
+ nt == TzDate32("1900-01-01,Europe/Moscow"),
+ ntz == TzDate32("1900-01-01,Europe/Moscow"),
+ wa == TzDate32("1900-01-01,Europe/Moscow"),
+ wd == TzDate32("1900-01-01,Europe/Moscow"),
+ wt == TzDate32("1900-01-01,Europe/Moscow"),
+ waz == TzDate32("1900-01-01,Europe/Moscow"),
+ wdz == TzDate32("1900-01-01,Europe/Moscow"),
+ wtz == TzDate32("1900-01-01,Europe/Moscow"),
+
+ na == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz == TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz == TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni == Interval("P1D"),
+ wi == Interval("P1D"),
+ ni == Interval64("P1D"),
+ wi == Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater.cfg b/yql/essentials/tests/sql/suites/blocks/date_greater.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater.sql b/yql/essentials/tests/sql/suites/blocks/date_greater.sql
new file mode 100644
index 0000000000..27c334fa61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na > b.na,
+ a.na > b.naz,
+ a.na > b.nd,
+ a.na > b.ndz,
+ a.na > b.nt,
+ a.na > b.ntz,
+ a.na > b.wa,
+ a.na > b.wd,
+ a.na > b.wt,
+ a.na > b.waz,
+ a.na > b.wdz,
+ a.na > b.wtz,
+
+ a.naz > b.na,
+ a.naz > b.naz,
+ a.naz > b.nd,
+ a.naz > b.ndz,
+ a.naz > b.nt,
+ a.naz > b.ntz,
+ a.naz > b.wa,
+ a.naz > b.wd,
+ a.naz > b.wt,
+ a.naz > b.waz,
+ a.naz > b.wdz,
+ a.naz > b.wtz,
+
+ a.nd > b.na,
+ a.nd > b.naz,
+ a.nd > b.nd,
+ a.nd > b.ndz,
+ a.nd > b.nt,
+ a.nd > b.ntz,
+ a.nd > b.wa,
+ a.nd > b.wd,
+ a.nd > b.wt,
+ a.nd > b.waz,
+ a.nd > b.wdz,
+ a.nd > b.wtz,
+
+ a.ndz > b.na,
+ a.ndz > b.naz,
+ a.ndz > b.nd,
+ a.ndz > b.ndz,
+ a.ndz > b.nt,
+ a.ndz > b.ntz,
+ a.ndz > b.wa,
+ a.ndz > b.wd,
+ a.ndz > b.wt,
+ a.ndz > b.waz,
+ a.ndz > b.wdz,
+ a.ndz > b.wtz,
+
+ a.nt > b.na,
+ a.nt > b.naz,
+ a.nt > b.nd,
+ a.nt > b.ndz,
+ a.nt > b.nt,
+ a.nt > b.ntz,
+ a.nt > b.wa,
+ a.nt > b.wd,
+ a.nt > b.wt,
+ a.nt > b.waz,
+ a.nt > b.wdz,
+ a.nt > b.wtz,
+
+ a.ntz > b.na,
+ a.ntz > b.naz,
+ a.ntz > b.nd,
+ a.ntz > b.ndz,
+ a.ntz > b.nt,
+ a.ntz > b.ntz,
+ a.ntz > b.wa,
+ a.ntz > b.wd,
+ a.ntz > b.wt,
+ a.ntz > b.waz,
+ a.ntz > b.wdz,
+ a.ntz > b.wtz,
+
+ a.ni > b.ni,
+ a.ni > b.wi,
+ a.wi > b.ni,
+ a.wi > b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa > b.na,
+ a.wa > b.naz,
+ a.wa > b.nd,
+ a.wa > b.ndz,
+ a.wa > b.nt,
+ a.wa > b.ntz,
+ a.wa > b.wa,
+ a.wa > b.wd,
+ a.wa > b.wt,
+ a.wa > b.waz,
+ a.wa > b.wdz,
+ a.wa > b.wtz,
+
+ a.wd > b.na,
+ a.wd > b.naz,
+ a.wd > b.nd,
+ a.wd > b.ndz,
+ a.wd > b.nt,
+ a.wd > b.ntz,
+ a.wd > b.wa,
+ a.wd > b.wd,
+ a.wd > b.wt,
+ a.wd > b.waz,
+ a.wd > b.wdz,
+ a.wd > b.wtz,
+
+ a.wt > b.na,
+ a.wt > b.naz,
+ a.wt > b.nd,
+ a.wt > b.ndz,
+ a.wt > b.nt,
+ a.wt > b.ntz,
+ a.wt > b.wa,
+ a.wt > b.wd,
+ a.wt > b.wt,
+ a.wt > b.waz,
+ a.wt > b.wdz,
+ a.wt > b.wtz,
+
+ a.waz > b.na,
+ a.waz > b.naz,
+ a.waz > b.nd,
+ a.waz > b.ndz,
+ a.waz > b.nt,
+ a.waz > b.ntz,
+ a.waz > b.wa,
+ a.waz > b.wd,
+ a.waz > b.wt,
+ a.waz > b.waz,
+ a.waz > b.wdz,
+ a.waz > b.wtz,
+
+ a.wdz > b.na,
+ a.wdz > b.naz,
+ a.wdz > b.nd,
+ a.wdz > b.ndz,
+ a.wdz > b.nt,
+ a.wdz > b.ntz,
+ a.wdz > b.wa,
+ a.wdz > b.wd,
+ a.wdz > b.wt,
+ a.wdz > b.waz,
+ a.wdz > b.wdz,
+ a.wdz > b.wtz,
+
+ a.wtz > b.na,
+ a.wtz > b.naz,
+ a.wtz > b.nd,
+ a.wtz > b.ndz,
+ a.wtz > b.nt,
+ a.wtz > b.ntz,
+ a.wtz > b.wa,
+ a.wtz > b.wd,
+ a.wtz > b.wt,
+ a.wtz > b.waz,
+ a.wtz > b.wdz,
+ a.wtz > b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.cfg b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.sql b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.sql
new file mode 100644
index 0000000000..f8508d2d3e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na >= b.na,
+ a.na >= b.naz,
+ a.na >= b.nd,
+ a.na >= b.ndz,
+ a.na >= b.nt,
+ a.na >= b.ntz,
+ a.na >= b.wa,
+ a.na >= b.wd,
+ a.na >= b.wt,
+ a.na >= b.waz,
+ a.na >= b.wdz,
+ a.na >= b.wtz,
+
+ a.naz >= b.na,
+ a.naz >= b.naz,
+ a.naz >= b.nd,
+ a.naz >= b.ndz,
+ a.naz >= b.nt,
+ a.naz >= b.ntz,
+ a.naz >= b.wa,
+ a.naz >= b.wd,
+ a.naz >= b.wt,
+ a.naz >= b.waz,
+ a.naz >= b.wdz,
+ a.naz >= b.wtz,
+
+ a.nd >= b.na,
+ a.nd >= b.naz,
+ a.nd >= b.nd,
+ a.nd >= b.ndz,
+ a.nd >= b.nt,
+ a.nd >= b.ntz,
+ a.nd >= b.wa,
+ a.nd >= b.wd,
+ a.nd >= b.wt,
+ a.nd >= b.waz,
+ a.nd >= b.wdz,
+ a.nd >= b.wtz,
+
+ a.ndz >= b.na,
+ a.ndz >= b.naz,
+ a.ndz >= b.nd,
+ a.ndz >= b.ndz,
+ a.ndz >= b.nt,
+ a.ndz >= b.ntz,
+ a.ndz >= b.wa,
+ a.ndz >= b.wd,
+ a.ndz >= b.wt,
+ a.ndz >= b.waz,
+ a.ndz >= b.wdz,
+ a.ndz >= b.wtz,
+
+ a.nt >= b.na,
+ a.nt >= b.naz,
+ a.nt >= b.nd,
+ a.nt >= b.ndz,
+ a.nt >= b.nt,
+ a.nt >= b.ntz,
+ a.nt >= b.wa,
+ a.nt >= b.wd,
+ a.nt >= b.wt,
+ a.nt >= b.waz,
+ a.nt >= b.wdz,
+ a.nt >= b.wtz,
+
+ a.ntz >= b.na,
+ a.ntz >= b.naz,
+ a.ntz >= b.nd,
+ a.ntz >= b.ndz,
+ a.ntz >= b.nt,
+ a.ntz >= b.ntz,
+ a.ntz >= b.wa,
+ a.ntz >= b.wd,
+ a.ntz >= b.wt,
+ a.ntz >= b.waz,
+ a.ntz >= b.wdz,
+ a.ntz >= b.wtz,
+
+ a.ni >= b.ni,
+ a.ni >= b.wi,
+ a.wi >= b.ni,
+ a.wi >= b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa >= b.na,
+ a.wa >= b.naz,
+ a.wa >= b.nd,
+ a.wa >= b.ndz,
+ a.wa >= b.nt,
+ a.wa >= b.ntz,
+ a.wa >= b.wa,
+ a.wa >= b.wd,
+ a.wa >= b.wt,
+ a.wa >= b.waz,
+ a.wa >= b.wdz,
+ a.wa >= b.wtz,
+
+ a.wd >= b.na,
+ a.wd >= b.naz,
+ a.wd >= b.nd,
+ a.wd >= b.ndz,
+ a.wd >= b.nt,
+ a.wd >= b.ntz,
+ a.wd >= b.wa,
+ a.wd >= b.wd,
+ a.wd >= b.wt,
+ a.wd >= b.waz,
+ a.wd >= b.wdz,
+ a.wd >= b.wtz,
+
+ a.wt >= b.na,
+ a.wt >= b.naz,
+ a.wt >= b.nd,
+ a.wt >= b.ndz,
+ a.wt >= b.nt,
+ a.wt >= b.ntz,
+ a.wt >= b.wa,
+ a.wt >= b.wd,
+ a.wt >= b.wt,
+ a.wt >= b.waz,
+ a.wt >= b.wdz,
+ a.wt >= b.wtz,
+
+ a.waz >= b.na,
+ a.waz >= b.naz,
+ a.waz >= b.nd,
+ a.waz >= b.ndz,
+ a.waz >= b.nt,
+ a.waz >= b.ntz,
+ a.waz >= b.wa,
+ a.waz >= b.wd,
+ a.waz >= b.wt,
+ a.waz >= b.waz,
+ a.waz >= b.wdz,
+ a.waz >= b.wtz,
+
+ a.wdz >= b.na,
+ a.wdz >= b.naz,
+ a.wdz >= b.nd,
+ a.wdz >= b.ndz,
+ a.wdz >= b.nt,
+ a.wdz >= b.ntz,
+ a.wdz >= b.wa,
+ a.wdz >= b.wd,
+ a.wdz >= b.wt,
+ a.wdz >= b.waz,
+ a.wdz >= b.wdz,
+ a.wdz >= b.wtz,
+
+ a.wtz >= b.na,
+ a.wtz >= b.naz,
+ a.wtz >= b.nd,
+ a.wtz >= b.ndz,
+ a.wtz >= b.nt,
+ a.wtz >= b.ntz,
+ a.wtz >= b.wa,
+ a.wtz >= b.wd,
+ a.wtz >= b.wt,
+ a.wtz >= b.waz,
+ a.wtz >= b.wdz,
+ a.wtz >= b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.sql
new file mode 100644
index 0000000000..f200b0deaa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_or_equal_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") >= na,
+ Date("2000-01-01") >= naz,
+ Date("2000-01-01") >= nd,
+ Date("2000-01-01") >= ndz,
+ Date("2000-01-01") >= nt,
+ Date("2000-01-01") >= ntz,
+ Date("2000-01-01") >= wa,
+ Date("2000-01-01") >= wd,
+ Date("2000-01-01") >= wt,
+ Date("2000-01-01") >= waz,
+ Date("2000-01-01") >= wdz,
+ Date("2000-01-01") >= wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") >= na,
+ TzDate("2000-01-01,Europe/Moscow") >= naz,
+ TzDate("2000-01-01,Europe/Moscow") >= nd,
+ TzDate("2000-01-01,Europe/Moscow") >= ndz,
+ TzDate("2000-01-01,Europe/Moscow") >= nt,
+ TzDate("2000-01-01,Europe/Moscow") >= ntz,
+ TzDate("2000-01-01,Europe/Moscow") >= wa,
+ TzDate("2000-01-01,Europe/Moscow") >= wd,
+ TzDate("2000-01-01,Europe/Moscow") >= wt,
+ TzDate("2000-01-01,Europe/Moscow") >= waz,
+ TzDate("2000-01-01,Europe/Moscow") >= wdz,
+ TzDate("2000-01-01,Europe/Moscow") >= wtz,
+
+ Datetime("2000-01-01T03:04:05Z") >= na,
+ Datetime("2000-01-01T03:04:05Z") >= naz,
+ Datetime("2000-01-01T03:04:05Z") >= nd,
+ Datetime("2000-01-01T03:04:05Z") >= ndz,
+ Datetime("2000-01-01T03:04:05Z") >= nt,
+ Datetime("2000-01-01T03:04:05Z") >= ntz,
+ Datetime("2000-01-01T03:04:05Z") >= wa,
+ Datetime("2000-01-01T03:04:05Z") >= wd,
+ Datetime("2000-01-01T03:04:05Z") >= wt,
+ Datetime("2000-01-01T03:04:05Z") >= waz,
+ Datetime("2000-01-01T03:04:05Z") >= wdz,
+ Datetime("2000-01-01T03:04:05Z") >= wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") >= wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") >= na,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") >= wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") >= wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") >= na,
+ Date32("1900-01-01") >= naz,
+ Date32("1900-01-01") >= nd,
+ Date32("1900-01-01") >= ndz,
+ Date32("1900-01-01") >= nt,
+ Date32("1900-01-01") >= ntz,
+ Date32("1900-01-01") >= wa,
+ Date32("1900-01-01") >= wd,
+ Date32("1900-01-01") >= wt,
+ Date32("1900-01-01") >= waz,
+ Date32("1900-01-01") >= wdz,
+ Date32("1900-01-01") >= wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") >= na,
+ Datetime64("1900-01-01T03:04:05Z") >= naz,
+ Datetime64("1900-01-01T03:04:05Z") >= nd,
+ Datetime64("1900-01-01T03:04:05Z") >= ndz,
+ Datetime64("1900-01-01T03:04:05Z") >= nt,
+ Datetime64("1900-01-01T03:04:05Z") >= ntz,
+ Datetime64("1900-01-01T03:04:05Z") >= wa,
+ Datetime64("1900-01-01T03:04:05Z") >= wd,
+ Datetime64("1900-01-01T03:04:05Z") >= wt,
+ Datetime64("1900-01-01T03:04:05Z") >= waz,
+ Datetime64("1900-01-01T03:04:05Z") >= wdz,
+ Datetime64("1900-01-01T03:04:05Z") >= wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") >= wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") >= na,
+ TzDate32("1900-01-01,Europe/Moscow") >= naz,
+ TzDate32("1900-01-01,Europe/Moscow") >= nd,
+ TzDate32("1900-01-01,Europe/Moscow") >= ndz,
+ TzDate32("1900-01-01,Europe/Moscow") >= nt,
+ TzDate32("1900-01-01,Europe/Moscow") >= ntz,
+ TzDate32("1900-01-01,Europe/Moscow") >= wa,
+ TzDate32("1900-01-01,Europe/Moscow") >= wd,
+ TzDate32("1900-01-01,Europe/Moscow") >= wt,
+ TzDate32("1900-01-01,Europe/Moscow") >= waz,
+ TzDate32("1900-01-01,Europe/Moscow") >= wdz,
+ TzDate32("1900-01-01,Europe/Moscow") >= wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") >= wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") >= wtz,
+
+ Interval("P1D") >= ni,
+ Interval("P1D") >= wi,
+ Interval64("P1D") >= ni,
+ Interval64("P1D") >= wi,
+FROM Dates;
+
+SELECT
+ na >= Date("2000-01-01"),
+ naz >= Date("2000-01-01"),
+ nd >= Date("2000-01-01"),
+ ndz >= Date("2000-01-01"),
+ nt >= Date("2000-01-01"),
+ ntz >= Date("2000-01-01"),
+ wa >= Date("2000-01-01"),
+ wd >= Date("2000-01-01"),
+ wt >= Date("2000-01-01"),
+ waz >= Date("2000-01-01"),
+ wdz >= Date("2000-01-01"),
+ wtz >= Date("2000-01-01"),
+
+ na >= TzDate("2000-01-01,Europe/Moscow"),
+ naz >= TzDate("2000-01-01,Europe/Moscow"),
+ nd >= TzDate("2000-01-01,Europe/Moscow"),
+ ndz >= TzDate("2000-01-01,Europe/Moscow"),
+ nt >= TzDate("2000-01-01,Europe/Moscow"),
+ ntz >= TzDate("2000-01-01,Europe/Moscow"),
+ wa >= TzDate("2000-01-01,Europe/Moscow"),
+ wd >= TzDate("2000-01-01,Europe/Moscow"),
+ wt >= TzDate("2000-01-01,Europe/Moscow"),
+ waz >= TzDate("2000-01-01,Europe/Moscow"),
+ wdz >= TzDate("2000-01-01,Europe/Moscow"),
+ wtz >= TzDate("2000-01-01,Europe/Moscow"),
+
+ na >= Datetime("2000-01-01T03:04:05Z"),
+ naz >= Datetime("2000-01-01T03:04:05Z"),
+ nd >= Datetime("2000-01-01T03:04:05Z"),
+ ndz >= Datetime("2000-01-01T03:04:05Z"),
+ nt >= Datetime("2000-01-01T03:04:05Z"),
+ ntz >= Datetime("2000-01-01T03:04:05Z"),
+ wa >= Datetime("2000-01-01T03:04:05Z"),
+ wd >= Datetime("2000-01-01T03:04:05Z"),
+ wt >= Datetime("2000-01-01T03:04:05Z"),
+ waz >= Datetime("2000-01-01T03:04:05Z"),
+ wdz >= Datetime("2000-01-01T03:04:05Z"),
+ wtz >= Datetime("2000-01-01T03:04:05Z"),
+
+ na >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz >= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz >= Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz >= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na >= Date32("1900-01-01"),
+ naz >= Date32("1900-01-01"),
+ nd >= Date32("1900-01-01"),
+ ndz >= Date32("1900-01-01"),
+ nt >= Date32("1900-01-01"),
+ ntz >= Date32("1900-01-01"),
+ wa >= Date32("1900-01-01"),
+ wd >= Date32("1900-01-01"),
+ wt >= Date32("1900-01-01"),
+ waz >= Date32("1900-01-01"),
+ wdz >= Date32("1900-01-01"),
+ wtz >= Date32("1900-01-01"),
+
+ na >= Datetime64("1900-01-01T03:04:05Z"),
+ naz >= Datetime64("1900-01-01T03:04:05Z"),
+ nd >= Datetime64("1900-01-01T03:04:05Z"),
+ ndz >= Datetime64("1900-01-01T03:04:05Z"),
+ nt >= Datetime64("1900-01-01T03:04:05Z"),
+ ntz >= Datetime64("1900-01-01T03:04:05Z"),
+ wa >= Datetime64("1900-01-01T03:04:05Z"),
+ wd >= Datetime64("1900-01-01T03:04:05Z"),
+ wt >= Datetime64("1900-01-01T03:04:05Z"),
+ waz >= Datetime64("1900-01-01T03:04:05Z"),
+ wdz >= Datetime64("1900-01-01T03:04:05Z"),
+ wtz >= Datetime64("1900-01-01T03:04:05Z"),
+
+ na >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz >= Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na >= TzDate32("1900-01-01,Europe/Moscow"),
+ naz >= TzDate32("1900-01-01,Europe/Moscow"),
+ nd >= TzDate32("1900-01-01,Europe/Moscow"),
+ ndz >= TzDate32("1900-01-01,Europe/Moscow"),
+ nt >= TzDate32("1900-01-01,Europe/Moscow"),
+ ntz >= TzDate32("1900-01-01,Europe/Moscow"),
+ wa >= TzDate32("1900-01-01,Europe/Moscow"),
+ wd >= TzDate32("1900-01-01,Europe/Moscow"),
+ wt >= TzDate32("1900-01-01,Europe/Moscow"),
+ waz >= TzDate32("1900-01-01,Europe/Moscow"),
+ wdz >= TzDate32("1900-01-01,Europe/Moscow"),
+ wtz >= TzDate32("1900-01-01,Europe/Moscow"),
+
+ na >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz >= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz >= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni >= Interval("P1D"),
+ wi >= Interval("P1D"),
+ ni >= Interval64("P1D"),
+ wi >= Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.sql
new file mode 100644
index 0000000000..b390aab2ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_greater_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") > na,
+ Date("2000-01-01") > naz,
+ Date("2000-01-01") > nd,
+ Date("2000-01-01") > ndz,
+ Date("2000-01-01") > nt,
+ Date("2000-01-01") > ntz,
+ Date("2000-01-01") > wa,
+ Date("2000-01-01") > wd,
+ Date("2000-01-01") > wt,
+ Date("2000-01-01") > waz,
+ Date("2000-01-01") > wdz,
+ Date("2000-01-01") > wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") > na,
+ TzDate("2000-01-01,Europe/Moscow") > naz,
+ TzDate("2000-01-01,Europe/Moscow") > nd,
+ TzDate("2000-01-01,Europe/Moscow") > ndz,
+ TzDate("2000-01-01,Europe/Moscow") > nt,
+ TzDate("2000-01-01,Europe/Moscow") > ntz,
+ TzDate("2000-01-01,Europe/Moscow") > wa,
+ TzDate("2000-01-01,Europe/Moscow") > wd,
+ TzDate("2000-01-01,Europe/Moscow") > wt,
+ TzDate("2000-01-01,Europe/Moscow") > waz,
+ TzDate("2000-01-01,Europe/Moscow") > wdz,
+ TzDate("2000-01-01,Europe/Moscow") > wtz,
+
+ Datetime("2000-01-01T03:04:05Z") > na,
+ Datetime("2000-01-01T03:04:05Z") > naz,
+ Datetime("2000-01-01T03:04:05Z") > nd,
+ Datetime("2000-01-01T03:04:05Z") > ndz,
+ Datetime("2000-01-01T03:04:05Z") > nt,
+ Datetime("2000-01-01T03:04:05Z") > ntz,
+ Datetime("2000-01-01T03:04:05Z") > wa,
+ Datetime("2000-01-01T03:04:05Z") > wd,
+ Datetime("2000-01-01T03:04:05Z") > wt,
+ Datetime("2000-01-01T03:04:05Z") > waz,
+ Datetime("2000-01-01T03:04:05Z") > wdz,
+ Datetime("2000-01-01T03:04:05Z") > wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") > wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") > na,
+ Timestamp("2000-01-01T03:04:05.678912Z") > naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") > nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") > ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") > nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") > ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") > wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") > wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") > wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") > waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") > wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") > wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") > wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") > na,
+ Date32("1900-01-01") > naz,
+ Date32("1900-01-01") > nd,
+ Date32("1900-01-01") > ndz,
+ Date32("1900-01-01") > nt,
+ Date32("1900-01-01") > ntz,
+ Date32("1900-01-01") > wa,
+ Date32("1900-01-01") > wd,
+ Date32("1900-01-01") > wt,
+ Date32("1900-01-01") > waz,
+ Date32("1900-01-01") > wdz,
+ Date32("1900-01-01") > wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") > na,
+ Datetime64("1900-01-01T03:04:05Z") > naz,
+ Datetime64("1900-01-01T03:04:05Z") > nd,
+ Datetime64("1900-01-01T03:04:05Z") > ndz,
+ Datetime64("1900-01-01T03:04:05Z") > nt,
+ Datetime64("1900-01-01T03:04:05Z") > ntz,
+ Datetime64("1900-01-01T03:04:05Z") > wa,
+ Datetime64("1900-01-01T03:04:05Z") > wd,
+ Datetime64("1900-01-01T03:04:05Z") > wt,
+ Datetime64("1900-01-01T03:04:05Z") > waz,
+ Datetime64("1900-01-01T03:04:05Z") > wdz,
+ Datetime64("1900-01-01T03:04:05Z") > wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") > na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") > wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") > na,
+ TzDate32("1900-01-01,Europe/Moscow") > naz,
+ TzDate32("1900-01-01,Europe/Moscow") > nd,
+ TzDate32("1900-01-01,Europe/Moscow") > ndz,
+ TzDate32("1900-01-01,Europe/Moscow") > nt,
+ TzDate32("1900-01-01,Europe/Moscow") > ntz,
+ TzDate32("1900-01-01,Europe/Moscow") > wa,
+ TzDate32("1900-01-01,Europe/Moscow") > wd,
+ TzDate32("1900-01-01,Europe/Moscow") > wt,
+ TzDate32("1900-01-01,Europe/Moscow") > waz,
+ TzDate32("1900-01-01,Europe/Moscow") > wdz,
+ TzDate32("1900-01-01,Europe/Moscow") > wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") > wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") > wtz,
+
+ Interval("P1D") > ni,
+ Interval("P1D") > wi,
+ Interval64("P1D") > ni,
+ Interval64("P1D") > wi,
+FROM Dates;
+
+SELECT
+ na > Date("2000-01-01"),
+ naz > Date("2000-01-01"),
+ nd > Date("2000-01-01"),
+ ndz > Date("2000-01-01"),
+ nt > Date("2000-01-01"),
+ ntz > Date("2000-01-01"),
+ wa > Date("2000-01-01"),
+ wd > Date("2000-01-01"),
+ wt > Date("2000-01-01"),
+ waz > Date("2000-01-01"),
+ wdz > Date("2000-01-01"),
+ wtz > Date("2000-01-01"),
+
+ na > TzDate("2000-01-01,Europe/Moscow"),
+ naz > TzDate("2000-01-01,Europe/Moscow"),
+ nd > TzDate("2000-01-01,Europe/Moscow"),
+ ndz > TzDate("2000-01-01,Europe/Moscow"),
+ nt > TzDate("2000-01-01,Europe/Moscow"),
+ ntz > TzDate("2000-01-01,Europe/Moscow"),
+ wa > TzDate("2000-01-01,Europe/Moscow"),
+ wd > TzDate("2000-01-01,Europe/Moscow"),
+ wt > TzDate("2000-01-01,Europe/Moscow"),
+ waz > TzDate("2000-01-01,Europe/Moscow"),
+ wdz > TzDate("2000-01-01,Europe/Moscow"),
+ wtz > TzDate("2000-01-01,Europe/Moscow"),
+
+ na > Datetime("2000-01-01T03:04:05Z"),
+ naz > Datetime("2000-01-01T03:04:05Z"),
+ nd > Datetime("2000-01-01T03:04:05Z"),
+ ndz > Datetime("2000-01-01T03:04:05Z"),
+ nt > Datetime("2000-01-01T03:04:05Z"),
+ ntz > Datetime("2000-01-01T03:04:05Z"),
+ wa > Datetime("2000-01-01T03:04:05Z"),
+ wd > Datetime("2000-01-01T03:04:05Z"),
+ wt > Datetime("2000-01-01T03:04:05Z"),
+ waz > Datetime("2000-01-01T03:04:05Z"),
+ wdz > Datetime("2000-01-01T03:04:05Z"),
+ wtz > Datetime("2000-01-01T03:04:05Z"),
+
+ na > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz > TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na > Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz > Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd > Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz > Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt > Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz > Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa > Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd > Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt > Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz > Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz > Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz > Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz > TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na > Date32("1900-01-01"),
+ naz > Date32("1900-01-01"),
+ nd > Date32("1900-01-01"),
+ ndz > Date32("1900-01-01"),
+ nt > Date32("1900-01-01"),
+ ntz > Date32("1900-01-01"),
+ wa > Date32("1900-01-01"),
+ wd > Date32("1900-01-01"),
+ wt > Date32("1900-01-01"),
+ waz > Date32("1900-01-01"),
+ wdz > Date32("1900-01-01"),
+ wtz > Date32("1900-01-01"),
+
+ na > Datetime64("1900-01-01T03:04:05Z"),
+ naz > Datetime64("1900-01-01T03:04:05Z"),
+ nd > Datetime64("1900-01-01T03:04:05Z"),
+ ndz > Datetime64("1900-01-01T03:04:05Z"),
+ nt > Datetime64("1900-01-01T03:04:05Z"),
+ ntz > Datetime64("1900-01-01T03:04:05Z"),
+ wa > Datetime64("1900-01-01T03:04:05Z"),
+ wd > Datetime64("1900-01-01T03:04:05Z"),
+ wt > Datetime64("1900-01-01T03:04:05Z"),
+ waz > Datetime64("1900-01-01T03:04:05Z"),
+ wdz > Datetime64("1900-01-01T03:04:05Z"),
+ wtz > Datetime64("1900-01-01T03:04:05Z"),
+
+ na > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz > Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na > TzDate32("1900-01-01,Europe/Moscow"),
+ naz > TzDate32("1900-01-01,Europe/Moscow"),
+ nd > TzDate32("1900-01-01,Europe/Moscow"),
+ ndz > TzDate32("1900-01-01,Europe/Moscow"),
+ nt > TzDate32("1900-01-01,Europe/Moscow"),
+ ntz > TzDate32("1900-01-01,Europe/Moscow"),
+ wa > TzDate32("1900-01-01,Europe/Moscow"),
+ wd > TzDate32("1900-01-01,Europe/Moscow"),
+ wt > TzDate32("1900-01-01,Europe/Moscow"),
+ waz > TzDate32("1900-01-01,Europe/Moscow"),
+ wdz > TzDate32("1900-01-01,Europe/Moscow"),
+ wtz > TzDate32("1900-01-01,Europe/Moscow"),
+
+ na > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz > TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz > TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni > Interval("P1D"),
+ wi > Interval("P1D"),
+ ni > Interval64("P1D"),
+ wi > Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_group_by.cfg b/yql/essentials/tests/sql/suites/blocks/date_group_by.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_group_by.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_group_by.sql b/yql/essentials/tests/sql/suites/blocks/date_group_by.sql
new file mode 100644
index 0000000000..52354c9ea8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_group_by.sql
@@ -0,0 +1,9 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+SELECT
+ count(*),min(i8)
+FROM (SELECT * FROM concat(Dates,Dates)) as t
+GROUP BY na,wa,naz,waz,nd,ndz,wd,wdz,nt,ntz,wt,wtz,ni,wi;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less.cfg b/yql/essentials/tests/sql/suites/blocks/date_less.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less.sql b/yql/essentials/tests/sql/suites/blocks/date_less.sql
new file mode 100644
index 0000000000..7145452b86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na < b.na,
+ a.na < b.naz,
+ a.na < b.nd,
+ a.na < b.ndz,
+ a.na < b.nt,
+ a.na < b.ntz,
+ a.na < b.wa,
+ a.na < b.wd,
+ a.na < b.wt,
+ a.na < b.waz,
+ a.na < b.wdz,
+ a.na < b.wtz,
+
+ a.naz < b.na,
+ a.naz < b.naz,
+ a.naz < b.nd,
+ a.naz < b.ndz,
+ a.naz < b.nt,
+ a.naz < b.ntz,
+ a.naz < b.wa,
+ a.naz < b.wd,
+ a.naz < b.wt,
+ a.naz < b.waz,
+ a.naz < b.wdz,
+ a.naz < b.wtz,
+
+ a.nd < b.na,
+ a.nd < b.naz,
+ a.nd < b.nd,
+ a.nd < b.ndz,
+ a.nd < b.nt,
+ a.nd < b.ntz,
+ a.nd < b.wa,
+ a.nd < b.wd,
+ a.nd < b.wt,
+ a.nd < b.waz,
+ a.nd < b.wdz,
+ a.nd < b.wtz,
+
+ a.ndz < b.na,
+ a.ndz < b.naz,
+ a.ndz < b.nd,
+ a.ndz < b.ndz,
+ a.ndz < b.nt,
+ a.ndz < b.ntz,
+ a.ndz < b.wa,
+ a.ndz < b.wd,
+ a.ndz < b.wt,
+ a.ndz < b.waz,
+ a.ndz < b.wdz,
+ a.ndz < b.wtz,
+
+ a.nt < b.na,
+ a.nt < b.naz,
+ a.nt < b.nd,
+ a.nt < b.ndz,
+ a.nt < b.nt,
+ a.nt < b.ntz,
+ a.nt < b.wa,
+ a.nt < b.wd,
+ a.nt < b.wt,
+ a.nt < b.waz,
+ a.nt < b.wdz,
+ a.nt < b.wtz,
+
+ a.ntz < b.na,
+ a.ntz < b.naz,
+ a.ntz < b.nd,
+ a.ntz < b.ndz,
+ a.ntz < b.nt,
+ a.ntz < b.ntz,
+ a.ntz < b.wa,
+ a.ntz < b.wd,
+ a.ntz < b.wt,
+ a.ntz < b.waz,
+ a.ntz < b.wdz,
+ a.ntz < b.wtz,
+
+ a.ni < b.ni,
+ a.ni < b.wi,
+ a.wi < b.ni,
+ a.wi < b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa < b.na,
+ a.wa < b.naz,
+ a.wa < b.nd,
+ a.wa < b.ndz,
+ a.wa < b.nt,
+ a.wa < b.ntz,
+ a.wa < b.wa,
+ a.wa < b.wd,
+ a.wa < b.wt,
+ a.wa < b.waz,
+ a.wa < b.wdz,
+ a.wa < b.wtz,
+
+ a.wd < b.na,
+ a.wd < b.naz,
+ a.wd < b.nd,
+ a.wd < b.ndz,
+ a.wd < b.nt,
+ a.wd < b.ntz,
+ a.wd < b.wa,
+ a.wd < b.wd,
+ a.wd < b.wt,
+ a.wd < b.waz,
+ a.wd < b.wdz,
+ a.wd < b.wtz,
+
+ a.wt < b.na,
+ a.wt < b.naz,
+ a.wt < b.nd,
+ a.wt < b.ndz,
+ a.wt < b.nt,
+ a.wt < b.ntz,
+ a.wt < b.wa,
+ a.wt < b.wd,
+ a.wt < b.wt,
+ a.wt < b.waz,
+ a.wt < b.wdz,
+ a.wt < b.wtz,
+
+ a.waz < b.na,
+ a.waz < b.naz,
+ a.waz < b.nd,
+ a.waz < b.ndz,
+ a.waz < b.nt,
+ a.waz < b.ntz,
+ a.waz < b.wa,
+ a.waz < b.wd,
+ a.waz < b.wt,
+ a.waz < b.waz,
+ a.waz < b.wdz,
+ a.waz < b.wtz,
+
+ a.wdz < b.na,
+ a.wdz < b.naz,
+ a.wdz < b.nd,
+ a.wdz < b.ndz,
+ a.wdz < b.nt,
+ a.wdz < b.ntz,
+ a.wdz < b.wa,
+ a.wdz < b.wd,
+ a.wdz < b.wt,
+ a.wdz < b.waz,
+ a.wdz < b.wdz,
+ a.wdz < b.wtz,
+
+ a.wtz < b.na,
+ a.wtz < b.naz,
+ a.wtz < b.nd,
+ a.wtz < b.ndz,
+ a.wtz < b.nt,
+ a.wtz < b.ntz,
+ a.wtz < b.wa,
+ a.wtz < b.wd,
+ a.wtz < b.wt,
+ a.wtz < b.waz,
+ a.wtz < b.wdz,
+ a.wtz < b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.cfg b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.sql b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.sql
new file mode 100644
index 0000000000..e0ea714ca5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na <= b.na,
+ a.na <= b.naz,
+ a.na <= b.nd,
+ a.na <= b.ndz,
+ a.na <= b.nt,
+ a.na <= b.ntz,
+ a.na <= b.wa,
+ a.na <= b.wd,
+ a.na <= b.wt,
+ a.na <= b.waz,
+ a.na <= b.wdz,
+ a.na <= b.wtz,
+
+ a.naz <= b.na,
+ a.naz <= b.naz,
+ a.naz <= b.nd,
+ a.naz <= b.ndz,
+ a.naz <= b.nt,
+ a.naz <= b.ntz,
+ a.naz <= b.wa,
+ a.naz <= b.wd,
+ a.naz <= b.wt,
+ a.naz <= b.waz,
+ a.naz <= b.wdz,
+ a.naz <= b.wtz,
+
+ a.nd <= b.na,
+ a.nd <= b.naz,
+ a.nd <= b.nd,
+ a.nd <= b.ndz,
+ a.nd <= b.nt,
+ a.nd <= b.ntz,
+ a.nd <= b.wa,
+ a.nd <= b.wd,
+ a.nd <= b.wt,
+ a.nd <= b.waz,
+ a.nd <= b.wdz,
+ a.nd <= b.wtz,
+
+ a.ndz <= b.na,
+ a.ndz <= b.naz,
+ a.ndz <= b.nd,
+ a.ndz <= b.ndz,
+ a.ndz <= b.nt,
+ a.ndz <= b.ntz,
+ a.ndz <= b.wa,
+ a.ndz <= b.wd,
+ a.ndz <= b.wt,
+ a.ndz <= b.waz,
+ a.ndz <= b.wdz,
+ a.ndz <= b.wtz,
+
+ a.nt <= b.na,
+ a.nt <= b.naz,
+ a.nt <= b.nd,
+ a.nt <= b.ndz,
+ a.nt <= b.nt,
+ a.nt <= b.ntz,
+ a.nt <= b.wa,
+ a.nt <= b.wd,
+ a.nt <= b.wt,
+ a.nt <= b.waz,
+ a.nt <= b.wdz,
+ a.nt <= b.wtz,
+
+ a.ntz <= b.na,
+ a.ntz <= b.naz,
+ a.ntz <= b.nd,
+ a.ntz <= b.ndz,
+ a.ntz <= b.nt,
+ a.ntz <= b.ntz,
+ a.ntz <= b.wa,
+ a.ntz <= b.wd,
+ a.ntz <= b.wt,
+ a.ntz <= b.waz,
+ a.ntz <= b.wdz,
+ a.ntz <= b.wtz,
+
+ a.ni <= b.ni,
+ a.ni <= b.wi,
+ a.wi <= b.ni,
+ a.wi <= b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa <= b.na,
+ a.wa <= b.naz,
+ a.wa <= b.nd,
+ a.wa <= b.ndz,
+ a.wa <= b.nt,
+ a.wa <= b.ntz,
+ a.wa <= b.wa,
+ a.wa <= b.wd,
+ a.wa <= b.wt,
+ a.wa <= b.waz,
+ a.wa <= b.wdz,
+ a.wa <= b.wtz,
+
+ a.wd <= b.na,
+ a.wd <= b.naz,
+ a.wd <= b.nd,
+ a.wd <= b.ndz,
+ a.wd <= b.nt,
+ a.wd <= b.ntz,
+ a.wd <= b.wa,
+ a.wd <= b.wd,
+ a.wd <= b.wt,
+ a.wd <= b.waz,
+ a.wd <= b.wdz,
+ a.wd <= b.wtz,
+
+ a.wt <= b.na,
+ a.wt <= b.naz,
+ a.wt <= b.nd,
+ a.wt <= b.ndz,
+ a.wt <= b.nt,
+ a.wt <= b.ntz,
+ a.wt <= b.wa,
+ a.wt <= b.wd,
+ a.wt <= b.wt,
+ a.wt <= b.waz,
+ a.wt <= b.wdz,
+ a.wt <= b.wtz,
+
+ a.waz <= b.na,
+ a.waz <= b.naz,
+ a.waz <= b.nd,
+ a.waz <= b.ndz,
+ a.waz <= b.nt,
+ a.waz <= b.ntz,
+ a.waz <= b.wa,
+ a.waz <= b.wd,
+ a.waz <= b.wt,
+ a.waz <= b.waz,
+ a.waz <= b.wdz,
+ a.waz <= b.wtz,
+
+ a.wdz <= b.na,
+ a.wdz <= b.naz,
+ a.wdz <= b.nd,
+ a.wdz <= b.ndz,
+ a.wdz <= b.nt,
+ a.wdz <= b.ntz,
+ a.wdz <= b.wa,
+ a.wdz <= b.wd,
+ a.wdz <= b.wt,
+ a.wdz <= b.waz,
+ a.wdz <= b.wdz,
+ a.wdz <= b.wtz,
+
+ a.wtz <= b.na,
+ a.wtz <= b.naz,
+ a.wtz <= b.nd,
+ a.wtz <= b.ndz,
+ a.wtz <= b.nt,
+ a.wtz <= b.ntz,
+ a.wtz <= b.wa,
+ a.wtz <= b.wd,
+ a.wtz <= b.wt,
+ a.wtz <= b.waz,
+ a.wtz <= b.wdz,
+ a.wtz <= b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.sql
new file mode 100644
index 0000000000..2f2db17af9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_or_equal_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") <= na,
+ Date("2000-01-01") <= naz,
+ Date("2000-01-01") <= nd,
+ Date("2000-01-01") <= ndz,
+ Date("2000-01-01") <= nt,
+ Date("2000-01-01") <= ntz,
+ Date("2000-01-01") <= wa,
+ Date("2000-01-01") <= wd,
+ Date("2000-01-01") <= wt,
+ Date("2000-01-01") <= waz,
+ Date("2000-01-01") <= wdz,
+ Date("2000-01-01") <= wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") <= na,
+ TzDate("2000-01-01,Europe/Moscow") <= naz,
+ TzDate("2000-01-01,Europe/Moscow") <= nd,
+ TzDate("2000-01-01,Europe/Moscow") <= ndz,
+ TzDate("2000-01-01,Europe/Moscow") <= nt,
+ TzDate("2000-01-01,Europe/Moscow") <= ntz,
+ TzDate("2000-01-01,Europe/Moscow") <= wa,
+ TzDate("2000-01-01,Europe/Moscow") <= wd,
+ TzDate("2000-01-01,Europe/Moscow") <= wt,
+ TzDate("2000-01-01,Europe/Moscow") <= waz,
+ TzDate("2000-01-01,Europe/Moscow") <= wdz,
+ TzDate("2000-01-01,Europe/Moscow") <= wtz,
+
+ Datetime("2000-01-01T03:04:05Z") <= na,
+ Datetime("2000-01-01T03:04:05Z") <= naz,
+ Datetime("2000-01-01T03:04:05Z") <= nd,
+ Datetime("2000-01-01T03:04:05Z") <= ndz,
+ Datetime("2000-01-01T03:04:05Z") <= nt,
+ Datetime("2000-01-01T03:04:05Z") <= ntz,
+ Datetime("2000-01-01T03:04:05Z") <= wa,
+ Datetime("2000-01-01T03:04:05Z") <= wd,
+ Datetime("2000-01-01T03:04:05Z") <= wt,
+ Datetime("2000-01-01T03:04:05Z") <= waz,
+ Datetime("2000-01-01T03:04:05Z") <= wdz,
+ Datetime("2000-01-01T03:04:05Z") <= wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") <= wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") <= na,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") <= wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") <= wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") <= na,
+ Date32("1900-01-01") <= naz,
+ Date32("1900-01-01") <= nd,
+ Date32("1900-01-01") <= ndz,
+ Date32("1900-01-01") <= nt,
+ Date32("1900-01-01") <= ntz,
+ Date32("1900-01-01") <= wa,
+ Date32("1900-01-01") <= wd,
+ Date32("1900-01-01") <= wt,
+ Date32("1900-01-01") <= waz,
+ Date32("1900-01-01") <= wdz,
+ Date32("1900-01-01") <= wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") <= na,
+ Datetime64("1900-01-01T03:04:05Z") <= naz,
+ Datetime64("1900-01-01T03:04:05Z") <= nd,
+ Datetime64("1900-01-01T03:04:05Z") <= ndz,
+ Datetime64("1900-01-01T03:04:05Z") <= nt,
+ Datetime64("1900-01-01T03:04:05Z") <= ntz,
+ Datetime64("1900-01-01T03:04:05Z") <= wa,
+ Datetime64("1900-01-01T03:04:05Z") <= wd,
+ Datetime64("1900-01-01T03:04:05Z") <= wt,
+ Datetime64("1900-01-01T03:04:05Z") <= waz,
+ Datetime64("1900-01-01T03:04:05Z") <= wdz,
+ Datetime64("1900-01-01T03:04:05Z") <= wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") <= wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") <= na,
+ TzDate32("1900-01-01,Europe/Moscow") <= naz,
+ TzDate32("1900-01-01,Europe/Moscow") <= nd,
+ TzDate32("1900-01-01,Europe/Moscow") <= ndz,
+ TzDate32("1900-01-01,Europe/Moscow") <= nt,
+ TzDate32("1900-01-01,Europe/Moscow") <= ntz,
+ TzDate32("1900-01-01,Europe/Moscow") <= wa,
+ TzDate32("1900-01-01,Europe/Moscow") <= wd,
+ TzDate32("1900-01-01,Europe/Moscow") <= wt,
+ TzDate32("1900-01-01,Europe/Moscow") <= waz,
+ TzDate32("1900-01-01,Europe/Moscow") <= wdz,
+ TzDate32("1900-01-01,Europe/Moscow") <= wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") <= wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") <= wtz,
+
+ Interval("P1D") <= ni,
+ Interval("P1D") <= wi,
+ Interval64("P1D") <= ni,
+ Interval64("P1D") <= wi,
+FROM Dates;
+
+SELECT
+ na <= Date("2000-01-01"),
+ naz <= Date("2000-01-01"),
+ nd <= Date("2000-01-01"),
+ ndz <= Date("2000-01-01"),
+ nt <= Date("2000-01-01"),
+ ntz <= Date("2000-01-01"),
+ wa <= Date("2000-01-01"),
+ wd <= Date("2000-01-01"),
+ wt <= Date("2000-01-01"),
+ waz <= Date("2000-01-01"),
+ wdz <= Date("2000-01-01"),
+ wtz <= Date("2000-01-01"),
+
+ na <= TzDate("2000-01-01,Europe/Moscow"),
+ naz <= TzDate("2000-01-01,Europe/Moscow"),
+ nd <= TzDate("2000-01-01,Europe/Moscow"),
+ ndz <= TzDate("2000-01-01,Europe/Moscow"),
+ nt <= TzDate("2000-01-01,Europe/Moscow"),
+ ntz <= TzDate("2000-01-01,Europe/Moscow"),
+ wa <= TzDate("2000-01-01,Europe/Moscow"),
+ wd <= TzDate("2000-01-01,Europe/Moscow"),
+ wt <= TzDate("2000-01-01,Europe/Moscow"),
+ waz <= TzDate("2000-01-01,Europe/Moscow"),
+ wdz <= TzDate("2000-01-01,Europe/Moscow"),
+ wtz <= TzDate("2000-01-01,Europe/Moscow"),
+
+ na <= Datetime("2000-01-01T03:04:05Z"),
+ naz <= Datetime("2000-01-01T03:04:05Z"),
+ nd <= Datetime("2000-01-01T03:04:05Z"),
+ ndz <= Datetime("2000-01-01T03:04:05Z"),
+ nt <= Datetime("2000-01-01T03:04:05Z"),
+ ntz <= Datetime("2000-01-01T03:04:05Z"),
+ wa <= Datetime("2000-01-01T03:04:05Z"),
+ wd <= Datetime("2000-01-01T03:04:05Z"),
+ wt <= Datetime("2000-01-01T03:04:05Z"),
+ waz <= Datetime("2000-01-01T03:04:05Z"),
+ wdz <= Datetime("2000-01-01T03:04:05Z"),
+ wtz <= Datetime("2000-01-01T03:04:05Z"),
+
+ na <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz <= TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz <= Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz <= TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na <= Date32("1900-01-01"),
+ naz <= Date32("1900-01-01"),
+ nd <= Date32("1900-01-01"),
+ ndz <= Date32("1900-01-01"),
+ nt <= Date32("1900-01-01"),
+ ntz <= Date32("1900-01-01"),
+ wa <= Date32("1900-01-01"),
+ wd <= Date32("1900-01-01"),
+ wt <= Date32("1900-01-01"),
+ waz <= Date32("1900-01-01"),
+ wdz <= Date32("1900-01-01"),
+ wtz <= Date32("1900-01-01"),
+
+ na <= Datetime64("1900-01-01T03:04:05Z"),
+ naz <= Datetime64("1900-01-01T03:04:05Z"),
+ nd <= Datetime64("1900-01-01T03:04:05Z"),
+ ndz <= Datetime64("1900-01-01T03:04:05Z"),
+ nt <= Datetime64("1900-01-01T03:04:05Z"),
+ ntz <= Datetime64("1900-01-01T03:04:05Z"),
+ wa <= Datetime64("1900-01-01T03:04:05Z"),
+ wd <= Datetime64("1900-01-01T03:04:05Z"),
+ wt <= Datetime64("1900-01-01T03:04:05Z"),
+ waz <= Datetime64("1900-01-01T03:04:05Z"),
+ wdz <= Datetime64("1900-01-01T03:04:05Z"),
+ wtz <= Datetime64("1900-01-01T03:04:05Z"),
+
+ na <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz <= Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na <= TzDate32("1900-01-01,Europe/Moscow"),
+ naz <= TzDate32("1900-01-01,Europe/Moscow"),
+ nd <= TzDate32("1900-01-01,Europe/Moscow"),
+ ndz <= TzDate32("1900-01-01,Europe/Moscow"),
+ nt <= TzDate32("1900-01-01,Europe/Moscow"),
+ ntz <= TzDate32("1900-01-01,Europe/Moscow"),
+ wa <= TzDate32("1900-01-01,Europe/Moscow"),
+ wd <= TzDate32("1900-01-01,Europe/Moscow"),
+ wt <= TzDate32("1900-01-01,Europe/Moscow"),
+ waz <= TzDate32("1900-01-01,Europe/Moscow"),
+ wdz <= TzDate32("1900-01-01,Europe/Moscow"),
+ wtz <= TzDate32("1900-01-01,Europe/Moscow"),
+
+ na <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz <= TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz <= TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni <= Interval("P1D"),
+ wi <= Interval("P1D"),
+ ni <= Interval64("P1D"),
+ wi <= Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_less_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_less_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_less_scalar.sql
new file mode 100644
index 0000000000..d62f54d430
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_less_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") < na,
+ Date("2000-01-01") < naz,
+ Date("2000-01-01") < nd,
+ Date("2000-01-01") < ndz,
+ Date("2000-01-01") < nt,
+ Date("2000-01-01") < ntz,
+ Date("2000-01-01") < wa,
+ Date("2000-01-01") < wd,
+ Date("2000-01-01") < wt,
+ Date("2000-01-01") < waz,
+ Date("2000-01-01") < wdz,
+ Date("2000-01-01") < wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") < na,
+ TzDate("2000-01-01,Europe/Moscow") < naz,
+ TzDate("2000-01-01,Europe/Moscow") < nd,
+ TzDate("2000-01-01,Europe/Moscow") < ndz,
+ TzDate("2000-01-01,Europe/Moscow") < nt,
+ TzDate("2000-01-01,Europe/Moscow") < ntz,
+ TzDate("2000-01-01,Europe/Moscow") < wa,
+ TzDate("2000-01-01,Europe/Moscow") < wd,
+ TzDate("2000-01-01,Europe/Moscow") < wt,
+ TzDate("2000-01-01,Europe/Moscow") < waz,
+ TzDate("2000-01-01,Europe/Moscow") < wdz,
+ TzDate("2000-01-01,Europe/Moscow") < wtz,
+
+ Datetime("2000-01-01T03:04:05Z") < na,
+ Datetime("2000-01-01T03:04:05Z") < naz,
+ Datetime("2000-01-01T03:04:05Z") < nd,
+ Datetime("2000-01-01T03:04:05Z") < ndz,
+ Datetime("2000-01-01T03:04:05Z") < nt,
+ Datetime("2000-01-01T03:04:05Z") < ntz,
+ Datetime("2000-01-01T03:04:05Z") < wa,
+ Datetime("2000-01-01T03:04:05Z") < wd,
+ Datetime("2000-01-01T03:04:05Z") < wt,
+ Datetime("2000-01-01T03:04:05Z") < waz,
+ Datetime("2000-01-01T03:04:05Z") < wdz,
+ Datetime("2000-01-01T03:04:05Z") < wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") < wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") < na,
+ Timestamp("2000-01-01T03:04:05.678912Z") < naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") < nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") < ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") < nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") < ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") < wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") < wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") < wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") < waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") < wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") < wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") < wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") < na,
+ Date32("1900-01-01") < naz,
+ Date32("1900-01-01") < nd,
+ Date32("1900-01-01") < ndz,
+ Date32("1900-01-01") < nt,
+ Date32("1900-01-01") < ntz,
+ Date32("1900-01-01") < wa,
+ Date32("1900-01-01") < wd,
+ Date32("1900-01-01") < wt,
+ Date32("1900-01-01") < waz,
+ Date32("1900-01-01") < wdz,
+ Date32("1900-01-01") < wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") < na,
+ Datetime64("1900-01-01T03:04:05Z") < naz,
+ Datetime64("1900-01-01T03:04:05Z") < nd,
+ Datetime64("1900-01-01T03:04:05Z") < ndz,
+ Datetime64("1900-01-01T03:04:05Z") < nt,
+ Datetime64("1900-01-01T03:04:05Z") < ntz,
+ Datetime64("1900-01-01T03:04:05Z") < wa,
+ Datetime64("1900-01-01T03:04:05Z") < wd,
+ Datetime64("1900-01-01T03:04:05Z") < wt,
+ Datetime64("1900-01-01T03:04:05Z") < waz,
+ Datetime64("1900-01-01T03:04:05Z") < wdz,
+ Datetime64("1900-01-01T03:04:05Z") < wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") < na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") < wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") < na,
+ TzDate32("1900-01-01,Europe/Moscow") < naz,
+ TzDate32("1900-01-01,Europe/Moscow") < nd,
+ TzDate32("1900-01-01,Europe/Moscow") < ndz,
+ TzDate32("1900-01-01,Europe/Moscow") < nt,
+ TzDate32("1900-01-01,Europe/Moscow") < ntz,
+ TzDate32("1900-01-01,Europe/Moscow") < wa,
+ TzDate32("1900-01-01,Europe/Moscow") < wd,
+ TzDate32("1900-01-01,Europe/Moscow") < wt,
+ TzDate32("1900-01-01,Europe/Moscow") < waz,
+ TzDate32("1900-01-01,Europe/Moscow") < wdz,
+ TzDate32("1900-01-01,Europe/Moscow") < wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") < wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") < wtz,
+
+ Interval("P1D") < ni,
+ Interval("P1D") < wi,
+ Interval64("P1D") < ni,
+ Interval64("P1D") < wi,
+FROM Dates;
+
+SELECT
+ na < Date("2000-01-01"),
+ naz < Date("2000-01-01"),
+ nd < Date("2000-01-01"),
+ ndz < Date("2000-01-01"),
+ nt < Date("2000-01-01"),
+ ntz < Date("2000-01-01"),
+ wa < Date("2000-01-01"),
+ wd < Date("2000-01-01"),
+ wt < Date("2000-01-01"),
+ waz < Date("2000-01-01"),
+ wdz < Date("2000-01-01"),
+ wtz < Date("2000-01-01"),
+
+ na < TzDate("2000-01-01,Europe/Moscow"),
+ naz < TzDate("2000-01-01,Europe/Moscow"),
+ nd < TzDate("2000-01-01,Europe/Moscow"),
+ ndz < TzDate("2000-01-01,Europe/Moscow"),
+ nt < TzDate("2000-01-01,Europe/Moscow"),
+ ntz < TzDate("2000-01-01,Europe/Moscow"),
+ wa < TzDate("2000-01-01,Europe/Moscow"),
+ wd < TzDate("2000-01-01,Europe/Moscow"),
+ wt < TzDate("2000-01-01,Europe/Moscow"),
+ waz < TzDate("2000-01-01,Europe/Moscow"),
+ wdz < TzDate("2000-01-01,Europe/Moscow"),
+ wtz < TzDate("2000-01-01,Europe/Moscow"),
+
+ na < Datetime("2000-01-01T03:04:05Z"),
+ naz < Datetime("2000-01-01T03:04:05Z"),
+ nd < Datetime("2000-01-01T03:04:05Z"),
+ ndz < Datetime("2000-01-01T03:04:05Z"),
+ nt < Datetime("2000-01-01T03:04:05Z"),
+ ntz < Datetime("2000-01-01T03:04:05Z"),
+ wa < Datetime("2000-01-01T03:04:05Z"),
+ wd < Datetime("2000-01-01T03:04:05Z"),
+ wt < Datetime("2000-01-01T03:04:05Z"),
+ waz < Datetime("2000-01-01T03:04:05Z"),
+ wdz < Datetime("2000-01-01T03:04:05Z"),
+ wtz < Datetime("2000-01-01T03:04:05Z"),
+
+ na < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz < TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na < Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz < Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd < Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz < Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt < Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz < Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa < Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd < Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt < Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz < Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz < Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz < Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz < TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na < Date32("1900-01-01"),
+ naz < Date32("1900-01-01"),
+ nd < Date32("1900-01-01"),
+ ndz < Date32("1900-01-01"),
+ nt < Date32("1900-01-01"),
+ ntz < Date32("1900-01-01"),
+ wa < Date32("1900-01-01"),
+ wd < Date32("1900-01-01"),
+ wt < Date32("1900-01-01"),
+ waz < Date32("1900-01-01"),
+ wdz < Date32("1900-01-01"),
+ wtz < Date32("1900-01-01"),
+
+ na < Datetime64("1900-01-01T03:04:05Z"),
+ naz < Datetime64("1900-01-01T03:04:05Z"),
+ nd < Datetime64("1900-01-01T03:04:05Z"),
+ ndz < Datetime64("1900-01-01T03:04:05Z"),
+ nt < Datetime64("1900-01-01T03:04:05Z"),
+ ntz < Datetime64("1900-01-01T03:04:05Z"),
+ wa < Datetime64("1900-01-01T03:04:05Z"),
+ wd < Datetime64("1900-01-01T03:04:05Z"),
+ wt < Datetime64("1900-01-01T03:04:05Z"),
+ waz < Datetime64("1900-01-01T03:04:05Z"),
+ wdz < Datetime64("1900-01-01T03:04:05Z"),
+ wtz < Datetime64("1900-01-01T03:04:05Z"),
+
+ na < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz < Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na < TzDate32("1900-01-01,Europe/Moscow"),
+ naz < TzDate32("1900-01-01,Europe/Moscow"),
+ nd < TzDate32("1900-01-01,Europe/Moscow"),
+ ndz < TzDate32("1900-01-01,Europe/Moscow"),
+ nt < TzDate32("1900-01-01,Europe/Moscow"),
+ ntz < TzDate32("1900-01-01,Europe/Moscow"),
+ wa < TzDate32("1900-01-01,Europe/Moscow"),
+ wd < TzDate32("1900-01-01,Europe/Moscow"),
+ wt < TzDate32("1900-01-01,Europe/Moscow"),
+ waz < TzDate32("1900-01-01,Europe/Moscow"),
+ wdz < TzDate32("1900-01-01,Europe/Moscow"),
+ wtz < TzDate32("1900-01-01,Europe/Moscow"),
+
+ na < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz < TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz < TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni < Interval("P1D"),
+ wi < Interval("P1D"),
+ ni < Interval64("P1D"),
+ wi < Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_not_equals.cfg b/yql/essentials/tests/sql/suites/blocks/date_not_equals.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_not_equals.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_not_equals.sql b/yql/essentials/tests/sql/suites/blocks/date_not_equals.sql
new file mode 100644
index 0000000000..098dbd0d58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_not_equals.sql
@@ -0,0 +1,169 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na != b.na,
+ a.na != b.naz,
+ a.na != b.nd,
+ a.na != b.ndz,
+ a.na != b.nt,
+ a.na != b.ntz,
+ a.na != b.wa,
+ a.na != b.wd,
+ a.na != b.wt,
+ a.na != b.waz,
+ a.na != b.wdz,
+ a.na != b.wtz,
+
+ a.naz != b.na,
+ a.naz != b.naz,
+ a.naz != b.nd,
+ a.naz != b.ndz,
+ a.naz != b.nt,
+ a.naz != b.ntz,
+ a.naz != b.wa,
+ a.naz != b.wd,
+ a.naz != b.wt,
+ a.naz != b.waz,
+ a.naz != b.wdz,
+ a.naz != b.wtz,
+
+ a.nd != b.na,
+ a.nd != b.naz,
+ a.nd != b.nd,
+ a.nd != b.ndz,
+ a.nd != b.nt,
+ a.nd != b.ntz,
+ a.nd != b.wa,
+ a.nd != b.wd,
+ a.nd != b.wt,
+ a.nd != b.waz,
+ a.nd != b.wdz,
+ a.nd != b.wtz,
+
+ a.ndz != b.na,
+ a.ndz != b.naz,
+ a.ndz != b.nd,
+ a.ndz != b.ndz,
+ a.ndz != b.nt,
+ a.ndz != b.ntz,
+ a.ndz != b.wa,
+ a.ndz != b.wd,
+ a.ndz != b.wt,
+ a.ndz != b.waz,
+ a.ndz != b.wdz,
+ a.ndz != b.wtz,
+
+ a.nt != b.na,
+ a.nt != b.naz,
+ a.nt != b.nd,
+ a.nt != b.ndz,
+ a.nt != b.nt,
+ a.nt != b.ntz,
+ a.nt != b.wa,
+ a.nt != b.wd,
+ a.nt != b.wt,
+ a.nt != b.waz,
+ a.nt != b.wdz,
+ a.nt != b.wtz,
+
+ a.ntz != b.na,
+ a.ntz != b.naz,
+ a.ntz != b.nd,
+ a.ntz != b.ndz,
+ a.ntz != b.nt,
+ a.ntz != b.ntz,
+ a.ntz != b.wa,
+ a.ntz != b.wd,
+ a.ntz != b.wt,
+ a.ntz != b.waz,
+ a.ntz != b.wdz,
+ a.ntz != b.wtz,
+
+ a.ni != b.ni,
+ a.ni != b.wi,
+ a.wi != b.ni,
+ a.wi != b.wi
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa != b.na,
+ a.wa != b.naz,
+ a.wa != b.nd,
+ a.wa != b.ndz,
+ a.wa != b.nt,
+ a.wa != b.ntz,
+ a.wa != b.wa,
+ a.wa != b.wd,
+ a.wa != b.wt,
+ a.wa != b.waz,
+ a.wa != b.wdz,
+ a.wa != b.wtz,
+
+ a.wd != b.na,
+ a.wd != b.naz,
+ a.wd != b.nd,
+ a.wd != b.ndz,
+ a.wd != b.nt,
+ a.wd != b.ntz,
+ a.wd != b.wa,
+ a.wd != b.wd,
+ a.wd != b.wt,
+ a.wd != b.waz,
+ a.wd != b.wdz,
+ a.wd != b.wtz,
+
+ a.wt != b.na,
+ a.wt != b.naz,
+ a.wt != b.nd,
+ a.wt != b.ndz,
+ a.wt != b.nt,
+ a.wt != b.ntz,
+ a.wt != b.wa,
+ a.wt != b.wd,
+ a.wt != b.wt,
+ a.wt != b.waz,
+ a.wt != b.wdz,
+ a.wt != b.wtz,
+
+ a.waz != b.na,
+ a.waz != b.naz,
+ a.waz != b.nd,
+ a.waz != b.ndz,
+ a.waz != b.nt,
+ a.waz != b.ntz,
+ a.waz != b.wa,
+ a.waz != b.wd,
+ a.waz != b.wt,
+ a.waz != b.waz,
+ a.waz != b.wdz,
+ a.waz != b.wtz,
+
+ a.wdz != b.na,
+ a.wdz != b.naz,
+ a.wdz != b.nd,
+ a.wdz != b.ndz,
+ a.wdz != b.nt,
+ a.wdz != b.ntz,
+ a.wdz != b.wa,
+ a.wdz != b.wd,
+ a.wdz != b.wt,
+ a.wdz != b.waz,
+ a.wdz != b.wdz,
+ a.wdz != b.wtz,
+
+ a.wtz != b.na,
+ a.wtz != b.naz,
+ a.wtz != b.nd,
+ a.wtz != b.ndz,
+ a.wtz != b.nt,
+ a.wtz != b.ntz,
+ a.wtz != b.wa,
+ a.wtz != b.wd,
+ a.wtz != b.wt,
+ a.wtz != b.waz,
+ a.wtz != b.wdz,
+ a.wtz != b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.sql
new file mode 100644
index 0000000000..803fcc49ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_not_equals_scalar.sql
@@ -0,0 +1,332 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") != na,
+ Date("2000-01-01") != naz,
+ Date("2000-01-01") != nd,
+ Date("2000-01-01") != ndz,
+ Date("2000-01-01") != nt,
+ Date("2000-01-01") != ntz,
+ Date("2000-01-01") != wa,
+ Date("2000-01-01") != wd,
+ Date("2000-01-01") != wt,
+ Date("2000-01-01") != waz,
+ Date("2000-01-01") != wdz,
+ Date("2000-01-01") != wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") != na,
+ TzDate("2000-01-01,Europe/Moscow") != naz,
+ TzDate("2000-01-01,Europe/Moscow") != nd,
+ TzDate("2000-01-01,Europe/Moscow") != ndz,
+ TzDate("2000-01-01,Europe/Moscow") != nt,
+ TzDate("2000-01-01,Europe/Moscow") != ntz,
+ TzDate("2000-01-01,Europe/Moscow") != wa,
+ TzDate("2000-01-01,Europe/Moscow") != wd,
+ TzDate("2000-01-01,Europe/Moscow") != wt,
+ TzDate("2000-01-01,Europe/Moscow") != waz,
+ TzDate("2000-01-01,Europe/Moscow") != wdz,
+ TzDate("2000-01-01,Europe/Moscow") != wtz,
+
+ Datetime("2000-01-01T03:04:05Z") != na,
+ Datetime("2000-01-01T03:04:05Z") != naz,
+ Datetime("2000-01-01T03:04:05Z") != nd,
+ Datetime("2000-01-01T03:04:05Z") != ndz,
+ Datetime("2000-01-01T03:04:05Z") != nt,
+ Datetime("2000-01-01T03:04:05Z") != ntz,
+ Datetime("2000-01-01T03:04:05Z") != wa,
+ Datetime("2000-01-01T03:04:05Z") != wd,
+ Datetime("2000-01-01T03:04:05Z") != wt,
+ Datetime("2000-01-01T03:04:05Z") != waz,
+ Datetime("2000-01-01T03:04:05Z") != wdz,
+ Datetime("2000-01-01T03:04:05Z") != wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") != wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") != na,
+ Timestamp("2000-01-01T03:04:05.678912Z") != naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") != nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") != ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") != nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") != ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") != wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") != wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") != wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") != waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") != wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") != wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") != wtz
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") != na,
+ Date32("1900-01-01") != naz,
+ Date32("1900-01-01") != nd,
+ Date32("1900-01-01") != ndz,
+ Date32("1900-01-01") != nt,
+ Date32("1900-01-01") != ntz,
+ Date32("1900-01-01") != wa,
+ Date32("1900-01-01") != wd,
+ Date32("1900-01-01") != wt,
+ Date32("1900-01-01") != waz,
+ Date32("1900-01-01") != wdz,
+ Date32("1900-01-01") != wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") != na,
+ Datetime64("1900-01-01T03:04:05Z") != naz,
+ Datetime64("1900-01-01T03:04:05Z") != nd,
+ Datetime64("1900-01-01T03:04:05Z") != ndz,
+ Datetime64("1900-01-01T03:04:05Z") != nt,
+ Datetime64("1900-01-01T03:04:05Z") != ntz,
+ Datetime64("1900-01-01T03:04:05Z") != wa,
+ Datetime64("1900-01-01T03:04:05Z") != wd,
+ Datetime64("1900-01-01T03:04:05Z") != wt,
+ Datetime64("1900-01-01T03:04:05Z") != waz,
+ Datetime64("1900-01-01T03:04:05Z") != wdz,
+ Datetime64("1900-01-01T03:04:05Z") != wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") != na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") != wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") != na,
+ TzDate32("1900-01-01,Europe/Moscow") != naz,
+ TzDate32("1900-01-01,Europe/Moscow") != nd,
+ TzDate32("1900-01-01,Europe/Moscow") != ndz,
+ TzDate32("1900-01-01,Europe/Moscow") != nt,
+ TzDate32("1900-01-01,Europe/Moscow") != ntz,
+ TzDate32("1900-01-01,Europe/Moscow") != wa,
+ TzDate32("1900-01-01,Europe/Moscow") != wd,
+ TzDate32("1900-01-01,Europe/Moscow") != wt,
+ TzDate32("1900-01-01,Europe/Moscow") != waz,
+ TzDate32("1900-01-01,Europe/Moscow") != wdz,
+ TzDate32("1900-01-01,Europe/Moscow") != wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") != wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") != wtz,
+
+ Interval("P1D") != ni,
+ Interval("P1D") != wi,
+ Interval64("P1D") != ni,
+ Interval64("P1D") != wi,
+FROM Dates;
+
+SELECT
+ na != Date("2000-01-01"),
+ naz != Date("2000-01-01"),
+ nd != Date("2000-01-01"),
+ ndz != Date("2000-01-01"),
+ nt != Date("2000-01-01"),
+ ntz != Date("2000-01-01"),
+ wa != Date("2000-01-01"),
+ wd != Date("2000-01-01"),
+ wt != Date("2000-01-01"),
+ waz != Date("2000-01-01"),
+ wdz != Date("2000-01-01"),
+ wtz != Date("2000-01-01"),
+
+ na != TzDate("2000-01-01,Europe/Moscow"),
+ naz != TzDate("2000-01-01,Europe/Moscow"),
+ nd != TzDate("2000-01-01,Europe/Moscow"),
+ ndz != TzDate("2000-01-01,Europe/Moscow"),
+ nt != TzDate("2000-01-01,Europe/Moscow"),
+ ntz != TzDate("2000-01-01,Europe/Moscow"),
+ wa != TzDate("2000-01-01,Europe/Moscow"),
+ wd != TzDate("2000-01-01,Europe/Moscow"),
+ wt != TzDate("2000-01-01,Europe/Moscow"),
+ waz != TzDate("2000-01-01,Europe/Moscow"),
+ wdz != TzDate("2000-01-01,Europe/Moscow"),
+ wtz != TzDate("2000-01-01,Europe/Moscow"),
+
+ na != Datetime("2000-01-01T03:04:05Z"),
+ naz != Datetime("2000-01-01T03:04:05Z"),
+ nd != Datetime("2000-01-01T03:04:05Z"),
+ ndz != Datetime("2000-01-01T03:04:05Z"),
+ nt != Datetime("2000-01-01T03:04:05Z"),
+ ntz != Datetime("2000-01-01T03:04:05Z"),
+ wa != Datetime("2000-01-01T03:04:05Z"),
+ wd != Datetime("2000-01-01T03:04:05Z"),
+ wt != Datetime("2000-01-01T03:04:05Z"),
+ waz != Datetime("2000-01-01T03:04:05Z"),
+ wdz != Datetime("2000-01-01T03:04:05Z"),
+ wtz != Datetime("2000-01-01T03:04:05Z"),
+
+ na != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz != TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na != Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz != Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd != Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz != Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt != Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz != Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa != Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd != Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt != Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz != Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz != Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz != Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz != TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow")
+FROM Dates;
+
+SELECT
+ na != Date32("1900-01-01"),
+ naz != Date32("1900-01-01"),
+ nd != Date32("1900-01-01"),
+ ndz != Date32("1900-01-01"),
+ nt != Date32("1900-01-01"),
+ ntz != Date32("1900-01-01"),
+ wa != Date32("1900-01-01"),
+ wd != Date32("1900-01-01"),
+ wt != Date32("1900-01-01"),
+ waz != Date32("1900-01-01"),
+ wdz != Date32("1900-01-01"),
+ wtz != Date32("1900-01-01"),
+
+ na != Datetime64("1900-01-01T03:04:05Z"),
+ naz != Datetime64("1900-01-01T03:04:05Z"),
+ nd != Datetime64("1900-01-01T03:04:05Z"),
+ ndz != Datetime64("1900-01-01T03:04:05Z"),
+ nt != Datetime64("1900-01-01T03:04:05Z"),
+ ntz != Datetime64("1900-01-01T03:04:05Z"),
+ wa != Datetime64("1900-01-01T03:04:05Z"),
+ wd != Datetime64("1900-01-01T03:04:05Z"),
+ wt != Datetime64("1900-01-01T03:04:05Z"),
+ waz != Datetime64("1900-01-01T03:04:05Z"),
+ wdz != Datetime64("1900-01-01T03:04:05Z"),
+ wtz != Datetime64("1900-01-01T03:04:05Z"),
+
+ na != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz != Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na != TzDate32("1900-01-01,Europe/Moscow"),
+ naz != TzDate32("1900-01-01,Europe/Moscow"),
+ nd != TzDate32("1900-01-01,Europe/Moscow"),
+ ndz != TzDate32("1900-01-01,Europe/Moscow"),
+ nt != TzDate32("1900-01-01,Europe/Moscow"),
+ ntz != TzDate32("1900-01-01,Europe/Moscow"),
+ wa != TzDate32("1900-01-01,Europe/Moscow"),
+ wd != TzDate32("1900-01-01,Europe/Moscow"),
+ wt != TzDate32("1900-01-01,Europe/Moscow"),
+ waz != TzDate32("1900-01-01,Europe/Moscow"),
+ wdz != TzDate32("1900-01-01,Europe/Moscow"),
+ wtz != TzDate32("1900-01-01,Europe/Moscow"),
+
+ na != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz != TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz != TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+
+ ni != Interval("P1D"),
+ wi != Interval("P1D"),
+ ni != Interval64("P1D"),
+ wi != Interval64("P1D"),
+FROM Dates;
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub.cfg b/yql/essentials/tests/sql/suites/blocks/date_sub.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub.sql b/yql/essentials/tests/sql/suites/blocks/date_sub.sql
new file mode 100644
index 0000000000..ec839a4199
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub.sql
@@ -0,0 +1,165 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ a.na - b.na,
+ a.na - b.naz,
+ a.na - b.nd,
+ a.na - b.ndz,
+ a.na - b.nt,
+ a.na - b.ntz,
+ a.na - b.wa,
+ a.na - b.wd,
+ a.na - b.wt,
+ a.na - b.waz,
+ a.na - b.wdz,
+ a.na - b.wtz,
+
+ a.naz - b.na,
+ a.naz - b.naz,
+ a.naz - b.nd,
+ a.naz - b.ndz,
+ a.naz - b.nt,
+ a.naz - b.ntz,
+ a.naz - b.wa,
+ a.naz - b.wd,
+ a.naz - b.wt,
+ a.naz - b.waz,
+ a.naz - b.wdz,
+ a.naz - b.wtz,
+
+ a.nd - b.na,
+ a.nd - b.naz,
+ a.nd - b.nd,
+ a.nd - b.ndz,
+ a.nd - b.nt,
+ a.nd - b.ntz,
+ a.nd - b.wa,
+ a.nd - b.wd,
+ a.nd - b.wt,
+ a.nd - b.waz,
+ a.nd - b.wdz,
+ a.nd - b.wtz,
+
+ a.ndz - b.na,
+ a.ndz - b.naz,
+ a.ndz - b.nd,
+ a.ndz - b.ndz,
+ a.ndz - b.nt,
+ a.ndz - b.ntz,
+ a.ndz - b.wa,
+ a.ndz - b.wd,
+ a.ndz - b.wt,
+ a.ndz - b.waz,
+ a.ndz - b.wdz,
+ a.ndz - b.wtz,
+
+ a.nt - b.na,
+ a.nt - b.naz,
+ a.nt - b.nd,
+ a.nt - b.ndz,
+ a.nt - b.nt,
+ a.nt - b.ntz,
+ a.nt - b.wa,
+ a.nt - b.wd,
+ a.nt - b.wt,
+ a.nt - b.waz,
+ a.nt - b.wdz,
+ a.nt - b.wtz,
+
+ a.ntz - b.na,
+ a.ntz - b.naz,
+ a.ntz - b.nd,
+ a.ntz - b.ndz,
+ a.ntz - b.nt,
+ a.ntz - b.ntz,
+ a.ntz - b.wa,
+ a.ntz - b.wd,
+ a.ntz - b.wt,
+ a.ntz - b.waz,
+ a.ntz - b.wdz,
+ a.ntz - b.wtz
+
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ a.wa - b.na,
+ a.wa - b.naz,
+ a.wa - b.nd,
+ a.wa - b.ndz,
+ a.wa - b.nt,
+ a.wa - b.ntz,
+ a.wa - b.wa,
+ a.wa - b.wd,
+ a.wa - b.wt,
+ a.wa - b.waz,
+ a.wa - b.wdz,
+ a.wa - b.wtz,
+
+ a.wd - b.na,
+ a.wd - b.naz,
+ a.wd - b.nd,
+ a.wd - b.ndz,
+ a.wd - b.nt,
+ a.wd - b.ntz,
+ a.wd - b.wa,
+ a.wd - b.wd,
+ a.wd - b.wt,
+ a.wd - b.waz,
+ a.wd - b.wdz,
+ a.wd - b.wtz,
+
+ a.wt - b.na,
+ a.wt - b.naz,
+ a.wt - b.nd,
+ a.wt - b.ndz,
+ a.wt - b.nt,
+ a.wt - b.ntz,
+ a.wt - b.wa,
+ a.wt - b.wd,
+ a.wt - b.wt,
+ a.wt - b.waz,
+ a.wt - b.wdz,
+ a.wt - b.wtz,
+
+ a.waz - b.na,
+ a.waz - b.naz,
+ a.waz - b.nd,
+ a.waz - b.ndz,
+ a.waz - b.nt,
+ a.waz - b.ntz,
+ a.waz - b.wa,
+ a.waz - b.wd,
+ a.waz - b.wt,
+ a.waz - b.waz,
+ a.waz - b.wdz,
+ a.waz - b.wtz,
+
+ a.wdz - b.na,
+ a.wdz - b.naz,
+ a.wdz - b.nd,
+ a.wdz - b.ndz,
+ a.wdz - b.nt,
+ a.wdz - b.ntz,
+ a.wdz - b.wa,
+ a.wdz - b.wd,
+ a.wdz - b.wt,
+ a.wdz - b.waz,
+ a.wdz - b.wdz,
+ a.wdz - b.wtz,
+
+ a.wtz - b.na,
+ a.wtz - b.naz,
+ a.wtz - b.nd,
+ a.wtz - b.ndz,
+ a.wtz - b.nt,
+ a.wtz - b.ntz,
+ a.wtz - b.wa,
+ a.wtz - b.wd,
+ a.wtz - b.wt,
+ a.wtz - b.waz,
+ a.wtz - b.wdz,
+ a.wtz - b.wtz,
+
+FROM Dates as a CROSS JOIN Dates as b;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_interval.cfg b/yql/essentials/tests/sql/suites/blocks/date_sub_interval.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_interval.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_interval.sql b/yql/essentials/tests/sql/suites/blocks/date_sub_interval.sql
new file mode 100644
index 0000000000..9e9c6ce95b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_interval.sql
@@ -0,0 +1,31 @@
+USE plato;
+
+SELECT
+ a.na - b.ni,
+ a.na - b.wi,
+ a.naz - b.ni,
+ a.naz - b.wi,
+ a.nd - b.ni,
+ a.nd - b.wi,
+ a.ndz - b.ni,
+ a.ndz - b.wi,
+ a.nt - b.ni,
+ a.nt - b.wi,
+ a.ntz - b.ni,
+ a.ntz - b.wi,
+
+ a.wa - b.ni,
+ a.wa - b.wi,
+ a.waz - b.ni,
+ a.waz - b.wi,
+ a.wd - b.ni,
+ a.wd - b.wi,
+ a.wdz - b.ni,
+ a.wdz - b.wi,
+ a.wt - b.ni,
+ a.wt - b.wi,
+ a.wtz - b.ni,
+ a.wtz - b.wi
+
+FROM Dates as a CROSS JOIN Dates as b
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.sql
new file mode 100644
index 0000000000..8b5aee81fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_interval_scalar.sql
@@ -0,0 +1,58 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") - ni,
+ Date("2000-01-01") - wi,
+ TzDate("2000-01-01,Europe/Moscow") - ni,
+ TzDate("2000-01-01,Europe/Moscow") - wi,
+ Datetime("2000-01-01T03:04:05Z") - ni,
+ Datetime("2000-01-01T03:04:05Z") - wi,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - ni,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wi,
+ Timestamp("2000-01-01T03:04:05.678912Z") - ni,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wi,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - ni,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wi,
+ Date32("1900-01-01") - ni,
+ Date32("1900-01-01") - wi,
+ Datetime64("1900-01-01T03:04:05Z") - ni,
+ Datetime64("1900-01-01T03:04:05Z") - wi,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - ni,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wi,
+ TzDate32("1900-01-01,Europe/Moscow") - ni,
+ TzDate32("1900-01-01,Europe/Moscow") - wi,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - ni,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wi,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - ni,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wi
+FROM Dates;
+
+SELECT
+ na - Interval("P1D"),
+ na - Interval64("P1D"),
+ naz - Interval("P1D"),
+ naz - Interval64("P1D"),
+ nd - Interval("P1D"),
+ nd - Interval64("P1D"),
+ ndz - Interval("P1D"),
+ ndz - Interval64("P1D"),
+ nt - Interval("P1D"),
+ nt - Interval64("P1D"),
+ ntz - Interval("P1D"),
+ ntz - Interval64("P1D"),
+ wa - Interval("P1D"),
+ wa - Interval64("P1D"),
+ wd - Interval("P1D"),
+ wd - Interval64("P1D"),
+ wt - Interval("P1D"),
+ wt - Interval64("P1D"),
+ waz - Interval("P1D"),
+ waz - Interval64("P1D"),
+ wdz - Interval("P1D"),
+ wdz - Interval64("P1D"),
+ wtz - Interval("P1D"),
+ wtz - Interval64("P1D")
+FROM Dates;
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql
new file mode 100644
index 0000000000..efe5c86006
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_sub_scalar.sql
@@ -0,0 +1,326 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ Date("2000-01-01") - na,
+ Date("2000-01-01") - naz,
+ Date("2000-01-01") - nd,
+ Date("2000-01-01") - ndz,
+ Date("2000-01-01") - nt,
+ Date("2000-01-01") - ntz,
+ Date("2000-01-01") - wa,
+ Date("2000-01-01") - wd,
+ Date("2000-01-01") - wt,
+ Date("2000-01-01") - waz,
+ Date("2000-01-01") - wdz,
+ Date("2000-01-01") - wtz,
+
+ TzDate("2000-01-01,Europe/Moscow") - na,
+ TzDate("2000-01-01,Europe/Moscow") - naz,
+ TzDate("2000-01-01,Europe/Moscow") - nd,
+ TzDate("2000-01-01,Europe/Moscow") - ndz,
+ TzDate("2000-01-01,Europe/Moscow") - nt,
+ TzDate("2000-01-01,Europe/Moscow") - ntz,
+ TzDate("2000-01-01,Europe/Moscow") - wa,
+ TzDate("2000-01-01,Europe/Moscow") - wd,
+ TzDate("2000-01-01,Europe/Moscow") - wt,
+ TzDate("2000-01-01,Europe/Moscow") - waz,
+ TzDate("2000-01-01,Europe/Moscow") - wdz,
+ TzDate("2000-01-01,Europe/Moscow") - wtz,
+
+ Datetime("2000-01-01T03:04:05Z") - na,
+ Datetime("2000-01-01T03:04:05Z") - naz,
+ Datetime("2000-01-01T03:04:05Z") - nd,
+ Datetime("2000-01-01T03:04:05Z") - ndz,
+ Datetime("2000-01-01T03:04:05Z") - nt,
+ Datetime("2000-01-01T03:04:05Z") - ntz,
+ Datetime("2000-01-01T03:04:05Z") - wa,
+ Datetime("2000-01-01T03:04:05Z") - wd,
+ Datetime("2000-01-01T03:04:05Z") - wt,
+ Datetime("2000-01-01T03:04:05Z") - waz,
+ Datetime("2000-01-01T03:04:05Z") - wdz,
+ Datetime("2000-01-01T03:04:05Z") - wtz,
+
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - na,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - naz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - nd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - ndz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - nt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - ntz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wa,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wd,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wt,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - waz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wdz,
+ TzDatetime("2000-01-01T03:04:05,Europe/Moscow") - wtz,
+
+ Timestamp("2000-01-01T03:04:05.678912Z") - na,
+ Timestamp("2000-01-01T03:04:05.678912Z") - naz,
+ Timestamp("2000-01-01T03:04:05.678912Z") - nd,
+ Timestamp("2000-01-01T03:04:05.678912Z") - ndz,
+ Timestamp("2000-01-01T03:04:05.678912Z") - nt,
+ Timestamp("2000-01-01T03:04:05.678912Z") - ntz,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wa,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wd,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wt,
+ Timestamp("2000-01-01T03:04:05.678912Z") - waz,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wdz,
+ Timestamp("2000-01-01T03:04:05.678912Z") - wtz,
+
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - na,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - naz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - nd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - ndz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - nt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - ntz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wa,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wd,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wt,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - waz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wdz,
+ TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow") - wtz,
+
+FROM Dates;
+
+SELECT
+ Date32("1900-01-01") - na,
+ Date32("1900-01-01") - naz,
+ Date32("1900-01-01") - nd,
+ Date32("1900-01-01") - ndz,
+ Date32("1900-01-01") - nt,
+ Date32("1900-01-01") - ntz,
+ Date32("1900-01-01") - wa,
+ Date32("1900-01-01") - wd,
+ Date32("1900-01-01") - wt,
+ Date32("1900-01-01") - waz,
+ Date32("1900-01-01") - wdz,
+ Date32("1900-01-01") - wtz,
+
+ Datetime64("1900-01-01T03:04:05Z") - na,
+ Datetime64("1900-01-01T03:04:05Z") - naz,
+ Datetime64("1900-01-01T03:04:05Z") - nd,
+ Datetime64("1900-01-01T03:04:05Z") - ndz,
+ Datetime64("1900-01-01T03:04:05Z") - nt,
+ Datetime64("1900-01-01T03:04:05Z") - ntz,
+ Datetime64("1900-01-01T03:04:05Z") - wa,
+ Datetime64("1900-01-01T03:04:05Z") - wd,
+ Datetime64("1900-01-01T03:04:05Z") - wt,
+ Datetime64("1900-01-01T03:04:05Z") - waz,
+ Datetime64("1900-01-01T03:04:05Z") - wdz,
+ Datetime64("1900-01-01T03:04:05Z") - wtz,
+
+ Timestamp64("1900-01-01T03:04:05.678912Z") - na,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - naz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - nd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - ndz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - nt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - ntz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wa,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wd,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wt,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - waz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wdz,
+ Timestamp64("1900-01-01T03:04:05.678912Z") - wtz,
+
+ TzDate32("1900-01-01,Europe/Moscow") - na,
+ TzDate32("1900-01-01,Europe/Moscow") - naz,
+ TzDate32("1900-01-01,Europe/Moscow") - nd,
+ TzDate32("1900-01-01,Europe/Moscow") - ndz,
+ TzDate32("1900-01-01,Europe/Moscow") - nt,
+ TzDate32("1900-01-01,Europe/Moscow") - ntz,
+ TzDate32("1900-01-01,Europe/Moscow") - wa,
+ TzDate32("1900-01-01,Europe/Moscow") - wd,
+ TzDate32("1900-01-01,Europe/Moscow") - wt,
+ TzDate32("1900-01-01,Europe/Moscow") - waz,
+ TzDate32("1900-01-01,Europe/Moscow") - wdz,
+ TzDate32("1900-01-01,Europe/Moscow") - wtz,
+
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - na,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - naz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - nd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - ndz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - nt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - ntz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wa,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wd,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wt,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - waz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wdz,
+ TzDatetime64("1900-01-01T03:04:05,Europe/Moscow") - wtz,
+
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - na,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - naz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - nd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - ndz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - nt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - ntz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wa,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wd,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wt,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - waz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wdz,
+ TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow") - wtz
+
+FROM Dates;
+
+SELECT
+ na - Date("2000-01-01"),
+ naz - Date("2000-01-01"),
+ nd - Date("2000-01-01"),
+ ndz - Date("2000-01-01"),
+ nt - Date("2000-01-01"),
+ ntz - Date("2000-01-01"),
+ wa - Date("2000-01-01"),
+ wd - Date("2000-01-01"),
+ wt - Date("2000-01-01"),
+ waz - Date("2000-01-01"),
+ wdz - Date("2000-01-01"),
+ wtz - Date("2000-01-01"),
+
+ na - TzDate("2000-01-01,Europe/Moscow"),
+ naz - TzDate("2000-01-01,Europe/Moscow"),
+ nd - TzDate("2000-01-01,Europe/Moscow"),
+ ndz - TzDate("2000-01-01,Europe/Moscow"),
+ nt - TzDate("2000-01-01,Europe/Moscow"),
+ ntz - TzDate("2000-01-01,Europe/Moscow"),
+ wa - TzDate("2000-01-01,Europe/Moscow"),
+ wd - TzDate("2000-01-01,Europe/Moscow"),
+ wt - TzDate("2000-01-01,Europe/Moscow"),
+ waz - TzDate("2000-01-01,Europe/Moscow"),
+ wdz - TzDate("2000-01-01,Europe/Moscow"),
+ wtz - TzDate("2000-01-01,Europe/Moscow"),
+
+ na - Datetime("2000-01-01T03:04:05Z"),
+ naz - Datetime("2000-01-01T03:04:05Z"),
+ nd - Datetime("2000-01-01T03:04:05Z"),
+ ndz - Datetime("2000-01-01T03:04:05Z"),
+ nt - Datetime("2000-01-01T03:04:05Z"),
+ ntz - Datetime("2000-01-01T03:04:05Z"),
+ wa - Datetime("2000-01-01T03:04:05Z"),
+ wd - Datetime("2000-01-01T03:04:05Z"),
+ wt - Datetime("2000-01-01T03:04:05Z"),
+ waz - Datetime("2000-01-01T03:04:05Z"),
+ wdz - Datetime("2000-01-01T03:04:05Z"),
+ wtz - Datetime("2000-01-01T03:04:05Z"),
+
+ na - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ naz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nd - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ndz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ nt - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ntz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wa - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wd - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wt - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ waz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wdz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wtz - TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+
+ na - Timestamp("2000-01-01T03:04:05.678912Z"),
+ naz - Timestamp("2000-01-01T03:04:05.678912Z"),
+ nd - Timestamp("2000-01-01T03:04:05.678912Z"),
+ ndz - Timestamp("2000-01-01T03:04:05.678912Z"),
+ nt - Timestamp("2000-01-01T03:04:05.678912Z"),
+ ntz - Timestamp("2000-01-01T03:04:05.678912Z"),
+ wa - Timestamp("2000-01-01T03:04:05.678912Z"),
+ wd - Timestamp("2000-01-01T03:04:05.678912Z"),
+ wt - Timestamp("2000-01-01T03:04:05.678912Z"),
+ waz - Timestamp("2000-01-01T03:04:05.678912Z"),
+ wdz - Timestamp("2000-01-01T03:04:05.678912Z"),
+ wtz - Timestamp("2000-01-01T03:04:05.678912Z"),
+
+ na - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ naz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nd - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ nt - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wa - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wd - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wt - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ waz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz - TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+FROM Dates;
+
+SELECT
+ na - Date32("1900-01-01"),
+ naz - Date32("1900-01-01"),
+ nd - Date32("1900-01-01"),
+ ndz - Date32("1900-01-01"),
+ nt - Date32("1900-01-01"),
+ ntz - Date32("1900-01-01"),
+ wa - Date32("1900-01-01"),
+ wd - Date32("1900-01-01"),
+ wt - Date32("1900-01-01"),
+ waz - Date32("1900-01-01"),
+ wdz - Date32("1900-01-01"),
+ wtz - Date32("1900-01-01"),
+
+ na - Datetime64("1900-01-01T03:04:05Z"),
+ naz - Datetime64("1900-01-01T03:04:05Z"),
+ nd - Datetime64("1900-01-01T03:04:05Z"),
+ ndz - Datetime64("1900-01-01T03:04:05Z"),
+ nt - Datetime64("1900-01-01T03:04:05Z"),
+ ntz - Datetime64("1900-01-01T03:04:05Z"),
+ wa - Datetime64("1900-01-01T03:04:05Z"),
+ wd - Datetime64("1900-01-01T03:04:05Z"),
+ wt - Datetime64("1900-01-01T03:04:05Z"),
+ waz - Datetime64("1900-01-01T03:04:05Z"),
+ wdz - Datetime64("1900-01-01T03:04:05Z"),
+ wtz - Datetime64("1900-01-01T03:04:05Z"),
+
+ na - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ naz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nd - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ndz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ nt - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ntz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wa - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wd - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wt - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ waz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wdz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wtz - Timestamp64("1900-01-01T03:04:05.678912Z"),
+
+ na - TzDate32("1900-01-01,Europe/Moscow"),
+ naz - TzDate32("1900-01-01,Europe/Moscow"),
+ nd - TzDate32("1900-01-01,Europe/Moscow"),
+ ndz - TzDate32("1900-01-01,Europe/Moscow"),
+ nt - TzDate32("1900-01-01,Europe/Moscow"),
+ ntz - TzDate32("1900-01-01,Europe/Moscow"),
+ wa - TzDate32("1900-01-01,Europe/Moscow"),
+ wd - TzDate32("1900-01-01,Europe/Moscow"),
+ wt - TzDate32("1900-01-01,Europe/Moscow"),
+ waz - TzDate32("1900-01-01,Europe/Moscow"),
+ wdz - TzDate32("1900-01-01,Europe/Moscow"),
+ wtz - TzDate32("1900-01-01,Europe/Moscow"),
+
+ na - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ naz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nd - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ndz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ nt - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ntz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wa - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wd - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wt - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ waz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wdz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wtz - TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+
+ na - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ naz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nd - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ndz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ nt - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ ntz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wa - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wd - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wt - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ waz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wdz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wtz - TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow")
+
+FROM Dates;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_top_sort.cfg b/yql/essentials/tests/sql/suites/blocks/date_top_sort.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_top_sort.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/date_top_sort.sql b/yql/essentials/tests/sql/suites/blocks/date_top_sort.sql
new file mode 100644
index 0000000000..a2cc856c56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/date_top_sort.sql
@@ -0,0 +1,9 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ t.*, i8+1
+FROM (SELECT * FROM concat(Dates,Dates)) as t
+ORDER BY na,wa,naz,waz,nd,ndz,wd,wdz,nt,ntz,wt,wtz,ni,wi
+LIMIT 1;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/dates.txt b/yql/essentials/tests/sql/suites/blocks/dates.txt
new file mode 100644
index 0000000000..9137f4bac7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/dates.txt
@@ -0,0 +1 @@
+{"na"=1u;"nd"=2u;"nt"=3u;"naz"="\x00\x04\x00\x01";"ndz"="\x00\x00\x00\x05\x00\x01";"ntz"="\x00\x00\x00\x00\x00\x00\x00\x06\x00\x01";"wa"=7;"wd"=8;"wt"=9;"ni"=10;"wi"=11;"i8"=12;"u8"=13u;"i16"=14;"u16"=15u;"i32"=16;"u32"=17u;"i64"=18;"u64"=19u;"waz"="\x80\x00\x00\x14\x00\x01";"wdz"="\x80\x00\x00\x00\x00\x00\x00\x15\x00\x01";"wtz"="\x80\x00\x00\x00\x00\x00\x00\x16\x00\x01";}
diff --git a/yql/essentials/tests/sql/suites/blocks/dates.txt.attr b/yql/essentials/tests/sql/suites/blocks/dates.txt.attr
new file mode 100644
index 0000000000..d2ce0ed49f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/dates.txt.attr
@@ -0,0 +1,27 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["na";["DataType";"Date"]];
+ ["nd";["DataType";"Datetime"]];
+ ["nt";["DataType";"Timestamp"]];
+ ["naz";["DataType";"TzDate"]];
+ ["ndz";["DataType";"TzDatetime"]];
+ ["ntz";["DataType";"TzTimestamp"]];
+ ["wa";["DataType";"Date32"]];
+ ["wd";["DataType";"Datetime64"]];
+ ["wt";["DataType";"Timestamp64"]];
+ ["ni";["DataType";"Interval"]];
+ ["wi";["DataType";"Interval64"]];
+ ["i8";["DataType";"Int8"]];
+ ["u8";["DataType";"Uint8"]];
+ ["i16";["DataType";"Int16"]];
+ ["u16";["DataType";"Uint16"]];
+ ["i32";["DataType";"Int32"]];
+ ["u32";["DataType";"Uint32"]];
+ ["i64";["DataType";"Int64"]];
+ ["u64";["DataType";"Uint64"]];
+ ["waz";["DataType";"TzDate32"]];
+ ["wdz";["DataType";"TzDatetime64"]];
+ ["wtz";["DataType";"TzTimestamp64"]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_avg.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_avg.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_avg.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_avg.sql b/yql/essentials/tests/sql/suites/blocks/decimal_avg.sql
new file mode 100644
index 0000000000..3e1dd49983
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_avg.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT
+ avg(cs_ext_list_price), avg(cs_ext_tax),
+ avg(cs_ext_list_price) * decimal("1.1", 7, 2),
+ decimal("1.1", 7, 2) * avg(cs_ext_tax),
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_comparison.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_comparison.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_comparison.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_comparison.sql b/yql/essentials/tests/sql/suites/blocks/decimal_comparison.sql
new file mode 100644
index 0000000000..c41cc5540e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_comparison.sql
@@ -0,0 +1,25 @@
+USE plato;
+
+SELECT
+ cs_ext_list_price == cs_ext_tax,
+ cs_ext_list_price != cs_ext_tax,
+ cs_ext_list_price < cs_ext_tax,
+ cs_ext_list_price <= cs_ext_tax,
+ cs_ext_list_price > cs_ext_tax,
+ cs_ext_list_price >= cs_ext_tax,
+
+ cs_ext_tax == decimal("26.91", 7, 2),
+ cs_ext_tax != decimal("26.91", 7, 2),
+ cs_ext_tax < decimal("26.91", 7, 2),
+ cs_ext_tax <= decimal("26.91", 7, 2),
+ cs_ext_tax > decimal("26.91", 7, 2),
+ cs_ext_tax >= decimal("26.91", 7, 2),
+
+ decimal("26.91", 7, 2) == cs_ext_tax,
+ decimal("26.91", 7, 2) != cs_ext_tax,
+ decimal("26.91", 7, 2) < cs_ext_tax,
+ decimal("26.91", 7, 2) <= cs_ext_tax,
+ decimal("26.91", 7, 2) > cs_ext_tax,
+ decimal("26.91", 7, 2) >= cs_ext_tax,
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.sql b/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.sql
new file mode 100644
index 0000000000..4d3166b6a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_multiplicative_ops.sql
@@ -0,0 +1,18 @@
+USE plato;
+
+SELECT
+ cs_ext_list_price, cs_ext_tax,
+ cs_ext_list_price * cs_ext_tax, cs_ext_list_price * Just(decimal("13.37", 7, 2)), Just(decimal("42.0", 7, 2)) * cs_ext_tax,
+ cs_ext_list_price * decimal("13.37", 7, 2), decimal("42.0", 7, 2) * cs_ext_tax,
+
+ cs_ext_list_price / cs_ext_tax, cs_ext_list_price / Just(decimal("13.37", 7, 2)), Just(decimal("42.0", 7, 2)) / cs_ext_tax,
+ cs_ext_list_price / decimal("13.37", 7, 2), decimal("42.0", 7, 2) / cs_ext_tax,
+
+ cs_ext_list_price % cs_ext_tax, cs_ext_list_price % Just(decimal("13.37", 7, 2)), Just(decimal("42.0", 7, 2)) % cs_ext_tax,
+ cs_ext_list_price % decimal("13.37", 7, 2), decimal("42.0", 7, 2) % cs_ext_tax,
+
+ cs_ext_list_price * Just(13), cs_ext_list_price * 13,
+ cs_ext_list_price / Just(13), cs_ext_list_price / 13,
+ cs_ext_list_price % Just(13), cs_ext_list_price % 13,
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.sql b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.sql
new file mode 100644
index 0000000000..996ea73835
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ cs_ext_list_price + cs_ext_tax,
+ cs_ext_list_price - cs_ext_tax,
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.sql b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.sql
new file mode 100644
index 0000000000..81ce0f5dbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_op_decimal_scalar.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+SELECT
+ cs_ext_list_price + cast("10.2" as decimal(7,2)),
+ cs_ext_list_price + cast("99999.99" as decimal(7,2)),
+ cs_ext_list_price - cast("11.22" as decimal(7,2)),
+ cs_ext_list_price - cast("99999.99" as decimal(7,2)),
+FROM Input;
+
+SELECT
+ cast("10.2" as decimal(7,2)) + cs_ext_list_price,
+ cast("99999.99" as decimal(7,2)) + cs_ext_list_price,
+ cast("11.22" as decimal(7,2)) - cs_ext_list_price,
+ cast("99999.99" as decimal(7,2)) - cs_ext_list_price,
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_unary.cfg b/yql/essentials/tests/sql/suites/blocks/decimal_unary.cfg
new file mode 100644
index 0000000000..a21c6560ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_unary.cfg
@@ -0,0 +1 @@
+in Input input_decimal.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/decimal_unary.sql b/yql/essentials/tests/sql/suites/blocks/decimal_unary.sql
new file mode 100644
index 0000000000..77d1170ef6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/decimal_unary.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ -cs_ext_list_price,
+ abs(cs_ext_tax),
+FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/default.cfg b/yql/essentials/tests/sql/suites/blocks/default.cfg
new file mode 100644
index 0000000000..41a0f8a733
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/default.cfg
@@ -0,0 +1,4 @@
+canonize_peephole
+peephole_use_blocks
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.sql b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.sql
new file mode 100644
index 0000000000..dae808a395
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_all.sql
@@ -0,0 +1,8 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ count(*),
+ sum(distinct key),min(distinct key)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.sql b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.sql
new file mode 100644
index 0000000000..8c3aac0c0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_mixed_keys.sql
@@ -0,0 +1,10 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ key, count(*), count(distinct subkey), sum(distinct subkey),
+ count(distinct Unwrap(subkey/2u)), sum(distinct Unwrap(subkey/2u))
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.cfg
new file mode 100644
index 0000000000..6ba971b075
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.sql b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.sql
new file mode 100644
index 0000000000..1f45427b87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_all.sql
@@ -0,0 +1,7 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ count(*),max(subkey),sum(distinct subkey),avg(subkey),count(distinct subkey/2u),avg(distinct subkey/2u)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.cfg
new file mode 100644
index 0000000000..6ba971b075
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.sql b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.sql
new file mode 100644
index 0000000000..9b5d778b98
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_opt_state_keys.sql
@@ -0,0 +1,10 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ key,count(*),max(subkey),sum(distinct subkey),avg(subkey),count(distinct subkey/2u),avg(distinct subkey/2u)
+FROM Input
+GROUP BY key
+ORDER BY key
+
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.sql b/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.sql
new file mode 100644
index 0000000000..aa2865f46d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_pure_all.sql
@@ -0,0 +1,7 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ sum(distinct key),min(distinct key)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.cfg b/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.sql b/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.sql
new file mode 100644
index 0000000000..2acc401488
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/distinct_pure_keys.sql
@@ -0,0 +1,10 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ key, count(distinct subkey), sum(distinct subkey),
+ count(distinct Unwrap(subkey/2u)), sum(distinct Unwrap(subkey/2u))
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/div_uint64.cfg b/yql/essentials/tests/sql/suites/blocks/div_uint64.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/div_uint64.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/div_uint64.sql b/yql/essentials/tests/sql/suites/blocks/div_uint64.sql
new file mode 100644
index 0000000000..3eff1d864b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/div_uint64.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key/subkey,1000ul/key,subkey/0ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.cfg b/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.cfg
new file mode 100644
index 0000000000..46fee85c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt2.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.sql b/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.sql
new file mode 100644
index 0000000000..3eff1d864b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/div_uint64_opt2.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key/subkey,1000ul/key,subkey/0ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/exists.cfg b/yql/essentials/tests/sql/suites/blocks/exists.cfg
new file mode 100644
index 0000000000..87522c685e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/exists.cfg
@@ -0,0 +1 @@
+in Input input_exists.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/exists.sql b/yql/essentials/tests/sql/suites/blocks/exists.sql
new file mode 100644
index 0000000000..a4a0b91d5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/exists.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ key,
+ maybe_null is NULL as is_maybe_null,
+ always_null is NULL as is_always_null,
+ never_null is NULL as is_never_null,
+FROM Input
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.cfg b/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.cfg
new file mode 100644
index 0000000000..490bd1a7a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.cfg
@@ -0,0 +1 @@
+in Input input_bools.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.sql b/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.sql
new file mode 100644
index 0000000000..6fd08e1d67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_by_column_with_drop.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+select
+ key,
+from Input
+where b1
+order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_direct_col.cfg b/yql/essentials/tests/sql/suites/blocks/filter_direct_col.cfg
new file mode 100644
index 0000000000..63c656a58f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_direct_col.cfg
@@ -0,0 +1 @@
+in Input input_uint32_optbool_bool.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_direct_col.sql b/yql/essentials/tests/sql/suites/blocks/filter_direct_col.sql
new file mode 100644
index 0000000000..363a005ca3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_direct_col.sql
@@ -0,0 +1 @@
+select * from plato.Input where value order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_expr.cfg b/yql/essentials/tests/sql/suites/blocks/filter_expr.cfg
new file mode 100644
index 0000000000..63c656a58f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_expr.cfg
@@ -0,0 +1 @@
+in Input input_uint32_optbool_bool.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_expr.sql b/yql/essentials/tests/sql/suites/blocks/filter_expr.sql
new file mode 100644
index 0000000000..07efda8677
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_expr.sql
@@ -0,0 +1 @@
+select key, subkey from plato.Input where not value order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.cfg b/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.cfg
new file mode 100644
index 0000000000..63c656a58f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.cfg
@@ -0,0 +1 @@
+in Input input_uint32_optbool_bool.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.sql b/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.sql
new file mode 100644
index 0000000000..df187d75f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/filter_partial_expr.sql
@@ -0,0 +1 @@
+select key, subkey from plato.Input where not value or Random(key) >= 0.0 order by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.cfg b/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.cfg
new file mode 100644
index 0000000000..57e52ccabb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.cfg
@@ -0,0 +1 @@
+in Input input_hashed_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.sql b/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.sql
new file mode 100644
index 0000000000..1609c02088
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/finalize_hashed_keys.sql
@@ -0,0 +1,9 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+SELECT
+ key, count(*), count(subkey), min(subkey), max(subkey), sum(subkey), avg(subkey)
+FROM Input
+GROUP by key
+ORDER by key;
diff --git a/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.cfg b/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.cfg
new file mode 100644
index 0000000000..b65712414d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.cfg
@@ -0,0 +1 @@
+in Input input_strings.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.sql b/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.sql
new file mode 100644
index 0000000000..59e121f52f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/group_by_complex_key.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+$src =
+SELECT
+ if (key != '075', AsTuple(Just(Just(key)), 123)) as k,
+ subkey,
+ value
+FROM Input;
+
+SELECT
+ k,
+ min(subkey) as min,
+ max(value) as max,
+FROM $src
+GROUP by k
+ORDER by k
diff --git a/yql/essentials/tests/sql/suites/blocks/if.cfg b/yql/essentials/tests/sql/suites/blocks/if.cfg
new file mode 100644
index 0000000000..b65712414d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/if.cfg
@@ -0,0 +1 @@
+in Input input_strings.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/if.sql b/yql/essentials/tests/sql/suites/blocks/if.sql
new file mode 100644
index 0000000000..829699ce50
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/if.sql
@@ -0,0 +1,16 @@
+select
+ key,
+ subkey,
+ if (1 > 0, key, subkey) as same_as_key,
+ if (0 > 100, key, subkey) as same_as_subkey,
+ if (10 > 0, 'scalar1 selected', key) as sc1,
+ if (0 > 11, subkey, 'scalar2 selected') as sc2,
+
+
+ if(key > subkey, key, subkey) as max_of_key_subkey,
+ if(key > subkey, key, 'subkey is greater') as sc3,
+ if(subkey >= key, 'subkey is greater or eq', key) as sc4,
+ if(subkey >= key, 'subkey is greater or eq', 'key is greater') as sc5,
+
+from plato.Input
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/blocks/input1.txt b/yql/essentials/tests/sql/suites/blocks/input1.txt
new file mode 100644
index 0000000000..35c1a628a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input1.txt
@@ -0,0 +1,5 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input1.txt.attr b/yql/essentials/tests/sql/suites/blocks/input1.txt.attr
new file mode 100644
index 0000000000..157b4f5c1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input1.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input2.txt b/yql/essentials/tests/sql/suites/blocks/input2.txt
new file mode 100644
index 0000000000..3d8c1dee24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input2.txt
@@ -0,0 +1,5 @@
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input2.txt.attr b/yql/essentials/tests/sql/suites/blocks/input2.txt.attr
new file mode 100644
index 0000000000..157b4f5c1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input2.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_allnums.txt b/yql/essentials/tests/sql/suites/blocks/input_allnums.txt
new file mode 100644
index 0000000000..ab464de5cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_allnums.txt
@@ -0,0 +1,3 @@
+{ "i8"=1 ; "i16"=2; "i32"=3; "i64"=4; "i8opt"=5; "i16opt"=6; "i32opt"=7; "i64opt"=8; "ui8"=9u; "ui16"=10u; "ui32"=11u; "ui64"=12u; "ui8opt"=13u; "ui16opt"=14u; "ui32opt"=15u; "ui64opt"=16u; };
+{ "i8"=17; "i16"=18; "i32"=19; "i64"=20; "i8opt"=21; "i16opt"=#; "i32opt"=23; "i64opt"=#; "ui8"=25u; "ui16"=26u; "ui32"=27u; "ui64"=28u; "ui8opt"=#; "ui16opt"=30u; "ui32opt"=#; "ui64opt"=32u; };
+{ "i8"=33; "i16"=34; "i32"=35; "i64"=36; "i8opt"=37; "i16opt"=38; "i32opt"=#; "i64opt"=40; "ui8"=41u; "ui16"=42u; "ui32"=43u; "ui64"=44u; "ui8opt"=45u; "ui16opt"=#; "ui32opt"=47u; "ui64opt"=48u; };
diff --git a/yql/essentials/tests/sql/suites/blocks/input_allnums.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_allnums.txt.attr
new file mode 100644
index 0000000000..aaf80d991f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_allnums.txt.attr
@@ -0,0 +1,23 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["i8";["DataType";"Int8"]];
+ ["i16";["DataType";"Int16"]];
+ ["i32";["DataType";"Int32"]];
+ ["i64";["DataType";"Int64"]];
+
+ ["i8opt";["OptionalType"; ["DataType";"Int8"]]];
+ ["i16opt";["OptionalType"; ["DataType";"Int16"]]];
+ ["i32opt";["OptionalType"; ["DataType";"Int32"]]];
+ ["i64opt";["OptionalType"; ["DataType";"Int64"]]];
+
+ ["ui8";["DataType";"Uint8"]];
+ ["ui16";["DataType";"Uint16"]];
+ ["ui32";["DataType";"Uint32"]];
+ ["ui64";["DataType";"Uint64"]];
+
+ ["ui8opt";["OptionalType"; ["DataType";"Uint8"]]];
+ ["ui16opt";["OptionalType"; ["DataType";"Uint16"]]];
+ ["ui32opt";["OptionalType"; ["DataType";"Uint32"]]];
+ ["ui64opt";["OptionalType"; ["DataType";"Uint64"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bool.txt b/yql/essentials/tests/sql/suites/blocks/input_bool.txt
new file mode 100644
index 0000000000..850bbde1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bool.txt
@@ -0,0 +1,4 @@
+{"key"=%false;"subkey"=%false;};
+{"key"=%false;"subkey"=%true;};
+{"key"=%true;"subkey"=%false;};
+{"key"=%true;"subkey"=%true;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bool.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_bool.txt.attr
new file mode 100644
index 0000000000..f59e3e2a04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bool.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Bool"]];
+ ["subkey";["DataType";"Bool"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt
new file mode 100644
index 0000000000..3526c15cc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt
@@ -0,0 +1,9 @@
+{"key"=%false;"subkey"=%false;};
+{"key"=%false;"subkey"=%true;};
+{"key"=%false;"subkey"=#;};
+{"key"=%true;"subkey"=%false;};
+{"key"=%true;"subkey"=%true;};
+{"key"=%true;"subkey"=#;};
+{"key"=#;"subkey"=%false;};
+{"key"=#;"subkey"=%true;};
+{"key"=#;"subkey"=#;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt.attr
new file mode 100644
index 0000000000..c9690dfe89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bool_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Bool"]]];
+ ["subkey";["OptionalType";["DataType";"Bool"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bools.txt b/yql/essentials/tests/sql/suites/blocks/input_bools.txt
new file mode 100644
index 0000000000..4c3461304c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bools.txt
@@ -0,0 +1,9 @@
+{"key"=1; "b1"=%false; "b2"=%false; "ob1"=%false;"ob2"=%false;};
+{"key"=2; "b1"=%false; "b2"=%true; "ob1"=%false;"ob2"=%true;};
+{"key"=3; "b1"=%true; "b2"=%false; "ob1"=%false;"ob2"=#;};
+{"key"=4; "b1"=%true; "b2"=%true; "ob1"=%true; "ob2"=%false;};
+{"key"=5; "b1"=%false; "b2"=%false; "ob1"=%true; "ob2"=%true;};
+{"key"=6; "b1"=%false; "b2"=%true; "ob1"=%true; "ob2"=#;};
+{"key"=7; "b1"=%true; "b2"=%false; "ob1"=#; "ob2"=%false;};
+{"key"=8; "b1"=%true; "b2"=%true; "ob1"=#; "ob2"=%true;};
+{"key"=9; "b1"=%false; "b2"=%false; "ob1"=#; "ob2"=#;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_bools.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_bools.txt.attr
new file mode 100644
index 0000000000..22b4be69d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_bools.txt.attr
@@ -0,0 +1,9 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["b1";["DataType";"Bool"]];
+ ["b2";["DataType";"Bool"]];
+ ["ob1";["OptionalType";["DataType";"Bool"]]];
+ ["ob2";["OptionalType";["DataType";"Bool"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_decimal.txt b/yql/essentials/tests/sql/suites/blocks/input_decimal.txt
new file mode 100644
index 0000000000..7be0d5ef5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_decimal.txt
@@ -0,0 +1,10 @@
+{"cs_ext_list_price"="\x83\7\xE1\xFC";"cs_ext_tax"="\x82\4p";"cs_sales_price"="\x82\7\x86";};
+{"cs_ext_list_price"="\x83\3\x11P";"cs_ext_tax"="\x82\x1BS";"cs_sales_price"="\x82\0143";};
+{"cs_ext_list_price"="\x83\x0B{\x94";"cs_ext_tax"="\x82\0229";"cs_sales_price"="\x82\x1B\x9D";};
+{"cs_ext_list_price"="\x83\x10\x98i";"cs_ext_tax"="\x82Q\x91";"cs_sales_price"="\x82\x0C\xE8";};
+{"cs_ext_list_price"="\x83\x15\x1B\xE8";"cs_ext_tax"="\x82\xA2\x1C";"cs_sales_price"="\x82@\xD8";};
+{"cs_ext_list_price"="\x83\x08\xF3Z";"cs_ext_tax"="\x82pD";"cs_sales_price"="\x82\x1D)";};
+{"cs_ext_list_price"="\x83\6\xF6\xB0";"cs_ext_tax"="\x82\x08\xBC";"cs_sales_price"="\x82\t\xED";};
+{"cs_ext_list_price"="\x83\x08\xBC\xD4";"cs_ext_tax"="\x82\n\xAD";"cs_sales_price"="\x82\x19T";};
+{"cs_ext_list_price"="\x82\x14r";"cs_ext_tax"="\x82\0011";"cs_sales_price"="\x82\7v";};
+{"cs_ext_list_price"="\x83\2\xC6\xB8";"cs_ext_tax"="\x82\n\x83";"cs_sales_price"="\x82\n\xF4";};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_decimal.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_decimal.txt.attr
new file mode 100644
index 0000000000..ebddf8b641
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_decimal.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cs_ext_list_price";["OptionalType";["DataType";"Decimal";"7";"2"]]];
+ ["cs_ext_tax";["OptionalType";["DataType";"Decimal";"7";"2"]]];
+ ["cs_sales_price";["OptionalType";["DataType";"Decimal";"7";"2"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_double.txt b/yql/essentials/tests/sql/suites/blocks/input_double.txt
new file mode 100644
index 0000000000..591700bec4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_double.txt
@@ -0,0 +1,9 @@
+{"key"=10u;"subkey"=1.0};
+{"key"=20u;"subkey"=-2.0};
+{"key"=20u;"subkey"=2.0};
+{"key"=10u;"subkey"=%-inf};
+{"key"=10u;"subkey"=%nan};
+{"key"=10u;"subkey"=%inf};
+{"key"=20u;"subkey"=3.0};
+{"key"=20u;"subkey"=-10.0};
+{"key"=20u;"subkey"=55.5};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_double.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_double.txt.attr
new file mode 100644
index 0000000000..da7771ff13
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_double.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"Double"]];
+ ];
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_exists.txt b/yql/essentials/tests/sql/suites/blocks/input_exists.txt
new file mode 100644
index 0000000000..aa9f87e25e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_exists.txt
@@ -0,0 +1,9 @@
+{"key"=1;"always_null"=#;"never_null"=11;"maybe_null"=11;};
+{"key"=2;"always_null"=#;"never_null"=22;"maybe_null"=22;};
+{"key"=3;"always_null"=#;"never_null"=33;"maybe_null"=33;};
+{"key"=4;"always_null"=#;"never_null"=44;"maybe_null"=#; };
+{"key"=5;"always_null"=#;"never_null"=55;"maybe_null"=55;};
+{"key"=6;"always_null"=#;"never_null"=66;"maybe_null"=#; };
+{"key"=7;"always_null"=#;"never_null"=77;"maybe_null"=#; };
+{"key"=8;"always_null"=#;"never_null"=88;"maybe_null"=88;};
+{"key"=9;"always_null"=#;"never_null"=99;"maybe_null"=#; };
diff --git a/yql/essentials/tests/sql/suites/blocks/input_exists.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_exists.txt.attr
new file mode 100644
index 0000000000..16f4c78734
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_exists.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["always_null";["OptionalType";["DataType";"Int32"]]];
+ ["never_null";["OptionalType";["DataType";"Int32"]]];
+ ["maybe_null";["OptionalType";["DataType";"Int32"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt b/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt
new file mode 100644
index 0000000000..3daf47309f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt
@@ -0,0 +1,3 @@
+{"a"="\3.Hr";"b"="?\xFC\x94-\xFA\3218\xC0"};
+{"a"="\xFF\xDA\x97\xA7";"b"="\xFD\x0F|\xC2\x1F\x08\x18\xC0"};
+{"a"="\x7F\xDA\x97\x0C";"b"="\x7F\xFF\xFFHs\xC3\xB8\xC0"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt.attr
new file mode 100644
index 0000000000..c7b3104a66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_from_pg_dates.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["PgType";"date"]];
+ ["b";["PgType";"timestamp"]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt
new file mode 100644
index 0000000000..6fdbd4f405
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt
@@ -0,0 +1,3 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
+{"key"=20u;"subkey"=5u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt.attr
new file mode 100644
index 0000000000..3a10c2a1ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"Uint32"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt
new file mode 100644
index 0000000000..048b654dc7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt
@@ -0,0 +1,5 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=10u;"subkey"=#;};
+{"key"=20u;"subkey"=4u;};
+{"key"=20u;"subkey"=5u;};
+{"key"=20u;"subkey"=#;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt.attr
new file mode 100644
index 0000000000..1c249a645e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_hashed_uint32_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["OptionalType";["DataType";"Uint32"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int16.txt b/yql/essentials/tests/sql/suites/blocks/input_int16.txt
new file mode 100644
index 0000000000..cdb5f49f97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int16.txt
@@ -0,0 +1,2 @@
+{"key"=10;"subkey"=3;};
+{"key"=20;"subkey"=4;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int16.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int16.txt.attr
new file mode 100644
index 0000000000..083adc01e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int16.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int16"]];
+ ["subkey";["DataType";"Int16"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32.txt b/yql/essentials/tests/sql/suites/blocks/input_int32.txt
new file mode 100644
index 0000000000..cdb5f49f97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32.txt
@@ -0,0 +1,2 @@
+{"key"=10;"subkey"=3;};
+{"key"=20;"subkey"=4;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int32.txt.attr
new file mode 100644
index 0000000000..4776c0c3e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["subkey";["DataType";"Int32"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt
new file mode 100644
index 0000000000..661b3fc1a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt
@@ -0,0 +1,5 @@
+{"k1"=1; "k2"=10;};
+{"k1"=2; "k2"=#;};
+{"k1"=3; "k2"=30;};
+{"k1"=4; "k2"=40;};
+{"k1"=5; "k2"=#;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt.attr
new file mode 100644
index 0000000000..3b099f504e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k1";["DataType";"Int32"]];
+ ["k2";["OptionalType";["DataType";"Int32"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt b/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt
new file mode 100644
index 0000000000..6af3e964b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt
@@ -0,0 +1,3 @@
+{"key"=10;"subkey"=3;"value"="foo";"value_utf"="теÑÑ‚"};
+{"key"=20;"subkey"=4;"value"="bar";"value_utf"="проверка"};
+{"key"=30;"subkey"=5;"value"="";"value_utf"=""};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt.attr
new file mode 100644
index 0000000000..52153089c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int32_string.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["subkey";["DataType";"Int32"]];
+ ["value";["DataType";"String"]];
+ ["value_utf";["DataType";"Utf8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int64.txt b/yql/essentials/tests/sql/suites/blocks/input_int64.txt
new file mode 100644
index 0000000000..cdb5f49f97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int64.txt
@@ -0,0 +1,2 @@
+{"key"=10;"subkey"=3;};
+{"key"=20;"subkey"=4;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int64.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int64.txt.attr
new file mode 100644
index 0000000000..763e1cad96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int64.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int64"]];
+ ["subkey";["DataType";"Int64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int8.txt b/yql/essentials/tests/sql/suites/blocks/input_int8.txt
new file mode 100644
index 0000000000..cdb5f49f97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int8.txt
@@ -0,0 +1,2 @@
+{"key"=10;"subkey"=3;};
+{"key"=20;"subkey"=4;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_int8.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_int8.txt.attr
new file mode 100644
index 0000000000..c25d3bbf54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_int8.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int8"]];
+ ["subkey";["DataType";"Int8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_json_document.txt b/yql/essentials/tests/sql/suites/blocks/input_json_document.txt
new file mode 100644
index 0000000000..6d9491ffcf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_json_document.txt
@@ -0,0 +1,9 @@
+{"key"=1;"val"="{\"a\":11,\"b\":1111}";};
+{"key"=2;"val"="{\"a\":22,\"b\":2222}";};
+{"key"=3;"val"="{\"a\":33,\"b\":3333}";};
+{"key"=4;"val"="{\"a\":44,\"b\":4444}";};
+{"key"=5;"val"="{\"a\":55,\"b\":5555}";};
+{"key"=6;"val"="{\"a\":66,\"b\":6666}";};
+{"key"=7;"val"="{\"a\":77,\"b\":7777}";};
+{"key"=8;"val"="{\"a\":88,\"b\":8888}";};
+{"key"=9;"val"="{\"a\":99,\"b\":9999}";};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_json_document.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_json_document.txt.attr
new file mode 100644
index 0000000000..d8a67034ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_json_document.txt.attr
@@ -0,0 +1,9 @@
+{"_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ ["key";["DataType";"Int32"]];
+ ["val";["DataType";"JsonDocument"]]
+ ]
+ ]
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_nested.txt b/yql/essentials/tests/sql/suites/blocks/input_nested.txt
new file mode 100644
index 0000000000..c18db18a76
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_nested.txt
@@ -0,0 +1,14 @@
+{"key"=10u;"subkey"=1u;"value"=[1;[1.0]]};
+{"key"=20u;"subkey"=2u;"value"=#};
+{"key"=20u;"subkey"=2u;"value"=[2;[#]]};
+{"key"=20u;"subkey"=2u;"value"=[2;[%nan]]};
+{"key"=20u;"subkey"=2u;"value"=[2;[%inf]]};
+{"key"=10u;"subkey"=1u;"value"=[1;[%-inf]]};
+{"key"=10u;"subkey"=1u;"value"=[1;[%nan]]};
+{"key"=10u;"subkey"=1u;"value"=[1;[%inf]]};
+{"key"=10u;"subkey"=1u;"value"=#};
+{"key"=10u;"subkey"=1u;"value"=[1;[#]]};
+{"key"=10u;"subkey"=1u;"value"=[1;#]};
+{"key"=20u;"subkey"=2u;"value"=[2;[1.0]]};
+{"key"=20u;"subkey"=2u;"value"=[2;#]};
+{"key"=20u;"subkey"=2u;"value"=[2;[%-inf]]};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_nested.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_nested.txt.attr
new file mode 100644
index 0000000000..da87d9df75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_nested.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"Uint32"]];
+ ["value";["OptionalType";["TupleType";[["DataType";"Int32"];["OptionalType"; ["OptionalType";["DataType";"Double"]]]]]]
+ ];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_pg.txt b/yql/essentials/tests/sql/suites/blocks/input_pg.txt
new file mode 100644
index 0000000000..7c2a036981
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_pg.txt
@@ -0,0 +1,3 @@
+{"a"="023";"b"="bbb";"c"=3;"d"="aaa"};
+{"a"="037";"b"="ddd";"c"=5;"d"="eee"};
+
diff --git a/yql/essentials/tests/sql/suites/blocks/input_pg.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_pg.txt.attr
new file mode 100644
index 0000000000..2e13cdd656
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_pg.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["PgType";"text"]];
+ ["b";["PgType";"cstring"]];
+ ["c";["PgType";"int2"]];
+ ["d";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt b/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt
new file mode 100644
index 0000000000..25433188f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt
@@ -0,0 +1,4 @@
+{"a"=1;"b"="aaa";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\2"};
+{"a"=1;"b"="ddd";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\3"};
+{"a"=2;"b"="bbb";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\2"};
+{"a"=2;"b"="ccc";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\3"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt.attr
new file mode 100644
index 0000000000..f3588e8e3c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_pg_arr.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["PgType";"int2"]];
+ ["b";["PgType";"text"]];
+ ["c";["PgType";"_int2"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_strings.txt b/yql/essentials/tests/sql/suites/blocks/input_strings.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_strings.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_strings.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_strings.txt.attr
new file mode 100644
index 0000000000..157b4f5c1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_strings.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt
new file mode 100644
index 0000000000..a8d18ef289
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt
@@ -0,0 +1,12 @@
+{"key"=#; "s"="4";"s_opt"="e";"utf"="б"};
+{"key"="3";"s"="2";"s_opt"="k";"utf"="й"};
+{"key"=#; "s"="7";"s_opt"="f";"utf"="в"};
+{"key"="1";"s"="5";"s_opt"=#; "utf"="д"};
+{"key"=#; "s"="1";"s_opt"=#; "utf"="а"};
+{"key"="2";"s"="3";"s_opt"="i";"utf"="Ñ‘"};
+{"key"="1";"s"="3";"s_opt"="q";"utf"="г"};
+{"key"="2";"s"="7";"s_opt"=#; "utf"="з"};
+{"key"="1";"s"="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1";"s_opt"="c";"utf"="е"};
+{"key"="3";"s"="6";"s_opt"="c";"utf"="и"};
+{"key"="2";"s"="8";"s_opt"="z";"utf"="ж"};
+{"key"="3";"s"="2";"s_opt"="k";"utf"="к"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt.attr
new file mode 100644
index 0000000000..563f941406
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_strings_opt.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType"; ["DataType";"String"]]];
+ ["s";["DataType";"String"]];
+ ["s_opt";["OptionalType"; ["DataType";"String"]]];
+ ["utf";["DataType";"Utf8"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_struct.txt b/yql/essentials/tests/sql/suites/blocks/input_struct.txt
new file mode 100644
index 0000000000..1c42304946
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_struct.txt
@@ -0,0 +1,9 @@
+{"key"=1;"val"={"a"=11;"x"=1111;"o"=111;};};
+{"key"=2;"val"={"a"=22;"x"=2222;"o"=222;};};
+{"key"=3;"val"={"a"=33;"x"=3333;"o"=333;};};
+{"key"=4;"val"={"a"=44;"x"=4444;"o"=#;};};
+{"key"=5;"val"={"a"=55;"x"=5555;"o"=555;};};
+{"key"=6;"val"={"a"=66;"x"=6666;"o"=#;};};
+{"key"=7;"val"={"a"=77;"x"=7777;"o"=#;};};
+{"key"=8;"val"={"a"=88;"x"=8888;"o"=888;};};
+{"key"=9;"val"={"a"=99;"x"=9999;"o"=#;};};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_struct.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_struct.txt.attr
new file mode 100644
index 0000000000..a28cc27044
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_struct.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["val";["StructType";[
+ ["a";["DataType";"Int32"]];
+ ["x";["DataType";"Int32"]];
+ ["o";["OptionalType";["DataType";"Int32"]]];
+ ]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt b/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt
new file mode 100644
index 0000000000..26719a34a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt
@@ -0,0 +1,2 @@
+{"a"=0u;"b"=0u;"c"=0u;"d"=-2440588;"e"=-210866799477;"f"=-210866799476543211};
+{"a"=49672u;"b"=4291747199u;"c"=4291747199999999u;"d"=53375807;"e"=4611669728523;"f"=4611669728523456789};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt.attr
new file mode 100644
index 0000000000..28015822b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_dates.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"Date"]];
+ ["b";["DataType";"Datetime"]];
+ ["c";["DataType";"Timestamp"]];
+ ["d";["DataType";"Date32"]];
+ ["e";["DataType";"Datetime64"]];
+ ["f";["DataType";"Timestamp64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt b/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt
new file mode 100644
index 0000000000..b97e513d27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt
@@ -0,0 +1,4 @@
+{"a"=0;"b"=0};
+{"a"=4291747199999999;"b"=9223339708799999999};
+{"a"=-4291747199999999;"b"=-9223339708799999999};
+
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt.attr
new file mode 100644
index 0000000000..5a665b0202
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_interval.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"Interval"]];
+ ["b";["DataType";"Interval64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt b/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt
new file mode 100644
index 0000000000..9f9c299eed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt
@@ -0,0 +1,4 @@
+{"i8"=0;"ui8"=0u;"i16"=0;"ui16"=0u;"i32"=0;"ui32"=0u;"i64"=0;"ui64"=0u;"f4"=0.0;"f8"=0.0};
+{"i8"=-128;"ui8"=0u;"i16"=-32768;"ui16"=0u;"i32"=-2147483648;"ui32"=0u;"i64"=-9223372036854775808;"ui64"=0u;"f4"=%-inf;"f8"=%-inf};
+{"i8"=127;"ui8"=255u;"i16"=32767;"ui16"=65535u;"i32"=2147483647;"ui32"=4294967295u;"i64"=9223372036854775807;"ui64"=18446744073709551615u;"f4"=%inf;"f8"=%inf};
+{"i8"=0;"ui8"=0u;"i16"=0;"ui16"=0u;"i32"=0;"ui32"=0u;"i64"=0;"ui64"=0u;"f4"=%nan;"f8"=%nan}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt.attr
new file mode 100644
index 0000000000..fea8a89ee2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_numbers.txt.attr
@@ -0,0 +1,15 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["i8";["DataType";"Int8"]];
+ ["ui8";["DataType";"Uint8"]];
+ ["i16";["DataType";"Int16"]];
+ ["ui16";["DataType";"Uint16"]];
+ ["i32";["DataType";"Int32"]];
+ ["ui32";["DataType";"Uint32"]];
+ ["i64";["DataType";"Int64"]];
+ ["ui64";["DataType";"Uint64"]];
+ ["f4";["DataType";"Float"]];
+ ["f8";["DataType";"Double"]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt b/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt
new file mode 100644
index 0000000000..efaefa3be3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt
@@ -0,0 +1 @@
+{"s"="foo";"u"="bar";"y"={a=1};"j"="[1,2,3]";"jd"="[4,5,6]";"tzd"=",[\0\1";"tzdt"=":{YB\0\1";tzts="\0\3|\\\xA6\xC3^\x94\0\1";"ud"="xV4\x12\xBC\x9A\xF0\xDE\0224Vx\x90\0224V"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt.attr
new file mode 100644
index 0000000000..8c64c6f3cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_to_pg_strings.txt.attr
@@ -0,0 +1,14 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["s";["DataType";"String"]];
+ ["u";["DataType";"Utf8"]];
+ ["y";["DataType";"Yson"]];
+ ["j";["DataType";"Json"]];
+ ["jd";["DataType";"JsonDocument"]];
+ ["ud";["DataType";"Uuid"]];
+ ["tzd";["DataType";"TzDate"]];
+ ["tzdt";["DataType";"TzDatetime"]];
+ ["tzts";["DataType";"TzTimestamp"]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt b/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt
new file mode 100644
index 0000000000..e898f381ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt
@@ -0,0 +1,2 @@
+{"a"="023";"b"="aaa";"c"="foo";"d"=#;"e"=1;"f"=2;"g"=#};
+{"a"="037";"b"="ddd";"c"="bar";"d"=#;"e"=3;"f"=4;"g"=#}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt.attr
new file mode 100644
index 0000000000..507d3a002b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_tofrom_pg.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"Utf8"]];
+ ["b";["PgType";"text"]];
+ ["c";["PgType";"cstring"]];
+ ["d";["OptionalType";["DataType";"Utf8"]]];
+ ["e";["DataType";"Int64"]];
+ ["f";["PgType";"int8"]];
+ ["g";["OptionalType";["DataType";"Int64"]]];
+ ]];
+}} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/blocks/input_top.txt b/yql/essentials/tests/sql/suites/blocks/input_top.txt
new file mode 100644
index 0000000000..a9a00994e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_top.txt
@@ -0,0 +1,11 @@
+{"key"=1;"subkey"=4;"value"="a"};
+{"key"=2;"subkey"=5;"value"="b"};
+{"key"=1;"subkey"=3;"value"="c"};
+{"key"=2;"subkey"=2;"value"="d"};
+{"key"=1;"subkey"=3;"value"="e"};
+{"key"=2;"subkey"=4;"value"="f"};
+{"key"=1;"subkey"=5;"value"="g"};
+{"key"=2;"subkey"=6;"value"="h"};
+{"key"=1;"subkey"=1;"value"="i"};
+{"key"=2;"subkey"=5;"value"="j"};
+{"key"=1;"subkey"=3;"value"="k"};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_top.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_top.txt.attr
new file mode 100644
index 0000000000..3ddddb86b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_top.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["subkey";["DataType";"Int32"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_tuple.txt b/yql/essentials/tests/sql/suites/blocks/input_tuple.txt
new file mode 100644
index 0000000000..f5bd074fd6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_tuple.txt
@@ -0,0 +1,3 @@
+{"key"=10u;"subkey"=3u;"value"=[1;2.3]};
+{"key"=20u;"subkey"=4u;"value"=[3;4.2]};
+{"key"=20u;"subkey"=5u;"value"=[5;6.1]};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_tuple.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_tuple.txt.attr
new file mode 100644
index 0000000000..bad356fdd4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_tuple.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"Uint32"]];
+ ["value";["TupleType";[["DataType";"Int32"];["DataType";"Double"]]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint16.txt b/yql/essentials/tests/sql/suites/blocks/input_uint16.txt
new file mode 100644
index 0000000000..8d8e86ff3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint16.txt
@@ -0,0 +1,2 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint16.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint16.txt.attr
new file mode 100644
index 0000000000..99a1ee195f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint16.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint16"]];
+ ["subkey";["DataType";"Uint16"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint32.txt b/yql/essentials/tests/sql/suites/blocks/input_uint32.txt
new file mode 100644
index 0000000000..8d8e86ff3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint32.txt
@@ -0,0 +1,2 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint32.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint32.txt.attr
new file mode 100644
index 0000000000..3a10c2a1ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint32.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"Uint32"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt b/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt
new file mode 100644
index 0000000000..0f01d78b2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt
@@ -0,0 +1,10 @@
+{"key"=10u;"subkey"=%true;"value"=%false;};
+{"key"=20u;"subkey"=%false;"value"=%true;};
+{"key"=30u;"subkey"=%false;"value"=%false;};
+{"key"=40u;"subkey"=#;"value"=%false;};
+{"key"=50u;"subkey"=%false;"value"=%true;};
+{"key"=60u;"subkey"=#;"value"=%true;};
+{"key"=70u;"subkey"=%true;"value"=%false;};
+{"key"=80u;"subkey"=%false;"value"=%true;};
+{"key"=90u;"subkey"=%false;"value"=%false;};
+{"key"=99u;"subkey"=%true;"value"=%true;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt.attr
new file mode 100644
index 0000000000..f0670909b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint32_optbool_bool.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["OptionalType"; ["DataType";"Bool"]]];
+ ["value";["DataType";"Bool"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64.txt
new file mode 100644
index 0000000000..8d8e86ff3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64.txt
@@ -0,0 +1,2 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64.txt.attr
new file mode 100644
index 0000000000..7240806897
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["subkey";["DataType";"Uint64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt
new file mode 100644
index 0000000000..4fb87dfa6c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt
@@ -0,0 +1,3 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
+{"key"=30u;"subkey"=5u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt.attr
new file mode 100644
index 0000000000..7240806897
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["subkey";["DataType";"Uint64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt
new file mode 100644
index 0000000000..67e9ac3f66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt
@@ -0,0 +1,5 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
+{"key"=30u;"subkey"=5u;};
+{"key"=#;"subkey"=6u;};
+{"key"=#;"subkey"=5u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt.attr
new file mode 100644
index 0000000000..6107e21eaa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_filter_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Uint64"]]];
+ ["subkey";["DataType";"Uint64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt
new file mode 100644
index 0000000000..86ae4ac337
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt
@@ -0,0 +1,3 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=#;};
+{"key"=30u;"subkey"=[];};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt.attr
new file mode 100644
index 0000000000..3633a48f45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_nested_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["subkey";["OptionalType";["OptionalType";["DataType";"Uint64"]]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt
new file mode 100644
index 0000000000..5301366c85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt
@@ -0,0 +1,3 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
+{"key"=#;"subkey"=5u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt.attr
new file mode 100644
index 0000000000..6107e21eaa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Uint64"]]];
+ ["subkey";["DataType";"Uint64"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt
new file mode 100644
index 0000000000..007ce6345f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt
@@ -0,0 +1,5 @@
+{"key"=10u;"subkey"=1u;};
+{"key"=20u;"subkey"=2u;};
+{"key"=#;"subkey"=3u;};
+{"key"=40u;"subkey"=#;};
+{"key"=#;"subkey"=#;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt.attr
new file mode 100644
index 0000000000..738708acf1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint64_opt2.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Uint64"]]];
+ ["subkey";["OptionalType";["DataType";"Uint64"]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint8.txt b/yql/essentials/tests/sql/suites/blocks/input_uint8.txt
new file mode 100644
index 0000000000..8d8e86ff3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint8.txt
@@ -0,0 +1,2 @@
+{"key"=10u;"subkey"=3u;};
+{"key"=20u;"subkey"=4u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint8.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint8.txt.attr
new file mode 100644
index 0000000000..619dbdd1bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint8.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint8"]];
+ ["subkey";["DataType";"Uint8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt b/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt
new file mode 100644
index 0000000000..9a504890eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt
@@ -0,0 +1,2 @@
+{"key"=100u;"subkey"=3u;};
+{"key"=200u;"subkey"=4u;};
diff --git a/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt.attr b/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt.attr
new file mode 100644
index 0000000000..619dbdd1bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/input_uint8_big.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint8"]];
+ ["subkey";["DataType";"Uint8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_date.cfg b/yql/essentials/tests/sql/suites/blocks/interval_add_date.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_date.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_date.sql b/yql/essentials/tests/sql/suites/blocks/interval_add_date.sql
new file mode 100644
index 0000000000..bb395b7f75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_date.sql
@@ -0,0 +1,31 @@
+USE plato;
+
+SELECT
+ b.ni + a.na,
+ b.wi + a.na,
+ b.ni + a.naz,
+ b.wi + a.naz,
+ b.ni + a.nd,
+ b.wi + a.nd,
+ b.ni + a.ndz,
+ b.wi + a.ndz,
+ b.ni + a.nt,
+ b.wi + a.nt,
+ b.ni + a.ntz,
+ b.wi + a.ntz,
+
+ b.ni + a.wa,
+ b.wi + a.wa,
+ b.ni + a.waz,
+ b.wi + a.waz,
+ b.ni + a.wd,
+ b.wi + a.wd,
+ b.ni + a.wdz,
+ b.wi + a.wdz,
+ b.ni + a.wt,
+ b.wi + a.wt,
+ b.ni + a.wtz,
+ b.wi + a.wtz
+FROM Dates as a CROSS JOIN Dates as b
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.sql b/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.sql
new file mode 100644
index 0000000000..1cc7f48940
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_date_scalar.sql
@@ -0,0 +1,57 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin,FuseMultiOutsWithOuterMaps";
+
+SELECT
+ ni + Date("2000-01-01") ,
+ wi + Date("2000-01-01"),
+ ni + TzDate("2000-01-01,Europe/Moscow"),
+ wi + TzDate("2000-01-01,Europe/Moscow"),
+ ni + Datetime("2000-01-01T03:04:05Z"),
+ wi + Datetime("2000-01-01T03:04:05Z"),
+ ni + TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ wi + TzDatetime("2000-01-01T03:04:05,Europe/Moscow"),
+ ni + Timestamp("2000-01-01T03:04:05.678912Z"),
+ wi + Timestamp("2000-01-01T03:04:05.678912Z"),
+ ni + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ wi + TzTimestamp("2000-01-01T03:04:05.678912,Europe/Moscow"),
+ ni + Date32("1900-01-01"),
+ wi + Date32("1900-01-01"),
+ ni + Datetime64("1900-01-01T03:04:05Z"),
+ wi + Datetime64("1900-01-01T03:04:05Z"),
+ ni + Timestamp64("1900-01-01T03:04:05.678912Z"),
+ wi + Timestamp64("1900-01-01T03:04:05.678912Z"),
+ ni + TzDate32("1900-01-01,Europe/Moscow"),
+ wi + TzDate32("1900-01-01,Europe/Moscow"),
+ ni + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ wi + TzDatetime64("1900-01-01T03:04:05,Europe/Moscow"),
+ ni + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+ wi + TzTimestamp64("1900-01-01T03:04:05.678912,Europe/Moscow"),
+FROM Dates;
+
+SELECT
+ Interval("P1D") + na,
+ Interval64("P1D") + na,
+ Interval("P1D") + naz,
+ Interval64("P1D") + naz,
+ Interval("P1D") + nd,
+ Interval64("P1D") + nd,
+ Interval("P1D") + ndz,
+ Interval64("P1D") + ndz,
+ Interval("P1D") + nt,
+ Interval64("P1D") + nt,
+ Interval("P1D") + ntz,
+ Interval64("P1D") + ntz,
+ Interval("P1D") + wa,
+ Interval64("P1D") + wa,
+ Interval("P1D") + wd,
+ Interval64("P1D") + wd,
+ Interval("P1D") + wt,
+ Interval64("P1D") + wt,
+ Interval("P1D") + waz,
+ Interval64("P1D") + waz,
+ Interval("P1D") + wdz,
+ Interval64("P1D") + wdz,
+ Interval("P1D") + wtz,
+ Interval64("P1D") + wtz
+FROM Dates;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_interval.cfg b/yql/essentials/tests/sql/suites/blocks/interval_add_interval.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_interval.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_interval.sql b/yql/essentials/tests/sql/suites/blocks/interval_add_interval.sql
new file mode 100644
index 0000000000..e1e84d209a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_interval.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+SELECT
+ a.ni + b.ni,
+ a.ni + b.wi,
+ a.wi + b.ni,
+ a.wi + b.wi
+FROM Dates AS a CROSS JOIN Dates as b
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.sql b/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.sql
new file mode 100644
index 0000000000..df0d35160c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_add_interval_scalar.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+SELECT
+ ni + Interval("P1D"),
+ wi + Interval("P1D"),
+ ni + Interval64("P1D"),
+ wi + Interval64("P1D")
+FROM Dates;
+
+SELECT
+ Interval("P1D") + ni,
+ Interval("P1D") + wi,
+ Interval64("P1D") + ni,
+ Interval64("P1D") + wi
+FROM Dates;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_div.cfg b/yql/essentials/tests/sql/suites/blocks/interval_div.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_div.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_div.sql b/yql/essentials/tests/sql/suites/blocks/interval_div.sql
new file mode 100644
index 0000000000..acbb470663
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_div.sql
@@ -0,0 +1,22 @@
+USE plato;
+
+SELECT
+ a.ni / b.i8,
+ a.wi / b.i8,
+ a.ni / b.u8,
+ a.wi / b.u8,
+ a.ni / b.i16,
+ a.wi / b.i16,
+ a.ni / b.u16,
+ a.wi / b.u16,
+ a.ni / b.i32,
+ a.wi / b.i32,
+ a.ni / b.u32,
+ a.wi / b.u32,
+ a.ni / b.i64,
+ a.wi / b.i64,
+ a.ni / b.u64,
+ a.wi / b.u64,
+FROM Dates as a CROSS JOIN Dates as b;
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.sql b/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.sql
new file mode 100644
index 0000000000..2c9dbb8cb9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_div_scalar.sql
@@ -0,0 +1,41 @@
+USE plato;
+
+SELECT
+ ni / Int8("10"),
+ wi / Int8("10"),
+ ni / Uint8("11"),
+ wi / Uint8("11"),
+ ni / Int16("12"),
+ wi / Int16("12"),
+ ni / Uint16("13"),
+ wi / Uint16("13"),
+ ni / Int32("14"),
+ wi / Int32("14"),
+ ni / Uint32("15"),
+ wi / Uint32("15"),
+ ni / Int64("16"),
+ wi / Int64("16"),
+ ni / Uint64("17"),
+ wi / Uint64("17"),
+FROM Dates;
+
+SELECT
+ Interval("P1D") / i8,
+ Interval64("P1D") / i8,
+ Interval("P1D") / u8,
+ Interval64("P1D") / u8,
+ Interval("P1D") / i16,
+ Interval64("P1D") / i16,
+ Interval("P1D") / u16,
+ Interval64("P1D") / u16,
+ Interval("P1D") / i32,
+ Interval64("P1D") / i32,
+ Interval("P1D") / u32,
+ Interval64("P1D") / u32,
+ Interval("P1D") / i64,
+ Interval64("P1D") / i64,
+ Interval("P1D") / u64,
+ Interval64("P1D") / u64
+FROM Dates;
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_mul.cfg b/yql/essentials/tests/sql/suites/blocks/interval_mul.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_mul.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_mul.sql b/yql/essentials/tests/sql/suites/blocks/interval_mul.sql
new file mode 100644
index 0000000000..bd5727a48e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_mul.sql
@@ -0,0 +1,40 @@
+USE plato;
+
+SELECT
+ a.ni * b.i8,
+ a.wi * b.i8,
+ a.ni * b.u8,
+ a.wi * b.u8,
+ a.ni * b.i16,
+ a.wi * b.i16,
+ a.ni * b.u16,
+ a.wi * b.u16,
+ a.ni * b.i32,
+ a.wi * b.i32,
+ a.ni * b.u32,
+ a.wi * b.u32,
+ a.ni * b.i64,
+ a.wi * b.i64,
+ a.ni * b.u64,
+ a.wi * b.u64,
+FROM Dates as a CROSS JOIN Dates as b;
+
+SELECT
+ b.i8 * a.ni,
+ b.i8 * a.wi,
+ b.u8 * a.ni,
+ b.u8 * a.wi,
+ b.i16 * a.ni,
+ b.i16 * a.wi,
+ b.u16 * a.ni,
+ b.u16 * a.wi,
+ b.i32 * a.ni,
+ b.i32 * a.wi,
+ b.u32 * a.ni,
+ b.u32 * a.wi,
+ b.i64 * a.ni,
+ b.i64 * a.wi,
+ b.u64 * a.ni,
+ b.u64 * a.wi,
+FROM Dates as a CROSS JOIN Dates as b;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.cfg
new file mode 100644
index 0000000000..d0a66cb111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.cfg
@@ -0,0 +1,2 @@
+in Dates dates.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.sql b/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.sql
new file mode 100644
index 0000000000..6fc2e88ad3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_mul_scalar.sql
@@ -0,0 +1,79 @@
+USE plato;
+
+SELECT
+ ni * Int8("10"),
+ wi * Int8("10"),
+ ni * Uint8("11"),
+ wi * Uint8("11"),
+ ni * Int16("12"),
+ wi * Int16("12"),
+ ni * Uint16("13"),
+ wi * Uint16("13"),
+ ni * Int32("14"),
+ wi * Int32("14"),
+ ni * Uint32("15"),
+ wi * Uint32("15"),
+ ni * Int64("16"),
+ wi * Int64("16"),
+ ni * Uint64("17"),
+ wi * Uint64("17"),
+FROM Dates;
+
+SELECT
+ Int8("10") * ni,
+ Int8("10") * wi,
+ Uint8("11") * ni,
+ Uint8("11") * wi,
+ Int16("12") * ni,
+ Int16("12") * wi,
+ Uint16("13") * ni,
+ Uint16("13") * wi,
+ Int32("14") * ni,
+ Int32("14") * wi,
+ Uint32("15") * ni,
+ Uint32("15") * wi,
+ Int64("16") * ni,
+ Int64("16") * wi,
+ Uint64("17") * ni,
+ Uint64("17") * wi
+FROM Dates;
+
+SELECT
+ Interval("P1D") * i8,
+ Interval64("P1D") * i8,
+ Interval("P1D") * u8,
+ Interval64("P1D") * u8,
+ Interval("P1D") * i16,
+ Interval64("P1D") * i16,
+ Interval("P1D") * u16,
+ Interval64("P1D") * u16,
+ Interval("P1D") * i32,
+ Interval64("P1D") * i32,
+ Interval("P1D") * u32,
+ Interval64("P1D") * u32,
+ Interval("P1D") * i64,
+ Interval64("P1D") * i64,
+ Interval("P1D") * u64,
+ Interval64("P1D") * u64
+FROM Dates;
+
+SELECT
+ i8 * Interval("P1D"),
+ i8 * Interval64("P1D"),
+ u8 * Interval("P1D"),
+ u8 * Interval64("P1D"),
+ i16 * Interval("P1D"),
+ i16 * Interval64("P1D"),
+ u16 * Interval("P1D"),
+ u16 * Interval64("P1D"),
+ i32 * Interval("P1D"),
+ i32 * Interval64("P1D"),
+ u32 * Interval("P1D"),
+ u32 * Interval64("P1D"),
+ i64 * Interval("P1D"),
+ i64 * Interval64("P1D"),
+ u64 * Interval("P1D"),
+ u64 * Interval64("P1D")
+FROM Dates;
+
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.cfg b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.sql b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.sql
new file mode 100644
index 0000000000..eaf0809d0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ a.ni - b.ni,
+ a.ni - b.wi,
+ a.wi - b.ni,
+ a.wi - b.wi
+FROM Dates as a CROSS JOIN Dates as b
+
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.cfg b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.cfg
new file mode 100644
index 0000000000..8d2d2a19fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.cfg
@@ -0,0 +1 @@
+in Dates dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.sql b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.sql
new file mode 100644
index 0000000000..4339da03f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/interval_sub_interval_scalar.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+SELECT
+ ni - Interval("P1D"),
+ wi - Interval("P1D"),
+ ni - Interval64("P1D"),
+ wi - Interval64("P1D")
+FROM Dates;
+
+SELECT
+ Interval("P1D") - ni,
+ Interval("P1D") - wi,
+ Interval64("P1D") - ni,
+ Interval64("P1D") - wi
+FROM Dates;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/json_document_type.cfg b/yql/essentials/tests/sql/suites/blocks/json_document_type.cfg
new file mode 100644
index 0000000000..8e18b34b94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/json_document_type.cfg
@@ -0,0 +1 @@
+in Input input_json_document.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/json_document_type.sql b/yql/essentials/tests/sql/suites/blocks/json_document_type.sql
new file mode 100644
index 0000000000..942f54bf80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/json_document_type.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT
+ key,
+ SOME(val) as someVal,
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.cfg b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.cfg
new file mode 100644
index 0000000000..34475912cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.cfg
@@ -0,0 +1,2 @@
+in Input input_strings.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.sql b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.sql
new file mode 100644
index 0000000000..81a521ab93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_basic.sql
@@ -0,0 +1,17 @@
+USE plato;
+
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin";
+
+
+$ns_tolower = ($x) -> (AssumeNonStrict(String::AsciiToLower($x)));
+$ns_toupper = ($x) -> (AssumeNonStrict(String::AsciiToUpper($x)));
+
+-- full block
+select * from Input where $ns_tolower(value) > "aaa" and subkey == "1";
+
+-- partial block due to lazy non-strict node
+select * from Input where subkey == "2" and $ns_toupper(value) <= "ZZZ";
+
+-- full block - same non strict is used in first arg of AND
+select * from Input where $ns_toupper(value) >= "AAA" and $ns_toupper(value) <= "ZZZ" and subkey == "3";
+
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.cfg b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.cfg
new file mode 100644
index 0000000000..34475912cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.cfg
@@ -0,0 +1,2 @@
+in Input input_strings.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.sql b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.sql
new file mode 100644
index 0000000000..2ae846ae4c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_nested.sql
@@ -0,0 +1,4 @@
+USE plato;
+
+-- partial blocks due to non strict in second arg of AND
+select if(value > "aaa" and String::AsciiToLower(AssumeNonStrict(subkey)) > "3", "foo", "bar"), value, subkey from Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.cfg b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.cfg
new file mode 100644
index 0000000000..b65712414d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.cfg
@@ -0,0 +1 @@
+in Input input_strings.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.sql b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.sql
new file mode 100644
index 0000000000..647de993e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/lazy_nonstrict_with_scalar_ctx.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+$one = select min(AssumeNonStrict(value)) from Input;
+$two = select AssumeNonStrict(min(value)) from Input;
+
+-- fully converted to blocks - scalar context is assumed strict
+select * from Input where subkey != "1" and value > $one;
+
+-- partially converted to blocks - AssumeStrict is calculated outside of scalar context
+select * from Input where subkey != "2" and value > $two;
diff --git a/yql/essentials/tests/sql/suites/blocks/member.cfg b/yql/essentials/tests/sql/suites/blocks/member.cfg
new file mode 100644
index 0000000000..ed506aaf28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/member.cfg
@@ -0,0 +1 @@
+in Input input_struct.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/member.sql b/yql/essentials/tests/sql/suites/blocks/member.sql
new file mode 100644
index 0000000000..199d5c17bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/member.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+SELECT
+ val.a as a,
+ <|qq:key,qkrq:"QKRQ"|> as q,
+ /* XXX: <AddMember> callable always expands to <AsStruct>. */
+ AddMember(val, "k", key) as wik,
+ /* XXX: <RemoveMember> callable always expands to <AsStruct>. */
+ RemoveMember(val, "x") as wox,
+FROM Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_strings.cfg b/yql/essentials/tests/sql/suites/blocks/minmax_strings.cfg
new file mode 100644
index 0000000000..476f4bfed1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_strings.cfg
@@ -0,0 +1 @@
+in Input input_strings_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_strings.sql b/yql/essentials/tests/sql/suites/blocks/minmax_strings.sql
new file mode 100644
index 0000000000..776834e93a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_strings.sql
@@ -0,0 +1,21 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+select
+ key,
+
+ max(s) as maxs,
+ min(s) as mins,
+ min(s_opt) as mins_opt,
+ max(s_opt) as maxs_opt,
+
+ max(distinct utf) as dmaxs,
+ min(distinct utf) as dmins,
+ min(distinct s_opt) as dmins_opt,
+ max(distinct s_opt) as dmaxs_opt,
+
+from Input
+group by key
+order by key;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.cfg b/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.cfg
new file mode 100644
index 0000000000..476f4bfed1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.cfg
@@ -0,0 +1 @@
+in Input input_strings_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.sql b/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.sql
new file mode 100644
index 0000000000..3fe3c7b524
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_strings_filter.sql
@@ -0,0 +1,17 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+select
+ key,
+
+ max(s) as maxs,
+ min(s) as mins,
+ min(s_opt) as mins_opt,
+ max(s_opt) as maxs_opt,
+
+from Input
+where key != "1" and s not in ("7", "8")
+group by key
+order by key;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_tuple.cfg b/yql/essentials/tests/sql/suites/blocks/minmax_tuple.cfg
new file mode 100644
index 0000000000..b65712414d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_tuple.cfg
@@ -0,0 +1 @@
+in Input input_strings.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/minmax_tuple.sql b/yql/essentials/tests/sql/suites/blocks/minmax_tuple.sql
new file mode 100644
index 0000000000..a785e7c958
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/minmax_tuple.sql
@@ -0,0 +1,16 @@
+pragma yt.UsePartitionsByKeysForFinalAgg="false";
+
+USE plato;
+
+select
+ key,
+ min(AsTuple(subkey, value)) as min,
+ max(AsTuple(subkey, value)) as max,
+from Input
+group by key
+order by key;
+
+select
+ min(AsTuple(subkey, value)) as min,
+ max(AsTuple(subkey, value)) as max,
+from Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/mod_uint64.cfg b/yql/essentials/tests/sql/suites/blocks/mod_uint64.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mod_uint64.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/mod_uint64.sql b/yql/essentials/tests/sql/suites/blocks/mod_uint64.sql
new file mode 100644
index 0000000000..9de44e5756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mod_uint64.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key%subkey,999ul%key,subkey%0ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.cfg b/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.cfg
new file mode 100644
index 0000000000..46fee85c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt2.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.sql b/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.sql
new file mode 100644
index 0000000000..9de44e5756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mod_uint64_opt2.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key%subkey,999ul%key,subkey%0ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.cfg b/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.cfg
new file mode 100644
index 0000000000..46fee85c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt2.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.sql b/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.sql
new file mode 100644
index 0000000000..52cda1db0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/mul_uint64_opt2.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key*subkey,1000ul*key,subkey*1ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/nested_optionals.cfg b/yql/essentials/tests/sql/suites/blocks/nested_optionals.cfg
new file mode 100644
index 0000000000..c0f7c37ee1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/nested_optionals.cfg
@@ -0,0 +1 @@
+in Input input_uint64_nested_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/nested_optionals.sql b/yql/essentials/tests/sql/suites/blocks/nested_optionals.sql
new file mode 100644
index 0000000000..f14105be2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/nested_optionals.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+1u,subkey
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/not.cfg b/yql/essentials/tests/sql/suites/blocks/not.cfg
new file mode 100644
index 0000000000..e4a99991a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/not.cfg
@@ -0,0 +1 @@
+in Input input_bool.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/not.sql b/yql/essentials/tests/sql/suites/blocks/not.sql
new file mode 100644
index 0000000000..6b7883d03d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/not.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key,subkey,not key
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/not_opt.cfg b/yql/essentials/tests/sql/suites/blocks/not_opt.cfg
new file mode 100644
index 0000000000..a159493a2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/not_opt.cfg
@@ -0,0 +1 @@
+in Input input_bool_opt.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/not_opt.sql b/yql/essentials/tests/sql/suites/blocks/not_opt.sql
new file mode 100644
index 0000000000..6b7883d03d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/not_opt.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key,subkey,not key
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/partial_blocks1.cfg b/yql/essentials/tests/sql/suites/blocks/partial_blocks1.cfg
new file mode 100644
index 0000000000..5ee9471fc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/partial_blocks1.cfg
@@ -0,0 +1 @@
+in Input input_uint64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/partial_blocks1.sql b/yql/essentials/tests/sql/suites/blocks/partial_blocks1.sql
new file mode 100644
index 0000000000..98b1bbd00d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/partial_blocks1.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ 2*(key+subkey),1ul+key+key+key,subkey+2ul,key
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/pg.cfg b/yql/essentials/tests/sql/suites/blocks/pg.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg.sql b/yql/essentials/tests/sql/suites/blocks/pg.sql
new file mode 100644
index 0000000000..050d81b633
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ a,
+ b,
+ c,
+ d,
+ len(d)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_call.cfg b/yql/essentials/tests/sql/suites/blocks/pg_call.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_call.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_call.sql b/yql/essentials/tests/sql/suites/blocks/pg_call.sql
new file mode 100644
index 0000000000..cb5def9f51
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_call.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ a || a, a || 'x'p, c + c, c * 10p, Pg::upper(a), Pg::concat(a,99)
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_from_dates.cfg b/yql/essentials/tests/sql/suites/blocks/pg_from_dates.cfg
new file mode 100644
index 0000000000..76186af27f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_from_dates.cfg
@@ -0,0 +1 @@
+in Input input_from_pg_dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_from_dates.sql b/yql/essentials/tests/sql/suites/blocks/pg_from_dates.sql
new file mode 100644
index 0000000000..d8fe47bd32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_from_dates.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ FromPg(a), FromPg(b)
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_sort.cfg b/yql/essentials/tests/sql/suites/blocks/pg_sort.cfg
new file mode 100644
index 0000000000..5356944180
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_sort.cfg
@@ -0,0 +1 @@
+in Input input_pg_arr.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_sort.sql b/yql/essentials/tests/sql/suites/blocks/pg_sort.sql
new file mode 100644
index 0000000000..8d5fcffce2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_sort.sql
@@ -0,0 +1,5 @@
+USE plato;
+SELECT
+ *
+FROM Input
+ORDER BY a,b desc,c desc
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_dates.cfg b/yql/essentials/tests/sql/suites/blocks/pg_to_dates.cfg
new file mode 100644
index 0000000000..e0f8a9c251
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_dates.cfg
@@ -0,0 +1 @@
+in Input input_to_pg_dates.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_dates.sql b/yql/essentials/tests/sql/suites/blocks/pg_to_dates.sql
new file mode 100644
index 0000000000..95dcb9db02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_dates.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ ToPg(a), ToPg(b), ToPg(c), ToPg(d), ToPg(e), ToPg(f)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_interval.cfg b/yql/essentials/tests/sql/suites/blocks/pg_to_interval.cfg
new file mode 100644
index 0000000000..9280de6a86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_interval.cfg
@@ -0,0 +1 @@
+in Input input_to_pg_interval.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_interval.sql b/yql/essentials/tests/sql/suites/blocks/pg_to_interval.sql
new file mode 100644
index 0000000000..094f64ae04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_interval.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ ToPg(a), ToPg(b)
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.cfg b/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.cfg
new file mode 100644
index 0000000000..5d629ee015
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.cfg
@@ -0,0 +1,2 @@
+in Input input_to_pg_numbers.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.sql b/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.sql
new file mode 100644
index 0000000000..b220cc3050
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_numbers.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+SELECT
+ ToPg(i8), ToPg(ui8),
+ ToPg(i16), ToPg(ui16),
+ ToPg(i32), ToPg(ui32),
+ ToPg(i64), ToPg(ui64),
+ ToPg(f4), ToPg(f8)
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_strings.cfg b/yql/essentials/tests/sql/suites/blocks/pg_to_strings.cfg
new file mode 100644
index 0000000000..1b143d34c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_strings.cfg
@@ -0,0 +1,2 @@
+in Input input_to_pg_strings.txt
+
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_to_strings.sql b/yql/essentials/tests/sql/suites/blocks/pg_to_strings.sql
new file mode 100644
index 0000000000..e1c3ad8b3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_to_strings.sql
@@ -0,0 +1,15 @@
+USE plato;
+pragma yt.DisableOptimizers="OutHorizontalJoin,HorizontalJoin,MultiHorizontalJoin";
+
+SELECT
+ ToPg(s), ToPg(u),
+ ToPg(y), ToPg(j),
+ ToPg(jd)
+FROM Input;
+
+
+SELECT
+ ToPg(tzd),
+ ToPg(tzdt), ToPg(tzts),
+ ToPg(ud)
+FROM Input;
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_tofrom.cfg b/yql/essentials/tests/sql/suites/blocks/pg_tofrom.cfg
new file mode 100644
index 0000000000..eebfc3c8df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_tofrom.cfg
@@ -0,0 +1 @@
+in Input input_tofrom_pg.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_tofrom.sql b/yql/essentials/tests/sql/suites/blocks/pg_tofrom.sql
new file mode 100644
index 0000000000..0b6724ffa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_tofrom.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ ToPg(a), FromPg(b), FromPg(c), ToPg(d), ToPg(e), FromPg(f), ToPg(g)
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_top_sort.cfg b/yql/essentials/tests/sql/suites/blocks/pg_top_sort.cfg
new file mode 100644
index 0000000000..5356944180
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_top_sort.cfg
@@ -0,0 +1 @@
+in Input input_pg_arr.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/pg_top_sort.sql b/yql/essentials/tests/sql/suites/blocks/pg_top_sort.sql
new file mode 100644
index 0000000000..0eabce49df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/pg_top_sort.sql
@@ -0,0 +1,5 @@
+USE plato;
+SELECT
+ *
+FROM Input
+ORDER BY a,b desc,c desc LIMIT 3
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_one_asc.cfg b/yql/essentials/tests/sql/suites/blocks/sort_one_asc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_one_asc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_one_asc.sql b/yql/essentials/tests/sql/suites/blocks/sort_one_asc.sql
new file mode 100644
index 0000000000..311e4b871b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_one_asc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ subkey+0 as subkey1, value
+FROM Input
+ORDER BY subkey1, value;
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_one_desc.cfg b/yql/essentials/tests/sql/suites/blocks/sort_one_desc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_one_desc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_one_desc.sql b/yql/essentials/tests/sql/suites/blocks/sort_one_desc.sql
new file mode 100644
index 0000000000..154842bc63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_one_desc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ subkey+0 as subkey1, value
+FROM Input
+ORDER BY subkey1, value desc;
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_asc.cfg b/yql/essentials/tests/sql/suites/blocks/sort_two_asc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_asc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_asc.sql b/yql/essentials/tests/sql/suites/blocks/sort_two_asc.sql
new file mode 100644
index 0000000000..a379cc27bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_asc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key, subkey1, value;
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_desc.cfg b/yql/essentials/tests/sql/suites/blocks/sort_two_desc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_desc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_desc.sql b/yql/essentials/tests/sql/suites/blocks/sort_two_desc.sql
new file mode 100644
index 0000000000..bbb338cf3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_desc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key desc, subkey1 desc, value;
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_mix.cfg b/yql/essentials/tests/sql/suites/blocks/sort_two_mix.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_mix.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sort_two_mix.sql b/yql/essentials/tests/sql/suites/blocks/sort_two_mix.sql
new file mode 100644
index 0000000000..9d7e8fd637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sort_two_mix.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key asc, subkey1 desc, value;
diff --git a/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.cfg b/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.cfg
new file mode 100644
index 0000000000..84150a8314
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.cfg
@@ -0,0 +1 @@
+in Input input_int32_string.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.sql b/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.sql
new file mode 100644
index 0000000000..25ead30441
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_as_agg_key.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT DISTINCT value, value_utf FROM Input ORDER BY value;
+SELECT DISTINCT value, FROM Input ORDER BY value;
+
diff --git a/yql/essentials/tests/sql/suites/blocks/string_filter.cfg b/yql/essentials/tests/sql/suites/blocks/string_filter.cfg
new file mode 100644
index 0000000000..84150a8314
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_filter.cfg
@@ -0,0 +1 @@
+in Input input_int32_string.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/string_filter.sql b/yql/essentials/tests/sql/suites/blocks/string_filter.sql
new file mode 100644
index 0000000000..2cb1054487
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_filter.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+SELECT
+ key, key + subkey, value, value_utf
+FROM Input
+WHERE subkey != 4
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.cfg b/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.cfg
new file mode 100644
index 0000000000..84150a8314
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.cfg
@@ -0,0 +1 @@
+in Input input_int32_string.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.sql b/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.sql
new file mode 100644
index 0000000000..6450080bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_len_and_cmp.sql
@@ -0,0 +1,42 @@
+USE plato;
+
+SELECT
+ key,
+
+ value == value_utf,
+ value_utf != value,
+ value < value_utf,
+ value_utf <= value_utf,
+ value > value_utf,
+ value_utf >= value_utf,
+
+ value == 'foo',
+ 'foo' != value,
+ value < 'foo',
+ 'теÑÑ‚' <= value_utf,
+ value > 'foo',
+ 'проверка'u >= value_utf,
+
+ '' == value_utf,
+ '' != value,
+ '' < value_utf,
+ '' <= value_utf,
+ '' > value_utf,
+ '' >= value_utf,
+
+ value == ''u,
+ value_utf != ''u,
+ value < ''u,
+ value_utf <= ''u,
+ value > ''u,
+ value_utf >= ''u,
+
+ len(value),
+ len(value_utf),
+ len(''),
+ len(''u),
+ len('проверка'),
+ len('теÑÑ‚'u),
+
+FROM Input
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/string_pass.cfg b/yql/essentials/tests/sql/suites/blocks/string_pass.cfg
new file mode 100644
index 0000000000..84150a8314
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_pass.cfg
@@ -0,0 +1 @@
+in Input input_int32_string.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/string_pass.sql b/yql/essentials/tests/sql/suites/blocks/string_pass.sql
new file mode 100644
index 0000000000..e58e6abd97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_pass.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+SELECT
+ key, key + subkey, value, value_utf
+FROM Input
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/string_with.cfg b/yql/essentials/tests/sql/suites/blocks/string_with.cfg
new file mode 100644
index 0000000000..84150a8314
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_with.cfg
@@ -0,0 +1 @@
+in Input input_int32_string.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/string_with.sql b/yql/essentials/tests/sql/suites/blocks/string_with.sql
new file mode 100644
index 0000000000..dc677c8c28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/string_with.sql
@@ -0,0 +1,22 @@
+pragma AnsiLike;
+pragma warning("disable", "4510");
+
+USE plato;
+
+SELECT
+ key,
+
+ YQL::StringContains(value, value_utf),
+ YQL::StringContains(value, 'o'),
+ value like 'o',
+ YQL::StringContains('foobar'u, value),
+
+ StartsWith(value, value_utf),
+ EndsWith(value, 'ar'u),
+ StartsWith('теÑтпроверка'u, value_utf),
+ EndsWith('теÑтпроверка'u, value_utf),
+
+ value like 'ba%ar',
+ value_utf like 'про%ерка',
+FROM Input
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/struct_type.cfg b/yql/essentials/tests/sql/suites/blocks/struct_type.cfg
new file mode 100644
index 0000000000..ed506aaf28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/struct_type.cfg
@@ -0,0 +1 @@
+in Input input_struct.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/struct_type.sql b/yql/essentials/tests/sql/suites/blocks/struct_type.sql
new file mode 100644
index 0000000000..942f54bf80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/struct_type.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT
+ key,
+ SOME(val) as someVal,
+FROM Input
+GROUP BY key
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.cfg b/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.cfg
new file mode 100644
index 0000000000..46fee85c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.cfg
@@ -0,0 +1 @@
+in Input input_uint64_opt2.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.sql b/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.sql
new file mode 100644
index 0000000000..28a74bab35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/sub_uint64_opt2.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key-subkey,1000ul-key,subkey-1ul
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.cfg b/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.sql b/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.sql
new file mode 100644
index 0000000000..6db7f8ea15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_one_asc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ subkey+0 as subkey1, value
+FROM Input
+ORDER BY subkey1, value limit 2;
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.cfg b/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.sql b/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.sql
new file mode 100644
index 0000000000..d0f391964f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_one_desc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ subkey+0 as subkey1, value
+FROM Input
+ORDER BY subkey1 desc, value limit 2;
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.cfg b/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.sql b/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.sql
new file mode 100644
index 0000000000..3e056b21be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_asc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key, subkey1, value limit 2;
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.cfg b/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.sql b/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.sql
new file mode 100644
index 0000000000..d8b6927e0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_desc.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key desc, subkey1 desc, value limit 2;
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.cfg b/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.cfg
new file mode 100644
index 0000000000..346b6ff2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.cfg
@@ -0,0 +1 @@
+in Input input_top.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.sql b/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.sql
new file mode 100644
index 0000000000..067e45fde2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/top_sort_two_mix.sql
@@ -0,0 +1,7 @@
+USE plato;
+pragma yt.UseNativeDescSort;
+
+SELECT
+ key, subkey+0 as subkey1, value
+FROM Input
+ORDER BY key asc, subkey1 desc, value limit 2;
diff --git a/yql/essentials/tests/sql/suites/blocks/tuple_nth.cfg b/yql/essentials/tests/sql/suites/blocks/tuple_nth.cfg
new file mode 100644
index 0000000000..d2b033ce45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/tuple_nth.cfg
@@ -0,0 +1 @@
+in Input input_int64.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/tuple_nth.sql b/yql/essentials/tests/sql/suites/blocks/tuple_nth.sql
new file mode 100644
index 0000000000..74b1c9d800
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/tuple_nth.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+insert into @tmp
+SELECT
+ key,
+ (subkey,key) as a,
+ (1,key) as b,
+ Just((subkey,key)) as c,
+ Just((Just(subkey),key)) as d,
+ Nothing(Tuple<Int32,Int32>?) as e,
+ Nothing(Tuple<Int32?,Int32>?) as f,
+FROM Input;
+
+commit;
+
+select a.0,a.1,b.0,b.1,c.0,c.1,d.0,d.1,e.0,e.1,f.0,f.1 from @tmp;
diff --git a/yql/essentials/tests/sql/suites/blocks/tuple_type.cfg b/yql/essentials/tests/sql/suites/blocks/tuple_type.cfg
new file mode 100644
index 0000000000..2c1468d47f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/tuple_type.cfg
@@ -0,0 +1 @@
+in Input input_tuple.txt
diff --git a/yql/essentials/tests/sql/suites/blocks/tuple_type.sql b/yql/essentials/tests/sql/suites/blocks/tuple_type.sql
new file mode 100644
index 0000000000..e1f04fe2de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/tuple_type.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ key+1u, (3, 4.0), value
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.cfg b/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.cfg
new file mode 100644
index 0000000000..6a38002573
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.cfg
@@ -0,0 +1,4 @@
+with_final_result_issues
+in Input input_strings.txt
+udf string_udf
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.sql b/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.sql
new file mode 100644
index 0000000000..5357170adb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/type_and_callable_stats.sql
@@ -0,0 +1,16 @@
+pragma BlockEngine='force';
+
+USE plato;
+$match = Re2::Match(@@\d+@@);
+$grep = Re2::Grep('911');
+
+SELECT
+ key,
+ String::EscapeC(value) as ok1,
+ $match(key) as no_block_udf1,
+ $grep(key) as no_block_udf2,
+ AsList(key) as no_block_list,
+ AsSet(key) as no_block_set_and_void,
+ cast(key as Double) as no_block_cast,
+ AsTuple(key, DyNumber("123")) as no_block_dynumber,
+FROM Input;
diff --git a/yql/essentials/tests/sql/suites/case/case_many_val.cfg b/yql/essentials/tests/sql/suites/case/case_many_val.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_many_val.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/case/case_many_val.sql b/yql/essentials/tests/sql/suites/case/case_many_val.sql
new file mode 100644
index 0000000000..a5b8642925
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_many_val.sql
@@ -0,0 +1,111 @@
+/* syntax version 1 */
+/* yt can not */
+$switch = ($x) -> {
+ $res = case $x
+ when 0 then 1
+ when 1 then 2
+ when 2 then 3
+ when 3 then 4
+ when 4 then 5
+ when 5 then 6
+ when 6 then 7
+ when 7 then 8
+ when 8 then 9
+ when 9 then 10
+ when 10 then 11
+ when 11 then 12
+ when 12 then 13
+ when 13 then 14
+ when 14 then 15
+ when 15 then 16
+ when 16 then 17
+ when 17 then 18
+ when 18 then 19
+ when 19 then 20
+ when 20 then 21
+ when 21 then 22
+ when 22 then 23
+ when 23 then 24
+ when 24 then 25
+ when 25 then 26
+ when 26 then 27
+ when 27 then 28
+ when 28 then 29
+ when 29 then 30
+ when 30 then 31
+ when 31 then 32
+ when 32 then 33
+ when 33 then 34
+ when 34 then 35
+ when 35 then 36
+ when 36 then 37
+ when 37 then 38
+ when 38 then 39
+ when 39 then 40
+ when 40 then 41
+ when 41 then 42
+ when 42 then 43
+ when 43 then 44
+ when 44 then 45
+ when 45 then 46
+ when 46 then 47
+ when 47 then 48
+ when 48 then 49
+ when 49 then 50
+ when 50 then 51
+ when 51 then 52
+ when 52 then 53
+ when 53 then 54
+ when 54 then 55
+ when 55 then 56
+ when 56 then 57
+ when 57 then 58
+ when 58 then 59
+ when 59 then 60
+ when 60 then 61
+ when 61 then 62
+ when 62 then 63
+ when 63 then 64
+ when 64 then 65
+ when 65 then 66
+ when 66 then 67
+ when 67 then 68
+ when 68 then 69
+ when 69 then 70
+ when 70 then 71
+ when 71 then 72
+ when 72 then 73
+ when 73 then 74
+ when 74 then 75
+ when 75 then 76
+ when 76 then 77
+ when 77 then 78
+ when 78 then 79
+ when 79 then 80
+ when 80 then 81
+ when 81 then 82
+ when 82 then 83
+ when 83 then 84
+ when 84 then 85
+ when 85 then 86
+ when 86 then 87
+ when 87 then 88
+ when 88 then 89
+ when 89 then 90
+ when 90 then 91
+ when 91 then 92
+ when 92 then 93
+ when 93 then 94
+ when 94 then 95
+ when 95 then 96
+ when 96 then 97
+ when 97 then 98
+ when 98 then 99
+ else 100
+ end;
+ return $res;
+};
+
+$expected = ListFromRange(1, 101);
+
+select ListMap(ListFromRange(0, 100), $switch) == $expected;
diff --git a/yql/essentials/tests/sql/suites/case/case_multi_val.sql b/yql/essentials/tests/sql/suites/case/case_multi_val.sql
new file mode 100644
index 0000000000..2a70a03167
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_multi_val.sql
@@ -0,0 +1 @@
+select key, subkey, case value when "jar" then "JAR" when "foo" then "FOO" else value end as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/case_opt_cond.sql b/yql/essentials/tests/sql/suites/case/case_opt_cond.sql
new file mode 100644
index 0000000000..16c3eb2e58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_opt_cond.sql
@@ -0,0 +1,5 @@
+select case when cast('true' as Bool) then 'FOO1' else 'BAR1' end
+union all
+select case when cast('false' as Bool) then 'FOO2' else 'BAR2' end
+union all
+select case when NULL then 'FOO3' else 'BAR3' end;
diff --git a/yql/essentials/tests/sql/suites/case/case_opt_then.sql b/yql/essentials/tests/sql/suites/case/case_opt_then.sql
new file mode 100644
index 0000000000..9824a06447
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_opt_then.sql
@@ -0,0 +1,5 @@
+select case when true then cast("123" as int) else 100501 end
+union all
+select case when true then NULL else 100502 end
+union all
+select case when false then NULL else 100503 end;
diff --git a/yql/essentials/tests/sql/suites/case/case_size_eq_cast.sql b/yql/essentials/tests/sql/suites/case/case_size_eq_cast.sql
new file mode 100644
index 0000000000..e5c5be7605
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_size_eq_cast.sql
@@ -0,0 +1 @@
+select key, subkey, case length(value) when cast(3 as smallint) then "JAR" else value end as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/case_then_else.sql b/yql/essentials/tests/sql/suites/case/case_then_else.sql
new file mode 100644
index 0000000000..5bdda9497f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_then_else.sql
@@ -0,0 +1 @@
+select case when key != subkey then subkey else value end from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/case_val_then_else.sql b/yql/essentials/tests/sql/suites/case/case_val_then_else.sql
new file mode 100644
index 0000000000..78ec7d4080
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_val_then_else.sql
@@ -0,0 +1 @@
+select case value when key then subkey else value end from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/case_val_when_then.sql b/yql/essentials/tests/sql/suites/case/case_val_when_then.sql
new file mode 100644
index 0000000000..55b6740500
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_val_when_then.sql
@@ -0,0 +1 @@
+select key, subkey, case value when subkey then "WAT" else value end as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/case_when_then.sql b/yql/essentials/tests/sql/suites/case/case_when_then.sql
new file mode 100644
index 0000000000..5d38925caa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/case_when_then.sql
@@ -0,0 +1 @@
+select key, subkey, case when value != subkey then "WAT" else value end as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/case/default.cfg b/yql/essentials/tests/sql/suites/case/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/case/input.txt b/yql/essentials/tests/sql/suites/case/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/case/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce.cfg b/yql/essentials/tests/sql/suites/coalesce/coalesce.cfg
new file mode 100644
index 0000000000..5640285809
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce.cfg
@@ -0,0 +1 @@
+in Input input_coalesce.txt
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce.sql b/yql/essentials/tests/sql/suites/coalesce/coalesce.sql
new file mode 100644
index 0000000000..92c4778505
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce.sql
@@ -0,0 +1 @@
+select coalesce(cast(value as int), 999) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.cfg b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.cfg
new file mode 100644
index 0000000000..64b3f61710
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.cfg
@@ -0,0 +1 @@
+in Input optional.txt
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.sql b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.sql
new file mode 100644
index 0000000000..1e2d541f60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_opt.sql
@@ -0,0 +1,24 @@
+select
+ 'first',
+ coalesce(first_null, 22),
+ coalesce(first_num, 33),
+ coalesce(coalesce(first_null, 122), 42),
+ coalesce(coalesce(first_num, 133), 43),
+ coalesce(coalesce(coalesce(first_null, 222), 442), 100500),
+ coalesce(coalesce(coalesce(first_num, 233), 443), 100501),
+ 'second',
+ coalesce(second_null, 22),
+ coalesce(second_num, 33),
+ coalesce(coalesce(second_null, 122), 42),
+ coalesce(coalesce(second_num, 133), 43),
+ coalesce(coalesce(coalesce(second_null, 222), 442), 100500),
+ coalesce(coalesce(coalesce(second_num, 233), 443), 100501),
+ 'third',
+ coalesce(third_null, 22),
+ coalesce(third_num, 33),
+ coalesce(coalesce(third_null, 122), 42),
+ coalesce(coalesce(third_num, 133), 43),
+ coalesce(coalesce(coalesce(third_null, 222), 442), 100500),
+ coalesce(coalesce(coalesce(third_num, 233), 443), 100501),
+ 'end'
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce_few_real.sql b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_real.sql
new file mode 100644
index 0000000000..0eebc69cc2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce_few_real.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+$optDuoFloat=Just(Just(cast(2.71 as float)));
+$optDuoDouble=Just(Just(cast(3.14 as double)));
+$optDuoFloatN=Just(Just(cast(null as float)));
+$optDuoDoubleN=Just(Just(cast(null as double)));
+
+select
+ ($optDuoFloat ?? 0) ?? 1,
+ ($optDuoDouble ?? 41) ?? 42,
+ ($optDuoFloatN ?? 0) ?? 1.,
+ ($optDuoDoubleN ?? 41.) ?? 42,
+ ($optDuoFloatN ?? cast(40.1 as float)) ?? cast(40.2 as float),
+ ($optDuoDoubleN ?? cast(40.1 as float)) ?? cast(40.2 as float),
+ (($optDuoFloatN ?? 0) ?? 1.) ?? 3,
+ (($optDuoDoubleN ?? 41) ?? 42) ?? 4,
+ 'end'
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce_sugar.sql b/yql/essentials/tests/sql/suites/coalesce/coalesce_sugar.sql
new file mode 100644
index 0000000000..c9d2442ee8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce_sugar.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+$data = (select key, cast(key as Int64)/100 as eval from plato.Input);
+select case when eval < 5 then eval else cast(Null as Int64) end ?? -1, key from $data;
diff --git a/yql/essentials/tests/sql/suites/coalesce/coalesce_symmetry.sql b/yql/essentials/tests/sql/suites/coalesce/coalesce_symmetry.sql
new file mode 100644
index 0000000000..393796816f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/coalesce_symmetry.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+$x = 1 + 0;
+$y = 2ul + 0ul;
+select $x ?? $y;
+select $y ?? $x;
+select Just($x) ?? $y;
+select $y ?? Just($x);
+select $x ?? Just($y);
+select Just($y) ?? $x;
+select Just($x) ?? Just($y);
+select Just($y) ?? Just($x);
diff --git a/yql/essentials/tests/sql/suites/coalesce/default.cfg b/yql/essentials/tests/sql/suites/coalesce/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/coalesce/input.txt b/yql/essentials/tests/sql/suites/coalesce/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/coalesce/input_coalesce.txt b/yql/essentials/tests/sql/suites/coalesce/input_coalesce.txt
new file mode 100644
index 0000000000..acc680146e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/input_coalesce.txt
@@ -0,0 +1,2 @@
+{"key"="1";"subkey"="2";"value"="3"};
+{"key"="4";"subkey"="5";"value"="x"};
diff --git a/yql/essentials/tests/sql/suites/coalesce/optional.txt b/yql/essentials/tests/sql/suites/coalesce/optional.txt
new file mode 100644
index 0000000000..74737be93c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/optional.txt
@@ -0,0 +1 @@
+{"first_num"=1u; "first_null"=#; "second_num"=[1u]; "second_null"=[]; "third_num"=[[1u]]; "third_null"=[#]};
diff --git a/yql/essentials/tests/sql/suites/coalesce/optional.txt.attr b/yql/essentials/tests/sql/suites/coalesce/optional.txt.attr
new file mode 100644
index 0000000000..7962199d3e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/coalesce/optional.txt.attr
@@ -0,0 +1,85 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "first_null";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ];
+ [
+ "first_num";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ];
+ [
+ "second_null";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ];
+ [
+ "second_num";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ];
+ [
+ "third_null";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ]
+ ];
+ [
+ "third_num";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]};
+}
diff --git a/yql/essentials/tests/sql/suites/column_group/default.cfg b/yql/essentials/tests/sql/suites/column_group/default.cfg
new file mode 100644
index 0000000000..ef47dfff66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg b/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg
new file mode 100644
index 0000000000..5bd531763a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="lookup"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-max.cfg b/yql/essentials/tests/sql/suites/column_group/groups-max.cfg
new file mode 100644
index 0000000000..dd3af3af12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-max.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.MaxColumnGroups="2"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-single.cfg b/yql/essentials/tests/sql/suites/column_group/groups-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups.sql b/yql/essentials/tests/sql/suites/column_group/groups.sql
new file mode 100644
index 0000000000..fe8ebf9ce9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg
new file mode 100644
index 0000000000..eb97f5b81d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg
new file mode 100644
index 0000000000..c426193038
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint-single.cfg
new file mode 100644
index 0000000000..2aab65b91e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-single.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint.sql b/yql/essentials/tests/sql/suites/column_group/hint.sql
new file mode 100644
index 0000000000..5a04cc74f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint.sql
@@ -0,0 +1,20 @@
+USE plato;
+
+$i1 = select * from Input where a > "a"; -- several publish consumers with same groups
+$i2 = select * from Input where a > "a1"; -- several publish consumers with different groups
+$i3 = select * from Input where a < "a2"; -- several consumers including publish
+$i4 = select * from Input where a != "a"; -- several publish consumers with and without groups
+
+-- test column group spec normalization
+insert into Output1 with column_groups="{g1=[a;b;c];def=#}" select * from $i1;
+insert into Output1 with column_groups="{def=#;g1=[c;a;b];}" select * from $i2;
+
+insert into Output2 with column_groups="{def=#}" select * from $i2;
+insert into Output2 with column_groups="{def=#}" select * from $i3;
+
+insert into Output3 with column_groups="{g1=[a;b;c];def=#}" select * from $i1;
+insert into Output3 with column_groups="{g1=[a;b;c];def=#}" select * from $i4;
+
+insert into Output4 select * from $i4;
+
+select a,b,c,d from $i3;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg
new file mode 100644
index 0000000000..648ff62ddc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon.sql b/yql/essentials/tests/sql/suites/column_group/hint_anon.sql
new file mode 100644
index 0000000000..b1d85f2d15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+-- Forces single group for $i
+insert into @tmp select * from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg
new file mode 100644
index 0000000000..648ff62ddc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql
new file mode 100644
index 0000000000..384dbcfd3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+-- Forces specific group for $i
+insert into @tmp with column_groups="{grp=[b;c;d]}" select * from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg
new file mode 100644
index 0000000000..f508c61b27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql
new file mode 100644
index 0000000000..2317d88dd2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+insert into Output
+with column_groups="{g1=[a;b];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql
new file mode 100644
index 0000000000..9eaa116ad5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+insert into Output
+with column_groups="{g1=[a;b];def=#}"
+select * from Input;
+
+insert into Output
+with column_groups="{g1=[c;d];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql
new file mode 100644
index 0000000000..e40a0624f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- duplicate column
+insert into Output
+with column_groups="{g1=[a;a;b];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql
new file mode 100644
index 0000000000..445ed03645
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- duplicate column
+insert into Output
+with column_groups="{def1=#;def2=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql
new file mode 100644
index 0000000000..30067b1ded
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- empty group
+insert into Output
+with column_groups="{g1=[];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql
new file mode 100644
index 0000000000..e7d630bfea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups=@@{g1="a"}@@
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql
new file mode 100644
index 0000000000..295f9ecf61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="[abc]"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql
new file mode 100644
index 0000000000..35fb731190
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="{g1=[3;a]}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql
new file mode 100644
index 0000000000..c2a36824dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="!"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql
new file mode 100644
index 0000000000..febf511fbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- too short group
+insert into Output
+with column_groups="{g1=[a];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql
new file mode 100644
index 0000000000..ebd127dbf3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+-- unknown column
+insert into Output
+with column_groups="{g1=[l;b;c];def=#}"
+select * from Input;
+
diff --git a/yql/essentials/tests/sql/suites/column_group/input.txt b/yql/essentials/tests/sql/suites/column_group/input.txt
new file mode 100644
index 0000000000..c5e5b75ec5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/input.txt
@@ -0,0 +1,2 @@
+{"a"="a1";"b"="b1";"c"="c1";"d"="d1";"e"="e1";"f"="f1"};
+{"a"="a2";"b"="b2";"c"="c2";"d"="d2";"e"="e2";"f"="f2"};
diff --git a/yql/essentials/tests/sql/suites/column_group/input.txt.attr b/yql/essentials/tests/sql/suites/column_group/input.txt.attr
new file mode 100644
index 0000000000..b337b62c6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/input.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"String"]];
+ ["b";["DataType";"String"]];
+ ["c";["DataType";"String"]];
+ ["d";["DataType";"String"]];
+ ["e";["DataType";"String"]];
+ ["f";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg
new file mode 100644
index 0000000000..351cce8968
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql
new file mode 100644
index 0000000000..f429533a41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into @a
+select * from $s1;
+
+commit;
+
+insert into @a with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg
new file mode 100644
index 0000000000..ab4dec69ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql
new file mode 100644
index 0000000000..2646c4cfe3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into Output
+select * from $s1;
+
+commit;
+
+insert into Output with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg
new file mode 100644
index 0000000000..356863d2ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql
new file mode 100644
index 0000000000..5f09a1e177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+insert into Output with column_groups="{a=#}"
+select * from Input where a != "";
diff --git a/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg
new file mode 100644
index 0000000000..eaefb06bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/length-single.cfg b/yql/essentials/tests/sql/suites/column_group/length-single.cfg
new file mode 100644
index 0000000000..c48072ee21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length-single.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/length.sql b/yql/essentials/tests/sql/suites/column_group/length.sql
new file mode 100644
index 0000000000..85ef54124a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+select count(*) from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg b/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg
new file mode 100644
index 0000000000..4a98bc6feb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/many_inserts.sql b/yql/essentials/tests/sql/suites/column_group/many_inserts.sql
new file mode 100644
index 0000000000..b0ead4fad6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/many_inserts.sql
@@ -0,0 +1,32 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into @a with column_groups="{a=#}"
+select * from $s1;
+
+insert into @b
+select * from $s1;
+
+insert into @c
+select * from $s1;
+
+insert into Output with column_groups="{a=#}"
+select * from $s1;
+
+commit;
+
+insert into @a with column_groups="{a=#}"
+select * from $s2;
+
+insert into @b
+select * from $s2;
+
+insert into @c with column_groups="{default=#}"
+select * from $s2;
+
+insert into Output with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/min_group.sql b/yql/essentials/tests/sql/suites/column_group/min_group.sql
new file mode 100644
index 0000000000..f99d380f15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/min_group.sql
@@ -0,0 +1,8 @@
+USE plato;
+pragma yt.MinColumnGroupSize="3";
+pragma yt.ColumnGroupMode="perusage";
+
+$i = select * from Input where a > "a";
+
+select a,b from $i;
+select c,d,e,f from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg
new file mode 100644
index 0000000000..eaefb06bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/publish-single.cfg b/yql/essentials/tests/sql/suites/column_group/publish-single.cfg
new file mode 100644
index 0000000000..c48072ee21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish-single.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/publish.sql b/yql/essentials/tests/sql/suites/column_group/publish.sql
new file mode 100644
index 0000000000..d9f7b9e855
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+insert into Output select * from $i;
diff --git a/yql/essentials/tests/sql/suites/column_order/align_publish.cfg b/yql/essentials/tests/sql/suites/column_order/align_publish.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/align_publish.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/align_publish.sql b/yql/essentials/tests/sql/suites/column_order/align_publish.sql
new file mode 100644
index 0000000000..7c56456e8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/align_publish.sql
@@ -0,0 +1,10 @@
+PRAGMA OrderedColumns;
+USE plato;
+
+INSERT INTO @table1 WITH TRUNCATE (a, c, b) VALUES ('1', '2', '3');
+COMMIT;
+
+INSERT INTO Output WITH TRUNCATE
+SELECT x.c AS d, x.b AS b, json('{}') AS a
+FROM @table1 AS x
+ORDER BY d
diff --git a/yql/essentials/tests/sql/suites/column_order/align_publish_native.cfg b/yql/essentials/tests/sql/suites/column_order/align_publish_native.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/align_publish_native.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/align_publish_native.sql b/yql/essentials/tests/sql/suites/column_order/align_publish_native.sql
new file mode 100644
index 0000000000..f483b40019
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/align_publish_native.sql
@@ -0,0 +1,12 @@
+/* ignore runonopt plan diff */
+PRAGMA OrderedColumns;
+PRAGMA yt.UseNativeYtTypes;
+USE plato;
+
+INSERT INTO @table1 WITH TRUNCATE (a, c, b) VALUES ('1', '2', '3');
+COMMIT;
+
+INSERT INTO Output WITH TRUNCATE
+SELECT x.c AS d, x.b AS b, json('{}') AS a
+FROM @table1 AS x
+ORDER BY d
diff --git a/yql/essentials/tests/sql/suites/column_order/default.cfg b/yql/essentials/tests/sql/suites/column_order/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/input.txt b/yql/essentials/tests/sql/suites/column_order/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/column_order/input.txt.attr b/yql/essentials/tests/sql/suites/column_order/input.txt.attr
new file mode 100644
index 0000000000..88356bebbc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/input.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["key";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/column_order/insert.cfg b/yql/essentials/tests/sql/suites/column_order/insert.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/insert.sql b/yql/essentials/tests/sql/suites/column_order/insert.sql
new file mode 100644
index 0000000000..5367b6913b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert.sql
@@ -0,0 +1,26 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+insert into Input
+select key, subkey, value from Input;
+
+commit;
+
+select * from Input order by subkey, key;
+
+insert into Output
+select * from Input order by subkey, key;
+
+commit;
+
+select * from Output order by subkey, key;
+
+insert into Output with truncate
+select key,value,subkey from Input order by subkey, key;
+
+select * from Output order by subkey, key;
+commit;
+select * from Output order by subkey, key;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.cfg b/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.sql b/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.sql
new file mode 100644
index 0000000000..0b9f6613ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_reorder_without_columnorder.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+pragma DisableOrderedColumns;
+pragma warning("disable", "4517");
+
+$Group = 1u;
+
+INSERT INTO Output(Group, Name)
+SELECT
+ $Group,
+ value
+FROM Input
+WHERE key = "150"
+LIMIT 1;
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_tmp.sql b/yql/essentials/tests/sql/suites/column_order/insert_tmp.sql
new file mode 100644
index 0000000000..be3485553e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_tmp.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+insert into @tmp
+select * from Input order by subkey, key;
+commit;
+
+select * from @tmp order by subkey, key;
+
+insert into @tmp with truncate
+select key, value, subkey from Input order by subkey, key;
+
+select * from @tmp order by subkey, key;
+commit;
+select * from @tmp order by subkey, key;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_with_desc_sort_and_native_types.sql b/yql/essentials/tests/sql/suites/column_order/insert_with_desc_sort_and_native_types.sql
new file mode 100644
index 0000000000..a97c43f38b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_with_desc_sort_and_native_types.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* hybridfile can not YQL-17743 */
+USE plato;
+
+PRAGMA OrderedColumns;
+PRAGMA yt.UseNativeYtTypes;
+
+insert into @tmp
+select key, AsList(subkey), value
+from Input
+where key > '000'
+order by value desc;
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.cfg b/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.sql b/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.sql
new file mode 100644
index 0000000000..54c1afc925
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_with_new_cols.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+insert into Output with truncate
+select a.*
+, count(key) over (partition by subkey) as cnt
+from Input as a
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.cfg b/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.sql b/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.sql
new file mode 100644
index 0000000000..eff98969d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/insert_with_reorder_cols.sql
@@ -0,0 +1,20 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+PRAGMA PositionalUnionAll;
+PRAGMA yt.UseNativeYtTypes;
+
+$i =
+SELECT
+ key,
+ AGGREGATE_LIST(subkey) as lst
+FROM Input
+GROUP BY key;
+
+INSERT INTO Output
+SELECT
+ a.key as key,
+ lst ?? [] as lst,
+ 2 as anum,
+FROM $i as a; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/column_order/join.cfg b/yql/essentials/tests/sql/suites/column_order/join.cfg
new file mode 100644
index 0000000000..1acaa00cf7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/join.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/column_order/join.sql b/yql/essentials/tests/sql/suites/column_order/join.sql
new file mode 100644
index 0000000000..9b356e0a4f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/join.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+$foo = select 1 as sk, "150" as key, 2 as v;
+
+select * from $foo as b join Input as a using(key);
+select a.* from $foo as b join Input as a using(key);
+select b.* from $foo as b join Input as a using(key);
+select a.*, b.* from $foo as b join Input as a using(key);
diff --git a/yql/essentials/tests/sql/suites/column_order/join_nosimple.cfg b/yql/essentials/tests/sql/suites/column_order/join_nosimple.cfg
new file mode 100644
index 0000000000..1acaa00cf7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/join_nosimple.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/column_order/join_nosimple.sql b/yql/essentials/tests/sql/suites/column_order/join_nosimple.sql
new file mode 100644
index 0000000000..8784238898
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/join_nosimple.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+pragma DisableSimpleColumns;
+
+$foo = select 1 as sk, "150" as key, 2 as v;
+
+select * from $foo as b join Input as a using(key);
+select a.* from $foo as b join Input as a using(key);
+select b.* from $foo as b join Input as a using(key);
+select a.*, b.* from $foo as b join Input as a using(key);
diff --git a/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.cfg b/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.sql b/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.sql
new file mode 100644
index 0000000000..589b74ccc8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/ordered_plus_native.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+PRAGMA OrderedColumns;
+PRAGMA yt.UseNativeYtTypes;
+
+
+INSERT INTO Output WITH TRUNCATE
+SELECT
+ aggr_list(subkey) as subkey,
+ key,
+FROM Input AS a
+GROUP BY a.key as key;
diff --git a/yql/essentials/tests/sql/suites/column_order/select_action.sql b/yql/essentials/tests/sql/suites/column_order/select_action.sql
new file mode 100644
index 0000000000..e26c75a06f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_action.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+evaluate for $i in ["1", "2", "3"] do begin
+ select * from Input where subkey = $i;
+end do;
diff --git a/yql/essentials/tests/sql/suites/column_order/select_distinct_star.sql b/yql/essentials/tests/sql/suites/column_order/select_distinct_star.sql
new file mode 100644
index 0000000000..5c229a512f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_distinct_star.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select distinct * from Input order by subkey, key;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_groupby_with_star.sql b/yql/essentials/tests/sql/suites/column_order/select_groupby_with_star.sql
new file mode 100644
index 0000000000..ffb116362a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_groupby_with_star.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input group by value, key order by key, value;
+select * from Input group by value, key having key = "150";
+select * from Input group by subkey, key || "x" as key order by subkey, key;
diff --git a/yql/essentials/tests/sql/suites/column_order/select_limit_offset.sql b/yql/essentials/tests/sql/suites/column_order/select_limit_offset.sql
new file mode 100644
index 0000000000..2da2186ca6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_limit_offset.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input order by key limit 1 offset 3;
+select * from Input order by value limit 0 offset 3;
+select * from Input limit 0;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_limit_offset_reorder.sql b/yql/essentials/tests/sql/suites/column_order/select_limit_offset_reorder.sql
new file mode 100644
index 0000000000..e8a9cf93db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_limit_offset_reorder.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select subkey, key, value from (select * from Input) as x order by key, subkey limit 1 offset 1;
diff --git a/yql/essentials/tests/sql/suites/column_order/select_orderby.sql b/yql/essentials/tests/sql/suites/column_order/select_orderby.sql
new file mode 100644
index 0000000000..12bfaa33d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_orderby.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input order by key;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_plain.sql b/yql/essentials/tests/sql/suites/column_order/select_plain.sql
new file mode 100644
index 0000000000..b495924f3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_plain.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input order by subkey;
+select * without key from Input order by subkey;
+
+select a.* from Input as a order by a.subkey;
+select a.* without key from Input as a order by a.subkey;
+
+select 1 as z, 2 as x, a.* from Input as a order by a.subkey;
+select 1 as z, 2 as x, a.* without key from Input as a order by a.subkey;
+
+select 1 as c, 2 as b, 3 as a;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_plain_nosimple.sql b/yql/essentials/tests/sql/suites/column_order/select_plain_nosimple.sql
new file mode 100644
index 0000000000..9f3c6de79b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_plain_nosimple.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+pragma DisableSimpleColumns;
+
+select * from Input;
+select * without key from Input;
+
+select a.* from Input as a;
+select a.* without key from Input as a;
+
+select 1 as z, 2 as x, a.* from Input as a;
+select 1 as z, 2 as x, a.* without key from Input as a;
+
+select 1 as c, 2 as b, 3 as a;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_sample.sql b/yql/essentials/tests/sql/suites/column_order/select_sample.sql
new file mode 100644
index 0000000000..af4555f2a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_sample.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input tablesample bernoulli(100.0);
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_subquery.sql b/yql/essentials/tests/sql/suites/column_order/select_subquery.sql
new file mode 100644
index 0000000000..c00407dfdc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_subquery.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+define subquery $select_star($table) as
+ select * without subkey from $table;
+end define;
+
+select * from $select_star("Input");
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_where.sql b/yql/essentials/tests/sql/suites/column_order/select_where.sql
new file mode 100644
index 0000000000..d08d7cae43
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_where.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select * from Input where key="150";
+
diff --git a/yql/essentials/tests/sql/suites/column_order/select_win_func.sql b/yql/essentials/tests/sql/suites/column_order/select_win_func.sql
new file mode 100644
index 0000000000..4ce0668d97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/select_win_func.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+
+select
+ min(subkey) over (partition by key) as zz,
+ row_number() over (order by key, subkey) as z,
+ a.*
+from Input as a
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all.sql b/yql/essentials/tests/sql/suites/column_order/union_all.sql
new file mode 100644
index 0000000000..ea88506906
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma OrderedColumns;
+
+select 1 as z, 2 as y, 3 as x
+union all
+select 1 as z, 2 as y
+union all
+select 1 as z;
+
+select 1 as z, 2 as y, 3 as x
+union all
+select 1 as z, 2 as y
+union all
+select 1 as a;
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all_positional.sql b/yql/essentials/tests/sql/suites/column_order/union_all_positional.sql
new file mode 100644
index 0000000000..9d1bcdb209
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all_positional.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma PositionalUnionAll;
+pragma warning("disable", "1107");
+
+select (1,1u) as z, (2,2u) as y, (3,3u) as x
+union all
+select (1u,1) as a, (2u,2) as b, (3u,3) as c;
+
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.cfg b/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.sql b/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.sql
new file mode 100644
index 0000000000..7f44ded569
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all_positional_columns_count_fail.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma PositionalUnionAll;
+
+select 1 as c, 2 as b, 3 as a
+union all
+select 1 as c, 2 as b;
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.cfg b/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.sql b/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.sql
new file mode 100644
index 0000000000..78c4dd86c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/union_all_positional_unordered_fail.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma PositionalUnionAll;
+
+select 1 as c, 2 as b, 3 as a
+union all
+select * from as_table([<|c:1, b:2, a:3|>]);
+
diff --git a/yql/essentials/tests/sql/suites/column_order/values.sql b/yql/essentials/tests/sql/suites/column_order/values.sql
new file mode 100644
index 0000000000..c5ec9acee3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/values.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma OrderedColumns;
+
+values (1,2), (3,4);
+
+select * from (values (1,2), (3,4));
+select * from (values (1,2), (3,4)) as t(b,c);
+select * from (values (1,2,3,4), (5,6,7,8)) as t(b,c,a);
+
diff --git a/yql/essentials/tests/sql/suites/column_order/winfunc.sql b/yql/essentials/tests/sql/suites/column_order/winfunc.sql
new file mode 100644
index 0000000000..eb5751334a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_order/winfunc.sql
@@ -0,0 +1,9 @@
+use plato;
+pragma OrderedColumns;
+
+select
+ a.*
+ , lag(key) over (order by subkey) as prev_k
+ , min(key) over (order by subkey) as min_k
+from Input as a
+order by subkey
diff --git a/yql/essentials/tests/sql/suites/compute_range/adjacent_to_point.sql b/yql/essentials/tests/sql/suites/compute_range/adjacent_to_point.sql
new file mode 100644
index 0000000000..15a272bea6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/adjacent_to_point.sql
@@ -0,0 +1,85 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+-- [10, 11) -> [10, 10]
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> ($row.x >= 10 and $row.x < 11),
+ AsTuple(AsAtom("x"))
+);
+
+-- (10, 11] -> [11, 11]
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> ($row.x > 10 and $row.x <= 11),
+ AsTuple(AsAtom("x"))
+);
+
+-- dates
+select YQL::RangeComputeFor(
+ Struct<x:Date??>,
+ ($row) -> (($row.x > Date("2021-09-08") and $row.x <= Date("2021-09-09")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Date32??>,
+ ($row) -> (($row.x > Date("2021-09-08") and $row.x <= Date("2021-09-09")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Date??>,
+ ($row) -> (($row.x > Date32("2021-09-08") and $row.x <= Date32("2021-09-09")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Date32??>,
+ ($row) -> (($row.x > Date32("-1-12-31") and $row.x <= Date32("1-01-01")) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- datetimes
+select YQL::RangeComputeFor(
+ Struct<x:Datetime?>,
+ ($row) -> (($row.x > Datetime("2021-09-09T12:00:00Z") and $row.x <= Datetime("2021-09-09T12:00:01Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Datetime64?>,
+ ($row) -> (($row.x > Datetime("2021-09-09T12:00:00Z") and $row.x <= Datetime("2021-09-09T12:00:01Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Datetime?>,
+ ($row) -> (($row.x > Datetime64("2021-09-09T12:00:00Z") and $row.x <= Datetime64("2021-09-09T12:00:01Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Datetime64?>,
+ ($row) -> (($row.x > Datetime64("-1-12-31T23:59:59Z") and $row.x <= Datetime64("1-01-01T00:00:00Z")) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- timestamps
+select YQL::RangeComputeFor(
+ Struct<x:Timestamp??>,
+ ($row) -> (($row.x > Timestamp("2021-09-09T12:00:00.000000Z") and $row.x <= Timestamp("2021-09-09T12:00:00.000001Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Timestamp64??>,
+ ($row) -> (($row.x > Timestamp("2021-09-09T12:00:00.000000Z") and $row.x <= Timestamp("2021-09-09T12:00:00.000001Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Timestamp??>,
+ ($row) -> (($row.x > Timestamp64("2021-09-09T12:00:00.000000Z") and $row.x <= Timestamp64("2021-09-09T12:00:00.000001Z")) ?? false),
+ AsTuple(AsAtom("x"))
+)
+, YQL::RangeComputeFor(
+ Struct<x:Timestamp64??>,
+ ($row) -> (($row.x > Timestamp64("-1-12-31T23:59:59.999999Z") and $row.x <= Timestamp64("1-01-01T00:00:00.000000Z")) ?? false),
+ AsTuple(AsAtom("x"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/decimal.sql b/yql/essentials/tests/sql/suites/compute_range/decimal.sql
new file mode 100644
index 0000000000..b6869a3661
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/decimal.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+$opt_type = Struct<x:Decimal(15,10)?>;
+$keys = AsTuple(AsAtom("x"));
+
+$pred = ($row) -> (($row.x < Decimal("-inf",15,10)) ?? false);
+
+select YQL::RangeComputeFor($opt_type, $pred, $keys);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/default.cfg b/yql/essentials/tests/sql/suites/compute_range/default.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/default.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/compute_range/huge_in.sql b/yql/essentials/tests/sql/suites/compute_range/huge_in.sql
new file mode 100644
index 0000000000..188a77494d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/huge_in.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<x:Int32>,
+ ($row) -> ($row.x IN ListFromRange(100000000, 0, -1)),
+ AsTuple(AsAtom("x"))
+);
+
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/in.sql b/yql/essentials/tests/sql/suites/compute_range/in.sql
new file mode 100644
index 0000000000..1c1f3dbee0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/in.sql
@@ -0,0 +1,58 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- basic IN
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> ($row.x IN (1, 2, -1)),
+ AsTuple(AsAtom("x"))
+);
+
+-- opaque collection
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> ($row.x IN ListFromRange(-1, 3)),
+ AsTuple(AsAtom("x"))
+);
+
+-- optional collection
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> (($row.x IN Just(AsSet(-1, 1, 2))) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- optional items
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> (($row.x IN (-1, 10u, 20, 1/0)) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- tuple
+select YQL::RangeComputeFor(
+ Struct<x:UInt32, y:Uint32, z:Uint32>,
+ ($row) -> (($row.y, $row.x, $row.z) IN [(1,2,3), (100,200,300)]),
+ AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
+);
+
+
+-- tuple partial
+select YQL::RangeComputeFor(
+ Struct<x:UInt32, y:Uint32, z:Uint32>,
+ ($row) -> (($row.y, $row.x, $row.z) IN [Just(Just((1,2,3))), (100,200,300), null]),
+ AsTuple(AsAtom("x"), AsAtom("y"))
+);
+
+
+-- tuple with implicit nulls
+select YQL::RangeComputeFor(
+ Struct<x:UInt32, y:Uint32, z:Uint32>,
+ ($row) -> (($row.y, $row.x) IN ((1,2,3), (100, 200, 300))),
+ AsTuple(AsAtom("x"), AsAtom("y"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/in2.sql b/yql/essentials/tests/sql/suites/compute_range/in2.sql
new file mode 100644
index 0000000000..7ef922e930
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/in2.sql
@@ -0,0 +1,29 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- tuple
+select YQL::RangeComputeFor(
+ Struct<x:UInt32, y:Uint32, z:Uint32>,
+ ($row) -> (($row.y, $row.x, $row.z) IN ((1,2,3), (100,200,300))),
+ AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
+);
+
+-- tuple with single element
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> (($row.x,) IN ((1,), (100,))),
+ AsTuple(AsAtom("x"))
+);
+
+-- key prefix tuples
+select YQL::RangeComputeFor(
+ Struct<x:UInt32, y:Uint32, z:Uint32>,
+ ($row) -> (($row.y, $row.x) IN ((1,2), (2,2))),
+ AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/in3.sql b/yql/essentials/tests/sql/suites/compute_range/in3.sql
new file mode 100644
index 0000000000..e1e02cbe7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/in3.sql
@@ -0,0 +1,78 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+$Input = [(4, 100), (5, 100)];
+select YQL::RangeComputeFor(
+ Struct<
+ a:Int32?,
+ b:Int32?,
+ c:Int32?,
+ d:Int32?,
+ e:Int32?,
+ >,
+
+ ($row) -> (((
+ $row.a,
+ $row.d)
+ IN $Input) ?? false),
+ AsTuple(
+ AsAtom("a"),
+ AsAtom("b"),
+ AsAtom("c"),
+ AsAtom("d"),
+ )
+);
+
+$Input2 = [(30, 20, 88), (31, 21, 99)];
+select YQL::RangeComputeFor(
+ Struct<
+ a:Int32?,
+ b:Int32?,
+ c:Int32?,
+ d:Int32?,
+ e:Int32?,
+ >,
+
+ ($row) -> ((((
+ $row.c,
+ $row.b,
+ $row.e)
+ IN $Input2) AND $row.a == 10) ?? false),
+ AsTuple(
+ AsAtom("a"),
+ AsAtom("b"),
+ AsAtom("c"),
+ AsAtom("d"),
+ AsAtom("e"),
+ )
+);
+
+$Input3 = [(20, 10, 30, 99), (21, 10, 31, 88)];
+select YQL::RangeComputeFor(
+ Struct<
+ a:Int32?,
+ b:Int32?,
+ c:Int32?,
+ d:Int32?,
+ e:Int32?,
+ >,
+
+ ($row) -> ((($row.c = 33 AND $row.d = 44 AND (
+ $row.b,
+ $row.a,
+ $row.b,
+ $row.e)
+ IN $Input3)) ?? false),
+ AsTuple(
+ AsAtom("a"),
+ AsAtom("b"),
+ AsAtom("c"),
+ AsAtom("d"),
+ AsAtom("e"),
+ )
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/in_literal_nulls.sql b/yql/essentials/tests/sql/suites/compute_range/in_literal_nulls.sql
new file mode 100644
index 0000000000..71946ffc02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/in_literal_nulls.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<x:Int32?>,
+ ($row) -> (($row.x IN (1,2,5,null)) ?? false),
+ AsTuple(AsAtom("x"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/merge_adjacent.sql b/yql/essentials/tests/sql/suites/compute_range/merge_adjacent.sql
new file mode 100644
index 0000000000..d8d534b501
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/merge_adjacent.sql
@@ -0,0 +1,43 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- basic in
+select YQL::RangeComputeFor(
+ Struct<x:UInt32>,
+ ($row) -> ($row.x in ListFromRange(-100, 100)),
+ AsTuple(AsAtom("x"))
+);
+
+-- maxint
+select YQL::RangeComputeFor(
+ Struct<x:Int32?>,
+ ($row) -> (($row.x in ListFromRange(2147483547ul, 2147483648ul)) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- date
+select YQL::RangeComputeFor(
+ Struct<x:Date>,
+ ($row) -> ($row.x in ListFromRange(Date("2105-01-01"), Date("2105-12-31")) or $row.x == Date("2105-12-31")),
+ AsTuple(AsAtom("x"))
+);
+
+-- datetime
+select YQL::RangeComputeFor(
+ Struct<x:Datetime>,
+ ($row) -> ($row.x == Datetime("2105-12-31T23:59:58Z") or $row.x == Datetime("2105-12-31T23:59:59Z")),
+ AsTuple(AsAtom("x"))
+);
+
+
+-- timestamp
+select YQL::RangeComputeFor(
+ Struct<x:Timestamp>,
+ ($row) -> ($row.x == Timestamp("2105-12-31T23:59:59.999998Z") or $row.x == Timestamp("2105-12-31T23:59:59.999999Z")),
+ AsTuple(AsAtom("x"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/multiply_limit.sql b/yql/essentials/tests/sql/suites/compute_range/multiply_limit.sql
new file mode 100644
index 0000000000..a8967ea763
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/multiply_limit.sql
@@ -0,0 +1,31 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- single over limit
+select YQL::RangeComputeFor(
+ Struct<x:String, y:String>,
+ ($row) -> ($row.x IN CAST(ListFromRange(0, 10001) AS List<String>)),
+ AsTuple(AsAtom("x"), AsAtom("y"))
+);
+
+
+-- multiply over limit
+select YQL::RangeComputeFor(
+ Struct<x:String, y:String>,
+ ($row) -> ($row.x IN CAST(ListFromRange(0, 101) AS List<String>) and $row.y IN CAST(ListFromRange(0, 101) AS List<String>)),
+ AsTuple(AsAtom("x"), AsAtom("y"))
+);
+
+-- fuzing predicates
+-- TODO: currently the result is (-inf, +inf) here. Optimally, it should be [0, +inf)
+select YQL::RangeComputeFor(
+ Struct<x:Int32>,
+ ($row) -> ($row.x IN ListFromRange(0, 20000)),
+ AsTuple(AsAtom("x"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/multiply_limit_for_single_key.sql b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_for_single_key.sql
new file mode 100644
index 0000000000..d7c3cedc10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_for_single_key.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- single over limit
+select YQL::RangeComputeFor(
+ Struct<x:String, y:String>,
+ ($row) -> ($row.x IN CAST(ListFromRange(0, 10001) AS List<String>)),
+ AsTuple(AsAtom("x"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_dups.sql b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_dups.sql
new file mode 100644
index 0000000000..312e173e08
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_dups.sql
@@ -0,0 +1,32 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+$lst = ListExtend(
+ ListFromRange(0, 5000),
+ ListFromRange(0, 5000),
+ ListFromRange(5000, 10000)
+);
+
+$lst = ListMap($lst, ($x)->(AsTuple(cast($x as String), $x)));
+
+select YQL::RangeComputeFor(
+ Struct<
+ a:Int32?,
+ b:String,
+ >,
+
+ ($row) -> (((
+ $row.b,
+ $row.a)
+ IN $lst) ?? false),
+ AsTuple(
+ AsAtom("a"),
+ AsAtom("b"),
+ )
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_nulls.sql b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_nulls.sql
new file mode 100644
index 0000000000..74ec8616f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/multiply_limit_with_nulls.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<x:Uint32>,
+ ($row) -> ($row.x IN ListFromRange(-1,10001)),
+ AsTuple(AsAtom("x"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/norange.sql b/yql/essentials/tests/sql/suites/compute_range/norange.sql
new file mode 100644
index 0000000000..825f9e8921
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/norange.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+$opt_type = Struct<x:Int32?, y:Int32?, z:String?, t:String?>;
+$xy_keys = AsTuple(AsAtom("x"), AsAtom("y"));
+
+$range_for = ($pred) -> (YQL::RangeComputeFor($opt_type, $pred, $xy_keys));
+
+$pred1 = ($row) -> (($row.x + $row.y > 0) ?? false);
+$pred2 = ($row) -> (($row.x > 0 or $row.y > 0) ?? false);
+$pred3 = ($row) -> (($row.x > 0 or $row.z == "test") ?? false);
+
+
+select
+ $range_for($pred1) is null,
+ $range_for($pred2) is null,
+ $range_for($pred3) is null,
+;
diff --git a/yql/essentials/tests/sql/suites/compute_range/pg_compare.sql b/yql/essentials/tests/sql/suites/compute_range/pg_compare.sql
new file mode 100644
index 0000000000..4bb2a3f805
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/pg_compare.sql
@@ -0,0 +1,35 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- a > 2
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (FromPg(PgOp(">", $row.a, 2p)) ?? false),
+ AsTuple(AsAtom("a"))
+);
+
+-- a >= 2
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (($row.a >= 2p) ?? false),
+ AsTuple(AsAtom("a"))
+);
+
+-- b < 2
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (('2'p > $row.b) ?? false),
+ AsTuple(AsAtom("b"))
+);
+
+-- b <= 2
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (FromPg(PgOp(">=", '2'p, $row.b)) ?? false),
+ AsTuple(AsAtom("b"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/pg_equal.sql b/yql/essentials/tests/sql/suites/compute_range/pg_equal.sql
new file mode 100644
index 0000000000..595e01bde3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/pg_equal.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- a != 2
+select YQL::RangeComputeFor(
+ Struct<a:PgFloat8,b:PgText>,
+ ($row) -> (FromPg(PgOp("<>", $row.a, 2.0pf8)) ?? false),
+ AsTuple(AsAtom("a"))
+);
+
+-- b == 'foo'
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (($row.b == 'foo'p) ?? false),
+ AsTuple(AsAtom("b"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/pg_exists.sql b/yql/essentials/tests/sql/suites/compute_range/pg_exists.sql
new file mode 100644
index 0000000000..5c368e9f35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/pg_exists.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<a:PgFloat8,b:PgText>,
+ ($row) -> ($row.a is not null),
+ AsTuple(AsAtom("a"))
+);
+
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> ($row.b is null),
+ AsTuple(AsAtom("b"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/pg_sqlin.sql b/yql/essentials/tests/sql/suites/compute_range/pg_sqlin.sql
new file mode 100644
index 0000000000..0e991c92ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/pg_sqlin.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+pragma AnsiInForEmptyOrNullableItemsCollections;
+
+-- a != 2
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (($row.a in (3p,2p,1p)) ?? false),
+ AsTuple(AsAtom("a"))
+);
+
+-- b == 'foo'
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (($row.b in ('foo'p, 'bar'p, 'baz'p)) ?? false),
+ AsTuple(AsAtom("b"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/pg_startswith.sql b/yql/essentials/tests/sql/suites/compute_range/pg_startswith.sql
new file mode 100644
index 0000000000..0ed99c65c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/pg_startswith.sql
@@ -0,0 +1,36 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+-- like 'aaaa'
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (StartsWith(FromPg($row.b), 'aaaa') ?? false),
+ AsTuple(AsAtom("b"))
+);
+
+-- not like 'aaaa'
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (not (StartsWith(FromPg($row.b), 'aaaa') ?? true)),
+ AsTuple(AsAtom("b"))
+);
+
+
+-- like <invalid utf8>
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (StartsWith(FromPg($row.b), 'a\xf5') ?? false),
+ AsTuple(AsAtom("b"))
+);
+
+-- not like <invalid utf8>
+select YQL::RangeComputeFor(
+ Struct<a:PgInt4,b:PgText>,
+ ($row) -> (not (StartsWith(FromPg($row.b), 'a\xf5') ?? true)),
+ AsTuple(AsAtom("b"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/preserve_rest_predicates_order.sql b/yql/essentials/tests/sql/suites/compute_range/preserve_rest_predicates_order.sql
new file mode 100644
index 0000000000..efd5ec2fb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/preserve_rest_predicates_order.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<x:String, y:String, z:String>,
+ ($row) -> (
+ ($row.x, $row.y, $row.z) > ("a", "b", "c") and
+ ($row.x, $row.y, $row.z) < ("d", "e", "f") and
+ $row.z IN AsList("t", "u", "v") and
+ $row.y IN AsList("x", "y", "z") and
+ (len($row.z) == 1 OR len($row.z || 'x') == 2)),
+ AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/repeated_keyranges_in_and.sql b/yql/essentials/tests/sql/suites/compute_range/repeated_keyranges_in_and.sql
new file mode 100644
index 0000000000..b8c98f6382
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/repeated_keyranges_in_and.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+pragma warning("disable", "1108");
+
+select YQL::RangeComputeFor(
+ Struct<x:Int32, y:UInt32, z:Uint64>,
+ ($row) -> ($row.x == 1 and ($row.y = 2 and $row.z > 0 and $row.z < 10 or
+ $row.y = 2 and $row.z > 8 and $row.z < 20)),
+ AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/startswith.sql b/yql/essentials/tests/sql/suites/compute_range/startswith.sql
new file mode 100644
index 0000000000..b5c31298cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/startswith.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4510");
+
+-- string/string
+select YQL::RangeComputeFor(
+ Struct<x:String>,
+ ($row) -> (StartsWith($row.x, 'foo')),
+ AsTuple(AsAtom("x"))
+);
+
+
+select YQL::RangeComputeFor(
+ Struct<x:String>,
+ ($row) -> (not StartsWith($row.x, 'foo')),
+ AsTuple(AsAtom("x"))
+);
+
+
+select YQL::RangeComputeFor(
+ Struct<x:String>,
+ ($row) -> (StartsWith($row.x, '\xff\xff')),
+ AsTuple(AsAtom("x"))
+);
+
+select YQL::RangeComputeFor(
+ Struct<x:String>,
+ ($row) -> (not StartsWith($row.x, '\xff\xff')),
+ AsTuple(AsAtom("x"))
+);
+
+-- optional string/string
+select YQL::RangeComputeFor(
+ Struct<x:String?>,
+ ($row) -> ((not StartsWith($row.x, 'foo')) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- optional string/optional string
+select YQL::RangeComputeFor(
+ Struct<x:String?>,
+ ($row) -> (StartsWith($row.x, if(1 > 2, 'void')) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+--utf8/string
+select YQL::RangeComputeFor(
+ Struct<x:Utf8>,
+ ($row) -> (StartsWith($row.x, 'теÑÑ‚')),
+ AsTuple(AsAtom("x"))
+);
+
+select YQL::RangeComputeFor(
+ Struct<x:Utf8>,
+ ($row) -> (StartsWith($row.x, 'теÑÑ‚\xf5')),
+ AsTuple(AsAtom("x"))
+);
+
+--optional utf8/utf8
+select YQL::RangeComputeFor(
+ Struct<x:Utf8?>,
+ ($row) -> ((not StartsWith($row.x, 'теÑÑ‚'u)) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+select YQL::RangeComputeFor(
+ Struct<x:Utf8?>,
+ ($row) -> (StartsWith($row.x, '\xf4\x8f\xbf\xbf'u) ?? false),
+ AsTuple(AsAtom("x"))
+);
+
+-- optional utf8/string
+select YQL::RangeComputeFor(
+ Struct<x:Utf8?>,
+ ($row) -> ((not StartsWith($row.x, 'теÑÑ‚\xf5')) ?? false),
+ AsTuple(AsAtom("x"))
+);
diff --git a/yql/essentials/tests/sql/suites/compute_range/tuples_compare.sql b/yql/essentials/tests/sql/suites/compute_range/tuples_compare.sql
new file mode 100644
index 0000000000..a9fae38085
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/tuples_compare.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+$type = Struct<x:Int32, y:Int32, z:Int32>;
+$keys = AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"));
+
+$range_for = ($pred) -> (YQL::RangeComputeFor($type, $pred, $keys));
+
+$pred1 = ($row) -> (($row.x, $row.y, $row.z) >= (11, 22, 33));
+$pred2 = ($row) -> (($row.x, $row.y, $row.z) > (11, 22, 33));
+
+$pred3 = ($row) -> (($row.x, $row.y, $row.z) < (11, 22, 33));
+$pred4 = ($row) -> (($row.x, $row.y, $row.z) <= (11, 22, 33));
+
+$pred5 = ($row) -> (($row.x, $row.y, $row.z) > (111, 222, 333) and ($row.x, $row.y, $row.z) <= (111, 333, 444));
+$pred6 = ($row) -> (($row.x, $row.y, $row.z) >= (111, 222, 333) and ($row.x, $row.y, $row.z) < (111, 222, 333));
+
+select
+ $range_for($pred1),
+ $range_for($pred2),
+ $range_for($pred3),
+ $range_for($pred4),
+ $range_for($pred5),
+ $range_for($pred6),
+;
+
+$pred1 = ($row) -> (($row.x, $row.y) >= (11, 22));
+$pred2 = ($row) -> (($row.x, $row.y) > (11, 22));
+
+$pred3 = ($row) -> (($row.x, $row.y) < (11, 22));
+$pred4 = ($row) -> (($row.x, $row.y) <= (11, 22));
+
+$pred5 = ($row) -> (($row.x, $row.y) > (111, 222) and ($row.x, $row.y) <= (111, 333));
+$pred6 = ($row) -> (($row.x, $row.y) >= (111, 222) and ($row.x, $row.y) < (111, 222));
+
+select
+ $range_for($pred1),
+ $range_for($pred2),
+ $range_for($pred3),
+ $range_for($pred4),
+ $range_for($pred5),
+ $range_for($pred6),
+;
diff --git a/yql/essentials/tests/sql/suites/compute_range/tztypes.sql b/yql/essentials/tests/sql/suites/compute_range/tztypes.sql
new file mode 100644
index 0000000000..915d2d94db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/tztypes.sql
@@ -0,0 +1,48 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+-- ==
+select YQL::RangeComputeFor(
+ Struct<x:TzDate>,
+ ($row) -> ($row.x == TzDate('2000-01-01,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
+-- !=
+select YQL::RangeComputeFor(
+ Struct<x:TzDate>,
+ ($row) -> ($row.x != TzDate('2000-01-01,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
+-- >
+select YQL::RangeComputeFor(
+ Struct<x:TzDatetime>,
+ ($row) -> ($row.x > TzDatetime('2000-01-01T00:00:00,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
+-- >=
+select YQL::RangeComputeFor(
+ Struct<x:TzDatetime>,
+ ($row) -> ($row.x >= TzDatetime('2000-01-01T00:00:00,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
+-- <
+select YQL::RangeComputeFor(
+ Struct<x:TzTimestamp>,
+ ($row) -> ($row.x < TzTimestamp('2000-01-01T00:00:00.000000,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
+-- <=
+select YQL::RangeComputeFor(
+ Struct<x:TzTimestamp>,
+ ($row) -> ($row.x <= TzTimestamp('2000-01-01T00:00:00.000000,Europe/Moscow')),
+ AsTuple(AsAtom("x"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/compute_range/yql-12941.sql b/yql/essentials/tests/sql/suites/compute_range/yql-12941.sql
new file mode 100644
index 0000000000..63e2a586bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/yql-12941.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+$opt_type = Struct<x:UInt32?, y:Int32?>;
+$xy_keys = AsTuple(AsAtom("x"), AsAtom("y"));
+
+$range_for = ($pred) -> (YQL::RangeComputeFor($opt_type, $pred, $xy_keys));
+
+$pred1 = ($row) -> (($row.x == 3u and ($row.y > 300 or $row.y == 100)) ?? false);
+$pred2 = ($row) -> (($row.y > 300 and $row.x == 3u or $row.x == 3u and $row.y == 100) ?? false);
+
+
+select
+ $range_for($pred1),
+ $range_for($pred2),
+;
diff --git a/yql/essentials/tests/sql/suites/compute_range/yql-13489.sql b/yql/essentials/tests/sql/suites/compute_range/yql-13489.sql
new file mode 100644
index 0000000000..2f2f153cb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/compute_range/yql-13489.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+
+pragma warning("disable", "4510");
+
+select YQL::RangeComputeFor(
+ Struct<x:Int32, y:Int32>,
+ ($row) -> ($row.x > 2 or ($row.x == 2 and $row.y >= 10) or ($row.x == 0 and $row.y < 10)),
+ AsTuple(AsAtom("x"))
+);
+
+select YQL::RangeComputeFor(
+ Struct<x:Int32, y:Int32>,
+ ($row) -> (($row.x > 10 and $row.y > 1) or $row.x < 5),
+ AsTuple(AsAtom("x"), AsAtom("y"))
+);
+
diff --git a/yql/essentials/tests/sql/suites/count/avg_and_sum_by_value.txt b/yql/essentials/tests/sql/suites/count/avg_and_sum_by_value.txt
new file mode 100644
index 0000000000..cebd64e139
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/avg_and_sum_by_value.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="2";"subkey"="20";"value"="BAR"};
+{"key"="3";"subkey"="30";"value"="BAR"};
+{"key"="WAT";"subkey"="WAT";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/count/boolean_count.cfg b/yql/essentials/tests/sql/suites/count/boolean_count.cfg
new file mode 100644
index 0000000000..28975418d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/boolean_count.cfg
@@ -0,0 +1 @@
+in Input count_input.txt
diff --git a/yql/essentials/tests/sql/suites/count/boolean_count.sql b/yql/essentials/tests/sql/suites/count/boolean_count.sql
new file mode 100644
index 0000000000..8ecebf2391
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/boolean_count.sql
@@ -0,0 +1,3 @@
+select count(*) from plato.Input;
+select count(e) from plato.Input;
+select count(distinct e) from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/count/count.cfg b/yql/essentials/tests/sql/suites/count/count.cfg
new file mode 100644
index 0000000000..28975418d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count.cfg
@@ -0,0 +1 @@
+in Input count_input.txt
diff --git a/yql/essentials/tests/sql/suites/count/count.sql b/yql/essentials/tests/sql/suites/count/count.sql
new file mode 100644
index 0000000000..9c01b87439
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+select a, aggregate_list(b), count(*) from plato.Input group by a order by a;
+select b, aggregate_list(a), count(*) from plato.Input group by b order by b;
+select c, aggregate_list(a), count(*) from plato.Input group by c order by c;
+select d, aggregate_list(a), count(*) from plato.Input group by d order by d;
+select e, aggregate_list(a), count(*) from plato.Input group by e order by e;
diff --git a/yql/essentials/tests/sql/suites/count/count_all.sql b/yql/essentials/tests/sql/suites/count/count_all.sql
new file mode 100644
index 0000000000..1e638449b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all.sql
@@ -0,0 +1 @@
+select count(*) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/count_all_grouped-empty.cfg b/yql/essentials/tests/sql/suites/count/count_all_grouped-empty.cfg
new file mode 100644
index 0000000000..3bccc051db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all_grouped-empty.cfg
@@ -0,0 +1 @@
+in Input empty.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_all_grouped.cfg b/yql/essentials/tests/sql/suites/count/count_all_grouped.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all_grouped.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_all_grouped.sql b/yql/essentials/tests/sql/suites/count/count_all_grouped.sql
new file mode 100644
index 0000000000..234ad3625a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all_grouped.sql
@@ -0,0 +1 @@
+select key, count(*) from plato.Input group by key order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/count_all_view_concat.cfg b/yql/essentials/tests/sql/suites/count/count_all_view_concat.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all_view_concat.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_all_view_concat.sql b/yql/essentials/tests/sql/suites/count/count_all_view_concat.sql
new file mode 100644
index 0000000000..1dba44bcdd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_all_view_concat.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select count(*) as count from plato.concat(Input view ksv, Input view ksv);
diff --git a/yql/essentials/tests/sql/suites/count/count_by_nulls.cfg b/yql/essentials/tests/sql/suites/count/count_by_nulls.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_by_nulls.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_by_nulls.sql b/yql/essentials/tests/sql/suites/count/count_by_nulls.sql
new file mode 100644
index 0000000000..6265a21122
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_by_nulls.sql
@@ -0,0 +1 @@
+select count(cast(subkey as int)) as not_null_subkeys from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/count/count_const_no_grouping.sql b/yql/essentials/tests/sql/suites/count/count_const_no_grouping.sql
new file mode 100644
index 0000000000..0590d2c282
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_const_no_grouping.sql
@@ -0,0 +1 @@
+select count(1) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.cfg b/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.sql b/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.sql
new file mode 100644
index 0000000000..d45d8742ad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_distinct_from_view_concat.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select count(distinct k) as count from plato.concat(Input view ksv, Input view ksv);
diff --git a/yql/essentials/tests/sql/suites/count/count_input.txt b/yql/essentials/tests/sql/suites/count/count_input.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_input.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/count/count_input.txt.attr b/yql/essentials/tests/sql/suites/count/count_input.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_input.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/count/count_no_grouping.sql b/yql/essentials/tests/sql/suites/count/count_no_grouping.sql
new file mode 100644
index 0000000000..7b0b662f41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_no_grouping.sql
@@ -0,0 +1 @@
+select count(value) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/count_nullable.cfg b/yql/essentials/tests/sql/suites/count/count_nullable.cfg
new file mode 100644
index 0000000000..8153a1f3e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_nullable.cfg
@@ -0,0 +1 @@
+in Input avg_and_sum_by_value.txt
diff --git a/yql/essentials/tests/sql/suites/count/count_nullable.sql b/yql/essentials/tests/sql/suites/count/count_nullable.sql
new file mode 100644
index 0000000000..4b70423490
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_nullable.sql
@@ -0,0 +1 @@
+select count(cast(key as int)), value from plato.Input group by value order by value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/count_nullable_sub.sql b/yql/essentials/tests/sql/suites/count/count_nullable_sub.sql
new file mode 100644
index 0000000000..0f962a7138
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/count_nullable_sub.sql
@@ -0,0 +1,8 @@
+select
+ count(val) as subkey,
+ cast(avg(val) as int) as value,
+ value as key
+from
+ (select case key when '0' then NULL else cast(subkey as int) / cast(key as int) end as val, value from plato.Input2) as res
+group by value
+order by value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/count/default.cfg b/yql/essentials/tests/sql/suites/count/default.cfg
new file mode 100644
index 0000000000..8d2f379d10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input2 input2.txt
diff --git a/yql/essentials/tests/sql/suites/count/empty.txt b/yql/essentials/tests/sql/suites/count/empty.txt
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/empty.txt
@@ -0,0 +1 @@
+
diff --git a/yql/essentials/tests/sql/suites/count/input.txt b/yql/essentials/tests/sql/suites/count/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/count/input2.txt b/yql/essentials/tests/sql/suites/count/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/count/input_intersect_with_holes.txt b/yql/essentials/tests/sql/suites/count/input_intersect_with_holes.txt
new file mode 100644
index 0000000000..e010220a24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/input_intersect_with_holes.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="null";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="null";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="322";"value"="qqq"};
+{"key"="150";"subkey"="null";"value"="zzz"};
+{"key"="023";"subkey"="null";"value"="vca"};
+{"key"="527";"subkey"="null";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="null";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="null";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/count/view_input.txt b/yql/essentials/tests/sql/suites/count/view_input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/view_input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/count/view_input.txt.attr b/yql/essentials/tests/sql/suites/count/view_input.txt.attr
new file mode 100644
index 0000000000..07386c98e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/count/view_input.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_ksv"="SELECT key as k, subkey as s, value as v FROM self";
+ "_yql_view_key"="SELECT key FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/csee/closure_in_l1_and_l2.sql b/yql/essentials/tests/sql/suites/csee/closure_in_l1_and_l2.sql
new file mode 100644
index 0000000000..4feaabc625
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/closure_in_l1_and_l2.sql
@@ -0,0 +1,12 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return $x
+ +Yql::Fold(AsList(9,10), 1, ($c,$d)->{return $c + $d + Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return $x+$y
+ }), 0, ($a,$b)->{return $a+$b})})
+ +Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return $x+$y
+ }), 0, ($a,$b)->{return $a+$b})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/closure_in_l2_and_l1.sql b/yql/essentials/tests/sql/suites/csee/closure_in_l2_and_l1.sql
new file mode 100644
index 0000000000..0456e07b1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/closure_in_l2_and_l1.sql
@@ -0,0 +1,12 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return $x
+ +Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return $x+$y
+ }), 0, ($a,$b)->{return $a+$b})
+ +Yql::Fold(AsList(9,10), 1, ($c,$d)->{return $c + $d + Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return $x+$y
+ }), 0, ($a,$b)->{return $a+$b})})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/closure_l2.sql b/yql/essentials/tests/sql/suites/csee/closure_l2.sql
new file mode 100644
index 0000000000..16153c80f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/closure_l2.sql
@@ -0,0 +1,4 @@
+SELECT
+ ListMap(AsList(1,2),($x)->{
+ return ListMap(AsList(100,101),($y)->{return $x+$y})
+ });
diff --git a/yql/essentials/tests/sql/suites/csee/complete_l2.sql b/yql/essentials/tests/sql/suites/csee/complete_l2.sql
new file mode 100644
index 0000000000..59ccdb43b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/complete_l2.sql
@@ -0,0 +1,6 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return $x+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ })
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/csee/const_body_diff_lambda.sql b/yql/essentials/tests/sql/suites/csee/const_body_diff_lambda.sql
new file mode 100644
index 0000000000..7fb449778c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/const_body_diff_lambda.sql
@@ -0,0 +1,5 @@
+SELECT
+ AsTuple(
+ ListMap(AsList(1,2),($_x)->{return 3+4}),
+ ListMap(AsList("foo","bar"),($_x)->{return 3+4})
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/const_body_same_lambda.sql b/yql/essentials/tests/sql/suites/csee/const_body_same_lambda.sql
new file mode 100644
index 0000000000..042e743c55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/const_body_same_lambda.sql
@@ -0,0 +1,5 @@
+SELECT
+ AsTuple(
+ ListMap(AsList(1,2),($_x)->{return 3+4}),
+ ListMap(AsList(5,6),($_x)->{return 3+4})
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/default.cfg b/yql/essentials/tests/sql/suites/csee/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/default.cfg
diff --git a/yql/essentials/tests/sql/suites/csee/expr.sql b/yql/essentials/tests/sql/suites/csee/expr.sql
new file mode 100644
index 0000000000..d859286e89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/expr.sql
@@ -0,0 +1 @@
+SELECT (1 + 2) * (1 + 2);
diff --git a/yql/essentials/tests/sql/suites/csee/expr_in_l0_and_l1.sql b/yql/essentials/tests/sql/suites/csee/expr_in_l0_and_l1.sql
new file mode 100644
index 0000000000..1c7a7298d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/expr_in_l0_and_l1.sql
@@ -0,0 +1,7 @@
+SELECT
+ AsList(
+ AsList(1+2),
+ ListMap(AsList(1,2),($x)->{
+ return $x+(1+2)
+ }),
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/expr_in_l1.sql b/yql/essentials/tests/sql/suites/csee/expr_in_l1.sql
new file mode 100644
index 0000000000..0d69aae125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/expr_in_l1.sql
@@ -0,0 +1,6 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return ($x+1)*($x+1)
+ }),
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/expr_in_l1_and_l0.sql b/yql/essentials/tests/sql/suites/csee/expr_in_l1_and_l0.sql
new file mode 100644
index 0000000000..5379245254
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/expr_in_l1_and_l0.sql
@@ -0,0 +1,7 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return $x+(1+2)
+ }),
+ AsList(1+2)
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/l2_dup_l1.sql b/yql/essentials/tests/sql/suites/csee/l2_dup_l1.sql
new file mode 100644
index 0000000000..75ac138279
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/l2_dup_l1.sql
@@ -0,0 +1,9 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return ($x+1)*($x+1)+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ }),
+ ListMap(AsList(10,11),($x)->{
+ return ($x+1)*($x+1)+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ })
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/csee/l2_dup_l1_many.sql b/yql/essentials/tests/sql/suites/csee/l2_dup_l1_many.sql
new file mode 100644
index 0000000000..e1a0c69772
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/l2_dup_l1_many.sql
@@ -0,0 +1,9 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($_x)->{
+ return Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b}) + Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ }),
+ ListMap(AsList(10,11),($_x)->{
+ return Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b}) * Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/lambda_in_l0_and_l1.sql b/yql/essentials/tests/sql/suites/csee/lambda_in_l0_and_l1.sql
new file mode 100644
index 0000000000..a5f244b9e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/lambda_in_l0_and_l1.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return $x+1
+ }),
+ ListMap(AsList(3,4),($x)->{
+ return $x+Yql::Fold(ListMap(AsList(5,6),($x)->{
+ return $x+1
+ }), 0, ($a,$b)->{return $a+$b})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/lambda_in_l1_and_l0.sql b/yql/essentials/tests/sql/suites/csee/lambda_in_l1_and_l0.sql
new file mode 100644
index 0000000000..7a6a51cec0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/lambda_in_l1_and_l0.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return $x+Yql::Fold(ListMap(AsList(5,6),($x)->{
+ return $x+1
+ }), 0, ($a,$b)->{return $a+$b})
+ }),
+ ListMap(AsList(1,2),($x)->{
+ return $x+1
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2.sql b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2.sql
new file mode 100644
index 0000000000..72f48c9697
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2.sql
@@ -0,0 +1,12 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return $x
+ +Yql::Fold(AsList(9,10), 1, ($c,$d)->{return $c + $d + Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return $x+Yql::Fold(AsList(11,12), 2, ($e,$f)->{return $e+$f+$y})
+ }), 0, ($a,$b)->{return $a+$b+Yql::Fold(AsList(13,14), 3, ($i,$j)->{return $i+$j+$a})})})
+ +Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return $x+Yql::Fold(AsList(11,12), 2, ($e,$f)->{return $e+$f+$y})
+ }), 0, ($a,$b)->{return $a+$b+Yql::Fold(AsList(13,14), 3, ($i,$j)->{return $i+$j+$a})})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2_unordered.sql b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2_unordered.sql
new file mode 100644
index 0000000000..ffdf9c639e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l1_and_l2_unordered.sql
@@ -0,0 +1,12 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return MIN_OF($x,
+ Yql::Fold(AsList(9,10), 100, ($c,$d)->{return MIN_OF($c,$d,Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return MIN_OF($x,Yql::Fold(AsList(11,12), 10, ($e,$f)->{return MIN_OF($f,$y,$e)}))
+ }), 100, ($a,$b)->{return MIN_OF($a,$b,Yql::Fold(AsList(13,14), 100, ($i,$j)->{return MIN_OF($i,$j,$a)}))}))}),
+ Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return MIN_OF($x,Yql::Fold(AsList(11,12), 10, ($e,$f)->{return MIN_OF($e,$f,$y)}))
+ }), 100, ($a,$b)->{return MIN_OF($b,Yql::Fold(AsList(13,14), 100, ($i,$j)->{return MIN_OF($a,$j,$i)}),$a)}))
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1.sql b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1.sql
new file mode 100644
index 0000000000..1adc7e0bdb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1.sql
@@ -0,0 +1,12 @@
+SELECT
+ AsList(
+ ListMap(AsList(3,4),($x)->{
+ return $x
+ +Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return $x+Yql::Fold(AsList(11,12), 2, ($e,$f)->{return $e+$f+$y})
+ }), 0, ($a,$b)->{return $a+$b+Yql::Fold(AsList(13,14), 3, ($i,$j)->{return $i+$j+$a})})
+ +Yql::Fold(AsList(9,10), 1, ($c,$d)->{return $c + $d + Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return $x+Yql::Fold(AsList(11,12), 2, ($e,$f)->{return $e+$f+$y})
+ }), 0, ($a,$b)->{return $a+$b+Yql::Fold(AsList(13,14), 3, ($i,$j)->{return $i+$j+$a})})})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1_unordered.sql b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1_unordered.sql
new file mode 100644
index 0000000000..05475188d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/nested_closure_in_l2_and_l1_unordered.sql
@@ -0,0 +1,13 @@
+SELECT
+ AsList(
+ ListMap(AsList(33,42),($x)->{
+ return MAX_OF($x,
+ Yql::Fold(ListMap(AsList(7,8),($y)->{
+ return MAX_OF($x,Yql::Fold(AsList(11,12), 2, ($e,$f)->{return MAX_OF($e,$f,$y)}))
+ }), 0, ($a,$b)->{return MAX_OF($a,$b,Yql::Fold(AsList(13,14), 3, ($i,$j)->{return MAX_OF($i,$j,$a)}))}),
+ Yql::Fold(AsList(9,10), 1, ($c,$d)->{return MAX_OF($c,$d,Yql::Fold(ListMap(AsList(5,6),($y)->{
+ return MAX_OF($x,Yql::Fold(AsList(11,12), 2, ($e,$f)->{return MAX_OF($f,$y,$e)}))
+ }), 0, ($a,$b)->{return MAX_OF(Yql::Fold(AsList(13,14), 3, ($i,$j)->{return MAX_OF($j,$a,$i)}),$a,$b)}))}))
+ })
+ );
+
diff --git a/yql/essentials/tests/sql/suites/csee/same_closure_l2.sql b/yql/essentials/tests/sql/suites/csee/same_closure_l2.sql
new file mode 100644
index 0000000000..b39ecaf0bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_closure_l2.sql
@@ -0,0 +1,6 @@
+SELECT
+ ListMap(AsList(1,2),($x)->{
+ return ListExtend(
+ ListMap(AsList(100,101),($y)->{return $x+$y}),
+ ListMap(AsList(100,101),($y)->{return $x+$y}))
+ })
diff --git a/yql/essentials/tests/sql/suites/csee/same_complete_l2.sql b/yql/essentials/tests/sql/suites/csee/same_complete_l2.sql
new file mode 100644
index 0000000000..80c7af98cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_complete_l2.sql
@@ -0,0 +1,9 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return $x+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ }),
+ ListMap(AsList(10,11),($x)->{
+ return $x+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/same_complete_l2_expr.sql b/yql/essentials/tests/sql/suites/csee/same_complete_l2_expr.sql
new file mode 100644
index 0000000000..d6ed82b87f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_complete_l2_expr.sql
@@ -0,0 +1,9 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{
+ return $x+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ }),
+ ListMap(AsList(1,2),($x)->{
+ return $x+Yql::Fold(AsList(1),0,($a,$b)->{return $a+$b})
+ })
+ );
diff --git a/yql/essentials/tests/sql/suites/csee/same_free_closure_size2.sql b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2.sql
new file mode 100644
index 0000000000..c145deeab4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsTuple(
+ YQL::FlatMap(3/1, ($x)->{
+ return YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })}),
+ YQL::FlatMap(4/1, ($x)->{
+ return YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })})
+ )
diff --git a/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level.sql b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level.sql
new file mode 100644
index 0000000000..a6b9a568fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsTuple(
+ YQL::FlatMap(3/1, ($x)->{
+ return $x + YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })}),
+ YQL::FlatMap(4/1, ($x)->{
+ return $x + YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })})
+ )
diff --git a/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level_expr.sql b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level_expr.sql
new file mode 100644
index 0000000000..ae43452088
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_arg_both_level_expr.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsTuple(
+ YQL::FlatMap(3/1, ($x)->{
+ return $x + YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })}),
+ YQL::FlatMap(3/1, ($x)->{
+ return $x + YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })})
+ )
diff --git a/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_expr.sql b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_expr.sql
new file mode 100644
index 0000000000..b348cbbe8a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_free_closure_size2_expr.sql
@@ -0,0 +1,11 @@
+SELECT
+ AsTuple(
+ YQL::FlatMap(3/1, ($x)->{
+ return YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })}),
+ YQL::FlatMap(3/1, ($x)->{
+ return YQL::FlatMap(1/1,($y)->{
+ return Just($x + $y)
+ })})
+ )
diff --git a/yql/essentials/tests/sql/suites/csee/same_l1.sql b/yql/essentials/tests/sql/suites/csee/same_l1.sql
new file mode 100644
index 0000000000..d1483c600f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_l1.sql
@@ -0,0 +1,5 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{return $x+1}),
+ ListMap(AsList(10,11),($x)->{return $x+1})
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/csee/same_l1_expr.sql b/yql/essentials/tests/sql/suites/csee/same_l1_expr.sql
new file mode 100644
index 0000000000..167e0dca0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/same_l1_expr.sql
@@ -0,0 +1,5 @@
+SELECT
+ AsList(
+ ListMap(AsList(1,2),($x)->{return $x+1}),
+ ListMap(AsList(1,2),($x)->{return $x+1})
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/csee/yql-7237.cfg b/yql/essentials/tests/sql/suites/csee/yql-7237.cfg
new file mode 100644
index 0000000000..c7f999ccb9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/yql-7237.cfg
@@ -0,0 +1 @@
+udf strings_udf
diff --git a/yql/essentials/tests/sql/suites/csee/yql-7237.sql b/yql/essentials/tests/sql/suites/csee/yql-7237.sql
new file mode 100644
index 0000000000..52a0a68ea7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/csee/yql-7237.sql
@@ -0,0 +1,68 @@
+/* syntax version 1 */
+USE plato;
+
+$push_final_data = AsList(
+ AsStruct("manufacturer" AS manufacturer, "state" AS state));
+
+INSERT INTO @push_final
+SELECT * FROM AS_TABLE($push_final_data);
+COMMIT;
+
+$manufacturer_name_fix = ($manufacturer) -> {
+ $lowered_manufacturer = CAST(Unicode::ToLower(CAST(String::Strip($manufacturer) AS Utf8)) AS String);
+ $in = AsList(
+ "oysters", -- bullshit in naming
+ "qumo", -- bullshit in naming
+ "texet", -- bullshit in naming
+ "alcatel", -- bullshit in naming
+ "dexp", -- bullshit in naming
+ "haier", -- bullshit in naming
+ "dexp", -- bullshit in naming
+ "asus", -- ASUSTek Computer Inc & ASUS both usable
+ "yota", -- Yota Devices & Yota Devices Limited ...
+ "ark" -- "ark" & "ark electronic technology" & "ark_electronic_technology"
+ );
+ $lambda = ($substring) -> {
+ RETURN FIND($lowered_manufacturer, $substring) IS NULL;
+ };
+ $list = ListSkipWhile($in, $lambda);
+ RETURN IF(ListHasItems($list), $list[0], $lowered_manufacturer);
+};
+
+$manufacturers_whitelist = (
+ SELECT
+ man as manufacturer
+ FROM
+ (
+ SELECT
+ man, COUNT(*) as cnt
+ FROM
+ @push_final
+ GROUP BY
+ $manufacturer_name_fix(manufacturer) as man
+ )
+ WHERE
+ cnt > 1000
+);
+
+$push_final_preprocessing = (
+ SELECT
+ $manufacturer_name_fix(manufacturer) as manufacturer,
+ state
+ FROM
+ @push_final
+);
+
+SELECT
+ COALESCE(fixed_manufacturer, "other") as manufacturer,
+ L.* WITHOUT L.manufacturer
+FROM
+ $push_final_preprocessing as L
+ LEFT JOIN
+ (
+ SELECT
+ manufacturer as fixed_manufacturer
+ FROM
+ $manufacturers_whitelist
+ ) as R
+ ON(L.manufacturer = R.fixed_manufacturer);
diff --git a/yql/essentials/tests/sql/suites/datetime/all_timezones.sql b/yql/essentials/tests/sql/suites/datetime/all_timezones.sql
new file mode 100644
index 0000000000..517f03c1cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/all_timezones.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+$zones = CAST(ListMap(
+ ListFromRange(0us, 1000us),
+ ($i) -> { RETURN AsStruct($i AS id, SUBSTRING(CAST(YQL::AddTimezone(CurrentUtcDate(), $i) AS String), 11, NULL) AS zone) }
+) AS List<Struct<id:Uint16, zone:Utf8>>);
+
+SELECT * FROM AS_TABLE($zones);
diff --git a/yql/essentials/tests/sql/suites/datetime/current_date.sql b/yql/essentials/tests/sql/suites/datetime/current_date.sql
new file mode 100644
index 0000000000..4743ca6b87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/current_date.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+SELECT
+ cast(CurrentUtcDate() as string) as `date`,
+ cast(CurrentUtcDatetime() as string) as `datetime`,
+ cast(CurrentUtcTimestamp() as string) as `timestamp`;
diff --git a/yql/essentials/tests/sql/suites/datetime/date_arithmetic.sql b/yql/essentials/tests/sql/suites/datetime/date_arithmetic.sql
new file mode 100644
index 0000000000..ac921b75d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_arithmetic.sql
@@ -0,0 +1,26 @@
+/* postgres can not */
+select cast(date("1970-01-02") - date("1970-01-01") as string);
+
+select cast(date("1970-01-01") + interval("P1D") as string);
+select cast(interval("P1D") + date("1970-01-01") as string);
+select cast(date("1970-01-02") - interval("P1D") as string);
+
+select cast(datetime("1970-01-02T00:00:00Z") - datetime("1970-01-01T00:00:00Z") as string);
+
+select cast(datetime("1970-01-01T00:00:00Z") + interval("P1D") as string);
+select cast(interval("P1D") + datetime("1970-01-01T00:00:00Z") as string);
+select cast(datetime("1970-01-02T00:00:00Z") - interval("P1D") as string);
+
+select cast(timestamp("1970-01-02T00:00:00.6Z") - timestamp("1970-01-01T00:00:00.3Z") as string);
+
+select cast(timestamp("1970-01-01T00:00:00.6Z") + interval("P1D") as string);
+select cast(interval("P1D") + timestamp("1970-01-01T00:00:00.6Z") as string);
+select cast(timestamp("1970-01-02T00:00:00.6Z") - interval("P1D") as string);
+
+select cast(interval("P1D") + interval("P1D") as string);
+select cast(interval("P1D") - interval("P1D") as string);
+
+select cast(interval("P1D") * 2l as string);
+select cast(2u * interval("P1D") as string);
+select cast(interval("P1D") / 2 as string);
+select cast(interval("P1D") / 0ut as string);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_bitcast.sql b/yql/essentials/tests/sql/suites/datetime/date_bitcast.sql
new file mode 100644
index 0000000000..94b5628605
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_bitcast.sql
@@ -0,0 +1,36 @@
+/* postgres can not */
+select bitcast(Yql::Date(AsAtom("1")) as Uint8);
+select bitcast(Yql::Date(AsAtom("1")) as Int8);
+select bitcast(Yql::Date(AsAtom("1")) as Uint16);
+select bitcast(Yql::Date(AsAtom("1")) as Int16);
+select bitcast(Yql::Date(AsAtom("1")) as Uint32);
+select bitcast(Yql::Date(AsAtom("1")) as Int32);
+select bitcast(Yql::Date(AsAtom("1")) as Uint64);
+select bitcast(Yql::Date(AsAtom("1")) as Int64);
+
+select bitcast(Yql::Datetime(AsAtom("1")) as Uint8);
+select bitcast(Yql::Datetime(AsAtom("1")) as Int8);
+select bitcast(Yql::Datetime(AsAtom("1")) as Uint16);
+select bitcast(Yql::Datetime(AsAtom("1")) as Int16);
+select bitcast(Yql::Datetime(AsAtom("1")) as Uint32);
+select bitcast(Yql::Datetime(AsAtom("1")) as Int32);
+select bitcast(Yql::Datetime(AsAtom("1")) as Uint64);
+select bitcast(Yql::Datetime(AsAtom("1")) as Int64);
+
+select bitcast(Yql::Timestamp(AsAtom("1")) as Uint8);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Int8);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Uint16);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Int16);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Uint32);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Int32);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Uint64);
+select bitcast(Yql::Timestamp(AsAtom("1")) as Int64);
+
+select bitcast(Yql::Interval(AsAtom("1")) as Uint8);
+select bitcast(Yql::Interval(AsAtom("1")) as Int8);
+select bitcast(Yql::Interval(AsAtom("1")) as Uint16);
+select bitcast(Yql::Interval(AsAtom("1")) as Int16);
+select bitcast(Yql::Interval(AsAtom("1")) as Uint32);
+select bitcast(Yql::Interval(AsAtom("1")) as Int32);
+select bitcast(Yql::Interval(AsAtom("1")) as Uint64);
+select bitcast(Yql::Interval(AsAtom("1")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_cast.sql b/yql/essentials/tests/sql/suites/datetime/date_cast.sql
new file mode 100644
index 0000000000..0cea9766c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_cast.sql
@@ -0,0 +1,97 @@
+/* postgres can not */
+select cast(Yql::Date(AsAtom("1")) as Uint8);
+select cast(Yql::Date(AsAtom("1")) as Uint32);
+select cast(Yql::Date(AsAtom("1")) as Int32);
+select cast(Yql::Date(AsAtom("1")) as Uint64);
+select cast(Yql::Date(AsAtom("1")) as Int64);
+
+select cast(Yql::Datetime(AsAtom("1")) as Uint8);
+select cast(Yql::Datetime(AsAtom("1")) as Uint32);
+select cast(Yql::Datetime(AsAtom("1")) as Int32);
+select cast(Yql::Datetime(AsAtom("1")) as Uint64);
+select cast(Yql::Datetime(AsAtom("1")) as Int64);
+
+select cast(Yql::Timestamp(AsAtom("1")) as Uint8);
+select cast(Yql::Timestamp(AsAtom("1")) as Uint32);
+select cast(Yql::Timestamp(AsAtom("1")) as Int32);
+select cast(Yql::Timestamp(AsAtom("1")) as Uint64);
+select cast(Yql::Timestamp(AsAtom("1")) as Int64);
+
+select cast(Yql::Interval(AsAtom("1")) as Uint8);
+select cast(Yql::Interval(AsAtom("1")) as Uint32);
+select cast(Yql::Interval(AsAtom("1")) as Int32);
+select cast(Yql::Interval(AsAtom("1")) as Uint64);
+select cast(Yql::Interval(AsAtom("1")) as Int64);
+
+select cast(1ut as Date);
+select cast(1u as Date);
+select cast(1 as Date);
+select cast(1ul as Date);
+select cast(1l as Date);
+select cast(-1 as Date);
+select cast(1/1 as Date);
+select cast(-1/1 as Date);
+/* postgres can not */
+select cast(Yql::Date(AsAtom("1")) as Uint8);
+select cast(Yql::Date(AsAtom("1")) as Uint32);
+select cast(Yql::Date(AsAtom("1")) as Int32);
+select cast(Yql::Date(AsAtom("1")) as Uint64);
+select cast(Yql::Date(AsAtom("1")) as Int64);
+
+select cast(Yql::Datetime(AsAtom("1")) as Uint8);
+select cast(Yql::Datetime(AsAtom("1")) as Uint32);
+select cast(Yql::Datetime(AsAtom("1")) as Int32);
+select cast(Yql::Datetime(AsAtom("1")) as Uint64);
+select cast(Yql::Datetime(AsAtom("1")) as Int64);
+
+select cast(Yql::Timestamp(AsAtom("1")) as Uint8);
+select cast(Yql::Timestamp(AsAtom("1")) as Uint32);
+select cast(Yql::Timestamp(AsAtom("1")) as Int32);
+select cast(Yql::Timestamp(AsAtom("1")) as Uint64);
+select cast(Yql::Timestamp(AsAtom("1")) as Int64);
+
+select cast(Yql::Interval(AsAtom("1")) as Uint8);
+select cast(Yql::Interval(AsAtom("1")) as Uint32);
+select cast(Yql::Interval(AsAtom("1")) as Int32);
+select cast(Yql::Interval(AsAtom("1")) as Uint64);
+select cast(Yql::Interval(AsAtom("1")) as Int64);
+
+select cast(1ut as Date);
+select cast(1u as Date);
+select cast(1 as Date);
+select cast(1ul as Date);
+select cast(1l as Date);
+select cast(-1 as Date);
+select cast(1/1 as Date);
+select cast(-1/1 as Date);
+select cast(1/0 as Date);
+
+select cast(1ut as Datetime);
+select cast(1u as Datetime);
+select cast(1 as Datetime);
+select cast(1ul as Datetime);
+select cast(1l as Datetime);
+select cast(-1 as Datetime);
+select cast(1/1 as Datetime);
+select cast(-1/1 as Datetime);
+select cast(1/0 as Datetime);
+
+select cast(1ut as Timestamp);
+select cast(1u as Timestamp);
+select cast(1 as Timestamp);
+select cast(1ul as Timestamp);
+select cast(1l as Timestamp);
+select cast(-1 as Timestamp);
+select cast(1/1 as Timestamp);
+select cast(-1/1 as Timestamp);
+select cast(1/0 as Timestamp);
+
+select cast(1ut as Interval);
+select cast(1u as Interval);
+select cast(-1 as Interval);
+select cast(1ul as Interval);
+select cast(-1l as Interval);
+select cast(-1 as Interval);
+select cast(1/1 as Interval);
+select cast(-1/1 as Interval);
+select cast(1/0 as Interval);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_convert.sql b/yql/essentials/tests/sql/suites/datetime/date_convert.sql
new file mode 100644
index 0000000000..01d8e296cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_convert.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+select Yql::Convert(Yql::Date(AsAtom("1")),AsAtom("Uint8"));
+select Yql::Convert(Yql::Date(AsAtom("1")),AsAtom("Uint32"));
+select Yql::Convert(Yql::Date(AsAtom("1")),AsAtom("Int32"));
+select Yql::Convert(Yql::Date(AsAtom("1")),AsAtom("Uint64"));
+select Yql::Convert(Yql::Date(AsAtom("1")),AsAtom("Int64"));
+
+select Yql::Convert(Yql::Datetime(AsAtom("1")),AsAtom("Uint8"));
+select Yql::Convert(Yql::Datetime(AsAtom("1")),AsAtom("Uint32"));
+select Yql::Convert(Yql::Datetime(AsAtom("1")),AsAtom("Int32"));
+select Yql::Convert(Yql::Datetime(AsAtom("1")),AsAtom("Uint64"));
+select Yql::Convert(Yql::Datetime(AsAtom("1")),AsAtom("Int64"));
+
+select Yql::Convert(Yql::Timestamp(AsAtom("1")),AsAtom("Uint8"));
+select Yql::Convert(Yql::Timestamp(AsAtom("1")),AsAtom("Uint32"));
+select Yql::Convert(Yql::Timestamp(AsAtom("1")),AsAtom("Int32"));
+select Yql::Convert(Yql::Timestamp(AsAtom("1")),AsAtom("Uint64"));
+select Yql::Convert(Yql::Timestamp(AsAtom("1")),AsAtom("Int64"));
+
+select Yql::Convert(Yql::Interval(AsAtom("1")),AsAtom("Uint8"));
+select Yql::Convert(Yql::Interval(AsAtom("1")),AsAtom("Uint32"));
+select Yql::Convert(Yql::Interval(AsAtom("1")),AsAtom("Int32"));
+select Yql::Convert(Yql::Interval(AsAtom("1")),AsAtom("Uint64"));
+select Yql::Convert(Yql::Interval(AsAtom("1")),AsAtom("Int64"));
diff --git a/yql/essentials/tests/sql/suites/datetime/date_diff_compare.sql b/yql/essentials/tests/sql/suites/datetime/date_diff_compare.sql
new file mode 100644
index 0000000000..862ecde03e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_diff_compare.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+select Date("2001-01-01") == Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") == Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") == Timestamp("2001-01-01T00:00:00Z");
+
+select Date("2001-01-01") != Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") != Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") != Timestamp("2001-01-01T00:00:00Z");
+
+select Date("2001-01-01") < Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") < Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") < Timestamp("2001-01-01T00:00:00Z");
+
+select Date("2001-01-01") <= Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") <= Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") <= Timestamp("2001-01-01T00:00:00Z");
+
+select Date("2001-01-01") > Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") > Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") > Timestamp("2001-01-01T00:00:00Z");
+
+select Date("2001-01-01") >= Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") >= Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") >= Timestamp("2001-01-01T00:00:00Z");
diff --git a/yql/essentials/tests/sql/suites/datetime/date_diff_sub.sql b/yql/essentials/tests/sql/suites/datetime/date_diff_sub.sql
new file mode 100644
index 0000000000..1de62ff2ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_diff_sub.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select Date("2001-01-01") - Datetime("2001-01-01T00:00:00Z");
+select Date("2001-01-01") - Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") - Timestamp("2001-01-01T00:00:00Z");
+select Datetime("2001-01-01T00:00:00Z") - Date("2001-01-01");
+select Timestamp("2001-01-01T00:00:00Z") - Date("2001-01-01");
+select Timestamp("2001-01-01T00:00:00Z") - Datetime("2001-01-01T00:00:00Z");
diff --git a/yql/essentials/tests/sql/suites/datetime/date_in.sql b/yql/essentials/tests/sql/suites/datetime/date_in.sql
new file mode 100644
index 0000000000..158c08c964
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_in.sql
@@ -0,0 +1,35 @@
+/* postgres can not */
+select cast("1970-01-01" as date),cast(cast("1970-01-01" as date) as string);
+select cast("2000-04-05" as date),cast(cast("2000-04-05" as date) as string);
+select cast("2100-02-29" as date),cast(cast("2100-02-29" as date) as string);
+select cast("2100-03-01" as date),cast(cast("2100-03-01" as date) as string);
+
+select cast("2000-04-05T06:07:08Z" as datetime),cast(cast("2000-04-05T06:07:08Z" as datetime) as string);
+select cast("2000-04-05T06:07:08Z" as timestamp),cast(cast("2000-04-05T06:07:08Z" as timestamp) as string);
+select cast("2000-04-05T06:07:08.9Z" as timestamp),cast(cast("2000-04-05T06:07:08.9Z" as timestamp) as string);
+select cast("2000-04-05T06:07:08.000009Z" as timestamp),cast(cast("2000-04-05T06:07:08.000009Z" as timestamp) as string);
+
+select cast("P" as interval),cast(cast("P" as interval) as string);
+select cast("P1D" as interval),cast(cast("P1D" as interval) as string);
+select cast("-P1D" as interval),cast(cast("-P1D" as interval) as string);
+select cast("PT2H" as interval),cast(cast("PT2H" as interval) as string);
+select cast("PT2H3M" as interval),cast(cast("PT2H3M" as interval) as string);
+select cast("PT3M" as interval),cast(cast("PT3M" as interval) as string);
+select cast("PT3M4S" as interval),cast(cast("PT3M4S" as interval) as string);
+select cast("PT4S" as interval),cast(cast("PT4S" as interval) as string);
+select cast("PT0S" as interval),cast(cast("PT0S" as interval) as string);
+select cast("PT4.5S" as interval),cast(cast("PT4.5S" as interval) as string);
+select cast("PT4.000005S" as interval),cast(cast("PT4.000005S" as interval) as string);
+select cast("P1DT2H3M4.5S" as interval),cast(cast("P1DT2H3M4.5S" as interval) as string);
+
+select cast("2105-12-31" as date),cast(cast("2105-12-31" as date) as string);
+select cast("2106-01-01" as date),cast(cast("2106-01-01" as date) as string);
+
+select cast("2105-12-31T23:59:59Z" as datetime),cast(cast("2105-12-31T23:59:59Z" as datetime) as string);
+select cast("2106-01-01T00:00:00Z" as datetime),cast(cast("2106-01-01T00:00:00Z" as datetime) as string);
+
+select cast("2105-12-31T23:59:59.999999Z" as timestamp),cast(cast("2105-12-31T23:59:59.999999Z" as timestamp) as string);
+select cast("2106-01-01T00:00:00.000000Z" as timestamp),cast(cast("2106-01-01T00:00:00.000000Z" as timestamp) as string);
+
+select cast("P49672DT23H59M59.999999S" as interval),cast(cast("P49672DT23H59M59.999999S" as interval) as string);
+select cast("P49673D" as interval),cast(cast("P49673D" as interval) as string);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_out.sql b/yql/essentials/tests/sql/suites/datetime/date_out.sql
new file mode 100644
index 0000000000..bdf6f6909c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_out.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+select cast(cast(18000u as date) as string);
+select cast(cast(18000u*86400ul+1u*3600u+2u*60u+3u as datetime) as string);
+select cast(cast(18000u*86400000000ul+1u*3600000000ul+2u*60000000ul+3000000ul+4u as timestamp) as string);
+select cast(cast(18000u*86400000000ul+1u*3600000000ul+2u*60000000ul+3000000ul+4u as interval) as string);
+
+select cast(cast(49673u - 1u as date) as string);
+select cast(cast(49673u as date) as string);
+
+select cast(cast(49673u*86400ul - 1u as datetime) as string);
+select cast(cast(49673u*86400ul as datetime) as string);
+
+select cast(cast(49673u*86400000000ul - 1u as timestamp) as string);
+select cast(cast(49673u*86400000000ul as timestamp) as string);
+
+select cast(cast(49673u*86400000000ul - 1u as interval) as string);
+select cast(cast(49673u*86400000000ul as interval) as string); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/datetime/date_scale.sql b/yql/essentials/tests/sql/suites/datetime/date_scale.sql
new file mode 100644
index 0000000000..d5fe663fca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_scale.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select cast(cast(1u as date) as datetime);
+select cast(cast(1u as date) as timestamp);
+select cast(cast(86400u as datetime) as timestamp);
+select cast(cast(86400u as datetime) as date);
+select cast(cast(86400000000ul as timestamp) as date);
+select cast(cast(86400000000ul as timestamp) as datetime);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_types.sql b/yql/essentials/tests/sql/suites/datetime/date_types.sql
new file mode 100644
index 0000000000..ed6cf55519
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_types.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ Yql::Date(AsAtom("1")),
+ Yql::Datetime(AsAtom("2")),
+ Yql::Timestamp(AsAtom("3")),
+ Yql::Interval(AsAtom("4"))
+FROM Input;
+
+SELECT
+ Yql::Date(AsAtom("1")),
+ Yql::Datetime(AsAtom("2")),
+ Yql::Timestamp(AsAtom("3")),
+ Yql::Interval(AsAtom("4"));
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz.txt b/yql/essentials/tests/sql/suites/datetime/date_tz.txt
new file mode 100644
index 0000000000..1cc4231129
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz.txt
@@ -0,0 +1,2 @@
+{"key"="023";"subkey"="3";"value"="2001-01-01T12:00:00,GMT"};
+{"key"="037";"subkey"="5";"value"="2001-01-01T15:00:00,Europe/Moscow"};
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_addremove.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_addremove.sql
new file mode 100644
index 0000000000..2050d7153d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_addremove.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select AddTimezone(Datetime("2000-01-01T12:00:00Z"),"Europe/Moscow"),
+ AddTimezone(Datetime("2000-01-01T12:00:00Z"),"America/Los_Angeles"),
+ cast(RemoveTimezone(TzDatetime("2000-01-01T12:00:00,Europe/Moscow")) as string),
+ cast(RemoveTimezone(TzDatetime("2000-01-01T12:00:00,America/Los_Angeles")) as string);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_arithmetic.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_arithmetic.sql
new file mode 100644
index 0000000000..438b92cc2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_arithmetic.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+select cast(date("1970-01-02") - tzdate("1970-01-01,America/Los_Angeles") as string);
+select cast(tzdate("1970-01-02,America/Los_Angeles") - date("1970-01-01") as string);
+select cast(tzdate("1970-01-02,America/Los_Angeles") - tzdate("1970-01-01,America/Los_Angeles") as string);
+
+select cast(tzdate("1970-01-01,America/Los_Angeles") + interval("P1D") as string);
+select cast(interval("P1D") + tzdate("1970-01-01,America/Los_Angeles") as string);
+select cast(tzdate("1970-01-02,America/Los_Angeles") - interval("P1D") as string);
+
+select cast(datetime("1970-01-02T00:00:00Z") - tzdatetime("1970-01-01T00:00:00,America/Los_Angeles") as string);
+select cast(tzdatetime("1970-01-02T00:00:00,America/Los_Angeles") - datetime("1970-01-01T00:00:00Z") as string);
+select cast(tzdatetime("1970-01-02T00:00:00,America/Los_Angeles") - tzdatetime("1970-01-01T00:00:00,America/Los_Angeles") as string);
+
+select cast(tzdatetime("1970-01-01T00:00:00,America/Los_Angeles") + interval("P1D") as string);
+select cast(interval("P1D") + tzdatetime("1970-01-01T00:00:00,America/Los_Angeles") as string);
+select cast(tzdatetime("1970-01-02T00:00:00,America/Los_Angeles") - interval("P1D") as string);
+
+select cast(timestamp("1970-01-02T00:00:00.6Z") - tztimestamp("1970-01-01T00:00:00.3,America/Los_Angeles") as string);
+select cast(tztimestamp("1970-01-02T00:00:00.6,America/Los_Angeles") - timestamp("1970-01-01T00:00:00.3Z") as string);
+select cast(tztimestamp("1970-01-02T00:00:00.6,America/Los_Angeles") - tztimestamp("1970-01-01T00:00:00.3,America/Los_Angeles") as string);
+
+select cast(tztimestamp("1970-01-01T00:00:00.6,America/Los_Angeles") + interval("P1D") as string);
+select cast(interval("P1D") + tztimestamp("1970-01-01T00:00:00.6,America/Los_Angeles") as string);
+select cast(tztimestamp("1970-01-02T00:00:00.6,America/Los_Angeles") - interval("P1D") as string);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_bitcast.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_bitcast.sql
new file mode 100644
index 0000000000..77d8f430e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_bitcast.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Uint8);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Int8);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Uint16);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Int16);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Uint32);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Int32);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Uint64);
+select bitcast(Yql::TzDate(AsAtom("1,UTC")) as Int64);
+
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint8);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Int8);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint16);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Int16);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint32);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Int32);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint64);
+select bitcast(Yql::TzDatetime(AsAtom("1,UTC")) as Int64);
+
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint8);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int8);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint16);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int16);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint32);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int32);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint64);
+select bitcast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int64);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_bounds.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_bounds.sql
new file mode 100644
index 0000000000..2dac802c9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_bounds.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+select
+ TZDATE("1970-01-02,Europe/Moscow"),
+ TZDATE("1970-01-01,America/Los_Angeles"),
+ TZDATE("2105-12-31,Europe/Moscow"),
+ TZDATE("2105-12-31,America/Los_Angeles"),
+
+ TZDATETIME("1970-01-01T03:00:00,Europe/Moscow"),
+ TZDATETIME("1969-12-31T16:00:00,America/Los_Angeles"),
+ TZDATETIME("2106-01-01T02:59:59,Europe/Moscow"),
+ TZDATETIME("2105-12-31T15:59:59,America/Los_Angeles"),
+
+ TZTIMESTAMP("1970-01-01T03:00:00.000000,Europe/Moscow"),
+ TZTIMESTAMP("1969-12-31T16:00:00.000000,America/Los_Angeles"),
+ TZTIMESTAMP("2106-01-01T02:59:59.999999,Europe/Moscow"),
+ TZTIMESTAMP("2105-12-31T15:59:59.999999,America/Los_Angeles")
+
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_bounds_scale.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_bounds_scale.sql
new file mode 100644
index 0000000000..0bf37288ad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_bounds_scale.sql
@@ -0,0 +1,31 @@
+/* postgres can not */
+select
+ cast(TZDATE("1970-01-02,Europe/Moscow") as TzDatetime),
+ cast(TZDATE("1970-01-01,America/Los_Angeles") as TzDatetime),
+ cast(TZDATE("2105-12-31,Europe/Moscow") as TzDatetime),
+ cast(TZDATE("2105-12-31,America/Los_Angeles") as TzDatetime),
+
+ cast(TZDATE("1970-01-02,Europe/Moscow") as TzTimestamp),
+ cast(TZDATE("1970-01-01,America/Los_Angeles") as TzTimestamp),
+ cast(TZDATE("2105-12-31,Europe/Moscow") as TzTimestamp),
+ cast(TZDATE("2105-12-31,America/Los_Angeles") as TzTimestamp),
+
+ cast(TZDATETIME("1970-01-02T00:00:00,Europe/Moscow") as TzDate),
+ cast(TZDATETIME("1970-01-01T00:00:00,America/Los_Angeles") as TzDate),
+ cast(TZDATETIME("2106-01-01T02:59:59,Europe/Moscow") as TzDate),
+ cast(TZDATETIME("2105-12-31T15:59:59,America/Los_Angeles") as TzDate),
+
+ cast(TZDATETIME("1970-01-02T00:00:00,Europe/Moscow") as TzTimestamp),
+ cast(TZDATETIME("1970-01-01T00:00:00,America/Los_Angeles") as TzTimestamp),
+ cast(TZDATETIME("2106-01-01T02:59:59,Europe/Moscow") as TzTimestamp),
+ cast(TZDATETIME("2105-12-31T15:59:59,America/Los_Angeles") as TzTimestamp),
+
+ cast(TZTIMESTAMP("1970-01-02T00:00:00.000000,Europe/Moscow") as TzDate),
+ cast(TZTIMESTAMP("1970-01-01T00:00:00.000000,America/Los_Angeles") as TzDate),
+ cast(TZTIMESTAMP("2106-01-01T02:59:59.999999,Europe/Moscow") as TzDate),
+ cast(TZTIMESTAMP("2105-12-31T15:59:59.999999,America/Los_Angeles") as TzDate),
+
+ cast(TZTIMESTAMP("1970-01-02T00:00:00.000000,Europe/Moscow") as TzDatetime),
+ cast(TZTIMESTAMP("1970-01-01T00:00:00.000000,America/Los_Angeles") as TzDatetime),
+ cast(TZTIMESTAMP("2106-01-01T02:59:59.999999,Europe/Moscow") as TzDatetime),
+ cast(TZTIMESTAMP("2105-12-31T15:59:59.999999,America/Los_Angeles") as TzDatetime)
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_bytes.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_bytes.sql
new file mode 100644
index 0000000000..06187182f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_bytes.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+select ToBytes(TzDate("2001-01-01,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzDate("2001-01-01,Europe/Moscow")),TzDate) as string);
+
+select ToBytes(TzDatetime("2001-01-01T01:02:03,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzDatetime("2001-01-01T01:02:03,Europe/Moscow")),TzDatetime) as string);
+
+select ToBytes(TzTimestamp("2001-01-01T01:02:03.456789,Europe/Moscow"));
+select cast(FromBytes(ToBytes(TzTimestamp("2001-01-01T01:02:03.456789,Europe/Moscow")),TzTimestamp) as string);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_cast.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_cast.sql
new file mode 100644
index 0000000000..84b60de923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_cast.sql
@@ -0,0 +1,47 @@
+/* postgres can not */
+select cast(Yql::TzDate(AsAtom("1,UTC")) as Uint8);
+select cast(Yql::TzDate(AsAtom("1,UTC")) as Uint32);
+select cast(Yql::TzDate(AsAtom("1,UTC")) as Int32);
+select cast(Yql::TzDate(AsAtom("1,UTC")) as Uint64);
+select cast(Yql::TzDate(AsAtom("1,UTC")) as Int64);
+
+select cast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint8);
+select cast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint32);
+select cast(Yql::TzDatetime(AsAtom("1,UTC")) as Int32);
+select cast(Yql::TzDatetime(AsAtom("1,UTC")) as Uint64);
+select cast(Yql::TzDatetime(AsAtom("1,UTC")) as Int64);
+
+select cast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint8);
+select cast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint32);
+select cast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int32);
+select cast(Yql::TzTimestamp(AsAtom("1,UTC")) as Uint64);
+select cast(Yql::TzTimestamp(AsAtom("1,UTC")) as Int64);
+
+select cast(1ut as TzDate);
+select cast(1u as TzDate);
+select cast(1 as TzDate);
+select cast(1ul as TzDate);
+select cast(1l as TzDate);
+select cast(-1 as TzDate);
+select cast(1/1 as TzDate);
+select cast(-1/1 as TzDate);
+
+select cast(1ut as TzDatetime);
+select cast(1u as TzDatetime);
+select cast(1 as TzDatetime);
+select cast(1ul as TzDatetime);
+select cast(1l as TzDatetime);
+select cast(-1 as TzDatetime);
+select cast(1/1 as TzDatetime);
+select cast(-1/1 as TzDatetime);
+select cast(1/0 as TzDatetime);
+
+select cast(1ut as TzTimestamp);
+select cast(1u as TzTimestamp);
+select cast(1 as TzTimestamp);
+select cast(1ul as TzTimestamp);
+select cast(1l as TzTimestamp);
+select cast(-1 as TzTimestamp);
+select cast(1/1 as TzTimestamp);
+select cast(-1/1 as TzTimestamp);
+select cast(1/0 as TzTimestamp);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_compare_diff_zones.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_diff_zones.sql
new file mode 100644
index 0000000000..61582cb6b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_diff_zones.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+select cast("2000-01-01,GMT" as tzdate) > tzdate("2000-01-01,Europe/Moscow");
+select cast("1999-12-31,GMT" as tzdate) == tzdate("2000-01-01,Europe/Moscow");
+select RemoveTimezone(cast("1999-12-31,GMT" as tzdate)) == RemoveTimezone(tzdate("2000-01-01,Europe/Moscow"));
+
+select cast("2000-01-01,GMT" as tzdate) == tzdate("2000-01-01,America/Los_Angeles"); -- same time value
+select RemoveTimezone(cast("2000-01-01,GMT" as tzdate)) == RemoveTimezone(tzdate("2000-01-01,America/Los_Angeles"));
+
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) > tzdatetime("2000-01-01T12:00:00,Europe/Moscow");
+select cast("2000-01-01T09:00:00,GMT" as tzdatetime) == tzdatetime("2000-01-01T12:00:00,Europe/Moscow");
+select RemoveTimezone(cast("2000-01-01T09:00:00,GMT" as tzdatetime)) == RemoveTimezone(tzdatetime("2000-01-01T12:00:00,Europe/Moscow"));
+
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) < tzdatetime("2000-01-01T12:00:00,America/Los_Angeles");
+select cast("2000-01-01T20:00:00,GMT" as tzdatetime) == tzdatetime("2000-01-01T12:00:00,America/Los_Angeles");
+select RemoveTimezone(cast("2000-01-01T20:00:00,GMT" as tzdatetime)) == RemoveTimezone(tzdatetime("2000-01-01T12:00:00,America/Los_Angeles"));
+
+select cast("2000-01-01T12:00:00,GMT" as tztimestamp) > tztimestamp("2000-01-01T12:00:00,Europe/Moscow");
+select cast("2000-01-01T09:00:00,GMT" as tztimestamp) == tztimestamp("2000-01-01T12:00:00,Europe/Moscow");
+select RemoveTimezone(cast("2000-01-01T09:00:00,GMT" as tztimestamp)) == RemoveTimezone(tztimestamp("2000-01-01T12:00:00,Europe/Moscow"));
+
+select cast("2000-01-01T12:00:00,GMT" as tztimestamp) < tztimestamp("2000-01-01T12:00:00,America/Los_Angeles");
+select cast("2000-01-01T20:00:00,GMT" as tztimestamp) == tztimestamp("2000-01-01T12:00:00,America/Los_Angeles");
+select RemoveTimezone(cast("2000-01-01T20:00:00,GMT" as tztimestamp)) == RemoveTimezone(tztimestamp("2000-01-01T12:00:00,America/Los_Angeles"));
+
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_compare_gmt.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_gmt.sql
new file mode 100644
index 0000000000..d6d805a826
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_gmt.sql
@@ -0,0 +1,42 @@
+/* postgres can not */
+select cast("2000-01-01,GMT" as tzdate) == cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) < cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) <= cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) > cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) >= cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) != cast("2000-01-01" as date);
+
+select cast("2000-01-01" as date) == cast("2000-01-01,GMT" as tzdate);
+select cast("2000-01-01" as date) < cast("2000-01-01,GMT" as tzdate);
+select cast("2000-01-01" as date) <= cast("2000-01-01,GMT" as tzdate);
+select cast("2000-01-01" as date) > cast("2000-01-01,GMT" as tzdate);
+select cast("2000-01-01" as date) >= cast("2000-01-01,GMT" as tzdate);
+select cast("2000-01-01" as date) != cast("2000-01-01,GMT" as tzdate);
+
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) == cast("2000-01-01T12:00:00Z" as datetime);
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) < cast("2000-01-01T12:00:00Z" as datetime);
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) <= cast("2000-01-01T12:00:00Z" as datetime);
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) > cast("2000-01-01T12:00:00Z" as datetime);
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) >= cast("2000-01-01T12:00:00Z" as datetime);
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) != cast("2000-01-01T12:00:00Z" as datetime);
+
+select cast("2000-01-01T12:00:00Z" as datetime) == cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select cast("2000-01-01T12:00:00Z" as datetime) < cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select cast("2000-01-01T12:00:00Z" as datetime) <= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select cast("2000-01-01T12:00:00Z" as datetime) > cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select cast("2000-01-01T12:00:00Z" as datetime) >= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select cast("2000-01-01T12:00:00Z" as datetime) != cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) == cast("2000-01-01T12:00:00.123456Z" as timestamp);
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) < cast("2000-01-01T12:00:00.123456Z" as timestamp);
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) <= cast("2000-01-01T12:00:00.123456Z" as timestamp);
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) > cast("2000-01-01T12:00:00.123456Z" as timestamp);
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) >= cast("2000-01-01T12:00:00.123456Z" as timestamp);
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) != cast("2000-01-01T12:00:00.123456Z" as timestamp);
+
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) == cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) < cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) <= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) > cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) >= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select cast("2000-01-01T12:00:00.123456Z" as timestamp) != cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_compare_same_zones.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_same_zones.sql
new file mode 100644
index 0000000000..862c0e2b94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_compare_same_zones.sql
@@ -0,0 +1,42 @@
+/* postgres can not */
+select cast("2000-01-01,GMT" as tzdate) == tzdate("2000-01-01,GMT");
+select cast("2000-01-01,GMT" as tzdate) < cast("2000-01-01" as date);
+select cast("2000-01-01,GMT" as tzdate) <= tzdate("2000-01-01,GMT");
+select cast("2000-01-01,GMT" as tzdate) > tzdate("2000-01-01,GMT");
+select cast("2000-01-01,GMT" as tzdate) >= tzdate("2000-01-01,GMT");
+select cast("2000-01-01,GMT" as tzdate) != tzdate("2000-01-01,GMT");
+
+select tzdate("2000-01-01,GMT") == cast("2000-01-01,GMT" as tzdate);
+select tzdate("2000-01-01,GMT") < cast("2000-01-01,GMT" as tzdate);
+select tzdate("2000-01-01,GMT") <= cast("2000-01-01,GMT" as tzdate);
+select tzdate("2000-01-01,GMT") > cast("2000-01-01,GMT" as tzdate);
+select tzdate("2000-01-01,GMT") >= cast("2000-01-01,GMT" as tzdate);
+select tzdate("2000-01-01,GMT") != cast("2000-01-01,GMT" as tzdate);
+
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) == tzdatetime("2000-01-01T12:00:00,GMT");
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) < tzdatetime("2000-01-01T12:00:00,GMT");
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) <= tzdatetime("2000-01-01T12:00:00,GMT");
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) > tzdatetime("2000-01-01T12:00:00,GMT");
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) >= tzdatetime("2000-01-01T12:00:00,GMT");
+select cast("2000-01-01T12:00:00,GMT" as tzdatetime) != tzdatetime("2000-01-01T12:00:00,GMT");
+
+select tzdatetime("2000-01-01T12:00:00,GMT") == cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select tzdatetime("2000-01-01T12:00:00,GMT") < cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select tzdatetime("2000-01-01T12:00:00,GMT") <= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select tzdatetime("2000-01-01T12:00:00,GMT") > cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select tzdatetime("2000-01-01T12:00:00,GMT") >= cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+select tzdatetime("2000-01-01T12:00:00,GMT") != cast("2000-01-01T12:00:00,GMT" as tzdatetime);
+
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) == tztimestamp("2000-01-01T12:00:00.123456,GMT");
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) < tztimestamp("2000-01-01T12:00:00.123456,GMT");
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) <= tztimestamp("2000-01-01T12:00:00.123456,GMT");
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) > tztimestamp("2000-01-01T12:00:00.123456,GMT");
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) >= tztimestamp("2000-01-01T12:00:00.123456,GMT");
+select cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp) != tztimestamp("2000-01-01T12:00:00.123456,GMT");
+
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") == cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") < cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") <= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") > cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") >= cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
+select tztimestamp("2000-01-01T12:00:00.123456,GMT") != cast("2000-01-01T12:00:00.123456,GMT" as tztimestamp);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_expand_gmt.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_expand_gmt.sql
new file mode 100644
index 0000000000..f0e62cc37e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_expand_gmt.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select
+ cast(Date("2000-01-01") as TzDate),
+ cast(Datetime("2000-01-01T01:02:03Z") as TzDatetime),
+ cast(Timestamp("2000-01-01T01:02:03.456789Z") as TzTimestamp);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.cfg b/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.sql
new file mode 100644
index 0000000000..f8f220c217
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_impossible_cast.sql
@@ -0,0 +1,6 @@
+SELECT
+ CAST(AddTimezone(
+ /* "1970-01-01T20:59:59Z" */
+ CAST(75599 AS DateTime),
+ "Europe/Moscow"
+ ) AS TzDate)
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_io.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_io.sql
new file mode 100644
index 0000000000..76e9243cd4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_io.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select
+ cast(cast(TzDate("2000-01-01,Europe/Moscow") as string) as TzDate),
+ cast(cast(TzDatetime("2000-01-01T01:02:03,Europe/Moscow") as string) as TzDatetime),
+ cast(cast(TzTimestamp("2000-01-01T01:02:03.456789,Europe/Moscow") as string) as TzTimestamp);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_scale.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_scale.sql
new file mode 100644
index 0000000000..84ffa55471
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_scale.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+select cast(TzDate("2000-01-01,Europe/Moscow") as TzDatetime);
+select cast(TzDate("2000-01-01,Europe/Moscow") as TzTimestamp);
+select cast(TzDatetime("2000-01-01T12:00:00,Europe/Moscow") as TzDate);
+select cast(TzDatetime("2000-01-01T12:00:00,Europe/Moscow") as TzTimestamp);
+select cast(TzTimestamp("2000-01-01T12:00:00.456789,Europe/Moscow") as TzDate);
+select cast(TzTimestamp("2000-01-01T12:00:00.456789,Europe/Moscow") as TzDatetime);
+
+select cast(TzDate("2000-01-01,America/Los_Angeles") as TzDatetime);
+select cast(TzDate("2000-01-01,America/Los_Angeles") as TzTimestamp);
+select cast(TzDatetime("2000-01-01T12:00:00,America/Los_Angeles") as TzDate);
+select cast(TzDatetime("2000-01-01T12:00:00,America/Los_Angeles") as TzTimestamp);
+select cast(TzTimestamp("2000-01-01T12:00:00.456789,America/Los_Angeles") as TzDate);
+select cast(TzTimestamp("2000-01-01T12:00:00.456789,America/Los_Angeles") as TzDatetime);
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.cfg b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.cfg
new file mode 100644
index 0000000000..4e01ee544a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.cfg
@@ -0,0 +1,2 @@
+in Input date_tz.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.sql
new file mode 100644
index 0000000000..72954c51bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_asc.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into Output with truncate
+select
+ cast(value as tzdatetime) as x
+from Input
+order by x asc;
+commit;
+
+select * from Output;
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.cfg b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.cfg
new file mode 100644
index 0000000000..4e01ee544a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.cfg
@@ -0,0 +1,2 @@
+in Input date_tz.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.sql b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.sql
new file mode 100644
index 0000000000..4f21122ede
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/date_tz_table_sort_desc.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into Output with truncate
+select
+ cast(value as tzdatetime) as x
+from Input
+order by x desc;
+commit;
+
+select * from Output;
diff --git a/yql/essentials/tests/sql/suites/datetime/default.cfg b/yql/essentials/tests/sql/suites/datetime/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/datetime/input.txt b/yql/essentials/tests/sql/suites/datetime/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/datetime/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/distinct/default.cfg b/yql/essentials/tests/sql/suites/distinct/default.cfg
new file mode 100644
index 0000000000..389a8e8f21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_and_join.cfg b/yql/essentials/tests/sql/suites/distinct/distinct_and_join.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_and_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_and_join.sql b/yql/essentials/tests/sql/suites/distinct/distinct_and_join.sql
new file mode 100644
index 0000000000..3f36ed9841
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_and_join.sql
@@ -0,0 +1,8 @@
+SELECT
+DISTINCT
+ i1.key,
+ i2.key,
+ i1.subkey
+FROM plato.Input AS i1 JOIN plato.Input AS i2 on i1.key == i2.subkey
+ORDER BY i1.key, i2.key, i1.subkey
+;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_by_tuple.sql b/yql/essentials/tests/sql/suites/distinct/distinct_by_tuple.sql
new file mode 100644
index 0000000000..ba6c707502
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_by_tuple.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select distinct key from (select AsTuple(Just(key), Just(key)) as key, subkey, value from plato.Input) order by key;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_columns.sql b/yql/essentials/tests/sql/suites/distinct/distinct_columns.sql
new file mode 100644
index 0000000000..75428df492
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_columns.sql
@@ -0,0 +1 @@
+select distinct key, subkey, value from plato.Input3 order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_columns_after_group.sql b/yql/essentials/tests/sql/suites/distinct/distinct_columns_after_group.sql
new file mode 100644
index 0000000000..0d98c79f1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_columns_after_group.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+select distinct avg_key, min_val from (
+ select avg(cast(key as int)) as avg_key, min(value) as min_val from plato.Input3 group by subkey
+) as x order by avg_key, min_val; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_count_and_avg.sql b/yql/essentials/tests/sql/suites/distinct/distinct_count_and_avg.sql
new file mode 100644
index 0000000000..ac99b592f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_count_and_avg.sql
@@ -0,0 +1 @@
+select count(distinct key) as count, avg(numKey) as avg from (select key, cast(key as int) as numKey, value from plato.Input2) as x group by value order by count; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_count_and_full_count.sql b/yql/essentials/tests/sql/suites/distinct/distinct_count_and_full_count.sql
new file mode 100644
index 0000000000..84900dc016
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_count_and_full_count.sql
@@ -0,0 +1 @@
+select value, count(distinct key) as dist, count(key) as full from plato.Input2 group by value order by value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_count_no_gouping.sql b/yql/essentials/tests/sql/suites/distinct/distinct_count_no_gouping.sql
new file mode 100644
index 0000000000..aec6be38e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_count_no_gouping.sql
@@ -0,0 +1 @@
+select count(distinct key) as dist, count(key) as full from plato.Input2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_count_only.sql b/yql/essentials/tests/sql/suites/distinct/distinct_count_only.sql
new file mode 100644
index 0000000000..45c1ec2740
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_count_only.sql
@@ -0,0 +1 @@
+select count(distinct key) from plato.Input2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_groupby.sql b/yql/essentials/tests/sql/suites/distinct/distinct_groupby.sql
new file mode 100644
index 0000000000..232a2b5a96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_groupby.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+
+use plato;
+
+select distinct k || "_" as k1, "_" || v as v1 from Input2 group by key as k, value as v order by k1,v1;
+
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_having_no_agg.sql b/yql/essentials/tests/sql/suites/distinct/distinct_having_no_agg.sql
new file mode 100644
index 0000000000..dfc8943362
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_having_no_agg.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+pragma warning("disable", "4526");
+use plato;
+
+select distinct key from Input2 having key != '0';
+
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_join.sql b/yql/essentials/tests/sql/suites/distinct/distinct_join.sql
new file mode 100644
index 0000000000..0e2aba1c5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_join.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+
+use plato;
+
+select distinct * from (select Unwrap(cast(key as Int32)) as key, value from Input2) as a
+join (select Just(1ul) as key, 123 as subkey) as b
+using(key) order by value;
+
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_list_after_group.sql b/yql/essentials/tests/sql/suites/distinct/distinct_list_after_group.sql
new file mode 100644
index 0000000000..33a780ea0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_list_after_group.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select listsort(aggregate_list(distinct key)) as key_list, value as name from plato.Input3 group by value order by name;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_one_count.sql b/yql/essentials/tests/sql/suites/distinct/distinct_one_count.sql
new file mode 100644
index 0000000000..a5778dfe30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_one_count.sql
@@ -0,0 +1 @@
+select value, count(distinct key) as count from plato.Input2 group by value order by value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_star.sql b/yql/essentials/tests/sql/suites/distinct/distinct_star.sql
new file mode 100644
index 0000000000..ac96695c1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_star.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+
+use plato;
+
+select distinct * from Input2 order by key, subkey;
+
+select distinct * without subkey from Input2 order by key, value;
+
+select distinct a.*, TableName() as tn, without subkey from Input2 as a order by key, value;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_star1.cfg b/yql/essentials/tests/sql/suites/distinct/distinct_star1.cfg
new file mode 100644
index 0000000000..d1dbe1ff8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_star1.cfg
@@ -0,0 +1 @@
+in Input input_dups.txt
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_star1.sql b/yql/essentials/tests/sql/suites/distinct/distinct_star1.sql
new file mode 100644
index 0000000000..775d2ac81d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_star1.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+
+select distinct * from plato.Input order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_star_inmem.sql b/yql/essentials/tests/sql/suites/distinct/distinct_star_inmem.sql
new file mode 100644
index 0000000000..520e6e13bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_star_inmem.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$src = select 1, 2, 3 union all select 1, 2, 3;
+
+select distinct * from $src;
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_union_all.sql b/yql/essentials/tests/sql/suites/distinct/distinct_union_all.sql
new file mode 100644
index 0000000000..7ddf2e4906
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_union_all.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+
+use plato;
+pragma AnsiOrderByLimitInUnionAll;
+
+select distinct key, value from Input2
+union all
+select key, value from Input2 order by key, value;
+
diff --git a/yql/essentials/tests/sql/suites/distinct/distinct_window.sql b/yql/essentials/tests/sql/suites/distinct/distinct_window.sql
new file mode 100644
index 0000000000..ab37cd91a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/distinct_window.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+
+use plato;
+
+select distinct AGGREGATE_LIST(value) over w as values, key from Input2
+window w as (partition by key order by value rows between unbounded preceding and unbounded following)
+order by key;
+
diff --git a/yql/essentials/tests/sql/suites/distinct/input.txt b/yql/essentials/tests/sql/suites/distinct/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/distinct/input2.txt b/yql/essentials/tests/sql/suites/distinct/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/distinct/input3.txt b/yql/essentials/tests/sql/suites/distinct/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/distinct/input4.txt b/yql/essentials/tests/sql/suites/distinct/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/distinct/input_dups.txt b/yql/essentials/tests/sql/suites/distinct/input_dups.txt
new file mode 100644
index 0000000000..4e5e036bb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input_dups.txt
@@ -0,0 +1,5 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="20";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/distinct/input_intersect.txt b/yql/essentials/tests/sql/suites/distinct/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/distinct/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.cfg b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.cfg
new file mode 100644
index 0000000000..628ba758c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.cfg
@@ -0,0 +1,3 @@
+providers dq
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.sql b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.sql
new file mode 100644
index 0000000000..48ed7e56a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* dq can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+pragma yt.MaxRowWeight='32M';
+
+insert into Input
+select key, subkey, value from Input;
+
diff --git a/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.cfg b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.cfg
new file mode 100644
index 0000000000..628ba758c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.cfg
@@ -0,0 +1,3 @@
+providers dq
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.sql b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.sql
new file mode 100644
index 0000000000..a5ff262828
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/blacklisted_pragmas1.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* dq can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+pragma yt.PoolTrees='test';
+
+insert into Input
+select key, subkey, value from Input;
+
diff --git a/yql/essentials/tests/sql/suites/dq/default.cfg b/yql/essentials/tests/sql/suites/dq/default.cfg
new file mode 100644
index 0000000000..5a04bd7d71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/default.cfg
@@ -0,0 +1,2 @@
+providers dq
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/dq/dq_replicate_ok.sql b/yql/essentials/tests/sql/suites/dq/dq_replicate_ok.sql
new file mode 100644
index 0000000000..7fe22bdd86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/dq_replicate_ok.sql
@@ -0,0 +1,6 @@
+use plato;
+SELECT key
+ , COUNT(*) AS cnt
+ , COUNT(DISTINCT value) AS uniq
+FROM Input
+GROUP BY key
diff --git a/yql/essentials/tests/sql/suites/dq/input.txt b/yql/essentials/tests/sql/suites/dq/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.cfg b/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.cfg
new file mode 100644
index 0000000000..041e8638ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.cfg
@@ -0,0 +1,5 @@
+providers dq
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
diff --git a/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.sql b/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.sql
new file mode 100644
index 0000000000..163762e45a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/join_cbo_native_3_tables.sql
@@ -0,0 +1,10 @@
+use plato;
+
+pragma CostBasedOptimizer="native";
+
+select i1.value, i2.value, i3.value, i4.value
+from Input1 as i1
+join Input2 as i2 on i1.key=i2.key
+join Input3 as i3 on i1.key=i3.key
+join Input4 as i4 on i1.key=i4.key
+order by i1.value, i2.value, i3.value, i4.value;
diff --git a/yql/essentials/tests/sql/suites/dq/list.txt b/yql/essentials/tests/sql/suites/dq/list.txt
new file mode 100644
index 0000000000..085426e7dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/list.txt
@@ -0,0 +1,4 @@
+075
+800
+020
+150
diff --git a/yql/essentials/tests/sql/suites/dq/mem_limit.cfg b/yql/essentials/tests/sql/suites/dq/mem_limit.cfg
new file mode 100644
index 0000000000..33c765a8f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/mem_limit.cfg
@@ -0,0 +1,2 @@
+xfail
+providers dq
diff --git a/yql/essentials/tests/sql/suites/dq/mem_limit.sql b/yql/essentials/tests/sql/suites/dq/mem_limit.sql
new file mode 100644
index 0000000000..b3bac08441
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/mem_limit.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* dqfile can not */
+USE plato;
+
+PRAGMA DqEngine="force";
+PRAGMA dq.MemoryLimit="1M";
+SELECT String::JoinFromList(ListMap(ListFromRange(0, 1000000), ($_) -> { return "0"; }), "");
diff --git a/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.cfg b/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.cfg
new file mode 100644
index 0000000000..628ba758c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.cfg
@@ -0,0 +1,3 @@
+providers dq
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.sql b/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.sql
new file mode 100644
index 0000000000..cb4b754ff4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/pool_trees_whitelist.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma OrderedColumns;
+pragma yt.PoolTrees='physical,cloud';
+
+insert into Input
+select key, subkey, value from Input;
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.cfg b/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.cfg
new file mode 100644
index 0000000000..144206fd2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.cfg
@@ -0,0 +1,4 @@
+providers dq
+in Input input.txt
+file list.txt list.txt
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.sql b/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.sql
new file mode 100644
index 0000000000..a75d060c8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_asyncfile.sql
@@ -0,0 +1,5 @@
+use plato;
+
+$a = select max(key) from Input where key in ParseFile("String", "list.txt");
+
+select * from Input where key >= $a;
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel.cfg b/yql/essentials/tests/sql/suites/dq/precompute_parallel.cfg
new file mode 100644
index 0000000000..cf64efcf8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel.cfg
@@ -0,0 +1,4 @@
+providers dq
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel.sql b/yql/essentials/tests/sql/suites/dq/precompute_parallel.sql
new file mode 100644
index 0000000000..4f3924af4c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel.sql
@@ -0,0 +1,7 @@
+use plato;
+
+$a = select key from Input order by key limit 1;
+
+insert into Output1 select * from Input where key <= $a;
+insert into Output2 select * from Input where key >= $a;
+
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.cfg b/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.cfg
new file mode 100644
index 0000000000..1ff2e85554
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.cfg
@@ -0,0 +1,5 @@
+providers dq
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.sql b/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.sql
new file mode 100644
index 0000000000..c9a5dbc8f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel_indep.sql
@@ -0,0 +1,5 @@
+use plato;
+
+insert into Output select sum(cast(key as int32)) from Input1;
+insert into Output select sum(cast(key as int32)) from Input2;
+insert into Output select sum(cast(key as int32)) from Input3;
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.cfg b/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.cfg
new file mode 100644
index 0000000000..cf64efcf8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.cfg
@@ -0,0 +1,4 @@
+providers dq
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.sql b/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.sql
new file mode 100644
index 0000000000..f68eaabcc9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_parallel_mix.sql
@@ -0,0 +1,7 @@
+use plato;
+
+$a = select key from Input order by key limit 1;
+$b = select key from Input order by key limit 1 offset 1;
+
+insert into Output1 select * from Input where key <= $a;
+insert into Output2 select * from Input where key >= $a and key != $b;
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_result.sql b/yql/essentials/tests/sql/suites/dq/precompute_result.sql
new file mode 100644
index 0000000000..c00a9af0de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_result.sql
@@ -0,0 +1,6 @@
+use plato;
+
+$l = select min(cast(key as uint64)) as key from Input;
+$l = EvaluateExpr($l);
+
+select * from Input limit $l ?? 0;
diff --git a/yql/essentials/tests/sql/suites/dq/precompute_tree.sql b/yql/essentials/tests/sql/suites/dq/precompute_tree.sql
new file mode 100644
index 0000000000..2073f261e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/precompute_tree.sql
@@ -0,0 +1,9 @@
+use plato;
+
+$a = select max(key) from Input;
+
+$b = select min(subkey) from Input where key < $a;
+
+$c = select min(key) from Input where key < "080";
+
+select * from Input where key > $c and subkey > $b;
diff --git a/yql/essentials/tests/sql/suites/dq/read_cost.sql b/yql/essentials/tests/sql/suites/dq/read_cost.sql
new file mode 100644
index 0000000000..173c2f1593
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/read_cost.sql
@@ -0,0 +1,8 @@
+pragma warning("disable", "4510");
+pragma CostBasedOptimizer="PG";
+use plato;
+
+$foo = select subkey, key, value as v from Input order by subkey asc, key desc limit 10;
+$x = process $foo;
+
+select YQL::CostsOf($x) as costs;
diff --git a/yql/essentials/tests/sql/suites/dq/read_cost_native.sql b/yql/essentials/tests/sql/suites/dq/read_cost_native.sql
new file mode 100644
index 0000000000..65e744bb77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/read_cost_native.sql
@@ -0,0 +1,8 @@
+pragma warning("disable", "4510");
+pragma CostBasedOptimizer="Native";
+use plato;
+
+$foo = select subkey, key, value as v from Input order by subkey asc, key desc limit 10;
+$x = process $foo;
+
+select YQL::CostsOf($x) as costs;
diff --git a/yql/essentials/tests/sql/suites/dq/truncate_local.sql b/yql/essentials/tests/sql/suites/dq/truncate_local.sql
new file mode 100644
index 0000000000..71872dcf16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/truncate_local.sql
@@ -0,0 +1,3 @@
+pragma DqEngine="auto";
+select * from AS_TABLE(ListMap(ListFromRange(1,10000),($x)->(<|a:$x|>)));
+
diff --git a/yql/essentials/tests/sql/suites/dq/wrong_script.cfg b/yql/essentials/tests/sql/suites/dq/wrong_script.cfg
new file mode 100644
index 0000000000..33c765a8f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/wrong_script.cfg
@@ -0,0 +1,2 @@
+xfail
+providers dq
diff --git a/yql/essentials/tests/sql/suites/dq/wrong_script.sql b/yql/essentials/tests/sql/suites/dq/wrong_script.sql
new file mode 100644
index 0000000000..7774e498a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/wrong_script.sql
@@ -0,0 +1,13 @@
+/* custom error:Failed to cast arguments*/
+/* dqfile can not */
+USE plato;
+
+$f=Python3::f(@@
+def f(x):
+ """
+ Callable<(Int32)->Int32>
+ """
+ return ""
+@@);
+
+select $f(0);
diff --git a/yql/essentials/tests/sql/suites/dq/wrong_script_segf.cfg b/yql/essentials/tests/sql/suites/dq/wrong_script_segf.cfg
new file mode 100644
index 0000000000..33c765a8f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/wrong_script_segf.cfg
@@ -0,0 +1,2 @@
+xfail
+providers dq
diff --git a/yql/essentials/tests/sql/suites/dq/wrong_script_segf.sql b/yql/essentials/tests/sql/suites/dq/wrong_script_segf.sql
new file mode 100644
index 0000000000..a679ed4c2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/wrong_script_segf.sql
@@ -0,0 +1,17 @@
+/* custom error:PrintBacktraceToStderr*/
+/* dqfile can not */
+USE plato;
+
+$f=Python3::f(@@
+def f(x):
+ """
+ Callable<(Int32)->Int32>
+ """
+ import ctypes
+ def deref(addr, typ):
+ return ctypes.cast(addr, ctypes.POINTER(typ)).contents
+ print(deref(1, ctypes.c_int))
+ return 0
+@@);
+
+select $f(0);
diff --git a/yql/essentials/tests/sql/suites/dq/wrong_script_timeout.sql b/yql/essentials/tests/sql/suites/dq/wrong_script_timeout.sql
new file mode 100644
index 0000000000..8493ab87e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/dq/wrong_script_timeout.sql
@@ -0,0 +1,14 @@
+/* dqfile can not */
+USE plato;
+
+$f=Python3::f(@@
+def f(x):
+ """
+ Callable<(Int32)->Int32>
+ """
+ import time
+ time.sleep(60)
+ return 0
+@@);
+
+select $f(0);
diff --git a/yql/essentials/tests/sql/suites/epochs/default.cfg b/yql/essentials/tests/sql/suites/epochs/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/default.cfg
diff --git a/yql/essentials/tests/sql/suites/epochs/input.txt b/yql/essentials/tests/sql/suites/epochs/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/epochs/modify.txt b/yql/essentials/tests/sql/suites/epochs/modify.txt
new file mode 100644
index 0000000000..15f63a38a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/modify.txt
@@ -0,0 +1,2 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/epochs/modify.txt.attr b/yql/essentials/tests/sql/suites/epochs/modify.txt.attr
new file mode 100644
index 0000000000..36b3c00c90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/modify.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["DataType";"String";];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/epochs/read_modified.cfg b/yql/essentials/tests/sql/suites/epochs/read_modified.cfg
new file mode 100644
index 0000000000..91ba34f663
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/read_modified.cfg
@@ -0,0 +1,2 @@
+out Output modify.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/epochs/read_modified.sql b/yql/essentials/tests/sql/suites/epochs/read_modified.sql
new file mode 100644
index 0000000000..b30996c785
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/read_modified.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into Output select * from Output;
+insert into Output select * from Output;
+
+commit;
+
+select count(*) from Output;
+
+insert into Output select * from Output;
+insert into Output select * from Output;
+
+commit;
+
+select count(*) from Output;
diff --git a/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.cfg b/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.cfg
new file mode 100644
index 0000000000..7cbf80703f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.cfg
@@ -0,0 +1,2 @@
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.sql b/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.sql
new file mode 100644
index 0000000000..8127e25a0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/reset_sortness_on_append.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into Output with truncate (a, b) values
+('00', '10'),
+('11', '20'),
+('21', '30'),
+('31', '40'),
+('41', '50');
+
+commit;
+
+insert into Output select * from Output order by a;
+
+commit;
+
+select * from Output where a > '11'
diff --git a/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.cfg b/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.cfg
new file mode 100644
index 0000000000..2e3eaf9682
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.sql b/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.sql
new file mode 100644
index 0000000000..ee5c907dc9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/use_and_drop_anonymous.sql
@@ -0,0 +1,21 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into @tmp select * from Input where key > "100";
+commit;
+
+insert into Output
+select * from @tmp where key != "150";
+
+drop table @tmp;
+commit;
+
+insert into @tmp select * from Input where key > "200";
+commit;
+
+insert into Output
+select * from @tmp where key != "150";
+
+drop table @tmp;
+commit;
diff --git a/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.cfg b/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.cfg
new file mode 100644
index 0000000000..fe2b19a9ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.sql b/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.sql
new file mode 100644
index 0000000000..28c1f2e062
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/epochs/use_sorted_by_complex_type.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+insert into Output
+select
+ key as key,
+ aggr_list(subkey) as lst
+from Input
+group by key
+order by key, lst;
+
+commit;
+
+select * from Output where key > "150"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/as_dict_dict_key.sql b/yql/essentials/tests/sql/suites/expr/as_dict_dict_key.sql
new file mode 100644
index 0000000000..40024336bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_dict_dict_key.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+$d1 = AsDict(
+ AsTuple(AsList(1,2,3),"foo"),
+ AsTuple(AsList(1,2),"bar")
+);
+
+
+$d2 = AsDict(
+ AsTuple(AsList(1,3),"baz"),
+ AsTuple(AsList(1,2),"qwe")
+);
+
+$d3 = DictCreate(DictKeyType(TypeOf($d2)), DictPayloadType(TypeOf($d2)));
+
+$d = AsDict(
+ AsTuple($d1, 17),
+ AsTuple($d2, 32)
+);
+
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return ListMap(DictItems($x.0), ($y) -> {return ($y, $x.1)})}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ ListSort(DictPayloads($d));
+select DictLookup($d,$d1), DictLookup($d,$d3);
+select DictContains($d,$d1), DictContains($d,$d3);
diff --git a/yql/essentials/tests/sql/suites/expr/as_dict_implicit_cast.sql b/yql/essentials/tests/sql/suites/expr/as_dict_implicit_cast.sql
new file mode 100644
index 0000000000..e9024cf14e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_dict_implicit_cast.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT {{13:42U},{13U:42}}, {{13U:42},{13:42U}};
diff --git a/yql/essentials/tests/sql/suites/expr/as_dict_list_key.sql b/yql/essentials/tests/sql/suites/expr/as_dict_list_key.sql
new file mode 100644
index 0000000000..1d105cfdd2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_dict_list_key.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+$d = AsDict(
+ AsTuple(AsList(1,2,3),"foo"),
+ AsTuple(AsList(1,2),"bar")
+);
+
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
diff --git a/yql/essentials/tests/sql/suites/expr/as_dict_tuple_key.sql b/yql/essentials/tests/sql/suites/expr/as_dict_tuple_key.sql
new file mode 100644
index 0000000000..78c8bb3924
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_dict_tuple_key.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+$d = AsDict(
+ AsTuple(AsTuple(),"foo"),
+ AsTuple(AsTuple(),"bar")
+);
+
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = AsDict(
+ AsTuple(AsTuple(1),"foo"),
+ AsTuple(AsTuple(2),"bar")
+);
+
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1)),DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(1)),DictContains($d,AsTuple(3));
+
+$d = AsDict(
+ AsTuple(AsTuple(1,2),"foo"),
+ AsTuple(AsTuple(1,3),"bar")
+);
+
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)),DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)),DictContains($d,AsTuple(1,4));
diff --git a/yql/essentials/tests/sql/suites/expr/as_set.sql b/yql/essentials/tests/sql/suites/expr/as_set.sql
new file mode 100644
index 0000000000..fedd028b97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_set.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select DictLength(AsSetStrict(1,2,3)),DictLength(AsSet(1,2,3u)),DictLength(SetCreate(Int32)) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/as_struct_0.sqlx b/yql/essentials/tests/sql/suites/expr/as_struct_0.sqlx
new file mode 100644
index 0000000000..fd59e199a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_struct_0.sqlx
@@ -0,0 +1 @@
+select AsStruct(5, 1 as key, 2l as subkey, 'cool' as value)
diff --git a/yql/essentials/tests/sql/suites/expr/as_struct_1.sqlx b/yql/essentials/tests/sql/suites/expr/as_struct_1.sqlx
new file mode 100644
index 0000000000..449debf70f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_struct_1.sqlx
@@ -0,0 +1 @@
+select AsStruct(1 as key, 2l as subkey, 'cool' as value, 321)
diff --git a/yql/essentials/tests/sql/suites/expr/as_struct_2.sqlx b/yql/essentials/tests/sql/suites/expr/as_struct_2.sqlx
new file mode 100644
index 0000000000..67dd7fac8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_struct_2.sqlx
@@ -0,0 +1 @@
+select AsStruct(1, 2, 3)
diff --git a/yql/essentials/tests/sql/suites/expr/as_struct_3.sqlx b/yql/essentials/tests/sql/suites/expr/as_struct_3.sqlx
new file mode 100644
index 0000000000..d2f2e9038d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_struct_3.sqlx
@@ -0,0 +1 @@
+select AsStruct('funny', 1, 100500l, 'bunny')
diff --git a/yql/essentials/tests/sql/suites/expr/as_struct_syntax.sql b/yql/essentials/tests/sql/suites/expr/as_struct_syntax.sql
new file mode 100644
index 0000000000..d9f0aeef02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_struct_syntax.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select AsStruct(1 as key, 2l as subkey, 'cool' as value)
diff --git a/yql/essentials/tests/sql/suites/expr/as_table.sql b/yql/essentials/tests/sql/suites/expr/as_table.sql
new file mode 100644
index 0000000000..8a293d03a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+
+$data = AsList(
+ AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
+ AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2),
+ AsStruct(3u AS Key, "v3" AS Value1, 300 AS Value2));
+
+SELECT Key, Value2 FROM AS_TABLE($data);
+
+$input = (
+ SELECT * FROM AS_TABLE($data) WHERE Key > 1
+);
+
+SELECT Key, Value1 FROM $input;
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_args.sqlx b/yql/essentials/tests/sql/suites/expr/as_table_args.sqlx
new file mode 100644
index 0000000000..83a28b7fbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_args.sqlx
@@ -0,0 +1,5 @@
+$data = AsList(
+ AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
+ AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2));
+
+SELECT * FROM AS_TABLE($data, "BadArg");
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.cfg b/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.sql b/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.sql
new file mode 100644
index 0000000000..a21a19e481
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_bad_columns_fail.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+
+$data = AsList(
+ AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
+ AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2),
+ AsStruct(3u AS Key, "v3" AS Value1, 300 AS Value2));
+
+SELECT Key, Value3 FROM AS_TABLE($data);
+
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.cfg b/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.sql b/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.sql
new file mode 100644
index 0000000000..beb55021a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_bad_row_type_fail.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+
+$data = AsList(1u, 2u, 3u);
+
+SELECT Key, Value3 FROM AS_TABLE($data);
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_cluster.sqlx b/yql/essentials/tests/sql/suites/expr/as_table_cluster.sqlx
new file mode 100644
index 0000000000..d8e29e1dba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_cluster.sqlx
@@ -0,0 +1,5 @@
+$data = AsList(
+ AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
+ AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2));
+
+SELECT * FROM plato.AS_TABLE($data);
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_emptylist.cfg b/yql/essentials/tests/sql/suites/expr/as_table_emptylist.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_emptylist.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_emptylist.sql b/yql/essentials/tests/sql/suites/expr/as_table_emptylist.sql
new file mode 100644
index 0000000000..6896846199
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_emptylist.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+select * from as_table([]);
+select x+1 from as_table([]);
+select * from as_table([]) order by x limit 5 offset 2;
+select x from as_table([]) order by x;
+select count(*) from as_table([]);
+select x, count(*) from as_table([]) group by x;
+select x, count(*) from as_table([]) group by x having count(x) > 1;
+select lead(x) over w, lag(x) over w, row_number() over w,
+ count(*) over w from as_table([]) window w as ();
+
+select lead(x) over w, lag(x) over w, rank() over w, denserank() over w,
+ count(*) over w from as_table([]) window w as (order by x);
+
+insert into plato.Output
+select * from as_table([]);
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_emptylist2.sql b/yql/essentials/tests/sql/suites/expr/as_table_emptylist2.sql
new file mode 100644
index 0000000000..588e1e3a02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_emptylist2.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+select * from as_table([]) flatten columns;
+select * from as_table([]) group by key, subkey;
+select * from as_table([]) flatten optional by (1+x as y);
+select distinct * from as_table([]);
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_hints.sqlx b/yql/essentials/tests/sql/suites/expr/as_table_hints.sqlx
new file mode 100644
index 0000000000..dcb548d062
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_hints.sqlx
@@ -0,0 +1,5 @@
+$data = AsList(
+ AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
+ AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2));
+
+SELECT * FROM AS_TABLE($data) WITH "hint";
diff --git a/yql/essentials/tests/sql/suites/expr/as_table_subquery.sqlx b/yql/essentials/tests/sql/suites/expr/as_table_subquery.sqlx
new file mode 100644
index 0000000000..778ea45e99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_table_subquery.sqlx
@@ -0,0 +1,3 @@
+$data = (select * from plato.Input);
+
+SELECT * FROM AS_TABLE($data);
diff --git a/yql/essentials/tests/sql/suites/expr/as_tuple_named.sqlx b/yql/essentials/tests/sql/suites/expr/as_tuple_named.sqlx
new file mode 100644
index 0000000000..3557fa700d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_tuple_named.sqlx
@@ -0,0 +1 @@
+select AsTuple(1 as key, 2l as subkey, 'cool' as value)
diff --git a/yql/essentials/tests/sql/suites/expr/as_tuple_syntax.sql b/yql/essentials/tests/sql/suites/expr/as_tuple_syntax.sql
new file mode 100644
index 0000000000..2d2728f229
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_tuple_syntax.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select AsTuple('funny', 1, 100500l, 'bunny')
diff --git a/yql/essentials/tests/sql/suites/expr/as_variant_enum.sql b/yql/essentials/tests/sql/suites/expr/as_variant_enum.sql
new file mode 100644
index 0000000000..dd14c8c1f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_variant_enum.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select AsVariant(1,"int"),AsEnum("monday"); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/as_variant_enum_compare.sql b/yql/essentials/tests/sql/suites/expr/as_variant_enum_compare.sql
new file mode 100644
index 0000000000..34fbbeb93b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/as_variant_enum_compare.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+Select Enum("foo",Enum<"foo","bar">) == AsEnum("foo"),
+ Enum("foo",Enum<"foo","bar">) == AsEnum("bar"),
+ Enum("foo",Enum<"foo","bar">) == AsEnum("baz");
diff --git a/yql/essentials/tests/sql/suites/expr/backtick_escape.sql b/yql/essentials/tests/sql/suites/expr/backtick_escape.sql
new file mode 100644
index 0000000000..1996b6d37a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/backtick_escape.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select 1 as `a``b`, 2 as ````, 3 as `\x60a\x60`, 4 as ```b```, 5 as `\`c\``;
diff --git a/yql/essentials/tests/sql/suites/expr/between.sql b/yql/essentials/tests/sql/suites/expr/between.sql
new file mode 100644
index 0000000000..df6af1dc4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/between.sql
@@ -0,0 +1,39 @@
+select
+ 1 between 2 and 4,
+ 3 between 2 and 4,
+ 5 between 2 and 4,
+ 3 between 4 and 2,
+ 5 between 4 and 2,
+ null between 2 and 4,
+ 1 between null and 4,
+ 1 between 4 and null,
+ 1 between 0 and null,
+ 1 between null and null,
+ null between null and null;
+
+select
+ 1 between asymmetric 2 and 4,
+ 3 between asymmetric 2 and 4,
+ 5 between asymmetric 2 and 4,
+ 3 between asymmetric 4 and 2,
+ 5 between asymmetric 4 and 2,
+ null between asymmetric 2 and 4,
+ 1 between asymmetric null and 4,
+ 1 between asymmetric 4 and null,
+ 1 between asymmetric 0 and null,
+ 1 between asymmetric null and null,
+ null between asymmetric null and null;
+
+select
+ 1 between symmetric 2 and 4,
+ 3 between symmetric 2 and 4,
+ 5 between symmetric 2 and 4,
+ 1 between symmetric 4 and 2,
+ 3 between symmetric 4 and 2,
+ 5 between symmetric 4 and 2,
+ null between symmetric 2 and 4,
+ 1 between symmetric null and 4,
+ 1 between symmetric 4 and null,
+ 1 between symmetric 0 and null,
+ 1 between symmetric null and null,
+ null between symmetric null and null;
diff --git a/yql/essentials/tests/sql/suites/expr/callable.sql b/yql/essentials/tests/sql/suites/expr/callable.sql
new file mode 100644
index 0000000000..b5af9143d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/callable.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+$lambda = ($x) -> {
+ return cast($x as String)
+};
+
+$callables = AsTuple(
+ Callable(Callable<(Int32)->String>, $lambda),
+ Callable(Callable<(Bool)->String>, $lambda),
+);
+
+select $callables.0(10), $callables.1(true);
diff --git a/yql/essentials/tests/sql/suites/expr/cast_dynumber.sql b/yql/essentials/tests/sql/suites/expr/cast_dynumber.sql
new file mode 100644
index 0000000000..840f928de2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_dynumber.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT CAST(DyNumber("-21.33") AS String), CAST(DyNumber("0") AS Utf8),
+ CAST(["-21.33E2","3.14","42","","bad"] AS List<DyNumber>);
+
+SELECT ListMap(["\x00\x80\x65","\x00\x81\x66","\x00\x82\x56","\x01","\x02\x84\x9A","\x02\x85\x99","\x02\x86\xA9"], ($i)->(FromBytes($i, DyNumber)));
diff --git a/yql/essentials/tests/sql/suites/expr/cast_from_utf8.sql b/yql/essentials/tests/sql/suites/expr/cast_from_utf8.sql
new file mode 100644
index 0000000000..acc97a5bad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_from_utf8.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select cast(Utf8("true") as bool),
+cast(Utf8("-1") as Int32),
+cast(Utf8("-3.5") as Double),
+cast(Utf8("P1D") as Interval),
+cast(Utf8("2000-01-01") as Date),
+cast(Utf8("2000-01-01,GMT") as TzDate);
diff --git a/yql/essentials/tests/sql/suites/expr/cast_longint.sql b/yql/essentials/tests/sql/suites/expr/cast_longint.sql
new file mode 100644
index 0000000000..227f56992c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_longint.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+$value = CAST(-7 AS Decimal(10, 0));
+SELECT
+ $value AS binary,
+ CAST($value AS String) AS to_string,
+ CAST("+123" AS Decimal(10,0)) AS from_string,
+ CAST("bad" AS Decimal(10,0)) AS bad_cast;
diff --git a/yql/essentials/tests/sql/suites/expr/cast_reverse_list.sql b/yql/essentials/tests/sql/suites/expr/cast_reverse_list.sql
new file mode 100644
index 0000000000..dc88313866
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_reverse_list.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+select CAST(ListReverse(ListExtend(["1","2","3"], ["4","5","6"])) AS List<Int64>);
+
diff --git a/yql/essentials/tests/sql/suites/expr/cast_string_implicit.sql b/yql/essentials/tests/sql/suites/expr/cast_string_implicit.sql
new file mode 100644
index 0000000000..b2872be2a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_string_implicit.sql
@@ -0,0 +1,16 @@
+select AsList('aaa', 'aaa'u); -- List<String>
+select AsList('aaa', '[1, 2, 3]'j); -- List<String>
+select AsList('aaa', '[1; 2; 3]'y); -- List<String>
+
+select AsList('aaa'u, 'aaa'); -- List<String>
+select AsList('aaa'u, '[1, 2, 3]'j); -- List<Utf8>
+select AsList('aaa'u, '[1; 2; 3]'y); -- List<String>
+
+select AsList('[1, 2, 3]'j, 'aaa'); -- List<String>
+select AsList('[1, 2, 3]'j, 'aaa'u); -- List<Utf8>
+select AsList('[1, 2, 3]'j, '[1; 2; 3]'y); -- List<String>
+
+select AsList('[1; 2; 3]'y, 'aaa'); -- List<String>
+select AsList('[1; 2; 3]'y, 'aaa'u); -- List<String>
+select AsList('[1; 2; 3]'y, '[1, 2, 3]'j); -- List<String>
+
diff --git a/yql/essentials/tests/sql/suites/expr/cast_struct.sql b/yql/essentials/tests/sql/suites/expr/cast_struct.sql
new file mode 100644
index 0000000000..1fd1cd914b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_struct.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+$struct = <|du:3.14, fl:-1.f, i:0, s:"str"u, u:123u|>;
+select
+ CAST($struct AS Struct<>) as empty,
+ CAST($struct AS Struct<du:Uint32?, fl:Uint32?, s:Uint16?, u:Int32?>) as partial,
+ CAST($struct AS Struct<x:Uint8?, y:Uint16?, z:Int8?>) as others,
+ CAST($struct AS Struct<du:Uint32, fl:Uint32, s:Uint16, u:Int32>) as fail;
diff --git a/yql/essentials/tests/sql/suites/expr/cast_type_bind.sql b/yql/essentials/tests/sql/suites/expr/cast_type_bind.sql
new file mode 100644
index 0000000000..c5cdce4889
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_type_bind.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+$t = List<Uint32>;
+select cast([1] as $t); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/cast_utf8.sql b/yql/essentials/tests/sql/suites/expr/cast_utf8.sql
new file mode 100644
index 0000000000..f7ebf5ffb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_utf8.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT CAST("Espa\u00f1ol" AS Utf8);
diff --git a/yql/essentials/tests/sql/suites/expr/cast_variant.sql b/yql/essentials/tests/sql/suites/expr/cast_variant.sql
new file mode 100644
index 0000000000..f453baed16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/cast_variant.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+$a = AsEnum("a");
+$b = AsEnum("b");
+$c = AsEnum("c");
+$d = AsEnum("d");
+
+$t = TypeOf([Just($a), Just($b), just($c)]);
+select CAST([just($a), just($b), just($d)] AS $t);
+
+$t0 = TypeOf([Just($a), Just($b)]);
+select CAST([$c, $d] AS $t0);
diff --git a/yql/essentials/tests/sql/suites/expr/checked_ops.sql b/yql/essentials/tests/sql/suites/expr/checked_ops.sql
new file mode 100644
index 0000000000..0b9d9e4243
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/checked_ops.sql
@@ -0,0 +1,21 @@
+pragma CheckedOps="true";
+select
+5+3,
+200ut+200ut,
+18446744073709551615ul+18446744073709551615ul;
+select
+5-3,
+-120t-100t,
+-9223372036854775807L-2l;
+select
+5*3,
+200ut*200ut,
+18446744073709551615ul*18446744073709551615ul;
+select
+5/3,
+200ut/1t;
+select
+5%3,
+100t%200ut;
+select
+-cast("-128" as int8);
diff --git a/yql/essentials/tests/sql/suites/expr/checked_ops_agg.sql b/yql/essentials/tests/sql/suites/expr/checked_ops_agg.sql
new file mode 100644
index 0000000000..b85db3cc07
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/checked_ops_agg.sql
@@ -0,0 +1,3 @@
+pragma CheckedOps="true";
+select sum(null),sum(x),sumif(x,true),sum(just(x)),sumif(just(x),true)
+from (values (18446744073709551615ul),(2ul)) as a(x);
diff --git a/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.cfg b/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.cfg
new file mode 100644
index 0000000000..d016b0b562
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.cfg
@@ -0,0 +1,3 @@
+udf yson2_udf
+udf json2_udf
+udf datetime2_udf
diff --git a/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.sql b/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.sql
new file mode 100644
index 0000000000..554c348b62
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/common_type_for_resource_and_data.sql
@@ -0,0 +1,6 @@
+select AsList(DateTime::StartOfMonth(CurrentUtcDate()), CurrentUtcDate());
+
+select AsList(Yson::Parse("1"), "2"y);
+select AsList(Yson::ParseJson("1"), "2"j);
+select AsList(Json2::Parse("1"), "2"j);
+
diff --git a/yql/essentials/tests/sql/suites/expr/constraints_of.cfg b/yql/essentials/tests/sql/suites/expr/constraints_of.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/constraints_of.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/constraints_of.sql b/yql/essentials/tests/sql/suites/expr/constraints_of.sql
new file mode 100644
index 0000000000..2306ba3532
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/constraints_of.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma warning("disable", "4510");
+use plato;
+
+$foo = select subkey, key, value as v from Input order by subkey asc, key desc limit 0;
+$x = process $foo;
+
+select YQL::ConstraintsOf($x) as constraints;
+
diff --git a/yql/essentials/tests/sql/suites/expr/container_comp.sql b/yql/essentials/tests/sql/suites/expr/container_comp.sql
new file mode 100644
index 0000000000..cd9246f4aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/container_comp.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+select AsStruct() == AsStruct();
+select AsTuple() == AsTuple();
+select AsTuple(0xffffffffu) == AsTuple(-1);
+select AsTuple(1,2/0) < AsTuple(10,1);
+select AsStruct(1 as a,2 as b) == AsStruct(1u as a,2u as b);
+select AsStruct(1 as a,2 as b) == AsStruct(1u as a,2u as c);
+select AsTuple(Void())<=AsTuple(Void());
+select AsTuple(null)<=AsTuple(null);
+select AsTagged(1, "foo") = AsTagged(1u, "foo");
diff --git a/yql/essentials/tests/sql/suites/expr/convert_to_lambda_optional_args.sql b/yql/essentials/tests/sql/suites/expr/convert_to_lambda_optional_args.sql
new file mode 100644
index 0000000000..729486ea2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/convert_to_lambda_optional_args.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+$f = ($x,$y?)->($x + ($y ?? 0));
+select ListMap([1,2,3],$f);
+
+$g = ($x,$y,$z?)->(($x + $y + $z) ?? 100);
+select Yql::Fold([1,2,3],0,$g);
diff --git a/yql/essentials/tests/sql/suites/expr/current_tz.sql b/yql/essentials/tests/sql/suites/expr/current_tz.sql
new file mode 100644
index 0000000000..62381a378f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/current_tz.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ CurrentTzDate("Europe/Moscow"),
+ CurrentTzDatetime("Europe/Moscow"),
+ CurrentTzTimestamp("Europe/Moscow"),
+ CurrentUtcDate(),
+ CurrentUtcDatetime(),
+ CurrentUtcTimestamp();
+
diff --git a/yql/essentials/tests/sql/suites/expr/decimal_bytes.sql b/yql/essentials/tests/sql/suites/expr/decimal_bytes.sql
new file mode 100644
index 0000000000..aa21b040f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/decimal_bytes.sql
@@ -0,0 +1,14 @@
+select ToBytes(Decimal("14.2",5,1)),
+ ToBytes(Decimal("inf",5,1)),
+ ToBytes(Decimal("-inf",5,1)),
+ ToBytes(Decimal("nan",5,1)),
+ ToBytes(Nothing(Optional<Decimal(5,1)>));
+
+select FromBytes(ToBytes(Decimal("14.2",5,1)),Decimal(5,1)),
+ FromBytes(ToBytes(Decimal("10",5,1)),Decimal(2,1)),
+ FromBytes(ToBytes(Decimal("-10",5,1)),Decimal(2,0)),
+ FromBytes(ToBytes(Decimal("inf",5,1)),Decimal(5,1)),
+ FromBytes(ToBytes(Decimal("-inf",5,1)),Decimal(5,1)),
+ FromBytes(ToBytes(Decimal("nan",5,1)),Decimal(5,1)),
+ FromBytes(Nothing(String?),Decimal(5,1));
+
diff --git a/yql/essentials/tests/sql/suites/expr/default.cfg b/yql/essentials/tests/sql/suites/expr/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/default.cfg
diff --git a/yql/essentials/tests/sql/suites/expr/dict_builtins.sql b/yql/essentials/tests/sql/suites/expr/dict_builtins.sql
new file mode 100644
index 0000000000..8b83553452
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/dict_builtins.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+$dict = AsDict(AsTuple("foo", 3), AsTuple("bar", 4));
+
+SELECT
+ DictKeys($dict),
+ DictPayloads($dict),
+ DictItems($dict),
+ DictLookup($dict, "foo"),
+ DictLookup($dict, "baz"),
+ DictContains($dict, "foo"),
+ DictContains($dict, "baz"),
+ DictCreate(String, Tuple<String,Double?>),
+ DictCreate(Tuple<Int32?,String>, OptionalType(DataType("String")));
+
diff --git a/yql/essentials/tests/sql/suites/expr/dict_builtins_null_lookup.sql b/yql/essentials/tests/sql/suites/expr/dict_builtins_null_lookup.sql
new file mode 100644
index 0000000000..87e1bd0ff9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/dict_builtins_null_lookup.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+
+$d2 = AsDict(AsTuple(1/1, "bar"));
+$d3 = AsDict(AsTuple(1/0, "baz"));
+
+$t1 = AsDict(AsTuple(AsTuple(1, "key"), AsTuple(1, "value")));
+$t2 = AsDict(AsTuple(AsTuple(1/1, "key"), AsTuple(2/1, "value")));
+$t3 = AsDict(AsTuple(AsTuple(1/0, "key"), AsTuple(123, "value")));
+
+SELECT
+ DictContains($d2, null), -- false, no such key
+ DictContains($d3, null), -- true, null is convertible to Nothing<T> for any T
+
+ DictLookup($d2, null), -- Nothing(String?), no such key
+ DictLookup($d3, null); -- Just("baz"), null is convertible to Nothing<T> for any T
+
+
+SELECT
+ DictContains($t1, AsTuple(1, "keyy")), -- false, missing key
+ DictContains($t1, AsTuple(1, "key")), -- true, match
+ DictContains($t1, Just(AsTuple(1, "key"))), -- true, match with optional
+
+ DictContains($t2, AsTuple(null, "key")), -- false, no such key
+ DictContains($t3, AsTuple(null, "key")), -- true, null is convertible to Nothing<T> for any T
+
+ DictLookup($t2, AsTuple(null, "key")), -- Nothing(Tuple<Int32?, String>?), no such key
+ DictLookup($t3, AsTuple(null, "key")); -- Just(AsTuple(123, "value")), null is convertible to Nothing<T> for any T
diff --git a/yql/essentials/tests/sql/suites/expr/dict_common_type.cfg b/yql/essentials/tests/sql/suites/expr/dict_common_type.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/dict_common_type.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/expr/dict_common_type.sql b/yql/essentials/tests/sql/suites/expr/dict_common_type.sql
new file mode 100644
index 0000000000..7eca9cb631
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/dict_common_type.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* yt can not */
+pragma warning("disable", "4510");
+
+$d1 = ToDict([(1, 1u)]);
+$d2 = AsDict((2, 2u));
+$d3 = YQL::Dict(Dict<Int32, Uint32>);
+$d4 = YQL::Dict(Dict<Int32, Uint32>, (3, 3u));
+
+$s1 = ToSet([1u]);
+$s2 = AsSet(2u);
+
+select AsList({100u:100}, $d1, $d2, $d3, $d4);
+select AsList({100}, $s1, $s2);
diff --git a/yql/essentials/tests/sql/suites/expr/dict_comp.sql b/yql/essentials/tests/sql/suites/expr/dict_comp.sql
new file mode 100644
index 0000000000..2f82dfdaad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/dict_comp.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+select AsTuple(
+ AsDict(AsTuple(1,2u)) == AsDict(AsTuple(1,2)),
+ AsDict(AsTuple(1,2u)) == AsDict(AsTuple(1,3)),
+ AsDict(AsTuple(1,2u)) == AsDict(AsTuple(1,2), AsTuple(3,4)),
+ AsDict(AsTuple(1,2u)) == AsDict(AsTuple(2,2)),
+ AsDict(AsTuple(1u,2l)) == AsDict(AsTuple(1u,just(2u))),
+ AsDict(AsTuple(1,2u)) == AsDict(AsTuple(1,2/0)),
+);
+
+select AsTuple(
+ AsDict(AsTuple(1,2u)) != AsDict(AsTuple(1,2)),
+ AsDict(AsTuple(1,2u)) != AsDict(AsTuple(1,3)),
+ AsDict(AsTuple(1,2u)) != AsDict(AsTuple(1,2), AsTuple(3,4)),
+ AsDict(AsTuple(1,2u)) != AsDict(AsTuple(2,2)),
+ AsDict(AsTuple(1u,2l)) != AsDict(AsTuple(1u,just(2u))),
+ AsDict(AsTuple(1,2u)) != AsDict(AsTuple(1,2/0)),
+); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/distinct_from.sql b/yql/essentials/tests/sql/suites/expr/distinct_from.sql
new file mode 100644
index 0000000000..bcb2a12714
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/distinct_from.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+
+select
+ 1 is distinct from 2,
+ 1 is not distinct from 2,
+ null is distinct from null,
+ Just(1 + 2) is distinct from Nothing(Int32?),
+ Nothing(Int32??) is not distinct from Just(Nothing(Int32?))
+;
+
diff --git a/yql/essentials/tests/sql/suites/expr/distinct_from_containers.sql b/yql/essentials/tests/sql/suites/expr/distinct_from_containers.sql
new file mode 100644
index 0000000000..622fdddc30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/distinct_from_containers.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$vt1 = ParseType("Variant<Int32,Int32?>");
+$vt2 = ParseType("Variant<Int64,Null>");
+
+$svt1 = ParseType("Variant<a:Int32,b:Int32?>");
+$svt2 = ParseType("Variant<a:Int64,b:Null>");
+
+select
+ (1, 2) is not distinct from (1, 2, 1/0), --true
+ <|a:1/0, b:Nothing(String?), c:1|> is not distinct from
+ <|c:1u, d:1u/0u, e:Nothing(Utf8?)|>, --true
+ [1, 2, null] is not distinct from [1, 2, just(1/0)], --false
+ {1:null} is distinct from {1u:2/0}, --false
+ Variant(1/0, "1", $vt1) is distinct from Variant(null, "1", $vt2), --false
+ Variant(1/0, "b", $svt1) is not distinct from Variant(null, "b", $svt2), --true
+;
diff --git a/yql/essentials/tests/sql/suites/expr/distinct_from_opt.sql b/yql/essentials/tests/sql/suites/expr/distinct_from_opt.sql
new file mode 100644
index 0000000000..33bfbbf368
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/distinct_from_opt.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+
+select
+ Null is not distinct from 1/0, --true
+ 1/0 is distinct from Null, --false
+ 1u/0u is distinct from 1/0, --false
+ Just(1u) is not distinct from 1/0, --false
+ 1u/0u is distinct from Just(1), --true
+ 1u is distinct from 1, --false
+ Nothing(Int32??) is distinct from Just(1/0), --true
+ 1 is not distinct from Just(Just(1u)), --true
+;
diff --git a/yql/essentials/tests/sql/suites/expr/double.txt b/yql/essentials/tests/sql/suites/expr/double.txt
new file mode 100644
index 0000000000..b5d25384ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/double.txt
@@ -0,0 +1,12 @@
+{"key"=23.0;"subkey"="3";"value"="aaa"};
+{"key"=37.0;"subkey"="5";"value"="ddd"};
+{"key"=75.1;"subkey"="1";"value"="abc"};
+{"key"=150.0;"subkey"="1";"value"="aaa"};
+{"key"=150.0;"subkey"="3";"value"="iii"};
+{"key"=150.0;"subkey"="8";"value"="zzz"};
+{"key"=150.0;"subkey"="7";"value"="qqq"};
+{"key"=527.2;"subkey"="4";"value"="bbb"};
+{"key"=%inf;"subkey"="6";"value"="ccc"};
+{"key"=%+inf;"subkey"="11";"value"="qqq"};
+{"key"=%nan;"subkey"="2";"value"="kkk"};
+{"key"=%-inf;"subkey"="9";"value"="uuu"};
diff --git a/yql/essentials/tests/sql/suites/expr/double.txt.attr b/yql/essentials/tests/sql/suites/expr/double.txt.attr
new file mode 100644
index 0000000000..f0f906d3f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/double.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Double"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]]
+}}
diff --git a/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.cfg b/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.sql b/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.sql
new file mode 100644
index 0000000000..9a430a536d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/double_join_with_list_from_range.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+$list = select lst, row_number() over (order by lst) as rn from (
+ select * from (
+ select ListFromRange(1us, 333us) as lst
+ ) FLATTEN LIST by lst
+);
+
+$usr = select value, CAST(key AS Uint16) + 3us AS age, CAST(key AS Uint16) + 7us as age1
+from plato.Input;
+
+select
+ u.*,
+ l1.rn as rn1,
+ l2.rn as rn2
+from $usr as u
+join $list as l1 on u.age == l1.lst
+join $list as l2 on u.age1 == l2.lst
+order by value;
diff --git a/yql/essentials/tests/sql/suites/expr/empty_dict_ops.sql b/yql/essentials/tests/sql/suites/expr/empty_dict_ops.sql
new file mode 100644
index 0000000000..c6787ec825
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_dict_ops.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ DictLength({}),
+ DictHasItems({}),
+ DictContains({},1),
+ DictLookup({},2),
+ DictKeys({}),
+ DictPayloads({}),
+ DictItems({}),
+ 3 in {},
+ DictLength(Just({})),
+ DictHasItems(Just({})),
+ DictContains(Just({}),1),
+ DictLookup(Just({}),2),
+ DictKeys(Just({})),
+ DictPayloads(Just({})),
+ DictItems(Just({})),
+ 3 in Just({});
diff --git a/yql/essentials/tests/sql/suites/expr/empty_iterator.cfg b/yql/essentials/tests/sql/suites/expr/empty_iterator.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_iterator.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/empty_iterator.sql b/yql/essentials/tests/sql/suites/expr/empty_iterator.sql
new file mode 100644
index 0000000000..0399f810a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_iterator.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$train =
+SELECT * FROM Input WHERE key > "900" GROUP BY value;
+
+$method = ($stream) -> {
+ $func = Callable(
+ CallableType(0, TypeOf($stream), TypeOf($stream)),
+ ($_1) -> { return $_1; }
+ );
+ RETURN $func($stream);
+};
+
+$prediction =
+ PROCESS $train
+ USING $method(TableRows());
+
+SELECT * FROM $prediction;
diff --git a/yql/essentials/tests/sql/suites/expr/empty_iterator2.cfg b/yql/essentials/tests/sql/suites/expr/empty_iterator2.cfg
new file mode 100644
index 0000000000..e68191f82c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_iterator2.cfg
@@ -0,0 +1 @@
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/empty_iterator2.sql b/yql/essentials/tests/sql/suites/expr/empty_iterator2.sql
new file mode 100644
index 0000000000..39164341d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_iterator2.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$train =
+SELECT key, value FROM Input GROUP BY key, value having key > "900";
+
+$method = ($stream) -> {
+ $func = Callable(
+ CallableType(0, TypeOf($stream), TypeOf($stream)),
+ ($_1) -> { return $_1; }
+ );
+ RETURN $func($stream);
+};
+
+$prediction =
+ PROCESS $train
+ USING $method(TableRows());
+
+SELECT * FROM $prediction;
diff --git a/yql/essentials/tests/sql/suites/expr/empty_list_ops1.sql b/yql/essentials/tests/sql/suites/expr/empty_list_ops1.sql
new file mode 100644
index 0000000000..cdf4eb2202
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_list_ops1.sql
@@ -0,0 +1,60 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ ListLength([]),
+ Yql::Append([],1),
+ Yql::Prepend(2,[]),
+ Yql::Extend(),
+ Yql::Extend([],[]),
+ Yql::Extend([],[1]),
+ Yql::Extend([1],[]),
+ Yql::UnionAll(),
+ Yql::UnionAll([],[]),
+ Yql::UnionAll([],[<|a:1|>]),
+ Yql::UnionAll([<|a:1|>],[]),
+ ListExtend(),
+ ListExtend([],[]),
+ ListExtend([],[1]),
+ ListExtend([1],[]),
+ ListUnionAll(),
+ ListUnionAll([],[]),
+ ListUnionAll([],[<|a:1|>]),
+ ListUnionAll([<|a:1|>],[]),
+ Yql::Zip([]),
+ Yql::Zip([],[]),
+ Yql::Zip([],[1]),
+ Yql::Zip([1],[]),
+ Yql::ZipAll([]),
+ Yql::ZipAll([],[]),
+ Yql::ZipAll([],[1]),
+ Yql::ZipAll([1],[]),
+ ListZip([]),
+ ListZip([],[]),
+ ListZip([],[1]),
+ ListZip([1],[]),
+ ListZipAll([]),
+ ListZipAll([],[]),
+ ListZipAll([],[1]),
+ ListZipAll([1],[]),
+
+ ListLength(Just([])),
+ ListExtend(),
+ ListExtend(Just([]),[]),
+ ListExtend(Just([]),Just([])),
+ ListExtend(Just([]),[1]),
+ ListExtend([1],Just([])),
+ ListUnionAll(),
+ ListUnionAll(Just([]),[]),
+ ListUnionAll(Just([]),Just([])),
+ ListUnionAll(Just([]),[<|a:1|>]),
+ ListUnionAll([<|a:1|>],Just([])),
+ ListZip(Just([])),
+ ListZip(Just([]),[]),
+ ListZip(Just([]),Just([])),
+ ListZip(Just([]),[1]),
+ ListZip([1],Just([])),
+ ListZipAll(Just([])),
+ ListZipAll(Just([]),[]),
+ ListZipAll(Just([]),Just([])),
+ ListZipAll(Just([]),[1]),
+ ListZipAll([1],Just([]));
diff --git a/yql/essentials/tests/sql/suites/expr/empty_list_ops2.sql b/yql/essentials/tests/sql/suites/expr/empty_list_ops2.sql
new file mode 100644
index 0000000000..a98298280b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_list_ops2.sql
@@ -0,0 +1,52 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ ListHasItems([]),
+ Yql::Filter([],($x)->{return $x}),
+ Yql::Map([],($x)->{return $x*2}),
+ Yql::FlatMap([],($x)->{return Just($x*2)}),
+ Yql::OrderedFilter([],($x)->{return $x}),
+ Yql::OrderedMap([],($x)->{return $x*2}),
+ Yql::OrderedFlatMap([],($x)->{return Just($x*2)}),
+ ListFilter([],($x)->{return $x}),
+ ListMap([],($x)->{return $x*2}),
+ ListFlatMap([],($x)->{return Just($x*2)}),
+ ListCollect([]),
+ ListSort([]),
+ ListReverse([]),
+ ListEnumerate([]),
+ ListSkip([], 1),
+ ListTake([], 1),
+ ListIndexOf([], 1),
+ ListUniq([]),
+ ListAny([]),
+ ListAll([]),
+ ListHas([],1),
+ ListHead([]),
+ ListLast([]),
+ ListMin([]),
+ ListMax([]),
+ ListSum([]),
+ ListAvg([]),
+
+ ListHasItems(Just([])),
+ ListFilter(Just([]),($x)->{return $x}),
+ ListMap(Just([]),($x)->{return $x*2}),
+ ListFlatMap(Just([]),($x)->{return Just($x*2)}),
+ ListCollect(Just([])),
+ ListSort(Just([])),
+ ListReverse(Just([])),
+ ListEnumerate(Just([])),
+ ListSkip(Just([]), 1),
+ ListTake(Just([]), 1),
+ ListUniq(Just([])),
+ ListAny(Just([])),
+ ListAll(Just([])),
+ ListHas(Just([]),1),
+ ListHead(Just([])),
+ ListLast(Just([])),
+ ListMin(Just([])),
+ ListMax(Just([])),
+ ListSum(Just([])),
+ ListAvg(Just([])),
+
diff --git a/yql/essentials/tests/sql/suites/expr/empty_list_ops3.sql b/yql/essentials/tests/sql/suites/expr/empty_list_ops3.sql
new file mode 100644
index 0000000000..f7db80ed73
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_list_ops3.sql
@@ -0,0 +1,34 @@
+/* syntax version 1 */
+/* postgres can not */
+$pred = ($x)->{ return $x > 0 };
+
+select
+ ListExtract([],"a"),
+ ListTakeWhile([], $pred),
+ ListSkipWhile([], $pred),
+ ListTakeWhileInclusive([], $pred),
+ ListSkipWhileInclusive([], $pred),
+ ListAggregate([], AGGREGATION_FACTORY("Sum")),
+ ToDict([]),
+ ToMultiDict([]),
+ ToSet([]),
+ SetIsDisjoint({1, 2, 3}, []),
+ SetIncludes({1, 2, 3}, []),
+ Yql::Fold([],0,($x,$y)->{return $x+$y}),
+ Yql::Fold1([],($x)->{return $x},($x,$y)->{return $x+$y}),
+ Yql::FoldMap([],0,($x,$y)->{return ($x+$y,$y)}),
+ Yql::Fold1Map([],($x)->{return ($x,$x)},($x,$y)->{return ($x+$y,$y)}),
+ Yql::LazyList([]),
+
+ ListExtract(Just([]),"a"),
+ ListTakeWhile(Just([]), $pred),
+ ListSkipWhile(Just([]), $pred),
+ ListTakeWhileInclusive(Just([]), $pred),
+ ListSkipWhileInclusive(Just([]), $pred),
+ ListAggregate(Just([]), AGGREGATION_FACTORY("Sum")),
+ ToDict(Just([])),
+ ToMultiDict(Just([])),
+ ToSet(Just([])),
+ SetIsDisjoint({1, 2, 3}, Just([])),
+ SetIncludes({1, 2, 3}, Just([])),
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/empty_struct_tuple_types.sql b/yql/essentials/tests/sql/suites/expr/empty_struct_tuple_types.sql
new file mode 100644
index 0000000000..14a1aea9d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/empty_struct_tuple_types.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ FormatType(Tuple<>),
+ FormatType(Tuple< >),
+ FormatType(Struct<>),
+ FormatType(Struct<
+ -- whitespace
+ >);
diff --git a/yql/essentials/tests/sql/suites/expr/ensure_ok.sql b/yql/essentials/tests/sql/suites/expr/ensure_ok.sql
new file mode 100644
index 0000000000..f4a40c0e40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/ensure_ok.sql
@@ -0,0 +1 @@
+select Ensure(42, true, "message");
diff --git a/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.cfg b/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.sql b/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.sql
new file mode 100644
index 0000000000..4ea3509678
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/ensure_runtime_fail.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select Ensure(42, 2 != 2, "message");
diff --git a/yql/essentials/tests/sql/suites/expr/ensure_type_fail.cfg b/yql/essentials/tests/sql/suites/expr/ensure_type_fail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/ensure_type_fail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/ensure_type_fail.sql b/yql/essentials/tests/sql/suites/expr/ensure_type_fail.sql
new file mode 100644
index 0000000000..08ae648b5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/ensure_type_fail.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+/* syntax version 1 */
+
+select EnsureType(42, String, "message");
diff --git a/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.cfg b/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.cfg
new file mode 100644
index 0000000000..88d007fa60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.cfg
@@ -0,0 +1,3 @@
+in Input double.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.sql b/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.sql
new file mode 100644
index 0000000000..ee49564f89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/evaluate_parse_inf_nan.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+use plato;
+
+$foo = process Input;
+select ListSort(EvaluateExpr($foo), ($item) -> (AsTuple($item.key, $item.subkey)));
+
diff --git a/yql/essentials/tests/sql/suites/expr/exapnd_with_singular_types.sql b/yql/essentials/tests/sql/suites/expr/exapnd_with_singular_types.sql
new file mode 100644
index 0000000000..20169c93b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/exapnd_with_singular_types.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+$null_t = TypeOf(null);
+$struct_t = Struct<a:String, b:Int32?, c:$null_t, d:pgtext>;
+$callable = Callable(Callable<($struct_t)->$struct_t>, ($x) -> { return $x; });
+
+select $callable(<|a:"1"|>), $callable(AddMember(<||>, "a", "2"));
diff --git a/yql/essentials/tests/sql/suites/expr/expr_add_literal_nulls.sql b/yql/essentials/tests/sql/suites/expr/expr_add_literal_nulls.sql
new file mode 100644
index 0000000000..521fcde8f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_add_literal_nulls.sql
@@ -0,0 +1 @@
+select NULL + 1, NULL + NULL; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/expr_cast.sql b/yql/essentials/tests/sql/suites/expr/expr_cast.sql
new file mode 100644
index 0000000000..b03d53d63d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_cast.sql
@@ -0,0 +1 @@
+select cast(3.14 as Uint32); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda.sql b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda.sql
new file mode 100644
index 0000000000..4c65330519
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda.sql
@@ -0,0 +1,2 @@
+$foo = YQL::@@(lambda '(item) (+ item item))@@;
+select $foo(1);
diff --git a/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_multiline_atoms.sql b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_multiline_atoms.sql
new file mode 100644
index 0000000000..8809853db4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_multiline_atoms.sql
@@ -0,0 +1,3 @@
+$foo = YQL::@@(lambda '(item) (Concat (String '@@@@foo@@@@@@@@
+@@@@) item))@@;
+select $foo("bar");
diff --git a/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_quotes.sql b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_quotes.sql
new file mode 100644
index 0000000000..e4169a16b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_named_yql_lambda_quotes.sql
@@ -0,0 +1,3 @@
+$foo1 = YQL::"(lambda '(item) (Concat (String '\"foo\\\"\") item))";
+$foo2 = YQL::'(lambda \'(item) (Concat (String \'"foo\\\'") item))';
+select $foo1("bar"), $foo2("bar");
diff --git a/yql/essentials/tests/sql/suites/expr/expr_null.sql b/yql/essentials/tests/sql/suites/expr/expr_null.sql
new file mode 100644
index 0000000000..8d6bd3be1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_null.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select NULL;
diff --git a/yql/essentials/tests/sql/suites/expr/expr_op_in_paren.sql b/yql/essentials/tests/sql/suites/expr/expr_op_in_paren.sql
new file mode 100644
index 0000000000..1d63ebbafa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_op_in_paren.sql
@@ -0,0 +1 @@
+select (1 + 2); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/expr_trivial_named.sql b/yql/essentials/tests/sql/suites/expr/expr_trivial_named.sql
new file mode 100644
index 0000000000..ff097ae0a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_trivial_named.sql
@@ -0,0 +1,2 @@
+$foo = 100500;
+select $foo;
diff --git a/yql/essentials/tests/sql/suites/expr/expr_yql_data.sql b/yql/essentials/tests/sql/suites/expr/expr_yql_data.sql
new file mode 100644
index 0000000000..94a7860a70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_yql_data.sql
@@ -0,0 +1 @@
+select YQL::@@(Uint32 '100500)@@, YQL::@@(String '[WAT])@@; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/expr_yql_from_string.sql b/yql/essentials/tests/sql/suites/expr/expr_yql_from_string.sql
new file mode 100644
index 0000000000..8d6ff8efba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_yql_from_string.sql
@@ -0,0 +1 @@
+select YQL::FromString("100500", YQL::@@'Uint64@@); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/expr_yql_function.sql b/yql/essentials/tests/sql/suites/expr/expr_yql_function.sql
new file mode 100644
index 0000000000..979c482de2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/expr_yql_function.sql
@@ -0,0 +1 @@
+select YQL::ToString(1 + 2); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.cfg b/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.sql b/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.sql
new file mode 100644
index 0000000000..9de0bf109a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/extra_opt_try_member.sql
@@ -0,0 +1,22 @@
+/* postgres can not */
+/* syntax version 1 */
+/* yt can not */
+
+$s = <|a:1, b:2u/1u, c:Just(Just(1))|>;
+$js = Just($s);
+$es = Nothing(Struct<a:Int32, b:Uint32?, c:Int32??>?);
+
+-- TypeOf TryMember is type of third argument
+-- field type should either match third type exactly, or (if the third type is optional)
+-- Optional(field) should be equal to third type
+select
+ TryMember($s, "b", Just(Just(99u))),
+ TryMember($s, "c", Just(Just(Just(2)))),
+
+ TryMember($js, "b", Just(Just(999u))),
+ TryMember($js, "c", Just(Just(Just(999)))),
+
+ TryMember($es, "b", Just(Just(999u))),
+ TryMember($es, "c", Just(Just(Just(999)))),
+;
+
diff --git a/yql/essentials/tests/sql/suites/expr/fallback_filternullelements.sql b/yql/essentials/tests/sql/suites/expr/fallback_filternullelements.sql
new file mode 100644
index 0000000000..27e7d67ce2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/fallback_filternullelements.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+$lists = AsList(AsList("one", "two", "three"), AsList("head", null), AsList(null, "tail"), ListCreate(String?));
+$map = ($l) -> { RETURN AsTuple(ListHead($l), ListLast($l)) };
+$structs = ListMap($lists, $map);
+SELECT YQL::FilterNullElements($structs), YQL::SkipNullElements($structs);
diff --git a/yql/essentials/tests/sql/suites/expr/fallback_filternullmembers.sql b/yql/essentials/tests/sql/suites/expr/fallback_filternullmembers.sql
new file mode 100644
index 0000000000..73a212aacd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/fallback_filternullmembers.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+$lists = AsList(AsList("one", "two", "three"), AsList("head", null), AsList(null, "tail"), ListCreate(String?));
+$map = ($l) -> { RETURN AsStruct(ListHead($l) AS head, ListLast($l) AS tail) };
+$structs = ListMap($lists, $map);
+SELECT YQL::FilterNullMembers($structs), YQL::SkipNullMembers($structs);
diff --git a/yql/essentials/tests/sql/suites/expr/flatmap_by_map_lazy_list.sql b/yql/essentials/tests/sql/suites/expr/flatmap_by_map_lazy_list.sql
new file mode 100644
index 0000000000..38473e2f56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/flatmap_by_map_lazy_list.sql
@@ -0,0 +1,6 @@
+$lazy = ListFromRange(1us, 3us);
+$list = AsList("one", "two");
+
+SELECT ListFlatMap($list, ($l)->{ RETURN ListMap($lazy, ($r)->{ RETURN AsTuple($l, $r) })});
+SELECT ListFlatMap($lazy, ($l)->{ RETURN ListMap($list, ($r)->{ RETURN AsTuple($l, $r) })});
+
diff --git a/yql/essentials/tests/sql/suites/expr/formattypediff.sql b/yql/essentials/tests/sql/suites/expr/formattypediff.sql
new file mode 100644
index 0000000000..4af4656733
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/formattypediff.sql
@@ -0,0 +1,7 @@
+SELECT
+ FormatTypeDiff(ParseType("Tuple<Tuple<Int32>, Tuple<String, Double>>"), ParseType("Tuple<String, Tuple<String, String>>")),
+ FormatTypeDiffPretty(ParseType("Tuple<Tuple<Int32>, Tuple<String, Double>>"), ParseType("Tuple<String, Tuple<String, String>>")),
+ FormatTypeDiffPretty(TypeHandle(ParseType("Tuple<Tuple<Int32>, Tuple<String, Double>>")), TypeHandle(ParseType("Tuple<String, Tuple<String, String>>"))),
+ FormatTypeDiff(ParseType("Tuple<Tuple<Int32>, Tuple<String, Double>>"), TypeHandle(ParseType("Tuple<String, Tuple<String, String>>"))),
+ FormatTypeDiffPretty(TypeHandle(ParseType("Tuple<Tuple<Int32>, Tuple<String, Double>>")), ParseType("Tuple<String, Tuple<String, String>>")),
+ FormatTypeDiff(TypeHandle(ParseType("Int32")), TypeHandle(ParseType("Int32"))) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.cfg b/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.sql b/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.sql
new file mode 100644
index 0000000000..b30ed85ce3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/implicit_bitcast_fail.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+pragma warning("error", "1107");
+select AsList(
+7498311229109140978,
+254610204336699107,
+11580367904009864964);
diff --git a/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_if.sql b/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_if.sql
new file mode 100644
index 0000000000..8bcfdcf84b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_if.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+select
+ IF(3 < 2, 13, 42U) as i32_then,
+ IF(3 < 2, 13U, 42) as i32_else,
+ IF(3 < 2, 13L, 42U) as i64_then,
+ IF(3 < 2, 13U, 42L) as i64_else;
diff --git a/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_listfromrange.sql b/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_listfromrange.sql
new file mode 100644
index 0000000000..b7e8b25293
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/implicit_cast_literals_under_listfromrange.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+SELECT
+ ListFromRange(13, 42U),
+ ListFromRange(13U, 42),
+ ListFromRange(13, null, 42U),
+ ListFromRange(13U, null, 42);
diff --git a/yql/essentials/tests/sql/suites/expr/inline_call.cfg b/yql/essentials/tests/sql/suites/expr/inline_call.cfg
new file mode 100644
index 0000000000..2c6a0d040b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/inline_call.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf math_udf
+
diff --git a/yql/essentials/tests/sql/suites/expr/inline_call.sql b/yql/essentials/tests/sql/suites/expr/inline_call.sql
new file mode 100644
index 0000000000..f93b2b64fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/inline_call.sql
@@ -0,0 +1,28 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$x = AsStruct(1 as a);
+select $x.a;
+
+$y = AsTuple(2,3);
+select $y.1;
+
+select length("foo");
+
+select Math::Pi();
+
+$f = () -> {
+ return () -> {
+ return AsDict(AsTuple("foo",AsList(AsStruct(AsTuple(1) as bar))));
+ }
+};
+
+select $f()()["foo"][0].bar.0;
+
+select ()->{return 1}();
+
+$type = Callable<()->List<Int32>>;
+$g = AsStruct(Yql::Callable($type, ()->{return AsList(1,2,3)}) as foo);
+
+select $g.foo()[0];
diff --git a/yql/essentials/tests/sql/suites/expr/input.txt b/yql/essentials/tests/sql/suites/expr/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/expr/int_literals.sql b/yql/essentials/tests/sql/suites/expr/int_literals.sql
new file mode 100644
index 0000000000..9d860f731f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/int_literals.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+select
+ 23 as small_int,
+ 9262583611491805930 as unsigned_long,
+ 0x7fffffff as i32max,
+ 0x80000000 as i32max_plus1,
+ 0x7fffffffffffffff as i64max,
+ 0x8000000000000000 as i64max_plus1
diff --git a/yql/essentials/tests/sql/suites/expr/int_literals_negative.sql b/yql/essentials/tests/sql/suites/expr/int_literals_negative.sql
new file mode 100644
index 0000000000..2e8914827e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/int_literals_negative.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+select -9223372036854775808 as i64_min;
+select 9223372036854775807 as i64_max;
+select 9223372036854775808 as u64;
+
+select -2147483648 as i32_min;
+select 2147483647 as i32_max;
+
+select 2147483648 as i64;
+select 4294967295 as i64;
+
+select -32768 as i32;
+
+select 18446744073709551615 as u64_max;
diff --git a/yql/essentials/tests/sql/suites/expr/int_literals_negative_typed.sql b/yql/essentials/tests/sql/suites/expr/int_literals_negative_typed.sql
new file mode 100644
index 0000000000..9fb8777dfa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/int_literals_negative_typed.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+select -128t as i8_min;
+select 127t as i8_max;
+
+select -32768s as i16_min;
+select 32767s as i16_max;
+
+select -9223372036854775808l as i64_min;
+select 9223372036854775807l as i64_max;
+
+
+select 255ut as u8_max;
+select 65535us as u16_max;
+select 18446744073709551615ul as u64_max;
+
+
+select -128ut;
+select -32768us;
+select -9223372036854775808ul;
diff --git a/yql/essentials/tests/sql/suites/expr/is_null.sql b/yql/essentials/tests/sql/suites/expr/is_null.sql
new file mode 100644
index 0000000000..e583901a72
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/is_null.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+select
+ 1/0 is NULL,
+ 1/0 isnull,
+ 1/0 is not NULL,
+ 1/0 notnull;
diff --git a/yql/essentials/tests/sql/suites/expr/iterable.sql b/yql/essentials/tests/sql/suites/expr/iterable.sql
new file mode 100644
index 0000000000..ebac483bf6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/iterable.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+$a = Yql::ToList(()->(Yql::Iterator([1,2,3])));
+select ListExtend($a, $a), ListHasItems($a), ListLength($a);
+
+$b = Yql::ToList(()->(Yql::EmptyIterator(Stream<Int32>)));
+select ListExtend($b, $b), ListHasItems($b), ListLength($b);
+
+$c = Yql::ToList(()->(Yql::EmptyIterator(Stream<Int32>)));
+select ListExtend($b, $b), ListLength($c), ListHasItems($c);
+
+select ListMap(ListFromRange(1,4), ($x)->{
+ $y = Yql::ToList(()->(Yql::Iterator([1,2,$x])));
+ return ListExtend($y, $y);
+ });
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/lambda_as_optional_callable.sql b/yql/essentials/tests/sql/suites/expr/lambda_as_optional_callable.sql
new file mode 100644
index 0000000000..5700bc9a71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/lambda_as_optional_callable.sql
@@ -0,0 +1,6 @@
+$callbackType = Callable<(Int32)->Int32>;
+$defaultFunc = Callable($callbackType, ($x)->($x));
+$outerType = CallableType(1, Int32, Int32, Optional<$callbackType>);
+$outer = Callable($outerType, ($x,$f)->(($f ?? $defaultFunc)($x)));
+
+select $outer(1,($y)->($y+1)), $outer(1);
diff --git a/yql/essentials/tests/sql/suites/expr/lds_empty_cast.sql b/yql/essentials/tests/sql/suites/expr/lds_empty_cast.sql
new file mode 100644
index 0000000000..fc3eae8e13
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/lds_empty_cast.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ Yql::Append(AsList(ListCreate(Int32)), []),
+ Yql::Append(AsList(DictCreate(Int32, String)), {}),
+ cast([] as List<Int32>),
+ cast({} as Dict<Int32, String>),
+ cast({} as Set<Int32>),
+ AsList(ListCreate(Int32),[]),
+ AsList([],ListCreate(Int32)),
+ AsList(DictCreate(Int32, String),{}),
+ AsList({},DictCreate(Int32, String)),
+ AsList(SetCreate(Int32),{}),
+ AsList({},SetCreate(Int32));
diff --git a/yql/essentials/tests/sql/suites/expr/lds_empty_compare.sql b/yql/essentials/tests/sql/suites/expr/lds_empty_compare.sql
new file mode 100644
index 0000000000..5dc4188f02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/lds_empty_compare.sql
@@ -0,0 +1,60 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ Yql::AggrEquals([],[]),
+ Yql::AggrNotEquals([],[]),
+ Yql::AggrLess([],[]),
+ Yql::AggrLessOrEqual([],[]),
+ Yql::AggrGreater([],[]),
+ Yql::AggrGreaterOrEqual([],[]),
+
+ Yql::AggrEquals({},{}),
+ Yql::AggrNotEquals({},{}),
+
+ [] = [],
+ [] = ListCreate(Int32),
+ ListCreate(Int32) = [],
+ [] = [1],
+ [1] = [],
+
+ [] != [],
+ [] != ListCreate(Int32),
+ ListCreate(Int32) != [],
+ [] != [1],
+ [1] != [],
+
+ [] < [],
+ [] < ListCreate(Int32),
+ ListCreate(Int32) < [],
+ [] < [1],
+ [1] < [],
+
+ [] <= [],
+ [] <= ListCreate(Int32),
+ ListCreate(Int32) <= [],
+ [] <= [1],
+ [1] <= [],
+
+ [] > [],
+ [] > ListCreate(Int32),
+ ListCreate(Int32) > [],
+ [] > [1],
+ [1] > [],
+
+ [] >= [],
+ [] >= ListCreate(Int32),
+ ListCreate(Int32) >= [],
+ [] >= [1],
+ [1] >= [],
+
+ {} = {},
+ {} = SetCreate(Int32),
+ SetCreate(Int32) = {},
+ {} = {1},
+ {1} = {},
+
+ {} != {},
+ {} != SetCreate(Int32),
+ SetCreate(Int32) != {},
+ {} != {1},
+ {1} != {},
diff --git a/yql/essentials/tests/sql/suites/expr/lds_literal.sql b/yql/essentials/tests/sql/suites/expr/lds_literal.sql
new file mode 100644
index 0000000000..a71723f9f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/lds_literal.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select [],[,],[1,],[1,2,3],{},{,},{1,1,},{"a":1,"a":2};
diff --git a/yql/essentials/tests/sql/suites/expr/lds_types.sql b/yql/essentials/tests/sql/suites/expr/lds_types.sql
new file mode 100644
index 0000000000..69e4a241c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/lds_types.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ FormatType(EmptyList), TypeKind(TypeHandle(EmptyList)),
+ FormatType(ParseType("EmptyList")), EmptyList(),
+ FormatType(EvaluateType(EmptyListTypeHandle())),
+ FormatType(EmptyDict), TypeKind(TypeHandle(EmptyDict)),
+ FormatType(ParseType("EmptyDict")), EmptyDict(),
+ FormatType(EvaluateType(EmptyDictTypeHandle()));
diff --git a/yql/essentials/tests/sql/suites/expr/len.cfg b/yql/essentials/tests/sql/suites/expr/len.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/len.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/len.sql b/yql/essentials/tests/sql/suites/expr/len.sql
new file mode 100644
index 0000000000..9e35dda177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/len.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT LEN("My String");
+
+SELECT LEN(key) from Input;
diff --git a/yql/essentials/tests/sql/suites/expr/length_of_optional_set_intesection.sql b/yql/essentials/tests/sql/suites/expr/length_of_optional_set_intesection.sql
new file mode 100644
index 0000000000..f1866cba94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/length_of_optional_set_intesection.sql
@@ -0,0 +1 @@
+SELECT ListLength(SetIntersection(ToSet(AsList("1", "2")), ToSet(Just(AsList("2", "3", "4", "5"))))); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/list_builtins.cfg b/yql/essentials/tests/sql/suites/expr/list_builtins.cfg
new file mode 100644
index 0000000000..5fee00e994
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_builtins.cfg
@@ -0,0 +1 @@
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/expr/list_builtins.sql b/yql/essentials/tests/sql/suites/expr/list_builtins.sql
new file mode 100644
index 0000000000..66dd5a0fcf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_builtins.sql
@@ -0,0 +1,70 @@
+/* postgres can not */
+/* syntax version 1 */
+$list = AsList(3, 1, 2, 3);
+$other_list = AsList(4);
+$bool_list = AsList(true, false, true);
+$struct_list = AsList(
+ AsStruct(1 AS one, 2 AS two),
+ AsStruct(-1 AS one, -2 AS two)
+);
+
+$script = @@
+def formula(a, b, c, d):
+ return a * b + c // d
+@@;
+$udf = Python3::formula(
+ Callable<(Int64, Int64, Int64, Int64)->Int64>,
+ $script
+);
+
+$lambdaSum = ($x, $y) -> { RETURN $x + $y; };
+$lambdaMult = ($x) -> { RETURN 4 * $x; };
+$lambdaTuple = ($i, $s) -> { RETURN ($i * $s, $i + $s); };
+$lambdaInc = ($i) -> { RETURN ($i + 1, $i + 2); };
+
+SELECT
+ ListLength($list) AS length,
+ ListExtend($list, $other_list) AS extend,
+ ListZip($list, $other_list) AS zip,
+ ListZipAll($list, $other_list) AS zipall,
+ ListEnumerate($list) AS enumerate,
+ ListReverse($list) AS reverse,
+ ListSkip($list, 2) AS skip,
+ ListTake($list, 2) AS take,
+ ListSort($list) AS sort,
+ ListSort($struct_list, ($x) -> { return $x.two; }) AS sort_structs,
+ ListMap($list, ($item) -> { return $udf($item, 6, 4, 2); }) AS map,
+ ListFlatMap($list, ($item) -> { return $item / 0; }) AS flatmap,
+ ListFilter($list, ($item) -> { return $item < 3; }) AS filter,
+ ListAny($bool_list) AS any,
+ ListAll($bool_list) AS all,
+ ListMax($list) AS max,
+ ListMin($list) AS min,
+ ListSum($list) AS sum,
+ ListAvg($list) AS avg,
+ ListUniq($list) AS uniq,
+ ListConcat(ListMap($list, ($item) -> { return CAST($item AS String); })) AS concat,
+ ListExtract($struct_list, "two") AS extract,
+ ListMap($list, ($item) -> { return CAST($item AS Double);}),
+ ListCreate(Tuple<Int64,Double>),
+ ListCreate(TypeOf("foo")),
+ ListFold($list, 6, $lambdaSum),
+ ListFold([], 3, $lambdaSum),
+ ListFold(Just($list), 6, $lambdaSum),
+ ListFold(Just([]), 3, $lambdaSum),
+ ListFold(Null, 3, $lambdaSum),
+ ListFold1($list, $lambdaMult, $lambdaSum),
+ ListFold1([], $lambdaMult, $lambdaSum),
+ ListFold1(Just($list), $lambdaMult, $lambdaSum),
+ ListFold1(Just([]), $lambdaMult, $lambdaSum),
+ ListFold1(Null, $lambdaMult, $lambdaSum),
+ ListFoldMap($list, 1, $lambdaTuple),
+ ListFoldMap([], 1, $lambdaTuple),
+ ListFoldMap(Just($list), 1, $lambdaTuple),
+ ListFoldMap(Just([]), 1, $lambdaTuple),
+ ListFoldMap(Null, 1, $lambdaTuple),
+ ListFold1Map($list, $lambdaInc, $lambdaTuple),
+ ListFold1Map([], $lambdaInc, $lambdaTuple),
+ ListFold1Map(Just($list), $lambdaInc, $lambdaTuple),
+ ListFold1Map(Just([]), $lambdaInc, $lambdaTuple),
+ ListFold1Map(Null, $lambdaInc, $lambdaTuple);
diff --git a/yql/essentials/tests/sql/suites/expr/list_builtins_opt.sql b/yql/essentials/tests/sql/suites/expr/list_builtins_opt.sql
new file mode 100644
index 0000000000..535c47cfe7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_builtins_opt.sql
@@ -0,0 +1,34 @@
+/* postgres can not */
+/* syntax version 1 */
+
+$list0 = AsList("a","b");
+$list1 = AsList(Just("a"), "b", Nothing(ParseType("String?")));
+$list2 = Just(AsList("a","b"));
+$list3 = Just(AsList(Just("a"), "b", Nothing(ParseType("String?"))));
+
+$list_empty0 = ListCreate(ParseType("String"));
+$list_empty1 = ListCreate(ParseType("String?"));
+$list_empty2 = Just(ListCreate(ParseType("String")));
+$list_empty3 = Just(ListCreate(ParseType("String?")));
+
+
+$list_null0 = Just(AsList(Nothing(ParseType("String?"))));
+$list_null1 = Nothing(ParseType("List<String?>?"));
+
+$list_min = Just(AsList(Just(Just(Just("a"))), "b"));
+
+
+select ListConcat($list0) as list0,
+ ListConcat($list1) as list1,
+ ListConcat($list2) as list2,
+ ListConcat($list3) as list3,
+
+ ListConcat($list_empty0) as list_empty0,
+ ListConcat($list_empty1) as list_empty1,
+ ListConcat($list_empty2) as list_empty2,
+ ListConcat($list_empty3) as list_empty3,
+
+ ListConcat($list_null0) as list_null0,
+ ListConcat($list_null1) as list_null1,
+
+ ListMin($list_min) as list_min;
diff --git a/yql/essentials/tests/sql/suites/expr/list_comp.sql b/yql/essentials/tests/sql/suites/expr/list_comp.sql
new file mode 100644
index 0000000000..fb3b91f27e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_comp.sql
@@ -0,0 +1,70 @@
+/* postgres can not */
+select AsTuple(
+AsList(1,2) < AsList(1u,3u),
+AsList(1,2) < AsList(1u,2u),
+AsList(1,2) < AsList(1u,1u),
+AsList(1,2) < AsList(2u,1u),
+AsList(1,2) < AsList(2u,3u),
+AsList(1,2/1) < AsList(1u,3u),
+AsList(1,2/1) < AsList(1u,2u),
+AsList(1,2/1) < AsList(1u,1u),
+AsList(1,2/0) < AsList(2u,3u),
+AsList(1,2/0) < AsList(1u,3u),
+);
+
+select AsTuple(
+AsList(1,2) <= AsList(1u,3u),
+AsList(1,2) <= AsList(1u,2u),
+AsList(1,2) <= AsList(1u,1u),
+AsList(1,2) <= AsList(2u,1u),
+AsList(1,2) <= AsList(2u,3u),
+AsList(1,2/1) <= AsList(1u,3u),
+AsList(1,2/1) <= AsList(1u,2u),
+AsList(1,2/1) <= AsList(1u,1u),
+AsList(1,2/0) <= AsList(2u,3u),
+AsList(1,2/0) <= AsList(1u,3u),
+);
+
+select AsTuple(
+AsList(1,2) > AsList(1u,3u),
+AsList(1,2) > AsList(1u,2u),
+AsList(1,2) > AsList(1u,1u),
+AsList(1,2) > AsList(2u,1u),
+AsList(1,2) > AsList(2u,3u),
+AsList(1,2/1) > AsList(1u,3u),
+AsList(1,2/1) > AsList(1u,2u),
+AsList(1,2/1) > AsList(1u,1u),
+AsList(1,2/0) > AsList(2u,3u),
+AsList(1,2/0) > AsList(1u,3u),
+);
+
+select AsTuple(
+AsList(1,2) >= AsList(1u,3u),
+AsList(1,2) >= AsList(1u,2u),
+AsList(1,2) >= AsList(1u,1u),
+AsList(1,2) >= AsList(2u,1u),
+AsList(1,2) >= AsList(2u,3u),
+AsList(1,2/1) >= AsList(1u,3u),
+AsList(1,2/1) >= AsList(1u,2u),
+AsList(1,2/1) >= AsList(1u,1u),
+AsList(1,2/0) >= AsList(2u,3u),
+AsList(1,2/0) >= AsList(1u,3u),
+);
+
+select AsTuple (
+AsList(1,2,3) == AsList(1u,2u),
+AsList(1/1,2/1) == AsList(1u,2u),
+AsList(1/1,2/0) == AsList(1u,2u)
+);
+
+select AsTuple(
+AsList(1,2) < AsList(1u,2u,3u),
+AsList(1,2) <= AsList(1u,2u,3u),
+AsList(1,2) > AsList(1u,2u,3u),
+AsList(1,2) >= AsList(1u,2u,3u),
+
+AsList(1,2,3) < AsList(1u,2u),
+AsList(1,2,3) <= AsList(1u,2u),
+AsList(1,2,3) > AsList(1u,2u),
+AsList(1,2,3) >= AsList(1u,2u),
+);
diff --git a/yql/essentials/tests/sql/suites/expr/list_concat.sql b/yql/essentials/tests/sql/suites/expr/list_concat.sql
new file mode 100644
index 0000000000..9f22a3c670
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_concat.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+$list = ["one","two","three","four","five"];
+
+SELECT
+ ListConcat([], "."),
+ ListConcat($list),
+ ListConcat($list, ";"),
+ ListConcat($list, Just(", ")),
+ ListConcat($list, NULL),
+ ListConcat($list, Nothing(String?)),
+ ListConcat(["single"], "tail");
diff --git a/yql/essentials/tests/sql/suites/expr/list_extend.sql b/yql/essentials/tests/sql/suites/expr/list_extend.sql
new file mode 100644
index 0000000000..337af69645
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_extend.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+PRAGMA warning("disable", "1107");
+SELECT
+ ListExtend([2u], [3s], [4l]),
+ ListExtend(1, "String", 123, null),
+ ListExtendStrict(1, "String", 123, null),
+ ListExtend([3s], [4], Just([5l])),
+ ListExtend([1u], [2u], Nothing(List<Int32>?)),
+ ListExtendStrict([1u], [2u], Nothing(List<UInt32>?)),
+ ListExtendStrict([1u], [2u], [4u, 3u]),
+ ListExtendStrict([1u], Just([2u]), [], [5u, 6u]),
+;
diff --git a/yql/essentials/tests/sql/suites/expr/list_flat_map_deprecated_opt.sql b/yql/essentials/tests/sql/suites/expr/list_flat_map_deprecated_opt.sql
new file mode 100644
index 0000000000..70ce023824
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_flat_map_deprecated_opt.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select ListFlatMap([1,2,null],($x)->(10 + $x));
diff --git a/yql/essentials/tests/sql/suites/expr/list_flatten.sql b/yql/essentials/tests/sql/suites/expr/list_flatten.sql
new file mode 100644
index 0000000000..4a4eda4b46
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_flatten.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+select ListFlatten(null),ListFlatten([]),
+ ListFlatten(Just([])),ListFlatten(Nothing(EmptyList?)),
+ ListFlatten([[],[]]),ListFlatten([null,null]),
+ ListFlatten([Just([]),Just([])]),
+ ListFlatten(Just([[],[]])),ListFlatten(Just([null,null])),
+ ListFlatten(Just([Just([]),Just([])]));
+
+select ListFlatten([[1,2],[3,4]]),
+ ListFlatten([[1,2],null,[3,4]]),
+ ListFlatten(Just([[1,2],[3,4]])),
+ ListFlatten(Just([[1,2],null,[3,4]])),
+ ListFlatten([Just([1,2]),Just([3,4])]),
+ ListFlatten(Just([Just([1,2]),Just([3,4])])); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/list_from_range.sql b/yql/essentials/tests/sql/suites/expr/list_from_range.sql
new file mode 100644
index 0000000000..fb5d384542
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_from_range.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+select
+ListFromRange(3,0,-1),
+ListFromRange(3,0),
+ListFromRange(0,3,-1),
+ListFromRange(0,3),
+ListFromRange(0,3,-0.5),
+ListFromRange(0,3,+0.5),
+ListFromRange(0u,7u,2u),
+ListFromRange(7u,0u,-2);
diff --git a/yql/essentials/tests/sql/suites/expr/list_from_range_opt.sql b/yql/essentials/tests/sql/suites/expr/list_from_range_opt.sql
new file mode 100644
index 0000000000..84907a1664
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_from_range_opt.sql
@@ -0,0 +1,26 @@
+SELECT ListFromRange(1, 3),
+ ListFromRange(1, Just(3)),
+ ListFromRange(Just(1), Just(3)),
+ ListFromRange(1, 3, 1),
+ ListFromRange(1, 3, Just(1)),
+ ListFromRange(1, 3, Nothing(Int32?)),
+ ListFromRange(1, Just(3), Just(1)),
+ ListFromRange(1.2, 3.2),
+ ListFromRange(1.2, Just(3.2)),
+ ListFromRange(Just(1.2), Just(3.2)),
+ ListFromRange(1, Just(3.2)),
+ ListFromRange(1, Nothing(Uint64?)),
+ ListFromRange(1.2, Just(3.2), 0.4),
+ ListFromRange(1.2, 3.2, Just(0.4)),
+ ListFromRange(Just(1.2), 3.2, Just(0.4)),
+ ListFromRange(1.2, 3.2, Nothing(Double?)),
+ ListFromRange(1, Just(1.2), Null),
+ ListFromRange(Just(1), Null, Null),
+ ListFromRange(1, 1.2, Null),
+ ListFromRange(1, Null, Null),
+ ListFromRange(Null, Null, Null),
+ ListFromRange(Interval("PT1S"), Interval("PT1S")),
+ ListFromRange(Interval("PT1M"), Just(Interval("PT1M"))),
+ ListFromRange(Interval("PT1M"), Interval("PT2M"), Just(Interval("PT10S"))),
+ ListFromRange(Interval("PT1S"), Interval("PT1M"), Null),
+ ListFromRange(Interval("PT1S"), Interval("PT4S"), Nothing(Interval?));
diff --git a/yql/essentials/tests/sql/suites/expr/list_from_range_overflow.sql b/yql/essentials/tests/sql/suites/expr/list_from_range_overflow.sql
new file mode 100644
index 0000000000..cd08bede81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_from_range_overflow.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+
+$min_tiny = -127t - 1t;
+
+select
+ ListFromRange(1ut,255ut,11ut),
+ ListFromRange(1ut,254ut,11ut),
+ ListFromRange(127t, $min_tiny, -1t),
+ ListFromRange(127t, $min_tiny, $min_tiny);
+
diff --git a/yql/essentials/tests/sql/suites/expr/list_indexof.sql b/yql/essentials/tests/sql/suites/expr/list_indexof.sql
new file mode 100644
index 0000000000..47be99e547
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_indexof.sql
@@ -0,0 +1,13 @@
+$list = [1, 2, 3];
+
+$opt_list = [1, null, 2, 3];
+
+select
+ ListIndexOf($list, 2),
+ ListIndexOf($list, 100),
+ ListIndexOf(Just($opt_list), 2),
+ ListIndexOf(Just($opt_list), 200),
+ ListIndexOf(Nothing(List<Int32>?), 2),
+ ListIndexOf([], 'foo'),
+ ListIndexOf(null, 1.0),
+;
diff --git a/yql/essentials/tests/sql/suites/expr/list_not_null.sql b/yql/essentials/tests/sql/suites/expr/list_not_null.sql
new file mode 100644
index 0000000000..69f2a206fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_not_null.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+select ListNotNull(null),ListNotNull([]),ListNotNull([null]),ListNotNull(Just([])),
+ListNotNull([1,2]),ListNotNull([1,null,2]),
+ListNotNull(Just([1,2])),ListNotNull(Just([1,null,2])),
+ListNotNull(Nothing(List<Int32>?)),ListNotNull(Nothing(List<Int32?>?)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/list_replicate.sql b/yql/essentials/tests/sql/suites/expr/list_replicate.sql
new file mode 100644
index 0000000000..d1e42fda27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_replicate.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+select
+ListReplicate(-1,10),
+ListReplicate(AsTuple(1,2),3),
+ListReplicate("foo",2),
+ListReplicate(true,0);
diff --git a/yql/essentials/tests/sql/suites/expr/list_replicate_fail.cfg b/yql/essentials/tests/sql/suites/expr/list_replicate_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_replicate_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/list_replicate_fail.sql b/yql/essentials/tests/sql/suites/expr/list_replicate_fail.sql
new file mode 100644
index 0000000000..0567764565
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_replicate_fail.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+select
+ListReplicate(1, -1);
diff --git a/yql/essentials/tests/sql/suites/expr/list_takeskipwhile.sql b/yql/essentials/tests/sql/suites/expr/list_takeskipwhile.sql
new file mode 100644
index 0000000000..8101dded6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_takeskipwhile.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+$a = AsList(1,2,3,1,2,3);
+
+select
+ ListTakeWhile($a,($x)->{return $x<3}),
+ ListSkipWhile($a,($x)->{return $x<3}),
+ Yql::Collect(YQL::TakeWhile(Yql::Iterator($a,Yql::DependsOn(1)),($x)->{return $x<3})),
+ Yql::Collect(YQL::SkipWhile(Yql::Iterator($a,Yql::DependsOn(2)),($x)->{return $x<3})),
+ Yql::TakeWhile(Just(1),($x)->{return $x<3}),
+ Yql::SkipWhile(Just(1),($x)->{return $x<3});
diff --git a/yql/essentials/tests/sql/suites/expr/list_takeskipwhileinclusive.sql b/yql/essentials/tests/sql/suites/expr/list_takeskipwhileinclusive.sql
new file mode 100644
index 0000000000..38159a462d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_takeskipwhileinclusive.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+$a = AsList(1,2,3,1,2,3);
+
+select
+ ListTakeWhileInclusive($a,($x)->{return $x<3}),
+ ListSkipWhileInclusive($a,($x)->{return $x<3}),
+ Yql::Collect(YQL::TakeWhileInclusive(Yql::Iterator($a,Yql::DependsOn(1)),($x)->{return $x<3})),
+ Yql::Collect(YQL::SkipWhileInclusive(Yql::Iterator($a,Yql::DependsOn(2)),($x)->{return $x<3})),
+ Yql::TakeWhileInclusive(Just(1),($x)->{return $x<3}),
+ Yql::SkipWhileInclusive(Just(1),($x)->{return $x<3});
diff --git a/yql/essentials/tests/sql/suites/expr/list_to_from_tuple.sql b/yql/essentials/tests/sql/suites/expr/list_to_from_tuple.sql
new file mode 100644
index 0000000000..4f80b8976e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_to_from_tuple.sql
@@ -0,0 +1,11 @@
+select
+ ListFromTuple(null),
+ ListFromTuple(()),
+ ListFromTuple((1,2)),
+ ListFromTuple(just((3,4))),
+ ListFromTuple(Nothing(Tuple<Int32,Int32>?)),
+ ListToTuple(null,10),
+ ListToTuple([],0),
+ ListToTuple(ListCreate(Int32),0),
+ ListToTuple([1,2],2),
+ ListToTuple(just([3,4]),2);
diff --git a/yql/essentials/tests/sql/suites/expr/list_top_sort.sql b/yql/essentials/tests/sql/suites/expr/list_top_sort.sql
new file mode 100644
index 0000000000..962b76ae61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_top_sort.sql
@@ -0,0 +1,32 @@
+/* syntax version 1 */
+
+$list = [45, 20, 34, 16];
+$empty = [];
+
+$digit = ($x) -> { return $x % 10; };
+
+SELECT
+ ListTopSort($list, 2), ListTopSort($list, 4), ListTopSort($list, 5),
+ ListTopSort($list, 2, $digit),
+ ListTopSort(NULL, 2), ListTopSort(Just($list), 2), ListTopSort($empty, 0);
+SELECT
+ ListTopSortAsc($list, 2), ListTopSortAsc($list, 4), ListTopSortAsc($list, 5),
+ ListTopSortAsc($list, 2, $digit),
+ ListTopSortAsc(NULL, 2), ListTopSortAsc(Just($list), 2), ListTopSortAsc($empty, 0);
+SELECT
+ ListTopSortDesc($list, 2), ListTopSortDesc($list, 4), ListTopSortDesc($list, 5),
+ ListTopSortDesc($list, 2, $digit),
+ ListTopSortDesc(NULL, 2), ListTopSortDesc(Just($list), 2), ListTopSortDesc($empty, 0);
+
+SELECT
+ ListSort(ListTop($list, 2)), ListSort(ListTop($list, 4)), ListSort(ListTop($list, 5)),
+ ListSort(ListTop($list, 2, $digit)),
+ ListSort(ListTop(NULL, 2)), ListSort(ListTop(Just($list), 2)), ListSort(ListTop($empty, 0));
+SELECT
+ ListSort(ListTopAsc($list, 2)), ListSort(ListTopAsc($list, 4)), ListSort(ListTopAsc($list, 5)),
+ ListSort(ListTopAsc($list, 2, $digit)),
+ ListSort(ListTopAsc(NULL, 2)), ListSort(ListTopAsc(Just($list), 2)), ListSort(ListTopAsc($empty, 0));
+SELECT
+ ListSort(ListTopDesc($list, 2)), ListSort(ListTopDesc($list, 4)), ListSort(ListTopDesc($list, 5)),
+ ListSort(ListTopDesc($list, 2, $digit)),
+ ListSort(ListTopDesc(NULL, 2)), ListSort(ListTopDesc(Just($list), 2)), ListSort(ListTopDesc($empty, 0)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/list_uniq.sql b/yql/essentials/tests/sql/suites/expr/list_uniq.sql
new file mode 100644
index 0000000000..b27c5413d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/list_uniq.sql
@@ -0,0 +1,8 @@
+SELECT ListSort(ListUniq([1, 2, 1, 3, 4, 2, 4])),
+ ListSort(ListUniq([1, 2, 3, null, 1, 7, 4, 3])),
+ ListUniqStable([]),
+ ListUniqStable([1, 2, 1, 3, 4, 2, 4]),
+ ListUniqStable([1, 2, 3, null, 1, 7, 4, 3]),
+ ListUniqStable(["a", "b", "c", "a", "ab", "ac", "ab"]),
+ ListUniqStable(Just(["a", "b", "c", "a", "ab", "ac", "ab"])),
+ ListUniqStable(NULL);
diff --git a/yql/essentials/tests/sql/suites/expr/literal_list_element.sql b/yql/essentials/tests/sql/suites/expr/literal_list_element.sql
new file mode 100644
index 0000000000..70b22d1bbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/literal_list_element.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$list = YQL::@@(AsList (String 'z) (String 'a))@@;
+SELECT $list[0];
diff --git a/yql/essentials/tests/sql/suites/expr/literal_strings.sql b/yql/essentials/tests/sql/suites/expr/literal_strings.sql
new file mode 100644
index 0000000000..6696be7d80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/literal_strings.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select '@@@@', '\'', "@@@@", "\"", @@ '@ @@, @@
+"@ @@@@
+@@,
+'"', "'";
diff --git a/yql/essentials/tests/sql/suites/expr/literal_strings_suffix.sql b/yql/essentials/tests/sql/suites/expr/literal_strings_suffix.sql
new file mode 100644
index 0000000000..6d63d0f750
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/literal_strings_suffix.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select "ab"u, "[1;2]"y, '{"a":null}'j;
diff --git a/yql/essentials/tests/sql/suites/expr/literal_struct_member.sql b/yql/essentials/tests/sql/suites/expr/literal_struct_member.sql
new file mode 100644
index 0000000000..a53d4b293f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/literal_struct_member.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+$struct = YQL::@@(AsStruct '('"z z" (String 'a)) '('y (String 'b)))@@;
+SELECT $struct.`z z`;
diff --git a/yql/essentials/tests/sql/suites/expr/literal_true.sql b/yql/essentials/tests/sql/suites/expr/literal_true.sql
new file mode 100644
index 0000000000..38d56a8fe3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/literal_true.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* postgres returns "t" as string representation */
+select true; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/longint_builtins.sql b/yql/essentials/tests/sql/suites/expr/longint_builtins.sql
new file mode 100644
index 0000000000..f87d611fc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/longint_builtins.sql
@@ -0,0 +1,22 @@
+/* postgres can not */
+-- not supported on windows
+$value = "1000000000000";
+$negative = -1000000000000;
+$longint = YQL::StrictFromString($value, AsAtom("Decimal"), AsAtom("32"), AsAtom("0"));
+$negative_longint = CAST($negative AS Decimal(32,0));
+$add = $longint + CAST("1111111111111111111111111111111" AS Decimal(32,0));
+$div = $longint / CAST(1111 AS Decimal(32,0));
+$mod = $longint % CAST(1111 AS Decimal(32,0));
+$mul = $longint * CAST(333333333333333333 AS Decimal(32,0));
+$sub = $longint - CAST("1111111111111111111111111111111" AS Decimal(32,0));
+SELECT
+ $longint AS binary,
+ YQL::ToString(YQL::Dec($longint)) AS to_string,
+ CAST(YQL::Inc(Abs($negative_longint)) AS String) AS abs,
+ CAST(YQL::Minus($add) AS String) AS add,
+ CAST($div AS String) AS div,
+ CAST($mod AS String) AS mod,
+ CAST($mul AS String) AS mul,
+ CAST($sub AS String) AS sub,
+ $longint == YQL::Abs($negative_longint) AS eq,
+ $div <= $longint AS cmp;
diff --git a/yql/essentials/tests/sql/suites/expr/many_opt_comp.sql b/yql/essentials/tests/sql/suites/expr/many_opt_comp.sql
new file mode 100644
index 0000000000..8062a6b8a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/many_opt_comp.sql
@@ -0,0 +1,104 @@
+/* postgres can not */
+select AsTuple(
+
+ Just(Just(1)) == Just(Just(2u)),
+ Just(Just(1)) == Just(2u),
+ Just(1) == Just(Just(2u)),
+ 1 == Just(Just(2u)),
+
+ Just(Just(1)) == Just(Just(1u)),
+ Just(Just(1)) == Just(1u),
+ Just(1) == Just(Just(1u)),
+ 1 == Just(Just(1u)),
+
+ Just(Just(2)) == Just(Just(1u)),
+ Just(Just(2)) == Just(1u),
+ Just(2) == Just(Just(1u)),
+ 2 == Just(Just(1u))
+);
+
+select AsTuple(
+ Just(Just(1)) != Just(Just(2u)),
+ Just(Just(1)) != Just(2u),
+ Just(1) != Just(Just(2u)),
+ 1 != Just(Just(2u)),
+
+ Just(Just(1)) != Just(Just(1u)),
+ Just(Just(1)) != Just(1u),
+ Just(1) != Just(Just(1u)),
+ 1 != Just(Just(1u)),
+
+ Just(Just(2)) != Just(Just(1u)),
+ Just(Just(2)) != Just(1u),
+ Just(2) != Just(Just(1u)),
+ 2 != Just(Just(1u))
+);
+
+
+select AsTuple(
+ Just(Just(1)) < Just(Just(2u)),
+ Just(Just(1)) < Just(2u),
+ Just(1) < Just(Just(2u)),
+ 1 < Just(Just(2u)),
+
+ Just(Just(1)) < Just(Just(1u)),
+ Just(Just(1)) < Just(1u),
+ Just(1) < Just(Just(1u)),
+ 1 < Just(Just(1u)),
+
+ Just(Just(2)) < Just(Just(1u)),
+ Just(Just(2)) < Just(1u),
+ Just(2) < Just(Just(1u)),
+ 2 < Just(Just(1u))
+);
+
+select AsTuple(
+ Just(Just(1)) <= Just(Just(2u)),
+ Just(Just(1)) <= Just(2u),
+ Just(1) <= Just(Just(2u)),
+ 1 <= Just(Just(2u)),
+
+ Just(Just(1)) <= Just(Just(1u)),
+ Just(Just(1)) <= Just(1u),
+ Just(1) <= Just(Just(1u)),
+ 1 <= Just(Just(1u)),
+
+ Just(Just(2)) <= Just(Just(1u)),
+ Just(Just(2)) <= Just(1u),
+ Just(2) <= Just(Just(1u)),
+ 2 <= Just(Just(1u))
+);
+
+select AsTuple(
+ Just(Just(1)) > Just(Just(2u)),
+ Just(Just(1)) > Just(2u),
+ Just(1) > Just(Just(2u)),
+ 1 > Just(Just(2u)),
+
+ Just(Just(1)) > Just(Just(1u)),
+ Just(Just(1)) > Just(1u),
+ Just(1) > Just(Just(1u)),
+ 1 > Just(Just(1u)),
+
+ Just(Just(2)) > Just(Just(1u)),
+ Just(Just(2)) > Just(1u),
+ Just(2) > Just(Just(1u)),
+ 2 > Just(Just(1u))
+);
+
+select AsTuple(
+ Just(Just(1)) >= Just(Just(2u)),
+ Just(Just(1)) >= Just(2u),
+ Just(1) >= Just(Just(2u)),
+ 1 >= Just(Just(2u)),
+
+ Just(Just(1)) >= Just(Just(1u)),
+ Just(Just(1)) >= Just(1u),
+ Just(1) >= Just(Just(1u)),
+ 1 >= Just(Just(1u)),
+
+ Just(Just(2)) >= Just(Just(1u)),
+ Just(Just(2)) >= Just(1u),
+ Just(2) >= Just(Just(1u)),
+ 2 >= Just(Just(1u))
+);
diff --git a/yql/essentials/tests/sql/suites/expr/minmax_for_complex_types.sql b/yql/essentials/tests/sql/suites/expr/minmax_for_complex_types.sql
new file mode 100644
index 0000000000..3b08ce957b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/minmax_for_complex_types.sql
@@ -0,0 +1,19 @@
+select
+ max_of(AsTuple(1u, 2), AsTuple(1, 1/0), AsTuple(1, 3)) as max_tuple,
+ min_of(AsTuple(1u, 2), AsTuple(1, 1/0), AsTuple(1, 3)) as min_tuple,
+
+ min_of(AsTuple(0, 1/0), AsTuple(1, 1/0), AsTuple(2, 1/0)) as min_tuple1,
+ max_of(AsTuple(0, 1/0), AsTuple(1, 1/0), AsTuple(2, 1/0)) as max_tuple1,
+
+ min_of(AsTuple(1, 1/0), AsTuple(1, 1)) as min_tuple2,
+ max_of(AsTuple(1, 1/0), AsTuple(1, 1)) as max_tuple2,
+
+ min_of(AsTuple(1, 1/0), AsTuple(1, 1/0)) as min_tuple3,
+ max_of(AsTuple(1, 1/0), AsTuple(1, 1/0)) as max_tuple3,
+
+ min_of(AsTuple(1, 1/0)) as min_tuple4,
+ max_of(AsTuple(1, 1/0)) as max_tuple4,
+
+
+ min_of(AsList(1, 2, 3), AsList(1, 1)) as min_list,
+ max_of(AsList(1, 2, 3), AsList(1, 1)) as max_list,
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.sql
new file mode 100644
index 0000000000..eae813be7a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_column_fail.sql
@@ -0,0 +1,6 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+SELECT COUNT(*) FROM Input
+GROUP BY YQL::NewMTRand(length(value)) as key;
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.sql
new file mode 100644
index 0000000000..3fc1126b89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_having_some_fail.sql
@@ -0,0 +1,9 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+SELECT
+ key
+FROM Input
+GROUP BY key
+HAVING Yql::NextMtRand(SOME(YQL::NewMTRand(1))).0 > 100;
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.sql
new file mode 100644
index 0000000000..e7b61c9b47
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_group_by_some_fail.sql
@@ -0,0 +1,6 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+SELECT SOME(YQL::NewMTRand(1)) FROM Input
+GROUP BY key;
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.sql
new file mode 100644
index 0000000000..4f6a600c31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_inner_select_fail.sql
@@ -0,0 +1,9 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+SELECT 1 FROM (
+ SELECT
+ YQL::NewMTRand(1) as x
+ FROM Input
+)
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.cfg
new file mode 100644
index 0000000000..5625fb3b45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.sql
new file mode 100644
index 0000000000..cd75cf3d25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_insert_into_fail.sql
@@ -0,0 +1,8 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+INSERT INTO
+ Output (key, value)
+VALUES
+ ("foo", YQL::NewMTRand(1));
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.cfg b/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.sql b/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.sql
new file mode 100644
index 0000000000..c94d1805ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/non_persistable_order_by_fail.sql
@@ -0,0 +1,6 @@
+PRAGMA Warning("error", '1104');
+
+USE plato;
+
+SELECT key, value FROM Input
+ORDER BY YQL::NewMTRand(length(value));
diff --git a/yql/essentials/tests/sql/suites/expr/opt_list_map.sql b/yql/essentials/tests/sql/suites/expr/opt_list_map.sql
new file mode 100644
index 0000000000..35f0e9d96b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/opt_list_map.sql
@@ -0,0 +1,26 @@
+/* postgres can not */
+/* syntax version 1 */
+$l1 = AsList(1,2,3,1,2,3);
+$l2 = Just($l1);
+$l3 = Nothing(TypeOf($l2));
+select $l1, $l2, $l3;
+
+$p = ($x) -> { return $x < 3 };
+select ListFilter($l1, $p), ListFilter($l2, $p), ListFilter($l3, $p);
+
+$m = ($x) -> { return $x * 2 };
+select ListMap($l1, $m), ListMap($l2, $m), ListMap($l3, $m);
+
+$f = ($x) -> { return AsList($x, $x * 2) };
+select ListFlatMap($l1, $f), ListFlatMap($l2, $f), ListFlatMap($l3, $f);
+
+select ListSkipWhile($l1, $p), ListSkipWhile($l2, $p), ListSkipWhile($l3, $p);
+select ListTakeWhile($l1, $p), ListTakeWhile($l2, $p), ListTakeWhile($l3, $p);
+
+select ListExtend($l1, $l1), ListExtend($l2, $l2), ListExtend($l2, $l3), ListExtend($l3, $l3);
+
+$ls1 = AsList(AsStruct(1 as a), AsStruct(2 as a));
+$ls2 = Just($ls1);
+$ls3 = Nothing(TypeOf($ls2));
+
+select ListUnionAll($ls1, $ls1), ListUnionAll($ls2, $ls2), ListUnionAll($ls2, $ls3), ListUnionAll($ls3, $ls3);
diff --git a/yql/essentials/tests/sql/suites/expr/opt_try_member.sql b/yql/essentials/tests/sql/suites/expr/opt_try_member.sql
new file mode 100644
index 0000000000..1be2db2401
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/opt_try_member.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+/* kikimr can not */
+/* syntax version 1 */
+select
+TryMember(Just(<|x:1|>),"x",0),
+TryMember(Just(<|x:1|>),"y",0),
+TryMember(Just(<|x:Just(1)|>),"x",Just(0)),
+TryMember(Just(<|x:Just(1)|>),"y",Just(0)),
+TryMember(Just(<|x:Nothing(Int32?)|>),"x",Just(0)),
+TryMember(Just(<|x:Nothing(Int32?)|>),"y",Just(0)),
+
+TryMember(Just(<|x:1|>),"x",null),
+TryMember(Just(<|x:1|>),"y",null),
+TryMember(Just(<|x:Just(1)|>),"x",null),
+TryMember(Just(<|x:Just(1)|>),"y",null),
+TryMember(Just(<|x:Nothing(Int32?)|>),"x",null),
+TryMember(Just(<|x:Nothing(Int32?)|>),"y",null),
+
+TryMember(Nothing(Struct<x:Int32>?),"x",0),
+TryMember(Nothing(Struct<x:Int32>?),"x",null),
+
+TryMember(Nothing(Struct<x:Int32?>?),"x",Just(0)),
+TryMember(Nothing(Struct<x:Int32?>?),"x",null);
diff --git a/yql/essentials/tests/sql/suites/expr/partial_columns_in_mem_aggr.sql b/yql/essentials/tests/sql/suites/expr/partial_columns_in_mem_aggr.sql
new file mode 100644
index 0000000000..7a72357070
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/partial_columns_in_mem_aggr.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+select
+ Domain,
+ aggregate_list(AsStruct(DeviceID as DeviceID, DeviceCategory as DeviceCategory)) as Devices
+from (
+ select 1 as DeviceID, 2 as DeviceCategory, 3 as Domain
+)
+group by Domain
diff --git a/yql/essentials/tests/sql/suites/expr/pg_try_member.cfg b/yql/essentials/tests/sql/suites/expr/pg_try_member.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/pg_try_member.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/expr/pg_try_member.sql b/yql/essentials/tests/sql/suites/expr/pg_try_member.sql
new file mode 100644
index 0000000000..66eb44a8f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/pg_try_member.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+/* syntax version 1 */
+/* yt can not */
+
+$s = <|a:1p|>;
+$js = Just($s);
+$es = Nothing(Struct<a:PgInt>?);
+
+-- fully equivalent to <struct>.<name>
+select
+ TryMember($s, "a", null),
+ TryMember($js, "a", null),
+ TryMember($es, "a", null),
+;
+
+-- TypeOf TryMember is type of third argument
+-- field type should either match third type exactly, or (if the third type is optional)
+-- Optional(field) should be equal to third type
+select
+ TryMember($s, "a", 999p),
+ TryMember($s, "a", Just(999p)),
+
+ TryMember($js, "a", 999p),
+ TryMember($js, "a", Just(999p)),
+
+ TryMember($es, "a", 999p),
+ TryMember($es, "a", Just(999p)),
+;
+
diff --git a/yql/essentials/tests/sql/suites/expr/pickle.sql b/yql/essentials/tests/sql/suites/expr/pickle.sql
new file mode 100644
index 0000000000..2279d409c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/pickle.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+$lst = AsList(AsTuple(13,4),AsTuple(11,2),AsTuple(17,8),AsTuple(5,6));
+
+$p1 = Pickle(ToDict($lst));
+$p2 = StablePickle(ToDict($lst));
+$p3 = StablePickle(ToSortedDict($lst));
+$p4 = Pickle(ToDict(ListReverse($lst)));
+$p5 = StablePickle(ToDict(ListReverse($lst)));
+select $p1, Ensure($p2, $p1 != $p2), Ensure($p3, $p2 = $p3),
+ Ensure($p4, $p4 != $p1), Ensure($p5, $p5 = $p2);
+select ListSort(DictItems(Unpickle(TypeOf(ToDict($lst)),$p1))), ListSort(DictItems(Unpickle(TypeOf(ToDict($lst)),$p2)));
+
diff --git a/yql/essentials/tests/sql/suites/expr/replace_member.sql b/yql/essentials/tests/sql/suites/expr/replace_member.sql
new file mode 100644
index 0000000000..1e2e47ed7a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/replace_member.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+/* syntax version 1 */
+$data = <|x: [<|y: 2|>], z: 5|>;
+
+-- set field function
+$F = ($field, $function) -> (
+ ($struct) -> (
+ ReplaceMember($struct, $field, $function($struct.$field))
+ )
+);
+
+-- set list element function
+$E = ($index, $function) -> (
+ ($list) -> (
+ ListMap(ListEnumerate($list), ($pair) -> (
+ IF ($pair.0 = $index, $function($pair.1), $pair.1)
+ ))
+ )
+);
+
+-- set value function
+$V = ($value) -> (
+ ($_item) -> ($value)
+);
+
+SELECT $F("x", $E(0, $F("y", $V(3))))($data)
+
diff --git a/yql/essentials/tests/sql/suites/expr/sets.sql b/yql/essentials/tests/sql/suites/expr/sets.sql
new file mode 100644
index 0000000000..4984941e5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/sets.sql
@@ -0,0 +1,40 @@
+/* postgres can not */
+$ns = ($set)->{return ListSort(DictKeys($set))};
+$nd = ($dict)->{return ListSort(DictItems($dict), ($z)->{return $z.0})};
+
+select $ns(ToSet(AsList(1,2,3)));
+
+select SetIsDisjoint(ToSet(AsList(1,2,3)), AsList(7,4));
+
+select SetIsDisjoint(ToSet(AsList(1,2,3)), AsList(3,4));
+
+select SetIsDisjoint(ToSet(AsList(1,2,3)), ToSet(AsList(7,4)));
+select SetIsDisjoint(ToSet(AsList(1,2,3)), ToSet(AsList(3,4)));
+
+select $ns(SetIntersection(ToSet(AsList(1,2,3)), ToSet(AsList(3,4))));
+select $nd(SetIntersection(
+ AsDict(AsTuple(1,"foo"),AsTuple(3,"bar")),
+ AsDict(AsTuple(1,"baz"),AsTuple(2,"qwe")),
+ ($_k, $a, $b)->{ return AsTuple($a, $b) }));
+
+select SetIncludes(ToSet(AsList(1,2,3)), AsList(3,4));
+
+select SetIncludes(ToSet(AsList(1,2,3)), AsList(2,3));
+
+select SetIncludes(ToSet(AsList(1,2,3)), ToSet(AsList(3,4)));
+select SetIncludes(ToSet(AsList(1,2,3)), ToSet(AsList(2,3)));
+
+select $ns(SetDifference(ToSet(AsList(1,2,3)), ToSet(AsList(3,4))));
+select $ns(SetDifference(ToSet(AsList(1,2,3)), ToSet(AsList(2,3))));
+
+select $ns(SetUnion(ToSet(AsList(1,2,3)), ToSet(AsList(3,4))));
+select $nd(SetUnion(
+ AsDict(AsTuple(1,"foo"),AsTuple(3,"bar")),
+ AsDict(AsTuple(1,"baz"),AsTuple(2,"qwe")),
+ ($_k, $a, $b)->{ return AsTuple($a, $b) }));
+
+select $ns(SetSymmetricDifference(ToSet(AsList(1,2,3)), ToSet(AsList(3,4))));
+select $nd(SetSymmetricDifference(
+ AsDict(AsTuple(1,"foo"),AsTuple(3,"bar")),
+ AsDict(AsTuple(1,"baz"),AsTuple(2,"qwe")),
+ ($_k, $a, $b)->{ return AsTuple($a, $b) }));
diff --git a/yql/essentials/tests/sql/suites/expr/static_fold.sql b/yql/essentials/tests/sql/suites/expr/static_fold.sql
new file mode 100644
index 0000000000..9118da0e06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/static_fold.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+
+$st_many = <|a: "one", b: "two", c: "three", d: "four"|>;
+$st_single = <|a: "zero"|>;
+$st_empty = <||>;
+$tup = AsTuple("first", "second");
+
+$concat = ($item, $state) -> { return $state || $item; };
+$start = ($value) -> { return "(" || $value || ")"; };
+
+SELECT
+ StaticFold($st_many, "->", $concat),
+ StaticFold($st_single, "->", $concat),
+ CAST(StaticFold($st_empty, "->", $concat) AS Optional<String>),
+ StaticFold($tup, "->", $concat);
+
+SELECT
+ StaticFold1($st_many, $start, $concat),
+ StaticFold1($st_single, $start, $concat),
+ CAST(StaticFold1($st_empty, $start, $concat) AS Optional<String>),
+ StaticFold1($tup, $start, $concat); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/static_zip.sql b/yql/essentials/tests/sql/suites/expr/static_zip.sql
new file mode 100644
index 0000000000..8cbb9856e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/static_zip.sql
@@ -0,0 +1,20 @@
+/* postgres can not */
+/* syntax version 1 */
+
+$s1 = AsStruct(1 as k1, "2" as k2, ["3", "4"] as k3);
+$s2 = AsStruct("10" as k1, [20, 30] as k2, 40 as k3);
+$s3 = AsStruct([100, 200] as k1, 300 as k2, "400" as k3);
+
+
+$t1 = AsTuple(1, "2", ["3", "4"]);
+$t2 = AsTuple("10", [20, 30], 40);
+$t3 = AsTuple([100, 200], 300, "400");
+
+SELECT
+ StaticZip($s1, $s2, $s3) as structs,
+ StaticZip($t1, $t2, $t3) as tuples,
+ StaticZip(AsStruct(), AsStruct()) as empty_structs,
+ StaticZip(AsTuple(), AsTuple()) as empty_tuples,
+ StaticZip($s1) as single_struct,
+ StaticZip($t1) as single_tuple,
+;
diff --git a/yql/essentials/tests/sql/suites/expr/struct_builtins.sql b/yql/essentials/tests/sql/suites/expr/struct_builtins.sql
new file mode 100644
index 0000000000..eac0098fa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_builtins.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* kikimr can not */
+/* syntax version 1 */
+$ad = AsStruct(1 AS a, 4 AS d);
+$b = AsStruct(2 AS b);
+$c_name = 'c';
+SELECT
+ TryMember($ad, $c_name, "foo") AS c,
+ TryMember($ad, "d", NULL) AS d,
+ AddMember($ad, $c_name, 3) AS acd,
+ ReplaceMember($ad, "a", 5) AS a5,
+ RemoveMember($ad, 'd') AS a,
+ ForceRemoveMember($ad, $c_name) AS ad,
+ ExpandStruct($b, 1 AS a) AS ab,
+ CombineMembers($ad, $b) AS abd,
+ FlattenMembers(AsTuple("fo" || "o", $ad), AsTuple("bar", $b)) AS foobar;
diff --git a/yql/essentials/tests/sql/suites/expr/struct_gather_spread.sql b/yql/essentials/tests/sql/suites/expr/struct_gather_spread.sql
new file mode 100644
index 0000000000..0054d0bc25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_gather_spread.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+/* syntax version 1 */
+select
+ StructMembers(<|a:1|>),
+ StructMembers(Just(<|a:1|>)),
+ StructMembers(null),
+
+ GatherMembers(<||>),
+ GatherMembers(<|a:1,b:2|>),
+ GatherMembers(Just(<|a:1,b:2|>)),
+ GatherMembers(null),
+
+ RenameMembers(<|a:1,c:2|>,[("a","b")]),
+ RenameMembers(<|a:1,c:2|>,[("a","b"),("a","d")]),
+ ForceRenameMembers(<|a:1,c:2|>,[("a","b")]),
+ ForceRenameMembers(<|a:1,c:2|>,[("d","d")]),
+ RenameMembers(Just(<|a:1,c:2|>),[("a","b")]),
+ RenameMembers(null,[("a","b")]),
+
+ SpreadMembers([("a",1)],["a","b"]),
+ SpreadMembers([("a",1),("b",2)],["a","b"]),
+ SpreadMembers([("a",Just(1))],["a","b"]),
+ SpreadMembers([("a",1),("a",2)],["a","b"]),
+ SpreadMembers([],["a","b"]),
+
+ SpreadMembers(Just([("a",1)]),["a","b"]),
+ SpreadMembers(null,["a","b"]),
+ ForceSpreadMembers([("a",1)],["a","b"]),
+ ForceSpreadMembers([("c",1)],["a","b"]);
diff --git a/yql/essentials/tests/sql/suites/expr/struct_literal.cfg b/yql/essentials/tests/sql/suites/expr/struct_literal.cfg
new file mode 100644
index 0000000000..f75b50116d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_literal.cfg
@@ -0,0 +1,2 @@
+udf string_udf
+
diff --git a/yql/essentials/tests/sql/suites/expr/struct_literal.sql b/yql/essentials/tests/sql/suites/expr/struct_literal.sql
new file mode 100644
index 0000000000..ba0c96cf81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_literal.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+select <||>, <|,|>, <|
+ CAST(Unicode::ToUpper("a"u) AS String):Unicode::ToUpper("b"u),
+ c:false,
+ "e":7,
+ `g`:2.0,
+ |>
diff --git a/yql/essentials/tests/sql/suites/expr/struct_literal_bind.sql b/yql/essentials/tests/sql/suites/expr/struct_literal_bind.sql
new file mode 100644
index 0000000000..e9111dce01
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_literal_bind.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$s = <| x:1, y:"2" |>;
+
+select $s;
diff --git a/yql/essentials/tests/sql/suites/expr/struct_literal_members.sql b/yql/essentials/tests/sql/suites/expr/struct_literal_members.sql
new file mode 100644
index 0000000000..174ccacc40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_literal_members.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+$list = YQL::@@
+(AddMember (AddMember (Struct) 'query (String 'QUERY)) 'result (String 'RESULT))
+@@;
+select $list.query as query, $list.result as result;
diff --git a/yql/essentials/tests/sql/suites/expr/struct_merge.sql b/yql/essentials/tests/sql/suites/expr/struct_merge.sql
new file mode 100644
index 0000000000..3b6fad5e81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_merge.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+
+$merge = ($_name, $l, $r) -> { return Coalesce($l, 0) + Coalesce($r, 0); };
+$left = <|a: 1, b: 2, c: 3|>;
+$right = <|c: 1, d: 2, e: 3|>;
+
+SELECT
+ StructUnion($left, $right),
+ StructUnion($left, $right, $merge),
+ StructIntersection($left, $right),
+ StructIntersection($left, $right, $merge),
+ StructDifference($left, $right),
+ StructSymmetricDifference($left, $right)
+;
diff --git a/yql/essentials/tests/sql/suites/expr/struct_slice.sql b/yql/essentials/tests/sql/suites/expr/struct_slice.sql
new file mode 100644
index 0000000000..dd7d418850
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/struct_slice.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+$s = <| a:1, b:2, c:3, d:4 |>;
+$list = ["a", "b"];
+select * from (select CombineMembers(
+ ChooseMembers($s, $list),
+ <| remain : RemoveMembers($s, $list) |>
+ )) flatten columns;
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/expr/tagged_runtime.sql b/yql/essentials/tests/sql/suites/expr/tagged_runtime.sql
new file mode 100644
index 0000000000..8d185b767e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/tagged_runtime.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+use plato;
+insert into @tmp
+select Just((
+ AsTagged(1,"A"),
+ AsTagged(just(2),"B"),
+ AsTagged(null,"C"),
+ AsTagged(Nothing(Int32?),"D"),
+ AsTagged(Nothing(pgint4?),"E")
+ )) as x;
+commit;
+select x.0, x.1, x.2, x.3, x.4 from @tmp
diff --git a/yql/essentials/tests/sql/suites/expr/to_dict_from_nothing.sql b/yql/essentials/tests/sql/suites/expr/to_dict_from_nothing.sql
new file mode 100644
index 0000000000..20b61dd510
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_dict_from_nothing.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT ToSet(Nothing(List<Uint8>?));
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_dict_dict_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_dict_key.sql
new file mode 100644
index 0000000000..0c74dc8dd1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_dict_key.sql
@@ -0,0 +1,40 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$i = AsDict(AsTuple(1,"A"),AsTuple(2,"B"));
+$j = AsDict(AsTuple(1,"A"),AsTuple(2,"C"));
+$k = AsDict(AsTuple(1,"A"),AsTuple(2,"D"));
+
+$l = AsList(
+ AsTuple($i,"foo"),
+ AsTuple($i,"bar"),
+ AsTuple($j,"baz")
+);
+
+$d = ToDict($l);
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return ListMap(DictItems($x.0), ($y) -> {return ($y, $x.1)})}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ ListSort(DictPayloads($d));
+select DictLookup($d,$i), DictLookup($d,$k);
+select DictContains($d,$i), DictContains($d,$k);
+
+$d = ToMultiDict($l);
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return ListMap(DictItems($x.0), ($y) -> {return ($y, $x.1)})}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ ListSort(DictPayloads($d));
+select DictLookup($d,$i), DictLookup($d,$k);
+select DictContains($d,$i), DictContains($d,$k);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return ListMap(DictItems($x.0), ($y) -> {return ($y, $x.1)})}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ ListSort(DictPayloads($d));
+select DictLookup($d,$i), DictLookup($d,$k);
+select DictContains($d,$i), DictContains($d,$k);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return ListMap(DictItems($x.0), ($y) -> {return ($y, $x.1)})}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ ListSort(DictPayloads($d));
+select DictLookup($d,$i), DictLookup($d,$k);
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_dict_list_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_list_key.sql
new file mode 100644
index 0000000000..024849b8cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_list_key.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$l = AsList(
+ AsTuple(AsList(1,2,3),"foo"),
+ AsTuple(AsList(1,2),"bar"),
+ AsTuple(AsList(1,2),"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_dict_tuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_tuple_key.sql
new file mode 100644
index 0000000000..77751c1c97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_tuple_key.sql
@@ -0,0 +1,81 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$l = AsList(
+ AsTuple(AsTuple(),"foo"),
+ AsTuple(AsTuple(),"bar"),
+ AsTuple(AsTuple(),"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$l = AsList(
+ AsTuple(AsTuple(1),"foo"),
+ AsTuple(AsTuple(2),"bar"),
+ AsTuple(AsTuple(2),"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$l = AsList(
+ AsTuple(AsTuple(1,2),"foo"),
+ AsTuple(AsTuple(1,3),"bar"),
+ AsTuple(AsTuple(1,3),"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_dict_varstruct_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_varstruct_key.sql
new file mode 100644
index 0000000000..fe80aed5a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_varstruct_key.sql
@@ -0,0 +1,34 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$vt = ParseType("Variant<a:Int32,b:Uint32>");
+$v1 = Variant(1,"a",$vt);
+$v2 = Variant(2u,"b",$vt);
+$v3 = Variant(2,"a",$vt);
+
+$l = AsList(
+ AsTuple($v1,"foo"),
+ AsTuple($v2,"bar"),
+ AsTuple($v2,"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_dict_vartuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_vartuple_key.sql
new file mode 100644
index 0000000000..1d2c656ebf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_dict_vartuple_key.sql
@@ -0,0 +1,34 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$vt = ParseType("Variant<Int32,Uint32>");
+$v1 = Variant(1,"0",$vt);
+$v2 = Variant(2u,"1",$vt);
+$v3 = Variant(2,"0",$vt);
+
+$l = AsList(
+ AsTuple($v1,"foo"),
+ AsTuple($v2,"bar"),
+ AsTuple($v2,"baz")
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = ToMultiDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("Many")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_set_dict_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_set_dict_key.sql
new file mode 100644
index 0000000000..7bd22f103d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_set_dict_key.sql
@@ -0,0 +1,28 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$i = AsDict(AsTuple(1,"A"),AsTuple(2,"B"));
+$j = AsDict(AsTuple(1,"A"),AsTuple(2,"C"));
+$k = AsDict(AsTuple(1,"A"),AsTuple(2,"D"));
+
+$l = AsList(
+ AsTuple($i,Void()),
+ AsTuple($i,Void()),
+ AsTuple($j,Void())
+);
+
+$d = ToDict($l);
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return DictItems($x.0)}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ DictPayloads($d);
+select DictLookup($d,$i), DictLookup($d,$k);
+select DictContains($d,$i), DictContains($d,$k);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(ListFlatten(ListMap(DictItems($d), ($x) -> {return DictItems($x.0)}))),
+ ListSort(ListFlatten(ListMap(DictKeys($d), ($x) -> {return DictItems($x)}))),
+ DictPayloads($d);
+select DictLookup($d,$i), DictLookup($d,$k);
+select DictContains($d,$i), DictContains($d,$k);
+
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_set_list_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_set_list_key.sql
new file mode 100644
index 0000000000..d511f0a88e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_set_list_key.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$l = AsList(
+ AsTuple(AsList(1,2,3),Void()),
+ AsTuple(AsList(1,2),Void()),
+ AsTuple(AsList(1,2),Void())
+);
+
+$d = ToDict($l);
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select DictKeys($d),DictPayloads($d),DictItems($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_set_tuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_set_tuple_key.sql
new file mode 100644
index 0000000000..4d722ca487
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_set_tuple_key.sql
@@ -0,0 +1,52 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$l = AsList(
+ AsTuple(AsTuple(),Void()),
+ AsTuple(AsTuple(),Void()),
+ AsTuple(AsTuple(),Void())
+);
+
+$d = ToDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$l = AsList(
+ AsTuple(AsTuple(1),Void()),
+ AsTuple(AsTuple(2),Void()),
+ AsTuple(AsTuple(2),Void())
+);
+
+$d = ToDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$l = AsList(
+ AsTuple(AsTuple(1,2),Void()),
+ AsTuple(AsTuple(1,3),Void()),
+ AsTuple(AsTuple(1,3),Void())
+);
+
+$d = ToDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_set_varstruct_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_set_varstruct_key.sql
new file mode 100644
index 0000000000..9588c5719f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_set_varstruct_key.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$vt = ParseType("Variant<a:Int32,b:Uint32>");
+$v1 = Variant(1,"a",$vt);
+$v2 = Variant(2u,"b",$vt);
+$v3 = Variant(2,"a",$vt);
+
+$l = AsList(
+ AsTuple($v1,Void()),
+ AsTuple($v2,Void()),
+ AsTuple($v2,Void())
+);
+
+$d = ToDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/to_hashed_set_vartuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_hashed_set_vartuple_key.sql
new file mode 100644
index 0000000000..e769b4f849
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_hashed_set_vartuple_key.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+$first = ($x)->{return $x.0};
+$second = ($x)->{return $x.1};
+
+$vt = ParseType("Variant<Int32,Uint32>");
+$v1 = Variant(1,"0",$vt);
+$v2 = Variant(2u,"1",$vt);
+$v3 = Variant(2,"0",$vt);
+
+$l = AsList(
+ AsTuple($v1,Void()),
+ AsTuple($v2,Void()),
+ AsTuple($v2,Void())
+);
+
+$d = ToDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = Yql::ToDict($l,$first,$second,AsTuple(AsAtom("Compact"),AsAtom("Hashed"),AsAtom("One")));
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_dict_list_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_list_key.sql
new file mode 100644
index 0000000000..d1a477381f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_list_key.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+$l = AsList(
+ AsTuple(AsList(1,2,3),"foo"),
+ AsTuple(AsList(1,2),"bar"),
+ AsTuple(AsList(1,2),"baz")
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),DictKeys($d),DictPayloads($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
+
+$d = ToSortedMultiDict($l);
+select ListSort(DictItems($d)),DictKeys($d),DictPayloads($d);
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_dict_tuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_tuple_key.sql
new file mode 100644
index 0000000000..c7ab81172e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_tuple_key.sql
@@ -0,0 +1,50 @@
+/* postgres can not */
+
+$l = AsList(
+ AsTuple(AsTuple(),"foo"),
+ AsTuple(AsTuple(),"bar"),
+ AsTuple(AsTuple(),"baz")
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$d = ToSortedMultiDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$l = AsList(
+ AsTuple(AsTuple(1),"foo"),
+ AsTuple(AsTuple(2),"bar"),
+ AsTuple(AsTuple(2),"baz")
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$d = ToSortedMultiDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$l = AsList(
+ AsTuple(AsTuple(1,2),"foo"),
+ AsTuple(AsTuple(1,3),"bar"),
+ AsTuple(AsTuple(1,3),"baz")
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
+$d = ToSortedMultiDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_dict_vartuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_vartuple_key.sql
new file mode 100644
index 0000000000..3581c0963d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_dict_vartuple_key.sql
@@ -0,0 +1,20 @@
+/* postgres can not */
+$vt = ParseType("Variant<Int32,Uint32>");
+$v1 = Variant(1,"0",$vt);
+$v2 = Variant(2u,"1",$vt);
+$v3 = Variant(2,"0",$vt);
+
+$l = AsList(
+ AsTuple($v1,"foo"),
+ AsTuple($v2,"bar"),
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
+
+$d = ToSortedMultiDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_set_list_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_set_list_key.sql
new file mode 100644
index 0000000000..323d74f550
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_set_list_key.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+
+$l = AsList(
+ AsTuple(AsList(1,2,3),Void()),
+ AsTuple(AsList(1,2),Void()),
+ AsTuple(AsList(1,2),Void())
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsList(1,2)), DictLookup($d,AsList(1,3));
+select DictContains($d,AsList(1,2)), DictContains($d,AsList(1,3));
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_set_tuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_set_tuple_key.sql
new file mode 100644
index 0000000000..792ac74533
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_set_tuple_key.sql
@@ -0,0 +1,35 @@
+/* postgres can not */
+
+$l = AsList(
+ AsTuple(AsTuple(),Void()),
+ AsTuple(AsTuple(),Void()),
+ AsTuple(AsTuple(),Void())
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple());
+select DictContains($d,AsTuple());
+
+$l = AsList(
+ AsTuple(AsTuple(1),Void()),
+ AsTuple(AsTuple(2),Void()),
+ AsTuple(AsTuple(2),Void())
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(2)), DictLookup($d,AsTuple(3));
+select DictContains($d,AsTuple(2)), DictContains($d,AsTuple(3));
+
+$l = AsList(
+ AsTuple(AsTuple(1,2),Void()),
+ AsTuple(AsTuple(1,3),Void()),
+ AsTuple(AsTuple(1,3),Void())
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,AsTuple(1,2)), DictLookup($d,AsTuple(1,4));
+select DictContains($d,AsTuple(1,2)), DictContains($d,AsTuple(1,4));
+
diff --git a/yql/essentials/tests/sql/suites/expr/to_sorted_set_vartuple_key.sql b/yql/essentials/tests/sql/suites/expr/to_sorted_set_vartuple_key.sql
new file mode 100644
index 0000000000..04e42b7cd3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/to_sorted_set_vartuple_key.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+$vt = ParseType("Variant<Int32,Uint32>");
+$v1 = Variant(1,"0",$vt);
+$v2 = Variant(2u,"1",$vt);
+$v3 = Variant(2,"0",$vt);
+
+$l = AsList(
+ AsTuple($v1,Void()),
+ AsTuple($v2,Void()),
+);
+
+$d = ToSortedDict($l);
+select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
+select DictLookup($d,$v1), DictLookup($d,$v3);
+select DictContains($d,$v1), DictContains($d,$v3);
diff --git a/yql/essentials/tests/sql/suites/expr/try_member.cfg b/yql/essentials/tests/sql/suites/expr/try_member.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/try_member.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/expr/try_member.sql b/yql/essentials/tests/sql/suites/expr/try_member.sql
new file mode 100644
index 0000000000..c543b523c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/try_member.sql
@@ -0,0 +1,53 @@
+/* postgres can not */
+/* syntax version 1 */
+/* yt can not */
+
+$s = <|a:1, b:2u/1u, c:Just(Just(1))|>;
+$js = Just($s);
+$es = Nothing(Struct<a:Int32, b:Uint32?, c:Int32??>?);
+
+-- result of TryMember() when member is not present is third argument
+-- (optional third arg if struct is optional, but third arg is not)
+select
+ TryMember($s, "z", 'qqq'),
+ TryMember($js, "z", null),
+ TryMember($es, "z", Just(Just('qqq'))),
+ TryMember($js, "z", 'zzz'),
+;
+
+
+-- fully equivalent to <struct>.<name>
+select
+ TryMember($s, "a", null),
+ TryMember($s, "b", null),
+ TryMember($s, "c", null),
+
+ TryMember($js, "a", null),
+ TryMember($js, "b", null),
+ TryMember($js, "c", null),
+
+ TryMember($es, "a", null),
+ TryMember($es, "b", null),
+ TryMember($es, "c", null),
+;
+
+-- TypeOf TryMember is type of third argument
+-- field type should either match third type exactly, or (if the third type is optional)
+-- Optional(field) should be equal to third type
+select
+ TryMember($s, "a", 999),
+ TryMember($s, "a", Just(999)),
+ TryMember($s, "b", Just(999u)),
+ TryMember($s, "c", Just(Just(999))),
+
+ TryMember($js, "a", 999),
+ TryMember($js, "a", Just(999)),
+ TryMember($js, "b", Just(999u)),
+ TryMember($js, "c", Just(Just(999))),
+
+ TryMember($es, "a", 999),
+ TryMember($es, "a", Just(999)),
+ TryMember($es, "b", Just(999u)),
+ TryMember($es, "c", Just(Just(999))),
+;
+
diff --git a/yql/essentials/tests/sql/suites/expr/type_as_key.sql b/yql/essentials/tests/sql/suites/expr/type_as_key.sql
new file mode 100644
index 0000000000..340489684b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/type_as_key.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select a.int32 from (select 1 as `int32`) as a
diff --git a/yql/essentials/tests/sql/suites/expr/tzdate_result.sql b/yql/essentials/tests/sql/suites/expr/tzdate_result.sql
new file mode 100644
index 0000000000..e152e43d04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/tzdate_result.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+$parse = DateTime::Parse("%Y-%m-%d,%Z");
+
+$date_string = '2020-05-30,Europe/Moscow';
+$date = $parse($date_string);
+
+select
+DateTime::MakeTzDate($date),
+DateTime::MakeTzDatetime($date);
+
+select EvaluateExpr(DateTime::MakeTzDate($date));
+
+$parse = DateTime::Parse("%Y-%m-%d,%Z");
+
+$date_string = '2020-05-30,America/Los_Angeles';
+$date = $parse($date_string);
+
+select
+DateTime::MakeTzDate($date),
+DateTime::MakeTzDatetime($date);
+
+select EvaluateExpr(DateTime::MakeTzDate($date));
diff --git a/yql/essentials/tests/sql/suites/expr/udaf_with_list_zip.sql b/yql/essentials/tests/sql/suites/expr/udaf_with_list_zip.sql
new file mode 100644
index 0000000000..c481de24b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/udaf_with_list_zip.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+$lists_2sum = ($l1, $l2) -> (
+ ListMap(ListZip($l1, $l2), ($x) -> ($x.0 + $x.1))
+);
+
+$perelement_sum = AGGREGATION_FACTORY(
+ "UDAF",
+ ($item, $_parent) -> ( $item ),
+ ($state, $item, $_parent) -> ( $lists_2sum($state, $item) ),
+ ($state1, $state2) -> ( $lists_2sum($state1, $state2) )
+);
+
+SELECT
+ AGGREGATE_BY(list_col, $perelement_sum) AS cnt1,
+FROM AS_TABLE([
+<|"list_col" : [4, 5, 6]|>,
+<|"list_col" : [4, 5, 6]|>,
+<|"list_col" : [4, 5, 6]|>,
+<|"list_col" : [4, 5, 6]|>,
+<|"list_col" : [4, 5, 6]|>,
+<|"list_col" : [4, 5, 6]|>
+]);
diff --git a/yql/essentials/tests/sql/suites/expr/unicode_literals.sql b/yql/essentials/tests/sql/suites/expr/unicode_literals.sql
new file mode 100644
index 0000000000..1910693fa8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/unicode_literals.sql
@@ -0,0 +1,22 @@
+pragma WarnUntypedStringLiterals;
+pragma UnicodeLiterals;
+$f = ()->{
+ return (
+ "a"s,
+ "b"u,
+ "c");
+};
+
+select $f();
+
+pragma DisableWarnUntypedStringLiterals;
+pragma DisableUnicodeLiterals;
+$g = ()->{
+ return (
+ "a"s,
+ "b"u,
+ "c");
+};
+
+select $g();
+
diff --git a/yql/essentials/tests/sql/suites/expr/untag.sql b/yql/essentials/tests/sql/suites/expr/untag.sql
new file mode 100644
index 0000000000..52b2b85f2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/untag.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select
+ Untag(AsTagged(1,'a'),'a'),
+ Untag(Just(AsTagged(1,'a')),'a'),
+ Untag(Nothing(Tagged<Int32,'a'>?),'a'),
+ Untag(NULL,'a');
+
diff --git a/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.cfg b/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.sql b/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.sql
new file mode 100644
index 0000000000..64c87cd8dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/unwrap_runtime_fail.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select Unwrap(null, "message");
diff --git a/yql/essentials/tests/sql/suites/expr/uuid.sql b/yql/essentials/tests/sql/suites/expr/uuid.sql
new file mode 100644
index 0000000000..1edc7dd19a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/uuid.sql
@@ -0,0 +1,10 @@
+select Uuid('550e8400-e29b-41d4-a716-446655440000');
+select cast('550e8400-e29b-41d4-a716-446655440000' as Uuid);
+select cast(cast('550e8400-e29b-41d4-a716-446655440000' as Uuid) as varchar);
+select cast(cast('550e8400-e29b-41d4-a716-446655440000' as Uuid) as varchar) = '550e8400-e29b-41d4-a716-446655440000';
+select Uuid('550e8400-e29b-41d4-a716-446655440000') = cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
+select Uuid('550e8400-e29b-41d4-a716-446655440000') < cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
+select Uuid('550e8400-e29b-41d4-a716-446655440000') <= cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
+select Uuid('550e8400-e29b-41d4-a716-446655440000') > cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
+select Uuid('550e8400-e29b-41d4-a716-446655440000') >= cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
+select Uuid('550e8400-e29b-41d4-a716-446655440000') != cast('550e8400-e29b-41d4-a716-446655440000' as uuid);
diff --git a/yql/essentials/tests/sql/suites/expr/uuid_order.sql b/yql/essentials/tests/sql/suites/expr/uuid_order.sql
new file mode 100644
index 0000000000..d11539d077
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/uuid_order.sql
@@ -0,0 +1,36 @@
+/* postgres can not */
+select * from (
+select 1 as a,Uuid('00000000-0000-0000-0000-000000000000') as x
+union all
+select 2 as a,Uuid('01000000-0000-0000-0000-000000000000') as x
+union all
+select 3 as a,Uuid('00010000-0000-0000-0000-000000000000') as x
+union all
+select 4 as a,Uuid('00000100-0000-0000-0000-000000000000') as x
+union all
+select 5 as a,Uuid('00000001-0000-0000-0000-000000000000') as x
+union all
+select 6 as a,Uuid('00000000-0100-0000-0000-000000000000') as x
+union all
+select 7 as a,Uuid('00000000-0001-0000-0000-000000000000') as x
+union all
+select 8 as a,Uuid('00000000-0000-0100-0000-000000000000') as x
+union all
+select 9 as a,Uuid('00000000-0000-0001-0000-000000000000') as x
+union all
+select 10 as a,Uuid('00000000-0000-0000-0100-000000000000') as x
+union all
+select 11 as a,Uuid('00000000-0000-0000-0001-000000000000') as x
+union all
+select 12 as a,Uuid('00000000-0000-0000-0000-010000000000') as x
+union all
+select 13 as a,Uuid('00000000-0000-0000-0000-000100000000') as x
+union all
+select 14 as a,Uuid('00000000-0000-0000-0000-000001000000') as x
+union all
+select 15 as a,Uuid('00000000-0000-0000-0000-000000010000') as x
+union all
+select 16 as a,Uuid('00000000-0000-0000-0000-000000000100') as x
+union all
+select 17 as a,Uuid('00000000-0000-0000-0000-000000000001') as x
+) as s order by x;
diff --git a/yql/essentials/tests/sql/suites/expr/variant_list_sort.sql b/yql/essentials/tests/sql/suites/expr/variant_list_sort.sql
new file mode 100644
index 0000000000..a8128a4c48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/variant_list_sort.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$list = [AsVariant(1, "int"),AsVariant(1.f, "float"),AsVariant(1.0, "double"),AsVariant(1u, "unsigned")];
+SELECT ListSortAsc($list) AS asc, ListSortDesc($list) AS desc;
diff --git a/yql/essentials/tests/sql/suites/expr/variant_struct_comp.sql b/yql/essentials/tests/sql/suites/expr/variant_struct_comp.sql
new file mode 100644
index 0000000000..f7eb33dc84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/variant_struct_comp.sql
@@ -0,0 +1,63 @@
+/* postgres can not */
+$id = ($x)->{
+ $f = Yql::Callable(CallableType(0, TypeOf($x)), ()->{return $x});
+ return $f();
+};
+
+$vt1 = ParseType("Variant<a:Int32,b:Uint32?>");
+$vt2 = ParseType("Variant<b:Int64,c:Uint32>");
+
+select AsTuple(
+ Variant(1,"a",$vt1) == Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) == Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) == Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) == Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) == Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) == Variant($id(1u),"b",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"a",$vt1) != Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) != Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) != Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) != Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) != Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) != Variant($id(1u),"b",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"a",$vt1) < Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) < Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) < Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) < Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) < Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) < Variant($id(1u),"b",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"a",$vt1) <= Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) <= Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) <= Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) <= Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) <= Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) <= Variant($id(1u),"b",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"a",$vt1) > Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) > Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) > Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) > Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) > Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) > Variant($id(1u),"b",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"a",$vt1) >= Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) >= Variant($id(1u),"b",$vt2),
+ Variant(1,"b",$vt1) >= Variant($id(2u),"b",$vt2),
+ Variant(1,"b",$vt1) >= Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) >= Variant($id(1u),"c",$vt2),
+ Variant(1u/0u,"b",$vt1) >= Variant($id(1u),"b",$vt2)
+);
+
diff --git a/yql/essentials/tests/sql/suites/expr/variant_tuple_comp.sql b/yql/essentials/tests/sql/suites/expr/variant_tuple_comp.sql
new file mode 100644
index 0000000000..c6e9d072ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/variant_tuple_comp.sql
@@ -0,0 +1,74 @@
+/* postgres can not */
+$id = ($x)->{
+ $f = Yql::Callable(CallableType(0, TypeOf($x)), ()->{return $x});
+ return $f();
+};
+
+$vt1 = ParseType("Variant<Int32,Uint32?>");
+$vt2 = ParseType("Variant<Int64,Uint32>");
+
+select AsTuple(
+ Variant(1,"0",$vt1) < Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) < Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) < Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) < Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) < Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) < Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) < Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) < Variant(1u,"1",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"0",$vt1) <= Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) <= Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) <= Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) <= Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) <= Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) <= Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) <= Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) <= Variant(1u,"1",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"0",$vt1) == Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) == Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) == Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) == Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) == Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) == Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) == Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) == Variant(1u,"1",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"0",$vt1) != Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) != Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) != Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) != Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) != Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) != Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) != Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) != Variant(1u,"1",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"0",$vt1) > Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) > Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) > Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) > Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) > Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) > Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) > Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) > Variant(1u,"1",$vt2)
+);
+
+select AsTuple(
+ Variant(1,"0",$vt1) >= Variant($id(1u),"0",$vt2),
+ Variant(1,"0",$vt1) >= Variant(2u,"0",$vt2),
+ Variant(1,"0",$vt1) >= Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) >= Variant($id(1u),"1",$vt2),
+ Variant(1,"1",$vt1) >= Variant(2u,"1",$vt2),
+ Variant(2,"1",$vt1) >= Variant(1u,"1",$vt2),
+ Variant(1,"1",$vt1) >= Variant($id(1u),"0",$vt2),
+ Variant(2u/0u,"1",$vt1) >= Variant(1u,"1",$vt2)
+);
diff --git a/yql/essentials/tests/sql/suites/expr/with_optional_args.sql b/yql/essentials/tests/sql/suites/expr/with_optional_args.sql
new file mode 100644
index 0000000000..5fe5dc6813
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/with_optional_args.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$f = Yql::WithOptionalArgs(($x,$y,$z)->($x + ($y ?? 0) + ($z ?? 0)), AsAtom("2"));
+select $f(1),$f(2,3),$f(4,5,6),
+ Yql::NamedApply($f,(1,),<||>),
+ Yql::NamedApply($f,(1,2),<||>),
+ Yql::NamedApply($f,(1,2,3),<||>),
+ Yql::NamedApply($f,(1,2,3,4),<||>);
diff --git a/yql/essentials/tests/sql/suites/expr/xor.sql b/yql/essentials/tests/sql/suites/expr/xor.sql
new file mode 100644
index 0000000000..3799af4276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/xor.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+SELECT
+ o1 XOR o2 AS xor,
+ o1 XOR o1 AS xor_same_o1,
+ o2 XOR o2 AS xor_same_o2,
+ o1 XOR o2 XOR o1 XOR o2 XOR o1 XOR o2 AS xor_triple_dups,
+ o1 XOR o2 XOR Unwrap(o1) XOR Unwrap(o2) AS xor_with_unwraps,
+FROM AS_TABLE([
+ <|o1: FALSE, o2: FALSE|>,
+ <|o1: TRUE, o2: TRUE|>,
+ <|o1: TRUE, o2: FALSE|>,
+ <|o1: FALSE, o2: TRUE|>,
+ <|o1: TRUE, o2: NULL|>,
+ <|o1: FALSE, o2: NULL|>,
+ <|o1: NULL, o2: TRUE|>,
+ <|o1: NULL, o2: FALSE|>
+]);
diff --git a/yql/essentials/tests/sql/suites/expr/yql-10180.sql b/yql/essentials/tests/sql/suites/expr/yql-10180.sql
new file mode 100644
index 0000000000..9fa1d68e31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/yql-10180.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+USE plato;
+
+$logs_path = "//logs/antirobot-daemon-log2/1d";
+$results_path = "//home/antispam/antirobot/sharding_daily";
+$logs_per_run = 10;
+
+DEFINE SUBQUERY $last_tables($path, $limit) AS
+ SELECT AGGREGATE_LIST(Name)
+ FROM (
+ SELECT ListLast(String::SplitToList(Path, "/")) as Name
+ FROM FOLDER($path)
+ WHERE Type = "table"
+ ORDER BY Name DESC
+ LIMIT $limit
+ )
+END DEFINE;
+
+
+$logs = (SELECT * FROM $last_tables($logs_path, $logs_per_run));
+$processed_logs = (SELECT * FROM $last_tables($results_path, $logs_per_run));
+
+SELECT SetDifference(ToSet($logs), ToSet($processed_logs))
diff --git a/yql/essentials/tests/sql/suites/expr/yql-15485.sql b/yql/essentials/tests/sql/suites/expr/yql-15485.sql
new file mode 100644
index 0000000000..b93cdc8e7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/expr/yql-15485.sql
@@ -0,0 +1,86 @@
+/* syntax version 1 */
+/* postgres can not */
+$ages = [
+ <|suffix: "0-0.5"u, begin: 0.f, end: 0.5f|>,
+ <|suffix: "0.5-1"u, begin: 0.5f, end: 1.f|>,
+ <|suffix: "1-3"u , begin: 1.f, end: 3.f|>,
+ <|suffix: "3-5"u , begin: 3.f, end: 5.f|>,
+ <|suffix: "5-7"u , begin: 5.f, end: 7.f|>,
+ <|suffix: "7-9"u , begin: 7.f, end: 9.f|>,
+ <|suffix: "9-12"u , begin: 9.f, end: 12.f|>,
+ <|suffix: "12-14"u, begin: 12.f, end: 14.f|>,
+ <|suffix: "14-16"u, begin: 14.f, end: 16.f|>,
+ <|suffix: "16+"u , begin: 16.f, end: 18.f|>,
+];
+
+$interval_fits_in = ($interval, $other) -> {
+ $length = $interval.end - $interval.begin;
+ RETURN IF(
+ $interval.end <= $other.begin OR $interval.begin >= $other.end,
+ 0.f,
+ IF(
+ $interval.begin >= $other.begin AND $interval.end <= $other.end, -- interval is completely within other
+ 1.f,
+ IF(
+ $interval.begin <= $other.begin AND $interval.end >= $other.end, -- other is completely within the interval
+ ($other.end - $other.begin) / $length,
+ IF(
+ $interval.begin < $other.begin,
+ ($interval.end - $other.begin) / $length,
+ ($other.end - $interval.begin) / $length
+ )
+ )
+ )
+ );
+};
+
+$age_suffixes = ($interval, $age_segments) -> {
+ RETURN IF(
+ $interval.end - $interval.begin > 10.f OR $interval.end - $interval.begin < 1e-4f,
+ [NULL],
+ ListFilter(
+ ListMap(
+ $age_segments,
+ ($i) -> {
+ RETURN <|age_suffix: ":Age:"u || $i.suffix, age_weight: $interval_fits_in($interval, $i)|>
+ }
+ ),
+ ($i) -> {
+ RETURN $i.age_weight > 1e-4f;
+ }
+ )
+ );
+};
+
+$data = (
+ SELECT
+ *
+ FROM
+ (
+ SELECT
+ puid,
+ ts,
+ boys ?? False AS boys,
+ girls ?? False AS girls,
+ min_age ?? 0.f AS min_age,
+ max_age ?? 18.f AS max_age
+ FROM
+
+ AS_TABLE([
+ <|puid: 1, ts: 123, boys: True, girls: False, min_age: 1.f, max_age: 2.f|>,
+ <|puid: 2, ts: 123, boys: True, girls: False, min_age: NULL, max_age: NULL|>,
+ <|puid: 3, ts: 123, boys: NULL, girls: NULL, min_age: 1.f, max_age: 2.f|>,
+ <|puid: 4, ts: 123, boys: True, girls: True, min_age: 1.f, max_age: 2.f|>,
+ <|puid: 5, ts: 123, boys: True, girls: True, min_age: 1.f, max_age: 5.f|>,
+ <|puid: 6, ts: 123, boys: True, girls: False, min_age: 1.f, max_age: 2.f|>,
+ ])
+
+ )
+ WHERE boys OR girls OR min_age > 0.f OR max_age < 18.f
+);
+
+SELECT
+ puid,
+ $age_suffixes(<|begin: min_age, end: max_age|>, $ages) AS age_suffixes,
+ <|begin: min_age, end: max_age|> as interval
+FROM $data;
diff --git a/yql/essentials/tests/sql/suites/file/bools.lst b/yql/essentials/tests/sql/suites/file/bools.lst
new file mode 100644
index 0000000000..f811fea266
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/bools.lst
@@ -0,0 +1,8 @@
+0
+1
+1
+false
+0
+1
+true
+0
diff --git a/yql/essentials/tests/sql/suites/file/file_constness.cfg b/yql/essentials/tests/sql/suites/file/file_constness.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_constness.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/file_constness.sql b/yql/essentials/tests/sql/suites/file/file_constness.sql
new file mode 100644
index 0000000000..b0adb1b5ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_constness.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+select key,
+ FileContent("keyid.lst") as content,
+ ListCollect(ParseFile('int32', "keyid.lst")) as content_list,
+from plato.Input group by key order by key;
diff --git a/yql/essentials/tests/sql/suites/file/file_list_bools.cfg b/yql/essentials/tests/sql/suites/file/file_list_bools.cfg
new file mode 100644
index 0000000000..b921413da2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_bools.cfg
@@ -0,0 +1,2 @@
+file bools.lst bools.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/file_list_bools.sql b/yql/essentials/tests/sql/suites/file/file_list_bools.sql
new file mode 100644
index 0000000000..40ef4be536
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_bools.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select ParseFile('bool', "bools.lst");
diff --git a/yql/essentials/tests/sql/suites/file/file_list_simple.cfg b/yql/essentials/tests/sql/suites/file/file_list_simple.cfg
new file mode 100644
index 0000000000..9756b704ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_simple.cfg
@@ -0,0 +1,4 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
+udf string_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/file_list_simple.sql b/yql/essentials/tests/sql/suites/file/file_list_simple.sql
new file mode 100644
index 0000000000..aabaacc753
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_simple.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+-- compiles to different code in v0/v1 due to different SplitToList settings
+select * from plato.Input where key in String::SplitToList(FileContent("keyid.lst"), "\n", true);
diff --git a/yql/essentials/tests/sql/suites/file/file_skip_take.cfg b/yql/essentials/tests/sql/suites/file/file_skip_take.cfg
new file mode 100644
index 0000000000..2397b1c376
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_skip_take.cfg
@@ -0,0 +1,2 @@
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/file_skip_take.sql b/yql/essentials/tests/sql/suites/file/file_skip_take.sql
new file mode 100644
index 0000000000..640db2185e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_skip_take.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+$file = ParseFile("String", "keyid.lst");
+
+$file = ListTake(ListSkip($file, 3ul), 2ul);
+
+$file = EvaluateExpr($file);
+
+select $file;
+
diff --git a/yql/essentials/tests/sql/suites/file/input_intersect.txt b/yql/essentials/tests/sql/suites/file/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/file/keyid.lst b/yql/essentials/tests/sql/suites/file/keyid.lst
new file mode 100644
index 0000000000..5c9644f627
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/keyid.lst
@@ -0,0 +1,7 @@
+911
+884
+350
+23
+150
+200
+250
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg
new file mode 100644
index 0000000000..a01a1a3d24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql
new file mode 100644
index 0000000000..2a47763852
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select ParseFile('uuid', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg
new file mode 100644
index 0000000000..0b503dd816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql
new file mode 100644
index 0000000000..ca58dc1af0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, cast(key as int32) ?? 0 in ParseFile('int32', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg
new file mode 100644
index 0000000000..0b503dd816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql
new file mode 100644
index 0000000000..47bf7969a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, key in ParseFile('string', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql
new file mode 100644
index 0000000000..2e1b948ef1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, cast(key as int32) in ParseFile('uint64', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg
new file mode 100644
index 0000000000..a3cc236d31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql
new file mode 100644
index 0000000000..10a2763a86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+$list = ParseFile("int32","keyid.lst");
+select ListExtend(
+ ListMap($list, ($x)->{return $x + 1 }),
+ ListMap($list, ($x)->{return $x + 2 })); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql
new file mode 100644
index 0000000000..12579fbf51
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where key in ParseFile('String', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql
new file mode 100644
index 0000000000..337a419ac5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where cast(key as Uint32) in ParseFile('uint32', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg
new file mode 100644
index 0000000000..9ad7c33313
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg
@@ -0,0 +1,4 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql
new file mode 100644
index 0000000000..aabaacc753
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+-- compiles to different code in v0/v1 due to different SplitToList settings
+select * from plato.Input where key in String::SplitToList(FileContent("keyid.lst"), "\n", true);
diff --git a/yql/essentials/tests/sql/suites/flatten_by/default.cfg b/yql/essentials/tests/sql/suites/flatten_by/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.sql
new file mode 100644
index 0000000000..df60a53b83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_and_where.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (select mod, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select mod, iv from $data as d flatten by lv as iv where iv < 'd' order by mod, iv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_aster_opt.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_aster_opt.sql
new file mode 100644
index 0000000000..7294949685
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_aster_opt.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select * from (select d.*, Just(key) as ok from plato.Input as d) flatten by ok;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_group_by_alias_collision.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_group_by_alias_collision.sql
new file mode 100644
index 0000000000..abf34243eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_group_by_alias_collision.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+
+$data = [<|key:1, subkeys:[1,2,2,3,4,5]|>, <|key:2, subkeys:[1,2,3,5,6,8]|>];
+
+SELECT
+ subkey,
+ COUNT(key) as cnt
+FROM AS_TABLE($data)
+FLATTEN LIST BY subkeys as subkey
+GROUP BY CAST(subkey as String) as subkey
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.sql
new file mode 100644
index 0000000000..1182060308
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_opt_dict.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_dict = (select mod, Just(ToDict(ListEnumerate(ListTake(ListSort(aggregate_list(key)), 1)))) as dk, ListTake(ListSort(aggregate_list(value)), 1) as lv from plato.Input group by cast(subkey as uint32) % 10 as mod);
+
+select * from $data_dict flatten dict by dk order by mod;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.cfg
new file mode 100644
index 0000000000..eaccb9ef55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.cfg
@@ -0,0 +1 @@
+in Input typed_table.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.sql
new file mode 100644
index 0000000000..10cf6ca887
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_by_typed_table.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select bb from plato.Input view opt_struct flatten by b as bb;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_columns.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns.sql
new file mode 100644
index 0000000000..12fe13e98d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+SELECT * FROM (
+SELECT
+ AsStruct(key as key, subkey as subkey),
+ AsStruct("value: " || value as value)
+FROM Input
+)
+FLATTEN COLUMNS;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_by_aggregate.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_by_aggregate.sql
new file mode 100644
index 0000000000..3ab01cc18d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_by_aggregate.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+USE plato;
+
+$input = (SELECT *
+ FROM (
+ SELECT Unwrap(some(row))
+ FROM (
+ SELECT TableRow() as row
+ FROM Input
+ )
+ ) FLATTEN COLUMNS
+);
+
+--INSERT INTO Output WITH TRUNCATE
+SELECT *
+FROM $input
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_non_struct.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_non_struct.sql
new file mode 100644
index 0000000000..c8fe587c6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_non_struct.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+select * from (
+select 1,AsStruct(2 as foo),Just(AsStruct(3 as bar)),
+Just(AsStruct(Just(4) as qwe))
+)
+flatten columns;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_with_opt_struct.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_with_opt_struct.sql
new file mode 100644
index 0000000000..80ad6d7a82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_columns_with_opt_struct.sql
@@ -0,0 +1,6 @@
+SELECT
+ *
+FROM (
+ SELECT JUST(<|col1: 1, col2: NULL, col3: Just(3), col4: 4p|>)
+)
+FLATTEN COLUMNS;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_corr_name_column.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_corr_name_column.sql
new file mode 100644
index 0000000000..666a9f5706
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_corr_name_column.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$data = select 1 as n, AsList(4, 5, 6) as l, AsStruct(10 as n, AsList(1, 2, 3) as l) as s union all
+ select 2 as n, AsList(4, 5) as l, AsStruct(20 as n, AsList(1, 2) as l) as s;
+
+select n,l from $data as l flatten by l order by n,l;
+select n,l from $data as l flatten by l.l order by n,l;
+
+select n,l from $data as s flatten by s.l order by n,l;
+select n,newl from $data as s flatten by (s.l as newl) order by n,newl;
+
+select n,l from $data as s flatten by (s.s.l as l) order by n,l;
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.sql
new file mode 100644
index 0000000000..a9618c7aac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma sampleselect;
+
+$data_dict = (select mod, YQL::ToIndexDict(ListSort(aggregate_list(key))) as dk, ListSort(aggregate_list(subkey)) as ls, ListSort(aggregate_list(value)) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select
+ mod, iv, ls,
+ dd.di.0 as key,
+ dd.di.1 as value
+from $data_dict as dd
+flatten by (dk as di, lv as iv, ls)
+order by mod, iv, ls, key, value;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.sql
new file mode 100644
index 0000000000..79acee152b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_dict_by_opt.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_dict = (select mod, YQL::ToIndexDict(ListTake(ListSort(aggregate_list(Just(key))), 1)) as dk, ListTake(ListSort(aggregate_list(subkey)), 1) as ls from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select * from $data_dict flatten by (dk as di, ls, mod) order by mod;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.cfg
new file mode 100644
index 0000000000..5c248bff3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.cfg
@@ -0,0 +1 @@
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.sql
new file mode 100644
index 0000000000..e2b17cb4cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = SELECT "a,b,c,d" AS a, "e,f,g,h" AS b, "x" AS c;
+
+SELECT a,bb,c FROM $data FLATTEN BY (String::SplitToList(a, ",") as a, String::SplitToList(b, ",") as bb) ORDER BY a,bb;
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.cfg
new file mode 100644
index 0000000000..5c248bff3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.cfg
@@ -0,0 +1 @@
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.sql
new file mode 100644
index 0000000000..235e70d859
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_groupby.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = SELECT "a,b,c,d" AS a, "e,f,g,h" AS b, "x" AS c;
+
+SELECT bb,count(*) as count FROM $data FLATTEN BY (String::SplitToList(a, ",") as a, String::SplitToList(b, ",") as bb) GROUP BY bb ORDER BY bb,count;
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.cfg
new file mode 100644
index 0000000000..c1a1de6dd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+udf string_udf
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.sql
new file mode 100644
index 0000000000..810c8b615d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_join.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$data = SELECT "075,020,075,020" AS a, "x" AS c;
+
+SELECT * FROM ANY $data as x FLATTEN BY (String::SplitToList(a, ",") as aa) JOIN Input as y ON x.aa = y.key ORDER BY aa;
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_struct.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_struct.sql
new file mode 100644
index 0000000000..35ca94eeb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_struct.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$data = select 1 as n, AsList(4, 5, 6) as l, AsStruct(10 as n, AsList(1, 2, 3) as l) as s union all
+ select 2 as n, AsList(4, 5) as l, AsStruct(20 as n, AsList(1, 2) as l) as s;
+
+select n,l from $data flatten by s.l as l order by n,l;
+select n,l from $data flatten by (s.l as l) order by n,l;
+select n,l from $data flatten by (ListExtend(s.l, AsList(100)) as l) order by n,l;
+
+select n,l,sl from $data flatten by (l, s.l as sl) order by n,l,sl
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.cfg
new file mode 100644
index 0000000000..5c248bff3d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.cfg
@@ -0,0 +1 @@
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.sql
new file mode 100644
index 0000000000..f2ba420046
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_expr_where.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$data = SELECT "a,b,c,d" AS a, "e,f,g,h" AS b, "x" AS c;
+
+SELECT a,bb,c FROM $data FLATTEN BY (String::SplitToList(a, ",") as a, String::SplitToList(b, ",") as bb) WHERE bb != "h" ORDER BY a,bb;
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.sql
new file mode 100644
index 0000000000..2f7ccd4bbb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_few_fields.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma sampleselect;
+
+$data_deep = (select mod, aggregate_list(key) as lk, aggregate_list(subkey) as ls, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+-- order to have same results on yamr and yt
+select * from $data_deep flatten by (lk as ik, ls, lv) order by mod, ik, ls, lv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_list.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_list.sql
new file mode 100644
index 0000000000..4a7c16bac7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (select mod, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select mod, iv from $data flatten by lv as iv order by mod, iv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.cfg
new file mode 100644
index 0000000000..2513e0a9c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.cfg
@@ -0,0 +1 @@
+in Input flatten_list_on_flatten_by.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.sql
new file mode 100644
index 0000000000..dfb14aea15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+USE plato;
+
+$flatten = (
+ SELECT
+ answer_and_clicks.0 AS permalink,
+ bc_type_tuple
+ FROM Input AS a
+ FLATTEN BY parsed_answers_and_clicks as answer_and_clicks
+ WHERE answer_and_clicks.1 = 1
+);
+
+SELECT
+ bc_type,
+ permalink,
+FROM (
+ SELECT
+ asList(bc_type_tuple.0, 'total') as bc_type,
+ a.* WITHOUT bc_type_tuple
+ FROM $flatten as a
+ )
+FLATTEN LIST BY bc_type;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt
new file mode 100644
index 0000000000..933b47e67d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt
@@ -0,0 +1,9 @@
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1022482316;];1;["bizfinder";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[63320754500;];1;["bizfinder";];];];};
+{"bc_type_tuple"=["unknown";"other";];"parsed_answers_and_clicks"=[[[56725259;];1;["geocoder";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1393063799;];1;["yabs";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1102340823;];1;["bizfinder";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1030456454;];1;["yabs";];];[[1023091930;];0;["yabs";];];[[91758116818;];0;["bizfinder";];];[[1089475933;];0;["yabs";];];[[1001186033;];0;["bizfinder";];];[[1746904934;];0;["bizfinder";];];[[16660487830;];0;["bizfinder";];];[[1927062611;];0;["bizfinder";];];[[211087055144;];0;["bizfinder";];];[[240631521347;];0;["bizfinder";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1128735493;];1;["bizfinder";];];[[1093055816;];0;["bizfinder";];];[[1101660521;];0;["bizfinder";];];];};
+{"bc_type_tuple"=["not_discovery";"1org";];"parsed_answers_and_clicks"=[[[1159830271;];1;["bizfinder";];];[[1030802514;];0;["bizfinder";];];];};
+
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt.attr b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt.attr
new file mode 100644
index 0000000000..1f5a7568d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_list_on_flatten_by.txt.attr
@@ -0,0 +1,55 @@
+{
+"_yql_row_spec"= {
+ "StrictSchema"= true;
+"Type"= [
+ "StructType";
+ [
+ [
+ "bc_type_tuple";
+ [
+ "TupleType";
+ [
+ [
+ "DataType";
+ "String"
+ ];
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ [
+ "parsed_answers_and_clicks";
+ [
+ "ListType";
+ [
+ "TupleType";
+ [
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "DataType";
+ "Int32"
+ ];
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.cfg
new file mode 100644
index 0000000000..ff4186ea03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.cfg
@@ -0,0 +1 @@
+in Input input_opt_struct_field.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.sql
new file mode 100644
index 0000000000..20bcbb42be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_member_is_struct.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ countIf(kkstritem % 10 == 0) as count_dec,
+ countIf(kkstritem < 100) as count_small,
+ countIf(kkstritem > 900) as count_huge
+FROM (
+ SELECT keyitem.kk as kkstr FROM Input as d FLATTEN BY key as keyitem
+)
+FLATTEN BY kkstr as kkstritem
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
new file mode 100644
index 0000000000..655c4940e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
@@ -0,0 +1,40 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ *
+FROM (SELECT Just(1) AS x)
+FLATTEN OPTIONAL BY x;
+
+$lst = AsList(1,2,3);
+SELECT
+ *
+FROM (SELECT $lst AS x)
+FLATTEN LIST BY x ORDER BY x;
+
+SELECT
+ x
+FROM (SELECT Just($lst) AS x)
+FLATTEN LIST BY x ORDER BY x;
+
+SELECT
+ *
+FROM (SELECT Just($lst) AS x)
+FLATTEN OPTIONAL BY x ORDER BY x;
+
+$dct = AsDict(AsTuple(1,"foo"),AsTuple(2,"bar"),AsTuple(3,"baz"));
+
+SELECT
+ *
+FROM (SELECT $dct AS x)
+FLATTEN DICT BY x ORDER BY x;
+
+SELECT
+ x
+FROM (SELECT Just($dct) AS x)
+FLATTEN DICT BY x ORDER BY x;
+
+SELECT
+ ListSort(DictItems(x))
+FROM (SELECT Just($dct) AS x)
+FLATTEN OPTIONAL BY x;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.sql
new file mode 100644
index 0000000000..c96cad25fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (select mod, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select * from $data flatten by lv as iv order by iv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.sql
new file mode 100644
index 0000000000..6145dcecbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_one_field_another.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (select mod, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select d.lv, d.mod from $data as d flatten by (lv) order by lv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.cfg
new file mode 100644
index 0000000000..bf1b560b58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.cfg
@@ -0,0 +1 @@
+in Input input_intersect_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.sql
new file mode 100644
index 0000000000..85633c4ae5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_two_fields.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_deep = (select mod, aggregate_list(key) as lk, aggregate_list(subkey) as ls, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select * from $data_deep flatten by (lk as ik, lv) order by ik, lv, mod;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.sql
new file mode 100644
index 0000000000..9d68c54e9f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_deep = (select mod, aggregate_list(cast(key as uint32)) as lk, aggregate_list(cast(subkey as uint32)) as ls, Count(*) as cc from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select sum(cc) as sc, sum(mod) as sm from $data_deep as d flatten by (lk as itk, ls as its) group by its + itk as ss order by sc, sm;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.sql
new file mode 100644
index 0000000000..cb6da4021f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_group_by_expr.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$data_deep = (select mod, aggregate_list(cast(key as uint32)) as lk, aggregate_list(cast(subkey as uint32)) as ls, Count(*) as cc from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select ss, sum(cc) as sc, sum(mod) as sm from $data_deep as d flatten by (lk as itk, ls as its) group by its + itk as ss order by ss;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.sql
new file mode 100644
index 0000000000..b7139810ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_join.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$data = (select mod, aggregate_list(value) as lv from plato.Input group by cast(key as uint32) % 10 as mod);
+
+select d.mod, d.lv, j.key
+from $data as d
+flatten by lv
+join plato.Input as j on d.mod == cast(j.key as uint32) / 10 % 10
+order by d.mod, d.lv;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.cfg b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.sql
new file mode 100644
index 0000000000..8dda0726f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_resource.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* kikimr can not */
+/* syntax version 1 */
+$script = @@
+def save(item):
+ return item
+
+def load(item):
+ return item
+@@;
+
+$save = Python3::save(Callable<(String)->Resource<Python3>>, $script);
+$load = Python3::load(Callable<(Resource<Python3>)->String>, $script);
+
+$input = (
+ SELECT key, AsList($save(value), $save(subkey)) AS resourceList FROM plato.Input
+);
+
+SELECT key, $load(resourceList) AS value FROM $input FLATTEN BY resourceList;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_with_subquery.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_subquery.sql
new file mode 100644
index 0000000000..ac7cab2094
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_with_subquery.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+
+define subquery $bar() as
+ select [1,2] as ks;
+end define;
+
+select key from $bar() flatten list by ks as key order by key;
+select key from $bar() flatten list by (ListExtend(ks, [3]) as key) order by key;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/input.txt b/yql/essentials/tests/sql/suites/flatten_by/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/flatten_by/input_intersect.txt b/yql/essentials/tests/sql/suites/flatten_by/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/flatten_by/input_intersect_sorted.txt b/yql/essentials/tests/sql/suites/flatten_by/input_intersect_sorted.txt
new file mode 100644
index 0000000000..617e73e92f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/input_intersect_sorted.txt
@@ -0,0 +1,14 @@
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="150";"subkey"="037";"value"="bfs"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt b/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt
new file mode 100644
index 0000000000..72dd9c3bfb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt
@@ -0,0 +1,12 @@
+{"key"=[[]];"subkey"="3";"value"="zer"};
+{"key"=[[]];"subkey"="9";"value"="ger"};
+{"key"=[[ 23u]];"subkey"="3";"value"="aaa"};
+{"key"=[[ 37u]];"subkey"="5";"value"="ddd"};
+{"key"=[[ 75u]];"subkey"="1";"value"="abc"};
+{"key"=[[150u]];"subkey"="1";"value"="aaa"};
+{"key"=[[150u]];"subkey"="3";"value"="iii"};
+{"key"=[[150u]];"subkey"="8";"value"="zzz"};
+{"key"=[[200u]];"subkey"="7";"value"="qqq"};
+{"key"=[[527u]];"subkey"="4";"value"="bbb"};
+{"key"=[[761u]];"subkey"="6";"value"="ccc"};
+{"key"=[[911u]];"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt.attr b/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt.attr
new file mode 100644
index 0000000000..b5a76775f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/input_opt_struct_field.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["StructType";[
+ ["kk";["OptionalType";["DataType";"Uint32"]]];
+ ]]]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/flatten_by/struct_with_wrong_correlation.sqlx b/yql/essentials/tests/sql/suites/flatten_by/struct_with_wrong_correlation.sqlx
new file mode 100644
index 0000000000..78e5c04267
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/struct_with_wrong_correlation.sqlx
@@ -0,0 +1,10 @@
+/* postgres can not */
+pragma sampleselect;
+use plato;
+
+$data_dict = (select mod, some(AsStruct(key as s, subkey as subkey)) as list_struct from Input group by cast(key as uint32) % 10 as mod order by mod);
+
+select
+ zz.s -- try with invalid correlation (show as wrong column)
+from $data_dict as dd
+flatten by list_struct as s
diff --git a/yql/essentials/tests/sql/suites/flatten_by/struct_without_correlation.sql b/yql/essentials/tests/sql/suites/flatten_by/struct_without_correlation.sql
new file mode 100644
index 0000000000..b280873d88
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/struct_without_correlation.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma sampleselect;
+use plato;
+
+$data_dict = (select mod, aggregate_list(AsStruct(key as `struct`, subkey as subkey)) as list_struct from Input group by cast(key as uint32) % 10 as mod);
+
+--insert into plato.Output
+select
+ mod, `struct`.`struct`
+from $data_dict as dd
+flatten by list_struct as `struct`
+order by mod, column1;
+--order by mod, iv, ls;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/table_funcs_spec_flatten_by.sqlx b/yql/essentials/tests/sql/suites/flatten_by/table_funcs_spec_flatten_by.sqlx
new file mode 100644
index 0000000000..a4815a1bc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/table_funcs_spec_flatten_by.sqlx
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+insert into Output
+select
+ key,
+ value,
+ TablePath()
+from Input flatten by (key)
+;
diff --git a/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt b/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt
new file mode 100644
index 0000000000..cc1df00106
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt.attr b/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt.attr
new file mode 100644
index 0000000000..67a1eb4bde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/typed_table.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_opt_struct"="SELECT YQL::AsList(1,2,3) as b FROM self;";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/flexible_types/basic.sql b/yql/essentials/tests/sql/suites/flexible_types/basic.sql
new file mode 100644
index 0000000000..fb4052b8be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/basic.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+$format = ($x) -> (FormatType($x));
+
+select
+ $format(integer) as formatted,
+ $format(inTeger) as formatted2,
+ inTeger as int,
+ inTeger + 1 as int_plus_one
+from (select 1 as inTeger);
diff --git a/yql/essentials/tests/sql/suites/flexible_types/default.cfg b/yql/essentials/tests/sql/suites/flexible_types/default.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/default.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/flexible_types/evaluate_expr.sql b/yql/essentials/tests/sql/suites/flexible_types/evaluate_expr.sql
new file mode 100644
index 0000000000..72f817d69d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/evaluate_expr.sql
@@ -0,0 +1,4 @@
+$x = ($type) -> (FormatType($type));
+
+select Substring($x(String), 1);
+select EvaluateExpr($x(String));
diff --git a/yql/essentials/tests/sql/suites/flexible_types/flatten_by.sql b/yql/essentials/tests/sql/suites/flexible_types/flatten_by.sql
new file mode 100644
index 0000000000..9728e406c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/flatten_by.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+select * from (select [1,1,1] as text) flatten list by (text);
diff --git a/yql/essentials/tests/sql/suites/flexible_types/functions.sql b/yql/essentials/tests/sql/suites/flexible_types/functions.sql
new file mode 100644
index 0000000000..4a5a0e270c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/functions.sql
@@ -0,0 +1,39 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+pragma warning("disable", "4510");
+
+$x1 = ()->(Int32);
+$x2 = ()->(Tuple<Int32>);
+$y1 = ()->{$a = String;return $a};
+$y2 = ()->{$a = Tuple<String>;return $a};
+$z1 = ()->{return Double};
+$z2 = ()->{return Tuple<Double>};
+
+select
+ timestamp,
+ EnsureType(ts,timestamp),
+ FormatType(timestamp),
+ FormatType(TypeOf(timestamp)),
+ FormatType(TypeOf(InstanceOf(timestamp))),
+ Nothing(OptionalType(timestamp)),
+ FormatType(OptionalType(timestamp)),
+ FormatType(ListType(timestamp)),
+ FormatType(StreamType(timeStamp)),
+ FormatType(DictType(timestamp,timestamp)),
+ FormatType(TupleType(timestamp,int32)),
+ FormatType(TaggedType(timestamp,'foo')),
+ FormatType(CallableType(0,timestamp)),
+ Yql::Minus(timestamp),
+ FormatType(Yql::OptionalType(timestamp)),
+ FormatType(TypeHandle(timestamp)),
+ FormatType($x1()),
+ FormatType($x2()),
+ FormatType($y1()),
+ FormatType($y2()),
+ FormatType($z1()),
+ FormatType($z2()),
+from (select 1 as timestamp, timestamp('2001-01-01T00:00:00Z') as ts)
diff --git a/yql/essentials/tests/sql/suites/flexible_types/group_by.sql b/yql/essentials/tests/sql/suites/flexible_types/group_by.sql
new file mode 100644
index 0000000000..29e643a224
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/group_by.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+$groupsrc =
+ select 1 as int32, 2 as value
+ union all
+ select 1 as int32, 1 as value;
+
+select
+ int32,
+ max(value) as maxval,
+ min(value) as minval,
+from $groupsrc group by int32 assume order by int32;
diff --git a/yql/essentials/tests/sql/suites/flexible_types/group_by2.sql b/yql/essentials/tests/sql/suites/flexible_types/group_by2.sql
new file mode 100644
index 0000000000..81ee626a82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/group_by2.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+$groupsrc =
+ select "1" as key, "2" as String
+ union all
+ select "1" as key, "3" as String;
+
+
+$foo = ($k, $t) -> (FormatType($t) || '_' || $k);
+
+select
+ $foo(key, String)
+from $groupsrc group by key;
diff --git a/yql/essentials/tests/sql/suites/flexible_types/inside_evaluate.sql b/yql/essentials/tests/sql/suites/flexible_types/inside_evaluate.sql
new file mode 100644
index 0000000000..d49fc796db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/inside_evaluate.sql
@@ -0,0 +1,11 @@
+$do_safe_cast = ($x, $type) -> {
+ $type_code = AtomCode($type);
+ $cast_code = EvaluateCode(LambdaCode(($x_code) -> {
+ RETURN FuncCode("SafeCast", $x_code, $type_code);
+ }));
+ RETURN $cast_code($x);
+};
+
+$do_safe_cast_2 = ($x, $type) -> ($do_safe_cast($x, FormatType($type)));
+
+select $do_safe_cast_2(123, String);
diff --git a/yql/essentials/tests/sql/suites/flexible_types/struct_literals_vs_columns.sql b/yql/essentials/tests/sql/suites/flexible_types/struct_literals_vs_columns.sql
new file mode 100644
index 0000000000..66eaec58da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/struct_literals_vs_columns.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+select <|'type_' || FormatType(TypeOf(text)):text|> as result from (select 1 as text);
+select <|text:''|>;
diff --git a/yql/essentials/tests/sql/suites/flexible_types/text_and_bytes.sql b/yql/essentials/tests/sql/suites/flexible_types/text_and_bytes.sql
new file mode 100644
index 0000000000..1cb89813b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/text_and_bytes.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+
+$src = select Text("test_text, привет") as text, Bytes("binary\x00\xff") as bytes;
+
+select
+ text,
+ bytes,
+ len(bytes) as bytes_len,
+ FormatType(TypeOf(text)) as text_real_type,
+ FormatType(Bytes) as bytes_real_type,
+from $src;
+
diff --git a/yql/essentials/tests/sql/suites/flexible_types/unused_types.sql b/yql/essentials/tests/sql/suites/flexible_types/unused_types.sql
new file mode 100644
index 0000000000..6f497ab1f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/unused_types.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+$format = ($x) -> (FormatType($x));
+
+$src = select 1 as integer, Float;
+
+select
+ $format(integer) as formatted,
+ integer + 1 as int_plus_one
+from $src;
diff --git a/yql/essentials/tests/sql/suites/flexible_types/with_typeof.sql b/yql/essentials/tests/sql/suites/flexible_types/with_typeof.sql
new file mode 100644
index 0000000000..066b0d81cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flexible_types/with_typeof.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma FlexibleTypes;
+
+
+$src =
+select Date("2022-01-01") as int32, 2 as value
+union all
+select Date("2021-12-31") as int32, 1 as value;
+
+$with_bytes = select t.*, ToBytes(int32) as date_bytes, ToBytes(value) as int_bytes from $src as t;
+
+select
+ int32,
+ value,
+ FromBytes(date_bytes, TypeOf(int32)) as d,
+ FromBytes(int_bytes, int32) as i
+from $with_bytes
+order by int32;
diff --git a/yql/essentials/tests/sql/suites/hor_join/default.cfg b/yql/essentials/tests/sql/suites/hor_join/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/double_input.sql b/yql/essentials/tests/sql/suites/hor_join/double_input.sql
new file mode 100644
index 0000000000..33eb738f9d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/double_input.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not */
+
+SELECT * FROM (
+ SELECT key, value || "a" as value FROM plato.Input
+ union all
+ SELECT key, "1" as value from plato.Input
+ union all
+ SELECT key, "1" as value from plato.Input
+ union all
+ SELECT key, "3" as value from plato.Input
+) AS x
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/empty_out_hor_join.sql b/yql/essentials/tests/sql/suites/hor_join/empty_out_hor_join.sql
new file mode 100644
index 0000000000..347407a3be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/empty_out_hor_join.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+
+USE plato;
+
+$i = (select * from Input where key == "0" order by key limit 100);
+
+select key, some(value) from $i group by key;
+select key, some(subkey) from $i group by key;
diff --git a/yql/essentials/tests/sql/suites/hor_join/filters.cfg b/yql/essentials/tests/sql/suites/hor_join/filters.cfg
new file mode 100644
index 0000000000..9b1926e035
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/filters.cfg
@@ -0,0 +1,2 @@
+in Input1 input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/filters.sql b/yql/essentials/tests/sql/suites/hor_join/filters.sql
new file mode 100644
index 0000000000..dfb4317e24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/filters.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT * FROM (
+ SELECT key, value FROM plato.Input1 where key > "010"
+ UNION ALL
+ SELECT key, value FROM plato.Input2 where key > "020"
+) AS x ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1-outlimit.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1-outlimit.cfg
new file mode 100644
index 0000000000..35111685c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1-outlimit.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+pragma yt.MaxOutputTables="2"
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.sql b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.sql
new file mode 100644
index 0000000000..4846907f41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs1.sql
@@ -0,0 +1,41 @@
+use plato;
+
+$udf = YQL::@@(lambda '(flow)
+(Map flow
+ (lambda '(item) (block '(
+ (let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ )))
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+ )))
+))@@;
+
+$i, $j = (PROCESS Input USING $udf(TableRows()));
+
+select key, value from $i where key > "100"
+order by key;
+
+insert into @a
+select * from $j;
+
+insert into @b
+select key from $i where key > "200";
+
+insert into @c
+select key from $j where key > "300";
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2-outlimit.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2-outlimit.cfg
new file mode 100644
index 0000000000..35111685c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2-outlimit.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+pragma yt.MaxOutputTables="2"
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.sql b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.sql
new file mode 100644
index 0000000000..02de4aae7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_outs2.sql
@@ -0,0 +1,38 @@
+use plato;
+
+$udf = YQL::@@(lambda '(flow)
+(Map flow
+ (lambda '(item) (block '(
+ (let varTuple (VariantType (TupleType
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ (StructType
+ '('key (DataType 'String))
+ '('subkey (DataType 'String))
+ '('value (DataType 'String))
+ )
+ )))
+ (let intValue (FromString (Member item 'key) 'Int32))
+ (let res
+ (If (Coalesce (Equal (% intValue (Int32 '2)) (Int32 '0)) (Bool 'false))
+ (Variant item '0 varTuple)
+ (Variant item '1 varTuple)
+ )
+ )
+ (return res)
+ )))
+))@@;
+
+$i, $j = (PROCESS Input USING $udf(TableRows()));
+
+select key, value from $i where key > "100"
+order by key;
+
+insert into @a
+select * from $j;
+
+insert into @b
+select key from $j where key > "200";
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage-outlimit.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage-outlimit.cfg
new file mode 100644
index 0000000000..35111685c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage-outlimit.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+pragma yt.MaxOutputTables="2"
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.cfg b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.sql b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.sql
new file mode 100644
index 0000000000..630c5285d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/fuse_multi_usage.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+$input = select key, some(subkey) as subkey, some(value) as value from Input group by key;
+
+select key from $input where subkey > "0"
+order by key;
+
+insert into @a
+select t.*, RandomNumber(TableRow()) as rnd from $input as t where value > "a";
+
+insert into @b
+select * from $input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_ranges.cfg b/yql/essentials/tests/sql/suites/hor_join/group_ranges.cfg
new file mode 100644
index 0000000000..c9c5c39ac1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_ranges.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_ranges.sql b/yql/essentials/tests/sql/suites/hor_join/group_ranges.sql
new file mode 100644
index 0000000000..25d8e78cd4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_ranges.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* kikimr can not */
+USE plato;
+
+$i = (SELECT * FROM plato.range(``, Input1, Input4));
+
+SELECT * FROM (
+ SELECT 1 as key, subkey, value FROM $i
+ UNION ALL
+ SELECT 2 as key, subkey, value FROM $i
+) AS x
+ORDER BY key, subkey, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_sampling.cfg b/yql/essentials/tests/sql/suites/hor_join/group_sampling.cfg
new file mode 100644
index 0000000000..c9c5c39ac1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_sampling.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_sampling.sql b/yql/essentials/tests/sql/suites/hor_join/group_sampling.sql
new file mode 100644
index 0000000000..255d3b5811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_sampling.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* kikimr can not */
+/* hybridfile can not YQL-17284 */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 16 */
+USE plato;
+
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as subkey, '' as value FROM plato.Input1 SAMPLE 0.1
+ UNION ALL
+ SELECT CAST(key AS int) as key, subkey, '' as value FROM plato.Input2 SAMPLE 0.1
+ UNION ALL
+ SELECT 1 as key, subkey, '' as value from plato.Input3
+ UNION ALL
+ SELECT 1 as key, '' as subkey, value from plato.Input4
+) AS x
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_yamr.cfg b/yql/essentials/tests/sql/suites/hor_join/group_yamr.cfg
new file mode 100644
index 0000000000..280feec6cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_yamr.cfg
@@ -0,0 +1,4 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 yamred_dsv.txt yamred_dsv
+in Input4 yamred_dsv.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/hor_join/group_yamr.sql b/yql/essentials/tests/sql/suites/hor_join/group_yamr.sql
new file mode 100644
index 0000000000..d781971f1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/group_yamr.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+SELECT * FROM (
+ SELECT 1 as key, subkey, '' as value from plato.Input1
+ UNION ALL
+ SELECT 2 as key, '' as subkey, value from plato.Input2
+ UNION ALL
+ SELECT 3 as key, subkey, '' as value from plato.Input3
+ UNION ALL
+ SELECT 4 as key, '' as subkey, value from plato.Input4
+) AS x
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/input.txt b/yql/essentials/tests/sql/suites/hor_join/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/hor_join/input.txt.attr b/yql/essentials/tests/sql/suites/hor_join/input.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/input.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/input1.txt b/yql/essentials/tests/sql/suites/hor_join/input1.txt
new file mode 100644
index 0000000000..9e2c7c8718
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/input1.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="160";"subkey"="3";"value"="iii"};
+{"key"="170";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/hor_join/less_outs.cfg b/yql/essentials/tests/sql/suites/hor_join/less_outs.cfg
new file mode 100644
index 0000000000..a06e20d35e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/less_outs.cfg
@@ -0,0 +1,7 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
+in Input5 input.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/hor_join/less_outs.sql b/yql/essentials/tests/sql/suites/hor_join/less_outs.sql
new file mode 100644
index 0000000000..a8594fe2dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/less_outs.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$i1 = SELECT CAST(key AS Int32) ?? 0 as key, '' as value FROM plato.Input1;
+$i2 = SELECT 0 as key, value from plato.Input2 UNION ALL SELECT 1 as key, value from plato.Input3;
+$i3 = (SELECT 2 as key, value from plato.Input4 UNION ALL SELECT 3 as key, value from plato.Input5);
+
+$udf = ($x) -> { return Yql::VariantItem($x) };
+
+PROCESS $i1, $i2, $i3 using $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/hor_join/max_in_tables.cfg b/yql/essentials/tests/sql/suites/hor_join/max_in_tables.cfg
new file mode 100644
index 0000000000..1d540ef27f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/max_in_tables.cfg
@@ -0,0 +1,5 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
+in Input5 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/max_in_tables.sql b/yql/essentials/tests/sql/suites/hor_join/max_in_tables.sql
new file mode 100644
index 0000000000..684ceb32fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/max_in_tables.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* kikimr can not */
+pragma yt.MaxInputTables="3";
+
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as value FROM plato.Input1
+ UNION ALL
+ SELECT 0 as key, value from plato.Input2
+ UNION ALL
+ SELECT 1 as key, value from plato.Input3
+ UNION ALL
+ SELECT 2 as key, value from plato.Input4
+ UNION ALL
+ SELECT 3 as key, value from plato.Input5
+) AS x
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/max_outtables.cfg b/yql/essentials/tests/sql/suites/hor_join/max_outtables.cfg
new file mode 100644
index 0000000000..a06e20d35e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/max_outtables.cfg
@@ -0,0 +1,7 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
+in Input5 input.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/hor_join/max_outtables.sql b/yql/essentials/tests/sql/suites/hor_join/max_outtables.sql
new file mode 100644
index 0000000000..0ce459d466
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/max_outtables.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not */
+pragma yt.MaxOutputTables="3";
+
+$i1 = (SELECT CAST(key AS Int32) ?? 0 as key, '' as value FROM plato.Input1);
+$i2 = (SELECT 0 as key, value from plato.Input2);
+$i3 = (SELECT 1 as key, value from plato.Input3);
+$i4 = (SELECT 2 as key, value from plato.Input4);
+$i5 = (SELECT 3 as key, value from plato.Input5);
+
+
+$udf = ($x) -> { return Yql::VariantItem($x) };
+
+PROCESS $i1, $i2, $i3, $i4, $i5 using $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.cfg b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.cfg
new file mode 100644
index 0000000000..b9e77a0bd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.sql b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.sql
new file mode 100644
index 0000000000..f413af69ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_all.sql
@@ -0,0 +1,43 @@
+use plato;
+
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def MyFunc(list):
+ return [(int(x.key) % 4, x) for x in list]
+@@;
+
+$record = (SELECT TableRow() FROM Input);
+$recordType =TypeOf(Unwrap($record));
+
+$udf = Python::MyFunc(
+ CallableType(0,
+ StreamType(
+ VariantType(TupleType($recordType, $recordType, $recordType, $recordType))
+ ),
+ StreamType($recordType)),
+ $udfScript
+);
+
+$i0, $i1, $i2, $i3 = (PROCESS Input USING $udf(TableRows()));
+
+select * from (
+ select * from $i0
+ union all
+ select * from $i1
+ union all
+ select * from $i2
+ union all
+ select * from $i3
+) order by key;
+
+insert into Output
+select * from (
+ select * from $i0
+ union all
+ select * from $i1
+ union all
+ select * from $i2
+ union all
+ select * from $i3
+);
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.cfg b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.cfg
new file mode 100644
index 0000000000..b9e77a0bd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.sql b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.sql
new file mode 100644
index 0000000000..640fd4a086
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_part.sql
@@ -0,0 +1,39 @@
+use plato;
+
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def MyFunc(list):
+ return [(int(x.key) % 4, x) for x in list]
+@@;
+
+$record = (SELECT TableRow() FROM plato.Input);
+$recordType =TypeOf(Unwrap($record));
+
+$udf = Python::MyFunc(
+ CallableType(0,
+ StreamType(
+ VariantType(TupleType($recordType, $recordType, $recordType, $recordType))
+ ),
+ StreamType($recordType)),
+ $udfScript
+);
+
+$i0, $i1, $i2, $i3 = (PROCESS plato.Input USING $udf(TableRows()));
+
+select * from (
+ select * from $i0
+ union all
+ select * from $i1
+ union all
+ select * from $i2
+) order by key;
+
+insert into Output
+select * from (
+ select * from $i1
+ union all
+ select * from $i2
+ union all
+ select * from $i3
+);
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.cfg b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.cfg
new file mode 100644
index 0000000000..b9e77a0bd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.sql b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.sql
new file mode 100644
index 0000000000..d0068e031c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/merge_multiouts_reuse.sql
@@ -0,0 +1,43 @@
+use plato;
+
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def MyFunc(list):
+ return [(int(x.key) % 4, x) for x in list]
+@@;
+
+$record = (SELECT TableRow() FROM Input);
+$recordType =TypeOf(Unwrap($record));
+
+$udf = Python::MyFunc(
+ CallableType(0,
+ StreamType(
+ VariantType(TupleType($recordType, $recordType, $recordType, $recordType))
+ ),
+ StreamType($recordType)),
+ $udfScript
+);
+
+$i0, $i1, $i2, $i3 = (PROCESS Input USING $udf(TableRows()));
+
+select * from (
+ select * from $i0
+ union all
+ select * from $i1
+ union all
+ select * from $i2
+ union all
+ select * from $i0
+) order by key;
+
+insert into Output
+select * from (
+ select * from $i3
+ union all
+ select * from $i1
+ union all
+ select * from $i2
+ union all
+ select * from $i3
+);
diff --git a/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt b/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt
new file mode 100644
index 0000000000..42c5393923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value1"="q"};
+{"key"="075";"subkey"="1";"value1"="abc"};
+{"key"="150";"subkey"="4";"value1"="qzz"};
+{"key"="800";"subkey"="2";"value1"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt.attr b/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/nonstrict.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_hor_join.sql b/yql/essentials/tests/sql/suites/hor_join/out_hor_join.sql
new file mode 100644
index 0000000000..0e410fbb55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_hor_join.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$i = (SELECT * FROM Input WHERE key < "900");
+
+SELECT key, some(value) as s FROM $i GROUP BY key ORDER BY key, s;
+
+SELECT key, sum(cast(subkey as Int32)) as s FROM $i GROUP BY key ORDER BY key, s;
+
+SELECT key, some(subkey) as s FROM $i GROUP BY key ORDER BY key, s;
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_max_outtables.sql b/yql/essentials/tests/sql/suites/hor_join/out_max_outtables.sql
new file mode 100644
index 0000000000..399028196d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_max_outtables.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* kikimr can not */
+pragma yt.MaxOutputTables="3";
+pragma yt.DisableOptimizers="HorizontalJoin,MultiHorizontalJoin";
+
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as value FROM plato.Input
+ UNION ALL
+ SELECT 0 as key, value from plato.Input
+ UNION ALL
+ SELECT 1 as key, value from plato.Input
+ UNION ALL
+ SELECT 2 as key, value from plato.Input
+ UNION ALL
+ SELECT 3 as key, value from plato.Input
+) AS x
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_mem_limit.sql b/yql/essentials/tests/sql/suites/hor_join/out_mem_limit.sql
new file mode 100644
index 0000000000..508ddfd6cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_mem_limit.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not - yt pragma */
+USE plato;
+
+PRAGMA yt.MaxExtraJobMemoryToFuseOperations="550m";
+PRAGMA yt.CombineCoreLimit="128m";
+
+$i = (SELECT * FROM Input WHERE key < "900");
+
+SELECT key, sum(cast(subkey as Int32)) as s FROM $i GROUP BY key ORDER BY key, s;
+
+SELECT key, some(subkey) as s FROM $i GROUP BY key ORDER by key, s;
+
+SELECT key, some(value) as s FROM $i GROUP BY key ORDER BY key, s;
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_range.sql b/yql/essentials/tests/sql/suites/hor_join/out_range.sql
new file mode 100644
index 0000000000..c734fd9441
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_range.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+
+SELECT key, some(value) as s FROM Input GROUP BY key ORDER BY key, s;
+
+SELECT key, sum(cast(subkey as Int32)) as s FROM Input WHERE key > "100" GROUP BY key ORDER BY key, s;
+
+SELECT key, some(subkey) as s FROM Input WHERE key > "100" GROUP BY key ORDER BY key, s;
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_sampling.cfg b/yql/essentials/tests/sql/suites/hor_join/out_sampling.cfg
new file mode 100644
index 0000000000..a654f9117d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_sampling.cfg
@@ -0,0 +1 @@
+in Input input1.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_sampling.sql b/yql/essentials/tests/sql/suites/hor_join/out_sampling.sql
new file mode 100644
index 0000000000..7619a391fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_sampling.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* kikimr can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) == 10 and len(yt_res_yson[1]['Write'][0]['Data']) < 10 and len(yt_res_yson[2]['Write'][0]['Data']) < 10 and len(yt_res_yson[3]['Write'][0]['Data']) == 10 */
+USE plato;
+
+SELECT key, some(value) FROM Input GROUP BY key;
+
+SELECT key, sum(cast(subkey as Int32)) FROM Input SAMPLE 0.3 GROUP BY key;
+
+SELECT key, some(subkey) FROM Input SAMPLE 0.3 GROUP BY key;
+
+SELECT key, sum(length(value)) FROM Input GROUP BY key;
diff --git a/yql/essentials/tests/sql/suites/hor_join/out_table_record.sql b/yql/essentials/tests/sql/suites/hor_join/out_table_record.sql
new file mode 100644
index 0000000000..25cc1dcc62
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/out_table_record.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+pragma yt.DisableOptimizers="HorizontalJoin,MultiHorizontalJoin";
+
+SELECT * FROM (
+ select key, TableRecordIndex() as record, TablePath() as path from Input
+ union all
+ select key, TableRecordIndex() as record, "d" as path from Input
+) AS x
+ORDER BY key, record, path
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.cfg b/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.cfg
new file mode 100644
index 0000000000..2d1eb20046
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.cfg
@@ -0,0 +1,2 @@
+in Input1 nonstrict.txt
+in Input2 input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.sql b/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.sql
new file mode 100644
index 0000000000..e3477cc693
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/row_num_per_sect.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* kikimr can not */
+/* syntax version 1 */
+USE plato;
+
+$with_row1 = (SELECT t.*, ROW_NUMBER() OVER () as row_num FROM Input1 as t);
+$with_row2 = (SELECT t.*, ROW_NUMBER() OVER () as row_num FROM Input2 as t);
+
+SELECT a.key as key, b.subkey as subkey, b.value as value FROM $with_row1 as a LEFT JOIN $with_row2 as b USING(row_num);
diff --git a/yql/essentials/tests/sql/suites/hor_join/runtime_dep.sql b/yql/essentials/tests/sql/suites/hor_join/runtime_dep.sql
new file mode 100644
index 0000000000..183635ba58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/runtime_dep.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+use plato;
+
+INSERT INTO @ttt WITH TRUNCATE
+SELECT CAST(key AS int) as key, subkey, value FROM Input;
+
+COMMIT;
+
+SELECT * FROM (
+ SELECT key, '' as value FROM @ttt
+ UNION ALL
+ SELECT 0 as key, value from @ttt
+) AS x
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/skip_sampling.cfg b/yql/essentials/tests/sql/suites/hor_join/skip_sampling.cfg
new file mode 100644
index 0000000000..15b84c0426
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/skip_sampling.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/skip_sampling.sql b/yql/essentials/tests/sql/suites/hor_join/skip_sampling.sql
new file mode 100644
index 0000000000..c00c6f9627
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/skip_sampling.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 12 */
+USE plato;
+
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as subkey, '' as value FROM plato.Input1 SAMPLE 0.1
+ UNION ALL
+ SELECT 1 as key, subkey, '' as value from plato.Input2
+ UNION ALL
+ SELECT 1 as key, '' as subkey, value from plato.Input3
+) AS x
+ORDER BY key, subkey, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/skip_yamr.cfg b/yql/essentials/tests/sql/suites/hor_join/skip_yamr.cfg
new file mode 100644
index 0000000000..d16bb7a691
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/skip_yamr.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 input.txt
+in Input3 yamred_dsv.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/hor_join/skip_yamr.sql b/yql/essentials/tests/sql/suites/hor_join/skip_yamr.sql
new file mode 100644
index 0000000000..8161e83e83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/skip_yamr.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+SELECT * FROM (
+ SELECT 1 as key, subkey, '' as value from plato.Input1
+ UNION ALL
+ SELECT 1 as key, '' as subkey, value from plato.Input2
+ UNION ALL
+ SELECT CAST(key as Int32) as key, '' as subkey, value from plato.Input3
+) ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted.txt b/yql/essentials/tests/sql/suites/hor_join/sorted.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted.txt.attr b/yql/essentials/tests/sql/suites/hor_join/sorted.txt.attr
new file mode 100644
index 0000000000..36f279e4a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]]
+ ];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted_out.cfg b/yql/essentials/tests/sql/suites/hor_join/sorted_out.cfg
new file mode 100644
index 0000000000..186d94fcae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted_out.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted.txt
+in Input2 input.txt
+in Input3 input.txt
+in Input4 input.txt
+in Input5 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted_out.sql b/yql/essentials/tests/sql/suites/hor_join/sorted_out.sql
new file mode 100644
index 0000000000..d0a017508a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted_out.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* kikimr can not */
+pragma yt.DisableOptimizers="UnorderedOuts";
+
+SELECT * FROM (
+ SELECT key, value || "a" as value FROM plato.Input1
+ union all
+ SELECT key, "1" as value from plato.Input2
+ union all
+ SELECT key, "2" as value from plato.Input3
+ union all
+ SELECT key, "3" as value from plato.Input4
+ union all
+ SELECT key, "4" as value from plato.Input5
+) AS x
+ORDER BY key, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.cfg b/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.cfg
new file mode 100644
index 0000000000..8bc2f58496
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.cfg
@@ -0,0 +1,5 @@
+in Input1 input.txt
+in Input2 sorted.txt
+in Input3 input.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.sql b/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.sql
new file mode 100644
index 0000000000..19aec3111b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/sorted_out_mix.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not */
+pragma yt.DisableOptimizers="UnorderedOuts";
+
+$i1 = (SELECT key, value || "a" as value1 FROM plato.Input1);
+$i2 = (SELECT key, "1" as value2 from plato.Input2);
+$i3 = (SELECT key, "2" as value3 from plato.Input3);
+
+$udf = ($x) -> {
+ return AsStruct(Yql::Visit($x
+ , AsAtom("0"), ($i) -> { return Yql::Member($i, AsAtom("key")) }
+ , AsAtom("1"), ($i) -> { return Yql::Member($i, AsAtom("key")) }
+ , AsAtom("2"), ($i) -> { return Yql::Member($i, AsAtom("key")) }
+ ) AS key)
+};
+
+SELECT * FROM (PROCESS $i1, $i2, $i3 using $udf(TableRow())) ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/hor_join/table_record.cfg b/yql/essentials/tests/sql/suites/hor_join/table_record.cfg
new file mode 100644
index 0000000000..9b1926e035
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/table_record.cfg
@@ -0,0 +1,2 @@
+in Input1 input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/hor_join/table_record.sql b/yql/essentials/tests/sql/suites/hor_join/table_record.sql
new file mode 100644
index 0000000000..af5f42281a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/table_record.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT * FROM (
+ select key, TableRecordIndex() as record, TablePath() as path from Input1
+ union all
+ select key, TableRecordIndex() as record, "d" as path from Input2
+) AS x
+ORDER BY key, record, path
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt b/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt
new file mode 100644
index 0000000000..f2882a08fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt
@@ -0,0 +1,4 @@
+{"key"="3";"subkey"="s3";"a"="2";"b"="075";"c"="1";"d"="abc"};
+{"key"="1";"subkey"="s1";"a"="1";"b"="800";"c"="2";"d"="ddd"};
+{"key"="2";"subkey"="s2";"a"="4";"b"="020";"c"="3";"d"="q"};
+{"key"="5";"subkey"="s5";"a"="3";"b"="150";"c"="4";"d"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt.attr b/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt.attr
new file mode 100644
index 0000000000..f52f445c2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yamred_dsv.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_format"=<
+ "fs"="\t";
+ "rs"="\n";
+ "has_subkey"=%true;
+ "escape_carriage_return"=%true;
+ "key_column_names"=["key"];
+ "subkey_column_names"=["subkey"]
+ >"yamred_dsv";
+}
diff --git a/yql/essentials/tests/sql/suites/hor_join/yield_off.sql b/yql/essentials/tests/sql/suites/hor_join/yield_off.sql
new file mode 100644
index 0000000000..a1635ae3e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yield_off.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+pragma config.flags("UdfSupportsYield","false");
+
+$s = @@
+import yql
+
+def f(input, a):
+ for x in input:
+ yield x
+@@;
+
+$f = Python::f(Callable<(Stream<Struct<key:String,subkey:String,value:String>>,Int32)->Stream<Struct<key:String,subkey:String,value:String>>>, $s);
+
+
+SELECT * FROM (
+ PROCESS Input using $f(TableRows(), 1)
+ UNION ALL
+ PROCESS Input using $f(TableRows(), 2)
+) AS x
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/yield_on.sql b/yql/essentials/tests/sql/suites/hor_join/yield_on.sql
new file mode 100644
index 0000000000..62efa85744
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yield_on.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+pragma config.flags("UdfSupportsYield","true");
+
+$s = @@
+def f(input, a):
+ for x in input:
+ yield x
+@@;
+
+$f = Python::f(Callable<(Stream<Struct<key:String,subkey:String,value:String>>,Int32)->Stream<Struct<key:String,subkey:String,value:String>>>, $s);
+
+SELECT * FROM (
+ PROCESS Input using $f(TableRows(), 1)
+ UNION ALL
+ PROCESS Input using $f(TableRows(), 2)
+) AS x
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.cfg b/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.sql b/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.sql
new file mode 100644
index 0000000000..3f36d0e6e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yql-12610_old_table_props.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+/* kikimr can not - yt pragma */
+USE plato;
+pragma yt.UseSystemColumns="0";
+
+SELECT * FROM (
+ select key, TableRecordIndex() as record, TablePath() as path from Input
+ union all
+ select key, TableRecordIndex() as record, "d" as path from Input
+) AS x
+ORDER BY key, record, path
+;
diff --git a/yql/essentials/tests/sql/suites/hor_join/yql-6477_table_path.sql b/yql/essentials/tests/sql/suites/hor_join/yql-6477_table_path.sql
new file mode 100644
index 0000000000..893cd776de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/hor_join/yql-6477_table_path.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+/* kikimr can not - yt pragma */
+USE plato;
+
+pragma yt.MaxExtraJobMemoryToFuseOperations="512M";
+
+$udfScript = @@
+def AsIs(s):
+ return s
+@@;
+
+$udf = Python::AsIs(Callable<(String)->String>, $udfScript);
+
+select TablePath() as path from Input
+union all
+select TablePath() as path from Input where $udf(key) > "080"
+;
diff --git a/yql/essentials/tests/sql/suites/in/basic_in.sql b/yql/essentials/tests/sql/suites/in/basic_in.sql
new file mode 100644
index 0000000000..fdb8c00408
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/basic_in.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+SELECT
+ 1 IN (1, 2),
+ 3 NOT IN (1, 2),
+ "1" IN (key, subkey, value),
+ key NOT IN (key, subkey, value),
+ key NOT IN AsList(subkey),
+ CAST(subkey AS Int32) IN (1, 2) AS optional_key_i32,
+ CAST(subkey AS Int64) IN (1, 2) AS optional_key_i64,
+ CAST(subkey AS Uint32) IN (1, 2) AS optional_key_ui32,
+ CAST(subkey AS Uint64) IN (1, 2) AS optional_key_ui64,
+ CAST(subkey AS Uint8) IN (1, 2) AS optional_key_to_larger_type
+FROM plato.Input;
diff --git a/yql/essentials/tests/sql/suites/in/default.cfg b/yql/essentials/tests/sql/suites/in/default.cfg
new file mode 100644
index 0000000000..3d282ff63b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/default.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+in InputWithTuples input_with_tuples.txt
diff --git a/yql/essentials/tests/sql/suites/in/empty.txt b/yql/essentials/tests/sql/suites/in/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/empty.txt
diff --git a/yql/essentials/tests/sql/suites/in/huge_in.sql b/yql/essentials/tests/sql/suites/in/huge_in.sql
new file mode 100644
index 0000000000..f2d164b254
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/huge_in.sql
@@ -0,0 +1,2495 @@
+SELECT
+ *
+FROM plato.Input
+WHERE value IN (
+'rambler.ru',
+'worldoftanks.ru',
+'pikabu.ru',
+'rbc.ru',
+'ria.ru',
+'lenta.ru',
+'4pda.ru',
+'lostfilm.tv',
+'yaplakal.com',
+'auto.mail.ru',
+'lady.mail.ru',
+'echo.msk.ru',
+'gazeta.ru',
+'lifenews.ru',
+'drive2.ru',
+'vesti.ru',
+'ivi.ru',
+'russian.rt.com',
+'championat.com',
+'habrahabr.ru',
+'tass.ru',
+'kp.ru',
+'games.mail.ru',
+'sports.ru',
+'hi-tech.mail.ru',
+'fishki.net',
+'news.sportbox.ru',
+'playground.ru',
+'1tv.ru',
+'fb.ru',
+'rg.ru',
+'ntv.ru',
+'kakprosto.ru',
+'vz.ru',
+'deti.mail.ru',
+'dom2.ru',
+'e1.ru',
+'aif.ru',
+'adme.ru',
+'regnum.ru',
+'livejournal.com',
+'interfax.ru',
+'tvzvezda.ru',
+'infox.sg',
+'sport-express.ru',
+'health.mail.ru',
+'kommersant.ru',
+'izvestia.ru',
+'topwar.ru',
+'meduza.io',
+'mk.ru',
+'geektimes.ru',
+'worldofwarships.ru',
+'newsru.com',
+'tvrain.ru',
+'stream.1tv.ru',
+'dota2.ru',
+'woman.ru',
+'banki.ru',
+'3dnews.ru',
+'weekend.rambler.ru',
+'womanadvice.ru',
+'video-dom2.ru',
+'ren.tv',
+'rusvesna.su',
+'vedomosti.ru',
+'tvc.ru',
+'forexpf.ru',
+'inosmi.ru',
+'goodgame.ru',
+'rusnovosti.ru',
+'cont.ws',
+'overclockers.ru',
+'politikus.ru',
+'autorambler.ru',
+'bbc.com',
+'fontanka.ru',
+'lifehacker.ru',
+'novayagazeta.ru',
+'ixbt.com',
+'oper.ru',
+'m24.ru',
+'stopgame.ru',
+'rustoria.ru',
+'russianfood.com',
+'russia.tv',
+'football.kulichki.net',
+'svpressa.ru',
+'igromania.ru',
+'finance.rambler.ru',
+'kinopati.ru',
+'elhow.ru',
+'ngs.ru',
+'navalny.com',
+'ru.investing.com',
+'shazoo.ru',
+'carambatv.ru',
+'colonelcassad.livejournal.com',
+'turkcinema.tv',
+'syl.ru',
+'gamebomb.ru',
+'ctc.ru',
+'hltv.org',
+'khl.ru',
+'slon.ru',
+'101.ru',
+'rusplt.ru',
+'lostfilm.info',
+'matchtv.ru',
+'svoboda.org',
+'finam.ru',
+'virtus.pro',
+'tjournal.ru',
+'livelib.ru',
+'tvigle.ru',
+'sovsport.ru',
+'expert.ru',
+'rns.online',
+'varlamov.ru',
+'astromeridian.ru',
+'74.ru',
+'quto.ru',
+'mobile-review.com',
+'stranamasterov.ru',
+'the-village.ru',
+'quote.rbc.ru',
+'rosbalt.ru',
+'eurosport.ru',
+'bash.im',
+'1prime.ru',
+'coop-land.ru',
+'kanobu.ru',
+'radiopotok.ru',
+'bfm.ru',
+'dni.ru',
+'soccer.ru',
+'europaplus.ru',
+'warfiles.ru',
+'radiovesti.ru',
+'nnm.me',
+'eadaily.com',
+'unian.net',
+'drive.ru',
+'afisha.ru',
+'wot-news.com',
+'forbes.ru',
+'ferra.ru',
+'vc.ru',
+'rusnext.ru',
+'tema.livejournal.com',
+'u-mama.ru',
+'eda.ru',
+'f1news.ru',
+'bazaistoria.ru',
+'ura.ru',
+'24auto.ru',
+'utro.ru',
+'edimdoma.ru',
+'politobzor.net',
+'sibnet.ru',
+'snob.ru',
+'news.drom.ru',
+'newsland.com',
+'popmech.ru',
+'trinixy.ru',
+'politrussia.com',
+'iphones.ru',
+'uznayvse.ru',
+'alogvinov.com',
+'ru-m.org',
+'vashmnenie.ru',
+'buhonline.ru',
+'politota.dirty.ru',
+'referatwork.ru',
+'gooool.org',
+'news-front.info',
+'vokrug.tv',
+'pravda.ru',
+'autonews.ru',
+'gamer.ru',
+'zr.ru',
+'govoritmoskva.ru',
+'gamemag.ru',
+'letidor.ru',
+'vestifinance.ru',
+'spletnik.ru',
+'cosmo.ru',
+'9gag.com',
+'exler.ru',
+'kolesa.ru',
+'bombardir.ru',
+'km.ru',
+'eva.ru',
+'maximonline.ru',
+'pedsovet.su',
+'megamozg.ru',
+'film.ru',
+'ondom2.com',
+'topnews.ru',
+'zdravotvet.ru',
+'schlock.ru',
+'kinomania.ru',
+'wday.ru',
+'life-dom2.ru',
+'kosmetista.ru',
+'rusfootball.info',
+'infoniac.ru',
+'sql.ru',
+'sport.rbc.ru',
+'narutoplanet.ru',
+'chelyabinsk.ru',
+'trashbox.ru',
+'ng.ru',
+'msk.kp.ru',
+'thg.ru',
+'soccer365.ru',
+'ridus.ru',
+'audit-it.ru',
+'mix.sibnet.ru',
+'fanat1k.ru',
+'riafan.ru',
+'gameguru.ru',
+'oko-planet.su',
+'gmbox.ru',
+'macdigger.ru',
+'kudago.com',
+'goha.ru',
+'style.rbc.ru',
+'avmalgin.livejournal.com',
+'pure-t.ru',
+'toastedballs.com',
+'66.ru',
+'kremlin.ru',
+'ppt.ru',
+'pix.playground.ru',
+'gotovim.ru',
+'zhenskoe-mnenie.ru',
+'motor.ru',
+'moslenta.ru',
+'dp.ru',
+'pravoslavie.ru',
+'footballhd.ru',
+'72.ru',
+'hmn.ru',
+'ruposters.ru',
+'ag.ru',
+'youloveit.ru',
+'7days.ru',
+'bmpd.livejournal.com',
+'nplus1.ru',
+'finanz.ru',
+'fantasy-worlds.org',
+'07kbr.ru',
+'glavbukh.ru',
+'newsvl.ru',
+'avtovzglyad.ru',
+'sdelanounas.ru',
+'rbctv.rbc.ru',
+'gorod48.ru',
+'elle.ru',
+'realty.rbc.ru',
+'fashiony.ru',
+'super.ru',
+'opennet.ru',
+'rusfishing.ru',
+'weburg.net',
+'znak.com',
+'smotrisport.tv',
+'eurolab.ua',
+'tonkosti.ru',
+'irk.ru',
+'kramola.info',
+'yurasumy.livejournal.com',
+'u-f.ru',
+'liveresult.ru',
+'starhit.ru',
+'allboxing.ru',
+'shkolazhizni.ru',
+'bloknot.ru',
+'babyplan.ru',
+'klerk.ru',
+'notebook-center.ru',
+'pravmir.ru',
+'eg.ru',
+'cn.ru',
+'anekdotov.net',
+'info.drom.ru',
+'comss.info',
+'oszone.net',
+'orsk.ru',
+'blogistars.com',
+'inopressa.ru',
+'xakep.ru',
+'riotpixels.com',
+'rsport.ru',
+'peremogi.livejournal.com',
+'moe-online.ru',
+'newkaliningrad.ru',
+'cxem.net',
+'nash-dom2.ru',
+'vprognoze.ru',
+'glav.su',
+'mama.ru',
+'nhl.com',
+'ekabu.ru',
+'59.ru',
+'ucrazy.ru',
+'euro-football.ru',
+'tvzavr.ru',
+'moevideo.net',
+'ibigdan.livejournal.com',
+'7ya.ru',
+'sadalskij.livejournal.com',
+'vm.ru',
+'rusdialog.ru',
+'factroom.ru',
+'mir24.tv',
+'voenhronika.ru',
+'argumenti.ru',
+'63.ru',
+'politnavigator.net',
+'peoples.ru',
+'medkrug.ru',
+'vladtime.ru',
+'3ddd.ru',
+'business-gazeta.ru',
+'moya-planeta.ru',
+'gorod.afisha.ru',
+'openrussia.org',
+'strana-sovetov.com',
+'allhockey.ru',
+'mobiltelefon.ru',
+'interfax-russia.ru',
+'politonline.ru',
+'filmpro.ru',
+'bugaga.ru',
+'iguides.ru',
+'urod.ru',
+'westwing.ru',
+'timeout.ru',
+'dw.com',
+'pandoraopen.ru',
+'autochel.ru',
+'tourister.ru',
+'cnews.ru',
+'pronedra.ru',
+'zadolba.li',
+'rap.ru',
+'112.ua',
+'molodost.bz',
+'mirsovetov.ru',
+'conf.7ya.ru',
+'disgustingmen.com',
+'hi-news.ru',
+'anna-news.info',
+'e-news.su',
+'warandpeace.ru',
+'tvkultura.ru',
+'mirfactov.com',
+'koolinar.ru',
+'evrl.to',
+'cinemate.cc',
+'roem.ru',
+'libertycity.ru',
+'informing.ru',
+'ofigenno.cc',
+'kolmovo.ru',
+'amic.ru',
+'mhealth.ru',
+'autoreview.ru',
+'itc.ua',
+'161.ru',
+'mmohelper.ru',
+'wow-impulse.ru',
+'appleinsider.ru',
+'pravda-tv.ru',
+'avtomarket.ru',
+'newsrbk.ru',
+'gtavicecity.ru',
+'radiomayak.ru',
+'rsute.ru',
+'spbdnevnik.ru',
+'dailymail.co.uk',
+'svopi.ru',
+'akaoray.ru',
+'fc-zenit.ru',
+'macos.livejournal.com',
+'vozduh.afisha.ru',
+'city-n.ru',
+'furfur.me',
+'ru.euronews.com',
+'metronews.ru',
+'vgtimes.ru',
+'nstarikov.ru',
+'polit.ru',
+'zoom.cnews.ru',
+'hiji.ru',
+'gordonua.com',
+'bigpicture.ru',
+'prestige-gaming.ru',
+'5-tv.ru',
+'rb.ru',
+'spbvoditel.ru',
+'overclockers.ua',
+'moddb.com',
+'7dach.ru',
+'ohranatruda.ru',
+'ngs24.ru',
+'russian7.ru',
+'nashgorod.ru',
+'rockstargame.ru',
+'nat-geo.ru',
+'gastronom.ru',
+'hitech.vesti.ru',
+'burdastyle.ru',
+'rfpl.org',
+'audi-club.ru',
+'allnokia.ru',
+'3mv.ru',
+'zavuch.ru',
+'news.ykt.ru',
+'lawmix.ru',
+'chita.ru',
+'altapress.ru',
+'domchel.ru',
+'dooralei.ru',
+'be-in.ru',
+'newslab.ru',
+'geekcity.ru',
+'rueconomics.ru',
+'cheat-master.ru',
+'takprosto.cc',
+'dofiga.net',
+'nacrestike.ru',
+'24smi.org',
+'voffka.com',
+'mpsh.ru',
+'vhlru.ru',
+'infox.ru',
+'bbc.co.uk',
+'newstube.ru',
+'womenhealthnet.ru',
+'gazeta.spb.ru',
+'lookatme.ru',
+'ivona.bigmir.net',
+'economics.unian.net',
+'pozneronline.ru',
+'rlocman.ru',
+'w-o-s.ru',
+'wowhead.com',
+'nashpoz.ru',
+'tverigrad.ru',
+'ign.com',
+'diets.ru',
+'demotivation.me',
+'ru.gecid.com',
+'golos-ameriki.ru',
+'finmarket.ru',
+'theguardian.com',
+'amur.info',
+'monavista.ru',
+'arzamas.academy',
+'pravo.ru',
+'edition.cnn.com',
+'ukr.net',
+'travel.drom.ru',
+'cluber.com.ua',
+'bibika.ru',
+'sharij.net',
+'pedsovet.org',
+'masterok.livejournal.com',
+'psychologies.ru',
+'gorod55.ru',
+'esquire.ru',
+'myslo.ru',
+'postnauka.ru',
+'abc-news.ru',
+'dom2.su',
+'volshebnaya-eda.ru',
+'ucheba.ru',
+'medialeaks.ru',
+'artstation.com',
+'kaifolog.ru',
+'relax.ru',
+'bikepost.ru',
+'rusbiathlon.ru',
+'bookmakersrating.ru',
+'culture.ru',
+'7kingdoms.ru',
+'wroom.ru',
+'sobesednik.ru',
+'proufu.ru',
+'chezasite.com',
+'bnkomi.ru',
+'piter.tv',
+'computerra.ru',
+'eer.ru',
+'yaom.ru',
+'rrnews.ru',
+'kpfu.ru',
+'ukraina.ru',
+'gagadget.com',
+'buhgalteria.ru',
+'atlib.ru',
+'wonderzine.com',
+'mmoboom.ru',
+'bucwar.ru',
+'primamedia.ru',
+'47news.ru',
+'klub-drug.ru',
+'kulturologia.ru',
+'bk55.ru',
+'2do2go.ru',
+'securitylab.ru',
+'nakanune.ru',
+'zdorovieinfo.ru',
+'medportal.ru',
+'novate.ru',
+'smotra.ru',
+'hibiny.com',
+'penzainform.ru',
+'buh.ru',
+'hi-fi.ru',
+'dwg.ru',
+'naked-science.ru',
+'ibusiness.ru',
+'fresher.ru',
+'carsguru.net',
+'fit4brain.com',
+'muz-tv.ru',
+'kavkaz-uzel.ru',
+'kitchenmag.ru',
+'ruspoll.ru',
+'wowlol.ru',
+'bcs-express.ru',
+'uralweb.ru',
+'nv.ua',
+'liveleak.com',
+'vasi.net',
+'topspb.tv',
+'sobaka.ru',
+'inmyroom.ru',
+'detkityumen.ru',
+'mirkosmosa.ru',
+'allwomens.ru',
+'kp40.ru',
+'optimakomp.ru',
+'29.ru',
+'trendymen.ru',
+'hardwareluxx.ru',
+'pln-pskov.ru',
+'klops.ru',
+'lfootball.ws',
+'kleo.ru',
+'sputnikipogrom.com',
+'pg21.ru',
+'medikforum.ru',
+'donnews.ru',
+'bankir.ru',
+'news.vse42.ru',
+'searchnews.info',
+'fedpress.ru',
+'fishingsib.ru',
+'podelki-rukami-svoimi.ru',
+'jv.ru',
+'nashaplaneta.su',
+'ideas.vdolevke.ru',
+'diletant.media',
+'gta.com.ua',
+'zagopod.com',
+'rian.com.ua',
+'gov.spb.ru',
+'glamius.ru',
+'yablyk.com',
+'uapress.info',
+'komarovskiy.net',
+'stolica.onego.ru',
+'popcornnews.ru',
+'qrz.ru',
+'rutraveller.ru',
+'ohotniki.ru',
+'progorodsamara.ru',
+'24tv.ua',
+'rusdtp.ru',
+'houzz.ru',
+'chto-proishodit.ru',
+'dnpmag.com',
+'ru.hellomagazine.com',
+'runews24.ru',
+'kak2z.ru',
+'pcgamer.com',
+'ruskline.ru',
+'dr-piliulkin.livejournal.com',
+'dezinfo.net',
+'korzik.net',
+'3rm.info',
+'tv-soyuz.ru',
+'knitka.ru',
+'alimero.ru',
+'planeta.moy.su',
+'elementy.ru',
+'newsli.ru',
+'zabmedia.ru',
+'antifashist.com',
+'tvoytrener.com',
+'elec.ru',
+'domechti.ru',
+'ulpressa.ru',
+'babiki.ru',
+'realty.newsru.com',
+'1obl.ru',
+'motorpage.ru',
+'winline.ru',
+'earth-chronicles.ru',
+'amdn.news',
+'ochepyatki.ru',
+'goodhouse.ru',
+'rt.com',
+'vzsar.ru',
+'buzzfeed.com',
+'bragazeta.ru',
+'tks.ru',
+'womanhit.ru',
+'sostav.ru',
+'ruspravda.info',
+'androidinsider.ru',
+'gdekluet.ru',
+'dejurka.ru',
+'keddr.com',
+'prokazan.ru',
+'vladmama.ru',
+'newtimes.ru',
+'voicesevas.ru',
+'v1.ru',
+'komiinform.ru',
+'chipstone.livejournal.com',
+'properm.ru',
+'searchengines.ru',
+'38mama.ru',
+'videoboom.cc',
+'newsru.co.il',
+'4tololo.ru',
+'mosday.ru',
+'deita.ru',
+'cars.ru',
+'news.allcrimea.net',
+'ufa1.ru',
+'gq.ru',
+'uafootball.org.ua',
+'travel.ru',
+'bn.ru',
+'news.am',
+'tvernews.ru',
+'tomshardware.co.uk',
+'ok-inform.ru',
+'tproger.ru',
+'shophelp.ru',
+'news.tut.by',
+'spb.aif.ru',
+'nytimes.com',
+'verstov.info',
+'droider.ru',
+'batona.net',
+'gamespot.com',
+'sarbc.ru',
+'dribbble.com',
+'nkj.ru',
+'vokrugsveta.ru',
+'vestiprim.ru',
+'kp.ua',
+'restate.ru',
+'glamour.ru',
+'doctorpiter.ru',
+'76.ru',
+'inforesist.org',
+'rzn.info',
+'spartak.com',
+'progorod11.ru',
+'e-xecutive.ru',
+'kdelo.ru',
+'jevons1.com',
+'news.day.az',
+'hochu.ua',
+'prophotos.ru',
+'4living.ru',
+'rusradio.ru',
+'kvadroom.ru',
+'nevnov.ru',
+'om1.ru',
+'omskinform.ru',
+'nahnews.org',
+'riarealty.ru',
+'avtoradio.ru',
+'homyak55.ru',
+'papaimama.ru',
+'reuters.com',
+'ngs55.ru',
+'lvrach.ru',
+'nvworld.ru',
+'autopeople.ru',
+'livesport.ru',
+'wmj.ru',
+'ru.uefa.com',
+'doseng.org',
+'techpowerup.com',
+'trud.ru',
+'khabmama.ru',
+'vtambove.ru',
+'patriarchia.ru',
+'progorodnn.ru',
+'art-assorty.ru',
+'gazeta.a42.ru',
+'vev.ru',
+'sdelaysam-svoimirukami.ru',
+'rusjev.net',
+'zagolovki.ru',
+'pressa.tv',
+'sarnovosti.ru',
+'kazanfirst.ru',
+'copypast.ru',
+'mignews.com',
+'gameawards.ru',
+'bloomberg.com',
+'facenewss.ru',
+'mforum.ru',
+'samru.ru',
+'rockpapershotgun.com',
+'gallerix.ru',
+'pravdoryb.info',
+'diy.ru',
+'rmnt.ru',
+'autosaratov.ru',
+'antipriunil.ru',
+'yuga.ru',
+'vitaportal.ru',
+'vogue.ru',
+'newsonline24.com.ua',
+'android-help.ru',
+'joinfo.ua',
+'meganovosti.net',
+'planet-today.ru',
+'chinamobil.ru',
+'tltgorod.ru',
+'freeseller.ru',
+'nversia.ru',
+'jpgazeta.ru',
+'ellegirl.ru',
+'tele.ru',
+'probirka.org',
+'pribalt.info',
+'bg.ru',
+'vashgorod.ru',
+'1gai.ru',
+'fithacker.ru',
+'darievna.ru',
+'36on.ru',
+'readtoday.ru',
+'domihobby.ru',
+'internet-technologies.ru',
+'irinazaytseva.ru',
+'nsknews.info',
+'telegraf.com.ua',
+'chemport.ru',
+'fotokomok.ru',
+'cameralabs.org',
+'mchs.gov.ru',
+'rostovdrive.ru',
+'grimnir74.livejournal.com',
+'riavrn.ru',
+'province.ru',
+'letnews.ru',
+'progorod43.ru',
+'andychef.ru',
+'dk.ru',
+'dni24.com',
+'rus.newsru.ua',
+'mr7.ru',
+'wordyou.ru',
+'stereo.ru',
+'gay.ru',
+'utmagazine.ru',
+'ya62.ru',
+'purmix.ru',
+'5koleso.ru',
+'zakon.ru',
+'seonews.ru',
+'metaltorg.ru',
+'unn.com.ua',
+'kgd.ru',
+'onedio.ru',
+'flot.com',
+'zol.ru',
+'eg-online.ru',
+'fakty.ictv.ua',
+'newsforamericans.com',
+'zn.ua',
+'rifey.ru',
+'dialog.ua',
+'psycabi.net',
+'gorodskoyportal.ru',
+'blackpantera.ru',
+'tv2.tomsk.ru',
+'brodude.ru',
+'bloknot-volgograd.ru',
+'aillarionov.livejournal.com',
+'gotps3.ru',
+'lady.tochka.net',
+'medicinform.net',
+'videozal.net',
+'zhenskiy-sait.ru',
+'ru.tv',
+'arms-expo.ru',
+'prikol.ru',
+'krabov.net',
+'n4k.ru',
+'museum.ru',
+'fontanka.fi',
+'the-challenger.ru',
+'sledcomrf.ru',
+'newsader.com',
+'zelenograd.ru',
+'avia.pro',
+'bloknot-voronezh.ru',
+'theoryandpractice.ru',
+'buro247.ru',
+'telegraph.co.uk',
+'njcar.ru',
+'iphone-gps.ru',
+'sport.bigmir.net',
+'soccerlivehd.com',
+'topgearrussia.ru',
+'argumentiru.com',
+'metrolyrics.com',
+'dvnovosti.ru',
+'infowoman.com.ua',
+'riasv.ru',
+'bankingsite.ru',
+'mgnews.ru',
+'sredstva.ru',
+'cossa.ru',
+'vg247.com',
+'molnet.ru',
+'grammio.com',
+'sovsekretno.ru',
+'etotdom.com',
+'lipetskmedia.ru',
+'video.bigmir.net',
+'nexplorer.ru',
+'beremennost.net',
+'filmz.ru',
+'ski.ru',
+'24gadget.ru',
+'rus.delfi.lv',
+'sotovik.ru',
+'online812.ru',
+'knowyourmeme.com',
+'howtogeek.com',
+'nsn.fm',
+'mobiledevice.ru',
+'ozpp.ru',
+'colta.ru',
+'guru3d.com',
+'31tv.ru',
+'gorodkirov.ru',
+'nikolaeva.livejournal.com',
+'hitech.newsru.com',
+'starslife.ru',
+'gazeta-unp.ru',
+'rosteplo.ru',
+'allcarz.ru',
+'tourprom.ru',
+'devaka.ru',
+'bloknot-rostov.ru',
+'peterburg2.ru',
+'nur.kz',
+'gardenia.ru',
+'ug.ru',
+'independent.co.uk',
+'bashinform.ru',
+'etoday.ru',
+'autonet.ru',
+'vostokmedia.com',
+'krsk.sibnovosti.ru',
+'medlinks.ru',
+'xage.ru',
+'myfreesoft.ru',
+'viperson.ru',
+'trkterra.ru',
+'kinokadr.ru',
+'interviewrussia.ru',
+'aksakal.tv',
+'vicer.ru',
+'irn.ru',
+'yugopolis.ru',
+'islam-today.ru',
+'btimes.ru',
+'rusactors.ru',
+'gaming.msi.com',
+'redigo.ru',
+'vpk-news.ru',
+'politolog.net',
+'hronika.info',
+'oilru.com',
+'sntat.ru',
+'ekburg.ru',
+'auto.newsru.com',
+'teknoblog.ru',
+'washingtonpost.com',
+'kinofilms.ua',
+'pics.ru',
+'tumix.ru',
+'cnet.com',
+'rustelegraph.ru',
+'marrietta.ru',
+'botanichka.ru',
+'piterburger.ru',
+'fitseven.ru',
+'okino.ua',
+'mastera-rukodeliya.ru',
+'domnika.ru',
+'newizv.ru',
+'army-news.ru',
+'korfiati.ru',
+'otr-online.ru',
+'pravdaurfo.ru',
+'mngz.ru',
+'nevsedoma.com.ua',
+'product-test.ru',
+'newrezume.org',
+'blognews.am',
+'philologist.livejournal.com',
+'almodi.org',
+'carobka.ru',
+'exkavator.ru',
+'by24.org',
+'news.auto.ru',
+'tvk6.ru',
+'yoursputnik.ru',
+'mylitta.ru',
+'mel.fm',
+'livekuban.ru',
+'perm.aif.ru',
+'turizm.ru',
+'osp.ru',
+'uralinform.ru',
+'procrf.ru',
+'finam.info',
+'saratovnews.ru',
+'marieclaire.ru',
+'secure.avaaz.org',
+'womenclub.ru',
+'signorina.ru',
+'kapital-rus.ru',
+'nedeli.org',
+'vtb.ru',
+'allure.ru',
+'myspace.com',
+'health-ua.org',
+'huffingtonpost.com',
+'ain.ua',
+'ufacitynews.ru',
+'trikky.ru',
+'tv.ua',
+'passion.ru',
+'storyfox.ru',
+'crimea.kp.ru',
+'ipadstory.ru',
+'mycharm.ru',
+'forbes.com',
+'prelest.com',
+'foodclub.ru',
+'idi-k-nam.ru',
+'spicami.ru',
+'medicus.ru',
+'android4all.ru',
+'novostroy-m.ru',
+'moscow-post.com',
+'fashiontime.ru',
+'mk-london.co.uk',
+'htn.su',
+'paperpaper.ru',
+'rospres.com',
+'unikassa.ru',
+'zoopicture.ru',
+'knitplanet.ru',
+'resobr.ru',
+'novayagazeta-ug.ru',
+'energovopros.ru',
+'lyxavto.ru',
+'vsezdorovo.com',
+'dela-ruk.ru',
+'top-antropos.com',
+'crimea.ria.ru',
+'taxpravo.ru',
+'ikirov.ru',
+'interfax.com.ua',
+'goodvesti.ru',
+'sofascore.com',
+'vremyan.ru',
+'mag.relax.by',
+'myjane.ru',
+'supersadovnik.ru',
+'povozcar.ru',
+'animal.ru',
+'an-crimea.ru',
+'informnapalm.org',
+'menobr.ru',
+'depo.ua',
+'ntpo.com',
+'domovouyasha.ru',
+'comandir.com',
+'mobiset.ru',
+'turbina.ru',
+'tribuna.ru',
+'wek.ru',
+'updiet.info',
+'insider.pro',
+'kvedomosti.com',
+'saint-petersburg.ru',
+'restoran.ru',
+'tatar-inform.ru',
+'blogimam.com',
+'carexpert.ru',
+'techno.bigmir.net',
+'mirror.co.uk',
+'f1cd.ru',
+'vlasti.net',
+'ukranews.com',
+'lifehacker.com',
+'prikol.i.ua',
+'imenno.ru',
+'whoswho.com.ua',
+'nbcnews.com',
+'indystar.com',
+'zergulio.livejournal.com',
+'116.ru',
+'zina-korzina.livejournal.com',
+'pe.com',
+'cyber.sports.ru',
+'news.meta.ua',
+'lingorado.com',
+'ampravda.ru',
+'ru.golos.ua',
+'gwinplane.livejournal.com',
+'cbssports.com',
+'sport.tut.by',
+'fapl.ru',
+'profile.ru',
+'shpilenok.livejournal.com',
+'volgograd.kp.ru',
+'sapojnik.livejournal.com',
+'chicagotribune.com',
+'portal-credo.ru',
+'fintraining.livejournal.com',
+'kungurov.livejournal.com',
+'oldfisher-mk.livejournal.com',
+'kosmos-x.net.ru',
+'npr.org',
+'twincities.com',
+'aex.ru',
+'mb.onliner.by',
+'vesiskitim.ru',
+'rua.gr',
+'gusev-online.ru',
+'blog.yandex.ru',
+'heraldsun.com.au',
+'chel.mk.ru',
+'info-tses.kz',
+'militaryexp.com',
+'cikavosti.com',
+'vestnik-rm.ru',
+'nsk.dk.ru',
+'chistoprudov.livejournal.com',
+'ru-healthlife.livejournal.com',
+'vestitambov.ru',
+'jobs.tut.by',
+'kurer-sreda.ru',
+'bloombergview.com',
+'thenewstribune.com',
+'izh.kp.ru',
+'tv21.ru',
+'hindustantimes.com',
+'businesswire.com',
+'bankfax.ru',
+'ato.ru',
+'bryansktoday.ru',
+'dtpptz.ru',
+'mzadornov.livejournal.com',
+'doktor-killer.livejournal.com',
+'motonews.ru',
+'penza-press.ru',
+'iran.ru',
+'9to5mac.com',
+'dima-pashchenko.livejournal.com',
+'bloknot-stavropol.ru',
+'dynamo.kiev.ua',
+'motogonki.ru',
+'fortune.com',
+'pushba.livejournal.com',
+'yarnovosti.com',
+'uralpress.ru',
+'wsj.com',
+'rabochy-put.ru',
+'eurointegration.com.ua',
+'prosportkz.kz',
+'ufa-room.ru',
+'brainpickings.org',
+'sport.business-gazeta.ru',
+'radulova.livejournal.com',
+'pg12.ru',
+'asfera.info',
+'smbc-comics.com',
+'whatculture.com',
+'foto-history.livejournal.com',
+'zdnet.com',
+'motogp-news.ru',
+'media-polesye.by',
+'vsenovostint.ru',
+'kolyan.net',
+'dirty.ru',
+'kineshemec.ru',
+'izrus.co.il',
+'dailyherald.com',
+'csmonitor.com',
+'mogilev.jobs.tut.by',
+'in-news.ru',
+'novostink.ru',
+'xn----8sbeybxdibygm.ru-an.info',
+'spb-auto.livejournal.com',
+'strangernn.livejournal.com',
+'ngs42.ru',
+'kriminalnn.ru',
+'newsmsk.com',
+'esotericblog.ru',
+'rweek.ru',
+'grey-croco.livejournal.com',
+'volg.mk.ru',
+'comingsoon.net',
+'siliconrus.com',
+'nvo.ng.ru',
+'alternathistory.livejournal.com',
+'krasnoturinsk.info',
+'oblgazeta.ru',
+'engadget.com',
+'sportfm.ru',
+'politichanka.livejournal.com',
+'androidauthority.com',
+'fondsk.ru',
+'bankrate.com',
+'neowin.net',
+'vestikavkaza.ru',
+'flackelf.livejournal.com',
+'readwrite.com',
+'radonezh.ru',
+'kase.kz',
+'cracked.com',
+'udmtv.ru',
+'arigus-tv.ru',
+'otvprim.ru',
+'ufa.rbc.ru',
+'sibdepo.ru',
+'eu-shestakov.livejournal.com',
+'i4u.com',
+'newsday.com',
+'yug.svpressa.ru',
+'krasnoyarsk.dk.ru',
+'lib.komarovskiy.net',
+'lada.kz',
+'baikal-media.ru',
+'news.sky.com',
+'belnovosti.by',
+'otdam-darom.livejournal.com',
+'recode.net',
+'vice.com',
+'grozny.tv',
+'ru-chp.livejournal.com',
+'stalic.livejournal.com',
+'gosh100.livejournal.com',
+'vibirai.ru',
+'buzulukmedia.ru',
+'chessok.net',
+'tula.aif.ru',
+'dvinainform.ru',
+'rgvktv.ru',
+'vinauto777.livejournal.com',
+'azcentral.com',
+'newsler.ru',
+'top.rbc.ru',
+'kvnews.ru',
+'altai.aif.ru',
+'kazan.kp.ru',
+'irk.kp.ru',
+'pravdoiskatel77.livejournal.com',
+'dailydot.com',
+'limonov-eduard.livejournal.com',
+'fastcompany.com',
+'zpravda.ru',
+'belapan.com',
+'washingtontimes.com',
+'journalstar.com',
+'articles.chita.ru',
+'cnbc.com',
+'spulers.livejournal.com',
+'telegraf.by',
+'stoletie.ru',
+'nnov.kp.ru',
+'startribune.com',
+'vsluh.ru',
+'finance.nur.kz',
+'gorno-altaisk.info',
+'gipsyteam.ru',
+'prikol.bigmir.net',
+'gotennis.ru',
+'chelseablues.ru',
+'themarysue.com',
+'sl-lopatnikov.livejournal.com',
+'chehov-vid.ru',
+'economist.com',
+'cultofmac.com',
+'el-murid.livejournal.com',
+'shel-gilbo.livejournal.com',
+'serfilatov.livejournal.com',
+'mr-rf.ru',
+'go31.ru',
+'bulochnikov.livejournal.com',
+'beauty.passion.ru',
+'ru.publika.md',
+'dangerousminds.net',
+'gorodskievesti.ru',
+'cnn.com',
+'nasdaq.com',
+'geektyrant.com',
+'realt.onliner.by',
+'gorod-che.ru',
+'islamdag.ru',
+'42.tut.by',
+'verola.livejournal.com',
+'news.vtomske.ru',
+'muravei-s.livejournal.com',
+'goal.com',
+'eugenyshultz.livejournal.com',
+'nbcbayarea.com',
+'dobryanka.net',
+'gawker.com',
+'contracostatimes.com',
+'spin.com',
+'thestar.com',
+'belta.by',
+'ria56.ru',
+'abc.net.au',
+'e-kazan.ru',
+'zaks.ru',
+'hollywoodreporter.com',
+'a-nikonov.livejournal.com',
+'vluki.ru',
+'factmag.com',
+'auto.kz',
+'sport-igrok.ru',
+'karpovka.net',
+'dymontiger.livejournal.com',
+'doc.rt.com',
+'metroelf.livejournal.com',
+'michurinsk.ru',
+'scmp.com',
+'your-look-today.livejournal.com',
+'computerworld.com',
+'chelny-izvest.ru',
+'wired.com',
+'pressdemocrat.com',
+'revda-info.ru',
+'vesti.irk.ru',
+'chepetsk.ru',
+'dnr-news.com',
+'1news.az',
+'philly.com',
+'kt.kz',
+'sochi-express.ru',
+'alexandrafl.livejournal.com',
+'omskzdes.ru',
+'gazetaby.com',
+'ugra-news.ru',
+'csnphilly.com',
+'ij-adult.livejournal.com',
+'u74.ru',
+'lubernet.ru',
+'russos.livejournal.com',
+'intex-press.by',
+'yesasia.ru',
+'bostonherald.com',
+'androidcentral.com',
+'blagin-anton.livejournal.com',
+'friend.livejournal.com',
+'novgaz-rzn.ru',
+'prokopievsk.ru',
+'spb.kp.ru',
+'prophotos-ru.livejournal.com',
+'mentalfloss.com',
+'av.by',
+'soba4ki.livejournal.com',
+'pro.tonkosti.ru',
+'salamnews.org',
+'fsrussia.ru',
+'9tv.co.il',
+'gtrk-omsk.ru',
+'te-st.ru',
+'gubdaily.ru',
+'gomel.today',
+'kirovnet.ru',
+'news.join.ua',
+'novostroy-spb.ru',
+'musictimes.com',
+'blastr.com',
+'yp.fedpress.ru',
+'usatoday.com',
+'blog.fontanka.ru',
+'usolie.info',
+'profit.kz',
+'marpravda.ru',
+'france24.com',
+'sutynews.ru',
+'wolsk.ru',
+'vdomodedovo.info',
+'chervonec-001.livejournal.com',
+'comicvine.com',
+'kavkaz.mk.ru',
+'oregonlive.com',
+'social.ridus.ru',
+'evo-lutio.livejournal.com',
+'astrakhan-24.ru',
+'uchvatovsb.livejournal.com',
+'avvakoum.livejournal.com',
+'onliner.by',
+'burckina-faso.livejournal.com',
+'spydell.livejournal.com',
+'freedom.livejournal.com',
+'ru.ign.com',
+'ria-m.tv',
+'interesno.co',
+'smh.com.au',
+'pg13.ru',
+'syasnews.ru',
+'vestivrn.ru',
+'phonearena.com',
+'nme.com',
+'timesunion.com',
+'charsov.livejournal.com',
+'isra.com',
+'astanatv.kz',
+'moygorod-online.ru',
+'sem40.ru',
+'militariorg.ucoz.ru',
+'news.com.au',
+'espn.go.com',
+'deseretnews.com',
+'azerisport.com',
+'sciencealert.com',
+'orlandosentinel.com',
+'vgoroden.ru',
+'novorosinform.org',
+'novosti.dn.ua',
+'liwli.ru',
+'likeni.ru',
+'tettie.livejournal.com',
+'gothamist.com',
+'vrn.mk.ru',
+'comicbookresources.com',
+'tlt.ru',
+'inter.ua',
+'govorun26.ru',
+'sport.nur.kz',
+'7info.ru',
+'infpol.ru',
+'ng.kz',
+'gmorder.livejournal.com',
+'sibkray.ru',
+'thedenverchannel.com',
+'kurgan.ru',
+'vseprosport.ru',
+'crimsonalter.livejournal.com',
+'lady.nur.kz',
+'moto-magazine.ru',
+'geeksaresexy.net',
+'vv-34.ru',
+'wow-impulse.net',
+'echonedeli.ru',
+'globalaffairs.ru',
+'ibigdan.com',
+'kansascity.com',
+'the-day-x.ru',
+'vesti.az',
+'melon-panda.livejournal.com',
+'tatler.ru',
+'novorus.info',
+'gorky-look.livejournal.com',
+'waralbum.ru',
+'shri-boomer.livejournal.com',
+'text.khl.ru',
+'thecrimson.com',
+'briansk.ru',
+'shakkar.livejournal.com',
+'saracinua.livejournal.com',
+'nsk.kp.ru',
+'kentucky.com',
+'astronews.ru',
+'mikle1.livejournal.com',
+'ptoday.ru',
+'novgorod.ru',
+'vesti-sochi.tv',
+'samara.kp.ru',
+'swissinfo.ch',
+'ufatime.ru',
+'holmogor.livejournal.com',
+'alt.kp.ru',
+'humus.livejournal.com',
+'ancient-origins.net',
+'russianshowbiz.info',
+'sv.ru-m.org',
+'interfax.by',
+'skisport.ru',
+'zakon.kz',
+'sochi.com',
+'pro-n.by',
+'greenchelman-3.livejournal.com',
+'consequenceofsound.net',
+'nyka-huldra.livejournal.com',
+'perevodika.ru',
+'ntv.livejournal.com',
+'wired.co.uk',
+'total.kz',
+'morena-morana.livejournal.com',
+'ru.delfi.lt',
+'katysha.livejournal.com',
+'media.club4x4.ru',
+'dilbert.com',
+'droid-life.com',
+'mainfun.ru',
+'screenrant.com',
+'domodedovod.ru',
+'ont.by',
+'news.vdv-s.ru',
+'kalmykia-online.ru',
+'kaluga24.tv',
+'ok-magazine.ru',
+'sense-life.com',
+'ctv.ca',
+'grantland.com',
+'kolomna-spravka.ru',
+'sport.kazanfirst.ru',
+'gazetairkutsk.ru',
+'t.rbc.ru',
+'pcworld.com',
+'opposingviews.com',
+'rbcdaily.ru',
+'dom.63.ru',
+'trisosny.ru',
+'progorod33.ru',
+'kaliningrad.kp.ru',
+'bgr.com',
+'reason.com',
+'al.com',
+'mediamatters.org',
+'businessspectator.com.au',
+'kashin.guru',
+'syracuse.com',
+'dubikvit.livejournal.com',
+'fritzmorgen.livejournal.com',
+'foodclub-ru.livejournal.com',
+'goloskarpat.info',
+'paparazzi.ru',
+'malyshi.livejournal.com',
+'bit.ua',
+'netall.ru',
+'news.megatyumen.ru',
+'rus.azattyq.org',
+'isurok.livejournal.com',
+'inamora.livejournal.com',
+'volha.livejournal.com',
+'mediaite.com',
+'cinemablend.com',
+'potsreotizm.livejournal.com',
+'ufa.kp.ru',
+'dymovskiy-name.livejournal.com',
+'hor.passion.ru',
+'168.ru',
+'huffingtonpost.co.uk',
+'reb.by',
+'caravan.kz',
+'vesti48.ru',
+'vott.ru',
+'kirov-portal.ru',
+'news.vitebsk.cc',
+'110km.ru',
+'theglobeandmail.com',
+'novokuznetsk.su',
+'ivanoctober.livejournal.com',
+'kuban.mk.ru',
+'uproxx.com',
+'gezitter.org',
+'thestreet.com',
+'letchikleha.livejournal.com',
+'slashgear.com',
+'rusanalit.livejournal.com',
+'reporter.akipress.org',
+'moneycontrol.com',
+'polygon.com',
+'mashkind.livejournal.com',
+'cheremuha.com',
+'odsgomel.org',
+'chaskor.ru',
+'bespridanitsa.livejournal.com',
+'frant.me',
+'prilepin.livejournal.com',
+'pgatour.com',
+'hqroom.ru',
+'kotaku.com',
+'dolboeb.livejournal.com',
+'ej.by',
+'gizmodo.com',
+'irek-murtazin.livejournal.com',
+'barrons.com',
+'syzran-small.ru',
+'sportbo.ru',
+'xn----ctbsbazhbctieai.ru-an.info',
+'holodilnik.info',
+'digitalspy.com',
+'fratria.ru',
+'time.com',
+'vesti42.ru',
+'365news.biz',
+'upi.com',
+'xn--h1akeme.ru-an.info',
+'dengi.59.ru',
+'ast-news.ru',
+'blogs.pravda.com.ua',
+'sergeydolya.livejournal.com',
+'independent.ie',
+'sibved.livejournal.com',
+'nypost.com',
+'bimru.ru',
+'ru-aviation.livejournal.com',
+'theregister.co.uk',
+'thestir.cafemom.com',
+'forbes.kz',
+'roman-n.livejournal.com',
+'realty.vesti.ru',
+'indianexpress.com',
+'rapsinews.ru',
+'ulan.mk.ru',
+'vg-saveliev.livejournal.com',
+'secondstreet.ru',
+'vnnews.ru',
+'ara-bublik.livejournal.com',
+'yurayakunin.livejournal.com',
+'zelenyikot.livejournal.com',
+'newsko.ru',
+'visualhistory.livejournal.com',
+'bnews.kz',
+'tomsk.ru',
+'alternet.org',
+'ural.kp.ru',
+'zarulem.by',
+'blog.netpeak.ua',
+'macworld.com',
+'sport.ru',
+'desmoinesregister.com',
+'vsegda-tvoj.livejournal.com',
+'news.1777.ru',
+'nfl.com',
+'putin-today.ru',
+'dw.de',
+'hurriyetdailynews.com',
+'tampabay.com',
+'7mednews.ru',
+'macleans.ca',
+'malka-lorenz.livejournal.com',
+'dv.kp.ru',
+'chastnik.ru',
+'gazetarb.ru',
+'alexandr-rogers.livejournal.com',
+'astrakhanfm.ru',
+'newsweek.com',
+'novorossy.ru',
+'365info.kz',
+'baltimoresun.com',
+'saratov.kp.ru',
+'region15.ru',
+'nsktv.ru',
+'ft.com',
+'kak-eto-sdelano.livejournal.com',
+'spb.sovsport.ru',
+'theoatmeal.com',
+'avclub.com',
+'auto.29.ru',
+'apsny.ge',
+'omg.md',
+'obninsk.name',
+'journalufa.com',
+'ndn.info',
+'tayga.info',
+'sciencedump.com',
+'homester.com.ua',
+'krylov.livejournal.com',
+'beerplace.com.ua',
+'natamax.livejournal.com',
+'rusathletics.com',
+'cursiv.ru',
+'mmaboxing.ru',
+'facte.ru',
+'dorkly.com',
+'ofeliyadd.livejournal.com',
+'kazan.mk.ru',
+'fototelegraf.ru',
+'tv29.ru',
+'tut.by',
+'35media.ru',
+'rgo.ru',
+'yarjal.com',
+'bleacherreport.com',
+'hata.by',
+'oper-1974.livejournal.com',
+'livescience.com',
+'io9.com',
+'people.com',
+'theweek.com',
+'nymag.com',
+'businessinsider.com',
+'primecrime.ru',
+'gazeta13.ru',
+'irsenas.livejournal.com',
+'russiapost.su',
+'trend.az',
+'tkgorod.ru',
+'politico.com',
+'apn.ru',
+'andreistp.livejournal.com',
+'adweek.com',
+'stuff.co.nz',
+'space.com',
+'sarapul.net',
+'ko44.ru',
+'yar.kp.ru',
+'exler.livejournal.com',
+'newser.com',
+'penzanews.ru',
+'sportsgrid.com',
+'vlast.kz',
+'informationweek.com',
+'vidsboku.com',
+'mstrok.ru',
+'webmastermaksim.ru',
+'ukrinform.ua',
+'geo.ru',
+'galkovsky.livejournal.com',
+'karel.mk.ru',
+'mir-mag.livejournal.com',
+'prosto-gost.livejournal.com',
+'k-ur.ru',
+'mhl.khl.ru',
+'news.novgorod.ru',
+'cleveland.com',
+'theage.com.au',
+'kenigtiger.livejournal.com',
+'unian.ua',
+'starshinazapasa.livejournal.com',
+'yuripasholok.livejournal.com',
+'deadline.com',
+'aljazeera.com',
+'timesofisrael.com',
+'people-press.org',
+'medpagetoday.com',
+'freep.com',
+'aviaport.ru',
+'make-your-style.livejournal.com',
+'examiner.com',
+'phys.org',
+'andrei-bt.livejournal.com',
+'glamurchik.tochka.net',
+'newsinfo.inquirer.net',
+'altpress.com',
+'ibtimes.co.uk',
+'rul.by',
+'nationalreview.com',
+'lasvegassun.com',
+'gagauzinfo.md',
+'dailynews.com',
+'bohemicus.livejournal.com',
+'amfora.livejournal.com',
+'adindex.ru',
+'chispa1707.livejournal.com',
+'autoban.by',
+'portal-kultura.ru',
+'matrony.ru',
+'omsk.kp.ru',
+'podrobno.uz',
+'rusila.su',
+'dom.72.ru',
+'fn-volga.ru',
+'martin.livejournal.com',
+'thehindu.com',
+'miloserdie.ru',
+'sportingnews.com',
+'networkworld.com',
+'seattlepi.com',
+'ctv.by',
+'vseneobichnoe.livejournal.com',
+'techtimes.com',
+'macrumors.com',
+'novayagazeta.livejournal.com',
+'spiked-online.com',
+'aquatek-filips.livejournal.com',
+'sitv.ru',
+'arbaletfire.livejournal.com',
+'zavtra.ru',
+'chernovik.net',
+'evrazia.org',
+'news29.ru',
+'alex-aka-jj.livejournal.com',
+'luki.ru',
+'usnews.com',
+'xn--90aiasbk5as2f.xn--p1ai',
+'cardesign.ru',
+'newsbabr.com',
+'info.sibnet.ru',
+'wik-end.com',
+'flytothesky.ru',
+'rostov.rbc.ru',
+'ryazan.kp.ru',
+'rostov.kp.ru',
+'billionnews.ru',
+'admagazine.ru',
+'rebro-a-dama.livejournal.com',
+'velolive.com',
+'vb.kg',
+'sarinform.ru',
+'stainlesstlrat.livejournal.com',
+'metalinjection.net',
+'amurmedia.ru',
+'top.thepo.st',
+'che-online.com',
+'volga-tv.ru',
+'mercurynews.com',
+'rodgor-vlg.ru',
+'komikz.ru',
+'ca-news.org',
+'greenpeace.org',
+'alex-leshy.livejournal.com',
+'valyaeva.ru',
+'usmagazine.com',
+'sergeytsvetkov.livejournal.com',
+'tradelikeapro.ru',
+'autostat.ru',
+'go32.ru',
+'mediapost.com',
+'ru-an.info',
+'mixednews.ru',
+'auto.161.ru',
+'most.tv',
+'yarnews.net',
+'tvtomsk.ru',
+'xkcd.com',
+'riatomsk.ru',
+'ais.by',
+'4vsar.ru',
+'khabar.ibnlive.com',
+'infodoktor.by',
+'eaomedia.ru',
+'laughingsquid.com',
+'islamnews.ru',
+'masslive.com',
+'glazovportal.net',
+'forum.gipsyteam.ru',
+'sport-weekend.com',
+'express.co.uk',
+'riadagestan.ru',
+'politsovet.ru',
+'pryf.livejournal.com',
+'chrono-tm.org',
+'newsroom24.ru',
+'rbworld.org',
+'sports.kz',
+'puerrtto.livejournal.com',
+'konkretno.ru',
+'kursiv.kz',
+'money.rbc.ru',
+'tutuskania.livejournal.com',
+'arbatovagidepar.livejournal.com',
+'rollingstone.com',
+'nslovo.info',
+'newsbel.by',
+'thestate.com',
+'theatlantic.com',
+'ivanovonews.ru',
+'ao.by',
+'sportsdaily.ru',
+'pushkino.tv',
+'kg.akipress.org',
+'kopeika.org',
+'royalcheese.ru',
+'tmz.com',
+'ab.onliner.by',
+'zwezda.net',
+'diapazon.kz',
+'kagemushanatako.livejournal.com',
+'pravdapfo.ru',
+'afn.by',
+'24.kg',
+'niann.ru',
+'cbsnews.com',
+'weeklystandard.com',
+'ufacity.info',
+'gorodusinsk.ru',
+'newsarama.com',
+'pinwin.ru',
+'indiatimes.com',
+'doodoo.ru',
+'sun-sentinel.com',
+'variety.com',
+'diak-kuraev.livejournal.com',
+'maks-portal.ru',
+'73online.ru',
+'slate.com',
+'beautyinsider.ru',
+'kiss-my-abs.livejournal.com',
+'auto.altapress.ru',
+'day.az',
+'dawn.com',
+'prima-tv.ru',
+'ruscur.ru',
+'omskpress.ru',
+'awas1952.livejournal.com',
+'dom.59.ru',
+'samara.ru',
+'bikeradar.com',
+'engineering-ru.livejournal.com',
+'xn----ctbsbaa3aibxhck.ru-an.info',
+'video.khl.ru',
+'thesun.co.uk',
+'ajc.com',
+'technologyreview.com',
+'vesti-ukr.com',
+'ekb.rbc.ru',
+'8plus1.ru',
+'korabel.ru',
+'k1news.ru',
+'mixnews.lv',
+'ekb.dk.ru',
+'pavel-sviridov.livejournal.com',
+'courant.com',
+'scientificamerican.com',
+'dnaindia.com',
+'popsci.com',
+'aftershock-1.livejournal.com',
+'ubergizmo.com',
+'ndtv.com',
+'zabinfo.ru',
+'prochepetsk.ru',
+'superomsk.ru',
+'ivakin-alexey.livejournal.com',
+'discovery.com',
+'utexas.edu',
+'gts.tv',
+'footballtop.ru',
+'bloody-disgusting.com',
+'arstechnica.com',
+'vykza.ru',
+'vaduhan-08.livejournal.com',
+'bither.livejournal.com',
+'rus-obr.ru',
+'sakhalin.info',
+'bocharik.livejournal.com',
+'drugoigorod.ru',
+'topic.lt',
+'putin-slil.livejournal.com',
+'pavel-shipilin.livejournal.com',
+'geek.com',
+'darsik-dasha.livejournal.com',
+'tver.kp.ru',
+'aktau-business.com',
+'volna.afisha.ru',
+'informpskov.ru',
+'susanin.udm.ru',
+'venturebeat.com',
+'mcall.com',
+'denofgeek.com',
+'artemdragunov.livejournal.com',
+'niasam.ru',
+'communitarian.ru',
+'kalugahouse.ru',
+'solnyszka.livejournal.com',
+'stltoday.com',
+'periskop.livejournal.com',
+'technobuffalo.com',
+'rugrad.eu',
+'extremetech.com',
+'miamiherald.com',
+'digitaltrends.com',
+'kuban.rbc.ru',
+'fox4kc.com',
+'newsok.com',
+'gtrk.tv',
+'yerkramas.org',
+'rt.rbc.ru',
+'nbcsports.com',
+'bizjournals.com',
+'2x2.su',
+'dailycaller.com',
+'v102.ru',
+'nydailynews.com',
+'ysia.ru',
+'biathlonrus.com',
+'bloodandsweat.ru',
+'newsvo.ru',
+'nn.mk.ru',
+'people.passion.ru',
+'biserok.org',
+'orenday.ru',
+'marketwatch.com',
+'afanasy.biz',
+'ya-kadyrov.livejournal.com',
+'chelnyltd.ru',
+'truthdig.com',
+'uk.eonline.com',
+'bobsoccer.ru',
+'kv.by',
+'realty.ngs.ru',
+'mirf.ru',
+'u-tv.ru',
+'mk.tula.ru',
+'adn.com',
+'star-telegram.com',
+'techradar.com',
+'ru-cats.livejournal.com',
+'marvel.com',
+'pppirate.livejournal.com',
+'proboknet.livejournal.com',
+'superkarate.ru',
+'drugoi.livejournal.com',
+'mycity.by',
+'pskov.kp.ru',
+'benzinga.com',
+'velikiynovgorod.ru',
+'qestigra.ru',
+'5min.by',
+'kirov.kp.ru',
+'onlinetambov.ru',
+'ibtimes.com',
+'hueviebin1.livejournal.com',
+'pachom.livejournal.com',
+'auto.onliner.by',
+'wrestdag.ru',
+'ex-press.by',
+'beauty-nax.livejournal.com',
+'andreyvadjra.livejournal.com',
+'nesn.com',
+'hrono61.livejournal.com',
+'dailyfinance.com',
+'discred.ru',
+'devyatka.ru',
+'skysports.com',
+'kaluga-poisk.ru',
+'politsib.ru',
+'nationalgeographic.com',
+'ru.reuters.com',
+'alau.kz',
+'perm.rbc.ru',
+'fighttime.ru',
+'ru.apa.az',
+'home-and-garden.livejournal.com',
+'news.nashbryansk.ru',
+'legatus-pretor.livejournal.com',
+'presstv.ir',
+'kuban.kp.ru',
+'kot-de-azur.livejournal.com',
+'kuzpress.ru',
+'comicsalliance.com',
+'tbo.com',
+'viking-nord.livejournal.com',
+'abrod.livejournal.com',
+'svodka.akipress.org',
+'cosharel.livejournal.com',
+'onedivision.ru',
+'tazabek.kg',
+'thinkprogress.org',
+'zasekin.ru',
+'aif.by',
+'strajj.livejournal.com',
+'prweb.com',
+'infobank.by',
+'gg34.ru',
+'sib.fm',
+'koketka.livejournal.com',
+'td5howard.livejournal.com',
+'megatyumen.ru',
+'timbuktoo.livejournal.com',
+'charlotteobserver.com',
+'latimes.com',
+'gazeta-n1.ru',
+'doneck-news.com',
+'scandaly.ru',
+'vesti.ua',
+'newsobserver.com',
+'news.ngs.ru',
+'vkarpinsk.info',
+'putnik1.livejournal.com',
+'pesen-net.livejournal.com',
+'newdaynews.ru',
+'equestrian.ru',
+'fotografersha.livejournal.com',
+'serovglobus.ru',
+'foxbusiness.com',
+'jacksonville.com',
+'ural56.ru',
+'maxfux.livejournal.com',
+'dostup1.ru',
+'tatpressa.ru',
+'nasa.gov',
+'jewish.ru',
+'t-itanium.livejournal.com',
+'dimabalakirev.livejournal.com',
+'mb.com.ph',
+'mosaica.ru',
+'tainy.net',
+'bel.ru',
+'inform.kz',
+'votkinsk.net',
+'odintsovo.info',
+'klaxon.ru',
+'teh-nomad.livejournal.com',
+'lev-sharansky2.livejournal.com',
+'iflscience.com',
+'foxsports.com',
+'got.vg',
+'5sfer.com',
+'android.mobile-review.com',
+'xn--80ajoghfjyj0a.xn--p1ai',
+'irishtimes.com',
+'emelamud.livejournal.com',
+'mnenia.zahav.ru',
+'mgorod.kz',
+'news.ircity.ru',
+'novorossia.su',
+'sexmotor.livejournal.com',
+'wod-1958.livejournal.com',
+'andrey-kuprikov.livejournal.com',
+'kerzak-1.livejournal.com',
+'maxkatz.livejournal.com',
+'portamur.ru',
+'avto.kazanfirst.ru',
+'sledcom.ru',
+'p-i-f.livejournal.com',
+'chern-molnija.livejournal.com',
+'sokol-ff.livejournal.com',
+'cbc.ca',
+'paranormal-news.ru',
+'pitchfork.com',
+'azh.kz',
+'archi.ru',
+'tvcom-tv.ru',
+'salon.com',
+'pora-valit.livejournal.com',
+'cherinfo.ru',
+'football.ua',
+'ai-zhilin.livejournal.com',
+'doktorbel.livejournal.com',
+'tsn.ua',
+'gorobzor.ru',
+'auto.72.ru',
+'dobre.stb.ua',
+'hypetrak.com',
+'53news.ru',
+'mozhga.net',
+'uglich-jj.livejournal.com',
+'npubop.livejournal.com',
+'vox.com',
+'sbnation.com',
+'iskra-kungur.ru',
+'arabic.rt.com',
+'lovigin.livejournal.com',
+'pennlive.com',
+'miss-tramell.livejournal.com',
+'open.by',
+'sacbee.com',
+'udf.by',
+'40161.ru',
+'panzerbar.livejournal.com',
+'rotoworld.com',
+'b-online.ru',
+'oppps.ru',
+'ruscesar.livejournal.com',
+'theins.ru',
+'vesti-yamal.ru',
+'euroradio.fm',
+'grodno24.com',
+'flgr.ru',
+'actualcomment.ru',
+'asiarussia.ru',
+'pravdasevera.ru',
+'apn-spb.ru',
+'samara-ru.livejournal.com',
+'tech.onliner.by',
+'gazetavolgodonsk.ru',
+'walera11.livejournal.com',
+'motherjones.com',
+'techspot.com',
+'molonlabe.livejournal.com',
+'billboard.com',
+'ocregister.com',
+'ctv7.ru',
+'tobolsk.ru',
+'kado4nikov.livejournal.com',
+'tv-rb.ru',
+'fool.com',
+'gorodche.ru',
+'f1-world.ru',
+'tourdom.ru',
+'techbrowsing.com',
+'szhaman.livejournal.com',
+'sb.by',
+'rostec.ru',
+'zacks.com',
+'i-news.kz',
+'chexov.net',
+'mockwa.com',
+'varjag-2007.livejournal.com',
+'privetsochi.ru',
+'waitbutwhy.com',
+'prnewswire.com',
+'chaiknet.ru',
+'prostitutka-ket.livejournal.com',
+'ulyanovskcity.ru',
+'auto.vesti.ru',
+'ihoraksjuta.livejournal.com',
+'rostov.dk.ru',
+'abw.by',
+'avtosreda.ru',
+'segodnia.ru',
+'tanya-mass.livejournal.com',
+'rebenok.by',
+'12news.uz',
+'albert-lex.livejournal.com',
+'boingboing.net',
+'u-96.livejournal.com',
+'denverpost.com',
+'nikitskij.livejournal.com',
+'tavto.ru',
+'odin-moy-den.livejournal.com',
+'nerdist.com',
+'hotnewhiphop.com',
+'newregion.kz',
+'kanchukov-sa.livejournal.com',
+'zebra-tv.ru',
+'chel.kp.ru',
+'primeminister.kz',
+'sfgate.com',
+'murmansk.kp.ru',
+'novos.mk.ru',
+'islam.ru',
+'mlb.com',
+'charter97.org',
+'echo.az',
+'rk.karelia.ru',
+'tvnz.co.nz',
+'volgograd-trv.ru',
+'progorod76.ru',
+'1istochnik.ru',
+'varandej.livejournal.com',
+'newskaz.ru',
+'statesman.com',
+'bleedingcool.com',
+'chel.dk.ru',
+'nemoold.livejournal.com',
+'uborshizzza.livejournal.com',
+'select.by',
+'kem.kp.ru',
+'kapital.kz',
+'uraldaily.ru',
+'abs-cbnnews.com',
+'volkovysk.by',
+'today.com',
+'mi3ch.livejournal.com',
+'rus.ozodi.org',
+'volzsky.ru',
+'macradar.ru',
+'kolobok1973.livejournal.com',
+'littlehirosima.livejournal.com',
+'tofight.ru',
+'canadianbusiness.com',
+'gmichailov.livejournal.com',
+'seva-riga.livejournal.com',
+'stuff.tv',
+'uk.eurosport.yahoo.com',
+'deccanherald.com',
+'rollingstone.ru',
+'eurofootball.ru',
+'palmbeachpost.com',
+'21.by',
+'vmolo.by',
+'hawk.ru',
+'nj.com',
+'vlg.aif.ru',
+'nv-online.info',
+'korea-blog.livejournal.com',
+'baltinfo.ru',
+'rossosh.bloknot-voronezh.ru',
+'meditation-portal.com',
+'bloknot-volzhsky.ru',
+'dpmmax.livejournal.com',
+'ru-auto.livejournal.com',
+'frontpagemag.com',
+'mkala.mk.ru',
+'citysakh.ru',
+'rovego.livejournal.com',
+'allsportinfo.ru',
+'miumau.livejournal.com',
+'rawstory.com',
+'lady.ru',
+'comicbookmovie.com',
+'homes.e1.ru',
+'myudm.ru',
+'nola.com',
+'tengrinews.kz',
+'foxnews.com',
+'stars365.livejournal.com',
+'zt16.ru',
+'vesti-kpss.livejournal.com',
+'weacom.ru',
+'actualidad.rt.com',
+'polosa.co.il',
+'1777.ru',
+'twower.livejournal.com',
+'gigaom.com',
+'pravdanews.info',
+'katun24.ru',
+'barnaul.fm',
+'altaynews.kz',
+'denokan.livejournal.com',
+'uralpolit.ru',
+'tumen.kp.ru',
+'cjonline.com',
+'post-gazette.com',
+'superherohype.com',
+'medicalnewstoday.com',
+'amsrus.ru',
+'om-saratov.ru',
+'nstarikov.livejournal.com',
+'rusrep.ru',
+'oblast45.ru',
+'mtv.com',
+'canadafreepress.com',
+'voanews.com',
+'oleglurie-new.livejournal.com',
+'russkiy-malchik.livejournal.com',
+'finance.tut.by',
+'m-kalashnikov.livejournal.com',
+'vyatka.ru',
+'business-class.su',
+'nationalpost.com',
+'63ru.livejournal.com',
+'mchs.gov.by',
+'naviny.by',
+'ew.com',
+'bloknot-volgodonsk.ru',
+'stogova.livejournal.com',
+'tv.mk.ru',
+'realty.altapress.ru',
+'i-korotchenko.livejournal.com',
+'scalemodels.ru',
+'etoonda.livejournal.com',
+'evening-kazan.ru',
+'bryansknovosti.ru',
+'kushva-online.ru',
+'belaruspartisan.org',
+'inquisitr.com',
+'infokam.su',
+'healthinfo.ua',
+'comicbook.com',
+'mashable.com',
+'washingtonexaminer.com',
+'a-s-k-e-t.livejournal.com',
+'sayanogorsk.info',
+'dgl.ru',
+'pervo.ru',
+'omaha.com',
+'mid-day.com',
+'myfin.by',
+'kotelnich.info',
+'alex-anpilogov.livejournal.com',
+'wrestrus.ru',
+'7x7-journal.ru',
+'natabelu.livejournal.com',
+'biser.info',
+'rus.postimees.ee',
+'dela.ru',
+'digitall-angell.livejournal.com',
+'chron.com',
+'chelny-biz.ru',
+'a-nalgin.livejournal.com',
+'kukmor.livejournal.com',
+'crimerussia.ru',
+'mordovmedia.ru',
+'parade.com',
+'3dtoday.ru',
+'vkusnyblog.ru',
+'newstula.ru',
+'soccernews.ru',
+'eilin-o-connor.livejournal.com',
+'mentbuster.livejournal.com',
+'kaotic.com',
+'rossoshru.ru',
+'she.ngs.ru',
+'news.sarbc.ru',
+'baikal-daily.ru',
+'thequietus.com',
+'flb.ru',
+'stockinfocus.ru',
+'xobi.com.ua',
+'eonline.com',
+'ru-railway.livejournal.com',
+'andrey-cruz.livejournal.com',
+'19rus.info',
+'pauluskp.livejournal.com',
+'calipsodellmar.livejournal.com',
+'newtimes.kz',
+'abcnews.go.com',
+'plush-koala.livejournal.com',
+'newscientist.com',
+'ss69100.livejournal.com',
+'contactmusic.com',
+'smolnarod.ru',
+'bnkirov.ru',
+'norg-norg.livejournal.com',
+'slashfilm.com',
+'dallasnews.com',
+'oren.ru',
+'point.md',
+'orelgrad.ru',
+'pressball.by',
+'forum-msk.org',
+'gradus.pro',
+'gazeta.uz',
+'matveychev-oleg.livejournal.com',
+'apsnypress.info',
+'46tv.ru',
+'ku66.ru',
+'video.komarovskiy.net',
+'mysanantonio.com',
+'kavpolit.com',
+'dima-piterski.livejournal.com',
+'made-inussr.livejournal.com',
+'thehill.com',
+'sciencemag.org',
+'pcmag.com',
+'europaplustv.com',
+'rjadovoj-rus.livejournal.com',
+'govp.info',
+'heritage.org',
+'perm.kp.ru',
+'shurigin.livejournal.com',
+'tuday.ru',
+'knews.kg',
+'shushpanzer-ru.livejournal.com',
+'webtous.ru',
+'boston.com',
+'odnako.org',
+'ironworld.ru',
+'dailybest.me',
+'da-dzi.livejournal.com',
+'versia.ru',
+'autosport.com.ru',
+'pravda-news.ru',
+'pocketnow.com',
+'asaratov.livejournal.com',
+'dddkursk.ru',
+'letohin.livejournal.com',
+'theaustralian.com.au',
+'steptohealth.ru',
+'alexcheban.livejournal.com',
+'lleo.me',
+'prodengi.kz',
+'readovka.ru',
+'efir24.tv',
+'ru-bykov.livejournal.com',
+'today.kz',
+'kasparov.ru.',
+'chelsea-fc.ru',
+'academ.info',
+'feministki.livejournal.com',
+'iarex.ru',
+'marimedia.ru',
+'androidcommunity.com',
+'uzoranet.livejournal.com',
+'ru-vederko.livejournal.com',
+'tanjand.livejournal.com',
+'komionline.ru',
+'gazette.com',
+'auto.tut.by',
+'ted.com',
+'mic.com',
+'spb.mk.ru',
+'berdsk-online.ru',
+'ossetia.ru',
+'ki-bella.livejournal.com',
+'keytas.ru',
+'severinform.ru',
+'tvolk.ru',
+'balashover.ru',
+'tor.com',
+'news.21.by',
+'karelinform.ru',
+'marv.livejournal.com',
+'seekingalpha.com',
+'ntsk.ru',
+'ksy-putan.livejournal.com',
+'universetoday.com',
+'thenextweb.com',
+'foma.ru',
+'kchetverg.ru',
+'ftbl.ru',
+'altyn-orda.kz',
+'ua.tribuna.com',
+'56orb.ru',
+'vesti.karelia.ru',
+'haaretz.com',
+'twentysix.ru',
+'primorye24.ru',
+'jsonline.com',
+'tobolsk.info',
+'tennessean.com',
+'moment-istini.com',
+'vrn.kp.ru',
+'navalny.livejournal.com',
+'roomble.com',
+'observer.com',
+'kyky.org',
+'news.chita.ru',
+'gov.cap.ru',
+'ammo1.livejournal.com',
+'wnyc.org',
+'whrussia.ru',
+'belan-olga.livejournal.com',
+'arguendi.livejournal.com',
+'freesmi.by',
+'greenbot.com',
+'(nemihail.livejournal.com',
+'obltv.ru',
+'sterlegrad.ru',
+'mlive.com',
+'gpk.gov.by',
+'fanatik.kz',
+'marina-yudenich.livejournal.com',
+'afisha.ngs.ru',
+'kupchinonews.ru',
+'shakin.ru',
+'silver.ru',
+'mirnov.ru',
+'techcrunch.com',
+'streetinsider.com',
+'otyrar.kz',
+'siapress.ru',
+'krsk.kp.ru',
+'becky-sharpe.livejournal.com',
+'mkala.ru',
+'prosto-vova.livejournal.com',
+'tagilcity.ru',
+'bloknot-krasnodar.ru',
+'greg-butcher.livejournal.com',
+'popados.livejournal.com',
+'mossudmed.livejournal.com',
+'s13.ru',
+'globalconflict.ru',
+'newyorker.com',
+'vladnews.ru',
+'kadykchanskiy.livejournal.com',
+'vladimir-krm.livejournal.com',
+'globalpost.com',
+'smolensk-i.ru',
+'newsmax.com',
+'providers.by',
+'theverge.com',
+'samsebeskazal.livejournal.com',
+'vb.by',
+'people.onliner.by',
+'peopleandcountries.com',
+'roizman.livejournal.com',
+'omvesti.ru',
+'sterlitamak.ru',
+'patch.com',
+'khabtime.info',
+'winnipegfreepress.com',
+'davydov-index.livejournal.com'
+);
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi.sql b/yql/essentials/tests/sql/suites/in/in_ansi.sql
new file mode 100644
index 0000000000..328826d33c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN (2, 3, null), -- Nothing<Bool?>
+ null IN (), -- false?
+ null IN (null), -- Nothing<Bool?>
+ null IN (1), -- Nothing<Bool?>
+ (1, null) IN ((1, 1), (2, 2)), -- Nothing<Bool?>
+ (1, null) IN ((2, 2), (3, 3)), -- false?
+ (1, 2) IN ((1, null), (2, 2)), -- Nothing<Bool?>
+ (1, 2) IN ((null, 1), (2, 1)), -- false?
+ (1, 2) IN ((1, null), (2, 1)), -- Nothing<Bool?>
+ 128 IN (128ut, 1t), -- true
+;
+
+SELECT
+ Just(1) IN (1, 2, 3), -- true?
+ 1 IN (Just(2), Just(3)), -- false?
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_dict.sql b/yql/essentials/tests/sql/suites/in/in_ansi_dict.sql
new file mode 100644
index 0000000000..aaf4b5590c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_dict.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN AsDict((2, "x"), (3, "y"), (null, "z")), -- Nothing<Bool?>
+ null IN DictCreate(Int32, String?), -- false?
+ null IN AsDict((null, "foo")), -- Nothing<Bool?>
+ null IN AsDict((1, "bar")), -- Nothing<Bool?>
+ (1, null) IN AsDict(((1, 1), null), ((2, 2), "foo")), -- Nothing<Bool?>
+ (1, null) IN AsDict(((2, 2), "foo"), ((3, 3), "bar")), -- false?
+ (1, 2) IN AsDict(((1, null), "foo"), ((2, 2), "bar")), -- Nothing<Bool?>
+ (1, 2) IN AsDict(((null, 1), "foo"), ((2, 1), null)), -- false?
+ (1, 2) IN AsDict(((1, null), "foo"), ((2, 1), "bar")), -- Nothing<Bool?>
+;
+
+SELECT
+ Just(1) IN AsDict((1, "foo"), (2, "bar"), (3, null)), -- true?
+ 1 IN AsDict((Just(2), null), (Just(3), "bar")), -- false?
+;
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_dict1.sql b/yql/essentials/tests/sql/suites/in/in_ansi_dict1.sql
new file mode 100644
index 0000000000..82b00039bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_dict1.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN {2, 3, null}, -- Nothing<Bool?>
+ 2 IN {2, 3, null}, -- true?
+ (1, 2) IN {(1, null), (2, 1)}, -- Nothing<Bool?>
+ (1, 2) IN {(1, null), (1, 2)}, -- true?
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_empty.sql b/yql/essentials/tests/sql/suites/in/in_ansi_empty.sql
new file mode 100644
index 0000000000..743967fdcf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_empty.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ null IN EmptyList(), -- false?
+ null IN EmptyDict(), -- false?
+ null IN (), -- false?
+ 1 IN EmptyList(), -- false
+ 1 IN EmptyDict(), -- false
+ 1 IN (), -- false
+ null IN Nothing(EmptyList?), -- Nothing<Bool?>
+ null IN Nothing(EmptyDict?), -- Nothing<Bool?>
+ null IN Nothing(ParseType("Tuple<>?")), -- Nothing<Bool?>
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_join.cfg b/yql/essentials/tests/sql/suites/in/in_ansi_join.cfg
new file mode 100644
index 0000000000..ebb9b67252
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_join.cfg
@@ -0,0 +1,2 @@
+in Input input_optkey1.txt
+in Dict optdict.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_join.sql b/yql/essentials/tests/sql/suites/in/in_ansi_join.sql
new file mode 100644
index 0000000000..48bfb9d637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_join.sql
@@ -0,0 +1,52 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+USE plato;
+
+-- Input: optkeys are 1-10,null
+-- Dict: keys are 1,5,7,9,11,null
+
+-- Either side can be: non-optional (P), optional without nulls (O), optional with nulls (N) - we test each of possible combination
+
+$lp = (SELECT Unwrap(optkey) AS optkey FROM Input WHERE optkey IS NOT NULL);
+$lo = (SELECT optkey FROM Input WHERE optkey IS NOT NULL);
+$ln = (SELECT optkey FROM Input);
+
+$rp = (SELECT Unwrap(key) AS key FROM Dict WHERE key IS NOT NULL);
+$ro = (SELECT key FROM Dict WHERE key IS NOT NULL);
+$rn = (SELECT key FROM Dict);
+
+
+-- Right is P
+SELECT optkey FROM $lp WHERE optkey NOT IN $rp ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $lo WHERE optkey NOT IN $rp ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $ln WHERE optkey NOT IN $rp ORDER BY optkey; -- [2,3,4,6,8,10]
+
+-- Right is O
+SELECT optkey FROM $lp WHERE optkey NOT IN $ro ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $lo WHERE optkey NOT IN $ro ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $ln WHERE optkey NOT IN $ro ORDER BY optkey; -- [2,3,4,6,8,10]
+
+-- Right is N
+SELECT optkey FROM $lp WHERE optkey NOT IN $rn ORDER BY optkey; -- []
+SELECT optkey FROM $lo WHERE optkey NOT IN $rn ORDER BY optkey; -- []
+SELECT optkey FROM $ln WHERE optkey NOT IN $rn ORDER BY optkey; -- []
+
+
+-- 2, 4, 6, null
+$extraDict = (
+ SELECT 2 AS key UNION ALL
+ SELECT 4 AS key UNION ALL
+ SELECT 6 AS key UNION ALL
+ SELECT NULL AS key
+);
+
+SELECT optkey FROM $lo WHERE optkey != 10 AND optkey NOT IN $ro AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey; -- [2,6]
+SELECT optkey FROM $ln WHERE optkey != 10 AND optkey NOT IN $rn AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey; -- []
+
+
+-- Empty dict
+SELECT optkey FROM $ln WHERE optkey NOT IN (SELECT * FROM $rn LIMIT 0) ORDER BY optkey; -- [1-10,null]
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_list.sql b/yql/essentials/tests/sql/suites/in/in_ansi_list.sql
new file mode 100644
index 0000000000..d1d9f74a5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_list.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN AsList(2, 3, null), -- Nothing<Bool?>
+ null IN ListCreate(Int32), -- false?
+ null IN AsList(null), -- Nothing<Bool?>
+ null IN AsList(1), -- Nothing<Bool?>
+ (1, null) IN AsList((1, 1), (2, 2)), -- Nothing<Bool?>
+ (1, null) IN AsList((2, 2), (3, 3)), -- false?
+ (1, 2) IN AsList((1, null), (2, 2)), -- Nothing<Bool?>
+ (1, 2) IN AsList((null, 1), (2, 1)), -- false?
+ (1, 2) IN AsList((1, null), (2, 1)), -- Nothing<Bool?>
+;
+
+SELECT
+ Just(1) IN AsList(1, 2, 3), -- true?
+ 1 IN AsList(Just(2), Just(3)), -- false?
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_list1.sql b/yql/essentials/tests/sql/suites/in/in_ansi_list1.sql
new file mode 100644
index 0000000000..36d5a3f05f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_list1.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN [2, 3, null], -- Nothing<Bool?>
+ 2 IN [2, 3, null], -- true?
+ (1, 2) IN [(1, null), (2, 1)], -- Nothing<Bool?>
+ (1, 2) IN [(1, null), (1, 2)], -- true?
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_set.sql b/yql/essentials/tests/sql/suites/in/in_ansi_set.sql
new file mode 100644
index 0000000000..e1871507de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_set.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN AsSet(2, 3, null), -- Nothing<Bool?>
+ null IN SetCreate(Int32), -- false?
+ null IN AsSet(null), -- Nothing<Bool?>
+ null IN AsSet(1), -- Nothing<Bool?>
+ (1, null) IN AsSet((1, 1), (2, 2)), -- Nothing<Bool?>
+ (1, null) IN AsSet((2, 2), (3, 3)), -- false?
+ (1, 2) IN AsSet((1, null), (2, 2)), -- Nothing<Bool?>
+ (1, 2) IN AsSet((null, 1), (2, 1)), -- false?
+ (1, 2) IN AsSet((1, null), (2, 1)), -- Nothing<Bool?>
+;
+
+SELECT
+ Just(1) IN AsSet(1, 2, 3), -- true?
+ 1 IN AsSet(Just(2), Just(3)), -- false?
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_ansi_variant.sql b/yql/essentials/tests/sql/suites/in/in_ansi_variant.sql
new file mode 100644
index 0000000000..86b2a2dbfa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_ansi_variant.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+/* syntax version 1 */
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+Select Enum("foo",Enum<"foo","bar">) in (
+ AsEnum("foo")
+ ),
+ Enum("foo",Enum<"foo","bar">) in (
+ AsEnum("bar")
+ ),
+ Enum("foo",Enum<"foo","bar">) in (
+ AsEnum("foo"),
+ AsEnum("bar")
+ ),
+ Enum("foo",Enum<"foo","bar">) in (
+ AsEnum("bar"),
+ AsEnum("baz")
+ ),
+ Enum("foo",Enum<"foo","bar">) in [
+ AsEnum("foo"),
+ AsEnum("bar")
+ ],
+ Enum("foo",Enum<"foo","bar">) in {
+ AsEnum("bar"),
+ AsEnum("baz")
+ }; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/in/in_compact_distinct-empty.cfg b/yql/essentials/tests/sql/suites/in/in_compact_distinct-empty.cfg
new file mode 100644
index 0000000000..6fe36b7db3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_compact_distinct-empty.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input1 empty.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_compact_distinct.cfg b/yql/essentials/tests/sql/suites/in/in_compact_distinct.cfg
new file mode 100644
index 0000000000..50ebbf3511
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_compact_distinct.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input1 input.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_compact_distinct.sql b/yql/essentials/tests/sql/suites/in/in_compact_distinct.sql
new file mode 100644
index 0000000000..f941a8facd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_compact_distinct.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+select * from Input
+where key in compact (select distinct key from Input1)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/in/in_enum_single0.sql b/yql/essentials/tests/sql/suites/in/in_enum_single0.sql
new file mode 100644
index 0000000000..f29aa9092e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_enum_single0.sql
@@ -0,0 +1 @@
+select * from plato.Input where key in ("023")
diff --git a/yql/essentials/tests/sql/suites/in/in_enum_single1.sql b/yql/essentials/tests/sql/suites/in/in_enum_single1.sql
new file mode 100644
index 0000000000..33d6f33878
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_enum_single1.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where cast(key as uint32) not in (150,)
diff --git a/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.cfg b/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.cfg
new file mode 100644
index 0000000000..a6d8867ac9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.cfg
@@ -0,0 +1,6 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.sql b/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.sql
new file mode 100644
index 0000000000..44928dec83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_exists_immediate_nested_subq.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* ignore runonopt plan diff */
+
+use plato;
+
+$q = (select key from Input order by key limit 100);
+$q1 = (select * from $q order by key limit 100);
+
+select * from Input where key in (select * from $q order by key limit 100) order by key;
+select * from Input where key in $q1 order by key;
+
+SELECT EXISTS (select key from $q) from Input;
+
+SELECT $q;
diff --git a/yql/essentials/tests/sql/suites/in/in_immediate_subquery.sql b/yql/essentials/tests/sql/suites/in/in_immediate_subquery.sql
new file mode 100644
index 0000000000..e3a7202fc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_immediate_subquery.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+select * from Input4 where subkey not in (select key || "0" from Input4) order by key,subkey;
+
+select * from Input4 where subkey in compact(select key || "0" from Input4) order by key,subkey;
diff --git a/yql/essentials/tests/sql/suites/in/in_noansi.sql b/yql/essentials/tests/sql/suites/in/in_noansi.sql
new file mode 100644
index 0000000000..43836c9f60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_noansi.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN (2, 3, null), -- false
+ null IN (), -- Nothing<Bool?>
+ null IN (null), -- Nothing<Bool?>
+ null IN (1), -- Nothing<Bool?>
+ (1, null) IN ((1, 1), (2, 2)), -- Nothing<Bool?>
+ (1, null) IN ((2, 2), (3, 3)), -- Nothing<Bool?>
+ (1, 2) IN ((1, null), (2, 2)), -- false
+ (1, 2) IN ((null, 1), (2, 1)), -- false
+ (1, 2) IN ((1, null), (2, 1)), -- false
+ 128 IN (128ut, 1t), -- true
+;
+
+SELECT
+ Just(1) IN (1, 2, 3), -- true?
+ 1 IN (Just(2), Just(3)), -- false
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_noansi_empty.sql b/yql/essentials/tests/sql/suites/in/in_noansi_empty.sql
new file mode 100644
index 0000000000..87c50a0fb9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_noansi_empty.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ null IN EmptyList(), -- Nothing<Bool?>
+ null IN EmptyDict(), -- Nothing<Bool?>
+ null IN (), -- Nothing<Bool?>
+ 1 IN EmptyList(), -- false
+ 1 IN EmptyDict(), -- false
+ 1 IN (), -- false
+ null IN Nothing(EmptyList?), -- Nothing<Bool?>
+ null IN Nothing(EmptyDict?), -- Nothing<Bool?>
+ null IN Nothing(ParseType("Tuple<>?")), -- Nothing<Bool?>
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_noansi_join.cfg b/yql/essentials/tests/sql/suites/in/in_noansi_join.cfg
new file mode 100644
index 0000000000..ebb9b67252
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_noansi_join.cfg
@@ -0,0 +1,2 @@
+in Input input_optkey1.txt
+in Dict optdict.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_noansi_join.sql b/yql/essentials/tests/sql/suites/in/in_noansi_join.sql
new file mode 100644
index 0000000000..ee043447f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_noansi_join.sql
@@ -0,0 +1,52 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+USE plato;
+
+-- Input: optkeys are 1-10,null
+-- Dict: keys are 1,5,7,9,11,null
+
+-- Either side can be: non-optional (P), optional without nulls (O), optional with nulls (N) - we test each of possible combination
+
+$lp = (SELECT Unwrap(optkey) AS optkey FROM Input WHERE optkey IS NOT NULL);
+$lo = (SELECT optkey FROM Input WHERE optkey IS NOT NULL);
+$ln = (SELECT optkey FROM Input);
+
+$rp = (SELECT Unwrap(key) AS key FROM Dict WHERE key IS NOT NULL);
+$ro = (SELECT key FROM Dict WHERE key IS NOT NULL);
+$rn = (SELECT key FROM Dict);
+
+
+-- Right is P
+SELECT optkey FROM $lp WHERE optkey NOT IN $rp ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $lo WHERE optkey NOT IN $rp ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $ln WHERE optkey NOT IN $rp ORDER BY optkey; -- [null,2,3,4,6,8,10]
+
+-- Right is O
+SELECT optkey FROM $lp WHERE optkey NOT IN $ro ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $lo WHERE optkey NOT IN $ro ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $ln WHERE optkey NOT IN $ro ORDER BY optkey; -- [null,2,3,4,6,8,10]
+
+-- Right is N
+SELECT optkey FROM $lp WHERE optkey NOT IN $rn ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $lo WHERE optkey NOT IN $rn ORDER BY optkey; -- [2,3,4,6,8,10]
+SELECT optkey FROM $ln WHERE optkey NOT IN $rn ORDER BY optkey; -- [null,2,3,4,6,8,10]
+
+
+-- 2, 4, 6, null
+$extraDict = (
+ SELECT 2 AS key UNION ALL
+ SELECT 4 AS key UNION ALL
+ SELECT 6 AS key UNION ALL
+ SELECT NULL AS key
+);
+
+SELECT optkey FROM $lo WHERE optkey != 10 AND optkey NOT IN $ro AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey; -- [2,6]
+SELECT optkey FROM $ln WHERE optkey != 10 AND optkey NOT IN $rn AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey; -- [2,6]
+
+
+-- Empty dict
+SELECT optkey FROM $ln WHERE optkey NOT IN (SELECT * FROM $rn LIMIT 0) ORDER BY optkey; -- [1-10,null]
+
diff --git a/yql/essentials/tests/sql/suites/in/in_noansi_list_dict.sql b/yql/essentials/tests/sql/suites/in/in_noansi_list_dict.sql
new file mode 100644
index 0000000000..0c75cd6bc9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_noansi_list_dict.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN [2, 3, null], -- false
+ 2 IN [2, 3, null], -- true
+ (1, 2) IN [(1, null), (2, 1)], -- false
+ (1, 2) IN [(1, null), (1, 2)], -- true
+
+ 1 IN {2, 3, null}, -- false
+ 2 IN {2, 3, null}, -- true
+ (1, 2) IN {(1, null), (2, 1)}, -- false
+ (1, 2) IN {(1, null), (1, 2)}, -- true
+;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple.sql b/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple.sql
new file mode 100644
index 0000000000..9a3e1994c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+select 1 in if(1 > 0, (1, 10, 301, 310,), (311,))
diff --git a/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple_ansi.sql b/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple_ansi.sql
new file mode 100644
index 0000000000..ff5b32e4cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_nonliteral_tuple_ansi.sql
@@ -0,0 +1,3 @@
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+select 1 in if(1 > 0, (1, 10, 301, 310,), (311,))
diff --git a/yql/essentials/tests/sql/suites/in/in_scalar_vector_subquery.sql b/yql/essentials/tests/sql/suites/in/in_scalar_vector_subquery.sql
new file mode 100644
index 0000000000..b92955efde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_scalar_vector_subquery.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+
+use plato;
+
+$bar = (select "1" union all select "2");
+$barr = (select "1" as subkey union all select "2" as subkey);
+
+select "1" in $bar, "2" in $bar;
+select "3" in $bar;
+
+select "1" in AsList($barr), "2" in AsList($barr);
+select "3" in AsList($barr);
+
+select * from Input where subkey in $bar order by subkey;
+select * from Input where subkey in AsList($barr) order by subkey;
+
+-- same content as $bar
+$baz = (select subkey from Input where subkey == "1" or subkey == "2");
+$bazz = (select subkey from Input where subkey < "3" order by subkey asc limit 1);
+
+select "1" in $baz, "2" in $baz;
+select "3" in $baz;
+
+select "1" in AsList($bazz), "2" in AsList($bazz);
+select "3" in AsList($bazz);
+
+select * from Input where subkey in $baz order by subkey;
+select * from Input where subkey in AsList($bazz) order by subkey;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_sorted.cfg b/yql/essentials/tests/sql/suites/in/in_sorted.cfg
new file mode 100644
index 0000000000..1ab381f28d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_sorted.cfg
@@ -0,0 +1 @@
+in InputSorted sorted.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_sorted.sql b/yql/essentials/tests/sql/suites/in/in_sorted.sql
new file mode 100644
index 0000000000..20907b1bee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_sorted.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$in = select key from InputSorted where key < "100";
+
+select * from InputSorted where key in $in;
diff --git a/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.cfg b/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.cfg
new file mode 100644
index 0000000000..8d8f865ecc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.cfg
@@ -0,0 +1,2 @@
+in InputSorted sorted.txt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.sql b/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.sql
new file mode 100644
index 0000000000..ff3e72a710
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_sorted_by_tuple.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+select value, AGG_LIST_DISTINCT(tpl) as tuples
+from (
+ select AsTuple(key, subkey, value) as tpl, value from InputSorted
+)
+where value in (select DISTINCT value from Input)
+group by value;
diff --git a/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.cfg b/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.cfg
new file mode 100644
index 0000000000..a6d8867ac9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.cfg
@@ -0,0 +1,6 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.sql b/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.sql
new file mode 100644
index 0000000000..07522e60f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tablesource_on_raw_list.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+use plato;
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+$src = (select cast(key as Int32) from Input);
+
+select ListFilter(ListFromRange(1, 100), ($i) -> { RETURN $i IN $src; });
diff --git a/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.cfg b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.cfg
new file mode 100644
index 0000000000..35c6d38395
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.cfg
@@ -0,0 +1 @@
+in Input input_optkey.txt
diff --git a/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql
new file mode 100644
index 0000000000..60ebfb97d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+
+USE plato;
+
+$r4_20 = (SELECT optkey FROM Input WHERE optkey BETWEEN 4 AND 20);
+$r6_20 = (SELECT key FROM Input WHERE optkey BETWEEN 6 AND 20);
+$r8_20 = (SELECT key FROM Input WHERE optkey BETWEEN 8 AND 20);
+$r10_20 = (SELECT optkey FROM Input WHERE optkey BETWEEN 10 AND 20);
+
+$r1_16 = (SELECT optkey FROM Input WHERE optkey BETWEEN 1 AND 16);
+$r1_12 = (SELECT key FROM Input WHERE optkey BETWEEN 1 AND 12);
+
+SELECT key FROM Input WHERE
+ (key + 1) IN $r4_20 AND -- key = [3, 19] -- 2 joinable
+ optkey IN $r6_20 AND -- key = [6, 19]
+
+ key IN /*+ COMPACT() */ $r8_20 AND -- key = [8, 19] -- 1 nonjoinable (due to COMPACT)
+
+ (optkey + 3) IN $r10_20 AND -- key = [8, 17] -- 3 joinable
+ (key + 4) NOT IN $r1_12 AND -- key = [9, 17]
+ key IN $r10_20 AND -- key = [10, 17]
+
+ (optkey IN $r1_16 OR key IN $r1_16) AND -- key = [10, 16] -- 1 nonjoinable (not SqlIn)
+
+ (key - 1) IN $r1_12 AND -- key = [10, 13] -- 2 joinable
+ (key - 3) NOT IN $r8_20 -- key = [10]
+
diff --git a/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.cfg b/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.sql b/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.sql
new file mode 100644
index 0000000000..6c8928c351
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tuple_check0_fail.sql
@@ -0,0 +1,5 @@
+select AsTuple(1, 1) in (
+ AsTuple(2, 1),
+ AsTuple(1, 2),
+ AsTuple(1, AsTuple(1, 2)), -- expect compatible tuple
+)
diff --git a/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.cfg b/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.sql b/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.sql
new file mode 100644
index 0000000000..ae352a79b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tuple_check1_fail.sql
@@ -0,0 +1,5 @@
+select AsTuple(1, 1) in (
+ AsTuple(2, 1),
+ AsTuple(1, 2),
+ 42 -- expect tuple, not data
+)
diff --git a/yql/essentials/tests/sql/suites/in/in_tuple_table.sql b/yql/essentials/tests/sql/suites/in/in_tuple_table.sql
new file mode 100644
index 0000000000..a36004f819
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tuple_table.sql
@@ -0,0 +1,4 @@
+USE Plato;
+SELECT 'c' IN t
+FROM InputWithTuples;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_types_cast.sql b/yql/essentials/tests/sql/suites/in/in_types_cast.sql
new file mode 100644
index 0000000000..8b3e5c71de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_types_cast.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where cast(key as uint32) not in (150,150ul)
diff --git a/yql/essentials/tests/sql/suites/in/in_types_cast_all.sql b/yql/essentials/tests/sql/suites/in/in_types_cast_all.sql
new file mode 100644
index 0000000000..709882ae86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_types_cast_all.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select * from plato.Input where cast(key as Uint8) in
+(
+ 1u,
+ 3l,
+ 23ul,
+ 255, -- out of Uint8
+ 0,
+)
diff --git a/yql/essentials/tests/sql/suites/in/in_with_cast.sql b/yql/essentials/tests/sql/suites/in/in_with_cast.sql
new file mode 100644
index 0000000000..ca43785625
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_cast.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+SELECT
+ Null in (100500) as `void`,
+ Just(cast(1 as Uint8)) in (23, Null, 32, Null, 255) as byte_wrap_match,
+ cast(5 as int64) in (1, 5, 42l) as different_types,
+ 3.14 in (1, 3, 4) as pi_not_exact,
+ 3.14 in (1, 3, 4, 3 + 0.14) as pi_in_expr,
+ 'end' as end
diff --git a/yql/essentials/tests/sql/suites/in/in_with_list_dict.sql b/yql/essentials/tests/sql/suites/in/in_with_list_dict.sql
new file mode 100644
index 0000000000..44993dd1d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_list_dict.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+
+$l = AsList(1, 2, 3, 800);
+$d = AsDict(AsTuple(1, 0), AsTuple(2, 0), AsTuple(3, 0), AsTuple(800, 0));
+
+SELECT key, CAST(key AS int32) IN $l, CAST(key AS int32) IN $d FROM plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs.sql b/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs.sql
new file mode 100644
index 0000000000..330ee0e6f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select AsStruct(1 as x) in AsList(AsStruct(1 as x), AsStruct(2 as x));
diff --git a/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs_ansi.sql b/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs_ansi.sql
new file mode 100644
index 0000000000..74d30c1ed2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_literal_list_of_structs_ansi.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+pragma AnsiInForEmptyOrNullableItemsCollections;
+select AsStruct(1 as x) in AsList(AsStruct(1 as x), AsStruct(2 as x));
diff --git a/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals.sql b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals.sql
new file mode 100644
index 0000000000..69b840e559
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+
+$pt = AsTuple(1, 2, 3);
+$et = Nothing(ParseType("Tuple<Int32, Int32, Int32>?"));
+
+SELECT
+ 1 IN $pt, -- true
+ 100 IN $pt, -- false
+ 1/1 IN $pt, -- Just(true)
+ 1/0 IN $pt, -- Nothing(bool)
+ NULL IN $pt, -- Nothing(bool)
+
+ 1 IN Just($pt), -- Just(true)
+ 100 IN Just($pt), -- Just(false)
+ 1/1 IN Just($pt), -- Just(true)
+ 1/0 IN Just($pt), -- Nothing(bool)
+ NULL IN Just($pt), -- Nothing(bool)
+
+ 1 IN $et, -- Nothing(bool) starting from here
+ 100 IN $et,
+ 1/1 IN $et,
+ 1/0 IN $et,
+ NULL IN $et,
+
+ 1 IN NULL,
+ 100 IN NULL,
+ 1/1 IN NULL,
+ 1/0 IN NULL,
+ NULL IN NULL;
diff --git a/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra.sql b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra.sql
new file mode 100644
index 0000000000..2242c60ac6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+PRAGMA DisableAnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN (2,3,null), -- false
+ 1 IN (null), -- false
+ (1, null) IN ((1,2), (1, 3), (1, null)), -- Nothing<Bool?>
+ (1, 1) IN ((1,null)), -- false
+ (1, 1) IN ((1,1),(2,null)), -- true
+ (1, null) IN ((1,2), (1,3)), -- Nothing<Bool?>
+ (2, null) IN ((1,2), (1,3)), -- Nothing<Bool?>
+ (1, null) IN (); -- Nothing<Bool?>
diff --git a/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra_ansi.sql b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra_ansi.sql
new file mode 100644
index 0000000000..ae0b7e348f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_nulls_and_optionals_extra_ansi.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+PRAGMA AnsiInForEmptyOrNullableItemsCollections;
+
+SELECT
+ 1 IN (2,3,null), -- Nothing<Bool?>
+ 1 IN (null), -- Nothing<Bool?>
+ (1, null) IN ((1,2), (1, 3), (1, null)), -- Nothing<Bool?>
+ (1, 1) IN ((1,null)), -- Nothing<Bool?>
+ (1, 1) IN ((1,1),(2,null)), -- Just(true)
+ (1, null) IN ((1,2), (1,3)), -- Nothing<Bool?>
+ (2, null) IN ((1,2), (1,3)), -- Just(false)
+ (1, null) IN (); -- Just(false)
diff --git a/yql/essentials/tests/sql/suites/in/in_with_opt_tuple.sql b/yql/essentials/tests/sql/suites/in/in_with_opt_tuple.sql
new file mode 100644
index 0000000000..98735c8ead
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_opt_tuple.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+SELECT *
+FROM plato.Input
+WHERE AsTuple(cast(key as int32), cast(subkey as int32)) in (
+ AsTuple(42, 5),
+ AsTuple(75, 1),
+ AsTuple(20, 3),
+);
diff --git a/yql/essentials/tests/sql/suites/in/in_with_subquery_where.sqlx b/yql/essentials/tests/sql/suites/in/in_with_subquery_where.sqlx
new file mode 100644
index 0000000000..3834cbca30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_subquery_where.sqlx
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+pragma warning("error", "4501");
+
+$subq = (SELECT subkey FROM Input WHERE value = "ddd");
+
+--INSERT INTO Output
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM Input
+WHERE subkey in ($subq)
+ORDER BY key
diff --git a/yql/essentials/tests/sql/suites/in/in_with_table_of_tuples.sql b/yql/essentials/tests/sql/suites/in/in_with_table_of_tuples.sql
new file mode 100644
index 0000000000..1e07ae5548
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_table_of_tuples.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+use plato;
+
+$t1 = AsList(
+ AsStruct(75 as key, 1 as subkey),
+ AsStruct(800 as key, 2 as subkey));
+
+insert into @t1
+select * from AS_TABLE($t1);
+
+commit;
+
+$tuples = (select AsTuple(key, subkey) from @t1);
+
+select * from Input
+where AsTuple(cast(key as uint64), cast(subkey as uint64)) in $tuples
diff --git a/yql/essentials/tests/sql/suites/in/in_with_tuple.sql b/yql/essentials/tests/sql/suites/in/in_with_tuple.sql
new file mode 100644
index 0000000000..bb280827f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_tuple.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+SELECT *
+FROM plato.Input
+WHERE AsTuple(cast(key as int32) ?? 0, cast(subkey as int32) ?? 0) in (
+ AsTuple(800, 1),
+ AsTuple(800, 2),
+ AsTuple(800, 3),
+ AsTuple(800, 4),
+);
diff --git a/yql/essentials/tests/sql/suites/in/in_with_tuple_simple.sql b/yql/essentials/tests/sql/suites/in/in_with_tuple_simple.sql
new file mode 100644
index 0000000000..d6a7e7b10e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_with_tuple_simple.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+SELECT
+ AsTuple(1,1) -- tuple is unsupported
+IN
+ (AsTuple(1, 1))
diff --git a/yql/essentials/tests/sql/suites/in/input.txt b/yql/essentials/tests/sql/suites/in/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/in/input4.txt b/yql/essentials/tests/sql/suites/in/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/in/input_optkey.txt b/yql/essentials/tests/sql/suites/in/input_optkey.txt
new file mode 100644
index 0000000000..eb67e7ff0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_optkey.txt
@@ -0,0 +1,21 @@
+{"key"=1; "optkey"=1; value="1" };
+{"key"=2; "optkey"=2; value="2" };
+{"key"=3; "optkey"=3; value="3" };
+{"key"=4; "optkey"=4; value="4" };
+{"key"=5; "optkey"=5; value="5" };
+{"key"=6; "optkey"=6; value="6" };
+{"key"=7; "optkey"=7; value="7" };
+{"key"=8; "optkey"=8; value="8" };
+{"key"=9; "optkey"=9; value="9" };
+{"key"=10; "optkey"=10; value="10"};
+{"key"=11; "optkey"=11; value="11"};
+{"key"=12; "optkey"=12; value="12"};
+{"key"=13; "optkey"=13; value="13"};
+{"key"=14; "optkey"=14; value="14"};
+{"key"=15; "optkey"=15; value="15"};
+{"key"=16; "optkey"=16; value="16"};
+{"key"=17; "optkey"=17; value="17"};
+{"key"=18; "optkey"=18; value="18"};
+{"key"=19; "optkey"=19; value="19"};
+{"key"=20; "optkey"=20; value="20"};
+{"key"=21; "optkey"=#; value="null"};
diff --git a/yql/essentials/tests/sql/suites/in/input_optkey.txt.attr b/yql/essentials/tests/sql/suites/in/input_optkey.txt.attr
new file mode 100644
index 0000000000..1ca6ee6155
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_optkey.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["optkey";["OptionalType";["DataType";"Int32"]]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/in/input_optkey1.txt b/yql/essentials/tests/sql/suites/in/input_optkey1.txt
new file mode 100644
index 0000000000..8b22cd7071
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_optkey1.txt
@@ -0,0 +1,11 @@
+{"key"=1; "optkey"=1; value="1" };
+{"key"=2; "optkey"=2; value="2" };
+{"key"=3; "optkey"=3; value="3" };
+{"key"=4; "optkey"=4; value="4" };
+{"key"=5; "optkey"=5; value="5" };
+{"key"=6; "optkey"=6; value="6" };
+{"key"=7; "optkey"=7; value="7" };
+{"key"=8; "optkey"=8; value="8" };
+{"key"=9; "optkey"=9; value="9" };
+{"key"=10; "optkey"=10; value="10"};
+{"key"=11; "optkey"=#; value="null"};
diff --git a/yql/essentials/tests/sql/suites/in/input_optkey1.txt.attr b/yql/essentials/tests/sql/suites/in/input_optkey1.txt.attr
new file mode 100644
index 0000000000..1ca6ee6155
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_optkey1.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["optkey";["OptionalType";["DataType";"Int32"]]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/in/input_with_tuples.txt b/yql/essentials/tests/sql/suites/in/input_with_tuples.txt
new file mode 100644
index 0000000000..6361ba135d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_with_tuples.txt
@@ -0,0 +1,3 @@
+{"t"=["a"; "b"; "c"]};
+{"t"=["a"; "b"; "d"]};
+
diff --git a/yql/essentials/tests/sql/suites/in/input_with_tuples.txt.attr b/yql/essentials/tests/sql/suites/in/input_with_tuples.txt.attr
new file mode 100644
index 0000000000..429fb94586
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/input_with_tuples.txt.attr
@@ -0,0 +1,9 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["t"; ["TupleType"; [
+ ["DataType"; "String"];
+ ["DataType"; "String"];
+ ["DataType"; "String"]
+ ]]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg
new file mode 100644
index 0000000000..1d3299a333
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg
@@ -0,0 +1 @@
+pragma AnsiInForEmptyOrNullableItemsCollections
diff --git a/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.cfg b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.cfg
new file mode 100644
index 0000000000..2ea925230e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.cfg
@@ -0,0 +1 @@
+pragma warning("disable","1108")
diff --git a/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.sql b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.sql
new file mode 100644
index 0000000000..fb9209fee0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/large_in_YQL-19183.sql
@@ -0,0 +1,10 @@
+$a = ('x',);
+$b1 = ('x','y1');
+$b2 = ('x','y2');
+$b3 = ('x','y3');
+$b4 = ('x','y4');
+$b5 = ('x','y5');
+$b6 = ('x','y6');
+
+SELECT $a in ($a, $b1, $b2, $b3, $b4, $b5, $b6)
+
diff --git a/yql/essentials/tests/sql/suites/in/optdict.txt b/yql/essentials/tests/sql/suites/in/optdict.txt
new file mode 100644
index 0000000000..15f55da049
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/optdict.txt
@@ -0,0 +1,6 @@
+{"key"=1};
+{"key"=#};
+{"key"=5};
+{"key"=7};
+{"key"=9};
+{"key"=11};
diff --git a/yql/essentials/tests/sql/suites/in/optdict.txt.attr b/yql/essentials/tests/sql/suites/in/optdict.txt.attr
new file mode 100644
index 0000000000..c57013cea5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/optdict.txt.attr
@@ -0,0 +1,5 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Int32"]]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg
new file mode 100644
index 0000000000..1d3299a333
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg
@@ -0,0 +1 @@
+pragma AnsiInForEmptyOrNullableItemsCollections
diff --git a/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.cfg b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.cfg
new file mode 100644
index 0000000000..2ea925230e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.cfg
@@ -0,0 +1 @@
+pragma warning("disable","1108")
diff --git a/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.sql b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.sql
new file mode 100644
index 0000000000..a351ad39bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/small_in_YQL-19183.sql
@@ -0,0 +1,5 @@
+$a = ('x',);
+$b = ('x','y');
+
+SELECT $a in ($a, $b);
+
diff --git a/yql/essentials/tests/sql/suites/in/sorted.txt b/yql/essentials/tests/sql/suites/in/sorted.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/sorted.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/in/sorted.txt.attr b/yql/essentials/tests/sql/suites/in/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/in/yql-10038.sql b/yql/essentials/tests/sql/suites/in/yql-10038.sql
new file mode 100644
index 0000000000..f5f75a1990
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/yql-10038.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+use plato;
+
+insert into @input
+select "foo" as reqid, "touch" as ui, AsList(1,2,236273) as test_ids;
+commit;
+
+$dict = (select "foo" as reqid);
+
+select
+ *
+from
+ @input
+where
+ ui='touch' and
+ reqid in (select reqid from $dict)
+ and 236273 in test_ids
+
diff --git a/yql/essentials/tests/sql/suites/in/yql-14677.sql b/yql/essentials/tests/sql/suites/in/yql-14677.sql
new file mode 100644
index 0000000000..abbe56ce7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/yql-14677.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+pragma yt.MapJoinLimit="1m";
+
+$l1 = select key from `Input`;
+
+select * from Input
+where true
+ and value != ""
+ and key in $l1
diff --git a/yql/essentials/tests/sql/suites/insert/after_group_by.sql b/yql/essentials/tests/sql/suites/insert/after_group_by.sql
new file mode 100644
index 0000000000..c2abecae36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/after_group_by.sql
@@ -0,0 +1,2 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, value) select key, subkey, max(value) from plato.Input group by key, subkey order by key;
diff --git a/yql/essentials/tests/sql/suites/insert/anonymous_tables.sql b/yql/essentials/tests/sql/suites/insert/anonymous_tables.sql
new file mode 100644
index 0000000000..93e6b3b041
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/anonymous_tables.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+pragma yt.MapJoinLimit="1M";
+
+insert into @a
+select * from Input;
+
+commit;
+
+select count(*) from @a;
+select * from @a limit 2;
+select count(*) from @a as a cross join @a as b;
+
+commit;
diff --git a/yql/essentials/tests/sql/suites/insert/append-proto_fail.cfg b/yql/essentials/tests/sql/suites/insert/append-proto_fail.cfg
new file mode 100644
index 0000000000..6d87958c65
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append-proto_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+out Output input_proto.txt
+udf protobuf_udf
diff --git a/yql/essentials/tests/sql/suites/insert/append-view_fail.cfg b/yql/essentials/tests/sql/suites/insert/append-view_fail.cfg
new file mode 100644
index 0000000000..db398a8d2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append-view_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+in Input1 input.txt
+in Input2 input2.txt
+out Output input_view.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append-with_read_udf_fail.cfg b/yql/essentials/tests/sql/suites/insert/append-with_read_udf_fail.cfg
new file mode 100644
index 0000000000..1d043c6420
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append-with_read_udf_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+out Output input_with_read_udf.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/sql/suites/insert/append-with_view.cfg b/yql/essentials/tests/sql/suites/insert/append-with_view.cfg
new file mode 100644
index 0000000000..4feca3f4ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append-with_view.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output input_with_view.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/insert/append.cfg b/yql/essentials/tests/sql/suites/insert/append.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append.sql b/yql/essentials/tests/sql/suites/insert/append.sql
new file mode 100644
index 0000000000..e4ce8e6422
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* multirun can not */
+insert into plato.Output
+select * from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/insert/append_after_replace.sql b/yql/essentials/tests/sql/suites/insert/append_after_replace.sql
new file mode 100644
index 0000000000..96894b317c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_after_replace.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* multirun can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, value from plato.Input;
+commit;
+insert into plato.Output (key, subkey, value) select key, subkey, value from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/insert/append_missing_null.sql b/yql/essentials/tests/sql/suites/insert/append_missing_null.sql
new file mode 100644
index 0000000000..e92b426132
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_missing_null.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+
+insert into @foo
+select null as x, 1 as y;
+
+commit;
+
+insert into @foo
+select 2 as y;
+
+commit;
+
+select * from @foo;
diff --git a/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted.cfg b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted.cfg
new file mode 100644
index 0000000000..1f640b66af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted.cfg
@@ -0,0 +1,9 @@
+in Input input.txt
+out Output1 sorted.txt
+out Output2 sorted.txt
+out Output3 sorted.txt
+out Output4 sorted.txt
+out Output5 sorted.txt
+out Output6 sorted.txt
+out Output7 sorted.txt
+out Output8 sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_calc.cfg b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_calc.cfg
new file mode 100644
index 0000000000..a47ebbb46d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_calc.cfg
@@ -0,0 +1,9 @@
+in Input input.txt
+out Output1 sorted_calc.txt
+out Output2 sorted_calc.txt
+out Output3 sorted_calc.txt
+out Output4 sorted_calc.txt
+out Output5 sorted_calc.txt
+out Output6 sorted_calc.txt
+out Output7 sorted_calc.txt
+out Output8 sorted_calc.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_desc.cfg b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_desc.cfg
new file mode 100644
index 0000000000..e337a07d80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_sorted-to_sorted_desc.cfg
@@ -0,0 +1,9 @@
+in Input input.txt
+out Output1 sorted_desc.txt
+out Output2 sorted_desc.txt
+out Output3 sorted_desc.txt
+out Output4 sorted_desc.txt
+out Output5 sorted_desc.txt
+out Output6 sorted_desc.txt
+out Output7 sorted_desc.txt
+out Output8 sorted_desc.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append_sorted.cfg b/yql/essentials/tests/sql/suites/insert/append_sorted.cfg
new file mode 100644
index 0000000000..8014b80c06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_sorted.cfg
@@ -0,0 +1,9 @@
+in Input input.txt
+out Output1 input.txt
+out Output2 input.txt
+out Output3 input.txt
+out Output4 input.txt
+out Output5 input.txt
+out Output6 input.txt
+out Output7 input.txt
+out Output8 input.txt
diff --git a/yql/essentials/tests/sql/suites/insert/append_sorted.sql b/yql/essentials/tests/sql/suites/insert/append_sorted.sql
new file mode 100644
index 0000000000..cefc494453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/append_sorted.sql
@@ -0,0 +1,25 @@
+/* multirun can not */
+
+insert into plato.Output1
+select * from plato.Input order by key;
+
+insert into plato.Output2
+select * from plato.Input order by key, subkey;
+
+insert into plato.Output3
+select * from plato.Input order by key, subkey, value;
+
+insert into plato.Output4
+select * from plato.Input;
+
+insert into plato.Output5
+select * from plato.Input order by subkey;
+
+insert into plato.Output6
+select * from plato.Input order by key desc;
+
+insert into plato.Output7
+select * from plato.Input order by key desc, subkey;
+
+insert into plato.Output8
+select * from plato.Input order by key || subkey;
diff --git a/yql/essentials/tests/sql/suites/insert/default.cfg b/yql/essentials/tests/sql/suites/insert/default.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.cfg b/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.sql b/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.sql
new file mode 100644
index 0000000000..af6aba3132
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/double_append_to_anonymous.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+
+INSERT INTO @tmp
+SELECT 1 as id, "qwer" as val;
+COMMIT;
+
+INSERT INTO @tmp
+SELECT 2 as id, "asdf" as val;
+
+COMMIT;
+
+SELECT *
+FROM @tmp; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/drop_sortness-calc.cfg b/yql/essentials/tests/sql/suites/insert/drop_sortness-calc.cfg
new file mode 100644
index 0000000000..da3506e2e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/drop_sortness-calc.cfg
@@ -0,0 +1,2 @@
+in Input sorted_calc.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/drop_sortness-desc.cfg b/yql/essentials/tests/sql/suites/insert/drop_sortness-desc.cfg
new file mode 100644
index 0000000000..803556470a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/drop_sortness-desc.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/drop_sortness.cfg b/yql/essentials/tests/sql/suites/insert/drop_sortness.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/drop_sortness.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/drop_sortness.sql b/yql/essentials/tests/sql/suites/insert/drop_sortness.sql
new file mode 100644
index 0000000000..ccd7972ca6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/drop_sortness.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+insert into plato.Output with truncate
+SELECT
+ value
+FROM plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.cfg b/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.cfg
new file mode 100644
index 0000000000..a26fadcaa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.sql b/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.sql
new file mode 100644
index 0000000000..aa2f928459
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/fail_read_view_after_modify.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+insert into plato.Output with truncate
+select * from plato.Input;
+
+commit;
+
+select * from plato.Output view raw;
diff --git a/yql/essentials/tests/sql/suites/insert/from_two_sorted_by_calc.sql b/yql/essentials/tests/sql/suites/insert/from_two_sorted_by_calc.sql
new file mode 100644
index 0000000000..d2c42ab47e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/from_two_sorted_by_calc.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+use plato;
+
+insert into @f1 select * from Input order by key || "1";
+insert into @f2 select * from Input order by key || "2";
+
+commit;
+
+insert into Output
+select * from
+(
+ select * from @f1
+ union all
+ select * from @f2
+);
diff --git a/yql/essentials/tests/sql/suites/insert/inferschema.txt b/yql/essentials/tests/sql/suites/insert/inferschema.txt
new file mode 100644
index 0000000000..740bf0ddd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/inferschema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{};
diff --git a/yql/essentials/tests/sql/suites/insert/inferschema.txt.attr b/yql/essentials/tests/sql/suites/insert/inferschema.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/inferschema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/insert/input.txt b/yql/essentials/tests/sql/suites/insert/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/insert/input.txt.attr b/yql/essentials/tests/sql/suites/insert/input.txt.attr
new file mode 100644
index 0000000000..36b3c00c90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["DataType";"String";];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/insert/input2.txt b/yql/essentials/tests/sql/suites/insert/input2.txt
new file mode 100644
index 0000000000..92aa4a0344
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input2.txt
@@ -0,0 +1 @@
+{"key"="999";"subkey"="9";"value"="xxx"};
diff --git a/yql/essentials/tests/sql/suites/insert/input_proto.txt b/yql/essentials/tests/sql/suites/insert/input_proto.txt
new file mode 100644
index 0000000000..d2eaef7f29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_proto.txt
@@ -0,0 +1 @@
+{"key"="1";"subkey"="\n\x10\x08\7\x12\x0C\n\ntext value";"value"="\n\x10\x08\7\x12\x0C\n\ntext value"};
diff --git a/yql/essentials/tests/sql/suites/insert/input_proto.txt.attr b/yql/essentials/tests/sql/suites/insert/input_proto.txt.attr
new file mode 100644
index 0000000000..c924675835
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_proto.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_proto_field_value"="#TA+H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==";
+ "_yql_proto_field_subkey"="#TA+H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/insert/input_view.txt b/yql/essentials/tests/sql/suites/insert/input_view.txt
new file mode 100644
index 0000000000..068860024c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_view.txt
@@ -0,0 +1,3 @@
+select key,1 as `num` from Input1
+union all
+select key,2 as `num` from Input2;
diff --git a/yql/essentials/tests/sql/suites/insert/input_view.txt.attr b/yql/essentials/tests/sql/suites/insert/input_view.txt.attr
new file mode 100644
index 0000000000..41ea51e276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_view.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_yql_type"="view";
+ "type"="document";
+}
diff --git a/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt b/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt
new file mode 100644
index 0000000000..ad6793f93c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a=B@@b=a@@c=a"};
+{"key"="800";"subkey"="2";"value"="b=1@@c=2@@d=3"};
+{"key"="020";"subkey"="3";"value"="a=i@@c=j"};
+{"key"="150";"subkey"="4";"value"="a=A"};
diff --git a/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt.attr b/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt.attr
new file mode 100644
index 0000000000..14544c6d7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_with_read_udf.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_read_udf"="Dsv.ReadRecord";
+ "_yql_read_udf_run_config"="@@";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/insert/input_with_view.txt b/yql/essentials/tests/sql/suites/insert/input_with_view.txt
new file mode 100644
index 0000000000..d15f960f63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_with_view.txt
@@ -0,0 +1,10 @@
+{"key"="0";"subkey"="-";"value"="zero"};
+{"key"="1";"subkey"="-";"value"="one"};
+{"key"="2";"subkey"="-";"value"="two"};
+{"key"="3";"subkey"="-";"value"="three"};
+{"key"="4";"subkey"="-";"value"="four"};
+{"key"="5";"subkey"="-";"value"="five"};
+{"key"="6";"subkey"="-";"value"="six"};
+{"key"="7";"subkey"="-";"value"="seven"};
+{"key"="8";"subkey"="-";"value"="eight"};
+{"key"="9";"subkey"="-";"value"="nine"};
diff --git a/yql/essentials/tests/sql/suites/insert/input_with_view.txt.attr b/yql/essentials/tests/sql/suites/insert/input_with_view.txt.attr
new file mode 100644
index 0000000000..501fdca6db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/input_with_view.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_my"="$udfScript=\"def f(row):\n\treturn {'myvalue':b'm' + row.value}\n\";$udf=Python::f(Callable<(Struct<key:String,subkey:String,value:String>)->Struct<myvalue:String>>, $udfScript);PROCESS self USING $udf(TableRow());";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/insert/insert_from_other.cfg b/yql/essentials/tests/sql/suites/insert/insert_from_other.cfg
new file mode 100644
index 0000000000..7cc1222553
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/insert_from_other.cfg
@@ -0,0 +1,2 @@
+in Input other.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/insert_from_other.sql b/yql/essentials/tests/sql/suites/insert/insert_from_other.sql
new file mode 100644
index 0000000000..9c295718ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/insert_from_other.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+insert into plato.Output with truncate
+select * from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/insert/insert_null.sql b/yql/essentials/tests/sql/suites/insert/insert_null.sql
new file mode 100644
index 0000000000..3aafd6c5a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/insert_null.sql
@@ -0,0 +1,4 @@
+use plato;
+
+insert into Output
+select NULL as x;
diff --git a/yql/essentials/tests/sql/suites/insert/insert_relabeled.sql b/yql/essentials/tests/sql/suites/insert/insert_relabeled.sql
new file mode 100644
index 0000000000..cbe93546dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/insert_relabeled.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, new_value, one_more_value) select key, subkey, value as new_value, "x" from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta-nonstrict_fail.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta-nonstrict_fail.cfg
new file mode 100644
index 0000000000..1f376d1f93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta-nonstrict_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txt
+out Output other.txt
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta-proto_fail.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta-proto_fail.cfg
new file mode 100644
index 0000000000..6d87958c65
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta-proto_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+out Output input_proto.txt
+udf protobuf_udf
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta-view_fail.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta-view_fail.cfg
new file mode 100644
index 0000000000..db398a8d2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta-view_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+in Input1 input.txt
+in Input2 input2.txt
+out Output input_view.txt
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta-with_read_udf_fail.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta-with_read_udf_fail.cfg
new file mode 100644
index 0000000000..1d043c6420
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta-with_read_udf_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+out Output input_with_read_udf.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta-with_view.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta-with_view.cfg
new file mode 100644
index 0000000000..4feca3f4ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta-with_view.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output input_with_view.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta.cfg b/yql/essentials/tests/sql/suites/insert/keepmeta.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/keepmeta.sql b/yql/essentials/tests/sql/suites/insert/keepmeta.sql
new file mode 100644
index 0000000000..360c609748
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/keepmeta.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* multirun can not */
+insert into plato.Output with (truncate, keepmeta)
+select * from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/insert/literals_to_string.sql b/yql/essentials/tests/sql/suites/insert/literals_to_string.sql
new file mode 100644
index 0000000000..d3cb1ae817
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/literals_to_string.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, value) values (YQL::ToString(1), YQL::ToString(2), "3");
diff --git a/yql/essentials/tests/sql/suites/insert/merge_publish.cfg b/yql/essentials/tests/sql/suites/insert/merge_publish.cfg
new file mode 100644
index 0000000000..1abba632a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/merge_publish.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 input.txt
diff --git a/yql/essentials/tests/sql/suites/insert/merge_publish.sql b/yql/essentials/tests/sql/suites/insert/merge_publish.sql
new file mode 100644
index 0000000000..741b5dc366
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/merge_publish.sql
@@ -0,0 +1,20 @@
+/* postgres can not */
+/* kikimr can not */
+/* ignore plan diff */
+use plato;
+
+pragma yt.ScriptCpu="1.0";
+
+insert into Output1 select "1" as key, subkey, value from Input;
+
+insert into Output2 select "2" as key, subkey, value from Input;
+
+insert into Output2 select "3" as key, subkey, value from Input;
+
+insert into Output1 select "4" as key, subkey, value from Input;
+
+pragma yt.ScriptCpu="2.0";
+
+insert into Output1 select "5" as key, subkey, value from Input;
+
+insert into Output1 select "6" as key, subkey, value from Input;
diff --git a/yql/essentials/tests/sql/suites/insert/multiappend_sorted.sql b/yql/essentials/tests/sql/suites/insert/multiappend_sorted.sql
new file mode 100644
index 0000000000..bd33297afb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/multiappend_sorted.sql
@@ -0,0 +1,63 @@
+/* postgres can not */
+/* multirun can not */
+
+insert into plato.Output with truncate
+select * from plato.Input order by key;
+
+insert into plato.Output
+select * from plato.Input;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input;
+
+insert into plato.Output
+select * from plato.Input order by key;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input order by key, subkey;
+
+insert into plato.Output
+select * from plato.Input order by key, subkey;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input order by key;
+
+insert into plato.Output
+select * from plato.Input order by key desc;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input order by key;
+
+insert into plato.Output
+select * from plato.Input order by key || subkey;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input order by key desc;
+
+insert into plato.Output
+select * from plato.Input order by key desc;
+
+commit;
+----------------------------------------
+
+insert into plato.Output with truncate
+select * from plato.Input order by key || subkey;
+
+insert into plato.Output
+select * from plato.Input order by key || subkey;
+
diff --git a/yql/essentials/tests/sql/suites/insert/other.txt b/yql/essentials/tests/sql/suites/insert/other.txt
new file mode 100644
index 0000000000..004ddc583b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/other.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/insert/other.txt.attr b/yql/essentials/tests/sql/suites/insert/other.txt.attr
new file mode 100644
index 0000000000..e6092cd69d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/other.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"}
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "sort_order" = "ascending";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/insert/override-from_sorted.cfg b/yql/essentials/tests/sql/suites/insert/override-from_sorted.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-from_sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/override-from_sorted_calc.cfg b/yql/essentials/tests/sql/suites/insert/override-from_sorted_calc.cfg
new file mode 100644
index 0000000000..da3506e2e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-from_sorted_calc.cfg
@@ -0,0 +1,2 @@
+in Input sorted_calc.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/override-from_sorted_desc.cfg b/yql/essentials/tests/sql/suites/insert/override-from_sorted_desc.cfg
new file mode 100644
index 0000000000..803556470a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-from_sorted_desc.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/override-proto.cfg b/yql/essentials/tests/sql/suites/insert/override-proto.cfg
new file mode 100644
index 0000000000..499362d95f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-proto.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output input_proto.txt
+udf protobuf_udf
diff --git a/yql/essentials/tests/sql/suites/insert/override-view_fail.cfg b/yql/essentials/tests/sql/suites/insert/override-view_fail.cfg
new file mode 100644
index 0000000000..db398a8d2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-view_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+in Input1 input.txt
+in Input2 input2.txt
+out Output input_view.txt
diff --git a/yql/essentials/tests/sql/suites/insert/override-with_read_udf.cfg b/yql/essentials/tests/sql/suites/insert/override-with_read_udf.cfg
new file mode 100644
index 0000000000..8edc95b521
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-with_read_udf.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output input_with_read_udf.txt
+udf dsv_udf
diff --git a/yql/essentials/tests/sql/suites/insert/override-with_view.cfg b/yql/essentials/tests/sql/suites/insert/override-with_view.cfg
new file mode 100644
index 0000000000..4feca3f4ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override-with_view.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output input_with_view.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/insert/override.cfg b/yql/essentials/tests/sql/suites/insert/override.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/override.sql b/yql/essentials/tests/sql/suites/insert/override.sql
new file mode 100644
index 0000000000..9c295718ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/override.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+insert into plato.Output with truncate
+select * from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/insert/part_sortness-desc.cfg b/yql/essentials/tests/sql/suites/insert/part_sortness-desc.cfg
new file mode 100644
index 0000000000..803556470a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/part_sortness-desc.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/part_sortness.cfg b/yql/essentials/tests/sql/suites/insert/part_sortness.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/part_sortness.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/part_sortness.sql b/yql/essentials/tests/sql/suites/insert/part_sortness.sql
new file mode 100644
index 0000000000..291ae5ae7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/part_sortness.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+insert into plato.Output with truncate
+SELECT
+ key,value
+FROM plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/read_schema.txt b/yql/essentials/tests/sql/suites/insert/read_schema.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/read_schema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/insert/read_schema.txt.attr b/yql/essentials/tests/sql/suites/insert/read_schema.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/read_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/insert/replace_inferred.cfg b/yql/essentials/tests/sql/suites/insert/replace_inferred.cfg
new file mode 100644
index 0000000000..b5b1813964
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_inferred.cfg
@@ -0,0 +1 @@
+out Output inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/insert/replace_inferred.sql b/yql/essentials/tests/sql/suites/insert/replace_inferred.sql
new file mode 100644
index 0000000000..ec481c4771
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_inferred.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* kikimr can not */
+use plato;
+
+pragma yt.InferSchema;
+pragma yt.InferSchemaTableCountThreshold="100000";
+
+insert into Output with truncate
+select * from Output;
diff --git a/yql/essentials/tests/sql/suites/insert/replace_inferred_op.cfg b/yql/essentials/tests/sql/suites/insert/replace_inferred_op.cfg
new file mode 100644
index 0000000000..b5b1813964
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_inferred_op.cfg
@@ -0,0 +1 @@
+out Output inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/insert/replace_inferred_op.sql b/yql/essentials/tests/sql/suites/insert/replace_inferred_op.sql
new file mode 100644
index 0000000000..40e1d5e3cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_inferred_op.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* kikimr can not */
+use plato;
+
+pragma yt.InferSchema;
+pragma yt.InferSchemaTableCountThreshold="0";
+
+insert into Output with truncate
+select * from Output;
diff --git a/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key.sql b/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key.sql
new file mode 100644
index 0000000000..02057e2951
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, value from plato.Input order by key;
diff --git a/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key_desc.sql b/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key_desc.sql
new file mode 100644
index 0000000000..46f2024768
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/replace_ordered_by_key_desc.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, value from plato.Input order by key desc;
diff --git a/yql/essentials/tests/sql/suites/insert/select_after_insert_relabeled.sql b/yql/essentials/tests/sql/suites/insert/select_after_insert_relabeled.sql
new file mode 100644
index 0000000000..774cea8db9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_after_insert_relabeled.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* multirun can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, new_value, one_more_value) select key, subkey, value as new_value, "x" from plato.Input;
+commit;
+select key, subkey, new_value, one_more_value from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/insert/select_after_replace.sql b/yql/essentials/tests/sql/suites/insert/select_after_replace.sql
new file mode 100644
index 0000000000..6c176e12be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_after_replace.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* multirun can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, value from plato.Input;
+commit;
+select key, subkey, value from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/insert/select_after_replace_unwrap.sql b/yql/essentials/tests/sql/suites/insert/select_after_replace_unwrap.sql
new file mode 100644
index 0000000000..d16e715ff9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_after_replace_unwrap.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* multirun can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, value from plato.Input;
+commit;
+select coalesce(key, ""), coalesce(subkey, ""), coalesce(value, "") from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.cfg b/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.cfg
new file mode 100644
index 0000000000..9421c82dab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.cfg
@@ -0,0 +1,3 @@
+in Input read_schema.txt
+out Output output.txt
+
diff --git a/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.sql b/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.sql
new file mode 100644
index 0000000000..12fe8035a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_operate_with_columns.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+insert into plato.Output with truncate
+select a + b + c as a, coalesce(d, "") as b, f as f, cast(coalesce(e, true) as varchar) as e from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/insert/select_relabel.sql b/yql/essentials/tests/sql/suites/insert/select_relabel.sql
new file mode 100644
index 0000000000..71b5507666
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_relabel.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output with truncate (key, subkey, value) select key, subkey, "1" as value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/insert/select_subquery.cfg b/yql/essentials/tests/sql/suites/insert/select_subquery.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_subquery.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/select_subquery.sql b/yql/essentials/tests/sql/suites/insert/select_subquery.sql
new file mode 100644
index 0000000000..08015031cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_subquery.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+$a = (select key from Input order by key limit 1);
+
+insert into Output (key) select $a;
diff --git a/yql/essentials/tests/sql/suites/insert/select_with_sort_limit.sql b/yql/essentials/tests/sql/suites/insert/select_with_sort_limit.sql
new file mode 100644
index 0000000000..97a8f11be7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/select_with_sort_limit.sql
@@ -0,0 +1,3 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output
+select * from plato.Input order by key limit 2;
diff --git a/yql/essentials/tests/sql/suites/insert/sorted.txt b/yql/essentials/tests/sql/suites/insert/sorted.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert/sorted.txt.attr b/yql/essentials/tests/sql/suites/insert/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_calc.txt b/yql/essentials/tests/sql/suites/insert/sorted_calc.txt
new file mode 100644
index 0000000000..1e60677ebb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_calc.txt
@@ -0,0 +1,4 @@
+{"_yql_column_0"="0233";"key"="023";"subkey"="3";"value"="aaa"};
+{"_yql_column_0"="0375";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="0751";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="1501";"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_calc.txt.attr b/yql/essentials/tests/sql/suites/insert/sorted_calc.txt.attr
new file mode 100644
index 0000000000..60103163df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_calc.txt.attr
@@ -0,0 +1,44 @@
+{
+ "_yql_row_spec" = {
+ "SortDirections" = [
+ 1
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_desc.txt b/yql/essentials/tests/sql/suites/insert/sorted_desc.txt
new file mode 100644
index 0000000000..235fc7cd49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_desc.txt
@@ -0,0 +1,10 @@
+{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"};
+{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"};
+{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"};
+{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/insert/sorted_desc.txt.attr
new file mode 100644
index 0000000000..5a6ca5761e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_desc.txt.attr
@@ -0,0 +1,47 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_empty.txt b/yql/essentials/tests/sql/suites/insert/sorted_empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_empty.txt
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_empty.txt.attr b/yql/essentials/tests/sql/suites/insert/sorted_empty.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_empty.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_unique.txt b/yql/essentials/tests/sql/suites/insert/sorted_unique.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_unique.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert/sorted_unique.txt.attr b/yql/essentials/tests/sql/suites/insert/sorted_unique.txt.attr
new file mode 100644
index 0000000000..eeee4c32ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/sorted_unique.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/trivial_literals.sql b/yql/essentials/tests/sql/suites/insert/trivial_literals.sql
new file mode 100644
index 0000000000..5d0a0e557a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/trivial_literals.sql
@@ -0,0 +1,2 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, value) values ("1", "2", "3");
diff --git a/yql/essentials/tests/sql/suites/insert/trivial_literals_multirow.sql b/yql/essentials/tests/sql/suites/insert/trivial_literals_multirow.sql
new file mode 100644
index 0000000000..8ea32ffc35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/trivial_literals_multirow.sql
@@ -0,0 +1,4 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+/* postgres can not */
+insert into plato.Output (key, subkey, value)
+values ("1", "2", "3"), ("4", "5", "6"), ("7", "8", "9");
diff --git a/yql/essentials/tests/sql/suites/insert/trivial_select.sql b/yql/essentials/tests/sql/suites/insert/trivial_select.sql
new file mode 100644
index 0000000000..26b1075133
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/trivial_select.sql
@@ -0,0 +1,2 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, value) select key, subkey, value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/insert/two_input_tables.cfg b/yql/essentials/tests/sql/suites/insert/two_input_tables.cfg
new file mode 100644
index 0000000000..369f783dcd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/two_input_tables.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+out Output output.txt
+
diff --git a/yql/essentials/tests/sql/suites/insert/two_input_tables.sql b/yql/essentials/tests/sql/suites/insert/two_input_tables.sql
new file mode 100644
index 0000000000..9a02779e6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/two_input_tables.sql
@@ -0,0 +1,3 @@
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output (key, subkey, value) select key, subkey, value from plato.Input;
+insert into plato.Output (key, subkey, value) select key, subkey, value from plato.Input2;
diff --git a/yql/essentials/tests/sql/suites/insert/udf_empty.cfg b/yql/essentials/tests/sql/suites/insert/udf_empty.cfg
new file mode 100644
index 0000000000..57571ef968
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/udf_empty.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/insert/udf_empty.sql b/yql/essentials/tests/sql/suites/insert/udf_empty.sql
new file mode 100644
index 0000000000..65823f12cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/udf_empty.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+-- kikimr only: pragma kikimr.UnwrapReadTableValues = "false"; create table plato.Output (key varchar null, subkey varchar null, value varchar null, primary key (key)); commit;
+insert into plato.Output(key, subkey, value) values (SimpleUdf::ReturnNull(""), SimpleUdf::ReturnVoid(""), coalesce(SimpleUdf::ReturnEmpty(""), "!"));
diff --git a/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.cfg b/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.cfg
new file mode 100644
index 0000000000..eddd32c5cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.cfg
@@ -0,0 +1,10 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+out Output5 output5.txt
+out Output6 output6.txt
+out Output7 output7.txt
+out Output8 output8.txt
+
diff --git a/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.sql b/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.sql
new file mode 100644
index 0000000000..9029434ebc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/unique_distinct_hints.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+USE plato;
+
+INSERT INTO Output1 WITH TRUNCATE SELECT /*+ unique() */ * FROM Input;
+INSERT INTO Output2 WITH TRUNCATE SELECT /*+ distinct() */ * FROM Input;
+
+INSERT INTO Output3 WITH TRUNCATE SELECT /*+ distinct(key subkey) unique(value) */ * FROM Input;
+INSERT INTO Output4 WITH TRUNCATE SELECT /*+ unique(key) distinct(subkey value) */ * FROM Input;
+INSERT INTO Output5 WITH TRUNCATE SELECT /*+ unique(key value) unique(subkey) */ * FROM Input;
+INSERT INTO Output6 WITH TRUNCATE SELECT /*+ distinct(key) distinct(subkey) */ * FROM Input;
+
+-- Bad case: missed column - ignore hint with warning.
+INSERT INTO Output7 WITH TRUNCATE SELECT /*+ unique(subkey value) */ key, value FROM Input;
+
+INSERT INTO Output8 WITH TRUNCATE SELECT /*+ distinct(key subkey) */ key, subkey FROM Input ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.cfg b/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.sql b/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.sql
new file mode 100644
index 0000000000..acf1795e35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/use_anon_table_before_commit_fail.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+use plato;
+
+insert into @a
+select * from Input;
+
+select * from @a;
+
diff --git a/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.cfg b/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.sql b/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.sql
new file mode 100644
index 0000000000..5d78422272
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/use_anon_table_without_fill_fail.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+use plato;
+
+select * from @a;
+
diff --git a/yql/essentials/tests/sql/suites/insert/values_subquery.cfg b/yql/essentials/tests/sql/suites/insert/values_subquery.cfg
new file mode 100644
index 0000000000..38b2bc62d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/values_subquery.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/values_subquery.sql b/yql/essentials/tests/sql/suites/insert/values_subquery.sql
new file mode 100644
index 0000000000..a409e91d8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/values_subquery.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+$a = (select key from Input order by key limit 1);
+
+insert into Output (key) values ($a);
diff --git a/yql/essentials/tests/sql/suites/insert/yql-13083-existig.cfg b/yql/essentials/tests/sql/suites/insert/yql-13083-existig.cfg
new file mode 100644
index 0000000000..97aa89b9bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/yql-13083-existig.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output1 sorted.txt
+out Output2 sorted.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/yql-13083.cfg b/yql/essentials/tests/sql/suites/insert/yql-13083.cfg
new file mode 100644
index 0000000000..09952ac4de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/yql-13083.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output1 output.txt
+out Output2 output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/yql-13083.sql b/yql/essentials/tests/sql/suites/insert/yql-13083.sql
new file mode 100644
index 0000000000..92c8c6ec79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/yql-13083.sql
@@ -0,0 +1,32 @@
+/* postgres can not */
+use plato;
+
+INSERT INTO Output1
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM Input
+WHERE key < "100"
+ORDER BY key;
+
+INSERT INTO Output2
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM Input
+WHERE key < "200"
+ORDER BY key;
+
+INSERT INTO Output1
+SELECT
+ *
+FROM Input
+ORDER BY key;
+
+INSERT INTO Output2
+SELECT
+ *
+FROM Input
+ORDER BY key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert/yql-14538.cfg b/yql/essentials/tests/sql/suites/insert/yql-14538.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/yql-14538.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert/yql-14538.sql b/yql/essentials/tests/sql/suites/insert/yql-14538.sql
new file mode 100644
index 0000000000..73c2c6267a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert/yql-14538.sql
@@ -0,0 +1,18 @@
+use plato;
+
+INSERT INTO Output
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM Input
+WHERE key < "100"
+ORDER BY key
+LIMIT 5;
+
+INSERT INTO Output
+SELECT
+ *
+FROM Input
+ORDER BY key
+LIMIT 4;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg
new file mode 100644
index 0000000000..f534ef41b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input1 input1.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql
new file mode 100644
index 0000000000..a44b306f32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql
@@ -0,0 +1,5 @@
+use plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg
new file mode 100644
index 0000000000..a517989811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input4.txt
+out Output sorted_unique.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql
new file mode 100644
index 0000000000..00865ab6c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql
@@ -0,0 +1,7 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT DISTINCT * FROM Input
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg
new file mode 100644
index 0000000000..a615fc5955
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg
@@ -0,0 +1,6 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input4 input4.txt
+in Input5 input5.txt
+out Output sorted.txt
+
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg
new file mode 100644
index 0000000000..cbcd5e6ebb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg
@@ -0,0 +1,2 @@
+in EmptyInput sorted_empty.txt
+out Output sorted.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql
new file mode 100644
index 0000000000..12a4cd2d3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM EmptyInput
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt
new file mode 100644
index 0000000000..9b007a435c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt
@@ -0,0 +1,2 @@
+{"key"="201";"subkey"="3";"value"="aaa"};
+{"key"="202";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt
new file mode 100644
index 0000000000..10fcfb562a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt
@@ -0,0 +1,2 @@
+{"key"="203";"subkey"="3";"value"="aaa"};
+{"key"="204";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt
new file mode 100644
index 0000000000..b088aadfed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt
@@ -0,0 +1 @@
+{"key"="149";"subkey"="1";"value"="aaa"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr
new file mode 100644
index 0000000000..f4e2c10c67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt
new file mode 100644
index 0000000000..f2da650820
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt
@@ -0,0 +1,4 @@
+{"key"="200";"subkey"="3";"value"="aaa"};
+{"key"="201";"subkey"="1";"value"="ddd"};
+{"key"="201";"subkey"="1";"value"="abc"};
+{"key"="202";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr
new file mode 100644
index 0000000000..dda2f66d5e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql b/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql
new file mode 100644
index 0000000000..cf797537e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH (MONOTONIC_KEYS, KEEP_META, TRUNCATE)
+SELECT * FROM Input1
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg
new file mode 100644
index 0000000000..407769fc34
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+out Output sorted_unique.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql
new file mode 100644
index 0000000000..9721c1b113
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql
@@ -0,0 +1,9 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT key, subkey, some(value) as value
+FROM Input
+GROUP BY key, subkey
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg
new file mode 100644
index 0000000000..5625fb3b45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql
new file mode 100644
index 0000000000..fe58dae84c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT 1 as key
+ORDER BY key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg
new file mode 100644
index 0000000000..be41f68e2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input1 input1.txt
+in Input2 input2.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql
new file mode 100644
index 0000000000..a209e180d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg
new file mode 100644
index 0000000000..1b0d1ea529
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input3.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql
new file mode 100644
index 0000000000..ec7888b052
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql
@@ -0,0 +1,7 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql b/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql
new file mode 100644
index 0000000000..f0f3f00b24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+INSERT INTO Output
+WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+UNION ALL
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql b/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql
new file mode 100644
index 0000000000..409f0b120e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr
new file mode 100644
index 0000000000..eeee4c32ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg
new file mode 100644
index 0000000000..01364c3d38
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+out EmptyOutput sorted_empty.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql
new file mode 100644
index 0000000000..b9cfd780bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO EmptyOutput WITH MONOTONIC_KEYS
+SELECT * FROM Input
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql
new file mode 100644
index 0000000000..6279af1bd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH TRUNCATE
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg
new file mode 100644
index 0000000000..88b7afd164
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input1.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql
new file mode 100644
index 0000000000..374d347fbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH (MONOTONIC_KEYS, TRUNCATE)
+SELECT * FROM Input
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/join/aggr_diff_order.sql b/yql/essentials/tests/sql/suites/join/aggr_diff_order.sql
new file mode 100644
index 0000000000..21762aa6c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/aggr_diff_order.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+PRAGMA yt.JoinMergeForce = "1";
+pragma yt.JoinMergeTablesLimit="10";
+
+SELECT key1, subkey1
+FROM
+ (
+ SELECT a.key as key1, a.subkey as subkey1
+ FROM ANY (SELECT * FROM Input8 WHERE subkey != "bar") AS a
+ JOIN ANY (SELECT * FROM Input8 WHERE subkey != "foo") AS b
+ ON a.key = b.key AND a.subkey = b.subkey
+ )
+GROUP COMPACT BY subkey1, key1;
diff --git a/yql/essentials/tests/sql/suites/join/alias_where_group-off.cfg b/yql/essentials/tests/sql/suites/join/alias_where_group-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/alias_where_group-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/alias_where_group.cfg b/yql/essentials/tests/sql/suites/join/alias_where_group.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/alias_where_group.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/alias_where_group.sql b/yql/essentials/tests/sql/suites/join/alias_where_group.sql
new file mode 100644
index 0000000000..bc7f28419c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/alias_where_group.sql
@@ -0,0 +1,16 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+SELECT
+ key,
+ subkey
+FROM Input3 as ia
+INNER JOIN Input4 as ib
+USING(key)
+WHERE
+ ib.subkey = '2'
+GROUP BY
+ ia.key as key,
+ ia.value as subkey
+ORDER BY key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_dup-off.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup-off.cfg
new file mode 100644
index 0000000000..ada3709d76
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_dup.txt
+in Input2 sorted_by_kv2_dup.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.cfg
new file mode 100644
index 0000000000..5186b3d003
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_dup.txt
+in Input2 sorted_by_kv2_dup.txt
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.sql b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.sql
new file mode 100644
index 0000000000..977215d43a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_dup.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+select * from Input1 as a right join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a right join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from Input1 as a right join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a right join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys-off.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.sql b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.sql
new file mode 100644
index 0000000000..bbde851b43
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodata_keys.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+
+$a = SELECT AsTuple(1, 2) AS k1, 1 AS k2, 2 AS v;
+
+$b = SELECT AsTuple(1, 2) AS k1, 1 AS k2, 3 AS v1
+ UNION ALL
+ SELECT AsTuple(1, 2) AS k1, 1 AS k2, 3 AS v1;
+
+INSERT INTO @a
+SELECT * FROM $a;
+
+INSERT INTO @b
+SELECT * FROM $b;
+
+COMMIT;
+
+SELECT * FROM @a AS a LEFT JOIN ANY @b AS b using(k1,k2);
+SELECT * FROM @a AS a LEFT JOIN @b AS b using(k1,k2);
+
+
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup-off.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.sql b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.sql
new file mode 100644
index 0000000000..977215d43a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_common_nodup.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+select * from Input1 as a right join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a right join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from Input1 as a right join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a right join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup-off.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.cfg b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.sql b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.sql
new file mode 100644
index 0000000000..7d9a857905
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/anyjoin_merge_nodup.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+
+select * from Input1 as a join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a join Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from Input1 as a join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+select * from any Input1 as a join any Input2 as b on a.k1 = b.k2 order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/branch.txt b/yql/essentials/tests/sql/suites/join/branch.txt
new file mode 100644
index 0000000000..35d1356535
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/branch.txt
@@ -0,0 +1,15 @@
+{"key"=13u;"leaf"=#;"value"=";dx;lwk;ed"};
+{"key"=17u;"leaf"=5u;"value"="dkeo3o"};
+{"key"=15u;"leaf"=#;"value"=#};
+{"key"=14u;"leaf"=#;"value"="neduiejud"};
+{"key"=10u;"leaf"=1u;"value"="lwk;lde;lw"};
+{"key"=10u;"leaf"=2u;"value"="&&"};
+{"key"=10u;"leaf"=2u;"value"="&&"};
+{"key"=18u;"leaf"=8u;"value"="98743897894"};
+{"key"=18u;"leaf"=3u;"value"="13"};
+{"key"=18u;"leaf"=#;"value"=#};
+{"key"=11u;"leaf"=4u;"value"=#};
+{"key"=19u;"leaf"=#;"value"="huiyhuihji"};
+{"key"=20u;"leaf"=9u;"value"=".xdws;"};
+{"key"=16u;"leaf"=#;"value"="!!!!!!!!!!"};
+{"key"=12u;"leaf"=3u;"value"=#};
diff --git a/yql/essentials/tests/sql/suites/join/branch.txt.attr b/yql/essentials/tests/sql/suites/join/branch.txt.attr
new file mode 100644
index 0000000000..4a77dc3233
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/branch.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["leaf";["OptionalType";["DataType";"Uint64"]]];
+ ["value";["OptionalType";["DataType";"String"]]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in.sql b/yql/essentials/tests/sql/suites/join/bush_dis_in.sql
new file mode 100644
index 0000000000..82a9d54d6f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+select * from (
+ SELECT DISTINCT i1.key AS Key, i1.value as Value, i2.value as Join
+ FROM Roots AS i1
+ INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+ UNION ALL
+ SELECT DISTINCT i1.key AS Key, i1.value as Value, i2.value as Join
+ FROM Roots AS i1
+ INNER JOIN Branches AS i2 ON i1.branch = i2.key
+) order by Key, Value, Join;
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in.sql b/yql/essentials/tests/sql/suites/join/bush_dis_in_in.sql
new file mode 100644
index 0000000000..bd1989e82d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT DISTINCT i1.key AS Key, i1.value AS Value, i2.value AS Leaf, i3.value AS Branch
+FROM Roots AS i1
+INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+INNER JOIN Branches AS i3 ON i1.branch = i3.key
+ORDER BY Leaf, Branch;
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.cfg b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.sql b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.sql
new file mode 100644
index 0000000000..22d12df7c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_dis_in_in_in.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT DISTINCT i1.key AS Key, i1.value as Value, i2.value As Leaf, i3.value AS Branch, i4.value AS Branch_Leaf
+FROM Roots AS i1
+INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+INNER JOIN Branches AS i3 ON i1.branch = i3.key
+INNER JOIN Leaves AS i4 ON i3.leaf = i4.key
+ORDER BY Leaf, Branch, Branch_Leaf;
diff --git a/yql/essentials/tests/sql/suites/join/bush_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_in.cfg b/yql/essentials/tests/sql/suites/join/bush_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_in.sql b/yql/essentials/tests/sql/suites/join/bush_in.sql
new file mode 100644
index 0000000000..af77ba34e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+select * from (
+ SELECT i1.key AS Key, i1.value as Value, i2.value as Join
+ FROM Roots AS i1
+ INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+ UNION ALL
+ SELECT i1.key AS Key, i1.value as Value, i2.value as Join
+ FROM Roots AS i1
+ INNER JOIN Branches AS i2 ON i1.branch = i2.key
+) order by Key, Value, Join;
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_in_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in.cfg b/yql/essentials/tests/sql/suites/join/bush_in_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in.sql b/yql/essentials/tests/sql/suites/join/bush_in_in.sql
new file mode 100644
index 0000000000..bf385a0ea9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT i1.key AS Key, i1.value AS Value, i2.value AS Leaf, i3.value AS Branch
+FROM Roots AS i1
+INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+INNER JOIN Branches AS i3 ON i1.branch = i3.key
+ORDER BY Leaf, Branch;
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in_in-off.cfg b/yql/essentials/tests/sql/suites/join/bush_in_in_in-off.cfg
new file mode 100644
index 0000000000..f091bc1467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in_in-off.cfg
@@ -0,0 +1,5 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in_in.cfg b/yql/essentials/tests/sql/suites/join/bush_in_in_in.cfg
new file mode 100644
index 0000000000..684f34abfd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in_in.cfg
@@ -0,0 +1,3 @@
+in Roots root.txt
+in Leaves leaf.txt
+in Branches branch.txt
diff --git a/yql/essentials/tests/sql/suites/join/bush_in_in_in.sql b/yql/essentials/tests/sql/suites/join/bush_in_in_in.sql
new file mode 100644
index 0000000000..901aa219d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/bush_in_in_in.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT i1.key AS Key, i1.value as Value, i2.value As Leaf, i3.value AS Branch, i4.value AS Branch_Leaf
+FROM Roots AS i1
+INNER JOIN Leaves AS i2 ON i1.leaf = i2.key
+INNER JOIN Branches AS i3 ON i1.branch = i3.key
+INNER JOIN Leaves AS i4 ON i3.leaf = i4.key;
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables.cfg b/yql/essentials/tests/sql/suites/join/cbo_4tables.cfg
new file mode 100644
index 0000000000..a3f4d2aec3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables.cfg
@@ -0,0 +1,5 @@
+providers dummy
+in InputA cbo_4tables_a.txt
+in InputB cbo_4tables_b.txt
+in InputC cbo_4tables_c.txt
+in InputD cbo_4tables_d.txt
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables.sql b/yql/essentials/tests/sql/suites/join/cbo_4tables.sql
new file mode 100644
index 0000000000..b96f5c3a79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+pragma CostBasedOptimizer="native";
+pragma yt.MapJoinLimit="1000";
+pragma yt.LookupJoinLimit="1000";
+pragma yt.LookupJoinMaxRows="100";
+pragma yt.ExtendedStatsMaxChunkCount="0";
+pragma yt.JoinMergeTablesLimit="100";
+
+SELECT
+ InputA.Key1, InputA.Key2, InputA.Value, InputB.val, InputC.v, InputD.value as vald
+FROM
+ InputA
+ INNER JOIN InputD ON InputA.Key2 = InputD.k
+ INNER JOIN InputB ON InputA.Fk1 = InputB.k
+ INNER JOIN InputC ON InputA.Key1 = InputC.k
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt b/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt
new file mode 100644
index 0000000000..6c0c166030
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt
@@ -0,0 +1,14 @@
+{"Key1"=101;"Key2"="One";"Fk1"=#;"Value"="no_right_key_1"};
+{"Key1"=102;"Key2"="Two";"Fk1"=#;"Value"="no_right_key_2"};
+{"Key1"=103;"Key2"="Three";"Fk1"="Name1";"Value"="Value1"};
+{"Key1"=104;"Key2"="One";"Fk1"="Name2";"Value"="Value2"};
+{"Key1"=104;"Key2"="Two";"Fk1"="Name2";"Value"="Value3"};
+{"Key1"=105;"Key2"="One";"Fk1"="Name3";"Value"="no_right_key_3"};
+{"Key1"=106;"Key2"="One";"Fk1"="Name4";"Value"=#};
+{"Key1"=106;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"};
+{"Key1"=107;"Key2"="Seventeen";"Fk1"="Name4";"Value"="Value4"};
+{"Key1"=108;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"};
+{"Key1"=109;"Key2"="Two";"Fk1"="Name1";"Value"="Value4"};
+{"Key1"=110;"Key2"="Four";"Fk1"="Name5";"Value"="Value4"};
+{"Key1"=111;"Key2"="Three";"Fk1"="Name4";"Value"="Value4"};
+{"Key1"=111;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"};
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt.attr b/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt.attr
new file mode 100644
index 0000000000..295e5a3d06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_a.txt.attr
@@ -0,0 +1,61 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["Key1";["DataType";"Int32"]];
+ ["Key2";["DataType";"String"]];
+ ["Fk1";["OptionalType";["DataType";"String"]]];
+ ["Value";["OptionalType";["DataType";"String"]]]]
+ ];
+ "SortDirections"=[1;1];
+ "SortedBy"=["Key1";"Key2"];
+ "SortedByTypes"=[["DataType";"Int32";];["DataType";"String"]];
+ "SortMembers"=["Key1";"Key2"];
+ };
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "Key1";
+ "sort_order" = "ascending";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ {
+ "name" = "Key2";
+ "sort_order" = "ascending";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "Fk1";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "Value";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "Key1";
+ "data_weight" = 56;
+ "num_unique_vals" = 11;
+ };
+ {
+ "column_name" = "Key2";
+ "data_weight" = 66;
+ "num_unique_vals" = 5;
+ };
+ {
+ "column_name" = "Fk1";
+ "data_weight" = 70;
+ "num_unique_vals" = 5;
+ };
+ {
+ "column_name" = "Value";
+ "data_weight" = 98;
+ "num_unique_vals" = 6;
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt b/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt
new file mode 100644
index 0000000000..9ef08e2fb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt
@@ -0,0 +1,3 @@
+{"k"="Name2";"val"="Misha"};
+{"k"="Name2";"val"="Sasha"};
+{"k"="Name3";"val"="Ksyusha"};
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt.attr b/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt.attr
new file mode 100644
index 0000000000..460ca717f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_b.txt.attr
@@ -0,0 +1,34 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k";["OptionalType";["DataType";"String"]]];
+ ["val";["OptionalType";["DataType";"String"]]]]
+ ];
+ };
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "k";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "val";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "k";
+ "data_weight" = 18;
+ "num_unique_vals" = 2;
+ };
+ {
+ "column_name" = "val";
+ "data_weight" = 20;
+ "num_unique_vals" = 3;
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt b/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt
new file mode 100644
index 0000000000..803ff2ca0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt
@@ -0,0 +1,5 @@
+{"k"=104;v=4};
+{"k"=105;v=5};
+{"k"=106;v=6};
+{"k"=107;v=6};
+{"k"=111;v=10};
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt.attr b/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt.attr
new file mode 100644
index 0000000000..fb108546cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_c.txt.attr
@@ -0,0 +1,34 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k";["OptionalType";["DataType";"Int64"]]];
+ ["v";["OptionalType";["DataType";"Int64"]]]]
+ ];
+ };
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "k";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ {
+ "name" = "v";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "k";
+ "data_weight" = 12;
+ "num_unique_vals" = 3;
+ };
+ {
+ "column_name" = "v";
+ "data_weight" = 12;
+ "num_unique_vals" = 3;
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt b/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt
new file mode 100644
index 0000000000..13684e9905
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt
@@ -0,0 +1,11 @@
+{id=3;"k"="One";"value"=17};
+{id=5;"k"="Two";"value"=17};
+{id=13;"k"="One";"value"=0};
+{id=23;"k"="Three";"value"=-44};
+{id=27;"k"="Ten";"value"=17};
+{id=33;"k"="Zero";"value"=1024};
+{id=38;"k"="Seventeen";"value"=17};
+{id=39;"k"="One";"value"=23};
+{id=40;"k"="Three";"value"=17};
+{id=42;"k"="Four";"value"=25};
+{id=50;"k"="One";"value"=17};
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt.attr b/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt.attr
new file mode 100644
index 0000000000..8050807ed9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_d.txt.attr
@@ -0,0 +1,50 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["id";["DataType";"Int32"]];
+ ["k";["OptionalType";["DataType";"String"]]];
+ ["value";["OptionalType";["DataType";"Int64"]]]]
+ ];
+ "SortDirections"=[1];
+ "SortedBy"=["id"];
+ "SortedByTypes"=[["DataType";"Int32"]];
+ "SortMembers"=["id"];
+ };
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "id";
+ "sort_order" = "ascending";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ {
+ "name" = "k";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "value";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "id";
+ "data_weight" = 44;
+ "num_unique_vals" = 11;
+ };
+ {
+ "column_name" = "k";
+ "data_weight" = 66;
+ "num_unique_vals" = 7;
+ };
+ {
+ "column_name" = "value";
+ "data_weight" = 44;
+ "num_unique_vals" = 6;
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg b/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg
new file mode 100644
index 0000000000..a5101acc8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg
@@ -0,0 +1,5 @@
+providers yt
+in InputA cbo_4tables_a.txt
+in InputB cbo_4tables_b.txt
+in InputC cbo_4tables_c.txt
+in InputD cbo_4tables_d.txt
diff --git a/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.sql b/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.sql
new file mode 100644
index 0000000000..1dce1a70fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cbo_4tables_only_sorted_merge.sql
@@ -0,0 +1,17 @@
+USE plato;
+
+pragma CostBasedOptimizer="native";
+pragma yt.MapJoinLimit="1000";
+pragma yt.LookupJoinLimit="1000";
+pragma yt.LookupJoinMaxRows="100";
+pragma yt.ExtendedStatsMaxChunkCount="0";
+pragma yt.JoinMergeTablesLimit="100";
+pragma yt.JoinMergeForce="true";
+
+SELECT
+ InputA.Key1, InputA.Key2, InputA.Value, InputB.val, InputC.v, InputD.value as vald
+FROM
+ InputA
+ INNER JOIN InputD ON InputA.Key2 = InputD.k
+ INNER JOIN InputB ON InputA.Fk1 = InputB.k
+ INNER JOIN InputC ON InputA.Key1 = InputC.k
diff --git a/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.sql
new file mode 100644
index 0000000000..8d4a07952d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/commonjoin_unused_keys.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+use plato;
+
+select
+
+v3
+
+from Input1 as a
+join Input2 as b on (a.k1 = b.k2)
+join Input3 as c on (a.k1 = c.k3)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/compact_join.cfg b/yql/essentials/tests/sql/suites/join/compact_join.cfg
new file mode 100644
index 0000000000..936236defd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/compact_join.cfg
@@ -0,0 +1,2 @@
+in InputLeft input_left.txt
+in InputRight input_right.txt
diff --git a/yql/essentials/tests/sql/suites/join/compact_join.sql b/yql/essentials/tests/sql/suites/join/compact_join.sql
new file mode 100644
index 0000000000..505bdb34fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/compact_join.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+$stream = SELECT a.k AS k, a.sk AS ask, a.v AS av
+FROM InputLeft AS a
+INNER JOIN /*+ merge() compact() */ InputRight AS b
+USING (k, sk, v);
+
+SELECT k, ask, av
+FROM $stream
+GROUP /*+ compact() */ BY (k, ask, av)
+ORDER BY k, ask, av; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem-off.cfg b/yql/essentials/tests/sql/suites/join/convert_check_key_mem-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem.cfg b/yql/essentials/tests/sql/suites/join/convert_check_key_mem.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem.sql b/yql/essentials/tests/sql/suites/join/convert_check_key_mem.sql
new file mode 100644
index 0000000000..5902507e2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem.sql
@@ -0,0 +1,40 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+
+$a = AsList(
+ AsStruct(255ut AS K, 1 AS V),
+ AsStruct(127ut AS K, 2 AS V),
+ AsStruct(0ut AS K, 3 AS V));
+
+$b = AsList(
+ AsStruct(Int8("-1") AS K, 1u AS V),
+ AsStruct(Int8("127") AS K, 2u AS V),
+ AsStruct(Int8("0") AS K, 3u AS V));
+
+$aopt = AsList(
+ AsStruct(Just(255ut) AS K, 1 AS V),
+ AsStruct(Just(127ut) AS K, 2 AS V),
+ AsStruct(Just(0ut) AS K, 3 AS V),
+ AsStruct(Nothing(ParseType("Uint8?")) AS K, 2 AS V));
+
+$bopt = AsList(
+ AsStruct(Just(Int8("-1")) AS K, 1u AS V),
+ AsStruct(Just(Int8("127")) AS K, 2u AS V),
+ AsStruct(Just(Int8("0")) AS K, 3u AS V),
+ AsStruct(Nothing(ParseType("Int8?")) AS K, 2u AS V));
+
+select a.K, b.V from as_table($a) as a
+ join as_table($b) as b on a.K = b.K and a.V = b.V
+order by a.K, b.V;
+
+select a.K, b.V from as_table($aopt) as a
+ join as_table($b) as b on a.K = b.K and a.V = b.V
+order by a.K, b.V;
+
+select a.K, b.V from as_table($a) as a
+ join as_table($bopt) as b on a.K = b.K and a.V = b.V
+order by a.K, b.V;
+
+select a.K, b.V from as_table($aopt) as a
+ join as_table($bopt) as b on a.K = b.K and a.V = b.V
+order by a.K, b.V;
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem2-off.cfg b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.cfg b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.sql b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.sql
new file mode 100644
index 0000000000..d4afb00ee7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_check_key_mem2.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+
+$a = AsList(
+ AsStruct(255ut AS K, 1 AS V),
+ AsStruct(127ut AS K, 2 AS V),
+ AsStruct(0ut AS K, 3 AS V));
+
+$b = AsList(
+ AsStruct(Int8("-1") AS K, 1 AS V),
+ AsStruct(Int8("127") AS K, 2 AS V),
+ AsStruct(Int8("0") AS K, 3 AS V));
+
+select a.K, b.V from as_table($a) as a
+ join as_table($b) as b on a.K = b.K and a.V = b.V
+order by a.K, b.V;
diff --git a/yql/essentials/tests/sql/suites/join/convert_key-off.cfg b/yql/essentials/tests/sql/suites/join/convert_key-off.cfg
new file mode 100644
index 0000000000..9e8955692d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_key-off.cfg
@@ -0,0 +1,4 @@
+in Input convert_key.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/convert_key.cfg b/yql/essentials/tests/sql/suites/join/convert_key.cfg
new file mode 100644
index 0000000000..dd4bfb988d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_key.cfg
@@ -0,0 +1,2 @@
+in Input convert_key.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/convert_key.sql b/yql/essentials/tests/sql/suites/join/convert_key.sql
new file mode 100644
index 0000000000..0d5ca60885
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_key.sql
@@ -0,0 +1,31 @@
+/* postgres can not */
+USE plato;
+
+PRAGMA SimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+$join_result =
+(
+ SELECT
+ i1.k1 as i1_k1,
+ i1.k2 as i1_k2,
+ i1.value as i1_value,
+ i2.k1 as i2_k1,
+ i2.k2 as i2_k2,
+ i2.value as i2_value
+ FROM
+ Input as i1
+ LEFT JOIN
+ (
+ SELECT
+ i2.value as value,
+ cast(i2.k1 as double) as k1,
+ cast(i2.k2 as double) as k2
+ FROM Input as i2
+ ) as i2
+ ON
+ i1.k1 == i2.k1 AND
+ i1.k2 == i2.k2
+);
+
+SELECT * FROM $join_result;
diff --git a/yql/essentials/tests/sql/suites/join/convert_key.txt b/yql/essentials/tests/sql/suites/join/convert_key.txt
new file mode 100644
index 0000000000..0f8369d4db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_key.txt
@@ -0,0 +1,4 @@
+{"k1"=417840;"k2"=417480;"value"="aaa"};
+{"k1"=417840;"k2"=417480;"value"="ddd"};
+{"k1"=417840;"k2"=417480;"value"="abc"};
+{"k1"=417840;"k2"=417480;"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/join/convert_key.txt.attr b/yql/essentials/tests/sql/suites/join/convert_key.txt.attr
new file mode 100644
index 0000000000..63d2666582
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/convert_key.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k1";["DataType";"Int64"]];
+ ["k2";["DataType";"Int64"]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/count_bans-off.cfg b/yql/essentials/tests/sql/suites/join/count_bans-off.cfg
new file mode 100644
index 0000000000..764ce5fc59
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/count_bans-off.cfg
@@ -0,0 +1,4 @@
+in spider_info spider_info.txt
+udf url_udf
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/count_bans.cfg b/yql/essentials/tests/sql/suites/join/count_bans.cfg
new file mode 100644
index 0000000000..2e4220b630
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/count_bans.cfg
@@ -0,0 +1,2 @@
+in spider_info spider_info.txt
+udf url_udf
diff --git a/yql/essentials/tests/sql/suites/join/count_bans.sql b/yql/essentials/tests/sql/suites/join/count_bans.sql
new file mode 100644
index 0000000000..499db2c7f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/count_bans.sql
@@ -0,0 +1,45 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$records = (
+SELECT
+ key as ip,
+ subkey AS recordType,
+ Url::GetHost(value) AS host
+FROM spider_info
+);
+
+$results = (
+SELECT
+ ip,
+ host,
+ count(*) AS request_count
+FROM $records
+WHERE host IS NOT NULL AND recordType == "RESULT"
+GROUP BY ip, host
+);
+
+$bans = (
+SELECT
+ ip,
+ host,
+ count(*) AS fetcher_count
+FROM $records
+WHERE host IS NOT NULL AND recordType == "BAN_DETECTED"
+GROUP BY ip, host
+);
+
+SELECT
+ results.ip AS ip,
+ results.host AS host,
+ results.request_count AS request_count,
+ bans.fetcher_count AS fetcher_count
+FROM
+ $results AS results
+ INNER JOIN
+ $bans AS bans
+ ON bans.ip == results.ip
+ AND bans.host == results.host
+ORDER BY fetcher_count DESC
+;
diff --git a/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list-off.cfg b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.cfg b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.sql b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.sql
new file mode 100644
index 0000000000..3f10761c07
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/cross_join_with_lazy_list.sql
@@ -0,0 +1,10 @@
+$list = AsList(AsStruct('one' AS x), AsStruct('two' AS x));
+$lazy = ListMap(ListFromRange(1s, 3s), ($i)->{ RETURN AsStruct($i AS y) });
+
+SELECT *
+ FROM AS_TABLE($list) as l
+ CROSS JOIN AS_TABLE($lazy) as r;
+
+SELECT *
+ FROM AS_TABLE($lazy) as l
+ CROSS JOIN AS_TABLE($list) as r;
diff --git a/yql/essentials/tests/sql/suites/join/default.cfg b/yql/essentials/tests/sql/suites/join/default.cfg
new file mode 100644
index 0000000000..429c022594
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/default.cfg
@@ -0,0 +1,6 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+in Input8 input8.txt
diff --git a/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.cfg b/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.cfg
new file mode 100644
index 0000000000..89a1fdcc94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv1_1.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.sql b/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.sql
new file mode 100644
index 0000000000..314c680b69
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/do_not_suppres_equijoin_input_sorts.sql
@@ -0,0 +1,8 @@
+USE plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma DisableSimpleColumns;
+
+select
+ *
+from Input1 as t1 cross join Input2 as t2
+where t1.k1 == t2.k1 and t1.k1 < "zzz";
diff --git a/yql/essentials/tests/sql/suites/join/empty_dynamic.txt b/yql/essentials/tests/sql/suites/join/empty_dynamic.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/empty_dynamic.txt
diff --git a/yql/essentials/tests/sql/suites/join/empty_dynamic.txt.attr b/yql/essentials/tests/sql/suites/join/empty_dynamic.txt.attr
new file mode 100644
index 0000000000..fad9c383f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/empty_dynamic.txt.attr
@@ -0,0 +1,22 @@
+{
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.sql
new file mode 100644
index 0000000000..3e50bfd2df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/emptyjoin_unused_keys.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+use plato;
+
+insert into @Input1
+select '' as k1, '' as v1, '' as u1 limit 0;
+commit;
+
+select
+
+v3
+
+from @Input1 as a
+join Input2 as b on (a.k1 = b.k2)
+right join Input3 as c on (a.k1 = c.k3)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_by_expr-off.cfg b/yql/essentials/tests/sql/suites/join/equi_join_by_expr-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_by_expr-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_by_expr.cfg b/yql/essentials/tests/sql/suites/join/equi_join_by_expr.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_by_expr.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_by_expr.sql b/yql/essentials/tests/sql/suites/join/equi_join_by_expr.sql
new file mode 100644
index 0000000000..d2cad73469
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_by_expr.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT * FROM plato.Input2 as A JOIN plato.Input3 as B ON CAST(A.key AS INT) + 1 == CAST(B.key AS INT);
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk-off.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk-off.cfg
new file mode 100644
index 0000000000..3ff2f86249
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk-off.cfg
@@ -0,0 +1,5 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.cfg
new file mode 100644
index 0000000000..24c926d868
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.cfg
@@ -0,0 +1,3 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.sql b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.sql
new file mode 100644
index 0000000000..9c56228f58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT A.*, C.subkey as goal,B.*
+FROM plato.A
+JOIN plato.B ON A.key == B.key
+JOIN plato.C ON B.subkey == C.subkey
+ORDER BY A.key;
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval-off.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval-off.cfg
new file mode 100644
index 0000000000..3ff2f86249
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval-off.cfg
@@ -0,0 +1,5 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.cfg
new file mode 100644
index 0000000000..24c926d868
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.cfg
@@ -0,0 +1,3 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.sql b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.sql
new file mode 100644
index 0000000000..8ad0ef844c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_asterisk_eval.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT A.*, C.subkey as goal,B.*, A.value || C.value as ac_val_concat
+FROM plato.A
+JOIN plato.B ON A.key == B.key
+JOIN plato.C ON B.subkey == C.subkey
+ORDER BY A.key, goal, ac_val_concat;
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_simple-off.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_simple-off.cfg
new file mode 100644
index 0000000000..3ff2f86249
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_simple-off.cfg
@@ -0,0 +1,5 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_simple.cfg b/yql/essentials/tests/sql/suites/join/equi_join_three_simple.cfg
new file mode 100644
index 0000000000..24c926d868
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_simple.cfg
@@ -0,0 +1,3 @@
+in A input1.txt
+in B input2.txt
+in C input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_three_simple.sql b/yql/essentials/tests/sql/suites/join/equi_join_three_simple.sql
new file mode 100644
index 0000000000..c620849a45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_three_simple.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT * FROM plato.A JOIN plato.B ON A.key == B.key JOIN plato.C ON A.subkey == C.subkey;
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys-off.cfg b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys-off.cfg
new file mode 100644
index 0000000000..c0badaaad9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys-off.cfg
@@ -0,0 +1,4 @@
+in A input1.txt
+in B input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.cfg b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.cfg
new file mode 100644
index 0000000000..661ab46dee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.cfg
@@ -0,0 +1,2 @@
+in A input1.txt
+in B input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.sql b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.sql
new file mode 100644
index 0000000000..1119ca50ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/equi_join_two_mult_keys.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT * FROM plato.A JOIN plato.B ON A.key == B.key AND A.subkey == B.subkey;
diff --git a/yql/essentials/tests/sql/suites/join/filter_joined-off.cfg b/yql/essentials/tests/sql/suites/join/filter_joined-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/filter_joined-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/filter_joined.cfg b/yql/essentials/tests/sql/suites/join/filter_joined.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/filter_joined.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/filter_joined.sql b/yql/essentials/tests/sql/suites/join/filter_joined.sql
new file mode 100644
index 0000000000..2b75c56856
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/filter_joined.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+SELECT b.key
+FROM Input2 as a
+RIGHT JOIN Input3 as b ON a.key == b.key
+WHERE a.key IS NULL
+ORDER BY b.key;
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns1-off.cfg b/yql/essentials/tests/sql/suites/join/flatten_columns1-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns1-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns1.cfg b/yql/essentials/tests/sql/suites/join/flatten_columns1.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns1.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns1.sql b/yql/essentials/tests/sql/suites/join/flatten_columns1.sql
new file mode 100644
index 0000000000..ada242dc80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns1.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+SELECT * FROM (
+SELECT
+ AsStruct(key as key, subkey as subkey),
+ AsStruct("value: " || value as value)
+FROM Input1
+) as a
+FLATTEN COLUMNS
+JOIN Input2
+USING (key)
+ORDER BY Input2.key;
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns2-off.cfg b/yql/essentials/tests/sql/suites/join/flatten_columns2-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns2-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns2.cfg b/yql/essentials/tests/sql/suites/join/flatten_columns2.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns2.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/flatten_columns2.sql b/yql/essentials/tests/sql/suites/join/flatten_columns2.sql
new file mode 100644
index 0000000000..9ae2d879e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/flatten_columns2.sql
@@ -0,0 +1,20 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+SELECT * FROM (
+SELECT
+ AsStruct(key as key, subkey as subkey),
+ AsStruct("value1: " || value as value)
+FROM Input1
+) as a
+FLATTEN COLUMNS
+JOIN (
+SELECT
+ AsStruct(key as key, subkey as subkey),
+ AsStruct("value2: " || value as value)
+FROM Input2
+) as b
+FLATTEN COLUMNS
+USING (key)
+ORDER BY a.key;
diff --git a/yql/essentials/tests/sql/suites/join/force_merge_join.sql b/yql/essentials/tests/sql/suites/join/force_merge_join.sql
new file mode 100644
index 0000000000..80aaedfb0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/force_merge_join.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+PRAGMA yt.JoinMergeForce = "1";
+pragma yt.JoinMergeTablesLimit="10";
+
+SELECT a.key as key1
+ FROM (SELECT * FROM plato.Input1 WHERE subkey != "bar") AS a
+ JOIN (SELECT * FROM plato.Input1 WHERE subkey != "foo") AS b ON a.key = b.key
+WHERE a.key != "1" OR b.key != "2";
diff --git a/yql/essentials/tests/sql/suites/join/from_in_front_join-off.cfg b/yql/essentials/tests/sql/suites/join/from_in_front_join-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/from_in_front_join-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/from_in_front_join.cfg b/yql/essentials/tests/sql/suites/join/from_in_front_join.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/from_in_front_join.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/from_in_front_join.sql b/yql/essentials/tests/sql/suites/join/from_in_front_join.sql
new file mode 100644
index 0000000000..2e1c8489de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/from_in_front_join.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+from plato.Input1 inner join plato.Input3 using (key) select Input1.key, Input1.subkey, Input3.value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_not_null-off.cfg b/yql/essentials/tests/sql/suites/join/full_equal_not_null-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_not_null-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_not_null.cfg b/yql/essentials/tests/sql/suites/join/full_equal_not_null.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_not_null.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_not_null.sql b/yql/essentials/tests/sql/suites/join/full_equal_not_null.sql
new file mode 100644
index 0000000000..39de950979
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_not_null.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select count(*) from (select cast(subkey as int) as v1, subkey from plato.Input1) as a full join (select cast(subkey as int) as v2, subkey from plato.Input1) as b on a.v1 = b.v2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_null-off.cfg b/yql/essentials/tests/sql/suites/join/full_equal_null-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_null-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_null.cfg b/yql/essentials/tests/sql/suites/join/full_equal_null.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_null.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/full_equal_null.sql b/yql/essentials/tests/sql/suites/join/full_equal_null.sql
new file mode 100644
index 0000000000..ed1d8077cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_equal_null.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select count(*) from (select cast(value as int) as v1, subkey from plato.Input1) as a full join (select cast(value as int) as v2, subkey from plato.Input1) as b on a.v1 = b.v2;
diff --git a/yql/essentials/tests/sql/suites/join/full_join-off.cfg b/yql/essentials/tests/sql/suites/join/full_join-off.cfg
new file mode 100644
index 0000000000..483714d007
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_join-off.cfg
@@ -0,0 +1,4 @@
+in test_join_1 test_join_1.txt
+in test_join_2 test_join_2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/full_join.cfg b/yql/essentials/tests/sql/suites/join/full_join.cfg
new file mode 100644
index 0000000000..ec3dcd7a74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_join.cfg
@@ -0,0 +1,2 @@
+in test_join_1 test_join_1.txt
+in test_join_2 test_join_2.txt
diff --git a/yql/essentials/tests/sql/suites/join/full_join.sql b/yql/essentials/tests/sql/suites/join/full_join.sql
new file mode 100644
index 0000000000..4f1e839311
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_join.sql
@@ -0,0 +1,19 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+SELECT
+ a.key AS a_key,
+ b.key AS b_key,
+ a.value AS a_value,
+ b.value AS b_value
+FROM
+ `test_join_1` AS a
+FULL JOIN
+ `test_join_2` AS b
+ON
+ a.key == b.subkey
+ORDER BY
+ b_key, a_key
+LIMIT 25
+;
+
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial-off.cfg b/yql/essentials/tests/sql/suites/join/full_trivial-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial.cfg b/yql/essentials/tests/sql/suites/join/full_trivial.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial.sql b/yql/essentials/tests/sql/suites/join/full_trivial.sql
new file mode 100644
index 0000000000..bb6fa176f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial.sql
@@ -0,0 +1,5 @@
+PRAGMA DisableSimpleColumns;
+select coalesce(Input1.key, "_null") as a, coalesce(Input1.subkey, "_null") as b, coalesce(Input3.value, "_null") as c
+from plato.Input1
+full join plato.Input3 using (key)
+order by a, b, c; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial_udf_call-off.cfg b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call-off.cfg
new file mode 100644
index 0000000000..2c2cb4cb8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call-off.cfg
@@ -0,0 +1,7 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf simple_udf
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.cfg b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.cfg
new file mode 100644
index 0000000000..4d2ebba571
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.cfg
@@ -0,0 +1,5 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.sql b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.sql
new file mode 100644
index 0000000000..d2acbd2b88
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/full_trivial_udf_call.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+select Input1.key, Input1.subkey, SimpleUdf::Concat(coalesce(Input1.value, ""), coalesce(Input3.value, "")) as value
+from plato.Input1
+full join plato.Input3 using (key)
+order by Input1.key, Input1.subkey, value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/gj_countries1.txt b/yql/essentials/tests/sql/suites/join/gj_countries1.txt
new file mode 100644
index 0000000000..b1bea9c8e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/gj_countries1.txt
@@ -0,0 +1,25 @@
+{"country_id"="0"; "country_name"="0"};
+{"country_id"="1"; "country_name"="1"};
+{"country_id"="2"; "country_name"="2"};
+{"country_id"="3"; "country_name"="3"};
+{"country_id"="4"; "country_name"="4"};
+{"country_id"="5"; "country_name"="5"};
+{"country_id"="6"; "country_name"="6"};
+{"country_id"="7"; "country_name"="7"};
+{"country_id"="8"; "country_name"="8"};
+{"country_id"="9"; "country_name"="9"};
+{"country_id"="10"; "country_name"="10"};
+{"country_id"="11"; "country_name"="11"};
+{"country_id"="12"; "country_name"="12"};
+{"country_id"="13"; "country_name"="13"};
+{"country_id"="14"; "country_name"="14"};
+{"country_id"="15"; "country_name"="15"};
+{"country_id"="16"; "country_name"="16"};
+{"country_id"="17"; "country_name"="17"};
+{"country_id"="18"; "country_name"="18"};
+{"country_id"="19"; "country_name"="19"};
+{"country_id"="20"; "country_name"="20"};
+{"country_id"="21"; "country_name"="21"};
+{"country_id"="22"; "country_name"="22"};
+{"country_id"="23"; "country_name"="23"};
+{"country_id"="24"; "country_name"="24"};
diff --git a/yql/essentials/tests/sql/suites/join/gj_countries1.txt.attr b/yql/essentials/tests/sql/suites/join/gj_countries1.txt.attr
new file mode 100644
index 0000000000..f9b5e0e010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/gj_countries1.txt.attr
@@ -0,0 +1,18 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "country_id";
+ "required" = %true;
+ "type" = "string"
+ };
+ {
+ "name" = "country_name";
+ "required" = %true;
+ "type" = "string"
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/gj_customers1.txt b/yql/essentials/tests/sql/suites/join/gj_customers1.txt
new file mode 100644
index 0000000000..95cade958b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/gj_customers1.txt
@@ -0,0 +1,100 @@
+{"customer_id"="0"; "country_id"="0"};
+{"customer_id"="1"; "country_id"="0"};
+{"customer_id"="2"; "country_id"="21"};
+{"customer_id"="3"; "country_id"="24"};
+{"customer_id"="4"; "country_id"="8"};
+{"customer_id"="5"; "country_id"="12"};
+{"customer_id"="6"; "country_id"="0"};
+{"customer_id"="7"; "country_id"="15"};
+{"customer_id"="8"; "country_id"="14"};
+{"customer_id"="9"; "country_id"="5"};
+{"customer_id"="10"; "country_id"="3"};
+{"customer_id"="11"; "country_id"="19"};
+{"customer_id"="12"; "country_id"="12"};
+{"customer_id"="13"; "country_id"="24"};
+{"customer_id"="14"; "country_id"="4"};
+{"customer_id"="15"; "country_id"="11"};
+{"customer_id"="16"; "country_id"="3"};
+{"customer_id"="17"; "country_id"="4"};
+{"customer_id"="18"; "country_id"="5"};
+{"customer_id"="19"; "country_id"="2"};
+{"customer_id"="20"; "country_id"="16"};
+{"customer_id"="21"; "country_id"="2"};
+{"customer_id"="22"; "country_id"="19"};
+{"customer_id"="23"; "country_id"="11"};
+{"customer_id"="24"; "country_id"="8"};
+{"customer_id"="25"; "country_id"="19"};
+{"customer_id"="26"; "country_id"="23"};
+{"customer_id"="27"; "country_id"="10"};
+{"customer_id"="28"; "country_id"="15"};
+{"customer_id"="29"; "country_id"="7"};
+{"customer_id"="30"; "country_id"="18"};
+{"customer_id"="31"; "country_id"="16"};
+{"customer_id"="32"; "country_id"="8"};
+{"customer_id"="33"; "country_id"="14"};
+{"customer_id"="34"; "country_id"="16"};
+{"customer_id"="35"; "country_id"="17"};
+{"customer_id"="36"; "country_id"="2"};
+{"customer_id"="37"; "country_id"="16"};
+{"customer_id"="38"; "country_id"="7"};
+{"customer_id"="39"; "country_id"="16"};
+{"customer_id"="40"; "country_id"="22"};
+{"customer_id"="41"; "country_id"="11"};
+{"customer_id"="42"; "country_id"="11"};
+{"customer_id"="43"; "country_id"="9"};
+{"customer_id"="44"; "country_id"="10"};
+{"customer_id"="45"; "country_id"="16"};
+{"customer_id"="46"; "country_id"="21"};
+{"customer_id"="47"; "country_id"="13"};
+{"customer_id"="48"; "country_id"="20"};
+{"customer_id"="49"; "country_id"="2"};
+{"customer_id"="50"; "country_id"="16"};
+{"customer_id"="51"; "country_id"="12"};
+{"customer_id"="52"; "country_id"="4"};
+{"customer_id"="53"; "country_id"="10"};
+{"customer_id"="54"; "country_id"="23"};
+{"customer_id"="55"; "country_id"="12"};
+{"customer_id"="56"; "country_id"="5"};
+{"customer_id"="57"; "country_id"="22"};
+{"customer_id"="58"; "country_id"="23"};
+{"customer_id"="59"; "country_id"="21"};
+{"customer_id"="60"; "country_id"="4"};
+{"customer_id"="61"; "country_id"="17"};
+{"customer_id"="62"; "country_id"="12"};
+{"customer_id"="63"; "country_id"="13"};
+{"customer_id"="64"; "country_id"="6"};
+{"customer_id"="65"; "country_id"="3"};
+{"customer_id"="66"; "country_id"="5"};
+{"customer_id"="67"; "country_id"="8"};
+{"customer_id"="68"; "country_id"="20"};
+{"customer_id"="69"; "country_id"="12"};
+{"customer_id"="70"; "country_id"="0"};
+{"customer_id"="71"; "country_id"="17"};
+{"customer_id"="72"; "country_id"="23"};
+{"customer_id"="73"; "country_id"="12"};
+{"customer_id"="74"; "country_id"="2"};
+{"customer_id"="75"; "country_id"="9"};
+{"customer_id"="76"; "country_id"="3"};
+{"customer_id"="77"; "country_id"="24"};
+{"customer_id"="78"; "country_id"="23"};
+{"customer_id"="79"; "country_id"="23"};
+{"customer_id"="80"; "country_id"="1"};
+{"customer_id"="81"; "country_id"="14"};
+{"customer_id"="82"; "country_id"="11"};
+{"customer_id"="83"; "country_id"="5"};
+{"customer_id"="84"; "country_id"="0"};
+{"customer_id"="85"; "country_id"="9"};
+{"customer_id"="86"; "country_id"="18"};
+{"customer_id"="87"; "country_id"="5"};
+{"customer_id"="88"; "country_id"="6"};
+{"customer_id"="89"; "country_id"="17"};
+{"customer_id"="90"; "country_id"="1"};
+{"customer_id"="91"; "country_id"="10"};
+{"customer_id"="92"; "country_id"="9"};
+{"customer_id"="93"; "country_id"="14"};
+{"customer_id"="94"; "country_id"="23"};
+{"customer_id"="95"; "country_id"="16"};
+{"customer_id"="96"; "country_id"="18"};
+{"customer_id"="97"; "country_id"="3"};
+{"customer_id"="98"; "country_id"="0"};
+{"customer_id"="99"; "country_id"="13"};
diff --git a/yql/essentials/tests/sql/suites/join/gj_customers1.txt.attr b/yql/essentials/tests/sql/suites/join/gj_customers1.txt.attr
new file mode 100644
index 0000000000..34f229c4fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/gj_customers1.txt.attr
@@ -0,0 +1,18 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "customer_id";
+ "required" = %true;
+ "type" = "string"
+ };
+ {
+ "name" = "country_id";
+ "required" = %true;
+ "type" = "string"
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/grace_join1-grace.cfg b/yql/essentials/tests/sql/suites/join/grace_join1-grace.cfg
new file mode 100644
index 0000000000..11f6f5b18b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join1-grace.cfg
@@ -0,0 +1,4 @@
+in customers1 gj_customers1.txt
+in countries1 gj_countries1.txt
+providers dq
+pragma Dq.HashJoinMode='grace';
diff --git a/yql/essentials/tests/sql/suites/join/grace_join1-map.cfg b/yql/essentials/tests/sql/suites/join/grace_join1-map.cfg
new file mode 100644
index 0000000000..f787c0665b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join1-map.cfg
@@ -0,0 +1,4 @@
+in customers1 gj_customers1.txt
+in countries1 gj_countries1.txt
+providers dq
+pragma Dq.HashJoinMode='map';
diff --git a/yql/essentials/tests/sql/suites/join/grace_join1-off.cfg b/yql/essentials/tests/sql/suites/join/grace_join1-off.cfg
new file mode 100644
index 0000000000..5c48d49545
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join1-off.cfg
@@ -0,0 +1,5 @@
+in customers1 gj_customers1.txt
+in countries1 gj_countries1.txt
+providers dq
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/grace_join1.cfg b/yql/essentials/tests/sql/suites/join/grace_join1.cfg
new file mode 100644
index 0000000000..a64c260418
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join1.cfg
@@ -0,0 +1,3 @@
+in customers1 gj_customers1.txt
+in countries1 gj_countries1.txt
+providers dq
diff --git a/yql/essentials/tests/sql/suites/join/grace_join1.sql b/yql/essentials/tests/sql/suites/join/grace_join1.sql
new file mode 100644
index 0000000000..42d4fdf492
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join1.sql
@@ -0,0 +1,11 @@
+USE plato;
+pragma DisableSimpleColumns;
+
+select
+cust.customer_id, cntr.country_name
+from
+plato.countries1 as cntr
+join
+plato.customers1 as cust
+on cntr.country_id = cust.country_id
+where cntr.country_id = "11";
diff --git a/yql/essentials/tests/sql/suites/join/grace_join2.cfg b/yql/essentials/tests/sql/suites/join/grace_join2.cfg
new file mode 100644
index 0000000000..7fa7de708f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join2.cfg
@@ -0,0 +1,3 @@
+in customers1 gj_customers1.txt
+providers dq
+pragma Dq.HashJoinMode='graceandself';
diff --git a/yql/essentials/tests/sql/suites/join/grace_join2.sql b/yql/essentials/tests/sql/suites/join/grace_join2.sql
new file mode 100644
index 0000000000..1b10d992e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/grace_join2.sql
@@ -0,0 +1,10 @@
+USE plato;
+pragma DisableSimpleColumns;
+
+select
+c1.customer_id, c2.customer_id
+from
+plato.customers1 as c1
+join
+plato.customers1 as c2
+on c1.country_id = c2.country_id order by c1.customer_id, c2.customer_id;
diff --git a/yql/essentials/tests/sql/suites/join/group_compact_by.cfg b/yql/essentials/tests/sql/suites/join/group_compact_by.cfg
new file mode 100644
index 0000000000..7697efeaa2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/group_compact_by.cfg
@@ -0,0 +1 @@
+in Input input8.txt
diff --git a/yql/essentials/tests/sql/suites/join/group_compact_by.sql b/yql/essentials/tests/sql/suites/join/group_compact_by.sql
new file mode 100644
index 0000000000..d5f33612df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/group_compact_by.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+PRAGMA yt.JoinMergeForce = "1";
+pragma yt.JoinMergeTablesLimit="10";
+
+SELECT key1, subkey1
+FROM
+ (
+ SELECT a.key as key1, a.subkey as subkey1
+ FROM (SELECT * FROM Input WHERE subkey != "bar") AS a
+ JOIN (SELECT * FROM Input WHERE subkey != "foo") AS b
+ ON a.key = b.key AND a.subkey = b.subkey
+ )
+GROUP COMPACT BY key1, subkey1;
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs-off.cfg b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.cfg b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.sql b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.sql
new file mode 100644
index 0000000000..ec4ad06056
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_structs.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+$l = [
+ <|Key:<|a:1, b:2, c:null|>, Lhs:"1,2,#"|>,
+ <|Key:<|a:2, b:3, c:null|>, Lhs:"4,5,#"|>,
+];
+
+$r = [
+ <|Key:<|a:1, b:2, c:3|>, Rhs:"1,2,3"|>,
+ <|Key:<|a:4, b:5, c:6|>, Rhs:"4,5,6"|>,
+];
+
+select Lhs, Rhs from AS_TABLE($l) as l left join AS_TABLE($r) as r using(Key);
+select Lhs from AS_TABLE($l) as l left semi join AS_TABLE($r) as r using(Key);
+select Lhs from AS_TABLE($l) as l left only join AS_TABLE($r) as r using(Key);
+
+select Rhs, Lhs from AS_TABLE($l) as l right join AS_TABLE($r) as r using(Key);
+select Rhs from AS_TABLE($l) as l right semi join AS_TABLE($r) as r using(Key);
+select Rhs from AS_TABLE($l) as l right only join AS_TABLE($r) as r using(Key);
+
+select Lhs, Rhs from AS_TABLE($l) as l inner join AS_TABLE($r) as r using(Key);
+select Lhs, Rhs from AS_TABLE($l) as l full join AS_TABLE($r) as r using(Key);
+select Lhs, Rhs from AS_TABLE($l) as l exclusion join AS_TABLE($r) as r using(Key);
+
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples-off.cfg b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.cfg b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.sql b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.sql
new file mode 100644
index 0000000000..18a95e6c49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_by_uncomparable_tuples.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+$l = AsList(
+ AsStruct(AsTuple(1,2,3) as Key, "1,2,3" as Lhs),
+ AsStruct(AsTuple(1,2,4) as Key, "1,2,4" as Lhs)
+);
+
+$r = AsList(
+ AsStruct(AsTuple(1,2) as Key, "1,2" as Rhs),
+ AsStruct(AsTuple(2,3) as Key, "2,3" as Rhs)
+);
+
+select Lhs, Rhs from AS_TABLE($l) as l left join AS_TABLE($r) as r using(Key);
+select Lhs from AS_TABLE($l) as l left semi join AS_TABLE($r) as r using(Key);
+select Lhs from AS_TABLE($l) as l left only join AS_TABLE($r) as r using(Key);
+
+select Rhs, Lhs from AS_TABLE($l) as l right join AS_TABLE($r) as r using(Key);
+select Rhs from AS_TABLE($l) as l right semi join AS_TABLE($r) as r using(Key);
+select Rhs from AS_TABLE($l) as l right only join AS_TABLE($r) as r using(Key);
+
+select Lhs, Rhs from AS_TABLE($l) as l inner join AS_TABLE($r) as r using(Key);
+select Lhs, Rhs from AS_TABLE($l) as l full join AS_TABLE($r) as r using(Key);
+select Lhs, Rhs from AS_TABLE($l) as l exclusion join AS_TABLE($r) as r using(Key);
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_null_key-off.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_null_key-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_null_key-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_null_key.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_null_key.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_null_key.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_null_key.sql b/yql/essentials/tests/sql/suites/join/inmem_with_null_key.sql
new file mode 100644
index 0000000000..2e19fd2d6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_null_key.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+
+$a = (select null as a, 1 as b);
+$b = (select null as a, 1 as b);
+
+select a.*
+from $a as a
+left only join $b as b
+using(a);
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key-off.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_set_key-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_set_key.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key.sql b/yql/essentials/tests/sql/suites/join/inmem_with_set_key.sql
new file mode 100644
index 0000000000..8ac235b3df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+
+$one = [<|'a':{"1"}, 'b':2|>, <|'a':{"2"}, 'b':3|>, <|'a':{"3"}, 'b':4|>, <|'a':{"1"}, 'b':8|>];
+$two = [<|'c':{Just("1")}, 'd':2|>, <|'c':{}, 'd':3|>, <|'c':null, 'd':4|>, <|'c':{Just("1")}, 'd':9|>];
+$foo = [<|'e':{"1"u}, 'f':-2|>, <|'e':{"1"u,"2"u}, 'f':-3|>, <|'e':null, 'f':-4|>, <|'e':{"1"u}, 'f':-9|>];
+$bar = [<|'g':{Just("1"u)}, 'h':1.|>, <|'g':{}, 'h':2.2|>, <|'g':{Just("1"u),Just("2"u)}, 'h':3.3|>, <|'g':{Just("1"u)}, 'h':4.4|>];
+
+SELECT
+ListSort(DictItems(bar.g)) as bar_g, bar.h,
+ListSort(DictItems(foo.e)) as foo_e, foo.f,
+ListSort(DictItems(one.a)) as one_a, one.b,
+ListSort(DictItems(two.c)) as two_c, two.d
+FROM AS_TABLE($one) AS one
+INNER JOIN AS_TABLE($two) AS two
+ON one.a == two.c
+LEFT JOIN AS_TABLE($foo) AS foo
+ON foo.e == two.c
+FULL JOIN AS_TABLE($bar) AS bar
+ON bar.g == one.a
+ORDER BY bar_g, bar.h, foo_e, foo.f, one_a, one.b, two_c, two.d
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any-off.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.cfg b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.sql b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.sql
new file mode 100644
index 0000000000..fc7d7be5c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inmem_with_set_key_any.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+
+$one = [<|'a':{"1"}, 'b':2|>, <|'a':{"2"}, 'b':3|>, <|'a':{"3"}, 'b':4|>, <|'a':{"1"}, 'b':8|>];
+$two = [<|'c':{Just("1")}, 'd':2|>, <|'c':{}, 'd':3|>, <|'c':null, 'd':4|>, <|'c':{Just("1")}, 'd':9|>];
+$foo = [<|'e':{"1"u}, 'f':-2|>, <|'e':{"1"u,"2"u}, 'f':-3|>, <|'e':null, 'f':-4|>, <|'e':{"1"u}, 'f':-9|>];
+$bar = [<|'g':{Just("1"u)}, 'h':1.|>, <|'g':{}, 'h':2.2|>, <|'g':{Just("1"u),Just("2"u)}, 'h':3.3|>, <|'g':{Just("1"u)}, 'h':4.4|>];
+
+SELECT
+ListSort(DictItems(bar.g)) as bar_g, bar.h,
+ListSort(DictItems(foo.e)) as foo_e, foo.f,
+ListSort(DictItems(one.a)) as one_a, one.b,
+ListSort(DictItems(two.c)) as two_c, two.d
+FROM ANY AS_TABLE($one) AS one
+INNER JOIN ANY AS_TABLE($two) AS two
+ON one.a == two.c
+LEFT JOIN ANY AS_TABLE($foo) AS foo
+ON foo.e == two.c
+FULL JOIN ANY AS_TABLE($bar) AS bar
+ON bar.g == one.a
+ORDER BY bar_g, bar.h, foo_e, foo.f, one_a, one.b, two_c, two.d
diff --git a/yql/essentials/tests/sql/suites/join/inner_all-off.cfg b/yql/essentials/tests/sql/suites/join/inner_all-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_all.cfg b/yql/essentials/tests/sql/suites/join/inner_all.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_all.sql b/yql/essentials/tests/sql/suites/join/inner_all.sql
new file mode 100644
index 0000000000..22803ca6b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+SELECT *
+FROM Input2 AS a
+JOIN Input3 AS b
+ON a.value == b.value;
diff --git a/yql/essentials/tests/sql/suites/join/inner_all_right-off.cfg b/yql/essentials/tests/sql/suites/join/inner_all_right-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all_right-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_all_right.cfg b/yql/essentials/tests/sql/suites/join/inner_all_right.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all_right.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_all_right.sql b/yql/essentials/tests/sql/suites/join/inner_all_right.sql
new file mode 100644
index 0000000000..ec84b11ad4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_all_right.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+SELECT b.*
+FROM Input2 AS a
+JOIN Input3 AS b
+ON a.value == b.value;
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped-off.cfg b/yql/essentials/tests/sql/suites/join/inner_grouped-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped.cfg b/yql/essentials/tests/sql/suites/join/inner_grouped.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped.sql b/yql/essentials/tests/sql/suites/join/inner_grouped.sql
new file mode 100644
index 0000000000..14d580b119
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key as key, max(Input3.value) as value from plato.Input1 inner join plato.Input3 using (key) group by Input1.key order by key;
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr-off.cfg b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.cfg b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.sql b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.sql
new file mode 100644
index 0000000000..97f05fef2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_grouped_by_expr.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+select keyz, max(Input3.value) as value from plato.Input1 inner join plato.Input3 using (key) group by Input1.key as keyz order by keyz;
diff --git a/yql/essentials/tests/sql/suites/join/inner_on_key_only-off.cfg b/yql/essentials/tests/sql/suites/join/inner_on_key_only-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_on_key_only-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_on_key_only.cfg b/yql/essentials/tests/sql/suites/join/inner_on_key_only.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_on_key_only.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_on_key_only.sql b/yql/essentials/tests/sql/suites/join/inner_on_key_only.sql
new file mode 100644
index 0000000000..e2d7e57d63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_on_key_only.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key, Input1.subkey, Input3.value from plato.Input1 inner join plato.Input3 on Input1.key = Input3.key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/inner_table_and_view.cfg b/yql/essentials/tests/sql/suites/join/inner_table_and_view.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_table_and_view.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial-off.cfg b/yql/essentials/tests/sql/suites/join/inner_trivial-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial.cfg b/yql/essentials/tests/sql/suites/join/inner_trivial.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial.sql b/yql/essentials/tests/sql/suites/join/inner_trivial.sql
new file mode 100644
index 0000000000..19db34045c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key, Input1.subkey, Input3.value from plato.Input1 inner join plato.Input3 using (key); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat-off.cfg b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.cfg b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.sql b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.sql
new file mode 100644
index 0000000000..aa317b9784
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_trivial_from_concat.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+select A.key, A.subkey, B.value from plato.concat(Input1, Input2) as A inner join plato.Input3 as B using (key); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_order-off.cfg b/yql/essentials/tests/sql/suites/join/inner_with_order-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_order-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_order.cfg b/yql/essentials/tests/sql/suites/join/inner_with_order.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_order.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_order.sql b/yql/essentials/tests/sql/suites/join/inner_with_order.sql
new file mode 100644
index 0000000000..471fb485ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_order.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key as key, Input1.subkey, Input3.value from plato.Input1 inner join plato.Input3 using (key) order by key desc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_select-off.cfg b/yql/essentials/tests/sql/suites/join/inner_with_select-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_select-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_select.cfg b/yql/essentials/tests/sql/suites/join/inner_with_select.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_select.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/inner_with_select.sql b/yql/essentials/tests/sql/suites/join/inner_with_select.sql
new file mode 100644
index 0000000000..b1e0c35edd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/inner_with_select.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+select
+ Input1.key as key,
+ Input1.subkey as subkey,
+ selected.value as value
+from plato.Input1
+inner join (select key, value || value as value from plato.Input3) as selected
+ using (key)
+order by key desc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/input.txt b/yql/essentials/tests/sql/suites/join/input.txt
new file mode 100644
index 0000000000..96d1fdd0ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input.txt
@@ -0,0 +1,3 @@
+{"key"="foo";"subkey"="bar";"value"="wat"};
+{"key"="bar";"subkey"="wat";"value"="wtf"};
+{"key"="wtf";"subkey"="foo";"value"="bar"};
diff --git a/yql/essentials/tests/sql/suites/join/input1.txt b/yql/essentials/tests/sql/suites/join/input1.txt
new file mode 100644
index 0000000000..f53757c309
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="1";"value"="ddd"};
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="150";"subkey"="1";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/join/input2.txt b/yql/essentials/tests/sql/suites/join/input2.txt
new file mode 100644
index 0000000000..07af3b4647
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="2";"value"="q"};
+{"key"="150";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/join/input3.txt b/yql/essentials/tests/sql/suites/join/input3.txt
new file mode 100644
index 0000000000..1dc1bcc60b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="3";"value"="ddd"};
+{"key"="021";"subkey"="3";"value"="q"};
+{"key"="151";"subkey"="3";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/join/input4.txt b/yql/essentials/tests/sql/suites/join/input4.txt
new file mode 100644
index 0000000000..a3185b8d9a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input4.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="3";"value"="abd"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="021";"subkey"="2";"value"="q"};
+{"key"="151";"subkey"="2";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/join/input5.txt b/yql/essentials/tests/sql/suites/join/input5.txt
new file mode 100644
index 0000000000..e5f4a7ae33
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input5.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="a";"value"="value1_1"};
+{"key"="INVALID";"subkey"="b";"value"="value1_2"};
+{"key"="3";"subkey"="c";"value"="value1_3"};
+{"key"="4";"subkey"="d";"value"="value1_4"};
diff --git a/yql/essentials/tests/sql/suites/join/input6.txt b/yql/essentials/tests/sql/suites/join/input6.txt
new file mode 100644
index 0000000000..ae3f3dd0d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input6.txt
@@ -0,0 +1,4 @@
+{"key1"="1";"subkey1"="a";"key"="1";"subkey"="a";"value"="value1_1"};
+{"key1"="INVALID";"subkey1"="b";"key"="INVALID";"subkey"="b";"value"="value1_2"};
+{"key1"="3";"subkey1"="c";"key"="3";"subkey"="c";"value"="value1_3"};
+{"key1"="4";"subkey1"="d";"key"="4";"subkey"="d";"value"="value1_4"};
diff --git a/yql/essentials/tests/sql/suites/join/input6.txt.attr b/yql/essentials/tests/sql/suites/join/input6.txt.attr
new file mode 100644
index 0000000000..ad1624a955
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input6.txt.attr
@@ -0,0 +1,9 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key1";["DataType";"Utf8"]];
+ ["subkey1";["DataType";"Utf8"]];
+ ["key";["DataType";"Utf8"]];
+ ["subkey";["DataType";"Utf8"]];
+ ["value";["DataType";"Utf8"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/input7.txt b/yql/essentials/tests/sql/suites/join/input7.txt
new file mode 100644
index 0000000000..5a8860b91d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input7.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="2";"value"="abcaaa"};
+{"key"="800";"subkey"="2";"value"="dddaaa"};
+{"key"="020";"subkey"="2";"value"="qaaa"};
+{"key"="150";"subkey"="2";"value"="qzzaaa"};
diff --git a/yql/essentials/tests/sql/suites/join/input8.txt b/yql/essentials/tests/sql/suites/join/input8.txt
new file mode 100644
index 0000000000..2417d71bb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input8.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="150";"subkey"="3";"value"="qzz"};
+{"key"="800";"subkey"="4";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/join/input8.txt.attr b/yql/essentials/tests/sql/suites/join/input8.txt.attr
new file mode 100644
index 0000000000..7ec3f318dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input8.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]]
+ ];
+ "SortDirections"=[1;1];
+ "SortedBy"=["key";"subkey"];
+ "SortedByTypes"=[["DataType";"String"];["DataType";"String"]];
+ "SortMembers"=["key";"subkey"];
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/input9.txt b/yql/essentials/tests/sql/suites/join/input9.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input9.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/join/input9.txt.attr b/yql/essentials/tests/sql/suites/join/input9.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input9.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/input_intersect.txt b/yql/essentials/tests/sql/suites/join/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/join/input_left.txt b/yql/essentials/tests/sql/suites/join/input_left.txt
new file mode 100644
index 0000000000..ac67f72937
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_left.txt
@@ -0,0 +1,4 @@
+{k=1u;sk="100";v="abc"};
+{k=2u;sk="200";v="def"};
+{k=3u;sk="300";v="ghi"};
+{k=5u;sk="500";v="mno"};
diff --git a/yql/essentials/tests/sql/suites/join/input_left.txt.attr b/yql/essentials/tests/sql/suites/join/input_left.txt.attr
new file mode 100644
index 0000000000..58ca2c84ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_left.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k";["DataType";"Uint64"]];
+ ["sk";["DataType";"Utf8"]];
+ ["v";["DataType";"Utf8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/input_right.txt b/yql/essentials/tests/sql/suites/join/input_right.txt
new file mode 100644
index 0000000000..7a094e2b95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_right.txt
@@ -0,0 +1,4 @@
+{k=1u;sk="100";v="ABC"};
+{k=3u;sk="300";v="GHI"};
+{k=4u;sk="400";v="JKL"};
+{k=5u;sk="500";v="MNO"};
diff --git a/yql/essentials/tests/sql/suites/join/input_right.txt.attr b/yql/essentials/tests/sql/suites/join/input_right.txt.attr
new file mode 100644
index 0000000000..58ca2c84ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_right.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["k";["DataType";"Uint64"]];
+ ["sk";["DataType";"Utf8"]];
+ ["v";["DataType";"Utf8"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/input_tutorial_users.txt b/yql/essentials/tests/sql/suites/join/input_tutorial_users.txt
new file mode 100644
index 0000000000..4a18a0dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/input_tutorial_users.txt
@@ -0,0 +1,12 @@
+{"key"="15";"subkey"="213";"value"="Anya"};
+{"key"="25";"subkey"="225";"value"="Petr"};
+{"key"="17";"subkey"="1";"value"="Masha"};
+{"key"="5";"subkey"="225";"value"="Alena"};
+{"key"="23";"subkey"="2";"value"="Irina"};
+{"key"="13";"subkey"="21";"value"="Inna"};
+{"key"="33";"subkey"="125";"value"="Ivan"};
+{"key"="45";"subkey"="225";"value"="Asya"};
+{"key"="27";"subkey"="125";"value"="German"};
+{"key"="41";"subkey"="225";"value"="Olya"};
+{"key"="35";"subkey"="2";"value"="Slava"};
+{"key"="56";"subkey"="2";"value"="Elena"};
diff --git a/yql/essentials/tests/sql/suites/join/join_and_distinct_key-off.cfg b/yql/essentials/tests/sql/suites/join/join_and_distinct_key-off.cfg
new file mode 100644
index 0000000000..76a2a2b6a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_and_distinct_key-off.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_and_distinct_key.cfg b/yql/essentials/tests/sql/suites/join/join_and_distinct_key.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_and_distinct_key.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_and_distinct_key.sql b/yql/essentials/tests/sql/suites/join/join_and_distinct_key.sql
new file mode 100644
index 0000000000..08037b8f7d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_and_distinct_key.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT
+ count(i1.key) as count,
+ count(distinct i1.key) as uniq_count
+FROM plato.Input as i1 JOIN plato.Input AS i2 on cast(i1.key as uint32) / 100 == cast(i2.subkey as uint32) / 100
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_and_distinct_key_without_correlation.sqlx b/yql/essentials/tests/sql/suites/join/join_and_distinct_key_without_correlation.sqlx
new file mode 100644
index 0000000000..1a8713cd30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_and_distinct_key_without_correlation.sqlx
@@ -0,0 +1,6 @@
+use plato;
+
+SELECT
+ count(distinct key) as uniq_count -- distinct qualifier required correlation name
+FROM Input as i1 JOIN Input AS i2 on cast(i1.key as uint32) / 100 == cast(i2.subkey as uint32) / 100
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.cfg b/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.cfg
new file mode 100644
index 0000000000..6978b80cd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.cfg
@@ -0,0 +1,4 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.sql b/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.sql
new file mode 100644
index 0000000000..12d53dd38f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_cbo_3_tables.sql
@@ -0,0 +1,10 @@
+use plato;
+
+pragma CostBasedOptimizer="pg";
+
+select i1.value, i2.value, i3.value, i4.value
+from Input1 as i1
+join Input2 as i2 on i1.key=i2.key
+join Input3 as i3 on i1.key=i3.key
+join Input4 as i4 on i1.key=i4.key
+order by i1.value, i2.value, i3.value, i4.value;
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_common_table-off.cfg b/yql/essentials/tests/sql/suites/join/join_comp_common_table-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_common_table-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_common_table.cfg b/yql/essentials/tests/sql/suites/join/join_comp_common_table.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_common_table.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_common_table.sql b/yql/essentials/tests/sql/suites/join/join_comp_common_table.sql
new file mode 100644
index 0000000000..770d18ecd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_common_table.sql
@@ -0,0 +1,15 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+use plato;
+
+$i = (select AsList(key) as x from Input);
+$j = (select Just(AsList(key)) as y from Input);
+select a.x as zzz,b.y as fff from $i as a inner join $j as b on a.x = b.y order by zzz,fff;
+select a.x as zzz,b.y as fff from $i as a right join $j as b on a.x = b.y order by zzz,fff;
+select a.x as zzz,b.y as fff from $i as a left join $j as b on a.x = b.y order by zzz,fff;
+select a.x as zzz from $i as a left semi join $j as b on a.x = b.y order by zzz;
+select a.x as zzz from $i as a left only join $j as b on a.x = b.y order by zzz;
+select b.y as fff from $i as a right semi join $j as b on a.x = b.y order by fff;
+select b.y as fff from $i as a right only join $j as b on a.x = b.y order by fff;
+select a.x as zzz,b.y as fff from $i as a full join $j as b on a.x = b.y order by zzz,fff;
+select a.x as zzz,b.y as fff from $i as a exclusion join $j as b on a.x = b.y order by zzz,fff;
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_inmem-off.cfg b/yql/essentials/tests/sql/suites/join/join_comp_inmem-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_inmem-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_inmem.cfg b/yql/essentials/tests/sql/suites/join/join_comp_inmem.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_inmem.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_inmem.sql b/yql/essentials/tests/sql/suites/join/join_comp_inmem.sql
new file mode 100644
index 0000000000..6c0c174d7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_inmem.sql
@@ -0,0 +1,13 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+$i = (select AsList("foo") as x);
+$j = (select Just(AsList("foo")) as y);
+select a.x as zzz,b.y as fff from $i as a inner join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a right join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a left join $j as b on a.x = b.y;
+select a.x as zzz from $i as a left semi join $j as b on a.x = b.y;
+select a.x as zzz from $i as a left only join $j as b on a.x = b.y;
+select b.y as fff from $i as a right semi join $j as b on a.x = b.y;
+select b.y as fff from $i as a right only join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a full join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a exclusion join $j as b on a.x = b.y;
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_map_table-off.cfg b/yql/essentials/tests/sql/suites/join/join_comp_map_table-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_map_table-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_map_table.cfg b/yql/essentials/tests/sql/suites/join/join_comp_map_table.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_map_table.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_comp_map_table.sql b/yql/essentials/tests/sql/suites/join/join_comp_map_table.sql
new file mode 100644
index 0000000000..4f64d5e685
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_comp_map_table.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+pragma yt.MapJoinLimit="1m";
+use plato;
+
+$i = (select AsList(key) as x from Input);
+$j = (select Just(AsList(key)) as y from Input);
+select a.x as zzz,b.y as fff from $i as a inner join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a right join $j as b on a.x = b.y;
+select a.x as zzz,b.y as fff from $i as a left join $j as b on a.x = b.y;
+select a.x as zzz from $i as a left semi join $j as b on a.x = b.y;
+select a.x as zzz from $i as a left only join $j as b on a.x = b.y;
+select b.y as fff from $i as a right semi join $j as b on a.x = b.y;
+select b.y as fff from $i as a right only join $j as b on a.x = b.y;
diff --git a/yql/essentials/tests/sql/suites/join/join_key_cmp_udf-off.cfg b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf-off.cfg
new file mode 100644
index 0000000000..3892ddff67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf-off.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+udf string_udf
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.cfg b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.cfg
new file mode 100644
index 0000000000..c6596e362c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.sql b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.sql
new file mode 100644
index 0000000000..70a160e96d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_key_cmp_udf.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ ib.*
+FROM Input as ia
+JOIN Input as ib
+ON Unicode::ToUpper(CAST(ia.key AS Utf8)) == ib.subkey
+ORDER BY ib.key, ib.subkey
diff --git a/yql/essentials/tests/sql/suites/join/join_left_cbo.cfg b/yql/essentials/tests/sql/suites/join/join_left_cbo.cfg
new file mode 100644
index 0000000000..559fde513f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_left_cbo.cfg
@@ -0,0 +1,2 @@
+in Input1 input1.txt
+in Input2 input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_left_cbo.sql b/yql/essentials/tests/sql/suites/join/join_left_cbo.sql
new file mode 100644
index 0000000000..81b974bdce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_left_cbo.sql
@@ -0,0 +1,8 @@
+use plato;
+
+pragma CostBasedOptimizer="PG";
+
+select i1.value, i2.value
+from Input1 as i1
+left join Input2 as i2 on i1.key=i2.key
+order by i1.value, i2.value;
diff --git a/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by-off.cfg b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.cfg b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.sql b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.sql
new file mode 100644
index 0000000000..1f3f1f4d95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_no_correlation_in_order_by.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 > 3);
+
+--INSERT INTO Output
+SELECT
+ *
+FROM Input JOIN $data as d ON Input.subkey = d.kk
+ORDER BY key, val
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_right_cbo.cfg b/yql/essentials/tests/sql/suites/join/join_right_cbo.cfg
new file mode 100644
index 0000000000..559fde513f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_right_cbo.cfg
@@ -0,0 +1,2 @@
+in Input1 input1.txt
+in Input2 input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_right_cbo.sql b/yql/essentials/tests/sql/suites/join/join_right_cbo.sql
new file mode 100644
index 0000000000..7b9378a9ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_right_cbo.sql
@@ -0,0 +1,8 @@
+use plato;
+
+pragma CostBasedOptimizer="PG";
+
+select i1.value, i2.value
+from Input1 as i1
+right join Input2 as i2 on i1.key=i2.key
+order by i1.value, i2.value;
diff --git a/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by-off.cfg b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.cfg b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.sql b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.sql
new file mode 100644
index 0000000000..4065705a77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_semi_correlation_in_order_by.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 > 3);
+
+--INSERT INTO Output
+SELECT
+ *
+FROM Input JOIN $data as d ON Input.subkey = d.kk
+ORDER BY key, d.val
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_table_conflict_fail-off.cfg b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail-off.cfg
new file mode 100644
index 0000000000..4408d29e54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail-off.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input.txtproviders dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.cfg b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.cfg
new file mode 100644
index 0000000000..9217c920f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.sql b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.sql
new file mode 100644
index 0000000000..e499d334b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_table_conflict_fail.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value || value as value FROM Input WHERE cast(key as uint32)/100 > 3);
+
+--INSERT INTO Output
+SELECT
+ value, key -- value is conflicted between Input and d sources
+FROM Input JOIN $data as d ON Input.subkey = d.kk
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.cfg b/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.cfg
new file mode 100644
index 0000000000..702bbb5a52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input.with.dot input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.sqlx b/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.sqlx
new file mode 100644
index 0000000000..01b6c5374a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_with_dot_without_alias.sqlx
@@ -0,0 +1,6 @@
+USE plato;
+SELECT
+ t.key, t.value
+FROM Input as t
+LEFT SEMI JOIN `Input.with.dot`
+USING(subkey);
diff --git a/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted-off.cfg b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted-off.cfg
new file mode 100644
index 0000000000..49af2b95f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted-off.cfg
@@ -0,0 +1,4 @@
+in SortedByKey sorted_by_key1.txt
+in SortedByKeySubkey sorted_by_key_subkey.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.cfg b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.cfg
new file mode 100644
index 0000000000..464068db6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.cfg
@@ -0,0 +1,2 @@
+in SortedByKey sorted_by_key1.txt
+in SortedByKeySubkey sorted_by_key_subkey.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.sql b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.sql
new file mode 100644
index 0000000000..9b350d29a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_with_duplicate_keys_on_sorted.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+
+FROM SortedByKeySubkey AS a JOIN SortedByKey AS b ON a.key=b.key AND a.subkey=b.key
+SELECT * ORDER BY a.value, b.value;
diff --git a/yql/essentials/tests/sql/suites/join/join_without_column-off.cfg b/yql/essentials/tests/sql/suites/join/join_without_column-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_column-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_without_column.cfg b/yql/essentials/tests/sql/suites/join/join_without_column.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_column.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_without_column.sql b/yql/essentials/tests/sql/suites/join/join_without_column.sql
new file mode 100644
index 0000000000..4c9c4bd612
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_column.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ *
+WITHOUT
+ d.value
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access-off.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access-off.cfg
new file mode 100644
index 0000000000..76a2a2b6a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access-off.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.sql b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.sql
new file mode 100644
index 0000000000..280a971538
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_dict_access.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+use plato;
+
+$data_dict = (select
+ mod,
+ YQL::ToIndexDict(ListSort(aggregate_list(key))) as dk,
+ ListSort(aggregate_list(subkey)) as ls,
+ ListSort(aggregate_list(value)) as lv
+from Input
+group by cast(key as uint32) % 10 as mod);
+
+--INSERT INTO Output
+SELECT
+--DISTINCT
+ dk[2],
+ key,
+ value
+FROM Input JOIN $data_dict AS d on cast(Input.key as uint32) / 100 == d.mod
+order by key, value
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access-off.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access-off.cfg
new file mode 100644
index 0000000000..76a2a2b6a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access-off.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.sql b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.sql
new file mode 100644
index 0000000000..d1934f0bfc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_and_struct_access.sql
@@ -0,0 +1,18 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+use plato;
+
+$data = ( select
+ cast(key as uint32) % 10 as mod,
+ (key as kk, subkey as sk) as struct_field
+from Input);
+
+--INSERT INTO Output
+SELECT
+ mod,
+ struct_field.kk as mod_key,
+ key,
+ value
+FROM Input JOIN $data AS d on cast(Input.key as uint32) / 100 == d.mod
+order by key, mod_key, value
+;
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_names-off.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_names-off.cfg
new file mode 100644
index 0000000000..76a2a2b6a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_names-off.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_names.cfg b/yql/essentials/tests/sql/suites/join/join_without_correlation_names.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_names.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/join/join_without_correlation_names.sql b/yql/essentials/tests/sql/suites/join/join_without_correlation_names.sql
new file mode 100644
index 0000000000..98922c13e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/join_without_correlation_names.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 > 3);
+
+--INSERT INTO Output
+SELECT
+ value, val, key, sk
+FROM Input JOIN $data as d ON Input.subkey = d.kk
+ORDER BY value, val;
diff --git a/yql/essentials/tests/sql/suites/join/kv1_sorted.txt b/yql/essentials/tests/sql/suites/join/kv1_sorted.txt
new file mode 100644
index 0000000000..32006a80c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv1_sorted.txt
@@ -0,0 +1,32 @@
+{"k1"="01";"v1"="1";"u1"="01"};
+{"k1"="01";"v1"="2";"u1"="02"};
+
+{"k1"="02";"v1"="1";"u1"="03"};
+{"k1"="02";"v1"="1";"u1"="04"};
+{"k1"="02";"v1"="2";"u1"="05"};
+{"k1"="02";"v1"="2";"u1"="06"};
+
+{"k1"="03";"v1"=#; "u1"="07"};
+{"k1"="03";"v1"="1";"u1"="08"};
+{"k1"="03";"v1"="2";"u1"="09"};
+
+{"k1"="04";"v1"="1";"u1"="10"};
+{"k1"="04";"v1"="2";"u1"="11"};
+
+{"k1"="05";"v1"="1";"u1"="12"};
+{"k1"="05";"v1"="2";"u1"="13"};
+
+{"k1"="06";"v1"="1";"u1"="14"};
+{"k1"="06";"v1"="2";"u1"="15"};
+
+{"k1"="07";"v1"="1";"u1"="16"};
+{"k1"="07";"v1"="2";"u1"="17"};
+
+{"k1"="08";"v1"="1";"u1"="18"};
+{"k1"="08";"v1"="2";"u1"="19"};
+
+{"k1"="09";"v1"="1";"u1"="20"};
+{"k1"="09";"v1"="2";"u1"="21"};
+
+{"k1"="10";"v1"="1";"u1"="22"};
+{"k1"="10";"v1"="2";"u1"="23"};
diff --git a/yql/essentials/tests/sql/suites/join/kv1_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/kv1_sorted.txt.attr
new file mode 100644
index 0000000000..0b9487ba64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv1_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt b/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt
new file mode 100644
index 0000000000..45fc02595f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt
@@ -0,0 +1,2 @@
+{"k1"="01";"v1"="1";"u1"="01"};
+{"k1"="01";"v1"="2";"u1"="02"};
diff --git a/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt.attr b/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt.attr
new file mode 100644
index 0000000000..0b9487ba64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv1_sorted1.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv2_sorted.txt b/yql/essentials/tests/sql/suites/join/kv2_sorted.txt
new file mode 100644
index 0000000000..2ce5f4119f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv2_sorted.txt
@@ -0,0 +1,22 @@
+{"k2"="02";"v2"="1";"u2"="01"};
+{"k2"="02";"v2"="1";"u2"="02"};
+{"k2"="02";"v2"="2";"u2"="03"};
+{"k2"="02";"v2"="2";"u2"="04"};
+
+{"k2"="03";"v2"="1";"u2"="05"};
+{"k2"="03";"v2"="2";"u2"="06"};
+
+{"k2"="04";"v2"="1";"u2"="07"};
+{"k2"="04";"v2"="2";"u2"="08"};
+
+{"k2"="05";"v2"="1";"u2"="09"};
+{"k2"="05";"v2"="2";"u2"="10"};
+
+{"k2"="06";"v2"="1";"u2"="11"};
+{"k2"="06";"v2"="2";"u2"="12"};
+
+{"k2"="07";"v2"="1";"u2"="13"};
+{"k2"="07";"v2"="2";"u2"="14"};
+
+{"k2"="09";"v2"="1";"u2"="15"};
+{"k2"="09";"v2"="2";"u2"="16"};
diff --git a/yql/essentials/tests/sql/suites/join/kv2_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/kv2_sorted.txt.attr
new file mode 100644
index 0000000000..387ceb1b55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv2_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt b/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt
new file mode 100644
index 0000000000..3bd67e7caa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt
@@ -0,0 +1,2 @@
+{"k2"="01";"v2"="1";"u2"="01"};
+{"k2"="01";"v2"="2";"u2"="03"};
diff --git a/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt.attr b/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt.attr
new file mode 100644
index 0000000000..387ceb1b55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv2_sorted1.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv3_sorted.txt b/yql/essentials/tests/sql/suites/join/kv3_sorted.txt
new file mode 100644
index 0000000000..c9ef7d9a22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv3_sorted.txt
@@ -0,0 +1,8 @@
+{"k3"=#; "v3"="1";"u3"="01"};
+{"k3"=#; "v3"="2";"u3"="02"};
+
+{"k3"="04";"v3"="1";"u3"="03"};
+{"k3"="04";"v3"="2";"u3"="04"};
+
+{"k3"="05";"v3"="1";"u3"="05"};
+{"k3"="05";"v3"="2";"u3"="06"};
diff --git a/yql/essentials/tests/sql/suites/join/kv3_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/kv3_sorted.txt.attr
new file mode 100644
index 0000000000..90e6a79548
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv3_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k3";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v3";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u3";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv4_sorted.txt b/yql/essentials/tests/sql/suites/join/kv4_sorted.txt
new file mode 100644
index 0000000000..a355cbb673
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv4_sorted.txt
@@ -0,0 +1,18 @@
+{"k4"="03";"v4"=#; "u4"="01"};
+{"k4"="03";"v4"="1";"u4"="02"};
+{"k4"="03";"v4"="2";"u4"="03"};
+
+{"k4"="04";"v4"="1";"u4"="04"};
+{"k4"="04";"v4"="2";"u4"="05"};
+
+{"k4"="05";"v4"="1";"u4"="06"};
+{"k4"="05";"v4"="2";"u4"="07"};
+
+{"k4"="06";"v4"="1";"u4"="08"};
+{"k4"="06";"v4"="2";"u4"="09"};
+
+{"k4"="07";"v4"="1";"u4"="10"};
+{"k4"="07";"v4"="2";"u4"="11"};
+
+{"k4"="08";"v4"="1";"u4"="12"};
+{"k4"="08";"v4"="2";"u4"="13"};
diff --git a/yql/essentials/tests/sql/suites/join/kv4_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/kv4_sorted.txt.attr
new file mode 100644
index 0000000000..ea731dd20b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv4_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %true
+ >
+ [
+ {
+ "name" = "k4";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v4";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u4";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/kv5_sorted.txt b/yql/essentials/tests/sql/suites/join/kv5_sorted.txt
new file mode 100644
index 0000000000..748994c8e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv5_sorted.txt
@@ -0,0 +1,13 @@
+{"k5"=# ;"v5"="1";"u5"="01"};
+{"k5"=# ;"v5"="2";"u5"="02"};
+
+{"k5"="02";"v5"="1";"u5"="03"};
+{"k5"="02";"v5"="1";"u5"="04"};
+{"k5"="02";"v5"="2";"u5"="05"};
+{"k5"="02";"v5"="2";"u5"="06"};
+
+{"k5"="03";"v5"="1";"u5"="07"};
+{"k5"="03";"v5"="2";"u5"="08"};
+
+{"k5"="09";"v5"="1";"u5"="09"};
+{"k5"="09";"v5"="2";"u5"="10"};
diff --git a/yql/essentials/tests/sql/suites/join/kv5_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/kv5_sorted.txt.attr
new file mode 100644
index 0000000000..05a419bcca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/kv5_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k5";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v5";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u5";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.cfg b/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.cfg
new file mode 100644
index 0000000000..04719e2ed1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.sql b/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.sql
new file mode 100644
index 0000000000..b0dd13c10d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/late_mergejoin_on_empty.sql
@@ -0,0 +1,8 @@
+use plato;
+PRAGMA DisableSimpleColumns;
+pragma yt.JoinMergeTablesLimit="100";
+
+select * from
+(select * from Input where key < "020") as a
+left only join (select subkey from Input where key < "010") as b on a.subkey = b.subkey
+join /*+ merge() */ (select key, value from Input) as c on a.key = c.key
diff --git a/yql/essentials/tests/sql/suites/join/leaf.txt b/yql/essentials/tests/sql/suites/join/leaf.txt
new file mode 100644
index 0000000000..0de2350ffa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/leaf.txt
@@ -0,0 +1,17 @@
+{"key"=0u;"value"="zero"};
+{"key"=0u;"value"=#};
+{"key"=0u;"value"="null"};
+{"key"=1u;"value"="one"};
+{"key"=2u;"value"="two"};
+{"key"=2u;"value"="two"};
+{"key"=2u;"value"="pair"};
+{"key"=3u;"value"="three"};
+{"key"=6u;"value"="six"};
+{"key"=6u;"value"="3+3"};
+{"key"=3u;"value"="1+1+1"};
+{"key"=7u;"value"="seven"};
+{"key"=9u;"value"="nine"};
+{"key"=8u;"value"="eight"};
+{"key"=5u;"value"="five"};
+{"key"=4u;"value"="2*2"};
+{"key"=4u;"value"="four"};
diff --git a/yql/essentials/tests/sql/suites/join/leaf.txt.attr b/yql/essentials/tests/sql/suites/join/leaf.txt.attr
new file mode 100644
index 0000000000..0a764a6b82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/leaf.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["value";["OptionalType";["DataType";"String"]]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/left_all-off.cfg b/yql/essentials/tests/sql/suites/join/left_all-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_all-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_all.cfg b/yql/essentials/tests/sql/suites/join/left_all.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_all.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_all.sql b/yql/essentials/tests/sql/suites/join/left_all.sql
new file mode 100644
index 0000000000..b980bc85d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_all.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+SELECT *
+FROM Input2 AS a
+LEFT JOIN Input3 AS b
+ON a.value == b.value;
diff --git a/yql/essentials/tests/sql/suites/join/left_cast_to_string-off.cfg b/yql/essentials/tests/sql/suites/join/left_cast_to_string-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_cast_to_string-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_cast_to_string.cfg b/yql/essentials/tests/sql/suites/join/left_cast_to_string.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_cast_to_string.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_cast_to_string.sql b/yql/essentials/tests/sql/suites/join/left_cast_to_string.sql
new file mode 100644
index 0000000000..5d41a78255
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_cast_to_string.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key as key, Input1.subkey, Cast(Input3.value as varchar) as value from plato.Input1 left join plato.Input3 using (key) order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input1.txt b/yql/essentials/tests/sql/suites/join/left_join_input1.txt
new file mode 100644
index 0000000000..ff0c12e814
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input1.txt
@@ -0,0 +1,8 @@
+{"Key1"=101;"Key2"="One";"Fk1"=#;"Value"="no_right_key_1"};
+{"Key1"=102;"Key2"="Two";"Fk1"=#;"Value"="no_right_key_2"};
+{"Key1"=103;"Key2"="Three";"Fk1"="Name1";"Value"="Value1"};
+{"Key1"=104;"Key2"="One";"Fk1"="Name2";"Value"="Value2"};
+{"Key1"=104;"Key2"="Two";"Fk1"="Name2";"Value"="Value3"};
+{"Key1"=105;"Key2"="One";"Fk1"="Name3";"Value"="no_right_key_3"};
+{"Key1"=106;"Key2"="One";"Fk1"="Name4";"Value"=#};
+{"Key1"=106;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"};
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input1.txt.attr b/yql/essentials/tests/sql/suites/join/left_join_input1.txt.attr
new file mode 100644
index 0000000000..4f113053bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input1.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["Key1";["OptionalType";["DataType";"Int32"]]];
+ ["Key2";["OptionalType";["DataType";"String"]]];
+ ["Fk1";["OptionalType";["DataType";"String"]]];
+ ["Value";["OptionalType";["DataType";"String"]]]]
+ ];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input2.txt b/yql/essentials/tests/sql/suites/join/left_join_input2.txt
new file mode 100644
index 0000000000..94730fa38c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input2.txt
@@ -0,0 +1,3 @@
+{"Key"="Name1";"Value"=1001};
+{"Key"="Name2";"Value"=1002};
+{"Key"="Name4";"Value"=#};
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input2.txt.attr b/yql/essentials/tests/sql/suites/join/left_join_input2.txt.attr
new file mode 100644
index 0000000000..be5e16e2ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input2.txt.attr
@@ -0,0 +1,8 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["Key";["DataType";"String"]];
+ ["Value";["OptionalType";["DataType";"Int32"]]]]
+ ];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input3.txt b/yql/essentials/tests/sql/suites/join/left_join_input3.txt
new file mode 100644
index 0000000000..596c900d7d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input3.txt
@@ -0,0 +1 @@
+{"Key"="Name2";"Value"=12345};
diff --git a/yql/essentials/tests/sql/suites/join/left_join_input3.txt.attr b/yql/essentials/tests/sql/suites/join/left_join_input3.txt.attr
new file mode 100644
index 0000000000..be5e16e2ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_input3.txt.attr
@@ -0,0 +1,8 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["Key";["DataType";"String"]];
+ ["Value";["OptionalType";["DataType";"Int32"]]]]
+ ];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/join/left_join_null_column-off.cfg b/yql/essentials/tests/sql/suites/join/left_join_null_column-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_null_column-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_join_null_column.cfg b/yql/essentials/tests/sql/suites/join/left_join_null_column.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_null_column.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_null_column.sql b/yql/essentials/tests/sql/suites/join/left_join_null_column.sql
new file mode 100644
index 0000000000..c7e38d6e0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_null_column.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"x":"150", "y":1, "z":Null|>, <|"x":"150", "y":2, "z":Null|>];
+
+SELECT * FROM Input1 AS a LEFT JOIN AS_TABLE($t) AS b ON a.key = b.x ORDER BY key, y;
+
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.cfg b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.cfg
new file mode 100644
index 0000000000..a0d2d24b7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.cfg
@@ -0,0 +1,3 @@
+in Input1 left_join_input1.txt
+in Input2 left_join_input2.txt
+in Input3 left_join_input3.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.sql b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.sql
new file mode 100644
index 0000000000..da815ce13b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_left.sql
@@ -0,0 +1,11 @@
+PRAGMA FilterPushdownOverJoinOptionalSide;
+
+SELECT t1.Key1, t1.Key2, t1.Fk1, t1.Value, t2.Key, t2.Value, t3.Value
+
+FROM plato.Input1 AS t1
+LEFT JOIN plato.Input2 AS t2
+ON t1.Fk1 = t2.Key
+INNER JOIN plato.Input3 as t3
+ON t1.Fk1 = t3.Key
+
+WHERE t2.Value > 1001;
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.cfg b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.cfg
new file mode 100644
index 0000000000..a0d2d24b7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.cfg
@@ -0,0 +1,3 @@
+in Input1 left_join_input1.txt
+in Input2 left_join_input2.txt
+in Input3 left_join_input3.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.sql b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.sql
new file mode 100644
index 0000000000..fe7fdeea48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_nested_right.sql
@@ -0,0 +1,10 @@
+PRAGMA FilterPushdownOverJoinOptionalSide;
+
+SELECT t1.Key1, t1.Key2, t1.Fk1, t1.Value, t2.Key, t2.Value, t3.Value
+
+FROM plato.Input1 AS t1
+CROSS JOIN plato.Input3 AS t3
+LEFT JOIN plato.Input2 AS t2
+ON t1.Fk1 = t2.Key
+
+WHERE t2.Value > 1001;
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.cfg b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.cfg
new file mode 100644
index 0000000000..a0d2d24b7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.cfg
@@ -0,0 +1,3 @@
+in Input1 left_join_input1.txt
+in Input2 left_join_input2.txt
+in Input3 left_join_input3.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.sql b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.sql
new file mode 100644
index 0000000000..de596ae77b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_no_opt.sql
@@ -0,0 +1,7 @@
+PRAGMA FilterPushdownOverJoinOptionalSide;
+
+SELECT t1.Key1, t1.Key2, t1.Fk1, t1.Value, t2.Key, t2.Value FROM plato.Input2 AS t2
+RIGHT JOIN plato.Input1 AS t1
+ON t2.Key = t1.Fk1
+WHERE t1.Key1 > 104
+ORDER BY t1.Key1, t1.Key2;
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.cfg b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.cfg
new file mode 100644
index 0000000000..a0d2d24b7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.cfg
@@ -0,0 +1,3 @@
+in Input1 left_join_input1.txt
+in Input2 left_join_input2.txt
+in Input3 left_join_input3.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.sql b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.sql
new file mode 100644
index 0000000000..ec45c754b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_null.sql
@@ -0,0 +1,7 @@
+PRAGMA FilterPushdownOverJoinOptionalSide;
+
+SELECT t1.Key1, t1.Key2, t1.Fk1, t1.Value, t2.Key, t2.Value FROM plato.Input1 AS t1
+LEFT JOIN plato.Input2 AS t2
+ON t1.Fk1 = t2.Key
+WHERE t2.Value IS NULL
+ORDER BY t1.Key1, t1.Key2;
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.cfg b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.sql b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.sql
new file mode 100644
index 0000000000..e1c15a8d52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_right_pushdown_simple.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA FilterPushdownOverJoinOptionalSide;
+
+use plato;
+SELECT *
+FROM Input2 AS a
+LEFT JOIN Input3 AS b
+ON a.value == b.value
+WHERE b.value >= "ddd";
diff --git a/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr-off.cfg b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.cfg b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.sql b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.sql
new file mode 100644
index 0000000000..5ce4892df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_join_with_self_aggr.sql
@@ -0,0 +1,51 @@
+
+$a = [
+ AsStruct(
+ 'a' as x,
+ 1 as y
+ ),
+ AsStruct(
+ 'a' as x,
+ 1 as y
+ ),
+ AsStruct(
+ 'a' as x,
+ 2 as y
+ ),
+ AsStruct(
+ 'a' as x,
+ 3 as y
+ ),
+ AsStruct(
+ 'b' as x,
+ 1 as y
+ ),
+ AsStruct(
+ 'b' as x,
+ 2 as y
+ ),
+ AsStruct(
+ 'b' as x,
+ 3 as y
+ ),
+ AsStruct(
+ 'c' as x,
+ 1 as y
+ ),
+];
+
+$a = select x as bar, y as foo from AS_TABLE($a);
+
+$b =
+SELECT
+ a.bar as bar, count(*) as cnt
+from $a as a
+inner join (
+ select bar, min(foo) as foo
+ from $a
+ group by bar
+) as b using (foo, bar)
+group by a.bar;
+
+
+select * from $a as a left join $b as b using (bar);
diff --git a/yql/essentials/tests/sql/suites/join/left_null_literal-off.cfg b/yql/essentials/tests/sql/suites/join/left_null_literal-off.cfg
new file mode 100644
index 0000000000..a838c2cc3a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_null_literal-off.cfg
@@ -0,0 +1,3 @@
+out Output output.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_null_literal.cfg b/yql/essentials/tests/sql/suites/join/left_null_literal.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_null_literal.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_null_literal.sql b/yql/essentials/tests/sql/suites/join/left_null_literal.sql
new file mode 100644
index 0000000000..4325869895
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_null_literal.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+use plato;
+
+$foo = [<|"x":1|>];
+$bar = [<|"x":1, "y":Null|>];
+
+insert into Output
+select * from AS_TABLE($foo) as a LEFT JOIN AS_TABLE($bar) as b USING(x);
diff --git a/yql/essentials/tests/sql/suites/join/left_only_semi_and_other-off.cfg b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.cfg b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.sql b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.sql
new file mode 100644
index 0000000000..3258c30324
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_semi_and_other.sql
@@ -0,0 +1,15 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data1 = (select cast(key as uint32) as key, subkey, value from Input1);
+$data2 = (select cast(key as uint32) % 100u as key, subkey, value from Input3);
+
+--INSERT INTO Output
+SELECT
+ i1.*
+FROM $data1 as i1
+LEFT ONLY JOIN $data2 as i2 ON i1.key = i2.key
+LEFT SEMI JOIN $data1 as i3 ON i1.key = i3.key
+LEFT OUTER JOIN $data1 as i4 ON i1.key = i4.key
+ORDER BY i1.key
diff --git a/yql/essentials/tests/sql/suites/join/left_only_with_other-off.cfg b/yql/essentials/tests/sql/suites/join/left_only_with_other-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_with_other-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_only_with_other.cfg b/yql/essentials/tests/sql/suites/join/left_only_with_other.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_with_other.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_only_with_other.sql b/yql/essentials/tests/sql/suites/join/left_only_with_other.sql
new file mode 100644
index 0000000000..65b1bf178d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_only_with_other.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data1 = (select cast(key as uint32) as key, subkey, value from Input1);
+$data2 = (select cast(key as uint32) % 100u as key, subkey, value from Input1);
+
+--INSERT INTO Output
+SELECT
+ i1.*
+FROM $data1 as i1
+LEFT ONLY JOIN $data2 as i2 ON i1.key = i2.key
+JOIN $data1 as i3 ON i1.key = i3.key
+;
diff --git a/yql/essentials/tests/sql/suites/join/left_semi_with_other-off.cfg b/yql/essentials/tests/sql/suites/join/left_semi_with_other-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_semi_with_other-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_semi_with_other.cfg b/yql/essentials/tests/sql/suites/join/left_semi_with_other.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_semi_with_other.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_semi_with_other.sql b/yql/essentials/tests/sql/suites/join/left_semi_with_other.sql
new file mode 100644
index 0000000000..0ac01a9e53
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_semi_with_other.sql
@@ -0,0 +1,15 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+$data1 = (select cast(key as uint32) as key, subkey, value from Input1);
+$data2 = (select cast(key as uint32) % 100u as key, subkey, value from Input2);
+
+--INSERT INTO Output
+SELECT
+ i1.*
+FROM $data1 as i1
+LEFT SEMI JOIN $data2 as i2 ON i1.key = i2.key
+LEFT OUTER JOIN $data1 as i3 ON i1.key = i3.key
+ORDER BY i1.key
+;
diff --git a/yql/essentials/tests/sql/suites/join/left_trivial-off.cfg b/yql/essentials/tests/sql/suites/join/left_trivial-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_trivial-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/left_trivial.cfg b/yql/essentials/tests/sql/suites/join/left_trivial.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_trivial.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/left_trivial.sql b/yql/essentials/tests/sql/suites/join/left_trivial.sql
new file mode 100644
index 0000000000..ae448327da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/left_trivial.sql
@@ -0,0 +1,5 @@
+PRAGMA DisableSimpleColumns;
+select Input1.key, Input1.subkey, Input3.value
+from plato.Input1
+left join plato.Input3 using (key)
+order by Input1.key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.sql
new file mode 100644
index 0000000000..63d400bf94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_csee.sql
@@ -0,0 +1,30 @@
+/* ignore runonopt plan diff */
+USE plato;
+PRAGMA DisableSimpleColumns;
+PRAGMA yt.LookupJoinLimit="64k";
+PRAGMA yt.LookupJoinMaxRows="100";
+
+$campaigns_data = AsList(
+ AsStruct(Just(1) as id),
+ AsStruct(Just(2) as id));
+
+$strategies_data = AsList(
+ AsStruct(Just(1) as id),
+ AsStruct(Just(2) as id));
+
+$lottery_data = AsList(
+ AsStruct(Just(1) as id, Just(2) as campaign_id, Just(3) as strategy_id));
+
+
+INSERT INTO @campaigns SELECT * FROM AS_TABLE($campaigns_data) ORDER BY id;
+INSERT INTO @strategies SELECT * FROM AS_TABLE($strategies_data) ORDER BY id;
+INSERT INTO @lottery SELECT * FROM AS_TABLE($lottery_data) ORDER BY id;
+
+COMMIT;
+
+SELECT
+ lottery.id AS lottery_id
+FROM @lottery AS lottery
+ JOIN @campaigns AS campaigns ON lottery.campaign_id = campaigns.id
+ JOIN @strategies AS strategies ON lottery.strategy_id = strategies.id
+WHERE 1 < 0
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.sql
new file mode 100644
index 0000000000..e91ef8f7c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug7646_subst.sql
@@ -0,0 +1,28 @@
+USE plato;
+PRAGMA DisableSimpleColumns;
+PRAGMA yt.LookupJoinLimit="64k";
+PRAGMA yt.LookupJoinMaxRows="100";
+
+$campaigns_data = AsList(
+ AsStruct(Just(1) as id),
+ AsStruct(Just(2) as id));
+
+$strategies_data = AsList(
+ AsStruct(Just(1) as id),
+ AsStruct(Just(2) as id));
+
+$lottery_data = AsList(
+ AsStruct(Just(1) as id, Just(2) as campaign_id, Just(3) as strategy_id));
+
+
+INSERT INTO @campaigns SELECT * FROM AS_TABLE($campaigns_data) ORDER BY id;
+INSERT INTO @strategies SELECT * FROM AS_TABLE($strategies_data) ORDER BY id;
+INSERT INTO @lottery SELECT * FROM AS_TABLE($lottery_data) ORDER BY id;
+
+COMMIT;
+
+SELECT
+ lottery.id AS lottery_id
+FROM @lottery AS lottery
+ JOIN @campaigns AS campaigns ON lottery.campaign_id = campaigns.id
+ JOIN @strategies AS strategies ON lottery.strategy_id = strategies.id
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.sql
new file mode 100644
index 0000000000..8e2b401fa0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_bug8533.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- tables should be swapped (Input1 is bigger)
+select * from Input2 as a
+inner join any Input1 as b on a.k2 = b.k1;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_inner.sql
new file mode 100644
index 0000000000..a85dec245c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- tables should be swapped (Input1 is bigger)
+select * from Input2 as a
+inner join Input1 as b on a.k2 = b.k1 and a.v2 = b.v1;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o-off.cfg
new file mode 100644
index 0000000000..473c367b92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.cfg
new file mode 100644
index 0000000000..0e1c5e12b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.sql
new file mode 100644
index 0000000000..a85dec245c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- tables should be swapped (Input1 is bigger)
+select * from Input2 as a
+inner join Input1 as b on a.k2 = b.k1 and a.v2 = b.v1;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o-off.cfg
new file mode 100644
index 0000000000..cb6cc9dbbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2_opt.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.cfg
new file mode 100644
index 0000000000..a567b5178d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2_opt.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.sql
new file mode 100644
index 0000000000..a85dec245c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_1o2o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- tables should be swapped (Input1 is bigger)
+select * from Input2 as a
+inner join Input1 as b on a.k2 = b.k1 and a.v2 = b.v1;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o-off.cfg
new file mode 100644
index 0000000000..8dc359be1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_opt.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.cfg
new file mode 100644
index 0000000000..a636052ccc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_opt.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.sql
new file mode 100644
index 0000000000..a85dec245c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_2o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- tables should be swapped (Input1 is bigger)
+select * from Input2 as a
+inner join Input1 as b on a.k2 = b.k1 and a.v2 = b.v1;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.sql
new file mode 100644
index 0000000000..afbfb0757b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_inner_empty_subq.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+select * from Input1 as a
+inner join (select * from Input2 where k2 = "not_existent") as b on a.k1 = b.k2;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.sql
new file mode 100644
index 0000000000..1f0f03b410
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_not_selected.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- no lookup join in this case
+select * from Input1 as a
+left join Input2 as b on a.k1 = b.k2;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi.sql
new file mode 100644
index 0000000000..79093ae0fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o-off.cfg
new file mode 100644
index 0000000000..473c367b92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.cfg
new file mode 100644
index 0000000000..0e1c5e12b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.sql
new file mode 100644
index 0000000000..79093ae0fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o-off.cfg
new file mode 100644
index 0000000000..cb6cc9dbbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2_opt.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.cfg
new file mode 100644
index 0000000000..a567b5178d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_opt.txt
+in Input2 sorted_by_kv2_opt.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.sql
new file mode 100644
index 0000000000..79093ae0fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_1o2o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o-off.cfg
new file mode 100644
index 0000000000..8dc359be1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_opt.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.cfg
new file mode 100644
index 0000000000..a636052ccc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_opt.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.sql
new file mode 100644
index 0000000000..79093ae0fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_2o.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty-off.cfg
new file mode 100644
index 0000000000..29c54dddd7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_empty.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.cfg
new file mode 100644
index 0000000000..b8938b393e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2_empty.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.sql
new file mode 100644
index 0000000000..79093ae0fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_empty.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.sql
new file mode 100644
index 0000000000..96cb5ca79a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_semi_subq.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+-- prefix of sort keys
+select * from Input1 as a
+left semi join (select * from Input2 where k2 != "ccc") as b on a.k1 = b.k2
+order by a.k1;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.cfg
new file mode 100644
index 0000000000..8790d17dc7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.cfg
@@ -0,0 +1,2 @@
+in Input input9.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.sql
new file mode 100644
index 0000000000..de1195209c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_take_skip.sql
@@ -0,0 +1,12 @@
+USE plato;
+PRAGMA yt.LookupJoinMaxRows="3";
+pragma yt.LookupJoinLimit = '10M';
+
+insert into @big
+select * from (select ListMap(ListFromRange(1, 100), ($x)->(Unwrap(CAST($x as String)))) as key) flatten list by key order by key;
+commit;
+
+$small = select substring(key, 0, 2) as key, subkey || '000' as subkey from Input order by key limit 5 offset 8;
+
+select * from @big as a join $small as b using(key) order by key;
+
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.sql
new file mode 100644
index 0000000000..cd0840eefe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_unused_keys.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+use plato;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+
+select
+
+v3
+
+from Input1 as a
+join Input2 as b on (a.k1 = b.k2)
+join Input3 as c on (a.k1 = c.k3)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache-off.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache-off.cfg
new file mode 100644
index 0000000000..e7286dfd15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache-off.cfg
@@ -0,0 +1,3 @@
+in Input sorted_by_key_subkey.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.cfg b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.cfg
new file mode 100644
index 0000000000..2e90092760
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.cfg
@@ -0,0 +1 @@
+in Input sorted_by_key_subkey.txt
diff --git a/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.sql b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.sql
new file mode 100644
index 0000000000..0aeadca09a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/lookupjoin_with_cache.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* kikimr can not */
+use plato;
+PRAGMA DisableSimpleColumns;
+pragma yt.LookupJoinLimit="64k";
+pragma yt.LookupJoinMaxRows="100";
+pragma yt.QueryCacheMode="normal";
+pragma yt.QueryCacheUseForCalc="true";
+
+insert into @tmp with truncate
+select * from Input
+where subkey == "bbb"
+order by key;
+
+commit;
+
+select * from Input as a
+inner join @tmp as b on a.key = b.key
+order by a.key, a.subkey;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_dup_key-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.sql b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.sql
new file mode 100644
index 0000000000..54066e1d90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_dup_key.sql
@@ -0,0 +1,10 @@
+use plato;
+
+/* postgres can not */
+/* kikimr can not */
+
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+select *
+from Input1 as a join Input2 as b on a.key = b.key and a.subkey = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite-off.cfg
new file mode 100644
index 0000000000..e76fa257e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite-off.cfg
@@ -0,0 +1,4 @@
+in Input uniqkeys.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.cfg
new file mode 100644
index 0000000000..0e7b4058e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.cfg
@@ -0,0 +1,2 @@
+in Input uniqkeys.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.sql b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.sql
new file mode 100644
index 0000000000..de352022c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+$subq = (SELECT CAST((CAST(subkey AS Int32) + 1) AS String) AS subkey_plus_one FROM Input);
+
+SELECT * FROM Input AS a JOIN $subq AS b ON a.subkey = b.subkey_plus_one order by subkey, key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence-off.cfg
new file mode 100644
index 0000000000..03784127c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence-off.cfg
@@ -0,0 +1,6 @@
+in Input uniqkeys.txt
+in Dict1 sorted_uniq.txt
+in Dict2 sorted_uniq1.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.cfg
new file mode 100644
index 0000000000..eff6a05aeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.cfg
@@ -0,0 +1,4 @@
+in Input uniqkeys.txt
+in Dict1 sorted_uniq.txt
+in Dict2 sorted_uniq1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.sql b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.sql
new file mode 100644
index 0000000000..bd93d67218
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_sequence.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+$subq = (SELECT key, CAST((CAST(subkey AS Int32) + 1) AS String) AS subkey_plus_one FROM Input);
+
+FROM $subq AS a
+JOIN Dict1 AS d1
+ON a.subkey_plus_one = d1.subkey
+JOIN Dict2 AS d2
+ON a.key = d2.key
+SELECT * ORDER BY a.key, a.subkey_plus_one;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star-off.cfg
new file mode 100644
index 0000000000..e76fa257e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star-off.cfg
@@ -0,0 +1,4 @@
+in Input uniqkeys.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.cfg
new file mode 100644
index 0000000000..0e7b4058e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.cfg
@@ -0,0 +1,2 @@
+in Input uniqkeys.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.sql b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.sql
new file mode 100644
index 0000000000..806a6ad8c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_early_rewrite_star.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+USE plato;
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+pragma yt.JoinEnableStarJoin="true";
+
+$subq = (SELECT CAST((CAST(subkey AS Int32) + 1) AS String) AS subkey_plus_one FROM Input);
+
+SELECT * FROM Input AS a JOIN $subq AS b ON a.subkey = b.subkey_plus_one order by subkey, key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.sql b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.sql
new file mode 100644
index 0000000000..df7b2ab987
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_left_null_column.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA yt.MapJoinLimit="1m";
+
+USE plato;
+
+$t = [<|"x":"150", "y":1, "z":Null|>, <|"x":"150", "y":2, "z":Null|>];
+
+SELECT * FROM Input1 AS a LEFT JOIN AS_TABLE($t) AS b ON a.key = b.x ORDER BY key, y;
+
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single-off.cfg
new file mode 100644
index 0000000000..c658c9ddb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single-off.cfg
@@ -0,0 +1,3 @@
+in Input input6.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.cfg
new file mode 100644
index 0000000000..684f1dbee4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.cfg
@@ -0,0 +1 @@
+in Input input6.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.sql
new file mode 100644
index 0000000000..518d33b511
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_non_optional_left_only_single.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"key1":"1", "subkey1":"a", "key":"1", "subkey":"a", "value":"value2_1"|>, <|"key1":"4", "subkey1":"d", "key":"4", "subkey":"d", "value":"value2_4"|>, <|"key1":"-5", "subkey1":"e", "key":"-5", "subkey":"e", "value":"value2_5"|>];
+
+SELECT *
+FROM
+ Input AS A
+LEFT ONLY JOIN
+ AS_TABLE($t) AS B
+ON
+ AsTuple(A.key, AsTuple(A.subkey, A.subkey1)) = AsTuple(B.key, AsTuple(B.subkey, B.subkey1))
+ORDER BY `key`;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single-off.cfg
new file mode 100644
index 0000000000..440cd8b680
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single-off.cfg
@@ -0,0 +1,3 @@
+in Input input5.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.sql
new file mode 100644
index 0000000000..d6eab69ed8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_only_single.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"key":"1", "subkey":"a", "value":"value2_1"|>, <|"key":"4", "subkey":"d", "value":"value2_4"|>, <|"key":"-5", "subkey":"e", "value":"value2_5"|>];
+
+SELECT *
+FROM
+ Input AS A
+LEFT ONLY JOIN
+ AS_TABLE($t) AS B
+ON
+ AsTuple(cast(A.key as uint64), cast(A.subkey as String)) = AsTuple(cast(B.key as int64), cast(B.subkey as Utf8))
+ORDER BY `key`;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many-off.cfg
new file mode 100644
index 0000000000..c658c9ddb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many-off.cfg
@@ -0,0 +1,3 @@
+in Input input6.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.cfg
new file mode 100644
index 0000000000..684f1dbee4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.cfg
@@ -0,0 +1 @@
+in Input input6.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.sql
new file mode 100644
index 0000000000..1175356b1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_many.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"key1":"1", "subkey1":"a", "key":"1", "subkey":"a", "value":"value2_1"|>, <|"key1":"4", "subkey1":"d", "key":"4", "subkey":"d", "value":"value2_4"|>, <|"key1":"-5", "subkey1":"e", "key":"-5", "subkey":"e", "value":"value2_5"|>];
+
+SELECT *
+FROM
+ Input AS A
+LEFT SEMI JOIN
+ AS_TABLE($t) AS B
+ON
+ AsTuple(cast(A.key as uint64), cast(A.subkey as String)) = AsTuple(cast(B.key as int64), cast(B.subkey as Utf8))
+ AND AsTuple(cast(A.key1 as uint64), cast(A.subkey1 as String)) = AsTuple(cast(B.key1 as int64), cast(B.subkey1 as Utf8))
+ORDER BY `key`;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single-off.cfg
new file mode 100644
index 0000000000..440cd8b680
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single-off.cfg
@@ -0,0 +1,3 @@
+in Input input5.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.sql
new file mode 100644
index 0000000000..959c476b80
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_complex_type_optional_left_semi_single.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"key":"1", "subkey":"a", "value":"value2_1"|>, <|"key":"4", "subkey":"d", "value":"value2_4"|>, <|"key":"-5", "subkey":"e", "value":"value2_5"|>];
+
+SELECT *
+FROM
+ Input AS A
+LEFT SEMI JOIN
+ AS_TABLE($t) AS B
+ON
+ AsTuple(cast(A.key as uint64), cast(A.subkey as String)) = AsTuple(cast(B.key as int64), cast(B.subkey as Utf8))
+ORDER BY `key`;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord-off.cfg
new file mode 100644
index 0000000000..2dd54c12a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord-off.cfg
@@ -0,0 +1,5 @@
+in Input input4.txt
+res result.txt
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.cfg
new file mode 100644
index 0000000000..b4bb56a6bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.cfg
@@ -0,0 +1,3 @@
+in Input input4.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.sql
new file mode 100644
index 0000000000..660b2d36b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_tablerecord.sql
@@ -0,0 +1,10 @@
+use plato;
+pragma yt.MapJoinLimit="1M";
+
+$i = select TableRecordIndex() as ind, t.* from Input as t;
+$filter = select min(ind) as ind from $i group by subkey;
+
+select
+ *
+from Input
+where TableRecordIndex() in $filter;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type-off.cfg
new file mode 100644
index 0000000000..c658c9ddb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type-off.cfg
@@ -0,0 +1,3 @@
+in Input input6.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.cfg
new file mode 100644
index 0000000000..684f1dbee4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.cfg
@@ -0,0 +1 @@
+in Input input6.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.sql b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.sql
new file mode 100644
index 0000000000..2ee1b912b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_on_very_complex_type.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+$t = [<|"key1":"1", "subkey1":"a", "key":"1", "subkey":"a", "value":"value2_1"|>, <|"key1":"4", "subkey1":"d", "key":"4", "subkey":"d", "value":"value2_4"|>, <|"key1":"-5", "subkey1":"e", "key":"-5", "subkey":"e", "value":"value2_5"|>];
+
+SELECT *
+FROM
+ Input AS A
+LEFT SEMI JOIN
+ AS_TABLE($t) AS B
+ON
+ AsTuple(A.subkey, AsTuple(A.subkey1, AsTuple(CAST(A.key AS Int64), CAST(A.key1 AS Uint64)))) = AsTuple(B.subkey, AsTuple(B.subkey1, AsTuple(CAST(B.key AS Uint64), CAST(B.key1 AS Int64))))
+ORDER BY `key`;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.sql b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.sql
new file mode 100644
index 0000000000..73171384f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_opt_vs_2xopt.sql
@@ -0,0 +1,23 @@
+use plato;
+
+pragma yt.MapJoinLimit="1m";
+
+$t1 = AsList(
+ AsStruct(Just(1) AS Key),
+ AsStruct(Just(2) AS Key),
+ AsStruct(Just(3) AS Key));
+
+$t2 = AsList(
+ AsStruct(Just(Just(2)) AS Key),
+ AsStruct(Just(Just(3)) AS Key),
+ AsStruct(Just(Just(4)) AS Key),
+ AsStruct(Just(Just(5)) AS Key),
+ AsStruct(Just(Just(6)) AS Key));
+
+insert into @t1 select * from as_table($t1);
+insert into @t2 select * from as_table($t2);
+
+commit;
+
+select *
+from @t1 as a join @t2 as b using(Key);
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys-off.cfg
new file mode 100644
index 0000000000..e76fa257e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys-off.cfg
@@ -0,0 +1,4 @@
+in Input uniqkeys.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.cfg
new file mode 100644
index 0000000000..0e7b4058e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.cfg
@@ -0,0 +1,2 @@
+in Input uniqkeys.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.sql b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.sql
new file mode 100644
index 0000000000..2d152113e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_partial_uniq_keys.sql
@@ -0,0 +1,18 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+/* kikimr can not */
+/* ignore runonopt plan diff */
+USE plato;
+pragma yt.MapJoinLimit="1m";
+
+-- YQL-5582
+$join = (select
+ a.key as key,
+ a.subkey as subkey,
+ a.value as value
+from (select * from Input where value > "bbb") as a
+left join Input as b
+on a.key = b.key);
+
+
+select count(*) from $join;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_sharded.sql b/yql/essentials/tests/sql/suites/join/mapjoin_sharded.sql
new file mode 100644
index 0000000000..e5af0c4509
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_sharded.sql
@@ -0,0 +1,13 @@
+use plato;
+
+/* postgres can not */
+/* kikimr can not */
+
+pragma DisableSimpleColumns;
+/* yt_local_var: MAP_JOIN_LIMIT = 30 */
+/* yqlrun_var: MAP_JOIN_LIMIT = 1000 */
+pragma yt.MapJoinLimit="MAP_JOIN_LIMIT";
+pragma yt.MapJoinShardCount = "10";
+
+select *
+from Input1 as a join Input2 as b on a.key = b.key and a.subkey = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.sql
new file mode 100644
index 0000000000..d574e50062
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_unused_keys.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+use plato;
+pragma yt.MapJoinLimit="1m";
+pragma yt.DisableOptimizers="PhysicalOptimizer-FuseInnerMap";
+
+select
+
+v3
+
+from Input1 as a
+join Input2 as b on (a.k1 = b.k2)
+join Input3 as c on (a.k1 = c.k3)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous-off.cfg
new file mode 100644
index 0000000000..08630ad2c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous-off.cfg
@@ -0,0 +1,4 @@
+in Input input1.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.cfg
new file mode 100644
index 0000000000..c8889a670f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.sql b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.sql
new file mode 100644
index 0000000000..0a6476fbda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_anonymous.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* kikimr can not */
+use plato;
+pragma DisableSimpleColumns;
+
+pragma yt.MapJoinLimit="1m";
+
+insert into @tmp select * from Input where key > "100";
+commit;
+
+select * from Input as a
+left join @tmp as b on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read-off.cfg
new file mode 100644
index 0000000000..63f3b16e05
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read-off.cfg
@@ -0,0 +1,3 @@
+in Input input1.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.cfg
new file mode 100644
index 0000000000..5b34491eb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.cfg
@@ -0,0 +1,4 @@
+in Input input1.txt
+res result.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.sql b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.sql
new file mode 100644
index 0000000000..eae0db98d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_read.sql
@@ -0,0 +1,20 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+/* kikimr can not */
+use plato;
+pragma yt.mapjoinlimit="1m";
+
+$cnt = (select count(*) from Input);
+$offset = ($cnt + 10) ?? 0;
+
+$in1 = (select key from Input where key != "" order by key limit 10 offset $offset);
+
+select * from Input as a
+left join $in1 as b on a.key = b.key;
+
+$limit = ($cnt / 100) ?? 0;
+
+$in2 = (select key from Input where key != "" limit $limit);
+
+select * from Input as a
+left only join $in2 as b on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct-off.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct-off.cfg
new file mode 100644
index 0000000000..08630ad2c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct-off.cfg
@@ -0,0 +1,4 @@
+in Input input1.txt
+res result.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.cfg b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.cfg
new file mode 100644
index 0000000000..c8889a670f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.sql b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.sql
new file mode 100644
index 0000000000..c0fcc01374
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mapjoin_with_empty_struct.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+/* kikimr can not */
+/* ignore yt detailed plan diff */
+use plato;
+pragma yt.MapJoinLimit="10M";
+
+$sizes = (
+ SELECT
+ 0 AS id
+ FROM Input
+);
+
+SELECT d.key FROM Input as d CROSS JOIN $sizes as s ORDER BY d.key;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce-off.cfg
new file mode 100644
index 0000000000..489ecd7e4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce-off.cfg
@@ -0,0 +1,3 @@
+in Input sorted_uniq2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.cfg
new file mode 100644
index 0000000000..de96d331e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.cfg
@@ -0,0 +1 @@
+in Input sorted_uniq2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.sql b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.sql
new file mode 100644
index 0000000000..bcd9751286
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_any_no_join_reduce.sql
@@ -0,0 +1,5 @@
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="2";
+
+select * from Input where key in (select "023" as key union all select "911" as key union all select "911" as key);
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.sql b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.sql
new file mode 100644
index 0000000000..a05dcc865c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+pragma yt.JoinMergeUseSmallAsPrimary="false";
+
+-- Input2 is smaller than Input1
+select * from Input1 as a join Input2 as b on a.k1 = b.k2
+order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique-off.cfg
new file mode 100644
index 0000000000..e41a2c5556
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1_unique.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.cfg
new file mode 100644
index 0000000000..c0114c4136
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1_unique.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.sql b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.sql
new file mode 100644
index 0000000000..79ac405416
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_big_primary_unique.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+pragma yt.JoinMergeUseSmallAsPrimary="false";
+
+-- Input2 is smaller than Input1, but Input1 has unique keys
+select * from Input1 as a join Input2 as b on a.k1 = b.k2 and a.v1 = b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.sql b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.sql
new file mode 100644
index 0000000000..97d4a93ea3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+-- Input2 is smaller than Input1
+select * from Input1 as a join Input2 as b on a.k1 = b.k2
+order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.cfg
new file mode 100644
index 0000000000..23a3ae77d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+pragma yt.ParallelOperationsLimit="1"
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.sql b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.sql
new file mode 100644
index 0000000000..aad534d5dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_choose_primary_with_retry.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+-- emulate monsters in big table
+pragma yt.JoinMergeReduceJobMaxSize="1";
+
+-- Input2 is smaller than Input1
+select * from Input1 as a join Input2 as b on a.k1 = b.k2
+order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align1-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1-off.cfg
new file mode 100644
index 0000000000..9299e9217a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1-off.cfg
@@ -0,0 +1,3 @@
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.sql
new file mode 100644
index 0000000000..3504fd3cf1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align1.sql
@@ -0,0 +1,26 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+pragma yt.JoinMergeTablesLimit="100";
+pragma yt.JoinMergeForce;
+
+insert into @t1
+select 1 as k1, 10 as v1;
+
+insert into @t2
+select 1u as k2, 100 as v2;
+
+insert into @t3
+select 1us as k3, 1000 as v3;
+
+insert into @t4
+select 1s as k4, 10000 as v4;
+
+commit;
+
+
+select * from (select * from @t1 as a join @t3 as c on a.k1 = c.k3) as ac
+ join (select * from @t2 as b join @t4 as d on b.k2 = d.k4) as bd on ac.k1 = bd.k2 and ac.k3 = bd.k4;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align2-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2-off.cfg
new file mode 100644
index 0000000000..9299e9217a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2-off.cfg
@@ -0,0 +1,3 @@
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.sql
new file mode 100644
index 0000000000..695adedf4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align2.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+pragma yt.JoinMergeTablesLimit="100";
+
+insert into @t1
+select 1 as k1, 10 as v1;
+
+insert into @t2
+select 1u as k2, 100 as v2;
+
+insert into @t3
+select 1us as k3, 1000 as v3;
+
+commit;
+
+select * from @t2 as b
+ left join /*+ merge() */ @t3 as c on b.k2 = c.k3
+ left join @t1 as a on a.k1 = b.k2 and a.k1=c.k3;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align3-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3-off.cfg
new file mode 100644
index 0000000000..9299e9217a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3-off.cfg
@@ -0,0 +1,3 @@
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.sql
new file mode 100644
index 0000000000..1cb847dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_align3.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+pragma yt.JoinMergeTablesLimit="100";
+pragma yt.JoinMergeForce;
+
+insert into @t1
+select (1, 1u) as k1, 100u as v1;
+
+insert into @t2
+select (1u, 1) as k2, 100 as v2;
+
+
+commit;
+
+select * from @t1 as a join @t2 as b on a.k1 = b.k2 and a.v1 = b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.sql
new file mode 100644
index 0000000000..a7cd554ffb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_no_sorted.sql
@@ -0,0 +1,5 @@
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeForce="true";
+
+select a.key as key from Input1 as a join Input2 as b using(key) order by key;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted-off.cfg
new file mode 100644
index 0000000000..644d022f87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted-off.cfg
@@ -0,0 +1,4 @@
+in Input input1.txt
+in InputSorted sorted_uniq.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.cfg
new file mode 100644
index 0000000000..a85b008cc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+in InputSorted sorted_uniq.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.sql
new file mode 100644
index 0000000000..ad74c2340b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_one_sorted.sql
@@ -0,0 +1,6 @@
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeForce="true";
+pragma yt.JoinMergeUnsortedFactor="0";
+
+select a.key as key from InputSorted as a join Input as b using(key) order by key;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link-off.cfg
new file mode 100644
index 0000000000..7f40aa5617
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link-off.cfg
@@ -0,0 +1,6 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.cfg
new file mode 100644
index 0000000000..f22309ab5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.cfg
@@ -0,0 +1,4 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.sql b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.sql
new file mode 100644
index 0000000000..7a30768b9f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_force_per_link.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+
+select
+ a.key as k1,
+ b.key as k2,
+ c.key as k3,
+ a.subkey as sk1,
+ b.subkey as sk2,
+ c.subkey as sk3
+from
+ Input1 as a join Input2 as b on a.key = b.key
+ join /*+ merge() */ Input3 as c on b.key = c.key
+order by k3
+;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt b/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt
new file mode 100644
index 0000000000..7ba5b163db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt
@@ -0,0 +1,20 @@
+{"PhraseID"=0u;"BaseNo"=53u;"Text"="julbo elara otg";};
+{"PhraseID"=0u;"BaseNo"=86u;"Text"="07644200";};
+{"PhraseID"=1u;"BaseNo"=1u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=2u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=3u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=4u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=5u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=6u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=7u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=8u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=9u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=10u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=11u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=12u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=13u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=14u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=15u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=16u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=17u;"Text"="julbo elara otg";};
+{"PhraseID"=1u;"BaseNo"=18u;"Text"="julbo elara otg";};
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt.attr b/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt.attr
new file mode 100644
index 0000000000..6a779223f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_input1.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "PhraseID";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "uint64"
+ };
+ {
+ "name" = "BaseNo";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "uint16"
+ };
+ {
+ "name" = "Text";
+ "required" = %false;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt b/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt
new file mode 100644
index 0000000000..57ff5110b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt
@@ -0,0 +1,5 @@
+{"BannerID"=11830670;"ResultCost"=70000;"ResultFlatCost"=70000;"PhraseID"=0u;"BaseNo"=86u;};
+{"BannerID"=12963892;"ResultCost"=3000;"ResultFlatCost"=0;"PhraseID"=0u;"BaseNo"=53u;};
+{"BannerID"=12977828;"ResultCost"=3000;"ResultFlatCost"=0;"PhraseID"=1u;"BaseNo"=1u;};
+{"BannerID"=13005350;"ResultCost"=3000;"ResultFlatCost"=0;"PhraseID"=1u;"BaseNo"=3u;};
+{"BannerID"=14145807;"ResultCost"=3000;"ResultFlatCost"=0;"PhraseID"=1u;"BaseNo"=10u;};
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt.attr b/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt.attr
new file mode 100644
index 0000000000..1a5403e22b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_input2.txt.attr
@@ -0,0 +1,60 @@
+{
+ "_yql_row_spec" = {
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "BannerID";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ]
+ ];
+ [
+ "BaseNo";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint16"
+ ]
+ ]
+ ];
+ [
+ "PhraseID";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ]
+ ];
+ [
+ "ResultCost";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ]
+ ];
+ [
+ "ResultFlatCost";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ]
+ ]
+ ]
+ ]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column-off.cfg
new file mode 100644
index 0000000000..0eb1ab8cde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column-off.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.cfg
new file mode 100644
index 0000000000..fa48e4fa82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.cfg
@@ -0,0 +1 @@
+in Input1 sorted_by_kv1.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.sql b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.sql
new file mode 100644
index 0000000000..1dd27bcc3a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_left_null_column.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA yt.JoinMergeTablesLimit="10";
+PRAGMA yt.JoinAllowColumnRenames="true";
+PRAGMA yt.JoinMergeUnsortedFactor="5.0";
+
+USE plato;
+
+$t = [<|"x":"bbb", "y":1, "z":Null|>, <|"x":"bbb", "y":2, "z":Null|>];
+
+SELECT * FROM Input1 AS a LEFT JOIN AS_TABLE($t) AS b ON a.k1 = b.x ORDER BY k1, y;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort-off.cfg
new file mode 100644
index 0000000000..a15ee3ce2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.cfg
new file mode 100644
index 0000000000..4d81d34ed9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.sql b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.sql
new file mode 100644
index 0000000000..c5ddba7f1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_narrows_output_sort.sql
@@ -0,0 +1,11 @@
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3";
+pragma yt.JoinAllowColumnRenames="true";
+pragma SimpleColumns;
+
+from Input3 as c
+join Input4 as d on c.k3 = d.k4
+right only join Input1 as a on a.k1 = c.k3 and a.v1 = c.v3
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort-off.cfg
new file mode 100644
index 0000000000..8e80f78742
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort-off.cfg
@@ -0,0 +1,4 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.cfg
new file mode 100644
index 0000000000..ea9e6ce443
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.cfg
@@ -0,0 +1,2 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.sql b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.sql
new file mode 100644
index 0000000000..24b8a2901b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort.sql
@@ -0,0 +1,42 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="0";
+pragma yt.JoinAllowColumnRenames="true";
+pragma yt.JoinMergeSetTopLevelFullSort="true";
+
+FROM SortedBySubkeyValue AS a INNER JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key, a.subkey, a.value
+ORDER BY a.subkey, a.value, b.key;
+
+FROM SortedBySubkeyValue AS a RIGHT JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key, a.subkey, a.value
+ORDER BY b.key;
+
+FROM SortedBySubkeyValue AS a LEFT JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key, a.subkey, a.value
+ORDER BY a.subkey, a.value;
+
+FROM SortedBySubkeyValue AS a FULL JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key, a.subkey, a.value
+ORDER BY b.key, a.subkey, a.value;
+
+FROM SortedBySubkeyValue AS a RIGHT ONLY JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key
+ORDER BY b.key;
+
+FROM SortedBySubkeyValue AS a LEFT ONLY JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT a.subkey, a.value
+ORDER BY a.subkey, a.value;
+
+FROM SortedBySubkeyValue AS a EXCLUSION JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key, a.subkey, a.value
+ORDER BY b.key, a.subkey, a.value;
+
+FROM SortedBySubkeyValue AS a RIGHT SEMI JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT b.key
+ORDER BY b.key;
+
+FROM SortedBySubkeyValue AS a LEFT SEMI JOIN SortedByKey AS b ON a.subkey = b.key
+SELECT a.subkey, a.value
+ORDER BY a.subkey, a.value;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross-off.cfg
new file mode 100644
index 0000000000..287d1fa1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross-off.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.cfg
new file mode 100644
index 0000000000..88a5beef60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.sql b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.sql
new file mode 100644
index 0000000000..8775257805
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_cross.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="0";
+pragma yt.JoinAllowColumnRenames="true";
+pragma yt.JoinMergeSetTopLevelFullSort="true";
+
+FROM Input1 AS a JOIN Input2 AS b ON b.k2 = a.k1
+ CROSS JOIN Input3 AS c
+SELECT c.k3 AS ck3, c.k3 AS ck3_extra, c.v3, a.k1 as ak1 ORDER BY ak1, ck3;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested-off.cfg
new file mode 100644
index 0000000000..7859898010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.cfg
new file mode 100644
index 0000000000..086641db8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.sql b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.sql
new file mode 100644
index 0000000000..3e01d0acda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_nested.sql
@@ -0,0 +1,12 @@
+/* ignore yt detailed plan diff */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="0";
+pragma yt.JoinAllowColumnRenames="true";
+
+FROM Input1 AS a JOIN Input2 AS b ON b.k2 = a.k1 AND a.v1 = b.v2
+ JOIN Input3 AS c ON a.k1 = c.k3 AND a.v1 = c.v3
+SELECT c.k3 AS ck3, c.k3 AS ck3_extra, c.k3 AS ck3_extra2, c.v3, a.k1 as ak1
+ORDER BY ck3, ck3_extra, ck3_extra2, c.v3 -- should be noop
+;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.cfg
new file mode 100644
index 0000000000..c13c3496d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted1.txt
+in Input2 kv2_sorted1.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.sql b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.sql
new file mode 100644
index 0000000000..bc9b116f5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_saves_output_sort_unmatched.sql
@@ -0,0 +1,11 @@
+/* ignore yt detailed plan diff */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="0";
+pragma yt.JoinAllowColumnRenames="true";
+
+FROM Input1 AS a JOIN Input2 AS b ON b.k2 = a.k1 AND a.v1 = b.v2
+SELECT b.k2 AS bk2, b.v2 as bv2, a.k1 as ak1
+ORDER BY bv2 -- should be a separate sort
+;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner-off.cfg
new file mode 100644
index 0000000000..d2366da42e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner-off.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.cfg
new file mode 100644
index 0000000000..829b6d19f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.cfg
@@ -0,0 +1,4 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.sql b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.sql
new file mode 100644
index 0000000000..4897e2737b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_composite_to_inner.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3";
+pragma yt.JoinAllowColumnRenames="true";
+
+$semi = select * from Input3 as c join Input4 as d on c.k3 = d.k4;
+
+from $semi as semi
+right semi join Input1 as a on a.k1 = semi.k3 and a.v1 = semi.v3
+join Input2 as b on b.k2 = a.k1 and b.v2 = a.v1
+select * order by u1;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner-off.cfg
new file mode 100644
index 0000000000..aed2b8c61b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner-off.cfg
@@ -0,0 +1,4 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.cfg
new file mode 100644
index 0000000000..6098eb907d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.cfg
@@ -0,0 +1,2 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.sql b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.sql
new file mode 100644
index 0000000000..3778d9f05b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_semi_to_inner.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="0";
+pragma yt.JoinAllowColumnRenames="true";
+
+from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2 and a.v1 = b.v2
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_small_primary-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary-off.cfg
new file mode 100644
index 0000000000..1f7a620911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary-off.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.cfg
new file mode 100644
index 0000000000..df8cd9f2c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.sql b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.sql
new file mode 100644
index 0000000000..be3ce895b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_small_primary.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+pragma yt.JoinMergeUseSmallAsPrimary="true";
+
+-- Input2 is smaller than Input1
+select * from Input2 as b join Input1 as a on a.k1 = b.k2
+order by a.v1, b.v2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.cfg
new file mode 100644
index 0000000000..1af5db027b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.cfg
@@ -0,0 +1,3 @@
+providers yt
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.sql b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.sql
new file mode 100644
index 0000000000..86a76d3573
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_inner.sql
@@ -0,0 +1,15 @@
+/* ignore yt detailed plan diff */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+$inner =
+ (FROM Input1 AS a JOIN Input2 AS b ON b.k2 = a.k1 AND a.v1 = b.v2
+ SELECT b.k2 AS bk2, b.k2 AS bk2_extra, b.v2 AS bv2, a.k1 as ak1);
+
+SELECT * FROM $inner ORDER BY bv2, bk2_extra;
+SELECT * FROM $inner ORDER BY bk2, bk2_extra, bv2;
+SELECT * FROM $inner ORDER BY bk2_extra, bv2;
+SELECT * FROM $inner ORDER BY bk2_extra;
+SELECT * FROM $inner ORDER BY ak1;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.cfg
new file mode 100644
index 0000000000..2de8793752
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.cfg
@@ -0,0 +1,3 @@
+providers yt
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.sql b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.sql
new file mode 100644
index 0000000000..16c281d696
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_left.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+$left =
+ (FROM Input1 AS a LEFT JOIN Input2 AS b ON b.k2 = a.k1
+ SELECT b.k2 AS bk2, b.k2 AS bk2_extra, b.v2 AS bv2, a.k1 as ak1);
+
+SELECT * FROM $left ORDER BY bv2, bk2_extra;
+SELECT * FROM $left ORDER BY bk2, bk2_extra, bv2;
+SELECT * FROM $left ORDER BY bk2_extra, bv2;
+SELECT * FROM $left ORDER BY bk2_extra;
+SELECT * FROM $left ORDER BY ak1;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.cfg
new file mode 100644
index 0000000000..2de8793752
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.cfg
@@ -0,0 +1,3 @@
+providers yt
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.sql b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.sql
new file mode 100644
index 0000000000..ed613582c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_nomatch.sql
@@ -0,0 +1,8 @@
+/* ignore yt detailed plan diff */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+FROM Input1 AS a JOIN Input2 AS b ON b.k2 = a.k1
+SELECT b.v2 AS bv2, a.k1 as ak1 ORDER BY ak1, bv2;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.cfg
new file mode 100644
index 0000000000..1af5db027b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.cfg
@@ -0,0 +1,3 @@
+providers yt
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.sql b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.sql
new file mode 100644
index 0000000000..2e4238f110
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_sorts_output_for_sort_right.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinAllowColumnRenames="true";
+
+$right =
+ (FROM Input1 AS a RIGHT JOIN Input2 AS b ON b.k2 = a.k1 AND a.v1 = b.v2
+ SELECT b.k2 AS bk2, b.k2 AS bk2_extra, b.v2 AS bv2, a.k1 as ak1, a.v1 as av1);
+
+SELECT * FROM $right ORDER BY bv2, bk2_extra;
+SELECT * FROM $right ORDER BY bk2, bk2_extra, bv2;
+SELECT * FROM $right ORDER BY bk2_extra, bv2;
+SELECT * FROM $right ORDER BY bk2_extra;
+SELECT * FROM $right ORDER BY ak1, av1;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.sql
new file mode 100644
index 0000000000..78bc056914
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_unused_keys.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+
+select
+
+v3
+
+from Input1 as a
+join Input2 as b on (a.k1 = b.k2)
+join Input3 as c on (a.k1 = c.k3)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names-off.cfg
new file mode 100644
index 0000000000..8e80f78742
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names-off.cfg
@@ -0,0 +1,4 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.cfg
new file mode 100644
index 0000000000..ea9e6ce443
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.cfg
@@ -0,0 +1,2 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.sql
new file mode 100644
index 0000000000..7fe038ad6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names.sql
@@ -0,0 +1,19 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+pragma yt.JoinAllowColumnRenames="true";
+
+
+FROM SortedBySubkeyValue as a JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY a.subkey, b.key;
+
+FROM SortedBySubkeyValue as a JOIN SortedByKey as b on a.subkey=b.key
+SELECT a.subkey, b.key ORDER BY a.subkey, b.key;
+
+
+FROM SortedBySubkeyValue as a LEFT JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY a.subkey;
+
+FROM SortedBySubkeyValue as a RIGHT JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested-off.cfg
new file mode 100644
index 0000000000..5d2e73b721
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested-off.cfg
@@ -0,0 +1,5 @@
+in Input sorted_by_key1.txt
+in Input1 sorted_by_k1.txt
+in Input2 sorted_by_k2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.cfg
new file mode 100644
index 0000000000..15fbfe10b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.cfg
@@ -0,0 +1,3 @@
+in Input sorted_by_key1.txt
+in Input1 sorted_by_k1.txt
+in Input2 sorted_by_k2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.sql
new file mode 100644
index 0000000000..427553d99e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nested.sql
@@ -0,0 +1,11 @@
+/* ignore yt detailed plan diff */
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+pragma yt.JoinAllowColumnRenames="true";
+
+FROM Input AS a JOIN Input1 AS b ON b.k1=a.key
+ JOIN Input2 AS c ON a.key=c.k2
+SELECT a.value as avalue, b.v1, c.k2 as ck2 ORDER BY avalue, b.v1, ck2;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted-off.cfg
new file mode 100644
index 0000000000..ec195ece46
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted-off.cfg
@@ -0,0 +1,4 @@
+in Unsorted input2.txt
+in SortedBySubkeyValue sorted_uniq1.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.cfg
new file mode 100644
index 0000000000..e049d17dbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.cfg
@@ -0,0 +1,2 @@
+in Unsorted input2.txt
+in SortedBySubkeyValue sorted_uniq1.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.sql
new file mode 100644
index 0000000000..d97fb38e04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_nonsorted.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="100.0";
+pragma yt.JoinAllowColumnRenames="true";
+
+$unsorted = (SELECT key, CAST((CAST(subkey as Int32) + 2) as String) as sk, value as val FROM Unsorted);
+
+FROM SortedBySubkeyValue AS a JOIN $unsorted AS b ON a.subkey=b.sk AND a.value=b.val
+SELECT * ORDER BY a.key,b.key;
+
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename-off.cfg
new file mode 100644
index 0000000000..8e80f78742
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename-off.cfg
@@ -0,0 +1,4 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.cfg
new file mode 100644
index 0000000000..ea9e6ce443
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.cfg
@@ -0,0 +1,2 @@
+in SortedByKey sorted_uniq.txt
+in SortedBySubkeyValue sorted_uniq1.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.sql
new file mode 100644
index 0000000000..07ad22faf7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_different_key_names_norename.sql
@@ -0,0 +1,19 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+pragma yt.JoinAllowColumnRenames="false";
+
+
+FROM SortedBySubkeyValue as a JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY a.subkey, b.key;
+
+FROM SortedBySubkeyValue as a JOIN SortedByKey as b on a.subkey=b.key
+SELECT a.subkey, b.key ORDER BY a.subkey, b.key;
+
+
+FROM SortedBySubkeyValue as a LEFT JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY a.subkey;
+
+FROM SortedBySubkeyValue as a RIGHT JOIN SortedByKey as b on a.subkey=b.key
+SELECT * ORDER BY b.key;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order-off.cfg
new file mode 100644
index 0000000000..01597c0916
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order-off.cfg
@@ -0,0 +1,4 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.cfg
new file mode 100644
index 0000000000..3ea969d8b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.cfg
@@ -0,0 +1,2 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.sql
new file mode 100644
index 0000000000..5cc0731682
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_reverse_key_order.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+SELECT pd.Text
+ FROM Input2 as m2
+ INNER JOIN Input1 as pd
+ USING (BaseNo, PhraseID)
+ORDER BY pd.Text;
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range-off.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range-off.cfg
new file mode 100644
index 0000000000..7dd23dd911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range-off.cfg
@@ -0,0 +1,6 @@
+in Left1 sorted_by_key1.txt
+in Left2 sorted_by_key2.txt
+in Right1 sorted_by_key3.txt
+in Right2 sorted_by_key4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.cfg b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.cfg
new file mode 100644
index 0000000000..5182327159
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.cfg
@@ -0,0 +1,4 @@
+in Left1 sorted_by_key1.txt
+in Left2 sorted_by_key2.txt
+in Right1 sorted_by_key3.txt
+in Right2 sorted_by_key4.txt
diff --git a/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.sql b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.sql
new file mode 100644
index 0000000000..95f96e883f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/mergejoin_with_table_range.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+SELECT *
+ FROM CONCAT("Left1", "Left2") as a
+ INNER JOIN CONCAT("Right1", "Right2") as b
+ USING(key)
+ORDER BY a.value,b.value;
+
diff --git a/yql/essentials/tests/sql/suites/join/nested_semi_join-off.cfg b/yql/essentials/tests/sql/suites/join/nested_semi_join-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nested_semi_join-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/nested_semi_join.cfg b/yql/essentials/tests/sql/suites/join/nested_semi_join.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nested_semi_join.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/nested_semi_join.sql b/yql/essentials/tests/sql/suites/join/nested_semi_join.sql
new file mode 100644
index 0000000000..f8b8277292
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nested_semi_join.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+use plato;
+
+$w1 = (select u.subkey as subkey, u.value as value from Input1 as u left semi join Input1 as v on u.key == v.key);
+
+$t1 = (select x.value from Input1 as x left semi join $w1 as y on x.subkey == y.subkey);
+
+select * from $t1;
diff --git a/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn-off.cfg b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn-off.cfg
new file mode 100644
index 0000000000..893ac062c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn-off.cfg
@@ -0,0 +1,5 @@
+in Input1 empty_dynamic.txt
+in Input2 empty_dynamic.txt
+providers yt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.cfg b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.cfg
new file mode 100644
index 0000000000..9b9c114a16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.cfg
@@ -0,0 +1,3 @@
+in Input1 empty_dynamic.txt
+in Input2 empty_dynamic.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.sql b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.sql
new file mode 100644
index 0000000000..cb7b8b50d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/no_empty_join_for_dyn.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+SELECT *
+FROM plato.Input1 as A
+INNER JOIN plato.Input2 as B
+ON A.key=B.key;
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner-off.cfg b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.cfg b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.sql b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.sql
new file mode 100644
index 0000000000..ed4f7c70ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_over_inner.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+-- should not pushdown
+select * from Input1 as a inner join Input2 as b on a.key = b.key where Unwrap(cast(a.key as Int32)) > 100 order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on-off.cfg b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.cfg b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.sql b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.sql
new file mode 100644
index 0000000000..8e43238765
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/nopushdown_filter_with_depends_on.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* hybridfile can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 4 */
+use plato;
+
+-- should not pushdown
+select * from Input1 as a left semi join Input2 as b using(key) where Random(TableRow()) < 0.1 order by key;
+
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side-off.cfg b/yql/essentials/tests/sql/suites/join/opt_on_opt_side-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side.cfg b/yql/essentials/tests/sql/suites/join/opt_on_opt_side.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side.sql b/yql/essentials/tests/sql/suites/join/opt_on_opt_side.sql
new file mode 100644
index 0000000000..f4abb9909e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side.sql
@@ -0,0 +1,20 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+SELECT
+ A.key,
+ B.subkey
+FROM
+ Input2 AS A
+LEFT JOIN
+ (
+ SELECT
+ key,
+ CAST(key AS INT) AS subkey
+ FROM
+ Input3
+ ) AS B
+ON
+ A.key == B.key
+ORDER BY A.key
+;
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group-off.cfg b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.cfg b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.sql b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.sql
new file mode 100644
index 0000000000..f01cd2147d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/opt_on_opt_side_with_group.sql
@@ -0,0 +1,24 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+SELECT
+ A.key as key,
+ B.subkey,
+ COUNT(*) AS count
+FROM
+ Input2 AS A
+LEFT JOIN
+ (
+ SELECT
+ key,
+ CAST(key AS INT) AS subkey
+ FROM
+ Input3
+ ) AS B
+ON
+ A.key == B.key
+GROUP BY
+ A.key, B.subkey
+ORDER BY
+ key
+;
diff --git a/yql/essentials/tests/sql/suites/join/order_of_qualified-off.cfg b/yql/essentials/tests/sql/suites/join/order_of_qualified-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/order_of_qualified-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/order_of_qualified.cfg b/yql/essentials/tests/sql/suites/join/order_of_qualified.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/order_of_qualified.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/order_of_qualified.sql b/yql/essentials/tests/sql/suites/join/order_of_qualified.sql
new file mode 100644
index 0000000000..a28e3beaea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/order_of_qualified.sql
@@ -0,0 +1,6 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+SELECT b.*,1 as q,a.*
+FROM Input2 AS a
+JOIN Input3 AS b
+ON a.value == b.value;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_cross-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_cross-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_cross-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_cross.cfg b/yql/essentials/tests/sql/suites/join/premap_common_cross.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_cross.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_cross.sql b/yql/essentials/tests/sql/suites/join/premap_common_cross.sql
new file mode 100644
index 0000000000..2790c4a108
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_cross.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key as akey, subkey, value as avalue from Input1) as a
+cross join Input2 as b
+select a.akey, a.subkey, b.subkey, b.value
+order by a.akey, a.subkey, b.subkey, b.value;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner.sql b/yql/essentials/tests/sql/suites/join/premap_common_inner.sql
new file mode 100644
index 0000000000..eab52d0662
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key, subkey, 1 as value from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, a.value, b.value
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.sql b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.sql
new file mode 100644
index 0000000000..7689cc7fa6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_both_sides.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key, subkey, 1 as value from Input1) as a
+join (select key, subkey, 2 as value from Input2) as b using(key)
+select a.key as key, a.subkey, a.value, b.subkey, b.value
+order by key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_filter-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.cfg b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.sql b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.sql
new file mode 100644
index 0000000000..24d54e5f9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_inner_filter.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key, subkey || key as subkey, value from Input1 where value != "ddd") as a
+join Input2 as b using(key)
+select a.key, a.subkey, b.value
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_left_cross-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_left_cross-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_left_cross-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_left_cross.cfg b/yql/essentials/tests/sql/suites/join/premap_common_left_cross.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_left_cross.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_left_cross.sql b/yql/essentials/tests/sql/suites/join/premap_common_left_cross.sql
new file mode 100644
index 0000000000..a7c8302df9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_left_cross.sql
@@ -0,0 +1,13 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+$one = (select key, 1 as subkey, value from Input1);
+$two = (select key, value from Input2);
+$three = (select key, value, 2 as subkey from Input3);
+
+from $one as a
+cross join $two as b
+left join $three as c on (c.key = a.key and c.value = b.value)
+select * order by a.key,a.subkey,b.key,b.value
+
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_multiparents-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents.cfg b/yql/essentials/tests/sql/suites/join/premap_common_multiparents.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents.sql b/yql/essentials/tests/sql/suites/join/premap_common_multiparents.sql
new file mode 100644
index 0000000000..e31ee06f4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents.sql
@@ -0,0 +1,15 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+$map = (select key, subkey, 1 as value, 2 as another from Input1);
+
+from $map as a
+join Input2 as b using(key)
+select a.key, a.value, b.value
+order by a.key,a.value;
+
+from $map as a
+join Input3 as b using(key)
+select a.key, a.value, a.subkey, b.value
+order by a.key,a.value;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.cfg b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.sql b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.sql
new file mode 100644
index 0000000000..e49c29fa42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_multiparents_no_premap.sql
@@ -0,0 +1,14 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+$map = (select key, subkey, 1 as value, 2 as another from Input1);
+
+from $map as a
+join Input2 as b using(key)
+select a.key, a.value, b.value
+order by a.key,a.value;
+
+from $map as a
+select a.key, a.value, a.subkey
+order by a.key,a.value;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.cfg b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.sql b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.sql
new file mode 100644
index 0000000000..1bd47b60a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_right_tablecontent.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+
+$keys = (select key from Input3);
+
+from (select key, value, key IN $keys as flag from Input1) as a
+right join (select key, key IN $keys as flag from Input2) as b using(key)
+select a.key, a.value, a.flag, b.flag
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_semi-off.cfg b/yql/essentials/tests/sql/suites/join/premap_common_semi-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_semi-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_semi.cfg b/yql/essentials/tests/sql/suites/join/premap_common_semi.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_semi.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_common_semi.sql b/yql/essentials/tests/sql/suites/join/premap_common_semi.sql
new file mode 100644
index 0000000000..343b8748b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_common_semi.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key, subkey as asubkey, value from Input1) as a
+left semi join (select key, 1 as value from Input2) as b using(key)
+select a.key, a.asubkey
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_context_dep-off.cfg b/yql/essentials/tests/sql/suites/join/premap_context_dep-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_context_dep-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_context_dep.cfg b/yql/essentials/tests/sql/suites/join/premap_context_dep.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_context_dep.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_context_dep.sql b/yql/essentials/tests/sql/suites/join/premap_context_dep.sql
new file mode 100644
index 0000000000..277a634626
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_context_dep.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+from (select key, subkey || key as subkey, value, TableRecordIndex() as tr from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, a.tr, b.value
+order by a.key, a.tr;
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_cross-off.cfg b/yql/essentials/tests/sql/suites/join/premap_map_cross-off.cfg
new file mode 100644
index 0000000000..287d1fa1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_cross-off.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_cross.cfg b/yql/essentials/tests/sql/suites/join/premap_map_cross.cfg
new file mode 100644
index 0000000000..88a5beef60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_cross.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_cross.sql b/yql/essentials/tests/sql/suites/join/premap_map_cross.sql
new file mode 100644
index 0000000000..75ec5b34cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_cross.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.MapJoinLimit="1m";
+
+from (select k1, v1, Just(1) as u1 from Input1) as a
+cross join (select k2, v2, Just(2) as u2 from Input2) as b
+select *
+order by a.k1,b.k2,a.v1,b.v2;
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_inner-off.cfg b/yql/essentials/tests/sql/suites/join/premap_map_inner-off.cfg
new file mode 100644
index 0000000000..287d1fa1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_inner-off.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_inner.cfg b/yql/essentials/tests/sql/suites/join/premap_map_inner.cfg
new file mode 100644
index 0000000000..88a5beef60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_inner.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_inner.sql b/yql/essentials/tests/sql/suites/join/premap_map_inner.sql
new file mode 100644
index 0000000000..737b8a2de0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_inner.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.MapJoinLimit="1m";
+
+from (select k1, v1 as u1 from Input1) as a
+join (select k2, v2 as u2 from Input2) as b on a.k1 = b.k2
+select a.k1,a.u1,b.u2
+order by a.k1,a.u1;
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_semi-off.cfg b/yql/essentials/tests/sql/suites/join/premap_map_semi-off.cfg
new file mode 100644
index 0000000000..287d1fa1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_semi-off.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_semi.cfg b/yql/essentials/tests/sql/suites/join/premap_map_semi.cfg
new file mode 100644
index 0000000000..88a5beef60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_semi.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_map_semi.sql b/yql/essentials/tests/sql/suites/join/premap_map_semi.sql
new file mode 100644
index 0000000000..c8ea1a1ef8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_map_semi.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.MapJoinLimit="1m";
+
+from (select k1, v1 || u1 as v1 from Input1) as a
+left semi join (select k2, u2 || v2 as u2 from Input2) as b on a.k1 = b.k2
+select *
+order by a.k1,a.v1;
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1-off.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1-off.cfg
new file mode 100644
index 0000000000..01597c0916
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1-off.cfg
@@ -0,0 +1,4 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.cfg
new file mode 100644
index 0000000000..3ea969d8b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.cfg
@@ -0,0 +1,2 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.sql b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.sql
new file mode 100644
index 0000000000..46cc25e42e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort1.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+
+SELECT pd.Text, pd.PhraseID, m2.BaseNo
+ FROM Input2 as m2
+ INNER JOIN (select PhraseID, BaseNo, True as Text from Input1) as pd
+ USING (BaseNo, PhraseID)
+ORDER BY pd.PhraseID, m2.BaseNo;
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2-off.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2-off.cfg
new file mode 100644
index 0000000000..01597c0916
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2-off.cfg
@@ -0,0 +1,4 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.cfg
new file mode 100644
index 0000000000..3ea969d8b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.cfg
@@ -0,0 +1,2 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.sql b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.sql
new file mode 100644
index 0000000000..b8d4f8e5f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_extrasort2.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+
+SELECT pd.Text, m2.BannerID
+ FROM (select BaseNo, PhraseID, 100 as BannerID from Input2) as m2
+ INNER JOIN (select PhraseID, BaseNo, 999 as Text from Input1) as pd
+ USING (BaseNo, PhraseID)
+ORDER BY pd.Text, m2.BannerID;
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_inner-off.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_inner-off.cfg
new file mode 100644
index 0000000000..287d1fa1ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_inner-off.cfg
@@ -0,0 +1,5 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_inner.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_inner.cfg
new file mode 100644
index 0000000000..88a5beef60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_inner.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv2.txt
+in Input3 sorted_by_kv3.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_inner.sql b/yql/essentials/tests/sql/suites/join/premap_merge_inner.sql
new file mode 100644
index 0000000000..2557b94ac4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_inner.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+
+from (select k1, v1 as u1 from Input1) as a
+join (select k2, v2 as u2 from Input2) as b on a.k1 = b.k2
+select a.k1,a.u1,b.u2
+order by a.k1,a.u1;
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_with_remap-off.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap-off.cfg
new file mode 100644
index 0000000000..01597c0916
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap-off.cfg
@@ -0,0 +1,4 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.cfg b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.cfg
new file mode 100644
index 0000000000..3ea969d8b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.cfg
@@ -0,0 +1,2 @@
+in Input1 mergejoin_input1.txt
+in Input2 mergejoin_input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.sql b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.sql
new file mode 100644
index 0000000000..6a582ffa76
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_merge_with_remap.sql
@@ -0,0 +1,17 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+pragma yt.JoinMergeTablesLimit="10";
+pragma yt.JoinMergeUnsortedFactor="3.0";
+
+INSERT INTO @inp2
+SELECT * FROM Input2
+ORDER BY BaseNo DESC;
+
+COMMIT;
+
+SELECT pd.BaseNo, m2.PhraseID, m2.Extra
+ FROM Input1 as pd
+ LEFT JOIN (select BaseNo, PhraseID, 1 as Extra from @inp2) as m2
+ USING (BaseNo, PhraseID)
+ORDER BY pd.BaseNo, m2.PhraseID, m2.Extra;
diff --git a/yql/essentials/tests/sql/suites/join/premap_no_premap-off.cfg b/yql/essentials/tests/sql/suites/join/premap_no_premap-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_no_premap-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_no_premap.cfg b/yql/essentials/tests/sql/suites/join/premap_no_premap.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_no_premap.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_no_premap.sql b/yql/essentials/tests/sql/suites/join/premap_no_premap.sql
new file mode 100644
index 0000000000..533fa758ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_no_premap.sql
@@ -0,0 +1,27 @@
+PRAGMA DisableSimpleColumns;
+PRAGMA DisablePullUpFlatMapOverJoin;
+use plato;
+
+-- not renaming
+from (select key, subkey || key as subkey, value from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, b.value
+order by a.key;
+
+-- not fixed size
+from (select key, "aaa" as subkey, value from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, b.value
+order by a.key;
+
+-- to many Justs
+from (select key, Just(Just(1)) as subkey, value from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, b.value
+order by a.key;
+
+-- container
+from (select key, AsTuple(1) as subkey, value from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, b.value
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap-off.cfg b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.cfg b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.sql b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.sql
new file mode 100644
index 0000000000..0163d931ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/premap_nonseq_flatmap.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+$hashes = (
+ SELECT multiplier AS hash
+ FROM (SELECT ListFromRange(0, 3) AS multiplier)
+ FLATTEN BY multiplier
+);
+
+SELECT * FROM Input1 AS a CROSS JOIN $hashes AS h
+ORDER BY a.key,a.subkey,h.hash;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_context_dep-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_context_dep-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_context_dep-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_context_dep.cfg b/yql/essentials/tests/sql/suites/join/pullup_context_dep.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_context_dep.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_context_dep.sql b/yql/essentials/tests/sql/suites/join/pullup_context_dep.sql
new file mode 100644
index 0000000000..5c8b94fc25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_context_dep.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value, TablePath() as tp from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, a.tp, b.value
+order by a.key, a.tp;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_cross-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_cross-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_cross-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_cross.cfg b/yql/essentials/tests/sql/suites/join/pullup_cross.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_cross.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_cross.sql b/yql/essentials/tests/sql/suites/join/pullup_cross.sql
new file mode 100644
index 0000000000..7b5f75f0ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_cross.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value || "v" as value from Input1) as a
+cross join Input2 as b
+select a.key, a.subkey, b.subkey, b.value
+order by a.key, a.subkey, b.subkey, b.value;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_exclusion-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_exclusion-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_exclusion-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_exclusion.cfg b/yql/essentials/tests/sql/suites/join/pullup_exclusion.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_exclusion.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_exclusion.sql b/yql/essentials/tests/sql/suites/join/pullup_exclusion.sql
new file mode 100644
index 0000000000..b865107bbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_exclusion.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value from Input1) as a
+exclusion join (select key || subkey as subkey, key, 1 as value from Input2) as b on a.key = b.key
+select a.key as akey, b.key as bkey, a.subkey, b.subkey, b.value
+order by akey;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_inner-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_inner-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_inner-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_inner.cfg b/yql/essentials/tests/sql/suites/join/pullup_inner.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_inner.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_inner.sql b/yql/essentials/tests/sql/suites/join/pullup_inner.sql
new file mode 100644
index 0000000000..097302e12e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_inner.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value from Input1) as a
+join (select key || subkey as subkey, key, 1 as value from Input2) as b on a.key = b.key
+select a.key as akey, b.key as bkey, a.subkey, b.subkey, b.value
+order by akey;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_left-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left.cfg b/yql/essentials/tests/sql/suites/join/pullup_left.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left.sql b/yql/essentials/tests/sql/suites/join/pullup_left.sql
new file mode 100644
index 0000000000..1784fea6cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value from Input1) as a
+left join (select key || subkey as subkey, key, 1 as value from Input2) as b on a.key = b.key
+select a.key as akey, b.key as bkey, a.subkey, b.subkey, b.value
+order by akey;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left_semi-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_left_semi-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left_semi-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left_semi.cfg b/yql/essentials/tests/sql/suites/join/pullup_left_semi.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left_semi.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_left_semi.sql b/yql/essentials/tests/sql/suites/join/pullup_left_semi.sql
new file mode 100644
index 0000000000..feeec671b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_left_semi.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value from Input1) as a
+left semi join (select key || subkey as subkey, key, 1 as value from Input2) as b on a.key = b.key
+select a.key as akey, a.subkey
+order by akey;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_null_column-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_null_column-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_null_column-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_null_column.cfg b/yql/essentials/tests/sql/suites/join/pullup_null_column.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_null_column.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_null_column.sql b/yql/essentials/tests/sql/suites/join/pullup_null_column.sql
new file mode 100644
index 0000000000..d7a5c88783
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_null_column.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from Input1 as a
+left join (select key, null as subkey, 1 as value from Input2) as b on a.key = b.key
+select a.key as akey, b.key as bkey, a.subkey, b.subkey, b.value
+order by akey;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_random-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_random-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_random-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_random.cfg b/yql/essentials/tests/sql/suites/join/pullup_random.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_random.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_random.sql b/yql/essentials/tests/sql/suites/join/pullup_random.sql
new file mode 100644
index 0000000000..f884b2d8fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_random.sql
@@ -0,0 +1,8 @@
+/* kikimr can not - due to random */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value, RANDOM(value || "x") <= 1.0 as rn from Input1) as a
+join Input2 as b using(key)
+select a.key, a.subkey, a.rn, b.value
+order by a.key, a.rn;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_renaming-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_renaming-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_renaming-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_renaming.cfg b/yql/essentials/tests/sql/suites/join/pullup_renaming.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_renaming.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_renaming.sql b/yql/essentials/tests/sql/suites/join/pullup_renaming.sql
new file mode 100644
index 0000000000..0f13acd39f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_renaming.sql
@@ -0,0 +1,8 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key as akey1, key as akey2, subkey || key as subkey, value from Input1) as a
+left join (select key || subkey as subkey, key as bkey1, key as bkey2, 1 as value from Input2) as b
+on a.akey1 = b.bkey1 and a.akey1 = b.bkey2 and a.akey2 = b.bkey1
+select a.akey1 as akey1, b.bkey1 as bkey1, a.subkey, b.subkey, b.value
+order by akey1, bkey1;
diff --git a/yql/essentials/tests/sql/suites/join/pullup_rownumber-off.cfg b/yql/essentials/tests/sql/suites/join/pullup_rownumber-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_rownumber-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pullup_rownumber.cfg b/yql/essentials/tests/sql/suites/join/pullup_rownumber.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_rownumber.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pullup_rownumber.sql b/yql/essentials/tests/sql/suites/join/pullup_rownumber.sql
new file mode 100644
index 0000000000..a40f65b939
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pullup_rownumber.sql
@@ -0,0 +1,7 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from (select key, subkey || key as subkey, value, ROW_NUMBER() over w as rn from Input1 window w as ()) as a
+join Input2 as b using(key)
+select a.key, a.subkey, a.rn, b.value
+order by a.key, a.rn;
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict-off.cfg b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.cfg b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.sql b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.sql
new file mode 100644
index 0000000000..e6fd2ce9af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_assume_strict.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+-- should pushdown
+select * from Input1 as a inner join Input2 as b on a.key = b.key where AssumeStrict(Unwrap(cast(a.key as Int32))) > 100 order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg
new file mode 100644
index 0000000000..75143a2d4b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+in Input2 input2.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql
new file mode 100644
index 0000000000..12ab5e8f6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+-- should pushdown
+select * from Input1 as a inner join Input2 as b on a.key = b.key where Math::IsFinite(cast(a.key as Double)) order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left-off.cfg b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.cfg b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.sql b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.sql
new file mode 100644
index 0000000000..d5b8567576
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/pushdown_filter_over_left.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+-- should pushdown
+select * from Input1 as a left join Input2 as b on a.key = b.key where Unwrap(cast(a.key as Int32)) > 100 order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/right_trivial-off.cfg b/yql/essentials/tests/sql/suites/join/right_trivial-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/right_trivial-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/right_trivial.cfg b/yql/essentials/tests/sql/suites/join/right_trivial.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/right_trivial.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/right_trivial.sql b/yql/essentials/tests/sql/suites/join/right_trivial.sql
new file mode 100644
index 0000000000..d63d52b615
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/right_trivial.sql
@@ -0,0 +1,5 @@
+PRAGMA DisableSimpleColumns;
+select coalesce(Input1.key, "_null") as a, coalesce(Input1.subkey, "_null") as b, coalesce(Input3.value, "_null") as c
+from plato.Input1
+right join plato.Input3 using (key)
+order by a, b, c; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/root.txt b/yql/essentials/tests/sql/suites/join/root.txt
new file mode 100644
index 0000000000..fc60ef431f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/root.txt
@@ -0,0 +1,20 @@
+{"key"=023u;"leaf"=3u;"branch"=10u;"value"="xxx"};
+{"key"=037u;"leaf"=5u;"branch"=#;"value"="ddd"};
+{"key"=075u;"leaf"=1u;"branch"=#;"value"="abc"};
+{"key"=150u;"leaf"=1u;"branch"=19u;"value"="aaa"};
+{"key"=150u;"leaf"=#;"branch"=18u;"value"="iii"};
+{"key"=150u;"leaf"=8u;"branch"=12u;"value"="zzz"};
+{"key"=200u;"leaf"=7u;"branch"=11u;"value"=#};
+{"key"=200u;"leaf"=7u;"branch"=11u;"value"=#};
+{"key"=666u;"leaf"=#;"branch"=#;"value"="bad"};
+{"key"=777u;"leaf"=2u;"branch"=#;"value"="lol"};
+{"key"=888u;"leaf"=#;"branch"=14u;"value"="dad"};
+{"key"=527u;"leaf"=#;"branch"=11u;"value"="bbb"};
+{"key"=761u;"leaf"=6u;"branch"=13u;"value"="ccc"};
+{"key"=911u;"leaf"=#;"branch"=17u;"value"=#};
+{"key"=999u;"leaf"=90u;"branch"=10u;"value"="not"};
+{"key"=090u;"leaf"=4u;"branch"=15u;"value"="ups"};
+{"key"=090u;"leaf"=4u;"branch"=15u;"value"="ups"};
+{"key"=111u;"leaf"=100u;"branch"=19u;"value"="jjj"};
+{"key"=222u;"leaf"=9u;"branch"=100u;"value"="ttt"};
+{"key"=000u;"leaf"=100u;"branch"=100u;"value"="000"};
diff --git a/yql/essentials/tests/sql/suites/join/root.txt.attr b/yql/essentials/tests/sql/suites/join/root.txt.attr
new file mode 100644
index 0000000000..8cfa8bc1a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/root.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["leaf";["OptionalType";["DataType";"Uint64"]]];
+ ["branch";["OptionalType";["DataType";"Uint64"]]];
+ ["value";["OptionalType";["DataType";"String"]]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted-off.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted-off.cfg
new file mode 100644
index 0000000000..579f91d547
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted-off.cfg
@@ -0,0 +1,4 @@
+in Input sorted_uniq.txt
+
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.cfg
new file mode 100644
index 0000000000..e6665422d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted_uniq.txt
+
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.sql b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.sql
new file mode 100644
index 0000000000..dc33eadc98
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select * from plato.Input as a inner join plato.Input as b on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-off.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-off.cfg
new file mode 100644
index 0000000000..579f91d547
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-off.cfg
@@ -0,0 +1,4 @@
+in Input sorted_uniq.txt
+
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-replicate.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-replicate.cfg
new file mode 100644
index 0000000000..1aa0bdd86e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter-replicate.cfg
@@ -0,0 +1,6 @@
+in Input sorted_uniq.txt
+
+providers dq
+pragma dq.HashJoinMode="off";
+pragma dq.SplitStageOnDqReplicate="false";
+pragma dq.SpillingEngine="disable";
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.cfg
new file mode 100644
index 0000000000..e6665422d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.cfg
@@ -0,0 +1,2 @@
+in Input sorted_uniq.txt
+
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.sql b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.sql
new file mode 100644
index 0000000000..7134d1c830
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_filter.sql
@@ -0,0 +1,4 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+$in = (select * from plato.Input where key > "100");
+select * from $in as a inner join $in as b on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename-off.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename-off.cfg
new file mode 100644
index 0000000000..579f91d547
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename-off.cfg
@@ -0,0 +1,4 @@
+in Input sorted_uniq.txt
+
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.cfg b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.cfg
new file mode 100644
index 0000000000..e6665422d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.cfg
@@ -0,0 +1,2 @@
+in Input sorted_uniq.txt
+
diff --git a/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.sql b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.sql
new file mode 100644
index 0000000000..51746196d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/selfjoin_on_sorted_with_rename.sql
@@ -0,0 +1,2 @@
+PRAGMA DisableSimpleColumns;
+select a.key as key, b.subkey as subkey, b.value as value from plato.Input as a inner join plato.Input as b on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/join/simple_columns_partial-off.cfg b/yql/essentials/tests/sql/suites/join/simple_columns_partial-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/simple_columns_partial-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/simple_columns_partial.cfg b/yql/essentials/tests/sql/suites/join/simple_columns_partial.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/simple_columns_partial.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/simple_columns_partial.sql b/yql/essentials/tests/sql/suites/join/simple_columns_partial.sql
new file mode 100644
index 0000000000..da45ff2766
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/simple_columns_partial.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+use plato;
+pragma SimpleColumns;
+
+SELECT *
+FROM `Input2` AS a
+LEFT SEMI JOIN `Input3` AS b
+ON a.value == b.value;
+
+SELECT *
+FROM `Input2` AS a
+LEFT ONLY JOIN `Input3` AS b
+ON a.value == b.value;
+
+SELECT *
+FROM `Input2` AS a
+RIGHT SEMI JOIN `Input3` AS b
+ON a.value == b.value;
+
+SELECT *
+FROM `Input2` AS a
+RIGHT ONLY JOIN `Input3` AS b
+ON a.value == b.value;
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt b/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt
new file mode 100644
index 0000000000..5da1f87a4d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt
@@ -0,0 +1,3 @@
+{"k1"="bbb";"v1"="v11"};
+{"k1"="ccc";"v1"="v12"};
+{"k1"="ddd";"v1"="v13"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt.attr
new file mode 100644
index 0000000000..9cef99eb90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_k1.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt b/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt
new file mode 100644
index 0000000000..96a4c1b787
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt
@@ -0,0 +1,3 @@
+{"k2"="ccc";"v2"="v21"};
+{"k2"="ddd";"v2"="v22"};
+{"k2"="eee";"v2"="v23"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt.attr
new file mode 100644
index 0000000000..39faeeb22c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_k2.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt b/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt
new file mode 100644
index 0000000000..6a547a4465
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt
@@ -0,0 +1,3 @@
+{"key"="aaa";"value"="a11"};
+{"key"="bbb";"value"="a12"};
+{"key"="ccc";"value"="a13"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt.attr
new file mode 100644
index 0000000000..852ba949fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key1.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "key";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt b/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt
new file mode 100644
index 0000000000..f902c54666
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt
@@ -0,0 +1,3 @@
+{"key"="bbb";"value"="a21"};
+{"key"="ccc";"value"="a22"};
+{"key"="ddd";"value"="a23"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt.attr
new file mode 100644
index 0000000000..852ba949fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key2.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "key";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt b/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt
new file mode 100644
index 0000000000..57cd6157f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt
@@ -0,0 +1,3 @@
+{"key"="aaa";"value"="b11"};
+{"key"="ccc";"value"="b12"};
+{"key"="ddd";"value"="b13"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt.attr
new file mode 100644
index 0000000000..852ba949fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key3.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "key";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt b/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt
new file mode 100644
index 0000000000..27a6a9b1bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt
@@ -0,0 +1,3 @@
+{"key"="ccc";"value"="b21"};
+{"key"="ddd";"value"="b22"};
+{"key"="eee";"value"="b23"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt.attr
new file mode 100644
index 0000000000..852ba949fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key4.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "key";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt b/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt
new file mode 100644
index 0000000000..0eca8aa4bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt
@@ -0,0 +1,3 @@
+{"key"="aaa";"subkey"="bbb";"value"="ks1"};
+{"key"="bbb";"subkey"="bbb";"value"="ks2"};
+{"key"="bbb";"subkey"="ccc";"value"="ks3"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt.attr
new file mode 100644
index 0000000000..1752b0ee6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_key_subkey.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "key";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt
new file mode 100644
index 0000000000..d8ba8879fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt
@@ -0,0 +1,4 @@
+{"k1"="aaa";"v1"="v11";"u1"="u11"};
+{"k1"="bbb";"v1"="v12";"u1"="u12"};
+{"k1"="ccc";"v1"="v13";"u1"="u13"};
+{"k1"="ddd";"v1"="v14";"u1"="u14"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt.attr
new file mode 100644
index 0000000000..4185224ec0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt
new file mode 100644
index 0000000000..7d1d077ae0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt
@@ -0,0 +1,10 @@
+{"k1"="aaa";"v1"="v11";"u1"="u11"};
+{"k1"="bbb";"v1"="v12";"u1"="u12"};
+{"k1"="ccc";"v1"="v13";"u1"="u13"};
+{"k1"="ddd";"v1"="v14";"u1"="u14"};
+{"k1"="eee";"v1"="v15";"u1"="u15"};
+{"k1"="fff";"v1"="v16";"u1"="u16"};
+{"k1"="ggg";"v1"="v17";"u1"="u17"};
+{"k1"="hhh";"v1"="v18";"u1"="u18"};
+{"k1"="iii";"v1"="v19";"u1"="u19"};
+{"k1"="jjj";"v1"="v20";"u1"="u20"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt.attr
new file mode 100644
index 0000000000..4185224ec0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_1.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt
new file mode 100644
index 0000000000..b51b68a8f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt
@@ -0,0 +1,8 @@
+{"k1"="aaa";"v1"="v11";"u1"="u11"};
+{"k1"="aaa";"v1"="v15";"u1"="u15"};
+{"k1"="bbb";"v1"="v12";"u1"="u12"};
+{"k1"="bbb";"v1"="v16";"u1"="u16"};
+{"k1"="ccc";"v1"="v13";"u1"="u13"};
+{"k1"="ccc";"v1"="v17";"u1"="u17"};
+{"k1"="ddd";"v1"="v14";"u1"="u14"};
+{"k1"="ddd";"v1"="v18";"u1"="u18"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt.attr
new file mode 100644
index 0000000000..4185224ec0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_dup.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt
new file mode 100644
index 0000000000..647c550221
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt
@@ -0,0 +1,5 @@
+{"k1"=#; "v1"="v10";"u1"="u10"};
+{"k1"="aaa";"v1"="v11";"u1"="u11"};
+{"k1"="bbb";"v1"="v12";"u1"="u12"};
+{"k1"="ccc";"v1"="v13";"u1"="u13"};
+{"k1"="ddd";"v1"="v14";"u1"="u14"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt.attr
new file mode 100644
index 0000000000..aee2f17230
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_opt.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt
new file mode 100644
index 0000000000..d8ba8879fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt
@@ -0,0 +1,4 @@
+{"k1"="aaa";"v1"="v11";"u1"="u11"};
+{"k1"="bbb";"v1"="v12";"u1"="u12"};
+{"k1"="ccc";"v1"="v13";"u1"="u13"};
+{"k1"="ddd";"v1"="v14";"u1"="u14"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt.attr
new file mode 100644
index 0000000000..6059c56833
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv1_unique.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %true
+ >
+ [
+ {
+ "name" = "k1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt
new file mode 100644
index 0000000000..33b04d59da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt
@@ -0,0 +1,3 @@
+{"k2"="bbb";"v2"="v21";"u2"="u21"};
+{"k2"="ccc";"v2"="v22";"u2"="u22"};
+{"k2"="ddd";"v2"="v23";"u2"="u23"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt.attr
new file mode 100644
index 0000000000..387ceb1b55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt
new file mode 100644
index 0000000000..80a400c3e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt
@@ -0,0 +1,6 @@
+{"k2"="bbb";"v2"="v21";"u2"="u21"};
+{"k2"="bbb";"v2"="v24";"u2"="u24"};
+{"k2"="ccc";"v2"="v22";"u2"="u22"};
+{"k2"="ccc";"v2"="v25";"u2"="u25"};
+{"k2"="ddd";"v2"="v23";"u2"="u23"};
+{"k2"="ddd";"v2"="v26";"u2"="u26"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt.attr
new file mode 100644
index 0000000000..387ceb1b55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_dup.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt.attr
new file mode 100644
index 0000000000..387ceb1b55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_empty.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt
new file mode 100644
index 0000000000..817b066cf5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt
@@ -0,0 +1,3 @@
+{"k2"=#; "v2"=#; "u2"="u20"};
+{"k2"="bbb";"v2"="v21";"u2"="u21"};
+{"k2"="ccc";"v2"="v22";"u2"="u22"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt.attr
new file mode 100644
index 0000000000..d10189b748
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv2_opt.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k2";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v2";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt b/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt
new file mode 100644
index 0000000000..13d78d00ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt
@@ -0,0 +1,3 @@
+{"k3"="ccc";"v3"="v31";"u3"="u31"};
+{"k3"="ddd";"v3"="v32";"u3"="u32"};
+{"k3"="eee";"v3"="v33";"u3"="u33"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt.attr
new file mode 100644
index 0000000000..3b51f7ab03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_by_kv3.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "k3";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "v3";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u3";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq.txt b/yql/essentials/tests/sql/suites/join/sorted_uniq.txt
new file mode 100644
index 0000000000..3aa17b8d65
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq.txt
@@ -0,0 +1,8 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_uniq.txt.attr
new file mode 100644
index 0000000000..3cbe9af3fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key";];
+ "SortedByTypes"=[["DataType";"String";];];
+ "SortMembers"=["key";];
+ "UniqueKeys"=%true;
+}}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt b/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt
new file mode 100644
index 0000000000..e84b5f77d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt
@@ -0,0 +1,14 @@
+{"key"="023";"subkey"="1";"value"="aaa"};
+{"key"="037";"subkey"="120";"value"="aab"};
+{"key"="075";"subkey"="150";"value"="abc"};
+{"key"="150";"subkey"="2";"value"="bbb"};
+{"key"="200";"subkey"="3";"value"="ccc"};
+{"key"="527";"subkey"="4";"value"="ddd"};
+{"key"="761";"subkey"="527";"value"="kkk"};
+{"key"="911";"subkey"="761";"value"="qqq"};
+{"key"="912";"subkey"="762";"value"="qqr"};
+{"key"="913";"subkey"="763";"value"="qqs"};
+{"key"="914";"subkey"="764";"value"="qqt"};
+{"key"="915";"subkey"="765";"value"="qqu"};
+{"key"="916";"subkey"="766";"value"="qqv"};
+{"key"="917";"subkey"="767";"value"="qqw"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt.attr
new file mode 100644
index 0000000000..fad1fb2801
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq1.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["subkey";"value"];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["subkey";"value"];
+ "UniqueKeys"=%true;
+}}
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt b/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt
new file mode 100644
index 0000000000..e84b5f77d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt
@@ -0,0 +1,14 @@
+{"key"="023";"subkey"="1";"value"="aaa"};
+{"key"="037";"subkey"="120";"value"="aab"};
+{"key"="075";"subkey"="150";"value"="abc"};
+{"key"="150";"subkey"="2";"value"="bbb"};
+{"key"="200";"subkey"="3";"value"="ccc"};
+{"key"="527";"subkey"="4";"value"="ddd"};
+{"key"="761";"subkey"="527";"value"="kkk"};
+{"key"="911";"subkey"="761";"value"="qqq"};
+{"key"="912";"subkey"="762";"value"="qqr"};
+{"key"="913";"subkey"="763";"value"="qqs"};
+{"key"="914";"subkey"="764";"value"="qqt"};
+{"key"="915";"subkey"="765";"value"="qqu"};
+{"key"="916";"subkey"="766";"value"="qqv"};
+{"key"="917";"subkey"="767";"value"="qqw"};
diff --git a/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt.attr b/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt.attr
new file mode 100644
index 0000000000..09cc6be90d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/sorted_uniq2.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key"];
+ "SortedByTypes"=[["DataType";"String";]];
+ "SortMembers"=["key";];
+ "UniqueKeys"=%true;
+}}
diff --git a/yql/essentials/tests/sql/suites/join/spider_info.txt b/yql/essentials/tests/sql/suites/join/spider_info.txt
new file mode 100644
index 0000000000..f8c75fb66e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/spider_info.txt
@@ -0,0 +1,8 @@
+{"key"="1.1.1.1";"subkey"="RESULT";"value"="http://www.foo.bar/wtf"};
+{"key"="1.1.1.1";"subkey"="RESULT";"value"="http://www.foo.bar/spam"};
+{"key"="1.1.1.1";"subkey"="BAN_DETECTED";"value"="http://www.foo.bar/spam"};
+{"key"="2.2.2.2";"subkey"="RESULT";"value"="http://www.spam.ru/foo"};
+{"key"="2.2.2.2";"subkey"="BAN_DETECTED";"value"="http://www.spam.ru/foo"};
+{"key"="2.2.2.2";"subkey"="RESULT";"value"="http://www.spam.ru/bar"};
+{"key"="2.2.2.2";"subkey"="BAN_DETECTED";"value"="http://www.spam.ru/bar"};
+{"key"="2.2.2.2";"subkey"="RESULT";"value"="http://www.yandex.ru/wat"};
diff --git a/yql/essentials/tests/sql/suites/join/split_to_list_as_key-off.cfg b/yql/essentials/tests/sql/suites/join/split_to_list_as_key-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/split_to_list_as_key-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/split_to_list_as_key.cfg b/yql/essentials/tests/sql/suites/join/split_to_list_as_key.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/split_to_list_as_key.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/split_to_list_as_key.sql b/yql/essentials/tests/sql/suites/join/split_to_list_as_key.sql
new file mode 100644
index 0000000000..64be5ae083
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/split_to_list_as_key.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+from Input1 as a
+join Input2 as b on a.key = String::SplitToList(b.key, "_")[0]
+select * order by a.key,a.subkey,b.subkey
diff --git a/yql/essentials/tests/sql/suites/join/star_join-off.cfg b/yql/essentials/tests/sql/suites/join/star_join-off.cfg
new file mode 100644
index 0000000000..64e0857bc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join-off.cfg
@@ -0,0 +1,7 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join.cfg b/yql/essentials/tests/sql/suites/join/star_join.cfg
new file mode 100644
index 0000000000..a884c15308
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join.sql b/yql/essentials/tests/sql/suites/join/star_join.sql
new file mode 100644
index 0000000000..19c7c910ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+
+$rightSemi = select * from Input2 as b right semi join Input1 as a on a.v1 = b.v2 and a.k1 = b.k2;
+$leftOnly = select * from $rightSemi as rs left only join Input3 as c on rs.k1 = c.k3 and rs.v1 = c.v3;
+$right = select * from Input4 as d right join $leftOnly as lo on d.v4 = lo.v1 and lo.k1 = d.k4;
+$inner = select * from $right as r join any Input5 as e on r.k1 = e.k5 and e.v5 = r.v1;
+
+select * from $inner order by u1,u5;
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners-off.cfg
new file mode 100644
index 0000000000..7859898010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners.cfg
new file mode 100644
index 0000000000..086641db8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners.sql b/yql/essentials/tests/sql/suites/join/star_join_inners.sql
new file mode 100644
index 0000000000..9396fe8f6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+from any Input2 as b
+join any Input1 as a on b.k2 = a.k1 and a.v1 = b.v2
+join any Input3 as c on a.k1 = c.k3 and c.v3 = a.v1
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_premap-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners_premap-off.cfg
new file mode 100644
index 0000000000..7859898010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_premap-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_premap.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners_premap.cfg
new file mode 100644
index 0000000000..086641db8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_premap.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_premap.sql b/yql/essentials/tests/sql/suites/join/star_join_inners_premap.sql
new file mode 100644
index 0000000000..4cf67ca9ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_premap.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+pragma DisablePullUpFlatMapOverJoin;
+
+$a = select k1,v1,u1, 1 as t1 from Input1;
+$c = select k3,v3,u3, 3 as t3 from Input3;
+
+from any Input2 as b
+join any $a as a on b.k2 = a.k1 and a.v1 = b.v2
+join any $c as c on a.k1 = c.k3 and c.v3 = a.v1
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted-off.cfg
new file mode 100644
index 0000000000..45c529ffa9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted-off.cfg
@@ -0,0 +1,5 @@
+in Input1 vk1_sorted.txt
+in Input2 vk2_sorted.txt
+in Input3 vk3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.cfg b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.cfg
new file mode 100644
index 0000000000..354c0f1d8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.cfg
@@ -0,0 +1,3 @@
+in Input1 vk1_sorted.txt
+in Input2 vk2_sorted.txt
+in Input3 vk3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.sql b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.sql
new file mode 100644
index 0000000000..9396fe8f6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_inners_vk_sorted.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+from any Input2 as b
+join any Input1 as a on b.k2 = a.k1 and a.v1 = b.v2
+join any Input3 as c on a.k1 = c.k3 and c.v3 = a.v1
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_mirror-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_mirror-off.cfg
new file mode 100644
index 0000000000..64e0857bc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_mirror-off.cfg
@@ -0,0 +1,7 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_mirror.cfg b/yql/essentials/tests/sql/suites/join/star_join_mirror.cfg
new file mode 100644
index 0000000000..a884c15308
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_mirror.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_mirror.sql b/yql/essentials/tests/sql/suites/join/star_join_mirror.sql
new file mode 100644
index 0000000000..8aaf6431b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_mirror.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+$leftSemi = select * from Input1 as a left semi join Input2 as b on b.k2 = a.k1 and a.v1 = b.v2;
+$rightOnly = select * from Input3 as c right only join $leftSemi as ls on ls.k1 = c.k3 and ls.v1 = c.v3;
+$left = select * from $rightOnly as ro left join Input4 as d on ro.v1 = d.v4 and d.k4 = ro.k1;
+$inner = select * from any Input5 as e join $left as l on e.k5 = l.k1 and l.v1 = e.v5;
+
+select * from $inner order by u1,u5;
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_multi-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_multi-off.cfg
new file mode 100644
index 0000000000..64e0857bc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_multi-off.cfg
@@ -0,0 +1,7 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_multi.cfg b/yql/essentials/tests/sql/suites/join/star_join_multi.cfg
new file mode 100644
index 0000000000..a884c15308
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_multi.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_multi.sql b/yql/essentials/tests/sql/suites/join/star_join_multi.sql
new file mode 100644
index 0000000000..b6553ce006
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_multi.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+
+-- first Star JOIN chain
+$rightSemi = select * from Input2 as b right semi join Input1 as a on a.v1 = b.v2 and a.k1 = b.k2;
+$leftOnly = select * from $rightSemi as rs left only join Input3 as c on rs.k1 = c.k3 and rs.v1 = c.v3;
+$right = select * from Input4 as d right join $leftOnly as lo on d.v4 = lo.v1 and lo.k1 = d.k4;
+$chain1 = select * from $right as r join any Input5 as e on r.k1 = e.k5 and e.v5 = r.v1;
+
+-- second Star JOIN chain (mirror reflection of first one)
+$leftSemi = select * from Input1 as a1 left semi join Input2 as b1 on b1.k2 = a1.k1 and a1.v1 = b1.v2;
+$rightOnly = select * from Input3 as c1 right only join $leftSemi as ls on ls.k1 = c1.k3 and ls.v1 = c1.v3;
+$left = select * from $rightOnly as ro left join Input4 as d1 on ro.v1 = d1.v4 and d1.k4 = ro.k1;
+$chain2 = select * from any Input5 as e1 join $left as l on e1.k5 = l.k1 and l.v1 = e1.v5;
+
+
+select left.k1 as k1, right.v1 as v1 from
+$chain1 as left join $chain2 as right on left.k1 = right.k1 and left.v1 = right.v1
+order by k1,v1;
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_semionly-off.cfg
new file mode 100644
index 0000000000..7859898010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly.cfg b/yql/essentials/tests/sql/suites/join/star_join_semionly.cfg
new file mode 100644
index 0000000000..086641db8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly.sql b/yql/essentials/tests/sql/suites/join/star_join_semionly.sql
new file mode 100644
index 0000000000..bd158ea86d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+from Input1 as a
+left semi join Input2 as b on a.k1 = b.k2
+left only join Input3 as c on a.k1 = c.k3
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly_premap-off.cfg b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap-off.cfg
new file mode 100644
index 0000000000..7859898010
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap-off.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.cfg b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.cfg
new file mode 100644
index 0000000000..086641db8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.cfg
@@ -0,0 +1,3 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.sql b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.sql
new file mode 100644
index 0000000000..370490c9fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_semionly_premap.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+pragma DisablePullUpFlatMapOverJoin;
+
+$a = select k1,v1,u1, 1 as t1 from Input1;
+$b = select k2,v2,u2, 2 as t2 from Input2;
+$c = select k3,v3,u3, 3 as t3 from Input3;
+
+from $a as a
+left semi join $b as b on a.k1 = b.k2
+left only join $c as c on a.k1 = c.k3
+select * order by u1
+
diff --git a/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.cfg b/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.cfg
new file mode 100644
index 0000000000..00227305fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.cfg
@@ -0,0 +1,5 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.sql b/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.sql
new file mode 100644
index 0000000000..94408a517e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/star_join_with_diff_complex_key.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+
+select *
+from Input1 as a
+join any Input2 as b on a.k1 = b.k2 AND a.v1 = b.v2
+join any Input3 as c on a.k1 = c.k3 AND a.v1 = c.v3
+left join Input4 as d on (c.v3, c.u3) = (d.v4, d.u4)
diff --git a/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.cfg b/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.cfg
new file mode 100644
index 0000000000..9a930ffe48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.cfg
@@ -0,0 +1,6 @@
+in Input1 kv1_sorted.txt
+in Input2 kv2_sorted.txt
+in Input3 kv3_sorted.txt
+in Input4 kv4_sorted.txt
+in Input5 kv5_sorted.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.sql b/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.sql
new file mode 100644
index 0000000000..4f2d3d932d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/starjoin_unused_keys.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+use plato;
+pragma yt.JoinEnableStarJoin="true";
+
+select
+
+v3
+
+from any Input1 as a
+join any Input2 as b on (a.k1 = b.k2 and a.v1 = b.v2)
+join any Input3 as c on (a.k1 = c.k3 and a.v1 = c.v3)
+join Input4 as d on (a.k1 = d.k4)
+order by v3;
diff --git a/yql/essentials/tests/sql/suites/join/strict_keys-off.cfg b/yql/essentials/tests/sql/suites/join/strict_keys-off.cfg
new file mode 100644
index 0000000000..e334c38f00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/strict_keys-off.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv1_opt.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/strict_keys.cfg b/yql/essentials/tests/sql/suites/join/strict_keys.cfg
new file mode 100644
index 0000000000..b54c86b56b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/strict_keys.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input1 sorted_by_kv1.txt
+in Input2 sorted_by_kv1_opt.txt
diff --git a/yql/essentials/tests/sql/suites/join/strict_keys.sql b/yql/essentials/tests/sql/suites/join/strict_keys.sql
new file mode 100644
index 0000000000..e9382fa7fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/strict_keys.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+define subquery $strict() as
+ pragma StrictJoinKeyTypes;
+ select count(*) from Input1 as a join Input2 as b using(k1)
+end define;
+
+select count(*) from Input1 as a join Input2 as b using(k1);
+select * from $strict();
diff --git a/yql/essentials/tests/sql/suites/join/table_funcs_spec_join.sqlx b/yql/essentials/tests/sql/suites/join/table_funcs_spec_join.sqlx
new file mode 100644
index 0000000000..05b06478d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/table_funcs_spec_join.sqlx
@@ -0,0 +1,9 @@
+/* postgres can not */
+use plato;
+
+--insert into Output
+select
+ TablePath() as table_path
+from Input as a join Input as b using(key)
+where a.key = '200'
+;
diff --git a/yql/essentials/tests/sql/suites/join/test_join_1.txt b/yql/essentials/tests/sql/suites/join/test_join_1.txt
new file mode 100644
index 0000000000..e6eac2eaa2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/test_join_1.txt
@@ -0,0 +1,1000 @@
+{"key"="1";"subkey"="1";"value"="999"};
+{"key"="2";"subkey"="4";"value"="998"};
+{"key"="3";"subkey"="9";"value"="997"};
+{"key"="4";"subkey"="16";"value"="996"};
+{"key"="5";"subkey"="25";"value"="995"};
+{"key"="6";"subkey"="36";"value"="994"};
+{"key"="7";"subkey"="49";"value"="993"};
+{"key"="8";"subkey"="64";"value"="992"};
+{"key"="9";"subkey"="81";"value"="991"};
+{"key"="10";"subkey"="100";"value"="990"};
+{"key"="11";"subkey"="121";"value"="989"};
+{"key"="12";"subkey"="144";"value"="988"};
+{"key"="13";"subkey"="169";"value"="987"};
+{"key"="14";"subkey"="196";"value"="986"};
+{"key"="15";"subkey"="225";"value"="985"};
+{"key"="16";"subkey"="256";"value"="984"};
+{"key"="17";"subkey"="289";"value"="983"};
+{"key"="18";"subkey"="324";"value"="982"};
+{"key"="19";"subkey"="361";"value"="981"};
+{"key"="20";"subkey"="400";"value"="980"};
+{"key"="21";"subkey"="441";"value"="979"};
+{"key"="22";"subkey"="484";"value"="978"};
+{"key"="23";"subkey"="529";"value"="977"};
+{"key"="24";"subkey"="576";"value"="976"};
+{"key"="25";"subkey"="625";"value"="975"};
+{"key"="26";"subkey"="676";"value"="974"};
+{"key"="27";"subkey"="729";"value"="973"};
+{"key"="28";"subkey"="784";"value"="972"};
+{"key"="29";"subkey"="841";"value"="971"};
+{"key"="30";"subkey"="900";"value"="970"};
+{"key"="31";"subkey"="961";"value"="969"};
+{"key"="32";"subkey"="1024";"value"="968"};
+{"key"="33";"subkey"="1089";"value"="967"};
+{"key"="34";"subkey"="1156";"value"="966"};
+{"key"="35";"subkey"="1225";"value"="965"};
+{"key"="36";"subkey"="1296";"value"="964"};
+{"key"="37";"subkey"="1369";"value"="963"};
+{"key"="38";"subkey"="1444";"value"="962"};
+{"key"="39";"subkey"="1521";"value"="961"};
+{"key"="40";"subkey"="1600";"value"="960"};
+{"key"="41";"subkey"="1681";"value"="959"};
+{"key"="42";"subkey"="1764";"value"="958"};
+{"key"="43";"subkey"="1849";"value"="957"};
+{"key"="44";"subkey"="1936";"value"="956"};
+{"key"="45";"subkey"="2025";"value"="955"};
+{"key"="46";"subkey"="2116";"value"="954"};
+{"key"="47";"subkey"="2209";"value"="953"};
+{"key"="48";"subkey"="2304";"value"="952"};
+{"key"="49";"subkey"="2401";"value"="951"};
+{"key"="50";"subkey"="2500";"value"="950"};
+{"key"="51";"subkey"="2601";"value"="949"};
+{"key"="52";"subkey"="2704";"value"="948"};
+{"key"="53";"subkey"="2809";"value"="947"};
+{"key"="54";"subkey"="2916";"value"="946"};
+{"key"="55";"subkey"="3025";"value"="945"};
+{"key"="56";"subkey"="3136";"value"="944"};
+{"key"="57";"subkey"="3249";"value"="943"};
+{"key"="58";"subkey"="3364";"value"="942"};
+{"key"="59";"subkey"="3481";"value"="941"};
+{"key"="60";"subkey"="3600";"value"="940"};
+{"key"="61";"subkey"="3721";"value"="939"};
+{"key"="62";"subkey"="3844";"value"="938"};
+{"key"="63";"subkey"="3969";"value"="937"};
+{"key"="64";"subkey"="4096";"value"="936"};
+{"key"="65";"subkey"="4225";"value"="935"};
+{"key"="66";"subkey"="4356";"value"="934"};
+{"key"="67";"subkey"="4489";"value"="933"};
+{"key"="68";"subkey"="4624";"value"="932"};
+{"key"="69";"subkey"="4761";"value"="931"};
+{"key"="70";"subkey"="4900";"value"="930"};
+{"key"="71";"subkey"="5041";"value"="929"};
+{"key"="72";"subkey"="5184";"value"="928"};
+{"key"="73";"subkey"="5329";"value"="927"};
+{"key"="74";"subkey"="5476";"value"="926"};
+{"key"="75";"subkey"="5625";"value"="925"};
+{"key"="76";"subkey"="5776";"value"="924"};
+{"key"="77";"subkey"="5929";"value"="923"};
+{"key"="78";"subkey"="6084";"value"="922"};
+{"key"="79";"subkey"="6241";"value"="921"};
+{"key"="80";"subkey"="6400";"value"="920"};
+{"key"="81";"subkey"="6561";"value"="919"};
+{"key"="82";"subkey"="6724";"value"="918"};
+{"key"="83";"subkey"="6889";"value"="917"};
+{"key"="84";"subkey"="7056";"value"="916"};
+{"key"="85";"subkey"="7225";"value"="915"};
+{"key"="86";"subkey"="7396";"value"="914"};
+{"key"="87";"subkey"="7569";"value"="913"};
+{"key"="88";"subkey"="7744";"value"="912"};
+{"key"="89";"subkey"="7921";"value"="911"};
+{"key"="90";"subkey"="8100";"value"="910"};
+{"key"="91";"subkey"="8281";"value"="909"};
+{"key"="92";"subkey"="8464";"value"="908"};
+{"key"="93";"subkey"="8649";"value"="907"};
+{"key"="94";"subkey"="8836";"value"="906"};
+{"key"="95";"subkey"="9025";"value"="905"};
+{"key"="96";"subkey"="9216";"value"="904"};
+{"key"="97";"subkey"="9409";"value"="903"};
+{"key"="98";"subkey"="9604";"value"="902"};
+{"key"="99";"subkey"="9801";"value"="901"};
+{"key"="100";"subkey"="10000";"value"="900"};
+{"key"="101";"subkey"="10201";"value"="899"};
+{"key"="102";"subkey"="10404";"value"="898"};
+{"key"="103";"subkey"="10609";"value"="897"};
+{"key"="104";"subkey"="10816";"value"="896"};
+{"key"="105";"subkey"="11025";"value"="895"};
+{"key"="106";"subkey"="11236";"value"="894"};
+{"key"="107";"subkey"="11449";"value"="893"};
+{"key"="108";"subkey"="11664";"value"="892"};
+{"key"="109";"subkey"="11881";"value"="891"};
+{"key"="110";"subkey"="12100";"value"="890"};
+{"key"="111";"subkey"="12321";"value"="889"};
+{"key"="112";"subkey"="12544";"value"="888"};
+{"key"="113";"subkey"="12769";"value"="887"};
+{"key"="114";"subkey"="12996";"value"="886"};
+{"key"="115";"subkey"="13225";"value"="885"};
+{"key"="116";"subkey"="13456";"value"="884"};
+{"key"="117";"subkey"="13689";"value"="883"};
+{"key"="118";"subkey"="13924";"value"="882"};
+{"key"="119";"subkey"="14161";"value"="881"};
+{"key"="120";"subkey"="14400";"value"="880"};
+{"key"="121";"subkey"="14641";"value"="879"};
+{"key"="122";"subkey"="14884";"value"="878"};
+{"key"="123";"subkey"="15129";"value"="877"};
+{"key"="124";"subkey"="15376";"value"="876"};
+{"key"="125";"subkey"="15625";"value"="875"};
+{"key"="126";"subkey"="15876";"value"="874"};
+{"key"="127";"subkey"="16129";"value"="873"};
+{"key"="128";"subkey"="16384";"value"="872"};
+{"key"="129";"subkey"="16641";"value"="871"};
+{"key"="130";"subkey"="16900";"value"="870"};
+{"key"="131";"subkey"="17161";"value"="869"};
+{"key"="132";"subkey"="17424";"value"="868"};
+{"key"="133";"subkey"="17689";"value"="867"};
+{"key"="134";"subkey"="17956";"value"="866"};
+{"key"="135";"subkey"="18225";"value"="865"};
+{"key"="136";"subkey"="18496";"value"="864"};
+{"key"="137";"subkey"="18769";"value"="863"};
+{"key"="138";"subkey"="19044";"value"="862"};
+{"key"="139";"subkey"="19321";"value"="861"};
+{"key"="140";"subkey"="19600";"value"="860"};
+{"key"="141";"subkey"="19881";"value"="859"};
+{"key"="142";"subkey"="20164";"value"="858"};
+{"key"="143";"subkey"="20449";"value"="857"};
+{"key"="144";"subkey"="20736";"value"="856"};
+{"key"="145";"subkey"="21025";"value"="855"};
+{"key"="146";"subkey"="21316";"value"="854"};
+{"key"="147";"subkey"="21609";"value"="853"};
+{"key"="148";"subkey"="21904";"value"="852"};
+{"key"="149";"subkey"="22201";"value"="851"};
+{"key"="150";"subkey"="22500";"value"="850"};
+{"key"="151";"subkey"="22801";"value"="849"};
+{"key"="152";"subkey"="23104";"value"="848"};
+{"key"="153";"subkey"="23409";"value"="847"};
+{"key"="154";"subkey"="23716";"value"="846"};
+{"key"="155";"subkey"="24025";"value"="845"};
+{"key"="156";"subkey"="24336";"value"="844"};
+{"key"="157";"subkey"="24649";"value"="843"};
+{"key"="158";"subkey"="24964";"value"="842"};
+{"key"="159";"subkey"="25281";"value"="841"};
+{"key"="160";"subkey"="25600";"value"="840"};
+{"key"="161";"subkey"="25921";"value"="839"};
+{"key"="162";"subkey"="26244";"value"="838"};
+{"key"="163";"subkey"="26569";"value"="837"};
+{"key"="164";"subkey"="26896";"value"="836"};
+{"key"="165";"subkey"="27225";"value"="835"};
+{"key"="166";"subkey"="27556";"value"="834"};
+{"key"="167";"subkey"="27889";"value"="833"};
+{"key"="168";"subkey"="28224";"value"="832"};
+{"key"="169";"subkey"="28561";"value"="831"};
+{"key"="170";"subkey"="28900";"value"="830"};
+{"key"="171";"subkey"="29241";"value"="829"};
+{"key"="172";"subkey"="29584";"value"="828"};
+{"key"="173";"subkey"="29929";"value"="827"};
+{"key"="174";"subkey"="30276";"value"="826"};
+{"key"="175";"subkey"="30625";"value"="825"};
+{"key"="176";"subkey"="30976";"value"="824"};
+{"key"="177";"subkey"="31329";"value"="823"};
+{"key"="178";"subkey"="31684";"value"="822"};
+{"key"="179";"subkey"="32041";"value"="821"};
+{"key"="180";"subkey"="32400";"value"="820"};
+{"key"="181";"subkey"="32761";"value"="819"};
+{"key"="182";"subkey"="33124";"value"="818"};
+{"key"="183";"subkey"="33489";"value"="817"};
+{"key"="184";"subkey"="33856";"value"="816"};
+{"key"="185";"subkey"="34225";"value"="815"};
+{"key"="186";"subkey"="34596";"value"="814"};
+{"key"="187";"subkey"="34969";"value"="813"};
+{"key"="188";"subkey"="35344";"value"="812"};
+{"key"="189";"subkey"="35721";"value"="811"};
+{"key"="190";"subkey"="36100";"value"="810"};
+{"key"="191";"subkey"="36481";"value"="809"};
+{"key"="192";"subkey"="36864";"value"="808"};
+{"key"="193";"subkey"="37249";"value"="807"};
+{"key"="194";"subkey"="37636";"value"="806"};
+{"key"="195";"subkey"="38025";"value"="805"};
+{"key"="196";"subkey"="38416";"value"="804"};
+{"key"="197";"subkey"="38809";"value"="803"};
+{"key"="198";"subkey"="39204";"value"="802"};
+{"key"="199";"subkey"="39601";"value"="801"};
+{"key"="200";"subkey"="40000";"value"="800"};
+{"key"="201";"subkey"="40401";"value"="799"};
+{"key"="202";"subkey"="40804";"value"="798"};
+{"key"="203";"subkey"="41209";"value"="797"};
+{"key"="204";"subkey"="41616";"value"="796"};
+{"key"="205";"subkey"="42025";"value"="795"};
+{"key"="206";"subkey"="42436";"value"="794"};
+{"key"="207";"subkey"="42849";"value"="793"};
+{"key"="208";"subkey"="43264";"value"="792"};
+{"key"="209";"subkey"="43681";"value"="791"};
+{"key"="210";"subkey"="44100";"value"="790"};
+{"key"="211";"subkey"="44521";"value"="789"};
+{"key"="212";"subkey"="44944";"value"="788"};
+{"key"="213";"subkey"="45369";"value"="787"};
+{"key"="214";"subkey"="45796";"value"="786"};
+{"key"="215";"subkey"="46225";"value"="785"};
+{"key"="216";"subkey"="46656";"value"="784"};
+{"key"="217";"subkey"="47089";"value"="783"};
+{"key"="218";"subkey"="47524";"value"="782"};
+{"key"="219";"subkey"="47961";"value"="781"};
+{"key"="220";"subkey"="48400";"value"="780"};
+{"key"="221";"subkey"="48841";"value"="779"};
+{"key"="222";"subkey"="49284";"value"="778"};
+{"key"="223";"subkey"="49729";"value"="777"};
+{"key"="224";"subkey"="50176";"value"="776"};
+{"key"="225";"subkey"="50625";"value"="775"};
+{"key"="226";"subkey"="51076";"value"="774"};
+{"key"="227";"subkey"="51529";"value"="773"};
+{"key"="228";"subkey"="51984";"value"="772"};
+{"key"="229";"subkey"="52441";"value"="771"};
+{"key"="230";"subkey"="52900";"value"="770"};
+{"key"="231";"subkey"="53361";"value"="769"};
+{"key"="232";"subkey"="53824";"value"="768"};
+{"key"="233";"subkey"="54289";"value"="767"};
+{"key"="234";"subkey"="54756";"value"="766"};
+{"key"="235";"subkey"="55225";"value"="765"};
+{"key"="236";"subkey"="55696";"value"="764"};
+{"key"="237";"subkey"="56169";"value"="763"};
+{"key"="238";"subkey"="56644";"value"="762"};
+{"key"="239";"subkey"="57121";"value"="761"};
+{"key"="240";"subkey"="57600";"value"="760"};
+{"key"="241";"subkey"="58081";"value"="759"};
+{"key"="242";"subkey"="58564";"value"="758"};
+{"key"="243";"subkey"="59049";"value"="757"};
+{"key"="244";"subkey"="59536";"value"="756"};
+{"key"="245";"subkey"="60025";"value"="755"};
+{"key"="246";"subkey"="60516";"value"="754"};
+{"key"="247";"subkey"="61009";"value"="753"};
+{"key"="248";"subkey"="61504";"value"="752"};
+{"key"="249";"subkey"="62001";"value"="751"};
+{"key"="250";"subkey"="62500";"value"="750"};
+{"key"="251";"subkey"="63001";"value"="749"};
+{"key"="252";"subkey"="63504";"value"="748"};
+{"key"="253";"subkey"="64009";"value"="747"};
+{"key"="254";"subkey"="64516";"value"="746"};
+{"key"="255";"subkey"="65025";"value"="745"};
+{"key"="256";"subkey"="65536";"value"="744"};
+{"key"="257";"subkey"="66049";"value"="743"};
+{"key"="258";"subkey"="66564";"value"="742"};
+{"key"="259";"subkey"="67081";"value"="741"};
+{"key"="260";"subkey"="67600";"value"="740"};
+{"key"="261";"subkey"="68121";"value"="739"};
+{"key"="262";"subkey"="68644";"value"="738"};
+{"key"="263";"subkey"="69169";"value"="737"};
+{"key"="264";"subkey"="69696";"value"="736"};
+{"key"="265";"subkey"="70225";"value"="735"};
+{"key"="266";"subkey"="70756";"value"="734"};
+{"key"="267";"subkey"="71289";"value"="733"};
+{"key"="268";"subkey"="71824";"value"="732"};
+{"key"="269";"subkey"="72361";"value"="731"};
+{"key"="270";"subkey"="72900";"value"="730"};
+{"key"="271";"subkey"="73441";"value"="729"};
+{"key"="272";"subkey"="73984";"value"="728"};
+{"key"="273";"subkey"="74529";"value"="727"};
+{"key"="274";"subkey"="75076";"value"="726"};
+{"key"="275";"subkey"="75625";"value"="725"};
+{"key"="276";"subkey"="76176";"value"="724"};
+{"key"="277";"subkey"="76729";"value"="723"};
+{"key"="278";"subkey"="77284";"value"="722"};
+{"key"="279";"subkey"="77841";"value"="721"};
+{"key"="280";"subkey"="78400";"value"="720"};
+{"key"="281";"subkey"="78961";"value"="719"};
+{"key"="282";"subkey"="79524";"value"="718"};
+{"key"="283";"subkey"="80089";"value"="717"};
+{"key"="284";"subkey"="80656";"value"="716"};
+{"key"="285";"subkey"="81225";"value"="715"};
+{"key"="286";"subkey"="81796";"value"="714"};
+{"key"="287";"subkey"="82369";"value"="713"};
+{"key"="288";"subkey"="82944";"value"="712"};
+{"key"="289";"subkey"="83521";"value"="711"};
+{"key"="290";"subkey"="84100";"value"="710"};
+{"key"="291";"subkey"="84681";"value"="709"};
+{"key"="292";"subkey"="85264";"value"="708"};
+{"key"="293";"subkey"="85849";"value"="707"};
+{"key"="294";"subkey"="86436";"value"="706"};
+{"key"="295";"subkey"="87025";"value"="705"};
+{"key"="296";"subkey"="87616";"value"="704"};
+{"key"="297";"subkey"="88209";"value"="703"};
+{"key"="298";"subkey"="88804";"value"="702"};
+{"key"="299";"subkey"="89401";"value"="701"};
+{"key"="300";"subkey"="90000";"value"="700"};
+{"key"="301";"subkey"="90601";"value"="699"};
+{"key"="302";"subkey"="91204";"value"="698"};
+{"key"="303";"subkey"="91809";"value"="697"};
+{"key"="304";"subkey"="92416";"value"="696"};
+{"key"="305";"subkey"="93025";"value"="695"};
+{"key"="306";"subkey"="93636";"value"="694"};
+{"key"="307";"subkey"="94249";"value"="693"};
+{"key"="308";"subkey"="94864";"value"="692"};
+{"key"="309";"subkey"="95481";"value"="691"};
+{"key"="310";"subkey"="96100";"value"="690"};
+{"key"="311";"subkey"="96721";"value"="689"};
+{"key"="312";"subkey"="97344";"value"="688"};
+{"key"="313";"subkey"="97969";"value"="687"};
+{"key"="314";"subkey"="98596";"value"="686"};
+{"key"="315";"subkey"="99225";"value"="685"};
+{"key"="316";"subkey"="99856";"value"="684"};
+{"key"="317";"subkey"="100489";"value"="683"};
+{"key"="318";"subkey"="101124";"value"="682"};
+{"key"="319";"subkey"="101761";"value"="681"};
+{"key"="320";"subkey"="102400";"value"="680"};
+{"key"="321";"subkey"="103041";"value"="679"};
+{"key"="322";"subkey"="103684";"value"="678"};
+{"key"="323";"subkey"="104329";"value"="677"};
+{"key"="324";"subkey"="104976";"value"="676"};
+{"key"="325";"subkey"="105625";"value"="675"};
+{"key"="326";"subkey"="106276";"value"="674"};
+{"key"="327";"subkey"="106929";"value"="673"};
+{"key"="328";"subkey"="107584";"value"="672"};
+{"key"="329";"subkey"="108241";"value"="671"};
+{"key"="330";"subkey"="108900";"value"="670"};
+{"key"="331";"subkey"="109561";"value"="669"};
+{"key"="332";"subkey"="110224";"value"="668"};
+{"key"="333";"subkey"="110889";"value"="667"};
+{"key"="334";"subkey"="111556";"value"="666"};
+{"key"="335";"subkey"="112225";"value"="665"};
+{"key"="336";"subkey"="112896";"value"="664"};
+{"key"="337";"subkey"="113569";"value"="663"};
+{"key"="338";"subkey"="114244";"value"="662"};
+{"key"="339";"subkey"="114921";"value"="661"};
+{"key"="340";"subkey"="115600";"value"="660"};
+{"key"="341";"subkey"="116281";"value"="659"};
+{"key"="342";"subkey"="116964";"value"="658"};
+{"key"="343";"subkey"="117649";"value"="657"};
+{"key"="344";"subkey"="118336";"value"="656"};
+{"key"="345";"subkey"="119025";"value"="655"};
+{"key"="346";"subkey"="119716";"value"="654"};
+{"key"="347";"subkey"="120409";"value"="653"};
+{"key"="348";"subkey"="121104";"value"="652"};
+{"key"="349";"subkey"="121801";"value"="651"};
+{"key"="350";"subkey"="122500";"value"="650"};
+{"key"="351";"subkey"="123201";"value"="649"};
+{"key"="352";"subkey"="123904";"value"="648"};
+{"key"="353";"subkey"="124609";"value"="647"};
+{"key"="354";"subkey"="125316";"value"="646"};
+{"key"="355";"subkey"="126025";"value"="645"};
+{"key"="356";"subkey"="126736";"value"="644"};
+{"key"="357";"subkey"="127449";"value"="643"};
+{"key"="358";"subkey"="128164";"value"="642"};
+{"key"="359";"subkey"="128881";"value"="641"};
+{"key"="360";"subkey"="129600";"value"="640"};
+{"key"="361";"subkey"="130321";"value"="639"};
+{"key"="362";"subkey"="131044";"value"="638"};
+{"key"="363";"subkey"="131769";"value"="637"};
+{"key"="364";"subkey"="132496";"value"="636"};
+{"key"="365";"subkey"="133225";"value"="635"};
+{"key"="366";"subkey"="133956";"value"="634"};
+{"key"="367";"subkey"="134689";"value"="633"};
+{"key"="368";"subkey"="135424";"value"="632"};
+{"key"="369";"subkey"="136161";"value"="631"};
+{"key"="370";"subkey"="136900";"value"="630"};
+{"key"="371";"subkey"="137641";"value"="629"};
+{"key"="372";"subkey"="138384";"value"="628"};
+{"key"="373";"subkey"="139129";"value"="627"};
+{"key"="374";"subkey"="139876";"value"="626"};
+{"key"="375";"subkey"="140625";"value"="625"};
+{"key"="376";"subkey"="141376";"value"="624"};
+{"key"="377";"subkey"="142129";"value"="623"};
+{"key"="378";"subkey"="142884";"value"="622"};
+{"key"="379";"subkey"="143641";"value"="621"};
+{"key"="380";"subkey"="144400";"value"="620"};
+{"key"="381";"subkey"="145161";"value"="619"};
+{"key"="382";"subkey"="145924";"value"="618"};
+{"key"="383";"subkey"="146689";"value"="617"};
+{"key"="384";"subkey"="147456";"value"="616"};
+{"key"="385";"subkey"="148225";"value"="615"};
+{"key"="386";"subkey"="148996";"value"="614"};
+{"key"="387";"subkey"="149769";"value"="613"};
+{"key"="388";"subkey"="150544";"value"="612"};
+{"key"="389";"subkey"="151321";"value"="611"};
+{"key"="390";"subkey"="152100";"value"="610"};
+{"key"="391";"subkey"="152881";"value"="609"};
+{"key"="392";"subkey"="153664";"value"="608"};
+{"key"="393";"subkey"="154449";"value"="607"};
+{"key"="394";"subkey"="155236";"value"="606"};
+{"key"="395";"subkey"="156025";"value"="605"};
+{"key"="396";"subkey"="156816";"value"="604"};
+{"key"="397";"subkey"="157609";"value"="603"};
+{"key"="398";"subkey"="158404";"value"="602"};
+{"key"="399";"subkey"="159201";"value"="601"};
+{"key"="400";"subkey"="160000";"value"="600"};
+{"key"="401";"subkey"="160801";"value"="599"};
+{"key"="402";"subkey"="161604";"value"="598"};
+{"key"="403";"subkey"="162409";"value"="597"};
+{"key"="404";"subkey"="163216";"value"="596"};
+{"key"="405";"subkey"="164025";"value"="595"};
+{"key"="406";"subkey"="164836";"value"="594"};
+{"key"="407";"subkey"="165649";"value"="593"};
+{"key"="408";"subkey"="166464";"value"="592"};
+{"key"="409";"subkey"="167281";"value"="591"};
+{"key"="410";"subkey"="168100";"value"="590"};
+{"key"="411";"subkey"="168921";"value"="589"};
+{"key"="412";"subkey"="169744";"value"="588"};
+{"key"="413";"subkey"="170569";"value"="587"};
+{"key"="414";"subkey"="171396";"value"="586"};
+{"key"="415";"subkey"="172225";"value"="585"};
+{"key"="416";"subkey"="173056";"value"="584"};
+{"key"="417";"subkey"="173889";"value"="583"};
+{"key"="418";"subkey"="174724";"value"="582"};
+{"key"="419";"subkey"="175561";"value"="581"};
+{"key"="420";"subkey"="176400";"value"="580"};
+{"key"="421";"subkey"="177241";"value"="579"};
+{"key"="422";"subkey"="178084";"value"="578"};
+{"key"="423";"subkey"="178929";"value"="577"};
+{"key"="424";"subkey"="179776";"value"="576"};
+{"key"="425";"subkey"="180625";"value"="575"};
+{"key"="426";"subkey"="181476";"value"="574"};
+{"key"="427";"subkey"="182329";"value"="573"};
+{"key"="428";"subkey"="183184";"value"="572"};
+{"key"="429";"subkey"="184041";"value"="571"};
+{"key"="430";"subkey"="184900";"value"="570"};
+{"key"="431";"subkey"="185761";"value"="569"};
+{"key"="432";"subkey"="186624";"value"="568"};
+{"key"="433";"subkey"="187489";"value"="567"};
+{"key"="434";"subkey"="188356";"value"="566"};
+{"key"="435";"subkey"="189225";"value"="565"};
+{"key"="436";"subkey"="190096";"value"="564"};
+{"key"="437";"subkey"="190969";"value"="563"};
+{"key"="438";"subkey"="191844";"value"="562"};
+{"key"="439";"subkey"="192721";"value"="561"};
+{"key"="440";"subkey"="193600";"value"="560"};
+{"key"="441";"subkey"="194481";"value"="559"};
+{"key"="442";"subkey"="195364";"value"="558"};
+{"key"="443";"subkey"="196249";"value"="557"};
+{"key"="444";"subkey"="197136";"value"="556"};
+{"key"="445";"subkey"="198025";"value"="555"};
+{"key"="446";"subkey"="198916";"value"="554"};
+{"key"="447";"subkey"="199809";"value"="553"};
+{"key"="448";"subkey"="200704";"value"="552"};
+{"key"="449";"subkey"="201601";"value"="551"};
+{"key"="450";"subkey"="202500";"value"="550"};
+{"key"="451";"subkey"="203401";"value"="549"};
+{"key"="452";"subkey"="204304";"value"="548"};
+{"key"="453";"subkey"="205209";"value"="547"};
+{"key"="454";"subkey"="206116";"value"="546"};
+{"key"="455";"subkey"="207025";"value"="545"};
+{"key"="456";"subkey"="207936";"value"="544"};
+{"key"="457";"subkey"="208849";"value"="543"};
+{"key"="458";"subkey"="209764";"value"="542"};
+{"key"="459";"subkey"="210681";"value"="541"};
+{"key"="460";"subkey"="211600";"value"="540"};
+{"key"="461";"subkey"="212521";"value"="539"};
+{"key"="462";"subkey"="213444";"value"="538"};
+{"key"="463";"subkey"="214369";"value"="537"};
+{"key"="464";"subkey"="215296";"value"="536"};
+{"key"="465";"subkey"="216225";"value"="535"};
+{"key"="466";"subkey"="217156";"value"="534"};
+{"key"="467";"subkey"="218089";"value"="533"};
+{"key"="468";"subkey"="219024";"value"="532"};
+{"key"="469";"subkey"="219961";"value"="531"};
+{"key"="470";"subkey"="220900";"value"="530"};
+{"key"="471";"subkey"="221841";"value"="529"};
+{"key"="472";"subkey"="222784";"value"="528"};
+{"key"="473";"subkey"="223729";"value"="527"};
+{"key"="474";"subkey"="224676";"value"="526"};
+{"key"="475";"subkey"="225625";"value"="525"};
+{"key"="476";"subkey"="226576";"value"="524"};
+{"key"="477";"subkey"="227529";"value"="523"};
+{"key"="478";"subkey"="228484";"value"="522"};
+{"key"="479";"subkey"="229441";"value"="521"};
+{"key"="480";"subkey"="230400";"value"="520"};
+{"key"="481";"subkey"="231361";"value"="519"};
+{"key"="482";"subkey"="232324";"value"="518"};
+{"key"="483";"subkey"="233289";"value"="517"};
+{"key"="484";"subkey"="234256";"value"="516"};
+{"key"="485";"subkey"="235225";"value"="515"};
+{"key"="486";"subkey"="236196";"value"="514"};
+{"key"="487";"subkey"="237169";"value"="513"};
+{"key"="488";"subkey"="238144";"value"="512"};
+{"key"="489";"subkey"="239121";"value"="511"};
+{"key"="490";"subkey"="240100";"value"="510"};
+{"key"="491";"subkey"="241081";"value"="509"};
+{"key"="492";"subkey"="242064";"value"="508"};
+{"key"="493";"subkey"="243049";"value"="507"};
+{"key"="494";"subkey"="244036";"value"="506"};
+{"key"="495";"subkey"="245025";"value"="505"};
+{"key"="496";"subkey"="246016";"value"="504"};
+{"key"="497";"subkey"="247009";"value"="503"};
+{"key"="498";"subkey"="248004";"value"="502"};
+{"key"="499";"subkey"="249001";"value"="501"};
+{"key"="500";"subkey"="250000";"value"="500"};
+{"key"="501";"subkey"="251001";"value"="499"};
+{"key"="502";"subkey"="252004";"value"="498"};
+{"key"="503";"subkey"="253009";"value"="497"};
+{"key"="504";"subkey"="254016";"value"="496"};
+{"key"="505";"subkey"="255025";"value"="495"};
+{"key"="506";"subkey"="256036";"value"="494"};
+{"key"="507";"subkey"="257049";"value"="493"};
+{"key"="508";"subkey"="258064";"value"="492"};
+{"key"="509";"subkey"="259081";"value"="491"};
+{"key"="510";"subkey"="260100";"value"="490"};
+{"key"="511";"subkey"="261121";"value"="489"};
+{"key"="512";"subkey"="262144";"value"="488"};
+{"key"="513";"subkey"="263169";"value"="487"};
+{"key"="514";"subkey"="264196";"value"="486"};
+{"key"="515";"subkey"="265225";"value"="485"};
+{"key"="516";"subkey"="266256";"value"="484"};
+{"key"="517";"subkey"="267289";"value"="483"};
+{"key"="518";"subkey"="268324";"value"="482"};
+{"key"="519";"subkey"="269361";"value"="481"};
+{"key"="520";"subkey"="270400";"value"="480"};
+{"key"="521";"subkey"="271441";"value"="479"};
+{"key"="522";"subkey"="272484";"value"="478"};
+{"key"="523";"subkey"="273529";"value"="477"};
+{"key"="524";"subkey"="274576";"value"="476"};
+{"key"="525";"subkey"="275625";"value"="475"};
+{"key"="526";"subkey"="276676";"value"="474"};
+{"key"="527";"subkey"="277729";"value"="473"};
+{"key"="528";"subkey"="278784";"value"="472"};
+{"key"="529";"subkey"="279841";"value"="471"};
+{"key"="530";"subkey"="280900";"value"="470"};
+{"key"="531";"subkey"="281961";"value"="469"};
+{"key"="532";"subkey"="283024";"value"="468"};
+{"key"="533";"subkey"="284089";"value"="467"};
+{"key"="534";"subkey"="285156";"value"="466"};
+{"key"="535";"subkey"="286225";"value"="465"};
+{"key"="536";"subkey"="287296";"value"="464"};
+{"key"="537";"subkey"="288369";"value"="463"};
+{"key"="538";"subkey"="289444";"value"="462"};
+{"key"="539";"subkey"="290521";"value"="461"};
+{"key"="540";"subkey"="291600";"value"="460"};
+{"key"="541";"subkey"="292681";"value"="459"};
+{"key"="542";"subkey"="293764";"value"="458"};
+{"key"="543";"subkey"="294849";"value"="457"};
+{"key"="544";"subkey"="295936";"value"="456"};
+{"key"="545";"subkey"="297025";"value"="455"};
+{"key"="546";"subkey"="298116";"value"="454"};
+{"key"="547";"subkey"="299209";"value"="453"};
+{"key"="548";"subkey"="300304";"value"="452"};
+{"key"="549";"subkey"="301401";"value"="451"};
+{"key"="550";"subkey"="302500";"value"="450"};
+{"key"="551";"subkey"="303601";"value"="449"};
+{"key"="552";"subkey"="304704";"value"="448"};
+{"key"="553";"subkey"="305809";"value"="447"};
+{"key"="554";"subkey"="306916";"value"="446"};
+{"key"="555";"subkey"="308025";"value"="445"};
+{"key"="556";"subkey"="309136";"value"="444"};
+{"key"="557";"subkey"="310249";"value"="443"};
+{"key"="558";"subkey"="311364";"value"="442"};
+{"key"="559";"subkey"="312481";"value"="441"};
+{"key"="560";"subkey"="313600";"value"="440"};
+{"key"="561";"subkey"="314721";"value"="439"};
+{"key"="562";"subkey"="315844";"value"="438"};
+{"key"="563";"subkey"="316969";"value"="437"};
+{"key"="564";"subkey"="318096";"value"="436"};
+{"key"="565";"subkey"="319225";"value"="435"};
+{"key"="566";"subkey"="320356";"value"="434"};
+{"key"="567";"subkey"="321489";"value"="433"};
+{"key"="568";"subkey"="322624";"value"="432"};
+{"key"="569";"subkey"="323761";"value"="431"};
+{"key"="570";"subkey"="324900";"value"="430"};
+{"key"="571";"subkey"="326041";"value"="429"};
+{"key"="572";"subkey"="327184";"value"="428"};
+{"key"="573";"subkey"="328329";"value"="427"};
+{"key"="574";"subkey"="329476";"value"="426"};
+{"key"="575";"subkey"="330625";"value"="425"};
+{"key"="576";"subkey"="331776";"value"="424"};
+{"key"="577";"subkey"="332929";"value"="423"};
+{"key"="578";"subkey"="334084";"value"="422"};
+{"key"="579";"subkey"="335241";"value"="421"};
+{"key"="580";"subkey"="336400";"value"="420"};
+{"key"="581";"subkey"="337561";"value"="419"};
+{"key"="582";"subkey"="338724";"value"="418"};
+{"key"="583";"subkey"="339889";"value"="417"};
+{"key"="584";"subkey"="341056";"value"="416"};
+{"key"="585";"subkey"="342225";"value"="415"};
+{"key"="586";"subkey"="343396";"value"="414"};
+{"key"="587";"subkey"="344569";"value"="413"};
+{"key"="588";"subkey"="345744";"value"="412"};
+{"key"="589";"subkey"="346921";"value"="411"};
+{"key"="590";"subkey"="348100";"value"="410"};
+{"key"="591";"subkey"="349281";"value"="409"};
+{"key"="592";"subkey"="350464";"value"="408"};
+{"key"="593";"subkey"="351649";"value"="407"};
+{"key"="594";"subkey"="352836";"value"="406"};
+{"key"="595";"subkey"="354025";"value"="405"};
+{"key"="596";"subkey"="355216";"value"="404"};
+{"key"="597";"subkey"="356409";"value"="403"};
+{"key"="598";"subkey"="357604";"value"="402"};
+{"key"="599";"subkey"="358801";"value"="401"};
+{"key"="600";"subkey"="360000";"value"="400"};
+{"key"="601";"subkey"="361201";"value"="399"};
+{"key"="602";"subkey"="362404";"value"="398"};
+{"key"="603";"subkey"="363609";"value"="397"};
+{"key"="604";"subkey"="364816";"value"="396"};
+{"key"="605";"subkey"="366025";"value"="395"};
+{"key"="606";"subkey"="367236";"value"="394"};
+{"key"="607";"subkey"="368449";"value"="393"};
+{"key"="608";"subkey"="369664";"value"="392"};
+{"key"="609";"subkey"="370881";"value"="391"};
+{"key"="610";"subkey"="372100";"value"="390"};
+{"key"="611";"subkey"="373321";"value"="389"};
+{"key"="612";"subkey"="374544";"value"="388"};
+{"key"="613";"subkey"="375769";"value"="387"};
+{"key"="614";"subkey"="376996";"value"="386"};
+{"key"="615";"subkey"="378225";"value"="385"};
+{"key"="616";"subkey"="379456";"value"="384"};
+{"key"="617";"subkey"="380689";"value"="383"};
+{"key"="618";"subkey"="381924";"value"="382"};
+{"key"="619";"subkey"="383161";"value"="381"};
+{"key"="620";"subkey"="384400";"value"="380"};
+{"key"="621";"subkey"="385641";"value"="379"};
+{"key"="622";"subkey"="386884";"value"="378"};
+{"key"="623";"subkey"="388129";"value"="377"};
+{"key"="624";"subkey"="389376";"value"="376"};
+{"key"="625";"subkey"="390625";"value"="375"};
+{"key"="626";"subkey"="391876";"value"="374"};
+{"key"="627";"subkey"="393129";"value"="373"};
+{"key"="628";"subkey"="394384";"value"="372"};
+{"key"="629";"subkey"="395641";"value"="371"};
+{"key"="630";"subkey"="396900";"value"="370"};
+{"key"="631";"subkey"="398161";"value"="369"};
+{"key"="632";"subkey"="399424";"value"="368"};
+{"key"="633";"subkey"="400689";"value"="367"};
+{"key"="634";"subkey"="401956";"value"="366"};
+{"key"="635";"subkey"="403225";"value"="365"};
+{"key"="636";"subkey"="404496";"value"="364"};
+{"key"="637";"subkey"="405769";"value"="363"};
+{"key"="638";"subkey"="407044";"value"="362"};
+{"key"="639";"subkey"="408321";"value"="361"};
+{"key"="640";"subkey"="409600";"value"="360"};
+{"key"="641";"subkey"="410881";"value"="359"};
+{"key"="642";"subkey"="412164";"value"="358"};
+{"key"="643";"subkey"="413449";"value"="357"};
+{"key"="644";"subkey"="414736";"value"="356"};
+{"key"="645";"subkey"="416025";"value"="355"};
+{"key"="646";"subkey"="417316";"value"="354"};
+{"key"="647";"subkey"="418609";"value"="353"};
+{"key"="648";"subkey"="419904";"value"="352"};
+{"key"="649";"subkey"="421201";"value"="351"};
+{"key"="650";"subkey"="422500";"value"="350"};
+{"key"="651";"subkey"="423801";"value"="349"};
+{"key"="652";"subkey"="425104";"value"="348"};
+{"key"="653";"subkey"="426409";"value"="347"};
+{"key"="654";"subkey"="427716";"value"="346"};
+{"key"="655";"subkey"="429025";"value"="345"};
+{"key"="656";"subkey"="430336";"value"="344"};
+{"key"="657";"subkey"="431649";"value"="343"};
+{"key"="658";"subkey"="432964";"value"="342"};
+{"key"="659";"subkey"="434281";"value"="341"};
+{"key"="660";"subkey"="435600";"value"="340"};
+{"key"="661";"subkey"="436921";"value"="339"};
+{"key"="662";"subkey"="438244";"value"="338"};
+{"key"="663";"subkey"="439569";"value"="337"};
+{"key"="664";"subkey"="440896";"value"="336"};
+{"key"="665";"subkey"="442225";"value"="335"};
+{"key"="666";"subkey"="443556";"value"="334"};
+{"key"="667";"subkey"="444889";"value"="333"};
+{"key"="668";"subkey"="446224";"value"="332"};
+{"key"="669";"subkey"="447561";"value"="331"};
+{"key"="670";"subkey"="448900";"value"="330"};
+{"key"="671";"subkey"="450241";"value"="329"};
+{"key"="672";"subkey"="451584";"value"="328"};
+{"key"="673";"subkey"="452929";"value"="327"};
+{"key"="674";"subkey"="454276";"value"="326"};
+{"key"="675";"subkey"="455625";"value"="325"};
+{"key"="676";"subkey"="456976";"value"="324"};
+{"key"="677";"subkey"="458329";"value"="323"};
+{"key"="678";"subkey"="459684";"value"="322"};
+{"key"="679";"subkey"="461041";"value"="321"};
+{"key"="680";"subkey"="462400";"value"="320"};
+{"key"="681";"subkey"="463761";"value"="319"};
+{"key"="682";"subkey"="465124";"value"="318"};
+{"key"="683";"subkey"="466489";"value"="317"};
+{"key"="684";"subkey"="467856";"value"="316"};
+{"key"="685";"subkey"="469225";"value"="315"};
+{"key"="686";"subkey"="470596";"value"="314"};
+{"key"="687";"subkey"="471969";"value"="313"};
+{"key"="688";"subkey"="473344";"value"="312"};
+{"key"="689";"subkey"="474721";"value"="311"};
+{"key"="690";"subkey"="476100";"value"="310"};
+{"key"="691";"subkey"="477481";"value"="309"};
+{"key"="692";"subkey"="478864";"value"="308"};
+{"key"="693";"subkey"="480249";"value"="307"};
+{"key"="694";"subkey"="481636";"value"="306"};
+{"key"="695";"subkey"="483025";"value"="305"};
+{"key"="696";"subkey"="484416";"value"="304"};
+{"key"="697";"subkey"="485809";"value"="303"};
+{"key"="698";"subkey"="487204";"value"="302"};
+{"key"="699";"subkey"="488601";"value"="301"};
+{"key"="700";"subkey"="490000";"value"="300"};
+{"key"="701";"subkey"="491401";"value"="299"};
+{"key"="702";"subkey"="492804";"value"="298"};
+{"key"="703";"subkey"="494209";"value"="297"};
+{"key"="704";"subkey"="495616";"value"="296"};
+{"key"="705";"subkey"="497025";"value"="295"};
+{"key"="706";"subkey"="498436";"value"="294"};
+{"key"="707";"subkey"="499849";"value"="293"};
+{"key"="708";"subkey"="501264";"value"="292"};
+{"key"="709";"subkey"="502681";"value"="291"};
+{"key"="710";"subkey"="504100";"value"="290"};
+{"key"="711";"subkey"="505521";"value"="289"};
+{"key"="712";"subkey"="506944";"value"="288"};
+{"key"="713";"subkey"="508369";"value"="287"};
+{"key"="714";"subkey"="509796";"value"="286"};
+{"key"="715";"subkey"="511225";"value"="285"};
+{"key"="716";"subkey"="512656";"value"="284"};
+{"key"="717";"subkey"="514089";"value"="283"};
+{"key"="718";"subkey"="515524";"value"="282"};
+{"key"="719";"subkey"="516961";"value"="281"};
+{"key"="720";"subkey"="518400";"value"="280"};
+{"key"="721";"subkey"="519841";"value"="279"};
+{"key"="722";"subkey"="521284";"value"="278"};
+{"key"="723";"subkey"="522729";"value"="277"};
+{"key"="724";"subkey"="524176";"value"="276"};
+{"key"="725";"subkey"="525625";"value"="275"};
+{"key"="726";"subkey"="527076";"value"="274"};
+{"key"="727";"subkey"="528529";"value"="273"};
+{"key"="728";"subkey"="529984";"value"="272"};
+{"key"="729";"subkey"="531441";"value"="271"};
+{"key"="730";"subkey"="532900";"value"="270"};
+{"key"="731";"subkey"="534361";"value"="269"};
+{"key"="732";"subkey"="535824";"value"="268"};
+{"key"="733";"subkey"="537289";"value"="267"};
+{"key"="734";"subkey"="538756";"value"="266"};
+{"key"="735";"subkey"="540225";"value"="265"};
+{"key"="736";"subkey"="541696";"value"="264"};
+{"key"="737";"subkey"="543169";"value"="263"};
+{"key"="738";"subkey"="544644";"value"="262"};
+{"key"="739";"subkey"="546121";"value"="261"};
+{"key"="740";"subkey"="547600";"value"="260"};
+{"key"="741";"subkey"="549081";"value"="259"};
+{"key"="742";"subkey"="550564";"value"="258"};
+{"key"="743";"subkey"="552049";"value"="257"};
+{"key"="744";"subkey"="553536";"value"="256"};
+{"key"="745";"subkey"="555025";"value"="255"};
+{"key"="746";"subkey"="556516";"value"="254"};
+{"key"="747";"subkey"="558009";"value"="253"};
+{"key"="748";"subkey"="559504";"value"="252"};
+{"key"="749";"subkey"="561001";"value"="251"};
+{"key"="750";"subkey"="562500";"value"="250"};
+{"key"="751";"subkey"="564001";"value"="249"};
+{"key"="752";"subkey"="565504";"value"="248"};
+{"key"="753";"subkey"="567009";"value"="247"};
+{"key"="754";"subkey"="568516";"value"="246"};
+{"key"="755";"subkey"="570025";"value"="245"};
+{"key"="756";"subkey"="571536";"value"="244"};
+{"key"="757";"subkey"="573049";"value"="243"};
+{"key"="758";"subkey"="574564";"value"="242"};
+{"key"="759";"subkey"="576081";"value"="241"};
+{"key"="760";"subkey"="577600";"value"="240"};
+{"key"="761";"subkey"="579121";"value"="239"};
+{"key"="762";"subkey"="580644";"value"="238"};
+{"key"="763";"subkey"="582169";"value"="237"};
+{"key"="764";"subkey"="583696";"value"="236"};
+{"key"="765";"subkey"="585225";"value"="235"};
+{"key"="766";"subkey"="586756";"value"="234"};
+{"key"="767";"subkey"="588289";"value"="233"};
+{"key"="768";"subkey"="589824";"value"="232"};
+{"key"="769";"subkey"="591361";"value"="231"};
+{"key"="770";"subkey"="592900";"value"="230"};
+{"key"="771";"subkey"="594441";"value"="229"};
+{"key"="772";"subkey"="595984";"value"="228"};
+{"key"="773";"subkey"="597529";"value"="227"};
+{"key"="774";"subkey"="599076";"value"="226"};
+{"key"="775";"subkey"="600625";"value"="225"};
+{"key"="776";"subkey"="602176";"value"="224"};
+{"key"="777";"subkey"="603729";"value"="223"};
+{"key"="778";"subkey"="605284";"value"="222"};
+{"key"="779";"subkey"="606841";"value"="221"};
+{"key"="780";"subkey"="608400";"value"="220"};
+{"key"="781";"subkey"="609961";"value"="219"};
+{"key"="782";"subkey"="611524";"value"="218"};
+{"key"="783";"subkey"="613089";"value"="217"};
+{"key"="784";"subkey"="614656";"value"="216"};
+{"key"="785";"subkey"="616225";"value"="215"};
+{"key"="786";"subkey"="617796";"value"="214"};
+{"key"="787";"subkey"="619369";"value"="213"};
+{"key"="788";"subkey"="620944";"value"="212"};
+{"key"="789";"subkey"="622521";"value"="211"};
+{"key"="790";"subkey"="624100";"value"="210"};
+{"key"="791";"subkey"="625681";"value"="209"};
+{"key"="792";"subkey"="627264";"value"="208"};
+{"key"="793";"subkey"="628849";"value"="207"};
+{"key"="794";"subkey"="630436";"value"="206"};
+{"key"="795";"subkey"="632025";"value"="205"};
+{"key"="796";"subkey"="633616";"value"="204"};
+{"key"="797";"subkey"="635209";"value"="203"};
+{"key"="798";"subkey"="636804";"value"="202"};
+{"key"="799";"subkey"="638401";"value"="201"};
+{"key"="800";"subkey"="640000";"value"="200"};
+{"key"="801";"subkey"="641601";"value"="199"};
+{"key"="802";"subkey"="643204";"value"="198"};
+{"key"="803";"subkey"="644809";"value"="197"};
+{"key"="804";"subkey"="646416";"value"="196"};
+{"key"="805";"subkey"="648025";"value"="195"};
+{"key"="806";"subkey"="649636";"value"="194"};
+{"key"="807";"subkey"="651249";"value"="193"};
+{"key"="808";"subkey"="652864";"value"="192"};
+{"key"="809";"subkey"="654481";"value"="191"};
+{"key"="810";"subkey"="656100";"value"="190"};
+{"key"="811";"subkey"="657721";"value"="189"};
+{"key"="812";"subkey"="659344";"value"="188"};
+{"key"="813";"subkey"="660969";"value"="187"};
+{"key"="814";"subkey"="662596";"value"="186"};
+{"key"="815";"subkey"="664225";"value"="185"};
+{"key"="816";"subkey"="665856";"value"="184"};
+{"key"="817";"subkey"="667489";"value"="183"};
+{"key"="818";"subkey"="669124";"value"="182"};
+{"key"="819";"subkey"="670761";"value"="181"};
+{"key"="820";"subkey"="672400";"value"="180"};
+{"key"="821";"subkey"="674041";"value"="179"};
+{"key"="822";"subkey"="675684";"value"="178"};
+{"key"="823";"subkey"="677329";"value"="177"};
+{"key"="824";"subkey"="678976";"value"="176"};
+{"key"="825";"subkey"="680625";"value"="175"};
+{"key"="826";"subkey"="682276";"value"="174"};
+{"key"="827";"subkey"="683929";"value"="173"};
+{"key"="828";"subkey"="685584";"value"="172"};
+{"key"="829";"subkey"="687241";"value"="171"};
+{"key"="830";"subkey"="688900";"value"="170"};
+{"key"="831";"subkey"="690561";"value"="169"};
+{"key"="832";"subkey"="692224";"value"="168"};
+{"key"="833";"subkey"="693889";"value"="167"};
+{"key"="834";"subkey"="695556";"value"="166"};
+{"key"="835";"subkey"="697225";"value"="165"};
+{"key"="836";"subkey"="698896";"value"="164"};
+{"key"="837";"subkey"="700569";"value"="163"};
+{"key"="838";"subkey"="702244";"value"="162"};
+{"key"="839";"subkey"="703921";"value"="161"};
+{"key"="840";"subkey"="705600";"value"="160"};
+{"key"="841";"subkey"="707281";"value"="159"};
+{"key"="842";"subkey"="708964";"value"="158"};
+{"key"="843";"subkey"="710649";"value"="157"};
+{"key"="844";"subkey"="712336";"value"="156"};
+{"key"="845";"subkey"="714025";"value"="155"};
+{"key"="846";"subkey"="715716";"value"="154"};
+{"key"="847";"subkey"="717409";"value"="153"};
+{"key"="848";"subkey"="719104";"value"="152"};
+{"key"="849";"subkey"="720801";"value"="151"};
+{"key"="850";"subkey"="722500";"value"="150"};
+{"key"="851";"subkey"="724201";"value"="149"};
+{"key"="852";"subkey"="725904";"value"="148"};
+{"key"="853";"subkey"="727609";"value"="147"};
+{"key"="854";"subkey"="729316";"value"="146"};
+{"key"="855";"subkey"="731025";"value"="145"};
+{"key"="856";"subkey"="732736";"value"="144"};
+{"key"="857";"subkey"="734449";"value"="143"};
+{"key"="858";"subkey"="736164";"value"="142"};
+{"key"="859";"subkey"="737881";"value"="141"};
+{"key"="860";"subkey"="739600";"value"="140"};
+{"key"="861";"subkey"="741321";"value"="139"};
+{"key"="862";"subkey"="743044";"value"="138"};
+{"key"="863";"subkey"="744769";"value"="137"};
+{"key"="864";"subkey"="746496";"value"="136"};
+{"key"="865";"subkey"="748225";"value"="135"};
+{"key"="866";"subkey"="749956";"value"="134"};
+{"key"="867";"subkey"="751689";"value"="133"};
+{"key"="868";"subkey"="753424";"value"="132"};
+{"key"="869";"subkey"="755161";"value"="131"};
+{"key"="870";"subkey"="756900";"value"="130"};
+{"key"="871";"subkey"="758641";"value"="129"};
+{"key"="872";"subkey"="760384";"value"="128"};
+{"key"="873";"subkey"="762129";"value"="127"};
+{"key"="874";"subkey"="763876";"value"="126"};
+{"key"="875";"subkey"="765625";"value"="125"};
+{"key"="876";"subkey"="767376";"value"="124"};
+{"key"="877";"subkey"="769129";"value"="123"};
+{"key"="878";"subkey"="770884";"value"="122"};
+{"key"="879";"subkey"="772641";"value"="121"};
+{"key"="880";"subkey"="774400";"value"="120"};
+{"key"="881";"subkey"="776161";"value"="119"};
+{"key"="882";"subkey"="777924";"value"="118"};
+{"key"="883";"subkey"="779689";"value"="117"};
+{"key"="884";"subkey"="781456";"value"="116"};
+{"key"="885";"subkey"="783225";"value"="115"};
+{"key"="886";"subkey"="784996";"value"="114"};
+{"key"="887";"subkey"="786769";"value"="113"};
+{"key"="888";"subkey"="788544";"value"="112"};
+{"key"="889";"subkey"="790321";"value"="111"};
+{"key"="890";"subkey"="792100";"value"="110"};
+{"key"="891";"subkey"="793881";"value"="109"};
+{"key"="892";"subkey"="795664";"value"="108"};
+{"key"="893";"subkey"="797449";"value"="107"};
+{"key"="894";"subkey"="799236";"value"="106"};
+{"key"="895";"subkey"="801025";"value"="105"};
+{"key"="896";"subkey"="802816";"value"="104"};
+{"key"="897";"subkey"="804609";"value"="103"};
+{"key"="898";"subkey"="806404";"value"="102"};
+{"key"="899";"subkey"="808201";"value"="101"};
+{"key"="900";"subkey"="810000";"value"="100"};
+{"key"="901";"subkey"="811801";"value"="99"};
+{"key"="902";"subkey"="813604";"value"="98"};
+{"key"="903";"subkey"="815409";"value"="97"};
+{"key"="904";"subkey"="817216";"value"="96"};
+{"key"="905";"subkey"="819025";"value"="95"};
+{"key"="906";"subkey"="820836";"value"="94"};
+{"key"="907";"subkey"="822649";"value"="93"};
+{"key"="908";"subkey"="824464";"value"="92"};
+{"key"="909";"subkey"="826281";"value"="91"};
+{"key"="910";"subkey"="828100";"value"="90"};
+{"key"="911";"subkey"="829921";"value"="89"};
+{"key"="912";"subkey"="831744";"value"="88"};
+{"key"="913";"subkey"="833569";"value"="87"};
+{"key"="914";"subkey"="835396";"value"="86"};
+{"key"="915";"subkey"="837225";"value"="85"};
+{"key"="916";"subkey"="839056";"value"="84"};
+{"key"="917";"subkey"="840889";"value"="83"};
+{"key"="918";"subkey"="842724";"value"="82"};
+{"key"="919";"subkey"="844561";"value"="81"};
+{"key"="920";"subkey"="846400";"value"="80"};
+{"key"="921";"subkey"="848241";"value"="79"};
+{"key"="922";"subkey"="850084";"value"="78"};
+{"key"="923";"subkey"="851929";"value"="77"};
+{"key"="924";"subkey"="853776";"value"="76"};
+{"key"="925";"subkey"="855625";"value"="75"};
+{"key"="926";"subkey"="857476";"value"="74"};
+{"key"="927";"subkey"="859329";"value"="73"};
+{"key"="928";"subkey"="861184";"value"="72"};
+{"key"="929";"subkey"="863041";"value"="71"};
+{"key"="930";"subkey"="864900";"value"="70"};
+{"key"="931";"subkey"="866761";"value"="69"};
+{"key"="932";"subkey"="868624";"value"="68"};
+{"key"="933";"subkey"="870489";"value"="67"};
+{"key"="934";"subkey"="872356";"value"="66"};
+{"key"="935";"subkey"="874225";"value"="65"};
+{"key"="936";"subkey"="876096";"value"="64"};
+{"key"="937";"subkey"="877969";"value"="63"};
+{"key"="938";"subkey"="879844";"value"="62"};
+{"key"="939";"subkey"="881721";"value"="61"};
+{"key"="940";"subkey"="883600";"value"="60"};
+{"key"="941";"subkey"="885481";"value"="59"};
+{"key"="942";"subkey"="887364";"value"="58"};
+{"key"="943";"subkey"="889249";"value"="57"};
+{"key"="944";"subkey"="891136";"value"="56"};
+{"key"="945";"subkey"="893025";"value"="55"};
+{"key"="946";"subkey"="894916";"value"="54"};
+{"key"="947";"subkey"="896809";"value"="53"};
+{"key"="948";"subkey"="898704";"value"="52"};
+{"key"="949";"subkey"="900601";"value"="51"};
+{"key"="950";"subkey"="902500";"value"="50"};
+{"key"="951";"subkey"="904401";"value"="49"};
+{"key"="952";"subkey"="906304";"value"="48"};
+{"key"="953";"subkey"="908209";"value"="47"};
+{"key"="954";"subkey"="910116";"value"="46"};
+{"key"="955";"subkey"="912025";"value"="45"};
+{"key"="956";"subkey"="913936";"value"="44"};
+{"key"="957";"subkey"="915849";"value"="43"};
+{"key"="958";"subkey"="917764";"value"="42"};
+{"key"="959";"subkey"="919681";"value"="41"};
+{"key"="960";"subkey"="921600";"value"="40"};
+{"key"="961";"subkey"="923521";"value"="39"};
+{"key"="962";"subkey"="925444";"value"="38"};
+{"key"="963";"subkey"="927369";"value"="37"};
+{"key"="964";"subkey"="929296";"value"="36"};
+{"key"="965";"subkey"="931225";"value"="35"};
+{"key"="966";"subkey"="933156";"value"="34"};
+{"key"="967";"subkey"="935089";"value"="33"};
+{"key"="968";"subkey"="937024";"value"="32"};
+{"key"="969";"subkey"="938961";"value"="31"};
+{"key"="970";"subkey"="940900";"value"="30"};
+{"key"="971";"subkey"="942841";"value"="29"};
+{"key"="972";"subkey"="944784";"value"="28"};
+{"key"="973";"subkey"="946729";"value"="27"};
+{"key"="974";"subkey"="948676";"value"="26"};
+{"key"="975";"subkey"="950625";"value"="25"};
+{"key"="976";"subkey"="952576";"value"="24"};
+{"key"="977";"subkey"="954529";"value"="23"};
+{"key"="978";"subkey"="956484";"value"="22"};
+{"key"="979";"subkey"="958441";"value"="21"};
+{"key"="980";"subkey"="960400";"value"="20"};
+{"key"="981";"subkey"="962361";"value"="19"};
+{"key"="982";"subkey"="964324";"value"="18"};
+{"key"="983";"subkey"="966289";"value"="17"};
+{"key"="984";"subkey"="968256";"value"="16"};
+{"key"="985";"subkey"="970225";"value"="15"};
+{"key"="986";"subkey"="972196";"value"="14"};
+{"key"="987";"subkey"="974169";"value"="13"};
+{"key"="988";"subkey"="976144";"value"="12"};
+{"key"="989";"subkey"="978121";"value"="11"};
+{"key"="990";"subkey"="980100";"value"="10"};
+{"key"="991";"subkey"="982081";"value"="9"};
+{"key"="992";"subkey"="984064";"value"="8"};
+{"key"="993";"subkey"="986049";"value"="7"};
+{"key"="994";"subkey"="988036";"value"="6"};
+{"key"="995";"subkey"="990025";"value"="5"};
+{"key"="996";"subkey"="992016";"value"="4"};
+{"key"="997";"subkey"="994009";"value"="3"};
+{"key"="998";"subkey"="996004";"value"="2"};
+{"key"="999";"subkey"="998001";"value"="1"};
+{"key"="1000";"subkey"="1000000";"value"="0"};
diff --git a/yql/essentials/tests/sql/suites/join/test_join_2.txt b/yql/essentials/tests/sql/suites/join/test_join_2.txt
new file mode 100644
index 0000000000..2e5076d14c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/test_join_2.txt
@@ -0,0 +1,100 @@
+{"key"="99";"subkey"="2";"value"="x"};
+{"key"="98";"subkey"="8";"value"="xx"};
+{"key"="97";"subkey"="18";"value"="xxx"};
+{"key"="96";"subkey"="32";"value"="xxxx"};
+{"key"="95";"subkey"="50";"value"="xxxxx"};
+{"key"="94";"subkey"="72";"value"="xxxxxx"};
+{"key"="93";"subkey"="98";"value"="xxxxxxx"};
+{"key"="92";"subkey"="128";"value"="xxxxxxxx"};
+{"key"="91";"subkey"="162";"value"="xxxxxxxxx"};
+{"key"="90";"subkey"="200";"value"="xxxxxxxxxx"};
+{"key"="89";"subkey"="242";"value"="xxxxxxxxxxx"};
+{"key"="88";"subkey"="288";"value"="xxxxxxxxxxxx"};
+{"key"="87";"subkey"="338";"value"="xxxxxxxxxxxxx"};
+{"key"="86";"subkey"="392";"value"="xxxxxxxxxxxxxx"};
+{"key"="85";"subkey"="450";"value"="xxxxxxxxxxxxxxx"};
+{"key"="84";"subkey"="512";"value"="xxxxxxxxxxxxxxxx"};
+{"key"="83";"subkey"="578";"value"="xxxxxxxxxxxxxxxxx"};
+{"key"="82";"subkey"="648";"value"="xxxxxxxxxxxxxxxxxx"};
+{"key"="81";"subkey"="722";"value"="xxxxxxxxxxxxxxxxxxx"};
+{"key"="80";"subkey"="800";"value"="xxxxxxxxxxxxxxxxxxxx"};
+{"key"="79";"subkey"="882";"value"="xxxxxxxxxxxxxxxxxxxxx"};
+{"key"="78";"subkey"="968";"value"="xxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="77";"subkey"="1058";"value"="xxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="76";"subkey"="1152";"value"="xxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="75";"subkey"="1250";"value"="xxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="74";"subkey"="1352";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="73";"subkey"="1458";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="72";"subkey"="1568";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="71";"subkey"="1682";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="70";"subkey"="1800";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="69";"subkey"="1922";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="68";"subkey"="2048";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="67";"subkey"="2178";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="66";"subkey"="2312";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="65";"subkey"="2450";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="64";"subkey"="2592";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="63";"subkey"="2738";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="62";"subkey"="2888";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="61";"subkey"="3042";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="60";"subkey"="3200";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="59";"subkey"="3362";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="58";"subkey"="3528";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="57";"subkey"="3698";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="56";"subkey"="3872";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="55";"subkey"="4050";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="54";"subkey"="4232";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="53";"subkey"="4418";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="52";"subkey"="4608";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="51";"subkey"="4802";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="50";"subkey"="5000";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="49";"subkey"="5202";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="48";"subkey"="5408";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="47";"subkey"="5618";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="46";"subkey"="5832";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="45";"subkey"="6050";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="44";"subkey"="6272";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="43";"subkey"="6498";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="42";"subkey"="6728";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="41";"subkey"="6962";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="40";"subkey"="7200";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="39";"subkey"="7442";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="38";"subkey"="7688";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="37";"subkey"="7938";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="36";"subkey"="8192";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="35";"subkey"="8450";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="34";"subkey"="8712";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="33";"subkey"="8978";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="32";"subkey"="9248";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="31";"subkey"="9522";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="30";"subkey"="9800";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="29";"subkey"="10082";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="28";"subkey"="10368";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="27";"subkey"="10658";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="26";"subkey"="10952";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="25";"subkey"="11250";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="24";"subkey"="11552";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="23";"subkey"="11858";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="22";"subkey"="12168";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="21";"subkey"="12482";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="20";"subkey"="12800";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="19";"subkey"="13122";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="18";"subkey"="13448";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="17";"subkey"="13778";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="16";"subkey"="14112";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="15";"subkey"="14450";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="14";"subkey"="14792";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="13";"subkey"="15138";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="12";"subkey"="15488";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="11";"subkey"="15842";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="10";"subkey"="16200";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="9";"subkey"="16562";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="8";"subkey"="16928";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="7";"subkey"="17298";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="6";"subkey"="17672";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="5";"subkey"="18050";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="4";"subkey"="18432";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="3";"subkey"="18818";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="2";"subkey"="19208";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="1";"subkey"="19602";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
+{"key"="0";"subkey"="20000";"value"="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"};
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities-off.cfg b/yql/essentials/tests/sql/suites/join/three_equalities-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities.cfg b/yql/essentials/tests/sql/suites/join/three_equalities.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities.sql b/yql/essentials/tests/sql/suites/join/three_equalities.sql
new file mode 100644
index 0000000000..51637f9154
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT * FROM
+ Input1 AS A
+JOIN
+ Input2 AS B
+ON
+ A.key == B.key AND
+ (cast(A.subkey AS int) + 1 == cast(B.subkey AS int)) AND
+ A.value == B.value
+ORDER BY A.key
+;
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities_paren-off.cfg b/yql/essentials/tests/sql/suites/join/three_equalities_paren-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities_paren-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities_paren.cfg b/yql/essentials/tests/sql/suites/join/three_equalities_paren.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities_paren.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/three_equalities_paren.sql b/yql/essentials/tests/sql/suites/join/three_equalities_paren.sql
new file mode 100644
index 0000000000..b1be3c32e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/three_equalities_paren.sql
@@ -0,0 +1,11 @@
+PRAGMA DisableSimpleColumns;
+USE plato;
+SELECT * FROM
+ Input2 AS A
+JOIN
+ Input4 AS B
+ON
+ (A.key == B.key) AND
+ (A.subkey == B.subkey) AND
+ (A.value == B.value)
+;
diff --git a/yql/essentials/tests/sql/suites/join/trivial_view-off.cfg b/yql/essentials/tests/sql/suites/join/trivial_view-off.cfg
new file mode 100644
index 0000000000..43f157699a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/trivial_view-off.cfg
@@ -0,0 +1,4 @@
+in Input1 view_input.txt
+in Input2 input.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/trivial_view.cfg b/yql/essentials/tests/sql/suites/join/trivial_view.cfg
new file mode 100644
index 0000000000..3f072cc800
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/trivial_view.cfg
@@ -0,0 +1,2 @@
+in Input1 view_input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/join/trivial_view.sql b/yql/essentials/tests/sql/suites/join/trivial_view.sql
new file mode 100644
index 0000000000..8534f3a0c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/trivial_view.sql
@@ -0,0 +1,9 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+SELECT a.v, b.value
+FROM `Input1` VIEW `ksv` AS a
+JOIN `Input2` AS b
+ON a.k == b.key
+ORDER BY a.v;
diff --git a/yql/essentials/tests/sql/suites/join/two_aggrs.sql b/yql/essentials/tests/sql/suites/join/two_aggrs.sql
new file mode 100644
index 0000000000..1be595ca17
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/two_aggrs.sql
@@ -0,0 +1,18 @@
+USE plato;
+
+PRAGMA yt.JoinMergeForce = "1";
+pragma yt.JoinMergeTablesLimit="10";
+
+$join =
+ SELECT a.key as key1, a.subkey as subkey1
+ FROM (SELECT * FROM Input8 WHERE subkey != "bar") AS a
+ JOIN (SELECT * FROM Input8 WHERE subkey != "foo") AS b
+ ON a.key = b.key AND a.subkey = b.subkey;
+
+SELECT key1, subkey1, count(*)
+FROM $join
+GROUP COMPACT BY subkey1, key1;
+
+SELECT key1, subkey1
+FROM $join
+GROUP COMPACT BY key1, subkey1;
diff --git a/yql/essentials/tests/sql/suites/join/uniqkeys.txt b/yql/essentials/tests/sql/suites/join/uniqkeys.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/uniqkeys.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/join/uniqkeys.txt.attr b/yql/essentials/tests/sql/suites/join/uniqkeys.txt.attr
new file mode 100644
index 0000000000..e847d48e3e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/uniqkeys.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+ "UniqueKeys"=%true
+}}
diff --git a/yql/essentials/tests/sql/suites/join/view_input.txt b/yql/essentials/tests/sql/suites/join/view_input.txt
new file mode 100644
index 0000000000..e1faba7b62
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/view_input.txt
@@ -0,0 +1,3 @@
+{"key"="foo";"subkey"="bar";"value"="jar"};
+{"key"="bar";"subkey"="jar";"value"="foo"};
+{"key"="jar";"subkey"="foo";"value"="baz"};
diff --git a/yql/essentials/tests/sql/suites/join/view_input.txt.attr b/yql/essentials/tests/sql/suites/join/view_input.txt.attr
new file mode 100644
index 0000000000..22c3547210
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/view_input.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_ksv"="SELECT key as k, subkey as s, value as v FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/join/vk1_sorted.txt b/yql/essentials/tests/sql/suites/join/vk1_sorted.txt
new file mode 100644
index 0000000000..0210602a64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk1_sorted.txt
@@ -0,0 +1,32 @@
+{"v1"="01";"k1"="1";"u1"="01"};
+{"v1"="01";"k1"="2";"u1"="02"};
+
+{"v1"="02";"k1"="1";"u1"="03"};
+{"v1"="02";"k1"="1";"u1"="04"};
+{"v1"="02";"k1"="2";"u1"="05"};
+{"v1"="02";"k1"="2";"u1"="06"};
+
+{"v1"="03";"k1"=#; "u1"="07"};
+{"v1"="03";"k1"="1";"u1"="08"};
+{"v1"="03";"k1"="2";"u1"="09"};
+
+{"v1"="04";"k1"="1";"u1"="10"};
+{"v1"="04";"k1"="2";"u1"="11"};
+
+{"v1"="05";"k1"="1";"u1"="12"};
+{"v1"="05";"k1"="2";"u1"="13"};
+
+{"v1"="06";"k1"="1";"u1"="14"};
+{"v1"="06";"k1"="2";"u1"="15"};
+
+{"v1"="07";"k1"="1";"u1"="16"};
+{"v1"="07";"k1"="2";"u1"="17"};
+
+{"v1"="08";"k1"="1";"u1"="18"};
+{"v1"="08";"k1"="2";"u1"="19"};
+
+{"v1"="09";"k1"="1";"u1"="20"};
+{"v1"="09";"k1"="2";"u1"="21"};
+
+{"v1"="10";"k1"="1";"u1"="22"};
+{"v1"="10";"k1"="2";"u1"="23"};
diff --git a/yql/essentials/tests/sql/suites/join/vk1_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/vk1_sorted.txt.attr
new file mode 100644
index 0000000000..068381b88f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk1_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "v1";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "k1";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u1";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/vk2_sorted.txt b/yql/essentials/tests/sql/suites/join/vk2_sorted.txt
new file mode 100644
index 0000000000..1156f3cbef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk2_sorted.txt
@@ -0,0 +1,22 @@
+{"v2"="02";"k2"="1";"u2"="01"};
+{"v2"="02";"k2"="1";"u2"="02"};
+{"v2"="02";"k2"="2";"u2"="03"};
+{"v2"="02";"k2"="2";"u2"="04"};
+
+{"v2"="03";"k2"="1";"u2"="05"};
+{"v2"="03";"k2"="2";"u2"="06"};
+
+{"v2"="04";"k2"="1";"u2"="07"};
+{"v2"="04";"k2"="2";"u2"="08"};
+
+{"v2"="05";"k2"="1";"u2"="09"};
+{"v2"="05";"k2"="2";"u2"="10"};
+
+{"v2"="06";"k2"="1";"u2"="11"};
+{"v2"="06";"k2"="2";"u2"="12"};
+
+{"v2"="07";"k2"="1";"u2"="13"};
+{"v2"="07";"k2"="2";"u2"="14"};
+
+{"v2"="09";"k2"="1";"u2"="15"};
+{"v2"="09";"k2"="2";"u2"="16"};
diff --git a/yql/essentials/tests/sql/suites/join/vk2_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/vk2_sorted.txt.attr
new file mode 100644
index 0000000000..ff5c200f6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk2_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "v2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "k2";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u2";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/vk3_sorted.txt b/yql/essentials/tests/sql/suites/join/vk3_sorted.txt
new file mode 100644
index 0000000000..3b3797f549
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk3_sorted.txt
@@ -0,0 +1,8 @@
+{"v3"=#; "k3"="1";"u3"="01"};
+{"v3"=#; "k3"="2";"u3"="02"};
+
+{"v3"="04";"k3"="1";"u3"="03"};
+{"v3"="04";"k3"="2";"u3"="04"};
+
+{"v3"="05";"k3"="1";"u3"="05"};
+{"v3"="05";"k3"="2";"u3"="06"};
diff --git a/yql/essentials/tests/sql/suites/join/vk3_sorted.txt.attr b/yql/essentials/tests/sql/suites/join/vk3_sorted.txt.attr
new file mode 100644
index 0000000000..c399355613
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/vk3_sorted.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false
+ >
+ [
+ {
+ "name" = "v3";
+ "required" = %false;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "k3";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "string"
+ };
+ {
+ "name" = "u3";
+ "required" = %true;
+ "type" = "string"
+ }
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/join/wrong_order_by_col.sqlx b/yql/essentials/tests/sql/suites/join/wrong_order_by_col.sqlx
new file mode 100644
index 0000000000..777ffc883f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/wrong_order_by_col.sqlx
@@ -0,0 +1,16 @@
+USE plato;
+
+$input = (
+ SELECT key, subkey, value FROM Input
+);
+
+--INSERT INTO Output
+SELECT
+ i1.key as kk,
+ i2.value as val
+FROM $input as i1
+FULL JOIN $input as i2
+ON cast(i1.key as uint32) % 10 = cast(i2.subkey as uint32)
+ORDER BY
+ i1.kk, -- invalid column, should be either kk or i1.key
+ i2.val -- invalid column, should be either val or i2.value
diff --git a/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns-off.cfg b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.cfg b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.sql b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.sql
new file mode 100644
index 0000000000..543df58892
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-10654_pullup_with_sys_columns.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+$src =
+ select key, subkey || key as subkey, value from Input
+ union all
+ select * from AS_TABLE(ListCreate(Struct<key:String,subkey:String,value:String>));
+
+select a.key, a.subkey, b.value
+from Input as a
+left join $src as b using(key)
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/join/yql-12022-off.cfg b/yql/essentials/tests/sql/suites/join/yql-12022-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-12022-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-12022.cfg b/yql/essentials/tests/sql/suites/join/yql-12022.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-12022.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-12022.sql b/yql/essentials/tests/sql/suites/join/yql-12022.sql
new file mode 100644
index 0000000000..15766d3004
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-12022.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+DEFINE SUBQUERY $sub($name) AS
+ SELECT * FROM $name
+END DEFINE;
+
+SELECT a.key
+FROM $sub("Input") AS a
+INNER JOIN Input AS b
+ON a.key = b.key
+WHERE JoinTableRow().`a.subkey` == "wat"
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_left-off.cfg b/yql/essentials/tests/sql/suites/join/yql-14829_left-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_left-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_left.cfg b/yql/essentials/tests/sql/suites/join/yql-14829_left.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_left.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_left.sql b/yql/essentials/tests/sql/suites/join/yql-14829_left.sql
new file mode 100644
index 0000000000..8e36a759e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_left.sql
@@ -0,0 +1,35 @@
+USE plato;
+
+pragma yt.JoinEnableStarJoin="true";
+
+insert into @x
+select Just('xxx') as id
+order by id;
+
+insert into @y
+select Just('yyy') as id
+order by id;
+
+insert into @a
+select Just('aaa') as id
+order by id;
+
+commit;
+
+
+$xy_left = (
+ SELECT
+ x.id AS id
+ FROM
+ ANY @x AS x
+ LEFT JOIN ANY @y AS y
+ ON x.id == y.id
+);
+
+SELECT
+ *
+FROM
+ ANY @a AS a
+ LEFT JOIN ANY $xy_left AS b
+ ON a.id == b.id;
+
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_leftonly-off.cfg b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.cfg b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.sql b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.sql
new file mode 100644
index 0000000000..50ef1bae40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14829_leftonly.sql
@@ -0,0 +1,35 @@
+USE plato;
+
+pragma yt.JoinEnableStarJoin="true";
+
+insert into @x
+select Just('xxx') as id
+order by id;
+
+insert into @y
+select Just('yyy') as id
+order by id;
+
+insert into @a
+select Just('aaa') as id
+order by id;
+
+commit;
+
+
+$xy_leftonly = (
+ SELECT
+ x.id AS id
+ FROM
+ @x AS x
+ LEFT ONLY JOIN @y AS y
+ ON x.id == y.id
+);
+
+SELECT
+ *
+FROM
+ @a AS a
+ LEFT ONLY JOIN $xy_leftonly AS b
+ ON a.id == b.id;
+
diff --git a/yql/essentials/tests/sql/suites/join/yql-14847-off.cfg b/yql/essentials/tests/sql/suites/join/yql-14847-off.cfg
new file mode 100644
index 0000000000..86539293ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14847-off.cfg
@@ -0,0 +1,5 @@
+in Input1 input1.txt
+in Input2 input7.txt
+in Input3 input3.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-14847.cfg b/yql/essentials/tests/sql/suites/join/yql-14847.cfg
new file mode 100644
index 0000000000..5cac58c60c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14847.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+in Input2 input7.txt
+in Input3 input3.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-14847.sql b/yql/essentials/tests/sql/suites/join/yql-14847.sql
new file mode 100644
index 0000000000..25d2f0394f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-14847.sql
@@ -0,0 +1,23 @@
+USE plato;
+
+pragma yt.MapJoinLimit="1M";
+
+$t = (
+SELECT
+ l.key as key,
+ r.subkey as subkey,
+ l.value || r.value as value
+FROM
+ Input1 as l
+CROSS JOIN
+ Input2 as r
+);
+
+SELECT
+ l.*,
+ r.value as rvalue
+FROM
+ $t as l
+LEFT JOIN
+ Input3 as r
+ON l.key = coalesce("" || r.key, "")
diff --git a/yql/essentials/tests/sql/suites/join/yql-16011.cfg b/yql/essentials/tests/sql/suites/join/yql-16011.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-16011.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/yql-16011.sql b/yql/essentials/tests/sql/suites/join/yql-16011.sql
new file mode 100644
index 0000000000..bb8698027d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-16011.sql
@@ -0,0 +1,27 @@
+USE plato;
+
+PRAGMA AnsiInForEmptyOrNullableItemsCollections = "true";
+PRAGMA yt.MapJoinLimit="1m";
+PRAGMA yt.LookupJoinLimit="64k";
+PRAGMA yt.LookupJoinMaxRows="100";
+
+
+insert into @T1
+select Just('fooo'u) as ID order by ID;
+
+insert into @T2
+select 't' as text, '{}'y as tags, 'foo' as ID
+order by ID;
+
+commit;
+
+
+$lost_ids = SELECT ID FROM @T2 WHERE ID NOT IN (SELECT ID FROM @T1);
+$lost_samples_after_align = SELECT * FROM @T2 WHERE ID IN $lost_ids;
+
+SELECT * FROM $lost_samples_after_align;
+
+SELECT
+ text || 'a' as text,
+ tags,
+FROM $lost_samples_after_align;
diff --git a/yql/essentials/tests/sql/suites/join/yql-19081.cfg b/yql/essentials/tests/sql/suites/join/yql-19081.cfg
new file mode 100644
index 0000000000..aaba13cbfa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-19081.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted_uniq.txt
+in Input2 sorted_uniq.txt
+in Input3 input1.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/yql-19081.sql b/yql/essentials/tests/sql/suites/join/yql-19081.sql
new file mode 100644
index 0000000000..215ba02fe4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-19081.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+pragma yt.JoinMergeTablesLimit="100";
+pragma yt.MapJoinLimit="10M";
+pragma yt.MaxReplicationFactorToFuseOperations="1";
+
+SELECT
+ a.key, a.subkey, c.value
+FROM Input1 as a
+JOIN /*+ merge() */ Input2 as b ON a.key = b.key AND a.subkey = b.subkey
+JOIN Input3 as c ON b.key = c.key AND b.subkey = c.subkey
+ORDER BY c.value;
diff --git a/yql/essentials/tests/sql/suites/join/yql-4275-off.cfg b/yql/essentials/tests/sql/suites/join/yql-4275-off.cfg
new file mode 100644
index 0000000000..3e2c239448
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-4275-off.cfg
@@ -0,0 +1,3 @@
+in Input yql-4275.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-4275.cfg b/yql/essentials/tests/sql/suites/join/yql-4275.cfg
new file mode 100644
index 0000000000..4461be80f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-4275.cfg
@@ -0,0 +1 @@
+in Input yql-4275.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-4275.sql b/yql/essentials/tests/sql/suites/join/yql-4275.sql
new file mode 100644
index 0000000000..99096a7bbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-4275.sql
@@ -0,0 +1,10 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+USE plato;
+
+SELECT
+*
+FROM Input as x1
+JOIN (select key ?? 4 as key from Input) as x2 on x1.key == x2.key
+WHERE x2.key == 4
+;
diff --git a/yql/essentials/tests/sql/suites/join/yql-4275.txt b/yql/essentials/tests/sql/suites/join/yql-4275.txt
new file mode 100644
index 0000000000..172a11b713
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-4275.txt
@@ -0,0 +1,6 @@
+{"key"=#;subkey=".";"value"="E"};
+{"key"=#;subkey=".";"value"="F"};
+{"key"=#;subkey=".";"value"="G"};
+{"key"=1;subkey=".";"value"="A"};
+{"key"=4;subkey=".";"value"="C"};
+{"key"=4;subkey=".";"value"="D"};
diff --git a/yql/essentials/tests/sql/suites/join/yql-4275.txt.attr b/yql/essentials/tests/sql/suites/join/yql-4275.txt.attr
new file mode 100644
index 0000000000..4c1e650192
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-4275.txt.attr
@@ -0,0 +1,40 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers"=["key";"subkey"];"SortedBy"=["key";"subkey"];"SortDirections"=[1;1];"SortedByTypes"=[["OptionalType";["DataType";"Int32"]];["OptionalType";["DataType";"String"]]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Int32"
+ ]
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ];
+ [
+ "value";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/join/yql-6199-off.cfg b/yql/essentials/tests/sql/suites/join/yql-6199-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6199-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-6199.cfg b/yql/essentials/tests/sql/suites/join/yql-6199.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6199.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-6199.sql b/yql/essentials/tests/sql/suites/join/yql-6199.sql
new file mode 100644
index 0000000000..bb2decf34d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6199.sql
@@ -0,0 +1,12 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+
+$i = (select 1 as key);
+
+$j1 = (select a2.key,b.key as k from $i as a2 join $i as b on a2.key = b.key);
+
+select a.* from $j1 as a join $i as d on a.k = d.key;
+
+$j2 = (select a.key,b.key as k from $i as a join $i as b on a.key = b.key);
+
+select a.* from $j2 as a join $i as d on a.k = d.key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/join/yql-6297-off.cfg b/yql/essentials/tests/sql/suites/join/yql-6297-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6297-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-6297.cfg b/yql/essentials/tests/sql/suites/join/yql-6297.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6297.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-6297.sql b/yql/essentials/tests/sql/suites/join/yql-6297.sql
new file mode 100644
index 0000000000..1d8bd0c1de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-6297.sql
@@ -0,0 +1,21 @@
+PRAGMA DisableSimpleColumns;
+/* postgres can not */
+$input = (
+select 2 as id,
+3 as taskId,
+4 as previousId
+union all
+
+select 1 as id,
+null as taskId,
+2 as previousId
+);
+
+SELECT count(*)
+FROM $input AS diff
+INNER JOIN $input AS taskSuite ON diff.previousId = taskSuite.id
+LEFT JOIN $input AS pedestrian ON diff.taskId = pedestrian.id
+WHERE
+diff.id = 1
+;
+
diff --git a/yql/essentials/tests/sql/suites/join/yql-8125-off.cfg b/yql/essentials/tests/sql/suites/join/yql-8125-off.cfg
new file mode 100644
index 0000000000..76a2a2b6a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8125-off.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-8125.cfg b/yql/essentials/tests/sql/suites/join/yql-8125.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8125.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-8125.sql b/yql/essentials/tests/sql/suites/join/yql-8125.sql
new file mode 100644
index 0000000000..b3d81a5509
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8125.sql
@@ -0,0 +1,29 @@
+use plato;
+
+PRAGMA yt.JoinCollectColumnarStatistics="async";
+
+INSERT INTO @yang_ids
+SELECT
+ *
+ from Input
+ where subkey <= "3"
+ LIMIT 100;
+commit;
+
+INSERT INTO @yang_ids
+ SELECT
+ *
+ from Input as j
+ LEFT ONLY JOIN @yang_ids
+ USING(key);
+commit;
+
+INSERT INTO @yang_ids
+ SELECT
+ *
+ from Input as j
+ LEFT ONLY JOIN @yang_ids
+ USING(key);
+commit;
+
+select * from @yang_ids;
diff --git a/yql/essentials/tests/sql/suites/join/yql-8131-off.cfg b/yql/essentials/tests/sql/suites/join/yql-8131-off.cfg
new file mode 100644
index 0000000000..be399805c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8131-off.cfg
@@ -0,0 +1,2 @@
+in Input input_intersect.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/join/yql-8131.cfg b/yql/essentials/tests/sql/suites/join/yql-8131.cfg
new file mode 100644
index 0000000000..32d89a04e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8131.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/join/yql-8131.sql b/yql/essentials/tests/sql/suites/join/yql-8131.sql
new file mode 100644
index 0000000000..bcdb5aa485
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8131.sql
@@ -0,0 +1,14 @@
+/* kikimr can not */
+use plato;
+
+PRAGMA DisableSimpleColumns;
+PRAGMA yt.JoinCollectColumnarStatistics="async";
+PRAGMA yt.MinTempAvgChunkSize="0";
+PRAGMA yt.MapJoinLimit="1";
+
+SELECT *
+FROM (select distinct key,subkey from Input where cast(key as Int32) > 100 order by key limit 100) as a
+RIGHT JOIN (select key,value from Input where cast(key as Int32) < 500) as b
+USING(key)
+ORDER BY a.key,a.subkey,b.value;
+
diff --git a/yql/essentials/tests/sql/suites/join/yql-8980-off.cfg b/yql/essentials/tests/sql/suites/join/yql-8980-off.cfg
new file mode 100644
index 0000000000..61ca79e527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8980-off.cfg
@@ -0,0 +1,7 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql-8980.cfg b/yql/essentials/tests/sql/suites/join/yql-8980.cfg
new file mode 100644
index 0000000000..5ffa9b00c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8980.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 input1.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql-8980.sql b/yql/essentials/tests/sql/suites/join/yql-8980.sql
new file mode 100644
index 0000000000..e2701ee730
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql-8980.sql
@@ -0,0 +1,15 @@
+USE plato;
+
+$foo = (SELECT key, subkey, value IN ("wat", "bar") AS value FROM Input);
+
+SELECT
+ R0.key, R0.subkey, R0.value,
+ R1.key, R1.subkey, R1.value,
+ R2.key, R2.value
+FROM $foo AS R0
+LEFT JOIN $foo AS R1 ON
+ R0.subkey = R1.key
+LEFT JOIN $foo AS R2 ON
+ R1.subkey = R2.key
+ORDER BY R0.key;
+
diff --git a/yql/essentials/tests/sql/suites/join/yql_465-off.cfg b/yql/essentials/tests/sql/suites/join/yql_465-off.cfg
new file mode 100644
index 0000000000..e6a2551297
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql_465-off.cfg
@@ -0,0 +1,4 @@
+in a input1.txt
+in b input2.txt
+providers dq
+pragma Dq.HashJoinMode='off';
diff --git a/yql/essentials/tests/sql/suites/join/yql_465.cfg b/yql/essentials/tests/sql/suites/join/yql_465.cfg
new file mode 100644
index 0000000000..96c331a7fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql_465.cfg
@@ -0,0 +1,2 @@
+in a input1.txt
+in b input2.txt
diff --git a/yql/essentials/tests/sql/suites/join/yql_465.sql b/yql/essentials/tests/sql/suites/join/yql_465.sql
new file mode 100644
index 0000000000..4054dc97c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/join/yql_465.sql
@@ -0,0 +1,3 @@
+PRAGMA DisableSimpleColumns;
+use plato;
+select * from (select * from a where a.key > "zzz") as a join b on a.key == b.key;
diff --git a/yql/essentials/tests/sql/suites/json/combination/nested.sql b/yql/essentials/tests/sql/suites/json/combination/nested.sql
new file mode 100644
index 0000000000..39c6f64daa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/combination/nested.sql
@@ -0,0 +1,55 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Check that Json2::Parse/Serialize calls fold
+$json = CAST(@@{
+ "a": {
+ "b": {
+ "c": {
+ "d": "Matreshka!"
+ }
+ }
+ }
+}@@ as Json);
+
+SELECT
+ JSON_VALUE(
+ JSON_QUERY(
+ JSON_QUERY(
+ JSON_QUERY(
+ $json,
+ "strict $.a"
+ ),
+ "strict $.b"
+ ),
+ "strict $.c"
+ ),
+ "strict $.d"
+ );
+
+SELECT
+ JSON_EXISTS(
+ JSON_QUERY(
+ JSON_QUERY(
+ JSON_QUERY(
+ $json,
+ "strict $.a"
+ ),
+ "strict $.b"
+ ),
+ "strict $.c"
+ ),
+ "strict $.d"
+ );
+
+SELECT
+ JSON_QUERY(
+ JSON_QUERY(
+ JSON_QUERY(
+ $json,
+ "strict $.a"
+ ),
+ "strict $.b"
+ ),
+ "strict $.c"
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/combination/unwrapped.sql b/yql/essentials/tests/sql/suites/json/combination/unwrapped.sql
new file mode 100644
index 0000000000..fe40242344
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/combination/unwrapped.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = Unwrap(CAST(@@{"x": 1}@@ as Json));
+
+SELECT
+ JSON_EXISTS($json, "strict $.x"),
+ JSON_VALUE($json, "strict $.x"),
+ JSON_QUERY($json, "strict $");
diff --git a/yql/essentials/tests/sql/suites/json/default.cfg b/yql/essentials/tests/sql/suites/json/default.cfg
new file mode 100644
index 0000000000..d47da430a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/default.cfg
@@ -0,0 +1 @@
+udf json2_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/example.txt b/yql/essentials/tests/sql/suites/json/example.txt
new file mode 100644
index 0000000000..a92e25dc49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/example.txt
@@ -0,0 +1,6 @@
+{"K"=101;"J"="{ \"who\": \"Fred\", \"where\": \"General Products\", \"friends\": [ { \"name\": \"Lili\", \"rank\": 5 }, {\"name\": \"Hank\", \"rank\": 7} ] }"};
+{"K"=102;"J"="{ \"who\": \"Tom\", \"where\": \"MultiCorp\", \"friends\": [ { \"name\": \"Sharon\", \"rank\": 2}, {\"name\": \"Monty\", \"rank\": 3} ] }"};
+{"K"=103;"J"="{ \"who\": \"Jack\",\"friends\": [ { \"name\": \"Connie\" } ] }"};
+{"K"=104;"J"="{ \"who\": \"Joe\",\"friends\": [ { \"name\": \"Doris\" }, {\"rank\": 1} ] }"};
+{"K"=105;"J"="{ \"who\": \"Mabel\", \"where\": \"Black Label\",\"friends\": [ { \"name\": \"Buck\", \"rank\": 6} ] }"};
+{"K"=106;"J"="{ \"who\": \"Louise\", \"where\": \"Iana\" }"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/example.txt.attr b/yql/essentials/tests/sql/suites/json/example.txt.attr
new file mode 100644
index 0000000000..b828b62de7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/example.txt.attr
@@ -0,0 +1,23 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "K";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "J";
+ [
+ "DataType";
+ "Json"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/common_syntax.sql b/yql/essentials/tests/sql/suites/json/json_exists/common_syntax.sql
new file mode 100644
index 0000000000..008fede78d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/common_syntax.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Null handling
+SELECT
+ JSON_EXISTS(NULL, "strict $.key"),
+ JSON_EXISTS(Nothing(Json?), "strict $.key");
+
+-- Casual select
+$json = CAST(@@{"key": 128}@@ as Json);
+SELECT
+ JSON_EXISTS($json, "strict $.key");
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/example.cfg b/yql/essentials/tests/sql/suites/json/json_exists/example.cfg
new file mode 100644
index 0000000000..ae59265f21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/example.cfg
@@ -0,0 +1,3 @@
+in T example.txt
+in Filter1 json_exists/filter_example1.txt
+in Filter2 json_exists/filter_example2.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/example.sql b/yql/essentials/tests/sql/suites/json/json_exists/example.sql
new file mode 100644
index 0000000000..7c903f4fe8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/example.sql
@@ -0,0 +1,48 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+-- These examples are taken from [ISO/IEC TR 19075-6:2017] standard (https://www.iso.org/standard/67367.html)
+SELECT T.K
+FROM T
+WHERE JSON_EXISTS (T.J, 'lax $.where');
+
+SELECT T.K
+FROM T
+WHERE JSON_EXISTS (T.J, 'strict $.where');
+
+SELECT T.K
+FROM T
+WHERE JSON_EXISTS(T.J, 'strict $.where' FALSE ON ERROR);
+
+SELECT T.K
+FROM T
+WHERE JSON_EXISTS (T.J, 'strict $.friends[*].rank');
+
+-- NOTE: Table "T" was renamed to "Filter{index}" to combine several filter examples in 1 test
+SELECT K
+FROM Filter1
+WHERE JSON_EXISTS (Filter1.J, 'lax $ ? (@.pay/@.hours > 9)');
+
+SELECT K
+FROM Filter1
+WHERE JSON_EXISTS (Filter1.J, 'strict $ ? (@.pay/@.hours > 9)');
+
+SELECT K
+FROM Filter2
+WHERE JSON_EXISTS (Filter2.J, 'lax $ ? (@.pay/@.hours > 9)');
+
+SELECT K
+FROM Filter2
+WHERE JSON_EXISTS (Filter2.J, 'strict $ ? (@.pay/@.hours > 9)');
+
+SELECT K
+FROM Filter2
+WHERE JSON_EXISTS (Filter2.J, 'lax $ ? (@.hours > 9)');
+
+SELECT K
+FROM Filter2
+WHERE JSON_EXISTS (Filter2.J, 'strict $ ? (@.hours > 9)');
+
+-- NOTE: Standard also provides several examples with is unknown predicate. Following their inimitable style
+-- standard authors do not provide data for these examples so we do not include them here
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt b/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt
new file mode 100644
index 0000000000..b5172d31c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt
@@ -0,0 +1,2 @@
+{"K"=101;"J"="{ \"pay\": 100, \"hours\": 10 }"};
+{"K"=102;"J"="{ \"pay\": 100, \"hours\": \"ten\" }"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt.attr b/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt.attr
new file mode 100644
index 0000000000..b828b62de7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/filter_example1.txt.attr
@@ -0,0 +1,23 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "K";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "J";
+ [
+ "DataType";
+ "Json"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt b/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt
new file mode 100644
index 0000000000..49e32a09bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt
@@ -0,0 +1,2 @@
+{"K"=101;"J"="{ \"pay\": 100, \"hours\": 10 }"};
+{"K"=102;"J"="{ \"pay\": 100, \"horas\": 10 }"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt.attr b/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt.attr
new file mode 100644
index 0000000000..b828b62de7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/filter_example2.txt.attr
@@ -0,0 +1,23 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "K";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "J";
+ [
+ "DataType";
+ "Json"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/on_error.sql b/yql/essentials/tests/sql/suites/json/json_exists/on_error.sql
new file mode 100644
index 0000000000..9cb826d6f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/on_error.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause jsonpath error in strict mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_EXISTS($json, "strict $.key"), -- defaults to FALSE ON ERROR
+ JSON_EXISTS($json, "strict $.key" FALSE ON ERROR),
+ JSON_EXISTS($json, "strict $.key" TRUE ON ERROR),
+ JSON_EXISTS($json, "strict $.key" UNKNOWN ON ERROR); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.cfg b/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.sql b/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.sql
new file mode 100644
index 0000000000..4670b0aa58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/on_error_exception.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause jsonpath error in strict mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_EXISTS($json, "strict $.key" ERROR ON ERROR); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/passing.sql b/yql/essentials/tests/sql/suites/json/json_exists/passing.sql
new file mode 100644
index 0000000000..0a71d78170
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/passing.sql
@@ -0,0 +1,102 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Check all supported types for variables
+SELECT
+ -- Numeric types
+ JSON_EXISTS(
+ $json,
+ "strict $var1 + $var2 + $var3 + $var4 + $var5 + $var6 + $var7 + $var8 + $var9 + $var10"
+ PASSING
+ CAST(1 as Int8) as var1,
+ CAST(2 as Uint8) as var2,
+ CAST(3 as Int16) as var3,
+ CAST(4 as Uint16) as var4,
+ CAST(5 as Int32) as var5,
+ CAST(6 as Uint32) as var6,
+ CAST(7 as Int64) as var7,
+ CAST(8 as Uint64) as var8,
+ CAST(9 as Double) as var9,
+ CAST(10 as Float) as var10
+ ),
+ -- Time types
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Datetime) as var
+ ),
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Timestamp) as var
+ ),
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("2020-02-18" as Date) as var
+ ),
+ -- Utf8
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("привет" as Utf8) as var
+ ),
+ -- Bool
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ true as var
+ ),
+ -- Json
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ $json as var
+ ),
+ -- Nulls
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ Nothing(Int64?) as var
+ ),
+ JSON_EXISTS(
+ $json,
+ "strict $var"
+ PASSING
+ NULL as var
+ );
+
+-- Check various ways to pass variable name
+SELECT
+ JSON_EXISTS(
+ $json, "strict $var1"
+ PASSING
+ 123 as var1
+ ),
+ -- NOTE: VaR1 is not casted to upper-case VAR1 as standard expects
+ JSON_EXISTS(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as VaR1
+ ),
+ JSON_EXISTS(
+ $json, "strict $var1"
+ PASSING
+ 123 as "var1"
+ ),
+ JSON_EXISTS(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as "VaR1"
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.cfg b/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.sql b/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.sql
new file mode 100644
index 0000000000..540741eeba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_exists/passing_exception.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Tuple type is not supported for variables
+SELECT
+ JSON_EXISTS(
+ $json, "strict $var"
+ PASSING
+ AsTuple(1, 2) as var
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/common_syntax.sql b/yql/essentials/tests/sql/suites/json/json_query/common_syntax.sql
new file mode 100644
index 0000000000..9edb14f795
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/common_syntax.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Null handling
+SELECT
+ JSON_QUERY(NULL, "strict $.key"),
+ JSON_QUERY(Nothing(Json?), "strict $.key");
+
+-- Casual select
+$json = CAST(@@{"key": [1, 2, 3]}@@ as Json);
+SELECT
+ JSON_QUERY($json, "strict $.key");
diff --git a/yql/essentials/tests/sql/suites/json/json_query/example.cfg b/yql/essentials/tests/sql/suites/json/json_query/example.cfg
new file mode 100644
index 0000000000..d23c2d6847
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/example.cfg
@@ -0,0 +1 @@
+in T example.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/example.sql b/yql/essentials/tests/sql/suites/json/json_query/example.sql
new file mode 100644
index 0000000000..bdac8376bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/example.sql
@@ -0,0 +1,47 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+-- These examples are taken from [ISO/IEC TR 19075-6:2017] standard (https://www.iso.org/standard/67367.html)
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ JSON_VALUE (T.J, 'lax $.where' NULL ON EMPTY) AS Nali,
+ JSON_QUERY (T.J, 'lax $.friends') AS Friends
+FROM T
+WHERE JSON_EXISTS (T.J, 'lax $.friends');
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ JSON_VALUE (T.J, 'lax $.where' NULL ON EMPTY) AS Nali,
+ JSON_QUERY (T.J, 'lax $.friends' NULL ON EMPTY) AS Friends
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ JSON_VALUE (T.J, 'lax $.where' NULL ON EMPTY) AS Nali,
+ JSON_QUERY (T.J, 'lax $.friends.name' WITH ARRAY WRAPPER) AS FriendsNames
+FROM T;
+
+-- In standard this example is demonstrated using PDF table, without any queries.
+-- We represent it as set of queries, using NULL as error value.
+-- Each SELECT is a row in source PDF table
+$J2 = CAST(@@{ "a": "[1,2]", "b": [1,2], "c": "hi"}@@ as Json);
+SELECT
+ JSON_VALUE($J2, "strict $.a"),
+ JSON_VALUE($J2, "strict $.b" NULL ON ERROR),
+ JSON_VALUE($J2, "strict $.c");
+
+SELECT
+ JSON_QUERY($J2, "strict $.a" WITHOUT ARRAY WRAPPER NULL ON ERROR),
+ JSON_QUERY($J2, "strict $.b" WITHOUT ARRAY WRAPPER),
+ JSON_QUERY($J2, "strict $.c" WITHOUT ARRAY WRAPPER NULL ON ERROR);
+
+SELECT
+ JSON_QUERY($J2, "strict $.a" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($J2, "strict $.b" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($J2, "strict $.c" WITH UNCONDITIONAL ARRAY WRAPPER);
+
+SELECT
+ JSON_QUERY($J2, "strict $.a" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($J2, "strict $.b" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($J2, "strict $.c" WITH CONDITIONAL ARRAY WRAPPER);
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_empty.sql b/yql/essentials/tests/sql/suites/json/json_query/on_empty.sql
new file mode 100644
index 0000000000..e6d8d4482b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_empty.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause empty result in lax mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_QUERY($json, "lax $.key"), -- defaults to NULL ON EMPTY
+ JSON_QUERY($json, "lax $.key" NULL ON EMPTY),
+ JSON_QUERY($json, "lax $.key" EMPTY ARRAY ON EMPTY),
+ JSON_QUERY($json, "lax $.key" EMPTY OBJECT ON EMPTY); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.cfg b/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.sql b/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.sql
new file mode 100644
index 0000000000..4298669f03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_empty_exception.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause empty result in lax mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_QUERY($json, "lax $.key" ERROR ON EMPTY); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_error.sql b/yql/essentials/tests/sql/suites/json/json_query/on_error.sql
new file mode 100644
index 0000000000..048db96610
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_error.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause jsonpath error in strict mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_QUERY($json, "strict $.key"), -- defaults to NULL ON ERROR
+ JSON_QUERY($json, "strict $.key" NULL ON ERROR),
+ JSON_QUERY($json, "strict $.key" EMPTY ARRAY ON ERROR),
+ JSON_QUERY($json, "strict $.key" EMPTY OBJECT ON ERROR); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.cfg b/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.sql b/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.sql
new file mode 100644
index 0000000000..6b1a7e0701
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/on_error_exception.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause jsonpath error in strict mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_QUERY($json, "strict $.key" ERROR ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_query/passing.sql b/yql/essentials/tests/sql/suites/json/json_query/passing.sql
new file mode 100644
index 0000000000..f1b09b1d27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/passing.sql
@@ -0,0 +1,114 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Check all supported types for variables
+SELECT
+ -- Numeric types
+ JSON_QUERY(
+ $json,
+ "strict $var1 + $var2 + $var3 + $var4 + $var5 + $var6 + $var7 + $var8 + $var9 + $var10"
+ PASSING
+ CAST(1 as Int8) as var1,
+ CAST(2 as Uint8) as var2,
+ CAST(3 as Int16) as var3,
+ CAST(4 as Uint16) as var4,
+ CAST(5 as Int32) as var5,
+ CAST(6 as Uint32) as var6,
+ CAST(7 as Int64) as var7,
+ CAST(8 as Uint64) as var8,
+ CAST(9 as Double) as var9,
+ CAST(10 as Float) as var10
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ -- Time types
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Datetime) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Timestamp) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("2020-02-18" as Date) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ -- Utf8
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("привет" as Utf8) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ -- Bool
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ true as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ -- Json
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ $json as var
+ ),
+ -- Nulls
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ Nothing(Int64?) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ JSON_QUERY(
+ $json,
+ "strict $var"
+ PASSING
+ NULL as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ );
+
+-- Check various ways to pass variable name
+SELECT
+ JSON_QUERY(
+ $json, "strict $var1"
+ PASSING
+ 123 as var1
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ -- NOTE: VaR1 is not casted to upper-case VAR1 as standard expects
+ JSON_QUERY(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as VaR1
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ JSON_QUERY(
+ $json, "strict $var1"
+ PASSING
+ 123 as "var1"
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ),
+ JSON_QUERY(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as "VaR1"
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/passing_exception.cfg b/yql/essentials/tests/sql/suites/json/json_query/passing_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/passing_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/passing_exception.sql b/yql/essentials/tests/sql/suites/json/json_query/passing_exception.sql
new file mode 100644
index 0000000000..0be7f24fa1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/passing_exception.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Tuple type is not supported for variables
+SELECT
+ JSON_QUERY(
+ $json, "strict $var"
+ PASSING
+ AsTuple(1, 2) as var
+ WITH UNCONDITIONAL ARRAY WRAPPER
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_query/wrapper.sql b/yql/essentials/tests/sql/suites/json/json_query/wrapper.sql
new file mode 100644
index 0000000000..7ec077f53c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_query/wrapper.sql
@@ -0,0 +1,54 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "object": {"key": 123},
+ "multi_object": [{"key": 123}, {"key": 456}, {"key": 789}],
+ "array": [1, 2, 3],
+ "multi_array": [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
+}@@ as Json);
+
+-- Check JSON_QUERY without wrapper
+SELECT
+ JSON_QUERY($json, "strict $.array"), -- defaults to WITHOUT ARRAY WRAPPER
+ JSON_QUERY($json, "strict $.array" WITHOUT WRAPPER),
+ JSON_QUERY($json, "strict $.array" WITHOUT ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.object"), -- defaults to WITHOUT ARRAY WRAPPER
+ JSON_QUERY($json, "strict $.object" WITHOUT WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITHOUT ARRAY WRAPPER);
+
+-- Check UNCONDITIONAL wrapper
+SELECT
+ JSON_QUERY($json, "strict $.array" WITH WRAPPER), -- default to WITH UNCONDITIONAL WRAPPER
+ JSON_QUERY($json, "strict $.array" WITH ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.array" WITH UNCONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.array" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITH WRAPPER), -- default to WITH UNCONDITIONAL WRAPPER
+ JSON_QUERY($json, "strict $.object" WITH ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITH UNCONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.array[*]" WITH WRAPPER), -- default to WITH UNCONDITIONAL WRAPPER
+ JSON_QUERY($json, "strict $.array[*]" WITH ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.array[*]" WITH UNCONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.array[*]" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH WRAPPER), -- default to WITH UNCONDITIONAL WRAPPER
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH UNCONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH UNCONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH WRAPPER), -- default to WITH UNCONDITIONAL WRAPPER
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH UNCONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH UNCONDITIONAL ARRAY WRAPPER);
+
+-- Check CONDITIONAL wrapper
+SELECT
+ JSON_QUERY($json, "strict $.array" WITH CONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.array" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITH CONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.object" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.array[*]" WITH CONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.array[*]" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH CONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.multi_array[*]" WITH CONDITIONAL ARRAY WRAPPER),
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH CONDITIONAL WRAPPER),
+ JSON_QUERY($json, "strict $.multi_object[*]" WITH CONDITIONAL ARRAY WRAPPER);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/common_syntax.sql b/yql/essentials/tests/sql/suites/json/json_value/common_syntax.sql
new file mode 100644
index 0000000000..19d17798b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/common_syntax.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Null handling
+SELECT
+ JSON_VALUE(NULL, "strict $.key"),
+ JSON_VALUE(Nothing(Json?), "strict $.key");
+
+-- Casual select
+$json = CAST(@@{"key": 128}@@ as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key");
diff --git a/yql/essentials/tests/sql/suites/json/json_value/example.cfg b/yql/essentials/tests/sql/suites/json/json_value/example.cfg
new file mode 100644
index 0000000000..d23c2d6847
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/example.cfg
@@ -0,0 +1 @@
+in T example.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/example.sql b/yql/essentials/tests/sql/suites/json/json_value/example.sql
new file mode 100644
index 0000000000..b62ed6648b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/example.sql
@@ -0,0 +1,55 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+-- These examples are taken from [ISO/IEC TR 19075-6:2017] standard (https://www.iso.org/standard/67367.html)
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ JSON_VALUE (T.J, 'lax $.where'
+ NULL ON EMPTY) AS Nali
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'strict $.who') AS Who,
+ JSON_VALUE (T.J, 'strict $.where'
+ DEFAULT 'no where there' ON ERROR )
+ AS Nali
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ JSON_VALUE (T.J, 'lax $.where' NULL ON EMPTY) AS Nali,
+ JSON_VALUE (T.J, 'lax $.friends.name' NULL ON EMPTY
+ DEFAULT '*** error ***' ON ERROR)
+ AS Friend
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'strict $.who') AS Who,
+ JSON_VALUE (T.J, 'strict $.where' NULL ON EMPTY NULL ON ERROR) AS Nali,
+
+ -- NOTE: output for this particular column differs with standard.
+ -- For row with T.K = 106 and T.J = { "who": "Louise", "where": "Iana" } output is "*** error ***", not NULL.
+ -- This is because answer in standard (NULL) is not correct. Query "strict $.friends[*].name" is executed in strict mode
+ -- where all structural errors are "hard" errors. Row with T.K = 106 does not have "friends" key in T.J. This is structural error
+ -- and the result of JSON_VALUE must tolerate ON ERROR section which specifies to return "*** error ***" string.
+ --
+ -- We can check this in PostgreSQL too (at the moment of writing PostgreSQL does not support JSON_VALUE function so we use jsonb_path_query):
+ -- postgres=# select * from jsonb_path_query('{ "who": "Louise", "where": "Iana" }', 'strict $.friends[*].name');
+ -- ERROR: JSON object does not contain key "friends"
+ -- PostgreSQL shows us that hard error has happened, as expected.
+ JSON_VALUE (T.J, 'strict $.friends[*].name' NULL ON EMPTY
+ DEFAULT '*** error ***' ON ERROR)
+ AS Friend
+FROM T;
+
+SELECT T.K,
+ JSON_VALUE (T.J, 'lax $.who') AS Who,
+ -- NOTE: In the original example INTEGER type was used. YQL does not have INTEGER type, Int64 was used instead
+ JSON_VALUE (T.J, 'lax $.friends[0].rank' RETURNING Int64 NULL ON EMPTY)
+ AS Rank
+FROM T;
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_empty.sql b/yql/essentials/tests/sql/suites/json/json_value/on_empty.sql
new file mode 100644
index 0000000000..e8f968274e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_empty.sql
@@ -0,0 +1,30 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause empty result in lax mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "lax $.key"), -- defaults to NULL ON EMPTY
+ JSON_VALUE($json, "lax $.key" NULL ON EMPTY),
+ JSON_VALUE($json, "lax $.key" DEFAULT "*** empty ***" ON EMPTY);
+
+-- Null as a default value
+SELECT
+ JSON_VALUE($json, "lax $.key" RETURNING Uint16 DEFAULT NULL ON EMPTY);
+
+-- Check that default value is casted to the target type
+SELECT
+ JSON_VALUE($json, "lax $.key" RETURNING Int16 DEFAULT "123" ON EMPTY),
+ JSON_VALUE($json, "lax $.key" RETURNING Int16 DEFAULT 123.456 ON EMPTY);
+
+-- Here JsonPath engine returns empty result and ON EMPTY section must be used.
+-- But default value in ON EMPTY section is -123 and casting it to Uint16 will fail.
+-- In this case ON ERROR section must be returned.
+SELECT
+ JSON_VALUE(
+ $json,
+ "lax $.key"
+ RETURNING Uint16
+ DEFAULT -123 ON EMPTY
+ DEFAULT 456 ON ERROR
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.sql
new file mode 100644
index 0000000000..c646cdb91f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_empty_cast_default_exception.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "lax $.key" RETURNING Uint32 DEFAULT -2 ON EMPTY ERROR ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.sql
new file mode 100644
index 0000000000..1ec55af7ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_empty_exception.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "lax $.key" ERROR ON EMPTY);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error.sql b/yql/essentials/tests/sql/suites/json/json_value/on_error.sql
new file mode 100644
index 0000000000..520b7f85a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Accessing absent object member will cause jsonpath error in strict mode
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key"), -- defaults to NULL ON ERROR
+ JSON_VALUE($json, "strict $.key" NULL ON ERROR),
+ JSON_VALUE($json, "strict $.key" DEFAULT "*** error ***" ON ERROR);
+
+-- Null as a default value
+SELECT
+ JSON_VALUE($json, "strict $.key" RETURNING Uint16 DEFAULT NULL ON ERROR);
+
+-- Check that default value is casted to the target type
+SELECT
+ JSON_VALUE($json, "strict $.key" RETURNING Int16 DEFAULT "123" ON ERROR),
+ JSON_VALUE($json, "strict $.key" RETURNING Int16 DEFAULT 123.456 ON ERROR);
+
+-- Here values retrieved from JSON cannot be casted to the target type Int16.
+-- ON ERROR default value must be used instead
+$invalid_types_json = CAST(@@{
+ "key": "string",
+ "another_key": -123
+}@@ as Json);
+SELECT
+ JSON_VALUE($invalid_types_json, "strict $.key" RETURNING Int16 DEFAULT 456 ON ERROR),
+ JSON_VALUE($invalid_types_json, "strict $.another_key" RETURNING Uint16 DEFAULT 456 ON ERROR); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.sql
new file mode 100644
index 0000000000..51f4591ad7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_default_exception.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Here JsonPath engine returns error result and ON ERROR section must be used.
+-- But default value in ON ERROR section is -123 and casting it to Uint16 will fail.
+-- In this case exception must be raised.
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key" RETURNING Uint16 DEFAULT -123 ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.sql
new file mode 100644
index 0000000000..722a06256c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_udf_exception.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- In this case call to Json2::SqlValueNumber will fail because "string"
+-- does not represent Number value
+$json = CAST(@@{
+ "key": "string"
+}@@ as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key" RETURNING Uint16 ERROR ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.sql
new file mode 100644
index 0000000000..5b97c45e49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_cast_value_exception.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- In this case call to Json2::SqlValueNumber will be successfull, but cast
+-- of -123 to Uint16 will fail
+$json = CAST(@@{
+ "key": -123
+}@@ as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key" RETURNING Uint16 ERROR ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.sql
new file mode 100644
index 0000000000..8314007547
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/on_error_jsonpath_exception.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST("{}" as Json);
+SELECT
+ JSON_VALUE($json, "strict $.key" ERROR ON ERROR);
diff --git a/yql/essentials/tests/sql/suites/json/json_value/passing.sql b/yql/essentials/tests/sql/suites/json/json_value/passing.sql
new file mode 100644
index 0000000000..30f963a5f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/passing.sql
@@ -0,0 +1,102 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Check all supported types for variables
+SELECT
+ -- Numeric types
+ JSON_VALUE(
+ $json,
+ "strict $var1 + $var2 + $var3 + $var4 + $var5 + $var6 + $var7 + $var8 + $var9 + $var10"
+ PASSING
+ CAST(1 as Int8) as var1,
+ CAST(2 as Uint8) as var2,
+ CAST(3 as Int16) as var3,
+ CAST(4 as Uint16) as var4,
+ CAST(5 as Int32) as var5,
+ CAST(6 as Uint32) as var6,
+ CAST(7 as Int64) as var7,
+ CAST(8 as Uint64) as var8,
+ CAST(9 as Double) as var9,
+ CAST(10 as Float) as var10
+ ),
+ -- Time types
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Datetime) as var
+ ),
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ CAST(1582044622 as Timestamp) as var
+ ),
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("2020-02-18" as Date) as var
+ ),
+ -- Utf8
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ CAST("привет" as Utf8) as var
+ ),
+ -- Bool
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ true as var
+ ),
+ -- Json
+ JSON_VALUE(
+ $json,
+ "strict $var.key"
+ PASSING
+ $json as var
+ ),
+ -- Nulls
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ Nothing(Int64?) as var
+ ),
+ JSON_VALUE(
+ $json,
+ "strict $var"
+ PASSING
+ NULL as var
+ );
+
+-- Check various ways to pass variable name
+SELECT
+ JSON_VALUE(
+ $json, "strict $var1"
+ PASSING
+ 123 as var1
+ ),
+ -- NOTE: VaR1 is not casted to upper-case VAR1 as standard expects
+ JSON_VALUE(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as VaR1
+ ),
+ JSON_VALUE(
+ $json, "strict $var1"
+ PASSING
+ 123 as "var1"
+ ),
+ JSON_VALUE(
+ $json, "strict $VaR1"
+ PASSING
+ 123 as "VaR1"
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/passing_exception.cfg b/yql/essentials/tests/sql/suites/json/json_value/passing_exception.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/passing_exception.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/passing_exception.sql b/yql/essentials/tests/sql/suites/json/json_value/passing_exception.sql
new file mode 100644
index 0000000000..7e94a73ccc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/passing_exception.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = CAST(@@{
+ "key": 123
+}@@ as Json);
+
+-- Tuple type is not supported for variables
+SELECT
+ JSON_VALUE(
+ $json, "strict $var"
+ PASSING
+ AsTuple(1, 2) as var
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/json_value/returning.sql b/yql/essentials/tests/sql/suites/json/json_value/returning.sql
new file mode 100644
index 0000000000..0903fb517a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/json_value/returning.sql
@@ -0,0 +1,78 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Basic cases
+$bool_json = CAST(@@{
+ "key": true
+}@@ as Json);
+SELECT
+ JSON_VALUE($bool_json, "strict $.key"), -- defaults to RETURNING Utf8 with cast to string value
+ JSON_VALUE($bool_json, "strict $.key" RETURNING Bool);
+
+$string_json = CAST(@@{
+ "key": "string"
+}@@ as Json);
+SELECT
+ JSON_VALUE($string_json, "strict $.key"), -- defaults to RETURNING Utf8 with cast to string value
+ JSON_VALUE($string_json, "strict $.key" RETURNING Utf8);
+
+$int64_json = CAST(@@{
+ "key": 123
+}@@ as Json);
+SELECT
+ JSON_VALUE($int64_json, "strict $.key"), -- defaults to RETURNING Utf8 with cast to string value
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Int64);
+
+$double_json = CAST(@@{
+ "key": 123.456
+}@@ as Json);
+SELECT
+ JSON_VALUE($double_json, "strict $.key"), -- defaults to RETURNING Utf8 with cast to string value
+ JSON_VALUE($double_json, "strict $.key" RETURNING Double);
+
+-- Casting of result value to different types
+-- From integer to various numeric types
+SELECT
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Int8),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Uint8),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Int16),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Uint16),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Int32),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Uint32),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Int64),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Uint64),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Double),
+ JSON_VALUE($int64_json, "strict $.key" RETURNING Float);
+
+-- From double to Double and Float
+SELECT
+ JSON_VALUE($double_json, "strict $.key" RETURNING Double),
+ JSON_VALUE($double_json, "strict $.key" RETURNING Float);
+
+-- From string to Utf8 and String
+SELECT
+ JSON_VALUE($string_json, "strict $.key" RETURNING Utf8),
+ JSON_VALUE($string_json, "strict $.key" RETURNING String);
+
+-- From timestamp to Datetime, Timestamp and Date
+$date_json = CAST(@@{
+ "date": 18312,
+ "datetime": 1582223316,
+ "timestamp": 1582223316529631
+}@@ as Json);
+SELECT
+ JSON_VALUE($date_json, "strict $.date" RETURNING Date),
+ JSON_VALUE($date_json, "strict $.datetime" RETURNING Datetime),
+ JSON_VALUE($date_json, "strict $.timestamp" RETURNING Timestamp);
+
+-- Null result form jsonpath
+$_null_json = CAST(@@{
+ "key": null
+}@@ as Json);
+SELECT
+ JSON_VALUE($date_json, "strict $.key" RETURNING Int16);
+
+-- Error case
+-- Must return NULL because NULL ON ERROR is default
+SELECT
+ JSON_VALUE($int64_json, "strict $.key" RETURNING String);
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/input.txt b/yql/essentials/tests/sql/suites/json/jsondocument/input.txt
new file mode 100644
index 0000000000..0ded9367b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/input.txt
@@ -0,0 +1,2 @@
+{"Id"=123;"Profile"="{\"age\":30,\"name\":\"First name\"}"};
+{"Id"=456;"Profile"="{\"age\":52,\"name\":\"Second name\"}"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/input.txt.attr b/yql/essentials/tests/sql/suites/json/jsondocument/input.txt.attr
new file mode 100644
index 0000000000..e61c1d4837
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/input.txt.attr
@@ -0,0 +1,23 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "Id";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "Profile";
+ [
+ "DataType";
+ "JsonDocument"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/insert.cfg b/yql/essentials/tests/sql/suites/json/jsondocument/insert.cfg
new file mode 100644
index 0000000000..25c3682008
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/insert.cfg
@@ -0,0 +1,2 @@
+in Input jsondocument/input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/insert.sql b/yql/essentials/tests/sql/suites/json/jsondocument/insert.sql
new file mode 100644
index 0000000000..a22fbb8390
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/insert.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* multirun can not */
+
+INSERT INTO plato.Output
+SELECT * FROM plato.Input;
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/json_exists.sql b/yql/essentials/tests/sql/suites/json/jsondocument/json_exists.sql
new file mode 100644
index 0000000000..9246bbf260
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/json_exists.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = JsonDocument(@@{"a": {"b": 1}, "c": 2}@@);
+
+SELECT
+ JSON_EXISTS($json, "$.a"),
+ JSON_EXISTS($json, "$.b"),
+ JSON_EXISTS($json, "$.c"),
+ JSON_EXISTS(CAST(NULL as JsonDocument), "$.a"); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/json_query.sql b/yql/essentials/tests/sql/suites/json/jsondocument/json_query.sql
new file mode 100644
index 0000000000..24ac8dd2aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/json_query.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = JsonDocument(@@{"a": {"b": 1}, "c": 2}@@);
+
+SELECT
+ JSON_QUERY($json, "$.a"),
+ JSON_QUERY($json, "$.b"),
+ JSON_QUERY($json, "$.c"),
+ JSON_QUERY(CAST(NULL as JsonDocument), "$.a"); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/json_value.sql b/yql/essentials/tests/sql/suites/json/jsondocument/json_value.sql
new file mode 100644
index 0000000000..ed807f569c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/json_value.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$json = JsonDocument(@@{"a": {"b": 1}, "c": 2}@@);
+
+SELECT
+ JSON_VALUE($json, "$.c"),
+ JSON_VALUE($json, "$.b"),
+ JSON_VALUE($json, "$.a"),
+ JSON_VALUE(CAST(NULL as JsonDocument), "$.a"); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/select.cfg b/yql/essentials/tests/sql/suites/json/jsondocument/select.cfg
new file mode 100644
index 0000000000..442a3ce787
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/select.cfg
@@ -0,0 +1 @@
+in Input jsondocument/input.txt
diff --git a/yql/essentials/tests/sql/suites/json/jsondocument/select.sql b/yql/essentials/tests/sql/suites/json/jsondocument/select.sql
new file mode 100644
index 0000000000..57361db5d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsondocument/select.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+
+SELECT
+ Id,
+ Profile
+FROM
+ plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/json/jsonpath/unicode.sql b/yql/essentials/tests/sql/suites/json/jsonpath/unicode.sql
new file mode 100644
index 0000000000..bce76c0aff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/json/jsonpath/unicode.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+-- Check access to members with unicode keys
+$json = CAST(@@{
+ "привет": 123
+}@@ as Json);
+SELECT
+ JSON_EXISTS($json, @@strict $."привет"@@),
+ JSON_VALUE($json, @@strict $."привет"@@);
+
+$nested_json = CAST(@@{
+ "привет": [1, 2, 3]
+}@@ as Json);
+SELECT
+ JSON_QUERY($nested_json, @@strict $."привет"@@); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.cfg b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.cfg
new file mode 100644
index 0000000000..b71bdee53e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.cfg
@@ -0,0 +1,2 @@
+in Input between_with_key_filter.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.sql b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.sql
new file mode 100644
index 0000000000..1cdb7cab2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.sql
@@ -0,0 +1,3 @@
+select * from (
+ select key as key, coalesce(cast(subkey as int), 0) as subkey, value as value from plato.Input
+) as x where key == "test" and subkey between 1 and 3 order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.txt b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.txt
new file mode 100644
index 0000000000..6f0a0bc4ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/between_with_key_filter.txt
@@ -0,0 +1,6 @@
+{"key"="a";"subkey"="1";"value"="2"};
+{"key"="test";"subkey"="1";"value"="3"};
+{"key"="test";"subkey"="3";"value"="4"};
+{"key"="test";"subkey"="4";"value"="5"};
+{"key"="b";"subkey"="2";"value"="6"};
+{"key"="test";"subkey"="2";"value"="7"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/calc_dependent.sql b/yql/essentials/tests/sql/suites/key_filter/calc_dependent.sql
new file mode 100644
index 0000000000..724884bc5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/calc_dependent.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$k1 = "3" || "23";
+$k2 = "0" || SUBSTRING($k1, 1);
+
+SELECT
+ key
+FROM Input
+WHERE key >= $k2 and key <= $k1;
diff --git a/yql/essentials/tests/sql/suites/key_filter/calc_dependent_with_tmp.sql b/yql/essentials/tests/sql/suites/key_filter/calc_dependent_with_tmp.sql
new file mode 100644
index 0000000000..35c2a6b1b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/calc_dependent_with_tmp.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+insert into @temp
+select * from Input order by key desc limit 1;
+
+commit;
+
+$last_key = select key from @temp limit 1;
+
+select * from Input where key = $last_key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/complex.sql b/yql/essentials/tests/sql/suites/key_filter/complex.sql
new file mode 100644
index 0000000000..fa2f53e0f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/complex.sql
@@ -0,0 +1,3 @@
+select * from plato.Input
+where key in ("023", "075", "150") and (subkey="1" or subkey="3") and value>="aaa" and value<="zzz"
+order by key,subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/contains.sql b/yql/essentials/tests/sql/suites/key_filter/contains.sql
new file mode 100644
index 0000000000..8c7d155eb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/contains.sql
@@ -0,0 +1 @@
+select * from plato.Input where key in ("075", "023", "037") order by key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/contains_optional.cfg b/yql/essentials/tests/sql/suites/key_filter/contains_optional.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/contains_optional.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/contains_optional.sql b/yql/essentials/tests/sql/suites/key_filter/contains_optional.sql
new file mode 100644
index 0000000000..5e1aa38d93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/contains_optional.sql
@@ -0,0 +1 @@
+select * from plato.Input where key in ("075", "023") order by key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/contains_tuples.sql b/yql/essentials/tests/sql/suites/key_filter/contains_tuples.sql
new file mode 100644
index 0000000000..65b9798176
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/contains_tuples.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+
+select * from plato.Input where AsTuple(key) in (
+ AsTuple("075"),
+ AsTuple("037")) order by key;
+
+select * from plato.Input where AsTuple(key, subkey) in (
+ AsTuple("075", "1"),
+ AsTuple("023", "3")) order by key;
+
+select * from plato.Input where AsTuple(key, subkey, 1 + 2, value) in (
+ AsTuple("075", "1", 3u, "abc"),
+ AsTuple("023", "3", 1+1+1, "aaa")) order by key;
+
+select * from plato.Input where AsTuple(subkey, AsTuple(key, 1), value, key) in (
+ AsTuple("1", AsTuple("075", 1), "abc", "075"),
+ AsTuple("3", AsTuple("023", 1), "aaa", "023")) order by key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/contains_tuples_no_keyfilter.sql b/yql/essentials/tests/sql/suites/key_filter/contains_tuples_no_keyfilter.sql
new file mode 100644
index 0000000000..fea4b3aa7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/contains_tuples_no_keyfilter.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+-- right side depends on row
+select * from plato.Input where AsTuple(key) in (
+ AsTuple("075"),
+ AsTuple(key)) order by key, subkey;
+
+-- left side is not a prefix of sort columns
+select * from plato.Input where AsTuple(subkey, value) in (
+ AsTuple("1", "aaa"),
+ AsTuple("3", "aaa")) order by key, subkey;
+-- not a member on left side
+select * from plato.Input where AsTuple(subkey, AsTuple(key, 1), value, key || "x") in (
+ AsTuple("1", AsTuple("075", 1), "abc", "075x"),
+ AsTuple("3", AsTuple("023", 1), "aaa", "023x")) order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/convert.cfg b/yql/essentials/tests/sql/suites/key_filter/convert.cfg
new file mode 100644
index 0000000000..c3f29d9c7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/convert.cfg
@@ -0,0 +1,2 @@
+in Input large_ui64.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/convert.sql b/yql/essentials/tests/sql/suites/key_filter/convert.sql
new file mode 100644
index 0000000000..ffbd15120f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/convert.sql
@@ -0,0 +1,5 @@
+select * from plato.Input
+where
+ key = 3755112183455673684
+ or key = 10790819990820982188
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/datetime.sql b/yql/essentials/tests/sql/suites/key_filter/datetime.sql
new file mode 100644
index 0000000000..cc8e1330ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/datetime.sql
@@ -0,0 +1,70 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+insert into @d
+select * from as_table(AsList(<|key:Date('2021-01-03')|>))
+assume order by key
+;
+
+insert into @dt
+select * from as_table(AsList(<|key:Datetime('2021-01-03T21:15:30Z')|>))
+assume order by key
+;
+
+insert into @ts
+select * from as_table(AsList(<|key:Timestamp('2021-01-03T21:15:30.673521Z')|>))
+assume order by key
+;
+
+
+COMMIT;
+
+SELECT * FROM @d WHERE key > Date('2021-01-02');
+SELECT * FROM @d WHERE key >= Date('2021-01-03');
+SELECT * FROM @d WHERE key < Date('2021-01-04');
+SELECT * FROM @d WHERE key <= Date('2021-01-03');
+
+SELECT * FROM @d WHERE key > Datetime('2021-01-02T23:00:00Z');
+SELECT * FROM @d WHERE key >= Datetime('2021-01-02T23:00:00Z');
+SELECT * FROM @d WHERE key < Datetime('2021-01-03T20:00:00Z');
+SELECT * FROM @d WHERE key <= Datetime('2021-01-03T20:00:00Z');
+
+SELECT * FROM @d WHERE key > Timestamp('2021-01-02T23:32:01.673521Z');
+SELECT * FROM @d WHERE key >= Timestamp('2021-01-02T23:32:01.673521Z');
+SELECT * FROM @d WHERE key < Timestamp('2021-01-03T00:00:00.673521Z');
+SELECT * FROM @d WHERE key <= Timestamp('2021-01-03T00:00:00.673521Z');
+
+-------------------------------------------
+
+SELECT * FROM @dt WHERE key > Date('2021-01-03');
+SELECT * FROM @dt WHERE key >= Date('2021-01-03');
+SELECT * FROM @dt WHERE key < Date('2021-01-04');
+SELECT * FROM @dt WHERE key <= Date('2021-01-04');
+
+SELECT * FROM @dt WHERE key > Datetime('2021-01-03T21:15:29Z');
+SELECT * FROM @dt WHERE key >= Datetime('2021-01-03T21:15:30Z');
+SELECT * FROM @dt WHERE key < Datetime('2021-01-03T21:15:31Z');
+SELECT * FROM @dt WHERE key <= Datetime('2021-01-03T21:15:30Z');
+
+SELECT * FROM @dt WHERE key > Timestamp('2021-01-03T21:15:29.673521Z');
+SELECT * FROM @dt WHERE key >= Timestamp('2021-01-03T21:15:29.673521Z');
+SELECT * FROM @dt WHERE key < Timestamp('2021-01-03T21:15:30.673521Z');
+SELECT * FROM @dt WHERE key <= Timestamp('2021-01-03T21:15:30.673521Z');
+
+-------------------------------------------
+
+SELECT * FROM @ts WHERE key > Date('2021-01-03');
+SELECT * FROM @ts WHERE key >= Date('2021-01-03');
+SELECT * FROM @ts WHERE key < Date('2021-01-04');
+SELECT * FROM @ts WHERE key <= Date('2021-01-04');
+
+SELECT * FROM @ts WHERE key > Datetime('2021-01-03T20:00:00Z');
+SELECT * FROM @ts WHERE key >= Datetime('2021-01-03T20:00:00Z');
+SELECT * FROM @ts WHERE key < Datetime('2021-01-03T22:00:00Z');
+SELECT * FROM @ts WHERE key <= Datetime('2021-01-03T22:00:00Z');
+
+SELECT * FROM @ts WHERE key > Timestamp('2021-01-03T21:15:30.573521Z');
+SELECT * FROM @ts WHERE key >= Timestamp('2021-01-03T21:15:30.673521Z');
+SELECT * FROM @ts WHERE key < Timestamp('2021-01-03T21:15:30.773521Z');
+SELECT * FROM @ts WHERE key <= Timestamp('2021-01-03T21:15:30.673521Z');
diff --git a/yql/essentials/tests/sql/suites/key_filter/decimal.cfg b/yql/essentials/tests/sql/suites/key_filter/decimal.cfg
new file mode 100644
index 0000000000..1f8653b25b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/decimal.cfg
@@ -0,0 +1,2 @@
+in Input key_decimal.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/decimal.sql b/yql/essentials/tests/sql/suites/key_filter/decimal.sql
new file mode 100644
index 0000000000..e64bfb7637
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/decimal.sql
@@ -0,0 +1,37 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$asIs = Python::asIs(Callable<(String)->String>,
+@@
+def asIs(arg):
+ return arg
+@@
+);
+
+insert into @decimal
+select cast(value as Decimal(15,10)) as value from Input order by value;
+
+commit;
+
+select * from (
+ select * from @decimal where value < Decimal("4.1",15,10) and value > Decimal("10.5",15,10) -- empty
+ union all
+ select * from @decimal where value > Decimal("inf",15,10) -- empty
+ union all
+ select * from @decimal where value < Decimal("-inf",15,10) -- empty
+ union all
+ select * from @decimal where value = Decimal("nan",15,10) -- empty
+ union all
+ select * from @decimal where value = Decimal("inf",15,10)
+ union all
+ select * from @decimal where value = Decimal("-inf",15,10)
+ union all
+ select * from @decimal where value > Decimal("3.3",15,10) or value >= Decimal("3.30001",15,10)
+)
+order by value;
+
+-- Don't union all to calc nodes separatelly
+select * from @decimal where value = cast("6.6" as Decimal(15,10)); -- Safe key filter calc
+select * from @decimal where value = cast($asIs("3.3") as Decimal(15,10)); -- Unsafe key filter calc
+select * from @decimal where value = cast($asIs("bad") as Decimal(15,10)); -- Unsafe key filter calc
diff --git a/yql/essentials/tests/sql/suites/key_filter/default.cfg b/yql/essentials/tests/sql/suites/key_filter/default.cfg
new file mode 100644
index 0000000000..2334ceb124
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/default.cfg
@@ -0,0 +1,2 @@
+in Input sorted1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/dependent_value.sql b/yql/essentials/tests/sql/suites/key_filter/dependent_value.sql
new file mode 100644
index 0000000000..a9dd4d6c52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dependent_value.sql
@@ -0,0 +1,3 @@
+select *
+from plato.Input
+where key == subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/dict_contains.sql b/yql/essentials/tests/sql/suites/key_filter/dict_contains.sql
new file mode 100644
index 0000000000..397df1f9d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dict_contains.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where key in YQL::DictFromKeys(ParseType("String"), AsTuple("075", "023", "037")) order by key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.cfg b/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.sql b/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.sql
new file mode 100644
index 0000000000..22006ae6d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dict_contains_optional.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where key in YQL::DictFromKeys(ParseType("String"), AsTuple("075", "023")) order by key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/dynamic.txt b/yql/essentials/tests/sql/suites/key_filter/dynamic.txt
new file mode 100644
index 0000000000..c2f900fd7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dynamic.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="075";"subkey"="4";"value"="abc"};
+{"key"="075";"subkey"="5";"value"="abc"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="800";"subkey"="7";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/dynamic.txt.attr b/yql/essentials/tests/sql/suites/key_filter/dynamic.txt.attr
new file mode 100644
index 0000000000..9e3c33c4cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/dynamic.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/empty_range.cfg b/yql/essentials/tests/sql/suites/key_filter/empty_range.cfg
new file mode 100644
index 0000000000..e893a2305b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/empty_range.cfg
@@ -0,0 +1,13 @@
+in InputInt8 key_i8.txt
+in InputInt16 key_i16.txt
+in InputInt32 key_i32.txt
+in InputInt64 key_i64.txt
+in InputUint8 key_ui8.txt
+in InputUint16 key_ui16.txt
+in InputUint32 key_ui32.txt
+in InputUint64 key_ui64.txt
+in InputFloat key_flt.txt
+in InputDouble key_dbl.txt
+in InputString key_str.txt
+in InputOptString key_opt_str.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/empty_range.sql b/yql/essentials/tests/sql/suites/key_filter/empty_range.sql
new file mode 100644
index 0000000000..3597ec3049
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/empty_range.sql
@@ -0,0 +1,17 @@
+use plato;
+
+select * from InputInt8 where value < -4 and value > 10;
+select * from InputInt16 where value < -4 and value > 10;
+select * from InputInt32 where value < -4 and value > 10;
+select * from InputInt64 where value < -4 and value > 10;
+
+select * from InputUint8 where value < 4 and value > 10;
+select * from InputUint16 where value < 4 and value > 10;
+select * from InputUint32 where value < 4 and value > 10;
+select * from InputUint64 where value < 4 and value > 10;
+
+select * from InputFloat where value < 4.1 and value > 10.5;
+select * from InputDouble where value < 4.1 and value > 10.5;
+
+select * from InputString where value < "a" and value > "c";
+select * from InputOptString where value < "a" and value > "c";
diff --git a/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.cfg b/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.sql b/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.sql
new file mode 100644
index 0000000000..59d8924372
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/empty_range_over_dynamic.sql
@@ -0,0 +1 @@
+select * from plato.Input where key<"030" and key>"200";
diff --git a/yql/essentials/tests/sql/suites/key_filter/extend_over_map_with_same_schema.sql b/yql/essentials/tests/sql/suites/key_filter/extend_over_map_with_same_schema.sql
new file mode 100644
index 0000000000..3f5c463eb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/extend_over_map_with_same_schema.sql
@@ -0,0 +1,10 @@
+select * from (
+ SELECT "x023" as key, subkey, value FROM plato.Input WHERE key == "023"
+ union all
+ SELECT "x037" as key, subkey, value FROM plato.Input WHERE key == "037"
+ union all
+ SELECT "x075" as key, subkey, value FROM plato.Input WHERE key == "075"
+ union all
+ SELECT "x150" as key, subkey, value FROM plato.Input WHERE key == "150"
+) as x
+order by key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/input.txt b/yql/essentials/tests/sql/suites/key_filter/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null.cfg b/yql/essentials/tests/sql/suites/key_filter/is_null.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null.sql b/yql/essentials/tests/sql/suites/key_filter/is_null.sql
new file mode 100644
index 0000000000..5edf06b299
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null.sql
@@ -0,0 +1 @@
+select * from plato.Input where key is null;
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.cfg b/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.sql b/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.sql
new file mode 100644
index 0000000000..69b306c5f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_multi_key.sql
@@ -0,0 +1 @@
+select * from plato.Input where key is null and subkey is null;
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.cfg b/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.sql b/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.sql
new file mode 100644
index 0000000000..d5aa2b346c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_or_data.sql
@@ -0,0 +1 @@
+select * from plato.Input where key is null or key = "023";
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.cfg b/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.sql b/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.sql
new file mode 100644
index 0000000000..bff04b59d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/is_null_with_condition.sql
@@ -0,0 +1 @@
+select * from plato.Input where key is null and subkey >= "0" and subkey <= "9";
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt b/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt
new file mode 100644
index 0000000000..9e8c8c997b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt
@@ -0,0 +1,5 @@
+{"value"=-1000.};
+{"value"=-10.};
+{"value"=0.};
+{"value"=10.};
+{"value"=1000.};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt.attr
new file mode 100644
index 0000000000..8aaee30aa6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_dbl.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"Double"]]
+ ]];
+ "SortMembers"=["value"];
+ "SortedBy"=["value"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"Double"]]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt b/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt
new file mode 100644
index 0000000000..e70dec1b02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt
@@ -0,0 +1,9 @@
+{"value"="bad"};
+{"value"="-inf"};
+{"value"="12.7"};
+{"value"="inf"};
+{"value"="nan"};
+{"value"="6.6"};
+{"value"="-77.5"};
+{"value"="-47.0"};
+{"value"="3.3"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt.attr
new file mode 100644
index 0000000000..e81b6ade45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_decimal.txt.attr
@@ -0,0 +1,5 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.cfg b/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.cfg
new file mode 100644
index 0000000000..6746e7263a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.cfg
@@ -0,0 +1,3 @@
+out Output output.txt
+providers yt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.sql b/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.sql
new file mode 100644
index 0000000000..9f721723b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_double_opt_suffix.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+INSERT INTO Output
+select 1 as key, Just(Just("x")) as subkey,
+union all
+select 2 as key, null as subkey,
+union all
+select 2 as key, Just(Nothing(String?)) as subkey,
+ORDER BY key, subkey;
+commit;
+
+
+select key, subkey from Output where key == 2;
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_flt.txt b/yql/essentials/tests/sql/suites/key_filter/key_flt.txt
new file mode 100644
index 0000000000..9e8c8c997b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_flt.txt
@@ -0,0 +1,5 @@
+{"value"=-1000.};
+{"value"=-10.};
+{"value"=0.};
+{"value"=10.};
+{"value"=1000.};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_flt.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_flt.txt.attr
new file mode 100644
index 0000000000..69560d7e0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_flt.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"Float"]]
+ ]];
+ "SortMembers"=["value"];
+ "SortedBy"=["value"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"Float"]]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i16.txt b/yql/essentials/tests/sql/suites/key_filter/key_i16.txt
new file mode 100644
index 0000000000..11663eece0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i16.txt
@@ -0,0 +1,5 @@
+{"value"=-32768};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=32767};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i16.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_i16.txt.attr
new file mode 100644
index 0000000000..0c02f17123
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i16.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int16";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i32.txt b/yql/essentials/tests/sql/suites/key_filter/key_i32.txt
new file mode 100644
index 0000000000..f71e6df2d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i32.txt
@@ -0,0 +1,5 @@
+{"value"=-2147483648};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=2147483647};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i32.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_i32.txt.attr
new file mode 100644
index 0000000000..7fcf7442be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i32.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i64.txt b/yql/essentials/tests/sql/suites/key_filter/key_i64.txt
new file mode 100644
index 0000000000..355772bb75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i64.txt
@@ -0,0 +1,5 @@
+{"value"=-9223372036854775808};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=9223372036854775807};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i64.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_i64.txt.attr
new file mode 100644
index 0000000000..38f5923be5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i64.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int64";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i8.txt b/yql/essentials/tests/sql/suites/key_filter/key_i8.txt
new file mode 100644
index 0000000000..b7eb279590
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i8.txt
@@ -0,0 +1,5 @@
+{"value"=-128};
+{"value"=-10};
+{"value"=0};
+{"value"=10};
+{"value"=127};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_i8.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_i8.txt.attr
new file mode 100644
index 0000000000..01598a2af9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_i8.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "int8";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt b/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt
new file mode 100644
index 0000000000..2f35b15da2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt
@@ -0,0 +1,4 @@
+{"value"=""};
+{"value"="aaa"};
+{"value"="bbb"};
+{"value"="c"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt.attr
new file mode 100644
index 0000000000..3b59311748
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_opt_str.txt.attr
@@ -0,0 +1,10 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "string";
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_str.txt b/yql/essentials/tests/sql/suites/key_filter/key_str.txt
new file mode 100644
index 0000000000..2f35b15da2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_str.txt
@@ -0,0 +1,4 @@
+{"value"=""};
+{"value"="aaa"};
+{"value"="bbb"};
+{"value"="c"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_str.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_str.txt.attr
new file mode 100644
index 0000000000..f69f774ce2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_str.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "string";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt b/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt
new file mode 100644
index 0000000000..6035cb382f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt
@@ -0,0 +1,9 @@
+{"value"="bad"};
+{"value"="1970-01-01,GMT"};
+{"value"="1970-01-01,Europe/Moscow"};
+{"value"="1999-01-01,Europe/Moscow"};
+{"value"="2018-02-01,Europe/Moscow"};
+{"value"="2018-02-01,GMT"};
+{"value"="2018-02-01,America/Los_Angeles"};
+{"value"="2105-12-30,America/Los_Angeles"};
+{"value"="2105-12-30,posixrules"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt.attr
new file mode 100644
index 0000000000..c8ad43a949
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_tzdate.txt.attr
@@ -0,0 +1,7 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"String"]]
+ ]];
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt b/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt
new file mode 100644
index 0000000000..7a9f3cc6ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=65535u};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt.attr
new file mode 100644
index 0000000000..d05297bf1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui16.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint16";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt b/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt
new file mode 100644
index 0000000000..32d26ed58e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=4294967295u};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt.attr
new file mode 100644
index 0000000000..edb661f4ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui32.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint32";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt b/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt
new file mode 100644
index 0000000000..c4e744a58c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=18446744073709551615u};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt.attr
new file mode 100644
index 0000000000..5028e033d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui64.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint64";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt b/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt
new file mode 100644
index 0000000000..d61b1d35da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt
@@ -0,0 +1,3 @@
+{"value"=0u};
+{"value"=10u};
+{"value"=255u};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt.attr
new file mode 100644
index 0000000000..6d04b983e9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_ui8.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema" = <"strict" = %true;"unique_keys" = %false>
+ [
+ {
+ "name" = "value";
+ "sort_order" = "ascending";
+ "type" = "uint8";
+ "required" = %true;
+ }
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt b/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt
new file mode 100644
index 0000000000..6df363b1fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt
@@ -0,0 +1,7 @@
+{"value"="bad"};
+{"value"="00000000-0000-0000-0000-000000000000"};
+{"value"="00000000-0000-0000-0000-100000000000"};
+{"value"="00000000-0000-0000-0000-200000000000"};
+{"value"="00000000-0000-0000-0000-300000000000"};
+{"value"="00000000-0000-0000-0000-400000000000"};
+{"value"="FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt.attr b/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt.attr
new file mode 100644
index 0000000000..9390239b63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/key_uuid.txt.attr
@@ -0,0 +1,7 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["value";["DataType";"String"]]
+ ]];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.cfg b/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.sql b/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.sql
new file mode 100644
index 0000000000..af8dcc75ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/lambda_with_null_filter.sql
@@ -0,0 +1,4 @@
+pragma DisableSimpleColumns;
+select * from plato.Input as a
+inner join (select * from plato.Input where key == "075") as b on a.subkey = b.subkey
+where b.value != "";
diff --git a/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt b/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt
new file mode 100644
index 0000000000..240d19f9e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt
@@ -0,0 +1,4 @@
+{"key"=3755112183455673684u;"subkey"="3";"value"="aaa"};
+{"key"=10790819990820982188u;"subkey"="5";"value"="ddd"};
+{"key"=11188839044644917908u;"subkey"="1";"value"="abc"};
+{"key"=17340866315722882514u;"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt.attr b/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt.attr
new file mode 100644
index 0000000000..aaf781b3ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/large_ui64.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint64"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key"];
+ "SortedByTypes"=[["DataType";"Uint64";];];
+ "SortMembers"=["key";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.cfg b/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.cfg
new file mode 100644
index 0000000000..10d1015e7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.cfg
@@ -0,0 +1,4 @@
+in Input sorted1.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.sql b/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.sql
new file mode 100644
index 0000000000..8955ef703b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/mixed_opt_bounds.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* syntax version 1 */
+$makeOpt = Python::makeOpt(Callable<(String, Bool)->String?>,
+@@
+def makeOpt(arg, flag):
+ if flag:
+ return arg
+ else:
+ return None
+@@
+);
+
+select * from plato.Input
+where key >= $makeOpt("030", true) and key <= "100"
+;
+
+select * from plato.Input
+where key >= $makeOpt("030", false) and key <= "100"
+;
diff --git a/yql/essentials/tests/sql/suites/key_filter/mixed_sort.cfg b/yql/essentials/tests/sql/suites/key_filter/mixed_sort.cfg
new file mode 100644
index 0000000000..ecac032a92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/mixed_sort.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input1 sorted1.txt
+in Input2 sorted2.txt
+in Input3 sorted3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/mixed_sort.sql b/yql/essentials/tests/sql/suites/key_filter/mixed_sort.sql
new file mode 100644
index 0000000000..010ace4f8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/mixed_sort.sql
@@ -0,0 +1,5 @@
+use plato;
+/* postgres can not */
+select * from concat(Input,Input1,Input2,Input3) where key="150" and subkey="1" and value>="aaa";
+
+select * from concat(Input,Input1,Input2,Input3) where subkey="1" and value>="aaa";
diff --git a/yql/essentials/tests/sql/suites/key_filter/multiusage.cfg b/yql/essentials/tests/sql/suites/key_filter/multiusage.cfg
new file mode 100644
index 0000000000..600154f15a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/multiusage.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted3.txt
+in Input2 sorted3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/multiusage.sql b/yql/essentials/tests/sql/suites/key_filter/multiusage.sql
new file mode 100644
index 0000000000..3ce037599b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/multiusage.sql
@@ -0,0 +1,31 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+
+$l = (
+ SELECT
+ t.*, TableName() as tn
+ FROM CONCAT(Input1, Input2) as t
+ WHERE
+ key == '023' AND
+ subkey == "3"
+);
+
+$r = (
+ SELECT
+ t.*, TableName() as tn
+ FROM CONCAT(Input1, Input2) as t
+ WHERE
+ key == '150' AND
+ subkey == "3"
+);
+
+SELECT
+ lhs.key as key,
+ rhs.value as value,
+ lhs.tn as l_tn,
+ rhs.tn as r_tn
+FROM $l as lhs
+JOIN $r as rhs
+ON lhs.subkey == rhs.subkey
diff --git a/yql/essentials/tests/sql/suites/key_filter/nile_pred.cfg b/yql/essentials/tests/sql/suites/key_filter/nile_pred.cfg
new file mode 100644
index 0000000000..12a1e15863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/nile_pred.cfg
@@ -0,0 +1,2 @@
+in Input optional.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/nile_pred.sql b/yql/essentials/tests/sql/suites/key_filter/nile_pred.sql
new file mode 100644
index 0000000000..fc0dd50197
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/nile_pred.sql
@@ -0,0 +1 @@
+select * from plato.Input where (key > "023") is not null and Unwrap(key > "023") order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.cfg b/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.cfg
new file mode 100644
index 0000000000..18d6033408
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.cfg
@@ -0,0 +1,3 @@
+in Input sorted2.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.sql b/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.sql
new file mode 100644
index 0000000000..431fbd3014
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/no_bypass_merge.sql
@@ -0,0 +1,8 @@
+/* ignore runonopt plan diff - extra LogicalOptimizer-PushdownOpColumns */
+pragma yt.PruneKeyFilterLambda = 'true';
+
+USE plato;
+
+$src = select * from Input where key == "1" || "5" || "0";
+select key, subkey from $src;
+select key, value from $src where key >= "000" and key < "999" and len(value) > 0;
diff --git a/yql/essentials/tests/sql/suites/key_filter/num_key.txt b/yql/essentials/tests/sql/suites/key_filter/num_key.txt
new file mode 100644
index 0000000000..b98129d169
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/num_key.txt
@@ -0,0 +1,13 @@
+{"key"=1;"subkey"=1;"value"="aaa"};
+{"key"=1;"subkey"=2;"value"="ddd"};
+{"key"=1;"subkey"=3;"value"="abc"};
+{"key"=2;"subkey"=1;"value"="abc"};
+{"key"=2;"subkey"=3;"value"="sss"};
+{"key"=3;"subkey"=1;"value"="abc"};
+{"key"=4;"subkey"=1;"value"="xxx"};
+{"key"=5;"subkey"=1;"value"="abc"};
+{"key"=5;"subkey"=2;"value"="yyy"};
+{"key"=6;"subkey"=1;"value"="abc"};
+{"key"=7;"subkey"=1;"value"="gfd"};
+{"key"=8;"subkey"=1;"value"="ooo"};
+{"key"=9;"subkey"=1;"value"="iii"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/num_key.txt.attr b/yql/essentials/tests/sql/suites/key_filter/num_key.txt.attr
new file mode 100644
index 0000000000..8e04185d86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/num_key.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["subkey";["DataType";"Int32"]];
+ ["value";["DataType";"String"]]]
+ ];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"Int32";];["DataType";"Int32";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/optional.txt b/yql/essentials/tests/sql/suites/key_filter/optional.txt
new file mode 100644
index 0000000000..5a88e11d6c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/optional.txt
@@ -0,0 +1,6 @@
+{"key"=#;"subkey"=#;"value"="aaa"};
+{"key"=#;"subkey"="1";"value"="iii"};
+{"key"=#;"subkey"="3";"value"="iii"};
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/optional.txt.attr b/yql/essentials/tests/sql/suites/key_filter/optional.txt.attr
new file mode 100644
index 0000000000..9ccdbd1f1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/optional.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"String"]]];
+ ["subkey";["OptionalType";["DataType";"String"]]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1];
+ "SortedBy"=["key";"subkey"];
+ "SortedByTypes"=[["OptionalType"; ["DataType";"String";]];["OptionalType"; ["DataType";"String";]]];
+ "SortMembers"=["key";"subkey"];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.cfg b/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.sql b/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.sql
new file mode 100644
index 0000000000..f0b8cac448
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/part_key_over_dynamic.sql
@@ -0,0 +1,3 @@
+USE plato;
+
+select * from (SELECT key from Input) as a where key>="030" and key<="200";
diff --git a/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_passthrough.sql b/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_passthrough.sql
new file mode 100644
index 0000000000..ad6f05abaa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_passthrough.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$src = select
+ key,
+ "ZZZ" || key as subkey,
+ value,
+from Input as u
+assume order by key;
+
+select * from $src where key < "075" or key > "075" order by key, subkey, value;
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_type_adjust.sql b/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_type_adjust.sql
new file mode 100644
index 0000000000..5dc914851e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/pushdown_keyextract_type_adjust.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$src = select
+ Just(key) as key,
+ "ZZZ" || subkey as subkey,
+ value
+from Input as u
+assume order by key, subkey, value;
+
+select * from $src where key > "023" and key < "150" order by key;
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/r1.txt b/yql/essentials/tests/sql/suites/key_filter/r1.txt
new file mode 100644
index 0000000000..cda312e0f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/r1.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"v1"="aaa";"v3"="aaa";};
+{"key"="037";"subkey"="5";"v1"="one";"v3"="aaa";};
+{"key"="075";"subkey"="1";"v1"="abc";"v3"="aaa";};
+{"key"="150";"subkey"="1";"v1"="two";"v3"="aaa";};
+{"key"="150";"subkey"="3";"v1"="iii";"v3"="aaa";};
+{"key"="150";"subkey"="8";"v1"="zzz";"v3"="aaa";};
diff --git a/yql/essentials/tests/sql/suites/key_filter/r1.txt.attr b/yql/essentials/tests/sql/suites/key_filter/r1.txt.attr
new file mode 100644
index 0000000000..f547b66c39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/r1.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["v1";["DataType";"String"]];
+ ["v3";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/r2.txt b/yql/essentials/tests/sql/suites/key_filter/r2.txt
new file mode 100644
index 0000000000..085a0710d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/r2.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"v1"="aaa";"v2"="bbb";"v3"="aaa";};
+{"key"="037";"subkey"="5";"v1"="one";"v2"="1";"v3"="aaa";};
+{"key"="075";"subkey"="1";"v1"="abc";"v2"="bbb";"v3"="aaa";};
+{"key"="150";"subkey"="1";"v1"="two";"v2"="2";"v3"="aaa";};
+{"key"="150";"subkey"="3";"v1"="iii";"v2"="bbb";"v3"="aaa";};
+{"key"="150";"subkey"="8";"v1"="zzz";"v2"="bbb";"v3"="aaa";};
diff --git a/yql/essentials/tests/sql/suites/key_filter/r2.txt.attr b/yql/essentials/tests/sql/suites/key_filter/r2.txt.attr
new file mode 100644
index 0000000000..84cf89978e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/r2.txt.attr
@@ -0,0 +1,13 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["v1";["DataType";"String"]];
+ ["v2";["OptionalType";["DataType";"String"]]];
+ ["v3";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/range_union.cfg b/yql/essentials/tests/sql/suites/key_filter/range_union.cfg
new file mode 100644
index 0000000000..ceb49907c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/range_union.cfg
@@ -0,0 +1,2 @@
+in Input num_key.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/range_union.sql b/yql/essentials/tests/sql/suites/key_filter/range_union.sql
new file mode 100644
index 0000000000..4e84df8e36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/range_union.sql
@@ -0,0 +1,67 @@
+/* postgres can not */
+select * from (
+ select * from plato.Input where key=8 or key>=9 --[8,)
+ union all
+ select * from plato.Input where key=8 or key>=8 --[8,)
+ union all
+ select * from plato.Input where key=8 or key>8 --[8,)
+ union all
+ select * from plato.Input where key=8 or key>7 --[8,)
+ union all
+ select * from plato.Input where key=8 or key>=7 --[7,)
+ union all
+
+ select * from plato.Input where key=8 or key<=7 --(,9)
+ union all
+ select * from plato.Input where key=8 or key<=8 --(,9)
+ union all
+ select * from plato.Input where key=8 or key<8 --(,9)
+ union all
+ select * from plato.Input where key=8 or key<9 --(,9)
+ union all
+ select * from plato.Input where key=8 or key<=9 --(,10)
+ union all
+
+ select * from plato.Input where key>8 or key<8 --(,8),[9,)
+ union all
+ select * from plato.Input where key>8 or key<=8 --(,)
+ union all
+ select * from plato.Input where key>8 or key<9 --(,)
+ union all
+ select * from plato.Input where key>7 or key<9 --(,)
+ union all
+ select * from plato.Input where key>=7 or key<9 --(,)
+ union all
+ select * from plato.Input where key>7 or key<=9 --(,)
+ union all
+
+ select * from plato.Input where (key>5 and key<7) or (key>4 and key<8) -- [5,8)
+ union all
+ select * from plato.Input where (key>5 and key<7) or (key>5 and key<8) -- [6,8)
+ union all
+ select * from plato.Input where (key>=5 and key<7) or (key>=5 and key<8) -- [5,8)
+ union all
+ select * from plato.Input where (key>5 and key<=7) or (key>4 and key<8) -- [5,8)
+ union all
+ select * from plato.Input where (key>5 and key<=7) or (key>4 and key<=7) -- [5,8)
+ union all
+ select * from plato.Input where (key>5 and key<8) or (key>4 and key<8) -- [5,8)
+ union all
+
+ select * from plato.Input where (key=1 and subkey<4 and subkey>1) or (key=2 and subkey<4 and subkey>1) --[{1,2},{1,4}),[{2,2},{2,4})
+ union all
+ select * from plato.Input where (key=1 and subkey<3 and subkey>1) or (key=2 and subkey<3 and subkey>1) --[{1,2}],[{2,2}]
+ union all
+ select * from plato.Input where (key=1 and subkey>1) or (key=2 and subkey<3) --[{1,2},{1}],[{2},{2,3})
+ union all
+ select * from plato.Input where (key=1 and subkey<3 and subkey>1) or key=1 --[1]
+ union all
+ select * from plato.Input where (key=1 and subkey>1) or key=1 --[1]
+ union all
+ select * from plato.Input where (key=1 and subkey<4 and subkey>1) or (key>1) --[{1,2},{1,4}),[2,)
+ union all
+ select * from plato.Input where key=1 and (subkey between 2 and 3 or subkey < 2) --[{1},{1,3}]
+ union all
+ select * from plato.Input where key=1 and (subkey >= 2 or subkey < 2) --[1]
+)
+order by key,subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/range_union_lower_excluded.sql b/yql/essentials/tests/sql/suites/key_filter/range_union_lower_excluded.sql
new file mode 100644
index 0000000000..550128a88e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/range_union_lower_excluded.sql
@@ -0,0 +1,2 @@
+select * from plato.Input where key > "075" or (key == "075" and subkey == "1" and value == "abc") order by key, subkey, value;
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/ranges.cfg b/yql/essentials/tests/sql/suites/key_filter/ranges.cfg
new file mode 100644
index 0000000000..2334ceb124
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/ranges.cfg
@@ -0,0 +1,2 @@
+in Input sorted1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/ranges.sql b/yql/essentials/tests/sql/suites/key_filter/ranges.sql
new file mode 100644
index 0000000000..cf4ed498a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/ranges.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select * from (
+ select * from plato.Input where key<="037" and key>="037"
+ union all
+ select * from plato.Input where key>="037" and key<="037"
+ union all
+ select * from plato.Input where key between "037" and "037"
+)
+order by key,subkey;
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted1.txt b/yql/essentials/tests/sql/suites/key_filter/sorted1.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted1.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted1.txt.attr b/yql/essentials/tests/sql/suites/key_filter/sorted1.txt.attr
new file mode 100644
index 0000000000..391c1a05f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;];
+ "SortedBy"=["key";"subkey";"value";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted2.txt b/yql/essentials/tests/sql/suites/key_filter/sorted2.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted2.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted2.txt.attr b/yql/essentials/tests/sql/suites/key_filter/sorted2.txt.attr
new file mode 100644
index 0000000000..be6e381cb4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted2.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key";];
+ "SortedByTypes"=[["DataType";"String";];];
+ "SortMembers"=["key";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted3.txt b/yql/essentials/tests/sql/suites/key_filter/sorted3.txt
new file mode 100644
index 0000000000..4676b237e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted3.txt
@@ -0,0 +1,6 @@
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted3.txt.attr b/yql/essentials/tests/sql/suites/key_filter/sorted3.txt.attr
new file mode 100644
index 0000000000..bcd06590fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted3.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["subkey";"value";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted4.txt b/yql/essentials/tests/sql/suites/key_filter/sorted4.txt
new file mode 100644
index 0000000000..8eb4e1c8d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted4.txt
@@ -0,0 +1,9 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="\xd1\x82\xd0\xb5\xd1\x81\xd1\x82\xff";"subkey"="8";"value"="zzz"};
+{"key"="\xff";"subkey"="8";"value"="zzz"};
+{"key"="\xff\xff";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/sorted4.txt.attr b/yql/essentials/tests/sql/suites/key_filter/sorted4.txt.attr
new file mode 100644
index 0000000000..391c1a05f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/sorted4.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;];
+ "SortedBy"=["key";"subkey";"value";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.cfg b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.cfg
new file mode 100644
index 0000000000..3b40f69cee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.cfg
@@ -0,0 +1,3 @@
+in Input sorted1.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.sql b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.sql
new file mode 100644
index 0000000000..94f7647dcd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter1.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+pragma yt.MaxInputTables="2";
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM concat(Input, Input, Input, Input)
+WHERE key = "07" || "5"
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.cfg b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.cfg
new file mode 100644
index 0000000000..3b40f69cee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.cfg
@@ -0,0 +1,3 @@
+in Input sorted1.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.sql b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.sql
new file mode 100644
index 0000000000..b2662fbedf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/split_input_with_key_filter2.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+pragma yt.MaxInputTables="2";
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM concat(Input, Input, Input)
+WHERE key = "07" || "5"
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/string_with.sql b/yql/essentials/tests/sql/suites/key_filter/string_with.sql
new file mode 100644
index 0000000000..abd53c9618
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/string_with.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.Input
+WHERE StartsWith(key, "0") AND EndsWith(key, "5");
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/string_with_ff.sql b/yql/essentials/tests/sql/suites/key_filter/string_with_ff.sql
new file mode 100644
index 0000000000..07d85b43c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/string_with_ff.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+insert into @src
+select "\xff\xff" || key as key from Input order by key;
+
+commit;
+
+select count(*) from (
+ select * from @src where StartsWith(key, "\xff\xff") and EndsWith(key, "5")
+);
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.cfg b/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.cfg
new file mode 100644
index 0000000000..965c7fe965
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.cfg
@@ -0,0 +1,2 @@
+in Input sorted4.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.sql b/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.sql
new file mode 100644
index 0000000000..415a38d93d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/string_with_legacy.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma yt.UseNewPredicateExtraction="false";
+
+SELECT key FROM plato.Input WHERE StartsWith(key, String("150")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, Utf8("15")) OR StartsWith(key, Utf8("150")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, Utf8("теÑÑ‚")) OR StartsWith(key, String("теÑÑ‚\xff")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, String("\xff")) ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/tzdate.cfg b/yql/essentials/tests/sql/suites/key_filter/tzdate.cfg
new file mode 100644
index 0000000000..2c7908c6e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/tzdate.cfg
@@ -0,0 +1,2 @@
+in Input key_tzdate.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/tzdate.sql b/yql/essentials/tests/sql/suites/key_filter/tzdate.sql
new file mode 100644
index 0000000000..c5fe5ab841
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/tzdate.sql
@@ -0,0 +1,35 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$asIs = Python::asIs(Callable<(String)->String>,
+@@
+def asIs(arg):
+ return arg
+@@
+);
+
+insert into @tzdate
+select cast(value as TzDate) as value from Input order by value;
+
+commit;
+
+select * from (
+ select * from @tzdate where value < TzDate("1999-01-01,Europe/Moscow") and value > TzDate("2011-01-01,Europe/Moscow") -- empty
+ union all
+ select * from @tzdate where value > TzDate("2105-12-30,posixrules") -- empty
+ union all
+ select * from @tzdate where value < TzDate("1970-01-01,GMT") -- empty
+ union all
+ select * from @tzdate where value = TzDate("2018-02-01,GMT")
+ union all
+ select * from @tzdate where value > TzDate("1999-01-01,GMT") or value >= TzDate("1999-01-01,Europe/Moscow")
+ union all
+ select * from @tzdate where value >= TzDate("2018-02-01,Europe/Moscow") and value <= TzDate("2105-12-30,America/Los_Angeles") -- Should include 2018-02-01,GMT and 2105-12-31,posixrules
+)
+order by value;
+
+-- Don't union all to calc nodes separatelly
+select * from @tzdate where value = cast("1999-01-01,Europe/Moscow" as TzDate); -- Safe key filter calc
+select * from @tzdate where value = cast($asIs("2105-12-30,America/Los_Angeles") as TzDate); -- Unsafe key filter calc
+select * from @tzdate where value = cast($asIs("bad") as TzDate); -- Unsafe key filter calc
diff --git a/yql/essentials/tests/sql/suites/key_filter/utf8.txt b/yql/essentials/tests/sql/suites/key_filter/utf8.txt
new file mode 100644
index 0000000000..5a579fd3db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/utf8.txt
@@ -0,0 +1,9 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="теÑÑ‚\xf4\x8f\xbf\xbf";"subkey"="8";"value"="zzz"};
+{"key"="\xf4\x8f\xbf\xbf";"subkey"="8";"value"="zzz"};
+{"key"="\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbf";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/key_filter/utf8.txt.attr b/yql/essentials/tests/sql/suites/key_filter/utf8.txt.attr
new file mode 100644
index 0000000000..ef4d43d3a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/utf8.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Utf8"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;];
+ "SortedBy"=["key";"subkey";"value";];
+ "SortedByTypes"=[["DataType";"Utf8";];["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.cfg b/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.cfg
new file mode 100644
index 0000000000..71de3c4553
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.cfg
@@ -0,0 +1,2 @@
+in Input utf8.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.sql b/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.sql
new file mode 100644
index 0000000000..37b892db0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/utf8_with_legacy.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma yt.UseNewPredicateExtraction="false";
+
+SELECT key FROM plato.Input WHERE StartsWith(key, String("150")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, String("15")) OR StartsWith(key, String("150")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, String("\xf5")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, Utf8("теÑÑ‚\xf4\x8f\xbf\xbf")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, Utf8("теÑÑ‚")) OR StartsWith(key, Utf8("теÑÑ‚\xf4\x8f\xbf\xbf")) ORDER BY key;
+
+SELECT key FROM plato.Input WHERE StartsWith(key, Utf8("\xf4\x8f\xbf\xbf")) ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/key_filter/uuid.cfg b/yql/essentials/tests/sql/suites/key_filter/uuid.cfg
new file mode 100644
index 0000000000..8e98e96be2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/uuid.cfg
@@ -0,0 +1,2 @@
+in Input key_uuid.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/uuid.sql b/yql/essentials/tests/sql/suites/key_filter/uuid.sql
new file mode 100644
index 0000000000..6a9a392561
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/uuid.sql
@@ -0,0 +1,41 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$asIs = Python::asIs(Callable<(String)->String>,
+@@
+def asIs(arg):
+ return arg
+@@
+);
+
+insert into @uuid
+select cast(value as Uuid) as value from Input order by value;
+
+commit;
+
+select * from (
+ select * from @uuid where value < Uuid("00000000-0000-0000-0000-100000000000") and value > Uuid("00000000-0000-0000-0000-400000000000") -- empty
+ union all
+ select * from @uuid where value > Uuid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF") -- empty
+ union all
+ select * from @uuid where value < Uuid("00000000-0000-0000-0000-000000000000") -- empty
+ union all
+ select * from @uuid where value > Uuid("00000000-0000-0000-0000-100000000000") or value >= Uuid("00000000-0000-0000-0000-200000000000") --(00000000-0000-0000-0000-100000000000,)
+ union all
+ select * from @uuid where value >= Uuid("00000000-0000-0000-0000-100000000000") or value > Uuid("00000000-0000-0000-0000-200000000000") --[00000000-0000-0000-0000-100000000000,)
+ union all
+ select * from @uuid where value = Uuid("00000000-0000-0000-0000-100000000000") or value < Uuid("00000000-0000-0000-0000-200000000000") --(,00000000-0000-0000-0000-200000000000)
+ union all
+ select * from @uuid where value < Uuid("00000000-0000-0000-0000-100000000000") or value <= Uuid("00000000-0000-0000-0000-200000000000") --(,00000000-0000-0000-0000-200000000000]
+ union all
+ select * from @uuid where value < Uuid("00000000-0000-0000-0000-100000000000") or value <= Uuid("00000000-0000-0000-0000-200000000000") --(,00000000-0000-0000-0000-200000000000]
+ union all
+ select * from @uuid where value > Uuid("00000000-0000-0000-0000-100000000000") and value <= Uuid("00000000-0000-0000-0000-400000000000") --(00000000-0000-0000-0000-100000000000,00000000-0000-0000-0000-400000000000]
+)
+order by value;
+
+-- Don't union all to calc nodes separatelly
+select * from @uuid where value = cast("00000000-0000-0000-0000-100000000000" as Uuid); -- Safe key filter calc
+select * from @uuid where value = cast($asIs("00000000-0000-0000-0000-200000000000") as Uuid); -- Unsafe key filter calc
+select * from @uuid where value = cast($asIs("bad") as Uuid); -- Unsafe key filter calc
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-14157.cfg b/yql/essentials/tests/sql/suites/key_filter/yql-14157.cfg
new file mode 100644
index 0000000000..f2977cd84e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-14157.cfg
@@ -0,0 +1,3 @@
+in Input1 r1.txt
+in Input2 r2.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-14157.sql b/yql/essentials/tests/sql/suites/key_filter/yql-14157.sql
new file mode 100644
index 0000000000..ec132b55ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-14157.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT v1, v2
+FROM RANGE("", "Input1", "Input2")
+WHERE key == "037";
+
+SELECT v1, v2
+FROM RANGE("", "Input1", "Input2")
+WHERE key == "150" and subkey = "1";
+
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.cfg b/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.cfg
new file mode 100644
index 0000000000..8dbea3de64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.cfg
@@ -0,0 +1,4 @@
+in InputA sorted2.txt
+in InputB sorted2.txt
+in InputC sorted2.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.sql b/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.sql
new file mode 100644
index 0000000000..5bb0744c2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-8117-table_key_filter.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+SELECT * FROM (
+ SELECT
+ value
+ FROM RANGE("", "InputA", "InputC")
+ WHERE
+ (key == "023" OR key == "037") AND value != ""
+ UNION ALL
+ SELECT
+ value
+ FROM RANGE("", "InputA", "InputC")
+ WHERE
+ (key == "075" OR key == "150") AND value != ""
+)
+ORDER BY value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.cfg b/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.cfg
new file mode 100644
index 0000000000..2334ceb124
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.cfg
@@ -0,0 +1,2 @@
+in Input sorted1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.sql b/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.sql
new file mode 100644
index 0000000000..c6a99abbaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql-8663-dedup_ranges.sql
@@ -0,0 +1,4 @@
+SELECT *
+FROM plato.Input
+WHERE key ='023'
+ AND (value = "aaa" OR subkey = "3") \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/key_filter/yql_5895_or.sql b/yql/essentials/tests/sql/suites/key_filter/yql_5895_or.sql
new file mode 100644
index 0000000000..57116d5d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/key_filter/yql_5895_or.sql
@@ -0,0 +1,4 @@
+SELECT
+ *
+FROM plato.Input
+WHERE key > "023" or key > "075" or key < "075";
diff --git a/yql/essentials/tests/sql/suites/lambda/default.cfg b/yql/essentials/tests/sql/suites/lambda/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/lambda/input.txt b/yql/essentials/tests/sql/suites/lambda/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_brief.sql b/yql/essentials/tests/sql/suites/lambda/lambda_brief.sql
new file mode 100644
index 0000000000..aac6edfa5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_brief.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select ($x, $y) -> ($x + $y)(1, 2); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_duplicate_arg.sqlx b/yql/essentials/tests/sql/suites/lambda/lambda_duplicate_arg.sqlx
new file mode 100644
index 0000000000..9b504d6a76
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_duplicate_arg.sqlx
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+$shiftSteps=1;
+$linear = ($x, $z, $x)->{ -- $x is duplicated
+ $v = 10 * $z + $x;
+ $shift = ($item) -> {return $item << $shiftSteps};
+ $res = Math::Floor(Math::Pi() * $shift($v));
+ return $res
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_no_aggrs.sqlx b/yql/essentials/tests/sql/suites/lambda/lambda_no_aggrs.sqlx
new file mode 100644
index 0000000000..18375de71a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_no_aggrs.sqlx
@@ -0,0 +1,9 @@
+USE plato;
+
+$f = ()->{
+ return sum(1);
+};
+
+SELECT
+ $f()
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_no_arg.sql b/yql/essentials/tests/sql/suites/lambda/lambda_no_arg.sql
new file mode 100644
index 0000000000..e86773d9e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_no_arg.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+$modVal = ()->{
+ return 2
+};
+
+$filter = ($item)->{
+ return not ($item % $modVal() == 0)
+};
+
+SELECT ListFilter(AsList(1,2,3,4,5), $filter);
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_no_columns.sqlx b/yql/essentials/tests/sql/suites/lambda/lambda_no_columns.sqlx
new file mode 100644
index 0000000000..ded3f046b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_no_columns.sqlx
@@ -0,0 +1,9 @@
+USE plato;
+
+$f = ()->{
+ return value;
+};
+
+SELECT
+ $f()
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_arg.sqlx b/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_arg.sqlx
new file mode 100644
index 0000000000..02a5d630fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_arg.sqlx
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+$shiftSteps=1;
+$linear = ($x, $z)->{
+ $v = 10 * $z + $x;
+ $shift = (item) -> {return $item << $shiftSteps}; -- must use '$' for lambda arguments, should be $item
+ $res = Math::Floor(Math::Pi() * $shift($v));
+ return $res
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_assign.sqlx b/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_assign.sqlx
new file mode 100644
index 0000000000..8a59426c1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_no_dollar_assign.sqlx
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+$shiftSteps=1;
+$linear = ($x, $z)->{
+ $v = 10 * $z + $x;
+ $shift = ($item) -> {return $item << $shiftSteps};
+ res = Math::Floor(Math::Pi() * $shift($v)); -- no '$' in variable, should be $res = ...
+ return $res
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_opt_args.sql b/yql/essentials/tests/sql/suites/lambda/lambda_opt_args.sql
new file mode 100644
index 0000000000..0256eeb140
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_opt_args.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+$f = ($x,$y?)->($x + ($y ?? 0));
+select $f(1), $f(2, 3);
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_simple.sql b/yql/essentials/tests/sql/suites/lambda/lambda_simple.sql
new file mode 100644
index 0000000000..93f7ea3e96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_simple.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+$shiftSteps=1;
+$linear = ($x, $z)->{
+ $v = 10 * $z + $x;
+ $shift = ($item) -> {return $item << $shiftSteps};
+ return $shift($v)
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_udf.cfg b/yql/essentials/tests/sql/suites/lambda/lambda_udf.cfg
new file mode 100644
index 0000000000..b0a6e1e6b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_udf.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_udf.sql b/yql/essentials/tests/sql/suites/lambda/lambda_udf.sql
new file mode 100644
index 0000000000..aff4e45606
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_udf.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$shiftSteps = 1;
+$linear = ($x, $z) -> {
+ $v = 10 * $z + $x;
+ $shift = ($item) -> {
+ return $item << $shiftSteps
+ };
+ $res = Math::Floor(Math::Pi() * $shift($v));
+ return $res
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) as linear FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_use_labmda_as_arg.sql b/yql/essentials/tests/sql/suites/lambda/lambda_use_labmda_as_arg.sql
new file mode 100644
index 0000000000..dafd67ef4f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_use_labmda_as_arg.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+$shiftSteps=($item) -> { return Cast($item % 4 as Uint8)??0 };
+
+$linear = ($x, $z, $func) -> {
+ $v = 10 * $z + $x;
+ $shift = ($item, $sk) -> {return $item << $func($sk)};
+ return $shift($v, $z)
+};
+
+--INSERT INTO Output
+SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64), $shiftSteps) FROM Input as t;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_with_tie.sql b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie.sql
new file mode 100644
index 0000000000..83c9aa7f46
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$func = ($x, $y)->{
+ $y, $x = AsTuple($x, $y);
+ return $x || "_" || $y;
+};
+
+--INSERT INTO Output
+SELECT $func(key, subkey) as func FROM Input;
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.cfg b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.cfg
new file mode 100644
index 0000000000..4f32e1efb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.sql b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.sql
new file mode 100644
index 0000000000..5172adb751
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/lambda_with_tie_bad_count_fail.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$func = ($x, $y)->{
+ $y, $x = AsTuple($x, $y, $x);
+ return $x || "_" || $y;
+};
+
+--INSERT INTO Output
+SELECT $func(key, subkey) as func FROM Input;
diff --git a/yql/essentials/tests/sql/suites/lambda/list_aggregate.sql b/yql/essentials/tests/sql/suites/lambda/list_aggregate.sql
new file mode 100644
index 0000000000..a4c1093ae7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/list_aggregate.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+$subst = ($names, $indices) -> {
+ RETURN ListMap(
+ $indices,
+ ($index) -> {
+ RETURN $names[$index];
+ }
+ );
+};
+
+$table = (
+ SELECT AsList("a", "b") AS names, AsList(0, 0, 1) AS indices
+ UNION ALL
+ SELECT AsList("c", "d") AS names, AsList(0, 1, 1) AS indices
+);
+
+SELECT AGGREGATE_LIST($subst(names, indices))
+FROM $table;
diff --git a/yql/essentials/tests/sql/suites/lambda/list_aggregate_flatmap.sql b/yql/essentials/tests/sql/suites/lambda/list_aggregate_flatmap.sql
new file mode 100644
index 0000000000..8d88b0b78c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lambda/list_aggregate_flatmap.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+$subst = ($names, $indices) -> {
+ RETURN ListFlatMap(
+ $indices,
+ ($index) -> {
+ RETURN $names[$index];
+ }
+ );
+};
+
+$table = (
+ SELECT AsList("a", "b") AS names, AsList(0, 0, 1) AS indices
+ UNION ALL
+ SELECT AsList("c", "d") AS names, AsList(0, 1, 1) AS indices
+);
+
+SELECT AGGREGATE_LIST($subst(names, indices))
+FROM $table;
diff --git a/yql/essentials/tests/sql/suites/library/agg.sql.txt b/yql/essentials/tests/sql/suites/library/agg.sql.txt
new file mode 100644
index 0000000000..4785684f11
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/agg.sql.txt
@@ -0,0 +1,7 @@
+-- Ðгрегационные функции, Ñоздаваемые Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
+-- AggregationFactory, удобно выноÑить в библиотеку
+$Agg_sum = AggregationFactory("SUM");
+$Agg_max = AggregationFactory("MAX");
+
+EXPORT $Agg_sum, $Agg_max;
+
diff --git a/yql/essentials/tests/sql/suites/library/forward_import.cfg b/yql/essentials/tests/sql/suites/library/forward_import.cfg
new file mode 100644
index 0000000000..665f5854f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/forward_import.cfg
@@ -0,0 +1,2 @@
+file agg.sql agg.sql.txt
+file lib.sql lib.sql.txt
diff --git a/yql/essentials/tests/sql/suites/library/forward_import.sql b/yql/essentials/tests/sql/suites/library/forward_import.sql
new file mode 100644
index 0000000000..8e0b95d44c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/forward_import.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+PRAGMA Library("agg.sql");
+PRAGMA Library("lib.sql");
+
+IMPORT lib SYMBOLS $Square, $Agg_sum, $Agg_max;
+SELECT $Square(2);
+
+SELECT
+ AGGREGATE_BY(x, $Agg_sum),
+ AGGREGATE_BY(x, $Agg_max)
+FROM (
+ SELECT 2 AS x
+ UNION ALL
+ SELECT 3 AS x
+)
diff --git a/yql/essentials/tests/sql/suites/library/lib.sql.txt b/yql/essentials/tests/sql/suites/library/lib.sql.txt
new file mode 100644
index 0000000000..5860176b7a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/lib.sql.txt
@@ -0,0 +1,6 @@
+IMPORT agg SYMBOLS $Agg_sum, $Agg_max;
+
+$Square = ($x) -> { RETURN $x * $x; };
+
+EXPORT $Square, $Agg_sum, $Agg_max;
+
diff --git a/yql/essentials/tests/sql/suites/library/lib1.sql.txt b/yql/essentials/tests/sql/suites/library/lib1.sql.txt
new file mode 100644
index 0000000000..0de921bca3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/lib1.sql.txt
@@ -0,0 +1,5 @@
+import lib2 symbols $mul;
+
+$sqr = ($x)->{ return $mul($x, $x); };
+
+export $sqr;
diff --git a/yql/essentials/tests/sql/suites/library/lib2.sql.txt b/yql/essentials/tests/sql/suites/library/lib2.sql.txt
new file mode 100644
index 0000000000..22d768ac39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/lib2.sql.txt
@@ -0,0 +1,3 @@
+$mul = ($x, $y)->{ return $x*$y; };
+
+export $mul;
diff --git a/yql/essentials/tests/sql/suites/library/library.cfg b/yql/essentials/tests/sql/suites/library/library.cfg
new file mode 100644
index 0000000000..24ecbe21c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library.cfg
@@ -0,0 +1,2 @@
+file lib1.sql lib1.sql.txt
+file lib2.sql lib2.sql.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/library/library.sql b/yql/essentials/tests/sql/suites/library/library.sql
new file mode 100644
index 0000000000..72213f6655
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+pragma library("lib1.sql");
+pragma library("lib2.sql");
+import lib1 symbols $sqr;
+select $sqr(10);
diff --git a/yql/essentials/tests/sql/suites/library/library_alias.cfg b/yql/essentials/tests/sql/suites/library/library_alias.cfg
new file mode 100644
index 0000000000..259944aff0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_alias.cfg
@@ -0,0 +1 @@
+file lib2.sql lib2.sql.txt
diff --git a/yql/essentials/tests/sql/suites/library/library_alias.sql b/yql/essentials/tests/sql/suites/library/library_alias.sql
new file mode 100644
index 0000000000..681d569cbc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_alias.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+pragma library("lib2.sql");
+import lib2 symbols $mul as $multiply;
+select $multiply(2,3);
diff --git a/yql/essentials/tests/sql/suites/library/library_udf.cfg b/yql/essentials/tests/sql/suites/library/library_udf.cfg
new file mode 100644
index 0000000000..720705143d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_udf.cfg
@@ -0,0 +1,2 @@
+file udf.sql udf.sql.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/library/library_udf.sql b/yql/essentials/tests/sql/suites/library/library_udf.sql
new file mode 100644
index 0000000000..42eff53997
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_udf.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+pragma Library("udf.sql");
+import udf symbols $f;
+select $f;
diff --git a/yql/essentials/tests/sql/suites/library/library_via_http.cfg b/yql/essentials/tests/sql/suites/library/library_via_http.cfg
new file mode 100644
index 0000000000..666586ba14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_via_http.cfg
@@ -0,0 +1,2 @@
+http_file lib1.sql lib1.sql.txt
+http_file lib2.sql lib2.sql.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/library/library_via_http.sql b/yql/essentials/tests/sql/suites/library/library_via_http.sql
new file mode 100644
index 0000000000..72213f6655
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/library_via_http.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+pragma library("lib1.sql");
+pragma library("lib2.sql");
+import lib1 symbols $sqr;
+select $sqr(10);
diff --git a/yql/essentials/tests/sql/suites/library/p_package_cluster.json b/yql/essentials/tests/sql/suites/library/p_package_cluster.json
new file mode 100644
index 0000000000..8824674974
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/p_package_cluster.json
@@ -0,0 +1 @@
+"plato"
diff --git a/yql/essentials/tests/sql/suites/library/package.cfg b/yql/essentials/tests/sql/suites/library/package.cfg
new file mode 100644
index 0000000000..2ec4243a95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package.cfg
@@ -0,0 +1,5 @@
+providers yt
+yt_file yt://plato/package/total.sql package_total.sql.txt
+yt_file yt://plato/package/detail/foo.sql package_foo.sql.txt
+yt_file yt://plato/package/detail/bar.sql package_bar.sql.txt
+param $cluster p_package_cluster.json
diff --git a/yql/essentials/tests/sql/suites/library/package.sql b/yql/essentials/tests/sql/suites/library/package.sql
new file mode 100644
index 0000000000..e649b298a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package.sql
@@ -0,0 +1,9 @@
+/* ytfile can not */
+
+declare $cluster as String;
+
+pragma package("project.package", "yt://{$cluster}/package");
+
+import pkg.project.package.total symbols $do_total;
+
+select $do_total(1);
diff --git a/yql/essentials/tests/sql/suites/library/package_bar.sql.txt b/yql/essentials/tests/sql/suites/library/package_bar.sql.txt
new file mode 100644
index 0000000000..adef3c7744
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_bar.sql.txt
@@ -0,0 +1,7 @@
+$do_bar = ($value) -> {
+ return AsStruct(
+ $value as bar
+ );
+};
+
+export $do_bar;
diff --git a/yql/essentials/tests/sql/suites/library/package_bar_override.sql.txt b/yql/essentials/tests/sql/suites/library/package_bar_override.sql.txt
new file mode 100644
index 0000000000..99244e08e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_bar_override.sql.txt
@@ -0,0 +1,7 @@
+$do_bar = ($value) -> {
+ return AsStruct(
+ $value as bar_override
+ );
+};
+
+export $do_bar;
diff --git a/yql/essentials/tests/sql/suites/library/package_foo.sql.txt b/yql/essentials/tests/sql/suites/library/package_foo.sql.txt
new file mode 100644
index 0000000000..88f9288369
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_foo.sql.txt
@@ -0,0 +1,7 @@
+$do_foo = ($value) -> {
+ return AsStruct(
+ $value as foo
+ );
+};
+
+export $do_foo;
diff --git a/yql/essentials/tests/sql/suites/library/package_override.cfg b/yql/essentials/tests/sql/suites/library/package_override.cfg
new file mode 100644
index 0000000000..5cc9b05eda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_override.cfg
@@ -0,0 +1,5 @@
+providers yt
+file pkg/project/package/detail/bar.sql package_bar_override.sql.txt
+yt_file yt://plato/package/total.sql package_total.sql.txt
+yt_file yt://plato/package/detail/foo.sql package_foo.sql.txt
+yt_file yt://plato/package/detail/bar.sql package_bar.sql.txt
diff --git a/yql/essentials/tests/sql/suites/library/package_override.sql b/yql/essentials/tests/sql/suites/library/package_override.sql
new file mode 100644
index 0000000000..bd0b2c7625
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_override.sql
@@ -0,0 +1,8 @@
+/* ytfile can not */
+
+pragma package("project.package", "yt://plato/package");
+pragma override_library("project/package/detail/bar.sql");
+
+import pkg.project.package.total symbols $do_total;
+
+select $do_total(1);
diff --git a/yql/essentials/tests/sql/suites/library/package_total.sql.txt b/yql/essentials/tests/sql/suites/library/package_total.sql.txt
new file mode 100644
index 0000000000..c1677315ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/package_total.sql.txt
@@ -0,0 +1,11 @@
+import pkg.project.package.detail.foo symbols $do_foo;
+import pkg.project.package.detail.bar symbols $do_bar;
+
+$do_total = ($value) -> {
+ $foo = $do_foo($value);
+ $bar = $do_bar($value);
+
+ return ($foo, $bar);
+};
+
+export $do_total;
diff --git a/yql/essentials/tests/sql/suites/library/udf.sql.txt b/yql/essentials/tests/sql/suites/library/udf.sql.txt
new file mode 100644
index 0000000000..1c7a2afd0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/library/udf.sql.txt
@@ -0,0 +1,2 @@
+$f = Unicode::ToUpper("foo"u);
+export $f;
diff --git a/yql/essentials/tests/sql/suites/like/default.cfg b/yql/essentials/tests/sql/suites/like/default.cfg
new file mode 100644
index 0000000000..e300a83153
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/like/ilike_clause.sql b/yql/essentials/tests/sql/suites/like/ilike_clause.sql
new file mode 100644
index 0000000000..42bb62c45e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/ilike_clause.sql
@@ -0,0 +1,2 @@
+select key, subkey, value from plato.Input
+where value ilike "q_Z" or value ilike "%Q";
diff --git a/yql/essentials/tests/sql/suites/like/input.txt b/yql/essentials/tests/sql/suites/like/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/like/like_clause.sql b/yql/essentials/tests/sql/suites/like/like_clause.sql
new file mode 100644
index 0000000000..4e190d1a05
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_clause.sql
@@ -0,0 +1,2 @@
+select key, subkey, value from plato.Input
+where value like "q_z" or value like "%q"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/like/like_clause_escape.sql b/yql/essentials/tests/sql/suites/like/like_clause_escape.sql
new file mode 100644
index 0000000000..9f7f67fb36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_clause_escape.sql
@@ -0,0 +1,5 @@
+select key, subkey, value from plato.Input
+where
+value like "!%z" escape "!" or
+value || "_" like "_?_" escape "?" or
+value || "!" like "ddd!!" escape "!"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/like/like_clause_no_pattern.sql b/yql/essentials/tests/sql/suites/like/like_clause_no_pattern.sql
new file mode 100644
index 0000000000..59e13dafdf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_clause_no_pattern.sql
@@ -0,0 +1,9 @@
+select
+ value,
+ case when
+ value like "abc"
+ then "true"
+ else "false"
+ end as is_abc
+from plato.Input
+order by is_abc desc, value asc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/like/like_escape.sql b/yql/essentials/tests/sql/suites/like/like_escape.sql
new file mode 100644
index 0000000000..f65d53be35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_escape.sql
@@ -0,0 +1 @@
+SELECT 'hawkeye' LIKE 'h%' ESCAPE '#' AS shouldTrue;
diff --git a/yql/essentials/tests/sql/suites/like/like_multiline.sql b/yql/essentials/tests/sql/suites/like/like_multiline.sql
new file mode 100644
index 0000000000..f514a3bf14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_multiline.sql
@@ -0,0 +1,3 @@
+SELECT
+"abc\ndef" LIKE "%f" AS match,
+"abc\ndef" LIKE "%a" AS no_match;
diff --git a/yql/essentials/tests/sql/suites/like/like_rewrite.sql b/yql/essentials/tests/sql/suites/like/like_rewrite.sql
new file mode 100644
index 0000000000..551e307ef8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/like_rewrite.sql
@@ -0,0 +1,11 @@
+PRAGMA AnsiLike;
+
+SELECT
+ 'abc' like '%%%%%',
+ 'qqq' like '%q%',
+ 'qqq' like '%q%q%q%',
+ 'def' like '%f',
+ 'def' like '%%%f',
+ 'foo' like 'foo%foo',
+ 'foofoo' like 'foo%%foo',
+ 'abcxzfoo' like '%x_foo',
diff --git a/yql/essentials/tests/sql/suites/like/regexp_clause.cfg b/yql/essentials/tests/sql/suites/like/regexp_clause.cfg
new file mode 100644
index 0000000000..93eff5b6bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/regexp_clause.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+udf re2_udf
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/like/regexp_clause.sql b/yql/essentials/tests/sql/suites/like/regexp_clause.sql
new file mode 100644
index 0000000000..648029051d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/like/regexp_clause.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+select key, subkey, value from plato.Input
+where value regexp "^a";
diff --git a/yql/essentials/tests/sql/suites/limit/default.cfg b/yql/essentials/tests/sql/suites/limit/default.cfg
new file mode 100644
index 0000000000..09cf05d98c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic.txt b/yql/essentials/tests/sql/suites/limit/dynamic.txt
new file mode 100644
index 0000000000..c2f900fd7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="075";"subkey"="4";"value"="abc"};
+{"key"="075";"subkey"="5";"value"="abc"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="800";"subkey"="7";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic.txt.attr b/yql/essentials/tests/sql/suites/limit/dynamic.txt.attr
new file mode 100644
index 0000000000..9e3c33c4cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic_limit.cfg b/yql/essentials/tests/sql/suites/limit/dynamic_limit.cfg
new file mode 100644
index 0000000000..eb1992232a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic_limit.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+res result.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic_limit.sql b/yql/essentials/tests/sql/suites/limit/dynamic_limit.sql
new file mode 100644
index 0000000000..b4eac0329a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic_limit.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+$avg = (SELECT AVG(Length(key)) FROM Input);
+
+SELECT key FROM Input LIMIT Cast($avg as Uint64) ?? 0;
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.cfg b/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.cfg
new file mode 100644
index 0000000000..1bfc4d45f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.sql b/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.sql
new file mode 100644
index 0000000000..96e033df95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/dynamic_sort_limit.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$script = @@
+def f(s):
+ return int(s)
+@@;
+
+$callable = Python::f(Callable<(String)->Uint64?>,$script);
+
+$i = unwrap($callable("2"));
+
+SELECT
+ key,
+ SOME(value) as value
+FROM Input
+GROUP BY key
+ORDER BY key LIMIT $i;
diff --git a/yql/essentials/tests/sql/suites/limit/empty_input_after_limit.sql b/yql/essentials/tests/sql/suites/limit/empty_input_after_limit.sql
new file mode 100644
index 0000000000..3a15ab796f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/empty_input_after_limit.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+$in = (
+ select * from plato.Input where key = "150"
+ union all
+ select * from plato.Input where key = "075"
+);
+
+select * from $in order by key limit 100 offset 90;
diff --git a/yql/essentials/tests/sql/suites/limit/empty_read_after_limit.sql b/yql/essentials/tests/sql/suites/limit/empty_read_after_limit.sql
new file mode 100644
index 0000000000..bc0dfad64e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/empty_read_after_limit.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+pragma direct_read;
+select * from plato.Input order by key limit 100 offset 90;
diff --git a/yql/essentials/tests/sql/suites/limit/empty_sort_after_limit.sql b/yql/essentials/tests/sql/suites/limit/empty_sort_after_limit.sql
new file mode 100644
index 0000000000..11ed40c1ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/empty_sort_after_limit.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input order by key limit 100 offset 90;
diff --git a/yql/essentials/tests/sql/suites/limit/empty_sort_calc_after_limit.sql b/yql/essentials/tests/sql/suites/limit/empty_sort_calc_after_limit.sql
new file mode 100644
index 0000000000..08033a5fef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/empty_sort_calc_after_limit.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input order by key || subkey limit 100 offset 90;
diff --git a/yql/essentials/tests/sql/suites/limit/empty_sort_desc_after_limit.sql b/yql/essentials/tests/sql/suites/limit/empty_sort_desc_after_limit.sql
new file mode 100644
index 0000000000..8bf56e6f2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/empty_sort_desc_after_limit.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input order by key desc limit 100 offset 90;
diff --git a/yql/essentials/tests/sql/suites/limit/input.txt b/yql/essentials/tests/sql/suites/limit/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/limit/insert_with_limit-dynamic.cfg b/yql/essentials/tests/sql/suites/limit/insert_with_limit-dynamic.cfg
new file mode 100644
index 0000000000..b4ffc75e3c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/insert_with_limit-dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/limit/insert_with_limit.cfg b/yql/essentials/tests/sql/suites/limit/insert_with_limit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/insert_with_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/limit/insert_with_limit.sql b/yql/essentials/tests/sql/suites/limit/insert_with_limit.sql
new file mode 100644
index 0000000000..f51506c8af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/insert_with_limit.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+insert into plato.Output with truncate
+select * from plato.Input limit 2;
diff --git a/yql/essentials/tests/sql/suites/limit/limit-dynamic.cfg b/yql/essentials/tests/sql/suites/limit/limit-dynamic.cfg
new file mode 100644
index 0000000000..80e8546f07
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit-dynamic.cfg
@@ -0,0 +1 @@
+in Input dynamic.txt
diff --git a/yql/essentials/tests/sql/suites/limit/limit.cfg b/yql/essentials/tests/sql/suites/limit/limit.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/limit/limit.sql b/yql/essentials/tests/sql/suites/limit/limit.sql
new file mode 100644
index 0000000000..8b2d036f97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input limit 1000; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/limit_offset.sql b/yql/essentials/tests/sql/suites/limit/limit_offset.sql
new file mode 100644
index 0000000000..99ac57e551
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit_offset.sql
@@ -0,0 +1 @@
+select value, subkey, key from (select * from plato.Input) as x order by key, subkey limit 1 offset 1;
diff --git a/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.cfg b/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.cfg
new file mode 100644
index 0000000000..c85115a8e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.sql b/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.sql
new file mode 100644
index 0000000000..9567209c22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit_over_sort_desc_in_subquery.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* hybridfile can not YQL-17743 */
+/* syntax version 1 */
+USE plato;
+
+$in = (
+ select
+ *
+ from Input
+ where subkey > '1'
+ order by
+ key desc
+ limit 15000
+);
+
+select
+ *
+from $in
+where value like "a%";
diff --git a/yql/essentials/tests/sql/suites/limit/limit_skip_take.sql b/yql/essentials/tests/sql/suites/limit/limit_skip_take.sql
new file mode 100644
index 0000000000..d6c63e4d82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/limit_skip_take.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select value, subkey, key from (select * from plato.Input) order by key, subkey limit 1,2;
diff --git a/yql/essentials/tests/sql/suites/limit/many_top_sorts.sql b/yql/essentials/tests/sql/suites/limit/many_top_sorts.sql
new file mode 100644
index 0000000000..ee81465874
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/many_top_sorts.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* ignore runonopt ast diff */
+/* ignore runonopt plan diff */
+use plato;
+
+$i = (select * from Input where key > "100");
+
+select * from $i order by key limit 1;
+
+select * from $i order by subkey limit 2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/sort_calc_limit.cfg b/yql/essentials/tests/sql/suites/limit/sort_calc_limit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/sort_calc_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/limit/sort_calc_limit.sql b/yql/essentials/tests/sql/suites/limit/sort_calc_limit.sql
new file mode 100644
index 0000000000..62bb39d249
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/sort_calc_limit.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+
+insert into Output with truncate
+select *
+from Input
+order by key || subkey
+limit 2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/sorted_desc.txt b/yql/essentials/tests/sql/suites/limit/sorted_desc.txt
new file mode 100644
index 0000000000..235fc7cd49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/sorted_desc.txt
@@ -0,0 +1,10 @@
+{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"};
+{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"};
+{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"};
+{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/limit/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/limit/sorted_desc.txt.attr
new file mode 100644
index 0000000000..5a6ca5761e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/sorted_desc.txt.attr
@@ -0,0 +1,47 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/yql-7900_empty_sorted_without_keys.sql b/yql/essentials/tests/sql/suites/limit/yql-7900_empty_sorted_without_keys.sql
new file mode 100644
index 0000000000..d61f7e9183
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-7900_empty_sorted_without_keys.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$cnt = (select count(*) from Input);
+$offset = ($cnt + 10) ?? 0;
+
+$data_limited = (select * from Input order by key || value limit 1 offset $offset);
+
+$result_top = (SELECT subkey, Length(key) as l, key FROM $data_limited);
+
+SELECT * FROM $result_top;
diff --git a/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.cfg b/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.cfg
new file mode 100644
index 0000000000..2e3eaf9682
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.sql b/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.sql
new file mode 100644
index 0000000000..6647df9e90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-8046_empty_sorted_desc.sql
@@ -0,0 +1,45 @@
+/* postgres can not */
+USE plato;
+
+$visitors = (
+SELECT
+ key,
+ subkey,
+ value
+FROM Input
+WHERE subkey != ""
+);
+
+$over_threshold = (
+SELECT
+ key,
+ subkey,
+ value
+FROM $visitors
+WHERE key > "070"
+);
+
+$clean = (SELECT COUNT(*) FROM $over_threshold);
+
+$tail = (
+SELECT
+ key,
+ subkey,
+ value
+FROM $visitors
+ORDER BY key DESC
+LIMIT IF($clean ?? 0 < 2, 2 - $clean ?? 0, 0)
+);
+
+INSERT INTO Output WITH TRUNCATE
+SELECT
+ key,
+ subkey,
+ value
+FROM $over_threshold
+UNION ALL
+SELECT
+ key,
+ subkey,
+ value
+FROM $tail;
diff --git a/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.cfg b/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.cfg
new file mode 100644
index 0000000000..b3080c2484
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.cfg
@@ -0,0 +1,6 @@
+in Input input.txt
+out Output0 output0.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+udf libyson_udf
diff --git a/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.sql b/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.sql
new file mode 100644
index 0000000000..aa1546401e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-8611_calc_peephole.sql
@@ -0,0 +1,31 @@
+USE plato;
+
+$tableList = AsList(
+ AsStruct(Yson('{"row_count"=9}') as Attributes, "Input1" as Path, "table" as Type),
+ AsStruct(Yson('{"row_count"=19}') as Attributes, "Input2" as Path, "table" as Type)
+);
+
+-- $bucket_size = 1000000;
+$buckets = ASLIST(0, 1, 2, 3);
+
+$row_count = (
+ SELECT Yson::LookupInt64(Attributes, "row_count")
+ FROM AS_TABLE($tableList)
+ WHERE
+ Type = "table"
+);
+
+$bucket_size = unwrap(CAST($row_count / ListLength($buckets) AS Uint64));
+
+DEFINE ACTION $make_bucket($bucket_number) AS
+ $offset = unwrap(CAST($bucket_number AS UInt8)) * $bucket_size;
+ $dst = "Output" || $bucket_number;
+
+ INSERT INTO $dst (
+ SELECT * FROM Input
+ ORDER BY key
+ LIMIT $bucket_size OFFSET $offset);
+END DEFINE;
+
+EVALUATE FOR $bucket_number IN $buckets
+ DO $make_bucket(CAST($bucket_number AS String));
diff --git a/yql/essentials/tests/sql/suites/limit/yql-9617_empty_lambda.sql b/yql/essentials/tests/sql/suites/limit/yql-9617_empty_lambda.sql
new file mode 100644
index 0000000000..8d438c5122
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/yql-9617_empty_lambda.sql
@@ -0,0 +1,7 @@
+use plato;
+
+select key, some(value) as value from Input
+where key > "999"
+group by key
+order by key
+limit 10; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/limit/zero_limit.sql b/yql/essentials/tests/sql/suites/limit/zero_limit.sql
new file mode 100644
index 0000000000..6532fb3737
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/limit/zero_limit.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+$x = (select * from Input order by value limit 10);
+
+select * from $x where key > "000" limit coalesce(cast(0.1 * 0 as Uint64), 0);
diff --git a/yql/essentials/tests/sql/suites/lineage/default.cfg b/yql/essentials/tests/sql/suites/lineage/default.cfg
new file mode 100644
index 0000000000..d818ef972a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+providers yt
+canonize_lineage \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/error_type.cfg b/yql/essentials/tests/sql/suites/lineage/error_type.cfg
new file mode 100644
index 0000000000..71212661a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/error_type.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+xfail
+
diff --git a/yql/essentials/tests/sql/suites/lineage/error_type.sql b/yql/essentials/tests/sql/suites/lineage/error_type.sql
new file mode 100644
index 0000000000..21f12d6d0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/error_type.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+INSERT INTO Output
+SELECT
+ 1 as foo
+FROM Input
+
+UNION ALL
+
+SELECT
+ 'x' as foo
+FROM Input
+
diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg b/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg
new file mode 100644
index 0000000000..ed48d1a300
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg
@@ -0,0 +1 @@
+in Input input_list_2.txt
diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_by.sql b/yql/essentials/tests/sql/suites/lineage/flatten_by.sql
new file mode 100644
index 0000000000..16bc737177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/flatten_by.sql
@@ -0,0 +1,21 @@
+use plato;
+
+$subquery1 =
+SELECT
+key, subkey, z
+FROM Input
+FLATTEN LIST BY value as z;
+
+$subquery2 =
+SELECT
+key, subkey, value as z, value2
+FROM Input
+FLATTEN LIST BY (value, value2);
+
+INSERT INTO @tmp1 WITH TRUNCATE
+SELECT *
+FROM $subquery1;
+
+INSERT INTO @tmp2 WITH TRUNCATE
+SELECT *
+FROM $subquery2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg
new file mode 100644
index 0000000000..0670741477
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg
@@ -0,0 +1,4 @@
+in Input input_list.txt
+out Output output.txt
+providers yt
+canonize_lineage
diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql
new file mode 100644
index 0000000000..f534644d0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql
@@ -0,0 +1,19 @@
+USE plato;
+
+$sub = (
+ select key
+ from Input
+ flatten list by
+ key
+);
+
+insert into Output
+ select
+ value,
+ ListFilter(
+ [value],
+ ($x) -> ($x in $sub)
+ ) as f
+ from Input
+ order by value
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_where.sql b/yql/essentials/tests/sql/suites/lineage/flatten_where.sql
new file mode 100644
index 0000000000..8f2d499356
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/flatten_where.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+INSERT INTO Output
+SELECT * FROM (
+ SELECT
+ [key, key] as key2,
+ value
+ FROM Input
+ WHERE value > ''
+) FLATTEN LIST BY key2
+
diff --git a/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql b/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql
new file mode 100644
index 0000000000..ea37605e02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql
@@ -0,0 +1,10 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT x FROM (
+SELECT
+ <|a:key,b:value|> as x
+FROM plato.Input
+)
+group by x
+)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg b/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg
new file mode 100644
index 0000000000..90436a56f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg
@@ -0,0 +1 @@
+in Input input_optional.txt
diff --git a/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql b/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql
new file mode 100644
index 0000000000..3bece90183
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql
@@ -0,0 +1,17 @@
+USE plato;
+
+$data = select
+ key, subkey, value
+from Input
+group by GROUPING SETS (
+ (key, subkey),
+ (subkey, value)
+ );
+
+INSERT INTO @tmp WITH TRUNCATE
+SELECT
+ b.value
+FROM $data AS a
+LEFT JOIN Input AS b
+USING (key)
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/if_struct.sql b/yql/essentials/tests/sql/suites/lineage/if_struct.sql
new file mode 100644
index 0000000000..c8e9b16f0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/if_struct.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select * from (select IF(key == "foo", CombineMembers(RemoveMembers(LAG(data) OVER w, ["key"]), ChooseMembers(data, ["key"])), data) from
+ (select TableRow() as data, key, value from plato.Input)
+window w as (partition by key)) flatten columns; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/input.txt b/yql/essentials/tests/sql/suites/lineage/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/lineage/input.txt.attr b/yql/essentials/tests/sql/suites/lineage/input.txt.attr
new file mode 100644
index 0000000000..36b3c00c90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["DataType";"String";];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/lineage/input_list.txt b/yql/essentials/tests/sql/suites/lineage/input_list.txt
new file mode 100644
index 0000000000..16d6acaa78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_list.txt
@@ -0,0 +1,3 @@
+{"key"=["075";"800"];"subkey"="1";"value"="abc"};
+{"key"=["020";"150"];"subkey"="3";"value"="q"};
+
diff --git a/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr
new file mode 100644
index 0000000000..01a4a26d00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["ListType";["DataType";"String";];];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/lineage/input_list_2.txt b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt
new file mode 100644
index 0000000000..90e76c01fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt
@@ -0,0 +1,3 @@
+{"key"="075";"subkey"="1";"value"=["abc";"cde"];"value2"=["efg"; "ghj"]};
+{"key"="020";"subkey"="3";"value"=["qqq";"ttt"];"value2"=["ppp";"rrr"]};
+
diff --git a/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr
new file mode 100644
index 0000000000..26fc5bf429
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String";];];
+ ["subkey";["DataType";"String";];];
+ ["value";["ListType";["DataType";"String";];];];
+ ["value2";["ListType";["DataType";"String";];];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/lineage/input_optional.txt b/yql/essentials/tests/sql/suites/lineage/input_optional.txt
new file mode 100644
index 0000000000..f707788196
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_optional.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"=1};
+{"key"="800";"subkey"="2";"value"=2};
+{"key"="020";"subkey"="3";"value"=3};
+{"key"="150";"subkey"="4";"value"=4};
diff --git a/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr
new file mode 100644
index 0000000000..b971d222d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"String"]]];["value";["OptionalType";["DataType";"Int64"];];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/lineage/isolated.sql b/yql/essentials/tests/sql/suites/lineage/isolated.sql
new file mode 100644
index 0000000000..2bd18612e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/isolated.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$one = select dummy from as_table([<|dummy:1|>]);
+
+INSERT INTO Output
+SELECT key FROM Input AS a
+CROSS JOIN $one AS b;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql b/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql
new file mode 100644
index 0000000000..2bb80fe374
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql
@@ -0,0 +1,15 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT x,y FROM (
+SELECT
+ key, <|a:key,b:value|> as x
+FROM plato.Input
+) as a
+JOIN (
+SELECT
+ key, <|c:key,d:value|> as y
+FROM plato.Input
+) as b
+ON a.key = b.key
+)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal1.sql b/yql/essentials/tests/sql/suites/lineage/list_literal1.sql
new file mode 100644
index 0000000000..b839e4526b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/list_literal1.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$key = select min(key) from Input;
+
+INSERT INTO Output
+SELECT
+$key as key;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal2.sql b/yql/essentials/tests/sql/suites/lineage/list_literal2.sql
new file mode 100644
index 0000000000..6fe5bf0773
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/list_literal2.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+$key = select min(key) from Input;
+
+INSERT INTO Output
+SELECT * FROM (
+ SELECT $key as key
+)
+where key > '';
+
diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal3.sql b/yql/essentials/tests/sql/suites/lineage/list_literal3.sql
new file mode 100644
index 0000000000..6344c18387
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/list_literal3.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+$key = select min(key) from Input;
+$value = select min(value) from Input;
+
+INSERT INTO Output
+SELECT * FROM (
+ SELECT $key as key
+ UNION ALL
+ SELECT $value as val
+)
+
diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal4.sql b/yql/essentials/tests/sql/suites/lineage/list_literal4.sql
new file mode 100644
index 0000000000..8ab9cafc82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/list_literal4.sql
@@ -0,0 +1,13 @@
+USE plato;
+
+$key = select min(key) from Input;
+$value = select min(value) from Input;
+
+INSERT INTO Output
+SELECT * FROM (
+ SELECT $key as key
+ UNION ALL
+ SELECT $value as val
+)
+WHERE key > '';
+
diff --git a/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql b/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql
new file mode 100644
index 0000000000..ceaf6df9b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select * from (select IF(key == "foo", LAG(data) over w, data) from
+ (select TableRow() as data, key, value from plato.Input)
+window w as (partition by key)) flatten columns; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql b/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql
new file mode 100644
index 0000000000..9091bae31e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql
@@ -0,0 +1,18 @@
+USE plato;
+
+$v = ($x) -> {
+ return ListFilter(["a","b"],($y)->($y = $x));
+};
+
+$k = ($x) -> {
+ return $x;
+};
+
+
+insert into Output
+with truncate
+select
+ $k(key) as k,
+ $v(value) as v
+from
+ Input
diff --git a/yql/essentials/tests/sql/suites/lineage/process.sql b/yql/essentials/tests/sql/suites/lineage/process.sql
new file mode 100644
index 0000000000..a97e7a237c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/process.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$p = ($s) -> ($s);
+
+INSERT INTO Output
+PROCESS Input
+USING $p(TableRows());
+
diff --git a/yql/essentials/tests/sql/suites/lineage/reduce.sql b/yql/essentials/tests/sql/suites/lineage/reduce.sql
new file mode 100644
index 0000000000..bc097c26af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/reduce.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+$r = ($_key, $s) -> ($s);
+
+INSERT INTO Output
+REDUCE Input
+ON key USING $r(TableRow());
diff --git a/yql/essentials/tests/sql/suites/lineage/reduce_all.sql b/yql/essentials/tests/sql/suites/lineage/reduce_all.sql
new file mode 100644
index 0000000000..aa16229644
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/reduce_all.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$r = ($s) -> ($s);
+
+INSERT INTO Output
+REDUCE Input
+ON key USING ALL $r(TableRows());
+
diff --git a/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql b/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql
new file mode 100644
index 0000000000..21be7d15ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+$r = ($s) -> (Yql::FlatMap($s, ($x)->($x.1)));
+
+INSERT INTO Output
+REDUCE Input
+ON key USING ALL $r(TableRow());
+
+
diff --git a/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg b/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg
new file mode 100644
index 0000000000..0670741477
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg
@@ -0,0 +1,4 @@
+in Input input_list.txt
+out Output output.txt
+providers yt
+canonize_lineage
diff --git a/yql/essentials/tests/sql/suites/lineage/scalar_context.sql b/yql/essentials/tests/sql/suites/lineage/scalar_context.sql
new file mode 100644
index 0000000000..ef0f4d18f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/scalar_context.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+$sub = (
+ select key
+ from Input where value = 'abc'
+);
+
+insert into Output
+ select
+ value, $sub as s
+ from Input
+ order by value
diff --git a/yql/essentials/tests/sql/suites/lineage/select_all.sql b/yql/essentials/tests/sql/suites/lineage/select_all.sql
new file mode 100644
index 0000000000..e83b513cf5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_all.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select * from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql b/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql
new file mode 100644
index 0000000000..660930df9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select * from plato.Input
+where key > ''
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_field.sql b/yql/essentials/tests/sql/suites/lineage/select_field.sql
new file mode 100644
index 0000000000..af706633d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_field.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select key from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql b/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql
new file mode 100644
index 0000000000..f07279fd60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select key from plato.Input
+where key > ''
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql b/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql
new file mode 100644
index 0000000000..2d4e4d2d89
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql
@@ -0,0 +1,6 @@
+insert into plato.Output
+select key from plato.Input
+order by key
+limit 4 offset 1;
+
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql b/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql
new file mode 100644
index 0000000000..6168ad6662
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select key, value from plato.Input
+order by key;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql b/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql
new file mode 100644
index 0000000000..deebad403e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select key as key2 from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql b/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql
new file mode 100644
index 0000000000..f0d0e6abd1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select count(*), min(value) from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql b/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql
new file mode 100644
index 0000000000..1c9e4b383d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select key, count(*), min(value) from plato.Input group by key order by key;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_join.sql b/yql/essentials/tests/sql/suites/lineage/select_join.sql
new file mode 100644
index 0000000000..fce7a756e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_join.sql
@@ -0,0 +1,5 @@
+insert into plato.Output
+select a.key as x, b.value as y from plato.Input as a
+join plato.Input as b on a.key = b.key
+order by x;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql b/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql
new file mode 100644
index 0000000000..61033e1f87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select key || value from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql b/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql
new file mode 100644
index 0000000000..adcc6c3619
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select StablePickle(TableRow()) from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_table_row.sql b/yql/essentials/tests/sql/suites/lineage/select_table_row.sql
new file mode 100644
index 0000000000..ca19dafd36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_table_row.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select TableRow() from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/select_union_all.sql b/yql/essentials/tests/sql/suites/lineage/select_union_all.sql
new file mode 100644
index 0000000000..24a56b8454
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/select_union_all.sql
@@ -0,0 +1,5 @@
+insert into plato.Output
+select key as x from plato.Input
+union all
+select value as x from plato.Input;
+
diff --git a/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql
new file mode 100644
index 0000000000..6edbc01dce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql
@@ -0,0 +1,6 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT
+ some(TableRow())
+FROM plato.Input)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/topsort.sql b/yql/essentials/tests/sql/suites/lineage/topsort.sql
new file mode 100644
index 0000000000..2289cb02b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/topsort.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+INSERT INTO Output
+SELECT a.value
+FROM Input AS a
+INNER JOIN (SELECT value FROM Input ORDER BY value LIMIT 1) AS b
+USING (value);
+
diff --git a/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql
new file mode 100644
index 0000000000..c2d3407e9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql
@@ -0,0 +1,11 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT
+ TableRow() as x
+FROM plato.Input
+UNION ALL
+SELECT
+ 1 as y
+FROM plato.Input
+)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql b/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql
new file mode 100644
index 0000000000..d7b657468d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+define subquery $f() as
+ SELECT * FROM Input
+end define;
+
+insert into Output with truncate
+ select * from $f()
+
diff --git a/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql b/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql
new file mode 100644
index 0000000000..3a65047285
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql
@@ -0,0 +1,6 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT
+ lead(<|a:key,b:value|>) over ()
+FROM plato.Input)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/window_many.sql b/yql/essentials/tests/sql/suites/lineage/window_many.sql
new file mode 100644
index 0000000000..5fe93a4226
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_many.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select key, row_number() over w1, lag(value) over w1, lead(value) over w1,
+ rank(value) over w2, dense_rank(value) over w2
+ from plato.Input window w1 as (order by key), w2 as (order by key desc) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql b/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql
new file mode 100644
index 0000000000..ff33cb8542
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql
@@ -0,0 +1,4 @@
+insert into plato.Output WITH TRUNCATE
+select * from (select lag(data) over w from
+ (select TableRow() as data, key from plato.Input)
+window w as (partition by key)) flatten columns;
diff --git a/yql/essentials/tests/sql/suites/lineage/window_one.sql b/yql/essentials/tests/sql/suites/lineage/window_one.sql
new file mode 100644
index 0000000000..6bd40dc505
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_one.sql
@@ -0,0 +1,2 @@
+insert into plato.Output
+select key, row_number() over () from plato.Input \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/lineage/window_session.sql b/yql/essentials/tests/sql/suites/lineage/window_session.sql
new file mode 100644
index 0000000000..74ba0f70d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_session.sql
@@ -0,0 +1,4 @@
+insert into plato.Output
+select key, row_number() over w as r, session_start() over w as s from plato.Input
+window w AS (PARTITION BY key, SessionWindow(cast(subkey as Datetime), DateTime::IntervalFromMinutes(15)));
+
diff --git a/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql
new file mode 100644
index 0000000000..e96be1ecfb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql
@@ -0,0 +1,6 @@
+INSERT INTO plato.Output
+SELECT * FROM (
+SELECT
+ lead(TableRow()) over ()
+FROM plato.Input)
+flatten columns
diff --git a/yql/essentials/tests/sql/suites/lineage/with_inline.sql b/yql/essentials/tests/sql/suites/lineage/with_inline.sql
new file mode 100644
index 0000000000..2c98d76f82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/lineage/with_inline.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+INSERT INTO Output
+SELECT
+key as key,
+"" as subkey,
+"value:" || value as value
+FROM Input WITH INLINE
diff --git a/yql/essentials/tests/sql/suites/match_recognize/after_match_skip_past_last_row.sql b/yql/essentials/tests/sql/suites/match_recognize/after_match_skip_past_last_row.sql
new file mode 100644
index 0000000000..79d9c76220
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/after_match_skip_past_last_row.sql
@@ -0,0 +1,19 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+
+$input = SELECT * FROM AS_TABLE([
+ <|time:0|>,
+ <|time:1|>,
+ <|time:2|>,
+ <|time:3|>,
+]);
+
+SELECT * FROM $input MATCH_RECOGNIZE(
+ ORDER BY CAST(time as Timestamp)
+ MEASURES
+ FIRST(X.time) as first_time,
+ LAST(X.time) as last_time
+ PATTERN (X{2})
+ DEFINE
+ X as True
+);
diff --git a/yql/essentials/tests/sql/suites/match_recognize/alerts-streaming.sql b/yql/essentials/tests/sql/suites/match_recognize/alerts-streaming.sql
new file mode 100644
index 0000000000..efa5bef17a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/alerts-streaming.sql
@@ -0,0 +1,61 @@
+$osquery_data = [
+<|dt:1688910000, host:"fqdn1", ev_type:"someEv", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910050, host:"fqdn2", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910100, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910220, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:false, |>,
+<|dt:1688910300, host:"fqdn1", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910400, host:"fqdn2", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688910600, host:"fqdn", ev_type:"someEv", ev_status:"", user:"user1", vpn:false, |>,
+<|dt:1688910800, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910900, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688911000, host:"fqdn2", ev_type:"login", ev_status:"success", user:"user1", vpn:false, |>,
+];
+
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "force");
+
+SELECT *
+FROM AS_TABLE($osquery_data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ LAST(SUSPICIOUS_ACTION_SOON.dt) as suspicious_action_dt,
+ LAST(LOGIN_SUCCESS_REMOTE.host) as remote_login_host,
+ LAST(LOGIN_SUCCESS_REMOTE.user) as remote_login_user,
+ LAST(LOGIN_SUCCESS_REMOTE.dt) as t,
+ FIRST(LOGIN_FAILED_SAME_USER.dt) as brutforce_begin,
+ FIRST(LOGIN_SUCCESS_SAME_USER.dt) as brutforce_end,
+ LAST(LOGIN_SUCCESS_SAME_USER.user) as brutforce_login
+
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ LOGIN_SUCCESS_REMOTE ANY_ROW* (SUSPICIOUS_ACTION_SOON | SUSPICIOUS_ACTION_TIMEOUT) |
+ (LOGIN_FAILED_SAME_USER ANY_ROW*){2,} LOGIN_SUCCESS_SAME_USER
+ )
+ DEFINE
+ LOGIN_SUCCESS_REMOTE as
+ LOGIN_SUCCESS_REMOTE.ev_type = "login" and
+ LOGIN_SUCCESS_REMOTE.ev_status = "success" and
+ LOGIN_SUCCESS_REMOTE.vpn = true,
+ SUSPICIOUS_ACTION_SOON as
+ SUSPICIOUS_ACTION_SOON.host = LAST(LOGIN_SUCCESS_REMOTE.host) and
+ SUSPICIOUS_ACTION_SOON.ev_type = "delete_all" and
+ SUSPICIOUS_ACTION_SOON.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) < 1000,
+ SUSPICIOUS_ACTION_TIMEOUT as
+ SUSPICIOUS_ACTION_TIMEOUT.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) >= 1000,
+
+ LOGIN_FAILED_SAME_USER as
+ LOGIN_FAILED_SAME_USER.ev_type = "login" and
+ LOGIN_FAILED_SAME_USER.ev_status <> "success" and
+ (LAST(LOGIN_FAILED_SAME_USER.user) IS NULL
+ or LAST(LOGIN_FAILED_SAME_USER.user) = LOGIN_FAILED_SAME_USER.user
+ ),
+ LOGIN_SUCCESS_SAME_USER as
+ LOGIN_SUCCESS_SAME_USER.ev_type = "login" and
+ LOGIN_SUCCESS_SAME_USER.ev_status = "success" and
+ LOGIN_SUCCESS_SAME_USER.user = LAST(LOGIN_FAILED_SAME_USER.user)
+) AS MATCHED
+;
+
diff --git a/yql/essentials/tests/sql/suites/match_recognize/alerts.sql b/yql/essentials/tests/sql/suites/match_recognize/alerts.sql
new file mode 100644
index 0000000000..65aac91efd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/alerts.sql
@@ -0,0 +1,61 @@
+$osquery_data = [
+<|dt:1688910000, host:"fqdn1", ev_type:"someEv", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910050, host:"fqdn2", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910100, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910220, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:false, |>,
+<|dt:1688910300, host:"fqdn1", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910400, host:"fqdn2", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688910600, host:"fqdn", ev_type:"someEv", ev_status:"", user:"user1", vpn:false, |>,
+<|dt:1688910800, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910900, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688911000, host:"fqdn2", ev_type:"login", ev_status:"success", user:"user1", vpn:false, |>,
+];
+
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+
+SELECT *
+FROM AS_TABLE($osquery_data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ LAST(SUSPICIOUS_ACTION_SOON.dt) as suspicious_action_dt,
+ LAST(LOGIN_SUCCESS_REMOTE.host) as remote_login_host,
+ LAST(LOGIN_SUCCESS_REMOTE.user) as remote_login_user,
+ LAST(LOGIN_SUCCESS_REMOTE.dt) as t,
+ FIRST(LOGIN_FAILED_SAME_USER.dt) as brutforce_begin,
+ FIRST(LOGIN_SUCCESS_SAME_USER.dt) as brutforce_end,
+ LAST(LOGIN_SUCCESS_SAME_USER.user) as brutforce_login
+
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ LOGIN_SUCCESS_REMOTE ANY_ROW* (SUSPICIOUS_ACTION_SOON | SUSPICIOUS_ACTION_TIMEOUT) |
+ (LOGIN_FAILED_SAME_USER ANY_ROW*){2,} LOGIN_SUCCESS_SAME_USER
+ )
+ DEFINE
+ LOGIN_SUCCESS_REMOTE as
+ LOGIN_SUCCESS_REMOTE.ev_type = "login" and
+ LOGIN_SUCCESS_REMOTE.ev_status = "success" and
+ LOGIN_SUCCESS_REMOTE.vpn = true,
+ SUSPICIOUS_ACTION_SOON as
+ SUSPICIOUS_ACTION_SOON.host = LAST(LOGIN_SUCCESS_REMOTE.host) and
+ SUSPICIOUS_ACTION_SOON.ev_type = "delete_all" and
+ SUSPICIOUS_ACTION_SOON.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) < 1000,
+ SUSPICIOUS_ACTION_TIMEOUT as
+ SUSPICIOUS_ACTION_TIMEOUT.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) >= 1000,
+
+ LOGIN_FAILED_SAME_USER as
+ LOGIN_FAILED_SAME_USER.ev_type = "login" and
+ LOGIN_FAILED_SAME_USER.ev_status <> "success" and
+ (LAST(LOGIN_FAILED_SAME_USER.user) IS NULL
+ or LAST(LOGIN_FAILED_SAME_USER.user) = LOGIN_FAILED_SAME_USER.user
+ ),
+ LOGIN_SUCCESS_SAME_USER as
+ LOGIN_SUCCESS_SAME_USER.ev_type = "login" and
+ LOGIN_SUCCESS_SAME_USER.ev_status = "success" and
+ LOGIN_SUCCESS_SAME_USER.user = LAST(LOGIN_FAILED_SAME_USER.user)
+) AS MATCHED
+;
+
diff --git a/yql/essentials/tests/sql/suites/match_recognize/alerts_without_order.sql b/yql/essentials/tests/sql/suites/match_recognize/alerts_without_order.sql
new file mode 100644
index 0000000000..4773e16588
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/alerts_without_order.sql
@@ -0,0 +1,60 @@
+$osquery_data = [
+<|dt:1688910000, host:"fqdn1", ev_type:"someEv", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910050, host:"fqdn2", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910100, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:true, |>,
+<|dt:1688910220, host:"fqdn1", ev_type:"login", ev_status:"success", user:"", vpn:false, |>,
+<|dt:1688910300, host:"fqdn1", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910400, host:"fqdn2", ev_type:"delete_all", ev_status:"", user:"", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910500, host:"fqdn1", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688910600, host:"fqdn", ev_type:"someEv", ev_status:"", user:"user1", vpn:false, |>,
+<|dt:1688910800, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user1", vpn:false, |>,
+<|dt:1688910900, host:"fqdn2", ev_type:"login", ev_status:"failed", user:"user2", vpn:false, |>,
+<|dt:1688911000, host:"fqdn2", ev_type:"login", ev_status:"success", user:"user1", vpn:false, |>,
+];
+
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+
+SELECT *
+FROM AS_TABLE($osquery_data) MATCH_RECOGNIZE(
+ MEASURES
+ LAST(SUSPICIOUS_ACTION_SOON.dt) as suspicious_action_dt,
+ LAST(LOGIN_SUCCESS_REMOTE.host) as remote_login_host,
+ LAST(LOGIN_SUCCESS_REMOTE.user) as remote_login_user,
+ LAST(LOGIN_SUCCESS_REMOTE.dt) as t,
+ FIRST(LOGIN_FAILED_SAME_USER.dt) as brutforce_begin,
+ FIRST(LOGIN_SUCCESS_SAME_USER.dt) as brutforce_end,
+ LAST(LOGIN_SUCCESS_SAME_USER.user) as brutforce_login
+
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ LOGIN_SUCCESS_REMOTE ANY_ROW* (SUSPICIOUS_ACTION_SOON | SUSPICIOUS_ACTION_TIMEOUT) |
+ (LOGIN_FAILED_SAME_USER ANY_ROW*){2,} LOGIN_SUCCESS_SAME_USER
+ )
+ DEFINE
+ LOGIN_SUCCESS_REMOTE as
+ LOGIN_SUCCESS_REMOTE.ev_type = "login" and
+ LOGIN_SUCCESS_REMOTE.ev_status = "success" and
+ LOGIN_SUCCESS_REMOTE.vpn = true,
+ SUSPICIOUS_ACTION_SOON as
+ SUSPICIOUS_ACTION_SOON.host = LAST(LOGIN_SUCCESS_REMOTE.host) and
+ SUSPICIOUS_ACTION_SOON.ev_type = "delete_all" and
+ SUSPICIOUS_ACTION_SOON.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) < 1000,
+ SUSPICIOUS_ACTION_TIMEOUT as
+ SUSPICIOUS_ACTION_TIMEOUT.dt - LAST(LOGIN_SUCCESS_REMOTE.dt) >= 1000,
+
+ LOGIN_FAILED_SAME_USER as
+ LOGIN_FAILED_SAME_USER.ev_type = "login" and
+ LOGIN_FAILED_SAME_USER.ev_status <> "success" and
+ (LAST(LOGIN_FAILED_SAME_USER.user) IS NULL
+ or LAST(LOGIN_FAILED_SAME_USER.user) = LOGIN_FAILED_SAME_USER.user
+ ),
+ LOGIN_SUCCESS_SAME_USER as
+ LOGIN_SUCCESS_SAME_USER.ev_type = "login" and
+ LOGIN_SUCCESS_SAME_USER.ev_status = "success" and
+ LOGIN_SUCCESS_SAME_USER.user = LAST(LOGIN_FAILED_SAME_USER.user)
+) AS MATCHED
+;
+
diff --git a/yql/essentials/tests/sql/suites/match_recognize/default.cfg b/yql/essentials/tests/sql/suites/match_recognize/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/default.cfg
diff --git a/yql/essentials/tests/sql/suites/match_recognize/permute.sql b/yql/essentials/tests/sql/suites/match_recognize/permute.sql
new file mode 100644
index 0000000000..614f5b77e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/permute.sql
@@ -0,0 +1,35 @@
+$data = [
+<|dt:1688910000, event:"A"|>,
+<|dt:1688910100, event:"B"|>,
+<|dt:1688910200, event:"C"|>,
+<|dt:1688910300, event:"A"|>,
+<|dt:1688910400, event:"C"|>,
+<|dt:1688910500, event:"D"|>,
+<|dt:1688910500, event:"C"|>,
+<|dt:1688910600, event:"B"|>,
+<|dt:1688910800, event:"A"|>,
+<|dt:1688910900, event:"C"|>,
+<|dt:1688911000, event:"B"|>,
+];
+
+pragma FeatureR010="prototype";
+
+SELECT *
+FROM AS_TABLE($data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ FIRST(A.dt) as a,
+ FIRST(B.dt) as b,
+ FIRST(C.dt) as c
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ PERMUTE(A, B, C)
+ )
+ DEFINE
+ A as A.event = "A",
+ B as B.event = "B",
+ C as C.event = "C"
+ ) AS MATCHED
+;
+
diff --git a/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning-streaming.sql b/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning-streaming.sql
new file mode 100644
index 0000000000..460af6b5da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning-streaming.sql
@@ -0,0 +1,45 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "force");
+USE plato;
+
+$data = [
+<|dt:15, host:"fqdn1", key:0|>,
+<|dt:16, host:"fqdn1", key:1|>,
+<|dt:17, host:"fqdn1", key:2|>,
+<|dt:18, host:"fqdn1", key:3|>,
+<|dt:19, host:"fqdn1", key:4|>,
+<|dt:20, host:"fqdn1", key:5|>,
+<|dt:21, host:"fqdn1", key:6|>,
+<|dt:22, host:"fqdn1", key:7|>,
+<|dt:23, host:"fqdn_2", key:0|>,
+<|dt:24, host:"fqdn1", key:8|>,
+<|dt:25, host:"fqdn1", key:9|>,
+<|dt:26, host:"fqdn1", key:10|>,
+<|dt:27, host:"fqdn__3", key:30|>,
+<|dt:28, host:"fqdn__3", key:1|>,
+<|dt:29, host:"fqdn__3", key:2|>,
+<|dt:30, host:"fqdn__3", key:3|>,
+<|dt:31, host:"fqdn__3", key:4|>,
+<|dt:32, host:"fqdn1", key:11|>,
+<|dt:33, host:"fqdn1", key:12|>,
+<|dt:34, host:"fqdn1", key:13|>,
+<|dt:35, host:"fqdn1", key:14|>,
+<|dt:36, host:"fqdn__3", key:15|>
+];
+
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ Last(Q.dt) as T,
+ First(Y.key) as Key
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ (Y Q)
+ )
+ DEFINE
+ Y as (Y.key) % 3 = 0,
+ Q as (Q.key) % 3 <> 0
+ ) as MR
+ORDER BY MR.T;
diff --git a/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning.sql b/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning.sql
new file mode 100644
index 0000000000..1c60d89462
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/simple_paritioning.sql
@@ -0,0 +1,46 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+
+USE plato;
+
+$data = [
+<|dt:15, host:"fqdn1", key:0|>,
+<|dt:16, host:"fqdn1", key:1|>,
+<|dt:17, host:"fqdn1", key:2|>,
+<|dt:18, host:"fqdn1", key:3|>,
+<|dt:19, host:"fqdn1", key:4|>,
+<|dt:20, host:"fqdn1", key:5|>,
+<|dt:21, host:"fqdn1", key:6|>,
+<|dt:22, host:"fqdn1", key:7|>,
+<|dt:23, host:"fqdn_2", key:0|>,
+<|dt:24, host:"fqdn1", key:8|>,
+<|dt:25, host:"fqdn1", key:9|>,
+<|dt:26, host:"fqdn1", key:10|>,
+<|dt:27, host:"fqdn__3", key:30|>,
+<|dt:28, host:"fqdn__3", key:1|>,
+<|dt:29, host:"fqdn__3", key:2|>,
+<|dt:30, host:"fqdn__3", key:3|>,
+<|dt:31, host:"fqdn__3", key:4|>,
+<|dt:32, host:"fqdn1", key:11|>,
+<|dt:33, host:"fqdn1", key:12|>,
+<|dt:34, host:"fqdn1", key:13|>,
+<|dt:35, host:"fqdn1", key:14|>,
+<|dt:36, host:"fqdn__3", key:15|>
+];
+
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host
+ ORDER BY dt
+ MEASURES
+ Last(Q.dt) as T,
+ First(Y.key) as Key
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ (Y Q)
+ )
+ DEFINE
+ Y as (Y.key) % 3 = 0,
+ Q as (Q.key) % 3 <> 0
+ ) as MR
+ORDER BY MR.T;
diff --git a/yql/essentials/tests/sql/suites/match_recognize/test_type-streaming.sql b/yql/essentials/tests/sql/suites/match_recognize/test_type-streaming.sql
new file mode 100644
index 0000000000..d742cae284
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/test_type-streaming.sql
@@ -0,0 +1,75 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "force");
+USE plato;
+
+$data = [<|dt:4, host:"fqdn1", key:14|>];
+
+-- NoPartitionNoMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Y
+ )
+ DEFINE
+ Y as NULL
+ );
+
+--NoPartitionStringMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as Measure1
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Q
+ )
+ DEFINE
+ Q as TRUE
+ );
+
+--IntPartitionColNoMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY key
+ ORDER BY CAST(dt as Timestamp)
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ L
+ )
+ DEFINE
+ L as JUST(TRUE)
+ );
+
+--StringPartitionColStringMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as Measure1
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Y
+ )
+ DEFINE
+ Y as TRUE
+ );
+
+--TwoPartitionColsTwoMeasures
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host, key
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as S,
+ 345 as I
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Q
+ )
+ DEFINE
+ Q as TRUE
+);
diff --git a/yql/essentials/tests/sql/suites/match_recognize/test_type.sql b/yql/essentials/tests/sql/suites/match_recognize/test_type.sql
new file mode 100644
index 0000000000..a92b5672e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/test_type.sql
@@ -0,0 +1,76 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+USE plato;
+
+$data = [<|dt:4, host:"fqdn1", key:14|>];
+
+
+-- NoPartitionNoMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Y
+ )
+ DEFINE
+ Y as NULL
+);
+
+--NoPartitionStringMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as Measure1
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Q
+ )
+ DEFINE
+ Q as TRUE
+);
+
+--IntPartitionColNoMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY dt
+ ORDER BY CAST(dt as Timestamp)
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ L
+ )
+ DEFINE
+ L as JUST(TRUE)
+);
+
+--StringPartitionColStringMeasure
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as Measure1
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Y
+ )
+ DEFINE
+ Y as TRUE
+);
+
+--TwoPartitionColsTwoMeasures
+select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ PARTITION BY host, dt
+ ORDER BY CAST(dt as Timestamp)
+ MEASURES
+ "SomeString" as S,
+ 345 as I
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ Q
+ )
+ DEFINE
+ Q as JUST(TRUE)
+);
diff --git a/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.cfg b/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.sql b/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.sql
new file mode 100644
index 0000000000..b19e7c6671
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/match_recognize/test_type_predicate.sql
@@ -0,0 +1,18 @@
+pragma FeatureR010="prototype";
+pragma config.flags("MatchRecognizeStream", "disable");
+
+USE plato;
+
+$data = [<||>];
+
+$BadPredicate = select TableRow() from (select * from AS_TABLE($data) MATCH_RECOGNIZE(
+ ONE ROW PER MATCH
+ AFTER MATCH SKIP TO NEXT ROW
+ PATTERN (
+ A
+ )
+ DEFINE
+ A as 123 -- must fail, Bool expected
+));
+
+select FormatType(TypeOf($BadPredicate));
diff --git a/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.cfg b/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.sql b/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.sql
new file mode 100644
index 0000000000..39306eb32a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/aggregate_over_aggregate.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+
+use plato;
+
+select distinct * from Input group by value, subkey, key order by subkey;
diff --git a/yql/essentials/tests/sql/suites/optimizers/and_absorption.cfg b/yql/essentials/tests/sql/suites/optimizers/and_absorption.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/and_absorption.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/and_absorption.sql b/yql/essentials/tests/sql/suites/optimizers/and_absorption.sql
new file mode 100644
index 0000000000..d939b2f6e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/and_absorption.sql
@@ -0,0 +1,9 @@
+pragma config.flags("OptimizerFlags", "ExtractCommonPredicatesFromLogicalOps");
+
+$a = 1 > 2;
+$b = 3 < 4;
+$c = 5 < 6;
+$d = 7 > 8;
+
+select (($a or $b) and $a) == $a;
+select (($b or $a) and $c and $b and ($d or $c)) == ($c and $b);
diff --git a/yql/essentials/tests/sql/suites/optimizers/coalesce_propagate.sql b/yql/essentials/tests/sql/suites/optimizers/coalesce_propagate.sql
new file mode 100644
index 0000000000..843106d800
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/coalesce_propagate.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+
+$src = [
+ <|x:1/0, y:2/0|>,
+ <|x:1/0, y:1|>,
+ <|x:1, y:1/0|>,
+ <|x:2, y:2|>,
+ <|x:3, y:3|>,
+ <|x:4, y:4|>,
+ <|x:5, y:5|>,
+];
+
+select * from as_table($src) where not (x < 3 or y > 3);
diff --git a/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.cfg b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.sql b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.sql
new file mode 100644
index 0000000000..6ed4e0ed36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset.sql
@@ -0,0 +1,3 @@
+SELECT count(DISTINCT subkey) AS subkey
+FROM plato.Input
+WHERE (key == "075" OR key == "150");
diff --git a/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.cfg b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.cfg
new file mode 100644
index 0000000000..f2bc0f7ec7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.cfg
@@ -0,0 +1,3 @@
+in Input0 sorted.txt
+in Input1 sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.sql b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.sql
new file mode 100644
index 0000000000..3acd90202b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/combinebykey_fields_subset_range.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+
+SELECT count(DISTINCT subkey) AS subkey
+FROM plato.CONCAT(Input0, Input1)
+WHERE (key == "075" OR key == "150");
diff --git a/yql/essentials/tests/sql/suites/optimizers/constant_fold_minmax.sql b/yql/essentials/tests/sql/suites/optimizers/constant_fold_minmax.sql
new file mode 100644
index 0000000000..841d5ae740
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/constant_fold_minmax.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+
+SELECT
+ MIN_OF(50ut, -255ut, 5ut, 15ut) AS MinByte,
+ MAX_OF(50ut, -255ut, 5ut, 15ut) AS MaxByte,
+ MIN_OF(300000, -600000, 4) AS MinInt32,
+ MAX_OF(300000, -600000, 4) AS MaxInt32,
+ MIN_OF(300000u, 600u, -4000000000u) AS MinUInt32,
+ MAX_OF(300000u, 600u, -4000000000u) AS MaxUInt32,
+ MIN_OF(80l, 5000000000l, 90l, -6000000000l) AS MinInt64,
+ MAX_OF(80l, 5000000000l, 90l, -6000000000l) AS MaxInt64,
+ MIN_OF(80ul, -5000000000ul, 90ul, 6000000000ul) AS MinUInt64,
+ MAX_OF(80ul, -5000000000ul, 90ul, 6000000000ul) AS MaxUInt64,
+ MIN_OF(50ut, -10, 56l, 17u, 78ul) AS MinMixed1,
+ MAX_OF(50ut, -10, 56l, 17u, 78ul) AS MaxMixed1,
+ MIN_OF(50ut, 30, 40) AS MinMixed2,
+ MAX_OF(50ut, 30, 40) AS MaxMixed2,
+ MIN_OF(1) AS MinSingle,
+ MAX_OF(-1) AS MaxSingle;
diff --git a/yql/essentials/tests/sql/suites/optimizers/default.cfg b/yql/essentials/tests/sql/suites/optimizers/default.cfg
new file mode 100644
index 0000000000..9b1614d4c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/default.cfg
@@ -0,0 +1,3 @@
+in Input0 input0.txt
+in Input1 input1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.cfg b/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.cfg
new file mode 100644
index 0000000000..3712d0f1ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.cfg
@@ -0,0 +1,3 @@
+in Input1 sorted.txt
+in Input2 sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.sql b/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.sql
new file mode 100644
index 0000000000..cde00141a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/direct_row_after_merge.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ key,
+ TablePath() as path
+FROM concat(Input1, Input2)
+order by key, path; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.cfg b/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.cfg
new file mode 100644
index 0000000000..670afdcdfa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.cfg
@@ -0,0 +1,3 @@
+in Input1 input3.txt
+in Input2 input_other.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.sql b/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.sql
new file mode 100644
index 0000000000..3a568de9ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/field_subset_for_multiusage.sql
@@ -0,0 +1,15 @@
+use plato;
+
+select
+ key,
+ count(1) as cnt,
+ sum(cast(subkey as int32)) as sm
+from concat(Input1, Input2)
+where subkey in ("1", "2", "3", "4")
+group by key
+order by sm desc;
+
+select
+ count(1) as cnt,
+ sum(cast(subkey as int32)) as sm
+from concat(Input1, Input2);
diff --git a/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.cfg b/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.cfg
new file mode 100644
index 0000000000..86ef4956fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.cfg
@@ -0,0 +1,3 @@
+in Input input3.txt
+res result.txt
+providers yt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.sql b/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.sql
new file mode 100644
index 0000000000..4a99afbccf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/flatmap_with_non_struct_out.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+$lst = process Input;
+$dict = ToDict(ListMap($lst,($x)->(($x.key, $x.subkey))));
+
+SELECT DictLength($dict); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.cfg b/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.cfg
new file mode 100644
index 0000000000..de847dcf33
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.cfg
@@ -0,0 +1,6 @@
+in Input1 input3.txt
+in Input2 input3.txt
+in Input3 input3.txt
+in Input4 opt_key.txt
+in Input5 opt_key.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.sql b/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.sql
new file mode 100644
index 0000000000..f5e2aab6e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/group_visit_lambdas.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+
+USE plato;
+
+select
+ key,
+ subkey,
+ value,
+ TablePath() as path
+from
+ range("", "Input1", "Input5")
+where key != ""
+order by key, subkey, path; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/input0.txt b/yql/essentials/tests/sql/suites/optimizers/input0.txt
new file mode 100644
index 0000000000..d3442809d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input0.txt
@@ -0,0 +1,200 @@
+{"key"="0";"subkey"="7";"value"="Value #18"};
+{"key"="1";"subkey"="12";"value"="Value #48"};
+{"key"="10";"subkey"="8";"value"="Value #33"};
+{"key"="100";"subkey"="9";"value"="Value #21"};
+{"key"="101";"subkey"="16";"value"="Value #32"};
+{"key"="102";"subkey"="12";"value"="Value #13"};
+{"key"="103";"subkey"="18";"value"="Value #11"};
+{"key"="104";"subkey"="3";"value"="Value #37"};
+{"key"="105";"subkey"="10";"value"="Value #52"};
+{"key"="106";"subkey"="4";"value"="Value #1"};
+{"key"="107";"subkey"="1";"value"="Value #47"};
+{"key"="108";"subkey"="16";"value"="Value #35"};
+{"key"="109";"subkey"="18";"value"="Value #12"};
+{"key"="11";"subkey"="13";"value"="Value #36"};
+{"key"="110";"subkey"="18";"value"="Value #39"};
+{"key"="111";"subkey"="14";"value"="Value #9"};
+{"key"="112";"subkey"="15";"value"="Value #14"};
+{"key"="113";"subkey"="2";"value"="Value #56"};
+{"key"="114";"subkey"="5";"value"="Value #49"};
+{"key"="115";"subkey"="1";"value"="Value #47"};
+{"key"="116";"subkey"="12";"value"="Value #13"};
+{"key"="117";"subkey"="3";"value"="Value #5"};
+{"key"="118";"subkey"="11";"value"="Value #27"};
+{"key"="119";"subkey"="14";"value"="Value #9"};
+{"key"="120";"subkey"="13";"value"="Value #25"};
+{"key"="121";"subkey"="11";"value"="Value #58"};
+{"key"="122";"subkey"="10";"value"="Value #59"};
+{"key"="123";"subkey"="15";"value"="Value #26"};
+{"key"="124";"subkey"="6";"value"="Value #16"};
+{"key"="125";"subkey"="10";"value"="Value #23"};
+{"key"="126";"subkey"="19";"value"="Value #17"};
+{"key"="127";"subkey"="5";"value"="Value #38"};
+{"key"="128";"subkey"="2";"value"="Value #56"};
+{"key"="129";"subkey"="2";"value"="Value #10"};
+{"key"="12";"subkey"="12";"value"="Value #13"};
+{"key"="130";"subkey"="4";"value"="Value #22"};
+{"key"="131";"subkey"="8";"value"="Value #43"};
+{"key"="132";"subkey"="18";"value"="Value #39"};
+{"key"="133";"subkey"="12";"value"="Value #48"};
+{"key"="134";"subkey"="0";"value"="Value #31"};
+{"key"="135";"subkey"="9";"value"="Value #21"};
+{"key"="136";"subkey"="8";"value"="Value #46"};
+{"key"="137";"subkey"="9";"value"="Value #20"};
+{"key"="138";"subkey"="2";"value"="Value #6"};
+{"key"="139";"subkey"="7";"value"="Value #44"};
+{"key"="13";"subkey"="3";"value"="Value #37"};
+{"key"="140";"subkey"="0";"value"="Value #30"};
+{"key"="141";"subkey"="16";"value"="Value #35"};
+{"key"="142";"subkey"="3";"value"="Value #5"};
+{"key"="143";"subkey"="14";"value"="Value #9"};
+{"key"="144";"subkey"="13";"value"="Value #28"};
+{"key"="145";"subkey"="15";"value"="Value #2"};
+{"key"="146";"subkey"="7";"value"="Value #18"};
+{"key"="147";"subkey"="19";"value"="Value #41"};
+{"key"="148";"subkey"="19";"value"="Value #0"};
+{"key"="149";"subkey"="7";"value"="Value #15"};
+{"key"="14";"subkey"="19";"value"="Value #0"};
+{"key"="150";"subkey"="11";"value"="Value #27"};
+{"key"="151";"subkey"="1";"value"="Value #55"};
+{"key"="152";"subkey"="1";"value"="Value #47"};
+{"key"="153";"subkey"="17";"value"="Value #24"};
+{"key"="154";"subkey"="7";"value"="Value #44"};
+{"key"="155";"subkey"="8";"value"="Value #43"};
+{"key"="156";"subkey"="14";"value"="Value #45"};
+{"key"="157";"subkey"="0";"value"="Value #31"};
+{"key"="158";"subkey"="3";"value"="Value #50"};
+{"key"="159";"subkey"="10";"value"="Value #52"};
+{"key"="15";"subkey"="17";"value"="Value #7"};
+{"key"="160";"subkey"="18";"value"="Value #39"};
+{"key"="161";"subkey"="9";"value"="Value #29"};
+{"key"="162";"subkey"="14";"value"="Value #45"};
+{"key"="163";"subkey"="3";"value"="Value #5"};
+{"key"="164";"subkey"="10";"value"="Value #52"};
+{"key"="165";"subkey"="13";"value"="Value #36"};
+{"key"="166";"subkey"="14";"value"="Value #4"};
+{"key"="167";"subkey"="16";"value"="Value #53"};
+{"key"="168";"subkey"="9";"value"="Value #29"};
+{"key"="169";"subkey"="6";"value"="Value #40"};
+{"key"="16";"subkey"="8";"value"="Value #46"};
+{"key"="170";"subkey"="15";"value"="Value #26"};
+{"key"="171";"subkey"="6";"value"="Value #40"};
+{"key"="172";"subkey"="16";"value"="Value #53"};
+{"key"="173";"subkey"="2";"value"="Value #10"};
+{"key"="174";"subkey"="5";"value"="Value #54"};
+{"key"="175";"subkey"="17";"value"="Value #7"};
+{"key"="176";"subkey"="10";"value"="Value #23"};
+{"key"="177";"subkey"="4";"value"="Value #51"};
+{"key"="178";"subkey"="17";"value"="Value #7"};
+{"key"="179";"subkey"="11";"value"="Value #19"};
+{"key"="17";"subkey"="11";"value"="Value #58"};
+{"key"="180";"subkey"="7";"value"="Value #44"};
+{"key"="181";"subkey"="2";"value"="Value #56"};
+{"key"="182";"subkey"="11";"value"="Value #58"};
+{"key"="183";"subkey"="12";"value"="Value #57"};
+{"key"="184";"subkey"="6";"value"="Value #16"};
+{"key"="185";"subkey"="11";"value"="Value #27"};
+{"key"="186";"subkey"="19";"value"="Value #17"};
+{"key"="187";"subkey"="12";"value"="Value #48"};
+{"key"="188";"subkey"="6";"value"="Value #8"};
+{"key"="189";"subkey"="1";"value"="Value #34"};
+{"key"="18";"subkey"="6";"value"="Value #40"};
+{"key"="190";"subkey"="15";"value"="Value #26"};
+{"key"="191";"subkey"="16";"value"="Value #53"};
+{"key"="192";"subkey"="2";"value"="Value #6"};
+{"key"="193";"subkey"="18";"value"="Value #11"};
+{"key"="194";"subkey"="9";"value"="Value #20"};
+{"key"="195";"subkey"="12";"value"="Value #57"};
+{"key"="196";"subkey"="3";"value"="Value #5"};
+{"key"="197";"subkey"="8";"value"="Value #33"};
+{"key"="198";"subkey"="4";"value"="Value #22"};
+{"key"="199";"subkey"="13";"value"="Value #25"};
+{"key"="19";"subkey"="11";"value"="Value #19"};
+{"key"="20";"subkey"="9";"value"="Value #29"};
+{"key"="21";"subkey"="1";"value"="Value #55"};
+{"key"="22";"subkey"="18";"value"="Value #12"};
+{"key"="23";"subkey"="7";"value"="Value #15"};
+{"key"="24";"subkey"="15";"value"="Value #14"};
+{"key"="25";"subkey"="8";"value"="Value #43"};
+{"key"="26";"subkey"="5";"value"="Value #54"};
+{"key"="27";"subkey"="13";"value"="Value #28"};
+{"key"="28";"subkey"="5";"value"="Value #54"};
+{"key"="29";"subkey"="10";"value"="Value #23"};
+{"key"="2";"subkey"="6";"value"="Value #8"};
+{"key"="30";"subkey"="7";"value"="Value #44"};
+{"key"="31";"subkey"="1";"value"="Value #34"};
+{"key"="32";"subkey"="17";"value"="Value #3"};
+{"key"="33";"subkey"="9";"value"="Value #21"};
+{"key"="34";"subkey"="6";"value"="Value #40"};
+{"key"="35";"subkey"="4";"value"="Value #51"};
+{"key"="36";"subkey"="16";"value"="Value #32"};
+{"key"="37";"subkey"="0";"value"="Value #31"};
+{"key"="38";"subkey"="0";"value"="Value #42"};
+{"key"="39";"subkey"="0";"value"="Value #30"};
+{"key"="3";"subkey"="18";"value"="Value #11"};
+{"key"="40";"subkey"="17";"value"="Value #7"};
+{"key"="41";"subkey"="19";"value"="Value #41"};
+{"key"="42";"subkey"="10";"value"="Value #52"};
+{"key"="43";"subkey"="8";"value"="Value #33"};
+{"key"="44";"subkey"="13";"value"="Value #36"};
+{"key"="45";"subkey"="17";"value"="Value #3"};
+{"key"="46";"subkey"="14";"value"="Value #4"};
+{"key"="47";"subkey"="8";"value"="Value #46"};
+{"key"="48";"subkey"="12";"value"="Value #13"};
+{"key"="49";"subkey"="0";"value"="Value #30"};
+{"key"="4";"subkey"="15";"value"="Value #2"};
+{"key"="50";"subkey"="2";"value"="Value #6"};
+{"key"="51";"subkey"="7";"value"="Value #18"};
+{"key"="52";"subkey"="14";"value"="Value #45"};
+{"key"="53";"subkey"="19";"value"="Value #41"};
+{"key"="54";"subkey"="4";"value"="Value #51"};
+{"key"="55";"subkey"="7";"value"="Value #15"};
+{"key"="56";"subkey"="3";"value"="Value #50"};
+{"key"="57";"subkey"="14";"value"="Value #4"};
+{"key"="58";"subkey"="3";"value"="Value #37"};
+{"key"="59";"subkey"="19";"value"="Value #41"};
+{"key"="5";"subkey"="13";"value"="Value #28"};
+{"key"="60";"subkey"="18";"value"="Value #12"};
+{"key"="61";"subkey"="15";"value"="Value #14"};
+{"key"="62";"subkey"="4";"value"="Value #1"};
+{"key"="63";"subkey"="18";"value"="Value #12"};
+{"key"="64";"subkey"="5";"value"="Value #38"};
+{"key"="65";"subkey"="17";"value"="Value #24"};
+{"key"="66";"subkey"="17";"value"="Value #3"};
+{"key"="67";"subkey"="5";"value"="Value #38"};
+{"key"="68";"subkey"="5";"value"="Value #49"};
+{"key"="69";"subkey"="5";"value"="Value #49"};
+{"key"="6";"subkey"="4";"value"="Value #1"};
+{"key"="70";"subkey"="16";"value"="Value #32"};
+{"key"="71";"subkey"="1";"value"="Value #55"};
+{"key"="72";"subkey"="1";"value"="Value #34"};
+{"key"="73";"subkey"="8";"value"="Value #33"};
+{"key"="74";"subkey"="10";"value"="Value #59"};
+{"key"="75";"subkey"="6";"value"="Value #8"};
+{"key"="76";"subkey"="0";"value"="Value #30"};
+{"key"="77";"subkey"="19";"value"="Value #17"};
+{"key"="78";"subkey"="13";"value"="Value #28"};
+{"key"="79";"subkey"="3";"value"="Value #50"};
+{"key"="7";"subkey"="17";"value"="Value #24"};
+{"key"="80";"subkey"="5";"value"="Value #49"};
+{"key"="81";"subkey"="14";"value"="Value #45"};
+{"key"="82";"subkey"="19";"value"="Value #0"};
+{"key"="83";"subkey"="15";"value"="Value #2"};
+{"key"="84";"subkey"="2";"value"="Value #56"};
+{"key"="85";"subkey"="2";"value"="Value #10"};
+{"key"="86";"subkey"="6";"value"="Value #16"};
+{"key"="87";"subkey"="15";"value"="Value #14"};
+{"key"="88";"subkey"="16";"value"="Value #35"};
+{"key"="89";"subkey"="4";"value"="Value #1"};
+{"key"="8";"subkey"="16";"value"="Value #35"};
+{"key"="90";"subkey"="4";"value"="Value #22"};
+{"key"="91";"subkey"="13";"value"="Value #25"};
+{"key"="92";"subkey"="0";"value"="Value #42"};
+{"key"="93";"subkey"="9";"value"="Value #20"};
+{"key"="94";"subkey"="10";"value"="Value #59"};
+{"key"="95";"subkey"="1";"value"="Value #34"};
+{"key"="96";"subkey"="12";"value"="Value #57"};
+{"key"="97";"subkey"="11";"value"="Value #19"};
+{"key"="98";"subkey"="9";"value"="Value #20"};
+{"key"="99";"subkey"="11";"value"="Value #58"};
+{"key"="9";"subkey"="0";"value"="Value #42"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input1.txt b/yql/essentials/tests/sql/suites/optimizers/input1.txt
new file mode 100644
index 0000000000..bd567557a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input1.txt
@@ -0,0 +1,19 @@
+{"Amount"=100;"Comment"="Test1";"Group"=1u;"Name"="Name1"};
+{"Amount"=101;"Comment"="Test1";"Group"=1u;"Name"="Name2"};
+{"Amount"=102;"Comment"="Test1";"Group"=1u;"Name"="Name3"};
+{"Amount"=103;"Comment"="Test1";"Group"=2u;"Name"="Name1"};
+{"Amount"=104;"Comment"="Test1";"Group"=3u;"Name"="Name3"};
+{"Amount"=105;"Comment"="Test1";"Group"=4u;"Name"="Name1"};
+{"Amount"=106;"Comment"="Test1";"Group"=4u;"Name"="Name4"};
+{"Amount"=107;"Comment"="Test1";"Group"=5u;"Name"="Name5"};
+{"Amount"=108;"Comment"="Test1";"Group"=6u;"Name"="Name1"};
+{"Amount"=109;"Comment"="Test1";"Group"=6u;"Name"="Name2"};
+{"Amount"=100;"Comment"="Test3";"Group"=10u;"Name"="Name1"};
+{"Amount"=101;"Comment"="Test3";"Group"=10u;"Name"="Name2"};
+{"Amount"=102;"Comment"="Test3";"Group"=10u;"Name"="Name3"};
+{"Amount"=103;"Comment"="Test3";"Group"=10u;"Name"="Name4"};
+{"Amount"=104;"Comment"="Test3";"Group"=10u;"Name"="Name5"};
+{"Amount"=105;"Comment"="Test3";"Group"=10u;"Name"="Name6"};
+{"Amount"=100;"Comment"="Test2";"Group"=100001u;"Name"="Name1"};
+{"Amount"=102;"Comment"="Test2";"Group"=100002u;"Name"="Name2"};
+{"Amount"=103;"Comment"="Test2";"Group"=100003u;"Name"="Name1"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input1.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input1.txt.attr
new file mode 100644
index 0000000000..ffb9a19cab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input1.txt.attr
@@ -0,0 +1,42 @@
+{
+ "_yql_row_spec" = {
+ "UniqueKeys"=%true;
+ "SortMembers"=["Group"; "Name"];
+ "SortedBy"=["Group"; "Name"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"Uint64"]; ["DataType";"String"]];
+ "Type" = [
+ "StructType";
+ [
+ [
+ "Group";
+ [
+ "DataType";
+ "Uint64"
+ ]
+ ];
+ [
+ "Name";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "Amount";
+ [
+ "DataType";
+ "Int64"
+ ]
+ ];
+ [
+ "Comment";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/input2.txt b/yql/essentials/tests/sql/suites/optimizers/input2.txt
new file mode 100644
index 0000000000..375a3143fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input2.txt
@@ -0,0 +1,4 @@
+{"key"="023,023";"subkey"="3,1";"value"="aaa"};
+{"key"="037,037";"subkey"="5,4";"value"="ddd"};
+{"key"="075,075,150";"subkey"="1,5";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input3.txt b/yql/essentials/tests/sql/suites/optimizers/input3.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input3.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input3.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input3.txt.attr
new file mode 100644
index 0000000000..b6100e5fd0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input3.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/input4.txt b/yql/essentials/tests/sql/suites/optimizers/input4.txt
new file mode 100644
index 0000000000..2c605925c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input4.txt
@@ -0,0 +1,4 @@
+{"key"="023";"info"="3"};
+{"key"="037";"info"="5"};
+{"key"="075";"info"="1"};
+{"key"="150";"info"="1"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input4.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input4.txt.attr
new file mode 100644
index 0000000000..9678beab02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input4.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["info";["DataType";"String"]];
+ ]];
+ "SortDirections"=[1;];
+ "SortedBy"=["key"];
+ "SortedByTypes"=[["DataType";"String";]];
+ "SortMembers"=["key"];
+}}
diff --git a/yql/essentials/tests/sql/suites/optimizers/input5.txt b/yql/essentials/tests/sql/suites/optimizers/input5.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input5.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input5.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input5.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input5.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/optimizers/input_other.txt b/yql/essentials/tests/sql/suites/optimizers/input_other.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input_other.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input_other.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input_other.txt.attr
new file mode 100644
index 0000000000..9d84682ce5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input_other.txt.attr
@@ -0,0 +1,8 @@
+{
+ "_read_schema" =
+ <"strict" = "false";>
+ [
+ {"name"="key"; "type"="string"};
+ {"name"="subkey"; "type"="string"};
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/optimizers/input_tutorial_users.txt b/yql/essentials/tests/sql/suites/optimizers/input_tutorial_users.txt
new file mode 100644
index 0000000000..4a18a0dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input_tutorial_users.txt
@@ -0,0 +1,12 @@
+{"key"="15";"subkey"="213";"value"="Anya"};
+{"key"="25";"subkey"="225";"value"="Petr"};
+{"key"="17";"subkey"="1";"value"="Masha"};
+{"key"="5";"subkey"="225";"value"="Alena"};
+{"key"="23";"subkey"="2";"value"="Irina"};
+{"key"="13";"subkey"="21";"value"="Inna"};
+{"key"="33";"subkey"="125";"value"="Ivan"};
+{"key"="45";"subkey"="225";"value"="Asya"};
+{"key"="27";"subkey"="125";"value"="German"};
+{"key"="41";"subkey"="225";"value"="Olya"};
+{"key"="35";"subkey"="2";"value"="Slava"};
+{"key"="56";"subkey"="2";"value"="Elena"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/input_view.txt b/yql/essentials/tests/sql/suites/optimizers/input_view.txt
new file mode 100644
index 0000000000..962496f023
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input_view.txt
@@ -0,0 +1,21 @@
+$p = @@
+def Parse(s):
+ return {'subkey': s, 'value': s}
+@@;
+
+$pv = Python::Parse(Callable<(String)->Struct<subkey: String, value: String>>, $p);
+
+$i = (
+ select
+ AsStruct(key as key),
+ $pv(info) as info
+ from ViewSource
+ where info != ""
+);
+
+$j = (
+ select *
+ from $i flatten columns
+);
+
+select * from $j
diff --git a/yql/essentials/tests/sql/suites/optimizers/input_view.txt.attr b/yql/essentials/tests/sql/suites/optimizers/input_view.txt.attr
new file mode 100644
index 0000000000..41ea51e276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/input_view.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_yql_type"="view";
+ "type"="document";
+}
diff --git a/yql/essentials/tests/sql/suites/optimizers/instant_contains_lookup.sql b/yql/essentials/tests/sql/suites/optimizers/instant_contains_lookup.sql
new file mode 100644
index 0000000000..0b74075205
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/instant_contains_lookup.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT ListHas([1,2,3], 2), DictContains({4:5,6:7,8:9}, 6), DictLookup({4:5,6:7,8:9}, 8);
diff --git a/yql/essentials/tests/sql/suites/optimizers/length_over_merge.cfg b/yql/essentials/tests/sql/suites/optimizers/length_over_merge.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/length_over_merge.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/length_over_merge.sql b/yql/essentials/tests/sql/suites/optimizers/length_over_merge.sql
new file mode 100644
index 0000000000..b102fdee47
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/length_over_merge.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+use plato;
+
+$input = (select key, key || subkey as subkey, value from Input);
+
+$total_count = (select count(1) from $input);
+
+$filtered = (select * from $input where key in ("023", "037", "075"));
+
+$filtered_cnt = (select count(1) from $filtered);
+
+select $filtered_cnt / cast($total_count as Double) as cnt;
diff --git a/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.cfg b/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.sql b/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.sql
new file mode 100644
index 0000000000..ff060f1ab3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/length_over_merge_fs_multiusage.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+pragma config.flags("OptimizerFlags", "FieldSubsetEnableMultiusage");
+
+use plato;
+
+$input = (select key, key || subkey as subkey, value from Input);
+
+$total_count = (select count(1) from $input);
+
+$filtered = (select * from $input where key in ("023", "037", "075"));
+
+$filtered_cnt = (select count(1) from $filtered);
+
+select $filtered_cnt / cast($total_count as Double) as cnt;
diff --git a/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.cfg b/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.sql b/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.sql
new file mode 100644
index 0000000000..d66d589ab8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/multi_to_empty_constraint.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+
+USE plato;
+
+select key, some(subkey) from (select * from Input where key > "010" and value in []) group by key
+union all
+select key, some(subkey) from (select * from Input where key > "020" and value in []) group by key
+;
diff --git a/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.cfg b/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.cfg
new file mode 100644
index 0000000000..a6e1f32b6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.cfg
@@ -0,0 +1,3 @@
+in Input1 input3.txt
+in Input2 input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.sql b/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.sql
new file mode 100644
index 0000000000..c0e6c1c34a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/nonselected_direct_row.sql
@@ -0,0 +1,8 @@
+use plato;
+
+select key, subkey, value
+from (
+ select TablePath() as tbl, key, subkey, value
+ from concat(Input1, Input2)
+)
+where tbl = "Input" and value != "";
diff --git a/yql/essentials/tests/sql/suites/optimizers/opt_key.txt b/yql/essentials/tests/sql/suites/optimizers/opt_key.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/opt_key.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/opt_key.txt.attr b/yql/essentials/tests/sql/suites/optimizers/opt_key.txt.attr
new file mode 100644
index 0000000000..72a3e1401c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/opt_key.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";[OptionalType;["DataType";"String"]]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/optimizers/or_absorption.cfg b/yql/essentials/tests/sql/suites/optimizers/or_absorption.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/or_absorption.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/or_absorption.sql b/yql/essentials/tests/sql/suites/optimizers/or_absorption.sql
new file mode 100644
index 0000000000..cbd7ba2db2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/or_absorption.sql
@@ -0,0 +1,8 @@
+pragma config.flags("OptimizerFlags", "ExtractCommonPredicatesFromLogicalOps");
+
+$a = 1 > 2;
+$b = 3 < 4;
+$c = 5 < 6;
+
+select ($a and $b or $b) == $b;
+select ($c and ($b or $a) or $a or $b) == ($a or $b)
diff --git a/yql/essentials/tests/sql/suites/optimizers/or_distributive.cfg b/yql/essentials/tests/sql/suites/optimizers/or_distributive.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/or_distributive.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/or_distributive.sql b/yql/essentials/tests/sql/suites/optimizers/or_distributive.sql
new file mode 100644
index 0000000000..a44d871c85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/or_distributive.sql
@@ -0,0 +1,14 @@
+pragma config.flags("OptimizerFlags", "ExtractCommonPredicatesFromLogicalOps");
+
+$a = 1 > 2;
+$b = 3 < 4;
+$c = 5 < 6;
+$d = 7 > 8;
+$e = 9 < 10;
+$f = 11 > 12;
+
+
+select (($a and $b) or ($b and $c)) == ($b and ($a or $c));
+select (($a and $b) or ($d and $e) or ($b and $c) or ($e and $f)) ==
+ ($b and ($a or $c) or $e and ($d or $f));
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/passthrough_sortness_over_map.sql b/yql/essentials/tests/sql/suites/optimizers/passthrough_sortness_over_map.sql
new file mode 100644
index 0000000000..0c6b58a563
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/passthrough_sortness_over_map.sql
@@ -0,0 +1,31 @@
+/* postgres can not */
+/* kikimr can not - anon tables */
+USE plato;
+
+INSERT INTO @a
+SELECT
+ *
+FROM Input0
+ORDER BY key, subkey;
+
+commit;
+
+INSERT INTO @c
+SELECT * FROM @a
+WHERE key < "100"
+ORDER BY key, subkey;
+
+INSERT INTO @d
+SELECT
+ key as key,
+ "" as subkey,
+ "value:" || value as value
+FROM @a
+WHERE key < "100"
+ORDER BY key;
+
+commit;
+
+select * from @c;
+
+select * from @d;
diff --git a/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.cfg b/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.cfg
new file mode 100644
index 0000000000..f3472752d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.cfg
@@ -0,0 +1,3 @@
+in Input input5.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.sql b/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.sql
new file mode 100644
index 0000000000..b3469e9a3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/pushdown_nonsep_over_aggregate.sql
@@ -0,0 +1,12 @@
+USE plato;
+
+pragma config.flags("OptimizerFlags", "PushdownComplexFiltersOverAggregate");
+
+SELECT * FROM (
+ SELECT
+ key as key,
+ min(value) as mv
+ FROM Input
+ GROUP BY key
+)
+WHERE AssumeNonStrict(200 > 100) and (2000 > 1000) and key != "911" and (key < "150" and mv != "ddd" or key > "200");
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.cfg b/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.cfg
new file mode 100644
index 0000000000..95d7627826
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.cfg
@@ -0,0 +1,3 @@
+in Input input0.txt
+providers yt
+xfail
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.sql b/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.sql
new file mode 100644
index 0000000000..47abbabbd6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_by_nonstrict_const.sql
@@ -0,0 +1,4 @@
+/* yt can not */
+use plato;
+
+select * from Input order by date, double;
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.cfg b/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.sql b/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.sql
new file mode 100644
index 0000000000..e1262ecbeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_constraint_in_left.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+
+USE plato;
+
+$input_table = (SELECT * FROM Input);
+
+SELECT * FROM (
+ SELECT 'total' AS key,
+ COUNT(*) AS count
+ FROM $input_table
+ WHERE key != "1"
+ UNION ALL
+ SELECT key,
+ COUNT(*) AS count
+ FROM $input_table
+ WHERE key != "1"
+ GROUP BY key
+)
+ORDER BY key, count;
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_prefix_keys.sql b/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_prefix_keys.sql
new file mode 100644
index 0000000000..6a1e4d9aab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_prefix_keys.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not - anon tables */
+USE plato;
+
+insert into @a
+SELECT
+ *
+FROM Input0
+ORDER BY key ASC, subkey ASC;
+
+commit;
+
+select * from @a
+ORDER BY key ASC;
diff --git a/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_same_keys.sql b/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_same_keys.sql
new file mode 100644
index 0000000000..d744ef5418
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sort_over_sorted_same_keys.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not - anon tables */
+USE plato;
+
+insert into @a
+SELECT
+ *
+FROM Input0
+ORDER BY key ASC, subkey ASC;
+
+commit;
+
+select * from @a
+ORDER BY key ASC, subkey ASC;
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted.txt b/yql/essentials/tests/sql/suites/optimizers/sorted.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted.txt.attr b/yql/essentials/tests/sql/suites/optimizers/sorted.txt.attr
new file mode 100644
index 0000000000..36f279e4a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]]
+ ];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt b/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt
new file mode 100644
index 0000000000..235fc7cd49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt
@@ -0,0 +1,10 @@
+{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"};
+{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"};
+{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"};
+{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt.attr
new file mode 100644
index 0000000000..5a6ca5761e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_desc.txt.attr
@@ -0,0 +1,47 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.cfg b/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.cfg
new file mode 100644
index 0000000000..ac3bc7d1d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.cfg
@@ -0,0 +1,3 @@
+in Input sorted.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.sql b/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.sql
new file mode 100644
index 0000000000..df6d3131d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_scalar_content.sql
@@ -0,0 +1,13 @@
+use plato;
+
+$ou = select * from Input;
+
+$a = select key from $ou where key > '0';
+
+insert into @a
+select * from $a order by key;
+
+select * from $ou
+where subkey > "0"
+ and key != $a
+order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.cfg b/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.cfg
new file mode 100644
index 0000000000..ac3bc7d1d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.cfg
@@ -0,0 +1,3 @@
+in Input sorted.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.sql b/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.sql
new file mode 100644
index 0000000000..c0debae4be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/sorted_sql_in.sql
@@ -0,0 +1,13 @@
+use plato;
+
+$ou = select * from Input;
+
+$a = select * from $ou where key > '0';
+
+insert into @a
+select * from $a order by key;
+
+select * from $ou
+where subkey > "0"
+ and key not in compact (select key from $a)
+order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_predicate_limit.sql b/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_predicate_limit.sql
new file mode 100644
index 0000000000..f7a96e9e48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_predicate_limit.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+
+$data = (
+ SELECT key AS Key, YQL::Substring(key, 1, 1) AS Category FROM plato.Input0 WHERE length(key) > 2 LIMIT 20
+);
+
+SELECT
+ Category,
+ COUNT(*)
+FROM $data
+GROUP BY Category
+ORDER BY Category ASC; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_take.sql b/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_take.sql
new file mode 100644
index 0000000000..eeb0cfcf24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_fuse_map_take.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+$data = (
+ SELECT key AS Name, value AS Value FROM plato.Input0
+);
+
+$filtered = (
+ SELECT * FROM $data WHERE Name != "BadName" LIMIT 10
+);
+
+SELECT Name, Avg(Length(Value)) AS Len FROM $filtered GROUP BY Name ORDER BY Name;
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.cfg b/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.cfg
new file mode 100644
index 0000000000..1aff987614
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.cfg
@@ -0,0 +1,5 @@
+in Input0 input0.txt
+udf streaming_udf
+udf python2_udf
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.sql b/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.sql
new file mode 100644
index 0000000000..90c0f8a2a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_lmap_opts.sql
@@ -0,0 +1,47 @@
+/* syntax version 1 */
+-- not supported on windows
+/* postgres can not */
+$udfScript = @@
+
+import collections;
+
+def processRows(prefix, rowList, separator):
+ ResultRow = collections.namedtuple("ResultRow", ["Result"]);
+
+ result = [];
+ for row in rowList:
+ resultValue = prefix + row.Name + separator + row.Value;
+ resultItem = ResultRow(Result=resultValue);
+ result.append(resultItem);
+
+ return result;
+@@;
+
+$udf = Python::processRows(
+ Callable<(String, List<Struct<Name:String, Value:String>>, String)->List<Struct<Result:String>>>,
+ $udfScript
+);
+
+$data = (
+ SELECT key AS Name, value AS Value FROM plato.Input0
+);
+
+$prefix = ">>";
+
+$p1 = (
+ PROCESS $data USING $udf($prefix, TableRows(), "=") WHERE Name != "foo"
+);
+
+$p2 = (
+ SELECT Result AS Data FROM $p1
+);
+
+$p3 = (
+ PROCESS $p2 USING Streaming::Process(TableRows(), "grep", AsList("180"))
+);
+
+$p4 = (
+ SELECT Data AS FinalResult FROM $p3
+);
+
+SELECT Avg(Length(FinalResult)) AS AvgResultLength FROM $p4;
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.cfg b/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.cfg
new file mode 100644
index 0000000000..8ca23afed0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.cfg
@@ -0,0 +1,2 @@
+in Input1 input1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.sql b/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.sql
new file mode 100644
index 0000000000..a5baec070e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/test_no_aggregate_split.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+
+$aggregated = (
+ SELECT Group, Name, SUM(Amount) AS TotalAmount
+ FROM plato.Input1
+ GROUP BY Group, Name
+);
+
+SELECT t.Comment, a.TotalAmount
+FROM plato.Input1 AS t
+INNER JOIN $aggregated AS a
+ON t.Group == a.Group AND t.Name == a.Name
+ORDER BY t.Comment, a.TotalAmount;
+
+SELECT TotalAmount FROM $aggregated ORDER BY TotalAmount;
diff --git a/yql/essentials/tests/sql/suites/optimizers/total_order.sql b/yql/essentials/tests/sql/suites/optimizers/total_order.sql
new file mode 100644
index 0000000000..c9b185a101
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/total_order.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+$x = AsTuple(Double("nan"),42);
+
+select $x = $x;
+select $x < $x;
+select $x <= $x;
+select $x > $x;
+select $x >= $x;
+select $x != $x;
+
+$x = AsStruct(Double("nan") as a,42 as b);
+select $x = $x;
+select $x != $x;
+
+$x = AsTuple(Nothing(ParseType("Int32?")), 1);
+select $x = $x;
+select $x < $x;
+select $x <= $x;
+select $x > $x;
+select $x >= $x;
+select $x != $x;
+
+$x = Nothing(ParseType("Int32?"));
+select $x = $x;
+select $x < $x;
+select $x <= $x;
+select $x > $x;
+select $x >= $x;
+select $x != $x;
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.cfg b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.cfg
new file mode 100644
index 0000000000..93653023e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.cfg
@@ -0,0 +1,2 @@
+in Input unused_columns_window.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.sql b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.sql
new file mode 100644
index 0000000000..0fb9467dc7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+select a,bb from (
+select a,count(distinct b) as bb,max(c) as cc,median(c) as cc1,percentile(c,0.8) as cc2 from (
+select a,b,cast(c as int32) as c,d from Input
+)
+group by a
+)
+order by a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.cfg b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.cfg
new file mode 100644
index 0000000000..2b2bac89e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.cfg
@@ -0,0 +1,3 @@
+in Input unused_columns_window.txt
+udf stat_udf
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.sql b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.sql
new file mode 100644
index 0000000000..eac1ef2643
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_group_one_of_multi.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+select a,cc1 from (
+select a,count(distinct b) as bb,max(c) as cc,median(c) as cc1,percentile(c,0.8) as cc2 from (
+select a,b,cast(c as int32) as c,d from Input
+)
+group by a
+)
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.cfg b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.cfg
new file mode 100644
index 0000000000..93653023e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.cfg
@@ -0,0 +1,2 @@
+in Input unused_columns_window.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.sql b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.sql
new file mode 100644
index 0000000000..ee5e54df18
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT
+ a,
+ lag(a) over w as prev_a,
+ min(a) over w as min_a
+FROM Input
+WINDOW w AS (PARTITION BY b ORDER by c)
+ORDER BY a;
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt
new file mode 100644
index 0000000000..15c7031586
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt
@@ -0,0 +1,4 @@
+{"a"="1";"b"="2";"c"="1";"d"="5"};
+{"a"="2";"b"="2";"c"="2";"d"="6"};
+{"a"="3";"b"="3";"c"="1";"d"="7"};
+{"a"="4";"b"="3";"c"="2";"d"="8"};
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt.attr b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt.attr
new file mode 100644
index 0000000000..2b156c3232
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"String"]];
+ ["b";["DataType";"String"]];
+ ["c";["DataType";"String"]];
+ ["d";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.cfg b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.cfg
new file mode 100644
index 0000000000..93653023e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.cfg
@@ -0,0 +1,2 @@
+in Input unused_columns_window.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.sql b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.sql
new file mode 100644
index 0000000000..65c7a1bf64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/unused_columns_window_no_payloads.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+select b from (
+SELECT
+ b,
+ lag(a) over w as prev_a
+FROM Input
+WINDOW w AS (PARTITION BY b ORDER by c)
+)
diff --git a/yql/essentials/tests/sql/suites/optimizers/wide_if_present_over_double_just.sql b/yql/essentials/tests/sql/suites/optimizers/wide_if_present_over_double_just.sql
new file mode 100644
index 0000000000..d8da491aa4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/wide_if_present_over_double_just.sql
@@ -0,0 +1 @@
+select ListFromRange(Date("2022-01-01"), Just(Date("2022-03-01")), Interval("P1D") * 2U);
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_flow_fuse_depends_on.sql b/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_flow_fuse_depends_on.sql
new file mode 100644
index 0000000000..a828dc1cff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_flow_fuse_depends_on.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+select RandomNumber(a) as first, RandomNumber(b) as second from (
+ select key as a, key as b from Input0
+) order by first, second;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_fuse_depends_on.sql b/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_fuse_depends_on.sql
new file mode 100644
index 0000000000..421ded4a1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-10042_disable_fuse_depends_on.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+$data = AsList((1 as a, 1 as b));
+select RandomNumber(a), RandomNumber(b) from AS_TABLE($data);
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-10070_extract_members_over_calcoverwindow.sql b/yql/essentials/tests/sql/suites/optimizers/yql-10070_extract_members_over_calcoverwindow.sql
new file mode 100644
index 0000000000..9b0e18cc0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-10070_extract_members_over_calcoverwindow.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+USE plato;
+
+INSERT INTO @source
+SELECT Date('2019-03-04') AS `Date`,
+ 1l AS `Permalink`,
+ 1l AS `ClusterPermalink`,
+ False AS `IsHead`,
+ False AS `WasHead`,
+ 23 as dummy1;
+COMMIT;
+
+SELECT
+ IF(
+ NOT `WasHead` AND NOT `IsHead`,
+ aggregate_list(AsStruct(`Permalink` AS `Permalink`, `Date` AS `Date`, `ClusterPermalink` AS ClusterPermalink)) OVER `w`
+ ) AS `Occurence`
+FROM
+ @source
+WINDOW `w` AS (
+ PARTITION BY `Permalink`
+ ORDER BY `Date`
+)
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-10074_dont_inline_lists_depends_on.sql b/yql/essentials/tests/sql/suites/optimizers/yql-10074_dont_inline_lists_depends_on.sql
new file mode 100644
index 0000000000..7a1dd02e70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-10074_dont_inline_lists_depends_on.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT a, b, c, RandomNumber(a) AS r FROM (
+ SELECT 1 AS a, 2 AS b, 3 AS c
+ UNION ALL
+ SELECT 1 AS a, 2 AS b, 3 AS c
+);
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-10737_lost_passthrough.sql b/yql/essentials/tests/sql/suites/optimizers/yql-10737_lost_passthrough.sql
new file mode 100644
index 0000000000..92271a89b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-10737_lost_passthrough.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+/* kikimr can not - table truncate */
+USE plato;
+
+insert into @a
+select "1" as Text, ["a", "b"] as Attachments;
+
+commit;
+
+SELECT x.*, "" AS Text, ListCreate(TypeOf(Attachments)) AS Attachments
+WITHOUT x.Text, x.Attachments
+FROM @a AS x
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.cfg
new file mode 100644
index 0000000000..a3de89f626
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.cfg
@@ -0,0 +1,4 @@
+in Input sorted.txt
+res result.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.sql b/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.sql
new file mode 100644
index 0000000000..d76011161b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-11171_unordered_over_sorted_fill.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+
+USE plato;
+select
+ key,
+ some(value)
+from (
+ select
+ key,
+ TableName() as value
+ from Input with inline
+ union all
+ select
+ key,
+ value
+ from Input
+)
+group compact by key;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.sql b/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.sql
new file mode 100644
index 0000000000..cae154861d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-12620_stage_multiuse.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$a=select * from Input;
+select count(*) from $a;
+select count(*) from $a where key != '075';
+select * from $a where key != '075'; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.cfg
new file mode 100644
index 0000000000..745508f188
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.cfg
@@ -0,0 +1,4 @@
+in Input1 sorted.txt
+in Input2 sorted.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.sql b/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.sql
new file mode 100644
index 0000000000..3cdbaeb766
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-14279_keyextract_with_world_dep.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+use plato;
+
+$input = select * from range("", "Input1", "Input2");
+
+$key = select min(key) from $input;
+
+select key, subkey, value
+from $input
+where subkey > '1' and key > $key
+order by key
+;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.cfg
new file mode 100644
index 0000000000..0df3369260
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.cfg
@@ -0,0 +1,3 @@
+res result.txt
+providers yt
+udf unicode_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.sql b/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.sql
new file mode 100644
index 0000000000..1302d6dde0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-14581_fuseflatmaps_with_external_lambda.sql
@@ -0,0 +1,28 @@
+/* postgres can not */
+USE plato;
+
+$improve_low = ($val) -> {
+ RETURN CAST($val AS Utf8);
+};
+
+$names_intersection = ($org_names, $db_names) -> {
+ RETURN ListLength(
+ ListFlatten(
+ ListMap(
+ $org_names,
+ ($org_name) -> {
+ RETURN ListFilter(
+ $db_names,
+ ($db_name) -> {
+ $org_name = $improve_low($org_name);
+ $db_name = $improve_low($db_name);
+ RETURN Unicode::LevensteinDistance($org_name, $db_name) < 0.2 * Unicode::GetLength($org_name);
+ }
+ );
+ }
+ )
+ )
+ ) > 0;
+};
+
+select $names_intersection(['1', '2'], ['nets'])
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.cfg
new file mode 100644
index 0000000000..7492954c20
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.cfg
@@ -0,0 +1,3 @@
+in Input input3.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.sql b/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.sql
new file mode 100644
index 0000000000..7054019fb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-15210_sqlin.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$max = select max(key) from Input;
+$list = select key from Input where subkey > "1";
+
+select * from (
+ select if(key = $max, "max", key) as key, value from Input
+)
+where key in compact $list \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-16134.sql b/yql/essentials/tests/sql/suites/optimizers/yql-16134.sql
new file mode 100644
index 0000000000..8eeb54afe9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-16134.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select Just(Just(true)) = true, Just(false) != Just(Just(false)) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.cfg
new file mode 100644
index 0000000000..c85115a8e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.sql b/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.sql
new file mode 100644
index 0000000000..646b84b1dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-17413-topsort.sql
@@ -0,0 +1,10 @@
+-- ignore runonopt plan diff
+USE plato;
+
+$filtered = select * from Input where value != "xxx";
+
+select distinct(subkey) as subkey
+from (select * from $filtered order by key desc limit 3)
+order by subkey;
+
+select sum(cast(subkey as int32)) as c from $filtered;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.sql b/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.sql
new file mode 100644
index 0000000000..10cae73c84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-17715_concat_sort_desc.sql
@@ -0,0 +1,43 @@
+use plato;
+
+$min_ts_for_stat_calculation = DateTime::ToSeconds(CurrentUtcDate() - Interval("P1D"));
+
+insert into @a
+select * from (
+ select 1ul as puid, CurrentUtcTimestamp() as timestamp, [1, 2] as segments, "a" as dummy1
+)
+assume order by puid, timestamp desc;
+
+insert into @b
+select * from (
+ select 4ul as puid, CurrentUtcTimestamp() as timestamp, [3, 2] as segments, "a" as dummy1
+)
+assume order by puid, timestamp desc;
+
+insert into @c
+select * from (
+ select 2ul as puid, Just(CurrentUtcTimestamp()) as timestamp, [2, 3] as segments, "a" as dummy2
+)
+assume order by puid, timestamp desc;
+
+commit;
+
+$target_events = (
+ SELECT
+ puid,
+ segments
+ FROM CONCAT(@a, @b, @c)
+ where DateTime::ToSeconds(`timestamp`) > $min_ts_for_stat_calculation
+);
+
+$target_events = (
+ SELECT DISTINCT *
+ FROM (
+ SELECT *
+ FROM $target_events
+ FLATTEN LIST BY segments
+ )
+ FLATTEN COLUMNS
+);
+
+SELECT * FROM $target_events ORDER BY puid, segments;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-18300-flatmap-over-extend.sql b/yql/essentials/tests/sql/suites/optimizers/yql-18300-flatmap-over-extend.sql
new file mode 100644
index 0000000000..7bd19b7bee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-18300-flatmap-over-extend.sql
@@ -0,0 +1,19 @@
+USE plato;
+
+insert into @tmp with truncate
+select "dummy" as a, "1" as b, ["b", "s"] as data
+order by a;
+
+commit;
+
+
+SELECT a, id
+FROM (
+ SELECT
+ a,
+ ListExtend(
+ [String::AsciiToLower(b)],
+ ListMap(data, String::AsciiToLower)
+ ) AS joins
+ FROM @tmp
+) FLATTEN LIST BY joins AS id;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-18408_filter_multiusage_pushdown.sql b/yql/essentials/tests/sql/suites/optimizers/yql-18408_filter_multiusage_pushdown.sql
new file mode 100644
index 0000000000..ad3afa8596
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-18408_filter_multiusage_pushdown.sql
@@ -0,0 +1,84 @@
+use plato;
+pragma AnsiOptionalAs;
+pragma config.flags("OptimizerFlags",
+ "FieldSubsetEnableMultiusage",
+ "FilterPushdownEnableMultiusage",
+ "EarlyExpandSkipNull");
+
+
+$date_dim = select * from as_table([
+ <|d_year:Just(1999), d_date_sk:Just(10001)|>,
+ <|d_year:Just(1999), d_date_sk:Just(10002)|>,
+ <|d_year:Just(1999), d_date_sk:Just(10003)|>,
+ <|d_year:Just(2000), d_date_sk:Just(10001)|>,
+ <|d_year:Just(2000), d_date_sk:Just(10002)|>,
+ <|d_year:Just(2000), d_date_sk:Just(10003)|>,
+]);
+
+$customer = select * from as_table([
+ <|c_customer_sk:Just(1), c_customer_id:Just(1), c_first_name:Just("Vasya"), c_last_name:Just("Ivanov"), c_preferred_cust_flag:Just("aaa"), c_birth_country:Just("RU"), c_login:Just("ivanov"), c_email_address:Just("foo@bar.com")|>,
+ <|c_customer_sk:Just(2), c_customer_id:Just(2), c_first_name:Just("Petya"), c_last_name:Just("Ivanov"), c_preferred_cust_flag:Just("bbb"), c_birth_country:Just("RU"), c_login:Just("ivanov1"), c_email_address:Just("foo1@bar.com")|>,
+ <|c_customer_sk:Just(3), c_customer_id:null, c_first_name:null, c_last_name:null, c_preferred_cust_flag:null, c_birth_country:null, c_login:Just("ivanov1"), c_email_address:Just("foo2@bar.com")|>,
+]);
+
+$store_sales = select * from as_table([
+ <|ss_sold_date_sk:Just(10001), ss_customer_sk:Just(1), ss_ext_list_price:Just(12345), ss_ext_discount_amt:Just(1234)|>,
+ <|ss_sold_date_sk:Just(10002), ss_customer_sk:Just(2), ss_ext_list_price:Just(12346), ss_ext_discount_amt:Just(123)|>,
+ <|ss_sold_date_sk:Just(10003), ss_customer_sk:Just(3), ss_ext_list_price:Just(12347), ss_ext_discount_amt:Just(1235)|>,
+]);
+
+insert into @date_dim
+select * from $date_dim;
+
+insert into @customer
+select * from $customer;
+
+insert into @store_sales
+select * from $store_sales;
+
+commit;
+
+
+$year_total = (
+ select customer.c_customer_id customer_id
+ ,customer.c_first_name customer_first_name
+ ,customer.c_last_name customer_last_name
+ ,customer.c_preferred_cust_flag customer_preferred_cust_flag
+ ,customer.c_birth_country customer_birth_country
+ ,customer.c_login customer_login
+ ,customer.c_email_address customer_email_address
+ ,date_dim.d_year dyear
+ ,sum(ss_ext_list_price-ss_ext_discount_amt) year_total
+ ,'s' sale_type
+ from @date_dim date_dim
+ cross join @store_sales store_sales
+ cross join @customer customer
+ where ss_sold_date_sk = d_date_sk and c_customer_sk = ss_customer_sk
+ group by customer.c_customer_id
+ ,customer.c_first_name
+ ,customer.c_last_name
+ ,customer.c_preferred_cust_flag
+ ,customer.c_birth_country
+ ,customer.c_login
+ ,customer.c_email_address
+ ,date_dim.d_year
+ );
+
+
+ select
+ t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_birth_country
+ from $year_total t_s_firstyear
+ cross join $year_total t_s_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+ and t_s_firstyear.sale_type = 's'
+ and t_s_secyear.sale_type = 's'
+ and t_s_firstyear.dyear = 1999
+ and t_s_secyear.dyear = 1999+1
+ order by t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_birth_country
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.sql b/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.sql
new file mode 100644
index 0000000000..56f9ddfde9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-18733_no_filter_multiusage_pushdown.sql
@@ -0,0 +1,6 @@
+pragma config.flags("OptimizerFlags", "FilterPushdownEnableMultiusage");
+USE plato;
+
+$src = select distinct key from Input where value = 'ddd';
+
+select * from Input where key = $src;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.cfg
new file mode 100644
index 0000000000..208adc1e38
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.cfg
@@ -0,0 +1,4 @@
+in Input input_tutorial_users.txt
+res result.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.sql b/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.sql
new file mode 100644
index 0000000000..0cce1f9889
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2171_aggregate_desc_sort_and_extract.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+$top_users_by_age_dec = (SELECT
+ age_dec,
+ COUNT(1) as age_dec_count
+FROM $data
+GROUP BY age / 10 as age_dec
+ORDER BY age_dec_count DESC
+LIMIT 2);
+
+--INSERT INTO Output
+SELECT age_dec, info.* FROM $top_users_by_age_dec AS top JOIN $data AS info ON top.age_dec = info.age / 10 ORDER BY name;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.cfg
new file mode 100644
index 0000000000..a6e1f32b6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.cfg
@@ -0,0 +1,3 @@
+in Input1 input3.txt
+in Input2 input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.sql b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.sql
new file mode 100644
index 0000000000..8887d13fcd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$data = (SELECT * FROM Input1 WHERE key < "700" LIMIT 10);
+
+SELECT * FROM $data LIMIT 100;
+
+SELECT a.key AS key, b.subkey AS subkey, b.value AS value
+FROM $data AS a
+INNER JOIN Input2 AS b ON a.key = b.key
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.cfg
new file mode 100644
index 0000000000..fd0ec5927e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.cfg
@@ -0,0 +1,3 @@
+in Input1 input_other.txt
+in Input2 input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.sql b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.sql
new file mode 100644
index 0000000000..a7c735a9ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-2582_limit_for_join_input_other.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$data = (SELECT * FROM Input1 LIMIT 10);
+
+SELECT key, subkey, _other["value"] FROM $data LIMIT 100;
+
+SELECT a.key AS key, b.subkey AS subkey, b.value AS value
+FROM $data AS a
+INNER JOIN Input2 AS b ON a.key = b.key
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.sql b/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.sql
new file mode 100644
index 0000000000..99d000cfa0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-3455_filter_sorted.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ subkey
+FROM Input
+WHERE subkey < "100";
+
+SELECT
+ value
+FROM Input
+LIMIT 3;
+
+SELECT
+ key
+FROM
+ (SELECT * FROM Input ORDER BY -CAST(subkey as Int32) LIMIT 5)
+;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-4240-aggregate_whole_struct.sql b/yql/essentials/tests/sql/suites/optimizers/yql-4240-aggregate_whole_struct.sql
new file mode 100644
index 0000000000..bf646532d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-4240-aggregate_whole_struct.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+use plato;
+
+$data = (select value as attr, key as urlBase, cast(subkey as int32) as dupsCount from Input0);
+
+ SELECT
+ urlBase,
+ SUM(dupsCount) as allDocs,
+ MAX_BY(AsStruct(dupsCount as dupsCount, attr as attr), dupsCount) as best
+ FROM (
+ SELECT urlBase, attr, count(*) as dupsCount
+ FROM $data
+ GROUP BY urlBase, attr
+ )
+ GROUP BY urlBase
+ ORDER BY urlBase
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.sql b/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.sql
new file mode 100644
index 0000000000..4ca893b99b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-5833-table_content.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+use plato;
+
+$max_key = (
+select
+max(key)
+from Input
+);
+
+select
+cast(count(*) as String) || ' (' || cast($max_key as String) ||'/24)'
+from Input
+where key = $max_key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.cfg
new file mode 100644
index 0000000000..551221cf56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.cfg
@@ -0,0 +1,3 @@
+in Input input3.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.sql b/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.sql
new file mode 100644
index 0000000000..1671816eec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-5978_fill_multi_usage.sql
@@ -0,0 +1,29 @@
+/* postgres can not */
+USE plato;
+
+$ctl = (
+ SELECT 1 AS join_col
+ , MAX(key) AS max
+ FROM Input
+ );
+
+INSERT INTO Output WITH TRUNCATE
+SELECT * FROM $ctl;
+
+$in = (
+ SELECT 1 AS join_col
+ , key
+ , subkey
+ , value
+ FROM Input
+ );
+
+SELECT
+ a.key AS key
+ , a.subkey AS subkey
+ , a.value AS value
+FROM $in AS a
+LEFT JOIN $ctl AS ctl
+ USING (join_col)
+WHERE key < max
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.sql b/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.sql
new file mode 100644
index 0000000000..53001bf902
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6008_limit_after_map.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+insert into Output
+select * from plato.Input where value != "111" limit 3;
+
+commit;
+
+insert into Output
+select * from plato.Input order by value;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.sql b/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.sql
new file mode 100644
index 0000000000..05c6779782
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6038_direct_row.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$queries_0 = (select distinct key from Input);
+
+$queries = (select TableRecordIndex() as j, key from $queries_0);
+
+$count = (select count(*) from $queries);
+
+$users_0 = (
+ select ListFromRange(0, 3) as lst, TableRecordIndex() as idx, subkey from Input as t
+);
+
+$users = (
+ select
+ cast(Random(idx + x) as Uint64) % $count as j,
+ subkey
+ from $users_0
+ flatten by lst as x
+);
+
+select *
+from $queries as queries join $users as users using(j)
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.cfg
new file mode 100644
index 0000000000..e934bc69c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.cfg
@@ -0,0 +1,4 @@
+in Input input3.txt
+out Output output.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.sql b/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.sql
new file mode 100644
index 0000000000..6d8c66947a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-6133_skip_deps.sql
@@ -0,0 +1,28 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+$out = (
+SELECT
+ *
+FROM
+ `Input`
+WHERE
+ value != "111"
+);
+
+$row_count = (
+ SELECT
+ COUNT(*)
+ FROM
+ $out
+);
+
+$needed_row = COALESCE(CAST(CAST($row_count as float) * 0.5 as Uint64), 1);
+
+INSERT INTO Output WITH TRUNCATE
+SELECT
+ *
+FROM $out ORDER BY key DESC
+LIMIT 1 OFFSET $needed_row;
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.cfg
new file mode 100644
index 0000000000..0781bebbd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+res result.txt
+udf strings_udf
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.sql b/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.sql
new file mode 100644
index 0000000000..df26751a74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-7324_duplicate_arg.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$to_int = ($x) -> { return cast($x as Int32) };
+$to_in_list = ($col) -> { return ListMap(String::SplitToList($col, ","), $to_int) };
+
+$input = (
+ SELECT
+ $to_in_list(key) AS event_ids,
+ $to_in_list(subkey) AS test_ids
+ FROM
+ Input
+ WHERE
+ value = "aaa"
+);
+
+SELECT
+ event_id,
+ test_ids
+FROM
+ $input
+FLATTEN BY event_ids AS event_id;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-7532_wrong_field_subset_for_calcoverwindow.sql b/yql/essentials/tests/sql/suites/optimizers/yql-7532_wrong_field_subset_for_calcoverwindow.sql
new file mode 100644
index 0000000000..5d8a388f94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-7532_wrong_field_subset_for_calcoverwindow.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+USE plato;
+
+INSERT INTO @source
+SELECT Date('2019-03-04') AS `Date`,
+ 1l AS `Permalink`,
+ 1l AS `ClusterPermalink`,
+ False AS `IsHead`,
+ False AS `WasHead`;
+COMMIT;
+
+SELECT
+ IF(
+ NOT `WasHead` AND NOT `IsHead`,
+ aggregate_list(AsStruct(`Permalink` AS `Permalink`, `Date` AS `Date`, `ClusterPermalink` AS ClusterPermalink)) OVER `w`
+ ) AS `Occurence`
+FROM
+ @source
+WINDOW `w` AS (
+ PARTITION BY `Permalink`
+ ORDER BY `Date`
+)
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.cfg
new file mode 100644
index 0000000000..7ed2bf2270
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.cfg
@@ -0,0 +1,5 @@
+in ViewSource input4.txt
+in Input1 sorted.txt
+in Input2 input_view.txt
+udf python3_udf
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.sql b/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.sql
new file mode 100644
index 0000000000..56c915118a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-7767_key_filter_with_view.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+select
+ key,
+ value || "_y" ?? "" as value
+from range("", "Input1", "Input2")
+where key > "010"
+order by key, value;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.sql b/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.sql
new file mode 100644
index 0000000000..2231c46900
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8041-fuse_with_desc_map.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+USE plato;
+
+$i = (
+ SELECT
+ cast(key as Double) as key,
+ value
+ FROM Input
+ WHERE key < "100"
+ ORDER BY key DESC
+ LIMIT 1000
+);
+
+select distinct key
+from $i
+where value != ""
+order by key;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.cfg
new file mode 100644
index 0000000000..676c920ddf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.cfg
@@ -0,0 +1,2 @@
+in Input opt_key.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.sql b/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.sql
new file mode 100644
index 0000000000..aaf5c9187e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8223_direct_row_and_skipnullmembers.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma AnsiInForEmptyOrNullableItemsCollections;
+
+$x = (
+ SELECT
+ TableName() AS path,
+ key, subkey, value
+ FROM CONCAT(Input, Input)
+);
+$y = (
+ SELECT
+ t.path AS path,
+ t.key as key,
+ info.value as value
+ FROM $x AS t
+ INNER JOIN (
+ SELECT key, subkey, value FROM Input
+ WHERE key != ""
+ ) AS info
+ USING (key)
+ WHERE t.key in ("023", "150")
+);
+select distinct path from $y;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.sql b/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.sql
new file mode 100644
index 0000000000..610f2ef729
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-8953_logical_fuse_with_table_props.sql
@@ -0,0 +1,10 @@
+use plato;
+
+select key, subkey, TableName() as name from Input
+where value == 'q';
+
+select key, count(*) as subkeys from (
+ select distinct key, subkey from Input
+ where value == 'q'
+)
+group by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.cfg b/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.cfg
new file mode 100644
index 0000000000..551221cf56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.cfg
@@ -0,0 +1,3 @@
+in Input input3.txt
+out Output output.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.sql b/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.sql
new file mode 100644
index 0000000000..d0a183b3ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql-9297_publish_ytcopy.sql
@@ -0,0 +1,22 @@
+/* postgres can not */
+/* multirun can not */
+/* kikimr can not - table truncate */
+USE plato;
+
+INSERT INTO @a
+SELECT *
+FROM Input
+WHERE key < "100"
+ORDER BY key DESC;
+
+COMMIT;
+
+INSERT INTO Output
+SELECT *
+FROM @a
+ORDER BY key DESC;
+
+COMMIT;
+
+SELECT *
+FROM Output; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.cfg b/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.cfg
new file mode 100644
index 0000000000..0474ee88ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.cfg
@@ -0,0 +1,2 @@
+in Input input3.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.sql b/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.sql
new file mode 100644
index 0000000000..4ab7aaf95e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql_5830_fuse_outer_with_extra_deps.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+
+$data = (select max_by(key, subkey)
+from Input where value > "a");
+
+select
+ a.key,
+ $data as max_key,
+ b.value
+from Input as a
+left join (select * from Input where key > "050") as b
+on a.key = b.key
+order by a.key;
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.cfg b/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.cfg
new file mode 100644
index 0000000000..1dc9a1e3a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.cfg
@@ -0,0 +1 @@
+in Input input0.txt
diff --git a/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.sql b/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.sql
new file mode 100644
index 0000000000..fcf21d7b36
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yql_6179_merge_chunks_of_outputs.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - yt pragma */
+
+PRAGMA yt.MinPublishedAvgChunkSize="0";
+PRAGMA yt.MinTempAvgChunkSize="0";
+
+USE plato;
+
+$i = (select subkey as s from Input where key = "112" limit 1);
+$j = (select subkey as s from Input where key = "113" limit 1);
+
+select * from Input where cast(TableRecordIndex() as String) == $i or
+ cast(TableRecordIndex() as String) == $j;
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.cfg b/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.cfg
new file mode 100644
index 0000000000..40b3e4c9a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.cfg
@@ -0,0 +1,3 @@
+res result.txt
+udf yson_udf
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.sql b/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.sql
new file mode 100644
index 0000000000..ead013f3b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yson_dup_serialize.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+$l = ($x)->( ListMap($x, Yson::Serialize) );
+$d = ($x)->( ToDict(ListMap(DictItems($x),($i)->(($i.0,Yson::Serialize($i.1))))));
+
+select $l($l(Yson::ConvertToList(Yson("[1;2;3]"))));
+select ListSort(DictItems($d($d(Yson::ConvertToDict(Yson("{a=1;b=2}"))))), ($x)->($x.0));
diff --git a/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.cfg b/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.cfg
new file mode 100644
index 0000000000..4ba549ce28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.cfg
@@ -0,0 +1,4 @@
+in Input input0.txt
+providers yt
+
+
diff --git a/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.sql b/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.sql
new file mode 100644
index 0000000000..b4bf37fa34
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/optimizers/yt_shuffle_by_keys.sql
@@ -0,0 +1,23 @@
+--Test, that YT optimizer can rewrite ShuffleByKeys with PartitionsByKes
+USE plato;
+
+$input = PROCESS Input;
+
+SELECT YQL::ShuffleByKeys(
+ $input,
+ ($_)->("dsdsa"),
+ ($_)->([1]) -- list
+ );
+
+SELECT YQL::ShuffleByKeys(
+ $input,
+ ($_)->(12),
+ ($_)->(Just(2)) -- optional
+ );
+
+SELECT YQL::ShuffleByKeys(
+ $input,
+ ($_)->(true),
+ ($_)->(YQL::ToStream([3])) -- stream
+ );
+
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByOneField.cfg b/yql/essentials/tests/sql/suites/order_by/SortByOneField.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByOneField.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByOneField.sql b/yql/essentials/tests/sql/suites/order_by/SortByOneField.sql
new file mode 100644
index 0000000000..192b522df4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByOneField.sql
@@ -0,0 +1 @@
+select a from plato.Input order by a;
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.cfg b/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.sql b/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.sql
new file mode 100644
index 0000000000..e269f50243
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByOneFieldDesc.sql
@@ -0,0 +1 @@
+select b from plato.Input order by b desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.cfg b/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.sql b/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.sql
new file mode 100644
index 0000000000..0a1a137b35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByTwoFields.sql
@@ -0,0 +1 @@
+select a, b from plato.Input order by a, b;
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.cfg b/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.cfg
new file mode 100644
index 0000000000..2dc97b5e95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.cfg
@@ -0,0 +1 @@
+in Input columns.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.sql b/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.sql
new file mode 100644
index 0000000000..adc58f1da7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/SortByTwoFieldsDesc.sql
@@ -0,0 +1 @@
+select a, b from plato.Input order by a desc, b desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.cfg b/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.cfg
new file mode 100644
index 0000000000..768acac67b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.cfg
@@ -0,0 +1,2 @@
+in Input input_sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.sql b/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.sql
new file mode 100644
index 0000000000..8e81372d57
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_cut_prefix.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+insert into Output
+select * from Input
+assume order by key;
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_over_input.cfg b/yql/essentials/tests/sql/suites/order_by/assume_over_input.cfg
new file mode 100644
index 0000000000..4ef8c714be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_over_input.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_over_input.sql b/yql/essentials/tests/sql/suites/order_by/assume_over_input.sql
new file mode 100644
index 0000000000..f2a2611de7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_over_input.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+INSERT INTO Output
+SELECT * FROM Input ASSUME ORDER BY key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.cfg b/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.sql b/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.sql
new file mode 100644
index 0000000000..252bd2ae91
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_over_input_desc.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+/* hybridfile can not YQL-17743 */
+USE plato;
+
+insert into Output
+select * from concat(`Input[#3]`, `Input[#0]`, `Input[#2]`)
+assume order by key desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_with_filter.cfg b/yql/essentials/tests/sql/suites/order_by/assume_with_filter.cfg
new file mode 100644
index 0000000000..4ef8c714be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_with_filter.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_with_filter.sql b/yql/essentials/tests/sql/suites/order_by/assume_with_filter.sql
new file mode 100644
index 0000000000..45463f1953
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_with_filter.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+INSERT INTO Output
+SELECT
+ "3" || key as key,
+ subkey,
+ value
+FROM Input
+WHERE key >= "0"
+ASSUME ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.cfg b/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.cfg
new file mode 100644
index 0000000000..4ef8c714be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.sql b/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.sql
new file mode 100644
index 0000000000..0c25b703e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/assume_with_transform_desc.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* hybridfile can not YQL-17743 */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+INSERT INTO Output
+SELECT
+ -(CAST(key as Int32) ?? 0) as key,
+ subkey,
+ value
+FROM Input
+ASSUME ORDER BY key DESC;
diff --git a/yql/essentials/tests/sql/suites/order_by/avg_and_sum_by_value.txt b/yql/essentials/tests/sql/suites/order_by/avg_and_sum_by_value.txt
new file mode 100644
index 0000000000..cebd64e139
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/avg_and_sum_by_value.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="2";"subkey"="20";"value"="BAR"};
+{"key"="3";"subkey"="30";"value"="BAR"};
+{"key"="WAT";"subkey"="WAT";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.cfg b/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.cfg
new file mode 100644
index 0000000000..f9159f698b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.cfg
@@ -0,0 +1,3 @@
+in Input input_sorted.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.sql b/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.sql
new file mode 100644
index 0000000000..e69117f930
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/changed_sort_with_limit.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+INSERT INTO Output
+SELECT
+ key,
+ '1' as subkey,
+ value || "a" as value
+FROM Input
+WHERE key < "100"
+ORDER BY value
+limit 3;
diff --git a/yql/essentials/tests/sql/suites/order_by/columns.txt b/yql/essentials/tests/sql/suites/order_by/columns.txt
new file mode 100644
index 0000000000..24785da79e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/columns.txt
@@ -0,0 +1,8 @@
+{"a"="x"; "b"=1u; "c"=133; "d"=-5 };
+{"a"="y"; "b"=1u; "c"=90; "d"=12 };
+{"a"="y"; "b"=0u; "c"=5; "d"=999};
+{"a"="y"; "b"=0u; "c"=111; "d"=42 };
+{"a"="y"; "b"=1u; "c"=-8; "d"=6 };
+{"a"="x"; "b"=1u; "c"=256; "d"=-77};
+{"a"="x"; "b"=1u; "c"=2; "d"=-47};
+{"a"="y"; "b"=1u; "c"=88; "d"=3 };
diff --git a/yql/essentials/tests/sql/suites/order_by/columns.txt.attr b/yql/essentials/tests/sql/suites/order_by/columns.txt.attr
new file mode 100644
index 0000000000..70da6cab1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/columns.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="string";"name"="a"};{"type"="uint64";"name"="b"};{"type"="int64";"name"="c"};{"type"="int64";"name"="d"}]
+}
diff --git a/yql/essentials/tests/sql/suites/order_by/complex_type.txt b/yql/essentials/tests/sql/suites/order_by/complex_type.txt
new file mode 100644
index 0000000000..1dd5ba0166
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/complex_type.txt
@@ -0,0 +1,2 @@
+{"value"=["v1";"v2"];"key"="k1"};
+{"value"=["v2";"v3"];"key"="k2"};
diff --git a/yql/essentials/tests/sql/suites/order_by/complex_type.txt.attr b/yql/essentials/tests/sql/suites/order_by/complex_type.txt.attr
new file mode 100644
index 0000000000..42cec863fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/complex_type.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec" = {
+ "StrictSchema"=%true;
+ "Type"=["StructType";[
+ ["value";["ListType";["DataType";"String"]]];
+ ["key";["OptionalType";["DataType";"String"]]];
+ ]];
+ };
+ "schema" = [
+ {"required"=%false; "type"="any"; "name"="value"};
+ {"required"=%false; "type"="string"; "name"="key"};
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/order_by/decimals.txt b/yql/essentials/tests/sql/suites/order_by/decimals.txt
new file mode 100644
index 0000000000..5c1ede16e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/decimals.txt
@@ -0,0 +1,8 @@
+{"a"="x"; "b"=1u; "c"="133.34"; "d"="-inf" };
+{"a"="y"; "b"=1u; "c"="90.5"; "d"="12.7" };
+{"a"="y"; "b"=0u; "c"="5.01"; "d"="inf"};
+{"a"="y"; "b"=0u; "c"="111"; "d"="nan" };
+{"a"="y"; "b"=1u; "c"="-8.99"; "d"="6.6" };
+{"a"="x"; "b"=1u; "c"="256.333"; "d"="-77.5"};
+{"a"="x"; "b"=1u; "c"="2.0"; "d"="-47.0"};
+{"a"="y"; "b"=1u; "c"="88.88"; "d"="3.3" };
diff --git a/yql/essentials/tests/sql/suites/order_by/decimals.txt.attr b/yql/essentials/tests/sql/suites/order_by/decimals.txt.attr
new file mode 100644
index 0000000000..1d13a3e179
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/decimals.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"String"]];
+ ["b";["DataType";"Uint8"]];
+ ["c";["DataType";"String"]];
+ ["d";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/order_by/default.cfg b/yql/essentials/tests/sql/suites/order_by/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/descending.txt b/yql/essentials/tests/sql/suites/order_by/descending.txt
new file mode 100644
index 0000000000..8e63b46e56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/descending.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="020";"subkey"="1";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/order_by/descending.txt.attr b/yql/essentials/tests/sql/suites/order_by/descending.txt.attr
new file mode 100644
index 0000000000..7024a9fc9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/descending.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.cfg b/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.sql b/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.sql
new file mode 100644
index 0000000000..6e5b264216
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/extract_members_over_sort_desc.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+$top = (select * from Input order by value desc limit 100);
+
+insert into Output
+select key, value
+from $top
+order by value desc;
+
+select * from $top; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/input.txt b/yql/essentials/tests/sql/suites/order_by/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/order_by/input2.txt b/yql/essentials/tests/sql/suites/order_by/input2.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/input2.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/order_by/input_expr.txt b/yql/essentials/tests/sql/suites/order_by/input_expr.txt
new file mode 100644
index 0000000000..621e7eaead
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/input_expr.txt
@@ -0,0 +1,10 @@
+{"key"="192";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="15";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="15";"value"="aaa"};
+{"key"="527";"subkey"="1";"value"="bbb"};
+{"key"="037";"subkey"="15";"value"="ddd"};
+{"key"="761";"subkey"="1";"value"="ccc"};
+{"key"="200";"subkey"="5";"value"="qqq"};
+{"key"="150";"subkey"="5";"value"="zzz"};
+{"key"="042";"subkey"="15";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/order_by/input_sorted.txt b/yql/essentials/tests/sql/suites/order_by/input_sorted.txt
new file mode 100644
index 0000000000..004ddc583b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/input_sorted.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/order_by/input_sorted.txt.attr b/yql/essentials/tests/sql/suites/order_by/input_sorted.txt.attr
new file mode 100644
index 0000000000..aa00b0ede5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/input_sorted.txt.attr
@@ -0,0 +1,53 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key";
+ "subkey";
+ ];
+ "SortDirections" = [
+ 1;
+ 1;
+ ];
+ "UniqueKeys" = %false;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ];
+ [
+ "DataType";
+ "String"
+ ];
+ ];
+ "SortedBy" = [
+ "key";
+ "subkey";
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/limit.cfg b/yql/essentials/tests/sql/suites/order_by/limit.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/limit.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/limit.sql b/yql/essentials/tests/sql/suites/order_by/limit.sql
new file mode 100644
index 0000000000..eb87ba6968
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/limit.sql
@@ -0,0 +1 @@
+select * from plato.Input order by a desc limit 3;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal.cfg b/yql/essentials/tests/sql/suites/order_by/literal.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal.sql b/yql/essentials/tests/sql/suites/order_by/literal.sql
new file mode 100644
index 0000000000..aac08c3fb8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+use plato;
+
+insert into Output
+select x
+from (select ListFromRange(0,100) as x)
+flatten by x
+order by x;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_complex.cfg b/yql/essentials/tests/sql/suites/order_by/literal_complex.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_complex.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_complex.sql b/yql/essentials/tests/sql/suites/order_by/literal_complex.sql
new file mode 100644
index 0000000000..84bee87970
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_complex.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* hybridfile can not YQL-17743 */
+use plato;
+
+$list = AsList(AsStruct(1 as a, "2" as b, "3" as c), AsStruct(4 as a, "5" as b, "6" as c));
+
+insert into Output
+select * from as_table($list)
+order by a desc, b, c desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_desc.cfg b/yql/essentials/tests/sql/suites/order_by/literal_desc.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_desc.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_desc.sql b/yql/essentials/tests/sql/suites/order_by/literal_desc.sql
new file mode 100644
index 0000000000..3aec7f5aa7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_desc.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* hybridfile can not YQL-17743 */
+use plato;
+
+insert into Output
+select x
+from (select ListFromRange(0,100) as x)
+flatten by x
+order by x desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.cfg b/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.sql b/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.sql
new file mode 100644
index 0000000000..ed51a6a4c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_empty_list_sort.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+use plato;
+
+$list = ListCreate(Struct<key:String, subkey:String, value:String>);
+
+insert into Output
+select * from as_table($list) order by key;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.cfg b/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.sql b/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.sql
new file mode 100644
index 0000000000..a928a89fd1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_single_item_sort.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+use plato;
+
+$t = AsList(
+ AsStruct(1 as key, 101 as value)
+);
+
+insert into Output
+select * from as_table($t) order by key;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.cfg b/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.sql b/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.sql
new file mode 100644
index 0000000000..18288547fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_take_zero_sort.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+use plato;
+
+$t = AsList(
+ AsStruct(1 as key, 101 as value),
+ AsStruct(2 as key, 34 as value),
+ AsStruct(4 as key, 22 as value),
+ AsStruct(6 as key, 256 as value),
+ AsStruct(7 as key, 111 as value)
+);
+
+insert into Output
+select * from as_table($t) order by key limit 0;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_with_assume.cfg b/yql/essentials/tests/sql/suites/order_by/literal_with_assume.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_with_assume.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_with_assume.sql b/yql/essentials/tests/sql/suites/order_by/literal_with_assume.sql
new file mode 100644
index 0000000000..5324313491
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_with_assume.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+use plato;
+
+$t = AsList(
+ AsStruct(1 as key, 101 as value),
+ AsStruct(2 as key, 34 as value),
+ AsStruct(4 as key, 22 as value),
+ AsStruct(6 as key, 256 as value),
+ AsStruct(7 as key, 111 as value)
+);
+
+insert into Output
+select * from as_table($t) assume order by key;
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.cfg b/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.sql b/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.sql
new file mode 100644
index 0000000000..dd67c120a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/literal_with_assume_desc.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* multirun can not */
+/* hybridfile can not YQL-17743 */
+/* syntax version 1 */
+use plato;
+
+insert into Output
+select x
+from (select ListFromRange(10,0,-1) as x)
+flatten by x
+assume order by x desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.cfg
new file mode 100644
index 0000000000..e40a99f9ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.cfg
@@ -0,0 +1,3 @@
+in Input input2.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.sql b/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.sql
new file mode 100644
index 0000000000..7f7ea25d54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_assume_with_transform.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+pragma yt.UseNativeDescSort;
+
+INSERT INTO Output
+SELECT
+ -(CAST(key as Int32) ?? 0) as key,
+ subkey,
+ value
+FROM Input
+ASSUME ORDER BY key DESC;
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_publish.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_publish.cfg
new file mode 100644
index 0000000000..fccca71d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_publish.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_publish.sql b/yql/essentials/tests/sql/suites/order_by/native_desc_publish.sql
new file mode 100644
index 0000000000..18bbffc0d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_publish.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+use plato;
+pragma yt.UseNativeDescSort;
+
+insert into Output
+select * from Input
+order by key desc;
+
+insert into Output
+select * from Input
+order by key desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort-over_sorted.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_sort-over_sorted.cfg
new file mode 100644
index 0000000000..1a2a7d1afc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort-over_sorted.cfg
@@ -0,0 +1,3 @@
+in Input descending.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_sort.cfg
new file mode 100644
index 0000000000..fccca71d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort.sql b/yql/essentials/tests/sql/suites/order_by/native_desc_sort.sql
new file mode 100644
index 0000000000..5f8292ae08
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+pragma yt.UseNativeDescSort;
+
+insert into Output
+select * from Input
+order by key desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.cfg
new file mode 100644
index 0000000000..fccca71d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.sql b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.sql
new file mode 100644
index 0000000000..3501a154d5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_calc.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+pragma yt.UseNativeDescSort;
+
+insert into Output
+select * from Input
+order by key || subkey desc, key desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.cfg b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.cfg
new file mode 100644
index 0000000000..fccca71d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.sql b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.sql
new file mode 100644
index 0000000000..6d4be0774b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/native_desc_sort_with_limit.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+pragma yt.UseNativeDescSort;
+
+insert into Output
+select * from Input
+order by key, subkey desc limit 3;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_dot_column.sql b/yql/essentials/tests/sql/suites/order_by/order_by_dot_column.sql
new file mode 100644
index 0000000000..b844b33900
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_dot_column.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+SELECT 100500 as magic, t.* FROM plato.Input as t ORDER BY `t.subkey` DESC
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_dynum.sql b/yql/essentials/tests/sql/suites/order_by/order_by_dynum.sql
new file mode 100644
index 0000000000..75b083db2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_dynum.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT * FROM plato.Input ORDER BY CAST(key AS DyNumber);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_dynum_desc.sql b/yql/essentials/tests/sql/suites/order_by/order_by_dynum_desc.sql
new file mode 100644
index 0000000000..4229b9ccf3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_dynum_desc.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT * FROM plato.Input ORDER BY CAST(key AS DyNumber) DESC;
+
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_expr.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr.sql b/yql/essentials/tests/sql/suites/order_by/order_by_expr.sql
new file mode 100644
index 0000000000..ec5b1999e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input as i order by cast(i.key as uint32) * cast(subkey as uint32) LIMIT 3;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.sql b/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.sql
new file mode 100644
index 0000000000..221cd5b9ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_mul_cols.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select i.key, i.subkey from plato.Input as i order by cast(subkey as uint32), cast(i.key as uint32) * cast(i.subkey as uint32) desc LIMIT 3 OFFSET 4;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.cfg
new file mode 100644
index 0000000000..fb5b1cca95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.cfg
@@ -0,0 +1,2 @@
+in Input sorted_table1.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.sql b/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.sql
new file mode 100644
index 0000000000..34d9290737
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_over_sorted_table.sql
@@ -0,0 +1,2 @@
+select key, value from plato.Input
+order by key, String::SplitToList(value, "$", 2 as Limit)[0]
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.sql b/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.sql
new file mode 100644
index 0000000000..a4a7d6ba92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_simple.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input as i order by (cast(i.key as uint32) / 10) % 10 desc, subkey;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_expr_with_deps.sql b/yql/essentials/tests/sql/suites/order_by/order_by_expr_with_deps.sql
new file mode 100644
index 0000000000..581b50d142
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_expr_with_deps.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$list = select ListSort(aggregate_list(key)) from Input;
+
+SELECT * FROM Input
+ORDER BY ListIndexOf($list ?? [], key);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.cfg
new file mode 100644
index 0000000000..14e04a5467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.cfg
@@ -0,0 +1 @@
+in Input complex_type.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.sql b/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.sql
new file mode 100644
index 0000000000..26d888f98a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_list_of_strings.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+use plato;
+select key,value from Input order by value limit 1
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column.sql
new file mode 100644
index 0000000000..56b49f972f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column.sql
@@ -0,0 +1,11 @@
+use plato;
+
+select subkey from Input order by key, value;
+select subkey from Input order by "x" || key, value;
+select subkey from Input order by key || "x" limit 3;
+
+select subkey from Input as a order by "x" || key, a.value limit 3;
+select subkey from Input as a order by a.key, value limit 1;
+select subkey from Input as a order by key, value limit 2;
+
+select subkey, key from Input order by key, value;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.sql
new file mode 100644
index 0000000000..d014aa41c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_as_table.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+
+$src = [
+ <|a:4, b:4, date:4|>,
+ <|a:3, b:3, date:3|>,
+ <|a:2, b:2, date:2|>,
+ <|a:1, b:1, date:1|>,
+];
+
+select a from as_table($src) order by date;
+select x.a from as_table($src) as x order by date;
+select x.a from as_table($src) as x order by x.date;
+
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.sql
new file mode 100644
index 0000000000..0a8301ea7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_ignored.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+pragma warning("disable", "4504");
+
+$t = [<|k:1, v:2|>];
+
+$src = select k FROM as_table($t) order by x;
+select * from $src;
+
+$src = select a.k as key from as_table($t) as a join as_table($t) as b on a.k=b.k order by b.u;
+select * from $src;
+
+$src = select a.k as key from as_table($t) as a join as_table($t) as b on a.k=b.k order by v;
+select * from $src;
+
+$src = select a.k as key from as_table($t) as a join as_table($t) as b on a.k=b.k order by z;
+select * from $src;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.sql
new file mode 100644
index 0000000000..1573b34b06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join.sql
@@ -0,0 +1,47 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+
+$src = [
+<|a:5, b:50, zz:500|>,
+<|a:4, b:40, zz:400|>,
+<|a:3, b:30, zz:300|>,
+<|a:2, b:20, zz:200|>,
+<|a:1, b:10, zz:100|>,
+];
+
+$src1 = [
+<|e:5, f:50|>,
+<|e:4, f:40|>,
+<|e:3, f:30|>,
+<|e:2, f:20|>,
+<|e:1, f:10|>,
+];
+
+
+$src = select * from as_table($src);
+$src1 = select * from as_table($src1);
+
+select a, b from $src order by zz + 1;
+select x.a, b from $src as x order by x.zz + 1;
+
+select * without b, a from $src order by zz + 1;
+select * without b, a, zz from $src order by zz + 1;
+
+select * without x.b, x.a from $src as x order by zz + 1;
+select * without x.b, x.a, zz from $src as x order by zz + 1;
+
+select a, b, x.* without b, a from $src as x order by zz + 1;
+select a, b, x.* without b, a, x.zz from $src as x order by zz + 1;
+select a, b, x.* without b, a, x.zz from $src as x order by x.zz + 1;
+
+select y.e, y.f from $src as x join $src1 as y on x.a = y.e order by x.zz;
+select * without x.a, x.b, from $src as x join $src1 as y on x.a = y.e order by zz;
+select x.* without x.zz from $src as x join $src1 as y on x.a = y.e order by x.zz;
+
+select x.*, unwrap(x.zz) as zz, without x.a, x.zz from $src as x order by zz;
+select x.*, unwrap(x.zz) as zz, without x.a, x.zz from $src as x join $src1 as y on x.a = y.e order by x.zz;
+select x.*, unwrap(x.zz) as zz, without x.a, x.zz from $src as x join $src1 as y on x.a = y.e order by zz;
+
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.sql
new file mode 100644
index 0000000000..fa283b1894
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join2.sql
@@ -0,0 +1,27 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+
+$src = [
+<|a:5, b:50, zz:500|>,
+<|a:4, b:40, zz:400|>,
+<|a:3, b:30, zz:300|>,
+<|a:2, b:20, zz:200|>,
+<|a:1, b:10, zz:100|>,
+];
+
+$src1 = [
+<|e:5, f:50|>,
+<|e:4, f:40|>,
+<|e:3, f:30|>,
+<|e:2, f:20|>,
+<|e:1, f:10|>,
+];
+
+
+$src = select * from as_table($src);
+$src1 = select * from as_table($src1);
+
+select x.zz, x.b + y.f as col1 from $src as x cross join $src1 as y where x.a = y.e order by zz, col1;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.sql b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.sql
new file mode 100644
index 0000000000..0107a069d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_missing_project_column_join_types.sql
@@ -0,0 +1,47 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+
+$src = [
+<|a:5, b:50, date:500|>,
+<|a:4, b:40, date:400|>,
+<|a:3, b:30, date:300|>,
+<|a:2, b:20, date:200|>,
+<|a:1, b:10, date:100|>,
+];
+
+$src1 = [
+<|e:5, f:50|>,
+<|e:4, f:40|>,
+<|e:3, f:30|>,
+<|e:2, f:20|>,
+<|e:1, f:10|>,
+];
+
+
+$src = select * from as_table($src);
+$src1 = select * from as_table($src1);
+
+select a, b from $src order by date + 1;
+select x.a, b from $src as x order by x.date + 1;
+
+select * without b, a from $src order by date + 1;
+select * without b, a, date from $src order by date + 1;
+
+select * without x.b, x.a from $src as x order by date + 1;
+select * without x.b, x.a, date from $src as x order by date + 1;
+
+select a, b, x.* without b, a from $src as x order by date + 1;
+select a, b, x.* without b, a, x.date from $src as x order by date + 1;
+select a, b, x.* without b, a, x.date from $src as x order by x.date + 1;
+
+select y.e, y.f from $src as x join $src1 as y on x.a = y.e order by x.date;
+select * without x.a, x.b, from $src as x join $src1 as y on x.a = y.e order by date;
+select x.* without x.date from $src as x join $src1 as y on x.a = y.e order by x.date;
+
+select x.*, unwrap(x.date) as date, without x.a, x.date from $src as x order by date;
+select x.*, unwrap(x.date) as date, without x.a, x.date from $src as x join $src1 as y on x.a = y.e order by x.date;
+select x.*, unwrap(x.date) as date, without x.a, x.date from $src as x join $src1 as y on x.a = y.e order by date;
+
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_mul_columns.sql b/yql/essentials/tests/sql/suites/order_by/order_by_mul_columns.sql
new file mode 100644
index 0000000000..223e3f50fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_mul_columns.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input order by value, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.cfg
new file mode 100644
index 0000000000..96f3ef0db7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.cfg
@@ -0,0 +1 @@
+in Input avg_and_sum_by_value.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.sql b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.sql
new file mode 100644
index 0000000000..6a28c09401
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select cast(key as int) as key, subkey, value from plato.Input order by key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.cfg
new file mode 100644
index 0000000000..96f3ef0db7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.cfg
@@ -0,0 +1 @@
+in Input avg_and_sum_by_value.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.sql b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.sql
new file mode 100644
index 0000000000..0d49cf05d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_num_key_and_subkey_desc.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select coalesce(cast(key as int), 0) as key, subkey, value from plato.Input order by key desc, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_subquery.sqlx b/yql/essentials/tests/sql/suites/order_by/order_by_subquery.sqlx
new file mode 100644
index 0000000000..e7abfd65ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_subquery.sqlx
@@ -0,0 +1,25 @@
+/* postgres can not */
+use plato;
+pragma warning("error", "4504");
+
+$x = (select * from Input order by value);
+select * from $x;
+
+select * from (select * from Input order by value);
+
+select * from (select * from Input as a join Input as b using(key) order by a.value);
+
+select * from (
+select * from Input
+union all
+select * from Input order by key
+);
+
+select * from (
+SELECT
+ key, prefix,
+ COUNT(*) AS cnt,
+ grouping(key, prefix) as agrouping
+FROM Input
+GROUP BY ROLLUP (key as key, Substring(value, 1, 1) as prefix)
+ORDER BY key);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.sql
new file mode 100644
index 0000000000..cc9ffeba99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablepath_column.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+use plato;
+select *
+from Input
+order by TablePath(), key;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.sql
new file mode 100644
index 0000000000..834527a065
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablerecord_column.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+select *
+from Input
+order by TableRecordIndex();
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.sql
new file mode 100644
index 0000000000..950374674c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tablerow_column.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+use plato;
+select key
+from Input
+order by TableRow().key;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tuple.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tuple.sql
new file mode 100644
index 0000000000..8e33db8a2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tuple.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+select * from (
+ select key, AsTuple(key, subkey) as tpl from Input
+) order by tpl;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tuple_and_member.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tuple_and_member.sql
new file mode 100644
index 0000000000..fecbcc7de3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tuple_and_member.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+select * from (
+ select key, AsTuple(key, subkey) as tpl from Input
+) order by key, tpl;
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_tuple_expr.sql b/yql/essentials/tests/sql/suites/order_by/order_by_tuple_expr.sql
new file mode 100644
index 0000000000..cb2b0b538b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_tuple_expr.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+$keys = ($key) -> {
+ return AsTuple($key, $key);
+};
+
+select * from Input order by $keys(value);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_udf.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_udf.cfg
new file mode 100644
index 0000000000..677bf9308b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_udf.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_udf.sql b/yql/essentials/tests/sql/suites/order_by/order_by_udf.sql
new file mode 100644
index 0000000000..998abf210b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_udf.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+SELECT *
+FROM plato.Input
+ORDER BY Math::Pow(cast(subkey as double), 2);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.cfg b/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.cfg
new file mode 100644
index 0000000000..677bf9308b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.sql b/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.sql
new file mode 100644
index 0000000000..17032c0605
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_udf_duo.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+
+SELECT *
+FROM plato.Input
+ORDER BY Math::Pow(cast(subkey as double), 2), Math::Pow(cast(key as double), 2);
diff --git a/yql/essentials/tests/sql/suites/order_by/order_by_value_desc.sql b/yql/essentials/tests/sql/suites/order_by/order_by_value_desc.sql
new file mode 100644
index 0000000000..df3e4d9be0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_by_value_desc.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input order by value desc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/order_with_null.sql b/yql/essentials/tests/sql/suites/order_by/order_with_null.sql
new file mode 100644
index 0000000000..27171419c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/order_with_null.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+use plato;
+
+$input = (
+select null as key, "0" as subkey, "kkk" as value
+union all
+select * from Input
+);
+
+select * from $input order by key asc;
+select * from $input order by key desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/ordered_fill.cfg b/yql/essentials/tests/sql/suites/order_by/ordered_fill.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/ordered_fill.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/ordered_fill.sql b/yql/essentials/tests/sql/suites/order_by/ordered_fill.sql
new file mode 100644
index 0000000000..97ce0503f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/ordered_fill.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* multirun can not */
+use plato;
+
+insert into Output
+select x from (select ListFromRange(0,100) as x) flatten by x order by x;
+
+commit;
+
+select * from Output where x=50; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/presort_mem.sql b/yql/essentials/tests/sql/suites/order_by/presort_mem.sql
new file mode 100644
index 0000000000..1c6bf964ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/presort_mem.sql
@@ -0,0 +1,76 @@
+/* postgres can not */
+select Yql::Sort(
+ AsList(
+ AsTuple(3,1),
+ AsTuple(1,2),
+ AsTuple(1,3),
+ ),
+ true,
+ ($x)->{return $x;}
+);
+
+select Yql::Sort(
+ AsList(
+ AsTuple(3,1),
+ AsTuple(1,1),
+ AsTuple(1,3),
+ ),
+ AsTuple(true, false),
+ ($x)->{return $x;}
+);
+
+select Yql::Sort(
+ AsList(
+ AsList(3,1),
+ AsList(1,2),
+ AsList(2,3),
+ AsList(1,2,3)
+ ),
+ true,
+ ($x)->{return $x;}
+);
+
+select Yql::Sort(
+ AsList(
+ AsTuple(1, AsList(3,1)),
+ AsTuple(1, AsList(1,2)),
+ AsTuple(1, AsList(2,3)),
+ AsTuple(1, AsList(1,2,3)),
+ AsTuple(2, AsList(3,1)),
+ AsTuple(2, AsList(1,2)),
+ AsTuple(2, AsList(2,3)),
+ AsTuple(2, AsList(1,2,3))
+ ),
+ AsTuple(true, false),
+ ($x)->{return $x;}
+);
+
+select Yql::Sort(
+ AsList(
+ AsTuple(1, AsList(3,1)),
+ AsTuple(1, AsList(1,2)),
+ AsTuple(1, AsList(2,3)),
+ AsTuple(1, AsList(1,2,3)),
+ AsTuple(2, AsList(3,1)),
+ AsTuple(2, AsList(1,2)),
+ AsTuple(2, AsList(2,3)),
+ AsTuple(2, AsList(1,2,3))
+ ),
+ AsTuple(true, true),
+ ($x)->{return $x;}
+);
+
+select Yql::Sort(
+ AsList(
+ AsTuple(1, AsList(3,1)),
+ AsTuple(1, AsList(1,2)),
+ AsTuple(1, AsList(2,3)),
+ AsTuple(1, AsList(1,2,3)),
+ AsTuple(2, AsList(3,1)),
+ AsTuple(2, AsList(1,2)),
+ AsTuple(2, AsList(2,3)),
+ AsTuple(2, AsList(1,2,3))
+ ),
+ false,
+ ($x)->{return $x;}
+);
diff --git a/yql/essentials/tests/sql/suites/order_by/presort_order_by_table.sql b/yql/essentials/tests/sql/suites/order_by/presort_order_by_table.sql
new file mode 100644
index 0000000000..9929a31017
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/presort_order_by_table.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+use plato;
+
+$list = AsList(
+ AsList(3,1),
+ AsList(1,1),
+ AsList(1),
+ );
+
+insert into @foo
+select x from (select $list as x)
+flatten by x;
+commit;
+select * from @foo
+order by x asc
diff --git a/yql/essentials/tests/sql/suites/order_by/read_schema.txt b/yql/essentials/tests/sql/suites/order_by/read_schema.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/read_schema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/order_by/read_schema.txt.attr b/yql/essentials/tests/sql/suites/order_by/read_schema.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/read_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/order_by/single_item_tuple.sql b/yql/essentials/tests/sql/suites/order_by/single_item_tuple.sql
new file mode 100644
index 0000000000..d04c7f9040
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/single_item_tuple.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT (42,) AS s ASSUME ORDER BY s;
diff --git a/yql/essentials/tests/sql/suites/order_by/singular.sql b/yql/essentials/tests/sql/suites/order_by/singular.sql
new file mode 100644
index 0000000000..8c22ab69f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/singular.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+/* hybridfile can not YQL-17743 */
+use plato;
+
+insert into @foo
+select void() as x,null as y,[] as z,{} as w
+order by x,y,z,w;
+
+commit;
+
+select * from @foo;
diff --git a/yql/essentials/tests/sql/suites/order_by/sort.cfg b/yql/essentials/tests/sql/suites/order_by/sort.cfg
new file mode 100644
index 0000000000..c3d8fbb039
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort.cfg
@@ -0,0 +1 @@
+in Input unsorted.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/sort.sql b/yql/essentials/tests/sql/suites/order_by/sort.sql
new file mode 100644
index 0000000000..37ceaff6de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort.sql
@@ -0,0 +1 @@
+select * from plato.Input order by d, a, b, c;
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_decimals.cfg b/yql/essentials/tests/sql/suites/order_by/sort_decimals.cfg
new file mode 100644
index 0000000000..1d2a5c3bce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_decimals.cfg
@@ -0,0 +1 @@
+in Input decimals.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_decimals.sql b/yql/essentials/tests/sql/suites/order_by/sort_decimals.sql
new file mode 100644
index 0000000000..5c250e1658
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_decimals.sql
@@ -0,0 +1,4 @@
+select * from plato.Input order by Cast(c as Decimal(13,3));
+select * from plato.Input order by Cast(c as Decimal(13,3)) desc;
+select * from plato.Input order by Cast(d as Decimal(5,1));
+select * from plato.Input order by Cast(d as Decimal(5,1)) desc;
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_simple.cfg b/yql/essentials/tests/sql/suites/order_by/sort_simple.cfg
new file mode 100644
index 0000000000..c3d8fbb039
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_simple.cfg
@@ -0,0 +1 @@
+in Input unsorted.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_simple.sql b/yql/essentials/tests/sql/suites/order_by/sort_simple.sql
new file mode 100644
index 0000000000..8db149f8f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_simple.sql
@@ -0,0 +1,6 @@
+select a from plato.Input order by a;
+select b from plato.Input order by b;
+select c from plato.Input order by c;
+select d from plato.Input order by d;
+select e from plato.Input order by e;
+
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_with_take.cfg b/yql/essentials/tests/sql/suites/order_by/sort_with_take.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_with_take.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_with_take.sql b/yql/essentials/tests/sql/suites/order_by/sort_with_take.sql
new file mode 100644
index 0000000000..f728aecb00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_with_take.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+insert into Output with truncate
+select * from (select * from Input limit 3)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.cfg b/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.sql b/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.sql
new file mode 100644
index 0000000000..a7b4e757e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sort_with_take_limit.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+insert into Output with truncate
+select * from (select * from Input limit 3)
+order by key limit 2;
diff --git a/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt b/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt
new file mode 100644
index 0000000000..73eb5e6653
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="1";"value"="z$c"};
+{"key"="1";"subkey"="3";"value"="y$b"};
+{"key"="1";"subkey"="5";"value"="x$a"};
+
diff --git a/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt.attr b/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt.attr
new file mode 100644
index 0000000000..ba8118899c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/sorted_table1.txt.attr
@@ -0,0 +1,12 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/order_by/tuple01.sql b/yql/essentials/tests/sql/suites/order_by/tuple01.sql
new file mode 100644
index 0000000000..da079265d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/tuple01.sql
@@ -0,0 +1,32 @@
+/* postgres can not */
+
+select Yql::Sort(
+AsList(3,2,1),
+AsTuple(),
+($_x)->{return AsTuple()}
+);
+
+
+select Yql::Sort(
+AsList(3,2,1),
+AsTuple(true),
+($x)->{return $x}
+);
+
+select Yql::Sort(
+AsList(3,2,1),
+true,
+($x)->{return $x}
+);
+
+select Yql::Sort(
+AsList(3,2,1),
+AsTuple(true),
+($x)->{return AsTuple($x)}
+);
+
+select Yql::Sort(
+AsList(3,2,1),
+AsTuple(true,true),
+($x)->{return AsTuple($x,$x)}
+);
diff --git a/yql/essentials/tests/sql/suites/order_by/union_all.cfg b/yql/essentials/tests/sql/suites/order_by/union_all.cfg
new file mode 100644
index 0000000000..de341b36d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/union_all.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/union_all.sql b/yql/essentials/tests/sql/suites/order_by/union_all.sql
new file mode 100644
index 0000000000..fce8866ddf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/union_all.sql
@@ -0,0 +1,21 @@
+USE plato;
+
+pragma DqEngine = "disable";
+
+DEFINE SUBQUERY $sample($product_type) AS
+
+ SELECT *
+ FROM Input
+ WHERE subkey = $product_type
+ ORDER BY key
+ LIMIT 10;
+
+END DEFINE;
+
+$list = ["a", "b"];
+$s = SubqueryUnionAllFor($list, $sample);
+$concated = PROCESS $s();
+
+INSERT INTO Output
+SELECT *
+FROM $concated \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/order_by/unsorted.txt b/yql/essentials/tests/sql/suites/order_by/unsorted.txt
new file mode 100644
index 0000000000..30aeaac5b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/unsorted.txt
@@ -0,0 +1,8 @@
+{"a"=1; "b"=1u; "c"=0.1; "d"="x"; "e"=%false; "f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2; "b"=2u; "c"=2.5; "d"="xx"; "e"=%true; "f"=0.123};
+{"a"=-5;"b"=8u; "c"=10.; "d"="xxx"; "f"="xyz"};
+{ "b"=5u; "d"="skdjfnsdf";"e"=%false};
+{};
+{"a"=-5;"b"=8u; "c"=12.; "d"="xxx"; "f"="xyz"};
+{"a"=-5;"b"=8u; "c"=10.01; "d"=""; "f"=%false};
+{}
diff --git a/yql/essentials/tests/sql/suites/order_by/unsorted.txt.attr b/yql/essentials/tests/sql/suites/order_by/unsorted.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/unsorted.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.cfg b/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.cfg
new file mode 100644
index 0000000000..8300ccd161
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.cfg
@@ -0,0 +1 @@
+in Input input_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.sql b/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.sql
new file mode 100644
index 0000000000..7e7f146553
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/order_by/warn_offset_wo_sort.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+select * from Input
+limit 5 offset 10;
diff --git a/yql/essentials/tests/sql/suites/params/complex_yson.cfg b/yql/essentials/tests/sql/suites/params/complex_yson.cfg
new file mode 100644
index 0000000000..bee766d276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/complex_yson.cfg
@@ -0,0 +1 @@
+param $x p_yson2.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/complex_yson.sql b/yql/essentials/tests/sql/suites/params/complex_yson.sql
new file mode 100644
index 0000000000..31c65f574e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/complex_yson.sql
@@ -0,0 +1,4 @@
+pragma yson.Strict;
+
+declare $x as Yson;
+select ToBytes(Yson::SerializePretty($x));
diff --git a/yql/essentials/tests/sql/suites/params/default.cfg b/yql/essentials/tests/sql/suites/params/default.cfg
new file mode 100644
index 0000000000..e68191f82c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/default.cfg
@@ -0,0 +1 @@
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/dict.cfg b/yql/essentials/tests/sql/suites/params/dict.cfg
new file mode 100644
index 0000000000..ecab95188f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/dict.cfg
@@ -0,0 +1,2 @@
+param $x p_dict.json
+param $x2 p_dict2.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/dict.sql b/yql/essentials/tests/sql/suites/params/dict.sql
new file mode 100644
index 0000000000..0af2b27d2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/dict.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+declare $x as Dict<String, Int64?>;
+declare $x2 as Dict<Utf8, Int64?>;
+select $x["a1"], $x["a2"], $x["a3"], $x2["a1"], $x2["a2"], $x2["a3"]
diff --git a/yql/essentials/tests/sql/suites/params/input.txt b/yql/essentials/tests/sql/suites/params/input.txt
new file mode 100644
index 0000000000..96d1fdd0ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/input.txt
@@ -0,0 +1,3 @@
+{"key"="foo";"subkey"="bar";"value"="wat"};
+{"key"="bar";"subkey"="wat";"value"="wtf"};
+{"key"="wtf";"subkey"="foo";"value"="bar"};
diff --git a/yql/essentials/tests/sql/suites/params/list.cfg b/yql/essentials/tests/sql/suites/params/list.cfg
new file mode 100644
index 0000000000..b50f6435a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/list.cfg
@@ -0,0 +1 @@
+param $x p_list.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/list.sql b/yql/essentials/tests/sql/suites/params/list.sql
new file mode 100644
index 0000000000..af4a6f4023
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/list.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+declare $x as List<String?>;
+select ListLength($x), $x[0], $x[1], $x[2], $x[3];
diff --git a/yql/essentials/tests/sql/suites/params/missing_param_fail.cfg b/yql/essentials/tests/sql/suites/params/missing_param_fail.cfg
new file mode 100644
index 0000000000..6fdcfa62be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/missing_param_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+param $x p_int64.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/missing_param_fail.sql b/yql/essentials/tests/sql/suites/params/missing_param_fail.sql
new file mode 100644
index 0000000000..65aa3ded37
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/missing_param_fail.sql
@@ -0,0 +1,3 @@
+declare $x as int;
+declare $y as int;
+select $x + $y;
diff --git a/yql/essentials/tests/sql/suites/params/no_optional_param.sql b/yql/essentials/tests/sql/suites/params/no_optional_param.sql
new file mode 100644
index 0000000000..db481d0094
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/no_optional_param.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+declare $x as Uint32?;
+select 2 * coalesce($x, 33);
diff --git a/yql/essentials/tests/sql/suites/params/no_params_fail.cfg b/yql/essentials/tests/sql/suites/params/no_params_fail.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/no_params_fail.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/no_params_fail.sql b/yql/essentials/tests/sql/suites/params/no_params_fail.sql
new file mode 100644
index 0000000000..9144f91e92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/no_params_fail.sql
@@ -0,0 +1,2 @@
+declare $x as int;
+select 2 * $x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_bool.json b/yql/essentials/tests/sql/suites/params/p_bool.json
new file mode 100644
index 0000000000..f32a5804e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_bool.json
@@ -0,0 +1 @@
+true \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_date.json b/yql/essentials/tests/sql/suites/params/p_date.json
new file mode 100644
index 0000000000..00877b0f5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_date.json
@@ -0,0 +1 @@
+"17563" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_datetime.json b/yql/essentials/tests/sql/suites/params/p_datetime.json
new file mode 100644
index 0000000000..38a1f5ac22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_datetime.json
@@ -0,0 +1 @@
+"1517498177" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_decimal.json b/yql/essentials/tests/sql/suites/params/p_decimal.json
new file mode 100644
index 0000000000..8640e06c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_decimal.json
@@ -0,0 +1 @@
+"-9876.12345" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_dict.json b/yql/essentials/tests/sql/suites/params/p_dict.json
new file mode 100644
index 0000000000..524df1fc93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_dict.json
@@ -0,0 +1 @@
+[["a1", "765"], ["a2", null]] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_dict2.json b/yql/essentials/tests/sql/suites/params/p_dict2.json
new file mode 100644
index 0000000000..2545ff38f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_dict2.json
@@ -0,0 +1 @@
+{"a1": "765", "a2": null} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_double.json b/yql/essentials/tests/sql/suites/params/p_double.json
new file mode 100644
index 0000000000..d37de39b8f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_double.json
@@ -0,0 +1 @@
+"-567.1234" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_int64.json b/yql/essentials/tests/sql/suites/params/p_int64.json
new file mode 100644
index 0000000000..45239526ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_int64.json
@@ -0,0 +1 @@
+"-21" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_interval.json b/yql/essentials/tests/sql/suites/params/p_interval.json
new file mode 100644
index 0000000000..80444e5c5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_interval.json
@@ -0,0 +1 @@
+"-2509261088556" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_json.json b/yql/essentials/tests/sql/suites/params/p_json.json
new file mode 100644
index 0000000000..b77a55d7d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_json.json
@@ -0,0 +1 @@
+"{\"b\": 321}" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_list.json b/yql/essentials/tests/sql/suites/params/p_list.json
new file mode 100644
index 0000000000..966d2f232e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_list.json
@@ -0,0 +1 @@
+["a1", null, "a2"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_null.json b/yql/essentials/tests/sql/suites/params/p_null.json
new file mode 100644
index 0000000000..ec747fa47d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_null.json
@@ -0,0 +1 @@
+null \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_number_list.json b/yql/essentials/tests/sql/suites/params/p_number_list.json
new file mode 100644
index 0000000000..fc4de450de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_number_list.json
@@ -0,0 +1 @@
+["1", "2", "3"]
diff --git a/yql/essentials/tests/sql/suites/params/p_string.json b/yql/essentials/tests/sql/suites/params/p_string.json
new file mode 100644
index 0000000000..0f53da34fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_string.json
@@ -0,0 +1 @@
+"Moscow!" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_string_bin.json b/yql/essentials/tests/sql/suites/params/p_string_bin.json
new file mode 100644
index 0000000000..bcd48de1af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_string_bin.json
@@ -0,0 +1 @@
+["AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_string_ru.json b/yql/essentials/tests/sql/suites/params/p_string_ru.json
new file mode 100644
index 0000000000..4cc3538906
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_string_ru.json
@@ -0,0 +1 @@
+"Moscow Привет!" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_struct.json b/yql/essentials/tests/sql/suites/params/p_struct.json
new file mode 100644
index 0000000000..f4670c9c63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_struct.json
@@ -0,0 +1 @@
+{"a": "42", "b": "\u043f\u0438\u0443-\u043f\u0438\u0443"} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_timestamp.json b/yql/essentials/tests/sql/suites/params/p_timestamp.json
new file mode 100644
index 0000000000..f9655df825
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_timestamp.json
@@ -0,0 +1 @@
+"1517498177034567" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_tuple1.json b/yql/essentials/tests/sql/suites/params/p_tuple1.json
new file mode 100644
index 0000000000..6da1e94df1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_tuple1.json
@@ -0,0 +1 @@
+["a1", "765"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_tuple2.json b/yql/essentials/tests/sql/suites/params/p_tuple2.json
new file mode 100644
index 0000000000..cbca0f6c6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_tuple2.json
@@ -0,0 +1 @@
+["a2", null] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_tzdate.json b/yql/essentials/tests/sql/suites/params/p_tzdate.json
new file mode 100644
index 0000000000..2754f54f59
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_tzdate.json
@@ -0,0 +1 @@
+"2018-02-01,America/Los_Angeles" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_tzdatetime.json b/yql/essentials/tests/sql/suites/params/p_tzdatetime.json
new file mode 100644
index 0000000000..cd6da4aab5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_tzdatetime.json
@@ -0,0 +1 @@
+"2018-02-01T15:16:17,Europe/Moscow" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_tztimestamp.json b/yql/essentials/tests/sql/suites/params/p_tztimestamp.json
new file mode 100644
index 0000000000..da2fb8656c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_tztimestamp.json
@@ -0,0 +1 @@
+"2018-02-01T15:16:17.034567,GMT" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_uint64.json b/yql/essentials/tests/sql/suites/params/p_uint64.json
new file mode 100644
index 0000000000..3e71fa1475
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_uint64.json
@@ -0,0 +1 @@
+"21" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_uuid.json b/yql/essentials/tests/sql/suites/params/p_uuid.json
new file mode 100644
index 0000000000..505d02b045
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_uuid.json
@@ -0,0 +1 @@
+["AIQOVZvi1EGnFkRmVUQAAA=="] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_variant1.json b/yql/essentials/tests/sql/suites/params/p_variant1.json
new file mode 100644
index 0000000000..7c32328715
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_variant1.json
@@ -0,0 +1 @@
+["0", "abc"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_variant2.json b/yql/essentials/tests/sql/suites/params/p_variant2.json
new file mode 100644
index 0000000000..8d709a2855
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_variant2.json
@@ -0,0 +1 @@
+["1", "789"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_variant3.json b/yql/essentials/tests/sql/suites/params/p_variant3.json
new file mode 100644
index 0000000000..1240fbbeb4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_variant3.json
@@ -0,0 +1 @@
+["0", "hehe"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_variant4.json b/yql/essentials/tests/sql/suites/params/p_variant4.json
new file mode 100644
index 0000000000..b614005aa3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_variant4.json
@@ -0,0 +1 @@
+["1", "119"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_variant5.json b/yql/essentials/tests/sql/suites/params/p_variant5.json
new file mode 100644
index 0000000000..73a83a951a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_variant5.json
@@ -0,0 +1 @@
+[["a"], "foo"] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_yson.json b/yql/essentials/tests/sql/suites/params/p_yson.json
new file mode 100644
index 0000000000..2f5ffff984
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_yson.json
@@ -0,0 +1 @@
+{"a": 123} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/p_yson2.json b/yql/essentials/tests/sql/suites/params/p_yson2.json
new file mode 100644
index 0000000000..6239a99bac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/p_yson2.json
@@ -0,0 +1,101 @@
+# import yt.yson as yson
+# bin_str = ''.join(map(chr, xrange(0, 255)))
+# s = yson.YsonString(bin_str)
+# s.attributes = yson.YsonMap({
+# 'a1': yson.YsonString('oops'),
+# 'a2': yson.YsonList([yson.YsonUint64(876), yson.YsonString('boom')])
+# })
+#
+# y = yson.YsonMap(
+# {
+# 'a': yson.YsonBoolean(True),
+# 'b': yson.YsonBoolean(False),
+# 'c': yson.YsonString('hello Ìîñêâà'),
+# 'd': s,
+# 'x': yson.YsonDouble(-1.34),
+# 'y': yson.YsonDouble(float('nan')),
+# 'v': yson.YsonEntity(),
+# '$z': yson.YsonDouble(float('-inf')),
+# '$t': yson.YsonDouble(float('inf')),
+# '$$$e': yson.YsonMap(
+# {
+# '$f': yson.YsonString('hehe'),
+# '$$g': yson.YsonList([yson.YsonEntity(), yson.YsonInt64(-12345), yson.YsonUint64(9876)])
+# }
+# )
+# }
+# )
+#
+# x = YqlParameterValueBuilder.make_yson(y)
+# t = json.dumps(x.to_json(), sort_keys=True, indent=4)
+# import sys
+# sys.stderr.write(t)
+
+{
+ "$$$$e": {
+ "$$$g": [
+ null,
+ {
+ "$type": "int64",
+ "$value": "-12345"
+ },
+ {
+ "$type": "uint64",
+ "$value": "9876"
+ }
+ ],
+ "$$f": {
+ "$type": "string",
+ "$value": "hehe"
+ }
+ },
+ "$$t": {
+ "$type": "double",
+ "$value": "inf"
+ },
+ "$$z": {
+ "$type": "double",
+ "$value": "-inf"
+ },
+ "a": {
+ "$type": "boolean",
+ "$value": "true"
+ },
+ "b": {
+ "$type": "boolean",
+ "$value": "false"
+ },
+ "c": {
+ "$type": "string",
+ "$value": "hello \u00d0\u009c\u00d0\u00be\u00d1\u0081\u00d0\u00ba\u00d0\u00b2\u00d0\u00b0"
+ },
+ "d": {
+ "$attributes": {
+ "a1": {
+ "$type": "string",
+ "$value": "oops"
+ },
+ "a2": [
+ {
+ "$type": "uint64",
+ "$value": "876"
+ },
+ {
+ "$type": "string",
+ "$value": "boom"
+ }
+ ]
+ },
+ "$type": "string",
+ "$value": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008a\u008b\u008c\u008d\u008e\u008f\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009a\u009b\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe"
+ },
+ "v": null,
+ "x": {
+ "$type": "double",
+ "$value": "-1.34"
+ },
+ "y": {
+ "$type": "double",
+ "$value": "nan"
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/param_in_in_predicate.cfg b/yql/essentials/tests/sql/suites/params/param_in_in_predicate.cfg
new file mode 100644
index 0000000000..0fd5347027
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_in_in_predicate.cfg
@@ -0,0 +1 @@
+param $foo p_number_list.json
diff --git a/yql/essentials/tests/sql/suites/params/param_in_in_predicate.sql b/yql/essentials/tests/sql/suites/params/param_in_in_predicate.sql
new file mode 100644
index 0000000000..ced6a53818
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_in_in_predicate.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+declare $foo as List<Int32>;
+
+select 1 in $foo, 100 in $foo;
+
diff --git a/yql/essentials/tests/sql/suites/params/param_in_json_api.cfg b/yql/essentials/tests/sql/suites/params/param_in_json_api.cfg
new file mode 100644
index 0000000000..935a7bf243
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_in_json_api.cfg
@@ -0,0 +1,6 @@
+param $input_json p_json.json
+param $int64_param p_int64.json
+param $double_param p_double.json
+param $bool_param p_bool.json
+param $string_param p_string_ru.json
+param $json_param p_json.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/param_in_json_api.sql b/yql/essentials/tests/sql/suites/params/param_in_json_api.sql
new file mode 100644
index 0000000000..714240ad4c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_in_json_api.sql
@@ -0,0 +1,45 @@
+/* syntax version 1 */
+/* postgres can not */
+
+DECLARE $input_json as Json;
+DECLARE $int64_param as Int64;
+DECLARE $double_param as Double;
+DECLARE $bool_param as Bool;
+DECLARE $string_param as Utf8;
+DECLARE $json_param as Json;
+
+SELECT
+ JSON_VALUE(
+ $input_json,
+ "strict $var"
+ PASSING
+ $int64_param as var
+ RETURNING Int64
+ ),
+ JSON_VALUE(
+ $input_json,
+ "strict $var"
+ PASSING
+ $double_param as var
+ RETURNING Double
+ ),
+ JSON_VALUE(
+ $input_json,
+ "strict $var"
+ PASSING
+ $bool_param as var
+ RETURNING Bool
+ ),
+ JSON_VALUE(
+ $input_json,
+ "strict $var"
+ PASSING
+ $string_param as var
+ RETURNING String
+ ),
+ JSON_QUERY(
+ $input_json,
+ "strict $var"
+ PASSING
+ $json_param as var
+ ); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.cfg b/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.cfg
new file mode 100644
index 0000000000..6fdcfa62be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+param $x p_int64.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.sql b/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.sql
new file mode 100644
index 0000000000..ea6e631d35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/param_type_mismatch_fail.sql
@@ -0,0 +1,2 @@
+declare $x as UInt32;
+select 2 * $x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/primitives.cfg b/yql/essentials/tests/sql/suites/params/primitives.cfg
new file mode 100644
index 0000000000..a6f7786da7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/primitives.cfg
@@ -0,0 +1,24 @@
+param $x1 p_int64.json
+param $x2 p_double.json
+param $x3 p_bool.json
+param $x4 p_double.json
+param $x5 p_string_ru.json
+param $x6 p_int64.json
+param $x7 p_uint64.json
+param $x8 p_string_bin.json
+param $x9 p_string_ru.json
+param $x10 p_uuid.json
+param $x11 p_null.json
+param $x12 p_string.json
+param $x13 p_yson.json
+param $x14 p_json.json
+param $x15 p_datetime.json
+param $x16 p_date.json
+param $x17 p_timestamp.json
+param $x18 p_interval.json
+param $x19 p_tzdatetime.json
+param $x20 p_tztimestamp.json
+param $x21 p_tzdate.json
+param $x22 p_null.json
+param $x23 p_decimal.json
+udf unicode_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/primitives.sql b/yql/essentials/tests/sql/suites/params/primitives.sql
new file mode 100644
index 0000000000..42aeef5bab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/primitives.sql
@@ -0,0 +1,30 @@
+/* syntax version 1 */
+declare $x1 as int;
+declare $x2 as Double;
+declare $x3 as Bool;
+declare $x4 as Float;
+declare $x5 as String; -- unicode
+declare $x6 as Int64;
+declare $x7 as Uint64;
+declare $x8 as String; -- binary
+declare $x9 as Utf8;
+declare $x10 as Uuid;
+declare $x11 as String?; -- null
+declare $x12 as String?; -- not null
+declare $x13 as Yson;
+declare $x14 as Json;
+declare $x15 as datetime;
+declare $x16 as date;
+declare $x17 as timestamp;
+declare $x18 as interval;
+declare $x19 as tzdatetime;
+declare $x20 as tztimestamp;
+declare $x21 as tzdate;
+declare $x22 as Void;
+declare $x23 as Decimal(21,8);
+select 2 * $x1, -$x2 * 10, not $x3, -$x4, $x5 || "2018", -$x6, $x7 + 1, Length($x8),
+ Unicode::GetLength($x9), cast($x10 as string), coalesce($x11, "XYZ"), coalesce($x12, "XYZ"),
+ Yson::LookupInt64($x13, 'a'), Yson::ConvertToInt64($x14.b),
+ cast($x15 as string), cast($x16 as string), cast($x17 as string), cast($x18 as string),
+ cast($x19 as string), cast($x20 as string), cast($x21 as string),
+ $x22, cast($x23 as string);
diff --git a/yql/essentials/tests/sql/suites/params/struct.cfg b/yql/essentials/tests/sql/suites/params/struct.cfg
new file mode 100644
index 0000000000..598bded49e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/struct.cfg
@@ -0,0 +1 @@
+param $x p_struct.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/struct.sql b/yql/essentials/tests/sql/suites/params/struct.sql
new file mode 100644
index 0000000000..01b450ece3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/struct.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+declare $x as Struct<a:Int64, b:String?>;
+select cast($x.a as String) || coalesce($x.b, "zzz");
diff --git a/yql/essentials/tests/sql/suites/params/tuple.cfg b/yql/essentials/tests/sql/suites/params/tuple.cfg
new file mode 100644
index 0000000000..731cd63af9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/tuple.cfg
@@ -0,0 +1,2 @@
+param $x1 p_tuple1.json
+param $x2 p_tuple2.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/tuple.sql b/yql/essentials/tests/sql/suites/params/tuple.sql
new file mode 100644
index 0000000000..783a7336dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/tuple.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+declare $x1 as Tuple<String, Int64?>;
+declare $x2 as Tuple<String, Int64?>;
+$a, $b = $x1;
+
+select $a, $b, $x2.0, $x2.1;
diff --git a/yql/essentials/tests/sql/suites/params/variant.cfg b/yql/essentials/tests/sql/suites/params/variant.cfg
new file mode 100644
index 0000000000..63ac903276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/variant.cfg
@@ -0,0 +1,5 @@
+param $x1 p_variant1.json
+param $x2 p_variant2.json
+param $x3 p_variant3.json
+param $x4 p_variant4.json
+param $x5 p_variant5.json \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/params/variant.sql b/yql/essentials/tests/sql/suites/params/variant.sql
new file mode 100644
index 0000000000..cd7c477a61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/params/variant.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+
+-- underlying type is tuple
+declare $x1 as Variant<String, Int64>;
+declare $x2 as Variant<String, Int64>;
+
+-- underlying type is struct
+declare $x3 as Variant<a:String, b:Int64>;
+declare $x4 as Variant<a:String, b:Int64>;
+declare $x5 as Variant<a:String, b:Int64>;
+
+select $x1.0 || cast($x2.1 as String) || $x3.a || cast($x4.b as String) || $x5.a;
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt b/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt.attr
new file mode 100644
index 0000000000..397a5b6105
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/call_center.txt.attr
@@ -0,0 +1,37 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cc_call_center_sk";["PgType";"int4";];];
+ ["cc_call_center_id";["PgType";"text";];];
+ ["cc_rec_start_date";["PgType";"date";];];
+ ["cc_rec_end_date";["PgType";"date";];];
+ ["cc_closed_date_sk";["PgType";"int4";];];
+ ["cc_open_date_sk";["PgType";"int4";];];
+ ["cc_name";["PgType";"text";];];
+ ["cc_class";["PgType";"text";];];
+ ["cc_employees";["PgType";"int4";];];
+ ["cc_sq_ft";["PgType";"int4";];];
+ ["cc_hours";["PgType";"text";];];
+ ["cc_manager";["PgType";"text";];];
+ ["cc_mkt_id";["PgType";"int4";];];
+ ["cc_mkt_class";["PgType";"text";];];
+ ["cc_mkt_desc";["PgType";"text";];];
+ ["cc_market_manager";["PgType";"text";];];
+ ["cc_division";["PgType";"int4";];];
+ ["cc_division_name";["PgType";"text";];];
+ ["cc_company";["PgType";"int4";];];
+ ["cc_company_name";["PgType";"text";];];
+ ["cc_street_number";["PgType";"text";];];
+ ["cc_street_name";["PgType";"text";];];
+ ["cc_street_type";["PgType";"text";];];
+ ["cc_suite_number";["PgType";"text";];];
+ ["cc_city";["PgType";"text";];];
+ ["cc_county";["PgType";"text";];];
+ ["cc_state";["PgType";"text";];];
+ ["cc_zip";["PgType";"text";];];
+ ["cc_country";["PgType";"text";];];
+ ["cc_gmt_offset";["PgType";"numeric";];];
+ ["cc_tax_percentage";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt.attr
new file mode 100644
index 0000000000..1de2694081
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_page.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cp_catalog_page_sk";["PgType";"int4";];];
+ ["cp_catalog_page_id";["PgType";"text";];];
+ ["cp_start_date_sk";["PgType";"int4";];];
+ ["cp_end_date_sk";["PgType";"int4";];];
+ ["cp_department";["PgType";"text";];];
+ ["cp_catalog_number";["PgType";"int4";];];
+ ["cp_catalog_page_number";["PgType";"int4";];];
+ ["cp_description";["PgType";"text";];];
+ ["cp_type";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt.attr
new file mode 100644
index 0000000000..209677594f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_returns.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cr_returned_date_sk";["PgType";"int4";];];
+ ["cr_returned_time_sk";["PgType";"int4";];];
+ ["cr_item_sk";["PgType";"int4";];];
+ ["cr_refunded_customer_sk";["PgType";"int4";];];
+ ["cr_refunded_cdemo_sk";["PgType";"int4";];];
+ ["cr_refunded_hdemo_sk";["PgType";"int4";];];
+ ["cr_refunded_addr_sk";["PgType";"int4";];];
+ ["cr_returning_customer_sk";["PgType";"int4";];];
+ ["cr_returning_cdemo_sk";["PgType";"int4";];];
+ ["cr_returning_hdemo_sk";["PgType";"int4";];];
+ ["cr_returning_addr_sk";["PgType";"int4";];];
+ ["cr_call_center_sk";["PgType";"int4";];];
+ ["cr_catalog_page_sk";["PgType";"int4";];];
+ ["cr_ship_mode_sk";["PgType";"int4";];];
+ ["cr_warehouse_sk";["PgType";"int4";];];
+ ["cr_reason_sk";["PgType";"int4";];];
+ ["cr_order_number";["PgType";"int4";];];
+ ["cr_return_quantity";["PgType";"int4";];];
+ ["cr_return_amount";["PgType";"numeric";];];
+ ["cr_return_tax";["PgType";"numeric";];];
+ ["cr_return_amt_inc_tax";["PgType";"numeric";];];
+ ["cr_fee";["PgType";"numeric";];];
+ ["cr_return_ship_cost";["PgType";"numeric";];];
+ ["cr_refunded_cash";["PgType";"numeric";];];
+ ["cr_reversed_charge";["PgType";"numeric";];];
+ ["cr_store_credit";["PgType";"numeric";];];
+ ["cr_net_loss";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt.attr
new file mode 100644
index 0000000000..3765f24437
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/catalog_sales.txt.attr
@@ -0,0 +1,40 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cs_sold_date_sk";["PgType";"int4";];];
+ ["cs_sold_time_sk";["PgType";"int4";];];
+ ["cs_ship_date_sk";["PgType";"int4";];];
+ ["cs_bill_customer_sk";["PgType";"int4";];];
+ ["cs_bill_cdemo_sk";["PgType";"int4";];];
+ ["cs_bill_hdemo_sk";["PgType";"int4";];];
+ ["cs_bill_addr_sk";["PgType";"int4";];];
+ ["cs_ship_customer_sk";["PgType";"int4";];];
+ ["cs_ship_cdemo_sk";["PgType";"int4";];];
+ ["cs_ship_hdemo_sk";["PgType";"int4";];];
+ ["cs_ship_addr_sk";["PgType";"int4";];];
+ ["cs_call_center_sk";["PgType";"int4";];];
+ ["cs_catalog_page_sk";["PgType";"int4";];];
+ ["cs_ship_mode_sk";["PgType";"int4";];];
+ ["cs_warehouse_sk";["PgType";"int4";];];
+ ["cs_item_sk";["PgType";"int4";];];
+ ["cs_promo_sk";["PgType";"int4";];];
+ ["cs_order_number";["PgType";"int4";];];
+ ["cs_quantity";["PgType";"int4";];];
+ ["cs_wholesale_cost";["PgType";"numeric";];];
+ ["cs_list_price";["PgType";"numeric";];];
+ ["cs_sales_price";["PgType";"numeric";];];
+ ["cs_ext_discount_amt";["PgType";"numeric";];];
+ ["cs_ext_sales_price";["PgType";"numeric";];];
+ ["cs_ext_wholesale_cost";["PgType";"numeric";];];
+ ["cs_ext_list_price";["PgType";"numeric";];];
+ ["cs_ext_tax";["PgType";"numeric";];];
+ ["cs_coupon_amt";["PgType";"numeric";];];
+ ["cs_ext_ship_cost";["PgType";"numeric";];];
+ ["cs_net_paid";["PgType";"numeric";];];
+ ["cs_net_paid_inc_tax";["PgType";"numeric";];];
+ ["cs_net_paid_inc_ship";["PgType";"numeric";];];
+ ["cs_net_paid_inc_ship_tax";["PgType";"numeric";];];
+ ["cs_net_profit";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt b/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt.attr
new file mode 100644
index 0000000000..0994cf7951
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer.txt.attr
@@ -0,0 +1,24 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["c_customer_sk";["PgType";"int4";];];
+ ["c_customer_id";["PgType";"text";];];
+ ["c_current_cdemo_sk";["PgType";"int4";];];
+ ["c_current_hdemo_sk";["PgType";"int4";];];
+ ["c_current_addr_sk";["PgType";"int4";];];
+ ["c_first_shipto_date_sk";["PgType";"int4";];];
+ ["c_first_sales_date_sk";["PgType";"int4";];];
+ ["c_salutation";["PgType";"text";];];
+ ["c_first_name";["PgType";"text";];];
+ ["c_last_name";["PgType";"text";];];
+ ["c_preferred_cust_flag";["PgType";"text";];];
+ ["c_birth_day";["PgType";"int4";];];
+ ["c_birth_month";["PgType";"int4";];];
+ ["c_birth_year";["PgType";"int4";];];
+ ["c_birth_country";["PgType";"text";];];
+ ["c_login";["PgType";"text";];];
+ ["c_email_address";["PgType";"text";];];
+ ["c_last_review_date";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt b/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt.attr
new file mode 100644
index 0000000000..6bd1ce06c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer_address.txt.attr
@@ -0,0 +1,19 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ca_address_sk";["PgType";"int4";];];
+ ["ca_address_id";["PgType";"text";];];
+ ["ca_street_number";["PgType";"text";];];
+ ["ca_street_name";["PgType";"text";];];
+ ["ca_street_type";["PgType";"text";];];
+ ["ca_suite_number";["PgType";"text";];];
+ ["ca_city";["PgType";"text";];];
+ ["ca_county";["PgType";"text";];];
+ ["ca_state";["PgType";"text";];];
+ ["ca_zip";["PgType";"text";];];
+ ["ca_country";["PgType";"text";];];
+ ["ca_gmt_offset";["PgType";"numeric";];];
+ ["ca_location_type";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt b/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt.attr
new file mode 100644
index 0000000000..6f106de2a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/customer_demographics.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["cd_demo_sk";["PgType";"int4";];];
+ ["cd_gender";["PgType";"text";];];
+ ["cd_marital_status";["PgType";"text";];];
+ ["cd_education_status";["PgType";"text";];];
+ ["cd_purchase_estimate";["PgType";"int4";];];
+ ["cd_credit_rating";["PgType";"text";];];
+ ["cd_dep_count";["PgType";"int4";];];
+ ["cd_dep_employed_count";["PgType";"int4";];];
+ ["cd_dep_college_count";["PgType";"int4";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt b/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt.attr
new file mode 100644
index 0000000000..fcead9adcc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/date_dim.txt.attr
@@ -0,0 +1,34 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["d_date_sk";["PgType";"int4";];];
+ ["d_date_id";["PgType";"text";];];
+ ["d_date";["PgType";"date";];];
+ ["d_month_seq";["PgType";"int4";];];
+ ["d_week_seq";["PgType";"int4";];];
+ ["d_quarter_seq";["PgType";"int4";];];
+ ["d_year";["PgType";"int4";];];
+ ["d_dow";["PgType";"int4";];];
+ ["d_moy";["PgType";"int4";];];
+ ["d_dom";["PgType";"int4";];];
+ ["d_qoy";["PgType";"int4";];];
+ ["d_fy_year";["PgType";"int4";];];
+ ["d_fy_quarter_seq";["PgType";"int4";];];
+ ["d_fy_week_seq";["PgType";"int4";];];
+ ["d_day_name";["PgType";"text";];];
+ ["d_quarter_name";["PgType";"text";];];
+ ["d_holiday";["PgType";"text";];];
+ ["d_weekend";["PgType";"text";];];
+ ["d_following_holiday";["PgType";"text";];];
+ ["d_first_dom";["PgType";"int4";];];
+ ["d_last_dom";["PgType";"int4";];];
+ ["d_same_day_ly";["PgType";"int4";];];
+ ["d_same_day_lq";["PgType";"int4";];];
+ ["d_current_day";["PgType";"text";];];
+ ["d_current_week";["PgType";"text";];];
+ ["d_current_month";["PgType";"text";];];
+ ["d_current_quarter";["PgType";"text";];];
+ ["d_current_year";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/default.cfg b/yql/essentials/tests/sql/suites/pg-tpcds/default.cfg
new file mode 100644
index 0000000000..67c1396cb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/default.cfg
@@ -0,0 +1,24 @@
+in call_center call_center.txt
+in catalog_page catalog_page.txt
+in catalog_returns catalog_returns.txt
+in catalog_sales catalog_sales.txt
+in customer customer.txt
+in customer_address customer_address.txt
+in customer_demographics customer_demographics.txt
+in date_dim date_dim.txt
+in household_demographics household_demographics.txt
+in income_band income_band.txt
+in inventory inventory.txt
+in item item.txt
+in promotion promotion.txt
+in reason reason.txt
+in ship_mode ship_mode.txt
+in store store.txt
+in store_returns store_returns.txt
+in store_sales store_sales.txt
+in time_dim time_dim.txt
+in warehouse warehouse.txt
+in web_page web_page.txt
+in web_returns web_returns.txt
+in web_sales web_sales.txt
+in web_site web_site.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt b/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt.attr
new file mode 100644
index 0000000000..c8ab25eb6d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/household_demographics.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["hd_demo_sk";["PgType";"int4";];];
+ ["hd_income_band_sk";["PgType";"int4";];];
+ ["hd_buy_potential";["PgType";"text";];];
+ ["hd_dep_count";["PgType";"int4";];];
+ ["hd_vehicle_count";["PgType";"int4";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt b/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt.attr
new file mode 100644
index 0000000000..63310508f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/income_band.txt.attr
@@ -0,0 +1,9 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ib_income_band_sk";["PgType";"int4";];];
+ ["ib_lower_bound";["PgType";"int4";];];
+ ["ib_upper_bound";["PgType";"int4";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt b/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt.attr
new file mode 100644
index 0000000000..95f22bfd71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/inventory.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["inv_date_sk";["PgType";"int4";];];
+ ["inv_item_sk";["PgType";"int4";];];
+ ["inv_warehouse_sk";["PgType";"int4";];];
+ ["inv_quantity_on_hand";["PgType";"int4";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/item.txt b/yql/essentials/tests/sql/suites/pg-tpcds/item.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/item.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/item.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/item.txt.attr
new file mode 100644
index 0000000000..9d103928f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/item.txt.attr
@@ -0,0 +1,28 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["i_item_sk";["PgType";"int4";];];
+ ["i_item_id";["PgType";"text";];];
+ ["i_rec_start_date";["PgType";"date";];];
+ ["i_rec_end_date";["PgType";"date";];];
+ ["i_item_desc";["PgType";"text";];];
+ ["i_current_price";["PgType";"numeric";];];
+ ["i_wholesale_cost";["PgType";"numeric";];];
+ ["i_brand_id";["PgType";"int4";];];
+ ["i_brand";["PgType";"text";];];
+ ["i_class_id";["PgType";"int4";];];
+ ["i_class";["PgType";"text";];];
+ ["i_category_id";["PgType";"int4";];];
+ ["i_category";["PgType";"text";];];
+ ["i_manufact_id";["PgType";"int4";];];
+ ["i_manufact";["PgType";"text";];];
+ ["i_size";["PgType";"text";];];
+ ["i_formulation";["PgType";"text";];];
+ ["i_color";["PgType";"text";];];
+ ["i_units";["PgType";"text";];];
+ ["i_container";["PgType";"text";];];
+ ["i_manager_id";["PgType";"int4";];];
+ ["i_product_name";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt b/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt.attr
new file mode 100644
index 0000000000..7db23f7b1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/promotion.txt.attr
@@ -0,0 +1,25 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["p_promo_sk";["PgType";"int4";];];
+ ["p_promo_id";["PgType";"text";];];
+ ["p_start_date_sk";["PgType";"int4";];];
+ ["p_end_date_sk";["PgType";"int4";];];
+ ["p_item_sk";["PgType";"int4";];];
+ ["p_cost";["PgType";"numeric";];];
+ ["p_response_target";["PgType";"int4";];];
+ ["p_promo_name";["PgType";"text";];];
+ ["p_channel_dmail";["PgType";"text";];];
+ ["p_channel_email";["PgType";"text";];];
+ ["p_channel_catalog";["PgType";"text";];];
+ ["p_channel_tv";["PgType";"text";];];
+ ["p_channel_radio";["PgType";"text";];];
+ ["p_channel_press";["PgType";"text";];];
+ ["p_channel_event";["PgType";"text";];];
+ ["p_channel_demo";["PgType";"text";];];
+ ["p_channel_details";["PgType";"text";];];
+ ["p_purpose";["PgType";"text";];];
+ ["p_discount_active";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q01.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q01.sql
new file mode 100644
index 0000000000..7e40034da4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q01.sql
@@ -0,0 +1,28 @@
+--!syntax_pg
+--TPC-DS Q1
+
+-- start query 1 in stream 0 using template ../query_templates/query1.tpl
+with customer_total_return as
+(select sr_customer_sk as ctr_customer_sk
+,sr_store_sk as ctr_store_sk
+,sum(sr_fee) as ctr_total_return
+from plato.store_returns
+,plato.date_dim
+where sr_returned_date_sk = d_date_sk
+and d_year =2000
+group by sr_customer_sk
+,sr_store_sk)
+ select c_customer_id
+from customer_total_return ctr1
+,plato.store
+,plato.customer
+where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2::numeric
+from customer_total_return ctr2
+where ctr1.ctr_store_sk = ctr2.ctr_store_sk)
+and s_store_sk = ctr1.ctr_store_sk
+and s_state = 'TN'
+and ctr1.ctr_customer_sk = c_customer_sk
+order by c_customer_id
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query1.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q02.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q02.sql
new file mode 100644
index 0000000000..0b1e03a631
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q02.sql
@@ -0,0 +1,63 @@
+--!syntax_pg
+--TPC-DS Q2
+
+-- start query 1 in stream 0 using template ../query_templates/query2.tpl
+with wscs as
+ (select sold_date_sk
+ ,sales_price
+ from (select ws_sold_date_sk sold_date_sk
+ ,ws_ext_sales_price sales_price
+ from plato.web_sales
+ union all
+ select cs_sold_date_sk sold_date_sk
+ ,cs_ext_sales_price sales_price
+ from plato.catalog_sales) a),
+ wswscs as
+ (select d_week_seq,
+ sum(case when (d_day_name='Sunday') then sales_price else null::numeric end) sun_sales,
+ sum(case when (d_day_name='Monday') then sales_price else null::numeric end) mon_sales,
+ sum(case when (d_day_name='Tuesday') then sales_price else null::numeric end) tue_sales,
+ sum(case when (d_day_name='Wednesday') then sales_price else null::numeric end) wed_sales,
+ sum(case when (d_day_name='Thursday') then sales_price else null::numeric end) thu_sales,
+ sum(case when (d_day_name='Friday') then sales_price else null::numeric end) fri_sales,
+ sum(case when (d_day_name='Saturday') then sales_price else null::numeric end) sat_sales
+ from wscs
+ ,plato.date_dim
+ where d_date_sk = sold_date_sk
+ group by d_week_seq)
+ select d_week_seq1
+ ,round(sun_sales1/sun_sales2,2) r1
+ ,round(mon_sales1/mon_sales2,2) r2
+ ,round(tue_sales1/tue_sales2,2) r3
+ ,round(wed_sales1/wed_sales2,2) r4
+ ,round(thu_sales1/thu_sales2,2) r5
+ ,round(fri_sales1/fri_sales2,2) r6
+ ,round(sat_sales1/sat_sales2,2) r7
+ from
+ (select wswscs.d_week_seq d_week_seq1
+ ,sun_sales sun_sales1
+ ,mon_sales mon_sales1
+ ,tue_sales tue_sales1
+ ,wed_sales wed_sales1
+ ,thu_sales thu_sales1
+ ,fri_sales fri_sales1
+ ,sat_sales sat_sales1
+ from wswscs,plato.date_dim
+ where date_dim.d_week_seq = wswscs.d_week_seq and
+ d_year = 2001) y,
+ (select wswscs.d_week_seq d_week_seq2
+ ,sun_sales sun_sales2
+ ,mon_sales mon_sales2
+ ,tue_sales tue_sales2
+ ,wed_sales wed_sales2
+ ,thu_sales thu_sales2
+ ,fri_sales fri_sales2
+ ,sat_sales sat_sales2
+ from wswscs
+ ,plato.date_dim
+ where date_dim.d_week_seq = wswscs.d_week_seq and
+ d_year = 2001+1) z
+ where d_week_seq1=d_week_seq2-53
+ order by d_week_seq1;
+
+-- end query 1 in stream 0 using template ../query_templates/query2.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q03.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q03.sql
new file mode 100644
index 0000000000..58a82aad56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q03.sql
@@ -0,0 +1,24 @@
+--!syntax_pg
+--TPC-DS Q3
+
+-- start query 1 in stream 0 using template ../query_templates/query3.tpl
+select dt.d_year
+ ,item.i_brand_id brand_id
+ ,item.i_brand brand
+ ,sum(ss_ext_sales_price) sum_agg
+ from plato.date_dim dt
+ ,plato.store_sales
+ ,plato.item
+ where dt.d_date_sk = store_sales.ss_sold_date_sk
+ and store_sales.ss_item_sk = item.i_item_sk
+ and item.i_manufact_id = 436
+ and dt.d_moy=12
+ group by dt.d_year
+ ,item.i_brand
+ ,item.i_brand_id
+ order by dt.d_year
+ ,sum_agg desc
+ ,brand_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query3.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q04.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q04.sql
new file mode 100644
index 0000000000..88e5ffdb32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q04.sql
@@ -0,0 +1,119 @@
+--!syntax_pg
+--TPC-DS Q4
+
+-- start query 1 in stream 0 using template ../query_templates/query4.tpl
+with year_total as (
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,c_preferred_cust_flag customer_preferred_cust_flag
+ ,c_birth_country customer_birth_country
+ ,c_login customer_login
+ ,c_email_address customer_email_address
+ ,d_year dyear
+ ,sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2::numeric) year_total
+ ,'s' sale_type
+ from plato.customer
+ ,plato.store_sales
+ ,plato.date_dim
+ where c_customer_sk = ss_customer_sk
+ and ss_sold_date_sk = d_date_sk
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,c_preferred_cust_flag
+ ,c_birth_country
+ ,c_login
+ ,c_email_address
+ ,d_year
+ union all
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,c_preferred_cust_flag customer_preferred_cust_flag
+ ,c_birth_country customer_birth_country
+ ,c_login customer_login
+ ,c_email_address customer_email_address
+ ,d_year dyear
+ ,sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2::numeric) ) year_total
+ ,'c' sale_type
+ from plato.customer
+ ,plato.catalog_sales
+ ,plato.date_dim
+ where c_customer_sk = cs_bill_customer_sk
+ and cs_sold_date_sk = d_date_sk
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,c_preferred_cust_flag
+ ,c_birth_country
+ ,c_login
+ ,c_email_address
+ ,d_year
+union all
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,c_preferred_cust_flag customer_preferred_cust_flag
+ ,c_birth_country customer_birth_country
+ ,c_login customer_login
+ ,c_email_address customer_email_address
+ ,d_year dyear
+ ,sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2::numeric) ) year_total
+ ,'w' sale_type
+ from plato.customer
+ ,plato.web_sales
+ ,plato.date_dim
+ where c_customer_sk = ws_bill_customer_sk
+ and ws_sold_date_sk = d_date_sk
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,c_preferred_cust_flag
+ ,c_birth_country
+ ,c_login
+ ,c_email_address
+ ,d_year
+ )
+ select
+ t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_email_address
+ from year_total t_s_firstyear
+ ,year_total t_s_secyear
+ ,year_total t_c_firstyear
+ ,year_total t_c_secyear
+ ,year_total t_w_firstyear
+ ,year_total t_w_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+ and t_s_firstyear.customer_id = t_c_secyear.customer_id
+ and t_s_firstyear.customer_id = t_c_firstyear.customer_id
+ and t_s_firstyear.customer_id = t_w_firstyear.customer_id
+ and t_s_firstyear.customer_id = t_w_secyear.customer_id
+ and t_s_firstyear.sale_type = 's'
+ and t_c_firstyear.sale_type = 'c'
+ and t_w_firstyear.sale_type = 'w'
+ and t_s_secyear.sale_type = 's'
+ and t_c_secyear.sale_type = 'c'
+ and t_w_secyear.sale_type = 'w'
+ and t_s_firstyear.dyear = 2001
+ and t_s_secyear.dyear = 2001+1
+ and t_c_firstyear.dyear = 2001
+ and t_c_secyear.dyear = 2001+1
+ and t_w_firstyear.dyear = 2001
+ and t_w_secyear.dyear = 2001+1
+ and t_s_firstyear.year_total > 0::numeric
+ and t_c_firstyear.year_total > 0::numeric
+ and t_w_firstyear.year_total > 0::numeric
+ and case when t_c_firstyear.year_total > 0::numeric then t_c_secyear.year_total / t_c_firstyear.year_total else null::numeric end
+ > case when t_s_firstyear.year_total > 0::numeric then t_s_secyear.year_total / t_s_firstyear.year_total else null::numeric end
+ and case when t_c_firstyear.year_total > 0::numeric then t_c_secyear.year_total / t_c_firstyear.year_total else null::numeric end
+ > case when t_w_firstyear.year_total > 0::numeric then t_w_secyear.year_total / t_w_firstyear.year_total else null::numeric end
+ order by t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_email_address
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query4.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q05.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q05.sql
new file mode 100644
index 0000000000..9601785498
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q05.sql
@@ -0,0 +1,131 @@
+--!syntax_pg
+--TPC-DS Q5
+
+-- start query 1 in stream 0 using template ../query_templates/query5.tpl
+with ssr as
+ (select s_store_id,
+ sum(sales_price) as sales,
+ sum(profit) as profit,
+ sum(return_amt) as returns,
+ sum(net_loss) as profit_loss
+ from
+ ( select ss_store_sk as store_sk,
+ ss_sold_date_sk as date_sk,
+ ss_ext_sales_price as sales_price,
+ ss_net_profit as profit,
+ cast(0 as decimal(7,2)) as return_amt,
+ cast(0 as decimal(7,2)) as net_loss
+ from plato.store_sales
+ union all
+ select sr_store_sk as store_sk,
+ sr_returned_date_sk as date_sk,
+ cast(0 as decimal(7,2)) as sales_price,
+ cast(0 as decimal(7,2)) as profit,
+ sr_return_amt as return_amt,
+ sr_net_loss as net_loss
+ from plato.store_returns
+ ) salesreturns,
+ plato.date_dim,
+ plato.store
+ where date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '14' day)::date
+ and store_sk = s_store_sk
+ group by s_store_id)
+ ,
+ csr as
+ (select cp_catalog_page_id,
+ sum(sales_price) as sales,
+ sum(profit) as profit,
+ sum(return_amt) as returns,
+ sum(net_loss) as profit_loss
+ from
+ ( select cs_catalog_page_sk as page_sk,
+ cs_sold_date_sk as date_sk,
+ cs_ext_sales_price as sales_price,
+ cs_net_profit as profit,
+ cast(0 as decimal(7,2)) as return_amt,
+ cast(0 as decimal(7,2)) as net_loss
+ from plato.catalog_sales
+ union all
+ select cr_catalog_page_sk as page_sk,
+ cr_returned_date_sk as date_sk,
+ cast(0 as decimal(7,2)) as sales_price,
+ cast(0 as decimal(7,2)) as profit,
+ cr_return_amount as return_amt,
+ cr_net_loss as net_loss
+ from plato.catalog_returns
+ ) salesreturns,
+ plato.date_dim,
+ plato.catalog_page
+ where date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '14' day)::date
+ and page_sk = cp_catalog_page_sk
+ group by cp_catalog_page_id)
+ ,
+ wsr as
+ (select web_site_id,
+ sum(sales_price) as sales,
+ sum(profit) as profit,
+ sum(return_amt) as returns,
+ sum(net_loss) as profit_loss
+ from
+ ( select ws_web_site_sk as wsr_web_site_sk,
+ ws_sold_date_sk as date_sk,
+ ws_ext_sales_price as sales_price,
+ ws_net_profit as profit,
+ cast(0 as decimal(7,2)) as return_amt,
+ cast(0 as decimal(7,2)) as net_loss
+ from plato.web_sales
+ union all
+ select ws_web_site_sk as wsr_web_site_sk,
+ wr_returned_date_sk as date_sk,
+ cast(0 as decimal(7,2)) as sales_price,
+ cast(0 as decimal(7,2)) as profit,
+ wr_return_amt as return_amt,
+ wr_net_loss as net_loss
+ from plato.web_returns left outer join plato.web_sales on
+ ( wr_item_sk = ws_item_sk
+ and wr_order_number = ws_order_number)
+ ) salesreturns,
+ plato.date_dim,
+ plato.web_site
+ where date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '14' day)::date
+ and wsr_web_site_sk = web_site_sk
+ group by web_site_id)
+ select channel
+ , id
+ , sum(sales) as sales
+ , sum(returns) as returns
+ , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+ , 'store' || s_store_id as id
+ , sales
+ , returns
+ , (profit - profit_loss) as profit
+ from ssr
+ union all
+ select 'catalog channel' as channel
+ , 'catalog_page' || cp_catalog_page_id as id
+ , sales
+ , returns
+ , (profit - profit_loss) as profit
+ from csr
+ union all
+ select 'web channel' as channel
+ , 'web_site' || web_site_id as id
+ , sales
+ , returns
+ , (profit - profit_loss) as profit
+ from wsr
+ ) x
+ group by rollup (channel, id)
+ order by channel
+ ,id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query5.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q06.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q06.sql
new file mode 100644
index 0000000000..045e74df82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q06.sql
@@ -0,0 +1,29 @@
+--!syntax_pg
+--TPC-DS Q6
+
+-- start query 1 in stream 0 using template ../query_templates/query6.tpl
+select a.ca_state state, count(*) cnt
+ from plato.customer_address a
+ ,plato.customer c
+ ,plato.store_sales s
+ ,plato.date_dim d
+ ,plato.item i
+ where a.ca_address_sk = c.c_current_addr_sk
+ and c.c_customer_sk = s.ss_customer_sk
+ and s.ss_sold_date_sk = d.d_date_sk
+ and s.ss_item_sk = i.i_item_sk
+ and d.d_month_seq =
+ (select distinct (d_month_seq)
+ from plato.date_dim
+ where d_year = 2000
+ and d_moy = 2 )
+ and i.i_current_price > 1.2::numeric *
+ (select avg(j.i_current_price)
+ from plato.item j
+ where j.i_category = i.i_category)
+ group by a.ca_state
+ having count(*) >= 10
+ order by cnt, a.ca_state
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query6.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q07.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q07.sql
new file mode 100644
index 0000000000..909507305f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q07.sql
@@ -0,0 +1,24 @@
+--!syntax_pg
+--TPC-DS Q7
+
+-- start query 1 in stream 0 using template ../query_templates/query7.tpl
+select i_item_id,
+ avg(ss_quantity) agg1,
+ avg(ss_list_price) agg2,
+ avg(ss_coupon_amt) agg3,
+ avg(ss_sales_price) agg4
+ from plato.store_sales, plato.customer_demographics, plato.date_dim, plato.item, plato.promotion
+ where ss_sold_date_sk = d_date_sk and
+ ss_item_sk = i_item_sk and
+ ss_cdemo_sk = cd_demo_sk and
+ ss_promo_sk = p_promo_sk and
+ cd_gender = 'F' and
+ cd_marital_status = 'W' and
+ cd_education_status = 'Primary' and
+ (p_channel_email = 'N' or p_channel_event = 'N') and
+ d_year = 1998
+ group by i_item_id
+ order by i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query7.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q08.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q08.sql
new file mode 100644
index 0000000000..7041a81acc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q08.sql
@@ -0,0 +1,111 @@
+--!syntax_pg
+--TPC-DS Q8
+
+-- start query 1 in stream 0 using template ../query_templates/query8.tpl
+select s_store_name
+ ,sum(ss_net_profit)
+ from plato.store_sales
+ ,plato.date_dim
+ ,plato.store,
+ (select ca_zip
+ from (
+ SELECT substr(ca_zip,1,5) ca_zip
+ FROM plato.customer_address
+ WHERE substr(ca_zip,1,5) IN (
+ '89436','30868','65085','22977','83927','77557',
+ '58429','40697','80614','10502','32779',
+ '91137','61265','98294','17921','18427',
+ '21203','59362','87291','84093','21505',
+ '17184','10866','67898','25797','28055',
+ '18377','80332','74535','21757','29742',
+ '90885','29898','17819','40811','25990',
+ '47513','89531','91068','10391','18846',
+ '99223','82637','41368','83658','86199',
+ '81625','26696','89338','88425','32200',
+ '81427','19053','77471','36610','99823',
+ '43276','41249','48584','83550','82276',
+ '18842','78890','14090','38123','40936',
+ '34425','19850','43286','80072','79188',
+ '54191','11395','50497','84861','90733',
+ '21068','57666','37119','25004','57835',
+ '70067','62878','95806','19303','18840',
+ '19124','29785','16737','16022','49613',
+ '89977','68310','60069','98360','48649',
+ '39050','41793','25002','27413','39736',
+ '47208','16515','94808','57648','15009',
+ '80015','42961','63982','21744','71853',
+ '81087','67468','34175','64008','20261',
+ '11201','51799','48043','45645','61163',
+ '48375','36447','57042','21218','41100',
+ '89951','22745','35851','83326','61125',
+ '78298','80752','49858','52940','96976',
+ '63792','11376','53582','18717','90226',
+ '50530','94203','99447','27670','96577',
+ '57856','56372','16165','23427','54561',
+ '28806','44439','22926','30123','61451',
+ '92397','56979','92309','70873','13355',
+ '21801','46346','37562','56458','28286',
+ '47306','99555','69399','26234','47546',
+ '49661','88601','35943','39936','25632',
+ '24611','44166','56648','30379','59785',
+ '11110','14329','93815','52226','71381',
+ '13842','25612','63294','14664','21077',
+ '82626','18799','60915','81020','56447',
+ '76619','11433','13414','42548','92713',
+ '70467','30884','47484','16072','38936',
+ '13036','88376','45539','35901','19506',
+ '65690','73957','71850','49231','14276',
+ '20005','18384','76615','11635','38177',
+ '55607','41369','95447','58581','58149',
+ '91946','33790','76232','75692','95464',
+ '22246','51061','56692','53121','77209',
+ '15482','10688','14868','45907','73520',
+ '72666','25734','17959','24677','66446',
+ '94627','53535','15560','41967','69297',
+ '11929','59403','33283','52232','57350',
+ '43933','40921','36635','10827','71286',
+ '19736','80619','25251','95042','15526',
+ '36496','55854','49124','81980','35375',
+ '49157','63512','28944','14946','36503',
+ '54010','18767','23969','43905','66979',
+ '33113','21286','58471','59080','13395',
+ '79144','70373','67031','38360','26705',
+ '50906','52406','26066','73146','15884',
+ '31897','30045','61068','45550','92454',
+ '13376','14354','19770','22928','97790',
+ '50723','46081','30202','14410','20223',
+ '88500','67298','13261','14172','81410',
+ '93578','83583','46047','94167','82564',
+ '21156','15799','86709','37931','74703',
+ '83103','23054','70470','72008','49247',
+ '91911','69998','20961','70070','63197',
+ '54853','88191','91830','49521','19454',
+ '81450','89091','62378','25683','61869',
+ '51744','36580','85778','36871','48121',
+ '28810','83712','45486','67393','26935',
+ '42393','20132','55349','86057','21309',
+ '80218','10094','11357','48819','39734',
+ '40758','30432','21204','29467','30214',
+ '61024','55307','74621','11622','68908',
+ '33032','52868','99194','99900','84936',
+ '69036','99149','45013','32895','59004',
+ '32322','14933','32936','33562','72550',
+ '27385','58049','58200','16808','21360',
+ '32961','18586','79307','15492')
+ intersect
+ select ca_zip
+ from (SELECT substr(ca_zip,1,5) ca_zip,count(*) cnt
+ FROM plato.customer_address, plato.customer
+ WHERE ca_address_sk = c_current_addr_sk and
+ c_preferred_cust_flag='Y'
+ group by ca_zip
+ having count(*) > 10)A1)A2) V1
+ where ss_store_sk = s_store_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_qoy = 1 and d_year = 2002
+ and (substr(s_zip,1,2) = substr(V1.ca_zip,1,2))
+ group by s_store_name
+ order by s_store_name
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query8.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q09.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q09.sql
new file mode 100644
index 0000000000..11b75aa231
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q09.sql
@@ -0,0 +1,54 @@
+--!syntax_pg
+--TPC-DS Q9
+
+-- start query 1 in stream 0 using template ../query_templates/query9.tpl
+select case when (select count(*)
+ from plato.store_sales
+ where ss_quantity between 1 and 20) > 25437
+ then (select avg(ss_ext_discount_amt)
+ from plato.store_sales
+ where ss_quantity between 1 and 20)
+ else (select avg(ss_net_profit)
+ from plato.store_sales
+ where ss_quantity between 1 and 20) end bucket1 ,
+ case when (select count(*)
+ from plato.store_sales
+ where ss_quantity between 21 and 40) > 22746
+ then (select avg(ss_ext_discount_amt)
+ from plato.store_sales
+ where ss_quantity between 21 and 40)
+ else (select avg(ss_net_profit)
+ from plato.store_sales
+ where ss_quantity between 21 and 40) end bucket2,
+ case when (select count(*)
+ from plato.store_sales
+ where ss_quantity between 41 and 60) > 9387
+ then (select avg(ss_ext_discount_amt)
+ from plato.store_sales
+ where ss_quantity between 41 and 60)
+ else (select avg(ss_net_profit)
+ from plato.store_sales
+ where ss_quantity between 41 and 60) end bucket3,
+ case when (select count(*)
+ from plato.store_sales
+ where ss_quantity between 61 and 80) > 10098
+ then (select avg(ss_ext_discount_amt)
+ from plato.store_sales
+ where ss_quantity between 61 and 80)
+ else (select avg(ss_net_profit)
+ from plato.store_sales
+ where ss_quantity between 61 and 80) end bucket4,
+ case when (select count(*)
+ from plato.store_sales
+ where ss_quantity between 81 and 100) > 18213
+ then (select avg(ss_ext_discount_amt)
+ from plato.store_sales
+ where ss_quantity between 81 and 100)
+ else (select avg(ss_net_profit)
+ from plato.store_sales
+ where ss_quantity between 81 and 100) end bucket5
+from plato.reason
+where r_reason_sk = 1
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query9.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q10.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q10.sql
new file mode 100644
index 0000000000..4295edb76e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q10.sql
@@ -0,0 +1,62 @@
+--!syntax_pg
+--TPC-DS Q10
+
+-- start query 1 in stream 0 using template ../query_templates/query10.tpl
+select
+ cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ count(*) cnt1,
+ cd_purchase_estimate,
+ count(*) cnt2,
+ cd_credit_rating,
+ count(*) cnt3,
+ cd_dep_count,
+ count(*) cnt4,
+ cd_dep_employed_count,
+ count(*) cnt5,
+ cd_dep_college_count,
+ count(*) cnt6
+ from
+ plato.customer c,plato.customer_address ca,plato.customer_demographics
+ where
+ c.c_current_addr_sk = ca.ca_address_sk and
+ ca_county in ('Walker County','Richland County','Gaines County','Douglas County','Dona Ana County') and
+ cd_demo_sk = c.c_current_cdemo_sk and
+ exists (select *
+ from plato.store_sales,plato.date_dim
+ where c.c_customer_sk = ss_customer_sk and
+ ss_sold_date_sk = d_date_sk and
+ d_year = 2002 and
+ d_moy between 4 and 4+3) and
+ (exists (select *
+ from plato.web_sales,plato.date_dim
+ where c.c_customer_sk = ws_bill_customer_sk and
+ ws_sold_date_sk = d_date_sk and
+ d_year = 2002 and
+ d_moy between 4 ANd 4+3) or
+ exists (select *
+ from plato.catalog_sales,plato.date_dim
+ where c.c_customer_sk = cs_ship_customer_sk and
+ cs_sold_date_sk = d_date_sk and
+ d_year = 2002 and
+ d_moy between 4 and 4+3))
+ group by cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ cd_purchase_estimate,
+ cd_credit_rating,
+ cd_dep_count,
+ cd_dep_employed_count,
+ cd_dep_college_count
+ order by cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ cd_purchase_estimate,
+ cd_credit_rating,
+ cd_dep_count,
+ cd_dep_employed_count,
+ cd_dep_college_count
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query10.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q11.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q11.sql
new file mode 100644
index 0000000000..3befe397a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q11.sql
@@ -0,0 +1,84 @@
+--!syntax_pg
+--TPC-DS Q11
+
+-- start query 1 in stream 0 using template ../query_templates/query11.tpl
+with year_total as (
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,c_preferred_cust_flag customer_preferred_cust_flag
+ ,c_birth_country customer_birth_country
+ ,c_login customer_login
+ ,c_email_address customer_email_address
+ ,d_year dyear
+ ,sum(ss_ext_list_price-ss_ext_discount_amt) year_total
+ ,'s' sale_type
+ from plato.customer
+ ,plato.store_sales
+ ,plato.date_dim
+ where c_customer_sk = ss_customer_sk
+ and ss_sold_date_sk = d_date_sk
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,c_preferred_cust_flag
+ ,c_birth_country
+ ,c_login
+ ,c_email_address
+ ,d_year
+ union all
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,c_preferred_cust_flag customer_preferred_cust_flag
+ ,c_birth_country customer_birth_country
+ ,c_login customer_login
+ ,c_email_address customer_email_address
+ ,d_year dyear
+ ,sum(ws_ext_list_price-ws_ext_discount_amt) year_total
+ ,'w' sale_type
+ from plato.customer
+ ,plato.web_sales
+ ,plato.date_dim
+ where c_customer_sk = ws_bill_customer_sk
+ and ws_sold_date_sk = d_date_sk
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,c_preferred_cust_flag
+ ,c_birth_country
+ ,c_login
+ ,c_email_address
+ ,d_year
+ )
+ select
+ t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_email_address
+ from year_total t_s_firstyear
+ ,year_total t_s_secyear
+ ,year_total t_w_firstyear
+ ,year_total t_w_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+ and t_s_firstyear.customer_id = t_w_secyear.customer_id
+ and t_s_firstyear.customer_id = t_w_firstyear.customer_id
+ and t_s_firstyear.sale_type = 's'
+ and t_w_firstyear.sale_type = 'w'
+ and t_s_secyear.sale_type = 's'
+ and t_w_secyear.sale_type = 'w'
+ and t_s_firstyear.dyear = 2001
+ and t_s_secyear.dyear = 2001+1
+ and t_w_firstyear.dyear = 2001
+ and t_w_secyear.dyear = 2001+1
+ and t_s_firstyear.year_total > 0::numeric
+ and t_w_firstyear.year_total > 0::numeric
+ and case when t_w_firstyear.year_total > 0::numeric then t_w_secyear.year_total / t_w_firstyear.year_total else 0.0::numeric end
+ > case when t_s_firstyear.year_total > 0::numeric then t_s_secyear.year_total / t_s_firstyear.year_total else 0.0::numeric end
+ order by t_s_secyear.customer_id
+ ,t_s_secyear.customer_first_name
+ ,t_s_secyear.customer_last_name
+ ,t_s_secyear.customer_email_address
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query11.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q12.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q12.sql
new file mode 100644
index 0000000000..1523125711
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q12.sql
@@ -0,0 +1,37 @@
+--!syntax_pg
+--TPC-DS Q12
+
+-- start query 1 in stream 0 using template ../query_templates/query12.tpl
+select i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+ ,sum(ws_ext_sales_price) as itemrevenue
+ ,sum(ws_ext_sales_price)*100::numeric/sum(sum(ws_ext_sales_price)) over
+ (partition by i_class) as revenueratio
+from
+ plato.web_sales
+ ,plato.item
+ ,plato.date_dim
+where
+ ws_item_sk = i_item_sk
+ and i_category in ('Jewelry', 'Sports', 'Books')
+ and ws_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date)
+ and (cast('2001-01-12' as date) + interval '30' day)::date
+group by
+ i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+order by
+ i_category
+ ,i_class
+ ,i_item_id
+ ,i_item_desc
+ ,revenueratio
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query12.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q13.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q13.sql
new file mode 100644
index 0000000000..c8e8a60cc8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q13.sql
@@ -0,0 +1,55 @@
+--!syntax_pg
+--TPC-DS Q13
+
+-- start query 1 in stream 0 using template ../query_templates/query13.tpl
+select avg(ss_quantity) avg_ss_q
+ ,avg(ss_ext_sales_price) avg_ss_s
+ ,avg(ss_ext_wholesale_cost) avg_ss_w
+ ,sum(ss_ext_wholesale_cost) sum_ss_w
+ from plato.store_sales
+ ,plato.store
+ ,plato.customer_demographics
+ ,plato.household_demographics
+ ,plato.customer_address
+ ,plato.date_dim
+ where s_store_sk = ss_store_sk
+ and ss_sold_date_sk = d_date_sk and d_year = 2001
+ and((ss_hdemo_sk=hd_demo_sk
+ and cd_demo_sk = ss_cdemo_sk
+ and cd_marital_status = 'D'
+ and cd_education_status = '2 yr Degree'
+ and ss_sales_price between 100.00::numeric and 150.00::numeric
+ and hd_dep_count = 3
+ )or
+ (ss_hdemo_sk=hd_demo_sk
+ and cd_demo_sk = ss_cdemo_sk
+ and cd_marital_status = 'S'
+ and cd_education_status = 'Secondary'
+ and ss_sales_price between 50.00::numeric and 100.00::numeric
+ and hd_dep_count = 1
+ ) or
+ (ss_hdemo_sk=hd_demo_sk
+ and cd_demo_sk = ss_cdemo_sk
+ and cd_marital_status = 'W'
+ and cd_education_status = 'Advanced Degree'
+ and ss_sales_price between 150.00::numeric and 200.00::numeric
+ and hd_dep_count = 1
+ ))
+ and((ss_addr_sk = ca_address_sk
+ and ca_country = 'United States'
+ and ca_state in ('CO', 'IL', 'MN')
+ and ss_net_profit between 100::numeric and 200::numeric
+ ) or
+ (ss_addr_sk = ca_address_sk
+ and ca_country = 'United States'
+ and ca_state in ('OH', 'MT', 'NM')
+ and ss_net_profit between 150::numeric and 300::numeric
+ ) or
+ (ss_addr_sk = ca_address_sk
+ and ca_country = 'United States'
+ and ca_state in ('TX', 'MO', 'MI')
+ and ss_net_profit between 50::numeric and 250::numeric
+ ))
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query13.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q14.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q14.sql
new file mode 100644
index 0000000000..00cc9da131
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q14.sql
@@ -0,0 +1,213 @@
+--!syntax_pg
+--TPC-DS Q14
+
+-- start query 1 in stream 0 using template ../query_templates/query14.tpl
+with cross_items as
+ (select i_item_sk ss_item_sk
+ from plato.item,
+ (select iss.i_brand_id brand_id
+ ,iss.i_class_id class_id
+ ,iss.i_category_id category_id
+ from plato.store_sales
+ ,plato.item iss
+ ,plato.date_dim d1
+ where ss_item_sk = iss.i_item_sk
+ and ss_sold_date_sk = d1.d_date_sk
+ and d1.d_year between 1998 AND 1998 + 2
+ intersect
+ select ics.i_brand_id
+ ,ics.i_class_id
+ ,ics.i_category_id
+ from plato.catalog_sales
+ ,plato.item ics
+ ,plato.date_dim d2
+ where cs_item_sk = ics.i_item_sk
+ and cs_sold_date_sk = d2.d_date_sk
+ and d2.d_year between 1998 AND 1998 + 2
+ intersect
+ select iws.i_brand_id
+ ,iws.i_class_id
+ ,iws.i_category_id
+ from plato.web_sales
+ ,plato.item iws
+ ,plato.date_dim d3
+ where ws_item_sk = iws.i_item_sk
+ and ws_sold_date_sk = d3.d_date_sk
+ and d3.d_year between 1998 AND 1998 + 2) a
+ where i_brand_id = brand_id
+ and i_class_id = class_id
+ and i_category_id = category_id
+),
+ avg_sales as
+ (select avg(quantity::numeric*list_price) average_sales
+ from (select ss_quantity quantity
+ ,ss_list_price list_price
+ from plato.store_sales
+ ,plato.date_dim
+ where ss_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2
+ union all
+ select cs_quantity quantity
+ ,cs_list_price list_price
+ from plato.catalog_sales
+ ,plato.date_dim
+ where cs_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2
+ union all
+ select ws_quantity quantity
+ ,ws_list_price list_price
+ from plato.web_sales
+ ,plato.date_dim
+ where ws_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2) x)
+ select channel, i_brand_id,i_class_id,i_category_id,sum(sales) sum_sales, sum(number_sales) sum_num_sales
+ from(
+ select 'store' channel, i_brand_id,i_class_id
+ ,i_category_id,sum(ss_quantity::numeric*ss_list_price) sales
+ , count(*) number_sales
+ from plato.store_sales
+ ,plato.item
+ ,plato.date_dim
+ where ss_item_sk in (select ss_item_sk from cross_items)
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year = 1998+2
+ and d_moy = 11
+ group by i_brand_id,i_class_id,i_category_id
+ having sum(ss_quantity::numeric*ss_list_price) > (select average_sales from avg_sales)
+ union all
+ select 'catalog' channel, i_brand_id,i_class_id,i_category_id, sum(cs_quantity::numeric*cs_list_price) sales, count(*) number_sales
+ from plato.catalog_sales
+ ,plato.item
+ ,plato.date_dim
+ where cs_item_sk in (select ss_item_sk from cross_items)
+ and cs_item_sk = i_item_sk
+ and cs_sold_date_sk = d_date_sk
+ and d_year = 1998+2
+ and d_moy = 11
+ group by i_brand_id,i_class_id,i_category_id
+ having sum(cs_quantity::numeric*cs_list_price) > (select average_sales from avg_sales)
+ union all
+ select 'web' channel, i_brand_id,i_class_id,i_category_id, sum(ws_quantity::numeric*ws_list_price) sales , count(*) number_sales
+ from plato.web_sales
+ ,plato.item
+ ,plato.date_dim
+ where ws_item_sk in (select ss_item_sk from cross_items)
+ and ws_item_sk = i_item_sk
+ and ws_sold_date_sk = d_date_sk
+ and d_year = 1998+2
+ and d_moy = 11
+ group by i_brand_id,i_class_id,i_category_id
+ having sum(ws_quantity::numeric*ws_list_price) > (select average_sales from avg_sales)
+ ) y
+ group by rollup (channel, i_brand_id,i_class_id,i_category_id)
+ order by channel,i_brand_id,i_class_id,i_category_id
+ limit 100;
+with cross_items as
+ (select i_item_sk ss_item_sk
+ from plato.item,
+ (select iss.i_brand_id brand_id
+ ,iss.i_class_id class_id
+ ,iss.i_category_id category_id
+ from plato.store_sales
+ ,plato.item iss
+ ,plato.date_dim d1
+ where ss_item_sk = iss.i_item_sk
+ and ss_sold_date_sk = d1.d_date_sk
+ and d1.d_year between 1998 AND 1998 + 2
+ intersect
+ select ics.i_brand_id
+ ,ics.i_class_id
+ ,ics.i_category_id
+ from plato.catalog_sales
+ ,plato.item ics
+ ,plato.date_dim d2
+ where cs_item_sk = ics.i_item_sk
+ and cs_sold_date_sk = d2.d_date_sk
+ and d2.d_year between 1998 AND 1998 + 2
+ intersect
+ select iws.i_brand_id
+ ,iws.i_class_id
+ ,iws.i_category_id
+ from plato.web_sales
+ ,plato.item iws
+ ,plato.date_dim d3
+ where ws_item_sk = iws.i_item_sk
+ and ws_sold_date_sk = d3.d_date_sk
+ and d3.d_year between 1998 AND 1998 + 2) x
+ where i_brand_id = brand_id
+ and i_class_id = class_id
+ and i_category_id = category_id
+),
+ avg_sales as
+(select avg(quantity::numeric*list_price) average_sales
+ from (select ss_quantity quantity
+ ,ss_list_price list_price
+ from plato.store_sales
+ ,plato.date_dim
+ where ss_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2
+ union all
+ select cs_quantity quantity
+ ,cs_list_price list_price
+ from plato.catalog_sales
+ ,plato.date_dim
+ where cs_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2
+ union all
+ select ws_quantity quantity
+ ,ws_list_price list_price
+ from plato.web_sales
+ ,plato.date_dim
+ where ws_sold_date_sk = d_date_sk
+ and d_year between 1998 and 1998 + 2) x)
+ select this_year.channel ty_channel
+ ,this_year.i_brand_id ty_brand
+ ,this_year.i_class_id ty_class
+ ,this_year.i_category_id ty_category
+ ,this_year.sales ty_sales
+ ,this_year.number_sales ty_number_sales
+ ,last_year.channel ly_channel
+ ,last_year.i_brand_id ly_brand
+ ,last_year.i_class_id ly_class
+ ,last_year.i_category_id ly_category
+ ,last_year.sales ly_sales
+ ,last_year.number_sales ly_number_sales
+ from
+ (select 'store' channel, i_brand_id,i_class_id,i_category_id
+ ,sum(ss_quantity::numeric*ss_list_price) sales, count(*) number_sales
+ from plato.store_sales
+ ,plato.item
+ ,plato.date_dim
+ where ss_item_sk in (select ss_item_sk from cross_items)
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_week_seq = (select d_week_seq
+ from plato.date_dim
+ where d_year = 1998 + 1
+ and d_moy = 12
+ and d_dom = 16)
+ group by i_brand_id,i_class_id,i_category_id
+ having sum(ss_quantity::numeric*ss_list_price) > (select average_sales from avg_sales)) this_year,
+ (select 'store' channel, i_brand_id,i_class_id
+ ,i_category_id, sum(ss_quantity::numeric*ss_list_price) sales, count(*) number_sales
+ from plato.store_sales
+ ,plato.item
+ ,plato.date_dim
+ where ss_item_sk in (select ss_item_sk from cross_items)
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_week_seq = (select d_week_seq
+ from plato.date_dim
+ where d_year = 1998
+ and d_moy = 12
+ and d_dom = 16)
+ group by i_brand_id,i_class_id,i_category_id
+ having sum(ss_quantity::numeric*ss_list_price) > (select average_sales from avg_sales)) last_year
+ where this_year.i_brand_id= last_year.i_brand_id
+ and this_year.i_class_id = last_year.i_class_id
+ and this_year.i_category_id = last_year.i_category_id
+ order by this_year.channel, this_year.i_brand_id, this_year.i_class_id, this_year.i_category_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query14.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q15.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q15.sql
new file mode 100644
index 0000000000..1ceca68e03
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q15.sql
@@ -0,0 +1,23 @@
+--!syntax_pg
+--TPC-DS Q15
+
+-- start query 1 in stream 0 using template ../query_templates/query15.tpl
+select ca_zip
+ ,sum(cs_sales_price)
+ from plato.catalog_sales
+ ,plato.customer
+ ,plato.customer_address
+ ,plato.date_dim
+ where cs_bill_customer_sk = c_customer_sk
+ and c_current_addr_sk = ca_address_sk
+ and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475',
+ '85392', '85460', '80348', '81792')
+ or ca_state in ('CA','WA','GA')
+ or cs_sales_price > 500::numeric)
+ and cs_sold_date_sk = d_date_sk
+ and d_qoy = 2 and d_year = 2000
+ group by ca_zip
+ order by ca_zip
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query15.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q16.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q16.sql
new file mode 100644
index 0000000000..04ad619f13
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q16.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-DS Q16
+
+-- start query 1 in stream 0 using template ../query_templates/query16.tpl
+select
+ count(distinct cs_order_number) as "order count"
+ ,sum(cs_ext_ship_cost) as "total shipping cost"
+ ,sum(cs_net_profit) as "total net profit"
+from
+ plato.catalog_sales cs1
+ ,plato.date_dim
+ ,plato.customer_address
+ ,plato.call_center
+where
+ d_date between '1999-2-01'::date and
+ (cast('1999-2-01' as date) + interval '60' day)::date
+and cs1.cs_ship_date_sk = d_date_sk
+and cs1.cs_ship_addr_sk = ca_address_sk
+and ca_state = 'IL'
+and cs1.cs_call_center_sk = cc_call_center_sk
+and cc_county in ('Williamson County','Williamson County','Williamson County','Williamson County',
+ 'Williamson County'
+)
+and exists (select *
+ from plato.catalog_sales cs2
+ where cs1.cs_order_number = cs2.cs_order_number
+ and cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
+and not exists(select *
+ from plato.catalog_returns cr1
+ where cs1.cs_order_number = cr1.cr_order_number)
+order by count(distinct cs_order_number)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query16.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q17.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q17.sql
new file mode 100644
index 0000000000..2b0a6cf476
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q17.sql
@@ -0,0 +1,48 @@
+--!syntax_pg
+--TPC-DS Q17
+
+-- start query 1 in stream 0 using template ../query_templates/query17.tpl
+select i_item_id
+ ,i_item_desc
+ ,s_state
+ ,count(ss_quantity) as store_sales_quantitycount
+ ,avg(ss_quantity) as store_sales_quantityave
+ ,stddev_samp(ss_quantity) as store_sales_quantitystdev
+ ,stddev_samp(ss_quantity)/avg(ss_quantity) as store_sales_quantitycov
+ ,count(sr_return_quantity) as store_returns_quantitycount
+ ,avg(sr_return_quantity) as store_returns_quantityave
+ ,stddev_samp(sr_return_quantity) as store_returns_quantitystdev
+ ,stddev_samp(sr_return_quantity)/avg(sr_return_quantity) as store_returns_quantitycov
+ ,count(cs_quantity) as catalog_sales_quantitycount ,avg(cs_quantity) as catalog_sales_quantityave
+ ,stddev_samp(cs_quantity) as catalog_sales_quantitystdev
+ ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitycov
+ from plato.store_sales
+ ,plato.store_returns
+ ,plato.catalog_sales
+ ,plato.date_dim d1
+ ,plato.date_dim d2
+ ,plato.date_dim d3
+ ,plato.store
+ ,plato.item
+ where d1.d_quarter_name = '1998Q1'
+ and d1.d_date_sk = ss_sold_date_sk
+ and i_item_sk = ss_item_sk
+ and s_store_sk = ss_store_sk
+ and ss_customer_sk = sr_customer_sk
+ and ss_item_sk = sr_item_sk
+ and ss_ticket_number = sr_ticket_number
+ and sr_returned_date_sk = d2.d_date_sk
+ and d2.d_quarter_name in ('1998Q1','1998Q2','1998Q3')
+ and sr_customer_sk = cs_bill_customer_sk
+ and sr_item_sk = cs_item_sk
+ and cs_sold_date_sk = d3.d_date_sk
+ and d3.d_quarter_name in ('1998Q1','1998Q2','1998Q3')
+ group by i_item_id
+ ,i_item_desc
+ ,s_state
+ order by i_item_id
+ ,i_item_desc
+ ,s_state
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query17.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q18.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q18.sql
new file mode 100644
index 0000000000..11b5a79cfb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q18.sql
@@ -0,0 +1,37 @@
+--!syntax_pg
+--TPC-DS Q18
+
+-- start query 1 in stream 0 using template ../query_templates/query18.tpl
+select i_item_id,
+ ca_country,
+ ca_state,
+ ca_county,
+ avg( cast(cs_quantity as decimal(12,2))) agg1,
+ avg( cast(cs_list_price as decimal(12,2))) agg2,
+ avg( cast(cs_coupon_amt as decimal(12,2))) agg3,
+ avg( cast(cs_sales_price as decimal(12,2))) agg4,
+ avg( cast(cs_net_profit as decimal(12,2))) agg5,
+ avg( cast(c_birth_year as decimal(12,2))) agg6,
+ avg( cast(cd1.cd_dep_count as decimal(12,2))) agg7
+ from plato.catalog_sales, plato.customer_demographics cd1,
+ plato.customer_demographics cd2, plato.customer, plato.customer_address, plato.date_dim, plato.item
+ where cs_sold_date_sk = d_date_sk and
+ cs_item_sk = i_item_sk and
+ cs_bill_cdemo_sk = cd1.cd_demo_sk and
+ cs_bill_customer_sk = c_customer_sk and
+ cd1.cd_gender = 'M' and
+ cd1.cd_education_status = 'College' and
+ c_current_cdemo_sk = cd2.cd_demo_sk and
+ c_current_addr_sk = ca_address_sk and
+ c_birth_month in (9,5,12,4,1,10) and
+ d_year = 2001 and
+ ca_state in ('ND','WI','AL'
+ ,'NC','OK','MS','TN')
+ group by rollup (i_item_id, ca_country, ca_state, ca_county)
+ order by ca_country,
+ ca_state,
+ ca_county,
+ i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query18.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q19.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q19.sql
new file mode 100644
index 0000000000..ff2d9315c8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q19.sql
@@ -0,0 +1,28 @@
+--!syntax_pg
+--TPC-DS Q19
+
+-- start query 1 in stream 0 using template ../query_templates/query19.tpl
+select i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
+ sum(ss_ext_sales_price) ext_price
+ from plato.date_dim, plato.store_sales, plato.item,plato.customer,plato.customer_address,plato.store
+ where d_date_sk = ss_sold_date_sk
+ and ss_item_sk = i_item_sk
+ and i_manager_id=7
+ and d_moy=11
+ and d_year=1999
+ and ss_customer_sk = c_customer_sk
+ and c_current_addr_sk = ca_address_sk
+ and substr(ca_zip,1,5) <> substr(s_zip,1,5)
+ and ss_store_sk = s_store_sk
+ group by i_brand
+ ,i_brand_id
+ ,i_manufact_id
+ ,i_manufact
+ order by ext_price desc
+ ,i_brand
+ ,i_brand_id
+ ,i_manufact_id
+ ,i_manufact
+limit 100 ;
+
+-- end query 1 in stream 0 using template ../query_templates/query19.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q20.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q20.sql
new file mode 100644
index 0000000000..8e1e02682f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q20.sql
@@ -0,0 +1,33 @@
+--!syntax_pg
+--TPC-DS Q20
+
+-- start query 1 in stream 0 using template ../query_templates/query20.tpl
+select i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+ ,sum(cs_ext_sales_price) as itemrevenue
+ ,sum(cs_ext_sales_price)*100::numeric/sum(sum(cs_ext_sales_price)) over
+ (partition by i_class) as revenueratio
+ from plato.catalog_sales
+ ,plato.item
+ ,plato.date_dim
+ where cs_item_sk = i_item_sk
+ and i_category in ('Jewelry', 'Sports', 'Books')
+ and cs_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date)
+ and (cast('2001-01-12' as date) + interval '30' day)::date
+ group by i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+ order by i_category
+ ,i_class
+ ,i_item_id
+ ,i_item_desc
+ ,revenueratio
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query20.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q21.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q21.sql
new file mode 100644
index 0000000000..c5eca101b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q21.sql
@@ -0,0 +1,33 @@
+--!syntax_pg
+--TPC-DS Q21
+
+-- start query 1 in stream 0 using template ../query_templates/query21.tpl
+select *
+ from(select w_warehouse_name
+ ,i_item_id
+ ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+ then inv_quantity_on_hand
+ else 0 end) as inv_before
+ ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date))
+ then inv_quantity_on_hand
+ else 0 end) as inv_after
+ from plato.inventory
+ ,plato.warehouse
+ ,plato.item
+ ,plato.date_dim
+ where i_current_price between 0.99::numeric and 1.49::numeric
+ and i_item_sk = inv_item_sk
+ and inv_warehouse_sk = w_warehouse_sk
+ and inv_date_sk = d_date_sk
+ and d_date between (cast ('1998-04-08' as date) - interval '30' day)::date
+ and (cast ('1998-04-08' as date) + interval '30' day)::date
+ group by w_warehouse_name, i_item_id) x
+ where (case when inv_before > 0
+ then inv_after / inv_before
+ else null::int8
+ end) between (2.0/3.0)::int8 and (3.0/2.0)::int8
+ order by w_warehouse_name
+ ,i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query21.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q22.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q22.sql
new file mode 100644
index 0000000000..889168511b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q22.sql
@@ -0,0 +1,23 @@
+--!syntax_pg
+--TPC-DS Q22
+
+-- start query 1 in stream 0 using template ../query_templates/query22.tpl
+select i_product_name
+ ,i_brand
+ ,i_class
+ ,i_category
+ ,avg(inv_quantity_on_hand) qoh
+ from plato.inventory
+ ,plato.date_dim
+ ,plato.item
+ where inv_date_sk=d_date_sk
+ and inv_item_sk=i_item_sk
+ and d_month_seq between 1212 and 1212 + 11
+ group by rollup(i_product_name
+ ,i_brand
+ ,i_class
+ ,i_category)
+order by qoh, i_product_name, i_brand, i_class, i_category
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query22.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q23.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q23.sql
new file mode 100644
index 0000000000..7dfc9f03ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q23.sql
@@ -0,0 +1,110 @@
+--!syntax_pg
+--TPC-DS Q23
+
+-- start query 1 in stream 0 using template ../query_templates/query23.tpl
+with frequent_ss_items as
+ (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
+ from plato.store_sales
+ ,plato.date_dim
+ ,plato.item
+ where ss_sold_date_sk = d_date_sk
+ and ss_item_sk = i_item_sk
+ and d_year in (1999,1999+1,1999+2,1999+3)
+ group by substr(i_item_desc,1,30),i_item_sk,d_date
+ having count(*) >4),
+ max_store_sales as
+ (select max(csales) tpcds_cmax
+ from (select c_customer_sk,sum(ss_quantity::numeric*ss_sales_price) csales
+ from plato.store_sales
+ ,plato.customer
+ ,plato.date_dim
+ where ss_customer_sk = c_customer_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year in (1999,1999+1,1999+2,1999+3)
+ group by c_customer_sk) a),
+ best_ss_customer as
+ (select c_customer_sk,sum(ss_quantity::numeric*ss_sales_price) ssales
+ from plato.store_sales
+ ,plato.customer
+ where ss_customer_sk = c_customer_sk
+ group by c_customer_sk
+ having sum(ss_quantity::numeric*ss_sales_price) > (95.0/100.0)::numeric * (select
+ *
+from
+ max_store_sales)::numeric)
+ select sum(sales)
+ from (select cs_quantity::numeric*cs_list_price sales
+ from plato.catalog_sales
+ ,plato.date_dim
+ where d_year = 1999
+ and d_moy = 1
+ and cs_sold_date_sk = d_date_sk
+ and cs_item_sk in (select item_sk from frequent_ss_items)
+ and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
+ union all
+ select ws_quantity::numeric*ws_list_price sales
+ from plato.web_sales
+ ,plato.date_dim
+ where d_year = 1999
+ and d_moy = 1
+ and ws_sold_date_sk = d_date_sk
+ and ws_item_sk in (select item_sk from frequent_ss_items)
+ and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)) a
+ limit 100;
+with frequent_ss_items as
+ (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
+ from plato.store_sales
+ ,plato.date_dim
+ ,plato.item
+ where ss_sold_date_sk = d_date_sk
+ and ss_item_sk = i_item_sk
+ and d_year in (1999,1999 + 1,1999 + 2,1999 + 3)
+ group by substr(i_item_desc,1,30),i_item_sk,d_date
+ having count(*) >4),
+ max_store_sales as
+ (select max(csales) tpcds_cmax
+ from (select c_customer_sk,sum(ss_quantity::numeric*ss_sales_price) csales
+ from plato.store_sales
+ ,plato.customer
+ ,plato.date_dim
+ where ss_customer_sk = c_customer_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year in (1999,1999+1,1999+2,1999+3)
+ group by c_customer_sk) a),
+ best_ss_customer as
+ (select c_customer_sk,sum(ss_quantity::numeric*ss_sales_price) ssales
+ from plato.store_sales
+ ,plato.customer
+ where ss_customer_sk = c_customer_sk
+ group by c_customer_sk
+ having sum(ss_quantity::numeric*ss_sales_price) > (95.0/100.0)::numeric * (select
+ *
+ from max_store_sales)::numeric)
+ select c_last_name,c_first_name,sales
+ from (select c_last_name,c_first_name,sum(cs_quantity::numeric*cs_list_price) sales
+ from plato.catalog_sales
+ ,plato.customer
+ ,plato.date_dim
+ where d_year = 1999
+ and d_moy = 1
+ and cs_sold_date_sk = d_date_sk
+ and cs_item_sk in (select item_sk from frequent_ss_items)
+ and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
+ and cs_bill_customer_sk = c_customer_sk
+ group by c_last_name,c_first_name
+ union all
+ select c_last_name,c_first_name,sum(ws_quantity::numeric*ws_list_price) sales
+ from plato.web_sales
+ ,plato.customer
+ ,plato.date_dim
+ where d_year = 1999
+ and d_moy = 1
+ and ws_sold_date_sk = d_date_sk
+ and ws_item_sk in (select item_sk from frequent_ss_items)
+ and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)
+ and ws_bill_customer_sk = c_customer_sk
+ group by c_last_name,c_first_name) a
+ order by c_last_name,c_first_name,sales
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query23.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q24.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q24.sql
new file mode 100644
index 0000000000..320888452d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q24.sql
@@ -0,0 +1,110 @@
+--!syntax_pg
+--TPC-DS Q24
+
+-- start query 1 in stream 0 using template ../query_templates/query24.tpl
+with ssales as
+(select c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,ca_state
+ ,s_state
+ ,i_color
+ ,i_current_price
+ ,i_manager_id
+ ,i_units
+ ,i_size
+ ,sum(ss_sales_price) netpaid
+from plato.store_sales
+ ,plato.store_returns
+ ,plato.store
+ ,plato.item
+ ,plato.customer
+ ,plato.customer_address
+where ss_ticket_number = sr_ticket_number
+ and ss_item_sk = sr_item_sk
+ and ss_customer_sk = c_customer_sk
+ and ss_item_sk = i_item_sk
+ and ss_store_sk = s_store_sk
+ and c_current_addr_sk = ca_address_sk
+ and c_birth_country <> upper(ca_country)
+ and s_zip = ca_zip
+and s_market_id=7
+group by c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,ca_state
+ ,s_state
+ ,i_color
+ ,i_current_price
+ ,i_manager_id
+ ,i_units
+ ,i_size)
+select c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,sum(netpaid) paid
+from ssales
+where i_color = 'orchid'
+group by c_last_name
+ ,c_first_name
+ ,s_store_name
+having sum(netpaid) > (select 0.05::numeric*avg(netpaid)
+ from ssales)
+order by c_last_name
+ ,c_first_name
+ ,s_store_name
+;
+with ssales as
+(select c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,ca_state
+ ,s_state
+ ,i_color
+ ,i_current_price
+ ,i_manager_id
+ ,i_units
+ ,i_size
+ ,sum(ss_sales_price) netpaid
+from plato.store_sales
+ ,plato.store_returns
+ ,plato.store
+ ,plato.item
+ ,plato.customer
+ ,plato.customer_address
+where ss_ticket_number = sr_ticket_number
+ and ss_item_sk = sr_item_sk
+ and ss_customer_sk = c_customer_sk
+ and ss_item_sk = i_item_sk
+ and ss_store_sk = s_store_sk
+ and c_current_addr_sk = ca_address_sk
+ and c_birth_country <> upper(ca_country)
+ and s_zip = ca_zip
+ and s_market_id = 7
+group by c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,ca_state
+ ,s_state
+ ,i_color
+ ,i_current_price
+ ,i_manager_id
+ ,i_units
+ ,i_size)
+select c_last_name
+ ,c_first_name
+ ,s_store_name
+ ,sum(netpaid) paid
+from ssales
+where i_color = 'chiffon'
+group by c_last_name
+ ,c_first_name
+ ,s_store_name
+having sum(netpaid) > (select 0.05::numeric*avg(netpaid)
+ from ssales)
+order by c_last_name
+ ,c_first_name
+ ,s_store_name
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query24.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q25.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q25.sql
new file mode 100644
index 0000000000..764be84db6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q25.sql
@@ -0,0 +1,51 @@
+--!syntax_pg
+--TPC-DS Q25
+
+-- start query 1 in stream 0 using template ../query_templates/query25.tpl
+select
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ ,sum(ss_net_profit) as store_sales_profit
+ ,sum(sr_net_loss) as store_returns_loss
+ ,sum(cs_net_profit) as catalog_sales_profit
+ from
+ plato.store_sales
+ ,plato.store_returns
+ ,plato.catalog_sales
+ ,plato.date_dim d1
+ ,plato.date_dim d2
+ ,plato.date_dim d3
+ ,plato.store
+ ,plato.item
+ where
+ d1.d_moy = 4
+ and d1.d_year = 2000
+ and d1.d_date_sk = ss_sold_date_sk
+ and i_item_sk = ss_item_sk
+ and s_store_sk = ss_store_sk
+ and ss_customer_sk = sr_customer_sk
+ and ss_item_sk = sr_item_sk
+ and ss_ticket_number = sr_ticket_number
+ and sr_returned_date_sk = d2.d_date_sk
+ and d2.d_moy between 4 and 10
+ and d2.d_year = 2000
+ and sr_customer_sk = cs_bill_customer_sk
+ and sr_item_sk = cs_item_sk
+ and cs_sold_date_sk = d3.d_date_sk
+ and d3.d_moy between 4 and 10
+ and d3.d_year = 2000
+ group by
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ order by
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query25.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q26.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q26.sql
new file mode 100644
index 0000000000..9d3e5f6200
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q26.sql
@@ -0,0 +1,24 @@
+--!syntax_pg
+--TPC-DS Q26
+
+-- start query 1 in stream 0 using template ../query_templates/query26.tpl
+select i_item_id,
+ avg(cs_quantity) agg1,
+ avg(cs_list_price) agg2,
+ avg(cs_coupon_amt) agg3,
+ avg(cs_sales_price) agg4
+ from plato.catalog_sales, plato.customer_demographics, plato.date_dim, plato.item, plato.promotion
+ where cs_sold_date_sk = d_date_sk and
+ cs_item_sk = i_item_sk and
+ cs_bill_cdemo_sk = cd_demo_sk and
+ cs_promo_sk = p_promo_sk and
+ cd_gender = 'F' and
+ cd_marital_status = 'W' and
+ cd_education_status = 'Primary' and
+ (p_channel_email = 'N' or p_channel_event = 'N') and
+ d_year = 1998
+ group by i_item_id
+ order by i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query26.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q27.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q27.sql
new file mode 100644
index 0000000000..a83e9a6e19
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q27.sql
@@ -0,0 +1,26 @@
+--!syntax_pg
+--TPC-DS Q27
+
+-- start query 1 in stream 0 using template ../query_templates/query27.tpl
+select i_item_id,
+ s_state, grouping(s_state) g_state,
+ avg(ss_quantity) agg1,
+ avg(ss_list_price) agg2,
+ avg(ss_coupon_amt) agg3,
+ avg(ss_sales_price) agg4
+ from plato.store_sales, plato.customer_demographics, plato.date_dim, plato.store, plato.item
+ where ss_sold_date_sk = d_date_sk and
+ ss_item_sk = i_item_sk and
+ ss_store_sk = s_store_sk and
+ ss_cdemo_sk = cd_demo_sk and
+ cd_gender = 'F' and
+ cd_marital_status = 'W' and
+ cd_education_status = 'Primary' and
+ d_year = 1998 and
+ s_state in ('TN','TN', 'TN', 'TN', 'TN', 'TN')
+ group by rollup (i_item_id, s_state)
+ order by i_item_id
+ ,s_state
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query27.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q28.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q28.sql
new file mode 100644
index 0000000000..c20841d8b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q28.sql
@@ -0,0 +1,56 @@
+--!syntax_pg
+--TPC-DS Q28
+
+-- start query 1 in stream 0 using template ../query_templates/query28.tpl
+select *
+from (select avg(ss_list_price) B1_LP
+ ,count(ss_list_price) B1_CNT
+ ,count(distinct ss_list_price) B1_CNTD
+ from plato.store_sales
+ where ss_quantity between 0 and 5
+ and (ss_list_price between 11::numeric and (11+10)::numeric
+ or ss_coupon_amt between 460::numeric and (460+1000)::numeric
+ or ss_wholesale_cost between 14::numeric and (14+20)::numeric)) B1,
+ (select avg(ss_list_price) B2_LP
+ ,count(ss_list_price) B2_CNT
+ ,count(distinct ss_list_price) B2_CNTD
+ from plato.store_sales
+ where ss_quantity between 6 and 10
+ and (ss_list_price between 91::numeric and (91+10)::numeric
+ or ss_coupon_amt between 1430::numeric and (1430+1000)::numeric
+ or ss_wholesale_cost between 32::numeric and (32+20)::numeric)) B2,
+ (select avg(ss_list_price) B3_LP
+ ,count(ss_list_price) B3_CNT
+ ,count(distinct ss_list_price) B3_CNTD
+ from plato.store_sales
+ where ss_quantity between 11 and 15
+ and (ss_list_price between 66::numeric and (66+10)::numeric
+ or ss_coupon_amt between 920::numeric and (920+1000)::numeric
+ or ss_wholesale_cost between 4::numeric and (4+20)::numeric)) B3,
+ (select avg(ss_list_price) B4_LP
+ ,count(ss_list_price) B4_CNT
+ ,count(distinct ss_list_price) B4_CNTD
+ from plato.store_sales
+ where ss_quantity between 16 and 20
+ and (ss_list_price between 142::numeric and (142+10)::numeric
+ or ss_coupon_amt between 3054::numeric and (3054+1000)::numeric
+ or ss_wholesale_cost between 80::numeric and (80+20)::numeric)) B4,
+ (select avg(ss_list_price) B5_LP
+ ,count(ss_list_price) B5_CNT
+ ,count(distinct ss_list_price) B5_CNTD
+ from plato.store_sales
+ where ss_quantity between 21 and 25
+ and (ss_list_price between 135::numeric and (135+10)::numeric
+ or ss_coupon_amt between 14180::numeric and (14180+1000)::numeric
+ or ss_wholesale_cost between 38::numeric and (38+20)::numeric)) B5,
+ (select avg(ss_list_price) B6_LP
+ ,count(ss_list_price) B6_CNT
+ ,count(distinct ss_list_price) B6_CNTD
+ from plato.store_sales
+ where ss_quantity between 26 and 30
+ and (ss_list_price between 28::numeric and (28+10)::numeric
+ or ss_coupon_amt between 2513::numeric and (2513+1000)::numeric
+ or ss_wholesale_cost between 42::numeric and (42+20)::numeric)) B6
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query28.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q29.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q29.sql
new file mode 100644
index 0000000000..0b2bf6556b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q29.sql
@@ -0,0 +1,50 @@
+--!syntax_pg
+--TPC-DS Q29
+
+-- start query 1 in stream 0 using template ../query_templates/query29.tpl
+select
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ ,sum(ss_quantity) as store_sales_quantity
+ ,sum(sr_return_quantity) as store_returns_quantity
+ ,sum(cs_quantity) as catalog_sales_quantity
+ from
+ plato.store_sales
+ ,plato.store_returns
+ ,plato.catalog_sales
+ ,plato.date_dim d1
+ ,plato.date_dim d2
+ ,plato.date_dim d3
+ ,plato.store
+ ,plato.item
+ where
+ d1.d_moy = 4
+ and d1.d_year = 1999
+ and d1.d_date_sk = ss_sold_date_sk
+ and i_item_sk = ss_item_sk
+ and s_store_sk = ss_store_sk
+ and ss_customer_sk = sr_customer_sk
+ and ss_item_sk = sr_item_sk
+ and ss_ticket_number = sr_ticket_number
+ and sr_returned_date_sk = d2.d_date_sk
+ and d2.d_moy between 4 and 4 + 3
+ and d2.d_year = 1999
+ and sr_customer_sk = cs_bill_customer_sk
+ and sr_item_sk = cs_item_sk
+ and cs_sold_date_sk = d3.d_date_sk
+ and d3.d_year in (1999,1999+1,1999+2)
+ group by
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ order by
+ i_item_id
+ ,i_item_desc
+ ,s_store_id
+ ,s_store_name
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query29.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q30.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q30.sql
new file mode 100644
index 0000000000..a1d3319069
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q30.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-DS Q30
+
+-- start query 1 in stream 0 using template ../query_templates/query30.tpl
+with customer_total_return as
+ (select wr_returning_customer_sk as ctr_customer_sk
+ ,ca_state as ctr_state,
+ sum(wr_return_amt) as ctr_total_return
+ from plato.web_returns
+ ,plato.date_dim
+ ,plato.customer_address
+ where wr_returned_date_sk = d_date_sk
+ and d_year =2002
+ and wr_returning_addr_sk = ca_address_sk
+ group by wr_returning_customer_sk
+ ,ca_state)
+ select c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
+ ,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
+ ,c_last_review_date,ctr_total_return
+ from customer_total_return ctr1
+ ,plato.customer_address
+ ,plato.customer
+ where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2::numeric
+ from customer_total_return ctr2
+ where ctr1.ctr_state = ctr2.ctr_state)
+ and ca_address_sk = c_current_addr_sk
+ and ca_state = 'IL'
+ and ctr1.ctr_customer_sk = c_customer_sk
+ order by c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
+ ,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
+ ,c_last_review_date,ctr_total_return
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query30.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q31.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q31.sql
new file mode 100644
index 0000000000..7cc0cc6542
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q31.sql
@@ -0,0 +1,55 @@
+--!syntax_pg
+--TPC-DS Q31
+
+-- start query 1 in stream 0 using template ../query_templates/query31.tpl
+with ss as
+ (select ca_county,d_qoy, d_year,sum(ss_ext_sales_price) as store_sales
+ from plato.store_sales,plato.date_dim,plato.customer_address
+ where ss_sold_date_sk = d_date_sk
+ and ss_addr_sk=ca_address_sk
+ group by ca_county,d_qoy, d_year),
+ ws as
+ (select ca_county,d_qoy, d_year,sum(ws_ext_sales_price) as web_sales
+ from plato.web_sales,plato.date_dim,plato.customer_address
+ where ws_sold_date_sk = d_date_sk
+ and ws_bill_addr_sk=ca_address_sk
+ group by ca_county,d_qoy, d_year)
+ select
+ ss1.ca_county
+ ,ss1.d_year
+ ,ws2.web_sales/ws1.web_sales web_q1_q2_increase
+ ,ss2.store_sales/ss1.store_sales store_q1_q2_increase
+ ,ws3.web_sales/ws2.web_sales web_q2_q3_increase
+ ,ss3.store_sales/ss2.store_sales store_q2_q3_increase
+ from
+ ss ss1
+ ,ss ss2
+ ,ss ss3
+ ,ws ws1
+ ,ws ws2
+ ,ws ws3
+ where
+ ss1.d_qoy = 1
+ and ss1.d_year = 2000
+ and ss1.ca_county = ss2.ca_county
+ and ss2.d_qoy = 2
+ and ss2.d_year = 2000
+ and ss2.ca_county = ss3.ca_county
+ and ss3.d_qoy = 3
+ and ss3.d_year = 2000
+ and ss1.ca_county = ws1.ca_county
+ and ws1.d_qoy = 1
+ and ws1.d_year = 2000
+ and ws1.ca_county = ws2.ca_county
+ and ws2.d_qoy = 2
+ and ws2.d_year = 2000
+ and ws1.ca_county = ws3.ca_county
+ and ws3.d_qoy = 3
+ and ws3.d_year =2000
+ and case when ws1.web_sales > 0::numeric then ws2.web_sales/ws1.web_sales else null::numeric end
+ > case when ss1.store_sales > 0::numeric then ss2.store_sales/ss1.store_sales else null::numeric end
+ and case when ws2.web_sales > 0::numeric then ws3.web_sales/ws2.web_sales else null::numeric end
+ > case when ss2.store_sales > 0::numeric then ss3.store_sales/ss2.store_sales else null::numeric end
+ order by ss1.d_year;
+
+-- end query 1 in stream 0 using template ../query_templates/query31.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q32.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q32.sql
new file mode 100644
index 0000000000..babfacba04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q32.sql
@@ -0,0 +1,31 @@
+--!syntax_pg
+--TPC-DS Q32
+
+-- start query 1 in stream 0 using template ../query_templates/query32.tpl
+select sum(cs_ext_discount_amt) as "excess discount amount"
+from
+ plato.catalog_sales
+ ,plato.item
+ ,plato.date_dim
+where
+i_manufact_id = 269
+and i_item_sk = cs_item_sk
+and d_date between '1998-03-18'::date and
+ (cast('1998-03-18' as date) + interval '90' day)::date
+and d_date_sk = cs_sold_date_sk
+and cs_ext_discount_amt
+ > (
+ select
+ 1.3::numeric * avg(cs_ext_discount_amt)
+ from
+ plato.catalog_sales
+ ,plato.date_dim
+ where
+ cs_item_sk = i_item_sk
+ and d_date between '1998-03-18'::date and
+ (cast('1998-03-18' as date) + interval '90' day)::date
+ and d_date_sk = cs_sold_date_sk
+ )
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query32.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q33.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q33.sql
new file mode 100644
index 0000000000..1fa71e6f9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q33.sql
@@ -0,0 +1,78 @@
+--!syntax_pg
+--TPC-DS Q33
+
+-- start query 1 in stream 0 using template ../query_templates/query33.tpl
+with ss as (
+ select
+ i_manufact_id,sum(ss_ext_sales_price) total_sales
+ from
+ plato.store_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_manufact_id in (select
+ i_manufact_id
+from
+ plato.item
+where i_category in ('Books'))
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 3
+ and ss_addr_sk = ca_address_sk
+ and ca_gmt_offset = -5::numeric
+ group by i_manufact_id),
+ cs as (
+ select
+ i_manufact_id,sum(cs_ext_sales_price) total_sales
+ from
+ plato.catalog_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_manufact_id in (select
+ i_manufact_id
+from
+ plato.item
+where i_category in ('Books'))
+ and cs_item_sk = i_item_sk
+ and cs_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 3
+ and cs_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -5::numeric
+ group by i_manufact_id),
+ ws as (
+ select
+ i_manufact_id,sum(ws_ext_sales_price) total_sales
+ from
+ plato.web_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_manufact_id in (select
+ i_manufact_id
+from
+ plato.item
+where i_category in ('Books'))
+ and ws_item_sk = i_item_sk
+ and ws_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 3
+ and ws_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -5::numeric
+ group by i_manufact_id)
+ select i_manufact_id ,sum(total_sales) total_sales
+ from (select * from ss
+ union all
+ select * from cs
+ union all
+ select * from ws) tmp1
+ group by i_manufact_id
+ order by total_sales
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query33.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q34.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q34.sql
new file mode 100644
index 0000000000..c00f60c79f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q34.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-DS Q34
+
+-- start query 1 in stream 0 using template ../query_templates/query34.tpl
+select c_last_name
+ ,c_first_name
+ ,c_salutation
+ ,c_preferred_cust_flag
+ ,ss_ticket_number
+ ,cnt from
+ (select ss_ticket_number
+ ,ss_customer_sk
+ ,count(*) cnt
+ from plato.store_sales,plato.date_dim,plato.store,plato.household_demographics
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_store_sk = store.s_store_sk
+ and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+ and (date_dim.d_dom between 1 and 3 or date_dim.d_dom between 25 and 28)
+ and (household_demographics.hd_buy_potential = '>10000' or
+ household_demographics.hd_buy_potential = 'Unknown')
+ and household_demographics.hd_vehicle_count > 0
+ and (case when household_demographics.hd_vehicle_count > 0
+ then household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count
+ else null::int4
+ end)::float8 > 1.2::float8
+ and date_dim.d_year in (1998,1998+1,1998+2)
+ and store.s_county in ('Williamson County','Williamson County','Williamson County','Williamson County',
+ 'Williamson County','Williamson County','Williamson County','Williamson County')
+ group by ss_ticket_number,ss_customer_sk) dn,plato.customer
+ where ss_customer_sk = c_customer_sk
+ and cnt between 15::int8 and 20::int8
+ order by c_last_name,c_first_name,c_salutation,c_preferred_cust_flag desc, ss_ticket_number;
+
+-- end query 1 in stream 0 using template ../query_templates/query34.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q35.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q35.sql
new file mode 100644
index 0000000000..4177175164
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q35.sql
@@ -0,0 +1,61 @@
+--!syntax_pg
+--TPC-DS Q35
+
+-- start query 1 in stream 0 using template ../query_templates/query35.tpl
+select
+ ca_state,
+ cd_gender,
+ cd_marital_status,
+ cd_dep_count,
+ count(*) cnt1,
+ avg(cd_dep_count) a1,
+ max(cd_dep_count) x1,
+ sum(cd_dep_count) s1,
+ cd_dep_employed_count,
+ count(*) cnt2,
+ avg(cd_dep_employed_count) a2,
+ max(cd_dep_employed_count) x2,
+ sum(cd_dep_employed_count) s2,
+ cd_dep_college_count,
+ count(*) cnt3,
+ avg(cd_dep_college_count) a3,
+ max(cd_dep_college_count) x3,
+ sum(cd_dep_college_count) s3
+ from
+ plato.customer c,plato.customer_address ca,plato.customer_demographics
+ where
+ c.c_current_addr_sk = ca.ca_address_sk and
+ cd_demo_sk = c.c_current_cdemo_sk and
+ exists (select *
+ from plato.store_sales,plato.date_dim
+ where c.c_customer_sk = ss_customer_sk and
+ ss_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_qoy < 4) and
+ (exists (select *
+ from plato.web_sales,plato.date_dim
+ where c.c_customer_sk = ws_bill_customer_sk and
+ ws_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_qoy < 4) or
+ exists (select *
+ from plato.catalog_sales,plato.date_dim
+ where c.c_customer_sk = cs_ship_customer_sk and
+ cs_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_qoy < 4))
+ group by ca_state,
+ cd_gender,
+ cd_marital_status,
+ cd_dep_count,
+ cd_dep_employed_count,
+ cd_dep_college_count
+ order by ca_state,
+ cd_gender,
+ cd_marital_status,
+ cd_dep_count,
+ cd_dep_employed_count,
+ cd_dep_college_count
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query35.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q36.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q36.sql
new file mode 100644
index 0000000000..fe38dc7e86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q36.sql
@@ -0,0 +1,33 @@
+--!syntax_pg
+--TPC-DS Q36
+
+-- start query 1 in stream 0 using template ../query_templates/query36.tpl
+select
+ sum(ss_net_profit)/sum(ss_ext_sales_price) as gross_margin
+ ,i_category
+ ,i_class
+ ,grouping(i_category)+grouping(i_class) as lochierarchy
+ ,rank() over (
+ partition by grouping(i_category)+grouping(i_class),
+ case when grouping(i_class) = 0 then i_category end
+ order by sum(ss_net_profit)/sum(ss_ext_sales_price) asc) as rank_within_parent
+ from
+ plato.store_sales
+ ,plato.date_dim d1
+ ,plato.item
+ ,plato.store
+ where
+ d1.d_year = 2000
+ and d1.d_date_sk = ss_sold_date_sk
+ and i_item_sk = ss_item_sk
+ and s_store_sk = ss_store_sk
+ and s_state in ('TN','TN','TN','TN',
+ 'TN','TN','TN','TN')
+ group by rollup(i_category,i_class)
+ order by
+ lochierarchy desc
+ ,case when lochierarchy = 0 then i_category end
+ ,rank_within_parent
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query36.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q37.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q37.sql
new file mode 100644
index 0000000000..285325bfae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q37.sql
@@ -0,0 +1,20 @@
+--!syntax_pg
+--TPC-DS Q37
+
+-- start query 1 in stream 0 using template ../query_templates/query37.tpl
+select i_item_id
+ ,i_item_desc
+ ,i_current_price
+ from plato.item, plato.inventory, plato.date_dim, plato.catalog_sales
+ where i_current_price between 22::numeric and (22 + 30)::numeric
+ and inv_item_sk = i_item_sk
+ and d_date_sk=inv_date_sk
+ and d_date between cast('2001-06-02' as date) and (cast('2001-06-02' as date) + interval '60' day)::date
+ and i_manufact_id in (678,964,918,849)
+ and inv_quantity_on_hand between 100 and 500
+ and cs_item_sk = i_item_sk
+ group by i_item_id,i_item_desc,i_current_price
+ order by i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query37.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q38.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q38.sql
new file mode 100644
index 0000000000..f27da36e41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q38.sql
@@ -0,0 +1,26 @@
+--!syntax_pg
+--TPC-DS Q38
+
+-- start query 1 in stream 0 using template ../query_templates/query38.tpl
+select count(*) from (
+ select distinct c_last_name, c_first_name, d_date
+ from plato.store_sales, plato.date_dim, plato.customer
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212 + 11
+ intersect
+ select distinct c_last_name, c_first_name, d_date
+ from plato.catalog_sales, plato.date_dim, plato.customer
+ where catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+ and catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212 + 11
+ intersect
+ select distinct c_last_name, c_first_name, d_date
+ from plato.web_sales, plato.date_dim, plato.customer
+ where web_sales.ws_sold_date_sk = date_dim.d_date_sk
+ and web_sales.ws_bill_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212 + 11
+) hot_cust
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query38.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q39.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q39.sql
new file mode 100644
index 0000000000..c877082142
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q39.sql
@@ -0,0 +1,57 @@
+--!syntax_pg
+--TPC-DS Q39
+
+-- start query 1 in stream 0 using template ../query_templates/query39.tpl
+with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+ ,stdev,mean, case mean when 0::numeric then null::numeric else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+ ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+ from plato.inventory
+ ,plato.item
+ ,plato.warehouse
+ ,plato.date_dim
+ where inv_item_sk = i_item_sk
+ and inv_warehouse_sk = w_warehouse_sk
+ and inv_date_sk = d_date_sk
+ and d_year =1998
+ group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0::numeric then 0::numeric else stdev/mean end > 1::numeric)
+select inv1.w_warehouse_sk as inv1_w_warehouse_sk,inv1.i_item_sk as inv1_i_item_sk,inv1.d_moy as inv1_d_moy,inv1.mean as inv1_mean, inv1.cov as inv1_cov
+ ,inv2.w_warehouse_sk as inv2_w_warehouse_sk,inv2.i_item_sk as inv2_i_item_sk,inv2.d_moy as inv2_d_moy,inv2.mean as inv2_mean, inv2.cov as inv2_cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+ and inv1.w_warehouse_sk = inv2.w_warehouse_sk
+ and inv1.d_moy=4
+ and inv2.d_moy=4+1
+order by inv1_w_warehouse_sk,inv1_i_item_sk,inv1_d_moy,inv1_mean,inv1_cov
+ ,inv2_d_moy,inv2_mean, inv2_cov
+;
+with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+ ,stdev,mean, case mean when 0::numeric then null::numeric else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+ ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+ from plato.inventory
+ ,plato.item
+ ,plato.warehouse
+ ,plato.date_dim
+ where inv_item_sk = i_item_sk
+ and inv_warehouse_sk = w_warehouse_sk
+ and inv_date_sk = d_date_sk
+ and d_year =1998
+ group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0::numeric then 0::numeric else stdev/mean end > 1::numeric)
+select inv1.w_warehouse_sk as inv1_w_warehouse_sk,inv1.i_item_sk as inv1_i_item_sk,inv1.d_moy as inv1_d_moy,inv1.mean as inv1_mean, inv1.cov as inv1_cov
+ ,inv2.w_warehouse_sk as inv2_w_warehouse_sk,inv2.i_item_sk as inv2_i_item_sk,inv2.d_moy as inv2_d_moy,inv2.mean as inv2_mean, inv2.cov as inv2_cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+ and inv1.w_warehouse_sk = inv2.w_warehouse_sk
+ and inv1.d_moy=4
+ and inv2.d_moy=4+1
+ and inv1.cov > 1.5::numeric
+order by inv1_w_warehouse_sk,inv1_i_item_sk,inv1_d_moy,inv1_mean,inv1_cov
+ ,inv2_d_moy,inv2_mean, inv2_cov
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query39.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q40.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q40.sql
new file mode 100644
index 0000000000..f7249d21c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q40.sql
@@ -0,0 +1,31 @@
+--!syntax_pg
+--TPC-DS Q40
+
+-- start query 1 in stream 0 using template ../query_templates/query40.tpl
+select
+ w_state
+ ,i_item_id
+ ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+ then cs_sales_price - coalesce(cr_refunded_cash,0::numeric) else 0::numeric end) as sales_before
+ ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date))
+ then cs_sales_price - coalesce(cr_refunded_cash,0::numeric) else 0::numeric end) as sales_after
+ from
+ plato.catalog_sales left outer join plato.catalog_returns on
+ (cs_order_number = cr_order_number
+ and cs_item_sk = cr_item_sk)
+ ,plato.warehouse
+ ,plato.item
+ ,plato.date_dim
+ where
+ i_current_price between 0.99::numeric and 1.49::numeric
+ and i_item_sk = cs_item_sk
+ and cs_warehouse_sk = w_warehouse_sk
+ and cs_sold_date_sk = d_date_sk
+ and d_date between (cast ('1998-04-08' as date) - interval '30' day)::date
+ and (cast ('1998-04-08' as date) + interval '30' day)::date
+ group by
+ w_state,i_item_id
+ order by w_state,i_item_id
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query40.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q41.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q41.sql
new file mode 100644
index 0000000000..6b79d610f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q41.sql
@@ -0,0 +1,55 @@
+--!syntax_pg
+--TPC-DS Q41
+
+-- start query 1 in stream 0 using template ../query_templates/query41.tpl
+select distinct(i_product_name)
+ from plato.item i1
+ where i_manufact_id between 742 and 742+40
+ and (select count(*) as item_cnt
+ from plato.item
+ where (i_manufact = i1.i_manufact and
+ ((i_category = 'Women' and
+ (i_color = 'orchid' or i_color = 'papaya') and
+ (i_units = 'Pound' or i_units = 'Lb') and
+ (i_size = 'petite' or i_size = 'medium')
+ ) or
+ (i_category = 'Women' and
+ (i_color = 'burlywood' or i_color = 'navy') and
+ (i_units = 'Bundle' or i_units = 'Each') and
+ (i_size = 'N/A' or i_size = 'extra large')
+ ) or
+ (i_category = 'Men' and
+ (i_color = 'bisque' or i_color = 'azure') and
+ (i_units = 'N/A' or i_units = 'Tsp') and
+ (i_size = 'small' or i_size = 'large')
+ ) or
+ (i_category = 'Men' and
+ (i_color = 'chocolate' or i_color = 'cornflower') and
+ (i_units = 'Bunch' or i_units = 'Gross') and
+ (i_size = 'petite' or i_size = 'medium')
+ ))) or
+ (i_manufact = i1.i_manufact and
+ ((i_category = 'Women' and
+ (i_color = 'salmon' or i_color = 'midnight') and
+ (i_units = 'Oz' or i_units = 'Box') and
+ (i_size = 'petite' or i_size = 'medium')
+ ) or
+ (i_category = 'Women' and
+ (i_color = 'snow' or i_color = 'steel') and
+ (i_units = 'Carton' or i_units = 'Tbl') and
+ (i_size = 'N/A' or i_size = 'extra large')
+ ) or
+ (i_category = 'Men' and
+ (i_color = 'purple' or i_color = 'gainsboro') and
+ (i_units = 'Dram' or i_units = 'Unknown') and
+ (i_size = 'small' or i_size = 'large')
+ ) or
+ (i_category = 'Men' and
+ (i_color = 'metallic' or i_color = 'forest') and
+ (i_units = 'Gram' or i_units = 'Ounce') and
+ (i_size = 'petite' or i_size = 'medium')
+ )))) > 0
+ order by i_product_name
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query41.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q42.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q42.sql
new file mode 100644
index 0000000000..a8fed2fb3a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q42.sql
@@ -0,0 +1,25 @@
+--!syntax_pg
+--TPC-DS Q42
+
+-- start query 1 in stream 0 using template ../query_templates/query42.tpl
+select dt.d_year
+ ,item.i_category_id
+ ,item.i_category
+ ,sum(ss_ext_sales_price)
+ from plato.date_dim dt
+ ,plato.store_sales
+ ,plato.item
+ where dt.d_date_sk = store_sales.ss_sold_date_sk
+ and store_sales.ss_item_sk = item.i_item_sk
+ and item.i_manager_id = 1
+ and dt.d_moy=12
+ and dt.d_year=1998
+ group by dt.d_year
+ ,item.i_category_id
+ ,item.i_category
+ order by sum(ss_ext_sales_price) desc,dt.d_year
+ ,item.i_category_id
+ ,item.i_category
+limit 100 ;
+
+-- end query 1 in stream 0 using template ../query_templates/query42.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q43.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q43.sql
new file mode 100644
index 0000000000..a2adaad63a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q43.sql
@@ -0,0 +1,22 @@
+--!syntax_pg
+--TPC-DS Q43
+
+-- start query 1 in stream 0 using template ../query_templates/query43.tpl
+select s_store_name, s_store_id,
+ sum(case when (d_day_name='Sunday') then ss_sales_price else null::numeric end) sun_sales,
+ sum(case when (d_day_name='Monday') then ss_sales_price else null::numeric end) mon_sales,
+ sum(case when (d_day_name='Tuesday') then ss_sales_price else null::numeric end) tue_sales,
+ sum(case when (d_day_name='Wednesday') then ss_sales_price else null::numeric end) wed_sales,
+ sum(case when (d_day_name='Thursday') then ss_sales_price else null::numeric end) thu_sales,
+ sum(case when (d_day_name='Friday') then ss_sales_price else null::numeric end) fri_sales,
+ sum(case when (d_day_name='Saturday') then ss_sales_price else null::numeric end) sat_sales
+ from plato.date_dim, plato.store_sales, plato.store
+ where d_date_sk = ss_sold_date_sk and
+ s_store_sk = ss_store_sk and
+ s_gmt_offset = -5::numeric and
+ d_year = 1998
+ group by s_store_name, s_store_id
+ order by s_store_name, s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query43.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q44.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q44.sql
new file mode 100644
index 0000000000..cf5a5fd9fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q44.sql
@@ -0,0 +1,38 @@
+--!syntax_pg
+--TPC-DS Q44
+
+-- start query 1 in stream 0 using template ../query_templates/query44.tpl
+select asceding.rnk, i1.i_product_name best_performing, i2.i_product_name worst_performing
+from(select *
+ from (select item_sk,rank() over (order by rank_col asc) rnk
+ from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
+ from plato.store_sales ss1
+ where ss_store_sk = 2
+ group by ss_item_sk
+ having avg(ss_net_profit) > 0.9::numeric*(select avg(ss_net_profit) rank_col
+ from plato.store_sales
+ where ss_store_sk = 2
+ and ss_hdemo_sk is null
+ group by ss_store_sk))V1)V11
+ where rnk < 11) asceding,
+ (select *
+ from (select item_sk,rank() over (order by rank_col desc) rnk
+ from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
+ from plato.store_sales ss1
+ where ss_store_sk = 2
+ group by ss_item_sk
+ having avg(ss_net_profit) > 0.9::numeric*(select avg(ss_net_profit) rank_col
+ from plato.store_sales
+ where ss_store_sk = 2
+ and ss_hdemo_sk is null
+ group by ss_store_sk))V2)V21
+ where rnk < 11) descending,
+plato.item i1,
+plato.item i2
+where asceding.rnk = descending.rnk
+ and i1.i_item_sk=asceding.item_sk
+ and i2.i_item_sk=descending.item_sk
+order by asceding.rnk
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query44.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q45.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q45.sql
new file mode 100644
index 0000000000..0e8df9be19
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q45.sql
@@ -0,0 +1,23 @@
+--!syntax_pg
+--TPC-DS Q45
+
+-- start query 1 in stream 0 using template ../query_templates/query45.tpl
+select ca_zip, ca_county, sum(ws_sales_price)
+ from plato.web_sales, plato.customer, plato.customer_address, plato.date_dim, plato.item
+ where ws_bill_customer_sk = c_customer_sk
+ and c_current_addr_sk = ca_address_sk
+ and ws_item_sk = i_item_sk
+ and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
+ or
+ i_item_id in (select i_item_id
+ from plato.item
+ where i_item_sk in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
+ )
+ )
+ and ws_sold_date_sk = d_date_sk
+ and d_qoy = 2 and d_year = 2000
+ group by ca_zip, ca_county
+ order by ca_zip, ca_county
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query45.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q46.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q46.sql
new file mode 100644
index 0000000000..27c2b14727
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q46.sql
@@ -0,0 +1,38 @@
+--!syntax_pg
+--TPC-DS Q46
+
+-- start query 1 in stream 0 using template ../query_templates/query46.tpl
+select c_last_name
+ ,c_first_name
+ ,ca_city
+ ,bought_city
+ ,ss_ticket_number
+ ,amt,profit
+ from
+ (select ss_ticket_number
+ ,ss_customer_sk
+ ,ca_city bought_city
+ ,sum(ss_coupon_amt) amt
+ ,sum(ss_net_profit) profit
+ from plato.store_sales,plato.date_dim,plato.store,plato.household_demographics,plato.customer_address
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_store_sk = store.s_store_sk
+ and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+ and store_sales.ss_addr_sk = customer_address.ca_address_sk
+ and (household_demographics.hd_dep_count = 5 or
+ household_demographics.hd_vehicle_count= 3)
+ and date_dim.d_dow in (6,0)
+ and date_dim.d_year in (1999,1999+1,1999+2)
+ and store.s_city in ('Midway','Fairview','Fairview','Midway','Fairview')
+ group by ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) dn,plato.customer,plato.customer_address current_addr
+ where ss_customer_sk = c_customer_sk
+ and customer.c_current_addr_sk = current_addr.ca_address_sk
+ and current_addr.ca_city <> bought_city
+ order by c_last_name
+ ,c_first_name
+ ,ca_city
+ ,bought_city
+ ,ss_ticket_number
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query46.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q47.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q47.sql
new file mode 100644
index 0000000000..126f80e1eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q47.sql
@@ -0,0 +1,54 @@
+--!syntax_pg
+--TPC-DS Q47
+
+-- start query 1 in stream 0 using template ../query_templates/query47.tpl
+with v1 as(
+ select i_category, i_brand,
+ s_store_name, s_company_name,
+ d_year, d_moy,
+ sum(ss_sales_price) sum_sales,
+ avg(sum(ss_sales_price)) over
+ (partition by i_category, i_brand,
+ s_store_name, s_company_name, d_year)
+ avg_monthly_sales,
+ rank() over
+ (partition by i_category, i_brand,
+ s_store_name, s_company_name
+ order by d_year, d_moy) rn
+ from plato.item, plato.store_sales, plato.date_dim, plato.store
+ where ss_item_sk = i_item_sk and
+ ss_sold_date_sk = d_date_sk and
+ ss_store_sk = s_store_sk and
+ (
+ d_year = 2000 or
+ ( d_year = 2000-1 and d_moy =12) or
+ ( d_year = 2000+1 and d_moy =1)
+ )
+ group by i_category, i_brand,
+ s_store_name, s_company_name,
+ d_year, d_moy),
+ v2 as(
+ select v1.i_category, v1.i_brand
+ ,v1.d_year, v1.d_moy
+ ,v1.avg_monthly_sales
+ ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
+ from v1, v1 v1_lag, v1 v1_lead
+ where v1.i_category = v1_lag.i_category and
+ v1.i_category = v1_lead.i_category and
+ v1.i_brand = v1_lag.i_brand and
+ v1.i_brand = v1_lead.i_brand and
+ v1.s_store_name = v1_lag.s_store_name and
+ v1.s_store_name = v1_lead.s_store_name and
+ v1.s_company_name = v1_lag.s_company_name and
+ v1.s_company_name = v1_lead.s_company_name and
+ v1.rn = v1_lag.rn + 1 and
+ v1.rn = v1_lead.rn - 1)
+ select *
+ from v2
+ where d_year = 2000 and
+ avg_monthly_sales > 0::numeric and
+ case when avg_monthly_sales > 0::numeric then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null::numeric end > 0.1::numeric
+ order by sum_sales - avg_monthly_sales, nsum
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query47.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q48.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q48.sql
new file mode 100644
index 0000000000..43155a852e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q48.sql
@@ -0,0 +1,70 @@
+--!syntax_pg
+--TPC-DS Q48
+
+-- start query 1 in stream 0 using template ../query_templates/query48.tpl
+select sum (ss_quantity)
+ from plato.store_sales, plato.store, plato.customer_demographics, plato.customer_address, plato.date_dim
+ where s_store_sk = ss_store_sk
+ and ss_sold_date_sk = d_date_sk and d_year = 1998
+ and
+ (
+ (
+ cd_demo_sk = ss_cdemo_sk
+ and
+ cd_marital_status = 'M'
+ and
+ cd_education_status = '4 yr Degree'
+ and
+ ss_sales_price between 100.00::numeric and 150.00::numeric
+ )
+ or
+ (
+ cd_demo_sk = ss_cdemo_sk
+ and
+ cd_marital_status = 'D'
+ and
+ cd_education_status = 'Primary'
+ and
+ ss_sales_price between 50.00::numeric and 100.00::numeric
+ )
+ or
+ (
+ cd_demo_sk = ss_cdemo_sk
+ and
+ cd_marital_status = 'U'
+ and
+ cd_education_status = 'Advanced Degree'
+ and
+ ss_sales_price between 150.00::numeric and 200.00::numeric
+ )
+ )
+ and
+ (
+ (
+ ss_addr_sk = ca_address_sk
+ and
+ ca_country = 'United States'
+ and
+ ca_state in ('KY', 'GA', 'NM')
+ and ss_net_profit between 0::numeric and 2000::numeric
+ )
+ or
+ (ss_addr_sk = ca_address_sk
+ and
+ ca_country = 'United States'
+ and
+ ca_state in ('MT', 'OR', 'IN')
+ and ss_net_profit between 150::numeric and 3000::numeric
+ )
+ or
+ (ss_addr_sk = ca_address_sk
+ and
+ ca_country = 'United States'
+ and
+ ca_state in ('WI', 'MO', 'WV')
+ and ss_net_profit between 50::numeric and 25000::numeric
+ )
+ )
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query48.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q49.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q49.sql
new file mode 100644
index 0000000000..62fa592b2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q49.sql
@@ -0,0 +1,132 @@
+--!syntax_pg
+--TPC-DS Q49
+
+-- start query 1 in stream 0 using template ../query_templates/query49.tpl
+select channel, item, return_ratio, return_rank, currency_rank from
+ (select
+ 'web' as channel
+ ,web.item
+ ,web.return_ratio
+ ,web.return_rank
+ ,web.currency_rank
+ from (
+ select
+ item
+ ,return_ratio
+ ,currency_ratio
+ ,rank() over (order by return_ratio) as return_rank
+ ,rank() over (order by currency_ratio) as currency_rank
+ from
+ ( select ws.ws_item_sk as item
+ ,(cast(sum(coalesce(wr.wr_return_quantity,0)) as decimal(15,4))/
+ cast(sum(coalesce(ws.ws_quantity,0)) as decimal(15,4) )) as return_ratio
+ ,(cast(sum(coalesce(wr.wr_return_amt,0::numeric)) as decimal(15,4))/
+ cast(sum(coalesce(ws.ws_net_paid,0::numeric)) as decimal(15,4) )) as currency_ratio
+ from
+ plato.web_sales ws left outer join plato.web_returns wr
+ on (ws.ws_order_number = wr.wr_order_number and
+ ws.ws_item_sk = wr.wr_item_sk)
+ ,plato.date_dim
+ where
+ wr.wr_return_amt > 10000::numeric
+ and ws.ws_net_profit > 1::numeric
+ and ws.ws_net_paid > 0::numeric
+ and ws.ws_quantity > 0
+ and ws_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 12
+ group by ws.ws_item_sk
+ ) in_web
+ ) web
+ where
+ (
+ web.return_rank <= 10
+ or
+ web.currency_rank <= 10
+ )
+ union
+ select
+ 'catalog' as channel
+ ,catalog.item
+ ,catalog.return_ratio
+ ,catalog.return_rank
+ ,catalog.currency_rank
+ from (
+ select
+ item
+ ,return_ratio
+ ,currency_ratio
+ ,rank() over (order by return_ratio) as return_rank
+ ,rank() over (order by currency_ratio) as currency_rank
+ from
+ ( select
+ cs.cs_item_sk as item
+ ,(cast(sum(coalesce(cr.cr_return_quantity,0)) as decimal(15,4))/
+ cast(sum(coalesce(cs.cs_quantity,0)) as decimal(15,4) )) as return_ratio
+ ,(cast(sum(coalesce(cr.cr_return_amount,0::numeric)) as decimal(15,4))/
+ cast(sum(coalesce(cs.cs_net_paid,0::numeric)) as decimal(15,4) )) as currency_ratio
+ from
+ plato.catalog_sales cs left outer join plato.catalog_returns cr
+ on (cs.cs_order_number = cr.cr_order_number and
+ cs.cs_item_sk = cr.cr_item_sk)
+ ,plato.date_dim
+ where
+ cr.cr_return_amount > 10000::numeric
+ and cs.cs_net_profit > 1::numeric
+ and cs.cs_net_paid > 0::numeric
+ and cs.cs_quantity > 0
+ and cs_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 12
+ group by cs.cs_item_sk
+ ) in_cat
+ ) catalog
+ where
+ (
+ catalog.return_rank <= 10
+ or
+ catalog.currency_rank <=10
+ )
+ union
+ select
+ 'store' as channel
+ ,store.item
+ ,store.return_ratio
+ ,store.return_rank
+ ,store.currency_rank
+ from (
+ select
+ item
+ ,return_ratio
+ ,currency_ratio
+ ,rank() over (order by return_ratio) as return_rank
+ ,rank() over (order by currency_ratio) as currency_rank
+ from
+ ( select sts.ss_item_sk as item
+ ,(cast(sum(coalesce(sr.sr_return_quantity,0)) as decimal(15,4))/cast(sum(coalesce(sts.ss_quantity,0)) as decimal(15,4) )) as return_ratio
+ ,(cast(sum(coalesce(sr.sr_return_amt,0::numeric)) as decimal(15,4))/cast(sum(coalesce(sts.ss_net_paid,0::numeric)) as decimal(15,4) )) as currency_ratio
+ from
+ plato.store_sales sts left outer join plato.store_returns sr
+ on (sts.ss_ticket_number = sr.sr_ticket_number and sts.ss_item_sk = sr.sr_item_sk)
+ ,plato.date_dim
+ where
+ sr.sr_return_amt > 10000::numeric
+ and sts.ss_net_profit > 1::numeric
+ and sts.ss_net_paid > 0::numeric
+ and sts.ss_quantity > 0
+ and ss_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 12
+ group by sts.ss_item_sk
+ ) in_store
+ ) store
+ where (
+ store.return_rank <= 10
+ or
+ store.currency_rank <= 10
+ )
+ ) a
+ order by 1,4,5,2
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query49.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q50.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q50.sql
new file mode 100644
index 0000000000..967a684157
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q50.sql
@@ -0,0 +1,62 @@
+--!syntax_pg
+--TPC-DS Q50
+
+-- start query 1 in stream 0 using template ../query_templates/query50.tpl
+select
+ s_store_name
+ ,s_company_id
+ ,s_street_number
+ ,s_street_name
+ ,s_street_type
+ ,s_suite_number
+ ,s_city
+ ,s_county
+ ,s_state
+ ,s_zip
+ ,sum(case when (sr_returned_date_sk - ss_sold_date_sk <= 30 ) then 1 else 0 end) as "30 days"
+ ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 30) and
+ (sr_returned_date_sk - ss_sold_date_sk <= 60) then 1 else 0 end ) as "31-60 days"
+ ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 60) and
+ (sr_returned_date_sk - ss_sold_date_sk <= 90) then 1 else 0 end) as "61-90 days"
+ ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 90) and
+ (sr_returned_date_sk - ss_sold_date_sk <= 120) then 1 else 0 end) as "91-120 days"
+ ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 120) then 1 else 0 end) as ">120 days"
+from
+ plato.store_sales
+ ,plato.store_returns
+ ,plato.store
+ ,plato.date_dim d1
+ ,plato.date_dim d2
+where
+ d2.d_year = 2000
+and d2.d_moy = 9
+and ss_ticket_number = sr_ticket_number
+and ss_item_sk = sr_item_sk
+and ss_sold_date_sk = d1.d_date_sk
+and sr_returned_date_sk = d2.d_date_sk
+and ss_customer_sk = sr_customer_sk
+and ss_store_sk = s_store_sk
+group by
+ s_store_name
+ ,s_company_id
+ ,s_street_number
+ ,s_street_name
+ ,s_street_type
+ ,s_suite_number
+ ,s_city
+ ,s_county
+ ,s_state
+ ,s_zip
+order by s_store_name
+ ,s_company_id
+ ,s_street_number
+ ,s_street_name
+ ,s_street_type
+ ,s_suite_number
+ ,s_city
+ ,s_county
+ ,s_state
+ ,s_zip
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query50.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q51.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q51.sql
new file mode 100644
index 0000000000..07e822bb3a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q51.sql
@@ -0,0 +1,48 @@
+--!syntax_pg
+--TPC-DS Q51
+
+-- start query 1 in stream 0 using template ../query_templates/query51.tpl
+WITH web_v1 as (
+select
+ ws_item_sk item_sk, d_date,
+ sum(sum(ws_sales_price))
+ over (partition by ws_item_sk order by d_date rows between unbounded preceding and current row) cume_sales
+from plato.web_sales
+ ,plato.date_dim
+where ws_sold_date_sk=d_date_sk
+ and d_month_seq between 1212 and 1212+11
+ and ws_item_sk is not NULL
+group by ws_item_sk, d_date),
+store_v1 as (
+select
+ ss_item_sk item_sk, d_date,
+ sum(sum(ss_sales_price))
+ over (partition by ss_item_sk order by d_date rows between unbounded preceding and current row) cume_sales
+from plato.store_sales
+ ,plato.date_dim
+where ss_sold_date_sk=d_date_sk
+ and d_month_seq between 1212 and 1212+11
+ and ss_item_sk is not NULL
+group by ss_item_sk, d_date)
+ select *
+from (select item_sk
+ ,d_date
+ ,web_sales
+ ,store_sales
+ ,max(web_sales)
+ over (partition by item_sk order by d_date rows between unbounded preceding and current row) web_cumulative
+ ,max(store_sales)
+ over (partition by item_sk order by d_date rows between unbounded preceding and current row) store_cumulative
+ from (select case when web.item_sk is not null then web.item_sk else store.item_sk end item_sk
+ ,case when web.d_date is not null then web.d_date else store.d_date end d_date
+ ,web.cume_sales web_sales
+ ,store.cume_sales store_sales
+ from web_v1 web full outer join store_v1 store on (web.item_sk = store.item_sk
+ and web.d_date = store.d_date)
+ )x )y
+where web_cumulative > store_cumulative
+order by item_sk
+ ,d_date
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query51.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q52.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q52.sql
new file mode 100644
index 0000000000..e49b9b8142
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q52.sql
@@ -0,0 +1,25 @@
+--!syntax_pg
+--TPC-DS Q52
+
+-- start query 1 in stream 0 using template ../query_templates/query52.tpl
+select dt.d_year
+ ,item.i_brand_id brand_id
+ ,item.i_brand brand
+ ,sum(ss_ext_sales_price) ext_price
+ from plato.date_dim dt
+ ,plato.store_sales
+ ,plato.item
+ where dt.d_date_sk = store_sales.ss_sold_date_sk
+ and store_sales.ss_item_sk = item.i_item_sk
+ and item.i_manager_id = 1
+ and dt.d_moy=12
+ and dt.d_year=1998
+ group by dt.d_year
+ ,item.i_brand
+ ,item.i_brand_id
+ order by dt.d_year
+ ,ext_price desc
+ ,brand_id
+limit 100 ;
+
+-- end query 1 in stream 0 using template ../query_templates/query52.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q53.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q53.sql
new file mode 100644
index 0000000000..bb9c25ce72
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q53.sql
@@ -0,0 +1,31 @@
+--!syntax_pg
+--TPC-DS Q53
+
+-- start query 1 in stream 0 using template ../query_templates/query53.tpl
+select * from
+(select i_manufact_id,
+sum(ss_sales_price) sum_sales,
+avg(sum(ss_sales_price)) over (partition by i_manufact_id) avg_quarterly_sales
+from plato.item, plato.store_sales, plato.date_dim, plato.store
+where ss_item_sk = i_item_sk and
+ss_sold_date_sk = d_date_sk and
+ss_store_sk = s_store_sk and
+d_month_seq in (1212,1212+1,1212+2,1212+3,1212+4,1212+5,1212+6,1212+7,1212+8,1212+9,1212+10,1212+11) and
+((i_category in ('Books','Children','Electronics') and
+i_class in ('personal','portable','reference','self-help') and
+i_brand in ('scholaramalgamalg #14','scholaramalgamalg #7',
+ 'exportiunivamalg #9','scholaramalgamalg #9'))
+or(i_category in ('Women','Music','Men') and
+i_class in ('accessories','classical','fragrances','pants') and
+i_brand in ('amalgimporto #1','edu packscholar #1','exportiimporto #1',
+ 'importoamalg #1')))
+group by i_manufact_id, d_qoy ) tmp1
+where case when avg_quarterly_sales > 0::numeric
+ then abs (sum_sales - avg_quarterly_sales)/ avg_quarterly_sales
+ else null::numeric end > 0.1::numeric
+order by avg_quarterly_sales,
+ sum_sales,
+ i_manufact_id
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query53.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q54.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q54.sql
new file mode 100644
index 0000000000..2396c50fe9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q54.sql
@@ -0,0 +1,59 @@
+--!syntax_pg
+--TPC-DS Q54
+
+-- start query 1 in stream 0 using template ../query_templates/query54.tpl
+with my_customers as (
+ select distinct c_customer_sk
+ , c_current_addr_sk
+ from
+ ( select cs_sold_date_sk sold_date_sk,
+ cs_bill_customer_sk customer_sk,
+ cs_item_sk item_sk
+ from plato.catalog_sales
+ union all
+ select ws_sold_date_sk sold_date_sk,
+ ws_bill_customer_sk customer_sk,
+ ws_item_sk item_sk
+ from plato.web_sales
+ ) cs_or_ws_sales,
+ plato.item,
+ plato.date_dim,
+ plato.customer
+ where sold_date_sk = d_date_sk
+ and item_sk = i_item_sk
+ and i_category = 'Jewelry'
+ and i_class = 'consignment'
+ and c_customer_sk = cs_or_ws_sales.customer_sk
+ and d_moy = 3
+ and d_year = 1999
+ )
+ , my_revenue as (
+ select c_customer_sk,
+ sum(ss_ext_sales_price) as revenue
+ from my_customers,
+ plato.store_sales,
+ plato.customer_address,
+ plato.store,
+ plato.date_dim
+ where c_current_addr_sk = ca_address_sk
+ and ca_county = s_county
+ and ca_state = s_state
+ and ss_sold_date_sk = d_date_sk
+ and c_customer_sk = ss_customer_sk
+ and d_month_seq between (select distinct d_month_seq+1
+ from plato.date_dim where d_year = 1999 and d_moy = 3)
+ and (select distinct d_month_seq+3
+ from plato.date_dim where d_year = 1999 and d_moy = 3)
+ group by c_customer_sk
+ )
+ , segments as
+ (select cast((revenue/50::numeric) as int) as segment
+ from my_revenue
+ )
+ select segment, count(*) as num_customers, segment*50 as segment_base
+ from segments
+ group by segment
+ order by segment, num_customers
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query54.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q55.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q55.sql
new file mode 100644
index 0000000000..3f42cc3c82
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q55.sql
@@ -0,0 +1,17 @@
+--!syntax_pg
+--TPC-DS Q55
+
+-- start query 1 in stream 0 using template ../query_templates/query55.tpl
+select i_brand_id brand_id, i_brand brand,
+ sum(ss_ext_sales_price) ext_price
+ from plato.date_dim, plato.store_sales, plato.item
+ where d_date_sk = ss_sold_date_sk
+ and ss_item_sk = i_item_sk
+ and i_manager_id=36
+ and d_moy=12
+ and d_year=2001
+ group by i_brand, i_brand_id
+ order by ext_price desc, i_brand_id
+limit 100 ;
+
+-- end query 1 in stream 0 using template ../query_templates/query55.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q56.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q56.sql
new file mode 100644
index 0000000000..8f6b72b284
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q56.sql
@@ -0,0 +1,72 @@
+--!syntax_pg
+--TPC-DS Q56
+
+-- start query 1 in stream 0 using template ../query_templates/query56.tpl
+with ss as (
+ select i_item_id,sum(ss_ext_sales_price) total_sales
+ from
+ plato.store_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where i_item_id in (select
+ i_item_id
+from plato.item
+where i_color in ('orchid','chiffon','lace'))
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 1
+ and ss_addr_sk = ca_address_sk
+ and ca_gmt_offset = -8::numeric
+ group by i_item_id),
+ cs as (
+ select i_item_id,sum(cs_ext_sales_price) total_sales
+ from
+ plato.catalog_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_item_id in (select
+ i_item_id
+from plato.item
+where i_color in ('orchid','chiffon','lace'))
+ and cs_item_sk = i_item_sk
+ and cs_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 1
+ and cs_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -8::numeric
+ group by i_item_id),
+ ws as (
+ select i_item_id,sum(ws_ext_sales_price) total_sales
+ from
+ plato.web_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_item_id in (select
+ i_item_id
+from plato.item
+where i_color in ('orchid','chiffon','lace'))
+ and ws_item_sk = i_item_sk
+ and ws_sold_date_sk = d_date_sk
+ and d_year = 2000
+ and d_moy = 1
+ and ws_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -8::numeric
+ group by i_item_id)
+ select i_item_id ,sum(total_sales) total_sales
+ from (select * from ss
+ union all
+ select * from cs
+ union all
+ select * from ws) tmp1
+ group by i_item_id
+ order by total_sales,
+ i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query56.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q57.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q57.sql
new file mode 100644
index 0000000000..29d1e9ee12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q57.sql
@@ -0,0 +1,51 @@
+--!syntax_pg
+--TPC-DS Q57
+
+-- start query 1 in stream 0 using template ../query_templates/query57.tpl
+with v1 as(
+ select i_category, i_brand,
+ cc_name,
+ d_year, d_moy,
+ sum(cs_sales_price) sum_sales,
+ avg(sum(cs_sales_price)) over
+ (partition by i_category, i_brand,
+ cc_name, d_year)
+ avg_monthly_sales,
+ rank() over
+ (partition by i_category, i_brand,
+ cc_name
+ order by d_year, d_moy) rn
+ from plato.item, plato.catalog_sales, plato.date_dim, plato.call_center
+ where cs_item_sk = i_item_sk and
+ cs_sold_date_sk = d_date_sk and
+ cc_call_center_sk= cs_call_center_sk and
+ (
+ d_year = 2000 or
+ ( d_year = 2000-1 and d_moy =12) or
+ ( d_year = 2000+1 and d_moy =1)
+ )
+ group by i_category, i_brand,
+ cc_name , d_year, d_moy),
+ v2 as(
+ select v1.cc_name
+ ,v1.d_year, v1.d_moy
+ ,v1.avg_monthly_sales
+ ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
+ from v1, v1 v1_lag, v1 v1_lead
+ where v1.i_category = v1_lag.i_category and
+ v1.i_category = v1_lead.i_category and
+ v1.i_brand = v1_lag.i_brand and
+ v1.i_brand = v1_lead.i_brand and
+ v1. cc_name = v1_lag. cc_name and
+ v1. cc_name = v1_lead. cc_name and
+ v1.rn = v1_lag.rn + 1 and
+ v1.rn = v1_lead.rn - 1)
+ select *
+ from v2
+ where d_year = 2000 and
+ avg_monthly_sales > 0::numeric and
+ case when avg_monthly_sales > 0::numeric then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null::numeric end > 0.1::numeric
+ order by sum_sales - avg_monthly_sales, nsum
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query57.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q58.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q58.sql
new file mode 100644
index 0000000000..5dd8e6aa22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q58.sql
@@ -0,0 +1,68 @@
+--!syntax_pg
+--TPC-DS Q58
+
+-- start query 1 in stream 0 using template ../query_templates/query58.tpl
+with ss_items as
+ (select i_item_id item_id
+ ,sum(ss_ext_sales_price) ss_item_rev
+ from plato.store_sales
+ ,plato.item
+ ,plato.date_dim
+ where ss_item_sk = i_item_sk
+ and d_date in (select d_date
+ from plato.date_dim
+ where d_week_seq = (select d_week_seq
+ from plato.date_dim
+ where d_date = '1998-02-19'::date))
+ and ss_sold_date_sk = d_date_sk
+ group by i_item_id),
+ cs_items as
+ (select i_item_id item_id
+ ,sum(cs_ext_sales_price) cs_item_rev
+ from plato.catalog_sales
+ ,plato.item
+ ,plato.date_dim
+ where cs_item_sk = i_item_sk
+ and d_date in (select d_date
+ from plato.date_dim
+ where d_week_seq = (select d_week_seq
+ from plato.date_dim
+ where d_date = '1998-02-19'::date))
+ and cs_sold_date_sk = d_date_sk
+ group by i_item_id),
+ ws_items as
+ (select i_item_id item_id
+ ,sum(ws_ext_sales_price) ws_item_rev
+ from plato.web_sales
+ ,plato.item
+ ,plato.date_dim
+ where ws_item_sk = i_item_sk
+ and d_date in (select d_date
+ from plato.date_dim
+ where d_week_seq =(select d_week_seq
+ from plato.date_dim
+ where d_date = '1998-02-19'::date))
+ and ws_sold_date_sk = d_date_sk
+ group by i_item_id)
+ select ss_items.item_id
+ ,ss_item_rev
+ ,ss_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3::numeric) * 100::numeric ss_dev
+ ,cs_item_rev
+ ,cs_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3::numeric) * 100::numeric cs_dev
+ ,ws_item_rev
+ ,ws_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3::numeric) * 100::numeric ws_dev
+ ,(ss_item_rev+cs_item_rev+ws_item_rev)/3::numeric average
+ from ss_items,cs_items,ws_items
+ where ss_items.item_id=cs_items.item_id
+ and ss_items.item_id=ws_items.item_id
+ and ss_item_rev between 0.9::numeric * cs_item_rev and 1.1::numeric * cs_item_rev
+ and ss_item_rev between 0.9::numeric * ws_item_rev and 1.1::numeric * ws_item_rev
+ and cs_item_rev between 0.9::numeric * ss_item_rev and 1.1::numeric * ss_item_rev
+ and cs_item_rev between 0.9::numeric * ws_item_rev and 1.1::numeric * ws_item_rev
+ and ws_item_rev between 0.9::numeric * ss_item_rev and 1.1::numeric * ss_item_rev
+ and ws_item_rev between 0.9::numeric * cs_item_rev and 1.1::numeric * cs_item_rev
+ order by item_id
+ ,ss_item_rev
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query58.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q59.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q59.sql
new file mode 100644
index 0000000000..7d16a9aec8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q59.sql
@@ -0,0 +1,47 @@
+--!syntax_pg
+--TPC-DS Q59
+
+-- start query 1 in stream 0 using template ../query_templates/query59.tpl
+with wss as
+ (select d_week_seq,
+ ss_store_sk,
+ sum(case when (d_day_name='Sunday') then ss_sales_price else null::numeric end) sun_sales,
+ sum(case when (d_day_name='Monday') then ss_sales_price else null::numeric end) mon_sales,
+ sum(case when (d_day_name='Tuesday') then ss_sales_price else null::numeric end) tue_sales,
+ sum(case when (d_day_name='Wednesday') then ss_sales_price else null::numeric end) wed_sales,
+ sum(case when (d_day_name='Thursday') then ss_sales_price else null::numeric end) thu_sales,
+ sum(case when (d_day_name='Friday') then ss_sales_price else null::numeric end) fri_sales,
+ sum(case when (d_day_name='Saturday') then ss_sales_price else null::numeric end) sat_sales
+ from plato.store_sales,plato.date_dim
+ where d_date_sk = ss_sold_date_sk
+ group by d_week_seq,ss_store_sk
+ )
+ select s_store_name1,s_store_id1,d_week_seq1
+ ,sun_sales1/sun_sales2,mon_sales1/mon_sales2
+ ,tue_sales1/tue_sales2,wed_sales1/wed_sales2,thu_sales1/thu_sales2
+ ,fri_sales1/fri_sales2,sat_sales1/sat_sales2
+ from
+ (select s_store_name s_store_name1,wss.d_week_seq d_week_seq1
+ ,s_store_id s_store_id1,sun_sales sun_sales1
+ ,mon_sales mon_sales1,tue_sales tue_sales1
+ ,wed_sales wed_sales1,thu_sales thu_sales1
+ ,fri_sales fri_sales1,sat_sales sat_sales1
+ from wss,plato.store,plato.date_dim d
+ where d.d_week_seq = wss.d_week_seq and
+ ss_store_sk = s_store_sk and
+ d_month_seq between 1185 and 1185 + 11) y,
+ (select s_store_name s_store_name2,wss.d_week_seq d_week_seq2
+ ,s_store_id s_store_id2,sun_sales sun_sales2
+ ,mon_sales mon_sales2,tue_sales tue_sales2
+ ,wed_sales wed_sales2,thu_sales thu_sales2
+ ,fri_sales fri_sales2,sat_sales sat_sales2
+ from wss,plato.store,plato.date_dim d
+ where d.d_week_seq = wss.d_week_seq and
+ ss_store_sk = s_store_sk and
+ d_month_seq between 1185+ 12 and 1185 + 23) x
+ where s_store_id1=s_store_id2
+ and d_week_seq1=d_week_seq2-52
+ order by s_store_name1,s_store_id1,d_week_seq1
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query59.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q60.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q60.sql
new file mode 100644
index 0000000000..e8913a839c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q60.sql
@@ -0,0 +1,81 @@
+--!syntax_pg
+--TPC-DS Q60
+
+-- start query 1 in stream 0 using template ../query_templates/query60.tpl
+with ss as (
+ select
+ i_item_id,sum(ss_ext_sales_price) total_sales
+ from
+ plato.store_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_item_id in (select
+ i_item_id
+from
+ plato.item
+where i_category in ('Children'))
+ and ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 9
+ and ss_addr_sk = ca_address_sk
+ and ca_gmt_offset = -6::numeric
+ group by i_item_id),
+ cs as (
+ select
+ i_item_id,sum(cs_ext_sales_price) total_sales
+ from
+ plato.catalog_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_item_id in (select
+ i_item_id
+from
+ plato.item
+where i_category in ('Children'))
+ and cs_item_sk = i_item_sk
+ and cs_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 9
+ and cs_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -6::numeric
+ group by i_item_id),
+ ws as (
+ select
+ i_item_id,sum(ws_ext_sales_price) total_sales
+ from
+ plato.web_sales,
+ plato.date_dim,
+ plato.customer_address,
+ plato.item
+ where
+ i_item_id in (select
+ i_item_id
+from
+ plato.item
+where i_category in ('Children'))
+ and ws_item_sk = i_item_sk
+ and ws_sold_date_sk = d_date_sk
+ and d_year = 1999
+ and d_moy = 9
+ and ws_bill_addr_sk = ca_address_sk
+ and ca_gmt_offset = -6::numeric
+ group by i_item_id)
+ select
+ i_item_id
+,sum(total_sales) total_sales
+ from (select * from ss
+ union all
+ select * from cs
+ union all
+ select * from ws) tmp1
+ group by i_item_id
+ order by i_item_id
+ ,total_sales
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query60.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q61.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q61.sql
new file mode 100644
index 0000000000..0862c0747e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q61.sql
@@ -0,0 +1,47 @@
+--!syntax_pg
+--TPC-DS Q61
+
+-- start query 1 in stream 0 using template ../query_templates/query61.tpl
+select promotions,total,cast(promotions as decimal(15,4))/cast(total as decimal(15,4))*100::numeric
+from
+ (select sum(ss_ext_sales_price) promotions
+ from plato.store_sales
+ ,plato.store
+ ,plato.promotion
+ ,plato.date_dim
+ ,plato.customer
+ ,plato.customer_address
+ ,plato.item
+ where ss_sold_date_sk = d_date_sk
+ and ss_store_sk = s_store_sk
+ and ss_promo_sk = p_promo_sk
+ and ss_customer_sk= c_customer_sk
+ and ca_address_sk = c_current_addr_sk
+ and ss_item_sk = i_item_sk
+ and ca_gmt_offset = -7::numeric
+ and i_category = 'Books'
+ and (p_channel_dmail = 'Y' or p_channel_email = 'Y' or p_channel_tv = 'Y')
+ and s_gmt_offset = -7::numeric
+ and d_year = 1999
+ and d_moy = 11) promotional_sales,
+ (select sum(ss_ext_sales_price) total
+ from plato.store_sales
+ ,plato.store
+ ,plato.date_dim
+ ,plato.customer
+ ,plato.customer_address
+ ,plato.item
+ where ss_sold_date_sk = d_date_sk
+ and ss_store_sk = s_store_sk
+ and ss_customer_sk= c_customer_sk
+ and ca_address_sk = c_current_addr_sk
+ and ss_item_sk = i_item_sk
+ and ca_gmt_offset = -7::numeric
+ and i_category = 'Books'
+ and s_gmt_offset = -7::numeric
+ and d_year = 1999
+ and d_moy = 11) all_sales
+order by promotions, total
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query61.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q62.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q62.sql
new file mode 100644
index 0000000000..c65b503787
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q62.sql
@@ -0,0 +1,38 @@
+--!syntax_pg
+--TPC-DS Q62
+
+-- start query 1 in stream 0 using template ../query_templates/query62.tpl
+select
+ substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,web_name
+ ,sum(case when (ws_ship_date_sk - ws_sold_date_sk <= 30 ) then 1 else 0 end) as "30 days"
+ ,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 30) and
+ (ws_ship_date_sk - ws_sold_date_sk <= 60) then 1 else 0 end ) as "31-60 days"
+ ,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 60) and
+ (ws_ship_date_sk - ws_sold_date_sk <= 90) then 1 else 0 end) as "61-90 days"
+ ,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 90) and
+ (ws_ship_date_sk - ws_sold_date_sk <= 120) then 1 else 0 end) as "91-120 days"
+ ,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 120) then 1 else 0 end) as ">120 days"
+from
+ plato.web_sales
+ ,plato.warehouse
+ ,plato.ship_mode
+ ,plato.web_site
+ ,plato.date_dim
+where
+ d_month_seq between 1212 and 1212 + 11
+and ws_ship_date_sk = d_date_sk
+and ws_warehouse_sk = w_warehouse_sk
+and ws_ship_mode_sk = sm_ship_mode_sk
+and ws_web_site_sk = web_site_sk
+group by
+ substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,web_name
+order by substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,web_name
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query62.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q63.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q63.sql
new file mode 100644
index 0000000000..87064c5b8a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q63.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-DS Q63
+
+-- start query 1 in stream 0 using template ../query_templates/query63.tpl
+select *
+from (select i_manager_id
+ ,sum(ss_sales_price) sum_sales
+ ,avg(sum(ss_sales_price)) over (partition by i_manager_id) avg_monthly_sales
+ from plato.item
+ ,plato.store_sales
+ ,plato.date_dim
+ ,plato.store
+ where ss_item_sk = i_item_sk
+ and ss_sold_date_sk = d_date_sk
+ and ss_store_sk = s_store_sk
+ and d_month_seq in (1212,1212+1,1212+2,1212+3,1212+4,1212+5,1212+6,1212+7,1212+8,1212+9,1212+10,1212+11)
+ and (( i_category in ('Books','Children','Electronics')
+ and i_class in ('personal','portable','reference','self-help')
+ and i_brand in ('scholaramalgamalg #14','scholaramalgamalg #7',
+ 'exportiunivamalg #9','scholaramalgamalg #9'))
+ or( i_category in ('Women','Music','Men')
+ and i_class in ('accessories','classical','fragrances','pants')
+ and i_brand in ('amalgimporto #1','edu packscholar #1','exportiimporto #1',
+ 'importoamalg #1')))
+group by i_manager_id, d_moy) tmp1
+where case when avg_monthly_sales > 0::numeric then abs (sum_sales - avg_monthly_sales) / avg_monthly_sales else null::numeric end > 0.1::numeric
+order by i_manager_id
+ ,avg_monthly_sales
+ ,sum_sales
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query63.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q64.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q64.sql
new file mode 100644
index 0000000000..57884978ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q64.sql
@@ -0,0 +1,124 @@
+--!syntax_pg
+--TPC-DS Q64
+
+-- start query 1 in stream 0 using template ../query_templates/query64.tpl
+with cs_ui as
+ (select cs_item_sk
+ ,sum(cs_ext_list_price) as sale,sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) as refund
+ from plato.catalog_sales
+ ,plato.catalog_returns
+ where cs_item_sk = cr_item_sk
+ and cs_order_number = cr_order_number
+ group by cs_item_sk
+ having sum(cs_ext_list_price)>2::numeric*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)),
+cross_sales as
+ (select i_product_name product_name
+ ,i_item_sk item_sk
+ ,s_store_name store_name
+ ,s_zip store_zip
+ ,ad1.ca_street_number b_street_number
+ ,ad1.ca_street_name b_street_name
+ ,ad1.ca_city b_city
+ ,ad1.ca_zip b_zip
+ ,ad2.ca_street_number c_street_number
+ ,ad2.ca_street_name c_street_name
+ ,ad2.ca_city c_city
+ ,ad2.ca_zip c_zip
+ ,d1.d_year as syear
+ ,d2.d_year as fsyear
+ ,d3.d_year s2year
+ ,count(*) cnt
+ ,sum(ss_wholesale_cost) s1
+ ,sum(ss_list_price) s2
+ ,sum(ss_coupon_amt) s3
+ FROM plato.store_sales
+ ,plato.store_returns
+ ,cs_ui
+ ,plato.date_dim d1
+ ,plato.date_dim d2
+ ,plato.date_dim d3
+ ,plato.store
+ ,plato.customer
+ ,plato.customer_demographics cd1
+ ,plato.customer_demographics cd2
+ ,plato.promotion
+ ,plato.household_demographics hd1
+ ,plato.household_demographics hd2
+ ,plato.customer_address ad1
+ ,plato.customer_address ad2
+ ,plato.income_band ib1
+ ,plato.income_band ib2
+ ,plato.item
+ WHERE ss_store_sk = s_store_sk AND
+ ss_sold_date_sk = d1.d_date_sk AND
+ ss_customer_sk = c_customer_sk AND
+ ss_cdemo_sk= cd1.cd_demo_sk AND
+ ss_hdemo_sk = hd1.hd_demo_sk AND
+ ss_addr_sk = ad1.ca_address_sk and
+ ss_item_sk = i_item_sk and
+ ss_item_sk = sr_item_sk and
+ ss_ticket_number = sr_ticket_number and
+ ss_item_sk = cs_ui.cs_item_sk and
+ c_current_cdemo_sk = cd2.cd_demo_sk AND
+ c_current_hdemo_sk = hd2.hd_demo_sk AND
+ c_current_addr_sk = ad2.ca_address_sk and
+ c_first_sales_date_sk = d2.d_date_sk and
+ c_first_shipto_date_sk = d3.d_date_sk and
+ ss_promo_sk = p_promo_sk and
+ hd1.hd_income_band_sk = ib1.ib_income_band_sk and
+ hd2.hd_income_band_sk = ib2.ib_income_band_sk and
+ cd1.cd_marital_status <> cd2.cd_marital_status and
+ i_color in ('maroon','burnished','dim','steel','navajo','chocolate') and
+ i_current_price between 35::numeric and (35 + 10)::numeric and
+ i_current_price between (35 + 1)::numeric and (35 + 15)::numeric
+group by i_product_name
+ ,i_item_sk
+ ,s_store_name
+ ,s_zip
+ ,ad1.ca_street_number
+ ,ad1.ca_street_name
+ ,ad1.ca_city
+ ,ad1.ca_zip
+ ,ad2.ca_street_number
+ ,ad2.ca_street_name
+ ,ad2.ca_city
+ ,ad2.ca_zip
+ ,d1.d_year
+ ,d2.d_year
+ ,d3.d_year
+)
+select cs1.product_name
+ ,cs1.store_name
+ ,cs1.store_zip
+ ,cs1.b_street_number
+ ,cs1.b_street_name
+ ,cs1.b_city
+ ,cs1.b_zip
+ ,cs1.c_street_number
+ ,cs1.c_street_name
+ ,cs1.c_city
+ ,cs1.c_zip
+ ,cs1.syear as cs1_syear
+ ,cs1.cnt as cs1_cnt
+ ,cs1.s1 as s11
+ ,cs1.s2 as s21
+ ,cs1.s3 as s31
+ ,cs2.s1 as s12
+ ,cs2.s2 as s22
+ ,cs2.s3 as s32
+ ,cs2.syear as cs2_syear
+ ,cs2.cnt as cs2_cnt
+from cross_sales cs1,cross_sales cs2
+where cs1.item_sk=cs2.item_sk and
+ cs1.syear = 2000 and
+ cs2.syear = 2000 + 1 and
+ cs2.cnt <= cs1.cnt and
+ cs1.store_name = cs2.store_name and
+ cs1.store_zip = cs2.store_zip
+order by cs1.product_name
+ ,cs1.store_name
+ ,cs2_cnt
+ ,cs1.s1
+ ,cs2.s1;
+
+-- end query 1 in stream 0 using template ../query_templates/query64.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q65.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q65.sql
new file mode 100644
index 0000000000..87d4e776af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q65.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-DS Q65
+
+-- start query 1 in stream 0 using template ../query_templates/query65.tpl
+select
+ s_store_name,
+ i_item_desc,
+ sc.revenue,
+ i_current_price,
+ i_wholesale_cost,
+ i_brand
+ from plato.store, plato.item,
+ (select ss_store_sk, avg(revenue) as ave
+ from
+ (select ss_store_sk, ss_item_sk,
+ sum(ss_sales_price) as revenue
+ from plato.store_sales, plato.date_dim
+ where ss_sold_date_sk = d_date_sk and d_month_seq between 1212 and 1212+11
+ group by ss_store_sk, ss_item_sk) sa
+ group by ss_store_sk) sb,
+ (select ss_store_sk, ss_item_sk, sum(ss_sales_price) as revenue
+ from plato.store_sales, plato.date_dim
+ where ss_sold_date_sk = d_date_sk and d_month_seq between 1212 and 1212+11
+ group by ss_store_sk, ss_item_sk) sc
+ where sb.ss_store_sk = sc.ss_store_sk and
+ sc.revenue <= 0.1::numeric * sb.ave and
+ s_store_sk = sc.ss_store_sk and
+ i_item_sk = sc.ss_item_sk
+ order by s_store_name, i_item_desc
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query65.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q66.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q66.sql
new file mode 100644
index 0000000000..2e6a5eabad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q66.sql
@@ -0,0 +1,223 @@
+--!syntax_pg
+--TPC-DS Q66
+
+-- start query 1 in stream 0 using template ../query_templates/query66.tpl
+select
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,ship_carriers
+ ,year
+ ,sum(jan_sales) as jan_sales
+ ,sum(feb_sales) as feb_sales
+ ,sum(mar_sales) as mar_sales
+ ,sum(apr_sales) as apr_sales
+ ,sum(may_sales) as may_sales
+ ,sum(jun_sales) as jun_sales
+ ,sum(jul_sales) as jul_sales
+ ,sum(aug_sales) as aug_sales
+ ,sum(sep_sales) as sep_sales
+ ,sum(oct_sales) as oct_sales
+ ,sum(nov_sales) as nov_sales
+ ,sum(dec_sales) as dec_sales
+ ,sum(jan_sales/w_warehouse_sq_ft::numeric) as jan_sales_per_sq_foot
+ ,sum(feb_sales/w_warehouse_sq_ft::numeric) as feb_sales_per_sq_foot
+ ,sum(mar_sales/w_warehouse_sq_ft::numeric) as mar_sales_per_sq_foot
+ ,sum(apr_sales/w_warehouse_sq_ft::numeric) as apr_sales_per_sq_foot
+ ,sum(may_sales/w_warehouse_sq_ft::numeric) as may_sales_per_sq_foot
+ ,sum(jun_sales/w_warehouse_sq_ft::numeric) as jun_sales_per_sq_foot
+ ,sum(jul_sales/w_warehouse_sq_ft::numeric) as jul_sales_per_sq_foot
+ ,sum(aug_sales/w_warehouse_sq_ft::numeric) as aug_sales_per_sq_foot
+ ,sum(sep_sales/w_warehouse_sq_ft::numeric) as sep_sales_per_sq_foot
+ ,sum(oct_sales/w_warehouse_sq_ft::numeric) as oct_sales_per_sq_foot
+ ,sum(nov_sales/w_warehouse_sq_ft::numeric) as nov_sales_per_sq_foot
+ ,sum(dec_sales/w_warehouse_sq_ft::numeric) as dec_sales_per_sq_foot
+ ,sum(jan_net) as jan_net
+ ,sum(feb_net) as feb_net
+ ,sum(mar_net) as mar_net
+ ,sum(apr_net) as apr_net
+ ,sum(may_net) as may_net
+ ,sum(jun_net) as jun_net
+ ,sum(jul_net) as jul_net
+ ,sum(aug_net) as aug_net
+ ,sum(sep_net) as sep_net
+ ,sum(oct_net) as oct_net
+ ,sum(nov_net) as nov_net
+ ,sum(dec_net) as dec_net
+ from (
+ select
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,'DIAMOND' || ',' || 'AIRBORNE' as ship_carriers
+ ,d_year as year
+ ,sum(case when d_moy = 1
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as jan_sales
+ ,sum(case when d_moy = 2
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as feb_sales
+ ,sum(case when d_moy = 3
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as mar_sales
+ ,sum(case when d_moy = 4
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as apr_sales
+ ,sum(case when d_moy = 5
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as may_sales
+ ,sum(case when d_moy = 6
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as jun_sales
+ ,sum(case when d_moy = 7
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as jul_sales
+ ,sum(case when d_moy = 8
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as aug_sales
+ ,sum(case when d_moy = 9
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as sep_sales
+ ,sum(case when d_moy = 10
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as oct_sales
+ ,sum(case when d_moy = 11
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as nov_sales
+ ,sum(case when d_moy = 12
+ then ws_sales_price* ws_quantity::numeric else 0::numeric end) as dec_sales
+ ,sum(case when d_moy = 1
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jan_net
+ ,sum(case when d_moy = 2
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as feb_net
+ ,sum(case when d_moy = 3
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as mar_net
+ ,sum(case when d_moy = 4
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as apr_net
+ ,sum(case when d_moy = 5
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as may_net
+ ,sum(case when d_moy = 6
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jun_net
+ ,sum(case when d_moy = 7
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jul_net
+ ,sum(case when d_moy = 8
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as aug_net
+ ,sum(case when d_moy = 9
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as sep_net
+ ,sum(case when d_moy = 10
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as oct_net
+ ,sum(case when d_moy = 11
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as nov_net
+ ,sum(case when d_moy = 12
+ then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as dec_net
+ from
+ plato.web_sales
+ ,plato.warehouse
+ ,plato.date_dim
+ ,plato.time_dim
+ ,plato.ship_mode
+ where
+ ws_warehouse_sk = w_warehouse_sk
+ and ws_sold_date_sk = d_date_sk
+ and ws_sold_time_sk = t_time_sk
+ and ws_ship_mode_sk = sm_ship_mode_sk
+ and d_year = 2002
+ and t_time between 49530 and 49530+28800
+ and sm_carrier in ('DIAMOND','AIRBORNE')
+ group by
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,d_year
+ union all
+ select
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,'DIAMOND' || ',' || 'AIRBORNE' as ship_carriers
+ ,d_year as year
+ ,sum(case when d_moy = 1
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jan_sales
+ ,sum(case when d_moy = 2
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as feb_sales
+ ,sum(case when d_moy = 3
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as mar_sales
+ ,sum(case when d_moy = 4
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as apr_sales
+ ,sum(case when d_moy = 5
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as may_sales
+ ,sum(case when d_moy = 6
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jun_sales
+ ,sum(case when d_moy = 7
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jul_sales
+ ,sum(case when d_moy = 8
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as aug_sales
+ ,sum(case when d_moy = 9
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as sep_sales
+ ,sum(case when d_moy = 10
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as oct_sales
+ ,sum(case when d_moy = 11
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as nov_sales
+ ,sum(case when d_moy = 12
+ then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as dec_sales
+ ,sum(case when d_moy = 1
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jan_net
+ ,sum(case when d_moy = 2
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as feb_net
+ ,sum(case when d_moy = 3
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as mar_net
+ ,sum(case when d_moy = 4
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as apr_net
+ ,sum(case when d_moy = 5
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as may_net
+ ,sum(case when d_moy = 6
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jun_net
+ ,sum(case when d_moy = 7
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jul_net
+ ,sum(case when d_moy = 8
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as aug_net
+ ,sum(case when d_moy = 9
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as sep_net
+ ,sum(case when d_moy = 10
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as oct_net
+ ,sum(case when d_moy = 11
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as nov_net
+ ,sum(case when d_moy = 12
+ then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as dec_net
+ from
+ plato.catalog_sales
+ ,plato.warehouse
+ ,plato.date_dim
+ ,plato.time_dim
+ ,plato.ship_mode
+ where
+ cs_warehouse_sk = w_warehouse_sk
+ and cs_sold_date_sk = d_date_sk
+ and cs_sold_time_sk = t_time_sk
+ and cs_ship_mode_sk = sm_ship_mode_sk
+ and d_year = 2002
+ and t_time between 49530 AND 49530+28800
+ and sm_carrier in ('DIAMOND','AIRBORNE')
+ group by
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,d_year
+ ) x
+ group by
+ w_warehouse_name
+ ,w_warehouse_sq_ft
+ ,w_city
+ ,w_county
+ ,w_state
+ ,w_country
+ ,ship_carriers
+ ,year
+ order by w_warehouse_name
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query66.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q67.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q67.sql
new file mode 100644
index 0000000000..8f3f7a868a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q67.sql
@@ -0,0 +1,47 @@
+--!syntax_pg
+--TPC-DS Q67
+
+-- start query 1 in stream 0 using template ../query_templates/query67.tpl
+select *
+from (select i_category
+ ,i_class
+ ,i_brand
+ ,i_product_name
+ ,d_year
+ ,d_qoy
+ ,d_moy
+ ,s_store_id
+ ,sumsales
+ ,rank() over (partition by i_category order by sumsales desc) rk
+ from (select i_category
+ ,i_class
+ ,i_brand
+ ,i_product_name
+ ,d_year
+ ,d_qoy
+ ,d_moy
+ ,s_store_id
+ ,sum(coalesce(ss_sales_price*ss_quantity::numeric,0::numeric)) sumsales
+ from plato.store_sales
+ ,plato.date_dim
+ ,plato.store
+ ,plato.item
+ where ss_sold_date_sk=d_date_sk
+ and ss_item_sk=i_item_sk
+ and ss_store_sk = s_store_sk
+ and d_month_seq between 1212 and 1212+11
+ group by rollup(i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy,s_store_id))dw1) dw2
+where rk <= 100
+order by i_category
+ ,i_class
+ ,i_brand
+ ,i_product_name
+ ,d_year
+ ,d_qoy
+ ,d_moy
+ ,s_store_id
+ ,sumsales
+ ,rk
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query67.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q68.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q68.sql
new file mode 100644
index 0000000000..385f421edc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q68.sql
@@ -0,0 +1,45 @@
+--!syntax_pg
+--TPC-DS Q68
+
+-- start query 1 in stream 0 using template ../query_templates/query68.tpl
+select c_last_name
+ ,c_first_name
+ ,ca_city
+ ,bought_city
+ ,ss_ticket_number
+ ,extended_price
+ ,extended_tax
+ ,list_price
+ from (select ss_ticket_number
+ ,ss_customer_sk
+ ,ca_city bought_city
+ ,sum(ss_ext_sales_price) extended_price
+ ,sum(ss_ext_list_price) list_price
+ ,sum(ss_ext_tax) extended_tax
+ from plato.store_sales
+ ,plato.date_dim
+ ,plato.store
+ ,plato.household_demographics
+ ,plato.customer_address
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_store_sk = store.s_store_sk
+ and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+ and store_sales.ss_addr_sk = customer_address.ca_address_sk
+ and date_dim.d_dom between 1 and 2
+ and (household_demographics.hd_dep_count = 5 or
+ household_demographics.hd_vehicle_count= 3)
+ and date_dim.d_year in (1999,1999+1,1999+2)
+ and store.s_city in ('Midway','Fairview')
+ group by ss_ticket_number
+ ,ss_customer_sk
+ ,ss_addr_sk,ca_city) dn
+ ,plato.customer
+ ,plato.customer_address current_addr
+ where ss_customer_sk = c_customer_sk
+ and customer.c_current_addr_sk = current_addr.ca_address_sk
+ and current_addr.ca_city <> bought_city
+ order by c_last_name
+ ,ss_ticket_number
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query68.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q69.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q69.sql
new file mode 100644
index 0000000000..7fd3ba6c71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q69.sql
@@ -0,0 +1,50 @@
+--!syntax_pg
+--TPC-DS Q69
+
+-- start query 1 in stream 0 using template ../query_templates/query69.tpl
+select
+ cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ count(*) cnt1,
+ cd_purchase_estimate,
+ count(*) cnt2,
+ cd_credit_rating,
+ count(*) cnt3
+ from
+ plato.customer c,plato.customer_address ca,plato.customer_demographics
+ where
+ c.c_current_addr_sk = ca.ca_address_sk and
+ ca_state in ('CO','IL','MN') and
+ cd_demo_sk = c.c_current_cdemo_sk and
+ exists (select *
+ from plato.store_sales,plato.date_dim
+ where c.c_customer_sk = ss_customer_sk and
+ ss_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_moy between 1 and 1+2) and
+ (not exists (select *
+ from plato.web_sales,plato.date_dim
+ where c.c_customer_sk = ws_bill_customer_sk and
+ ws_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_moy between 1 and 1+2) and
+ not exists (select *
+ from plato.catalog_sales,plato.date_dim
+ where c.c_customer_sk = cs_ship_customer_sk and
+ cs_sold_date_sk = d_date_sk and
+ d_year = 1999 and
+ d_moy between 1 and 1+2))
+ group by cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ cd_purchase_estimate,
+ cd_credit_rating
+ order by cd_gender,
+ cd_marital_status,
+ cd_education_status,
+ cd_purchase_estimate,
+ cd_credit_rating
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query69.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q70.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q70.sql
new file mode 100644
index 0000000000..530cb0f973
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q70.sql
@@ -0,0 +1,41 @@
+--!syntax_pg
+--TPC-DS Q70
+
+-- start query 1 in stream 0 using template ../query_templates/query70.tpl
+select
+ sum(ss_net_profit) as total_sum
+ ,s_state
+ ,s_county
+ ,grouping(s_state)+grouping(s_county) as lochierarchy
+ ,rank() over (
+ partition by grouping(s_state)+grouping(s_county),
+ case when grouping(s_county) = 0 then s_state end
+ order by sum(ss_net_profit) desc) as rank_within_parent
+ from
+ plato.store_sales
+ ,plato.date_dim d1
+ ,plato.store
+ where
+ d1.d_month_seq between 1212 and 1212+11
+ and d1.d_date_sk = ss_sold_date_sk
+ and s_store_sk = ss_store_sk
+ and s_state in
+ ( select s_state
+ from (select s_state as s_state,
+ rank() over ( partition by s_state order by sum(ss_net_profit) desc) as ranking
+ from plato.store_sales, plato.store, plato.date_dim
+ where d_month_seq between 1212 and 1212+11
+ and d_date_sk = ss_sold_date_sk
+ and s_store_sk = ss_store_sk
+ group by s_state
+ ) tmp1
+ where ranking <= 5
+ )
+ group by rollup(s_state,s_county)
+ order by
+ lochierarchy desc
+ ,case when lochierarchy = 0 then s_state end
+ ,rank_within_parent
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query70.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q71.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q71.sql
new file mode 100644
index 0000000000..72f8f06225
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q71.sql
@@ -0,0 +1,43 @@
+--!syntax_pg
+--TPC-DS Q71
+
+-- start query 1 in stream 0 using template ../query_templates/query71.tpl
+select i_brand_id brand_id, i_brand brand,t_hour,t_minute,
+ sum(ext_price) ext_price
+ from plato.item, (select ws_ext_sales_price as ext_price,
+ ws_sold_date_sk as sold_date_sk,
+ ws_item_sk as sold_item_sk,
+ ws_sold_time_sk as time_sk
+ from plato.web_sales,plato.date_dim
+ where d_date_sk = ws_sold_date_sk
+ and d_moy=12
+ and d_year=2000
+ union all
+ select cs_ext_sales_price as ext_price,
+ cs_sold_date_sk as sold_date_sk,
+ cs_item_sk as sold_item_sk,
+ cs_sold_time_sk as time_sk
+ from plato.catalog_sales,plato.date_dim
+ where d_date_sk = cs_sold_date_sk
+ and d_moy=12
+ and d_year=2000
+ union all
+ select ss_ext_sales_price as ext_price,
+ ss_sold_date_sk as sold_date_sk,
+ ss_item_sk as sold_item_sk,
+ ss_sold_time_sk as time_sk
+ from plato.store_sales,plato.date_dim
+ where d_date_sk = ss_sold_date_sk
+ and d_moy=12
+ and d_year=2000
+ ) tmp,plato.time_dim
+ where
+ sold_item_sk = i_item_sk
+ and i_manager_id=1
+ and time_sk = t_time_sk
+ and (t_meal_time = 'breakfast' or t_meal_time = 'dinner')
+ group by i_brand, i_brand_id,t_hour,t_minute
+ order by ext_price desc, i_brand_id
+ ;
+
+-- end query 1 in stream 0 using template ../query_templates/query71.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q72.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q72.sql
new file mode 100644
index 0000000000..1687f6f0e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q72.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-DS Q72
+
+-- start query 1 in stream 0 using template ../query_templates/query72.tpl
+select i_item_desc
+ ,w_warehouse_name
+ ,d1.d_week_seq
+ ,sum(case when p_promo_sk is null then 1 else 0 end) no_promo
+ ,sum(case when p_promo_sk is not null then 1 else 0 end) promo
+ ,count(*) total_cnt
+from plato.catalog_sales
+join plato.inventory on (cs_item_sk = inv_item_sk)
+join plato.warehouse on (w_warehouse_sk=inv_warehouse_sk)
+join plato.item on (i_item_sk = cs_item_sk)
+join plato.customer_demographics on (cs_bill_cdemo_sk = cd_demo_sk)
+join plato.household_demographics on (cs_bill_hdemo_sk = hd_demo_sk)
+join plato.date_dim d1 on (cs_sold_date_sk = d1.d_date_sk)
+join plato.date_dim d2 on (inv_date_sk = d2.d_date_sk)
+join plato.date_dim d3 on (cs_ship_date_sk = d3.d_date_sk)
+left outer join plato.promotion on (cs_promo_sk=p_promo_sk)
+left outer join plato.catalog_returns on (cr_item_sk = cs_item_sk and cr_order_number = cs_order_number)
+where d1.d_week_seq = d2.d_week_seq
+ and inv_quantity_on_hand < cs_quantity
+ and d3.d_date > d1.d_date + 5
+ and hd_buy_potential = '1001-5000'
+ and d1.d_year = 2001
+ and cd_marital_status = 'M'
+group by i_item_desc,w_warehouse_name,d1.d_week_seq
+order by total_cnt desc, i_item_desc, w_warehouse_name, d_week_seq
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query72.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q73.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q73.sql
new file mode 100644
index 0000000000..768a01d4cf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q73.sql
@@ -0,0 +1,31 @@
+--!syntax_pg
+--TPC-DS Q73
+
+-- start query 1 in stream 0 using template ../query_templates/query73.tpl
+select c_last_name
+ ,c_first_name
+ ,c_salutation
+ ,c_preferred_cust_flag
+ ,ss_ticket_number
+ ,cnt from
+ (select ss_ticket_number
+ ,ss_customer_sk
+ ,count(*) cnt
+ from plato.store_sales,plato.date_dim,plato.store,plato.household_demographics
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_store_sk = store.s_store_sk
+ and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+ and date_dim.d_dom between 1 and 2
+ and (household_demographics.hd_buy_potential = '>10000' or
+ household_demographics.hd_buy_potential = 'Unknown')
+ and household_demographics.hd_vehicle_count > 0
+ and case when household_demographics.hd_vehicle_count > 0 then
+ household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count else null::int4 end > 1
+ and date_dim.d_year in (1998,1998+1,1998+2)
+ and store.s_county in ('Williamson County','Williamson County','Williamson County','Williamson County')
+ group by ss_ticket_number,ss_customer_sk) dj,plato.customer
+ where ss_customer_sk = c_customer_sk
+ and cnt between 1::int8 and 5::int8
+ order by cnt desc, c_last_name asc;
+
+-- end query 1 in stream 0 using template ../query_templates/query73.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q74.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q74.sql
new file mode 100644
index 0000000000..86b46f1122
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q74.sql
@@ -0,0 +1,64 @@
+--!syntax_pg
+--TPC-DS Q74
+
+-- start query 1 in stream 0 using template ../query_templates/query74.tpl
+with year_total as (
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,d_year as year
+ ,max(ss_net_paid) year_total
+ ,'s' sale_type
+ from plato.customer
+ ,plato.store_sales
+ ,plato.date_dim
+ where c_customer_sk = ss_customer_sk
+ and ss_sold_date_sk = d_date_sk
+ and d_year in (2001,2001+1)
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,d_year
+ union all
+ select c_customer_id customer_id
+ ,c_first_name customer_first_name
+ ,c_last_name customer_last_name
+ ,d_year as year
+ ,max(ws_net_paid) year_total
+ ,'w' sale_type
+ from plato.customer
+ ,plato.web_sales
+ ,plato.date_dim
+ where c_customer_sk = ws_bill_customer_sk
+ and ws_sold_date_sk = d_date_sk
+ and d_year in (2001,2001+1)
+ group by c_customer_id
+ ,c_first_name
+ ,c_last_name
+ ,d_year
+ )
+ select
+ t_s_secyear.customer_id, t_s_secyear.customer_first_name, t_s_secyear.customer_last_name
+ from year_total t_s_firstyear
+ ,year_total t_s_secyear
+ ,year_total t_w_firstyear
+ ,year_total t_w_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+ and t_s_firstyear.customer_id = t_w_secyear.customer_id
+ and t_s_firstyear.customer_id = t_w_firstyear.customer_id
+ and t_s_firstyear.sale_type = 's'
+ and t_w_firstyear.sale_type = 'w'
+ and t_s_secyear.sale_type = 's'
+ and t_w_secyear.sale_type = 'w'
+ and t_s_firstyear.year = 2001
+ and t_s_secyear.year = 2001+1
+ and t_w_firstyear.year = 2001
+ and t_w_secyear.year = 2001+1
+ and t_s_firstyear.year_total > 0::numeric
+ and t_w_firstyear.year_total > 0::numeric
+ and case when t_w_firstyear.year_total > 0::numeric then t_w_secyear.year_total / t_w_firstyear.year_total else null::numeric end
+ > case when t_s_firstyear.year_total > 0::numeric then t_s_secyear.year_total / t_s_firstyear.year_total else null::numeric end
+ order by 2,1,3
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query74.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q75.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q75.sql
new file mode 100644
index 0000000000..62937cb56d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q75.sql
@@ -0,0 +1,73 @@
+--!syntax_pg
+--TPC-DS Q75
+
+-- start query 1 in stream 0 using template ../query_templates/query75.tpl
+WITH all_sales AS (
+ SELECT d_year
+ ,i_brand_id
+ ,i_class_id
+ ,i_category_id
+ ,i_manufact_id
+ ,SUM(sales_cnt) AS sales_cnt
+ ,SUM(sales_amt) AS sales_amt
+ FROM (SELECT d_year
+ ,i_brand_id
+ ,i_class_id
+ ,i_category_id
+ ,i_manufact_id
+ ,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt
+ ,cs_ext_sales_price - COALESCE(cr_return_amount,0.0::numeric) AS sales_amt
+ FROM plato.catalog_sales JOIN plato.item ON i_item_sk=cs_item_sk
+ JOIN plato.date_dim ON d_date_sk=cs_sold_date_sk
+ LEFT JOIN plato.catalog_returns ON (cs_order_number=cr_order_number
+ AND cs_item_sk=cr_item_sk)
+ WHERE i_category='Sports'
+ UNION
+ SELECT d_year
+ ,i_brand_id
+ ,i_class_id
+ ,i_category_id
+ ,i_manufact_id
+ ,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt
+ ,ss_ext_sales_price - COALESCE(sr_return_amt,0.0::numeric) AS sales_amt
+ FROM plato.store_sales JOIN plato.item ON i_item_sk=ss_item_sk
+ JOIN plato.date_dim ON d_date_sk=ss_sold_date_sk
+ LEFT JOIN plato.store_returns ON (ss_ticket_number=sr_ticket_number
+ AND ss_item_sk=sr_item_sk)
+ WHERE i_category='Sports'
+ UNION
+ SELECT d_year
+ ,i_brand_id
+ ,i_class_id
+ ,i_category_id
+ ,i_manufact_id
+ ,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt
+ ,ws_ext_sales_price - COALESCE(wr_return_amt,0.0::numeric) AS sales_amt
+ FROM plato.web_sales JOIN plato.item ON i_item_sk=ws_item_sk
+ JOIN plato.date_dim ON d_date_sk=ws_sold_date_sk
+ LEFT JOIN plato.web_returns ON (ws_order_number=wr_order_number
+ AND ws_item_sk=wr_item_sk)
+ WHERE i_category='Sports') sales_detail
+ GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id)
+ SELECT prev_yr.d_year AS prev_year
+ ,curr_yr.d_year AS year
+ ,curr_yr.i_brand_id
+ ,curr_yr.i_class_id
+ ,curr_yr.i_category_id
+ ,curr_yr.i_manufact_id
+ ,prev_yr.sales_cnt AS prev_yr_cnt
+ ,curr_yr.sales_cnt AS curr_yr_cnt
+ ,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff
+ ,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff
+ FROM all_sales curr_yr, all_sales prev_yr
+ WHERE curr_yr.i_brand_id=prev_yr.i_brand_id
+ AND curr_yr.i_class_id=prev_yr.i_class_id
+ AND curr_yr.i_category_id=prev_yr.i_category_id
+ AND curr_yr.i_manufact_id=prev_yr.i_manufact_id
+ AND curr_yr.d_year=2002
+ AND prev_yr.d_year=2002-1
+ AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9::numeric
+ ORDER BY sales_cnt_diff,sales_amt_diff
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query75.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q76.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q76.sql
new file mode 100644
index 0000000000..ce2e458ace
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q76.sql
@@ -0,0 +1,27 @@
+--!syntax_pg
+--TPC-DS Q76
+
+-- start query 1 in stream 0 using template ../query_templates/query76.tpl
+select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
+ SELECT 'store' as channel, 'ss_addr_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
+ FROM plato.store_sales, plato.item, plato.date_dim
+ WHERE ss_addr_sk IS NULL
+ AND ss_sold_date_sk=d_date_sk
+ AND ss_item_sk=i_item_sk
+ UNION ALL
+ SELECT 'web' as channel, 'ws_web_page_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
+ FROM plato.web_sales, plato.item, plato.date_dim
+ WHERE ws_web_page_sk IS NULL
+ AND ws_sold_date_sk=d_date_sk
+ AND ws_item_sk=i_item_sk
+ UNION ALL
+ SELECT 'catalog' as channel, 'cs_warehouse_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
+ FROM plato.catalog_sales, plato.item, plato.date_dim
+ WHERE cs_warehouse_sk IS NULL
+ AND cs_sold_date_sk=d_date_sk
+ AND cs_item_sk=i_item_sk) foo
+GROUP BY channel, col_name, d_year, d_qoy, i_category
+ORDER BY channel, col_name, d_year, d_qoy, i_category
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query76.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q77.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q77.sql
new file mode 100644
index 0000000000..fbef66a1e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q77.sql
@@ -0,0 +1,111 @@
+--!syntax_pg
+--TPC-DS Q77
+
+-- start query 1 in stream 0 using template ../query_templates/query77.tpl
+with ss as
+ (select s_store_sk,
+ sum(ss_ext_sales_price) as sales,
+ sum(ss_net_profit) as profit
+ from plato.store_sales,
+ plato.date_dim,
+ plato.store
+ where ss_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and ss_store_sk = s_store_sk
+ group by s_store_sk)
+ ,
+ sr as
+ (select s_store_sk,
+ sum(sr_return_amt) as returns,
+ sum(sr_net_loss) as profit_loss
+ from plato.store_returns,
+ plato.date_dim,
+ plato.store
+ where sr_returned_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and sr_store_sk = s_store_sk
+ group by s_store_sk),
+ cs as
+ (select cs_call_center_sk,
+ sum(cs_ext_sales_price) as sales,
+ sum(cs_net_profit) as profit
+ from plato.catalog_sales,
+ plato.date_dim
+ where cs_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ group by cs_call_center_sk
+ ),
+ cr as
+ (select cr_call_center_sk,
+ sum(cr_return_amount) as returns,
+ sum(cr_net_loss) as profit_loss
+ from plato.catalog_returns,
+ plato.date_dim
+ where cr_returned_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ group by cr_call_center_sk
+ ),
+ ws as
+ ( select wp_web_page_sk,
+ sum(ws_ext_sales_price) as sales,
+ sum(ws_net_profit) as profit
+ from plato.web_sales,
+ plato.date_dim,
+ plato.web_page
+ where ws_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and ws_web_page_sk = wp_web_page_sk
+ group by wp_web_page_sk),
+ wr as
+ (select wp_web_page_sk,
+ sum(wr_return_amt) as returns,
+ sum(wr_net_loss) as profit_loss
+ from plato.web_returns,
+ plato.date_dim,
+ plato.web_page
+ where wr_returned_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and wr_web_page_sk = wp_web_page_sk
+ group by wp_web_page_sk)
+ select channel
+ , id
+ , sum(sales) as sales
+ , sum(returns) as returns
+ , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+ , ss.s_store_sk as id
+ , sales
+ , coalesce(returns, 0::numeric) as returns
+ , (profit - coalesce(profit_loss,0::numeric)) as profit
+ from ss left join sr
+ on ss.s_store_sk = sr.s_store_sk
+ union all
+ select 'catalog channel' as channel
+ , cs_call_center_sk as id
+ , sales
+ , returns
+ , (profit - profit_loss) as profit
+ from cs
+ , cr
+ union all
+ select 'web channel' as channel
+ , ws.wp_web_page_sk as id
+ , sales
+ , coalesce(returns, 0::numeric) returns
+ , (profit - coalesce(profit_loss,0::numeric)) as profit
+ from ws left join wr
+ on ws.wp_web_page_sk = wr.wp_web_page_sk
+ ) x
+ group by rollup (channel, id)
+ order by channel
+ ,id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query77.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q78.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q78.sql
new file mode 100644
index 0000000000..e9d81de782
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q78.sql
@@ -0,0 +1,61 @@
+--!syntax_pg
+--TPC-DS Q78
+
+-- start query 1 in stream 0 using template ../query_templates/query78.tpl
+with ws as
+ (select d_year AS ws_sold_year, ws_item_sk,
+ ws_bill_customer_sk ws_customer_sk,
+ sum(ws_quantity) ws_qty,
+ sum(ws_wholesale_cost) ws_wc,
+ sum(ws_sales_price) ws_sp
+ from plato.web_sales
+ left join plato.web_returns on wr_order_number=ws_order_number and ws_item_sk=wr_item_sk
+ join plato.date_dim on ws_sold_date_sk = d_date_sk
+ where wr_order_number is null
+ group by d_year, ws_item_sk, ws_bill_customer_sk
+ ),
+cs as
+ (select d_year AS cs_sold_year, cs_item_sk,
+ cs_bill_customer_sk cs_customer_sk,
+ sum(cs_quantity) cs_qty,
+ sum(cs_wholesale_cost) cs_wc,
+ sum(cs_sales_price) cs_sp
+ from plato.catalog_sales
+ left join plato.catalog_returns on cr_order_number=cs_order_number and cs_item_sk=cr_item_sk
+ join plato.date_dim on cs_sold_date_sk = d_date_sk
+ where cr_order_number is null
+ group by d_year, cs_item_sk, cs_bill_customer_sk
+ ),
+ss as
+ (select d_year AS ss_sold_year, ss_item_sk,
+ ss_customer_sk,
+ sum(ss_quantity) ss_qty,
+ sum(ss_wholesale_cost) ss_wc,
+ sum(ss_sales_price) ss_sp
+ from plato.store_sales
+ left join plato.store_returns on sr_ticket_number=ss_ticket_number and ss_item_sk=sr_item_sk
+ join plato.date_dim on ss_sold_date_sk = d_date_sk
+ where sr_ticket_number is null
+ group by d_year, ss_item_sk, ss_customer_sk
+ )
+ select
+ss_sold_year, ss_item_sk, ss_customer_sk,
+round((ss_qty/(coalesce(ws_qty,0::int8)+coalesce(cs_qty,0::int8)))::numeric,2) ratio,
+ss_qty store_qty, ss_wc store_wholesale_cost, ss_sp store_sales_price,
+coalesce(ws_qty,0::int8)+coalesce(cs_qty,0::int8) other_chan_qty,
+coalesce(ws_wc,0::numeric)+coalesce(cs_wc,0::numeric) other_chan_wholesale_cost,
+coalesce(ws_sp,0::numeric)+coalesce(cs_sp,0::numeric) other_chan_sales_price
+from ss
+left join ws on (ws_sold_year=ss_sold_year and ws_item_sk=ss_item_sk and ws_customer_sk=ss_customer_sk)
+left join cs on (cs_sold_year=ss_sold_year and cs_item_sk=ss_item_sk and cs_customer_sk=ss_customer_sk)
+where (coalesce(ws_qty,0::int8)>0::int8 or coalesce(cs_qty, 0::int8)>0::int8) and ss_sold_year=2000
+order by
+ ss_sold_year, ss_item_sk, ss_customer_sk,
+ ss_qty desc, ss_wc desc, ss_sp desc,
+ other_chan_qty,
+ other_chan_wholesale_cost,
+ other_chan_sales_price,
+ ratio
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query78.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q79.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q79.sql
new file mode 100644
index 0000000000..106c147a1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q79.sql
@@ -0,0 +1,26 @@
+--!syntax_pg
+--TPC-DS Q79
+
+-- start query 1 in stream 0 using template ../query_templates/query79.tpl
+select
+ c_last_name,c_first_name,substr(s_city,1,30),ss_ticket_number,amt,profit
+ from
+ (select ss_ticket_number
+ ,ss_customer_sk
+ ,store.s_city
+ ,sum(ss_coupon_amt) amt
+ ,sum(ss_net_profit) profit
+ from plato.store_sales,plato.date_dim,plato.store,plato.household_demographics
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_store_sk = store.s_store_sk
+ and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+ and (household_demographics.hd_dep_count = 8 or household_demographics.hd_vehicle_count > 0)
+ and date_dim.d_dow = 1
+ and date_dim.d_year in (1998,1998+1,1998+2)
+ and store.s_number_employees between 200 and 295
+ group by ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city) ms,plato.customer
+ where ss_customer_sk = c_customer_sk
+ order by c_last_name,c_first_name,substr(s_city,1,30), profit
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query79.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q80.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q80.sql
new file mode 100644
index 0000000000..0ed10ead39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q80.sql
@@ -0,0 +1,99 @@
+--!syntax_pg
+--TPC-DS Q80
+
+-- start query 1 in stream 0 using template ../query_templates/query80.tpl
+with ssr as
+ (select s_store_id as store_id,
+ sum(ss_ext_sales_price) as sales,
+ sum(coalesce(sr_return_amt, 0::numeric)) as returns,
+ sum(ss_net_profit - coalesce(sr_net_loss, 0::numeric)) as profit
+ from plato.store_sales left outer join plato.store_returns on
+ (ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number),
+ plato.date_dim,
+ plato.store,
+ plato.item,
+ plato.promotion
+ where ss_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and ss_store_sk = s_store_sk
+ and ss_item_sk = i_item_sk
+ and i_current_price > 50::numeric
+ and ss_promo_sk = p_promo_sk
+ and p_channel_tv = 'N'
+ group by s_store_id)
+ ,
+ csr as
+ (select cp_catalog_page_id as catalog_page_id,
+ sum(cs_ext_sales_price) as sales,
+ sum(coalesce(cr_return_amount, 0::numeric)) as returns,
+ sum(cs_net_profit - coalesce(cr_net_loss, 0::numeric)) as profit
+ from plato.catalog_sales left outer join plato.catalog_returns on
+ (cs_item_sk = cr_item_sk and cs_order_number = cr_order_number),
+ plato.date_dim,
+ plato.catalog_page,
+ plato.item,
+ plato.promotion
+ where cs_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and cs_catalog_page_sk = cp_catalog_page_sk
+ and cs_item_sk = i_item_sk
+ and i_current_price > 50::numeric
+ and cs_promo_sk = p_promo_sk
+ and p_channel_tv = 'N'
+group by cp_catalog_page_id)
+ ,
+ wsr as
+ (select web_site_id,
+ sum(ws_ext_sales_price) as sales,
+ sum(coalesce(wr_return_amt, 0::numeric)) as returns,
+ sum(ws_net_profit - coalesce(wr_net_loss, 0::numeric)) as profit
+ from plato.web_sales left outer join plato.web_returns on
+ (ws_item_sk = wr_item_sk and ws_order_number = wr_order_number),
+ plato.date_dim,
+ plato.web_site,
+ plato.item,
+ plato.promotion
+ where ws_sold_date_sk = d_date_sk
+ and d_date between cast('1998-08-04' as date)
+ and (cast('1998-08-04' as date) + interval '30' day)::date
+ and ws_web_site_sk = web_site_sk
+ and ws_item_sk = i_item_sk
+ and i_current_price > 50::numeric
+ and ws_promo_sk = p_promo_sk
+ and p_channel_tv = 'N'
+group by web_site_id)
+ select channel
+ , id
+ , sum(sales) as sales
+ , sum(returns) as returns
+ , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+ , 'store' || store_id as id
+ , sales
+ , returns
+ , profit
+ from ssr
+ union all
+ select 'catalog channel' as channel
+ , 'catalog_page' || catalog_page_id as id
+ , sales
+ , returns
+ , profit
+ from csr
+ union all
+ select 'web channel' as channel
+ , 'web_site' || web_site_id as id
+ , sales
+ , returns
+ , profit
+ from wsr
+ ) x
+ group by rollup (channel, id)
+ order by channel
+ ,id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query80.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q81.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q81.sql
new file mode 100644
index 0000000000..e90c1f85ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q81.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-DS Q81
+
+-- start query 1 in stream 0 using template ../query_templates/query81.tpl
+with customer_total_return as
+ (select cr_returning_customer_sk as ctr_customer_sk
+ ,ca_state as ctr_state,
+ sum(cr_return_amt_inc_tax) as ctr_total_return
+ from plato.catalog_returns
+ ,plato.date_dim
+ ,plato.customer_address
+ where cr_returned_date_sk = d_date_sk
+ and d_year =1998
+ and cr_returning_addr_sk = ca_address_sk
+ group by cr_returning_customer_sk
+ ,ca_state )
+ select c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name
+ ,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset
+ ,ca_location_type,ctr_total_return
+ from customer_total_return ctr1
+ ,plato.customer_address
+ ,plato.customer
+ where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2::numeric
+ from customer_total_return ctr2
+ where ctr1.ctr_state = ctr2.ctr_state)
+ and ca_address_sk = c_current_addr_sk
+ and ca_state = 'IL'
+ and ctr1.ctr_customer_sk = c_customer_sk
+ order by c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name
+ ,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset
+ ,ca_location_type,ctr_total_return
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query81.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q82.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q82.sql
new file mode 100644
index 0000000000..9d641268b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q82.sql
@@ -0,0 +1,20 @@
+--!syntax_pg
+--TPC-DS Q82
+
+-- start query 1 in stream 0 using template ../query_templates/query82.tpl
+select i_item_id
+ ,i_item_desc
+ ,i_current_price
+ from plato.item, plato.inventory, plato.date_dim, plato.store_sales
+ where i_current_price between 30::numeric and (30+30)::numeric
+ and inv_item_sk = i_item_sk
+ and d_date_sk=inv_date_sk
+ and d_date between cast('2002-05-30' as date) and (cast('2002-05-30' as date) + interval '60' day)::date
+ and i_manufact_id in (437,129,727,663)
+ and inv_quantity_on_hand between 100 and 500
+ and ss_item_sk = i_item_sk
+ group by i_item_id,i_item_desc,i_current_price
+ order by i_item_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query82.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q83.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q83.sql
new file mode 100644
index 0000000000..0801e9902c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q83.sql
@@ -0,0 +1,70 @@
+--!syntax_pg
+--TPC-DS Q83
+
+-- start query 1 in stream 0 using template ../query_templates/query83.tpl
+with sr_items as
+ (select i_item_id item_id,
+ sum(sr_return_quantity) sr_item_qty
+ from plato.store_returns,
+ plato.item,
+ plato.date_dim
+ where sr_item_sk = i_item_sk
+ and d_date in
+ (select d_date
+ from plato.date_dim
+ where d_week_seq in
+ (select d_week_seq
+ from plato.date_dim
+ where d_date in ('1998-01-02'::date,'1998-10-15'::date,'1998-11-10'::date)))
+ and sr_returned_date_sk = d_date_sk
+ group by i_item_id),
+ cr_items as
+ (select i_item_id item_id,
+ sum(cr_return_quantity) cr_item_qty
+ from plato.catalog_returns,
+ plato.item,
+ plato.date_dim
+ where cr_item_sk = i_item_sk
+ and d_date in
+ (select d_date
+ from plato.date_dim
+ where d_week_seq in
+ (select d_week_seq
+ from plato.date_dim
+ where d_date in ('1998-01-02'::date,'1998-10-15'::date,'1998-11-10'::date)))
+ and cr_returned_date_sk = d_date_sk
+ group by i_item_id),
+ wr_items as
+ (select i_item_id item_id,
+ sum(wr_return_quantity) wr_item_qty
+ from plato.web_returns,
+ plato.item,
+ plato.date_dim
+ where wr_item_sk = i_item_sk
+ and d_date in
+ (select d_date
+ from plato.date_dim
+ where d_week_seq in
+ (select d_week_seq
+ from plato.date_dim
+ where d_date in ('1998-01-02'::date,'1998-10-15'::date,'1998-11-10'::date)))
+ and wr_returned_date_sk = d_date_sk
+ group by i_item_id)
+ select sr_items.item_id
+ ,sr_item_qty
+ ,sr_item_qty::numeric/(sr_item_qty+cr_item_qty+wr_item_qty)::numeric/3.0::numeric * 100::numeric sr_dev
+ ,cr_item_qty
+ ,cr_item_qty::numeric/(sr_item_qty+cr_item_qty+wr_item_qty)::numeric/3.0::numeric * 100::numeric cr_dev
+ ,wr_item_qty
+ ,wr_item_qty::numeric/(sr_item_qty+cr_item_qty+wr_item_qty)::numeric/3.0::numeric * 100::numeric wr_dev
+ ,(sr_item_qty+cr_item_qty+wr_item_qty)::numeric/3.0::numeric average
+ from sr_items
+ ,cr_items
+ ,wr_items
+ where sr_items.item_id=cr_items.item_id
+ and sr_items.item_id=wr_items.item_id
+ order by sr_items.item_id
+ ,sr_item_qty
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query83.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q84.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q84.sql
new file mode 100644
index 0000000000..edb7027691
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q84.sql
@@ -0,0 +1,24 @@
+--!syntax_pg
+--TPC-DS Q84
+
+-- start query 1 in stream 0 using template ../query_templates/query84.tpl
+select c_customer_id as customer_id
+ , coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername
+ from plato.customer
+ ,plato.customer_address
+ ,plato.customer_demographics
+ ,plato.household_demographics
+ ,plato.income_band
+ ,plato.store_returns
+ where ca_city = 'Hopewell'
+ and c_current_addr_sk = ca_address_sk
+ and ib_lower_bound >= 32287
+ and ib_upper_bound <= 32287 + 50000
+ and ib_income_band_sk = hd_income_band_sk
+ and cd_demo_sk = c_current_cdemo_sk
+ and hd_demo_sk = c_current_hdemo_sk
+ and sr_cdemo_sk = cd_demo_sk
+ order by c_customer_id
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query84.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q85.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q85.sql
new file mode 100644
index 0000000000..b438fd07c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q85.sql
@@ -0,0 +1,87 @@
+--!syntax_pg
+--TPC-DS Q85
+
+-- start query 1 in stream 0 using template ../query_templates/query85.tpl
+select substr(r_reason_desc,1,20) reason
+ ,avg(ws_quantity) avg_ws_q
+ ,avg(wr_refunded_cash) avg_wr_r
+ ,avg(wr_fee) avg_wr_f
+ from plato.web_sales, plato.web_returns, plato.web_page, plato.customer_demographics cd1,
+ plato.customer_demographics cd2, plato.customer_address, plato.date_dim, plato.reason
+ where ws_web_page_sk = wp_web_page_sk
+ and ws_item_sk = wr_item_sk
+ and ws_order_number = wr_order_number
+ and ws_sold_date_sk = d_date_sk and d_year = 1998
+ and cd1.cd_demo_sk = wr_refunded_cdemo_sk
+ and cd2.cd_demo_sk = wr_returning_cdemo_sk
+ and ca_address_sk = wr_refunded_addr_sk
+ and r_reason_sk = wr_reason_sk
+ and
+ (
+ (
+ cd1.cd_marital_status = 'M'
+ and
+ cd1.cd_marital_status = cd2.cd_marital_status
+ and
+ cd1.cd_education_status = '4 yr Degree'
+ and
+ cd1.cd_education_status = cd2.cd_education_status
+ and
+ ws_sales_price between 100.00::numeric and 150.00::numeric
+ )
+ or
+ (
+ cd1.cd_marital_status = 'D'
+ and
+ cd1.cd_marital_status = cd2.cd_marital_status
+ and
+ cd1.cd_education_status = 'Primary'
+ and
+ cd1.cd_education_status = cd2.cd_education_status
+ and
+ ws_sales_price between 50.00::numeric and 100.00::numeric
+ )
+ or
+ (
+ cd1.cd_marital_status = 'U'
+ and
+ cd1.cd_marital_status = cd2.cd_marital_status
+ and
+ cd1.cd_education_status = 'Advanced Degree'
+ and
+ cd1.cd_education_status = cd2.cd_education_status
+ and
+ ws_sales_price between 150.00::numeric and 200.00::numeric
+ )
+ )
+ and
+ (
+ (
+ ca_country = 'United States'
+ and
+ ca_state in ('KY', 'GA', 'NM')
+ and ws_net_profit between 100::numeric and 200::numeric
+ )
+ or
+ (
+ ca_country = 'United States'
+ and
+ ca_state in ('MT', 'OR', 'IN')
+ and ws_net_profit between 150::numeric and 300::numeric
+ )
+ or
+ (
+ ca_country = 'United States'
+ and
+ ca_state in ('WI', 'MO', 'WV')
+ and ws_net_profit between 50::numeric and 250::numeric
+ )
+ )
+group by r_reason_desc
+order by substr(r_reason_desc,1,20)
+ ,avg(ws_quantity)
+ ,avg(wr_refunded_cash)
+ ,avg(wr_fee)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query85.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q86.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q86.sql
new file mode 100644
index 0000000000..0d44f7482b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q86.sql
@@ -0,0 +1,29 @@
+--!syntax_pg
+--TPC-DS Q86
+
+-- start query 1 in stream 0 using template ../query_templates/query86.tpl
+select
+ sum(ws_net_paid) as total_sum
+ ,i_category
+ ,i_class
+ ,grouping(i_category)+grouping(i_class) as lochierarchy
+ ,rank() over (
+ partition by grouping(i_category)+grouping(i_class),
+ case when grouping(i_class) = 0 then i_category end
+ order by sum(ws_net_paid) desc) as rank_within_parent
+ from
+ plato.web_sales
+ ,plato.date_dim d1
+ ,plato.item
+ where
+ d1.d_month_seq between 1212 and 1212+11
+ and d1.d_date_sk = ws_sold_date_sk
+ and i_item_sk = ws_item_sk
+ group by rollup(i_category,i_class)
+ order by
+ lochierarchy desc,
+ case when lochierarchy = 0 then i_category end,
+ rank_within_parent
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query86.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q87.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q87.sql
new file mode 100644
index 0000000000..e3ff56344c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q87.sql
@@ -0,0 +1,26 @@
+--!syntax_pg
+--TPC-DS Q87
+
+-- start query 1 in stream 0 using template ../query_templates/query87.tpl
+select count(*)
+from ((select distinct c_last_name, c_first_name, d_date
+ from plato.store_sales, plato.date_dim, plato.customer
+ where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+ and store_sales.ss_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212+11)
+ except
+ (select distinct c_last_name, c_first_name, d_date
+ from plato.catalog_sales, plato.date_dim, plato.customer
+ where catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+ and catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212+11)
+ except
+ (select distinct c_last_name, c_first_name, d_date
+ from plato.web_sales, plato.date_dim, plato.customer
+ where web_sales.ws_sold_date_sk = date_dim.d_date_sk
+ and web_sales.ws_bill_customer_sk = customer.c_customer_sk
+ and d_month_seq between 1212 and 1212+11)
+) cool_cust
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query87.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q88.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q88.sql
new file mode 100644
index 0000000000..e2887788ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q88.sql
@@ -0,0 +1,97 @@
+--!syntax_pg
+--TPC-DS Q88
+
+-- start query 1 in stream 0 using template ../query_templates/query88.tpl
+select *
+from
+ (select count(*) h8_30_to_9
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 8
+ and time_dim.t_minute >= 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s1,
+ (select count(*) h9_to_9_30
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 9
+ and time_dim.t_minute < 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s2,
+ (select count(*) h9_30_to_10
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 9
+ and time_dim.t_minute >= 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s3,
+ (select count(*) h10_to_10_30
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 10
+ and time_dim.t_minute < 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s4,
+ (select count(*) h10_30_to_11
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 10
+ and time_dim.t_minute >= 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s5,
+ (select count(*) h11_to_11_30
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 11
+ and time_dim.t_minute < 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s6,
+ (select count(*) h11_30_to_12
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 11
+ and time_dim.t_minute >= 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s7,
+ (select count(*) h12_to_12_30
+ from plato.store_sales, plato.household_demographics , plato.time_dim, plato.store
+ where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 12
+ and time_dim.t_minute < 30
+ and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
+ (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+ (household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
+ and store.s_store_name = 'ese') s8
+;
+
+-- end query 1 in stream 0 using template ../query_templates/query88.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q89.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q89.sql
new file mode 100644
index 0000000000..7bc365056a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q89.sql
@@ -0,0 +1,31 @@
+--!syntax_pg
+--TPC-DS Q89
+
+-- start query 1 in stream 0 using template ../query_templates/query89.tpl
+select *
+from(
+select i_category, i_class, i_brand,
+ s_store_name, s_company_name,
+ d_moy,
+ sum(ss_sales_price) sum_sales,
+ avg(sum(ss_sales_price)) over
+ (partition by i_category, i_brand, s_store_name, s_company_name)
+ avg_monthly_sales
+from plato.item, plato.store_sales, plato.date_dim, plato.store
+where ss_item_sk = i_item_sk and
+ ss_sold_date_sk = d_date_sk and
+ ss_store_sk = s_store_sk and
+ d_year in (2000) and
+ ((i_category in ('Home','Books','Electronics') and
+ i_class in ('wallpaper','parenting','musical')
+ )
+ or (i_category in ('Shoes','Jewelry','Men') and
+ i_class in ('womens','birdal','pants')
+ ))
+group by i_category, i_class, i_brand,
+ s_store_name, s_company_name, d_moy) tmp1
+where case when (avg_monthly_sales <> 0::numeric) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null::numeric end > 0.1::numeric
+order by sum_sales - avg_monthly_sales, s_store_name
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query89.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q90.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q90.sql
new file mode 100644
index 0000000000..cf4342c67c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q90.sql
@@ -0,0 +1,25 @@
+--!syntax_pg
+--TPC-DS Q90
+
+-- start query 1 in stream 0 using template ../query_templates/query90.tpl
+select cast(amc as decimal(15,4))/cast(pmc as decimal(15,4)) am_pm_ratio
+ from ( select count(*) amc
+ from plato.web_sales, plato.household_demographics , plato.time_dim, plato.web_page
+ where ws_sold_time_sk = time_dim.t_time_sk
+ and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+ and ws_web_page_sk = web_page.wp_web_page_sk
+ and time_dim.t_hour between 6 and 6+1
+ and household_demographics.hd_dep_count = 8
+ and web_page.wp_char_count between 5000 and 5200) at,
+ ( select 1 + count(*) pmc
+ from plato.web_sales, plato.household_demographics , plato.time_dim, plato.web_page
+ where ws_sold_time_sk = time_dim.t_time_sk
+ and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+ and ws_web_page_sk = web_page.wp_web_page_sk
+ and time_dim.t_hour between 14 and 14+1
+ and household_demographics.hd_dep_count = 8
+ and web_page.wp_char_count between 5000 and 5200) pt
+ order by am_pm_ratio
+ limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query90.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q91.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q91.sql
new file mode 100644
index 0000000000..3fa68d2371
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q91.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-DS Q91
+
+-- start query 1 in stream 0 using template ../query_templates/query91.tpl
+select
+ cc_call_center_id Call_Center,
+ cc_name Call_Center_Name,
+ cc_manager Manager,
+ sum(cr_net_loss) Returns_Loss
+from
+ plato.call_center,
+ plato.catalog_returns,
+ plato.date_dim,
+ plato.customer,
+ plato.customer_address,
+ plato.customer_demographics,
+ plato.household_demographics
+where
+ cr_call_center_sk = cc_call_center_sk
+and cr_returned_date_sk = d_date_sk
+and cr_returning_customer_sk= c_customer_sk
+and cd_demo_sk = c_current_cdemo_sk
+and hd_demo_sk = c_current_hdemo_sk
+and ca_address_sk = c_current_addr_sk
+and d_year = 1999
+and d_moy = 11
+and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown')
+ or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree'))
+and hd_buy_potential like '0-500%'
+and ca_gmt_offset = -7::numeric
+group by cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status
+order by sum(cr_net_loss) desc;
+
+-- end query 1 in stream 0 using template ../query_templates/query91.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q92.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q92.sql
new file mode 100644
index 0000000000..262bcdc718
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q92.sql
@@ -0,0 +1,33 @@
+--!syntax_pg
+--TPC-DS Q92
+
+-- start query 1 in stream 0 using template ../query_templates/query92.tpl
+select
+ sum(ws_ext_discount_amt) as "Excess Discount Amount"
+from
+ plato.web_sales
+ ,plato.item
+ ,plato.date_dim
+where
+i_manufact_id = 269
+and i_item_sk = ws_item_sk
+and d_date between '1998-03-18'::date and
+ (cast('1998-03-18' as date) + interval '90' day)::date
+and d_date_sk = ws_sold_date_sk
+and ws_ext_discount_amt
+ > (
+ SELECT
+ 1.3::numeric * avg(ws_ext_discount_amt)
+ FROM
+ plato.web_sales
+ ,plato.date_dim
+ WHERE
+ ws_item_sk = i_item_sk
+ and d_date between '1998-03-18'::date and
+ (cast('1998-03-18' as date) + interval '90' day)::date
+ and d_date_sk = ws_sold_date_sk
+ )
+order by sum(ws_ext_discount_amt)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query92.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q93.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q93.sql
new file mode 100644
index 0000000000..4dadc188eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q93.sql
@@ -0,0 +1,21 @@
+--!syntax_pg
+--TPC-DS Q93
+
+-- start query 1 in stream 0 using template ../query_templates/query93.tpl
+select ss_customer_sk
+ ,sum(act_sales) sumsales
+ from (select ss_item_sk
+ ,ss_ticket_number
+ ,ss_customer_sk
+ ,case when sr_return_quantity is not null then (ss_quantity-sr_return_quantity)::numeric*ss_sales_price
+ else (ss_quantity::numeric*ss_sales_price) end act_sales
+ from plato.store_sales left outer join plato.store_returns on (sr_item_sk = ss_item_sk
+ and sr_ticket_number = ss_ticket_number)
+ ,plato.reason
+ where sr_reason_sk = r_reason_sk
+ and r_reason_desc = 'Did not like the warranty') t
+ group by ss_customer_sk
+ order by sumsales, ss_customer_sk
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query93.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q94.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q94.sql
new file mode 100644
index 0000000000..daacc6aa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q94.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-DS Q94
+
+-- start query 1 in stream 0 using template ../query_templates/query94.tpl
+select
+ count(distinct ws_order_number) as "order count"
+ ,sum(ws_ext_ship_cost) as "total shipping cost"
+ ,sum(ws_net_profit) as "total net profit"
+from
+ plato.web_sales ws1
+ ,plato.date_dim
+ ,plato.customer_address
+ ,plato.web_site
+where
+ d_date between '1999-5-01'::date and
+ (cast('1999-5-01' as date) + interval '60' day)::date
+and ws1.ws_ship_date_sk = d_date_sk
+and ws1.ws_ship_addr_sk = ca_address_sk
+and ca_state = 'TX'
+and ws1.ws_web_site_sk = web_site_sk
+and web_company_name = 'pri'
+and exists (select *
+ from plato.web_sales ws2
+ where ws1.ws_order_number = ws2.ws_order_number
+ and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
+and not exists(select *
+ from plato.web_returns wr1
+ where ws1.ws_order_number = wr1.wr_order_number)
+order by count(distinct ws_order_number)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query94.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q95.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q95.sql
new file mode 100644
index 0000000000..22bf4259f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q95.sql
@@ -0,0 +1,35 @@
+--!syntax_pg
+--TPC-DS Q95
+
+-- start query 1 in stream 0 using template ../query_templates/query95.tpl
+with ws_wh as
+(select ws1.ws_order_number,ws1.ws_warehouse_sk wh1,ws2.ws_warehouse_sk wh2
+ from plato.web_sales ws1,plato.web_sales ws2
+ where ws1.ws_order_number = ws2.ws_order_number
+ and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
+ select
+ count(distinct ws_order_number) as "order count"
+ ,sum(ws_ext_ship_cost) as "total shipping cost"
+ ,sum(ws_net_profit) as "total net profit"
+from
+ plato.web_sales ws1
+ ,plato.date_dim
+ ,plato.customer_address
+ ,plato.web_site
+where
+ d_date between '1999-5-01'::date and
+ (cast('1999-5-01' as date) + interval '60' day)::date
+and ws1.ws_ship_date_sk = d_date_sk
+and ws1.ws_ship_addr_sk = ca_address_sk
+and ca_state = 'TX'
+and ws1.ws_web_site_sk = web_site_sk
+and web_company_name = 'pri'
+and ws1.ws_order_number in (select ws_order_number
+ from ws_wh)
+and ws1.ws_order_number in (select wr_order_number
+ from plato.web_returns,ws_wh
+ where wr_order_number = ws_wh.ws_order_number)
+order by count(distinct ws_order_number)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query95.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q96.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q96.sql
new file mode 100644
index 0000000000..d7b1e2032b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q96.sql
@@ -0,0 +1,19 @@
+--!syntax_pg
+--TPC-DS Q96
+
+-- start query 1 in stream 0 using template ../query_templates/query96.tpl
+select count(*)
+from plato.store_sales
+ ,plato.household_demographics
+ ,plato.time_dim, plato.store
+where ss_sold_time_sk = time_dim.t_time_sk
+ and ss_hdemo_sk = household_demographics.hd_demo_sk
+ and ss_store_sk = s_store_sk
+ and time_dim.t_hour = 8
+ and time_dim.t_minute >= 30
+ and household_demographics.hd_dep_count = 5
+ and store.s_store_name = 'ese'
+order by count(*)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query96.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q97.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q97.sql
new file mode 100644
index 0000000000..6202209359
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q97.sql
@@ -0,0 +1,28 @@
+--!syntax_pg
+--TPC-DS Q97
+
+-- start query 1 in stream 0 using template ../query_templates/query97.tpl
+with ssci as (
+select ss_customer_sk customer_sk
+ ,ss_item_sk item_sk
+from plato.store_sales,plato.date_dim
+where ss_sold_date_sk = d_date_sk
+ and d_month_seq between 1212 and 1212 + 11
+group by ss_customer_sk
+ ,ss_item_sk),
+csci as(
+ select cs_bill_customer_sk customer_sk
+ ,cs_item_sk item_sk
+from plato.catalog_sales,plato.date_dim
+where cs_sold_date_sk = d_date_sk
+ and d_month_seq between 1212 and 1212 + 11
+group by cs_bill_customer_sk
+ ,cs_item_sk)
+ select sum(case when ssci.customer_sk is not null and csci.customer_sk is null then 1 else 0 end) store_only
+ ,sum(case when ssci.customer_sk is null and csci.customer_sk is not null then 1 else 0 end) catalog_only
+ ,sum(case when ssci.customer_sk is not null and csci.customer_sk is not null then 1 else 0 end) store_and_catalog
+from ssci full outer join csci on (ssci.customer_sk=csci.customer_sk
+ and ssci.item_sk = csci.item_sk)
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query97.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q98.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q98.sql
new file mode 100644
index 0000000000..a6342cfc08
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q98.sql
@@ -0,0 +1,36 @@
+--!syntax_pg
+--TPC-DS Q98
+
+-- start query 1 in stream 0 using template ../query_templates/query98.tpl
+select i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+ ,sum(ss_ext_sales_price) as itemrevenue
+ ,sum(ss_ext_sales_price)*100::numeric/sum(sum(ss_ext_sales_price)) over
+ (partition by i_class) as revenueratio
+from
+ plato.store_sales
+ ,plato.item
+ ,plato.date_dim
+where
+ ss_item_sk = i_item_sk
+ and i_category in ('Jewelry', 'Sports', 'Books')
+ and ss_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date)
+ and (cast('2001-01-12' as date) + interval '30' day)::date
+group by
+ i_item_id
+ ,i_item_desc
+ ,i_category
+ ,i_class
+ ,i_current_price
+order by
+ i_category
+ ,i_class
+ ,i_item_id
+ ,i_item_desc
+ ,revenueratio;
+
+-- end query 1 in stream 0 using template ../query_templates/query98.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/q99.sql b/yql/essentials/tests/sql/suites/pg-tpcds/q99.sql
new file mode 100644
index 0000000000..997a52b9c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/q99.sql
@@ -0,0 +1,38 @@
+--!syntax_pg
+--TPC-DS Q99
+
+-- start query 1 in stream 0 using template ../query_templates/query99.tpl
+select
+ substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,cc_name
+ ,sum(case when (cs_ship_date_sk - cs_sold_date_sk <= 30 ) then 1 else 0 end) as "30 days"
+ ,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 30) and
+ (cs_ship_date_sk - cs_sold_date_sk <= 60) then 1 else 0 end ) as "31-60 days"
+ ,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 60) and
+ (cs_ship_date_sk - cs_sold_date_sk <= 90) then 1 else 0 end) as "61-90 days"
+ ,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 90) and
+ (cs_ship_date_sk - cs_sold_date_sk <= 120) then 1 else 0 end) as "91-120 days"
+ ,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 120) then 1 else 0 end) as ">120 days"
+from
+ plato.catalog_sales
+ ,plato.warehouse
+ ,plato.ship_mode
+ ,plato.call_center
+ ,plato.date_dim
+where
+ d_month_seq between 1212 and 1212 + 11
+and cs_ship_date_sk = d_date_sk
+and cs_warehouse_sk = w_warehouse_sk
+and cs_ship_mode_sk = sm_ship_mode_sk
+and cs_call_center_sk = cc_call_center_sk
+group by
+ substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,cc_name
+order by substr(w_warehouse_name,1,20)
+ ,sm_type
+ ,cc_name
+limit 100;
+
+-- end query 1 in stream 0 using template ../query_templates/query99.tpl
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt b/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt.attr
new file mode 100644
index 0000000000..fd3f41bb77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/reason.txt.attr
@@ -0,0 +1,9 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["r_reason_sk";["PgType";"int4";];];
+ ["r_reason_id";["PgType";"text";];];
+ ["r_reason_desc";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt b/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt.attr
new file mode 100644
index 0000000000..51e9bb003e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/ship_mode.txt.attr
@@ -0,0 +1,12 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["sm_ship_mode_sk";["PgType";"int4";];];
+ ["sm_ship_mode_id";["PgType";"text";];];
+ ["sm_type";["PgType";"text";];];
+ ["sm_code";["PgType";"text";];];
+ ["sm_carrier";["PgType";"text";];];
+ ["sm_contract";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store.txt b/yql/essentials/tests/sql/suites/pg-tpcds/store.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/store.txt.attr
new file mode 100644
index 0000000000..20fb103d16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store.txt.attr
@@ -0,0 +1,35 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["s_store_sk";["PgType";"int4";];];
+ ["s_store_id";["PgType";"text";];];
+ ["s_rec_start_date";["PgType";"date";];];
+ ["s_rec_end_date";["PgType";"date";];];
+ ["s_closed_date_sk";["PgType";"int4";];];
+ ["s_store_name";["PgType";"text";];];
+ ["s_number_employees";["PgType";"int4";];];
+ ["s_floor_space";["PgType";"int4";];];
+ ["s_hours";["PgType";"text";];];
+ ["s_manager";["PgType";"text";];];
+ ["s_market_id";["PgType";"int4";];];
+ ["s_geography_class";["PgType";"text";];];
+ ["s_market_desc";["PgType";"text";];];
+ ["s_market_manager";["PgType";"text";];];
+ ["s_division_id";["PgType";"int4";];];
+ ["s_division_name";["PgType";"text";];];
+ ["s_company_id";["PgType";"int4";];];
+ ["s_company_name";["PgType";"text";];];
+ ["s_street_number";["PgType";"text";];];
+ ["s_street_name";["PgType";"text";];];
+ ["s_street_type";["PgType";"text";];];
+ ["s_suite_number";["PgType";"text";];];
+ ["s_city";["PgType";"text";];];
+ ["s_county";["PgType";"text";];];
+ ["s_state";["PgType";"text";];];
+ ["s_zip";["PgType";"text";];];
+ ["s_country";["PgType";"text";];];
+ ["s_gmt_offset";["PgType";"numeric";];];
+ ["s_tax_precentage";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt b/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt.attr
new file mode 100644
index 0000000000..19ce866250
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store_returns.txt.attr
@@ -0,0 +1,26 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["sr_returned_date_sk";["PgType";"int4";];];
+ ["sr_return_time_sk";["PgType";"int4";];];
+ ["sr_item_sk";["PgType";"int4";];];
+ ["sr_customer_sk";["PgType";"int4";];];
+ ["sr_cdemo_sk";["PgType";"int4";];];
+ ["sr_hdemo_sk";["PgType";"int4";];];
+ ["sr_addr_sk";["PgType";"int4";];];
+ ["sr_store_sk";["PgType";"int4";];];
+ ["sr_reason_sk";["PgType";"int4";];];
+ ["sr_ticket_number";["PgType";"int4";];];
+ ["sr_return_quantity";["PgType";"int4";];];
+ ["sr_return_amt";["PgType";"numeric";];];
+ ["sr_return_tax";["PgType";"numeric";];];
+ ["sr_return_amt_inc_tax";["PgType";"numeric";];];
+ ["sr_fee";["PgType";"numeric";];];
+ ["sr_return_ship_cost";["PgType";"numeric";];];
+ ["sr_refunded_cash";["PgType";"numeric";];];
+ ["sr_reversed_charge";["PgType";"numeric";];];
+ ["sr_store_credit";["PgType";"numeric";];];
+ ["sr_net_loss";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt b/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt.attr
new file mode 100644
index 0000000000..16235a21fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/store_sales.txt.attr
@@ -0,0 +1,29 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ss_sold_date_sk";["PgType";"int4";];];
+ ["ss_sold_time_sk";["PgType";"int4";];];
+ ["ss_item_sk";["PgType";"int4";];];
+ ["ss_customer_sk";["PgType";"int4";];];
+ ["ss_cdemo_sk";["PgType";"int4";];];
+ ["ss_hdemo_sk";["PgType";"int4";];];
+ ["ss_addr_sk";["PgType";"int4";];];
+ ["ss_store_sk";["PgType";"int4";];];
+ ["ss_promo_sk";["PgType";"int4";];];
+ ["ss_ticket_number";["PgType";"int4";];];
+ ["ss_quantity";["PgType";"int4";];];
+ ["ss_wholesale_cost";["PgType";"numeric";];];
+ ["ss_list_price";["PgType";"numeric";];];
+ ["ss_sales_price";["PgType";"numeric";];];
+ ["ss_ext_discount_amt";["PgType";"numeric";];];
+ ["ss_ext_sales_price";["PgType";"numeric";];];
+ ["ss_ext_wholesale_cost";["PgType";"numeric";];];
+ ["ss_ext_list_price";["PgType";"numeric";];];
+ ["ss_ext_tax";["PgType";"numeric";];];
+ ["ss_coupon_amt";["PgType";"numeric";];];
+ ["ss_net_paid";["PgType";"numeric";];];
+ ["ss_net_paid_inc_tax";["PgType";"numeric";];];
+ ["ss_net_profit";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt b/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt.attr
new file mode 100644
index 0000000000..4ce0b9f06d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/time_dim.txt.attr
@@ -0,0 +1,16 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["t_time_sk";["PgType";"int4";];];
+ ["t_time_id";["PgType";"text";];];
+ ["t_time";["PgType";"int4";];];
+ ["t_hour";["PgType";"int4";];];
+ ["t_minute";["PgType";"int4";];];
+ ["t_second";["PgType";"int4";];];
+ ["t_am_pm";["PgType";"text";];];
+ ["t_shift";["PgType";"text";];];
+ ["t_sub_shift";["PgType";"text";];];
+ ["t_meal_time";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt b/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt.attr
new file mode 100644
index 0000000000..1bb8d17441
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/warehouse.txt.attr
@@ -0,0 +1,20 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["w_warehouse_sk";["PgType";"int4";];];
+ ["w_warehouse_id";["PgType";"text";];];
+ ["w_warehouse_name";["PgType";"text";];];
+ ["w_warehouse_sq_ft";["PgType";"int4";];];
+ ["w_street_number";["PgType";"text";];];
+ ["w_street_name";["PgType";"text";];];
+ ["w_street_type";["PgType";"text";];];
+ ["w_suite_number";["PgType";"text";];];
+ ["w_city";["PgType";"text";];];
+ ["w_county";["PgType";"text";];];
+ ["w_state";["PgType";"text";];];
+ ["w_zip";["PgType";"text";];];
+ ["w_country";["PgType";"text";];];
+ ["w_gmt_offset";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt b/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt.attr
new file mode 100644
index 0000000000..627f5e6b90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_page.txt.attr
@@ -0,0 +1,20 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["wp_web_page_sk";["PgType";"int4";];];
+ ["wp_web_page_id";["PgType";"text";];];
+ ["wp_rec_start_date";["PgType";"date";];];
+ ["wp_rec_end_date";["PgType";"date";];];
+ ["wp_creation_date_sk";["PgType";"int4";];];
+ ["wp_access_date_sk";["PgType";"int4";];];
+ ["wp_autogen_flag";["PgType";"text";];];
+ ["wp_customer_sk";["PgType";"int4";];];
+ ["wp_url";["PgType";"text";];];
+ ["wp_type";["PgType";"text";];];
+ ["wp_char_count";["PgType";"int4";];];
+ ["wp_link_count";["PgType";"int4";];];
+ ["wp_image_count";["PgType";"int4";];];
+ ["wp_max_ad_count";["PgType";"int4";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt b/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt.attr
new file mode 100644
index 0000000000..591d69b136
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_returns.txt.attr
@@ -0,0 +1,30 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["wr_returned_date_sk";["PgType";"int4";];];
+ ["wr_returned_time_sk";["PgType";"int4";];];
+ ["wr_item_sk";["PgType";"int4";];];
+ ["wr_refunded_customer_sk";["PgType";"int4";];];
+ ["wr_refunded_cdemo_sk";["PgType";"int4";];];
+ ["wr_refunded_hdemo_sk";["PgType";"int4";];];
+ ["wr_refunded_addr_sk";["PgType";"int4";];];
+ ["wr_returning_customer_sk";["PgType";"int4";];];
+ ["wr_returning_cdemo_sk";["PgType";"int4";];];
+ ["wr_returning_hdemo_sk";["PgType";"int4";];];
+ ["wr_returning_addr_sk";["PgType";"int4";];];
+ ["wr_web_page_sk";["PgType";"int4";];];
+ ["wr_reason_sk";["PgType";"int4";];];
+ ["wr_order_number";["PgType";"int4";];];
+ ["wr_return_quantity";["PgType";"int4";];];
+ ["wr_return_amt";["PgType";"numeric";];];
+ ["wr_return_tax";["PgType";"numeric";];];
+ ["wr_return_amt_inc_tax";["PgType";"numeric";];];
+ ["wr_fee";["PgType";"numeric";];];
+ ["wr_return_ship_cost";["PgType";"numeric";];];
+ ["wr_refunded_cash";["PgType";"numeric";];];
+ ["wr_reversed_charge";["PgType";"numeric";];];
+ ["wr_account_credit";["PgType";"numeric";];];
+ ["wr_net_loss";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt b/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt.attr
new file mode 100644
index 0000000000..7a4c5dda75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_sales.txt.attr
@@ -0,0 +1,40 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ws_sold_date_sk";["PgType";"int4";];];
+ ["ws_sold_time_sk";["PgType";"int4";];];
+ ["ws_ship_date_sk";["PgType";"int4";];];
+ ["ws_item_sk";["PgType";"int4";];];
+ ["ws_bill_customer_sk";["PgType";"int4";];];
+ ["ws_bill_cdemo_sk";["PgType";"int4";];];
+ ["ws_bill_hdemo_sk";["PgType";"int4";];];
+ ["ws_bill_addr_sk";["PgType";"int4";];];
+ ["ws_ship_customer_sk";["PgType";"int4";];];
+ ["ws_ship_cdemo_sk";["PgType";"int4";];];
+ ["ws_ship_hdemo_sk";["PgType";"int4";];];
+ ["ws_ship_addr_sk";["PgType";"int4";];];
+ ["ws_web_page_sk";["PgType";"int4";];];
+ ["ws_web_site_sk";["PgType";"int4";];];
+ ["ws_ship_mode_sk";["PgType";"int4";];];
+ ["ws_warehouse_sk";["PgType";"int4";];];
+ ["ws_promo_sk";["PgType";"int4";];];
+ ["ws_order_number";["PgType";"int4";];];
+ ["ws_quantity";["PgType";"int4";];];
+ ["ws_wholesale_cost";["PgType";"numeric";];];
+ ["ws_list_price";["PgType";"numeric";];];
+ ["ws_sales_price";["PgType";"numeric";];];
+ ["ws_ext_discount_amt";["PgType";"numeric";];];
+ ["ws_ext_sales_price";["PgType";"numeric";];];
+ ["ws_ext_wholesale_cost";["PgType";"numeric";];];
+ ["ws_ext_list_price";["PgType";"numeric";];];
+ ["ws_ext_tax";["PgType";"numeric";];];
+ ["ws_coupon_amt";["PgType";"numeric";];];
+ ["ws_ext_ship_cost";["PgType";"numeric";];];
+ ["ws_net_paid";["PgType";"numeric";];];
+ ["ws_net_paid_inc_tax";["PgType";"numeric";];];
+ ["ws_net_paid_inc_ship";["PgType";"numeric";];];
+ ["ws_net_paid_inc_ship_tax";["PgType";"numeric";];];
+ ["ws_net_profit";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt b/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt.attr b/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt.attr
new file mode 100644
index 0000000000..9244afbf49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpcds/web_site.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["web_site_sk";["PgType";"int4";];];
+ ["web_site_id";["PgType";"text";];];
+ ["web_rec_start_date";["PgType";"date";];];
+ ["web_rec_end_date";["PgType";"date";];];
+ ["web_name";["PgType";"text";];];
+ ["web_open_date_sk";["PgType";"int4";];];
+ ["web_close_date_sk";["PgType";"int4";];];
+ ["web_class";["PgType";"text";];];
+ ["web_manager";["PgType";"text";];];
+ ["web_mkt_id";["PgType";"int4";];];
+ ["web_mkt_class";["PgType";"text";];];
+ ["web_mkt_desc";["PgType";"text";];];
+ ["web_market_manager";["PgType";"text";];];
+ ["web_company_id";["PgType";"int4";];];
+ ["web_company_name";["PgType";"text";];];
+ ["web_street_number";["PgType";"text";];];
+ ["web_street_name";["PgType";"text";];];
+ ["web_street_type";["PgType";"text";];];
+ ["web_suite_number";["PgType";"text";];];
+ ["web_city";["PgType";"text";];];
+ ["web_county";["PgType";"text";];];
+ ["web_state";["PgType";"text";];];
+ ["web_zip";["PgType";"text";];];
+ ["web_country";["PgType";"text";];];
+ ["web_gmt_offset";["PgType";"numeric";];];
+ ["web_tax_percentage";["PgType";"numeric";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/customer.txt b/yql/essentials/tests/sql/suites/pg-tpch/customer.txt
new file mode 100644
index 0000000000..28e42f042d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/customer.txt
@@ -0,0 +1 @@
+{"c_acctbal"="\0\2\0\0\0\0\0\2\x11\xAA\x1D\xB0";"c_address"="ocIz 2S9MsEyfkL";"c_comment"="dolites alongside of the furiously pending theodolites affix closely idly bold instruction";"c_custkey"=750001;"c_mktsegment"="FURNITURE";"c_name"="Customer#000750001";"c_nationkey"=6;"c_phone"="16-182-876-9496";};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/customer.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/customer.txt.attr
new file mode 100644
index 0000000000..858a12536d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/customer.txt.attr
@@ -0,0 +1,14 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["c_custkey";["PgType";"int4";];];
+ ["c_name";["PgType";"text";];];
+ ["c_address";["PgType";"text";];];
+ ["c_nationkey";["PgType";"int4";];];
+ ["c_phone";["PgType";"text";];];
+ ["c_acctbal";["PgType";"numeric";];];
+ ["c_mktsegment";["PgType";"text";];];
+ ["c_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/default.cfg b/yql/essentials/tests/sql/suites/pg-tpch/default.cfg
new file mode 100644
index 0000000000..f3c9624348
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/default.cfg
@@ -0,0 +1,8 @@
+in customer customer.txt
+in lineitem lineitem.txt
+in nation nation.txt
+in orders orders.txt
+in part part.txt
+in partsupp partsupp.txt
+in region region.txt
+in supplier supplier.txt
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt b/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt
new file mode 100644
index 0000000000..c730fcaafb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt
@@ -0,0 +1 @@
+{"l_comment"="ckages boost throug";"l_commitdate"="\xFF\xFF\xF9V";"l_discount"="\0\1\xFF\xFF\0\0\0\2\2X";"l_extendedprice"="\0\3\0\1\0\0\0\2\0\2\6\xEF\x1B\xBC";"l_linenumber"=1;"l_linestatus"="F";"l_orderkey"=5997378;"l_partkey"=1292154;"l_quantity"="\0\1\0\0\0\0\0\0\0\x13";"l_receiptdate"="\xFF\xFF\xF9?";"l_returnflag"="A";"l_shipdate"="\xFF\xFF\xF9<";"l_shipinstruct"="COLLECT COD";"l_shipmode"="RAIL";"l_suppkey"=67191;"l_tax"="\0\1\xFF\xFF\0\0\0\2\0\xC8";};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt.attr
new file mode 100644
index 0000000000..f6de3aba92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/lineitem.txt.attr
@@ -0,0 +1,22 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["l_orderkey";["PgType";"int4";];];
+ ["l_partkey";["PgType";"int4";];];
+ ["l_suppkey";["PgType";"int4";];];
+ ["l_linenumber";["PgType";"int4";];];
+ ["l_quantity";["PgType";"numeric";];];
+ ["l_extendedprice";["PgType";"numeric";];];
+ ["l_discount";["PgType";"numeric";];];
+ ["l_tax";["PgType";"numeric";];];
+ ["l_returnflag";["PgType";"text";];];
+ ["l_linestatus";["PgType";"text";];];
+ ["l_shipdate";["PgType";"date";];];
+ ["l_commitdate";["PgType";"date";];];
+ ["l_receiptdate";["PgType";"date";];];
+ ["l_shipinstruct";["PgType";"text";];];
+ ["l_shipmode";["PgType";"text";];];
+ ["l_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/nation.txt b/yql/essentials/tests/sql/suites/pg-tpch/nation.txt
new file mode 100644
index 0000000000..b3784e0a7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/nation.txt
@@ -0,0 +1 @@
+{"n_comment"=" haggle. carefully final deposits detect slyly agai";"n_name"="ALGERIA";"n_nationkey"=0;"n_regionkey"=0;};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/nation.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/nation.txt.attr
new file mode 100644
index 0000000000..984875af2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/nation.txt.attr
@@ -0,0 +1,10 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["n_nationkey";["PgType";"int4";];];
+ ["n_name";["PgType";"text";];];
+ ["n_regionkey";["PgType";"int4";];];
+ ["n_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/orders.txt b/yql/essentials/tests/sql/suites/pg-tpch/orders.txt
new file mode 100644
index 0000000000..59a7a09401
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/orders.txt
@@ -0,0 +1 @@
+{"o_clerk"="Clerk#000006222";"o_comment"=" ironic platelets. final instructions haggle ";"o_custkey"=1110145;"o_orderdate"="\xFF\xFF\xF6k";"o_orderkey"=55714306;"o_orderpriority"="4-NOT SPECIFIED";"o_orderstatus"="F";"o_shippriority"=0;"o_totalprice"="\0\3\0\1\0\0\0\1\0\x10\x1A\xB2\x1BX";};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/orders.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/orders.txt.attr
new file mode 100644
index 0000000000..dc3829bfe4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/orders.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["o_orderkey";["PgType";"int4";];];
+ ["o_custkey";["PgType";"int4";];];
+ ["o_orderstatus";["PgType";"text";];];
+ ["o_totalprice";["PgType";"numeric";];];
+ ["o_orderdate";["PgType";"date";];];
+ ["o_orderpriority";["PgType";"text";];];
+ ["o_clerk";["PgType";"text";];];
+ ["o_shippriority";["PgType";"int4";];];
+ ["o_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/part.txt b/yql/essentials/tests/sql/suites/pg-tpch/part.txt
new file mode 100644
index 0000000000..34b4faf5b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/part.txt
@@ -0,0 +1 @@
+{"p_brand"="Brand#13";"p_comment"="ly. slyly ironi";"p_container"="JUMBO PKG";"p_mfgr"="Manufacturer#1";"p_name"="goldenrod lavender spring chocolate lace";"p_partkey"=1;"p_retailprice"="\0\1\0\0\0\0\0\0\3\x85";"p_size"=7;"p_type"="PROMO BURNISHED COPPER";};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/part.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/part.txt.attr
new file mode 100644
index 0000000000..c4d0a973fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/part.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["p_partkey";["PgType";"int4";];];
+ ["p_name";["PgType";"text";];];
+ ["p_mfgr";["PgType";"text";];];
+ ["p_brand";["PgType";"text";];];
+ ["p_type";["PgType";"text";];];
+ ["p_size";["PgType";"int4";];];
+ ["p_container";["PgType";"text";];];
+ ["p_retailprice";["PgType";"numeric";];];
+ ["p_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt b/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt
new file mode 100644
index 0000000000..7ccfca7134
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt
@@ -0,0 +1 @@
+{"ps_availqty"=3903;"ps_comment"="olites. blithely ironic accounts sublate furiously slow instructions. blithely ironic deposits pr";"ps_partkey"=1400001;"ps_suppkey"=2;"ps_supplycost"="\0\2\0\0\0\0\0\2\3Y\x0E\xD8";};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt.attr
new file mode 100644
index 0000000000..7e6a2bd73c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/partsupp.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ps_partkey";["PgType";"int4";];];
+ ["ps_suppkey";["PgType";"int4";];];
+ ["ps_availqty";["PgType";"int4";];];
+ ["ps_supplycost";["PgType";"numeric";];];
+ ["ps_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q01.sql b/yql/essentials/tests/sql/suites/pg-tpch/q01.sql
new file mode 100644
index 0000000000..7198f496bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q01.sql
@@ -0,0 +1,25 @@
+--!syntax_pg
+--TPC-H Q1
+
+
+select
+l_returnflag,
+l_linestatus,
+sum(l_quantity) as sum_qty,
+sum(l_extendedprice) as sum_base_price,
+sum(l_extendedprice*(1::numeric-l_discount)) as sum_disc_price,
+sum(l_extendedprice*(1::numeric-l_discount)*(1::numeric+l_tax)) as sum_charge,
+avg(l_quantity) as avg_qty,
+avg(l_extendedprice) as avg_price,
+avg(l_discount) as avg_disc,
+count(*) as count_order
+from
+plato."lineitem"
+where
+l_shipdate <= date '1998-12-01' - interval '90' day
+group by
+l_returnflag,
+l_linestatus
+order by
+l_returnflag,
+l_linestatus;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q02.sql b/yql/essentials/tests/sql/suites/pg-tpch/q02.sql
new file mode 100644
index 0000000000..91349256c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q02.sql
@@ -0,0 +1,49 @@
+--!syntax_pg
+--ignore runonopt plan diff
+--TPC-H Q2
+
+
+select
+s_acctbal,
+s_name,
+n_name,
+p_partkey,
+p_mfgr,
+s_address,
+s_phone,
+s_comment
+from
+plato."part",
+plato."supplier",
+plato."partsupp",
+plato."nation",
+plato."region"
+where
+p_partkey = ps_partkey
+and s_suppkey = ps_suppkey
+and p_size = 15
+and p_type like '%BRASS'
+and s_nationkey = n_nationkey
+and n_regionkey = r_regionkey
+and r_name = 'EUROPE'
+and ps_supplycost = (
+select
+min(ps_supplycost)
+from
+plato."partsupp",
+plato."supplier",
+plato."nation",
+plato."region"
+where
+p_partkey = ps_partkey
+and s_suppkey = ps_suppkey
+and s_nationkey = n_nationkey
+and n_regionkey = r_regionkey
+and r_name = 'EUROPE'
+)
+order by
+s_acctbal desc,
+n_name,
+s_name,
+p_partkey
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q03.sql b/yql/essentials/tests/sql/suites/pg-tpch/q03.sql
new file mode 100644
index 0000000000..fd34b86d2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q03.sql
@@ -0,0 +1,27 @@
+--!syntax_pg
+--TPC-H Q3
+
+
+select
+l_orderkey,
+sum(l_extendedprice*(1::numeric-l_discount)) as revenue,
+o_orderdate,
+o_shippriority
+from
+plato."customer",
+plato."orders",
+plato."lineitem"
+where
+c_mktsegment = 'BUILDING'
+and c_custkey = o_custkey
+and l_orderkey = o_orderkey
+and o_orderdate < date '1995-03-15'
+and l_shipdate > date '1995-03-15'
+group by
+l_orderkey,
+o_orderdate,
+o_shippriority
+order by
+revenue desc,
+o_orderdate
+limit 10;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q04.sql b/yql/essentials/tests/sql/suites/pg-tpch/q04.sql
new file mode 100644
index 0000000000..40718918ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q04.sql
@@ -0,0 +1,26 @@
+--!syntax_pg
+--ignore runonopt plan diff
+--TPC-H Q4
+
+
+select
+o_orderpriority,
+count(*) as order_count
+from
+plato."orders"
+where
+o_orderdate >= date '1993-07-01'
+and o_orderdate < date '1993-07-01' + interval '3' month
+and exists (
+select
+*
+from
+plato."lineitem"
+where
+l_orderkey = o_orderkey
+and l_commitdate < l_receiptdate
+)
+group by
+o_orderpriority
+order by
+o_orderpriority;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q05.sql b/yql/essentials/tests/sql/suites/pg-tpch/q05.sql
new file mode 100644
index 0000000000..089c838380
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q05.sql
@@ -0,0 +1,28 @@
+--!syntax_pg
+--TPC-H Q5
+
+
+select
+n_name,
+sum(l_extendedprice * (1::numeric - l_discount)) as revenue
+from
+plato."customer",
+plato."orders",
+plato."lineitem",
+plato."supplier",
+plato."nation",
+plato."region"
+where
+c_custkey = o_custkey
+and l_orderkey = o_orderkey
+and l_suppkey = s_suppkey
+and c_nationkey = s_nationkey
+and s_nationkey = n_nationkey
+and n_regionkey = r_regionkey
+and r_name = 'ASIA'
+and o_orderdate >= date '1994-01-01'
+and o_orderdate < date '1994-01-01' + interval '1' year
+group by
+n_name
+order by
+revenue desc;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q06.sql b/yql/essentials/tests/sql/suites/pg-tpch/q06.sql
new file mode 100644
index 0000000000..4f6c0b039b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q06.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+--TPC-H Q6
+
+
+select
+sum(l_extendedprice*l_discount) as revenue
+from
+plato."lineitem"
+where
+l_shipdate >= date '1994-01-01'
+and l_shipdate < date '1994-01-01' + interval '1' year
+and l_discount between (0.06 - 0.01)::numeric and (0.06 + 0.01)::numeric
+and l_quantity < 24::numeric;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q07.sql b/yql/essentials/tests/sql/suites/pg-tpch/q07.sql
new file mode 100644
index 0000000000..8f1c30e994
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q07.sql
@@ -0,0 +1,41 @@
+--!syntax_pg
+--TPC-H Q7
+
+
+select
+supp_nation,
+cust_nation,
+l_year, sum(volume) as revenue
+from (
+select
+n1.n_name as supp_nation,
+n2.n_name as cust_nation,
+extract(year from l_shipdate) as l_year,
+l_extendedprice * (1::numeric - l_discount) as volume
+from
+plato."supplier",
+plato."lineitem",
+plato."orders",
+plato."customer",
+plato."nation" n1,
+plato."nation" n2
+where
+s_suppkey = l_suppkey
+and o_orderkey = l_orderkey
+and c_custkey = o_custkey
+and s_nationkey = n1.n_nationkey
+and c_nationkey = n2.n_nationkey
+and (
+(n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
+or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
+)
+and l_shipdate between date '1995-01-01' and date '1996-12-31'
+) as shipping
+group by
+supp_nation,
+cust_nation,
+l_year
+order by
+supp_nation,
+cust_nation,
+l_year;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q08.sql b/yql/essentials/tests/sql/suites/pg-tpch/q08.sql
new file mode 100644
index 0000000000..bd31d2dde4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q08.sql
@@ -0,0 +1,41 @@
+--!syntax_pg
+--TPC-H Q8
+
+
+select
+o_year,
+sum(case
+when nation = 'BRAZIL'
+then volume
+else 0::numeric
+end) / (sum(volume) + 1e-12::numeric) as mkt_share
+from (
+select
+extract(year from o_orderdate) as o_year,
+l_extendedprice * (1::numeric-l_discount) as volume,
+n2.n_name as nation
+from
+plato."part",
+plato."supplier",
+plato."lineitem",
+plato."orders",
+plato."customer",
+plato."nation" n1,
+plato."nation" n2,
+plato."region"
+where
+p_partkey = l_partkey
+and s_suppkey = l_suppkey
+and l_orderkey = o_orderkey
+and o_custkey = c_custkey
+and c_nationkey = n1.n_nationkey
+and n1.n_regionkey = r_regionkey
+and r_name = 'AMERICA'
+and s_nationkey = n2.n_nationkey
+and o_orderdate between date '1995-01-01' and date '1996-12-31'
+and p_type = 'ECONOMY ANODIZED STEEL'
+) as all_nations
+group by
+o_year
+order by
+o_year;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q09.sql b/yql/essentials/tests/sql/suites/pg-tpch/q09.sql
new file mode 100644
index 0000000000..7db204c44f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q09.sql
@@ -0,0 +1,35 @@
+--!syntax_pg
+--TPC-H Q9
+
+
+select
+nation,
+o_year,
+sum(amount) as sum_profit
+from (
+select
+n_name as nation,
+extract(year from o_orderdate) as o_year,
+l_extendedprice * (1::numeric - l_discount) - ps_supplycost * l_quantity as amount
+from
+plato."part",
+plato."supplier",
+plato."lineitem",
+plato."partsupp",
+plato."orders",
+plato."nation"
+where
+s_suppkey = l_suppkey
+and ps_suppkey = l_suppkey
+and ps_partkey = l_partkey
+and p_partkey = l_partkey
+and o_orderkey = l_orderkey
+and s_nationkey = n_nationkey
+and p_name like '%green%'
+) as profit
+group by
+nation,
+o_year
+order by
+nation,
+o_year desc;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q10.sql b/yql/essentials/tests/sql/suites/pg-tpch/q10.sql
new file mode 100644
index 0000000000..e331135e3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q10.sql
@@ -0,0 +1,36 @@
+--!syntax_pg
+--TPC-H Q10
+
+
+select
+c_custkey,
+c_name,
+sum(l_extendedprice * (1::numeric - l_discount)) as revenue,
+c_acctbal,
+n_name,
+c_address,
+c_phone,
+c_comment
+from
+plato."customer",
+plato."orders",
+plato."lineitem",
+plato."nation"
+where
+c_custkey = o_custkey
+and l_orderkey = o_orderkey
+and o_orderdate >= date '1993-10-01'
+and o_orderdate < date '1993-10-01' + interval '3' month
+and l_returnflag = 'R'
+and c_nationkey = n_nationkey
+group by
+c_custkey,
+c_name,
+c_acctbal,
+c_phone,
+n_name,
+c_address,
+c_comment
+order by
+revenue desc
+limit 20;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q11.sql b/yql/essentials/tests/sql/suites/pg-tpch/q11.sql
new file mode 100644
index 0000000000..f61ddbb957
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q11.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-H Q11
+-- ignore runonopt plan diff
+
+
+select
+ps_partkey,
+sum(ps_supplycost * ps_availqty::numeric) as value
+from
+plato."partsupp",
+plato."supplier",
+plato."nation"
+where
+ps_suppkey = s_suppkey
+and s_nationkey = n_nationkey
+and n_name = 'GERMANY'
+group by
+ps_partkey having
+sum(ps_supplycost * ps_availqty::numeric) > (
+select
+sum(ps_supplycost * ps_availqty::numeric) * 0.0001::numeric
+from
+plato."partsupp",
+plato."supplier",
+plato."nation"
+where
+ps_suppkey = s_suppkey
+and s_nationkey = n_nationkey
+and n_name = 'GERMANY'
+)
+order by
+value desc;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q12.sql b/yql/essentials/tests/sql/suites/pg-tpch/q12.sql
new file mode 100644
index 0000000000..bf38bc5e83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q12.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+--TPC-H Q12
+
+
+select
+l_shipmode,
+sum(case
+when o_orderpriority ='1-URGENT'
+or o_orderpriority ='2-HIGH'
+then 1
+else 0
+end) as high_line_count,
+sum(case
+when o_orderpriority <> '1-URGENT'
+and o_orderpriority <> '2-HIGH'
+then 1
+else 0
+end) as low_line_count
+from
+plato."orders",
+plato."lineitem"
+where
+o_orderkey = l_orderkey
+and l_shipmode in ('MAIL', 'SHIP')
+and l_commitdate < l_receiptdate
+and l_shipdate < l_commitdate
+and l_receiptdate >= date '1994-01-01'
+and l_receiptdate < date '1994-01-01' + interval '1' year
+group by
+l_shipmode
+order by
+l_shipmode;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q13.sql b/yql/essentials/tests/sql/suites/pg-tpch/q13.sql
new file mode 100644
index 0000000000..97848f0b9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q13.sql
@@ -0,0 +1,25 @@
+--!syntax_pg
+--TPC-H Q13
+
+
+select
+c_count, count(*) as custdist
+from (
+select
+c_custkey,
+count(o_orderkey)
+from
+plato."customer"
+left outer join
+plato."orders"
+on
+c_custkey = o_custkey
+and o_comment not like '%special%requests%'
+group by
+c_custkey
+)as c_orders (c_custkey, c_count)
+group by
+c_count
+order by
+custdist desc,
+c_count desc;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q14.sql b/yql/essentials/tests/sql/suites/pg-tpch/q14.sql
new file mode 100644
index 0000000000..e515a5d480
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q14.sql
@@ -0,0 +1,17 @@
+--!syntax_pg
+--TPC-H Q14
+
+
+select
+100.00::numeric * sum(case
+when p_type like 'PROMO%'
+then l_extendedprice*(1::numeric-l_discount)
+else 0::numeric
+end) / (sum(l_extendedprice * (1::numeric - l_discount)) + 1e-12::numeric) as promo_revenue
+from
+plato."lineitem",
+plato."part"
+where
+l_partkey = p_partkey
+and l_shipdate >= date '1995-09-01'
+and l_shipdate < date '1995-09-01' + interval '1' month;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q15.sql b/yql/essentials/tests/sql/suites/pg-tpch/q15.sql
new file mode 100644
index 0000000000..729fd88641
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q15.sql
@@ -0,0 +1,36 @@
+--!syntax_pg
+--ignore runonopt plan diff
+--TPC-H Q15
+
+
+create view revenue_STREAM_ID (supplier_no, total_revenue) as
+select
+l_suppkey,
+sum(l_extendedprice * (1::numeric - l_discount))
+from
+plato."lineitem"
+where
+l_shipdate >= date '1996-01-01'
+and l_shipdate < date '1996-01-01' + interval '3' month
+group by
+l_suppkey;
+select
+s_suppkey,
+s_name,
+s_address,
+s_phone,
+total_revenue
+from
+plato."supplier",
+revenue_STREAM_ID
+where
+s_suppkey = supplier_no
+and total_revenue = (
+select
+max(total_revenue)
+from
+revenue_STREAM_ID
+)
+order by
+s_suppkey;
+drop view revenue_STREAM_ID;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q16.sql b/yql/essentials/tests/sql/suites/pg-tpch/q16.sql
new file mode 100644
index 0000000000..7df4f54439
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q16.sql
@@ -0,0 +1,34 @@
+--!syntax_pg
+--TPC-H Q16
+
+
+select
+p_brand,
+p_type,
+p_size,
+count(distinct ps_suppkey) as supplier_cnt
+from
+plato."partsupp",
+plato."part"
+where
+p_partkey = ps_partkey
+and p_brand <> 'Brand#45'
+and p_type not like 'MEDIUM POLISHED%'
+and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
+and ps_suppkey not in (
+select
+s_suppkey
+from
+plato."supplier"
+where
+s_comment like '%Customer%Complaints%'
+)
+group by
+p_brand,
+p_type,
+p_size
+order by
+supplier_cnt desc,
+p_brand,
+p_type,
+p_size;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q17.sql b/yql/essentials/tests/sql/suites/pg-tpch/q17.sql
new file mode 100644
index 0000000000..e893138f09
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q17.sql
@@ -0,0 +1,22 @@
+--!syntax_pg
+--ignore runonopt plan diff
+--TPC-H Q17
+
+
+select
+sum(l_extendedprice) / 7.0::numeric as avg_yearly
+from
+plato."lineitem",
+plato."part"
+where
+p_partkey = l_partkey
+and p_brand = 'Brand#23'
+and p_container = 'MED BOX'
+and l_quantity < (
+select
+0.2::numeric * avg(l_quantity)
+from
+plato."lineitem"
+where
+l_partkey = p_partkey
+);
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q18.sql b/yql/essentials/tests/sql/suites/pg-tpch/q18.sql
new file mode 100644
index 0000000000..0c32891237
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q18.sql
@@ -0,0 +1,38 @@
+--!syntax_pg
+--ignore runonopt plan diff
+--TPC-H Q18
+
+
+select
+c_name,
+c_custkey,
+o_orderkey,
+o_orderdate,
+o_totalprice,
+sum(l_quantity)
+from
+plato."customer",
+plato."orders",
+plato."lineitem"
+where
+o_orderkey in (
+select
+l_orderkey
+from
+plato."lineitem"
+group by
+l_orderkey having
+sum(l_quantity) > 300::numeric
+)
+and c_custkey = o_custkey
+and o_orderkey = l_orderkey
+group by
+c_name,
+c_custkey,
+o_orderkey,
+o_orderdate,
+o_totalprice
+order by
+o_totalprice desc,
+o_orderdate
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q19.sql b/yql/essentials/tests/sql/suites/pg-tpch/q19.sql
new file mode 100644
index 0000000000..5eb0799774
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q19.sql
@@ -0,0 +1,39 @@
+--!syntax_pg
+--TPC-H Q19
+
+
+select
+sum(l_extendedprice * (1::numeric - l_discount) ) as revenue
+from
+plato."lineitem",
+plato."part"
+where
+(
+p_partkey = l_partkey
+and p_brand = 'Brand#12'
+and p_container in ( 'SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+and l_quantity >= 1::numeric and l_quantity <= (1 + 10)::numeric
+and p_size between 1 and 5
+and l_shipmode in ('AIR', 'AIR REG')
+and l_shipinstruct = 'DELIVER IN PERSON'
+)
+or
+(
+p_partkey = l_partkey
+and p_brand = 'Brand#23'
+and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+and l_quantity >= 10::numeric and l_quantity <= (10 + 10)::numeric
+and p_size between 1 and 10
+and l_shipmode in ('AIR', 'AIR REG')
+and l_shipinstruct = 'DELIVER IN PERSON'
+)
+or
+(
+p_partkey = l_partkey
+and p_brand = 'Brand#34'
+and p_container in ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+and l_quantity >= 20::numeric and l_quantity <= (20 + 10)::numeric
+and p_size between 1 and 15
+and l_shipmode in ('AIR', 'AIR REG')
+and l_shipinstruct = 'DELIVER IN PERSON'
+);
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q20.sql b/yql/essentials/tests/sql/suites/pg-tpch/q20.sql
new file mode 100644
index 0000000000..fdb34b62f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q20.sql
@@ -0,0 +1,41 @@
+--!syntax_pg
+--TPC-H Q20
+
+
+select
+s_name,
+s_address
+from
+plato."supplier",
+plato."nation"
+where
+s_suppkey in (
+select
+ps_suppkey
+from
+plato."partsupp"
+where
+ps_partkey in (
+select
+p_partkey
+from
+plato."part"
+where
+p_name like 'forest%'
+)
+and ps_availqty::numeric > (
+select
+0.5::numeric * sum(l_quantity)
+from
+plato."lineitem"
+where
+l_partkey = ps_partkey
+and l_suppkey = ps_suppkey
+and l_shipdate >= '1994-01-01'::date
+and l_shipdate < '1994-01-01'::date + interval '1' year
+)
+)
+and s_nationkey = n_nationkey
+and n_name = 'CANADA'
+order by
+s_name;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q21.sql b/yql/essentials/tests/sql/suites/pg-tpch/q21.sql
new file mode 100644
index 0000000000..acd5bf4bb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q21.sql
@@ -0,0 +1,44 @@
+--!syntax_pg
+--TPC-H Q21
+
+
+select
+s_name,
+count(*) as numwait
+from
+plato."supplier",
+plato."lineitem" l1,
+plato."orders",
+plato."nation"
+where
+s_suppkey = l1.l_suppkey
+and o_orderkey = l1.l_orderkey
+and o_orderstatus = 'F'
+and l1.l_receiptdate > l1.l_commitdate
+and exists (
+select
+*
+from
+plato."lineitem" l2
+where
+l2.l_orderkey = l1.l_orderkey
+and l2.l_suppkey <> l1.l_suppkey
+)
+and not exists (
+select
+*
+from
+plato."lineitem" l3
+where
+l3.l_orderkey = l1.l_orderkey
+and l3.l_suppkey <> l1.l_suppkey
+and l3.l_receiptdate > l3.l_commitdate
+)
+and s_nationkey = n_nationkey
+and n_name = 'SAUDI ARABIA'
+group by
+s_name
+order by
+numwait desc,
+s_name
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/q22.sql b/yql/essentials/tests/sql/suites/pg-tpch/q22.sql
new file mode 100644
index 0000000000..80a89442ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/q22.sql
@@ -0,0 +1,40 @@
+--!syntax_pg
+--TPC-H Q22
+
+
+select
+cntrycode,
+count(*) as numcust,
+sum(c_acctbal) as totacctbal
+from (
+select
+substring(c_phone from 1 for 2) as cntrycode,
+c_acctbal
+from
+plato."customer"
+where
+substring(c_phone from 1 for 2) in
+('13','31','23','29','30','18','17')
+and c_acctbal > (
+select
+avg(c_acctbal)
+from
+plato."customer"
+where
+c_acctbal > 0.00::numeric
+and substring (c_phone from 1 for 2) in
+('13','31','23','29','30','18','17')
+)
+and not exists (
+select
+*
+from
+plato."orders"
+where
+o_custkey = c_custkey
+)
+) as custsale
+group by
+cntrycode
+order by
+cntrycode;
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/region.txt b/yql/essentials/tests/sql/suites/pg-tpch/region.txt
new file mode 100644
index 0000000000..35b2e04fad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/region.txt
@@ -0,0 +1 @@
+{"r_comment"="lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to ";"r_name"="AFRICA";"r_regionkey"=0;};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/region.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/region.txt.attr
new file mode 100644
index 0000000000..3c92a439ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/region.txt.attr
@@ -0,0 +1,9 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["r_regionkey";["PgType";"int4";];];
+ ["r_name";["PgType";"text";];];
+ ["r_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt b/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt
new file mode 100644
index 0000000000..c5f0cbc1ad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt
@@ -0,0 +1 @@
+{"s_acctbal"="\0\2\0\0\0\0\0\2\x16{$\xB8";"s_address"=" N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ";"s_comment"="each slyly above the careful";"s_name"="Supplier#000000001";"s_nationkey"=17;"s_phone"="27-918-335-1736";"s_suppkey"=1;};
diff --git a/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt.attr b/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt.attr
new file mode 100644
index 0000000000..610ac95a35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg-tpch/supplier.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["s_suppkey";["PgType";"int4";];];
+ ["s_name";["PgType";"text";];];
+ ["s_address";["PgType";"text";];];
+ ["s_nationkey";["PgType";"int4";];];
+ ["s_phone";["PgType";"text";];];
+ ["s_acctbal";["PgType";"numeric";];];
+ ["s_comment";["PgType";"text";];];
+ ];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/aggr_compare.sql b/yql/essentials/tests/sql/suites/pg/aggr_compare.sql
new file mode 100644
index 0000000000..e041d4e61a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggr_compare.sql
@@ -0,0 +1,14 @@
+$n = Nothing(pgint4);
+$n2 = Nothing(pgint4) + 0p;
+$a = 1p;
+$b = 2p;
+$b2 = 1p + 1p;
+select
+ AsStruct(Yql::AggrLess($a, $b) as x1, Yql::AggrLess($b, $a) as x2, Yql::AggrLess($b, $b2) as x3,
+ Yql::AggrLess($a, $n) as y1, Yql::AggrLess($n, $a) as y2, Yql::AggrLess($n, $n2) as y3),
+ AsStruct(Yql::AggrLessOrEqual($a, $b) as x1, Yql::AggrLessOrEqual($b, $a) as x2, Yql::AggrLessOrEqual($b, $b2) as x3,
+ Yql::AggrLessOrEqual($a, $n) as y1, Yql::AggrLessOrEqual($n, $a) as y2, Yql::AggrLessOrEqual($n, $n2) as y3),
+ AsStruct(Yql::AggrGreater($a, $b) as x1, Yql::AggrGreater($b, $a) as x2, Yql::AggrGreater($b, $b2) as x3,
+ Yql::AggrGreater($a, $n) as y1, Yql::AggrGreater($n, $a) as y2, Yql::AggrGreater($n, $n2) as y3),
+ AsStruct(Yql::AggrGreaterOrEqual($a, $b) as x1, Yql::AggrGreaterOrEqual($b, $a) as x2, Yql::AggrGreaterOrEqual($b, $b2) as x3,
+ Yql::AggrGreaterOrEqual($a, $n) as y1, Yql::AggrGreaterOrEqual($n, $a) as y2, Yql::AggrGreaterOrEqual($n, $n2) as y3),
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_combine.cfg b/yql/essentials/tests/sql/suites/pg/aggregate_combine.cfg
new file mode 100644
index 0000000000..e377e2a9ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_combine.cfg
@@ -0,0 +1 @@
+in Input3 input3.txt
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_combine.sql b/yql/essentials/tests/sql/suites/pg/aggregate_combine.sql
new file mode 100644
index 0000000000..2aaccbf7ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_combine.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select value,avg(key::int8)
+from plato."Input3"
+group by value
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.cfg b/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.cfg
new file mode 100644
index 0000000000..e377e2a9ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.cfg
@@ -0,0 +1 @@
+in Input3 input3.txt
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.sql b/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.sql
new file mode 100644
index 0000000000..4c2def72ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_combine_all.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select avg(key::int8)
+from plato."Input3"
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_ctx.sql b/yql/essentials/tests/sql/suites/pg/aggregate_ctx.sql
new file mode 100644
index 0000000000..56edb9e18a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_ctx.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select string_agg(x,',') from (values ('a'),('b')) a(x);
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_distinct.sql b/yql/essentials/tests/sql/suites/pg/aggregate_distinct.sql
new file mode 100644
index 0000000000..d6391e5a85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_distinct.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select string_agg(distinct x,y) from (values ('a',','),('b',':'),('a',',')) a(x,y);
+select count(distinct x) from (values (1),(2),(1),(3),(2),(1)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_emit_agg_apply.sql b/yql/essentials/tests/sql/suites/pg/aggregate_emit_agg_apply.sql
new file mode 100644
index 0000000000..f3f663340c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_emit_agg_apply.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+set EmitAggApply=true;
+select string_agg(cast(x as text),',') from generate_series(1,2) as x
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_factory.sql b/yql/essentials/tests/sql/suites/pg/aggregate_factory.sql
new file mode 100644
index 0000000000..6fbe0119bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_factory.sql
@@ -0,0 +1,27 @@
+select
+Pg::string_agg(x,','p)
+from (values ('a'p),('b'p),('c'p)) as a(x);
+
+select
+Pg::string_agg(x,','p) over (order by x),
+from (values ('a'p),('b'p),('c'p)) as a(x);
+
+$agg_string_agg = AggregationFactory("Pg::string_agg");
+
+select
+AggregateBy((x,','p),$agg_string_agg)
+from (values ('a'p),('b'p),('c'p)) as a(x);
+
+select
+AggregateBy((x,','p),$agg_string_agg) over (order by x),
+from (values ('a'p),('b'p),('c'p)) as a(x);
+
+$agg_max = AggregationFactory("Pg::max");
+
+select
+AggregateBy(x,$agg_max)
+from (values ('a'p),('b'p),('c'p)) as a(x);
+
+select
+AggregateBy(x,$agg_max) over (order by x),
+from (values ('a'p),('b'p),('c'p)) as a(x);
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.cfg b/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.cfg
new file mode 100644
index 0000000000..0cdbb201f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.cfg
@@ -0,0 +1 @@
+in InputZ inputZ.txt
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.sql b/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.sql
new file mode 100644
index 0000000000..b4738cf99c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_minus_zero.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select x, count(*)
+from (
+select f::float8 as x from plato."InputZ"
+) a
+group by x
diff --git a/yql/essentials/tests/sql/suites/pg/aggregate_scalar_minus_zero.sql b/yql/essentials/tests/sql/suites/pg/aggregate_scalar_minus_zero.sql
new file mode 100644
index 0000000000..672e61a034
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/aggregate_scalar_minus_zero.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x, count(*)
+from (
+select '+0.0'::float8 as x
+union all
+select '-0.0'::float8 as x
+) a
+group by x
diff --git a/yql/essentials/tests/sql/suites/pg/all_data.cfg b/yql/essentials/tests/sql/suites/pg/all_data.cfg
new file mode 100644
index 0000000000..5b191b093d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/all_data.cfg
@@ -0,0 +1 @@
+in Input all_data.txt
diff --git a/yql/essentials/tests/sql/suites/pg/all_data.sql b/yql/essentials/tests/sql/suites/pg/all_data.sql
new file mode 100644
index 0000000000..cab5016734
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/all_data.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/all_data.txt b/yql/essentials/tests/sql/suites/pg/all_data.txt
new file mode 100644
index 0000000000..311847daa5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/all_data.txt
@@ -0,0 +1,2 @@
+{}
+
diff --git a/yql/essentials/tests/sql/suites/pg/all_data.txt.attr b/yql/essentials/tests/sql/suites/pg/all_data.txt.attr
new file mode 100644
index 0000000000..f2e081cdfe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/all_data.txt.attr
@@ -0,0 +1,35 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["Bool";["OptionalType";["DataType";"Bool"]]];
+ ["Int8";["OptionalType";["DataType";"Int8"]]];
+ ["Uint8";["OptionalType";["DataType";"Uint8"]]];
+ ["Int16";["OptionalType";["DataType";"Int16"]]];
+ ["Uint16";["OptionalType";["DataType";"Uint16"]]];
+ ["Int32";["OptionalType";["DataType";"Int32"]]];
+ ["Uint32";["OptionalType";["DataType";"Uint32"]]];
+ ["Int64";["OptionalType";["DataType";"Int64"]]];
+ ["Uint64";["OptionalType";["DataType";"Uint64"]]];
+ ["Double";["OptionalType";["DataType";"Double"]]];
+ ["Float";["OptionalType";["DataType";"Float"]]];
+ ["String";["OptionalType";["DataType";"String"]]];
+ ["Utf8";["OptionalType";["DataType";"Utf8"]]];
+ ["Yson";["OptionalType";["DataType";"Yson"]]];
+ ["Json";["OptionalType";["DataType";"Json"]]];
+ ["Uuid";["OptionalType";["DataType";"Uuid"]]];
+ ["Date";["OptionalType";["DataType";"Date"]]];
+ ["Datetime";["OptionalType";["DataType";"Datetime"]]];
+ ["Timestamp";["OptionalType";["DataType";"Timestamp"]]];
+ ["Interval";["OptionalType";["DataType";"Interval"]]];
+ ["TzDate";["OptionalType";["DataType";"TzDate"]]];
+ ["TzDatetime";["OptionalType";["DataType";"TzDatetime"]]];
+ ["TzTimestamp";["OptionalType";["DataType";"TzTimestamp"]]];
+ ["Decimal";["OptionalType";["DataType";"Decimal";"10";"1"]]];
+ ["DyNumber";["OptionalType";["DataType";"DyNumber"]]];
+ ["JsonDocument";["OptionalType";["DataType";"JsonDocument"]]];
+ ["Date32";["OptionalType";["DataType";"Date32"]]];
+ ["Datetime64";["OptionalType";["DataType";"Datetime64"]]];
+ ["Timestamp64";["OptionalType";["DataType";"Timestamp64"]]];
+ ["Interval64";["OptionalType";["DataType";"Interval64"]]];
+ ]];
+}}
+
diff --git a/yql/essentials/tests/sql/suites/pg/avg_float_clone_init_value.sql b/yql/essentials/tests/sql/suites/pg/avg_float_clone_init_value.sql
new file mode 100644
index 0000000000..cc7f21571b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/avg_float_clone_init_value.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select avg(x) ax, avg(y) ay from (values (1.0,2.0),(3.0,4.0)) as a(x,y)
+
diff --git a/yql/essentials/tests/sql/suites/pg/bit_const.sql b/yql/essentials/tests/sql/suites/pg/bit_const.sql
new file mode 100644
index 0000000000..89190d29ad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/bit_const.sql
@@ -0,0 +1 @@
+select PgConst('101',pgbit,2),PgConst('{101,111}',_pgbit,2) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/cast_int_to_bit.sql b/yql/essentials/tests/sql/suites/pg/cast_int_to_bit.sql
new file mode 100644
index 0000000000..eb4b52ae10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/cast_int_to_bit.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select array[44,44]::_bit(10), 44::bit(10)
diff --git a/yql/essentials/tests/sql/suites/pg/cbo_pragma1.sql b/yql/essentials/tests/sql/suites/pg/cbo_pragma1.sql
new file mode 100644
index 0000000000..497fdc6ed1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/cbo_pragma1.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+set CostBasedOptimizer="PG";
+select 1;
diff --git a/yql/essentials/tests/sql/suites/pg/cbo_pragma2.sql b/yql/essentials/tests/sql/suites/pg/cbo_pragma2.sql
new file mode 100644
index 0000000000..5cf8cbf560
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/cbo_pragma2.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+set CostBasedOptimizer="native";
+select 1;
diff --git a/yql/essentials/tests/sql/suites/pg/coalesce.sql b/yql/essentials/tests/sql/suites/pg/coalesce.sql
new file mode 100644
index 0000000000..0b7018990a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/coalesce.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select coalesce(1,2),coalesce(x,2),coalesce(x,y,z) from
+(
+select null::int4 as x, null::int4 as y, 6 as z
+) a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/compare.sql b/yql/essentials/tests/sql/suites/pg/compare.sql
new file mode 100644
index 0000000000..15cfebfab4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/compare.sql
@@ -0,0 +1,12 @@
+select
+1p < 2p, 1p <= 2p, cast(null as pgint4) < 1p, cast(null as pgint4) <= 1p,
+1p = 2p, 1p != 2p, cast(null as pgint4) = 1p, cast(null as pgint4) != 1p,
+1p > 2p, 1p >= 2p, cast(null as pgint4) > 1p, cast(null as pgint4) >= 1p,
+1p is distinct from 2p,
+1p is not distinct from 2p,
+cast(null as pgint4) is distinct from cast(null as pgint4),
+cast(null as pgint4) is not distinct from cast(null as pgint4),
+1p is distinct from cast(null as pgint4),
+1p is not distinct from cast(null as pgint4),
+cast(null as pgint4) is distinct from 1p,
+cast(null as pgint4) is not distinct from 1p;
diff --git a/yql/essentials/tests/sql/suites/pg/current_database.sql b/yql/essentials/tests/sql/suites/pg/current_database.sql
new file mode 100644
index 0000000000..c9542c10c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/current_database.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select current_database();
+
diff --git a/yql/essentials/tests/sql/suites/pg/dates_from_pg.sql b/yql/essentials/tests/sql/suites/pg/dates_from_pg.sql
new file mode 100644
index 0000000000..b96bbce8c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/dates_from_pg.sql
@@ -0,0 +1,3 @@
+select
+ FromPg(pgdate('148107-12-31')),FromPg(pgdate('4714-11-24BC')),FromPg(pgdate('5874897-12-31')),
+ FromPg(pgtimestamp('148107-12-31 01:02:03')),FromPg(pgtimestamp('4714-11-24BC 01:02:03')),FromPg(pgtimestamp('294276-12-31 01:02:03'));
diff --git a/yql/essentials/tests/sql/suites/pg/dates_to_pg.sql b/yql/essentials/tests/sql/suites/pg/dates_to_pg.sql
new file mode 100644
index 0000000000..df359f5fc1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/dates_to_pg.sql
@@ -0,0 +1,7 @@
+select ToPg(date("1970-01-01")),ToPg(date("2105-12-31")),
+ ToPg(datetime("1970-01-01T00:00:00Z")),ToPg(datetime("2105-12-31T23:59:59Z")),
+ ToPg(timestamp("1970-01-01T00:00:00.000000Z")),ToPg(timestamp("2105-12-31T23:59:59.999999Z")),
+ ToPg(date32("-4714-11-24")),ToPg(date32("148107-12-31")),
+ ToPg(datetime64("-4714-11-24T00:00:00Z")),ToPg(datetime64("148107-12-31T23:59:59Z")),
+ ToPg(timestamp64("-4714-11-24T00:00:00.000000Z")),ToPg(timestamp64("148107-12-31T23:59:59.999999Z"));
+ \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/def_column_name_func.sql b/yql/essentials/tests/sql/suites/pg/def_column_name_func.sql
new file mode 100644
index 0000000000..c0d4e7361c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/def_column_name_func.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select upper('a');
+
diff --git a/yql/essentials/tests/sql/suites/pg/default.cfg b/yql/essentials/tests/sql/suites/pg/default.cfg
new file mode 100644
index 0000000000..1e0c12cac0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+in Input2 input2.txt
+in Input5 input5.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/distinct_all_projection.sql b/yql/essentials/tests/sql/suites/pg/distinct_all_projection.sql
new file mode 100644
index 0000000000..f0453afde4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/distinct_all_projection.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select distinct x from (values (1),(2),(1),(null::int4)) a(x)
diff --git a/yql/essentials/tests/sql/suites/pg/distinct_on_multi_projection.sql b/yql/essentials/tests/sql/suites/pg/distinct_on_multi_projection.sql
new file mode 100644
index 0000000000..60b4e4577f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/distinct_on_multi_projection.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select 10 as u,20 as v
+union all
+select distinct on (x) x,y
+from (values (1,1),(1,2),(2,5),(2,4)) a(x,y)
+order by u,v desc
diff --git a/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_no_order.sql b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_no_order.sql
new file mode 100644
index 0000000000..83f5751d1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_no_order.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (x) x,y
+from (values (1,1),(1,2),(2,5),(2,4)) a(x,y)
+
diff --git a/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order.sql b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order.sql
new file mode 100644
index 0000000000..18cfde2324
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (x) x,y
+from (values (1,1),(1,2),(2,5),(2,4)) a(x,y)
+order by x,y desc
diff --git a/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order_expr.sql b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order_expr.sql
new file mode 100644
index 0000000000..2736b0ff26
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/distinct_on_single_projection_order_expr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (x/3) x,y
+from (values (1,1),(1,2),(2,5),(2,4)) a(x,y)
+order by x/3,y desc
diff --git a/yql/essentials/tests/sql/suites/pg/doubles_search_path.sql b/yql/essentials/tests/sql/suites/pg/doubles_search_path.sql
new file mode 100644
index 0000000000..f35d89bdca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/doubles_search_path.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+SET search_path = "public", public;
+select count(*) from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/drop_table.cfg b/yql/essentials/tests/sql/suites/pg/drop_table.cfg
new file mode 100644
index 0000000000..9b85bd0ae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/drop_table.cfg
@@ -0,0 +1 @@
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/pg/drop_table.sql b/yql/essentials/tests/sql/suites/pg/drop_table.sql
new file mode 100644
index 0000000000..7a3549cd75
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/drop_table.sql
@@ -0,0 +1,17 @@
+--!syntax_pg
+
+insert into plato."Output"
+SELECT 1;
+
+commit;
+
+drop table plato."Output";
+
+commit;
+
+insert into plato."Output"
+SELECT 'foo';
+
+commit;
+
+drop table plato."Output";
diff --git a/yql/essentials/tests/sql/suites/pg/equals_where_over_cross.sql b/yql/essentials/tests/sql/suites/pg/equals_where_over_cross.sql
new file mode 100644
index 0000000000..8914889178
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/equals_where_over_cross.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (select 1 as x) as a
+, (select 1 as y) as b
+, (select 1 as z) as c
+where
+a.x = c.z
+and
+a.x = b.y
diff --git a/yql/essentials/tests/sql/suites/pg/equals_where_over_cross2.sql b/yql/essentials/tests/sql/suites/pg/equals_where_over_cross2.sql
new file mode 100644
index 0000000000..f46adbefb1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/equals_where_over_cross2.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+select * from (select 1 as x, 2 as w) as a
+, (select 1 as y, 2 as v) as b
+, (select 1 as z) as c
+where
+a.x = c.z
+and
+a.x = b.y
+and
+a.w = b.v
diff --git a/yql/essentials/tests/sql/suites/pg/expr_op_array.sql b/yql/essentials/tests/sql/suites/pg/expr_op_array.sql
new file mode 100644
index 0000000000..b70da9fc1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/expr_op_array.sql
@@ -0,0 +1,16 @@
+--!syntax_pg
+select 1 = any(array[1,2]),
+ 1 = any(array[2,3]),
+ 2 = all(array[2,2]),
+ 2 = all(array[2,3]),
+ 1 = any(array[null,1]),
+ 1 = any(array[null,2]),
+ 1 = all(array[null,1]),
+ 1 = any(null::_int4),
+ 1 = all(null::_int4),
+ null = any(array[1,2]),
+ null = all(array[1,2]),
+ null = any(null::_int4),
+ null = all(null::_int4);
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/in_mixed.cfg b/yql/essentials/tests/sql/suites/pg/in_mixed.cfg
new file mode 100644
index 0000000000..0ca1ef5bf1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/in_mixed.cfg
@@ -0,0 +1 @@
+in Input input_name.txt
diff --git a/yql/essentials/tests/sql/suites/pg/in_mixed.sql b/yql/essentials/tests/sql/suites/pg/in_mixed.sql
new file mode 100644
index 0000000000..b25173295c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/in_mixed.sql
@@ -0,0 +1,21 @@
+--!syntax_pg
+
+-- simple case
+select 1 in ('1', '2');
+
+-- splits into IN over numerics and IN over text
+select '1' in (0, 0.0, 1, '1'::text, '3'::char(3));
+
+-- mixture of types in rhs, expression in lhs
+select (c::int + 1) in (1, 2.9, '4') from (values ('0'), ('1')) as t(c);
+
+-- arrays support
+select array[1, 2] in (array[2, 4], array[1, 2]);
+
+-- NULL in rhs
+select 1 in (0, NULL);
+select 1 in ('1', NULL);
+
+-- non-PG types handling
+select index in ('2', 4) from plato."Input";
+
diff --git a/yql/essentials/tests/sql/suites/pg/in_sorted.sql b/yql/essentials/tests/sql/suites/pg/in_sorted.sql
new file mode 100644
index 0000000000..5569d18fc3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/in_sorted.sql
@@ -0,0 +1 @@
+select pgbit('0001') in (pgbit('0001'),pgbit('0010')) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/input.txt b/yql/essentials/tests/sql/suites/pg/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/pg/input.txt.attr b/yql/essentials/tests/sql/suites/pg/input.txt.attr
new file mode 100644
index 0000000000..29966e9729
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["PgType";"text";];];["subkey";["PgType";"text";];];["value";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input2.txt b/yql/essentials/tests/sql/suites/pg/input2.txt
new file mode 100644
index 0000000000..0667916f57
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input2.txt
@@ -0,0 +1,3 @@
+{"key2"="075";"subkey2"="1";"value2"="ABC"};
+{"key2"="800";"subkey2"="2";"value2"="DDD"};
+{"key2"="020";"subkey2"="3";"value2"="Q"};
diff --git a/yql/essentials/tests/sql/suites/pg/input2.txt.attr b/yql/essentials/tests/sql/suites/pg/input2.txt.attr
new file mode 100644
index 0000000000..764e188c0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input2.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key2";["PgType";"text";];];["subkey2";["PgType";"text";];];["value2";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input3.txt b/yql/essentials/tests/sql/suites/pg/input3.txt
new file mode 100644
index 0000000000..f489ef07c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input3.txt
@@ -0,0 +1,3 @@
+{"key"="1";"subkey"="3";"value"="aaa"};
+{"key"="2";"subkey"="5";"value"="aaa"};
+{"key"="3";"subkey"="1";"value"="bbb"};
diff --git a/yql/essentials/tests/sql/suites/pg/input3.txt.attr b/yql/essentials/tests/sql/suites/pg/input3.txt.attr
new file mode 100644
index 0000000000..29966e9729
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input3.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["PgType";"text";];];["subkey";["PgType";"text";];];["value";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input4.txt b/yql/essentials/tests/sql/suites/pg/input4.txt
new file mode 100644
index 0000000000..9ca7e736b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input4.txt
@@ -0,0 +1,3 @@
+{"b_val"="true";"i_val"="3";"d_val"="2000-01-01"};
+{"b_val"="false";"i_val"="5";"d_val"="1979-12-12"};
+{"b_val"="true";"i_val"="1";"d_val"="2010-12-01"};
diff --git a/yql/essentials/tests/sql/suites/pg/input4.txt.attr b/yql/essentials/tests/sql/suites/pg/input4.txt.attr
new file mode 100644
index 0000000000..cbd95f44d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input4.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["b_val";["PgType";"text";];];["i_val";["PgType";"text";];];["d_val";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input5.txt b/yql/essentials/tests/sql/suites/pg/input5.txt
new file mode 100644
index 0000000000..3d8c1dee24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input5.txt
@@ -0,0 +1,5 @@
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/pg/input5.txt.attr b/yql/essentials/tests/sql/suites/pg/input5.txt.attr
new file mode 100644
index 0000000000..29966e9729
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input5.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["PgType";"text";];];["subkey";["PgType";"text";];];["value";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/inputC.txt b/yql/essentials/tests/sql/suites/pg/inputC.txt
new file mode 100644
index 0000000000..9b2963ca66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/inputC.txt
@@ -0,0 +1 @@
+{"id"="1";"CodeGen_FullTime"="infinity"};
diff --git a/yql/essentials/tests/sql/suites/pg/inputC.txt.attr b/yql/essentials/tests/sql/suites/pg/inputC.txt.attr
new file mode 100644
index 0000000000..04395da84e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/inputC.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["id";["PgType";"text";];];["CodeGen_FullTime";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/inputZ.txt b/yql/essentials/tests/sql/suites/pg/inputZ.txt
new file mode 100644
index 0000000000..6379112ef3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/inputZ.txt
@@ -0,0 +1,2 @@
+{"f"="+0.0"};
+{"f"="-0.0"};
diff --git a/yql/essentials/tests/sql/suites/pg/inputZ.txt.attr b/yql/essentials/tests/sql/suites/pg/inputZ.txt.attr
new file mode 100644
index 0000000000..7a0736147d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/inputZ.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["f";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input_1.txt b/yql/essentials/tests/sql/suites/pg/input_1.txt
new file mode 100644
index 0000000000..9c4f4416e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_1.txt
@@ -0,0 +1,4 @@
+{"id"="000";"name"="vera"};
+{"id"="001";"name"="nadezhda"};
+{"id"="002";"name"="lubov"};
+{"id"="003";"name"="mashina"};
diff --git a/yql/essentials/tests/sql/suites/pg/input_1.txt.attr b/yql/essentials/tests/sql/suites/pg/input_1.txt.attr
new file mode 100644
index 0000000000..4eb7921afd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_1.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["id";["PgType";"text";];];["name";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input_2.txt b/yql/essentials/tests/sql/suites/pg/input_2.txt
new file mode 100644
index 0000000000..1fb956089f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_2.txt
@@ -0,0 +1,4 @@
+{"id"="000";"no"="A001TX77"};
+{"id"="001";"no"="B002KK76"};
+{"id"="002";"no"="C003AE78"};
+{"id"="003";"no"="B777OP777"};
diff --git a/yql/essentials/tests/sql/suites/pg/input_2.txt.attr b/yql/essentials/tests/sql/suites/pg/input_2.txt.attr
new file mode 100644
index 0000000000..e13fdd2707
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_2.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["id";["PgType";"text";];];["no";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input_3.txt b/yql/essentials/tests/sql/suites/pg/input_3.txt
new file mode 100644
index 0000000000..cea60db303
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_3.txt
@@ -0,0 +1,4 @@
+{"id"="000";"sname"="lodkovna"};
+{"id"="001";"sname"="korableva"};
+{"id"="002";"sname"="sudnovna"};
+{"id"="003";"sname"="vremeni"};
diff --git a/yql/essentials/tests/sql/suites/pg/input_3.txt.attr b/yql/essentials/tests/sql/suites/pg/input_3.txt.attr
new file mode 100644
index 0000000000..236c665843
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_3.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["id";["PgType";"text";];];["sname";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg/input_name.txt b/yql/essentials/tests/sql/suites/pg/input_name.txt
new file mode 100644
index 0000000000..096cfb7e19
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_name.txt
@@ -0,0 +1,3 @@
+{"key"="foo";index=1};
+{"key"="bar";index=2};
+{"key"="baz";index=3};
diff --git a/yql/essentials/tests/sql/suites/pg/input_name.txt.attr b/yql/essentials/tests/sql/suites/pg/input_name.txt.attr
new file mode 100644
index 0000000000..8ec2d4d44b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_name.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["PgType";"name"]];
+ ["index";["DataType";"Int32"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/pg/input_pg.txt b/yql/essentials/tests/sql/suites/pg/input_pg.txt
new file mode 100644
index 0000000000..25433188f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_pg.txt
@@ -0,0 +1,4 @@
+{"a"=1;"b"="aaa";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\2"};
+{"a"=1;"b"="ddd";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\3"};
+{"a"=2;"b"="bbb";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\2"};
+{"a"=2;"b"="ccc";"c"="\0\0\0\1\0\0\0\0\0\0\0\x15\0\0\0\2\0\0\0\1\0\0\0\2\0\1\0\0\0\2\0\3"};
diff --git a/yql/essentials/tests/sql/suites/pg/input_pg.txt.attr b/yql/essentials/tests/sql/suites/pg/input_pg.txt.attr
new file mode 100644
index 0000000000..aa9ffac476
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_pg.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["PgType";"int2"]];
+ ["b";["PgType";"text"]];
+ ["c";["PgType";"_int2"]];
+ ]];
+}} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt b/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt
new file mode 100644
index 0000000000..79d59e9d3f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt
@@ -0,0 +1,4 @@
+{"a"=1;"b"="aaa"};
+{"a"=1;"b"="bbb"};
+{"a"=2;"b"=#};
+{"a"=2;"b"="ccc"};
diff --git a/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt.attr b/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt.attr
new file mode 100644
index 0000000000..f10676fc0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/input_pg_int_and_text.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["PgType";"int2"]];
+ ["b";["PgType";"text"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/pg/insert.cfg b/yql/essentials/tests/sql/suites/pg/insert.cfg
new file mode 100644
index 0000000000..de341b36d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/insert.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/insert.sql b/yql/essentials/tests/sql/suites/pg/insert.sql
new file mode 100644
index 0000000000..25ed958fea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/insert.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+insert into plato."Output"
+select * from plato."Input" \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/interval_to_pg.sql b/yql/essentials/tests/sql/suites/pg/interval_to_pg.sql
new file mode 100644
index 0000000000..f06adefdce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/interval_to_pg.sql
@@ -0,0 +1,3 @@
+select ToPg(cast(0 as interval)),ToPg(cast(4291747199999999l as interval)),ToPg(cast(-4291747199999999l as interval)),
+ ToPg(cast(0 as interval64)),ToPg(cast(9223339708799999999l as interval64)),ToPg(cast(-9223339708799999999l as interval64));
+
diff --git a/yql/essentials/tests/sql/suites/pg/is_predicate.sql b/yql/essentials/tests/sql/suites/pg/is_predicate.sql
new file mode 100644
index 0000000000..c13e0e4e4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/is_predicate.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select c,
+ c is true as "true", c is not true as "~true",
+ c is false as "false", c is not false as "~false",
+ c is unknown as "unk", c is not unknown as "~unk"
+from (values (true), (false), (null)) as t(c)
+
diff --git a/yql/essentials/tests/sql/suites/pg/join_brackets1.sql b/yql/essentials/tests/sql/suites/pg/join_brackets1.sql
new file mode 100644
index 0000000000..8604642809
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_brackets1.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+select * from
+(select 1 as foo) a
+join
+(select 2 as bar) b
+on a.foo + 1= b.bar
+join
+((select 3 as x) c
+join
+(select 4 as y) d
+on c.x=d.y-1) on a.foo=c.x-2 and b.bar=d.y-2 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_brackets2.sql b/yql/essentials/tests/sql/suites/pg/join_brackets2.sql
new file mode 100644
index 0000000000..8d665392ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_brackets2.sql
@@ -0,0 +1,21 @@
+--!syntax_pg
+SELECT DISTINCT att.attname as name, att.attnum as OID, pg_catalog.format_type(ty.oid,NULL) AS datatype,
+att.attnotnull as not_null, att.atthasdef as has_default_val, des.description, seq.seqtypid
+FROM pg_catalog.pg_attribute att
+ JOIN pg_catalog.pg_type ty ON ty.oid=atttypid
+ JOIN pg_catalog.pg_namespace tn ON tn.oid=ty.typnamespace
+ JOIN pg_catalog.pg_class cl ON cl.oid=att.attrelid
+ JOIN pg_catalog.pg_namespace na ON na.oid=cl.relnamespace
+ LEFT OUTER JOIN pg_catalog.pg_type et ON et.oid=ty.typelem
+ LEFT OUTER JOIN pg_catalog.pg_attrdef def ON adrelid=att.attrelid AND adnum=att.attnum
+ LEFT OUTER JOIN (pg_catalog.pg_depend JOIN pg_catalog.pg_class cs ON classid='pg_class'::regclass AND objid=cs.oid AND cs.relkind='S') ON refobjid=att.attrelid AND refobjsubid::int4=att.attnum
+ LEFT OUTER JOIN pg_catalog.pg_namespace ns ON ns.oid=cs.relnamespace
+ LEFT OUTER JOIN pg_catalog.pg_index pi ON pi.indrelid=att.attrelid AND indisprimary
+ LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=att.attrelid AND des.objsubid::int4=att.attnum AND des.classoid='pg_class'::regclass)
+ LEFT OUTER JOIN pg_catalog.pg_sequence seq ON cs.oid=seq.seqrelid
+WHERE
+
+ att.attrelid = 12302::oid
+ AND att.attnum > 0
+ AND att.attisdropped IS FALSE
+ORDER BY att.attnum
diff --git a/yql/essentials/tests/sql/suites/pg/join_groups.sql b/yql/essentials/tests/sql/suites/pg/join_groups.sql
new file mode 100644
index 0000000000..1e7f89d425
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_groups.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select 1 from
+(select 1 as foo) a, (select 2 as foo) b
+left join
+(select 1 as bar) c
+on b.foo=c.bar \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_tree_order.sql b/yql/essentials/tests/sql/suites/pg/join_tree_order.sql
new file mode 100644
index 0000000000..abe6339431
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_tree_order.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+SELECT DISTINCT cs.oid
+FROM pg_catalog.pg_attribute att
+JOIN (pg_catalog.pg_depend JOIN pg_catalog.pg_class cs ON objid=cs.oid) ON refobjid=att.attrelid \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using1.sql b/yql/essentials/tests/sql/suites/pg/join_using1.sql
new file mode 100644
index 0000000000..34b4aaa99a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using1.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select c.fooo from (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo, 3 as xy) d
+ using(fooo)) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using2.sql b/yql/essentials/tests/sql/suites/pg/join_using2.sql
new file mode 100644
index 0000000000..533aa654e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using2.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo, 3 as xy) d
+ using(fooo)) order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using3.sql b/yql/essentials/tests/sql/suites/pg/join_using3.sql
new file mode 100644
index 0000000000..b0d66de17d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using3.sql
@@ -0,0 +1,12 @@
+--!syntax_pg
+select * from (
+ (select 2 as foo) a
+ join
+ (select 2 as bar) b
+ on(a.foo = b.bar)), (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo) d
+ using(fooo)) order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using4.sql b/yql/essentials/tests/sql/suites/pg/join_using4.sql
new file mode 100644
index 0000000000..849dd6fcc2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using4.sql
@@ -0,0 +1,12 @@
+--!syntax_pg
+select * from (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo) d
+ using(fooo)),(
+ (select 2 as foo) a
+ join
+ (select 2 as bar) b
+ on(a.foo = b.bar)) order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using5.sql b/yql/essentials/tests/sql/suites/pg/join_using5.sql
new file mode 100644
index 0000000000..d10ff2ada4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using5.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select c.fooo from (
+ (select 1 as fooo) c
+ full join
+ (select 2 as fooo) d
+ using(fooo)) order by fooo \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using6.sql b/yql/essentials/tests/sql/suites/pg/join_using6.sql
new file mode 100644
index 0000000000..e8b6d17f91
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using6.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select * from (
+ (select 1 as fooo) c
+ full join
+ (select 2 as fooo) d
+ using(fooo)) order by fooo \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using7.sql b/yql/essentials/tests/sql/suites/pg/join_using7.sql
new file mode 100644
index 0000000000..04bba587b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using7.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select c.* from (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo, 3 as xy) d
+ using(fooo)) order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using8.sql b/yql/essentials/tests/sql/suites/pg/join_using8.sql
new file mode 100644
index 0000000000..917bb57631
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using8.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select c.fooo as x, d.fooo as y from (
+ (select 1 as fooo, 1 as x) c
+ full join
+ (select 2 as fooo, 3 as xy) d
+ using(fooo)) order by x, y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using9.sql b/yql/essentials/tests/sql/suites/pg/join_using9.sql
new file mode 100644
index 0000000000..c5d9eb14e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using9.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select c.*, fooo as b from (
+ (select 1 as fooo, 1 as x
+ union all
+ select 1 as fooo, 2 as y) c
+ join
+ (select 1 as fooo, 3 as xy) d
+ using(fooo)) order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive1.sql b/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive1.sql
new file mode 100644
index 0000000000..1b4426f70f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive1.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select * from (
+ (select 1 as FOO) c
+ join
+ (select 1 as foo) d
+ using(Foo)) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive2.sql b/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive2.sql
new file mode 100644
index 0000000000..59e95d4247
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_case_insensetive2.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select c.FOO as a, d.* from (
+ (select 1 as FOO) c
+ join
+ (select 1 as foo) d
+ using(Foo)) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_multiple1.sql b/yql/essentials/tests/sql/suites/pg/join_using_multiple1.sql
new file mode 100644
index 0000000000..5866a9102e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_multiple1.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select a.fooo as x, b.fooo as y, c.fooo as z, fooo from (
+ (select 1 as fooo) a
+ full join
+ (select 2 as fooo) b
+ using (fooo)
+ full join
+ (select 3 as fooo) c
+ using(fooo)) order by fooo \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_multiple2.cfg b/yql/essentials/tests/sql/suites/pg/join_using_multiple2.cfg
new file mode 100644
index 0000000000..8ea83a7905
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_multiple2.cfg
@@ -0,0 +1,3 @@
+in Input input_1.txt
+in Input2 input_2.txt
+in Input3 input_3.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_multiple2.sql b/yql/essentials/tests/sql/suites/pg/join_using_multiple2.sql
new file mode 100644
index 0000000000..56fbd4ce06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_multiple2.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select * from (
+ (plato."Input"
+ join
+ plato."Input2"
+ using (id))
+ join
+ plato."Input3"
+ using (id)) order by id \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_multiple3.sql b/yql/essentials/tests/sql/suites/pg/join_using_multiple3.sql
new file mode 100644
index 0000000000..989b9822bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_multiple3.sql
@@ -0,0 +1,12 @@
+--!syntax_pg
+select foo, q.foo as a1, w.foo as a2, e.foo as a3, r.foo as a4 from
+ ((select 1 as foo) q
+ full join
+ (select 2 as foo) w
+ using (foo))
+ full join
+ ((select 3 as foo) e
+ full join
+ (select 4 as foo) r
+ using (foo))
+ using(foo) order by foo \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_table_used_order.sql b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order.sql
new file mode 100644
index 0000000000..a3f58c4dbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+select * from
+ ((select 1 as foo) aa
+ join
+ (select 1 as foo, 2 as bar) bb
+ using (foo)
+ join
+ (select 2 as bar, 1 as x) cc
+ using (bar)
+ join
+ (select 1 as x) dd
+ using (x)
+ ) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_table_used_order1.sql b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order1.sql
new file mode 100644
index 0000000000..bd66d6881f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order1.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+select * from
+ ((select 1 as foo, 1 as x) aa
+ join
+ (select 1 as foo, 2 as bar) bb
+ using (foo)
+ join
+ (select 2 as zoo, 1 as x) cc
+ using (x)
+ ) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.cfg b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.sql b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.sql
new file mode 100644
index 0000000000..b5d0bdd25c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_table_used_order2.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+select * from
+ ((select 1 as foo, 1 as bar, 1 as zoo) aa
+ join
+ (select 1 as foo, 1 as bar, 1 as zoo) bb
+ using (foo)
+ join
+ (select 1 as bar, 1 as zoo) cc
+ using (zoo)
+ ) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_tables1.sql b/yql/essentials/tests/sql/suites/pg/join_using_tables1.sql
new file mode 100644
index 0000000000..6641655afc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_tables1.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select a.* from (
+ plato."Input" a
+ join
+ plato."Input"
+ using(key)) order by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_tables2.sql b/yql/essentials/tests/sql/suites/pg/join_using_tables2.sql
new file mode 100644
index 0000000000..e8a7531146
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_tables2.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select a.* from (
+ plato."Input"
+ join
+ plato."Input" a
+ using(key)) order by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_tables3.sql b/yql/essentials/tests/sql/suites/pg/join_using_tables3.sql
new file mode 100644
index 0000000000..4d7ccc7630
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_tables3.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select * from (
+ plato."Input" a
+ full join
+ plato."Input"
+ using(key,subkey,value)) order by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/join_using_tables4.sql b/yql/essentials/tests/sql/suites/pg/join_using_tables4.sql
new file mode 100644
index 0000000000..008fcbf819
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/join_using_tables4.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select key from (
+ plato."Input" a
+ full join
+ plato."Input5"
+ using(key)) order by key \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/lang_sql.sql b/yql/essentials/tests/sql/suites/pg/lang_sql.sql
new file mode 100644
index 0000000000..e402811d94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/lang_sql.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select lpad('abc',5);
+
diff --git a/yql/essentials/tests/sql/suites/pg/long_ident.sql b/yql/essentials/tests/sql/suites/pg/long_ident.sql
new file mode 100644
index 0000000000..817162befa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/long_ident.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 as aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggg \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/multi_usage_cross_join.sql b/yql/essentials/tests/sql/suites/pg/multi_usage_cross_join.sql
new file mode 100644
index 0000000000..f62e70eb34
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/multi_usage_cross_join.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+
+with foo(x) as (
+ select 1 as x
+)
+select count(*) from foo a,foo b
+where a.x=b.x and a.x<2;
+
+with foo(x) as (
+ select 1 as x
+)
+select count(*) from foo a,foo b
+where a.x=b.x and a.x>1;
diff --git a/yql/essentials/tests/sql/suites/pg/name.cfg b/yql/essentials/tests/sql/suites/pg/name.cfg
new file mode 100644
index 0000000000..d54cfe5b7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/name.cfg
@@ -0,0 +1,2 @@
+in Input input_name.txt
+out Output output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/name.sql b/yql/essentials/tests/sql/suites/pg/name.sql
new file mode 100644
index 0000000000..42d2e28596
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/name.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+INSERT INTO plato."Output"
+SELECT
+ key, index+1 as index
+FROM plato."Input"
+ORDER BY index; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/nothing.sql b/yql/essentials/tests/sql/suites/pg/nothing.sql
new file mode 100644
index 0000000000..a55d35ec52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/nothing.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select null::bool,null::int,null::float,null::varchar
diff --git a/yql/essentials/tests/sql/suites/pg/nullif.sql b/yql/essentials/tests/sql/suites/pg/nullif.sql
new file mode 100644
index 0000000000..8207ab1c99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/nullif.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select nullif(1, 1), nullif(1, 2.2), nullif(2, 1), nullif(1.2, '7'), nullif(1.2, '1.2'); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/nulls.sql b/yql/essentials/tests/sql/suites/pg/nulls.sql
new file mode 100644
index 0000000000..3ba4143226
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/nulls.sql
@@ -0,0 +1,39 @@
+use plato;
+
+insert into @foo
+select
+
+ 1 as a,
+ Nothing(pgcstring) as i1,
+
+ Just(Nothing(pgcstring)) as j1,
+ Nothing(pgcstring?) as j2,
+
+ Just(Just(Nothing(pgcstring))) as k1,
+ Just(Nothing(pgcstring?)) as k2,
+ Nothing(pgcstring??) as k3
+
+;
+
+commit;
+
+insert into @bar
+select t.a+1 as a,t.* without a from @foo as t;
+
+commit;
+
+select
+a,
+i1,i1 is null as i1n,
+j1,j1 is null as j1n,
+j2,j2 is null as j2n,
+k1,k1 is null as k1n,
+k2,k2 is null as k2n,
+k3,k3 is null as k3n
+from @bar;
+
+
+
+
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/nulls_native.sql b/yql/essentials/tests/sql/suites/pg/nulls_native.sql
new file mode 100644
index 0000000000..3b77aeb9db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/nulls_native.sql
@@ -0,0 +1,40 @@
+use plato;
+pragma yt.UseNativeYtTypes;
+
+insert into @foo
+select
+
+ 1 as a,
+ Nothing(pgcstring) as i1,
+
+ Just(Nothing(pgcstring)) as j1,
+ Nothing(pgcstring?) as j2,
+
+ Just(Just(Nothing(pgcstring))) as k1,
+ Just(Nothing(pgcstring?)) as k2,
+ Nothing(pgcstring??) as k3
+
+;
+
+commit;
+
+insert into @bar
+select t.a+1 as a,t.* without a from @foo as t;
+
+commit;
+
+select
+a,
+i1,i1 is null as i1n,
+j1,j1 is null as j1n,
+j2,j2 is null as j2n,
+k1,k1 is null as k1n,
+k2,k2 is null as k2n,
+k3,k3 is null as k3n
+from @bar;
+
+
+
+
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/numbers_to_pg.sql b/yql/essentials/tests/sql/suites/pg/numbers_to_pg.sql
new file mode 100644
index 0000000000..d8888ac9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/numbers_to_pg.sql
@@ -0,0 +1,5 @@
+select ToPg(-128t),ToPg(127t),ToPg(0ut),ToPg(255ut),
+ ToPg(-32768s),ToPg(32767s),ToPg(0us),ToPg(65535us),
+ ToPg(-2147483648),ToPg(2147483647),ToPg(0u),ToPg(4294967295u),
+ ToPg(-9223372036854775808l),ToPg(9223372036854775807l),ToPg(0ul),ToPg(9223372036854775807ul),ToPg(9223372036854775808ul),ToPg(18446744073709551615ul),
+ ToPg(1.3f),ToPg(-2.4);
diff --git a/yql/essentials/tests/sql/suites/pg/numeric_to_pg.sql b/yql/essentials/tests/sql/suites/pg/numeric_to_pg.sql
new file mode 100644
index 0000000000..5972bd219a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/numeric_to_pg.sql
@@ -0,0 +1,3 @@
+select ToPg(Decimal('nan',25,1)), ToPg(Decimal('inf',25,1)), ToPg(Decimal('-inf',25,1)),
+ ToPg(Decimal('1.23',25,1)), ToPg(DyNumber("-10.23"));
+
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_extra_for_keys.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_extra_for_keys.sql
new file mode 100644
index 0000000000..070e5d7064
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_extra_for_keys.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x
+from (values (1,2,3)) a(x,y,z)
+group by x,y
+order by y,count(z) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_aggr.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_aggr.sql
new file mode 100644
index 0000000000..87253bf1b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_aggr.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select 1
+from (values (1,1),(2,5),(2,4)) a(x,y)
+group by x
+order by count(*)
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_full.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_full.sql
new file mode 100644
index 0000000000..6498f10b3c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_full.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select sum(x)
+from (values (1,1),(2,5),(2,4)) a(x,y)
+order by count(*)
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_keys.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_keys.sql
new file mode 100644
index 0000000000..815173ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_keys.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select 1
+from (values (1,1),(2,5),(2,4)) a(x,y)
+group by x
+order by x
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_aggr.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_aggr.sql
new file mode 100644
index 0000000000..73e2f8efcf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_aggr.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x, count(*)
+from (values (1,1),(3,5),(3,4)) a(x,y)
+group by x
+order by count(*)+1 desc
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_keys_and_aggr.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_keys_and_aggr.sql
new file mode 100644
index 0000000000..076e8ea186
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_input_columns_prj_and_keys_and_aggr.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x, count(*)
+from (values (1,1),(3,5),(3,4)) a(x,y)
+group by x
+order by count(*)+1 desc,x
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_agg_no_extra_for_aggs.sql b/yql/essentials/tests/sql/suites/pg/order_by_agg_no_extra_for_aggs.sql
new file mode 100644
index 0000000000..5c6cf52019
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_agg_no_extra_for_aggs.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select count(x) as y
+from (values (1)) a(x)
+order by sum(x)
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr.sql b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr.sql
new file mode 100644
index 0000000000..56a03ea834
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select distinct x+1 as y,x-1 from (select 1 as x) a order by x+1,x-1
+
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg.sql b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg.sql
new file mode 100644
index 0000000000..2ea98f75e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select distinct (x + 1) * 2 as y,(x + 1) * 3,min(z) - 1 from (select 1 as x,2 as z) a group by x + 1 order by (x + 1) * 2, (x + 1) * 3, min(z) - 1
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg_sublink.sql b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg_sublink.sql
new file mode 100644
index 0000000000..3f1d1169d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_distinct_same_expr_agg_sublink.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select distinct x + 1/(select count(*) from pg_type) as y from (select 1 as x) a order by x + 1/(select count(*) from pg_type)
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_input_columns.sql b/yql/essentials/tests/sql/suites/pg/order_by_input_columns.sql
new file mode 100644
index 0000000000..c1735bcfff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_input_columns.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select y
+from (values (1,1),(2,5),(7,4)) a(x,y)
+order by x desc \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_input_columns_qual.sql b/yql/essentials/tests/sql/suites/pg/order_by_input_columns_qual.sql
new file mode 100644
index 0000000000..536d1ce2eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_input_columns_qual.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select y
+from (values (1,1),(2,5),(7,4)) a(x,y)
+order by a.x desc \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns.sql b/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns.sql
new file mode 100644
index 0000000000..16de18abe3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select -x as x
+from (values (1,1),(2,5),(7,4)) a(x,y)
+order by x desc \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns_qual.sql b/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns_qual.sql
new file mode 100644
index 0000000000..d04a344882
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/order_by_shadow_input_columns_qual.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select -x as x
+from (values (1,1),(2,5),(7,4)) a(x,y)
+order by a.x desc \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/palloc_big_string.sql b/yql/essentials/tests/sql/suites/pg/palloc_big_string.sql
new file mode 100644
index 0000000000..059b2a322b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/palloc_big_string.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+-- string larger than page (65489 bytes)
+select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
diff --git a/yql/essentials/tests/sql/suites/pg/param_text1.json b/yql/essentials/tests/sql/suites/pg/param_text1.json
new file mode 100644
index 0000000000..d4e83b6c9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/param_text1.json
@@ -0,0 +1 @@
+"param_text1"
diff --git a/yql/essentials/tests/sql/suites/pg/param_text2.json b/yql/essentials/tests/sql/suites/pg/param_text2.json
new file mode 100644
index 0000000000..b948e9f727
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/param_text2.json
@@ -0,0 +1 @@
+"param_text2"
diff --git a/yql/essentials/tests/sql/suites/pg/parametrized.cfg b/yql/essentials/tests/sql/suites/pg/parametrized.cfg
new file mode 100644
index 0000000000..094e634048
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/parametrized.cfg
@@ -0,0 +1,2 @@
+param $p1 param_text1.json
+param $p2 param_text2.json
diff --git a/yql/essentials/tests/sql/suites/pg/parametrized.sql b/yql/essentials/tests/sql/suites/pg/parametrized.sql
new file mode 100644
index 0000000000..96304e7cc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/parametrized.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select $1 as "text_col", $2 as "text_col_2";
diff --git a/yql/essentials/tests/sql/suites/pg/pg_array_cast.sql b/yql/essentials/tests/sql/suites/pg/pg_array_cast.sql
new file mode 100644
index 0000000000..7cbe0cc881
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_array_cast.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select
+cast(array[1,2,3] as text),
+cast('{1,2,3}' as _int4),
+cast(array[1,2,3] as _int8),
+cast(array[1,2,3] as _text),
+cast(array['1',null,'3'] as _int4),
+cast(array['{"a":1}'::json,'{"b":2}'::json] as _jsonb),
+cast(array[1,2,3] as _oid)
diff --git a/yql/essentials/tests/sql/suites/pg/pg_array_compare.sql b/yql/essentials/tests/sql/suites/pg/pg_array_compare.sql
new file mode 100644
index 0000000000..aa890a286e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_array_compare.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select array[1, 2] < array[1, 3]
+ , array[1, 2] = array[1, 3]
+;
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_array_literal.sql b/yql/essentials/tests/sql/suites/pg/pg_array_literal.sql
new file mode 100644
index 0000000000..ff3435ec7a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_array_literal.sql
@@ -0,0 +1,15 @@
+--!syntax_pg
+select
+array['a','b'] a1,
+array[array['a','b']] a2,
+array[array['a','b'],array['c','d']] a3,
+array['a',null] a4,
+array[null] a5,
+array[1] a6,
+array[1,2] a7,
+array[null::int4,2] a8,
+array[array[1,2]] a9,
+array[array[1,2],array[3,4]] a10,
+array_out(array[1,2]) a11,
+array_out(array[null,'NULL','',',','{}']) a12
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_column_case.cfg b/yql/essentials/tests/sql/suites/pg/pg_column_case.cfg
new file mode 100644
index 0000000000..a175d357b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_column_case.cfg
@@ -0,0 +1,2 @@
+in InputC inputC.txt
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_column_case.sql b/yql/essentials/tests/sql/suites/pg/pg_column_case.sql
new file mode 100644
index 0000000000..a04df0091f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_column_case.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select id, CodeGen_FullTime
+ , "CodeGen_FullTime" as Quoted
+ , CodeGen_FullTime || 'x'
+ , "CodeGen_FullTime" || 'x'
+ , (CodeGen_FullTime || 'x')
+from plato."InputC" limit 100;
diff --git a/yql/essentials/tests/sql/suites/pg/pg_corr_count.sql b/yql/essentials/tests/sql/suites/pg/pg_corr_count.sql
new file mode 100644
index 0000000000..150d502aea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_corr_count.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+SELECT y,
+(select count(*) from (values (1),(2),(3)) a(x) where a.x=y
+)
+FROM
+(values (4)) b(y)
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_corr_limit.sql b/yql/essentials/tests/sql/suites/pg/pg_corr_limit.sql
new file mode 100644
index 0000000000..aab8a41c46
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_corr_limit.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+SELECT y,
+(
+ select x+y as v from (values (1),(1),(1)) a(x)
+ limit 1
+)
+FROM
+(values (40),(50),(60)) b(y)
+order by y
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_corr_offset.sql b/yql/essentials/tests/sql/suites/pg/pg_corr_offset.sql
new file mode 100644
index 0000000000..0b86d1ae7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_corr_offset.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+SELECT y,
+(
+ select x+y as v from (values (1),(1),(1)) a(x)
+ offset 2
+)
+FROM
+(values (40),(50),(60)) b(y)
+order by y
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit.sql b/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit.sql
new file mode 100644
index 0000000000..81c4edba78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+SELECT y,
+(
+ select x+y as v from (values (3),(1),(2)) a(x)
+ order by v
+ limit 1
+)
+FROM
+(values (40),(50),(60)) b(y)
+order by y
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit2.sql b/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit2.sql
new file mode 100644
index 0000000000..1707b33558
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_corr_sort_limit2.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+SELECT y,
+(
+ select x+y as v from (values (3),(1)) a(x)
+ union all
+ select x+y as v from (values (2)) a(x)
+ order by v
+ limit 1
+)
+FROM
+(values (40),(50),(60)) b(y)
+order by y
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_in_dict_key_with_stable_pickle.sql b/yql/essentials/tests/sql/suites/pg/pg_in_dict_key_with_stable_pickle.sql
new file mode 100644
index 0000000000..95495e7616
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_in_dict_key_with_stable_pickle.sql
@@ -0,0 +1,8 @@
+select StablePickle({{1,2},{3,4}}) == StablePickle({{4,3},{2,1}});
+
+select
+ StablePickle({{pgdate('2020-01-01'),pgdate('2020-01-02')},{pgdate('2020-01-03'),pgdate('2020-01-04')}}) ==
+ StablePickle({{pgdate('2020-01-04'),pgdate('2020-01-03')},{pgdate('2020-01-02'),pgdate('2020-01-01')}});
+
+select StablePickle({{pgbit('0001'),pgbit('0010')},{pgbit('0100'),pgbit('1000')}}) ==
+ StablePickle({{pgbit('1000'),pgbit('0100')},{pgbit('0010'),pgbit('0001')}}); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/pg_in_expr.sql b/yql/essentials/tests/sql/suites/pg/pg_in_expr.sql
new file mode 100644
index 0000000000..913e76fabf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_in_expr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 in (2),1 in (2,1), 1 in (1),null::int4 in (1),1 in (null::int4),null in (null) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/pg_interval_literal.sql b/yql/essentials/tests/sql/suites/pg/pg_interval_literal.sql
new file mode 100644
index 0000000000..43e50a75c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_interval_literal.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+ INTERVAL '1 day 2:03:04' HOUR TO MINUTE,
+ INTERVAL '5',
+ INTERVAL '90' DAY
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_iterate.sql b/yql/essentials/tests/sql/suites/pg/pg_iterate.sql
new file mode 100644
index 0000000000..2c58f3957b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_iterate.sql
@@ -0,0 +1,22 @@
+pragma warning("disable","4510");
+$init = ListCreate(Struct<n:Int32>);
+$transform = ($value)->{
+ return ListMap(ListFilter($value, ($r)->($r.n<5)), ($r)->(<|n:$r.n + 1|>));
+};
+
+select * from AS_TABLE(Yql::PgIterateAll($init,$transform)) order by n;
+
+$init = [<|n:1|>];
+$transform = ($value)->{
+ return ListMap(ListFilter($value, ($r)->($r.n<5)), ($r)->(<|n:$r.n + 1|>));
+};
+
+select * from AS_TABLE(Yql::PgIterateAll($init,$transform)) order by n;
+
+$init = [<|n:1|>, <|n:1|>, <|n:2|>];
+$transform = ($value)->{
+ return ListFlatMap($value, ($_r)->([<|n:1|>,<|n:2|>,<|n:2|>]));
+};
+
+select * from AS_TABLE(Yql::PgIterate($init,$transform)) order by n;
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_like.cfg b/yql/essentials/tests/sql/suites/pg/pg_like.cfg
new file mode 100644
index 0000000000..e035127424
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_like.cfg
@@ -0,0 +1 @@
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/pg/pg_like.sql b/yql/essentials/tests/sql/suites/pg/pg_like.sql
new file mode 100644
index 0000000000..3a21574890
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_like.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select x like y from ( select 'a' as x, 'a%' as y) as a;
+select x ilike y from ( select 'a' as x, 'A%' as y) as a;
+select x like y from ( select 'a' as x, 'A%' as y) as a;
+select x like y from ( select 'a' as x, null as y) as a;
+select x like y from ( select null as x, 'a%' as y) as a;
diff --git a/yql/essentials/tests/sql/suites/pg/pg_like_cast.sql b/yql/essentials/tests/sql/suites/pg/pg_like_cast.sql
new file mode 100644
index 0000000000..998a6c6514
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_like_cast.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_like_opt.sql b/yql/essentials/tests/sql/suites/pg/pg_like_opt.sql
new file mode 100644
index 0000000000..0c3c60d5c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_like_opt.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 'abc' like 'abc', 'abc' like '%bc', 'abc' like 'ab%', 'abc' like '%b%' \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/pg_type_from_oid.sql b/yql/essentials/tests/sql/suites/pg/pg_type_from_oid.sql
new file mode 100644
index 0000000000..2fe7acb7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_type_from_oid.sql
@@ -0,0 +1,2 @@
+select FormatType(PgType(25)), FormatType(PgType("int4"));
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_aggregate1.sql b/yql/essentials/tests/sql/suites/pg/pg_types_aggregate1.sql
new file mode 100644
index 0000000000..a8eaecab0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_aggregate1.sql
@@ -0,0 +1,80 @@
+--!syntax_pg
+select count(*) from (
+select 1 as x,2 as y
+union all
+select 2 as x,3 as y
+) a;
+
+select count(x) from (
+select 1 as x,2 as y
+union all
+select 2 as x,3 as y
+union all
+select 3 as x,3 as y
+) a;
+
+select count(x) from (
+select null::int4 as x,2 as y
+union all
+select 2 as x,3 as y
+union all
+select 3 as x,3 as y
+) a;
+
+select count(x) from (
+select 1 as x,2 as y
+union all
+select null::int4 as x,3 as y
+union all
+select 3 as x,3 as y
+) a;
+
+select count(x) from (
+select 1 as x,2 as y
+union all
+select 2 as x,3 as y
+union all
+select null::int4 as x,3 as y
+) a;
+
+select sum(x) from (
+select 10 as x,2 as y
+union all
+select 20 as x,3 as y
+) a;
+
+select sum(x) from (
+select 10 as x,2 as y
+union all
+select null::int4 as x,3 as y
+) a;
+
+select sum(x) from (
+select null::int4 as x,2 as y
+union all
+select 20 as x,3 as y
+) a;
+
+select sum(x) from (
+select 10.0::float8 as x,2 as y
+union all
+select 20.0::float8 as x,3 as y
+) a;
+
+select sum(x) from (
+select 10.0::float8 as x,2 as y
+union all
+select null::float8 as x,3 as y
+) a;
+
+select sum(x) from (
+select null::float8 as x,2 as y
+union all
+select 20.0::float8 as x,3 as y
+) a;
+
+select regr_count(x,y) from (
+select 1.0::float8 as x,2.0::float8 as y
+union all
+select 2.0::float8 as x,3.0::float8 as y
+) a;
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_array_literal.sql b/yql/essentials/tests/sql/suites/pg/pg_types_array_literal.sql
new file mode 100644
index 0000000000..12c49c1f02
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_array_literal.sql
@@ -0,0 +1 @@
+select PgArray(1p,null,2p)
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_cast_with_length.sql b/yql/essentials/tests/sql/suites/pg/pg_types_cast_with_length.sql
new file mode 100644
index 0000000000..fad800a55a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_cast_with_length.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select
+ cast('foo' as varchar(2)),
+ cast(12345 as varchar(2)),
+ cast('{foo,bar}' as _varchar(2)),
+ cast(array['foo','bar'] as _varchar(2)),
+ cast(array[12345,67890] as _varchar(2)),
+ cast(array['foo','bar'] as varchar(2)),
+ cast(array[12345,67890] as varchar(2));
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_dict.cfg b/yql/essentials/tests/sql/suites/pg/pg_types_dict.cfg
new file mode 100644
index 0000000000..73b348a561
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_dict.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_dict.sql b/yql/essentials/tests/sql/suites/pg/pg_types_dict.sql
new file mode 100644
index 0000000000..54634fff1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_dict.sql
@@ -0,0 +1,17 @@
+select
+ToSortedDict([([pgdate('2012-01-01')],0), ([pgdate('2012-01-01')],1)]),
+ToDict([([pgdate('2012-01-01')],0), ([pgdate('2012-01-01')],1)]),
+ToSortedMultiDict([([pgdate('2012-01-01')],0), ([pgdate('2012-01-01')],1)]),
+ToMultiDict([([pgdate('2012-01-01')],0), ([pgdate('2012-01-01')],1)]);
+
+select
+ToSortedDict([([pgtext('2012-01-01')],0), ([pgtext('2012-01-01')],1)]),
+ToDict([([pgtext('2012-01-01')],0), ([pgtext('2012-01-01')],1)]),
+ToSortedMultiDict([([pgtext('2012-01-01')],0), ([pgtext('2012-01-01')],1)]),
+ToMultiDict([([pgtext('2012-01-01')],0), ([pgtext('2012-01-01')],1)]);
+
+select
+ToSortedDict([([pgdate('2021-01-01')],0), ([pgdate('1999-01-01')],1)]);
+
+select
+ToSortedDict([([pgtext('2021-01-01')],0), ([pgtext('1999-01-01')],1)]);
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_literal_mods.sql b/yql/essentials/tests/sql/suites/pg/pg_types_literal_mods.sql
new file mode 100644
index 0000000000..6765b0b504
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_literal_mods.sql
@@ -0,0 +1,14 @@
+select
+PgConst(90,pginterval,"day"),
+PgConst("1.2345678",pginterval,"second",3),
+PgConst('{90}',_pginterval,"day"),
+PgConst('13.45',pgnumeric,10,1),
+PgConst('{13.45}',_pgnumeric,10,1),
+PgCast('90'p,pginterval,"day"),
+PgCast('13.45'p,pgnumeric,10,1),
+PgCast('{90}'p,_pginterval,"day"),
+PgCast('{13.45}'p,_pgnumeric,10,1),
+PgInterval(90, "day"),
+PgNumeric(13.45, 10, 1),
+_PgInterval('{90}', "day"),
+_PgNumeric('{13.45}', 10, 1);
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_literal_with_length.sql b/yql/essentials/tests/sql/suites/pg/pg_types_literal_with_length.sql
new file mode 100644
index 0000000000..08ff3c1bda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_literal_with_length.sql
@@ -0,0 +1,4 @@
+select
+ PgConst('foo', pgvarchar, 2),
+ PgConst(12345, pgvarchar, 2),
+ PgConst('{foo,bar}', _pgvarchar, 2);
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_orderby.cfg b/yql/essentials/tests/sql/suites/pg/pg_types_orderby.cfg
new file mode 100644
index 0000000000..748ba77b3f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_orderby.cfg
@@ -0,0 +1,2 @@
+in Input4 input4.txt
+providers dq
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_orderby.sql b/yql/essentials/tests/sql/suites/pg/pg_types_orderby.sql
new file mode 100644
index 0000000000..56fd84dded
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_orderby.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+select b_val::bool as value
+from plato."Input4"
+order by value;
+
+select i_val::int2 as value
+from plato."Input4"
+order by value;
+
+select i_val::int4 as value
+from plato."Input4"
+order by value;
+
+select i_val::int8 as value
+from plato."Input4"
+order by value;
+
+select i_val::float4 as value
+from plato."Input4"
+order by value;
+
+select i_val::float8 as value
+from plato."Input4"
+order by value;
+
+select d_val::bytea as value
+from plato."Input4"
+order by value;
+
+select d_val::date as value
+from plato."Input4"
+order by value;
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_window1.sql b/yql/essentials/tests/sql/suites/pg/pg_types_window1.sql
new file mode 100644
index 0000000000..988682a9c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_window1.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select string_agg(x,',') over w
+from (values ('a'),('b'),('c')) a(x)
+window w as (order by x)
diff --git a/yql/essentials/tests/sql/suites/pg/pg_types_window2.sql b/yql/essentials/tests/sql/suites/pg/pg_types_window2.sql
new file mode 100644
index 0000000000..a08d28ad30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_types_window2.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,row_number() over w,lag(x) over w,lead(x) over w
+from (values ('a'),('b'),('c')) a(x)
+window w as (order by x)
diff --git a/yql/essentials/tests/sql/suites/pg/pg_view.sql b/yql/essentials/tests/sql/suites/pg/pg_view.sql
new file mode 100644
index 0000000000..f62fe320b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pg_view.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+create view a(x,y) as select 1,2;
+select * from a;
+create or replace view a(x,y) as values (3,4);
+select * from a;
+drop view a;
+drop view if exists a,b,c;
diff --git a/yql/essentials/tests/sql/suites/pg/pgns_agg.sql b/yql/essentials/tests/sql/suites/pg/pgns_agg.sql
new file mode 100644
index 0000000000..bb19c6421e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pgns_agg.sql
@@ -0,0 +1,2 @@
+select PgAgg::count() from (select 1);
+
diff --git a/yql/essentials/tests/sql/suites/pg/pgns_proc.sql b/yql/essentials/tests/sql/suites/pg/pgns_proc.sql
new file mode 100644
index 0000000000..3429538606
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/pgns_proc.sql
@@ -0,0 +1 @@
+select PgProc::upper('a'u);
diff --git a/yql/essentials/tests/sql/suites/pg/point.sql b/yql/essentials/tests/sql/suites/pg/point.sql
new file mode 100644
index 0000000000..c106a3ecca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/point.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select key,'(1,2)'::point from plato."Input"
+order by key;
diff --git a/yql/essentials/tests/sql/suites/pg/range_function_multi.sql b/yql/essentials/tests/sql/suites/pg/range_function_multi.sql
new file mode 100644
index 0000000000..4f188c9000
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/range_function_multi.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from generate_series(1,10);
+select * from generate_series(1,10) x;
+select * from generate_series(1,10) x(y);
diff --git a/yql/essentials/tests/sql/suites/pg/range_function_multi_record.sql b/yql/essentials/tests/sql/suites/pg/range_function_multi_record.sql
new file mode 100644
index 0000000000..da9330fc6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/range_function_multi_record.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from json_each('{"a":"foo", "b":"bar"}');
+select * from json_each('{"a":"foo", "b":"bar"}') as f;
+select * from json_each('{"a":"foo", "b":"bar"}') as f(x,y);
diff --git a/yql/essentials/tests/sql/suites/pg/range_function_scalar.sql b/yql/essentials/tests/sql/suites/pg/range_function_scalar.sql
new file mode 100644
index 0000000000..e5b0525ddd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/range_function_scalar.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from upper('abc');
+select * from upper('abc') x;
+select * from upper('abc') x(a);
diff --git a/yql/essentials/tests/sql/suites/pg/record_from_table_row.sql b/yql/essentials/tests/sql/suites/pg/record_from_table_row.sql
new file mode 100644
index 0000000000..5133380ec6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/record_from_table_row.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+SELECT row_to_json(TR)
+FROM (select 'foo' as y, 1 as x) tr
+
diff --git a/yql/essentials/tests/sql/suites/pg/reflection.sql b/yql/essentials/tests/sql/suites/pg/reflection.sql
new file mode 100644
index 0000000000..b36947e5d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/reflection.sql
@@ -0,0 +1,2 @@
+select FormatType(PgTypeHandle("text")),PgTypeName(TypeHandle(_pgint4));
+
diff --git a/yql/essentials/tests/sql/suites/pg/regoids.sql b/yql/essentials/tests/sql/suites/pg/regoids.sql
new file mode 100644
index 0000000000..c0b14dfdd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/regoids.sql
@@ -0,0 +1,44 @@
+--!syntax_pg
+
+-- Tests for OID types
+-- See https://www.postgresql.org/docs/14/datatype-oid.html
+
+select oid, oid::regclass from pg_catalog.pg_class
+where oid::regclass in ('pg_user', 'pg_group');
+
+select oid, oid::regconfig from pg_catalog.pg_ts_config
+where oid::regconfig in ('english', 'russian');
+
+select oid, oid::regdictionary from pg_catalog.pg_ts_dict
+where oid::regdictionary in ('irish_stem', 'italian_stem');
+
+select oid, oid::regnamespace from pg_catalog.pg_namespace
+where oid::regnamespace in ('public', 'information_schema');
+
+/*
+TODO: uncomment after YQL-18711
+select oid, oid::regoperator from pg_catalog.pg_operator
+where oid::regoperator in ('=(integer,integer)', '+(float4,float8)');
+*/
+
+/*
+TODO: uncomment after YQL-18712
+select oid, oid::regproc from pg_catalog.pg_proc
+where oid::regproc in ('int4in', 'int4out');
+*/
+
+/*
+TODO: uncomment after YQL-18711
+select oid, oid::regprocedure from pg_catalog.pg_proc
+where oid::regprocedure in ('namein(cstring)', 'nameout(name)');
+*/
+
+select oid, oid::regrole from pg_catalog.pg_authid
+where oid::regrole in ('pg_read_all_data', 'pg_write_all_data');
+
+/*
+TODO: uncomment after YQL-18713
+select oid, oid::regtype from pg_catalog.pg_type
+where oid::regtype in ('boolean', 'char');
+*/
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg.sql b/yql/essentials/tests/sql/suites/pg/select_agg.sql
new file mode 100644
index 0000000000..6bb81d33fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select count(*) c1,count(x) c2,min(x) i1,max(x) a1,sum(x) s1 from
+(values (1),(3),(null::int4)) as u(x)
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_expr_having.sql b/yql/essentials/tests/sql/suites/pg/select_agg_expr_having.sql
new file mode 100644
index 0000000000..93437dce70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_expr_having.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select 1
+from (values (1),(1)) a(x)
+group by x+1
+having x+1=2
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_expr_key_under_agg.sql b/yql/essentials/tests/sql/suites/pg/select_agg_expr_key_under_agg.sql
new file mode 100644
index 0000000000..026cd99a78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_expr_key_under_agg.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select x, min(x) from (select 1 as x) a group by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_expr_order.sql b/yql/essentials/tests/sql/suites/pg/select_agg_expr_order.sql
new file mode 100644
index 0000000000..9e78d6ffdd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_expr_order.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select 1
+from (values (1),(1)) a(x)
+group by x+1
+order by x+1
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_expr_projection.sql b/yql/essentials/tests/sql/suites/pg/select_agg_expr_projection.sql
new file mode 100644
index 0000000000..4e000dc3ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_expr_projection.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x+1
+from (values (1),(1)) a(x)
+group by x+1
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_group.sql b/yql/essentials/tests/sql/suites/pg/select_agg_group.sql
new file mode 100644
index 0000000000..10caa8edb6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_group.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x,count(y),min(y),max(y),sum(y)
+from (values (1,2),(3,4),(3,5)) u(x,y)
+group by x
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_group_key_only.sql b/yql/essentials/tests/sql/suites/pg/select_agg_group_key_only.sql
new file mode 100644
index 0000000000..8a133d4248
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_group_key_only.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x
+from (values (1,2),(3,4),(3,5)) u(x,y)
+group by x
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_gs_cube.sql b/yql/essentials/tests/sql/suites/pg/select_agg_gs_cube.sql
new file mode 100644
index 0000000000..e308294353
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_gs_cube.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select x,y
+from (
+ values (1,2),(1,2),(2,3),(2,2)
+) a(x,y)
+group by cube(x,y)
+order by x,y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_gs_grouping.sql b/yql/essentials/tests/sql/suites/pg/select_agg_gs_grouping.sql
new file mode 100644
index 0000000000..96f8a67ac9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_gs_grouping.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select x,y,grouping(x),grouping(y),grouping(x,y)
+from (
+ values (1,2),(1,2),(2,3),(2,2)
+) a(x,y)
+group by cube(x,y)
+order by x,y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_gs_rollup.sql b/yql/essentials/tests/sql/suites/pg/select_agg_gs_rollup.sql
new file mode 100644
index 0000000000..2c556ad1f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_gs_rollup.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select x,y
+from (
+ values (1,2),(1,2),(2,3),(2,2)
+) a(x,y)
+group by rollup(x,y)
+order by x,y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_gs_sets.sql b/yql/essentials/tests/sql/suites/pg/select_agg_gs_sets.sql
new file mode 100644
index 0000000000..e702a254be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_gs_sets.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select x,y
+from (
+ values (1,2),(1,2),(2,3),(2,2)
+) a(x,y)
+group by grouping sets((x),(),(y))
+order by x,y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_one_row.sql b/yql/essentials/tests/sql/suites/pg/select_agg_one_row.sql
new file mode 100644
index 0000000000..88f7f3e4c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_one_row.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+ count(*) c1,count(0) c2,count(null) c3,count(null::text) c4,
+ min(5) i1,min('a') i2,min(1.0) i3,min(null) i4,min(null::text) i5,
+ max(6) a1,max('a') a2,max(1.0) a3,max(null) a4,max(null::text) a5,
+ sum(7) s1,sum(1.0) s2,sum(null::int) s3
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_agg_qstar.sql
new file mode 100644
index 0000000000..f3e0c473df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_qstar.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select 1,a.* from
+(values (1,2,3)) a(x,y,z)
+group by x,y,z \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_agg_star.sql b/yql/essentials/tests/sql/suites/pg/select_agg_star.sql
new file mode 100644
index 0000000000..28692ef83d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_agg_star.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from
+(values (1,2,3)) a(x,y,z)
+group by x,y,z \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_alias_partial.sql b/yql/essentials/tests/sql/suites/pg/select_alias_partial.sql
new file mode 100644
index 0000000000..2db4a8111e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_alias_partial.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select key,a.value,key2 from plato."Input" as a,plato."Input2";
diff --git a/yql/essentials/tests/sql/suites/pg/select_and_or_group.sql b/yql/essentials/tests/sql/suites/pg/select_and_or_group.sql
new file mode 100644
index 0000000000..ae0230e807
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_and_or_group.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 < 2 and 2 < 3 and 3 < 4 as and3_true, 1 < 2 and 2 > 3 and 3 < 4 as and3_false, 1 > 2 or 2 > 3 or 3 < 4 as or3_true, 1 > 2 or 2 > 3 or 3 > 4 as or3_false
diff --git a/yql/essentials/tests/sql/suites/pg/select_between.sql b/yql/essentials/tests/sql/suites/pg/select_between.sql
new file mode 100644
index 0000000000..17c57a604b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_between.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+select
+1 between 2 and 4,3 between 2 and 4,5 between 2 and 4,3 between 4 and 2,
+null::int4 between 2 and 4,1 between null::int4 and 4,1 between 4 and null::int4,1 between 0 and null::int4,
+null between null and null;
+
+select 3 between symmetric 4 and 2,
+3 between symmetric 0 and 2,
+null::int4 between symmetric 4 and 2,
+3 between symmetric null::int4 and 2,
+3 between symmetric 2 and null::int4;
diff --git a/yql/essentials/tests/sql/suites/pg/select_case.sql b/yql/essentials/tests/sql/suites/pg/select_case.sql
new file mode 100644
index 0000000000..67ba959fa8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_case.sql
@@ -0,0 +1,20 @@
+--!syntax_pg
+
+select
+-- case $x when
+case 2 when 1 then 777 else 999 end a1,
+case 1 when 1 then 777 else 999 end a2,
+case 1 when 1 then 3 end a3,
+case 1 when 2 then 3 end a4,
+case 1 when 2 then 3 else 4 end a5,
+case 1 when 2 then 20 when 3 then 30 when 4 then 40 when 5 then 50 when 6 then 60 when 7 then 70 else 100 end a6,
+case 1 when 2 then 20 when 3 then 30 when 4 then 40 when 5 then 50 when 6 then 60 when 7 then 70 end a7,
+
+-- case when
+case when 2=1 then 777 else 999 end b1,
+case when 1=1 then 777 else 999 end b2,
+case when 1=1 then 3 end b3,
+case when 1=2 then 3 end b4,
+case when 1=2 then 3 else 4 end b5,
+case when 1=2 then 20 when 1=3 then 30 when 1=4 then 40 when 1=5 then 50 when 1=6 then 60 when 1=7 then 70 else 100 end b6,
+case when 1=2 then 20 when 1=3 then 30 when 1=4 then 40 when 1=5 then 50 when 1=6 then 60 when 1=7 then 70 end b7
diff --git a/yql/essentials/tests/sql/suites/pg/select_cast_same_arg.sql b/yql/essentials/tests/sql/suites/pg/select_cast_same_arg.sql
new file mode 100755
index 0000000000..d61a801716
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_cast_same_arg.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1::varchar(255) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_columnref1.sql b/yql/essentials/tests/sql/suites/pg/select_columnref1.sql
new file mode 100644
index 0000000000..b45b8e3cc3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_columnref1.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select key, value || '!', key || value as c from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/select_columnref2.sql b/yql/essentials/tests/sql/suites/pg/select_columnref2.sql
new file mode 100644
index 0000000000..dce20796a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_columnref2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select key, value || '!', key2, value2, key || value2 as c from plato."Input", plato."Input2";
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_except.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_except.sql
new file mode 100644
index 0000000000..8a08cf3234
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_except.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select 1
+except
+select '1';
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_exceptall.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_exceptall.sql
new file mode 100644
index 0000000000..f46620b7a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_exceptall.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+values ('1'), (1), ('2')
+except all
+select 1
+order by 1;
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_if.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_if.sql
new file mode 100644
index 0000000000..b92287e963
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_if.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select case when true then 1::numeric else -1::int4 end;
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_intersect.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_intersect.sql
new file mode 100644
index 0000000000..f25b41e8c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_intersect.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select '1'
+intersect
+select 1;
+
+select * from (values ('1'), ('2')) t
+intersect
+select '1';
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_intersectall.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_intersectall.sql
new file mode 100644
index 0000000000..11bd725c66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_intersectall.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+values ('1'), (1), (2)
+intersect all
+select 1;
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_union.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_union.sql
new file mode 100644
index 0000000000..5858c2f9c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_union.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select 1
+union
+select '1'
+union
+select '2'
+order by 1;
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.cfg b/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.cfg
new file mode 100644
index 0000000000..1a343da34c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.cfg
@@ -0,0 +1 @@
+in Input input_pg_int_and_text.txt
diff --git a/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.sql b/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.sql
new file mode 100644
index 0000000000..9b9c379e87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_common_type_unionall.sql
@@ -0,0 +1,21 @@
+--!syntax_pg
+
+-- check unknown-typed string literals converted to int and text types
+-- also check that column names from the 1st select are used for result columns
+select 1 as step, '1', 'x' as c2
+union all
+-- 2nd column is of integer type
+-- It's important to have one of 1st columns' value as the 2nd column value in this SELECT. That helps us to catch ExprNode sharing bugs
+select 2, 3, null as c3
+union all
+-- we need to check casts of aggregation functions' results, so make 2nd column int8
+-- also, check we get PgCasts for columns generated by PgStar
+-- also, check aggregation functions in projection subqueries
+select 3, * from (select 4::int8 as c1, max(b) as c from plato."Input") as t
+union all
+-- check PgQualifiedStar
+select 4, t.* from plato."Input" as t
+union all
+-- check if casts are there for aggregation functions used directly and in a projection
+select 5, min(a), (select min(b) from plato."Input") from plato."Input"
+order by 1, 2, 3
diff --git a/yql/essentials/tests/sql/suites/pg/select_except.sql b/yql/essentials/tests/sql/suites/pg/select_except.sql
new file mode 100644
index 0000000000..15213e93cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_except.sql
@@ -0,0 +1,12 @@
+--!syntax_pg
+select * from (values (1),(1),(1)) a(x)
+except
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1)) a(x)
+except
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1)) a(x)
+except
+select * from (values (1),(1),(1)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_except_all.sql b/yql/essentials/tests/sql/suites/pg/select_except_all.sql
new file mode 100644
index 0000000000..4e423c8ea2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_except_all.sql
@@ -0,0 +1,12 @@
+--!syntax_pg
+select * from (values (1),(1),(1),(1),(1)) a(x)
+except all
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1)) a(x)
+except all
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1)) a(x)
+except all
+select * from (values (1),(1),(1)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_from_columns.sql b/yql/essentials/tests/sql/suites/pg/select_from_columns.sql
new file mode 100644
index 0000000000..26a9849a9f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_from_columns.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a from plato."Input" u(a,b,c)
diff --git a/yql/essentials/tests/sql/suites/pg/select_from_columns_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_from_columns_qstar.sql
new file mode 100644
index 0000000000..de80f5d467
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_from_columns_qstar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select u.* from plato."Input" u(a,b,c)
diff --git a/yql/essentials/tests/sql/suites/pg/select_from_columns_scalar.sql b/yql/essentials/tests/sql/suites/pg/select_from_columns_scalar.sql
new file mode 100644
index 0000000000..1c86464d32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_from_columns_scalar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a from (select 1) x(a)
diff --git a/yql/essentials/tests/sql/suites/pg/select_from_columns_star.sql b/yql/essentials/tests/sql/suites/pg/select_from_columns_star.sql
new file mode 100644
index 0000000000..1ae501d588
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_from_columns_star.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input" u(a,b,c)
diff --git a/yql/essentials/tests/sql/suites/pg/select_having.sql b/yql/essentials/tests/sql/suites/pg/select_having.sql
new file mode 100644
index 0000000000..faba1d41f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_having.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x,sum(y)
+from (values (1,2),(3,4),(3,5)) u(x,y)
+group by x
+having count(y)=2
diff --git a/yql/essentials/tests/sql/suites/pg/select_having_no_from.sql b/yql/essentials/tests/sql/suites/pg/select_having_no_from.sql
new file mode 100644
index 0000000000..b12c6fca4d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_having_no_from.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select 1 having count(*)=0;
+select 2 having count(*)=1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_having_same_agg.sql b/yql/essentials/tests/sql/suites/pg/select_having_same_agg.sql
new file mode 100644
index 0000000000..2eb458681e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_having_same_agg.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x,count(y)
+from (values (1,2),(3,4),(3,5)) u(x,y)
+group by x
+having count(y)=2
diff --git a/yql/essentials/tests/sql/suites/pg/select_intersect.sql b/yql/essentials/tests/sql/suites/pg/select_intersect.sql
new file mode 100644
index 0000000000..183b3cefb0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_intersect.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1),(1),(1)) a(x)
+intersect
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1),(1)) a(x)
+intersect
+select * from (values (2)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_intersect_all.sql b/yql/essentials/tests/sql/suites/pg/select_intersect_all.sql
new file mode 100644
index 0000000000..6d8e43fe13
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_intersect_all.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1),(1),(1)) a(x)
+intersect all
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1),(1)) a(x)
+intersect all
+select * from (values (2)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_is_null.sql b/yql/essentials/tests/sql/suites/pg/select_is_null.sql
new file mode 100644
index 0000000000..2a9bb97dbb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_is_null.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 is null, 2 is not null, null is null, null is not null \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_cross.sql b/yql/essentials/tests/sql/suites/pg/select_join_cross.sql
new file mode 100644
index 0000000000..ec6f271cb0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_cross.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (values (1),(2)) q(x) cross join (values (3),(4)) u(y);
+select * from (values (1),(2)) q(x),(values (3),(4)) u(y); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_cross_and_inner.sql b/yql/essentials/tests/sql/suites/pg/select_join_cross_and_inner.sql
new file mode 100644
index 0000000000..caab400a0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_cross_and_inner.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select * from (values (1),(2)) q(x) cross join (values (3),(4)) u(y) join (values (5),(6)) v(z) on v.z>u.y;
+select * from (values (3),(4)) u(y) join (values (5),(6)) v(z) on v.z>u.y cross join (values (1),(2)) q(x);
+select * from (values (1),(2)) q(x),(values (3),(4)) u(y) join (values (5),(6)) v(z) on v.z>u.y;
+select * from (values (3),(4)) u(y) join (values (5),(6)) v(z) on v.z>u.y,(values (1),(2)) q(x);
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full.sql b/yql/essentials/tests/sql/suites/pg/select_join_full.sql
new file mode 100644
index 0000000000..2518366b32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u full join (select 1 as y) v on u.x=v.y;
+select * from (select 1 as x ) u full join (select 2 as y) v on u.x=v.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full3.sql b/yql/essentials/tests/sql/suites/pg/select_join_full3.sql
new file mode 100644
index 0000000000..c00fc629a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full3.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u full join (select 1 as y) v on u.x=v.y full join (select 1 as z) r on v.y=r.z;
+select * from (select 1 as x ) u full join (select 2 as y) v on u.x=v.y full join (select 3 as z) r on v.y=r.z;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_full_const.sql
new file mode 100644
index 0000000000..605eb5c89c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full_const.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+full join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+full join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+full join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+full join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full_equi.sql b/yql/essentials/tests/sql/suites/pg/select_join_full_equi.sql
new file mode 100644
index 0000000000..6a1302a61b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full_equi.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.v = a.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_const.sql
new file mode 100644
index 0000000000..05f1ca4b14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_const.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_one.sql
new file mode 100644
index 0000000000..f6a40eeb3f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full_equi_and_one.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and a.x=1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.u=1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_full_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_full_one.sql
new file mode 100644
index 0000000000..b5cdcb6967
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_full_one.sql
@@ -0,0 +1,16 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on a.x = 0;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on b.u = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+full join (values (1,2),(2,5)) as b(u,v)
+on b.u = 0;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner.sql
new file mode 100644
index 0000000000..ea9298b1e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x) q join (select 1 as y) u on q.x=u.y;
+select * from (select 1 as x) q join (select 2 as y) u on q.x=u.y; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner3.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner3.sql
new file mode 100644
index 0000000000..eedd9b9e0b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner3.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select * from (select 1 as x) q join (select 1 as y) u on q.x=u.y join (select 1 as z) v on v.z = q.x;
+select * from (select 1 as x) q join (select 2 as y) u on q.x=u.y join (select 3 as z) v on v.z = q.x;
+select * from (select 1 as x) q join (select 1 as y) u on q.x=u.y join (select 1 as z) v on v.z = u.y;
+select * from (select 1 as x) q join (select 2 as y) u on q.x=u.y join (select 3 as z) v on v.z = u.y; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner_const.sql
new file mode 100644
index 0000000000..1180d6ef64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner_const.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+inner join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+inner join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+inner join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+inner join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner_equi.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi.sql
new file mode 100644
index 0000000000..ed348717e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.v = a.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_const.sql
new file mode 100644
index 0000000000..a0fd63ba86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_const.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_one.sql
new file mode 100644
index 0000000000..3086f40cd4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner_equi_and_one.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and a.x=1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.u=1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_inner_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_inner_one.sql
new file mode 100644
index 0000000000..803ce9ccaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_inner_one.sql
@@ -0,0 +1,16 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on a.x = 0;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on b.u = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+inner join (values (1,2),(2,5)) as b(u,v)
+on b.u = 0;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left.sql b/yql/essentials/tests/sql/suites/pg/select_join_left.sql
new file mode 100644
index 0000000000..4190c29e5e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u left join (select 1 as y) v on u.x=v.y;
+select * from (select 1 as x ) u left join (select 2 as y) v on u.x=v.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left3.sql b/yql/essentials/tests/sql/suites/pg/select_join_left3.sql
new file mode 100644
index 0000000000..4a49f90169
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left3.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u left join (select 1 as y) v on u.x=v.y left join (select 1 as z) r on v.y=r.z;
+select * from (select 1 as x ) u left join (select 2 as y) v on u.x=v.y left join (select 3 as z) r on v.y=r.z;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_left_const.sql
new file mode 100644
index 0000000000..225541d3a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left_const.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+left join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+left join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+left join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+left join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left_equi.sql b/yql/essentials/tests/sql/suites/pg/select_join_left_equi.sql
new file mode 100644
index 0000000000..1572be7b53
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left_equi.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.v = a.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_const.sql
new file mode 100644
index 0000000000..34d2ce1fe5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_const.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_one.sql
new file mode 100644
index 0000000000..4e44ae8edc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left_equi_and_one.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and a.x=1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.u=1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_left_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_left_one.sql
new file mode 100644
index 0000000000..d10f91976e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_left_one.sql
@@ -0,0 +1,16 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on a.x = 0;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on b.u = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+left join (values (1,2),(2,5)) as b(u,v)
+on b.u = 0;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_join_qstar.sql
new file mode 100644
index 0000000000..2935c425a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_qstar.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select * from (select 1 as x) a inner join (select 1 as y) b on a.x=b.y;
+select x from (select 1 as x) a inner join (select 1 as y) b on a.x=b.y;
+select a.x from (select 1 as x) a inner join (select 1 as y) b on a.x=b.y;
+select a.* from (select 1 as x) a inner join (select 1 as y) b on a.x=b.y; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right.sql b/yql/essentials/tests/sql/suites/pg/select_join_right.sql
new file mode 100644
index 0000000000..aa9ebf27b4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u right join (select 1 as y) v on u.x=v.y;
+select * from (select 1 as x ) u right join (select 2 as y) v on u.x=v.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right3.sql b/yql/essentials/tests/sql/suites/pg/select_join_right3.sql
new file mode 100644
index 0000000000..0e54a61e12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right3.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x ) u right join (select 1 as y) v on u.x=v.y right join (select 1 as z) r on v.y=r.z;
+select * from (select 1 as x ) u right join (select 2 as y) v on u.x=v.y right join (select 3 as z) r on v.y=r.z;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_right_const.sql
new file mode 100644
index 0000000000..7e77f16485
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right_const.sql
@@ -0,0 +1,32 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+right join (values (1,2),(2,5)) as b(u,v)
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+right join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+right join (values (1,2),(2,5)) as b(u,v)
+on 1+1=3;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
+
+select * from (select * from (values (1,2),(3,4)) as a(x,y) limit 0) a
+right join (select * from (values (1,2),(2,5)) as b(u,v) limit 0) b
+on 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right_equi.sql b/yql/essentials/tests/sql/suites/pg/select_join_right_equi.sql
new file mode 100644
index 0000000000..027ffc83d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right_equi.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.v = a.y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_const.sql b/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_const.sql
new file mode 100644
index 0000000000..0c9e283c0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_const.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=2;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and 1+1=3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_one.sql
new file mode 100644
index 0000000000..a3cb350b25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right_equi_and_one.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and a.x=1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = b.u and b.u=1; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_join_right_one.sql b/yql/essentials/tests/sql/suites/pg/select_join_right_one.sql
new file mode 100644
index 0000000000..073b28e334
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_join_right_one.sql
@@ -0,0 +1,16 @@
+--!syntax_pg
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on a.x = 0;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on b.u = 1;
+
+select * from (values (1,2),(3,4)) as a(x,y)
+right join (values (1,2),(2,5)) as b(u,v)
+on b.u = 0;
diff --git a/yql/essentials/tests/sql/suites/pg/select_limit.sql b/yql/essentials/tests/sql/suites/pg/select_limit.sql
new file mode 100644
index 0000000000..a8c47d63f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_limit.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input" limit 2 offset 1 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_literals.sql b/yql/essentials/tests/sql/suites/pg/select_literals.sql
new file mode 100644
index 0000000000..2f4c83f234
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_literals.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 as y, 2 as x;
diff --git a/yql/essentials/tests/sql/suites/pg/select_plusminus.sql b/yql/essentials/tests/sql/suites/pg/select_plusminus.sql
new file mode 100644
index 0000000000..ff2ec584f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_plusminus.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1+2-3;
diff --git a/yql/essentials/tests/sql/suites/pg/select_plusminus_unary.sql b/yql/essentials/tests/sql/suites/pg/select_plusminus_unary.sql
new file mode 100644
index 0000000000..7d47ef8f6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_plusminus_unary.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x,+x from (select 1 as x) u; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_expr.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_expr.sql
new file mode 100644
index 0000000000..b00a8b3d01
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_expr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (1)
+x+1
+from (values (3),(2),(1),(2)) a(x)
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_qstar.sql
new file mode 100644
index 0000000000..6bf58bbd74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_qstar.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (1)
+a.*
+from (values (3),(2),(1),(2)) a(x)
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_star.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_star.sql
new file mode 100644
index 0000000000..231107eac9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_distinct_on_star.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select distinct on (1)
+*
+from (values (3),(2),(1),(2)) a(x)
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_col.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_col.sql
new file mode 100644
index 0000000000..b12248d87a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_col.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+x
+from (values (3),(2),(1),(2)) a(x)
+group by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_expr.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_expr.sql
new file mode 100644
index 0000000000..4f04831613
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_expr.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+x+1
+from (values (3),(2),(1),(2)) a(x)
+group by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qcol.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qcol.sql
new file mode 100644
index 0000000000..1834610a78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qcol.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+a.x
+from (values (3),(2),(1),(2)) a(x)
+group by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qstar.sql
new file mode 100644
index 0000000000..63dbd0f527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_qstar.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+a.*
+from (values (3),(2),(1),(2)) a(x)
+group by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_star.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_star.sql
new file mode 100644
index 0000000000..f1b7102844
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_group_by_star.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+*
+from (values (3),(2),(1),(2)) a(x)
+group by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_expr.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_expr.sql
new file mode 100644
index 0000000000..479d3dc3f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_expr.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+x+1
+from (values (3),(2),(1),(2)) a(x)
+order by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_qstar.sql
new file mode 100644
index 0000000000..7302876326
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_qstar.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+a.*
+from (values (3),(2),(1),(2)) a(x)
+order by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_star.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_star.sql
new file mode 100644
index 0000000000..51e61c1c9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_star.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+*
+from (values (3),(2),(1),(2)) a(x)
+order by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_union_all_expr.sql b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_union_all_expr.sql
new file mode 100644
index 0000000000..364214823f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_proj_ref_order_by_union_all_expr.sql
@@ -0,0 +1,10 @@
+--!syntax_pg
+select
+x+1
+from (values (3),(2),(1),(2)) a(x)
+union all
+select
+x-1
+from (values (30),(20),(10),(20)) a(x)
+order by 1
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_qstarref1.sql b/yql/essentials/tests/sql/suites/pg/select_qstarref1.sql
new file mode 100644
index 0000000000..71a0b26b95
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_qstarref1.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a.*,1,value as foo from plato."Input" as a;
diff --git a/yql/essentials/tests/sql/suites/pg/select_qstarref2.sql b/yql/essentials/tests/sql/suites/pg/select_qstarref2.sql
new file mode 100644
index 0000000000..be8829bd85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_qstarref2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a.*,b.* from plato."Input" as a,plato."Input2" as b;
diff --git a/yql/essentials/tests/sql/suites/pg/select_sort_project_expr.sql b/yql/essentials/tests/sql/suites/pg/select_sort_project_expr.sql
new file mode 100644
index 0000000000..3bd163fc5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_sort_project_expr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x as x from (values (1),(2)) u(x) order by -x
diff --git a/yql/essentials/tests/sql/suites/pg/select_sort_project_new.sql b/yql/essentials/tests/sql/suites/pg/select_sort_project_new.sql
new file mode 100644
index 0000000000..3b2421e0ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_sort_project_new.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x as y from (values (1),(2)) u(x) order by y
diff --git a/yql/essentials/tests/sql/suites/pg/select_sort_project_same.sql b/yql/essentials/tests/sql/suites/pg/select_sort_project_same.sql
new file mode 100644
index 0000000000..1851b1cd2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_sort_project_same.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x as x from (values (1),(2)) u(x) order by x
diff --git a/yql/essentials/tests/sql/suites/pg/select_sort_project_same_asc.sql b/yql/essentials/tests/sql/suites/pg/select_sort_project_same_asc.sql
new file mode 100644
index 0000000000..5a3f3b19db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_sort_project_same_asc.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x as x from (values (1),(2)) u(x) order by x asc
diff --git a/yql/essentials/tests/sql/suites/pg/select_sort_project_same_desc.sql b/yql/essentials/tests/sql/suites/pg/select_sort_project_same_desc.sql
new file mode 100644
index 0000000000..ca33d06b5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_sort_project_same_desc.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select -x as x from (values (1),(2)) u(x) order by x desc
diff --git a/yql/essentials/tests/sql/suites/pg/select_starref1.sql b/yql/essentials/tests/sql/suites/pg/select_starref1.sql
new file mode 100644
index 0000000000..cab5016734
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_starref1.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/select_starref2.sql b/yql/essentials/tests/sql/suites/pg/select_starref2.sql
new file mode 100644
index 0000000000..7d4e1b9ec6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_starref2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input", plato."Input2";
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery.sql b/yql/essentials/tests/sql/suites/pg/select_subquery.sql
new file mode 100644
index 0000000000..f8f6899b72
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select value,key from plato."Input") a
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery2.sql b/yql/essentials/tests/sql/suites/pg/select_subquery2.sql
new file mode 100644
index 0000000000..ba11590f6c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select * from plato."Input") a, (select * from plato."Input2") b;
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery2_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_subquery2_qstar.sql
new file mode 100644
index 0000000000..7d5a5e46e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery2_qstar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select b.*,a.* from (select * from plato."Input") a, (select * from plato."Input2") b;
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery_scalar.sql b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar.sql
new file mode 100644
index 0000000000..b097f6cbf1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select 1 as y, 2 as x) a
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2.sql b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2.sql
new file mode 100644
index 0000000000..2fdbeb6f71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select 1 as y) a, (select 2 as x) b
diff --git a/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2_qstar.sql b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2_qstar.sql
new file mode 100644
index 0000000000..850814d15b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_subquery_scalar2_qstar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select b.*,a.* from (select 1 as y) a, (select 2 as x) b
diff --git a/yql/essentials/tests/sql/suites/pg/select_substring.sql b/yql/essentials/tests/sql/suites/pg/select_substring.sql
new file mode 100644
index 0000000000..98197d1ea6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_substring.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select substring('привет',3,3) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_table1.sql b/yql/essentials/tests/sql/suites/pg/select_table1.sql
new file mode 100644
index 0000000000..ef66a44482
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_table1.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/select_table2.sql b/yql/essentials/tests/sql/suites/pg/select_table2.sql
new file mode 100644
index 0000000000..d430b624f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_table2.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 from plato."Input", plato."Input2";
diff --git a/yql/essentials/tests/sql/suites/pg/select_union.sql b/yql/essentials/tests/sql/suites/pg/select_union.sql
new file mode 100644
index 0000000000..5cb2640b4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_union.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select * from (values (1),(1),(1)) a(x)
+union
+select * from (values (1),(1)) a(x);
+
+select * from (values (1),(1),(1)) a(x)
+union
+select * from (values (2)) a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_unionall_scalar.sql b/yql/essentials/tests/sql/suites/pg/select_unionall_scalar.sql
new file mode 100644
index 0000000000..a7f95a1e48
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_unionall_scalar.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select * from (select 1 as x, 3 as y) u
+union all
+select * from (select null::int4 as y, 2 as x) v
+union all
+select * from (select 4 as y, null::int4 as x) v
diff --git a/yql/essentials/tests/sql/suites/pg/select_unionall_self.sql b/yql/essentials/tests/sql/suites/pg/select_unionall_self.sql
new file mode 100644
index 0000000000..f0f8968796
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_unionall_self.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select * from plato."Input"
+union all
+select * from plato."Input"
+union all
+select * from plato."Input";
diff --git a/yql/essentials/tests/sql/suites/pg/select_where.sql b/yql/essentials/tests/sql/suites/pg/select_where.sql
new file mode 100644
index 0000000000..c7db84240d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_where.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from plato."Input" where key = '800' or not (key < '999')
diff --git a/yql/essentials/tests/sql/suites/pg/select_where_scalar.sql b/yql/essentials/tests/sql/suites/pg/select_where_scalar.sql
new file mode 100644
index 0000000000..3fbc7545b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_where_scalar.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 where 2=null::int4 and true or false
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_column_order_by.sql b/yql/essentials/tests/sql/suites/pg/select_win_column_order_by.sql
new file mode 100644
index 0000000000..f31997f49b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_column_order_by.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select x,rank() over (order by y) rnk from (select 1 x,2 y) a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_column_partition_by.sql b/yql/essentials/tests/sql/suites/pg/select_win_column_partition_by.sql
new file mode 100644
index 0000000000..761ed9b225
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_column_partition_by.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select x,rank() over (partition by y) rnk from (select 1 x,2 y) a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_count.sql b/yql/essentials/tests/sql/suites/pg/select_win_count.sql
new file mode 100644
index 0000000000..ae8c9cce1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_count.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,count(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,count(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_count_all.sql b/yql/essentials/tests/sql/suites/pg/select_win_count_all.sql
new file mode 100644
index 0000000000..63296342ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_count_all.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,count(*) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,count(*) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_cume_dist.sql b/yql/essentials/tests/sql/suites/pg/select_win_cume_dist.sql
new file mode 100644
index 0000000000..315f428496
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_cume_dist.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+SELECT cume_dist() over w FROM (VALUES (4),(5),(5),(6)) as a(x)
+window w as (ORDER BY x ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_expr_agg.sql b/yql/essentials/tests/sql/suites/pg/select_win_expr_agg.sql
new file mode 100644
index 0000000000..825d2ced08
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_expr_agg.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select sum(x+1 + sum(z)) over w as l from (
+ values (1,2,3),(1,5,3)) a(x,y,z)
+group by x+1,y
+window w as (
+)
+order by l
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_expr_agg_order.sql b/yql/essentials/tests/sql/suites/pg/select_win_expr_agg_order.sql
new file mode 100644
index 0000000000..cacec89c0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_expr_agg_order.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select sum(x+1 + sum(z)) over w as l from (
+ values (1,2,3),(1,5,3)) a(x,y,z)
+group by x+1,y
+window w as (
+ order by x+1 + sum(z)
+)
+order by l
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_expr_lead.sql b/yql/essentials/tests/sql/suites/pg/select_win_expr_lead.sql
new file mode 100644
index 0000000000..09708f56ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_expr_lead.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select lead(x+1 + sum(z)) over w as l from (
+ values (1,2,3),(1,5,3)) a(x,y,z)
+group by x+1,y
+window w as (
+)
+order by l
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_expr_order.sql b/yql/essentials/tests/sql/suites/pg/select_win_expr_order.sql
new file mode 100644
index 0000000000..8dbf711b67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_expr_order.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select row_number() over w as l from (
+ values (1,2,3),(1,5,3)) a(x,y,z)
+group by x+1,y
+window w as (
+ order by x+1 + sum(z)
+)
+order by l
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_expr_partition.sql b/yql/essentials/tests/sql/suites/pg/select_win_expr_partition.sql
new file mode 100644
index 0000000000..47288c6cd4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_expr_partition.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select row_number() over w as l from (
+ values (1,2,3),(1,5,3)) a(x,y,z)
+group by x+1,y
+window w as (
+ partition by x+1 + sum(z)
+)
+order by l
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_first_last_value.sql b/yql/essentials/tests/sql/suites/pg/select_win_first_last_value.sql
new file mode 100644
index 0000000000..392517a0c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_first_last_value.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x,first_value(x) over w,last_value(x) over w
+from (values (1),(2),(2),(3)) as a(x)
+window w as (order by x)
+order by x \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_frame.sql b/yql/essentials/tests/sql/suites/pg/select_win_frame.sql
new file mode 100644
index 0000000000..beb43d6d8a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_frame.sql
@@ -0,0 +1,18 @@
+--!syntax_pg
+select
+x,
+sum(x) over (order by x rows between unbounded preceding and 1 preceding) as upp,
+sum(x) over (order by x rows between unbounded preceding and current row) as upc,
+sum(x) over (order by x rows between unbounded preceding and 1 following) as upf,
+sum(x) over (order by x rows between unbounded preceding and unbounded following) as upuf,
+sum(x) over (order by x rows between 2 preceding and 1 preceding) as pp,
+sum(x) over (order by x rows between 2 preceding and current row) as pc,
+sum(x) over (order by x rows between 2 preceding and 1 following) as pf,
+sum(x) over (order by x rows between 2 preceding and unbounded following) as puf,
+sum(x) over (order by x rows between current row and current row) as cc,
+sum(x) over (order by x rows between current row and 1 following) as cf,
+sum(x) over (order by x rows between current row and unbounded following) as cuf,
+sum(x) over (order by x rows between 1 following and 2 following) as ff,
+sum(x) over (order by x rows between 1 following and unbounded following) as fuf
+from (values (1),(2),(3),(4),(5),(6),(7)) a(x)
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_lead_lag.sql b/yql/essentials/tests/sql/suites/pg/select_win_lead_lag.sql
new file mode 100644
index 0000000000..1938a1bc6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_lead_lag.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,lead(x) over w,lag(x) over w
+from (values (3),(4),(5)) as a(x)
+window w as ()
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_max.sql b/yql/essentials/tests/sql/suites/pg/select_win_max.sql
new file mode 100644
index 0000000000..64bb771e85
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_max.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,max(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,max(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_max_null.sql b/yql/essentials/tests/sql/suites/pg/select_win_max_null.sql
new file mode 100644
index 0000000000..69ffb29ab1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_max_null.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,max(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,max(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_min.sql b/yql/essentials/tests/sql/suites/pg/select_win_min.sql
new file mode 100644
index 0000000000..e9e2dca480
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_min.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,min(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,min(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_min_null.sql b/yql/essentials/tests/sql/suites/pg/select_win_min_null.sql
new file mode 100644
index 0000000000..0fbd5f1691
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_min_null.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,min(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,min(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_nth_value.sql b/yql/essentials/tests/sql/suites/pg/select_win_nth_value.sql
new file mode 100644
index 0000000000..209a23405d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_nth_value.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+select
+r,x,
+nth_value(x,1) over w as nr1,
+nth_value(x,2) over w as nr2,
+nth_value(x,3) over w as nr3,
+nth_value(x,4) over w as nr4
+from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_ntile.sql b/yql/essentials/tests/sql/suites/pg/select_win_ntile.sql
new file mode 100644
index 0000000000..42f69b3e57
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_ntile.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select
+r,x,
+ntile(3) over w
+from (select * from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)) as z
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_partition_sort.sql b/yql/essentials/tests/sql/suites/pg/select_win_partition_sort.sql
new file mode 100644
index 0000000000..ba23d74177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_partition_sort.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x,y,lead(y) over w,lag(y) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as (partition by a.x order by a.y desc)
+order by x,y;
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_percent_rank.sql b/yql/essentials/tests/sql/suites/pg/select_win_percent_rank.sql
new file mode 100644
index 0000000000..e0ccd1c450
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_percent_rank.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select
+r,x,
+percent_rank() over w
+from (select * from (values (1,null),(2,3),(3,4),(4,4)) as a(r,x)) as z
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_rank.sql b/yql/essentials/tests/sql/suites/pg/select_win_rank.sql
new file mode 100644
index 0000000000..4734a855ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_rank.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,rank() over w,dense_rank() over w
+from (values (1),(2),(2),(3)) as a(x)
+window w as ()
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_rank_order.sql b/yql/essentials/tests/sql/suites/pg/select_win_rank_order.sql
new file mode 100644
index 0000000000..214a7e8496
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_rank_order.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,rank() over w,dense_rank() over w
+from (values (1),(2),(2),(3)) as a(x)
+window w as (order by x)
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_row_number.sql b/yql/essentials/tests/sql/suites/pg/select_win_row_number.sql
new file mode 100644
index 0000000000..deb68ea9d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_row_number.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,row_number() over w r1,row_number() over () r2
+from (values (3),(5)) as a(x)
+window w as ()
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_sum.sql b/yql/essentials/tests/sql/suites/pg/select_win_sum.sql
new file mode 100644
index 0000000000..89e8656a09
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_sum.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,sum(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,sum(x) over w
+from (values (1,2),(1,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_win_sum_null.sql b/yql/essentials/tests/sql/suites/pg/select_win_sum_null.sql
new file mode 100644
index 0000000000..f0948aed20
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_win_sum_null.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select x,y,sum(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as ();
+
+select x,y,sum(x) over w
+from (values (1,2),(null::int4,3),(2,4),(2,5)) as a(x,y)
+window w as (order by y);
diff --git a/yql/essentials/tests/sql/suites/pg/select_yql_type.cfg b/yql/essentials/tests/sql/suites/pg/select_yql_type.cfg
new file mode 100644
index 0000000000..0ca1ef5bf1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_yql_type.cfg
@@ -0,0 +1 @@
+in Input input_name.txt
diff --git a/yql/essentials/tests/sql/suites/pg/select_yql_type.sql b/yql/essentials/tests/sql/suites/pg/select_yql_type.sql
new file mode 100644
index 0000000000..18574a079b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/select_yql_type.sql
@@ -0,0 +1,15 @@
+--!syntax_pg
+SELECT
+ key, index, index + 1
+FROM plato."Input"
+ORDER BY index;
+
+SELECT
+ *
+FROM plato."Input"
+ORDER BY index;
+
+SELECT
+ t.*
+FROM plato."Input" as t
+ORDER BY index;
diff --git a/yql/essentials/tests/sql/suites/pg/set_of_as_records.cfg b/yql/essentials/tests/sql/suites/pg/set_of_as_records.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/set_of_as_records.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/pg/set_of_as_records.sql b/yql/essentials/tests/sql/suites/pg/set_of_as_records.sql
new file mode 100644
index 0000000000..f205c5f947
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/set_of_as_records.sql
@@ -0,0 +1 @@
+select Pg::json_each(pgjson('{"a":"foo", "b":"bar"}')) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/set_of_as_structs.sql b/yql/essentials/tests/sql/suites/pg/set_of_as_structs.sql
new file mode 100644
index 0000000000..06242eeaa9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/set_of_as_structs.sql
@@ -0,0 +1,2 @@
+SELECT * FROM
+ AS_TABLE(PgRangeCall("json_each", pgjson('{"a":"foo", "b":"bar"}'))); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/set_over_unhashable.sql b/yql/essentials/tests/sql/suites/pg/set_over_unhashable.sql
new file mode 100644
index 0000000000..e7eb38835c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/set_over_unhashable.sql
@@ -0,0 +1 @@
+select DictKeys(ToSet([<|a:pgbit('10')|>,<|a:pgbit('01')|>,<|a:pgbit('01')|>]))
diff --git a/yql/essentials/tests/sql/suites/pg/simple_ops.sql b/yql/essentials/tests/sql/suites/pg/simple_ops.sql
new file mode 100644
index 0000000000..9c063ec257
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/simple_ops.sql
@@ -0,0 +1,18 @@
+select 1p + 2p, +(1p), -(1p), 1p - 2p, 3p * 4p, 7p / 4p, 7p % 4p, "a"p || "b"p,
+ pgdate('2001-09-28')+7,
+ pgdate('2001-09-28') + pginterval('1 hour'),
+ pgdate('2001-09-28') + pgtime('03:00'),
+ pginterval('1 day') + pginterval('1 hour'),
+ pgtimestamp('2001-09-28 01:00') + pginterval('23 hours'),
+ pgtime('01:00') + pginterval('3 hours'),
+ -pginterval('23 hours'),
+ pgdate('2001-10-01') - pgdate('2001-09-28'),
+ pgdate('2001-10-01') - 7,
+ pgdate('2001-09-28') - pginterval('1 hour'),
+ pgtime('05:00') - pgtime('03:00'),
+ pgtime('05:00') - pginterval('2 hours'),
+ pgtimestamp('2001-09-28 23:00') - pginterval('23 hours'),
+ pginterval('1 day') - pginterval('1 hour'),
+ pgtimestamp('2001-09-29 03:00') - pgtimestamp('2001-07-27 12:00'),
+ pginterval('1 second') * 900.0,
+ pginterval('1 hour') / 1.5; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/single_input_filter_over_join.sql b/yql/essentials/tests/sql/suites/pg/single_input_filter_over_join.sql
new file mode 100644
index 0000000000..34d4c134a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/single_input_filter_over_join.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (select 1 as x) as a, (select 1 as y) as b, (select 1 as z) as c where a.x = 1;
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/sort_nulls_priority.sql b/yql/essentials/tests/sql/suites/pg/sort_nulls_priority.sql
new file mode 100644
index 0000000000..f6b31a0cb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sort_nulls_priority.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+SELECT
+*
+FROM
+(VALUES (null),(3),(1),(2)) as a(x)
+ORDER BY x nulls last;
+
+SELECT
+*
+FROM
+(VALUES (null),(3),(1),(2)) as a(x)
+ORDER BY x nulls first;
+
diff --git a/yql/essentials/tests/sql/suites/pg/sort_nulls_priority_window.sql b/yql/essentials/tests/sql/suites/pg/sort_nulls_priority_window.sql
new file mode 100644
index 0000000000..7659657828
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sort_nulls_priority_window.sql
@@ -0,0 +1,13 @@
+--!syntax_pg
+SELECT
+x,array_agg(x) over (order by x nulls first)
+FROM
+(VALUES (null),(3),(1),(2)) a(x)
+ORDER BY x nulls first;
+
+SELECT
+x,array_agg(x) over (order by x nulls last)
+FROM
+(VALUES (null),(3),(1),(2)) a(x)
+ORDER BY x nulls last;
+
diff --git a/yql/essentials/tests/sql/suites/pg/str_lookup_pg.sql b/yql/essentials/tests/sql/suites/pg/str_lookup_pg.sql
new file mode 100644
index 0000000000..750cd6281f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/str_lookup_pg.sql
@@ -0,0 +1,22 @@
+pragma warning("disable", "4510");
+
+select StartsWith('test1'u, 'tes'p),
+ EndsWith('test1'u, 't1'p),
+ YQL::StringContains('test1'u, 'est'p);
+
+select StartsWith('test1'u, 'tes'pb),
+ EndsWith('test1'u, 't1'pb),
+ YQL::StringContains('test1'u, 'est'pb);
+
+select StartsWith('test1', 'tes'p),
+ EndsWith('test1', 't1'p),
+ YQL::StringContains('test1', 'est'p);
+
+select StartsWith('test1', 'tes'pv),
+ EndsWith('test1', 't1'pv),
+ YQL::StringContains('test1', 'est'pv);
+
+select StartsWith('test1'u, 'x'pv),
+ EndsWith(Nothing(Utf8?), 'x'pv),
+ YQL::StringContains('test1'u, PgCast(null, PgVarChar));
+
diff --git a/yql/essentials/tests/sql/suites/pg/strings_to_pg.sql b/yql/essentials/tests/sql/suites/pg/strings_to_pg.sql
new file mode 100644
index 0000000000..ac2eccfa60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/strings_to_pg.sql
@@ -0,0 +1,11 @@
+select ToPg("foo"),ToPg(Utf8("bar")),ToPg(Yson("<a=1>[]")),ToPg(Json('{"a":1}')),ToPg(JsonDocument("[1,2,3]")),
+ ToPg(Uuid('12345678-9abc-def0-1234-567890123456')),
+ ToPg(TzDate("2001-02-03,Europe/Moscow")),
+ ToPg(TzDatetime("2001-02-03T04:05:06,Europe/Moscow")),
+ ToPg(TzTimestamp("2001-02-03T04:05:06.789012,Europe/Moscow")),
+ ToPg(TzDate32("1901-02-03,Europe/Moscow")),
+ ToPg(TzDatetime64("1901-02-03T04:05:06,Europe/Moscow")),
+ ToPg(TzTimestamp64("1901-02-03T04:05:06.789012,Europe/Moscow"));
+
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/struct_tuple_cast.sql b/yql/essentials/tests/sql/suites/pg/struct_tuple_cast.sql
new file mode 100644
index 0000000000..abc59e540c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/struct_tuple_cast.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+
+$s = <|foo:1p|>;
+$t = (1p,);
+
+select cast($s as Struct<a:PgText,b:PgInt4,c:_PgText,foo:PgInt4>);
+select cast($t as Tuple<PgInt4,PgText,_PgText>);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns.sql b/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns.sql
new file mode 100644
index 0000000000..1eb3fc829d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+select x = any (select 1)
+from (values (1,1),(2,5),(3,4)) a(x,y);
+
+select *
+from (values (1,1),(2,5),(3,4)) a(x,y)
+where x = all (select 1);
+
+select 1
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by x in (select 1); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns_corr.sql
new file mode 100644
index 0000000000..481a7775d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_columns_in_test_expr_columns_corr.sql
@@ -0,0 +1,11 @@
+--!syntax_pg
+select x = any (select x)
+from (values (1,1),(2,5),(3,4)) a(x,y);
+
+select *
+from (values (1,1),(2,5),(3,4)) a(x,y)
+where x = all (select x);
+
+select 1
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by x in (select x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_having_all.sql b/yql/essentials/tests/sql/suites/pg/sublink_having_all.sql
new file mode 100644
index 0000000000..6c1de30d5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_having_all.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select 1 from (select 10 as x) a having min(x) > all (values (1),(2));
+select 1 from (select 2 as x) a having min(x) > all (values (1),(2));
+select 1 from (select 1 as x) a having min(x) > all (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_having_any.sql b/yql/essentials/tests/sql/suites/pg/sublink_having_any.sql
new file mode 100644
index 0000000000..363940773b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_having_any.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select 1 from (select 10 as x) a having min(x) > any (values (1),(2));
+select 1 from (select 2 as x) a having min(x) > any (values (1),(2));
+select 1 from (select 1 as x) a having min(x) > any (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_having_exists.sql b/yql/essentials/tests/sql/suites/pg/sublink_having_exists.sql
new file mode 100644
index 0000000000..cea23512c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_having_exists.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select 1 from (select 1 as x) a having exists (select 1,2);
+select 1 from (select 1 as x) a having exists (select 1,2 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_having_expr.sql b/yql/essentials/tests/sql/suites/pg/sublink_having_expr.sql
new file mode 100644
index 0000000000..0cfa288f18
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_having_expr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 from (select 1 as x) a having min(x) = (select 1);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_having_in.sql b/yql/essentials/tests/sql/suites/pg/sublink_having_in.sql
new file mode 100644
index 0000000000..184cac17d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_having_in.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select 1 from (select 10 as x) a having min(x) in (values (1),(2));
+select 1 from (select 2 as x) a having min(x) in (values (1),(2));
+select 1 from (select 1 as x) a having min(x) in (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_order_all_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_order_all_corr.sql
new file mode 100644
index 0000000000..3c0a30649d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_order_all_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,y
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by 2 <> all (select x),y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_order_any_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_order_any_corr.sql
new file mode 100644
index 0000000000..1146b23674
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_order_any_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,y
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by 2 <> any (select x),y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_order_exists_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_order_exists_corr.sql
new file mode 100644
index 0000000000..a3131203dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_order_exists_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,y
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by exists (select * from (values (2)) b(z) where z <> x),y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_order_expr_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_order_expr_corr.sql
new file mode 100644
index 0000000000..d4a5393a40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_order_expr_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select -x as x
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by (select x) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_order_in_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_order_in_corr.sql
new file mode 100644
index 0000000000..edd6898302
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_order_in_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x,y
+from (values (1,1),(2,5),(3,4)) a(x,y)
+order by 2 not in (select x),y \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_all_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_all_corr.sql
new file mode 100644
index 0000000000..eb75d03293
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_all_corr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 = all (select 2 where 1 = x) from (values (1,2),(2,3)) a(x,y); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_any_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_any_corr.sql
new file mode 100644
index 0000000000..ba4e193dd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_any_corr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 = any (select 1 where 1 = x) from (values (1,2),(2,3)) a(x,y); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_array.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_array.sql
new file mode 100644
index 0000000000..f073ab0d1e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_array.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select array(select z from (values (1),(2)) a(z));
+select array(select z from (values (array[1,2]),(array[3,4])) a(z));
+
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_array_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_array_corr.sql
new file mode 100644
index 0000000000..1a98ab394a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_array_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select y,array(select x+u from (values (10),(20)) c(u)) from (values (1,2),(2,3)) a(x,y) order by y;
+select y,array(select array[x+u,x+u+1] from (values (10),(20)) c(u)) from (values (1,2),(2,3)) a(x,y) order by y;
+
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_exists_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_exists_corr.sql
new file mode 100644
index 0000000000..8135221621
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_exists_corr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select exists (select 1 where 1 = x) from (values (1,2),(2,3)) a(x,y); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_expr_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_expr_corr.sql
new file mode 100644
index 0000000000..73b286eeeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_expr_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select (select x) as z from (values (1,2),(2,3)) a(x,y) order by z;
+select (select x limit 0) as z from (values (1,2),(2,3)) a(x,y) order by z;
+
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_in_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_in_corr.sql
new file mode 100644
index 0000000000..fd042d4b79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_in_corr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 in (select 1 where 1 = x) from (values (1,2),(2,3)) a(x,y); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_projection_uncorrelated.sql b/yql/essentials/tests/sql/suites/pg/sublink_projection_uncorrelated.sql
new file mode 100644
index 0000000000..22d3fc00b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_projection_uncorrelated.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 as one, (select 2) as two;
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_all.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_all.sql
new file mode 100644
index 0000000000..c810321284
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_all.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (select 10 as x) a where x > all (values (1),(2));
+select * from (select 2 as x) a where x > all (values (1),(2));
+select * from (select 1 as x) a where x > all (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_all_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_all_corr.sql
new file mode 100644
index 0000000000..cc7c97a396
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_all_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (values (1,2),(2,3)) a(x,y) where 1 = all (select 1 where x = 1);
+select * from (values (1,2),(2,3)) a(x,y) where 1 = all (select 1 where x = 10);
+select * from (values (1,2),(2,3)) a(x,y) where 1 = all (select 2 where x = 1);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_any.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_any.sql
new file mode 100644
index 0000000000..712eda94bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_any.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (select 10 as x) a where x > any (values (1),(2));
+select * from (select 2 as x) a where x > any (values (1),(2));
+select * from (select 1 as x) a where x > any (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_any_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_any_corr.sql
new file mode 100644
index 0000000000..806901aaab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_any_corr.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (values (1,2),(2,3)) a(x,y) where 1 = any (select 1 where x = 1);
+select * from (values (1,2),(2,3)) a(x,y) where 1 = any (select 1 where x = 10);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_exists.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_exists.sql
new file mode 100644
index 0000000000..14ad41b684
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_exists.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (select 1 as x) a where exists (select 1,2);
+select * from (select 1 as x) a where exists (select 1,2 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_exists_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_exists_corr.sql
new file mode 100644
index 0000000000..07089c410a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_exists_corr.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (values (1,2),(2,3)) a(x,y) where exists (select 1 where x=1);
+select * from (values (1,2),(2,3)) a(x,y) where exists (select 1 where x=10);
+
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_expr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_expr.sql
new file mode 100644
index 0000000000..fc3872a343
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_expr.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select 1 as x) a where x = (select 1);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_expr_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_expr_corr.sql
new file mode 100644
index 0000000000..8b30bc0b40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_expr_corr.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (values (1,2),(2,3)) a(x,y) where 1 = (select 1 where x = 10);
+select * from (values (1,2),(2,3)) a(x,y) where 1 = (select 1 where x = 2);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_in.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_in.sql
new file mode 100644
index 0000000000..6fdb415b77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_in.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from (select 10 as x) a where x in (values (1),(2));
+select * from (select 2 as x) a where x in (values (1),(2));
+select * from (select 1 as x) a where x in (select 1 limit 0);
diff --git a/yql/essentials/tests/sql/suites/pg/sublink_where_in_corr.sql b/yql/essentials/tests/sql/suites/pg/sublink_where_in_corr.sql
new file mode 100644
index 0000000000..70cb650ed2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/sublink_where_in_corr.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select * from (values (1,2),(2,3)) a(x,y) where 1 in (select 1 where x = 1);
+select * from (values (1,2),(2,3)) a(x,y) where 1 in (select 1 where x = 10);
diff --git a/yql/essentials/tests/sql/suites/pg/table_func.sql b/yql/essentials/tests/sql/suites/pg/table_func.sql
new file mode 100644
index 0000000000..3d481c9cf8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/table_func.sql
@@ -0,0 +1,15 @@
+--!syntax_pg
+select count(*) from plato.concat('Input','Input');
+select count(*) from plato.concat_view('Input','raw','Input','raw');
+select count(*) from plato.range('');
+select count(*) from plato.range('','A');
+select count(*) from plato.range('','A','Z');
+select count(*) from plato.range('','A','Z','');
+select count(*) from plato.range('','A','Z','','raw');
+select count(*) from plato.regexp('','Inpu.?');
+select count(*) from plato.regexp('','Inpu.?','');
+select count(*) from plato.regexp('','Inpu.?','','raw');
+select count(*) from plato.like('','Inpu%');
+select count(*) from plato.like('','Inpu%','');
+select count(*) from plato.like('','Inpu%','','raw');
+
diff --git a/yql/essentials/tests/sql/suites/pg/type_aliases.sql b/yql/essentials/tests/sql/suites/pg/type_aliases.sql
new file mode 100644
index 0000000000..70bd0331a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/type_aliases.sql
@@ -0,0 +1,3 @@
+select
+ pgboolean("true"),pginteger("123"),pgsmallint("123"),pgbigint("123"),pgreal("0.5"),
+ pgdouble_precision("0.5"),pgcharacter("foo"),pgtime_without_time_zone("12:00"),pgcharacter_varying("bar");
diff --git a/yql/essentials/tests/sql/suites/pg/unknown.sql b/yql/essentials/tests/sql/suites/pg/unknown.sql
new file mode 100644
index 0000000000..c03a21a4fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/unknown.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select ''::unknown, ''::unknown::text
diff --git a/yql/essentials/tests/sql/suites/pg/uuid_from_pg.sql b/yql/essentials/tests/sql/suites/pg/uuid_from_pg.sql
new file mode 100644
index 0000000000..2bf8aeb5f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/uuid_from_pg.sql
@@ -0,0 +1,2 @@
+select
+ FromPg(pguuid('12345678-9abc-def0-1234-567890123456'))
diff --git a/yql/essentials/tests/sql/suites/pg/values.sql b/yql/essentials/tests/sql/suites/pg/values.sql
new file mode 100644
index 0000000000..25758fbfb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/values.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+values (1,2),(2,3);
+values ('a')
diff --git a/yql/essentials/tests/sql/suites/pg/variadic.sql b/yql/essentials/tests/sql/suites/pg/variadic.sql
new file mode 100644
index 0000000000..0136cb6804
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/variadic.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select concat('a',1,null), concat_ws(',','a',1,null)
+
diff --git a/yql/essentials/tests/sql/suites/pg/variadic_array_arg.sql b/yql/essentials/tests/sql/suites/pg/variadic_array_arg.sql
new file mode 100644
index 0000000000..a2a13f8b98
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/variadic_array_arg.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}', 'f4', 'f6')
+
diff --git a/yql/essentials/tests/sql/suites/pg/wide_sort.cfg b/yql/essentials/tests/sql/suites/pg/wide_sort.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/wide_sort.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/pg/wide_sort.sql b/yql/essentials/tests/sql/suites/pg/wide_sort.sql
new file mode 100644
index 0000000000..8d5fcffce2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/wide_sort.sql
@@ -0,0 +1,5 @@
+USE plato;
+SELECT
+ *
+FROM Input
+ORDER BY a,b desc,c desc
diff --git a/yql/essentials/tests/sql/suites/pg/wide_top_sort.cfg b/yql/essentials/tests/sql/suites/pg/wide_top_sort.cfg
new file mode 100644
index 0000000000..72b51dc777
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/wide_top_sort.cfg
@@ -0,0 +1 @@
+in Input input_pg.txt
diff --git a/yql/essentials/tests/sql/suites/pg/wide_top_sort.sql b/yql/essentials/tests/sql/suites/pg/wide_top_sort.sql
new file mode 100644
index 0000000000..0eabce49df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/wide_top_sort.sql
@@ -0,0 +1,5 @@
+USE plato;
+SELECT
+ *
+FROM Input
+ORDER BY a,b desc,c desc LIMIT 3
diff --git a/yql/essentials/tests/sql/suites/pg/with.sql b/yql/essentials/tests/sql/suites/pg/with.sql
new file mode 100644
index 0000000000..f37e69b95e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/with.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+with foo(x) as (
+ select 1
+), bar as (select 2 as y from foo)
+select x,b.y,z,a.y as y2 from foo,bar b,(
+with foo as (select 3 as z)
+select * from foo, bar) a
diff --git a/yql/essentials/tests/sql/suites/pg/with_rec_all.sql b/yql/essentials/tests/sql/suites/pg/with_rec_all.sql
new file mode 100644
index 0000000000..dd657be29a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/with_rec_all.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+WITH RECURSIVE t(n) AS (
+ SELECT 1
+ UNION ALL
+ SELECT n+1 FROM t WHERE n < 5
+)
+SELECT * FROM t
+
diff --git a/yql/essentials/tests/sql/suites/pg/with_rec_all_empty.sql b/yql/essentials/tests/sql/suites/pg/with_rec_all_empty.sql
new file mode 100644
index 0000000000..84deddc383
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/with_rec_all_empty.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+WITH RECURSIVE t(n) AS (
+ SELECT * FROM (SELECT 1 LIMIT 0) a
+ UNION ALL
+ SELECT n+1 FROM t WHERE n < 5
+)
+SELECT * FROM t
+
+
diff --git a/yql/essentials/tests/sql/suites/pg/with_rec_distinct.sql b/yql/essentials/tests/sql/suites/pg/with_rec_distinct.sql
new file mode 100644
index 0000000000..fc2d879ac1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/with_rec_distinct.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+WITH RECURSIVE t(n) AS (
+ SELECT 1
+ UNION
+ SELECT 1 FROM t
+)
+SELECT * FROM t
diff --git a/yql/essentials/tests/sql/suites/pg/with_rec_trivial.sql b/yql/essentials/tests/sql/suites/pg/with_rec_trivial.sql
new file mode 100644
index 0000000000..8d53e48309
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg/with_rec_trivial.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+WITH RECURSIVE t(n) AS (
+ select 1
+)
+SELECT n FROM t;
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/columns.sql b/yql/essentials/tests/sql/suites/pg_catalog/columns.sql
new file mode 100644
index 0000000000..7eebac9502
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/columns.sql
@@ -0,0 +1,14 @@
+--!syntax_pg
+select
+count(*) n,
+min(table_schema) min_s,
+min(table_name) min_t,
+min(column_name) min_c,
+min(udt_name) min_u,
+max(table_schema) max_s,
+max(table_name) max_t,
+max(column_name) max_c,
+max(udt_name) max_u
+from
+information_schema.columns
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/default.cfg b/yql/essentials/tests/sql/suites/pg_catalog/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/default.cfg
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt
new file mode 100644
index 0000000000..6085fdcc90
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt
@@ -0,0 +1,4 @@
+{"key"=1;"subkey"="1";"value"="abc"};
+{"key"=16;"subkey"="2";"value"="ddd"};
+{"key"=25;"subkey"="3";"value"="q"};
+{"key"=100;"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr
new file mode 100644
index 0000000000..7747e0f9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/input_pg.txt.attr
@@ -0,0 +1,5 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[["key";["PgType";"int4";];];["subkey";["PgType";"text";];];["value";["PgType";"text";];];];];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg b/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg
new file mode 100644
index 0000000000..ef7e4f47a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/lambda.cfg
@@ -0,0 +1,2 @@
+in Input input_pg.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql b/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql
new file mode 100644
index 0000000000..f7cf0d582a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/lambda.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select key, key::oid in (select oid from pg_catalog.pg_type) as found from plato."Input" order by key
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql
new file mode 100644
index 0000000000..be077b826b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_aggregate.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select min(aggfnoid) as minaggfnoid, max(aggfnoid) as maxaggfnoid,
+ min(aggkind) as minaggkind, max(aggkind) as maxaggkind,
+ min(aggtranstype) as minaggtranstype, max(aggtranstype) as maxaggtranstype from pg_aggregate;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql
new file mode 100644
index 0000000000..136511b4c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_am_pg_syntax.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select oid from pg_catalog.pg_am order by oid;
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql
new file mode 100644
index 0000000000..7adf651ad1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_auth_members.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select
+roleid,
+member,
+grantor,
+admin_option
+from pg_catalog.pg_auth_members
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql
new file mode 100644
index 0000000000..28f3d66e28
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_class.sql
@@ -0,0 +1,20 @@
+--!syntax_pg
+select
+count(*) n,
+min(oid) min_oid,
+min(relispartition::text) min_isrel,
+min(relkind) min_relkind,
+min(relname) min_relname,
+min(relnamespace) min_relns,
+min(relowner) min_relowner,
+max(oid) max_oid,
+max(relispartition::text) max_isrel,
+max(relkind) max_relkind,
+max(relname) max_relname,
+max(relnamespace) max_relns,
+max(relowner) max_relowner,
+min(relam) min_am,
+max(relam) max_am
+from
+pg_catalog.pg_class;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql
new file mode 100644
index 0000000000..4b4d7c7c9a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_database.sql
@@ -0,0 +1,14 @@
+--!syntax_pg
+select
+datallowconn,
+datdba,
+datistemplate,
+datname,
+encoding,
+oid,
+datacl is null,
+datcollate,
+datctype
+from
+pg_catalog.pg_database
+order by oid
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql
new file mode 100644
index 0000000000..0b812a9db2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_description_pg_syntax.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select count(*) n, min(objoid) min_objid, min(classoid) min_classoid, max(objoid) max_objid, max(classoid) max_classoid, min(description) min_desc, max(description) max_desc from pg_catalog.pg_description;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql
new file mode 100644
index 0000000000..a0eb2599ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_get_userbyid.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select pg_get_userbyid(datdba) from pg_catalog.pg_database where datname = 'postgres'
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql
new file mode 100644
index 0000000000..28e7c1c6ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_inherits.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+inhrelid,
+inhparent
+from
+pg_catalog.pg_inherits \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql
new file mode 100644
index 0000000000..fef787fa84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_language.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select oid, lanname, lanowner from pg_language order by oid
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql
new file mode 100644
index 0000000000..b827421b7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_locks.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select
+transactionid
+from
+pg_catalog.pg_locks
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql
new file mode 100644
index 0000000000..89e355f157
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_namespace_pg_syntax.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select nspname,oid,nspowner from pg_catalog.pg_namespace order by oid;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql
new file mode 100644
index 0000000000..526764c1a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_operator.sql
@@ -0,0 +1,23 @@
+--!syntax_pg
+select
+ min(oid) as min_oid,
+ min(oprcom) as min_oprcom,
+ min(oprleft) as min_oprleft,
+ min(oprname) as min_oprname,
+ min(oprnamespace) as min_oprnamespace,
+ min(oprnegate) as min_oprnegate,
+ min(oprowner) as min_oprowner,
+ min(oprresult) as min_oprresult,
+ min(oprright) as min_oprright,
+
+ max(oid) as max_oid,
+ max(oprcom) as max_oprcom,
+ max(oprleft) as max_oprleft,
+ max(oprname) as max_oprname,
+ max(oprnamespace) as max_oprnamespace,
+ max(oprnegate) as max_oprnegate,
+ max(oprowner) as max_oprowner,
+ max(oprresult) as max_oprresult,
+ max(oprright) as max_oprright
+from pg_operator;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql
new file mode 100644
index 0000000000..1c9cd12590
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_proc.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select min(oid) as minoid, max(oid) as maxoid,
+ min(proname) as minproname, max(proname) as maxproname,
+ min(pronamespace) as minpronamespace, max(pronamespace) as maxpronamespace,
+ min(proowner) as minproowner, max(proowner) as maxproowner,
+ min(prorettype) as minprorettype, max(prorettype) as maxprorettype,
+ min(prolang) as minprolang, max(prolang) as maxprolang,
+ min(prokind) as minprokind, max(prokind) as maxprokind from pg_proc;
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql
new file mode 100644
index 0000000000..b8bb06ab74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_roles.sql
@@ -0,0 +1,17 @@
+--!syntax_pg
+select
+oid,
+rolbypassrls,
+rolcanlogin,
+rolconfig,
+rolconnlimit,
+rolcreatedb,
+rolcreaterole,
+rolinherit,
+rolname,
+rolreplication,
+rolsuper,
+rolvaliduntil
+from pg_catalog.pg_roles
+order by oid
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql
new file mode 100644
index 0000000000..13d8d66c3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select set_config('search_path', 'pg_catalog', false);
+select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type order by oid;
+select set_config('search_path', 'public', false);
+select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_catalog.pg_type order by oid;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql
new file mode 100644
index 0000000000..5df0cac811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_set_config_commit.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select set_config('search_path', 'pg_catalog', false);
+commit;
+select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type;
+rollback;
+select oid, typinput::int4 as typinput, typname, typnamespace, typtype from pg_type;
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql
new file mode 100644
index 0000000000..10315a92ef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_shdescription.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select
+objoid,
+classoid,
+description
+from
+pg_catalog.pg_shdescription
+order by objoid
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql
new file mode 100644
index 0000000000..04ddde2e1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_activity.sql
@@ -0,0 +1,18 @@
+--!syntax_pg
+select
+application_name,
+backend_start,
+backend_type,
+client_addr,
+datname,
+pid,
+query,
+query_start,
+state,
+state_change,
+usename,
+wait_event,
+wait_event_type,
+xact_start
+from
+pg_catalog.pg_stat_activity
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql
new file mode 100644
index 0000000000..f15ce35f12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_database.sql
@@ -0,0 +1,15 @@
+--!syntax_pg
+select
+datid,
+blks_hit,
+blks_read,
+tup_deleted
+tup_fetched,
+tup_inserted,
+tup_returned,
+tup_updated,
+xact_commit,
+xact_rollback
+from pg_catalog.pg_stat_database
+order by datid
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql
new file mode 100644
index 0000000000..2738a852df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_stat_gssapi.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select count(*) n,min(encrypted::text) min_enc,min(gss_authenticated::text) min_auth from (
+select
+encrypted,
+gss_authenticated,
+pid
+from
+pg_catalog.pg_stat_gssapi
+) a
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql
new file mode 100644
index 0000000000..a4ab718d58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_tables.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select
+count(*) n,
+min(schemaname) min_s,
+min(tablename) min_t,
+max(schemaname) max_s,
+max(tablename) max_t
+from pg_catalog.pg_tables;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql
new file mode 100644
index 0000000000..63c8e2f1e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_tablespace.sql
@@ -0,0 +1,7 @@
+--!syntax_pg
+select
+oid,
+spcname
+from
+pg_catalog.pg_tablespace
+order by oid
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql
new file mode 100644
index 0000000000..08348b1a26
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_abbrevs.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+abbrev,
+is_dst
+from
+pg_catalog.pg_timezone_abbrevs
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql
new file mode 100644
index 0000000000..1fc53cfa1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_timezone_names.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+name,
+is_dst
+from
+pg_catalog.pg_timezone_names
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql
new file mode 100644
index 0000000000..26a3c4eeb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_trigger.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select
+tgrelid,
+tgenabled
+from
+pg_catalog.pg_trigger
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql
new file mode 100644
index 0000000000..f02f382772
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_pg.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select oid,
+typinput::int4 as typinput,
+typname,
+typnamespace,
+typtype
+from pg_catalog.pg_type
+order by oid
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql
new file mode 100644
index 0000000000..ceb039005c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/pg_type_syntax_yql.sql
@@ -0,0 +1 @@
+select typname,oid from pg_catalog.pg_type order by oid
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql b/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql
new file mode 100644
index 0000000000..d3388c8cad
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/system_columns.sql
@@ -0,0 +1,3 @@
+--!syntax_pg
+select oid,tableoid,xmin,cmin,xmax,cmax,ctid from pg_type where typname = 'text';
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql b/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql
new file mode 100644
index 0000000000..54ae1c97b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/table_constraints.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select
+constraint_schema,
+table_name,
+constraint_type
+from
+information_schema.table_constraints
+order by constraint_schema, table_name
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/tables.sql b/yql/essentials/tests/sql/suites/pg_catalog/tables.sql
new file mode 100644
index 0000000000..a8bbe4cd87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/tables.sql
@@ -0,0 +1,9 @@
+--!syntax_pg
+select
+count(*) n,
+min(table_schema) min_s,
+min(table_name) min_t,
+max(table_schema) max_s,
+max(table_name) max_t
+from information_schema.tables;
+
diff --git a/yql/essentials/tests/sql/suites/pg_catalog/user.sql b/yql/essentials/tests/sql/suites/pg_catalog/user.sql
new file mode 100644
index 0000000000..750627d9e9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_catalog/user.sql
@@ -0,0 +1,6 @@
+--!syntax_pg
+select user, current_user, current_role, current_catalog, current_schema, current_schema();
+set search_path to "pg_catalog";
+select user, current_user, current_role, current_catalog, current_schema, current_schema();
+
+
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.sql
new file mode 100644
index 0000000000..50a8ce4e63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_join.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select a.x + 1 as y, b.x + 1 as z from
+ ((select 1 x) a
+ join
+ (select 1 x) b
+ on a.x = b.x)
+order by x+1
+-- column reference "x" is ambiguous \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.sql
new file mode 100644
index 0000000000..08260c4911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_from_table.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select a.* from
+ (select 1 x, 2 x) a
+order by x
+-- ORDER BY "x" is ambiguous
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.sql
new file mode 100644
index 0000000000..7efb496218
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_item_expression_from_projection.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select x + 1 as y, x - 1 as y from
+ (select 1 x) a
+order by y+1 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.sql
new file mode 100644
index 0000000000..9ceb4a1e41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_with_duplicates.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x + 1 as y, x - 1 as y from
+ (select 1 x) a
+order by y
+-- order by y is ambigous \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.cfg
new file mode 100644
index 0000000000..eb2e5315d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.cfg
@@ -0,0 +1 @@
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.sql
new file mode 100644
index 0000000000..f27341fb2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_order_by_wo_duplicated_in_projection.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select z from
+ (select 1 x, 1 x, 3 z) a
+order by x
+-- column reference "x" is ambiguous \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.sql b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.sql
new file mode 100644
index 0000000000..22098666df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/ambigous_ref.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a.x from (select 1 x, 2 x) a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/default.cfg b/yql/essentials/tests/sql/suites/pg_duplicated/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/default.cfg
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/order_by_duplicated_proj_on_column_ref.sql b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_duplicated_proj_on_column_ref.sql
new file mode 100644
index 0000000000..c7bc20ea1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_duplicated_proj_on_column_ref.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x + 1 as y, x + 1 as y from
+ (select 1 x) a
+order by y
+-- [2, 2] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_duplicates.sql b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_duplicates.sql
new file mode 100644
index 0000000000..4a971632a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_duplicates.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x + 1 as y, x + 1 as y from
+ (select 1 x) a
+order by y
+-- 2, 2 \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_same_projection_lambda.sql b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_same_projection_lambda.sql
new file mode 100644
index 0000000000..47507529b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/order_by_with_same_projection_lambda.sql
@@ -0,0 +1,5 @@
+--!syntax_pg
+select x + 1 as y, x + 1 as z from
+ (select 1 x) a
+order by x+1
+-- [2,2] \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_from_using.sql b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_from_using.sql
new file mode 100644
index 0000000000..a0045b7863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_from_using.sql
@@ -0,0 +1,8 @@
+--!syntax_pg
+select a.*, b.* from
+(
+ (select 1 x) a
+ full join
+ (select 2 x) b
+ using(x)
+) \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj.sql b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj.sql
new file mode 100644
index 0000000000..f082c48984
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select a.*, c.* from
+(select 1 x, 2 x) a,
+(select 3 x, 4 x) c \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_three_times.sql b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_three_times.sql
new file mode 100644
index 0000000000..a6b6cfa1af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_three_times.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select a.*, c.*, a.* from
+(select '1' x, 2 x) a,
+(select 3 x, '4' x) c \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_two_times.sql b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_two_times.sql
new file mode 100644
index 0000000000..c2fd10c145
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/qualified_star_proj_two_times.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select a.*, a.* from (select 1 x, 2 x) a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/simple_duplicate.sql b/yql/essentials/tests/sql/suites/pg_duplicated/simple_duplicate.sql
new file mode 100644
index 0000000000..f1c0010b2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/simple_duplicate.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select 1 a, '2' a \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/star_from_crossjoin.sql b/yql/essentials/tests/sql/suites/pg_duplicated/star_from_crossjoin.sql
new file mode 100644
index 0000000000..87cf83ac09
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/star_from_crossjoin.sql
@@ -0,0 +1,4 @@
+--!syntax_pg
+select * from
+(select '1' x, 2 x) a,
+(select 3 x, '4' x) c \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pg_duplicated/star_proj.sql b/yql/essentials/tests/sql/suites/pg_duplicated/star_proj.sql
new file mode 100644
index 0000000000..065b56014e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pg_duplicated/star_proj.sql
@@ -0,0 +1,2 @@
+--!syntax_pg
+select * from (select 1 a, 2 a) d \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/pragma/classic_division.sql b/yql/essentials/tests/sql/suites/pragma/classic_division.sql
new file mode 100644
index 0000000000..a6988269f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/classic_division.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+SELECT 1 / 2;
+
+PRAGMA ClassicDivision("false");
+SELECT 3 / 4;
+PRAGMA ClassicDivision("true");
+SELECT 5 / 6;
+
+DEFINE ACTION $div_8_by_value($value) AS
+ PRAGMA ClassicDivision("false");
+ SELECT 8 / $value;
+END DEFINE;
+
+DO $div_8_by_value(9);
+
+SELECT 10 / 11;
diff --git a/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx b/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx
new file mode 100644
index 0000000000..952eac04ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = "false";
+PRAGMA ClassicDivision = $x;
diff --git a/yql/essentials/tests/sql/suites/pragma/config_exec.cfg b/yql/essentials/tests/sql/suites/pragma/config_exec.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/config_exec.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/pragma/config_exec.sql b/yql/essentials/tests/sql/suites/pragma/config_exec.sql
new file mode 100644
index 0000000000..4e83143e42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/config_exec.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+INSERT INTO Output
+SELECT "1" as key, "1" as subkey, "1" as value;
+
+PRAGMA File("file", "dummy");
+
+INSERT INTO Output
+SELECT * from Input where key < "030";
diff --git a/yql/essentials/tests/sql/suites/pragma/default.cfg b/yql/essentials/tests/sql/suites/pragma/default.cfg
new file mode 100644
index 0000000000..8d1c8b69c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/default.cfg
@@ -0,0 +1 @@
+
diff --git a/yql/essentials/tests/sql/suites/pragma/file.sql b/yql/essentials/tests/sql/suites/pragma/file.sql
new file mode 100644
index 0000000000..d252d8dbe5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/file.sql
@@ -0,0 +1 @@
+pragma file("HW", "sbr:181041334");
diff --git a/yql/essentials/tests/sql/suites/pragma/input.txt b/yql/essentials/tests/sql/suites/pragma/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/pragma/messages.sqlx b/yql/essentials/tests/sql/suites/pragma/messages.sqlx
new file mode 100644
index 0000000000..09b5d72e54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/messages.sqlx
@@ -0,0 +1,5 @@
+/* postgres can not */
+PRAGMA Greetings;
+PRAGMA Greetings("It's a good day!");
+PRAGMA WarningMsg("Ready to fight!");
+PRAGMA ErrorMsg("Loose!");
diff --git a/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx b/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx
new file mode 100644
index 0000000000..fa577be58e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* not supported on windows */
+PRAGMA Warning("error", '4500');
+PRAGMA Greetings;
+PRAGMA Greetings("It's a good day!");
+PRAGMA WarningMsg("Ready to fight!");
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg
new file mode 100644
index 0000000000..1b5feeea00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg
@@ -0,0 +1,2 @@
+providers yt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql
new file mode 100644
index 0000000000..8fd8207414
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql
@@ -0,0 +1,23 @@
+/* kikimr can not */
+USE plato;
+
+PRAGMA yt.ReleaseTempData="immediate";
+PRAGMA yt.InflightTempTablesLimit="6";
+
+DEFINE ACTION $action($param) AS
+
+$key = CAST($param as String);
+
+$a = "Input";
+$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10);
+$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10);
+$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10);
+$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10);
+$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10);
+$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10);
+
+PROCESS $g;
+
+END DEFINE;
+
+EVALUATE FOR $param IN ListFromRange(1, 3) DO $action($param);
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg
new file mode 100644
index 0000000000..8896f1030d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+providers yt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql
new file mode 100644
index 0000000000..ae0813c283
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql
@@ -0,0 +1,24 @@
+USE plato;
+
+PRAGMA yt.ReleaseTempData="finish";
+PRAGMA yt.InflightTempTablesLimit="6";
+
+/* custom error:Too many temporary tables registered - limit is 6*/
+
+DEFINE ACTION $action($param) AS
+
+$key = CAST($param as String);
+
+$a = "Input";
+$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10);
+$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10);
+$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10);
+$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10);
+$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10);
+$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10);
+
+PROCESS $g;
+
+END DEFINE;
+
+EVALUATE FOR $param IN ListFromRange(1, 3) DO $action($param);
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg
new file mode 100644
index 0000000000..1b5feeea00
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg
@@ -0,0 +1,2 @@
+providers yt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql
new file mode 100644
index 0000000000..fcd945613f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql
@@ -0,0 +1,23 @@
+/* kikimr can not */
+USE plato;
+
+PRAGMA yt.ReleaseTempData="immediate";
+PRAGMA yt.InflightTempTablesLimit="3";
+
+DEFINE ACTION $action($param) AS
+
+$key = CAST($param as String);
+
+$a = "Input";
+$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10);
+$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10);
+$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10);
+$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10);
+$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10);
+$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10);
+
+PROCESS $g;
+
+END DEFINE;
+
+EVALUATE FOR $param IN ListFromRange(1, 2) DO $action($param);
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg
new file mode 100644
index 0000000000..8896f1030d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+providers yt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql
new file mode 100644
index 0000000000..c8dc1a2ac3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql
@@ -0,0 +1,25 @@
+/* dq can not */
+USE plato;
+
+PRAGMA yt.ReleaseTempData="immediate";
+PRAGMA yt.InflightTempTablesLimit="2";
+
+/* custom error:Too many temporary tables registered - limit is 2*/
+
+DEFINE ACTION $action($param) AS
+
+$key = CAST($param as String);
+
+$a = "Input";
+$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10);
+$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10);
+$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10);
+$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10);
+$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10);
+$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10);
+
+PROCESS $g;
+
+END DEFINE;
+
+EVALUATE FOR $param IN ListFromRange(1, 2) DO $action($param);
diff --git a/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg
new file mode 100644
index 0000000000..06764a39ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg
@@ -0,0 +1 @@
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql
new file mode 100644
index 0000000000..01cb8bf33f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+PRAGMA yson.AutoConvert;
+PRAGMA yson.Strict;
+
+SELECT Yson::ConvertToString(Yson("[123;]").0);
diff --git a/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg
new file mode 100644
index 0000000000..cf17d0b8d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql
new file mode 100644
index 0000000000..1db347862d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+PRAGMA yson.Strict;
+
+SELECT Yson::ConvertToString(Yson("122"));
diff --git a/yql/essentials/tests/sql/suites/produce/default.cfg b/yql/essentials/tests/sql/suites/produce/default.cfg
new file mode 100644
index 0000000000..55e29c24ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/default.cfg
@@ -0,0 +1,7 @@
+in Input0 input0.txt
+in Input1 input1.txt
+udf python3_udf
+udf streaming_udf
+udf simple_udf
+udf string_udf
+udf structs_udf
diff --git a/yql/essentials/tests/sql/suites/produce/descending.txt b/yql/essentials/tests/sql/suites/produce/descending.txt
new file mode 100644
index 0000000000..8e63b46e56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/descending.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="020";"subkey"="1";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/produce/descending.txt.attr b/yql/essentials/tests/sql/suites/produce/descending.txt.attr
new file mode 100644
index 0000000000..4f8cb9b625
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/descending.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "required" = %true;
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "required" = %true;
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ "required" = %true;
+ "sort_order" = "descending";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/discard_process_with_lambda.sql b/yql/essentials/tests/sql/suites/produce/discard_process_with_lambda.sql
new file mode 100644
index 0000000000..ea5a9252ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/discard_process_with_lambda.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$udf = YQL::@@(lambda '(x)
+(FlatMap x
+ (lambda '(y) (AsList y y))
+))@@;
+
+discard process plato.Input0 using $udf(TableRows());
diff --git a/yql/essentials/tests/sql/suites/produce/discard_reduce_lambda.sql b/yql/essentials/tests/sql/suites/produce/discard_reduce_lambda.sql
new file mode 100644
index 0000000000..132b492b4c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/discard_reduce_lambda.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+--INSERT INTO Output
+DISCARD REDUCE Input1 ON key USING $udf(cast(value as uint32) ?? 0);
diff --git a/yql/essentials/tests/sql/suites/produce/empty.txt b/yql/essentials/tests/sql/suites/produce/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/empty.txt
diff --git a/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.cfg b/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.cfg
new file mode 100644
index 0000000000..612a5060aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.cfg
@@ -0,0 +1 @@
+in Input input_sorted.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.sql b/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.sql
new file mode 100644
index 0000000000..b4f5afd8c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/fuse_reduces_with_presort.sql
@@ -0,0 +1,69 @@
+USE plato;
+
+$reduce = ($_, $TableRows) -> {
+ return Yql::Condense1(
+ $TableRows,
+ ($item) -> ($item),
+ ($_, $_) -> (false),
+ ($item, $_) -> ($item)
+ );
+};
+
+$stream =
+select * from Input;
+
+--
+
+$stream1 = Reduce $stream
+presort value1
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey, value1;
+
+$stream1 = Reduce $stream1
+presort value1
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey, value1;
+
+--
+
+$stream2 = Reduce $stream
+presort value1, value2
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey, value1, value2;
+
+$stream2 = Reduce $stream2
+presort value1
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey, value1;
+
+--
+
+$stream3 = Reduce $stream
+presort value1, value2, value3
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey, value1, value2, value3;
+
+$stream3 = Reduce $stream3
+on key, subkey
+using $reduce(TableRow())
+assume order by key, subkey;
+
+select
+ *
+from $stream1
+ASSUME ORDER BY `key`, `subkey`;
+
+select
+ *
+from $stream2
+ASSUME ORDER BY `key`, `subkey`;
+
+select
+ *
+from $stream3
+ASSUME ORDER BY `key`, `subkey`;
diff --git a/yql/essentials/tests/sql/suites/produce/input0.txt b/yql/essentials/tests/sql/suites/produce/input0.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/input0.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/produce/input1.txt b/yql/essentials/tests/sql/suites/produce/input1.txt
new file mode 100644
index 0000000000..60ee525827
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/input1.txt
@@ -0,0 +1,9 @@
+{"key"="foo";"subkey"="a";"value"="7"};
+{"key"="foo";"subkey"="b";"value"="1"};
+{"key"="foo";"subkey"="b";"value"="0"};
+{"key"="foo";"subkey"="a";"value"="2"};
+{"key"="bar";"subkey"="b";"value"="1"};
+{"key"="bar";"subkey"="u";"value"="2"};
+{"key"="bar";"subkey"="n";"value"="3"};
+{"key"="bar";"subkey"="n";"value"="4"};
+{"key"="bar";"subkey"="y";"value"="5"};
diff --git a/yql/essentials/tests/sql/suites/produce/input2.txt b/yql/essentials/tests/sql/suites/produce/input2.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/input2.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/produce/input_sorted.txt b/yql/essentials/tests/sql/suites/produce/input_sorted.txt
new file mode 100644
index 0000000000..070ba2f987
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/input_sorted.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="1";"value1"="abc";"value2"="aabbcc";"value3"="aa"};
+{"key"="075";"subkey"="2";"value1"="ddd";"value2"="dddddd";"value3"="bb"};
+{"key"="150";"subkey"="3";"value1"="q";"value2"="qq";"value3"="cc"};
+{"key"="800";"subkey"="4";"value1"="qzz";"value2"="qqzzzz";"value3"="dd"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/input_sorted.txt.attr b/yql/essentials/tests/sql/suites/produce/input_sorted.txt.attr
new file mode 100644
index 0000000000..f091ca59dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/input_sorted.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value1";["DataType";"String"]];
+ ["value2";["DataType";"String"]];
+ ["value3";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;1;1];
+ "SortedBy"=["key";"subkey";"value1";"value2";"value3"];
+ "SortedByTypes"=[["DataType";"String"];["DataType";"String"];["DataType";"String"];["DataType";"String"];["DataType";"String"]];
+ "SortMembers"=["key";"subkey";"value1";"value2";"value3"];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.cfg b/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.cfg
new file mode 100644
index 0000000000..faf73f95ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.cfg
@@ -0,0 +1,3 @@
+in Input1 descending.txt
+in Input2 sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.sql b/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.sql
new file mode 100644
index 0000000000..4970a01bbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/native_desc_reduce_with_presort.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+USE plato;
+pragma yt.UseNativeDescSort;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Nothing (OptionalType (DataType 'String))) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Coalesce state (Just item))))))
+))@@;
+
+select * from (
+ reduce Input1 presort value desc on key, subkey using $udf(value) --YtReduce
+) order by key, summ;
+
+select * from (
+ reduce Input1 presort subkey desc, value desc on key using $udf(value) --YtReduce
+) order by key, summ;
+
+select * from (
+ reduce Input1 presort value on key, subkey using $udf(value) --YtMapReduce
+) order by key, summ;
+
+select * from (
+ reduce concat(Input1, Input2) presort value desc on key, subkey using $udf(value) --YtMapReduce
+) order by key, summ;
diff --git a/yql/essentials/tests/sql/suites/produce/process_and_filter.sql b/yql/essentials/tests/sql/suites/produce/process_and_filter.sql
new file mode 100644
index 0000000000..2bd992f4f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_and_filter.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+PROCESS pLaTo.Input0 USING SimpleUdf::Echo(value) as val WHERE value == "abc";
diff --git a/yql/essentials/tests/sql/suites/produce/process_lambda_opt_args.sql b/yql/essentials/tests/sql/suites/produce/process_lambda_opt_args.sql
new file mode 100644
index 0000000000..612885c95b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_lambda_opt_args.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+$f = ($x, $optArg?)->{
+ return Ensure($x, $optArg is null or len($optArg)>0);
+};
+
+PROCESS Input0 USING $f(TableRow());
+
+PROCESS Input0 USING $f(TableRow(),'foo');
+
+PROCESS Input0 USING $f(TableRows());
+
+PROCESS Input0 USING $f(TableRows(),'foo');
+
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in.cfg b/yql/essentials/tests/sql/suites/produce/process_multi_in.cfg
new file mode 100644
index 0000000000..19cfc046c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in.cfg
@@ -0,0 +1,3 @@
+in Input input0.txt
+res result.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in.sql b/yql/essentials/tests/sql/suites/produce/process_multi_in.sql
new file mode 100644
index 0000000000..41d9c9be0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq file can not */
+$udfScript = @@
+def MyFunc(stream):
+ return stream
+@@;
+
+$record = (SELECT TableRow() FROM plato.Input);
+$recordType = TypeOf(Unwrap($record));
+$streamType = StreamType(VariantType(TupleType($recordType, $recordType, $recordType)));
+$udf = Python3::MyFunc(CallableType(0, $streamType, $streamType), $udfScript);
+
+$src = (select * from plato.Input where key > "200");
+
+$i, $j, $k = (PROCESS plato.Input, (select * from plato.Input where key > "100"), $src USING $udf(TableRows()));
+
+select * from $i;
+
+select * from $j;
+
+select * from $k;
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.cfg b/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.cfg
new file mode 100644
index 0000000000..98996c5bf7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.cfg
@@ -0,0 +1,3 @@
+in Input0 input0.txt
+out Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.sql b/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.sql
new file mode 100644
index 0000000000..11bc99aa5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in_single_out.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$udf = YQL::@@
+(lambda '(stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs (lambda '(pair)
+ (Map (Nth pair '1) (lambda '(elem)
+ (AsStruct
+ '('cnt (Visit elem '0 (lambda '(v) (Member v 'subkey)) '1 (lambda '(v) (Member v 'subkey))))
+ '('src (Nth pair '0))
+ )
+ ))
+ ))
+ )
+ )
+)
+@@;
+
+INSERT INTO plato.Output WITH TRUNCATE
+PROCESS plato.Input0, (select * from plato.Input0 where key > "100") USING $udf(TableRows());
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.cfg b/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.sql b/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.sql
new file mode 100644
index 0000000000..51c3de3aaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_in_trivial_lambda.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$lambda = ($x) -> { return $x; };
+
+$result = PROCESS Input, Input
+USING
+ $lambda(TableRow())
+;
+
+SELECT * FROM AS_TABLE($result.0);
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/process_multi_out.cfg
new file mode 100644
index 0000000000..d5a164924d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_out.cfg
@@ -0,0 +1,4 @@
+in Input input0.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_out.sql b/yql/essentials/tests/sql/suites/produce/process_multi_out.sql
new file mode 100644
index 0000000000..a6162a13a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_out.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def MyFunc(list):
+ return [(int(x.key) % 2, x) for x in list]
+@@;
+
+$record = (SELECT TableRow() FROM plato.Input);
+$recordType =TypeOf(Unwrap($record));
+
+$udf = Python::MyFunc(
+ CallableType(0,
+ StreamType(
+ VariantType(TupleType($recordType, $recordType))
+ ),
+ StreamType($recordType)),
+ $udfScript
+);
+
+$i, $j = (PROCESS plato.Input USING $udf(TableRows()));
+
+select * from $i;
+
+select * from $j;
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.cfg b/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.cfg
new file mode 100644
index 0000000000..00bbe745ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input0.txt
+res result.txt
+udf python2_udf
diff --git a/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.sql b/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.sql
new file mode 100644
index 0000000000..fdd02d93e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_multi_out_bad_count_fail.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def MyFunc(list):
+ return [(int(x.key) % 2, x) for x in list]
+@@;
+
+$record = (SELECT TableRow() FROM plato.Input);
+$recordType =TypeOf(Unwrap($record));
+
+$udf = Python::MyFunc(
+ CallableType(0,
+ StreamType(
+ VariantType(TupleType($recordType, $recordType))
+ ),
+ StreamType($recordType)),
+ $udfScript
+);
+
+$i, $j, $k = (PROCESS plato.Input USING $udf(TableRows()));
+
+select * from $i;
+select * from $j;
+select * from $k;
diff --git a/yql/essentials/tests/sql/suites/produce/process_pure_with_sort.sql b/yql/essentials/tests/sql/suites/produce/process_pure_with_sort.sql
new file mode 100644
index 0000000000..c03cc257ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_pure_with_sort.sql
@@ -0,0 +1,32 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$sorted = ($world, $input, $orderByColumns, $asc) -> {
+ $n = ListLength($orderByColumns);
+
+ $keySelector = LambdaCode(($row) -> {
+ $items = ListMap($orderByColumns,
+ ($x) -> {
+ RETURN FuncCode("Member", $row, AtomCode($x));
+ });
+ RETURN ListCode($items);
+ });
+
+ $sort = EvaluateCode(LambdaCode(($x) -> {
+ return FuncCode("Sort",
+ $x,
+ ListCode(ListReplicate(ReprCode($asc), $n)),
+ $keySelector)
+ }));
+
+ RETURN $sort($input($world));
+};
+
+DEFINE SUBQUERY $source() AS
+ PROCESS Input0;
+END DEFINE;
+
+PROCESS $sorted($source, AsList("key","subkey"), true);
+PROCESS $sorted($source, AsList("value"), true);
+PROCESS $sorted($source, ListCreate(TypeOf("")), true); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_row_and_columns.sql b/yql/essentials/tests/sql/suites/produce/process_row_and_columns.sql
new file mode 100644
index 0000000000..8ce580f615
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_row_and_columns.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def processRow(row, tag, separator):
+ return {"value":row.Name + separator + row.Value + separator + tag};
+@@;
+
+$udf = Python::processRow(
+ Callable<(Struct<Name:String, Tag:String, Value:String>, String, String)->Struct<value:String>>,
+ $udfScript
+);
+
+$data = (
+ SELECT key AS Name, value AS Value, subkey AS Tag FROM plato.Input0
+);
+
+$separator = "|";
+
+PROCESS $data USING $udf(TableRow(), Tag, $separator);
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.cfg b/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.cfg
new file mode 100644
index 0000000000..c1a5b06634
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.sql b/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.sql
new file mode 100644
index 0000000000..1af88830eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_and_filter.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+$udfScript = @@
+def processRows(prefix, rowList, separator):
+ result = [];
+ for row in rowList:
+ result.append({"Data" : prefix + row.Name + separator + row.Value});
+
+ return result;
+@@;
+
+$udf = Python::processRows(
+ Callable<(String, Stream<Struct<Name:String, Value:String>>, String)->Stream<Struct<Data:String>>>,
+ $udfScript
+);
+
+$data = (
+ SELECT key AS Name, value AS Value FROM plato.Input1
+);
+
+$prefix = ">>";
+
+PROCESS $data USING $udf($prefix, TableRows(), "=") WHERE Name != "foo";
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.sql b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.sql
new file mode 100644
index 0000000000..97fb0222b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_desc_multi_out.sql
@@ -0,0 +1,30 @@
+USE plato;
+
+$values = ListMap(
+ ListFromRange(0, 30),
+ ($x) -> (AsStruct($x as x))
+);
+
+INSERT INTO @table SELECT * FROM AS_TABLE($values) ORDER BY x DESC;
+
+COMMIT;
+
+$splitter = ($rows) -> {
+ $recordType = StreamItemType(TypeOf($rows));
+ $varType = VariantType(TupleType($recordType, $recordType, $recordType, $recordType));
+ RETURN Yql::OrderedMap($rows, ($row) -> {
+ RETURN CASE $row.x
+ WHEN 0 THEN Variant($row, "0", $varType)
+ WHEN 1 THEN Variant($row, "1", $varType)
+ WHEN 2 THEN Variant($row, "2", $varType)
+ ELSE Variant($row, "3", $varType)
+ END;
+ });
+};
+
+$a, $b, $c, $d = (PROCESS @table USING $splitter(TableRows()));
+
+SELECT * FROM $a;
+SELECT * FROM $b;
+SELECT * FROM $c ORDER BY x DESC;
+SELECT * FROM $d ORDER BY x DESC; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.sql b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.sql
new file mode 100644
index 0000000000..17ecc1de2b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_rows_sorted_multi_out.sql
@@ -0,0 +1,30 @@
+USE plato;
+
+$values = ListMap(
+ ListFromRange(0, 30),
+ ($x) -> (AsStruct($x as x))
+);
+
+INSERT INTO @table SELECT * FROM AS_TABLE($values) ORDER BY x;
+
+COMMIT;
+
+$splitter = ($rows) -> {
+ $recordType = StreamItemType(TypeOf($rows));
+ $varType = VariantType(TupleType($recordType, $recordType, $recordType, $recordType));
+ RETURN Yql::OrderedMap($rows, ($row) -> {
+ RETURN CASE $row.x
+ WHEN 0 THEN Variant($row, "0", $varType)
+ WHEN 1 THEN Variant($row, "1", $varType)
+ WHEN 2 THEN Variant($row, "2", $varType)
+ ELSE Variant($row, "3", $varType)
+ END;
+ });
+};
+
+$a, $b, $c, $d = (PROCESS @table USING $splitter(TableRows()));
+
+SELECT * FROM $a;
+SELECT * FROM $b;
+SELECT * FROM $c ORDER BY x;
+SELECT * FROM $d ORDER BY x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.sql b/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.sql
new file mode 100644
index 0000000000..478eda3d2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_sorted_desc_multi_out.sql
@@ -0,0 +1,28 @@
+USE plato;
+
+$values = ListMap(
+ ListFromRange(0, 30),
+ ($x) -> (AsStruct($x as x))
+);
+
+INSERT INTO @table SELECT * FROM AS_TABLE($values) ORDER BY x DESC;
+
+COMMIT;
+
+$splitter = ($row) -> {
+ $recordType = TypeOf($row);
+ $varType = VariantType(TupleType($recordType, $recordType, $recordType, $recordType));
+ RETURN CASE $row.x
+ WHEN 0 THEN Variant($row, "0", $varType)
+ WHEN 1 THEN Variant($row, "1", $varType)
+ WHEN 2 THEN Variant($row, "2", $varType)
+ ELSE Variant($row, "3", $varType)
+ END
+};
+
+$a, $b, $c, $d = (PROCESS @table USING $splitter(TableRow()));
+
+SELECT * FROM $a;
+SELECT * FROM $b;
+SELECT * FROM $c ORDER BY x DESC;
+SELECT * FROM $d ORDER BY x DESC; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.cfg
new file mode 100644
index 0000000000..a1b36ede45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.cfg
@@ -0,0 +1,2 @@
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.sql b/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.sql
new file mode 100644
index 0000000000..87a401a806
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_sorted_multi_out.sql
@@ -0,0 +1,28 @@
+USE plato;
+
+$values = ListMap(
+ ListFromRange(0, 30),
+ ($x) -> (AsStruct($x as x))
+);
+
+INSERT INTO @table SELECT * FROM AS_TABLE($values) ORDER BY x;
+
+COMMIT;
+
+$splitter = ($row) -> {
+ $recordType = TypeOf($row);
+ $varType = VariantType(TupleType($recordType, $recordType, $recordType, $recordType));
+ RETURN CASE $row.x
+ WHEN 0 THEN Variant($row, "0", $varType)
+ WHEN 1 THEN Variant($row, "1", $varType)
+ WHEN 2 THEN Variant($row, "2", $varType)
+ ELSE Variant($row, "3", $varType)
+ END
+};
+
+$a, $b, $c, $d = (PROCESS @table USING $splitter(TableRow()));
+
+SELECT * FROM $a;
+SELECT * FROM $b;
+SELECT * FROM $c ORDER BY x;
+SELECT * FROM $d ORDER BY x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_streaming.sql b/yql/essentials/tests/sql/suites/produce/process_streaming.sql
new file mode 100644
index 0000000000..1ad7274c79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_streaming.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+-- not supported on windows
+
+$input = (
+ SELECT String::JoinFromList(AsList(key, subkey, value), ",") AS Data FROM plato.Input1
+);
+
+$processed = (
+ PROCESS $input USING Streaming::Process(TableRows(), "grep", AsList("[14]"))
+);
+
+$list = (
+ SELECT String::SplitToList(Data, ',') AS DataList FROM $processed
+);
+
+SELECT
+ input.DataList[0] AS key,
+ input.DataList[1] AS subkey,
+ input.DataList[2] AS value
+FROM $list AS input;
+
diff --git a/yql/essentials/tests/sql/suites/produce/process_streaming_count.sql b/yql/essentials/tests/sql/suites/produce/process_streaming_count.sql
new file mode 100644
index 0000000000..c8111d385a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_streaming_count.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+-- not supported on windows
+
+$input = (
+ SELECT String::JoinFromList(AsList(key, subkey, value), ",") AS Data FROM plato.Input1
+);
+
+$processed = (
+ PROCESS $input USING Streaming::Process(TableRows(), "grep", AsList("[14]"))
+);
+
+SELECT
+ *
+FROM $processed;
+
+SELECT
+ COUNT(*)
+FROM $processed;
diff --git a/yql/essentials/tests/sql/suites/produce/process_streaming_inline_bash.sql b/yql/essentials/tests/sql/suites/produce/process_streaming_inline_bash.sql
new file mode 100644
index 0000000000..5737cf807b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_streaming_inline_bash.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+-- not supported on windows
+
+$script = @@
+#!/bin/bash
+cat - | grep $1 | head -n 3 | grep [234]
+@@;
+
+$input = (
+ SELECT String::JoinFromList(AsList(key, subkey, value), ",") AS Data FROM plato.Input1
+);
+
+PROCESS $input USING Streaming::ProcessInline(TableRows(), $script, AsList("bar"));
diff --git a/yql/essentials/tests/sql/suites/produce/process_trivial_as_struct.sql b/yql/essentials/tests/sql/suites/produce/process_trivial_as_struct.sql
new file mode 100644
index 0000000000..a948124640
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_trivial_as_struct.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+process plato.Input0 using SimpleUdf::Echo(value) as val; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_assume.cfg b/yql/essentials/tests/sql/suites/produce/process_with_assume.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_assume.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_assume.sql b/yql/essentials/tests/sql/suites/produce/process_with_assume.sql
new file mode 100644
index 0000000000..ddb1353299
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_assume.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+use plato;
+
+$udf = YQL::@@(lambda '(x)
+(FlatMap x
+ (lambda '(y) (Just (AsStruct '('key (Concat (String '"0") (Member y 'key))) '('subkey (Member y 'subkey)) '('value (Member y 'value)))))
+))@@;
+
+insert into Output with truncate
+process plato.Input using $udf(TableRows()) assume order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_lambda.sql b/yql/essentials/tests/sql/suites/produce/process_with_lambda.sql
new file mode 100644
index 0000000000..e0886faaf8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_lambda.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+$udf = YQL::@@(lambda '(x)
+(FlatMap x
+ (lambda '(y) (AsList y y))
+))@@;
+
+process plato.Input0 using $udf(TableRows());
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_lambda_outstream.sql b/yql/essentials/tests/sql/suites/produce/process_with_lambda_outstream.sql
new file mode 100644
index 0000000000..0c6c100764
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_lambda_outstream.sql
@@ -0,0 +1,27 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$f1 = ($r)->{
+ return $r;
+};
+
+PROCESS Input0 USING $f1(TableRow());
+
+$f2 = ($r)->{
+ return Just($r);
+};
+
+PROCESS Input0 USING $f2(TableRow());
+
+$f3 = ($r)->{
+ return AsList($r,$r);
+};
+
+PROCESS Input0 USING $f3(TableRow());
+
+$f4 = ($r)->{
+ return Yql::Iterator(AsList($r,$r));
+};
+
+PROCESS Input0 USING $f4(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_python.sql b/yql/essentials/tests/sql/suites/produce/process_with_python.sql
new file mode 100644
index 0000000000..caeb8c2cb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_python.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+$udfScript = @@
+def Dup(s):
+ return [{"value":s},{"value":s}]
+@@;
+
+$udf = Python::Dup(Callable<(String)->List<Struct<value:String>>>, $udfScript);
+
+process plato.Input0 using $udf(value);
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_python_as_struct.sql b/yql/essentials/tests/sql/suites/produce/process_with_python_as_struct.sql
new file mode 100644
index 0000000000..237c2abef8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_python_as_struct.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+$udfScript = @@
+def Dup(s):
+ return [s, s];
+@@;
+
+$udf = Python::Dup(Callable<(String)->List<String>>, $udfScript);
+
+process plato.Input0 using $udf(value) as val;
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_python_stream-empty.cfg b/yql/essentials/tests/sql/suites/produce/process_with_python_stream-empty.cfg
new file mode 100644
index 0000000000..837223c684
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_python_stream-empty.cfg
@@ -0,0 +1,2 @@
+in Input0 empty.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_python_stream.cfg b/yql/essentials/tests/sql/suites/produce/process_with_python_stream.cfg
new file mode 100644
index 0000000000..e34e70ff55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_python_stream.cfg
@@ -0,0 +1,3 @@
+in Input0 input0.txt
+udf python3_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_python_stream.sql b/yql/essentials/tests/sql/suites/produce/process_with_python_stream.sql
new file mode 100644
index 0000000000..33a0b8f8f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_python_stream.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* kikimr can not */
+USE plato;
+
+$udfScript = @@
+def f(input,x):
+ for i in input:
+ yield {
+ 'key': i.key,
+ 'subkey': i.subkey,
+ 'value': i.value,
+ 'pass': x
+ }
+@@;
+
+$udf_stream = Python3::f(
+Callable<
+ (Stream<Struct<key:String,subkey:String,value:String>>,Int32)
+ ->
+ Stream<Struct<key:String,subkey:String,value:String,pass:Int32>>
+>, $udfScript);
+
+PROCESS Input0 using $udf_stream(TableRows(), 2);
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_udf.sql b/yql/essentials/tests/sql/suites/produce/process_with_udf.sql
new file mode 100644
index 0000000000..f8fb326983
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_udf.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+process plato.Input0 using Person::New(key, subkey, coalesce(cast(value as Uint32), 0)); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_udf_rows.sql b/yql/essentials/tests/sql/suites/produce/process_with_udf_rows.sql
new file mode 100644
index 0000000000..3df9f4df1b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_udf_rows.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+$udf = Python::process(
+Callable<
+ ()->Stream<Struct<result:Int64>>
+>, @@
+def process():
+ for row in range(10):
+ result = row
+ yield locals()
+@@);
+
+$users = (
+ SELECT `key` AS age, `value` AS name FROM plato.Input0
+);
+
+PROCESS $users
+USING $udf();
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_udf_validate.sql b/yql/essentials/tests/sql/suites/produce/process_with_udf_validate.sql
new file mode 100644
index 0000000000..e5082fdd77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_udf_validate.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+$processed = (
+ process plato.Input0 using Person::New(key, subkey, coalesce(cast(value as Uint32), 0))
+);
+
+PRAGMA config.flags("ValidateUdf", "Lazy");
+SELECT * FROM $processed;
diff --git a/yql/essentials/tests/sql/suites/produce/process_with_udf_validate_ignore_broken.sql b/yql/essentials/tests/sql/suites/produce/process_with_udf_validate_ignore_broken.sql
new file mode 100644
index 0000000000..de471f14f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/process_with_udf_validate_ignore_broken.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+
+$processed = (
+ process plato.Input0 using Person::New(key, subkey, Length(SimpleUdf::ReturnBrokenInt()))
+);
+
+PRAGMA config.flags("ValidateUdf", "None");
+SELECT * FROM $processed;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all.sql b/yql/essentials/tests/sql/suites/produce/reduce_all.sql
new file mode 100644
index 0000000000..89362a4454
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dqfile can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + int(y.value), pair[1], 0) for pair in stream]
+ return {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+@@;
+
+$udf = Python::Len(Callable<(Stream<Tuple<String,Stream<Struct<key:String,subkey:String,value:String>>>>)->Struct<sumByAllVal:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_expr.sql b/yql/essentials/tests/sql/suites/produce/reduce_all_expr.sql
new file mode 100644
index 0000000000..d4e194802f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_expr.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+/* dqfile can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + y, pair[1], 0) for pair in stream]
+ return {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+@@;
+
+$udf = Python::Len(Callable<(Stream<Tuple<String,Stream<Uint32>>>)->Struct<sumByAllVal:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(cast(value as uint32) ?? 0);
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_list.sql b/yql/essentials/tests/sql/suites/produce/reduce_all_list.sql
new file mode 100644
index 0000000000..ec08c7922d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_list.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dq can not */
+/* dqfile can not */
+USE plato;
+
+$udfScript = @@
+import functools
+
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + int(y.value), pair[1], 0) for pair in stream]
+ return [{"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}]
+@@;
+
+$udf = Python::Len(Callable<(Stream<Tuple<String,Stream<Struct<key:String,subkey:String,value:String>>>>)->List<Struct<sumByAllVal:Uint32>>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_list_stream.sql b/yql/essentials/tests/sql/suites/produce/reduce_all_list_stream.sql
new file mode 100644
index 0000000000..5e154426c0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_list_stream.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+from yql import TYieldIteration
+
+def Sum(stream):
+ def Gen(stream):
+ sums = []
+ for pair in stream:
+ if isinstance(pair, TYieldIteration):
+ yield pair
+ else:
+ sums.append(functools.reduce(lambda x,y: x + int(y.value), pair[1], 0))
+
+ yield {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+ return Gen(stream)
+@@;
+
+$udf = Python3::Sum(Callable<(Stream<Tuple<String,Stream<Struct<key:String,subkey:String,value:String>>>>)->Stream<Struct<sumByAllVal:Uint32>>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_multi_in.sql b/yql/essentials/tests/sql/suites/produce/reduce_all_multi_in.sql
new file mode 100644
index 0000000000..6f6750898e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_multi_in.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dqfile can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + int(y[1].value), pair[1], 0) for pair in stream]
+ return {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+@@;
+
+$udf = Python::Len(Callable<(Stream<Tuple<String,Stream<Variant<Struct<key:String,subkey:String,value:String>,Struct<key:String,subkey:String,value:String>>>>>)->Struct<sumByAllVal:Uint32>>, $udfScript);
+
+REDUCE Input1, Input1 ON key USING ALL $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_opt.sql b/yql/essentials/tests/sql/suites/produce/reduce_all_opt.sql
new file mode 100644
index 0000000000..467be50696
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_opt.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+/* dqfile can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + int(y.value), pair[1], 0) for pair in stream]
+ return {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+@@;
+
+$udf = Python::Len(Callable<(Stream<Tuple<String,Stream<Struct<key:String,subkey:String,value:String>>>>)->Optional<Struct<sumByAllVal:Uint32>>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream-dq_fail.cfg b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream-dq_fail.cfg
new file mode 100644
index 0000000000..c426164726
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream-dq_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input1 input1.txt
+udf python3_udf
+providers dq
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream._sql b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream._sql
new file mode 100644
index 0000000000..82b3767cc5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream._sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(stream):
+ sums = [functools.reduce(lambda x,y: x + y, pair[1], 0) for pair in stream]
+ return {"sumByAllVal":functools.reduce(lambda x,y: x + y, sums, 0)}
+@@;
+
+$udf = Python3::Len(Callable<(Stream<Tuple<String,Stream<Uint32>>>)->Struct<sumByAllVal:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING ALL $udf(cast(value as uint32) ?? 0);
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream.cfg b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream.cfg
new file mode 100644
index 0000000000..13bb8734c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_all_with_python_input_stream.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+udf python3_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_by_struct.sql b/yql/essentials/tests/sql/suites/produce/reduce_by_struct.sql
new file mode 100644
index 0000000000..a36223f7a4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_by_struct.sql
@@ -0,0 +1,16 @@
+USE plato;
+
+INSERT INTO @tmp
+SELECT * FROM AS_TABLE([
+ <|key: <|field1: 1, field2: 1|>, value: 1|>,
+ <|key: <|field1: 1, field2: 1|>, value: 2|>,
+ ]);
+
+COMMIT;
+
+$reducer = ($_key, $stream) -> ($stream);
+
+REDUCE @tmp
+ON key
+USING $reducer(TableRow());
+
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_lambda.sql b/yql/essentials/tests/sql/suites/produce/reduce_lambda.sql
new file mode 100644
index 0000000000..74d1372d73
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_lambda.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+--INSERT INTO Output
+$res = (REDUCE Input1 ON key USING $udf(cast(value as uint32) ?? 0));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_mem.sql b/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_mem.sql
new file mode 100644
index 0000000000..4593e67ba3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_mem.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+--INSERT INTO Output
+$res = (REDUCE (select AsList("foo") as key, "123" as value) ON key USING $udf(cast(value as uint32) ?? 0));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_table.sql b/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_table.sql
new file mode 100644
index 0000000000..39aa5ec294
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_lambda_list_table.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+--INSERT INTO Output
+$res = (REDUCE (select AsList(key) as key, value from Input1) ON key USING $udf(cast(value as uint32) ?? 0));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin.sql b/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin.sql
new file mode 100644
index 0000000000..ca37608c70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('superstring (Collect (Condense stream (String '"") (lambda '(item state) (Bool 'False)) (lambda '(item state)
+ (Concat state (Concat (Member item 'char) (Member item 'num)))
+ ))))
+))@@;
+
+--INSERT INTO Output
+$res = (REDUCE Input1 PRESORT subkey, value desc ON key USING $udf(AsStruct(subkey as char, value as num)));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin_list.sql b/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin_list.sql
new file mode 100644
index 0000000000..65225b9ffa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_lambda_presort_twin_list.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('superstring (Collect (Condense stream (String '"") (lambda '(item state) (Bool 'False)) (lambda '(item state)
+ (Concat state (Concat (Member item 'char) (Member item 'num)))
+ ))))
+))@@;
+
+--INSERT INTO Output
+$res = (REDUCE Input1 PRESORT AsList(subkey), value desc ON key USING $udf(AsStruct(subkey as char, value as num)));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in-empty.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in-empty.cfg
new file mode 100644
index 0000000000..ce36bb4337
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in-empty.cfg
@@ -0,0 +1,2 @@
+in Input empty.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in-sorted.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in-sorted.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in-sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in.sql
new file mode 100644
index 0000000000..c819fb4a58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, Input ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.sql
new file mode 100644
index 0000000000..b867fc4fdc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, `Input{key,subkey}` ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.sql
new file mode 100644
index 0000000000..159e80f995
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$user_process = ($key, $t1, $t2, $t3) -> {
+ return AsStruct(
+ $key AS key,
+ COALESCE(cast($t1.subkey as Int32), 0) + COALESCE(cast($t2.subkey as Int32), 0) + COALESCE(cast($t3.subkey as Int32), 0) AS subkey
+ );
+};
+
+$reducer = ($key, $stream) -> {
+ $stream = YQL::OrderedMap($stream, ($item) -> {
+ return AsStruct(
+ YQL::Guess($item, AsAtom("0")).t1 AS t1,
+ YQL::Guess($item, AsAtom("1")).t2 AS t2,
+ YQL::Guess($item, AsAtom("2")).t3 AS t3,
+ );
+ });
+ $recs = YQL::Collect(YQL::Condense1(
+ $stream,
+ ($item) -> {return AsStruct(
+ $item.t1 AS t1,
+ $item.t2 AS t2,
+ $item.t3 AS t3,
+ );},
+ ($_item, $_state) -> {return false;},
+ ($item, $state) -> {return AsStruct(
+ COALESCE($state.t1, $item.t1) AS t1,
+ COALESCE($state.t2, $item.t2) AS t2,
+ COALESCE($state.t3, $item.t3) AS t3,
+ );},
+ ));
+ $rec = Ensure($recs, ListLength($recs) == 1ul)[0];
+ return $user_process($key, $rec.t1, $rec.t2, $rec.t3);
+};
+
+INSERT INTO Output WITH TRUNCATE
+REDUCE
+ (SELECT key, TableRow() AS t1 FROM Input),
+ (SELECT key, TableRow() AS t2 FROM Input),
+ (SELECT key, TableRow() AS t3 FROM Input)
+ON key
+USING $reducer(TableRow())
+ASSUME ORDER BY key;
+
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.sql
new file mode 100644
index 0000000000..e1f71c3953
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_difftype_assume_keytuple.sql
@@ -0,0 +1,45 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$user_process = ($key, $t1, $t2, $t3) -> {
+ return AsStruct(
+ $key.0 AS key,
+ COALESCE(cast($t1.subkey as Int32), 0) + COALESCE(cast($t2.subkey as Int32), 0) + COALESCE(cast($t3.subkey as Int32), 0) AS subkey
+ );
+};
+
+$reducer = ($key, $stream) -> {
+ $stream = YQL::OrderedMap($stream, ($item) -> {
+ return AsStruct(
+ YQL::Guess($item, AsAtom("0")).t1 AS t1,
+ YQL::Guess($item, AsAtom("1")).t2 AS t2,
+ YQL::Guess($item, AsAtom("2")).t3 AS t3,
+ );
+ });
+ $recs = YQL::Collect(YQL::Condense1(
+ $stream,
+ ($item) -> {return AsStruct(
+ $item.t1 AS t1,
+ $item.t2 AS t2,
+ $item.t3 AS t3,
+ );},
+ ($_item, $_state) -> {return false;},
+ ($item, $state) -> {return AsStruct(
+ COALESCE($state.t1, $item.t1) AS t1,
+ COALESCE($state.t2, $item.t2) AS t2,
+ COALESCE($state.t3, $item.t3) AS t3,
+ );},
+ ));
+ $rec = Ensure($recs, ListLength($recs) == 1ul)[0];
+ return $user_process($key, $rec.t1, $rec.t2, $rec.t3);
+};
+
+INSERT INTO Output WITH TRUNCATE
+REDUCE
+ (SELECT key, subkey, TableRow() AS t1 FROM Input),
+ (SELECT key, subkey, TableRow() AS t2 FROM Input),
+ (SELECT key, subkey, TableRow() AS t3 FROM Input)
+ON key, subkey
+USING $reducer(TableRow())
+ASSUME ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.sql
new file mode 100644
index 0000000000..fe9bd349ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key (Nth key '0)) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, Input ON key,subkey USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.sql
new file mode 100644
index 0000000000..ea6a236d22
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_keytuple_difftype.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key (Nth key '0)) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, `Input{key,subkey}` ON key,subkey USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.sql
new file mode 100644
index 0000000000..3712268059
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_presort.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, Input PRESORT value, key || subkey ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.sql
new file mode 100644
index 0000000000..9587d1a453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_ref.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$src = (select * from plato.Input where key > "200");
+
+$r = (REDUCE Input, (select * from Input where key > "100"), $src ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling-sorted.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling-sorted.cfg
new file mode 100644
index 0000000000..2334ceb124
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling-sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted1.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.cfg
new file mode 100644
index 0000000000..fb4fb16059
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.cfg
@@ -0,0 +1,2 @@
+in Input input2.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.sql
new file mode 100644
index 0000000000..e82a139d2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_sampling.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 16 */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input SAMPLE(0.1), Input SAMPLE(0.1) ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.cfg
new file mode 100644
index 0000000000..4468d3ba29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.sql
new file mode 100644
index 0000000000..1e694e0280
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_in_stage_and_flatmap.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udf = YQL::@@
+(lambda '(key stream)
+ (PartitionByKey stream
+ (lambda '(item) (Way item))
+ (Void)
+ (Void)
+ (lambda '(listOfPairs)
+ (FlatMap listOfPairs
+ (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
+ )
+ )
+ )
+)
+@@;
+
+$r = (REDUCE Input, AS_TABLE(ListMap(ListFromRange(0,10), ($val) -> {
+ RETURN AsStruct(Cast($val AS String) AS key, Cast($val AS String) AS subkey, Cast($val AS String) AS value)
+})) ON key USING $udf(TableRow()));
+
+SELECT key, src, cnt FROM $r ORDER BY key, src, cnt; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_out.cfg b/yql/essentials/tests/sql/suites/produce/reduce_multi_out.cfg
new file mode 100644
index 0000000000..f73dce605c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_out.cfg
@@ -0,0 +1,4 @@
+in Input input1.txt
+res result.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_multi_out.sql b/yql/essentials/tests/sql/suites/produce/reduce_multi_out.sql
new file mode 100644
index 0000000000..079ff55899
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_multi_out.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+
+def Len(key, input):
+ sumByValue = functools.reduce(lambda x,y: x + int(y.value), input, 0)
+ return (sumByValue % 2, {"sumByVal": sumByValue})
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<Struct<key:String,subkey:String,value:String>>)->Variant<Struct<sumByVal:Uint32>,Struct<sumByVal:Uint32>>>, $udfScript);
+
+$i, $j = (REDUCE Input ON key USING $udf(TableRow()));
+
+select * from $i order by sumByVal;
+select * from $j order by sumByVal;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_subfields-sorted.cfg b/yql/essentials/tests/sql/suites/produce/reduce_subfields-sorted.cfg
new file mode 100644
index 0000000000..a709300fac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_subfields-sorted.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_subfields.cfg b/yql/essentials/tests/sql/suites/produce/reduce_subfields.cfg
new file mode 100644
index 0000000000..0245ac800c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_subfields.cfg
@@ -0,0 +1,2 @@
+in Input input0.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_subfields.sql b/yql/essentials/tests/sql/suites/produce/reduce_subfields.sql
new file mode 100644
index 0000000000..3518cac97e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_subfields.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+def f(key, input):
+ for i in input:
+ yield {
+ 'key': i.key,
+ 'value': i.value,
+ 'pass': 10
+ }
+@@;
+
+$udf_stream = Python3::f(
+Callable<
+ (String,Stream<Struct<key:String,value:String>>)
+ ->
+ Stream<Struct<key:String,value:String,pass:Int32>>
+>, $udfScript);
+
+
+REDUCE Input
+ON key
+USING $udf_stream(TableRow());
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.cfg b/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.cfg
new file mode 100644
index 0000000000..520f10d8f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.cfg
@@ -0,0 +1,3 @@
+in Input0 input0.txt
+udf simple_udf
+providers yt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.sql b/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.sql
new file mode 100644
index 0000000000..bebc744f63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_typeinfo.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+/* ignore runonopt plan diff */
+use plato;
+
+pragma warning("disable", "4510");
+
+$r1 = REDUCE Input0 ON key USING ALL SimpleUdf::GenericAsStruct(TableRows());
+$r2 = REDUCE Input0 ON key USING SimpleUdf::GenericAsStruct(cast(TableRow().subkey as Int32));
+$r3 = REDUCE Input0 ON key USING ALL SimpleUdf::GenericAsStruct(TableRow().key);
+
+
+select * from (select * from $r1 flatten list by arg_0) flatten columns order by key, subkey;
+select arg_0 as key, ListSort(YQL::Collect(arg_1)) as values from $r2 order by key;
+
+
+select FormatType(TypeOf(TableRow())) from $r1 limit 1;
+select FormatType(TypeOf(TableRow())) from $r3 limit 1;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_assume.cfg b/yql/essentials/tests/sql/suites/produce/reduce_with_assume.cfg
new file mode 100644
index 0000000000..66737248b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_assume.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_assume.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_assume.sql
new file mode 100644
index 0000000000..3f51be0d12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_assume.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* multirun can not */
+/* syntax version 1 */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('sum (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+INSERT INTO Output
+REDUCE Input ON key USING $udf(cast(subkey as uint32) ?? 0) ASSUME ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.cfg b/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.cfg
new file mode 100644
index 0000000000..144f0dd840
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.cfg
@@ -0,0 +1 @@
+in Input input2.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.sql
new file mode 100644
index 0000000000..3913353e12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_assume_in_subquery.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Nothing (OptionalType (DataType 'String))) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Coalesce state (Just item))))))
+))@@;
+
+$in = (SELECT * FROM Input ASSUME ORDER BY key, subkey);
+
+$res = (REDUCE $in ON key USING $udf(value));
+
+SELECT * FROM $res ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_flat_lambda.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_flat_lambda.sql
new file mode 100644
index 0000000000..b0e1e56200
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_flat_lambda.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* kikimr can not */
+USE plato;
+
+$udf_stream = ($input)->{ return $input };
+
+$res = REDUCE Input0 ON key using all $udf_stream(TableRows());
+
+select * from $res order by value;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_flat_python_stream.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_flat_python_stream.sql
new file mode 100644
index 0000000000..8d164a65c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_flat_python_stream.sql
@@ -0,0 +1,30 @@
+/* syntax version 1 */
+/* kikimr can not */
+USE plato;
+
+$udfScript = @@
+def f(input):
+ s = []
+ last_key = None
+ for i in input:
+ if last_key is not None and last_key != i.key:
+ s = []
+ s.append(i.value)
+ last_key = i.key
+ yield {
+ 'key': i.key,
+ 'subkey1': i.subkey,
+ 'value': b''.join(s),
+ }
+@@;
+
+$udf_stream = Python3::f(
+Callable<
+ (Stream<Struct<key:String,subkey:String,value:String>>)
+ ->
+ Stream<Struct<key:String,subkey1:String,value:String>>
+>, $udfScript);
+
+$res = REDUCE Input0 PRESORT value ON key using all $udf_stream(TableRows()) ;
+
+select * from $res order by key, value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.cfg b/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.cfg
new file mode 100644
index 0000000000..1dc9a1e3a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.cfg
@@ -0,0 +1 @@
+in Input input0.txt
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.sql
new file mode 100644
index 0000000000..9bdca4b7d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_presort_diff_order.sql
@@ -0,0 +1,32 @@
+USE plato;
+
+insert into @skv1v2
+select key, subkey, value as value1, value as value2 from Input order by subkey, key, value1, value2;
+
+insert into @skv2v1
+select key, subkey, value as value1, value as value2 from Input order by subkey, key, value2, value1;
+
+insert into @ksv1v2
+select key, subkey, value as value1, value as value2 from Input order by key, subkey, value1, value2;
+
+commit;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Nothing (OptionalType (DataType 'String))) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Coalesce state (Just item))))))
+))@@;
+
+select * from (
+ reduce concat(@skv1v2, @skv1v2) presort value1, value2 on key, subkey using $udf(value1) --YtReduce
+) order by key, summ;
+
+select * from (
+ reduce @ksv1v2 presort value2, value1 on key, subkey using $udf(value1) --YtMapReduce
+) order by key, summ;
+
+select * from (
+ reduce concat(@skv1v2, @skv2v1) presort value1, value2 on key, subkey using $udf(value1) --YtMapReduce
+) order by key, summ;
+
+select * from (
+ reduce concat(@skv1v2, @ksv1v2) presort value1, value2 on key, subkey using $udf(value1) --YtMapReduce
+) order by key, summ;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python.sql
new file mode 100644
index 0000000000..6bdf0efb24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(key, input):
+ return {"value":functools.reduce(lambda x,y: x + 1, input, 0)}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<String>)->Struct<value:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+$res = (REDUCE Input1 ON key USING $udf(value));
+
+select * from $res order by value;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys.sql
new file mode 100644
index 0000000000..346c977f16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+$udfScript = @@
+import functools
+def Len(val_key, input):
+ return {"zuza": {val_key[0] + b"-" + str(val_key[1]).encode('utf-8'): functools.reduce(lambda x,y: x + 1, input, 0)}}
+@@;
+
+$udf = Python::Len(Callable<(Tuple<String,Uint32>, Stream<String>)->Struct<zuza:Dict<String, Uint32>>>, $udfScript);
+
+$data = (select Cast(value as uint32) ?? 0 as kk, value as ss, key as val from plato.Input1);
+
+$res = (reduce $data on val, kk using $udf(ss));
+
+select * from $res order by Yql::ToOptional(Yql::DictKeys(zuza));
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys_stream.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys_stream.sql
new file mode 100644
index 0000000000..aac5ae32b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_few_keys_stream.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$udfScript = @@
+import functools
+
+def Len(val_key, input):
+ return {"zuza": {val_key[0] + b"-" + str(val_key[1]).encode('utf-8'): functools.reduce(lambda x, y: x + 1, input, 0)}}
+@@;
+
+$udf = Python3::Len(Callable<(Tuple<String,Uint32>, Stream<String>)->Struct<zuza:Dict<String, Uint32>>>, $udfScript);
+
+$data = (select Cast(value as uint32) ?? 0 as kk, value as ss, key as val from Input1);
+
+--insert into Output
+$res = (reduce $data on val, kk using $udf(ss));
+
+select * from $res order by DictKeys(zuza);
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_filter_and_having.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_filter_and_having.sql
new file mode 100644
index 0000000000..dc3beb4025
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_filter_and_having.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(key, input):
+ return {"total":functools.reduce(lambda x,y: x + 1, input, 0)}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<String>)->Struct<total:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING $udf(value) WHERE cast(value as int) > 1 HAVING total > 3;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_having.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_having.sql
new file mode 100644
index 0000000000..b226e6f399
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_having.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(key, input):
+ return {"count":functools.reduce(lambda x,y: x + 1, input, 0)}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<String>)->Struct<count:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+REDUCE Input1 ON key USING $udf(value) HAVING count > 4;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream._sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream._sql
new file mode 100644
index 0000000000..f244cd5c0d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream._sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(key, input):
+ return {"value":functools.reduce(lambda x,y: x + 1, input, 0)}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<String>)->Struct<value:Uint32>>, $udfScript);
+
+$res = (REDUCE Input1 ON key USING $udf(value));
+
+select * from $res order by value;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream.cfg b/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream.cfg
new file mode 100644
index 0000000000..b16f832837
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_input_stream.cfg
@@ -0,0 +1,2 @@
+in Input1 input1.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort.sql
new file mode 100644
index 0000000000..fa55b8bce2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+def Len(val_key, input):
+ return {"joined": {val_key: b", ".join(input)}}
+@@;
+
+$udf = Python3::Len(Callable<(String, Stream<String>)->Struct<joined:Dict<String, String>>>, $udfScript);
+
+--INSERT INTO Output
+$res = (REDUCE Input1 PRESORT value DESC ON key USING $udf(subkey));
+
+select * from $res order by Yql::ToOptional(Yql::DictKeys(joined));
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort_stream.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort_stream.sql
new file mode 100644
index 0000000000..276c70136c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_presort_stream.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+$udfScript = @@
+def Len(val_key, input):
+ return {"joined": {val_key: b", ".join(input)}}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<String>)->Struct<joined:Dict<String, String>>>, $udfScript);
+
+--INSERT INTO Output
+$res = (REDUCE Input1 PRESORT value DESC ON key USING $udf(subkey));
+
+select * from $res order by DictKeys(joined);
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_row.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_row.sql
new file mode 100644
index 0000000000..6d3371d649
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_row.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+
+def Len(key, input):
+ return {"sumByVal": functools.reduce(lambda x,y: x + int(y.value), input, 0)}
+@@;
+
+$udf = Python3::Len(Callable<(String, Stream<Struct<key:String,subkey:String,value:String>>)->Struct<sumByVal:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+$res = (REDUCE Input1 ON key USING $udf(TableRow()));
+
+select * from $res order by sumByVal;
diff --git a/yql/essentials/tests/sql/suites/produce/reduce_with_python_row_repack.sql b/yql/essentials/tests/sql/suites/produce/reduce_with_python_row_repack.sql
new file mode 100644
index 0000000000..1eba13ec1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/reduce_with_python_row_repack.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$udfScript = @@
+import functools
+def Len(key, input):
+ return {"sumByValAndKeyLen":functools.reduce(lambda x,y: x + int(y.value) + len(y.key), input, 0)}
+@@;
+
+$udf = Python::Len(Callable<(String, Stream<Struct<key:String,value:String>>)->Struct<sumByValAndKeyLen:Uint32>>, $udfScript);
+
+--INSERT INTO Output
+$res = (REDUCE Input1 ON key USING $udf(AsStruct(TableRow().value as value, TableRow().subkey as key)));
+
+select * from $res order by sumByValAndKeyLen;
diff --git a/yql/essentials/tests/sql/suites/produce/sorted.txt b/yql/essentials/tests/sql/suites/produce/sorted.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/sorted.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/produce/sorted.txt.attr b/yql/essentials/tests/sql/suites/produce/sorted.txt.attr
new file mode 100644
index 0000000000..391c1a05f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;];
+ "SortedBy"=["key";"subkey";"value";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/produce/sorted1.txt b/yql/essentials/tests/sql/suites/produce/sorted1.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/sorted1.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/produce/sorted1.txt.attr b/yql/essentials/tests/sql/suites/produce/sorted1.txt.attr
new file mode 100644
index 0000000000..391c1a05f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/sorted1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;1;];
+ "SortedBy"=["key";"subkey";"value";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";"value";];
+}}
diff --git a/yql/essentials/tests/sql/suites/produce/yql-10297.sql b/yql/essentials/tests/sql/suites/produce/yql-10297.sql
new file mode 100644
index 0000000000..9622221e15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/produce/yql-10297.sql
@@ -0,0 +1,30 @@
+/* syntax version 1 */
+/* postgres can not */
+DEFINE SUBQUERY $t() AS
+ select * from as_table([<|key:"0"|>, <|key:"1"|>]);
+END DEFINE;
+
+DEFINE SUBQUERY $split_formula_log($in) AS
+ $parition = ($row) -> {
+ $recordType = TypeOf($row);
+ $varType = VariantType(TupleType($recordType,
+ $recordType));
+ RETURN case
+ when $row.key = "0" then
+ Variant($row, "0", $varType)
+
+ when $row.key = "1" then
+ Variant($row, "1", $varType)
+ else null
+ end
+ ;
+ };
+
+ PROCESS $in() USING $parition(TableRow());
+END DEFINE;
+
+
+$a, $b = (PROCESS $split_formula_log($t));
+select * from $a;
+select * from $b;
+
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_default.sql b/yql/essentials/tests/sql/suites/sampling/bind_default.sql
new file mode 100644
index 0000000000..c0f98c9dcc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_default.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+USE plato;
+
+$var = SELECT * FROM Input;
+
+SELECT * FROM $var TABLESAMPLE BERNOULLI(50);
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_expr.sql b/yql/essentials/tests/sql/suites/sampling/bind_expr.sql
new file mode 100644
index 0000000000..e0820679f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_expr.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+USE plato;
+
+$count = SELECT COUNT(*) FROM Input; -- $count = 10
+
+$var = SELECT * FROM Input;
+
+SELECT * FROM $var TABLESAMPLE BERNOULLI(5 * $count);
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_expr_subquery.sql b/yql/essentials/tests/sql/suites/sampling/bind_expr_subquery.sql
new file mode 100644
index 0000000000..a734691f70
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_expr_subquery.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+USE plato;
+
+$rc = (select count(*) from Input);
+$sample_size = 10;
+
+select * from Input tablesample bernoulli(MIN_OF($sample_size * 100.0 / $rc, 100.0)) order by key;
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.cfg b/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.cfg
new file mode 100644
index 0000000000..7b2051c1bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf math_udf
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.sql b/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.sql
new file mode 100644
index 0000000000..4a5bbf945b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_expr_udf.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$percent = Math::Ceil(0.2);
+
+SELECT * FROM Input TABLESAMPLE BERNOULLI(Math::Ceil(100 * $percent)) ORDER BY key; -- 100% sample
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_join_left.sql b/yql/essentials/tests/sql/suites/sampling/bind_join_left.sql
new file mode 100644
index 0000000000..8e1a9d863f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_join_left.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+/* hybridfile can not YQL-17764 */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 3 */
+
+use plato;
+pragma DisableSimpleColumns;
+
+$a = select * from Input where key > "199" and value != "bbb";
+
+select * from (select a.value, b.value from $a as a inner join Input as b using(subkey)) tablesample bernoulli(25);
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_join_right.sql b/yql/essentials/tests/sql/suites/sampling/bind_join_right.sql
new file mode 100644
index 0000000000..b044495e84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_join_right.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+/* hybridfile can not YQL-17764 */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 3 */
+
+use plato;
+pragma DisableSimpleColumns;
+
+$a = select * from Input where key > "199" and value != "bbb";
+
+select * from (select a.value from Input as a inner join $a as b using(subkey)) tablesample bernoulli(40);
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_multiple_sample.sql b/yql/essentials/tests/sql/suites/sampling/bind_multiple_sample.sql
new file mode 100644
index 0000000000..db9f9cfa16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_multiple_sample.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 20 */
+USE plato;
+
+$var = SELECT * FROM Input;
+
+INSERT INTO @tmp
+SELECT * FROM $var TABLESAMPLE BERNOULLI(100);
+
+INSERT INTO @tmp
+SELECT * FROM $var TABLESAMPLE BERNOULLI(50);
+
+COMMIT;
+
+SELECT * FROM @tmp;
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_small_rate.sql b/yql/essentials/tests/sql/suites/sampling/bind_small_rate.sql
new file mode 100644
index 0000000000..388857feb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_small_rate.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 2 */
+
+$a = select * from plato.Input;
+
+select * from $a tablesample bernoulli(0.1)
diff --git a/yql/essentials/tests/sql/suites/sampling/bind_topsort.sql b/yql/essentials/tests/sql/suites/sampling/bind_topsort.sql
new file mode 100644
index 0000000000..781dd8d100
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/bind_topsort.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+
+$var = SELECT key, value FROM plato.Input;
+
+SELECT * FROM $var TABLESAMPLE BERNOULLI(10) ORDER BY key ASC, value LIMIT 10;
diff --git a/yql/essentials/tests/sql/suites/sampling/default.cfg b/yql/essentials/tests/sql/suites/sampling/default.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/direct_read-dynamic.cfg b/yql/essentials/tests/sql/suites/sampling/direct_read-dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/direct_read-dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/direct_read.cfg b/yql/essentials/tests/sql/suites/sampling/direct_read.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/direct_read.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/direct_read.sql b/yql/essentials/tests/sql/suites/sampling/direct_read.sql
new file mode 100644
index 0000000000..5cfebc5a9f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/direct_read.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+pragma direct_read;
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1);
diff --git a/yql/essentials/tests/sql/suites/sampling/dynamic.txt b/yql/essentials/tests/sql/suites/sampling/dynamic.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/dynamic.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/sampling/dynamic.txt.attr b/yql/essentials/tests/sql/suites/sampling/dynamic.txt.attr
new file mode 100644
index 0000000000..9e3c33c4cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/dynamic.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/sampling/input.txt b/yql/essentials/tests/sql/suites/sampling/input.txt
new file mode 100644
index 0000000000..9e2c7c8718
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/input.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="160";"subkey"="3";"value"="iii"};
+{"key"="170";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/sampling/input1.txt b/yql/essentials/tests/sql/suites/sampling/input1.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/input1.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/sampling/insert.cfg b/yql/essentials/tests/sql/suites/sampling/insert.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/insert.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/insert.sql b/yql/essentials/tests/sql/suites/sampling/insert.sql
new file mode 100644
index 0000000000..0d67d7dbeb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/insert.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+USE plato;
+
+INSERT INTO @tmp
+SELECT * FROM Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1);
+
+COMMIT;
+
+SELECT * FROM @tmp;
diff --git a/yql/essentials/tests/sql/suites/sampling/join_left_sample.sql b/yql/essentials/tests/sql/suites/sampling/join_left_sample.sql
new file mode 100644
index 0000000000..a7a00d57df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/join_left_sample.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+/* ignore plan diff */
+use plato;
+pragma DisableSimpleColumns;
+
+select * from plato.Input as a SAMPLE 0.3
+inner join plato.Input as b
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/join_right_sample.sql b/yql/essentials/tests/sql/suites/sampling/join_right_sample.sql
new file mode 100644
index 0000000000..bc61dc247e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/join_right_sample.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+/* syntax version 1 */
+use plato;
+pragma DisableSimpleColumns;
+
+select * from plato.Input as a
+inner join plato.Input as b SAMPLE 0.3
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/map-dynamic.cfg b/yql/essentials/tests/sql/suites/sampling/map-dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/map-dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/map-keyfilter.cfg b/yql/essentials/tests/sql/suites/sampling/map-keyfilter.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/map-keyfilter.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/map.cfg b/yql/essentials/tests/sql/suites/sampling/map.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/map.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/map.sql b/yql/essentials/tests/sql/suites/sampling/map.sql
new file mode 100644
index 0000000000..cb2ddc5ff4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/map.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 8 */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) WHERE subkey > "1";
diff --git a/yql/essentials/tests/sql/suites/sampling/mapjoin_left_sample.sql b/yql/essentials/tests/sql/suites/sampling/mapjoin_left_sample.sql
new file mode 100644
index 0000000000..d2a55e6993
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/mapjoin_left_sample.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+use plato;
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+select * from plato.Input as a SAMPLE 0.3
+inner join plato.Input as b
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/mapjoin_right_sample.sql b/yql/essentials/tests/sql/suites/sampling/mapjoin_right_sample.sql
new file mode 100644
index 0000000000..43f5dd455f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/mapjoin_right_sample.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+/* syntax version 1 */
+use plato;
+pragma yt.MapJoinLimit="1m";
+pragma DisableSimpleColumns;
+
+select * from plato.Input as a
+inner join plato.Input as b SAMPLE 0.3
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/orderedjoin_left_sample.sql b/yql/essentials/tests/sql/suites/sampling/orderedjoin_left_sample.sql
new file mode 100644
index 0000000000..e38ecc0d0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/orderedjoin_left_sample.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+/* ignore plan diff */
+/* syntax version 1 */
+use plato;
+pragma yt.JoinMergeTablesLimit="2";
+pragma DisableSimpleColumns;
+
+select * from plato.Input as a SAMPLE 0.3
+inner join plato.Input as b
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/orderedjoin_right_sample.sql b/yql/essentials/tests/sql/suites/sampling/orderedjoin_right_sample.sql
new file mode 100644
index 0000000000..001e283204
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/orderedjoin_right_sample.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+/* ignore plan diff */
+/* syntax version 1 */
+use plato;
+pragma yt.JoinMergeTablesLimit="2";
+pragma DisableSimpleColumns;
+
+select * from plato.Input as a
+inner join plato.Input as b SAMPLE 0.3
+on a.key = b.key;
diff --git a/yql/essentials/tests/sql/suites/sampling/read-dynamic.cfg b/yql/essentials/tests/sql/suites/sampling/read-dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/read-dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/read.cfg b/yql/essentials/tests/sql/suites/sampling/read.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/read.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/read.sql b/yql/essentials/tests/sql/suites/sampling/read.sql
new file mode 100644
index 0000000000..1fe51fd9e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/read.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1);
diff --git a/yql/essentials/tests/sql/suites/sampling/reduce-with_premap.cfg b/yql/essentials/tests/sql/suites/sampling/reduce-with_premap.cfg
new file mode 100644
index 0000000000..c85115a8e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/reduce-with_premap.cfg
@@ -0,0 +1,2 @@
+in Input sorted_desc.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/reduce.cfg b/yql/essentials/tests/sql/suites/sampling/reduce.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/reduce.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/reduce.sql b/yql/essentials/tests/sql/suites/sampling/reduce.sql
new file mode 100644
index 0000000000..0f72b64380
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/reduce.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 8 */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+$res = (REDUCE Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) ON key USING $udf(cast(value as uint32) ?? 0));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/sampling/reduce_with_presort.sql b/yql/essentials/tests/sql/suites/sampling/reduce_with_presort.sql
new file mode 100644
index 0000000000..cfdb444c16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/reduce_with_presort.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 8 */
+USE plato;
+
+$udf = YQL::@@(lambda '(key stream) (AsStruct
+ '('key key) '('summ (Collect (Condense stream (Uint32 '0) (lambda '(item state) (Bool 'False)) (lambda '(item state) (Add state item)))))
+))@@;
+
+$res = (REDUCE Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) PRESORT key || subkey ON key USING $udf(cast(value as uint32) ?? 0));
+
+select * from $res order by key;
diff --git a/yql/essentials/tests/sql/suites/sampling/sample.sql b/yql/essentials/tests/sql/suites/sampling/sample.sql
new file mode 100644
index 0000000000..6dd6d7ee31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sample.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT * FROM (SELECT* from Input)
+SAMPLE(0.5)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/sampling/sort.sql b/yql/essentials/tests/sql/suites/sampling/sort.sql
new file mode 100644
index 0000000000..98ea792894
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sort.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) ORDER BY key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/sampling/sorted.txt b/yql/essentials/tests/sql/suites/sampling/sorted.txt
new file mode 100644
index 0000000000..ebb866c3d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sorted.txt
@@ -0,0 +1,10 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="911";"subkey"="2";"value"="kkk"};
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/sampling/sorted.txt.attr b/yql/essentials/tests/sql/suites/sampling/sorted.txt.attr
new file mode 100644
index 0000000000..1d2e02ee20
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sorted.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["subkey"];
+ "SortedBy"=["subkey"];
+ "SortDirections"=[1];
+ "SortedByTypes"=[["DataType";"String"]]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt b/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt
new file mode 100644
index 0000000000..235fc7cd49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt
@@ -0,0 +1,10 @@
+{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"};
+{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"};
+{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"};
+{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt.attr
new file mode 100644
index 0000000000..5a6ca5761e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/sorted_desc.txt.attr
@@ -0,0 +1,47 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_default.sql b/yql/essentials/tests/sql/suites/sampling/subquery_default.sql
new file mode 100644
index 0000000000..60e9adf0f5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_default.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+
+SELECT * FROM (SELECT * FROM plato.Input) TABLESAMPLE BERNOULLI(50);
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_expr.sql b/yql/essentials/tests/sql/suites/sampling/subquery_expr.sql
new file mode 100644
index 0000000000..e9c339b728
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_expr.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+
+$count = SELECT COUNT(*) FROM plato.Input; -- $count = 10
+
+SELECT * FROM (SELECT * FROM plato.Input) TABLESAMPLE BERNOULLI(5 * $count);
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_filter.sql b/yql/essentials/tests/sql/suites/sampling/subquery_filter.sql
new file mode 100644
index 0000000000..54c30b5787
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_filter.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 8 */
+
+select * from (select key from plato.Input where subkey != "1") tablesample bernoulli(44) where key > "50";
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_limit.sql b/yql/essentials/tests/sql/suites/sampling/subquery_limit.sql
new file mode 100644
index 0000000000..9d6d945b11
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_limit.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 6 */
+
+select * from (select * from plato.Input) tablesample bernoulli(80) limit 5;
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_mapjoin.sql b/yql/essentials/tests/sql/suites/sampling/subquery_mapjoin.sql
new file mode 100644
index 0000000000..bd7c425a8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_mapjoin.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+/* hybridfile can not YQL-17764 */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+use plato;
+
+pragma DisableSimpleColumns;
+pragma yt.MapJoinLimit="1m";
+
+select * from(
+select * from plato.Input as a
+inner join plato.Input as b
+on a.key = b.key
+) tablesample bernoulli(30);
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_multiple_sample.sql b/yql/essentials/tests/sql/suites/sampling/subquery_multiple_sample.sql
new file mode 100644
index 0000000000..bc46b5a3eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_multiple_sample.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+
+SELECT * FROM (SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(50)) TABLESAMPLE BERNOULLI(30);
diff --git a/yql/essentials/tests/sql/suites/sampling/subquery_sort.sql b/yql/essentials/tests/sql/suites/sampling/subquery_sort.sql
new file mode 100644
index 0000000000..d322a3822f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/subquery_sort.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+
+select key from (select key, value from plato.Input) tablesample bernoulli(33) order by key;
+
diff --git a/yql/essentials/tests/sql/suites/sampling/system_sampling-io_block_size.cfg b/yql/essentials/tests/sql/suites/sampling/system_sampling-io_block_size.cfg
new file mode 100644
index 0000000000..7544cd7111
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/system_sampling-io_block_size.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+pragma yt.SamplingIoBlockSize="32M"
+providers yt
diff --git a/yql/essentials/tests/sql/suites/sampling/system_sampling.cfg b/yql/essentials/tests/sql/suites/sampling/system_sampling.cfg
new file mode 100644
index 0000000000..5d963ebb21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/system_sampling.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/sampling/system_sampling.sql b/yql/essentials/tests/sql/suites/sampling/system_sampling.sql
new file mode 100644
index 0000000000..edc2038653
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/system_sampling.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 100 */
+/* syntax version 1 */
+USE plato;
+
+EVALUATE FOR $_i IN ListFromRange(0, 10) DO BEGIN
+ INSERT INTO Output
+ SELECT * FROM Input;
+ COMMIT;
+END DO;
+
+SELECT * FROM Output TABLESAMPLE SYSTEM(10);
diff --git a/yql/essentials/tests/sql/suites/sampling/table_content.cfg b/yql/essentials/tests/sql/suites/sampling/table_content.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/table_content.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/table_content.sql b/yql/essentials/tests/sql/suites/sampling/table_content.sql
new file mode 100644
index 0000000000..b0aff15615
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/table_content.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) == 1 */
+use plato;
+
+$key = (select key from plato.Input SAMPLE(0.5));
+
+select * from Input where key = $key;
diff --git a/yql/essentials/tests/sql/suites/sampling/take_with_sampling.sql b/yql/essentials/tests/sql/suites/sampling/take_with_sampling.sql
new file mode 100644
index 0000000000..123aabdbb0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/take_with_sampling.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) LIMIT 10; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/sampling/topsort.sql b/yql/essentials/tests/sql/suites/sampling/topsort.sql
new file mode 100644
index 0000000000..1acbb70faa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/topsort.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(30) REPEATABLE(1) ORDER BY key LIMIT 10; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/sampling/yql-14664_deps.sql b/yql/essentials/tests/sql/suites/sampling/yql-14664_deps.sql
new file mode 100644
index 0000000000..1ce0ee9463
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/yql-14664_deps.sql
@@ -0,0 +1,20 @@
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 10 */
+USE plato;
+
+INSERT INTO @a
+SELECT
+ *
+FROM Input
+WHERE key > "020";
+
+COMMIT;
+
+SELECT
+ *
+FROM (
+ SELECT
+ *
+ FROM @a
+ TABLESAMPLE BERNOULLI(50.0) REPEATABLE(1)
+) LIMIT 10
diff --git a/yql/essentials/tests/sql/suites/sampling/zero_percentage.cfg b/yql/essentials/tests/sql/suites/sampling/zero_percentage.cfg
new file mode 100644
index 0000000000..3f5bebb5a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/zero_percentage.cfg
@@ -0,0 +1,2 @@
+in Input sorted.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/sampling/zero_percentage.sql b/yql/essentials/tests/sql/suites/sampling/zero_percentage.sql
new file mode 100644
index 0000000000..43693ecd77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/sampling/zero_percentage.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT * FROM plato.Input TABLESAMPLE BERNOULLI(0) ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/schema/append_to_desc.cfg b/yql/essentials/tests/sql/suites/schema/append_to_desc.cfg
new file mode 100644
index 0000000000..96bf89fe0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/append_to_desc.cfg
@@ -0,0 +1,2 @@
+in Input descending.txt
+out Output descending.txt
diff --git a/yql/essentials/tests/sql/suites/schema/append_to_desc.sql b/yql/essentials/tests/sql/suites/schema/append_to_desc.sql
new file mode 100644
index 0000000000..61480975cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/append_to_desc.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+insert into Output
+select * from Input
+order by key desc, subkey desc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.cfg b/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.cfg
new file mode 100644
index 0000000000..96bf89fe0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.cfg
@@ -0,0 +1,2 @@
+in Input descending.txt
+out Output descending.txt
diff --git a/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.sql b/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.sql
new file mode 100644
index 0000000000..0b315899d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/append_to_desc_with_remap.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+USE plato;
+
+insert into Output
+select * from Input
+where key > "000"
+order by key desc, subkey desc; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/concat.cfg b/yql/essentials/tests/sql/suites/schema/concat.cfg
new file mode 100644
index 0000000000..a9740fa8b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/concat.cfg
@@ -0,0 +1,2 @@
+in InputGood input_good.txt
+in InputBad input_bad.txt
diff --git a/yql/essentials/tests/sql/suites/schema/concat.sql b/yql/essentials/tests/sql/suites/schema/concat.sql
new file mode 100644
index 0000000000..4e6fe0fddd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/concat.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+USE plato;
+
+SELECT id1 FROM CONCAT(InputGood, InputBad);
diff --git a/yql/essentials/tests/sql/suites/schema/copy-other.cfg b/yql/essentials/tests/sql/suites/schema/copy-other.cfg
new file mode 100644
index 0000000000..5529b28815
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/copy-other.cfg
@@ -0,0 +1,2 @@
+in Input read_schema_other.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/copy-read_schema.cfg b/yql/essentials/tests/sql/suites/schema/copy-read_schema.cfg
new file mode 100644
index 0000000000..3ebcb3bb45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/copy-read_schema.cfg
@@ -0,0 +1,2 @@
+in Input read_schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/copy-schema.cfg b/yql/essentials/tests/sql/suites/schema/copy-schema.cfg
new file mode 100644
index 0000000000..80ffec4b32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/copy-schema.cfg
@@ -0,0 +1,2 @@
+in Input schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/copy-yamred_dsv_raw.cfg b/yql/essentials/tests/sql/suites/schema/copy-yamred_dsv_raw.cfg
new file mode 100644
index 0000000000..0cad3cec7d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/copy-yamred_dsv_raw.cfg
@@ -0,0 +1,2 @@
+in Input yamred_dsv_raw.txt yamred_dsv
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/copy.sql b/yql/essentials/tests/sql/suites/schema/copy.sql
new file mode 100644
index 0000000000..90d80ae84a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/copy.sql
@@ -0,0 +1,3 @@
+insert into plato.Output
+select * from plato.Input
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/schema/def_values.cfg b/yql/essentials/tests/sql/suites/schema/def_values.cfg
new file mode 100644
index 0000000000..2578259926
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values.cfg
@@ -0,0 +1 @@
+in Input def_values.txt
diff --git a/yql/essentials/tests/sql/suites/schema/def_values.sql b/yql/essentials/tests/sql/suites/schema/def_values.sql
new file mode 100644
index 0000000000..327a664434
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/def_values.txt b/yql/essentials/tests/sql/suites/schema/def_values.txt
new file mode 100644
index 0000000000..be88432c29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values.txt
@@ -0,0 +1,6 @@
+{"key"="2";"value"="4";"subkey"="123"};
+{"key"="1"};
+{"subkey"="2"};
+{"value"="4"};
+{};
+{"key"=#;"value"=#;"subkey"=#}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/def_values.txt.attr b/yql/essentials/tests/sql/suites/schema/def_values.txt.attr
new file mode 100644
index 0000000000..c54e9fca8f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values.txt.attr
@@ -0,0 +1,19 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ "DefaultValues"={
+ "key"="\"def_key\"";
+ "subkey"="\"def_subkey\"";
+ "value"="\"def_value\"";
+ };
+ };
+ "schema"=<"strict" = %true> [
+ {"type"="string"; "name"="key"};
+ {"type"="string"; "name"="subkey"};
+ {"type"="string"; "name"="value"}
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/def_values_job.cfg b/yql/essentials/tests/sql/suites/schema/def_values_job.cfg
new file mode 100644
index 0000000000..2578259926
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values_job.cfg
@@ -0,0 +1 @@
+in Input def_values.txt
diff --git a/yql/essentials/tests/sql/suites/schema/def_values_job.sql b/yql/essentials/tests/sql/suites/schema/def_values_job.sql
new file mode 100644
index 0000000000..7165961a6f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/def_values_job.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input where key != "fake";
diff --git a/yql/essentials/tests/sql/suites/schema/default.cfg b/yql/essentials/tests/sql/suites/schema/default.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/default.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/descending.txt b/yql/essentials/tests/sql/suites/schema/descending.txt
new file mode 100644
index 0000000000..8e63b46e56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/descending.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="020";"subkey"="1";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/schema/descending.txt.attr b/yql/essentials/tests/sql/suites/schema/descending.txt.attr
new file mode 100644
index 0000000000..7024a9fc9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/descending.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "descending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.cfg b/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.sql b/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.sql
new file mode 100644
index 0000000000..407dff9475
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/diffrerent_schemas.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+USE plato;
+SELECT * FROM Input WITH SCHEMA Struct<key:String, subkey:String>;
+SELECT * FROM Input WITH SCHEMA Struct<key:String, value:String>;
+
diff --git a/yql/essentials/tests/sql/suites/schema/empty.txt b/yql/essentials/tests/sql/suites/schema/empty.txt
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/empty.txt
@@ -0,0 +1 @@
+{}
diff --git a/yql/essentials/tests/sql/suites/schema/empty.txt.attr b/yql/essentials/tests/sql/suites/schema/empty.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/empty.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt b/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt.attr b/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/empty_no_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/fake_column.sql b/yql/essentials/tests/sql/suites/schema/fake_column.sql
new file mode 100644
index 0000000000..21c745b27e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/fake_column.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+insert into @tmp
+select * from (
+ select <||> as a
+) flatten columns;
+
+commit;
+
+select 1 as a from @tmp;
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema.txt b/yql/essentials/tests/sql/suites/schema/inferschema.txt
new file mode 100644
index 0000000000..740bf0ddd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema.txt.attr b/yql/essentials/tests/sql/suites/schema/inferschema.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema2.txt b/yql/essentials/tests/sql/suites/schema/inferschema2.txt
new file mode 100644
index 0000000000..1c5a93c6c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema2.txt
@@ -0,0 +1,5 @@
+{"a"=2;"b"=5u;"d"="skdjfnsdf"};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"={"xyz"="zxy"}};
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"={"a"=0.123}};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema2.txt.attr b/yql/essentials/tests/sql/suites/schema/inferschema2.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt b/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt
new file mode 100644
index 0000000000..1ddba983c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{"x"=22};
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt.attr b/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema_extra_field.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt b/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt
new file mode 100644
index 0000000000..868d0aad6c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt
@@ -0,0 +1,6 @@
+{};
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt.attr b/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/inferschema_no_fields.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/input.txt b/yql/essentials/tests/sql/suites/schema/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/schema/input_bad.txt b/yql/essentials/tests/sql/suites/schema/input_bad.txt
new file mode 100644
index 0000000000..04b7336aa9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_bad.txt
@@ -0,0 +1 @@
+{"dates"=#;"id1"="4657454";};
diff --git a/yql/essentials/tests/sql/suites/schema/input_bad.txt.attr b/yql/essentials/tests/sql/suites/schema/input_bad.txt.attr
new file mode 100644
index 0000000000..c858a649c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_bad.txt.attr
@@ -0,0 +1,6 @@
+{
+ "schema" = [
+ {"required"=%false; "type"="any"; "name"="dates"};
+ {"required"=%false; "type"="string"; "name"="id1"};
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/schema/input_good.txt b/yql/essentials/tests/sql/suites/schema/input_good.txt
new file mode 100644
index 0000000000..e588868424
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_good.txt
@@ -0,0 +1,2 @@
+{"dates"=["2016-04-11"];"id1"="40684420";"IsValid"=%true};
+{"dates"=["2016-04-11"];"id1"="41885493";"IsValid"=%true};
diff --git a/yql/essentials/tests/sql/suites/schema/input_good.txt.attr b/yql/essentials/tests/sql/suites/schema/input_good.txt.attr
new file mode 100644
index 0000000000..431dd78c84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_good.txt.attr
@@ -0,0 +1,15 @@
+{
+ "_yql_row_spec" = {
+ "StrictSchema"=%true;
+ "Type"=["StructType";[
+ ["IsValid";["DataType";"Bool"]];
+ ["dates";["ListType";["DataType";"String"]]];
+ ["id1";["OptionalType";["DataType";"String"]]];
+ ]];
+ };
+ "schema" = [
+ {"required"=%false; "type"="any"; "name"="dates"};
+ {"required"=%false; "type"="string"; "name"="id1"};
+ {"required"=%true; "type"="boolean"; "name"="IsValid"};
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/schema/input_no_schema.txt b/yql/essentials/tests/sql/suites/schema/input_no_schema.txt
new file mode 100644
index 0000000000..073076680b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_no_schema.txt
@@ -0,0 +1,4 @@
+{"key"="020"};
+{"key"="075";"subkey"="1";"value1"="abc"};
+{"key"="150";"subkey"="2";"value1"="qzz"};
+{"key"="800";"subkey"="4";"value1"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/input_no_schema.txt.attr b/yql/essentials/tests/sql/suites/schema/input_no_schema.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/input_no_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/schema/insert-read_schema.cfg b/yql/essentials/tests/sql/suites/schema/insert-read_schema.cfg
new file mode 100644
index 0000000000..3ebcb3bb45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert-read_schema.cfg
@@ -0,0 +1,2 @@
+in Input read_schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert-row_spec.cfg b/yql/essentials/tests/sql/suites/schema/insert-row_spec.cfg
new file mode 100644
index 0000000000..82e876ad52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert-row_spec.cfg
@@ -0,0 +1,2 @@
+in Input row_spec.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert-schema.cfg b/yql/essentials/tests/sql/suites/schema/insert-schema.cfg
new file mode 100644
index 0000000000..80ffec4b32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert-schema.cfg
@@ -0,0 +1,2 @@
+in Input schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert.sql b/yql/essentials/tests/sql/suites/schema/insert.sql
new file mode 100644
index 0000000000..0ea3cadf0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert.sql
@@ -0,0 +1,4 @@
+/* multirun can not */
+insert into plato.Output select * from plato.Input where a is not null;
+commit;
+select * from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/schema/insert_sorted-read_schema.cfg b/yql/essentials/tests/sql/suites/schema/insert_sorted-read_schema.cfg
new file mode 100644
index 0000000000..3ebcb3bb45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert_sorted-read_schema.cfg
@@ -0,0 +1,2 @@
+in Input read_schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert_sorted-row_spec.cfg b/yql/essentials/tests/sql/suites/schema/insert_sorted-row_spec.cfg
new file mode 100644
index 0000000000..82e876ad52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert_sorted-row_spec.cfg
@@ -0,0 +1,2 @@
+in Input row_spec.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert_sorted-schema.cfg b/yql/essentials/tests/sql/suites/schema/insert_sorted-schema.cfg
new file mode 100644
index 0000000000..80ffec4b32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert_sorted-schema.cfg
@@ -0,0 +1,2 @@
+in Input schema.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/schema/insert_sorted.sql b/yql/essentials/tests/sql/suites/schema/insert_sorted.sql
new file mode 100644
index 0000000000..f93a54e166
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/insert_sorted.sql
@@ -0,0 +1,4 @@
+/* multirun can not */
+insert into plato.Output select * from plato.Input order by d, a, b, c;
+commit;
+select * from plato.Output;
diff --git a/yql/essentials/tests/sql/suites/schema/limit_directread.cfg b/yql/essentials/tests/sql/suites/schema/limit_directread.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/limit_directread.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/limit_directread.sql b/yql/essentials/tests/sql/suites/schema/limit_directread.sql
new file mode 100644
index 0000000000..f083e0bbc0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/limit_directread.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+pragma directread;
+select * from `Input` limit 3;
diff --git a/yql/essentials/tests/sql/suites/schema/limit_simple.cfg b/yql/essentials/tests/sql/suites/schema/limit_simple.cfg
new file mode 100644
index 0000000000..128536d9eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/limit_simple.cfg
@@ -0,0 +1 @@
+in Input read_schema_no_any.txt
diff --git a/yql/essentials/tests/sql/suites/schema/limit_simple.sql b/yql/essentials/tests/sql/suites/schema/limit_simple.sql
new file mode 100644
index 0000000000..b9eeaad952
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/limit_simple.sql
@@ -0,0 +1,2 @@
+use plato;
+select a from Input limit 3;
diff --git a/yql/essentials/tests/sql/suites/schema/other.cfg b/yql/essentials/tests/sql/suites/schema/other.cfg
new file mode 100644
index 0000000000..4035425a79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other.cfg
@@ -0,0 +1,3 @@
+in Input1 other1.txt
+in Input2 other2.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/schema/other.sql b/yql/essentials/tests/sql/suites/schema/other.sql
new file mode 100644
index 0000000000..1412b0692f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other.sql
@@ -0,0 +1 @@
+select key, _other from plato.range(``, Input1, Input2); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/other1.txt b/yql/essentials/tests/sql/suites/schema/other1.txt
new file mode 100644
index 0000000000..42c5393923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other1.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value1"="q"};
+{"key"="075";"subkey"="1";"value1"="abc"};
+{"key"="150";"subkey"="4";"value1"="qzz"};
+{"key"="800";"subkey"="2";"value1"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/other1.txt.attr b/yql/essentials/tests/sql/suites/schema/other1.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other1.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/other2.txt b/yql/essentials/tests/sql/suites/schema/other2.txt
new file mode 100644
index 0000000000..1fa10bf270
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other2.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value2"="q"};
+{"key"="075";"subkey"="1";"value2"="abc"};
+{"key"="150";"subkey"="4";"value2"="qzz"};
+{"key"="800";"subkey"="2";"value2"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/other2.txt.attr b/yql/essentials/tests/sql/suites/schema/other2.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other2.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/other_job.cfg b/yql/essentials/tests/sql/suites/schema/other_job.cfg
new file mode 100644
index 0000000000..4035425a79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other_job.cfg
@@ -0,0 +1,3 @@
+in Input1 other1.txt
+in Input2 other2.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/schema/other_job.sql b/yql/essentials/tests/sql/suites/schema/other_job.sql
new file mode 100644
index 0000000000..22dc1e1bae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/other_job.sql
@@ -0,0 +1 @@
+select key, _other from plato.range(``, Input1, Input2) where key != "fake";
diff --git a/yql/essentials/tests/sql/suites/schema/patched1.txt b/yql/essentials/tests/sql/suites/schema/patched1.txt
new file mode 100644
index 0000000000..ed383983fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched1.txt
@@ -0,0 +1 @@
+{"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/schema/patched1.txt.attr b/yql/essentials/tests/sql/suites/schema/patched1.txt.attr
new file mode 100644
index 0000000000..4590bb2e0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched1.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string"};
+ {"name"="subkey";"type"="string"};
+ {"name"="value";"type"="string"};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/patched2.txt b/yql/essentials/tests/sql/suites/schema/patched2.txt
new file mode 100644
index 0000000000..ed383983fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched2.txt
@@ -0,0 +1 @@
+{"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/schema/patched2.txt.attr b/yql/essentials/tests/sql/suites/schema/patched2.txt.attr
new file mode 100644
index 0000000000..2ee1e38628
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched2.txt.attr
@@ -0,0 +1,11 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="subkey";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/patched3.txt b/yql/essentials/tests/sql/suites/schema/patched3.txt
new file mode 100644
index 0000000000..ed383983fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched3.txt
@@ -0,0 +1 @@
+{"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/schema/patched3.txt.attr b/yql/essentials/tests/sql/suites/schema/patched3.txt.attr
new file mode 100644
index 0000000000..5712df5e2d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched3.txt.attr
@@ -0,0 +1,15 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="subkey";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[
+ ]];
+ "SortedBy"=["key"];
+ "SortDirections"=[1];
+ "SortMembers"=["key"];
+ "SortedByTypes"=[["DataType";"String"]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/patched4.txt b/yql/essentials/tests/sql/suites/schema/patched4.txt
new file mode 100644
index 0000000000..47435e8f8f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched4.txt
@@ -0,0 +1 @@
+{"_yql_column_0"="\xE0\xC7\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/patched4.txt.attr b/yql/essentials/tests/sql/suites/schema/patched4.txt.attr
new file mode 100644
index 0000000000..8002bb3a8d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched4.txt.attr
@@ -0,0 +1,15 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="_yql_column_0";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="key";"type"="string";"required"=%true};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[]];
+ "SortMembers"=["key"];
+ "SortedBy"=["_yql_column_0"];
+ "SortDirections"=[0];
+ "SortedByTypes"=[["DataType";"String"]];
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/patched5.txt b/yql/essentials/tests/sql/suites/schema/patched5.txt
new file mode 100644
index 0000000000..7edc78581b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched5.txt
@@ -0,0 +1 @@
+{"any_column"={"this"=["is";{"unstructured"="value";};];};"boolean_column"=%true;"date_column"=2131u;"double_column"=3.14;"int64_column"=-64;"interval_column"=123131123;"list_column"=[%true;%false;];"null_column"=#;"optional_column"="foo";"string_column"="txt";};
diff --git a/yql/essentials/tests/sql/suites/schema/patched5.txt.attr b/yql/essentials/tests/sql/suites/schema/patched5.txt.attr
new file mode 100644
index 0000000000..9d5ab09f10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched5.txt.attr
@@ -0,0 +1,22 @@
+{
+ "schema"=<"strict" = %true;"unique_keys" = %false;>[
+ {"type" = "any";"required" = %false;"name" = "any_column";};
+ {"type" = "boolean";"required" = %true;"name" = "boolean_column";};
+ {"type" = "uint16";"required" = %true;"name" = "date_column";};
+ {"type" = "double";"required" = %true;"name" = "double_column";};
+ {"type" = "int64";"required" = %true;"name" = "int64_column";};
+ {"type" = "int64";"required" = %true;"name" = "interval_column";};
+ {"type" = "any";"required" = %false;"name" = "list_column";};
+ {"type" = "any";"required" = %false;"name" = "null_column";};
+ {"type" = "utf8";"required" = %false;"name" = "optional_column";};
+ {"type" = "string";"required" = %true;"name" = "string_column";};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[
+ ["null_column";["NullType";];];
+ ["list_column";["ListType";["DataType";"Bool"]];];
+ ["interval_column";["DataType";"Interval";];];
+ ["date_column";["DataType";"Date";];];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/patched6.txt b/yql/essentials/tests/sql/suites/schema/patched6.txt
new file mode 100644
index 0000000000..e76546baa4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched6.txt
@@ -0,0 +1 @@
+{"_yql_column_0"="1800";"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/patched6.txt.attr b/yql/essentials/tests/sql/suites/schema/patched6.txt.attr
new file mode 100644
index 0000000000..75ac5aeb7d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patched6.txt.attr
@@ -0,0 +1,15 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="_yql_column_0";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="key";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "TypePatch"=["StructType";[]];
+ "SortMembers"=[];
+ "SortedBy"=["_yql_column_0";"key"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"];["DataType";"String"]];
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/patchtype.cfg b/yql/essentials/tests/sql/suites/schema/patchtype.cfg
new file mode 100644
index 0000000000..f623e8ac73
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patchtype.cfg
@@ -0,0 +1,6 @@
+in Input1 patched1.txt
+in Input2 patched2.txt
+in Input3 patched3.txt
+in Input4 patched4.txt
+in Input5 patched5.txt
+in Input6 patched6.txt
diff --git a/yql/essentials/tests/sql/suites/schema/patchtype.sql b/yql/essentials/tests/sql/suites/schema/patchtype.sql
new file mode 100644
index 0000000000..637cdfbebf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/patchtype.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+SELECT key, subkey, value FROM Input1;
+SELECT key, subkey, value FROM Input2;
+SELECT key, subkey, value FROM Input3;
+SELECT key, subkey, value FROM Input4;
+SELECT any_column, boolean_column, date_column, double_column, int64_column, interval_column, list_column, null_column, optional_column, string_column FROM Input5;
+SELECT key, subkey, value FROM Input6;
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema.txt b/yql/essentials/tests/sql/suites/schema/read_schema.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema.txt.attr b/yql/essentials/tests/sql/suites/schema/read_schema.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_change_other.cfg b/yql/essentials/tests/sql/suites/schema/read_schema_change_other.cfg
new file mode 100644
index 0000000000..2ab8a973ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_change_other.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input read_schema_other.txt
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_change_other.sql b/yql/essentials/tests/sql/suites/schema/read_schema_change_other.sql
new file mode 100644
index 0000000000..7be00eab9c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_change_other.sql
@@ -0,0 +1 @@
+select * from plato.Input with schema Struct<_other:Yson>;
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt b/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt
new file mode 100644
index 0000000000..c245b88bd8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt.attr b/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt.attr
new file mode 100644
index 0000000000..0d717f80ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_no_any.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_other.cfg b/yql/essentials/tests/sql/suites/schema/read_schema_other.cfg
new file mode 100644
index 0000000000..64822f8de1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_other.cfg
@@ -0,0 +1 @@
+in Input read_schema_other.txt
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_other.sql b/yql/essentials/tests/sql/suites/schema/read_schema_other.sql
new file mode 100644
index 0000000000..87b80f3c30
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_other.sql
@@ -0,0 +1 @@
+select ListSort(DictItems(_other)) as other from plato.Input order by other;
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_other.txt b/yql/essentials/tests/sql/suites/schema/read_schema_other.txt
new file mode 100644
index 0000000000..2d51827263
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_other.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123;"x"=1};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz";"y"="test"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false;"y"="Y";"x"=2};
+{"y"=""};
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_other.txt.attr b/yql/essentials/tests/sql/suites/schema/read_schema_other.txt.attr
new file mode 100644
index 0000000000..8a1a87469b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_other.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=<"strict" = "false";>[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt b/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt
new file mode 100644
index 0000000000..7d4ce31a5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt
@@ -0,0 +1,6 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
+{"key"="075";"subkey"="5";"value"="q"};
+{"key"="100";"subkey"="6";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt.attr b/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt.attr
new file mode 100644
index 0000000000..dd019afccd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/read_schema_partial.txt.attr
@@ -0,0 +1,6 @@
+{
+ "_read_schema"=[
+ {"name"="key";"type"="string"};
+ {"name"="value";"type"="string"};
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/remap_desc.cfg b/yql/essentials/tests/sql/suites/schema/remap_desc.cfg
new file mode 100644
index 0000000000..27e2b96813
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/remap_desc.cfg
@@ -0,0 +1 @@
+in Input descending.txt
diff --git a/yql/essentials/tests/sql/suites/schema/remap_desc.sql b/yql/essentials/tests/sql/suites/schema/remap_desc.sql
new file mode 100644
index 0000000000..23f8492ae2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/remap_desc.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+USE plato;
+
+select TableName() as tn, t.*
+from concat(Input, Input) as t;
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec.txt b/yql/essentials/tests/sql/suites/schema/row_spec.txt
new file mode 100644
index 0000000000..740bf0ddd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec.txt.attr
new file mode 100644
index 0000000000..d2878eb9a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_yql_row_spec"={"Type"=["StructType";[["a"; ["OptionalType"; ["DataType"; "Int64"]]]; ["b"; ["OptionalType"; ["DataType"; "Uint64"]]]; ["c"; ["OptionalType"; ["DataType"; "Double"]]]; ["d"; ["OptionalType"; ["DataType"; "String"]]]; ["e"; ["OptionalType"; ["DataType"; "Bool"]]]; ["f"; ["OptionalType"; ["DataType"; "Yson"]]]]]; "UniqueKeys"=%false}
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt
new file mode 100644
index 0000000000..2b972cbab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt.attr
new file mode 100644
index 0000000000..86ef9822bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort.txt.attr
@@ -0,0 +1,18 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ "SortedBy"=["key";"subkey"];
+ "SortDirections"=[1;1];
+ "SortMembers"=["key";"subkey"];
+ "SortedByTypes"=[["DataType";"String"];["DataType";"String"]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt
new file mode 100644
index 0000000000..2b972cbab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt.attr
new file mode 100644
index 0000000000..633e8fe403
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort2.txt.attr
@@ -0,0 +1,19 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="subkey";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="key";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ "TypePatch"=["StructType";[]];
+ "SortedBy"=["key";"subkey"];
+ "SortDirections"=[1;1];
+ "SortMembers"=["key";"subkey"];
+ "SortedByTypes"=[["DataType";"String"];["DataType";"String"]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt
new file mode 100644
index 0000000000..f62e8e8df4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt
@@ -0,0 +1,4 @@
+{"_yql_column_0"="\xE0\xCF\xCD\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="020";"subkey"="3";"value"="q"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="150";"subkey"="4";"value"="qzz"};
+{"_yql_column_0"="\xE0\xC7\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt.attr
new file mode 100644
index 0000000000..6e70786e68
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_diff_sort_desc.txt.attr
@@ -0,0 +1,25 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true;"sort_order"="ascending"};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ {"name"="_yql_column_0";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec" = {
+ "SortMembers" = ["key"];
+ "SortDirections" = [0];
+ "UniqueKeys" = %false;
+ "Type" = ["StructType";[
+ ["key"; ["DataType";"String"]];
+ ["subkey"; ["DataType";"String"]];
+ ["value"; ["DataType";"String"]];
+ ]];
+ "TypePath" = ["StructType";[]];
+ "SortedByTypes" = [
+ ["DataType";"String"]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt b/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt
new file mode 100644
index 0000000000..2b972cbab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt.attr
new file mode 100644
index 0000000000..aefafb171b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_extra_sort.txt.attr
@@ -0,0 +1,18 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ "SortedBy"=["key"];
+ "SortDirections"=[1];
+ "SortMembers"=["key"];
+ "SortedByTypes"=[["DataType";"String"]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt b/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt
new file mode 100644
index 0000000000..2b972cbab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt.attr
new file mode 100644
index 0000000000..f1cc5f542d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_hide_sort.txt.attr
@@ -0,0 +1,12 @@
+{
+ "schema"=<"strict"=%false; "schema_mode"="weak"; "unique_keys"=%false>[
+ {"name"="key";"type"="any";"required"=%false;"sort_order"="ascending"};
+ ];
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_part.txt b/yql/essentials/tests/sql/suites/schema/row_spec_part.txt
new file mode 100644
index 0000000000..2b972cbab7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_part.txt
@@ -0,0 +1,2 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_part.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_part.txt.attr
new file mode 100644
index 0000000000..6216178a50
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_part.txt.attr
@@ -0,0 +1,12 @@
+{
+ "schema"=<"strict"=%true; "unique_keys"=%false>[
+ {"name"="key";"type"="string";"required"=%true};
+ {"name"="subkey";"type"="string";"required"=%true};
+ {"name"="value";"type"="string";"required"=%true};
+ ];
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ]];
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.cfg b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.cfg
new file mode 100644
index 0000000000..00014cad5b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.cfg
@@ -0,0 +1 @@
+in Input row_spec_with_default_values.txt
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.sql b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.sql
new file mode 100644
index 0000000000..684733fe7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.sql
@@ -0,0 +1 @@
+select * from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt
new file mode 100644
index 0000000000..5a5fca5c32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt
@@ -0,0 +1,2 @@
+{"key"="1";value="3"};
+{"key"="2";value="4";"subkey"="123"};
diff --git a/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt.attr b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt.attr
new file mode 100644
index 0000000000..c59e495acf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/row_spec_with_default_values.txt.attr
@@ -0,0 +1,19 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String";];];
+ ["subkey";["DataType";"String";];];
+ ["value";["DataType";"String";];];
+ ]];
+ "SortedBy"=["key";"subkey";];
+ "SortDirections"=[1;1;];
+ "SortMembers"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "DefaultValues"={"key"="\"\"";"subkey"="\"\"";"value"="\"\"";};
+ };
+ "schema"=<"strict" = %true> [
+ {"type"="string"; "name"="key"; "sort_order"="ascending"};
+ {"type"="string"; "name"="subkey"; "sort_order"="ascending"};
+ {"type"="string"; "name"="value"}
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/schema.txt b/yql/essentials/tests/sql/suites/schema/schema.txt
new file mode 100644
index 0000000000..740bf0ddd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/schema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf"};
+{};
diff --git a/yql/essentials/tests/sql/suites/schema/schema.txt.attr b/yql/essentials/tests/sql/suites/schema/schema.txt.attr
new file mode 100644
index 0000000000..ec236b37ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-read_schema.cfg b/yql/essentials/tests/sql/suites/schema/select_all-read_schema.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-read_schema.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec.cfg
new file mode 100644
index 0000000000..32ba245472
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec.cfg
@@ -0,0 +1 @@
+in Input row_spec.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort.cfg
new file mode 100644
index 0000000000..6ddab148ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort.cfg
@@ -0,0 +1 @@
+in Input row_spec_diff_sort.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort2.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort2.cfg
new file mode 100644
index 0000000000..65f896224f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort2.cfg
@@ -0,0 +1 @@
+in Input row_spec_diff_sort2.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort_desc.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort_desc.cfg
new file mode 100644
index 0000000000..5c62b38d77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_diff_sort_desc.cfg
@@ -0,0 +1 @@
+in Input row_spec_diff_sort_desc.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_extra_sort.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_extra_sort.cfg
new file mode 100644
index 0000000000..69bdda2fb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_extra_sort.cfg
@@ -0,0 +1 @@
+in Input row_spec_extra_sort.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_hide_sort.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_hide_sort.cfg
new file mode 100644
index 0000000000..53f9c737ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_hide_sort.cfg
@@ -0,0 +1 @@
+in Input row_spec_hide_sort.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-row_spec_part.cfg b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_part.cfg
new file mode 100644
index 0000000000..f55b54f2a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-row_spec_part.cfg
@@ -0,0 +1 @@
+in Input row_spec_part.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-schema.cfg b/yql/essentials/tests/sql/suites/schema/select_all-schema.cfg
new file mode 100644
index 0000000000..4e26fdc668
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-schema.cfg
@@ -0,0 +1 @@
+in Input schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv.cfg b/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv.cfg
new file mode 100644
index 0000000000..ea928dac01
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv.cfg
@@ -0,0 +1 @@
+in Input yamred_dsv.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv_raw.cfg b/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv_raw.cfg
new file mode 100644
index 0000000000..f3f737a2ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all-yamred_dsv_raw.cfg
@@ -0,0 +1 @@
+in Input yamred_dsv_raw.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/schema/select_all.sql b/yql/essentials/tests/sql/suites/schema/select_all.sql
new file mode 100644
index 0000000000..684733fe7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all.sql
@@ -0,0 +1 @@
+select * from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.cfg b/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.cfg
new file mode 100644
index 0000000000..eeacd081d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.cfg
@@ -0,0 +1,4 @@
+in Input inferschema2.txt
+in Input2 inferschema2.txt
+in Input3 inferschema2.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.sql b/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.sql
new file mode 100644
index 0000000000..797cbb1364
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_forceinferschema.sql
@@ -0,0 +1,3 @@
+select * from plato.Input with forceinferschema;
+select * from plato.Input2 with forceinferschema="2";
+select * from plato.Input3 with forceinferschema="3";
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema-extra_field.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema-extra_field.cfg
new file mode 100644
index 0000000000..312ba32bff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema-extra_field.cfg
@@ -0,0 +1 @@
+in Input inferschema_extra_field.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema-no_fields.cfg-disabled b/yql/essentials/tests/sql/suites/schema/select_all_inferschema-no_fields.cfg-disabled
new file mode 100644
index 0000000000..baf0c61076
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema-no_fields.cfg-disabled
@@ -0,0 +1 @@
+in Input inferschema_no_fields.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema.cfg
new file mode 100644
index 0000000000..0d7add8b04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema.cfg
@@ -0,0 +1 @@
+in Input inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema.sql
new file mode 100644
index 0000000000..a053d0d08a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema.sql
@@ -0,0 +1 @@
+select * from plato.Input with inferscheme;
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.cfg
new file mode 100644
index 0000000000..80edd303eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.cfg
@@ -0,0 +1,2 @@
+in Input2 inferschema2.txt
+in Input3 inferschema2.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.sql
new file mode 100644
index 0000000000..79e591518e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema2.sql
@@ -0,0 +1,2 @@
+select * from plato.Input2 with inferschema="2";
+select * from plato.Input3 with inferschema="3";
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.cfg
new file mode 100644
index 0000000000..0d7add8b04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.cfg
@@ -0,0 +1 @@
+in Input inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.sql
new file mode 100644
index 0000000000..dd3951e482
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_limit.sql
@@ -0,0 +1 @@
+select * from plato.Input with inferscheme limit 2;
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.cfg
new file mode 100644
index 0000000000..0d7add8b04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.cfg
@@ -0,0 +1 @@
+in Input inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.sql
new file mode 100644
index 0000000000..ad16b10591
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* kikimr can not */
+pragma yt.InferSchemaTableCountThreshold="0";
+
+select * from plato.Input with inferscheme;
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.cfg
new file mode 100644
index 0000000000..0d7add8b04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.cfg
@@ -0,0 +1 @@
+in Input inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.sql
new file mode 100644
index 0000000000..b1588fd8c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_op_custom_tmp.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* kikimr can not */
+pragma yt.InferSchemaTableCountThreshold="0";
+pragma yt.TmpFolder="custom";
+
+select * from plato.Input with inferscheme;
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range-empty_fail.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range-empty_fail.cfg
new file mode 100644
index 0000000000..c2ff0dfe88
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range-empty_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input1 inferschema.txt
+in Input2 empty.txt
+in Input3 inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.cfg b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.cfg
new file mode 100644
index 0000000000..e0dbc3b2d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.cfg
@@ -0,0 +1,3 @@
+in Input1 inferschema.txt
+in Input2 inferschema.txt
+in Input3 inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.sql b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.sql
new file mode 100644
index 0000000000..a610f9cedb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_all_inferschema_range.sql
@@ -0,0 +1,2 @@
+pragma yt.InferSchemaTableCountThreshold="0";
+select * from plato.range(``, Input1, Input3) with inferscheme;
diff --git a/yql/essentials/tests/sql/suites/schema/select_field-read_schema.cfg b/yql/essentials/tests/sql/suites/schema/select_field-read_schema.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_field-read_schema.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_field-row_spec.cfg b/yql/essentials/tests/sql/suites/schema/select_field-row_spec.cfg
new file mode 100644
index 0000000000..32ba245472
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_field-row_spec.cfg
@@ -0,0 +1 @@
+in Input row_spec.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_field-schema.cfg b/yql/essentials/tests/sql/suites/schema/select_field-schema.cfg
new file mode 100644
index 0000000000..4e26fdc668
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_field-schema.cfg
@@ -0,0 +1 @@
+in Input schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_field.sql b/yql/essentials/tests/sql/suites/schema/select_field.sql
new file mode 100644
index 0000000000..ea246caffb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_field.sql
@@ -0,0 +1 @@
+select a from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.cfg b/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.cfg
new file mode 100644
index 0000000000..0d7add8b04
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.cfg
@@ -0,0 +1 @@
+in Input inferschema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.sql b/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.sql
new file mode 100644
index 0000000000..2a38709e51
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_fields_inferschema.sql
@@ -0,0 +1 @@
+select a, b, d from plato.Input with inferscheme;
diff --git a/yql/essentials/tests/sql/suites/schema/select_operate_with_columns_simple.sql b/yql/essentials/tests/sql/suites/schema/select_operate_with_columns_simple.sql
new file mode 100644
index 0000000000..5c1e78aac7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_operate_with_columns_simple.sql
@@ -0,0 +1 @@
+select a + b + c from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/select_reordered.sql b/yql/essentials/tests/sql/suites/schema/select_reordered.sql
new file mode 100644
index 0000000000..38d1ad8ee2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_reordered.sql
@@ -0,0 +1 @@
+select b, c, d, e, a, f from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/select_simple.sql b/yql/essentials/tests/sql/suites/schema/select_simple.sql
new file mode 100644
index 0000000000..9d081c58a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_simple.sql
@@ -0,0 +1 @@
+select a as aa, b as bb, c as cc, d as dd, e as ee, f as ff from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/schema/select_with_map-partial_read_schema.cfg b/yql/essentials/tests/sql/suites/schema/select_with_map-partial_read_schema.cfg
new file mode 100644
index 0000000000..d19bb07754
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_with_map-partial_read_schema.cfg
@@ -0,0 +1 @@
+in Input read_schema_partial.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_with_map-sorted_desc.cfg b/yql/essentials/tests/sql/suites/schema/select_with_map-sorted_desc.cfg
new file mode 100644
index 0000000000..2bcea8c52e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_with_map-sorted_desc.cfg
@@ -0,0 +1 @@
+in Input sorted_desc.txt
diff --git a/yql/essentials/tests/sql/suites/schema/select_with_map.sql b/yql/essentials/tests/sql/suites/schema/select_with_map.sql
new file mode 100644
index 0000000000..701896d6aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_with_map.sql
@@ -0,0 +1 @@
+select * from plato.Input where key > "100"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/select_yamr_fields.cfg b/yql/essentials/tests/sql/suites/schema/select_yamr_fields.cfg
new file mode 100644
index 0000000000..f3f737a2ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_yamr_fields.cfg
@@ -0,0 +1 @@
+in Input yamred_dsv_raw.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/schema/select_yamr_fields.sql b/yql/essentials/tests/sql/suites/schema/select_yamr_fields.sql
new file mode 100644
index 0000000000..0447ad6e5a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/select_yamr_fields.sql
@@ -0,0 +1 @@
+select key,subkey from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type.cfg b/yql/essentials/tests/sql/suites/schema/skip_complex_type.cfg
new file mode 100644
index 0000000000..23b45796d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type.cfg
@@ -0,0 +1 @@
+in Input skip_complex_type.txt
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type.sql b/yql/essentials/tests/sql/suites/schema/skip_complex_type.sql
new file mode 100644
index 0000000000..fc573ceb44
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type.sql
@@ -0,0 +1,5 @@
+pragma DqEngine="disable";
+PRAGMA yt.InferSchema;
+pragma yt.UseNativeYtTypes="1";
+PRAGMA yt.DefaultMaxJobFails="1";
+select boobee, DictLookup(_other, 'boobee') from plato.Input order by boobee;
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt b/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt
new file mode 100644
index 0000000000..b63ae6229b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt
@@ -0,0 +1,4 @@
+{"boobee"=5;"xx"=[0;1;];};
+{"boobee"=6;"xx"=[1;"abc";];};
+{"boobee"=7;"xx"=[2;3.14;];};
+{"boobee"=8}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt.attr b/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt.attr
new file mode 100644
index 0000000000..a4e88ede97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type.txt.attr
@@ -0,0 +1,3 @@
+{
+ "schema"=<strict=%false>[{name=boobee;required=%true;type=int32;type_v3=int32};{name=xx;required=%false;type=any;type_v3={type_name=optional;item={type_name=variant;elements=[{type=int32};{type=string};{type=double}]}}}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type2.cfg b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.cfg
new file mode 100644
index 0000000000..4848247dcb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.cfg
@@ -0,0 +1 @@
+in Input skip_complex_type2.txt
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type2.sql b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.sql
new file mode 100644
index 0000000000..fc573ceb44
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.sql
@@ -0,0 +1,5 @@
+pragma DqEngine="disable";
+PRAGMA yt.InferSchema;
+pragma yt.UseNativeYtTypes="1";
+PRAGMA yt.DefaultMaxJobFails="1";
+select boobee, DictLookup(_other, 'boobee') from plato.Input order by boobee;
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt
new file mode 100644
index 0000000000..28a8e84b14
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt
@@ -0,0 +1,4 @@
+{"boobee"=5};
+{"boobee"=6;"xx"=[];};
+{"boobee"=7;"xx"=[{bee=1;foo=2}];};
+{"boobee"=8;"xx"=[{bee=1;foo=2};{bee=4;foo=3}];};
diff --git a/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt.attr b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt.attr
new file mode 100644
index 0000000000..7226f6c31c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/skip_complex_type2.txt.attr
@@ -0,0 +1,3 @@
+{
+ "schema"=<strict=%false>[{name=boobee;required=%true;type=int32;type_v3=int32};{name=xx;required=%false;type=any;type_v3={type_name=optional;item={type_name=list;item={type_name=struct;members=[{type=int32;name=bee};{type=int32;name=foo}]}}}}]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/sorted.txt b/yql/essentials/tests/sql/suites/schema/sorted.txt
new file mode 100644
index 0000000000..d8de65c4db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/sorted.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="151";"subkey"="3";"value"="iii"};
+{"key"="152";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/schema/sorted.txt.attr b/yql/essentials/tests/sql/suites/schema/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/schema/sorted_desc.txt b/yql/essentials/tests/sql/suites/schema/sorted_desc.txt
new file mode 100644
index 0000000000..ac8e34386d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/sorted_desc.txt
@@ -0,0 +1,4 @@
+{"_yql_column_0"="\xE0\xC7\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="800";"subkey"="2";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="150";"subkey"="4";"value"="qzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFC";"key"="020";"subkey"="3";"value"="q"};
diff --git a/yql/essentials/tests/sql/suites/schema/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/schema/sorted_desc.txt.attr
new file mode 100644
index 0000000000..903b4c7d93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/sorted_desc.txt.attr
@@ -0,0 +1,46 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/unsorted.txt b/yql/essentials/tests/sql/suites/schema/unsorted.txt
new file mode 100644
index 0000000000..30aeaac5b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/unsorted.txt
@@ -0,0 +1,8 @@
+{"a"=1; "b"=1u; "c"=0.1; "d"="x"; "e"=%false; "f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2; "b"=2u; "c"=2.5; "d"="xx"; "e"=%true; "f"=0.123};
+{"a"=-5;"b"=8u; "c"=10.; "d"="xxx"; "f"="xyz"};
+{ "b"=5u; "d"="skdjfnsdf";"e"=%false};
+{};
+{"a"=-5;"b"=8u; "c"=12.; "d"="xxx"; "f"="xyz"};
+{"a"=-5;"b"=8u; "c"=10.01; "d"=""; "f"=%false};
+{}
diff --git a/yql/essentials/tests/sql/suites/schema/unsorted.txt.attr b/yql/essentials/tests/sql/suites/schema/unsorted.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/unsorted.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_append.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_append.cfg
new file mode 100644
index 0000000000..e523b0a1e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_append.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+out Input input.txt
+xfail
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_append.sql b/yql/essentials/tests/sql/suites/schema/user_schema_append.sql
new file mode 100644
index 0000000000..5ec9e939bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_append.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+USE plato;
+
+INSERT INTO Input
+SELECT * FROM Input WITH SCHEMA Struct<key:String, value:String>;
+
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_bind.sql b/yql/essentials/tests/sql/suites/schema/user_schema_bind.sql
new file mode 100644
index 0000000000..778aeae870
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_bind.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+use plato;
+
+$table = "In" || "put";
+
+select *
+from $table
+with schema Struct<a:Int64?>;
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_directread.sql b/yql/essentials/tests/sql/suites/schema/user_schema_directread.sql
new file mode 100644
index 0000000000..0699179524
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_directread.sql
@@ -0,0 +1,8 @@
+use plato;
+
+pragma directread;
+
+$in = (select * from Input where a != 0);
+
+select * from $in;
+
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_empty_table_ranges.sql b/yql/essentials/tests/sql/suites/schema/user_schema_empty_table_ranges.sql
new file mode 100644
index 0000000000..5e70b05ab1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_empty_table_ranges.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+use plato;
+
+select *
+from range("","foo","foo")
+with schema Struct<Key:String>;
+
+select *
+from Range_strict("","foo","foo")
+with schema Struct<Key:String>;
+
+select * from Each(ListCreate(String))
+with schema Struct<Key:Int32>;
+
+select * from Each_strict(ListCreate(String))
+with schema Struct<Key:Int32>;
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.cfg
new file mode 100644
index 0000000000..f246051d81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.cfg
@@ -0,0 +1 @@
+in Input input_no_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.sql b/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.sql
new file mode 100644
index 0000000000..021311a6a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_existing_column.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+use plato;
+
+select * from Input with schema Struct<key:String>; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.cfg
new file mode 100644
index 0000000000..f246051d81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.cfg
@@ -0,0 +1 @@
+in Input input_no_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.sql b/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.sql
new file mode 100644
index 0000000000..ae68ca4339
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_missing_column.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+use plato;
+
+select * from Input with schema Struct<value1:String?>; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix1.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_mix1.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix1.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix1.sql b/yql/essentials/tests/sql/suites/schema/user_schema_mix1.sql
new file mode 100644
index 0000000000..ceda4b7624
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix1.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT * FROM Input;
+SELECT * FROM Input WITH SCHEMA Struct<key:String, value:String>;
+
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix2.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_mix2.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix2.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix2.sql b/yql/essentials/tests/sql/suites/schema/user_schema_mix2.sql
new file mode 100644
index 0000000000..52885ab1b9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix2.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT * FROM Input WITH SCHEMA Struct<key:String, value:String>;
+SELECT * FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix3.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_mix3.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix3.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_mix3.sql b/yql/essentials/tests/sql/suites/schema/user_schema_mix3.sql
new file mode 100644
index 0000000000..83bb1a6a1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_mix3.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT * FROM Input WITH SCHEMA Struct<key:String, subkey:String, value:String>;
+SELECT * FROM Input;
+
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.cfg
new file mode 100644
index 0000000000..964ee21a18
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.cfg
@@ -0,0 +1 @@
+in Input empty_no_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.sql b/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.sql
new file mode 100644
index 0000000000..1c3343a295
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_no_infer.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+use plato;
+pragma yt.InferSchema;
+
+select * from Input with schema Struct<key:String>; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_override.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_override.cfg
new file mode 100644
index 0000000000..cf3e367ee4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_override.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Input input.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_override.sql b/yql/essentials/tests/sql/suites/schema/user_schema_override.sql
new file mode 100644
index 0000000000..126fe3f86d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_override.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+USE plato;
+
+INSERT INTO Input WITH TRUNCATE
+SELECT * FROM Input WITH SCHEMA Struct<key:String, value:String>;
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.cfg
new file mode 100644
index 0000000000..f246051d81
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.cfg
@@ -0,0 +1 @@
+in Input input_no_schema.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.sql b/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.sql
new file mode 100644
index 0000000000..a40ef2d04b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_patch_columns.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+use plato;
+pragma yt.InferSchema;
+
+select ListSort(DictItems(_other)) as _other,key,subkey from Input with columns Struct<key:Utf8, subkey:String?>; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.cfg b/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.cfg
new file mode 100644
index 0000000000..7f2ba236c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted.txt
+in Input2 sorted_desc.txt
diff --git a/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.sql b/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.sql
new file mode 100644
index 0000000000..442c257187
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/user_schema_with_sort.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT * FROM Input1 WITH SCHEMA Struct<key:String, value:String> ORDER BY key;
+SELECT * FROM Input1 WITH SCHEMA Struct<key:String?, subkey:String> ORDER BY key; -- should reset sort
+SELECT * FROM Input2 WITH SCHEMA Struct<key:String, subkey:String> ORDER BY key DESC;
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt b/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt
new file mode 100644
index 0000000000..f2882a08fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt
@@ -0,0 +1,4 @@
+{"key"="3";"subkey"="s3";"a"="2";"b"="075";"c"="1";"d"="abc"};
+{"key"="1";"subkey"="s1";"a"="1";"b"="800";"c"="2";"d"="ddd"};
+{"key"="2";"subkey"="s2";"a"="4";"b"="020";"c"="3";"d"="q"};
+{"key"="5";"subkey"="s5";"a"="3";"b"="150";"c"="4";"d"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt.attr b/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt.attr
new file mode 100644
index 0000000000..b6264f0dfc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_format"=<"fs"="\t";"rs"="\n";"has_subkey"=%true;"escape_carriage_return"=%true;"key_column_names"=["key"];"subkey_column_names"=["subkey"]>"yamred_dsv";
+ "_yql_read_udf"="Dsv.ReadRecord"
+}
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt b/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt
new file mode 100644
index 0000000000..b9a49cd58d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt
@@ -0,0 +1,5 @@
+{"a"="a1";"b"="b1";"c"="c1";"d"="d1"};
+{"a"="a2";"b"="b2";"c"="c2";"d"="d2"};
+{"a"="a3";"b"="b3";"c"="c3";"d"="d3"};
+{"a"="a4";"b"="b4";"c"="c4";"d"="d4"};
+{"a"="a5";"b"="b5";"c"="c5";"d"="d5"};
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt.attr b/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt.attr
new file mode 100644
index 0000000000..0a26cb14d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv_raw.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_format" = <
+ "escape_carriage_return" = %true;
+ "has_subkey" = %false;
+ "key_column_names" = [
+ "a";
+ "b"
+ ];
+ >
+ "yamred_dsv";
+}
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.cfg b/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.cfg
new file mode 100644
index 0000000000..ea928dac01
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.cfg
@@ -0,0 +1 @@
+in Input yamred_dsv.txt yamred_dsv
diff --git a/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.sql b/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.sql
new file mode 100644
index 0000000000..6c22e21f41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/schema/yamred_dsv_select_from_dict.sql
@@ -0,0 +1,2 @@
+/* syntax version 1 */
+select key as key, subkey as subkey, Input.`dict`["a"] as a, Input.`dict`["b"] as b, Input.`dict`["c"] as c, Input.`dict`["d"] as d from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/anon_clash.cfg b/yql/essentials/tests/sql/suites/select/anon_clash.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/anon_clash.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/select/anon_clash.sql b/yql/essentials/tests/sql/suites/select/anon_clash.sql
new file mode 100644
index 0000000000..7fa8927b9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/anon_clash.sql
@@ -0,0 +1,8 @@
+use plato;
+
+insert into @a select 1 as t;
+
+commit;
+
+select * from @a;
+select * from a;
diff --git a/yql/essentials/tests/sql/suites/select/append_to_value.cfg b/yql/essentials/tests/sql/suites/select/append_to_value.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/append_to_value.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/select/append_to_value.sql b/yql/essentials/tests/sql/suites/select/append_to_value.sql
new file mode 100644
index 0000000000..399241b7b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/append_to_value.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, subkey, value || "foo" as new_value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/append_to_value_1000.cfg b/yql/essentials/tests/sql/suites/select/append_to_value_1000.cfg
new file mode 100644
index 0000000000..97c9faa1f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/append_to_value_1000.cfg
@@ -0,0 +1,2 @@
+in Input input1100.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/select/append_to_value_1000.sql b/yql/essentials/tests/sql/suites/select/append_to_value_1000.sql
new file mode 100644
index 0000000000..c86c8d13cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/append_to_value_1000.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* kikimr can not - no ref select mode */
+select key, subkey, value || "foo" as new_value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/autoextract_source_value.sql b/yql/essentials/tests/sql/suites/select/autoextract_source_value.sql
new file mode 100644
index 0000000000..8a865b85c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/autoextract_source_value.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+
+$_data = (SELECT key as kk, subkey as sk, value as val FROM plato.Input WHERE key == '075');
+$data_one_key = (SELECT subkey as sk FROM plato.Input WHERE key == '075');
+
+SELECT * FROM Input WHERE key = $data_one_key;
diff --git a/yql/essentials/tests/sql/suites/select/autoextract_source_value_in_where.sqlx b/yql/essentials/tests/sql/suites/select/autoextract_source_value_in_where.sqlx
new file mode 100644
index 0000000000..e5df9cc6ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/autoextract_source_value_in_where.sqlx
@@ -0,0 +1,11 @@
+/* postgres can not */
+use plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM plato.Input WHERE key == '075');
+
+SELECT
+ *
+FROM
+ Input
+WHERE
+ key = $data; -- $data should have one column
diff --git a/yql/essentials/tests/sql/suites/select/autogen_columns_conflict.sql b/yql/essentials/tests/sql/suites/select/autogen_columns_conflict.sql
new file mode 100644
index 0000000000..16c07dbbb6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/autogen_columns_conflict.sql
@@ -0,0 +1,29 @@
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+/* postgres can not */
+
+$src = select <|column0:1|> as x;
+
+$src = select * from $src flatten columns;
+
+select 2, a.* from $src as a;
+
+select 2, 1 as column0;
+
+select 2, 1 as column0
+union all
+select 4, 3 as column0;
+
+
+select * from (select 1) as a join (select 1) as b using(column0);
+
+
+
+select
+
+ 1 as a,
+ 2 as b,
+ 3, -- should be column2
+ 4 as column1;
+
diff --git a/yql/essentials/tests/sql/suites/select/backtick_with_escapes.sql b/yql/essentials/tests/sql/suites/select/backtick_with_escapes.sql
new file mode 100644
index 0000000000..c8120b41bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/backtick_with_escapes.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+USE plato;
+SELECT key as `#[k]ey`, subkey as `#[s]ubkey`, value as `\x5bv\x5dalue#` FROM Input;
diff --git a/yql/essentials/tests/sql/suites/select/bin_ops_long_concat.sql b/yql/essentials/tests/sql/suites/select/bin_ops_long_concat.sql
new file mode 100644
index 0000000000..d62efd5eef
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/bin_ops_long_concat.sql
@@ -0,0 +1 @@
+select "The" || " std::tuple" || " type" || " introduced" || " in" || " C++11" || " allows" || " an" || " aggregate" || " of" || " typed" || " values" || " to" || " be" || " indexed" || " by" || " a" || " compile-time" || " constant" || " integer." || " C++14" || " extends" || " this" || " to" || " allow" || " fetching" || " from" || " a" || " tuple" || " by" || " type" || " instead" || " of" || " by" || " index." || " If" || " the" || " tuple" || " has" || " more" || " than" || " one" || " element" || " of" || " the" || " type," || " a" || " compile-time" || " error" || " results...";
diff --git a/yql/essentials/tests/sql/suites/select/bit_ops.sql b/yql/essentials/tests/sql/suites/select/bit_ops.sql
new file mode 100644
index 0000000000..b7fd34b68b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/bit_ops.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+SELECT
+ LENGTH(key) & LENGTH(value) as and_res,
+ LENGTH(key) | LENGTH(value) as or_res,
+ LENGTH(key) ^ LENGTH(value) as xor_res,
+ LENGTH(key) << 1 as shl_res,
+ LENGTH(key) >> 1 as shr_res,
+ LENGTH(key) |<< 15 as rotl_res,
+ LENGTH(key) >>| 15 as rotr_res,
+ ~LENGTH(key) as not_res
+FROM plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/boolean_where.cfg b/yql/essentials/tests/sql/suites/select/boolean_where.cfg
new file mode 100644
index 0000000000..a09f034ddd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/boolean_where.cfg
@@ -0,0 +1 @@
+in Input boolean_where.txt
diff --git a/yql/essentials/tests/sql/suites/select/boolean_where.sql b/yql/essentials/tests/sql/suites/select/boolean_where.sql
new file mode 100644
index 0000000000..c12a9b6022
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/boolean_where.sql
@@ -0,0 +1,2 @@
+select * from plato.Input where e;
+select a from plato.Input where not e;
diff --git a/yql/essentials/tests/sql/suites/select/boolean_where.txt b/yql/essentials/tests/sql/suites/select/boolean_where.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/boolean_where.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/select/boolean_where.txt.attr b/yql/essentials/tests/sql/suites/select/boolean_where.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/boolean_where.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/select/braces.sql b/yql/essentials/tests/sql/suites/select/braces.sql
new file mode 100644
index 0000000000..55834ff839
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/braces.sql
@@ -0,0 +1 @@
+select key, subkey, ("foo" || "bar") as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/calculated_values.sql b/yql/essentials/tests/sql/suites/select/calculated_values.sql
new file mode 100644
index 0000000000..f23c91eaf8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/calculated_values.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* can not check this with postgres becouse order of columns is not specified here */
+select key, (value || "ab"), (value || "a"), value from plato.Input order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/cast_double_to_uint32.sql b/yql/essentials/tests/sql/suites/select/cast_double_to_uint32.sql
new file mode 100644
index 0000000000..4e9d9f6737
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/cast_double_to_uint32.sql
@@ -0,0 +1 @@
+select key, subkey, cast(cast(3.1415 as smallint) as varchar) as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/column_labels.sql b/yql/essentials/tests/sql/suites/select/column_labels.sql
new file mode 100644
index 0000000000..eacf0460c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/column_labels.sql
@@ -0,0 +1 @@
+select key, subkey || value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/complex_filter_with_order.sql b/yql/essentials/tests/sql/suites/select/complex_filter_with_order.sql
new file mode 100644
index 0000000000..6ed86d9d92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/complex_filter_with_order.sql
@@ -0,0 +1 @@
+select key as value, subkey, value as key from plato.Input where value > "A" and length(value) = cast(3 as smallint) order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/complex_view_input.txt b/yql/essentials/tests/sql/suites/select/complex_view_input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/complex_view_input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/select/complex_view_input.txt.attr b/yql/essentials/tests/sql/suites/select/complex_view_input.txt.attr
new file mode 100644
index 0000000000..a9108a292e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/complex_view_input.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_struct"="SELECT YQL::@@(AsStruct '('k (Member row 'key)) '('s (Member row 'subkey)) '('v (Member row 'value)))@@ as struct FROM self;";
+ "_yql_view_tuple"="SELECT YQL::@@'((Member row 'key) (Member row 'subkey) (Member row 'value))@@ as tuple FROM self;";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/select/const_subrequest_and_select_by_all.sql b/yql/essentials/tests/sql/suites/select/const_subrequest_and_select_by_all.sql
new file mode 100644
index 0000000000..405f199c6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/const_subrequest_and_select_by_all.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+USE plato;
+
+$input = (FROM Input SELECT key ORDER BY key LIMIT 3);
+
+--insert into Output
+SELECT * FROM $input;
+
+SELECT * FROM Input WHERE key = $input;
diff --git a/yql/essentials/tests/sql/suites/select/core_func_test_bit.sql b/yql/essentials/tests/sql/suites/select/core_func_test_bit.sql
new file mode 100644
index 0000000000..d446c253fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/core_func_test_bit.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+SELECT TestBit(" ", 4) as bit4, TestBit(" ", 5) as bit5
diff --git a/yql/essentials/tests/sql/suites/select/corr_name_in_select.sql b/yql/essentials/tests/sql/suites/select/corr_name_in_select.sql
new file mode 100644
index 0000000000..10294f918d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/corr_name_in_select.sql
@@ -0,0 +1 @@
+select b.sortkey from (select a.key as sortkey from plato.Input as a) as b order by b.sortkey desc;
diff --git a/yql/essentials/tests/sql/suites/select/corr_name_in_select_seq.sql b/yql/essentials/tests/sql/suites/select/corr_name_in_select_seq.sql
new file mode 100644
index 0000000000..514b9f94cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/corr_name_in_select_seq.sql
@@ -0,0 +1 @@
+select c.key from (select b.key from (select a.key from plato.Input as a) as b) as c order by c.key;
diff --git a/yql/essentials/tests/sql/suites/select/create_structures.sql b/yql/essentials/tests/sql/suites/select/create_structures.sql
new file mode 100644
index 0000000000..79baf49bb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/create_structures.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select (key as k), (subkey as s, value as v) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/create_tuples.sql b/yql/essentials/tests/sql/suites/select/create_tuples.sql
new file mode 100644
index 0000000000..84387a3b06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/create_tuples.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select (key,), (subkey, value) from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/data_instance.sql b/yql/essentials/tests/sql/suites/select/data_instance.sql
new file mode 100644
index 0000000000..457d2d110c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/data_instance.sql
@@ -0,0 +1,45 @@
+/* postgres can not */
+select Bool("true");
+select Bool("FalsE");
+select Int8("-128");
+select Int8("127");
+select Uint8("0");
+select Uint8("255");
+select Int16("-32768");
+select Int16("32767");
+select Uint16("0");
+select Uint16("65535");
+select Int32("-2147483648");
+select Int32("2147483647");
+select Uint32("0");
+select Uint32("4294967295");
+select Int64("-9223372036854775808");
+select Int64("9223372036854775807");
+select Uint64("0");
+select Uint64("18446744073709551615");
+select Float("0");
+select Float("1");
+select Float("-1e30");
+select Float("-inf");
+select Float("+inf");
+select Float("nan");
+select Double("0");
+select Double("1");
+select Double("-1e300");
+select Double("-inf");
+select Double("+inf");
+select Double("nan");
+select String("foo\xffbar");
+select Utf8("привет");
+select Yson("<a=1>[3;%false]");
+select Json(@@{"a":1,"b":null}@@);
+select cast(Date("2000-01-01") as string);
+select cast(Datetime("2000-01-01T01:02:03Z") as string);
+select cast(Timestamp("2000-01-01T01:02:03.4Z") as string);
+select cast(Interval("P1DT12H") as string);
+select TZDATE("2010-07-01,Europe/Moscow");
+select TZDATE("2010-07-01,America/Los_Angeles");
+select TZDATETIME("2010-07-01T00:00:00,Europe/Moscow");
+select TZTIMESTAMP("2010-07-01T00:00:00,America/Los_Angeles");
+select TZTIMESTAMP("2010-07-01T12:00:00.123456,Europe/Moscow");
+select Uuid('550e8400-e29b-41d4-a716-446655440000');
diff --git a/yql/essentials/tests/sql/suites/select/deep_udf_call.cfg b/yql/essentials/tests/sql/suites/select/deep_udf_call.cfg
new file mode 100644
index 0000000000..55c2f97264
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/deep_udf_call.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/select/deep_udf_call.sql b/yql/essentials/tests/sql/suites/select/deep_udf_call.sql
new file mode 100644
index 0000000000..03bceb447b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/deep_udf_call.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$data = (
+ SELECT
+ Math::Pi() * CAST(subkey AS Double) AS rad
+ FROM Input
+);
+
+--INSERT INTO Output
+SELECT Math::Sqrt(Math::Sin(rad) * Math::Sin(rad) + Math::Cos(rad) * Math::Cos(rad)) FROM $data
diff --git a/yql/essentials/tests/sql/suites/select/default.cfg b/yql/essentials/tests/sql/suites/select/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/select/dict_lookup.sql b/yql/essentials/tests/sql/suites/select/dict_lookup.sql
new file mode 100644
index 0000000000..50f85dd099
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dict_lookup.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$dictList = (select
+ AsDict(AsTuple(value, CAST(subkey AS Int32))) as `dict`,
+ AsDict(AsTuple("z", "a"), AsTuple("y", "b")) AS d,
+ subkey, value
+from Input);
+
+select d["z"] as static, input.`dict`[input.value] as dynamic, input.`dict` as `dict` from $dictList as input;
diff --git a/yql/essentials/tests/sql/suites/select/dict_lookup_by_key.sql b/yql/essentials/tests/sql/suites/select/dict_lookup_by_key.sql
new file mode 100644
index 0000000000..9a7feebcae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dict_lookup_by_key.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+$key_text = AsDict(
+ ('911', 'emergency'),
+ ('200', 'two hundred'),
+ ('150', 'one and half hundred'),
+ ('023', 'funny'),
+ ('075', '3/4 of hundred')
+);
+
+SELECT
+ value,
+ $key_text[key] as key_text
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/dict_lookup_by_key_with_def.sql b/yql/essentials/tests/sql/suites/select/dict_lookup_by_key_with_def.sql
new file mode 100644
index 0000000000..19011f7714
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dict_lookup_by_key_with_def.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+$key_text = AsDict(
+ ('911', 'emergency'),
+ ('200', 'two hundred'),
+ ('150', 'one and half hundred'),
+ ('023', 'funny'),
+ ('075', '3/4 of hundred')
+);
+
+SELECT
+ value,
+ $key_text[key] ?? "unknown" as key_text
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/dict_lookup_column_names.sql b/yql/essentials/tests/sql/suites/select/dict_lookup_column_names.sql
new file mode 100644
index 0000000000..6ee1151214
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dict_lookup_column_names.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$dictList = (select AsDict(AsTuple(value, CAST(subkey AS Int32))) as `dict`, subkey, value from Input);
+select input.`dict`[input.value], input.`dict`[input.subkey] from $dictList as input;
diff --git a/yql/essentials/tests/sql/suites/select/dict_with_few_keys.sql b/yql/essentials/tests/sql/suites/select/dict_with_few_keys.sql
new file mode 100644
index 0000000000..b2a1601612
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dict_with_few_keys.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$dict = (
+SELECT
+ AsDict(
+ AsTuple("key", cast(key as uint32) ?? 0),
+ AsTuple("sk", cast(subkey as uint32) ?? 1),
+ AsTuple("str", Cast(ByteAt(value, 0) as uint32) ?? 256)
+ ) as dd
+FROM Input);
+
+--INSERT INTO Output
+SELECT dd['key'] as key, dd['str'] as zz from $dict as d ORDER BY key, zz
diff --git a/yql/essentials/tests/sql/suites/select/digits.cfg b/yql/essentials/tests/sql/suites/select/digits.cfg
new file mode 100644
index 0000000000..55c2f97264
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/digits.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/select/digits.sql b/yql/essentials/tests/sql/suites/select/digits.sql
new file mode 100644
index 0000000000..5425900bdf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/digits.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+select 0xffut, 0x0ffut, 0o77ut, 0xdead, 0xdeadl, 0xdeadbeef, 0x7fffffff, 0x80000000, 0x80000000u, 0xffffffffu, 0x80000000ul;
+select 0xfFUt, 0X0FfuT, 0O77ut, 0xDeaD, 0xdeaDL, 0xdeaDBeef, 0X7fFfFfff, 0x80000000, 0x80000000U, 0xffffffffu, 0x80000000uL;
+
+select 0.f, 0.0f, 1, 1l, 1u, 1ut, 1., 2.f, Math::Round(3.14f, -3), 1.e2f, 1.0e2f;
+select 0.F, 0.0f, 1, 1L, 1u, 1Ut, 1., 2.f, Math::Round(3.14F, -3), 1.e2f, 1.0E2F;
+
+select 1t,2ut,3s,4us,5,6u,7l,8ul,9.0,10.0f;
diff --git a/yql/essentials/tests/sql/suites/select/discard.sql b/yql/essentials/tests/sql/suites/select/discard.sql
new file mode 100644
index 0000000000..f1f3423811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/discard.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+use plato;
+pragma DisableSimpleColumns;
+discard select 1;
+discard select * from Input;
+discard select * from Input where key<"foo";
+discard select * from Input as a join Input as b using(key);
+discard select sum(length(value)), key, subkey from Input group by rollup(key,subkey) order by key, subkey;
+discard select * from (select key || "a" || "b" as key from Input) as a join (select key || "ab" as key from Input) as b using(key);
diff --git a/yql/essentials/tests/sql/suites/select/dot_in_alias.sql b/yql/essentials/tests/sql/suites/select/dot_in_alias.sql
new file mode 100644
index 0000000000..0f5f81aae8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dot_in_alias.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+PRAGMA AllowDotInAlias;
+
+--INSERT INTO Output
+SELECT key as `.key`, subkey as `sub.key`, value as `value.` FROM Input ORDER BY `.key`, `sub.key`
diff --git a/yql/essentials/tests/sql/suites/select/dot_name_subrequest.sql b/yql/essentials/tests/sql/suites/select/dot_name_subrequest.sql
new file mode 100644
index 0000000000..a685c26f29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/dot_name_subrequest.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+$req = (SELECT 100500 as magic, t.* FROM Input as t);
+
+--INSERT INTO Output
+SELECT `t.subkey` as sk, `t.value` as val FROM $req ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/select/double_at_ids.sql b/yql/essentials/tests/sql/suites/select/double_at_ids.sql
new file mode 100644
index 0000000000..994d7f8167
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/double_at_ids.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select @@@@, @@A@@, @@@A@@, @@@@@@@@; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/exists_false.sql b/yql/essentials/tests/sql/suites/select/exists_false.sql
new file mode 100644
index 0000000000..dd4564a387
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/exists_false.sql
@@ -0,0 +1 @@
+SELECT EXISTS (SELECT * FROM plato.Input WHERE key = 'none') from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/exists_true.sql b/yql/essentials/tests/sql/suites/select/exists_true.sql
new file mode 100644
index 0000000000..163f223faf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/exists_true.sql
@@ -0,0 +1 @@
+SELECT EXISTS (SELECT 'Cool') from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/extend_and_take.cfg b/yql/essentials/tests/sql/suites/select/extend_and_take.cfg
new file mode 100644
index 0000000000..48d54a12ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/extend_and_take.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/select/extend_and_take.sql b/yql/essentials/tests/sql/suites/select/extend_and_take.sql
new file mode 100644
index 0000000000..58867d204a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/extend_and_take.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+select ListExtend(String::SplitToList("1234 123", " "),String::SplitToList("1234 123", " "))[1];
diff --git a/yql/essentials/tests/sql/suites/select/from_in_front.sql b/yql/essentials/tests/sql/suites/select/from_in_front.sql
new file mode 100644
index 0000000000..70b0c1c356
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/from_in_front.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+from plato.Input select * order by key, subkey limit 1;
diff --git a/yql/essentials/tests/sql/suites/select/from_in_front_sub.sql b/yql/essentials/tests/sql/suites/select/from_in_front_sub.sql
new file mode 100644
index 0000000000..e611f8c661
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/from_in_front_sub.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+from
+ (select cast(subkey as Double) / cast(key as Double) as val, value from plato.Input2) as res
+select
+ count(val) as subkey,
+ cast(avg(val) as int) as value,
+ value as key
+group by value
+order by subkey, value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/hits_count.cfg b/yql/essentials/tests/sql/suites/select/hits_count.cfg
new file mode 100644
index 0000000000..3dd8c79387
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/hits_count.cfg
@@ -0,0 +1,3 @@
+in Input1 hits_input1.txt
+in Input2 hits_input2.txt
+udf url_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/hits_count.sql b/yql/essentials/tests/sql/suites/select/hits_count.sql
new file mode 100644
index 0000000000..df10886307
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/hits_count.sql
@@ -0,0 +1,33 @@
+/* postgres can not */
+USE plato;
+
+$data = (
+ SELECT
+ Url::Normalize(value) AS normalized_url,
+ Url::GetHost(Url::Normalize(value)) AS host,
+ Url::GetDomain(Url::Normalize(value), 1) AS tld
+ FROM CONCAT(
+ `Input1`,
+ `Input2`
+ )
+);
+$ru_hosts = (
+ SELECT
+ host
+ FROM
+ $data
+ WHERE normalized_url IS NOT NULL AND (
+ tld = "ru"
+ OR tld = "su"
+ OR tld = "рф"
+ OR tld = "xn--p1ai" -- punycode рф
+ )
+);
+
+SELECT
+ host AS host,
+ COUNT(*) AS hits_count
+FROM $ru_hosts
+GROUP BY host
+ORDER BY hits_count DESC
+LIMIT 25;
diff --git a/yql/essentials/tests/sql/suites/select/hits_input1.txt b/yql/essentials/tests/sql/suites/select/hits_input1.txt
new file mode 100644
index 0000000000..e503207310
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/hits_input1.txt
@@ -0,0 +1,3 @@
+{"key"="1";"subkey"="";"value"="http://www.ya.ru/foo"};
+{"key"="2";"subkey"="";"value"="http://www.ya.ru/bar"};
+{"key"="3";"subkey"="";"value"="http://www.ya.hz/wat"};
diff --git a/yql/essentials/tests/sql/suites/select/hits_input2.txt b/yql/essentials/tests/sql/suites/select/hits_input2.txt
new file mode 100644
index 0000000000..70707946e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/hits_input2.txt
@@ -0,0 +1,3 @@
+{"key"="1";"subkey"="";"value"="http://www.foo.ru/"};
+{"key"="2";"subkey"="";"value"="http://www.wat.com/"};
+{"key"="3";"subkey"="";"value"="http://www.ya.hz/wat"};
diff --git a/yql/essentials/tests/sql/suites/select/host_count.cfg b/yql/essentials/tests/sql/suites/select/host_count.cfg
new file mode 100644
index 0000000000..72fa41ff1f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_count.cfg
@@ -0,0 +1,3 @@
+in Input1 host_input1.txt
+in Input2 host_input2.txt
+udf url_udf
diff --git a/yql/essentials/tests/sql/suites/select/host_count.sql b/yql/essentials/tests/sql/suites/select/host_count.sql
new file mode 100644
index 0000000000..eed3d6c9fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_count.sql
@@ -0,0 +1,33 @@
+/* postgres can not */
+USE plato;
+
+$data = (
+ SELECT
+ Url::Normalize(url) AS normalized_url,
+ Url::GetHost(Url::Normalize(url)) AS host,
+ Url::GetDomain(Url::Normalize(url), 1) AS tld
+ FROM CONCAT(
+ `Input1`,
+ `Input2`
+ )
+);
+$ru_hosts = (
+ SELECT
+ tld,
+ host
+ FROM
+ $data
+ WHERE normalized_url IS NOT NULL AND (
+ tld = "ru"
+ OR tld = "su"
+ OR tld = "рф"
+ OR tld = "xn--p1ai" -- punycode рф
+ )
+);
+
+SELECT
+ tld,
+ COUNT(DISTINCT host) AS hosts_count
+FROM $ru_hosts
+GROUP BY tld
+ORDER BY hosts_count DESC;
diff --git a/yql/essentials/tests/sql/suites/select/host_input1.txt b/yql/essentials/tests/sql/suites/select/host_input1.txt
new file mode 100644
index 0000000000..2a21fe973a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_input1.txt
@@ -0,0 +1,3 @@
+{"url"="http://www.ya.ru/foo";};
+{"url"="http://www.ya.ru/bar";};
+{"url"="http://www.ya.hz/wat";};
diff --git a/yql/essentials/tests/sql/suites/select/host_input1.txt.attr b/yql/essentials/tests/sql/suites/select/host_input1.txt.attr
new file mode 100644
index 0000000000..fb4f4c76a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_input1.txt.attr
@@ -0,0 +1,16 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "url";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/select/host_input2.txt b/yql/essentials/tests/sql/suites/select/host_input2.txt
new file mode 100644
index 0000000000..6102055fa1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_input2.txt
@@ -0,0 +1,3 @@
+{"url"="http://www.foo.ru/";};
+{"url"="http://www.wat.com/";};
+{"url"="http://www.ya.hz/wat";};
diff --git a/yql/essentials/tests/sql/suites/select/host_input2.txt.attr b/yql/essentials/tests/sql/suites/select/host_input2.txt.attr
new file mode 100644
index 0000000000..fb4f4c76a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/host_input2.txt.attr
@@ -0,0 +1,16 @@
+{
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "url";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/select/id_xor.sql b/yql/essentials/tests/sql/suites/select/id_xor.sql
new file mode 100644
index 0000000000..39b40de153
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/id_xor.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select Yql::Xor(true,false);
diff --git a/yql/essentials/tests/sql/suites/select/if.sql b/yql/essentials/tests/sql/suites/select/if.sql
new file mode 100644
index 0000000000..69b35b586e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/if.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+SELECT
+ if(LENGTH(value) > 2, "long", "short") AS if,
+ if(false, 3) AS no_else
+FROM plato.Input
+;
diff --git a/yql/essentials/tests/sql/suites/select/input.txt b/yql/essentials/tests/sql/suites/select/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/select/input1100.txt b/yql/essentials/tests/sql/suites/select/input1100.txt
new file mode 100644
index 0000000000..f3a5a3a5ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input1100.txt
@@ -0,0 +1,1100 @@
+{"key"="0000";"subkey"="0000";"value"="val0000"};
+{"key"="0001";"subkey"="0001";"value"="val0001"};
+{"key"="0002";"subkey"="0002";"value"="val0002"};
+{"key"="0003";"subkey"="0003";"value"="val0003"};
+{"key"="0004";"subkey"="0004";"value"="val0004"};
+{"key"="0005";"subkey"="0005";"value"="val0005"};
+{"key"="0006";"subkey"="0006";"value"="val0006"};
+{"key"="0007";"subkey"="0007";"value"="val0007"};
+{"key"="0008";"subkey"="0008";"value"="val0008"};
+{"key"="0009";"subkey"="0009";"value"="val0009"};
+{"key"="0010";"subkey"="0010";"value"="val0010"};
+{"key"="0011";"subkey"="0011";"value"="val0011"};
+{"key"="0012";"subkey"="0012";"value"="val0012"};
+{"key"="0013";"subkey"="0013";"value"="val0013"};
+{"key"="0014";"subkey"="0014";"value"="val0014"};
+{"key"="0015";"subkey"="0015";"value"="val0015"};
+{"key"="0016";"subkey"="0016";"value"="val0016"};
+{"key"="0017";"subkey"="0017";"value"="val0017"};
+{"key"="0018";"subkey"="0018";"value"="val0018"};
+{"key"="0019";"subkey"="0019";"value"="val0019"};
+{"key"="0020";"subkey"="0020";"value"="val0020"};
+{"key"="0021";"subkey"="0021";"value"="val0021"};
+{"key"="0022";"subkey"="0022";"value"="val0022"};
+{"key"="0023";"subkey"="0023";"value"="val0023"};
+{"key"="0024";"subkey"="0024";"value"="val0024"};
+{"key"="0025";"subkey"="0025";"value"="val0025"};
+{"key"="0026";"subkey"="0026";"value"="val0026"};
+{"key"="0027";"subkey"="0027";"value"="val0027"};
+{"key"="0028";"subkey"="0028";"value"="val0028"};
+{"key"="0029";"subkey"="0029";"value"="val0029"};
+{"key"="0030";"subkey"="0030";"value"="val0030"};
+{"key"="0031";"subkey"="0031";"value"="val0031"};
+{"key"="0032";"subkey"="0032";"value"="val0032"};
+{"key"="0033";"subkey"="0033";"value"="val0033"};
+{"key"="0034";"subkey"="0034";"value"="val0034"};
+{"key"="0035";"subkey"="0035";"value"="val0035"};
+{"key"="0036";"subkey"="0036";"value"="val0036"};
+{"key"="0037";"subkey"="0037";"value"="val0037"};
+{"key"="0038";"subkey"="0038";"value"="val0038"};
+{"key"="0039";"subkey"="0039";"value"="val0039"};
+{"key"="0040";"subkey"="0040";"value"="val0040"};
+{"key"="0041";"subkey"="0041";"value"="val0041"};
+{"key"="0042";"subkey"="0042";"value"="val0042"};
+{"key"="0043";"subkey"="0043";"value"="val0043"};
+{"key"="0044";"subkey"="0044";"value"="val0044"};
+{"key"="0045";"subkey"="0045";"value"="val0045"};
+{"key"="0046";"subkey"="0046";"value"="val0046"};
+{"key"="0047";"subkey"="0047";"value"="val0047"};
+{"key"="0048";"subkey"="0048";"value"="val0048"};
+{"key"="0049";"subkey"="0049";"value"="val0049"};
+{"key"="0050";"subkey"="0050";"value"="val0050"};
+{"key"="0051";"subkey"="0051";"value"="val0051"};
+{"key"="0052";"subkey"="0052";"value"="val0052"};
+{"key"="0053";"subkey"="0053";"value"="val0053"};
+{"key"="0054";"subkey"="0054";"value"="val0054"};
+{"key"="0055";"subkey"="0055";"value"="val0055"};
+{"key"="0056";"subkey"="0056";"value"="val0056"};
+{"key"="0057";"subkey"="0057";"value"="val0057"};
+{"key"="0058";"subkey"="0058";"value"="val0058"};
+{"key"="0059";"subkey"="0059";"value"="val0059"};
+{"key"="0060";"subkey"="0060";"value"="val0060"};
+{"key"="0061";"subkey"="0061";"value"="val0061"};
+{"key"="0062";"subkey"="0062";"value"="val0062"};
+{"key"="0063";"subkey"="0063";"value"="val0063"};
+{"key"="0064";"subkey"="0064";"value"="val0064"};
+{"key"="0065";"subkey"="0065";"value"="val0065"};
+{"key"="0066";"subkey"="0066";"value"="val0066"};
+{"key"="0067";"subkey"="0067";"value"="val0067"};
+{"key"="0068";"subkey"="0068";"value"="val0068"};
+{"key"="0069";"subkey"="0069";"value"="val0069"};
+{"key"="0070";"subkey"="0070";"value"="val0070"};
+{"key"="0071";"subkey"="0071";"value"="val0071"};
+{"key"="0072";"subkey"="0072";"value"="val0072"};
+{"key"="0073";"subkey"="0073";"value"="val0073"};
+{"key"="0074";"subkey"="0074";"value"="val0074"};
+{"key"="0075";"subkey"="0075";"value"="val0075"};
+{"key"="0076";"subkey"="0076";"value"="val0076"};
+{"key"="0077";"subkey"="0077";"value"="val0077"};
+{"key"="0078";"subkey"="0078";"value"="val0078"};
+{"key"="0079";"subkey"="0079";"value"="val0079"};
+{"key"="0080";"subkey"="0080";"value"="val0080"};
+{"key"="0081";"subkey"="0081";"value"="val0081"};
+{"key"="0082";"subkey"="0082";"value"="val0082"};
+{"key"="0083";"subkey"="0083";"value"="val0083"};
+{"key"="0084";"subkey"="0084";"value"="val0084"};
+{"key"="0085";"subkey"="0085";"value"="val0085"};
+{"key"="0086";"subkey"="0086";"value"="val0086"};
+{"key"="0087";"subkey"="0087";"value"="val0087"};
+{"key"="0088";"subkey"="0088";"value"="val0088"};
+{"key"="0089";"subkey"="0089";"value"="val0089"};
+{"key"="0090";"subkey"="0090";"value"="val0090"};
+{"key"="0091";"subkey"="0091";"value"="val0091"};
+{"key"="0092";"subkey"="0092";"value"="val0092"};
+{"key"="0093";"subkey"="0093";"value"="val0093"};
+{"key"="0094";"subkey"="0094";"value"="val0094"};
+{"key"="0095";"subkey"="0095";"value"="val0095"};
+{"key"="0096";"subkey"="0096";"value"="val0096"};
+{"key"="0097";"subkey"="0097";"value"="val0097"};
+{"key"="0098";"subkey"="0098";"value"="val0098"};
+{"key"="0099";"subkey"="0099";"value"="val0099"};
+{"key"="0100";"subkey"="0100";"value"="val0100"};
+{"key"="0101";"subkey"="0101";"value"="val0101"};
+{"key"="0102";"subkey"="0102";"value"="val0102"};
+{"key"="0103";"subkey"="0103";"value"="val0103"};
+{"key"="0104";"subkey"="0104";"value"="val0104"};
+{"key"="0105";"subkey"="0105";"value"="val0105"};
+{"key"="0106";"subkey"="0106";"value"="val0106"};
+{"key"="0107";"subkey"="0107";"value"="val0107"};
+{"key"="0108";"subkey"="0108";"value"="val0108"};
+{"key"="0109";"subkey"="0109";"value"="val0109"};
+{"key"="0110";"subkey"="0110";"value"="val0110"};
+{"key"="0111";"subkey"="0111";"value"="val0111"};
+{"key"="0112";"subkey"="0112";"value"="val0112"};
+{"key"="0113";"subkey"="0113";"value"="val0113"};
+{"key"="0114";"subkey"="0114";"value"="val0114"};
+{"key"="0115";"subkey"="0115";"value"="val0115"};
+{"key"="0116";"subkey"="0116";"value"="val0116"};
+{"key"="0117";"subkey"="0117";"value"="val0117"};
+{"key"="0118";"subkey"="0118";"value"="val0118"};
+{"key"="0119";"subkey"="0119";"value"="val0119"};
+{"key"="0120";"subkey"="0120";"value"="val0120"};
+{"key"="0121";"subkey"="0121";"value"="val0121"};
+{"key"="0122";"subkey"="0122";"value"="val0122"};
+{"key"="0123";"subkey"="0123";"value"="val0123"};
+{"key"="0124";"subkey"="0124";"value"="val0124"};
+{"key"="0125";"subkey"="0125";"value"="val0125"};
+{"key"="0126";"subkey"="0126";"value"="val0126"};
+{"key"="0127";"subkey"="0127";"value"="val0127"};
+{"key"="0128";"subkey"="0128";"value"="val0128"};
+{"key"="0129";"subkey"="0129";"value"="val0129"};
+{"key"="0130";"subkey"="0130";"value"="val0130"};
+{"key"="0131";"subkey"="0131";"value"="val0131"};
+{"key"="0132";"subkey"="0132";"value"="val0132"};
+{"key"="0133";"subkey"="0133";"value"="val0133"};
+{"key"="0134";"subkey"="0134";"value"="val0134"};
+{"key"="0135";"subkey"="0135";"value"="val0135"};
+{"key"="0136";"subkey"="0136";"value"="val0136"};
+{"key"="0137";"subkey"="0137";"value"="val0137"};
+{"key"="0138";"subkey"="0138";"value"="val0138"};
+{"key"="0139";"subkey"="0139";"value"="val0139"};
+{"key"="0140";"subkey"="0140";"value"="val0140"};
+{"key"="0141";"subkey"="0141";"value"="val0141"};
+{"key"="0142";"subkey"="0142";"value"="val0142"};
+{"key"="0143";"subkey"="0143";"value"="val0143"};
+{"key"="0144";"subkey"="0144";"value"="val0144"};
+{"key"="0145";"subkey"="0145";"value"="val0145"};
+{"key"="0146";"subkey"="0146";"value"="val0146"};
+{"key"="0147";"subkey"="0147";"value"="val0147"};
+{"key"="0148";"subkey"="0148";"value"="val0148"};
+{"key"="0149";"subkey"="0149";"value"="val0149"};
+{"key"="0150";"subkey"="0150";"value"="val0150"};
+{"key"="0151";"subkey"="0151";"value"="val0151"};
+{"key"="0152";"subkey"="0152";"value"="val0152"};
+{"key"="0153";"subkey"="0153";"value"="val0153"};
+{"key"="0154";"subkey"="0154";"value"="val0154"};
+{"key"="0155";"subkey"="0155";"value"="val0155"};
+{"key"="0156";"subkey"="0156";"value"="val0156"};
+{"key"="0157";"subkey"="0157";"value"="val0157"};
+{"key"="0158";"subkey"="0158";"value"="val0158"};
+{"key"="0159";"subkey"="0159";"value"="val0159"};
+{"key"="0160";"subkey"="0160";"value"="val0160"};
+{"key"="0161";"subkey"="0161";"value"="val0161"};
+{"key"="0162";"subkey"="0162";"value"="val0162"};
+{"key"="0163";"subkey"="0163";"value"="val0163"};
+{"key"="0164";"subkey"="0164";"value"="val0164"};
+{"key"="0165";"subkey"="0165";"value"="val0165"};
+{"key"="0166";"subkey"="0166";"value"="val0166"};
+{"key"="0167";"subkey"="0167";"value"="val0167"};
+{"key"="0168";"subkey"="0168";"value"="val0168"};
+{"key"="0169";"subkey"="0169";"value"="val0169"};
+{"key"="0170";"subkey"="0170";"value"="val0170"};
+{"key"="0171";"subkey"="0171";"value"="val0171"};
+{"key"="0172";"subkey"="0172";"value"="val0172"};
+{"key"="0173";"subkey"="0173";"value"="val0173"};
+{"key"="0174";"subkey"="0174";"value"="val0174"};
+{"key"="0175";"subkey"="0175";"value"="val0175"};
+{"key"="0176";"subkey"="0176";"value"="val0176"};
+{"key"="0177";"subkey"="0177";"value"="val0177"};
+{"key"="0178";"subkey"="0178";"value"="val0178"};
+{"key"="0179";"subkey"="0179";"value"="val0179"};
+{"key"="0180";"subkey"="0180";"value"="val0180"};
+{"key"="0181";"subkey"="0181";"value"="val0181"};
+{"key"="0182";"subkey"="0182";"value"="val0182"};
+{"key"="0183";"subkey"="0183";"value"="val0183"};
+{"key"="0184";"subkey"="0184";"value"="val0184"};
+{"key"="0185";"subkey"="0185";"value"="val0185"};
+{"key"="0186";"subkey"="0186";"value"="val0186"};
+{"key"="0187";"subkey"="0187";"value"="val0187"};
+{"key"="0188";"subkey"="0188";"value"="val0188"};
+{"key"="0189";"subkey"="0189";"value"="val0189"};
+{"key"="0190";"subkey"="0190";"value"="val0190"};
+{"key"="0191";"subkey"="0191";"value"="val0191"};
+{"key"="0192";"subkey"="0192";"value"="val0192"};
+{"key"="0193";"subkey"="0193";"value"="val0193"};
+{"key"="0194";"subkey"="0194";"value"="val0194"};
+{"key"="0195";"subkey"="0195";"value"="val0195"};
+{"key"="0196";"subkey"="0196";"value"="val0196"};
+{"key"="0197";"subkey"="0197";"value"="val0197"};
+{"key"="0198";"subkey"="0198";"value"="val0198"};
+{"key"="0199";"subkey"="0199";"value"="val0199"};
+{"key"="0200";"subkey"="0200";"value"="val0200"};
+{"key"="0201";"subkey"="0201";"value"="val0201"};
+{"key"="0202";"subkey"="0202";"value"="val0202"};
+{"key"="0203";"subkey"="0203";"value"="val0203"};
+{"key"="0204";"subkey"="0204";"value"="val0204"};
+{"key"="0205";"subkey"="0205";"value"="val0205"};
+{"key"="0206";"subkey"="0206";"value"="val0206"};
+{"key"="0207";"subkey"="0207";"value"="val0207"};
+{"key"="0208";"subkey"="0208";"value"="val0208"};
+{"key"="0209";"subkey"="0209";"value"="val0209"};
+{"key"="0210";"subkey"="0210";"value"="val0210"};
+{"key"="0211";"subkey"="0211";"value"="val0211"};
+{"key"="0212";"subkey"="0212";"value"="val0212"};
+{"key"="0213";"subkey"="0213";"value"="val0213"};
+{"key"="0214";"subkey"="0214";"value"="val0214"};
+{"key"="0215";"subkey"="0215";"value"="val0215"};
+{"key"="0216";"subkey"="0216";"value"="val0216"};
+{"key"="0217";"subkey"="0217";"value"="val0217"};
+{"key"="0218";"subkey"="0218";"value"="val0218"};
+{"key"="0219";"subkey"="0219";"value"="val0219"};
+{"key"="0220";"subkey"="0220";"value"="val0220"};
+{"key"="0221";"subkey"="0221";"value"="val0221"};
+{"key"="0222";"subkey"="0222";"value"="val0222"};
+{"key"="0223";"subkey"="0223";"value"="val0223"};
+{"key"="0224";"subkey"="0224";"value"="val0224"};
+{"key"="0225";"subkey"="0225";"value"="val0225"};
+{"key"="0226";"subkey"="0226";"value"="val0226"};
+{"key"="0227";"subkey"="0227";"value"="val0227"};
+{"key"="0228";"subkey"="0228";"value"="val0228"};
+{"key"="0229";"subkey"="0229";"value"="val0229"};
+{"key"="0230";"subkey"="0230";"value"="val0230"};
+{"key"="0231";"subkey"="0231";"value"="val0231"};
+{"key"="0232";"subkey"="0232";"value"="val0232"};
+{"key"="0233";"subkey"="0233";"value"="val0233"};
+{"key"="0234";"subkey"="0234";"value"="val0234"};
+{"key"="0235";"subkey"="0235";"value"="val0235"};
+{"key"="0236";"subkey"="0236";"value"="val0236"};
+{"key"="0237";"subkey"="0237";"value"="val0237"};
+{"key"="0238";"subkey"="0238";"value"="val0238"};
+{"key"="0239";"subkey"="0239";"value"="val0239"};
+{"key"="0240";"subkey"="0240";"value"="val0240"};
+{"key"="0241";"subkey"="0241";"value"="val0241"};
+{"key"="0242";"subkey"="0242";"value"="val0242"};
+{"key"="0243";"subkey"="0243";"value"="val0243"};
+{"key"="0244";"subkey"="0244";"value"="val0244"};
+{"key"="0245";"subkey"="0245";"value"="val0245"};
+{"key"="0246";"subkey"="0246";"value"="val0246"};
+{"key"="0247";"subkey"="0247";"value"="val0247"};
+{"key"="0248";"subkey"="0248";"value"="val0248"};
+{"key"="0249";"subkey"="0249";"value"="val0249"};
+{"key"="0250";"subkey"="0250";"value"="val0250"};
+{"key"="0251";"subkey"="0251";"value"="val0251"};
+{"key"="0252";"subkey"="0252";"value"="val0252"};
+{"key"="0253";"subkey"="0253";"value"="val0253"};
+{"key"="0254";"subkey"="0254";"value"="val0254"};
+{"key"="0255";"subkey"="0255";"value"="val0255"};
+{"key"="0256";"subkey"="0256";"value"="val0256"};
+{"key"="0257";"subkey"="0257";"value"="val0257"};
+{"key"="0258";"subkey"="0258";"value"="val0258"};
+{"key"="0259";"subkey"="0259";"value"="val0259"};
+{"key"="0260";"subkey"="0260";"value"="val0260"};
+{"key"="0261";"subkey"="0261";"value"="val0261"};
+{"key"="0262";"subkey"="0262";"value"="val0262"};
+{"key"="0263";"subkey"="0263";"value"="val0263"};
+{"key"="0264";"subkey"="0264";"value"="val0264"};
+{"key"="0265";"subkey"="0265";"value"="val0265"};
+{"key"="0266";"subkey"="0266";"value"="val0266"};
+{"key"="0267";"subkey"="0267";"value"="val0267"};
+{"key"="0268";"subkey"="0268";"value"="val0268"};
+{"key"="0269";"subkey"="0269";"value"="val0269"};
+{"key"="0270";"subkey"="0270";"value"="val0270"};
+{"key"="0271";"subkey"="0271";"value"="val0271"};
+{"key"="0272";"subkey"="0272";"value"="val0272"};
+{"key"="0273";"subkey"="0273";"value"="val0273"};
+{"key"="0274";"subkey"="0274";"value"="val0274"};
+{"key"="0275";"subkey"="0275";"value"="val0275"};
+{"key"="0276";"subkey"="0276";"value"="val0276"};
+{"key"="0277";"subkey"="0277";"value"="val0277"};
+{"key"="0278";"subkey"="0278";"value"="val0278"};
+{"key"="0279";"subkey"="0279";"value"="val0279"};
+{"key"="0280";"subkey"="0280";"value"="val0280"};
+{"key"="0281";"subkey"="0281";"value"="val0281"};
+{"key"="0282";"subkey"="0282";"value"="val0282"};
+{"key"="0283";"subkey"="0283";"value"="val0283"};
+{"key"="0284";"subkey"="0284";"value"="val0284"};
+{"key"="0285";"subkey"="0285";"value"="val0285"};
+{"key"="0286";"subkey"="0286";"value"="val0286"};
+{"key"="0287";"subkey"="0287";"value"="val0287"};
+{"key"="0288";"subkey"="0288";"value"="val0288"};
+{"key"="0289";"subkey"="0289";"value"="val0289"};
+{"key"="0290";"subkey"="0290";"value"="val0290"};
+{"key"="0291";"subkey"="0291";"value"="val0291"};
+{"key"="0292";"subkey"="0292";"value"="val0292"};
+{"key"="0293";"subkey"="0293";"value"="val0293"};
+{"key"="0294";"subkey"="0294";"value"="val0294"};
+{"key"="0295";"subkey"="0295";"value"="val0295"};
+{"key"="0296";"subkey"="0296";"value"="val0296"};
+{"key"="0297";"subkey"="0297";"value"="val0297"};
+{"key"="0298";"subkey"="0298";"value"="val0298"};
+{"key"="0299";"subkey"="0299";"value"="val0299"};
+{"key"="0300";"subkey"="0300";"value"="val0300"};
+{"key"="0301";"subkey"="0301";"value"="val0301"};
+{"key"="0302";"subkey"="0302";"value"="val0302"};
+{"key"="0303";"subkey"="0303";"value"="val0303"};
+{"key"="0304";"subkey"="0304";"value"="val0304"};
+{"key"="0305";"subkey"="0305";"value"="val0305"};
+{"key"="0306";"subkey"="0306";"value"="val0306"};
+{"key"="0307";"subkey"="0307";"value"="val0307"};
+{"key"="0308";"subkey"="0308";"value"="val0308"};
+{"key"="0309";"subkey"="0309";"value"="val0309"};
+{"key"="0310";"subkey"="0310";"value"="val0310"};
+{"key"="0311";"subkey"="0311";"value"="val0311"};
+{"key"="0312";"subkey"="0312";"value"="val0312"};
+{"key"="0313";"subkey"="0313";"value"="val0313"};
+{"key"="0314";"subkey"="0314";"value"="val0314"};
+{"key"="0315";"subkey"="0315";"value"="val0315"};
+{"key"="0316";"subkey"="0316";"value"="val0316"};
+{"key"="0317";"subkey"="0317";"value"="val0317"};
+{"key"="0318";"subkey"="0318";"value"="val0318"};
+{"key"="0319";"subkey"="0319";"value"="val0319"};
+{"key"="0320";"subkey"="0320";"value"="val0320"};
+{"key"="0321";"subkey"="0321";"value"="val0321"};
+{"key"="0322";"subkey"="0322";"value"="val0322"};
+{"key"="0323";"subkey"="0323";"value"="val0323"};
+{"key"="0324";"subkey"="0324";"value"="val0324"};
+{"key"="0325";"subkey"="0325";"value"="val0325"};
+{"key"="0326";"subkey"="0326";"value"="val0326"};
+{"key"="0327";"subkey"="0327";"value"="val0327"};
+{"key"="0328";"subkey"="0328";"value"="val0328"};
+{"key"="0329";"subkey"="0329";"value"="val0329"};
+{"key"="0330";"subkey"="0330";"value"="val0330"};
+{"key"="0331";"subkey"="0331";"value"="val0331"};
+{"key"="0332";"subkey"="0332";"value"="val0332"};
+{"key"="0333";"subkey"="0333";"value"="val0333"};
+{"key"="0334";"subkey"="0334";"value"="val0334"};
+{"key"="0335";"subkey"="0335";"value"="val0335"};
+{"key"="0336";"subkey"="0336";"value"="val0336"};
+{"key"="0337";"subkey"="0337";"value"="val0337"};
+{"key"="0338";"subkey"="0338";"value"="val0338"};
+{"key"="0339";"subkey"="0339";"value"="val0339"};
+{"key"="0340";"subkey"="0340";"value"="val0340"};
+{"key"="0341";"subkey"="0341";"value"="val0341"};
+{"key"="0342";"subkey"="0342";"value"="val0342"};
+{"key"="0343";"subkey"="0343";"value"="val0343"};
+{"key"="0344";"subkey"="0344";"value"="val0344"};
+{"key"="0345";"subkey"="0345";"value"="val0345"};
+{"key"="0346";"subkey"="0346";"value"="val0346"};
+{"key"="0347";"subkey"="0347";"value"="val0347"};
+{"key"="0348";"subkey"="0348";"value"="val0348"};
+{"key"="0349";"subkey"="0349";"value"="val0349"};
+{"key"="0350";"subkey"="0350";"value"="val0350"};
+{"key"="0351";"subkey"="0351";"value"="val0351"};
+{"key"="0352";"subkey"="0352";"value"="val0352"};
+{"key"="0353";"subkey"="0353";"value"="val0353"};
+{"key"="0354";"subkey"="0354";"value"="val0354"};
+{"key"="0355";"subkey"="0355";"value"="val0355"};
+{"key"="0356";"subkey"="0356";"value"="val0356"};
+{"key"="0357";"subkey"="0357";"value"="val0357"};
+{"key"="0358";"subkey"="0358";"value"="val0358"};
+{"key"="0359";"subkey"="0359";"value"="val0359"};
+{"key"="0360";"subkey"="0360";"value"="val0360"};
+{"key"="0361";"subkey"="0361";"value"="val0361"};
+{"key"="0362";"subkey"="0362";"value"="val0362"};
+{"key"="0363";"subkey"="0363";"value"="val0363"};
+{"key"="0364";"subkey"="0364";"value"="val0364"};
+{"key"="0365";"subkey"="0365";"value"="val0365"};
+{"key"="0366";"subkey"="0366";"value"="val0366"};
+{"key"="0367";"subkey"="0367";"value"="val0367"};
+{"key"="0368";"subkey"="0368";"value"="val0368"};
+{"key"="0369";"subkey"="0369";"value"="val0369"};
+{"key"="0370";"subkey"="0370";"value"="val0370"};
+{"key"="0371";"subkey"="0371";"value"="val0371"};
+{"key"="0372";"subkey"="0372";"value"="val0372"};
+{"key"="0373";"subkey"="0373";"value"="val0373"};
+{"key"="0374";"subkey"="0374";"value"="val0374"};
+{"key"="0375";"subkey"="0375";"value"="val0375"};
+{"key"="0376";"subkey"="0376";"value"="val0376"};
+{"key"="0377";"subkey"="0377";"value"="val0377"};
+{"key"="0378";"subkey"="0378";"value"="val0378"};
+{"key"="0379";"subkey"="0379";"value"="val0379"};
+{"key"="0380";"subkey"="0380";"value"="val0380"};
+{"key"="0381";"subkey"="0381";"value"="val0381"};
+{"key"="0382";"subkey"="0382";"value"="val0382"};
+{"key"="0383";"subkey"="0383";"value"="val0383"};
+{"key"="0384";"subkey"="0384";"value"="val0384"};
+{"key"="0385";"subkey"="0385";"value"="val0385"};
+{"key"="0386";"subkey"="0386";"value"="val0386"};
+{"key"="0387";"subkey"="0387";"value"="val0387"};
+{"key"="0388";"subkey"="0388";"value"="val0388"};
+{"key"="0389";"subkey"="0389";"value"="val0389"};
+{"key"="0390";"subkey"="0390";"value"="val0390"};
+{"key"="0391";"subkey"="0391";"value"="val0391"};
+{"key"="0392";"subkey"="0392";"value"="val0392"};
+{"key"="0393";"subkey"="0393";"value"="val0393"};
+{"key"="0394";"subkey"="0394";"value"="val0394"};
+{"key"="0395";"subkey"="0395";"value"="val0395"};
+{"key"="0396";"subkey"="0396";"value"="val0396"};
+{"key"="0397";"subkey"="0397";"value"="val0397"};
+{"key"="0398";"subkey"="0398";"value"="val0398"};
+{"key"="0399";"subkey"="0399";"value"="val0399"};
+{"key"="0400";"subkey"="0400";"value"="val0400"};
+{"key"="0401";"subkey"="0401";"value"="val0401"};
+{"key"="0402";"subkey"="0402";"value"="val0402"};
+{"key"="0403";"subkey"="0403";"value"="val0403"};
+{"key"="0404";"subkey"="0404";"value"="val0404"};
+{"key"="0405";"subkey"="0405";"value"="val0405"};
+{"key"="0406";"subkey"="0406";"value"="val0406"};
+{"key"="0407";"subkey"="0407";"value"="val0407"};
+{"key"="0408";"subkey"="0408";"value"="val0408"};
+{"key"="0409";"subkey"="0409";"value"="val0409"};
+{"key"="0410";"subkey"="0410";"value"="val0410"};
+{"key"="0411";"subkey"="0411";"value"="val0411"};
+{"key"="0412";"subkey"="0412";"value"="val0412"};
+{"key"="0413";"subkey"="0413";"value"="val0413"};
+{"key"="0414";"subkey"="0414";"value"="val0414"};
+{"key"="0415";"subkey"="0415";"value"="val0415"};
+{"key"="0416";"subkey"="0416";"value"="val0416"};
+{"key"="0417";"subkey"="0417";"value"="val0417"};
+{"key"="0418";"subkey"="0418";"value"="val0418"};
+{"key"="0419";"subkey"="0419";"value"="val0419"};
+{"key"="0420";"subkey"="0420";"value"="val0420"};
+{"key"="0421";"subkey"="0421";"value"="val0421"};
+{"key"="0422";"subkey"="0422";"value"="val0422"};
+{"key"="0423";"subkey"="0423";"value"="val0423"};
+{"key"="0424";"subkey"="0424";"value"="val0424"};
+{"key"="0425";"subkey"="0425";"value"="val0425"};
+{"key"="0426";"subkey"="0426";"value"="val0426"};
+{"key"="0427";"subkey"="0427";"value"="val0427"};
+{"key"="0428";"subkey"="0428";"value"="val0428"};
+{"key"="0429";"subkey"="0429";"value"="val0429"};
+{"key"="0430";"subkey"="0430";"value"="val0430"};
+{"key"="0431";"subkey"="0431";"value"="val0431"};
+{"key"="0432";"subkey"="0432";"value"="val0432"};
+{"key"="0433";"subkey"="0433";"value"="val0433"};
+{"key"="0434";"subkey"="0434";"value"="val0434"};
+{"key"="0435";"subkey"="0435";"value"="val0435"};
+{"key"="0436";"subkey"="0436";"value"="val0436"};
+{"key"="0437";"subkey"="0437";"value"="val0437"};
+{"key"="0438";"subkey"="0438";"value"="val0438"};
+{"key"="0439";"subkey"="0439";"value"="val0439"};
+{"key"="0440";"subkey"="0440";"value"="val0440"};
+{"key"="0441";"subkey"="0441";"value"="val0441"};
+{"key"="0442";"subkey"="0442";"value"="val0442"};
+{"key"="0443";"subkey"="0443";"value"="val0443"};
+{"key"="0444";"subkey"="0444";"value"="val0444"};
+{"key"="0445";"subkey"="0445";"value"="val0445"};
+{"key"="0446";"subkey"="0446";"value"="val0446"};
+{"key"="0447";"subkey"="0447";"value"="val0447"};
+{"key"="0448";"subkey"="0448";"value"="val0448"};
+{"key"="0449";"subkey"="0449";"value"="val0449"};
+{"key"="0450";"subkey"="0450";"value"="val0450"};
+{"key"="0451";"subkey"="0451";"value"="val0451"};
+{"key"="0452";"subkey"="0452";"value"="val0452"};
+{"key"="0453";"subkey"="0453";"value"="val0453"};
+{"key"="0454";"subkey"="0454";"value"="val0454"};
+{"key"="0455";"subkey"="0455";"value"="val0455"};
+{"key"="0456";"subkey"="0456";"value"="val0456"};
+{"key"="0457";"subkey"="0457";"value"="val0457"};
+{"key"="0458";"subkey"="0458";"value"="val0458"};
+{"key"="0459";"subkey"="0459";"value"="val0459"};
+{"key"="0460";"subkey"="0460";"value"="val0460"};
+{"key"="0461";"subkey"="0461";"value"="val0461"};
+{"key"="0462";"subkey"="0462";"value"="val0462"};
+{"key"="0463";"subkey"="0463";"value"="val0463"};
+{"key"="0464";"subkey"="0464";"value"="val0464"};
+{"key"="0465";"subkey"="0465";"value"="val0465"};
+{"key"="0466";"subkey"="0466";"value"="val0466"};
+{"key"="0467";"subkey"="0467";"value"="val0467"};
+{"key"="0468";"subkey"="0468";"value"="val0468"};
+{"key"="0469";"subkey"="0469";"value"="val0469"};
+{"key"="0470";"subkey"="0470";"value"="val0470"};
+{"key"="0471";"subkey"="0471";"value"="val0471"};
+{"key"="0472";"subkey"="0472";"value"="val0472"};
+{"key"="0473";"subkey"="0473";"value"="val0473"};
+{"key"="0474";"subkey"="0474";"value"="val0474"};
+{"key"="0475";"subkey"="0475";"value"="val0475"};
+{"key"="0476";"subkey"="0476";"value"="val0476"};
+{"key"="0477";"subkey"="0477";"value"="val0477"};
+{"key"="0478";"subkey"="0478";"value"="val0478"};
+{"key"="0479";"subkey"="0479";"value"="val0479"};
+{"key"="0480";"subkey"="0480";"value"="val0480"};
+{"key"="0481";"subkey"="0481";"value"="val0481"};
+{"key"="0482";"subkey"="0482";"value"="val0482"};
+{"key"="0483";"subkey"="0483";"value"="val0483"};
+{"key"="0484";"subkey"="0484";"value"="val0484"};
+{"key"="0485";"subkey"="0485";"value"="val0485"};
+{"key"="0486";"subkey"="0486";"value"="val0486"};
+{"key"="0487";"subkey"="0487";"value"="val0487"};
+{"key"="0488";"subkey"="0488";"value"="val0488"};
+{"key"="0489";"subkey"="0489";"value"="val0489"};
+{"key"="0490";"subkey"="0490";"value"="val0490"};
+{"key"="0491";"subkey"="0491";"value"="val0491"};
+{"key"="0492";"subkey"="0492";"value"="val0492"};
+{"key"="0493";"subkey"="0493";"value"="val0493"};
+{"key"="0494";"subkey"="0494";"value"="val0494"};
+{"key"="0495";"subkey"="0495";"value"="val0495"};
+{"key"="0496";"subkey"="0496";"value"="val0496"};
+{"key"="0497";"subkey"="0497";"value"="val0497"};
+{"key"="0498";"subkey"="0498";"value"="val0498"};
+{"key"="0499";"subkey"="0499";"value"="val0499"};
+{"key"="0500";"subkey"="0500";"value"="val0500"};
+{"key"="0501";"subkey"="0501";"value"="val0501"};
+{"key"="0502";"subkey"="0502";"value"="val0502"};
+{"key"="0503";"subkey"="0503";"value"="val0503"};
+{"key"="0504";"subkey"="0504";"value"="val0504"};
+{"key"="0505";"subkey"="0505";"value"="val0505"};
+{"key"="0506";"subkey"="0506";"value"="val0506"};
+{"key"="0507";"subkey"="0507";"value"="val0507"};
+{"key"="0508";"subkey"="0508";"value"="val0508"};
+{"key"="0509";"subkey"="0509";"value"="val0509"};
+{"key"="0510";"subkey"="0510";"value"="val0510"};
+{"key"="0511";"subkey"="0511";"value"="val0511"};
+{"key"="0512";"subkey"="0512";"value"="val0512"};
+{"key"="0513";"subkey"="0513";"value"="val0513"};
+{"key"="0514";"subkey"="0514";"value"="val0514"};
+{"key"="0515";"subkey"="0515";"value"="val0515"};
+{"key"="0516";"subkey"="0516";"value"="val0516"};
+{"key"="0517";"subkey"="0517";"value"="val0517"};
+{"key"="0518";"subkey"="0518";"value"="val0518"};
+{"key"="0519";"subkey"="0519";"value"="val0519"};
+{"key"="0520";"subkey"="0520";"value"="val0520"};
+{"key"="0521";"subkey"="0521";"value"="val0521"};
+{"key"="0522";"subkey"="0522";"value"="val0522"};
+{"key"="0523";"subkey"="0523";"value"="val0523"};
+{"key"="0524";"subkey"="0524";"value"="val0524"};
+{"key"="0525";"subkey"="0525";"value"="val0525"};
+{"key"="0526";"subkey"="0526";"value"="val0526"};
+{"key"="0527";"subkey"="0527";"value"="val0527"};
+{"key"="0528";"subkey"="0528";"value"="val0528"};
+{"key"="0529";"subkey"="0529";"value"="val0529"};
+{"key"="0530";"subkey"="0530";"value"="val0530"};
+{"key"="0531";"subkey"="0531";"value"="val0531"};
+{"key"="0532";"subkey"="0532";"value"="val0532"};
+{"key"="0533";"subkey"="0533";"value"="val0533"};
+{"key"="0534";"subkey"="0534";"value"="val0534"};
+{"key"="0535";"subkey"="0535";"value"="val0535"};
+{"key"="0536";"subkey"="0536";"value"="val0536"};
+{"key"="0537";"subkey"="0537";"value"="val0537"};
+{"key"="0538";"subkey"="0538";"value"="val0538"};
+{"key"="0539";"subkey"="0539";"value"="val0539"};
+{"key"="0540";"subkey"="0540";"value"="val0540"};
+{"key"="0541";"subkey"="0541";"value"="val0541"};
+{"key"="0542";"subkey"="0542";"value"="val0542"};
+{"key"="0543";"subkey"="0543";"value"="val0543"};
+{"key"="0544";"subkey"="0544";"value"="val0544"};
+{"key"="0545";"subkey"="0545";"value"="val0545"};
+{"key"="0546";"subkey"="0546";"value"="val0546"};
+{"key"="0547";"subkey"="0547";"value"="val0547"};
+{"key"="0548";"subkey"="0548";"value"="val0548"};
+{"key"="0549";"subkey"="0549";"value"="val0549"};
+{"key"="0550";"subkey"="0550";"value"="val0550"};
+{"key"="0551";"subkey"="0551";"value"="val0551"};
+{"key"="0552";"subkey"="0552";"value"="val0552"};
+{"key"="0553";"subkey"="0553";"value"="val0553"};
+{"key"="0554";"subkey"="0554";"value"="val0554"};
+{"key"="0555";"subkey"="0555";"value"="val0555"};
+{"key"="0556";"subkey"="0556";"value"="val0556"};
+{"key"="0557";"subkey"="0557";"value"="val0557"};
+{"key"="0558";"subkey"="0558";"value"="val0558"};
+{"key"="0559";"subkey"="0559";"value"="val0559"};
+{"key"="0560";"subkey"="0560";"value"="val0560"};
+{"key"="0561";"subkey"="0561";"value"="val0561"};
+{"key"="0562";"subkey"="0562";"value"="val0562"};
+{"key"="0563";"subkey"="0563";"value"="val0563"};
+{"key"="0564";"subkey"="0564";"value"="val0564"};
+{"key"="0565";"subkey"="0565";"value"="val0565"};
+{"key"="0566";"subkey"="0566";"value"="val0566"};
+{"key"="0567";"subkey"="0567";"value"="val0567"};
+{"key"="0568";"subkey"="0568";"value"="val0568"};
+{"key"="0569";"subkey"="0569";"value"="val0569"};
+{"key"="0570";"subkey"="0570";"value"="val0570"};
+{"key"="0571";"subkey"="0571";"value"="val0571"};
+{"key"="0572";"subkey"="0572";"value"="val0572"};
+{"key"="0573";"subkey"="0573";"value"="val0573"};
+{"key"="0574";"subkey"="0574";"value"="val0574"};
+{"key"="0575";"subkey"="0575";"value"="val0575"};
+{"key"="0576";"subkey"="0576";"value"="val0576"};
+{"key"="0577";"subkey"="0577";"value"="val0577"};
+{"key"="0578";"subkey"="0578";"value"="val0578"};
+{"key"="0579";"subkey"="0579";"value"="val0579"};
+{"key"="0580";"subkey"="0580";"value"="val0580"};
+{"key"="0581";"subkey"="0581";"value"="val0581"};
+{"key"="0582";"subkey"="0582";"value"="val0582"};
+{"key"="0583";"subkey"="0583";"value"="val0583"};
+{"key"="0584";"subkey"="0584";"value"="val0584"};
+{"key"="0585";"subkey"="0585";"value"="val0585"};
+{"key"="0586";"subkey"="0586";"value"="val0586"};
+{"key"="0587";"subkey"="0587";"value"="val0587"};
+{"key"="0588";"subkey"="0588";"value"="val0588"};
+{"key"="0589";"subkey"="0589";"value"="val0589"};
+{"key"="0590";"subkey"="0590";"value"="val0590"};
+{"key"="0591";"subkey"="0591";"value"="val0591"};
+{"key"="0592";"subkey"="0592";"value"="val0592"};
+{"key"="0593";"subkey"="0593";"value"="val0593"};
+{"key"="0594";"subkey"="0594";"value"="val0594"};
+{"key"="0595";"subkey"="0595";"value"="val0595"};
+{"key"="0596";"subkey"="0596";"value"="val0596"};
+{"key"="0597";"subkey"="0597";"value"="val0597"};
+{"key"="0598";"subkey"="0598";"value"="val0598"};
+{"key"="0599";"subkey"="0599";"value"="val0599"};
+{"key"="0600";"subkey"="0600";"value"="val0600"};
+{"key"="0601";"subkey"="0601";"value"="val0601"};
+{"key"="0602";"subkey"="0602";"value"="val0602"};
+{"key"="0603";"subkey"="0603";"value"="val0603"};
+{"key"="0604";"subkey"="0604";"value"="val0604"};
+{"key"="0605";"subkey"="0605";"value"="val0605"};
+{"key"="0606";"subkey"="0606";"value"="val0606"};
+{"key"="0607";"subkey"="0607";"value"="val0607"};
+{"key"="0608";"subkey"="0608";"value"="val0608"};
+{"key"="0609";"subkey"="0609";"value"="val0609"};
+{"key"="0610";"subkey"="0610";"value"="val0610"};
+{"key"="0611";"subkey"="0611";"value"="val0611"};
+{"key"="0612";"subkey"="0612";"value"="val0612"};
+{"key"="0613";"subkey"="0613";"value"="val0613"};
+{"key"="0614";"subkey"="0614";"value"="val0614"};
+{"key"="0615";"subkey"="0615";"value"="val0615"};
+{"key"="0616";"subkey"="0616";"value"="val0616"};
+{"key"="0617";"subkey"="0617";"value"="val0617"};
+{"key"="0618";"subkey"="0618";"value"="val0618"};
+{"key"="0619";"subkey"="0619";"value"="val0619"};
+{"key"="0620";"subkey"="0620";"value"="val0620"};
+{"key"="0621";"subkey"="0621";"value"="val0621"};
+{"key"="0622";"subkey"="0622";"value"="val0622"};
+{"key"="0623";"subkey"="0623";"value"="val0623"};
+{"key"="0624";"subkey"="0624";"value"="val0624"};
+{"key"="0625";"subkey"="0625";"value"="val0625"};
+{"key"="0626";"subkey"="0626";"value"="val0626"};
+{"key"="0627";"subkey"="0627";"value"="val0627"};
+{"key"="0628";"subkey"="0628";"value"="val0628"};
+{"key"="0629";"subkey"="0629";"value"="val0629"};
+{"key"="0630";"subkey"="0630";"value"="val0630"};
+{"key"="0631";"subkey"="0631";"value"="val0631"};
+{"key"="0632";"subkey"="0632";"value"="val0632"};
+{"key"="0633";"subkey"="0633";"value"="val0633"};
+{"key"="0634";"subkey"="0634";"value"="val0634"};
+{"key"="0635";"subkey"="0635";"value"="val0635"};
+{"key"="0636";"subkey"="0636";"value"="val0636"};
+{"key"="0637";"subkey"="0637";"value"="val0637"};
+{"key"="0638";"subkey"="0638";"value"="val0638"};
+{"key"="0639";"subkey"="0639";"value"="val0639"};
+{"key"="0640";"subkey"="0640";"value"="val0640"};
+{"key"="0641";"subkey"="0641";"value"="val0641"};
+{"key"="0642";"subkey"="0642";"value"="val0642"};
+{"key"="0643";"subkey"="0643";"value"="val0643"};
+{"key"="0644";"subkey"="0644";"value"="val0644"};
+{"key"="0645";"subkey"="0645";"value"="val0645"};
+{"key"="0646";"subkey"="0646";"value"="val0646"};
+{"key"="0647";"subkey"="0647";"value"="val0647"};
+{"key"="0648";"subkey"="0648";"value"="val0648"};
+{"key"="0649";"subkey"="0649";"value"="val0649"};
+{"key"="0650";"subkey"="0650";"value"="val0650"};
+{"key"="0651";"subkey"="0651";"value"="val0651"};
+{"key"="0652";"subkey"="0652";"value"="val0652"};
+{"key"="0653";"subkey"="0653";"value"="val0653"};
+{"key"="0654";"subkey"="0654";"value"="val0654"};
+{"key"="0655";"subkey"="0655";"value"="val0655"};
+{"key"="0656";"subkey"="0656";"value"="val0656"};
+{"key"="0657";"subkey"="0657";"value"="val0657"};
+{"key"="0658";"subkey"="0658";"value"="val0658"};
+{"key"="0659";"subkey"="0659";"value"="val0659"};
+{"key"="0660";"subkey"="0660";"value"="val0660"};
+{"key"="0661";"subkey"="0661";"value"="val0661"};
+{"key"="0662";"subkey"="0662";"value"="val0662"};
+{"key"="0663";"subkey"="0663";"value"="val0663"};
+{"key"="0664";"subkey"="0664";"value"="val0664"};
+{"key"="0665";"subkey"="0665";"value"="val0665"};
+{"key"="0666";"subkey"="0666";"value"="val0666"};
+{"key"="0667";"subkey"="0667";"value"="val0667"};
+{"key"="0668";"subkey"="0668";"value"="val0668"};
+{"key"="0669";"subkey"="0669";"value"="val0669"};
+{"key"="0670";"subkey"="0670";"value"="val0670"};
+{"key"="0671";"subkey"="0671";"value"="val0671"};
+{"key"="0672";"subkey"="0672";"value"="val0672"};
+{"key"="0673";"subkey"="0673";"value"="val0673"};
+{"key"="0674";"subkey"="0674";"value"="val0674"};
+{"key"="0675";"subkey"="0675";"value"="val0675"};
+{"key"="0676";"subkey"="0676";"value"="val0676"};
+{"key"="0677";"subkey"="0677";"value"="val0677"};
+{"key"="0678";"subkey"="0678";"value"="val0678"};
+{"key"="0679";"subkey"="0679";"value"="val0679"};
+{"key"="0680";"subkey"="0680";"value"="val0680"};
+{"key"="0681";"subkey"="0681";"value"="val0681"};
+{"key"="0682";"subkey"="0682";"value"="val0682"};
+{"key"="0683";"subkey"="0683";"value"="val0683"};
+{"key"="0684";"subkey"="0684";"value"="val0684"};
+{"key"="0685";"subkey"="0685";"value"="val0685"};
+{"key"="0686";"subkey"="0686";"value"="val0686"};
+{"key"="0687";"subkey"="0687";"value"="val0687"};
+{"key"="0688";"subkey"="0688";"value"="val0688"};
+{"key"="0689";"subkey"="0689";"value"="val0689"};
+{"key"="0690";"subkey"="0690";"value"="val0690"};
+{"key"="0691";"subkey"="0691";"value"="val0691"};
+{"key"="0692";"subkey"="0692";"value"="val0692"};
+{"key"="0693";"subkey"="0693";"value"="val0693"};
+{"key"="0694";"subkey"="0694";"value"="val0694"};
+{"key"="0695";"subkey"="0695";"value"="val0695"};
+{"key"="0696";"subkey"="0696";"value"="val0696"};
+{"key"="0697";"subkey"="0697";"value"="val0697"};
+{"key"="0698";"subkey"="0698";"value"="val0698"};
+{"key"="0699";"subkey"="0699";"value"="val0699"};
+{"key"="0700";"subkey"="0700";"value"="val0700"};
+{"key"="0701";"subkey"="0701";"value"="val0701"};
+{"key"="0702";"subkey"="0702";"value"="val0702"};
+{"key"="0703";"subkey"="0703";"value"="val0703"};
+{"key"="0704";"subkey"="0704";"value"="val0704"};
+{"key"="0705";"subkey"="0705";"value"="val0705"};
+{"key"="0706";"subkey"="0706";"value"="val0706"};
+{"key"="0707";"subkey"="0707";"value"="val0707"};
+{"key"="0708";"subkey"="0708";"value"="val0708"};
+{"key"="0709";"subkey"="0709";"value"="val0709"};
+{"key"="0710";"subkey"="0710";"value"="val0710"};
+{"key"="0711";"subkey"="0711";"value"="val0711"};
+{"key"="0712";"subkey"="0712";"value"="val0712"};
+{"key"="0713";"subkey"="0713";"value"="val0713"};
+{"key"="0714";"subkey"="0714";"value"="val0714"};
+{"key"="0715";"subkey"="0715";"value"="val0715"};
+{"key"="0716";"subkey"="0716";"value"="val0716"};
+{"key"="0717";"subkey"="0717";"value"="val0717"};
+{"key"="0718";"subkey"="0718";"value"="val0718"};
+{"key"="0719";"subkey"="0719";"value"="val0719"};
+{"key"="0720";"subkey"="0720";"value"="val0720"};
+{"key"="0721";"subkey"="0721";"value"="val0721"};
+{"key"="0722";"subkey"="0722";"value"="val0722"};
+{"key"="0723";"subkey"="0723";"value"="val0723"};
+{"key"="0724";"subkey"="0724";"value"="val0724"};
+{"key"="0725";"subkey"="0725";"value"="val0725"};
+{"key"="0726";"subkey"="0726";"value"="val0726"};
+{"key"="0727";"subkey"="0727";"value"="val0727"};
+{"key"="0728";"subkey"="0728";"value"="val0728"};
+{"key"="0729";"subkey"="0729";"value"="val0729"};
+{"key"="0730";"subkey"="0730";"value"="val0730"};
+{"key"="0731";"subkey"="0731";"value"="val0731"};
+{"key"="0732";"subkey"="0732";"value"="val0732"};
+{"key"="0733";"subkey"="0733";"value"="val0733"};
+{"key"="0734";"subkey"="0734";"value"="val0734"};
+{"key"="0735";"subkey"="0735";"value"="val0735"};
+{"key"="0736";"subkey"="0736";"value"="val0736"};
+{"key"="0737";"subkey"="0737";"value"="val0737"};
+{"key"="0738";"subkey"="0738";"value"="val0738"};
+{"key"="0739";"subkey"="0739";"value"="val0739"};
+{"key"="0740";"subkey"="0740";"value"="val0740"};
+{"key"="0741";"subkey"="0741";"value"="val0741"};
+{"key"="0742";"subkey"="0742";"value"="val0742"};
+{"key"="0743";"subkey"="0743";"value"="val0743"};
+{"key"="0744";"subkey"="0744";"value"="val0744"};
+{"key"="0745";"subkey"="0745";"value"="val0745"};
+{"key"="0746";"subkey"="0746";"value"="val0746"};
+{"key"="0747";"subkey"="0747";"value"="val0747"};
+{"key"="0748";"subkey"="0748";"value"="val0748"};
+{"key"="0749";"subkey"="0749";"value"="val0749"};
+{"key"="0750";"subkey"="0750";"value"="val0750"};
+{"key"="0751";"subkey"="0751";"value"="val0751"};
+{"key"="0752";"subkey"="0752";"value"="val0752"};
+{"key"="0753";"subkey"="0753";"value"="val0753"};
+{"key"="0754";"subkey"="0754";"value"="val0754"};
+{"key"="0755";"subkey"="0755";"value"="val0755"};
+{"key"="0756";"subkey"="0756";"value"="val0756"};
+{"key"="0757";"subkey"="0757";"value"="val0757"};
+{"key"="0758";"subkey"="0758";"value"="val0758"};
+{"key"="0759";"subkey"="0759";"value"="val0759"};
+{"key"="0760";"subkey"="0760";"value"="val0760"};
+{"key"="0761";"subkey"="0761";"value"="val0761"};
+{"key"="0762";"subkey"="0762";"value"="val0762"};
+{"key"="0763";"subkey"="0763";"value"="val0763"};
+{"key"="0764";"subkey"="0764";"value"="val0764"};
+{"key"="0765";"subkey"="0765";"value"="val0765"};
+{"key"="0766";"subkey"="0766";"value"="val0766"};
+{"key"="0767";"subkey"="0767";"value"="val0767"};
+{"key"="0768";"subkey"="0768";"value"="val0768"};
+{"key"="0769";"subkey"="0769";"value"="val0769"};
+{"key"="0770";"subkey"="0770";"value"="val0770"};
+{"key"="0771";"subkey"="0771";"value"="val0771"};
+{"key"="0772";"subkey"="0772";"value"="val0772"};
+{"key"="0773";"subkey"="0773";"value"="val0773"};
+{"key"="0774";"subkey"="0774";"value"="val0774"};
+{"key"="0775";"subkey"="0775";"value"="val0775"};
+{"key"="0776";"subkey"="0776";"value"="val0776"};
+{"key"="0777";"subkey"="0777";"value"="val0777"};
+{"key"="0778";"subkey"="0778";"value"="val0778"};
+{"key"="0779";"subkey"="0779";"value"="val0779"};
+{"key"="0780";"subkey"="0780";"value"="val0780"};
+{"key"="0781";"subkey"="0781";"value"="val0781"};
+{"key"="0782";"subkey"="0782";"value"="val0782"};
+{"key"="0783";"subkey"="0783";"value"="val0783"};
+{"key"="0784";"subkey"="0784";"value"="val0784"};
+{"key"="0785";"subkey"="0785";"value"="val0785"};
+{"key"="0786";"subkey"="0786";"value"="val0786"};
+{"key"="0787";"subkey"="0787";"value"="val0787"};
+{"key"="0788";"subkey"="0788";"value"="val0788"};
+{"key"="0789";"subkey"="0789";"value"="val0789"};
+{"key"="0790";"subkey"="0790";"value"="val0790"};
+{"key"="0791";"subkey"="0791";"value"="val0791"};
+{"key"="0792";"subkey"="0792";"value"="val0792"};
+{"key"="0793";"subkey"="0793";"value"="val0793"};
+{"key"="0794";"subkey"="0794";"value"="val0794"};
+{"key"="0795";"subkey"="0795";"value"="val0795"};
+{"key"="0796";"subkey"="0796";"value"="val0796"};
+{"key"="0797";"subkey"="0797";"value"="val0797"};
+{"key"="0798";"subkey"="0798";"value"="val0798"};
+{"key"="0799";"subkey"="0799";"value"="val0799"};
+{"key"="0800";"subkey"="0800";"value"="val0800"};
+{"key"="0801";"subkey"="0801";"value"="val0801"};
+{"key"="0802";"subkey"="0802";"value"="val0802"};
+{"key"="0803";"subkey"="0803";"value"="val0803"};
+{"key"="0804";"subkey"="0804";"value"="val0804"};
+{"key"="0805";"subkey"="0805";"value"="val0805"};
+{"key"="0806";"subkey"="0806";"value"="val0806"};
+{"key"="0807";"subkey"="0807";"value"="val0807"};
+{"key"="0808";"subkey"="0808";"value"="val0808"};
+{"key"="0809";"subkey"="0809";"value"="val0809"};
+{"key"="0810";"subkey"="0810";"value"="val0810"};
+{"key"="0811";"subkey"="0811";"value"="val0811"};
+{"key"="0812";"subkey"="0812";"value"="val0812"};
+{"key"="0813";"subkey"="0813";"value"="val0813"};
+{"key"="0814";"subkey"="0814";"value"="val0814"};
+{"key"="0815";"subkey"="0815";"value"="val0815"};
+{"key"="0816";"subkey"="0816";"value"="val0816"};
+{"key"="0817";"subkey"="0817";"value"="val0817"};
+{"key"="0818";"subkey"="0818";"value"="val0818"};
+{"key"="0819";"subkey"="0819";"value"="val0819"};
+{"key"="0820";"subkey"="0820";"value"="val0820"};
+{"key"="0821";"subkey"="0821";"value"="val0821"};
+{"key"="0822";"subkey"="0822";"value"="val0822"};
+{"key"="0823";"subkey"="0823";"value"="val0823"};
+{"key"="0824";"subkey"="0824";"value"="val0824"};
+{"key"="0825";"subkey"="0825";"value"="val0825"};
+{"key"="0826";"subkey"="0826";"value"="val0826"};
+{"key"="0827";"subkey"="0827";"value"="val0827"};
+{"key"="0828";"subkey"="0828";"value"="val0828"};
+{"key"="0829";"subkey"="0829";"value"="val0829"};
+{"key"="0830";"subkey"="0830";"value"="val0830"};
+{"key"="0831";"subkey"="0831";"value"="val0831"};
+{"key"="0832";"subkey"="0832";"value"="val0832"};
+{"key"="0833";"subkey"="0833";"value"="val0833"};
+{"key"="0834";"subkey"="0834";"value"="val0834"};
+{"key"="0835";"subkey"="0835";"value"="val0835"};
+{"key"="0836";"subkey"="0836";"value"="val0836"};
+{"key"="0837";"subkey"="0837";"value"="val0837"};
+{"key"="0838";"subkey"="0838";"value"="val0838"};
+{"key"="0839";"subkey"="0839";"value"="val0839"};
+{"key"="0840";"subkey"="0840";"value"="val0840"};
+{"key"="0841";"subkey"="0841";"value"="val0841"};
+{"key"="0842";"subkey"="0842";"value"="val0842"};
+{"key"="0843";"subkey"="0843";"value"="val0843"};
+{"key"="0844";"subkey"="0844";"value"="val0844"};
+{"key"="0845";"subkey"="0845";"value"="val0845"};
+{"key"="0846";"subkey"="0846";"value"="val0846"};
+{"key"="0847";"subkey"="0847";"value"="val0847"};
+{"key"="0848";"subkey"="0848";"value"="val0848"};
+{"key"="0849";"subkey"="0849";"value"="val0849"};
+{"key"="0850";"subkey"="0850";"value"="val0850"};
+{"key"="0851";"subkey"="0851";"value"="val0851"};
+{"key"="0852";"subkey"="0852";"value"="val0852"};
+{"key"="0853";"subkey"="0853";"value"="val0853"};
+{"key"="0854";"subkey"="0854";"value"="val0854"};
+{"key"="0855";"subkey"="0855";"value"="val0855"};
+{"key"="0856";"subkey"="0856";"value"="val0856"};
+{"key"="0857";"subkey"="0857";"value"="val0857"};
+{"key"="0858";"subkey"="0858";"value"="val0858"};
+{"key"="0859";"subkey"="0859";"value"="val0859"};
+{"key"="0860";"subkey"="0860";"value"="val0860"};
+{"key"="0861";"subkey"="0861";"value"="val0861"};
+{"key"="0862";"subkey"="0862";"value"="val0862"};
+{"key"="0863";"subkey"="0863";"value"="val0863"};
+{"key"="0864";"subkey"="0864";"value"="val0864"};
+{"key"="0865";"subkey"="0865";"value"="val0865"};
+{"key"="0866";"subkey"="0866";"value"="val0866"};
+{"key"="0867";"subkey"="0867";"value"="val0867"};
+{"key"="0868";"subkey"="0868";"value"="val0868"};
+{"key"="0869";"subkey"="0869";"value"="val0869"};
+{"key"="0870";"subkey"="0870";"value"="val0870"};
+{"key"="0871";"subkey"="0871";"value"="val0871"};
+{"key"="0872";"subkey"="0872";"value"="val0872"};
+{"key"="0873";"subkey"="0873";"value"="val0873"};
+{"key"="0874";"subkey"="0874";"value"="val0874"};
+{"key"="0875";"subkey"="0875";"value"="val0875"};
+{"key"="0876";"subkey"="0876";"value"="val0876"};
+{"key"="0877";"subkey"="0877";"value"="val0877"};
+{"key"="0878";"subkey"="0878";"value"="val0878"};
+{"key"="0879";"subkey"="0879";"value"="val0879"};
+{"key"="0880";"subkey"="0880";"value"="val0880"};
+{"key"="0881";"subkey"="0881";"value"="val0881"};
+{"key"="0882";"subkey"="0882";"value"="val0882"};
+{"key"="0883";"subkey"="0883";"value"="val0883"};
+{"key"="0884";"subkey"="0884";"value"="val0884"};
+{"key"="0885";"subkey"="0885";"value"="val0885"};
+{"key"="0886";"subkey"="0886";"value"="val0886"};
+{"key"="0887";"subkey"="0887";"value"="val0887"};
+{"key"="0888";"subkey"="0888";"value"="val0888"};
+{"key"="0889";"subkey"="0889";"value"="val0889"};
+{"key"="0890";"subkey"="0890";"value"="val0890"};
+{"key"="0891";"subkey"="0891";"value"="val0891"};
+{"key"="0892";"subkey"="0892";"value"="val0892"};
+{"key"="0893";"subkey"="0893";"value"="val0893"};
+{"key"="0894";"subkey"="0894";"value"="val0894"};
+{"key"="0895";"subkey"="0895";"value"="val0895"};
+{"key"="0896";"subkey"="0896";"value"="val0896"};
+{"key"="0897";"subkey"="0897";"value"="val0897"};
+{"key"="0898";"subkey"="0898";"value"="val0898"};
+{"key"="0899";"subkey"="0899";"value"="val0899"};
+{"key"="0900";"subkey"="0900";"value"="val0900"};
+{"key"="0901";"subkey"="0901";"value"="val0901"};
+{"key"="0902";"subkey"="0902";"value"="val0902"};
+{"key"="0903";"subkey"="0903";"value"="val0903"};
+{"key"="0904";"subkey"="0904";"value"="val0904"};
+{"key"="0905";"subkey"="0905";"value"="val0905"};
+{"key"="0906";"subkey"="0906";"value"="val0906"};
+{"key"="0907";"subkey"="0907";"value"="val0907"};
+{"key"="0908";"subkey"="0908";"value"="val0908"};
+{"key"="0909";"subkey"="0909";"value"="val0909"};
+{"key"="0910";"subkey"="0910";"value"="val0910"};
+{"key"="0911";"subkey"="0911";"value"="val0911"};
+{"key"="0912";"subkey"="0912";"value"="val0912"};
+{"key"="0913";"subkey"="0913";"value"="val0913"};
+{"key"="0914";"subkey"="0914";"value"="val0914"};
+{"key"="0915";"subkey"="0915";"value"="val0915"};
+{"key"="0916";"subkey"="0916";"value"="val0916"};
+{"key"="0917";"subkey"="0917";"value"="val0917"};
+{"key"="0918";"subkey"="0918";"value"="val0918"};
+{"key"="0919";"subkey"="0919";"value"="val0919"};
+{"key"="0920";"subkey"="0920";"value"="val0920"};
+{"key"="0921";"subkey"="0921";"value"="val0921"};
+{"key"="0922";"subkey"="0922";"value"="val0922"};
+{"key"="0923";"subkey"="0923";"value"="val0923"};
+{"key"="0924";"subkey"="0924";"value"="val0924"};
+{"key"="0925";"subkey"="0925";"value"="val0925"};
+{"key"="0926";"subkey"="0926";"value"="val0926"};
+{"key"="0927";"subkey"="0927";"value"="val0927"};
+{"key"="0928";"subkey"="0928";"value"="val0928"};
+{"key"="0929";"subkey"="0929";"value"="val0929"};
+{"key"="0930";"subkey"="0930";"value"="val0930"};
+{"key"="0931";"subkey"="0931";"value"="val0931"};
+{"key"="0932";"subkey"="0932";"value"="val0932"};
+{"key"="0933";"subkey"="0933";"value"="val0933"};
+{"key"="0934";"subkey"="0934";"value"="val0934"};
+{"key"="0935";"subkey"="0935";"value"="val0935"};
+{"key"="0936";"subkey"="0936";"value"="val0936"};
+{"key"="0937";"subkey"="0937";"value"="val0937"};
+{"key"="0938";"subkey"="0938";"value"="val0938"};
+{"key"="0939";"subkey"="0939";"value"="val0939"};
+{"key"="0940";"subkey"="0940";"value"="val0940"};
+{"key"="0941";"subkey"="0941";"value"="val0941"};
+{"key"="0942";"subkey"="0942";"value"="val0942"};
+{"key"="0943";"subkey"="0943";"value"="val0943"};
+{"key"="0944";"subkey"="0944";"value"="val0944"};
+{"key"="0945";"subkey"="0945";"value"="val0945"};
+{"key"="0946";"subkey"="0946";"value"="val0946"};
+{"key"="0947";"subkey"="0947";"value"="val0947"};
+{"key"="0948";"subkey"="0948";"value"="val0948"};
+{"key"="0949";"subkey"="0949";"value"="val0949"};
+{"key"="0950";"subkey"="0950";"value"="val0950"};
+{"key"="0951";"subkey"="0951";"value"="val0951"};
+{"key"="0952";"subkey"="0952";"value"="val0952"};
+{"key"="0953";"subkey"="0953";"value"="val0953"};
+{"key"="0954";"subkey"="0954";"value"="val0954"};
+{"key"="0955";"subkey"="0955";"value"="val0955"};
+{"key"="0956";"subkey"="0956";"value"="val0956"};
+{"key"="0957";"subkey"="0957";"value"="val0957"};
+{"key"="0958";"subkey"="0958";"value"="val0958"};
+{"key"="0959";"subkey"="0959";"value"="val0959"};
+{"key"="0960";"subkey"="0960";"value"="val0960"};
+{"key"="0961";"subkey"="0961";"value"="val0961"};
+{"key"="0962";"subkey"="0962";"value"="val0962"};
+{"key"="0963";"subkey"="0963";"value"="val0963"};
+{"key"="0964";"subkey"="0964";"value"="val0964"};
+{"key"="0965";"subkey"="0965";"value"="val0965"};
+{"key"="0966";"subkey"="0966";"value"="val0966"};
+{"key"="0967";"subkey"="0967";"value"="val0967"};
+{"key"="0968";"subkey"="0968";"value"="val0968"};
+{"key"="0969";"subkey"="0969";"value"="val0969"};
+{"key"="0970";"subkey"="0970";"value"="val0970"};
+{"key"="0971";"subkey"="0971";"value"="val0971"};
+{"key"="0972";"subkey"="0972";"value"="val0972"};
+{"key"="0973";"subkey"="0973";"value"="val0973"};
+{"key"="0974";"subkey"="0974";"value"="val0974"};
+{"key"="0975";"subkey"="0975";"value"="val0975"};
+{"key"="0976";"subkey"="0976";"value"="val0976"};
+{"key"="0977";"subkey"="0977";"value"="val0977"};
+{"key"="0978";"subkey"="0978";"value"="val0978"};
+{"key"="0979";"subkey"="0979";"value"="val0979"};
+{"key"="0980";"subkey"="0980";"value"="val0980"};
+{"key"="0981";"subkey"="0981";"value"="val0981"};
+{"key"="0982";"subkey"="0982";"value"="val0982"};
+{"key"="0983";"subkey"="0983";"value"="val0983"};
+{"key"="0984";"subkey"="0984";"value"="val0984"};
+{"key"="0985";"subkey"="0985";"value"="val0985"};
+{"key"="0986";"subkey"="0986";"value"="val0986"};
+{"key"="0987";"subkey"="0987";"value"="val0987"};
+{"key"="0988";"subkey"="0988";"value"="val0988"};
+{"key"="0989";"subkey"="0989";"value"="val0989"};
+{"key"="0990";"subkey"="0990";"value"="val0990"};
+{"key"="0991";"subkey"="0991";"value"="val0991"};
+{"key"="0992";"subkey"="0992";"value"="val0992"};
+{"key"="0993";"subkey"="0993";"value"="val0993"};
+{"key"="0994";"subkey"="0994";"value"="val0994"};
+{"key"="0995";"subkey"="0995";"value"="val0995"};
+{"key"="0996";"subkey"="0996";"value"="val0996"};
+{"key"="0997";"subkey"="0997";"value"="val0997"};
+{"key"="0998";"subkey"="0998";"value"="val0998"};
+{"key"="0999";"subkey"="0999";"value"="val0999"};
+{"key"="1000";"subkey"="1000";"value"="val1000"};
+{"key"="1001";"subkey"="1001";"value"="val1001"};
+{"key"="1002";"subkey"="1002";"value"="val1002"};
+{"key"="1003";"subkey"="1003";"value"="val1003"};
+{"key"="1004";"subkey"="1004";"value"="val1004"};
+{"key"="1005";"subkey"="1005";"value"="val1005"};
+{"key"="1006";"subkey"="1006";"value"="val1006"};
+{"key"="1007";"subkey"="1007";"value"="val1007"};
+{"key"="1008";"subkey"="1008";"value"="val1008"};
+{"key"="1009";"subkey"="1009";"value"="val1009"};
+{"key"="1010";"subkey"="1010";"value"="val1010"};
+{"key"="1011";"subkey"="1011";"value"="val1011"};
+{"key"="1012";"subkey"="1012";"value"="val1012"};
+{"key"="1013";"subkey"="1013";"value"="val1013"};
+{"key"="1014";"subkey"="1014";"value"="val1014"};
+{"key"="1015";"subkey"="1015";"value"="val1015"};
+{"key"="1016";"subkey"="1016";"value"="val1016"};
+{"key"="1017";"subkey"="1017";"value"="val1017"};
+{"key"="1018";"subkey"="1018";"value"="val1018"};
+{"key"="1019";"subkey"="1019";"value"="val1019"};
+{"key"="1020";"subkey"="1020";"value"="val1020"};
+{"key"="1021";"subkey"="1021";"value"="val1021"};
+{"key"="1022";"subkey"="1022";"value"="val1022"};
+{"key"="1023";"subkey"="1023";"value"="val1023"};
+{"key"="1024";"subkey"="1024";"value"="val1024"};
+{"key"="1025";"subkey"="1025";"value"="val1025"};
+{"key"="1026";"subkey"="1026";"value"="val1026"};
+{"key"="1027";"subkey"="1027";"value"="val1027"};
+{"key"="1028";"subkey"="1028";"value"="val1028"};
+{"key"="1029";"subkey"="1029";"value"="val1029"};
+{"key"="1030";"subkey"="1030";"value"="val1030"};
+{"key"="1031";"subkey"="1031";"value"="val1031"};
+{"key"="1032";"subkey"="1032";"value"="val1032"};
+{"key"="1033";"subkey"="1033";"value"="val1033"};
+{"key"="1034";"subkey"="1034";"value"="val1034"};
+{"key"="1035";"subkey"="1035";"value"="val1035"};
+{"key"="1036";"subkey"="1036";"value"="val1036"};
+{"key"="1037";"subkey"="1037";"value"="val1037"};
+{"key"="1038";"subkey"="1038";"value"="val1038"};
+{"key"="1039";"subkey"="1039";"value"="val1039"};
+{"key"="1040";"subkey"="1040";"value"="val1040"};
+{"key"="1041";"subkey"="1041";"value"="val1041"};
+{"key"="1042";"subkey"="1042";"value"="val1042"};
+{"key"="1043";"subkey"="1043";"value"="val1043"};
+{"key"="1044";"subkey"="1044";"value"="val1044"};
+{"key"="1045";"subkey"="1045";"value"="val1045"};
+{"key"="1046";"subkey"="1046";"value"="val1046"};
+{"key"="1047";"subkey"="1047";"value"="val1047"};
+{"key"="1048";"subkey"="1048";"value"="val1048"};
+{"key"="1049";"subkey"="1049";"value"="val1049"};
+{"key"="1050";"subkey"="1050";"value"="val1050"};
+{"key"="1051";"subkey"="1051";"value"="val1051"};
+{"key"="1052";"subkey"="1052";"value"="val1052"};
+{"key"="1053";"subkey"="1053";"value"="val1053"};
+{"key"="1054";"subkey"="1054";"value"="val1054"};
+{"key"="1055";"subkey"="1055";"value"="val1055"};
+{"key"="1056";"subkey"="1056";"value"="val1056"};
+{"key"="1057";"subkey"="1057";"value"="val1057"};
+{"key"="1058";"subkey"="1058";"value"="val1058"};
+{"key"="1059";"subkey"="1059";"value"="val1059"};
+{"key"="1060";"subkey"="1060";"value"="val1060"};
+{"key"="1061";"subkey"="1061";"value"="val1061"};
+{"key"="1062";"subkey"="1062";"value"="val1062"};
+{"key"="1063";"subkey"="1063";"value"="val1063"};
+{"key"="1064";"subkey"="1064";"value"="val1064"};
+{"key"="1065";"subkey"="1065";"value"="val1065"};
+{"key"="1066";"subkey"="1066";"value"="val1066"};
+{"key"="1067";"subkey"="1067";"value"="val1067"};
+{"key"="1068";"subkey"="1068";"value"="val1068"};
+{"key"="1069";"subkey"="1069";"value"="val1069"};
+{"key"="1070";"subkey"="1070";"value"="val1070"};
+{"key"="1071";"subkey"="1071";"value"="val1071"};
+{"key"="1072";"subkey"="1072";"value"="val1072"};
+{"key"="1073";"subkey"="1073";"value"="val1073"};
+{"key"="1074";"subkey"="1074";"value"="val1074"};
+{"key"="1075";"subkey"="1075";"value"="val1075"};
+{"key"="1076";"subkey"="1076";"value"="val1076"};
+{"key"="1077";"subkey"="1077";"value"="val1077"};
+{"key"="1078";"subkey"="1078";"value"="val1078"};
+{"key"="1079";"subkey"="1079";"value"="val1079"};
+{"key"="1080";"subkey"="1080";"value"="val1080"};
+{"key"="1081";"subkey"="1081";"value"="val1081"};
+{"key"="1082";"subkey"="1082";"value"="val1082"};
+{"key"="1083";"subkey"="1083";"value"="val1083"};
+{"key"="1084";"subkey"="1084";"value"="val1084"};
+{"key"="1085";"subkey"="1085";"value"="val1085"};
+{"key"="1086";"subkey"="1086";"value"="val1086"};
+{"key"="1087";"subkey"="1087";"value"="val1087"};
+{"key"="1088";"subkey"="1088";"value"="val1088"};
+{"key"="1089";"subkey"="1089";"value"="val1089"};
+{"key"="1090";"subkey"="1090";"value"="val1090"};
+{"key"="1091";"subkey"="1091";"value"="val1091"};
+{"key"="1092";"subkey"="1092";"value"="val1092"};
+{"key"="1093";"subkey"="1093";"value"="val1093"};
+{"key"="1094";"subkey"="1094";"value"="val1094"};
+{"key"="1095";"subkey"="1095";"value"="val1095"};
+{"key"="1096";"subkey"="1096";"value"="val1096"};
+{"key"="1097";"subkey"="1097";"value"="val1097"};
+{"key"="1098";"subkey"="1098";"value"="val1098"};
+{"key"="1099";"subkey"="1099";"value"="val1099"};
diff --git a/yql/essentials/tests/sql/suites/select/input2.txt b/yql/essentials/tests/sql/suites/select/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/select/input3.txt b/yql/essentials/tests/sql/suites/select/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/select/input4.txt b/yql/essentials/tests/sql/suites/select/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/select/input_expr.txt b/yql/essentials/tests/sql/suites/select/input_expr.txt
new file mode 100644
index 0000000000..621e7eaead
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input_expr.txt
@@ -0,0 +1,10 @@
+{"key"="192";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="15";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="15";"value"="aaa"};
+{"key"="527";"subkey"="1";"value"="bbb"};
+{"key"="037";"subkey"="15";"value"="ddd"};
+{"key"="761";"subkey"="1";"value"="ccc"};
+{"key"="200";"subkey"="5";"value"="qqq"};
+{"key"="150";"subkey"="5";"value"="zzz"};
+{"key"="042";"subkey"="15";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/select/input_intersect.txt b/yql/essentials/tests/sql/suites/select/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/select/input_struct_field.txt b/yql/essentials/tests/sql/suites/select/input_struct_field.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input_struct_field.txt
diff --git a/yql/essentials/tests/sql/suites/select/input_struct_field.txt.attr b/yql/essentials/tests/sql/suites/select/input_struct_field.txt.attr
new file mode 100644
index 0000000000..bcc8251d99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/input_struct_field.txt.attr
@@ -0,0 +1,11 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["StructType";[
+ ["kk";["DataType";"String"]];
+ ]]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]];
+ ]];
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/select/literal_bool.sql b/yql/essentials/tests/sql/suites/select/literal_bool.sql
new file mode 100644
index 0000000000..0cd9f9bac2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/literal_bool.sql
@@ -0,0 +1 @@
+select key, subkey, cast(true as varchar) as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/literal_negative.sql b/yql/essentials/tests/sql/suites/select/literal_negative.sql
new file mode 100644
index 0000000000..de18406964
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/literal_negative.sql
@@ -0,0 +1 @@
+select key, subkey, cast(-1 as varchar) as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/logical_ops.sql b/yql/essentials/tests/sql/suites/select/logical_ops.sql
new file mode 100644
index 0000000000..062a3366d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/logical_ops.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+SELECT
+ LENGTH(key) == 3 AND LENGTH(value) == 3 as and_res,
+ LENGTH(key) == 3 OR LENGTH(value) == 3 as or_res,
+ LENGTH(key) == 3 XOR LENGTH(value) == 3 as xor_res
+FROM plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/match_clause.cfg b/yql/essentials/tests/sql/suites/select/match_clause.cfg
new file mode 100644
index 0000000000..93eff5b6bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/match_clause.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+udf re2_udf
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/select/match_clause.sql b/yql/essentials/tests/sql/suites/select/match_clause.sql
new file mode 100644
index 0000000000..9efb61a9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/match_clause.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+select key, subkey, value from plato.Input
+where value match "q";
diff --git a/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.cfg b/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.sql b/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.sql
new file mode 100644
index 0000000000..82fe2a092b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/missing_with_nonpersist.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+$data = select
+ Yson::Parse(cast(key as Yson)) as key,
+ text, -- missing colums
+ subkey
+from Input;
+
+select key, subkey
+from $data;
diff --git a/yql/essentials/tests/sql/suites/select/multi_source_issue.sql b/yql/essentials/tests/sql/suites/select/multi_source_issue.sql
new file mode 100644
index 0000000000..16e9fb83fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/multi_source_issue.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+USE plato;
+
+$i = (SELECT * FROM Input2);
+$ii = (SELECT * FROM Input4);
+
+$count_a=(SELECT count(*) FROM $i WHERE substring(value, 0, 1) = 'a');
+
+--INSERT INTO Output
+SELECT
+ count(*), count(*)/$count_a
+FROM $i;
+
+--INSERT INTO Output
+SELECT
+ count(*), count(*)/$count_a
+FROM $ii;
diff --git a/yql/essentials/tests/sql/suites/select/normalize_name.sqlx b/yql/essentials/tests/sql/suites/select/normalize_name.sqlx
new file mode 100644
index 0000000000..ceb6d7eed7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/normalize_name.sqlx
@@ -0,0 +1 @@
+select co_a_lesc____e__(1);
diff --git a/yql/essentials/tests/sql/suites/select/null_check.sql b/yql/essentials/tests/sql/suites/select/null_check.sql
new file mode 100644
index 0000000000..2c24b3e3af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/null_check.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* by correct way ;-)
+E assert 'a;;a' == 'a;Void;b'
+E - a;;a
+E + a;Void;b
+*/
+SELECT 'a', x, 'b' FROM (SELECT Null as x) as sq WHERE x IS NULL;
diff --git a/yql/essentials/tests/sql/suites/select/one_labeled_column.sql b/yql/essentials/tests/sql/suites/select/one_labeled_column.sql
new file mode 100644
index 0000000000..3ff643663c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/one_labeled_column.sql
@@ -0,0 +1 @@
+select key as wat from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/one_unlabeled_column.sql b/yql/essentials/tests/sql/suites/select/one_unlabeled_column.sql
new file mode 100644
index 0000000000..f7104a1585
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/one_unlabeled_column.sql
@@ -0,0 +1 @@
+select key from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/opt_list_access.sql b/yql/essentials/tests/sql/suites/select/opt_list_access.sql
new file mode 100644
index 0000000000..ed06206b42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/opt_list_access.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+$data = (SELECT key, Just(aggregate_list(cast(subkey as uint32))) as lsk FROM plato.Input GROUP BY cast(key as uint32) as key);
+
+SELECT key, lsk[0] FROM $data WHERE lsk IS NOT NULL ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/select/optional_as_warn.sql b/yql/essentials/tests/sql/suites/select/optional_as_warn.sql
new file mode 100644
index 0000000000..1dd720af5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/optional_as_warn.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* dq can not */
+/* dqfile can not */
+/* yt can not */
+use plato;
+
+pragma AnsiOptionalAs;
+
+select
+ key subkey,
+ value v,
+from Input order by subkey;
+
+
+select
+ key AS subkey,
+ value v,
+from Input order by subkey;
diff --git a/yql/essentials/tests/sql/suites/select/optional_in_job.cfg b/yql/essentials/tests/sql/suites/select/optional_in_job.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/optional_in_job.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/select/optional_in_job.sql b/yql/essentials/tests/sql/suites/select/optional_in_job.sql
new file mode 100644
index 0000000000..f41bd2f579
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/optional_in_job.sql
@@ -0,0 +1,34 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+insert into @a
+SELECT
+ Yql::Nothing(OptionalType(DataType("String"))) as level1_null,
+ Yql::Optional(OptionalType(DataType("String")), "val") as level1_just_val,
+ Yql::Nothing(OptionalType(OptionalType(DataType("String")))) as level2_null,
+ Yql::Optional(OptionalType(OptionalType(DataType("String"))), Yql::Nothing(OptionalType(DataType("String")))) as level2_just_null,
+ Yql::Optional(OptionalType(OptionalType(DataType("String"))), Yql::Just("val")) as level2_just_just_val,
+ Yql::Nothing(OptionalType(OptionalType(OptionalType(DataType("String"))))) as level3_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Nothing(OptionalType(OptionalType(DataType("String"))))) as level3_just_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Just(Yql::Nothing(OptionalType(DataType("String"))))) as level3_just_just_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Just(Yql::Just("val"))) as level3_just_just_just_val,
+ "const" as const
+;
+
+commit;
+
+-- Everything should be True
+select
+ level1_null is null,
+ Yql::Unwrap(level1_just_val) = "val",
+ level2_null is null,
+ Yql::Unwrap(level2_just_null) is null,
+ Yql::Unwrap(Yql::Unwrap(level2_just_just_val)) = "val",
+ level3_null is null,
+ Yql::Unwrap(level3_just_null) is null,
+ Yql::Unwrap(Yql::Unwrap(level3_just_just_null)) is null,
+ Yql::Unwrap(Yql::Unwrap(Yql::Unwrap(level3_just_just_just_val))) = "val",
+ True
+from @a
+where const = "const";
diff --git a/yql/essentials/tests/sql/suites/select/optional_pull.cfg b/yql/essentials/tests/sql/suites/select/optional_pull.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/optional_pull.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/select/optional_pull.sql b/yql/essentials/tests/sql/suites/select/optional_pull.sql
new file mode 100644
index 0000000000..fd5e736f64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/optional_pull.sql
@@ -0,0 +1,32 @@
+/* postgres can not */
+/* multirun can not */
+USE plato;
+
+insert into @a
+SELECT
+ Yql::Nothing(OptionalType(DataType("String"))) as level1_null,
+ Yql::Optional(OptionalType(DataType("String")), "val") as level1_just_val,
+ Yql::Nothing(OptionalType(OptionalType(DataType("String")))) as level2_null,
+ Yql::Optional(OptionalType(OptionalType(DataType("String"))), Yql::Nothing(OptionalType(DataType("String")))) as level2_just_null,
+ Yql::Optional(OptionalType(OptionalType(DataType("String"))), Yql::Just("val")) as level2_just_just_val,
+ Yql::Nothing(OptionalType(OptionalType(OptionalType(DataType("String"))))) as level3_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Nothing(OptionalType(OptionalType(DataType("String"))))) as level3_just_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Just(Yql::Nothing(OptionalType(DataType("String"))))) as level3_just_just_null,
+ Yql::Optional(OptionalType(OptionalType(OptionalType(DataType("String")))), Yql::Just(Yql::Just("val"))) as level3_just_just_just_val,
+ "const" as const
+;
+
+commit;
+
+-- Check result representation
+select
+ level1_null,
+ level1_just_val,
+ level2_null,
+ level2_just_null,
+ level2_just_just_val,
+ level3_null,
+ level3_just_null,
+ level3_just_just_null,
+ level3_just_just_just_val
+from @a;
diff --git a/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sql b/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sql
new file mode 100644
index 0000000000..2b45add62e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+--INSERT INTO Output
+SELECT
+ hundred_keys, sum(cast(`data.subkey` as uint32))
+FROM (
+ SELECT data.key as dkey, data.*
+ FROM Input as data
+) as middle
+GROUP BY
+ cast(middle.dkey as uint32)/100 as hundred_keys
+ORDER BY hundred_keys
diff --git a/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sqlx b/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sqlx
new file mode 100644
index 0000000000..f326c4bca4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/qualified_all_and_group_by.sqlx
@@ -0,0 +1,15 @@
+/* postgres can not */
+USE plato;
+PRAGMA DisableSimpleColumns;
+
+--INSERT INTO Output
+SELECT
+ hundred_keys, sum(cast(data.subkey as uint32)) -- should use backticks or brackets
+FROM (
+ SELECT data.key as dkey, data.*
+ FROM Input as data
+) as middle
+GROUP BY
+ cast(middle.dkey as uint32)/100 as hundred_keys
+ORDER BY hundred_keys
+
diff --git a/yql/essentials/tests/sql/suites/select/quoted_ids.sql b/yql/essentials/tests/sql/suites/select/quoted_ids.sql
new file mode 100644
index 0000000000..39d4f4de71
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/quoted_ids.sql
@@ -0,0 +1,2 @@
+/* do not execute */
+select `A%%B`, `A'`, `A\"\"`, `A ` from plato.`C-D`; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/quoted_ids_with_escapes.sql b/yql/essentials/tests/sql/suites/select/quoted_ids_with_escapes.sql
new file mode 100644
index 0000000000..637616a655
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/quoted_ids_with_escapes.sql
@@ -0,0 +1,2 @@
+/* do not execute */
+select `A\\a`, `\"A\\b\"` from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/read_schema.txt b/yql/essentials/tests/sql/suites/select/read_schema.txt
new file mode 100644
index 0000000000..851703e9a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/read_schema.txt
@@ -0,0 +1,5 @@
+{"a"=1;"b"=1u;"c"=0.1;"d"="x";"e"=%false;"f"={"a"="b";"c"="d";"e"=[0;1;2]}};
+{"a"=2;"b"=2u;"c"=2.5;"d"="xx";"e"=%true;"f"=0.123};
+{"a"=-5;"b"=8u;"c"=10.;"d"="xxx";"f"="xyz"};
+{"b"=5u;"d"="skdjfnsdf";"e"=%false};
+{};
diff --git a/yql/essentials/tests/sql/suites/select/read_schema.txt.attr b/yql/essentials/tests/sql/suites/select/read_schema.txt.attr
new file mode 100644
index 0000000000..3176be619e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/read_schema.txt.attr
@@ -0,0 +1,3 @@
+{
+ "_read_schema"=[{"type"="int64";"name"="a"};{"type"="uint64";"name"="b"};{"type"="double";"name"="c"};{"type"="string";"name"="d"};{"type"="boolean";name="e"};{"type"="any";"name"="f"}]
+}
diff --git a/yql/essentials/tests/sql/suites/select/refselect-1000.cfg b/yql/essentials/tests/sql/suites/select/refselect-1000.cfg
new file mode 100644
index 0000000000..1bae01480b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/refselect-1000.cfg
@@ -0,0 +1,2 @@
+in test_table_src input1100.txt
+providers yt,dq
diff --git a/yql/essentials/tests/sql/suites/select/refselect.cfg b/yql/essentials/tests/sql/suites/select/refselect.cfg
new file mode 100644
index 0000000000..8763f366de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/refselect.cfg
@@ -0,0 +1,2 @@
+in test_table_src input.txt
+providers yt,dq
diff --git a/yql/essentials/tests/sql/suites/select/refselect.sql b/yql/essentials/tests/sql/suites/select/refselect.sql
new file mode 100644
index 0000000000..7043d7b364
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/refselect.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+USE plato;
+PRAGMA refselect;
+SELECT key, subkey, value FROM `test_table_src`;
diff --git a/yql/essentials/tests/sql/suites/select/result_label.sql b/yql/essentials/tests/sql/suites/select/result_label.sql
new file mode 100644
index 0000000000..4887b9c60f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_label.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select 1 into result foo;
diff --git a/yql/essentials/tests/sql/suites/select/result_rows_limit.cfg b/yql/essentials/tests/sql/suites/select/result_rows_limit.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_rows_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/select/result_rows_limit.sql b/yql/essentials/tests/sql/suites/select/result_rows_limit.sql
new file mode 100644
index 0000000000..614d4928c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_rows_limit.sql
@@ -0,0 +1,7 @@
+/* kikimr can not - no refs */
+/* postgres can not */
+USE plato;
+pragma ResultRowsLimit="2";
+
+SELECT key||"a" as key FROM Input order by key;
+SELECT key||"b" as key FROM Input order by key;
diff --git a/yql/essentials/tests/sql/suites/select/result_size_limit.cfg b/yql/essentials/tests/sql/suites/select/result_size_limit.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_size_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/select/result_size_limit.sql b/yql/essentials/tests/sql/suites/select/result_size_limit.sql
new file mode 100644
index 0000000000..df0d9d6fd6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_size_limit.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* kikimr can not - no refs */
+USE plato;
+pragma ResultSizeLimit="25";
+
+SELECT key||"a" as key FROM Input order by key;
+SELECT key||"b" as key FROM Input order by key;
diff --git a/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.cfg b/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.sql b/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.sql
new file mode 100644
index 0000000000..d6394b5d0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/result_size_limit_with_fill.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* kikimr can not - no refs */
+USE plato;
+pragma ResultSizeLimit="25";
+
+SELECT key||"a" as key FROM Input order by key;
+SELECT key||"b" as key FROM Input order by key;
+SELECT 1 + 1;
+SELECT 2 + 2;
diff --git a/yql/essentials/tests/sql/suites/select/reuse_named_node.sql b/yql/essentials/tests/sql/suites/select/reuse_named_node.sql
new file mode 100644
index 0000000000..238865d79d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/reuse_named_node.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+USE plato;
+$x = ($key) -> { return "aa" || $key };
+select $x(key) from Input;
+select $x(key) from Input;
diff --git a/yql/essentials/tests/sql/suites/select/sampleselect-1000.cfg b/yql/essentials/tests/sql/suites/select/sampleselect-1000.cfg
new file mode 100644
index 0000000000..115c212714
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/sampleselect-1000.cfg
@@ -0,0 +1 @@
+in Input input1100.txt
diff --git a/yql/essentials/tests/sql/suites/select/sampleselect.cfg b/yql/essentials/tests/sql/suites/select/sampleselect.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/sampleselect.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/select/sampleselect.sql b/yql/essentials/tests/sql/suites/select/sampleselect.sql
new file mode 100644
index 0000000000..d6700cb9b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/sampleselect.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+pragma sampleselect;
+select key, subkey, value || "foo" as new_value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/scalar_subquery.sql b/yql/essentials/tests/sql/suites/select/scalar_subquery.sql
new file mode 100644
index 0000000000..f5644ed27f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/scalar_subquery.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+$query = (
+select AsTuple(count(*),min(value)) FROM plato.Input
+--WHERE 1=0
+);
+select $query ?? AsTuple(0,"") as cnt;
diff --git a/yql/essentials/tests/sql/suites/select/scalar_subquery_with_star.sql b/yql/essentials/tests/sql/suites/select/scalar_subquery_with_star.sql
new file mode 100644
index 0000000000..29e0be1919
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/scalar_subquery_with_star.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+
+$single = (select key from plato.Input);
+$all = (select * from $single order by key limit 100);
+select $all;
+
diff --git a/yql/essentials/tests/sql/suites/select/select_all.sql b/yql/essentials/tests/sql/suites/select/select_all.sql
new file mode 100644
index 0000000000..684733fe7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all.sql
@@ -0,0 +1 @@
+select * from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/select_all_filtered.sql b/yql/essentials/tests/sql/suites/select/select_all_filtered.sql
new file mode 100644
index 0000000000..73574ab4d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_filtered.sql
@@ -0,0 +1,2 @@
+select * from plato.Input where value = "ddd";
+
diff --git a/yql/essentials/tests/sql/suites/select/select_all_from_concat.sql b/yql/essentials/tests/sql/suites/select/select_all_from_concat.sql
new file mode 100644
index 0000000000..2f22f7a461
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_from_concat.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.concat(Input2, Input3);
diff --git a/yql/essentials/tests/sql/suites/select/select_all_from_concat_anon.sql b/yql/essentials/tests/sql/suites/select/select_all_from_concat_anon.sql
new file mode 100644
index 0000000000..967844883c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_from_concat_anon.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+insert into @foo
+select 1;
+
+commit;
+
+$name = "fo" || "o";
+select * from concat(@foo,@$name);
diff --git a/yql/essentials/tests/sql/suites/select/select_all_group_by_column.cfg b/yql/essentials/tests/sql/suites/select/select_all_group_by_column.cfg
new file mode 100644
index 0000000000..c7e99df4d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_group_by_column.cfg
@@ -0,0 +1 @@
+in Input input_expr.txt
diff --git a/yql/essentials/tests/sql/suites/select/select_all_group_by_column.sql b/yql/essentials/tests/sql/suites/select/select_all_group_by_column.sql
new file mode 100644
index 0000000000..d2dc93b17b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_group_by_column.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input group by subkey order by subkey;
diff --git a/yql/essentials/tests/sql/suites/select/select_all_ordered.sql b/yql/essentials/tests/sql/suites/select/select_all_ordered.sql
new file mode 100644
index 0000000000..1021bb94cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_all_ordered.sql
@@ -0,0 +1,3 @@
+select * from plato.Input order by value;
+
+
diff --git a/yql/essentials/tests/sql/suites/select/select_concrete_detailed_columns.sql b/yql/essentials/tests/sql/suites/select/select_concrete_detailed_columns.sql
new file mode 100644
index 0000000000..577f255c97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/select_concrete_detailed_columns.sql
@@ -0,0 +1 @@
+select i.key, i.subkey from plato.Input as i;
diff --git a/yql/essentials/tests/sql/suites/select/shift_columns.sql b/yql/essentials/tests/sql/suites/select/shift_columns.sql
new file mode 100644
index 0000000000..60938dc01c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/shift_columns.sql
@@ -0,0 +1 @@
+select key as subkey, subkey as value, value as key from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/simple_struct_field_access.cfg b/yql/essentials/tests/sql/suites/select/simple_struct_field_access.cfg
new file mode 100644
index 0000000000..2dbce9ede0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/simple_struct_field_access.cfg
@@ -0,0 +1 @@
+in Input input_struct_field.txt
diff --git a/yql/essentials/tests/sql/suites/select/simple_struct_field_access.sql b/yql/essentials/tests/sql/suites/select/simple_struct_field_access.sql
new file mode 100644
index 0000000000..a140ab624d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/simple_struct_field_access.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+use plato;
+select key.kk, subkey, value from Input
diff --git a/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.cfg b/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.sql b/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.sql
new file mode 100644
index 0000000000..0a3446a339
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/struct_access_without_table_name.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+use plato;
+
+$data = ( select
+ cast(key as uint32) % 10 as mod,
+ (key as kk, subkey as sk) as struct_field,
+ value
+from Input);
+
+--INSERT INTO Output
+SELECT
+ mod,
+ struct_field.kk as mod_key,
+ struct_field.sk,
+ d.value
+FROM $data as d
+order by mod_key, value
+;
diff --git a/yql/essentials/tests/sql/suites/select/struct_members.sql b/yql/essentials/tests/sql/suites/select/struct_members.sql
new file mode 100644
index 0000000000..4fd4c403d8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/struct_members.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$structList = (select AsStruct(key as k, value as v) as `struct` from Input);
+select input.`struct`.k as key, input.`struct`.v as value, input.`struct` as `struct` from $structList as input;
diff --git a/yql/essentials/tests/sql/suites/select/substring.sql b/yql/essentials/tests/sql/suites/select/substring.sql
new file mode 100644
index 0000000000..469b7bc3aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/substring.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+select
+ substring(key, 1, 1) as char,
+ substring(value, 1) as tail
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/substring_v1.sql b/yql/essentials/tests/sql/suites/select/substring_v1.sql
new file mode 100644
index 0000000000..566e8c9401
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/substring_v1.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+-- in v1 substring returns Null as a result for missing value
+select
+ substring(key, 1, 1) as char,
+ substring(value, 1) as tail
+from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/sum_to_string.sql b/yql/essentials/tests/sql/suites/select/sum_to_string.sql
new file mode 100644
index 0000000000..59d6860ebb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/sum_to_string.sql
@@ -0,0 +1 @@
+select key, subkey, cast(1 + 1 as varchar) as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/swap_columns.sql b/yql/essentials/tests/sql/suites/select/swap_columns.sql
new file mode 100644
index 0000000000..61e848ab7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/swap_columns.sql
@@ -0,0 +1 @@
+select key, subkey as value, value as subkey from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/table_content_from_double_opt.sql b/yql/essentials/tests/sql/suites/select/table_content_from_double_opt.sql
new file mode 100644
index 0000000000..472917fe5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_content_from_double_opt.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+insert into @tmp with truncate
+select Just(Just(key)) as key from Input;
+
+commit;
+
+$key = select key from @tmp;
+select * from Input where key = $key;
diff --git a/yql/essentials/tests/sql/suites/select/table_content_from_sort_desc.sql b/yql/essentials/tests/sql/suites/select/table_content_from_sort_desc.sql
new file mode 100644
index 0000000000..efa2818a96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_content_from_sort_desc.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+insert into @tmp with truncate
+select key from Input order by key desc;
+
+commit;
+
+$key = select key from @tmp;
+select * from Input where key = $key;
diff --git a/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.cfg b/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.sql b/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.sql
new file mode 100644
index 0000000000..04a6ecb98b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_content_with_tmp_folder.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* kikimr can not */
+use plato;
+pragma yt.MapJoinLimit="1M";
+pragma yt.TmpFolder="//custom_tmp";
+
+-- MapJoin with table content
+$input = (select cast(a.key as Uint64) as key from Input as a cross join Input as b);
+
+-- ResFill with table content
+select sum(key) from $input;
diff --git a/yql/essentials/tests/sql/suites/select/table_funcs_spec.sql b/yql/essentials/tests/sql/suites/select/table_funcs_spec.sql
new file mode 100644
index 0000000000..87cbdfe0dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_funcs_spec.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not */
+use plato;
+
+--insert into Output
+select
+ TablePath() as table_path,
+ TableRecordIndex() as table_rec,
+ TableName("foo/bar") as table_name1,
+ TableName("baz") as table_name2,
+ TableName() as table_name3
+from Input
+where key = '800'
+;
diff --git a/yql/essentials/tests/sql/suites/select/table_funcs_spec_flatten_by.sql_gb_gs.sqlx b/yql/essentials/tests/sql/suites/select/table_funcs_spec_flatten_by.sql_gb_gs.sqlx
new file mode 100644
index 0000000000..02472e7673
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/table_funcs_spec_flatten_by.sql_gb_gs.sqlx
@@ -0,0 +1,11 @@
+/* postgres can not */
+use plato;
+
+insert into Output
+select
+ key,
+ value,
+ TablePath()
+from Input
+group by grouping sets (key)
+;
diff --git a/yql/essentials/tests/sql/suites/select/tablename_with_table_row.sql b/yql/essentials/tests/sql/suites/select/tablename_with_table_row.sql
new file mode 100644
index 0000000000..3080bcf52c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/tablename_with_table_row.sql
@@ -0,0 +1,11 @@
+USE plato;
+
+SELECT
+ TableName() AS tn,
+ ROW_NUMBER() OVER () AS rowid,
+FROM
+ Input
+WHERE
+ key > "010"
+ORDER BY rowid
+;
diff --git a/yql/essentials/tests/sql/suites/select/tablepathprefix.sql b/yql/essentials/tests/sql/suites/select/tablepathprefix.sql
new file mode 100644
index 0000000000..f543356ff0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/tablepathprefix.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+pragma TablePathPrefix = "//";
+
+$input = "In" || "put";
+
+select * from `Input` order by subkey;
+select * from $input order by subkey;
diff --git a/yql/essentials/tests/sql/suites/select/to_dict.sql b/yql/essentials/tests/sql/suites/select/to_dict.sql
new file mode 100644
index 0000000000..7c1e8e85bd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/to_dict.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT
+ key,
+ ToDict(items) AS `dict`,
+ ToMultiDict(items) AS multi_dict
+FROM (
+ SELECT
+ key,
+ AGGREGATE_LIST(AsTuple(subkey, value)) AS items
+ FROM (
+ SELECT * FROM plato.Input
+ UNION ALL
+ SELECT * FROM plato.Input
+ ) GROUP BY key
+)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/select/trivial_between.sql b/yql/essentials/tests/sql/suites/select/trivial_between.sql
new file mode 100644
index 0000000000..38d14ec4a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_between.sql
@@ -0,0 +1,3 @@
+select * from (
+ select key as key, coalesce(cast(subkey as int), 0) as subkey, value as value from plato.Input
+) as x where subkey between 1 and 3 order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/select/trivial_group_by.sql b/yql/essentials/tests/sql/suites/select/trivial_group_by.sql
new file mode 100644
index 0000000000..8475eeda7d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_group_by.sql
@@ -0,0 +1 @@
+select key, Min(subkey) as subkey, Max(value) as value from plato.Input group by key order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/trivial_having.sql b/yql/essentials/tests/sql/suites/select/trivial_having.sql
new file mode 100644
index 0000000000..5ad1424027
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_having.sql
@@ -0,0 +1 @@
+select key, "WAT" as subkey, Max(value) as value from plato.Input group by key having Max(value) = "FOO"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/trivial_order_by.sql b/yql/essentials/tests/sql/suites/select/trivial_order_by.sql
new file mode 100644
index 0000000000..b087520e60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_order_by.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input order by key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/trivial_where-many.cfg b/yql/essentials/tests/sql/suites/select/trivial_where-many.cfg
new file mode 100644
index 0000000000..67bb5475e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_where-many.cfg
@@ -0,0 +1 @@
+in Input trivial_where-many.txt
diff --git a/yql/essentials/tests/sql/suites/select/trivial_where-many.txt b/yql/essentials/tests/sql/suites/select/trivial_where-many.txt
new file mode 100644
index 0000000000..2c65337d78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_where-many.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="1";"value"="abc"};
+{"key"="1";"subkey"="2";"value"="ddd"};
+{"key"="2";"subkey"="2";"value"="qqq"};
+{"key"="3";"subkey"="3";"value"="xxx"};
diff --git a/yql/essentials/tests/sql/suites/select/trivial_where-one.cfg b/yql/essentials/tests/sql/suites/select/trivial_where-one.cfg
new file mode 100644
index 0000000000..7e850225a0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_where-one.cfg
@@ -0,0 +1 @@
+in Input trivial_where.txt
diff --git a/yql/essentials/tests/sql/suites/select/trivial_where.sql b/yql/essentials/tests/sql/suites/select/trivial_where.sql
new file mode 100644
index 0000000000..f7c092f14c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_where.sql
@@ -0,0 +1 @@
+select key, subkey, value from plato.Input where key = subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/trivial_where.txt b/yql/essentials/tests/sql/suites/select/trivial_where.txt
new file mode 100644
index 0000000000..4e5614f76a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/trivial_where.txt
@@ -0,0 +1,2 @@
+{"key"="1";"subkey"="1";"value"="abc"};
+{"key"="1";"subkey"="2";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/select/two_select_without_semi.sql b/yql/essentials/tests/sql/suites/select/two_select_without_semi.sql
new file mode 100644
index 0000000000..8bef33c650
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/two_select_without_semi.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select 1; select 2
diff --git a/yql/essentials/tests/sql/suites/select/two_selects_with_diff_fields.sql b/yql/essentials/tests/sql/suites/select/two_selects_with_diff_fields.sql
new file mode 100644
index 0000000000..3b7b8d1e32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/two_selects_with_diff_fields.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+select key from plato.Input;
+select key, subkey, value from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/select/type_assert.sql b/yql/essentials/tests/sql/suites/select/type_assert.sql
new file mode 100644
index 0000000000..c634446b93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/type_assert.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+select EnsureType(cast(key as Int64), Int64?, "some text 1") from Input;
+select FormatType(EnsureType(TypeOf(1), Int32, "some text 2"));
+select FormatType(EnsureType(TypeOf(1), Int32));
+
+select EnsureConvertibleTo(cast(key as Int64), Double?, "some text 3") from Input;
+select FormatType(EnsureConvertibleTo(TypeOf(1), Int64, "some text 4"));
+select FormatType(EnsureConvertibleTo(TypeOf(1), Int64));
diff --git a/yql/essentials/tests/sql/suites/select/unary_op_interval.sql b/yql/essentials/tests/sql/suites/select/unary_op_interval.sql
new file mode 100644
index 0000000000..3df738d68a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/unary_op_interval.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select +Interval("P1D");
+select -Interval("P1D");
+select +Yql::Just(Interval("P1D"));
+select -Yql::Just(Interval("P1D"));
+select +Yql::Nothing(ParseType("Interval?"));
+select -Yql::Nothing(ParseType("Interval?"));
diff --git a/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.cfg b/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.cfg
new file mode 100644
index 0000000000..f4f8c09a16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.cfg
@@ -0,0 +1,3 @@
+in Input1 input_intersect.txt
+in Input2 input_expr.txt
+
diff --git a/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.sql b/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.sql
new file mode 100644
index 0000000000..261f20ec16
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/uncorrelated_subqueries.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+
+$_data = (SELECT key as kk, subkey as sk, value as val FROM plato.Input1 WHERE key == '075');
+$data_one_key = (SELECT subkey FROM plato.Input1 WHERE key == '075');
+
+SELECT * FROM Input2 WHERE key = $data_one_key;
diff --git a/yql/essentials/tests/sql/suites/select/unlabeled.cfg b/yql/essentials/tests/sql/suites/select/unlabeled.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/unlabeled.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/select/unlabeled.sql b/yql/essentials/tests/sql/suites/select/unlabeled.sql
new file mode 100644
index 0000000000..c904961f66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/unlabeled.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, subkey, value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/unlabeled_1000.cfg b/yql/essentials/tests/sql/suites/select/unlabeled_1000.cfg
new file mode 100644
index 0000000000..115c212714
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/unlabeled_1000.cfg
@@ -0,0 +1 @@
+in Input input1100.txt
diff --git a/yql/essentials/tests/sql/suites/select/unlabeled_1000.sql b/yql/essentials/tests/sql/suites/select/unlabeled_1000.sql
new file mode 100644
index 0000000000..ec52757d06
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/unlabeled_1000.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* kikimr can not - no ref select mode */
+select key, subkey, value from plato.Input order by key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/select/use_cluster.sql b/yql/essentials/tests/sql/suites/select/use_cluster.sql
new file mode 100644
index 0000000000..197a75f9c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/use_cluster.sql
@@ -0,0 +1,2 @@
+use plato;
+select key from Input;
diff --git a/yql/essentials/tests/sql/suites/select/use_subrequest_as_table.sqlx b/yql/essentials/tests/sql/suites/select/use_subrequest_as_table.sqlx
new file mode 100644
index 0000000000..a5227e7e2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/use_subrequest_as_table.sqlx
@@ -0,0 +1,23 @@
+/* postgres can not */
+/* syntax version 1 */
+$script = @@
+def test(src):
+ l = []
+ for i in src:
+ l.append(str(i.test))
+ l.append(str(i.test2))
+ return str(l)
+@@;
+
+$test_table_1 =
+ (
+ SELECT 1 AS test, "a" AS test2
+ UNION ALL
+ SELECT 2 AS test, "b" AS test2
+ );
+
+$callable = Python::test(Callable<(List<Struct<test:Int32,test2:String?>>) -> String?>, $script);
+
+SELECT
+ $callable( $test_table_1 ) -- use as const subrequest should contain one column
+FROM $test_table_1;
diff --git a/yql/essentials/tests/sql/suites/select/values.sql b/yql/essentials/tests/sql/suites/select/values.sql
new file mode 100644
index 0000000000..345513ede5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/values.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+values (1,2), (3,4);
+
+select * from (values (1,2), (3,4));
+select * from (values (1,2), (3,4)) as t(x,y);
+select * from (values (1,2,3,4), (5,6,7,8)) as t(x,y,z);
+
+select exists(values (1));
diff --git a/yql/essentials/tests/sql/suites/select/where_cast.sql b/yql/essentials/tests/sql/suites/select/where_cast.sql
new file mode 100644
index 0000000000..8ae781dccf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_cast.sql
@@ -0,0 +1 @@
+select value from plato.Input where cast(key as int) > 100; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/select/where_in.sql b/yql/essentials/tests/sql/suites/select/where_in.sql
new file mode 100644
index 0000000000..8618c593e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_in.sql
@@ -0,0 +1,7 @@
+SELECT
+ *
+FROM plato.Input
+WHERE
+ "1" IN (key, subkey, value) OR
+ value NOT IN (key, subkey, value)
+;
diff --git a/yql/essentials/tests/sql/suites/select/where_not_null.cfg b/yql/essentials/tests/sql/suites/select/where_not_null.cfg
new file mode 100644
index 0000000000..86c772ae1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_not_null.cfg
@@ -0,0 +1 @@
+in Input read_schema.txt
diff --git a/yql/essentials/tests/sql/suites/select/where_not_null.sql b/yql/essentials/tests/sql/suites/select/where_not_null.sql
new file mode 100644
index 0000000000..a582898978
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_not_null.sql
@@ -0,0 +1 @@
+select * from plato.Input where a is not null;
diff --git a/yql/essentials/tests/sql/suites/select/where_with_lambda.cfg b/yql/essentials/tests/sql/suites/select/where_with_lambda.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_with_lambda.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/select/where_with_lambda.sql b/yql/essentials/tests/sql/suites/select/where_with_lambda.sql
new file mode 100644
index 0000000000..e2587c8ac0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/select/where_with_lambda.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+$predicate = ($x) -> {
+ RETURN $x == "911"
+};
+$field = "field";
+
+SELECT *
+FROM Input
+WHERE $predicate($field);
diff --git a/yql/essentials/tests/sql/suites/seq_mode/action_shared_subquery_expr_after_commit.sql b/yql/essentials/tests/sql/suites/seq_mode/action_shared_subquery_expr_after_commit.sql
new file mode 100644
index 0000000000..b693dcd0a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/action_shared_subquery_expr_after_commit.sql
@@ -0,0 +1,12 @@
+pragma SeqMode;
+use plato;
+define action $a() as
+ insert into @tmp
+ select 1;
+ commit;
+ $r = select * from @tmp;
+ select * from $r;
+ select * from $r;
+end define;
+
+do $a();
diff --git a/yql/essentials/tests/sql/suites/seq_mode/default.cfg b/yql/essentials/tests/sql/suites/seq_mode/default.cfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/default.cfg
diff --git a/yql/essentials/tests/sql/suites/seq_mode/shared_named_expr.sql b/yql/essentials/tests/sql/suites/seq_mode/shared_named_expr.sql
new file mode 100644
index 0000000000..160f41fc1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/shared_named_expr.sql
@@ -0,0 +1,6 @@
+pragma SeqMode;
+pragma CompactNamedExprs;
+$a = 1;
+select $a;
+select $a;
+
diff --git a/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr.sql b/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr.sql
new file mode 100644
index 0000000000..a1bf46cf45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr.sql
@@ -0,0 +1,5 @@
+pragma SeqMode;
+$a = select 1;
+select * from $a;
+select * from $a;
+
diff --git a/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr_after_commit.sql b/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr_after_commit.sql
new file mode 100644
index 0000000000..ec13f4e0fa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/shared_subquery_expr_after_commit.sql
@@ -0,0 +1,9 @@
+use plato;
+pragma SeqMode;
+insert into @foo
+select 1;
+commit;
+$a = select * from @foo;
+select * from $a;
+select * from $a;
+
diff --git a/yql/essentials/tests/sql/suites/seq_mode/simple1.sql b/yql/essentials/tests/sql/suites/seq_mode/simple1.sql
new file mode 100644
index 0000000000..eea968ad96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/simple1.sql
@@ -0,0 +1,3 @@
+pragma SeqMode;
+select 1;
+
diff --git a/yql/essentials/tests/sql/suites/seq_mode/simple2.sql b/yql/essentials/tests/sql/suites/seq_mode/simple2.sql
new file mode 100644
index 0000000000..dbb53e3ecb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/simple2.sql
@@ -0,0 +1,4 @@
+pragma SeqMode;
+select 1;
+select 2;
+
diff --git a/yql/essentials/tests/sql/suites/seq_mode/subquery_shared_subquery.sql b/yql/essentials/tests/sql/suites/seq_mode/subquery_shared_subquery.sql
new file mode 100644
index 0000000000..81954be5bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/seq_mode/subquery_shared_subquery.sql
@@ -0,0 +1,9 @@
+pragma SeqMode;
+use plato;
+define subquery $a() as
+ $r = select 1 as x;
+ select * from $r;
+end define;
+
+process $a();
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/default.cfg b/yql/essentials/tests/sql/suites/simple_columns/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/simple_columns/input.txt b/yql/essentials/tests/sql/suites/simple_columns/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/simple_columns/no_simple_columns_tablerow.sql b/yql/essentials/tests/sql/suites/simple_columns/no_simple_columns_tablerow.sql
new file mode 100644
index 0000000000..231e9d743e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/no_simple_columns_tablerow.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+PRAGMA DisableSimpleColumns;
+
+SELECT 100500 as magic, TableRow() AS tr FROM plato.Input AS t;
+SELECT 100500 as magic, t.* FROM plato.Input AS t;
+
+SELECT
+TableRow() AS tr
+FROM (SELECT Just(1ul) AS k, 1 AS v1) AS a
+JOIN (SELECT 1 AS k, 2 AS v2) AS b
+ON a.k = b.k;
+
+SELECT
+*
+FROM (SELECT Just(1ul) AS k, 1 AS v1) AS a
+JOIN (SELECT 1 AS k, 2 AS v2) AS b
+ON a.k = b.k;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base.sql
new file mode 100644
index 0000000000..2d050f1024
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base.sql
@@ -0,0 +1,4 @@
+PRAGMA SimpleColumns;
+
+--INSERT INTO plato.Output
+SELECT 100500 as magic, t.* FROM plato.Input as t
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.cfg b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.cfg
new file mode 100644
index 0000000000..9217c920f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.sql
new file mode 100644
index 0000000000..6930913766
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_base_fail.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+
+USE plato;
+
+$req = (SELECT 100500 as magic, t.* FROM Input as t);
+
+--INSERT INTO Output
+SELECT
+ ff.*,
+ subkey as magic, -- 'magic' is exist from ff.magic
+ value as val
+FROM $req as ff ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_all.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_all.sql
new file mode 100644
index 0000000000..8fbba96abe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_all.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ *
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, val
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_1.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_1.sql
new file mode 100644
index 0000000000..dbb7d0ba60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_1.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma DisableCoalesceJoinKeysOnQualifiedAll;
+
+$foo = select 1 as key, 1 as value1;
+$bar = select 1l as key, 2 as value2;
+
+select * from $foo as foo
+join $bar as bar on foo.key = bar.key;
+
+-- output key has type Int64
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_2.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_2.sql
new file mode 100644
index 0000000000..4037bdd680
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_all_2.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma CoalesceJoinKeysOnQualifiedAll;
+
+$foo = select 1 as key, 1 as value1;
+$bar = select 1l as key, 2 as value2;
+
+select * from $foo as foo
+join $bar as bar on foo.key = bar.key;
+
+-- output key has type Int64
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_bug8923.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_bug8923.sql
new file mode 100644
index 0000000000..a4d816e21a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_bug8923.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+-- fails with CoalesceJoinKeysOnQualifiedAll
+pragma DisableCoalesceJoinKeysOnQualifiedAll;
+
+$foo = select 1 as key, 1 as value1;
+$bar = select 1l as key, 2 as value2;
+$baz = select 1l as key, 2 as value3;
+
+
+select foo.* from $foo as foo
+join $bar as bar on cast(foo.key as Int32) = bar.key
+join $baz as baz on bar.key = baz.key
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_disable.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_disable.sql
new file mode 100644
index 0000000000..633c62c500
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_disable.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma DisableCoalesceJoinKeysOnQualifiedAll;
+
+$foo = select 1 as key, 1 as value1;
+$bar = select 1l as key, 2 as value2;
+
+select foo.* from $foo as foo
+join $bar as bar on foo.key = bar.key;
+
+-- output key has type Int32
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_enable.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_enable.sql
new file mode 100644
index 0000000000..9d55cd5cb4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_qualified_all_enable.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma CoalesceJoinKeysOnQualifiedAll;
+
+$foo = select 1 as key, 1 as value1;
+$bar = select 1l as key, 2 as value2;
+
+select foo.* from $foo as foo
+join $bar as bar on foo.key = bar.key;
+
+-- output key has type Int64
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_1.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_1.sql
new file mode 100644
index 0000000000..d3933f7860
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_1.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma DisableCoalesceJoinKeysOnQualifiedAll;
+
+select
+ b.* without b.x
+from (select * from (select AsList(1, 2, 3) as x, AsList(1, 2) as y) flatten by (x, y)) as a
+join (select * from (select AsList(1, 2, 3) as x, AsList(2, 3) as y) flatten by (x, y)) as b
+on a.x == b.x and a.y == b.y;
+
+select
+ * without b.x
+from (select * from (select AsList(1, 2, 3) as x, AsList(1, 2) as y) flatten by (x, y)) as a
+join (select * from (select AsList(1, 2, 3) as x, AsList(2, 3) as y) flatten by (x, y)) as b
+on a.x == b.x and a.y == b.y
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_2.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_2.sql
new file mode 100644
index 0000000000..ff33a478ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_2.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma CoalesceJoinKeysOnQualifiedAll;
+
+select
+ b.* without b.x
+from (select * from (select AsList(1, 2, 3) as x, AsList(1, 2) as y) flatten by (x, y)) as a
+join (select * from (select AsList(1, 2, 3) as x, AsList(2, 3) as y) flatten by (x, y)) as b
+on a.x == b.x and a.y == b.y;
+
+select
+ * without b.x
+from (select * from (select AsList(1, 2, 3) as x, AsList(1, 2) as y) flatten by (x, y)) as a
+join (select * from (select AsList(1, 2, 3) as x, AsList(2, 3) as y) flatten by (x, y)) as b
+on a.x == b.x and a.y == b.y
+
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_1.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_1.sql
new file mode 100644
index 0000000000..f2e3ca2c12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_1.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma DisableCoalesceJoinKeysOnQualifiedAll;
+
+select a.* without a.key, a.value from Input as a left semi join Input as b using(key) order by subkey;
+select * without a.key, a.value from Input as a left semi join Input as b using(key) order by subkey;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_2.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_2.sql
new file mode 100644
index 0000000000..fc85664b2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_coalesce_without_left_semi_2.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+USE plato;
+
+pragma SimpleColumns;
+pragma CoalesceJoinKeysOnQualifiedAll;
+
+select a.* without a.key, a.value from Input as a left semi join Input as b using(key) order by subkey;
+select * without a.key, a.value from Input as a left semi join Input as b using(key) order by subkey;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.cfg b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.cfg
new file mode 100644
index 0000000000..9217c920f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input input.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.sql
new file mode 100644
index 0000000000..7728a22ba1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_fail.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ d.*,
+ Input.key as kk -- 'kk' is exist from d.kk
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, val
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_qualified.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_qualified.sql
new file mode 100644
index 0000000000..b2cac15f8f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_qualified.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value as val FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ d.*,
+ key
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, val
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_all_key_without.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_all_key_without.sql
new file mode 100644
index 0000000000..51b49cdb29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_all_key_without.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ *
+WITHOUT
+ Input.value
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key.sql
new file mode 100644
index 0000000000..5318d327bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key, subkey as sk, value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ d.*,
+ subkey
+FROM Input JOIN $data as d ON Input.key = d.key and Input.value == d.value
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_by_all.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_by_all.sql
new file mode 100644
index 0000000000..e75b01c64a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_by_all.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key, subkey as sk, value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ *
+FROM Input JOIN $data as d ON Input.key = d.key and Input.value == d.value
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_without.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_without.sql
new file mode 100644
index 0000000000..a99ae21f79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_subreq_same_key_without.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ Input.*,
+ d.value as val
+WITHOUT
+ Input.subkey
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates.sql
new file mode 100644
index 0000000000..686bb52cbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT key as kk, subkey as sk, "data: " || value as value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ Input.*,
+ d.*,
+ Input.value as valueFromInput
+WITHOUT
+ Input.value
+FROM Input JOIN $data as d ON Input.subkey = cast(cast(d.kk as uint32)/100 as string)
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates_mult.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates_mult.sql
new file mode 100644
index 0000000000..b262fcf84b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_join_without_resolve_dublicates_mult.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+USE plato;
+
+$data = (SELECT cast(cast(key as uint32)/100 as string) as key, key as kk, cast(subkey as uint32) * 10 as subkey, "data: " || value as value FROM Input WHERE cast(key as uint32)/100 < 5);
+
+--INSERT INTO Output
+SELECT
+ Input.*,
+ d.*,
+ Input.value as valueFromInput,
+ d.subkey as subkeyFromD
+WITHOUT
+ Input.value, d.subkey, d.key
+FROM Input JOIN $data as d ON Input.subkey = d.key
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_qualified_all_and_group_by.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_qualified_all_and_group_by.sql
new file mode 100644
index 0000000000..e3cdad7350
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_qualified_all_and_group_by.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+PRAGMA SimpleColumns;
+
+--INSERT INTO Output
+SELECT
+ hundred_keys, sum(cast(subkey as uint32))
+FROM (
+ SELECT data.key as dkey, data.*
+ FROM Input as data
+) as middle
+GROUP BY
+ cast(middle.dkey as uint32)/100 as hundred_keys
+ORDER BY hundred_keys
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq.sql
new file mode 100644
index 0000000000..07417c5874
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+
+USE plato;
+
+$req = (SELECT 100500 as magic, t.* FROM Input as t);
+
+--INSERT INTO Output
+SELECT subkey as sk, value as val FROM $req ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq_all.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq_all.sql
new file mode 100644
index 0000000000..8f62e71cfa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_subreq_all.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+PRAGMA SimpleColumns;
+
+USE plato;
+
+$req = (SELECT 100500 as magic, t.* FROM Input as t);
+
+--INSERT INTO Output
+SELECT ff.*, subkey as sk, value as val FROM $req as ff ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_tablerow.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_tablerow.sql
new file mode 100644
index 0000000000..f9cdb31af7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_tablerow.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+PRAGMA SimpleColumns;
+
+SELECT 100500 as magic, TableRow() AS tr FROM plato.Input AS t;
+SELECT 100500 as magic, t.* FROM plato.Input AS t;
+
+SELECT
+TableRow() AS tr
+FROM (SELECT Just(1ul) AS k, 1 AS v1) AS a
+JOIN (SELECT 1 AS k, 2 AS v2) AS b
+ON a.k = b.k;
+
+SELECT
+*
+FROM (SELECT Just(1ul) AS k, 1 AS v1) AS a
+JOIN (SELECT 1 AS k, 2 AS v2) AS b
+ON a.k = b.k;
diff --git a/yql/essentials/tests/sql/suites/simple_columns/simple_columns_union_all_qualified_star.sql b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_union_all_qualified_star.sql
new file mode 100644
index 0000000000..48b00df4ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/simple_columns/simple_columns_union_all_qualified_star.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+use plato;
+PRAGMA simplecolumns;
+
+insert into @A (key, value) values
+('x', 1),
+('y', 2);
+
+insert into @B (key, value) values
+('y', 3),
+('z', 4);
+commit;
+
+select A.* from @A AS A LEFT ONLY JOIN @B AS B ON A.key = B.key
+UNION ALL
+select B.* from @A AS A RIGHT ONLY JOIN @B AS B ON A.key = B.key
+
+
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.cfg b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.sql b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.sql
new file mode 100644
index 0000000000..dda21f9ce6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingAggregation.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.aggregation` = "ABC"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.cfg b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.sql b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.sql
new file mode 100644
index 0000000000..61ca6e90b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingDisabled.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.disabled` = "ABC"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.cfg b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.sql b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.sql
new file mode 100644
index 0000000000..cf7dac7f35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingFill.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.fill` = "ABC"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.cfg b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.sql b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.sql
new file mode 100644
index 0000000000..e5f24c16e9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BadDownsamplingInterval.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.grid_interval` = "ABC"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/Basic.sql b/yql/essentials/tests/sql/suites/solomon/Basic.sql
new file mode 100644
index 0000000000..d59089121f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/Basic.sql
@@ -0,0 +1,5 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.cfg b/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.sql b/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.sql
new file mode 100644
index 0000000000..c7fd10d9e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/BrokenJsonResponse.sql
@@ -0,0 +1,5 @@
+SELECT * FROM local_solomon.broken_json WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/Downsampling.sql b/yql/essentials/tests/sql/suites/solomon/Downsampling.sql
new file mode 100644
index 0000000000..976cbc696a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/Downsampling.sql
@@ -0,0 +1,9 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.disabled` = "true",
+ `downsampling.aggregation` = "SUM",
+ `downsampling.grid_interval` = "25",
+ `downsampling.fill` = "PREVIOUS"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/DownsamplingValidSettings.sql b/yql/essentials/tests/sql/suites/solomon/DownsamplingValidSettings.sql
new file mode 100644
index 0000000000..c1f59e9de9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/DownsamplingValidSettings.sql
@@ -0,0 +1,17 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+
+ `downsampling.aggregation` = "AVG",
+ `downsampling.aggregation` = "COUNT",
+ `downsampling.aggregation` = "DEFAULT_AGGREGATION",
+ `downsampling.aggregation` = "LAST",
+ `downsampling.aggregation` = "MAX",
+ `downsampling.aggregation` = "MIN",
+ `downsampling.aggregation` = "SUM",
+
+ `downsampling.fill` = "NONE",
+ `downsampling.fill` = "NULL",
+ `downsampling.fill` = "PREVIOUS"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/InvalidProject.cfg b/yql/essentials/tests/sql/suites/solomon/InvalidProject.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/InvalidProject.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/InvalidProject.sql b/yql/essentials/tests/sql/suites/solomon/InvalidProject.sql
new file mode 100644
index 0000000000..a9275c07d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/InvalidProject.sql
@@ -0,0 +1,5 @@
+SELECT * FROM local_solomon.invalid WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/LabelColumns.sql b/yql/essentials/tests/sql/suites/solomon/LabelColumns.sql
new file mode 100644
index 0000000000..0ff5b736c4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/LabelColumns.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ labels = "downsampling.disabled, downsampling.fill, project, downsampling.gridMillis"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/Subquery.sql b/yql/essentials/tests/sql/suites/solomon/Subquery.sql
new file mode 100644
index 0000000000..d3886b00ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/Subquery.sql
@@ -0,0 +1,15 @@
+DEFINE SUBQUERY $q($p) AS
+
+SELECT * FROM local_solomon.my_project WITH (
+ program = $p,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ `downsampling.disabled` = "true",
+ `downsampling.aggregation` = "SUM",
+ `downsampling.grid_interval` = "25",
+ `downsampling.fill` = "PREVIOUS"
+);
+
+END DEFINE;
+
+SELECT * FROM $q(@@{}@@);
diff --git a/yql/essentials/tests/sql/suites/solomon/UnknownSetting.cfg b/yql/essentials/tests/sql/suites/solomon/UnknownSetting.cfg
new file mode 100644
index 0000000000..58b70eefbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/UnknownSetting.cfg
@@ -0,0 +1,2 @@
+providers solomon
+xfail
diff --git a/yql/essentials/tests/sql/suites/solomon/UnknownSetting.sql b/yql/essentials/tests/sql/suites/solomon/UnknownSetting.sql
new file mode 100644
index 0000000000..0e51464d23
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/UnknownSetting.sql
@@ -0,0 +1,6 @@
+SELECT * FROM local_solomon.my_project WITH (
+ program = @@{}@@,
+ from = "2023-12-08T14:40:39Z",
+ to = "2023-12-08T14:45:39Z",
+ unk = "ABC"
+);
diff --git a/yql/essentials/tests/sql/suites/solomon/default.cfg b/yql/essentials/tests/sql/suites/solomon/default.cfg
new file mode 100644
index 0000000000..3e2499f96d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/solomon/default.cfg
@@ -0,0 +1 @@
+providers solomon
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg b/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg
new file mode 100644
index 0000000000..13ec07f2a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Event event.txt
+in Host host.txt
+providers dq
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt
new file mode 100644
index 0000000000..0c6dd06751
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt
@@ -0,0 +1,30 @@
+{"host"="host0";"id"="id_0";"net"="net0";"ts"=1716739200u;"type"="type_0";"user"="host0"};
+{"host"="host1";"id"="id_1";"net"="net1";"ts"=1716739201u;"type"="type_1";"user"="host1"};
+{"host"="host2";"id"="id_2";"net"="net2";"ts"=1716739202u;"type"="type_2";"user"="host2"};
+{"host"="host3";"id"="id_3";"net"="net3";"ts"=1716739203u;"type"="type_3";"user"="host3"};
+{"host"="host4";"id"="id_4";"net"="net0";"ts"=1716739204u;"type"="type_4";"user"="host4"};
+{"host"="host5";"id"="id_5";"net"="net1";"ts"=1716739205u;"type"="type_5";"user"="host0"};
+{"host"="host6";"id"="id_6";"net"="net2";"ts"=1716739206u;"type"="type_6";"user"="host1"};
+{"host"="host7";"id"="id_7";"net"="net3";"ts"=1716739207u;"type"="type_0";"user"="host2"};
+{"host"="host8";"id"="id_8";"net"="net0";"ts"=1716739208u;"type"="type_1";"user"="host3"};
+{"host"="very very long hostname to for test 1";"id"="id_9";"net"="net1";"ts"=1716739209u;"type"="type_2";"user"="host4"};
+{"host"="host0";"id"="id_10";"net"="net2";"ts"=1716739210u;"type"="type_3";"user"="host0"};
+{"host"="host1";"id"="id_11";"net"="net3";"ts"=1716739211u;"type"="type_4";"user"="host1"};
+{"host"="host2";"id"="id_12";"net"="net0";"ts"=1716739212u;"type"="type_5";"user"="host2"};
+{"host"="host3";"id"="id_13";"net"="net1";"ts"=1716739213u;"type"="type_6";"user"="host3"};
+{"host"="host4";"id"="id_14";"net"="net2";"ts"=1716739214u;"type"="type_0";"user"="host4"};
+{"host"="host5";"id"="id_15";"net"="net3";"ts"=1716739215u;"type"="type_1";"user"="host0"};
+{"host"="host6";"id"="id_16";"net"="net0";"ts"=1716739216u;"type"="type_2";"user"="host1"};
+{"host"="host7";"id"="id_17";"net"="net1";"ts"=1716739217u;"type"="type_3";"user"="host2"};
+{"host"="host8";"id"="id_18";"net"="net2";"ts"=1716739218u;"type"="type_4";"user"="host3"};
+{"host"="host9";"id"="id_19";"net"="net3";"ts"=1716739219u;"type"="type_5";"user"="host4"};
+{"host"="host0";"id"="id_20";"net"="net0";"ts"=1716739220u;"type"="type_6";"user"="host0"};
+{"host"="host1";"id"="id_21";"net"="net1";"ts"=1716739221u;"type"="type_0";"user"="host1"};
+{"host"="host2";"id"="id_22";"net"="net2";"ts"=1716739222u;"type"="type_1";"user"="host2"};
+{"host"="host3";"id"="id_23";"net"="net3";"ts"=1716739223u;"type"="type_2";"user"="host3"};
+{"host"="host4";"id"="id_24";"net"="net0";"ts"=1716739224u;"type"="type_3";"user"="host4"};
+{"host"="host5";"id"="id_25";"net"="net1";"ts"=1716739225u;"type"="type_4";"user"="host0"};
+{"host"="host6";"id"="id_26";"net"="net2";"ts"=1716739226u;"type"="type_5";"user"="host1"};
+{"host"="host7";"id"="id_27";"net"="net3";"ts"=1716739227u;"type"="type_6";"user"="host2"};
+{"host"="host8";"id"="id_28";"net"="net0";"ts"=1716739228u;"type"="type_0";"user"="host3"};
+{"host"="host9";"id"="id_29";"net"="net1";"ts"=1716739229u;"type"="type_1";"user"="host4"};
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr
new file mode 100644
index 0000000000..7dd7675ed1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["id";["DataType";"String"]];
+ ["ts";["DataType";"Datetime"]];
+ ["type";["DataType";"String"]];
+ ["host";["DataType";"String"]];
+ ["net";["DataType";"String"]];
+ ["user";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt
new file mode 100644
index 0000000000..793da43db5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt
@@ -0,0 +1,11 @@
+{"hostname"="host1";"fqdn"="fqdn1.net";"ip4"="192.168.0.1"; "ip6"="[xxxx:xxxx:xxxx:1111]"};
+{"hostname"="host2";"fqdn"="fqdn2.net";"ip4"="192.168.0.2"; "ip6"="[xxxx:xxxx:xxxx:2222]"};
+{"hostname"="host3";"fqdn"="fqdn3.net";"ip4"="192.168.0.3"; "ip6"="[xxxx:xxxx:xxxx:3333]"};
+{"hostname"="host4";"fqdn"="fqdn4.net";"ip4"="192.168.0.4"; "ip6"="[xxxx:xxxx:xxxx:4444]"};
+{"hostname"="host5";"fqdn"="fqdn5.net";"ip4"="192.168.0.5"; "ip6"="[xxxx:xxxx:xxxx:5555]"};
+{"hostname"="host6";"fqdn"="fqdn6.net";"ip4"="192.168.0.6"; "ip6"="[xxxx:xxxx:xxxx:6666]"};
+{"hostname"="host7";"fqdn"="fqdn7.net";"ip4"="192.168.0.7"; "ip6"="[xxxx:xxxx:xxxx:7777]"};
+{"hostname"="host8";"fqdn"="fqdn8.net";"ip4"="192.168.0.8"; "ip6"="[xxxx:xxxx:xxxx:8888]"};
+{"hostname"="very very long hostname to for test 1";"fqdn"="very very long fqdn for test 1";"ip4"="192.168.100.1"; "ip6"="[xxxx:xxxx:XXXX:1111]"};
+{"hostname"="very very long hostname to for test 2";"fqdn"="very very long fqdn for test 2";"ip4"="192.168.100.2"; "ip6"="[xxxx:xxxx:XXXX:2222]"};
+
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr
new file mode 100644
index 0000000000..2206fffce8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr
@@ -0,0 +1,8 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["hostname";["DataType";"String"]];
+ ["fqdn";["DataType";"String"]];
+ ["ip4";["DataType";"String"]];
+ ["ip6";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr
new file mode 100644
index 0000000000..7a11b85b77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql
new file mode 100644
index 0000000000..84eed2af7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql
@@ -0,0 +1,9 @@
+pragma dq.UseWideChannels = "true";
+use plato;
+
+select e.id as id, e.ts as ts, e.host as host, h.fqdn as fqdn, h.ip4 as ip4, h.ip6 as ip6
+ from Event as e
+ left join /*+ streamlookup() */ Host as h
+ on (e.host == h.hostname)
+;
+
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql
new file mode 100644
index 0000000000..e2ff789e2f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql
@@ -0,0 +1,9 @@
+pragma dq.UseWideChannels = "false";
+use plato;
+
+select e.id as id, e.ts as ts, e.host as host, h.fqdn as fqdn, h.ip4 as ip4, h.ip6 as ip6
+ from Event as e
+ left join /*+ streamlookup() */ Host as h
+ on (e.host == h.hostname)
+;
+
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg
new file mode 100644
index 0000000000..040f725d60
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg
@@ -0,0 +1,2 @@
+in Input1 empty_int64.txt
+in Input2 empty_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql
new file mode 100644
index 0000000000..d30c32b9b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql
@@ -0,0 +1,3 @@
+USE plato;
+
+SELECT * FROM concat(Input1, Input2); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg
new file mode 100644
index 0000000000..c717a38afa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg
@@ -0,0 +1,4 @@
+in Input sorted1.txt
+out Output output.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql
new file mode 100644
index 0000000000..bd692d7685
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+/* kikimr can not */
+/* multirun can not */
+USE plato;
+pragma yt.MaxInputTables="3";
+pragma yt.MaxInputTablesForSortedMerge="2";
+
+INSERT INTO Output
+SELECT
+ key,
+ value
+FROM concat(Input, Input, Input, Input)
+ORDER BY key
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg
new file mode 100644
index 0000000000..b6e7b1a582
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg
@@ -0,0 +1,2 @@
+in Input sorted1.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql
new file mode 100644
index 0000000000..08a4e76749
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* kikimr can not */
+/* multirun can not */
+USE plato;
+pragma yt.MaxInputTables="3";
+pragma yt.MaxInputTablesForSortedMerge="2";
+
+INSERT INTO Output
+SELECT
+ key,
+ value
+FROM concat(Input, Input, Input, Input)
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg
new file mode 100644
index 0000000000..4ea0bf2550
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted1.txt
+in Input2 sorted2.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql
new file mode 100644
index 0000000000..3e752de8b8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+select * from plato.concat("Input1", "Input2") order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg
new file mode 100644
index 0000000000..c4e9cf98a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg
@@ -0,0 +1,4 @@
+in InputA input.txt
+in InputD doc_view.txt
+in Input1 input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql b/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql
new file mode 100644
index 0000000000..c9ea1fd45b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+select * from plato.concat("InputA", "InputD");
diff --git a/yql/essentials/tests/sql/suites/table_range/doc_view.txt b/yql/essentials/tests/sql/suites/table_range/doc_view.txt
new file mode 100644
index 0000000000..d664c9eec9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/doc_view.txt
@@ -0,0 +1,10 @@
+$f = ($x)->{return $x+1};
+
+select key,min(num) as num from (
+select key,$f(0) as `num` from Input1
+union all
+select key,$f(1) as `num` from Input2
+)
+group by key
+order by key
+
diff --git a/yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr b/yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr
new file mode 100644
index 0000000000..41ea51e276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_yql_type"="view";
+ "type"="document";
+}
diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg
new file mode 100644
index 0000000000..62226ec6e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input1 nonexist.txt
+in Input2 nonexist.txt
+in Input3 nonexist.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg
new file mode 100644
index 0000000000..51e035b460
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 nonexist.txt
+in Input3 nonexist.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql
new file mode 100644
index 0000000000..a2527cc655
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* kikimr can not - range not supported */
+USE plato;
+SELECT * FROM each(["Input1", "Input2", "Input3"]);
diff --git a/yql/essentials/tests/sql/suites/table_range/empty_int64.txt b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr
new file mode 100644
index 0000000000..5a3a989e42
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int64"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1];
+ "SortedBy"=["key"];
+ "SortedByTypes"=[["DataType";"Int64";]];
+ "SortMembers"=["key"];
+}}
diff --git a/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr
new file mode 100644
index 0000000000..9bd4ce7778
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Uint32"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1];
+ "SortedBy"=["key"];
+ "SortedByTypes"=[["DataType";"Uint32";]];
+ "SortMembers"=["key"];
+}}
diff --git a/yql/essentials/tests/sql/suites/table_range/input.txt b/yql/essentials/tests/sql/suites/table_range/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg
new file mode 100644
index 0000000000..7cc6ef73bf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted1.txt
+in Input2 sorted1.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql
new file mode 100644
index 0000000000..6e940b08a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* kikimr can not */
+
+SELECT key, value, SUBSTRING(TablePath(), NULL, CAST(LENGTH(TablePath()) - 1 as Uint32)) as path
+FROM plato.range("","Input1", "Input2")
+LIMIT 2
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg
new file mode 100644
index 0000000000..b9f4d07258
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_non_strict.txt
+in Input2 sorted1.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql
new file mode 100644
index 0000000000..97d2b56b77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+SELECT key, subkey FROM CONCAT(Input1, Input1) ORDER BY key, subkey;
+
+SELECT key, subkey FROM CONCAT(Input1, Input2) ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg
new file mode 100644
index 0000000000..ceaf2a5ea3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg
@@ -0,0 +1,2 @@
+in Input1 sorted_desc.txt
+in Input2 sorted_desc.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql b/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql
new file mode 100644
index 0000000000..fa2f513898
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+/* syntax version 1 */
+use plato;
+
+select t.*, TableName() as path from range("","Input1", "Input2") as t
+order by path, key, value;
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg
new file mode 100644
index 0000000000..c6cac50799
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf python3_udf
+udf unicode_udf
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql b/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql
new file mode 100644
index 0000000000..682f3fdb79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+/* kikimr can not - range not supported */
+select count(*) as count from plato.filter(``, Unicode::IsUtf);
+
+$script = @@
+def f(s):
+ return True
+@@;
+
+$callable = Python3::f(Callable<(String)->Bool?>,$script);
+select count(*) as count from plato.filter(``, $callable);
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg
new file mode 100644
index 0000000000..6149ae4837
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf python3_udf
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql
new file mode 100644
index 0000000000..4756b27c4b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+/* kikimr can not - range not supported */
+$script = @@
+def f(f):
+ def ft(s):
+ return True
+ def ff(s):
+ return False
+ return f and ft or ff
+@@;
+
+$callable = Python3::f(Callable<(Bool)->Callable<(String)->Bool>>,$script);
+$callableT = $callable(Re2::Match('test.*')('testfets'));
+
+select count(*) as count from plato.filter(``, $callableT);
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg
new file mode 100644
index 0000000000..e300a83153
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_like.sql b/yql/essentials/tests/sql/suites/table_range/range_over_like.sql
new file mode 100644
index 0000000000..28a45f57fe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_like.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+/* syntax version 1 */
+select count(*) as count from plato.like(``, "_np%");
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg
new file mode 100644
index 0000000000..ce7c51a32a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql
new file mode 100644
index 0000000000..f78820f952
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+/* syntax version 1 */
+PRAGMA RegexUseRe2='true';
+select count(*) as count from plato.regexp(``, "np");
diff --git a/yql/essentials/tests/sql/suites/table_range/range_slash.cfg b/yql/essentials/tests/sql/suites/table_range/range_slash.cfg
new file mode 100644
index 0000000000..53bfd46c84
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_slash.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 input.txt
+
diff --git a/yql/essentials/tests/sql/suites/table_range/range_slash.sql b/yql/essentials/tests/sql/suites/table_range/range_slash.sql
new file mode 100644
index 0000000000..f0a2693294
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_slash.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+USE plato;
+
+SELECT *
+FROM RANGE("/", "Input1", "Input2", "/");
+
+SELECT *
+FROM RANGE("/", "Input1", "Input2", "/");
+
diff --git a/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql
new file mode 100644
index 0000000000..b1dc52aa63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+select count(*) as count from plato.range(``, ``, ``, ``, ksv);
diff --git a/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg
new file mode 100644
index 0000000000..c4e9cf98a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg
@@ -0,0 +1,4 @@
+in InputA input.txt
+in InputD doc_view.txt
+in Input1 input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/range_with_view.sql b/yql/essentials/tests/sql/suites/table_range/range_with_view.sql
new file mode 100644
index 0000000000..4e28ca82e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/range_with_view.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* kikimr can not - range not supported */
+select * from plato.range("","InputA", "InputD");
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted1.txt b/yql/essentials/tests/sql/suites/table_range/sorted1.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted1.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted2.txt b/yql/essentials/tests/sql/suites/table_range/sorted2.txt
new file mode 100644
index 0000000000..2ede97b886
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted2.txt
@@ -0,0 +1,6 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr
new file mode 100644
index 0000000000..02e438f8df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["OptionalType"; ["DataType";"String";]]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["OptionalType"; ["DataType";"String";]];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt
new file mode 100644
index 0000000000..235fc7cd49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt
@@ -0,0 +1,10 @@
+{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"};
+{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"};
+{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"};
+{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"};
+{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"};
+{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"};
+{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"};
+{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr
new file mode 100644
index 0000000000..5a6ca5761e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr
@@ -0,0 +1,47 @@
+{
+ "_yql_row_spec" = {
+ "SortMembers" = [
+ "key"
+ ];
+ "SortDirections" = [
+ 0
+ ];
+ "UniqueKeys" = %false;
+ "SortedByTypes" = [
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ "StrictSchema" = %true;
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ];
+ "SortedBy" = [
+ "_yql_column_0"
+ ]
+ }
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt
new file mode 100644
index 0000000000..1fa10bf270
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value2"="q"};
+{"key"="075";"subkey"="1";"value2"="abc"};
+{"key"="150";"subkey"="4";"value2"="qzz"};
+{"key"="800";"subkey"="2";"value2"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr
new file mode 100644
index 0000000000..a932faecd8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr
@@ -0,0 +1,15 @@
+{
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg
new file mode 100644
index 0000000000..4464fb271c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+udf re2_udf
+udf hyperscan_udf
+udf string_udf
+
diff --git a/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql
new file mode 100644
index 0000000000..0ca6068d44
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+select count(*) from concat("Inp"||Unicode::ToLower("ut"u));
+select count(*) from concat_strict("Inp"||Unicode::ToLower("ut"u));
+select count(*) from range("","Inp" || Unicode::ToLower("ut"u));
+select count(*) from range_strict("","Inp" || Unicode::ToLower("ut"u));
+select count(*) from filter("",($x)->{return $x == "Input"});
+select count(*) from filter_strict("",($x)->{return $x == "Input"});
+select count(*) from like("","Inp" || "%");
+select count(*) from like_strict("","Inp" || "%");
+select count(*) from regexp("","Inp" || ".t");
+select count(*) from regexp_strict("","Inp" || ".t");
+select count(*) from each(AsList("Input"));
+select count(*) from each_strict(AsList("Input"));
+select count(*) from folder(SUBSTRING("foo",0,0));
diff --git a/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg
new file mode 100644
index 0000000000..51e035b460
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg
@@ -0,0 +1,3 @@
+in Input1 input.txt
+in Input2 nonexist.txt
+in Input3 nonexist.txt
diff --git a/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql
new file mode 100644
index 0000000000..f6a46792fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql
@@ -0,0 +1,6 @@
+/* syntax version 1 */
+/* kikimr can not - range not supported */
+USE plato;
+SELECT key, subkey, TableName() AS name
+FROM each(["Input1", "Input2", "Input3"])
+WITH SCHEMA Struct<key:String, subkey:String, value:String>;
diff --git a/yql/essentials/tests/sql/suites/table_range/view_input.txt b/yql/essentials/tests/sql/suites/table_range/view_input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/view_input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/table_range/view_input.txt.attr b/yql/essentials/tests/sql/suites/table_range/view_input.txt.attr
new file mode 100644
index 0000000000..07386c98e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/table_range/view_input.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_ksv"="SELECT key as k, subkey as s, value as v FROM self";
+ "_yql_view_key"="SELECT key FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/customer.txt b/yql/essentials/tests/sql/suites/tpch/customer.txt
new file mode 100644
index 0000000000..51461f4d12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/customer.txt
@@ -0,0 +1 @@
+{"c_custkey"=1;"c_acctbal"=711.56;"c_phone"="25-989-741-2988";"c_mktsegment"="BUILDING";"c_nationkey"=15;"c_comment"="to the even, regular platelets. regular, ironic epitaphs nag e";"c_name"="Customer#000000001";"c_address"="IVhzIApeRb ot,c,E";};
diff --git a/yql/essentials/tests/sql/suites/tpch/customer.txt.attr b/yql/essentials/tests/sql/suites/tpch/customer.txt.attr
new file mode 100644
index 0000000000..db4ca5853e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/customer.txt.attr
@@ -0,0 +1,56 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "c_custkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "c_acctbal";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "c_phone";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "c_mktsegment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "c_nationkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "c_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "c_name";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "c_address";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/default.cfg b/yql/essentials/tests/sql/suites/tpch/default.cfg
new file mode 100644
index 0000000000..f3c9624348
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/default.cfg
@@ -0,0 +1,8 @@
+in customer customer.txt
+in lineitem lineitem.txt
+in nation nation.txt
+in orders orders.txt
+in part part.txt
+in partsupp partsupp.txt
+in region region.txt
+in supplier supplier.txt
diff --git a/yql/essentials/tests/sql/suites/tpch/lineitem.txt b/yql/essentials/tests/sql/suites/tpch/lineitem.txt
new file mode 100644
index 0000000000..dedb4b8f12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/lineitem.txt
@@ -0,0 +1 @@
+{"l_orderkey"=1;"l_linenumber"=1;"l_discount"=0.04;"l_extendedprice"=21168.23;"l_comment"="egular courts above the";"l_shipdate"=9568u;"l_returnflag"="N";"l_partkey"=155190;"l_tax"=0.02;"l_shipinstruct"="DELIVER IN PERSON";"l_commitdate"=9538u;"l_receiptdate"=9577u;"l_quantity"=17.;"l_suppkey"=7706;"l_shipmode"="TRUCK";"l_linestatus"="O";};
diff --git a/yql/essentials/tests/sql/suites/tpch/lineitem.txt.attr b/yql/essentials/tests/sql/suites/tpch/lineitem.txt.attr
new file mode 100644
index 0000000000..7abd7775de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/lineitem.txt.attr
@@ -0,0 +1,114 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "l_orderkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "l_linenumber";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "l_discount";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "l_extendedprice";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "l_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "l_shipdate";
+ "required" = %false;
+ "type" = "date";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "date";
+ };
+ };
+ {
+ "name" = "l_returnflag";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "l_partkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "l_tax";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "l_shipinstruct";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "l_commitdate";
+ "required" = %false;
+ "type" = "date";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "date";
+ };
+ };
+ {
+ "name" = "l_receiptdate";
+ "required" = %false;
+ "type" = "date";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "date";
+ };
+ };
+ {
+ "name" = "l_quantity";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "l_suppkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "l_shipmode";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "l_linestatus";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/nation.txt b/yql/essentials/tests/sql/suites/tpch/nation.txt
new file mode 100644
index 0000000000..69cbb20e37
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/nation.txt
@@ -0,0 +1 @@
+{"n_nationkey"=0;"n_regionkey"=0;"n_name"="ALGERIA";"n_comment"=" haggle. carefully final deposits detect slyly agai";};
diff --git a/yql/essentials/tests/sql/suites/tpch/nation.txt.attr b/yql/essentials/tests/sql/suites/tpch/nation.txt.attr
new file mode 100644
index 0000000000..1db996b861
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/nation.txt.attr
@@ -0,0 +1,32 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "n_nationkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "n_regionkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "n_name";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "n_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/orders.txt b/yql/essentials/tests/sql/suites/tpch/orders.txt
new file mode 100644
index 0000000000..0fb3aa5340
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/orders.txt
@@ -0,0 +1 @@
+{"o_orderkey"=1;"o_orderstatus"="O";"o_comment"="nstructions sleep furiously among ";"o_totalprice"=173665.47;"o_clerk"="Clerk#000000951";"o_custkey"=36901;"o_orderpriority"="5-LOW";"o_orderdate"=9497u;"o_shippriority"=0;};
diff --git a/yql/essentials/tests/sql/suites/tpch/orders.txt.attr b/yql/essentials/tests/sql/suites/tpch/orders.txt.attr
new file mode 100644
index 0000000000..fb5e422f56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/orders.txt.attr
@@ -0,0 +1,65 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "o_orderkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "o_orderstatus";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "o_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "o_totalprice";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "o_clerk";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "o_custkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "o_orderpriority";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "o_orderdate";
+ "required" = %false;
+ "type" = "date";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "date";
+ };
+ };
+ {
+ "name" = "o_shippriority";
+ "required" = %true;
+ "type" = "int64";
+ "type_v3" = "int64";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/part.txt b/yql/essentials/tests/sql/suites/tpch/part.txt
new file mode 100644
index 0000000000..62ebe18f41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/part.txt
@@ -0,0 +1 @@
+{"p_partkey"=1;"p_name"="goldenrod lavender spring chocolate lace";"p_container"="JUMBO PKG";"p_size"=7;"p_type"="PROMO BURNISHED COPPER";"p_comment"="ly. slyly ironi";"p_retailprice"=901.;"p_mfgr"="Manufacturer#1";"p_brand"="Brand#13";};
diff --git a/yql/essentials/tests/sql/suites/tpch/part.txt.attr b/yql/essentials/tests/sql/suites/tpch/part.txt.attr
new file mode 100644
index 0000000000..973fedb9e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/part.txt.attr
@@ -0,0 +1,62 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "p_partkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "p_name";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "p_container";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "p_size";
+ "required" = %true;
+ "type" = "int64";
+ "type_v3" = "int64";
+ };
+ {
+ "name" = "p_type";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "p_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "p_retailprice";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "p_mfgr";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "p_brand";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/partsupp.txt b/yql/essentials/tests/sql/suites/tpch/partsupp.txt
new file mode 100644
index 0000000000..c06ac1b884
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/partsupp.txt
@@ -0,0 +1 @@
+{"ps_partkey"=1;"ps_suppkey"=2;"ps_comment"=", even theodolites. regular, final theodolites eat after the carefully pending foxes. furiously regular deposits sleep slyly. carefully bold realms above the ironic dependencies haggle careful";"ps_supplycost"=771.64;"ps_availqty"=3325;};
diff --git a/yql/essentials/tests/sql/suites/tpch/partsupp.txt.attr b/yql/essentials/tests/sql/suites/tpch/partsupp.txt.attr
new file mode 100644
index 0000000000..b941075b07
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/partsupp.txt.attr
@@ -0,0 +1,39 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "ps_partkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "ps_suppkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "ps_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "ps_supplycost";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "ps_availqty";
+ "required" = %true;
+ "type" = "int64";
+ "type_v3" = "int64";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/q1.sql b/yql/essentials/tests/sql/suites/tpch/q1.sql
new file mode 100644
index 0000000000..3f8ccfe964
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q1.sql
@@ -0,0 +1,26 @@
+
+-- TPC-H/TPC-R Pricing Summary Report Query (Q1)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+select
+ l_returnflag,
+ l_linestatus,
+ sum(l_quantity) as sum_qty,
+ sum(l_extendedprice) as sum_base_price,
+ sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
+ sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
+ avg(l_quantity) as avg_qty,
+ avg(l_extendedprice) as avg_price,
+ avg(l_discount) as avg_disc,
+ count(*) as count_order
+from
+ plato.lineitem
+where
+ CAST(l_shipdate AS Timestamp) <= (CAST('1998-12-01' AS Date) - Interval("P100D"))
+group by
+ l_returnflag,
+ l_linestatus
+order by
+ l_returnflag,
+ l_linestatus;
diff --git a/yql/essentials/tests/sql/suites/tpch/q10.sql b/yql/essentials/tests/sql/suites/tpch/q10.sql
new file mode 100644
index 0000000000..1d3e4a75bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q10.sql
@@ -0,0 +1,87 @@
+
+-- TPC-H/TPC-R Returned Item Reporting Query (Q10)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1993-12-01");
+$join1 = (
+select
+ c.c_custkey as c_custkey,
+ c.c_name as c_name,
+ c.c_acctbal as c_acctbal,
+ c.c_address as c_address,
+ c.c_phone as c_phone,
+ c.c_comment as c_comment,
+ c.c_nationkey as c_nationkey,
+ o.o_orderkey as o_orderkey
+from
+ plato.customer as c
+join
+ plato.orders as o
+on
+ c.c_custkey = o.o_custkey
+where
+ cast(o.o_orderdate as timestamp) >= $border and
+ cast(o.o_orderdate as timestamp) < ($border + Interval("P90D"))
+);
+$join2 = (
+select
+ j.c_custkey as c_custkey,
+ j.c_name as c_name,
+ j.c_acctbal as c_acctbal,
+ j.c_address as c_address,
+ j.c_phone as c_phone,
+ j.c_comment as c_comment,
+ j.c_nationkey as c_nationkey,
+ l.l_extendedprice as l_extendedprice,
+ l.l_discount as l_discount
+from
+ $join1 as j
+join
+ plato.lineitem as l
+on
+ l.l_orderkey = j.o_orderkey
+where
+ l.l_returnflag = 'R'
+);
+$join3 = (
+select
+ j.c_custkey as c_custkey,
+ j.c_name as c_name,
+ j.c_acctbal as c_acctbal,
+ j.c_address as c_address,
+ j.c_phone as c_phone,
+ j.c_comment as c_comment,
+ j.c_nationkey as c_nationkey,
+ j.l_extendedprice as l_extendedprice,
+ j.l_discount as l_discount,
+ n.n_name as n_name
+from
+ $join2 as j
+join
+ plato.nation as n
+on
+ n.n_nationkey = j.c_nationkey
+);
+select
+ c_custkey,
+ c_name,
+ sum(l_extendedprice * (1 - l_discount)) as revenue,
+ c_acctbal,
+ n_name,
+ c_address,
+ c_phone,
+ c_comment
+from
+ $join3
+group by
+ c_custkey,
+ c_name,
+ c_acctbal,
+ c_phone,
+ n_name,
+ c_address,
+ c_comment
+order by
+ revenue desc
+limit 20;
diff --git a/yql/essentials/tests/sql/suites/tpch/q11.sql b/yql/essentials/tests/sql/suites/tpch/q11.sql
new file mode 100644
index 0000000000..2a80fb6128
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q11.sql
@@ -0,0 +1,62 @@
+
+-- TPC-H/TPC-R Important Stock Identification Query (Q11)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+PRAGMA DisableSimpleColumns;
+
+$join1 = (
+select
+ ps.ps_partkey as ps_partkey,
+ ps.ps_supplycost as ps_supplycost,
+ ps.ps_availqty as ps_availqty,
+ s.s_nationkey as s_nationkey
+from
+ plato.partsupp as ps
+join
+ plato.supplier as s
+on
+ ps.ps_suppkey = s.s_suppkey
+);
+$join2 = (
+select
+ j.ps_partkey as ps_partkey,
+ j.ps_supplycost as ps_supplycost,
+ j.ps_availqty as ps_availqty,
+ j.s_nationkey as s_nationkey
+from
+ $join1 as j
+join
+ plato.nation as n
+on
+ n.n_nationkey = j.s_nationkey
+where
+ n.n_name = 'CANADA'
+);
+$threshold = (
+select
+ sum(ps_supplycost * ps_availqty) * 0.0001000000 as threshold
+from
+ $join2
+);
+$values = (
+select
+ ps_partkey,
+ sum(ps_supplycost * ps_availqty) as value
+from
+ $join2
+group by
+ ps_partkey
+);
+
+select
+ v.ps_partkey as ps_partkey,
+ v.value as value
+from
+ $values as v
+cross join
+ $threshold as t
+where
+ v.value > t.threshold
+order by
+ value desc;
diff --git a/yql/essentials/tests/sql/suites/tpch/q12.sql b/yql/essentials/tests/sql/suites/tpch/q12.sql
new file mode 100644
index 0000000000..d8425b0b4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q12.sql
@@ -0,0 +1,45 @@
+
+-- TPC-H/TPC-R Shipping Modes and Order Priority Query (Q12)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$join = (
+ select
+ l.l_shipmode as l_shipmode,
+ o.o_orderpriority as o_orderpriority,
+ l.l_commitdate as l_commitdate,
+ l.l_shipdate as l_shipdate,
+ l.l_receiptdate as l_receiptdate
+ from
+ plato.orders as o
+ join plato.lineitem as l
+ on o.o_orderkey == l.l_orderkey
+);
+
+$border = Date("1994-01-01");
+
+select
+ l_shipmode,
+ sum(case
+ when o_orderpriority = '1-URGENT'
+ or o_orderpriority = '2-HIGH'
+ then 1
+ else 0
+ end) as high_line_count,
+ sum(case
+ when o_orderpriority <> '1-URGENT'
+ and o_orderpriority <> '2-HIGH'
+ then 1
+ else 0
+ end) as low_line_count
+from $join
+where
+ (l_shipmode = 'MAIL' or l_shipmode = 'TRUCK')
+ and l_commitdate < l_receiptdate
+ and l_shipdate < l_commitdate
+ and cast(l_receiptdate as timestamp) >= $border
+ and cast(l_receiptdate as timestamp) < ($border + Interval("P365D"))
+group by
+ l_shipmode
+order by
+ l_shipmode;
diff --git a/yql/essentials/tests/sql/suites/tpch/q13.sql b/yql/essentials/tests/sql/suites/tpch/q13.sql
new file mode 100644
index 0000000000..e94f36a545
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q13.sql
@@ -0,0 +1,33 @@
+
+-- TPC-H/TPC-R Customer Distribution Query (Q13)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$orders = (
+ select
+ o_orderkey,
+ o_custkey
+ from
+ plato.orders
+ where
+ o_comment NOT LIKE "%unusual%requests%"
+);
+select
+ c_count as c_count,
+ count(*) as custdist
+from
+ (
+ select
+ c.c_custkey as c_custkey,
+ count(o.o_orderkey) as c_count
+ from
+ plato.customer as c left outer join $orders as o on
+ c.c_custkey = o.o_custkey
+ group by
+ c.c_custkey
+ ) as c_orders
+group by
+ c_count
+order by
+ custdist desc,
+ c_count desc;
diff --git a/yql/essentials/tests/sql/suites/tpch/q14.sql b/yql/essentials/tests/sql/suites/tpch/q14.sql
new file mode 100644
index 0000000000..99ad7f0c4e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q14.sql
@@ -0,0 +1,21 @@
+
+-- TPC-H/TPC-R Promotion Effect Query (Q14)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1994-08-01");
+select
+ 100.00 * sum(case
+ when StartsWith(p.p_type, 'PROMO')
+ then l.l_extendedprice * (1 - l.l_discount)
+ else 0
+ end) / sum(l.l_extendedprice * (1 - l.l_discount)) as promo_revenue
+from
+ plato.lineitem as l
+join
+ plato.part as p
+on
+ l.l_partkey = p.p_partkey
+where
+ cast(l.l_shipdate as timestamp) >= $border
+ and cast(l.l_shipdate as timestamp) < ($border + Interval("P31D"));
diff --git a/yql/essentials/tests/sql/suites/tpch/q15.sql b/yql/essentials/tests/sql/suites/tpch/q15.sql
new file mode 100644
index 0000000000..e8a141e83f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q15.sql
@@ -0,0 +1,56 @@
+-- ignore runonopt plan diff
+-- TPC-H/TPC-R Top Supplier Query (Q15)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1997-03-01");
+$revenue0 = (
+ select
+ l_suppkey as supplier_no,
+ sum(l_extendedprice * (1 - l_discount)) as total_revenue,
+ cast(sum(l_extendedprice * (1 - l_discount)) as Uint64) as total_revenue_approx
+ from
+ plato.lineitem
+ where
+ cast(l_shipdate as timestamp) >= $border
+ and cast(l_shipdate as timestamp) < ($border + Interval("P92D"))
+ group by
+ l_suppkey
+);
+$max_revenue = (
+select
+ max(total_revenue_approx) as max_revenue
+from
+ $revenue0
+);
+$join1 = (
+select
+ s.s_suppkey as s_suppkey,
+ s.s_name as s_name,
+ s.s_address as s_address,
+ s.s_phone as s_phone,
+ r.total_revenue as total_revenue,
+ r.total_revenue_approx as total_revenue_approx
+from
+ plato.supplier as s
+join
+ $revenue0 as r
+on
+ s.s_suppkey = r.supplier_no
+);
+
+select
+ j.s_suppkey as s_suppkey,
+ j.s_name as s_name,
+ j.s_address as s_address,
+ j.s_phone as s_phone,
+ j.total_revenue as total_revenue
+from
+ $join1 as j
+join
+ $max_revenue as m
+on
+ j.total_revenue_approx = m.max_revenue
+order by
+ s_suppkey;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q16.sql b/yql/essentials/tests/sql/suites/tpch/q16.sql
new file mode 100644
index 0000000000..153b72797b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q16.sql
@@ -0,0 +1,44 @@
+
+-- TPC-H/TPC-R Parts/Supplier Relationship Query (Q16)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$join = (
+select
+ ps.ps_suppkey as ps_suppkey,
+ ps.ps_partkey as ps_partkey
+from
+ plato.partsupp as ps
+left join
+ plato.supplier as w
+on
+ w.s_suppkey = ps.ps_suppkey
+where not (s_comment like "%Customer%Complaints%")
+);
+
+select
+ p.p_brand as p_brand,
+ p.p_type as p_type,
+ p.p_size as p_size,
+ count(distinct j.ps_suppkey) as supplier_cnt
+from
+ $join as j
+join
+ plato.part as p
+on
+ p.p_partkey = j.ps_partkey
+where
+ p.p_brand <> 'Brand#33'
+ and (not StartsWith(p.p_type, 'PROMO POLISHED'))
+ and (p.p_size = 20 or p.p_size = 27 or p.p_size = 11 or p.p_size = 45 or p.p_size = 40 or p.p_size = 41 or p.p_size = 34 or p.p_size = 36)
+group by
+ p.p_brand,
+ p.p_type,
+ p.p_size
+order by
+ supplier_cnt desc,
+ p_brand,
+ p_type,
+ p_size
+;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q17.sql b/yql/essentials/tests/sql/suites/tpch/q17.sql
new file mode 100644
index 0000000000..c775d585bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q17.sql
@@ -0,0 +1,41 @@
+
+-- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$threshold = (
+select
+ 0.2 * avg(l_quantity) as threshold,
+ l_partkey
+from
+ plato.lineitem
+group by
+ l_partkey
+);
+
+$join1 = (
+select
+ p.p_partkey as p_partkey,
+ l.l_extendedprice as l_extendedprice,
+ l.l_quantity as l_quantity
+from
+ plato.lineitem as l
+join
+ plato.part as p
+on
+ p.p_partkey = l.l_partkey
+where
+ p.p_brand = 'Brand#35'
+ and p.p_container = 'LG DRUM'
+);
+
+select
+ sum(j.l_extendedprice) / 7.0 as avg_yearly
+from
+ $join1 as j
+join
+ $threshold as t
+on
+ j.p_partkey = t.l_partkey
+where
+ j.l_quantity < t.threshold;
diff --git a/yql/essentials/tests/sql/suites/tpch/q18.sql b/yql/essentials/tests/sql/suites/tpch/q18.sql
new file mode 100644
index 0000000000..dfc0e858ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q18.sql
@@ -0,0 +1,53 @@
+
+-- TPC-H/TPC-R Large Volume Customer Query (Q18)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$in = (
+select
+ l_orderkey,
+ sum(l_quantity) as sum_l_quantity
+from
+ plato.lineitem
+group by
+ l_orderkey having
+ sum(l_quantity) > 315
+);
+
+$join1 = (
+select
+ c.c_name as c_name,
+ c.c_custkey as c_custkey,
+ o.o_orderkey as o_orderkey,
+ o.o_orderdate as o_orderdate,
+ o.o_totalprice as o_totalprice
+from
+ plato.customer as c
+join
+ plato.orders as o
+on
+ c.c_custkey = o.o_custkey
+);
+select
+ j.c_name as c_name,
+ j.c_custkey as c_custkey,
+ j.o_orderkey as o_orderkey,
+ j.o_orderdate as o_orderdate,
+ j.o_totalprice as o_totalprice,
+ sum(i.sum_l_quantity) as sum_l_quantity
+from
+ $join1 as j
+join
+ $in as i
+on
+ i.l_orderkey = j.o_orderkey
+group by
+ j.c_name,
+ j.c_custkey,
+ j.o_orderkey,
+ j.o_orderdate,
+ j.o_totalprice
+order by
+ o_totalprice desc,
+ o_orderdate
+limit 100;
diff --git a/yql/essentials/tests/sql/suites/tpch/q19.sql b/yql/essentials/tests/sql/suites/tpch/q19.sql
new file mode 100644
index 0000000000..e9b3a7d7bc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q19.sql
@@ -0,0 +1,40 @@
+
+-- TPC-H/TPC-R Discounted Revenue Query (Q19)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+select
+ sum(l.l_extendedprice* (1 - l.l_discount)) as revenue
+from
+ plato.lineitem as l
+join
+ plato.part as p
+on
+ p.p_partkey = l.l_partkey
+where
+ (
+ p.p_brand = 'Brand#23'
+ and (p.p_container = 'SM CASE' or p.p_container = 'SM BOX' or p.p_container = 'SM PACK' or p.p_container = 'SM PKG')
+ and l.l_quantity >= 7 and l.l_quantity <= 7 + 10
+ and p.p_size between 1 and 5
+ and (l.l_shipmode = 'AIR' or l.l_shipmode = 'AIR REG')
+ and l.l_shipinstruct = 'DELIVER IN PERSON'
+ )
+ or
+ (
+ p.p_brand = 'Brand#15'
+ and (p.p_container = 'MED BAG' or p.p_container = 'MED BOX' or p.p_container = 'MED PKG' or p.p_container = 'MED PACK')
+ and l.l_quantity >= 17 and l.l_quantity <= 17 + 10
+ and p.p_size between 1 and 10
+ and (l.l_shipmode = 'AIR' or l.l_shipmode = 'AIR REG')
+ and l.l_shipinstruct = 'DELIVER IN PERSON'
+ )
+ or
+ (
+ p.p_brand = 'Brand#44'
+ and (p.p_container = 'LG CASE' or p.p_container = 'LG BOX' or p.p_container = 'LG PACK' or p.p_container = 'LG PKG')
+ and l.l_quantity >= 25 and l.l_quantity <= 25 + 10
+ and p.p_size between 1 and 15
+ and (l.l_shipmode = 'AIR' or l.l_shipmode = 'AIR REG')
+ and l.l_shipinstruct = 'DELIVER IN PERSON'
+ );
diff --git a/yql/essentials/tests/sql/suites/tpch/q2.sql b/yql/essentials/tests/sql/suites/tpch/q2.sql
new file mode 100644
index 0000000000..f8e11a8c5d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q2.sql
@@ -0,0 +1,68 @@
+
+-- TPC-H/TPC-R Minimum Cost Supplier Query (Q2)
+-- using 1680793381 as a seed to the RNG
+
+$r = (select r_regionkey from
+ plato.region
+where r_name='AMERICA');
+
+$j1 = (select n_name,n_nationkey
+ from plato.nation as n
+ join $r as r on
+ n.n_regionkey = r.r_regionkey);
+
+$j2 = (select s_acctbal,s_name,s_address,s_phone,s_comment,n_name,s_suppkey
+ from plato.supplier as s
+ join $j1 as j on
+ s.s_nationkey = j.n_nationkey
+);
+
+$j3 = (select ps_partkey,ps_supplycost,s_acctbal,s_name,s_address,s_phone,s_comment,n_name
+ from plato.partsupp as ps
+ join $j2 as j on
+ ps.ps_suppkey = j.s_suppkey
+);
+
+$min_ps_supplycost = (select min(ps_supplycost) as min_ps_supplycost,ps_partkey
+ from $j3
+ group by ps_partkey
+);
+
+$p = (select p_partkey,p_mfgr
+ from plato.part
+ where
+ p_size = 10
+ and p_type like '%COPPER'
+);
+
+$j4 = (select s_acctbal,
+ s_name,
+ n_name,
+ p_partkey,
+ p_mfgr,
+ s_address,
+ s_phone,
+ s_comment
+ from $p as p
+ join $j3 as j on p.p_partkey = j.ps_partkey
+ join $min_ps_supplycost as m on p.p_partkey = m.ps_partkey
+ where min_ps_supplycost=ps_supplycost
+);
+
+select
+ s_acctbal,
+ s_name,
+ n_name,
+ p_partkey,
+ p_mfgr,
+ s_address,
+ s_phone,
+ s_comment
+from $j4
+order by
+ s_acctbal desc,
+ n_name,
+ s_name,
+ p_partkey
+limit 100;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q20.sql b/yql/essentials/tests/sql/suites/tpch/q20.sql
new file mode 100644
index 0000000000..3272f866d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q20.sql
@@ -0,0 +1,83 @@
+
+-- TPC-H/TPC-R Potential Part Promotion Query (Q20)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1993-01-01");
+$threshold = (
+select
+ 0.5 * sum(l_quantity) as threshold,
+ l_partkey as l_partkey,
+ l_suppkey as l_suppkey
+from
+ plato.lineitem
+where
+ cast(l_shipdate as timestamp) >= $border
+ and cast(l_shipdate as timestamp) < ($border + Interval("P365D"))
+group by
+ l_partkey, l_suppkey
+);
+
+$parts = (
+select
+ p_partkey
+from
+ plato.part
+where
+ StartsWith(p_name, 'maroon')
+);
+
+$join1 = (
+select
+ ps.ps_suppkey as ps_suppkey,
+ ps.ps_availqty as ps_availqty,
+ ps.ps_partkey as ps_partkey
+from
+ plato.partsupp as ps
+join any
+ $parts as p
+on
+ ps.ps_partkey = p.p_partkey
+);
+
+$join2 = (
+select
+ distinct(j.ps_suppkey) as ps_suppkey
+from
+ $join1 as j
+join any
+ $threshold as t
+on
+ j.ps_partkey = t.l_partkey and j.ps_suppkey = t.l_suppkey
+where
+ j.ps_availqty > t.threshold
+);
+
+$join3 = (
+select
+ j.ps_suppkey as ps_suppkey,
+ s.s_name as s_name,
+ s.s_address as s_address,
+ s.s_nationkey as s_nationkey
+from
+ $join2 as j
+join any
+ plato.supplier as s
+on
+ j.ps_suppkey = s.s_suppkey
+);
+
+select
+ j.s_name as s_name,
+ j.s_address as s_address
+from
+ $join3 as j
+join
+ plato.nation as n
+on
+ j.s_nationkey = n.n_nationkey
+where
+ n.n_name = 'VIETNAM'
+order by
+ s_name;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q21.sql b/yql/essentials/tests/sql/suites/tpch/q21.sql
new file mode 100644
index 0000000000..8b116c809c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q21.sql
@@ -0,0 +1,51 @@
+
+-- TPC-H/TPC-R Suppliers Who Kept Orders Waiting Query (Q21)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$n = select n_nationkey from plato.nation
+where n_name = 'EGYPT';
+
+$s = select s_name, s_suppkey from plato.supplier as supplier
+join $n as nation
+on supplier.s_nationkey = nation.n_nationkey;
+
+$l = select l_suppkey, l_orderkey from plato.lineitem
+where l_receiptdate > l_commitdate;
+
+$j1 = select s_name, l_suppkey, l_orderkey from $l as l1
+join $s as supplier
+on l1.l_suppkey = supplier.s_suppkey;
+
+$j1_1 = select l1.l_orderkey as l_orderkey from $j1 as l1
+join $l as l3
+on l1.l_orderkey = l3.l_orderkey
+where l3.l_suppkey <> l1.l_suppkey;
+
+$j2 = select s_name, l_suppkey, l_orderkey from $j1 as l1
+left only join $j1_1 as l3
+on l1.l_orderkey = l3.l_orderkey;
+
+$j2_1 = select l1.l_orderkey as l_orderkey from $j2 as l1
+join plato.lineitem as l2
+on l1.l_orderkey = l2.l_orderkey
+where l2.l_suppkey <> l1.l_suppkey;
+
+$j3 = select s_name, l1.l_suppkey as l_suppkey, l1.l_orderkey as l_orderkey from $j2 as l1
+left semi join $j2_1 as l2
+on l1.l_orderkey = l2.l_orderkey;
+
+$j4 = select s_name from $j3 as l1
+join plato.orders as orders
+on orders.o_orderkey = l1.l_orderkey
+where o_orderstatus = 'F';
+
+select s_name,
+ count(*) as numwait from $j4
+group by
+ s_name
+order by
+ numwait desc,
+ s_name
+limit 100;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q22.sql b/yql/essentials/tests/sql/suites/tpch/q22.sql
new file mode 100644
index 0000000000..4b12ec51a7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q22.sql
@@ -0,0 +1,58 @@
+
+-- TPC-H/TPC-R Global Sales Opportunity Query (Q22)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$customers = (
+select
+ c_acctbal,
+ c_custkey,
+ Substring(c_phone, 0u, 2u) as cntrycode
+from
+ plato.customer
+where (Substring(c_phone, 0u, 2u) = '31' or Substring(c_phone, 0u, 2u) = '29' or Substring(c_phone, 0u, 2u) = '30' or Substring(c_phone, 0u, 2u) = '26' or Substring(c_phone, 0u, 2u) = '28' or Substring(c_phone, 0u, 2u) = '25' or Substring(c_phone, 0u, 2u) = '15')
+);
+$avg = (
+select
+ avg(c_acctbal) as a
+from
+ $customers
+where
+ c_acctbal > 0.00
+);
+$join1 = (
+select
+ c.c_acctbal as c_acctbal,
+ c.c_custkey as c_custkey,
+ c.cntrycode as cntrycode
+from
+ $customers as c
+cross join
+ $avg as a
+where
+ c.c_acctbal > a.a
+);
+$join2 = (
+select
+ j.cntrycode as cntrycode,
+ c_custkey,
+ j.c_acctbal as c_acctbal
+from
+ $join1 as j
+left only join
+ plato.orders as o
+on
+ o.o_custkey = j.c_custkey
+);
+
+select
+ cntrycode,
+ count(*) as numcust,
+ sum(c_acctbal) as totacctbal
+from
+ $join2 as custsale
+group by
+ cntrycode
+order by
+ cntrycode;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q3.sql b/yql/essentials/tests/sql/suites/tpch/q3.sql
new file mode 100644
index 0000000000..668cb9441f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q3.sql
@@ -0,0 +1,55 @@
+
+-- TPC-H/TPC-R Shipping Priority Query (Q3)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$join1 = (
+select
+ c.c_mktsegment as c_mktsegment,
+ o.o_orderdate as o_orderdate,
+ o.o_shippriority as o_shippriority,
+ o.o_orderkey as o_orderkey
+from
+ plato.customer as c
+join
+ plato.orders as o
+on
+ c.c_custkey = o.o_custkey
+);
+
+$join2 = (
+select
+ j1.c_mktsegment as c_mktsegment,
+ j1.o_orderdate as o_orderdate,
+ j1.o_shippriority as o_shippriority,
+ l.l_orderkey as l_orderkey,
+ l.l_discount as l_discount,
+ l.l_shipdate as l_shipdate,
+ l.l_extendedprice as l_extendedprice
+from
+ $join1 as j1
+join
+ plato.lineitem as l
+on
+ l.l_orderkey = j1.o_orderkey
+);
+
+select
+ l_orderkey,
+ sum(l_extendedprice * (1 - l_discount)) as revenue,
+ o_orderdate,
+ o_shippriority
+from
+ $join2
+where
+ c_mktsegment = 'MACHINERY'
+ and CAST(o_orderdate AS Timestamp) < Date('1995-03-08')
+ and CAST(l_shipdate AS Timestamp) > Date('1995-03-08')
+group by
+ l_orderkey,
+ o_orderdate,
+ o_shippriority
+order by
+ revenue desc,
+ o_orderdate
+limit 10;
diff --git a/yql/essentials/tests/sql/suites/tpch/q4.sql b/yql/essentials/tests/sql/suites/tpch/q4.sql
new file mode 100644
index 0000000000..9b02c049cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q4.sql
@@ -0,0 +1,29 @@
+
+-- TPC-H/TPC-R Order Priority Checking Query (Q4)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1994-03-01");
+
+$join = (select
+ o.o_orderpriority as o_orderpriority,
+ o.o_orderdate as o_orderdate,
+ l.l_commitdate as l_commitdate,
+ l.l_receiptdate as l_receiptdate
+ from
+ plato.orders as o
+ join any plato.lineitem as l
+ on o.o_orderkey = l.l_orderkey);
+
+select
+ o_orderpriority,
+ count(*) as order_count
+from $join
+where
+ CAST(o_orderdate AS Timestamp) >= $border
+ and CAST(o_orderdate AS Timestamp) < DateTime::MakeDate(DateTime::ShiftMonths($border, 3))
+ and l_commitdate < l_receiptdate
+group by
+ o_orderpriority
+order by
+ o_orderpriority;
diff --git a/yql/essentials/tests/sql/suites/tpch/q5.sql b/yql/essentials/tests/sql/suites/tpch/q5.sql
new file mode 100644
index 0000000000..62e7acc7d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q5.sql
@@ -0,0 +1,102 @@
+
+-- TPC-H/TPC-R Local Supplier Volume Query (Q5)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$join1 = (
+select
+ o.o_orderkey as o_orderkey,
+ o.o_orderdate as o_orderdate,
+ c.c_nationkey as c_nationkey
+from
+ plato.customer as c
+join
+ plato.orders as o
+on
+ c.c_custkey = o.o_custkey
+);
+
+$join2 = (
+select
+ j.o_orderkey as o_orderkey,
+ j.o_orderdate as o_orderdate,
+ j.c_nationkey as c_nationkey,
+ l.l_extendedprice as l_extendedprice,
+ l.l_discount as l_discount,
+ l.l_suppkey as l_suppkey
+from
+ $join1 as j
+join
+ plato.lineitem as l
+on
+ l.l_orderkey = j.o_orderkey
+);
+
+$join3 = (
+select
+ j.o_orderkey as o_orderkey,
+ j.o_orderdate as o_orderdate,
+ j.c_nationkey as c_nationkey,
+ j.l_extendedprice as l_extendedprice,
+ j.l_discount as l_discount,
+ j.l_suppkey as l_suppkey,
+ s.s_nationkey as s_nationkey
+from
+ $join2 as j
+join
+ plato.supplier as s
+on
+ j.l_suppkey = s.s_suppkey
+);
+$join4 = (
+select
+ j.o_orderkey as o_orderkey,
+ j.o_orderdate as o_orderdate,
+ j.c_nationkey as c_nationkey,
+ j.l_extendedprice as l_extendedprice,
+ j.l_discount as l_discount,
+ j.l_suppkey as l_suppkey,
+ j.s_nationkey as s_nationkey,
+ n.n_regionkey as n_regionkey,
+ n.n_name as n_name
+from
+ $join3 as j
+join
+ plato.nation as n
+on
+ j.s_nationkey = n.n_nationkey
+ and j.c_nationkey = n.n_nationkey
+);
+$join5 = (
+select
+ j.o_orderkey as o_orderkey,
+ j.o_orderdate as o_orderdate,
+ j.c_nationkey as c_nationkey,
+ j.l_extendedprice as l_extendedprice,
+ j.l_discount as l_discount,
+ j.l_suppkey as l_suppkey,
+ j.s_nationkey as s_nationkey,
+ j.n_regionkey as n_regionkey,
+ j.n_name as n_name,
+ r.r_name as r_name
+from
+ $join4 as j
+join
+ plato.region as r
+on
+ j.n_regionkey = r.r_regionkey
+);
+$border = Date("1995-01-01");
+select
+ n_name,
+ sum(l_extendedprice * (1 - l_discount)) as revenue
+from
+ $join5
+where
+ r_name = 'AFRICA'
+ and CAST(o_orderdate AS Timestamp) >= $border
+ and CAST(o_orderdate AS Timestamp) < ($border + Interval("P365D"))
+group by
+ n_name
+order by
+ revenue desc;
diff --git a/yql/essentials/tests/sql/suites/tpch/q6.sql b/yql/essentials/tests/sql/suites/tpch/q6.sql
new file mode 100644
index 0000000000..c96b8ac098
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q6.sql
@@ -0,0 +1,16 @@
+
+-- TPC-H/TPC-R Forecasting Revenue Change Query (Q6)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$border = Date("1995-01-01");
+
+select
+ sum(l_extendedprice * l_discount) as revenue
+from
+ plato.lineitem
+where
+ CAST(l_shipdate AS Timestamp) >= $border
+ and cast(l_shipdate as Timestamp) < ($border + Interval("P365D"))
+ and l_discount between 0.07 - 0.01 and 0.07 + 0.01
+ and l_quantity < 25;
diff --git a/yql/essentials/tests/sql/suites/tpch/q7.sql b/yql/essentials/tests/sql/suites/tpch/q7.sql
new file mode 100644
index 0000000000..6ff0eec4db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q7.sql
@@ -0,0 +1,87 @@
+
+-- TPC-H/TPC-R Volume Shipping Query (Q7)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$n = select n_name, n_nationkey from plato.nation as n
+ where n_name = 'PERU' or n_name = 'MOZAMBIQUE';
+
+$l = select
+ l_orderkey, l_suppkey,
+ DateTime::GetYear(cast(l_shipdate as timestamp)) as l_year,
+ l_extendedprice * (1 - l_discount) as volume
+from
+ plato.lineitem as l
+where
+ cast(cast(l.l_shipdate as Timestamp) as Date)
+ between Date('1995-01-01') and Date('1996-12-31');
+
+$j1 = select
+ n_name as supp_nation,
+ s_suppkey
+from
+ plato.supplier as supplier
+join
+ $n as n1
+on
+ supplier.s_nationkey = n1.n_nationkey;
+
+$j2 = select
+ n_name as cust_nation,
+ c_custkey
+from
+ plato.customer as customer
+join
+ $n as n2
+on
+ customer.c_nationkey = n2.n_nationkey;
+
+$j3 = select
+ cust_nation, o_orderkey
+from
+ plato.orders as orders
+join
+ $j2 as customer
+on
+ orders.o_custkey = customer.c_custkey;
+
+$j4 = select
+ cust_nation,
+ l_orderkey, l_suppkey,
+ l_year,
+ volume
+from
+ $l as lineitem
+join
+ $j3 as orders
+on
+ lineitem.l_orderkey = orders.o_orderkey;
+
+$j5 = select
+ supp_nation, cust_nation,
+ l_year, volume
+from
+ $j4 as lineitem
+join
+ $j1 as supplier
+on
+ lineitem.l_suppkey = supplier.s_suppkey
+where (supp_nation = 'PERU' and cust_nation = 'MOZAMBIQUE')
+ OR (supp_nation = 'MOZAMBIQUE' and cust_nation = 'PERU');
+
+select
+ supp_nation,
+ cust_nation,
+ l_year,
+ sum(volume) as revenue
+from
+ $j5 as shipping
+group by
+ supp_nation,
+ cust_nation,
+ l_year
+order by
+ supp_nation,
+ cust_nation,
+ l_year;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/q8.sql b/yql/essentials/tests/sql/suites/tpch/q8.sql
new file mode 100644
index 0000000000..855813a06e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q8.sql
@@ -0,0 +1,110 @@
+
+-- TPC-H/TPC-R National Market Share Query (Q8)
+-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
+-- using 1680793381 as a seed to the RNG
+
+$join1 = (
+select
+ l.l_extendedprice * (1 - l.l_discount) as volume,
+ l.l_suppkey as l_suppkey,
+ l.l_orderkey as l_orderkey
+from
+ plato.part as p
+join
+ plato.lineitem as l
+on
+ p.p_partkey = l.l_partkey
+where
+ p.p_type = 'ECONOMY PLATED COPPER'
+);
+$join2 = (
+select
+ j.volume as volume,
+ j.l_orderkey as l_orderkey,
+ s.s_nationkey as s_nationkey
+from
+ $join1 as j
+join
+ plato.supplier as s
+on
+ s.s_suppkey = j.l_suppkey
+);
+$join3 = (
+select
+ j.volume as volume,
+ j.l_orderkey as l_orderkey,
+ n.n_name as nation
+from
+ $join2 as j
+join
+ plato.nation as n
+on
+ n.n_nationkey = j.s_nationkey
+);
+$join4 = (
+select
+ j.volume as volume,
+ j.nation as nation,
+ DateTime::GetYear(cast(o.o_orderdate as Timestamp)) as o_year,
+ o.o_custkey as o_custkey
+from
+ $join3 as j
+join
+ plato.orders as o
+on
+ o.o_orderkey = j.l_orderkey
+where cast(cast(o_orderdate as Timestamp) as Date) between Date('1995-01-01') and Date('1996-12-31')
+);
+$join5 = (
+select
+ j.volume as volume,
+ j.nation as nation,
+ j.o_year as o_year,
+ c.c_nationkey as c_nationkey
+from
+ $join4 as j
+join
+ plato.customer as c
+on
+ c.c_custkey = j.o_custkey
+);
+$join6 = (
+select
+ j.volume as volume,
+ j.nation as nation,
+ j.o_year as o_year,
+ n.n_regionkey as n_regionkey
+from
+ $join5 as j
+join
+ plato.nation as n
+on
+ n.n_nationkey = j.c_nationkey
+);
+$join7 = (
+select
+ j.volume as volume,
+ j.nation as nation,
+ j.o_year as o_year
+from
+ $join6 as j
+join
+ plato.region as r
+on
+ r.r_regionkey = j.n_regionkey
+where
+ r.r_name = 'AFRICA'
+);
+
+select
+ o_year,
+ sum(case
+ when nation = 'MOZAMBIQUE' then volume
+ else 0
+ end) / sum(volume) as mkt_share
+from
+ $join7 as all_nations
+group by
+ o_year
+order by
+ o_year;
diff --git a/yql/essentials/tests/sql/suites/tpch/q9.sql b/yql/essentials/tests/sql/suites/tpch/q9.sql
new file mode 100644
index 0000000000..f6c9f914ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/q9.sql
@@ -0,0 +1,59 @@
+
+-- TPC-H/TPC-R Product Type Profit Measure Query (Q9)
+-- Approved February 1998
+-- using 1680793381 as a seed to the RNG
+
+$p = (select p_partkey, p_name
+from
+ plato.part
+where FIND(p_name, 'rose') IS NOT NULL);
+
+$j1 = (select ps_partkey, ps_suppkey, ps_supplycost
+from
+ plato.partsupp as ps
+join $p as p
+on ps.ps_partkey = p.p_partkey);
+
+$j2 = (select l_suppkey, l_partkey, l_orderkey, l_extendedprice, l_discount, ps_supplycost, l_quantity
+from
+ plato.lineitem as l
+join $j1 as j
+on l.l_suppkey = j.ps_suppkey AND l.l_partkey = j.ps_partkey);
+
+$j3 = (select l_orderkey, s_nationkey, l_extendedprice, l_discount, ps_supplycost, l_quantity
+from
+ plato.supplier as s
+join $j2 as j
+on j.l_suppkey = s.s_suppkey);
+
+$j4 = (select o_orderdate, l_extendedprice, l_discount, ps_supplycost, l_quantity, s_nationkey
+from
+ plato.orders as o
+join $j3 as j
+on o.o_orderkey = j.l_orderkey);
+
+$j5 = (select n_name, o_orderdate, l_extendedprice, l_discount, ps_supplycost, l_quantity
+from
+ plato.nation as n
+join $j4 as j
+on j.s_nationkey = n.n_nationkey
+);
+
+$profit = (select
+ n_name as nation,
+ DateTime::GetYear(cast(o_orderdate as timestamp)) as o_year,
+ l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+from $j5);
+
+select
+ nation,
+ o_year,
+ sum(amount) as sum_profit
+from $profit
+group by
+ nation,
+ o_year
+order by
+ nation,
+ o_year desc;
+
diff --git a/yql/essentials/tests/sql/suites/tpch/region.txt b/yql/essentials/tests/sql/suites/tpch/region.txt
new file mode 100644
index 0000000000..14ddd4ea7b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/region.txt
@@ -0,0 +1 @@
+{"r_regionkey"=0;"r_comment"="lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to ";"r_name"="AFRICA";};
diff --git a/yql/essentials/tests/sql/suites/tpch/region.txt.attr b/yql/essentials/tests/sql/suites/tpch/region.txt.attr
new file mode 100644
index 0000000000..daadd6b05b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/region.txt.attr
@@ -0,0 +1,26 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "r_regionkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "r_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "r_name";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/tpch/supplier.txt b/yql/essentials/tests/sql/suites/tpch/supplier.txt
new file mode 100644
index 0000000000..52c12d3c7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/supplier.txt
@@ -0,0 +1 @@
+{"s_suppkey"=1;"s_comment"="each slyly above the careful";"s_address"=" N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ";"s_acctbal"=5755.94;"s_nationkey"=17;"s_name"="Supplier#000000001";"s_phone"="27-918-335-1736";};
diff --git a/yql/essentials/tests/sql/suites/tpch/supplier.txt.attr b/yql/essentials/tests/sql/suites/tpch/supplier.txt.attr
new file mode 100644
index 0000000000..cc250b2226
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/tpch/supplier.txt.attr
@@ -0,0 +1,50 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "s_suppkey";
+ "required" = %true;
+ "sort_order" = "ascending";
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "s_comment";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "s_address";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "s_acctbal";
+ "required" = %true;
+ "type" = "double";
+ "type_v3" = "double";
+ };
+ {
+ "name" = "s_nationkey";
+ "required" = %true;
+ "type" = "int32";
+ "type_v3" = "int32";
+ };
+ {
+ "name" = "s_name";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ {
+ "name" = "s_phone";
+ "required" = %true;
+ "type" = "string";
+ "type_v3" = "string";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_literal/create_table.sql b/yql/essentials/tests/sql/suites/type_literal/create_table.sql
new file mode 100644
index 0000000000..de2d80bf98
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_literal/create_table.sql
@@ -0,0 +1,80 @@
+/* syntax version 1 */
+/* do not execute */
+
+create table plato.Output (
+ c_void Void,
+ c_unit Unit,
+ c_bool Bool,
+
+ c_uint8 Uint8,
+ c_uint16 Uint16,
+ c_uint32 Uint32 NOT NULL,
+ c_uint64 Uint64 NOT NULL,
+
+ c_int8 int8,
+ c_int16 int16,
+ c_int32 int32,
+ c_int64 int64,
+
+ c_tinyint TINYINT,
+ c_smallint SMALLINT,
+ c_int INT,
+ c_integer INTEGER,
+ c_bigint BIGINT,
+
+ c_float float,
+ c_double double,
+
+ c_string String,
+ c_varchar Varchar,
+ c_utf8 Utf8,
+ c_yson Yson,
+ c_json Json,
+ c_uuid Uuid,
+
+ c_date Date,
+ c_datetime Datetime,
+ c_timestamp Timestamp,
+ c_interval Interval,
+ c_tzdate TzDate,
+ c_tzdatetime TzDatetime,
+ c_tztimestamp TzTimestamp,
+
+ c_decimal0 Decimal(20, 10),
+
+ c_optional0 Optional<string>,
+ c_optional1 string ?,
+ c_optional2 string??,
+ c_optional3 string? ? ?,
+ c_optional4 optional<string>?,
+
+ c_tuple Tuple< bool, uint64 >,
+ c_struct Struct< foo:string, 'bar':float >,
+ c_variant1 Variant< int, bool >,
+ c_variant2 Variant< foo:int, "bar":bool >,
+
+ c_list List<Yson>,
+ c_stream Stream<Date>,
+ c_flow Flow<Uuid>,
+ c_dict Dict<string, interval>,
+ c_set Set<TzTimestamp>,
+ c_enum Enum< first, second, third >,
+
+ c_resource0 Resource<'foo'>,
+ c_resource1 Resource<bar>,
+
+ c_tagged Tagged<Uint64, 'tag'>,
+ c_generic Generic,
+
+ c_sometype0 set<list<dict<string, int??>?>>,
+
+ c_callable0 Callable<()->bool>,
+ c_callable1 Callable<(int32)->int8>,
+ c_callable2 Callable<(int32, string)->float>,
+ c_callable3 Callable<(int32, foo : string)->float>,
+ c_callable4 Callable<(foo : int32, bar : string)->float>,
+ c_callable5 Callable<([foo : int32, bar : string])->float>,
+ c_callable6 Callable<(foo : int32, [bar : string])->float>,
+ c_callable7 Callable<(foo : int32, bar : optional<string>)->float?>,
+ c_callable8 Callable<(foo : int32{automap}, bar : string{Automap})->float>
+);
diff --git a/yql/essentials/tests/sql/suites/type_literal/declare.sql b/yql/essentials/tests/sql/suites/type_literal/declare.sql
new file mode 100644
index 0000000000..4454e4d97d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_literal/declare.sql
@@ -0,0 +1,82 @@
+/* syntax version 1 */
+/* do not execute */
+
+declare $c_void as Void;
+declare $c_unit as Unit;
+declare $c_bool as Bool;
+
+declare $c_uint8 as Uint8;
+declare $c_uint16 as Uint16;
+declare $c_uint32 as Uint32;
+declare $c_uint64 as Uint64;
+
+declare $c_int8 as int8;
+declare $c_int16 as int16;
+declare $c_int32 as int32;
+declare $c_int64 as int64;
+
+declare $c_tinyint as TINYINT;
+declare $c_smallint as SMALLINT;
+declare $c_int as INT;
+declare $c_integer as INTEGER;
+declare $c_bigint as BIGINT;
+
+declare $c_float as float;
+declare $c_double as double;
+
+declare $c_string as String;
+declare $c_varchar as Varchar;
+declare $c_utf8 as Utf8;
+declare $c_yson as Yson;
+declare $c_json as Json;
+declare $c_uuid as Uuid;
+
+declare $c_date as Date;
+declare $c_datetime as Datetime;
+declare $c_timestamp as Timestamp;
+declare $c_interval as Interval;
+declare $c_tzdate as TzDate;
+declare $c_tzdatetime as TzDatetime;
+declare $c_tztimestamp as TzTimestamp;
+
+declare $c_decimal0 as Decimal(20, 10);
+
+declare $c_optional0 as Optional<string>;
+declare $c_optional1 as string ?;
+declare $c_optional2 as string??;
+declare $c_optional3 as string? ? ?;
+declare $c_optional4 as optional<string>?;
+
+declare $c_tuple as Tuple< bool, uint64 >;
+declare $c_struct as Struct< foo:string, 'bar':float >;
+declare $c_variant1 as Variant< int, bool >;
+declare $c_variant2 as Variant< foo:int, "bar":bool >;
+
+declare $c_list0 as List<Yson>;
+declare $c_list1 as List<$c_yson>;
+declare $c_stream as Stream<Date>;
+declare $c_flow as Flow<Uuid>;
+declare $c_dict as Dict<string, interval>;
+declare $c_set as Set<TzTimestamp>;
+declare $c_enum as Enum<'first', 'second', 'third'>;
+
+declare $c_resource0 as Resource<'foo'>;
+declare $c_resource1 as Resource<bar>;
+declare $resource as string;
+declare $c_resource2 as Resource<$resource>;
+
+declare $c_tagged as Tagged<Uint64, 'tag'>;
+declare $c_generic as Generic;
+
+declare $c_sometype0 as set<list<dict<string, int??>?>>;
+
+declare $c_callable0 as Callable<()->bool>;
+declare $c_callable1 as Callable<(int32)->int8>;
+declare $c_callable2 as Callable<(int32, string)->float>;
+declare $c_callable3 as Callable<(int32, foo : string)->float>;
+declare $c_callable4 as Callable<(foo : int32, bar : string)->float>;
+declare $c_callable5 as Callable<([foo : int32, bar : string])->float>;
+declare $c_callable6 as Callable<(foo : int32, [bar : string])->float>;
+declare $c_callable7 as Callable<(foo : int32, bar : optional<string>)->float>;
+declare $c_callable8 as Callable<(int32{automap}, foo : string{Automap})->float>;
+
diff --git a/yql/essentials/tests/sql/suites/type_literal/default.cfg b/yql/essentials/tests/sql/suites/type_literal/default.cfg
new file mode 100644
index 0000000000..00dec6c3f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_literal/default.cfg
@@ -0,0 +1 @@
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/type_literal/evaluate.sql b/yql/essentials/tests/sql/suites/type_literal/evaluate.sql
new file mode 100644
index 0000000000..dbec333a88
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_literal/evaluate.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+$tag1 = "ta" || "g1";
+$struct = struct< $tag1 : string, tag2 : string, "tag3" : string >;
+
+$type1 = TypeOf(10);
+
+select FormatType(list<$type1>), FormatType($struct);
+
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.cfg b/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.cfg
new file mode 100644
index 0000000000..6abe091093
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.cfg
@@ -0,0 +1,2 @@
+in Input with_datetime.txt yson1
+out Output with_datetime.txt yson1
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.sql b/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.sql
new file mode 100644
index 0000000000..c6b51727a9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_flags.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="date";
+
+insert into Output
+select key || "a" as key, subkey
+from Input
+order by key;
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.cfg b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.cfg
new file mode 100644
index 0000000000..f0f076e433
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.cfg
@@ -0,0 +1,4 @@
+in Input native.txt yson1
+out Output1 native1.txt
+out Output2 native1.txt
+out Output3 native_sorted1.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.sql b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.sql
new file mode 100644
index 0000000000..b90c123c33
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout1.sql
@@ -0,0 +1,41 @@
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="complex";
+
+$udf = YQL::@@(lambda '(x) (block '(
+ (let structType (StructType '('key (DataType 'String)) '('subkey (StructType '('a (DataType 'String)) '('b (OptionalType (DataType 'Int32))) '('c (DataType 'String))))))
+ (let varType (VariantType (TupleType structType structType structType)))
+ (let res (Map x
+ (lambda '(r)
+ (If
+ (Coalesce (> (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '200)) (Bool 'false))
+ (Variant r '0 varType)
+ (If
+ (Coalesce (< (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '50)) (Bool 'false))
+ (Variant r '1 varType)
+ (Variant r '2 varType)
+ )
+ )
+ )
+ ))
+ (return res)
+)))@@;
+
+$i, $j, $k = (PROCESS Input USING $udf(TableRows()));
+
+insert into Output1
+select *
+from $i;
+
+insert into Output2
+select *
+from $j
+limit 2;
+
+insert into Output3
+select *
+from $k
+order by key;
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.cfg b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.cfg
new file mode 100644
index 0000000000..a37f07f0b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.cfg
@@ -0,0 +1,6 @@
+in Input native_sorted.txt yson1
+out Output1 native1.txt
+out Output2 native1.txt
+out Output3 native_sorted1.txt
+providers yt
+
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.sql b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.sql
new file mode 100644
index 0000000000..fda6fde3c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_diff_layout2.sql
@@ -0,0 +1,44 @@
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="complex";
+
+$udf = YQL::@@(lambda '(x) (block '(
+ (let structType (StructType '('key (DataType 'String)) '('subkey (StructType '('a (DataType 'String)) '('b (OptionalType (DataType 'Int32))) '('c (DataType 'String))))))
+ (let varType (VariantType (TupleType structType structType structType)))
+ (let res (Map x
+ (lambda '(r)
+ (If
+ (Coalesce (> (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '200)) (Bool 'false))
+ (Variant r '0 varType)
+ (If
+ (Coalesce (< (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '50)) (Bool 'false))
+ (Variant r '1 varType)
+ (Variant r '2 varType)
+ )
+ )
+ )
+ ))
+ (return res)
+)))@@;
+
+$i, $j, $k = (PROCESS Input USING $udf(TableRows()));
+
+insert into Output1
+select *
+from $i;
+
+insert into Output2
+select *
+from $j
+limit 2;
+
+insert into Output3
+select *
+from $k;
+
+insert into Output3
+select *
+from $j;
diff --git a/yql/essentials/tests/sql/suites/type_v3/append_struct.sql b/yql/essentials/tests/sql/suites/type_v3/append_struct.sql
new file mode 100644
index 0000000000..2e58c3a9cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/append_struct.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) == 10 */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+insert into Input
+select "10" as key, <|a:"10", b:Just(10), c:"e"|> as subkey;
+
+commit;
+
+insert into Input
+select * from Input where key > "100";
+
+insert into Input
+select * from Input where key <= "100";
+
+commit;
+
+select * from Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal.txt b/yql/essentials/tests/sql/suites/type_v3/decimal.txt
new file mode 100644
index 0000000000..842034a2ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal.txt
@@ -0,0 +1,2 @@
+{"decimal-9-2"="\x80\x00\x01\x3a";"decimal-18-2"="\x80\x00\x00\x00\x00\x00\x01\x3a";"decimal-35-2"="\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x3a"};
+{"decimal-9-2"="\xFF\xFF\xFF\xFF";"decimal-18-2"="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE";"decimal-35-2"="\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"};
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal.txt.attr b/yql/essentials/tests/sql/suites/type_v3/decimal.txt.attr
new file mode 100644
index 0000000000..ecf2741d59
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal.txt.attr
@@ -0,0 +1,37 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type" = "string";
+ "required" = %true;
+ "name" = "decimal-9-2";
+ "type_v3" = {
+ "type_name" = "decimal";
+ "precision" = 9;
+ "scale" = 2
+ };
+ };
+ {
+ "type" = "string";
+ "required" = %true;
+ "name" = "decimal-18-2";
+ "type_v3" = {
+ "type_name" = "decimal";
+ "precision" = 18;
+ "scale" = 2
+ };
+ };
+ {
+ "type" = "string";
+ "required" = %true;
+ "name" = "decimal-35-2";
+ "type_v3" = {
+ "type_name" = "decimal";
+ "precision" = 35;
+ "scale" = 2
+ };
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt.cfg b/yql/essentials/tests/sql/suites/type_v3/decimal_yt.cfg
new file mode 100644
index 0000000000..de341b36d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt.sql b/yql/essentials/tests/sql/suites/type_v3/decimal_yt.sql
new file mode 100644
index 0000000000..16bf6b2d33
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt.sql
@@ -0,0 +1,8 @@
+pragma yt.UseNativeYtTypes = "true";
+insert into plato.Output with truncate
+select
+ Decimal("3.1415", 5, 4), Decimal("2.9999999999", 12, 10), Decimal("2.12345678900876543", 35, 10),
+ Decimal("nan", 5, 4), Decimal("nan", 15, 4), Decimal("nan", 35, 4),
+ Decimal("inf", 5, 4), Decimal("inf", 15, 4), Decimal("inf", 35, 4),
+ Decimal("-inf", 5, 4), Decimal("-inf", 15, 4), Decimal("-inf", 35, 4)
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.cfg b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.cfg
new file mode 100644
index 0000000000..0736d65621
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.cfg
@@ -0,0 +1 @@
+in Input decimal.txt yson1
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.sql b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.sql
new file mode 100644
index 0000000000..093c45369c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_llvm.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+
+pragma config.flags("LLVM", "");
+
+insert into @a
+select * from (
+ select Decimal("3.14",3,2) as d3, Decimal("2.9999999999",12,10) as d12, Decimal("2.12345678900876543",35,10) as d35
+ union all
+ select Decimal("inf",3,2) as d3, Decimal("inf",12,10) as d12, Decimal("inf",35,10) as d35
+ union all
+ select Decimal("-inf",3,2) as d3, Decimal("-inf",12,10) as d12, Decimal("-inf",35,10) as d35
+ union all
+ select Decimal("nan",3,2) as d3, Decimal("nan",12,10) as d12, Decimal("nan",35,10) as d35
+);
+
+commit;
+
+select * from @a where d3 != Decimal("5.3",3,2);
+
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.cfg b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.cfg
new file mode 100644
index 0000000000..0736d65621
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.cfg
@@ -0,0 +1 @@
+in Input decimal.txt yson1
diff --git a/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.sql b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.sql
new file mode 100644
index 0000000000..ee7de28816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/decimal_yt_nollvm.sql
@@ -0,0 +1,24 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+
+pragma config.flags("LLVM", "OFF");
+
+insert into @a
+select * from (
+ select Decimal("3.14",3,2) as d3, Decimal("2.9999999999",12,10) as d12, Decimal("2.12345678900876543",35,10) as d35
+ union all
+ select Decimal("inf",3,2) as d3, Decimal("inf",12,10) as d12, Decimal("inf",35,10) as d35
+ union all
+ select Decimal("-inf",3,2) as d3, Decimal("-inf",12,10) as d12, Decimal("-inf",35,10) as d35
+ union all
+ select Decimal("nan",3,2) as d3, Decimal("nan",12,10) as d12, Decimal("nan",35,10) as d35
+);
+
+commit;
+
+select * from @a where d3 != Decimal("5.3",3,2);
+
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/type_v3/default.cfg b/yql/essentials/tests/sql/suites/type_v3/default.cfg
new file mode 100644
index 0000000000..c776db379d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/default.cfg
@@ -0,0 +1 @@
+in Input native.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/float.cfg b/yql/essentials/tests/sql/suites/type_v3/float.cfg
new file mode 100644
index 0000000000..4e524d6239
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/float.cfg
@@ -0,0 +1 @@
+in Output output.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/float.sql b/yql/essentials/tests/sql/suites/type_v3/float.sql
new file mode 100644
index 0000000000..47d35cc437
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/float.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+
+insert into Output
+select * from (
+ select Float("3.14") as f
+ union all
+ select Float("1.2") as f
+);
+
+commit;
+
+select * from Output where f != Float("5.3");
diff --git a/yql/essentials/tests/sql/suites/type_v3/float.txt b/yql/essentials/tests/sql/suites/type_v3/float.txt
new file mode 100644
index 0000000000..76eccda56b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/float.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"=1.0;};
+{"key"="075";"subkey"=2.0;};
+{"key"="150";"subkey"=3.0;};
+{"key"="800";"subkey"=4.0;};
diff --git a/yql/essentials/tests/sql/suites/type_v3/float.txt.attr b/yql/essentials/tests/sql/suites/type_v3/float.txt.attr
new file mode 100644
index 0000000000..14512b014a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/float.txt.attr
@@ -0,0 +1,17 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = "float";
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-opt.cfg b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-opt.cfg
new file mode 100644
index 0000000000..5b9fbdcfe1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-opt.cfg
@@ -0,0 +1,3 @@
+in Input native_opt.txt
+udf protobuf_udf
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-protofield.cfg b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-protofield.cfg
new file mode 100644
index 0000000000..cb1a9077b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-protofield.cfg
@@ -0,0 +1,3 @@
+in Input native_proto.txt
+udf protobuf_udf
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-tag_opt.cfg b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-tag_opt.cfg
new file mode 100644
index 0000000000..895395a8e9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint-tag_opt.cfg
@@ -0,0 +1,3 @@
+in Input native_tag_opt.txt
+udf protobuf_udf
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.cfg b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.cfg
new file mode 100644
index 0000000000..4d28bce293
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.cfg
@@ -0,0 +1,2 @@
+in Input native.txt
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.sql b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.sql
new file mode 100644
index 0000000000..6026251f49
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_hint.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select
+ key,
+ Yson::LookupString(subkey, "a") as a,
+from Input with ignore_type_v3; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.cfg b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.cfg
new file mode 100644
index 0000000000..4d28bce293
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.cfg
@@ -0,0 +1,2 @@
+in Input native.txt
+udf yson2_udf
diff --git a/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.sql b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.sql
new file mode 100644
index 0000000000..9e04d09cb9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/ignore_v3_pragma.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.IgnoreTypeV3;
+
+select
+ key,
+ Yson::LookupString(subkey, "a") as a,
+from Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.cfg b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.cfg
new file mode 100644
index 0000000000..d381049510
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.cfg
@@ -0,0 +1,3 @@
+in Input1 native.txt
+in Input2 native1.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.sql b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.sql
new file mode 100644
index 0000000000..1a8440f48c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_with_native.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+/* kikimr can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+
+insert into @a with truncate
+select * from concat(Input1, Input2);
+
+commit;
+
+insert into @a with truncate
+select * from Input1;
+
+commit;
+
+insert into @a
+select * from Input2;
+
+commit;
+
+insert into @a
+select * from concat(Input1, Input2);
diff --git a/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.cfg b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.cfg
new file mode 100644
index 0000000000..d381049510
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.cfg
@@ -0,0 +1,3 @@
+in Input1 native.txt
+in Input2 native1.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.sql b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.sql
new file mode 100644
index 0000000000..f2812ad5ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/insert_struct_v3_wo_native.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+/* kikimr can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="0";
+
+insert into Output with truncate
+select * from concat(Input1, Input2);
+
+commit;
+
+insert into Output with truncate
+select * from Input1;
+
+commit;
+
+insert into Output
+select * from Input2;
+
+commit;
+
+insert into Output
+select * from concat(Input1, Input2);
diff --git a/yql/essentials/tests/sql/suites/type_v3/json.cfg b/yql/essentials/tests/sql/suites/type_v3/json.cfg
new file mode 100644
index 0000000000..4e524d6239
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/json.cfg
@@ -0,0 +1 @@
+in Output output.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/json.sql b/yql/essentials/tests/sql/suites/type_v3/json.sql
new file mode 100644
index 0000000000..33d3b27e10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/json.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+
+insert into Output
+select * from (
+ select Json(@@{"a": 4.7, "c": "abc"}@@) as j
+ union all
+ select Json(@@{"d": "fff"}@@) as j
+);
+
+commit;
+
+select * from Output where ToBytes(j) != "";
diff --git a/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.cfg b/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.cfg
new file mode 100644
index 0000000000..8bb3b795de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.cfg
@@ -0,0 +1,2 @@
+in Input1 native.txt
+in Input2 native_sorted.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.sql b/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.sql
new file mode 100644
index 0000000000..0c579ffd74
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mergejoin_with_sort.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.JoinMergeTablesLimit="100";
+pragma yt.JoinMergeForce="true";
+
+select a.key as key, a.subkey as s1, b.subkey as s2
+from Input1 as a
+join Input2 as b using(key)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/type_v3/mixed.txt b/yql/essentials/tests/sql/suites/type_v3/mixed.txt
new file mode 100644
index 0000000000..3d545ada10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mixed.txt
@@ -0,0 +1 @@
+{"dt"=19299u;"dt_yson"=19299u;"lst"=[1;2;];"lst_yson"=[1;2;];}
diff --git a/yql/essentials/tests/sql/suites/type_v3/mixed.txt.attr b/yql/essentials/tests/sql/suites/type_v3/mixed.txt.attr
new file mode 100644
index 0000000000..27e89f554e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mixed.txt.attr
@@ -0,0 +1,40 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "name" = "dt";
+ "required" = %true;
+ "type" = "date";
+ "type_v3" = "date";
+ };
+ {
+ "name" = "dt_yson";
+ "required" = %false;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "yson";
+ };
+ };
+ {
+ "name" = "lst";
+ "required" = %true;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "list";
+ "item" = "int32";
+ };
+ };
+ {
+ "name" = "lst_yson";
+ "required" = %false;
+ "type" = "any";
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = "yson";
+ };
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.cfg b/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.cfg
new file mode 100644
index 0000000000..66d8ecc478
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.cfg
@@ -0,0 +1 @@
+in Input mixed.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.sql b/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.sql
new file mode 100644
index 0000000000..1092d16c3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/mixed_with_columns.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+use plato;
+
+select dt_yson, lst_yson, dt, lst from Input
+with columns Struct<lst_yson: List<int32>?,dt_yson:Date?>; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/native.txt b/yql/essentials/tests/sql/suites/type_v3/native.txt
new file mode 100644
index 0000000000..071427ff0a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"={"b"=1;"a"="075abc";"c"="a";};};
+{"key"="800";"subkey"={"b"=2;"a"="800ddd";"c"="b";};};
+{"key"="020";"subkey"={"b"=3;"a"="020q";"c"="c";};};
+{"key"="150";"subkey"={"b"=4;"a"="150qzz";"c"="d";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native.txt.attr
new file mode 100644
index 0000000000..9ec4ef5162
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native.txt.attr
@@ -0,0 +1,36 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ ];
+ };
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native1.txt b/yql/essentials/tests/sql/suites/type_v3/native1.txt
new file mode 100644
index 0000000000..4c76da9749
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native1.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"={"b"=1;"c"="a";"a"="075abc";};};
+{"key"="800";"subkey"={"b"=2;"c"="b";"a"="800ddd";};};
+{"key"="020";"subkey"={"b"=3;"c"="c";"a"="020q";};};
+{"key"="150";"subkey"={"b"=4;"c"="d";"a"="150qzz";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native1.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native1.txt.attr
new file mode 100644
index 0000000000..69b61addb6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native1.txt.attr
@@ -0,0 +1,36 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ ];
+ };
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_opt.txt b/yql/essentials/tests/sql/suites/type_v3/native_opt.txt
new file mode 100644
index 0000000000..9f35ab7624
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_opt.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"={"b"=1;"c"="a";"a"="075abc";};};
+{"key"="800";"subkey"=#;};
+{"key"="020";"subkey"={"b"=3;"c"="c";"a"="020q";};};
+{"key"="150";"subkey"={"b"=4;"c"="d";"a"="150qzz";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_opt.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native_opt.txt.attr
new file mode 100644
index 0000000000..e6dfe29775
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_opt.txt.attr
@@ -0,0 +1,39 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "optional";
+ "item" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ ];
+ };
+ };
+ "required" = %false;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_proto.txt b/yql/essentials/tests/sql/suites/type_v3/native_proto.txt
new file mode 100644
index 0000000000..c8c833c0c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_proto.txt
@@ -0,0 +1 @@
+{"key"="\n\x10\x08\7\x12\x0C\n\ntext value";"subkey"={"b"=1;"a"="075abc";"c"="a";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_proto.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native_proto.txt.attr
new file mode 100644
index 0000000000..6d2ac56a57
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_proto.txt.attr
@@ -0,0 +1,37 @@
+{
+ "_yql_proto_field_key"="{\"name\":\"TA\",\"meta\":\"H4sIAAAAAAAAA42Puw6CQBBFszw0DEp0Y4E2GmyolriJHyAPS6rVflFMTBCUR8Hn+KcuD0ui3WRy59wzcIJ1co9yntfOM8/KLKpuTv1KnKp0rqTdWBQk5uM5SEFhKhvZNqhKmE8CPAHF5yU30QbZmqUDCvAIpONuhmA/jL30WCywXsMI+SPuGJAOn0XdGVZDFhfl6qf1VuBdPAX1zJOq46vYAOSbkhh1Kosf4I2GC/mfhb3YcOD78EoYHfACkNva6FQjLZow11rCmJ3SqoivjaPXB4Sj9wEBmoL3ogEAAA==\",\"lists\":{\"optional\":true}}";
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ ];
+ };
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt b/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt
new file mode 100644
index 0000000000..e775f178a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"={"b"=3;"a"="020q";"c"="c";};};
+{"key"="075";"subkey"={"b"=1;"a"="075abc";"c"="a";};};
+{"key"="150";"subkey"={"b"=4;"a"="150qzz";"c"="d";};};
+{"key"="800";"subkey"={"b"=2;"a"="800ddd";"c"="b";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt.attr
new file mode 100644
index 0000000000..e09d645e5e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_sorted.txt.attr
@@ -0,0 +1,37 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ "sort_order" = "ascending";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ ];
+ };
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt b/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt
new file mode 100644
index 0000000000..85672ab2f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"={"b"=3;"c"="c";"a"="020q";};};
+{"key"="075";"subkey"={"b"=1;"c"="a";"a"="075abc";};};
+{"key"="150";"subkey"={"b"=4;"c"="d";"a"="150qzz";};};
+{"key"="800";"subkey"={"b"=2;"c"="b";"a"="800ddd";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt.attr
new file mode 100644
index 0000000000..5e4d231c78
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_sorted1.txt.attr
@@ -0,0 +1,37 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ "sort_order" = "ascending";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ ];
+ };
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt b/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt
new file mode 100644
index 0000000000..9f35ab7624
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"={"b"=1;"c"="a";"a"="075abc";};};
+{"key"="800";"subkey"=#;};
+{"key"="020";"subkey"={"b"=3;"c"="c";"a"="020q";};};
+{"key"="150";"subkey"={"b"=4;"c"="d";"a"="150qzz";};};
diff --git a/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt.attr b/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt.attr
new file mode 100644
index 0000000000..d8710922f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/native_tag_opt.txt.attr
@@ -0,0 +1,43 @@
+{
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ };
+ {
+ "type_v3" = {
+ "type_name" = "tagged";
+ "tag" = "tag";
+ "item" = {
+ "type_name" = "optional";
+ "item" = {
+ "type_name" = "struct";
+ "members" = [
+ {
+ "type" = {
+ "type_name" = "optional";
+ "item" = "int32";
+ };
+ "name" = "b";
+ };
+ {
+ "type" = "string";
+ "name" = "c";
+ };
+ {
+ "type" = "string";
+ "name" = "a";
+ };
+ ];
+ };
+ };
+ };
+ "required" = %false;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/non_strict.cfg b/yql/essentials/tests/sql/suites/type_v3/non_strict.cfg
new file mode 100644
index 0000000000..b5f401ea5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/non_strict.cfg
@@ -0,0 +1,2 @@
+in Input other.txt
+in Output output.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/non_strict.sql b/yql/essentials/tests/sql/suites/type_v3/non_strict.sql
new file mode 100644
index 0000000000..d9900ca7a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/non_strict.sql
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="complex";
+
+insert into Output
+select t.*, CAST(TableRecordIndex() as UInt64) as record_idx
+from Input as t
+order by record_idx;
diff --git a/yql/essentials/tests/sql/suites/type_v3/other.txt b/yql/essentials/tests/sql/suites/type_v3/other.txt
new file mode 100644
index 0000000000..42c5393923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/other.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value1"="q"};
+{"key"="075";"subkey"="1";"value1"="abc"};
+{"key"="150";"subkey"="4";"value1"="qzz"};
+{"key"="800";"subkey"="2";"value1"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/type_v3/other.txt.attr b/yql/essentials/tests/sql/suites/type_v3/other.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/other.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.cfg b/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.cfg
new file mode 100644
index 0000000000..f88f151e72
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.cfg
@@ -0,0 +1,4 @@
+in Input native_sorted.txt yson1
+out Output1 native.txt
+out Output2 native1.txt
+out Output3 native_sorted1.txt
diff --git a/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.sql b/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.sql
new file mode 100644
index 0000000000..e3e62f71cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/replace_diff_layout.sql
@@ -0,0 +1,40 @@
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="complex";
+
+$udf = YQL::@@(lambda '(x) (block '(
+ (let structType (StructType '('key (DataType 'String)) '('subkey (StructType '('a (DataType 'String)) '('b (OptionalType (DataType 'Int32))) '('c (DataType 'String))))))
+ (let varType (VariantType (TupleType structType structType structType)))
+ (let res (Map x
+ (lambda '(r)
+ (If
+ (Coalesce (> (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '200)) (Bool 'false))
+ (Variant r '0 varType)
+ (If
+ (Coalesce (< (SafeCast (Member r 'key) (DataType 'Int32)) (Int32 '50)) (Bool 'false))
+ (Variant r '1 varType)
+ (Variant r '2 varType)
+ )
+ )
+ )
+ ))
+ (return res)
+)))@@;
+
+$i, $j, $k = (PROCESS Input USING $udf(TableRows()));
+
+insert into Output1 with (truncate, keepmeta)
+select *
+from $i;
+
+insert into Output2 with (truncate, keepmeta)
+select *
+from $j
+limit 2;
+
+insert into Output3 with (truncate, keepmeta)
+select *
+from $k;
diff --git a/yql/essentials/tests/sql/suites/type_v3/singulars.cfg b/yql/essentials/tests/sql/suites/type_v3/singulars.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/singulars.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/type_v3/singulars.sql b/yql/essentials/tests/sql/suites/type_v3/singulars.sql
new file mode 100644
index 0000000000..0f6e789c43
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/singulars.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="null;void";
+
+INSERT INTO @tmp
+SELECT null AS ttt, Yql::Void AS v
+;
+
+COMMIT;
+SELECT * FROM @tmp
diff --git a/yql/essentials/tests/sql/suites/type_v3/split.cfg b/yql/essentials/tests/sql/suites/type_v3/split.cfg
new file mode 100644
index 0000000000..356360ad58
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/split.cfg
@@ -0,0 +1,5 @@
+in Input1 float.txt
+in Input2 float.txt
+in Input3 float.txt
+in Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/type_v3/split.sql b/yql/essentials/tests/sql/suites/type_v3/split.sql
new file mode 100644
index 0000000000..97045d6e69
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/split.sql
@@ -0,0 +1,6 @@
+USE plato;
+PRAGMA yt.MaxInputTables="2";
+
+insert into Output
+select * from concat(Input1, Input2, Input3);
+
diff --git a/yql/essentials/tests/sql/suites/type_v3/type_subset.cfg b/yql/essentials/tests/sql/suites/type_v3/type_subset.cfg
new file mode 100644
index 0000000000..382a04dfda
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/type_subset.cfg
@@ -0,0 +1,6 @@
+in Input1 native.txt
+in Input2 native.txt
+in Input3 native.txt
+in Input4 native.txt
+in Output output.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/type_v3/type_subset.sql b/yql/essentials/tests/sql/suites/type_v3/type_subset.sql
new file mode 100644
index 0000000000..310fdb303b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/type_subset.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* multirun can not */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="complex";
+
+pragma yt.MaxInputTables="2";
+
+insert into Output with truncate
+select
+ key
+from range("")
+where key > "000";
diff --git a/yql/essentials/tests/sql/suites/type_v3/uuid.cfg b/yql/essentials/tests/sql/suites/type_v3/uuid.cfg
new file mode 100644
index 0000000000..9761526bb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/uuid.cfg
@@ -0,0 +1 @@
+in Output output.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/uuid.sql b/yql/essentials/tests/sql/suites/type_v3/uuid.sql
new file mode 100644
index 0000000000..56390c09c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/uuid.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+pragma yt.UseNativeYtTypes="1";
+pragma yt.NativeYtTypeCompatibility="uuid";
+
+insert into Output
+select * from (
+ select Uuid("00000000-0000-0000-0000-100000000000")
+ union all
+ select Uuid("00000000-0000-0000-0000-200000000000")
+ union all
+ select Uuid("00000000-0000-0000-0000-400000000000")
+ union all
+ select Uuid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF")
+ union all
+ select Uuid("3200ec12-4ded-4f6c-a981-4b0ff18bbdd5")
+);
+
+commit;
+
+select * from Output; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt b/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt
new file mode 100644
index 0000000000..8444bc56f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"=1612888619u;};
+{"key"="075";"subkey"=1612888619u;};
+{"key"="150";"subkey"=1612888619u;};
+{"key"="800";"subkey"=1612888619u;};
diff --git a/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt.attr b/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt.attr
new file mode 100644
index 0000000000..067d81a082
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/type_v3/with_datetime.txt.attr
@@ -0,0 +1,29 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "Datetime"]];
+ ]];
+ "UseNativeYtTypes" = %true;
+ "SortMembers" = ["key"];
+ "SortedBy" = ["key"];
+ "SortDirections" = [1];
+ "SortedByTypes" = [["DataType";"String"]];
+ };
+ "schema" = <
+ "strict" = %true;
+ "unique_keys" = %false;
+ > [
+ {
+ "type_v3" = "string";
+ "required" = %true;
+ "name" = "key";
+ "sort_order" = "ascending";
+ };
+ {
+ "type_v3" = "datetime";
+ "required" = %true;
+ "name" = "subkey";
+ };
+ ];
+}
diff --git a/yql/essentials/tests/sql/suites/udf/automap_null.cfg b/yql/essentials/tests/sql/suites/udf/automap_null.cfg
new file mode 100644
index 0000000000..9354002fbc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/automap_null.cfg
@@ -0,0 +1 @@
+udf strings_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/udf/automap_null.sql b/yql/essentials/tests/sql/suites/udf/automap_null.sql
new file mode 100644
index 0000000000..6ca93e6f09
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/automap_null.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+select String::CollapseText("abc",1);
+select String::CollapseText(Nothing(String?),1);
+select String::CollapseText(null,1);
diff --git a/yql/essentials/tests/sql/suites/udf/complex_return_type.cfg b/yql/essentials/tests/sql/suites/udf/complex_return_type.cfg
new file mode 100644
index 0000000000..8df9e9bd77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/complex_return_type.cfg
@@ -0,0 +1 @@
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/udf/complex_return_type.sql b/yql/essentials/tests/sql/suites/udf/complex_return_type.sql
new file mode 100644
index 0000000000..aaa361e1b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/complex_return_type.sql
@@ -0,0 +1 @@
+select ListSort(DictItems(SimpleUdf::ComplexReturnType("banana")));
diff --git a/yql/essentials/tests/sql/suites/udf/default.cfg b/yql/essentials/tests/sql/suites/udf/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/udf/generic_udf.cfg b/yql/essentials/tests/sql/suites/udf/generic_udf.cfg
new file mode 100644
index 0000000000..7daac60a2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/generic_udf.cfg
@@ -0,0 +1 @@
+udf type_inspection_udf
diff --git a/yql/essentials/tests/sql/suites/udf/generic_udf.sql b/yql/essentials/tests/sql/suites/udf/generic_udf.sql
new file mode 100644
index 0000000000..e5d2a1e364
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/generic_udf.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select TypeInspection::Zip(AsList("A","B","C"),AsList(1,2,3));
diff --git a/yql/essentials/tests/sql/suites/udf/input.txt b/yql/essentials/tests/sql/suites/udf/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/udf/input_tutorial_users.txt b/yql/essentials/tests/sql/suites/udf/input_tutorial_users.txt
new file mode 100644
index 0000000000..4a18a0dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/input_tutorial_users.txt
@@ -0,0 +1,12 @@
+{"key"="15";"subkey"="213";"value"="Anya"};
+{"key"="25";"subkey"="225";"value"="Petr"};
+{"key"="17";"subkey"="1";"value"="Masha"};
+{"key"="5";"subkey"="225";"value"="Alena"};
+{"key"="23";"subkey"="2";"value"="Irina"};
+{"key"="13";"subkey"="21";"value"="Inna"};
+{"key"="33";"subkey"="125";"value"="Ivan"};
+{"key"="45";"subkey"="225";"value"="Asya"};
+{"key"="27";"subkey"="125";"value"="German"};
+{"key"="41";"subkey"="225";"value"="Olya"};
+{"key"="35";"subkey"="2";"value"="Slava"};
+{"key"="56";"subkey"="2";"value"="Elena"};
diff --git a/yql/essentials/tests/sql/suites/udf/named_args.cfg b/yql/essentials/tests/sql/suites/udf/named_args.cfg
new file mode 100644
index 0000000000..8df9e9bd77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args.cfg
@@ -0,0 +1 @@
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/udf/named_args.sql b/yql/essentials/tests/sql/suites/udf/named_args.sql
new file mode 100644
index 0000000000..2aa5ea265d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+select
+ SimpleUdf::NamedArgs(0) as named_args0,
+ SimpleUdf::NamedArgs(1, 101 as D, 13 as C) as named_args1,
+ SimpleUdf::NamedArgs(1, 21 as C, 113 as D) as named_args2,
+ SimpleUdf::NamedArgs(1, 42 as C) as named_args3,
+ SimpleUdf::NamedArgs(1, 128 as D) as named_args4,
+ SimpleUdf::NamedArgs(100, 500, 404 as D, 44 as C) as named_args5,
+ SimpleUdf::NamedArgs(100, 500, 55 as C, 505 as D) as named_args6,
+ SimpleUdf::NamedArgs(100, 500, 25 as C) as named_args7,
+ SimpleUdf::NamedArgs(100, 500, 606 as D) as named_args8,
+ SimpleUdf::NamedArgs(100, 500, 64, 512 as D) as named_args9
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script.cfg b/yql/essentials/tests/sql/suites/udf/named_args_for_script.cfg
new file mode 100644
index 0000000000..f773dab653
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script.cfg
@@ -0,0 +1,3 @@
+in Input input_tutorial_users.txt
+udf python3_udf
+
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script.sql b/yql/essentials/tests/sql/suites/udf/named_args_for_script.sql
new file mode 100644
index 0000000000..523b97853a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendInfo(a_name, a_age = None, a_region = None):
+ res = a_name.decode('utf-8')
+ if a_age:
+ res += ", age: " + repr(a_age)
+ if a_region:
+ res += ", region: " + repr(a_region)
+ return res.encode('utf-8')
+@@;
+
+$udf = Python3::AppendInfo(Callable<(name:String, [age:Int32?, region:Int32?])->String>, $udfScript);
+
+$data = (select cast(key as int32) as age, cast(subkey as int32) as region, value as name from Input);
+
+select $udf(region as region, name as name) as val from $data;
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.cfg b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.sql b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.sql
new file mode 100644
index 0000000000..e393ea92d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendInfo(a_name, a_age = None, a_region = None):
+ res = a_name.decode('utf-8')
+ if a_age:
+ res += ", age: " + repr(a_age)
+ if a_region:
+ res += ", region: " + repr(a_region)
+ return res.encode('utf-8')
+@@;
+
+$udf = Python3::AppendInfo(Callable<(name:String, [age:Int32?, region:Int32?])->String>, $udfScript);
+
+$data = (select cast(key as int32) as age, cast(subkey as int32) as region, value as name from Input);
+
+select $udf(name, region as region, age as age) as val from $data;
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.cfg b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.sql b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.sql
new file mode 100644
index 0000000000..bcc8bfebaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs2.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendInfo(a_name, a_age = None, a_region = None):
+ res = a_name.decode('utf-8')
+ if a_age:
+ res += ", age: " + repr(a_age)
+ if a_region:
+ res += ", region: " + repr(a_region)
+ return res.encode('utf-8')
+@@;
+
+$udf = Python3::AppendInfo(Callable<(name:String, [age:Int32?, region:Int32?])->String>, $udfScript);
+
+$data = (select cast(key as int32) as age, cast(subkey as int32) as region, value as name from Input);
+
+select $udf(name, age, region as region) as val from $data;
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.cfg b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.cfg
new file mode 100644
index 0000000000..0311eba913
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input_tutorial_users.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.sql b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.sql
new file mode 100644
index 0000000000..21f66fa806
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_posargs_reuse_args_fail.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendInfo(a_name, a_age = None, a_region = None):
+ res = a_name.decode('utf-8')
+ if a_age:
+ res += ", age: " + repr(a_age)
+ if a_region:
+ res += ", region: " + repr(a_region)
+ return res.encode('utf-8')
+@@;
+
+$udf = Python3::AppendInfo(Callable<(name:String, [age:Int32?, region:Int32?])->String>, $udfScript);
+
+$data = (select cast(key as int32) as age, cast(subkey as int32) as region, value as name from Input);
+
+select $udf(name, age, age as age) as val from $data; -- age is reused as named after positional
diff --git a/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_wrong_order.sqlx b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_wrong_order.sqlx
new file mode 100644
index 0000000000..0f7acf017b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/named_args_for_script_with_wrong_order.sqlx
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendInfo(a_name, a_age = None, a_region = None):
+ res = a_name.decode('utf-8')
+ if a_age:
+ res += ", age: " + repr(a_age)
+ if a_region:
+ res += ", region: " + repr(a_region)
+ return res.encode('utf-8')
+@@;
+
+$udf = Python3::AppendInfo(Callable<(String, [age:Int32?, region:Int32?])->String>, $udfScript);
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+select $udf(name, region as region, age) as val from $data;
diff --git a/yql/essentials/tests/sql/suites/udf/python_script.cfg b/yql/essentials/tests/sql/suites/udf/python_script.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_script.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/python_script.py b/yql/essentials/tests/sql/suites/udf/python_script.py
new file mode 100644
index 0000000000..29f52fab0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_script.py
@@ -0,0 +1,2 @@
+def AppendNum(s, n):
+ return s + str(n).encode('utf-8')
diff --git a/yql/essentials/tests/sql/suites/udf/python_script.sql b/yql/essentials/tests/sql/suites/udf/python_script.sql
new file mode 100644
index 0000000000..cb3c5075c9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_script.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = @@
+def AppendNum(name, age):
+ return name + str(age).encode('utf-8')
+@@;
+
+$udf = Python3::AppendNum(Callable<(String, Int32?)->String>, $udfScript);
+
+select $udf(value, cast(subkey as Int32)) as val from Input;
diff --git a/yql/essentials/tests/sql/suites/udf/python_script_from_file.cfg b/yql/essentials/tests/sql/suites/udf/python_script_from_file.cfg
new file mode 100644
index 0000000000..79b7571fec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_script_from_file.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+file python_script.py python_script.py
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/udf/python_script_from_file.sql b/yql/essentials/tests/sql/suites/udf/python_script_from_file.sql
new file mode 100644
index 0000000000..259ec838aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_script_from_file.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+$udfScript = FileContent("python_script.py");
+$udf = Python::AppendNum(Callable<(String, Int32?)->String>, $udfScript);
+
+select $udf(value, cast(subkey as Int32)) as value from Input;
diff --git a/yql/essentials/tests/sql/suites/udf/python_struct.cfg b/yql/essentials/tests/sql/suites/udf/python_struct.cfg
new file mode 100644
index 0000000000..d86459a8db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_struct.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+udf python2_udf
+providers yt
diff --git a/yql/essentials/tests/sql/suites/udf/python_struct.sql b/yql/essentials/tests/sql/suites/udf/python_struct.sql
new file mode 100644
index 0000000000..ed7fc8eeb3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/python_struct.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+use plato;
+
+$udf = YQL::@@(block '(
+ (let $udfScript (String '@@@@
+class Person:
+ def __init__(self, name, age):
+ self.name = name
+ self.age = age
+
+def NewPerson(name, age):
+ return Person(name, age)
+@@@@))
+ (let ui32 (DataType 'Uint32))
+ (let str (DataType 'String))
+ (let personType (StructType '('name str) '('age ui32)))
+ (let udfType (CallableType '() '(personType) '(str) '(ui32)))
+ (let udf (ScriptUdf 'Python 'NewPerson udfType $udfScript))
+ (return udf)
+))@@;
+
+$persons = (select $udf(value, 100) as val from Input);
+select val from $persons;
diff --git a/yql/essentials/tests/sql/suites/udf/regexp_udf.cfg b/yql/essentials/tests/sql/suites/udf/regexp_udf.cfg
new file mode 100644
index 0000000000..ce7c51a32a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/regexp_udf.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/udf/regexp_udf.sql b/yql/essentials/tests/sql/suites/udf/regexp_udf.sql
new file mode 100644
index 0000000000..f3fba96738
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/regexp_udf.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+$regexp = Pire::Match("q.*");
+select * from plato.Input where $regexp(value);
diff --git a/yql/essentials/tests/sql/suites/udf/same_udf_modules.cfg b/yql/essentials/tests/sql/suites/udf/same_udf_modules.cfg
new file mode 100644
index 0000000000..e035127424
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/same_udf_modules.cfg
@@ -0,0 +1 @@
+udf re2_udf
diff --git a/yql/essentials/tests/sql/suites/udf/same_udf_modules.sql b/yql/essentials/tests/sql/suites/udf/same_udf_modules.sql
new file mode 100644
index 0000000000..9d5103074f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/same_udf_modules.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+$value = "xaaxaaxaa";
+$match = Re2::Match("[ax]+\\d");
+$grep = Re2Posix::Grep("a.*");
+$capture = Re2::Capture(".*(?P<foo>xa?)(a{2,}).*");
+$replace = Re2::Replace("x(a+)x");
+$count = Re2::Count("a");
+
+SELECT
+ $match($value) AS match,
+ $grep($value) AS grep,
+ $capture($value) AS capture,
+ $capture($value)._1 AS capture_member,
+ $replace($value, "b\\1z") AS replace,
+ $count($value) AS count;
diff --git a/yql/essentials/tests/sql/suites/udf/sqlproject_grounds.sql b/yql/essentials/tests/sql/suites/udf/sqlproject_grounds.sql
new file mode 100644
index 0000000000..2c903ee41a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/sqlproject_grounds.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$ts_bytes = String::HexDecode('0a0b0c0d');
+$ts_int = FromBytes($ts_bytes, Uint32);
+SELECT
+ $ts_int,
+ DateTime::FromSeconds($ts_int)
diff --git a/yql/essentials/tests/sql/suites/udf/trivial_udf.cfg b/yql/essentials/tests/sql/suites/udf/trivial_udf.cfg
new file mode 100644
index 0000000000..b16a0e0534
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/trivial_udf.cfg
@@ -0,0 +1 @@
+udf datetime_udf
diff --git a/yql/essentials/tests/sql/suites/udf/trivial_udf.sql b/yql/essentials/tests/sql/suites/udf/trivial_udf.sql
new file mode 100644
index 0000000000..ecc31fc71b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/trivial_udf.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT Unicode::ToUpper("foo"u);
diff --git a/yql/essentials/tests/sql/suites/udf/two_regexps.cfg b/yql/essentials/tests/sql/suites/udf/two_regexps.cfg
new file mode 100644
index 0000000000..ce7c51a32a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/two_regexps.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/udf/two_regexps.sql b/yql/essentials/tests/sql/suites/udf/two_regexps.sql
new file mode 100644
index 0000000000..23c16a81cd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/two_regexps.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+$is_abc = Pire::Match(".*abc");
+$_is_wtf = Pire::Match(".*wtf");
+
+SELECT * FROM plato.Input WHERE $is_abc(value) LIMIT 10;
diff --git a/yql/essentials/tests/sql/suites/udf/udaf.cfg b/yql/essentials/tests/sql/suites/udf/udaf.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udaf.sql b/yql/essentials/tests/sql/suites/udf/udaf.sql
new file mode 100644
index 0000000000..ea2d7fa7ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf.sql
@@ -0,0 +1,49 @@
+/* postgres can not */
+/* syntax version 1 */
+$script = @@
+import heapq
+import json
+
+N_SMALLEST = 3
+
+def create(item):
+ return [item]
+
+def add(state, item):
+ heapq.heappush(state, item)
+ return heapq.nsmallest(N_SMALLEST, state)
+
+def merge(state_a, state_b):
+ merged = heapq.merge(state_a, state_b)
+ return heapq.nsmallest(N_SMALLEST, merged)
+
+def get_result(state):
+ result = heapq.nsmallest(N_SMALLEST, state)
+ return '%d smallest items: %s' % (
+ N_SMALLEST,
+ ', '.join(map(str, result))
+ )
+
+def serialize(state):
+ return json.dumps(state)
+
+def deserialize(serialized):
+ return json.loads(serialized)
+@@;
+
+$create = Python3::create(Callable<(Double)->Resource<Python3>>, $script);
+$add = Python3::add(Callable<(Resource<Python3>,Double)->Resource<Python3>>, $script);
+$merge = Python3::merge(Callable<(Resource<Python3>,Resource<Python3>)->Resource<Python3>>, $script);
+$get_result = Python3::get_result(Callable<(Resource<Python3>)->String>, $script);
+$serialize = Python3::serialize(Callable<(Resource<Python3>)->String>, $script);
+$deserialize = Python3::deserialize(Callable<(String)->Resource<Python3>>, $script);
+
+SELECT UDAF(
+ CAST(key AS Double),
+ $create,
+ $add,
+ $merge,
+ $get_result,
+ $serialize,
+ $deserialize
+) FROM plato.Input;
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_default.sql b/yql/essentials/tests/sql/suites/udf/udaf_default.sql
new file mode 100644
index 0000000000..88182c32b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_default.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+/* syntax version 1 */
+
+$create = ($item, $_parent) -> { return AsList($item) };
+$add = ($state, $item, $_parent) -> { return Yql::Append($state, $item) };
+$merge = ($state1, $state2) -> { return ListExtend($state1,$state2) };
+$get_result = ($state) -> { return $state };
+$serialize = ($state) -> { return $state };
+$deserialize = ($state) -> { return $state };
+$default = ($result_type)->{ return Yql::List($result_type) };
+
+$udaf_factory = AGGREGATION_FACTORY(
+ "UDAF",
+ $create,
+ $add,
+ $merge,
+ $get_result,
+ $serialize,
+ $deserialize,
+ $default
+);
+
+select ListAggregate(AsList(1,2),$udaf_factory);
+select ListAggregate(ListCreate(Int32),$udaf_factory);
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_distinct.cfg b/yql/essentials/tests/sql/suites/udf/udaf_distinct.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_distinct.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_distinct.sql b/yql/essentials/tests/sql/suites/udf/udaf_distinct.sql
new file mode 100644
index 0000000000..2bde48ca55
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_distinct.sql
@@ -0,0 +1,53 @@
+/* postgres can not */
+/* syntax version 1 */
+$script = @@
+import heapq
+import json
+
+N_SMALLEST = 3
+
+def create(item):
+ return [item]
+
+def add(state, item):
+ heapq.heappush(state, item)
+ return heapq.nsmallest(N_SMALLEST, state)
+
+def merge(state_a, state_b):
+ merged = heapq.merge(state_a, state_b)
+ return heapq.nsmallest(N_SMALLEST, merged)
+
+def get_result(state):
+ result = heapq.nsmallest(N_SMALLEST, state)
+ return '%d smallest items: %s' % (
+ N_SMALLEST,
+ ', '.join(map(str, result))
+ )
+
+def serialize(state):
+ return json.dumps(state)
+
+def deserialize(serialized):
+ return json.loads(serialized)
+@@;
+
+$create = Python3::create(Callable<(Int64)->Resource<Python3>>, $script);
+$add = Python3::add(Callable<(Resource<Python3>,Int64)->Resource<Python3>>, $script);
+$merge = Python3::merge(Callable<(Resource<Python3>,Resource<Python3>)->Resource<Python3>>, $script);
+$get_result = Python3::get_result(Callable<(Resource<Python3>)->String>, $script);
+$serialize = Python3::serialize(Callable<(Resource<Python3>)->String>, $script);
+$deserialize = Python3::deserialize(Callable<(String)->Resource<Python3>>, $script);
+
+SELECT UDAF(
+ DISTINCT item,
+ $create,
+ $add,
+ $merge,
+ $get_result,
+ $serialize,
+ $deserialize
+) FROM (
+ SELECT
+ CAST(LENGTH(value) AS Int64) AS item
+ FROM plato.Input
+);
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_lambda.sql b/yql/essentials/tests/sql/suites/udf/udaf_lambda.sql
new file mode 100644
index 0000000000..9e2a4d11b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_lambda.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+$create = ($item, $_parent) -> { return $item };
+$add = ($state, $item, $_parent) -> { return $item + $state };
+$merge = ($state1, $state2) -> { return $state1 + $state2 };
+$get_result = ($state) -> { return $state };
+$serialize = ($state) -> { return $state };
+$deserialize = ($state) -> { return $state };
+
+SELECT UDAF(
+ length(key),
+ $create,
+ $add,
+ $merge,
+ $get_result,
+ $serialize,
+ $deserialize,
+ 0u
+) FROM plato.Input;
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_short.cfg b/yql/essentials/tests/sql/suites/udf/udaf_short.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_short.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udaf_short.sql b/yql/essentials/tests/sql/suites/udf/udaf_short.sql
new file mode 100644
index 0000000000..9072ffb8cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udaf_short.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+/* syntax version 1 */
+$script = @@
+def create(item):
+ return item
+
+def add(state, item):
+ return state + item
+
+def merge(state_a, state_b):
+ return state_a + state_b
+@@;
+
+$create = Python3::create(Callable<(Int64)->Int64>, $script);
+$add = Python3::add(Callable<(Int64,Int64)->Int64>, $script);
+$merge = Python3::merge(Callable<(Int64,Int64)->Int64>, $script);
+
+SELECT UDAF(
+ item,
+ $create,
+ $add,
+ $merge
+) FROM (
+ SELECT
+ CAST(LENGTH(value) AS Int64) AS item
+ FROM plato.Input
+);
diff --git a/yql/essentials/tests/sql/suites/udf/udf.cfg b/yql/essentials/tests/sql/suites/udf/udf.cfg
new file mode 100644
index 0000000000..abdcfc8271
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udf.sql b/yql/essentials/tests/sql/suites/udf/udf.sql
new file mode 100644
index 0000000000..8b6d115640
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, subkey, SimpleUdf::Concat(value, "test") as value from plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.cfg b/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.cfg
new file mode 100644
index 0000000000..abdcfc8271
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.sql b/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.sql
new file mode 100644
index 0000000000..c2285575ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_call_with_group_and_limit.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+select SimpleUdf::Echo(key) as key, count(*) as count
+ from plato.Input
+ group by key
+ order by key /* sort for stable results only */
+ limit 2; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/udf/udf_empty.cfg b/yql/essentials/tests/sql/suites/udf/udf_empty.cfg
new file mode 100644
index 0000000000..8df9e9bd77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_empty.cfg
@@ -0,0 +1 @@
+udf simple_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udf_empty.sql b/yql/essentials/tests/sql/suites/udf/udf_empty.sql
new file mode 100644
index 0000000000..645668e0c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_empty.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select SimpleUdf::ReturnNull(""), SimpleUdf::ReturnVoid(""), SimpleUdf::ReturnEmpty(""), SimpleUdf::ReturnEmpty("") is null;
diff --git a/yql/essentials/tests/sql/suites/udf/udf_result_member.cfg b/yql/essentials/tests/sql/suites/udf/udf_result_member.cfg
new file mode 100644
index 0000000000..1f757514f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_result_member.cfg
@@ -0,0 +1 @@
+udf structs_udf
diff --git a/yql/essentials/tests/sql/suites/udf/udf_result_member.sql b/yql/essentials/tests/sql/suites/udf/udf_result_member.sql
new file mode 100644
index 0000000000..58295ef434
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/udf_result_member.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+$person = Person::New("Vasya", "Pupkin", 33);
+select $person.FirstName as name, $person.Age as age;
diff --git a/yql/essentials/tests/sql/suites/udf/wrong_args_fail.cfg b/yql/essentials/tests/sql/suites/udf/wrong_args_fail.cfg
new file mode 100644
index 0000000000..f4ea431abc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/wrong_args_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+udf strings_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/udf/wrong_args_fail.sql b/yql/essentials/tests/sql/suites/udf/wrong_args_fail.sql
new file mode 100644
index 0000000000..759bfd3816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/udf/wrong_args_fail.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+
+-- Find has optional args
+select String::ReplaceAll(); -- too few
+select String::ReplaceAll("abc"); -- too few
+
+select String::ReplaceAll("abc", "b", 2, 4); -- too many
+select String::ReplaceAll("abc" , "b", 2, 4, 44); -- too many
diff --git a/yql/essentials/tests/sql/suites/union/default.cfg b/yql/essentials/tests/sql/suites/union/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/union/input.txt b/yql/essentials/tests/sql/suites/union/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/union/input2.txt b/yql/essentials/tests/sql/suites/union/input2.txt
new file mode 100644
index 0000000000..252cb6a46d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/input2.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="www"};
+{"key"="150";"subkey"="4";"value"="www"};
diff --git a/yql/essentials/tests/sql/suites/union/union_column_extention.sql b/yql/essentials/tests/sql/suites/union/union_column_extention.sql
new file mode 100644
index 0000000000..592b6ba780
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_column_extention.sql
@@ -0,0 +1,16 @@
+SELECT
+ 1 as x
+UNION
+SELECT
+ 'a' as y
+UNION
+SELECT
+ 1 as x,
+ 'a' as y
+UNION
+SELECT
+ 1 as x
+UNION
+SELECT
+ 1 as x,
+ 'b' as y;
diff --git a/yql/essentials/tests/sql/suites/union/union_mix.sql b/yql/essentials/tests/sql/suites/union/union_mix.sql
new file mode 100644
index 0000000000..74e2f9680c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_mix.sql
@@ -0,0 +1,4 @@
+SELECT 1
+UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 1 UNION ALL SELECT 2
+UNION SELECT 1
+UNION ALL SELECT 1 UNION ALL SELECT 2;
diff --git a/yql/essentials/tests/sql/suites/union/union_multiin.cfg b/yql/essentials/tests/sql/suites/union/union_multiin.cfg
new file mode 100644
index 0000000000..311e41d04b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_multiin.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input2 input2.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union/union_multiin.sql b/yql/essentials/tests/sql/suites/union/union_multiin.sql
new file mode 100644
index 0000000000..b13293562a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_multiin.sql
@@ -0,0 +1,4 @@
+SELECT * FROM plato.Input
+UNION
+SELECT * FROM plato.Input2
+ORDER BY key, subkey, value;
diff --git a/yql/essentials/tests/sql/suites/union/union_positional.sql b/yql/essentials/tests/sql/suites/union/union_positional.sql
new file mode 100644
index 0000000000..3f3a15c1a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_positional.sql
@@ -0,0 +1,9 @@
+PRAGMA PositionalUnionAll;
+
+SELECT
+ 1 as y,
+ 2 as x
+UNION
+SELECT
+ 1 as x,
+ 2 as y; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union/union_positional_mix.sql b/yql/essentials/tests/sql/suites/union/union_positional_mix.sql
new file mode 100644
index 0000000000..52302030f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_positional_mix.sql
@@ -0,0 +1,10 @@
+PRAGMA PositionalUnionAll;
+
+SELECT
+ 1 as y, 2 as x
+UNION
+SELECT
+ 1 as x, 2 as y
+UNION ALL
+SELECT
+ 1 as y, 2 as x; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union/union_trivial.sql b/yql/essentials/tests/sql/suites/union/union_trivial.sql
new file mode 100644
index 0000000000..e4112d94ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union/union_trivial.sql
@@ -0,0 +1,4 @@
+SELECT * FROM plato.Input
+UNION
+SELECT * FROM plato.Input
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/union_all/default.cfg b/yql/essentials/tests/sql/suites/union_all/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/union_all/infer_3.sql b/yql/essentials/tests/sql/suites/union_all/infer_3.sql
new file mode 100644
index 0000000000..ba01618d8a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/infer_3.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+use plato;
+
+select Just(1) as x,1 as y
+union all
+select Just(1l) as x, 2 as y
+union all
+select 3 as y;
diff --git a/yql/essentials/tests/sql/suites/union_all/inner_union_all_with_limits.sql b/yql/essentials/tests/sql/suites/union_all/inner_union_all_with_limits.sql
new file mode 100644
index 0000000000..07ec3df9ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/inner_union_all_with_limits.sql
@@ -0,0 +1,21 @@
+USE plato;
+
+SELECT
+ key,
+ value
+FROM (
+ (select * from Input limit 3)
+ union all
+ (select * from Input limit 2)
+)
+WHERE key < "100";
+
+SELECT
+ key,
+ value
+FROM (
+ (select * from Input limit 3)
+ union all
+ select * from Input
+)
+WHERE key < "200";
diff --git a/yql/essentials/tests/sql/suites/union_all/input.txt b/yql/essentials/tests/sql/suites/union_all/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/union_all/input2.txt b/yql/essentials/tests/sql/suites/union_all/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/union_all/input_infer.txt b/yql/essentials/tests/sql/suites/union_all/input_infer.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/input_infer.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/union_all/input_infer.txt.attr b/yql/essentials/tests/sql/suites/union_all/input_infer.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/input_infer.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/union_all/mix_map_and_project-trivial_map.cfg b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project-trivial_map.cfg
new file mode 100644
index 0000000000..c557142061
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project-trivial_map.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input2 input_infer.txt
diff --git a/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.cfg b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.cfg
new file mode 100644
index 0000000000..0e44b7c5ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input2 input.txt
diff --git a/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.sql b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.sql
new file mode 100644
index 0000000000..60d039f9a5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/mix_map_and_project.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* kikimr can not */
+PRAGMA yt.InferSchema;
+
+SELECT * FROM (
+ SELECT key, '' as value FROM plato.Input
+ UNION ALL
+ SELECT key, value from plato.Input2
+ UNION ALL
+ SELECT '' as key, value from plato.Input
+)
+ORDER BY key, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/mix_map_and_read.sql b/yql/essentials/tests/sql/suites/union_all/mix_map_and_read.sql
new file mode 100644
index 0000000000..43f7bcef57
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/mix_map_and_read.sql
@@ -0,0 +1,9 @@
+SELECT * FROM (
+ SELECT key, subkey, '' as value FROM plato.Input
+ UNION ALL
+ SELECT * from plato.Input
+ UNION ALL
+ SELECT '' as key, subkey, value from plato.Input
+)
+ORDER BY key, subkey, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/path_and_record.sql b/yql/essentials/tests/sql/suites/union_all/path_and_record.sql
new file mode 100644
index 0000000000..9aa42057eb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/path_and_record.sql
@@ -0,0 +1,11 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+SELECT * FROM (
+ select key, value, TablePath() as path, TableRecordIndex() as record from Input
+ union all
+ select key, value, "" as path, TableRecordIndex() as record from Input
+)
+ORDER BY key, path, record
+;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_fields.sql b/yql/essentials/tests/sql/suites/union_all/union_all_fields.sql
new file mode 100644
index 0000000000..4d313c3659
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_fields.sql
@@ -0,0 +1,7 @@
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as value FROM plato.Input
+ UNION ALL
+ SELECT 0 as key, value from plato.Input
+)
+ORDER BY key, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_incompatible.sql b/yql/essentials/tests/sql/suites/union_all/union_all_incompatible.sql
new file mode 100644
index 0000000000..b506121c94
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_incompatible.sql
@@ -0,0 +1,26 @@
+select key from
+(
+ select key, subkey from
+ (
+ select 1 as key, "foo" as subkey
+ union all
+ select 2 as key, "bar" as subkey
+ union all
+ select 3 as key, 123 as subkey
+ )
+)
+order by key;
+
+
+select key from
+(
+ select * from
+ (
+ select 4 as key, "baz" as subkey
+ union all
+ select 5 as key, "goo" as subkey
+ union all
+ select 6 as key, 456 as subkey
+ )
+)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_multiin.cfg b/yql/essentials/tests/sql/suites/union_all/union_all_multiin.cfg
new file mode 100644
index 0000000000..8d2f379d10
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_multiin.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input2 input2.txt
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_multiin.sql b/yql/essentials/tests/sql/suites/union_all/union_all_multiin.sql
new file mode 100644
index 0000000000..284528b526
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_multiin.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+SELECT * FROM (
+ SELECT key, value from Input
+ UNION ALL
+ SELECT subkey as key, value from Input2
+)
+ORDER BY key, value
+;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_multiple.sql b/yql/essentials/tests/sql/suites/union_all/union_all_multiple.sql
new file mode 100644
index 0000000000..d5fc95436f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_multiple.sql
@@ -0,0 +1,9 @@
+SELECT * FROM (
+ SELECT CAST(key AS int) as key, '' as subkey, '' as value FROM plato.Input
+ UNION ALL
+ SELECT 1 as key, subkey, '' as value from plato.Input
+ UNION ALL
+ SELECT 1 as key, '' as subkey, value from plato.Input
+)
+ORDER BY key, subkey, value
+; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_null.sql b/yql/essentials/tests/sql/suites/union_all/union_all_null.sql
new file mode 100644
index 0000000000..960390755e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_null.sql
@@ -0,0 +1,11 @@
+SELECT
+ 1/2 as jx,
+ 'a' as x,
+ NULL as jy,
+ NULL as y
+UNION ALL
+SELECT
+ NULL as jx,
+ NULL as x,
+ 2/1 as jy,
+ 'b' as y;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_subexpr.sql b/yql/essentials/tests/sql/suites/union_all/union_all_subexpr.sql
new file mode 100644
index 0000000000..9f7f840ce9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_subexpr.sql
@@ -0,0 +1,7 @@
+SELECT *
+FROM (
+ SELECT key, CAST(subkey AS int) as subkey, NULL as value FROM plato.Input
+ UNION ALL
+ SELECT key, NULL as subkey, value from plato.Input
+) as x
+ORDER BY key, subkey, value; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_trivial.sql b/yql/essentials/tests/sql/suites/union_all/union_all_trivial.sql
new file mode 100644
index 0000000000..6ba8ed0790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_trivial.sql
@@ -0,0 +1,3 @@
+SELECT * FROM plato.Input
+UNION ALL
+SELECT * FROM plato.Input; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_with_discard_into_result_ansi.sql b/yql/essentials/tests/sql/suites/union_all/union_all_with_discard_into_result_ansi.sql
new file mode 100644
index 0000000000..d3d7107e79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_with_discard_into_result_ansi.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+use plato;
+pragma AnsiOrderByLimitInUnionAll;
+
+select * from Input
+union all
+select * from Input into result aaa;
+
+discard
+select * from Input
+union all
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_with_limits.sql b/yql/essentials/tests/sql/suites/union_all/union_all_with_limits.sql
new file mode 100644
index 0000000000..ad00f72d99
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_with_limits.sql
@@ -0,0 +1,3 @@
+(SELECT * FROM plato.Input WHERE key < "100" LIMIT 2)
+UNION ALL
+(SELECT * FROM plato.Input WHERE key > "100" LIMIT 2);
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_with_parenthesis.sql b/yql/essentials/tests/sql/suites/union_all/union_all_with_parenthesis.sql
new file mode 100644
index 0000000000..b782887269
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_with_parenthesis.sql
@@ -0,0 +1,4 @@
+(SELECT * FROM plato.Input)
+UNION ALL
+(SELECT * FROM plato.Input)
+
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits.sqlx b/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits.sqlx
new file mode 100644
index 0000000000..261bf97a83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits.sqlx
@@ -0,0 +1,12 @@
+/* syntax version 1 */
+/* postgres can not */
+
+use plato;
+pragma DisableAnsiOrderByLimitInUnionAll;
+
+$foo =
+select * from Input
+union all
+select * from Input limit 2;
+
+select * from $foo order by subkey;
diff --git a/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits_ansi.sql b/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits_ansi.sql
new file mode 100644
index 0000000000..304bf54999
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/union_all/union_all_with_top_level_limits_ansi.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+
+use plato;
+pragma AnsiOrderByLimitInUnionAll;
+
+$foo =
+select * from Input
+union all
+select * from Input limit 2;
+
+$bar =
+select * from Input
+union all
+(select * from Input limit 2);
+
+
+select * from $foo order by subkey;
+select * from $bar order by subkey;
+
+select 1 as key
+union all
+select 2 as key assume order by key into result aaa;
+
+discard
+select 1 as key
+union all
+select 2 as key assume order by key;
diff --git a/yql/essentials/tests/sql/suites/version/default.cfg b/yql/essentials/tests/sql/suites/version/default.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/version/default.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/version/version.sql b/yql/essentials/tests/sql/suites/version/version.sql
new file mode 100644
index 0000000000..ee89f2b5af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/version/version.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* yt can not */
+use plato;
+
+select length(version()) > 1;
diff --git a/yql/essentials/tests/sql/suites/view/all_from_view.cfg b/yql/essentials/tests/sql/suites/view/all_from_view.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/all_from_view.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/view/all_from_view.sql b/yql/essentials/tests/sql/suites/view/all_from_view.sql
new file mode 100644
index 0000000000..9deea8173f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/all_from_view.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT * FROM plato.`Input` VIEW `key`;
diff --git a/yql/essentials/tests/sql/suites/view/default.cfg b/yql/essentials/tests/sql/suites/view/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/view/file_eval.cfg b/yql/essentials/tests/sql/suites/view/file_eval.cfg
new file mode 100644
index 0000000000..3c3eef57dc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_eval.cfg
@@ -0,0 +1,2 @@
+in Input view_file.txt
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/file_eval.sql b/yql/essentials/tests/sql/suites/view/file_eval.sql
new file mode 100644
index 0000000000..890ebdece4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_eval.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW file_eval;
diff --git a/yql/essentials/tests/sql/suites/view/file_inner.cfg b/yql/essentials/tests/sql/suites/view/file_inner.cfg
new file mode 100644
index 0000000000..6ec6d9a459
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner.cfg
@@ -0,0 +1,2 @@
+in Input view_file.txt
+http_file foo.txt foo.txt
diff --git a/yql/essentials/tests/sql/suites/view/file_inner.sql b/yql/essentials/tests/sql/suites/view/file_inner.sql
new file mode 100644
index 0000000000..fb8dd1ce41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW file_inner;
diff --git a/yql/essentials/tests/sql/suites/view/file_inner_library.cfg b/yql/essentials/tests/sql/suites/view/file_inner_library.cfg
new file mode 100644
index 0000000000..51e0aafced
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner_library.cfg
@@ -0,0 +1,2 @@
+in Input view_file_inner_library.txt
+http_file mylib.sql mylib.sql.txt
diff --git a/yql/essentials/tests/sql/suites/view/file_inner_library.sql b/yql/essentials/tests/sql/suites/view/file_inner_library.sql
new file mode 100644
index 0000000000..f81464e158
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner_library.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW file_inner_library;
diff --git a/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg b/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg
new file mode 100644
index 0000000000..9e38dc624d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg
@@ -0,0 +1,4 @@
+in Input view_file_inner_udf.txt
+http_file myfile yql/essentials/udfs/test/test_import/libtest_import_udf.so
+os linux
+providers yt
diff --git a/yql/essentials/tests/sql/suites/view/file_inner_udf.sql b/yql/essentials/tests/sql/suites/view/file_inner_udf.sql
new file mode 100644
index 0000000000..9b1a90e856
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_inner_udf.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW file_inner_udf1
+UNION ALL
+SELECT k, s, v FROM Input VIEW file_inner_udf2;
+
diff --git a/yql/essentials/tests/sql/suites/view/file_outer.cfg b/yql/essentials/tests/sql/suites/view/file_outer.cfg
new file mode 100644
index 0000000000..331e1aedcc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_outer.cfg
@@ -0,0 +1,3 @@
+in Input view_file.txt
+file foo.txt foo.txt
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/file_outer.sql b/yql/essentials/tests/sql/suites/view/file_outer.sql
new file mode 100644
index 0000000000..bc1b0a4070
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_outer.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW file_outer;
diff --git a/yql/essentials/tests/sql/suites/view/file_outer_library.cfg b/yql/essentials/tests/sql/suites/view/file_outer_library.cfg
new file mode 100644
index 0000000000..cf7d8cce56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_outer_library.cfg
@@ -0,0 +1,4 @@
+in Input view_file_outer_library.txt
+http_file mylib.sql mylib.sql.txt
+xfail
+
diff --git a/yql/essentials/tests/sql/suites/view/file_outer_library.sql b/yql/essentials/tests/sql/suites/view/file_outer_library.sql
new file mode 100644
index 0000000000..b7e7ee2ad4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/file_outer_library.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+PRAGMA library('mylib.sql');
+SELECT k, s, v FROM Input VIEW file_outer_library;
diff --git a/yql/essentials/tests/sql/suites/view/foo.txt b/yql/essentials/tests/sql/suites/view/foo.txt
new file mode 100644
index 0000000000..f3a34851d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/foo.txt
@@ -0,0 +1 @@
+text \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql b/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql
new file mode 100644
index 0000000000..3dafc5f598
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+$i = select * from Input;
+$i = process $i;
+
+$members = StructTypeComponents(ListItemType(TypeHandle(TypeOf($i))));
+$filteredMembers = ListFilter(ListMap($members, ($x) -> { return $x.Name }), ($x) -> { return $x > "k" });
+
+select ChooseMembers(TableRow(), $filteredMembers) from Input view raw;
diff --git a/yql/essentials/tests/sql/suites/view/input.txt b/yql/essentials/tests/sql/suites/view/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/view/input_lambda.txt b/yql/essentials/tests/sql/suites/view/input_lambda.txt
new file mode 100644
index 0000000000..326457a31b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/input_lambda.txt
@@ -0,0 +1 @@
+{"key"="0";"subkey"="-";"value"="zero"};
diff --git a/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr b/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr
new file mode 100644
index 0000000000..c9e8e9e38d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_lambda"="$update_key = ($key) -> ($key || '.updated'); SELECT $update_key(key) as key, subkey, value from self";
+ "_yql_view_lambda_process"="$update_row = ($row) -> (AddMember($row, 'new_value', 'NEW_VALUE')); PROCESS self USING $update_row(TableRow());";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/input_library.txt b/yql/essentials/tests/sql/suites/view/input_library.txt
new file mode 100644
index 0000000000..476d61c812
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/input_library.txt
@@ -0,0 +1 @@
+{"key"="FoO_1";"subkey"="-";"value"="zero"};
diff --git a/yql/essentials/tests/sql/suites/view/input_library.txt.attr b/yql/essentials/tests/sql/suites/view/input_library.txt.attr
new file mode 100644
index 0000000000..f053d1dea6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/input_library.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_library"="PRAGMA Library('nested_library.sql', 'http_test://nested_library.sql.txt'); import nested_library symbols $to_lower; SELECT key, subkey, value, $to_lower(key) as lower_key from self";
+ "_yql_syntax_version_library"=1;
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/mylib.sql.txt b/yql/essentials/tests/sql/suites/view/mylib.sql.txt
new file mode 100644
index 0000000000..cd551d25c7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/mylib.sql.txt
@@ -0,0 +1,2 @@
+$x = 1;
+export $x;
diff --git a/yql/essentials/tests/sql/suites/view/nested_library.sql.txt b/yql/essentials/tests/sql/suites/view/nested_library.sql.txt
new file mode 100644
index 0000000000..7a227412b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/nested_library.sql.txt
@@ -0,0 +1,10 @@
+/* unrelated lambda in v1 syntax to check that syntax version for libraries in views is correctly passed */
+$unused = ($row) -> ($row);
+
+$lambda_code = QuoteCode(($item) -> (String::AsciiToLower($item)));
+
+$to_lower = EvaluateCode(LambdaCode(($item) -> {
+ return FuncCode("Apply", $lambda_code, $item);
+}));
+
+export $to_lower;
diff --git a/yql/essentials/tests/sql/suites/view/secure.cfg b/yql/essentials/tests/sql/suites/view/secure.cfg
new file mode 100644
index 0000000000..faeeed07f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure.cfg
@@ -0,0 +1,2 @@
+in Input view_secure.txt
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/secure.sql b/yql/essentials/tests/sql/suites/view/secure.sql
new file mode 100644
index 0000000000..be73998ca2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW secure;
diff --git a/yql/essentials/tests/sql/suites/view/secure_eval.cfg b/yql/essentials/tests/sql/suites/view/secure_eval.cfg
new file mode 100644
index 0000000000..faeeed07f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure_eval.cfg
@@ -0,0 +1,2 @@
+in Input view_secure.txt
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/secure_eval.sql b/yql/essentials/tests/sql/suites/view/secure_eval.sql
new file mode 100644
index 0000000000..32f07f32df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure_eval.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW secure_eval;
diff --git a/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg
new file mode 100644
index 0000000000..faeeed07f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg
@@ -0,0 +1,2 @@
+in Input view_secure.txt
+xfail \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql
new file mode 100644
index 0000000000..44f17b18da
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW secure_eval_dynamic;
diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg
new file mode 100644
index 0000000000..b4c7e23249
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg
@@ -0,0 +1,3 @@
+in InputView standalone_view_lambda.txt
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql
new file mode 100644
index 0000000000..7edb28296d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql
@@ -0,0 +1,8 @@
+use plato;
+
+$stream = process InputView;
+$type = EvaluateType(TypeHandle(ListItemType(TypeOf($stream))));
+
+$lambda = ($row) -> (Cast($row as $type));
+
+process InputView using $lambda(TableRow());
diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt
new file mode 100644
index 0000000000..bf15038909
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt
@@ -0,0 +1,8 @@
+$concat = ($row) -> {
+ return AddMember(
+ $row, "foo",
+ $row.key || "|" || $row.subkey || "|" || $row.value
+ );
+};
+
+process `Input` using $concat(TableRow());
diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr
new file mode 100644
index 0000000000..2666763633
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr
@@ -0,0 +1,4 @@
+{
+ "_yql_type" = <syntax_version=1>"view";
+ "type" = "document";
+}
diff --git a/yql/essentials/tests/sql/suites/view/system_udf.cfg b/yql/essentials/tests/sql/suites/view/system_udf.cfg
new file mode 100644
index 0000000000..3760566137
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/system_udf.cfg
@@ -0,0 +1,2 @@
+in Input view_system_udf.txt
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/view/system_udf.sql b/yql/essentials/tests/sql/suites/view/system_udf.sql
new file mode 100644
index 0000000000..e5599aa9c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/system_udf.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+/* syntax version 1 */
+pragma yt.ViewIsolation = 'true';
+USE plato;
+SELECT k, s, v FROM Input VIEW system_udf;
diff --git a/yql/essentials/tests/sql/suites/view/trivial_view.cfg b/yql/essentials/tests/sql/suites/view/trivial_view.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/trivial_view.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/view/trivial_view.sql b/yql/essentials/tests/sql/suites/view/trivial_view.sql
new file mode 100644
index 0000000000..d126465c8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/trivial_view.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+SELECT k, s, v FROM Input VIEW ksv;
diff --git a/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg b/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg
new file mode 100644
index 0000000000..8b7633b301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg
@@ -0,0 +1 @@
+in Input view_input.txt
diff --git a/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql b/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql
new file mode 100644
index 0000000000..bad7874f6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+SELECT k, s, v FROM concat(Input view ksv, Input view ksv);
diff --git a/yql/essentials/tests/sql/suites/view/view_file.txt b/yql/essentials/tests/sql/suites/view/view_file.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_file.txt.attr b/yql/essentials/tests/sql/suites/view/view_file.txt.attr
new file mode 100644
index 0000000000..b70ac5691b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_view_file_eval"="SELECT EvaluateCode(FuncCode('FileContent', AtomCode('foo.txt'))) as k, subkey as s, value as v FROM self";
+ "_yql_view_file_outer"="SELECT FileContent('foo' || '.txt') as k, subkey as s, value as v FROM self";
+ "_yql_view_file_inner"="pragma file('foo.txt','http_test://foo.txt');SELECT FileContent('foo.txt') as k, subkey as s, value as v FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr
new file mode 100644
index 0000000000..43581a8c93
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_file_inner_library"="PRAGMA library('mylib.sql','http_test://mylib.sql');IMPORT mylib SYMBOLS $x;select $x as k, 2 as s, 3 as v";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr
new file mode 100644
index 0000000000..51babfc5e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_file_inner_udf1"="PRAGMA file('myfile','http_test://myfile');PRAGMA udf('myfile');select TestImportUdf::Concat(key,'!') as k, 2 as s, 3 as v from self";
+ "_yql_view_file_inner_udf2"="PRAGMA file('myfile','http_test://myfile');PRAGMA udf('myfile');select TestImportUdf::Concat(key,'?') as k, 2 as s, 3 as v from self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr
new file mode 100644
index 0000000000..c0e969f6f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_file_outer_library"="IMPORT mylib SYMBOLS $x;select $x as k, 2 as s, 3 as v";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_input.txt b/yql/essentials/tests/sql/suites/view/view_input.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_input.txt.attr b/yql/essentials/tests/sql/suites/view/view_input.txt.attr
new file mode 100644
index 0000000000..07386c98e5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_input.txt.attr
@@ -0,0 +1,32 @@
+{
+ "_yql_view_ksv"="SELECT key as k, subkey as s, value as v FROM self";
+ "_yql_view_key"="SELECT key FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_secure.txt b/yql/essentials/tests/sql/suites/view/view_secure.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_secure.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_secure.txt.attr b/yql/essentials/tests/sql/suites/view/view_secure.txt.attr
new file mode 100644
index 0000000000..2d8ed382fc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_secure.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_view_secure"="SELECT SecureParam('api:oauth') as k, subkey as s, value as v FROM self";
+ "_yql_view_secure_eval"="SELECT EvaluateCode(FuncCode('SecureParam', AtomCode('api:oauth'))) as k, subkey as s, value as v FROM self";
+ "_yql_view_secure_eval_dynamic"="SELECT EvaluateCode(FuncCode('S' || 'ecureParam', AtomCode('api:oauth'))) as k, subkey as s, value as v FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_system_udf.txt b/yql/essentials/tests/sql/suites/view/view_system_udf.txt
new file mode 100644
index 0000000000..df76c64125
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_system_udf.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="a7c"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="q8z"};
diff --git a/yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr b/yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr
new file mode 100644
index 0000000000..2badea2c2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr
@@ -0,0 +1,31 @@
+{
+ "_yql_view_system_udf"="SELECT String::Strip(key) as k, subkey as s, value as v FROM self";
+ "_yql_row_spec" = {
+ "Type" = [
+ "StructType";
+ [
+ [
+ "key";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "subkey";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ]
+ ]
+ ]
+ }
+}
diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg b/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg
new file mode 100644
index 0000000000..8cb4920700
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg
@@ -0,0 +1,2 @@
+in Input input_lambda.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda.sql b/yql/essentials/tests/sql/suites/view/view_with_lambda.sql
new file mode 100644
index 0000000000..c698d5c100
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_lambda.sql
@@ -0,0 +1,2 @@
+use plato;
+select * from Input view lambda;
diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg
new file mode 100644
index 0000000000..8cb4920700
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg
@@ -0,0 +1,2 @@
+in Input input_lambda.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql
new file mode 100644
index 0000000000..0db9c8b8ce
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql
@@ -0,0 +1,2 @@
+use plato;
+select * from Input view lambda_process;
diff --git a/yql/essentials/tests/sql/suites/view/view_with_library.cfg b/yql/essentials/tests/sql/suites/view/view_with_library.cfg
new file mode 100644
index 0000000000..fa1b395601
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_library.cfg
@@ -0,0 +1,3 @@
+in Input input_library.txt
+http_file nested_library.sql.txt nested_library.sql.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/view/view_with_library.sql b/yql/essentials/tests/sql/suites/view/view_with_library.sql
new file mode 100644
index 0000000000..3d10f4272f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/view/view_with_library.sql
@@ -0,0 +1,2 @@
+use plato;
+select * from Input view `library`;
diff --git a/yql/essentials/tests/sql/suites/weak_field/default.cfg b/yql/essentials/tests/sql/suites/weak_field/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.cfg b/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.cfg
new file mode 100644
index 0000000000..84859da06f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.cfg
@@ -0,0 +1,2 @@
+in Input1 infer_scheme.txt
+in Input2 input_other_yson_esc.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.sql b/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.sql
new file mode 100644
index 0000000000..321ffdf307
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/few_source_different_columns.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+PRAGMA yt.InferSchema="2";
+
+USE plato;
+
+SELECT
+ WeakField(key, "String", "funny"),
+ WeakField(subkey, "String", "bunny"),
+ WeakField(value, "String", "boom")
+FROM RANGE(``, ``, ``)
+--FROM Concat(Input1, Input2)
diff --git a/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.cfg b/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.cfg
new file mode 100644
index 0000000000..400d2341a2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.cfg
@@ -0,0 +1 @@
+in Input other1.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.sql b/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.sql
new file mode 100644
index 0000000000..74aad3d484
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/hor_join_with_mix_weak_access.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+select key, WeakField(value1, "String", "funny") as value from Input
+union all
+select key, _other["value1"] as value from Input;
diff --git a/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt b/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt
new file mode 100644
index 0000000000..ba7745c045
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt.attr b/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt.attr
new file mode 100644
index 0000000000..3c0f7e55c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/infer_scheme.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema" = %true
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/weak_field/input.txt b/yql/essentials/tests/sql/suites/weak_field/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt b/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt
new file mode 100644
index 0000000000..e447383632
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt
@@ -0,0 +1,5 @@
+{"key"="020";"subkey"="1";"binZ"="\x04" ;"strY"="\1\x08test";"realZ"="\x03\x18-DT\xfb!\t@" ;"uiData"=1u};
+{"key"="075";"subkey"="5";"binZ"="%true" ;"strY"="\1\nfunny" ;"realZ"="\x03iW\x14\x8b\n\xbf\x05@" ;"uiData"=1u};
+{"key"="150";"subkey"="4";"binZ"="\x05" ;"strY"="\1\nbunny" ;"realZ"="\x03\xcd;\x7ff\x9e\xa0\xf6?" ;"uiData"=100500u};
+{"key"="500";"subkey"="2";"binZ"="%false";"strY"="33.33" ;"realZ"="\x03\x00\x00\x00\x00\x00\x00\xf0?" ;"uiData"=#};
+{"key"="800";"subkey"="3";"binZ"="%false";"strY"="\1\x06zzz" ;"realZ"="\x03\x00\x00\x00\x00\x00\x00\xf0\xbf";"uiData"=33u};
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt.attr b/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_other_yson.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt b/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt
new file mode 100644
index 0000000000..329f198957
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"strE1"="hello\\world" ;"value"="find"};
+{"key"="075";"subkey"="5";"strE1"="\nfunny\n" };
+{"key"="150";"subkey"="4";"strE1"="\nbunny\n" ;"value"="the"};
+{"key"="333";"subkey"="9";"strE1"=# };
+{"key"="500";"subkey"="2";"strE1"="33.33" ;"value"="black"};
+{"key"="400";"subkey"="13";"strE1"="test\"funny\"esc"};
+{"key"="800";"subkey"="3";"strE1"="test\\esc" ;"value"="rabbit"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt.attr b/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_other_yson_esc.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_rest.txt b/yql/essentials/tests/sql/suites/weak_field/input_rest.txt
new file mode 100644
index 0000000000..e5828cef9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_rest.txt
@@ -0,0 +1,5 @@
+{"key"="020";"subkey"="1";"_rest"={"animal"="wombat";"size"="small";"weightMin"=20.;"weightMax"=35.;"wild"=%true};};
+{"key"="075";"subkey"="5";"_rest"={"animal"="dog";"size"="huge";"weightMin"=5.;"weightMax"=75.;"pet"=%true};};
+{"key"="150";"subkey"="4";"_rest"={"animal"="chipmunk";"size"="small";"weightMin"=0.05;"weightMax"=0.15;"wild"=%true};};
+{"key"="500";"subkey"="2";"_rest"={"animal"="hamster";"size"="verysmall";"weightMin"=0.015;"weightMax"=0.045;"pet"=%true};};
+{"key"="800";"subkey"="3";"_rest"={"animal"="dingo";"size"="huge";"weightMin"=10.;"weightMax"=20.;"wild"=%true};};
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_rest.txt.attr b/yql/essentials/tests/sql/suites/weak_field/input_rest.txt.attr
new file mode 100644
index 0000000000..68b8ac17ed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_rest.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["_rest";["DictType";["DataType";"String"];["DataType";"Yson"]]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt b/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt
new file mode 100644
index 0000000000..2faec7887d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt
@@ -0,0 +1,5 @@
+{"email"="test@email.com";"yandexuid"=999999999999999999u;};
+{"email"="test00000@email.com";"yandexuid"=999999999999999999u;};
+{"email"="test00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000@email.com";"yandexuid"=999999999999999999u;};
+{"email"="test0000000000000@email.com";"yandexuid"=999999999999999999u;};
+{"email"="test0@email.com";"yandexuid"=999999999999999999u;};
diff --git a/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt.attr b/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt.attr
new file mode 100644
index 0000000000..8f81910ca5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/input_tutorial_email_short_as_other.txt.attr
@@ -0,0 +1,12 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="uint64";"name"="yandexuid"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "yandexuid";
+ "type" = "uint64"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt
new file mode 100644
index 0000000000..cd303b9b31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt
@@ -0,0 +1,3 @@
+{"key"="023"};
+{"key"="037";"subkey"=5;"value"="ddd"};
+{"key"="075";"subkey"=1;"value"="abc"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt.attr b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt.attr
new file mode 100644
index 0000000000..ada1f836f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields.txt.attr
@@ -0,0 +1,3 @@
+{
+ "infer_schema"=%true
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.cfg b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.cfg
new file mode 100644
index 0000000000..548d8860d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.cfg
@@ -0,0 +1 @@
+in Input optimize_weak_fields.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.sql b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.sql
new file mode 100644
index 0000000000..7050c55069
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_combine.sql
@@ -0,0 +1,4 @@
+/* kikimr can not */
+pragma yt.InferSchema;
+USE plato;
+SELECT key, min(WeakField(subkey, "Int64")), max(WeakField(value, "String")) FROM Input GROUP BY key ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.cfg b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.cfg
new file mode 100644
index 0000000000..548d8860d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.cfg
@@ -0,0 +1 @@
+in Input optimize_weak_fields.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.sql b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.sql
new file mode 100644
index 0000000000..f981ba133b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_filter_combine.sql
@@ -0,0 +1,4 @@
+/* kikimr can not */
+pragma yt.InferSchema;
+USE plato;
+SELECT min(key),subkey,max(WeakField(value, "String")) FROM Input where WeakField(subkey, "Int64") > 0 group by WeakField(subkey, "Int64") as subkey order by subkey;
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.cfg b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.cfg
new file mode 100644
index 0000000000..548d8860d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.cfg
@@ -0,0 +1 @@
+in Input optimize_weak_fields.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.sql b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.sql
new file mode 100644
index 0000000000..6cbe12e979
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map.sql
@@ -0,0 +1,4 @@
+/* kikimr can not */
+pragma yt.InferSchema;
+USE plato;
+SELECT key, WeakField(subkey, "Int64"), WeakField(value, "String") FROM Input;
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.cfg b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.cfg
new file mode 100644
index 0000000000..548d8860d2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.cfg
@@ -0,0 +1 @@
+in Input optimize_weak_fields.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.sql b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.sql
new file mode 100644
index 0000000000..ec5fe0a26f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optimize_weak_fields_map_combine.sql
@@ -0,0 +1,4 @@
+/* kikimr can not */
+pragma yt.InferSchema;
+USE plato;
+SELECT min(key),subkey,max(WeakField(value, "String")) FROM Input group by WeakField(subkey, "Int64") as subkey order by subkey;
diff --git a/yql/essentials/tests/sql/suites/weak_field/optional.txt b/yql/essentials/tests/sql/suites/weak_field/optional.txt
new file mode 100644
index 0000000000..74737be93c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optional.txt
@@ -0,0 +1 @@
+{"first_num"=1u; "first_null"=#; "second_num"=[1u]; "second_null"=[]; "third_num"=[[1u]]; "third_null"=[#]};
diff --git a/yql/essentials/tests/sql/suites/weak_field/optional.txt.attr b/yql/essentials/tests/sql/suites/weak_field/optional.txt.attr
new file mode 100644
index 0000000000..7962199d3e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/optional.txt.attr
@@ -0,0 +1,85 @@
+{
+ "_yql_row_spec" = {"Type" = [
+ "StructType";
+ [
+ [
+ "first_null";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ];
+ [
+ "first_num";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ];
+ [
+ "second_null";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ];
+ [
+ "second_num";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ];
+ [
+ "third_null";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ]
+ ];
+ [
+ "third_num";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "OptionalType";
+ [
+ "DataType";
+ "Uint32"
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]};
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/other1.txt b/yql/essentials/tests/sql/suites/weak_field/other1.txt
new file mode 100644
index 0000000000..42c5393923
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other1.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value1"="q"};
+{"key"="075";"subkey"="1";"value1"="abc"};
+{"key"="150";"subkey"="4";"value1"="qzz"};
+{"key"="800";"subkey"="2";"value1"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/other1.txt.attr b/yql/essentials/tests/sql/suites/weak_field/other1.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other1.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/other2.txt b/yql/essentials/tests/sql/suites/weak_field/other2.txt
new file mode 100644
index 0000000000..1fa10bf270
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other2.txt
@@ -0,0 +1,4 @@
+{"key"="020";"subkey"="3";"value2"="q"};
+{"key"="075";"subkey"="1";"value2"="abc"};
+{"key"="150";"subkey"="4";"value2"="qzz"};
+{"key"="800";"subkey"="2";"value2"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/other2.txt.attr b/yql/essentials/tests/sql/suites/weak_field/other2.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other2.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/other3.txt b/yql/essentials/tests/sql/suites/weak_field/other3.txt
new file mode 100644
index 0000000000..d5302f1f4a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other3.txt
@@ -0,0 +1,5 @@
+{"key"="020";"subkey"="1";"data3"=33;datahole3=3};
+{"key"="075";"subkey"="5";"data3"=100500;datahole3=1};
+{"key"="150";"subkey"="4";"data3"=123;datahole3=#};
+{"key"="500";"subkey"="2";"data3"=42;datahole3=2};
+{"key"="800";"subkey"="3";"data3"=321;datahole3=#};
diff --git a/yql/essentials/tests/sql/suites/weak_field/other3.txt.attr b/yql/essentials/tests/sql/suites/weak_field/other3.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other3.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/other4.txt b/yql/essentials/tests/sql/suites/weak_field/other4.txt
new file mode 100644
index 0000000000..7b4b7c469d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other4.txt
@@ -0,0 +1,5 @@
+{"key"="020";"subkey"="1";"data3"=33;datahole3=3u};
+{"key"="075";"subkey"="5";"data3"=100500;datahole3=1u};
+{"key"="150";"subkey"="4";"data3"=123;datahole3=#};
+{"key"="500";"subkey"="2";"data3"=42;datahole3=2u};
+{"key"="800";"subkey"="3";"data3"=321;datahole3=#};
diff --git a/yql/essentials/tests/sql/suites/weak_field/other4.txt.attr b/yql/essentials/tests/sql/suites/weak_field/other4.txt.attr
new file mode 100644
index 0000000000..49d98771a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/other4.txt.attr
@@ -0,0 +1,17 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field.cfg
new file mode 100644
index 0000000000..1410268275
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field.cfg
@@ -0,0 +1,2 @@
+in Input1 other1.txt
+in Input2 other2.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field.sql
new file mode 100644
index 0000000000..96e155080d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+use plato;
+select "input1-value1" as src, key, WeakField(value1, "String", "funny") as ozer from Input1
+union all
+select "input2-value1" as src, key, WeakField(value1, "String", "funny") as ozer from Input2
+union all
+select "input1-value2" as src, key, WeakField(value2, "String") as ozer from Input1
+union all
+select "input2-value2" as src, key, WeakField(value2, "String") as ozer from Input2
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.cfg
new file mode 100644
index 0000000000..b41a784aca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.cfg
@@ -0,0 +1 @@
+in Input4 other4.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.sql
new file mode 100644
index 0000000000..904f01470d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_aggregation.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ odd,
+ sum(WeakField(data3, "int32") + WeakField(datahole3, "uint32", 999)) as score
+FROM Input4
+GROUP BY cast(subkey as uint32) % 2 as odd
+ORDER BY odd, score
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_data.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_data.cfg
new file mode 100644
index 0000000000..2c8cfa4101
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_data.cfg
@@ -0,0 +1 @@
+in Input3 other3.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_data.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_data.sql
new file mode 100644
index 0000000000..e3d3002084
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_data.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+use plato;
+select subkey, WeakField(data1, "Int32", 32) as d1, WeakField(data3, "Int32", 32) as d3 from Input3 order by subkey
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.cfg
new file mode 100644
index 0000000000..ec92471037
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.cfg
@@ -0,0 +1 @@
+in Input input_other_yson_esc.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.sql
new file mode 100644
index 0000000000..9c394f9ca9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_string.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT WeakField(subkey, 'string'), WeakField(strE1, 'string')
+FROM Input
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.cfg
new file mode 100644
index 0000000000..ec92471037
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.cfg
@@ -0,0 +1 @@
+in Input input_other_yson_esc.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.sql
new file mode 100644
index 0000000000..28482d250f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_esc_yson.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ Cast(WeakField(subkey, 'string') as uint32) as subkey,
+ WeakField(strE1, 'string'),
+ YQL::FromYsonSimpleType(WeakField(strE1, "Yson"), AsAtom("String")) AS strE1overYson
+FROM Input
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.cfg
new file mode 100644
index 0000000000..b1dd7b3cd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.cfg
@@ -0,0 +1 @@
+in Input input_other_yson.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.sql
new file mode 100644
index 0000000000..a1bf197bb5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_in_group_by.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ sk,
+ count(*) as count
+FROM Input
+GROUP BY WeakField(uiData, 'uint64') as sk
+ORDER BY sk \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.cfg
new file mode 100644
index 0000000000..4895b73f21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.cfg
@@ -0,0 +1 @@
+in Input infer_scheme.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.sql
new file mode 100644
index 0000000000..a403fed293
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_infer_scheme.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* kikimr can not */
+USE plato;
+pragma yt.InferSchema;
+
+SELECT key, subkey, WeakField(value, "String") as value FROM Input;
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_join.cfg
new file mode 100644
index 0000000000..1410268275
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join.cfg
@@ -0,0 +1,2 @@
+in Input1 other1.txt
+in Input2 other2.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_join.sql
new file mode 100644
index 0000000000..dd834f50a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+SELECT
+ i1.subkey as sk,
+ WeakField(i1.value1, "String", "funny") as i1v1,
+ WeakField(i1.value2, "String", "bunny") as i1v2,
+ WeakField(i2.value1, "String", "short") as i2v1,
+ WeakField(i2.value2, "String", "circuit") as i2v2
+FROM Input1 as i1 join Input2 as i2 USING(subkey) ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.cfg
new file mode 100644
index 0000000000..1410268275
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.cfg
@@ -0,0 +1,2 @@
+in Input1 other1.txt
+in Input2 other2.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.sql
new file mode 100644
index 0000000000..7818c68f11
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_condition.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ i1.subkey as sk,
+ WeakField(i1.value1, "String", "funny") as i1v1,
+ WeakField(i1.value2, "String", "bunny") as i1v2,
+ WeakField(i2.value1, "String", "short") as i2v1,
+ WeakField(i2.value2, "String", "circuit") as i2v2
+FROM Input1 as i1 JOIN Input2 as i2 ON WeakField(i1.value1, "String") == WeakField(i2.value2, "String") ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join_no_src.sqlx b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_no_src.sqlx
new file mode 100644
index 0000000000..1781a93f66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_no_src.sqlx
@@ -0,0 +1,8 @@
+/* postgres can not */
+use plato;
+
+SELECT
+ i1.subkey as sk,
+ WeakField(value1, "String", "funny") as v1, -- no idea to check value1 from i1._other or i2._other
+ WeakField(value2, "String", "bunny") as v2
+FROM Input1 as i1 join Input2 as i2 USING(subkey) ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.cfg
new file mode 100644
index 0000000000..1410268275
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.cfg
@@ -0,0 +1,2 @@
+in Input1 other1.txt
+in Input2 other2.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.sql
new file mode 100644
index 0000000000..0807940069
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_join_where.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ i1.subkey as sk,
+ WeakField(i1.value1, "String", "funny") as i1v1,
+ WeakField(i1.value2, "String", "bunny") as i1v2,
+ WeakField(i2.value1, "String", "short") as i2v1,
+ WeakField(i2.value2, "String", "circuit") as i2v2
+FROM Input1 as i1 JOIN Input2 as i2 ON WeakField(i1.value1, "String") == WeakField(i2.value2, "String")
+WHERE WeakField(i2.key, "String") == "150" or WeakField(i1.key, "String") == "075"
+ORDER BY sk
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_list_type.sqlx b/yql/essentials/tests/sql/suites/weak_field/weak_field_list_type.sqlx
new file mode 100644
index 0000000000..569608e549
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_list_type.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+use plato;
+select WeakField(value1, "List<Int32>", "epic type!") as ll_i32 from Input1
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.cfg
new file mode 100644
index 0000000000..11c3f04b25
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_email_short_as_other.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.sql
new file mode 100644
index 0000000000..81cc5bacd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_fields.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ WeakField(email, "String"),
+ WeakField(yandexuid, "Uint64")
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.cfg
new file mode 100644
index 0000000000..e85c3febf4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.cfg
@@ -0,0 +1 @@
+in Input other1.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.sql
new file mode 100644
index 0000000000..ab439e9cc9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_long_name.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ WeakField(long_long_long_column_name, 'string')
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.cfg
new file mode 100644
index 0000000000..b41a784aca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.cfg
@@ -0,0 +1 @@
+in Input4 other4.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.sql
new file mode 100644
index 0000000000..eb6365bff3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_num_access.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ subkey,
+ WeakField(data3, "int32") as data3,
+ WeakField(datahole3, "uint32", 999) as holes3
+FROM Input4
+ORDER BY subkey
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.cfg
new file mode 100644
index 0000000000..2c8cfa4101
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.cfg
@@ -0,0 +1 @@
+in Input3 other3.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.sql
new file mode 100644
index 0000000000..8f66299362
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_opt.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+use plato;
+select subkey, WeakField(data3, "int32") as data3str, WeakField(datahole3, "int32", 999) as holes3 from Input3 order by subkey
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_real_col.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_real_col.sql
new file mode 100644
index 0000000000..3249bbc634
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_real_col.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ WeakField(key, "String", 'test'),
+ WeakField(balu, "String", 'bebe'),
+ WeakField(value, "String", 'zzz')
+FROM Input
+WHERE key < "200"
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.cfg
new file mode 100644
index 0000000000..2c0d92202d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.cfg
@@ -0,0 +1 @@
+in Input input_rest.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.sql
new file mode 100644
index 0000000000..a330421f3f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_rest.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ WeakField(animal, "String"),
+ WeakField(size, "String") as sizeRating,
+ WeakField(weightMin, "Float"),
+ WeakField(weightMax, "Float"),
+ WeakField(wild, "Bool"),
+ WeakField(pet, "Bool", false),
+ WeakField(miss, "Bool", true)
+FROM Input
+ORDER BY weightMin
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.cfg
new file mode 100644
index 0000000000..64b3f61710
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.cfg
@@ -0,0 +1 @@
+in Input optional.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.sql
new file mode 100644
index 0000000000..e156940290
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_strict.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+SELECT
+ WeakField(first_num, "uint32") as num_nodef,
+ WeakField(first_num, "uint32", 11) as num_def,
+ WeakField(first_null, "uint32") as null_nodef,
+ WeakField(first_null, "uint32", 42) as null_def,
+ WeakField(val, "string") as missed_nodef,
+ WeakField(val, "string", "no value") as missed_def
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.cfg
new file mode 100644
index 0000000000..b1dd7b3cd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.cfg
@@ -0,0 +1 @@
+in Input input_other_yson.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.sql
new file mode 100644
index 0000000000..bc00acf465
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_to_yson.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+SELECT
+ YQL::FromYsonSimpleType(WeakField(uiData, "Yson"), AsAtom("Uint32")) AS val
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_type.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_type.sql
new file mode 100644
index 0000000000..0411ee0b98
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_type.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+select
+ WeakField(key, DataType("String")),
+ WeakField(subkey, OptionalType(DataType("String"))),
+ WeakField(value, "String")
+from Input;
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.cfg b/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.cfg
new file mode 100644
index 0000000000..faca17b0b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+in Input optional.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.sql b/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.sql
new file mode 100644
index 0000000000..0d8cf87a35
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_field_wrong_types_fail.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+use plato;
+SELECT
+ WeakField(first_num, "int32", 42) -- first_num column have another type
+FROM Input
diff --git a/yql/essentials/tests/sql/suites/weak_field/weak_member_string_copy.sql b/yql/essentials/tests/sql/suites/weak_field/weak_member_string_copy.sql
new file mode 100644
index 0000000000..1a19c1cc51
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/weak_member_string_copy.sql
@@ -0,0 +1,3 @@
+/* postgres can not */
+$d = AsDict(AsTuple("fld","РоÑÑиÑ, Санкт-Петербург, ПетроградÑÐºÐ°Ñ Ð½Ð°Ð±ÐµÑ€ÐµÐ¶Ð½Ð°Ñ, 2-4"),AsTuple("_yql_fld",""));
+select Yql::TryWeakMemberFromDict(Just($d), NULL, AsAtom("String"), AsAtom("fld"));
diff --git a/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt b/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt.attr b/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt.attr
new file mode 100644
index 0000000000..5976cdb9c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/yql-7888_input.txt.attr
@@ -0,0 +1,22 @@
+{
+ "_read_schema" = <"strict" = %false>[
+ {"type"="string";"name"="key"};
+ {"type"="string";"name"="subkey"};
+ {"type"="string";"name"="value"};
+ ];
+ "schema" = <"strict" = %false; "unique_keys" = %false>
+ [
+ {
+ "name" = "key";
+ "type" = "string"
+ };
+ {
+ "name" = "subkey";
+ "type" = "string"
+ };
+ {
+ "name" = "value";
+ "type" = "string"
+ }
+ ]
+}
diff --git a/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.cfg b/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.cfg
new file mode 100644
index 0000000000..b4421ba5f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.cfg
@@ -0,0 +1 @@
+in Input yql-7888_input.txt
diff --git a/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.sql b/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.sql
new file mode 100644
index 0000000000..34b7271562
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/weak_field/yql-7888_mapfieldsubset.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+define subquery $input() as
+ select
+ value,
+ WeakField(strongest_id, "String") as strongest_id,
+ WeakField(video_position_sec, "String") as video_position_sec,
+ key,
+ subkey
+ from concat(Input, Input)
+ where key in ("heartbeat", "show", "click")
+ and subkey in ("native", "gif");
+end define;
+
+-- Native:
+define subquery $native_show_and_clicks($input) as
+ select
+ value, strongest_id, key
+ from $input()
+ where subkey == "native"
+ and key in ("click", "show");
+end define;
+
+select count(distinct strongest_id) as native_users from $native_show_and_clicks($input);
+select count(distinct strongest_id) as native_users_with_click from $native_show_and_clicks($input) where key == "click"; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/window/agg_factory.sql.txt b/yql/essentials/tests/sql/suites/window/agg_factory.sql.txt
new file mode 100644
index 0000000000..6842b1818c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/agg_factory.sql.txt
@@ -0,0 +1,3 @@
+$factory = AGGREGATION_FACTORY('COUNT');
+
+export $factory;
diff --git a/yql/essentials/tests/sql/suites/window/all_columns_hide_window_special_ones.sql b/yql/essentials/tests/sql/suites/window/all_columns_hide_window_special_ones.sql
new file mode 100644
index 0000000000..b9b356c939
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/all_columns_hide_window_special_ones.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+pragma simplecolumns;
+
+select
+a.*,
+(ROW_NUMBER() over w) - 1 as position_cnt,
+lag(key) over w as pkey,
+lead(key) over w as nkey
+from Input as a
+window w as (
+ order by value desc
+)
+order by position_cnt;
diff --git a/yql/essentials/tests/sql/suites/window/current/aggregations.cfg b/yql/essentials/tests/sql/suites/window/current/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/aggregations.sql b/yql/essentials/tests/sql/suites/window/current/aggregations.sql
new file mode 100644
index 0000000000..444ea196cc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/aggregations.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM plato.Input
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value),
+ w2 as ( ORDER BY value)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.cfg b/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.sql b/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.sql
new file mode 100644
index 0000000000..c73f26cb67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/aggregations_leadlag.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM plato.Input
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value),
+ w2 as ( ORDER BY value)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current.cfg b/yql/essentials/tests/sql/suites/window/current/ansi_current.cfg
new file mode 100644
index 0000000000..812be3893b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current.cfg
@@ -0,0 +1 @@
+in Input input4.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current.sql b/yql/essentials/tests/sql/suites/window/current/ansi_current.sql
new file mode 100644
index 0000000000..d005c57dc2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma AnsiCurrentRow;
+
+SELECT
+ value,
+ key,
+ subkey,
+ SUM(cast(subkey as Int32)) over w as subkey_sum,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY value
+ ORDER BY key
+)
+ORDER BY value, key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.cfg b/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.cfg
new file mode 100644
index 0000000000..812be3893b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.cfg
@@ -0,0 +1 @@
+in Input input4.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.sql b/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.sql
new file mode 100644
index 0000000000..b89caf963f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current_mixed.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma AnsiCurrentRow;
+
+SELECT
+ value,
+ key,
+ subkey,
+ SUM(cast(subkey as Int32)) over w as subkey_sum_ansi,
+ SUM(cast(subkey as Int32)) over w1 as subkey_sum,
+ SUM(cast(subkey as Int32)) over w2 as subkey_sum_next,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY value
+ ORDER BY key
+), w1 AS (
+ PARTITION BY value
+ ORDER BY key
+ ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+), w2 AS (
+ PARTITION BY value
+ ORDER BY key
+ ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING
+)
+ORDER BY value, key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.cfg b/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.cfg
new file mode 100644
index 0000000000..812be3893b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.cfg
@@ -0,0 +1 @@
+in Input input4.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.sql b/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.sql
new file mode 100644
index 0000000000..8baa348440
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/ansi_current_with_win.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma AnsiCurrentRow;
+
+SELECT
+ value,
+ key,
+ subkey,
+ SUM(cast(subkey as Int32)) over w as subkey_sum_ansi,
+ LEAD(cast(subkey as Int32)) over w as subkey_next,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY value
+ ORDER BY key
+)
+ORDER BY value, key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/current/session.cfg b/yql/essentials/tests/sql/suites/window/current/session.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/session.sql b/yql/essentials/tests/sql/suites/window/current/session.sql
new file mode 100644
index 0000000000..10ae2c44d3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ payload,
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts, 10)
+ ORDER BY ts
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/current/session_aliases.cfg b/yql/essentials/tests/sql/suites/window/current/session_aliases.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_aliases.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/session_aliases.sql b/yql/essentials/tests/sql/suites/window/current/session_aliases.sql
new file mode 100644
index 0000000000..9aa080e22c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_aliases.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ SessionStart() over w1 as ss1,
+ SessionStart() over w as ss,
+
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts, 10) as ss0
+ ORDER BY ts
+),
+w1 AS (
+ PARTITION BY SessionWindow(ts, 10), user
+ ORDER BY ts
+)
+ORDER BY user, ts, session_len;
diff --git a/yql/essentials/tests/sql/suites/window/current/session_extended.cfg b/yql/essentials/tests/sql/suites/window/current/session_extended.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_extended.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/session_extended.sql b/yql/essentials/tests/sql/suites/window/current/session_extended.sql
new file mode 100644
index 0000000000..5990b4ec12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_extended.sql
@@ -0,0 +1,29 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$init = ($row) -> (AsStruct($row.ts ?? 0 as value, 1 as count));
+
+$calculate = ($_row, $state) -> ($state.value);
+-- split partition into two-element grooups, make session key to be cumulative sum of ts from partition start
+$update = ($row, $state) -> {
+ $state = AsStruct($state.count + 1 as count, $state.value as value);
+ $state = AsStruct($state.count as count, $state.value + ($row.ts ?? 0) as value);
+ return AsTuple(Unwrap($state.count % 2) == 1, $state);
+};
+
+
+SELECT
+ user,
+ ts,
+ payload,
+ AGGREGATE_LIST(cast(ts as string) ?? "null") over w as ts_session,
+ COUNT(1) over w as session_len,
+ SessionStart() over w as session_start,
+ SessionState() over w as session_state,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts + 1, $init, $update, $calculate)
+ ORDER BY ts
+)
+ORDER BY user, payload;
+
diff --git a/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.cfg b/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.sql b/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.sql
new file mode 100644
index 0000000000..81efa941a6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/current/session_incompat_sort.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ payload,
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+ SessionStart() over w as session_start,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY SessionWindow(ts, 10), user
+ ORDER BY payload
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/default.cfg b/yql/essentials/tests/sql/suites/window/default.cfg
new file mode 100644
index 0000000000..0b7e11f3c5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/window/distinct_over_window.cfg b/yql/essentials/tests/sql/suites/window/distinct_over_window.cfg
new file mode 100644
index 0000000000..ed883e79be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/distinct_over_window.cfg
@@ -0,0 +1 @@
+in Input input3.txt
diff --git a/yql/essentials/tests/sql/suites/window/distinct_over_window.sql b/yql/essentials/tests/sql/suites/window/distinct_over_window.sql
new file mode 100644
index 0000000000..536db81911
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/distinct_over_window.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+PRAGMA DistinctOverWindow;
+
+$input = (SELECT cast(key AS Int32) AS key, cast(subkey AS Int32) AS subkey, value FROM Input);
+
+SELECT
+ subkey,
+ key,
+ value,
+ -- assuming ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+ count(DISTINCT key) OVER (PARTITION BY subkey ORDER BY key) AS count_by_key,
+ count(DISTINCT value || "force_preagg") OVER (PARTITION BY subkey ORDER BY key) AS count_by_value,
+ sum(DISTINCT key) OVER (PARTITION BY subkey ORDER BY key) AS sum,
+ median(DISTINCT key) OVER (PARTITION BY subkey ORDER BY key) AS median,
+FROM $input
+ORDER BY subkey, key, value;
diff --git a/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.cfg b/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.cfg
new file mode 100644
index 0000000000..ed883e79be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.cfg
@@ -0,0 +1 @@
+in Input input3.txt
diff --git a/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.sql b/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.sql
new file mode 100644
index 0000000000..973a23db8c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/distinct_over_window_full_frames.sql
@@ -0,0 +1,22 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+PRAGMA DistinctOverWindow;
+
+$input = (SELECT cast(key AS Int32) AS key, cast(subkey AS Int32) AS subkey, value FROM Input);
+
+SELECT
+ subkey,
+ key,
+ value,
+ -- assuming ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+ count(DISTINCT key) OVER () AS cnt_distinct_total,
+ sum(DISTINCT key) OVER () AS sum_distinct_total,
+ median(DISTINCT key) OVER () AS median_distinct_total,
+ count(DISTINCT key) OVER (PARTITION BY subkey) AS cnt_distinct_part,
+ sum(DISTINCT key) OVER (PARTITION BY subkey) AS sum_distinct_part,
+ median(DISTINCT key) OVER (PARTITION BY subkey) AS median_distinct_part,
+FROM $input
+ORDER BY subkey, key, value;
diff --git a/yql/essentials/tests/sql/suites/window/distinct_over_window_struct.sql b/yql/essentials/tests/sql/suites/window/distinct_over_window_struct.sql
new file mode 100644
index 0000000000..57e76a0935
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/distinct_over_window_struct.sql
@@ -0,0 +1,37 @@
+/* syntax version 1 */
+/* postgres can not */
+
+USE plato;
+
+PRAGMA DistinctOverWindow;
+
+$input = AsList(
+ AsStruct(1 AS key, 1 AS subkey, AsStruct(1 AS i1, 2 AS i2, 3 AS i3) AS col),
+ AsStruct(2 AS key, 1 AS subkey, AsStruct(1 AS i1, 2 AS i2, 3 AS i3) AS col),
+ AsStruct(3 AS key, 1 AS subkey, AsStruct(1 AS i1, 2 AS i2, 3 AS i3) AS col),
+ AsStruct(4 AS key, 2 AS subkey, AsStruct(3 AS i1, 4 AS i2, 5 AS i3) AS col),
+ AsStruct(5 AS key, 2 AS subkey, AsStruct(3 AS i1, 4 AS i2, 5 AS i3) AS col),
+ AsStruct(6 AS key, 2 AS subkey, AsStruct(5 AS i1, 5 AS i2, 5 AS i3) AS col),
+ AsStruct(7 AS key, 3 AS subkey, AsStruct(5 AS i1, 6 AS i2, 7 AS i3) AS col),
+ AsStruct(8 AS key, 3 AS subkey, AsStruct(6 AS i1, 7 AS i2, 8 AS i3) AS col),
+ AsStruct(9 AS key, 3 AS subkey, AsStruct(7 AS i1, 8 AS i2, 9 AS i3) AS col),
+);
+
+SELECT
+ key,
+ subkey,
+ col,
+ -- assuming ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+ count(DISTINCT col) OVER (PARTITION BY subkey ORDER BY key ASC) AS cnt1_asc,
+ count(DISTINCT col) OVER (PARTITION BY subkey ORDER BY key DESC) AS cnt2_desc,
+FROM AS_TABLE($input)
+ORDER BY key;
+
+SELECT
+ key,
+ subkey,
+ col,
+ -- assuming ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+ count(DISTINCT col) OVER (PARTITION BY subkey) AS cnt,
+FROM AS_TABLE($input)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/window/empty/aggregations.cfg b/yql/essentials/tests/sql/suites/window/empty/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/empty/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/empty/aggregations.sql b/yql/essentials/tests/sql/suites/window/empty/aggregations.sql
new file mode 100644
index 0000000000..673e724f83
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/empty/aggregations.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM plato.Input
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 5 PRECEDING AND 10 PRECEDING),
+ w2 as ( ROWS BETWEEN 3 FOLLOWING AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.cfg b/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.sql b/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.sql
new file mode 100644
index 0000000000..c305328b8b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/empty/aggregations_leadlag.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM plato.Input
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 5 PRECEDING AND 10 PRECEDING),
+ w2 as (ORDER BY value DESC ROWS BETWEEN 3 FOLLOWING AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations.cfg b/yql/essentials/tests/sql/suites/window/full/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations.sql b/yql/essentials/tests/sql/suites/window/full/aggregations.sql
new file mode 100644
index 0000000000..b413db5f7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (),
+ w2 as (PARTITION BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_compact.cfg b/yql/essentials/tests/sql/suites/window/full/aggregations_compact.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_compact.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_compact.sql b/yql/essentials/tests/sql/suites/window/full/aggregations_compact.sql
new file mode 100644
index 0000000000..1c18473298
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_compact.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION COMPACT BY ()),
+ w2 as (PARTITION COMPACT BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.cfg b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.sql b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.sql
new file mode 100644
index 0000000000..413e1a0ddd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.cfg b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.sql b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.sql
new file mode 100644
index 0000000000..c68f9946a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/aggregations_leadlag_compact.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION COMPACT BY () ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w2 as (PARTITION COMPACT BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/leadlag.cfg b/yql/essentials/tests/sql/suites/window/full/leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/leadlag.sql b/yql/essentials/tests/sql/suites/window/full/leadlag.sql
new file mode 100644
index 0000000000..1fccdfd276
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/leadlag.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$in = SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+;
+
+SELECT value, dvalue_lead1, value_lag2 FROM $in ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/leadlag_compact.cfg b/yql/essentials/tests/sql/suites/window/full/leadlag_compact.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/leadlag_compact.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/leadlag_compact.sql b/yql/essentials/tests/sql/suites/window/full/leadlag_compact.sql
new file mode 100644
index 0000000000..45a8a6232f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/leadlag_compact.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$in = SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION /*+ COMPACT() */ BY () ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w2 as (PARTITION COMPACT BY key ORDER BY value DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+;
+
+SELECT value, dvalue_lead1, value_lag2 FROM $in ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.cfg b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.sql b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.sql
new file mode 100644
index 0000000000..019551ef7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input = (
+SELECT * FROM plato.Input WHERE key = '1'
+UNION ALL
+SELECT NULL AS key, "9" as subkey, "000" as value
+UNION ALL
+SELECT NULL AS key, "9" as subkey, "001" as value
+);
+
+
+SELECT
+ key,
+ subkey,
+ value,
+
+ AGGREGATE_LIST(value) over w1 as agglist1,
+
+FROM $input
+WINDOW
+ w1 as (PARTITION BY key, subkey ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.cfg b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.sql b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.sql
new file mode 100644
index 0000000000..81c3fe43ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_nulls_tuple_key.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input = (
+SELECT * FROM plato.Input WHERE key = '1'
+UNION ALL
+SELECT NULL AS key, "9" as subkey, "000" as value
+UNION ALL
+SELECT NULL AS key, "9" as subkey, "001" as value
+);
+
+
+SELECT
+ key,
+ subkey,
+ value,
+
+ AGGREGATE_LIST(value) over w1 as agglist1,
+
+FROM $input
+WINDOW
+ w1 as (PARTITION BY (key, subkey) as pkey ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.cfg b/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.cfg
new file mode 100644
index 0000000000..bcf4082c5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.cfg
@@ -0,0 +1 @@
+in Input input_optkey2.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.sql b/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.sql
new file mode 100644
index 0000000000..1b3778fc96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/noncompact_with_tablerow.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ key,
+ subkey,
+ value,
+
+ AGGREGATE_LIST(TableRow()) OVER w AS frame,
+
+FROM plato.Input
+WINDOW
+ w as (PARTITION BY key, subkey ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/full/session.cfg b/yql/essentials/tests/sql/suites/window/full/session.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/session.sql b/yql/essentials/tests/sql/suites/window/full/session.sql
new file mode 100644
index 0000000000..76ee7bd0c8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+-- add non-optional partition key
+$src = SELECT t.*, user ?? "u0" as user_nonopt FROM Input as t;
+
+SELECT
+ user,
+ user_nonopt,
+ ts,
+ payload,
+ AGGREGATE_LIST(TableRow()) over w as full_session,
+ COUNT(1) over w as session_len,
+FROM $src
+WINDOW w AS (
+ PARTITION BY user, user_nonopt, SessionWindow(ts, 10)
+ ORDER BY ts
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/full/session_aliases.cfg b/yql/essentials/tests/sql/suites/window/full/session_aliases.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_aliases.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/session_aliases.sql b/yql/essentials/tests/sql/suites/window/full/session_aliases.sql
new file mode 100644
index 0000000000..b809c6b534
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_aliases.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ SessionStart() over w1 as ss1,
+ SessionStart() over w as ss,
+
+ ListSort(AGGREGATE_LIST(ts) over w) as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts, 10) as ss0
+),
+w1 AS (
+ PARTITION BY SessionWindow(ts, 10), user
+)
+ORDER BY user, ts;
diff --git a/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.cfg b/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.sql b/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.sql
new file mode 100644
index 0000000000..2bd49f12f1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_aliases_compact.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ SessionStart() over w1 as ss1,
+ SessionStart() over w as ss,
+
+ ListSort(AGGREGATE_LIST(ts) over w) as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION COMPACT BY user, SessionWindow(ts, 10) as ss0
+),
+w1 AS (
+ PARTITION COMPACT BY SessionWindow(ts, 10), user
+)
+ORDER BY user, ts;
diff --git a/yql/essentials/tests/sql/suites/window/full/session_compact.cfg b/yql/essentials/tests/sql/suites/window/full/session_compact.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_compact.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/session_compact.sql b/yql/essentials/tests/sql/suites/window/full/session_compact.sql
new file mode 100644
index 0000000000..8c86df8e1c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_compact.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ payload,
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION COMPACT BY user, SessionWindow(ts, 10)
+ ORDER BY ts
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.cfg b/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.sql b/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.sql
new file mode 100644
index 0000000000..6280f571af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/session_incompat_sort.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+-- add non-optional partition key
+$src = SELECT t.*, user ?? "u0" as user_nonopt FROM Input as t;
+
+SELECT
+ user,
+ user_nonopt,
+ ts,
+ payload,
+ AGGREGATE_LIST(TableRow()) over w as full_session,
+ COUNT(1) over w as session_len,
+FROM $src
+WINDOW w AS (
+ PARTITION BY user, user_nonopt, SessionWindow(ts, 10)
+ ORDER BY ts DESC
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/full/syscolumns.cfg b/yql/essentials/tests/sql/suites/window/full/syscolumns.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/syscolumns.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/full/syscolumns.sql b/yql/essentials/tests/sql/suites/window/full/syscolumns.sql
new file mode 100644
index 0000000000..d2533c062b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/full/syscolumns.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+select
+ value,
+ max(value) over (partition by cast(TableName() as Utf8)),
+ cast(TableName() as Utf8),
+from Input order by value;
+
+select
+ value,
+ max(value) over (order by cast(TableName() as Utf8) rows between unbounded preceding and unbounded following),
+ cast(TableName() as Utf8),
+from Input order by value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.cfg b/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.sql b/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.sql
new file mode 100644
index 0000000000..aca3f1c6e6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_after_current.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 3 FOLLOWING AND 5 FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.cfg b/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.sql b/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.sql
new file mode 100644
index 0000000000..e3adba7ded
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_before_current.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 5 PRECEDING AND 3 PRECEDING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.cfg b/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.sql b/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.sql
new file mode 100644
index 0000000000..8b43cd6699
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_include_current.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 3 PRECEDING AND 3 FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.cfg b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.sql b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.sql
new file mode 100644
index 0000000000..f301c179de
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 3 PRECEDING AND 1 PRECEDING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.cfg b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.sql b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.sql
new file mode 100644
index 0000000000..2b744948ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/aggregations_mixed_leadlag.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN 3 PRECEDING AND 1 PRECEDING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/generic/session.cfg b/yql/essentials/tests/sql/suites/window/generic/session.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/session.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/session.sql b/yql/essentials/tests/sql/suites/window/generic/session.sql
new file mode 100644
index 0000000000..998f12e1ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/session.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ payload,
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts, 10)
+ ORDER BY ts
+ ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
+)
+ORDER BY user, payload;
diff --git a/yql/essentials/tests/sql/suites/window/generic/session_aliases.cfg b/yql/essentials/tests/sql/suites/window/generic/session_aliases.cfg
new file mode 100644
index 0000000000..c788a7d1ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/session_aliases.cfg
@@ -0,0 +1 @@
+in Input session1.txt
diff --git a/yql/essentials/tests/sql/suites/window/generic/session_aliases.sql b/yql/essentials/tests/sql/suites/window/generic/session_aliases.sql
new file mode 100644
index 0000000000..2375d56064
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/generic/session_aliases.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ user,
+ ts,
+ SessionStart() over w1 as ss1,
+ SessionStart() over w as ss,
+
+ AGGREGATE_LIST(ts) over w as ts_session,
+ COUNT(1) over w as session_len,
+FROM plato.Input
+WINDOW w AS (
+ PARTITION BY user, SessionWindow(ts, 10) as ss0
+ ORDER BY ts
+ ROWS BETWEEN 10 PRECEDING AND 10 FOLLOWING
+),
+w1 AS (
+ PARTITION BY SessionWindow(ts, 10), user
+ ORDER BY ts
+ ROWS BETWEEN 100 PRECEDING AND 100 FOLLOWING
+)
+ORDER BY user, ts;
diff --git a/yql/essentials/tests/sql/suites/window/input.txt b/yql/essentials/tests/sql/suites/window/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input.txt
@@ -0,0 +1,4 @@
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="800";"subkey"="2";"value"="ddd"};
+{"key"="020";"subkey"="3";"value"="q"};
+{"key"="150";"subkey"="4";"value"="qzz"};
diff --git a/yql/essentials/tests/sql/suites/window/input2.txt b/yql/essentials/tests/sql/suites/window/input2.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input2.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/window/input3.txt b/yql/essentials/tests/sql/suites/window/input3.txt
new file mode 100644
index 0000000000..b125936b3c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input3.txt
@@ -0,0 +1,9 @@
+{"key"="23";"subkey"="1";"value"="aaa"};
+{"key"="41";"subkey"="2";"value"="ddd"};
+{"key"="54";"subkey"="3";"value"="ggg"};
+{"key"="25";"subkey"="1";"value"="bbb"};
+{"key"="41";"subkey"="2";"value"="eee"};
+{"key"="25";"subkey"="1";"value"="ccc"};
+{"key"="55";"subkey"="3";"value"="hhh"};
+{"key"="41";"subkey"="2";"value"="fff"};
+{"key"="56";"subkey"="3";"value"="iii"};
diff --git a/yql/essentials/tests/sql/suites/window/input4.txt b/yql/essentials/tests/sql/suites/window/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/window/input5.txt b/yql/essentials/tests/sql/suites/window/input5.txt
new file mode 100644
index 0000000000..f90c1dbacc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input5.txt
@@ -0,0 +1,30 @@
+{"key"="1";"subkey"="3";"value"="01"};
+{"key"="1";"subkey"="5";"value"="02"};
+{"key"="1";"subkey"="1";"value"="03"};
+{"key"="1";"subkey"="1";"value"="04"};
+{"key"="1";"subkey"="3";"value"="05"};
+{"key"="1";"subkey"="8";"value"="06"};
+{"key"="1";"subkey"="7";"value"="07"};
+{"key"="1";"subkey"="4";"value"="08"};
+{"key"="1";"subkey"="6";"value"="09"};
+{"key"="1";"subkey"="2";"value"="10"};
+{"key"="2";"subkey"="3";"value"="11"};
+{"key"="2";"subkey"="5";"value"="12"};
+{"key"="2";"subkey"="1";"value"="13"};
+{"key"="2";"subkey"="1";"value"="14"};
+{"key"="2";"subkey"="3";"value"="15"};
+{"key"="2";"subkey"="8";"value"="16"};
+{"key"="2";"subkey"="7";"value"="17"};
+{"key"="2";"subkey"="4";"value"="18"};
+{"key"="2";"subkey"="6";"value"="19"};
+{"key"="2";"subkey"="2";"value"="20"};
+{"key"="3";"subkey"="3";"value"="21"};
+{"key"="3";"subkey"="5";"value"="22"};
+{"key"="3";"subkey"="1";"value"="23"};
+{"key"="3";"subkey"="1";"value"="24"};
+{"key"="3";"subkey"="3";"value"="25"};
+{"key"="3";"subkey"="8";"value"="26"};
+{"key"="3";"subkey"="7";"value"="27"};
+{"key"="3";"subkey"="4";"value"="28"};
+{"key"="3";"subkey"="6";"value"="29"};
+{"key"="3";"subkey"="2";"value"="30"};
diff --git a/yql/essentials/tests/sql/suites/window/input_intersect.txt b/yql/essentials/tests/sql/suites/window/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/window/input_intersect_with_holes.txt b/yql/essentials/tests/sql/suites/window/input_intersect_with_holes.txt
new file mode 100644
index 0000000000..e010220a24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_intersect_with_holes.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="null";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="null";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="322";"value"="qqq"};
+{"key"="150";"subkey"="null";"value"="zzz"};
+{"key"="023";"subkey"="null";"value"="vca"};
+{"key"="527";"subkey"="null";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="null";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="null";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/window/input_optkey1.txt b/yql/essentials/tests/sql/suites/window/input_optkey1.txt
new file mode 100644
index 0000000000..c525b5bd8e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_optkey1.txt
@@ -0,0 +1,5 @@
+{"key"=1; "optkey"=1; value="1" };
+{"key"=2; "optkey"=2; value="2" };
+{"key"=3; "optkey"=3; value="3" };
+{"key"=4; "optkey"=4; value="4" };
+{"key"=5; "optkey"=#; value="null"};
diff --git a/yql/essentials/tests/sql/suites/window/input_optkey1.txt.attr b/yql/essentials/tests/sql/suites/window/input_optkey1.txt.attr
new file mode 100644
index 0000000000..1ca6ee6155
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_optkey1.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"Int32"]];
+ ["optkey";["OptionalType";["DataType";"Int32"]]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/window/input_optkey2.txt b/yql/essentials/tests/sql/suites/window/input_optkey2.txt
new file mode 100644
index 0000000000..2c9f6066e7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_optkey2.txt
@@ -0,0 +1,5 @@
+{"key"=#; "subkey"=1u; value="000" };
+{"key"=1; "subkey"=2u; value="aaa" };
+{"key"=1; "subkey"=2u; value="bbb" };
+{"key"=1; "subkey"=2u; value="ccc" };
+{"key"=1; "subkey"=2u; value="ddd" };
diff --git a/yql/essentials/tests/sql/suites/window/input_optkey2.txt.attr b/yql/essentials/tests/sql/suites/window/input_optkey2.txt.attr
new file mode 100644
index 0000000000..14e8d693aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_optkey2.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["OptionalType";["DataType";"Int32"]]];
+ ["subkey";["DataType";"Uint32"]];
+ ["value";["DataType";"String"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/window/input_tutorial_users.txt b/yql/essentials/tests/sql/suites/window/input_tutorial_users.txt
new file mode 100644
index 0000000000..4a18a0dd29
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/input_tutorial_users.txt
@@ -0,0 +1,12 @@
+{"key"="15";"subkey"="213";"value"="Anya"};
+{"key"="25";"subkey"="225";"value"="Petr"};
+{"key"="17";"subkey"="1";"value"="Masha"};
+{"key"="5";"subkey"="225";"value"="Alena"};
+{"key"="23";"subkey"="2";"value"="Irina"};
+{"key"="13";"subkey"="21";"value"="Inna"};
+{"key"="33";"subkey"="125";"value"="Ivan"};
+{"key"="45";"subkey"="225";"value"="Asya"};
+{"key"="27";"subkey"="125";"value"="German"};
+{"key"="41";"subkey"="225";"value"="Olya"};
+{"key"="35";"subkey"="2";"value"="Slava"};
+{"key"="56";"subkey"="2";"value"="Elena"};
diff --git a/yql/essentials/tests/sql/suites/window/lagging/aggregations.cfg b/yql/essentials/tests/sql/suites/window/lagging/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/lagging/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/lagging/aggregations.sql b/yql/essentials/tests/sql/suites/window/lagging/aggregations.sql
new file mode 100644
index 0000000000..bd38e584e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/lagging/aggregations.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 3 PRECEDING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.cfg b/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.sql b/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.sql
new file mode 100644
index 0000000000..f87bf21f0e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/lagging/aggregations_leadlag.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 3 PRECEDING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/leading/aggregations.cfg b/yql/essentials/tests/sql/suites/window/leading/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/leading/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/leading/aggregations.sql b/yql/essentials/tests/sql/suites/window/leading/aggregations.sql
new file mode 100644
index 0000000000..9e2fb4090d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/leading/aggregations.sql
@@ -0,0 +1,16 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ COUNT(*) over w1 as count1,
+ ListSort(AGGREGATE_LIST_DISTINCT(subkey) over w1) as agglist_distinct1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 3 FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.cfg b/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.sql b/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.sql
new file mode 100644
index 0000000000..23f6c5ae87
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/leading/aggregations_leadlag.sql
@@ -0,0 +1,15 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ LEAD(value || value, 3) over w1 as dvalue_lead1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ LAG(cast(value as uint32)) over w2 as value_lag2,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 3 FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/lib1.sql.txt b/yql/essentials/tests/sql/suites/window/lib1.sql.txt
new file mode 100644
index 0000000000..be9eb62cb7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/lib1.sql.txt
@@ -0,0 +1,5 @@
+DEFINE SUBQUERY $subq() AS
+ SELECT key, subkey, value, DENSE_RANK() OVER w AS r FROM plato.Input WINDOW w AS (PARTITION BY key ORDER BY subkey);
+END DEFINE;
+
+EXPORT $subq;
diff --git a/yql/essentials/tests/sql/suites/window/mixed/aggregations.cfg b/yql/essentials/tests/sql/suites/window/mixed/aggregations.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/mixed/aggregations.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/mixed/aggregations.sql b/yql/essentials/tests/sql/suites/window/mixed/aggregations.sql
new file mode 100644
index 0000000000..d54d034301
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/mixed/aggregations.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+
+SELECT
+ value,
+
+ SUM(unwrap(cast(subkey as uint32))) over w1 as sum1,
+ AGGREGATE_LIST(subkey) over w1 as agglist1,
+
+ SUM(cast(subkey as uint32)) over w2 as sum2,
+ AGGREGATE_LIST(subkey) over w2 as agglist2,
+
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w2 as (PARTITION BY key ORDER BY value ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING)
+ORDER BY value;
diff --git a/yql/essentials/tests/sql/suites/window/multiaggr_subq.sql.txt b/yql/essentials/tests/sql/suites/window/multiaggr_subq.sql.txt
new file mode 100644
index 0000000000..0c1d4f8b40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/multiaggr_subq.sql.txt
@@ -0,0 +1,11 @@
+import agg_factory symbols $factory;
+use plato;
+
+define subquery $multiaggr_win() as
+ select
+ MULTI_AGGREGATE_BY(AsStruct(subkey as a,value as b), $factory) over w as ma,
+ ROW_NUMBER() over w as rn
+ from Input window w as (order by key);
+end define;
+
+export $multiaggr_win;
diff --git a/yql/essentials/tests/sql/suites/window/null_type.sql b/yql/essentials/tests/sql/suites/window/null_type.sql
new file mode 100644
index 0000000000..ea743b19aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/null_type.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+select
+ min(x) over w,
+ count(x) over w,
+ count(*) over w,
+ aggregate_list_distinct(x) over w,
+ aggregate_list(x) over w,
+ bool_and(x) over w
+from (
+ select null as x union all select Null as x
+)
+window w as (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW);
+
+select
+ min(x) over w,
+ count(x) over w,
+ count(*) over w,
+ aggregate_list_distinct(x) over w,
+ aggregate_list(x) over w,
+ bool_and(x) over w
+from (
+ select null as x union all select Null as x
+)
+window w as (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING);
diff --git a/yql/essentials/tests/sql/suites/window/p_int32.json b/yql/essentials/tests/sql/suites/window/p_int32.json
new file mode 100644
index 0000000000..18d17df026
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/p_int32.json
@@ -0,0 +1 @@
+"3"
diff --git a/yql/essentials/tests/sql/suites/window/presort_window_order_by_table.sql b/yql/essentials/tests/sql/suites/window/presort_window_order_by_table.sql
new file mode 100644
index 0000000000..a635674af9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/presort_window_order_by_table.sql
@@ -0,0 +1,16 @@
+/* postgres can not */
+use plato;
+
+$list = AsList(
+ AsList(3,1),
+ AsList(1,1),
+ AsList(1),
+ );
+
+insert into @foo
+select x from (select $list as x)
+flatten by x;
+commit;
+select x,row_number() over w as r from @foo
+window w as (order by x asc);
+
diff --git a/yql/essentials/tests/sql/suites/window/presort_window_partition_by_mem.sql b/yql/essentials/tests/sql/suites/window/presort_window_partition_by_mem.sql
new file mode 100644
index 0000000000..6f5b6dc5ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/presort_window_partition_by_mem.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+SELECT
+ key, row_number() over w
+FROM (SELECT AsList("a") as key, "z" as value)
+WINDOW w AS (partition by key order by value);
diff --git a/yql/essentials/tests/sql/suites/window/presort_window_partition_by_table.sql b/yql/essentials/tests/sql/suites/window/presort_window_partition_by_table.sql
new file mode 100644
index 0000000000..402496130b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/presort_window_partition_by_table.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+use plato;
+SELECT
+ key, row_number() over w
+FROM (SELECT AsList(key) as key, value from Input)
+WINDOW w AS (partition by key order by value)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/window/rank/nulls.sql b/yql/essentials/tests/sql/suites/window/rank/nulls.sql
new file mode 100644
index 0000000000..7feafa67ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/nulls.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+PRAGMA AnsiRankForNullableKeys;
+
+SELECT
+ key,
+ RANK() over w1 as r1,
+ DENSE_RANK() over w1 as r2,
+FROM AS_TABLE([<|key:1|>, <|key:null|>, <|key:null|>, <|key:1|>, <|key:2|>])
+WINDOW
+ w1 as (ORDER BY key ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/window/rank/nulls_legacy.sql b/yql/essentials/tests/sql/suites/window/rank/nulls_legacy.sql
new file mode 100644
index 0000000000..a9db1c3400
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/nulls_legacy.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+PRAGMA DisableAnsiRankForNullableKeys;
+
+SELECT
+ key,
+ RANK() over w1 as r1,
+ DENSE_RANK() over w1 as r2,
+FROM AS_TABLE([<|key:1|>, <|key:null|>, <|key:null|>, <|key:1|>, <|key:2|>])
+WINDOW
+ w1 as (ORDER BY key ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING)
+ORDER BY key;
diff --git a/yql/essentials/tests/sql/suites/window/rank/opt.cfg b/yql/essentials/tests/sql/suites/window/rank/opt.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/opt.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/rank/opt.sql b/yql/essentials/tests/sql/suites/window/rank/opt.sql
new file mode 100644
index 0000000000..3260ffb6ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/opt.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+PRAGMA AnsiRankForNullableKeys;
+
+SELECT
+ key,
+ subkey,
+ RANK() over w1 as r1,
+ DENSE_RANK() over w1 as r2,
+ RANK(subkey) over w1 as r3,
+ DENSE_RANK(subkey) over w1 as r4,
+
+ RANK() over w2 as r5,
+ DENSE_RANK() over w2 as r6,
+ RANK(subkey || subkey) over w2 as r7,
+ DENSE_RANK(subkey || subkey) over w2 as r8,
+FROM (SELECT cast(key as uint32) as key, subkey, value FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY subkey ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING),
+ w2 as ( ORDER BY key, subkey ROWS BETWEEN 3 FOLLOWING AND 2 FOLLOWING)
+ORDER BY key,subkey;
diff --git a/yql/essentials/tests/sql/suites/window/rank/plain.cfg b/yql/essentials/tests/sql/suites/window/rank/plain.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/plain.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/rank/plain.sql b/yql/essentials/tests/sql/suites/window/rank/plain.sql
new file mode 100644
index 0000000000..dee09aefe6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/plain.sql
@@ -0,0 +1,23 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+PRAGMA AnsiRankForNullableKeys;
+
+SELECT
+ key,
+ subkey,
+ RANK() over w1 as r1,
+ DENSE_RANK() over w1 as r2,
+ RANK(subkey) over w1 as r3,
+ DENSE_RANK(subkey) over w1 as r4,
+
+ RANK() over w2 as r5,
+ DENSE_RANK() over w2 as r6,
+ RANK(subkey || subkey) over w2 as r7,
+ DENSE_RANK(subkey || subkey) over w2 as r8,
+FROM (SELECT * FROM plato.Input WHERE key = '1')
+WINDOW
+ w1 as (PARTITION BY key ORDER BY subkey ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING),
+ w2 as ( ORDER BY key, subkey ROWS BETWEEN 3 FOLLOWING AND 2 FOLLOWING)
+ORDER BY key,subkey;
diff --git a/yql/essentials/tests/sql/suites/window/rank/unordered.cfg b/yql/essentials/tests/sql/suites/window/rank/unordered.cfg
new file mode 100644
index 0000000000..000848a05d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/unordered.cfg
@@ -0,0 +1 @@
+in Input input5.txt
diff --git a/yql/essentials/tests/sql/suites/window/rank/unordered.sql b/yql/essentials/tests/sql/suites/window/rank/unordered.sql
new file mode 100644
index 0000000000..c8213f505e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/rank/unordered.sql
@@ -0,0 +1,20 @@
+/* syntax version 1 */
+/* postgres can not */
+
+PRAGMA warning("disable", "4520");
+PRAGMA warning("disable", "4521");
+PRAGMA AnsiRankForNullableKeys;
+
+SELECT
+ key,
+ subkey,
+ RANK() over w1 as r1,
+ DENSE_RANK() over w1 as r2,
+
+ RANK() over w2 as r3,
+ DENSE_RANK() over w2 as r4,
+FROM plato.Input
+WINDOW
+ w1 as (PARTITION BY key ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING),
+ w2 as ( ROWS BETWEEN 3 FOLLOWING AND 2 FOLLOWING)
+ORDER BY key,subkey;
diff --git a/yql/essentials/tests/sql/suites/window/row_number_no_part_from_subq.sql b/yql/essentials/tests/sql/suites/window/row_number_no_part_from_subq.sql
new file mode 100644
index 0000000000..1b767deceb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/row_number_no_part_from_subq.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+USE plato;
+
+SELECT key, ROW_NUMBER() OVER w AS row_num
+FROM (select * from Input where key != "020")
+WINDOW w AS ();
diff --git a/yql/essentials/tests/sql/suites/window/row_number_no_part_multi_input.sql b/yql/essentials/tests/sql/suites/window/row_number_no_part_multi_input.sql
new file mode 100644
index 0000000000..df8eebf750
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/row_number_no_part_multi_input.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+USE plato;
+
+insert into @foo select * from Input;
+
+commit;
+
+$input = (
+ select * from Input where key != "020"
+ union all
+ select * from @foo
+ union all
+ select * from Input
+);
+
+$output = SELECT key, ROW_NUMBER() OVER w AS row_num
+FROM $input
+WINDOW w AS ();
+
+select
+ min(key) as min_key,
+ count(distinct row_num) as dist_rn,
+ min(row_num) as min_rn,
+ max(row_num) as max_rn,
+from $output;
diff --git a/yql/essentials/tests/sql/suites/window/row_number_to_map.sql b/yql/essentials/tests/sql/suites/window/row_number_to_map.sql
new file mode 100644
index 0000000000..914b36e574
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/row_number_to_map.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+
+SELECT key, subkey,
+ ROW_NUMBER() OVER w1 AS rn1,
+ ROW_NUMBER() OVER w2 AS rn2,
+ COUNT(*) OVER w2 AS w2_cnt,
+ ROW_NUMBER() OVER w3 AS rn3,
+ ROW_NUMBER() OVER w4 AS rn4,
+FROM Input
+WINDOW
+ w1 AS (),
+ w2 AS (ORDER BY subkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w3 AS (ORDER BY subkey DESC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW),
+ w4 AS (ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/window/row_number_to_map_multiple.sql b/yql/essentials/tests/sql/suites/window/row_number_to_map_multiple.sql
new file mode 100644
index 0000000000..979699b5af
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/row_number_to_map_multiple.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+
+SELECT key, subkey,
+ ROW_NUMBER() OVER w1 AS rn1,
+ ROW_NUMBER() OVER w2 AS rn2,
+ ROW_NUMBER() OVER w3 AS rn3,
+FROM Input
+WINDOW
+ w1 AS (),
+ w2 AS (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),
+ w3 AS (ORDER BY subkey DESC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/window/row_number_to_map_noncompact.sql b/yql/essentials/tests/sql/suites/window/row_number_to_map_noncompact.sql
new file mode 100644
index 0000000000..7d870be944
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/row_number_to_map_noncompact.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+
+USE plato;
+
+SELECT
+ ROW_NUMBER() OVER w AS rn,
+ COUNT(*) OVER w AS cnt,
+FROM Input
+WINDOW
+ w AS ()
+ORDER BY rn;
diff --git a/yql/essentials/tests/sql/suites/window/session1.txt b/yql/essentials/tests/sql/suites/window/session1.txt
new file mode 100644
index 0000000000..632c7ed4f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/session1.txt
@@ -0,0 +1,26 @@
+{"user"=#; "ts"=#; payload=1 };
+{"user"="u1"; "ts"=#; payload=2 };
+
+{"user"=#; "ts"=#; payload=3 };
+{"user"="u1"; "ts"=#; payload=4 };
+
+{"user"=#; "ts"=1; payload=5 };
+{"user"="u1"; "ts"=2; payload=6 };
+
+{"user"=#; "ts"=2; payload=7 };
+{"user"="u1"; "ts"=3; payload=8 };
+
+{"user"=#; "ts"=3; payload=9 };
+{"user"="u1"; "ts"=4; payload=10 };
+
+{"user"=#; "ts"=10; payload=11 };
+{"user"="u1"; "ts"=11; payload=12 };
+
+{"user"=#; "ts"=21; payload=13 };
+{"user"="u1"; "ts"=22; payload=14 };
+
+{"user"=#; "ts"=31; payload=15 };
+{"user"="u1"; "ts"=32; payload=16 };
+
+{"user"=#; "ts"=50; payload=17 };
+{"user"="u1"; "ts"=51; payload=18 };
diff --git a/yql/essentials/tests/sql/suites/window/session1.txt.attr b/yql/essentials/tests/sql/suites/window/session1.txt.attr
new file mode 100644
index 0000000000..0df1a044c1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/session1.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["user";["OptionalType";["DataType";"String"]]];
+ ["ts";["OptionalType";["DataType";"Int32"]]];
+ ["payload";["DataType";"Int32"]]]
+ ];
+}}
diff --git a/yql/essentials/tests/sql/suites/window/table_funcs_spec_win_func.sqlx b/yql/essentials/tests/sql/suites/window/table_funcs_spec_win_func.sqlx
new file mode 100644
index 0000000000..41e8728051
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/table_funcs_spec_win_func.sqlx
@@ -0,0 +1,10 @@
+/* postgres can not */
+use plato;
+
+insert into Output
+select
+ key,
+ max(TablePath()) over w as table_rec
+from Input
+window w as (order by key)
+;
diff --git a/yql/essentials/tests/sql/suites/window/table_funcs_spec_with_win_func.sqlx b/yql/essentials/tests/sql/suites/window/table_funcs_spec_with_win_func.sqlx
new file mode 100644
index 0000000000..ab63366f15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/table_funcs_spec_with_win_func.sqlx
@@ -0,0 +1,6 @@
+/* postgres can not */
+select
+ key, TablePath() as tab_path, ROW_NUMBER() over w1
+from plato.Input
+window w1 as (order by key)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/window/udaf_no_merge.sql b/yql/essentials/tests/sql/suites/window/udaf_no_merge.sql
new file mode 100644
index 0000000000..b9fe5fb2e2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/udaf_no_merge.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+/* syntax version 1 */
+$f = AggregationFactory(
+ "UDAF",
+ ($item, $_) -> ($item),
+ ($state, $item, $_) -> ($state),
+ null,
+ ($state) -> ($state)
+);
+
+select aggregate_by(x,$f) over (order by x) from (values (1),(2),(3)) as a(x); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/window/udaf_window.cfg b/yql/essentials/tests/sql/suites/window/udaf_window.cfg
new file mode 100644
index 0000000000..289c4251bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/udaf_window.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf python3_udf
diff --git a/yql/essentials/tests/sql/suites/window/udaf_window.sql b/yql/essentials/tests/sql/suites/window/udaf_window.sql
new file mode 100644
index 0000000000..34f9f56c6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/udaf_window.sql
@@ -0,0 +1,51 @@
+/* postgres can not */
+/* syntax version 1 */
+$script = @@
+import heapq
+import json
+
+N_SMALLEST = 3
+
+def create(item):
+ return [item]
+
+def add(state, item):
+ heapq.heappush(state, item)
+ return heapq.nsmallest(N_SMALLEST, state)
+
+def merge(state_a, state_b):
+ merged = heapq.merge(state_a, state_b)
+ return heapq.nsmallest(N_SMALLEST, merged)
+
+def get_result(state):
+ result = heapq.nsmallest(N_SMALLEST, state)
+ return '%d smallest items: %s' % (
+ N_SMALLEST,
+ ', '.join(map(str, result))
+ )
+
+def serialize(state):
+ return json.dumps(state)
+
+def deserialize(serialized):
+ return json.loads(serialized)
+@@;
+
+$create = Python3::create(Callable<(Double)->Resource<Python3>>, $script);
+$add = Python3::add(Callable<(Resource<Python3>,Double)->Resource<Python3>>, $script);
+$merge = Python3::merge(Callable<(Resource<Python3>,Resource<Python3>)->Resource<Python3>>, $script);
+$get_result = Python3::get_result(Callable<(Resource<Python3>)->String>, $script);
+$serialize = Python3::serialize(Callable<(Resource<Python3>)->String>, $script);
+$deserialize = Python3::deserialize(Callable<(String)->Resource<Python3>>, $script);
+
+SELECT UDAF(
+ CAST(key AS Double),
+ $create,
+ $add,
+ $merge,
+ $get_result,
+ $serialize,
+ $deserialize
+) OVER w
+FROM plato.Input
+WINDOW w AS (ORDER by value);
diff --git a/yql/essentials/tests/sql/suites/window/udaf_with_def_value.sql b/yql/essentials/tests/sql/suites/window/udaf_with_def_value.sql
new file mode 100644
index 0000000000..a68fdd16a3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/udaf_with_def_value.sql
@@ -0,0 +1,65 @@
+pragma warning("disable", "4520");
+
+$my_table =
+SELECT 1 AS id, 1 AS ts, 4 AS value1
+UNION ALL
+SELECT 2 AS id, 1 AS ts, NULL AS value1
+UNION ALL
+SELECT 1 AS id, 2 AS ts, 4 AS value1
+UNION ALL
+SELECT 3 AS id, 2 AS ts, 40 AS value1
+UNION ALL
+SELECT 3 AS id, 5 AS ts, 2 AS value1
+UNION ALL
+SELECT 3 AS id, 10 AS ts, 40 AS value1
+;
+
+$cnt_create = ($_item, $_parent) -> { return 1ul };
+$cnt_add = ($state, $_item, $_parent) -> { return 1ul + $state };
+$cnt_merge = ($state1, $state2) -> { return $state1 + $state2 };
+$cnt_get_result = ($state) -> { return $state };
+$cnt_serialize = ($state) -> { return $state };
+$cnt_deserialize = ($state) -> { return $state };
+-- non-trivial default value
+$cnt_default = 0.0;
+
+$cnt_udaf_factory = AggregationFactory(
+ "UDAF",
+ $cnt_create,
+ $cnt_add,
+ $cnt_merge,
+ $cnt_get_result,
+ $cnt_serialize,
+ $cnt_deserialize,
+ $cnt_default
+);
+
+
+SELECT
+ id
+ , ts
+ , value1
+ , AGGREGATE_BY(value1, $cnt_udaf_factory) OVER lagging AS lagging_opt
+ , AGGREGATE_BY(value1, $cnt_udaf_factory) OVER generic AS generic_opt
+
+ , AGGREGATE_BY(ts, $cnt_udaf_factory) OVER lagging AS lagging
+ , AGGREGATE_BY(ts, $cnt_udaf_factory) OVER generic AS generic
+
+ , AGGREGATE_BY(value1, $cnt_udaf_factory) OVER empty AS empty_opt
+ , AGGREGATE_BY(ts, $cnt_udaf_factory) OVER empty AS empty
+
+FROM $my_table
+WINDOW lagging AS (
+ ORDER BY ts, id
+ ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING
+)
+, generic AS (
+ ORDER BY ts, id
+ ROWS BETWEEN 10 PRECEDING AND 1 PRECEDING
+)
+, empty AS (
+ ORDER BY ts, id
+ ROWS BETWEEN 10 FOLLOWING AND 1 FOLLOWING
+)
+ORDER BY ts, id;
+
diff --git a/yql/essentials/tests/sql/suites/window/win_aggregate_check01.sqlx b/yql/essentials/tests/sql/suites/window/win_aggregate_check01.sqlx
new file mode 100644
index 0000000000..ffc03289d4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_aggregate_check01.sqlx
@@ -0,0 +1,24 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ region + 2 as region_2,
+ age, -- use direct value in aggregation impossible
+ avg(age) as avg_age,
+ sum(age) as sum_age,
+ sum(avg(age)) over w1 as sum_by_avg_age,
+ lag(region) over w1 as prev_region,
+ some(prefix) over w1 as prefix_list,
+ lag(prefix) over w1 as prev_prefix_list,
+ lag(some(name)) over w1 as prev_region_list,
+ 'test'
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+window w1 as (partition by region order by avg(age) desc)
+order by region, avg_age desc
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_aggregate_check02.sqlx b/yql/essentials/tests/sql/suites/window/win_aggregate_check02.sqlx
new file mode 100644
index 0000000000..46ee384a24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_aggregate_check02.sqlx
@@ -0,0 +1,23 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ region + 2 as region_2,
+ avg(age) as avg_age,
+ sum(age) as sum_age,
+ sum(avg(age)) over w1 as sum_by_avg_age,
+ lag(region) over w1 as prev_region,
+ some(prefix) over w1 as prefix_list,
+ lag(prefix) over w1 as prev_prefix_list,
+ lag(some(name)) over w1 as prev_region_list,
+ 'test'
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+window w1 as (partition by region order by age desc) -- use unaggregaded age in order by in win specification
+order by region, avg_age desc
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.cfg b/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.cfg
new file mode 100644
index 0000000000..0dba2231fb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.cfg
@@ -0,0 +1,4 @@
+in Input input_tutorial_users.txt
+udf histogram_udf
+udf math_udf
+udf stat_udf
diff --git a/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.sql b/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.sql
new file mode 100644
index 0000000000..d144fc095d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_by_all_aggregate.sql
@@ -0,0 +1,38 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+-- insert into Output
+select
+ region,
+ name,
+ sum(age) over w1 as sum,
+ min(age) over w1 as min,
+ max(age) over w1 as max,
+ count(age) over w1 as count,
+ count(*) over w1 as count_all,
+ count_if(age>20) over w1 as count_if,
+ some(age) over w1 as some,
+ bit_and(age) over w1 as bit_and,
+ bit_or(age) over w1 as bit_or,
+ bit_xor(age) over w1 as bit_xor,
+ bool_and(age>20) over w1 as bool_and,
+ bool_or(age>20) over w1 as bool_or,
+ avg(age) over w1 as avg,
+ aggr_list(age) over w1 as `list`,
+ min_by(age, name) over w1 as min_by,
+ max_by(age, name) over w1 as max_by,
+ nanvl(variance(age) over w1, -999.0) as variance,
+ nanvl(stddev(age) over w1, -999.0) as stddev,
+ nanvl(populationvariance(age) over w1, -999.0) as popvar,
+ nanvl(stddevpopulation(age) over w1, -999.0) as popstddev,
+ histogram(age) over w1 as hist,
+ median(age) over w1 as median,
+ percentile(age, 0.9) over w1 as perc90,
+ aggregate_by(age, aggregation_factory("count")) over w1 as aggby
+from $data
+window w1 as (partition by region order by name desc)
+order by region, name desc
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_by_all_avg_interval.sql b/yql/essentials/tests/sql/suites/window/win_by_all_avg_interval.sql
new file mode 100644
index 0000000000..c2ff089f9e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_by_all_avg_interval.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+-- insert into Output
+$data2 = (select
+ region,
+ name,
+ avg(CAST(age as Interval)) over w1 as avg_age,
+from $data
+window w1 as (partition by region order by name desc)
+);
+
+discard select
+ EnsureType(avg_age, Interval?) as avg_age
+from $data2
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_by_all_percentile_interval.sql b/yql/essentials/tests/sql/suites/window/win_by_all_percentile_interval.sql
new file mode 100644
index 0000000000..b7c1cf8a79
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_by_all_percentile_interval.sql
@@ -0,0 +1,36 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$zero = unwrap( cast(0 as Interval) );
+
+-- safely cast data to get rid of optionals after cast
+$prepared = select
+ cast(key as Interval) ?? $zero as age
+ , cast(subkey as uint32) as region
+ , value as name
+ from Input;
+
+-- we want to check both optional<interval> and plain interval
+$data = (select
+ age
+ , just(age) as age_opt
+ , region
+ , name
+ from $prepared);
+
+$data2 = (select
+ region,
+ name,
+ percentile(age, 0.8) over w1 as age_p80,
+ percentile(age_opt, 0.8) over w1 as age_opt_p80,
+from $data
+window w1 as (partition by region order by name desc)
+);
+
+select
+ EnsureType(age_p80, Interval) as age_p80
+ , EnsureType(age_opt_p80, Interval?) as age_opt_p80
+from $data2
+;
+
diff --git a/yql/essentials/tests/sql/suites/window/win_by_simple.sql b/yql/essentials/tests/sql/suites/window/win_by_simple.sql
new file mode 100644
index 0000000000..4a34e08cea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_by_simple.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+SELECT
+ key, row_number() over w
+FROM (SELECT "a" as key, "z" as value)
+WINDOW w AS (partition by key order by value);
diff --git a/yql/essentials/tests/sql/suites/window/win_expr_bounds.cfg b/yql/essentials/tests/sql/suites/window/win_expr_bounds.cfg
new file mode 100644
index 0000000000..10325bfb63
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_expr_bounds.cfg
@@ -0,0 +1,2 @@
+in Input4 input4.txt
+param $begin p_int32.json
diff --git a/yql/essentials/tests/sql/suites/window/win_expr_bounds.sql b/yql/essentials/tests/sql/suites/window/win_expr_bounds.sql
new file mode 100644
index 0000000000..64e7387bc6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_expr_bounds.sql
@@ -0,0 +1,13 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+declare $begin as Int32;
+
+select
+ key, subkey,
+ COUNT(*) over w as cnt
+from Input4
+window
+ w as (order by key, subkey rows between $begin preceding and 1 + 1 following)
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/win_extract_members.sql b/yql/essentials/tests/sql/suites/window/win_extract_members.sql
new file mode 100644
index 0000000000..7785cf9eb9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_extract_members.sql
@@ -0,0 +1,21 @@
+/* postgres can not */
+use plato;
+
+$foo = (
+ select key, subkey, value,
+ sum(cast(subkey as uint32)) over w as sks
+ from Input
+ window w as (partition by key order by subkey)
+);
+
+$bar = (
+ select key, subkey,
+ sum(cast(subkey as uint32)) over w as sks,
+ avg(cast(subkey as uint32)) over w as ska
+ from Input4
+ window w as (partition by key order by subkey)
+);
+
+select key,subkey, value from $foo order by key, subkey;
+select key,ska from $bar order by key,ska;
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.sql
new file mode 100644
index 0000000000..245bbdf5b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select
+ subkey,
+ 2 * sum(cast(key as uint32)) over w1 as dbl_sum,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from plato.Input window w1 as (partition by subkey order by key)
+order by subkey, c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.sql
new file mode 100644
index 0000000000..6d15ae0b4b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+select
+ 2 * sum(cast(key as uint32)) over w1 as dbl_sum,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from plato.Input window w1 as (order by key desc)
+order by c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.sql
new file mode 100644
index 0000000000..34f8c138f6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_no_part_sorted.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select
+ 2 * sum(cast(key as uint32)) over w1 as dbl_sum,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from plato.Input
+window w1 as (order by key)
+order by c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.sql
new file mode 100644
index 0000000000..821da3fefd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select
+ subkey,
+ sum(cast(key as uint32)) over w1 as s,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from plato.Input window w1 as (partition by subkey order by key)
+order by subkey, c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.sql
new file mode 100644
index 0000000000..3553711d4d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_4func_sort_desc.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+select
+ subkey,
+ sum(cast(key as uint32)) over w1 as s,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from plato.Input window w1 as (partition by subkey order by key desc)
+order by subkey, c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.cfg
new file mode 100644
index 0000000000..79b8cf294f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.cfg
@@ -0,0 +1,2 @@
+in Input input_intersect.txt
+udf histogram_udf
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.sql
new file mode 100644
index 0000000000..c7c506e390
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_hist.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select subkey, HISTOGRAM(cast(key as uint32) % 10, 2.) over w1 as hh, count(key) over w1 as c, min(key) over w1 as mink, max(key) over w1 as maxk
+from plato.Input
+window w1 as (partition by subkey order by key)
+order by subkey, c;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.cfg
new file mode 100644
index 0000000000..b0a6e1e6b6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.sql
new file mode 100644
index 0000000000..7d7ed2bb52
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_stat.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+select
+ key, subkey,
+ nanvl(correlation(cast(key as double), cast(subkey as double)) over w, NULL) as corr,
+ nanvl(covariance(cast(key as double), cast(subkey as double)) over w, -9.9) as covar,
+ hll(value, 18) over w as hll
+from plato.Input
+window w as (order by subkey);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.cfg
new file mode 100644
index 0000000000..144f0dd840
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.cfg
@@ -0,0 +1 @@
+in Input input2.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.sql
new file mode 100644
index 0000000000..976046bcc8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all.sql
@@ -0,0 +1,6 @@
+pragma SimpleColumns;
+use plato;
+
+$q = (select CAST(key as Int32) as key, CAST(subkey as Int32) as subkey, value from Input);
+
+select t.*, sum(subkey) over w as subkey_sum, sum(key) over w from $q as t window w as (partition by key order by value) order by key,subkey;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.cfg b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.cfg
new file mode 100644
index 0000000000..144f0dd840
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.cfg
@@ -0,0 +1 @@
+in Input input2.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.sql b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.sql
new file mode 100644
index 0000000000..d790cfea62
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_aggr_with_qualified_all_no_simple_columns.sql
@@ -0,0 +1,7 @@
+pragma DisableSimpleColumns;
+
+use plato;
+
+$q = (select CAST(key as Int32) as key, CAST(subkey as Int32) as subkey, value from Input);
+
+select t.*, sum(subkey) over w as subkey_sum, sum(key) over w from $q as t window w as (partition by key order by value) order by `t.key`,`t.subkey`;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_auto_arg.sql b/yql/essentials/tests/sql/suites/window/win_func_auto_arg.sql
new file mode 100644
index 0000000000..4dea9c50b1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_auto_arg.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+SELECT
+ RANK() over w as rank_noarg,
+ DENSE_RANK() over w as dense_rank_noarg,
+ RANK(cast(subkey as uint32) / 10 % 2) over w as rank,
+ DENSE_RANK(cast(subkey as uint32) / 10 % 2) over w as dense_rank,
+ zz.*
+FROM
+ Input4 as zz
+WINDOW
+ w as (PARTITION BY key ORDER BY subkey)
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_auto_arg_selective_rank.sql b/yql/essentials/tests/sql/suites/window/win_func_auto_arg_selective_rank.sql
new file mode 100644
index 0000000000..aae50e65f4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_auto_arg_selective_rank.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+PRAGMA DisableSimpleColumns;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+--INSERT INTO Output
+SELECT
+ RANK() over w as rank_noarg,
+ DENSE_RANK() over w as dense_rank_noarg,
+ RANK(AsTuple(key, value)) over w as rank,
+ DENSE_RANK(AsTuple(key, value)) over w as dense_rank,
+ zz.*
+FROM
+ Input4 as zz
+WINDOW
+ w as (ORDER BY key, subkey, value)
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_auto_arg_two_sort.sql b/yql/essentials/tests/sql/suites/window/win_func_auto_arg_two_sort.sql
new file mode 100644
index 0000000000..67f6c8cc5f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_auto_arg_two_sort.sql
@@ -0,0 +1,18 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+--INSERT INTO Output
+SELECT
+ RANK() over w as rank_noarg,
+ DENSE_RANK() over w as dense_rank_noarg,
+ RANK(subkey) over w as rank,
+ DENSE_RANK(subkey) over w as dense_rank,
+ zz.*
+FROM
+ Input4 as zz
+WINDOW
+ w as (PARTITION BY key ORDER BY subkey, value)
+ORDER BY key, subkey, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_cume_dist.sql b/yql/essentials/tests/sql/suites/window/win_func_cume_dist.sql
new file mode 100644
index 0000000000..864cfcc6ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_cume_dist.sql
@@ -0,0 +1,7 @@
+select
+r,x,
+cume_dist() over w,
+from (select * from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)) as z
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_cume_dist_ansi.sql b/yql/essentials/tests/sql/suites/window/win_func_cume_dist_ansi.sql
new file mode 100644
index 0000000000..fd609fd046
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_cume_dist_ansi.sql
@@ -0,0 +1,4 @@
+pragma AnsiCurrentRow;
+SELECT cume_dist() over w FROM (VALUES (4),(5),(5),(6)) as a(x)
+window w as (ORDER BY x ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING);
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last.cfg b/yql/essentials/tests/sql/suites/window/win_func_first_last.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last.sql b/yql/essentials/tests/sql/suites/window/win_func_first_last.sql
new file mode 100644
index 0000000000..1e0c82e8fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+SELECT
+ key,
+ FIRST_VALUE(cast(subkey as uint32)) RESPECT NULLS OVER w1,
+ FIRST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1,
+ LAST_VALUE(cast(subkey as uint32)) OVER w1,
+ LAST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1,
+ subkey
+FROM plato.Input
+WINDOW w1 as (ORDER BY key desc, subkey);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last_over_nonopt.sql b/yql/essentials/tests/sql/suites/window/win_func_first_last_over_nonopt.sql
new file mode 100644
index 0000000000..9303079983
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last_over_nonopt.sql
@@ -0,0 +1,19 @@
+/* postgres can not */
+/* syntax version 1 */
+SELECT
+ key,
+
+ FIRST_VALUE(key) RESPECT NULLS OVER w1,
+ FIRST_VALUE(key) IGNORE NULLS OVER w1,
+ LAST_VALUE(key) OVER w1,
+ LAST_VALUE(key) IGNORE NULLS OVER w1,
+
+ FIRST_VALUE(null) RESPECT NULLS OVER w1,
+ FIRST_VALUE(null) IGNORE NULLS OVER w1,
+ LAST_VALUE(null) OVER w1,
+ LAST_VALUE(null) IGNORE NULLS OVER w1,
+
+ subkey
+FROM plato.Input
+WINDOW w1 as (ORDER BY subkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.cfg b/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.sql b/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.sql
new file mode 100644
index 0000000000..ce137c76f3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last_rev.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+SELECT
+ key,
+ FIRST_VALUE(cast(subkey as uint32)) OVER w1,
+ FIRST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1,
+ LAST_VALUE(cast(subkey as uint32)) RESPECT NULLS OVER w1,
+ LAST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1,
+ subkey
+FROM plato.Input
+WINDOW w1 as (ORDER BY key asc, subkey);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.sql b/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.sql
new file mode 100644
index 0000000000..84de1048c6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_first_last_with_part.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+$input=(select cast(key as int32) / 100 as key_hundred, cast(key as int32) as key, cast(subkey as int32) as subkey, value from plato.Input);
+
+SELECT
+ key_hundred,
+ key,
+ FIRST_VALUE(cast(subkey as uint32)) RESPECT NULLS OVER w1 as first_res_null,
+ FIRST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1 as first_esc_null,
+ LAST_VALUE(cast(subkey as uint32)) OVER w1 as last_res_null,
+ LAST_VALUE(cast(subkey as uint32)) IGNORE NULLS OVER w1 as last_esc_null,
+ subkey
+FROM $input
+WINDOW w1 as (PARTITION BY key_hundred ORDER BY key)
+ORDER BY key_hundred, key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_in_lib.cfg b/yql/essentials/tests/sql/suites/window/win_func_in_lib.cfg
new file mode 100644
index 0000000000..b6318845f7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_in_lib.cfg
@@ -0,0 +1,2 @@
+file lib1.sql lib1.sql.txt
+in Input input.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_in_lib.sql b/yql/essentials/tests/sql/suites/window/win_func_in_lib.sql
new file mode 100644
index 0000000000..3c6dd9719c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_in_lib.sql
@@ -0,0 +1,6 @@
+USE plato;
+PRAGMA library('lib1.sql');
+
+IMPORT lib1 symbols $subq;
+
+SELECT * FROM $subq();
diff --git a/yql/essentials/tests/sql/suites/window/win_func_into_udf.cfg b/yql/essentials/tests/sql/suites/window/win_func_into_udf.cfg
new file mode 100644
index 0000000000..061efc4f73
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_into_udf.cfg
@@ -0,0 +1,2 @@
+in Input input4.txt
+udf math_udf
diff --git a/yql/essentials/tests/sql/suites/window/win_func_into_udf.sql b/yql/essentials/tests/sql/suites/window/win_func_into_udf.sql
new file mode 100644
index 0000000000..45083bc46d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_into_udf.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+SELECT
+ key, Math::Sqrt(CAST(row_number() over w as double)) as sq
+FROM plato.Input
+WINDOW w AS (partition by key order by subkey)
+ORDER BY key, sq;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.cfg b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.cfg
new file mode 100644
index 0000000000..f0840473ba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+in InputOpt input_optkey1.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.sql b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.sql
new file mode 100644
index 0000000000..192103f030
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_opt.sql
@@ -0,0 +1,23 @@
+/* postgres can not */
+use plato;
+
+select
+ subkey,
+ lag(Just(subkey)) over w as opt_lag,
+ lead(Just(subkey)) over w as opt_lead,
+ lag(subkey, 0) over w as lag0,
+ lead(subkey, 0) over w as lead0
+from Input window w as ()
+order by subkey;
+
+
+select
+ key,
+ lag(optkey) over w as opt_lag,
+ lead(Just(optkey)) over w as opt_lead,
+ lag(Just(optkey), 0) over w as lag0,
+ lead(optkey, 0) over w as lead0
+from InputOpt window w as ()
+order by key;
+
+select lead(null) over w from (select 1 as key) window w as ();
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.cfg b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.sql b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.sql
new file mode 100644
index 0000000000..4400f070f2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm.sql
@@ -0,0 +1,21 @@
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as int32) as key, cast(subkey as int32) as subkey, value from Input);
+
+--insert into Output
+select
+ lead(key, 3) over w as keyL,
+ lead(key, 2) over w as keyM,
+ lead(key, 1) over w as keyN,
+ key as keyO,
+ lag(key, 1) over w as key_1,
+ lag(key, 2) over w as key_2,
+ lag(key, 3) over w as key_3,
+ lag(key, 4) over w as key_4,
+ lag(key, 5) over w as key_5,
+ value
+from $input
+window w as (order by key, value)
+order by keyO, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.sql b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.sql
new file mode 100644
index 0000000000..509cd93f05
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part.sql
@@ -0,0 +1,22 @@
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as int32) / 100 as key_hundred, cast(key as int32) as key, cast(subkey as int32) as subkey, value from Input);
+
+--insert into Output
+select
+ key_hundred as a_part,
+ lead(key, 3) over w as keyL,
+ lead(key, 2) over w as keyM,
+ lead(key, 1) over w as keyN,
+ key as keyO,
+ lag(key, 1) over w as key_1,
+ lag(key, 2) over w as key_2,
+ lag(key, 3) over w as key_3,
+ lag(key, 4) over w as key_4,
+ lag(key, 5) over w as key_5,
+ value
+from $input
+window w as (partition by key_hundred order by key, value)
+order by a_part, keyO, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.cfg b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.sql b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.sql
new file mode 100644
index 0000000000..1da77dd086
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_lead_lag_worm_with_part_other.sql
@@ -0,0 +1,22 @@
+/* postgres can not */
+use plato;
+
+$input=(select cast(key as int32) % 4 as key_quad, cast(key as int32) as key, cast(subkey as int32) as subkey, value from Input);
+
+--insert into Output
+select
+ key_quad as a_part,
+ lead(key, 3) over w as keyL,
+ lead(key, 2) over w as keyM,
+ lead(key, 1) over w as keyN,
+ key as keyO,
+ lag(key, 1) over w as key_1,
+ lag(key, 2) over w as key_2,
+ lag(key, 3) over w as key_3,
+ lag(key, 4) over w as key_4,
+ lag(key, 5) over w as key_5,
+ value
+from $input
+window w as (partition by key_quad order by key, value)
+order by a_part, keyO, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_mutable_resource.sql b/yql/essentials/tests/sql/suites/window/win_func_mutable_resource.sql
new file mode 100644
index 0000000000..74892a5a56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_mutable_resource.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+select median(x) over w,median(x) over w from (
+select x, 0 as y from (select AsList(1,2,3,4,5,6,7,8,9,10) as x) flatten by x
+)
+window w as (order by y)
diff --git a/yql/essentials/tests/sql/suites/window/win_func_nth_value.sql b/yql/essentials/tests/sql/suites/window/win_func_nth_value.sql
new file mode 100644
index 0000000000..a8e99c6201
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_nth_value.sql
@@ -0,0 +1,14 @@
+select
+r,x,
+nth_value(x,1) over w as nr1,
+nth_value(x,1) ignore nulls over w as ni1,
+nth_value(x,2) over w as nr2,
+nth_value(x,2) ignore nulls over w as ni2,
+nth_value(x,3) over w as nr3,
+nth_value(x,3) ignore nulls over w as ni3,
+nth_value(x,4) over w as nr4,
+nth_value(x,4) ignore nulls over w as ni4
+from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_ntile.sql b/yql/essentials/tests/sql/suites/window/win_func_ntile.sql
new file mode 100644
index 0000000000..86b622e239
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_ntile.sql
@@ -0,0 +1,7 @@
+select
+r,x,
+ntile(3) over w,
+from (select * from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)) as z
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_on_cloned_source.sql b/yql/essentials/tests/sql/suites/window/win_func_on_cloned_source.sql
new file mode 100644
index 0000000000..a4cd401589
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_on_cloned_source.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+USE plato;
+
+$sub_raws = (SELECT ROW_NUMBER() OVER trivialWindow as RowNum
+FROM Input WINDOW trivialWindow As ()
+);
+
+--INSERT INTO Output
+SELECT
+ *
+FROM $sub_raws;
+
+SELECT
+ *
+FROM $sub_raws;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.cfg b/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.cfg
new file mode 100644
index 0000000000..144f0dd840
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.cfg
@@ -0,0 +1 @@
+in Input input2.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.sql b/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.sql
new file mode 100644
index 0000000000..6508a8c827
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_order_by_udf_empty_rank.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+PRAGMA DisableAnsiRankForNullableKeys;
+
+USE plato;
+
+SELECT
+ key,
+ RANK() over w as ix,
+ subkey,
+ String::Base64Encode(subkey) as subkey_enc
+FROM Input
+WINDOW w AS (
+ PARTITION BY key
+ ORDER BY String::Base64Encode(subkey) DESC
+)
+ORDER BY key, ix;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by.cfg b/yql/essentials/tests/sql/suites/window/win_func_over_group_by.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by.sql b/yql/essentials/tests/sql/suites/window/win_func_over_group_by.sql
new file mode 100644
index 0000000000..2766549b6e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by.sql
@@ -0,0 +1,17 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ avg(age) as avg_age,
+ sum(avg(age)) over w1 as sum_by_avg_age
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+-- how to use single avg_age?
+window w1 as (partition by region order by avg(age))
+order by region, avg_age
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.cfg b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.sql b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.sql
new file mode 100644
index 0000000000..fda60ad550
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_compl.sql
@@ -0,0 +1,25 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ region + 2 as region_2,
+ --age,
+ avg(age) as avg_age,
+ sum(age) as sum_age,
+ sum(avg(age)) over w1 as sum_by_avg_age,
+ lag(region) over w1 as prev_region,
+ lag(aggr_list(region)) over w1 as prev_region_list,
+ 'test'
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+-- how to use single avg_age?
+window w1 as (partition by region order by avg(age) desc)
+--window w1 as (order by avg(age) desc)
+order by region, avg_age desc
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.cfg b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.sql b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.sql
new file mode 100644
index 0000000000..d6ec520dae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ region + 2 as region_2,
+ --age,
+ avg(age) as avg_age,
+ sum(age) as sum_age,
+ sum(avg(age)) over w1 as sum_by_avg_age,
+ lag(region) over w1 as prev_region,
+ aggr_list(prefix) over w1 as prefix_list,
+ lag(prefix) over w1 as prev_prefix_list,
+ lag(aggr_list(name)) over w1 as prev_region_list,
+ 'test'
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+-- how to use single avg_age?
+window w1 as (partition by region order by avg(age) desc, prefix)
+--window w1 as (order by avg(age) desc)
+order by region, avg_age desc, prefix
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.cfg b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.sql b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.sql
new file mode 100644
index 0000000000..3050750f9b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_list_names_order_prefix.sql
@@ -0,0 +1,24 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ region + 2 as region_2,
+ avg(age) as avg_age,
+ sum(age) as sum_age,
+ sum(avg(age)) over w1 as sum_by_avg_age,
+ lag(region) over w1 as prev_region,
+ aggr_list(prefix) over w1 as prefix_list,
+ lag(prefix) over w1 as prev_prefix_list,
+ lag(agg_list(name)) over w1 as prev_region_list,
+ 'test'
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+window w1 as (partition by region order by prefix desc)
+order by region desc, prefix, sum_by_avg_age
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_having.sqlx b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_having.sqlx
new file mode 100644
index 0000000000..de7ab56543
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_having.sqlx
@@ -0,0 +1,17 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+insert into Output
+select
+ prefix,
+ region,
+ avg(age) as avg_age,
+ sum(avg(age)) over w1 as sum_by_avg_age
+from $data
+group by region, SUBSTRING(name,0,1) as prefix
+having lag(avg(age)) over w1 > 30
+window w1 as (partition by region order by avg(age))
+order by region, avg_age
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_where.sqlx b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_where.sqlx
new file mode 100644
index 0000000000..27da455931
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_over_group_by_with_where.sqlx
@@ -0,0 +1,16 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+insert into Output
+select
+ prefix,
+ region,
+ sum(avg(age)) over w1 as sum_by_avg_age
+from $data
+where lag(avg(age), 2) over w1 > 30
+group by region, SUBSTRING(name,0,1) as prefix
+window w1 as (partition by region order by avg(age))
+order by region, avg_age
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.cfg b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.sql b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.sql
new file mode 100644
index 0000000000..f101052580
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+use plato;
+
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
+
+--insert into Output
+select
+ prefix,
+ region,
+ name,
+ sum(age) over w1 as sum1
+from $data
+window w1 as (partition by SUBSTRING(name,0,1) as prefix order by name)
+order by prefix, region, name;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_part_by_expr_new.sql b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr_new.sql
new file mode 100644
index 0000000000..cec51e2e40
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_part_by_expr_new.sql
@@ -0,0 +1,9 @@
+/* postgres can not */
+/* syntax version 1 */
+-- YQL-1977
+use plato;
+
+--insert into Output
+select key_mod, aggr_list(value) over w, aggr_list(subkey) over w
+from Input window w as (partition by cast(key as uint32) % 10 as key_mod order by subkey)
+order by key_mod, column1;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_percent_rank.sql b/yql/essentials/tests/sql/suites/window/win_func_percent_rank.sql
new file mode 100644
index 0000000000..f249d901e3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_percent_rank.sql
@@ -0,0 +1,8 @@
+select
+r,x,
+percent_rank() over w,
+percent_rank(x) over w,
+from (select * from (values (1,null),(2,3),(3,4),(4,4)) as a(r,x)) as z
+window w as (order by r)
+order by r
+
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.cfg b/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.sql b/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.sql
new file mode 100644
index 0000000000..963a93391f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_all.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+$input=(select cast(key as int32) ?? 0 as key, cast(subkey as int32) as subkey, value from Input);
+
+SELECT
+ rank(key) over w1 as rank_key,
+ dense_rank(key) over w1 as dense_rank_key,
+ key
+FROM $input
+WINDOW w1 as (ORDER BY key);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.cfg b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.sql b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.sql
new file mode 100644
index 0000000000..fd589fcba2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_all.sql
@@ -0,0 +1,13 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+$input=(select cast(key as int32) as key, cast(subkey as int32) as subkey, value from Input);
+
+SELECT
+ rank(key) over w1 as rank_key,
+ dense_rank(key) over w1 as dense_rank_key,
+ key
+FROM $input
+WINDOW w1 as (ORDER BY key);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.sql b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.sql
new file mode 100644
index 0000000000..72e506b183
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_opt_part.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+$input=(select cast(key as int32) % 4 as key_quad, cast(key as int32) as key, cast(subkey as int32) as subkey, value from Input);
+
+SELECT
+ rank(key) over w1 as rank_key,
+ dense_rank(key) over w1 as dense_rank_key,
+ key_quad,
+ key
+FROM $input
+WINDOW w1 as (PARTITION BY key_quad ORDER BY key)
+ORDER BY rank_key, dense_rank_key, key_quad;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.cfg
new file mode 100644
index 0000000000..1af92ac7be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect_with_holes.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.sql b/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.sql
new file mode 100644
index 0000000000..6b94e82863
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_by_part.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+/* syntax version 1 */
+use plato;
+PRAGMA DisableAnsiRankForNullableKeys;
+
+$input=(select cast(key as int32) % 4 as key_quad, cast(key as int32) ?? 0 as key, cast(subkey as int32) as subkey, value from Input);
+
+SELECT
+ rank(key) over w1 as rank_key,
+ dense_rank(key) over w1 as dense_rank_key,
+ key_quad,
+ key
+FROM $input
+WINDOW w1 as (PARTITION BY key_quad ORDER BY key)
+ORDER BY rank_key, dense_rank_key, key_quad;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.cfg b/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.sql b/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.sql
new file mode 100644
index 0000000000..5153e2cca7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_rank_with_order_by_aggr_key.sql
@@ -0,0 +1,9 @@
+use plato;
+
+select
+ key,
+ RANK() over w
+from Input
+group by key
+WINDOW w as (order by key)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.cfg b/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.sql b/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.sql
new file mode 100644
index 0000000000..c4ccbc43be
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_spec_with_part.sql
@@ -0,0 +1,14 @@
+/* postgres can not */
+$input=(select cast(key as int32) / 100 as key_hundred, cast(key as int32) as key, cast(subkey as int32) as subkey, value from plato.Input);
+
+select
+ key_hundred,
+ key,
+ (key - lag(key, 1) over w) as key_diff,
+ (subkey - lag(subkey, 1) over w) as subkey_diff,
+ row_number() over w as row,
+ value
+from $input
+window w as (partition by key_hundred order by key, value)
+order by key_hundred, key, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_special.cfg b/yql/essentials/tests/sql/suites/window/win_func_special.cfg
new file mode 100644
index 0000000000..3df7813790
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_special.cfg
@@ -0,0 +1 @@
+in Input input_intersect.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_func_special.sql b/yql/essentials/tests/sql/suites/window/win_func_special.sql
new file mode 100644
index 0000000000..1dd68979b3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_special.sql
@@ -0,0 +1,11 @@
+/* postgres can not */
+$input=(select cast(key as int32) as key, cast(subkey as int32) as subkey, value from plato.Input);
+
+select
+ key,
+ (key - lag(key, 1) over w) as key_diff,
+ (subkey - lag(subkey, 1) over w) as subkey_diff,
+ row_number() over w as row,
+ value
+from $input
+window w as (order by key, subkey, value);
diff --git a/yql/essentials/tests/sql/suites/window/win_func_with_group_by.sqlx b/yql/essentials/tests/sql/suites/window/win_func_with_group_by.sqlx
new file mode 100644
index 0000000000..4d4d238324
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_with_group_by.sqlx
@@ -0,0 +1,12 @@
+/* postgres can not */
+USE plato;
+
+--INSERT INTO Output
+SELECT
+ RANK(), -- unable to use window function with GROUP BY
+ key
+FROM
+ Input as zz
+GROUP BY
+ key
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_with_struct_access.sql b/yql/essentials/tests/sql/suites/window/win_func_with_struct_access.sql
new file mode 100644
index 0000000000..47c0a0001e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_with_struct_access.sql
@@ -0,0 +1,21 @@
+/* postgres can not */
+USE plato;
+
+$input=(SELECT
+ Cast(key as int32) / 100 as key_hundred,
+ AsStruct(
+ Cast(key as int32) as key,
+ Cast(subkey as int32) as subkey
+ ) as `struct`,
+ value
+FROM Input as inSrc);
+
+--INSERT INTO Output
+SELECT
+ key_hundred as a_part,
+ `struct`.key - lead(`struct`.key, 1) over w as keyDiff,
+ value
+FROM $input as outSrc
+WINDOW w as (partition by key_hundred ORDER BY `struct`.key, value)
+ORDER by a_part, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_func_with_struct_access_full_access.sql b/yql/essentials/tests/sql/suites/window/win_func_with_struct_access_full_access.sql
new file mode 100644
index 0000000000..49642a734e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_func_with_struct_access_full_access.sql
@@ -0,0 +1,21 @@
+/* postgres can not */
+USE plato;
+
+$input=(SELECT
+ Cast(key as int32) / 100 as key_hundred,
+ AsStruct(
+ Cast(key as int32) as key,
+ Cast(subkey as int32) as subkey
+ ) as `struct`,
+ value
+FROM Input as inSrc);
+
+--INSERT INTO Output
+SELECT
+ key_hundred as a_part,
+ `struct`.key - lead(outSrc.`struct`.key, 1) over w as keyDiff,
+ value
+FROM $input as outSrc
+WINDOW w as (partition by key_hundred ORDER BY `struct`.key, value)
+ORDER by a_part, value
+;
diff --git a/yql/essentials/tests/sql/suites/window/win_fuse_window.sql b/yql/essentials/tests/sql/suites/window/win_fuse_window.sql
new file mode 100644
index 0000000000..644031aeaf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_fuse_window.sql
@@ -0,0 +1,25 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$data = (select unwrap(cast(key as uint32)) as key, unwrap(cast(subkey as uint32)) as subkey, value, value || value as unused from Input4);
+
+insert into @data
+select * from $data;
+
+commit;
+
+select
+ key, subkey,
+ FIRST_VALUE(value) over w1 as w1_first_value,
+ SUM(subkey) over w2 as w2_sum_subkey,
+ LAST_VALUE(value) over w3 as w3_last_value,
+ SUM(key) over w4 as w4_sum_key,
+ LEAD(value) over w5 as w5_next_value,
+from @data
+window
+ w1 as (partition by subkey, key order by value),
+ w2 as (order by key,subkey rows unbounded preceding),
+ w3 as (partition by key, subkey order by value rows unbounded preceding), -- = w1
+ w4 as (order by key,subkey rows between unbounded preceding and current row), -- = w2
+ w5 as (partition by subkey, key order by value rows between unbounded preceding and current row) -- = w1
+order by key, subkey;
diff --git a/yql/essentials/tests/sql/suites/window/win_group_peephole.sql b/yql/essentials/tests/sql/suites/window/win_group_peephole.sql
new file mode 100644
index 0000000000..7997aa0940
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_group_peephole.sql
@@ -0,0 +1,19 @@
+/* syntax version 1 */
+/* postgres can not */
+
+
+$t = SELECT 'john' as name, 42 as age;
+
+SELECT
+ SUM(age) OVER w0 AS sumAge,
+ LEAD(age,1) OVER w1 AS nextAge,
+ LAG(age,1) OVER w1 AS prevAge,
+ RANK() OVER w0 as rank,
+ DENSE_RANK() OVER w0 as dense_rank,
+ ROW_NUMBER() OVER w1 as row_number,
+FROM $t AS u
+WINDOW
+ w0 AS (ORDER BY name),
+ w1 AS ()
+;
+
diff --git a/yql/essentials/tests/sql/suites/window/win_inline_spec.sql b/yql/essentials/tests/sql/suites/window/win_inline_spec.sql
new file mode 100644
index 0000000000..b881a07689
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_inline_spec.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+select
+ key,
+ max(key) over (order by key) as running_max,
+ lead(key) over (order by key rows unbounded preceding) as next_key,
+ aggregate_list(key) over w as keys,
+from plato.Input
+window w as (order by key rows between unbounded preceding and current row)
+order by key;
diff --git a/yql/essentials/tests/sql/suites/window/win_lead_in_mem.sql b/yql/essentials/tests/sql/suites/window/win_lead_in_mem.sql
new file mode 100644
index 0000000000..ae78304cbd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_lead_in_mem.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+USE plato;
+
+$list = (select item FROM (select AsList('foo', 'bar', 'baz', 'quux', 'bat') as `list`) FLATTEN BY `list` as item);
+
+--INSERT INTO Output
+SELECT
+ item, YQL::Concat('+', Lead(item, 1) over w), YQL::Concat("++", Lead(item,2) over w)
+FROM $list
+WINDOW w as ();
diff --git a/yql/essentials/tests/sql/suites/window/win_multiaggr.sql b/yql/essentials/tests/sql/suites/window/win_multiaggr.sql
new file mode 100644
index 0000000000..4d641e8a53
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_multiaggr.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+select MULTI_AGGREGATE_BY(AsStruct(subkey as a,value as b), AGGREGATION_FACTORY("count")) over w,
+MULTI_AGGREGATE_BY(AsStruct(subkey as a,value as b), AGGREGATION_FACTORY("max")) over w
+from Input window w as (order by key);
diff --git a/yql/essentials/tests/sql/suites/window/win_multiaggr_library.cfg b/yql/essentials/tests/sql/suites/window/win_multiaggr_library.cfg
new file mode 100644
index 0000000000..f71ef4179c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_multiaggr_library.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+file agg_factory.sql agg_factory.sql.txt
+file multiaggr_subq.sql multiaggr_subq.sql.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_multiaggr_library.sql b/yql/essentials/tests/sql/suites/window/win_multiaggr_library.sql
new file mode 100644
index 0000000000..a9f599906c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_multiaggr_library.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+pragma library('multiaggr_subq.sql');
+pragma library('agg_factory.sql');
+
+import multiaggr_subq symbols $multiaggr_win;
+
+select * from $multiaggr_win() order by rn;
diff --git a/yql/essentials/tests/sql/suites/window/win_multiaggr_list.sql b/yql/essentials/tests/sql/suites/window/win_multiaggr_list.sql
new file mode 100644
index 0000000000..5eeb21148c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_multiaggr_list.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+select MULTI_AGGREGATE_BY(AsList(subkey,value), AGGREGATION_FACTORY("count")) over w,
+MULTI_AGGREGATE_BY(AsList(subkey,value), AGGREGATION_FACTORY("max")) over w
+from Input window w as (order by key);
diff --git a/yql/essentials/tests/sql/suites/window/win_multiaggr_tuple.sql b/yql/essentials/tests/sql/suites/window/win_multiaggr_tuple.sql
new file mode 100644
index 0000000000..2384757bfb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_multiaggr_tuple.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+use plato;
+
+select MULTI_AGGREGATE_BY(AsTuple(subkey,value), AGGREGATION_FACTORY("count")) over w,
+MULTI_AGGREGATE_BY(AsTuple(subkey,value), AGGREGATION_FACTORY("max")) over w
+from Input window w as (order by key);
diff --git a/yql/essentials/tests/sql/suites/window/win_over_few_partitions.cfg b/yql/essentials/tests/sql/suites/window/win_over_few_partitions.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_few_partitions.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_over_few_partitions.sql b/yql/essentials/tests/sql/suites/window/win_over_few_partitions.sql
new file mode 100644
index 0000000000..20f59940d0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_few_partitions.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+$data = (select
+ cast(key as uint32) as age,
+ cast(key as uint32)/10 as age_decade,
+ cast(subkey as uint32) as region,
+ value as name
+from plato.Input);
+
+select
+ region, age, name, sum(age) over w1 as sum1, sum(age) over w2 as sum2
+from $data
+window
+ w1 as (partition by region order by name),
+ w2 as (partition by age_decade order by name)
+order by region, age;
diff --git a/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.cfg b/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.sql b/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.sql
new file mode 100644
index 0000000000..19bd3fe37b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_few_partitions_other.sql
@@ -0,0 +1,15 @@
+/* postgres can not */
+$input = (select cast(key as uint32) as key, cast(subkey as uint32) as subkey, value from plato.Input);
+
+select
+ subkey,
+ sum(subkey) over w2 AS x,
+ 2 * sum(key) over w1 as dbl_sum,
+ count(key) over w1 as c,
+ min(key) over w1 as mink,
+ max(key) over w1 as maxk
+from $input
+window
+ w1 as (partition by subkey order by key % 3, key),
+ w2 as (partition by key order by subkey)
+order by subkey, x, dbl_sum;
diff --git a/yql/essentials/tests/sql/suites/window/win_over_joined.cfg b/yql/essentials/tests/sql/suites/window/win_over_joined.cfg
new file mode 100644
index 0000000000..b90cccc68d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_joined.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+in Input4 input4.txt
+
diff --git a/yql/essentials/tests/sql/suites/window/win_over_joined.sql b/yql/essentials/tests/sql/suites/window/win_over_joined.sql
new file mode 100644
index 0000000000..77a93d6e2c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_over_joined.sql
@@ -0,0 +1,13 @@
+SELECT
+ r.id,
+ ROW_NUMBER() OVER w AS rank
+FROM (
+ SELECT 0 AS id
+) AS r
+JOIN (
+ SELECT 0 AS id
+) AS m
+ON r.id = m.id
+WINDOW w AS (
+ PARTITION BY r.id
+)
diff --git a/yql/essentials/tests/sql/suites/window/win_peephole.sql b/yql/essentials/tests/sql/suites/window/win_peephole.sql
new file mode 100644
index 0000000000..94c054edac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_peephole.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+
+$t = SELECT 'john' as name, 42 as age;
+
+SELECT
+ SUM(age) OVER w0 AS sumAge,
+ LEAD(age,1) OVER w0 AS nextAge,
+ LAG(age,1) OVER w0 AS prevAge,
+ RANK() OVER w0 as rank,
+ DENSE_RANK() OVER w0 as dense_rank,
+ ROW_NUMBER() OVER w0 as row_number,
+FROM $t AS u
+WINDOW
+ w0 AS (ORDER BY name)
+;
+
diff --git a/yql/essentials/tests/sql/suites/window/win_peephole_double_usage.sql b/yql/essentials/tests/sql/suites/window/win_peephole_double_usage.sql
new file mode 100644
index 0000000000..3ace3346d6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_peephole_double_usage.sql
@@ -0,0 +1,14 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$input = select * from as_table([<|key:1|>, <|key:1|>]);
+
+$src = select
+ key,
+ MIN(key) over w as curr_min
+from $input
+window w as (order by key);
+
+select * from $src
+union all
+select * from $src;
diff --git a/yql/essentials/tests/sql/suites/window/win_with_as_table.sql b/yql/essentials/tests/sql/suites/window/win_with_as_table.sql
new file mode 100644
index 0000000000..bcd5b5a3f8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_with_as_table.sql
@@ -0,0 +1,7 @@
+/* postgres can not */
+select k,
+ SUM(k) over w1 as s1,
+ SUM(k) over w2 as s2
+from as_table(AsList(AsStruct(1 as k), AsStruct(2 as k)))
+window w1 as (order by k), w2 as (order by k desc)
+order by k;
diff --git a/yql/essentials/tests/sql/suites/window/win_with_cur_row.cfg b/yql/essentials/tests/sql/suites/window/win_with_cur_row.cfg
new file mode 100644
index 0000000000..582479bcde
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_with_cur_row.cfg
@@ -0,0 +1 @@
+in Input input_tutorial_users.txt
diff --git a/yql/essentials/tests/sql/suites/window/win_with_cur_row.sql b/yql/essentials/tests/sql/suites/window/win_with_cur_row.sql
new file mode 100644
index 0000000000..15c59c9159
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/win_with_cur_row.sql
@@ -0,0 +1,8 @@
+/* postgres can not */
+$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from plato.Input);
+
+select
+ region, name, sum(age) over w1 as sum1
+from $data
+window w1 as (partition by region order by name)
+order by region, name;
diff --git a/yql/essentials/tests/sql/suites/window/yql-14179.sql b/yql/essentials/tests/sql/suites/window/yql-14179.sql
new file mode 100644
index 0000000000..79fc1bcd39
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-14179.sql
@@ -0,0 +1,7 @@
+select
+ x,
+ aggregate_list(x) over w as lst,
+from (values (1),(2),(3)) as a(x)
+window
+ w as (rows between 0 preceding and 0 preceding)
+order by x;
diff --git a/yql/essentials/tests/sql/suites/window/yql-14277.sql b/yql/essentials/tests/sql/suites/window/yql-14277.sql
new file mode 100644
index 0000000000..937dfd3d18
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-14277.sql
@@ -0,0 +1,21 @@
+/* syntax version 1 */
+$data = [
+ <|id:1, time:1, value:'a'|>,
+ <|id:1, time:2, value:null|>,
+ <|id:1, time:3, value:null|>,
+ <|id:1, time:4, value:'b'|>,
+ <|id:1, time:5, value:null|>,
+ <|id:2, time:1, value:'c'|>,
+ <|id:2, time:2, value:'d'|>,
+ <|id:2, time:3, value:null|>,
+];
+
+select
+ a.*,
+ count(value) over w1 as w1,
+ max(value) over w2 as w2,
+from
+ as_table($data) as a
+window w1 as (order by time, id),
+ w2 as (partition by id)
+order by id, time;
diff --git a/yql/essentials/tests/sql/suites/window/yql-14479.sql b/yql/essentials/tests/sql/suites/window/yql-14479.sql
new file mode 100644
index 0000000000..bb0de0cb7f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-14479.sql
@@ -0,0 +1,8 @@
+/* custom check: len(yt_res_yson[0]['Write'][0]['Data']) < 4 */
+/* ignore plan diff */
+USE plato;
+
+SELECT a.*, row_number() OVER (PARTITION BY key, subkey) as rn, TableName() as tn
+FROM Input as a
+TABLESAMPLE BERNOULLI(10.0) REPEATABLE(1)
+;
diff --git a/yql/essentials/tests/sql/suites/window/yql-14738.sql b/yql/essentials/tests/sql/suites/window/yql-14738.sql
new file mode 100644
index 0000000000..b295b092c2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-14738.sql
@@ -0,0 +1,12 @@
+/* postgres can not */
+/* syntax version 1 */
+USE plato;
+
+SELECT
+ t.*,
+ COUNT(*) OVER (PARTITION BY key || "1") as c1,
+ COUNT(*) OVER (PARTITION BY key || "2") as c2,
+ COUNT(*) OVER w as c3,
+FROM Input as t
+WINDOW w AS (PARTITION BY key || "3")
+ORDER BY subkey;
diff --git a/yql/essentials/tests/sql/suites/window/yql-15636.sql b/yql/essentials/tests/sql/suites/window/yql-15636.sql
new file mode 100644
index 0000000000..b9efdb2c56
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-15636.sql
@@ -0,0 +1,37 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+
+insert into @tmp
+select
+ Just('foo') as driver_license_pd_id,
+ 'bar' as order_id,
+ '1' as user_phone_pd_id,
+ '2' as utc_order_dttm;
+commit;
+
+
+
+SELECT
+ driver_license_pd_id,
+ user_phone_pd_id,
+ utc_order_dttm,
+ order_id,
+
+ LEAD(
+ <|"order_id": order_id, "order_dttm": utc_order_dttm|>,
+ 1
+ ) OVER (
+ PARTITION BY user_phone_pd_id
+ ORDER BY utc_order_dttm
+ ) AS next_user_order,
+
+ LEAD(
+ <|"order_id": order_id|>,
+ 1
+ ) OVER (
+ PARTITION BY driver_license_pd_id
+ ORDER BY utc_order_dttm
+ ) AS next_driver_order,
+
+FROM @tmp;
diff --git a/yql/essentials/tests/sql/suites/window/yql-18879.sql b/yql/essentials/tests/sql/suites/window/yql-18879.sql
new file mode 100644
index 0000000000..3778686fd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/window/yql-18879.sql
@@ -0,0 +1,29 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$t1 = AsList(
+ AsStruct(100 AS itemid, 20 AS duration, 2 AS start_shows, 1 AS day),
+ AsStruct(1001 AS itemid, 10 AS duration, 2 AS start_shows, 1 AS day),
+ AsStruct(134 AS itemid, 25 AS duration, 1 AS start_shows, 1 AS day),
+ AsStruct(123 AS itemid, 24 AS duration, 1 AS start_shows, 1 AS day),
+ AsStruct(23 AS itemid, 30 AS duration, 1 AS start_shows, 2 AS day),
+ AsStruct(23 AS itemid, 30 AS duration, 1 AS start_shows, 2 AS day),
+ AsStruct(1 AS itemid, 45 AS duration, 1 AS start_shows, 2 AS day),
+ AsStruct(30 AS itemid, 63 AS duration, 1 AS start_shows, 2 AS day),
+ AsStruct(53 AS itemid, 1000 AS duration, 0 AS start_shows, 2 AS day),
+);
+
+SELECT
+ PERCENT_RANK() OVER (PARTITION BY day ORDER BY start_shows DESC) AS col1,
+ SUM(start_shows) OVER (PARTITION BY day) AS col2
+FROM AS_TABLE($t1);
+
+SELECT
+ CUME_DIST() OVER (PARTITION BY day ORDER BY start_shows DESC) AS col1,
+ SUM(start_shows) OVER (PARTITION BY day) AS col2
+FROM AS_TABLE($t1);
+
+SELECT
+ NTILE(2) OVER (PARTITION BY day ORDER BY start_shows DESC) AS col1,
+ SUM(start_shows) OVER (PARTITION BY day) AS col2
+FROM AS_TABLE($t1);
diff --git a/yql/essentials/tests/sql/suites/ypath/complex.sql b/yql/essentials/tests/sql/suites/ypath/complex.sql
new file mode 100644
index 0000000000..8c8ec6cba9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/complex.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.`Input[#0:#2,"075",#7:#9,("150","2"):("150","5")]`;
diff --git a/yql/essentials/tests/sql/suites/ypath/default.cfg b/yql/essentials/tests/sql/suites/ypath/default.cfg
new file mode 100644
index 0000000000..6f99339756
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/default.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.cfg b/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.cfg
new file mode 100644
index 0000000000..1908d503d1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.cfg
@@ -0,0 +1,2 @@
+in Input dynamic.txt
+res result.txt
diff --git a/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.sql b/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.sql
new file mode 100644
index 0000000000..1f9f690313
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/direct_read_from_dynamic.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+pragma direct_read;
+SELECT * FROM plato.`Input["150"]`;
diff --git a/yql/essentials/tests/sql/suites/ypath/dynamic.txt b/yql/essentials/tests/sql/suites/ypath/dynamic.txt
new file mode 100644
index 0000000000..c2f900fd7c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/dynamic.txt
@@ -0,0 +1,7 @@
+{"key"="020";"subkey"="1";"value"="q"};
+{"key"="075";"subkey"="2";"value"="abc"};
+{"key"="075";"subkey"="3";"value"="abc"};
+{"key"="075";"subkey"="4";"value"="abc"};
+{"key"="075";"subkey"="5";"value"="abc"};
+{"key"="150";"subkey"="6";"value"="qzz"};
+{"key"="800";"subkey"="7";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/ypath/dynamic.txt.attr b/yql/essentials/tests/sql/suites/ypath/dynamic.txt.attr
new file mode 100644
index 0000000000..9e3c33c4cb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/dynamic.txt.attr
@@ -0,0 +1,33 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+ "_yql_dynamic"=%true;
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/ypath/empty_range-dynamic.cfg b/yql/essentials/tests/sql/suites/ypath/empty_range-dynamic.cfg
new file mode 100644
index 0000000000..a35dbb3169
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/empty_range-dynamic.cfg
@@ -0,0 +1,3 @@
+in Input dynamic.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/ypath/empty_range.cfg b/yql/essentials/tests/sql/suites/ypath/empty_range.cfg
new file mode 100644
index 0000000000..2c31ed76e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/empty_range.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+res result.txt
+providers yt
diff --git a/yql/essentials/tests/sql/suites/ypath/empty_range.sql b/yql/essentials/tests/sql/suites/ypath/empty_range.sql
new file mode 100644
index 0000000000..397ed970db
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/empty_range.sql
@@ -0,0 +1,2 @@
+/*ytfile can not*/
+SELECT * FROM plato.`<ranges=[]>//Input`;
diff --git a/yql/essentials/tests/sql/suites/ypath/input.txt b/yql/essentials/tests/sql/suites/ypath/input.txt
new file mode 100644
index 0000000000..b214aab0d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/input.txt
@@ -0,0 +1,10 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
+{"key"="150";"subkey"="3";"value"="iii"};
+{"key"="150";"subkey"="8";"value"="zzz"};
+{"key"="200";"subkey"="7";"value"="qqq"};
+{"key"="527";"subkey"="4";"value"="bbb"};
+{"key"="761";"subkey"="6";"value"="ccc"};
+{"key"="911";"subkey"="2";"value"="kkk"};
diff --git a/yql/essentials/tests/sql/suites/ypath/input.txt.attr b/yql/essentials/tests/sql/suites/ypath/input.txt.attr
new file mode 100644
index 0000000000..7a11b85b77
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/input.txt.attr
@@ -0,0 +1,13 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key"; ["DataType"; "String"]];
+ ["subkey"; ["DataType"; "String"]];
+ ["value"; ["DataType"; "String"]];
+ ]];
+ "SortMembers"=["key"; "subkey"];
+ "SortedBy"=["key"; "subkey"];
+ "SortDirections"=[1; 1];
+ "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]]
+ };
+}
diff --git a/yql/essentials/tests/sql/suites/ypath/limit_with_key.sql b/yql/essentials/tests/sql/suites/ypath/limit_with_key.sql
new file mode 100644
index 0000000000..7d0b726842
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/limit_with_key.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.`Input["150"]` LIMIT 2;
diff --git a/yql/essentials/tests/sql/suites/ypath/limit_with_range.sql b/yql/essentials/tests/sql/suites/ypath/limit_with_range.sql
new file mode 100644
index 0000000000..7739be5c32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/limit_with_range.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.`Input[#1:#4]` LIMIT 2;
diff --git a/yql/essentials/tests/sql/suites/ypath/multi_key.sql b/yql/essentials/tests/sql/suites/ypath/multi_key.sql
new file mode 100644
index 0000000000..ccc77294e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/multi_key.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.`Input[("150","2"):("150","5"),"075"]`;
diff --git a/yql/essentials/tests/sql/suites/ypath/multi_range.sql b/yql/essentials/tests/sql/suites/ypath/multi_range.sql
new file mode 100644
index 0000000000..ecdc211aea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/ypath/multi_range.sql
@@ -0,0 +1,3 @@
+/* syntax version 1 */
+/* postgres can not */
+SELECT * FROM plato.`Input[#0:#2,#4:#7]`; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/ya.make b/yql/essentials/tests/sql/ya.make
new file mode 100644
index 0000000000..b2b9b4089c
--- /dev/null
+++ b/yql/essentials/tests/sql/ya.make
@@ -0,0 +1,6 @@
+SUBSCRIBER(g:yql)
+
+RECURSE_FOR_TESTS(
+ sql2yql
+)
+
diff --git a/yql/essentials/tests/ya.make b/yql/essentials/tests/ya.make
new file mode 100644
index 0000000000..99a9c79f1a
--- /dev/null
+++ b/yql/essentials/tests/ya.make
@@ -0,0 +1,8 @@
+SUBSCRIBER(g:yql)
+
+RECURSE(
+ common
+ postgresql
+ sql
+)
+
diff --git a/yql/essentials/tools/pg-make-test/README.md b/yql/essentials/tools/pg-make-test/README.md
index 19084fd9c6..9e1fe97ab0 100644
--- a/yql/essentials/tools/pg-make-test/README.md
+++ b/yql/essentials/tools/pg-make-test/README.md
@@ -1,8 +1,8 @@
# pg-make-test
This tool extracts a subset of SQL statements which work as expected
-from Postgres' regression tests located in ydb/library/yql/tests/postgresql/original/cases.
-The extracted tests are normally saved into ydb/library/yql/tests/postgresql/cases.
+from Postgres' regression tests located in yql/essentials/tests/postgresql/original/cases.
+The extracted tests are normally saved into yql/essentials/tests/postgresql/cases.
The tests could optionally get patched.
For each .sql test file the tool expects a matching .out file(s) in the
diff --git a/yql/essentials/tools/pg-make-test/__main__.py b/yql/essentials/tools/pg-make-test/__main__.py
index 3750510efc..e21104e7c7 100644
--- a/yql/essentials/tools/pg-make-test/__main__.py
+++ b/yql/essentials/tools/pg-make-test/__main__.py
@@ -13,7 +13,7 @@ import click
import patch
from collections import Counter
from library.python.svn_version import svn_version
-from contrib.ydb.library.yql.tests.postgresql.common import get_out_files, Differ
+from yql.essentials.tests.postgresql.common import get_out_files, Differ
PROGRAM_NAME = "pg-make-test"
diff --git a/yql/essentials/tools/pg-make-test/ya.make b/yql/essentials/tools/pg-make-test/ya.make
index 344ea2d3d2..bbd56a1f11 100644
--- a/yql/essentials/tools/pg-make-test/ya.make
+++ b/yql/essentials/tools/pg-make-test/ya.make
@@ -11,7 +11,7 @@ PEERDIR(
contrib/python/PyYAML
contrib/python/patch
library/python/svn_version
- contrib/ydb/library/yql/tests/postgresql/common
+ yql/essentials/tests/postgresql/common
)
END()
diff --git a/yql/essentials/ya.make b/yql/essentials/ya.make
index c209762b0b..7c34bf60b7 100644
--- a/yql/essentials/ya.make
+++ b/yql/essentials/ya.make
@@ -9,6 +9,7 @@ RECURSE(
providers
public
sql
+ tests
tools
types
udfs